rivet-design 0.28.1 → 0.28.3
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/cli/commands/libraryOpen.js +1 -0
- package/dist/cli/commands/mcpServe.js +5 -1
- package/dist/cli/commands/open.js +17 -6
- package/dist/cli/commands/profile.js +8 -1
- package/dist/cli/commands/profileDisconnect.d.ts +3 -0
- package/dist/cli/commands/profileDisconnect.js +34 -0
- package/dist/cli/commands/serve.js +2 -0
- package/dist/cli/commands/shared.js +4 -1
- package/dist/cli/envelope.d.ts +1 -0
- package/dist/cli/router.js +8 -2
- package/dist/jest.globalSetup.d.ts +3 -0
- package/dist/jest.globalSetup.js +19 -0
- package/dist/library/browserLaunch.d.ts +2 -1
- package/dist/library/browserLaunch.js +3 -2
- package/dist/proxy-middleware/proxy-config.d.ts +0 -1
- package/dist/proxy-middleware/proxy-config.js +6 -34
- package/dist/routes/agentVariants.js +20 -173
- package/dist/routes/referenceProfiles.js +3 -3
- package/dist/routes/static.js +8 -2
- package/dist/server.d.ts +1 -1
- package/dist/server.js +15 -26
- package/dist/services/AuthService.js +7 -61
- package/dist/services/IntegrationsClient.d.ts +2 -1
- package/dist/services/IntegrationsClient.js +46 -20
- package/dist/services/TelemetryService.d.ts +16 -2
- package/dist/services/TelemetryService.js +18 -0
- package/dist/services/accessTokenRefresh.js +2 -2
- package/dist/services/profiles/DesignProfiles.d.ts +16 -0
- package/dist/services/profiles/DesignProfiles.js +78 -17
- package/dist/services/profiles/ProfileAnalysis.d.ts +3 -0
- package/dist/services/profiles/ProfileAnalysis.js +66 -1
- package/dist/services/profiles/ProfileImports.d.ts +2 -0
- package/dist/services/profiles/ProfileImports.js +2 -0
- package/dist/services/templates/viteReactTs.js +1 -1
- package/dist/storage/profiles/ProfileRecords.d.ts +17 -0
- package/dist/storage/profiles/ProfileRecords.js +45 -7
- package/dist/storage/profiles/migrations.d.ts +2 -2
- package/dist/storage/profiles/migrations.js +7 -0
- package/dist/storage/profiles/schema.d.ts +48 -0
- package/dist/storage/profiles/schema.js +3 -0
- package/dist/types/api-responses.d.ts +39 -0
- package/dist/types/api-responses.js +12 -1
- package/dist/types/design-profile.d.ts +12 -0
- package/dist/types/design-profile.js +10 -1
- package/dist/types/rivet-page-types.d.ts +48 -0
- package/dist/types/rivet-page-types.js +6 -0
- package/dist/utils/failureReason.js +1 -1
- package/dist/utils/hostedLogPrivacy.js +1 -1
- package/dist/utils/launchRuntime.d.ts +2 -0
- package/dist/utils/launchRuntime.js +12 -0
- package/dist/utils/rivetPage.d.ts +8 -0
- package/dist/utils/rivetPage.js +24 -0
- package/dist/utils/rivetPage.testHelpers.d.ts +6 -0
- package/dist/utils/rivetPage.testHelpers.js +18 -0
- package/dist/utils/rivetPageDocument.d.ts +7 -0
- package/dist/utils/rivetPageDocument.js +41 -0
- package/dist/utils/scriptJson.d.ts +2 -0
- package/dist/utils/scriptJson.js +9 -0
- package/dist/utils/skills/cli-guidance.d.ts +1 -1
- package/dist/utils/skills/cli-guidance.js +2 -1
- package/dist/utils/uiDistPath.d.ts +2 -0
- package/dist/utils/uiDistPath.js +22 -0
- package/package.json +8 -5
- package/src/ui/dist/assets/LibraryEntry-CSU5OJwC.js +2 -0
- package/src/ui/dist/assets/google-g-CpxN0HWb.png +0 -0
- package/src/ui/dist/assets/main-B89lcZEY.css +1 -0
- package/src/ui/dist/assets/main-DeCxjHC1.js +204 -0
- package/src/ui/dist/index.html +3 -3
- package/src/ui/dist/pages/empty-project.html +53 -0
- package/src/ui/dist/pages/rivet-page.html +53 -0
- package/dist/routes/emptyStatePage.d.ts +0 -2
- package/dist/routes/emptyStatePage.js +0 -589
- package/src/ui/dist/assets/LibraryEntry-DS6Ce0sW.js +0 -112
- package/src/ui/dist/assets/logo-animation/clasp.png +0 -0
- package/src/ui/dist/assets/logo-animation/eraser.png +0 -0
- package/src/ui/dist/assets/logo-animation/playdough.png +0 -0
- package/src/ui/dist/assets/logo-animation/sea/bubblephone.png +0 -0
- package/src/ui/dist/assets/logo-animation/sea/cart.png +0 -0
- package/src/ui/dist/assets/logo-animation/sea/chair.png +0 -0
- package/src/ui/dist/assets/logo-animation/sea/desk.png +0 -0
- package/src/ui/dist/assets/logo-animation/sea/mug.png +0 -0
- package/src/ui/dist/assets/logo-animation/sea/pitcher.png +0 -0
- package/src/ui/dist/assets/logo-animation/sea/pot.png +0 -0
- package/src/ui/dist/assets/logo-animation/sea/startac.png +0 -0
- package/src/ui/dist/assets/logo-animation/sea/terracotta-1.png +0 -0
- package/src/ui/dist/assets/logo-animation/sea/terracotta-2.png +0 -0
- package/src/ui/dist/assets/logo-animation/sea/vhsplant.png +0 -0
- package/src/ui/dist/assets/main-CQSk-6km.css +0 -1
- package/src/ui/dist/assets/main-DkKRuatC.js +0 -218
|
@@ -0,0 +1,204 @@
|
|
|
1
|
+
var Ek=e=>{throw TypeError(e)};var $y=(e,t,n)=>t.has(e)||Ek("Cannot "+n);var Z=(e,t,n)=>($y(e,t,"read from private field"),n?n.call(e):t.get(e)),rt=(e,t,n)=>t.has(e)?Ek("Cannot add the same private member more than once"):t instanceof WeakSet?t.add(e):t.set(e,n),Le=(e,t,n,r)=>($y(e,t,"write to private field"),r?r.call(e,n):t.set(e,n),n),bt=(e,t,n)=>($y(e,t,"access private method"),n);var Yp=(e,t,n,r)=>({set _(s){Le(e,t,s,n)},get _(){return Z(e,t,r)}});function e9(e,t){for(var n=0;n<t.length;n++){const r=t[n];if(typeof r!="string"&&!Array.isArray(r)){for(const s in r)if(s!=="default"&&!(s in e)){const i=Object.getOwnPropertyDescriptor(r,s);i&&Object.defineProperty(e,s,i.get?i:{enumerable:!0,get:()=>r[s]})}}}return Object.freeze(Object.defineProperty(e,Symbol.toStringTag,{value:"Module"}))}(function(){const t=document.createElement("link").relList;if(t&&t.supports&&t.supports("modulepreload"))return;for(const s of document.querySelectorAll('link[rel="modulepreload"]'))r(s);new MutationObserver(s=>{for(const i of s)if(i.type==="childList")for(const o of i.addedNodes)o.tagName==="LINK"&&o.rel==="modulepreload"&&r(o)}).observe(document,{childList:!0,subtree:!0});function n(s){const i={};return s.integrity&&(i.integrity=s.integrity),s.referrerPolicy&&(i.referrerPolicy=s.referrerPolicy),s.crossOrigin==="use-credentials"?i.credentials="include":s.crossOrigin==="anonymous"?i.credentials="omit":i.credentials="same-origin",i}function r(s){if(s.ep)return;s.ep=!0;const i=n(s);fetch(s.href,i)}})();const t9="modulepreload",n9=function(e){return"/"+e},kk={},r9=function(t,n,r){let s=Promise.resolve();if(n&&n.length>0){let o=function(d){return Promise.all(d.map(f=>Promise.resolve(f).then(p=>({status:"fulfilled",value:p}),p=>({status:"rejected",reason:p}))))};document.getElementsByTagName("link");const c=document.querySelector("meta[property=csp-nonce]"),u=(c==null?void 0:c.nonce)||(c==null?void 0:c.getAttribute("nonce"));s=o(n.map(d=>{if(d=n9(d),d in kk)return;kk[d]=!0;const f=d.endsWith(".css"),p=f?'[rel="stylesheet"]':"";if(document.querySelector(`link[href="${d}"]${p}`))return;const m=document.createElement("link");if(m.rel=f?"stylesheet":t9,f||(m.as="script"),m.crossOrigin="",m.href=d,u&&m.setAttribute("nonce",u),document.head.appendChild(m),f)return new Promise((v,_)=>{m.addEventListener("load",v),m.addEventListener("error",()=>_(new Error(`Unable to preload CSS for ${d}`)))})}))}function i(o){const c=new Event("vite:preloadError",{cancelable:!0});if(c.payload=o,window.dispatchEvent(c),!c.defaultPrevented)throw o}return s.then(o=>{for(const c of o||[])c.status==="rejected"&&i(c.reason);return t().catch(i)})};function Sg(e){return e&&e.__esModule&&Object.prototype.hasOwnProperty.call(e,"default")?e.default:e}var Dy={exports:{}},uf={},Fy={exports:{}},It={};/**
|
|
2
|
+
* @license React
|
|
3
|
+
* react.production.min.js
|
|
4
|
+
*
|
|
5
|
+
* Copyright (c) Facebook, Inc. and its affiliates.
|
|
6
|
+
*
|
|
7
|
+
* This source code is licensed under the MIT license found in the
|
|
8
|
+
* LICENSE file in the root directory of this source tree.
|
|
9
|
+
*/var Ck;function s9(){if(Ck)return It;Ck=1;var e=Symbol.for("react.element"),t=Symbol.for("react.portal"),n=Symbol.for("react.fragment"),r=Symbol.for("react.strict_mode"),s=Symbol.for("react.profiler"),i=Symbol.for("react.provider"),o=Symbol.for("react.context"),c=Symbol.for("react.forward_ref"),u=Symbol.for("react.suspense"),d=Symbol.for("react.memo"),f=Symbol.for("react.lazy"),p=Symbol.iterator;function m(L){return L===null||typeof L!="object"?null:(L=p&&L[p]||L["@@iterator"],typeof L=="function"?L:null)}var v={isMounted:function(){return!1},enqueueForceUpdate:function(){},enqueueReplaceState:function(){},enqueueSetState:function(){}},_=Object.assign,w={};function b(L,G,ue){this.props=L,this.context=G,this.refs=w,this.updater=ue||v}b.prototype.isReactComponent={},b.prototype.setState=function(L,G){if(typeof L!="object"&&typeof L!="function"&&L!=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,L,G,"setState")},b.prototype.forceUpdate=function(L){this.updater.enqueueForceUpdate(this,L,"forceUpdate")};function S(){}S.prototype=b.prototype;function E(L,G,ue){this.props=L,this.context=G,this.refs=w,this.updater=ue||v}var C=E.prototype=new S;C.constructor=E,_(C,b.prototype),C.isPureReactComponent=!0;var A=Array.isArray,T=Object.prototype.hasOwnProperty,M={current:null},O={key:!0,ref:!0,__self:!0,__source:!0};function R(L,G,ue){var te,ie={},he=null,ke=null;if(G!=null)for(te in G.ref!==void 0&&(ke=G.ref),G.key!==void 0&&(he=""+G.key),G)T.call(G,te)&&!O.hasOwnProperty(te)&&(ie[te]=G[te]);var ge=arguments.length-2;if(ge===1)ie.children=ue;else if(1<ge){for(var pe=Array(ge),Ne=0;Ne<ge;Ne++)pe[Ne]=arguments[Ne+2];ie.children=pe}if(L&&L.defaultProps)for(te in ge=L.defaultProps,ge)ie[te]===void 0&&(ie[te]=ge[te]);return{$$typeof:e,type:L,key:he,ref:ke,props:ie,_owner:M.current}}function D(L,G){return{$$typeof:e,type:L.type,key:G,ref:L.ref,props:L.props,_owner:L._owner}}function U(L){return typeof L=="object"&&L!==null&&L.$$typeof===e}function W(L){var G={"=":"=0",":":"=2"};return"$"+L.replace(/[=:]/g,function(ue){return G[ue]})}var H=/\/+/g;function Y(L,G){return typeof L=="object"&&L!==null&&L.key!=null?W(""+L.key):G.toString(36)}function J(L,G,ue,te,ie){var he=typeof L;(he==="undefined"||he==="boolean")&&(L=null);var ke=!1;if(L===null)ke=!0;else switch(he){case"string":case"number":ke=!0;break;case"object":switch(L.$$typeof){case e:case t:ke=!0}}if(ke)return ke=L,ie=ie(ke),L=te===""?"."+Y(ke,0):te,A(ie)?(ue="",L!=null&&(ue=L.replace(H,"$&/")+"/"),J(ie,G,ue,"",function(Ne){return Ne})):ie!=null&&(U(ie)&&(ie=D(ie,ue+(!ie.key||ke&&ke.key===ie.key?"":(""+ie.key).replace(H,"$&/")+"/")+L)),G.push(ie)),1;if(ke=0,te=te===""?".":te+":",A(L))for(var ge=0;ge<L.length;ge++){he=L[ge];var pe=te+Y(he,ge);ke+=J(he,G,ue,pe,ie)}else if(pe=m(L),typeof pe=="function")for(L=pe.call(L),ge=0;!(he=L.next()).done;)he=he.value,pe=te+Y(he,ge++),ke+=J(he,G,ue,pe,ie);else if(he==="object")throw G=String(L),Error("Objects are not valid as a React child (found: "+(G==="[object Object]"?"object with keys {"+Object.keys(L).join(", ")+"}":G)+"). If you meant to render a collection of children, use an array instead.");return ke}function V(L,G,ue){if(L==null)return L;var te=[],ie=0;return J(L,te,"","",function(he){return G.call(ue,he,ie++)}),te}function q(L){if(L._status===-1){var G=L._result;G=G(),G.then(function(ue){(L._status===0||L._status===-1)&&(L._status=1,L._result=ue)},function(ue){(L._status===0||L._status===-1)&&(L._status=2,L._result=ue)}),L._status===-1&&(L._status=0,L._result=G)}if(L._status===1)return L._result.default;throw L._result}var ee={current:null},F={transition:null},X={ReactCurrentDispatcher:ee,ReactCurrentBatchConfig:F,ReactCurrentOwner:M};function B(){throw Error("act(...) is not supported in production builds of React.")}return It.Children={map:V,forEach:function(L,G,ue){V(L,function(){G.apply(this,arguments)},ue)},count:function(L){var G=0;return V(L,function(){G++}),G},toArray:function(L){return V(L,function(G){return G})||[]},only:function(L){if(!U(L))throw Error("React.Children.only expected to receive a single React element child.");return L}},It.Component=b,It.Fragment=n,It.Profiler=s,It.PureComponent=E,It.StrictMode=r,It.Suspense=u,It.__SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED=X,It.act=B,It.cloneElement=function(L,G,ue){if(L==null)throw Error("React.cloneElement(...): The argument must be a React element, but you passed "+L+".");var te=_({},L.props),ie=L.key,he=L.ref,ke=L._owner;if(G!=null){if(G.ref!==void 0&&(he=G.ref,ke=M.current),G.key!==void 0&&(ie=""+G.key),L.type&&L.type.defaultProps)var ge=L.type.defaultProps;for(pe in G)T.call(G,pe)&&!O.hasOwnProperty(pe)&&(te[pe]=G[pe]===void 0&&ge!==void 0?ge[pe]:G[pe])}var pe=arguments.length-2;if(pe===1)te.children=ue;else if(1<pe){ge=Array(pe);for(var Ne=0;Ne<pe;Ne++)ge[Ne]=arguments[Ne+2];te.children=ge}return{$$typeof:e,type:L.type,key:ie,ref:he,props:te,_owner:ke}},It.createContext=function(L){return L={$$typeof:o,_currentValue:L,_currentValue2:L,_threadCount:0,Provider:null,Consumer:null,_defaultValue:null,_globalName:null},L.Provider={$$typeof:i,_context:L},L.Consumer=L},It.createElement=R,It.createFactory=function(L){var G=R.bind(null,L);return G.type=L,G},It.createRef=function(){return{current:null}},It.forwardRef=function(L){return{$$typeof:c,render:L}},It.isValidElement=U,It.lazy=function(L){return{$$typeof:f,_payload:{_status:-1,_result:L},_init:q}},It.memo=function(L,G){return{$$typeof:d,type:L,compare:G===void 0?null:G}},It.startTransition=function(L){var G=F.transition;F.transition={};try{L()}finally{F.transition=G}},It.unstable_act=B,It.useCallback=function(L,G){return ee.current.useCallback(L,G)},It.useContext=function(L){return ee.current.useContext(L)},It.useDebugValue=function(){},It.useDeferredValue=function(L){return ee.current.useDeferredValue(L)},It.useEffect=function(L,G){return ee.current.useEffect(L,G)},It.useId=function(){return ee.current.useId()},It.useImperativeHandle=function(L,G,ue){return ee.current.useImperativeHandle(L,G,ue)},It.useInsertionEffect=function(L,G){return ee.current.useInsertionEffect(L,G)},It.useLayoutEffect=function(L,G){return ee.current.useLayoutEffect(L,G)},It.useMemo=function(L,G){return ee.current.useMemo(L,G)},It.useReducer=function(L,G,ue){return ee.current.useReducer(L,G,ue)},It.useRef=function(L){return ee.current.useRef(L)},It.useState=function(L){return ee.current.useState(L)},It.useSyncExternalStore=function(L,G,ue){return ee.current.useSyncExternalStore(L,G,ue)},It.useTransition=function(){return ee.current.useTransition()},It.version="18.3.1",It}var Pk;function Q2(){return Pk||(Pk=1,Fy.exports=s9()),Fy.exports}/**
|
|
10
|
+
* @license React
|
|
11
|
+
* react-jsx-runtime.production.min.js
|
|
12
|
+
*
|
|
13
|
+
* Copyright (c) Facebook, Inc. and its affiliates.
|
|
14
|
+
*
|
|
15
|
+
* This source code is licensed under the MIT license found in the
|
|
16
|
+
* LICENSE file in the root directory of this source tree.
|
|
17
|
+
*/var Ak;function i9(){if(Ak)return uf;Ak=1;var e=Q2(),t=Symbol.for("react.element"),n=Symbol.for("react.fragment"),r=Object.prototype.hasOwnProperty,s=e.__SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED.ReactCurrentOwner,i={key:!0,ref:!0,__self:!0,__source:!0};function o(c,u,d){var f,p={},m=null,v=null;d!==void 0&&(m=""+d),u.key!==void 0&&(m=""+u.key),u.ref!==void 0&&(v=u.ref);for(f in u)r.call(u,f)&&!i.hasOwnProperty(f)&&(p[f]=u[f]);if(c&&c.defaultProps)for(f in u=c.defaultProps,u)p[f]===void 0&&(p[f]=u[f]);return{$$typeof:t,type:c,key:m,ref:v,props:p,_owner:s.current}}return uf.Fragment=n,uf.jsx=o,uf.jsxs=o,uf}var Tk;function o9(){return Tk||(Tk=1,Dy.exports=i9()),Dy.exports}var P=o9();const a9="x-rivet-editor-token",Rk="editorToken",l9=["/api/account","/api/config","/api/auth/store","/api/auth/logout","/api/library/browser-launches","/api/integrations","/api/reference-profiles"],c9=/^\/api\/variants\/(?:[^/]+\/static\/|history\/[^/]+\/[^/]+\/(?:preview(?:\/|$)|site\/)|[^/]+\/[^/]+\/references\/[^/]+\/image\/?$)/,u9=(e,t="GET")=>{const n=e.split(/[?#]/)[0].toLowerCase();return/^\/api\/variants(?:\/|$)/.test(n)?!["GET","HEAD"].includes(t.toUpperCase())||!c9.test(n):l9.some(r=>n===r||n.startsWith(`${r}/`))},R_="rivet_editor_token";let I_;const d9=()=>{if(window.location.pathname.startsWith("/rivet/library"))return;const e=new URLSearchParams(window.location.hash.slice(1)),t=e.get(Rk);if(t===null)return;I_=t||null,e.delete(Rk);const n=e.toString();window.history.replaceState(null,"",`${window.location.pathname}${window.location.search}${n?`#${n}`:""}`);try{t?window.sessionStorage.setItem(R_,t):window.sessionStorage.removeItem(R_)}catch{}},f9=()=>{if(I_!==void 0)return I_;try{return window.sessionStorage.getItem(R_)}catch{return null}};var g=Q2();const Ee=Sg(g),bd=e9({__proto__:null,default:Ee},[g]);var h9={};const le="u">typeof window?window:void 0,ns="u">typeof globalThis?globalThis:le,Fr=ns==null?void 0:ns.navigator,Ie=ns==null?void 0:ns.document,cn=ns==null?void 0:ns.location,ih=ns==null?void 0:ns.fetch,X2=ns!=null&&ns.XMLHttpRequest&&"withCredentials"in new ns.XMLHttpRequest?ns.XMLHttpRequest:void 0,Ik=ns==null?void 0:ns.AbortController,p9=ns==null?void 0:ns.CompressionStream,ds=Fr==null?void 0:Fr.userAgent,df=typeof globalThis<"u"?globalThis:le;df&&typeof self>"u"&&(df.self=df),df&&typeof File>"u"&&(df.File=function(){});const et=le??{},m9="0.10.7",Xo={DEBUG:!1,LIB_VERSION:m9,LIB_NAME:"browser-common"};var so=(function(e){return e.AnonymousId="anonymous_id",e.DistinctId="distinct_id",e.Props="props",e.EnablePersonProcessing="enable_person_processing",e.PersonMode="person_mode",e.FeatureFlagDetails="feature_flag_details",e.FeatureFlags="feature_flags",e.FeatureFlagPayloads="feature_flag_payloads",e.BootstrapFeatureFlagDetails="bootstrap_feature_flag_details",e.BootstrapFeatureFlags="bootstrap_feature_flags",e.BootstrapFeatureFlagPayloads="bootstrap_feature_flag_payloads",e.OverrideFeatureFlags="override_feature_flags",e.Queue="queue",e.AiQueue="ai_queue",e.AiCaptureQueue="ai_capture_queue",e.LogsQueue="logs_queue",e.OptedOut="opted_out",e.SessionId="session_id",e.SessionStartTimestamp="session_start_timestamp",e.SessionLastTimestamp="session_timestamp",e.PersonProperties="person_properties",e.GroupProperties="group_properties",e.InstalledAppBuild="installed_app_build",e.InstalledAppVersion="installed_app_version",e.SessionReplay="session_replay",e.PushRegistered="push_registered",e.SessionReplayEventTriggerActivatedSession="session_replay_event_trigger_activated_session",e.SurveyLastSeenDate="survey_last_seen_date",e.SurveysInProgress="surveys_in_progress",e.SurveysSeen="surveys_seen",e.Surveys="surveys",e.RemoteConfig="remote_config",e.FlagsEndpointWasHit="flags_endpoint_was_hit",e.DeviceId="device_id",e})({}),O_=(function(e){return e.GZipJS="gzip-js",e.Base64="base64",e})({});const g9=["$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"],v9=["token"];function We(e,t){return e.indexOf(t)!==-1}const Xu=function(e){return e.trim()},M_=function(e){return e.replace(/^\$/,"")};function hT(e){var t;const n=[];return(t=JSON.stringify(e,function(r,s){if(typeof s=="bigint")return s.toString();if(typeof s!="function"&&typeof s!="symbol"){if(s instanceof Error)return{name:s.name,message:s.message,stack:s.stack};if(s&&typeof s=="object"){for(;n.length>0&&n[n.length-1]!==this;)n.pop();if(n.includes(s))return"[Circular]";n.push(s)}return s}}))!==null&&t!==void 0?t:"null"}const pT=Object.prototype,J2=pT.hasOwnProperty,Eg=pT.toString,He=Array.isArray||function(e){return Eg.call(e)==="[object Array]"},Mn=e=>typeof e=="function",lt=e=>e===Object(e)&&!He(e),Ps=e=>{if(lt(e)){for(const t in e)if(J2.call(e,t))return!1;return!0}return!1},ce=e=>e===void 0,dt=e=>Eg.call(e)=="[object String]",Hf=e=>dt(e)&&e.trim().length===0,kn=e=>e===null,ot=e=>ce(e)||kn(e),Fn=e=>Eg.call(e)=="[object Number]"&&e==e,zo=e=>Fn(e)&&e>0,hs=e=>Eg.call(e)==="[object Boolean]",y9=e=>We(g9,e),_9=e=>We(v9,e);function mT(e){return e===null||typeof e!="object"}function v0(e,t){return{}.toString.call(e)===`[object ${t}]`}function xd(e){switch({}.toString.call(e)){case"[object Error]":case"[object Exception]":case"[object DOMException]":case"[object DOMError]":case"[object WebAssembly.Exception]":return!0;default:return gT(e,Error)}}function eb(e){return"u">typeof Event&&gT(e,Event)}function gT(e,t){try{return e instanceof t}catch{return!1}}const w9=[!0,"true",1,"1","yes"],jy=e=>We(w9,e),b9=[!1,"false",0,"0","no"];function Ok(e,t,n,r,s,i,o){try{var c=e[i](o),u=c.value}catch(d){return void n(d)}c.done?t(u):Promise.resolve(u).then(r,s)}function un(e){return function(){var t=this,n=arguments;return new Promise(function(r,s){var i=e.apply(t,n);function o(u){Ok(i,r,s,o,c,"next",u)}function c(u){Ok(i,r,s,o,c,"throw",u)}o(void 0)})}}const x9=["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","pinterestbot","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","lightpanda","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"],Qp=new Map,Mk=function(e,t=[]){if(!e)return!1;const n=(function(o,c){let u="";for(let d=0;c.length>d;d++){const f=c[d];u+=f.length+":"+f}return o.length+":"+o+"|"+c.length+":"+u})(e,t),r=Qp.get(n);if(r!==void 0)return r;const s=e.toLowerCase(),i=x9.concat(t).some(o=>s.indexOf(o.toLowerCase())!==-1);return 256>Qp.size||Qp.clear(),Qp.set(n,i),i};function ho(e,t,n,r,s){return t>n&&(r.warn("min cannot be greater than max."),t=n),Fn(e)?e>n?(r.warn(" cannot be greater than max: "+n+". Using max value instead."),n):t>e?(r.warn(" cannot be less than min: "+t+". Using min value instead."),t):e:(r.warn(" must be a number. using max or fallback. max: "+n+", fallback: "+s),ho(s??n,t,n,r))}var S9=class{constructor(e){this.C={},this.I=e.I,this.R=ho(e.bucketSize,0,100,e.A),this.O=ho(e.refillRate,0,this.R,e.A),this.$=ho(e.refillInterval,0,864e5,e.A)}F(e,t){const n=Math.floor((t-e.lastAccess)/this.$);n>0&&(e.tokens=Math.min(e.tokens+n*this.O,this.R),e.lastAccess=e.lastAccess+n*this.$)}consumeRateLimit(e){var t;const n=Date.now(),r=String(e);let s=this.C[r];return s?this.F(s,n):(s={tokens:this.R,lastAccess:n},this.C[r]=s),s.tokens===0||(s.tokens--,s.tokens===0&&((t=this.I)===null||t===void 0||t.call(this,e)),s.tokens===0)}stop(){this.C={}}};const oh="Mobile",ah="Android",N_="Tablet",vT="Android Tablet",yT="iPad",_T="Apple Watch",Vm="Safari",kg="BlackBerry",wT="Samsung Internet",Hm="Chrome",bT="Chrome iOS",xT="Internet Explorer",ST="Internet Explorer Mobile",ET="Opera",kT="Microsoft Edge",Um="Firefox",CT="Firefox iOS",y0="Nintendo",_0="PlayStation",Cg="Xbox",PT="Android Mobile",AT="Mobile Safari",zy="Windows",TT="Windows Phone",Nk="Nokia",L_="Ouya",RT="Generic tablet",$_="Konqueror",IT="Oculus Browser",OT="Vivaldi",MT="Yandex",NT="Whale",LT="DuckDuckGo",$T="Pale Moon",DT="Waterfox",D_="Brave",FT="Claude",jT="Codex",zT="ChatGPT",VT="Google Search App",Vy=new RegExp("Version/(\\d+(\\.\\d+)?)"),Hy=new RegExp("(Claude|Codex|ChatGPT)\\/(\\d+(\\.\\d+)?)"),E9=new RegExp(Cg,"i"),k9=new RegExp("PlayStation \\w+","i"),C9=new RegExp("Nintendo \\w+","i"),tb=new RegExp("BlackBerry|PlayBook|BB10","i"),P9={"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"},HT=function(e,t,n,r){return t=t||"",(function(i){return i!=null&&i.brave?D_:null})(n)||(r!=null&&r.detectGoogleSearchApp&&We(e,"GSA/")?VT:We(e," OPR/")&&We(e,"Mini")?"Opera Mini":We(e," OPR/")?ET:tb.test(e)?kg:We(e,"IEMobile")||We(e,"WPDesktop")?ST:We(e,"OculusBrowser")?IT:We(e,"SamsungBrowser")?wT:We(e,"Edge")||We(e,"Edg/")?kT:We(e,"Vivaldi/")?OT:We(e,"YaBrowser/")?MT:We(e,"Whale/")?NT:We(e,"DuckDuckGo/")||We(e,"Ddg/")?LT:We(e,"Claude/")?FT:We(e,"Codex/")?jT:We(e,"ChatGPT/")?zT:We(e,"FBIOS")?"Facebook Mobile":We(e,"UCWEB")||We(e,"UCBrowser")?"UC Browser":We(e,"CriOS")?bT:We(e,"CrMo")||We(e,Hm)?Hm:We(e,ah)&&We(e,Vm)?PT:We(e,"FxiOS")?CT:We(e.toLowerCase(),$_.toLowerCase())?$_:We(e,"Brave/")?D_:((i,o)=>o&&We(o,"Apple")||(function(c){return We(c,Vm)&&!We(c,Hm)&&!We(c,ah)})(i))(e,t)?We(e,oh)?AT:Vm:We(e,"PaleMoon/")?$T:We(e,"Waterfox/")?DT:We(e,Um)?Um:We(e,"MSIE")||We(e,"Trident/")?xT:We(e,"Gecko")?Um:"")},A9={[ST]:[new RegExp("rv:(\\d+(\\.\\d+)?)")],[kT]:[new RegExp("Edge?\\/(\\d+(\\.\\d+)?)")],[Hm]:[new RegExp("(Chrome|CrMo)\\/(\\d+(\\.\\d+)?)")],[bT]:[new RegExp("CriOS\\/(\\d+(\\.\\d+)?)")],"UC Browser":[new RegExp("(UCBrowser|UCWEB)\\/(\\d+(\\.\\d+)?)")],[Vm]:[Vy],[AT]:[Vy],[ET]:[new RegExp("(Opera|OPR)\\/(\\d+(\\.\\d+)?)")],[Um]:[new RegExp("Firefox\\/(\\d+(\\.\\d+)?)")],[CT]:[new RegExp("FxiOS\\/(\\d+(\\.\\d+)?)")],[$_]:[new RegExp("Konqueror[:/]?(\\d+(\\.\\d+)?)","i")],[kg]:[new RegExp("BlackBerry (\\d+(\\.\\d+)?)"),Vy],[PT]:[new RegExp("android\\s(\\d+(\\.\\d+)?)","i")],[wT]:[new RegExp("SamsungBrowser\\/(\\d+(\\.\\d+)?)")],[IT]:[new RegExp("OculusBrowser\\/(\\d+(\\.\\d+)?)")],[OT]:[new RegExp("Vivaldi\\/(\\d+(\\.\\d+)?)")],[MT]:[new RegExp("YaBrowser\\/(\\d+(\\.\\d+)?)")],[NT]:[new RegExp("Whale\\/(\\d+(\\.\\d+)?)")],[D_]:[new RegExp("Brave\\/(\\d+(\\.\\d+)?)")],[FT]:[Hy],[jT]:[Hy],[zT]:[Hy],[LT]:[new RegExp("(DuckDuckGo|Ddg)\\/(\\d+(\\.\\d+)?)")],[$T]:[new RegExp("PaleMoon\\/(\\d+(\\.\\d+)?)")],[DT]:[new RegExp("Waterfox\\/(\\d+(\\.\\d+)?)")],[VT]:[new RegExp("GSA\\/(\\d+(\\.\\d+)?)")],[xT]:[new RegExp("(rv:|MSIE )(\\d+(\\.\\d+)?)")],Mozilla:[new RegExp("rv:(\\d+(\\.\\d+)?)")]},T9=function(e,t,n,r){const s=HT(e,t,n,r),i=A9[s];if(ce(i))return null;for(let o=0;i.length>o;o++){const c=e.match(i[o]);if(c)return parseFloat(c[c.length-2])}return null},Lk=[[new RegExp("Xbox; Xbox (.*?)[);]","i"),e=>[Cg,e&&e[1]||""]],[new RegExp(y0,"i"),[y0,""]],[new RegExp(_0,"i"),[_0,""]],[tb,[kg,""]],[new RegExp(zy,"i"),(e,t)=>{if(/Phone/.test(t)||/WPDesktop/.test(t))return[TT,""];if(new RegExp(oh).test(t)&&!/IEMobile\b/.test(t))return["Windows Mobile",""];const n=/Windows NT ([0-9.]+)/i.exec(t);if(n&&n[1]){let r=P9[n[1]]||"";return/arm/i.test(t)&&(r="RT"),[zy,r]}return[zy,""]}],[/((iPhone|iPad|iPod).*?OS (\d+)_(\d+)_?(\d+)?|iPhone)/,e=>e&&e[3]?["iOS",[e[3],e[4],e[5]||"0"].join(".")]:["iOS",""]],[/(watch.*\/(\d+\.\d+\.\d+)|watch os,(\d+\.\d+),)/i,e=>{let t="";return e&&e.length>=3&&(t=ce(e[2])?e[3]:e[2]),["watchOS",t]}],[new RegExp("(Android (\\d+)\\.(\\d+)\\.?(\\d+)?|Android)","i"),e=>e&&e[2]?[ah,[e[2],e[3],e[4]||"0"].join(".")]:[ah,""]],[/Mac OS X (\d+)[_.](\d+)[_.]?(\d+)?/i,e=>{const t=["Mac OS X",""];return e&&e[1]&&(t[1]=[e[1],e[2],e[3]||"0"].join(".")),t}],[/Mac/i,["Mac OS X",""]],[/CrOS/,["Chrome OS",""]],[/Linux|debian/i,["Linux",""]]],UT=function(e){for(let t=0;Lk.length>t;t++){const[n,r]=Lk[t],s=n.exec(e),i=s&&(Mn(r)?r(s,e):r);if(i)return i}return["",""]},ZT=function(e){return C9.test(e)?y0:k9.test(e)?_0:E9.test(e)?Cg:new RegExp(L_,"i").test(e)?L_:new RegExp("(Windows Phone|WPDesktop)","i").test(e)?TT:/iPad/.test(e)?yT:/iPod/.test(e)?"iPod Touch":/iPhone/.test(e)?"iPhone":/(watch)(?: ?os[,/]|\d,\d\/)[\d.]+/i.test(e)?_T:tb.test(e)?kg:/(kobo)\s(ereader|touch)/i.test(e)?"Kobo":new RegExp(Nk,"i").test(e)?Nk:/(kf[a-z]{2}wi|aeo[c-r]{2})( bui|\))/i.test(e)||/(kf[a-z]+)( bui|\)).+silk\//i.test(e)?"Kindle Fire":/(Android|ZTE)/i.test(e)?new RegExp(oh).test(e)&&!/(9138B|TB782B|Nexus [97]|pixel c|HUAWEISHT|BTV|noble nook|smart ultra 6)/i.test(e)||/pixel[\daxl ]{1,6}/i.test(e)&&!/pixel c/i.test(e)||/(huaweimed-al00|tah-|APA|SM-G92|i980|zte|U304AA)/i.test(e)||/lmy47v/i.test(e)&&!/QTAQZ3/i.test(e)?ah:vT:new RegExp("(pda|Mobile)","i").test(e)?"Generic mobile":new RegExp(N_,"i").test(e)&&!new RegExp("Tablet pc","i").test(e)?RT:""},R9=function(e,t){var n;const r=ZT(e);return r===yT||r===vT||r==="Kobo"||r==="Kindle Fire"||r===RT?N_:r===y0||r===Cg||r===_0||r===L_?"Console":r===_T?"Wearable":r?oh:(t==null?void 0:t.userAgentDataPlatform)==="Android"&&((n=t==null?void 0:t.maxTouchPoints)!==null&&n!==void 0?n:0)>0?600>Math.min((s=t==null?void 0:t.screenWidth)!==null&&s!==void 0?s:0,(i=t==null?void 0:t.screenHeight)!==null&&i!==void 0?i:0)/((o=t==null?void 0:t.devicePixelRatio)!==null&&o!==void 0?o:1)?oh:N_:"Desktop";var s,i,o},Uy=/\bFBAV\/(\d+(?:\.\d+)*)/i,$k=[[/\bInstagram(?:[ /](\d+(?:\.\d+)*))?\b/i,"Instagram"],[/\bBarcelona[ /](\d+(?:\.\d+)*)?/i,"Threads"],[/\b(?:MessengerForiOS|(?:FBAN|FB_IAB)\/Orca-Android)\b/i,"Messenger",Uy],[/\bFBAN\/EMA\b/i,"Facebook Lite",Uy],[/\b(?:FBIOS|(?:FBAN|FB_IAB)\/(?:FB4A|FBIOS))\b/i,"Facebook",Uy],[/\bLinkedInApp(?:\]?\/(\d+(?:\.\d+)*))?\b/i,"LinkedIn"],[/\bTwitter(?:Android| for (?:iPhone|iPad|Android))(?:\/(\d+(?:\.\d+)*))?\b/i,"Twitter"],[/\b(?:musical_ly|trill)(?:[_/](\d+\.\d+(?:\.\d+)*))?(?=\b|_)/i,"TikTok",/\bapp_version\/(\d+(?:\.\d+)*)/i],[/\b(?:MicroMessenger|WeChat)\/(\d+(?:\.\d+)*)?/i,"WeChat"],[/\bLine\/(\d+(?:\.\d+)*)?/i,"Line"],[/\bGSA\/(\d+(?:\.\d+)*)?/i,"Google"],[/\[Pinterest\/(?:iOS|Android)\b|\bPinterest(?: for (?:Android(?: Tablet)?|iOS))?\/(\d+(?:\.\d+)*)/i,"Pinterest"],[/\b(?:WA4A|WAiOS)\/(\d+(?:\.\d+)*)?/i,"WhatsApp"],[/\bSnapchat[ /](\d+(?:\.\d+)*)?/i,"Snapchat"],[/\bBing(?:Web|Sapphire)\/(\d+(?:\.\d+)*)?/i,"Bing"],[/\bNAVER\(inapp; search;/i,"Naver",/\bNAVER\(inapp; search;[^;)]*; (\d+(?:\.\d+)*)/i],[/\bKAKAOTALK[ /](\d+\.\d+(?:\.\d+)*)?/i,"KakaoTalk"]],F_="[Truncated]",Uh="[Unserializable]";function Tu(e){let t="";for(let n=0;e.length>n;n++){const r=e.charCodeAt(n);if(55296>r||r>56319)t+=56320>r||r>57343?e[n]:"�";else{const s=e.charCodeAt(n+1);56320>s||s>57343?t+="�":(t+=e[n]+e[n+1],n++)}}return t}function BT(e,t){if(!t)return e;let n=[];try{n=Object.keys(t)}catch{n=[]}for(const r of n){let s;try{s=t[r]}catch{s=Uh}Object.defineProperty(e,r,{value:s,enumerable:!0,writable:!0,configurable:!0})}return e}const Zy=3e5;var WT=class{record(e){if(e.kind==="too-large")return;if(e.kind!=="retry-later")return void this.reset();if(!e.retryAfterMs)return;const t=this.isOpen(),n=Date.now(),r=Math.min(e.retryAfterMs,Zy);if(!t)return this.ts=n,void(this.es=n+r);this.es=Math.max(this.es,Math.min(n+r,this.ts+Zy))}remainingMs(){const e=Date.now();if(this.ts-5e3>e)return this.reset(),0;const t=Math.min(Zy,Math.max(0,this.es-e));return t===0&&this.reset(),t}isOpen(){return this.remainingMs()>0}reset(){this.es=0,this.ts=0}constructor(){this.es=0,this.ts=0}};const I9=/^[0-9a-f]{8}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{12}$/i;function Dk(e,t){return typeof(n=e)=="string"&&I9.test(n)?e:t();var n}function KT(e,t){const n=new Error(t);try{Object.defineProperty(n,"name",{value:e,writable:!0,enumerable:!0,configurable:!0})}catch{}return n}function nl(e){return e&&e.split("#")[0]}function Fk(e){try{return e()}catch{return}}function GT(e,t){const n=setTimeout(e,t);return n!=null&&n.unref&&(n==null||n.unref()),n}function jk(e,t,n){return qT.apply(this,arguments)}function qT(){return(qT=un(function*(e,t,n){let r;try{return yield Promise.race([e,new Promise((s,i)=>{r=GT(()=>{try{n==null||n(),s()}catch(o){i(o)}},t)})])}finally{clearTimeout(r)}})).apply(this,arguments)}function Uf(e){return Uf=typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?function(t){return typeof t}:function(t){return t&&typeof Symbol=="function"&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t},Uf(e)}function O9(e,t,n){return(t=(function(r){var s=(function(i){if(Uf(i)!="object"||!i)return i;var o=i[Symbol.toPrimitive];if(o!==void 0){var c=o.call(i,"string");if(Uf(c)!="object")return c;throw new TypeError("@@toPrimitive must return a primitive value.")}return String(i)})(r);return Uf(s)=="symbol"?s:s+""})(t))in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function zk(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter(function(s){return Object.getOwnPropertyDescriptor(e,s).enumerable})),n.push.apply(n,r)}return n}function $(e){for(var t=1;arguments.length>t;t++){var n=arguments[t]!=null?arguments[t]:{};t%2?zk(Object(n),!0).forEach(function(r){O9(e,r,n[r])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):zk(Object(n)).forEach(function(r){Object.defineProperty(e,r,Object.getOwnPropertyDescriptor(n,r))})}return e}let ff,Vk,Hk,Jc;function M9(e){var t;const n=globalThis._posthogChunkIds,r=globalThis._debugIds;if(!n&&!r)return;const s=n?Object.keys(n):[],i=r?Object.keys(r):[];if(Jc&&Uk(n,s,Vk)&&Uk(r,i,Hk))return Jc;Vk=n?$({},n):void 0,Hk=r?$({},r):void 0,Jc={},(t=ff)!==null&&t!==void 0||(ff={});const o=(c,u)=>{for(const f of c){const p=u[f];if(!p)continue;const m=ff==null?void 0:ff[f];if(m){Jc[m]=p;continue}const v=e(f);for(let _=v.length-1;_>=0;_--){var d;const w=(d=v[_])===null||d===void 0?void 0:d.filename;if(w){Jc[w]=p,ff[f]=w;break}}}};return r&&o(i,r),n&&o(s,n),Jc}function Uk(e,t,n){return e&&n?t.length===Object.keys(n).length&&t.every(r=>e[r]===n[r]):e===n}var N9=class{constructor(e,t,n=[]){this.coercers=e,this.stackParser=t,this.modifiers=n}buildFromUnknown(e,t={}){const n=t&&t.mechanism||{handled:!0,type:"generic"},r=this.buildCoercingContext(n,t,0).apply(e),s=this.buildParsingContext(t),i=this.parseStacktrace(r,s);return{$exception_list:this.convertToExceptionList(i,n),$exception_level:"error"}}modifyFrames(e){var t=this;return un(function*(){for(const n of e)n.stacktrace&&n.stacktrace.frames&&He(n.stacktrace.frames)&&(n.stacktrace.frames=yield t.applyModifiers(n.stacktrace.frames));return e})()}coerceFallback(e){var t;return{type:"Error",value:"Unknown error",stack:(t=e.syntheticException)===null||t===void 0?void 0:t.stack,synthetic:!0}}parseStacktrace(e,t){var n;let r,s;if(e.cause!=null&&(r=this.parseStacktrace(e.cause,t)),e.stack!=""&&e.stack!=null)try{s=this.applyChunkIds(this.stackParser(e.stack,e.synthetic?t.skipFirstLines:0),t.chunkIdMap)}catch{}return $($({},e),{},{cause:r,stack:s,errors:(n=e.errors)===null||n===void 0?void 0:n.map(i=>this.parseStacktrace(i,t))})}applyChunkIds(e,t){return e.map(n=>(n.filename&&t&&(n.chunk_id=t[n.filename]),n))}applyCoercers(e,t){for(const n of this.coercers)if(n.match(e))return n.coerce(e,t);return this.coerceFallback(t)}applyModifiers(e){var t=this;return un(function*(){let n=e;for(const r of t.modifiers)n=yield r(n);return n})()}convertToExceptionList(e,t){const n=[],r=(s,i,o)=>{var c;const u=n.length,d=i===void 0?$($({type:typeof t.type=="string"&&t.type.length>0?t.type:"generic"},typeof t.handled=="boolean"?{handled:t.handled}:t.handled===void 0?{handled:!0}:{}),{},{synthetic:typeof t.synthetic=="boolean"?t.synthetic:s.synthetic,exception_id:u}):{type:"chained",source:o,synthetic:s.synthetic,exception_id:u,parent_id:i},f={type:s.type,value:s.value,mechanism:d};s.stack&&(f.stacktrace={type:"raw",frames:s.stack}),n.push(f),s.cause&&r(s.cause,u,"cause");for(const p of(c=s.errors)!==null&&c!==void 0?c:[])r(p,u,"member")};return r(e),n}buildParsingContext(e){var t;return{chunkIdMap:M9(this.stackParser),skipFirstLines:(t=e.skipFirstLines)!==null&&t!==void 0?t:1}}getAggregateErrors(e){try{if(xd(e)){let n=Object.getPrototypeOf(e);for(let r=0;n&&100>r;r++){var t;const s=(t=Object.getOwnPropertyDescriptor(n,"constructor"))===null||t===void 0?void 0:t.value;if(typeof s=="function"&&s.name==="AggregateError"){const i=e.errors;return He(i)?i:void 0}n=Object.getPrototypeOf(n)}}}catch{}}buildCoercingContext(e,t,n=0){let r=0,s=0,i=!1;const o=new Set,c=[],u={},d=(m,v,_=0)=>{const w=f(v,_),b=w.apply;if(w.apply=M=>{c.push(m);try{return b(M)}finally{c.pop()}},_>4||_>0&&c.indexOf(m)!==-1)return this.coerceFallback(w);const S=typeof m=="object"&&m!==null||typeof m=="function";if(_===0&&r>=50||S&&o.has(m))return;S&&o.add(m),_===0&&r++;const E=this.getAggregateErrors(m);let C,A;i||(i=!!E);try{if(C=this.applyCoercers(m,w),!C)throw u}catch(M){if(M===u)return void(_===0&&r--);if(!i)throw M;C=this.coerceFallback(w)}if(!E||r>=50)return C;try{A=E.length}catch{return C}if(!Number.isInteger(A)||0>A||A>4294967295)return C;const T=[];for(let M=0;50>r&&1e3>s&&A>M;M++){let O;s++;try{O=w.next(E[M])}catch{r++,O=this.coerceFallback(f(v+1))}O&&T.push(O)}return $($({},C),{},{errors:T})},f=(m,v=0)=>$($({},t),{},{syntheticException:m==0?t.syntheticException:void 0,mechanism:m==0?e:{},apply(_){const w=d(_,m,v+1);if(!w)throw u;return w},next:_=>d(_,m+1)}),p=f(n);return $($({},p),{},{apply:m=>{var v;return(v=d(m,n))!==null&&v!==void 0?v:this.coerceFallback(p)}})}};const L9=/^([a-z][a-z0-9.+-]+):/i,$9=["http","https","file","blob","app","capacitor","ionic","webpack","webpack-internal","ng"];function D9(e){if(!e||e==="<anonymous>")return!1;const t=L9.exec(e);return!t||$9.includes(t[1].toLowerCase())}function j_(e,t,n,r,s){const i={platform:e,filename:t,function:n==="<anonymous>"?"?":n,in_app:D9(t)};return ce(r)||(i.lineno=r),ce(s)||(i.colno=s),i}const YT=(e,t)=>{const n=e.indexOf("safari-extension")!==-1,r=e.indexOf("safari-web-extension")!==-1;return n||r?[e.indexOf("@")!==-1?e.split("@")[0]:"?",n?`safari-extension:${t}`:`safari-web-extension:${t}`]:[e,t]},F9=/^\s*at (\S+?)(?::(\d+))(?::(\d+))\s*$/i,j9=/^\s*at (?:(.+?\)(?: \[.+\])?|.*?) ?\((?:address at )?)?(?:async )?((?:<anonymous>|[-a-z]+:|.*bundle|\/)?.*?)(?::(\d+))?(?::(\d+))?\)?\s*$/i,z9=/\((\S*)(?::(\d+))(?::(\d+))\)/,V9=(e,t)=>{const n=F9.exec(e);if(n){const[,s,i,o]=n;return j_(t,s,"?",+i,+o)}const r=j9.exec(e);if(r){if(r[2]&&r[2].indexOf("eval")===0){const o=z9.exec(r[2]);o&&(r[2]=o[1],r[3]=o[2],r[4]=o[3])}const[s,i]=YT(r[1]||"?",r[2]);return j_(t,i,s,r[3]?+r[3]:void 0,r[4]?+r[4]:void 0)}},H9=/^\s*(.*?)(?:\((.*?)\))?(?:^|@)?((?:[-a-z]+)?:\/.*?|\[native code\]|[^@]*(?:bundle|\d+\.js)|\/[\w\-. /=]+)(?::(\d+))?(?::(\d+))?\s*$/i,U9=/(\S+) line (\d+)(?: > eval line \d+)* > eval/i,Z9=(e,t)=>{const n=H9.exec(e);if(n){if(n[3]&&n[3].indexOf(" > eval")>-1){const i=U9.exec(n[3]);i&&(n[1]=n[1]||"eval",n[3]=i[1],n[4]=i[2],n[5]="")}let r=n[3],s=n[1]||"?";return[s,r]=YT(s,r),j_(t,r,s,n[4]?+n[4]:void 0,n[5]?+n[5]:void 0)}},Zk=/\(error: (.*)\)/;function nb(e,t){return e.filename===t.filename&&e.function===t.function&&e.module===t.module&&e.lineno===t.lineno&&e.colno===t.colno}function B9(e){for(let t=1;10>=t;t++){const n=e.length-2*t;if(0>n)break;let r=!0;for(let s=0;t>s;s++)if(!nb(e[n+s],e[n+t+s])){r=!1;break}if(r){for(let s=0;t>s;s++)e[n+s]=e[n+t+s];return e.length=n+t,{start:n,length:t}}}}function W9(e,t){const n=t.start+t.length,r=XT(e,t);r&&e.splice(n+r===e.length?n:t.start,r)}function QT(e,t){let n=t.start;for(;n>0&&nb(e[n-1],e[n-1+t.length]);)n--;return t.start-n}function XT(e,t){const n=t.start+t.length;let r=n;for(;e.length>r&&nb(e[r],e[r-t.length]);)r++;return r-n}function K9(e,t){const n=t[0];let r=e.length-(n?QT(e,n):0);for(const s of t)r-=XT(e,s);return r}function G9(e,t,n){for(let r=0;e.length>r;r++){const s=e[(t+r)%e.length],i=e[(n+r)%e.length];if(s!==i)return i>s}return!1}var q9=class{match(e){return this.isDOMException(e)||this.isDOMError(e)}coerce(e,t){const n=dt(e.stack);return{type:this.getType(e),value:this.getValue(e),stack:n?e.stack:void 0,cause:e.cause?t.next(e.cause):void 0,synthetic:!1}}getType(e){return this.isDOMError(e)?"DOMError":"DOMException"}getValue(e){const t=e.name||(this.isDOMError(e)?"DOMError":"DOMException");return e.message?`${t}: ${e.message}`:t}isDOMException(e){return v0(e,"DOMException")}isDOMError(e){return v0(e,"DOMError")}},Y9=class{match(e){return xd(e)}coerce(e,t){var n;const r=this.getStack(e),s=r===void 0?(n=t.syntheticException)===null||n===void 0?void 0:n.stack:void 0,i=!!s;return{type:this.getType(e),value:this.getMessage(e,t),stack:r??s,cause:e.cause?t.next(e.cause):void 0,synthetic:i}}getType(e){return e.name||e.constructor.name}getMessage(e,t){const n=e.message;return String(n.error&&typeof n.error.message=="string"?n.error.message:n)}getStack(e){try{const t=e.stacktrace;if(typeof t=="string"&&t.length>0)return t;const n=e.stack;return typeof n=="string"&&n.length>0?n:void 0}catch{return}}},Q9=class{match(e){return!!v0(e,"ErrorEvent")&&(e.error!=null||this.br(e))}coerce(e,t){var n;if(e.error!=null)return t.apply(e.error);const r=t.apply(e.message);return $($({},r),{},{stack:(n=this.wr(e))!==null&&n!==void 0?n:r.stack,synthetic:!0})}br(e){return dt(e.message)&&e.message.length>0}wr(e){var t,n;const r=e,s=(t=r.lineno)!==null&&t!==void 0?t:0,i=(n=r.colno)!==null&&n!==void 0?n:0;if(dt(r.filename)&&r.filename.length!==0&&s!==0)return`Error
|
|
18
|
+
at ${r.filename}:${s}:${i}`}};const X9=/^(?:[Uu]ncaught (?:exception: )?)?(?:((?:Eval|Internal|Range|Reference|Syntax|Type|URI|)Error): )?(.*)$/i;var J9=class{match(e){return typeof e=="string"}coerce(e,t){var n;const[r,s]=this.getInfos(e);return{type:r??"Error",value:s??e,stack:(n=t.syntheticException)===null||n===void 0?void 0:n.stack,synthetic:!0}}getInfos(e){let t="Error",n=e;const r=e.match(X9);return r&&(t=r[1],n=r[2]),[t,n]}};const eF=["fatal","error","warning","log","info","debug"];function JT(e,t=40){const n=Object.keys(e);if(n.sort(),!n.length)return"[object has no keys]";for(let r=n.length;r>0;r--){const s=n.slice(0,r).join(", ");if(t>=s.length)return r===n.length?s:s.length>t?`${s.slice(0,t)}...`:s}return""}var tF=class{match(e){return typeof e=="object"&&e!==null}coerce(e,t){var n,r;const s=this.getErrorPropertyFromObject(e);return s?t.apply(s):{type:this.getType(e),value:this.getValue(e),stack:(n=this.getStack(e))!==null&&n!==void 0?n:(r=t.syntheticException)===null||r===void 0?void 0:r.stack,level:this.isSeverityLevel(e.level)?e.level:"error",synthetic:!0}}getType(e){if(eb(e))return e.constructor.name;const t="name"in e?e.name:void 0;return dt(t)&&!Hf(t)?t:"Error"}getValue(e){if("name"in e&&typeof e.name=="string"){let 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;const t=this.getObjectClassName(e);return`${t&&t!=="Object"?`'${t}'`:"Object"} captured as exception with keys: ${JT(e)}`}isSeverityLevel(e){return dt(e)&&!Hf(e)&&eF.indexOf(e)>=0}getStack(e){try{return dt(e.stacktrace)&&e.stacktrace.length>0?e.stacktrace:dt(e.stack)&&e.stack.length>0?e.stack:void 0}catch{return}}getErrorPropertyFromObject(e){for(const t in e)if({}.hasOwnProperty.call(e,t)){const n=e[t];if(xd(n))return n}}getObjectClassName(e){try{const t=Object.getPrototypeOf(e);return t?t.constructor.name:void 0}catch{return}}},nF=class{match(e){return eb(e)}coerce(e,t){var n;const r=e.constructor.name;return{type:r,value:`${r} captured as exception with keys: ${JT(e)}`,stack:(n=t.syntheticException)===null||n===void 0?void 0:n.stack,synthetic:!0}}},rF=class{match(e){return mT(e)}coerce(e,t){var n;return{type:"Error",value:`Primitive value captured as exception: ${String(e)}`,stack:(n=t.syntheticException)===null||n===void 0?void 0:n.stack,synthetic:!0}}},sF=class{match(e){return v0(e,"PromiseRejectionEvent")||this.isCustomEventWrappingRejection(e)}isCustomEventWrappingRejection(e){if(!eb(e))return!1;try{const t=e.detail;return t!=null&&typeof t=="object"&&"reason"in t}catch{return!1}}coerce(e,t){var n;const r=this.getUnhandledRejectionReason(e);return mT(r)?{type:"UnhandledRejection",value:`Non-Error promise rejection captured with value: ${String(r)}`,stack:(n=t.syntheticException)===null||n===void 0?void 0:n.stack,synthetic:!0}:t.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}};const w0="$message",b0="$timestamp",iF=new Set([w0,b0]),By={enabled:!0,max_bytes:32768};function x0(e){var t;return e?{enabled:(t=e.enabled)!==null&&t!==void 0?t:By.enabled,max_bytes:aF(e.max_bytes,By.max_bytes)}:$({},By)}var oF=class{constructor(e){this.ns=[],this.ss=0,this.Nr=x0(e)}setConfig(e){this.Nr=x0(e),this.rs()}add(e){const t=(function(r){let s;try{s=hT(r)}catch{return}try{const i=JSON.parse(s);if(!lt(i))return;const o=i,c=o[w0],u=o[b0];return!dt(c)||c.trim().length===0||!dt(u)&&!Fn(u)?void 0:{step:o,json:s}}catch{return}})(e);if(!t)return;const n=(function(r){if("u">typeof TextEncoder)return new TextEncoder().encode(r).length;const s=encodeURIComponent(r);let i=0;for(let o=0;s.length>o;o++)s[o]==="%"?(i+=1,o+=2):i+=1;return i})(t.json);n>this.Nr.max_bytes||(this.ns.push({step:t.step,bytes:n}),this.ss+=n,this.rs())}getAttachable(){return this.ns.map(e=>e.step)}clear(){this.ns=[],this.ss=0}size(){return this.ns.length}rs(){for(;this.ss>this.Nr.max_bytes&&this.ns.length>0;){const e=this.ns.shift();e&&(this.ss-=e.bytes)}}};function aF(e,t){if(!Fn(e)||e===1/0||e===-1/0)return t;const n=Math.floor(e);return 0>n?t:n}const Bk=e=>{if(typeof e!="string")return e;try{return JSON.parse(e)}catch{return e}};function Wk(e){return typeof e=="string"||e}function Kk(e){return typeof e=="string"?e:void 0}const lF=["$feature_flag","$feature_flag_response","$feature_flag_has_experiment","$feature_flag_id","$feature_flag_version","$feature_flag_reason","$feature_flag_request_id","$feature_flag_evaluated_at","$feature_flag_error","locally_evaluated","$groups","$process_person_profile","$geoip_disable","$current_url","$pathname","$referring_domain","utm_source","utm_medium","utm_campaign","utm_content","utm_term","gad_source","mc_cid","gclid","gclsrc","dclid","gbraid","wbraid","fbclid","msclkid","twclid","li_fat_id","igshid","ttclid","rdt_cid","epik","qclid","sccid","oppref","bfcid","irclid","_kx","$session_id","$window_id","$lib","$lib_version","$device_id","$is_server"],eR="NativeGzipValidationError",z_=e=>e.length>=2&&e[0]===31&&e[1]===139,Gk=(e,t)=>e===O_.GZipJS||t===O_.GZipJS||t==="gzip",qk=e=>!(!e||typeof e!="object")&&("name"in e?String(e.name):"")==="NotReadableError";let hf;const Xp=e=>{throw KT(eR,`Native gzip produced invalid output: ${e}`)},cF=(function(){var e=un(function*(t,n){18>t.size&&Xp("too-short");const r=new Uint8Array(yield t.slice(0,10).arrayBuffer());z_(r)&&r[2]===8||Xp("invalid-header");const s=new DataView(yield t.slice(t.size-8).arrayBuffer());s.getUint32(0,!0)!==(o=>{const c=(()=>{if(hf)return hf;hf=[];for(let d=0;256>d;d++){let f=d;for(let p=0;8>p;p++)f=1&f?3988292384^f>>>1:f>>>1;hf[d]=f>>>0}return hf})();let u=4294967295;for(let d=0;o.length>d;d++)u=c[255&(u^o[d])]^u>>>8;return(4294967295^u)>>>0})(n)&&Xp("invalid-crc");const i=n.length>>>0;s.getUint32(4,!0)!==i&&Xp("invalid-size")});return function(t,n){return e.apply(this,arguments)}})();function V_(){return V_=un(function*(e,t=!0,n){try{const s=new TextEncoder().encode(e),i=new globalThis.CompressionStream("gzip"),o=i.writable.getWriter(),c=o.write(s).then(()=>o.close()).catch((r=un(function*(f){try{yield o.abort(f)}catch{}throw f}),function(f){return r.apply(this,arguments)})),u=new Response(i.readable).blob(),[d]=yield Promise.all([u,c]);return yield cF(d,s),d}catch(s){if(n!=null&&n.rethrow)throw s;return t&&console.error("Failed to gzip compress data",s),null}var r}),V_.apply(this,arguments)}function tR(e,t){if(e==null)return{};var n,r,s=(function(o,c){if(o==null)return{};var u={};for(var d in o)if({}.hasOwnProperty.call(o,d)){if(c.includes(d))continue;u[d]=o[d]}return u})(e,t);if(Object.getOwnPropertySymbols){var i=Object.getOwnPropertySymbols(e);for(r=0;i.length>r;r++)t.includes(n=i[r])||{}.propertyIsEnumerable.call(e,n)&&(s[n]=e[n])}return s}const es="[redacted]",uF=/^[A-Za-z0-9+/\n\r]+=*$/,dF=/^[A-Za-z0-9_-]+={0,2}$/,fF=/[-_]/,hF=/^data:[^,\s]*;base64,/i,pF=/^[A-Za-z0-9+/_-]+={0,2}$/,mF=/\bph[a-z]_[A-Za-z0-9_-]{20,}\b/g,gF=/^(authorization|cookie|set-cookie|x-api-key|api[-_]?key|api[-_]?token|access[-_]?token|refresh[-_]?token|token|password|secret|client[-_]?secret|private[-_]?key)$/i,nR=/[a-z][a-z0-9+.-]{0,63}:[^\s<>"]+/gi,vF=/[\s<>"]/,rR=new RegExp(nR.source,"i"),sR=/[a-z][a-z0-9+.-]{0,63}:\/\//i,yF=new RegExp(`^${sR.source}`,"i"),_F=new RegExp(sR.source,"gi"),wF=/(^|[-_./;])(auth|token|secret|password|passwd|pwd|credential|signature|sig|key|hmac|sas|bearer|jwt|session|sessionid)([-_./;]|$)/i,bF=/^(code|AWSAccessKeyId|GoogleAccessId|Policy)$/i,xF=/[\u00A0\u1680\u2000-\u200A\u202F\u205F\u3000]/g,SF=/[A-Za-z0-9._%+-]{1,64}@[A-Za-z0-9.-]{1,255}\.[A-Za-z]{2,24}/g,EF=/\b(?:(?:25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)\.){3}(?:25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)\b/g,kF=/(^|[^\w:])((?:(?:[0-9A-Fa-f]{1,4}:){7}[0-9A-Fa-f]{1,4}|(?:[0-9A-Fa-f]{1,4}:){1,7}:|(?:[0-9A-Fa-f]{1,4}:){1,6}:[0-9A-Fa-f]{1,4}(?::[0-9A-Fa-f]{1,4}){0,5}|::(?:[0-9A-Fa-f]{1,4}(?::[0-9A-Fa-f]{1,4}){0,6})))(?=$|[^\w:])/g,CF=/\b\d{3}[ .-]\d{2}[ .-]\d{4}\b/g,Yk=/\d+/g,PF=/(^|[^\w+])((?:\+?1[ ./-]?)?(?:\(\d{3}\)[ ./-]?|\d{3}[ ./-])\d{3}[ ./-]\d{4})(?![\w])/g,AF=/(^|[^\w])(\+\d{1,3}(?:[ ./()-]{0,2}\d){7,13})(?![\w])/g;function H_(e){return(function(t){return gF.test(t)})(e)||wF.test(e)||bF.test(e)}function Wy(e){return e.split("&",129).length>128}function TF(e,t,n){return H_(e)||t.includes(";")&&(function(r){return r.split(";").some(s=>H_(s.split("=",1)[0]))})(t)?es:rR.test(t)?n?rb(t,{allowNestedUrls:!1,stripPunctuation:!0}):es:t}function iR(e,t){const n=new URLSearchParams;let r=!1,s=!1;for(const[i,o]of new URLSearchParams(e)){const c=S0(i),u=S0(o);r||(r=c!==i||u!==o);const d=TF(c,u,t);r||(r=d!==u),s=H_(c)||d!==u,n.append(c,d)}return{changed:r,lastFieldSensitive:s,serialized:n.toString()}}function Qk(e,t){if(!e.includes("="))return{value:RF(e,t),lastFieldSensitive:!1};const n=iR(e,t);return{value:n.changed?n.serialized:e,lastFieldSensitive:n.lastFieldSensitive}}function RF(e,t){return t?rb(e,{allowNestedUrls:!1,stripPunctuation:!0}):rR.test(e)?es:e}function IF(e,t,n){return e==="#"?!t.fragment&&(t.fragment=!0):e==="?"&&(t.fragment?n!=="="&&!t.fragmentQuery&&(t.fragmentQuery=!0):!t.query&&(t.query=!0))}function Ky(e,t){var n;if(e.length>8192&&yF.test(e))return es;const{address:r,suffix:s}=t.stripPunctuation?(function(b){let S=b.length;for(;S>0&&".,;:!?)]}'".includes(b[S-1]);)S--;return{address:b.slice(0,S),suffix:b.slice(S)}})(e):{address:e,suffix:""};let i;try{i=new URL(r)}catch{return es+s}const o=i.search.slice(1),c=i.hash!=="",u=(function(b){const S=b.slice(1),E=S.indexOf("?");return 0>E?{head:S,tail:null}:{head:S.slice(0,E),tail:S.slice(E+1)}})(i.hash);if(Wy(o)||Wy(u.head)||Wy((n=u.tail)!==null&&n!==void 0?n:""))return es+s;let d=!1;(i.username||i.password)&&(i.username=es,i.password="",d=!0);const f=iR(o,t.allowNestedUrls);f.changed&&(i.search=f.serialized,d=!0);const p=Qk(u.head,t.allowNestedUrls),m=u.tail===null?null:(v=u.tail,p.lastFieldSensitive?{value:v===""?"":es,lastFieldSensitive:!0}:Qk(v,t.allowNestedUrls));var v;const _=m===null?p.value:`${p.value}?${m.value}`;_!==i.hash.slice(1)&&(i.hash=_,d=!0);const w=c?m??p:f;return(d?S0(i.toString()):r)+(w.lastFieldSensitive?"":s)}function rb(e,t){return e.replace(nR,n=>(function(r,s){const i=(function(u){if(!u.includes("://"))return[];const d=[...u.matchAll(_F)].map(w=>w.index),f=[],p={query:!1,fragment:!1,fragmentQuery:!1};let m=0,v=!1,_="";for(let w=0;u.length>w&&d.length>m;w++){d[m]===w&&(w>0&&_!=="="&&f.push(w),m++);const b=u[w];IF(b,p,_)?(_=b,v=!0):v&&"=&".includes(b)&&(_=b)}return f})(r);if(i.length===0)return Ky(r,s);let o="",c=0;for(const u of i)o+=Ky(r.slice(c,u),$($({},s),{},{stripPunctuation:!1})),c=u;return o+Ky(r.slice(c),s)})(n,$($({},t),{},{stripPunctuation:t.stripPunctuation&&n.length!==e.length})))}function S0(e){return e.replace(mF,es)}function oR(e,t){return(function(n){return n.length>=10240&&(uF.test(n)||(function(r){const s=hF.exec(r);if(!s)return!1;let i;try{i=decodeURIComponent(r.slice(s[0].length))}catch{return!1}return pF.test(i.replace(/[\r\n]/g,""))})(n)||fF.test(n)&&dF.test(n))})(e)?"[binary data redacted - not supported by PostHog MCP analytics]":(function(n,r,s){const i=4*s.maxStringLength;if(n.length>i){const o=r(n.slice(0,(function(c,u){let d=u;for(;d>0&&!vF.test(c[d-1]);)d--;return d})(n,i)));if(o.length>=2*s.maxStringLength)return o+s.truncationSuffix}return r(n)})(e,n=>(function(r){return rb(r,{allowNestedUrls:!0,stripPunctuation:!0})})((function(r){let s=r.replace(xF," ");return s=s.replace(SF,es),s=s.replace(EF,es),s=s.replace(kF,`$1${es}`),s=(function(i){let o="",c=0;for(let u=Jk(i,0);u!==null;u=Jk(i,u[1]))o+=i.slice(c,u[0])+NF(i.slice(u[0],u[1])),c=u[1];return o+i.slice(c)})(s),s=s.replace(CF,es),s=s.replace(PF,`$1${es}`),s=s.replace(AF,`$1${es}`),s})(S0(n))),t)}function OF(e){let t=0,n=!1;for(let r=e.length-1;r>=0;r--){let s=e.charCodeAt(r)-48;if(0>s||s>9)return!1;n&&(s*=2,s>9&&(s-=9)),t+=s,n=!n}return t%10==0}function E0(e,t){const n=e.charCodeAt(t);return n>=48&&57>=n}function Xk(e,t){const n=e.charCodeAt(t);return E0(e,t)||n===95||n>=65&&90>=n||n>=97&&122>=n}function MF(e,t){let n=t;for(;E0(e,n);)n++;return n}function Jk(e,t){for(let n=t;e.length>n;n++){if(!E0(e,n)||Xk(e,n-1))continue;let r=0,s=-1,i=n;for(;;){const o=MF(e,i);if(r+=o-i,13>r||Xk(e,o)||(s=o),i=o+1,!" ./-".includes(e.charAt(o))||!E0(e,i))break}if(s>=0)return[n,s];n=i-1}return null}function NF(e){const t=[];for(let i=Yk.exec(e);i!==null;i=Yk.exec(e))t.push({digits:i[0],start:i.index,end:i.index+i[0].length});let n="",r=0,s=0;for(;t.length>s;){let i="",o=-1;for(let c=s;t.length>c&&(i+=t[c].digits,19>=i.length);c++)i.length>=13&&OF(i)&&(o=c);0>o?s++:(n+=e.slice(r,t[s].start)+es,r=t[o].end,s=o+1)}return n+e.slice(r)}const LF={}.propertyIsEnumerable;function k0(e,t){try{return aR(e,t,{ancestors:new WeakSet,remainingNodes:1e4},0)}catch{return[]}}function sb(e,t,n,r){if(0>=n.remainingNodes)return{stringValue:F_};if(n.remainingNodes--,hs(e))return{boolValue:e};if(typeof e=="bigint")return(function(s,i){const o=s.toString(),c=BigInt("9223372036854775808");return s>=c||-c>s?(i==null||i.debug(`Attribute ${o} is outside the int64 range; encoding it as a string`),{stringValue:o}):{intValue:o}})(e,t);if(typeof e=="number"){if(!Number.isFinite(e))return{stringValue:String(e)};if(Number.isInteger(e)){if(Number.isSafeInteger(e))return{intValue:String(e)};if(typeof BigInt>"u")return{stringValue:String(e)};const s=BigInt(e).toString();return e>=9223372036854776e3||-9223372036854776e3>e?(t==null||t.debug(`Attribute ${s} is outside the int64 range; encoding it as a string`),{stringValue:s}):{intValue:s}}return{doubleValue:e}}if(typeof e=="string")return{stringValue:Tu(e)};if(typeof e=="function")return{stringValue:"[Function]"};if(typeof e=="symbol")return{stringValue:String(e)};if(typeof e=="object"&&e!==null){if(n.ancestors.has(e))return{stringValue:"[Circular]"};if(r>=20)return{stringValue:F_};if(e instanceof Date){const s=e.getTime(),i=Number.isFinite(s)?e.toISOString():String(e);return{stringValue:typeof i=="string"?Tu(i):String(i)}}n.ancestors.add(e);try{try{const s=e.toJSON;if(typeof s=="function")return sb(s.call(e),t,n,r+1)}catch{}return He(e)?{arrayValue:{values:$F(e,t,n,r+1)}}:{kvlistValue:{values:aR(e,t,n,r+1)}}}finally{n.ancestors.delete(e)}}return{stringValue:Tu(String(e))}}function $F(e,t,n,r){const s=[],i=Math.min(e.length,1e3);let o=0;for(;i>o&&n.remainingNodes>0;o++)try{const c=o in e?e[o]:void 0;if(ot(c))continue;s.push(sb(c,t,n,r))}catch{s.push({stringValue:Uh})}return e.length>o&&s.push({stringValue:F_}),s}function aR(e,t,n,r){const s=[];for(const i in e)if(LF.call(e,i)){if(!i){t==null||t.debug("Dropping an attribute with an empty key");continue}if(s.length>=1e3||0>=n.remainingNodes){t==null||t.debug("Attributes truncated: the value exceeds the OTLP encoder budget");break}try{const o=e[i];if(kn(o)||ce(o))continue;s.push({key:Tu(i),value:sb(o,t,n,r)})}catch{s.push({key:Tu(i),value:{stringValue:Uh}})}}return s}function lR(e,t,n){return $($($($({},BT({},e.resourceAttributes)),{},{"service.name":e.serviceName||"unknown_service"},e.environment&&{"deployment.environment":e.environment}),e.serviceVersion&&{"service.version":e.serviceVersion}),{},{"telemetry.sdk.name":t,"telemetry.sdk.version":n})}const DF=["service.name","deployment.environment","service.version","telemetry.sdk.name","telemetry.sdk.version"];function cR(e,t){const n=BT({},e),r={};for(const s of DF)({}).hasOwnProperty.call(n,s)&&(r[s]=n[s],delete n[s]);return[...k0(n,t),...k0(r,t)]}const e6={darwin:"macOS",win32:"Windows",cygwin:"Windows",linux:"Linux",android:"Android",freebsd:"FreeBSD",openbsd:"OpenBSD",netbsd:"NetBSD",sunos:"SunOS",aix:"AIX",haiku:"Haiku","Mac OS X":"macOS"},uR={text:"INFO",number:9},FF={trace:{text:"TRACE",number:1},debug:{text:"DEBUG",number:5},info:uR,warn:{text:"WARN",number:13},error:{text:"ERROR",number:17},fatal:{text:"FATAL",number:21}};function jF(e){try{return Tu(String(e))}catch{return Uh}}function zF(e,t,n,r){const s=e.level||"info",{text:i,number:o}=FF[s]||uR,c=(function(m=Date.now()){return String(m)+"000000"})(Fn(r)?r:void 0),u={};t.distinctId&&(u.posthogDistinctId=t.distinctId),t.sessionId&&(u.sessionId=t.sessionId),t.windowId&&(u["window.id"]=t.windowId),ot(t.sessionStartTimestamp)||(u.sessionStartTimestamp=String(t.sessionStartTimestamp)),ot(t.lastActivityTimestamp)||(u.lastActivityTimestamp=String(t.lastActivityTimestamp)),t.currentUrl&&(u["url.full"]=t.currentUrl),t.screenName&&(u["screen.name"]=t.screenName),t.appState&&(u["app.state"]=t.appState),t.activeFeatureFlags&&t.activeFeatureFlags.length>0&&(u.feature_flags=t.activeFeatureFlags);const d=$({},u),f=e.attributes;if(f){let m=[];try{m=Object.keys(f)}catch{m=[]}for(const v of m){let _;try{_=f[v]}catch{_=Uh}Object.defineProperty(d,v,{value:_,enumerable:!0,writable:!0,configurable:!0})}}const p={timeUnixNano:c,observedTimeUnixNano:c,severityNumber:o,severityText:i,body:{stringValue:jF(e.body)},attributes:k0(d,n)};return e.trace_id&&(p.traceId=e.trace_id),e.span_id&&(p.spanId=e.span_id),ce(e.trace_flags)||(p.flags=e.trace_flags),p}function dR(e,t,n){return lR(e,t,n)}function fR(e,t,n,r){return{resourceLogs:[{resource:{attributes:cR(t)},scopeLogs:[{scope:{name:n,version:r},logRecords:e}]}]}}var hR=class{constructor(e){this.ls=e,this.us=0}get pending(){return!!this.cs}arm(e){this.clear(),this.us=Date.now()+e,this.cs=GT(()=>{this.cs=void 0,this.ls()},e)}armNoEarlierThan(e){this.cs&&Date.now()+e<=this.us||this.arm(e)}clear(){this.cs&&(clearTimeout(this.cs),this.cs=void 0)}};function pR(){return .75+.5*Math.random()}function mR(e,t,n,r){const s=Math.min(Math.max(0,t-1),6),i=e*Math.pow(2,s);return Math.round(Math.min(i,Math.max(r,e))*n)}var VF=class{constructor(e,t,n,r,s,i=()=>Promise.resolve(),o,c=()=>!1){var u;this._instance=e,this.Nr=t,this.A=n,this.hs=r,this.ds=s,this.vs=i,this.fs=o,this.ps=c,this.gs=new hR(()=>this.ys()),this.bs=null,this._s=0,this.ws=0,this.ks=null,this.Ss=new WT,this.xs=0,this.$s=1,this.Cs=0,this.Ts=0,this.Is=!1,this.Ms=t.maxBufferSize,this.Es=Math.max((u=t.maxQueueSize)!==null&&u!==void 0?u:t.maxBufferSize,t.maxBufferSize),this.As=t.flushIntervalMs,this.Rs=t.maxBatchRecordsPerPost,this.Ps=t.rateCapWindowMs,this.Os=t.maxLogsPerInterval}clearQueue(){this.ws++,this._instance.setPersistedProperty(so.LogsQueue,[])}get throttled(){return this.Ss.isOpen()}reset(){this.gs.clear(),this.Cs=0,this.Ts=0,this.Is=!1,this.xs=0,this.$s=1,this.Ss.reset(),this.Rs=this.Nr.maxBatchRecordsPerPost}onReconnect(){this.xs=0,this.$s=1,this.Ss.isOpen()?this.Fs()&&this.Ds():this.ys()}captureLog(e,t){var n;if(this._instance.isDisabled||this._instance.optedOut||!(e!=null&&e.body))return;const r=this.Ls(e);if(r===null)return;if(!r.body)return void this.A.info("Log was rejected in beforeSend function");if(!this.Ns())return;const s={record:zF(r,(n=t==null?void 0:t.context)!==null&&n!==void 0?n:this.hs(),this.A,t==null?void 0:t.occurredAtMs)};this.ds(()=>this.js(s))}Ls(e){const t=this.Nr.beforeSend;if(!t)return e;const n=He(t)?t:[t];let r=e;for(const s of n)try{const i=s(r);if(!i)return this.A.info("Log was rejected in beforeSend function"),null;r=i}catch(i){return this.A.error("Error in beforeSend function for log:",i),null}return r}Ns(){if(this.Os===void 0)return!0;const e=Date.now(),t=e-this.Cs;return this.Ps>t&&t>=0||(this.Cs=e,this.Ts=0,this.Is=!1),this.Os>this.Ts?(this.Ts++,!0):(this.Is||(this.A.warn(`captureLog dropping logs: exceeded ${this.Os} logs per ${this.Ps}ms`),this.Is=!0),!1)}flush(){var e=this;return un(function*(){if(!e._instance.isDisabled)return e.bs||(e.bs=e.qs().finally(()=>{e.bs=null})),e.bs})()}qs(){var e=this;return un(function*(){var t;if(e.gs.clear(),e.Bs())return;let n=(t=e._instance.getPersistedProperty(so.LogsQueue))!==null&&t!==void 0?t:[];if(n.length===0)return;const r=n.length;let s=0;for(;n.length>0&&r>s;){var i,o;if(e.Bs())return;const c=e.ws;e._s=0;const u=Math.min(n.length,e.Rs),d=n.slice(0,u),f=fR(d.map(m=>m.record),e.zs(),(i=e.fs)!==null&&i!==void 0?i:e._instance.getLibraryId(),e._instance.getLibraryVersion()),p=yield e._instance.Hs(f);if(e.ws!==c)return;if(p.kind==="too-large"&&d.length>1)e.Rs=Math.max(1,Math.floor(d.length/2)),e.A.warn(`Logs batch of size ${d.length} was too large for the ingestion endpoint, reducing batch size to ${e.Rs}`);else if(e.Ss.record(p),e.gs.pending&&e.gs.arm(Math.max(e.As,e.Ss.remainingMs())),p.kind==="retry-later"||(p.kind==="too-large"?e.A.warn("Dropping a single log record with batch size 1 — the record is larger than the server cap and cannot be split further."):p.kind==="ok"&&e.Nr.maxBatchRecordsPerPost>e.Rs&&(e.Rs=Math.min(e.Nr.maxBatchRecordsPerPost,e.Rs+1)),yield e.Us(d.length),n=(o=e._instance.getPersistedProperty(so.LogsQueue))!==null&&o!==void 0?o:[],s+=d.length,p.kind==="fatal"))throw p.error}})()}Bs(){return!!this.ps()&&(this.Fs()&&this.clearQueue(),!0)}Us(e){var t=this;return un(function*(){var n;const r=Math.max(0,e-t._s),s=(n=t._instance.getPersistedProperty(so.LogsQueue))!==null&&n!==void 0?n:[];t._instance.setPersistedProperty(so.LogsQueue,s.slice(r)),yield t.vs()})()}zs(){return dR(this.Nr,this._instance.getLibraryId(),this._instance.getLibraryVersion())}js(e){var t;if(this._instance.optedOut)return;const n=(t=this._instance.getPersistedProperty(so.LogsQueue))!==null&&t!==void 0?t:[];this.Es>n.length||(n.shift(),this._s++,this.A.info("Logs queue is full, dropping oldest record.")),n.push(e),this._instance.setPersistedProperty(so.LogsQueue,n),this.Ms>n.length||this.Ss.isOpen()?this.Ds():this.ys()}Ds(){this.gs.pending||this.gs.arm(Math.max(this.As,this.Ss.remainingMs()))}Ws(){return Math.max(mR(this.As,this.xs,this.$s,3e4),this.Ss.remainingMs())}Fs(){const e=this._instance.getPersistedProperty(so.LogsQueue);return!!e&&e.length>0}shutdown(e){var t=this;return un(function*(){t.gs.clear();const n=t.flush().catch(()=>{});e!==void 0?yield jk(n,e):yield n})()}flushWithTimeout(e){var t=this;return un(function*(){const n=t.flush();yield jk(n,e,()=>{n.catch(()=>{})})})()}flushInBackground(){if(this.ks)return this.ks;const e=this.flush().then(()=>{this.xs=0,this.$s=1},t=>{this.xs++,this.$s=pR(),this.A.error("PostHog logs flush failed:",t)}).finally(()=>{this.ks===e&&(this.ks=null),!this._instance.isDisabled&&this.Fs()&&this.gs.armNoEarlierThan(this.Ws())});return this.ks=e,e}ys(){this.flushInBackground()}};const HF=/^[0-9a-f]+$/;function t6(e,t,n){return typeof e=="string"&&e.length===t&&e!==n&&HF.test(e)}const UF=/^([0-9a-f]{2})-([0-9a-f]{32})-([0-9a-f]{16})-([0-9a-f]{2})(-.*)?$/,ZF="00",Jp=[0,5,10,25,50,75,100,250,500,750,1e3,2500,5e3,7500,1e4];function U_(e){return String(e)+"000000"}function Gy(e,t,n,r){let s="";return r&&(s=Object.keys(r).sort().map(i=>`${JSON.stringify(i)}:${JSON.stringify(r[i])}`).join(",")),`${e}\0${t}\0${n??""}\0${s}`}var BF=class{constructor(e,t,n){this._instance=e,this.Nr=t,this.A=n,this.Vs=new Map,this.gs=new hR(()=>this.flush().catch(r=>{this.A.error("Metrics flush failed:",r)})),this.bs=null,this.Gs=null,this.Qs=!1,this.Js=new Map,this.Zs=new Set,this.Ks=new Map,this.Ys=new Set,this.Xs=!1,this.Ss=new WT,this.xs=0,this.$s=1,this._o=0}count(e,t=1,n){this.So({name:e,type:"count",value:t,unit:n==null?void 0:n.unit,attributes:n==null?void 0:n.attributes})}gauge(e,t,n){this.So({name:e,type:"gauge",value:t,unit:n==null?void 0:n.unit,attributes:n==null?void 0:n.attributes})}histogram(e,t,n){this.So({name:e,type:"histogram",value:t,unit:n==null?void 0:n.unit,attributes:n==null?void 0:n.attributes,bounds:He(n==null?void 0:n.bounds)?n.bounds.slice():n==null?void 0:n.bounds})}flush(){var e=this;const t=this.bs,n=(function(){var r=un(function*(){t&&(yield t.catch(()=>{})),yield e.xo()});return function(){return r.apply(this,arguments)}})()().finally(()=>{this.bs===n&&(this.bs=null)});return this.bs=n,n}flushCoalesced(){var e,t;return this.$o()?(e=this.bs)!==null&&e!==void 0?e:Promise.resolve():(this.Gs||(this.Gs=((t=this.bs)!==null&&t!==void 0?t:Promise.resolve()).catch(()=>{}).then(()=>(this.Gs=null,this.$o()?void 0:this.flush()))),this.Gs)}$o(){return this.xs>0||this.Ss.remainingMs()>0}drainWindow(){if(this.Vs.size===0)return null;const e=this.Vs;return this.Co(),this.To(e)}reset(){this._o++,this.Ss.reset(),this.xs=0,this.$s=1,this.gs.clear(),this.bs=null,this.Gs=null,this.Co(),this.Ks=new Map,this.Xs=!1}Co(){this.Vs=new Map,this.Qs=!1,this.Js=new Map,this.Zs=new Set,this.Ys=new Set}So(e){if(this._instance.isDisabled||this._instance.optedOut)return;const t=this.Ls(e);if(t===null)return;if(!t.name||typeof t.name!="string")return void this.A.warn("Dropping metric with empty name");if(typeof t.value!="number"||!Number.isFinite(t.value))return void this.A.warn(`Dropping metric '${t.name}': value must be a finite number`);if(t.type!=="count"&&t.type!=="gauge"&&t.type!=="histogram")return void this.A.warn(`Dropping metric '${t.name}': unknown type '${String(t.type)}'`);if(t.type==="count"&&0>t.value)return void this.A.warn(`Dropping count '${t.name}': counters are monotonic, value must be >= 0`);let n,r;try{n=t.attributes?$({},t.attributes):void 0,r=Gy(t.type,t.name,t.unit,n)}catch(u){return void this.A.warn(`Dropping metric '${t.name}': attributes could not be serialized`,u)}let s,i=this.Vs.get(r);if(!i&&!this.Io()||t.type==="histogram"&&(s=this.Mo(t.name,t.unit,t.bounds),!s))return;i||(i={name:t.name,type:t.type,unit:t.unit,attributes:n,windowStartMs:Date.now(),hist:s&&WF(s)},this.Vs.set(r,i));const o=this.Js.get(t.name);o===void 0?this.Js.set(t.name,t.type):o===t.type||this.Zs.has(t.name)||(this.Zs.add(t.name),this.A.warn(`Metric name '${t.name}' is already used as a ${o}; recording it as a ${t.type} too will blend both series in charts. Use a distinct name.`)),this.Eo(i,t.value);const c=this.Ao();c&&(i.exemplar=$($({},c),{},{value:t.value,timeMs:Date.now()})),this.Ds()}Ao(){try{var e,t;const n=(function(r){const s=(function(o){if(typeof o!="string")return;const c=UF.exec(o.trim());if(!c)return;const[,u,d,f,p,m]=c;return u==="ff"||u==="00"&&m||!(function(v){return t6(v,32,"00000000000000000000000000000000")})(d)||!(function(v){return t6(v,16,"0000000000000000")})(f)?void 0:{version:u,traceId:d,spanId:f,flags:p}})(r);return s&&{traceId:s.traceId,spanId:s.spanId,flags:(i=s.flags,1&parseInt(i,16)?"01":ZF)};var i})((e=(t=this._instance).getActiveSpan)===null||e===void 0||(e=e.call(t))===null||e===void 0?void 0:e.traceparent());if(n&&n.flags==="01")return{traceId:n.traceId,spanId:n.spanId}}catch{}}Io(){return this.Nr.maxSeriesPerFlush>this.Vs.size||(this.Qs||(this.Qs=!0,this.A.warn(`Metric series cap reached (${this.Nr.maxSeriesPerFlush} per flush window); dropping new series until the next flush. Reduce attribute cardinality.`)),!1)}Mo(e,t,n){if(n!==void 0&&!(function(o){if(!He(o)||o.length===0)return!1;for(let c=0;o.length>c;c++)if(!Number.isFinite(o[c])||c>0&&o[c-1]>=o[c])return!1;return!0})(n))return void this.A.warn(`Dropping histogram '${e}': bounds must be a non-empty array of finite, strictly increasing numbers`);const r=Gy("histogram",e,t,void 0),s=this.Ks.get(r);if(s)return this.Ro(e,r,s,n),s;if(this.Ks.size>=this.Nr.maxSeriesPerFlush)return this.Xs||(this.Xs=!0,this.A.warn(`Histogram bounds limit reached (${this.Nr.maxSeriesPerFlush} distinct histograms); new histograms that pass custom bounds are dropped. Reduce histogram name cardinality.`)),n&&!n6(n,Jp)?void 0:Jp;const i=n?n.slice():Jp;return this.Ks.set(r,i),i}Ro(e,t,n,r){n6(n,r??Jp)||this.Ys.has(t)||(this.Ys.add(t),this.A.warn(`Histogram '${e}' already uses the bounds [${n.join(", ")}]; samples that pass different bounds are recorded in those buckets.`))}Eo(e,t){switch(e.type){case"count":var n;e.total=((n=e.total)!==null&&n!==void 0?n:0)+t;break;case"gauge":e.last=t;break;case"histogram":{const r=e.hist;r.count+=1,r.sum+=t,r.min=Math.min(r.min,t),r.max=Math.max(r.max,t),r.bucketCounts[(function(s,i){for(let o=0;i.length>o;o++)if(i[o]>=s)return o;return i.length})(t,r.bounds)]+=1;break}}}Ls(e){const t=this.Nr.beforeSend;if(!t)return e;const n=He(t)?t:[t];let r=e;for(const s of n)try{const i=s(r);if(!i)return this.A.info("Metric was rejected in beforeSend function"),null;r=i}catch(i){return this.A.error("Error in beforeSend function for metric:",i),null}return r}Ds(){this.gs.pending||this.gs.arm(this.Ws())}Ws(){return Math.max(mR(this.Nr.flushIntervalMs,this.xs,this.$s,3e4),this.Ss.remainingMs())}xo(){var e=this;return un(function*(){if(e.gs.clear(),e.Vs.size===0)return;const t=e.Vs;e.Co();const n=e._o,r=yield e._instance.Po(e.To(t));if(n===e._o)switch(e.Ss.record(r),r.kind==="retry-later"?(e.xs++,e.$s=pR()):(e.xs=0,e.$s=1),e.gs.pending&&e.gs.arm(e.Ws()),r.kind){case"ok":return;case"retry-later":return e.Oo(t),void e.gs.armNoEarlierThan(e.Ws());case"too-large":return void e.A.warn("Metrics batch exceeded the server size limit and was dropped");case"fatal":return void e.A.error("Failed to send metrics batch:",r.error)}})()}To(e){return t=this.Fo(e),n=(function(i,o,c){return lR(i,o,c)})(this.Nr,this._instance.getLibraryId(),this._instance.getLibraryVersion()),r=this._instance.getLibraryId(),s=this._instance.getLibraryVersion(),{resourceMetrics:[{resource:{attributes:cR(n)},scopeMetrics:[{scope:{name:r,version:s},metrics:t}]}]};var t,n,r,s}Fo(e){const t=U_(Date.now()),n=new Map;for(const o of e.values()){var r;const c=Gy(o.type,o.name,o.unit,void 0);let u=n.get(c);u||(u=$({name:o.name},o.unit&&{unit:o.unit}),o.type==="count"?u.sum={aggregationTemporality:1,isMonotonic:!0,dataPoints:[]}:o.type==="gauge"?u.gauge={dataPoints:[]}:u.histogram={aggregationTemporality:1,dataPoints:[]},n.set(c,u));const d=k0((r=o.attributes)!==null&&r!==void 0?r:{},this.A),f=U_(o.windowStartMs),p=KF(o.exemplar);if(o.type==="count"){var s;const m=$({attributes:d,startTimeUnixNano:f,timeUnixNano:t,asDouble:(s=o.total)!==null&&s!==void 0?s:0},p);u.sum.dataPoints.push(m)}else if(o.type==="gauge"){var i;const m=$({attributes:d,timeUnixNano:t,asDouble:(i=o.last)!==null&&i!==void 0?i:0},p);u.gauge.dataPoints.push(m)}else{const m=o.hist,v=$({attributes:d,startTimeUnixNano:f,timeUnixNano:t,count:m.count,sum:m.sum,min:m.min,max:m.max,bucketCounts:m.bucketCounts,explicitBounds:m.bounds},p);u.histogram.dataPoints.push(v)}}return Array.from(n.values())}Oo(e){for(const[s,i]of e){var t;const o=this.Vs.get(s);if(o)switch(o.windowStartMs=Math.min(o.windowStartMs,i.windowStartMs),o.exemplar=(t=o.exemplar)!==null&&t!==void 0?t:i.exemplar,o.type){case"count":var n,r;o.total=((n=o.total)!==null&&n!==void 0?n:0)+((r=i.total)!==null&&r!==void 0?r:0);break;case"gauge":break;case"histogram":{const c=o.hist,u=i.hist;c.count+=u.count,c.sum+=u.sum,c.min=Math.min(c.min,u.min),c.max=Math.max(c.max,u.max);for(let d=0;c.bucketCounts.length>d;d++)c.bucketCounts[d]+=u.bucketCounts[d];break}}else this.Io()&&this.Vs.set(s,i)}}};function n6(e,t){if(e===t)return!0;if(e.length!==t.length)return!1;for(let n=0;e.length>n;n++)if(e[n]!==t[n])return!1;return!0}function WF(e){return{bounds:e,count:0,sum:0,min:1/0,max:-1/0,bucketCounts:new Array(e.length+1).fill(0)}}function KF(e){return e?{exemplars:[{filteredAttributes:[],timeUnixNano:U_(e.timeMs),asDouble:e.value,traceId:e.traceId,spanId:e.spanId}]}:{}}const gR=(e,{debugEnabled:t}={})=>{const n={N(r,...s){let i;try{i=typeof window>"u"?void 0:window}catch{return}i&&(Xo.DEBUG||i.POSTHOG_DEBUG||t)&&!ce(i.console)&&i.console&&("__rrweb_original__"in i.console[r]?i.console[r].__rrweb_original__:i.console[r])(e,...s)},debug(...r){n.N("debug",...r)},info(...r){n.N("log",...r)},warn(...r){n.N("warn",...r)},error(...r){n.N("error",...r)},critical(...r){console.error(e,...r)},uninitializedWarning(r){n.error(`You must initialize PostHog before calling ${r}`)},createLogger:(r,s)=>gR(`${e} ${r}`,s)};return n},me=gR("[PostHog.js]"),xn=(e,t)=>me.createLogger(e,t),GF=xn("[ExternalScriptsLoader]"),C0=e=>{const t=Ie==null?void 0:Ie.querySelectorAll("script");if(t){for(let n=0;t.length>n;n++)if(t[n].src===e||t[n].getAttribute("src")===e)return t[n]}},eu=(e,t,n)=>{if(e.config.disable_external_dependency_loading)return GF.warn(`${t} was requested but loading of external scripts is disabled.`),n("Loading of external scripts is disabled");const r=()=>{if(Ie==null||Ie.removeEventListener("DOMContentLoaded",r),e.config.disable_external_dependency_loading)return n("Loading of external scripts is disabled");if(!Ie)return n("document not found");let i=Ie.createElement("script");if(i.type="text/javascript",i.crossOrigin="anonymous",i.src=t,i.onload=u=>{i.__posthog_loading_callback_fired=!0,n(void 0,u)},i.onerror=u=>{i.__posthog_loading_error=u,n(u)},e.config.prepare_external_dependency_script&&(i=e.config.prepare_external_dependency_script(i)),!i)return n("prepare_external_dependency_script returned null");if(e.config.disable_external_dependency_loading)return n("Loading of external scripts is disabled");const o=C0(i.src);if(o){if(o.integrity!==i.integrity||o.crossOrigin!==i.crossOrigin||o.nonce!==i.nonce)return n("Existing script conflicts with prepared script policy");if(o.__posthog_loading_callback_fired)return n();const u=o.__posthog_loading_error;return u?n(u):(o.addEventListener("load",d=>{o.__posthog_loading_callback_fired=!0,n(void 0,d)}),void o.addEventListener("error",d=>{o.__posthog_loading_error=d,n(d)}))}if(!Ie.body)return s();if(e.config.external_scripts_inject_target==="head")Ie.head.appendChild(i);else{const u=Ie.querySelectorAll("body > script");var c;u.length>0?(c=u[0].parentNode)===null||c===void 0||c.insertBefore(i,u[0]):Ie.body.appendChild(i)}},s=()=>{Ie==null||Ie.addEventListener("DOMContentLoaded",r)};Ie!=null&&Ie.body||C0(t)?r():s()},qy={},r6=(e,t)=>{let n=`/static/${t}.js?v=${e.version}`;return t==="toolbar"&&(n=`${n}&t=${Math.floor(Date.now()/3e5)*3e5}`),e.requestRouter.endpointFor("assets",n)};et.__PosthogExtensions__=et.__PosthogExtensions__||{},et.__PosthogExtensions__.loadExternalDependency=(e,t,n)=>{if(t==="remote-config"){const s=e.requestRouter.endpointFor("assets",`/array/${e.config.token}/config.js`);return void eu(e,s,n)}const r=e.config.strict_script_versioning;if(r){const s=e.requestRouter.endpointFor("assets",`/static/${e.version}/${t}.js`),i=qy[s];if(r==="fallback"&&i){if(C0(i))return void eu(e,i,n);delete qy[s]}return void eu(e,s,r==="fallback"?(o,c)=>{if(o)if(typeof o=="string")n(o);else{var u;const d=r6(e,t);qy[s]=d;const f=C0(s);f==null||(u=f.parentNode)===null||u===void 0||u.removeChild(f),eu(e,d,n)}else n(void 0,c)}:n)}eu(e,r6(e,t),n)},et.__PosthogExtensions__.loadSiteApp=(e,t,n)=>{const r=e.requestRouter.endpointFor("api",t);eu(e,r,n)},Xo.DEBUG=!1,Xo.LIB_VERSION="1.447.9",Xo.LIB_NAME="web";var Cs=Xo;const Z_="$early_access_features",qo="$active_feature_flags",uc="$feature_flag_details",lh="$feature_flag_errors",rl="$feature_flag_evaluated_at",dc="$feature_flag_request_id",Zf="$minimal_flag_called_events",$i="$enabled_feature_flags",Qa="$stored_group_properties",Xa="$stored_person_properties",co="$flag_call_reported",Tf="$flag_call_reported_session_id",Ja="$feature_flag_payloads",ro="$override_feature_flags",Yl="$override_feature_flag_payloads",Ru="visibilitychange",vR="$autocapture_disabled_server_side",Rf="$surveys",P0="$surveys_loaded_at",B_="PostHog loadExternalDependency extension not found.",W_="$surveys_activated",Zm="$surveys_activated_session",Bm="$surveys_activated_timestamps",qF="$people_distinct_id",ui="distinct_id",ib="$device_id",Yy="$device_model",A0="__alias",YF="__cmpns",s6="$fbc",Iu="$fbc_persistence",i6="$fbp",Bf="$fbp_persistence",K_="__timers",G_="$heatmaps_enabled_server_side",q_="$exception_capture_enabled_server_side",yR="$error_tracking_suppression_rules",Y_="$error_tracking_capture_extension_exceptions",Q_="$web_vitals_enabled_server_side",ob="$dead_clicks_enabled_server_side",ab="$product_tours_enabled_server_side",_R="$logs_capture_enabled_server_side",wR="$web_vitals_allowed_metrics",Wf="$session_recording_remote_config",QF="$session_recording_enabled_server_side",XF="$replay_sample_rate",JF="$replay_override_sampling",ej="$replay_override_linked_flag",tj="$replay_override_url_trigger",nj="$replay_override_event_trigger",wu="$sesid",bR="$session_is_sampled",rj="$session_past_minimum_duration",sj="$session_recording_url_trigger_activated_session",ij="$session_recording_event_trigger_activated_session",oj="$debug_first_full_snapshot_timestamp",aj="$sess_rec_flush_size",xR="$groups",X_="ph_product_tours",lj="$product_tours_activated",cj="$product_tours_activated_session",uj="$conversations_widget_session_id",dj="$conversations_ticket_id",fj="$conversations_widget_state",hj="$conversations_user_traits",Jr="$user_state",J_="$client_session_props",SR="$capture_rate_limit",ER="$initial_campaign_params",kR="$initial_referrer_info",bu="$initial_person_info",lb="$epp",Qy="$posthog_cookieless",CR="$cookieless_mode",PR="$sdk_debug_extensions_init_method",AR="$sdk_debug_extensions_init_time_ms",cb="$sdk_debug_recording_script_not_loaded",ub="$sdk_debug_replay_stale_config",TR="$sdk_debug_replay_event_trigger_status",RR="$sdk_debug_replay_linked_flag_trigger_status",IR="$sdk_debug_replay_matched_recording_trigger_groups",OR="$sdk_debug_replay_pending_trigger_conditions",MR="$sdk_debug_replay_remote_trigger_matching_config",NR="$sdk_debug_replay_trigger_groups_count",LR="$sdk_debug_replay_url_trigger_status",pj="$session_recording_start_reason",Yo="anonymous",Wm="identified",$R="identified_only",T0="beforeunload",db="$pageview",o6="$pageleave",DR="$identify",a6="$groupidentify";function xu(e,t){He(e)&&e.forEach(t)}function Zt(e,t){if(!ot(e))if(He(e))e.forEach(t);else if((n=>n instanceof FormData)(e))e.forEach((n,r)=>t(n,r));else for(const n in e)J2.call(e,n)&&t(e[n],n)}const mn=function(e,...t){for(const n of t)for(const r in n)n[r]!==void 0&&(e[r]=n[r]);return e};function Km(e){const t=Object.keys(e);let n=t.length;const r=new Array(n);for(;n--;)r[n]=[t[n],e[t[n]]];return r}const mj=function(e){return function(...t){try{return e.apply(this,t)}catch(n){me.critical("Implementation error. Please turn on debug mode and open a ticket on https://app.posthog.com/home#panel=support%3Asupport%3A."),me.critical(n)}}},fb=function(e){const t={};return Zt(e,function(n,r){(dt(n)&&n.length>0||Fn(n))&&(t[r]=n)}),t};function FR(e){const t=$({},e);for(const n of["name","message","stack","cause","errors"])try{n in e&&(t[n]=e[n])}catch{}return t}const gj=["herokuapp.com","vercel.app","netlify.app"];function vj(e){const t=e==null?void 0:e.hostname;if(!dt(t))return!1;const n=t.split(".").slice(-2).join(".");for(const r of gj)if(n===r)return!1;return!0}function Lt(e,t,n,r){const{capture:s=!1,passive:i=!0}=r??{};e==null||e.addEventListener(t,n,{capture:s,passive:i})}function Xy(e){return e.name==="ph_toolbar_internal"}const Kf=e=>{if(Ie){try{const t=e+"=",n=Ie.cookie.split(";").filter(r=>r.length);for(let r=0;n.length>r;r++){let s=n[r];for(;s.charAt(0)==" ";)s=s.substring(1,s.length);if(s.indexOf(t)===0)return decodeURIComponent(s.substring(t.length,s.length))}}catch{}return null}};var yj=class ew{constructor(t){if(this.bytes=t,t.length!==16)throw new TypeError("not 128-bit length")}static fromFieldsV7(t,n,r,s){if(!Number.isInteger(t)||!Number.isInteger(n)||!Number.isInteger(r)||!Number.isInteger(s)||0>t||0>n||0>r||0>s||t>0xffffffffffff||n>4095||r>1073741823||s>4294967295)throw new RangeError("invalid field value");const i=new Uint8Array(16);return i[0]=t/Math.pow(2,40),i[1]=t/Math.pow(2,32),i[2]=t/Math.pow(2,24),i[3]=t/Math.pow(2,16),i[4]=t/256,i[5]=t,i[6]=112|n>>>8,i[7]=n,i[8]=128|r>>>24,i[9]=r>>>16,i[10]=r>>>8,i[11]=r,i[12]=s>>>24,i[13]=s>>>16,i[14]=s>>>8,i[15]=s,new ew(i)}toString(){let t="";for(let n=0;this.bytes.length>n;n++)t=t+(this.bytes[n]>>>4).toString(16)+(15&this.bytes[n]).toString(16),n!==3&&n!==5&&n!==7&&n!==9||(t+="-");if(t.length!==36)throw new Error("Invalid UUIDv7 was generated");return t}clone(){return new ew(this.bytes.slice(0))}equals(t){return this.compareTo(t)===0}compareTo(t){for(let n=0;16>n;n++){const r=this.bytes[n]-t.bytes[n];if(r!==0)return Math.sign(r)}return 0}},_j=class{generate(){const e=this.generateOrAbort();if(!ce(e))return e;{this.Tt=0;const t=this.generateOrAbort();if(ce(t))throw new Error("Could not generate UUID after timestamp reset");return t}}generateOrAbort(){const e=(()=>{const t=Date.now();return Fn(t)&&isFinite(t)?Math.min(Math.max(Math.floor(t),0),0xffffffffffff):0})();if(e>this.Tt)this.Tt=e,this.Mt();else{if(this.Tt>=e+1e4)return;this.It++,this.It>4398046511103&&(this.Tt++,this.Mt())}return yj.fromFieldsV7(this.Tt,Math.trunc(this.It/Math.pow(2,30)),this.It&Math.pow(2,30)-1,this.Rt.nextUint32())}Mt(){this.It=1024*this.Rt.nextUint32()+(1023&this.Rt.nextUint32())}constructor(){this.Tt=0,this.It=0,this.Rt=new wj}};const l6=e=>{if("u">typeof UUIDV7_DENY_WEAK_RNG&&UUIDV7_DENY_WEAK_RNG)throw new Error("no cryptographically strong RNG available");for(let t=0;e.length>t;t++)e[t]=65536*Math.trunc(65536*Math.random())+Math.trunc(65536*Math.random());return e};let c6;var wj=class{nextUint32(){var e;return this.At.length>this.Et||(((e=c6)!==null&&e!==void 0?e:c6="u">typeof window&&!ce(window.crypto)&&crypto.getRandomValues?t=>{try{return crypto.getRandomValues(t)}catch{return l6(t)}}:l6)(this.At),this.Et=0),this.At[this.Et++]}constructor(){this.At=new Uint32Array(8),this.Et=1/0}};let u6;const Di=()=>bj().toString(),bj=()=>(u6||(u6=new _j)).generate();let pf="";const xj=/[a-z0-9][a-z0-9-]+\.[a-z]{2,}$/i;let tu=null;const pn={Ot(){if(!kn(tu))return tu;if(tu=!1,Ie)try{const e=`__ph_cookie_support_${Di()}`;pn.$t(e,"xyz"),tu=Kf(e)==='"xyz"',pn.Dt(e)}catch{tu=!1}return tu},Pt(e){me.error("cookieStore error: "+e)},Lt:Kf,Ft(e){let t;try{t=JSON.parse(pn.Lt(e))||{}}catch{}return t},$t(e,t,n,r,s){if(!Ie)return!1;try{let i="",o="";const c=(function(d,f){if(f){let p=(function(m,v=Ie){if(pf)return pf;if(!v||["localhost","127.0.0.1"].includes(m))return"";const _=m.split(".");let w=Math.min(_.length,8);const b="dmn_chk_"+Di();for(;!pf&&w--;){const S=_.slice(w).join("."),E=b+"=1;domain=."+S+";path=/";v.cookie=E+";max-age=3",v.cookie.includes(b)&&(v.cookie=E+";max-age=0",pf=S)}return pf})(d);if(!p){const m=(v=>{const _=v.match(xj);return _?_[0]:""})(d);m!==p&&me.info("Warning: cookie subdomain discovery mismatch",m,p),p=m}return p?"; domain=."+p:""}return""})(Ie.location.hostname,r);if(n){const d=new Date;d.setTime(d.getTime()+864e5*n),i="; expires="+d.toUTCString()}s&&(o="; secure");const u=e+"="+encodeURIComponent(JSON.stringify(t))+i+"; SameSite=Lax; path=/"+c+o;return u.length>3686.4&&me.warn("cookieStore warning: large cookie, len="+u.length),Ie.cookie=u,!0}catch{return!1}},Dt(e,t){if(Ie!=null&&Ie.cookie&&(!t||!kn(Kf(e))))try{pn.$t(e,"",-1,t)}catch{return}}};let Jy=null;const Ot={Ot(){if(!kn(Jy))return Jy;let e=!0;if(ce(le))e=!1;else try{const t="__mplssupport__";Ot.$t(t,"xyz"),Ot.Lt(t)!=='"xyz"'&&(e=!1),Ot.Dt(t)}catch{e=!1}return e||me.error("localStorage unsupported; falling back to cookie store"),Jy=e,e},Pt(e){me.error("localStorage error: "+e)},Lt(e){try{return le==null?void 0:le.localStorage.getItem(e)}catch(t){Ot.Pt(t)}return null},Ft(e){try{return JSON.parse(Ot.Lt(e))||{}}catch{}return null},$t(e,t){try{return le==null||le.localStorage.setItem(e,JSON.stringify(t)),!0}catch(n){Ot.Pt(n)}return!1},Dt(e){try{le==null||le.localStorage.removeItem(e)}catch(t){Ot.Pt(t)}}},e1=[Xa,qo,$i,uc,Ja,dc,rl,lh,co],La=[ib,ui,wu,bR,lb,bu,Iu,Jr],R0=e=>e+"_cpm",Sj=["__proto__","constructor","prototype"],em=e=>{if(!lt(e))return{};const t={};return Object.keys(e).forEach(n=>{Sj.indexOf(n)===-1&&(t[n]=e[n])}),t},tm=(e,t=[])=>{const n={};return[...La,...t].forEach(r=>{const s=e[r];ce(s)||kn(s)||s===""||(n[r]=s)}),n},jR=e=>{let t=5381,n=2166136261;for(let r=0;e.length>r;r++){const s=e.charCodeAt(r);t=33*t^s,n=Math.imul(n^s,16777619)}return e.length.toString(36)+"."+(t>>>0).toString(36)+"."+(n>>>0).toString(36)},d6=(e,t)=>({p:t,f:jR(JSON.stringify(e))}),f6=(e,t)=>{if(!t)return{properties:[],isValid:!1};try{const n=pn.Ft(R0(e)),r=(n==null?void 0:n.f)===jR(t)&&He(n.p);return{properties:r?n.p:[],isValid:r}}catch{return{properties:[],isValid:!1}}},t1=(e,t)=>t+"|"+(pn.Lt(R0(e))||""),nu={},Gm={Ot:()=>!0,Pt(e){me.error("memoryStorage error: "+e)},Lt:e=>e in nu?nu[e]:null,Ft:e=>e in nu?nu[e]:null,$t:(e,t)=>(nu[e]=t,!0),Dt(e){delete nu[e]}};let zl=null;const sn={Ot(){if(!kn(zl))return zl;if(zl=!0,ce(le))zl=!1;else try{const e="__support__";sn.$t(e,"xyz"),sn.Lt(e)!=='"xyz"'&&(zl=!1),sn.Dt(e)}catch{zl=!1}return zl},Pt(e){me.error("sessionStorage error: ",e)},Lt(e){try{return le==null?void 0:le.sessionStorage.getItem(e)}catch(t){sn.Pt(t)}return null},Ft(e){try{return JSON.parse(sn.Lt(e))||null}catch{}return null},$t(e,t){try{return le==null||le.sessionStorage.setItem(e,JSON.stringify(t)),!0}catch(n){sn.Pt(n)}return!1},Dt(e){try{le==null||le.sessionStorage.removeItem(e)}catch(t){sn.Pt(t)}}};var Ej=class{constructor(e){this._instance=e}get Nr(){return this._instance.config}get consent(){return this.Ba()?0:this.za}isOptedOut(){return this.Nr.cookieless_mode==="always"||this.isRejected()||this.consent===-1&&this.Nr.cookieless_mode==="on_reject"}isOptedIn(){return!this.isOptedOut()}isExplicitlyOptedOut(){return this.consent===0}isRejected(){return this.consent===0||this.consent===-1&&this.Nr.opt_out_capturing_by_default}optInOut(e){this.Ha.$t(this.Ua,e?1:0,this.Nr.cookie_expiration,this.Nr.cross_subdomain_cookie,this.Nr.secure_cookie)}reset(){this.Ha.Dt(this.Ua,this.Nr.cross_subdomain_cookie)}get Ua(){const{token:e,opt_out_capturing_cookie_prefix:t,consent_persistence_name:n}=this._instance.config;return n||(t?t+e:"__ph_opt_in_out_"+e)}get za(){const e=this.Ha.Lt(this.Ua);return jy(e)?1:We(b9,e)?0:-1}get Ha(){const e=this.Nr.opt_out_capturing_persistence_type,t=e==="localStorage"?Ot:pn,n=t.Ot()?t:Gm;if(!this.Wa||this.Wa!==n){this.Wa=n;const r=e==="localStorage"?pn:Ot;r.Lt(this.Ua)&&(this.Wa.Lt(this.Ua)||this.optInOut(jy(r.Lt(this.Ua))),r.Dt(this.Ua,this.Nr.cross_subdomain_cookie))}return this.Wa}Ba(){return!!this.Nr.respect_dnt&&[Fr==null?void 0:Fr.doNotTrack,Fr==null?void 0:Fr.msDoNotTrack,et.doNotTrack,Fr==null?void 0:Fr.globalPrivacyControl].some(e=>jy(e))}};function zR(e,t){var n;const r=e==null||(n=e.config)===null||n===void 0?void 0:n.get_current_url;if(!Mn(r))return t;try{const s=r(t);return dt(s)&&s?s:t}catch(s){return me.error("Error in get_current_url, falling back to window.location.href",s),t}}function h6(e){var t;return e instanceof Element&&(e.id==="__POSTHOG_TOOLBAR__"||!!(!((t=e.closest)===null||t===void 0)&&t.call(e,".toolbar-global-fade-container")))}function pi(e){return!!e&&e.nodeType===1}function Xn(e,t){return!!e&&!!e.tagName&&e.tagName.toLowerCase()===t.toLowerCase()}function VR(e){return!!e&&e.nodeType===3}function I0(e){return!!e&&e.nodeType===11&&pi(e.host)}function hb(e){return e?Xu(e).split(/\s+/):[]}function p6(e,t){const n=(function(r){var s;const i=typeof window>"u"?void 0:window,o=i==null||(s=i.location)===null||s===void 0?void 0:s.href;return ce(o)?void 0:zR(r,o)})(t);return!!(n&&e&&e.some(r=>n.match(r)))}function fc(e){let t="";switch(typeof e.className){case"string":t=e.className;break;case"object":t=(e.className&&"baseVal"in e.className?e.className.baseVal:null)||e.getAttribute("class")||"";break;default:t=""}return hb(t)}function HR(e){return ot(e)?null:Xu(e).split(/(\s+)/).filter(t=>Ou(t)).join("").replace(/[\r\n]/g," ").replace(/[ ]+/g," ").substring(0,255)}function ch(e){let t="";return sl(e)&&!Ju(e)&&e.childNodes&&e.childNodes.length&&Zt(e.childNodes,function(n){var r;VR(n)&&n.textContent&&(t+=(r=HR(n.textContent))!==null&&r!==void 0?r:"")}),Xu(t)}function Gf(e){var t;return ce(e.target)?e.srcElement||null:!((t=e.target)===null||t===void 0)&&t.shadowRoot?e.composedPath()[0]||null:e.target||null}const pb=["a","button","form","input","select","textarea","label"];function If(e,t){const n=e.matches||e.matchesSelector||e.msMatchesSelector||e.mozMatchesSelector||e.webkitMatchesSelector||e.oMatchesSelector;try{return!!n&&n.call(e,t)}catch{return!1}}function tw(e,t){if(ce(t))return!0;for(const n of e)if(t.some(r=>If(n,r)))return!0;return!1}function UR(e){const t=e.parentNode;return!(!t||!pi(t))&&t}const nm=[".ph-no-autocapture","[data-ph-no-autocapture]"],ZR=["next","previous","prev",">","<","→","←","›","‹","»","«","▶","◀","❯","❮"],mb=[...ZR,"+","-","−","–"],m6=mb.length+10,kj=["button","a","input","select","textarea","label"],Cj=["button","link","tab","menuitem","option"],g6=(e,t)=>/[a-z0-9]/i.test(t)?We(mb,t)?new RegExp(`\\b${t}\\b`).test(e):e.includes(t):e===t,Pj=e=>We(kj,e.tagName.toLowerCase())||We(Cj,(e.getAttribute("role")||"").toLowerCase());function n1(e){let t="",n="";const r=o=>{pi(o)&&sl(o)&&!Ju(o)&&(t+=` ${ch(o)}`,n=n||o.getAttribute("aria-label")||"",Zt(o.childNodes,r))};r(e),t=Xu(t.replace(/\s+/g," "));const s=(Ou(t)?t:"").toLowerCase(),i=e.getAttribute("aria-label")||(s?"":n);return{safeText:s,ariaLabel:Xu(i).toLowerCase()}}const v6=[".ph-no-rageclick",".ph-no-capture"],Aj=["","text","search","email","password","url","tel","number"];function BR(e,t){if(!(!(typeof window>"u")&&window)||gb(e))return!1;let n,r,s;var i,o;if(hs(t)?(n=!!t&&v6,r=void 0,s=!1):(n=(i=t==null?void 0:t.css_selector_ignorelist)!==null&&i!==void 0?i:v6,r=t==null?void 0:t.content_ignorelist,s=(o=t==null?void 0:t.ignore_text_selection)!==null&&o!==void 0&&o),n===!1||s&&(function(u){return!(!u||!pi(u))&&(!!Xn(u,"textarea")||(Xn(u,"input")?We(Aj,(u.getAttribute("type")||"").toLowerCase()):(function(d){var f;if(d.isContentEditable)return!0;const p=(f=d.getAttribute)===null||f===void 0?void 0:f.call(d,"contenteditable");return p==="true"||p===""})(u)))})(e))return!1;const{targetElementList:c}=WR(e,!1);return!(r&&(function(u,{safeText:d,ariaLabel:f}){let p;if(u===!0)p=ZR;else{if(!He(u))return!1;if(u.length>m6)return me.error(`[PostHog] content_ignorelist array cannot exceed ${m6} items. Use css_selector_ignorelist for more complex matching.`),!1;p=u.map(m=>m.toLowerCase())}return p.some(m=>g6(d,m)||g6(f,m))})(r,(function(u,d){for(const p of d)if(Pj(p))return n1(p);for(const p of d){try{var f;if(((f=window)===null||f===void 0?void 0:f.getComputedStyle(p).getPropertyValue("cursor"))!=="pointer")break}catch{break}const m=n1(p);if(m.safeText||m.ariaLabel)return m}return n1(u)})(e,c))||tw(c,n))}const gb=e=>!e||Xn(e,"html")||!pi(e),WR=(e,t)=>{const n=typeof window>"u"?void 0:window;if(!n||gb(e))return{parentIsUsefulElement:!1,targetElementList:[]};let r=!1;const s=[e];let i=e;for(;i.parentNode&&!Xn(i,"body");){if(I0(i.parentNode)){s.push(i.parentNode.host),i=i.parentNode.host;continue}const o=UR(i);if(!o)break;if(t||pb.indexOf(o.tagName.toLowerCase())>-1)r=!0;else try{const c=n.getComputedStyle(o);c&&c.getPropertyValue("cursor")==="pointer"&&(r=!0)}catch{}s.push(o),i=o}return{parentIsUsefulElement:r,targetElementList:s}};function sl(e){const t=new Set;let n=0;for(let i=e;i.parentNode&&!Xn(i,"body");i=i.parentNode){if(n++>=1e3||t.has(i))return!1;t.add(i);const o=fc(i);if(We(o,"ph-sensitive")||We(o,"ph-no-capture"))return!1}if(We(fc(e),"ph-include"))return!0;const r=e.type||"";if(dt(r))switch(r.toLowerCase()){case"hidden":case"password":return!1}const s=e.name||e.id||"";return!dt(s)||!/^cc|cardnum|ccnum|creditcard|csc|cvc|cvv|exp|pass|pwd|routing|seccode|securitycode|securitynum|socialsec|socsec|ssn/i.test(s.replace(/[^a-zA-Z0-9]/g,""))}function Ju(e){return!!(Xn(e,"input")&&!["button","checkbox","submit","reset"].includes(e.type)||Xn(e,"select")||Xn(e,"textarea")||e.getAttribute("contenteditable")==="true")}const y6=new RegExp("^(?:(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}))$"),_6=/(^|[^0-9A-Za-z_])([0-9][0-9 -]*[0-9])(?=$|[^0-9A-Za-z_])/g,Tj=[16,15,14,13],Rj=new RegExp("^(\\d{3}-?\\d{2}-?\\d{4})$"),w6=new RegExp("(^|[^0-9])((?!000|666)[0-9]{3}-?(?!00)[0-9]{2}-?(?!0000)[0-9]{4})(?=$|([^0-9]))","g"),b6=/[0-9A-Za-z_]/;function Ij(e){let t=0,n=!1;for(let r=e.length-1;r>=0;r--){let s=e.charCodeAt(r)-48;n&&(s*=2,s>9&&(s-=9)),t+=s,n=!n}return t%10==0}function Ou(e,t=!0){return!(ot(e)||dt(e)&&(e=Xu(e),(t?y6.test((e||"").replace(/[- ]/g,"")):(function(n){let r;for(_6.lastIndex=0;r=_6.exec(n);){const s=r[2];if(!s)continue;const i=s.replace(/[- ]/g,"");for(let o=0;i.length>o;o++)for(const c of Tj){const u=o+c;if(i.length>=u){const d=i.slice(o,u);if(y6.test(d)&&Ij(d))return!0}}}return!1})(e))||(t?Rj.test(e):(function(n){let r;for(w6.lastIndex=0;r=w6.exec(n);){const s=r[1],i=r[3];if(!(s&&i&&b6.test(s)&&b6.test(i)))return!0}return!1})(e))))}function x6(e){let t=ch(e);return t=`${t} ${KR(e)}`.trim(),Ou(t)?t:""}function KR(e){let t="";return e&&e.childNodes&&e.childNodes.length&&Zt(e.childNodes,function(n){var r;if(n&&((r=n.tagName)===null||r===void 0?void 0:r.toLowerCase())==="span")try{const s=ch(n);t=`${t} ${s}`.trim(),n.childNodes&&n.childNodes.length&&(t=`${t} ${KR(n)}`.trim())}catch(s){me.error("[AutoCapture]",s)}}),t}function S6(e){return e.replace(/"|\\"/g,'\\"')}function Oj(e){const t=e.attr__class;if(t)return He(t)?t:hb(t)}const rm=xn("[Dead Clicks]"),Mj=()=>!0,Nj=e=>{var t;const n=!!(!((t=e.instance.persistence)===null||t===void 0)&&t.get_property(ob)),r=e.instance.config.capture_dead_clicks;return hs(r)?r:!!lt(r)||n};var E6=class{get lazyLoadedDeadClicksAutocapture(){return this.Va}constructor(e,t,n){this.instance=e,this.isEnabled=t,this.onCapture=n,this.startIfEnabledOrStop()}onRemoteConfig(e){if(!e.ok)return;const t=e.config;"captureDeadClicks"in t&&(this.instance.persistence&&this.instance.persistence.register({[ob]:t.captureDeadClicks}),this.startIfEnabledOrStop())}startIfEnabledOrStop(){this.isEnabled(this)?this.Ga(()=>{this.Qa()}):this.stop()}Ga(e){var t,n,r;!((t=et.__PosthogExtensions__)===null||t===void 0)&&t.initDeadClicksAutocapture?e():(n=et.__PosthogExtensions__)===null||n===void 0||(r=n.loadExternalDependency)===null||r===void 0||r.call(n,this.instance,"dead-clicks-autocapture",s=>{s?rm.error("failed to load script",s):e()})}Qa(){var e;if(Ie){if(!this.Va&&(!((e=et.__PosthogExtensions__)===null||e===void 0)&&e.initDeadClicksAutocapture)){const t=lt(this.instance.config.capture_dead_clicks)?$({},this.instance.config.capture_dead_clicks):{};t.__onCapture=this.onCapture,this.onCapture&&(t.capture_dead_swipes=!1),this.Va=et.__PosthogExtensions__.initDeadClicksAutocapture(this.instance,t),this.Va.start(Ie),rm.info("starting...")}}else rm.error("`document` not found. Cannot start.")}stop(){this.Va&&(this.Va.stop(),this.Va=void 0,rm.info("stopping..."))}};const mf=xn("[SegmentIntegration]");function k6(e,t,n=!0){const r=e.config.segment;if(!r)return t();const{analytics:s,filterProperties:i}=(c=>Mn(c.register))(o=r)?{analytics:o}:o;var o;(function(c,u,d,f){const p=v=>{const _=()=>v.anonymousId()||Di();c.config.get_device_id=_,f&&v.id()&&(c.register({distinct_id:v.id(),$device_id:_()}),c.persistence.set_property(Jr,Wm)),d(f?void 0:v.anonymousId()||void 0)},m=u.user();"then"in m&&Mn(m.then)?m.then(p):p(m)})(e,s,c=>{s.register(((u,d,{filterProperties:f}={})=>{typeof Promise<"u"&&Promise.resolve||mf.warn("This browser does not have Promise support, and can not use the segment integration");const p=(m,v)=>{if(!v)return m;const _=!!d&&m.event.anonymousId===d&&!m.event.userId;_||m.event.userId||m.event.anonymousId===u.get_distinct_id()||(mf.info("No userId set, resetting PostHog"),u.reset()),_||(d=void 0),m.event.userId&&m.event.userId!==u.get_distinct_id()&&(mf.info("UserId set, identifying with PostHog"),u.identify(m.event.userId));let w=u.calculateEventProperties(v,m.event.properties);if(!ot(f)){const b=m.event.properties||{},S={};for(const C of Object.keys(w))J2.call(b,C)||(S[C]=w[C]);const E=((C,A)=>{const T=He(C)?C:[C];let M=$({},A);for(const O of T)try{if(M=O(M),ot(M))return null}catch(R){return mf.error("Error in Segment filterProperties:",R),null}return M})(f,S);if(ot(E))return m;w=E}return m.event.properties=Object.assign({},w,m.event.properties),m};return{name:"PostHog JS",type:"enrichment",version:"1.0.0",isLoaded(){return!0},load(){return Promise.resolve()},track(m){return p(m,m.event.event)},page(m){return p(m,db)},identify(m){return p(m,DR)},screen(m){return p(m,"$screen")}}})(e,c,{filterProperties:i})).then(()=>{t()},u=>{mf.error("Failed to register the Segment integration",u),t()})},n)}const GR="posthog-js";function qR(e,{organization:t,projectId:n,prefix:r,severityAllowList:s=["error"],sendExceptionsToPostHog:i=!0}={}){return o=>{var c,u,d,f,p;if(s!=="*"&&!s.includes(o.level)||!e.__loaded)return o;o.tags||(o.tags={});const m=e.requestRouter.endpointFor("ui",`/project/${e.config.token}/person/${e.get_distinct_id()}`);o.tags["PostHog Person URL"]=m,e.sessionRecordingStarted()&&(o.tags["PostHog Recording URL"]=e.get_session_replay_url({withTimestamp:!0}));const v=((c=o.exception)===null||c===void 0?void 0:c.values)||[],_=v.map(S=>$($({},S),{},{stacktrace:S.stacktrace?$($({},S.stacktrace),{},{type:"raw",frames:(S.stacktrace.frames||[]).map(E=>$($({},E),{},{platform:"web:javascript"}))}):void 0})),w={$exception_message:((u=v[0])===null||u===void 0?void 0:u.value)||o.message,$exception_type:(d=v[0])===null||d===void 0?void 0:d.type,$exception_level:o.level,$exception_list:_,$sentry_event_id:o.event_id,$sentry_exception:o.exception,$sentry_exception_message:((f=v[0])===null||f===void 0?void 0:f.value)||o.message,$sentry_exception_type:(p=v[0])===null||p===void 0?void 0:p.type,$sentry_tags:o.tags};var b;return t&&n&&(w.$sentry_url=(r||"https://sentry.io/organizations/")+t+"/issues/?project="+n+"&query="+o.event_id),i&&((b=e.exceptions)===null||b===void 0||b.sendExceptionEvent(w)),o}}var Lj=class{constructor(e,t,n,r,s,i){this.name=GR,this.setupOnce=function(o){o(qR(e,{organization:t,projectId:n,prefix:r,severityAllowList:s,sendExceptionsToPostHog:i==null||i}))}}},C6=class{constructor(e){this.Ja=(t,n,r)=>{r&&(r.noSessionId||r.activityTimeout||r.sessionPastMaximumLength||r.crossTabAdoption)&&(me.info("[PageViewManager] Session rotated, clearing pageview state",{sessionId:t,changeReason:r}),this.Za=void 0,this._instance.scrollManager.resetContext())},this._instance=e,this.Ka()}Ka(){var e;this.Ya=(e=this._instance.sessionManager)===null||e===void 0?void 0:e.onSessionId(this.Ja)}destroy(){var e;(e=this.Ya)===null||e===void 0||e.call(this),this.Ya=void 0}doPageView(e,t){var n;const r=this.Xa(e,t);return this.Za={pathname:(n=le==null?void 0:le.location.pathname)!==null&&n!==void 0?n:"",pageViewId:t,timestamp:e},this._instance.scrollManager.resetContext(),r}doPageLeave(e){var t;return this.Xa(e,(t=this.Za)===null||t===void 0?void 0:t.pageViewId)}doEvent(){var e;return{$pageview_id:(e=this.Za)===null||e===void 0?void 0:e.pageViewId}}Xa(e,t){const n=this.Za;if(!n)return{$pageview_id:t};let r={$pageview_id:t,$prev_pageview_id:n.pageViewId};const s=this._instance.scrollManager.getContext();if(s&&!this._instance.config.disable_scroll_properties){let{maxScrollHeight:i,lastScrollY:o,maxScrollY:c,maxContentHeight:u,lastContentY:d,maxContentY:f}=s;if(!(ce(i)||ce(o)||ce(c)||ce(u)||ce(d)||ce(f))){i=Math.ceil(i),o=Math.ceil(o),c=Math.ceil(c),u=Math.ceil(u),d=Math.ceil(d),f=Math.ceil(f);const p=i>1?ho(o/i,0,1,me):1,m=i>1?ho(c/i,0,1,me):1,v=u>1?ho(d/u,0,1,me):1,_=u>1?ho(f/u,0,1,me):1;r=mn(r,{$prev_pageview_last_scroll:o,$prev_pageview_last_scroll_percentage:p,$prev_pageview_max_scroll:c,$prev_pageview_max_scroll_percentage:m,$prev_pageview_last_content:d,$prev_pageview_last_content_percentage:v,$prev_pageview_max_content:f,$prev_pageview_max_content_percentage:_})}}return n.pathname&&(r.$prev_pageview_pathname=n.pathname),n.timestamp&&(r.$prev_pageview_duration=(e.getTime()-n.timestamp.getTime())/1e3),r}};const gf=["flags","surveys"],$j={[qF]:{exposure:"hidden"},[A0]:{exposure:"hidden"},[YF]:{exposure:"hidden"},[K_]:{exposure:"hidden"},[Iu]:{exposure:"hidden"},[Bf]:{exposure:"hidden"},[vR]:{exposure:"event"},[G_]:{exposure:"hidden"},[_R]:{exposure:"hidden"},[q_]:{exposure:"event"},[yR]:{exposure:"hidden"},[Y_]:{exposure:"event"},[Q_]:{exposure:"event"},[ob]:{exposure:"event"},[ab]:{exposure:"hidden"},[wR]:{exposure:"event"},[Wf]:{exposure:"hidden"},[QF]:{exposure:"hidden"},[wu]:{exposure:"hidden"},[bR]:{exposure:"event"},[XF]:{exposure:"event",shouldSkipFromEventProperties:e=>kn(e)},[rj]:{exposure:"event"},[sj]:{exposure:"event"},[ij]:{exposure:"event"},[oj]:{exposure:"event"},[aj]:{exposure:"hidden"},[$i]:{exposure:"hidden",storageGroup:"flags"},[qo]:{exposure:"hidden",storageGroup:"flags"},[Z_]:{exposure:"hidden"},[uc]:{exposure:"hidden",storageGroup:"flags"},[Ja]:{exposure:"hidden",storageGroup:"flags"},[dc]:{exposure:"hidden",storageGroup:"flags",volatile:!0},[Zf]:{exposure:"hidden",storageGroup:"flags"},[ro]:{exposure:"hidden"},[Yl]:{exposure:"hidden"},[Xa]:{exposure:"hidden"},[Qa]:{exposure:"hidden"},[Rf]:{exposure:"hidden",storageGroup:"surveys"},[P0]:{exposure:"hidden",storageGroup:"surveys",volatile:!0},[W_]:{exposure:"event"},[Zm]:{exposure:"hidden"},[Bm]:{exposure:"hidden"},[X_]:{exposure:"hidden"},[lj]:{exposure:"hidden"},[cj]:{exposure:"hidden"},[uj]:{exposure:"event"},[dj]:{exposure:"event"},[fj]:{exposure:"event"},[hj]:{exposure:"event"},[co]:{exposure:"hidden"},[Tf]:{exposure:"hidden"},[xR]:{exposure:"event"},[lh]:{exposure:"hidden"},[rl]:{exposure:"hidden",storageGroup:"flags",volatile:!0},[Jr]:{exposure:"hidden"},[J_]:{exposure:"hidden"},[SR]:{exposure:"hidden"},[ER]:{exposure:"hidden"},[kR]:{exposure:"hidden"},[bu]:{exposure:"hidden"},[lb]:{exposure:"hidden"},[JF]:{exposure:"event"},[ej]:{exposure:"event"},[tj]:{exposure:"event"},[nj]:{exposure:"event"},[PR]:{exposure:"event"},[AR]:{exposure:"event"},[cb]:{exposure:"hidden"},[ub]:{exposure:"hidden"},[TR]:{exposure:"hidden"},[RR]:{exposure:"hidden"},[IR]:{exposure:"hidden"},[OR]:{exposure:"hidden"},[MR]:{exposure:"hidden"},[NR]:{exposure:"hidden"},[LR]:{exposure:"hidden"},[pj]:{exposure:"event"}},Dj=[["$posthog_sr_group_event_trigger_",{exposure:"hidden"}],["$posthog_sr_group_url_trigger_",{exposure:"hidden"}],["$posthog_sr_group_sampling_",{exposure:"hidden"}]],Cr=e=>{const t=$j[e];if(t)return t;for(const[n,r]of Dj)if(e.indexOf(n)===0)return r};function vb(){try{return Intl.DateTimeFormat().resolvedOptions().timeZone}catch{return}}const yo=e=>{const t=typeof document>"u"?void 0:document,n=t==null?void 0:t.createElement("a");return ce(n)?null:(n.href=e,n)},YR=()=>{try{return"u">typeof window&&window.navigator.onLine!==!1}catch{return!1}},QR=(e,t)=>e>=t&&YR(),XR=(e,t,n,r)=>{if(e===0){if(YR()){const s=t+1;return s===n&&r(),s}return t}return 0},Su=(e,t)=>{try{let n;return JSON.stringify(e,(r,s)=>{var i;return xd(s)?((i=n)!==null&&i!==void 0||(n=new WeakMap),n.has(s)||n.set(s,FR(s)),n.get(s)):typeof s=="bigint"?s.toString():s},t)}catch{return hT(e)}},ed=function(e,t){const n=((e.split("#")[0]||"").split(/\?(.*)/)[1]||"").replace(/^\?+/g,"").split("&");let r;for(let s=0;n.length>s;s++){const i=n[s].split(/=(.*)/);if(i[0]===t){r=i;break}}if(!He(r)||2>r.length)return"";{let s=r[1].replace(/\+/g," ");try{s=decodeURIComponent(s)}catch{me.error("Skipping decoding for malformed query param: "+s)}return s}},uh=function(e,t,n){if(!e||!t||!t.length)return e;const r=e.split(/#(.*)/),s=r[1],i=(r[0]||"").split(/\?(.*)/),o=i[1],c=i[0],u=(o||"").split("&"),d=[];for(let p=0;u.length>p;p++){const m=u[p].split("?");let v=0;for(;m.length>v&&!t.includes(m[v].split("=")[0]);)v++;d.push(m.length>v?m.slice(0,v).concat(m[v].split("=")[0]+"="+n).join("?"):u[p])}let f=c;return o!=null&&(f+="?"+d.join("&")),s!=null&&(f+="#"+s),f},O0=function(e,t){const n=e.match(new RegExp(t+"=([^&]*)"));return n?n[1]:null},td=["gclid","gclsrc","dclid","gbraid","wbraid","fbclid","msclkid","twclid","li_fat_id","igshid","ttclid","rdt_cid","epik","qclid","sccid","oppref","bfcid","irclid","_kx"],Fj=["utm_source","utm_medium","utm_campaign","utm_content","utm_term","gad_source","mc_cid",...td],dh="<masked>",jj=["li_fat_id"];function JR(e,t,n){if(!Ie)return{};const r=t?[...td,...n||[]]:[],s=eI(uh(Ie.URL,r,dh),e),i=(function(){const o={};return Zt(jj,function(c){const u=Kf(c);o[c]=u||null}),o})();return mn(i,s)}function eI(e,t){const n=Fj.concat(t||[]),r={};return Zt(n,function(s){const i=ed(e,s);r[s]=i||null}),r}function tI(e){const t=(function(s){return s?s.search("https?://(.*)google.([^/?]*)")===0?"google":s.search("https?://(.*)bing.com")===0?"bing":s.search("https?://(.*)yahoo.com")===0?"yahoo":s.search("https?://(.*)duckduckgo.com")===0?"duckduckgo":null:null})(e),n=t!="yahoo"?"q":"p",r={};if(!kn(t)){r.$search_engine=t;const s=Ie?ed(Ie.referrer,n):"";s.length&&(r.ph_keyword=s)}return r}function nI(){return navigator.language||navigator.userLanguage}function zj(){const e=nI();return typeof e=="string"?e.split("-")[0]:void 0}const M0="$direct";function rI(){return(Ie==null?void 0:Ie.referrer)||M0}function sI(e,t,n=!1){const r=e?[...td,...t||[]]:[],s=n?nl(cn==null?void 0:cn.href):cn==null?void 0:cn.href,i=s==null?void 0:s.substring(0,1e3);return{r:rI().substring(0,1e3),u:i?uh(i,r,dh):void 0}}function iI(e,t=!1){var n;const{r,u:s}=e,i=t?nl(s):s,o={$referrer:r,$referring_domain:r==null?void 0:r==M0?M0:(n=yo(r))===null||n===void 0?void 0:n.host};if(i){o.$current_url=i;const c=yo(i);o.$host=c==null?void 0:c.host,o.$pathname=c==null?void 0:c.pathname;const u=eI(i);mn(o,u)}if(r){const c=tI(r);mn(o,c)}return o}function Vj(){try{return new Date().getTimezoneOffset()}catch{return}}const Hj={flags:rl,surveys:P0},Uj=["cookie","localstorage","localstorage+cookie","sessionstorage","memory"],sm=e=>`${e}_cookie_identity_change_pending`,im=e=>{let t="",n=0;for(const r of e){const s=encodeURIComponent(JSON.stringify(r).slice(1,-1)).length;if(n+s>1e3)break;t+=r,n+=s}return t},Qn="main",Vo=[$i,qo,uc,Ja,dc,rl,Zf,Xa],r1=e=>Vo.indexOf(e)!==-1,Of=[Iu,Bf],P6=e=>Of.indexOf(e)!==-1,No=(e,t)=>{try{return JSON.stringify(e)===JSON.stringify(t)}catch{return e===t}},ru=e=>{if(!e)return{};const t=JSON.parse(e);return lt(t)?t:{}},A6=(e,t)=>{Zt(e,(n,r)=>{const s=Cr(r);s&&s.exposure!=="event"||{}.hasOwnProperty.call(t,r)||delete e[r]})};var s1=class{constructor(e,t,n=!0,r=!e.cookieless_mode){if(this.tu={},this.eu=!1,this.iu=!1,this.nu=!1,this.su=!1,this.ru=!1,this.ou=new Map,this.lu=!1,this.au=!1,this.uu=!1,this.cu=new Set,this.hu=new Set,this.Nr=e,this.du=n,this.props={},this.vu=void 0,this.fu=(s=>{let i="";return s.token&&(i=s.token.replace(/\+/g,"PL").replace(/\//g,"SL").replace(/=/g,"EQ")),s.persistence_name?"ph_"+s.persistence_name:"ph_"+i+"_posthog"})(e),this.pi=e.disable_persistence||!!t,this.Ha=this.pu(e),this.nu=this.gu(e),this.load(r),this.mu(),e.debug&&me.info("Persistence loaded",e.persistence,$({},this.props)),this.update_config(e,e,t),this.save(),le){const s=()=>this.flush();Lt(le,"beforeunload",s,{capture:!1}),Lt(le,"pagehide",s,{capture:!1}),this.yu=i=>{if(this.eu&&(!i.storageArea||i.storageArea===(le==null?void 0:le.localStorage))&&i.key)if(i.key!==this.fu){if(this.nu){const o=gf.find(c=>i.key===this.bu(c));o&&this._u(i.key,o)}}else this._u(i.key,Qn)},Lt(le,"storage",this.yu)}}markCrossTabFeatureFlagChanges(e){Object.entries(e).forEach(([t,n])=>{const r=this.ou.get(t);if(!r1(t)||r===!0)return;if(n===!0)return void this.wu(t,!0);const s=new Set(r||[]);n.forEach(i=>s.add(i)),s.size&&this.wu(t,s)})}onCrossTabFeatureFlagChange(e){return this.hu.add(e),()=>this.hu.delete(e)}destroy(){this.yu&&le&&(le.removeEventListener("storage",this.yu),this.yu=void 0),this.hu.clear()}_u(e,t,n=!0){if(this.pi)return!1;let r,s;try{if(s=Ot.Lt(e),kn(s)){const c=this.ku(t);return c.storageValue=null,t!==Qn?c.persisted=!1:this.Su({}),!1}r=ru(s)}catch{return!1}t===Qn&&this.Su(r);const i=t===Qn?r:Ot.Ft(this.fu);if(i&&this.xu(i))return!1;const o=this.$u(r,t,n);return t===Qn&&this.nu&&!No(this.Cu().main,r)||this.Tu(r,t,!0,s),o}xu(e){const t=this.props[ui],n=e[ui];return!ce(t)&&!ce(n)&&t!==n}Tu(e,t,n,r){const s=this.ku(t);s.storageValue=r,t!==Qn&&(s.persisted=n);try{s.fingerprint=this.Iu(e,t)}catch{s.fingerprint=void 0}}$u(e,t,n){let r=!1;return Vo.forEach(s=>{var i;const o=(i=Cr(s))===null||i===void 0?void 0:i.storageGroup;if(t===Qn&&this.nu&&o||t!==Qn&&o!==t)return;const c=s in e,u=this.Mu(s,c?e[s]:void 0),d=this.ou.has(s)?s in this.props:c;d===s in this.props&&No(u,this.props[s])||(d?this.Eu(s,u,!1):this.Au(s,!1),r=!0)}),r&&n&&this.hu.forEach(s=>s()),r}Su(e){const t=this.iu&&this.Nr.cookieWinsOnConflict?[...La,...this.Nr.cookie_persisted_properties||[]]:[];Of.forEach(n=>{this.cu.has(n)||t.indexOf(n)!==-1||(n in e?No(e[n],this.props[n])||this.Eu(n,e[n],!1):n in this.props&&this.Au(n,!1))})}Ru(){return this.iu&&this.eu&&!this.Nr.cookieWinsOnConflict}Pu(){if(!this.Ru())return;let e,t;try{e=pn.Lt(this.fu)||void 0}catch{return}if(e&&e!==this.Ou){this.Ou=e;try{t=em(JSON.parse(e))}catch{return}Of.forEach(n=>{!(n in t)||n in this.props||this.cu.has(n)||this.Eu(n,t[n],!1)})}}Fu(e){if(this.Ru())try{const t=JSON.stringify(tm(e,this.Nr.cookie_persisted_properties||[])),n=pn.Lt(this.fu)||void 0;n===t&&(this.Ou=n)}catch{}}Du(){if(!this.eu)return!1;try{this.uu=!1;const e=Ot.Lt(this.fu),t=this.ku(Qn);let n,r=!1,s=!1;if(e!==t.storageValue)if(kn(e))dt(t.storageValue)&&this.Su({}),t.storageValue=null;else{if(n=ru(e),this.Su(n),this.uu=!this.au&&this.xu(n),this.uu)return!1;s=this.$u(n,Qn,!1),!this.nu||No(this.Cu().main,n)?this.Tu(n,Qn,!0,e):t.storageValue=e,r=!0}return this.nu&&gf.forEach(i=>{const o=Ot.Lt(this.bu(i)),c=this.ku(i),u=n||{},d=r&&Vo.some(p=>{var m;return((m=Cr(p))===null||m===void 0?void 0:m.storageGroup)===i&&p in u});if(o===c.storageValue&&!d)return;if(kn(o))return c.storageValue=null,c.persisted=!1,void(d&&(s=this.$u(u,i,!1)||s));const f=ru(o);s=this.$u(f,i,!1)||s,this.Tu(f,i,!0,o)}),s}catch{return!1}}wu(e,t){this.ou.set(e,t);const n=Cr(e);n!=null&&n.volatile||(this.ku((this.nu?n==null?void 0:n.storageGroup:void 0)||Qn).fingerprint=void 0,this.Lu(e))}Nu(){Vo.forEach(e=>this.ou.set(e,!0))}mu(){if(this.eu)try{const e=Ot.Lt(this.fu),t=ru(e);this.ku(Qn).storageValue=e,Vo.forEach(n=>{var r;const s=this.nu?(r=Cr(n))===null||r===void 0?void 0:r.storageGroup:void 0,i=s?Ot.Lt(this.bu(s)):null;if(s){const c=this.ku(s);c.storageValue=i,c.persisted=!kn(i)}const o=s&&!kn(i)?ru(i):t;n in this.props?this.ju(n,o[n],this.props[n]):n in o&&this.wu(n,!0)})}catch{}}Mu(e,t){const n=this.ou.get(e);if(!n)return t;if(n===!0)return this.props[e];if(e==="$active_feature_flags"){const i=new Set(He(t)?t:[]),o=new Set(He(this.props[e])?this.props[e]:[]);return n.forEach(c=>o.has(c)?i.add(c):i.delete(c)),Array.from(i)}const r=lt(t)?$({},t):{},s=lt(this.props[e])?this.props[e]:{};return n.forEach(i=>{i in s?r[i]=s[i]:delete r[i]}),r}ju(e,t,n){if(!r1(e))return;const r=this.ou.get(e);if(r===!0)return;let s=t;if(this.eu)try{var i;const c=this.nu?(i=Cr(e))===null||i===void 0?void 0:i.storageGroup:void 0,u=c?this.bu(c):this.fu;s=ru(Ot.Lt(u))[e]}catch{}const o=new Set(r||[]);if(e==="$active_feature_flags"){if(!ce(t)&&!He(t)||!ce(s)&&!He(s)||!He(n))return void this.wu(e,!0);const c=new Set(t||[]),u=new Set(s||[]),d=new Set(n);new Set([...c,...d]).forEach(f=>{c.has(f)!==d.has(f)&&o.add(f)}),o.forEach(f=>{u.has(f)===d.has(f)&&o.delete(f)})}else{if(!lt(n))return void(No(s,n)?this.ou.delete(e):this.wu(e,!0));{if(!ce(t)&&!lt(t)||ce(t)&&Ps(n)&&ce(s))return void this.wu(e,!0);const c=lt(t)?t:{},u=lt(s)?s:{};new Set([...Object.keys(c),...Object.keys(n)]).forEach(d=>{d in c==d in n&&No(c[d],n[d])||o.add(d)}),o.forEach(d=>{d in u==d in n&&No(u[d],n[d])&&o.delete(d)})}}o.size?this.wu(e,o):this.ou.delete(e)}qu(){var e;const t=(e=this.Nr)===null||e===void 0?void 0:e.persistence_save_debounce_ms;return Fn(t)&&t>0?t:0}Bu(e){if(this.Nr.cookieWinsOnConflict&&this.Nr.persistence.toLowerCase()==="localstorage+cookie")if(e)try{const t=tm(e,this.Nr.cookie_persisted_properties||[]),n=d6(t,this.Nr.cookie_persisted_properties||[]),r=JSON.stringify(t)+"|"+JSON.stringify(n),s=pn.Lt(this.fu)||void 0;s&&t1(this.fu,s)===r&&(this.zu=r,this.Hu=s)}catch{}else try{const t=pn.Lt(this.fu)||void 0;this.zu=t?t1(this.fu,t):void 0,this.Hu=t}catch{}}syncCookieProperties(){return this.Uu(this.Nr)}Uu(e,t=!1){if(this.pi&&!t||this.ru||!e.cookieWinsOnConflict||e.persistence.toLowerCase()!=="localstorage+cookie")return!1;let n;try{n=pn.Lt(this.fu)||void 0}catch{}if(!n||n===this.Hu)return!1;const r=t1(this.fu,n);let s;try{s=em(JSON.parse(n))}catch{return!1}if((pn.Lt(this.fu)||void 0)!==n)return!1;this.zu=r,this.Hu=n;const i=f6(this.fu,n),o=[...La,...i.properties],c={};if(Object.keys(s).forEach(w=>{const b=s[w];(ce(b)||kn(b)||b===""||w==="$user_state"&&b!=="anonymous"&&b!=="identified")&&(c[w]=!0,delete s[w])}),Ps(s))return!1;const u="distinct_id"in s||s.$user_state==="anonymous"||s.$user_state==="identified",d=this.props,f=d[ui],p=d[Jr],m=mn({},d);[...La,...e.cookie_persisted_properties||[]].forEach(w=>{if(o.indexOf(w)!==-1&&!(w in s)&&!c[w]&&(u||w!=="distinct_id"&&w!=="$user_state")){const b=m[w];(i.isValid||La.indexOf(w)===-1||b!==!1&&b!==0)&&delete m[w]}}),this.props=mn(m,s),Vo.forEach(w=>{const b=w in this.props;w in d===b&&No(d[w],this.props[w])||(b?this.ju(w,d[w],this.props[w]):this.wu(w,!0))}),!u||"$user_state"in s||"$user_state"in this.props||this.Eu(Jr,Yo);const v=this.props[ui],_=this.props[Jr];return!u||v===f&&_===p||(this.au=!0,this.su=!0,sn.$t(sm(this.fu),!0),this.Au(Xa),this.Au(qo),this.Au($i),this.Au(uc),this.Au(Ja),this.Au(dc),this.Au(rl),this.Au(lh),this.Au(co),_!=="anonymous"||p!=="identified"&&s.$user_state!=="anonymous"&&(ce(f)||v===f)||(A6(this.props,s),this.Au(Qa)),_==="identified"?this.props.$user_id=v:delete this.props.$user_id,this.Au(A0)),!0}consumeCookieIdentityChange(){const e=sm(this.fu),t=this.su||!!sn.Lt(e);return this.su=!1,t&&sn.Dt(e),t}Wu(e=!1){return!(this.ru||this.pi&&!e||!this.Nr.cookieWinsOnConflict||this.Nr.persistence.toLowerCase()!=="localstorage+cookie"||(this.ru=!0,0))}Vu(){this.ru&&(ce(this.Gu)||(clearTimeout(this.Gu),this.Gu=void 0),delete this.tu[Qn],this.Qu(!0))}Ju(e=!0){if(this.ru)try{e?this.Vu():ce(this.Gu)||(clearTimeout(this.Gu),this.Gu=void 0)}finally{this.ru=!1}}isDisabled(){return!!this.pi}pu(e){Uj.indexOf(e.persistence.toLowerCase())===-1&&(me.critical("Unknown persistence type "+e.persistence+"; falling back to localStorage+cookie"),e.persistence="localStorage+cookie");const t=((o=[],c=!1,u=()=>!1)=>{const d=[...La,...o];return $($({},Ot),{},{Ft(f){try{let m,v={};try{m=pn.Lt(f)||void 0,v=m?em(JSON.parse(m)):{}}catch{}const _=JSON.parse(Ot.Lt(f)||"{}");let w;if(c){const b=f6(f,m),S=[...La,...b.properties],E={};Object.keys(v).forEach(A=>{const T=v[A];kn(T)||T===""||A==="$user_state"&&T!=="anonymous"&&T!=="identified"||(E[A]=T)});const C="distinct_id"in E||E.$user_state==="anonymous"||E.$user_state==="identified";if(Object.keys(E).length>0){var p;const A=_[ui],T=(p=_.$user_state)!==null&&p!==void 0?p:Yo;d.forEach(M=>{if(S.indexOf(M)!==-1&&!(M in v)&&(C||M!=="distinct_id"&&M!=="$user_state")){const O=_[M];(b.isValid||La.indexOf(M)===-1||O!==!1&&O!==0)&&delete _[M]}}),!C||"$user_state"in v||"$user_state"in _||(_[Jr]=Yo),!C||("distinct_id"in E?E[ui]:_[ui])===A&&("$user_state"in E?E[Jr]:_[Jr])===T||(e1.forEach(M=>delete _[M]),E.$user_state==="identified"&&"distinct_id"in E?_.$user_id=E[ui]:delete _.$user_id,E.$user_state!=="identified"&&(delete _[xR],delete _[Qa]),delete _.__alias)}w=mn(_,E)}else w=mn(v,_);return u()||Ot.$t(f,w),w}catch{}return null},$t(f,p,m,v,_,w){const b=Ot.$t(f,p,void 0,void 0,w);try{const S=tm(p,o);if(Object.keys(S).length){if(c){const E=R0(f),C=d6(S,o);if(pn.$t(E,C,m,v,_,w),pn.Lt(E)!==JSON.stringify(C)){pn.Dt(E,v);const A=tm(p);return pn.$t(f,A,m,v,_,w),b}}pn.$t(f,S,m,v,_,w)}}catch(S){Ot.Pt(S)}return b},Dt(f,p){try{le==null||le.localStorage.removeItem(f),pn.Dt(f,p),pn.Dt(R0(f),p)}catch(m){Ot.Pt(m)}}})})(e.cookie_persisted_properties||[],e.cookieWinsOnConflict,()=>!!this.pi);let n,r=!1,s=!1;const i=e.persistence.toLowerCase();return i==="localstorage"&&Ot.Ot()?(n=Ot,s=!0):i==="localstorage+cookie"&&t.Ot()?(n=t,s=!0,r=!0):i==="sessionstorage"&&sn.Ot()?n=sn:i==="memory"?n=Gm:i==="cookie"&&pn.Ot()?(n=pn,r=!0):t.Ot()?(n=t,s=!0,r=!0):pn.Ot()?(n=pn,r=!0):n=Gm,this.eu=s,this.iu=r,n}bu(e){return`${this.fu}__${e}`}gu(e){return this.eu&&!!e.split_storage}properties(){const e={};return Zt(this.props,(t,n)=>{const r=Cr(n);if(!r||r.exposure==="event"){var s;if(!(r==null||(s=r.shouldSkipFromEventProperties)===null||s===void 0)&&s.call(r,t))return;e[n]=t}}),e}load(e=!1){if(this.pi&&!e)return;const t=this.Nr.cookieWinsOnConflict&&this.Nr.persistence.toLowerCase()==="localstorage+cookie",n=t?Ot.Ft(this.fu):null;let r={};if(t)try{r=em(pn.Ft(this.fu)),Zt(r,(c,u)=>{(ce(c)||kn(c)||c==="")&&delete r[u]})}catch{}const s=this.Ha.Ft(this.fu);if(s&&(this.props=mn({},s)),this.nu&&this.Zu(),t&&s){var i,o;const c=n==null?void 0:n[ui],u=(i=n==null?void 0:n.$user_state)!==null&&i!==void 0?i:Yo,d=s[ui],f=(o=s.$user_state)!==null&&o!==void 0?o:Yo;if(d!==c||f!==u){this.su=!0,this.pi||sn.$t(sm(this.fu),!0);const p=mn({},this.props);e1.forEach(v=>delete p[v]),f!=="anonymous"||u!=="identified"&&r.$user_state!=="anonymous"&&(ce(c)||d===c)||(A6(p,r),delete p[Qa]),this.props=p;const m=new Set;e1.forEach(v=>{var _;const w=(_=Cr(v))===null||_===void 0?void 0:_.storageGroup;w&&m.add(w)}),m.forEach(v=>{if(this.pi)return;const _={};Zt(this.props,(w,b)=>{var S;((S=Cr(b))===null||S===void 0?void 0:S.storageGroup)===v&&(_[b]=w)}),Ps(_)?(Ot.Dt(this.bu(v)),this.tu[v]={}):Ot.$t(this.bu(v),_)&&(this.tu[v]={persisted:!0,fingerprint:this.Iu(_,v)})})}}sn.Lt(sm(this.fu))&&(this.su=!0)}Zu(){for(const e of gf){const t=Ot.Ft(this.bu(e));if(t&&!Ps(t)){const n=this.ku(e);n.persisted=!0,this.Ku(e)||(n.fingerprint=this.Iu(t,e)),this.Yu(e,t)||mn(this.props,t)}}}Ku(e){return Object.keys(this.props).some(t=>{var n;return((n=Cr(t))===null||n===void 0?void 0:n.storageGroup)===e})}Yu(e,t){const n=Hj[e];if(!n)return!1;const r=t[n],s=this.props[n];return Fn(r)&&Fn(s)&&s>r}refreshKey(e){this.Xu([e])}Xu(e){if(this.pi)return;let t,n=!1;const r=()=>(n||(t=this.Ha.Ft(this.fu),n=!0),t);e.forEach(s=>{var i;if(this.cu.has(s))return;const o=this.nu?(i=Cr(s))===null||i===void 0?void 0:i.storageGroup:void 0,c=o?Ot.Ft(this.bu(o)):r();if(c&&s in c)this.Eu(s,c[s],!1);else{if(o){const u=r();if(u&&s in u)return void this.Eu(s,u[s],!1)}this.Au(s,!1)}})}refreshMetaIdentifiers(){this.pi||(this.tc()?this.ec():this.Xu(Of))}ec(){const e=this.nc();(ce(e)||e!==this.sc)&&(this.Xu(Of),this.rc(e))}rc(e=this.nc()){this.sc=this.cu.size===0?e:void 0}refreshMetaIdentifiersBeforeCapture(){this.pi||this.ru||(this.tc()||this.Pu(),this.ec())}tc(){return this.Ha===pn||this.Ha===sn||this.Ha===Gm}nc(){const e=this.Ha.Lt(this.fu);return dt(e)?e:void 0}save(){if(this.pi)return;const e=this.qu();e>0?ce(this.Gu)&&(this.Gu=setTimeout(()=>{this.Gu=void 0,this.Qu()},e)):this.Qu()}flush(){ce(this.Gu)||(clearTimeout(this.Gu),this.Gu=void 0,this.Qu())}Qu(e=!1){if(this.pi||this.ru&&!e)return;e||(this.syncCookieProperties(),this.tc()&&this.refreshMetaIdentifiers());const t=!e&&!this.lu;t||(this.uu=!1);const n=!!t&&this.Du();if(this.uu)return void(this.Nr.debug&&me.warn("skipping persistence write because storage belongs to a different distinct ID"));if(e||this.Pu(),this.nu)return this.oc(),void(n&&this.hu.forEach(s=>s()));const r=this.lc(this.Ha,this.fu,this.props,Qn);r==="written"&&(this.Bu(this.props),this.Fu(this.props)),r!=="failed"&&(this.ou.clear(),this.au=!1,this.cu.clear()),r==="written"&&this.rc(),n&&this.hu.forEach(s=>s())}oc(){const{main:e,groups:t}=this.Cu(),n=this.lc(this.Ha,this.fu,e,Qn);n==="written"&&(this.Bu(e),this.Fu(e)),n!=="failed"&&(this.au=!1,this.cu.clear(),Vo.forEach(s=>{var i;!((i=Cr(s))===null||i===void 0)&&i.storageGroup||this.ou.delete(s)})),n==="written"&&this.rc();for(const s of gf){var r;const i=t[s];if(Ps(i)&&!(!((r=this.tu[s])===null||r===void 0)&&r.persisted)){Vo.forEach(c=>{var u;((u=Cr(c))===null||u===void 0?void 0:u.storageGroup)===s&&this.ou.delete(c)});continue}const o=this.lc(Ot,this.bu(s),i,s);o!=="failed"&&Vo.forEach(c=>{const u=Cr(c);(u==null?void 0:u.storageGroup)!==s||o!=="written"&&u.volatile||this.ou.delete(c)})}}Cu(){const e={},t={flags:{},surveys:{}};return Zt(this.props,(n,r)=>{var s;const i=(s=Cr(r))===null||s===void 0?void 0:s.storageGroup;i?t[i][r]=n:e[r]=n}),{main:e,groups:t}}Iu(e,t){if(t===Qn)return JSON.stringify(e)+"|"+this.ac+"|"+this.uc+"|"+this.cc;const n={};return Zt(e,(r,s)=>{var i;n[s]=!((i=Cr(s))===null||i===void 0)&&i.volatile?"__volatile__":r}),JSON.stringify(n)}lc(e,t,n,r){const s=this.ku(r);if(r!==Qn&&!s.dirty&&!ce(s.fingerprint))return"skipped";let i;try{if(i=this.Iu(n,r),i===s.fingerprint)return s.dirty=!1,"skipped"}catch{i=void 0}return e.$t(t,n,this.ac,this.uc,this.cc,this.Nr.debug)?(s.dirty=!1,r!==Qn&&(s.persisted=!0),ce(i)||(s.fingerprint=i),this.eu&&(s.storageValue=Ot.Lt(t)),"written"):(this.Nr.debug&&me.warn(`failed to persist storage entry "${t}"; will retry on next save`),"failed")}remove({keepGroupEntries:e=!1}={}){if(this.Nu(),ce(this.Gu)||(clearTimeout(this.Gu),this.Gu=void 0),this.Ha.Dt(this.fu,!1),this.Ha.Dt(this.fu,!0),!e&&this.du)for(const t of gf)Ot.Dt(this.bu(t));e?delete this.tu[Qn]:this.tu={},this.zu=void 0,this.Hu=void 0,this.Ou=void 0}clear(){this.remove(),this.props={}}register_once(e,t,n){if(lt(e)){this.syncCookieProperties(),ce(t)&&(t="None"),this.ac=ce(n)?this.hc:n;let r=!1;if(Zt(e,(s,i)=>{this.props.hasOwnProperty(i)&&this.props[i]!==t||(this.Eu(i,s),r=!0)}),r)return this.save(),!0}return!1}register(e,t){if(lt(e)){this.syncCookieProperties(),this.ac=ce(t)?this.hc:t;let n=!1;if(Zt(e,(r,s)=>{e.hasOwnProperty(s)&&(this.props[s]!==r||lt(r)||He(r))&&(this.Eu(s,r),n=!0)}),n)return this.save(),!0}return!1}unregister(e){this.syncCookieProperties();const t=typeof e=="string"?[e]:e;let n=!1;for(const r of t)r in this.props&&(this.Au(r),n=!0);n&&this.save()}update_campaign_params(){const e=Ie==null?void 0:Ie.URL;if(e===this.vu)return;const t=JR(this.Nr.custom_campaign_params,this.Nr.mask_personal_data_properties,this.Nr.custom_personal_data_properties),n=!Ps(fb(t));return n&&this.register(t),this.vu=e,n?t:void 0}update_search_keyword(){this.register((function(){const e=Ie==null?void 0:Ie.referrer;return e?tI(e):{}})())}update_referrer_info(){var e;this.register_once({$referrer:rI(),$referring_domain:(Ie==null?void 0:Ie.referrer)&&((e=yo(Ie.referrer))===null||e===void 0?void 0:e.host)||M0},void 0)}set_initial_person_info(){if(this.props.$initial_campaign_params||this.props.$initial_referrer_info)return;const e=sI(this.Nr.mask_personal_data_properties,this.Nr.custom_personal_data_properties,this.Nr.disable_capture_url_hashes);this.register_once({[bu]:this.iu?{r:im(e.r),u:e.u?im(e.u):void 0}:e},void 0)}get_initial_props(){const e={};Zt([kR,ER],n=>{const r=this.props[n];r&&Zt(r,function(s,i){e["$initial_"+M_(i)]=s})});const t=this.props[bu];if(t){const n=(function(r,s=!1){const i=iI(r,s),o={};return Zt(i,function(c,u){o[`$initial_${M_(u)}`]=c}),o})(t,this.Nr.disable_capture_url_hashes);mn(e,n)}return e}safe_merge(e){return Zt(this.props,function(t,n){n in e||(e[n]=t)}),e}update_config(e,t,n){const r=e.persistence!==t.persistence,s=!((v,_)=>{if(v.length!==_.length)return!1;const w=[...v].sort(),b=[..._].sort();return w.every((S,E)=>S===b[E])})(e.cookie_persisted_properties||[],t.cookie_persisted_properties||[]),i=r||s,o=e.cookieWinsOnConflict!==t.cookieWinsOnConflict,c=e.disable_persistence||!!n,u=!!this.pi&&!c;c||this.Uu(t,u),this.Nr=e,!c&&(r||s||o)&&(this.zu=void 0,this.Hu=void 0,this.Ou=void 0,this.Uu($($({},e),{},{cookie_persisted_properties:t.cookie_persisted_properties}),u));const d=i||o?this.pu(e):this.Ha;this.dc();const f=this.gu(e),p=i||f!==this.nu,m=!c&&(p||e.cross_subdomain_cookie!==this.uc||e.secure_cookie!==this.cc)&&this.Wu(u);this.lu=p;try{if(this.hc=this.ac=e.cookie_expiration,this.set_disabled(c),this.set_cross_subdomain(e.cross_subdomain_cookie),this.set_secure(e.secure_cookie),p){const v=this.props;this.clear(),this.Ha=d,this.nu=f,this.props=v,this.save()}else o&&(this.Ha=d,c||(delete this.tu[Qn],this.Qu()))}finally{this.lu=!1,m&&this.Ju()}}dc(){const e=this.props[bu];if(!this.iu||!lt(e)||typeof e.r!="string")return;const t=im(e.r),n=typeof e.u=="string"?im(e.u):e.u;t===e.r&&n===e.u||this.Eu(bu,$($({},e),{},{r:t,u:n}))}set_disabled(e){this.pi=e,this.pi?this.remove():this.save()}set_cross_subdomain(e){e!==this.uc&&(this.uc=e,this.remove({keepGroupEntries:!0}),this.save())}set_secure(e){e!==this.cc&&(this.cc=e,this.remove({keepGroupEntries:!0}),this.save())}set_event_timer(e,t){const n=this.props.__timers||{};n[e]=t,this.Eu(K_,n),this.save()}remove_event_timer(e){const t=this.props.__timers||{},n=t[e];return ce(n)||(delete t[e],this.Eu(K_,t),this.save()),n}get_property(e){return this.props[e]}set_property(e,t){this.Eu(e,t),this.save()}Eu(e,t,n=!0){var r;const s=this.props[e];this.props[e]=t,n&&(e!=="distinct_id"&&e!=="$user_state"||s===t||(this.au=!0),P6(e)&&!No(s,t)&&this.cu.add(e),this.ju(e,s,t),!((r=Cr(e))===null||r===void 0)&&r.volatile||this.Lu(e))}Au(e,t=!0){delete this.props[e],t&&(r1(e)&&this.wu(e,!0),P6(e)&&this.cu.add(e),this.Lu(e))}Lu(e){var t;const n=(t=Cr(e))===null||t===void 0?void 0:t.storageGroup;n&&(this.ku(n).dirty=!0)}ku(e){return this.tu[e]||(this.tu[e]={})}};const Ks={GZipJS:"gzip-js",Base64:"base64"},vf={Activation:"events",Cancellation:"cancelEvents"},i1={Popover:"popover",API:"api",Widget:"widget"},Ws={SHOWN:"survey shown",DISMISSED:"survey dismissed",SENT:"survey sent"},o1={SURVEY_ID:"$survey_id",SURVEY_ITERATION:"$survey_iteration",SURVEY_LAST_SEEN_DATE:"$survey_last_seen_date"},nw={Popover:"popover",Inline:"inline"};function om(e){let t=!0;return{dispose(){if(t){t=!1;const n=e();n&&Mn(n.then)&&n.then(void 0,()=>{})}}}}const Zj={SHOWN:"product tour shown"},T6={TOUR_LAST_SEEN_DATE:"$product_tour_last_seen_date",TOUR_TYPE:"$product_tour_type"},R6=xn("[RateLimiter]");var Bj=class{constructor(e){this.serverLimits={},this.lastEventRateLimited=!1,this.checkForLimiting=t=>{const n=t.text;if(n&&n.length)try{(JSON.parse(n).quota_limited||[]).forEach(r=>{R6.info(`${r||"events"} is quota limited.`),this.serverLimits[r]=new Date().getTime()+6e4})}catch(r){return void R6.warn(`could not rate limit - continuing. Error: "${r==null?void 0:r.message}"`,{text:n})}},this.instance=e,this.lastEventRateLimited=this.clientRateLimitContext(!0).isRateLimited}get captureEventsPerSecond(){var e;return((e=this.instance.config.rate_limiting)===null||e===void 0?void 0:e.events_per_second)||10}get captureEventsBurstLimit(){var e;return Math.max(((e=this.instance.config.rate_limiting)===null||e===void 0?void 0:e.events_burst_limit)||10*this.captureEventsPerSecond,this.captureEventsPerSecond)}get isClientRateLimited(){return 1>this.vc().tokens}clientRateLimitContext(e=!1){var t;const n=this.vc(),r=1>n.tokens;if(r||e||(n.tokens=Math.max(0,n.tokens-1)),r&&!e){const s=(Fn(n.dropped)?n.dropped:0)+1;n.dropped=s,!this.lastEventRateLimited&&this.fc(s)&&(n.dropped=0)}return this.lastEventRateLimited=r,(t=this.instance.persistence)===null||t===void 0||t.set_property("$capture_rate_limit",n),{isRateLimited:r,remainingTokens:n.tokens}}vc(){var e;const{captureEventsBurstLimit:t,captureEventsPerSecond:n}=this,r=new Date().getTime(),s=(e=this.instance.persistence)===null||e===void 0?void 0:e.get_property(SR),i=s?$({},s):{tokens:t,last:r};return i.tokens+=Math.max(0,r-i.last)/1e3*n,i.last=Math.max(i.last,r),i.tokens>t&&(i.tokens=t),i}gc(e){const t=this.instance.config.property_denylist;return!He(t)||!t.includes(e)}mc(){var e;if(this.gc("$current_url")&&this.gc("$pathname")&&(cn!=null&&cn.pathname))return`${(e=cn.origin)!==null&&e!==void 0?e:""}${cn.pathname}`}fc(e){var t,n;const{captureEventsBurstLimit:r,captureEventsPerSecond:s}=this,i=this.mc(),o=this.gc("$session_id")?(t=(n=this.instance).get_session_id)===null||t===void 0?void 0:t.call(n):void 0,c=[`${e} event(s) dropped since the last warning`,i?`triggered on ${i}`:void 0,o?`session ${o}`:void 0].filter(Boolean).join(", ");return!!this.instance.capture("$$client_ingestion_warning",{$$client_ingestion_warning_message:`posthog-js client rate limited: ${c}. Config is set to ${s} events per second and ${r} events burst limit.`},{skip_client_rate_limiting:!0})}isServerRateLimited(e){const t=this.serverLimits[e||"events"]||!1;return t!==!1&&new Date().getTime()<t}};const Oa=xn("[RemoteConfig]");var oI=class{constructor(e){this._instance=e}get remoteConfig(){var e;return(e=et._POSTHOG_REMOTE_CONFIG)===null||e===void 0||(e=e[this._instance.config.token])===null||e===void 0?void 0:e.config}yc(e){var t,n,r;!((t=et.__PosthogExtensions__)===null||t===void 0)&&t.loadExternalDependency?(n=et.__PosthogExtensions__)===null||n===void 0||(r=n.loadExternalDependency)===null||r===void 0||r.call(n,this._instance,"remote-config",()=>e(this.remoteConfig)):e()}bc(e){this._instance._send_request({method:"GET",url:this._instance.requestRouter.endpointFor("assets",`/array/${this._instance.config.token}/config`),callback:e})}load(){try{if(this.remoteConfig)return Oa.info("Using preloaded remote config",this.remoteConfig),void this._c(this.remoteConfig);if(this._instance.wc())return void Oa.warn("Remote config is disabled. Falling back to local config.");this.yc(e=>{if(!e)return Oa.info("No config found after loading remote JS config. Falling back to JSON."),void this.bc(t=>{this._c(t.json,t)});this._c(e)})}catch(e){Oa.error("Error loading remote config",e),this._c()}}_c(e,t){!e&&t&&(t.statusCode===0?t.error||Oa.warn("Failed to fetch remote config from PostHog."):Oa.error("Failed to fetch remote config from PostHog."));try{this._instance._c(e?{ok:!0,config:e}:{ok:!1})}catch(r){Oa.error("Error applying remote config",r)}if((e==null?void 0:e.hasFeatureFlags)!==!1&&!this._instance.config.advanced_disable_feature_flags_on_first_load)try{var n;(n=this._instance.featureFlags)===null||n===void 0||n.ensureFlagsLoaded()}catch(r){Oa.error("Error loading feature flags",r)}}},mi=Uint8Array,As=Uint16Array,nd=Uint32Array,yb=new mi([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]),_b=new mi([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]),I6=new mi([16,17,18,0,8,7,9,6,10,5,11,4,12,3,13,2,14,1,15]),aI=function(e,t){for(var n=new As(31),r=0;31>r;++r)n[r]=t+=1<<e[r-1];var s=new nd(n[30]);for(r=1;30>r;++r)for(var i=n[r];n[r+1]>i;++i)s[i]=i-n[r]<<5|r;return[n,s]},lI=aI(yb,2),rw=lI[1];lI[0][28]=258,rw[258]=28;for(var O6=aI(_b,0)[1],cI=new As(32768),Cn=0;32768>Cn;++Cn){var su=(43690&Cn)>>>1|(21845&Cn)<<1;cI[Cn]=((65280&(su=(61680&(su=(52428&su)>>>2|(13107&su)<<2))>>>4|(3855&su)<<4))>>>8|(255&su)<<8)>>>1}var qf=function(e,t,n){for(var r=e.length,s=0,i=new As(t);r>s;++s)++i[e[s]-1];var o,c=new As(t);for(s=0;t>s;++s)c[s]=c[s-1]+i[s-1]<<1;for(o=new As(r),s=0;r>s;++s)o[s]=cI[c[e[s]-1]++]>>>15-e[s];return o},_c=new mi(288);for(Cn=0;144>Cn;++Cn)_c[Cn]=8;for(Cn=144;256>Cn;++Cn)_c[Cn]=9;for(Cn=256;280>Cn;++Cn)_c[Cn]=7;for(Cn=280;288>Cn;++Cn)_c[Cn]=8;var N0=new mi(32);for(Cn=0;32>Cn;++Cn)N0[Cn]=5;var Wj=qf(_c,9),Kj=qf(N0,5),uI=function(e){return(e/8|0)+(7&e&&1)},dI=function(e,t,n){(n==null||n>e.length)&&(n=e.length);var r=new(e instanceof As?As:e instanceof nd?nd:mi)(n-t);return r.set(e.subarray(t,n)),r},Lo=function(e,t,n){var r=t/8|0;e[r]|=n<<=7&t,e[r+1]|=n>>>8},yf=function(e,t,n){var r=t/8|0;e[r]|=n<<=7&t,e[r+1]|=n>>>8,e[r+2]|=n>>>16},a1=function(e,t){for(var n=[],r=0;e.length>r;++r)e[r]&&n.push({s:r,f:e[r]});var s=n.length,i=n.slice();if(!s)return[new mi(0),0];if(s==1){var o=new mi(n[0].s+1);return o[n[0].s]=1,[o,1]}n.sort(function(T,M){return T.f-M.f}),n.push({s:-1,f:25001});var c=n[0],u=n[1],d=0,f=1,p=2;for(n[0]={s:-1,f:c.f+u.f,l:c,r:u};f!=s-1;)c=n[n[p].f>n[d].f?d++:p++],u=n[d!=f&&n[p].f>n[d].f?d++:p++],n[f++]={s:-1,f:c.f+u.f,l:c,r:u};var m=i[0].s;for(r=1;s>r;++r)i[r].s>m&&(m=i[r].s);var v=new As(m+1),_=sw(n[f-1],v,0);if(_>t){r=0;var w=0,b=_-t,S=1<<b;for(i.sort(function(T,M){return v[M.s]-v[T.s]||T.f-M.f});s>r;++r){var E=i[r].s;if(t>=v[E])break;w+=S-(1<<_-v[E]),v[E]=t}for(w>>>=b;w>0;){var C=i[r].s;t>v[C]?w-=1<<t-v[C]++-1:++r}for(;r>=0&&w;--r){var A=i[r].s;v[A]==t&&(--v[A],++w)}_=t}return[new mi(v),_]},sw=function(e,t,n){return e.s==-1?Math.max(sw(e.l,t,n+1),sw(e.r,t,n+1)):t[e.s]=n},M6=function(e){for(var t=e.length;t&&!e[--t];);for(var n=new As(++t),r=0,s=e[0],i=1,o=function(u){n[r++]=u},c=1;t>=c;++c)if(e[c]==s&&c!=t)++i;else{if(!s&&i>2){for(;i>138;i-=138)o(32754);i>2&&(o(i>10?i-11<<5|28690:i-3<<5|12305),i=0)}else if(i>3){for(o(s),--i;i>6;i-=6)o(8304);i>2&&(o(i-3<<5|8208),i=0)}for(;i--;)o(s);i=1,s=e[c]}return[n.subarray(0,r),t]},_f=function(e,t){for(var n=0,r=0;t.length>r;++r)n+=e[r]*t[r];return n},iw=function(e,t,n){var r=n.length,s=uI(t+2);e[s]=255&r,e[s+1]=r>>>8,e[s+2]=255^e[s],e[s+3]=255^e[s+1];for(var i=0;r>i;++i)e[s+i+4]=n[i];return 8*(s+4+r)},N6=function(e,t,n,r,s,i,o,c,u,d,f){Lo(t,f++,n),++s[256];for(var p=a1(s,15),m=p[0],v=p[1],_=a1(i,15),w=_[0],b=_[1],S=M6(m),E=S[0],C=S[1],A=M6(w),T=A[0],M=A[1],O=new As(19),R=0;E.length>R;++R)O[31&E[R]]++;for(R=0;T.length>R;++R)O[31&T[R]]++;for(var D=a1(O,7),U=D[0],W=D[1],H=19;H>4&&!U[I6[H-1]];--H);var Y,J,V,q,ee=d+5<<3,F=_f(s,_c)+_f(i,N0)+o,X=_f(s,m)+_f(i,w)+o+14+3*H+_f(O,U)+(2*O[16]+3*O[17]+7*O[18]);if(F>=ee&&X>=ee)return iw(t,f,e.subarray(u,u+d));if(Lo(t,f,1+(F>X)),f+=2,F>X){Y=qf(m,v),J=m,V=qf(w,b),q=w;var B=qf(U,W);for(Lo(t,f,C-257),Lo(t,f+5,M-1),Lo(t,f+10,H-4),f+=14,R=0;H>R;++R)Lo(t,f+3*R,U[I6[R]]);f+=3*H;for(var L=[E,T],G=0;2>G;++G){var ue=L[G];for(R=0;ue.length>R;++R)Lo(t,f,B[te=31&ue[R]]),f+=U[te],te>15&&(Lo(t,f,ue[R]>>>5&127),f+=ue[R]>>>12)}}else Y=Wj,J=_c,V=Kj,q=N0;for(R=0;c>R;++R)if(r[R]>255){var te;yf(t,f,Y[257+(te=r[R]>>>18&31)]),f+=J[te+257],te>7&&(Lo(t,f,r[R]>>>23&31),f+=yb[te]);var ie=31&r[R];yf(t,f,V[ie]),f+=q[ie],ie>3&&(yf(t,f,r[R]>>>5&8191),f+=_b[ie])}else yf(t,f,Y[r[R]]),f+=J[r[R]];return yf(t,f,Y[256]),f+J[256]},Gj=new nd([65540,131080,131088,131104,262176,1048704,1048832,2114560,2117632]),qj=(function(){for(var e=new nd(256),t=0;256>t;++t){for(var n=t,r=9;--r;)n=(1&n&&3988292384)^n>>>1;e[t]=n}return e})(),l1=function(e,t,n){for(;n;++t)e[t]=n,n>>>=8};function Yj(e,t){t===void 0&&(t={});var n=(function(){var p=4294967295;return{p(m){for(var v=p,_=0;m.length>_;++_)v=qj[255&v^m[_]]^v>>>8;p=v},d(){return 4294967295^p}}})(),r=e.length;n.p(e);var s,i,o,c,u,d=(c=10+((s=t).filename&&s.filename.length+1||0),u=8,(function(p,m,v,_,w,b){var S=p.length,E=new mi(_+S+5*(1+Math.floor(S/7e3))+w),C=E.subarray(_,E.length-w),A=0;if(!m||8>S)for(var T=0;S>=T;T+=65535){var M=T+65535;S>M?A=iw(C,A,p.subarray(T,M)):(C[T]=b,A=iw(C,A,p.subarray(T,S)))}else{for(var O=Gj[m-1],R=O>>>13,D=8191&O,U=(1<<v)-1,W=new As(32768),H=new As(U+1),Y=Math.ceil(v/3),J=2*Y,V=function(xt){return(p[xt]^p[xt+1]<<Y^p[xt+2]<<J)&U},q=new nd(25e3),ee=new As(288),F=new As(32),X=0,B=0,L=(T=0,0),G=0,ue=0;S>T;++T){var te=V(T),ie=32767&T,he=H[te];if(W[ie]=he,H[te]=ie,T>=G){var ke=S-T;if((X>7e3||L>24576)&&ke>423){A=N6(p,C,0,q,ee,F,B,L,ue,T-ue,A),L=X=B=0,ue=T;for(var ge=0;286>ge;++ge)ee[ge]=0;for(ge=0;30>ge;++ge)F[ge]=0}var pe=2,Ne=0,Re=D,$e=ie-he&32767;if(ke>2&&te==V(T-$e))for(var Et=Math.min(R,ke)-1,dn=Math.min(32767,T),an=Math.min(258,ke);dn>=$e&&--Re&&ie!=he;){if(p[T+pe]==p[T+pe-$e]){for(var kt=0;an>kt&&p[T+kt]==p[T+kt-$e];++kt);if(kt>pe){if(pe=kt,Ne=$e,kt>Et)break;var Gt=Math.min($e,kt-2),gn=0;for(ge=0;Gt>ge;++ge){var Qt=T-$e+ge+32768&32767,Me=Qt-W[Qt]+32768&32767;Me>gn&&(gn=Me,he=Qt)}}}$e+=(ie=he)-(he=W[ie])+32768&32767}if(Ne){q[L++]=268435456|rw[pe]<<18|O6[Ne];var Xe=31&rw[pe],Te=31&O6[Ne];B+=yb[Xe]+_b[Te],++ee[257+Xe],++F[Te],G=T+pe,++X}else q[L++]=p[T],++ee[p[T]]}}A=N6(p,C,b,q,ee,F,B,L,ue,T-ue,A)}return dI(E,0,_+uI(A)+w)})(i=e,(o=t).level==null?6:o.level,o.mem==null?Math.ceil(1.5*Math.max(8,Math.min(13,Math.log(i.length)))):12+o.mem,c,u,!0)),f=d.length;return(function(p,m){var v=m.filename;if(p[0]=31,p[1]=139,p[2]=8,p[8]=2>m.level?4:m.level==9?2:0,p[9]=3,m.mtime!=0&&l1(p,4,Math.floor(new Date(m.mtime||Date.now())/1e3)),v){p[3]=8;for(var _=0;v.length>=_;++_)p[_+10]=v.charCodeAt(_)}})(d,t),l1(d,f-8,n.d()),l1(d,f-4,r),d}const Qj=!!X2||!!ih,fI=new WeakMap,hI="text/plain";let c1=0,qm=!1;const pI=(e,t)=>{const[n,r]=e.split("#"),[s,i]=n.split("?");if(!i)return e;const o=i.split("&").filter(c=>c.split("=")[0]!==t).join("&");return`${s}${o?`?${o}`:""}${r?`#${r}`:""}`},Pg=(e,t,n=!0)=>{var r;const[s,i]=e.split("?"),o=$({},t),c=(r=i==null?void 0:i.split("&").map(d=>{var f;const[p,m]=d.split("="),v=n&&(f=o[p])!==null&&f!==void 0?f:m;return delete o[p],`${p}=${v}`}))!==null&&r!==void 0?r:[],u=(function(d,f="&"){let p,m;const v=[];return Zt(d,function(_,w){ce(_)||ce(w)||w==="undefined"||(p=encodeURIComponent((b=>b instanceof File)(_)?_.name:_.toString()),m=encodeURIComponent(w),v[v.length]=m+"="+p)}),v.join(f)})(o);return u&&c.push(u),c.length>0?`${s}?${c.join("&")}`:s},u1=e=>{if(e.dr)return e.dr;const{data:t,compression:n}=e;if(!t)return;if(n===Ks.GZipJS){const s=Yj((function(i){var o=i.length;if(typeof TextEncoder<"u")return new TextEncoder().encode(i);for(var c=new mi(i.length+(i.length>>>1)),u=0,d=function(v){c[u++]=v},f=0;o>f;++f){if(u+5>c.length){var p=new mi(u+8+(o-f<<1));p.set(c),c=p}var m=i.charCodeAt(f);128>m?d(m):2048>m?(d(192|m>>>6),d(128|63&m)):m>55295&&57344>m?(d(240|(m=65536+(1047552&m)|1023&i.charCodeAt(++f))>>>18),d(128|m>>>12&63),d(128|m>>>6&63),d(128|63&m)):(d(224|m>>>12),d(128|m>>>6&63),d(128|63&m))}return dI(c,0,u)})(Su(t)),{mtime:0});return{contentType:hI,body:s.buffer.slice(s.byteOffset,s.byteOffset+s.byteLength),estimatedSize:s.byteLength}}if(n===Ks.Base64){const s=(function(o){return o&&btoa(encodeURIComponent(o).replace(/%([0-9A-F]{2})/g,(c,u)=>String.fromCharCode(parseInt(u,16))))})(Su(t)),i=(o=>"data="+encodeURIComponent(typeof o=="string"?o:Su(o)))(s);return{contentType:"application/x-www-form-urlencoded",body:i,estimatedSize:new Blob([i]).size}}const r=Su(t);return{contentType:"application/json",body:r,estimatedSize:new Blob([r]).size}},mI=e=>{const t=()=>e.transport==="sendBeacon"?{url:Pg(e.url,{compression:Ks.Base64}),encodedBody:u1($($({},e),{},{compression:Ks.Base64,dr:void 0}))}:{url:pI(e.url,"compression"),encodedBody:u1($($({},e),{},{compression:void 0,dr:void 0}))};let n;try{n=u1(e)}catch(s){if(Gk(e.compression,ed(e.url,"compression")))return me.error("Failed to gzip request body, sending uncompressed payload",s),t();throw s}return n&&Gk(e.compression,ed(e.url,"compression"))&&!((r=n.body)instanceof ArrayBuffer?z_(new Uint8Array(r)):ArrayBuffer.isView(r)&&z_(new Uint8Array(r.buffer,r.byteOffset,r.byteLength)))?(qm=!0,t()):{url:e.url,encodedBody:n};var r},gI=e=>{try{return mI(e)}catch(n){var t;return me.error(n),void((t=e.callback)===null||t===void 0||t.call(e,{statusCode:0,error:n}))}},Xj=(function(){var e=un(function*(t){const n=yield(function(s){return V_.apply(this,arguments)})(Su(t.data),Cs.DEBUG,{rethrow:!0});if(!n)return t;const r=yield n.arrayBuffer();return $($({},t),{},{dr:{contentType:hI,body:r,estimatedSize:r.byteLength}})});return function(t){return e.apply(this,arguments)}})(),vI=e=>KT("AbortError","PostHog request timed out"+(e?` after ${e}ms`:"")),Jj=/Failed to fetch|NetworkError|Load failed/i,yI=e=>(e==null?void 0:e.name)==="TypeError"&&Jj.test((e==null?void 0:e.message)||""),_I=e=>{try{const t=(function(n,r=Date.now(),s=3e5){if(typeof n!="string"||!n)return;const i=n.trim(),o=/^\d+\s*,/.test(i)?i.slice(0,i.indexOf(",")).trim():i;if(/^\d+$/.test(o)){const d=1e3*Math.min(Number(o),s/1e3);return d>0?d:void 0}if(!/^(Mon|Tue|Wed|Thu|Fri|Sat|Sun)[a-z]*[ ,]/.test(o))return;const c=/^\w{3} \w{3} /.test(o)?o+" GMT":o,u=Date.parse(c)-r;return Number.isFinite(u)&&u>0?Math.min(u,s):void 0})(e());return ce(t)?void 0:Math.min(t,3e4)}catch{return}},wI=e=>{const t=gI(e);if(!t)return;const n=new X2;fI.set(n,!0);const{url:r,encodedBody:s}=t;n.open(e.method||"GET",r,!0);const{contentType:i,body:o}=s??{};Zt(e.headers,function(u,d){n.setRequestHeader(d,u)}),i&&n.setRequestHeader("Content-Type",i),e.timeout&&(n.timeout=e.timeout);let c=!1;n.ontimeout=()=>{c=!0},n.onloadend=()=>{var u;if(c){var d;const p=vI(e.timeout);return me.warn(p),void((d=e.callback)===null||d===void 0||d.call(e,{statusCode:0,error:p}))}const f={statusCode:n.status,text:n.responseText};if(n.status===200)try{f.json=JSON.parse(n.responseText)}catch{}(u=e.callback)===null||u===void 0||u.call(e,f,_I(()=>n.getResponseHeader("Retry-After")))},n.send(o)},bI=e=>{const t=gI(e);if(!t)return;const{url:n,encodedBody:r}=t,{contentType:s,body:i,estimatedSize:o}=r??{},c=new Headers;Zt(e.headers,function(_,w){c.append(w,_)}),s&&c.append("Content-Type",s);let u=null,d=!1;if(Ik){const _=new Ik;u={signal:_.signal,timeout:setTimeout(()=>{d=!0;try{_.abort(vI(e.timeout))}catch(w){p(w)}},e.timeout)}}let f=!1;const p=_=>{var w;f||(f=!0,d&&(_==null?void 0:_.name)==="AbortError"||yI(_)?me.warn(_):me.error(_),(w=e.callback)===null||w===void 0||w.call(e,{statusCode:0,error:_}))};let m=0;const v=()=>{c1-=m,m=0,u&&clearTimeout(u.timeout)};try{const _=$({method:(e==null?void 0:e.method)||"GET",headers:c,referrerPolicy:"strict-origin",body:i,signal:u==null?void 0:u.signal},e.fetchOptions),w=o??(ce(i)?0:void 0);_.keepalive=_.method==="POST"&&!e.qa&&_.keepalive!==!1&&_.body===i&&!ce(w)&&w>=0&&52428.8>c1+w,_.keepalive&&(m=w,c1+=m),ih(n,_).then(b=>b.text().then(S=>{var E;if(f)return;const C={statusCode:b.status,text:S};if(b.status===200)try{C.json=JSON.parse(S)}catch(A){me.error(A)}f=!0,v(),(E=e.callback)===null||E===void 0||E.call(e,C,_I(()=>b.headers.get("Retry-After")))})).catch(b=>{v(),p(b)}).finally(v)}catch(_){v(),p(_)}},ow=e=>{try{var t;const{url:n,encodedBody:r}=mI(e),{contentType:s,body:i,estimatedSize:o}=r??{};if(!i)return;const c=i instanceof Blob?i:new Blob([i],{type:s});if(Fr.sendBeacon(n,c))return;const u=He(e.data)?e.data:(t=e.data)===null||t===void 0?void 0:t.batch;if(He(u)&&u.length>1&&(o??0)>16384){const d=Math.ceil(u.length/2),f=p=>He(e.data)?p:$($({},e.data),{},{batch:p});return ow($($({},e),{},{data:f(u.slice(0,d))})),void ow($($({},e),{},{data:f(u.slice(d))}))}me.warn(`Beacon of ~${o??0} bytes was rejected by the browser, falling back to ${ih?"fetch":"XHR"}`),ih?bI($($({},e),{},{qa:!0})):wI(e)}catch(n){me.warn("Beacon send failed",n)}},L6=(e,t,n,r)=>{const s=r==="query"?t==="POST"?"sent_at":"_":void 0;return Pg(n===Ks.GZipJS?pI(e,"compression"):e,$($({},s?{[s]:Date.now().toString()}:{}),n===Ks.GZipJS?{}:{compression:n}))},e7=(()=>{const e=[];return ih&&e.push({transport:"fetch",method:bI}),X2&&e.push({transport:"XHR",method:wI}),Fr!=null&&Fr.sendBeacon&&e.push({transport:"sendBeacon",method:ow}),e})();let xI=!Qj&&(ds==null?void 0:ds.indexOf("MSIE"))===-1&&(ds==null?void 0:ds.indexOf("Mozilla"))===-1;function SI(e,t,n){var r,s,i,o;n&&(t=$($({},t),{},{callback:c=>n(c)})),e.__loaded?xI?e.__request_queue.push(t):e.rateLimiter.isServerRateLimited(t.batchKey)?t.fireCallbackOnDrop&&((i=t.callback)===null||i===void 0||i.call(t,{statusCode:429})):(t.transport=t.transport||e.config.api_transport,t.headers=$($({},e.config.request_headers),t.headers),t.compression=t.compression==="best-available"?(r=e.compression)!==null&&r!==void 0?r:t.compressionFallback:t.compression,(ce(e.config.disable_beacon)?e.config.__preview_disable_beacon:e.config.disable_beacon)&&(t.disableTransport=["sendBeacon"]),t.fetchOptions=t.fetchOptions||e.config.fetch_options,(s=t.onDispatch)===null||s===void 0||s.call(t),((c,u)=>{var d,f,p;const m=$($({},c),{},{callback:u??(S=>{var E;return(E=c.callback)===null||E===void 0?void 0:E.call(c,S)})});m.timeout=m.timeout||6e4;const v=(d=m.transport)!==null&&d!==void 0?d:"fetch";v==="sendBeacon"&&ce(m.compression)&&m.data&&(m.compression=Ks.Base64),m.method==="POST"&&m.data&&(m.timestampMode==="capture-body"?m.data=(S=>{var E,C;const A=(He(S)?S:[S]).map(M=>$($({},M),M.timestamp instanceof Date&&!isNaN(M.timestamp.getTime())?{timestamp:M.timestamp.toISOString()}:{})),T=A[0];return{api_key:(E=T==null||(C=T.properties)===null||C===void 0?void 0:C.token)!==null&&E!==void 0?E:T==null?void 0:T.token,batch:A,sent_at:new Date().toISOString()}})(m.data):m.timestampMode==="body"&&(m.data=((S,E=new Date().toISOString())=>He(S)?S.map(C=>$($({},C),{},{sent_at:E})):$($({},S),{},{sent_at:E}))(m.data))),m.url=L6(m.url,m.method,m.compression,m.timestampMode);const _=e7.filter(S=>!m.disableTransport||!S.transport||!m.disableTransport.includes(S.transport)),w=(f=(p=(function(S,E){for(let C=0;S.length>C;C++)if(E(S[C]))return S[C]})(_,S=>S.transport===v))===null||p===void 0?void 0:p.method)!==null&&f!==void 0?f:_[0].method;if(!w)throw new Error("No available transport method");const b=S=>{try{w(S)}catch(C){var E;yI(C)?me.warn(C):me.error(C),(E=m.callback)===null||E===void 0||E.call(m,{statusCode:0,error:C})}};v!=="sendBeacon"&&!m.preferSyncCompression&&m.data&&m.compression===Ks.GZipJS&&p9&&typeof Promise<"u"&&!qm?Xj(m).then(S=>{b(S)}).catch(S=>{if(qk(S))return qm=!0,void b($($({},m),{},{compression:void 0,url:L6(c.url,c.method,void 0,c.timestampMode)}));(E=>{if(!E||typeof E!="object")return!1;const C="name"in E?String(E.name):"";return qk(E)||C===eR})(S)&&(qm=!0),b(m)}):b(m)})(t,(c,u)=>{var d,f,p;e.rateLimiter.checkForLimiting(c),400>c.statusCode||(d=(f=e.config).on_request_error)===null||d===void 0||d.call(f,c),n?n(c,u):(p=t.callback)===null||p===void 0||p.call(t,c)})):t.fireCallbackOnDrop&&((o=t.callback)===null||o===void 0||o.call(t,{statusCode:0}))}var t7=class{constructor(e,t){this.kc=!0,this.Sc=[],this.xc=ho((t==null?void 0:t.flush_interval_ms)||3e3,250,5e3,me.createLogger("flush interval"),3e3),this.$c=e}enqueue(e){this.Sc.push(e),this.Cc||this.Tc()}unload(){this.Ic();const e=this.Sc.length>0?this.Mc():{},t=Object.values(e);[...t.filter(n=>n.url.indexOf("/e")===0),...t.filter(n=>n.url.indexOf("/e")!==0)].map(n=>{this.Ec($($({},n),{},{callback:void 0}),"sendBeacon")})}enable(){this.kc=!1,this.Tc()}Tc(){this.kc||(this.Cc=setTimeout(()=>{this.Ic(),this.Ac()},this.xc))}Ac(){if(this.Sc.length>0){const e=this.Mc();for(const t in e)this.Ec(e[t])}}Ec(e,t){try{this.$c(e,t)}catch(n){me.error(n)}}Ic(){clearTimeout(this.Cc),this.Cc=void 0}Mc(){const e={},t={};Zt(this.Sc,n=>{var r;const s=n,i=((s?s.batchKey:null)||s.url)+(s.batchGroup?`:${s.batchGroup}`:"");ce(e[i])&&(e[i]=$($({},s),{},{data:[],callback:void 0,fireCallbackOnDrop:void 0}),t[i]=[]),(r=e[i].data)===null||r===void 0||r.push(s.data),s.callback&&t[i].push(s.callback)});for(const n in t){const r=t[n];r.length&&(e[n].callback=s=>{for(const i of r)i(s)})}return this.Sc=[],e}};const n7=["retriesPerformedSoFar"];var r7=class{constructor(e){this._instance=e,this.Rc=!1,this.Pc=3e3,this.Sc=[],this.Sc=[],this.Oc=!0,this.resume()}resume(){if(!ce(le)&&"onLine"in le.navigator){if(this.Oc=le.navigator.onLine,this.Fc)return;this.Fc=()=>{this.Oc=!0,this.Ac()},this.Dc=()=>{this.Oc=!1},Lt(le,"online",this.Fc),Lt(le,"offline",this.Dc)}}get length(){return this.Sc.length}retriableRequest(e,t){let{retriesPerformedSoFar:n}=e,r=tR(e,n7);zo(n)&&(r.url=Pg(r.url,{retry_count:n})),SI(this._instance,t?$($({},r),{},{transport:t}):r,(s,i)=>{var o;if(s.statusCode!==200&&(400>s.statusCode||s.statusCode>=500)){if((s.statusCode===0?3:10)>(n??0))return void this.js($({retriesPerformedSoFar:n},r),i);s.statusCode===0&&me.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.`)}(o=r.callback)===null||o===void 0||o.call(r,s)})}js(e,t){const n=e.retriesPerformedSoFar||0;e.retriesPerformedSoFar=n+1;const r=Math.max((function(o){const c=3e3*Math.pow(2,o),u=c/2,d=Math.min(18e5,c),f=(Math.random()-.5)*(d-u);return Math.ceil(d+f)})(n),t??0),s=Date.now()+r;this.Sc.push({retryAt:s,requestOptions:e});let i=`Enqueued failed request for retry in ${r}`;navigator.onLine||(i+=" (Browser is offline)"),me.warn(i),this.Rc||(this.Rc=!0,this.Lc())}Lc(){if(this.Nc&&clearTimeout(this.Nc),this.Sc.length===0)return this.Rc=!1,void(this.Nc=void 0);this.Nc=setTimeout(()=>{this.Oc&&this.Sc.length>0&&this.Ac(),this.Lc()},this.Pc)}Ac(){const e=Date.now(),t=[],n=this.Sc.filter(r=>e>r.retryAt||(t.push(r),!1));if(this.Sc=t,n.length>0)for(const{requestOptions:r}of n)this.retriableRequest(r)}unload(){this.Nc&&(clearTimeout(this.Nc),this.Nc=void 0),this.Rc=!1,ce(le)||(this.Fc&&(le.removeEventListener("online",this.Fc),this.Fc=void 0),this.Dc&&(le.removeEventListener("offline",this.Dc),this.Dc=void 0));for(const{requestOptions:e}of this.Sc)try{this._instance._send_request($($({},e),{},{callback:He(e.data)?void 0:e.callback,transport:"sendBeacon"}))}catch(t){me.error(t)}this.Sc=[]}},s7=class{constructor(e){this._instance=e,this.jc=()=>{var t,n,r,s;this.qc||(this.qc={});const i=this.scrollElement(),o=this.scrollY(),c=i?Math.max(0,i.scrollHeight-i.clientHeight):0,u=o+((i==null?void 0:i.clientHeight)||0),d=(i==null?void 0:i.scrollHeight)||0;this.qc.lastScrollY=Math.ceil(o),this.qc.maxScrollY=Math.max(o,(t=this.qc.maxScrollY)!==null&&t!==void 0?t:0),this.qc.maxScrollHeight=Math.max(c,(n=this.qc.maxScrollHeight)!==null&&n!==void 0?n:0),this.qc.lastContentY=u,this.qc.maxContentY=Math.max(u,(r=this.qc.maxContentY)!==null&&r!==void 0?r:0),this.qc.maxContentHeight=Math.max(d,(s=this.qc.maxContentHeight)!==null&&s!==void 0?s:0)}}get Bc(){return this._instance.config.scroll_root_selector}getContext(){return this.qc}resetContext(){const e=this.qc;return this.qc=void 0,setTimeout(this.jc,0),e}startMeasuringScrollPosition(){Lt(le,"scroll",this.jc,{capture:!0}),Lt(le,"scrollend",this.jc,{capture:!0}),Lt(le,"resize",this.jc)}scrollElement(){if(this.Bc){const n=He(this.Bc)?this.Bc:[this.Bc];for(const r of n){var e;const s=le==null||(e=le.document)===null||e===void 0?void 0:e.querySelector(r);if(s)return s}return}var t;return le==null||(t=le.document)===null||t===void 0?void 0:t.documentElement}zc(e){var t,n;const r=e==="y"?"scrollTop":"scrollLeft";if(this.Bc){const s=this.scrollElement();return s&&s[r]||0}return le?e==="y"?le.scrollY||le.pageYOffset||((t=le.document)===null||t===void 0||(t=t.documentElement)===null||t===void 0?void 0:t.scrollTop)||0:le.scrollX||le.pageXOffset||((n=le.document)===null||n===void 0||(n=n.documentElement)===null||n===void 0?void 0:n.scrollLeft)||0:0}scrollY(){return this.zc("y")}scrollX(){return this.zc("x")}};const i7=e=>sI(e==null?void 0:e.config.mask_personal_data_properties,e==null?void 0:e.config.custom_personal_data_properties,e==null?void 0:e.config.disable_capture_url_hashes);var $6=class{constructor(e,t,n,r){this.Be=s=>{const i=this.Hc();if(i&&i.sessionId===s)return;const o={sessionId:s,props:this.Uc(this._instance)};this.Wc.register({[J_]:o})},this._instance=e,this.Vc=t,this.Wc=n,this.Uc=r||i7,this.Vc.onSessionId(this.Be)}Hc(){return this.Wc.props[J_]}getSetOnceProps(){var e;const t=(e=this.Hc())===null||e===void 0?void 0:e.props;return t?"r"in t?iI(t,this._instance.config.disable_capture_url_hashes):{$referring_domain:t.referringDomain,$pathname:t.initialPathName,utm_source:t.utm_source,utm_campaign:t.utm_campaign,utm_medium:t.utm_medium,utm_content:t.utm_content,utm_term:t.utm_term}:{}}getSessionProps(){const e={};return Zt(fb(this.getSetOnceProps()),(t,n)=>{n==="$current_url"&&(n="url"),e[`$session_entry_${M_(n)}`]=t}),e}},L0=class{on(e,t){return this.Do[e]||(this.Do[e]=[]),this.Do[e].push(t),()=>{this.Do[e]=this.Do[e].filter(n=>n!==t)}}emit(e,t){for(const n of this.Do[e]||[])n(t);for(const n of this.Do["*"]||[])n(e,t)}constructor(){this.Do={}}};const iu=xn("[SessionId]"),D6=864e5;var F6=class{on(e,t){return this.Gc.on(e,t)}constructor(e,t,n){var r;if(this.Qc=null,this.Jc=null,this.Zc=[],this.Kc=void 0,this.Yc=!1,this.Gc=new L0,this.Xc=(i,o)=>!(!zo(i)||!zo(o))&&Math.abs(i-o)>this.sessionTimeoutMs,!e.persistence)throw new Error("SessionIdManager requires a PostHogPersistence instance");if(e.config.cookieless_mode==="always")throw new Error('SessionIdManager cannot be used with cookieless_mode="always"');this.Nr=e.config,this.Wc=e.persistence,this.ze=void 0,this.Xt=void 0,this._sessionStartTimestamp=null,this.eh=void 0,this._sessionActivityTimestamp=null,this.ih=t||Di,this.nh=n||Di;const s=this.Nr.persistence_name||this.Nr.token;if(this._sessionTimeoutMs=1e3*ho(this.Nr.session_idle_timeout_seconds||1800,60,36e3,iu.createLogger("session_idle_timeout_seconds"),1800),e.register({$configured_session_timeout_ms:this._sessionTimeoutMs}),this.sh(),this.rh="ph_"+s+"_window_id",this.oh="ph_"+s+"_primary_window_exists",this.ah()){const i=sn.Ft(this.rh),o=sn.Ft(this.oh);i&&!o?this.ze=i:sn.Dt(this.rh),sn.$t(this.oh,!0)}!((r=this.Nr.bootstrap)===null||r===void 0)&&r.sessionID&&this.setBootstrapSessionId(this.Nr.bootstrap.sessionID),this.uh()}get sessionTimeoutMs(){return this._sessionTimeoutMs}onSessionId(e){return ce(this.Zc)&&(this.Zc=[]),this.Zc.push(e),this.Xt&&e(this.Xt,this.ze),()=>{this.Zc=this.Zc.filter(t=>t!==e)}}ah(){return this.Nr.persistence!=="memory"&&!this.Wc.pi&&sn.Ot()}hh(e){e!==this.ze&&(this.ze=e,this.ah()&&sn.$t(this.rh,e))}dh(){return this.ze?this.ze:this.ah()?sn.Ft(this.rh):null}fh(e){const t=this.Qc;return!kn(t)&&!kn(e)&&5e3>Math.abs(e-t)}ph(e,t,n){const r=t!==this._sessionActivityTimestamp,s=!(e!==this.Xt||n!==this._sessionStartTimestamp);this._sessionStartTimestamp=n,this._sessionActivityTimestamp=t,this.Xt=e,s&&!r||s&&this.fh(t)||(this.Qc=t,this.Wc.register({[wu]:[t,e,n]}))}gh(){var e;const t=(e=this.Nr)===null||e===void 0?void 0:e.persistence_save_debounce_ms;return zo(t)&&t>0}mh(){this.gh()?this.Wc.refreshKey(wu):(this.Wc.flush(),this.Wc.load())}yh(){var e;if(kn(this._sessionActivityTimestamp)||this._sessionActivityTimestamp===this.Qc)return;this.mh();const[,t,n]=this.bh();t===this.Xt&&n===this._sessionStartTimestamp&&(this.Qc=this._sessionActivityTimestamp,this.Wc.register({[wu]:[this._sessionActivityTimestamp,(e=this.Xt)!==null&&e!==void 0?e:null,this._sessionStartTimestamp]}),this.Wc.flush())}_h(){const[e]=this.bh(),t=zo(e)?e:0,n=zo(this._sessionActivityTimestamp)?this._sessionActivityTimestamp:0;return Math.max(t,n)}wh(e){return this.mh(),this.Xc(e,this._h())}bh(){const e=this.Wc.props[wu];return He(e)&&e.length===2&&e.push(e[0]),e||[0,null,0]}resetSessionId(){this.Qc=null,this.eh=void 0,clearTimeout(this.kh),this.kh=void 0,this.ph(null,null,null)}setBootstrapSessionId(e,t=!1){const n=((r,s=new Date().getTime())=>{try{const i=(o=>{const c=o.replace(/-/g,"");if(c.length!==32)throw new Error("Not a valid UUID");if(c[12]!=="7")throw new Error("Not a UUIDv7");return parseInt(c.substring(0,12),16)})(r);return i>s+6e4?void iu.error("Bootstrap sessionID cannot be in the future"):i}catch(i){return void iu.error("Invalid sessionID in bootstrap",i)}})(e);return!ce(n)&&(t?this.eh={sessionId:e,sessionStartTimestamp:n}:this.ph(e,new Date().getTime(),n),!0)}destroy(){this.Yc=!0,this.yh(),clearTimeout(this.kh),this.kh=void 0,this.Kc&&le&&(le.removeEventListener(T0,this.Kc,{capture:!1}),this.Kc=void 0),this.Zc=[]}uh(){this.Kc=()=>{this.yh(),this.ah()&&sn.Dt(this.oh)},Lt(le,T0,this.Kc,{capture:!1})}checkAndGetSessionAndWindowId(e=!1,t=null,n=!1){if(this.Nr.cookieless_mode==="always")throw new Error('checkAndGetSessionAndWindowId should not be called with cookieless_mode="always"');const r=t||new Date().getTime(),s=this.Xt;if(n)this.Jc=r;else if(kn(this.Jc)||this.Jc>r||r-this.Jc>=1e3){var i,o;(i=(o=this.Wc).syncCookieProperties)===null||i===void 0||i.call(o),this.Jc=r}let[,c,u]=this.bh();const d=!ce(s)&&c!==s,f=this._h();let p=this.dh();const m=this.eh,v=!!m&&(m.sessionStartTimestamp>r+6e4||r-m.sessionStartTimestamp>D6),_=m?v:zo(u)&&Math.abs(r-u)>D6;let w=!1,b=d,S=!c||!!m;const E=c;let C=!S&&!e&&this.Xc(r,f);if(C&&(C=this.wh(r),C||iu.info("cross-tab refresh kept the session alive",{sessionId:c}),[,c,u]=this.bh(),C||(S=!c||!!m)),S||C||_){b=!1;const O=m&&!v;c=O?m.sessionId:this.ih(),p=this.nh(),iu.info("new session ID assigned",{sessionId:c,windowId:p,bootstrapped:!!O,changeReason:{noSessionId:S,activityTimeout:C,sessionPastMaximumLength:_}}),u=O?m.sessionStartTimestamp:r,this.eh=void 0,w=!0}else p||(p=this.nh(),w=!0),b=b||c!==E,b&&(iu.info("adopted cross-tab session id",{sessionId:c,windowId:p}),w=!0);const A=zo(f)&&e&&!_?f:r,T=zo(u)?u:new Date().getTime();this.hh(p),this.ph(c,A,T),e||this.sh();const M={noSessionId:S,activityTimeout:C,sessionPastMaximumLength:_,crossTabAdoption:b};return w&&this.Zc.forEach(O=>O(c,p,M)),{sessionId:c,windowId:p,sessionStartTimestamp:T,changeReason:w?M:void 0,lastActivityTimestamp:f}}sh(){this.Yc||(clearTimeout(this.kh),this.kh=setTimeout(()=>{if(!this.Yc)if(this.wh(new Date().getTime())){const e=this.Xt;this.resetSessionId(),this.Gc.emit("forcedIdleReset",{idleSessionId:e})}else this.sh()},1.1*this.sessionTimeoutMs))}};const j6=Object.freeze(["2026-08-30","2026-08-29","2026-06-25","2026-05-30","2026-01-30","2025-11-30","2025-05-24"]),EI=function(e,t){if(!e)return!1;const n=e.userAgent;if(n&&Mk(n,t))return!0;try{const r=e==null?void 0:e.userAgentData;if(r!=null&&r.brands&&r.brands.some(s=>Mk(s==null?void 0:s.brand,t)))return!0}catch{}return!!e.webdriver};function kI(){return(kI=un(function*(){const e=Fr==null?void 0:Fr.userAgentData;if(e!=null&&e.getHighEntropyValues)try{const t=yield e.getHighEntropyValues(["model"]),n=t==null?void 0:t.model;return dt(n)&&n.length>0?n:void 0}catch(t){return void me.info("Unable to resolve $device_model from userAgentData.getHighEntropyValues",t)}})).apply(this,arguments)}function o7(e,t){let n=`$survey_${t}/${e.id}`;return e.current_iteration&&e.current_iteration>0&&(n=`$survey_${t}/${e.id}/${e.current_iteration}`),n}function CI(e){var t;return!!(!((t=e.conditions)===null||t===void 0||(t=t.events)===null||t===void 0||(t=t.values)===null||t===void 0)&&t.length)}const $0=(e,t)=>{if(!(n=>{try{new RegExp(n)}catch{return!1}return!0})(t))return!1;try{return new RegExp(t).test(e)}catch{return!1}},am=e=>e.toLowerCase(),PI={exact:(e,t)=>t.some(n=>e.some(r=>n===r)),is_not:(e,t)=>t.every(n=>e.every(r=>n!==r)),regex:(e,t)=>t.some(n=>e.some(r=>$0(n,r))),not_regex:(e,t)=>t.every(n=>e.every(r=>!$0(n,r))),icontains:(e,t)=>t.map(am).some(n=>e.map(am).some(r=>n.includes(r))),not_icontains:(e,t)=>t.map(am).every(n=>e.map(am).every(r=>!n.includes(r))),gt:(e,t)=>t.some(n=>{const r=parseFloat(n);return!isNaN(r)&&e.some(s=>r>parseFloat(s))}),lt:(e,t)=>t.some(n=>{const r=parseFloat(n);return!isNaN(r)&&e.some(s=>r<parseFloat(s))})};function AI(e,t){return!e||Object.entries(e).every(([n,r])=>{const s=t==null?void 0:t[n];if(s==null)return!1;const i=PI[r.operator];return!!i&&i(r.values.map(String),[String(s)])})}function d1(e,t,n){return Su({distinct_id:e,userPropertiesToSet:t,userPropertiesToSetOnce:n})}const aw="custom",z6="i.posthog.com",a7=/^\/static\//,l7=["/s/","/e/","/i/"];var c7=class{constructor(e){this.Sh={},this.instance=e}get apiHost(){const e=this.instance.config.api_host.trim().replace(/\/$/,"");return e==="https://app.posthog.com"?"https://us.i.posthog.com":e}get flagsApiHost(){const e=this.instance.config.flags_api_host;return e?e.trim().replace(/\/$/,""):this.apiHost}get uiHost(){var e;let t=(e=this.instance.config.ui_host)===null||e===void 0?void 0:e.replace(/\/$/,"");return t||(t=this.apiHost.replace(`.${z6}`,".posthog.com")),t==="https://app.posthog.com"?"https://us.posthog.com":t}get region(){return this.Sh[this.apiHost]||(this.Sh[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":aw),this.Sh[this.apiHost]}xh(e){if(!a7.test(e))return;const t=this.instance.config.asset_host;return typeof t=="string"&&t.trim().replace(/\/$/,"")||void 0}$h(e){const t=yo(e);return t?t.protocol+"//"+t.host+t.pathname:void 0}Ch(e,t,n){if(e==="ui")return n;let r=n;const s=this.instance.config.rewriteRequestPath;if(s){var i;const o=((i=yo(n))===null||i===void 0?void 0:i.href)||n;r=s(new URL(o)).toString()}if(s&&e==="api"&&l7.some(o=>t.indexOf(o)===0)){const o=this.$h(r);if(o){const c=this.apiHost;let u=this.Th;(u==null?void 0:u.apiHost)===c&&u.rewriteRequestPath===s||(u={apiHost:c,rewriteRequestPath:s,urls:new Set},this.Th=u),u.urls.add(o)}}return r}isIngestionEndpoint(e){const t=this.Th,n=this.$h(e);return(t==null?void 0:t.apiHost)===this.apiHost&&t.rewriteRequestPath===this.instance.config.rewriteRequestPath&&!!n&&t.urls.has(n)}endpointFor(e,t=""){if(t&&(t=t[0]==="/"?t:`/${t}`),e==="ui")return this.Ch(e,t,this.uiHost+t);if(e==="flags")return this.Ch(e,t,this.flagsApiHost+t);if(e==="assets"){const r=this.xh(t);if(r)return this.Ch(e,t,`${r}${t}`)}if(this.region===aw)return this.Ch(e,t,this.apiHost+t);const n=z6+t;switch(e){case"assets":return this.Ch(e,t,`https://${this.region}-assets.${n}`);case"api":return this.Ch(e,t,`https://${this.region}.${n}`)}}};const Ut=xn("[Surveys]"),TI=e=>{try{const t=(n=>((r,s)=>`seenSurvey_${(function(i){return i.current_iteration&&i.current_iteration>0?`${i.id}_${i.current_iteration}`:i.id})(s)}`)(0,n))(e);if(localStorage.getItem(t))return;localStorage.setItem(t,"true")}catch(t){Ut.error("Failed to persist survey seen state",t)}},u7=[i1.Popover,i1.Widget,i1.API],d7={ignoreConditions:!1,ignoreDelay:!1,displayType:nw.Popover},f7=xn("[PostHog ExternalIntegrations]"),h7={intercom:"intercom-integration",crispChat:"crisp-chat-integration"};var p7=class{constructor(e){this._instance=e}Ga(e,t){var n,r;(n=et.__PosthogExtensions__)===null||n===void 0||(r=n.loadExternalDependency)===null||r===void 0||r.call(n,this._instance,e,s=>{if(s)return f7.error("failed to load script",s);t()})}startIfEnabledOrStop(){var e;for(const[s,i]of Object.entries((e=this._instance.config.integrations)!==null&&e!==void 0?e:{})){var t,n,r;i&&!(!((t=et.__PosthogExtensions__)===null||t===void 0||(t=t.integrations)===null||t===void 0)&&t[s])&&this.Ga(h7[s],()=>{var o;(o=et.__PosthogExtensions__)===null||o===void 0||(o=o.integrations)===null||o===void 0||(o=o[s])===null||o===void 0||o.start(this._instance)}),!i&&(!((n=et.__PosthogExtensions__)===null||n===void 0||(n=n.integrations)===null||n===void 0)&&n[s])&&((r=et.__PosthogExtensions__)===null||r===void 0||(r=r.integrations)===null||r===void 0||(r=r[s])===null||r===void 0||r.stop())}}},RI=class{constructor(e){this.disabled=e===!1;const t=lt(e)?e:{};this.thresholdPx=t.threshold_px||30,this.timeoutMs=t.timeout_ms||1e3,this.clickCount=t.click_count||3,this.clicks=[]}isRageClick(e,t,n){if(this.disabled)return!1;const r=this.clicks[this.clicks.length-1];if(r&&Math.abs(e-r.x)+Math.abs(t-r.y)<this.thresholdPx&&this.timeoutMs>n-r.timestamp){if(this.clicks.push({x:e,y:t,timestamp:n}),this.clicks.length===this.clickCount)return!0}else this.clicks=[{x:e,y:t,timestamp:n}];return!1}};const lw=()=>typeof window>"u"?void 0:window,wf=()=>typeof document>"u"?void 0:document,f1="$copy_autocapture",m7=["password","hidden","file","checkbox","button","submit","reset","image"],lm=xn("[AutoCapture]");function h1(e,t){return t.length>e?t.slice(0,e)+"...":t}function g7(e){if(e.previousElementSibling)return e.previousElementSibling;let t=e;do t=t.previousSibling;while(t&&!pi(t));return t}function v7(e,{e:t,maskAllElementAttributes:n,maskAllText:r,elementAttributeIgnoreList:s,elementsChainAsString:i,disableCaptureUrlHashes:o}){var c,u;if(!pi(e))return{props:{}};const d=[e],f=new Set([e]);let p=e;for(;p.parentNode&&!Xn(p,"body")&&1e3>d.length;){if(I0(p.parentNode)){const M=p.parentNode.host;if(f.has(M))break;f.add(M),d.push(M),p=M;continue}if(!pi(p.parentNode)||f.has(p.parentNode))break;f.add(p.parentNode),d.push(p.parentNode),p=p.parentNode}const m=t.type==="click"&&e.namespaceURI==="http://www.w3.org/2000/svg"?d.findIndex(M=>Xn(M,"button")||Xn(M,"a")):-1;m>0&&(r=r||d.slice(0,m+1).some(M=>!sl(M)||Ju(M)));const v=[],_={};let w,b=!1,S=!1;if(Zt(d,M=>{const O=sl(M);if(Xn(M,"a")&&!n&&!(s!=null&&s.includes("href"))){const R=M.getAttribute("href");b=!!(O&&R&&Ou(R))&&(o?nl(R):R)}We(fc(M),"ph-no-capture")&&(S=!0),v.push((function(R,D,U,W,H=!1){const Y=R.tagName.toLowerCase(),J={tag_name:Y};pb.indexOf(Y)>-1&&!U&&(J.$el_text=Y.toLowerCase()==="a"||Y.toLowerCase()==="button"?h1(1024,x6(R)):h1(1024,ch(R)));const V=fc(R);D||W!=null&&W.includes("class")||0>=V.length||(J.classes=V.filter(function(X){return X!==""})),Zt(R.attributes,function(X){var B;if((!Ju(R)||["name","id","class","aria-label"].indexOf(X.name)!==-1)&&!(W!=null&&W.includes(X.name))&&!D&&Ou(X.value)&&(!dt(B=X.name)||B.substring(0,10)!=="_ngcontent"&&B.substring(0,7)!=="_nghost")){let L=X.value;X.name==="class"&&(L=hb(L).join(" ")),J["attr__"+X.name]=h1(1024,X.name==="href"&&H?nl(L):L)}});let q=1,ee=1,F=R;for(;F=g7(F);)q++,F.tagName===R.tagName&&ee++;return J.nth_child=q,J.nth_of_type=ee,J})(M,n,r,s,o)),Zt((function(R){if(!sl(R))return{};const D={};return Zt(R.attributes,function(U){if(U.name&&U.name.indexOf("data-ph-capture-attribute")===0){const W=U.name.replace("data-ph-capture-attribute-",""),H=U.value;W&&H&&Ou(H)&&(D[W]=H)}}),D})(M),(R,D)=>{({}).hasOwnProperty.call(_,D)||(_[D]=R)})}),S)return{props:{},explicitNoCapture:S};if(m>0&&(e=d[m],v.splice(0,m)),r||(v[0].$el_text=Xn(e,"a")||Xn(e,"button")?x6(e):ch(e)),b){var E,C;v[0].attr__href=b;const M=(E=yo(b))===null||E===void 0?void 0:E.host,O=(C=lw())===null||C===void 0||(C=C.location)===null||C===void 0?void 0:C.host;M&&O&&M!==O&&(w=b)}return{props:mn((T=t.type,{$event_type:T,$ce_version:1}),i?{}:{$elements:v},{$elements_chain:(A=v,He(A)?(function(M){return M.map(O=>{var R,D;let U="";if(O.tag_name&&(U+=O.tag_name),O.attr_class){O.attr_class.sort();for(const Y of O.attr_class)U+=`.${Y.replace(/"/g,"")}`}const W=$($($($({},O.text?{text:O.text}:{}),{},{"nth-child":(R=O.nth_child)!==null&&R!==void 0?R:0,"nth-of-type":(D=O.nth_of_type)!==null&&D!==void 0?D:0},O.href?{href:O.href}:{}),O.attr_id?{attr_id:O.attr_id}:{}),O.attributes),H={};return Km(W).sort(([Y],[J])=>(function(V,q){return q>V?-1:V>q?1:0})(Y,J)).forEach(([Y,J])=>H[S6(Y.toString())]=S6(J.toString())),U+=":",U+=Km(H).map(([Y,J])=>`${Y}="${J}"`).join(""),U}).join(";")})((function(M){return M.map(O=>{var R,D;const U={text:(R=O.$el_text)===null||R===void 0?void 0:R.slice(0,400),tag_name:O.tag_name,href:(D=O.attr__href)===null||D===void 0?void 0:D.slice(0,2048),attr_class:Oj(O),attr_id:O.attr__id,nth_child:O.nth_child,nth_of_type:O.nth_of_type,attributes:{}};return Km(O).filter(([W])=>W.indexOf("attr__")===0).forEach(([W,H])=>U.attributes[W]=H),U})})(A)):"")},!((c=v[0])===null||c===void 0)&&c.$el_text?{$el_text:(u=v[0])===null||u===void 0?void 0:u.$el_text}:{},w&&t.type==="click"?{$external_click_url:w}:{},_),target:e};var A,T}const II="autocapture";var y7=class{ba(){this._a=void 0,clearTimeout(this.wa),this.wa=void 0}ka(e){var t;if(!sl(e))return!0;const n=(t=this.Sa().css_selector_ignorelist)!==null&&t!==void 0?t:nm,r=new Set;let s=e;for(;s;){if(r.size>=1e3||r.has(s))return!0;r.add(s);const i=s,o=fc(i);if(We(o,"ph-no-capture")||We(o,"ph-sensitive")||Ju(i)||n.some(u=>If(i,u)))return!0;const c=s.parentNode;s=I0(c)?c.host:c&&pi(c)?c:null}return!1}xa(e){if(!this.isEnabled||e.type==="pointercancel")return void this.ba();if(e.type==="pointerdown"){var t;this.ba();const r=Gf(e);return void(e.isPrimary&&e.button===0&&!e.ctrlKey&&r&&pi(r)&&(this._a={target:r,excluded:this.ka(r),id:e.pointerId,x:e.clientX,y:e.clientY,released:!1,distinctId:(t=this.zl)===null||t===void 0?void 0:t.distinctId}))}const n=this._a;n&&(e.pointerId!==n.id||Math.abs(e.clientX-n.x)>5||Math.abs(e.clientY-n.y)>5?this.ba():e.type==="pointerup"&&(n.released=!0,this.wa=setTimeout(()=>this.ba(),0)))}$a(e){var t;const n=this._a;this.ba();const r=Gf(e);if(n!=null&&n.released&&n.target.isConnected&&n.distinctId===((t=this.zl)===null||t===void 0?void 0:t.distinctId)&&e.pointerId===n.id&&(e.detail>0||e.pointerType==="touch"||e.pointerType==="pen")&&e.button===0&&5>=Math.abs(e.clientX-n.x)&&5>=Math.abs(e.clientY-n.y)&&r&&(Xn(r,"html")||Xn(r,"body"))){var s,i,o;if(n.excluded)return null;const c=(s=this.Sa().css_selector_ignorelist)!==null&&s!==void 0?s:nm;return[r,(i=wf())===null||i===void 0?void 0:i.documentElement,(o=wf())===null||o===void 0?void 0:o.body].some(u=>{if(!u)return!1;const d=fc(u);return We(d,"ph-no-capture")||We(d,"ph-sensitive")||!sl(u)||Ju(u)||c.some(f=>If(u,f))})?null:n.target}}constructor(e){this.Wl=e,this.name=II,this.Ca=!1,this.Ta=null,this.Ia=!1,this.Ma=new Map,this.Ea=!1,this.Nr={enabled:!1,rageclick:!1,maskAllElementAttributes:!1,maskAllText:!1,disableCaptureUrlHashes:!1,remoteRequestsDisabled:!1},this.Mi=!1,this.Wl.refresh(this.Nr),this.rageclicks=new RI(this.Nr.rageclick),this.Aa=null}setup(e){this.Ra(),this.zl=e;const t=e.onRemoteConfig(this.onRemoteConfig.bind(this));this.Mi?t.dispose():(this.na=t,this.startIfEnabled())}dispose(){var e;this.Mi||(this.Mi=!0,this.zl=void 0,(e=this.na)===null||e===void 0||e.dispose(),this.na=void 0,this.Ma.clear(),this.Aa=null,this.Pa())}Sa(){return this.Wl.refresh(this.Nr),this.Nr}Ra(){var e,t;return this.Sa(),this.Nr.url_allowlist=(e=this.Nr.url_allowlist)===null||e===void 0?void 0:e.map(n=>new RegExp(n)),this.Nr.url_ignorelist=(t=this.Nr.url_ignorelist)===null||t===void 0?void 0:t.map(n=>new RegExp(n)),this.Nr}Oa(){const e=lw(),t=wf();if(!this.isBrowserSupported())return void lm.info("Disabling Automatic Event Collection because this browser is not supported");if(!e||!t)return;this.Fa=e,this.Da=t;const n=this.La=r=>{r=r||(e==null?void 0:e.event);try{if(r.type==="blur")return void this.ba();if(r.type.indexOf("pointer")===0)return void this.xa(r);const s=r.type==="click"?this.$a(r):void 0;if(kn(s))return;this.Na(r,"$autocapture",s)}catch(s){lm.error("Failed to capture event",s)}};if(Lt(e,"blur",n),Lt(t,"submit",n,{capture:!0}),Lt(t,"change",n,{capture:!0}),Lt(t,"click",n,{capture:!0}),Zt(["pointerdown","pointermove","pointerup","pointercancel"],r=>{Lt(t,r,n,{capture:!0})}),this.Sa().capture_copied_text){const r=this.ja=s=>{s=s||(e==null?void 0:e.event);try{this.Na(s,f1)}catch(i){lm.error("Failed to capture clipboard event",i)}};Lt(t,"copy",r,{capture:!0}),Lt(t,"cut",r,{capture:!0}),Lt(t,"paste",r,{capture:!0})}}Pa(){const e=this.Fa,t=this.Da;this.ba(),this.La&&(e==null||e.removeEventListener("blur",this.La),Zt(["pointerdown","pointermove","pointerup","pointercancel"],n=>{t==null||t.removeEventListener(n,this.La,!0)}),t==null||t.removeEventListener("submit",this.La,!0),t==null||t.removeEventListener("change",this.La,!0),t==null||t.removeEventListener("click",this.La,!0),this.La=void 0),this.ja&&(t==null||t.removeEventListener("copy",this.ja,!0),t==null||t.removeEventListener("cut",this.ja,!0),t==null||t.removeEventListener("paste",this.ja,!0),this.ja=void 0),this.Fa=void 0,this.Da=void 0,this.Ca=!1}startIfEnabled(){this.isEnabled||this.ba(),!this.Mi&&this.zl&&this.isEnabled&&!this.Ca&&(this.Oa(),this.Ca=!0)}onRemoteConfig(e){if(this.Mi)return;if(this.Ia=!0,!e.ok)return void this.startIfEnabled();const t=e.config;t.elementsChainAsString&&(this.Ea=t.elementsChainAsString);const n=t.autocapture_opt_out;var r;hs(n)&&((r=this.zl)===null||r===void 0||r.kv.set("$autocapture_disabled_server_side",n),this.Ta=n),this.startIfEnabled()}setElementSelectors(e,t=this){if(this.Mi)return;e.size?this.Ma.set(t,new Set(e)):this.Ma.delete(t);const n=new Set;this.Ma.forEach(r=>{r.forEach(s=>n.add(s))}),this.Aa=n}getElementSelectors(e,t){var n;const r=[];return(n=this.Aa)===null||n===void 0||n.forEach(s=>{var i;const o=(i=wf())===null||i===void 0?void 0:i.querySelectorAll(s);o==null||o.forEach(c=>{e!==c&&t!==c||We(r,s)||r.push(s)})}),r}get isEnabled(){var e,t;if(this.Mi)return!1;const n=(e=this.zl)===null||e===void 0?void 0:e.kv.get(vR),r=this.Ta,s=this.Sa();if(!s.remoteRequestsDisabled&&!this.Ia)return!1;const i=s.remoteRequestsDisabled&&!this.Ia;if(kn(r)&&!hs(n)&&!i)return!1;const o=(t=this.Ta)!==null&&t!==void 0?t:!!n;return!!s.enabled&&!o}Na(e,t="$autocapture",n){if(!this.isEnabled)return void this.ba();let r=n||Gf(e);VR(r)&&(r=r.parentNode||null);const s=this.Ra();var i;t==="$autocapture"&&e.type==="click"&&e instanceof MouseEvent&&s.rageclick&&(!((i=this.rageclicks)===null||i===void 0)&&i.isRageClick(e.clientX,e.clientY,e.timeStamp||new Date().getTime()))&&BR(r,s.rageclick)&&this.Na(e,"$rageclick",n);const o=t===f1,c=o?$($({},s),{},{dom_event_allowlist:void 0}):s;if(r&&(function(m,v,_,w,b,S){var E;const C=typeof window>"u"?void 0:window;if(!C||gb(m)||_!=null&&_.url_allowlist&&!p6(_.url_allowlist,S)||_!=null&&_.url_ignorelist&&p6(_.url_ignorelist,S))return!1;if(_!=null&&_.dom_event_allowlist){const O=_.dom_event_allowlist;if(O&&!O.some(R=>v.type===R))return!1}const{parentIsUsefulElement:A,targetElementList:T}=WR(m,w);if(!(function(O,R){const D=R==null?void 0:R.element_allowlist;if(ce(D))return!0;for(const U of O)if(D.some(W=>U.tagName.toLowerCase()===W))return!0;return!1})(T,_)||!tw(T,_==null?void 0:_.css_selector_allowlist)||tw(T,(E=_==null?void 0:_.css_selector_ignorelist)!==null&&E!==void 0?E:nm))return!1;try{const O=C.getComputedStyle(m);if(O&&O.getPropertyValue("cursor")==="pointer"&&v.type==="click")return!0}catch{}const M=m.tagName.toLowerCase();switch(M){case"html":return!1;case"form":return(b||["submit"]).indexOf(v.type)>=0;case"input":case"select":case"textarea":return(b||["change","click"]).indexOf(v.type)>=0;default:return A?(b||["click"]).indexOf(v.type)>=0:(b||["click"]).indexOf(v.type)>=0&&(pb.indexOf(M)>-1||m.getAttribute("contenteditable")==="true")}})(r,e,c,o,o?["copy","cut","paste"]:void 0,{config:{get_current_url:s.getCurrentUrl}})){var u;const{props:m,explicitNoCapture:v,target:_}=v7(r,{e,maskAllElementAttributes:s.maskAllElementAttributes,maskAllText:s.maskAllText,elementAttributeIgnoreList:s.element_attribute_ignorelist,elementsChainAsString:this.Ea,disableCaptureUrlHashes:s.disableCaptureUrlHashes});if(v)return!1;const w=this.getElementSelectors(r,_);if(w&&w.length>0&&(m.$element_selectors=w),t===f1){const b=e.type||"clipboard";if(b!=="paste"){var d,f;const S=(d=lw())===null||d===void 0||(d=d.getSelection())===null||d===void 0?void 0:d.toString(),E=HR(S);if(!E)return!1;m.$selected_content=E,m.$clipboard_text_length=(f=S==null?void 0:S.length)!==null&&f!==void 0?f:0}m.$copy_type=b}if(t==="$autocapture"&&e.type==="change"&&s.capture_value_css_selector_allowlist&&!s.maskAllText&&(Xn(p=r,"input")?!We(m7,p.type):Xn(p,"textarea")||Xn(p,"select")&&!p.multiple)&&(function(b,S){var E;if(!sl(b))return!1;const C=(E=S.css_selector_ignorelist)!==null&&E!==void 0?E:nm,A=new Set;let T=b;for(Xn(b,"select")&&(T=b.options[b.selectedIndex]||b);T;){const M=T,O=fc(M);if(A.size>=1e3||A.has(T)||We(O,"ph-sensitive")||We(O,"ph-no-capture")||C.some(D=>If(M,D)))return!1;A.add(T);const R=T.assignedSlot||T.parentNode;T=I0(R)?R.host:R&&pi(R)?R:null}return!0})(r,s)&&!r.querySelector(".ph-no-capture, .ph-sensitive")){const b=s.capture_value_css_selector_allowlist;let S=!1;try{S=Mn(b)?!!b(r):He(b)&&b.some(E=>If(r,E))}catch(E){lm.error("capture_value_css_selector_allowlist threw",E)}S&&(m.$input_value=r.value)}return(u=this.zl)===null||u===void 0||u.capture(t,m),!0}var p}isBrowserSupported(){var e;return Mn((e=wf())===null||e===void 0?void 0:e.querySelectorAll)}};const OI="featureFlags",MI="logs",fh=()=>{var e;return!(le==null||(e=le.performance)===null||e===void 0)&&e.now?le.performance.now():Date.now()},_7=[50,75,100,150,200,300,400,500,750,1e3,1500,2e3,3e3,5e3,1e4];var w7=class{constructor(e){this._instance=e}initialize(){}get(e){const t=this._instance.persistence;if(typeof e=="string")return t==null?void 0:t.get_property(e);const n={};for(const r of e){const s=t==null?void 0:t.get_property(r);ce(s)||(n[r]=s)}return n}set(e,t){var n;(n=this._instance.persistence)===null||n===void 0||n.register(typeof e=="string"?{[e]:t}:e)}remove(e){var t;(t=this._instance.persistence)===null||t===void 0||t.unregister(e)}},b7=class{constructor(e){this.instance=e,this.A=me,this.kv=new w7(e),this.onSession=t=>om(this.instance.onSessionId(n=>{try{t(n)}catch(r){this.A.error("Browser extension session listener failed",r)}})),this.onEvent=t=>om(this.instance._addCaptureHook((n,r)=>{if(r)try{t({event:n,properties:r.properties})}catch(s){this.A.error("Browser extension event listener failed",s)}})),this.onRemoteConfig=t=>{const n=s=>{try{t(s)}catch(i){this.A.error("Browser extension remote config listener failed",i)}},r=this.instance.vr.on("extensionsRemoteConfig",n);return this.instance.pr&&n(this.instance.pr),om(r)}}get logger(){return this.A}get distinctId(){return this.instance.get_distinct_id()}get anonymousId(){var e;return(e=this.instance.get_property("$device_id"))!==null&&e!==void 0?e:this.distinctId}get deviceId(){const e=this.instance.get_property(ib);return typeof e=="string"?e:void 0}get library(){return{name:Cs.LIB_NAME,version:Cs.LIB_VERSION}}get initialPersonProperties(){var e,t;return(e=(t=this.instance.persistence)===null||t===void 0?void 0:t.get_initial_props())!==null&&e!==void 0?e:{}}get groups(){return this.instance.getGroups()}get session(){try{var e,t,n,r,s;const i=(e=this.instance.sessionManager)===null||e===void 0?void 0:e.checkAndGetSessionAndWindowId(!0);return{sessionId:(t=i==null?void 0:i.sessionId)!==null&&t!==void 0?t:"",windowId:(n=i==null?void 0:i.windowId)!==null&&n!==void 0?n:"",sessionStartTimestamp:(r=i==null?void 0:i.sessionStartTimestamp)!==null&&r!==void 0?r:0,lastActivityTimestamp:(s=i==null?void 0:i.lastActivityTimestamp)!==null&&s!==void 0?s:0}}catch{return{sessionId:"",windowId:"",sessionStartTimestamp:0,lastActivityTimestamp:0}}}get isOptedOut(){return this.instance.has_opted_out_capturing()}get canCapture(){return Mn(this.instance.is_capturing)?this.instance.is_capturing():!this.isOptedOut}get isRateLimited(){var e;return!!(!((e=this.instance.rateLimiter)===null||e===void 0)&&e.isClientRateLimited)}get projectToken(){return this.instance.config.token}getExtension(e){let t;switch(e){case OI:case"featureFlagsCommon":t=this.instance.featureFlags;break;case MI:t=this.instance.logs;break;case"surveys":t=this.instance.surveys;break;case II:t=this.instance.autocapture}return t}capture(e,t,n){if(!n)return this.mr(this.instance.capture(e,t));const r=$({timestamp:n.timestamp,uuid:n.uuid,$set:n.set,$set_once:n.setOnce},n.delivery==="unload"?{transport:"sendBeacon",send_instantly:!0}:{});return this.mr(this.instance.capture(e,t,r))}mr(e){var t;return!ce(e)||!(!((t=this.instance.rateLimiter)===null||t===void 0)&&t.lastEventRateLimited)}registerDynamicEventProperties(e){return om(this.instance.gr(e))}sendRequest(e){var t=this;return un(function*(n,r={}){var s;const i=(s=r.target)!==null&&s!==void 0?s:"api",o=r.query?Pg(n,r.query):n,c=t.instance.requestRouter.endpointFor(i,o),u={method:r.method,url:c,data:r.body,headers:r.headers,timeout:r.timeoutMs,fireCallbackOnDrop:!0,transport:r.transport,compression:r.compression,compressionFallback:r.target==="flags"&&r.compression==="best-available"?O_.Base64:void 0,timestampMode:r.sentAt};return i==="api"&&n==="/i/v1/logs"&&(u.batchKey="logs"),r.transport==="sendBeacon"?(t.instance._send_request(u),{statusCode:202}):new Promise(d=>{var f;if(u.callback=d,i==="flags"&&((f=t.instance.config.metrics)===null||f===void 0?void 0:f.flags)){let p;u.onDispatch=()=>{p=fh()},u.callback=m=>{ce(p)||t.yr(c,m,fh()-p),d(m)}}t.instance._send_request(u)})}).apply(this,arguments)}yr(e,t,n){try{var r,s,i;const o=t.statusCode||void 0,c={"server.address":((r=(s=yo(e))===null||s===void 0?void 0:s.hostname)!==null&&r!==void 0?r:e).replace(/^\[(.*)\]$/,"$1")};o&&(c["http.response.status_code"]=o);const u=((f,p)=>f?400>f?void 0:String(f):(p==null?void 0:p.name)==="AbortError"?"timeout":"_OTHER")(o,t.error);u&&(c["error.type"]=u);const d=vb();d&&(c["client.timezone"]=d),(i=this.instance.metrics)===null||i===void 0||i.histogram("posthog.flags.request.duration",n,{unit:"ms",attributes:c,bounds:_7})}catch(o){me.error("Failed to record the /flags request duration",o)}}};const Yf={};let p1=0;const Qf=()=>{},V6='Consent opt in/out is not valid with cookieless_mode="always" and will be ignored',ou="Surveys module not available",H6="sanitize_properties is deprecated. Use before_send instead",NI="Invalid value for property_denylist config: ",x7=["$recording_status","$sdk_debug_recording_script_not_loaded","$sdk_debug_replay_url_trigger_status","$sdk_debug_replay_event_trigger_status","$sdk_debug_replay_linked_flag_trigger_status","$sdk_debug_replay_rrweb_error","$sdk_debug_replay_internal_buffer_length","$sdk_debug_replay_flushed_size"],S7=["$feature_flag_called","$$heatmap","$snapshot"],U6=e=>e.charAt(0)==="$"&&!We(S7,e),E7=/^[A-Za-z0-9_-]{1,400}$/,Z6=/^fb\.[0-9]+\.[0-9]+\.[A-Za-z0-9_-]+(?:\.[A-Za-z0-9_-]+)?$/,B6=/^fb\.[0-9]+\.[0-9]+\.[0-9]+$/,k7=["token","distinct_id",CR],Mf="posthog",C7=[...j6].sort()[j6.length-1],P7=e=>{const t={};return e&&e!=="unset"&&("2025-11-30">e||(t.strictMinimumDuration=!0),"2026-05-30">e||(t.canvasCapture={resolutionScale:.6}),"2026-06-25">e||(t.streamNetworkBody=!0),"2026-08-30">e||(t.captureJsonLd=!0)),t},m1=e=>{var t;return $({api_host:"https://us.i.posthog.com",flags_api_host:null,ui_host:null,asset_host:null,token:"",autocapture:!0,cross_subdomain_cookie:vj(Ie==null?void 0:Ie.location),persistence:"localStorage+cookie",persistence_name:"",cookie_persisted_properties:[],loaded:Qf,save_campaign_params:!0,custom_campaign_params:[],custom_blocked_useragents:[],save_referrer:!0,capture_pageleave:"if_capture_pageview",defaults:e??"unset",__preview_deferred_init_extensions:!1,__preview_replay_sync_fetch:!0,__preview_external_dependency_versioned_paths:!1,__preview_cookie_wins_on_conflict:!1,debug:cn&&dt(cn==null?void 0:cn.search)&&cn.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,reuseAnonymousId:!1,disable_external_dependency_loading:!1,strict_script_versioning:"fallback",enable_recording_console_log:void 0,secure_cookie:(le==null||(t=le.location)===null||t===void 0?void 0:t.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,feature_flag_request_max_retries:1,surveys_request_timeout_ms:1e4,on_request_error(n){me.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:$R,before_send:void 0,get_current_url:void 0,request_queue_config:{flush_interval_ms:3e3},error_tracking:{},_onCapture:Qf},(n=>({rageclick:n&&n>="2026-05-30"?{content_ignorelist:mb,ignore_text_selection:!0}:!n||"2025-11-30">n||{content_ignorelist:!0},capture_pageview:!n||"2025-05-24">n||"history_change",session_recording:P7(n),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),cookieWinsOnConflict:!(!n||n==="unset"||"2026-08-29">n)}))(e))},A7=[["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"],["__preview_cookie_wins_on_conflict","cookieWinsOnConflict"]],W6=e=>{const t={};for(const[s,i]of A7)ce(e[s])||(t[i]=e[s]);const n=mn({},t,e),r=e.__preview_external_dependency_versioned_paths;return ce(r)||(ce(e.strict_script_versioning)&&(n.strict_script_versioning=!!r),dt(r)&&ce(e.asset_host)&&(n.asset_host=r)),He(e.property_blacklist)&&(ce(e.property_denylist)?n.property_denylist=e.property_blacklist:He(e.property_denylist)?n.property_denylist=[...e.property_blacklist,...e.property_denylist]:me.error(NI+e.property_denylist)),n};var T7=class{constructor(){this.__forceAllowLocalhost=!1,this.Ih=!1}get Mh(){return this.__forceAllowLocalhost}set Mh(e){me.error("WebPerformanceObserver is deprecated and has no impact on network capture. Use `_forceAllowLocalhostNetworkCapture` on `posthog.sessionRecording`"),this.__forceAllowLocalhost=e}},Xf=class Ho{Eh(t){if(!t)return;const n=this.Ah.indexOf(t);n!==-1&&this.Ah.splice(n,1)}Rh(t,n){var r;return this.Eh(t),this.Ah.push(n),(r=n.initialize)===null||r===void 0||r.call(n),n}Ph(){return this.config.cookieless_mode==="always"||this.config.cookieless_mode==="on_reject"&&this.consent.isRejected()}Oh(){if(this.Fh||!this.Dh||!("capture_pageview"in this.Dh)||$($({},Ho.__defaultExtensionClasses),this.config.__extensionClasses).historyAutocapture)return;const t=this.config.capture_pageview;(t==="history_change"||lt(t)&&(t.path||t.search||t.hash&&!this.config.disable_capture_url_hashes))&&(this.Fh=!0,me.warn("capture_pageview is set to capture history changes, but the history autocapture extension is not loaded, so only the first pageview of each page load is captured. With the slim bundle, pass __extensionClasses: { historyAutocapture: AnalyticsExtensions.historyAutocapture } from 'posthog-js/dist/extension-bundles', or set capture_pageview: true to capture page loads only."))}Lh(){if(this.Nh||this.config.reuseAnonymousId||this.config.segment||this.Ph())return;const t=this.config.persistence==="memory"||this.config.persistence==="sessionStorage";if(!t&&!this.config.disable_persistence||this.jh)return;let n,r,s;t?(n=`persistence is set to '${this.config.persistence}'`,r=this.config.persistence==="memory"?"on every page load":"for every new browser tab or window",s="Either set persistence to 'localStorage+cookie', keep this persistence and pass a stable ID through bootstrap.distinctID, or enable reuseAnonymousId."):(n="persistence is disabled (disable_persistence is true)",r="on every page load",s="Either set disable_persistence to false, keep persistence disabled and pass a stable ID through bootstrap.distinctID, or enable reuseAnonymousId."),this.Nh=!0,console.warn("[PostHog.js]",`${n} but no bootstrap.distinctID was provided. PostHog will mint a new distinct ID ${r}, so calling identify() merges a new ID onto the person each time. A person can then pass the distinct-ID limit and its events stop appearing on person pages and the session tab. ${s}`)}qh(){const t=this.persistence;if(!t||this.Bh)return;if(this.Ph())return void(this.config.cookieless_mode==="on_reject"&&this.get_distinct_id()!=="$posthog_cookieless"&&(this.zh(),this.Hh()));if(this.get_distinct_id()!=="$posthog_cookieless")return;this.Uh()||t.load(!0);const n=this.get_distinct_id();if(!n||n==="$posthog_cookieless"){const r=this.config.get_device_id(Di());this.register({distinct_id:r,$device_id:r}),t.set_property(Jr,Yo)}this.zh()}get decideEndpointWasHit(){var t,n;return(t=(n=this.featureFlags)===null||n===void 0?void 0:n.hasLoadedFlags)!==null&&t!==void 0&&t}get flagsEndpointWasHit(){var t,n;return(t=(n=this.featureFlags)===null||n===void 0?void 0:n.hasLoadedFlags)!==null&&t!==void 0&&t}constructor(){var t;this.Ih=!1,this.Wh=!1,this.Vh=!1,this.webPerformance=new T7,this.Gh=!1,this.version=Cs.LIB_VERSION,this.Qh=new Set,this.Jh="",this.vr=new L0,this.Ah=[],this.Zh=[],this.Kh=!1,this.jh=!1,this.Nh=!1,this.Fh=!1,this.Bh=!1,this._calculate_event_properties=this.calculateEventProperties.bind(this),this.config=m1(),this.SentryIntegration=Lj,this.sentryIntegration=r=>(function(s,i){const o=qR(s,i);return{name:GR,processEvent:c=>o(c)}})(this,r),this.__request_queue=[],this.__loaded=!1,this.analyticsDefaultEndpoint="/e/",this.Yh=!1,this.Xh=null,this.ed=null,this.nd=null,this.scrollManager=new s7(this),this.pageViewManager=new C6(this),this.rateLimiter=new Bj(this),this.requestRouter=new c7(this),this.consent=new Ej(this),this.externalIntegrations=new p7(this);const n=(t=Ho.__defaultExtensionClasses)!==null&&t!==void 0?t:{};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:(r,s,i)=>{const o=dt(r)?{[r]:s}:r;this.setPersonProperties(o),i==null||i({})},set_once:(r,s,i)=>{const o=dt(r)?{[r]:s}:r;this.setPersonProperties(void 0,o),i==null||i({})}},this.on("eventCaptured",r=>me.info(`send "${r==null?void 0:r.event}"`,r))}init(t,n,r){if(r&&r!==Mf){var s;const i=(s=Yf[r])!==null&&s!==void 0?s:new Ho;return i._init(t,n,r),Yf[r]=i,Yf[Mf][r]=i,i}return this._init(t,n,r)}_init(t,n={},r){var s,i,o;const c=dt(t)?t.trim():"";if(!c)return me.critical("PostHog was initialized without a token. This likely indicates a misconfiguration. Please check the first argument passed to posthog.init()"),this;var u;if(this.__loaded)return c!==((u=this.config)===null||u===void 0?void 0:u.token)?console.warn("[PostHog.js]",`You have already initialized PostHog with a different project token! Re-initializing is a no-op, so events will keep going to the project this instance was initialized with. To capture into a second project, load PostHog once, then initialize a named instance after the SDK has loaded, e.g. posthog.init('${c}', { ... }, 'project2')`):console.warn("[PostHog.js]","You have already initialized PostHog! Re-initializing is a no-op"),this;this.__loaded=!0,this.config=m1(n.defaults),n.debug=this.sd(n.debug),this.Dh=n,this.rd=[],n.person_profiles?this.ed=n.person_profiles:n.process_person&&(this.ed=n.process_person);const d=m1(n.defaults),f=W6(n),p=mn({},d,f,{name:r,token:c});lt(d.rageclick)&<(f.rageclick)&&(p.rageclick=mn({},d.rageclick,f.rageclick)),lt(d.session_recording)&<(f.session_recording)&&(p.session_recording=mn({},d.session_recording,f.session_recording)),this.set_config(p),this.config.on_xhr_error&&me.error("on_xhr_error is deprecated. Use on_request_error instead"),this.compression=n.disable_compression?void 0:Ks.GZipJS;const m=this.Uh(),v=!this.Ph();if(this.persistence=new s1(this.config,m,!0,v),this.sessionPersistence=this.config.persistence==="sessionStorage"||this.config.persistence==="memory"?this.persistence:new s1($($({},this.config),{},{persistence:"sessionStorage"}),m,!1,v),this.Jh="ph_"+(this.config.persistence_name||this.config.token)+"_session_registered_properties",this.config.persistence!=="memory"&&!m&&sn.Ot()){const E=sn.Ft(this.Jh);He(E)&&E.forEach(C=>{dt(C)&&this.Qh.add(C)})}else sn.Dt(this.Jh);const _=$({},this.persistence.props),w=$({},this.sessionPersistence.props);this.register({$initialization_time:new Date().toISOString()}),this.od=new t7((E,C)=>this.ld(E,C),this.config.request_queue_config),this.ad=new r7(this),this.__request_queue=[];const b=this.Ph();b||(this.sessionManager=new F6(this),this.sessionPropsManager=new $6(this,this.sessionManager,this.persistence),this.sessionManager.onSessionId((E,C,A)=>{(A!=null&&A.activityTimeout||A!=null&&A.sessionPastMaximumLength||A!=null&&A.crossTabAdoption)&&this.ud()})),this.hd(),this.config.__preview_deferred_init_extensions?(me.info("Deferring extension initialization to improve startup performance"),this.dd=setTimeout(()=>{this.dd=void 0,this.vd(b)},0)):(me.info("Initializing extensions synchronously"),this.vd(b)),Cs.DEBUG=Cs.DEBUG||this.config.debug,Cs.DEBUG&&me.info("Starting in debug mode",{this:this,config:n,thisC:$({},this.config),p:_,s:w}),this.config.identity_distinct_id&&!(!((s=n.bootstrap)===null||s===void 0)&&s.distinctID)&&(n.bootstrap=$($({},n.bootstrap),{},{distinctID:this.config.identity_distinct_id,isIdentifiedID:!0}));const S=(i=n.bootstrap)===null||i===void 0?void 0:i.distinctID;if(this.jh=!!S&&!Hf(S),(o=n.bootstrap)===null||o===void 0?void 0:o.distinctID){const E=n.bootstrap.distinctID,C=this.get_distinct_id(),A=this.persistence.get_property(Jr);if(n.bootstrap.isIdentifiedID&&C!=null&&C!==E&&A==="anonymous")this.identify(E);else if(n.bootstrap.isIdentifiedID&&C!=null&&C!==E&&A==="identified")me.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{const T=this.config.get_device_id(Di()),M=n.bootstrap.isIdentifiedID?T:E;this.persistence.set_property(Jr,n.bootstrap.isIdentifiedID?Wm:Yo),this.register({distinct_id:E,$device_id:M})}}if(b)this.register_once({distinct_id:Qy,$device_id:null},"");else if(!this.get_distinct_id()){const E=this.config.get_device_id(Di());this.register_once({distinct_id:E,$device_id:E},""),this.persistence.set_property(Jr,Yo)}return Lt(le,"onpagehide"in self?"pagehide":"unload",this._handle_unload.bind(this),{passive:!1}),Lt(le,"pageshow",E=>{if(this.Wh=!1,!this.Vh){var C;if(E.persisted&&this.persistence){const A=this.persistence.get_property(ui),T=this.persistence.get_property(Jr);this.persistence.load(),this.fd()||A===this.persistence.get_property("distinct_id")&&T===this.persistence.get_property("$user_state")||this.pd()}(C=this.ad)===null||C===void 0||C.resume()}}),n.segment?k6(this,()=>this.gd()):this.gd(),Mn(this.config._onCapture)&&this.config._onCapture!==Qf&&(me.warn("onCapture is deprecated. Please use `before_send` instead"),this.on("eventCaptured",E=>this.config._onCapture(E.event,E))),this.config.ip&&me.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 kI.apply(this,arguments)})().then(E=>{E&&this.register({[Yy]:E})}).catch(Qf),this}md(t){const n=t;return dt(n.name)&&Mn(n.setup)}yd(t,n){var r=this;this.md(t)?n.push(un(function*(){try{yield t.setup(r.bd())}catch(i){me.error(`Failed to set up extension "${t.name}"`,i);try{var s;yield(s=t.dispose)===null||s===void 0?void 0:s.call(t)}catch(o){me.error(`Failed to dispose extension "${t.name}"`,o)}}})):this.Ah.push(t)}hd(){var t,n,r,s=this;const i=(t=(n=this.config.__extensionClasses)===null||n===void 0?void 0:n.featureFlags)!==null&&t!==void 0?t:(r=Ho.__defaultExtensionClasses)===null||r===void 0?void 0:r.featureFlags;var o,c,u;if(i)if(this.featureFlags&&this.featureFlags instanceof i||((o=this._d)===null||o===void 0||o.call(this),this._d=void 0,this.featureFlags=new i(this)),Mn(this.featureFlags.onReloading)&&Mn(this.featureFlags.setup)){if(!this._d){this._d=this.featureFlags.onReloading(()=>{this.vr.emit("featureFlagsReloading",!0)});const d=this.featureFlags;un(function*(){try{yield d.setup(s.bd())}catch(f){me.error("Failed to set up feature flags",f);const p=s._d;s._d=void 0;try{p==null||p()}catch(m){me.error("Failed to unsubscribe feature flag reloading",m)}try{yield d.dispose()}catch(m){me.error("Failed to dispose feature flags",m)}}})()}}else(c=(u=this.featureFlags).initialize)===null||c===void 0||c.call(u)}vd(t){const n=performance.now(),r=$($({},Ho.__defaultExtensionClasses),this.config.__extensionClasses),s=[];var i,o,c,u,d,f,p,m;r.exceptions&&this.Ah.push(this.exceptions=(i=this.exceptions)!==null&&i!==void 0?i:new r.exceptions(this)),r.historyAutocapture&&this.Ah.push(this.historyAutocapture=new r.historyAutocapture(this)),this.Oh(),r.tracingHeaders&&this.Ah.push(this.tracingHeaders=new r.tracingHeaders(this)),r.siteApps&&this.Ah.push(this.siteApps=new r.siteApps(this)),r.sessionRecording&&!t&&this.Ah.push(this.sessionRecording=new r.sessionRecording(this)),this.config.disable_scroll_properties||s.push(()=>{this.scrollManager.startMeasuringScrollPosition()}),r.autocapture&&this.yd(this.autocapture=new r.autocapture(this),s),r.surveys&&this.yd(this.surveys=(o=this.surveys)!==null&&o!==void 0?o:new r.surveys(this),s),r.logs&&this.yd(this.logs=(c=this.logs)!==null&&c!==void 0?c:new r.logs(this),s),r.metrics&&this.Ah.push(this.metrics=(u=this.metrics)!==null&&u!==void 0?u:new r.metrics(this)),r.conversations&&this.Ah.push(this.conversations=(d=this.conversations)!==null&&d!==void 0?d:new r.conversations(this)),r.productTours&&this.Ah.push(this.productTours=new r.productTours(this)),r.heatmaps&&this.Ah.push(this.heatmaps=new r.heatmaps(this)),r.webVitalsAutocapture&&this.Ah.push(this.webVitalsAutocapture=new r.webVitalsAutocapture(this)),r.exceptionObserver&&this.Ah.push(this.exceptionObserver=new r.exceptionObserver(this)),r.deadClicksAutocapture&&this.Ah.push(this.deadClicksAutocapture=new r.deadClicksAutocapture(this,Nj)),r.toolbar&&this.Ah.push(this.toolbar=(f=this.toolbar)!==null&&f!==void 0?f:new r.toolbar(this)),r.experiments&&this.Ah.push(this.experiments=(p=this.experiments)!==null&&p!==void 0?p:new r.experiments(this)),r.webMCP&&this.Ah.push(this.webMCP=(m=this.webMCP)!==null&&m!==void 0?m:new r.webMCP(this)),this.Ah.forEach(v=>{v.initialize&&s.push(()=>{var _;(_=v.initialize)===null||_===void 0||_.call(v)})}),s.push(()=>{if(this.wd){const v=this.wd;this.wd=void 0,this.Ah.forEach(_=>{var w;return(w=_.onRemoteConfig)===null||w===void 0?void 0:w.call(_,v)})}}),this.kd(s,n)}kd(t,n){for(;t.length>0;){if(this.config.__preview_deferred_init_extensions&&performance.now()-n>=30&&t.length>0)return void(this.dd=setTimeout(()=>{this.dd=void 0,this.kd(t,n)},0));const s=t.shift();if(s)try{s()}catch(i){me.error("Error initializing extension:",i)}}const r=Math.round(performance.now()-n);this.register_for_session({[PR]:this.config.__preview_deferred_init_extensions?"deferred":"synchronous",[AR]:r}),this.config.__preview_deferred_init_extensions&&me.info(`PostHog extensions initialized (${r}ms)`)}_c(t){if(!Ie||!Ie.body)return me.info("document not ready yet, trying again in 500 milliseconds..."),void setTimeout(()=>{this._c(t)},500);if(this.config.__preview_deferred_init_extensions&&(this.wd=t),this.pr=t,this.compression=void 0,t.ok){var n;const r=t.config;r.supportedCompression&&!this.config.disable_compression&&(this.compression=We(r.supportedCompression,Ks.GZipJS)?Ks.GZipJS:We(r.supportedCompression,Ks.Base64)?Ks.Base64:void 0),!((n=r.analytics)===null||n===void 0)&&n.endpoint&&(this.analyticsDefaultEndpoint=r.analytics.endpoint)}this.set_config({person_profiles:this.ed?this.ed:$R}),this.vr.emit("extensionsRemoteConfig",t),this.Ah.forEach(r=>{var s;return(s=r.onRemoteConfig)===null||s===void 0?void 0:s.call(r,t)})}gd(){try{this.config.loaded(this)}catch(t){me.critical("`loaded` function failed",t)}if(this.Sd(),this.config.internal_or_test_user_hostname&&(cn==null?void 0:cn.hostname)){const t=cn.hostname,n=this.config.internal_or_test_user_hostname;(typeof n=="string"?t===n:n.test(t))&&this.setInternalOrTestUser()}this.config.capture_pageview&&setTimeout(()=>{(this.consent.isOptedIn()||this.Ph())&&this.xd()},1),this.$d=new oI(this),this.$d.load()}Sd(){var t;this.is_capturing()&&this.config.request_batching&&((t=this.od)===null||t===void 0||t.enable())}_dom_loaded(){this.is_capturing()&&xu(this.__request_queue,t=>this.ld(t)),this.__request_queue=[],this.Sd()}_handle_unload(){var t,n,r,s,i,o;this.Wh=!0,(t=this.surveys)===null||t===void 0||(n=t.handlePageUnload)===null||n===void 0||n.call(t),(r=this.metrics)===null||r===void 0||r.flush("sendBeacon"),this.config.request_batching?(this.Cd()&&this.capture(o6),(s=this.logs)===null||s===void 0||s.flushLogs("sendBeacon"),(i=this.od)===null||i===void 0||i.unload(),(o=this.ad)===null||o===void 0||o.unload()):this.Cd()&&this.capture(o6,null,{transport:"sendBeacon"})}_send_request(t){SI(this,t)}ld(t,n){this.ad?this.ad.retriableRequest(t,n):this._send_request(n?$($({},t),{},{transport:n}):t)}_execute_array(t){p1++;try{let n;const r=[],s=[],i=[];xu(t,c=>{if(c)if(n=c[0],He(n))i.push(c);else if(Mn(c))try{c.call(this)}catch(u){me.error("Error executing queued PostHog call",c,u)}else He(c)&&n==="alias"?r.push(c):He(c)&&n.indexOf("capture")!==-1&&Mn(this[n])?i.push(c):s.push(c)});const o=function(c,u){xu(c,function(d){try{if(He(d[0])){let f=u;Zt(d,function(p){f=f[p[0]].apply(f,p.slice(1))})}else u[d[0]].apply(u,d.slice(1))}catch(f){me.error("Error executing queued PostHog call",d,f)}})};o(r,this),o(s,this),o(i,this)}finally{p1--}}push(t){if(p1>0&&He(t)&&dt(t[0])){const n=Ho.prototype[t[0]];return void(Mn(n)&&n.apply(this,t.slice(1)))}this._execute_array([t])}get Td(){return{property:s6,persistenceKey:Iu,cookieName:"_fbc",pattern:Z6,register:(t,n)=>{var r;return(r=this.persistence)===null||r===void 0?void 0:r.register({[Iu]:{value:t,delivered:n}})},unregister:()=>{var t;return(t=this.persistence)===null||t===void 0?void 0:t.unregister(Iu)}}}get Id(){return{property:i6,persistenceKey:Bf,cookieName:"_fbp",pattern:B6,register:(t,n)=>{var r;return(r=this.persistence)===null||r===void 0?void 0:r.register({[Bf]:{value:t,delivered:n}})},unregister:()=>{var t;return(t=this.persistence)===null||t===void 0?void 0:t.unregister(Bf)}}}Md(t){var n;const r=(n=this.persistence)===null||n===void 0?void 0:n.get_property(t.persistenceKey);return dt(r)&&t.pattern.test(r)?{value:r,delivered:!1}:lt(r)&&dt(r.value)&&t.pattern.test(r.value)?{value:r.value,delivered:r.delivered===!0}:void 0}Ed(t,n,r){return n===(r==null?void 0:r.value)?{value:n,pending:!r.delivered}:(t.register(n,!1),{value:n,pending:!0})}Ad(t){if(!this.config.save_campaign_params||this.Ph())return;const n=Kf(t.cookieName);return dt(n)&&t.pattern.test(n)?n:void 0}Rd(t,n,r,s){if(!this.persistence)return;const i=this.Td,o=this.Md(i);if(s)return void i.unregister();if(r)return dt(n)&&Z6.test(n)?this.Ed(i,n,o):void i.unregister();const c=dt(t)&&E7.test(t)?t:void 0,u=this.Ad(i);return u&&((d,f,p)=>{const m=d.split(".");if(f)return m[3]===f;if(!p)return!0;const v=p.value.split(".");return m[3]===v[3]||Number(m[2])>Number(v[2])})(u,c,o)?this.Ed(i,u,o):c?(o==null?void 0:o.value.split(".")[3])===c?{value:o.value,pending:!o.delivered}:this.Ed(i,`fb.1.${Date.now()}.${c}`,o):o?{value:o.value,pending:!o.delivered}:void 0}Pd(t,n,r){if(!this.persistence)return;const s=this.Id,i=this.Md(s);if(r)return void s.unregister();if(n)return dt(t)&&B6.test(t)?this.Ed(s,t,i):void s.unregister();const o=this.Ad(s);return o?this.Ed(s,o,i):i?{value:i.value,pending:!i.delivered}:void 0}Od(t){if(!this.persistence)return;const n=({channel:s,value:i})=>{const o=this.Md(s);return(o==null?void 0:o.value)===i&&!o.delivered},r=t.filter(n);r.length&&(this.persistence.refreshMetaIdentifiers(),r.filter(n).forEach(({channel:s,value:i})=>s.register(i,!0)))}capture(t,n,r){var s,i,o;if(!(this.__loaded&&this.persistence&&this.sessionPersistence&&this.od))return void me.uninitializedWarning("posthog.capture");if(!this.is_capturing())return void me.info(`Event "${t}" was not captured because capturing is disabled (opted out or consent pending).`);if(ce(t)||!dt(t))return void me.error("No event name provided to posthog.capture");if(this.qh(),t==="$snapshot"&&this.Ph())return;const c=!this.config.opt_out_useragent_filter&&this._is_bot();if(c&&!this.config.__preview_capture_bot_pageviews)return this.Ih||(this.Ih=!0,console.warn('[PostHog.js] Events are being dropped because the user agent looks like a bot (first dropped event: "'+t+'"). Set `opt_out_useragent_filter: true` to capture them, e.g. in end-to-end tests. Note that logs from `captureLog` are not subject to this filter.')),void me.info(`Event "${t}" was not captured because the user agent looks like a bot. Set \`opt_out_useragent_filter: true\` to capture it.`);const u=r!=null&&r.skip_client_rate_limiting?void 0:this.rateLimiter.clientRateLimitContext();if(u!=null&&u.isRateLimited)return void me.critical("This capture call is ignored due to client rate limiting.");let d;n!=null&&n.$current_url&&!dt(n==null?void 0:n.$current_url)&&(me.error("Invalid `$current_url` property provided to `posthog.capture`. Input must be a string. Ignoring provided value."),n==null||delete n.$current_url),t!=="$exception"||r!=null&&r.Fd||me.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&&(d=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();const f=new Date,p=(r==null?void 0:r.timestamp)||f,m=Dk(r==null?void 0:r.uuid,Di);let v={uuid:m,event:t,properties:this.calculateEventProperties(t,n||{},p,m)};t==="$pageview"&&this.config.__preview_capture_bot_pageviews&&c&&(v.event="$bot_pageview",v.properties.$browser_type="bot"),u&&(v.properties.$lib_rate_limit_remaining_tokens=u.remainingTokens);const _=t==="$feature_flag_called"&&v.properties.$feature_flag_has_experiment===!1&&this.get_property("$minimal_flag_called_events")===!0;r!=null&&r.$set&&!_&&(v.$set=r==null?void 0:r.$set);const w=lt(n==null?void 0:n.$set)?n.$set:void 0,b=He(n==null?void 0:n.$unset)?n.$unset:[],S=(r==null?void 0:r.$unset)||[],E=V=>{var q;const ee=!!(r!=null&&r.$set)&&V in r.$set;return{hasProvided:ee||!!w&&V in w,provided:ee?r==null||(q=r.$set)===null||q===void 0?void 0:q[V]:w==null?void 0:w[V],unset:b.indexOf(V)!==-1||S.indexOf(V)!==-1}};this.persistence.refreshMetaIdentifiersBeforeCapture();const C=E(s6),A=E(i6),T=[{channel:this.Td,hasProvided:C.hasProvided,update:this.Rd(d==null?void 0:d.fbclid,C.provided,C.hasProvided,C.unset)},{channel:this.Id,hasProvided:A.hasProvided,update:this.Pd(A.provided,A.hasProvided,A.unset)}];for(const{channel:V,hasProvided:q,update:ee}of T)ee&&v.properties.$process_person_profile===!0&&ee.pending&&!q&&!_&&(v.$set=$({[V.property]:ee.value},v.$set));const M=r==null?void 0:r.$unset;M&&(v.$unset=M);const O=_?void 0:this.Dd(r==null?void 0:r.$set_once,t!==a6,t===DR);if(O&&(v.$set_once=O),r!=null&&r._noTruncate||(R=this.config.properties_string_max_length,v=(function(V,q){const ee=new Set;return(function F(X,B){if(X!==Object(X))return q?q(X):X;if(ee.has(X))return;let L;if(ee.add(X),He(X))L=[],xu(X,G=>{L.push(F(G))});else{const G={};Zt(xd(X)?FR(X):X,(ue,te)=>{ee.has(ue)||(G[te]=F(ue))}),L=G}return L})(V)})(v,V=>dt(V)?V.slice(0,R):V)),v.timestamp=p,ce(r==null?void 0:r.timestamp)||(v.properties.$event_time_override_provided=!0,v.properties.$event_time_override_system_time=f),_&&(v.properties=((V,q=[])=>{const ee={},F=X=>{V[X]!==void 0&&(ee[X]=V[X])};return lF.forEach(F),q.forEach(F),ee})(v.properties,k7)),t===Ws.DISMISSED||t===Ws.SENT){const V=n==null?void 0:n[o1.SURVEY_ID],q=n==null?void 0:n[o1.SURVEY_ITERATION];TI({id:V,current_iteration:q}),v.$set=$($({},v.$set),{},{[o7({id:V,current_iteration:q},t===Ws.SENT?"responded":"dismissed")]:!0})}else t===Ws.SHOWN&&(v.$set=$($({},v.$set),{},{[o1.SURVEY_LAST_SEEN_DATE]:new Date().toISOString()}));var R;if(t===Zj.SHOWN){const V=n==null?void 0:n[T6.TOUR_TYPE];V&&(v.$set=$($({},v.$set),{},{[`${T6.TOUR_LAST_SEEN_DATE}/${V}`]:new Date().toISOString()}))}const D=$($({},v.properties.$set),v.$set);if(Ps(D)||this.setPersonPropertiesForFlags(D),!ot(this.config.before_send)){const V=this.Ls(v);if(!V)return;v=V,v.uuid=Dk(v.uuid,Di)}this.sessionRecording&&!this.Kh&&U6(t)&&(this.Kh=!0,setTimeout(()=>this.Kh=!1,3e4));const U=[];T.forEach(({channel:V,update:q})=>{var ee,F,X;const B=(ee=(F=v.$set)===null||F===void 0?void 0:F[V.property])!==null&&ee!==void 0?ee:lt((X=v.properties)===null||X===void 0?void 0:X.$set)?v.properties.$set[V.property]:void 0;q!=null&&q.pending&&B===q.value&&U.push({channel:V,value:q.value})}),this.vr.emit("eventCaptured",v);const W=(s=r==null?void 0:r._url)!==null&&s!==void 0?s:this.requestRouter.endpointFor("api",this.analyticsDefaultEndpoint),H=(r==null?void 0:r._batchKey)==="recordings"||/\/s\/(?:\?|$)/.test(W),Y=$($($({method:"POST",url:W,data:v,compression:"best-available",preferSyncCompression:r==null?void 0:r.send_instantly,timestampMode:H?"body":"capture-body",batchKey:r==null?void 0:r._batchKey},H&&(!((i=v.properties)===null||i===void 0)&&i.$session_id)?{batchGroup:v.properties.$session_id+(v.properties.$window_id?`-${v.properties.$window_id}`:"")}:{}),r!=null&&r.transport?{transport:r.transport}:{}),U.length?{fireCallbackOnDrop:!0,callback:V=>{V.statusCode>=200&&300>V.statusCode&&this.Od(U)}}:{});if(!this.config.request_batching||r&&!(r!=null&&r._batchKey)||r!=null&&r.send_instantly){var J;let V;!Y.transport&&!Y.callback&&Ps((J=this.config.request_headers)!==null&&J!==void 0?J:{})&&this.Wh&&(V="sendBeacon"),this.ld(Y,V)}else this.od.enqueue(Y);return(o=this.featureFlags)===null||o===void 0||o.sendFlagCallsPendingCapture(),v}_addCaptureHook(t){return this.on("eventCaptured",n=>t(n.event,n))}getExtension(t){var n;return(n=this.Ld)===null||n===void 0?void 0:n.getExtension(t)}bd(){var t;return(t=this.Ld)!==null&&t!==void 0?t:this.Ld=new b7(this)}gr(t){this.Zh.push(t);let n=!0;return()=>{if(!n)return;n=!1;const r=this.Zh.indexOf(t);r!==-1&&this.Zh.splice(r,1)}}fd(t=!0){var n;return!!(!((n=this.persistence)===null||n===void 0)&&n.consumeCookieIdentityChange())&&(this.pd(t),!0)}pd(t=!0){var n,r,s;this.nd=null,((n=this.persistence)===null||n===void 0?void 0:n.get_property("$user_state"))==="anonymous"&&((s=this.sessionPersistence)===null||s===void 0||s.clear(),this.Qh.clear(),this.Nd()),(r=this.featureFlags)===null||r===void 0||r.reset(),t&&this.reloadFeatureFlags()}calculateEventProperties(t,n,r,s,i){if(r=r||new Date,!this.persistence||!this.sessionPersistence)return n;this.qh(),this.persistence.syncCookieProperties(),this.fd();const o=i?void 0:this.persistence.remove_event_timer(t);let c=$({},n);if(c.token=this.config.token,c.$config_defaults=this.config.defaults==="latest"?C7:this.config.defaults,this.Ph()&&(c[CR]=!0),t==="$snapshot"){const E=$($({},this.persistence.properties()),this.sessionPersistence.properties());return c.distinct_id=E.distinct_id,(!dt(c.distinct_id)&&!Fn(c.distinct_id)||Hf(c.distinct_id))&&me.error("Invalid distinct_id for replay event. This indicates a bug in your implementation"),c}const u=(function(E,C,A,T=!1){var M,O,R,D;if(!ds)return{};const U=E?[...td,...C||[]]:[],[W,H]=UT(ds),[Y,J]=(function(te){for(let ie=0;$k.length>ie;ie++){const[he,ke,ge]=$k[ie],pe=te.match(he);if(pe){const Ne=ge&&te.match(ge)||pe;return[ke,(Ne==null?void 0:Ne[1])||""]}}return["",""]})(ds),V=(function(){const te="u">typeof navigator?navigator:void 0;return te!=null&&te.brave?{brave:!0}:{}})(),q={};ce(A)||(q.detectGoogleSearchApp=A);const ee={},F=(M=navigator)===null||M===void 0||(M=M.userAgentData)===null||M===void 0?void 0:M.platform,X=(O=navigator)===null||O===void 0?void 0:O.maxTouchPoints,B=le==null||(R=le.screen)===null||R===void 0?void 0:R.width,L=le==null||(D=le.screen)===null||D===void 0?void 0:D.height,G=le==null?void 0:le.devicePixelRatio;ce(F)||(ee.userAgentDataPlatform=F),ce(X)||(ee.maxTouchPoints=X),ce(B)||(ee.screenWidth=B),ce(L)||(ee.screenHeight=L),ce(G)||(ee.devicePixelRatio=G);const ue=mn(fb({$os:W,$os_version:H,$browser:HT(ds,navigator.vendor,V,q),$webview_app:Y,$webview_app_version:J,$device:ZT(ds),$device_type:R9(ds,ee),$timezone:vb(),$timezone_offset:Vj()}),{$current_url:uh(T?nl(cn==null?void 0:cn.href):cn==null?void 0:cn.href,U,dh),$host:cn==null?void 0:cn.host,$pathname:cn==null?void 0:cn.pathname,$raw_user_agent:ds.length>1e3?ds.substring(0,997)+"...":ds,$browser_version:T9(ds,navigator.vendor,V,q),$browser_language:nI(),$browser_language_prefix:zj(),$screen_height:le==null?void 0:le.screen.height,$screen_width:le==null?void 0:le.screen.width,$viewport_height:le==null?void 0:le.innerHeight,$viewport_width:le==null?void 0:le.innerWidth,$lib:Xo.LIB_NAME,$lib_version:Xo.LIB_VERSION,$insert_id:Math.random().toString(36).substring(2,10)+Math.random().toString(36).substring(2,10),$time:Date.now()/1e3});return Xo.SDK_DIST_CHANNEL&&(ue.$sdk_dist_channel=Xo.SDK_DIST_CHANNEL),ue})(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){const{sessionId:E,windowId:C}=this.sessionManager.checkAndGetSessionAndWindowId(i,r.getTime(),!0);c.$session_id=E,c.$window_id=C}this.sessionPropsManager&&mn(c,this.sessionPropsManager.getSessionProps());try{var d;if(this.sessionRecording){const E=this.sessionRecording.sdkDebugProperties,C=!this.Kh&&U6(t);for(const A in E)(C||We(x7,A))&&(c[A]=E[A])}c.$sdk_debug_retry_queue_size=(d=this.ad)===null||d===void 0?void 0:d.length}catch(E){c.$sdk_debug_error_capturing_properties=String(E)}let f;if(this.requestRouter.region===aw&&(c.$lib_custom_api_host=this.config.api_host),f=t!=="$pageview"||i?t!=="$pageleave"||i?this.pageViewManager.doEvent():this.pageViewManager.doPageLeave(r):this.pageViewManager.doPageView(r,s),c=mn(c,f),t==="$pageview"&&Ie&&(c.title=Ie.title),!ce(o)){const E=r.getTime()-o;c.$duration=parseFloat((E/1e3).toFixed(3))}ds&&this.config.opt_out_useragent_filter&&(c.$browser_type=this._is_bot()?"bot":"browser");const p=this.persistence.properties(),m=this.sessionPersistence.properties(),v=c.$groups,_=p.$groups;lt(v)&&!Ps(v)&&(c.$groups=$($({},lt(_)?_:{}),v)),Zt(["$referrer","$referring_domain"],E=>{E in p&&delete m[E]});const w={};if(this.Zh.length>0)for(const E of this.Zh.slice())try{mn(w,E())}catch(C){me.error("Failed to produce browser extension event properties",C)}c=mn({},u,p,m,$($({},w),c)),c.$is_identified=this._isIdentified(),He(this.config.property_denylist)?Zt(this.config.property_denylist,function(E){delete c[E]}):me.error(NI+this.config.property_denylist+" or property_blacklist config: "+this.config.property_blacklist);const b=this.config.sanitize_properties;b&&(me.error(H6),c=b(c,t));const S=this.jd();return c.$process_person_profile=S,S&&!i&&this.qd("_calculate_event_properties"),c}Dd(t,n=!0,r=!1){var s;if(!this.persistence||!this.jd()||this.Gh&&!r)return t;const i=this.persistence.get_initial_props(),o=(s=this.sessionPropsManager)===null||s===void 0?void 0:s.getSetOnceProps();let c=mn({},i,o||{},t||{});const u=this.config.sanitize_properties;return u&&(me.error(H6),c=u(c,"$set_once")),n&&(this.Gh=!0),Ps(c)?void 0:c}register(t,n){var r;(r=this.persistence)===null||r===void 0||r.register(t,n)}register_once(t,n,r){var s;(s=this.persistence)===null||s===void 0||s.register_once(t,n,r)}register_for_session(t){var n,r;(n=this.persistence)===null||n===void 0||n.syncCookieProperties(),this.fd(),(r=this.sessionPersistence)===null||r===void 0||r.register(t),Object.keys(t).forEach(s=>this.Qh.add(s)),this.Nd()}unregister(t){var n;(n=this.persistence)===null||n===void 0||n.unregister(t)}unregister_for_session(t){var n;(n=this.sessionPersistence)===null||n===void 0||n.unregister(t),this.Qh.delete(t),this.Nd()}Bd(t,n){this.register({[t]:n})}ud(){this.Qh.forEach(t=>{var n;(n=this.sessionPersistence)===null||n===void 0||n.unregister(t)}),this.Qh.clear(),this.Nd()}Nd(){var t;if(!this.Jh)return;if(this.config.persistence==="memory"||!((t=this.sessionPersistence)===null||t===void 0)&&t.pi||!sn.Ot())return void sn.Dt(this.Jh);const n=[];this.Qh.forEach(r=>n.push(r)),n.length>0?sn.$t(this.Jh,n):sn.Dt(this.Jh)}getFeatureFlag(t,n){var r;return(r=this.featureFlags)===null||r===void 0?void 0:r.getFeatureFlag(t,n)}getFeatureFlagPayload(t){var n;return(n=this.featureFlags)===null||n===void 0?void 0:n.getFeatureFlagPayload(t)}getFeatureFlagResult(t,n){var r;return(r=this.featureFlags)===null||r===void 0?void 0:r.getFeatureFlagResult(t,n)}getAllFeatureFlags(){var t,n;return(t=(n=this.featureFlags)===null||n===void 0?void 0:n.getAllFeatureFlags())!==null&&t!==void 0?t:[]}isFeatureEnabled(t,n){var r,s;return(r=(s=this.featureFlags)===null||s===void 0?void 0:s.isFeatureEnabled(t,n))!==null&&r!==void 0?r:n==null?void 0:n.defaultValue}reloadFeatureFlags(){var t;(t=this.featureFlags)===null||t===void 0||t.reloadFeatureFlags()}updateFlags(t,n,r){var s;(s=this.featureFlags)===null||s===void 0||s.updateFlags(t,n,r)}updateEarlyAccessFeatureEnrollment(t,n,r){var s;(s=this.featureFlags)===null||s===void 0||s.updateEarlyAccessFeatureEnrollment(t,n,r)}getEarlyAccessFeatures(t,n=!1,r){var s;return(s=this.featureFlags)===null||s===void 0?void 0:s.getEarlyAccessFeatures(t,n,r)}on(t,n){return this.vr.on(t,n)}onFeatureFlags(t){return this.featureFlags?this.featureFlags.onFeatureFlags(t):(t([],{},{errorsLoading:!0}),()=>{})}onSurveysLoaded(t){return this.surveys?this.surveys.onSurveysLoaded(t):(t([],{isLoaded:!1,error:ou}),()=>{})}onSessionId(t){var n,r;return(n=(r=this.sessionManager)===null||r===void 0?void 0:r.onSessionId(t))!==null&&n!==void 0?n:()=>{}}getSurveys(t,n=!1){this.surveys?this.surveys.getSurveys(t,n):t([],{isLoaded:!1,error:ou})}getActiveMatchingSurveys(t,n=!1){this.surveys?this.surveys.getActiveMatchingSurveys(t,n):t([],{isLoaded:!1,error:ou})}onActiveMatchingSurveysChanged(t){return this.surveys?this.surveys.onActiveMatchingSurveysChanged(t):(t([],{isLoaded:!1,error:ou}),()=>{})}renderSurvey(t,n){var r;(r=this.surveys)===null||r===void 0||r.renderSurvey(t,n)}displaySurvey(t,n=d7){var r;(r=this.surveys)===null||r===void 0||r.displaySurvey(t,n)}cancelPendingSurvey(t){var n;(n=this.surveys)===null||n===void 0||n.cancelPendingSurvey(t)}canRenderSurvey(t){var n,r;return(n=(r=this.surveys)===null||r===void 0?void 0:r.canRenderSurvey(t))!==null&&n!==void 0?n:{visible:!1,disabledReason:ou}}canRenderSurveyAsync(t,n=!1){var r,s;return(r=(s=this.surveys)===null||s===void 0?void 0:s.canRenderSurveyAsync(t,n))!==null&&r!==void 0?r:Promise.resolve({visible:!1,disabledReason:ou})}zd(t){return!t||Hf(t)?(me.critical("Unique user id has not been set in posthog.identify"),!1):t==="$posthog_cookieless"?(me.critical(`The string "${t}" was set in posthog.identify which indicates an error. This ID is only used as a sentinel value.`),!1):!["distinct_id","distinctid"].includes(t.toLowerCase())&&!["undefined","null"].includes(t.toLowerCase())||(me.critical(`The string "${t}" was set in posthog.identify which indicates an error. This ID should be unique to the user and not a hardcoded string.`),!1)}identify(t,n,r){if(!this.__loaded||!this.persistence)return me.uninitializedWarning("posthog.identify");if(Fn(t)&&(t=t.toString(),me.warn("The first argument to posthog.identify was a number, but it should be a string. It has been converted to a string.")),!this.zd(t)||!this.qd("posthog.identify"))return;this.qh();const s=this.get_distinct_id(),i=this.persistence.syncCookieProperties()&&this.get_distinct_id()!==s,o=this.fd(!1),c=this.persistence.Wu();let u=!1;try{const f=this.get_distinct_id();this.register({$user_id:t}),this.get_property("$device_id")||this.register_once({$had_persisted_distinct_id:!0,$device_id:f},""),t!==f&&t!==this.get_property("__alias")&&(this.unregister(A0),this.register({distinct_id:t}));const p=(this.persistence.get_property("$user_state")||"anonymous")===Yo,m=t!==f,v=!m&&p;if(m&&p){var d;const _=this.config.reuseAnonymousId?{distinct_id:t}:{distinct_id:t,$anon_distinct_id:f};this.persistence.set_property(Jr,Wm),this.setPersonPropertiesForFlags({$set:n||{},$set_once:r||{}},!1),this.config.cookieWinsOnConflict&&this.persistence.Vu(),this.capture("$identify",_,{$set:n||{},$set_once:r||{}})&&(this.nd=d1(t,n,r)),(d=this.featureFlags)===null||d===void 0||d.setAnonymousDistinctId(this.config.reuseAnonymousId?void 0:f)}else if(v){this.persistence.set_property(Jr,Wm);const _=n||{},w=r||{};this.setPersonPropertiesForFlags({$set:_,$set_once:w},!1),this.config.cookieWinsOnConflict&&this.persistence.Vu(),this.capture("$set",{$set:_,$set_once:w})&&(this.nd=d1(t,n,r))}else(n||r)&&this.setPersonProperties(n,r);m||i||o?(this.reloadFeatureFlags(),this.featureFlags?this.featureFlags.resetFlagCallReported():this.unregister(co)):v&&(n||r)&&this.reloadFeatureFlags(),u=!0}finally{c&&this.persistence.Ju(u)}}setPersonProperties(t,n){if(!t&&!n||!this.qd("posthog.setPersonProperties"))return;const r=d1(this.get_distinct_id(),t,n);this.nd!==r?(this.setPersonPropertiesForFlags({$set:t||{},$set_once:n||{}},!0),this.capture("$set",{$set:t||{},$set_once:n||{}})&&(this.nd=r)):me.info("A duplicate setPersonProperties call was made with the same properties. It has been ignored.")}unsetPersonProperties(t){var n;const r=(He(t)?t:[t]).filter(s=>dt(s)&&s.length>0);r.length!==0&&this.qd("posthog.unsetPersonProperties")&&((n=this.featureFlags)===null||n===void 0||n.unsetPersonPropertiesForFlags(r,!0),this.capture("$set",{$unset:r}),this.nd=null)}group(t,n,r){var s;if(!t||!n)return void me.error("posthog.group requires a group type and group key");(s=this.persistence)===null||s===void 0||s.syncCookieProperties(),this.fd();const i=this.getGroups(),o=i[t]!==n;if(o&&this.resetGroupPropertiesForFlags(t),this.register({$groups:$($({},i),{},{[t]:n})}),(o||r)&&this.jd()){const c={$group_type:t,$group_key:n};r&&(c.$group_set=r),this.capture(a6,c)}r&&this.setGroupPropertiesForFlags({[t]:r}),o&&!r&&this.reloadFeatureFlags()}resetGroups(){this.register({$groups:{}}),this.resetGroupPropertiesForFlags(),this.reloadFeatureFlags()}setPersonPropertiesForFlags(t,n=!0){var r;(r=this.featureFlags)===null||r===void 0||r.setPersonPropertiesForFlags(t,n)}resetPersonPropertiesForFlags(t=!0){var n;(n=this.featureFlags)===null||n===void 0||n.resetPersonPropertiesForFlags(t)}setGroupPropertiesForFlags(t,n=!0){var r;this.qd("posthog.setGroupPropertiesForFlags")&&((r=this.featureFlags)===null||r===void 0||r.setGroupPropertiesForFlags(t,n))}resetGroupPropertiesForFlags(t){var n;(n=this.featureFlags)===null||n===void 0||n.resetGroupPropertiesForFlags(t)}reset(t){const n=hs(t)?t:t==null?void 0:t.resetDeviceID,r=hs(t)||t==null?void 0:t.bootstrap;this.Hd(n,!1,r)}Hd(t,n=!1,r){var s,i,o,c,u,d;if(me.info("reset"),!this.__loaded)return me.uninitializedWarning("posthog.reset");const f=r==null?void 0:r.sessionID;this.config.bootstrap=r||((s=this.Dh)===null||s===void 0?void 0:s.bootstrap)||{},(i=this.featureFlags)===null||i===void 0||(o=i.updateConfig)===null||o===void 0||o.call(i,this.config,this.wc());const p=this.get_property(ib),m=this.get_property(Yy),v=this.get_property(Wf);(c=this.sessionRecording)===null||c===void 0||c.flushBeforeIdentityReset();const _=this.is_capturing();n||this.consent.reset(),n||!_||this.is_capturing()||console.warn("[PostHog.js]","reset() cleared the stored consent, and capturing is now off because of `opt_out_capturing_by_default`. Call opt_in_capturing() again, and prefer calling reset() before opting in rather than after.");const w=(u=this.persistence)===null||u===void 0||(d=u.Wu)===null||d===void 0?void 0:d.call(u),b=this.Bh;this.Bh=b||n;let S=!1;try{var E,C,A,T,M,O,R,D,U,W,H,Y,J;if((E=this.persistence)===null||E===void 0||E.clear(),(C=this.sessionPersistence)===null||C===void 0||C.clear(),this.Qh.clear(),this.Nd(),ce(v)||(W=this.persistence)===null||W===void 0||W.register({$session_recording_remote_config:v}),(A=this.surveys)===null||A===void 0||A.reset(),(T=this.featureFlags)===null||T===void 0||T.reset(),(M=this.conversations)===null||M===void 0||M.reset(),(O=this.logs)===null||O===void 0||O.reset(),(R=this.metrics)===null||R===void 0||R.reset(),(D=this.persistence)===null||D===void 0||D.set_property("$user_state","anonymous"),(U=this.sessionManager)===null||U===void 0||U.resetSessionId(),this.nd=null,this.config.cookieless_mode==="always")this.register_once({distinct_id:Qy,$device_id:null},"");else{const F=this.config.get_device_id(Di());this.register_once({distinct_id:F,$device_id:t?F:p},""),t||ce(m)||this.register({[Yy]:m})}if(this.register({$last_posthog_reset:new Date().toISOString()},1),r&&(r.distinctID&&!this.Ph()&&((J=this.persistence)===null||J===void 0||J.set_property("$user_state",r.isIdentifiedID?"identified":"anonymous"),this.register({distinct_id:r.distinctID})),(H=this.featureFlags)===null||H===void 0||H.initialize(),!ot(f)&&!(!((Y=this.sessionManager)===null||Y===void 0)&&Y.setBootstrapSessionId(f,!0)))){const F=$({},r);delete F.sessionID,this.config.bootstrap=F}delete this.config.identity_distinct_id,delete this.config.identity_hash,delete this.config.identity_claims,S=!0}finally{var V,q;this.Bh=b,w&&((V=this.persistence)===null||V===void 0||(q=V.Ju)===null||q===void 0||q.call(V,S))}var ee;this.pr&&((ee=this.conversations)===null||ee===void 0||ee.onRemoteConfig(this.pr)),this.reloadFeatureFlags()}shutdown(t){var n=this;return un(function*(){if(!n.__loaded)return void me.uninitializedWarning("posthog.shutdown");n.Vh=!0,clearTimeout(n.dd),n.dd=void 0;const r=n._d;n._d=void 0;for(const s of[()=>{var i;return(i=n.sessionRecording)===null||i===void 0?void 0:i.dispose()},()=>{var i;return(i=n.logs)===null||i===void 0?void 0:i.flushLogs("sendBeacon")},()=>{var i;return(i=n.metrics)===null||i===void 0?void 0:i.flush("sendBeacon")},()=>{var i;return(i=n.metrics)===null||i===void 0?void 0:i.dispose()},()=>{var i;return(i=n.logs)===null||i===void 0?void 0:i.dispose()},()=>{var i;return(i=n.surveys)===null||i===void 0?void 0:i.dispose()},()=>{var i;return(i=n.autocapture)===null||i===void 0?void 0:i.dispose()},()=>r==null?void 0:r(),()=>{var i;return(i=n.od)===null||i===void 0?void 0:i.unload()},()=>{var i;return(i=n.ad)===null||i===void 0?void 0:i.unload()},()=>{var i;return(i=n.featureFlags)===null||i===void 0?void 0:i.destroy()},()=>{var i;return(i=n.persistence)===null||i===void 0?void 0:i.destroy()},()=>{var i;return(i=n.sessionPersistence)===null||i===void 0?void 0:i.destroy()}])try{const i=s();i&&Mn(i.then)&&i.then(void 0,o=>{me.error("Error during shutdown",o)})}catch(i){me.error("Error during shutdown",i)}})()}setIdentity(t,n){var r;delete this.config.identity_claims,this.config.identity_distinct_id=t,this.config.identity_hash=n,this.alias(t),(r=this.conversations)===null||r===void 0||r.Ud()}clearIdentity(){var t;delete this.config.identity_distinct_id,delete this.config.identity_hash,delete this.config.identity_claims,(t=this.conversations)===null||t===void 0||t.Wd()}get_distinct_id(){return this.get_property("distinct_id")}getGroups(){return this.get_property("$groups")||{}}get_session_id(){var t,n;return(t=(n=this.sessionManager)===null||n===void 0?void 0:n.checkAndGetSessionAndWindowId(!0).sessionId)!==null&&t!==void 0?t:""}get_session_replay_url(t){if(!this.sessionManager)return"";const{sessionId:n,sessionStartTimestamp:r}=this.sessionManager.checkAndGetSessionAndWindowId(!0);let s=this.requestRouter.endpointFor("ui",`/project/${this.config.token}/replay/${n}`);if(t!=null&&t.withTimestamp&&r){var i;const o=(i=t.timestampLookBack)!==null&&i!==void 0?i:10;if(!r)return s;s+=`?t=${Math.max(Math.floor((new Date().getTime()-r)/1e3)-o,0)}`}return s}alias(t,n){return t===this.get_property("$people_distinct_id")?(me.critical("Attempting to create alias for existing People user - aborting."),-2):this.qd("posthog.alias")?(ce(n)&&(n=this.get_distinct_id()),t!==n?(this.Bd(A0,t),this.capture("$create_alias",{alias:t,distinct_id:n})):(me.warn("alias matches current distinct_id - skipping api call."),this.identify(t),-1)):void 0}set_config(t){const n=$({},this.config);if(lt(t)){var r,s,i,o,c,u,d,f,p,m,v,_,w,b;mn(this.config,W6(t));const T=this.Uh();if(this.persistence){const O=this.config.persistence==="sessionStorage"||this.config.persistence==="memory";var S,E;if(O&&this.sessionPersistence!==this.persistence&&((S=this.sessionPersistence)===null||S===void 0||S.remove(),(E=this.sessionPersistence)===null||E===void 0||E.destroy()),this.persistence.update_config(this.config,n,T),O)this.sessionPersistence=this.persistence;else if(this.sessionPersistence===this.persistence)this.sessionPersistence=new s1($($({},this.config),{},{persistence:"sessionStorage"}),T,!1);else{var C;(C=this.sessionPersistence)===null||C===void 0||C.update_config($($({},this.config),{},{persistence:"sessionStorage"}),$($({},n),{},{persistence:"sessionStorage"}),T)}}const M=this.sd(this.config.debug);var A;hs(M)&&(this.config.debug=M),hs(this.config.debug)&&(this.config.debug?(Cs.DEBUG=!0,Ot.Ot()&&Ot.$t("ph_debug",!0),me.info("set_config",{config:t,oldConfig:n,newConfig:$({},this.config)})):(Cs.DEBUG=!1,Ot.Ot()&&Ot.Dt("ph_debug"))),(r=this.featureFlags)===null||r===void 0||(s=r.updateConfig)===null||s===void 0||s.call(r,this.config,this.wc()),(i=this.exceptionObserver)===null||i===void 0||i.onConfigChange(),(o=this.exceptions)===null||o===void 0||o.onConfigChange(),(c=this.metrics)===null||c===void 0||c.onConfigChange(),(u=this.webMCP)===null||u===void 0||u.startIfEnabled(),(d=this.sessionRecording)===null||d===void 0||d.startIfEnabledOrStop(),(f=this.tracingHeaders)===null||f===void 0||f.startIfEnabledOrStop(),(p=this.autocapture)===null||p===void 0||p.startIfEnabled(),(m=this.heatmaps)===null||m===void 0||m.startIfEnabled(),("capture_pageview"in t||"disable_capture_url_hashes"in t)&&((A=this.historyAutocapture)===null||A===void 0||A.startIfEnabledOrStop()),(v=this.exceptionObserver)===null||v===void 0||v.startIfEnabledOrStop(),(_=this.deadClicksAutocapture)===null||_===void 0||_.startIfEnabledOrStop(),(w=this.surveys)===null||w===void 0||w.loadIfEnabled(),this.zh(),(b=this.externalIntegrations)===null||b===void 0||b.startIfEnabledOrStop(),!n.segment&&this.config.segment&&this.persistence&&k6(this,Qf,!1)}}_overrideSDKInfo(t,n){Cs.LIB_NAME=t,Cs.LIB_VERSION=n}startSessionRecording(t){const n=t===!0,r={sampling:n||!!(t!=null&&t.sampling),linked_flag:n||!!(t!=null&&t.linked_flag),url_trigger:n||!!(t!=null&&t.url_trigger),event_trigger:n||!!(t!=null&&t.event_trigger)};var s,i,o,c,u;Object.values(r).some(Boolean)&&((s=this.sessionManager)===null||s===void 0||s.checkAndGetSessionAndWindowId(),r.sampling&&((i=this.sessionRecording)===null||i===void 0||i.overrideSampling()),r.linked_flag&&((o=this.sessionRecording)===null||o===void 0||o.overrideLinkedFlag()),r.url_trigger&&((c=this.sessionRecording)===null||c===void 0||c.overrideTrigger("url")),r.event_trigger&&((u=this.sessionRecording)===null||u===void 0||u.overrideTrigger("event"))),this.set_config({disable_session_recording:!1})}stopSessionRecording(){this.set_config({disable_session_recording:!0})}sessionRecordingStarted(){var t;return!!(!((t=this.sessionRecording)===null||t===void 0)&&t.started)}captureException(t,n){try{if(!this.exceptions)return;const r=this.exceptions.buildProperties(t,{handled:!0,syntheticException:new Error("PostHog syntheticException")});return this.exceptions.sendExceptionEvent($($({},r),n))}catch{return}}addExceptionStep(t,n){var r;(r=this.exceptions)===null||r===void 0||r.addExceptionStep(t,n)}captureLog(t){var n;(n=this.logs)===null||n===void 0||n.captureLog(t)}get logger(){var t,n;return(t=(n=this.logs)===null||n===void 0?void 0:n.logger)!==null&&t!==void 0?t:Ho.Vd}startExceptionAutocapture(t){this.set_config({capture_exceptions:t==null||t})}stopExceptionAutocapture(){this.set_config({capture_exceptions:!1})}loadToolbar(t){var n,r;return(n=(r=this.toolbar)===null||r===void 0?void 0:r.loadToolbar(t))!==null&&n!==void 0&&n}get_property(t){var n;return(n=this.persistence)===null||n===void 0?void 0:n.props[t]}getSessionProperty(t){var n;return(n=this.sessionPersistence)===null||n===void 0?void 0:n.props[t]}toString(){var t;let n=(t=this.config.name)!==null&&t!==void 0?t:Mf;return n!==Mf&&(n="posthog."+n),n}_isIdentified(){var t,n;return((t=this.persistence)===null||t===void 0?void 0:t.get_property("$user_state"))==="identified"||((n=this.sessionPersistence)===null||n===void 0?void 0:n.get_property("$user_state"))==="identified"}jd(){var t,n;return!(this.config.person_profiles==="never"||this.config.person_profiles==="identified_only"&&!this._isIdentified()&&Ps(this.getGroups())&&!(!((t=this.persistence)===null||t===void 0||(t=t.props)===null||t===void 0)&&t.__alias)&&!(!((n=this.persistence)===null||n===void 0||(n=n.props)===null||n===void 0)&&n.$epp))}Cd(){return this.config.capture_pageleave===!0||this.config.capture_pageleave==="if_capture_pageview"&&!!this.config.capture_pageview}createPersonProfile(){this.jd()||this.qd("posthog.createPersonProfile")&&this.setPersonProperties({},{})}setInternalOrTestUser(){this.qd("posthog.setInternalOrTestUser")&&this.setPersonProperties({$internal_or_test_user:!0})}qd(t){return this.config.person_profiles==="never"?(me.error(t+' was called, but process_person is set to "never". This call will be ignored.'),!1):(this.Lh(),this.Bd(lb,!0),!0)}Uh(){if(this.config.cookieless_mode==="always")return!0;const t=this.consent.isOptedOut();return this.config.disable_persistence||t&&!(!this.config.opt_out_persistence_by_default&&this.config.cookieless_mode!=="on_reject")}zh(){var t,n;const r=this.Uh();var s,i,o;return this.is_capturing()||(s=this.logs)===null||s===void 0||s.Gd(),((t=this.persistence)===null||t===void 0?void 0:t.pi)!==r&&((i=this.persistence)===null||i===void 0||i.set_disabled(r)),((n=this.sessionPersistence)===null||n===void 0?void 0:n.pi)!==r&&((o=this.sessionPersistence)===null||o===void 0||o.set_disabled(r)),this.Nd(),r}opt_in_capturing(t){var n,r,s;if(this.config.cookieless_mode==="always")return void me.warn(V6);if(this.Ph()){var i,o,c,u,d,f;(i=this.sessionRecording)===null||i===void 0||i.dispose({discardBufferedEvents:!0}),this.Hd(!0,!0),(o=this.sessionManager)===null||o===void 0||o.destroy(),(c=this.pageViewManager)===null||c===void 0||c.destroy(),this.sessionManager=new F6(this),this.pageViewManager=new C6(this),this.persistence&&(this.sessionPropsManager=new $6(this,this.sessionManager,this.persistence));const S=(u=(d=this.config.__extensionClasses)===null||d===void 0?void 0:d.sessionRecording)!==null&&u!==void 0?u:(f=Ho.__defaultExtensionClasses)===null||f===void 0?void 0:f.sessionRecording;var p,m;S&&(this.sessionRecording=this.Rh(this.sessionRecording,new S(this)),this.pr&&((p=this.sessionRecording)===null||p===void 0||(m=p.onRemoteConfig)===null||m===void 0||m.call(p,this.pr)))}const v=this.consent.consent===1;var _,w,b;v&&this.qh(),this.consent.optInOut(!0),this.zh(),this.Sd(),(n=this.sessionRecording)===null||n===void 0||n.startIfEnabledOrStop(),this.config.cookieless_mode=="on_reject"&&((_=this.surveys)===null||_===void 0||_.loadIfEnabled(),(w=this.conversations)===null||w===void 0||w.loadIfEnabled()),v||!ce(t==null?void 0:t.captureEventName)&&!(t!=null&&t.captureEventName)||this.capture((b=t==null?void 0:t.captureEventName)!==null&&b!==void 0?b:"$opt_in",t==null?void 0:t.captureProperties,{send_instantly:!0}),(r=this.persistence)===null||r===void 0||r.syncCookieProperties(),this.fd(),(s=this.featureFlags)===null||s===void 0||s.sendFlagCallsPendingCapture(),this.config.capture_pageview&&this.xd()}opt_out_capturing(){this.config.cookieless_mode!=="always"?(this.consent.optInOut(!1),this.zh(),this.config.cookieless_mode==="on_reject"&&this.Hh()):me.warn(V6)}Hh(){var t,n;const r=this.sessionRecording;r==null||r.dispose({discardBufferedEvents:!0}),this.get_distinct_id()!=="$posthog_cookieless"&&this.Hd(!0,!0),this.register({distinct_id:Qy,$device_id:null}),this.Eh(r),this.sessionRecording=void 0,(t=this.sessionManager)===null||t===void 0||t.destroy(),(n=this.pageViewManager)===null||n===void 0||n.destroy(),this.sessionManager=void 0,this.sessionPropsManager=void 0,this.config.capture_pageview&&this.xd(),this.Sd()}has_opted_in_capturing(){return this.consent.isOptedIn()}has_opted_out_capturing(){return this.consent.isOptedOut()}get_explicit_consent_status(){const t=this.consent.consent;return t===1?"granted":t===0?"denied":"pending"}is_capturing(){return!this.Bh&&(this.config.cookieless_mode==="always"||(this.config.cookieless_mode==="on_reject"?this.consent.isRejected()||this.consent.isOptedIn():!this.has_opted_out_capturing()))}clear_opt_in_out_capturing(){this.consent.reset(),this.zh()}_is_bot(){return Fr?EI(Fr,this.config.custom_blocked_useragents):void 0}xd(){Ie&&(Ie.visibilityState==="visible"?this.Yh||(this.Yh=!0,this.capture(db,{title:Ie.title},{send_instantly:!0}),this.Xh&&(Ie.removeEventListener(Ru,this.Xh),this.Xh=null)):this.Xh||(this.Xh=this.xd.bind(this),Lt(Ie,Ru,this.Xh)))}debug(t){t===!1?(le==null||le.console.log("You've disabled debug mode."),this.set_config({debug:!1})):(le==null||le.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}))}wc(){const t=this.Dh||{};return"advanced_disable_flags"in t?!!t.advanced_disable_flags:this.config.advanced_disable_flags!==!1?!!this.config.advanced_disable_flags:this.config.advanced_disable_decide===!0?(me.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):(function(n,r,s,i,o){const c=r in n&&!ot(n[r]),u=s in n&&!ot(n[s]);return c?n[r]:!!u&&(o&&o.warn(`Config field '${s}' is deprecated. Please use '${r}' instead. The old field will be removed in a future major version.`),n[s])})(t,"advanced_disable_flags","advanced_disable_decide",0,me)}Ls(t){var n;if(ot(this.config.before_send))return t;const r=Object.keys((n=t.properties)!==null&&n!==void 0?n:{}).filter(_9),s=He(this.config.before_send)?this.config.before_send:[this.config.before_send];let i=t;for(const o of s)try{if(i=o(i),ot(i)){const c=`Event '${t.event}' was rejected in beforeSend function`;return y9(t.event)?me.warn(`${c}. This can cause unexpected behavior.`):me.info(c),null}i.properties&&!Ps(i.properties)||me.warn(`Event '${t.event}' has no properties after beforeSend function, this is likely an error.`)}catch(c){return me.error(`Error in beforeSend function for event '${t.event}':`,c),null}for(const o of r)if(i.properties&&ot(i.properties[o]))return me.warn(`Event '${t.event}' had its '${o}' property removed in a beforeSend function. This property is required for ingestion, so the event will be dropped.`),null;return i}getPageViewId(){var t;return(t=this.pageViewManager.Za)===null||t===void 0?void 0:t.pageViewId}captureTraceFeedback(t,n){this.capture("$ai_feedback",{$ai_trace_id:String(t),$ai_feedback_text:n})}captureTraceMetric(t,n,r){this.capture("$ai_metric",{$ai_trace_id:String(t),$ai_metric_name:n,$ai_metric_value:String(r)})}sd(t){const n=hs(t)&&!t,r=Ot.Ot()&&Ot.Lt("ph_debug")==="true";return!n&&(!!r||t)}};Xf.__defaultExtensionClasses={},Xf.Vd=(()=>{const e=()=>{};return{trace:e,debug:e,info:e,warn:e,error:e,fatal:e}})(),(function(e,t){for(let n=0;t.length>n;n++)e.prototype[t[n]]=mj(e.prototype[t[n]])})(Xf,["identify"]);const R7=["[data-ph-capture-value]"];var I7=class{constructor(e){this._instance=e}refresh(e){var t;const n=this._instance.config,r=lt(n.autocapture)?n.autocapture:void 0;e.enabled=!!n.autocapture,e.rageclick=n.rageclick,e.maskAllElementAttributes=n.mask_all_element_attributes,e.maskAllText=n.mask_all_text,e.disableCaptureUrlHashes=n.disable_capture_url_hashes,e.getCurrentUrl=n.get_current_url,e.remoteRequestsDisabled=this._instance.wc(),e.url_allowlist=r==null?void 0:r.url_allowlist,e.url_ignorelist=r==null?void 0:r.url_ignorelist,e.dom_event_allowlist=r==null?void 0:r.dom_event_allowlist,e.element_allowlist=r==null?void 0:r.element_allowlist,e.css_selector_allowlist=r==null?void 0:r.css_selector_allowlist,e.css_selector_ignorelist=r==null?void 0:r.css_selector_ignorelist,e.element_attribute_ignorelist=r==null?void 0:r.element_attribute_ignorelist,e.capture_copied_text=r==null?void 0:r.capture_copied_text,e.capture_value_css_selector_allowlist=(t=r==null?void 0:r.capture_value_css_selector_allowlist)!==null&&t!==void 0?t:R7}};const bf=xn("[ExceptionAutocapture]"),K6=()=>{},G6=e=>{var t;if(Mn(e))return(t=e.__posthog_layer__)!==null&&t!==void 0?t:e.__rrweb_layer__};function rd(e,t,n){try{if(!(t in e))return K6;const r={next:e[t]},s=n(function(...i){return r.next.apply(this,i)});return Mn(s)&&(s.prototype=s.prototype||{},Object.defineProperties(s,{__posthog_wrapped__:{enumerable:!1,value:!0},__posthog_layer__:{enumerable:!1,value:r}})),e[t]=s,()=>{if(e[t]===s)return void(e[t]=r.next);let i=e[t],o=G6(i);for(;o;){if(o.next===s)return void(o.next=r.next);i=o.next,o=G6(i)}}}catch{return K6}}const O7=xn("[TracingHeaders]"),Vl=xn("[Web Vitals]"),q6=9e5,Y6=["CLS","FCP","INP","LCP"],M7=["INP","LCP"],N7=["interactionTarget","interactionType","inputDelay","processingDuration","presentationDelay","loadState","target","url","timeToFirstByte","resourceLoadDelay","resourceLoadDuration","elementRenderDelay","largestShiftTarget","largestShiftTime","largestShiftValue","firstByteToFCP"],g1="disabled",Q6="lazy_loading",$o=xn("[SessionRecording]"),L7=[cb,ub,TR,RR,IR,OR,MR,NR,LR],$7=xn("[Heatmaps]");function v1(e){return lt(e)&&"clientX"in e&&"clientY"in e&&Fn(e.clientX)&&Fn(e.clientY)}const cm=xn("[Product Tours]"),y1=e=>{var t;return!e.config.disable_product_tours&&!!(!((t=e.persistence)===null||t===void 0)&&t.get_property(ab))},D7=["$set_once","$set"],Ji=xn("[SiteApps]"),X6="Error while initializing PostHog app with config id ";function au(e,t,n){if(ot(e))return!1;switch(n){case"exact":return e===t;case"contains":{const r=t.replace(/[.*+?^${}()|[\]\\]/g,"\\$&").replace(/_/g,".").replace(/%/g,".*");return new RegExp(r,"i").test(e)}case"regex":try{return new RegExp(t).test(e)}catch{return!1}default:return!1}}var F7=class{constructor(e){this.Li=e,this.Lo=new Set,this.No=new Set,this.jo=new L0,this.qo=(t,n)=>this.Bo(t,n)&&this.zo(t,n)&&this.Ho(t,n)&&this.Uo(t,n),this.Bo=(t,n)=>!(n!=null&&n.event)||(t==null?void 0:t.event)===(n==null?void 0:n.event)}init(){var e,t;ce((e=this.Li)===null||e===void 0?void 0:e.subscribeCapture)||(this.Wo=(t=this.Li)===null||t===void 0?void 0:t.subscribeCapture((n,r)=>{this.on(n,r)}))}dispose(){var e,t,n;(e=this.Wo)===null||e===void 0||e.call(this),this.Wo=void 0,(t=this.Li)===null||t===void 0||(n=t.setElementSelectors)===null||n===void 0||n.call(t,new Set,this),this.jo=new L0}register(e){var t,n;if(!ce((t=this.Li)===null||t===void 0?void 0:t.subscribeCapture)&&(e.forEach(r=>{var s;this.Lo.add(r),(s=r.steps)===null||s===void 0||s.forEach(i=>{this.No.add((i==null?void 0:i.event)||"")})}),(n=this.Li)===null||n===void 0?void 0:n.setElementSelectors)){const r=new Set;this.Lo.forEach(s=>{var i;(i=s.steps)===null||i===void 0||i.forEach(o=>{o!=null&&o.selector&&r.add(o.selector)})}),this.Li.setElementSelectors(r,this)}}replace(e){this.Lo.clear(),this.No.clear(),this.register(e)}on(e,t){t!=null&&e.length!=0&&(this.No.has(e)||this.No.has(t.event))&&this.Lo.forEach(n=>{this.Vo(t,n)&&this.jo.emit("actionCaptured",n.name)})}Go(e){this.onAction("actionCaptured",t=>e(t))}Vo(e,t){if((t==null?void 0:t.steps)==null)return!1;for(const n of t.steps)if(this.qo(e,n))return!0;return!1}onAction(e,t){return this.jo.on(e,t)}zo(e,t){if(t!=null&&t.url){var n;let i=e==null||(n=e.properties)===null||n===void 0?void 0:n.$current_url;if(!(e!=null&&e.properties)||!("$current_url"in e.properties))try{var r,s;i=(r=this.Li)===null||r===void 0||(s=r.getActionUrl)===null||s===void 0?void 0:s.call(r)}catch{return!1}if(!i||typeof i!="string"||!au(i,t.url,t.url_matching||"contains"))return!1}return!0}Ho(e,t){return!!this.Qo(e,t)&&!!this.Jo(e,t)&&!!this.Zo(e,t)}Qo(e,t){var n;if(!(t!=null&&t.href))return!0;const r=this.Ko(e);if(r.length>0)return r.some(i=>au(i.href,t.href,t.href_matching||"exact"));const s=(e==null||(n=e.properties)===null||n===void 0?void 0:n.$elements_chain)||"";return!!s&&au((function(i){const o=i.match(/(?::|")href="(.*?)"/);return o?o[1]:""})(s),t.href,t.href_matching||"exact")}Jo(e,t){var n;if(!(t!=null&&t.text))return!0;const r=this.Ko(e);if(r.length>0)return r.some(u=>au(u.text,t.text,t.text_matching||"exact")||au(u.$el_text,t.text,t.text_matching||"exact"));const s=(e==null||(n=e.properties)===null||n===void 0?void 0:n.$elements_chain)||"";return!!s&&(i=(function(u){const d=[],f=/(?::|")text="(.*?)"/g;let p;for(;!ot(p=f.exec(u));)d.includes(p[1])||d.push(p[1]);return d})(s),o=t.text,c=t.text_matching||"exact",i.some(u=>au(u,o,c)));var i,o,c}Zo(e,t){var n,r;if(!(t!=null&&t.selector))return!0;const s=e==null||(n=e.properties)===null||n===void 0?void 0:n.$element_selectors;if(s!=null&&s.includes(t.selector))return!0;const i=(e==null||(r=e.properties)===null||r===void 0?void 0:r.$elements_chain)||"";if(t.selector_regex&&i)try{return new RegExp(t.selector_regex).test(i)}catch{}return!1}Ko(e){var t;return(e==null||(t=e.properties)===null||t===void 0?void 0:t.$elements)==null?[]:e==null?void 0:e.properties.$elements}Uo(e,t){return!(t!=null&&t.properties)||t.properties.length===0||AI(t.properties.reduce((n,r)=>{const s=He(r.value)?r.value.map(String):r.value!=null?[String(r.value)]:[];return n[r.key]={values:s,operator:r.operator||"exact"},n},{}),e==null?void 0:e.properties)}},j7=class{constructor(e,t){this.Yo=t,this.Xo=[],this.Li=e,this.tl=new Map,this.el=new Map,this.il=new Map}nl(){var e,t;this.sl=(e=(t=this.Li).subscribeSession)===null||e===void 0?void 0:e.call(t,n=>this.rl(n))}ll(e){return!1}al(){return null}ul(e){}cl(){}hl(e,t){return!!e&&AI(e.propertyFilters,t==null?void 0:t.properties)}dl(e,t){const n=new Map;return e.forEach(r=>{var s;(s=r.conditions)===null||s===void 0||(s=s[t])===null||s===void 0||(s=s.values)===null||s===void 0||s.forEach(i=>{if(i!=null&&i.name){const o=n.get(i.name)||[];o.push(r.id),n.set(i.name,o)}})}),n}vl(e,t,n){const r=(n===vf.Activation?this.tl:this.el).get(e);let s=[];return this.fl(i=>{s=i.filter(o=>r==null?void 0:r.includes(o.id))}),s.filter(i=>{var o;const c=(o=i.conditions)===null||o===void 0||(o=o[n])===null||o===void 0||(o=o.values)===null||o===void 0?void 0:o.find(u=>u.name===e);return this.hl(c,t)})}register(e){this.pl(e,!1)}replace(e){this.pl(e,!0)}pl(e,t){ce(this.Li.subscribeCapture)||(this.gl(e,t),this.ml(e,t))}ml(e,t){const n=e.filter(i=>{var o;return(o=i.conditions)===null||o===void 0||(o=o.actions)===null||o===void 0||(o=o.values)===null||o===void 0?void 0:o.length});var r;if(t&&this.il.clear(),n.length===0)return void(t&&((r=this.yl)===null||r===void 0||r.replace([])));this.yl||(this.yl=new F7(this.Li),this.yl.init(),this.yl.Go(i=>this.onAction(i)));const s=[];n.forEach(i=>{var o;(o=i.conditions)===null||o===void 0||(o=o.actions)===null||o===void 0||o.values.forEach(c=>{if(s.push(c),c.name){var u;const d=(u=this.il.get(c.name))!==null&&u!==void 0?u:[];d.includes(i.id)||d.push(i.id),this.il.set(c.name,d)}})}),t?this.yl.replace(s):this.yl.register(s)}bl(e,t){t.forEach((n,r)=>{var s;const i=(s=e.get(r))!==null&&s!==void 0?s:[];n.forEach(o=>{i.includes(o)||i.push(o)}),e.set(r,i)})}gl(e,t){var n,r,s;const i=e.filter(d=>{var f,p;return((f=d.conditions)===null||f===void 0?void 0:f.events)&&((p=d.conditions)===null||p===void 0||(p=p.events)===null||p===void 0||(p=p.values)===null||p===void 0?void 0:p.length)>0}),o=e.filter(d=>{var f,p;return((f=d.conditions)===null||f===void 0?void 0:f.cancelEvents)&&((p=d.conditions)===null||p===void 0||(p=p.cancelEvents)===null||p===void 0||(p=p.values)===null||p===void 0?void 0:p.length)>0}),c=this.dl(e,vf.Activation),u=this.dl(e,vf.Cancellation);t?(this.tl=c,this.el=u):(this.bl(this.tl,c),this.bl(this.el,u)),(i.length!==0||o.length!==0||e.some(d=>{var f;return(f=d.conditions)===null||f===void 0||(f=f.actions)===null||f===void 0||(f=f.values)===null||f===void 0?void 0:f.length}))&&((n=this.Wo)!==null&&n!==void 0||(this.Wo=(r=(s=this.Li).subscribeCapture)===null||r===void 0?void 0:r.call(s,(d,f)=>{this.onEvent(d,f)})))}onEvent(e,t){var n,r;const s=this._l(),i=(t==null||(n=t.properties)===null||n===void 0?void 0:n.$survey_id)||(t==null||(r=t.properties)===null||r===void 0?void 0:r.$product_tour_id);if(i&&this.getActivatedIds().includes(i)){const c=this.wl(e,i,t);if(c==="consume")return s.info("event consumed activated item, removing it",{event:e,itemId:i}),void this.kl([i]);if(c==="persist")return s.info("shown item promoted to persisted activation",{event:e,itemId:i}),this.Sl(i),void this.xl([i])}if(this.el.has(e)){const c=this.vl(e,t,vf.Cancellation);c.length>0&&(s.info("cancel event matched, cancelling items",{event:e,itemsToCancel:c.map(u=>u.id)}),this.kl(c.map(u=>u.id)),c.forEach(u=>this.$l(u.id)))}if(!this.tl.has(e))return;s.info("event name matched",{event:e,eventPayload:t,items:this.tl.get(e)});const o=this.vl(e,t,vf.Activation);this.Cl(o.map(c=>c.id))}onAction(e){this.il.has(e)&&this.Cl(this.il.get(e)||[])}Cl(e){if(e.length===0)return;const t=!!this.Li.getSessionId(),n=[];for(const r of e)t&&this.ll(r)?this.Sl(r)&&this.Tl(r):n.push(r);n.length>0&&(this.Xo=[...new Set([...this.Xo,...n])]),this._l().info("updating activated items",{activatedItems:this.getActivatedIds()}),this.Il()}Sl(e){this.Xo=this.Xo.filter(n=>n!==e);const t=this.Ml();return!t.includes(e)&&(this.El([...t,e]),this.Al(),!0)}kl(e){const t=new Set(e);this.Xo=this.Xo.filter(s=>!t.has(s));const n=this.Rl(),r=n.filter(s=>!t.has(s));r.length!==n.length&&(this.El(r),r.length===0&&this.Pl()),this.xl(e),this.Il()}Il(){try{var e;(e=this.Yo)===null||e===void 0||e.call(this)}catch(t){this._l().error("Error while handling activated items change",t)}}Ol(){const e=this.al();if(!e)return{};const t=this.Li.getProperty(e);return t&&typeof t=="object"?t:{}}Tl(e){if(!this.al())return;const t=this.Ol();this.ul($($({},t),{},{[e]:Date.now()}))}xl(e){if(!this.al())return;const t=this.Ol(),n={};let r=!1;for(const[s,i]of Object.entries(t))e.includes(s)?r=!0:n[s]=i;r&&(Ps(n)?this.cl():this.ul(n))}Fl(){this.al()&&this.cl()}getActivationTimestamp(e){if(!this.Ml().includes(e))return;const t=this.Ol()[e];return Fn(t)?t:void 0}Rl(){const e=this.Dl();return this.Li.getProperty(e)||[]}Ml(){const e=this.Rl();if(e.length===0)return[];const t=this.Li.getProperty(this.Ll()),n=this.Li.getSessionId();return n&&t===n?e:[]}Al(){const e=this.Li.getSessionId();e&&this.Nl(e)}Pl(){this.jl()}rl(e){const t=this.Li.getProperty(this.Ll());if(t&&t!==e){const n=this.Rl(),r=this.Ol();n.length>0&&(this.El([]),n.filter(s=>Fn(r[s])).forEach(s=>this.$l(s))),this.Pl(),this.Fl(),n.length>0&&this.Il()}}getActivatedIds(){return[...new Set([...this.Ml(),...this.Xo])].filter(e=>!this.ql(e))}dispose(){var e,t,n;(e=this.sl)===null||e===void 0||e.call(this),this.sl=void 0,(t=this.Wo)===null||t===void 0||t.call(this),this.Wo=void 0,(n=this.yl)===null||n===void 0||n.dispose(),this.yl=void 0}reset(){this.Xo=[],this.Rl().length>0&&this.El([]),this.Pl(),this.Fl(),this.Il()}getEventToItemsMap(){return this.tl}Bl(){return this.yl}},z7=class extends j7{constructor(e,t,n,r){var s;super({subscribeCapture(i){const o=e.onEvent(c=>i(c.event,c));return()=>o.dispose()},subscribeSession(i){const o=e.onSession(i);return()=>o.dispose()},getSessionId(){var i;return(i=e.session)===null||i===void 0?void 0:i.sessionId},getProperty:i=>e.kv.get(i),getActionUrl:n==null?void 0:n.getActionUrl,setElementSelectors:(s=n==null?void 0:n.setElementSelectors)!==null&&s!==void 0?s:(i,o)=>{var c;return(c=e.getExtension("autocapture"))===null||c===void 0?void 0:c.setElementSelectors(i,o)}},r),this.zl=e,this.Hl=t,this.nl()}Dl(){return W_}Ll(){return Zm}al(){return Bm}ul(e){this.zl.kv.set({[Bm]:e})}cl(){this.zl.kv.remove(Bm)}ll(e){var t;let n;this.fl(s=>{n=s.find(i=>i.id===e)});const r=n==null||(t=n.appearance)===null||t===void 0?void 0:t.surveyPopupDelaySeconds;return Fn(r)&&r>0}Ul(){return Ws.SHOWN}fl(e){this.Hl.getSurveys(e)}$l(e){this.Hl.cancelPendingSurvey(e)}_l(){return Ut}El(e){this.zl.kv.set({[W_]:e})}Nl(e){this.zl.kv.set({[Zm]:e})}jl(){this.zl.kv.remove(Zm)}ql(){return!1}wl(e,t,n){var r;if(e===Ws.SENT&&(n==null||(r=n.properties)===null||r===void 0?void 0:r.$survey_completed)===!1)return"ignore";let s;return this.fl(i=>{s=i.find(o=>o.id===t)}),!s||(function(i){var o;return CI(i)&&!!(!((o=i.conditions)===null||o===void 0||(o=o.events)===null||o===void 0)&&o.repeatedActivation)||i.schedule==="always"})(s)?e===Ws.SHOWN?"consume":"ignore":e===Ws.SHOWN?"persist":e===Ws.DISMISSED||e===Ws.SENT?"consume":"ignore"}getSurveys(){return this.getActivatedIds()}getEventToSurveys(){return this.getEventToItemsMap()}};const wb=(e,t)=>e!=null&&e.then?e.then(t):t(e),lu="SDK is not enabled or survey functionality is not yet loaded",J6="Disabled. Not loading surveys.";var V7=class{constructor(e){this.Wl=e,this.name="surveys",this._surveyEventReceiver=null,this._surveyManager=null,this.Vl=!1,this.Gl=!1,this.Ql=[],this.Jl=[],this.Zl=null,this.Kl=null,this.Mi=!1,this.Yl=new Set,this.onRemoteConfig=t=>{if(this.Mi||this.Nr.disableSurveys)return;if(!t.ok)return this.Gl=!0,this.Xl({isLoaded:!1,error:"Remote config unavailable. Not loading surveys."}),Ut.warn("Remote config unavailable. Not loading surveys.");const n=t.config.surveys;if(ot(n))return Ut.warn("Flags not loaded yet. Not loading surveys.");this.ta=hs(n)?n:n.length>0,Ut.info(`flags response received, isSurveysEnabled: ${this.ta}`),this.loadIfEnabled()},this.Xl=t=>{this.Jl.slice().forEach(n=>this.ea(n,t))}}setup(e){if(!this.Mi)return this.ia=e,wb(e.kv.initialize(),()=>{if(this.ia!==e||this.Mi)return;this.ia=void 0,this.zl=e;const t=e.onRemoteConfig(this.onRemoteConfig);this.Mi?t.dispose():(this.na=t,this.loadIfEnabled())})}dispose(){var e,t,n,r,s;this.Mi||(this.Mi=!0,this.ia=void 0,this.zl=void 0,(e=this.na)===null||e===void 0||e.dispose(),this.na=void 0,(t=this._surveyEventReceiver)===null||t===void 0||t.dispose(),this._surveyEventReceiver=null,(n=this._surveyManager)===null||n===void 0||(r=n.dispose)===null||r===void 0||r.call(n),this._surveyManager=null,this.Ql=[],this.Jl.forEach(i=>{i.active=!1}),this.Jl=[],(s=this.sa)===null||s===void 0||s.call(this),this.sa=void 0,this.Zl=null,this.Yl.forEach(i=>clearTimeout(i)),this.Yl.clear())}get Nr(){return this.Wl.get()}getRenderContext(){if(!this.zl)return;const e=this;return{client:this.zl,get config(){return e.Nr},surveys:e}}initialize(){this.loadIfEnabled()}reset(){var e,t;(e=this._surveyManager)===null||e===void 0||(t=e.clearInMemoryInProgressSurveyState)===null||t===void 0||t.call(e);try{var n;(n=this._surveyEventReceiver)===null||n===void 0||n.reset(),localStorage.removeItem("lastSeenSurveyDate");const r=[];for(let s=0;s<localStorage.length;s++){const i=localStorage.key(s);(i!=null&&i.startsWith("seenSurvey_")||i!=null&&i.startsWith("inProgressSurvey_"))&&r.push(i)}r.forEach(s=>localStorage.removeItem(s))}catch{}this.Xl()}loadIfEnabled(){if(this.Mi||!this.zl)return;const e=this.Nr;if(this._surveyManager)return;if(this.Vl)return void Ut.info("Already initializing surveys, skipping...");if(e.disableSurveys)return void Ut.info(J6);if(e.cookielessMode&&this.zl.isOptedOut)return void Ut.info("Not loading surveys in cookieless mode without consent.");const t=this.Wl.getExtensions();if(!t)return void this.ra("PostHog Extensions not found.");if(ce(this.ta)&&!e.advancedEnableSurveys)return;const n=this.ta||e.advancedEnableSurveys;this.Vl=!0,this.Gl=!1;try{const r=t.generateSurveys;if(r)return this.oa(r,n),void(this.Vl=!1);const s=t.loadExternalDependency;if(!s)return this.ra(B_),void(this.Vl=!1);s(i=>{try{if(this.Mi)return;const o=this.Wl.getExtensions();i||!(o!=null&&o.generateSurveys)?this.ra("Could not load surveys script",i):this.oa(o.generateSurveys,n)}finally{this.Vl=!1}})}catch(r){throw this.Vl=!1,this.ra("Error initializing surveys",r),r}}oa(e,t){var n;if(this.Mi)return;this._surveyManager=e(t),this._surveyEventReceiver=this.la(this.zl,this.Xl);const r=(n=this.zl)===null||n===void 0?void 0:n.kv.get(Rf);r&&this.aa(r),Ut.info("Surveys loaded successfully"),this.ua(),this.Xl(),this.ca({isLoaded:!0})}la(e,t){return new z7(e,this,void 0,t)}ra(e,t){this.Gl=!0,Ut.error(e,t),this.Xl({isLoaded:!1,error:e}),this.ca({isLoaded:!1,error:e})}onSurveysLoaded(e){return this.Ql.push(e),this._surveyManager&&this.ca({isLoaded:!0}),()=>{this.Ql=this.Ql.filter(t=>t!==e)}}getSurveys(e,t=!1){if(this.Mi)return;const n=this.zl;if(!n)return e([],{isLoaded:!1,error:lu});if(this.Nr.disableSurveys)return Ut.info(J6),e([]);const r=n.kv.get(Rf);if(r&&!t)return e(r,{isLoaded:!0}),void(this.ha()&&this.getSurveys(()=>{},!0));if(this.Zl)return void this.Zl.then(({surveys:o,context:c})=>{this.Mi||e(o,c)}).catch(o=>Ut.error("Error in survey callback",o));const s=n.sendRequest("/api/surveys/",{method:"GET",query:{token:n.projectToken},sentAt:"query",timeoutMs:this.Nr.requestTimeoutMs}).then(o=>{try{return this.da(n,o)}catch(c){return Ut.error("Error processing surveys response",c),this.da(n,{statusCode:0,error:c})}},o=>this.da(n,{statusCode:0,error:o}));this.Zl=s;const i=()=>{this.Zl===s&&(this.Zl=null)};s.then(o=>{i(),this.Mi||(this.Xl(o.context),e(o.surveys,o.context))},i).catch(o=>Ut.error("Error in survey callback",o))}da(e,t){if(this.Mi)return{surveys:[],context:{isLoaded:!1,error:lu}};const n=t.statusCode;if(n!==200||!t.json){const s=`Surveys API could not be loaded, status: ${n}`;return n!==0?Ut.error(s):t.error||Ut.warn(s),this.Kl=Date.now(),{surveys:[],context:{isLoaded:!1,error:s}}}this.Kl=null;const r=t.json.surveys||[];return e.kv.set({[Rf]:r,[P0]:Date.now()}),this.aa(r),{surveys:r,context:{isLoaded:!0}}}aa(e){const t=e.filter(n=>(function(r){return!(!r.start_date||r.end_date)})(n)&&(CI(n)||(function(r){var s;return!!(!((s=r.conditions)===null||s===void 0||(s=s.actions)===null||s===void 0||(s=s.values)===null||s===void 0)&&s.length)})(n)));this.va(t)}va(e){var t;(t=this._surveyEventReceiver)===null||t===void 0||t.replace(e)}ha(){return this.fa()&&!this.Zl&&!this.pa()}fa(){var e;const t=(e=this.zl)===null||e===void 0?void 0:e.kv.get(P0);return Fn(t)&&Date.now()-t>3e5}pa(){return Fn(this.Kl)&&3e5>Date.now()-this.Kl}markSurveyAsSeen(e,t){var n;const r={id:e,current_iteration:(n=t==null?void 0:t.iteration)!==null&&n!==void 0?n:null};TI(r);try{localStorage.setItem("lastSeenSurveyDate",new Date().toISOString())}catch{}this.Xl()}ca(e){for(const t of this.Ql){if(this.Mi)return;try{e.isLoaded?this.getSurveys(t):t([],e)}catch(n){Ut.error("Error in survey callback",n)}}}getActiveMatchingSurveys(e,t=!1){if(!ot(this._surveyManager))return this._surveyManager.getActiveMatchingSurveys(e,t);Ut.warn("init was not called")}onActiveMatchingSurveysChanged(e){var t;if(this.Mi)return()=>{};const n={callback:e,active:!0,revision:0};this.Jl.push(n),this.ua();const r=(t=this.zl)===null||t===void 0?void 0:t.kv.get(Rf);return this.Nr.disableSurveys||!this._surveyManager&&this.Gl&&!this.Vl||!r&&!ot(this.Kl)&&!this.Zl?this.ea(n,{isLoaded:!1}):this._surveyManager&&this.ea(n),()=>{var s;n.active=!1,this.Jl=this.Jl.filter(i=>i!==n),this.Jl.length===0&&((s=this.sa)===null||s===void 0||s.call(this),this.sa=void 0)}}ua(){var e,t,n;this._surveyManager&&this.Jl.length>0&&((e=this.sa)!==null&&e!==void 0||(this.sa=(t=(n=this.Wl).onMatchingConditionsChanged)===null||t===void 0?void 0:t.call(n,this.Xl)))}ea(e,t){if(this.Mi||!e.active)return;const n=++e.revision,r=s=>{if(!this.Mi&&e.active&&n===e.revision)try{const i=t??{isLoaded:!0},o=JSON.stringify([s,i]);if(o===e.lastResult)return;e.lastResult=o,e.callback(s,i)}catch(i){Ut.error("Error in active matching surveys callback",i)}};try{t&&!t.isLoaded?r([]):this.getActiveMatchingSurveys(r)}catch(s){Ut.error("Error in active matching surveys callback",s)}}ga(e){let t=null;return this.getSurveys(n=>{var r;t=(r=n.find(s=>s.id===e))!==null&&r!==void 0?r:null}),t}ma(e){if(ot(this._surveyManager))return{eligible:!1,reason:lu};const t=typeof e=="string"?this.ga(e):e;return t?this._surveyManager.checkSurveyEligibility(t):{eligible:!1,reason:"Survey not found"}}ya(e){var t;if(!(!((t=this.zl)===null||t===void 0)&&t.canCapture))return{eligible:!1,reason:"PostHog is not capturing, so a survey response cannot be recorded"};if(ot(this._surveyManager))return{eligible:!1,reason:lu};const n=typeof e=="string"?this.ga(e):e;return n?this._surveyManager.checkSurveyRenderability(n):{eligible:!1,reason:"Survey not found"}}canRenderSurvey(e){if(ot(this._surveyManager))return Ut.warn("init was not called"),{visible:!1,disabledReason:lu};const t=this.ya(e);return{visible:t.eligible,disabledReason:t.reason}}canRenderSurveyAsync(e,t){return ot(this._surveyManager)?(Ut.warn("init was not called"),Promise.resolve({visible:!1,disabledReason:lu})):new Promise(n=>{this.getSurveys(r=>{var s;const i=(s=r.find(o=>o.id===e))!==null&&s!==void 0?s:null;if(i){const o=this.ya(i);n({visible:o.eligible,disabledReason:o.reason})}else n({visible:!1,disabledReason:"Survey not found"})},t)})}renderSurvey(e,t,n){var r,s,i;if(!(!((r=this.zl)===null||r===void 0)&&r.canCapture))return;if(ot(this._surveyManager))return void Ut.warn("init was not called");const o=typeof e=="string"?this.ga(e):e;if(!(o!=null&&o.id))return void Ut.warn("Survey not found");if(!u7.includes(o.type))return void Ut.warn(`Surveys of type ${o.type} cannot be rendered in the app`);const c=(s=typeof document>"u"?void 0:document)===null||s===void 0?void 0:s.querySelector(t);if(c){if(!((i=o.appearance)===null||i===void 0)&&i.surveyPopupDelaySeconds){Ut.info(`Rendering survey ${o.id} with delay of ${o.appearance.surveyPopupDelaySeconds} seconds`);const u=setTimeout(()=>{var d,f,p;this.Yl.delete(u),!this.Mi&&(!((d=this.zl)===null||d===void 0)&&d.canCapture)&&(Ut.info(`Rendering survey ${o.id} with delay of ${(f=o.appearance)===null||f===void 0?void 0:f.surveyPopupDelaySeconds} seconds`),(p=this._surveyManager)===null||p===void 0||p.renderSurvey(o,c,n),Ut.info(`Survey ${o.id} rendered`))},1e3*o.appearance.surveyPopupDelaySeconds);return void this.Yl.add(u)}this._surveyManager.renderSurvey(o,c,n)}else Ut.warn("Survey element not found")}displaySurvey(e,t){var n,r;if(!(!((n=this.zl)===null||n===void 0)&&n.canCapture))return;if(ot(this._surveyManager))return void Ut.warn("init was not called");const s=this.ga(e);if(!s)return void Ut.warn("Survey not found");let i=s;if(!((r=s.appearance)===null||r===void 0)&&r.surveyPopupDelaySeconds&&t.ignoreDelay&&(i=$($({},s),{},{appearance:$($({},s.appearance),{},{surveyPopupDelaySeconds:0})})),t.displayType!==nw.Popover&&t.initialResponses&&Ut.warn("initialResponses is only supported for popover surveys. prefill will not be applied."),t.ignoreConditions===!1){const o=this.ma(s);if(!o.eligible)return void Ut.warn("Survey is not eligible to be displayed: ",o.reason)}t.displayType!==nw.Inline?this._surveyManager.handlePopoverSurvey(i,t):this.renderSurvey(i,t.selector,t.properties)}cancelPendingSurvey(e){ot(this._surveyManager)?Ut.warn("init was not called"):this._surveyManager.cancelSurvey(e)}handlePageUnload(){var e,t;(e=this._surveyManager)===null||e===void 0||(t=e.handlePageUnload)===null||t===void 0||t.call(e)}},H7=class{constructor(e){this._instance=e}get(){var e,t,n,r;const s=(e=this._instance)===null||e===void 0?void 0:e.config;return{disableSurveys:!!(s!=null&&s.disable_surveys),cookielessMode:!!(s!=null&&s.cookieless_mode),advancedEnableSurveys:!!(s!=null&&s.advanced_enable_surveys),requestTimeoutMs:(t=s==null?void 0:s.surveys_request_timeout_ms)!==null&&t!==void 0?t:1e4,prefillFromUrl:!!(!(s==null||(n=s.surveys)===null||n===void 0)&&n.prefillFromUrl),automaticDisplay:!(s!=null&&s.disable_surveys_automatic_display),featureFlagEvaluation:!(s!=null&&s.advanced_disable_feature_flags),overrideLanguage:s==null?void 0:s.override_display_language,prepareStylesheet:s==null?void 0:s.prepare_external_dependency_stylesheet,get_current_url:s==null?void 0:s.get_current_url,uiHost:(r=this._instance)===null||r===void 0||(r=r.requestRouter)===null||r===void 0?void 0:r.endpointFor("ui","")}}getExtensions(){const e=et==null?void 0:et.__PosthogExtensions__;if(!e||!this._instance)return;const t=this._instance,{generateSurveys:n,loadExternalDependency:r}=e;return{generateSurveys:n?s=>n(t,s):void 0,loadExternalDependency:r?s=>r(t,"surveys",s):void 0}}onMatchingConditionsChanged(e){var t,n;const r=(t=this._instance)===null||t===void 0?void 0:t._addCaptureHook(c=>{c!=="$pageview"&&c!==Ws.SHOWN&&c!==Ws.DISMISSED&&c!==Ws.SENT||e()}),s=()=>e();Lt(le,"PHSurveyShown",s);let i=!1;const o=(n=this._instance)===null||n===void 0?void 0:n.onFeatureFlags(()=>{i&&e()});return i=!0,()=>{i=!1,r==null||r(),o==null||o(),le==null||le.removeEventListener("PHSurveyShown",s)}}};const U7=le!=null&&le.location?O0(le.location.hash,"__posthog")||O0(location.hash,"state"):null,eC="_postHogToolbarParams",tC=xn("[Toolbar]"),nC=xn("[FeatureFlags]"),Hl=xn("[FeatureFlags]",{debugEnabled:!0}),_1=`" failed. Feature flags didn't load in time.`,Z7=[502,504],rC=["click","keydown","wheel","touchstart","pointerdown"],sC="connection_error",iC=e=>{const t={};for(let n=0;e.length>n;n++)t[e[n]]=!0;return t},oC=e=>{const t={};for(const[n,r]of Km(e||{}))r&&(t[n]=r);return t},B7=(e,t)=>e.distinctId===t.distinctId&&e.sessionId===t.sessionId&&((n,r)=>{const s=Object.keys(n);return s.length===Object.keys(r).length&&s.every(i=>n[i]===r[i])})(e.groups,t.groups);var W7=class{constructor(e){this.name="featureFlags",this.Qd=!1,this.featureFlagEventHandlers=[],this.A=nC,this.Jd={},this.Zd={},this.Kd=[],this.Yd=new Set,this.Xd=new Set,this.tv=!1,this.ev=!1,this.iv=0,this.nv=!1,this.sv=!1,this.rv=!1,this.ov=new Map,this.lv=!1,this.av=!1,this.uv=!1,this.hv=0,this.dv=!1,this.an=()=>{const t=this.vv();this.hv=0,t&&this.reloadFeatureFlags()},this.fv=()=>{var t,n;const r=this.pv,s=(t=this.gv)!==null&&t!==void 0?t:r;ce(r)||ce(s)||this.Nr.remoteRequestsDisabled||!this.mv||this.mv.visibilityState==="hidden"||Date.now()-((n=this.yv)!==null&&n!==void 0?n:0)<s||(this.gv=this.dv||!this.Nr.idleRefreshBackoff?r:Math.min(2*s,36e5),this.dv=!1,this.reloadFeatureFlags(),this.bv())},this._v=()=>{this.dv&&this.gv===this.pv||this.wv()},this.ln=()=>{var t;((t=this.mv)===null||t===void 0?void 0:t.visibilityState)==="visible"&&this.wv()},this.Wl=e}get Sv(){}xv(){this.zl&&this.$v()}setup(e){try{this.Cv=typeof window>"u"?void 0:window,this.mv=typeof document>"u"?void 0:document}catch{this.Cv=void 0,this.mv=void 0}return this.ia=e,this.A=e.logger.createLogger("[FeatureFlags]"),wb(e.kv.initialize(),()=>{this.ia===e&&(this.ia=void 0,this.zl=e,this.Tv(e))})}Tv(e){var t;if(this.zl===e)return this.Cv&&Lt(this.Cv,"online",this.an),this.$v(),this.Iv=e.registerDynamicEventProperties(()=>this.Mv()?this.Jd:this.Zd),this.Ev=(t=this.Sv)===null||t===void 0?void 0:t.onCrossTabFeatureFlagChange(()=>{this.Av(),this.Rv(),this.Pv()}),this.Rv(),this.initialize()}wv(){this.dv=!0,this.gv=this.pv,this.fv()}$v(){var e;const t=this.Nr.refreshIntervalMs,n=!this.Nr.remoteRequestsDisabled&&this.mv&&!ce(t)&&t>0?t:void 0;this.Nr.idleRefreshBackoff||(this.gv=n),n!==this.pv&&(this.Ov(),ce(n)||(this.pv=n,this.gv=n,this.bv(),!((e=this.mv)===null||e===void 0)&&e.addEventListener&&(Lt(this.mv,Ru,this.ln),xu(rC,r=>{Lt(this.mv,r,this._v,{capture:!0})}))))}bv(){ce(this.pv)||(ce(this.Fv)||clearInterval(this.Fv),this.yv=Date.now(),this.Fv=setInterval(this.fv,this.pv))}Ov(){var e,t;ce(this.Fv)||(clearInterval(this.Fv),this.Fv=void 0,(e=this.mv)===null||e===void 0||(t=e.removeEventListener)===null||t===void 0||t.call(e,"visibilitychange",this.ln),xu(rC,n=>{var r,s;(r=this.mv)===null||r===void 0||(s=r.removeEventListener)===null||s===void 0||s.call(r,n,this._v,{capture:!0})})),this.pv=void 0,this.gv=void 0,this.dv=!1,this.yv=void 0}destroy(){this.Dv()}dispose(){this.Dv()}Dv(){var e,t,n;this.Ov(),this.iv++,this.sv=!1,this.ia=void 0,this.Lv(this.Yd,"cancelled"),this.Lv(this.Xd,"cancelled"),this.zl&&(this.Nv(),(e=this.Iv)===null||e===void 0||e.dispose(),this.Iv=void 0,(t=this.Ev)===null||t===void 0||t.call(this),this.Ev=void 0,this.Kd=[],(n=this.Cv)===null||n===void 0||n.removeEventListener("online",this.an),this.zl=void 0)}get Nr(){return this.Wl.get()}jv(e){var t;return this.qv&&e in this.qv?this.qv[e]:(t=this.zl)===null||t===void 0?void 0:t.kv.get(e)}Av(){return!!this.qv&&(this.qv=void 0,!0)}Bv(){var e;return!ce((e=this.zl)===null||e===void 0?void 0:e.kv.get("$enabled_feature_flags"))&&this.Av()}$t(e){this.zv(()=>{var t;return(t=this.zl)===null||t===void 0?void 0:t.kv.set(e)})}Hv(e,t,n){if(!this.Sv||!e.$enabled_feature_flags)return;const r=this.jv("$enabled_feature_flags")||{},s=e.$enabled_feature_flags||{},i=t.flags||t.featureFlags,o=t.flags?Object.entries(t.flags).filter(([,b])=>!(b!=null&&b.failed)).map(([b])=>b):[],c=!!t.errorsWhileComputingFlags&&!!t.flags,u=c?o:n&&!He(i)?Object.keys(i||{}):Array.from(new Set([...Object.keys(r),...Object.keys(s)])),d=this.jv("$feature_flag_payloads")||{},f=e.$feature_flag_payloads||{},p=c||n?u:Array.from(new Set([...Object.keys(d),...Object.keys(f)])),m=!c&&!n,v=!!m||u,_=!!m||p,w={[qo]:v,[$i]:v,[Ja]:_};e.$feature_flag_details&&(w[uc]=v);for(const b of[dc,rl,Zf])ce(e[b])||(w[b]=!0);this.Sv.markCrossTabFeatureFlagChanges(w)}Dt(e){this.zv(()=>{var t;return(t=this.zl)===null||t===void 0?void 0:t.kv.remove(e)})}zv(e){try{e()}catch(t){this.A.error("Failed to update feature flag persistence",t)}}Rv(){const e={};for(const r of[qo,Ja,dc,ro]){const s=this.jv(r);ce(s)||(e[r]=s)}this.Jd=e;const t=$({},e),n=this.jv($i);if(n)for(const[r,s]of Object.entries(n))t[`$feature/${r}`]=s;this.Zd=t}Mv(){const e=this.Nr.cacheTtlMs;if(!e||0>=e)return!1;const t=this.jv(rl);return typeof t!="number"||Date.now()-t>e}Uv(){return!!this.Mv()&&(this.uv||this.ev||(this.uv=!0,this.A.warn("Feature flag cache is stale, triggering refresh..."),this.reloadFeatureFlags()),!0)}Wv(){const e=this.Nr.evaluationContexts;return e!=null&&e.length?e.filter(t=>{const n=t&&typeof t=="string"&&t.trim().length>0;return n||this.A.error("Invalid evaluation context found:",t,"Expected non-empty string"),n}):[]}Vv(){const e=this.Nr.flagKeys;if(!ce(e))return e.filter(t=>{const n=t&&typeof t=="string"&&t.trim().length>0;return n||this.A.error("Invalid flag key found:",t,"Expected non-empty string"),n})}initialize(){var e,t;const n=this.Nr,r=(e=(t=n.bootstrap)===null||t===void 0?void 0:t.featureFlags)!==null&&e!==void 0?e:{};if(Object.keys(r).length){var s,i;const o=(s=(i=n.bootstrap)===null||i===void 0?void 0:i.featureFlagPayloads)!==null&&s!==void 0?s:{},c=Object.keys(r).filter(d=>!ce(r[d])).reduce((d,f)=>(d[f]=r[f],d),{}),u=Object.keys(o).filter(d=>c[d]).reduce((d,f)=>(d[f]=o[f],d),{});return this.Gv({featureFlags:c,featureFlagPayloads:u},void 0,{persist:!1})}}updateFlags(e,t,n){var r,s;const i=n!=null&&n.merge&&(r=this.jv("$enabled_feature_flags"))!==null&&r!==void 0?r:{},o=n!=null&&n.merge&&(s=this.jv("$feature_flag_payloads"))!==null&&s!==void 0?s:{},c=$($({},i),e),u=$($({},o),t),d={};for(const[f,p]of Object.entries(c))d[f]={key:f,enabled:Wk(p),variant:Kk(p),reason:void 0,metadata:ce(u==null?void 0:u[f])?void 0:{id:0,version:void 0,description:void 0,payload:u[f]}};this.Gv({flags:d})}get hasLoadedFlags(){return this.tv}getFlags(){return Object.keys(this.getFlagVariants())}getFlagsWithDetails(){const e=this.jv(uc),t=this.jv(ro),n=this.jv(Yl);if(!n&&!t)return e||{};const r=mn({},e||{}),s=[...new Set([...Object.keys(n||{}),...Object.keys(t||{})])];for(const c of s){var i,o;const u=r[c],d=t==null?void 0:t[c],f=ce(d)?(i=u==null?void 0:u.enabled)!==null&&i!==void 0&&i:!!d,p=ce(d)?u==null?void 0:u.variant:typeof d=="string"?d:void 0,m=n==null?void 0:n[c],v=$($({},u),{},{enabled:f,variant:f?p??(u==null?void 0:u.variant):void 0});f!==(u==null?void 0:u.enabled)&&(v.original_enabled=u==null?void 0:u.enabled),p!==(u==null?void 0:u.variant)&&(v.original_variant=u==null?void 0:u.variant),m&&(v.metadata=$($({},u==null?void 0:u.metadata),{},{payload:m,original_payload:u==null||(o=u.metadata)===null||o===void 0?void 0:o.payload})),r[c]=v}return this.Qd||(this.A.warn(" Overriding feature flag details!",{flagDetails:e,overriddenPayloads:n,finalDetails:r}),this.Qd=!0),r}getAllFeatureFlags(){const e=this.getFlagVariants(),t=this.getFlagPayloads();return Object.keys(e).map(n=>{const r=e[n];return{key:n,enabled:Wk(r),variant:Kk(r),payload:Bk(t[n])}})}getFlagVariants(){const e=this.jv($i),t=this.jv(ro);if(!t)return e||{};const n=mn({},e||{}),r=Object.keys(t);for(let s=0;r.length>s;s++)n[r[s]]=t[r[s]];return this.Qd||(this.A.warn(" Overriding feature flags!",{enabledFlags:e,overriddenFlags:t,finalFlags:n}),this.Qd=!0),n}getFlagPayloads(){const e=this.jv(Ja),t=this.jv(Yl);if(!t)return e||{};const n=mn({},e||{}),r=Object.keys(t);for(let s=0;r.length>s;s++)n[r[s]]=t[r[s]];return this.Qd||(this.A.warn(" Overriding feature flag payloads!",{flagPayloads:e,overriddenPayloads:t,finalPayloads:n}),this.Qd=!0),n}reloadFeatureFlags(){this.nv||this.Nr.featureFlagsDisabled||this.vv()||(this.rv&&this.A.warn("reloadFeatureFlags() was called inside an onFeatureFlags callback. This callback also runs when flags change in other tabs, so this can cause a request loop."),this.ev&&(this.sv=!0),this.Qv||(this.Kd.slice().forEach(e=>{try{e()}catch(t){this.A.error("Error while running feature flags reloading callback",t)}}),this.Qv=setTimeout(()=>{this.Jv()},5)))}reloadFeatureFlagsAsync(){return!this.zl||this.nv||this.Nr.featureFlagsDisabled||this.Nr.remoteRequestsDisabled||this.vv()?Promise.resolve({status:"skipped"}):new Promise(e=>{this.Yd.add(e),this.reloadFeatureFlags()})}Lv(e,t){e.forEach(n=>n({status:t})),e.clear()}Nv(){clearTimeout(this.Qv),this.Qv=void 0}onReloading(e){return this.Kd.push(e),()=>{this.Kd=this.Kd.filter(t=>t!==e)}}ensureFlagsLoaded(){this.tv||this.ev||this.Qv||this.reloadFeatureFlags()}setAnonymousDistinctId(e){this.$anon_distinct_id=e}setReloadingPaused(e){this.nv=e}resetFlagCallReported(){this.Dt(co),this.ov=new Map}sendFlagCallsPendingCapture(){var e;if(this.ov.size!==0&&!this.lv&&(!((e=this.zl)===null||e===void 0)&&e.canCapture)&&!this.zl.isRateLimited){this.lv=!0;try{const t=this.getFlagVariants();for(const n of Array.from(this.ov.keys())){const r=this.ov.get(n);if(r){if(r.value!==String(t[n])||!B7(r.context,this.Zv())){this.ov.delete(n);continue}if(this.getFeatureFlagResult(n),this.ov.has(n))break}}}finally{this.lv=!1}}}Jv(e){var t;this.Nv();const n=this.zl;if(!n||this.Nr.remoteRequestsDisabled||this.vv())return void this.Lv(this.Yd,"skipped");if(this.ev)return void(this.sv=!0);const r={token:n.projectToken,distinct_id:n.distinctId,groups:n.groups,$anon_distinct_id:this.$anon_distinct_id,person_properties:$($($({},n.initialPersonProperties),this.jv("$stored_person_properties")||{}),{},{$lib:n.library.name,$lib_version:n.library.version}),group_properties:this.jv(Qa),timezone:vb()};ce(n.deviceId)||(r.$device_id=n.deviceId),(e!=null&&e.disableFlags||this.Nr.featureFlagsDisabled)&&(r.disable_flags=!0);const s=this.Wv();s.length&&(r.evaluation_contexts=s);const i=this.Vv();ce(i)||(r.flag_keys=i);const o=this.Nr.onlyEvaluateSurveyFeatureFlags,c="/flags/?v=2"+(o?"&only_evaluate_survey_feature_flags=true":""),u=this.iv,d=this.Yd;this.Yd=new Set,this.Xd=d,this.ev=!0;const f=()=>{this.sv&&(this.sv=!1,this.Jv())},p=b=>{var S,E;const C=(S=b.json)!==null&&S!==void 0?S:{},A=b.statusCode!==200;if(this.ev=!1,u!==this.iv)return void f();if(this.Kv(b.statusCode),A||this.sv||(this.$anon_distinct_id=void 0),r.disable_flags&&!this.sv)return void this.Lv(d,"skipped");this.av=!A;const T=[];b.error?T.push(b.error instanceof Error&&b.error.name==="AbortError"?"timeout":b.error instanceof Error?sC:"unknown_error"):b.statusCode!==200&&T.push(`api_error_${b.statusCode}`),C.errorsWhileComputingFlags&&T.push("errors_while_computing_flags");const M=!!(!((E=C.quotaLimited)===null||E===void 0)&&E.includes("feature_flags"));M&&T.push("quota_limited"),this.$t({[lh]:T}),M?this.A.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.Gv(C,A,{partialResponse:o}),this.Lv(d,r.disable_flags?"skipped":T.length||!C.flags&&!C.featureFlags?"error":"loaded"),f()},m=b=>{this.ev=!1,u===this.iv&&(this.$t({[lh]:[sC]}),this.A.error("Feature flag request failed",b),this.Bv()&&this.Pv(!0),this.Lv(d,"error")),f()};let v=(t=this.Nr.requestMaxRetries)!==null&&t!==void 0?t:1;const _=()=>v>0&&u===this.iv,w=()=>{if(u!==this.iv||!this.zl||this.Nr.remoteRequestsDisabled)return this.ev=!1,this.Lv(d,"skipped"),void f();try{n.sendRequest(c,{target:"flags",method:"POST",body:r,compression:this.Nr.compression,sentAt:"body",timeoutMs:this.Nr.requestTimeoutMs}).then(b=>{if((S=>Z7.includes(S.statusCode)||(E=>E.statusCode===0&&E.error instanceof Error&&E.error.name==="AbortError")(S))(b)&&_())return v--,void setTimeout(w,500);p(b)}).catch(m)}catch(b){m(b)}};w()}vv(){return QR(this.hv,3)}Kv(e){this.hv=XR(e,this.hv,3,()=>this.A.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(e,t={}){var n;if(t.fresh&&!this.av)return;if(!(this.tv||this.getFlags()&&this.getFlags().length>0))return void this.A.warn('getFeatureFlag for key "'+e+_1);if(this.Uv())return;const r=this.getFeatureFlagResult(e,t);return(n=r==null?void 0:r.variant)!==null&&n!==void 0?n:r==null?void 0:r.enabled}getFeatureFlagDetails(e){return this.getFlagsWithDetails()[e]}getFeatureFlagPayload(e){const t=this.getFeatureFlagResult(e,{send_event:!1});return t==null?void 0:t.payload}getFeatureFlagResult(e,t={}){if(t.fresh&&!this.av)return;if(!(this.tv||this.getFlags()&&this.getFlags().length>0))return void this.A.warn('getFeatureFlagResult for key "'+e+_1);if(this.Uv())return;const n=this.getFlagVariants(),r=e in n,s=n[e],i=this.getFlagPayloads()[e],o=String(s),c=this.jv("$feature_flag_request_id")||void 0,u=this.jv("$feature_flag_evaluated_at")||void 0;let d,f=this.jv("$flag_call_reported")||{};if(this.Nr.deduplicateCallsPerSession){var p;const Y=(p=this.zl)===null||p===void 0||(p=p.session)===null||p===void 0?void 0:p.sessionId,J=this.jv(Tf);Y&&Y!==J&&(f={},d=Y)}if(!t.send_event&&"send_event"in t)d&&this.$t({[co]:f,[Tf]:d});else{var m,v,_;const Y=!(!((m=this.zl)===null||m===void 0)&&m.canCapture),J=!Y&&!(!((v=this.zl)===null||v===void 0)&&v.isRateLimited);var w;if(J?this.ov.delete(e):(Y&&Object.keys(f).length>0&&(f={},this.$t({[co]:f})),!((w=f[e])===null||w===void 0)&&w.includes(o)||this.Yv(e,o)),J&&!(!((_=f[e])===null||_===void 0)&&_.includes(o))){var b,S,E,C,A,T,M,O,R,D,U,W,H;He(f[e])?f[e].push(o):f[e]=[o],this.$t($({[co]:f},d?{[Tf]:d}:{}));const V=this.getFeatureFlagDetails(e),q=[...(b=this.jv("$feature_flag_errors"))!==null&&b!==void 0?b:[]];ce(s)&&q.push("flag_missing");const ee={$feature_flag:e,$feature_flag_response:s,$feature_flag_payload:i??null,$feature_flag_request_id:c,$feature_flag_evaluated_at:u,$feature_flag_bootstrapped_response:(S=(E=this.Nr.bootstrap)===null||E===void 0||(E=E.featureFlags)===null||E===void 0?void 0:E[e])!==null&&S!==void 0?S:null,$feature_flag_bootstrapped_payload:(C=(A=this.Nr.bootstrap)===null||A===void 0||(A=A.featureFlagPayloads)===null||A===void 0?void 0:A[e])!==null&&C!==void 0?C:null,$used_bootstrap_value:!this.av};ce(V==null||(T=V.metadata)===null||T===void 0?void 0:T.has_experiment)||(ee.$feature_flag_has_experiment=V.metadata.has_experiment),ce(V==null||(M=V.metadata)===null||M===void 0?void 0:M.version)||(ee.$feature_flag_version=V.metadata.version);const F=(O=V==null||(R=V.reason)===null||R===void 0?void 0:R.description)!==null&&O!==void 0?O:V==null||(D=V.reason)===null||D===void 0?void 0:D.code;F&&(ee.$feature_flag_reason=F),!(V==null||(U=V.metadata)===null||U===void 0)&&U.id&&(ee.$feature_flag_id=V.metadata.id),ce(V==null?void 0:V.original_variant)&&ce(V==null?void 0:V.original_enabled)||(ee.$feature_flag_original_response=ce(V.original_variant)?V.original_enabled:V.original_variant),!(V==null||(W=V.metadata)===null||W===void 0)&&W.original_payload&&(ee.$feature_flag_original_payload=V==null||(H=V.metadata)===null||H===void 0?void 0:H.original_payload),q.length&&(ee.$feature_flag_error=q.join(",")),this.Xv(ee)||(this.tf(e,o),this.Yv(e,o))}else d&&this.$t({[co]:f,[Tf]:d})}return r?{key:e,enabled:!!s,variant:typeof s=="string"?s:void 0,payload:Bk(i)}:void 0}Xv(e){try{var t;return((t=this.zl)===null||t===void 0?void 0:t.capture("$feature_flag_called",e))!==!1}catch(n){return this.A.error("Failed to capture feature flag call",n),!0}}Yv(e,t){this.ov.set(e,{value:t,context:this.Zv()})}Zv(){var e,t,n;return{distinctId:(e=this.zl)===null||e===void 0?void 0:e.distinctId,groups:$({},(t=this.zl)===null||t===void 0?void 0:t.groups),sessionId:this.Nr.deduplicateCallsPerSession?(n=this.zl)===null||n===void 0||(n=n.session)===null||n===void 0?void 0:n.sessionId:void 0}}tf(e,t){const n=this.jv("$flag_call_reported")||{},r=n[e];He(r)&&r.includes(t)&&(n[e]=r.filter(s=>s!==t),this.$t({[co]:n}))}getRemoteConfigPayload(e,t){this.ef(e,t)}ef(e,t){var n=this;return un(function*(){const r=n.zl;if(!r)return;const s={distinct_id:r.distinctId,token:r.projectToken,person_properties:{$lib:r.library.name,$lib_version:r.library.version}},i=n.Wv();i.length&&(s.evaluation_contexts=i);const o=n.Vv();let c;ce(o)||(s.flag_keys=o);try{var u;const d=(u=(yield r.sendRequest("/flags/?v=2",{target:"flags",method:"POST",body:s,compression:n.Nr.compression,sentAt:"body",timeoutMs:n.Nr.requestTimeoutMs})).json)===null||u===void 0?void 0:u.featureFlagPayloads;c=(d==null?void 0:d[e])||void 0}catch(d){return void n.A.error("Remote config feature flag request failed",d)}try{t(c)}catch(d){n.A.error("Remote config feature flag callback failed",d)}})()}isFeatureEnabled(e,t={}){if(t.fresh&&!this.av)return t.defaultValue;if(!(this.tv||this.getFlags()&&this.getFlags().length>0))return this.A.warn('isFeatureEnabled for key "'+e+_1),t.defaultValue;const n=this.getFeatureFlag(e,t);return ce(n)?t.defaultValue:!!n}addFeatureFlagsHandler(e){this.featureFlagEventHandlers.push(e)}removeFeatureFlagsHandler(e){this.featureFlagEventHandlers=this.featureFlagEventHandlers.filter(t=>t!==e)}receivedFeatureFlags(e,t,n){this.Gv(e,t,n)}Gv(e,t,n){if(!this.zl)return;this.tv=!0;const r=((s,i={},o={},c={},u,d=nC)=>{const f=((C,A)=>{const T=C.flags;if(T){const M=Object.fromEntries(Object.keys(T).map(R=>{var D;return[R,(D=T[R].variant)!==null&&D!==void 0?D:T[R].enabled]})),O=Object.fromEntries(Object.keys(T).filter(R=>T[R].enabled).filter(R=>{var D;return!ce((D=T[R].metadata)===null||D===void 0?void 0:D.payload)}).map(R=>{var D;return[R,(D=T[R].metadata)===null||D===void 0?void 0:D.payload]}));return $($({},C),{},{featureFlags:M,featureFlagPayloads:O})}return C.featureFlags&&A.warn("Using an older version of the feature flags endpoint. Please upgrade your PostHog server to the latest version"),C})(s,d),p=f.flags,m=f.featureFlags,v=f.featureFlagPayloads;if(!m)return;const _=s.requestId,w=s.evaluatedAt;if(He(m)){d.warn("v1 of the feature flags endpoint is deprecated. Please use the latest version.");const C={};if(m)for(let A=0;m.length>A;A++)C[m[A]]=!0;return{[qo]:m,[$i]:C,[Zf]:!1}}let b=m,S=v,E=p;if(u!=null&&u.partialResponse){const C=Object.keys(b),A=S||{};b=$($({},i),b),S=$($({},o),A),C.forEach(T=>{T in A||S==null||delete S[T]}),E=$($({},c),E)}else if(s.errorsWhileComputingFlags)if(p){const C=new Set(Object.keys(p).filter(T=>{var M;return!(!((M=p[T])===null||M===void 0)&&M.failed)}));b=$($({},i),Object.fromEntries(Object.entries(b).filter(([T])=>C.has(T))));const A=Object.fromEntries(Object.entries(S||{}).filter(([T])=>C.has(T)));S=$($({},o),A),C.forEach(T=>{T in A||S==null||delete S[T]}),E=$($({},c),Object.fromEntries(Object.entries(E||{}).filter(([T])=>C.has(T))))}else b=$($({},i),b),S=$($({},o),S),E=$($({},c),E);return $($({[qo]:Object.keys(oC(b)),[$i]:b||{},[Ja]:S||{},[uc]:E||{},[Zf]:s.minimalFlagCalledEvents===!0},_?{[dc]:_}:{}),w?{[rl]:w}:{})})(e,this.getFlagVariants(),this.getFlagPayloads(),this.getFlagsWithDetails(),n,this.A);if(r)if((n==null?void 0:n.persist)===!1){const s=!ce(this.zl.kv.get($i));this.qv=r,s||this.$t(r)}else this.Av(),this.Hv(r,e,!!(n!=null&&n.partialResponse)),this.$t(r);else t&&this.Bv();t||(this.uv=!1),this.Pv(t)}override(e,t=!1){this.A.warn("override is deprecated. Please use overrideFeatureFlags instead."),this.overrideFeatureFlags({flags:e,suppressWarning:t})}overrideFeatureFlags(e){this.if(e)}if(e){if(this.zl){if(e===!1)return this.Dt([ro,Yl]),this.Pv(),void Hl.info("All overrides cleared");if(He(e))return this.$t({[ro]:iC(e)}),this.Pv(),void Hl.info("Flag overrides set",{flags:e});if(e&&typeof e=="object"&&("flags"in e||"payloads"in e)){var t;const n=e;this.Qd=!!((t=n.suppressWarning)!==null&&t!==void 0&&t);const r={},s=n.flags,i=n.payloads;return s&&(r[ro]=He(s)?iC(s):s),i&&(r[Yl]=i),Object.keys(r).length&&this.$t(r),s===!1&&i===!1?this.Dt([ro,Yl]):s===!1?this.Dt(ro):i===!1&&this.Dt(Yl),this.Pv(),s===!1?Hl.info("Flag overrides cleared"):s&&Hl.info("Flag overrides set",{flags:s}),void(i===!1?Hl.info("Payload overrides cleared"):i&&Hl.info("Payload overrides set",{payloads:i}))}if(e&&typeof e=="object")return this.$t({[ro]:e}),this.Pv(),void Hl.info("Flag overrides set",{flags:e});this.A.warn("Invalid overrideOptions provided to overrideFeatureFlags",{overrideOptions:e})}else this.A.warn("posthog.featureFlags.overrideFeatureFlags called before feature flags were ready")}onFeatureFlags(e){if(this.addFeatureFlagsHandler(e),this.tv){const{flags:t,flagVariants:n}=this.nf();try{e(t,n)}catch(r){this.A.error("Error while running feature flags callback",r)}}return()=>this.removeFeatureFlagsHandler(e)}updateEarlyAccessFeatureEnrollment(e,t,n){var r;const s=(this.jv("$early_access_features")||[]).find(d=>d.flagKey===e),i={[`$feature_enrollment/${e}`]:t},o={$feature_flag:e,$feature_enrollment:t,$set:i};s&&(o.$early_access_feature_name=s.name),n&&(o.$feature_enrollment_stage=n);const c=$($({},this.getFlagVariants()),{},{[e]:t});(r=this.Sv)===null||r===void 0||r.markCrossTabFeatureFlagChanges({$active_feature_flags:[e],$enabled_feature_flags:[e],$stored_person_properties:Object.keys(i)}),this.$t({[qo]:Object.keys(oC(c)),[$i]:c,[Xa]:$($({},this.jv("$stored_person_properties")||{}),i)}),this.Pv();try{var u;(u=this.zl)===null||u===void 0||u.capture("$feature_enrollment_update",o)}catch(d){this.A.error("Failed to capture early access feature enrollment",d)}}getEarlyAccessFeatures(e,t=!1,n){const r=this.jv(Z_);!r||t?this.sf(e,n):e(r)}sf(e,t){var n=this;return un(function*(){const r=n.zl;if(!r)return;const s=t?`&${t.map(o=>`stage=${o}`).join("&")}`:"";let i;try{const o=yield r.sendRequest(`/api/early_access_features/?token=${r.projectToken}${s}`,{target:"api",method:"GET",sentAt:"query"});if(!o.json)return;i=o.json.earlyAccessFeatures,n.$t({[Z_]:i})}catch(o){return void n.A.error("Early access feature request failed",o)}try{e(i)}catch(o){n.A.error("Early access feature callback failed",o)}})()}nf(){const e=this.getFlags(),t=this.getFlagVariants();return{flags:e.filter(n=>t[n]),flagVariants:Object.keys(t).filter(n=>t[n]).reduce((n,r)=>(n[r]=t[r],n),{})}}Pv(e){this.Rv();const{flags:t,flagVariants:n}=this.nf(),r=this.rv;this.rv=!0,this.featureFlagEventHandlers.forEach(s=>{try{s(t,n,{errorsLoading:e})}catch(i){this.A.error("Error while running feature flags callback",i)}}),this.rv=r}setPersonPropertiesForFlags(e,t=!0){this.rf(e,t)}rf(e,t=!0){const n=this.jv("$stored_person_properties")||{},r=(e==null?void 0:e.$set)||(e!=null&&e.$set_once?{}:e),s=e==null?void 0:e.$set_once,i={};if(s)for(const o in s)({}).hasOwnProperty.call(s,o)&&(o in n||(i[o]=s[o]));this.$t({[Xa]:$($($({},n),i),r)}),t&&this.reloadFeatureFlags()}unsetPersonPropertiesForFlags(e,t=!0){const n=$({},this.jv("$stored_person_properties")||{});e.forEach(r=>{delete n[r]}),this.$t({[Xa]:n}),t&&this.reloadFeatureFlags()}resetPersonPropertiesForFlags(e=!0){this.Dt(Xa),e&&this.reloadFeatureFlags()}setGroupPropertiesForFlags(e,t=!0){const n=this.jv("$stored_group_properties")||{},r=$({},n);for(const s of Object.keys(e))r[s]=$($({},n[s]),e[s]);this.$t({[Qa]:r}),t&&this.reloadFeatureFlags()}resetGroupPropertiesForFlags(e){if(e){const t=this.jv("$stored_group_properties")||{};this.$t({[Qa]:$($({},t),{},{[e]:{}})})}else this.Dt(Qa)}reset(){this.iv++,this.Lv(this.Yd,"cancelled"),this.Lv(this.Xd,"cancelled"),this.sv=!1,this.Jd={},this.Zd={},this.qv=void 0,this.tv=!1,this.nv=!1,this.av=!1,this.$anon_distinct_id=void 0,this.Nv(),this.Qd=!1,this.hv=0,this.ov=new Map}};const aC=xn("[FeatureFlags]");var K7=class{constructor(e,t=!1){this.lf=!1,this.update(e,t)}update(e,t){this.af=((n,r)=>{var s,i,o,c,u,d,f,p;return{bootstrap:{featureFlags:(s=(i=n.bootstrap)===null||i===void 0?void 0:i.featureFlags)!==null&&s!==void 0?s:void 0,featureFlagPayloads:(o=(c=n.bootstrap)===null||c===void 0?void 0:c.featureFlagPayloads)!==null&&o!==void 0?o:void 0},remoteRequestsDisabled:r,featureFlagsDisabled:!!n.advanced_disable_feature_flags,onlyEvaluateSurveyFeatureFlags:!!n.advanced_only_evaluate_survey_feature_flags,deduplicateCallsPerSession:!!n.advanced_feature_flags_dedup_per_session,cacheTtlMs:n.feature_flag_cache_ttl_ms,refreshIntervalMs:(u=n.remote_config_refresh_interval_ms)!==null&&u!==void 0?u:3e5,idleRefreshBackoff:ce(n.remote_config_refresh_interval_ms),requestTimeoutMs:n.feature_flag_request_timeout_ms,requestMaxRetries:Math.max(0,(d=n.feature_flag_request_max_retries)!==null&&d!==void 0?d:1),compression:n.disable_compression?void 0:"best-available",evaluationContexts:(f=(p=n.evaluation_contexts)!==null&&p!==void 0?p:n.evaluation_environments)!==null&&f!==void 0?f:[],flagKeys:He(n.flag_keys)?n.flag_keys:void 0}})(e,t),!e.evaluation_environments||e.evaluation_contexts||this.lf||(aC.warn("evaluation_environments is deprecated. Use evaluation_contexts instead. evaluation_environments will be removed in a future version."),this.lf=!0),ce(e.flag_keys)||He(e.flag_keys)||aC.error("Invalid flag_keys found:",e.flag_keys,"Expected array of non-empty strings")}get(){return this.af}},um=class extends W7{constructor(e){const t=new K7(e.config,e.wc());super(t),this.name=OI,this._instance=e,this.uf=t}get Sv(){return this._instance.persistence}updateConfig(e,t){this.uf.update(e,t),this.xv()}};const lC=e=>xd(e)&&(e.name==="RangeError"&&e.message.indexOf("Maximum call stack size exceeded")===0||e.name==="InternalError"&&e.message==="too much recursion"),Ti=xn("[Error tracking]"),cw="webkit-masked-url:",G7=[{value:"isolatedAPI.contexts.topHostname",exact:!1},{value:"No response from target",exact:!0}],q7=["chrome-extension://","moz-extension://","safari-extension:","safari-web-extension:",cw],Y7=["__firefox__","__gCrWeb"];function cC(e,t){(t==null||t>e.length)&&(t=e.length);for(var n=0,r=Array(t);t>n;n++)r[n]=e[n];return r}function Q7(e,t){return(function(n){if(Array.isArray(n))return n})(e)||(function(n,r){var s=n==null?null:typeof Symbol<"u"&&n[Symbol.iterator]||n["@@iterator"];if(s!=null){var i,o,c,u,d=[],f=!0,p=!1;try{if(c=(s=s.call(n)).next,r!==0)for(;!(f=(i=c.call(s)).done)&&(d.push(i.value),d.length!==r);f=!0);}catch(m){p=!0,o=m}finally{try{if(!f&&s.return!=null&&(u=s.return(),Object(u)!==u))return}finally{if(p)throw o}}return d}})(e,t)||(function(n,r){if(n){if(typeof n=="string")return cC(n,r);var s={}.toString.call(n).slice(8,-1);return s==="Object"&&n.constructor&&(s=n.constructor.name),s==="Map"||s==="Set"?Array.from(n):s==="Arguments"||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(s)?cC(n,r):void 0}})(e,t)||(function(){throw new TypeError(`Invalid attempt to destructure non-iterable instance.
|
|
19
|
+
In order to be iterable, non-array objects must have a [Symbol.iterator]() method.`)})()}const LI=Object.entries,uC=Object.setPrototypeOf,X7=Object.isFrozen,J7=Object.getPrototypeOf,ez=Object.getOwnPropertyDescriptor;let jr=Object.freeze,Vr=Object.seal,gu=Object.create,$I=typeof Reflect<"u"&&Reflect,uw=$I.apply,dw=$I.construct;jr||(jr=function(e){return e}),Vr||(Vr=function(e){return e}),uw||(uw=function(e,t){for(var n=arguments.length,r=new Array(n>2?n-2:0),s=2;n>s;s++)r[s-2]=arguments[s];return e.apply(t,r)}),dw||(dw=function(e){for(var t=arguments.length,n=new Array(t>1?t-1:0),r=1;t>r;r++)n[r-1]=arguments[r];return new e(...n)});const cu=cr([].forEach),tz=cr([].lastIndexOf),dC=cr([].pop),uu=cr([].push),nz=cr([].splice),za=Array.isArray,Nf=cr("".toLowerCase),w1=cr("".toString),fC=cr("".match),xf=cr("".replace),hC=cr("".indexOf),rz=cr("".trim),sz=cr(0 .toString),iz=cr(Boolean.prototype.toString),pC=typeof BigInt>"u"?null:cr(BigInt.prototype.toString),mC=typeof Symbol>"u"?null:cr(Symbol.prototype.toString),Pr=cr({}.hasOwnProperty),dm=cr({}.toString),kr=cr(/t/.test),Ul=(gC=TypeError,function(){for(var e=arguments.length,t=new Array(e),n=0;e>n;n++)t[n]=arguments[n];return dw(gC,t)});var gC;function cr(e){return function(t){t instanceof RegExp&&(t.lastIndex=0);for(var n=arguments.length,r=new Array(n>1?n-1:0),s=1;n>s;s++)r[s-1]=arguments[s];return uw(e,t,r)}}function Ht(e,t){let n=arguments.length>2&&arguments[2]!==void 0?arguments[2]:Nf;if(uC&&uC(e,null),!za(t))return e;let r=t.length;for(;r--;){let s=t[r];if(typeof s=="string"){const i=n(s);i!==s&&(X7(t)||(t[r]=i),s=i)}e[s]=!0}return e}function oz(e){for(let t=0;e.length>t;t++)Pr(e,t)||(e[t]=null);return e}function Yr(e){const t=gu(null);for(const r of LI(e)){var n=Q7(r,2);const s=n[0],i=n[1];Pr(e,s)&&(t[s]=za(i)?oz(i):i&&typeof i=="object"&&i.constructor===Object?Yr(i):i)}return t}function Ri(e,t){for(;e!==null;){const n=ez(e,t);if(n){if(n.get)return cr(n.get);if(typeof n.value=="function")return cr(n.value)}e=J7(e)}return function(){return null}}const vC=jr(["a","abbr","acronym","address","area","article","aside","audio","b","bdi","bdo","big","blink","blockquote","body","br","button","canvas","caption","center","cite","code","col","colgroup","content","data","datalist","dd","decorator","del","details","dfn","dialog","dir","div","dl","dt","element","em","fieldset","figcaption","figure","font","footer","form","h1","h2","h3","h4","h5","h6","head","header","hgroup","hr","html","i","img","input","ins","kbd","label","legend","li","main","map","mark","marquee","menu","menuitem","meter","nav","nobr","ol","optgroup","option","output","p","picture","pre","progress","q","rp","rt","ruby","s","samp","search","section","select","shadow","slot","small","source","spacer","span","strike","strong","style","sub","summary","sup","table","tbody","td","template","textarea","tfoot","th","thead","time","tr","track","tt","u","ul","var","video","wbr"]),b1=jr(["svg","a","altglyph","altglyphdef","altglyphitem","animatecolor","animatemotion","animatetransform","circle","clippath","defs","desc","ellipse","enterkeyhint","exportparts","filter","font","g","glyph","glyphref","hkern","image","inputmode","line","lineargradient","marker","mask","metadata","mpath","part","path","pattern","polygon","polyline","radialgradient","rect","stop","style","switch","symbol","text","textpath","title","tref","tspan","view","vkern"]),x1=jr(["feBlend","feColorMatrix","feComponentTransfer","feComposite","feConvolveMatrix","feDiffuseLighting","feDisplacementMap","feDistantLight","feDropShadow","feFlood","feFuncA","feFuncB","feFuncG","feFuncR","feGaussianBlur","feImage","feMerge","feMergeNode","feMorphology","feOffset","fePointLight","feSpecularLighting","feSpotLight","feTile","feTurbulence"]),az=jr(["animate","color-profile","cursor","discard","font-face","font-face-format","font-face-name","font-face-src","font-face-uri","foreignobject","hatch","hatchpath","mesh","meshgradient","meshpatch","meshrow","missing-glyph","script","set","solidcolor","unknown","use"]),S1=jr(["math","menclose","merror","mfenced","mfrac","mglyph","mi","mlabeledtr","mmultiscripts","mn","mo","mover","mpadded","mphantom","mroot","mrow","ms","mspace","msqrt","mstyle","msub","msup","msubsup","mtable","mtd","mtext","mtr","munder","munderover","mprescripts"]),lz=jr(["maction","maligngroup","malignmark","mlongdiv","mscarries","mscarry","msgroup","mstack","msline","msrow","semantics","annotation","annotation-xml","mprescripts","none"]),yC=jr(["#text"]),_C=jr(["accept","action","align","alt","autocapitalize","autocomplete","autopictureinpicture","autoplay","background","bgcolor","border","capture","cellpadding","cellspacing","checked","cite","class","clear","color","cols","colspan","command","commandfor","controls","controlslist","coords","crossorigin","datetime","decoding","default","dir","disabled","disablepictureinpicture","disableremoteplayback","download","draggable","enctype","enterkeyhint","exportparts","face","for","headers","height","hidden","high","href","hreflang","id","inert","inputmode","integrity","ismap","kind","label","lang","list","loading","loop","low","max","maxlength","media","method","min","minlength","multiple","muted","name","nonce","noshade","novalidate","nowrap","open","optimum","part","pattern","placeholder","playsinline","popover","popovertarget","popovertargetaction","poster","preload","pubdate","radiogroup","readonly","rel","required","rev","reversed","role","rows","rowspan","spellcheck","scope","selected","shape","size","sizes","slot","span","srclang","start","src","srcset","step","style","summary","tabindex","title","translate","type","usemap","valign","value","width","wrap","xmlns"]),E1=jr(["accent-height","accumulate","additive","alignment-baseline","amplitude","ascent","attributename","attributetype","azimuth","basefrequency","baseline-shift","begin","bias","by","class","clip","clippathunits","clip-path","clip-rule","color","color-interpolation","color-interpolation-filters","color-profile","color-rendering","cx","cy","d","dx","dy","diffuseconstant","direction","display","divisor","dominant-baseline","dur","edgemode","elevation","end","exponent","fill","fill-opacity","fill-rule","filter","filterunits","flood-color","flood-opacity","font-family","font-size","font-size-adjust","font-stretch","font-style","font-variant","font-weight","fx","fy","g1","g2","glyph-name","glyphref","gradientunits","gradienttransform","height","href","id","image-rendering","in","in2","intercept","k","k1","k2","k3","k4","kerning","keypoints","keysplines","keytimes","lang","lengthadjust","letter-spacing","kernelmatrix","kernelunitlength","lighting-color","local","marker-end","marker-mid","marker-start","markerheight","markerunits","markerwidth","maskcontentunits","maskunits","max","mask","mask-type","media","method","mode","min","name","numoctaves","offset","operator","opacity","order","orient","orientation","origin","overflow","paint-order","path","pathlength","patterncontentunits","patterntransform","patternunits","points","preservealpha","preserveaspectratio","primitiveunits","r","rx","ry","radius","refx","refy","repeatcount","repeatdur","restart","result","rotate","scale","seed","shape-rendering","slope","specularconstant","specularexponent","spreadmethod","startoffset","stddeviation","stitchtiles","stop-color","stop-opacity","stroke-dasharray","stroke-dashoffset","stroke-linecap","stroke-linejoin","stroke-miterlimit","stroke-opacity","stroke","stroke-width","style","surfacescale","systemlanguage","tabindex","tablevalues","targetx","targety","transform","transform-origin","text-anchor","text-decoration","text-orientation","text-rendering","textlength","type","u1","u2","unicode","values","viewbox","visibility","version","vert-adv-y","vert-origin-x","vert-origin-y","width","word-spacing","wrap","writing-mode","xchannelselector","ychannelselector","x","x1","x2","xmlns","y","y1","y2","z","zoomandpan"]),wC=jr(["accent","accentunder","align","bevelled","close","columnalign","columnlines","columnspacing","columnspan","denomalign","depth","dir","display","displaystyle","encoding","fence","frame","height","href","id","largeop","length","linethickness","lquote","lspace","mathbackground","mathcolor","mathsize","mathvariant","maxsize","minsize","movablelimits","notation","numalign","open","rowalign","rowlines","rowspacing","rowspan","rspace","rquote","scriptlevel","scriptminsize","scriptsizemultiplier","selection","separator","separators","stretchy","subscriptshift","supscriptshift","symmetric","voffset","width","xmlns"]),fm=jr(["xlink:href","xml:id","xlink:title","xml:space","xmlns:xlink"]),cz=Vr(/{{[\w\W]*|^[\w\W]*}}/g),uz=Vr(/<%[\w\W]*|^[\w\W]*%>/g),dz=Vr(/\${[\w\W]*/g),fz=Vr(/^data-[\-\w.\u00B7-\uFFFF]+$/),hz=Vr(/^aria-[\-\w]+$/),bC=Vr(/^(?:(?:(?:f|ht)tps?|mailto|tel|callto|sms|cid|xmpp|matrix):|[^a-z]|[a-z+.\-]+(?:[^a-z+.\-:]|$))/i),pz=Vr(/^(?:\w+script|data):/i),mz=Vr(/[\u0000-\u0020\u00A0\u1680\u180E\u2000-\u2029\u205F\u3000]/g),gz=Vr(/^html$/i),vz=Vr(/^[a-z][.\w]*(-[.\w]+)+$/i),xC=Vr(/<[/\w!]/g),SC=Vr(/<[/\w]/g),yz=Vr(/<\/no(script|embed|frames)/i),_z=Vr(/\/>/i),wz=function(){return typeof window>"u"?null:window},Ma=function(e,t,n,r){return Pr(e,t)&&za(e[t])?Ht(r.base?Yr(r.base):{},e[t],r.transform):n};var bz=(function e(){let t=arguments.length>0&&arguments[0]!==void 0?arguments[0]:wz();const n=N=>e(N);if(n.version="3.4.13",n.removed=[],!t||!t.document||t.document.nodeType!==9||!t.Element)return n.isSupported=!1,n;let r=t.document;const s=r,i=s.currentScript,o=t.HTMLTemplateElement,c=t.Node,u=t.NodeFilter,d=t.DOMParser,f=t.trustedTypes,p=t.Element.prototype,m=Ri(p,"cloneNode"),v=Ri(p,"remove"),_=Ri(p,"nextSibling"),w=Ri(p,"childNodes"),b=Ri(p,"parentNode"),S=Ri(p,"shadowRoot"),E=Ri(p,"attributes"),C=c&&c.prototype?Ri(c.prototype,"nodeType"):null,A=c&&c.prototype?Ri(c.prototype,"nodeName"):null,T=c&&c.prototype?Ri(c.prototype,"ownerDocument"):null;if(typeof o=="function"){const N=r.createElement("template");N.content&&N.content.ownerDocument&&(r=N.content.ownerDocument)}let M,O,R="",D=!1,U=0;const W=function(){if(U>0)throw Ul('A configured TRUSTED_TYPES_POLICY callback (createHTML or createScriptURL) must not call DOMPurify.sanitize, as that causes infinite recursion. Do not pass a policy whose callbacks wrap DOMPurify as TRUSTED_TYPES_POLICY; see the "DOMPurify and Trusted Types" section of the README.')},H=function(N){W(),U++;try{return M.createHTML(N)}finally{U--}},Y=r.implementation,J=r.createNodeIterator,V=r.createDocumentFragment,q=r.getElementsByTagName,ee=s.importNode;let F={afterSanitizeAttributes:[],afterSanitizeElements:[],afterSanitizeShadowDOM:[],beforeSanitizeAttributes:[],beforeSanitizeElements:[],beforeSanitizeShadowDOM:[],uponSanitizeAttribute:[],uponSanitizeElement:[],uponSanitizeShadowNode:[]};n.isSupported=typeof LI=="function"&&typeof b=="function"&&Y&&Y.createHTMLDocument!==void 0;const X=cz,B=uz,L=dz,G=fz,ue=hz,te=pz,ie=mz,he=vz;let ke=bC,ge=null;const pe=Ht({},[...vC,...b1,...x1,...S1,...yC]);let Ne=null;const Re=Ht({},[..._C,...E1,...wC,...fm]);let $e=Object.seal(gu(null,{tagNameCheck:{writable:!0,configurable:!1,enumerable:!0,value:null},attributeNameCheck:{writable:!0,configurable:!1,enumerable:!0,value:null},allowCustomizedBuiltInElements:{writable:!0,configurable:!1,enumerable:!0,value:!1}})),Et=null,dn=null;const an=Object.seal(gu(null,{tagCheck:{writable:!0,configurable:!1,enumerable:!0,value:null},attributeCheck:{writable:!0,configurable:!1,enumerable:!0,value:null}}));let kt=!0,Gt=!0,gn=!1,Qt=!0,Me=!1,Xe=!0,Te=!1,xt=!1,xe=null,$t=null,ft=!1,gt=!1,Hn=!1,Js=!1,_n=!0,Gn=!1;const _i="user-content-";let rs=!0,Hr=!1,Un={},fn=null;const Ur=Ht({},["annotation-xml","audio","colgroup","desc","foreignobject","head","iframe","math","mi","mn","mo","ms","mtext","noembed","noframes","noscript","plaintext","script","selectedcontent","style","svg","template","thead","title","video","xmp"]);let Jn=null;const Ui=Ht({},["audio","video","img","source","image","track"]);let Rr=null;const Zn=Ht({},["alt","class","for","id","label","name","pattern","placeholder","role","summary","title","value","style","xmlns"]),_r="http://www.w3.org/1998/Math/MathML",$s="http://www.w3.org/2000/svg",qn="http://www.w3.org/1999/xhtml";let ss=qn,st=!1,nn=null;const Xt=Ht({},[_r,$s,qn],w1),hn=jr(["mi","mo","mn","ms","mtext"]);let wn=Ht({},hn);const Bt=jr(["annotation-xml"]);let Tn=Ht({},Bt);const Zr=Ht({},["title","style","font","a","script"]);let Bn=null;const ur=["application/xhtml+xml","text/html"];let Vt=null,ei=null;const Ld=r.createElement("form"),ha=function(N){return N instanceof RegExp||N instanceof Function},Zi=function(){let N=arguments.length>0&&arguments[0]!==void 0?arguments[0]:{};if(ei&&ei===N)return;N&&typeof N=="object"||(N={}),N=Yr(N),Bn=ur.indexOf(N.PARSER_MEDIA_TYPE)===-1?"text/html":N.PARSER_MEDIA_TYPE,Vt=Bn==="application/xhtml+xml"?w1:Nf,ge=Ma(N,"ALLOWED_TAGS",pe,{transform:Vt}),Ne=Ma(N,"ALLOWED_ATTR",Re,{transform:Vt}),nn=Ma(N,"ALLOWED_NAMESPACES",Xt,{transform:w1}),Rr=Ma(N,"ADD_URI_SAFE_ATTR",Zn,{transform:Vt,base:Zn}),Jn=Ma(N,"ADD_DATA_URI_TAGS",Ui,{transform:Vt,base:Ui}),fn=Ma(N,"FORBID_CONTENTS",Ur,{transform:Vt}),Et=Ma(N,"FORBID_TAGS",Yr({}),{transform:Vt}),dn=Ma(N,"FORBID_ATTR",Yr({}),{transform:Vt}),Un=!!Pr(N,"USE_PROFILES")&&(N.USE_PROFILES&&typeof N.USE_PROFILES=="object"?Yr(N.USE_PROFILES):N.USE_PROFILES),kt=N.ALLOW_ARIA_ATTR!==!1,Gt=N.ALLOW_DATA_ATTR!==!1,gn=N.ALLOW_UNKNOWN_PROTOCOLS||!1,Qt=N.ALLOW_SELF_CLOSE_IN_ATTR!==!1,Me=N.SAFE_FOR_TEMPLATES||!1,Xe=N.SAFE_FOR_XML!==!1,Te=N.WHOLE_DOCUMENT||!1,gt=N.RETURN_DOM||!1,Hn=N.RETURN_DOM_FRAGMENT||!1,Js=N.RETURN_TRUSTED_TYPE||!1,ft=N.FORCE_BODY||!1,_n=N.SANITIZE_DOM!==!1,Gn=N.SANITIZE_NAMED_PROPS||!1,rs=N.KEEP_CONTENT!==!1,Hr=N.IN_PLACE||!1,ke=(function(ve){try{return kr(ve,""),!0}catch{return!1}})(N.ALLOWED_URI_REGEXP)?N.ALLOWED_URI_REGEXP:bC,ss=typeof N.NAMESPACE=="string"?N.NAMESPACE:qn,wn=Pr(N,"MATHML_TEXT_INTEGRATION_POINTS")&&N.MATHML_TEXT_INTEGRATION_POINTS&&typeof N.MATHML_TEXT_INTEGRATION_POINTS=="object"?Yr(N.MATHML_TEXT_INTEGRATION_POINTS):Ht({},hn),Tn=Pr(N,"HTML_INTEGRATION_POINTS")&&N.HTML_INTEGRATION_POINTS&&typeof N.HTML_INTEGRATION_POINTS=="object"?Yr(N.HTML_INTEGRATION_POINTS):Ht({},Bt);const de=Pr(N,"CUSTOM_ELEMENT_HANDLING")&&N.CUSTOM_ELEMENT_HANDLING&&typeof N.CUSTOM_ELEMENT_HANDLING=="object"?Yr(N.CUSTOM_ELEMENT_HANDLING):gu(null);if($e=gu(null),Pr(de,"tagNameCheck")&&ha(de.tagNameCheck)&&($e.tagNameCheck=de.tagNameCheck),Pr(de,"attributeNameCheck")&&ha(de.attributeNameCheck)&&($e.attributeNameCheck=de.attributeNameCheck),Pr(de,"allowCustomizedBuiltInElements")&&typeof de.allowCustomizedBuiltInElements=="boolean"&&($e.allowCustomizedBuiltInElements=de.allowCustomizedBuiltInElements),Vr($e),Me&&(Gt=!1),Hn&&(gt=!0),Un&&(ge=Ht({},yC),Ne=gu(null),Un.html===!0&&(Ht(ge,vC),Ht(Ne,_C)),Un.svg===!0&&(Ht(ge,b1),Ht(Ne,E1),Ht(Ne,fm)),Un.svgFilters===!0&&(Ht(ge,x1),Ht(Ne,E1),Ht(Ne,fm)),Un.mathMl===!0&&(Ht(ge,S1),Ht(Ne,wC),Ht(Ne,fm))),an.tagCheck=null,an.attributeCheck=null,Pr(N,"ADD_TAGS")&&(typeof N.ADD_TAGS=="function"?an.tagCheck=N.ADD_TAGS:za(N.ADD_TAGS)&&(ge===pe&&(ge=Yr(ge)),Ht(ge,N.ADD_TAGS,Vt))),Pr(N,"ADD_ATTR")&&(typeof N.ADD_ATTR=="function"?an.attributeCheck=N.ADD_ATTR:za(N.ADD_ATTR)&&(Ne===Re&&(Ne=Yr(Ne)),Ht(Ne,N.ADD_ATTR,Vt))),Pr(N,"ADD_URI_SAFE_ATTR")&&za(N.ADD_URI_SAFE_ATTR)&&Ht(Rr,N.ADD_URI_SAFE_ATTR,Vt),Pr(N,"FORBID_CONTENTS")&&za(N.FORBID_CONTENTS)&&(fn===Ur&&(fn=Yr(fn)),Ht(fn,N.FORBID_CONTENTS,Vt)),Pr(N,"ADD_FORBID_CONTENTS")&&za(N.ADD_FORBID_CONTENTS)&&(fn===Ur&&(fn=Yr(fn)),Ht(fn,N.ADD_FORBID_CONTENTS,Vt)),rs&&(ge["#text"]=!0),Te&&Ht(ge,["html","head","body"]),ge.table&&(Ht(ge,["tbody"]),delete Et.tbody),N.TRUSTED_TYPES_POLICY){if(typeof N.TRUSTED_TYPES_POLICY.createHTML!="function")throw Ul('TRUSTED_TYPES_POLICY configuration option must provide a "createHTML" hook.');if(typeof N.TRUSTED_TYPES_POLICY.createScriptURL!="function")throw Ul('TRUSTED_TYPES_POLICY configuration option must provide a "createScriptURL" hook.');const ve=M;M=N.TRUSTED_TYPES_POLICY;try{R=H("")}catch(Se){throw M=ve,Se}}else N.TRUSTED_TYPES_POLICY===null?(M=void 0,R=""):(M===void 0&&(D||(O=(function(ve,Se){if(typeof ve!="object"||typeof ve.createPolicy!="function")return null;let Ue=null;const ht="data-tt-policy-suffix";Se&&Se.hasAttribute(ht)&&(Ue=Se.getAttribute(ht));const Ct="dompurify"+(Ue?"#"+Ue:"");try{return ve.createPolicy(Ct,{createHTML:Tt=>Tt,createScriptURL:Tt=>Tt})}catch{return console.warn("TrustedTypes policy "+Ct+" could not be created."),null}})(f,i),D=!0),M=O),M&&typeof R=="string"&&(R=H("")));jr&&jr(N),ei=N},wr=Ht({},[...b1,...x1,...az]),ti=Ht({},[...S1,...lz]),vs=function(N){uu(n.removed,{element:N});try{b(N).removeChild(N)}catch{if(v(N),!b(N))throw Ul("a node selected for removal could not be detached from its tree and cannot be safely returned; refusing to sanitize in place")}},wi=function(N){Ds(N);const de=w(N);if(de){const Se=[];cu(de,Ue=>{uu(Se,Ue)}),cu(Se,Ue=>{try{v(Ue)}catch{}})}const ve=E(N);if(ve)for(let Se=ve.length-1;Se>=0;--Se){const Ue=ve[Se],ht=Ue&&Ue.name;if(typeof ht=="string")try{N.removeAttribute(ht)}catch{}}},ys=function(N,de){try{uu(n.removed,{attribute:de.getAttributeNode(N),from:de})}catch{uu(n.removed,{attribute:null,from:de})}if(de.removeAttribute(N),N==="is")if(gt||Hn)try{vs(de)}catch{}else try{de.setAttribute(N,"")}catch{}},pa=function(N){const de=E(N);if(de)for(let ve=de.length-1;ve>=0;--ve){const Se=de[ve],Ue=Se&&Se.name;if(typeof Ue=="string"&&!Ne[Vt(Ue)])try{N.removeAttribute(Ue)}catch{}}},Ds=function(N){const de=[N];for(;de.length>0;){const ve=de.pop();(C?C(ve):ve.nodeType)===1&&pa(ve);const Se=w(ve);if(Se)for(let Ue=Se.length-1;Ue>=0;--Ue)de.push(Se[Ue])}},xl=function(N){let de=null,ve=null;if(ft)N="<remove></remove>"+N;else{const ht=fC(N,/^[\r\n\t ]+/);ve=ht&&ht[0]}Bn==="application/xhtml+xml"&&ss===qn&&(N='<html xmlns="http://www.w3.org/1999/xhtml"><head></head><body>'+N+"</body></html>");const Se=M?H(N):N;if(ss===qn)try{de=new d().parseFromString(Se,Bn)}catch{}if(!de||!de.documentElement){de=Y.createDocument(ss,"template",null);try{de.documentElement.innerHTML=st?R:Se}catch{}}const Ue=de.body||de.documentElement;return N&&ve&&Ue.insertBefore(r.createTextNode(ve),Ue.childNodes[0]||null),ss===qn?q.call(de,Te?"html":"body")[0]:Te?de.documentElement:Ue},Tc=function(N){const de=T?T(N):N.ownerDocument;return J.call(de||N,N,u.SHOW_ELEMENT|u.SHOW_COMMENT|u.SHOW_TEXT|u.SHOW_PROCESSING_INSTRUCTION|u.SHOW_CDATA_SECTION,null)},ma=function(N){return N=xf(N,X," "),N=xf(N,B," "),xf(N,L," ")},ln=function(N){var de;N.normalize();const ve=T?T(N):N.ownerDocument,Se=J.call(ve||N,N,u.SHOW_TEXT|u.SHOW_COMMENT|u.SHOW_CDATA_SECTION|u.SHOW_PROCESSING_INSTRUCTION,null);let Ue=Se.nextNode();for(;Ue;)Ue.data=ma(Ue.data),Ue=Se.nextNode();const ht=(de=N.querySelectorAll)===null||de===void 0?void 0:de.call(N,"template");ht&&cu(ht,Ct=>{Fs(Ct.content)&&ln(Ct.content)})},Bi=function(N){const de=A?A(N):null;return typeof de=="string"&&Vt(de)==="form"&&(typeof N.nodeName!="string"||typeof N.textContent!="string"||typeof N.removeChild!="function"||N.attributes!==E(N)||typeof N.removeAttribute!="function"||typeof N.setAttribute!="function"||typeof N.namespaceURI!="string"||typeof N.insertBefore!="function"||typeof N.hasChildNodes!="function"||N.nodeType!==C(N)||N.childNodes!==w(N))},Fs=function(N){if(!C||typeof N!="object"||N===null)return!1;try{return C(N)===11}catch{return!1}},Wi=function(N){if(!C||typeof N!="object"||N===null)return!1;try{return typeof C(N)=="number"}catch{return!1}};function Ir(N,de,ve){N.length!==0&&cu(N,Se=>{Se.call(n,de,ve,ei)})}const Sl=function(N,de,ve,Se){return N.length===0?de:de===ve||de===Se?Yr(de):de},El=function(N,de){if(Ir(F.beforeSanitizeElements,N,null),N!==de&&b(N)===null)return Hr&&Ds(N),!0;if(Bi(N))return vs(N),!0;const ve=Vt(A?A(N):N.nodeName);if(ge=Sl(F.uponSanitizeElement,ge,pe,xe),Ir(F.uponSanitizeElement,N,{tagName:ve,allowedTags:ge}),N!==de&&b(N)===null)return Hr&&Ds(N),!0;if((function(Se,Ue){return!!(Xe&&Se.hasChildNodes()&&!Wi(Se.firstElementChild)&&kr(xC,Se.textContent)&&kr(xC,Se.innerHTML))||!(!Xe||Se.namespaceURI!==qn||Ue!=="style"||!Wi(Se.firstElementChild))||Se.nodeType===7||!(!Xe||Se.nodeType!==8||!kr(SC,Se.data))})(N,ve))return vs(N),!0;if(Et[ve]||!(an.tagCheck instanceof Function&&an.tagCheck(ve))&&!ge[ve]){const Se=(function(Ue,ht,Ct){if(!Et[ht]&&kl(ht)&&($e.tagNameCheck instanceof RegExp&&kr($e.tagNameCheck,ht)||$e.tagNameCheck instanceof Function&&$e.tagNameCheck(ht)))return!1;if(rs&&!fn[ht]){const Tt=b(Ue),Jt=w(Ue);if(Jt&&Tt)for(let pt=Jt.length-1;pt>=0;--pt){const Rn=Ue===Ct?m(Jt[pt],!0):Jt[pt];Tt.insertBefore(Rn,_(Ue))}}return vs(Ue),!0})(N,ve,de);return Se===!1&&Ir(F.afterSanitizeElements,N,null),Se}if((C?C(N):N.nodeType)===1&&!(function(Se){let Ue=b(Se);Ue&&Ue.tagName||(Ue={namespaceURI:ss,tagName:"template"});const ht=Nf(Se.tagName),Ct=Nf(Ue.tagName);return!!nn[Se.namespaceURI]&&(Se.namespaceURI===$s?(function(Tt,Jt,pt){return Jt.namespaceURI===qn?Tt==="svg":Jt.namespaceURI===_r?Tt==="svg"&&(pt==="annotation-xml"||wn[pt]):!!wr[Tt]})(ht,Ue,Ct):Se.namespaceURI===_r?(function(Tt,Jt,pt){return Jt.namespaceURI===qn?Tt==="math":Jt.namespaceURI===$s?Tt==="math"&&Tn[pt]:!!ti[Tt]})(ht,Ue,Ct):Se.namespaceURI===qn?(function(Tt,Jt,pt){return!(Jt.namespaceURI===$s&&!Tn[pt])&&!(Jt.namespaceURI===_r&&!wn[pt])&&!ti[Tt]&&(Zr[Tt]||!wr[Tt])})(ht,Ue,Ct):!(Bn!=="application/xhtml+xml"||!nn[Se.namespaceURI]))})(N)||(ve==="noscript"||ve==="noembed"||ve==="noframes")&&kr(yz,N.innerHTML))return vs(N),!0;if(Me&&N.nodeType===3){const Se=ma(N.textContent);N.textContent!==Se&&(uu(n.removed,{element:N.cloneNode()}),N.textContent=Se)}return Ir(F.afterSanitizeElements,N,null),!1},So=function(N,de,ve){if(dn[de]||Xe&&de==="patchsrc"||Xe&&de==="for"&&N!=="label"&&N!=="output"||_n&&(de==="id"||de==="name")&&(ve in r||ve in Ld))return!1;const Se=Ne[de]||an.attributeCheck instanceof Function&&an.attributeCheck(de,N);if(!(Gt&&kr(G,de))){if(!(kt&&kr(ue,de))){if(Se){if(!Rr[de]){if(!kr(ke,xf(ve,ie,""))){if((de!=="src"&&de!=="xlink:href"&&de!=="href"||N==="script"||hC(ve,"data:")!==0||!Jn[N])&&!(gn&&!kr(te,xf(ve,ie,"")))){if(ve)return!1}}}}else if(!(kl(N)&&($e.tagNameCheck instanceof RegExp&&kr($e.tagNameCheck,N)||$e.tagNameCheck instanceof Function&&$e.tagNameCheck(N))&&($e.attributeNameCheck instanceof RegExp&&kr($e.attributeNameCheck,de)||$e.attributeNameCheck instanceof Function&&$e.attributeNameCheck(de,N))||de==="is"&&$e.allowCustomizedBuiltInElements&&($e.tagNameCheck instanceof RegExp&&kr($e.tagNameCheck,ve)||$e.tagNameCheck instanceof Function&&$e.tagNameCheck(ve))))return!1}}return!0},Br=Ht({},["annotation-xml","color-profile","font-face","font-face-format","font-face-name","font-face-src","font-face-uri","missing-glyph"]),kl=function(N){return!Br[Nf(N)]&&kr(he,N)},is=function(N,de,ve,Se){if(M&&typeof f=="object"&&typeof f.getAttributeType=="function"&&!ve)switch(f.getAttributeType(N,de)){case"TrustedHTML":return H(Se);case"TrustedScriptURL":return(function(Ue){W(),U++;try{return M.createScriptURL(Ue)}finally{U--}})(Se)}return Se},$d=function(N,de,ve,Se){try{ve?N.setAttributeNS(ve,de,Se):N.setAttribute(de,Se),Bi(N)?vs(N):dC(n.removed)}catch{ys(de,N)}},Rc=function(N){Ir(F.beforeSanitizeAttributes,N,null);const de=N.attributes;if(!de||Bi(N))return;Ne=Sl(F.uponSanitizeAttribute,Ne,Re,$t);const ve={attrName:"",attrValue:"",keepAttr:!0,allowedAttributes:Ne,forceKeepAttr:void 0};let Se=de.length;const Ue=Vt(N.nodeName);for(;Se--;){const ht=de[Se],Ct=ht.name,Tt=ht.namespaceURI,Jt=ht.value,pt=Vt(Ct),Rn=Jt;let it=Ct==="value"?Rn:rz(Rn);ve.attrName=pt,ve.attrValue=it,ve.keepAttr=!0,ve.forceKeepAttr=void 0,Ir(F.uponSanitizeAttribute,N,ve),it=ve.attrValue,!Gn||pt!=="id"&&pt!=="name"||hC(it,_i)===0||(ys(Ct,N),it=_i+it),Xe&&kr(/((--!?|])>)|<\/(style|script|title|xmp|textarea|noscript|iframe|noembed|noframes)/i,it)||pt==="attributename"&&fC(it,"href")?ys(Ct,N):ve.forceKeepAttr||(!ve.keepAttr||!Qt&&kr(_z,it)?ys(Ct,N):(Me&&(it=ma(it)),So(Ue,pt,it)?(it=is(Ue,pt,Tt,it),it!==Rn&&$d(N,Ct,Tt,it)):ys(Ct,N)))}Ir(F.afterSanitizeAttributes,N,null)},ga=function(N){let de=null;const ve=Tc(N);for(Ir(F.beforeSanitizeShadowDOM,N,null);de=ve.nextNode();)if(Ir(F.uponSanitizeShadowNode,de,null),El(de,N),Rc(de),Fs(de.content)&&ga(de.content),(C?C(de):de.nodeType)===1){const Se=S(de);Fs(Se)&&(ni(Se),ga(Se))}Ir(F.afterSanitizeShadowDOM,N,null)},ni=function(N){const de=[{node:N,shadow:null}];for(;de.length>0;){const ve=de.pop();if(ve.shadow){ga(ve.shadow);continue}const Se=ve.node,Ue=(C?C(Se):Se.nodeType)===1,ht=w(Se);if(ht)for(let Ct=ht.length-1;Ct>=0;--Ct)de.push({node:ht[Ct],shadow:null});if(Ue){const Ct=A?A(Se):null;if(typeof Ct=="string"&&Vt(Ct)==="template"){const Tt=Se.content;Fs(Tt)&&de.push({node:Tt,shadow:null})}}if(Ue){const Ct=S(Se);Fs(Ct)&&de.push({node:null,shadow:Ct},{node:Ct,shadow:null})}}};return n.sanitize=function(N){let de=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{},ve=null,Se=null,Ue=null,ht=null;if(st=!N,st&&(N="<!-->"),typeof N!="string"&&!Wi(N)&&typeof(N=(function(pt){switch(typeof pt){case"string":return pt;case"number":return sz(pt);case"boolean":return iz(pt);case"bigint":return pC?pC(pt):"0";case"symbol":return mC?mC(pt):"Symbol()";case"undefined":default:return dm(pt);case"function":case"object":{if(pt===null)return dm(pt);const Rn=pt,it=Ri(Rn,"toString");if(typeof it=="function"){const Or=it(Rn);return typeof Or=="string"?Or:dm(Or)}return dm(pt)}}})(N))!="string")throw Ul("dirty is not a string, aborting");if(!n.isSupported)return N;xt?(ge=xe,Ne=$t):Zi(de),(F.uponSanitizeElement.length>0||F.uponSanitizeAttribute.length>0)&&(ge=Yr(ge)),F.uponSanitizeAttribute.length>0&&(Ne=Yr(Ne)),n.removed=[];const Ct=Hr&&typeof N!="string"&&Wi(N);if(Ct){(function(Rn){if(!Xe)return;const it=[Rn];for(;it.length>0;){const Or=it.pop(),Eo=C?C(Or):Or.nodeType;if(Eo===7||Eo===8&&kr(SC,Or.data)){try{v(Or)}catch{}continue}if(Eo===1){const Mr=Or,Ki=Vt(A?A(Or):Or.nodeName);try{Mr.hasAttribute&&Mr.hasAttribute("patchsrc")&&Mr.removeAttribute("patchsrc"),Mr.hasAttribute&&Mr.hasAttribute("for")&&Ki!=="label"&&Ki!=="output"&&Mr.removeAttribute("for")}catch{}}const ko=w(Or);if(ko)for(let Mr=ko.length-1;Mr>=0;--Mr)it.push(ko[Mr])}})(N);const pt=A?A(N):N.nodeName;if(typeof pt=="string"){const Rn=Vt(pt);if(!ge[Rn]||Et[Rn])throw wi(N),Ul("root node is forbidden and cannot be sanitized in-place")}if(Bi(N))throw wi(N),Ul("root node is clobbered and cannot be sanitized in-place");try{ni(N)}catch(Rn){throw wi(N),Rn}}else if(Wi(N))ve=xl("<!---->"),Se=ve.ownerDocument.importNode(N,!0),Se.nodeType===1&&Se.nodeName==="BODY"||Se.nodeName==="HTML"?ve=Se:ve.appendChild(Se),ni(Se);else{if(!gt&&!Me&&!Te&&N.indexOf("<")===-1)return M&&Js?H(N):N;if(ve=xl(N),!ve)return gt?null:Js?R:""}ve&&ft&&vs(ve.firstChild);const Tt=Ct?N:ve;try{const pt=Tc(Tt);for(;Ue=pt.nextNode();)El(Ue,Tt),Rc(Ue),Fs(Ue.content)&&ga(Ue.content)}catch(pt){throw Ct&&(wi(N),cu(n.removed,Rn=>{Rn.element&&Ds(Rn.element)})),pt}if(Ct)return cu(n.removed,pt=>{pt.element&&Ds(pt.element)}),Me&&ln(N),N;if(gt){if(Me&&ln(ve),Hn)for(ht=V.call(ve.ownerDocument);ve.firstChild;)ht.appendChild(ve.firstChild);else ht=ve;return(Ne.shadowroot||Ne.shadowrootmode)&&(ht=ee.call(s,ht,!0)),ht}let Jt=Te?ve.outerHTML:ve.innerHTML;return Te&&ge["!doctype"]&&ve.ownerDocument&&ve.ownerDocument.doctype&&ve.ownerDocument.doctype.name&&kr(gz,ve.ownerDocument.doctype.name)&&(Jt="<!DOCTYPE "+ve.ownerDocument.doctype.name+`>
|
|
20
|
+
`+Jt),Me&&(Jt=ma(Jt)),M&&Js?H(Jt):Jt},n.setConfig=function(){Zi(arguments.length>0&&arguments[0]!==void 0?arguments[0]:{}),xt=!0,xe=ge,$t=Ne},n.clearConfig=function(){ei=null,xt=!1,xe=null,$t=null,M=O,R=""},n.isValidAttribute=function(N,de,ve){ei||Zi({});const Se=Vt(N),Ue=Vt(de);return So(Se,Ue,ve)},n.addHook=function(N,de){typeof de=="function"&&Pr(F,N)&&uu(F[N],de)},n.removeHook=function(N,de){if(Pr(F,N)){if(de!==void 0){const ve=tz(F[N],de);return ve===-1?void 0:nz(F[N],ve,1)[0]}return dC(F[N])}},n.removeHooks=function(N){Pr(F,N)&&(F[N]=[])},n.removeAllHooks=function(){F={afterSanitizeAttributes:[],afterSanitizeElements:[],afterSanitizeShadowDOM:[],beforeSanitizeAttributes:[],beforeSanitizeElements:[],beforeSanitizeShadowDOM:[],uponSanitizeAttribute:[],uponSanitizeElement:[],uponSanitizeShadowNode:[]}},n})();const EC="Refusing to render web experiment since the viewer is a likely bot",kC={ADD_ATTR:(e,t)=>e==="target"&&t==="a"||e==="form"&&/^(button|fieldset|input|output|select|textarea)$/.test(t),ADD_URI_SAFE_ATTR:["form"]};let CC;const xz={icontains:(e,t)=>t.toLowerCase().indexOf(e.toLowerCase())>-1,not_icontains:(e,t)=>t.toLowerCase().indexOf(e.toLowerCase())===-1,regex:(e,t)=>$0(t,e),not_regex:(e,t)=>!$0(t,e),exact:(e,t)=>t===e,is_not:(e,t)=>t!==e},ci=xn("[Conversations]"),Zl="Conversations not available yet.";function PC(e,t){var n,r,s,i,o,c,u;const d=(n=e==null?void 0:e.flushIntervalMs)!==null&&n!==void 0?n:3e3,f=(r=e==null?void 0:e.maxBufferSize)!==null&&r!==void 0?r:100,p=t!=null&&t.consoleCapture?void 0:(s=e==null?void 0:e.maxLogsPerInterval)!==null&&s!==void 0?s:1e3,m=ce(p)?Math.max(f,2048):Math.max(f,p),v=$($({},(function(){let _="",w="";try{var b;const S="u">typeof globalThis?globalThis:"u">typeof window?window:void 0,E=S==null||(b=S.navigator)===null||b===void 0?void 0:b.userAgent;E&&([_,w]=UT(E))}catch{}return(function(S,E){const C=(function(A){if(A)return{}.hasOwnProperty.call(e6,A)?e6[A]:A})(S);return $($({},C?{"os.name":C}:{}),E?{"os.version":E}:{})})(_,w)})()),e==null?void 0:e.resourceAttributes);return{serviceName:(i=(o=v==null?void 0:v["service.name"])!==null&&o!==void 0?o:e==null?void 0:e.serviceName)!==null&&i!==void 0?i:t==null?void 0:t.serviceNameDefault,serviceVersion:(c=v==null?void 0:v["service.version"])!==null&&c!==void 0?c:e==null?void 0:e.serviceVersion,environment:(u=v==null?void 0:v["deployment.environment"])!==null&&u!==void 0?u:e==null?void 0:e.environment,resourceAttributes:v,beforeSend:e==null?void 0:e.beforeSend,flushIntervalMs:d,maxBufferSize:f,maxQueueSize:m,maxBatchRecordsPerPost:100,rateCapWindowMs:d,maxLogsPerInterval:p,backgroundFlushBudgetMs:0,terminationFlushBudgetMs:0}}const Sz=["debug","log","warn","error","info"],Ez=e=>{for(;e!=null&&e.__rrweb_original__;)e=e.__rrweb_original__;return e},AC="console",DI="__posthogHandledLogsRequestError",k1=(e,t)=>{const n=e instanceof Error?e:new Error(t);return n[DI]=!0,n},TC=e=>!!e&&typeof e=="object"&&e[DI]===!0;var kz=class{get cf(){return $($({},this.A),{},{error:(...e)=>{e.some(TC)||this.A.error(...e)}})}constructor(e,t){var n;this.Wl=e,this.hf=t,this.name="logs",this.df=!1,this.vf=!1,this.ff=!1,this.A=xn("[logs]"),this.Sc=[],this.pf=[],this.hv=0,this.gf=!1,this.Mi=!1,this.mf=[],this.yf=[],this.bf=!1,this._f=!1,this.wf=!1,this.kf=()=>{var r,s;this.Mi||(this.hv=0,(r=this.Sf)===null||r===void 0||r.onReconnect(),(s=this.xf)===null||s===void 0||s.onReconnect())},this.df=!!(!((n=e.get())===null||n===void 0)&&n.captureConsoleLogs)}get $f(){return!0}Cf(){}Tf(){if(!this.wf){try{this.Cv=typeof window>"u"?void 0:window}catch{this.Cv=void 0}this.Cv&&(Lt(this.Cv,"online",this.kf),this.wf=!0)}}If(e,t,n,r){this.Tf();const s=PC(this.Wl.get(),n);return[new VF(this.Mf(e,t),s,this.cf,()=>this.hf(),i=>i(),void 0,r),s]}Ef(){const e=this.Wl.get();var t;return this.Sf&&this.Af===e||((t=this.Sf)===null||t===void 0||t.reset(),this.Af=e,[this.Sf,this.Rf]=this.If(()=>this.Sc,n=>{this.Sc=n})),this.Sf}Pf(){const e=this.Wl.get();var t;return this.xf&&this.Of===e||((t=this.xf)===null||t===void 0||t.reset(),this.Of=e,[this.xf,this.Ff]=this.If(()=>this.pf,n=>{this.pf=n},{serviceNameDefault:"posthog-browser-logs",consoleCapture:!0},AC)),this.xf}setup(e){if(!this.Mi&&!this.gf)return this.gf=!0,this.zl=e,this.A=e.logger.createLogger("[logs]"),wb(e.kv.initialize(),()=>{this.Mi||this.Tv(e)})}Tv(e){var t;this.Tf(),!((t=this.Wl.get())===null||t===void 0)&&t.captureConsoleLogs&&(this.df=!0),(this.df||this.Wl.remoteConfigWillArrive&&e.kv.get(this.Wl.captureHintKey))&&this.Df();let n=!1;const r=e.onRemoteConfig(s=>{var i;n=s.ok&&((i=s.config.logs)===null||i===void 0?void 0:i.captureConsoleLogs)===!0,this.onRemoteConfig(s)});this.Mi?r.dispose():(this.na=r,n||this.loadIfEnabled())}dispose(){var e,t,n,r,s,i,o;this.Mi||(this.Mi=!0,this.Lf(),(e=this.na)===null||e===void 0||e.dispose(),this.na=void 0,this.zl=void 0,this.ff=!1,(t=this.Cv)===null||t===void 0||t.removeEventListener("online",this.kf),(n=this.Nf)===null||n===void 0||n.call(this),this.Nf=void 0,(r=this.Sf)===null||r===void 0||r.clearQueue(),(s=this.xf)===null||s===void 0||s.clearQueue(),(i=this.Sf)===null||i===void 0||i.reset(),(o=this.xf)===null||o===void 0||o.reset())}onRemoteConfig(e){var t,n;if(this.Mi)return;const r=e.ok?(t=e.config.logs)===null||t===void 0?void 0:t.captureConsoleLogs:void 0;ot(r)?this.jf():((n=this.zl)===null||n===void 0||n.kv.set(this.Wl.captureHintKey,!!r),r?(this.df=!0,this.vf||this.Df(),this.loadIfEnabled()):this.jf())}reset(){var e,t,n,r;this.Lf(),(e=this.Sf)===null||e===void 0||e.clearQueue(),this.Sc=[],(t=this.Sf)===null||t===void 0||t.reset(),(n=this.xf)===null||n===void 0||n.clearQueue(),this.pf=[],(r=this.xf)===null||r===void 0||r.reset(),this.hv=0}captureLog(e){!this.Mi&&this.zl&&this.Ef().captureLog(e)}captureConsoleLog(e){!this.Mi&&this.zl&&this.Pf().captureLog(e)}captureBufferedConsoleLog(e,t,n){!this.Mi&&this.zl&&this.Pf().captureLog(e,{context:t,occurredAtMs:n})}Gd(){var e;this.Lf(),(e=this.xf)===null||e===void 0||e.clearQueue(),this.pf=[]}jf(){this.df||this.Lf()}Df(){var e;if(this.bf||!(!((e=this.Cv)===null||e===void 0)&&e.console))return;const t=PC(this.Wl.get()).maxBufferSize;let n=!0;this.yf.push(()=>{n=!1});for(const r of Sz){let s;try{s=Ez(this.Cv.console[r])}catch{continue}s&&this.yf.push(rd(this.Cv.console,r,i=>{const o=(...c)=>{try{n&&this.qf(r,c,t)}catch{}return i.apply(this.Cv.console,c)};return o.__rrweb_original__=s,o}))}this.bf=!0,this.Bf=setTimeout(()=>{this.Lf()},3e4)}qf(e,t,n){var r;if(this.bf&&!this._f&&t.length!==0)if(!((r=this.zl)===null||r===void 0)&&r.canCapture){if(n>this.mf.length){this._f=!0;try{this.mf.push({level:e,args:t,occurredAtMs:Date.now(),context:this.hf()})}finally{this._f=!1}}}else this.Lf()}Lf(){if(this.mf=[],this.bf){this.bf=!1,this.Bf&&(clearTimeout(this.Bf),this.Bf=void 0);for(const e of this.yf)e();this.yf=[]}}zf(){const e=this.mf;return this.Lf(),e}get logger(){return this.Hf||(this.Hf={trace:(e,t)=>this.captureLog({body:e,level:"trace",attributes:t}),debug:(e,t)=>this.captureLog({body:e,level:"debug",attributes:t}),info:(e,t)=>this.captureLog({body:e,level:"info",attributes:t}),warn:(e,t)=>this.captureLog({body:e,level:"warn",attributes:t}),error:(e,t)=>this.captureLog({body:e,level:"error",attributes:t}),fatal:(e,t)=>this.captureLog({body:e,level:"fatal",attributes:t})}),this.Hf}flushLogs(e){this.zl&&(e?this.Uf(e):(this.Sf&&this.Sf.flush().catch(t=>this.Wf(t)),this.xf&&this.xf.flush().catch(t=>this.Wf(t))))}flush(){var e=this;return un(function*(){var t,n;const r=(t=e.Sf)===null||t===void 0?void 0:t.flush().catch(i=>e.Wf(i)),s=(n=e.xf)===null||n===void 0?void 0:n.flush().catch(i=>e.Wf(i));yield r,yield s})()}Wf(e){TC(e)||this.A.error("PostHog logs flush failed:",e)}loadIfEnabled(){if(this.Mi||!this.df||this.vf||this.ff)return;const e=this.Cf();if(e){this.ff=!0;try{e((t,n)=>{if(this.ff=!1,!this.Mi&&this.df)if(t||!n)this.A.error("Could not load logs script",t),this.Lf();else{const r=this.zf();this.Nf=n.initialize(this.zl),this.vf=!0,r.length>0&&n.replay(this.zl,r)}})}catch(t){throw this.ff=!1,t}}else this.Lf()}Mf(e,t){const n=this.zl;return{get isDisabled(){return!1},get optedOut(){return!n.canCapture},getPersistedProperty:r=>r===so.LogsQueue?e():void 0,setPersistedProperty(r,s){r===so.LogsQueue&&t(s??[])},Hs:r=>this.Hs(r),getLibraryId:()=>n.library.name,getLibraryVersion:()=>n.library.version}}Hs(e){return new Promise(t=>{if(QR(this.hv,3))return void t({kind:"fatal",error:k1(void 0,"logs endpoint is unreachable, dropping batch")});let n=!1;const r=o=>{n||(n=!0,clearTimeout(s),t(o))},s=setTimeout(()=>{this.A.warn("Logs request timed out before receiving a response"),r({kind:"retry-later",error:k1(void 0,"logs request timed out")})},9e4),i=this.$f;this.zl.sendRequest("/i/v1/logs",{method:"POST",query:{token:this.zl.projectToken},body:e,compression:"best-available",timeoutMs:6e4}).then(o=>{var c;const u=o.statusCode;this.Vf(u,i),u>=200&&300>u?r({kind:"ok"}):u===413?r({kind:"too-large"}):u!==0&&u!==408&&u!==429&&500>u?r({kind:"fatal",error:new Error(`logs request failed with status ${u}`)}):u===0?(o.error||this.A.warn("Logs request failed before receiving an HTTP response"),r({kind:"retry-later",error:k1(o.error,"logs request failed before receiving an HTTP response")})):r({kind:"retry-later",error:(c=o.error)!==null&&c!==void 0?c:new Error(`logs request failed with status ${u}`)})},o=>{r({kind:"retry-later",error:o})})})}Vf(e,t){(e!==0||t)&&(this.hv=XR(e,this.hv,3,()=>this.A.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.")))}Uf(e){this.Sc.length>0&&this.Gf(e,this.Sc,this.Rf,this.zl.library.name,t=>{this.Sc=t}),this.pf.length>0&&this.Gf(e,this.pf,this.Ff,AC,t=>{this.pf=t})}Gf(e,t,n,r,s){if(t.length===0)return;const i=t.map(c=>c.record);s([]);const o=fR(i,dR(n,this.zl.library.name,this.zl.library.version),r,this.zl.library.version);this.zl.sendRequest("/i/v1/logs",{method:"POST",query:{token:this.zl.projectToken},body:o,compression:"best-available",transport:e,timeoutMs:6e4}).catch(c=>this.Wf(c))}};const D0=xn("[NetworkMetrics]"),Cz={"http:":80,"https:":443},Pz=new Set(["CONNECT","DELETE","GET","HEAD","OPTIONS","PATCH","POST","PUT","TRACE"]),FI=(e,t)=>{var n;const r=String(t);return{method:String(e).toUpperCase(),url:((n=yo(r))===null||n===void 0?void 0:n.href)||r}},fw=(e,t,n,r,s,i,o=!1)=>{try{var c,u;const d=s();if(!d)return;const f=n||void 0,p=fh()-r,m=yo(t.url);if(m&&m.protocol!=="http:"&&m.protocol!=="https:")return;const v={url:(m==null?void 0:m.href)||t.url,method:t.method},_=Mn(d.name)?d.name(v):dt(d.name)?d.name:"http.client.request.duration";if(!_)return;const w=o&&!f?void 0:((S,E)=>S?400>S?void 0:String(S):(E==null?void 0:E.name)||"_OTHER")(f,i),b=$($($($($({},(S=>{const E=Pz.has(S)?S:"_OTHER";return $({"http.request.method":E},E==="_OTHER"&&S!==E?{"http.request.method_original":S}:{})})(v.method)),m?(S=>{return{"server.address":S.hostname.startsWith("[")&&S.hostname.endsWith("]")?S.hostname.slice(1,-1):S.hostname,"server.port":Number(S.port)||Cz[S.protocol],"url.scheme":S.protocol.slice(0,-1),"url.template":(E=S.pathname,E.split("/").map(C=>(A=>/^\d+$/.test(A)||A.length>=8&&/^[0-9a-f-]*\d[0-9a-f-]*$/i.test(A))(C)?":id":C).join("/"))};var E})(m):{}),f?{"http.response.status_code":f}:{}),w?{"error.type":w}:{}),(c=d.attributes)===null||c===void 0?void 0:c.call(d,v,{status:f,durationMs:p}));(u=e.metrics)===null||u===void 0||u.histogram(_,p,{unit:"ms",attributes:b})}catch(d){D0.error("Failed to record network metric",d)}},jI=()=>{},Az=(e,t)=>Mn(le==null?void 0:le.fetch)?rd(le,"fetch",n=>function(...r){const s=fh(),i=n.apply(this,r);if(!t())return i;try{var o,c,u;const[d,f]=r,p=FI((o=(c=f==null?void 0:f.method)!==null&&c!==void 0?c:d==null?void 0:d.method)!==null&&o!==void 0?o:"GET",(u=d==null?void 0:d.url)!==null&&u!==void 0?u:d);return i.then(m=>(fw(e,p,m==null?void 0:m.status,s,t,void 0,!0),m),m=>{throw fw(e,p,void 0,s,t,m),m})}catch(d){return D0.error("Failed to observe fetch",d),i}}):jI,Tz=(e,t)=>{var n;const r=le==null||(n=le.XMLHttpRequest)===null||n===void 0?void 0:n.prototype;if(!r)return jI;const s=new WeakMap,i=rd(r,"open",c=>function(...u){try{fI.has(this)||s.set(this,FI(u[0],u[1]))}catch(d){D0.error("Failed to observe XHR open",d)}return c.apply(this,u)}),o=rd(r,"send",c=>function(...u){let d;try{const f=s.get(this);if(f&&t()){const p=fh();d=()=>{this.removeEventListener("loadend",d),fw(e,f,this.status,p,t)},Lt(this,"loadend",d)}}catch(f){D0.error("Failed to observe XHR send",f)}try{return c.apply(this,u)}catch(f){throw d&&this.removeEventListener("loadend",d),f}});return()=>{i(),o()}},RC=new WeakMap,Rz=new Set(["$comment","$defs","$id","$schema","additionalProperties","default","definitions","deprecated","description","examples","minProperties","properties","readOnly","required","title","type","writeOnly"]),Iz={maxStringLength:2048,truncationSuffix:"..."},Oz={maxStringLength:2048,truncationSuffix:"..."};function IC(e){if(e)return e===!0?{intent:!0,model:!0}:{intent:e.intent!==!1,model:e.model!==!1}}function C1(e,t){return{}.hasOwnProperty.call(e,t)}function P1(e,t){const n=Object.create(e);return t&&Object.defineProperty(n,"inputSchema",{configurable:!0,enumerable:!0,writable:!0,value:t}),n}function OC(e,t,n=!1){if(!dt(e))return;const r=e.trim();return r?(n?oR(r,Iz):r).slice(0,t):void 0}function MC(e){try{return lt(e)&&e.isError===!0}catch{return!1}}function zI(e){return oR(e||"Unknown error",Oz).slice(0,2048)}function Mz(e,t){try{return zI(t?(function(n){try{return!lt(n)||!He(n.content)?void 0:n.content.filter(r=>lt(r)&&r.type==="text"&&dt(r.text)).map(r=>r.text).join(" ").trim()||void 0}catch{return}})(e):lt(e)&&dt(e.message)?e.message:dt(e)?e:String(e))}catch{return"Unknown error"}}function Nz(e,t,n){return t.errorResult?[{type:"Error",value:n,mechanism:{type:"generic",handled:!0,synthetic:!0,exception_id:0}}]:e.buildProperties(t.error,{handled:!0}).$exception_list.map(r=>$($({},r),{},{value:zI(r.value)}))}function Lz(e,t){if(t)return"Error";try{if(!lt(e))return"Error";let n=dt(e.name)?e.name.trim():"";const r=e.constructor;return n&&n!=="Error"||!Mn(r)||r.name==="Error"||(n=r.name),(n||"Error").slice(0,256)}catch{return"Error"}}function $z(e,t){return{message:Mz(e,t),type:Lz(e,t)}}Xf.__defaultExtensionClasses=$({},((...e)=>mn({},...e))({featureFlags:um},{sessionRecording:class{get Nr(){return this._instance.config}get Wc(){return this._instance.persistence}get started(){var e;return!!(!((e=this.Qf)===null||e===void 0)&&e.isStarted)}get status(){var e,t;return this.Jf==="awaiting_config"||this.Jf==="missing_config"?this.Jf:(e=(t=this.Qf)===null||t===void 0?void 0:t.status)!==null&&e!==void 0?e:this.Jf}constructor(e){if(this._instance=e,this._forceAllowLocalhostNetworkCapture=!1,this.Jf=g1,this.Zf=void 0,this.Kf=!1,this.Ke=(()=>{var t,n;if(!(Ie!=null&&Ie.visibilityState)||Ie.visibilityState==="visible")return!0;const r=le==null||(t=le.performance)===null||t===void 0||(n=t.getEntriesByType)===null||n===void 0?void 0:n.call(t,"visibility-state");return!(r!=null&&r.length)||r.some(s=>s.name==="visible")})(),this.ln=()=>{var t,n;(Ie==null?void 0:Ie.visibilityState)==="visible"&&(this.Ke=!0,(t=this.Qf)===null||t===void 0||(n=t.setDocumentWasEverVisible)===null||n===void 0||n.call(t,!0))},!this._instance.sessionManager)throw $o.error("started without valid sessionManager"),new Error("[SessionRecording] started without valid sessionManager. This is a bug.");if(this.Nr.cookieless_mode==="always")throw new Error('[SessionRecording] cannot be used with cookieless_mode="always"');Ie!=null&&Ie.addEventListener&&Lt(Ie,"visibilitychange",this.ln)}initialize(){this.startIfEnabledOrStop()}dispose({discardBufferedEvents:e=!1}={}){var t;this.Kf=!0,Ie==null||(t=Ie.removeEventListener)===null||t===void 0||t.call(Ie,"visibilitychange",this.ln),e?this.Yf(!0):this.stopRecording()}get Xf(){var e;const t=!!(!((e=this._instance.get_property("$session_recording_remote_config"))===null||e===void 0)&&e.enabled),n=!this.Nr.disable_session_recording,r=this.Nr.disable_session_recording||this._instance.consent.isOptedOut();return le&&t&&n&&!r}startIfEnabledOrStop(e){var t;if(this.Kf||this.Xf&&(!((t=this.Qf)===null||t===void 0)&&t.isStarted))return;const n=!ce(Object.assign)&&!ce(Array.from);this.Xf&&n?(this.tp(e),$o.info("starting")):(this.Jf=g1,this.stopRecording())}tp(e){var t,n;if(this.Xf)if(this.Jf!=="awaiting_config"&&this.Jf!=="missing_config"&&(this.Jf=Q6),(et==null||(t=et.__PosthogExtensions__)===null||t===void 0||(t=t.rrweb)===null||t===void 0?void 0:t.record)&&((n=et.__PosthogExtensions__)===null||n===void 0?void 0:n.initSessionRecording))this.ep(e);else{var r,s;const i=this._instance.sessionManager;(r=et.__PosthogExtensions__)===null||r===void 0||(s=r.loadExternalDependency)===null||s===void 0||s.call(r,this._instance,this.np,o=>{if(!this.Kf&&this.Xf&&this._instance.sessionManager===i)return o?(this._instance.register_for_session({$sdk_debug_recording_script_not_loaded:!0}),$o.error("could not load recorder",o)):void this.ep(e);this.Jf="disabled"})}}stopRecording(){var e,t;(e=this.Zf)===null||e===void 0||e.call(this),this.Zf=void 0,(t=this.Qf)===null||t===void 0||t.stop()}Yf(e=!1){var t,n;(t=this.Zf)===null||t===void 0||t.call(this),this.Zf=void 0,(n=this.Qf)===null||n===void 0||n.discard({discardProducerEvents:e})}sp(){var e,t;(e=this.Wc)===null||e===void 0||e.unregister("$session_is_sampled"),(t=this.Wc)===null||t===void 0||t.unregister("$replay_sample_rate")}rp(e,t){if(ot(e))return null;const n=Fn(e)?e:parseFloat(e);return typeof(r=n)!="number"||!Number.isFinite(r)||0>r||r>1?($o.warn(`${t} must be between 0 and 1. Ignoring invalid value:`,e),null):n;var r}op(e){if(this.Wc){var t,n;const r=this.Wc,s=()=>{var i;const o=e.sessionRecording===!1?void 0:e.sessionRecording,c=this.rp((i=this.Nr.session_recording)===null||i===void 0?void 0:i.sampleRate,"session_recording.sampleRate"),u=this.rp(o==null?void 0:o.sampleRate,"remote config sampleRate"),d=c??u;ot(d)&&this.sp();const f=o==null?void 0:o.minimumDurationMilliseconds;r.register({[Wf]:$($({cache_timestamp:Date.now(),enabled:!!o},o),{},{networkPayloadCapture:$({capturePerformance:e.capturePerformance},o==null?void 0:o.networkPayloadCapture),canvasRecording:{enabled:o==null?void 0:o.recordCanvas,fps:o==null?void 0:o.canvasFps,quality:o==null?void 0:o.canvasQuality},sampleRate:d,minimumDurationMilliseconds:ce(f)?null:f,endpoint:o==null?void 0:o.endpoint,triggerMatchType:o==null?void 0:o.triggerMatchType,masking:o==null?void 0:o.masking,urlTriggers:o==null?void 0:o.urlTriggers,version:o==null?void 0:o.version,triggerGroups:o==null?void 0:o.triggerGroups})})};s(),(t=this.Zf)===null||t===void 0||t.call(this),this.Zf=(n=this._instance.sessionManager)===null||n===void 0?void 0:n.onSessionId(s)}}onRemoteConfig(e){const t=e.ok?e.config:void 0;return t&&"sessionRecording"in t?t.sessionRecording===!1?(this.op(t),void this.Yf()):(this.op(t),void this.startIfEnabledOrStop()):(this.Jf==="awaiting_config"&&(this.Jf="missing_config",this._instance.register_for_session({[ub]:!0}),$o.warn("config refresh failed, recording will not start until page reload")),void this.startIfEnabledOrStop())}log(e,t="log"){var n;!((n=this.Qf)===null||n===void 0)&&n.log?this.Qf.log(e,t):$o.warn("log called before recorder was ready")}get np(){var e,t;const n=(e=this._instance)===null||e===void 0||(e=e.persistence)===null||e===void 0?void 0:e.get_property(Wf);return(n==null||(t=n.scriptConfig)===null||t===void 0?void 0:t.script)||"lazy-recorder"}lp(){const e=this._instance.get_property(Wf);if(!e)return!1;let t;try{t=typeof e=="object"?e:JSON.parse(e)}catch(n){return $o.warn("persisted remote config for session recording is invalid and will be ignored",n),!1}return!ot(t.cache_timestamp)&&36e5>=Date.now()-t.cache_timestamp}ep(e){var t,n,r;if(!this.Kf&&this.Xf&&this._instance.sessionManager){if(!(!((t=et.__PosthogExtensions__)===null||t===void 0)&&t.initSessionRecording))return $o.warn("Called on script loaded before session recording is available. This can be caused by adblockers."),void this._instance.register_for_session({[cb]:!0});var s;if(this.Qf||(this.Qf=(s=et.__PosthogExtensions__)===null||s===void 0?void 0:s.initSessionRecording(this._instance,this.Ke),this.Qf._forceAllowLocalhostNetworkCapture=this._forceAllowLocalhostNetworkCapture),!this.lp())return this.Jf==="missing_config"||this.Jf==="awaiting_config"?void 0:(this.Jf="awaiting_config",$o.info("persisted remote config is stale, requesting fresh config before starting"),void new oI(this._instance).load());this.Jf=Q6,(n=(r=this.Qf).setDocumentWasEverVisible)===null||n===void 0||n.call(r,this.Ke),this.Qf.start(e)}else this.Jf=g1}onRRwebEmit(e){var t,n;(t=this.Qf)===null||t===void 0||(n=t.onRRwebEmit)===null||n===void 0||n.call(t,e)}overrideLinkedFlag(){var e,t;this.Qf||(t=this.Wc)===null||t===void 0||t.register({$replay_override_linked_flag:!0}),(e=this.Qf)===null||e===void 0||e.overrideLinkedFlag()}overrideSampling(){var e,t;this.Qf||(t=this.Wc)===null||t===void 0||t.register({$replay_override_sampling:!0}),(e=this.Qf)===null||e===void 0||e.overrideSampling()}overrideTrigger(e){var t,n;this.Qf||(n=this.Wc)===null||n===void 0||n.register({[e==="url"?"$replay_override_url_trigger":"$replay_override_event_trigger"]:!0}),(t=this.Qf)===null||t===void 0||t.overrideTrigger(e)}get sdkDebugProperties(){var e;const t={};for(const r of L7){var n;const s=(n=this._instance.sessionPersistence)===null||n===void 0?void 0:n.get_property(r);ce(s)||(t[r]=s)}return $($({},t),((e=this.Qf)===null||e===void 0?void 0:e.sdkDebugProperties)||{$recording_status:this.status})}tryAddCustomEvent(e,t){var n;return!!(!((n=this.Qf)===null||n===void 0)&&n.tryAddCustomEvent(e,t))}flushBeforeIdentityReset(){var e,t;(e=this.Qf)===null||e===void 0||(t=e.flushBeforeIdentityReset)===null||t===void 0||t.call(e)}}},{autocapture:class extends y7{constructor(e){super(new I7(e)),this.instance=e}},historyAutocapture:class{constructor(e){this.ap=!1,this._instance=e,this.up=this.cp()}initialize(){this.startIfEnabled()}get isEnabled(){const e=this.hp();return!!(e.path||e.search||this.dp(e))}startIfEnabled(){this.isEnabled&&(me.info("History API monitoring enabled, starting..."),this.monitorHistoryChanges())}startIfEnabledOrStop(){this.stop(),this.up=this.cp(),this.startIfEnabled()}stop(){this.vp&&this.vp(),this.vp=void 0,this.fp&&this.fp(),this.fp=void 0,me.info("History API monitoring stopped")}monitorHistoryChanges(){le&&le.history&&(this.pp("pushState"),this.pp("replaceState"),this.gp(),this.dp()&&this.mp())}pp(e){var t;if(!le||!((t=le.history[e])===null||t===void 0)&&t.__posthog_wrapped__)return;const n=this;rd(le.history,e,r=>function(s,i,o){var c;n.yp(o)&&n.bp(),r.call(this,s,i,o),n._p(e,!n.ap&&(le==null||(c=le.event)===null||c===void 0?void 0:c.type)!=="popstate")})}cp(){const e=le==null?void 0:le.location;if(e!=null&&e.pathname)return{pathname:e.pathname,search:e.search,hash:e.hash}}hp(){const e=this._instance.config.capture_pageview;return e==="history_change"?{path:!0}:lt(e)?e:{}}dp(e=this.hp()){return!!e.hash&&!this._instance.config.disable_capture_url_hashes}wp(e){const t=this.hp(),n=this.up;return!(!n||!(t.path&&e.pathname!==n.pathname||t.search&&e.search!==n.search||this.dp(t)&&e.hash!==n.hash))}_p(e,t=!1){try{t||this.bp();const n=this.cp();if(!n)return;if(this.wp(n)){const r=()=>this._instance.capture(db,{navigation_type:e});t?(this.kp=r,Promise.resolve().then(()=>this.bp())):r()}this.up=n}catch(n){me.error(`Error capturing ${e} pageview`,n)}}yp(e){var t,n;return!(ot(e)||!le)&&((t=yo(String(e)))===null||t===void 0?void 0:t.href)!==((n=le.location)===null||n===void 0?void 0:n.href)}bp(){const e=this.kp;if(e){this.kp=void 0,this.ap=!0;try{e()}catch(t){me.error("Error capturing deferred pageview",t)}finally{this.ap=!1}this.up=this.cp()}}gp(){if(this.vp)return;const e=()=>{this._p("popstate")};Lt(le,"popstate",e),this.vp=()=>{le&&le.removeEventListener("popstate",e)}}mp(){if(this.fp)return;const e=()=>{this._p("hashchange")};Lt(le,"hashchange",e),this.fp=()=>{le&&le.removeEventListener("hashchange",e)}}},heatmaps:class{get Nr(){return this.instance.config}constructor(e){var t;this.Sp=!1,this.Ca=!1,this.xp=null,this.instance=e,this.Sp=!!(!((t=this.instance.persistence)===null||t===void 0)&&t.props[G_]),this.rageclicks=new RI(e.config.rageclick)}initialize(){this.startIfEnabled()}get flushIntervalMilliseconds(){let e=5e3;return lt(this.Nr.capture_heatmaps)&&this.Nr.capture_heatmaps.flush_interval_milliseconds&&(e=this.Nr.capture_heatmaps.flush_interval_milliseconds),e}get isEnabled(){return ot(this.Nr.capture_heatmaps)?ot(this.Nr.enable_heatmaps)?this.Sp:this.Nr.enable_heatmaps:this.Nr.capture_heatmaps!==!1}startIfEnabled(){if(this.isEnabled){if(this.Ca)return;$7.info("starting..."),this.$p(),this.ln()}else{var e;clearInterval((e=this.xp)!==null&&e!==void 0?e:void 0),this.Cp(),this.getAndClearBuffer()}}onRemoteConfig(e){if(!e.ok)return;const t=e.config;if(!("heatmaps"in t))return;const n=!!t.heatmaps;this.instance.persistence&&this.instance.persistence.register({[G_]:n}),this.Sp=n,this.startIfEnabled()}getAndClearBuffer(){const e=this.At;return this.At=void 0,e}Tp(e){v1(e.originalEvent)&&this.Fr(e.originalEvent,"deadclick")}ln(){this.xp&&clearInterval(this.xp),this.xp=(Ie==null?void 0:Ie.visibilityState)==="visible"?setInterval(this.Ac.bind(this),this.flushIntervalMilliseconds):null}$p(){le&&Ie&&(this.Ip=this.Ac.bind(this),Lt(le,T0,this.Ip),this.Mp=e=>this.Fr(e||(le==null?void 0:le.event)),Lt(Ie,"click",this.Mp,{capture:!0}),this.Ep=e=>this.Ap(e||(le==null?void 0:le.event)),Lt(Ie,"mousemove",this.Ep,{capture:!0}),this.Rp=new E6(this.instance,Mj,this.Tp.bind(this)),this.Rp.startIfEnabledOrStop(),this.Pp=this.ln.bind(this),Lt(Ie,Ru,this.Pp),this.Ca=!0)}Cp(){var e;le&&Ie&&(this.Ip&&le.removeEventListener(T0,this.Ip),this.Mp&&Ie.removeEventListener("click",this.Mp,{capture:!0}),this.Ep&&Ie.removeEventListener("mousemove",this.Ep,{capture:!0}),this.Pp&&Ie.removeEventListener(Ru,this.Pp),clearTimeout(this.Op),(e=this.Rp)===null||e===void 0||e.stop(),this.Ca=!1)}Fp(e,t){const n=this.instance.scrollManager.scrollY(),r=this.instance.scrollManager.scrollX(),s=this.instance.scrollManager.scrollElement(),i=(function(o,c,u){let d=o;for(;d&&pi(d)&&!Xn(d,"body");){if(d===u)return!1;let v;try{var f,p,m;v=(f=(p=(m=d.ownerDocument)===null||m===void 0?void 0:m.defaultView)!==null&&p!==void 0?p:le)===null||f===void 0?void 0:f.getComputedStyle(d).position}catch{return!1}if(We(c,v))return!0;d=UR(d)}return!1})(Gf(e),["fixed","sticky"],s);return{x:e.clientX+(i?0:r),y:e.clientY+(i?0:n),target_fixed:i,type:t}}Fr(e,t="click"){var n;if(h6(e.target)||!v1(e))return;const r=this.Fp(e,t);!((n=this.rageclicks)===null||n===void 0)&&n.isRageClick(e.clientX,e.clientY,new Date().getTime())&&BR(Gf(e),this.instance.config.rageclick)&&this.So($($({},r),{},{type:"rageclick"})),this.So(r)}Ap(e){!h6(e.target)&&v1(e)&&(clearTimeout(this.Op),this.Op=setTimeout(()=>{this.So(this.Fp(e,"mousemove"))},500))}So(e){if(!le)return;const t=this.Nr.disable_capture_url_hashes?nl(le.location.href):le.location.href,n=this.Nr.custom_personal_data_properties,r=this.Nr.mask_personal_data_properties?[...td,...n||[]]:[],s=uh(t,r,dh);this.At=this.At||{},this.At[s]||(this.At[s]=[]),this.At[s].push(e)}Ac(){this.At&&!Ps(this.At)&&this.instance.capture("$$heatmap",{$heatmap_data:this.getAndClearBuffer()})}},deadClicksAutocapture:E6,webVitalsAutocapture:class{constructor(e){var t;this._instance=e,this.Sp=!1,this.Ca=!1,this.At={navigationKey:void 0,url:void 0,metrics:[],firstMetricTimestamp:void 0},this.Dp=(n=!1)=>{clearTimeout(this.Lp),this.Lp=void 0,this.At.metrics.length!==0&&(this._instance.capture("$web_vitals",$({$current_url:this.At.url},this.At.metrics.reduce((r,s)=>$($({},r),{},{[`$web_vitals_${s.name}_event`]:$({},s),[`$web_vitals_${s.name}_value`]:s.value}),{})),n?{transport:"sendBeacon",send_instantly:!0}:void 0),this.At={navigationKey:void 0,url:void 0,metrics:[],firstMetricTimestamp:void 0})},this.Np=n=>{var r;if(this.At=this.At||{navigationKey:void 0,url:void 0,metrics:[],firstMetricTimestamp:void 0},ot(n==null?void 0:n.name)||ot(n==null?void 0:n.value))return void Vl.error("Invalid metric received",n);const s=typeof n.navigationURL=="string"?n.navigationURL:void 0,i=this.jp(s);if(ce(i))return;const o=Fn(n.navigationId)||typeof n.navigationId=="string"?`navigation:${n.navigationId}`:`url:${i}`;if(this.qp&&n.value>=this.qp)return void Vl.error("Ignoring metric with value >= "+this.qp,n);this.At.navigationKey!==o&&(this.Dp(),this.Lp=setTimeout(this.Dp,this.flushToCaptureTimeoutMs)),ce(this.At.navigationKey)&&(this.At.navigationKey=o,this.At.url=i),this.At.firstMetricTimestamp=ce(this.At.firstMetricTimestamp)?Date.now():this.At.firstMetricTimestamp;const c=(r=this._instance.sessionManager)===null||r===void 0?void 0:r.checkAndGetSessionAndWindowId(!0),u=$($($({},n),s?{navigationURL:i}:{}),{},{$current_url:i,timestamp:Date.now()});if(delete u.entries,lt(n.attribution)&&this.attributionMetrics.indexOf(n.name)>-1){const d={};for(const f of N7){const p=f==="url"&&typeof n.attribution[f]=="string"?this.jp(n.attribution[f]):n.attribution[f];ce(p)||(d[f]=p)}u.attribution=d}else delete u.attribution;ce(c)||(u.$session_id=c.sessionId,u.$window_id=c.windowId),this.At.metrics.push(u),this.At.metrics.length===this.allowedMetrics.length&&this.Dp()},this.Bp=()=>{if(this.Ca)return;let n,r,s,i,o=!1;const c=et.__PosthogExtensions__,u=c==null?void 0:c.postHogWebVitalsCallbacksByFlavor,d=(u==null?void 0:u[this.zp])||(this.zp==="web-vitals"&&ce(u)?c==null?void 0:c.postHogWebVitalsCallbacks:void 0);if(!ce(d)){const v=d.withoutAttribution,_=this.attributionMetrics;o=!ce(v),n=_.indexOf("LCP")>-1?d.onLCP:(v==null?void 0:v.onLCP)||d.onLCP,r=_.indexOf("CLS")>-1?d.onCLS:(v==null?void 0:v.onCLS)||d.onCLS,s=_.indexOf("FCP")>-1?d.onFCP:(v==null?void 0:v.onFCP)||d.onFCP,i=_.indexOf("INP")>-1?d.onINP:(v==null?void 0:v.onINP)||d.onINP}if(!(n&&r&&s&&i))return void Vl.error("web vitals callbacks not loaded - not starting");const f={reportSoftNavs:this.useSoftNavs},p=o&&this.attributionMetrics.indexOf("INP")>-1?$($({},f),{},{includeProcessedEventEntries:!1}):f;this.allowedMetrics.indexOf("LCP")>-1&&n(this.Np.bind(this),f),this.allowedMetrics.indexOf("CLS")>-1&&r(this.Np.bind(this),f),this.allowedMetrics.indexOf("FCP")>-1&&s(this.Np.bind(this),f),this.allowedMetrics.indexOf("INP")>-1&&i(this.Np.bind(this),p);const m=le==null?void 0:le.document;Lt(m,Ru,()=>{(m==null?void 0:m.visibilityState)==="hidden"&&this.Dp(!0)}),Lt(le,"pagehide",()=>this.Dp(!0)),this.Ca=!0},this.Sp=!!(!((t=this._instance.persistence)===null||t===void 0)&&t.props[Q_]),this.startIfEnabled()}get Hp(){return this._instance.config.capture_performance}get allowedMetrics(){var e,t;const n=lt(this.Hp)?(e=this.Hp)===null||e===void 0?void 0:e.web_vitals_allowed_metrics:void 0;return ot(n)?((t=this._instance.persistence)===null||t===void 0?void 0:t.props.$web_vitals_allowed_metrics)||Y6:n}get flushToCaptureTimeoutMs(){return(lt(this.Hp)?this.Hp.web_vitals_delayed_flush_ms:void 0)||5e3}get attributionMetrics(){const e=lt(this.Hp)?this.Hp.web_vitals_attribution:void 0;return hs(e)?e?Y6:[]:He(e)?e:M7}get useAttribution(){return this.attributionMetrics.length>0}get useSoftNavs(){const e=lt(this.Hp)?this.Hp.__preview_web_vitals_soft_navs:void 0;return e!=null&&e}get qp(){const e=lt(this.Hp)&&Fn(this.Hp.__web_vitals_max_value)?this.Hp.__web_vitals_max_value:q6;return e>0&&6e4>=e?q6:e}get isEnabled(){const e=cn==null?void 0:cn.protocol;if(e!=="http:"&&e!=="https:")return Vl.info("Web Vitals are disabled on non-http/https protocols"),!1;const t=lt(this.Hp)?this.Hp.web_vitals:hs(this.Hp)?this.Hp:void 0;return hs(t)?t:this.Sp}startIfEnabled(){this.isEnabled&&!this.Ca&&(Vl.info("enabled, starting..."),this.Ga(this.Bp))}onRemoteConfig(e){if(!e.ok)return;const t=e.config;if(!("capturePerformance"in t))return;const n=lt(t.capturePerformance)&&!!t.capturePerformance.web_vitals,r=lt(t.capturePerformance)?t.capturePerformance.web_vitals_allowed_metrics:void 0;this._instance.persistence&&(this._instance.persistence.register({[Q_]:n}),this._instance.persistence.register({[wR]:r})),this.Sp=n,this.startIfEnabled()}get zp(){return this.useSoftNavs?this.useAttribution?"web-vitals-with-attribution-soft-navs":"web-vitals-soft-navs":this.useAttribution?"web-vitals-with-attribution":"web-vitals"}Ga(e){var t;const n=et.__PosthogExtensions__,r=this.zp,s=n==null?void 0:n.postHogWebVitalsCallbacksByFlavor;s!=null&&s[r]||r==="web-vitals"&&ce(s)&&(n!=null&&n.postHogWebVitalsCallbacks)?e():n==null||(t=n.loadExternalDependency)===null||t===void 0||t.call(n,this._instance,r,i=>{i?Vl.error("failed to load script",i):e()})}jp(e){const t=e||(le==null?void 0:le.location.href);if(!t)return void Vl.error("Could not determine current URL");const n=this._instance.config.disable_capture_url_hashes?nl(t):t,r=this._instance.config.custom_personal_data_properties,s=this._instance.config.mask_personal_data_properties?[...td,...r||[]]:[];return uh(n,s,dh)}}},{exceptionObserver:class{constructor(e){var t;this.Bp=()=>{var n;if(!le||!this.isEnabled||!(!((n=et.__PosthogExtensions__)===null||n===void 0)&&n.errorWrappingFunctions))return;const r=et.__PosthogExtensions__.errorWrappingFunctions.wrapOnError,s=et.__PosthogExtensions__.errorWrappingFunctions.wrapUnhandledRejection,i=et.__PosthogExtensions__.errorWrappingFunctions.wrapConsoleError;try{!this.Up&&this.Nr.capture_unhandled_errors&&(this.Up=r(this.captureException.bind(this))),!this.Wp&&this.Nr.capture_unhandled_rejections&&(this.Wp=s(this.captureException.bind(this))),!this.Vp&&this.Nr.capture_console_errors&&(this.Vp=i(this.captureException.bind(this)))}catch(o){bf.error("failed to start",o),this.Gp()}},this._instance=e,this.Qp=!!(!((t=this._instance.persistence)===null||t===void 0)&&t.props[q_]),this.kt=new S9($($({},(function(n={}){var r,s,i,o;return{refillRate:(r=(s=n.exceptionRateLimiterRefillRate)!==null&&s!==void 0?s:n.__exceptionRateLimiterRefillRate)!==null&&r!==void 0?r:1,bucketSize:(i=(o=n.exceptionRateLimiterBucketSize)!==null&&o!==void 0?o:n.__exceptionRateLimiterBucketSize)!==null&&i!==void 0?i:10}})(this._instance.config.error_tracking)),{},{refillInterval:1e4,A:bf})),this.Nr=this.Jp(),this.startIfEnabledOrStop()}Jp(){const e=this._instance.config.capture_exceptions;let t={capture_unhandled_errors:!1,capture_unhandled_rejections:!1,capture_console_errors:!1};return lt(e)?t=$($({},t),e):(ce(e)?this.Qp:e)&&(t=$($({},t),{},{capture_unhandled_errors:!0,capture_unhandled_rejections:!0})),t}get isEnabled(){return this.Nr.capture_console_errors||this.Nr.capture_unhandled_errors||this.Nr.capture_unhandled_rejections}startIfEnabledOrStop(){this.isEnabled?(bf.info("enabled"),this.Gp(),this.Ga(this.Bp)):this.Gp()}Ga(e){var t,n,r;!((t=et.__PosthogExtensions__)===null||t===void 0)&&t.errorWrappingFunctions?e():(n=et.__PosthogExtensions__)===null||n===void 0||(r=n.loadExternalDependency)===null||r===void 0||r.call(n,this._instance,"exception-autocapture",s=>{if(s)return bf.error("failed to load script",s);e()})}Gp(){var e,t,n;(e=this.Up)===null||e===void 0||e.call(this),this.Up=void 0,(t=this.Wp)===null||t===void 0||t.call(this),this.Wp=void 0,(n=this.Vp)===null||n===void 0||n.call(this),this.Vp=void 0}onRemoteConfig(e){if(!e.ok)return;const t=e.config;"autocaptureExceptions"in t&&(this.Qp=!!t.autocaptureExceptions||!1,this._instance.persistence&&this._instance.persistence.register({[q_]:this.Qp}),this.Nr=this.Jp(),this.startIfEnabledOrStop())}onConfigChange(){this.Nr=this.Jp()}captureException(e){try{var t,n,r;const s=(t=e==null||(n=e.$exception_list)===null||n===void 0||(n=n[0])===null||n===void 0?void 0:n.type)!==null&&t!==void 0?t:"Exception";if(this.kt.consumeRateLimit(s))return void bf.info("Skipping exception capture because of client rate limiting.",{exception:s});(r=this._instance.exceptions)===null||r===void 0||r.sendExceptionEvent(e)}catch{}}},exceptions:class{constructor(e){var t,n;this.Zp=[],this.Kp=new N9([new q9,new sF,new Q9,new Y9,new nF,new tF,new J9,new rF],(function(r,...s){return(i,o=0)=>{const c=[],u=i.split(`
|
|
21
|
+
`),d=Math.min(u.length,o+1e3),f=[];for(let v=o;d>v;v++){const _=u[v];if(_.length>1024)continue;const w=Zk.test(_)?_.replace(Zk,"$1"):_;if(!w.match(/\S*Error: /)){for(const b of s){const S=b(w,r);if(S){c.push(S);const E=B9(c);if(E){for(let C=f.length-1;C>=0;C--){const A=f[C];if(E.start>=A.start+A.length)break;f.pop()}f.push(E)}break}}if(K9(c,f)>=50)break}}const p=[...f].sort((v,_)=>_.start-v.start),m=p[p.length-1];if(m){const v=QT(c,m);c.splice(m.start-v,v);for(const _ of p)_.start-=v}for(const v of p)W9(c,v);return f.some(v=>v.start===0&&c.length===v.length)&&(function(v){const _=v.map(b=>`${b.function}|${b.filename}|${b.lineno}|${b.colno}|${b.module}`);let w=0;for(let b=1;_.length>b;b++)G9(_,b,w)&&(w=b);v.push(...v.splice(0,w))})(c),(function(v){if(!v.length)return[];const _=Array.from(v);return _.reverse(),_.slice(0,50).map(w=>{return $($({},w),{},{filename:w.filename||(b=_,b[b.length-1]||{}).filename,function:w.function||"?"});var b})})(c)}})("web:javascript",V9,Z9)),this._instance=e,this.Zp=(t=(n=this._instance.persistence)===null||n===void 0?void 0:n.get_property("$error_tracking_suppression_rules"))!==null&&t!==void 0?t:[],this.Yp=x0(this.Xp()),this.tg=new oF(this.Yp)}onConfigChange(){this.Yp=x0(this.Xp()),this.tg.setConfig(this.Yp)}onRemoteConfig(e){var t,n,r;if(!e.ok)return;const s=e.config;if(!("errorTracking"in s))return;const i=(t=(n=s.errorTracking)===null||n===void 0?void 0:n.suppressionRules)!==null&&t!==void 0?t:[],o=(r=s.errorTracking)===null||r===void 0?void 0:r.captureExtensionExceptions;this.Zp=i,this._instance.persistence&&this._instance.persistence.register({[yR]:this.Zp,[Y_]:o})}get eg(){var e;const t=!!this._instance.get_property(Y_),n=this._instance.config.error_tracking.captureExtensionExceptions;return(e=n??t)!==null&&e!==void 0&&e}buildProperties(e,t){return this.Kp.buildFromUnknown(e,{syntheticException:t==null?void 0:t.syntheticException,mechanism:{handled:t==null?void 0:t.handled}})}addExceptionStep(e,t){if(this.Yp.enabled)try{if(!dt(e)||e.trim().length===0)return void Ti.warn("Ignoring exception step because message must be a non-empty string");const{sanitizedProperties:n,droppedKeys:r}=(function(s){if(!s)return{sanitizedProperties:{},droppedKeys:[]};const i=[];return{sanitizedProperties:Object.keys(s).reduce((o,c)=>iF.has(c)?(i.push(c),o):(o[c]=s[c],o),{}),droppedKeys:i}})(this.ig(t));r.length>0&&Ti.warn("Ignoring reserved exception step fields",{droppedKeys:r}),this.tg.add($({[w0]:e,[b0]:new Date().toISOString()},n))}catch(n){Ti.error("Failed to add exception step. Ignoring breadcrumb.",n)}}sendExceptionEvent(e){try{const t=e.$exception_list;if(this.ng(t)){if(this.sg(t))return this.rg("Exception dropped: matched a suppression rule"),void Ti.info("Skipping exception capture because a suppression rule matched");if(!this.eg&&this.og(t))return this.rg("Exception dropped: thrown by a browser extension"),void Ti.info("Skipping exception capture because it was thrown by an extension");if(!this.eg&&this.lg(t))return this.rg("Exception dropped: thrown by an injected browser script"),void Ti.info("Skipping exception capture because it was thrown by an injected browser script");if(!this._instance.config.error_tracking.__capturePostHogExceptions&&this.ag(t))return this.rg("Exception dropped: thrown by the PostHog SDK"),void Ti.info("Skipping exception capture because it was thrown by the PostHog SDK")}const n=this.Yp.enabled&&ot(e.$exception_steps)?this.ug(e):e,r=(function(){if("u">typeof process){var s;const o=(s=h9.POSTHOG_RELEASE_ID)===null||s===void 0?void 0:s.trim();if(o)return o}const i=globalThis._posthogReleaseId;return typeof i=="string"&&i.length>0?i:void 0})();r&&(n.$release_id=r);try{const s=this._instance.capture("$exception",n,{_noTruncate:!0,_batchKey:"exceptionEvent",Fd:!0});return s&&this.tg.clear(),s}catch(s){return lC(s)||Ti.error("Failed to capture exception event. Dropping this exception.",s),void this.tg.clear()}}catch(t){return void(lC(t)||Ti.error("Failed to process exception event. Ignoring this exception.",t))}}ug(e){try{const t=this.tg.getAttachable();return t.length===0?e:$($({},e),{},{$exception_steps:t})}catch(t){return Ti.error("Failed to read buffered exception steps. Capturing exception without steps.",t),e}}rg(e){this.Yp.enabled&&this.tg.add({[w0]:e,[b0]:new Date().toISOString()})}ig(e){return lt(e)?$({},e):{}}Xp(){var e,t;return(e=(t=this._instance.config.error_tracking)===null||t===void 0?void 0:t.exception_steps)!==null&&e!==void 0?e:{}}sg(e){if(e.length===0)return!1;try{const t=e.reduce((n,{type:r,value:s})=>(dt(r)&&r.length>0&&n.$exception_types.push(r),dt(s)&&s.length>0&&n.$exception_values.push(s),n),{$exception_types:[],$exception_values:[]});return this.Zp.some(n=>{const r=n.values.map(s=>{const i=PI[s.operator],o=t[s.key];if(!i||!o)return!1;const c=He(s.value)?s.value:[s.value];return c.length>0&&i(c,o)});return n.type==="OR"?r.some(Boolean):r.every(Boolean)})}catch(t){return Ti.warn("Failed to evaluate suppression rules. Capturing the exception.",t),!1}}og(e){const t=e.flatMap(r=>{var s,i;return(s=(i=r.stacktrace)===null||i===void 0?void 0:i.frames)!==null&&s!==void 0?s:[]}),n=t.filter(({filename:r})=>!!r&&q7.some(s=>r.startsWith(s)));return n.length!==0&&(!n.every(({filename:r})=>!!r&&r.startsWith(cw))||e.some(({type:r,value:s})=>r==="NoResponse"||dt(s)&&G7.some(({value:i,exact:o})=>o?s===i:s.includes(i)))&&!t.some(({in_app:r,filename:s})=>r&&!(s!=null&&s.startsWith(cw))))}lg(e){return e.some(({value:t})=>dt(t)&&Y7.some(n=>t.includes(n)))}ag(e){if(e.length>0){var t,n,r,s;const i=(t=(n=e[0].stacktrace)===null||n===void 0?void 0:n.frames)!==null&&t!==void 0?t:[],o=i[i.length-1];return(r=o==null||(s=o.filename)===null||s===void 0?void 0:s.includes("posthog.com/static"))!==null&&r!==void 0&&r}return!1}ng(e){return!ot(e)&&He(e)}}},{productTours:class{get Wc(){return this._instance.persistence}constructor(e){this.cg=null,this.hg=null,this._instance=e}initialize(){this.loadIfEnabled()}onRemoteConfig(e){if(!e.ok)return;const t=e.config;if("productTours"in t){var n,r;if(this.Wc&&this.Wc.register({[ab]:!!t.productTours}),!y1(this._instance))return!this.cg&&ot((n=this.Wc)===null||n===void 0?void 0:n.props.ph_product_tours)||cm.info("product tours disabled; stopping and clearing cached tours"),(r=this.cg)===null||r===void 0||r.stop(),this.cg=null,void this.clearCache();this.loadIfEnabled()}}loadIfEnabled(){!this.cg&&y1(this._instance)&&this.Ga(()=>this.dg())}Ga(e){var t,n,r;!((t=et.__PosthogExtensions__)===null||t===void 0)&&t.generateProductTours?e():(n=et.__PosthogExtensions__)===null||n===void 0||(r=n.loadExternalDependency)===null||r===void 0||r.call(n,this._instance,"product-tours",s=>{s?cm.error("Could not load product tours script",s):e()})}dg(){var e;!this.cg&&(!((e=et.__PosthogExtensions__)===null||e===void 0)&&e.generateProductTours)&&(this.cg=et.__PosthogExtensions__.generateProductTours(this._instance,!0))}getProductTours(e,t=!1){if(He(this.hg)&&!t)return void e(this.hg,{isLoaded:!0});const n=this.Wc;if(n){const r=n.props[X_];if(He(r)&&!t)return this.hg=r,void e(r,{isLoaded:!0})}this._instance._send_request({url:this._instance.requestRouter.endpointFor("api",`/api/product_tours/?token=${this._instance.config.token}`),method:"GET",timestampMode:"query",callback:r=>{if(!y1(this._instance))return void e([],{isLoaded:!0});const s=r.statusCode;if(s!==200||!r.json){const o=`Product Tours API could not be loaded, status: ${s}`;return s===0?r.error||cm.warn(o):cm.error(o),void e([],{isLoaded:!1,error:o})}const i=He(r.json.product_tours)?r.json.product_tours:[];this.hg=i,n&&n.register({[X_]:i}),e(i,{isLoaded:!0})}})}getActiveProductTours(e){ot(this.cg)?e([],{isLoaded:!1,error:"Product tours not loaded"}):this.cg.getActiveProductTours(e)}showProductTour(e){var t;(t=this.cg)===null||t===void 0||t.showTourById(e)}previewTour(e){this.cg?this.cg.previewTour(e):this.Ga(()=>{var t;this.dg(),(t=this.cg)===null||t===void 0||t.previewTour(e)})}dismissProductTour(){var e;(e=this.cg)===null||e===void 0||e.dismissTour("user_clicked_skip")}nextStep(){var e;(e=this.cg)===null||e===void 0||e.nextStep()}previousStep(){var e;(e=this.cg)===null||e===void 0||e.previousStep()}clearCache(){var e;this.hg=null,(e=this.Wc)===null||e===void 0||e.unregister("ph_product_tours")}resetTour(e){var t;(t=this.cg)===null||t===void 0||t.resetTour(e)}resetAllTours(){var e;(e=this.cg)===null||e===void 0||e.resetAllTours()}cancelPendingTour(e){var t;(t=this.cg)===null||t===void 0||t.cancelPendingTour(e)}},featureFlags:um},{siteApps:class{constructor(e){this._instance=e,this.vg=0,this.fg=[],this.apps={}}get isEnabled(){return!!this._instance.config.opt_in_site_apps}pg(e,t){if(!t)return;const n=this.globalsForEvent(t);this.fg.push(n),this.fg.length>1e3&&(this.fg=this.fg.slice(10))}get siteAppLoaders(){var e;return(e=et._POSTHOG_REMOTE_CONFIG)===null||e===void 0||(e=e[this._instance.config.token])===null||e===void 0?void 0:e.siteApps}initialize(){if(this.isEnabled){const e=this._instance._addCaptureHook(this.pg.bind(this));this.gg=()=>{e(),this.fg=[],this.gg=void 0}}}globalsForEvent(e){var t,n,r,s,i,o,c;if(!e)throw new Error("Event payload is required");const u={},d=this._instance.get_property("$groups")||[],f=this._instance.get_property("$stored_group_properties")||{};for(const[v,_]of Object.entries(f))u[v]={id:d[v],type:v,properties:_};const{$set_once:p,$set:m}=e;return{event:$($({},tR(e,D7)),{},{properties:$($($({},e.properties),m?{$set:$($({},(t=(n=e.properties)===null||n===void 0?void 0:n.$set)!==null&&t!==void 0?t:{}),m)}:{}),p?{$set_once:$($({},(r=(s=e.properties)===null||s===void 0?void 0:s.$set_once)!==null&&r!==void 0?r:{}),p)}:{}),elements_chain:(i=(o=e.properties)===null||o===void 0?void 0:o.$elements_chain)!==null&&i!==void 0?i:"",distinct_id:(c=e.properties)===null||c===void 0?void 0:c.distinct_id}),person:{properties:this._instance.get_property("$stored_person_properties")},groups:u}}mg(e){var t;const n=(t=e.tagName)===null||t===void 0?void 0:t.toLowerCase();return n==="style"&&this._instance.config.prepare_external_dependency_stylesheet?this._instance.config.prepare_external_dependency_stylesheet(e)||(Ji.error("prepare_external_dependency_stylesheet returned null"),null):n==="script"&&this._instance.config.prepare_external_dependency_script?this._instance.config.prepare_external_dependency_script(e)||(Ji.error("prepare_external_dependency_script returned null"),null):e}yg(){var e,t,n,r,s,i,o,c;if(!this._instance.config.prepare_external_dependency_stylesheet&&!this._instance.config.prepare_external_dependency_script)return()=>{};const u=Ie==null?void 0:Ie.defaultView,d=u==null||(e=u.Node)===null||e===void 0?void 0:e.prototype;if(!u||!d)return()=>{};if(this.vg++,this.bg)return this._g();const f=[],p=this,m=new WeakSet,v=(b,S,E)=>{if(!(b!=null&&b[S]))return;const C=b[S];b[S]=E(C),f.push(()=>{b[S]=C})},_=b=>{if(m.has(b))return b;const S=p.mg(b);return S&&m.add(S),S},w=b=>b.map(S=>typeof S=="string"?S:_(S)).filter(S=>!kn(S));return v(d,"appendChild",b=>function(S){const E=_(S);return E?b.call(this,E):S}),v(d,"insertBefore",b=>function(S,E){const C=_(S);return C?b.call(this,C,E):S}),v(d,"replaceChild",b=>function(S,E){const C=_(S);return C?b.call(this,C,E):E}),[(t=u.Element)===null||t===void 0?void 0:t.prototype,(n=u.Document)===null||n===void 0?void 0:n.prototype,(r=u.DocumentFragment)===null||r===void 0?void 0:r.prototype].forEach(b=>{v(b,"append",S=>function(...E){return S.apply(this,w(E))}),v(b,"prepend",S=>function(...E){return S.apply(this,w(E))})}),[(s=u.Element)===null||s===void 0?void 0:s.prototype,(i=u.CharacterData)===null||i===void 0?void 0:i.prototype,(o=u.DocumentType)===null||o===void 0?void 0:o.prototype].forEach(b=>{v(b,"before",S=>function(...E){return S.apply(this,w(E))}),v(b,"after",S=>function(...E){return S.apply(this,w(E))}),v(b,"replaceWith",S=>function(...E){const C=w(E);return E.length&&!C.length?void 0:S.apply(this,C)})}),v((c=u.Element)===null||c===void 0?void 0:c.prototype,"insertAdjacentElement",b=>function(S,E){const C=_(E);return C?b.call(this,S,C):null}),this.bg=()=>{f.forEach(b=>b()),this.bg=void 0},this._g()}_g(){let e=!1;return()=>{var t;e||(e=!0,this.vg--,this.vg===0&&((t=this.bg)===null||t===void 0||t.call(this)))}}wg(e,t=!0){const n=this.yg();try{const r=e(n);return t&&n(),r}catch(r){throw n(),r}}setupSiteApp(e){const t=this.apps[e.id],n=()=>{var i;!t.errored&&this.fg.length&&(Ji.info(`Processing ${this.fg.length} events for site app with id ${e.id}`),this.fg.forEach(o=>this.wg(()=>{var c;return(c=t.processEvent)===null||c===void 0?void 0:c.call(t,o)})),t.processedBuffer=!0),Object.values(this.apps).every(o=>o.processedBuffer||o.errored)&&((i=this.gg)===null||i===void 0||i.call(this))};let r=!1;const s=i=>{t.errored=!i,t.loaded=!0,Ji.info(`Site app with id ${e.id} ${i?"loaded":"errored"}`),r&&n()};try{const{processEvent:i}=this.wg(o=>e.init({posthog:this._instance,callback(c){o(),s(c)}}),!1);i&&(t.processEvent=i),r=!0}catch(i){Ji.error(X6+e.id,i),s(!1)}if(r&&t.loaded)try{n()}catch(i){Ji.error(`Error while processing buffered events PostHog app with config id ${e.id}`,i),t.errored=!0}}kg(){const e=this.siteAppLoaders||[];for(const t of e)this.apps[t.id]={id:t.id,loaded:!1,errored:!1,processedBuffer:!1};for(const t of e)this.setupSiteApp(t)}Sg(e){if(Object.keys(this.apps).length===0)return;const t=this.globalsForEvent(e);for(const n of Object.values(this.apps))try{this.wg(()=>{var r;return(r=n.processEvent)===null||r===void 0?void 0:r.call(n,t)})}catch(r){Ji.error(`Error while processing event ${e.event} for site app ${n.id}`,r)}}onRemoteConfig(e){var t,n,r;if(!((t=this.siteAppLoaders)===null||t===void 0)&&t.length)return this.isEnabled?(this.kg(),void this._instance.on("eventCaptured",c=>this.Sg(c))):void Ji.error('PostHog site apps are disabled. Enable the "opt_in_site_apps" config to proceed.');if((n=this.gg)===null||n===void 0||n.call(this),!e.ok)return;const s=e.config;if(!((r=s.siteApps)===null||r===void 0)&&r.length)if(this.isEnabled)for(const{id:c,url:u}of s.siteApps){var i,o;et[`__$$ph_site_app_${c}`]=this._instance,(i=et.__PosthogExtensions__)===null||i===void 0||(o=i.loadSiteApp)===null||o===void 0||o.call(i,this._instance,u,d=>{if(d)return Ji.error(X6+c,d)})}else Ji.error('PostHog site apps are disabled. Enable the "opt_in_site_apps" config to proceed.')}}},{surveys:class extends V7{constructor(e){super(new H7(e))}},featureFlags:um},{tracingHeaders:class{constructor(e){this._instance=e,this.xg=void 0,this.$g=void 0,this.Cg=void 0,this.Bp=()=>{const t=this.Tg();var n,r;t?(ce(this.xg)&&(this.xg=(n=et.__PosthogExtensions__)===null||n===void 0||(n=n.tracingHeadersPatchFns)===null||n===void 0?void 0:n._patchXHR(t,()=>this._instance.get_distinct_id(),this._instance.sessionManager)),ce(this.$g)&&(this.$g=(r=et.__PosthogExtensions__)===null||r===void 0||(r=r.tracingHeadersPatchFns)===null||r===void 0?void 0:r._patchFetch(t,()=>this._instance.get_distinct_id(),this._instance.sessionManager))):this.Gp()}}initialize(){this.startIfEnabledOrStop()}Ga(e){var t,n,r;!((t=et.__PosthogExtensions__)===null||t===void 0)&&t.tracingHeadersPatchFns?e():(n=et.__PosthogExtensions__)===null||n===void 0||(r=n.loadExternalDependency)===null||r===void 0||r.call(n,this._instance,"tracing-headers",s=>{if(s)return O7.error("failed to load script",s);e()})}Ig(){var e,t;return(e=(t=this._instance.config.tracing_headers)!==null&&t!==void 0?t:this._instance.config.addTracingHeaders)!==null&&e!==void 0?e:this._instance.config.__add_tracing_headers}Tg(){const e=this.Ig();return He(e)?(He(this.Cg)?this.Cg.splice(0,this.Cg.length,...e):this.Cg=[...e],e.length>0?this.Cg:void 0):(He(this.Cg)&&this.Cg.splice(0),this.Cg=e||void 0,this.Cg)}Gp(){var e,t;(e=this.xg)===null||e===void 0||e.call(this),(t=this.$g)===null||t===void 0||t.call(this),this.xg=void 0,this.$g=void 0}startIfEnabledOrStop(){this.Tg()?this.Ga(this.Bp):this.Gp()}}},{toolbar:class{constructor(e){this.instance=e}Mg(e){et.ph_toolbar_state=e}Eg(){var e;return(e=et.ph_toolbar_state)!==null&&e!==void 0?e:0}initialize(){return this.maybeLoadToolbar()}maybeLoadToolbar(e=void 0,t=void 0,n=void 0){var r,s;if(Xy(this.instance.config)||!le||!Ie)return!1;e=(r=e)!==null&&r!==void 0?r:le.location,n=(s=n)!==null&&s!==void 0?s:le.history;try{if(!t){try{le.localStorage.setItem("test","test"),le.localStorage.removeItem("test")}catch{return!1}t=le==null?void 0:le.localStorage}const i=U7||O0(e.hash,"__posthog")||O0(e.hash,"state");let o;const c=i?Fk(()=>JSON.parse(atob(decodeURIComponent(i))))||Fk(()=>JSON.parse(decodeURIComponent(i))):null;return c&&c.action==="ph_authorize"?(o=c,o.source="url",o&&Object.keys(o).length>0&&(c.desiredHash?e.hash=c.desiredHash:n?n.replaceState(n.state,"",e.pathname+e.search):e.hash="")):(o=JSON.parse(t.getItem(eC)||"{}"),o.source="localstorage",delete o.userIntent),!(!o.token||this.instance.config.token!==o.token||(this.loadToolbar(o),0))}catch{return!1}}Ag(e){const t=et.ph_load_toolbar||et.ph_load_editor;!ot(t)&&Mn(t)?t(e,this.instance):tC.warn("No toolbar load function found")}loadToolbar(e){const t=!!(Ie!=null&&Ie.getElementById("__POSTHOG_TOOLBAR__"));if(!le||t)return!1;const n=this.instance.requestRouter.region==="custom"&&this.instance.config.advanced_disable_toolbar_metrics,r=$($({token:this.instance.config.token},e),{},{apiURL:this.instance.requestRouter.endpointFor("ui")},n?{instrument:!1}:{});if(le.localStorage.setItem(eC,JSON.stringify($($({},r),{},{source:void 0}))),this.Eg()===2)this.Ag(r);else if(this.Eg()===0){var s,i;this.Mg(1),(s=et.__PosthogExtensions__)===null||s===void 0||(i=s.loadExternalDependency)===null||i===void 0||i.call(s,this.instance,"toolbar",o=>{if(o)return tC.error("[Toolbar] Failed to load",o),void this.Mg(0);this.Mg(2),this.Ag(r)}),Lt(le,"turbolinks:load",()=>{this.Mg(0),this.loadToolbar(r)})}return!0}Rg(e){return this.loadToolbar(e)}maybeLoadEditor(e=void 0,t=void 0,n=void 0){return this.maybeLoadToolbar(e,t,n)}}},{experiments:class nr{get Nr(){return this._instance.config}constructor(t){this._instance=t,this.getWebExperimentsAndEvaluateDisplayLogic=(n=!1)=>{this.getWebExperiments(r=>{nr.Pg("retrieved web experiments from the server"),this.Og=new Map,r.forEach(s=>{if(s.feature_flag_key){var i;this.Og&&(nr.Pg("setting flag key ",s.feature_flag_key," to web experiment ",s),(i=this.Og)===null||i===void 0||i.set(s.feature_flag_key,s));const o=this._instance.getFeatureFlag(s.feature_flag_key);dt(o)&&s.variants[o]&&this.Fg(s,o)}else if(s.variants)for(const o in s.variants){const c=s.variants[o];nr.Dg(c,this._instance)&&this.Lg(s.name,o,c.transforms)}})},n)},this._instance.onFeatureFlags(n=>{this.onFeatureFlags(n)})}initialize(){}onFeatureFlags(t){if(this._is_bot())nr.Pg(EC);else if(!this.Nr.disable_web_experiments){if(ot(this.Og))return this.Og=new Map,this.loadIfEnabled(),void this.previewWebExperiment();nr.Pg("applying feature flags",t),t.forEach(n=>{var r;if(this.Og&&(!((r=this.Og)===null||r===void 0)&&r.has(n))){var s;const i=this._instance.getFeatureFlag(n),o=(s=this.Og)===null||s===void 0?void 0:s.get(n);i&&(o!=null&&o.variants[i])&&this.Fg(o,i)}})}}previewWebExperiment(){const t=nr.getWindowLocation();if(t!=null&&t.search){const n=ed(t==null?void 0:t.search,"__experiment_id"),r=ed(t==null?void 0:t.search,"__experiment_variant");n&&r&&(nr.Pg(`previewing web experiments ${n} && ${r}`),this.getWebExperiments(s=>{this.Ng(parseInt(n),r,s)},!1,!0))}}loadIfEnabled(){this.Nr.disable_web_experiments||this.getWebExperimentsAndEvaluateDisplayLogic()}getWebExperiments(t,n,r){if(this.Nr.disable_web_experiments&&!r)return t([]);const s=this._instance.get_property("$web_experiments");if(s&&!n)return t(s);this._instance._send_request({url:this._instance.requestRouter.endpointFor("api",`/api/web_experiments/?token=${this.Nr.token}`),method:"GET",timestampMode:"query",callback:i=>t(i.statusCode===200&&i.json&&i.json.experiments||[])})}Ng(t,n,r){const s=r.filter(i=>i.id===t);s&&s.length>0&&(nr.Pg(`Previewing web experiment [${s[0].name}] with variant [${n}]`),this.Lg(s[0].name,n,s[0].variants[n].transforms))}Fg(t,n){const r=t.variants[n];nr.jg(r,this._instance)?this.Lg(t.name,n,r.transforms):nr.Pg(`skipping variant ${n} of experiment ${t.name} because this page does not match its url conditions`)}static Dg(t,n){return!ot(t.conditions)&&nr.jg(t,n)&&nr.qg(t)}static jg(t,n){var r;if(ot(t.conditions)||ot((r=t.conditions)===null||r===void 0?void 0:r.url))return!0;const s=nr.getWindowLocation();if(s){var i,o,c;const u=zR(n,s.href);return!(!((i=t.conditions)===null||i===void 0)&&i.url)||xz[(o=(c=t.conditions)===null||c===void 0?void 0:c.urlMatchType)!==null&&o!==void 0?o:"icontains"](t.conditions.url,u)}return!1}static getWindowLocation(){return le==null?void 0:le.location}static qg(t){var n;if(ot(t.conditions)||ot((n=t.conditions)===null||n===void 0?void 0:n.utm))return!0;const r=JR();if(r.utm_source){var s,i,o,c,u,d,f,p;const m=!(!((s=t.conditions)===null||s===void 0||(s=s.utm)===null||s===void 0)&&s.utm_campaign)||((i=t.conditions)===null||i===void 0||(i=i.utm)===null||i===void 0?void 0:i.utm_campaign)==r.utm_campaign,v=!(!((o=t.conditions)===null||o===void 0||(o=o.utm)===null||o===void 0)&&o.utm_source)||((c=t.conditions)===null||c===void 0||(c=c.utm)===null||c===void 0?void 0:c.utm_source)==r.utm_source,_=!(!((u=t.conditions)===null||u===void 0||(u=u.utm)===null||u===void 0)&&u.utm_medium)||((d=t.conditions)===null||d===void 0||(d=d.utm)===null||d===void 0?void 0:d.utm_medium)==r.utm_medium,w=!(!((f=t.conditions)===null||f===void 0||(f=f.utm)===null||f===void 0)&&f.utm_term)||((p=t.conditions)===null||p===void 0||(p=p.utm)===null||p===void 0?void 0:p.utm_term)==r.utm_term;return m&&_&&w&&v}return!1}static Pg(t,...n){me.info(`[WebExperiments] ${t}`,n)}static Bg(t,...n){me.warn(`[WebExperiments] ${t}`,n)}static zg(t){(t.namespaceURI==="http://www.w3.org/1999/xhtml"&&t.localName==="template"?t.content:t).querySelectorAll("a[target], template").forEach(n=>{var r;if(n.localName==="template")return void(n.namespaceURI==="http://www.w3.org/1999/xhtml"&&nr.zg(n));if(n.namespaceURI!=="http://www.w3.org/1999/xhtml"||((r=n.getAttribute("target"))===null||r===void 0?void 0:r.toLowerCase())!=="_blank")return void n.removeAttribute("target");const s=(n.getAttribute("rel")||"").split(/\s+/).filter(i=>i&&!/^(opener|noopener)$/i.test(i));s.push("noopener"),n.setAttribute("rel",s.join(" "))})}Lg(t,n,r){this._is_bot()?nr.Pg(EC):n!=="control"?r.forEach(s=>{if(s.selector){var i;nr.Pg(`applying transform of variant ${n} for experiment ${t} `,s);const o=(i=document)===null||i===void 0?void 0:i.querySelectorAll(s.selector);if(!(o!=null&&o.length))return void nr.Bg(`no element on this page matches selector ${s.selector} of variant ${n} for experiment ${t}`);const c=new Map;o==null||o.forEach(u=>{if(u.localName.toLowerCase()==="script")return;const d=u;if(s.html){var f;const m=u.namespaceURI==="http://www.w3.org/1998/Math/MathML"&&u.localName==="annotation-xml"&&((f=u.getAttribute("encoding"))===null||f===void 0?void 0:f.toLowerCase())||"",v=JSON.stringify([u.namespaceURI,u.localName,m]);let _=c.get(v);if(ot(_)){var p;const w=(p=CC)!==null&&p!==void 0?p:CC=bz(),b=u.ownerDocument.implementation.createHTMLDocument(""),S=b.createElementNS(u.namespaceURI,u.localName);m&&S.setAttribute("encoding",m);const E=b.createRange();E.selectNodeContents(S);const C=u.namespaceURI==="http://www.w3.org/2000/svg"&&/^(foreignObject|desc|title)$/.test(u.localName)||/^(text\/html|application\/xhtml\+xml)$/.test(m)?"http://www.w3.org/1999/xhtml":u.namespaceURI,A=E.createContextualFragment(s.html);u.namespaceURI==="http://www.w3.org/1998/Math/MathML"&&/^(mi|mo|mn|ms|mtext)$/.test(u.localName)?(S.appendChild(A),w.sanitize(S,$($({},kC),{},{NAMESPACE:C||void 0,IN_PLACE:!0}))):(S.namespaceURI==="http://www.w3.org/1999/xhtml"&&S.localName==="template"?S.content:S).appendChild(w.sanitize(A,$($({},kC),{},{NAMESPACE:C||void 0,RETURN_DOM_FRAGMENT:!0}))),nr.zg(S),_=S.innerHTML,c.set(v,_)}d.innerHTML=_}s.css&&d.setAttribute("style",s.css)})}}):nr.Pg("Control variants leave the page unmodified.")}_is_bot(){return Fr&&this._instance?EI(Fr,this.Nr.custom_blocked_useragents):void 0}},featureFlags:um},{conversations:class{constructor(e){this._instance=e,this.Hg=void 0,this._conversationsManager=null,this.Ug=!1,this.ie=null,this.Wg=!1,this.Vg=0,this.Gg=null,this.Qg=null}initialize(){this.loadIfEnabled()}onRemoteConfig(e){if(this._instance.config.disable_conversations)return void(this.Gg=null);if(this.Jg=e.ok,!e.ok)return;const t=e.config.conversations;ot(t)?this.Gg=null:(hs(t)?this.Hg=t:(this.Hg=t.enabled,this.ie=t),this.Hg||(this.Gg=null),this.loadIfEnabled())}reset(){var e;(e=this._conversationsManager)===null||e===void 0||e.reset(),this._conversationsManager=null,this.Vg++,this.Hg=void 0,this.ie=null,this.Jg=void 0,this.Wg=!1,this.Gg=null}loadIfEnabled(){if(this._conversationsManager||this.Ug||this._instance.config.disable_conversations||Xy(this._instance.config)||this._instance.config.cookieless_mode&&this._instance.consent.isOptedOut())return;const e=et==null?void 0:et.__PosthogExtensions__;if(e&&!ce(this.Hg)&&this.Hg)if(this.ie&&this.ie.token){this.Ug=!0;try{const t=e.initConversations;if(t)return this.Zg(t),void(this.Ug=!1);const n=e.loadExternalDependency;if(!n)return void this.Kg(B_);const r=this.Vg;n(this._instance,"conversations",s=>{if(r!==this.Vg)return this.Ug=!1,void this.loadIfEnabled();s||!e.initConversations?this.Kg("Could not load conversations script",s):this.Zg(e.initConversations),this.Ug=!1})}catch(t){this.Kg("Error initializing conversations",t),this.Ug=!1}}else ci.error("Conversations enabled but missing token in remote config.")}Zg(e){if(this.ie){try{this._conversationsManager=e(this.ie,this._instance),this.Wg=!1,ci.info("Conversations loaded successfully")}catch(t){return void this.Kg("Error completing conversations initialization",t)}this.Qg&&this._conversationsManager.setTheme(this.Qg),this.Yg()}else ci.error("Cannot complete initialization: remote config is null")}Yg(){const e=this.Gg;this.Gg=null,this._conversationsManager&&e&&(e==="open"?this._conversationsManager.open():this._conversationsManager.close())}Kg(e,t){ci.error(e,t),this._conversationsManager=null,this.Ug=!1,this.Wg=!0}show(){this._conversationsManager?this._conversationsManager.show():ci.warn("Conversations not loaded yet.")}hide(){this.Gg==="open"&&(this.Gg=null),this._conversationsManager&&this._conversationsManager.hide()}open(){this._conversationsManager?(this.Gg=null,this._conversationsManager.open()):this.Gg="open"}close(){this._conversationsManager?(this.Gg=null,this._conversationsManager.close()):this.Gg="close"}setTheme(e){var t,n;this.Qg=$($($({},this.Qg),e),{},{dark:$($({},(t=this.Qg)===null||t===void 0?void 0:t.dark),e==null?void 0:e.dark)}),(n=this._conversationsManager)===null||n===void 0||n.setTheme(e)}isAvailable(){return this.Hg===!0&&!kn(this._conversationsManager)}getUnavailableReason(){return this.isAvailable()?null:this._instance.config.disable_conversations?"disabled_by_config":Xy(this._instance.config)?"disabled_for_toolbar":this._instance.config.cookieless_mode&&this._instance.consent.isOptedOut()?"consent_opted_out":this.Jg===!1?"remote_config_failed":ce(this.Hg)?this.Jg?"disabled_in_project":"remote_config_pending":this.Hg?ot(this.ie)||!this.ie.token?"missing_token":et!=null&&et.__PosthogExtensions__?this.Ug?"initializing":this.Wg?"load_failed":"not_loaded":"extensions_unavailable":"disabled_in_project"}isVisible(){var e,t;return(e=(t=this._conversationsManager)===null||t===void 0?void 0:t.isVisible())!==null&&e!==void 0&&e}sendMessage(e,t,n){var r=this;return un(function*(){return r._conversationsManager?r._conversationsManager.sendMessage(e,t,n):(ci.warn(Zl),null)})()}getMessages(e,t){var n=this;return un(function*(){return n._conversationsManager?n._conversationsManager.getMessages(e,t):(ci.warn(Zl),null)})()}markAsRead(e){var t=this;return un(function*(){return t._conversationsManager?t._conversationsManager.markAsRead(e):(ci.warn(Zl),null)})()}getTickets(e){var t=this;return un(function*(){return t._conversationsManager?t._conversationsManager.getTickets(e):(ci.warn(Zl),null)})()}requestRestoreLink(e){var t=this;return un(function*(){return t._conversationsManager?t._conversationsManager.requestRestoreLink(e):(ci.warn(Zl),null)})()}restoreFromToken(e){var t=this;return un(function*(){return t._conversationsManager?t._conversationsManager.restoreFromToken(e):(ci.warn(Zl),null)})()}restoreFromUrlToken(){var e=this;return un(function*(){return e._conversationsManager?e._conversationsManager.restoreFromUrlToken():(ci.warn(Zl),null)})()}getCurrentTicketId(){var e,t;return(e=(t=this._conversationsManager)===null||t===void 0?void 0:t.getCurrentTicketId())!==null&&e!==void 0?e:null}getWidgetSessionId(){var e,t;return(e=(t=this._conversationsManager)===null||t===void 0?void 0:t.getWidgetSessionId())!==null&&e!==void 0?e:null}Ud(){var e;(e=this._conversationsManager)===null||e===void 0||e.setIdentity()}Wd(){var e;(e=this._conversationsManager)===null||e===void 0||e.clearIdentity()}}},{logs:class extends kz{constructor(e){super({get(){var t;return e==null||(t=e.config)===null||t===void 0?void 0:t.logs},captureHintKey:_R,get remoteConfigWillArrive(){var t,n;return!(!((t=e.wc)===null||t===void 0)&&t.call(e))||!!(!((n=et._POSTHOG_REMOTE_CONFIG)===null||n===void 0||(n=n[e.config.token])===null||n===void 0)&&n.config)}},()=>(function(t){var n;const r={};if(r.distinctId=t.get_distinct_id(),t.sessionManager){const{sessionId:s,windowId:i,sessionStartTimestamp:o,lastActivityTimestamp:c}=t.sessionManager.checkAndGetSessionAndWindowId(!0);r.sessionId=s,r.windowId=i,ot(o)||(r.sessionStartTimestamp=o),ot(c)||(r.lastActivityTimestamp=c)}if(!(et==null||(n=et.location)===null||n===void 0)&&n.href&&(r.currentUrl=t.config.disable_capture_url_hashes?nl(et.location.href):et.location.href),t.featureFlags){const s=t.featureFlags.getFlags();s&&s.length>0&&(r.activeFeatureFlags=s)}return r})(e)),this._instance=e,this.name=MI,this.Tf()}get $f(){return this._instance.__loaded}Cf(){const e=xn("[logs]"),t=et==null?void 0:et.__PosthogExtensions__;if(!t)return void e.error("PostHog Extensions not found.");const n=t.loadExternalDependency;if(n)return r=>{n(this._instance,"logs",s=>{const i=t.logs;r(s,i!=null&&i.initializeLogs?{initialize:o=>i.initializeLogs(o),replay(o,c){var u;return(u=i.replayConsoleBuffer)===null||u===void 0?void 0:u.call(i,o,c)}}:void 0)})};e.error(B_)}}},{metrics:class{constructor(e){this._instance=e,this.A=xn("[metrics]"),this.Mi=!1}initialize(){this.onConfigChange()}onConfigChange(){var e;if(this.Mi)return;const t=!!(!((e=this._instance.config.metrics)===null||e===void 0)&&e.network);t&&!this.Xg?this.Xg=(n=>{let r=!0;const s=()=>r?(c=>{var u;const d=(u=c.config.metrics)===null||u===void 0?void 0:u.network;return d===!0?{}:d||void 0})(n):void 0,i=Az(n,s),o=Tz(n,s);return()=>{r=!1,i(),o()}})(this._instance):!t&&this.Xg&&(this.Xg(),this.Xg=void 0)}Ef(){var e;if(this.Mi)return;const t=(e=this._instance)===null||e===void 0||(e=e.config)===null||e===void 0?void 0:e.metrics;var n;return this.Sf&&this.Af===t||((n=this.Sf)===null||n===void 0||n.reset(),this.Af=t,this.Sf=new BF(this.Mf(),(function(r){var s,i,o,c,u;const d=r==null?void 0:r.resourceAttributes;return{serviceName:(s=d==null?void 0:d["service.name"])!==null&&s!==void 0?s:r==null?void 0:r.serviceName,serviceVersion:(i=d==null?void 0:d["service.version"])!==null&&i!==void 0?i:r==null?void 0:r.serviceVersion,environment:(o=d==null?void 0:d["deployment.environment"])!==null&&o!==void 0?o:r==null?void 0:r.environment,resourceAttributes:d,beforeSend:r==null?void 0:r.beforeSend,flushIntervalMs:(c=r==null?void 0:r.flushIntervalMs)!==null&&c!==void 0?c:1e4,maxSeriesPerFlush:(u=r==null?void 0:r.maxSeriesPerFlush)!==null&&u!==void 0?u:1e3}})(t),this.A)),this.Sf}count(e,t=1,n){var r;(r=this.Ef())===null||r===void 0||r.count(e,t,n)}gauge(e,t,n){var r;(r=this.Ef())===null||r===void 0||r.gauge(e,t,n)}histogram(e,t,n){var r;(r=this.Ef())===null||r===void 0||r.histogram(e,t,n)}flush(e){if(!this.Sf)return Promise.resolve();if(e){const t=this.Sf.drainWindow();return t&&this.Po(t,e),Promise.resolve()}return this.Sf.flush().catch(t=>this.A.error("PostHog metrics flush failed:",t))}reset(){var e;(e=this.Sf)===null||e===void 0||e.reset()}dispose(){var e,t;this.Mi=!0,(e=this.Xg)===null||e===void 0||e.call(this),this.Xg=void 0,(t=this.Sf)===null||t===void 0||t.reset()}Mf(){const e=this._instance,t=this;return{get isDisabled(){return!1},get optedOut(){return!e.is_capturing()},Po:n=>t.Po(n),getLibraryId:()=>Cs.LIB_NAME,getLibraryVersion:()=>Cs.LIB_VERSION}}Po(e,t){return new Promise(n=>{let r=!1;const s=o=>{r||(r=!0,clearTimeout(i),n(o))},i=setTimeout(()=>s({kind:"retry-later",error:new Error("metrics request timed out")}),9e4);this._instance._send_request($($({method:"POST",url:this.tm(),data:e,compression:"best-available",batchKey:"metrics"},t&&{transport:t}),{},{fireCallbackOnDrop:!0,callback(o){const c=o.statusCode;if(c>=200&&300>c)s({kind:"ok"});else if(c===413)s({kind:"too-large"});else if(c!==0&&c!==408&&c!==429&&500>c)s({kind:"fatal",error:new Error(`metrics request failed with status ${c}`)});else{var u;s({kind:"retry-later",error:(u=o.error)!==null&&u!==void 0?u:new Error(`metrics request failed with status ${c}`)})}}}))})}tm(){return this._instance.requestRouter.endpointFor("api","/i/v1/metrics")+"?token="+encodeURIComponent(this._instance.config.token)}}},{webMCP:class{constructor(e){this._instance=e,this.im=!1}initialize(){this.startIfEnabled()}startIfEnabled(){if(!this._instance.config.capture_webmcp||this.im)return;const e=Ie==null?void 0:Ie.modelContext;if(!e||!Mn(e.registerTool))return;const t=RC.get(e);if(t)return t.instances.add(this._instance),void(this.im=!0);const n={instances:new Set([this._instance])},r=e.registerTool,s=this;rd(e,"registerTool",i=>{const o=i;return function(c,...u){let d=c;try{d=s.nm(c,n)}catch{return o.call(this,c,...u)}return o.call(this,d,...u)}}),e.registerTool!==r&&(RC.set(e,n),this.im=!0)}nm(e,t){if(!e||!Mn(e.execute))return e;const n=e.execute,r=this,{tool:s,injected:i}=(function(o,c){const u={intent:!1,model:!1},d=o.inputSchema;if(!(function(_){return!!ce(_)||lt(_)&&Object.keys(_).every(w=>Rz.has(w)||w.startsWith("x-"))&&_.additionalProperties!==!0&&!lt(_.additionalProperties)&&(!_.type||_.type==="object")&&(!_.properties||lt(_.properties))&&(!_.required||He(_.required))})(d))return{tool:P1(o),injected:u};const f=(d==null?void 0:d.properties)||{},p=_=>C1(f,_)||He(d==null?void 0:d.required)&&d.required.includes(_);if(u.intent=c.intent&&!p("context"),u.model=c.model&&!p("llm_model"),!u.intent&&!u.model)return{tool:P1(o),injected:u};const m=$({},f),v=He(d==null?void 0:d.required)?[...d.required]:[];return u.intent&&(m.context={type:"string",description:`Explain why this tool is called and how it supports the user's goal. Describe the abstract purpose only. Do not include personal or identifying information. Generalize specific entities as roles such as "a customer".`},v.includes("context")||v.push("context")),u.model&&(m.llm_model={type:"string",description:`The model identifier you are running as, for example "claude-opus-4-8" or "gpt-5.2". Pass "unknown" if you are not certain. Recorded for the site developer's analytics.`},v.includes("llm_model")||v.push("llm_model")),{tool:P1(o,$($({},d),{},{type:(d==null?void 0:d.type)||"object",properties:m,required:v})),injected:u}})(e,(function(o){const c={intent:!1,model:!1};for(const u of o.instances){const d=IC(u.config.capture_webmcp);c.intent||(c.intent=(d==null?void 0:d.intent)===!0),c.model||(c.model=(d==null?void 0:d.model)===!0)}return c})(t));return Object.defineProperty(s,"execute",{configurable:!0,enumerable:!0,writable:!0,value(...o){const c=new Date,u=(function(v,_){if(!lt(v))return{};try{const w=_.intent?OC(v.context,2048,!0):void 0,b=_.model?OC(v.llm_model,256):void 0;return $($({},w&&w!=="{}"?{intent:w}:{}),b&&b.toLowerCase()!=="unknown"?{model:b}:{})}catch{return{}}})(o[0],i),d=(function(v,_){const w=v[0];if(!lt(w))return v;try{const b=_.intent&&C1(w,"context"),S=_.model&&C1(w,"llm_model");if(!b&&!S)return v;const E=$({},w);return b&&delete E.context,S&&delete E.llm_model,[E,...v.slice(1)]}catch{return v}})(o,i);let f;try{f=n.apply(this===s?e:this,d)}catch(v){throw r.sm(t,s,c,{error:v,errorResult:!1},u),v}if((p=f)&&typeof p.then=="function")return Promise.resolve(f).then(v=>{const _=MC(v)?{error:v,errorResult:!0}:void 0;return r.sm(t,s,c,_,u),v},v=>{throw r.sm(t,s,c,{error:v,errorResult:!1},u),v});var p;const m=MC(f)?{error:f,errorResult:!0}:void 0;return r.sm(t,s,c,m,u),f}}),s}sm(e,t,n,r,s){const i=Date.now()-n.getTime();let o;for(const u of e.instances){var c;const d=IC(u.config.capture_webmcp);if(d){r&&!o&&(o=$z(r.error,r.errorResult));try{u.capture("$mcp_tool_call",$($($({$mcp_source:"posthog_mcp_analytics",$mcp_interface:"webmcp",$mcp_tool_name:t.name,$mcp_resource_name:t.name,$mcp_tool_description:t.description,$mcp_server_name:cn==null?void 0:cn.hostname,$mcp_duration_ms:i,$mcp_is_error:!!r},o?{$mcp_error_type:o.type,$mcp_error_message:o.message}:{}),d.intent&&s.intent?{$mcp_intent:s.intent,$mcp_intent_source:"context_parameter"}:{}),d.model&&s.model?{$mcp_llm_model:s.model,$mcp_llm_model_source:"self_reported"}:{}),{timestamp:n})}catch{continue}if(r&&o&&u.exceptions&&(!((c=u.exceptionObserver)===null||c===void 0)&&c.isEnabled))try{const f={$exception_list:Nz(u.exceptions,r,o.message),$exception_level:"error",$exception_source:"mcp.tool_call",$mcp_interface:"webmcp",$mcp_tool_name:t.name,$mcp_resource_name:t.name,$mcp_tool_description:t.description,$mcp_server_name:cn==null?void 0:cn.hostname};u.exceptionObserver.captureException(f)}catch{}}}}}}));const Dz=(function(){Cs.SDK_DIST_CHANNEL="npm";const e=Yf[Mf]=new Xf;return(function(){function t(){t.done||(t.done=!0,xI=!1,Zt(Yf,function(n){n._dom_loaded()}))}Ie!=null&&Ie.addEventListener?Ie.readyState==="complete"?t():Lt(Ie,"DOMContentLoaded",t,{capture:!1}):le&&me.error("Browser doesn't support `document.addEventListener` so PostHog couldn't be initialized")})(),e})();var Qe=Dz;function hw(e){const t=Object.values(e).filter(r=>typeof r=="number");return Object.entries(e).filter(([r,s])=>t.indexOf(+r)===-1).map(([r,s])=>s)}function NC(e,t="|"){return e.map(n=>BI(n)).join(t)}function pw(e,t){return typeof t=="bigint"?t.toString():t}class Fz{constructor(t){this._getter=t,this._value=void 0}get value(){const t=this._getter;return t!==void 0&&(this._value=t(),this._getter=void 0),this._value}}function Ag(e){return new Fz(e)}function jz(e){return e==null}function bb(e){const t=e.startsWith("^")?1:0,n=e.endsWith("$")?e.length-1:e.length;return e.slice(t,n)}function zz(e,t){const n=e/t,r=Math.round(n),s=4*Number.EPSILON*Math.max(Math.abs(n),1);return Math.abs(n-r)<s?0:n-r}function ua(e,t,n){Object.defineProperty(e,t,{value:n,writable:!0,enumerable:!0,configurable:!0})}function xb(e){const t=Object.getOwnPropertyDescriptor(e,"shape");return t!=null&&t.get?t.get.raw:t==null?void 0:t.value}function sa(e){return xb(e._zod.def)??e._zod.def.shape}function VI(e,t,n){Object.defineProperty(e,t,{get(){const r=n();return ua(this,t,r),r},enumerable:!0,configurable:!0})}function HI(e,t,n){t in e?ua(e,t,n):e[t]=n}function wc(e,t,n,r){const s=sa(t);for(const i of n){const o=Object.getOwnPropertyDescriptor(s,i);o.enumerable&&(o.get?VI(e,i,()=>{const c=t._zod.def.shape[i];return r?r(c,i):c}):HI(e,i,r?r(o.value,i):o.value))}}function Vz(e,t){for(const n of Reflect.ownKeys(t)){const r=Object.getOwnPropertyDescriptor(t,n);r.enumerable&&(r.get?VI(e,n,()=>t[n]):HI(e,n,r.value))}}function Gs(...e){const t={};for(const n of e){const r=Object.getOwnPropertyDescriptors(n);Object.assign(t,r)}return Object.defineProperties({},t)}function Hz(e){return JSON.stringify(e)}function Uz(e){return e.toLowerCase().trim().replace(/[^\w\s-]/g,"").replace(/[\s_-]+/g,"-").replace(/^-+|-+$/g,"")}const UI="captureStackTrace"in Error?Error.captureStackTrace:(...e)=>{};function hh(e){return typeof e=="object"&&e!==null&&!Array.isArray(e)}const Zz=Ag(()=>{var e;if(zi.jitless||typeof navigator<"u"&&((e=navigator==null?void 0:navigator.userAgent)!=null&&e.includes("Cloudflare")))return!1;try{const t=Function;return new t(""),!0}catch{return!1}});function sd(e){if(hh(e)===!1)return!1;const t=e.constructor;if(t===void 0||typeof t!="function")return!0;const n=t.prototype;return!(hh(n)===!1||Object.prototype.hasOwnProperty.call(n,"isPrototypeOf")===!1)}function ZI(e){return sd(e)?{...e}:Array.isArray(e)?[...e]:e instanceof Map?new Map(e):e instanceof Set?new Set(e):e}const Bz=new Set(["string","number","symbol"]);function id(e){return e.replace(/[.*+?^${}()|[\]\\]/g,"\\$&")}function yl(e,t,n){const r=new e._zod.constr(t??e._zod.def);return(!t||n!=null&&n.parent)&&(r._zod.parent=e),r}function nt(e){const t=e;if(!t)return{};if(typeof t=="string")return{error:()=>t};if((t==null?void 0:t.message)!==void 0){if((t==null?void 0:t.error)!==void 0)throw new Error("Cannot specify both `message` and `error` params");t.error=t.message}return delete t.message,typeof t.error=="string"?{...t,error:()=>t.error}:t}function BI(e){return typeof e=="bigint"?e.toString()+"n":typeof e=="string"?`"${e}"`:`${e}`}function Wz(e){return Object.keys(e).filter(t=>e[t]._zod.optin!==void 0&&e[t]._zod.optout==="optional")}const WI={safeint:[Number.MIN_SAFE_INTEGER,Number.MAX_SAFE_INTEGER],int32:[-2147483648,2147483647],uint32:[0,4294967295],float32:[-34028234663852886e22,34028234663852886e22],float64:[-Number.MAX_VALUE,Number.MAX_VALUE]},Kz={int64:[BigInt("-9223372036854775808"),BigInt("9223372036854775807")],uint64:[BigInt(0),BigInt("18446744073709551615")]};function Gz(e,t){const n=e._zod.def,r=n.checks;if(r&&r.length>0)throw new Error(".pick() cannot be used on object schemas containing refinements");const i={};return wc(i,e,Tg(e,t)),yl(e,Gs(n,{shape:i,checks:[]}))}function Tg(e,t){var s;const n=sa(e),r=[];for(const i of Reflect.ownKeys(t)){if(!((s=Object.getOwnPropertyDescriptor(n,i))!=null&&s.enumerable))throw new Error(`Unrecognized key: "${String(i)}"`);t[i]&&r.push(i)}return r}function qz(e,t){const n=e._zod.def,r=n.checks;if(r&&r.length>0)throw new Error(".omit() cannot be used on object schemas containing refinements");const i=new Set(Tg(e,t)),o={};return wc(o,e,Reflect.ownKeys(sa(e)).filter(c=>!i.has(c))),yl(e,Gs(n,{shape:o,checks:[]}))}function Yz(e,t){if(!sd(t))throw new Error("Invalid input to extend: expected a plain object");const n=e._zod.def.checks;if(n&&n.length>0){const s=sa(e);for(const i of Reflect.ownKeys(t))if(Object.getOwnPropertyDescriptor(s,i)!==void 0)throw new Error("Cannot overwrite keys on object schemas containing refinements. Use `.safeExtend()` instead.")}return yl(e,Gs(e._zod.def,{shape:KI(e,t)}))}function KI(e,t){const n={};return wc(n,e,Reflect.ownKeys(sa(e))),Vz(n,t),n}function Qz(e,t){if(!sd(t))throw new Error("Invalid input to safeExtend: expected a plain object");return yl(e,Gs(e._zod.def,{shape:KI(e,t)}))}function Xz(e,t){var s,i;if(!((s=t==null?void 0:t._zod)!=null&&s.def))throw new Error("Invalid input to merge: expected an object schema. To merge a plain shape, use `.extend()`.");if((i=e._zod.def.checks)!=null&&i.length)throw new Error(".merge() cannot be used on object schemas containing refinements. Use .safeExtend() instead.");const n={};wc(n,e,Reflect.ownKeys(sa(e))),wc(n,t,Reflect.ownKeys(sa(t)));const r=Gs(e._zod.def,{shape:n,get catchall(){return t._zod.def.catchall},checks:t._zod.def.checks??[]});return yl(e,r)}function LC(e,t,n,r="partial"){const i=t._zod.def.checks;if(i&&i.length>0)throw new Error(`.${r}() cannot be used on object schemas containing refinements`);const c=n?new Set(Tg(t,n)):void 0,u={};return wc(u,t,Reflect.ownKeys(sa(t)),e&&((d,f)=>c&&!c.has(f)?d:new e({type:"optional",innerType:d}))),yl(t,Gs(t._zod.def,{shape:u,checks:[]}))}function Jz(e,t,n){const r=n?new Set(Tg(t,n)):void 0,s={};return wc(s,t,Reflect.ownKeys(sa(t)),(i,o)=>r&&!r.has(o)?i:new e({type:"nonoptional",innerType:i})),yl(t,Gs(t._zod.def,{shape:s}))}function Jo(e,t=0){var n;if(e.aborted===!0)return!0;for(let r=t;r<e.issues.length;r++)if(((n=e.issues[r])==null?void 0:n.continue)!==!0)return!0;return!1}function eV(e,t=0){var n;if(e.aborted===!0)return!0;for(let r=t;r<e.issues.length;r++)if(((n=e.issues[r])==null?void 0:n.continue)===!1)return!0;return!1}function Eu(e,t){return t.map(n=>{var r;return(r=n).path??(r.path=[]),n.path.unshift(e),n})}function Sf(e){return typeof e=="string"?e:e==null?void 0:e.message}function $C(e){const t=[];for(const n of e??[]){const r=n._zod.def;if(!/_(length|size)$|_equals$/.test(r.check))break;const s=r.maximum??r.length??r.size;s>=0&&t.push([s,n])}return t}function mw(e,t,n){var r;for(let s=t;s<e.length;s++)(r=e[s]).schema??(r.schema=n)}function ll(e,t,n){var u,d,f,p,m,v,_,w,b,S;var r;const s=(d=(u=e.inst)==null?void 0:u._zod)==null?void 0:d.traits;s!=null&&s.has("$ZodType")&&(s.has("$ZodCheck")?(r=e).schema??(r.schema=e.inst):e.schema=e.inst);const i=e.schema!==e.inst?(p=(f=e.schema)==null?void 0:f._zod.def)==null?void 0:p.error:void 0,o=e.message?e.message:Sf((_=(v=(m=e.inst)==null?void 0:m._zod.def)==null?void 0:v.error)==null?void 0:_.call(v,e))??Sf(i==null?void 0:i(e))??Sf((w=t==null?void 0:t.error)==null?void 0:w.call(t,e))??Sf((b=n.customError)==null?void 0:b.call(n,e))??Sf((S=n.localeError)==null?void 0:S.call(n,e))??"Invalid input",c={};for(const E of Object.keys(e))E==="inst"||E==="schema"||E==="continue"||E==="input"||E==="__proto__"||(c[E]=e[E]);return c.path??(c.path=[]),c.message=o,t!=null&&t.reportInput&&(c.input=e.input),c}const tV=/[\uD800-\uDBFF]/;function Sb(e){const t=e.length;if(!tV.test(e))return t;let n=t;for(let r=0;r<t-1;r++)(e.charCodeAt(r)&64512)===55296&&(e.charCodeAt(r+1)&64512)===56320&&(n--,r++);return n}function Eb(e){return Array.isArray(e)?"array":typeof e=="string"?"string":"unknown"}function nV(e){const t=typeof e;switch(t){case"number":return Number.isNaN(e)?"nan":"number";case"object":{if(e===null)return"null";if(Array.isArray(e))return"array";const n=e;if(n&&Object.getPrototypeOf(n)!==Object.prototype&&"constructor"in n&&n.constructor)return n.constructor.name}}return t}function ph(...e){const[t,n,r]=e;return typeof t=="string"?{message:t,code:"custom",input:n,inst:r}:{...t}}function rV(e,t){for(const n in t){const r=Object.getOwnPropertyDescriptor(t,n);r.get?Object.defineProperty(e,n,{...r,enumerable:!1}):sV(e,n,r.value)}}function cl(e,t,n,r=!0){return Object.defineProperty(e,t,{configurable:!0,writable:!0,enumerable:r,value:n}),n}function GI(e,t,n){return cl(e,t,n,!1)}function qI(e,t){for(const n in e){const r=e[n];Object.defineProperty(t,n,{configurable:!0,enumerable:!0,get(){return cl(this,n,r(this))},set(s){cl(this,n,s)}})}return t}function sV(e,t,n){Object.defineProperty(e,t,{configurable:!0,get(){return this==null?n:cl(this,t,n.bind(this))},set(r){cl(this,t,r)}})}function iV(e,t){const n=Object.getPrototypeOf(e);return t in n?void 0:n}let A1,$a=!1;const oV={configurable:!0,get(){$a=!0}};function en(e,t,n){const r=Object.getPrototypeOf(e._zod);if(t in r&&A1!==e._zod){A1=void 0;return}A1=e._zod,Object.defineProperty(r,t,{configurable:!0,get(){Object.defineProperty(this,t,oV);const s=$a;$a=!1;try{const i=n(this);return $a?delete this[t]:Object.defineProperty(this,t,{configurable:!0,writable:!0,value:i}),$a=$a||s,i}catch(i){throw delete this[t],$a=$a||s,i}},set(s){Object.defineProperty(this,t,{configurable:!0,writable:!0,value:s})}})}function aV(e,t,n,r){const s=iV(e,t);s&&Object.defineProperty(s,t,{configurable:!0,get(){const i={configurable:!0,writable:!0,enumerable:r,value:void 0};return Object.defineProperty(this,t,i),i.value=n(this),Object.defineProperty(this,t,i),i.value},set(i){Object.defineProperty(this,t,{configurable:!0,writable:!0,enumerable:r,value:i})}})}const lV="~constantCatch";function cV(e){const t=()=>e;return t[lV]=!0,t}var DC;const YI=Object.freeze({status:"aborted"}),T1={value:void 0,enumerable:!1};let FC="captureStackTrace"in Error?Error:null;function uV(e){const t=FC;if(t){const n=t.stackTraceLimit;if(typeof n=="number"){try{t.stackTraceLimit=0}catch{return FC=null,new e}try{return new e}finally{t.stackTraceLimit=n}}}return new e}function fe(e,t,n,r){const s={};function i(m){this.def=m,this.constr=p,this.traits=new Set}i.prototype=s;const o=n,c=o&&new WeakSet;function u(m,v){if(m._zod){if(m._zod.traits.has(e))return}else{T1.value=new i(v);try{Object.defineProperty(m,"_zod",T1)}finally{T1.value=void 0}}if(m._zod.traits.add(e),t(m,v),c){const w=Object.getPrototypeOf(m),b=m._zod.constr.prototype;let S=w;for(;S&&S!==b;)S=Object.getPrototypeOf(S);const E=S??w;c.has(E)||(c.add(E),rV(E,o))}const _=p.prototype;for(const w in _)Object.prototype.hasOwnProperty.call(_,w)&&(w in m||(m[w]=_[w].bind(m)))}const d=(r==null?void 0:r.Parent)??Object;class f extends d{}Object.defineProperty(f,"name",{value:e});function p(m){var b;const v=r!=null&&r.Parent?uV(f):this;u(v,m);const _=v._zod.deferred;if(_){for(const S of _)S();v._zod.deferred=void 0}const w=(b=globalThis.__zod_globalConfig)==null?void 0:b.postProcessor;return w&&w(v),v}return Object.defineProperty(p,"init",{value:u}),Object.defineProperty(p,Symbol.hasInstance,{value:m=>{var v,_;return r!=null&&r.Parent&&m instanceof r.Parent?!0:(_=(v=m==null?void 0:m._zod)==null?void 0:v.traits)==null?void 0:_.has(e)}}),Object.defineProperty(p,"name",{value:e}),p}class hc extends Error{constructor(){super("Encountered Promise during synchronous parse. Use .parseAsync() instead.")}}class QI extends Error{constructor(t){super(`Encountered unidirectional transform during encode: ${t}`),this.name="ZodEncodeError"}}(DC=globalThis).__zod_globalConfig??(DC.__zod_globalConfig={});const zi=globalThis.__zod_globalConfig;function _o(e){return e&&Object.assign(zi,e),zi}function dV(){const e=this._zod;return e.message??(e.message=JSON.stringify(e.def,pw,2)),e.message}function fV(e){this._zod.message=e}const hV={get:dV,set:fV,enumerable:!0,configurable:!0},R1={value:void 0,enumerable:!1},jC=new WeakSet([Object.prototype,Error.prototype]),pV=(e,t)=>{e.name="$ZodError",R1.value=t,Object.defineProperty(e,"issues",R1),R1.value=void 0,Object.defineProperty(e,"message",hV);const n=Object.getPrototypeOf(e);jC.has(n)||(jC.add(n),Object.defineProperty(n,"toString",{configurable:!0,enumerable:!1,get(){const r=()=>this.message;return Object.defineProperty(this,"toString",{value:r,configurable:!0,writable:!0}),r},set(r){Object.defineProperty(this,"toString",{value:r,configurable:!0,writable:!0})}}))},mV=fe("$ZodError",pV);function gV(e,t,n){return Object.prototype.hasOwnProperty.call(e,t)||(t==="__proto__"?Object.defineProperty(e,t,{value:n(),writable:!0,enumerable:!0,configurable:!0}):e[t]=n()),e[t]}function vV(e,t=n=>n.message){const n={},r=[];for(const s of e.issues)s.path.length>0?gV(n,s.path[0],()=>[]).push(t(s)):r.push(t(s));return{formErrors:r,fieldErrors:n}}function yV(e,t=n=>n.message){const n={_errors:[]},r=(s,i=[])=>{for(const o of s.issues)if(o.code==="invalid_union"&&o.errors.length)o.errors.map(c=>r({issues:c},[...i,...o.path]));else if(o.code==="invalid_key")r({issues:o.issues},[...i,...o.path]);else if(o.code==="invalid_element")r({issues:o.issues},[...i,...o.path]);else{const c=[...i,...o.path];if(c.length===0)n._errors.push(t(o));else{let u=n,d=0;for(;d<c.length;){const f=c[d],p=d===c.length-1;if(f==="_errors"){p&&u._errors.push(t(o)),d++;continue}Object.prototype.hasOwnProperty.call(u,f)||Object.defineProperty(u,f,{value:{_errors:[]},enumerable:!0,writable:!0,configurable:!0});const m=u[f];p&&m._errors.push(t(o)),u=m,d++}}}};return r(e),n}function Rg(e,t){return{callee:(t==null?void 0:t.callee)??e,Err:t==null?void 0:t.Err}}const kb=e=>{const t=(n,r,s,i)=>{const o=s?{...s,async:!1}:{async:!1},c=n._zod.run({value:r,issues:[]},o);if(c instanceof Promise)throw new hc;if(c.issues.length){const u=new((i==null?void 0:i.Err)??e)(c.issues.map(d=>ll(d,o,_o())));throw UI(u,(i==null?void 0:i.callee)??t),u}return c.value};return t},Cb=e=>{const t=async(n,r,s,i)=>{const o=s?{...s,async:!0}:{async:!0};let c=n._zod.run({value:r,issues:[]},o);if(c instanceof Promise&&(c=await c),c.issues.length){const u=new((i==null?void 0:i.Err)??e)(c.issues.map(d=>ll(d,o,_o())));throw UI(u,(i==null?void 0:i.callee)??t),u}return c.value};return t},Pb=e=>(t,n,r)=>{const s=r?{...r,async:!1}:{async:!1},i=t._zod.run({value:n,issues:[]},s);if(i instanceof Promise)throw new hc;return i.issues.length?XI(e,i.issues,s):{success:!0,data:i.value}};function XI(e,t,n){let r;return{success:!1,get error(){return r||(r=new e(t.map(s=>ll(s,n,_o()))),t=void 0,n=void 0),r},set error(s){r=s,t=void 0,n=void 0}}}const Ab=e=>async(t,n,r)=>{const s=r?{...r,async:!0}:{async:!0};let i=t._zod.run({value:n,issues:[]},s);return i instanceof Promise&&(i=await i),i.issues.length?XI(e,i.issues,s):{success:!0,data:i.value}},_V=Symbol.for("zod.compile.invalid"),wV=Symbol.for("zod.compile.fallback"),bV=((e,t,n)=>{const r=e._zod.bag.validator;if(r!==void 0){if(r(t)!==_V)return!0;if(r.definite===!0&&n===void 0)return!1}return xV(e,t,n)});function xV(e,t,n){const r=n?{...n,async:!1,abortEarly:!0}:{async:!1,abortEarly:!0},s=e._zod.bag.fallbackRun;let i;if(s?(r[wV]=!0,i=s({value:t,issues:[]},r)):i=e._zod.run({value:t,issues:[]},r),i instanceof Promise)throw new hc;return i.issues.length===0}const SV=async(e,t,n)=>{const r=n?{...n,async:!0,abortEarly:!0}:{async:!0,abortEarly:!0};let s=e._zod.run({value:t,issues:[]},r);return s instanceof Promise&&(s=await s),s.issues.length===0},EV=e=>{const t=kb(e),n=(r,s,i,o)=>{const c=i?{...i,direction:"backward"}:{direction:"backward"};return t(r,s,c,Rg(n,o))};return n},kV=e=>{const t=kb(e),n=(r,s,i,o)=>t(r,s,i,Rg(n,o));return n},CV=e=>{const t=Cb(e),n=async(r,s,i,o)=>{const c=i?{...i,direction:"backward"}:{direction:"backward"};return await t(r,s,c,Rg(n,o))};return n},PV=e=>{const t=Cb(e),n=async(r,s,i,o)=>await t(r,s,i,Rg(n,o));return n},AV=e=>(t,n,r)=>{const s=r?{...r,direction:"backward"}:{direction:"backward"};return Pb(e)(t,n,s)},TV=e=>(t,n,r)=>Pb(e)(t,n,r),RV=e=>async(t,n,r)=>{const s=r?{...r,direction:"backward"}:{direction:"backward"};return Ab(e)(t,n,s)},IV=e=>async(t,n,r)=>Ab(e)(t,n,r),OV=/^[cC][0-9a-z]{6,}$/,MV=/^[0-9a-z]+$/,NV=/^[0-7][0-9A-HJKMNP-TV-Za-hjkmnp-tv-z]{25}$/,LV=/^[0-9a-vA-V]{20}$/,$V=/^[A-Za-z0-9]{27}$/,DV=/^[a-zA-Z0-9_-]{21}$/;function FV(e){return new RegExp(`^[a-zA-Z0-9_-]{${e}}$`)}const jV=/^P(?:(\d+W)|(?!.*W)(?=\d|T\d)(\d+Y)?(\d+M)?(\d+D)?(T(?=\d)(\d+H)?(\d+M)?(\d+([.,]\d+)?S)?)?)$/,zV=/^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{12})$/,zC=e=>e?new RegExp(`^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-${e}[0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12})$`):/^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$/,VV=/^(?:[A-Za-z0-9_'+\-]+\.)*[A-Za-z0-9_'+\-]*[A-Za-z0-9_+-]@(?:[A-Za-z0-9][A-Za-z0-9\-]*\.)+[A-Za-z]{2,}$/,HV="^(?=[\\s\\S]*[\\p{Extended_Pictographic}\\p{Regional_Indicator}\\u20E3])[\\p{Extended_Pictographic}\\p{Emoji_Component}]+$";function UV(){return new RegExp(HV,"u")}const ZV=/^(?:(?:25[0-5]|2[0-4][0-9]|1[0-9][0-9]|[1-9][0-9]|[0-9])\.){3}(?:25[0-5]|2[0-4][0-9]|1[0-9][0-9]|[1-9][0-9]|[0-9])$/,BV=/^(([0-9a-fA-F]{1,4}:){7}[0-9a-fA-F]{1,4}|([0-9a-fA-F]{1,4}:){1,7}:|([0-9a-fA-F]{1,4}:){1,6}:[0-9a-fA-F]{1,4}|([0-9a-fA-F]{1,4}:){1,5}(:[0-9a-fA-F]{1,4}){1,2}|([0-9a-fA-F]{1,4}:){1,4}(:[0-9a-fA-F]{1,4}){1,3}|([0-9a-fA-F]{1,4}:){1,3}(:[0-9a-fA-F]{1,4}){1,4}|([0-9a-fA-F]{1,4}:){1,2}(:[0-9a-fA-F]{1,4}){1,5}|[0-9a-fA-F]{1,4}:((:[0-9a-fA-F]{1,4}){1,6})|:((:[0-9a-fA-F]{1,4}){1,7}|:))$/,WV=/^((25[0-5]|2[0-4][0-9]|1[0-9][0-9]|[1-9][0-9]|[0-9])\.){3}(25[0-5]|2[0-4][0-9]|1[0-9][0-9]|[1-9][0-9]|[0-9])\/([0-9]|[1-2][0-9]|3[0-2])$/,KV=/^(([0-9a-fA-F]{1,4}:){7}[0-9a-fA-F]{1,4}|([0-9a-fA-F]{1,4}:){1,7}:|([0-9a-fA-F]{1,4}:){1,6}:[0-9a-fA-F]{1,4}|([0-9a-fA-F]{1,4}:){1,5}(:[0-9a-fA-F]{1,4}){1,2}|([0-9a-fA-F]{1,4}:){1,4}(:[0-9a-fA-F]{1,4}){1,3}|([0-9a-fA-F]{1,4}:){1,3}(:[0-9a-fA-F]{1,4}){1,4}|([0-9a-fA-F]{1,4}:){1,2}(:[0-9a-fA-F]{1,4}){1,5}|[0-9a-fA-F]{1,4}:((:[0-9a-fA-F]{1,4}){1,6})|:((:[0-9a-fA-F]{1,4}){1,7}|:))\/(12[0-8]|1[01][0-9]|[1-9]?[0-9])$/,GV=/^$|^(?:[0-9a-zA-Z+/]{4})*(?:(?:[0-9a-zA-Z+/]{2}==)|(?:[0-9a-zA-Z+/]{3}=))?$/,qV=/^(?:[A-Za-z0-9_-]{4})*(?:[A-Za-z0-9_-]{2,3})?$/,YV=/^https?$/,QV=/^\+[1-9]\d{6,14}$/,JI="(?:(?:\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\\d|30)|(?:02)-(?:0[1-9]|1\\d|2[0-8])))";function XV(e){return new RegExp(`^${e}$`)}const JV=XV(JI);function gw(e){const t="(?:[01]\\d|2[0-3]):[0-5]\\d";return typeof e.precision=="number"?e.precision===-1?`${t}`:e.precision===0?`${t}:[0-5]\\d`:`${t}:[0-5]\\d\\.\\d{${e.precision}}`:e.seconds?`${t}:[0-5]\\d(?:\\.\\d+)?`:`${t}(?::[0-5]\\d(?:\\.\\d+)?)?`}function eH(e){return new RegExp(`^${gw(e)}$`)}function tH(e){const t=["Z"];e.offset&&t.push("([+-](?:[01]\\d|2[0-3]):[0-5]\\d)");const n=`${gw({precision:e.precision,seconds:!0})}(?:${t.join("|")})`,r=e.local?`${n}|${gw({precision:e.precision})}`:n;return new RegExp(`^${JI}T(?:${r})$`)}const nH=/^[\s\S]{0,}$/,rH=/^-?\d+$/,Tb=/^-?\d+(?:\.\d+)?$/,sH=/^(?:true|false)$/i,iH=/^[^A-Z]*$/,oH=/^[^a-z]*$/,Os=fe("$ZodCheck",(e,t)=>{var n;e._zod??(e._zod={}),e._zod.def=t,(n=e._zod).onattach??(n.onattach=[])}),Rb=e=>{const t=e.value;return!jz(t)&&t.length!==void 0},F0={number:"number",bigint:"bigint",object:"date"},eO=fe("$ZodCheckLessThan",(e,t)=>{Os.init(e,t);const n=F0[typeof t.value];e._zod.check=r=>{(t.inclusive?r.value<=t.value:r.value<t.value)||r.issues.push({origin:F0[typeof r.value]??n,code:"too_big",maximum:typeof t.value=="object"?t.value.getTime():t.value,input:r.value,inclusive:t.inclusive,inst:e,continue:!t.abort})}}),tO=fe("$ZodCheckGreaterThan",(e,t)=>{Os.init(e,t);const n=F0[typeof t.value];e._zod.check=r=>{(t.inclusive?r.value>=t.value:r.value>t.value)||r.issues.push({origin:F0[typeof r.value]??n,code:"too_small",minimum:typeof t.value=="object"?t.value.getTime():t.value,input:r.value,inclusive:t.inclusive,inst:e,continue:!t.abort})}}),aH=fe("$ZodCheckMultipleOf",(e,t)=>{Os.init(e,t),e._zod.check=n=>{if(typeof n.value!=typeof t.value)throw new Error("Cannot mix number and bigint in multiple_of check.");(typeof n.value=="bigint"?t.value!==BigInt(0)&&n.value%t.value===BigInt(0):zz(n.value,t.value)===0)||n.issues.push({origin:typeof n.value,code:"not_multiple_of",divisor:t.value,input:n.value,inst:e,continue:!t.abort})}}),lH=fe("$ZodCheckNumberFormat",(e,t)=>{var o;Os.init(e,t),t.format=t.format||"float64";const n=(o=t.format)==null?void 0:o.includes("int"),r=n?"int":"number",[s,i]=WI[t.format];e._zod.check=c=>{const u=c.value;if(n){if(!Number.isInteger(u)){c.issues.push({expected:r,format:t.format,code:"invalid_type",continue:!1,input:u,inst:e});return}if(!Number.isSafeInteger(u)){u>0?c.issues.push({input:u,code:"too_big",maximum:Number.MAX_SAFE_INTEGER,note:"Integers must be within the safe integer range.",inst:e,origin:r,inclusive:!0,continue:!t.abort}):c.issues.push({input:u,code:"too_small",minimum:Number.MIN_SAFE_INTEGER,note:"Integers must be within the safe integer range.",inst:e,origin:r,inclusive:!0,continue:!t.abort});return}}u<s&&c.issues.push({origin:"number",input:u,code:"too_small",minimum:s,inclusive:!0,inst:e,continue:!t.abort}),u>i&&c.issues.push({origin:"number",input:u,code:"too_big",maximum:i,inclusive:!0,inst:e,continue:!t.abort})}}),cH=fe("$ZodCheckMaxLength",(e,t)=>{var n;Os.init(e,t),(n=e._zod.def).when??(n.when=Rb),e._zod.check=r=>{const s=r.value,i=s.length;if((typeof s=="string"&&i>t.maximum?Sb(s):i)<=t.maximum)return;const c=Eb(s);r.issues.push({origin:c,code:"too_big",maximum:t.maximum,inclusive:!0,input:s,inst:e,continue:!t.abort})}}),uH=fe("$ZodCheckMinLength",(e,t)=>{var n;Os.init(e,t),(n=e._zod.def).when??(n.when=Rb),e._zod.check=r=>{const s=r.value,i=s.length;if((typeof s=="string"&&i>=t.minimum&&i<t.minimum*2?Sb(s):i)>=t.minimum)return;const c=Eb(s);r.issues.push({origin:c,code:"too_small",minimum:t.minimum,inclusive:!0,input:s,inst:e,continue:!t.abort})}}),dH=fe("$ZodCheckLengthEquals",(e,t)=>{var n;Os.init(e,t),(n=e._zod.def).when??(n.when=Rb),e._zod.check=r=>{const s=r.value,i=s.length,o=typeof s=="string"&&i>=t.length&&i<=t.length*2?Sb(s):i;if(o===t.length)return;const c=Eb(s),u=o>t.length;r.issues.push({origin:c,...u?{code:"too_big",maximum:t.length}:{code:"too_small",minimum:t.length},inclusive:!0,exact:!0,input:r.value,inst:e,continue:!t.abort})}}),Ig=fe("$ZodCheckStringFormat",(e,t)=>{var n,r;Os.init(e,t),t.pattern?(n=e._zod).check??(n.check=s=>{t.pattern.lastIndex=0,!t.pattern.test(s.value)&&s.issues.push({origin:"string",code:"invalid_format",format:t.format,input:s.value,...t.pattern?{pattern:t.pattern.toString()}:{},inst:e,continue:!t.abort})}):(r=e._zod).check??(r.check=()=>{})}),fH=fe("$ZodCheckRegex",(e,t)=>{Ig.init(e,t),e._zod.check=n=>{t.pattern.lastIndex=0,!t.pattern.test(n.value)&&n.issues.push({origin:"string",code:"invalid_format",format:"regex",input:n.value,pattern:t.pattern.toString(),inst:e,continue:!t.abort})}}),hH=fe("$ZodCheckLowerCase",(e,t)=>{t.pattern??(t.pattern=iH),Ig.init(e,t)}),pH=fe("$ZodCheckUpperCase",(e,t)=>{t.pattern??(t.pattern=oH),Ig.init(e,t)}),mH=fe("$ZodCheckIncludes",(e,t)=>{Os.init(e,t);const n=id(t.includes),r=new RegExp(typeof t.position=="number"?`^.{${t.position},}${n}`:n);t.pattern=r,e._zod.check=s=>{s.value.includes(t.includes,t.position)||s.issues.push({origin:"string",code:"invalid_format",format:"includes",includes:t.includes,input:s.value,inst:e,continue:!t.abort})}}),gH=fe("$ZodCheckStartsWith",(e,t)=>{Os.init(e,t);const n=new RegExp(`^${id(t.prefix)}.*`);t.pattern??(t.pattern=n),e._zod.check=r=>{r.value.startsWith(t.prefix)||r.issues.push({origin:"string",code:"invalid_format",format:"starts_with",prefix:t.prefix,input:r.value,inst:e,continue:!t.abort})}}),vH=fe("$ZodCheckEndsWith",(e,t)=>{Os.init(e,t);const n=new RegExp(`.*${id(t.suffix)}$`);t.pattern??(t.pattern=n),e._zod.check=r=>{r.value.endsWith(t.suffix)||r.issues.push({origin:"string",code:"invalid_format",format:"ends_with",suffix:t.suffix,input:r.value,inst:e,continue:!t.abort})}}),yH=fe("$ZodCheckOverwrite",(e,t)=>{Os.init(e,t),e._zod.check=n=>{n.value=t.tx(n.value)}});class _H{constructor(t=[],n={}){this.content=[],this.indent=0,this.args=t,this.closed=n}indented(t){this.indent+=1;try{t(this)}finally{this.indent-=1}}write(t){if(typeof t=="function"){t(this,{execution:"sync"}),t(this,{execution:"async"});return}const r=t.split(`
|
|
22
|
+
`).filter(o=>o),s=Math.min(...r.map(o=>o.length-o.trimStart().length)),i=r.map(o=>o.slice(s)).map(o=>" ".repeat(this.indent*2)+o);for(const o of i)this.content.push(o)}compile(){const t=Function,n=(this==null?void 0:this.content)??[""];return new t(...Object.keys(this.closed),`return function (${this.args.join(", ")}) {
|
|
23
|
+
${n.join(`
|
|
24
|
+
`)}
|
|
25
|
+
};`)(...Object.values(this.closed))}}const wH={major:4,minor:6,patch:7},jn=fe("$ZodType",(e,t)=>{var i;var n;e??(e={}),e._zod.def=t,e._zod.bag=e._zod.bag||{},e._zod.version=wH;const r=e._zod.def.checks,s=e._zod.traits.has("$ZodCheck")?[e,...r??[]]:r!=null&&r.length?[...r]:[];for(const o of s)for(const c of o._zod.onattach)c(e);if(s.length===0)(n=e._zod).deferred??(n.deferred=[]),(i=e._zod.deferred)==null||i.push(()=>{e._zod.run=e._zod.parse});else{const o=(u,d,f)=>{if(u.memo)return u;let p=Jo(u),m;for(const v of d){if(v._zod.def.when){if(eV(u)||!v._zod.def.when(u))continue}else if(p)continue;const _=u.issues.length,w=v._zod.check(u);if(w instanceof Promise&&(f==null?void 0:f.async)===!1)throw new hc;if(m||w instanceof Promise)m=(m??Promise.resolve()).then(async()=>{await w,u.issues.length!==_&&(mw(u.issues,_,e),p||(p=Jo(u,_)))});else{if(u.issues.length===_)continue;mw(u.issues,_,e),p||(p=Jo(u,_))}}return m?m.then(()=>u):u},c=(u,d,f)=>{if(Jo(u))return u.aborted=!0,u;const p=o(d,s,f);if(p instanceof Promise){if(f.async===!1)throw new hc;return p.then(m=>e._zod.parse(m,f))}return e._zod.parse(p,f)};e._zod.run=(u,d)=>{if(d.skipChecks)return e._zod.parse(u,d);if(d.direction==="backward"){const p=e._zod.parse({value:u.value,issues:[]},{...d,skipChecks:!0});return p instanceof Promise?p.then(m=>c(m,u,d)):c(p,u,d)}const f=e._zod.parse(u,d);if(f instanceof Promise){if(d.async===!1)throw new hc;return f.then(p=>o(p,s,d))}return o(f,s,d)}}},{get"~standard"(){return GI(this,"~standard",rO(this))},set"~standard"(e){cl(this,"~standard",e)}}),nO=(e,t)=>e.issues.length?{issues:e.issues.map(n=>ll(n,t,_o()))}:{value:e.value};async function bH(e,t){const n={async:!0};return nO(await e._zod.run({value:t,issues:[]},n),n)}function rO(e){return{validate:t=>{const n={async:!1};try{const r=e._zod.run({value:t,issues:[]},n);if(!(r instanceof Promise))return nO(r,n)}catch{}return bH(e,t)},vendor:"zod",version:1}}const Ib=fe("$ZodString",(e,t)=>{jn.init(e,t),e._zod.pattern=t.pattern??nH,e._zod.parse=(n,r)=>{if(t.coerce)try{n.value=String(n.value)}catch{}return typeof n.value=="string"||n.issues.push({expected:"string",code:"invalid_type",input:n.value,inst:e}),n}}),Nn=fe("$ZodStringFormat",(e,t)=>{Ig.init(e,t),Ib.init(e,t)}),xH=fe("$ZodGUID",(e,t)=>{t.pattern??(t.pattern=zV),Nn.init(e,t)}),SH=fe("$ZodUUID",(e,t)=>{if(t.version){const r={v1:1,v2:2,v3:3,v4:4,v5:5,v6:6,v7:7,v8:8}[t.version];if(r===void 0)throw new Error(`Invalid UUID version: "${t.version}"`);t.pattern??(t.pattern=zC(r))}else t.pattern??(t.pattern=zC());Nn.init(e,t)}),EH=fe("$ZodEmail",(e,t)=>{t.pattern??(t.pattern=VV),Nn.init(e,t)}),sO=1,j0=2;function iO(e){try{return typeof URL<"u"&&typeof URL.canParse=="function"?URL.canParse(e):(new URL(e),!0)}catch{return!1}}function kH(e,t){return!("normalize"in t)&&!("hostname"in t)&&!("protocol"in t)?iO(e)||j0:CH(e,t)}function CH(e,t){var n;if(!t.normalize&&((n=t.protocol)==null?void 0:n.source)===YV.source&&!/^https?:\/\//i.test(e))return sO;try{if(typeof URL<"u"){const r=URL;if(typeof r.parse=="function")return r.parse(e)??j0}return new URL(e)}catch{return j0}}const PH=/[\t\n\r]/g;function VC(e){return e.replace(PH,"")}function AH(e,t){return t.lastIndex=0,t.test(e.hostname)}function TH(e,t){return t.lastIndex=0,t.test(e.protocol.endsWith(":")?e.protocol.slice(0,-1):e.protocol)}const RH=fe("$ZodURL",(e,t)=>{Nn.init(e,t),e._zod.check=n=>{try{const r=n.value.trim(),s=kH(r,t);if(s===sO){n.issues.push({code:"invalid_format",format:"url",note:"Invalid URL format",input:n.value,inst:e,continue:!t.abort});return}if(s===j0){n.issues.push({code:"invalid_format",format:"url",input:n.value,inst:e,continue:!t.abort});return}if(s===!0){n.value=VC(r);return}t.hostname&&!AH(s,t.hostname)&&n.issues.push({code:"invalid_format",format:"url",note:"Invalid hostname",pattern:t.hostname.source,input:n.value,inst:e,continue:!t.abort}),t.protocol&&!TH(s,t.protocol)&&n.issues.push({code:"invalid_format",format:"url",note:"Invalid protocol",pattern:t.protocol.source,input:n.value,inst:e,continue:!t.abort}),n.value=t.normalize?s.href:VC(r);return}catch{n.issues.push({code:"invalid_format",format:"url",input:n.value,inst:e,continue:!t.abort})}}}),IH=fe("$ZodEmoji",(e,t)=>{t.pattern??(t.pattern=UV()),Nn.init(e,t)}),OH=fe("$ZodNanoID",(e,t)=>{if(t.length!==void 0&&(!Number.isInteger(t.length)||t.length<1))throw new Error(`Invalid nanoid length: ${t.length}`);t.pattern??(t.pattern=t.length===void 0?DV:FV(t.length)),Nn.init(e,t)}),MH=fe("$ZodCUID",(e,t)=>{t.pattern??(t.pattern=OV),Nn.init(e,t)}),NH=fe("$ZodCUID2",(e,t)=>{t.pattern??(t.pattern=MV),Nn.init(e,t)}),LH=fe("$ZodULID",(e,t)=>{t.pattern??(t.pattern=NV),Nn.init(e,t)}),$H=fe("$ZodXID",(e,t)=>{t.pattern??(t.pattern=LV),Nn.init(e,t)}),DH=fe("$ZodKSUID",(e,t)=>{t.pattern??(t.pattern=$V),Nn.init(e,t)}),FH=fe("$ZodISODateTime",(e,t)=>{t.pattern??(t.pattern=tH(t)),Nn.init(e,t)}),jH=fe("$ZodISODate",(e,t)=>{t.pattern??(t.pattern=JV),Nn.init(e,t)}),zH=fe("$ZodISOTime",(e,t)=>{t.pattern??(t.pattern=eH(t)),Nn.init(e,t)}),VH=fe("$ZodISODuration",(e,t)=>{t.pattern??(t.pattern=jV),Nn.init(e,t)}),HH=fe("$ZodIPv4",(e,t)=>{t.pattern??(t.pattern=ZV),Nn.init(e,t)}),UH=/^[0-9a-fA-F:.]+$/;function oO(e){return UH.test(e)?iO(`http://[${e}]`):!1}const ZH=fe("$ZodIPv6",(e,t)=>{t.pattern??(t.pattern=BV),Nn.init(e,t),e._zod.check=n=>{oO(n.value)||n.issues.push({code:"invalid_format",format:"ipv6",input:n.value,inst:e,continue:!t.abort})}}),BH=fe("$ZodCIDRv4",(e,t)=>{t.pattern??(t.pattern=WV),Nn.init(e,t)});function WH(e){const t=e.split("/");if(t.length!==2)return!1;const[n,r]=t;if(!r)return!1;const s=Number(r);return`${s}`!==r||s<0||s>128?!1:oO(n)}const KH=fe("$ZodCIDRv6",(e,t)=>{t.pattern??(t.pattern=KV),Nn.init(e,t),e._zod.check=n=>{WH(n.value)||n.issues.push({code:"invalid_format",format:"cidrv6",input:n.value,inst:e,continue:!t.abort})}});function aO(e){if(e==="")return!0;if(/\s/.test(e)||e.length%4!==0)return!1;try{return atob(e),!0}catch{return!1}}const lO=/^[0-9a-zA-Z+/]*={0,2}$/,GH=fe("$ZodBase64",(e,t)=>{t.pattern??(t.pattern=lO),Nn.init(e,t),e._zod.check=n=>{aO(n.value)||n.issues.push({code:"invalid_format",format:"base64",input:n.value,inst:e,continue:!t.abort})}}),Ob=/^[A-Za-z0-9_-]*$/;function qH(e){if(!Ob.test(e))return!1;const t=e.replace(/[-_]/g,r=>r==="-"?"+":"/"),n=t.padEnd(Math.ceil(t.length/4)*4,"=");return aO(n)}const YH=fe("$ZodBase64URL",(e,t)=>{t.pattern??(t.pattern=Ob),Nn.init(e,t),e._zod.check=n=>{qH(n.value)||n.issues.push({code:"invalid_format",format:"base64url",input:n.value,inst:e,continue:!t.abort})}}),QH=fe("$ZodE164",(e,t)=>{t.pattern??(t.pattern=QV),Nn.init(e,t)});function XH(e,t=null){try{const n=e.split(".");if(n.length!==3)return!1;const[r]=n;if(!r)return!1;const s=JSON.parse(atob(r));return!("typ"in s&&(s==null?void 0:s.typ)!=="JWT"||!s.alg||t&&(!("alg"in s)||s.alg!==t))}catch{return!1}}const JH=fe("$ZodJWT",(e,t)=>{Nn.init(e,t),e._zod.check=n=>{XH(n.value,t.alg)||n.issues.push({code:"invalid_format",format:"jwt",input:n.value,inst:e,continue:!t.abort})}}),cO=fe("$ZodNumber",(e,t)=>{jn.init(e,t),e._zod.pattern=Tb,e._zod.parse=(n,r)=>{if(t.coerce)try{n.value=Number(n.value)}catch{}const s=n.value;if(typeof s=="number"&&!Number.isNaN(s)&&Number.isFinite(s))return n;const i=typeof s=="number"?Number.isNaN(s)?"NaN":Number.isFinite(s)?void 0:String(s):void 0;return n.issues.push({expected:"number",code:"invalid_type",input:s,inst:e,...i?{received:i}:{}}),n}}),eU=fe("$ZodNumberFormat",(e,t)=>{lH.init(e,t),cO.init(e,t)}),tU=fe("$ZodBoolean",(e,t)=>{jn.init(e,t),e._zod.pattern=sH,e._zod.parse=(n,r)=>{if(t.coerce)try{n.value=!!n.value}catch{}const s=n.value;return typeof s=="boolean"||n.issues.push({expected:"boolean",code:"invalid_type",input:s,inst:e}),n}}),nU=fe("$ZodUnknown",(e,t)=>{jn.init(e,t),e._zod.parse=n=>n}),rU=fe("$ZodNever",(e,t)=>{jn.init(e,t),e._zod.parse=(n,r)=>(n.issues.push({expected:"never",code:"invalid_type",input:n.value,inst:e}),n)});function sU(e,t){const n=$C(e._zod.def.checks);if(!n.length)return;const r=Math.min(...n.map(i=>i[0])),s=e._zod.parse;e._zod.parse=(i,o)=>{const c=t(i.value);if(c>r&&!(o!=null&&o.skipChecks)&&(o==null?void 0:o.direction)!=="backward"){for(const[u,d]of $C(e._zod.def.checks))if(c>u&&d._zod.def.when(i)){const f=i.issues.length;return d._zod.check(i),i.issues[f].continue=!1,mw(i.issues,f,e),i}}return s(i,o)}}const iU=e=>Array.isArray(e)?e.length:-1;function HC(e,t,n){e.issues.length&&t.issues.push(...Eu(n,e.issues)),t.value[n]=e.value}const oU=fe("$ZodArray",(e,t)=>{jn.init(e,t);const n=zi.memoizer;n==null||n.attach(e),e._zod.parse=(r,s)=>{const i=r.value;if(!Array.isArray(i))return r.issues.push({expected:"array",code:"invalid_type",input:i,inst:e}),r;r.value=n?n.alloc(e,r,Array(i.length),s):Array(i.length);const o=[],c=s==null?void 0:s.abortEarly;for(let u=0;u<i.length;u++){const d=i[u],f=t.element._zod.run({value:d,issues:[]},s);if(f instanceof Promise)o.push(f.then(p=>HC(p,r,u)));else if(HC(f,r,u),c&&f.issues.length!==0&&Jo(f))break}return o.length?Promise.all(o).then(()=>r):r},sU(e,iU)});function z0(e,t,n,r,s,i){const o=n in r,c=i==="optional";if(!(!o&&c&&s==="optional")){if(e.issues.length){if(s!==void 0&&c&&!o)return;t.issues.push(...Eu(n,e.issues))}if(!o&&s===void 0){e.issues.length||t.issues.push({code:"invalid_type",expected:"nonoptional",input:void 0,path:[n]});return}e.value===void 0?(o||s==="defaulted"&&!c)&&(t.value[n]=void 0):t.value[n]=e.value}}const aU=[];function uO(e){var o,c,u,d;const t=Object.keys(e.shape),n=Object.getOwnPropertySymbols(e.shape),r=n.length?n:aU,s=r.length?[...t,...r]:t;for(const f of s)if(!((d=(u=(c=(o=e.shape)==null?void 0:o[f])==null?void 0:c._zod)==null?void 0:u.traits)!=null&&d.has("$ZodType")))throw new Error(`Invalid element at key "${String(f)}": expected a Zod schema`);const i=Wz(e.shape);return{...e,allKeys:s,symbolKeys:r,keySet:new Set(t),numKeys:t.length,optionalKeys:new Set(i)}}function dO(e,t,n,r,s,i,o){const c=[],u=s.keySet,d=s.catchall._zod,f=d.def.type,p=d.optin,m=d.optout;let v=0;for(const _ in t){if(o&&n.issues.length!==v){if(Jo(n,v))break;v=n.issues.length}if(u.has(_))continue;if(_==="__proto__"){f==="never"&&c.push(_);continue}if(f==="never"){c.push(_);continue}const w=d.run({value:t[_],issues:[]},r);w instanceof Promise?e.push(w.then(b=>z0(b,n,_,t,p,m))):z0(w,n,_,t,p,m)}return c.length&&n.issues.push({code:"unrecognized_keys",keys:c,input:t,inst:i,continue:!0}),e.length?Promise.all(e).then(()=>n):n}const lU=fe("$ZodObject",(e,t)=>{jn.init(e,t);const n=Object.getOwnPropertyDescriptor(t,"shape"),r=n!=null&&n.get?n.get.raw:t.shape??{};if(r){const d=()=>{const f={...r};return Object.defineProperty(t,"shape",{value:f}),d.raw=f,f};d.raw=r,Object.defineProperty(t,"shape",{get:d})}const s=Ag(()=>uO(t));en(e,"propValues",d=>{const f=d.def.shape,p={};for(const m in f){const v=f[m]._zod;if(v.values){Object.prototype.hasOwnProperty.call(p,m)||ua(p,m,new Set);for(const _ of v.values)p[m].add(_);v.optin!==void 0&&p[m].add(void 0)}}return p});const i=hh,o=t.catchall;let c;const u=zi.memoizer;u==null||u.attach(e),e._zod.parse=(d,f)=>{c??(c=s.value);const p=d.value;if(!i(p))return d.issues.push({expected:"object",code:"invalid_type",input:p,inst:e}),d;d.value=u?u.alloc(e,d,{},f):{};const m=[],v=c.shape,_=f==null?void 0:f.abortEarly;let w=d.issues.length;for(const b of c.allKeys){if(_&&d.issues.length!==w){if(Jo(d,w))break;w=d.issues.length}if(b==="__proto__")continue;const S=v[b],E=S._zod.optin,C=S._zod.optout,A=S._zod.run({value:p[b],issues:[]},f);A instanceof Promise?m.push(A.then(T=>z0(T,d,b,p,E,C))):z0(A,d,b,p,E,C)}return o?dO(m,p,d,f,s.value,e,_===!0):m.length?Promise.all(m).then(()=>d):d}}),cU=fe("$ZodObjectJIT",(e,t)=>{lU.init(e,t);const n=e._zod.parse,r=Ag(()=>uO(t)),s=zi.memoizer,i=v=>{var T,M;const _=r.value,w=_.symbolKeys,b=new _H(["payload","ctx"],{shape:v,inst:e,memo:s,syms:w}),S=O=>`shape[${O}]._zod.run({ value: input[${O}], issues: [] }, ctx)`,E=(O,R)=>`
|
|
26
|
+
let ${O}_ab = false;
|
|
27
|
+
for (let i = 0; i < ${O}.issues.length; i++) {
|
|
28
|
+
const iss = ${O}.issues[i];
|
|
29
|
+
iss.path = iss.path ? [${R}, ...iss.path] : [${R}];
|
|
30
|
+
payload.issues.push(iss);
|
|
31
|
+
if (iss.continue !== true) ${O}_ab = true;
|
|
32
|
+
}
|
|
33
|
+
if (${O}_ab && ctx && ctx.abortEarly) {
|
|
34
|
+
payload.value = newResult;
|
|
35
|
+
return payload;
|
|
36
|
+
}`;b.write("const input = payload.value;");const C=Object.create(null);let A=0;for(const O of _.allKeys)C[O]=`key_${A++}`;b.write(s?"const newResult = memo.alloc(inst, payload, {}, ctx);":"const newResult = {};");for(const O of _.allKeys){if(O==="__proto__")continue;const R=C[O],D=typeof O=="symbol"?`syms[${w.indexOf(O)}]`:Hz(O),U=`${D} in input`,W=v[O],H=(T=W==null?void 0:W._zod)==null?void 0:T.optin,Y=H!==void 0,J=((M=W==null?void 0:W._zod)==null?void 0:M.optout)==="optional";if(b.write(`const ${R} = ${S(D)};`),Y&&J){const V=H==="optional"?`${R}_present`:`${R}.value !== undefined || ${R}_present`;b.write(`
|
|
37
|
+
const ${R}_present = ${U};
|
|
38
|
+
if (!${R}.issues.length || ${R}_present) {
|
|
39
|
+
if (${R}.issues.length) {${E(R,D)}
|
|
40
|
+
}
|
|
41
|
+
|
|
42
|
+
if (${V}) {
|
|
43
|
+
newResult[${D}] = ${R}.value;
|
|
44
|
+
}
|
|
45
|
+
}
|
|
46
|
+
|
|
47
|
+
`)}else Y?(b.write(`
|
|
48
|
+
if (${R}.issues.length) {${E(R,D)}
|
|
49
|
+
}
|
|
50
|
+
`),H==="defaulted"?b.write(`newResult[${D}] = ${R}.value;`):b.write(`
|
|
51
|
+
if (${R}.value !== undefined || ${U}) {
|
|
52
|
+
newResult[${D}] = ${R}.value;
|
|
53
|
+
}
|
|
54
|
+
`)):b.write(`
|
|
55
|
+
const ${R}_present = ${U};
|
|
56
|
+
if (${R}.issues.length) {${E(R,D)}
|
|
57
|
+
}
|
|
58
|
+
if (!${R}_present && !${R}.issues.length) {
|
|
59
|
+
payload.issues.push({
|
|
60
|
+
code: "invalid_type",
|
|
61
|
+
expected: "nonoptional",
|
|
62
|
+
input: undefined,
|
|
63
|
+
path: [${D}]
|
|
64
|
+
});
|
|
65
|
+
if (ctx && ctx.abortEarly) {
|
|
66
|
+
payload.value = newResult;
|
|
67
|
+
return payload;
|
|
68
|
+
}
|
|
69
|
+
}
|
|
70
|
+
|
|
71
|
+
if (${R}_present) {
|
|
72
|
+
newResult[${D}] = ${R}.value;
|
|
73
|
+
}
|
|
74
|
+
|
|
75
|
+
`)}return b.write("payload.value = newResult;"),b.write("return payload;"),b.compile()};let o;const c=hh,u=!zi.jitless,f=u&&Zz.value,p=t.catchall;let m;e._zod.parse=(v,_)=>{m??(m=r.value);const w=v.value;return c(w)?u&&f&&(_==null?void 0:_.async)===!1&&_.jitless!==!0?(o||(o=i(t.shape)),v=o(v,_),p?dO([],w,v,_,m,e,(_==null?void 0:_.abortEarly)===!0):v):n(v,_):(v.issues.push({expected:"object",code:"invalid_type",input:w,inst:e}),v)}});function UC(e,t,n,r){for(const i of e)if(i.issues.length===0)return t.value=i.value,t;const s=e.filter(i=>!Jo(i));return s.length===1?(t.value=s[0].value,s[0]):(t.issues.push({code:"invalid_union",input:t.value,inst:n,errors:e.map(i=>i.issues.map(o=>ll(o,r,_o())))}),t)}const fO=fe("$ZodUnion",(e,t)=>{jn.init(e,t),en(e,"optin",r=>r.def.options.some(s=>s._zod.optin==="defaulted")?"defaulted":r.def.options.some(s=>s._zod.optin!==void 0)?"optional":void 0),en(e,"optout",r=>r.def.options.some(s=>s._zod.optout==="optional")?"optional":void 0),en(e,"values",r=>{if(r.def.options.every(s=>s._zod.values))return new Set(r.def.options.flatMap(s=>Array.from(s._zod.values)))}),en(e,"pattern",r=>{if(r.def.options.every(s=>s._zod.pattern)){const s=r.def.options.map(i=>i._zod.pattern);return new RegExp(`^(${s.map(i=>bb(i.source)).join("|")})$`)}});const n=t.options.length===1?t.options[0]._zod.run:null;e._zod.parse=(r,s)=>{if(n)return n(r,s);let i=!1;const o=[];for(const c of t.options){const u=c._zod.run({value:r.value,issues:[]},s);if(u instanceof Promise)o.push(u),i=!0;else{if(u.issues.length===0)return u;o.push(u)}}return i?Promise.all(o).then(c=>UC(c,r,e,s)):UC(o,r,e,s)}});function uU(e){var n;const t=new Map;for(const r of e.options){const s=(n=r._zod.propValues)==null?void 0:n[e.discriminator];if(!s||s.size===0)throw new Error(`Invalid discriminated union option at index "${e.options.indexOf(r)}"`);for(const i of s)if(t.has(i)){if(i!==void 0)throw new Error(`Duplicate discriminator value "${String(i)}"`);t.set(i,null)}else t.set(i,r)}return t}const dU=fe("$ZodDiscriminatedUnion",(e,t)=>{t.inclusive=!1,fO.init(e,t);const n=e._zod.parse;en(e,"propValues",s=>{var c,u;const i={};let o=0;for(const d of s.def.options){const f=d._zod.propValues;if(!f||Object.keys(f).length===0)throw new Error(`Invalid discriminated union option at index "${s.def.options.indexOf(d)}"`);(c=f[s.def.discriminator])!=null&&c.has(void 0)&&o++;for(const[p,m]of Object.entries(f)){Object.prototype.hasOwnProperty.call(i,p)||ua(i,p,new Set);for(const v of m)i[p].add(v)}}return!s.def.unionFallback&&o>1&&((u=i[s.def.discriminator])==null||u.delete(void 0)),i}),t.options.forEach((s,i)=>{const o=xb(s._zod.def);if(o&&!Object.prototype.hasOwnProperty.call(o,t.discriminator))throw new Error(`Invalid discriminated union option at index "${i}"`)});const r=Ag(()=>uU(t));e._zod.parse=(s,i)=>{const o=s.value;if(!hh(o))return s.issues.push({code:"invalid_type",expected:"object",input:o,inst:e}),s;const c=o==null?void 0:o[t.discriminator],u=r.value.get(c);return u&&(c!==void 0||i.direction!=="backward")?u._zod.run(s,i):t.unionFallback||i.direction==="backward"?n(s,i):(s.issues.push({code:"invalid_union",errors:[],note:"No matching discriminator",discriminator:t.discriminator,options:Array.from(r.value.keys()).filter(d=>r.value.get(d)!==null),input:o,path:[t.discriminator],inst:e}),s)}}),fU=fe("$ZodIntersection",(e,t)=>{jn.init(e,t),e._zod.parse=(n,r)=>{const s=n.value,i=t.left._zod.run({value:s,issues:[]},r),o=t.right._zod.run({value:s,issues:[]},r);return i instanceof Promise||o instanceof Promise?Promise.all([i,o]).then(([u,d])=>ZC(n,u,d)):ZC(n,i,o)}});function vw(e,t){if(e===t)return{valid:!0,data:e};if(e instanceof Date&&t instanceof Date&&+e==+t)return{valid:!0,data:e};if(sd(e)&&sd(t)){const n=Object.keys(t),r=Object.keys(e).filter(i=>n.indexOf(i)!==-1),s={...e,...t};Object.prototype.hasOwnProperty.call(s,"__proto__")&&delete s.__proto__;for(const i of r){if(i==="__proto__")continue;const o=vw(e[i],t[i]);if(!o.valid)return{valid:!1,mergeErrorPath:[i,...o.mergeErrorPath]};s[i]=o.data}return{valid:!0,data:s}}if(Array.isArray(e)&&Array.isArray(t)){if(e.length!==t.length)return{valid:!1,mergeErrorPath:[]};const n=[];for(let r=0;r<e.length;r++){const s=e[r],i=t[r],o=vw(s,i);if(!o.valid)return{valid:!1,mergeErrorPath:[r,...o.mergeErrorPath]};n.push(o.data)}return{valid:!0,data:n}}return{valid:!1,mergeErrorPath:[]}}function ZC(e,t,n){const r=new Map;let s;const i=new Map,o=(d,f)=>{var m,v;let p;if(d.code==="unrecognized_keys"&&!((m=d.path)!=null&&m.length))s??(s=d),p=d.keys;else if(d.code==="invalid_key"&&d.origin==="record"&&((v=d.path)==null?void 0:v.length)===1){const _=String(d.path[0]);i.has(_)||i.set(_,d),p=[_]}else return!1;for(const _ of p)r.has(_)||r.set(_,{}),r.get(_)[f]=!0;return!0};for(const d of t.issues)o(d,"l")||e.issues.push(d);for(const d of n.issues)o(d,"r")||e.issues.push(d);const c=[...r].filter(([,d])=>d.l&&d.r).map(([d])=>d);if(c.length){const d=s?c.filter(f=>s.keys.includes(f)):[];d.length&&e.issues.push({...s,keys:d});for(const f of c)!d.includes(f)&&i.has(f)&&e.issues.push(i.get(f))}const u=vw(t.value,n.value);if(!u.valid){if(Jo(e))return e;throw new Error(`Unmergable intersection. Error path: ${JSON.stringify(u.mergeErrorPath)}`)}return e.value=u.data,e}const hU=fe("$ZodRecord",(e,t)=>{jn.init(e,t);const n=zi.memoizer;n==null||n.attach(e),e._zod.parse=(r,s)=>{const i=r.value;if(!sd(i))return r.issues.push({expected:"record",code:"invalid_type",input:i,inst:e}),r;const o=[],c=t.keyType._zod.values;if(c&&!t.partial){r.value=n?n.alloc(e,r,{},s):{};const u=new Set;for(const f of c)if(typeof f=="string"||typeof f=="number"||typeof f=="symbol"){if(u.add(typeof f=="number"?f.toString():f),f==="__proto__")continue;const p=t.keyType._zod.run({value:f,issues:[]},s);if(p instanceof Promise)throw new Error("Async schemas not supported in object keys currently");if(p.issues.length){r.issues.push({code:"invalid_key",origin:"record",issues:p.issues.map(_=>ll(_,s,_o())),input:f,path:[f],inst:e});continue}const m=p.value;if(m==="__proto__")continue;const v=t.valueType._zod.run({value:i[f],issues:[]},s);v instanceof Promise?o.push(v.then(_=>{_.issues.length&&r.issues.push(...Eu(f,_.issues)),r.value[m]=_.value})):(v.issues.length&&r.issues.push(...Eu(f,v.issues)),r.value[m]=v.value)}let d;for(const f in i)if(!u.has(f))if(t.mode==="loose"){if(f==="__proto__")continue;r.value[f]=i[f]}else d=d??[],d.push(f);d&&d.length>0&&r.issues.push({code:"unrecognized_keys",input:i,inst:e,keys:d,continue:!0})}else{r.value=n?n.alloc(e,r,{},s):{};let u;for(const d of Reflect.ownKeys(i)){if(d==="__proto__"||!Object.prototype.propertyIsEnumerable.call(i,d))continue;let f=t.keyType._zod.run({value:d,issues:[]},s);if(f instanceof Promise)throw new Error("Async schemas not supported in object keys currently");if(typeof d=="string"&&Tb.test(d)&&f.issues.length){const _=t.keyType._zod.run({value:Number(d),issues:[]},s);if(_ instanceof Promise)throw new Error("Async schemas not supported in object keys currently");_.issues.length===0&&(f=_)}if(f.issues.length){t.mode==="loose"?r.value[d]=i[d]:c?(u=u??[],u.push(d)):r.issues.push({code:"invalid_key",origin:"record",issues:f.issues.map(_=>ll(_,s,_o())),input:d,path:[d],inst:e});continue}const m=f.value;if(m==="__proto__")continue;const v=t.valueType._zod.run({value:i[d],issues:[]},s);v instanceof Promise?o.push(v.then(_=>{_.issues.length&&r.issues.push(...Eu(d,_.issues)),r.value[m]=_.value})):(v.issues.length&&r.issues.push(...Eu(d,v.issues)),r.value[m]=v.value)}u&&u.length>0&&r.issues.push({code:"unrecognized_keys",input:i,inst:e,keys:u,continue:!0})}return o.length?Promise.all(o).then(()=>r):r}}),pU=fe("$ZodEnum",(e,t)=>{jn.init(e,t);const n=hw(t.entries),r=new Set(n);e._zod.values=r,en(e,"pattern",s=>{const i=hw(s.def.entries).filter(o=>Bz.has(typeof o));return new RegExp(i.length?`^(${i.map(o=>id(o.toString())).join("|")})$`:"^[^\\s\\S]$")}),e._zod.parse=(s,i)=>{const o=s.value;return r.has(o)||s.issues.push({code:"invalid_value",values:n,input:o,inst:e}),s}}),mU=fe("$ZodLiteral",(e,t)=>{jn.init(e,t);const n=new Set(t.values);e._zod.values=n,en(e,"pattern",r=>{const s=r.def.values;return new RegExp(s.length?`^(${s.map(i=>typeof i=="string"?id(i):i?id(i.toString()):String(i)).join("|")})$`:"^[^\\s\\S]$")}),e._zod.parse=(r,s)=>{const i=r.value;return n.has(i)||r.issues.push({code:"invalid_value",values:t.values,input:i,inst:e}),r}}),gU=fe("$ZodTransform",(e,t)=>{var n;jn.init(e,t),e._zod.optin="optional",(n=zi.memoizer)==null||n.guard(e),e._zod.parse=(r,s)=>{if(s.direction==="backward")throw new QI(e.constructor.name);const i=t.transform(r.value,r);if(s.async)return(i instanceof Promise?i:Promise.resolve(i)).then(c=>(r.value=c,r));if(i instanceof Promise)throw new hc;return r.value=i,r}});function BC(e,t){return e.value=t.issues.length?void 0:t.value,e}const hO=fe("$ZodOptional",(e,t)=>{jn.init(e,t),en(e,"optin",n=>n.def.innerType._zod.optin==="defaulted"?"defaulted":"optional"),e._zod.optout="optional",en(e,"values",n=>{const r=n.def.innerType._zod.values;return r?new Set([...r,void 0]):void 0}),en(e,"pattern",n=>{const r=n.def.innerType._zod.pattern;return r?new RegExp(`^(${bb(r.source)})?$`):void 0}),e._zod.parse=(n,r)=>{if(n.value===void 0){if(t.innerType._zod.optin!=="defaulted")return n;const s=t.innerType._zod.run({value:n.value,issues:[]},r);return s instanceof Promise?s.then(i=>BC(n,i)):BC(n,s)}return t.innerType._zod.run(n,r)}}),vU=fe("$ZodExactOptional",(e,t)=>{hO.init(e,t),en(e,"values",n=>n.def.innerType._zod.values),en(e,"pattern",n=>n.def.innerType._zod.pattern),e._zod.parse=(n,r)=>t.innerType._zod.run(n,r)}),yU=fe("$ZodNullable",(e,t)=>{jn.init(e,t),en(e,"optin",n=>n.def.innerType._zod.optin),en(e,"optout",n=>n.def.innerType._zod.optout),en(e,"pattern",n=>{const r=n.def.innerType._zod.pattern;return r?new RegExp(`^(${bb(r.source)}|null)$`):void 0}),en(e,"values",n=>n.def.innerType._zod.values?new Set([...n.def.innerType._zod.values,null]):void 0),e._zod.parse=(n,r)=>n.value===null?n:t.innerType._zod.run(n,r)}),_U=fe("$ZodDefault",(e,t)=>{jn.init(e,t),e._zod.optin="defaulted",en(e,"values",n=>n.def.innerType._zod.values),e._zod.parse=(n,r)=>{if(r.direction==="backward")return t.innerType._zod.run(n,r);if(n.value===void 0)return n.value=t.defaultValue,n;const s=t.innerType._zod.run(n,r);return s instanceof Promise?s.then(i=>WC(i,t)):WC(s,t)}});function WC(e,t){return e.value===void 0&&(e.value=t.defaultValue),e}const wU=fe("$ZodPrefault",(e,t)=>{jn.init(e,t),e._zod.optin="defaulted",en(e,"values",n=>n.def.innerType._zod.values),e._zod.parse=(n,r)=>(r.direction==="backward"||n.value===void 0&&(n.value=t.defaultValue),t.innerType._zod.run(n,r))}),bU=fe("$ZodNonOptional",(e,t)=>{jn.init(e,t),en(e,"values",n=>{const r=n.def.innerType._zod.values;return r?new Set([...r].filter(s=>s!==void 0)):void 0}),e._zod.parse=(n,r)=>{const s=t.innerType._zod.run(n,r);return s instanceof Promise?s.then(i=>KC(i,e)):KC(s,e)}});function KC(e,t){return!e.issues.length&&e.value===void 0&&e.issues.push({code:"invalid_type",expected:"nonoptional",input:e.value,inst:t}),e}function GC(e,t,n,r){return t.issues.length?(e.value=n.catchValue({...t,value:e.value,error:{issues:t.issues.map(s=>ll(s,r,_o()))},input:e.value}),e):(e.value=t.value,t.memo&&(e.memo=!0),e)}const xU=fe("$ZodCatch",(e,t)=>{jn.init(e,t),en(e,"optin",n=>n.def.innerType._zod.optin==="defaulted"?"defaulted":"optional"),en(e,"optout",n=>n.def.innerType._zod.optout),en(e,"values",n=>n.def.innerType._zod.values),e._zod.parse=(n,r)=>{if(r.direction==="backward")return t.innerType._zod.run(n,r);const s=t.innerType._zod.run({value:n.value,issues:[]},r);return s instanceof Promise?s.then(i=>GC(n,i,t,r)):GC(n,s,t,r)}}),SU=fe("$ZodPipe",(e,t)=>{jn.init(e,t),en(e,"values",n=>n.def.in._zod.values),en(e,"optin",n=>n.def.in._zod.optin),en(e,"optout",n=>n.def.out._zod.optout),en(e,"propValues",n=>n.def.in._zod.propValues),e._zod.parse=(n,r)=>{if(r.direction==="backward"){const i=t.out._zod.run(n,r);return i instanceof Promise?i.then(o=>hm(o,t.in,r)):hm(i,t.in,r)}const s=t.in._zod.run(n,r);return s instanceof Promise?s.then(i=>hm(i,t.out,r)):hm(s,t.out,r)}});function hm(e,t,n){return e.issues.some(r=>r.code!=="unrecognized_keys")?(e.aborted=!0,e):t._zod.run({value:e.value,issues:e.issues},n)}const EU=fe("$ZodReadonly",(e,t)=>{jn.init(e,t),en(e,"propValues",n=>n.def.innerType._zod.propValues),en(e,"values",n=>n.def.innerType._zod.values),en(e,"optin",n=>{var r,s;return(s=(r=n.def.innerType)==null?void 0:r._zod)==null?void 0:s.optin}),en(e,"optout",n=>{var r,s;return(s=(r=n.def.innerType)==null?void 0:r._zod)==null?void 0:s.optout}),e._zod.parse=(n,r)=>{if(r.direction==="backward")return t.innerType._zod.run(n,r);const s=t.innerType._zod.run(n,r);return s instanceof Promise?s.then(qC):qC(s)}});function qC(e){return e.memo||(e.value=Object.freeze(e.value)),e}const kU=fe("$ZodCustom",(e,t)=>{Os.init(e,t),jn.init(e,t),e._zod.parse=(n,r)=>n,e._zod.check=n=>{const r=n.value,s=t.fn(r);if(s instanceof Promise)return s.then(i=>YC(i,n,r,e));YC(s,n,r,e)}});function YC(e,t,n,r){if(!e){const s={code:"custom",input:n,inst:r,path:[...r._zod.def.path??[]],continue:!r._zod.def.abort};r._zod.def.params&&(s.params=r._zod.def.params),t.issues.push(ph(s))}}class CU extends Error{constructor(){super("Cannot parse a reference cycle that closes through a transform"),this.name="ZodCyclicError"}}const yw="~memo",QC=[];function pO(e){return e!==null&&typeof e=="object"}function I1(e){return e.map(t=>t.path?{...t,path:t.path.slice()}:{...t})}const mO=new WeakMap,Lf=0,Ym=1,Jf=2;function Qm(e,t,n){const r=mO.get(e);if(r!==void 0)return r?Jf:Lf;if(t.has(e))return Jf;t.add(e);let s=Lf;const i=f=>{if(s!==Jf&&(f!=null&&f._zod)){const p=Qm(f,t);p>s&&(s=p)}},o=(f,p)=>{var v;let m=Lf;for(const _ of Reflect.ownKeys(f)){const w=Object.getOwnPropertyDescriptor(f,_);if(!w.enumerable)continue;const b=w.get?Ym:(v=w.value)!=null&&v._zod?Qm(w.value,t):Lf;b>m&&(m=b)}return m},c=f=>{f>s&&(s=f)},u=e._zod.def;switch(u.type){case"object":{const f=xb(u);c(f?o(f):Ym),i(u.catchall);break}case"array":i(u.element);break;case"tuple":for(const f of u.items)i(f);i(u.rest);break;case"record":case"map":i(u.keyType),i(u.valueType);break;case"set":i(u.valueType);break;case"union":for(const f of u.options)i(f);break;case"intersection":i(u.left),i(u.right);break;case"optional":case"nullable":case"default":case"prefault":case"catch":case"readonly":case"nonoptional":case"promise":case"success":i(u.innerType);break;case"pipe":i(u.in),i(u.out);break;case"function":i(u.input),i(u.output);break;case"lazy":{const f=u._cachedInner??void 0;c(f?Qm(f,t):Ym);break}case"template_literal":case"string":case"number":case"int":case"boolean":case"bigint":case"symbol":case"undefined":case"null":case"void":case"never":case"any":case"unknown":case"date":case"nan":case"enum":case"literal":case"file":case"transform":case"custom":break;default:for(const f in u){const p=Object.getOwnPropertyDescriptor(u,f);if(!p||p.get)continue;const m=p.value;if(!(!m||typeof m!="object")){if(m._zod)i(m);else if(Array.isArray(m))for(const v of m)i(v)}}}return t.delete(e),PU(e,s)}function PU(e,t){return t!==Ym&&mO.set(e,t===Jf),t}function AU(e,t){let n=e.buckets.get(t);return n||(n=new WeakMap,e.buckets.set(t,n)),n}let pm;const mm=[],TU={alloc(e,t,n){const r=pm;if(!r)return n;pm=void 0;const s={value:n,issues:null};return r.set(t.value,s),mm.push(s),n},guard(e){var t;(t=e._zod).deferred??(t.deferred=[]),e._zod.deferred.push(()=>{const n=e._zod.parse,r=(s,i)=>{if(i.direction!=="backward"&&IU(i,s.value))throw new CU;return n(s,i)};e._zod.parse=r,e._zod.run===n&&(e._zod.run=r)})},attach(e){var t;let n,r=!1,s,i;(t=e._zod).deferred??(t.deferred=[]),e._zod.deferred.push(()=>{const o=e._zod.parse,c=(u,d)=>{if(n===void 0){const S=Qm(e,new Set);if(S===Lf)return e._zod.parse=o,e._zod.run===c&&(e._zod.run=o),o(u,d);S===Jf||r?n=!0:r=!0}const f=u.value;if(!pO(f))return o(u,d);let p=d[yw];p||(p={buckets:new WeakMap,backEdges:void 0},d[yw]=p);let m;s===d?m=i:(m=AU(p,e),s=d,i=m);const v=m.get(f);if(v)return u.value=v.value,v.issues?v.issues.length&&u.issues.push(...I1(v.issues)):(u.memo=!0,p.backEdges??(p.backEdges=new WeakSet),p.backEdges.add(v.value)),u;pm=m;const _=mm.length,w=o(u,d);pm=void 0;const b=mm.length>_?mm.pop():void 0;return w instanceof Promise?w.then(S=>(b&&(b.issues=S.issues.length?I1(S.issues):QC),S)):(b&&(b.issues=w.issues.length?I1(w.issues):QC),w)};e._zod.parse=c,e._zod.run===o&&(e._zod.run=c)})}};function RU(){return TU}function IU(e,t){var r;const n=(r=e[yw])==null?void 0:r.backEdges;return n!==void 0&&pO(t)&&n.has(t)}const OU=()=>{const e={string:{unit:"characters",verb:"to have"},file:{unit:"bytes",verb:"to have"},array:{unit:"items",verb:"to have"},set:{unit:"items",verb:"to have"},map:{unit:"entries",verb:"to have"}};function t(i){return e[i]??null}const n={regex:"input",email:"email address",url:"URL",emoji:"emoji",uuid:"UUID",uuidv4:"UUIDv4",uuidv6:"UUIDv6",nanoid:"nanoid",guid:"GUID",cuid:"cuid",cuid2:"cuid2",ulid:"ULID",xid:"XID",ksuid:"KSUID",datetime:"ISO datetime",date:"ISO date",time:"ISO time",duration:"ISO duration",ipv4:"IPv4 address",ipv6:"IPv6 address",mac:"MAC address",cidrv4:"IPv4 range",cidrv6:"IPv6 range",base64:"base64-encoded string",base64url:"base64url-encoded string",json_string:"JSON string",e164:"E.164 number",currency_code:"currency code",credit_card:"credit card number",iban:"IBAN",jwt:"JWT",template_literal:"input"},r={nan:"NaN"};function s(i,o){return i==="number"&&typeof o=="number"&&!Number.isFinite(o)?String(o):r[i]??i}return i=>{switch(i.code){case"invalid_type":{const o=s(i.expected),c=nV(i.input),u=s(c,i.input);return`Invalid input: expected ${o}, received ${u}`}case"invalid_value":return i.values.length===1?`Invalid input: expected ${BI(i.values[0])}`:`Invalid option: expected one of ${NC(i.values,"|")}`;case"too_big":{const o=i.exact?"exactly ":i.inclusive?"<=":"<",c=t(i.origin);return c?`Too big: expected ${i.origin??"value"} to have ${o}${i.maximum.toString()} ${c.unit??"elements"}`:`Too big: expected ${i.origin??"value"} to be ${o}${i.maximum.toString()}`}case"too_small":{const o=i.exact?"exactly ":i.inclusive?">=":">",c=t(i.origin);return c?`Too small: expected ${i.origin} to have ${o}${i.minimum.toString()} ${c.unit}`:`Too small: expected ${i.origin} to be ${o}${i.minimum.toString()}`}case"invalid_format":{const o=i;return o.format==="starts_with"?`Invalid string: must start with "${o.prefix}"`:o.format==="ends_with"?`Invalid string: must end with "${o.suffix}"`:o.format==="includes"?`Invalid string: must include "${o.includes}"`:o.format==="regex"?`Invalid string: must match pattern ${o.pattern}`:`Invalid ${n[o.format]??i.format}`}case"not_multiple_of":return`Invalid number: must be a multiple of ${i.divisor}`;case"unrecognized_keys":return`Unrecognized key${i.keys.length>1?"s":""}: ${NC(i.keys,", ")}`;case"invalid_key":return`Invalid key in ${i.origin}`;case"invalid_union":return i.options&&Array.isArray(i.options)&&i.options.length>0?`Invalid discriminator value. Expected ${i.options.map(c=>`'${c}'`).join(" | ")}`:i.inclusive===!1?"Invalid input: more than one option matched":"Invalid input";case"invalid_element":return`Invalid value in ${i.origin}`;default:return"Invalid input"}}};function MU(){return{localeError:OU()}}var XC;class NU{constructor(){this._map=new WeakMap,this._idmap=new Map}add(t,...n){const r=n[0];return this._map.set(t,r),r&&typeof r=="object"&&"id"in r&&this._idmap.set(r.id,t),this}clear(){return this._map=new WeakMap,this._idmap=new Map,this}remove(t){const n=this._map.get(t);return n&&typeof n=="object"&&"id"in n&&this._idmap.delete(n.id),this._map.delete(t),this}get(t){const n=t._zod.parent;if(n){const r={...this.get(n)??{}};delete r.id;const s={...r,...this._map.get(t)};return Object.keys(s).length?s:void 0}return this._map.get(t)}has(t){return this._map.has(t)}}function LU(){return new NU}(XC=globalThis).__zod_globalRegistry??(XC.__zod_globalRegistry=LU());const $f=globalThis.__zod_globalRegistry;function gO(e){return e.checks&&(e.checks=[...e.checks]),e}function $U(e,t){return new e(gO({type:"string",...nt(t)}))}function DU(e,t){return new e({type:"string",format:"email",check:"string_format",abort:!1,...nt(t)})}function FU(e,t){return new e({type:"string",format:"guid",check:"string_format",abort:!1,...nt(t)})}function jU(e,t){return new e({type:"string",format:"uuid",check:"string_format",abort:!1,...nt(t)})}function zU(e,t){return new e({type:"string",format:"uuid",check:"string_format",abort:!1,version:"v4",...nt(t)})}function VU(e,t){return new e({type:"string",format:"uuid",check:"string_format",abort:!1,version:"v6",...nt(t)})}function HU(e,t){return new e({type:"string",format:"uuid",check:"string_format",abort:!1,version:"v7",...nt(t)})}function UU(e,t){return new e({type:"string",format:"url",check:"string_format",abort:!1,...nt(t)})}function ZU(e,t){return new e({type:"string",format:"emoji",check:"string_format",abort:!1,...nt(t)})}function BU(e,t){return new e({type:"string",format:"nanoid",check:"string_format",abort:!1,...nt(t)})}function WU(e,t){return new e({type:"string",format:"cuid",check:"string_format",abort:!1,...nt(t)})}function KU(e,t){return new e({type:"string",format:"cuid2",check:"string_format",abort:!1,...nt(t)})}function GU(e,t){return new e({type:"string",format:"ulid",check:"string_format",abort:!1,...nt(t)})}function qU(e,t){return new e({type:"string",format:"xid",check:"string_format",abort:!1,...nt(t)})}function YU(e,t){return new e({type:"string",format:"ksuid",check:"string_format",abort:!1,...nt(t)})}function QU(e,t){return new e({type:"string",format:"ipv4",check:"string_format",abort:!1,...nt(t)})}function XU(e,t){return new e({type:"string",format:"ipv6",check:"string_format",abort:!1,...nt(t)})}function JU(e,t){return new e({type:"string",format:"cidrv4",check:"string_format",abort:!1,...nt(t)})}function eZ(e,t){return new e({type:"string",format:"cidrv6",check:"string_format",abort:!1,...nt(t)})}function tZ(e,t){return new e({type:"string",format:"base64",check:"string_format",abort:!1,...nt(t)})}function nZ(e,t){return new e({type:"string",format:"base64url",check:"string_format",abort:!1,...nt(t)})}function rZ(e,t){return new e({type:"string",format:"e164",check:"string_format",abort:!1,...nt(t)})}function sZ(e,t){return new e({type:"string",format:"jwt",check:"string_format",abort:!1,...nt(t)})}function iZ(e,t){return new e({type:"string",format:"datetime",check:"string_format",offset:!1,local:!1,precision:null,...nt(t)})}function oZ(e,t){return new e({type:"string",format:"date",check:"string_format",...nt(t)})}function aZ(e,t){return new e({type:"string",format:"time",check:"string_format",precision:null,...nt(t)})}function lZ(e,t){return new e({type:"string",format:"duration",check:"string_format",...nt(t)})}function cZ(e,t){return new e(gO({type:"number",checks:[],...nt(t)}))}function uZ(e,t){return new e({type:"number",check:"number_format",abort:!1,format:"safeint",...nt(t)})}function dZ(e,t){return new e({type:"boolean",...nt(t)})}function fZ(e){return new e({type:"unknown"})}function hZ(e,t){return new e({type:"never",...nt(t)})}function JC(e,t){return new eO({check:"less_than",...nt(t),value:e,inclusive:!1})}function O1(e,t){return new eO({check:"less_than",...nt(t),value:e,inclusive:!0})}function e8(e,t){return new tO({check:"greater_than",...nt(t),value:e,inclusive:!1})}function M1(e,t){return new tO({check:"greater_than",...nt(t),value:e,inclusive:!0})}function t8(e,t){return new aH({check:"multiple_of",...nt(t),value:e})}function vO(e,t){return new cH({check:"max_length",...nt(t),maximum:e})}function V0(e,t){return new uH({check:"min_length",...nt(t),minimum:e})}function yO(e,t){return new dH({check:"length_equals",...nt(t),length:e})}function pZ(e,t){return new fH({check:"string_format",format:"regex",...nt(t),pattern:e})}function mZ(e){return new hH({check:"string_format",format:"lowercase",...nt(e)})}function gZ(e){return new pH({check:"string_format",format:"uppercase",...nt(e)})}function vZ(e,t){return new mH({check:"string_format",format:"includes",...nt(t),includes:e})}function yZ(e,t){return new gH({check:"string_format",format:"starts_with",...nt(t),prefix:e})}function _Z(e,t){return new vH({check:"string_format",format:"ends_with",...nt(t),suffix:e})}function Sd(e){return new yH({check:"overwrite",tx:e})}function wZ(e){return Sd(t=>t.normalize(e))}function bZ(){return Sd(e=>e.trim())}function xZ(){return Sd(e=>e.toLowerCase())}function SZ(){return Sd(e=>e.toUpperCase())}function EZ(){return Sd(e=>Uz(e))}function kZ(e,t,n){return new e({type:"array",element:t,...nt(n)})}function CZ(e,t,n){return new e({type:"custom",check:"custom",fn:t,...nt(n)})}function PZ(e,t){const n=AZ(r=>(r.addIssue=s=>{if(typeof s=="string")r.issues.push(ph(s,r.value,n._zod.def));else{const i=s;i.fatal&&(i.continue=!1),i.code??(i.code="custom"),"input"in i||(i.input=r.value),i.inst??(i.inst=n),i.continue??(i.continue=!n._zod.def.abort),r.issues.push(ph(i))}},e(r.value,r)),t);return n}function AZ(e,t){const n=new Os({check:"custom",...nt(t)});return n._zod.check=e,n}function eh(e,...t){for(const n of t)for(const r of Reflect.ownKeys(n))Object.prototype.propertyIsEnumerable.call(n,r)&&ua(e,r,n[r]);return e}function _O(e){let t=(e==null?void 0:e.target)??"draft-2020-12";return t==="draft-4"&&(t="draft-04"),t==="draft-7"&&(t="draft-07"),{processors:e.processors??{},metadataRegistry:(e==null?void 0:e.metadata)??$f,target:t,unrepresentable:(e==null?void 0:e.unrepresentable)??"throw",override:(e==null?void 0:e.override)??(()=>{}),io:(e==null?void 0:e.io)??"output",counter:0,seen:new Map,sharedDefsExtractedFor:void 0,sharedEmitDoneFor:void 0,cycles:(e==null?void 0:e.cycles)??"ref",reused:(e==null?void 0:e.reused)??"inline",intersections:[],deferred:[],external:(e==null?void 0:e.external)??void 0}}function ul(e,t,n,r,s){const i=typeof t.unrepresentable=="function"?t.unrepresentable({zodSchema:e,path:r.path,message:s}):t.unrepresentable;if(i==="any")return!1;if(i===void 0||i==="throw")throw new Error(s);return Object.assign(n,i),!0}function lr(e,t,n={path:[],schemaPath:[]}){var f,p;var r;const s=e._zod.def,i=t.seen.get(e);if(i)return i.count++,n.schemaPath.includes(e)&&(i.cycle=n.path),i.schema;const o={schema:{},count:1,cycle:void 0,path:n.path};t.seen.set(e,o),t.sharedDefsExtractedFor=void 0,t.sharedEmitDoneFor=void 0;const c=(p=(f=e._zod).toJSONSchema)==null?void 0:p.call(f);if(c)o.schema=c;else{const m={...n,schemaPath:[...n.schemaPath,e],path:n.path};if(e._zod.processJSONSchema)e._zod.processJSONSchema(t,o.schema,m);else{const _=o.schema,w=t.processors[s.type];if(!w)throw new Error(`[toJSONSchema]: Non-representable type encountered: ${s.type}`);w(e,t,_,m)}const v=e._zod.parent;v&&(o.ref||(o.ref=v),lr(v,t,m),t.seen.get(v).isParent=!0)}const u=t.metadataRegistry.get(e);return u&&eh(o.schema,u),t.io==="input"&&ls(e)&&(delete o.schema.examples,delete o.schema.default),t.io==="input"&&"_prefault"in o.schema&&((r=o.schema).default??(r.default=o.schema._prefault)),delete o.schema._prefault,t.seen.get(e).schema}function n8(e){return e.replace(/~/g,"~0").replace(/\//g,"~1")}function wO(e,t){var o,c,u,d;const n=e.seen.get(t);if(!n)throw new Error("Unprocessed schema. This is a bug in Zod.");if(e.external&&e.sharedDefsExtractedFor===e.external)return;const r=new Map;for(const f of e.seen.entries()){const p=(o=e.metadataRegistry.get(f[0]))==null?void 0:o.id;if(p){const m=r.get(p);if(m&&m!==f[0])throw new Error(`Duplicate schema id "${p}" detected during JSON Schema conversion. Two different schemas cannot share the same id when converted together.`);r.set(p,f[0])}}const s=f=>{var w;const p=e.target==="draft-2020-12"?"$defs":"definitions";if(e.external){const b=(w=e.external.registry.get(f[0]))==null?void 0:w.id,S=e.external.uri??(C=>C);if(b)return{ref:S(b)};const E=f[1].defId??f[1].schema.id??`schema${e.counter++}`;return f[1].defId=E,{defId:E,ref:`${S("__shared")}#/${p}/${n8(E)}`}}const m="#",v=`${m}/${p}/`;if(f[1]===n&&!f[1].schema.id)return{ref:m};const _=f[1].schema.id??`__schema${e.counter++}`;return{defId:_,ref:v+n8(_)}},i=f=>{if(f[1].schema.$ref)return;const p=f[1],{ref:m,defId:v}=s(f);p.def={...p.schema},v&&(p.defId=v);const _=p.schema;for(const w in _)delete _[w];_.$ref=m};if(e.cycles==="throw")for(const f of e.seen.entries()){const p=f[1];if(p.cycle)throw new Error(`Cycle detected: #/${(c=p.cycle)==null?void 0:c.join("/")}/<root>
|
|
76
|
+
|
|
77
|
+
Set the \`cycles\` parameter to \`"ref"\` to resolve cyclical schemas with defs.`)}for(const f of e.seen.entries()){const p=f[1];if(t===f[0]){i(f);continue}if(e.external){const v=(u=e.external.registry.get(f[0]))==null?void 0:u.id;if(t!==f[0]&&v){i(f);continue}}if((d=e.metadataRegistry.get(f[0]))==null?void 0:d.id){i(f);continue}if(p.cycle){i(f);continue}p.count>1&&e.reused==="ref"&&i(f)}e.external&&(e.sharedDefsExtractedFor=e.external)}function bO(e){const t=e.anyOf;if(!Array.isArray(t)||t.length===0||e.type!==void 0)return;const n=[];for(const r of t){if(!r||typeof r!="object")return;bO(r);const s=Object.keys(r);if(s.length!==1||s[0]!=="type")return;const i=r.type;for(const o of Array.isArray(i)?i:[i]){if(typeof o!="string")return;n.includes(o)||n.push(o)}}delete e.anyOf,e.type=n.length===1?n[0]:n}const xO=new Set(["type","properties","required","additionalProperties"]),r8=["oneOf","anyOf"];function s8(e){const t=e.additionalProperties;return t===void 0||t===!1||typeof t!="object"||t===null?null:Object.keys(t).length?t:null}function _w(e){var i;const t=[];for(const o of e){if(typeof o!="object"||o.type!=="object")return null;for(const c in o)if(!xO.has(c))return null;t.push(o)}const n={},r=new Set;for(const o of t){for(const c in o.properties){if(Object.prototype.hasOwnProperty.call(n,c))continue;const u=[];for(const f of t){const p=((i=f.properties)==null?void 0:i[c])??s8(f);p!=null&&(u.some(m=>JSON.stringify(m)===JSON.stringify(p))||u.push(p))}const d=u.length===1?u[0]:_w(u)??{allOf:u};ua(n,c,d)}for(const c of o.required??[])r.add(c)}const s={type:"object",properties:n};if(r.size&&(s.required=[...r]),t.every(o=>o.additionalProperties===!1))s.additionalProperties=!1;else{const o=[];for(const c of t){const u=s8(c);u&&!o.some(d=>JSON.stringify(d)===JSON.stringify(u))&&o.push(u)}o.length===1?s.additionalProperties=o[0]:o.length>1&&(s.additionalProperties={allOf:o})}return s}function TZ(e){const t=e.allOf;if(!Array.isArray(t)||t.length<2)return;for(const s of xO)if(s in e)return;const n=t.filter(s=>r8.some(i=>Array.isArray(s[i])));let r=null;if(!n.length)r=_w(t);else{const s=n[0],i=r8.find(u=>Array.isArray(s[u]));if(Object.keys(s).length!==1)return;const o=t.filter(u=>u!==s),c=s[i].map(u=>_w([...o,u]));if(c.some(u=>!u))return;r={[i]:c}}r&&(delete e.allOf,eh(e,r))}function SO(e,t){var c,u,d,f;const n=e.seen.get(t);if(!n)throw new Error("Unprocessed schema. This is a bug in Zod.");const r=p=>{const m=e.seen.get(p);if(m.ref===null)return;const v=m.def??m.schema,_={...v},w=m.ref;if(m.ref=null,w){r(w);const S=e.seen.get(w),E=S.schema;if(E.$ref&&(e.target==="draft-07"||e.target==="draft-04"||e.target==="openapi-3.0")?(v.allOf=v.allOf??[],v.allOf.push(E)):eh(v,E),eh(v,_),p._zod.parent===w)for(const A in v)A==="$ref"||A==="allOf"||A in _||delete v[A];if(E.$ref&&S.def)for(const A in v)A==="$ref"||A==="allOf"||A in S.def&&JSON.stringify(v[A])===JSON.stringify(S.def[A])&&delete v[A]}const b=p._zod.parent;if(b&&b!==w){r(b);const S=e.seen.get(b);if(S!=null&&S.schema.$ref&&(v.$ref=S.schema.$ref,S.def))for(const E in v)E==="$ref"||E==="allOf"||E in S.def&&JSON.stringify(v[E])===JSON.stringify(S.def[E])&&delete v[E]}e.override({zodSchema:p,jsonSchema:v,path:m.path??[]})};if(!e.external||e.sharedEmitDoneFor!==e.external){for(const p of[...e.seen.entries()].reverse())r(p[0]);if(e.target!=="openapi-3.0")for(const p of e.seen.entries())bO(p[1].def??p[1].schema);for(const p of e.deferred)p();if(e.intersections.length){const p=new Map;for(const m of e.seen.values())for(const v of[m.schema,m.def]){const _=v==null?void 0:v.allOf;if(!Array.isArray(_))continue;const w=p.get(_);w?w.push(v):p.set(_,[v])}for(const m of e.intersections)for(const v of p.get(m)??[])TZ(v)}}const s={};if(e.target==="draft-2020-12"?s.$schema="https://json-schema.org/draft/2020-12/schema":e.target==="draft-07"?s.$schema="http://json-schema.org/draft-07/schema#":e.target==="draft-04"?s.$schema="http://json-schema.org/draft-04/schema#":e.target,(c=e.external)!=null&&c.uri){const p=(u=e.external.registry.get(t))==null?void 0:u.id;if(!p)throw new Error("Schema is missing an `id` property");s.$id=e.external.uri(p)}eh(s,n.defId?n.schema:n.def??n.schema);const i=(d=e.metadataRegistry.get(t))==null?void 0:d.id;i!==void 0&&s.id===i&&delete s.id;const o=((f=e.external)==null?void 0:f.defs)??{};if(!e.external||e.sharedEmitDoneFor!==e.external)for(const p of e.seen.entries()){const m=p[1];m.def&&m.defId&&(m.def.id===m.defId&&delete m.def.id,ua(o,m.defId,m.def))}e.external&&(e.sharedEmitDoneFor=e.external),e.external||Object.keys(o).length>0&&(e.target==="draft-2020-12"?s.$defs=o:s.definitions=o);try{const p=JSON.parse(JSON.stringify(s));return Object.defineProperty(p,"~standard",{value:{...t["~standard"],jsonSchema:{input:H0(t,"input",e.processors),output:H0(t,"output",e.processors)}},enumerable:!1,writable:!1}),p}catch{throw new Error("Error converting schema to JSON.")}}function ls(e,t){const n=t??{seen:new Set};if(n.seen.has(e))return!1;n.seen.add(e);const r=e._zod.def;if(r.type==="transform")return!0;if(r.type==="array")return ls(r.element,n);if(r.type==="set")return ls(r.valueType,n);if(r.type==="lazy")return ls(r.getter(),n);if(r.type==="promise"||r.type==="optional"||r.type==="nonoptional"||r.type==="nullable"||r.type==="readonly"||r.type==="default"||r.type==="prefault"||r.type==="catch")return ls(r.innerType,n);if(r.type==="intersection")return ls(r.left,n)||ls(r.right,n);if(r.type==="record"||r.type==="map")return ls(r.keyType,n)||ls(r.valueType,n);if(r.type==="pipe")return e._zod.traits.has("$ZodCodec")?!0:ls(r.in,n)||ls(r.out,n);if(r.type==="object"){for(const s in r.shape)if(ls(r.shape[s],n))return!0;return!1}if(r.type==="union"){for(const s of r.options)if(ls(s,n))return!0;return!1}if(r.type==="tuple"){for(const s of r.items)if(ls(s,n))return!0;return!!(r.rest&&ls(r.rest,n))}return!1}const RZ=(e,t={})=>n=>{const r=_O({...n,processors:t});return lr(e,r),wO(r,e),SO(r,e)},H0=(e,t,n={})=>r=>{const{libraryOptions:s,target:i}=r??{},o=_O({...s??{},target:i,io:t,processors:n});return lr(e,o),wO(o,e),SO(o,e)},od=(e,t,n)=>{(e[t]===void 0||n>e[t])&&(e[t]=n)},ad=(e,t,n)=>{(e[t]===void 0||n<e[t])&&(e[t]=n)},i8=(e,t)=>{od(e,"minimum",t),ad(e,"maximum",t)},EO=(e,t)=>{e.multipleOf??(e.multipleOf=[]),e.multipleOf.includes(t)||e.multipleOf.push(t)},kO=(e,t)=>{e.patterns??(e.patterns=new Set),e.patterns.add(t)},CO=(e,t)=>{e.mime=e.mime?e.mime.filter(n=>t.includes(n)):[...t]},PO=(e,t)=>{e.format=t,t.includes("int")&&(e.isInt=!0)},o8=(e,t)=>od(e,"minimum",t.minimum),a8=(e,t)=>ad(e,"maximum",t.maximum),l8=e=>(t,n)=>{PO(t,n.format);const[r,s]=e[n.format];od(t,"minimum",r),ad(t,"maximum",s)},N1={greater_than:(e,t)=>od(e,t.inclusive?"minimum":"exclusiveMinimum",t.value),less_than:(e,t)=>ad(e,t.inclusive?"maximum":"exclusiveMaximum",t.value),multiple_of:(e,t)=>EO(e,t.value),number_format:l8(WI),bigint_format:l8(Kz),min_length:o8,max_length:a8,length_equals:(e,t)=>i8(e,t.length),min_size:o8,max_size:a8,size_equals:(e,t)=>i8(e,t.size),string_format:(e,t)=>{PO(e,t.format),t.pattern&&kO(e,t.pattern),(t.format==="base64"||t.format==="base64url")&&(e.contentEncoding=t.format),(t.local||t.precision===-1)&&(e.laxFormat=!0)},mime_type:(e,t)=>CO(e,t.mime)};function Fi(e){var i;const t={},n=e._zod.def,r=e._zod.traits.has("$ZodCheck")?[e,...n.checks??[]]:n.checks??[];for(const o of r)(i=N1[o._zod.def.check])==null||i.call(N1,t,o._zod.def);const s=e._zod.bag;s.minimum!==void 0&&od(t,"minimum",s.minimum),s.exclusiveMinimum!==void 0&&od(t,"exclusiveMinimum",s.exclusiveMinimum),s.maximum!==void 0&&ad(t,"maximum",s.maximum),s.exclusiveMaximum!==void 0&&ad(t,"exclusiveMaximum",s.exclusiveMaximum),s.multipleOf!==void 0&&EO(t,s.multipleOf),s.format!==void 0&&(t.format??(t.format=s.format),s.format.includes("int")&&(t.isInt=!0)),s.mime&&CO(t,s.mime);for(const o of s.patterns??[])kO(t,o);return t}const IZ={guid:"uuid",url:"uri",datetime:"date-time",json_string:"json-string",regex:""},OZ=new Map([[lO,GV],[Ob,qV]]),AO=e=>OZ.get(e)??e,MZ=(e,t,n,r)=>{const s=n;s.type="string";const{minimum:i,maximum:o,format:c,patterns:u,contentEncoding:d,laxFormat:f}=Fi(e);if(typeof i=="number"&&(s.minLength=i),typeof o=="number"&&(s.maxLength=o),c&&(s.format=IZ[c]??c,s.format===""&&delete s.format,(c==="time"||f)&&delete s.format),d&&(s.contentEncoding=d),u&&u.size>0){const p=[...u].map(AO);p.length===1?s.pattern=p[0].source:p.length>1&&(s.allOf=[...p.map(m=>({...t.target==="draft-07"||t.target==="draft-04"||t.target==="openapi-3.0"?{type:"string"}:{},pattern:m.source}))])}},NZ=(e,t,n,r)=>{const s=n,{minimum:i,maximum:o,multipleOf:c,exclusiveMaximum:u,exclusiveMinimum:d,isInt:f}=Fi(e);s.type=f?"integer":"number";const p=typeof d=="number"&&d>=(i??Number.NEGATIVE_INFINITY),m=typeof u=="number"&&u<=(o??Number.POSITIVE_INFINITY),v=t.target==="draft-04"||t.target==="openapi-3.0";if(p?v?(s.minimum=d,s.exclusiveMinimum=!0):s.exclusiveMinimum=d:typeof i=="number"&&(s.minimum=i),m?v?(s.maximum=u,s.exclusiveMaximum=!0):s.exclusiveMaximum=u:typeof o=="number"&&(s.maximum=o),c){const _=new Set;for(const S of c)Number.isFinite(S)&&S!==0?_.add(Math.abs(S)):ul(e,t,s,r,`A multipleOf divisor of ${S} cannot be represented in JSON Schema`);const[w,...b]=_;w!==void 0&&(s.multipleOf=w),b.length&&(s.allOf=[...s.allOf??[],...b.map(S=>({multipleOf:S}))])}},LZ=(e,t,n,r)=>{n.type="boolean"},$Z=(e,t,n,r)=>{n.not={}},DZ=(e,t,n,r)=>{},FZ=(e,t,n,r)=>{const s=e._zod.def,i=hw(s.entries);if(i.length===0){n.not={};return}i.every(o=>typeof o=="number")&&(n.type="number"),i.every(o=>typeof o=="string")&&(n.type="string"),n.enum=i},jZ=(e,t,n,r)=>{const s=e._zod.def;if(s.values.length===0){n.not={};return}const i=[];for(const o of s.values)if(o===void 0){if(ul(e,t,n,r,"Literal `undefined` cannot be represented in JSON Schema"))return}else if(typeof o=="bigint"){if(ul(e,t,n,r,"BigInt literals cannot be represented in JSON Schema"))return;i.push(Number(o))}else i.push(o);if(i.length!==0)if(i.length===1){const o=i[0];n.type=o===null?"null":typeof o,t.target==="draft-04"||t.target==="openapi-3.0"?n.enum=[o]:n.const=o}else i.every(o=>typeof o=="number")&&(n.type="number"),i.every(o=>typeof o=="string")&&(n.type="string"),i.every(o=>typeof o=="boolean")&&(n.type="boolean"),i.every(o=>o===null)&&(n.type="null"),n.enum=i},zZ=(e,t,n,r)=>{ul(e,t,n,r,"Custom types cannot be represented in JSON Schema")},VZ=(e,t,n,r)=>{ul(e,t,n,r,"Transforms cannot be represented in JSON Schema")},HZ=(e,t,n,r)=>{const s=n,i=e._zod.def,{minimum:o,maximum:c}=Fi(e);typeof o=="number"&&(s.minItems=o),typeof c=="number"&&(s.maxItems=c),s.type="array",s.items=lr(i.element,t,{...r,path:[...r.path,"items"]})};function U0(e){const t=e._zod.def;return t.type==="pipe"&&t.in._zod.traits.has("$ZodTransform")?U0(t.out):t.type==="catch"?U0(t.innerType):e._zod.optin}const UZ=(e,t,n,r)=>{var d;const s=n,i=e._zod.def,o=i.shape;if(Object.getOwnPropertySymbols(o).length&&ul(e,t,s,r,"Symbol keys cannot be represented in JSON Schema"))return;s.type="object",s.properties={};for(const f in o)ua(s.properties,f,lr(o[f],t,{...r,path:[...r.path,"properties",f]}));const u=[];for(const f of Object.keys(o)){const p=i.shape[f];(t.io==="input"?U0(p)===void 0:p._zod.optout===void 0)&&u.push(f)}u.length>0&&(s.required=u),((d=i.catchall)==null?void 0:d._zod.def.type)==="never"?s.additionalProperties=!1:i.catchall?i.catchall&&(s.additionalProperties=lr(i.catchall,t,{...r,path:[...r.path,"additionalProperties"]})):t.io==="output"&&(s.additionalProperties=!1)},ZZ=(e,t,n,r)=>{const s=e._zod.def,i=s.inclusive===!1,o=s.options.map((c,u)=>lr(c,t,{...r,path:[...r.path,i?"oneOf":"anyOf",u]}));i?n.oneOf=o:n.anyOf=o},BZ=(e,t,n,r)=>{const s=e._zod.def,i=lr(s.left,t,{...r,path:[...r.path,"allOf",0]}),o=lr(s.right,t,{...r,path:[...r.path,"allOf",1]}),c=d=>"allOf"in d&&Object.keys(d).length===1,u=[...c(i)?i.allOf:[i],...c(o)?o.allOf:[o]];n.allOf=u,t.intersections.push(u)};function ww(e,t,n){var _;if(t.$ref){if(n.has(t))return t;n.add(t);const w=(_=e.get(t))==null?void 0:_.def;if(!w)return t;const b=ww(e,w,n);return b===w?t:b}for(const w of["anyOf","oneOf"]){const b=t[w];if(!Array.isArray(b))continue;const S=b.map(E=>ww(e,E,n));S.some((E,C)=>E!==b[C])&&(t={...t,[w]:S})}const r=Array.isArray(t.type)?t.type:[t.type],s=!r.includes("string")&&r.some(w=>w==="number"||w==="integer"),i=t.enum??(t.const!==void 0?[t.const]:void 0);if(!s&&!(i!=null&&i.some(w=>typeof w=="number")))return t;const{minimum:o,maximum:c,exclusiveMinimum:u,exclusiveMaximum:d,multipleOf:f,format:p,id:m,...v}=t;return v.enum?v.enum=v.enum.map(w=>typeof w=="number"?String(w):w):typeof v.const=="number"&&(v.const=String(v.const)),s&&(v.type="string",i||(v.pattern=(r.includes("number")?Tb:rH).source)),v}const bw=new WeakMap;function WZ(e){var r;const t=new Map;for(const s of e.seen.values())s.def&&!t.has(s.schema)&&t.set(s.schema,s);const n=new Map;for(const s of bw.get(e)??[]){const i=e.seen.get(s),o=(r=(i==null?void 0:i.def)??(i==null?void 0:i.schema))==null?void 0:r.propertyNames;if(!o||o===!0||n.has(o))continue;const c=ww(t,o,new Set);c!==o&&n.set(o,c)}if(n.size)for(const s of e.seen.values())for(const i of[s.schema,s.def]){const o=i&&n.get(i.propertyNames);o&&(i.propertyNames=o)}}const KZ=(e,t,n,r)=>{const s=n,i=e._zod.def;s.type="object";const o=i.keyType,c=Fi(o).patterns;if(i.mode==="loose"&&c&&c.size>0){const f=lr(i.valueType,t,{...r,path:[...r.path,"patternProperties","*"]});s.patternProperties={};for(const p of c)ua(s.patternProperties,AO(p).source,f)}else{if(t.target==="draft-07"||t.target==="draft-2020-12"){s.propertyNames=lr(i.keyType,t,{...r,path:[...r.path,"propertyNames"]});let f=bw.get(t);f||(f=[],bw.set(t,f),t.deferred.push(()=>WZ(t))),f.push(e)}s.additionalProperties=lr(i.valueType,t,{...r,path:[...r.path,"additionalProperties"]})}const u=o._zod.values,d=t.io==="input"&&U0(i.valueType)!==void 0;if(u&&!i.partial&&!d){const f=[...u].filter(p=>typeof p=="string"||typeof p=="number");f.length>0&&(s.required=f.map(String))}},GZ=(e,t,n,r)=>{const s=e._zod.def,i=lr(s.innerType,t,r),o=t.seen.get(e);t.target==="openapi-3.0"?(o.ref=s.innerType,n.nullable=!0):n.anyOf=[i,{type:"null"}]},qZ=(e,t,n,r)=>{const s=e._zod.def;lr(s.innerType,t,r);const i=t.seen.get(e);i.ref=s.innerType},Mb=Symbol();function TO(e,t,n,r,s){let i=!1;const o=JSON.stringify(e,(c,u)=>typeof u!="bigint"?u:(i=!0,null));return i?(ul(t,n,r,s,"BigInt defaults cannot be represented in JSON Schema"),Mb):JSON.parse(o)}const YZ=(e,t,n,r)=>{const s=e._zod.def;lr(s.innerType,t,r);const i=t.seen.get(e);i.ref=s.innerType;const o=TO(s.defaultValue,e,t,n,r);o!==Mb&&(n.default=o)},QZ=(e,t,n,r)=>{const s=e._zod.def;lr(s.innerType,t,r);const i=t.seen.get(e);if(i.ref=s.innerType,t.io!=="input")return;const o=TO(s.defaultValue,e,t,n,r);o!==Mb&&(n._prefault=o)},XZ=(e,t,n,r)=>{const s=e._zod.def;lr(s.innerType,t,r);const i=t.seen.get(e);i.ref=s.innerType;let o;try{o=s.catchValue(void 0)}catch{ul(e,t,n,r,"Dynamic catch values are not supported in JSON Schema");return}n.default=o},JZ=(e,t,n,r)=>{const s=e._zod.def,i=s.in._zod.traits.has("$ZodTransform"),o=t.io==="input"?i?s.out:s.in:s.out;lr(o,t,r);const c=t.seen.get(e);c.ref=o},eB=(e,t,n,r)=>{const s=e._zod.def;lr(s.innerType,t,r);const i=t.seen.get(e);i.ref=s.innerType,n.readOnly=!0},RO=(e,t,n,r)=>{const s=e._zod.def;lr(s.innerType,t,r);const i=t.seen.get(e);i.ref=s.innerType},c8=new WeakSet([Object.prototype,Error.prototype]);function gm(e,t,n){Object.defineProperty(e,t,{configurable:!0,enumerable:!1,get(){const r=n(this);return Object.defineProperty(this,t,{value:r,configurable:!0,writable:!0}),r},set(r){Object.defineProperty(this,t,{value:r,configurable:!0,writable:!0})}})}const tB=(e,t)=>{mV.init(e,t),e.name="ZodError";const n=Object.getPrototypeOf(e);c8.has(n)||(c8.add(n),gm(n,"format",r=>s=>yV(r,s)),gm(n,"flatten",r=>s=>vV(r,s)),gm(n,"addIssue",r=>s=>{r.issues.push(s),r.message=JSON.stringify(r.issues,pw,2)}),gm(n,"addIssues",r=>s=>{r.issues.push(...s),r.message=JSON.stringify(r.issues,pw,2)}),Object.defineProperty(n,"isEmpty",{configurable:!0,enumerable:!1,get(){return this.issues.length===0}}))},vi=fe("ZodError",tB,void 0,{Parent:Error}),nB=kb(vi),rB=Cb(vi),sB=Pb(vi),iB=Ab(vi),oB=EV(vi),aB=kV(vi),lB=CV(vi),cB=PV(vi),uB=AV(vi),dB=TV(vi),fB=RV(vi),hB=IV(vi);function pB(){zi.localeError||_o(MU())}function Og(){zi.memoizer||_o({memoizer:RU()})}const zn=fe("ZodType",(e,t)=>(pB(),jn.init(e,t),e.def=t,e.type=t.type,e),{check(...e){const t=this.def;return this.clone(Gs(t,{checks:[...t.checks??[],...e.map(n=>typeof n=="function"?{_zod:{check:n,def:{check:"custom"},onattach:[]}}:n)]}),{parent:!0})},with(...e){return this.check(...e)},clone(e,t){return yl(this,e,t)},brand(){return this},register(e,t){return e.add(this,t),this},refine(e,t){return this.check(dW(e,t))},superRefine(e,t){return this.check(fW(e,t))},overwrite(e){return this.check(Sd(e))},optional(){return f8(this)},exactOptional(){return XB(this)},nullable(){return h8(this)},nullish(){return f8(h8(this))},nonoptional(e){return sW(this,e)},array(){return At(this)},or(e){return Ed([this,e])},and(e){return GB(this,e)},transform(e){return p8(this,QB(e))},default(e){return tW(this,e)},prefault(e){return rW(this,e)},catch(e){return oW(this,e)},pipe(e){return p8(this,e)},readonly(){return cW(this)},describe(e){const t=this.clone();return $f.add(t,{description:e}),t},meta(...e){if(e.length===0)return $f.get(this);const t=this.clone();return $f.add(t,e[0]),t},isOptional(){return this.safeParse(void 0).success},isNullable(){return this.safeParse(null).success},apply(e,...t){return t.length===0?e(this):e(this,...t)},get"~standard"(){return GI(this,"~standard",{...rO(this),jsonSchema:{input:H0(this,"input"),output:H0(this,"output")}})},set"~standard"(e){cl(this,"~standard",e)},parse:function e(t,n){return nB(this,t,n,{callee:e})},parseAsync:async function e(t,n){return await rB(this,t,n,{callee:e})},safeParse(e,t){return sB(this,e,t)},async safeParseAsync(e,t){return iB(this,e,t)},get spa(){return this==null?void 0:this.safeParseAsync},set spa(e){cl(this,"spa",e)},validate(e,t){return bV(this,e,t)},validateAsync(e,t){return SV(this,e,t)},encode:function e(t,n){return oB(this,t,n,{callee:e})},decode:function e(t,n){return aB(this,t,n,{callee:e})},encodeAsync:async function e(t,n){return await lB(this,t,n,{callee:e})},decodeAsync:async function e(t,n){return await cB(this,t,n,{callee:e})},safeEncode(e,t){return uB(this,e,t)},safeDecode(e,t){return dB(this,e,t)},async safeEncodeAsync(e,t){return fB(this,e,t)},async safeDecodeAsync(e,t){return hB(this,e,t)},toJSONSchema(e){return RZ(this,{})(e)},get description(){var e;return(e=$f.get(this))==null?void 0:e.description},get _def(){return this._zod.def}}),IO=fe("_ZodString",(e,t)=>{Ib.init(e,t),zn.init(e,t),e._zod.processJSONSchema=(n,r,s)=>MZ(e,n,r)},qI({format:e=>Fi(e).format??null,minLength:e=>Fi(e).minimum??null,maxLength:e=>Fi(e).maximum??null},{regex(...e){return this.check(pZ(...e))},includes(...e){return this.check(vZ(...e))},startsWith(...e){return this.check(yZ(...e))},endsWith(...e){return this.check(_Z(...e))},min(...e){return this.check(V0(...e))},max(...e){return this.check(vO(...e))},length(...e){return this.check(yO(...e))},nonempty(...e){return this.check(V0(1,...e))},lowercase(e){return this.check(mZ(e))},uppercase(e){return this.check(gZ(e))},trim(){return this.check(bZ())},normalize(...e){return this.check(wZ(...e))},toLowerCase(){return this.check(xZ())},toUpperCase(){return this.check(SZ())},slugify(){return this.check(EZ())}})),mB=fe("ZodString",(e,t)=>{Ib.init(e,t),IO.init(e,t)},{email(e){return this.check(DU(wB,e))},url(e){return this.check(UU(xB,e))},jwt(e){return this.check(sZ(DB,e))},emoji(e){return this.check(ZU(SB,e))},guid(e){return this.check(FU(bB,e))},uuid(e){return this.check(jU(vm,e))},uuidv4(e){return this.check(zU(vm,e))},uuidv6(e){return this.check(VU(vm,e))},uuidv7(e){return this.check(HU(vm,e))},nanoid(e){return this.check(BU(EB,e))},cuid(e){return this.check(WU(kB,e))},cuid2(e){return this.check(KU(CB,e))},ulid(e){return this.check(GU(PB,e))},base64(e){return this.check(tZ(NB,e))},base64url(e){return this.check(nZ(LB,e))},xid(e){return this.check(qU(AB,e))},ksuid(e){return this.check(YU(TB,e))},ipv4(e){return this.check(QU(RB,e))},ipv6(e){return this.check(XU(IB,e))},cidrv4(e){return this.check(JU(OB,e))},cidrv6(e){return this.check(eZ(MB,e))},e164(e){return this.check(rZ($B,e))},datetime(e){return this.check(iZ(gB,e))},date(e){return this.check(oZ(vB,e))},time(e){return this.check(aZ(yB,e))},duration(e){return this.check(lZ(_B,e))}});function re(e){return $U(mB,e)}const Vn=fe("ZodStringFormat",(e,t)=>{Nn.init(e,t),IO.init(e,t)}),gB=fe("ZodISODateTime",(e,t)=>{FH.init(e,t),Vn.init(e,t)}),vB=fe("ZodISODate",(e,t)=>{jH.init(e,t),Vn.init(e,t)}),yB=fe("ZodISOTime",(e,t)=>{zH.init(e,t),Vn.init(e,t)}),_B=fe("ZodISODuration",(e,t)=>{VH.init(e,t),Vn.init(e,t)}),wB=fe("ZodEmail",(e,t)=>{EH.init(e,t),Vn.init(e,t)}),bB=fe("ZodGUID",(e,t)=>{xH.init(e,t),Vn.init(e,t)}),vm=fe("ZodUUID",(e,t)=>{SH.init(e,t),Vn.init(e,t)}),xB=fe("ZodURL",(e,t)=>{RH.init(e,t),Vn.init(e,t)}),SB=fe("ZodEmoji",(e,t)=>{IH.init(e,t),Vn.init(e,t)}),EB=fe("ZodNanoID",(e,t)=>{OH.init(e,t),Vn.init(e,t)}),kB=fe("ZodCUID",(e,t)=>{MH.init(e,t),Vn.init(e,t)}),CB=fe("ZodCUID2",(e,t)=>{NH.init(e,t),Vn.init(e,t)}),PB=fe("ZodULID",(e,t)=>{LH.init(e,t),Vn.init(e,t)}),AB=fe("ZodXID",(e,t)=>{$H.init(e,t),Vn.init(e,t)}),TB=fe("ZodKSUID",(e,t)=>{DH.init(e,t),Vn.init(e,t)}),RB=fe("ZodIPv4",(e,t)=>{HH.init(e,t),Vn.init(e,t)}),IB=fe("ZodIPv6",(e,t)=>{ZH.init(e,t),Vn.init(e,t)}),OB=fe("ZodCIDRv4",(e,t)=>{BH.init(e,t),Vn.init(e,t)}),MB=fe("ZodCIDRv6",(e,t)=>{KH.init(e,t),Vn.init(e,t)}),NB=fe("ZodBase64",(e,t)=>{GH.init(e,t),Vn.init(e,t)}),LB=fe("ZodBase64URL",(e,t)=>{YH.init(e,t),Vn.init(e,t)}),$B=fe("ZodE164",(e,t)=>{QH.init(e,t),Vn.init(e,t)}),DB=fe("ZodJWT",(e,t)=>{JH.init(e,t),Vn.init(e,t)}),OO=fe("ZodNumber",(e,t)=>{cO.init(e,t),zn.init(e,t),e._zod.processJSONSchema=(n,r,s)=>NZ(e,n,r,s),e.isFinite=!0},qI({minValue:e=>{const{minimum:t,exclusiveMinimum:n}=Fi(e);return Math.max(t??Number.NEGATIVE_INFINITY,n??Number.NEGATIVE_INFINITY)},maxValue:e=>{const{maximum:t,exclusiveMaximum:n}=Fi(e);return Math.min(t??Number.POSITIVE_INFINITY,n??Number.POSITIVE_INFINITY)},isInt:e=>{const{isInt:t,multipleOf:n}=Fi(e);return!!t||!!(n!=null&&n.some(Number.isSafeInteger))},format:e=>Fi(e).format??null},{gt(e,t){return this.check(e8(e,t))},gte(e,t){return this.check(M1(e,t))},min(e,t){return this.check(M1(e,t))},lt(e,t){return this.check(JC(e,t))},lte(e,t){return this.check(O1(e,t))},max(e,t){return this.check(O1(e,t))},int(e){return this.check(u8(e))},safe(e){return this.check(u8(e))},positive(e){return this.check(e8(0,e))},nonnegative(e){return this.check(M1(0,e))},negative(e){return this.check(JC(0,e))},nonpositive(e){return this.check(O1(0,e))},multipleOf(e,t){return this.check(t8(e,t))},step(e,t){return this.check(t8(e,t))},finite(){return this}}));function Pn(e){return cZ(OO,e)}const FB=fe("ZodNumberFormat",(e,t)=>{eU.init(e,t),OO.init(e,t)});function u8(e){return uZ(FB,e)}const jB=fe("ZodBoolean",(e,t)=>{tU.init(e,t),zn.init(e,t),e._zod.processJSONSchema=(n,r,s)=>LZ(e,n,r)});function Ts(e){return dZ(jB,e)}const zB=fe("ZodUnknown",(e,t)=>{nU.init(e,t),zn.init(e,t),e._zod.processJSONSchema=(n,r,s)=>DZ()});function xw(){return fZ(zB)}const VB=fe("ZodNever",(e,t)=>{rU.init(e,t),zn.init(e,t),e._zod.processJSONSchema=(n,r,s)=>$Z(e,n,r)});function HB(e){return hZ(VB,e)}const UB=fe("ZodArray",(e,t)=>{Og(),oU.init(e,t),zn.init(e,t),e._zod.processJSONSchema=(n,r,s)=>HZ(e,n,r,s),e.element=t.element},{min(e,t){return this.check(V0(e,t))},nonempty(e){return this.check(V0(1,e))},max(e,t){return this.check(vO(e,t))},length(e,t){return this.check(yO(e,t))},unwrap(){return this.element}});function At(e,t){return kZ(UB,e,t)}const ZB=fe("ZodObject",(e,t)=>{Og(),cU.init(e,t),zn.init(e,t),e._zod.processJSONSchema=(n,r,s)=>UZ(e,n,r,s),aV(e,"shape",n=>n._zod.def.shape,!1)},{keyof(){return zt(Object.keys(this._zod.def.shape))},catchall(e){return this.clone(Gs(this._zod.def,{catchall:e}))},passthrough(){return this.clone(Gs(this._zod.def,{catchall:xw()}))},loose(){return this.clone(Gs(this._zod.def,{catchall:xw()}))},strict(){return this.clone(Gs(this._zod.def,{catchall:HB()}))},strip(){return this.clone(Gs(this._zod.def,{catchall:void 0}))},extend(e){return Yz(this,e)},safeExtend(e){return Qz(this,e)},merge(e){return Xz(this,e)},pick(e){return Gz(this,e)},omit(e){return qz(this,e)},partial(...e){return LC(NO,this,e[0])},exactPartial(...e){return LC(LO,this,e[0],"exactPartial")},required(...e){return Jz($O,this,e[0])}});function ze(e,t){const n={type:"object",shape:e??{},...nt(t)};return new ZB(n)}const MO=fe("ZodUnion",(e,t)=>{fO.init(e,t),zn.init(e,t),e._zod.processJSONSchema=(n,r,s)=>ZZ(e,n,r,s),e.options=t.options});function Ed(e,t){return new MO({type:"union",options:e,...nt(t)})}const BB=fe("ZodDiscriminatedUnion",(e,t)=>{MO.init(e,t),dU.init(e,t)});function WB(e,t,n){return new BB({type:"union",options:t,discriminator:e,...nt(n)})}const KB=fe("ZodIntersection",(e,t)=>{fU.init(e,t),zn.init(e,t),e._zod.processJSONSchema=(n,r,s)=>BZ(e,n,r,s)});function GB(e,t){return new KB({type:"intersection",left:e,right:t})}const d8=fe("ZodRecord",(e,t)=>{Og(),hU.init(e,t),zn.init(e,t),e._zod.processJSONSchema=(n,r,s)=>KZ(e,n,r,s),e.keyType=t.keyType,e.valueType=t.valueType});function Nb(e,t,n){return!t||!t._zod?new d8({type:"record",keyType:re(),valueType:e,...nt(t)}):new d8({type:"record",keyType:e,valueType:t,...nt(n)})}const Sw=fe("ZodEnum",(e,t)=>{pU.init(e,t),zn.init(e,t),e._zod.processJSONSchema=(r,s,i)=>FZ(e,r,s),e.enum=t.entries,e.options=[...e._zod.values];const n=new Set(Object.keys(t.entries));e.extract=(r,s)=>{const i={};for(const o of r)if(n.has(o))i[o]=t.entries[o];else throw new Error(`Key ${o} not found in enum`);return new Sw({...t,checks:[],...nt(s),entries:i})},e.exclude=(r,s)=>{const i={...t.entries};for(const o of r)if(n.has(o))delete i[o];else throw new Error(`Key ${o} not found in enum`);return new Sw({...t,checks:[],...nt(s),entries:i})}});function zt(e,t){const n=Array.isArray(e)?Object.fromEntries(e.map(r=>[r,r])):e;return new Sw({type:"enum",entries:n,...nt(t)})}const qB=fe("ZodLiteral",(e,t)=>{mU.init(e,t),zn.init(e,t),e._zod.processJSONSchema=(n,r,s)=>jZ(e,n,r,s),e.values=new Set(t.values),Object.defineProperty(e,"value",{get(){if(t.values.length>1)throw new Error("This schema contains multiple valid literal values. Use `.values` instead.");return t.values[0]}})});function bc(e,t){return new qB({type:"literal",values:Array.isArray(e)?e:[e],...nt(t)})}const YB=fe("ZodTransform",(e,t)=>{Og(),gU.init(e,t),zn.init(e,t),e._zod.processJSONSchema=(n,r,s)=>VZ(e,n,r,s),e._zod.parse=(n,r)=>{if(r.direction==="backward")throw new QI(e.constructor.name);n.addIssue=i=>{if(typeof i=="string")n.issues.push(ph(i,n.value,t));else{const o=i;o.fatal&&(o.continue=!1),o.code??(o.code="custom"),"input"in o||(o.input=n.value),o.inst??(o.inst=e),n.issues.push(ph(o))}};const s=t.transform(n.value,n);return s instanceof Promise?s.then(i=>(n.value=i,n)):(n.value=s,n)}});function QB(e){return new YB({type:"transform",transform:e})}const NO=fe("ZodOptional",(e,t)=>{hO.init(e,t),zn.init(e,t),e._zod.processJSONSchema=(n,r,s)=>RO(e,n,r,s),e.unwrap=()=>e._zod.def.innerType});function f8(e){return new NO({type:"optional",innerType:e})}const LO=fe("ZodExactOptional",(e,t)=>{vU.init(e,t),zn.init(e,t),e._zod.processJSONSchema=(n,r,s)=>RO(e,n,r,s),e.unwrap=()=>e._zod.def.innerType});function XB(e){return new LO({type:"optional",innerType:e})}const JB=fe("ZodNullable",(e,t)=>{yU.init(e,t),zn.init(e,t),e._zod.processJSONSchema=(n,r,s)=>GZ(e,n,r,s),e.unwrap=()=>e._zod.def.innerType});function h8(e){return new JB({type:"nullable",innerType:e})}const eW=fe("ZodDefault",(e,t)=>{_U.init(e,t),zn.init(e,t),e._zod.processJSONSchema=(n,r,s)=>YZ(e,n,r,s),e.unwrap=()=>e._zod.def.innerType,e.removeDefault=e.unwrap});function tW(e,t){return new eW({type:"default",innerType:e,get defaultValue(){return typeof t=="function"?t():ZI(t)}})}const nW=fe("ZodPrefault",(e,t)=>{wU.init(e,t),zn.init(e,t),e._zod.processJSONSchema=(n,r,s)=>QZ(e,n,r,s),e.unwrap=()=>e._zod.def.innerType});function rW(e,t){return new nW({type:"prefault",innerType:e,get defaultValue(){return typeof t=="function"?t():ZI(t)}})}const $O=fe("ZodNonOptional",(e,t)=>{bU.init(e,t),zn.init(e,t),e._zod.processJSONSchema=(n,r,s)=>qZ(e,n,r,s),e.unwrap=()=>e._zod.def.innerType});function sW(e,t){return new $O({type:"nonoptional",innerType:e,...nt(t)})}const iW=fe("ZodCatch",(e,t)=>{xU.init(e,t),zn.init(e,t),e._zod.processJSONSchema=(n,r,s)=>XZ(e,n,r,s),e.unwrap=()=>e._zod.def.innerType,e.removeCatch=e.unwrap});function oW(e,t){return new iW({type:"catch",innerType:e,catchValue:typeof t=="function"?t:cV(t)})}const aW=fe("ZodPipe",(e,t)=>{SU.init(e,t),zn.init(e,t),e._zod.processJSONSchema=(n,r,s)=>JZ(e,n,r,s),e.in=t.in,e.out=t.out});function p8(e,t){return new aW({type:"pipe",in:e,out:t})}const lW=fe("ZodReadonly",(e,t)=>{EU.init(e,t),zn.init(e,t),e._zod.processJSONSchema=(n,r,s)=>eB(e,n,r,s),e.unwrap=()=>e._zod.def.innerType});function cW(e){return new lW({type:"readonly",innerType:e})}const uW=fe("ZodCustom",(e,t)=>{kU.init(e,t),zn.init(e,t),e._zod.processJSONSchema=(n,r,s)=>zZ(e,n,r,s)});function dW(e,t={}){return CZ(uW,e,t)}function fW(e,t){return PZ(e,t)}const DO={custom:"custom"},ts=(e,t=String(e))=>e instanceof Error?e.message:t,hW=["multiple_lockfiles","unsupported_package_manager","invalid_package_manager_field","invalid_manifest","invalid_workspace","path_outside_workspace","dangling_symlink","version_unreadable","version_mismatch","no_install_command","install_failed","lockfile_outdated","engine_incompatible","install_script_failed","installer_unstoppable","inputs_changed"],FO=["ENOENT","EACCES","EPERM","EEXIST","ENOTDIR","EISDIR","ELOOP","ENOSPC","EMFILE","EADDRINUSE","ECONNREFUSED","ECONNRESET","ETIMEDOUT","EBUSY","ENOTSUP","EINVAL","ENOTEMPTY","EROFS","EAI_AGAIN"],pW=["timeout","aborted","unknown"],jO=[...hW,...FO,...pW];new Set(jO);new Set(FO);const Bs=Pn().finite().nonnegative().max(Number.MAX_SAFE_INTEGER),mW=ze({command:zt(["open","status","stop","wait","auth.status","variants.start","variants.status","variants.get","variants.list","variants.complete","variants.cancel","reference.fetch","evidence.capture","context.add","context.update","context.list","context.show","context.enable","context.disable","context.remove","context.resolve","context.inspect","context.verifier","context.verify"]).optional(),tool_name:zt(["rivet_login","rivet_explore_designs","rivet_get_exploration","rivet_cancel_exploration","rivet_complete_variant_work","rivet_get_design_context","rivet_find_references","rivet_save_reference","rivet_remove_reference","rivet_preview_reference_import","rivet_import_references","rivet_connect_reference_account","rivet_discover_reference_collections","rivet_save_design_preference","rivet_remove_design_preference","rivet_save_design_check","rivet_remove_design_check","rivet_run_design_check"]).optional(),caller_agent:zt(["claude","codex","cursor","unknown","other"]).optional(),mcp_editor:zt(["claude","claude-desktop","codex","cursor","unknown","other"]).optional(),source:zt(["cli","mcp","core","ui","visual_editor"]).optional(),surface:zt(["cli","mcp","visual_editor"]).optional(),mode:zt(["initial_generation","zero_to_one","source_grounded","comment_refine","vary","history_adoption","commit","unknown"]).optional(),entry_point:zt(["mcp_tool","visual_editor_comment","variants_panel","history","watch_loop","route","unknown","login_command","signin_command","install_flow","tool_call","account_menu","library","menu","onboarding","editor_gate","cli","mcp"]).optional(),project_context_kind:zt(["existing","fresh"]).optional(),preview_kind:zt(["dev_server","static_artifact"]).optional(),provider:zt(["pinterest","arena","cosmos","x"]).optional(),request_status:zt(["accepted","rejected","completed","failed","cancelled","degraded","superseded"]).optional(),error_code:zt(["OPERATION_FAILED","USAGE_ERROR","AUTH_REQUIRED","SERVER_UNAVAILABLE","WAIT_TIMEOUT","SESSION_NOT_FOUND","WORK_ITEM_NOT_FOUND","DIRECTION_AMBIGUOUS","MCP_REMOVED","STATIC_PREVIEW_FAILED","DEV_SERVER_FAILED","PREVIEW_UNAVAILABLE","DEPENDENCY_INSTALL_FAILED","DEV_SERVER_START_FAILED","DEV_SCRIPT_MISSING"]).optional(),reason_code:zt(jO).optional(),failure_reason:zt(["ack_failed","active_session","destination_not_empty","feature_disabled","invalid_stage_action","lease_expired","missing_artifact","missing_required_input","pending_change_conflict","queue_full","runtime_validation_failed","schema_validation_failed","source_context_invalid","start_in_flight","target_not_editable","timeout","unknown","work_item_not_found","local_server_failed","oauth_failed","popup_blocked","credential_store_failed","popup_closed","provider_failed","request_failed","auth_required","invalid_arguments","operation_failed","server_unavailable","usage_error","wait_timeout","session_not_found","direction_ambiguous","mcp_removed","server_start_timeout","handshake_missing","handshake_invalid","process_not_running","health_check_failed","plugin_context_mismatch","telemetry_policy_mismatch","server_starting","transport_failed","server_shutdown_pending","server_process_exited","server_upgrade_required","replacement_version_mismatch","replacement_health_failed","app_health_failed","dev_server_resolution_failed","rivet_port_unavailable","editor_server_start_failed"]).optional(),verification_outcome:zt(["pass","fail","blocked","package_required","verifier_missing","verifier_stale","cancelled","timeout","output_limit","process_failed","invalid_result","invalid_evidence","cleanup_failed","setup_failed"]).optional(),verification_check_count:Bs.int().optional(),verification_duration_ms:Bs.optional(),ok:Ts().optional(),is_recoverable:Ts().optional(),is_fresh:Ts().optional(),duration_ms:Bs.optional(),dwell_ms_from_terminal:Bs.optional(),exit_code:Bs.optional(),requested_count:Bs.optional(),accepted_count:Bs.optional(),work_item_count:Bs.optional(),completed_count:Bs.optional(),failed_count:Bs.optional(),cancelled_count:Bs.optional(),reference_count:Bs.optional(),changed_files_count:Bs.optional()}),gW=new Set(["cli_command_completed","cli_auth_started","cli_auth_completed","cli_auth_failed","mcp_auth_started","mcp_auth_completed","mcp_auth_failed","mcp_tool_executed","mcp_tool_failed","mcp_login_failed","mcp_login_started","mcp_login_completed","visual_editor_auth_started","visual_editor_auth_completed","visual_editor_auth_failed","visual_editor_reference_connection_started","visual_editor_reference_connection_completed","visual_editor_reference_connection_failed","agent_variants.request_started","agent_variants.request_accepted","agent_variants.refinement_requested","agent_variants.refinement_completed","agent_variants.refinement_failed","agent_variants.round_started","agent_variants.round_completed","agent_variants.preview_started","agent_variants.preview_ready","agent_variants.preview_failed"]),vW=(e,t)=>{if(!gW.has(e))return null;const n={};for(const[r,s]of Object.entries(mW.shape)){const i=s.safeParse(t[r]);i.success&&i.data!==void 0&&(n[r]=i.data)}return n};var Yt;(function(e){e.assertEqual=s=>{};function t(s){}e.assertIs=t;function n(s){throw new Error}e.assertNever=n,e.arrayToEnum=s=>{const i={};for(const o of s)i[o]=o;return i},e.getValidEnumValues=s=>{const i=e.objectKeys(s).filter(c=>typeof s[s[c]]!="number"),o={};for(const c of i)o[c]=s[c];return e.objectValues(o)},e.objectValues=s=>e.objectKeys(s).map(function(i){return s[i]}),e.objectKeys=typeof Object.keys=="function"?s=>Object.keys(s):s=>{const i=[];for(const o in s)Object.prototype.hasOwnProperty.call(s,o)&&i.push(o);return i},e.find=(s,i)=>{for(const o of s)if(i(o))return o},e.isInteger=typeof Number.isInteger=="function"?s=>Number.isInteger(s):s=>typeof s=="number"&&Number.isFinite(s)&&Math.floor(s)===s;function r(s,i=" | "){return s.map(o=>typeof o=="string"?`'${o}'`:o).join(i)}e.joinValues=r,e.jsonStringifyReplacer=(s,i)=>typeof i=="bigint"?i.toString():i})(Yt||(Yt={}));var m8;(function(e){e.mergeShapes=(t,n)=>({...t,...n})})(m8||(m8={}));const Ye=Yt.arrayToEnum(["string","nan","number","integer","float","boolean","date","bigint","symbol","function","undefined","null","array","object","unknown","promise","void","never","map","set"]),ja=e=>{switch(typeof e){case"undefined":return Ye.undefined;case"string":return Ye.string;case"number":return Number.isNaN(e)?Ye.nan:Ye.number;case"boolean":return Ye.boolean;case"function":return Ye.function;case"bigint":return Ye.bigint;case"symbol":return Ye.symbol;case"object":return Array.isArray(e)?Ye.array:e===null?Ye.null:e.then&&typeof e.then=="function"&&e.catch&&typeof e.catch=="function"?Ye.promise:typeof Map<"u"&&e instanceof Map?Ye.map:typeof Set<"u"&&e instanceof Set?Ye.set:typeof Date<"u"&&e instanceof Date?Ye.date:Ye.object;default:return Ye.unknown}},Ae=Yt.arrayToEnum(["invalid_type","invalid_literal","custom","invalid_union","invalid_union_discriminator","invalid_enum_value","unrecognized_keys","invalid_arguments","invalid_return_type","invalid_date","invalid_string","too_small","too_big","invalid_intersection_types","not_multiple_of","not_finite"]);class ia extends Error{get errors(){return this.issues}constructor(t){super(),this.issues=[],this.addIssue=r=>{this.issues=[...this.issues,r]},this.addIssues=(r=[])=>{this.issues=[...this.issues,...r]};const n=new.target.prototype;Object.setPrototypeOf?Object.setPrototypeOf(this,n):this.__proto__=n,this.name="ZodError",this.issues=t}format(t){const n=t||function(i){return i.message},r={_errors:[]},s=i=>{for(const o of i.issues)if(o.code==="invalid_union")o.unionErrors.map(s);else if(o.code==="invalid_return_type")s(o.returnTypeError);else if(o.code==="invalid_arguments")s(o.argumentsError);else if(o.path.length===0)r._errors.push(n(o));else{let c=r,u=0;for(;u<o.path.length;){const d=o.path[u],f=u===o.path.length-1;if(d==="_errors"){f&&c._errors.push(n(o)),u++;continue}Object.prototype.hasOwnProperty.call(c,d)||(d==="__proto__"?Object.defineProperty(c,d,{value:{_errors:[]},writable:!0,enumerable:!0,configurable:!0}):c[d]={_errors:[]}),c=c[d],f&&c._errors.push(n(o)),u++}}};return s(this),r}static assert(t){if(!(t instanceof ia))throw new Error(`Not a ZodError: ${t}`)}toString(){return this.message}get message(){return JSON.stringify(this.issues,Yt.jsonStringifyReplacer,2)}get isEmpty(){return this.issues.length===0}flatten(t=n=>n.message){const n=Object.create(null),r=[];for(const s of this.issues)if(s.path.length>0){const i=s.path[0];n[i]=n[i]||[],n[i].push(t(s))}else r.push(t(s));return{formErrors:r,fieldErrors:n}}get formErrors(){return this.flatten()}}ia.create=e=>new ia(e);const Ew=(e,t)=>{let n;switch(e.code){case Ae.invalid_type:e.received===Ye.undefined?n="Required":n=`Expected ${e.expected}, received ${e.received}`;break;case Ae.invalid_literal:n=`Invalid literal value, expected ${JSON.stringify(e.expected,Yt.jsonStringifyReplacer)}`;break;case Ae.unrecognized_keys:n=`Unrecognized key(s) in object: ${Yt.joinValues(e.keys,", ")}`;break;case Ae.invalid_union:n="Invalid input";break;case Ae.invalid_union_discriminator:n=`Invalid discriminator value. Expected ${Yt.joinValues(e.options)}`;break;case Ae.invalid_enum_value:n=`Invalid enum value. Expected ${Yt.joinValues(e.options)}, received '${e.received}'`;break;case Ae.invalid_arguments:n="Invalid function arguments";break;case Ae.invalid_return_type:n="Invalid function return type";break;case Ae.invalid_date:n="Invalid date";break;case Ae.invalid_string:typeof e.validation=="object"?"includes"in e.validation?(n=`Invalid input: must include "${e.validation.includes}"`,typeof e.validation.position=="number"&&(n=`${n} at one or more positions greater than or equal to ${e.validation.position}`)):"startsWith"in e.validation?n=`Invalid input: must start with "${e.validation.startsWith}"`:"endsWith"in e.validation?n=`Invalid input: must end with "${e.validation.endsWith}"`:Yt.assertNever(e.validation):e.validation!=="regex"?n=`Invalid ${e.validation}`:n="Invalid";break;case Ae.too_small:e.type==="array"?n=`Array must contain ${e.exact?"exactly":e.inclusive?"at least":"more than"} ${e.minimum} element(s)`:e.type==="string"?n=`String must contain ${e.exact?"exactly":e.inclusive?"at least":"over"} ${e.minimum} character(s)`:e.type==="number"?n=`Number must be ${e.exact?"exactly equal to ":e.inclusive?"greater than or equal to ":"greater than "}${e.minimum}`:e.type==="bigint"?n=`Number must be ${e.exact?"exactly equal to ":e.inclusive?"greater than or equal to ":"greater than "}${e.minimum}`:e.type==="date"?n=`Date must be ${e.exact?"exactly equal to ":e.inclusive?"greater than or equal to ":"greater than "}${new Date(Number(e.minimum))}`:n="Invalid input";break;case Ae.too_big:e.type==="array"?n=`Array must contain ${e.exact?"exactly":e.inclusive?"at most":"less than"} ${e.maximum} element(s)`:e.type==="string"?n=`String must contain ${e.exact?"exactly":e.inclusive?"at most":"under"} ${e.maximum} character(s)`:e.type==="number"?n=`Number must be ${e.exact?"exactly":e.inclusive?"less than or equal to":"less than"} ${e.maximum}`:e.type==="bigint"?n=`BigInt must be ${e.exact?"exactly":e.inclusive?"less than or equal to":"less than"} ${e.maximum}`:e.type==="date"?n=`Date must be ${e.exact?"exactly":e.inclusive?"smaller than or equal to":"smaller than"} ${new Date(Number(e.maximum))}`:n="Invalid input";break;case Ae.custom:n="Invalid input";break;case Ae.invalid_intersection_types:n="Intersection results could not be merged";break;case Ae.not_multiple_of:n=`Number must be a multiple of ${e.multipleOf}`;break;case Ae.not_finite:n="Number must be finite";break;default:n=t.defaultError,Yt.assertNever(e)}return{message:n}};let yW=Ew;function _W(){return yW}const wW=e=>{const{data:t,path:n,errorMaps:r,issueData:s}=e,i=[...n,...s.path||[]],o={...s,path:i};if(s.message!==void 0)return{...s,path:i,message:s.message};let c="";const u=r.filter(d=>!!d).slice().reverse();for(const d of u)c=d(o,{data:t,defaultError:c}).message;return{...s,path:i,message:c}};function je(e,t){const n=_W(),r=wW({issueData:t,data:e.data,path:e.path,errorMaps:[e.common.contextualErrorMap,e.schemaErrorMap,n,n===Ew?void 0:Ew].filter(s=>!!s)});e.common.issues.push(r)}class Ys{constructor(){this.value="valid"}dirty(){this.value==="valid"&&(this.value="dirty")}abort(){this.value!=="aborted"&&(this.value="aborted")}static mergeArray(t,n){const r=[];for(const s of n){if(s.status==="aborted")return yt;s.status==="dirty"&&t.dirty(),r.push(s.value)}return{status:t.value,value:r}}static async mergeObjectAsync(t,n){const r=[];for(const s of n){const i=await s.key,o=await s.value;r.push({key:i,value:o})}return Ys.mergeObjectSync(t,r)}static mergeObjectSync(t,n){const r={};for(const s of n){const{key:i,value:o}=s;if(i.status==="aborted"||o.status==="aborted")return yt;i.status==="dirty"&&t.dirty(),o.status==="dirty"&&t.dirty(),i.value!=="__proto__"&&(typeof o.value<"u"||s.alwaysSet)&&(r[i.value]=o.value)}return{status:t.value,value:r}}}const yt=Object.freeze({status:"aborted"}),Df=e=>({status:"dirty",value:e}),yi=e=>({status:"valid",value:e}),g8=e=>e.status==="aborted",v8=e=>e.status==="dirty",ld=e=>e.status==="valid",Z0=e=>typeof Promise<"u"&&e instanceof Promise;var tt;(function(e){e.errToObj=t=>typeof t=="string"?{message:t}:t||{},e.toString=t=>typeof t=="string"?t:t==null?void 0:t.message})(tt||(tt={}));class dl{constructor(t,n,r,s){this._cachedPath=[],this.parent=t,this.data=n,this._path=r,this._key=s}get path(){return this._cachedPath.length||(Array.isArray(this._key)?this._cachedPath.push(...this._path,...this._key):this._cachedPath.push(...this._path,this._key)),this._cachedPath}}const y8=(e,t)=>{if(ld(t))return{success:!0,data:t.value};if(!e.common.issues.length)throw new Error("Validation failed but no issues detected.");return{success:!1,get error(){if(this._error)return this._error;const n=new ia(e.common.issues);return this._error=n,this._error}}};function Mt(e){if(!e)return{};const{errorMap:t,invalid_type_error:n,required_error:r,description:s}=e;if(t&&(n||r))throw new Error(`Can't use "invalid_type_error" or "required_error" in conjunction with custom error map.`);return t?{errorMap:t,description:s}:{errorMap:(o,c)=>{const{message:u}=e;return o.code==="invalid_enum_value"?{message:u??c.defaultError}:typeof c.data>"u"?{message:u??r??c.defaultError}:o.code!=="invalid_type"?{message:c.defaultError}:{message:u??n??c.defaultError}},description:s}}class Kt{get description(){return this._def.description}_getType(t){return ja(t.data)}_getOrReturnCtx(t,n){return n||{common:t.parent.common,data:t.data,parsedType:ja(t.data),schemaErrorMap:this._def.errorMap,path:t.path,parent:t.parent}}_processInputParams(t){return{status:new Ys,ctx:{common:t.parent.common,data:t.data,parsedType:ja(t.data),schemaErrorMap:this._def.errorMap,path:t.path,parent:t.parent}}}_parseSync(t){const n=this._parse(t);if(Z0(n))throw new Error("Synchronous parse encountered promise.");return n}_parseAsync(t){const n=this._parse(t);return Promise.resolve(n)}parse(t,n){const r=this.safeParse(t,n);if(r.success)return r.data;throw r.error}safeParse(t,n){const r={common:{issues:[],async:(n==null?void 0:n.async)??!1,contextualErrorMap:n==null?void 0:n.errorMap},path:(n==null?void 0:n.path)||[],schemaErrorMap:this._def.errorMap,parent:null,data:t,parsedType:ja(t)},s=this._parseSync({data:t,path:r.path,parent:r});return y8(r,s)}"~validate"(t){var r,s;const n={common:{issues:[],async:!!this["~standard"].async},path:[],schemaErrorMap:this._def.errorMap,parent:null,data:t,parsedType:ja(t)};if(!this["~standard"].async)try{const i=this._parseSync({data:t,path:[],parent:n});return ld(i)?{value:i.value}:{issues:n.common.issues}}catch(i){(s=(r=i==null?void 0:i.message)==null?void 0:r.toLowerCase())!=null&&s.includes("encountered")&&(this["~standard"].async=!0),n.common={issues:[],async:!0}}return this._parseAsync({data:t,path:[],parent:n}).then(i=>ld(i)?{value:i.value}:{issues:n.common.issues})}async parseAsync(t,n){const r=await this.safeParseAsync(t,n);if(r.success)return r.data;throw r.error}async safeParseAsync(t,n){const r={common:{issues:[],contextualErrorMap:n==null?void 0:n.errorMap,async:!0},path:(n==null?void 0:n.path)||[],schemaErrorMap:this._def.errorMap,parent:null,data:t,parsedType:ja(t)},s=this._parse({data:t,path:r.path,parent:r}),i=await(Z0(s)?s:Promise.resolve(s));return y8(r,i)}refine(t,n){const r=s=>typeof n=="string"||typeof n>"u"?{message:n}:typeof n=="function"?n(s):n;return this._refinement((s,i)=>{const o=t(s),c=()=>i.addIssue({code:Ae.custom,...r(s)});return typeof Promise<"u"&&o instanceof Promise?o.then(u=>u?!0:(c(),!1)):o?!0:(c(),!1)})}refinement(t,n){return this._refinement((r,s)=>t(r)?!0:(s.addIssue(typeof n=="function"?n(r,s):n),!1))}_refinement(t){return new ud({schema:this,typeName:_t.ZodEffects,effect:{type:"refinement",refinement:t}})}superRefine(t){return this._refinement(t)}constructor(t){this.spa=this.safeParseAsync,this._def=t,this.parse=this.parse.bind(this),this.safeParse=this.safeParse.bind(this),this.parseAsync=this.parseAsync.bind(this),this.safeParseAsync=this.safeParseAsync.bind(this),this.spa=this.spa.bind(this),this.refine=this.refine.bind(this),this.refinement=this.refinement.bind(this),this.superRefine=this.superRefine.bind(this),this.optional=this.optional.bind(this),this.nullable=this.nullable.bind(this),this.nullish=this.nullish.bind(this),this.array=this.array.bind(this),this.promise=this.promise.bind(this),this.or=this.or.bind(this),this.and=this.and.bind(this),this.transform=this.transform.bind(this),this.brand=this.brand.bind(this),this.default=this.default.bind(this),this.catch=this.catch.bind(this),this.describe=this.describe.bind(this),this.pipe=this.pipe.bind(this),this.readonly=this.readonly.bind(this),this.isNullable=this.isNullable.bind(this),this.isOptional=this.isOptional.bind(this),this["~standard"]={version:1,vendor:"zod",validate:n=>this["~validate"](n)}}optional(){return il.create(this,this._def)}nullable(){return dd.create(this,this._def)}nullish(){return this.nullable().optional()}array(){return go.create(this)}promise(){return G0.create(this,this._def)}or(t){return W0.create([this,t],this._def)}and(t){return K0.create(this,t,this._def)}transform(t){return new ud({...Mt(this._def),schema:this,typeName:_t.ZodEffects,effect:{type:"transform",transform:t}})}default(t){const n=typeof t=="function"?t:()=>t;return new Cw({...Mt(this._def),innerType:this,defaultValue:n,typeName:_t.ZodDefault})}brand(){return new UW({typeName:_t.ZodBranded,type:this,...Mt(this._def)})}catch(t){const n=typeof t=="function"?t:()=>t;return new Pw({...Mt(this._def),innerType:this,catchValue:n,typeName:_t.ZodCatch})}describe(t){const n=this.constructor;return new n({...this._def,description:t})}pipe(t){return Lb.create(this,t)}readonly(){return Aw.create(this)}isOptional(){return this.safeParse(void 0).success}isNullable(){return this.safeParse(null).success}}const bW=/^c[^\s-]{8,}$/i,xW=/^[0-9a-z]+$/,SW=/^[0-9A-HJKMNP-TV-Z]{26}$/i,EW=/^[0-9a-fA-F]{8}\b-[0-9a-fA-F]{4}\b-[0-9a-fA-F]{4}\b-[0-9a-fA-F]{4}\b-[0-9a-fA-F]{12}$/i,kW=/^[a-z0-9_-]{21}$/i,CW=/^[A-Za-z0-9-_]+\.[A-Za-z0-9-_]+\.[A-Za-z0-9-_]*$/,PW=/^[-+]?P(?!$)(?:(?:[-+]?\d+Y)|(?:[-+]?\d+[.,]\d+Y$))?(?:(?:[-+]?\d+M)|(?:[-+]?\d+[.,]\d+M$))?(?:(?:[-+]?\d+W)|(?:[-+]?\d+[.,]\d+W$))?(?:(?:[-+]?\d+D)|(?:[-+]?\d+[.,]\d+D$))?(?:T(?=[\d+-])(?:(?:[-+]?\d+H)|(?:[-+]?\d+[.,]\d+H$))?(?:(?:[-+]?\d+M)|(?:[-+]?\d+[.,]\d+M$))?(?:[-+]?\d+(?:[.,]\d+)?S)?)??$/,AW=/^(?!\.)(?!.*\.\.)([A-Z0-9_'+\-\.]*)[A-Z0-9_+-]@([A-Z0-9][A-Z0-9\-]*\.)+[A-Z]{2,}$/i,TW="^[\\p{Extended_Pictographic}\\p{Emoji_Component}]+$";let L1;const RW=/^(?:(?:25[0-5]|2[0-4][0-9]|1[0-9][0-9]|[1-9][0-9]|[0-9])\.){3}(?:25[0-5]|2[0-4][0-9]|1[0-9][0-9]|[1-9][0-9]|[0-9])$/,IW=/^(?:(?:25[0-5]|2[0-4][0-9]|1[0-9][0-9]|[1-9][0-9]|[0-9])\.){3}(?:25[0-5]|2[0-4][0-9]|1[0-9][0-9]|[1-9][0-9]|[0-9])\/(3[0-2]|[12]?[0-9])$/,OW=/^(([0-9a-fA-F]{1,4}:){7,7}[0-9a-fA-F]{1,4}|([0-9a-fA-F]{1,4}:){1,7}:|([0-9a-fA-F]{1,4}:){1,6}:[0-9a-fA-F]{1,4}|([0-9a-fA-F]{1,4}:){1,5}(:[0-9a-fA-F]{1,4}){1,2}|([0-9a-fA-F]{1,4}:){1,4}(:[0-9a-fA-F]{1,4}){1,3}|([0-9a-fA-F]{1,4}:){1,3}(:[0-9a-fA-F]{1,4}){1,4}|([0-9a-fA-F]{1,4}:){1,2}(:[0-9a-fA-F]{1,4}){1,5}|[0-9a-fA-F]{1,4}:((:[0-9a-fA-F]{1,4}){1,6})|:((:[0-9a-fA-F]{1,4}){1,7}|:)|fe80:(:[0-9a-fA-F]{0,4}){0,4}%[0-9a-zA-Z]{1,}|::(ffff(:0{1,4}){0,1}:){0,1}((25[0-5]|(2[0-4]|1{0,1}[0-9]){0,1}[0-9])\.){3,3}(25[0-5]|(2[0-4]|1{0,1}[0-9]){0,1}[0-9])|([0-9a-fA-F]{1,4}:){1,4}:((25[0-5]|(2[0-4]|1{0,1}[0-9]){0,1}[0-9])\.){3,3}(25[0-5]|(2[0-4]|1{0,1}[0-9]){0,1}[0-9]))$/,MW=/^(([0-9a-fA-F]{1,4}:){7,7}[0-9a-fA-F]{1,4}|([0-9a-fA-F]{1,4}:){1,7}:|([0-9a-fA-F]{1,4}:){1,6}:[0-9a-fA-F]{1,4}|([0-9a-fA-F]{1,4}:){1,5}(:[0-9a-fA-F]{1,4}){1,2}|([0-9a-fA-F]{1,4}:){1,4}(:[0-9a-fA-F]{1,4}){1,3}|([0-9a-fA-F]{1,4}:){1,3}(:[0-9a-fA-F]{1,4}){1,4}|([0-9a-fA-F]{1,4}:){1,2}(:[0-9a-fA-F]{1,4}){1,5}|[0-9a-fA-F]{1,4}:((:[0-9a-fA-F]{1,4}){1,6})|:((:[0-9a-fA-F]{1,4}){1,7}|:)|fe80:(:[0-9a-fA-F]{0,4}){0,4}%[0-9a-zA-Z]{1,}|::(ffff(:0{1,4}){0,1}:){0,1}((25[0-5]|(2[0-4]|1{0,1}[0-9]){0,1}[0-9])\.){3,3}(25[0-5]|(2[0-4]|1{0,1}[0-9]){0,1}[0-9])|([0-9a-fA-F]{1,4}:){1,4}:((25[0-5]|(2[0-4]|1{0,1}[0-9]){0,1}[0-9])\.){3,3}(25[0-5]|(2[0-4]|1{0,1}[0-9]){0,1}[0-9]))\/(12[0-8]|1[01][0-9]|[1-9]?[0-9])$/,NW=/^([0-9a-zA-Z+/]{4})*(([0-9a-zA-Z+/]{2}==)|([0-9a-zA-Z+/]{3}=))?$/,LW=/^([0-9a-zA-Z-_]{4})*(([0-9a-zA-Z-_]{2}(==)?)|([0-9a-zA-Z-_]{3}(=)?))?$/,zO="((\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-((0[13578]|1[02])-(0[1-9]|[12]\\d|3[01])|(0[469]|11)-(0[1-9]|[12]\\d|30)|(02)-(0[1-9]|1\\d|2[0-8])))",$W=new RegExp(`^${zO}$`);function VO(e){let t="[0-5]\\d";e.precision?t=`${t}\\.\\d{${e.precision}}`:e.precision==null&&(t=`${t}(\\.\\d+)?`);const n=e.precision?"+":"?";return`([01]\\d|2[0-3]):[0-5]\\d(:${t})${n}`}function DW(e){return new RegExp(`^${VO(e)}$`)}function FW(e){let t=`${zO}T${VO(e)}`;const n=[];return n.push(e.local?"Z?":"Z"),e.offset&&n.push("([+-]\\d{2}:?\\d{2})"),t=`${t}(${n.join("|")})`,new RegExp(`^${t}$`)}function jW(e,t){return!!((t==="v4"||!t)&&RW.test(e)||(t==="v6"||!t)&&OW.test(e))}function zW(e,t){if(!CW.test(e))return!1;try{const[n]=e.split(".");if(!n)return!1;const r=n.replace(/-/g,"+").replace(/_/g,"/").padEnd(n.length+(4-n.length%4)%4,"="),s=JSON.parse(atob(r));return!(typeof s!="object"||s===null||"typ"in s&&(s==null?void 0:s.typ)!=="JWT"||!s.alg||t&&s.alg!==t)}catch{return!1}}function VW(e,t){return!!((t==="v4"||!t)&&IW.test(e)||(t==="v6"||!t)&&MW.test(e))}class el extends Kt{_parse(t){if(this._def.coerce&&(t.data=String(t.data)),this._getType(t)!==Ye.string){const i=this._getOrReturnCtx(t);return je(i,{code:Ae.invalid_type,expected:Ye.string,received:i.parsedType}),yt}const r=new Ys;let s;for(const i of this._def.checks)if(i.kind==="min")t.data.length<i.value&&(s=this._getOrReturnCtx(t,s),je(s,{code:Ae.too_small,minimum:i.value,type:"string",inclusive:!0,exact:!1,message:i.message}),r.dirty());else if(i.kind==="max")t.data.length>i.value&&(s=this._getOrReturnCtx(t,s),je(s,{code:Ae.too_big,maximum:i.value,type:"string",inclusive:!0,exact:!1,message:i.message}),r.dirty());else if(i.kind==="length"){const o=t.data.length>i.value,c=t.data.length<i.value;(o||c)&&(s=this._getOrReturnCtx(t,s),o?je(s,{code:Ae.too_big,maximum:i.value,type:"string",inclusive:!0,exact:!0,message:i.message}):c&&je(s,{code:Ae.too_small,minimum:i.value,type:"string",inclusive:!0,exact:!0,message:i.message}),r.dirty())}else if(i.kind==="email")AW.test(t.data)||(s=this._getOrReturnCtx(t,s),je(s,{validation:"email",code:Ae.invalid_string,message:i.message}),r.dirty());else if(i.kind==="emoji")L1||(L1=new RegExp(TW,"u")),L1.test(t.data)||(s=this._getOrReturnCtx(t,s),je(s,{validation:"emoji",code:Ae.invalid_string,message:i.message}),r.dirty());else if(i.kind==="uuid")EW.test(t.data)||(s=this._getOrReturnCtx(t,s),je(s,{validation:"uuid",code:Ae.invalid_string,message:i.message}),r.dirty());else if(i.kind==="nanoid")kW.test(t.data)||(s=this._getOrReturnCtx(t,s),je(s,{validation:"nanoid",code:Ae.invalid_string,message:i.message}),r.dirty());else if(i.kind==="cuid")bW.test(t.data)||(s=this._getOrReturnCtx(t,s),je(s,{validation:"cuid",code:Ae.invalid_string,message:i.message}),r.dirty());else if(i.kind==="cuid2")xW.test(t.data)||(s=this._getOrReturnCtx(t,s),je(s,{validation:"cuid2",code:Ae.invalid_string,message:i.message}),r.dirty());else if(i.kind==="ulid")SW.test(t.data)||(s=this._getOrReturnCtx(t,s),je(s,{validation:"ulid",code:Ae.invalid_string,message:i.message}),r.dirty());else if(i.kind==="url")try{new URL(t.data)}catch{s=this._getOrReturnCtx(t,s),je(s,{validation:"url",code:Ae.invalid_string,message:i.message}),r.dirty()}else i.kind==="regex"?(i.regex.lastIndex=0,i.regex.test(t.data)||(s=this._getOrReturnCtx(t,s),je(s,{validation:"regex",code:Ae.invalid_string,message:i.message}),r.dirty())):i.kind==="trim"?t.data=t.data.trim():i.kind==="includes"?t.data.includes(i.value,i.position)||(s=this._getOrReturnCtx(t,s),je(s,{code:Ae.invalid_string,validation:{includes:i.value,position:i.position},message:i.message}),r.dirty()):i.kind==="toLowerCase"?t.data=t.data.toLowerCase():i.kind==="toUpperCase"?t.data=t.data.toUpperCase():i.kind==="startsWith"?t.data.startsWith(i.value)||(s=this._getOrReturnCtx(t,s),je(s,{code:Ae.invalid_string,validation:{startsWith:i.value},message:i.message}),r.dirty()):i.kind==="endsWith"?t.data.endsWith(i.value)||(s=this._getOrReturnCtx(t,s),je(s,{code:Ae.invalid_string,validation:{endsWith:i.value},message:i.message}),r.dirty()):i.kind==="datetime"?FW(i).test(t.data)||(s=this._getOrReturnCtx(t,s),je(s,{code:Ae.invalid_string,validation:"datetime",message:i.message}),r.dirty()):i.kind==="date"?$W.test(t.data)||(s=this._getOrReturnCtx(t,s),je(s,{code:Ae.invalid_string,validation:"date",message:i.message}),r.dirty()):i.kind==="time"?DW(i).test(t.data)||(s=this._getOrReturnCtx(t,s),je(s,{code:Ae.invalid_string,validation:"time",message:i.message}),r.dirty()):i.kind==="duration"?PW.test(t.data)||(s=this._getOrReturnCtx(t,s),je(s,{validation:"duration",code:Ae.invalid_string,message:i.message}),r.dirty()):i.kind==="ip"?jW(t.data,i.version)||(s=this._getOrReturnCtx(t,s),je(s,{validation:"ip",code:Ae.invalid_string,message:i.message}),r.dirty()):i.kind==="jwt"?zW(t.data,i.alg)||(s=this._getOrReturnCtx(t,s),je(s,{validation:"jwt",code:Ae.invalid_string,message:i.message}),r.dirty()):i.kind==="cidr"?VW(t.data,i.version)||(s=this._getOrReturnCtx(t,s),je(s,{validation:"cidr",code:Ae.invalid_string,message:i.message}),r.dirty()):i.kind==="base64"?NW.test(t.data)||(s=this._getOrReturnCtx(t,s),je(s,{validation:"base64",code:Ae.invalid_string,message:i.message}),r.dirty()):i.kind==="base64url"?LW.test(t.data)||(s=this._getOrReturnCtx(t,s),je(s,{validation:"base64url",code:Ae.invalid_string,message:i.message}),r.dirty()):Yt.assertNever(i);return{status:r.value,value:t.data}}_regex(t,n,r){return this.refinement(s=>t.test(s),{validation:n,code:Ae.invalid_string,...tt.errToObj(r)})}_addCheck(t){return new el({...this._def,checks:[...this._def.checks,t]})}email(t){return this._addCheck({kind:"email",...tt.errToObj(t)})}url(t){return this._addCheck({kind:"url",...tt.errToObj(t)})}emoji(t){return this._addCheck({kind:"emoji",...tt.errToObj(t)})}uuid(t){return this._addCheck({kind:"uuid",...tt.errToObj(t)})}nanoid(t){return this._addCheck({kind:"nanoid",...tt.errToObj(t)})}cuid(t){return this._addCheck({kind:"cuid",...tt.errToObj(t)})}cuid2(t){return this._addCheck({kind:"cuid2",...tt.errToObj(t)})}ulid(t){return this._addCheck({kind:"ulid",...tt.errToObj(t)})}base64(t){return this._addCheck({kind:"base64",...tt.errToObj(t)})}base64url(t){return this._addCheck({kind:"base64url",...tt.errToObj(t)})}jwt(t){return this._addCheck({kind:"jwt",...tt.errToObj(t)})}ip(t){return this._addCheck({kind:"ip",...tt.errToObj(t)})}cidr(t){return this._addCheck({kind:"cidr",...tt.errToObj(t)})}datetime(t){return typeof t=="string"?this._addCheck({kind:"datetime",precision:null,offset:!1,local:!1,message:t}):this._addCheck({kind:"datetime",precision:typeof(t==null?void 0:t.precision)>"u"?null:t==null?void 0:t.precision,offset:(t==null?void 0:t.offset)??!1,local:(t==null?void 0:t.local)??!1,...tt.errToObj(t==null?void 0:t.message)})}date(t){return this._addCheck({kind:"date",message:t})}time(t){return typeof t=="string"?this._addCheck({kind:"time",precision:null,message:t}):this._addCheck({kind:"time",precision:typeof(t==null?void 0:t.precision)>"u"?null:t==null?void 0:t.precision,...tt.errToObj(t==null?void 0:t.message)})}duration(t){return this._addCheck({kind:"duration",...tt.errToObj(t)})}regex(t,n){return this._addCheck({kind:"regex",regex:t,...tt.errToObj(n)})}includes(t,n){return this._addCheck({kind:"includes",value:t,position:n==null?void 0:n.position,...tt.errToObj(n==null?void 0:n.message)})}startsWith(t,n){return this._addCheck({kind:"startsWith",value:t,...tt.errToObj(n)})}endsWith(t,n){return this._addCheck({kind:"endsWith",value:t,...tt.errToObj(n)})}min(t,n){return this._addCheck({kind:"min",value:t,...tt.errToObj(n)})}max(t,n){return this._addCheck({kind:"max",value:t,...tt.errToObj(n)})}length(t,n){return this._addCheck({kind:"length",value:t,...tt.errToObj(n)})}nonempty(t){return this.min(1,tt.errToObj(t))}trim(){return new el({...this._def,checks:[...this._def.checks,{kind:"trim"}]})}toLowerCase(){return new el({...this._def,checks:[...this._def.checks,{kind:"toLowerCase"}]})}toUpperCase(){return new el({...this._def,checks:[...this._def.checks,{kind:"toUpperCase"}]})}get isDatetime(){return!!this._def.checks.find(t=>t.kind==="datetime")}get isDate(){return!!this._def.checks.find(t=>t.kind==="date")}get isTime(){return!!this._def.checks.find(t=>t.kind==="time")}get isDuration(){return!!this._def.checks.find(t=>t.kind==="duration")}get isEmail(){return!!this._def.checks.find(t=>t.kind==="email")}get isURL(){return!!this._def.checks.find(t=>t.kind==="url")}get isEmoji(){return!!this._def.checks.find(t=>t.kind==="emoji")}get isUUID(){return!!this._def.checks.find(t=>t.kind==="uuid")}get isNANOID(){return!!this._def.checks.find(t=>t.kind==="nanoid")}get isCUID(){return!!this._def.checks.find(t=>t.kind==="cuid")}get isCUID2(){return!!this._def.checks.find(t=>t.kind==="cuid2")}get isULID(){return!!this._def.checks.find(t=>t.kind==="ulid")}get isIP(){return!!this._def.checks.find(t=>t.kind==="ip")}get isCIDR(){return!!this._def.checks.find(t=>t.kind==="cidr")}get isBase64(){return!!this._def.checks.find(t=>t.kind==="base64")}get isBase64url(){return!!this._def.checks.find(t=>t.kind==="base64url")}get minLength(){let t=null;for(const n of this._def.checks)n.kind==="min"&&(t===null||n.value>t)&&(t=n.value);return t}get maxLength(){let t=null;for(const n of this._def.checks)n.kind==="max"&&(t===null||n.value<t)&&(t=n.value);return t}}el.create=e=>new el({checks:[],typeName:_t.ZodString,coerce:(e==null?void 0:e.coerce)??!1,...Mt(e)});function HW(e,t){const n=(e.toString().split(".")[1]||"").length,r=(t.toString().split(".")[1]||"").length,s=n>r?n:r,i=Number.parseInt(e.toFixed(s).replace(".","")),o=Number.parseInt(t.toFixed(s).replace(".",""));return i%o/10**s}class mh extends Kt{constructor(){super(...arguments),this.min=this.gte,this.max=this.lte,this.step=this.multipleOf}_parse(t){if(this._def.coerce&&(t.data=Number(t.data)),this._getType(t)!==Ye.number){const i=this._getOrReturnCtx(t);return je(i,{code:Ae.invalid_type,expected:Ye.number,received:i.parsedType}),yt}let r;const s=new Ys;for(const i of this._def.checks)i.kind==="int"?Yt.isInteger(t.data)||(r=this._getOrReturnCtx(t,r),je(r,{code:Ae.invalid_type,expected:"integer",received:"float",message:i.message}),s.dirty()):i.kind==="min"?(i.inclusive?t.data<i.value:t.data<=i.value)&&(r=this._getOrReturnCtx(t,r),je(r,{code:Ae.too_small,minimum:i.value,type:"number",inclusive:i.inclusive,exact:!1,message:i.message}),s.dirty()):i.kind==="max"?(i.inclusive?t.data>i.value:t.data>=i.value)&&(r=this._getOrReturnCtx(t,r),je(r,{code:Ae.too_big,maximum:i.value,type:"number",inclusive:i.inclusive,exact:!1,message:i.message}),s.dirty()):i.kind==="multipleOf"?HW(t.data,i.value)!==0&&(r=this._getOrReturnCtx(t,r),je(r,{code:Ae.not_multiple_of,multipleOf:i.value,message:i.message}),s.dirty()):i.kind==="finite"?Number.isFinite(t.data)||(r=this._getOrReturnCtx(t,r),je(r,{code:Ae.not_finite,message:i.message}),s.dirty()):Yt.assertNever(i);return{status:s.value,value:t.data}}gte(t,n){return this.setLimit("min",t,!0,tt.toString(n))}gt(t,n){return this.setLimit("min",t,!1,tt.toString(n))}lte(t,n){return this.setLimit("max",t,!0,tt.toString(n))}lt(t,n){return this.setLimit("max",t,!1,tt.toString(n))}setLimit(t,n,r,s){return new mh({...this._def,checks:[...this._def.checks,{kind:t,value:n,inclusive:r,message:tt.toString(s)}]})}_addCheck(t){return new mh({...this._def,checks:[...this._def.checks,t]})}int(t){return this._addCheck({kind:"int",message:tt.toString(t)})}positive(t){return this._addCheck({kind:"min",value:0,inclusive:!1,message:tt.toString(t)})}negative(t){return this._addCheck({kind:"max",value:0,inclusive:!1,message:tt.toString(t)})}nonpositive(t){return this._addCheck({kind:"max",value:0,inclusive:!0,message:tt.toString(t)})}nonnegative(t){return this._addCheck({kind:"min",value:0,inclusive:!0,message:tt.toString(t)})}multipleOf(t,n){return this._addCheck({kind:"multipleOf",value:t,message:tt.toString(n)})}finite(t){return this._addCheck({kind:"finite",message:tt.toString(t)})}safe(t){return this._addCheck({kind:"min",inclusive:!0,value:Number.MIN_SAFE_INTEGER,message:tt.toString(t)})._addCheck({kind:"max",inclusive:!0,value:Number.MAX_SAFE_INTEGER,message:tt.toString(t)})}get minValue(){let t=null;for(const n of this._def.checks)n.kind==="min"&&(t===null||n.value>t)&&(t=n.value);return t}get maxValue(){let t=null;for(const n of this._def.checks)n.kind==="max"&&(t===null||n.value<t)&&(t=n.value);return t}get isInt(){return!!this._def.checks.find(t=>t.kind==="int"||t.kind==="multipleOf"&&Yt.isInteger(t.value))}get isFinite(){let t=null,n=null;for(const r of this._def.checks){if(r.kind==="finite"||r.kind==="int"||r.kind==="multipleOf")return!0;r.kind==="min"?(n===null||r.value>n)&&(n=r.value):r.kind==="max"&&(t===null||r.value<t)&&(t=r.value)}return Number.isFinite(n)&&Number.isFinite(t)}}mh.create=e=>new mh({checks:[],typeName:_t.ZodNumber,coerce:(e==null?void 0:e.coerce)||!1,...Mt(e)});class gh extends Kt{constructor(){super(...arguments),this.min=this.gte,this.max=this.lte}_parse(t){if(this._def.coerce)try{t.data=BigInt(t.data)}catch{return this._getInvalidInput(t)}if(this._getType(t)!==Ye.bigint)return this._getInvalidInput(t);let r;const s=new Ys;for(const i of this._def.checks)i.kind==="min"?(i.inclusive?t.data<i.value:t.data<=i.value)&&(r=this._getOrReturnCtx(t,r),je(r,{code:Ae.too_small,type:"bigint",minimum:i.value,inclusive:i.inclusive,message:i.message}),s.dirty()):i.kind==="max"?(i.inclusive?t.data>i.value:t.data>=i.value)&&(r=this._getOrReturnCtx(t,r),je(r,{code:Ae.too_big,type:"bigint",maximum:i.value,inclusive:i.inclusive,message:i.message}),s.dirty()):i.kind==="multipleOf"?t.data%i.value!==BigInt(0)&&(r=this._getOrReturnCtx(t,r),je(r,{code:Ae.not_multiple_of,multipleOf:i.value,message:i.message}),s.dirty()):Yt.assertNever(i);return{status:s.value,value:t.data}}_getInvalidInput(t){const n=this._getOrReturnCtx(t);return je(n,{code:Ae.invalid_type,expected:Ye.bigint,received:n.parsedType}),yt}gte(t,n){return this.setLimit("min",t,!0,tt.toString(n))}gt(t,n){return this.setLimit("min",t,!1,tt.toString(n))}lte(t,n){return this.setLimit("max",t,!0,tt.toString(n))}lt(t,n){return this.setLimit("max",t,!1,tt.toString(n))}setLimit(t,n,r,s){return new gh({...this._def,checks:[...this._def.checks,{kind:t,value:n,inclusive:r,message:tt.toString(s)}]})}_addCheck(t){return new gh({...this._def,checks:[...this._def.checks,t]})}positive(t){return this._addCheck({kind:"min",value:BigInt(0),inclusive:!1,message:tt.toString(t)})}negative(t){return this._addCheck({kind:"max",value:BigInt(0),inclusive:!1,message:tt.toString(t)})}nonpositive(t){return this._addCheck({kind:"max",value:BigInt(0),inclusive:!0,message:tt.toString(t)})}nonnegative(t){return this._addCheck({kind:"min",value:BigInt(0),inclusive:!0,message:tt.toString(t)})}multipleOf(t,n){return this._addCheck({kind:"multipleOf",value:t,message:tt.toString(n)})}get minValue(){let t=null;for(const n of this._def.checks)n.kind==="min"&&(t===null||n.value>t)&&(t=n.value);return t}get maxValue(){let t=null;for(const n of this._def.checks)n.kind==="max"&&(t===null||n.value<t)&&(t=n.value);return t}}gh.create=e=>new gh({checks:[],typeName:_t.ZodBigInt,coerce:(e==null?void 0:e.coerce)??!1,...Mt(e)});class _8 extends Kt{_parse(t){if(this._def.coerce&&(t.data=!!t.data),this._getType(t)!==Ye.boolean){const r=this._getOrReturnCtx(t);return je(r,{code:Ae.invalid_type,expected:Ye.boolean,received:r.parsedType}),yt}return yi(t.data)}}_8.create=e=>new _8({typeName:_t.ZodBoolean,coerce:(e==null?void 0:e.coerce)||!1,...Mt(e)});class B0 extends Kt{_parse(t){if(this._def.coerce&&(t.data=new Date(t.data)),this._getType(t)!==Ye.date){const i=this._getOrReturnCtx(t);return je(i,{code:Ae.invalid_type,expected:Ye.date,received:i.parsedType}),yt}if(Number.isNaN(t.data.getTime())){const i=this._getOrReturnCtx(t);return je(i,{code:Ae.invalid_date}),yt}const r=new Ys;let s;for(const i of this._def.checks)i.kind==="min"?t.data.getTime()<i.value&&(s=this._getOrReturnCtx(t,s),je(s,{code:Ae.too_small,message:i.message,inclusive:!0,exact:!1,minimum:i.value,type:"date"}),r.dirty()):i.kind==="max"?t.data.getTime()>i.value&&(s=this._getOrReturnCtx(t,s),je(s,{code:Ae.too_big,message:i.message,inclusive:!0,exact:!1,maximum:i.value,type:"date"}),r.dirty()):Yt.assertNever(i);return{status:r.value,value:new Date(t.data.getTime())}}_addCheck(t){return new B0({...this._def,checks:[...this._def.checks,t]})}min(t,n){return this._addCheck({kind:"min",value:t.getTime(),message:tt.toString(n)})}max(t,n){return this._addCheck({kind:"max",value:t.getTime(),message:tt.toString(n)})}get minDate(){let t=null;for(const n of this._def.checks)n.kind==="min"&&(t===null||n.value>t)&&(t=n.value);return t!=null?new Date(t):null}get maxDate(){let t=null;for(const n of this._def.checks)n.kind==="max"&&(t===null||n.value<t)&&(t=n.value);return t!=null?new Date(t):null}}B0.create=e=>new B0({checks:[],coerce:(e==null?void 0:e.coerce)||!1,typeName:_t.ZodDate,...Mt(e)});class w8 extends Kt{_parse(t){if(this._getType(t)!==Ye.symbol){const r=this._getOrReturnCtx(t);return je(r,{code:Ae.invalid_type,expected:Ye.symbol,received:r.parsedType}),yt}return yi(t.data)}}w8.create=e=>new w8({typeName:_t.ZodSymbol,...Mt(e)});class b8 extends Kt{_parse(t){if(this._getType(t)!==Ye.undefined){const r=this._getOrReturnCtx(t);return je(r,{code:Ae.invalid_type,expected:Ye.undefined,received:r.parsedType}),yt}return yi(t.data)}}b8.create=e=>new b8({typeName:_t.ZodUndefined,...Mt(e)});class x8 extends Kt{_parse(t){if(this._getType(t)!==Ye.null){const r=this._getOrReturnCtx(t);return je(r,{code:Ae.invalid_type,expected:Ye.null,received:r.parsedType}),yt}return yi(t.data)}}x8.create=e=>new x8({typeName:_t.ZodNull,...Mt(e)});class S8 extends Kt{constructor(){super(...arguments),this._any=!0}_parse(t){return yi(t.data)}}S8.create=e=>new S8({typeName:_t.ZodAny,...Mt(e)});class E8 extends Kt{constructor(){super(...arguments),this._unknown=!0}_parse(t){return yi(t.data)}}E8.create=e=>new E8({typeName:_t.ZodUnknown,...Mt(e)});class fl extends Kt{_parse(t){const n=this._getOrReturnCtx(t);return je(n,{code:Ae.invalid_type,expected:Ye.never,received:n.parsedType}),yt}}fl.create=e=>new fl({typeName:_t.ZodNever,...Mt(e)});class k8 extends Kt{_parse(t){if(this._getType(t)!==Ye.undefined){const r=this._getOrReturnCtx(t);return je(r,{code:Ae.invalid_type,expected:Ye.void,received:r.parsedType}),yt}return yi(t.data)}}k8.create=e=>new k8({typeName:_t.ZodVoid,...Mt(e)});class go extends Kt{_parse(t){const{ctx:n,status:r}=this._processInputParams(t),s=this._def;if(n.parsedType!==Ye.array)return je(n,{code:Ae.invalid_type,expected:Ye.array,received:n.parsedType}),yt;if(s.exactLength!==null){const o=n.data.length>s.exactLength.value,c=n.data.length<s.exactLength.value;(o||c)&&(je(n,{code:o?Ae.too_big:Ae.too_small,minimum:c?s.exactLength.value:void 0,maximum:o?s.exactLength.value:void 0,type:"array",inclusive:!0,exact:!0,message:s.exactLength.message}),r.dirty())}if(s.minLength!==null&&n.data.length<s.minLength.value&&(je(n,{code:Ae.too_small,minimum:s.minLength.value,type:"array",inclusive:!0,exact:!1,message:s.minLength.message}),r.dirty()),s.maxLength!==null&&n.data.length>s.maxLength.value&&(je(n,{code:Ae.too_big,maximum:s.maxLength.value,type:"array",inclusive:!0,exact:!1,message:s.maxLength.message}),r.dirty()),n.common.async)return Promise.all([...n.data].map((o,c)=>s.type._parseAsync(new dl(n,o,n.path,c)))).then(o=>Ys.mergeArray(r,o));const i=[...n.data].map((o,c)=>s.type._parseSync(new dl(n,o,n.path,c)));return Ys.mergeArray(r,i)}get element(){return this._def.type}min(t,n){return new go({...this._def,minLength:{value:t,message:tt.toString(n)}})}max(t,n){return new go({...this._def,maxLength:{value:t,message:tt.toString(n)}})}length(t,n){return new go({...this._def,exactLength:{value:t,message:tt.toString(n)}})}nonempty(t){return this.min(1,t)}}go.create=(e,t)=>new go({type:e,minLength:null,maxLength:null,exactLength:null,typeName:_t.ZodArray,...Mt(t)});function vu(e){if(e instanceof rr){const t={};for(const n in e.shape){const r=e.shape[n];t[n]=il.create(vu(r))}return new rr({...e._def,shape:()=>t})}else return e instanceof go?new go({...e._def,type:vu(e.element)}):e instanceof il?il.create(vu(e.unwrap())):e instanceof dd?dd.create(vu(e.unwrap())):e instanceof xc?xc.create(e.items.map(t=>vu(t))):e}class rr extends Kt{constructor(){super(...arguments),this._cached=null,this.nonstrict=this.passthrough,this.augment=this.extend}_getCached(){if(this._cached!==null)return this._cached;const t=this._def.shape(),n=Yt.objectKeys(t);return this._cached={shape:t,keys:n},this._cached}_parse(t){if(this._getType(t)!==Ye.object){const d=this._getOrReturnCtx(t);return je(d,{code:Ae.invalid_type,expected:Ye.object,received:d.parsedType}),yt}const{status:r,ctx:s}=this._processInputParams(t),{shape:i,keys:o}=this._getCached(),c=[];if(!(this._def.catchall instanceof fl&&this._def.unknownKeys==="strip"))for(const d in s.data)o.includes(d)||c.push(d);const u=[];for(const d of o){const f=i[d],p=s.data[d];u.push({key:{status:"valid",value:d},value:f._parse(new dl(s,p,s.path,d)),alwaysSet:d in s.data})}if(this._def.catchall instanceof fl){const d=this._def.unknownKeys;if(d==="passthrough")for(const f of c)u.push({key:{status:"valid",value:f},value:{status:"valid",value:s.data[f]}});else if(d==="strict")c.length>0&&(je(s,{code:Ae.unrecognized_keys,keys:c}),r.dirty());else if(d!=="strip")throw new Error("Internal ZodObject error: invalid unknownKeys value.")}else{const d=this._def.catchall;for(const f of c){const p=s.data[f];u.push({key:{status:"valid",value:f},value:d._parse(new dl(s,p,s.path,f)),alwaysSet:f in s.data})}}return s.common.async?Promise.resolve().then(async()=>{const d=[];for(const f of u){const p=await f.key,m=await f.value;d.push({key:p,value:m,alwaysSet:f.alwaysSet})}return d}).then(d=>Ys.mergeObjectSync(r,d)):Ys.mergeObjectSync(r,u)}get shape(){return this._def.shape()}strict(t){return tt.errToObj,new rr({...this._def,unknownKeys:"strict",...t!==void 0?{errorMap:(n,r)=>{var i,o;const s=((o=(i=this._def).errorMap)==null?void 0:o.call(i,n,r).message)??r.defaultError;return n.code==="unrecognized_keys"?{message:tt.errToObj(t).message??s}:{message:s}}}:{}})}strip(){return new rr({...this._def,unknownKeys:"strip"})}passthrough(){return new rr({...this._def,unknownKeys:"passthrough"})}extend(t){return new rr({...this._def,shape:()=>({...this._def.shape(),...t})})}merge(t){return new rr({unknownKeys:t._def.unknownKeys,catchall:t._def.catchall,shape:()=>({...this._def.shape(),...t._def.shape()}),typeName:_t.ZodObject})}setKey(t,n){return this.augment({[t]:n})}catchall(t){return new rr({...this._def,catchall:t})}pick(t){const n={};for(const r of Yt.objectKeys(t))t[r]&&this.shape[r]&&(n[r]=this.shape[r]);return new rr({...this._def,shape:()=>n})}omit(t){const n={};for(const r of Yt.objectKeys(this.shape))t[r]||(n[r]=this.shape[r]);return new rr({...this._def,shape:()=>n})}deepPartial(){return vu(this)}partial(t){const n={};for(const r of Yt.objectKeys(this.shape)){const s=this.shape[r];t&&!t[r]?n[r]=s:n[r]=s.optional()}return new rr({...this._def,shape:()=>n})}required(t){const n={};for(const r of Yt.objectKeys(this.shape))if(t&&!t[r])n[r]=this.shape[r];else{let i=this.shape[r];for(;i instanceof il;)i=i._def.innerType;n[r]=i}return new rr({...this._def,shape:()=>n})}keyof(){return HO(Yt.objectKeys(this.shape))}}rr.create=(e,t)=>new rr({shape:()=>e,unknownKeys:"strip",catchall:fl.create(),typeName:_t.ZodObject,...Mt(t)});rr.strictCreate=(e,t)=>new rr({shape:()=>e,unknownKeys:"strict",catchall:fl.create(),typeName:_t.ZodObject,...Mt(t)});rr.lazycreate=(e,t)=>new rr({shape:e,unknownKeys:"strip",catchall:fl.create(),typeName:_t.ZodObject,...Mt(t)});class W0 extends Kt{_parse(t){const{ctx:n}=this._processInputParams(t),r=this._def.options;function s(i){for(const c of i)if(c.result.status==="valid")return c.result;for(const c of i)if(c.result.status==="dirty")return n.common.issues.push(...c.ctx.common.issues),c.result;const o=i.map(c=>new ia(c.ctx.common.issues));return je(n,{code:Ae.invalid_union,unionErrors:o}),yt}if(n.common.async)return Promise.all(r.map(async i=>{const o={...n,common:{...n.common,issues:[]},parent:null};return{result:await i._parseAsync({data:n.data,path:n.path,parent:o}),ctx:o}})).then(s);{let i;const o=[];for(const u of r){const d={...n,common:{...n.common,issues:[]},parent:null},f=u._parseSync({data:n.data,path:n.path,parent:d});if(f.status==="valid")return f;f.status==="dirty"&&!i&&(i={result:f,ctx:d}),d.common.issues.length&&o.push(d.common.issues)}if(i)return n.common.issues.push(...i.ctx.common.issues),i.result;const c=o.map(u=>new ia(u));return je(n,{code:Ae.invalid_union,unionErrors:c}),yt}}get options(){return this._def.options}}W0.create=(e,t)=>new W0({options:e,typeName:_t.ZodUnion,...Mt(t)});function kw(e,t){const n=ja(e),r=ja(t);if(e===t)return{valid:!0,data:e};if(n===Ye.object&&r===Ye.object){const s=Yt.objectKeys(t),i=Yt.objectKeys(e).filter(c=>s.indexOf(c)!==-1),o={...e,...t};Object.prototype.hasOwnProperty.call(o,"__proto__")&&delete o.__proto__;for(const c of i){if(c==="__proto__")continue;const u=kw(e[c],t[c]);if(!u.valid)return{valid:!1};o[c]=u.data}return{valid:!0,data:o}}else if(n===Ye.array&&r===Ye.array){if(e.length!==t.length)return{valid:!1};const s=[];for(let i=0;i<e.length;i++){const o=e[i],c=t[i],u=kw(o,c);if(!u.valid)return{valid:!1};s.push(u.data)}return{valid:!0,data:s}}else return n===Ye.date&&r===Ye.date&&+e==+t?{valid:!0,data:e}:{valid:!1}}class K0 extends Kt{_parse(t){const{status:n,ctx:r}=this._processInputParams(t),s=(i,o)=>{if(g8(i)||g8(o))return yt;const c=kw(i.value,o.value);return c.valid?((v8(i)||v8(o))&&n.dirty(),{status:n.value,value:c.data}):(je(r,{code:Ae.invalid_intersection_types}),yt)};return r.common.async?Promise.all([this._def.left._parseAsync({data:r.data,path:r.path,parent:r}),this._def.right._parseAsync({data:r.data,path:r.path,parent:r})]).then(([i,o])=>s(i,o)):s(this._def.left._parseSync({data:r.data,path:r.path,parent:r}),this._def.right._parseSync({data:r.data,path:r.path,parent:r}))}}K0.create=(e,t,n)=>new K0({left:e,right:t,typeName:_t.ZodIntersection,...Mt(n)});class xc extends Kt{_parse(t){const{status:n,ctx:r}=this._processInputParams(t);if(r.parsedType!==Ye.array)return je(r,{code:Ae.invalid_type,expected:Ye.array,received:r.parsedType}),yt;if(r.data.length<this._def.items.length)return je(r,{code:Ae.too_small,minimum:this._def.items.length,inclusive:!0,exact:!1,type:"array"}),yt;!this._def.rest&&r.data.length>this._def.items.length&&(je(r,{code:Ae.too_big,maximum:this._def.items.length,inclusive:!0,exact:!1,type:"array"}),n.dirty());const i=[...r.data].map((o,c)=>{const u=this._def.items[c]||this._def.rest;return u?u._parse(new dl(r,o,r.path,c)):null}).filter(o=>!!o);return r.common.async?Promise.all(i).then(o=>Ys.mergeArray(n,o)):Ys.mergeArray(n,i)}get items(){return this._def.items}rest(t){return new xc({...this._def,rest:t})}}xc.create=(e,t)=>{if(!Array.isArray(e))throw new Error("You must pass an array of schemas to z.tuple([ ... ])");return new xc({items:e,typeName:_t.ZodTuple,rest:null,...Mt(t)})};class C8 extends Kt{get keySchema(){return this._def.keyType}get valueSchema(){return this._def.valueType}_parse(t){const{status:n,ctx:r}=this._processInputParams(t);if(r.parsedType!==Ye.map)return je(r,{code:Ae.invalid_type,expected:Ye.map,received:r.parsedType}),yt;const s=this._def.keyType,i=this._def.valueType,o=[...r.data.entries()].map(([c,u],d)=>({key:s._parse(new dl(r,c,r.path,[d,"key"])),value:i._parse(new dl(r,u,r.path,[d,"value"]))}));if(r.common.async){const c=new Map;return Promise.resolve().then(async()=>{for(const u of o){const d=await u.key,f=await u.value;if(d.status==="aborted"||f.status==="aborted")return yt;(d.status==="dirty"||f.status==="dirty")&&n.dirty(),c.set(d.value,f.value)}return{status:n.value,value:c}})}else{const c=new Map;for(const u of o){const d=u.key,f=u.value;if(d.status==="aborted"||f.status==="aborted")return yt;(d.status==="dirty"||f.status==="dirty")&&n.dirty(),c.set(d.value,f.value)}return{status:n.value,value:c}}}}C8.create=(e,t,n)=>new C8({valueType:t,keyType:e,typeName:_t.ZodMap,...Mt(n)});class vh extends Kt{_parse(t){const{status:n,ctx:r}=this._processInputParams(t);if(r.parsedType!==Ye.set)return je(r,{code:Ae.invalid_type,expected:Ye.set,received:r.parsedType}),yt;const s=this._def;s.minSize!==null&&r.data.size<s.minSize.value&&(je(r,{code:Ae.too_small,minimum:s.minSize.value,type:"set",inclusive:!0,exact:!1,message:s.minSize.message}),n.dirty()),s.maxSize!==null&&r.data.size>s.maxSize.value&&(je(r,{code:Ae.too_big,maximum:s.maxSize.value,type:"set",inclusive:!0,exact:!1,message:s.maxSize.message}),n.dirty());const i=this._def.valueType;function o(u){const d=new Set;for(const f of u){if(f.status==="aborted")return yt;f.status==="dirty"&&n.dirty(),d.add(f.value)}return{status:n.value,value:d}}const c=[...r.data.values()].map((u,d)=>i._parse(new dl(r,u,r.path,d)));return r.common.async?Promise.all(c).then(u=>o(u)):o(c)}min(t,n){return new vh({...this._def,minSize:{value:t,message:tt.toString(n)}})}max(t,n){return new vh({...this._def,maxSize:{value:t,message:tt.toString(n)}})}size(t,n){return this.min(t,n).max(t,n)}nonempty(t){return this.min(1,t)}}vh.create=(e,t)=>new vh({valueType:e,minSize:null,maxSize:null,typeName:_t.ZodSet,...Mt(t)});class P8 extends Kt{get schema(){return this._def.getter()}_parse(t){const{ctx:n}=this._processInputParams(t);return this._def.getter()._parse({data:n.data,path:n.path,parent:n})}}P8.create=(e,t)=>new P8({getter:e,typeName:_t.ZodLazy,...Mt(t)});class A8 extends Kt{_parse(t){if(t.data!==this._def.value){const n=this._getOrReturnCtx(t);return je(n,{received:n.data,code:Ae.invalid_literal,expected:this._def.value}),yt}return{status:"valid",value:t.data}}get value(){return this._def.value}}A8.create=(e,t)=>new A8({value:e,typeName:_t.ZodLiteral,...Mt(t)});function HO(e,t){return new cd({values:e,typeName:_t.ZodEnum,...Mt(t)})}class cd extends Kt{_parse(t){if(typeof t.data!="string"){const n=this._getOrReturnCtx(t),r=this._def.values;return je(n,{expected:Yt.joinValues(r),received:n.parsedType,code:Ae.invalid_type}),yt}if(this._cache||(this._cache=new Set(this._def.values)),!this._cache.has(t.data)){const n=this._getOrReturnCtx(t),r=this._def.values;return je(n,{received:n.data,code:Ae.invalid_enum_value,options:r}),yt}return yi(t.data)}get options(){return this._def.values}get enum(){const t={};for(const n of this._def.values)t[n]=n;return t}get Values(){const t={};for(const n of this._def.values)t[n]=n;return t}get Enum(){const t={};for(const n of this._def.values)t[n]=n;return t}extract(t,n=this._def){return cd.create(t,{...this._def,...n})}exclude(t,n=this._def){return cd.create(this.options.filter(r=>!t.includes(r)),{...this._def,...n})}}cd.create=HO;class T8 extends Kt{_parse(t){const n=Yt.getValidEnumValues(this._def.values),r=this._getOrReturnCtx(t);if(r.parsedType!==Ye.string&&r.parsedType!==Ye.number){const s=Yt.objectValues(n);return je(r,{expected:Yt.joinValues(s),received:r.parsedType,code:Ae.invalid_type}),yt}if(this._cache||(this._cache=new Set(Yt.getValidEnumValues(this._def.values))),!this._cache.has(t.data)){const s=Yt.objectValues(n);return je(r,{received:r.data,code:Ae.invalid_enum_value,options:s}),yt}return yi(t.data)}get enum(){return this._def.values}}T8.create=(e,t)=>new T8({values:e,typeName:_t.ZodNativeEnum,...Mt(t)});class G0 extends Kt{unwrap(){return this._def.type}_parse(t){const{ctx:n}=this._processInputParams(t);if(n.parsedType!==Ye.promise&&n.common.async===!1)return je(n,{code:Ae.invalid_type,expected:Ye.promise,received:n.parsedType}),yt;const r=n.parsedType===Ye.promise?n.data:Promise.resolve(n.data);return yi(r.then(s=>this._def.type.parseAsync(s,{path:n.path,errorMap:n.common.contextualErrorMap})))}}G0.create=(e,t)=>new G0({type:e,typeName:_t.ZodPromise,...Mt(t)});class ud extends Kt{innerType(){return this._def.schema}sourceType(){return this._def.schema._def.typeName===_t.ZodEffects?this._def.schema.sourceType():this._def.schema}_parse(t){const{status:n,ctx:r}=this._processInputParams(t),s=this._def.effect||null,i={addIssue:o=>{je(r,o),o.fatal?n.abort():n.dirty()},get path(){return r.path}};if(i.addIssue=i.addIssue.bind(i),s.type==="preprocess"){const o=s.transform(r.data,i);if(r.common.async)return Promise.resolve(o).then(async c=>{if(n.value==="aborted")return yt;const u=await this._def.schema._parseAsync({data:c,path:r.path,parent:r});return u.status==="aborted"?yt:u.status==="dirty"||n.value==="dirty"?Df(u.value):u});{if(n.value==="aborted")return yt;const c=this._def.schema._parseSync({data:o,path:r.path,parent:r});return c.status==="aborted"?yt:c.status==="dirty"||n.value==="dirty"?Df(c.value):c}}if(s.type==="refinement"){const o=c=>{const u=s.refinement(c,i);if(r.common.async)return Promise.resolve(u);if(u instanceof Promise)throw new Error("Async refinement encountered during synchronous parse operation. Use .parseAsync instead.");return c};if(r.common.async===!1){const c=this._def.schema._parseSync({data:r.data,path:r.path,parent:r});return c.status==="aborted"?yt:(c.status==="dirty"&&n.dirty(),o(c.value),{status:n.value,value:c.value})}else return this._def.schema._parseAsync({data:r.data,path:r.path,parent:r}).then(c=>c.status==="aborted"?yt:(c.status==="dirty"&&n.dirty(),o(c.value).then(()=>({status:n.value,value:c.value}))))}if(s.type==="transform")if(r.common.async===!1){const o=this._def.schema._parseSync({data:r.data,path:r.path,parent:r});if(!ld(o))return yt;const c=s.transform(o.value,i);if(c instanceof Promise)throw new Error("Asynchronous transform encountered during synchronous parse operation. Use .parseAsync instead.");return{status:n.value,value:c}}else return this._def.schema._parseAsync({data:r.data,path:r.path,parent:r}).then(o=>ld(o)?Promise.resolve(s.transform(o.value,i)).then(c=>({status:n.value,value:c})):yt);Yt.assertNever(s)}}ud.create=(e,t,n)=>new ud({schema:e,typeName:_t.ZodEffects,effect:t,...Mt(n)});ud.createWithPreprocess=(e,t,n)=>new ud({schema:t,effect:{type:"preprocess",transform:e},typeName:_t.ZodEffects,...Mt(n)});class il extends Kt{_parse(t){return this._getType(t)===Ye.undefined?yi(void 0):this._def.innerType._parse(t)}unwrap(){return this._def.innerType}}il.create=(e,t)=>new il({innerType:e,typeName:_t.ZodOptional,...Mt(t)});class dd extends Kt{_parse(t){return this._getType(t)===Ye.null?yi(null):this._def.innerType._parse(t)}unwrap(){return this._def.innerType}}dd.create=(e,t)=>new dd({innerType:e,typeName:_t.ZodNullable,...Mt(t)});class Cw extends Kt{_parse(t){const{ctx:n}=this._processInputParams(t);let r=n.data;return n.parsedType===Ye.undefined&&(r=this._def.defaultValue()),this._def.innerType._parse({data:r,path:n.path,parent:n})}removeDefault(){return this._def.innerType}}Cw.create=(e,t)=>new Cw({innerType:e,typeName:_t.ZodDefault,defaultValue:typeof t.default=="function"?t.default:()=>t.default,...Mt(t)});class Pw extends Kt{_parse(t){const{ctx:n}=this._processInputParams(t),r={...n,common:{...n.common,issues:[]}},s=this._def.innerType._parse({data:r.data,path:r.path,parent:{...r}});return Z0(s)?s.then(i=>({status:"valid",value:i.status==="valid"?i.value:this._def.catchValue({get error(){return new ia(r.common.issues)},input:r.data})})):{status:"valid",value:s.status==="valid"?s.value:this._def.catchValue({get error(){return new ia(r.common.issues)},input:r.data})}}removeCatch(){return this._def.innerType}}Pw.create=(e,t)=>new Pw({innerType:e,typeName:_t.ZodCatch,catchValue:typeof t.catch=="function"?t.catch:()=>t.catch,...Mt(t)});class R8 extends Kt{_parse(t){if(this._getType(t)!==Ye.nan){const r=this._getOrReturnCtx(t);return je(r,{code:Ae.invalid_type,expected:Ye.nan,received:r.parsedType}),yt}return{status:"valid",value:t.data}}}R8.create=e=>new R8({typeName:_t.ZodNaN,...Mt(e)});class UW extends Kt{_parse(t){const{ctx:n}=this._processInputParams(t),r=n.data;return this._def.type._parse({data:r,path:n.path,parent:n})}unwrap(){return this._def.type}}class Lb extends Kt{_parse(t){const{status:n,ctx:r}=this._processInputParams(t);if(r.common.async)return(async()=>{const i=await this._def.in._parseAsync({data:r.data,path:r.path,parent:r});return i.status==="aborted"?yt:i.status==="dirty"?(n.dirty(),Df(i.value)):this._def.out._parseAsync({data:i.value,path:r.path,parent:r})})();{const s=this._def.in._parseSync({data:r.data,path:r.path,parent:r});return s.status==="aborted"?yt:s.status==="dirty"?(n.dirty(),{status:"dirty",value:s.value}):this._def.out._parseSync({data:s.value,path:r.path,parent:r})}}static create(t,n){return new Lb({in:t,out:n,typeName:_t.ZodPipeline})}}class Aw extends Kt{_parse(t){const n=this._def.innerType._parse(t),r=s=>(ld(s)&&(s.value=Object.freeze(s.value)),s);return Z0(n)?n.then(s=>r(s)):r(n)}unwrap(){return this._def.innerType}}Aw.create=(e,t)=>new Aw({innerType:e,typeName:_t.ZodReadonly,...Mt(t)});var _t;(function(e){e.ZodString="ZodString",e.ZodNumber="ZodNumber",e.ZodNaN="ZodNaN",e.ZodBigInt="ZodBigInt",e.ZodBoolean="ZodBoolean",e.ZodDate="ZodDate",e.ZodSymbol="ZodSymbol",e.ZodUndefined="ZodUndefined",e.ZodNull="ZodNull",e.ZodAny="ZodAny",e.ZodUnknown="ZodUnknown",e.ZodNever="ZodNever",e.ZodVoid="ZodVoid",e.ZodArray="ZodArray",e.ZodObject="ZodObject",e.ZodUnion="ZodUnion",e.ZodDiscriminatedUnion="ZodDiscriminatedUnion",e.ZodIntersection="ZodIntersection",e.ZodTuple="ZodTuple",e.ZodRecord="ZodRecord",e.ZodMap="ZodMap",e.ZodSet="ZodSet",e.ZodFunction="ZodFunction",e.ZodLazy="ZodLazy",e.ZodLiteral="ZodLiteral",e.ZodEnum="ZodEnum",e.ZodEffects="ZodEffects",e.ZodNativeEnum="ZodNativeEnum",e.ZodOptional="ZodOptional",e.ZodNullable="ZodNullable",e.ZodDefault="ZodDefault",e.ZodCatch="ZodCatch",e.ZodPromise="ZodPromise",e.ZodBranded="ZodBranded",e.ZodPipeline="ZodPipeline",e.ZodReadonly="ZodReadonly"})(_t||(_t={}));const ku=el.create;fl.create;const ZW=go.create,UO=rr.create;W0.create;K0.create;xc.create;const BW=cd.create;G0.create;il.create;dd.create;const WW=UO({hash:ku().regex(/^[a-f0-9]{64}$/),mimeType:BW(["image/png","image/jpeg","image/webp","image/gif","image/avif"])}),ZO=UO({id:ku().min(1),title:ku().trim().min(1),url:ku().url().refine(e=>{try{const t=new URL(e);return["http:","https:"].includes(t.protocol)&&!t.username&&!t.password}catch{return!1}}).optional(),reason:ku().optional(),image:WW.optional().catch(void 0)}).refine(e=>!!(e.url||e.image),{message:"A reference requires a public URL or an image"}),KW=(...e)=>{const t=[],n=new Set,r=new Set;for(const s of e.flatMap(i=>i??[])){const i=ZO.safeParse(s);if(!i.success)continue;const o=i.data,c=o.url?new URL(o.url).href:void 0;if(n.has(o.id)||c&&r.has(c)){const u=t.find(d=>d.url===c&&(c!==void 0||d.id===o.id));u&&!u.image&&o.image&&(u.id===o.id||!n.has(o.id))&&(u.id=o.id,u.image=o.image,n.add(o.id));continue}t.push({...o,...c?{url:c}:{}}),n.add(o.id),c&&r.add(c)}return t.length?t:void 0},GW=6,yh=100,I8=100,qW=35*1024*1024,O8=Math.ceil(qW/3)*4,YW=zt(["pinterest","arena","x","cosmos"]),$b=zt(["image",...YW.options,"text","pdf","variant"]),oa=zt(["codex","claude","cursor"]),BO=ze({projectId:re().min(1).max(200),sessionId:re().min(1).max(200),variantId:re().min(1).max(200)}).strict();BO.extend({runtime:oa,note:re().trim().max(500).optional(),imageFile:re().min(1).max(2048).optional()});const WO=BO.extend({treeSha:re().max(100).optional()}),QW=ze({hash:re().regex(/^[a-f0-9]{64}$/),mimeType:zt(["image/png","image/jpeg","image/webp","image/gif"]),bytes:Pn().int().positive(),representation:zt(["image","video-cover","page","variant"]).default("image"),page:Pn().int().positive().optional()});ze({provider:$b,remoteId:re().trim().min(1).max(2048),title:re().trim().min(1).max(500),url:re().url().optional()});const KO=ze({provider:$b,remoteId:re().trim().min(1).max(2048),title:re().max(1e3),text:re().max(1e5),url:re().url().optional(),media:At(QW).max(100),remoteImages:At(re().url()).max(100).optional(),remoteImageRepresentations:At(zt(["image","video-cover"])).max(100).optional(),unsupportedReason:re().max(1e3).optional(),variant:WO.optional(),note:re().max(500).optional()}),GO=ze({inputTokens:Pn().nonnegative().optional(),outputTokens:Pn().nonnegative().optional(),cachedInputTokens:Pn().nonnegative().optional(),allocation:bc("equal-share").optional()}),Rue=ze({referenceId:re().min(1),revision:Pn().int().positive(),description:re().trim().min(1).max(8e3),runtime:Ed([oa,bc("user")]),evidence:zt(["observation","preference"]),usage:GO.optional()}),Iue=KO.extend({id:re(),revision:Pn()}),XW=ze({requestId:re().min(1).max(200),instruction:re().min(1).max(3e4),runtime:oa,mode:zt(["auto","off","uploads"]).default("off"),excludedSourceIds:At(re()).max(100).default([]),excludedReferenceIds:At(re()).max(100).default([]),excludedMediaHashes:At(re()).max(100).default([]),suppliedInputHashes:At(re().regex(/^[a-f0-9]{64}$/)).max(yh).optional()});XW.extend({mode:zt(["auto","off","uploads"]).default("uploads"),uploads:At(re().max(O8+I8)).max(yh).optional()}).refine(e=>(e.uploads??[]).reduce((t,n)=>t+n.length,0)<=O8+yh*I8,"Supplied images exceed the profile upload budget");const JW=xw().transform((e,t)=>{const n=ZO.safeParse(e);return n.success?n.data:(t.addIssue({code:DO.custom,message:"Invalid supplied image reference"}),YI)}),M8=ze({suppliedReferences:At(JW).max(yh).optional(),failedUploadCount:Pn().int().min(0).max(yh).optional(),usage:GO.optional(),requestId:re(),status:zt(["selected","empty","off","unavailable","timeout"]),queries:At(re()),candidateIds:At(re()),selected:At(ze({id:re(),revision:Pn(),title:re().optional(),url:re().url().optional(),mediaHashes:At(re().regex(/^[a-f0-9]{64}$/)).optional(),reason:re(),sourceTitles:At(re()),variant:WO.optional()})),contextText:re().max(6e3),images:At(ze({path:re(),hash:re().regex(/^[a-f0-9]{64}$/),mimeType:zt(["image/png","image/jpeg","image/webp","image/gif"])})).max(GW),durationMs:Pn()});M8.pick({requestId:!0,suppliedReferences:!0,failedUploadCount:!0,status:!0,selected:!0,images:!0,durationMs:!0}).extend({requestId:re().min(1).max(200),selected:M8.shape.selected.max(3)});const pc=re().regex(/^[1-9]\d{0,15}$/).refine(e=>Number.isSafeInteger(Number(e))),qO=re().min(1).max(4096),Db=e=>{const t=()=>new Error("Use an HTTPS Cosmos profile URL such as https://www.cosmos.so/username");let n;try{n=new URL(e)}catch{throw t()}const r=n.pathname.split("/").filter(Boolean);if(n.protocol!=="https:"||n.username||n.password||n.port||!["cosmos.so","www.cosmos.so"].includes(n.hostname)||r.length!==1)throw t();let s;try{s=decodeURIComponent(r[0])}catch{throw t()}if(!/^[a-zA-Z0-9_.-]{1,100}$/.test(s)||["e","login","signup","explore","search","collections","settings","api","profile"].includes(s.toLowerCase()))throw t();return{username:s,url:`https://www.cosmos.so/${encodeURIComponent(s)}`}},YO=re().max(2048).transform((e,t)=>{try{return Db(e).url}catch(n){return t.addIssue({code:DO.custom,message:ts(n,"Invalid Cosmos profile URL")}),YI}}),QO=e=>{const t=()=>new Error("Use an HTTPS Cosmos collection URL such as https://www.cosmos.so/owner/collection");let n;try{n=new URL(e)}catch{throw t()}const r=n.pathname.split("/").filter(Boolean);if(n.protocol!=="https:"||n.username||n.password||n.port||!["cosmos.so","www.cosmos.so"].includes(n.hostname)||r.length<2||r.length>3||r[0]==="e")throw t();let s;try{s=r.map(i=>decodeURIComponent(i))}catch{throw t()}if(s.some(i=>!i.length||i.length>300||/[/\\\p{Cc}]/u.test(i)))throw t();return{ownerUsername:s[0],slug:s[1],subcollectionSlug:s[2],url:`https://www.cosmos.so/${s.map(encodeURIComponent).join("/")}`}},eK=re().url().refine(e=>{const t=new URL(e);return t.protocol==="https:"&&t.hostname==="cdn.cosmos.so"&&!t.username&&!t.password&&!t.port}),tK=ze({id:pc,title:re().min(1).max(500),url:re().url().transform(e=>QO(e).url),children:At(pc)}),nK=ze({id:pc,url:re().url(),title:re().max(1e3),text:re().max(1e5),author:re().nullable(),owner:re().nullable(),sourceUrl:re().url().nullable(),images:At(ze({url:eK,representation:zt(["image","video-cover"])})).max(100),unsupportedReason:re().optional()}),rK=ze({collection:tK,elements:At(nK),total:Pn().int().nonnegative(),nextCursor:qO.nullable()});WB("status",[rK.extend({status:bc("ok")}),ze({status:bc("error"),message:re(),reason:zt(["rate_limited","provider_unavailable","collection_unavailable"]).optional(),retryAfterMs:Pn().nonnegative().optional()})]);const XO=ze({id:pc,username:re().min(1).max(100),title:re().max(500),url:re().transform(e=>Db(e).url)}),sK=ze({id:pc,title:re().min(1).max(500),description:re().max(1e4).nullable(),url:re().transform(e=>QO(e).url),total:Pn().int().nonnegative(),parentId:pc.nullable(),children:At(pc).max(1e4)});ze({profile:XO,collections:At(sK),total:Pn().int().nonnegative(),nextCursor:qO.nullable()});const Fb=zt(["pinterest","arena","x"]),iK=zt(["cosmos","pinterest","arena","x"]),Mu=re().min(1).max(200).regex(/^[a-zA-Z0-9:_-]+$/),JO={"www.cosmos.so":"cosmos","www.pinterest.com":"pinterest","www.are.na":"arena","x.com":"x"},oK=re().url().refine(e=>{const t=new URL(e);return t.protocol==="https:"&&!t.username&&!t.password&&!t.port&&!t.search&&!t.hash&&Fb.safeParse(JO[t.hostname]).success&&/^\/[a-zA-Z0-9_-]+\/?$/.test(t.pathname)},"Use a canonical reference provider profile URL"),jb=ze({id:Mu,username:re().min(1).max(100),title:re().max(500),url:Ed([YO,oK])}).transform(e=>JO[new URL(e.url).hostname]==="cosmos"?XO.parse(e):e),zb=ze({id:Mu,title:re().min(1).max(500),description:re().max(1e4).nullable(),url:re().url().nullable(),total:Pn().int().nonnegative().nullable(),parentId:Mu.nullable(),children:At(Mu).max(1e4)});Ed([ze({url:YO}).strict(),ze({provider:Fb}).strict()]);const aK=ze({collections:At(zb),total:Pn().int().nonnegative().nullable(),nextCursor:re().min(1).max(4096).nullable()});aK.extend({profile:jb});const _h=1e3,lK=1e4,cK=ze({profile:jb,collections:At(zb).max(_h),total:Pn().int().nonnegative().max(_h)}),uK=cK.extend({id:re().uuid(),createdAt:re().datetime()}),dK=ze({collection:zb,collectionIds:At(Mu).min(1).max(_h),references:At(KO.extend({provider:iK})).max(lK)}),fK=ze({discoveryId:re().uuid(),runtime:oa,sources:At(dK).min(1).max(_h),reusableCount:Pn().int().nonnegative()});fK.extend({id:re().uuid(),profile:jb,revision:re().regex(/^[a-f0-9]{64}$/),createdAt:re().datetime(),expiresAt:re().datetime(),approvedAt:re().datetime().nullable(),jobIds:At(re().uuid())});ze({discoveryId:re().uuid(),collectionIds:At(Mu).min(1).max(_h),runtime:oa}).strict();ze({id:re().uuid(),revision:re().regex(/^[a-f0-9]{64}$/),isApproved:bc(!0)}).strict();zt(["later","dismiss","reset"]);const Oue=200,Vb=ze({id:re(),name:re(),pinnedAt:re().nullable().optional(),lastOpenedAt:re(),projectPath:re(),isAvailable:Ts(),storageKind:zt(["project","bundle"]),issue:re().optional(),historyIssue:re().optional()}),hK=ze({dataUrl:re(),label:re(),capturedAt:re()}),pK=ze({projectId:re(),sessionId:re(),variantId:re(),label:re(),brief:re(),createdAt:re(),hasStaticPreview:Ts(),hasInteractivePreview:Ts()}),Mue=ze({projects:At(Vb),variants:At(pK)}),eM=ze({error:re()}),mK=ze({errorCode:re(),message:re()}),gK=ze({error:re().optional(),details:Ed([re(),ze({formErrors:At(re()).optional(),fieldErrors:Nb(re(),At(re()).optional()).optional()})]).optional()}),vK=ze({token:re().min(1)}),yK=ze({url:re().url()}),Nue=ze({projects:At(Vb)}),Lue=ze({project:Vb}),$ue=ze({projectId:re()}),Due=ze({preview:hK.nullable()}),Fue=ze({projectPath:re().nullable()}),jue=ze({editorUrl:re()}),zue=ze({url:re()}),Vue=ze({saved:bc(!0)}),_K=ze({requestId:re(),sequence:Pn(),projectId:re().optional(),sessionId:re().optional(),variantId:re().optional()}),Hue=ze({navigations:At(_K)}),Uue=ze({acknowledged:Ts()}),tM=ze({profile:ze({isEnabled:Ts()}),sources:At(ze({provider:$b,title:re(),url:re().nullable()}))}),wK=Ed([uK,ze({status:bc("authorization_required"),provider:Fb,authUrl:re().url(),message:re()})]),nM=ze({id:re(),revision:re(),collectionCount:Pn(),referenceCount:Pn(),imageCount:Pn(),reusableCount:Pn(),unsupportedCount:Pn(),scopeDisclosure:re(),usageDisclosure:re()}),bK=ze({isAuthenticated:Ts(),email:re().optional(),name:re().optional(),userId:re().optional()}),$1=re().min(1).max(500),rM=ze({pinned:At($1).max(1e3),order:ze({groups:At($1).max(1e3),rows:Nb(re(),At($1).max(1e3))})}),xK=ze({projectPath:re(),uiState:rM});ze({uiState:rM,projectPath:re().optional()});const SK=e=>vK.parse(e).token,N8="The library returned an invalid response.",Mg="rivet_library_token";let aa="",fd=0,ea=null,q0=null,L8=!1;const Tw=new Set,wh=()=>Tw.forEach(e=>e()),Zue=()=>ea??q0,Bue=()=>fd,bh=()=>{try{const e=window.localStorage.getItem(Mg)??"";aa!==e&&(fd+=1),aa=e,ea=null}catch{ea="Rivet cannot access browser storage. Allow site storage and try again."}},sM=()=>{L8||(window.addEventListener("storage",e=>{e.key!==Mg&&e.key!==null||(bh(),wh())}),L8=!0)},Wue=()=>!!aa,Kue=e=>(sM(),Tw.add(e),()=>Tw.delete(e)),EK=(e,t)=>{if(t!==void 0&&bh(),t!==void 0&&t!==fd)throw new Error("Sign-in was cancelled because the browser login changed.");try{window.localStorage.setItem(Mg,e)}catch{throw ea="Rivet cannot save browser access. Allow site storage and try again.",wh(),new Error(ea)}aa=e,fd+=1,ea=null,q0=null,wh()},iM=()=>{aa="",fd+=1,ea=null;try{window.localStorage.removeItem(Mg)}catch{ea="Rivet cannot clear browser storage. Allow site storage and try again."}wh()},kK=async()=>{if(!window.location.pathname.startsWith("/rivet/library"))return;sM(),bh();const e=fd,t=new URLSearchParams(window.location.hash.slice(1)).get("code");if(t){window.history.replaceState(null,"",window.location.pathname+window.location.search);try{const n=await fetch("/api/library/browser-sessions/exchange",{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({code:t})});if(n.ok){EK(SK(await n.json()),e);return}n.status>=500&&!aa&&(q0="Rivet is temporarily unavailable. Please retry this link.")}catch{!aa&&!ea&&(q0="Rivet could not open this link. Please retry when the server is available.")}}wh()},oM=async(e,t={})=>{bh();const n=aa,r=new Headers(t.headers);r.set("Authorization",`Bearer ${n}`);const s=await fetch(e,{...t,headers:r});return s.status===401&&(bh(),aa===n&&iM()),s},CK=async(e,{schema:t,...n})=>{const r=await oM(`/api/library${e}`,{method:n.method??"GET",signal:n.signal,headers:{"Content-Type":"application/json"},...n.body!==void 0?{body:JSON.stringify(n.body)}:{}});return aM(r,t)},aM=async(e,t)=>{const n=await e.text();let r;try{r=JSON.parse(n)}catch{if(e.ok)throw new Error(N8)}if(!e.ok){if(e.status===401)throw new Error("Sign in to access this library.");const i=eM.safeParse(r),o=i.success&&i.data.error.trim()?i.data.error:`Library request failed (${e.status}).`;throw new Error(o)}const s=t.safeParse(r);if(!s.success)throw new Error(N8);return s.data},Dt=(e,t={})=>{if(!window.location.pathname.startsWith("/rivet/library")){const n=new Headers(t.headers),r=f9();return r&&u9(e,t.method)&&n.set(a9,r),fetch(e,{...t,headers:n,redirect:"error"})}return oM(e,t)};let lM="off";const $8=e=>{lM=e},PK=()=>lM==="full",cM=({userId:e,email:t})=>{PK()&&(e?(Qe.identify(e,t?{email:t}:{}),t&&Qe.alias(t,e)):t&&Qe.identify(t,{email:t}))},AK="phc_Ntj9tXHbS64XgYxlTfhglRmFivFsfm0AERph4ZlnNH",TK=3e3,RK=/^plugin-[0-9a-f]{8}-[0-9a-f]{4}-4[0-9a-f]{3}-[89ab][0-9a-f]{3}-[0-9a-f]{12}$/,IK=e=>({person_profiles:"never",autocapture:!1,opt_out_useragent_filter:!0,capture_pageview:!1,capture_pageleave:!1,capture_exceptions:!1,capture_performance:!1,disable_session_recording:!0,enable_recording_console_log:!1,disable_external_dependency_loading:!0,disable_surveys:!0,advanced_disable_flags:!0,advanced_disable_feature_flags:!0,mask_all_text:!0,mask_all_element_attributes:!0,persistence:"memory",bootstrap:{distinctID:e,isIdentifiedID:!1},before_send:t=>{const n=vW(t.event,t.properties);return n&&Dt("/api/telemetry/events",{method:"POST",credentials:"same-origin",headers:{"Content-Type":"application/json"},body:JSON.stringify({event:t.event,properties:n}),keepalive:!0}).catch(()=>{}),null}}),OK=async()=>{try{const e=await Dt("/api/telemetry",{signal:AbortSignal.timeout(TK),cache:"no-store"});if(!e.ok)return;const t=await e.json();if(t.mode!=="full"&&t.mode!=="metrics"||t.mode==="metrics"&&(typeof t.distinctId!="string"||!RK.test(t.distinctId)))return;const n=t.mode,s={api_host:"https://rivet-proxy.onrender.com/ingest",ui_host:"https://us.posthog.com",person_profiles:"always",capture_exceptions:!0,autocapture:!0,capture_pageview:!0,capture_performance:!0,persistence:"localStorage",...{session_recording:{maskAllInputs:!0,maskTextSelector:"[data-rivet-private]",blockSelector:"iframe[data-rivet-private]"}},mask_all_text:!1,mask_all_element_attributes:!1,loaded:i=>i.register({source:"visual_editor",surface:"visual_editor",telemetry_version:2,rivet_version:"0.28.3",env:"production"})};n==="metrics"&&Object.assign(s,IK(t.distinctId),{api_host:window.location.origin}),Qe.init(AK,s),$8(n)}catch{$8("off")}},uM=g.createContext(void 0),kd=e=>{const t=g.useContext(uM);if(!t)throw new Error("No QueryClient set, use QueryClientProvider to set one");return t},MK=({client:e,children:t})=>(g.useEffect(()=>(e.mount(),()=>{e.unmount()}),[e]),P.jsx(uM.Provider,{value:e,children:t})),NK={setTimeout:(e,t)=>setTimeout(e,t),clearTimeout:e=>clearTimeout(e),setInterval:(e,t)=>setInterval(e,t),clearInterval:e=>clearInterval(e)};var Ha,Y2,nT,LK=(nT=class{constructor(){rt(this,Ha,NK);rt(this,Y2,!1)}setTimeoutProvider(e){Le(this,Ha,e)}setTimeout(e,t){return Z(this,Ha).setTimeout(e,t)}clearTimeout(e){Z(this,Ha).clearTimeout(e)}setInterval(e,t){return Z(this,Ha).setInterval(e,t)}clearInterval(e){Z(this,Ha).clearInterval(e)}},Ha=new WeakMap,Y2=new WeakMap,nT);const Xl=new LK;function $K(e){setTimeout(e,0)}const DK=typeof window>"u"||"Deno"in globalThis;function fs(){}function FK(e,t){return typeof e=="function"?e(t):e}function dM(e){return typeof e=="number"&&e>=0&&e!==1/0}function fM(e,t){return Math.max(e+(t||0)-Date.now(),0)}function On(e,t){return typeof e=="function"?e(t):e}function D8(e,t){const{type:n="all",exact:r,fetchStatus:s,predicate:i,queryKey:o,stale:c}=e;if(o){if(r){if(t.queryHash!==Hb(o,t.options))return!1}else if(!hd(t.queryKey,o))return!1}if(n!=="all"){const u=t.isActive();if(n==="active"&&!u||n==="inactive"&&u)return!1}return!(typeof c=="boolean"&&t.isStale()!==c||s&&s!==t.state.fetchStatus||i&&!i(t))}function F8(e,t){const{exact:n,status:r,predicate:s,mutationKey:i}=e;if(i){if(!t.options.mutationKey)return!1;if(n){if(Sc(t.options.mutationKey)!==Sc(i))return!1}else if(!hd(t.options.mutationKey,i))return!1}return!(r&&t.state.status!==r||s&&!s(t))}function Hb(e,t){return((t==null?void 0:t.queryKeyHashFn)||Sc)(e)}function Sc(e){return JSON.stringify(e,(t,n)=>Rw(n)?Object.keys(n).sort().reduce((r,s)=>(r[s]=n[s],r),{}):n)}function hd(e,t){if(e===t)return!0;if(typeof e!=typeof t)return!1;if(e&&t&&typeof e=="object"&&typeof t=="object"){if(Array.isArray(e)&&Array.isArray(t)){if(t.length>e.length)return!1;for(let r=0;r<t.length;r++)if(!hd(e[r],t[r]))return!1;return!0}const n=Object.keys(t);for(const r of n)if(!hd(e[r],t[r]))return!1;return!0}return!1}const hM=Object.prototype.hasOwnProperty;function pM(e,t,n=0){if(e===t)return e;if(n>500)return t;const r=j8(e)&&j8(t);if(!r&&!(Rw(e)&&Rw(t)))return t;const s=(r?e:Object.keys(e)).length,i=r?t:Object.keys(t),o=i.length,c=r?new Array(o):{};let u=0;for(let d=0;d<o;d++){const f=r?d:i[d],p=e[f],m=t[f];if(p===m){c[f]=p,(r?d<s:hM.call(e,f))&&u++;continue}if(p===null||m===null||typeof p!="object"||typeof m!="object"){c[f]=m;continue}const v=pM(p,m,n+1);c[f]=v,v===p&&u++}return s===o&&u===s?e:c}function Xm(e,t){if(!t||Object.keys(e).length!==Object.keys(t).length)return!1;for(const n of Object.keys(e))if(!hM.call(t,n)||e[n]!==t[n])return!1;return!0}function j8(e){return Array.isArray(e)&&e.length===Object.keys(e).length}function Rw(e){if(!z8(e))return!1;const t=Object.getPrototypeOf(e),n=t==null?void 0:t.constructor;if(n===void 0)return!0;if(typeof n!="function")return!1;const r=n.prototype;return!(!z8(r)||!r.hasOwnProperty("isPrototypeOf")||t!==Object.prototype)}function z8(e){return Object.prototype.toString.call(e)==="[object Object]"}function jK(e){return new Promise(t=>{Xl.setTimeout(t,e)})}function Iw(e,t,n){return typeof n.structuralSharing=="function"?n.structuralSharing(e,t):n.structuralSharing!==!1?pM(e,t):t}function zK(e){return e}function VK(e,t,n=0){const r=[...e,t];return n&&r.length>n?r.slice(-n):r}function HK(e,t,n=0){const r=[t,...e];return n&&r.length>n?r.slice(0,n):r}const Ub=Symbol();function mM(e,t){return!e.queryFn&&(t!=null&&t.initialPromise)?()=>t.initialPromise:!e.queryFn||e.queryFn===Ub?()=>Promise.reject(new Error(`Missing queryFn: '${e.queryHash}'`)):e.queryFn}function Zb(e,t){return typeof e=="function"?e(...t):!!e}const Bb=Symbol();function UK(e,t,n,r){let s=!1,i;return Object.defineProperties(e,{[Bb]:{value:r},signal:{enumerable:!0,get:()=>(i??(i=t()),s||(s=!0,i.aborted?n():i.addEventListener("abort",n,{once:!0})),i)}}),e}let ZK=()=>DK;const Wb=()=>ZK();var Cd=class{constructor(){this.listeners=new Set,this.subscribe=this.subscribe.bind(this)}subscribe(e){return this.listeners.add(e),this.onSubscribe(),()=>{this.listeners.delete(e),this.onUnsubscribe()}}hasListeners(){return this.listeners.size>0}onSubscribe(){}onUnsubscribe(){}},tc,Ua,ju,rT,BK=(rT=class extends Cd{constructor(){super();rt(this,tc);rt(this,Ua);rt(this,ju);Le(this,ju,t=>{if(typeof window<"u"&&window.addEventListener){const n=()=>t();return window.addEventListener("visibilitychange",n,!1),()=>{window.removeEventListener("visibilitychange",n)}}})}onSubscribe(){Z(this,Ua)||this.setEventListener(Z(this,ju))}onUnsubscribe(){var t;this.hasListeners()||((t=Z(this,Ua))==null||t.call(this),Le(this,Ua,void 0))}setEventListener(t){var n;Le(this,ju,t),(n=Z(this,Ua))==null||n.call(this),Le(this,Ua,t(r=>{typeof r=="boolean"?this.setFocused(r):this.onFocus()}))}setFocused(t){Z(this,tc)!==t&&(Le(this,tc,t),this.onFocus())}onFocus(){const t=this.isFocused();this.listeners.forEach(n=>{n(t)})}isFocused(){var t;return typeof Z(this,tc)=="boolean"?Z(this,tc):((t=globalThis.document)==null?void 0:t.visibilityState)!=="hidden"}},tc=new WeakMap,Ua=new WeakMap,ju=new WeakMap,rT);const Kb=new BK,WK=$K;function KK(){let e=[],t=0,n=c=>{c()},r=c=>{c()},s=WK;const i=c=>{t?e.push(c):s(()=>{n(c)})},o=()=>{const c=e;e=[],c.length&&s(()=>{r(()=>{c.forEach(u=>{n(u)})})})};return{batch:c=>{let u;t++;try{u=c()}finally{t--,t||o()}return u},batchCalls:c=>(...u)=>{i(()=>{c(...u)})},schedule:i,setNotifyFunction:c=>{n=c},setBatchNotifyFunction:c=>{r=c},setScheduler:c=>{s=c}}}const mr=KK();var zu,Za,Vu,sT,GK=(sT=class extends Cd{constructor(){super();rt(this,zu,!0);rt(this,Za);rt(this,Vu);Le(this,Vu,t=>{if(typeof window<"u"&&window.addEventListener){const n=()=>t(!0),r=()=>t(!1);return window.addEventListener("online",n,!1),window.addEventListener("offline",r,!1),()=>{window.removeEventListener("online",n),window.removeEventListener("offline",r)}}})}onSubscribe(){Z(this,Za)||this.setEventListener(Z(this,Vu))}onUnsubscribe(){var t;this.hasListeners()||((t=Z(this,Za))==null||t.call(this),Le(this,Za,void 0))}setEventListener(t){var n;Le(this,Vu,t),(n=Z(this,Za))==null||n.call(this),Le(this,Za,t(this.setOnline.bind(this)))}setOnline(t){Z(this,zu)!==t&&(Le(this,zu,t),this.listeners.forEach(n=>{n(t)}))}isOnline(){return Z(this,zu)}},zu=new WeakMap,Za=new WeakMap,Vu=new WeakMap,sT);const Y0=new GK;function qK(e){return Math.min(1e3*2**e,3e4)}function gM(e){return(e??"online")==="online"?Y0.isOnline():!0}var Ow=class extends Error{constructor(e){super("CancelledError"),this.revert=e==null?void 0:e.revert,this.silent=e==null?void 0:e.silent}};function vM(e){let t=!1,n=0,r,s="pending",i,o;const c=new Promise((E,C)=>{i=E,o=C});c.catch(fs);const u=()=>s!=="pending",d=E=>{var C;if(!u()){const A=new Ow(E);w(A),(C=e.onCancel)==null||C.call(e,A)}},f=()=>{t=!0},p=()=>{t=!1},m=()=>Kb.isFocused()&&(e.networkMode==="always"||Y0.isOnline())&&e.canRun(),v=()=>gM(e.networkMode)&&e.canRun(),_=E=>{u()||(r==null||r(),s="resolved",i(E))},w=E=>{u()||(r==null||r(),s="rejected",o(E))},b=E=>new Promise(C=>{var A;r=T=>{(u()||E())&&C(T)},(A=e.onPause)==null||A.call(e)}).then(()=>{var C;r=void 0,u()||(C=e.onContinue)==null||C.call(e)}),S=()=>{if(u())return;let E;const C=n===0?e.initialPromise:void 0;try{E=C??e.fn()}catch(A){E=Promise.reject(A)}Promise.resolve(E).then(_).catch(A=>{var D;if(u())return;const T=e.retry??(Wb()?0:3),M=e.retryDelay??qK,O=typeof M=="function"?M(n,A):M,R=T===!0||typeof T=="number"&&n<T||typeof T=="function"&&T(n,A);if(t||!R){w(A);return}n++,(D=e.onFail)==null||D.call(e,n,A),jK(O).then(()=>u()||m()?void 0:b(m)).then(()=>{t?w(A):S()})})};return{promise:c,status:()=>s,cancel:d,continue:()=>(r==null||r(),c),cancelRetry:f,continueRetry:p,canStart:v,start:()=>(v()?S():b(v).then(S),c)}}var nc,iT,yM=(iT=class{constructor(){rt(this,nc)}destroy(){this.clearGcTimeout()}scheduleGc(){this.clearGcTimeout(),dM(this.gcTime)&&Le(this,nc,Xl.setTimeout(()=>{this.optionalRemove()},this.gcTime))}updateGcTime(e){this.gcTime=Math.max(this.gcTime||0,e??(Wb()?1/0:3e5))}clearGcTimeout(){Z(this,nc)!==void 0&&(Xl.clearTimeout(Z(this,nc)),Le(this,nc,void 0))}},nc=new WeakMap,iT);function YK(e){return{onFetch:(t,n)=>{var f,p,m,v,_;const r=t.options,s=(m=(p=(f=t.fetchOptions)==null?void 0:f.meta)==null?void 0:p.fetchMore)==null?void 0:m.direction,i=((v=t.state.data)==null?void 0:v.pages)||[],o=((_=t.state.data)==null?void 0:_.pageParams)||[];let c={pages:[],pageParams:[]},u=0;const d=async()=>{let w=!1;const b=t,S=A=>{UK(A,()=>t.signal,()=>w=!0,b[Bb])},E=mM(t.options,t.fetchOptions),C=async(A,T,M)=>{if(w)return Promise.reject(t.signal.reason);if(T==null&&A.pages.length)return Promise.resolve(A);const R=(()=>{const H={client:t.client,queryKey:t.queryKey,pageParam:T,direction:M?"backward":"forward",meta:t.options.meta};return S(H),H})(),D=await E(R),{maxPages:U}=t.options,W=M?HK:VK;return{pages:W(A.pages,D,U),pageParams:W(A.pageParams,T,U)}};if(s&&i.length){const A=s==="backward",T=A?QK:V8,M={pages:i,pageParams:o};c=await C(M,T(r,M),A)}else{const A=e??i.length;do{const T=u===0?o[0]===void 0?r.initialPageParam:o[0]:V8(r,c);if(u>0&&T==null)break;c=await C(c,T),u++}while(u<A)}return c};t.options.persister?t.fetchFn=()=>{var w,b;return(b=(w=t.options).persister)==null?void 0:b.call(w,d,{client:t.client,queryKey:t.queryKey,meta:t.options.meta,signal:t.signal},n)}:t.fetchFn=d}}}function V8(e,{pages:t,pageParams:n}){const r=t.length-1;return t.length>0?e.getNextPageParam(t[r],t,n[r],n):void 0}function QK(e,{pages:t,pageParams:n}){var r;return t.length>0?(r=e.getPreviousPageParam)==null?void 0:r.call(e,t[0],t,n[0],n):void 0}var Hu,rc,Uu,di,sc,Ar,Wo,Dh,ic,Ni,Uo,oT,XK=(oT=class extends yM{constructor(t){super();rt(this,Ni);rt(this,Hu);rt(this,rc);rt(this,Uu);rt(this,di);rt(this,sc);rt(this,Ar);rt(this,Wo);rt(this,Dh);rt(this,ic);Le(this,ic,!1),Le(this,Dh,t.defaultOptions),this.setOptions(t.options),this.observers=[],Le(this,sc,t.client),Le(this,di,Z(this,sc).getQueryCache()),this.queryKey=t.queryKey,this.queryHash=t.queryHash,Le(this,rc,U8(this.options)),this.state=t.state??Z(this,rc),this.scheduleGc()}get meta(){return this.options.meta}get queryType(){return Z(this,Hu)}get promise(){var t;return(t=Z(this,Ar))==null?void 0:t.promise}setOptions(t){if(this.options={...Z(this,Dh),...t},t!=null&&t._type&&Le(this,Hu,t._type),this.updateGcTime(this.options.gcTime),this.state&&this.state.data===void 0){const n=U8(this.options);n.data!==void 0&&(this.setState(H8(n.data,n.dataUpdatedAt)),Le(this,rc,n))}}optionalRemove(){!this.observers.length&&this.state.fetchStatus==="idle"&&Z(this,di).remove(this)}setData(t,n){const r=Iw(this.state.data,t,this.options);return bt(this,Ni,Uo).call(this,{data:r,type:"success",dataUpdatedAt:n==null?void 0:n.updatedAt,manual:n==null?void 0:n.manual}),r}setState(t){bt(this,Ni,Uo).call(this,{type:"setState",state:t})}cancel(t){var r,s;const n=(r=Z(this,Ar))==null?void 0:r.promise;return(s=Z(this,Ar))==null||s.cancel(t),n?n.then(fs).catch(fs):Promise.resolve()}destroy(){super.destroy(),this.cancel({silent:!0})}get resetState(){return Z(this,rc)}reset(){this.destroy(),this.setState(this.resetState)}isActive(){return this.observers.some(t=>On(t.options.enabled,this)!==!1)}isDisabled(){return this.getObserversCount()>0?!this.isActive():this.options.queryFn===Ub||!this.isFetched()}isFetched(){return this.state.dataUpdateCount+this.state.errorUpdateCount>0}isStatic(){return this.state.data===void 0?!1:this.getObserversCount()>0?this.observers.some(t=>On(t.options.staleTime,this)==="static"):!1}isStale(){return this.getObserversCount()>0?this.observers.some(t=>t.getCurrentResult().isStale):this.state.data===void 0||this.state.isInvalidated}isStaleByTime(t=0){return this.state.data===void 0?!0:t==="static"?!1:this.state.isInvalidated?!0:!fM(this.state.dataUpdatedAt,t)}onFocus(){var t,n;(t=this.observers.find(r=>r.shouldFetchOnWindowFocus()))==null||t.refetch({cancelRefetch:!1}),(n=Z(this,Ar))==null||n.continue()}onOnline(){var t,n;(t=this.observers.find(r=>r.shouldFetchOnReconnect()))==null||t.refetch({cancelRefetch:!1}),(n=Z(this,Ar))==null||n.continue()}addObserver(t){this.observers.includes(t)||(this.observers.push(t),this.clearGcTimeout(),Z(this,di).notify({type:"observerAdded",query:this,observer:t}))}removeObserver(t){const n=this.observers.indexOf(t);n!==-1&&(this.observers.splice(n,1),this.observers.length||(Z(this,Ar)&&(Z(this,ic)||this.state.fetchStatus==="paused"&&this.state.status==="pending"?Z(this,Ar).cancel({revert:!0}):Z(this,Ar).cancelRetry()),this.scheduleGc()),Z(this,di).notify({type:"observerRemoved",query:this,observer:t}))}getObserversCount(){return this.observers.length}invalidate(){this.state.isInvalidated||bt(this,Ni,Uo).call(this,{type:"invalidate"})}async fetch(t,n){var f,p,m,v;if(this.state.fetchStatus!=="idle"&&((f=Z(this,Ar))==null?void 0:f.status())!=="rejected"){if(this.state.data!==void 0&&(n!=null&&n.cancelRefetch))this.cancel({silent:!0});else if(Z(this,Ar)&&Z(this,Wo))return Z(this,Ar).continueRetry(),Z(this,Wo)}if(t&&this.setOptions(t),!this.options.queryFn){const _=this.observers.find(w=>w.options.queryFn);_&&this.setOptions(_.options)}const r=new AbortController,s=_=>{Object.defineProperties(_,{[Bb]:{value:r.signal,enumerable:!0},signal:{enumerable:!0,get:()=>(Le(this,ic,!0),r.signal)}})},i=()=>{const _=mM(this.options,n),b=(()=>{const S={client:Z(this,sc),queryKey:this.queryKey,meta:this.meta};return s(S),S})();return Le(this,ic,!1),this.options.persister?this.options.persister(_,b,this):_(b)},c=(()=>{const _={fetchOptions:n,options:this.options,queryKey:this.queryKey,client:Z(this,sc),state:this.state,fetchFn:i};return s(_),_})();(p=Z(this,Hu)==="infinite"?YK(this.options.pages):this.options.behavior)==null||p.onFetch(c,this),Le(this,Uu,this.state),(this.state.fetchStatus==="idle"||this.state.fetchMeta!==((m=c.fetchOptions)==null?void 0:m.meta))&&bt(this,Ni,Uo).call(this,{type:"fetch",meta:(v=c.fetchOptions)==null?void 0:v.meta});const u=Le(this,Ar,vM({initialPromise:n==null?void 0:n.initialPromise,fn:c.fetchFn,onCancel:_=>{_ instanceof Ow&&_.revert&&this.setState({...Z(this,Uu),fetchStatus:"idle"}),r.abort()},onFail:(_,w)=>{bt(this,Ni,Uo).call(this,{type:"failed",failureCount:_,error:w})},onPause:()=>{bt(this,Ni,Uo).call(this,{type:"pause"})},onContinue:()=>{bt(this,Ni,Uo).call(this,{type:"continue"})},retry:c.options.retry,retryDelay:c.options.retryDelay,networkMode:c.options.networkMode,canRun:()=>!0})),d=(async()=>{var _,w,b,S,E,C,A,T;try{const M=await u.promise;if(M===void 0)throw new Error(`${this.queryHash} data is undefined`);return this.setData(M),(w=(_=Z(this,di).config).onSuccess)==null||w.call(_,M,this),(S=(b=Z(this,di).config).onSettled)==null||S.call(b,M,this.state.error,this),M}catch(M){if(M instanceof Ow){if(M.silent){if(Z(this,Ar)!==u&&Z(this,Wo))return Z(this,Wo);throw M}else if(M.revert){if(this.state.data===void 0)throw M;return this.state.data}}throw bt(this,Ni,Uo).call(this,{type:"error",error:M}),(C=(E=Z(this,di).config).onError)==null||C.call(E,M,this),(T=(A=Z(this,di).config).onSettled)==null||T.call(A,this.state.data,M,this),M}finally{Z(this,Ar)===u&&(Le(this,Ar,void 0),Le(this,Wo,void 0)),this.scheduleGc()}})();return Le(this,Wo,d),u.start(),d}},Hu=new WeakMap,rc=new WeakMap,Uu=new WeakMap,di=new WeakMap,sc=new WeakMap,Ar=new WeakMap,Wo=new WeakMap,Dh=new WeakMap,ic=new WeakMap,Ni=new WeakSet,Uo=function(t){const n=r=>{switch(t.type){case"failed":return{...r,fetchFailureCount:t.failureCount,fetchFailureReason:t.error};case"pause":return{...r,fetchStatus:"paused"};case"continue":return{...r,fetchStatus:"fetching"};case"fetch":return{...r,..._M(r.data,this.options),fetchMeta:t.meta??null};case"success":const s={...r,...H8(t.data,t.dataUpdatedAt),dataUpdateCount:r.dataUpdateCount+1,...!t.manual&&{fetchStatus:"idle",fetchFailureCount:0,fetchFailureReason:null}};return Le(this,Uu,t.manual?s:void 0),s;case"error":const i=t.error;return{...r,error:i,errorUpdateCount:r.errorUpdateCount+1,errorUpdatedAt:Date.now(),fetchFailureCount:r.fetchFailureCount+1,fetchFailureReason:i,fetchStatus:"idle",status:"error",isInvalidated:!0};case"invalidate":return{...r,isInvalidated:!0};case"setState":return{...r,...t.state}}};this.state=n(this.state),mr.batch(()=>{this.observers.slice().forEach(r=>{r.onQueryUpdate()}),Z(this,di).notify({query:this,type:"updated",action:t})})},oT);function _M(e,t){return{fetchFailureCount:0,fetchFailureReason:null,fetchStatus:gM(t.networkMode)?"fetching":"paused",...e===void 0&&{error:null,status:"pending"}}}function H8(e,t){return{data:e,dataUpdatedAt:t??Date.now(),error:null,isInvalidated:!1,status:"success"}}function U8(e){const t=typeof e.initialData=="function"?e.initialData():e.initialData,n=t!==void 0,r=n?typeof e.initialDataUpdatedAt=="function"?e.initialDataUpdatedAt():e.initialDataUpdatedAt:0;return{data:t,dataUpdateCount:0,dataUpdatedAt:n?r??Date.now():0,error:null,errorUpdateCount:0,errorUpdatedAt:0,fetchFailureCount:0,fetchFailureReason:null,fetchMeta:null,isInvalidated:!1,status:n?"success":"pending",fetchStatus:"idle"}}var cs,jt,Fh,us,oc,Zu,Ko,jh,Bu,Wu,ac,lc,Ba,Ku,tn,Ff,Mw,Nw,Lw,$w,Dw,Fw,jw,zw,aT,JK=(aT=class extends Cd{constructor(t,n){super();rt(this,tn);rt(this,cs);rt(this,jt);rt(this,Fh);rt(this,us);rt(this,oc);rt(this,Zu);rt(this,Ko);rt(this,jh);rt(this,Bu);rt(this,Wu);rt(this,ac);rt(this,lc);rt(this,Ba);rt(this,Ku,new Set);this.options=n,Le(this,cs,t),Le(this,Ko,null),this.bindMethods(),this.setOptions(n)}bindMethods(){this.refetch=this.refetch.bind(this)}onSubscribe(){this.listeners.size===1&&(Z(this,jt).addObserver(this),Z8(Z(this,jt),this.options)?bt(this,tn,Ff).call(this):this.updateResult(),bt(this,tn,Dw).call(this))}onUnsubscribe(){this.hasListeners()||this.destroy()}shouldFetchOnReconnect(){return Vw(Z(this,jt),this.options,this.options.refetchOnReconnect)}shouldFetchOnWindowFocus(){return Vw(Z(this,jt),this.options,this.options.refetchOnWindowFocus)}destroy(){this.listeners=new Set,bt(this,tn,Fw).call(this),bt(this,tn,jw).call(this),Z(this,jt).removeObserver(this)}setOptions(t){const n=this.options,r=Z(this,jt);if(this.options=Z(this,cs).defaultQueryOptions(t),this.options.enabled!==void 0&&typeof this.options.enabled!="boolean"&&typeof this.options.enabled!="function"&&typeof On(this.options.enabled,Z(this,jt))!="boolean")throw new Error("Expected enabled to be a boolean or a callback that returns a boolean");bt(this,tn,zw).call(this),Z(this,jt).setOptions(this.options),n._defaulted&&!Xm(this.options,n)&&Z(this,cs).getQueryCache().notify({type:"observerOptionsUpdated",query:Z(this,jt),observer:this});const s=this.hasListeners();s&&B8(Z(this,jt),r,this.options,n)&&bt(this,tn,Ff).call(this),this.updateResult(),s&&(Z(this,jt)!==r||On(this.options.enabled,Z(this,jt))!==On(n.enabled,Z(this,jt))||On(this.options.staleTime,Z(this,jt))!==On(n.staleTime,Z(this,jt)))&&bt(this,tn,Nw).call(this);const i=bt(this,tn,Lw).call(this);s&&(Z(this,jt)!==r||On(this.options.enabled,Z(this,jt))!==On(n.enabled,Z(this,jt))||i!==Z(this,Ba))&&bt(this,tn,$w).call(this,i)}getOptimisticResult(t){const n=Z(this,cs).getQueryCache().build(Z(this,cs),t),r=this.createResult(n,t);return Xm(this.getCurrentResult(),r)||(Le(this,us,r),Le(this,Zu,this.options),Le(this,oc,Z(this,jt).state)),r}getCurrentResult(){return Z(this,us)}trackResult(t,n){return new Proxy(t,{get:(r,s)=>(this.trackProp(s),n==null||n(s),Reflect.get(r,s))})}trackProp(t){Z(this,Ku).add(t)}getCurrentQuery(){return Z(this,jt)}refetch({...t}={}){return this.fetch({...t})}fetchOptimistic(t){const n=Z(this,cs).defaultQueryOptions(t),r=Z(this,cs).getQueryCache().build(Z(this,cs),n);let s=()=>{},i;const o=new Promise(c=>{i=c,s=Z(this,cs).getQueryCache().subscribe(u=>{u.type==="updated"&&u.query.queryHash===r.queryHash&&r.state.data!==void 0&&(s(),c(this.createResult(r,n)))})});return Promise.race([r.fetch(n).then(()=>{const c=this.createResult(r,n);return i==null||i(c),c}).finally(()=>{s()}),o])}fetch(t){return bt(this,tn,Ff).call(this,{...t,cancelRefetch:t.cancelRefetch??!0}).then(()=>(this.updateResult(),Z(this,us)))}createResult(t,n){var M;const r=Z(this,jt),s=this.options,i=Z(this,us),o=Z(this,oc),c=Z(this,Zu),u=t!==r?t.state:Z(this,Fh),{state:d}=t;let f={...d},p=!1,m;if(n._optimisticResults){const O=this.hasListeners(),R=!O&&Z8(t,n),D=O&&B8(t,r,n,s);(R||D)&&(f={...f,..._M(d.data,t.options)}),n._optimisticResults==="isRestoring"&&(f.fetchStatus="idle")}let{error:v,errorUpdatedAt:_,status:w}=f;m=f.data;let b=!1;if(n.placeholderData!==void 0&&m===void 0&&w==="pending"){let O;i!=null&&i.isPlaceholderData&&n.placeholderData===(c==null?void 0:c.placeholderData)?(O=i.data,b=!0):O=typeof n.placeholderData=="function"?n.placeholderData((M=Z(this,Wu))==null?void 0:M.state.data,Z(this,Wu)):n.placeholderData,O!==void 0&&(w="success",m=Iw(i==null?void 0:i.data,O,n),p=!0)}if(n.select&&m!==void 0&&!b)if(i&&m===(o==null?void 0:o.data)&&n.select===Z(this,jh))m=Z(this,Bu);else try{Le(this,jh,n.select),m=n.select(m),m=Iw(i==null?void 0:i.data,m,n),Le(this,Bu,m),Le(this,Ko,null)}catch(O){Le(this,Ko,O)}else m===void 0&&Le(this,Ko,null);Z(this,Ko)&&(v=Z(this,Ko),m=Z(this,Bu),_=(i==null?void 0:i.error)===v?i.errorUpdatedAt:Date.now(),w="error",p=!1);const S=f.fetchStatus==="fetching",E=w==="pending",C=w==="error",A=E&&S,T=m!==void 0;return{status:w,fetchStatus:f.fetchStatus,isPending:E,isSuccess:w==="success",isError:C,isInitialLoading:A,isLoading:A,data:m,dataUpdatedAt:f.dataUpdatedAt,error:v,errorUpdatedAt:_,failureCount:f.fetchFailureCount,failureReason:f.fetchFailureReason,errorUpdateCount:f.errorUpdateCount,isFetched:t.isFetched(),isFetchedAfterMount:f.dataUpdateCount>u.dataUpdateCount||f.errorUpdateCount>u.errorUpdateCount,isFetching:S,isRefetching:S&&!E,isLoadingError:C&&!T,isPaused:f.fetchStatus==="paused",isPlaceholderData:p,isRefetchError:C&&T,isStale:Gb(t,n),refetch:this.refetch,isEnabled:On(n.enabled,t)!==!1}}updateResult(){const t=Z(this,us),n=this.createResult(Z(this,jt),this.options);if(Le(this,oc,Z(this,jt).state),Le(this,Zu,this.options),Z(this,oc).data!==void 0&&Le(this,Wu,Z(this,jt)),Xm(n,t))return;Le(this,us,n);const s=(()=>{if(!t)return!0;const{notifyOnChangeProps:i}=this.options,o=typeof i=="function"?i():i;if(o==="all"||!o&&!Z(this,Ku).size||this.options.throwOnError&&Z(this,us).error!==t.error)return!0;for(const c of o??Z(this,Ku))if(Z(this,us)[c]!==t[c])return!0;return!1})();mr.batch(()=>{s&&this.listeners.forEach(i=>{i(Z(this,us))}),Z(this,cs).getQueryCache().notify({query:Z(this,jt),type:"observerResultsUpdated"})})}onQueryUpdate(){this.updateResult(),this.hasListeners()&&bt(this,tn,Dw).call(this)}},cs=new WeakMap,jt=new WeakMap,Fh=new WeakMap,us=new WeakMap,oc=new WeakMap,Zu=new WeakMap,Ko=new WeakMap,jh=new WeakMap,Bu=new WeakMap,Wu=new WeakMap,ac=new WeakMap,lc=new WeakMap,Ba=new WeakMap,Ku=new WeakMap,tn=new WeakSet,Ff=function(t){bt(this,tn,zw).call(this);let n=Z(this,jt).fetch(this.options,t);return t!=null&&t.throwOnError||(n=n.catch(fs)),n},Mw=function(t){return!Wb()&&On(this.options.enabled,Z(this,jt))!==!1&&dM(t)},Nw=function(){bt(this,tn,Fw).call(this);const t=On(this.options.staleTime,Z(this,jt));if(Z(this,us).isStale||!bt(this,tn,Mw).call(this,t))return;const n=fM(Z(this,us).dataUpdatedAt,t)+1;Le(this,ac,Xl.setTimeout(()=>{Z(this,us).isStale||this.updateResult()},n))},Lw=function(){return On(this.options.refetchInterval,Z(this,jt))??!1},$w=function(t){bt(this,tn,jw).call(this),Le(this,Ba,t),!(Z(this,Ba)===0||!bt(this,tn,Mw).call(this,Z(this,Ba)))&&Le(this,lc,Xl.setInterval(()=>{(this.options.refetchIntervalInBackground||Kb.isFocused())&&bt(this,tn,Ff).call(this)},Z(this,Ba)))},Dw=function(){bt(this,tn,Nw).call(this),bt(this,tn,$w).call(this,bt(this,tn,Lw).call(this))},Fw=function(){Z(this,ac)!==void 0&&(Xl.clearTimeout(Z(this,ac)),Le(this,ac,void 0))},jw=function(){Z(this,lc)!==void 0&&(Xl.clearInterval(Z(this,lc)),Le(this,lc,void 0))},zw=function(){const t=Z(this,cs).getQueryCache().build(Z(this,cs),this.options);if(t===Z(this,jt))return;const n=Z(this,jt);Le(this,jt,t),Le(this,Fh,t.state),this.hasListeners()&&(n==null||n.removeObserver(this),t.addObserver(this))},aT);function eG(e,t){return On(t.enabled,e)!==!1&&e.state.data===void 0&&!(e.state.status==="error"&&On(t.retryOnMount,e)===!1)}function Z8(e,t){return eG(e,t)||e.state.data!==void 0&&Vw(e,t,t.refetchOnMount)}function Vw(e,t,n){if(On(t.enabled,e)!==!1&&On(t.staleTime,e)!=="static"){const r=On(n,e);return r==="always"||r!==!1&&Gb(e,t)}return!1}function B8(e,t,n,r){return(e!==t||On(r.enabled,e)===!1)&&(!n.suspense||e.state.status!=="error")&&Gb(e,n)}function Gb(e,t){return On(t.enabled,e)!==!1&&e.isStaleByTime(On(t.staleTime,e))}var zh,oo,Qr,cc,ao,Da,lT,tG=(lT=class extends yM{constructor(t){super();rt(this,ao);rt(this,zh);rt(this,oo);rt(this,Qr);rt(this,cc);Le(this,zh,t.client),this.mutationId=t.mutationId,Le(this,Qr,t.mutationCache),Le(this,oo,[]),this.state=t.state||wM(),this.setOptions(t.options),this.scheduleGc()}setOptions(t){this.options=t,this.updateGcTime(this.options.gcTime)}get meta(){return this.options.meta}addObserver(t){Z(this,oo).includes(t)||(Z(this,oo).push(t),this.clearGcTimeout(),Z(this,Qr).notify({type:"observerAdded",mutation:this,observer:t}))}removeObserver(t){Le(this,oo,Z(this,oo).filter(n=>n!==t)),this.scheduleGc(),Z(this,Qr).notify({type:"observerRemoved",mutation:this,observer:t})}optionalRemove(){Z(this,oo).length||(this.state.status==="pending"?this.scheduleGc():Z(this,Qr).remove(this))}continue(){var t;return((t=Z(this,cc))==null?void 0:t.continue())??(this.state.status==="pending"?this.execute(this.state.variables):Promise.resolve())}async execute(t){var c,u,d,f,p,m,v,_,w,b,S,E,C,A,T,M,O,R;const n=()=>{bt(this,ao,Da).call(this,{type:"continue"})},r={client:Z(this,zh),meta:this.options.meta,mutationKey:this.options.mutationKey},s=Le(this,cc,vM({fn:()=>this.options.mutationFn?this.options.mutationFn(t,r):Promise.reject(new Error("No mutationFn found")),onFail:(D,U)=>{bt(this,ao,Da).call(this,{type:"failed",failureCount:D,error:U})},onPause:()=>{bt(this,ao,Da).call(this,{type:"pause"})},onContinue:n,retry:this.options.retry??0,retryDelay:this.options.retryDelay,networkMode:this.options.networkMode,canRun:()=>Z(this,Qr).canRun(this)})),i=this.state.status==="pending",o=!s.canStart();try{if(i)n();else{bt(this,ao,Da).call(this,{type:"pending",variables:t,isPaused:o}),Z(this,Qr).config.onMutate&&await Z(this,Qr).config.onMutate(t,this,r);const U=await((u=(c=this.options).onMutate)==null?void 0:u.call(c,t,r));U!==this.state.context&&bt(this,ao,Da).call(this,{type:"pending",context:U,variables:t,isPaused:o})}this.state.isPaused&&s.canStart()&&n();const D=await s.start();return await((f=(d=Z(this,Qr).config).onSuccess)==null?void 0:f.call(d,D,t,this.state.context,this,r)),await((m=(p=this.options).onSuccess)==null?void 0:m.call(p,D,t,this.state.context,r)),await((_=(v=Z(this,Qr).config).onSettled)==null?void 0:_.call(v,D,null,this.state.variables,this.state.context,this,r)),await((b=(w=this.options).onSettled)==null?void 0:b.call(w,D,null,t,this.state.context,r)),bt(this,ao,Da).call(this,{type:"success",data:D}),D}catch(D){try{await((E=(S=Z(this,Qr).config).onError)==null?void 0:E.call(S,D,t,this.state.context,this,r))}catch(U){Promise.reject(U)}try{await((A=(C=this.options).onError)==null?void 0:A.call(C,D,t,this.state.context,r))}catch(U){Promise.reject(U)}try{await((M=(T=Z(this,Qr).config).onSettled)==null?void 0:M.call(T,void 0,D,this.state.variables,this.state.context,this,r))}catch(U){Promise.reject(U)}try{await((R=(O=this.options).onSettled)==null?void 0:R.call(O,void 0,D,t,this.state.context,r))}catch(U){Promise.reject(U)}throw bt(this,ao,Da).call(this,{type:"error",error:D}),D}finally{Z(this,cc)===s&&Le(this,cc,void 0),Z(this,Qr).runNext(this)}}},zh=new WeakMap,oo=new WeakMap,Qr=new WeakMap,cc=new WeakMap,ao=new WeakSet,Da=function(t){const n=r=>{switch(t.type){case"failed":return{...r,failureCount:t.failureCount,failureReason:t.error};case"pause":return{...r,isPaused:!0};case"continue":return{...r,isPaused:!1};case"pending":return{...r,context:t.context,data:void 0,failureCount:0,failureReason:null,error:null,isPaused:t.isPaused,status:"pending",variables:t.variables,submittedAt:Date.now()};case"success":return{...r,data:t.data,failureCount:0,failureReason:null,error:null,status:"success",isPaused:!1};case"error":return{...r,data:void 0,error:t.error,failureCount:r.failureCount+1,failureReason:t.error,isPaused:!1,status:"error"}}};this.state=n(this.state),mr.batch(()=>{Z(this,oo).forEach(r=>{r.onMutationUpdate(t)}),Z(this,Qr).notify({mutation:this,type:"updated",action:t})})},lT);function wM(){return{context:void 0,data:void 0,error:null,failureCount:0,failureReason:null,isPaused:!1,status:"idle",variables:void 0,submittedAt:0}}var Wa,Li,Vh,cT,nG=(cT=class extends Cd{constructor(t={}){super();rt(this,Wa);rt(this,Li);rt(this,Vh);this.config=t,Le(this,Wa,new Set),Le(this,Li,new Map),Le(this,Vh,0)}build(t,n,r){const s=new tG({client:t,mutationCache:this,mutationId:++Yp(this,Vh)._,options:t.defaultMutationOptions(n),state:r});return this.add(s),s}add(t){Z(this,Wa).add(t);const n=ym(t);if(typeof n=="string"){const r=Z(this,Li).get(n);r?r.push(t):Z(this,Li).set(n,[t])}this.notify({type:"added",mutation:t})}remove(t){if(Z(this,Wa).delete(t)){const n=ym(t);if(typeof n=="string"){const r=Z(this,Li).get(n);if(r)if(r.length>1){const s=r.indexOf(t);s!==-1&&r.splice(s,1)}else r[0]===t&&Z(this,Li).delete(n)}}this.notify({type:"removed",mutation:t})}canRun(t){var r;const n=ym(t);if(typeof n=="string"){const s=(r=Z(this,Li).get(n))==null?void 0:r.find(i=>i.state.status==="pending");return!s||s===t}else return!0}runNext(t){var r,s;const n=ym(t);return typeof n=="string"?((s=(r=Z(this,Li).get(n))==null?void 0:r.find(i=>i!==t&&i.state.isPaused))==null?void 0:s.continue())??Promise.resolve():Promise.resolve()}clear(){mr.batch(()=>{const t=this.getAll();Z(this,Wa).clear(),Z(this,Li).clear(),t.forEach(n=>{this.notify({type:"removed",mutation:n})})})}getAll(){return Array.from(Z(this,Wa))}find(t){const n={exact:!0,...t};return this.getAll().find(r=>F8(n,r))}findAll(t={}){return this.getAll().filter(n=>F8(t,n))}notify(t){mr.batch(()=>{this.listeners.forEach(n=>{n(t)})})}resumePausedMutations(){const t=this.getAll().filter(n=>n.state.isPaused);return mr.batch(()=>Promise.all(t.map(n=>n.continue().catch(fs))))}},Wa=new WeakMap,Li=new WeakMap,Vh=new WeakMap,cT);function ym(e){var t;return(t=e.options.scope)==null?void 0:t.id}var Go,Ka,Xr,Hh,mo,jf,Hw,uT,rG=(uT=class extends Cd{constructor(n,r){super();rt(this,mo);rt(this,Go);rt(this,Ka);rt(this,Xr);rt(this,Hh);Le(this,Go,n),this.setOptions(r),this.bindMethods(),bt(this,mo,jf).call(this)}bindMethods(){this.mutate=this.mutate.bind(this),this.reset=this.reset.bind(this)}setOptions(n){var s;const r=this.options;this.options=Z(this,Go).defaultMutationOptions(n),Xm(this.options,r)||Z(this,Go).getMutationCache().notify({type:"observerOptionsUpdated",mutation:Z(this,Xr),observer:this}),r!=null&&r.mutationKey&&this.options.mutationKey&&Sc(r.mutationKey)!==Sc(this.options.mutationKey)?this.reset():((s=Z(this,Xr))==null?void 0:s.state.status)==="pending"&&Z(this,Xr).setOptions(this.options)}onSubscribe(){this.listeners.size===1&&Z(this,Xr)&&(Z(this,Xr).addObserver(this),bt(this,mo,jf).call(this))}onUnsubscribe(){var n;this.hasListeners()||(n=Z(this,Xr))==null||n.removeObserver(this)}onMutationUpdate(n){bt(this,mo,jf).call(this),bt(this,mo,Hw).call(this,n)}getCurrentResult(){return Z(this,Ka)}reset(){var n;(n=Z(this,Xr))==null||n.removeObserver(this),Le(this,Xr,void 0),bt(this,mo,jf).call(this),bt(this,mo,Hw).call(this)}mutate(n,r){var s;return Le(this,Hh,r),(s=Z(this,Xr))==null||s.removeObserver(this),Le(this,Xr,Z(this,Go).getMutationCache().build(Z(this,Go),this.options)),Z(this,Xr).addObserver(this),Z(this,Xr).execute(n)}},Go=new WeakMap,Ka=new WeakMap,Xr=new WeakMap,Hh=new WeakMap,mo=new WeakSet,jf=function(){var r;const n=((r=Z(this,Xr))==null?void 0:r.state)??wM();Le(this,Ka,{...n,isPending:n.status==="pending",isSuccess:n.status==="success",isError:n.status==="error",isIdle:n.status==="idle",mutate:this.mutate,reset:this.reset})},Hw=function(n){mr.batch(()=>{var s,i,o,c;const r=Z(this,Hh);if(r&&this.hasListeners()){const u=Z(this,Ka).variables,d=Z(this,Ka).context,f={client:Z(this,Go),meta:this.options.meta,mutationKey:this.options.mutationKey};if((n==null?void 0:n.type)==="success"){try{(s=r.onSuccess)==null||s.call(r,n.data,u,d,f)}catch(p){Promise.reject(p)}try{(i=r.onSettled)==null||i.call(r,n.data,null,u,d,f)}catch(p){Promise.reject(p)}}else if((n==null?void 0:n.type)==="error"){try{(o=r.onError)==null||o.call(r,n.error,u,d,f)}catch(p){Promise.reject(p)}try{(c=r.onSettled)==null||c.call(r,void 0,n.error,u,d,f)}catch(p){Promise.reject(p)}}}this.listeners.forEach(u=>{u(Z(this,Ka))})})},uT),lo,dT,sG=(dT=class extends Cd{constructor(t={}){super();rt(this,lo);this.config=t,Le(this,lo,new Map)}build(t,n,r){const s=n.queryKey,i=n.queryHash??Hb(s,n);let o=this.get(i);return o||(o=new XK({client:t,queryKey:s,queryHash:i,options:t.defaultQueryOptions(n),state:r,defaultOptions:t.getQueryDefaults(s)}),this.add(o)),o}add(t){Z(this,lo).has(t.queryHash)||(Z(this,lo).set(t.queryHash,t),this.notify({type:"added",query:t}))}remove(t){Z(this,lo).get(t.queryHash)===t&&(t.destroy(),Z(this,lo).delete(t.queryHash),this.notify({type:"removed",query:t}))}clear(){mr.batch(()=>{this.getAll().forEach(t=>{this.remove(t)})})}get(t){return Z(this,lo).get(t)}getAll(){return[...Z(this,lo).values()]}find(t){const n={exact:!0,...t};return this.getAll().find(r=>D8(n,r))}findAll(t={}){const n=this.getAll();return Object.keys(t).length>0?n.filter(r=>D8(t,r)):n}notify(t){mr.batch(()=>{this.listeners.forEach(n=>{n(t)})})}onFocus(){mr.batch(()=>{this.getAll().forEach(t=>{t.onFocus()})})}onOnline(){mr.batch(()=>{this.getAll().forEach(t=>{t.onOnline()})})}},lo=new WeakMap,dT),Dn,Ga,qa,Gu,qu,Ya,Yu,Qu,fT,iG=(fT=class{constructor(e={}){rt(this,Dn);rt(this,Ga);rt(this,qa);rt(this,Gu);rt(this,qu);rt(this,Ya);rt(this,Yu);rt(this,Qu);Le(this,Dn,e.queryCache||new sG),Le(this,Ga,e.mutationCache||new nG),Le(this,qa,e.defaultOptions||{}),Le(this,Gu,new Map),Le(this,qu,new Map),Le(this,Ya,0)}mount(){Yp(this,Ya)._++,Z(this,Ya)===1&&(Le(this,Yu,Kb.subscribe(async e=>{e&&(await this.resumePausedMutations(),Z(this,Dn).onFocus())})),Le(this,Qu,Y0.subscribe(async e=>{e&&(await this.resumePausedMutations(),Z(this,Dn).onOnline())})))}unmount(){var e,t;Yp(this,Ya)._--,Z(this,Ya)===0&&((e=Z(this,Yu))==null||e.call(this),Le(this,Yu,void 0),(t=Z(this,Qu))==null||t.call(this),Le(this,Qu,void 0))}isFetching(e){return Z(this,Dn).findAll({...e,fetchStatus:"fetching"}).length}isMutating(e){return Z(this,Ga).findAll({...e,status:"pending"}).length}getQueryData(e){var n;const t=this.defaultQueryOptions({queryKey:e});return(n=Z(this,Dn).get(t.queryHash))==null?void 0:n.state.data}ensureQueryData(e){const t=this.defaultQueryOptions(e),n=Z(this,Dn).build(this,t),r=n.state.data;return r===void 0?this.fetchQuery(e):(e.revalidateIfStale&&n.isStaleByTime(On(t.staleTime,n))&&this.prefetchQuery(t),Promise.resolve(r))}getQueriesData(e){return Z(this,Dn).findAll(e).map(({queryKey:t,state:n})=>[t,n.data])}setQueryData(e,t,n){var o;const r=this.defaultQueryOptions({queryKey:e}),s=(o=Z(this,Dn).get(r.queryHash))==null?void 0:o.state.data,i=FK(t,s);if(i!==void 0)return Z(this,Dn).build(this,r).setData(i,{...n,manual:!0})}setQueriesData(e,t,n){return mr.batch(()=>Z(this,Dn).findAll(e).map(({queryKey:r})=>[r,this.setQueryData(r,t,n)]))}getQueryState(e){var n;const t=this.defaultQueryOptions({queryKey:e});return(n=Z(this,Dn).get(t.queryHash))==null?void 0:n.state}removeQueries(e){const t=Z(this,Dn);mr.batch(()=>{t.findAll(e).forEach(n=>{t.remove(n)})})}resetQueries(e,t){const n=Z(this,Dn);return mr.batch(()=>{const r=n.findAll(e),s=new Set(r);return r.forEach(i=>{i.reset()}),this.refetchQueries({type:"active",predicate:i=>s.has(i)},t)})}cancelQueries(e,t={}){const n={revert:!0,...t},r=mr.batch(()=>Z(this,Dn).findAll(e).map(s=>s.cancel(n)));return Promise.all(r).then(fs).catch(fs)}invalidateQueries(e,t={}){return mr.batch(()=>(Z(this,Dn).findAll(e).forEach(n=>{n.invalidate()}),(e==null?void 0:e.refetchType)==="none"?Promise.resolve():this.refetchQueries({...e,type:(e==null?void 0:e.refetchType)??(e==null?void 0:e.type)??"active"},t)))}refetchQueries(e,t={}){const n={...t,cancelRefetch:t.cancelRefetch??!0},r=mr.batch(()=>Z(this,Dn).findAll(e).filter(s=>!s.isDisabled()&&!s.isStatic()).map(s=>{let i=s.fetch(void 0,n);const o=s.state.fetchStatus==="paused";return(!n.throwOnError||o)&&(i=i.catch(fs)),o?Promise.resolve():i}));return Promise.all(r).then(fs)}async query(e){const t=this.defaultQueryOptions(e);t.retry===void 0&&(t.retry=!1);const n=Z(this,Dn).build(this,t),r=n.isStaleByTime(On(t.staleTime,n))?await n.fetch(t):n.state.data,s=t.select;return s?s(r):r}fetchQuery(e){const t=this.defaultQueryOptions(e);t.retry===void 0&&(t.retry=!1);const n=Z(this,Dn).build(this,t);return n.isStaleByTime(On(t.staleTime,n))?n.fetch(t):Promise.resolve(n.state.data)}prefetchQuery(e){return this.fetchQuery(e).then(fs).catch(fs)}infiniteQuery(e){return e._type="infinite",this.query(e)}fetchInfiniteQuery(e){return e._type="infinite",this.fetchQuery(e)}prefetchInfiniteQuery(e){return this.fetchInfiniteQuery(e).then(fs).catch(fs)}ensureInfiniteQueryData(e){return e._type="infinite",this.ensureQueryData(e)}resumePausedMutations(){return Y0.isOnline()?Z(this,Ga).resumePausedMutations():Promise.resolve()}getQueryCache(){return Z(this,Dn)}getMutationCache(){return Z(this,Ga)}getDefaultOptions(){return Z(this,qa)}setDefaultOptions(e){Le(this,qa,e)}setQueryDefaults(e,t){Z(this,Gu).set(Sc(e),{queryKey:e,defaultOptions:t})}getQueryDefaults(e){const t=[...Z(this,Gu).values()],n={};return t.forEach(r=>{hd(e,r.queryKey)&&Object.assign(n,r.defaultOptions)}),n}setMutationDefaults(e,t){Z(this,qu).set(Sc(e),{mutationKey:e,defaultOptions:t})}getMutationDefaults(e){const t=[...Z(this,qu).values()],n={};return t.forEach(r=>{hd(e,r.mutationKey)&&Object.assign(n,r.defaultOptions)}),n}defaultQueryOptions(e){if(e._defaulted)return e;const t={...Z(this,qa).queries,...this.getQueryDefaults(e.queryKey),...e,_defaulted:!0};return t.queryHash||(t.queryHash=Hb(t.queryKey,t)),t.refetchOnReconnect===void 0&&(t.refetchOnReconnect=t.networkMode!=="always"),t.throwOnError===void 0&&(t.throwOnError=!!t.suspense),!t.networkMode&&t.persister&&(t.networkMode="offlineFirst"),t.queryFn===Ub&&(t.enabled=!1),t}defaultMutationOptions(e){return e!=null&&e._defaulted?e:{...Z(this,qa).mutations,...(e==null?void 0:e.mutationKey)&&this.getMutationDefaults(e.mutationKey),...e,_defaulted:!0}}clear(){Z(this,Dn).clear(),Z(this,Ga).clear()}},Dn=new WeakMap,Ga=new WeakMap,qa=new WeakMap,Gu=new WeakMap,qu=new WeakMap,Ya=new WeakMap,Yu=new WeakMap,Qu=new WeakMap,fT);const bM=g.createContext(!1),oG=()=>g.useContext(bM);bM.Provider;function aG(){let e=!1;return{clearReset:()=>{e=!1},reset:()=>{e=!0},isReset:()=>e}}const lG=g.createContext(aG()),cG=()=>g.useContext(lG),uG=(e,t,n)=>{const r=(n==null?void 0:n.state.status)==="error"&&typeof e.throwOnError=="function"?Zb(e.throwOnError,[n.state.error,n]):e.throwOnError;(e.suspense||r)&&(t.isReset()||(e.retryOnMount=!1))},dG=e=>{g.useEffect(()=>{e.clearReset()},[e])},fG=({result:e,errorResetBoundary:t,throwOnError:n,query:r,suspense:s})=>e.isError&&!t.isReset()&&!e.isFetching&&r&&(s&&e.data===void 0||Zb(n,[e.error,r])),hG=e=>{if(e.suspense){const n=s=>s==="static"?s:Math.max(s??1e3,1e3),r=e.staleTime;e.staleTime=typeof r=="function"?(...s)=>n(r(...s)):n(r),typeof e.gcTime=="number"&&(e.gcTime=Math.max(e.gcTime,1e3))}},pG=(e,t)=>(e==null?void 0:e.suspense)&&t.isPending,mG=(e,t,n)=>t.fetchOptimistic(e).catch(()=>{n.clearReset()});function gG(e,t,n){const r=oG(),s=cG(),i=kd(),o=i.defaultQueryOptions(e),c=i.getQueryCache().get(o.queryHash),u=e.subscribed!==!1;o._optimisticResults=r?"isRestoring":u?"optimistic":void 0,hG(o),uG(o,s,c),dG(s);const[d]=g.useState(()=>new t(i,o)),f=d.getOptimisticResult(o);g.useEffect(()=>{d.setOptions(o)},[o,d]);const p=!r&&u;if(g.useSyncExternalStore(g.useCallback(m=>{const v=p?d.subscribe(mr.batchCalls(m)):fs;return d.updateResult(),v},[d,p]),()=>d.getCurrentResult(),()=>d.getCurrentResult()),pG(o,f))throw mG(o,d,s);if(fG({result:f,errorResetBoundary:s,throwOnError:o.throwOnError,query:c,suspense:o.suspense}))throw f.error;return o.notifyOnChangeProps?f:d.trackResult(f)}function Vi(e,t){return gG(e,JK)}function Ng(e,t){const n=kd(),[r]=g.useState(()=>new rG(n,e));g.useEffect(()=>{r.setOptions(e)},[r,e]);const s=g.useSyncExternalStore(g.useCallback(o=>r.subscribe(mr.batchCalls(o)),[r]),()=>r.getCurrentResult(),()=>r.getCurrentResult()),i=g.useCallback((...o)=>{r.mutate(o[0],o[1]).catch(fs)},[r]);if(s.error&&Zb(r.options.throwOnError,[s.error]))throw s.error;return{...s,mutate:i,mutateAsync:s.mutate}}const qb=g.createContext({});function Lg(e){const t=g.useRef(null);return t.current===null&&(t.current=e()),t.current}const vG=typeof window<"u",Yb=vG?g.useLayoutEffect:g.useEffect,$g=g.createContext(null);function Qb(e,t){e.indexOf(t)===-1&&e.push(t)}function Q0(e,t){const n=e.indexOf(t);n>-1&&e.splice(n,1)}const wo=(e,t,n)=>n>t?t:n<e?e:n;let Dg=()=>{};const hl={},xM=e=>/^-?(?:\d+(?:\.\d+)?|\.\d+)$/u.test(e),SM=e=>typeof e=="object"&&e!==null,EM=e=>/^0[^.\s]+$/u.test(e);function kM(e){let t;return()=>(t===void 0&&(t=e()),t)}const gi=e=>e,Zh=(...e)=>e.reduce((t,n)=>r=>n(t(r))),xh=(e,t,n)=>{const r=t-e;return r?(n-e)/r:1};class Xb{constructor(){this.subscriptions=[]}add(t){return Qb(this.subscriptions,t),()=>Q0(this.subscriptions,t)}notify(t,n,r){const s=this.subscriptions.length;if(s)if(s===1)this.subscriptions[0](t,n,r);else for(let i=0;i<s;i++){const o=this.subscriptions[i];o&&o(t,n,r)}}getSize(){return this.subscriptions.length}clear(){this.subscriptions.length=0}}const qs=e=>e*1e3,hi=e=>e/1e3,CM=(e,t)=>t?e*(1e3/t):0,PM=(e,t,n)=>(((1-3*n+3*t)*e+(3*n-6*t))*e+3*t)*e,yG=1e-7,_G=12;function wG(e,t,n,r,s){let i,o,c=0;do o=t+(n-t)/2,i=PM(o,r,s)-e,i>0?n=o:t=o;while(Math.abs(i)>yG&&++c<_G);return o}function Bh(e,t,n,r){if(e===t&&n===r)return gi;const s=i=>wG(i,0,1,e,n);return i=>i===0||i===1?i:PM(s(i),t,r)}const AM=e=>t=>t<=.5?e(2*t)/2:(2-e(2*(1-t)))/2,TM=e=>t=>1-e(1-t),RM=Bh(.33,1.53,.69,.99),Jb=TM(RM),IM=AM(Jb),OM=e=>e>=1?1:(e*=2)<1?.5*Jb(e):.5*(2-Math.pow(2,-10*(e-1))),ex=e=>1-Math.sin(Math.acos(e)),MM=TM(ex),NM=AM(ex),bG=Bh(.42,0,1,1),xG=Bh(0,0,.58,1),LM=Bh(.42,0,.58,1),SG=e=>Array.isArray(e)&&typeof e[0]!="number",$M=e=>Array.isArray(e)&&typeof e[0]=="number",EG={linear:gi,easeIn:bG,easeInOut:LM,easeOut:xG,circIn:ex,circInOut:NM,circOut:MM,backIn:Jb,backInOut:IM,backOut:RM,anticipate:OM},kG=e=>typeof e=="string",W8=e=>{if($M(e)){Dg(e.length===4);const[t,n,r,s]=e;return Bh(t,n,r,s)}else if(kG(e))return EG[e];return e},_m=["setup","read","resolveKeyframes","preUpdate","update","preRender","render","postRender"];function CG(e){let t=new Set,n=new Set,r=!1,s=!1;const i=new WeakSet;let o={delta:0,timestamp:0,isProcessing:!1};function c(d){i.has(d)&&(u.schedule(d),e()),d(o)}const u={schedule:(d,f=!1,p=!1)=>{const v=p&&r?t:n;return f&&i.add(d),v.add(d),d},cancel:d=>{n.delete(d),i.delete(d)},process:d=>{if(o=d,r){s=!0;return}r=!0;const f=t;t=n,n=f,t.forEach(c),t.clear(),r=!1,s&&(s=!1,u.process(d))}};return u}const PG=40;function DM(e,t){let n=!1,r=!0;const s={delta:0,timestamp:0,isProcessing:!1},i=()=>n=!0,o=_m.reduce((C,A)=>(C[A]=CG(i),C),{}),{setup:c,read:u,resolveKeyframes:d,preUpdate:f,update:p,preRender:m,render:v,postRender:_}=o,w=()=>{const C=hl.useManualTiming,A=C?s.timestamp:performance.now();n=!1,C||(s.delta=r?1e3/60:Math.max(Math.min(A-s.timestamp,PG),1)),s.timestamp=A,s.isProcessing=!0,c.process(s),u.process(s),d.process(s),f.process(s),p.process(s),m.process(s),v.process(s),_.process(s),s.isProcessing=!1,n&&t&&(r=!1,e(w))},b=()=>{n=!0,r=!0,s.isProcessing||e(w)};return{schedule:_m.reduce((C,A)=>{const T=o[A];return C[A]=(M,O=!1,R=!1)=>(n||b(),T.schedule(M,O,R)),C},{}),cancel:C=>{for(let A=0;A<_m.length;A++)o[_m[A]].cancel(C)},state:s,steps:o}}const{schedule:yn,cancel:pl,state:Dr,steps:D1}=DM(typeof requestAnimationFrame<"u"?requestAnimationFrame:gi,!0);let Jm;function AG(){Jm=void 0}const ps={now:()=>(Jm===void 0&&ps.set(Dr.isProcessing||hl.useManualTiming?Dr.timestamp:performance.now()),Jm),set:e=>{Jm=e,queueMicrotask(AG)}},FM=e=>t=>typeof t=="string"&&t.startsWith(e),jM=FM("--"),TG=FM("var(--"),tx=e=>TG(e)?RG.test(e.split("/*")[0].trim()):!1,RG=/var\(--(?:[\w-]+\s*|[\w-]+\s*,(?:\s*[^)(\s]|\s*\((?:[^)(]|\([^)(]*\))*\))+\s*)\)$/iu;function K8(e){return typeof e!="string"?!1:e.split("/*")[0].includes("var(--")}const Pd={test:e=>typeof e=="number",parse:parseFloat,transform:e=>e},Sh={...Pd,transform:e=>wo(0,1,e)},wm={...Pd,default:1},th=e=>Math.round(e*1e5)/1e5,nx=/-?(?:\d+(?:\.\d+)?|\.\d+)/gu;function IG(e){return e==null}const OG=/^(?:#[\da-f]{3,8}|(?:rgb|hsl)a?\((?:-?[\d.]+%?[,\s]+){2}-?[\d.]+%?\s*(?:[,/]\s*)?(?:\b\d+(?:\.\d+)?|\.\d+)?%?\))$/iu,rx=(e,t)=>n=>!!(typeof n=="string"&&OG.test(n)&&n.startsWith(e)||t&&!IG(n)&&Object.prototype.hasOwnProperty.call(n,t)),zM=(e,t,n)=>r=>{if(typeof r!="string")return r;const[s,i,o,c]=r.match(nx);return{[e]:parseFloat(s),[t]:parseFloat(i),[n]:parseFloat(o),alpha:c!==void 0?parseFloat(c):1}},MG=e=>wo(0,255,e),F1={...Pd,transform:e=>Math.round(MG(e))},Jl={test:rx("rgb","red"),parse:zM("red","green","blue"),transform:({red:e,green:t,blue:n,alpha:r=1})=>"rgba("+F1.transform(e)+", "+F1.transform(t)+", "+F1.transform(n)+", "+th(Sh.transform(r))+")"};function NG(e){let t="",n="",r="",s="";return e.length>5?(t=e.substring(1,3),n=e.substring(3,5),r=e.substring(5,7),s=e.substring(7,9)):(t=e.substring(1,2),n=e.substring(2,3),r=e.substring(3,4),s=e.substring(4,5),t+=t,n+=n,r+=r,s+=s),{red:parseInt(t,16),green:parseInt(n,16),blue:parseInt(r,16),alpha:s?parseInt(s,16)/255:1}}const Uw={test:rx("#"),parse:NG,transform:Jl.transform},Wh=e=>({test:t=>typeof t=="string"&&t.endsWith(e)&&t.split(" ").length===1,parse:parseFloat,transform:t=>`${t}${e}`}),Zo=Wh("deg"),vo=Wh("%"),Ge=Wh("px"),LG=Wh("vh"),$G=Wh("vw"),G8={...vo,parse:e=>vo.parse(e)/100,transform:e=>vo.transform(e*100)},Cu={test:rx("hsl","hue"),parse:zM("hue","saturation","lightness"),transform:({hue:e,saturation:t,lightness:n,alpha:r=1})=>"hsla("+Math.round(e)+", "+vo.transform(th(t))+", "+vo.transform(th(n))+", "+th(Sh.transform(r))+")"},sr={test:e=>Jl.test(e)||Uw.test(e)||Cu.test(e),parse:e=>Jl.test(e)?Jl.parse(e):Cu.test(e)?Cu.parse(e):Uw.parse(e),transform:e=>typeof e=="string"?e:e.hasOwnProperty("red")?Jl.transform(e):Cu.transform(e),getAnimatableNone:e=>{const t=sr.parse(e);return t.alpha=0,sr.transform(t)}},DG=/(?:#[\da-f]{3,8}|(?:rgb|hsl)a?\((?:-?[\d.]+%?[,\s]+){2}-?[\d.]+%?\s*(?:[,/]\s*)?(?:\b\d+(?:\.\d+)?|\.\d+)?%?\))/giu;function FG(e){var t,n;return isNaN(e)&&typeof e=="string"&&(((t=e.match(nx))==null?void 0:t.length)||0)+(((n=e.match(DG))==null?void 0:n.length)||0)>0}const VM="number",HM="color",jG="var",zG="var(",q8="${}",VG=/var\s*\(\s*--(?:[\w-]+\s*|[\w-]+\s*,(?:\s*[^)(\s]|\s*\((?:[^)(]|\([^)(]*\))*\))+\s*)\)|#[\da-f]{3,8}|(?:rgb|hsl)a?\((?:-?[\d.]+%?[,\s]+){2}-?[\d.]+%?\s*(?:[,/]\s*)?(?:\b\d+(?:\.\d+)?|\.\d+)?%?\)|-?(?:\d+(?:\.\d+)?|\.\d+)/giu;function pd(e){const t=e.toString(),n=[],r={color:[],number:[],var:[]},s=[];let i=0;const c=t.replace(VG,u=>(sr.test(u)?(r.color.push(i),s.push(HM),n.push(sr.parse(u))):u.startsWith(zG)?(r.var.push(i),s.push(jG),n.push(u)):(r.number.push(i),s.push(VM),n.push(parseFloat(u))),++i,q8)).split(q8);return{values:n,split:c,indexes:r,types:s}}function HG(e){return pd(e).values}function UM({split:e,types:t}){const n=e.length;return r=>{let s="";for(let i=0;i<n;i++)if(s+=e[i],r[i]!==void 0){const o=t[i];o===VM?s+=th(r[i]):o===HM?s+=sr.transform(r[i]):s+=r[i]}return s}}function UG(e){return UM(pd(e))}const ZG=e=>typeof e=="number"?0:sr.test(e)?sr.getAnimatableNone(e):e,BG=(e,t)=>typeof e=="number"?t!=null&&t.trim().endsWith("/")?e:0:ZG(e);function WG(e){const t=pd(e);return UM(t)(t.values.map((r,s)=>BG(r,t.split[s])))}const ji={test:FG,parse:HG,createTransformer:UG,getAnimatableNone:WG};function j1(e,t,n){return n<0&&(n+=1),n>1&&(n-=1),n<1/6?e+(t-e)*6*n:n<1/2?t:n<2/3?e+(t-e)*(2/3-n)*6:e}function KG({hue:e,saturation:t,lightness:n,alpha:r}){e/=360,t/=100,n/=100;let s=0,i=0,o=0;if(!t)s=i=o=n;else{const c=n<.5?n*(1+t):n+t-n*t,u=2*n-c;s=j1(u,c,e+1/3),i=j1(u,c,e),o=j1(u,c,e-1/3)}return{red:Math.round(s*255),green:Math.round(i*255),blue:Math.round(o*255),alpha:r}}function X0(e,t){return n=>n>0?t:e}const vn=(e,t,n)=>e+(t-e)*n,z1=(e,t,n)=>{const r=e*e,s=n*(t*t-r)+r;return s<0?0:Math.sqrt(s)},GG=[Uw,Jl,Cu],qG=e=>GG.find(t=>t.test(e));function Y8(e){const t=qG(e);if(!t)return!1;let n=t.parse(e);return t===Cu&&(n=KG(n)),n}const Q8=(e,t)=>{const n=Y8(e),r=Y8(t);if(!n||!r)return X0(e,t);const s={...n};return i=>(s.red=z1(n.red,r.red,i),s.green=z1(n.green,r.green,i),s.blue=z1(n.blue,r.blue,i),s.alpha=vn(n.alpha,r.alpha,i),Jl.transform(s))},Zw=new Set(["none","hidden"]);function YG(e,t){return Zw.has(e)?n=>n<=0?e:t:n=>n>=1?t:e}function QG(e,t){return n=>vn(e,t,n)}function sx(e){return typeof e=="number"?QG:typeof e=="string"?tx(e)?X0:sr.test(e)?Q8:eq:Array.isArray(e)?ZM:typeof e=="object"?sr.test(e)?Q8:XG:X0}function ZM(e,t){const n=[...e],r=n.length,s=e.map((i,o)=>sx(i)(i,t[o]));return i=>{for(let o=0;o<r;o++)n[o]=s[o](i);return n}}function XG(e,t){const n={...e,...t},r={};for(const s in n)e[s]!==void 0&&t[s]!==void 0&&(r[s]=sx(e[s])(e[s],t[s]));return s=>{for(const i in r)n[i]=r[i](s);return n}}function JG(e,t){const n=[],r={color:0,var:0,number:0};for(let s=0;s<t.values.length;s++){const i=t.types[s],o=e.indexes[i][r[i]],c=e.values[o]??0;n[s]=c,r[i]++}return n}const eq=(e,t)=>{const n=ji.createTransformer(t),r=pd(e),s=pd(t);return r.indexes.var.length===s.indexes.var.length&&r.indexes.color.length===s.indexes.color.length&&r.indexes.number.length>=s.indexes.number.length?Zw.has(e)&&!s.values.length||Zw.has(t)&&!r.values.length?YG(e,t):Zh(ZM(JG(r,s),s.values),n):X0(e,t)};function BM(e,t,n){return typeof e=="number"&&typeof t=="number"&&typeof n=="number"?vn(e,t,n):sx(e)(e,t)}const tq=e=>{const t=({timestamp:n})=>e(n);return{start:(n=!0)=>yn.update(t,n),stop:()=>pl(t),now:()=>Dr.isProcessing?Dr.timestamp:ps.now()}},WM=(e,t,n=10)=>{let r="";const s=Math.max(Math.round(t/n),2);for(let i=0;i<s;i++)r+=Math.round(e(i/(s-1))*1e4)/1e4+", ";return`linear(${r.substring(0,r.length-2)})`},J0=2e4;function ix(e){let t=0;const n=50;let r=e.next(t);for(;!r.done&&t<J0;)t+=n,r=e.next(t);return t>=J0?1/0:t}function nq(e,t=100,n){const r=n({...e,keyframes:[0,t]}),s=Math.min(ix(r),J0);return{type:"keyframes",ease:i=>r.next(s*i).value/t,duration:hi(s)}}const Kn={stiffness:100,damping:10,mass:1,velocity:0,duration:800,bounce:.3,visualDuration:.3,restSpeed:{granular:.01,default:2},restDelta:{granular:.005,default:.5},minDuration:.01,maxDuration:10,minDamping:.05,maxDamping:1};function Bw(e,t){return e*Math.sqrt(1-t*t)}const rq=12;function sq(e,t,n){let r=n;for(let s=1;s<rq;s++)r=r-e(r)/t(r);return r}const V1=.001;function iq({duration:e=Kn.duration,bounce:t=Kn.bounce,velocity:n=Kn.velocity,mass:r=Kn.mass}){let s,i,o=1-t;o=wo(Kn.minDamping,Kn.maxDamping,o),e=wo(Kn.minDuration,Kn.maxDuration,hi(e)),o<1?(s=d=>{const f=d*o,p=f*e,m=f-n,v=Bw(d,o),_=Math.exp(-p);return V1-m/v*_},i=d=>{const p=d*o*e,m=p*n+n,v=Math.pow(o,2)*Math.pow(d,2)*e,_=Math.exp(-p),w=Bw(Math.pow(d,2),o);return(-s(d)+V1>0?-1:1)*((m-v)*_)/w}):(s=d=>{const f=Math.exp(-d*e),p=(d-n)*e+1;return-V1+f*p},i=d=>{const f=Math.exp(-d*e),p=(n-d)*(e*e);return f*p});const c=5/e,u=sq(s,i,c);if(e=qs(e),isNaN(u))return{stiffness:Kn.stiffness,damping:Kn.damping,duration:e};{const d=Math.pow(u,2)*r;return{stiffness:d,damping:o*2*Math.sqrt(r*d),duration:e}}}const oq=["duration","bounce"],aq=["stiffness","damping","mass"];function X8(e,t){return t.some(n=>e[n]!==void 0)}function lq(e){let t={velocity:Kn.velocity,stiffness:Kn.stiffness,damping:Kn.damping,mass:Kn.mass,isResolvedFromDuration:!1,...e};if(!X8(e,aq)&&X8(e,oq))if(t.velocity=0,e.visualDuration){const n=e.visualDuration,r=2*Math.PI/(n*1.2),s=r*r,i=2*wo(.05,1,1-(e.bounce||0))*Math.sqrt(s);t={...t,mass:Kn.mass,stiffness:s,damping:i}}else{const n=iq({...e,velocity:0});t={...t,...n,mass:Kn.mass},t.isResolvedFromDuration=!0}return t}function eg(e=Kn.visualDuration,t=Kn.bounce){const n=typeof e!="object"?{visualDuration:e,keyframes:[0,1],bounce:t}:e;let{restSpeed:r,restDelta:s}=n;const i=n.keyframes[0],o=n.keyframes[n.keyframes.length-1],c={done:!1,value:i},{stiffness:u,damping:d,mass:f,duration:p,velocity:m,isResolvedFromDuration:v}=lq({...n,velocity:-hi(n.velocity||0)}),_=m||0,w=d/(2*Math.sqrt(u*f)),b=o-i,S=hi(Math.sqrt(u/f)),E=Math.abs(b)<5;r||(r=E?Kn.restSpeed.granular:Kn.restSpeed.default),s||(s=E?Kn.restDelta.granular:Kn.restDelta.default);let C,A,T,M,O,R;if(w<1)T=Bw(S,w),M=(_+w*S*b)/T,C=U=>{const W=Math.exp(-w*S*U);return o-W*(M*Math.sin(T*U)+b*Math.cos(T*U))},O=w*S*M+b*T,R=w*S*b-M*T,A=U=>Math.exp(-w*S*U)*(O*Math.sin(T*U)+R*Math.cos(T*U));else if(w===1){C=W=>o-Math.exp(-S*W)*(b+(_+S*b)*W);const U=_+S*b;A=W=>Math.exp(-S*W)*(S*U*W-_)}else{const U=S*Math.sqrt(w*w-1);C=J=>{const V=Math.exp(-w*S*J),q=Math.min(U*J,300);return o-V*((_+w*S*b)*Math.sinh(q)+U*b*Math.cosh(q))/U};const W=(_+w*S*b)/U,H=w*S*W-b*U,Y=w*S*b-W*U;A=J=>{const V=Math.exp(-w*S*J),q=Math.min(U*J,300);return V*(H*Math.sinh(q)+Y*Math.cosh(q))}}const D={calculatedDuration:v&&p||null,velocity:U=>qs(A(U)),next:U=>{if(!v&&w<1){const H=Math.exp(-w*S*U),Y=Math.sin(T*U),J=Math.cos(T*U),V=o-H*(M*Y+b*J),q=qs(H*(O*Y+R*J));return c.done=Math.abs(q)<=r&&Math.abs(o-V)<=s,c.value=c.done?o:V,c}const W=C(U);if(v)c.done=U>=p;else{const H=qs(A(U));c.done=Math.abs(H)<=r&&Math.abs(o-W)<=s}return c.value=c.done?o:W,c},toString:()=>{const U=Math.min(ix(D),J0),W=WM(H=>D.next(U*H).value,U,30);return U+"ms "+W},toTransition:()=>{}};return D}eg.applyToOptions=e=>{const t=nq(e,100,eg);return e.ease=t.ease,e.duration=qs(t.duration),e.type="keyframes",e};const cq=5;function KM(e,t,n){const r=Math.max(t-cq,0);return CM(n-e(r),t-r)}function Ww({keyframes:e,velocity:t=0,power:n=.8,timeConstant:r=325,bounceDamping:s=10,bounceStiffness:i=500,modifyTarget:o,min:c,max:u,restDelta:d=.5,restSpeed:f}){const p=e[0],m={done:!1,value:p},v=R=>c!==void 0&&R<c||u!==void 0&&R>u,_=R=>c===void 0?u:u===void 0||Math.abs(c-R)<Math.abs(u-R)?c:u;let w=n*t;const b=p+w,S=o===void 0?b:o(b);S!==b&&(w=S-p);const E=R=>-w*Math.exp(-R/r),C=R=>S+E(R),A=R=>{const D=E(R),U=C(R);m.done=Math.abs(D)<=d,m.value=m.done?S:U};let T,M;const O=R=>{v(m.value)&&(T=R,M=eg({keyframes:[m.value,_(m.value)],velocity:KM(C,R,m.value),damping:s,stiffness:i,restDelta:d,restSpeed:f}))};return O(0),{calculatedDuration:null,next:R=>{let D=!1;return!M&&T===void 0&&(D=!0,A(R),O(R)),T!==void 0&&R>=T?M.next(R-T):(!D&&A(R),m)}}}function uq(e,t,n){const r=[],s=n||hl.mix||BM,i=e.length-1;for(let o=0;o<i;o++){let c=s(e[o],e[o+1]);if(t){const u=Array.isArray(t)?t[o]||gi:t;c=Zh(u,c)}r.push(c)}return r}function dq(e,t,{clamp:n=!0,ease:r,mixer:s}={}){const i=e.length;if(Dg(i===t.length),i===1)return()=>t[0];if(i===2&&t[0]===t[1])return()=>t[1];const o=e[0]===e[1];e[0]>e[i-1]&&(e=[...e].reverse(),t=[...t].reverse());const c=uq(t,r,s),u=c.length,d=f=>{if(o&&f<e[0])return t[0];let p=0;if(u>1)for(;p<e.length-2&&!(f<e[p+1]);p++);const m=xh(e[p],e[p+1],f);return c[p](m)};return n?f=>d(wo(e[0],e[i-1],f)):d}function fq(e,t){const n=e[e.length-1];for(let r=1;r<=t;r++){const s=xh(0,t,r);e.push(vn(n,1,s))}}function hq(e){const t=[0];return fq(t,e.length-1),t}function pq(e,t){return e.map(n=>n*t)}function mq(e,t){return e.map(()=>t||LM).splice(0,e.length-1)}function nh({duration:e=300,keyframes:t,times:n,ease:r="easeInOut"}){const s=SG(r)?r.map(W8):W8(r),i={done:!1,value:t[0]},o=pq(n&&n.length===t.length?n:hq(t),e),c=dq(o,t,{ease:Array.isArray(s)?s:mq(t,s)});return{calculatedDuration:e,next:u=>(i.value=c(u),i.done=u>=e,i)}}const gq=e=>e!==null;function Fg(e,{repeat:t,repeatType:n="loop"},r,s=1){const i=e.filter(gq),c=s<0||t&&n!=="loop"&&t%2===1?0:i.length-1;return!c||r===void 0?i[c]:r}const vq={decay:Ww,inertia:Ww,tween:nh,keyframes:nh,spring:eg};function GM(e){typeof e.type=="string"&&(e.type=vq[e.type])}class ox{constructor(){this.updateFinished()}get finished(){return this._finished}updateFinished(){this._finished=new Promise(t=>{this.resolve=t})}notifyFinished(){this.resolve()}then(t,n){return this.finished.then(t,n)}}const yq=e=>e/100;class tg extends ox{constructor(t){super(),this.state="idle",this.startTime=null,this.isStopped=!1,this.currentTime=0,this.holdTime=null,this.playbackSpeed=1,this.delayState={done:!1,value:void 0},this.stop=()=>{var r,s;const{motionValue:n}=this.options;n&&n.updatedAt!==ps.now()&&this.tick(ps.now()),this.isStopped=!0,this.state!=="idle"&&(this.teardown(),(s=(r=this.options).onStop)==null||s.call(r))},this.options=t,this.initAnimation(),this.play(),t.autoplay===!1&&this.pause()}initAnimation(){const{options:t}=this;GM(t);const{type:n=nh,repeat:r=0,repeatDelay:s=0,repeatType:i,velocity:o=0}=t;let{keyframes:c}=t;const u=n||nh;u!==nh&&typeof c[0]!="number"&&(this.mixKeyframes=Zh(yq,BM(c[0],c[1])),c=[0,100]);const d=u({...t,keyframes:c});i==="mirror"&&(this.mirroredGenerator=u({...t,keyframes:[...c].reverse(),velocity:-o})),d.calculatedDuration===null&&(d.calculatedDuration=ix(d));const{calculatedDuration:f}=d;this.calculatedDuration=f,this.resolvedDuration=f+s,this.totalDuration=this.resolvedDuration*(r+1)-s,this.generator=d}updateTime(t){const n=Math.round(t-this.startTime)*this.playbackSpeed;this.holdTime!==null?this.currentTime=this.holdTime:this.currentTime=n}tick(t,n=!1){const{generator:r,totalDuration:s,mixKeyframes:i,mirroredGenerator:o,resolvedDuration:c,calculatedDuration:u}=this;if(this.startTime===null)return r.next(0);const{delay:d=0,keyframes:f,repeat:p,repeatType:m,repeatDelay:v,type:_,onUpdate:w,finalKeyframe:b}=this.options;this.speed>0?this.startTime=Math.min(this.startTime,t):this.speed<0&&(this.startTime=Math.min(t-s/this.speed,this.startTime)),n?this.currentTime=t:this.updateTime(t);const S=this.currentTime-d*(this.playbackSpeed>=0?1:-1),E=this.playbackSpeed>=0?S<0:S>s;this.currentTime=Math.max(S,0),this.state==="finished"&&this.holdTime===null&&(this.currentTime=s);let C=this.currentTime,A=r;if(p){const R=Math.min(this.currentTime,s)/c;let D=Math.floor(R),U=R%1;!U&&R>=1&&(U=1),U===1&&D--,D=Math.min(D,p+1),!!(D%2)&&(m==="reverse"?(U=1-U,v&&(U-=v/c)):m==="mirror"&&(A=o)),C=wo(0,1,U)*c}let T;E?(this.delayState.value=f[0],T=this.delayState):T=A.next(C),i&&!E&&(T.value=i(T.value));let{done:M}=T;!E&&u!==null&&(M=this.playbackSpeed>=0?this.currentTime>=s:this.currentTime<=0);const O=this.holdTime===null&&(this.state==="finished"||this.state==="running"&&M);return O&&_!==Ww&&(T.value=Fg(f,this.options,b,this.speed)),w&&w(T.value),O&&this.finish(),T}then(t,n){return this.finished.then(t,n)}get duration(){return hi(this.calculatedDuration)}get iterationDuration(){const{delay:t=0}=this.options||{};return this.duration+hi(t)}get time(){return hi(this.currentTime)}set time(t){t=qs(t),this.currentTime=t,this.startTime===null||this.holdTime!==null||this.playbackSpeed===0?this.holdTime=t:this.driver&&(this.startTime=this.driver.now()-t/this.playbackSpeed),this.driver?this.driver.start(!1):(this.startTime=0,this.state="paused",this.holdTime=t,this.tick(t))}getGeneratorVelocity(){const t=this.currentTime;if(t<=0)return this.options.velocity||0;if(this.generator.velocity)return this.generator.velocity(t);const n=this.generator.next(t).value;return KM(r=>this.generator.next(r).value,t,n)}get speed(){return this.playbackSpeed}set speed(t){const n=this.playbackSpeed!==t;n&&this.driver&&this.updateTime(ps.now()),this.playbackSpeed=t,n&&this.driver&&(this.time=hi(this.currentTime))}play(){var s,i;if(this.isStopped)return;const{driver:t=tq,startTime:n}=this.options;this.driver||(this.driver=t(o=>this.tick(o))),(i=(s=this.options).onPlay)==null||i.call(s);const r=this.driver.now();this.state==="finished"?(this.updateFinished(),this.startTime=r):this.holdTime!==null?this.startTime=r-this.holdTime:this.startTime||(this.startTime=n??r),this.state==="finished"&&this.speed<0&&(this.startTime+=this.calculatedDuration),this.holdTime=null,this.state="running",this.driver.start()}pause(){this.state="paused",this.updateTime(ps.now()),this.holdTime=this.currentTime}complete(){this.state!=="running"&&this.play(),this.state="finished",this.holdTime=null}finish(){var t,n;this.notifyFinished(),this.teardown(),this.state="finished",(n=(t=this.options).onComplete)==null||n.call(t)}cancel(){var t,n;this.holdTime=null,this.startTime=0,this.tick(0),this.teardown(),(n=(t=this.options).onCancel)==null||n.call(t)}teardown(){this.state="idle",this.stopDriver(),this.startTime=this.holdTime=null}stopDriver(){this.driver&&(this.driver.stop(),this.driver=void 0)}sample(t){return this.startTime=0,this.tick(t,!0)}attachTimeline(t){var n;return this.options.allowFlatten&&(this.options.type="keyframes",this.options.ease="linear",this.initAnimation()),(n=this.driver)==null||n.stop(),t.observe(this)}}function _q(e){for(let t=1;t<e.length;t++)e[t]??(e[t]=e[t-1])}const ec=e=>e*180/Math.PI,Kw=e=>{const t=ec(Math.atan2(e[1],e[0]));return Gw(t)},wq={x:4,y:5,translateX:4,translateY:5,scaleX:0,scaleY:3,scale:e=>(Math.abs(e[0])+Math.abs(e[3]))/2,rotate:Kw,rotateZ:Kw,skewX:e=>ec(Math.atan(e[1])),skewY:e=>ec(Math.atan(e[2])),skew:e=>(Math.abs(e[1])+Math.abs(e[2]))/2},Gw=e=>(e=e%360,e<0&&(e+=360),e),J8=Kw,eP=e=>Math.sqrt(e[0]*e[0]+e[1]*e[1]),tP=e=>Math.sqrt(e[4]*e[4]+e[5]*e[5]),bq={x:12,y:13,z:14,translateX:12,translateY:13,translateZ:14,scaleX:eP,scaleY:tP,scale:e=>(eP(e)+tP(e))/2,rotateX:e=>Gw(ec(Math.atan2(e[6],e[5]))),rotateY:e=>Gw(ec(Math.atan2(-e[2],e[0]))),rotateZ:J8,rotate:J8,skewX:e=>ec(Math.atan(e[4])),skewY:e=>ec(Math.atan(e[1])),skew:e=>(Math.abs(e[1])+Math.abs(e[4]))/2};function qw(e){return e.includes("scale")?1:0}function Yw(e,t){if(!e||e==="none")return qw(t);const n=e.match(/^matrix3d\(([-\d.e\s,]+)\)$/u);let r,s;if(n)r=bq,s=n;else{const c=e.match(/^matrix\(([-\d.e\s,]+)\)$/u);r=wq,s=c}if(!s)return qw(t);const i=r[t],o=s[1].split(",").map(Sq);return typeof i=="function"?i(o):o[i]}const xq=(e,t)=>{const{transform:n="none"}=getComputedStyle(e);return Yw(n,t)};function Sq(e){return parseFloat(e.trim())}const Ad=["transformPerspective","x","y","z","translateX","translateY","translateZ","scale","scaleX","scaleY","rotate","rotateX","rotateY","rotateZ","skew","skewX","skewY"],Td=new Set([...Ad,"pathRotation"]),nP=e=>e===Pd||e===Ge,Eq=new Set(["x","y","z"]),kq=Ad.filter(e=>!Eq.has(e));function Cq(e){const t=[];return kq.forEach(n=>{const r=e.getValue(n);r!==void 0&&(t.push([n,r.get()]),r.set(n.startsWith("scale")?1:0))}),t}const tl={width:({x:e},{paddingLeft:t="0",paddingRight:n="0",boxSizing:r})=>{const s=e.max-e.min;return r==="border-box"?s:s-parseFloat(t)-parseFloat(n)},height:({y:e},{paddingTop:t="0",paddingBottom:n="0",boxSizing:r})=>{const s=e.max-e.min;return r==="border-box"?s:s-parseFloat(t)-parseFloat(n)},top:(e,{top:t})=>parseFloat(t),left:(e,{left:t})=>parseFloat(t),bottom:({y:e},{top:t})=>parseFloat(t)+(e.max-e.min),right:({x:e},{left:t})=>parseFloat(t)+(e.max-e.min),x:(e,{transform:t})=>Yw(t,"x"),y:(e,{transform:t})=>Yw(t,"y")};tl.translateX=tl.x;tl.translateY=tl.y;const mc=new Set;let Qw=!1,Xw=!1,Jw=!1;function qM(){if(Xw){const e=Array.from(mc).filter(r=>r.needsMeasurement),t=new Set(e.map(r=>r.element)),n=new Map;t.forEach(r=>{const s=Cq(r);s.length&&(n.set(r,s),r.render())}),e.forEach(r=>r.measureInitialState()),t.forEach(r=>{r.render();const s=n.get(r);s&&s.forEach(([i,o])=>{var c;(c=r.getValue(i))==null||c.set(o)})}),e.forEach(r=>r.measureEndState()),e.forEach(r=>{r.suspendedScrollY!==void 0&&window.scrollTo(0,r.suspendedScrollY)})}Xw=!1,Qw=!1,mc.forEach(e=>e.complete(Jw)),mc.clear()}function YM(){mc.forEach(e=>{e.readKeyframes(),e.needsMeasurement&&(Xw=!0)})}function Pq(){Jw=!0,YM(),qM(),Jw=!1}class ax{constructor(t,n,r,s,i,o=!1){this.state="pending",this.isAsync=!1,this.needsMeasurement=!1,this.unresolvedKeyframes=[...t],this.onComplete=n,this.name=r,this.motionValue=s,this.element=i,this.isAsync=o}scheduleResolve(){this.state="scheduled",this.isAsync?(mc.add(this),Qw||(Qw=!0,yn.read(YM),yn.resolveKeyframes(qM))):(this.readKeyframes(),this.complete())}readKeyframes(){const{unresolvedKeyframes:t,name:n,element:r,motionValue:s}=this;if(t[0]===null){const i=s==null?void 0:s.get(),o=t[t.length-1];if(i!==void 0)t[0]=i;else if(r&&n){const c=r.readValue(n,o);c!=null&&(t[0]=c)}t[0]===void 0&&(t[0]=o),s&&i===void 0&&s.set(t[0])}_q(t)}setFinalKeyframe(){}measureInitialState(){}renderEndStyles(){}measureEndState(){}complete(t=!1){this.state="complete",this.onComplete(this.unresolvedKeyframes,this.finalKeyframe,t),mc.delete(this)}cancel(){this.state==="scheduled"&&(mc.delete(this),this.state="pending")}resume(){this.state==="pending"&&this.scheduleResolve()}}const Aq=e=>e.startsWith("--");function QM(e,t,n){Aq(t)?e.style.setProperty(t,n):e.style[t]=n}const Tq={};function XM(e,t){const n=kM(e);return()=>Tq[t]??n()}const Rq=XM(()=>window.ScrollTimeline!==void 0,"scrollTimeline"),JM=XM(()=>{try{document.createElement("div").animate({opacity:0},{easing:"linear(0, 1)"})}catch{return!1}return!0},"linearEasing"),zf=([e,t,n,r])=>`cubic-bezier(${e}, ${t}, ${n}, ${r})`,rP={linear:"linear",ease:"ease",easeIn:"ease-in",easeOut:"ease-out",easeInOut:"ease-in-out",circIn:zf([0,.65,.55,1]),circOut:zf([.55,0,1,.45]),backIn:zf([.31,.01,.66,-.59]),backOut:zf([.33,1.53,.69,.99])};function eN(e,t){if(e)return typeof e=="function"?JM()?WM(e,t):"ease-out":$M(e)?zf(e):Array.isArray(e)?e.map(n=>eN(n,t)||rP.easeOut):rP[e]}function Iq(e,t,n,{delay:r=0,duration:s=300,repeat:i=0,repeatType:o="loop",ease:c="easeOut",times:u}={},d=void 0){const f={[t]:n};u&&(f.offset=u);const p=eN(c,s);Array.isArray(p)&&(f.easing=p);const m={delay:r,duration:s,easing:Array.isArray(p)?"linear":p,fill:"both",iterations:i+1,direction:o==="reverse"?"alternate":"normal"};return d&&(m.pseudoElement=d),e.animate(f,m)}function tN(e){return typeof e=="function"&&"applyToOptions"in e}function Oq({type:e,...t}){return tN(e)&&JM()?e.applyToOptions(t):(t.duration??(t.duration=300),t.ease??(t.ease="easeOut"),t)}class nN extends ox{constructor(t){if(super(),this.finishedTime=null,this.isStopped=!1,this.manualStartTime=null,!t)return;const{element:n,name:r,keyframes:s,pseudoElement:i,allowFlatten:o=!1,finalKeyframe:c,onComplete:u}=t;this.isPseudoElement=!!i,this.allowFlatten=o,this.options=t,Dg(typeof t.type!="string");const d=Oq(t);this.animation=Iq(n,r,s,d,i),d.autoplay===!1&&this.animation.pause(),this.animation.onfinish=()=>{if(this.finishedTime=this.time,!i){const f=Fg(s,this.options,c,this.speed);this.updateMotionValue&&this.updateMotionValue(f),QM(n,r,f),this.animation.cancel()}u==null||u(),this.notifyFinished()}}play(){this.isStopped||(this.manualStartTime=null,this.animation.play(),this.state==="finished"&&this.updateFinished())}pause(){this.animation.pause()}complete(){var t,n;(n=(t=this.animation).finish)==null||n.call(t)}cancel(){try{this.animation.cancel()}catch{}}stop(){if(this.isStopped)return;this.isStopped=!0;const{state:t}=this;t==="idle"||t==="finished"||(this.updateMotionValue?this.updateMotionValue():this.commitStyles(),this.isPseudoElement||this.cancel())}commitStyles(){var n,r,s;const t=(n=this.options)==null?void 0:n.element;!this.isPseudoElement&&(t!=null&&t.isConnected)&&((s=(r=this.animation).commitStyles)==null||s.call(r))}get duration(){var n,r;const t=((r=(n=this.animation.effect)==null?void 0:n.getComputedTiming)==null?void 0:r.call(n).duration)||0;return hi(Number(t))}get iterationDuration(){const{delay:t=0}=this.options||{};return this.duration+hi(t)}get time(){return hi(Number(this.animation.currentTime)||0)}set time(t){const n=this.finishedTime!==null;this.manualStartTime=null,this.finishedTime=null,this.animation.currentTime=qs(t),n&&this.animation.pause()}get speed(){return this.animation.playbackRate}set speed(t){t<0&&(this.finishedTime=null),this.animation.playbackRate=t}get state(){return this.finishedTime!==null?"finished":this.animation.playState}get startTime(){return this.manualStartTime??Number(this.animation.startTime)}set startTime(t){this.manualStartTime=this.animation.startTime=t}attachTimeline({timeline:t,rangeStart:n,rangeEnd:r,observe:s}){var i;return this.allowFlatten&&((i=this.animation.effect)==null||i.updateTiming({easing:"linear"})),this.animation.onfinish=null,t&&Rq()?(this.animation.timeline=t,n&&(this.animation.rangeStart=n),r&&(this.animation.rangeEnd=r),gi):s(this)}}const rN={anticipate:OM,backInOut:IM,circInOut:NM};function Mq(e){return e in rN}function Nq(e){typeof e.ease=="string"&&Mq(e.ease)&&(e.ease=rN[e.ease])}const H1=10;class Lq extends nN{constructor(t){Nq(t),GM(t),super(t),t.startTime!==void 0&&t.autoplay!==!1&&(this.startTime=t.startTime),this.options=t}updateMotionValue(t){const{motionValue:n,onUpdate:r,onComplete:s,element:i,...o}=this.options;if(!n)return;if(t!==void 0){n.set(t);return}const c=new tg({...o,autoplay:!1}),u=Math.max(H1,ps.now()-this.startTime),d=wo(0,H1,u-H1),f=c.sample(u).value,{name:p}=this.options;i&&p&&QM(i,p,f),n.setWithVelocity(c.sample(Math.max(0,u-d)).value,f,d),c.stop()}}const sP=(e,t)=>t==="zIndex"?!1:!!(typeof e=="number"||Array.isArray(e)||typeof e=="string"&&(ji.test(e)||e==="0")&&!e.startsWith("url("));function $q(e){const t=e[0];if(e.length===1)return!0;for(let n=0;n<e.length;n++)if(e[n]!==t)return!0}function Dq(e,t,n,r){const s=e[0];if(s===null)return!1;if(t==="display"||t==="visibility")return!0;const i=e[e.length-1],o=sP(s,t),c=sP(i,t);return!o||!c?!1:$q(e)||(n==="spring"||tN(n))&&r}function e2(e){e.duration=0,e.type="keyframes"}const sN=new Set(["opacity","clipPath","filter","transform","backgroundColor"]),Fq=/^(?:oklch|oklab|lab|lch|color|color-mix|light-dark)\(/;function jq(e){for(let t=0;t<e.length;t++)if(typeof e[t]=="string"&&Fq.test(e[t]))return!0;return!1}const zq=new Set(["color","backgroundColor","outlineColor","fill","stroke","borderColor","borderTopColor","borderRightColor","borderBottomColor","borderLeftColor"]),Vq=kM(()=>Object.hasOwnProperty.call(Element.prototype,"animate"));function Hq(e){var p;const{motionValue:t,name:n,repeatDelay:r,repeatType:s,damping:i,type:o,keyframes:c}=e,u=(p=t==null?void 0:t.owner)==null?void 0:p.current;if(!(u instanceof HTMLElement)&&!(u instanceof SVGElement))return!1;const{onUpdate:d,transformTemplate:f}=t.owner.getProps();return Vq()&&n&&(sN.has(n)||zq.has(n)&&jq(c))&&(n!=="transform"||!f)&&!d&&!r&&s!=="mirror"&&i!==0&&o!=="inertia"}const Uq=40;class Zq extends ox{constructor({autoplay:t=!0,delay:n=0,type:r="keyframes",repeat:s=0,repeatDelay:i=0,repeatType:o="loop",keyframes:c,name:u,motionValue:d,element:f,...p}){var _;super(),this.stop=()=>{var w,b;this._animation&&(this._animation.stop(),(w=this.stopTimeline)==null||w.call(this)),(b=this.keyframeResolver)==null||b.cancel()},this.createdAt=ps.now();const m={autoplay:t,delay:n,type:r,repeat:s,repeatDelay:i,repeatType:o,name:u,motionValue:d,element:f,...p},v=(f==null?void 0:f.KeyframeResolver)||ax;this.keyframeResolver=new v(c,(w,b,S)=>this.onKeyframesResolved(w,b,m,!S),u,d,f),(_=this.keyframeResolver)==null||_.scheduleResolve()}onKeyframesResolved(t,n,r,s){var S,E;this.keyframeResolver=void 0;const{name:i,type:o,velocity:c,delay:u,isHandoff:d,onUpdate:f}=r;this.resolvedAt=ps.now();let p=!0;Dq(t,i,o,c)||(p=!1,(hl.instantAnimations||!u)&&(f==null||f(Fg(t,r,n))),t[0]=t[t.length-1],e2(r),r.repeat=0);const v={startTime:s?this.resolvedAt?this.resolvedAt-this.createdAt>Uq?this.resolvedAt:this.createdAt:this.createdAt:void 0,finalKeyframe:n,...r,keyframes:t},_=p&&!d&&Hq(v),w=(E=(S=v.motionValue)==null?void 0:S.owner)==null?void 0:E.current;let b;if(_)try{b=new Lq({...v,element:w})}catch{b=new tg(v)}else b=new tg(v);b.finished.then(()=>{this.notifyFinished()}).catch(gi),this.pendingTimeline&&(this.stopTimeline=b.attachTimeline(this.pendingTimeline),this.pendingTimeline=void 0),this._animation=b}get finished(){return this._animation?this.animation.finished:this._finished}then(t,n){return this.finished.finally(t).then(()=>{})}get animation(){var t;return this._animation||((t=this.keyframeResolver)==null||t.resume(),Pq()),this._animation}get duration(){return this.animation.duration}get iterationDuration(){return this.animation.iterationDuration}get time(){return this.animation.time}set time(t){this.animation.time=t}get speed(){return this.animation.speed}get state(){return this.animation.state}set speed(t){this.animation.speed=t}get startTime(){return this.animation.startTime}attachTimeline(t){return this._animation?this.stopTimeline=this.animation.attachTimeline(t):this.pendingTimeline=t,()=>this.stop()}play(){this.animation.play()}pause(){this.animation.pause()}complete(){this.animation.complete()}cancel(){var t;this._animation&&this.animation.cancel(),(t=this.keyframeResolver)==null||t.cancel()}}function iN(e,t,n,r=0,s=1){const i=Array.from(e).sort((d,f)=>d.sortNodePosition(f)).indexOf(t),o=e.size,c=(o-1)*r;return typeof n=="function"?n(i,o):s===1?i*r:c-i*r}const iP=30,Bq=e=>!isNaN(parseFloat(e));class Wq{constructor(t,n={}){this.canTrackVelocity=null,this.events={},this.updateAndNotify=r=>{var i;const s=ps.now();if(this.updatedAt!==s&&this.setPrevFrameValue(),this.prev=this.current,this.setCurrent(r),this.current!==this.prev&&((i=this.events.change)==null||i.notify(this.current),this.dependents))for(const o of this.dependents)o.dirty()},this.hasAnimated=!1,this.setCurrent(t),this.owner=n.owner}setCurrent(t){this.current=t,this.updatedAt=ps.now(),this.canTrackVelocity===null&&t!==void 0&&(this.canTrackVelocity=Bq(this.current))}setPrevFrameValue(t=this.current){this.prevFrameValue=t,this.prevUpdatedAt=this.updatedAt}onChange(t){return this.on("change",t)}on(t,n){this.events[t]||(this.events[t]=new Xb);const r=this.events[t].add(n);return t==="change"?()=>{r(),yn.read(()=>{this.events.change.getSize()||this.stop()})}:r}clearListeners(){for(const t in this.events)this.events[t].clear()}attach(t,n){this.passiveEffect=t,this.stopPassiveEffect=n}set(t){this.passiveEffect?this.passiveEffect(t,this.updateAndNotify):this.updateAndNotify(t)}setWithVelocity(t,n,r){this.set(n),this.prev=void 0,this.prevFrameValue=t,this.prevUpdatedAt=this.updatedAt-r}jump(t,n=!0){this.updateAndNotify(t),this.prev=t,this.prevUpdatedAt=this.prevFrameValue=void 0,n&&this.stop(),this.stopPassiveEffect&&this.stopPassiveEffect()}dirty(){var t;(t=this.events.change)==null||t.notify(this.current)}addDependent(t){this.dependents||(this.dependents=new Set),this.dependents.add(t)}removeDependent(t){this.dependents&&this.dependents.delete(t)}get(){return this.current}getPrevious(){return this.prev}getVelocity(){const t=ps.now();if(!this.canTrackVelocity||this.prevFrameValue===void 0||t-this.updatedAt>iP)return 0;const n=Math.min(this.updatedAt-this.prevUpdatedAt,iP);return CM(parseFloat(this.current)-parseFloat(this.prevFrameValue),n)}start(t){return this.stop(),new Promise(n=>{this.hasAnimated=!0,this.animation=t(n),this.events.animationStart&&this.events.animationStart.notify()}).then(()=>{this.events.animationComplete&&this.events.animationComplete.notify(),this.clearAnimation()})}stop(){this.animation&&(this.animation.stop(),this.events.animationCancel&&this.events.animationCancel.notify()),this.clearAnimation()}isAnimating(){return!!this.animation}clearAnimation(){delete this.animation}destroy(){var t,n;(t=this.dependents)==null||t.clear(),(n=this.events.destroy)==null||n.notify(),this.clearListeners(),this.stop(),this.stopPassiveEffect&&this.stopPassiveEffect()}}function md(e,t){return new Wq(e,t)}function lx(e,t){if(e!=null&&e.inherit&&t){const{inherit:n,...r}=e;return{...t,...r}}return e}function cx(e,t){const n=(e==null?void 0:e[t])??(e==null?void 0:e.default)??e;return n!==e?lx(n,e):n}const Kq={type:"spring",stiffness:500,damping:25,restSpeed:10},Gq=e=>({type:"spring",stiffness:550,damping:e===0?2*Math.sqrt(550):30,restSpeed:10}),qq={type:"keyframes",duration:.8},Yq={type:"keyframes",ease:[.25,.1,.35,1],duration:.3},Qq=(e,{keyframes:t})=>t.length>2?qq:Td.has(e)?e.startsWith("scale")?Gq(t[1]):Kq:Yq,Xq=new Set(["when","delay","delayChildren","staggerChildren","staggerDirection","repeat","repeatType","repeatDelay","from","elapsed"]);function Jq(e){for(const t in e)if(!Xq.has(t))return!0;return!1}const ux=(e,t,n,r={},s,i)=>o=>{const c=cx(r,e)||{},u=c.delay||r.delay||0;let{elapsed:d=0}=r;d=d-qs(u);const f={keyframes:Array.isArray(n)?n:[null,n],ease:"easeOut",velocity:t.getVelocity(),...c,delay:-d,onUpdate:m=>{t.set(m),c.onUpdate&&c.onUpdate(m)},onComplete:()=>{o(),c.onComplete&&c.onComplete()},name:e,motionValue:t,element:i?void 0:s};Jq(c)||Object.assign(f,Qq(e,f)),f.duration&&(f.duration=qs(f.duration)),f.repeatDelay&&(f.repeatDelay=qs(f.repeatDelay)),f.from!==void 0&&(f.keyframes[0]=f.from);let p=!1;if((f.type===!1||f.duration===0&&!f.repeatDelay)&&(e2(f),f.delay===0&&(p=!0)),(hl.instantAnimations||hl.skipAnimations||s!=null&&s.shouldSkipAnimations||c.skipAnimations)&&(p=!0,e2(f),f.delay=0),f.allowFlatten=!c.type&&!c.ease,p&&!i&&t.get()!==void 0){const m=Fg(f.keyframes,c);if(m!==void 0){yn.update(()=>{f.onUpdate(m),f.onComplete()});return}}return c.isSync?new tg(f):new Zq(f)},eY=/^var\(--(?:([\w-]+)|([\w-]+), ?([a-zA-Z\d ()%#.,-]+))\)/u;function tY(e){const t=eY.exec(e);if(!t)return[,];const[,n,r,s]=t;return[`--${n??r}`,s]}function oN(e,t,n=1){const[r,s]=tY(e);if(!r)return;const i=window.getComputedStyle(t).getPropertyValue(r);if(i){const o=i.trim();return xM(o)?parseFloat(o):o}return tx(s)?oN(s,t,n+1):s}function oP(e){const t=[{},{}];return e==null||e.values.forEach((n,r)=>{t[0][r]=n.get(),t[1][r]=n.getVelocity()}),t}function dx(e,t,n,r){if(typeof t=="function"){const[s,i]=oP(r);t=t(n!==void 0?n:e.custom,s,i)}if(typeof t=="string"&&(t=e.variants&&e.variants[t]),typeof t=="function"){const[s,i]=oP(r);t=t(n!==void 0?n:e.custom,s,i)}return t}function gc(e,t,n){const r=e.getProps();return dx(r,t,n!==void 0?n:r.custom,e)}const aN=new Set(["width","height","top","left","right","bottom",...Ad]),t2=e=>Array.isArray(e);function nY(e,t,n){e.hasValue(t)?e.getValue(t).set(n):e.addValue(t,md(n))}function rY(e){return t2(e)?e[e.length-1]||0:e}function sY(e,t){const n=gc(e,t);let{transitionEnd:r={},transition:s={},...i}=n||{};i={...i,...r};for(const o in i){const c=rY(i[o]);nY(e,o,c)}}const zr=e=>!!(e&&e.getVelocity);function iY(e){return!!(zr(e)&&e.add)}function n2(e,t){const n=e.getValue("willChange");if(iY(n))return n.add(t);if(!n&&hl.WillChange){const r=new hl.WillChange("auto");e.addValue("willChange",r),r.add(t)}}function fx(e){return e.replace(/([A-Z])/g,t=>`-${t.toLowerCase()}`)}const oY="framerAppearId",lN="data-"+fx(oY);function cN(e){return e.props[lN]}function aY({protectedKeys:e,needsAnimating:t},n){const r=e.hasOwnProperty(n)&&t[n]!==!0;return t[n]=!1,r}function uN(e,t,{delay:n=0,transitionOverride:r,type:s}={}){let{transition:i,transitionEnd:o,...c}=t;const u=e.getDefaultTransition();i=i?lx(i,u):u;const d=i==null?void 0:i.reduceMotion,f=i==null?void 0:i.skipAnimations;r&&(i=r);const p=[],m=s&&e.animationState&&e.animationState.getState()[s],v=i==null?void 0:i.path;v&&v.animateVisualElement(e,c,i,n,p);for(const _ in c){const w=e.getValue(_,e.latestValues[_]??null),b=c[_];if(b===void 0||m&&aY(m,_))continue;const S={delay:n,...cx(i||{},_)};f&&(S.skipAnimations=!0);const E=w.get();if(E!==void 0&&!w.isAnimating()&&!Array.isArray(b)&&b===E&&!S.velocity){yn.update(()=>w.set(b));continue}let C=!1;if(window.MotionHandoffAnimation){const M=cN(e);if(M){const O=window.MotionHandoffAnimation(M,_,yn);O!==null&&(S.startTime=O,C=!0)}}n2(e,_);const A=d??e.shouldReduceMotion;w.start(ux(_,w,b,A&&aN.has(_)?{type:!1}:S,e,C));const T=w.animation;T&&p.push(T)}if(o){const _=()=>yn.update(()=>{o&&sY(e,o)});p.length?Promise.all(p).then(_):_()}return p}function r2(e,t,n={}){var u;const r=gc(e,t,n.type==="exit"?(u=e.presenceContext)==null?void 0:u.custom:void 0);let{transition:s=e.getDefaultTransition()||{}}=r||{};n.transitionOverride&&(s=n.transitionOverride);const i=r?()=>Promise.all(uN(e,r,n)):()=>Promise.resolve(),o=e.variantChildren&&e.variantChildren.size?(d=0)=>{const{delayChildren:f=0,staggerChildren:p,staggerDirection:m}=s;return lY(e,t,d,f,p,m,n)}:()=>Promise.resolve(),{when:c}=s;if(c){const[d,f]=c==="beforeChildren"?[i,o]:[o,i];return d().then(()=>f())}else return Promise.all([i(),o(n.delay)])}function lY(e,t,n=0,r=0,s=0,i=1,o){const c=[];for(const u of e.variantChildren)u.notify("AnimationStart",t),c.push(r2(u,t,{...o,delay:n+(typeof r=="function"?0:r)+iN(e.variantChildren,u,r,s,i)}).then(()=>u.notify("AnimationComplete",t)));return Promise.all(c)}function cY(e,t,n={}){e.notify("AnimationStart",t);let r;if(Array.isArray(t)){const s=t.map(i=>r2(e,i,n));r=Promise.all(s)}else if(typeof t=="string")r=r2(e,t,n);else{const s=typeof t=="function"?gc(e,t,n.custom):t;r=Promise.all(uN(e,s,n))}return r.then(()=>{e.notify("AnimationComplete",t)})}const uY={test:e=>e==="auto",parse:e=>e},dN=e=>t=>t.test(e),fN=[Pd,Ge,vo,Zo,$G,LG,uY],aP=e=>fN.find(dN(e));function dY(e){return typeof e=="number"?e===0:e!==null?e==="none"||e==="0"||EM(e):!0}const fY=new Set(["brightness","contrast","saturate","opacity"]);function hY(e){const[t,n]=e.slice(0,-1).split("(");if(t==="drop-shadow")return e;const[r]=n.match(nx)||[];if(!r)return e;const s=n.replace(r,"");let i=fY.has(t)?1:0;return r!==n&&(i*=100),t+"("+i+s+")"}const pY=/\b([a-z-]*)\(.*?\)/gu,s2={...ji,getAnimatableNone:e=>{const t=e.match(pY);return t?t.map(hY).join(" "):e}},i2={...ji,getAnimatableNone:e=>{const t=ji.parse(e);return ji.createTransformer(e)(t.map(r=>typeof r=="number"?0:typeof r=="object"?{...r,alpha:1}:r))}},lP={...Pd,transform:Math.round},mY={rotate:Zo,pathRotation:Zo,rotateX:Zo,rotateY:Zo,rotateZ:Zo,scale:wm,scaleX:wm,scaleY:wm,scaleZ:wm,skew:Zo,skewX:Zo,skewY:Zo,distance:Ge,translateX:Ge,translateY:Ge,translateZ:Ge,x:Ge,y:Ge,z:Ge,perspective:Ge,transformPerspective:Ge,opacity:Sh,originX:G8,originY:G8,originZ:Ge},ng={borderWidth:Ge,borderTopWidth:Ge,borderRightWidth:Ge,borderBottomWidth:Ge,borderLeftWidth:Ge,borderRadius:Ge,borderTopLeftRadius:Ge,borderTopRightRadius:Ge,borderBottomRightRadius:Ge,borderBottomLeftRadius:Ge,width:Ge,maxWidth:Ge,height:Ge,maxHeight:Ge,top:Ge,right:Ge,bottom:Ge,left:Ge,inset:Ge,insetBlock:Ge,insetBlockStart:Ge,insetBlockEnd:Ge,insetInline:Ge,insetInlineStart:Ge,insetInlineEnd:Ge,padding:Ge,paddingTop:Ge,paddingRight:Ge,paddingBottom:Ge,paddingLeft:Ge,paddingBlock:Ge,paddingBlockStart:Ge,paddingBlockEnd:Ge,paddingInline:Ge,paddingInlineStart:Ge,paddingInlineEnd:Ge,margin:Ge,marginTop:Ge,marginRight:Ge,marginBottom:Ge,marginLeft:Ge,marginBlock:Ge,marginBlockStart:Ge,marginBlockEnd:Ge,marginInline:Ge,marginInlineStart:Ge,marginInlineEnd:Ge,fontSize:Ge,backgroundPositionX:Ge,backgroundPositionY:Ge,...mY,zIndex:lP,fillOpacity:Sh,strokeOpacity:Sh,numOctaves:lP},gY={...ng,color:sr,backgroundColor:sr,outlineColor:sr,fill:sr,stroke:sr,borderColor:sr,borderTopColor:sr,borderRightColor:sr,borderBottomColor:sr,borderLeftColor:sr,filter:s2,WebkitFilter:s2,mask:i2,WebkitMask:i2},hN=e=>gY[e],vY=new Set([s2,i2]);function pN(e,t){let n=hN(e);return vY.has(n)||(n=ji),n.getAnimatableNone?n.getAnimatableNone(t):void 0}const yY=new Set(["auto","none","0"]);function _Y(e,t,n){let r=0,s;for(;r<e.length&&!s;){const i=e[r];typeof i=="string"&&!yY.has(i)&&pd(i).values.length&&(s=e[r]),r++}if(s&&n)for(const i of t)e[i]=pN(n,s)}class wY extends ax{constructor(t,n,r,s,i){super(t,n,r,s,i,!0)}readKeyframes(){const{unresolvedKeyframes:t,element:n,name:r}=this;if(!n||!n.current)return;super.readKeyframes();for(let f=0;f<t.length;f++){let p=t[f];if(typeof p=="string"&&(p=p.trim(),tx(p))){const m=oN(p,n.current);m!==void 0&&(t[f]=m),f===t.length-1&&(this.finalKeyframe=p)}}if(this.resolveNoneKeyframes(),!aN.has(r)||t.length!==2)return;const[s,i]=t,o=aP(s),c=aP(i),u=K8(s),d=K8(i);if(u!==d&&tl[r]){this.needsMeasurement=!0;return}if(o!==c)if(nP(o)&&nP(c))for(let f=0;f<t.length;f++){const p=t[f];typeof p=="string"&&(t[f]=parseFloat(p))}else tl[r]&&(this.needsMeasurement=!0)}resolveNoneKeyframes(){const{unresolvedKeyframes:t,name:n}=this,r=[];for(let s=0;s<t.length;s++)(t[s]===null||dY(t[s]))&&r.push(s);r.length&&_Y(t,r,n)}measureInitialState(){const{element:t,unresolvedKeyframes:n,name:r}=this;if(!t||!t.current)return;r==="height"&&(this.suspendedScrollY=window.pageYOffset),this.measuredOrigin=tl[r](t.measureViewportBox(),window.getComputedStyle(t.current)),n[0]=this.measuredOrigin;const s=n[n.length-1];s!==void 0&&t.getValue(r,s).jump(s,!1)}measureEndState(){var c;const{element:t,name:n,unresolvedKeyframes:r}=this;if(!t||!t.current)return;const s=t.getValue(n);s&&s.jump(this.measuredOrigin,!1);const i=r.length-1,o=r[i];r[i]=tl[n](t.measureViewportBox(),window.getComputedStyle(t.current)),o!==null&&this.finalKeyframe===void 0&&(this.finalKeyframe=o),(c=this.removedTransforms)!=null&&c.length&&this.removedTransforms.forEach(([u,d])=>{t.getValue(u).set(d)}),this.resolveNoneKeyframes()}}const hx=["borderTopLeftRadius","borderTopRightRadius","borderBottomRightRadius","borderBottomLeftRadius"];function mN(e,t,n){if(e==null)return[];if(e instanceof EventTarget)return[e];if(typeof e=="string"){let r=document;const s=(n==null?void 0:n[e])??r.querySelectorAll(e);return s?Array.from(s):[]}return Array.from(e).filter(r=>r!=null)}const o2=(e,t)=>t&&typeof e=="number"?t.transform(e):e;function e0(e){return SM(e)&&"offsetHeight"in e&&!("ownerSVGElement"in e)}const{schedule:px}=DM(queueMicrotask,!1),Oi={x:!1,y:!1};function gN(){return Oi.x||Oi.y}function bY(e){return e==="x"||e==="y"?Oi[e]?null:(Oi[e]=!0,()=>{Oi[e]=!1}):Oi.x||Oi.y?null:(Oi.x=Oi.y=!0,()=>{Oi.x=Oi.y=!1})}function vN(e,t){const n=mN(e),r=new AbortController,s={passive:!0,...t,signal:r.signal};return[n,s,()=>r.abort()]}function xY(e){return!(e.pointerType==="touch"||gN())}function SY(e,t,n={}){const[r,s,i]=vN(e,n);return r.forEach(o=>{let c=!1,u=!1,d;const f=()=>{o.removeEventListener("pointerleave",_)},p=b=>{d&&(d(b),d=void 0),f()},m=b=>{c=!1,window.removeEventListener("pointerup",m),window.removeEventListener("pointercancel",m),u&&(u=!1,p(b))},v=()=>{c=!0,window.addEventListener("pointerup",m,s),window.addEventListener("pointercancel",m,s)},_=b=>{if(b.pointerType!=="touch"){if(c){u=!0;return}p(b)}},w=b=>{if(!xY(b))return;u=!1;const S=t(o,b);typeof S=="function"&&(d=S,o.addEventListener("pointerleave",_,s))};o.addEventListener("pointerenter",w,s),o.addEventListener("pointerdown",v,s)}),i}const yN=(e,t)=>t?e===t?!0:yN(e,t.parentElement):!1,mx=e=>e.pointerType==="mouse"?typeof e.button!="number"||e.button<=0:e.isPrimary!==!1,EY=new Set(["BUTTON","INPUT","SELECT","TEXTAREA","A"]);function kY(e){return EY.has(e.tagName)||e.isContentEditable===!0}const CY=new Set(["INPUT","SELECT","TEXTAREA"]);function PY(e){return CY.has(e.tagName)||e.isContentEditable===!0}const t0=new WeakSet;function cP(e){return t=>{t.key==="Enter"&&e(t)}}function U1(e,t){e.dispatchEvent(new PointerEvent("pointer"+t,{isPrimary:!0,bubbles:!0}))}const AY=(e,t)=>{const n=e.currentTarget;if(!n)return;const r=cP(()=>{if(t0.has(n))return;U1(n,"down");const s=cP(()=>{U1(n,"up")}),i=()=>U1(n,"cancel");n.addEventListener("keyup",s,t),n.addEventListener("blur",i,t)});n.addEventListener("keydown",r,t),n.addEventListener("blur",()=>n.removeEventListener("keydown",r),t)};function uP(e){return mx(e)&&!gN()}const dP=new WeakSet;function TY(e,t,n={}){const[r,s,i]=vN(e,n),o=c=>{const u=c.currentTarget;if(!uP(c)||dP.has(c))return;t0.add(u),n.stopPropagation&&dP.add(c);const d=t(u,c),f={...s,capture:!0},p=(_,w)=>{window.removeEventListener("pointerup",m,f),window.removeEventListener("pointercancel",v,f),t0.has(u)&&t0.delete(u),uP(_)&&typeof d=="function"&&d(_,{success:w})},m=_=>{p(_,u===window||u===document||n.useGlobalTarget||yN(u,_.target))},v=_=>{p(_,!1)};window.addEventListener("pointerup",m,f),window.addEventListener("pointercancel",v,f)};return r.forEach(c=>{(n.useGlobalTarget?window:c).addEventListener("pointerdown",o,s),e0(c)&&(c.addEventListener("focus",d=>AY(d,s)),!kY(c)&&!c.hasAttribute("tabindex")&&(c.tabIndex=0))}),i}function gx(e){return SM(e)&&"ownerSVGElement"in e}const n0=new WeakMap;let Fa;const _N=(e,t,n)=>(r,s)=>s&&s[0]?s[0][e+"Size"]:gx(r)&&"getBBox"in r?r.getBBox()[t]:r[n],RY=_N("inline","width","offsetWidth"),IY=_N("block","height","offsetHeight");function OY({target:e,borderBoxSize:t}){var n;(n=n0.get(e))==null||n.forEach(r=>{r(e,{get width(){return RY(e,t)},get height(){return IY(e,t)}})})}function MY(e){e.forEach(OY)}function NY(){typeof ResizeObserver>"u"||(Fa=new ResizeObserver(MY))}function LY(e,t){Fa||NY();const n=mN(e);return n.forEach(r=>{let s=n0.get(r);s||(s=new Set,n0.set(r,s)),s.add(t),Fa==null||Fa.observe(r)}),()=>{n.forEach(r=>{const s=n0.get(r);s==null||s.delete(t),s!=null&&s.size||Fa==null||Fa.unobserve(r)})}}const r0=new Set;let Pu;function $Y(){Pu=()=>{const e={get width(){return window.innerWidth},get height(){return window.innerHeight}};r0.forEach(t=>t(e))},window.addEventListener("resize",Pu)}function DY(e){return r0.add(e),Pu||$Y(),()=>{r0.delete(e),!r0.size&&typeof Pu=="function"&&(window.removeEventListener("resize",Pu),Pu=void 0)}}function fP(e,t){return typeof e=="function"?DY(e):LY(e,t)}function FY(e){return gx(e)&&e.tagName==="svg"}const jY=[...fN,sr,ji],zY=e=>jY.find(dN(e)),hP=()=>({translate:0,scale:1,origin:0,originPoint:0}),Au=()=>({x:hP(),y:hP()}),pP=()=>({min:0,max:0}),pr=()=>({x:pP(),y:pP()}),VY=new WeakMap;function jg(e){return e!==null&&typeof e=="object"&&typeof e.start=="function"}function Eh(e){return typeof e=="string"||Array.isArray(e)}const vx=["animate","whileInView","whileFocus","whileHover","whileTap","whileDrag","exit"],yx=["initial",...vx];function zg(e){return jg(e.animate)||yx.some(t=>Eh(e[t]))}function wN(e){return!!(zg(e)||e.variants)}function HY(e,t,n){for(const r in t){const s=t[r],i=n[r];if(zr(s))e.addValue(r,s);else if(zr(i))e.addValue(r,md(s,{owner:e}));else if(i!==s)if(e.hasValue(r)){const o=e.getValue(r);o.liveStyle===!0?o.jump(s):o.hasAnimated||o.set(s)}else{const o=e.getStaticValue(r);e.addValue(r,md(o!==void 0?o:s,{owner:e}))}}for(const r in n)t[r]===void 0&&e.removeValue(r);return t}const rg={current:null},_x={current:!1},UY=typeof window<"u";function bN(){if(_x.current=!0,!!UY)if(window.matchMedia){const e=window.matchMedia("(prefers-reduced-motion)"),t=()=>rg.current=e.matches;e.addEventListener("change",t),t()}else rg.current=!1}const mP=["AnimationStart","AnimationComplete","Update","BeforeLayoutMeasure","LayoutMeasure","LayoutAnimationStart","LayoutAnimationComplete"];let sg={};function xN(e){sg=e}function ZY(){return sg}class BY{scrapeMotionValuesFromProps(t,n,r){return{}}constructor({parent:t,props:n,presenceContext:r,reducedMotionConfig:s,skipAnimations:i,blockInitialAnimation:o,visualState:c},u={}){this.current=null,this.children=new Set,this.isVariantNode=!1,this.isControllingVariants=!1,this.shouldReduceMotion=null,this.shouldSkipAnimations=!1,this.values=new Map,this.KeyframeResolver=ax,this.features={},this.valueSubscriptions=new Map,this.prevMotionValues={},this.hasBeenMounted=!1,this.events={},this.propEventSubscriptions={},this.notifyUpdate=()=>this.notify("Update",this.latestValues),this.render=()=>{this.current&&(this.triggerBuild(),this.renderInstance(this.current,this.renderState,this.props.style,this.projection))},this.renderScheduledAt=0,this.scheduleRender=()=>{const v=ps.now();this.renderScheduledAt<v&&(this.renderScheduledAt=v,yn.render(this.render,!1,!0))};const{latestValues:d,renderState:f}=c;this.latestValues=d,this.baseTarget={...d},this.initialValues=n.initial?{...d}:{},this.renderState=f,this.parent=t,this.props=n,this.presenceContext=r,this.depth=t?t.depth+1:0,this.reducedMotionConfig=s,this.skipAnimationsConfig=i,this.options=u,this.blockInitialAnimation=!!o,this.isControllingVariants=zg(n),this.isVariantNode=wN(n),this.isVariantNode&&(this.variantChildren=new Set),this.manuallyAnimateOnMount=!!(t&&t.current);const{willChange:p,...m}=this.scrapeMotionValuesFromProps(n,{},this);for(const v in m){const _=m[v];d[v]!==void 0&&zr(_)&&_.set(d[v])}}mount(t){var n,r;if(this.hasBeenMounted)for(const s in this.initialValues)(n=this.values.get(s))==null||n.jump(this.initialValues[s]),this.latestValues[s]=this.initialValues[s];this.current=t,VY.set(t,this),this.projection&&!this.projection.instance&&this.projection.mount(t),this.parent&&this.isVariantNode&&!this.isControllingVariants&&(this.removeFromVariantTree=this.parent.addVariantChild(this)),this.values.forEach((s,i)=>this.bindToMotionValue(i,s)),this.reducedMotionConfig==="never"?this.shouldReduceMotion=!1:this.reducedMotionConfig==="always"?this.shouldReduceMotion=!0:(_x.current||bN(),this.shouldReduceMotion=rg.current),this.shouldSkipAnimations=this.skipAnimationsConfig??!1,(r=this.parent)==null||r.addChild(this),this.update(this.props,this.presenceContext),this.hasBeenMounted=!0}unmount(){var t;this.projection&&this.projection.unmount(),pl(this.notifyUpdate),pl(this.render),this.valueSubscriptions.forEach(n=>n()),this.valueSubscriptions.clear(),this.removeFromVariantTree&&this.removeFromVariantTree(),(t=this.parent)==null||t.removeChild(this);for(const n in this.events)this.events[n].clear();for(const n in this.features){const r=this.features[n];r&&(r.unmount(),r.isMounted=!1)}this.current=null}addChild(t){this.children.add(t),this.enteringChildren??(this.enteringChildren=new Set),this.enteringChildren.add(t)}removeChild(t){this.children.delete(t),this.enteringChildren&&this.enteringChildren.delete(t)}bindToMotionValue(t,n){if(this.valueSubscriptions.has(t)&&this.valueSubscriptions.get(t)(),n.accelerate&&sN.has(t)&&this.current instanceof HTMLElement){const{factory:o,keyframes:c,times:u,ease:d,duration:f}=n.accelerate,p=new nN({element:this.current,name:t,keyframes:c,times:u,ease:d,duration:qs(f)}),m=o(p);this.valueSubscriptions.set(t,()=>{m(),p.cancel()});return}const r=Td.has(t);r&&this.onBindTransform&&this.onBindTransform();const s=n.on("change",o=>{this.latestValues[t]=o,this.props.onUpdate&&yn.preRender(this.notifyUpdate),r&&this.projection&&(this.projection.isTransformDirty=!0),this.scheduleRender()});let i;typeof window<"u"&&window.MotionCheckAppearSync&&(i=window.MotionCheckAppearSync(this,t,n)),this.valueSubscriptions.set(t,()=>{s(),i&&i()})}sortNodePosition(t){return!this.current||!this.sortInstanceNodePosition||this.type!==t.type?0:this.sortInstanceNodePosition(this.current,t.current)}updateFeatures(){let t="animation";for(t in sg){const n=sg[t];if(!n)continue;const{isEnabled:r,Feature:s}=n;if(!this.features[t]&&s&&r(this.props)&&(this.features[t]=new s(this)),this.features[t]){const i=this.features[t];i.isMounted?i.update():(i.mount(),i.isMounted=!0)}}}triggerBuild(){this.build(this.renderState,this.latestValues,this.props)}measureViewportBox(){return this.current?this.measureInstanceViewportBox(this.current,this.props):pr()}getStaticValue(t){return this.latestValues[t]}setStaticValue(t,n){this.latestValues[t]=n}update(t,n){(t.transformTemplate||this.props.transformTemplate)&&this.scheduleRender(),this.prevProps=this.props,this.props=t,this.prevPresenceContext=this.presenceContext,this.presenceContext=n;for(let r=0;r<mP.length;r++){const s=mP[r];this.propEventSubscriptions[s]&&(this.propEventSubscriptions[s](),delete this.propEventSubscriptions[s]);const i="on"+s,o=t[i];o&&(this.propEventSubscriptions[s]=this.on(s,o))}this.prevMotionValues=HY(this,this.scrapeMotionValuesFromProps(t,this.prevProps||{},this),this.prevMotionValues),this.handleChildMotionValue&&this.handleChildMotionValue()}getProps(){return this.props}getVariant(t){return this.props.variants?this.props.variants[t]:void 0}getDefaultTransition(){return this.props.transition}getTransformPagePoint(){return this.props.transformPagePoint}getClosestVariantNode(){return this.isVariantNode?this:this.parent?this.parent.getClosestVariantNode():void 0}addVariantChild(t){const n=this.getClosestVariantNode();if(n)return n.variantChildren&&n.variantChildren.add(t),()=>n.variantChildren.delete(t)}addValue(t,n){const r=this.values.get(t);n!==r&&(r&&this.removeValue(t),this.bindToMotionValue(t,n),this.values.set(t,n),this.latestValues[t]=n.get())}removeValue(t){this.values.delete(t);const n=this.valueSubscriptions.get(t);n&&(n(),this.valueSubscriptions.delete(t)),delete this.latestValues[t],this.removeValueFromRenderState(t,this.renderState)}hasValue(t){return this.values.has(t)}getValue(t,n){if(this.props.values&&this.props.values[t])return this.props.values[t];let r=this.values.get(t);return r===void 0&&n!==void 0&&(r=md(n===null?void 0:n,{owner:this}),this.addValue(t,r)),r}readValue(t,n){let r=this.latestValues[t]!==void 0||!this.current?this.latestValues[t]:this.getBaseTargetFromProps(this.props,t)??this.readValueFromInstance(this.current,t,this.options);return r!=null&&(typeof r=="string"&&(xM(r)||EM(r))?r=parseFloat(r):!zY(r)&&ji.test(n)&&(r=pN(t,n)),this.setBaseTarget(t,zr(r)?r.get():r)),zr(r)?r.get():r}setBaseTarget(t,n){this.baseTarget[t]=n}getBaseTarget(t){var i;const{initial:n}=this.props;let r;if(typeof n=="string"||typeof n=="object"){const o=dx(this.props,n,(i=this.presenceContext)==null?void 0:i.custom);o&&(r=o[t])}if(n&&r!==void 0)return r;const s=this.getBaseTargetFromProps(this.props,t);return s!==void 0&&!zr(s)?s:this.initialValues[t]!==void 0&&r===void 0?void 0:this.baseTarget[t]}on(t,n){return this.events[t]||(this.events[t]=new Xb),this.events[t].add(n)}notify(t,...n){this.events[t]&&this.events[t].notify(...n)}scheduleRenderMicrotask(){px.render(this.render)}}class SN extends BY{constructor(){super(...arguments),this.KeyframeResolver=wY}sortInstanceNodePosition(t,n){return t.compareDocumentPosition(n)&2?1:-1}getBaseTargetFromProps(t,n){const r=t.style;return r?r[n]:void 0}removeValueFromRenderState(t,{vars:n,style:r}){delete n[t],delete r[t]}handleChildMotionValue(){this.childSubscription&&(this.childSubscription(),delete this.childSubscription);const{children:t}=this.props;zr(t)&&(this.childSubscription=t.on("change",n=>{this.current&&(this.current.textContent=`${n}`)}))}}class _l{constructor(t){this.isMounted=!1,this.node=t}update(){}}function EN({top:e,left:t,right:n,bottom:r}){return{x:{min:t,max:n},y:{min:e,max:r}}}function WY({x:e,y:t}){return{top:t.min,right:e.max,bottom:t.max,left:e.min}}function KY(e,t){if(!t)return e;const n=t({x:e.left,y:e.top}),r=t({x:e.right,y:e.bottom});return{top:n.y,left:n.x,bottom:r.y,right:r.x}}function Z1(e){return e===void 0||e===1}function a2({scale:e,scaleX:t,scaleY:n}){return!Z1(e)||!Z1(t)||!Z1(n)}function Ql(e){return a2(e)||kN(e)||e.z||e.rotate||e.rotateX||e.rotateY||e.skewX||e.skewY}function kN(e){return gP(e.x)||gP(e.y)}function gP(e){return e&&e!=="0%"}function ig(e,t,n){const r=e-n,s=t*r;return n+s}function vP(e,t,n,r,s){return s!==void 0&&(e=ig(e,s,r)),ig(e,n,r)+t}function l2(e,t=0,n=1,r,s){e.min=vP(e.min,t,n,r,s),e.max=vP(e.max,t,n,r,s)}function CN(e,{x:t,y:n}){l2(e.x,t.translate,t.scale,t.originPoint),l2(e.y,n.translate,n.scale,n.originPoint)}const yP=.999999999999,_P=1.0000000000001;function GY(e,t,n,r=!1){var c;const s=n.length;if(!s)return;t.x=t.y=1;let i,o;for(let u=0;u<s;u++){i=n[u],o=i.projectionDelta;const{visualElement:d}=i.options;d&&d.props.style&&d.props.style.display==="contents"||(r&&i.options.layoutScroll&&i.scroll&&i!==i.root&&(uo(e.x,-i.scroll.offset.x),uo(e.y,-i.scroll.offset.y)),o&&(t.x*=o.x.scale,t.y*=o.y.scale,CN(e,o)),r&&Ql(i.latestValues)&&s0(e,i.latestValues,(c=i.layout)==null?void 0:c.layoutBox))}t.x<_P&&t.x>yP&&(t.x=1),t.y<_P&&t.y>yP&&(t.y=1)}function uo(e,t){e.min+=t,e.max+=t}function wP(e,t,n,r,s=.5){const i=vn(e.min,e.max,s);l2(e,t,n,i,r)}function bP(e,t){return typeof e=="string"?parseFloat(e)/100*(t.max-t.min):e}function s0(e,t,n){const r=n??e;wP(e.x,bP(t.x,r.x),t.scaleX,t.scale,t.originX),wP(e.y,bP(t.y,r.y),t.scaleY,t.scale,t.originY)}function PN(e,t){return EN(KY(e.getBoundingClientRect(),t))}function qY(e,t,n){const r=PN(e,n),{scroll:s}=t;return s&&(uo(r.x,s.offset.x),uo(r.y,s.offset.y)),r}const YY={x:"translateX",y:"translateY",z:"translateZ",transformPerspective:"perspective"},QY=Ad.length;function XY(e,t,n){let r="",s=!0;for(let o=0;o<QY;o++){const c=Ad[o],u=e[c];if(u===void 0)continue;let d=!0;if(typeof u=="number")d=u===(c.startsWith("scale")?1:0);else{const f=parseFloat(u);d=c.startsWith("scale")?f===1:f===0}if(!d||n){const f=o2(u,ng[c]);if(!d){s=!1;const p=YY[c]||c;r+=`${p}(${f}) `}n&&(t[c]=f)}}const i=e.pathRotation;return i&&(s=!1,r+=`rotate(${o2(i,ng.pathRotation)}) `),r=r.trim(),n?r=n(t,s?"":r):s&&(r="none"),r}function wx(e,t,n){const{style:r,vars:s,transformOrigin:i}=e;let o=!1,c=!1;for(const u in t){const d=t[u];if(Td.has(u)){o=!0;continue}else if(jM(u)){s[u]=d;continue}else{const f=o2(d,ng[u]);u.startsWith("origin")?(c=!0,i[u]=f):r[u]=f}}if(t.transform||(o||n?r.transform=XY(t,e.transform,n):r.transform&&(r.transform="none")),c){const{originX:u="50%",originY:d="50%",originZ:f=0}=i;r.transformOrigin=`${u} ${d} ${f}`}}function AN(e,{style:t,vars:n},r,s){const i=e.style;let o;for(o in t)i[o]=t[o];s==null||s.applyProjectionStyles(i,r);for(o in n)i.setProperty(o,n[o])}function xP(e,t){return t.max===t.min?0:e/(t.max-t.min)*100}const Ef={correct:(e,t)=>{if(!t.target)return e;if(typeof e=="string")if(Ge.test(e))e=parseFloat(e);else return e;const n=xP(e,t.target.x),r=xP(e,t.target.y);return`${n}% ${r}%`}},JY={correct:(e,{treeScale:t,projectionDelta:n})=>{const r=e,s=ji.parse(e);if(s.length>5)return r;const i=ji.createTransformer(e),o=typeof s[0]!="number"?1:0,c=n.x.scale*t.x,u=n.y.scale*t.y;s[0+o]/=c,s[1+o]/=u;const d=vn(c,u,.5);return typeof s[2+o]=="number"&&(s[2+o]/=d),typeof s[3+o]=="number"&&(s[3+o]/=d),i(s)}},c2={borderRadius:{...Ef,applyTo:[...hx]},borderTopLeftRadius:Ef,borderTopRightRadius:Ef,borderBottomLeftRadius:Ef,borderBottomRightRadius:Ef,boxShadow:JY};function TN(e,{layout:t,layoutId:n}){return Td.has(e)||e.startsWith("origin")||(t||n!==void 0)&&(!!c2[e]||e==="opacity")}function bx(e,t,n){var o;const r=e.style,s=t==null?void 0:t.style,i={};if(!r)return i;for(const c in r)(zr(r[c])||s&&zr(s[c])||TN(c,e)||((o=n==null?void 0:n.getValue(c))==null?void 0:o.liveStyle)!==void 0)&&(i[c]=r[c]);return i}function eQ(e){return window.getComputedStyle(e)}class tQ extends SN{constructor(){super(...arguments),this.type="html",this.renderInstance=AN}mount(t){Dg(!!t.style),super.mount(t)}readValueFromInstance(t,n){var r;if(Td.has(n))return(r=this.projection)!=null&&r.isProjecting?qw(n):xq(t,n);{const s=eQ(t),i=(jM(n)?s.getPropertyValue(n):s[n])||0;return typeof i=="string"?i.trim():i}}measureInstanceViewportBox(t,{transformPagePoint:n}){return PN(t,n)}build(t,n,r){wx(t,n,r.transformTemplate)}scrapeMotionValuesFromProps(t,n,r){return bx(t,n,r)}}const nQ={offset:"stroke-dashoffset",array:"stroke-dasharray"},rQ={offset:"strokeDashoffset",array:"strokeDasharray"};function sQ(e,t,n=1,r=0,s=!0){e.pathLength=1;const i=s?nQ:rQ;e[i.offset]=`${-r}`,e[i.array]=`${t} ${n}`}const iQ=["offsetDistance","offsetPath","offsetRotate","offsetAnchor"];function RN(e,{attrX:t,attrY:n,attrScale:r,pathLength:s,pathSpacing:i=1,pathOffset:o=0,...c},u,d,f){if(wx(e,c,d),u){e.style.viewBox&&(e.attrs.viewBox=e.style.viewBox);return}e.attrs=e.style,e.style={};const{attrs:p,style:m}=e;p.transform&&(m.transform=p.transform,delete p.transform),(m.transform||p.transformOrigin)&&(m.transformOrigin=p.transformOrigin??"50% 50%",delete p.transformOrigin),m.transform&&(m.transformBox=(f==null?void 0:f.transformBox)??"fill-box",delete p.transformBox);for(const v of iQ)p[v]!==void 0&&(m[v]=p[v],delete p[v]);t!==void 0&&(p.x=t),n!==void 0&&(p.y=n),r!==void 0&&(p.scale=r),s!==void 0&&sQ(p,s,i,o,!1)}const IN=new Set(["baseFrequency","diffuseConstant","kernelMatrix","kernelUnitLength","keySplines","keyTimes","limitingConeAngle","markerHeight","markerWidth","numOctaves","targetX","targetY","surfaceScale","specularConstant","specularExponent","stdDeviation","tableValues","viewBox","gradientTransform","pathLength","startOffset","textLength","lengthAdjust"]),ON=e=>typeof e=="string"&&e.toLowerCase()==="svg";function oQ(e,t,n,r){AN(e,t,void 0,r);for(const s in t.attrs)e.setAttribute(IN.has(s)?s:fx(s),t.attrs[s])}function MN(e,t,n){const r=bx(e,t,n);for(const s in e)if(zr(e[s])||zr(t[s])){const i=Ad.indexOf(s)!==-1?"attr"+s.charAt(0).toUpperCase()+s.substring(1):s;r[i]=e[s]}return r}class aQ extends SN{constructor(){super(...arguments),this.type="svg",this.isSVGTag=!1,this.measureInstanceViewportBox=pr}getBaseTargetFromProps(t,n){return t[n]}readValueFromInstance(t,n){if(Td.has(n)){const r=hN(n);return r&&r.default||0}return n=IN.has(n)?n:fx(n),t.getAttribute(n)}scrapeMotionValuesFromProps(t,n,r){return MN(t,n,r)}build(t,n,r){RN(t,n,this.isSVGTag,r.transformTemplate,r.style)}renderInstance(t,n,r,s){oQ(t,n,r,s)}mount(t){this.isSVGTag=ON(t.tagName),super.mount(t)}}const lQ=yx.length;function NN(e){if(!e)return;if(!e.isControllingVariants){const n=e.parent?NN(e.parent)||{}:{};return e.props.initial!==void 0&&(n.initial=e.props.initial),n}const t={};for(let n=0;n<lQ;n++){const r=yx[n],s=e.props[r];(Eh(s)||s===!1)&&(t[r]=s)}return t}function LN(e,t){if(!Array.isArray(t))return!1;const n=t.length;if(n!==e.length)return!1;for(let r=0;r<n;r++)if(t[r]!==e[r])return!1;return!0}const cQ=[...vx].reverse(),uQ=vx.length;function dQ(e){return t=>Promise.all(t.map(({animation:n,options:r})=>cY(e,n,r)))}function fQ(e){let t=dQ(e),n=SP(),r=!0,s=!1;const i=d=>(f,p)=>{var v;const m=gc(e,p,d==="exit"?(v=e.presenceContext)==null?void 0:v.custom:void 0);if(m){const{transition:_,transitionEnd:w,...b}=m;f={...f,...b,...w}}return f};function o(d){t=d(e)}function c(d){const{props:f}=e,p=NN(e.parent)||{},m=[],v=new Set;let _={},w=1/0;for(let S=0;S<uQ;S++){const E=cQ[S],C=n[E],A=f[E]!==void 0?f[E]:p[E],T=Eh(A),M=E===d?C.isActive:null;M===!1&&(w=S);let O=A===p[E]&&A!==f[E]&&T;if(O&&(r||s)&&e.manuallyAnimateOnMount&&(O=!1),C.protectedKeys={..._},!C.isActive&&M===null||!A&&!C.prevProp||jg(A)||typeof A=="boolean")continue;if(E==="exit"&&C.isActive&&M!==!0){C.prevResolvedValues&&(_={..._,...C.prevResolvedValues});continue}const R=hQ(C.prevProp,A);let D=R||E===d&&C.isActive&&!O&&T||S>w&&T,U=!1;const W=Array.isArray(A)?A:[A];let H=W.reduce(i(E),{});M===!1&&(H={});const{prevResolvedValues:Y={}}=C,J={...Y,...H},V=F=>{D=!0,v.has(F)&&(U=!0,v.delete(F)),C.needsAnimating[F]=!0;const X=e.getValue(F);X&&(X.liveStyle=!1)};for(const F in J){const X=H[F],B=Y[F];if(_.hasOwnProperty(F))continue;let L=!1;t2(X)&&t2(B)?L=!LN(X,B)||R:L=X!==B,L?X!=null?V(F):v.add(F):X!==void 0&&v.has(F)?V(F):C.protectedKeys[F]=!0}C.prevProp=A,C.prevResolvedValues=H,C.isActive&&(_={..._,...H}),(r||s)&&e.blockInitialAnimation&&(D=!1);const q=O&&R;D&&(!q||U)&&m.push(...W.map(F=>{const X={type:E};if(typeof F=="string"&&(r||s)&&!q&&e.manuallyAnimateOnMount&&e.parent){const{parent:B}=e,L=gc(B,F);if(B.enteringChildren&&L){const{delayChildren:G}=L.transition||{};X.delay=iN(B.enteringChildren,e,G)}}return{animation:F,options:X}}))}if(v.size){const S={};if(typeof f.initial!="boolean"){const E=gc(e,Array.isArray(f.initial)?f.initial[0]:f.initial);E&&E.transition&&(S.transition=E.transition)}v.forEach(E=>{const C=e.getBaseTarget(E),A=e.getValue(E);A&&(A.liveStyle=!0),S[E]=C??null}),m.push({animation:S})}let b=!!m.length;return r&&(f.initial===!1||f.initial===f.animate)&&!e.manuallyAnimateOnMount&&(b=!1),r=!1,s=!1,b?t(m):Promise.resolve()}function u(d,f){var m;if(n[d].isActive===f)return Promise.resolve();(m=e.variantChildren)==null||m.forEach(v=>{var _;return(_=v.animationState)==null?void 0:_.setActive(d,f)}),n[d].isActive=f;const p=c(d);for(const v in n)n[v].protectedKeys={};return p}return{animateChanges:c,setActive:u,setAnimateFunction:o,getState:()=>n,reset:()=>{n=SP(),s=!0}}}function hQ(e,t){return typeof t=="string"?t!==e:Array.isArray(t)?!LN(t,e):!1}function Bl(e=!1){return{isActive:e,protectedKeys:{},needsAnimating:{},prevResolvedValues:{}}}function SP(){return{animate:Bl(!0),whileInView:Bl(),whileHover:Bl(),whileTap:Bl(),whileDrag:Bl(),whileFocus:Bl(),exit:Bl()}}function u2(e,t){e.min=t.min,e.max=t.max}function Ii(e,t){u2(e.x,t.x),u2(e.y,t.y)}function EP(e,t){e.translate=t.translate,e.scale=t.scale,e.originPoint=t.originPoint,e.origin=t.origin}const $N=1e-4,pQ=1-$N,mQ=1+$N,DN=.01,gQ=0-DN,vQ=0+DN;function ms(e){return e.max-e.min}function yQ(e,t,n){return Math.abs(e-t)<=n}function kP(e,t,n,r=.5){e.origin=r,e.originPoint=vn(t.min,t.max,e.origin),e.scale=ms(n)/ms(t),e.translate=vn(n.min,n.max,e.origin)-e.originPoint,(e.scale>=pQ&&e.scale<=mQ||isNaN(e.scale))&&(e.scale=1),(e.translate>=gQ&&e.translate<=vQ||isNaN(e.translate))&&(e.translate=0)}function rh(e,t,n,r){kP(e.x,t.x,n.x,r?r.originX:void 0),kP(e.y,t.y,n.y,r?r.originY:void 0)}function CP(e,t,n,r=0){const s=r?vn(n.min,n.max,r):n.min;e.min=s+t.min,e.max=e.min+ms(t)}function _Q(e,t,n,r){CP(e.x,t.x,n.x,r==null?void 0:r.x),CP(e.y,t.y,n.y,r==null?void 0:r.y)}function PP(e,t,n,r=0){const s=r?vn(n.min,n.max,r):n.min;e.min=t.min-s,e.max=e.min+ms(t)}function og(e,t,n,r){PP(e.x,t.x,n.x,r==null?void 0:r.x),PP(e.y,t.y,n.y,r==null?void 0:r.y)}function AP(e,t,n,r,s){return e-=t,e=ig(e,1/n,r),s!==void 0&&(e=ig(e,1/s,r)),e}function wQ(e,t=0,n=1,r=.5,s,i=e,o=e){if(vo.test(t)&&(t=parseFloat(t),t=vn(o.min,o.max,t/100)-o.min),typeof t!="number")return;let c=vn(i.min,i.max,r);e===i&&(c-=t),e.min=AP(e.min,t,n,c,s),e.max=AP(e.max,t,n,c,s)}function TP(e,t,[n,r,s],i,o){wQ(e,t[n],t[r],t[s],t.scale,i,o)}const bQ=["x","scaleX","originX"],xQ=["y","scaleY","originY"];function RP(e,t,n,r){TP(e.x,t,bQ,n?n.x:void 0,r?r.x:void 0),TP(e.y,t,xQ,n?n.y:void 0,r?r.y:void 0)}function IP(e){return e.translate===0&&e.scale===1}function FN(e){return IP(e.x)&&IP(e.y)}function OP(e,t){return e.min===t.min&&e.max===t.max}function SQ(e,t){return OP(e.x,t.x)&&OP(e.y,t.y)}function MP(e,t){return Math.round(e.min)===Math.round(t.min)&&Math.round(e.max)===Math.round(t.max)}function jN(e,t){return MP(e.x,t.x)&&MP(e.y,t.y)}function NP(e){return ms(e.x)/ms(e.y)}function LP(e,t){return e.translate===t.translate&&e.scale===t.scale&&e.originPoint===t.originPoint}function io(e){return[e("x"),e("y")]}function EQ(e,t,n){let r="";const s=e.x.translate/t.x,i=e.y.translate/t.y,o=(n==null?void 0:n.z)||0;if((s||i||o)&&(r=`translate3d(${s}px, ${i}px, ${o}px) `),(t.x!==1||t.y!==1)&&(r+=`scale(${1/t.x}, ${1/t.y}) `),n){const{transformPerspective:d,rotate:f,pathRotation:p,rotateX:m,rotateY:v,skewX:_,skewY:w}=n;d&&(r=`perspective(${d}px) ${r}`),f&&(r+=`rotate(${f}deg) `),p&&(r+=`rotate(${p}deg) `),m&&(r+=`rotateX(${m}deg) `),v&&(r+=`rotateY(${v}deg) `),_&&(r+=`skewX(${_}deg) `),w&&(r+=`skewY(${w}deg) `)}const c=e.x.scale*t.x,u=e.y.scale*t.y;return(c!==1||u!==1)&&(r+=`scale(${c}, ${u})`),r||"none"}const kQ=hx.length,$P=e=>typeof e=="string"?parseFloat(e):e,DP=e=>typeof e=="number"||Ge.test(e);function CQ(e,t,n,r,s,i){s?(e.opacity=vn(0,n.opacity??1,PQ(r)),e.opacityExit=vn(t.opacity??1,0,AQ(r))):i&&(e.opacity=vn(t.opacity??1,n.opacity??1,r));for(let o=0;o<kQ;o++){const c=hx[o];let u=FP(t,c),d=FP(n,c);if(u===void 0&&d===void 0)continue;u||(u=0),d||(d=0),u===0||d===0||DP(u)===DP(d)?(e[c]=Math.max(vn($P(u),$P(d),r),0),(vo.test(d)||vo.test(u))&&(e[c]+="%")):e[c]=d}(t.rotate||n.rotate)&&(e.rotate=vn(t.rotate||0,n.rotate||0,r))}function FP(e,t){return e[t]!==void 0?e[t]:e.borderRadius}const PQ=zN(0,.5,MM),AQ=zN(.5,.95,gi);function zN(e,t,n){return r=>r<e?0:r>t?1:n(xh(e,t,r))}function TQ(e,t,n){const r=zr(e)?e:md(e);return r.start(ux("",r,t,n)),r.animation}function kh(e,t,n,r={passive:!0}){return e.addEventListener(t,n,r),()=>e.removeEventListener(t,n,r)}const RQ=(e,t)=>e.depth-t.depth;class IQ{constructor(){this.children=[],this.isDirty=!1}add(t){Qb(this.children,t),this.isDirty=!0}remove(t){Q0(this.children,t),this.isDirty=!0}forEach(t){this.isDirty&&this.children.sort(RQ),this.isDirty=!1,this.children.forEach(t)}}function OQ(e,t){const n=ps.now(),r=({timestamp:s})=>{const i=s-n;i>=t&&(pl(r),e(i-t))};return yn.setup(r,!0),()=>pl(r)}function i0(e){return zr(e)?e.get():e}class MQ{constructor(){this.members=[]}add(t){Qb(this.members,t);for(let n=this.members.length-1;n>=0;n--){const r=this.members[n];if(r===t||r===this.lead||r===this.prevLead)continue;const s=r.instance;(!s||s.isConnected===!1)&&!r.snapshot&&(Q0(this.members,r),r.unmount())}t.scheduleRender()}remove(t){if(Q0(this.members,t),t===this.prevLead&&(this.prevLead=void 0),t===this.lead){const n=this.members[this.members.length-1];n&&this.promote(n)}}relegate(t){var n;for(let r=this.members.indexOf(t)-1;r>=0;r--){const s=this.members[r];if(s.isPresent!==!1&&((n=s.instance)==null?void 0:n.isConnected)!==!1)return this.promote(s),!0}return!1}promote(t,n){var s;const r=this.lead;if(t!==r&&(this.prevLead=r,this.lead=t,t.show(),r)){r.updateSnapshot(),t.scheduleRender();const{layoutDependency:i}=r.options,{layoutDependency:o}=t.options;(i===void 0||i!==o)&&(t.resumeFrom=r,n&&(r.preserveOpacity=!0),r.snapshot&&(t.snapshot=r.snapshot,t.snapshot.latestValues=r.animationValues||r.latestValues),(s=t.root)!=null&&s.isUpdating&&(t.isLayoutDirty=!0)),t.options.crossfade===!1&&r.hide()}}exitAnimationComplete(){this.members.forEach(t=>{var n,r,s,i,o;(r=(n=t.options).onExitComplete)==null||r.call(n),(o=(s=t.resumingFrom)==null?void 0:(i=s.options).onExitComplete)==null||o.call(i)})}scheduleRender(){this.members.forEach(t=>t.instance&&t.scheduleRender(!1))}removeLeadSnapshot(){var t;(t=this.lead)!=null&&t.snapshot&&(this.lead.snapshot=void 0)}}const o0={hasAnimatedSinceResize:!0,hasEverUpdated:!1},B1=["","X","Y","Z"],NQ=1e3;let LQ=0;function W1(e,t,n,r){const{latestValues:s}=t;s[e]&&(n[e]=s[e],t.setStaticValue(e,0),r&&(r[e]=0))}function VN(e){if(e.hasCheckedOptimisedAppear=!0,e.root===e)return;const{visualElement:t}=e.options;if(!t)return;const n=cN(t);if(window.MotionHasOptimisedAnimation(n,"transform")){const{layout:s,layoutId:i}=e.options;window.MotionCancelOptimisedAnimation(n,"transform",yn,!(s||i))}const{parent:r}=e;r&&!r.hasCheckedOptimisedAppear&&VN(r)}function HN({attachResizeListener:e,defaultParent:t,measureScroll:n,checkIsScrollRoot:r,resetTransform:s}){return class{constructor(o={},c=t==null?void 0:t()){this.id=LQ++,this.animationId=0,this.animationCommitId=0,this.children=new Set,this.options={},this.isTreeAnimating=!1,this.isAnimationBlocked=!1,this.isLayoutDirty=!1,this.isProjectionDirty=!1,this.isSharedProjectionDirty=!1,this.isTransformDirty=!1,this.updateManuallyBlocked=!1,this.updateBlockedByResize=!1,this.isUpdating=!1,this.isSVG=!1,this.needsReset=!1,this.shouldResetTransform=!1,this.hasCheckedOptimisedAppear=!1,this.treeScale={x:1,y:1},this.eventHandlers=new Map,this.hasTreeAnimated=!1,this.layoutVersion=0,this.updateScheduled=!1,this.scheduleUpdate=()=>this.update(),this.projectionUpdateScheduled=!1,this.checkUpdateFailed=()=>{this.isUpdating&&(this.isUpdating=!1,this.clearAllSnapshots())},this.updateProjection=()=>{this.projectionUpdateScheduled=!1,this.nodes.forEach(FQ),this.nodes.forEach(ZQ),this.nodes.forEach(BQ),this.nodes.forEach(jQ)},this.resolvedRelativeTargetAt=0,this.linkedParentVersion=0,this.hasProjected=!1,this.isVisible=!0,this.animationProgress=0,this.sharedNodes=new Map,this.latestValues=o,this.root=c?c.root||c:this,this.path=c?[...c.path,c]:[],this.parent=c,this.depth=c?c.depth+1:0;for(let u=0;u<this.path.length;u++)this.path[u].shouldResetTransform=!0;this.root===this&&(this.nodes=new IQ)}addEventListener(o,c){return this.eventHandlers.has(o)||this.eventHandlers.set(o,new Xb),this.eventHandlers.get(o).add(c)}notifyListeners(o,...c){const u=this.eventHandlers.get(o);u&&u.notify(...c)}hasListeners(o){return this.eventHandlers.has(o)}mount(o){if(this.instance)return;this.isSVG=gx(o)&&!FY(o),this.instance=o;const{layoutId:c,layout:u,visualElement:d}=this.options;if(d&&!d.current&&d.mount(o),this.root.nodes.add(this),this.parent&&this.parent.children.add(this),this.root.hasTreeAnimated&&(u||c)&&(this.isLayoutDirty=!0),e){let f,p=0;const m=()=>this.root.updateBlockedByResize=!1;yn.read(()=>{p=window.innerWidth}),e(o,()=>{const v=window.innerWidth;v!==p&&(p=v,this.root.updateBlockedByResize=!0,f&&f(),f=OQ(m,250),o0.hasAnimatedSinceResize&&(o0.hasAnimatedSinceResize=!1,this.nodes.forEach(VP)))})}c&&this.root.registerSharedNode(c,this),this.options.animate!==!1&&d&&(c||u)&&this.addEventListener("didUpdate",({delta:f,hasLayoutChanged:p,hasRelativeLayoutChanged:m,layout:v})=>{if(this.isTreeAnimationBlocked()){this.target=void 0,this.relativeTarget=void 0;return}const _=this.options.transition||d.getDefaultTransition()||YQ,{onLayoutAnimationStart:w,onLayoutAnimationComplete:b}=d.getProps(),S=!this.targetLayout||!jN(this.targetLayout,v),E=!p&&m;if(this.options.layoutRoot||this.resumeFrom||E||p&&(S||!this.currentAnimation)){this.resumeFrom&&(this.resumingFrom=this.resumeFrom,this.resumingFrom.resumingFrom=void 0);const C={...cx(_,"layout"),onPlay:w,onComplete:b};(d.shouldReduceMotion||this.options.layoutRoot)&&(C.delay=0,C.type=!1),this.startAnimation(C),this.setAnimationOrigin(f,E,C.path)}else p||VP(this),this.isLead()&&this.options.onExitComplete&&this.options.onExitComplete();this.targetLayout=v})}unmount(){this.options.layoutId&&this.willUpdate(),this.root.nodes.remove(this);const o=this.getStack();o&&o.remove(this),this.parent&&this.parent.children.delete(this),this.instance=void 0,this.eventHandlers.clear(),pl(this.updateProjection)}blockUpdate(){this.updateManuallyBlocked=!0}unblockUpdate(){this.updateManuallyBlocked=!1}isUpdateBlocked(){return this.updateManuallyBlocked||this.updateBlockedByResize}isTreeAnimationBlocked(){return this.isAnimationBlocked||this.parent&&this.parent.isTreeAnimationBlocked()||!1}startUpdate(){this.isUpdateBlocked()||(this.isUpdating=!0,this.nodes&&this.nodes.forEach(WQ),this.animationId++)}getTransformTemplate(){const{visualElement:o}=this.options;return o&&o.getProps().transformTemplate}willUpdate(o=!0){if(this.root.hasTreeAnimated=!0,this.root.isUpdateBlocked()){this.options.onExitComplete&&this.options.onExitComplete();return}if(window.MotionCancelOptimisedAnimation&&!this.hasCheckedOptimisedAppear&&VN(this),!this.root.isUpdating&&this.root.startUpdate(),this.isLayoutDirty)return;this.isLayoutDirty=!0;for(let f=0;f<this.path.length;f++){const p=this.path[f];p.shouldResetTransform=!0,(typeof p.latestValues.x=="string"||typeof p.latestValues.y=="string")&&(p.isLayoutDirty=!0),p.updateScroll("snapshot"),p.options.layoutRoot&&p.willUpdate(!1)}const{layoutId:c,layout:u}=this.options;if(c===void 0&&!u)return;const d=this.getTransformTemplate();this.prevTransformTemplateValue=d?d(this.latestValues,""):void 0,this.updateSnapshot(),o&&this.notifyListeners("willUpdate")}update(){if(this.updateScheduled=!1,this.isUpdateBlocked()){const u=this.updateBlockedByResize;this.unblockUpdate(),this.updateBlockedByResize=!1,this.clearAllSnapshots(),u&&this.nodes.forEach(VQ),this.nodes.forEach(jP);return}if(this.animationId<=this.animationCommitId){this.nodes.forEach(zP);return}this.animationCommitId=this.animationId,this.isUpdating?(this.isUpdating=!1,this.nodes.forEach(HQ),this.nodes.forEach(UQ),this.nodes.forEach($Q),this.nodes.forEach(DQ)):this.nodes.forEach(zP),this.clearAllSnapshots();const c=ps.now();Dr.delta=wo(0,1e3/60,c-Dr.timestamp),Dr.timestamp=c,Dr.isProcessing=!0,D1.update.process(Dr),D1.preRender.process(Dr),D1.render.process(Dr),Dr.isProcessing=!1}didUpdate(){this.updateScheduled||(this.updateScheduled=!0,px.read(this.scheduleUpdate))}clearAllSnapshots(){this.nodes.forEach(zQ),this.sharedNodes.forEach(KQ)}scheduleUpdateProjection(){this.projectionUpdateScheduled||(this.projectionUpdateScheduled=!0,yn.preRender(this.updateProjection,!1,!0))}scheduleCheckAfterUnmount(){yn.postRender(()=>{this.isLayoutDirty?this.root.didUpdate():this.root.checkUpdateFailed()})}updateSnapshot(){this.snapshot||!this.instance||(this.snapshot=this.measure(),this.snapshot&&!ms(this.snapshot.measuredBox.x)&&!ms(this.snapshot.measuredBox.y)&&(this.snapshot=void 0))}updateLayout(){if(!this.instance||(this.updateScroll(),!(this.options.alwaysMeasureLayout&&this.isLead())&&!this.isLayoutDirty))return;if(this.resumeFrom&&!this.resumeFrom.instance)for(let u=0;u<this.path.length;u++)this.path[u].updateScroll();const o=this.layout;this.layout=this.measure(!1),this.layoutVersion++,this.layoutCorrected||(this.layoutCorrected=pr()),this.isLayoutDirty=!1,this.projectionDelta=void 0,this.notifyListeners("measure",this.layout.layoutBox);const{visualElement:c}=this.options;c&&c.notify("LayoutMeasure",this.layout.layoutBox,o?o.layoutBox:void 0)}updateScroll(o="measure"){let c=!!(this.options.layoutScroll&&this.instance);if(this.scroll&&this.scroll.animationId===this.root.animationId&&this.scroll.phase===o&&(c=!1),c&&this.instance){const u=r(this.instance);this.scroll={animationId:this.root.animationId,phase:o,isRoot:u,offset:n(this.instance),wasRoot:this.scroll?this.scroll.isRoot:u}}}resetTransform(){if(!s)return;const o=this.isLayoutDirty||this.shouldResetTransform||this.options.alwaysMeasureLayout,c=this.projectionDelta&&!FN(this.projectionDelta),u=this.getTransformTemplate(),d=u?u(this.latestValues,""):void 0,f=d!==this.prevTransformTemplateValue;o&&this.instance&&(c||Ql(this.latestValues)||f)&&(s(this.instance,d),this.shouldResetTransform=!1,this.scheduleRender())}measure(o=!0){const c=this.measurePageBox();let u=this.removeElementScroll(c);return o&&(u=this.removeTransform(u)),QQ(u),{animationId:this.root.animationId,measuredBox:c,layoutBox:u,latestValues:{},source:this.id}}measurePageBox(){var d;const{visualElement:o}=this.options;if(!o)return pr();const c=o.measureViewportBox();if(!(((d=this.scroll)==null?void 0:d.wasRoot)||this.path.some(XQ))){const{scroll:f}=this.root;f&&(uo(c.x,f.offset.x),uo(c.y,f.offset.y))}return c}removeElementScroll(o){var u;const c=pr();if(Ii(c,o),(u=this.scroll)!=null&&u.wasRoot)return c;for(let d=0;d<this.path.length;d++){const f=this.path[d],{scroll:p,options:m}=f;f!==this.root&&p&&m.layoutScroll&&(p.wasRoot&&Ii(c,o),uo(c.x,p.offset.x),uo(c.y,p.offset.y))}return c}applyTransform(o,c=!1,u){var f,p;const d=u||pr();Ii(d,o);for(let m=0;m<this.path.length;m++){const v=this.path[m];!c&&v.options.layoutScroll&&v.scroll&&v!==v.root&&(uo(d.x,-v.scroll.offset.x),uo(d.y,-v.scroll.offset.y)),Ql(v.latestValues)&&s0(d,v.latestValues,(f=v.layout)==null?void 0:f.layoutBox)}return Ql(this.latestValues)&&s0(d,this.latestValues,(p=this.layout)==null?void 0:p.layoutBox),d}removeTransform(o){var u;const c=pr();Ii(c,o);for(let d=0;d<this.path.length;d++){const f=this.path[d];if(!Ql(f.latestValues))continue;let p;f.instance&&(a2(f.latestValues)&&f.updateSnapshot(),p=pr(),Ii(p,f.measurePageBox())),RP(c,f.latestValues,(u=f.snapshot)==null?void 0:u.layoutBox,p)}return Ql(this.latestValues)&&RP(c,this.latestValues),c}setTargetDelta(o){this.targetDelta=o,this.root.scheduleUpdateProjection(),this.isProjectionDirty=!0}setOptions(o){this.options={...this.options,...o,crossfade:o.crossfade!==void 0?o.crossfade:!0}}clearMeasurements(){this.scroll=void 0,this.layout=void 0,this.snapshot=void 0,this.prevTransformTemplateValue=void 0,this.targetDelta=void 0,this.target=void 0,this.isLayoutDirty=!1}forceRelativeParentToResolveTarget(){this.relativeParent&&this.relativeParent.resolvedRelativeTargetAt!==Dr.timestamp&&this.relativeParent.resolveTargetDelta(!0)}resolveTargetDelta(o=!1){var v;const c=this.getLead();this.isProjectionDirty||(this.isProjectionDirty=c.isProjectionDirty),this.isTransformDirty||(this.isTransformDirty=c.isTransformDirty),this.isSharedProjectionDirty||(this.isSharedProjectionDirty=c.isSharedProjectionDirty);const u=!!this.resumingFrom||this!==c;if(!(o||u&&this.isSharedProjectionDirty||this.isProjectionDirty||(v=this.parent)!=null&&v.isProjectionDirty||this.attemptToResolveRelativeTarget||this.root.updateBlockedByResize))return;const{layout:f,layoutId:p}=this.options;if(!this.layout||!(f||p))return;this.resolvedRelativeTargetAt=Dr.timestamp;const m=this.getClosestProjectingParent();m&&this.linkedParentVersion!==m.layoutVersion&&!m.options.layoutRoot&&this.removeRelativeTarget(),!this.targetDelta&&!this.relativeTarget&&(this.options.layoutAnchor!==!1&&m&&m.layout?this.createRelativeTarget(m,this.layout.layoutBox,m.layout.layoutBox):this.removeRelativeTarget()),!(!this.relativeTarget&&!this.targetDelta)&&(this.target||(this.target=pr(),this.targetWithTransforms=pr()),this.relativeTarget&&this.relativeTargetOrigin&&this.relativeParent&&this.relativeParent.target?(this.forceRelativeParentToResolveTarget(),_Q(this.target,this.relativeTarget,this.relativeParent.target,this.options.layoutAnchor||void 0)):this.targetDelta?(this.resumingFrom?this.applyTransform(this.layout.layoutBox,!1,this.target):Ii(this.target,this.layout.layoutBox),CN(this.target,this.targetDelta)):Ii(this.target,this.layout.layoutBox),this.attemptToResolveRelativeTarget&&(this.attemptToResolveRelativeTarget=!1,this.options.layoutAnchor!==!1&&m&&!!m.resumingFrom==!!this.resumingFrom&&!m.options.layoutScroll&&m.target&&this.animationProgress!==1?this.createRelativeTarget(m,this.target,m.target):this.relativeParent=this.relativeTarget=void 0))}getClosestProjectingParent(){if(!(!this.parent||a2(this.parent.latestValues)||kN(this.parent.latestValues)))return this.parent.isProjecting()?this.parent:this.parent.getClosestProjectingParent()}isProjecting(){return!!((this.relativeTarget||this.targetDelta||this.options.layoutRoot)&&this.layout)}createRelativeTarget(o,c,u){this.relativeParent=o,this.linkedParentVersion=o.layoutVersion,this.forceRelativeParentToResolveTarget(),this.relativeTarget=pr(),this.relativeTargetOrigin=pr(),og(this.relativeTargetOrigin,c,u,this.options.layoutAnchor||void 0),Ii(this.relativeTarget,this.relativeTargetOrigin)}removeRelativeTarget(){this.relativeParent=this.relativeTarget=void 0}calcProjection(){var _;const o=this.getLead(),c=!!this.resumingFrom||this!==o;let u=!0;if((this.isProjectionDirty||(_=this.parent)!=null&&_.isProjectionDirty)&&(u=!1),c&&(this.isSharedProjectionDirty||this.isTransformDirty)&&(u=!1),this.resolvedRelativeTargetAt===Dr.timestamp&&(u=!1),u)return;const{layout:d,layoutId:f}=this.options;if(this.isTreeAnimating=!!(this.parent&&this.parent.isTreeAnimating||this.currentAnimation||this.pendingAnimation),this.isTreeAnimating||(this.targetDelta=this.relativeTarget=void 0),!this.layout||!(d||f))return;Ii(this.layoutCorrected,this.layout.layoutBox);const p=this.treeScale.x,m=this.treeScale.y;GY(this.layoutCorrected,this.treeScale,this.path,c),o.layout&&!o.target&&(this.treeScale.x!==1||this.treeScale.y!==1)&&(o.target=o.layout.layoutBox,o.targetWithTransforms=pr());const{target:v}=o;if(!v){this.prevProjectionDelta&&(this.createProjectionDeltas(),this.scheduleRender());return}!this.projectionDelta||!this.prevProjectionDelta?this.createProjectionDeltas():(EP(this.prevProjectionDelta.x,this.projectionDelta.x),EP(this.prevProjectionDelta.y,this.projectionDelta.y)),rh(this.projectionDelta,this.layoutCorrected,v,this.latestValues),(this.treeScale.x!==p||this.treeScale.y!==m||!LP(this.projectionDelta.x,this.prevProjectionDelta.x)||!LP(this.projectionDelta.y,this.prevProjectionDelta.y))&&(this.hasProjected=!0,this.scheduleRender(),this.notifyListeners("projectionUpdate",v))}hide(){this.isVisible=!1}show(){this.isVisible=!0}scheduleRender(o=!0){var c;if((c=this.options.visualElement)==null||c.scheduleRender(),o){const u=this.getStack();u&&u.scheduleRender()}this.resumingFrom&&!this.resumingFrom.instance&&(this.resumingFrom=void 0)}createProjectionDeltas(){this.prevProjectionDelta=Au(),this.projectionDelta=Au(),this.projectionDeltaWithTransform=Au()}setAnimationOrigin(o,c=!1,u){const d=this.snapshot,f=d?d.latestValues:{},p={...this.latestValues},m=Au();(!this.relativeParent||!this.relativeParent.options.layoutRoot)&&(this.relativeTarget=this.relativeTargetOrigin=void 0),this.attemptToResolveRelativeTarget=!c;const v=pr(),_=d?d.source:void 0,w=this.layout?this.layout.source:void 0,b=_!==w,S=this.getStack(),E=!S||S.members.length<=1,C=!!(b&&!E&&this.options.crossfade===!0&&!this.path.some(qQ));this.animationProgress=0;let A;const T=u==null?void 0:u.interpolateProjection(o);this.mixTargetDelta=M=>{const O=M/1e3,R=T==null?void 0:T(O);R?(m.x.translate=R.x,m.x.scale=vn(o.x.scale,1,O),m.x.origin=o.x.origin,m.x.originPoint=o.x.originPoint,m.y.translate=R.y,m.y.scale=vn(o.y.scale,1,O),m.y.origin=o.y.origin,m.y.originPoint=o.y.originPoint):(HP(m.x,o.x,O),HP(m.y,o.y,O)),this.setTargetDelta(m),this.relativeTarget&&this.relativeTargetOrigin&&this.layout&&this.relativeParent&&this.relativeParent.layout&&(og(v,this.layout.layoutBox,this.relativeParent.layout.layoutBox,this.options.layoutAnchor||void 0),GQ(this.relativeTarget,this.relativeTargetOrigin,v,O),A&&SQ(this.relativeTarget,A)&&(this.isProjectionDirty=!1),A||(A=pr()),Ii(A,this.relativeTarget)),b&&(this.animationValues=p,CQ(p,f,this.latestValues,O,C,E)),R&&R.rotate!==void 0&&(this.animationValues||(this.animationValues=p),this.animationValues.pathRotation=R.rotate),this.root.scheduleUpdateProjection(),this.scheduleRender(),this.animationProgress=O},this.mixTargetDelta(this.options.layoutRoot?1e3:0)}startAnimation(o){var c,u,d;this.notifyListeners("animationStart"),(c=this.currentAnimation)==null||c.stop(),(d=(u=this.resumingFrom)==null?void 0:u.currentAnimation)==null||d.stop(),this.pendingAnimation&&(pl(this.pendingAnimation),this.pendingAnimation=void 0),this.pendingAnimation=yn.update(()=>{o0.hasAnimatedSinceResize=!0,this.motionValue||(this.motionValue=md(0)),this.motionValue.jump(0,!1),this.currentAnimation=TQ(this.motionValue,[0,1e3],{...o,velocity:0,isSync:!0,onUpdate:f=>{this.mixTargetDelta(f),o.onUpdate&&o.onUpdate(f)},onComplete:()=>{o.onComplete&&o.onComplete(),this.completeAnimation()}}),this.resumingFrom&&(this.resumingFrom.currentAnimation=this.currentAnimation),this.pendingAnimation=void 0})}completeAnimation(){this.resumingFrom&&(this.resumingFrom.currentAnimation=void 0,this.resumingFrom.preserveOpacity=void 0);const o=this.getStack();o&&o.exitAnimationComplete(),this.resumingFrom=this.currentAnimation=this.animationValues=void 0,this.notifyListeners("animationComplete")}finishAnimation(){this.currentAnimation&&(this.mixTargetDelta&&this.mixTargetDelta(NQ),this.currentAnimation.stop()),this.completeAnimation()}applyTransformsToTarget(){const o=this.getLead();let{targetWithTransforms:c,target:u,layout:d,latestValues:f}=o;if(!(!c||!u||!d)){if(this!==o&&this.layout&&d&&UN(this.options.animationType,this.layout.layoutBox,d.layoutBox)){u=this.target||pr();const p=ms(this.layout.layoutBox.x);u.x.min=o.target.x.min,u.x.max=u.x.min+p;const m=ms(this.layout.layoutBox.y);u.y.min=o.target.y.min,u.y.max=u.y.min+m}Ii(c,u),s0(c,f),rh(this.projectionDeltaWithTransform,this.layoutCorrected,c,f)}}registerSharedNode(o,c){this.sharedNodes.has(o)||this.sharedNodes.set(o,new MQ),this.sharedNodes.get(o).add(c);const d=c.options.initialPromotionConfig;c.promote({transition:d?d.transition:void 0,preserveFollowOpacity:d&&d.shouldPreserveFollowOpacity?d.shouldPreserveFollowOpacity(c):void 0})}isLead(){const o=this.getStack();return o?o.lead===this:!0}getLead(){var c;const{layoutId:o}=this.options;return o?((c=this.getStack())==null?void 0:c.lead)||this:this}getPrevLead(){var c;const{layoutId:o}=this.options;return o?(c=this.getStack())==null?void 0:c.prevLead:void 0}getStack(){const{layoutId:o}=this.options;if(o)return this.root.sharedNodes.get(o)}promote({needsReset:o,transition:c,preserveFollowOpacity:u}={}){const d=this.getStack();d&&d.promote(this,u),o&&(this.projectionDelta=void 0,this.needsReset=!0),c&&this.setOptions({transition:c})}relegate(){const o=this.getStack();return o?o.relegate(this):!1}resetSkewAndRotation(){const{visualElement:o}=this.options;if(!o)return;let c=!1;const{latestValues:u}=o;if((u.z||u.rotate||u.rotateX||u.rotateY||u.rotateZ||u.skewX||u.skewY)&&(c=!0),!c)return;const d={};u.z&&W1("z",o,d,this.animationValues);for(let f=0;f<B1.length;f++)W1(`rotate${B1[f]}`,o,d,this.animationValues),W1(`skew${B1[f]}`,o,d,this.animationValues);o.render();for(const f in d)o.setStaticValue(f,d[f]),this.animationValues&&(this.animationValues[f]=d[f]);o.scheduleRender()}applyProjectionStyles(o,c){if(!this.instance||this.isSVG)return;if(!this.isVisible){o.visibility="hidden";return}const u=this.getTransformTemplate();if(this.needsReset){this.needsReset=!1,o.visibility="",o.opacity="",o.pointerEvents=i0(c==null?void 0:c.pointerEvents)||"",o.transform=u?u(this.latestValues,""):"none";return}const d=this.getLead();if(!this.projectionDelta||!this.layout||!d.target){this.options.layoutId&&(o.opacity=this.latestValues.opacity!==void 0?this.latestValues.opacity:1,o.pointerEvents=i0(c==null?void 0:c.pointerEvents)||""),this.hasProjected&&!Ql(this.latestValues)&&(o.transform=u?u({},""):"none",this.hasProjected=!1);return}o.visibility="";const f=d.animationValues||d.latestValues;this.applyTransformsToTarget();let p=EQ(this.projectionDeltaWithTransform,this.treeScale,f);u&&(p=u(f,p)),o.transform=p;const{x:m,y:v}=this.projectionDelta;o.transformOrigin=`${m.origin*100}% ${v.origin*100}% 0`,d.animationValues?o.opacity=d===this?f.opacity??this.latestValues.opacity??1:this.preserveOpacity?this.latestValues.opacity:f.opacityExit:o.opacity=d===this?f.opacity!==void 0?f.opacity:"":f.opacityExit!==void 0?f.opacityExit:0;for(const _ in c2){if(f[_]===void 0)continue;const{correct:w,applyTo:b,isCSSVariable:S}=c2[_],E=p==="none"?f[_]:w(f[_],d);if(b){const C=b.length;for(let A=0;A<C;A++)o[b[A]]=E}else S?this.options.visualElement.renderState.vars[_]=E:o[_]=E}this.options.layoutId&&(o.pointerEvents=d===this?i0(c==null?void 0:c.pointerEvents)||"":"none")}clearSnapshot(){this.resumeFrom=this.snapshot=void 0}resetTree(){this.root.nodes.forEach(o=>{var c;return(c=o.currentAnimation)==null?void 0:c.stop()}),this.root.nodes.forEach(jP),this.root.sharedNodes.clear()}}}function $Q(e){e.updateLayout()}function DQ(e){var n;const t=((n=e.resumeFrom)==null?void 0:n.snapshot)||e.snapshot;if(e.isLead()&&e.layout&&t&&e.hasListeners("didUpdate")){const{layoutBox:r,measuredBox:s}=e.layout,{animationType:i}=e.options,o=t.source!==e.layout.source;if(i==="size")io(p=>{const m=o?t.measuredBox[p]:t.layoutBox[p],v=ms(m);m.min=r[p].min,m.max=m.min+v});else if(i==="x"||i==="y"){const p=i==="x"?"y":"x";u2(o?t.measuredBox[p]:t.layoutBox[p],r[p])}else UN(i,t.layoutBox,r)&&io(p=>{const m=o?t.measuredBox[p]:t.layoutBox[p],v=ms(r[p]);m.max=m.min+v,e.relativeTarget&&!e.currentAnimation&&(e.isProjectionDirty=!0,e.relativeTarget[p].max=e.relativeTarget[p].min+v)});const c=Au();rh(c,r,t.layoutBox);const u=Au();o?rh(u,e.applyTransform(s,!0),t.measuredBox):rh(u,r,t.layoutBox);const d=!FN(c);let f=!1;if(!e.resumeFrom){const p=e.getClosestProjectingParent();if(p&&!p.resumeFrom){const{snapshot:m,layout:v}=p;if(m&&v){const _=e.options.layoutAnchor||void 0,w=pr();og(w,t.layoutBox,m.layoutBox,_);const b=pr();og(b,r,v.layoutBox,_),jN(w,b)||(f=!0),p.options.layoutRoot&&(e.relativeTarget=b,e.relativeTargetOrigin=w,e.relativeParent=p)}}}e.notifyListeners("didUpdate",{layout:r,snapshot:t,delta:u,layoutDelta:c,hasLayoutChanged:d,hasRelativeLayoutChanged:f})}else if(e.isLead()){const{onExitComplete:r}=e.options;r&&r()}e.options.transition=void 0}function FQ(e){e.parent&&(e.isProjecting()||(e.isProjectionDirty=e.parent.isProjectionDirty),e.isSharedProjectionDirty||(e.isSharedProjectionDirty=!!(e.isProjectionDirty||e.parent.isProjectionDirty||e.parent.isSharedProjectionDirty)),e.isTransformDirty||(e.isTransformDirty=e.parent.isTransformDirty))}function jQ(e){e.isProjectionDirty=e.isSharedProjectionDirty=e.isTransformDirty=!1}function zQ(e){e.clearSnapshot()}function jP(e){e.clearMeasurements()}function VQ(e){e.isLayoutDirty=!0,e.updateLayout()}function zP(e){e.isLayoutDirty=!1}function HQ(e){e.isAnimationBlocked&&e.layout&&!e.isLayoutDirty&&(e.snapshot=e.layout,e.isLayoutDirty=!0)}function UQ(e){const{visualElement:t}=e.options;t&&t.getProps().onBeforeLayoutMeasure&&t.notify("BeforeLayoutMeasure"),e.resetTransform()}function VP(e){e.finishAnimation(),e.targetDelta=e.relativeTarget=e.target=void 0,e.isProjectionDirty=!0}function ZQ(e){e.resolveTargetDelta()}function BQ(e){e.calcProjection()}function WQ(e){e.resetSkewAndRotation()}function KQ(e){e.removeLeadSnapshot()}function HP(e,t,n){e.translate=vn(t.translate,0,n),e.scale=vn(t.scale,1,n),e.origin=t.origin,e.originPoint=t.originPoint}function UP(e,t,n,r){e.min=vn(t.min,n.min,r),e.max=vn(t.max,n.max,r)}function GQ(e,t,n,r){UP(e.x,t.x,n.x,r),UP(e.y,t.y,n.y,r)}function qQ(e){return e.animationValues&&e.animationValues.opacityExit!==void 0}const YQ={duration:.45,ease:[.4,0,.1,1]},ZP=e=>typeof navigator<"u"&&navigator.userAgent&&navigator.userAgent.toLowerCase().includes(e),BP=ZP("applewebkit/")&&!ZP("chrome/")?Math.round:gi;function WP(e){e.min=BP(e.min),e.max=BP(e.max)}function QQ(e){WP(e.x),WP(e.y)}function UN(e,t,n){return e==="position"||e==="preserve-aspect"&&!yQ(NP(t),NP(n),.2)}function XQ(e){var t;return e!==e.root&&((t=e.scroll)==null?void 0:t.wasRoot)}const JQ=HN({attachResizeListener:(e,t)=>kh(e,"resize",t),measureScroll:()=>{var e,t;return{x:document.documentElement.scrollLeft||((e=document.body)==null?void 0:e.scrollLeft)||0,y:document.documentElement.scrollTop||((t=document.body)==null?void 0:t.scrollTop)||0}},checkIsScrollRoot:()=>!0}),K1={current:void 0},ZN=HN({measureScroll:e=>({x:e.scrollLeft,y:e.scrollTop}),defaultParent:()=>{if(!K1.current){const e=new JQ({});e.mount(window),e.setOptions({layoutScroll:!0}),K1.current=e}return K1.current},resetTransform:(e,t)=>{e.style.transform=t!==void 0?t:"none"},checkIsScrollRoot:e=>window.getComputedStyle(e).position==="fixed"}),Ch=g.createContext({transformPagePoint:e=>e,isStatic:!1,reducedMotion:"never"});function KP(e,t){if(typeof e=="function")return e(t);e!=null&&(e.current=t)}function eX(...e){return t=>{let n=!1;const r=e.map(s=>{const i=KP(s,t);return!n&&typeof i=="function"&&(n=!0),i});if(n)return()=>{for(let s=0;s<r.length;s++){const i=r[s];typeof i=="function"?i():KP(e[s],null)}}}}function tX(...e){return g.useCallback(eX(...e),e)}class nX extends g.Component{getSnapshotBeforeUpdate(t){const n=this.props.childRef.current;if(e0(n)&&t.isPresent&&!this.props.isPresent&&this.props.pop!==!1){const r=n.offsetParent,s=e0(r)&&r.offsetWidth||0,i=e0(r)&&r.offsetHeight||0,o=getComputedStyle(n),c=this.props.sizeRef.current;c.height=parseFloat(o.height),c.width=parseFloat(o.width),c.top=n.offsetTop,c.left=n.offsetLeft,c.right=s-c.width-c.left,c.bottom=i-c.height-c.top,c.direction=o.direction}return null}componentDidUpdate(){}render(){return this.props.children}}function rX({children:e,isPresent:t,anchorX:n,anchorY:r,root:s,pop:i}){var m;const o=g.useId(),c=g.useRef(null),u=g.useRef({width:0,height:0,top:0,left:0,right:0,bottom:0,direction:"ltr"}),{nonce:d}=g.useContext(Ch),f=i!==!1?((m=e.props)==null?void 0:m.ref)??(e==null?void 0:e.ref):void 0,p=tX(c,f);return g.useInsertionEffect(()=>{const{width:v,height:_,top:w,left:b,right:S,bottom:E,direction:C}=u.current;if(t||i===!1||!c.current||!v||!_)return;const A=C==="rtl",T=n==="left"?A?`right: ${S}`:`left: ${b}`:A?`left: ${b}`:`right: ${S}`,M=r==="bottom"?`bottom: ${E}`:`top: ${w}`;c.current.dataset.motionPopId=o;const O=document.createElement("style");d&&(O.nonce=d);const R=s??document.head;return R.appendChild(O),O.sheet&&O.sheet.insertRule(`
|
|
78
|
+
[data-motion-pop-id="${o}"] {
|
|
79
|
+
position: absolute !important;
|
|
80
|
+
width: ${v}px !important;
|
|
81
|
+
height: ${_}px !important;
|
|
82
|
+
${T}px !important;
|
|
83
|
+
${M}px !important;
|
|
84
|
+
}
|
|
85
|
+
`),()=>{var D;(D=c.current)==null||D.removeAttribute("data-motion-pop-id"),R.contains(O)&&R.removeChild(O)}},[t]),P.jsx(nX,{isPresent:t,childRef:c,sizeRef:u,pop:i,children:i===!1?e:g.cloneElement(e,{ref:p})})}const sX=({children:e,initial:t,isPresent:n,onExitComplete:r,custom:s,presenceAffectsLayout:i,mode:o,anchorX:c,anchorY:u,root:d})=>{const f=Lg(iX),p=g.useId(),m=g.useRef(n),v=g.useRef(r);Yb(()=>{m.current=n,v.current=r});let _=!0,w=g.useMemo(()=>(_=!1,{id:p,initial:t,isPresent:n,custom:s,onExitComplete:b=>{f.set(b,!0);for(const S of f.values())if(!S)return;r&&r()},register:b=>(f.set(b,!1),()=>{var S;f.delete(b),!m.current&&!f.size&&((S=v.current)==null||S.call(v))})}),[n,f,r]);return i&&_&&(w={...w}),g.useMemo(()=>{f.forEach((b,S)=>f.set(S,!1))},[n]),g.useEffect(()=>{!n&&!f.size&&r&&r()},[n]),e=P.jsx(rX,{pop:o==="popLayout",isPresent:n,anchorX:c,anchorY:u,root:d,children:e}),P.jsx($g.Provider,{value:w,children:e})};function iX(){return new Map}function BN(e=!0){const t=g.useContext($g);if(t===null)return[!0,null];const{isPresent:n,onExitComplete:r,register:s}=t,i=g.useId();g.useEffect(()=>{if(e)return s(i)},[e]);const o=g.useCallback(()=>e&&r&&r(i),[i,r,e]);return!n&&r?[!1,o]:[!0]}const bm=e=>e.key||"";function GP(e){const t=[];return g.Children.forEach(e,n=>{g.isValidElement(n)&&t.push(n)}),t}const Nu=({children:e,custom:t,initial:n=!0,onExitComplete:r,presenceAffectsLayout:s=!0,mode:i="sync",propagate:o=!1,anchorX:c="left",anchorY:u="top",root:d})=>{const[f,p]=BN(o),m=g.useMemo(()=>GP(e),[e]),v=o&&!f?[]:m.map(bm),_=g.useRef(!0),w=g.useRef(m),b=Lg(()=>new Map),S=g.useRef(new Set),[E,C]=g.useState(m),[A,T]=g.useState(m);Yb(()=>{_.current=!1,w.current=m;for(let R=0;R<A.length;R++){const D=bm(A[R]);v.includes(D)?(b.delete(D),S.current.delete(D)):b.get(D)!==!0&&b.set(D,!1)}},[A,v.length,v.join("-")]);const M=[];if(m!==E){let R=[...m];for(let D=0;D<A.length;D++){const U=A[D],W=bm(U);v.includes(W)||(R.splice(D,0,U),M.push(U))}return i==="wait"&&M.length&&(R=M),T(GP(R)),C(m),null}const{forceRender:O}=g.useContext(qb);return P.jsx(P.Fragment,{children:A.map(R=>{const D=bm(R),U=o&&!f?!1:m===A||v.includes(D),W=()=>{if(S.current.has(D))return;if(b.has(D))S.current.add(D),b.set(D,!0);else return;let H=!0;b.forEach(Y=>{Y||(H=!1)}),H&&(O==null||O(),T(w.current),o&&(p==null||p()),r&&r())};return P.jsx(sX,{isPresent:U,initial:!_.current||n?void 0:!1,custom:t,presenceAffectsLayout:s,mode:i,root:d,onExitComplete:U?void 0:W,anchorX:c,anchorY:u,children:R},D)})})},WN=g.createContext({strict:!1}),qP={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 YP=!1;function oX(){if(YP)return;const e={};for(const t in qP)e[t]={isEnabled:n=>qP[t].some(r=>!!n[r])};xN(e),YP=!0}function KN(){return oX(),ZY()}function aX(e){const t=KN();for(const n in e)t[n]={...t[n],...e[n]};xN(t)}const lX=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 ag(e){return e.startsWith("while")||e.startsWith("drag")&&e!=="draggable"||e.startsWith("layout")||e.startsWith("onTap")||e.startsWith("onPan")||e.startsWith("onLayout")||lX.has(e)}let GN=e=>!ag(e);function qN(e){typeof e=="function"&&(GN=t=>t.startsWith("on")?!ag(t):e(t))}try{qN(require("@emotion/is-prop-valid").default)}catch{}function cX(e,t,n){const r={};for(const s in e)s==="values"&&typeof e.values=="object"||zr(e[s])||(GN(s)||n===!0&&ag(s)||!t&&!ag(s)||e.draggable&&s.startsWith("onDrag"))&&(r[s]=e[s]);return r}function uX({children:e,isValidProp:t,...n}){t&&qN(t);const r=g.useContext(Ch);n={...r,...n},n.transition=lx(n.transition,r.transition),n.isStatic=Lg(()=>n.isStatic);const s=g.useMemo(()=>n,[JSON.stringify(n.transition),n.transformPagePoint,n.reducedMotion,n.skipAnimations]);return P.jsx(Ch.Provider,{value:s,children:e})}const Vg=g.createContext({});function dX(e,t){if(zg(e)){const{initial:n,animate:r}=e;return{initial:n===!1||Eh(n)?n:void 0,animate:Eh(r)?r:void 0}}return e.inherit!==!1?t:{}}function fX(e){const{initial:t,animate:n}=dX(e,g.useContext(Vg));return g.useMemo(()=>({initial:t,animate:n}),[QP(t),QP(n)])}function QP(e){return Array.isArray(e)?e.join(" "):e}const xx=()=>({style:{},transform:{},transformOrigin:{},vars:{}});function YN(e,t,n){for(const r in t)!zr(t[r])&&!TN(r,n)&&(e[r]=t[r])}function hX({transformTemplate:e},t){return g.useMemo(()=>{const n=xx();return wx(n,t,e),Object.assign({},n.vars,n.style)},[t])}function pX(e,t){const n=e.style||{},r={};return YN(r,n,e),Object.assign(r,hX(e,t)),r}function mX(e,t){const n={},r=pX(e,t);return e.drag&&e.dragListener!==!1&&(n.draggable=!1,r.userSelect=r.WebkitUserSelect=r.WebkitTouchCallout="none",r.touchAction=e.drag===!0?"none":`pan-${e.drag==="x"?"y":"x"}`),e.tabIndex===void 0&&(e.onTap||e.onTapStart||e.whileTap)&&(n.tabIndex=0),n.style=r,n}const QN=()=>({...xx(),attrs:{}});function gX(e,t,n,r){const s=g.useMemo(()=>{const i=QN();return RN(i,t,ON(r),e.transformTemplate,e.style),{...i.attrs,style:{...i.style}}},[t]);if(e.style){const i={};YN(i,e.style,e),s.style={...i,...s.style}}return s}const vX=["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 Sx(e){return typeof e!="string"||e.includes("-")?!1:!!(vX.indexOf(e)>-1||/[A-Z]/u.test(e))}function yX(e,t,n,{latestValues:r},s,i=!1,o){const u=(o??Sx(e)?gX:mX)(t,r,s,e),d=cX(t,typeof e=="string",i),f=e!==g.Fragment?{...d,...u,ref:n}:{},{children:p}=t,m=g.useMemo(()=>zr(p)?p.get():p,[p]);return g.createElement(e,{...f,children:m})}function _X({scrapeMotionValuesFromProps:e,createRenderState:t},n,r,s){return{latestValues:wX(n,r,s,e),renderState:t()}}function wX(e,t,n,r){const s={},i=r(e,{});for(const m in i)s[m]=i0(i[m]);let{initial:o,animate:c}=e;const u=zg(e),d=wN(e);t&&d&&!u&&e.inherit!==!1&&(o===void 0&&(o=t.initial),c===void 0&&(c=t.animate));let f=n?n.initial===!1:!1;f=f||o===!1;const p=f?c:o;if(p&&typeof p!="boolean"&&!jg(p)){const m=Array.isArray(p)?p:[p];for(let v=0;v<m.length;v++){const _=dx(e,m[v]);if(_){const{transitionEnd:w,transition:b,...S}=_;for(const E in S){let C=S[E];if(Array.isArray(C)){const A=f?C.length-1:0;C=C[A]}C!==null&&(s[E]=C)}for(const E in w)s[E]=w[E]}}}return s}const XN=e=>(t,n)=>{const r=g.useContext(Vg),s=g.useContext($g),i=()=>_X(e,t,r,s);return n?i():Lg(i)},bX=XN({scrapeMotionValuesFromProps:bx,createRenderState:xx}),xX=XN({scrapeMotionValuesFromProps:MN,createRenderState:QN}),SX=Symbol.for("motionComponentSymbol");function EX(e,t,n){const r=g.useRef(n);g.useInsertionEffect(()=>{r.current=n});const s=g.useRef(null);return g.useCallback(i=>{var c;i&&((c=e.onMount)==null||c.call(e,i)),t&&(i?t.mount(i):t.unmount());const o=r.current;if(typeof o=="function")if(i){const u=o(i);typeof u=="function"&&(s.current=u)}else s.current?(s.current(),s.current=null):o(i);else o&&(o.current=i)},[t])}const JN=g.createContext({});function yu(e){return e&&typeof e=="object"&&Object.prototype.hasOwnProperty.call(e,"current")}function kX(e,t,n,r,s,i){var C,A;const{visualElement:o}=g.useContext(Vg),c=g.useContext(WN),u=g.useContext($g),d=g.useContext(Ch),f=d.reducedMotion,p=d.skipAnimations,m=g.useRef(null),v=g.useRef(!1);r=r||c.renderer,!m.current&&r&&(m.current=r(e,{visualState:t,parent:o,props:n,presenceContext:u,blockInitialAnimation:u?u.initial===!1:!1,reducedMotionConfig:f,skipAnimations:p,isSVG:i}),v.current&&m.current&&(m.current.manuallyAnimateOnMount=!0));const _=m.current,w=g.useContext(JN);_&&!_.projection&&s&&(_.type==="html"||_.type==="svg")&&CX(m.current,n,s,w);const b=g.useRef(!1);g.useInsertionEffect(()=>{_&&b.current&&_.update(n,u)});const S=n[lN],E=g.useRef(!!S&&typeof window<"u"&&!((C=window.MotionHandoffIsComplete)!=null&&C.call(window,S))&&((A=window.MotionHasOptimisedAnimation)==null?void 0:A.call(window,S)));return Yb(()=>{v.current=!0,_&&(b.current=!0,window.MotionIsMounted=!0,_.updateFeatures(),_.scheduleRenderMicrotask(),E.current&&_.animationState&&_.animationState.animateChanges())}),g.useEffect(()=>{_&&(!E.current&&_.animationState&&_.animationState.animateChanges(),E.current&&(queueMicrotask(()=>{var T;(T=window.MotionHandoffMarkAsComplete)==null||T.call(window,S)}),E.current=!1),_.enteringChildren=void 0)}),_}function CX(e,t,n,r){const{layoutId:s,layout:i,drag:o,dragConstraints:c,layoutScroll:u,layoutRoot:d,layoutAnchor:f,layoutCrossfade:p}=t;e.projection=new n(e.latestValues,t["data-framer-portal-id"]?void 0:eL(e.parent)),e.projection.setOptions({layoutId:s,layout:i,alwaysMeasureLayout:!!o||c&&yu(c),visualElement:e,animationType:typeof i=="string"?i:"both",initialPromotionConfig:r,crossfade:p,layoutScroll:u,layoutRoot:d,layoutAnchor:f})}function eL(e){if(e)return e.options.allowProjection!==!1?e.projection:eL(e.parent)}function G1(e,{forwardMotionProps:t=!1,type:n}={},r,s){r&&aX(r);const i=n?n==="svg":Sx(e),o=i?xX:bX;function c(d,f){let p;const m={...g.useContext(Ch),...d,layoutId:PX(d)},{isStatic:v}=m,_=fX(d),w=o(d,v);if(!v&&typeof window<"u"){AX();const b=TX(m);p=b.MeasureLayout,_.visualElement=kX(e,w,m,s,b.ProjectionNode,i)}return P.jsxs(Vg.Provider,{value:_,children:[p&&_.visualElement?P.jsx(p,{visualElement:_.visualElement,...m}):null,yX(e,d,EX(w,_.visualElement,f),w,v,t,i)]})}c.displayName=`motion.${typeof e=="string"?e:`create(${e.displayName??e.name??""})`}`;const u=g.forwardRef(c);return u[SX]=e,u}function PX({layoutId:e}){const t=g.useContext(qb).id;return t&&e!==void 0?t+"-"+e:e}function AX(e,t){g.useContext(WN).strict}function TX(e){const t=KN(),{drag:n,layout:r}=t;if(!n&&!r)return{};const s={...n,...r};return{MeasureLayout:n!=null&&n.isEnabled(e)||r!=null&&r.isEnabled(e)?s.MeasureLayout:void 0,ProjectionNode:s.ProjectionNode}}function RX(e,t){if(typeof Proxy>"u")return G1;const n=new Map,r=(i,o)=>G1(i,o,e,t),s=(i,o)=>r(i,o);return new Proxy(s,{get:(i,o)=>o==="create"?r:(n.has(o)||n.set(o,G1(o,void 0,e,t)),n.get(o))})}const IX=(e,t)=>t.isSVG??Sx(e)?new aQ(t):new tQ(t,{allowProjection:e!==g.Fragment});class OX extends _l{constructor(t){super(t),t.animationState||(t.animationState=fQ(t))}updateAnimationControlsSubscription(){const{animate:t}=this.node.getProps();jg(t)&&(this.unmountControls=t.subscribe(this.node))}mount(){this.updateAnimationControlsSubscription()}update(){const{animate:t}=this.node.getProps(),{animate:n}=this.node.prevProps||{};t!==n&&this.updateAnimationControlsSubscription()}unmount(){var t;this.node.animationState.reset(),(t=this.unmountControls)==null||t.call(this)}}let MX=0;class NX extends _l{constructor(){super(...arguments),this.id=MX++,this.isExitComplete=!1}update(){var i;if(!this.node.presenceContext)return;const{isPresent:t,onExitComplete:n}=this.node.presenceContext,{isPresent:r}=this.node.prevPresenceContext||{};if(!this.node.animationState||t===r)return;if(t&&r===!1){if(this.isExitComplete){const{initial:o,custom:c}=this.node.getProps();if(typeof o=="string"||typeof o=="object"&&o!==null&&!Array.isArray(o)){const u=gc(this.node,o,c);if(u){const{transition:d,transitionEnd:f,...p}=u;for(const m in p)(i=this.node.getValue(m))==null||i.jump(p[m])}}this.node.animationState.reset(),this.node.animationState.animateChanges()}else this.node.animationState.setActive("exit",!1);this.isExitComplete=!1;return}const s=this.node.animationState.setActive("exit",!t);n&&!t&&s.then(()=>{this.isExitComplete=!0,n(this.id)})}mount(){const{register:t,onExitComplete:n}=this.node.presenceContext||{};n&&n(this.id),t&&(this.unmount=t(this.id))}unmount(){}}const LX={animation:{Feature:OX},exit:{Feature:NX}};function Kh(e){return{point:{x:e.pageX,y:e.pageY}}}const $X=e=>t=>mx(t)&&e(t,Kh(t));function sh(e,t,n,r){return kh(e,t,$X(n),r)}const tL=({current:e})=>e?e.ownerDocument.defaultView:null,XP=(e,t)=>Math.abs(e-t);function DX(e,t){const n=XP(e.x,t.x),r=XP(e.y,t.y);return Math.sqrt(n**2+r**2)}const JP=new Set(["auto","scroll"]);class nL{constructor(t,n,{transformPagePoint:r,contextWindow:s=window,dragSnapToOrigin:i=!1,distanceThreshold:o=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=_=>{this.handleScroll(_.target)},this.onWindowScroll=()=>{this.handleScroll(window)},this.updatePoint=()=>{if(!(this.lastMoveEvent&&this.lastMoveEventInfo))return;this.lastRawMoveEventInfo&&(this.lastMoveEventInfo=xm(this.lastRawMoveEventInfo,this.transformPagePoint));const _=q1(this.lastMoveEventInfo,this.history),w=this.startEvent!==null,b=DX(_.offset,{x:0,y:0})>=this.distanceThreshold;if(!w&&!b)return;const{point:S}=_,{timestamp:E}=Dr;this.history.push({...S,timestamp:E});const{onStart:C,onMove:A}=this.handlers;w||(C&&C(this.lastMoveEvent,_),this.startEvent=this.lastMoveEvent),A&&A(this.lastMoveEvent,_)},this.handlePointerMove=(_,w)=>{this.lastMoveEvent=_,this.lastRawMoveEventInfo=w,this.lastMoveEventInfo=xm(w,this.transformPagePoint),yn.update(this.updatePoint,!0)},this.handlePointerUp=(_,w)=>{this.end();const{onEnd:b,onSessionEnd:S,resumeAnimation:E}=this.handlers;if((this.dragSnapToOrigin||!this.startEvent)&&E&&E(),!(this.lastMoveEvent&&this.lastMoveEventInfo))return;const C=q1(_.type==="pointercancel"?this.lastMoveEventInfo:xm(w,this.transformPagePoint),this.history);this.startEvent&&b&&b(_,C),S&&S(_,C)},!mx(t))return;this.dragSnapToOrigin=i,this.handlers=n,this.transformPagePoint=r,this.distanceThreshold=o,this.contextWindow=s||window;const u=Kh(t),d=xm(u,this.transformPagePoint),{point:f}=d,{timestamp:p}=Dr;this.history=[{...f,timestamp:p}];const{onSessionStart:m}=n;m&&m(t,q1(d,this.history));const v={passive:!0,capture:!0};this.removeListeners=Zh(sh(this.contextWindow,"pointermove",this.handlePointerMove,v),sh(this.contextWindow,"pointerup",this.handlePointerUp,v),sh(this.contextWindow,"pointercancel",this.handlePointerUp,v)),c&&this.startScrollTracking(c)}startScrollTracking(t){let n=t.parentElement;for(;n;){const r=getComputedStyle(n);(JP.has(r.overflowX)||JP.has(r.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(t){const n=this.scrollPositions.get(t);if(!n)return;const r=t===window,s=r?{x:window.scrollX,y:window.scrollY}:{x:t.scrollLeft,y:t.scrollTop},i={x:s.x-n.x,y:s.y-n.y};i.x===0&&i.y===0||(r?this.lastMoveEventInfo&&(this.lastMoveEventInfo.point.x+=i.x,this.lastMoveEventInfo.point.y+=i.y):this.history.length>0&&(this.history[0].x-=i.x,this.history[0].y-=i.y),this.scrollPositions.set(t,s),yn.update(this.updatePoint,!0))}updateHandlers(t){this.handlers=t}end(){this.removeListeners&&this.removeListeners(),this.removeScrollListeners&&this.removeScrollListeners(),this.scrollPositions.clear(),pl(this.updatePoint)}}function xm(e,t){return t?{point:t(e.point)}:e}function eA(e,t){return{x:e.x-t.x,y:e.y-t.y}}function q1({point:e},t){return{point:e,delta:eA(e,rL(t)),offset:eA(e,FX(t)),velocity:jX(t,.1)}}function FX(e){return e[0]}function rL(e){return e[e.length-1]}function jX(e,t){if(e.length<2)return{x:0,y:0};let n=e.length-1,r=null;const s=rL(e);for(;n>=0&&(r=e[n],!(s.timestamp-r.timestamp>qs(t)));)n--;if(!r)return{x:0,y:0};r===e[0]&&e.length>2&&s.timestamp-r.timestamp>qs(t)*2&&(r=e[1]);const i=hi(s.timestamp-r.timestamp);if(i===0)return{x:0,y:0};const o={x:(s.x-r.x)/i,y:(s.y-r.y)/i};return o.x===1/0&&(o.x=0),o.y===1/0&&(o.y=0),o}function zX(e,{min:t,max:n},r){return t!==void 0&&e<t?e=r?vn(t,e,r.min):Math.max(e,t):n!==void 0&&e>n&&(e=r?vn(n,e,r.max):Math.min(e,n)),e}function tA(e,t,n){return{min:t!==void 0?e.min+t:void 0,max:n!==void 0?e.max+n-(e.max-e.min):void 0}}function VX(e,{top:t,left:n,bottom:r,right:s}){return{x:tA(e.x,n,s),y:tA(e.y,t,r)}}function nA(e,t){let n=t.min-e.min,r=t.max-e.max;return t.max-t.min<e.max-e.min&&([n,r]=[r,n]),{min:n,max:r}}function HX(e,t){return{x:nA(e.x,t.x),y:nA(e.y,t.y)}}function UX(e,t){let n=.5;const r=ms(e),s=ms(t);return s>r?n=xh(t.min,t.max-r,e.min):r>s&&(n=xh(e.min,e.max-s,t.min)),wo(0,1,n)}function ZX(e,t){const n={};return t.min!==void 0&&(n.min=t.min-e.min),t.max!==void 0&&(n.max=t.max-e.min),n}const d2=.35;function BX(e=d2){return e===!1?e=0:e===!0&&(e=d2),{x:rA(e,"left","right"),y:rA(e,"top","bottom")}}function rA(e,t,n){return{min:sA(e,t),max:sA(e,n)}}function sA(e,t){return typeof e=="number"?e:e[t]||0}const WX=new WeakMap;class KX{constructor(t){this.openDragLock=null,this.isDragging=!1,this.currentDirection=null,this.originPoint={x:0,y:0},this.constraints=!1,this.hasMutatedConstraints=!1,this.elastic=pr(),this.latestPointerEvent=null,this.latestPanInfo=null,this.visualElement=t}start(t,{snapToCursor:n=!1,distanceThreshold:r}={}){const{presenceContext:s}=this.visualElement;if(s&&s.isPresent===!1)return;const i=p=>{n&&this.snapToCursor(Kh(p).point),this.stopAnimation()},o=(p,m)=>{const{drag:v,dragPropagation:_,onDragStart:w}=this.getProps();if(v&&!_&&(this.openDragLock&&this.openDragLock(),this.openDragLock=bY(v),!this.openDragLock))return;this.latestPointerEvent=p,this.latestPanInfo=m,this.isDragging=!0,this.currentDirection=null,this.resolveConstraints(),this.visualElement.projection&&(this.visualElement.projection.isAnimationBlocked=!0,this.visualElement.projection.target=void 0),io(S=>{let E=this.getAxisMotionValue(S).get()||0;if(vo.test(E)){const{projection:C}=this.visualElement;if(C&&C.layout){const A=C.layout.layoutBox[S];A&&(E=ms(A)*(parseFloat(E)/100))}}this.originPoint[S]=E}),w&&yn.update(()=>w(p,m),!1,!0),n2(this.visualElement,"transform");const{animationState:b}=this.visualElement;b&&b.setActive("whileDrag",!0)},c=(p,m)=>{this.latestPointerEvent=p,this.latestPanInfo=m;const{dragPropagation:v,dragDirectionLock:_,onDirectionLock:w,onDrag:b}=this.getProps();if(!v&&!this.openDragLock)return;const{offset:S}=m;if(_&&this.currentDirection===null){this.currentDirection=qX(S),this.currentDirection!==null&&w&&w(this.currentDirection);return}this.updateAxis("x",m.point,S),this.updateAxis("y",m.point,S),this.visualElement.render(),b&&yn.update(()=>b(p,m),!1,!0)},u=(p,m)=>{this.latestPointerEvent=p,this.latestPanInfo=m,this.stop(p,m),this.latestPointerEvent=null,this.latestPanInfo=null},d=()=>{const{dragSnapToOrigin:p}=this.getProps();(p||this.constraints)&&this.startAnimation({x:0,y:0})},{dragSnapToOrigin:f}=this.getProps();this.panSession=new nL(t,{onSessionStart:i,onStart:o,onMove:c,onSessionEnd:u,resumeAnimation:d},{transformPagePoint:this.visualElement.getTransformPagePoint(),dragSnapToOrigin:f,distanceThreshold:r,contextWindow:tL(this.visualElement),element:this.visualElement.current})}stop(t,n){const r=t||this.latestPointerEvent,s=n||this.latestPanInfo,i=this.isDragging;if(this.cancel(),!i||!s||!r)return;const{velocity:o}=s;this.startAnimation(o);const{onDragEnd:c}=this.getProps();c&&yn.postRender(()=>c(r,s))}cancel(){this.isDragging=!1;const{projection:t,animationState:n}=this.visualElement;t&&(t.isAnimationBlocked=!1),this.endPanSession();const{dragPropagation:r}=this.getProps();!r&&this.openDragLock&&(this.openDragLock(),this.openDragLock=null),n&&n.setActive("whileDrag",!1)}endPanSession(){this.panSession&&this.panSession.end(),this.panSession=void 0}updateAxis(t,n,r){const{drag:s}=this.getProps();if(!r||!Sm(t,s,this.currentDirection))return;const i=this.getAxisMotionValue(t);let o=this.originPoint[t]+r[t];this.constraints&&this.constraints[t]&&(o=zX(o,this.constraints[t],this.elastic[t])),i.set(o)}resolveConstraints(){var i;const{dragConstraints:t,dragElastic:n}=this.getProps(),r=this.visualElement.projection&&!this.visualElement.projection.layout?this.visualElement.projection.measure(!1):(i=this.visualElement.projection)==null?void 0:i.layout,s=this.constraints;t&&yu(t)?this.constraints||(this.constraints=this.resolveRefConstraints()):t&&r?this.constraints=VX(r.layoutBox,t):this.constraints=!1,this.elastic=BX(n),s!==this.constraints&&!yu(t)&&r&&this.constraints&&!this.hasMutatedConstraints&&io(o=>{this.constraints!==!1&&this.getAxisMotionValue(o)&&(this.constraints[o]=ZX(r.layoutBox[o],this.constraints[o]))})}resolveRefConstraints(){const{dragConstraints:t,onMeasureDragConstraints:n}=this.getProps();if(!t||!yu(t))return!1;const r=t.current,{projection:s}=this.visualElement;if(!s||!s.layout)return!1;s.root&&(s.root.scroll=void 0,s.root.updateScroll());const i=qY(r,s.root,this.visualElement.getTransformPagePoint());let o=HX(s.layout.layoutBox,i);if(n){const c=n(WY(o));this.hasMutatedConstraints=!!c,c&&(o=EN(c))}return o}startAnimation(t){const{drag:n,dragMomentum:r,dragElastic:s,dragTransition:i,dragSnapToOrigin:o,onDragTransitionEnd:c}=this.getProps(),u=this.constraints||{},d=io(f=>{if(!Sm(f,n,this.currentDirection))return;let p=u&&u[f]||{};(o===!0||o===f)&&(p={min:0,max:0});const m=s?200:1e6,v=s?40:1e7,_={type:"inertia",velocity:r?t[f]:0,bounceStiffness:m,bounceDamping:v,timeConstant:750,restDelta:1,restSpeed:10,...i,...p};return this.startAxisValueAnimation(f,_)});return Promise.all(d).then(c)}startAxisValueAnimation(t,n){const r=this.getAxisMotionValue(t);return n2(this.visualElement,t),r.start(ux(t,r,0,n,this.visualElement,!1))}stopAnimation(){io(t=>this.getAxisMotionValue(t).stop())}getAxisMotionValue(t){const n=`_drag${t.toUpperCase()}`,s=this.visualElement.getProps()[n];return s||this.visualElement.getValue(t,this.visualElement.latestValues[t]??0)}snapToCursor(t){io(n=>{const{drag:r}=this.getProps();if(!Sm(n,r,this.currentDirection))return;const{projection:s}=this.visualElement,i=this.getAxisMotionValue(n);if(s&&s.layout){const{min:o,max:c}=s.layout.layoutBox[n],u=i.get()||0;i.set(t[n]-vn(o,c,.5)+u)}})}scalePositionWithinConstraints(){if(!this.visualElement.current)return;const{drag:t,dragConstraints:n}=this.getProps(),{projection:r}=this.visualElement;if(!yu(n)||!r||!this.constraints)return;this.stopAnimation();const s={x:0,y:0};io(o=>{const c=this.getAxisMotionValue(o);if(c&&this.constraints!==!1){const u=c.get();s[o]=UX({min:u,max:u},this.constraints[o])}});const{transformTemplate:i}=this.visualElement.getProps();this.visualElement.current.style.transform=i?i({},""):"none",r.root&&r.root.updateScroll(),r.updateLayout(),this.constraints=!1,this.resolveConstraints(),io(o=>{if(!Sm(o,t,null))return;const c=this.getAxisMotionValue(o),{min:u,max:d}=this.constraints[o];c.set(vn(u,d,s[o]))}),this.visualElement.render()}addListeners(){if(!this.visualElement.current)return;WX.set(this.visualElement,this);const t=this.visualElement.current,n=sh(t,"pointerdown",d=>{const{drag:f,dragListener:p=!0}=this.getProps(),m=d.target,v=m!==t&&PY(m);f&&p&&!v&&this.start(d)});let r;const s=()=>{const{dragConstraints:d}=this.getProps();yu(d)&&d.current&&(this.constraints=this.resolveRefConstraints(),r||(r=GX(t,d.current,()=>this.scalePositionWithinConstraints())))},{projection:i}=this.visualElement,o=i.addEventListener("measure",s);i&&!i.layout&&(i.root&&i.root.updateScroll(),i.updateLayout()),yn.read(s);const c=kh(window,"resize",()=>this.scalePositionWithinConstraints()),u=i.addEventListener("didUpdate",(({delta:d,hasLayoutChanged:f})=>{this.isDragging&&f&&(io(p=>{const m=this.getAxisMotionValue(p);m&&(this.originPoint[p]+=d[p].translate,m.set(m.get()+d[p].translate))}),this.visualElement.render())}));return()=>{c(),n(),o(),u&&u(),r&&r()}}getProps(){const t=this.visualElement.getProps(),{drag:n=!1,dragDirectionLock:r=!1,dragPropagation:s=!1,dragConstraints:i=!1,dragElastic:o=d2,dragMomentum:c=!0}=t;return{...t,drag:n,dragDirectionLock:r,dragPropagation:s,dragConstraints:i,dragElastic:o,dragMomentum:c}}}function iA(e){let t=!0;return()=>{if(t){t=!1;return}e()}}function GX(e,t,n){const r=fP(e,iA(n)),s=fP(t,iA(n));return()=>{r(),s()}}function Sm(e,t,n){return(t===!0||t===e)&&(n===null||n===e)}function qX(e,t=10){let n=null;return Math.abs(e.y)>t?n="y":Math.abs(e.x)>t&&(n="x"),n}class YX extends _l{constructor(t){super(t),this.removeGroupControls=gi,this.removeListeners=gi,this.controls=new KX(t)}mount(){const{dragControls:t}=this.node.getProps();t&&(this.removeGroupControls=t.subscribe(this.controls)),this.removeListeners=this.controls.addListeners()||gi}update(){const{dragControls:t}=this.node.getProps(),{dragControls:n}=this.node.prevProps||{};t!==n&&(this.removeGroupControls(),t&&(this.removeGroupControls=t.subscribe(this.controls)))}unmount(){this.removeGroupControls(),this.removeListeners(),this.controls.isDragging||this.controls.endPanSession()}}const Y1=e=>(t,n)=>{e&&yn.update(()=>e(t,n),!1,!0)};class QX extends _l{constructor(){super(...arguments),this.removePointerDownListener=gi}onPointerDown(t){this.session=new nL(t,this.createPanHandlers(),{transformPagePoint:this.node.getTransformPagePoint(),contextWindow:tL(this.node)})}createPanHandlers(){const{onPanSessionStart:t,onPanStart:n,onPan:r,onPanEnd:s}=this.node.getProps();return{onSessionStart:Y1(t),onStart:Y1(n),onMove:Y1(r),onEnd:(i,o)=>{delete this.session,s&&yn.postRender(()=>s(i,o))}}}mount(){this.removePointerDownListener=sh(this.node.current,"pointerdown",t=>this.onPointerDown(t))}update(){this.session&&this.session.updateHandlers(this.createPanHandlers())}unmount(){this.removePointerDownListener(),this.session&&this.session.end()}}let Q1=!1;class XX extends g.Component{componentDidMount(){const{visualElement:t,layoutGroup:n,switchLayoutGroup:r,layoutId:s}=this.props,{projection:i}=t;i&&(n.group&&n.group.add(i),r&&r.register&&s&&r.register(i),Q1&&i.root.didUpdate(),i.addEventListener("animationComplete",()=>{this.safeToRemove()}),i.setOptions({...i.options,layoutDependency:this.props.layoutDependency,onExitComplete:()=>this.safeToRemove()})),o0.hasEverUpdated=!0}getSnapshotBeforeUpdate(t){const{layoutDependency:n,visualElement:r,drag:s,isPresent:i}=this.props,{projection:o}=r;return o&&(o.isPresent=i,t.layoutDependency!==n&&o.setOptions({...o.options,layoutDependency:n}),Q1=!0,s||t.layoutDependency!==n||n===void 0||t.isPresent!==i?o.willUpdate():this.safeToRemove(),t.isPresent!==i&&(i?o.promote():o.relegate()||yn.postRender(()=>{const c=o.getStack();(!c||!c.members.length)&&this.safeToRemove()}))),null}componentDidUpdate(){const{visualElement:t,layoutAnchor:n}=this.props,{projection:r}=t;r&&(r.options.layoutAnchor=n,r.root.didUpdate(),px.postRender(()=>{!r.currentAnimation&&r.isLead()&&this.safeToRemove()}))}componentWillUnmount(){const{visualElement:t,layoutGroup:n,switchLayoutGroup:r}=this.props,{projection:s}=t;Q1=!0,s&&(s.scheduleCheckAfterUnmount(),n&&n.group&&n.group.remove(s),r&&r.deregister&&r.deregister(s))}safeToRemove(){const{safeToRemove:t}=this.props;t&&t()}render(){return null}}function sL(e){const[t,n]=BN(),r=g.useContext(qb);return P.jsx(XX,{...e,layoutGroup:r,switchLayoutGroup:g.useContext(JN),isPresent:t,safeToRemove:n})}const JX={pan:{Feature:QX},drag:{Feature:YX,ProjectionNode:ZN,MeasureLayout:sL}};function oA(e,t,n){const{props:r}=e;e.animationState&&r.whileHover&&e.animationState.setActive("whileHover",n==="Start");const s="onHover"+n,i=r[s];i&&yn.postRender(()=>i(t,Kh(t)))}class eJ extends _l{mount(){const{current:t}=this.node;t&&(this.unmount=SY(t,(n,r)=>(oA(this.node,r,"Start"),s=>oA(this.node,s,"End"))))}unmount(){}}class tJ extends _l{constructor(){super(...arguments),this.isActive=!1}onFocus(){let t=!1;try{t=this.node.current.matches(":focus-visible")}catch{t=!0}!t||!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=Zh(kh(this.node.current,"focus",()=>this.onFocus()),kh(this.node.current,"blur",()=>this.onBlur()))}unmount(){}}function aA(e,t,n){const{props:r}=e;if(e.current instanceof HTMLButtonElement&&e.current.disabled)return;e.animationState&&r.whileTap&&e.animationState.setActive("whileTap",n==="Start");const s="onTap"+(n==="End"?"":n),i=r[s];i&&yn.postRender(()=>i(t,Kh(t)))}class nJ extends _l{mount(){const{current:t}=this.node;if(!t)return;const{globalTapTarget:n,propagate:r}=this.node.props;this.unmount=TY(t,(s,i)=>(aA(this.node,i,"Start"),(o,{success:c})=>aA(this.node,o,c?"End":"Cancel")),{useGlobalTarget:n,stopPropagation:(r==null?void 0:r.tap)===!1})}unmount(){}}const f2=new WeakMap,X1=new WeakMap,rJ=e=>{const t=f2.get(e.target);t&&t(e)},sJ=e=>{e.forEach(rJ)};function iJ({root:e,...t}){const n=e||document;X1.has(n)||X1.set(n,{});const r=X1.get(n),s=JSON.stringify(t);return r[s]||(r[s]=new IntersectionObserver(sJ,{root:e,...t})),r[s]}function oJ(e,t,n){const r=iJ(t);return f2.set(e,n),r.observe(e),()=>{f2.delete(e),r.unobserve(e)}}const aJ={some:0,all:1};class lJ extends _l{constructor(){super(...arguments),this.hasEnteredView=!1,this.isInView=!1}startObserver(){var u;(u=this.stopObserver)==null||u.call(this);const{viewport:t={}}=this.node.getProps(),{root:n,margin:r,amount:s="some",once:i}=t,o={root:n?n.current:void 0,rootMargin:r,threshold:typeof s=="number"?s:aJ[s]},c=d=>{const{isIntersecting:f}=d;if(this.isInView===f||(this.isInView=f,i&&!f&&this.hasEnteredView))return;f&&(this.hasEnteredView=!0),this.node.animationState&&this.node.animationState.setActive("whileInView",f);const{onViewportEnter:p,onViewportLeave:m}=this.node.getProps(),v=f?p:m;v&&v(d)};this.stopObserver=oJ(this.node.current,o,c)}mount(){this.startObserver()}update(){if(typeof IntersectionObserver>"u")return;const{props:t,prevProps:n}=this.node;["amount","margin","root"].some(cJ(t,n))&&this.startObserver()}unmount(){var t;(t=this.stopObserver)==null||t.call(this),this.hasEnteredView=!1,this.isInView=!1}}function cJ({viewport:e={}},{viewport:t={}}={}){return n=>e[n]!==t[n]}const uJ={inView:{Feature:lJ},tap:{Feature:nJ},focus:{Feature:tJ},hover:{Feature:eJ}},dJ={layout:{ProjectionNode:ZN,MeasureLayout:sL}},fJ={...LX,...uJ,...JX,...dJ},hJ=RX(fJ,IX);function pJ(){!_x.current&&bN();const[e]=g.useState(rg.current);return e}const ta=hJ;var mJ=(function(){var e=function(t,n){return e=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(r,s){r.__proto__=s}||function(r,s){for(var i in s)Object.prototype.hasOwnProperty.call(s,i)&&(r[i]=s[i])},e(t,n)};return function(t,n){if(typeof n!="function"&&n!==null)throw new TypeError("Class extends value "+String(n)+" is not a constructor or null");e(t,n);function r(){this.constructor=t}t.prototype=n===null?Object.create(n):(r.prototype=n.prototype,new r)}})();var gJ=function(e,t,n){return typeof t=="symbol"&&(t=t.description?"[".concat(t.description,"]"):""),Object.defineProperty(e,"name",{configurable:!0,value:n?"".concat(n," ",t):t})},Em,lA="__POSTHOG_REACT_SHARED_STATE__",cA=typeof globalThis<"u"?globalThis:typeof window<"u"?window:{},Ph;try{Ph=cA[lA]=cA[lA]||new WeakMap}catch{Ph=new WeakMap}Ph.has(g.createContext)||Ph.set(g.createContext,{});var vc=Ph.get(g.createContext),h2;function vJ(e){(!vc.defaultPostHogInstance||vc.defaultPostHogInstance===h2)&&(vc.defaultPostHogInstance=e),h2=e}function p2(){return h2}vc.context||(vc.context=g.createContext({get client(){return p2()||vc.defaultPostHogInstance},bootstrap:void 0}));var Ex=vc.context;function iL(e,t,n){if(n===void 0&&(n=new WeakMap),e===t)return!0;if(typeof e!="object"||e===null||typeof t!="object"||t===null)return!1;if(n.has(e)&&n.get(e)===t)return!0;n.set(e,t);var r=Object.keys(e),s=Object.keys(t);if(r.length!==s.length)return!1;for(var i=0,o=r;i<o.length;i++){var c=o[i];if(!s.includes(c)||!iL(e[c],t[c],n))return!1}return!0}function yJ(e){var t,n,r=e.children,s=e.client,i=e.apiKey,o=e.options,c=g.useRef(null),u=g.useMemo(function(){if(s)return i&&console.warn("[PostHog.js] You have provided both `client` and `apiKey` to `PostHogProvider`. `apiKey` will be ignored in favour of `client`."),o&&console.warn("[PostHog.js] You have provided both `client` and `options` to `PostHogProvider`. `options` will be ignored in favour of `client`."),s;var d=p2();return i||console.warn("[PostHog.js] No `apiKey` or `client` were provided to `PostHogProvider`. Using default global `window.posthog` instance. You must initialize it manually. This is not recommended behavior."),d},[s,i,JSON.stringify(o)]);return g.useEffect(function(){if(!(s||!i)){var d=p2(),f=c.current;f?(i!==f.apiKey&&console.warn("[PostHog.js] You have provided a different `apiKey` to `PostHogProvider` than the one that was already initialized. This is not supported by our provider and we'll keep using the previous key. If you need to toggle between API Keys you need to control the `client` yourself and pass it in as a prop rather than an `apiKey` prop."),o&&!iL(o,f.options)&&d.set_config(o),c.current={apiKey:i,options:o??{}}):(d.__loaded&&console.warn("[PostHog.js] `posthog` was already loaded elsewhere. This may cause issues."),d.init(i,o),c.current={apiKey:i,options:o??{}})}},[s,i,JSON.stringify(o)]),Ee.createElement(Ex.Provider,{value:{client:u,bootstrap:(t=o==null?void 0:o.bootstrap)!==null&&t!==void 0?t:(n=s==null?void 0:s.config)===null||n===void 0?void 0:n.bootstrap}},r)}var J1=function(e){return typeof e=="function"},_J=function(e){return e===void 0},Ms=function(){var e=g.useContext(Ex).client;return e},a0=function(e){var t=Object.prototype.toString.call(e);return e instanceof Error||t==="[object Error]"||t==="[object Exception]"||t==="[object DOMException]"||t==="[object DOMError]"},wJ=function(e,t){try{Object.defineProperty(e,"name",{value:t,writable:!0,enumerable:!0,configurable:!0})}catch{}},bJ=function(e,t){for(var n=new WeakSet,r=e;!n.has(r);){if(n.add(r),!a0(r.cause)){_J(r.cause)||(t.cause=r.cause),r.cause=t;return}r=r.cause}},xJ=function(e,t){if(!t)return e;var n=new Error(a0(e)?e.message:"Primitive value captured as exception: ".concat(String(e)));return wJ(n,"React ErrorBoundary ".concat(a0(e)?e.name:"Error")),n.stack=t,a0(e)?(bJ(e,n),e):n},uA={componentStack:null,exceptionEvent:null,error:null},SJ={INVALID_FALLBACK:"[PostHog.js][PostHogErrorBoundary] Invalid fallback prop, provide a valid React element or a function that returns a valid React element."},EJ=(Em=(function(e){mJ(t,e);function t(n){var r=e.call(this,n)||this;return r._resetError=function(){r.setState(uA)},r.state=uA,r}return t.prototype.componentDidCatch=function(n,r){var s=this.props.additionalProperties,i;J1(s)?i=s(n,r):typeof s=="object"&&(i=s);var o=this.context.client,c=r.componentStack,u=o.captureException(xJ(n,c),i);this.setState({error:n,componentStack:c??null,exceptionEvent:u})},t.prototype.render=function(){var n=this.props,r=n.children,s=n.fallback,i=this.state;if(i.componentStack==null)return J1(r)?r():r;var o=J1(s)?Ee.createElement(s,{error:i.error,componentStack:i.componentStack,exceptionEvent:i.exceptionEvent,resetError:this._resetError}):s;return Ee.isValidElement(o)?o:(console.warn(SJ.INVALID_FALLBACK),Ee.createElement(Ee.Fragment,null))},t})(Ee.Component),gJ(Em,"PostHogErrorBoundary"),(function(){Em.contextType=Ex})(),Em);vJ(Qe);const kJ="rivet-preview-bridge",CJ=["ArrowUp","ArrowDown"],PJ=new Set(["INPUT","TEXTAREA","SELECT"]),oL=e=>!e||!("tagName"in e)||typeof e.tagName!="string"?!1:PJ.has(e.tagName.toUpperCase())||"isContentEditable"in e&&e.isContentEditable===!0,AJ=e=>typeof e!="object"||e===null||!("channel"in e)||e.channel!==kJ||!("direction"in e)||e.direction!=="event"||!("type"in e)||e.type!=="keydown"||!("key"in e)?null:CJ.find(t=>t===e.key)??null,TJ=e=>{try{return new URL(e.src,window.location.href).origin}catch{return null}},RJ=e=>e.source===null?null:Array.from(document.querySelectorAll("iframe")).find(t=>t.contentWindow===e.source&&TJ(t)===e.origin)??null,IJ=e=>{const t=n=>{oL(n.target)||e(n)};return window.addEventListener("keydown",t),()=>window.removeEventListener("keydown",t)},OJ=()=>{const e=t=>{const n=AJ(t.data),r=n?RJ(t):null;!n||!r||r.dispatchEvent(new KeyboardEvent("keydown",{key:n,bubbles:!0,cancelable:!0}))};return window.addEventListener("message",e),()=>window.removeEventListener("message",e)};var km={},e_={exports:{}},Es={},t_={exports:{}},n_={};/**
|
|
86
|
+
* @license React
|
|
87
|
+
* scheduler.production.min.js
|
|
88
|
+
*
|
|
89
|
+
* Copyright (c) Facebook, Inc. and its affiliates.
|
|
90
|
+
*
|
|
91
|
+
* This source code is licensed under the MIT license found in the
|
|
92
|
+
* LICENSE file in the root directory of this source tree.
|
|
93
|
+
*/var dA;function MJ(){return dA||(dA=1,(function(e){function t(F,X){var B=F.length;F.push(X);e:for(;0<B;){var L=B-1>>>1,G=F[L];if(0<s(G,X))F[L]=X,F[B]=G,B=L;else break e}}function n(F){return F.length===0?null:F[0]}function r(F){if(F.length===0)return null;var X=F[0],B=F.pop();if(B!==X){F[0]=B;e:for(var L=0,G=F.length,ue=G>>>1;L<ue;){var te=2*(L+1)-1,ie=F[te],he=te+1,ke=F[he];if(0>s(ie,B))he<G&&0>s(ke,ie)?(F[L]=ke,F[he]=B,L=he):(F[L]=ie,F[te]=B,L=te);else if(he<G&&0>s(ke,B))F[L]=ke,F[he]=B,L=he;else break e}}return X}function s(F,X){var B=F.sortIndex-X.sortIndex;return B!==0?B:F.id-X.id}if(typeof performance=="object"&&typeof performance.now=="function"){var i=performance;e.unstable_now=function(){return i.now()}}else{var o=Date,c=o.now();e.unstable_now=function(){return o.now()-c}}var u=[],d=[],f=1,p=null,m=3,v=!1,_=!1,w=!1,b=typeof setTimeout=="function"?setTimeout:null,S=typeof clearTimeout=="function"?clearTimeout:null,E=typeof setImmediate<"u"?setImmediate:null;typeof navigator<"u"&&navigator.scheduling!==void 0&&navigator.scheduling.isInputPending!==void 0&&navigator.scheduling.isInputPending.bind(navigator.scheduling);function C(F){for(var X=n(d);X!==null;){if(X.callback===null)r(d);else if(X.startTime<=F)r(d),X.sortIndex=X.expirationTime,t(u,X);else break;X=n(d)}}function A(F){if(w=!1,C(F),!_)if(n(u)!==null)_=!0,q(T);else{var X=n(d);X!==null&&ee(A,X.startTime-F)}}function T(F,X){_=!1,w&&(w=!1,S(R),R=-1),v=!0;var B=m;try{for(C(X),p=n(u);p!==null&&(!(p.expirationTime>X)||F&&!W());){var L=p.callback;if(typeof L=="function"){p.callback=null,m=p.priorityLevel;var G=L(p.expirationTime<=X);X=e.unstable_now(),typeof G=="function"?p.callback=G:p===n(u)&&r(u),C(X)}else r(u);p=n(u)}if(p!==null)var ue=!0;else{var te=n(d);te!==null&&ee(A,te.startTime-X),ue=!1}return ue}finally{p=null,m=B,v=!1}}var M=!1,O=null,R=-1,D=5,U=-1;function W(){return!(e.unstable_now()-U<D)}function H(){if(O!==null){var F=e.unstable_now();U=F;var X=!0;try{X=O(!0,F)}finally{X?Y():(M=!1,O=null)}}else M=!1}var Y;if(typeof E=="function")Y=function(){E(H)};else if(typeof MessageChannel<"u"){var J=new MessageChannel,V=J.port2;J.port1.onmessage=H,Y=function(){V.postMessage(null)}}else Y=function(){b(H,0)};function q(F){O=F,M||(M=!0,Y())}function ee(F,X){R=b(function(){F(e.unstable_now())},X)}e.unstable_IdlePriority=5,e.unstable_ImmediatePriority=1,e.unstable_LowPriority=4,e.unstable_NormalPriority=3,e.unstable_Profiling=null,e.unstable_UserBlockingPriority=2,e.unstable_cancelCallback=function(F){F.callback=null},e.unstable_continueExecution=function(){_||v||(_=!0,q(T))},e.unstable_forceFrameRate=function(F){0>F||125<F?console.error("forceFrameRate takes a positive int between 0 and 125, forcing frame rates higher than 125 fps is not supported"):D=0<F?Math.floor(1e3/F):5},e.unstable_getCurrentPriorityLevel=function(){return m},e.unstable_getFirstCallbackNode=function(){return n(u)},e.unstable_next=function(F){switch(m){case 1:case 2:case 3:var X=3;break;default:X=m}var B=m;m=X;try{return F()}finally{m=B}},e.unstable_pauseExecution=function(){},e.unstable_requestPaint=function(){},e.unstable_runWithPriority=function(F,X){switch(F){case 1:case 2:case 3:case 4:case 5:break;default:F=3}var B=m;m=F;try{return X()}finally{m=B}},e.unstable_scheduleCallback=function(F,X,B){var L=e.unstable_now();switch(typeof B=="object"&&B!==null?(B=B.delay,B=typeof B=="number"&&0<B?L+B:L):B=L,F){case 1:var G=-1;break;case 2:G=250;break;case 5:G=1073741823;break;case 4:G=1e4;break;default:G=5e3}return G=B+G,F={id:f++,callback:X,priorityLevel:F,startTime:B,expirationTime:G,sortIndex:-1},B>L?(F.sortIndex=B,t(d,F),n(u)===null&&F===n(d)&&(w?(S(R),R=-1):w=!0,ee(A,B-L))):(F.sortIndex=G,t(u,F),_||v||(_=!0,q(T))),F},e.unstable_shouldYield=W,e.unstable_wrapCallback=function(F){var X=m;return function(){var B=m;m=X;try{return F.apply(this,arguments)}finally{m=B}}}})(n_)),n_}var fA;function NJ(){return fA||(fA=1,t_.exports=MJ()),t_.exports}/**
|
|
94
|
+
* @license React
|
|
95
|
+
* react-dom.production.min.js
|
|
96
|
+
*
|
|
97
|
+
* Copyright (c) Facebook, Inc. and its affiliates.
|
|
98
|
+
*
|
|
99
|
+
* This source code is licensed under the MIT license found in the
|
|
100
|
+
* LICENSE file in the root directory of this source tree.
|
|
101
|
+
*/var hA;function LJ(){if(hA)return Es;hA=1;var e=Q2(),t=NJ();function n(a){for(var l="https://reactjs.org/docs/error-decoder.html?invariant="+a,h=1;h<arguments.length;h++)l+="&args[]="+encodeURIComponent(arguments[h]);return"Minified React error #"+a+"; visit "+l+" for the full message or use the non-minified dev environment for full errors and additional helpful warnings."}var r=new Set,s={};function i(a,l){o(a,l),o(a+"Capture",l)}function o(a,l){for(s[a]=l,a=0;a<l.length;a++)r.add(l[a])}var c=!(typeof window>"u"||typeof window.document>"u"||typeof window.document.createElement>"u"),u=Object.prototype.hasOwnProperty,d=/^[: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]*$/,f={},p={};function m(a){return u.call(p,a)?!0:u.call(f,a)?!1:d.test(a)?p[a]=!0:(f[a]=!0,!1)}function v(a,l,h,y){if(h!==null&&h.type===0)return!1;switch(typeof l){case"function":case"symbol":return!0;case"boolean":return y?!1:h!==null?!h.acceptsBooleans:(a=a.toLowerCase().slice(0,5),a!=="data-"&&a!=="aria-");default:return!1}}function _(a,l,h,y){if(l===null||typeof l>"u"||v(a,l,h,y))return!0;if(y)return!1;if(h!==null)switch(h.type){case 3:return!l;case 4:return l===!1;case 5:return isNaN(l);case 6:return isNaN(l)||1>l}return!1}function w(a,l,h,y,x,k,I){this.acceptsBooleans=l===2||l===3||l===4,this.attributeName=y,this.attributeNamespace=x,this.mustUseProperty=h,this.propertyName=a,this.type=l,this.sanitizeURL=k,this.removeEmptyString=I}var b={};"children dangerouslySetInnerHTML defaultValue defaultChecked innerHTML suppressContentEditableWarning suppressHydrationWarning style".split(" ").forEach(function(a){b[a]=new w(a,0,!1,a,null,!1,!1)}),[["acceptCharset","accept-charset"],["className","class"],["htmlFor","for"],["httpEquiv","http-equiv"]].forEach(function(a){var l=a[0];b[l]=new w(l,1,!1,a[1],null,!1,!1)}),["contentEditable","draggable","spellCheck","value"].forEach(function(a){b[a]=new w(a,2,!1,a.toLowerCase(),null,!1,!1)}),["autoReverse","externalResourcesRequired","focusable","preserveAlpha"].forEach(function(a){b[a]=new w(a,2,!1,a,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(a){b[a]=new w(a,3,!1,a.toLowerCase(),null,!1,!1)}),["checked","multiple","muted","selected"].forEach(function(a){b[a]=new w(a,3,!0,a,null,!1,!1)}),["capture","download"].forEach(function(a){b[a]=new w(a,4,!1,a,null,!1,!1)}),["cols","rows","size","span"].forEach(function(a){b[a]=new w(a,6,!1,a,null,!1,!1)}),["rowSpan","start"].forEach(function(a){b[a]=new w(a,5,!1,a.toLowerCase(),null,!1,!1)});var S=/[\-:]([a-z])/g;function E(a){return a[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(a){var l=a.replace(S,E);b[l]=new w(l,1,!1,a,null,!1,!1)}),"xlink:actuate xlink:arcrole xlink:role xlink:show xlink:title xlink:type".split(" ").forEach(function(a){var l=a.replace(S,E);b[l]=new w(l,1,!1,a,"http://www.w3.org/1999/xlink",!1,!1)}),["xml:base","xml:lang","xml:space"].forEach(function(a){var l=a.replace(S,E);b[l]=new w(l,1,!1,a,"http://www.w3.org/XML/1998/namespace",!1,!1)}),["tabIndex","crossOrigin"].forEach(function(a){b[a]=new w(a,1,!1,a.toLowerCase(),null,!1,!1)}),b.xlinkHref=new w("xlinkHref",1,!1,"xlink:href","http://www.w3.org/1999/xlink",!0,!1),["src","href","action","formAction"].forEach(function(a){b[a]=new w(a,1,!1,a.toLowerCase(),null,!0,!0)});function C(a,l,h,y){var x=b.hasOwnProperty(l)?b[l]:null;(x!==null?x.type!==0:y||!(2<l.length)||l[0]!=="o"&&l[0]!=="O"||l[1]!=="n"&&l[1]!=="N")&&(_(l,h,x,y)&&(h=null),y||x===null?m(l)&&(h===null?a.removeAttribute(l):a.setAttribute(l,""+h)):x.mustUseProperty?a[x.propertyName]=h===null?x.type===3?!1:"":h:(l=x.attributeName,y=x.attributeNamespace,h===null?a.removeAttribute(l):(x=x.type,h=x===3||x===4&&h===!0?"":""+h,y?a.setAttributeNS(y,l,h):a.setAttribute(l,h))))}var A=e.__SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED,T=Symbol.for("react.element"),M=Symbol.for("react.portal"),O=Symbol.for("react.fragment"),R=Symbol.for("react.strict_mode"),D=Symbol.for("react.profiler"),U=Symbol.for("react.provider"),W=Symbol.for("react.context"),H=Symbol.for("react.forward_ref"),Y=Symbol.for("react.suspense"),J=Symbol.for("react.suspense_list"),V=Symbol.for("react.memo"),q=Symbol.for("react.lazy"),ee=Symbol.for("react.offscreen"),F=Symbol.iterator;function X(a){return a===null||typeof a!="object"?null:(a=F&&a[F]||a["@@iterator"],typeof a=="function"?a:null)}var B=Object.assign,L;function G(a){if(L===void 0)try{throw Error()}catch(h){var l=h.stack.trim().match(/\n( *(at )?)/);L=l&&l[1]||""}return`
|
|
102
|
+
`+L+a}var ue=!1;function te(a,l){if(!a||ue)return"";ue=!0;var h=Error.prepareStackTrace;Error.prepareStackTrace=void 0;try{if(l)if(l=function(){throw Error()},Object.defineProperty(l.prototype,"props",{set:function(){throw Error()}}),typeof Reflect=="object"&&Reflect.construct){try{Reflect.construct(l,[])}catch(ae){var y=ae}Reflect.construct(a,[],l)}else{try{l.call()}catch(ae){y=ae}a.call(l.prototype)}else{try{throw Error()}catch(ae){y=ae}a()}}catch(ae){if(ae&&y&&typeof ae.stack=="string"){for(var x=ae.stack.split(`
|
|
103
|
+
`),k=y.stack.split(`
|
|
104
|
+
`),I=x.length-1,z=k.length-1;1<=I&&0<=z&&x[I]!==k[z];)z--;for(;1<=I&&0<=z;I--,z--)if(x[I]!==k[z]){if(I!==1||z!==1)do if(I--,z--,0>z||x[I]!==k[z]){var K=`
|
|
105
|
+
`+x[I].replace(" at new "," at ");return a.displayName&&K.includes("<anonymous>")&&(K=K.replace("<anonymous>",a.displayName)),K}while(1<=I&&0<=z);break}}}finally{ue=!1,Error.prepareStackTrace=h}return(a=a?a.displayName||a.name:"")?G(a):""}function ie(a){switch(a.tag){case 5:return G(a.type);case 16:return G("Lazy");case 13:return G("Suspense");case 19:return G("SuspenseList");case 0:case 2:case 15:return a=te(a.type,!1),a;case 11:return a=te(a.type.render,!1),a;case 1:return a=te(a.type,!0),a;default:return""}}function he(a){if(a==null)return null;if(typeof a=="function")return a.displayName||a.name||null;if(typeof a=="string")return a;switch(a){case O:return"Fragment";case M:return"Portal";case D:return"Profiler";case R:return"StrictMode";case Y:return"Suspense";case J:return"SuspenseList"}if(typeof a=="object")switch(a.$$typeof){case W:return(a.displayName||"Context")+".Consumer";case U:return(a._context.displayName||"Context")+".Provider";case H:var l=a.render;return a=a.displayName,a||(a=l.displayName||l.name||"",a=a!==""?"ForwardRef("+a+")":"ForwardRef"),a;case V:return l=a.displayName||null,l!==null?l:he(a.type)||"Memo";case q:l=a._payload,a=a._init;try{return he(a(l))}catch{}}return null}function ke(a){var l=a.type;switch(a.tag){case 24:return"Cache";case 9:return(l.displayName||"Context")+".Consumer";case 10:return(l._context.displayName||"Context")+".Provider";case 18:return"DehydratedFragment";case 11:return a=l.render,a=a.displayName||a.name||"",l.displayName||(a!==""?"ForwardRef("+a+")":"ForwardRef");case 7:return"Fragment";case 5:return l;case 4:return"Portal";case 3:return"Root";case 6:return"Text";case 16:return he(l);case 8:return l===R?"StrictMode":"Mode";case 22:return"Offscreen";case 12:return"Profiler";case 21:return"Scope";case 13:return"Suspense";case 19:return"SuspenseList";case 25:return"TracingMarker";case 1:case 0:case 17:case 2:case 14:case 15:if(typeof l=="function")return l.displayName||l.name||null;if(typeof l=="string")return l}return null}function ge(a){switch(typeof a){case"boolean":case"number":case"string":case"undefined":return a;case"object":return a;default:return""}}function pe(a){var l=a.type;return(a=a.nodeName)&&a.toLowerCase()==="input"&&(l==="checkbox"||l==="radio")}function Ne(a){var l=pe(a)?"checked":"value",h=Object.getOwnPropertyDescriptor(a.constructor.prototype,l),y=""+a[l];if(!a.hasOwnProperty(l)&&typeof h<"u"&&typeof h.get=="function"&&typeof h.set=="function"){var x=h.get,k=h.set;return Object.defineProperty(a,l,{configurable:!0,get:function(){return x.call(this)},set:function(I){y=""+I,k.call(this,I)}}),Object.defineProperty(a,l,{enumerable:h.enumerable}),{getValue:function(){return y},setValue:function(I){y=""+I},stopTracking:function(){a._valueTracker=null,delete a[l]}}}}function Re(a){a._valueTracker||(a._valueTracker=Ne(a))}function $e(a){if(!a)return!1;var l=a._valueTracker;if(!l)return!0;var h=l.getValue(),y="";return a&&(y=pe(a)?a.checked?"true":"false":a.value),a=y,a!==h?(l.setValue(a),!0):!1}function Et(a){if(a=a||(typeof document<"u"?document:void 0),typeof a>"u")return null;try{return a.activeElement||a.body}catch{return a.body}}function dn(a,l){var h=l.checked;return B({},l,{defaultChecked:void 0,defaultValue:void 0,value:void 0,checked:h??a._wrapperState.initialChecked})}function an(a,l){var h=l.defaultValue==null?"":l.defaultValue,y=l.checked!=null?l.checked:l.defaultChecked;h=ge(l.value!=null?l.value:h),a._wrapperState={initialChecked:y,initialValue:h,controlled:l.type==="checkbox"||l.type==="radio"?l.checked!=null:l.value!=null}}function kt(a,l){l=l.checked,l!=null&&C(a,"checked",l,!1)}function Gt(a,l){kt(a,l);var h=ge(l.value),y=l.type;if(h!=null)y==="number"?(h===0&&a.value===""||a.value!=h)&&(a.value=""+h):a.value!==""+h&&(a.value=""+h);else if(y==="submit"||y==="reset"){a.removeAttribute("value");return}l.hasOwnProperty("value")?Qt(a,l.type,h):l.hasOwnProperty("defaultValue")&&Qt(a,l.type,ge(l.defaultValue)),l.checked==null&&l.defaultChecked!=null&&(a.defaultChecked=!!l.defaultChecked)}function gn(a,l,h){if(l.hasOwnProperty("value")||l.hasOwnProperty("defaultValue")){var y=l.type;if(!(y!=="submit"&&y!=="reset"||l.value!==void 0&&l.value!==null))return;l=""+a._wrapperState.initialValue,h||l===a.value||(a.value=l),a.defaultValue=l}h=a.name,h!==""&&(a.name=""),a.defaultChecked=!!a._wrapperState.initialChecked,h!==""&&(a.name=h)}function Qt(a,l,h){(l!=="number"||Et(a.ownerDocument)!==a)&&(h==null?a.defaultValue=""+a._wrapperState.initialValue:a.defaultValue!==""+h&&(a.defaultValue=""+h))}var Me=Array.isArray;function Xe(a,l,h,y){if(a=a.options,l){l={};for(var x=0;x<h.length;x++)l["$"+h[x]]=!0;for(h=0;h<a.length;h++)x=l.hasOwnProperty("$"+a[h].value),a[h].selected!==x&&(a[h].selected=x),x&&y&&(a[h].defaultSelected=!0)}else{for(h=""+ge(h),l=null,x=0;x<a.length;x++){if(a[x].value===h){a[x].selected=!0,y&&(a[x].defaultSelected=!0);return}l!==null||a[x].disabled||(l=a[x])}l!==null&&(l.selected=!0)}}function Te(a,l){if(l.dangerouslySetInnerHTML!=null)throw Error(n(91));return B({},l,{value:void 0,defaultValue:void 0,children:""+a._wrapperState.initialValue})}function xt(a,l){var h=l.value;if(h==null){if(h=l.children,l=l.defaultValue,h!=null){if(l!=null)throw Error(n(92));if(Me(h)){if(1<h.length)throw Error(n(93));h=h[0]}l=h}l==null&&(l=""),h=l}a._wrapperState={initialValue:ge(h)}}function xe(a,l){var h=ge(l.value),y=ge(l.defaultValue);h!=null&&(h=""+h,h!==a.value&&(a.value=h),l.defaultValue==null&&a.defaultValue!==h&&(a.defaultValue=h)),y!=null&&(a.defaultValue=""+y)}function $t(a){var l=a.textContent;l===a._wrapperState.initialValue&&l!==""&&l!==null&&(a.value=l)}function ft(a){switch(a){case"svg":return"http://www.w3.org/2000/svg";case"math":return"http://www.w3.org/1998/Math/MathML";default:return"http://www.w3.org/1999/xhtml"}}function gt(a,l){return a==null||a==="http://www.w3.org/1999/xhtml"?ft(l):a==="http://www.w3.org/2000/svg"&&l==="foreignObject"?"http://www.w3.org/1999/xhtml":a}var Hn,Js=(function(a){return typeof MSApp<"u"&&MSApp.execUnsafeLocalFunction?function(l,h,y,x){MSApp.execUnsafeLocalFunction(function(){return a(l,h,y,x)})}:a})(function(a,l){if(a.namespaceURI!=="http://www.w3.org/2000/svg"||"innerHTML"in a)a.innerHTML=l;else{for(Hn=Hn||document.createElement("div"),Hn.innerHTML="<svg>"+l.valueOf().toString()+"</svg>",l=Hn.firstChild;a.firstChild;)a.removeChild(a.firstChild);for(;l.firstChild;)a.appendChild(l.firstChild)}});function _n(a,l){if(l){var h=a.firstChild;if(h&&h===a.lastChild&&h.nodeType===3){h.nodeValue=l;return}}a.textContent=l}var Gn={animationIterationCount:!0,aspectRatio:!0,borderImageOutset:!0,borderImageSlice:!0,borderImageWidth:!0,boxFlex:!0,boxFlexGroup:!0,boxOrdinalGroup:!0,columnCount:!0,columns:!0,flex:!0,flexGrow:!0,flexPositive:!0,flexShrink:!0,flexNegative:!0,flexOrder:!0,gridArea:!0,gridRow:!0,gridRowEnd:!0,gridRowSpan:!0,gridRowStart:!0,gridColumn:!0,gridColumnEnd:!0,gridColumnSpan:!0,gridColumnStart:!0,fontWeight:!0,lineClamp:!0,lineHeight:!0,opacity:!0,order:!0,orphans:!0,tabSize:!0,widows:!0,zIndex:!0,zoom:!0,fillOpacity:!0,floodOpacity:!0,stopOpacity:!0,strokeDasharray:!0,strokeDashoffset:!0,strokeMiterlimit:!0,strokeOpacity:!0,strokeWidth:!0},_i=["Webkit","ms","Moz","O"];Object.keys(Gn).forEach(function(a){_i.forEach(function(l){l=l+a.charAt(0).toUpperCase()+a.substring(1),Gn[l]=Gn[a]})});function rs(a,l,h){return l==null||typeof l=="boolean"||l===""?"":h||typeof l!="number"||l===0||Gn.hasOwnProperty(a)&&Gn[a]?(""+l).trim():l+"px"}function Hr(a,l){a=a.style;for(var h in l)if(l.hasOwnProperty(h)){var y=h.indexOf("--")===0,x=rs(h,l[h],y);h==="float"&&(h="cssFloat"),y?a.setProperty(h,x):a[h]=x}}var Un=B({menuitem:!0},{area:!0,base:!0,br:!0,col:!0,embed:!0,hr:!0,img:!0,input:!0,keygen:!0,link:!0,meta:!0,param:!0,source:!0,track:!0,wbr:!0});function fn(a,l){if(l){if(Un[a]&&(l.children!=null||l.dangerouslySetInnerHTML!=null))throw Error(n(137,a));if(l.dangerouslySetInnerHTML!=null){if(l.children!=null)throw Error(n(60));if(typeof l.dangerouslySetInnerHTML!="object"||!("__html"in l.dangerouslySetInnerHTML))throw Error(n(61))}if(l.style!=null&&typeof l.style!="object")throw Error(n(62))}}function Ur(a,l){if(a.indexOf("-")===-1)return typeof l.is=="string";switch(a){case"annotation-xml":case"color-profile":case"font-face":case"font-face-src":case"font-face-uri":case"font-face-format":case"font-face-name":case"missing-glyph":return!1;default:return!0}}var Jn=null;function Ui(a){return a=a.target||a.srcElement||window,a.correspondingUseElement&&(a=a.correspondingUseElement),a.nodeType===3?a.parentNode:a}var Rr=null,Zn=null,_r=null;function $s(a){if(a=Gd(a)){if(typeof Rr!="function")throw Error(n(280));var l=a.stateNode;l&&(l=dp(l),Rr(a.stateNode,a.type,l))}}function qn(a){Zn?_r?_r.push(a):_r=[a]:Zn=a}function ss(){if(Zn){var a=Zn,l=_r;if(_r=Zn=null,$s(a),l)for(a=0;a<l.length;a++)$s(l[a])}}function st(a,l){return a(l)}function nn(){}var Xt=!1;function hn(a,l,h){if(Xt)return a(l,h);Xt=!0;try{return st(a,l,h)}finally{Xt=!1,(Zn!==null||_r!==null)&&(nn(),ss())}}function wn(a,l){var h=a.stateNode;if(h===null)return null;var y=dp(h);if(y===null)return null;h=y[l];e:switch(l){case"onClick":case"onClickCapture":case"onDoubleClick":case"onDoubleClickCapture":case"onMouseDown":case"onMouseDownCapture":case"onMouseMove":case"onMouseMoveCapture":case"onMouseUp":case"onMouseUpCapture":case"onMouseEnter":(y=!y.disabled)||(a=a.type,y=!(a==="button"||a==="input"||a==="select"||a==="textarea")),a=!y;break e;default:a=!1}if(a)return null;if(h&&typeof h!="function")throw Error(n(231,l,typeof h));return h}var Bt=!1;if(c)try{var Tn={};Object.defineProperty(Tn,"passive",{get:function(){Bt=!0}}),window.addEventListener("test",Tn,Tn),window.removeEventListener("test",Tn,Tn)}catch{Bt=!1}function Zr(a,l,h,y,x,k,I,z,K){var ae=Array.prototype.slice.call(arguments,3);try{l.apply(h,ae)}catch(_e){this.onError(_e)}}var Bn=!1,ur=null,Vt=!1,ei=null,Ld={onError:function(a){Bn=!0,ur=a}};function ha(a,l,h,y,x,k,I,z,K){Bn=!1,ur=null,Zr.apply(Ld,arguments)}function Zi(a,l,h,y,x,k,I,z,K){if(ha.apply(this,arguments),Bn){if(Bn){var ae=ur;Bn=!1,ur=null}else throw Error(n(198));Vt||(Vt=!0,ei=ae)}}function wr(a){var l=a,h=a;if(a.alternate)for(;l.return;)l=l.return;else{a=l;do l=a,(l.flags&4098)!==0&&(h=l.return),a=l.return;while(a)}return l.tag===3?h:null}function ti(a){if(a.tag===13){var l=a.memoizedState;if(l===null&&(a=a.alternate,a!==null&&(l=a.memoizedState)),l!==null)return l.dehydrated}return null}function vs(a){if(wr(a)!==a)throw Error(n(188))}function wi(a){var l=a.alternate;if(!l){if(l=wr(a),l===null)throw Error(n(188));return l!==a?null:a}for(var h=a,y=l;;){var x=h.return;if(x===null)break;var k=x.alternate;if(k===null){if(y=x.return,y!==null){h=y;continue}break}if(x.child===k.child){for(k=x.child;k;){if(k===h)return vs(x),a;if(k===y)return vs(x),l;k=k.sibling}throw Error(n(188))}if(h.return!==y.return)h=x,y=k;else{for(var I=!1,z=x.child;z;){if(z===h){I=!0,h=x,y=k;break}if(z===y){I=!0,y=x,h=k;break}z=z.sibling}if(!I){for(z=k.child;z;){if(z===h){I=!0,h=k,y=x;break}if(z===y){I=!0,y=k,h=x;break}z=z.sibling}if(!I)throw Error(n(189))}}if(h.alternate!==y)throw Error(n(190))}if(h.tag!==3)throw Error(n(188));return h.stateNode.current===h?a:l}function ys(a){return a=wi(a),a!==null?pa(a):null}function pa(a){if(a.tag===5||a.tag===6)return a;for(a=a.child;a!==null;){var l=pa(a);if(l!==null)return l;a=a.sibling}return null}var Ds=t.unstable_scheduleCallback,xl=t.unstable_cancelCallback,Tc=t.unstable_shouldYield,ma=t.unstable_requestPaint,ln=t.unstable_now,Bi=t.unstable_getCurrentPriorityLevel,Fs=t.unstable_ImmediatePriority,Wi=t.unstable_UserBlockingPriority,Ir=t.unstable_NormalPriority,Sl=t.unstable_LowPriority,El=t.unstable_IdlePriority,So=null,Br=null;function kl(a){if(Br&&typeof Br.onCommitFiberRoot=="function")try{Br.onCommitFiberRoot(So,a,void 0,(a.current.flags&128)===128)}catch{}}var is=Math.clz32?Math.clz32:ga,$d=Math.log,Rc=Math.LN2;function ga(a){return a>>>=0,a===0?32:31-($d(a)/Rc|0)|0}var ni=64,N=4194304;function de(a){switch(a&-a){case 1:return 1;case 2:return 2;case 4:return 4;case 8:return 8;case 16:return 16;case 32:return 32;case 64:case 128:case 256:case 512:case 1024:case 2048:case 4096:case 8192:case 16384:case 32768:case 65536:case 131072:case 262144:case 524288:case 1048576:case 2097152:return a&4194240;case 4194304:case 8388608:case 16777216:case 33554432:case 67108864:return a&130023424;case 134217728:return 134217728;case 268435456:return 268435456;case 536870912:return 536870912;case 1073741824:return 1073741824;default:return a}}function ve(a,l){var h=a.pendingLanes;if(h===0)return 0;var y=0,x=a.suspendedLanes,k=a.pingedLanes,I=h&268435455;if(I!==0){var z=I&~x;z!==0?y=de(z):(k&=I,k!==0&&(y=de(k)))}else I=h&~x,I!==0?y=de(I):k!==0&&(y=de(k));if(y===0)return 0;if(l!==0&&l!==y&&(l&x)===0&&(x=y&-y,k=l&-l,x>=k||x===16&&(k&4194240)!==0))return l;if((y&4)!==0&&(y|=h&16),l=a.entangledLanes,l!==0)for(a=a.entanglements,l&=y;0<l;)h=31-is(l),x=1<<h,y|=a[h],l&=~x;return y}function Se(a,l){switch(a){case 1:case 2:case 4:return l+250;case 8:case 16:case 32:case 64:case 128:case 256:case 512:case 1024:case 2048:case 4096:case 8192:case 16384:case 32768:case 65536:case 131072:case 262144:case 524288:case 1048576:case 2097152:return l+5e3;case 4194304:case 8388608:case 16777216:case 33554432:case 67108864:return-1;case 134217728:case 268435456:case 536870912:case 1073741824:return-1;default:return-1}}function Ue(a,l){for(var h=a.suspendedLanes,y=a.pingedLanes,x=a.expirationTimes,k=a.pendingLanes;0<k;){var I=31-is(k),z=1<<I,K=x[I];K===-1?((z&h)===0||(z&y)!==0)&&(x[I]=Se(z,l)):K<=l&&(a.expiredLanes|=z),k&=~z}}function ht(a){return a=a.pendingLanes&-1073741825,a!==0?a:a&1073741824?1073741824:0}function Ct(){var a=ni;return ni<<=1,(ni&4194240)===0&&(ni=64),a}function Tt(a){for(var l=[],h=0;31>h;h++)l.push(a);return l}function Jt(a,l,h){a.pendingLanes|=l,l!==536870912&&(a.suspendedLanes=0,a.pingedLanes=0),a=a.eventTimes,l=31-is(l),a[l]=h}function pt(a,l){var h=a.pendingLanes&~l;a.pendingLanes=l,a.suspendedLanes=0,a.pingedLanes=0,a.expiredLanes&=l,a.mutableReadLanes&=l,a.entangledLanes&=l,l=a.entanglements;var y=a.eventTimes;for(a=a.expirationTimes;0<h;){var x=31-is(h),k=1<<x;l[x]=0,y[x]=-1,a[x]=-1,h&=~k}}function Rn(a,l){var h=a.entangledLanes|=l;for(a=a.entanglements;h;){var y=31-is(h),x=1<<y;x&l|a[y]&l&&(a[y]|=l),h&=~x}}var it=0;function Or(a){return a&=-a,1<a?4<a?(a&268435455)!==0?16:536870912:4:1}var Eo,ko,Mr,Ki,Cl,Ic=!1,Pl=[],bi=null,j=null,oe=null,Oe=new Map,Pe=new Map,be=[],De="mousedown mouseup touchcancel touchend touchstart auxclick dblclick pointercancel pointerdown pointerup dragend dragstart drop compositionend compositionstart keydown keypress keyup input textInput copy cut paste click change contextmenu reset submit".split(" ");function St(a,l){switch(a){case"focusin":case"focusout":bi=null;break;case"dragenter":case"dragleave":j=null;break;case"mouseover":case"mouseout":oe=null;break;case"pointerover":case"pointerout":Oe.delete(l.pointerId);break;case"gotpointercapture":case"lostpointercapture":Pe.delete(l.pointerId)}}function at(a,l,h,y,x,k){return a===null||a.nativeEvent!==k?(a={blockedOn:l,domEventName:h,eventSystemFlags:y,nativeEvent:k,targetContainers:[x]},l!==null&&(l=Gd(l),l!==null&&ko(l)),a):(a.eventSystemFlags|=y,l=a.targetContainers,x!==null&&l.indexOf(x)===-1&&l.push(x),a)}function wt(a,l,h,y,x){switch(l){case"focusin":return bi=at(bi,a,l,h,y,x),!0;case"dragenter":return j=at(j,a,l,h,y,x),!0;case"mouseover":return oe=at(oe,a,l,h,y,x),!0;case"pointerover":var k=x.pointerId;return Oe.set(k,at(Oe.get(k)||null,a,l,h,y,x)),!0;case"gotpointercapture":return k=x.pointerId,Pe.set(k,at(Pe.get(k)||null,a,l,h,y,x)),!0}return!1}function er(a){var l=Al(a.target);if(l!==null){var h=wr(l);if(h!==null){if(l=h.tag,l===13){if(l=ti(h),l!==null){a.blockedOn=l,Cl(a.priority,function(){Mr(h)});return}}else if(l===3&&h.stateNode.current.memoizedState.isDehydrated){a.blockedOn=h.tag===3?h.stateNode.containerInfo:null;return}}}a.blockedOn=null}function br(a){if(a.blockedOn!==null)return!1;for(var l=a.targetContainers;0<l.length;){var h=cv(a.domEventName,a.eventSystemFlags,l[0],a.nativeEvent);if(h===null){h=a.nativeEvent;var y=new h.constructor(h.type,h);Jn=y,h.target.dispatchEvent(y),Jn=null}else return l=Gd(h),l!==null&&ko(l),a.blockedOn=h,!1;l.shift()}return!0}function js(a,l,h){br(a)&&h.delete(l)}function zs(){Ic=!1,bi!==null&&br(bi)&&(bi=null),j!==null&&br(j)&&(j=null),oe!==null&&br(oe)&&(oe=null),Oe.forEach(js),Pe.forEach(js)}function Ft(a,l){a.blockedOn===l&&(a.blockedOn=null,Ic||(Ic=!0,t.unstable_scheduleCallback(t.unstable_NormalPriority,zs)))}function Pt(a){function l(x){return Ft(x,a)}if(0<Pl.length){Ft(Pl[0],a);for(var h=1;h<Pl.length;h++){var y=Pl[h];y.blockedOn===a&&(y.blockedOn=null)}}for(bi!==null&&Ft(bi,a),j!==null&&Ft(j,a),oe!==null&&Ft(oe,a),Oe.forEach(l),Pe.forEach(l),h=0;h<be.length;h++)y=be[h],y.blockedOn===a&&(y.blockedOn=null);for(;0<be.length&&(h=be[0],h.blockedOn===null);)er(h),h.blockedOn===null&&be.shift()}var xi=A.ReactCurrentBatchConfig,Gi=!0;function k$(a,l,h,y){var x=it,k=xi.transition;xi.transition=null;try{it=1,lv(a,l,h,y)}finally{it=x,xi.transition=k}}function C$(a,l,h,y){var x=it,k=xi.transition;xi.transition=null;try{it=4,lv(a,l,h,y)}finally{it=x,xi.transition=k}}function lv(a,l,h,y){if(Gi){var x=cv(a,l,h,y);if(x===null)Cv(a,l,y,Jh,h),St(a,y);else if(wt(x,a,l,h,y))y.stopPropagation();else if(St(a,y),l&4&&-1<De.indexOf(a)){for(;x!==null;){var k=Gd(x);if(k!==null&&Eo(k),k=cv(a,l,h,y),k===null&&Cv(a,l,y,Jh,h),k===x)break;x=k}x!==null&&y.stopPropagation()}else Cv(a,l,y,null,h)}}var Jh=null;function cv(a,l,h,y){if(Jh=null,a=Ui(y),a=Al(a),a!==null)if(l=wr(a),l===null)a=null;else if(h=l.tag,h===13){if(a=ti(l),a!==null)return a;a=null}else if(h===3){if(l.stateNode.current.memoizedState.isDehydrated)return l.tag===3?l.stateNode.containerInfo:null;a=null}else l!==a&&(a=null);return Jh=a,null}function uS(a){switch(a){case"cancel":case"click":case"close":case"contextmenu":case"copy":case"cut":case"auxclick":case"dblclick":case"dragend":case"dragstart":case"drop":case"focusin":case"focusout":case"input":case"invalid":case"keydown":case"keypress":case"keyup":case"mousedown":case"mouseup":case"paste":case"pause":case"play":case"pointercancel":case"pointerdown":case"pointerup":case"ratechange":case"reset":case"resize":case"seeked":case"submit":case"touchcancel":case"touchend":case"touchstart":case"volumechange":case"change":case"selectionchange":case"textInput":case"compositionstart":case"compositionend":case"compositionupdate":case"beforeblur":case"afterblur":case"beforeinput":case"blur":case"fullscreenchange":case"focus":case"hashchange":case"popstate":case"select":case"selectstart":return 1;case"drag":case"dragenter":case"dragexit":case"dragleave":case"dragover":case"mousemove":case"mouseout":case"mouseover":case"pointermove":case"pointerout":case"pointerover":case"scroll":case"toggle":case"touchmove":case"wheel":case"mouseenter":case"mouseleave":case"pointerenter":case"pointerleave":return 4;case"message":switch(Bi()){case Fs:return 1;case Wi:return 4;case Ir:case Sl:return 16;case El:return 536870912;default:return 16}default:return 16}}var va=null,uv=null,ep=null;function dS(){if(ep)return ep;var a,l=uv,h=l.length,y,x="value"in va?va.value:va.textContent,k=x.length;for(a=0;a<h&&l[a]===x[a];a++);var I=h-a;for(y=1;y<=I&&l[h-y]===x[k-y];y++);return ep=x.slice(a,1<y?1-y:void 0)}function tp(a){var l=a.keyCode;return"charCode"in a?(a=a.charCode,a===0&&l===13&&(a=13)):a=l,a===10&&(a=13),32<=a||a===13?a:0}function np(){return!0}function fS(){return!1}function Vs(a){function l(h,y,x,k,I){this._reactName=h,this._targetInst=x,this.type=y,this.nativeEvent=k,this.target=I,this.currentTarget=null;for(var z in a)a.hasOwnProperty(z)&&(h=a[z],this[z]=h?h(k):k[z]);return this.isDefaultPrevented=(k.defaultPrevented!=null?k.defaultPrevented:k.returnValue===!1)?np:fS,this.isPropagationStopped=fS,this}return B(l.prototype,{preventDefault:function(){this.defaultPrevented=!0;var h=this.nativeEvent;h&&(h.preventDefault?h.preventDefault():typeof h.returnValue!="unknown"&&(h.returnValue=!1),this.isDefaultPrevented=np)},stopPropagation:function(){var h=this.nativeEvent;h&&(h.stopPropagation?h.stopPropagation():typeof h.cancelBubble!="unknown"&&(h.cancelBubble=!0),this.isPropagationStopped=np)},persist:function(){},isPersistent:np}),l}var Oc={eventPhase:0,bubbles:0,cancelable:0,timeStamp:function(a){return a.timeStamp||Date.now()},defaultPrevented:0,isTrusted:0},dv=Vs(Oc),Dd=B({},Oc,{view:0,detail:0}),P$=Vs(Dd),fv,hv,Fd,rp=B({},Dd,{screenX:0,screenY:0,clientX:0,clientY:0,pageX:0,pageY:0,ctrlKey:0,shiftKey:0,altKey:0,metaKey:0,getModifierState:mv,button:0,buttons:0,relatedTarget:function(a){return a.relatedTarget===void 0?a.fromElement===a.srcElement?a.toElement:a.fromElement:a.relatedTarget},movementX:function(a){return"movementX"in a?a.movementX:(a!==Fd&&(Fd&&a.type==="mousemove"?(fv=a.screenX-Fd.screenX,hv=a.screenY-Fd.screenY):hv=fv=0,Fd=a),fv)},movementY:function(a){return"movementY"in a?a.movementY:hv}}),hS=Vs(rp),A$=B({},rp,{dataTransfer:0}),T$=Vs(A$),R$=B({},Dd,{relatedTarget:0}),pv=Vs(R$),I$=B({},Oc,{animationName:0,elapsedTime:0,pseudoElement:0}),O$=Vs(I$),M$=B({},Oc,{clipboardData:function(a){return"clipboardData"in a?a.clipboardData:window.clipboardData}}),N$=Vs(M$),L$=B({},Oc,{data:0}),pS=Vs(L$),$$={Esc:"Escape",Spacebar:" ",Left:"ArrowLeft",Up:"ArrowUp",Right:"ArrowRight",Down:"ArrowDown",Del:"Delete",Win:"OS",Menu:"ContextMenu",Apps:"ContextMenu",Scroll:"ScrollLock",MozPrintableKey:"Unidentified"},D$={8:"Backspace",9:"Tab",12:"Clear",13:"Enter",16:"Shift",17:"Control",18:"Alt",19:"Pause",20:"CapsLock",27:"Escape",32:" ",33:"PageUp",34:"PageDown",35:"End",36:"Home",37:"ArrowLeft",38:"ArrowUp",39:"ArrowRight",40:"ArrowDown",45:"Insert",46:"Delete",112:"F1",113:"F2",114:"F3",115:"F4",116:"F5",117:"F6",118:"F7",119:"F8",120:"F9",121:"F10",122:"F11",123:"F12",144:"NumLock",145:"ScrollLock",224:"Meta"},F$={Alt:"altKey",Control:"ctrlKey",Meta:"metaKey",Shift:"shiftKey"};function j$(a){var l=this.nativeEvent;return l.getModifierState?l.getModifierState(a):(a=F$[a])?!!l[a]:!1}function mv(){return j$}var z$=B({},Dd,{key:function(a){if(a.key){var l=$$[a.key]||a.key;if(l!=="Unidentified")return l}return a.type==="keypress"?(a=tp(a),a===13?"Enter":String.fromCharCode(a)):a.type==="keydown"||a.type==="keyup"?D$[a.keyCode]||"Unidentified":""},code:0,location:0,ctrlKey:0,shiftKey:0,altKey:0,metaKey:0,repeat:0,locale:0,getModifierState:mv,charCode:function(a){return a.type==="keypress"?tp(a):0},keyCode:function(a){return a.type==="keydown"||a.type==="keyup"?a.keyCode:0},which:function(a){return a.type==="keypress"?tp(a):a.type==="keydown"||a.type==="keyup"?a.keyCode:0}}),V$=Vs(z$),H$=B({},rp,{pointerId:0,width:0,height:0,pressure:0,tangentialPressure:0,tiltX:0,tiltY:0,twist:0,pointerType:0,isPrimary:0}),mS=Vs(H$),U$=B({},Dd,{touches:0,targetTouches:0,changedTouches:0,altKey:0,metaKey:0,ctrlKey:0,shiftKey:0,getModifierState:mv}),Z$=Vs(U$),B$=B({},Oc,{propertyName:0,elapsedTime:0,pseudoElement:0}),W$=Vs(B$),K$=B({},rp,{deltaX:function(a){return"deltaX"in a?a.deltaX:"wheelDeltaX"in a?-a.wheelDeltaX:0},deltaY:function(a){return"deltaY"in a?a.deltaY:"wheelDeltaY"in a?-a.wheelDeltaY:"wheelDelta"in a?-a.wheelDelta:0},deltaZ:0,deltaMode:0}),G$=Vs(K$),q$=[9,13,27,32],gv=c&&"CompositionEvent"in window,jd=null;c&&"documentMode"in document&&(jd=document.documentMode);var Y$=c&&"TextEvent"in window&&!jd,gS=c&&(!gv||jd&&8<jd&&11>=jd),vS=" ",yS=!1;function _S(a,l){switch(a){case"keyup":return q$.indexOf(l.keyCode)!==-1;case"keydown":return l.keyCode!==229;case"keypress":case"mousedown":case"focusout":return!0;default:return!1}}function wS(a){return a=a.detail,typeof a=="object"&&"data"in a?a.data:null}var Mc=!1;function Q$(a,l){switch(a){case"compositionend":return wS(l);case"keypress":return l.which!==32?null:(yS=!0,vS);case"textInput":return a=l.data,a===vS&&yS?null:a;default:return null}}function X$(a,l){if(Mc)return a==="compositionend"||!gv&&_S(a,l)?(a=dS(),ep=uv=va=null,Mc=!1,a):null;switch(a){case"paste":return null;case"keypress":if(!(l.ctrlKey||l.altKey||l.metaKey)||l.ctrlKey&&l.altKey){if(l.char&&1<l.char.length)return l.char;if(l.which)return String.fromCharCode(l.which)}return null;case"compositionend":return gS&&l.locale!=="ko"?null:l.data;default:return null}}var J$={color:!0,date:!0,datetime:!0,"datetime-local":!0,email:!0,month:!0,number:!0,password:!0,range:!0,search:!0,tel:!0,text:!0,time:!0,url:!0,week:!0};function bS(a){var l=a&&a.nodeName&&a.nodeName.toLowerCase();return l==="input"?!!J$[a.type]:l==="textarea"}function xS(a,l,h,y){qn(y),l=lp(l,"onChange"),0<l.length&&(h=new dv("onChange","change",null,h,y),a.push({event:h,listeners:l}))}var zd=null,Vd=null;function eD(a){zS(a,0)}function sp(a){var l=Fc(a);if($e(l))return a}function tD(a,l){if(a==="change")return l}var SS=!1;if(c){var vv;if(c){var yv="oninput"in document;if(!yv){var ES=document.createElement("div");ES.setAttribute("oninput","return;"),yv=typeof ES.oninput=="function"}vv=yv}else vv=!1;SS=vv&&(!document.documentMode||9<document.documentMode)}function kS(){zd&&(zd.detachEvent("onpropertychange",CS),Vd=zd=null)}function CS(a){if(a.propertyName==="value"&&sp(Vd)){var l=[];xS(l,Vd,a,Ui(a)),hn(eD,l)}}function nD(a,l,h){a==="focusin"?(kS(),zd=l,Vd=h,zd.attachEvent("onpropertychange",CS)):a==="focusout"&&kS()}function rD(a){if(a==="selectionchange"||a==="keyup"||a==="keydown")return sp(Vd)}function sD(a,l){if(a==="click")return sp(l)}function iD(a,l){if(a==="input"||a==="change")return sp(l)}function oD(a,l){return a===l&&(a!==0||1/a===1/l)||a!==a&&l!==l}var Si=typeof Object.is=="function"?Object.is:oD;function Hd(a,l){if(Si(a,l))return!0;if(typeof a!="object"||a===null||typeof l!="object"||l===null)return!1;var h=Object.keys(a),y=Object.keys(l);if(h.length!==y.length)return!1;for(y=0;y<h.length;y++){var x=h[y];if(!u.call(l,x)||!Si(a[x],l[x]))return!1}return!0}function PS(a){for(;a&&a.firstChild;)a=a.firstChild;return a}function AS(a,l){var h=PS(a);a=0;for(var y;h;){if(h.nodeType===3){if(y=a+h.textContent.length,a<=l&&y>=l)return{node:h,offset:l-a};a=y}e:{for(;h;){if(h.nextSibling){h=h.nextSibling;break e}h=h.parentNode}h=void 0}h=PS(h)}}function TS(a,l){return a&&l?a===l?!0:a&&a.nodeType===3?!1:l&&l.nodeType===3?TS(a,l.parentNode):"contains"in a?a.contains(l):a.compareDocumentPosition?!!(a.compareDocumentPosition(l)&16):!1:!1}function RS(){for(var a=window,l=Et();l instanceof a.HTMLIFrameElement;){try{var h=typeof l.contentWindow.location.href=="string"}catch{h=!1}if(h)a=l.contentWindow;else break;l=Et(a.document)}return l}function _v(a){var l=a&&a.nodeName&&a.nodeName.toLowerCase();return l&&(l==="input"&&(a.type==="text"||a.type==="search"||a.type==="tel"||a.type==="url"||a.type==="password")||l==="textarea"||a.contentEditable==="true")}function aD(a){var l=RS(),h=a.focusedElem,y=a.selectionRange;if(l!==h&&h&&h.ownerDocument&&TS(h.ownerDocument.documentElement,h)){if(y!==null&&_v(h)){if(l=y.start,a=y.end,a===void 0&&(a=l),"selectionStart"in h)h.selectionStart=l,h.selectionEnd=Math.min(a,h.value.length);else if(a=(l=h.ownerDocument||document)&&l.defaultView||window,a.getSelection){a=a.getSelection();var x=h.textContent.length,k=Math.min(y.start,x);y=y.end===void 0?k:Math.min(y.end,x),!a.extend&&k>y&&(x=y,y=k,k=x),x=AS(h,k);var I=AS(h,y);x&&I&&(a.rangeCount!==1||a.anchorNode!==x.node||a.anchorOffset!==x.offset||a.focusNode!==I.node||a.focusOffset!==I.offset)&&(l=l.createRange(),l.setStart(x.node,x.offset),a.removeAllRanges(),k>y?(a.addRange(l),a.extend(I.node,I.offset)):(l.setEnd(I.node,I.offset),a.addRange(l)))}}for(l=[],a=h;a=a.parentNode;)a.nodeType===1&&l.push({element:a,left:a.scrollLeft,top:a.scrollTop});for(typeof h.focus=="function"&&h.focus(),h=0;h<l.length;h++)a=l[h],a.element.scrollLeft=a.left,a.element.scrollTop=a.top}}var lD=c&&"documentMode"in document&&11>=document.documentMode,Nc=null,wv=null,Ud=null,bv=!1;function IS(a,l,h){var y=h.window===h?h.document:h.nodeType===9?h:h.ownerDocument;bv||Nc==null||Nc!==Et(y)||(y=Nc,"selectionStart"in y&&_v(y)?y={start:y.selectionStart,end:y.selectionEnd}:(y=(y.ownerDocument&&y.ownerDocument.defaultView||window).getSelection(),y={anchorNode:y.anchorNode,anchorOffset:y.anchorOffset,focusNode:y.focusNode,focusOffset:y.focusOffset}),Ud&&Hd(Ud,y)||(Ud=y,y=lp(wv,"onSelect"),0<y.length&&(l=new dv("onSelect","select",null,l,h),a.push({event:l,listeners:y}),l.target=Nc)))}function ip(a,l){var h={};return h[a.toLowerCase()]=l.toLowerCase(),h["Webkit"+a]="webkit"+l,h["Moz"+a]="moz"+l,h}var Lc={animationend:ip("Animation","AnimationEnd"),animationiteration:ip("Animation","AnimationIteration"),animationstart:ip("Animation","AnimationStart"),transitionend:ip("Transition","TransitionEnd")},xv={},OS={};c&&(OS=document.createElement("div").style,"AnimationEvent"in window||(delete Lc.animationend.animation,delete Lc.animationiteration.animation,delete Lc.animationstart.animation),"TransitionEvent"in window||delete Lc.transitionend.transition);function op(a){if(xv[a])return xv[a];if(!Lc[a])return a;var l=Lc[a],h;for(h in l)if(l.hasOwnProperty(h)&&h in OS)return xv[a]=l[h];return a}var MS=op("animationend"),NS=op("animationiteration"),LS=op("animationstart"),$S=op("transitionend"),DS=new Map,FS="abort auxClick cancel canPlay canPlayThrough click close contextMenu copy cut drag dragEnd dragEnter dragExit dragLeave dragOver dragStart drop durationChange emptied encrypted ended error gotPointerCapture input invalid keyDown keyPress keyUp load loadedData loadedMetadata loadStart lostPointerCapture mouseDown mouseMove mouseOut mouseOver mouseUp paste pause play playing pointerCancel pointerDown pointerMove pointerOut pointerOver pointerUp progress rateChange reset resize seeked seeking stalled submit suspend timeUpdate touchCancel touchEnd touchStart volumeChange scroll toggle touchMove waiting wheel".split(" ");function ya(a,l){DS.set(a,l),i(l,[a])}for(var Sv=0;Sv<FS.length;Sv++){var Ev=FS[Sv],cD=Ev.toLowerCase(),uD=Ev[0].toUpperCase()+Ev.slice(1);ya(cD,"on"+uD)}ya(MS,"onAnimationEnd"),ya(NS,"onAnimationIteration"),ya(LS,"onAnimationStart"),ya("dblclick","onDoubleClick"),ya("focusin","onFocus"),ya("focusout","onBlur"),ya($S,"onTransitionEnd"),o("onMouseEnter",["mouseout","mouseover"]),o("onMouseLeave",["mouseout","mouseover"]),o("onPointerEnter",["pointerout","pointerover"]),o("onPointerLeave",["pointerout","pointerover"]),i("onChange","change click focusin focusout input keydown keyup selectionchange".split(" ")),i("onSelect","focusout contextmenu dragend focusin keydown keyup mousedown mouseup selectionchange".split(" ")),i("onBeforeInput",["compositionend","keypress","textInput","paste"]),i("onCompositionEnd","compositionend focusout keydown keypress keyup mousedown".split(" ")),i("onCompositionStart","compositionstart focusout keydown keypress keyup mousedown".split(" ")),i("onCompositionUpdate","compositionupdate focusout keydown keypress keyup mousedown".split(" "));var Zd="abort canplay canplaythrough durationchange emptied encrypted ended error loadeddata loadedmetadata loadstart pause play playing progress ratechange resize seeked seeking stalled suspend timeupdate volumechange waiting".split(" "),dD=new Set("cancel close invalid load scroll toggle".split(" ").concat(Zd));function jS(a,l,h){var y=a.type||"unknown-event";a.currentTarget=h,Zi(y,l,void 0,a),a.currentTarget=null}function zS(a,l){l=(l&4)!==0;for(var h=0;h<a.length;h++){var y=a[h],x=y.event;y=y.listeners;e:{var k=void 0;if(l)for(var I=y.length-1;0<=I;I--){var z=y[I],K=z.instance,ae=z.currentTarget;if(z=z.listener,K!==k&&x.isPropagationStopped())break e;jS(x,z,ae),k=K}else for(I=0;I<y.length;I++){if(z=y[I],K=z.instance,ae=z.currentTarget,z=z.listener,K!==k&&x.isPropagationStopped())break e;jS(x,z,ae),k=K}}}if(Vt)throw a=ei,Vt=!1,ei=null,a}function Sn(a,l){var h=l[Ov];h===void 0&&(h=l[Ov]=new Set);var y=a+"__bubble";h.has(y)||(VS(l,a,2,!1),h.add(y))}function kv(a,l,h){var y=0;l&&(y|=4),VS(h,a,y,l)}var ap="_reactListening"+Math.random().toString(36).slice(2);function Bd(a){if(!a[ap]){a[ap]=!0,r.forEach(function(h){h!=="selectionchange"&&(dD.has(h)||kv(h,!1,a),kv(h,!0,a))});var l=a.nodeType===9?a:a.ownerDocument;l===null||l[ap]||(l[ap]=!0,kv("selectionchange",!1,l))}}function VS(a,l,h,y){switch(uS(l)){case 1:var x=k$;break;case 4:x=C$;break;default:x=lv}h=x.bind(null,l,h,a),x=void 0,!Bt||l!=="touchstart"&&l!=="touchmove"&&l!=="wheel"||(x=!0),y?x!==void 0?a.addEventListener(l,h,{capture:!0,passive:x}):a.addEventListener(l,h,!0):x!==void 0?a.addEventListener(l,h,{passive:x}):a.addEventListener(l,h,!1)}function Cv(a,l,h,y,x){var k=y;if((l&1)===0&&(l&2)===0&&y!==null)e:for(;;){if(y===null)return;var I=y.tag;if(I===3||I===4){var z=y.stateNode.containerInfo;if(z===x||z.nodeType===8&&z.parentNode===x)break;if(I===4)for(I=y.return;I!==null;){var K=I.tag;if((K===3||K===4)&&(K=I.stateNode.containerInfo,K===x||K.nodeType===8&&K.parentNode===x))return;I=I.return}for(;z!==null;){if(I=Al(z),I===null)return;if(K=I.tag,K===5||K===6){y=k=I;continue e}z=z.parentNode}}y=y.return}hn(function(){var ae=k,_e=Ui(h),we=[];e:{var ye=DS.get(a);if(ye!==void 0){var Fe=dv,Ke=a;switch(a){case"keypress":if(tp(h)===0)break e;case"keydown":case"keyup":Fe=V$;break;case"focusin":Ke="focus",Fe=pv;break;case"focusout":Ke="blur",Fe=pv;break;case"beforeblur":case"afterblur":Fe=pv;break;case"click":if(h.button===2)break e;case"auxclick":case"dblclick":case"mousedown":case"mousemove":case"mouseup":case"mouseout":case"mouseover":case"contextmenu":Fe=hS;break;case"drag":case"dragend":case"dragenter":case"dragexit":case"dragleave":case"dragover":case"dragstart":case"drop":Fe=T$;break;case"touchcancel":case"touchend":case"touchmove":case"touchstart":Fe=Z$;break;case MS:case NS:case LS:Fe=O$;break;case $S:Fe=W$;break;case"scroll":Fe=P$;break;case"wheel":Fe=G$;break;case"copy":case"cut":case"paste":Fe=N$;break;case"gotpointercapture":case"lostpointercapture":case"pointercancel":case"pointerdown":case"pointermove":case"pointerout":case"pointerover":case"pointerup":Fe=mS}var qe=(l&4)!==0,Yn=!qe&&a==="scroll",ne=qe?ye!==null?ye+"Capture":null:ye;qe=[];for(var Q=ae,se;Q!==null;){se=Q;var Ce=se.stateNode;if(se.tag===5&&Ce!==null&&(se=Ce,ne!==null&&(Ce=wn(Q,ne),Ce!=null&&qe.push(Wd(Q,Ce,se)))),Yn)break;Q=Q.return}0<qe.length&&(ye=new Fe(ye,Ke,null,h,_e),we.push({event:ye,listeners:qe}))}}if((l&7)===0){e:{if(ye=a==="mouseover"||a==="pointerover",Fe=a==="mouseout"||a==="pointerout",ye&&h!==Jn&&(Ke=h.relatedTarget||h.fromElement)&&(Al(Ke)||Ke[Co]))break e;if((Fe||ye)&&(ye=_e.window===_e?_e:(ye=_e.ownerDocument)?ye.defaultView||ye.parentWindow:window,Fe?(Ke=h.relatedTarget||h.toElement,Fe=ae,Ke=Ke?Al(Ke):null,Ke!==null&&(Yn=wr(Ke),Ke!==Yn||Ke.tag!==5&&Ke.tag!==6)&&(Ke=null)):(Fe=null,Ke=ae),Fe!==Ke)){if(qe=hS,Ce="onMouseLeave",ne="onMouseEnter",Q="mouse",(a==="pointerout"||a==="pointerover")&&(qe=mS,Ce="onPointerLeave",ne="onPointerEnter",Q="pointer"),Yn=Fe==null?ye:Fc(Fe),se=Ke==null?ye:Fc(Ke),ye=new qe(Ce,Q+"leave",Fe,h,_e),ye.target=Yn,ye.relatedTarget=se,Ce=null,Al(_e)===ae&&(qe=new qe(ne,Q+"enter",Ke,h,_e),qe.target=se,qe.relatedTarget=Yn,Ce=qe),Yn=Ce,Fe&&Ke)t:{for(qe=Fe,ne=Ke,Q=0,se=qe;se;se=$c(se))Q++;for(se=0,Ce=ne;Ce;Ce=$c(Ce))se++;for(;0<Q-se;)qe=$c(qe),Q--;for(;0<se-Q;)ne=$c(ne),se--;for(;Q--;){if(qe===ne||ne!==null&&qe===ne.alternate)break t;qe=$c(qe),ne=$c(ne)}qe=null}else qe=null;Fe!==null&&HS(we,ye,Fe,qe,!1),Ke!==null&&Yn!==null&&HS(we,Yn,Ke,qe,!0)}}e:{if(ye=ae?Fc(ae):window,Fe=ye.nodeName&&ye.nodeName.toLowerCase(),Fe==="select"||Fe==="input"&&ye.type==="file")var Je=tD;else if(bS(ye))if(SS)Je=iD;else{Je=rD;var ct=nD}else(Fe=ye.nodeName)&&Fe.toLowerCase()==="input"&&(ye.type==="checkbox"||ye.type==="radio")&&(Je=sD);if(Je&&(Je=Je(a,ae))){xS(we,Je,h,_e);break e}ct&&ct(a,ye,ae),a==="focusout"&&(ct=ye._wrapperState)&&ct.controlled&&ye.type==="number"&&Qt(ye,"number",ye.value)}switch(ct=ae?Fc(ae):window,a){case"focusin":(bS(ct)||ct.contentEditable==="true")&&(Nc=ct,wv=ae,Ud=null);break;case"focusout":Ud=wv=Nc=null;break;case"mousedown":bv=!0;break;case"contextmenu":case"mouseup":case"dragend":bv=!1,IS(we,h,_e);break;case"selectionchange":if(lD)break;case"keydown":case"keyup":IS(we,h,_e)}var ut;if(gv)e:{switch(a){case"compositionstart":var mt="onCompositionStart";break e;case"compositionend":mt="onCompositionEnd";break e;case"compositionupdate":mt="onCompositionUpdate";break e}mt=void 0}else Mc?_S(a,h)&&(mt="onCompositionEnd"):a==="keydown"&&h.keyCode===229&&(mt="onCompositionStart");mt&&(gS&&h.locale!=="ko"&&(Mc||mt!=="onCompositionStart"?mt==="onCompositionEnd"&&Mc&&(ut=dS()):(va=_e,uv="value"in va?va.value:va.textContent,Mc=!0)),ct=lp(ae,mt),0<ct.length&&(mt=new pS(mt,a,null,h,_e),we.push({event:mt,listeners:ct}),ut?mt.data=ut:(ut=wS(h),ut!==null&&(mt.data=ut)))),(ut=Y$?Q$(a,h):X$(a,h))&&(ae=lp(ae,"onBeforeInput"),0<ae.length&&(_e=new pS("onBeforeInput","beforeinput",null,h,_e),we.push({event:_e,listeners:ae}),_e.data=ut))}zS(we,l)})}function Wd(a,l,h){return{instance:a,listener:l,currentTarget:h}}function lp(a,l){for(var h=l+"Capture",y=[];a!==null;){var x=a,k=x.stateNode;x.tag===5&&k!==null&&(x=k,k=wn(a,h),k!=null&&y.unshift(Wd(a,k,x)),k=wn(a,l),k!=null&&y.push(Wd(a,k,x))),a=a.return}return y}function $c(a){if(a===null)return null;do a=a.return;while(a&&a.tag!==5);return a||null}function HS(a,l,h,y,x){for(var k=l._reactName,I=[];h!==null&&h!==y;){var z=h,K=z.alternate,ae=z.stateNode;if(K!==null&&K===y)break;z.tag===5&&ae!==null&&(z=ae,x?(K=wn(h,k),K!=null&&I.unshift(Wd(h,K,z))):x||(K=wn(h,k),K!=null&&I.push(Wd(h,K,z)))),h=h.return}I.length!==0&&a.push({event:l,listeners:I})}var fD=/\r\n?/g,hD=/\u0000|\uFFFD/g;function US(a){return(typeof a=="string"?a:""+a).replace(fD,`
|
|
106
|
+
`).replace(hD,"")}function cp(a,l,h){if(l=US(l),US(a)!==l&&h)throw Error(n(425))}function up(){}var Pv=null,Av=null;function Tv(a,l){return a==="textarea"||a==="noscript"||typeof l.children=="string"||typeof l.children=="number"||typeof l.dangerouslySetInnerHTML=="object"&&l.dangerouslySetInnerHTML!==null&&l.dangerouslySetInnerHTML.__html!=null}var Rv=typeof setTimeout=="function"?setTimeout:void 0,pD=typeof clearTimeout=="function"?clearTimeout:void 0,ZS=typeof Promise=="function"?Promise:void 0,mD=typeof queueMicrotask=="function"?queueMicrotask:typeof ZS<"u"?function(a){return ZS.resolve(null).then(a).catch(gD)}:Rv;function gD(a){setTimeout(function(){throw a})}function Iv(a,l){var h=l,y=0;do{var x=h.nextSibling;if(a.removeChild(h),x&&x.nodeType===8)if(h=x.data,h==="/$"){if(y===0){a.removeChild(x),Pt(l);return}y--}else h!=="$"&&h!=="$?"&&h!=="$!"||y++;h=x}while(h);Pt(l)}function _a(a){for(;a!=null;a=a.nextSibling){var l=a.nodeType;if(l===1||l===3)break;if(l===8){if(l=a.data,l==="$"||l==="$!"||l==="$?")break;if(l==="/$")return null}}return a}function BS(a){a=a.previousSibling;for(var l=0;a;){if(a.nodeType===8){var h=a.data;if(h==="$"||h==="$!"||h==="$?"){if(l===0)return a;l--}else h==="/$"&&l++}a=a.previousSibling}return null}var Dc=Math.random().toString(36).slice(2),qi="__reactFiber$"+Dc,Kd="__reactProps$"+Dc,Co="__reactContainer$"+Dc,Ov="__reactEvents$"+Dc,vD="__reactListeners$"+Dc,yD="__reactHandles$"+Dc;function Al(a){var l=a[qi];if(l)return l;for(var h=a.parentNode;h;){if(l=h[Co]||h[qi]){if(h=l.alternate,l.child!==null||h!==null&&h.child!==null)for(a=BS(a);a!==null;){if(h=a[qi])return h;a=BS(a)}return l}a=h,h=a.parentNode}return null}function Gd(a){return a=a[qi]||a[Co],!a||a.tag!==5&&a.tag!==6&&a.tag!==13&&a.tag!==3?null:a}function Fc(a){if(a.tag===5||a.tag===6)return a.stateNode;throw Error(n(33))}function dp(a){return a[Kd]||null}var Mv=[],jc=-1;function wa(a){return{current:a}}function En(a){0>jc||(a.current=Mv[jc],Mv[jc]=null,jc--)}function bn(a,l){jc++,Mv[jc]=a.current,a.current=l}var ba={},Wr=wa(ba),_s=wa(!1),Tl=ba;function zc(a,l){var h=a.type.contextTypes;if(!h)return ba;var y=a.stateNode;if(y&&y.__reactInternalMemoizedUnmaskedChildContext===l)return y.__reactInternalMemoizedMaskedChildContext;var x={},k;for(k in h)x[k]=l[k];return y&&(a=a.stateNode,a.__reactInternalMemoizedUnmaskedChildContext=l,a.__reactInternalMemoizedMaskedChildContext=x),x}function ws(a){return a=a.childContextTypes,a!=null}function fp(){En(_s),En(Wr)}function WS(a,l,h){if(Wr.current!==ba)throw Error(n(168));bn(Wr,l),bn(_s,h)}function KS(a,l,h){var y=a.stateNode;if(l=l.childContextTypes,typeof y.getChildContext!="function")return h;y=y.getChildContext();for(var x in y)if(!(x in l))throw Error(n(108,ke(a)||"Unknown",x));return B({},h,y)}function hp(a){return a=(a=a.stateNode)&&a.__reactInternalMemoizedMergedChildContext||ba,Tl=Wr.current,bn(Wr,a),bn(_s,_s.current),!0}function GS(a,l,h){var y=a.stateNode;if(!y)throw Error(n(169));h?(a=KS(a,l,Tl),y.__reactInternalMemoizedMergedChildContext=a,En(_s),En(Wr),bn(Wr,a)):En(_s),bn(_s,h)}var Po=null,pp=!1,Nv=!1;function qS(a){Po===null?Po=[a]:Po.push(a)}function _D(a){pp=!0,qS(a)}function xa(){if(!Nv&&Po!==null){Nv=!0;var a=0,l=it;try{var h=Po;for(it=1;a<h.length;a++){var y=h[a];do y=y(!0);while(y!==null)}Po=null,pp=!1}catch(x){throw Po!==null&&(Po=Po.slice(a+1)),Ds(Fs,xa),x}finally{it=l,Nv=!1}}return null}var Vc=[],Hc=0,mp=null,gp=0,ri=[],si=0,Rl=null,Ao=1,To="";function Il(a,l){Vc[Hc++]=gp,Vc[Hc++]=mp,mp=a,gp=l}function YS(a,l,h){ri[si++]=Ao,ri[si++]=To,ri[si++]=Rl,Rl=a;var y=Ao;a=To;var x=32-is(y)-1;y&=~(1<<x),h+=1;var k=32-is(l)+x;if(30<k){var I=x-x%5;k=(y&(1<<I)-1).toString(32),y>>=I,x-=I,Ao=1<<32-is(l)+x|h<<x|y,To=k+a}else Ao=1<<k|h<<x|y,To=a}function Lv(a){a.return!==null&&(Il(a,1),YS(a,1,0))}function $v(a){for(;a===mp;)mp=Vc[--Hc],Vc[Hc]=null,gp=Vc[--Hc],Vc[Hc]=null;for(;a===Rl;)Rl=ri[--si],ri[si]=null,To=ri[--si],ri[si]=null,Ao=ri[--si],ri[si]=null}var Hs=null,Us=null,In=!1,Ei=null;function QS(a,l){var h=li(5,null,null,0);h.elementType="DELETED",h.stateNode=l,h.return=a,l=a.deletions,l===null?(a.deletions=[h],a.flags|=16):l.push(h)}function XS(a,l){switch(a.tag){case 5:var h=a.type;return l=l.nodeType!==1||h.toLowerCase()!==l.nodeName.toLowerCase()?null:l,l!==null?(a.stateNode=l,Hs=a,Us=_a(l.firstChild),!0):!1;case 6:return l=a.pendingProps===""||l.nodeType!==3?null:l,l!==null?(a.stateNode=l,Hs=a,Us=null,!0):!1;case 13:return l=l.nodeType!==8?null:l,l!==null?(h=Rl!==null?{id:Ao,overflow:To}:null,a.memoizedState={dehydrated:l,treeContext:h,retryLane:1073741824},h=li(18,null,null,0),h.stateNode=l,h.return=a,a.child=h,Hs=a,Us=null,!0):!1;default:return!1}}function Dv(a){return(a.mode&1)!==0&&(a.flags&128)===0}function Fv(a){if(In){var l=Us;if(l){var h=l;if(!XS(a,l)){if(Dv(a))throw Error(n(418));l=_a(h.nextSibling);var y=Hs;l&&XS(a,l)?QS(y,h):(a.flags=a.flags&-4097|2,In=!1,Hs=a)}}else{if(Dv(a))throw Error(n(418));a.flags=a.flags&-4097|2,In=!1,Hs=a}}}function JS(a){for(a=a.return;a!==null&&a.tag!==5&&a.tag!==3&&a.tag!==13;)a=a.return;Hs=a}function vp(a){if(a!==Hs)return!1;if(!In)return JS(a),In=!0,!1;var l;if((l=a.tag!==3)&&!(l=a.tag!==5)&&(l=a.type,l=l!=="head"&&l!=="body"&&!Tv(a.type,a.memoizedProps)),l&&(l=Us)){if(Dv(a))throw eE(),Error(n(418));for(;l;)QS(a,l),l=_a(l.nextSibling)}if(JS(a),a.tag===13){if(a=a.memoizedState,a=a!==null?a.dehydrated:null,!a)throw Error(n(317));e:{for(a=a.nextSibling,l=0;a;){if(a.nodeType===8){var h=a.data;if(h==="/$"){if(l===0){Us=_a(a.nextSibling);break e}l--}else h!=="$"&&h!=="$!"&&h!=="$?"||l++}a=a.nextSibling}Us=null}}else Us=Hs?_a(a.stateNode.nextSibling):null;return!0}function eE(){for(var a=Us;a;)a=_a(a.nextSibling)}function Uc(){Us=Hs=null,In=!1}function jv(a){Ei===null?Ei=[a]:Ei.push(a)}var wD=A.ReactCurrentBatchConfig;function qd(a,l,h){if(a=h.ref,a!==null&&typeof a!="function"&&typeof a!="object"){if(h._owner){if(h=h._owner,h){if(h.tag!==1)throw Error(n(309));var y=h.stateNode}if(!y)throw Error(n(147,a));var x=y,k=""+a;return l!==null&&l.ref!==null&&typeof l.ref=="function"&&l.ref._stringRef===k?l.ref:(l=function(I){var z=x.refs;I===null?delete z[k]:z[k]=I},l._stringRef=k,l)}if(typeof a!="string")throw Error(n(284));if(!h._owner)throw Error(n(290,a))}return a}function yp(a,l){throw a=Object.prototype.toString.call(l),Error(n(31,a==="[object Object]"?"object with keys {"+Object.keys(l).join(", ")+"}":a))}function tE(a){var l=a._init;return l(a._payload)}function nE(a){function l(ne,Q){if(a){var se=ne.deletions;se===null?(ne.deletions=[Q],ne.flags|=16):se.push(Q)}}function h(ne,Q){if(!a)return null;for(;Q!==null;)l(ne,Q),Q=Q.sibling;return null}function y(ne,Q){for(ne=new Map;Q!==null;)Q.key!==null?ne.set(Q.key,Q):ne.set(Q.index,Q),Q=Q.sibling;return ne}function x(ne,Q){return ne=Ra(ne,Q),ne.index=0,ne.sibling=null,ne}function k(ne,Q,se){return ne.index=se,a?(se=ne.alternate,se!==null?(se=se.index,se<Q?(ne.flags|=2,Q):se):(ne.flags|=2,Q)):(ne.flags|=1048576,Q)}function I(ne){return a&&ne.alternate===null&&(ne.flags|=2),ne}function z(ne,Q,se,Ce){return Q===null||Q.tag!==6?(Q=Ry(se,ne.mode,Ce),Q.return=ne,Q):(Q=x(Q,se),Q.return=ne,Q)}function K(ne,Q,se,Ce){var Je=se.type;return Je===O?_e(ne,Q,se.props.children,Ce,se.key):Q!==null&&(Q.elementType===Je||typeof Je=="object"&&Je!==null&&Je.$$typeof===q&&tE(Je)===Q.type)?(Ce=x(Q,se.props),Ce.ref=qd(ne,Q,se),Ce.return=ne,Ce):(Ce=Hp(se.type,se.key,se.props,null,ne.mode,Ce),Ce.ref=qd(ne,Q,se),Ce.return=ne,Ce)}function ae(ne,Q,se,Ce){return Q===null||Q.tag!==4||Q.stateNode.containerInfo!==se.containerInfo||Q.stateNode.implementation!==se.implementation?(Q=Iy(se,ne.mode,Ce),Q.return=ne,Q):(Q=x(Q,se.children||[]),Q.return=ne,Q)}function _e(ne,Q,se,Ce,Je){return Q===null||Q.tag!==7?(Q=jl(se,ne.mode,Ce,Je),Q.return=ne,Q):(Q=x(Q,se),Q.return=ne,Q)}function we(ne,Q,se){if(typeof Q=="string"&&Q!==""||typeof Q=="number")return Q=Ry(""+Q,ne.mode,se),Q.return=ne,Q;if(typeof Q=="object"&&Q!==null){switch(Q.$$typeof){case T:return se=Hp(Q.type,Q.key,Q.props,null,ne.mode,se),se.ref=qd(ne,null,Q),se.return=ne,se;case M:return Q=Iy(Q,ne.mode,se),Q.return=ne,Q;case q:var Ce=Q._init;return we(ne,Ce(Q._payload),se)}if(Me(Q)||X(Q))return Q=jl(Q,ne.mode,se,null),Q.return=ne,Q;yp(ne,Q)}return null}function ye(ne,Q,se,Ce){var Je=Q!==null?Q.key:null;if(typeof se=="string"&&se!==""||typeof se=="number")return Je!==null?null:z(ne,Q,""+se,Ce);if(typeof se=="object"&&se!==null){switch(se.$$typeof){case T:return se.key===Je?K(ne,Q,se,Ce):null;case M:return se.key===Je?ae(ne,Q,se,Ce):null;case q:return Je=se._init,ye(ne,Q,Je(se._payload),Ce)}if(Me(se)||X(se))return Je!==null?null:_e(ne,Q,se,Ce,null);yp(ne,se)}return null}function Fe(ne,Q,se,Ce,Je){if(typeof Ce=="string"&&Ce!==""||typeof Ce=="number")return ne=ne.get(se)||null,z(Q,ne,""+Ce,Je);if(typeof Ce=="object"&&Ce!==null){switch(Ce.$$typeof){case T:return ne=ne.get(Ce.key===null?se:Ce.key)||null,K(Q,ne,Ce,Je);case M:return ne=ne.get(Ce.key===null?se:Ce.key)||null,ae(Q,ne,Ce,Je);case q:var ct=Ce._init;return Fe(ne,Q,se,ct(Ce._payload),Je)}if(Me(Ce)||X(Ce))return ne=ne.get(se)||null,_e(Q,ne,Ce,Je,null);yp(Q,Ce)}return null}function Ke(ne,Q,se,Ce){for(var Je=null,ct=null,ut=Q,mt=Q=0,Er=null;ut!==null&&mt<se.length;mt++){ut.index>mt?(Er=ut,ut=null):Er=ut.sibling;var qt=ye(ne,ut,se[mt],Ce);if(qt===null){ut===null&&(ut=Er);break}a&&ut&&qt.alternate===null&&l(ne,ut),Q=k(qt,Q,mt),ct===null?Je=qt:ct.sibling=qt,ct=qt,ut=Er}if(mt===se.length)return h(ne,ut),In&&Il(ne,mt),Je;if(ut===null){for(;mt<se.length;mt++)ut=we(ne,se[mt],Ce),ut!==null&&(Q=k(ut,Q,mt),ct===null?Je=ut:ct.sibling=ut,ct=ut);return In&&Il(ne,mt),Je}for(ut=y(ne,ut);mt<se.length;mt++)Er=Fe(ut,ne,mt,se[mt],Ce),Er!==null&&(a&&Er.alternate!==null&&ut.delete(Er.key===null?mt:Er.key),Q=k(Er,Q,mt),ct===null?Je=Er:ct.sibling=Er,ct=Er);return a&&ut.forEach(function(Ia){return l(ne,Ia)}),In&&Il(ne,mt),Je}function qe(ne,Q,se,Ce){var Je=X(se);if(typeof Je!="function")throw Error(n(150));if(se=Je.call(se),se==null)throw Error(n(151));for(var ct=Je=null,ut=Q,mt=Q=0,Er=null,qt=se.next();ut!==null&&!qt.done;mt++,qt=se.next()){ut.index>mt?(Er=ut,ut=null):Er=ut.sibling;var Ia=ye(ne,ut,qt.value,Ce);if(Ia===null){ut===null&&(ut=Er);break}a&&ut&&Ia.alternate===null&&l(ne,ut),Q=k(Ia,Q,mt),ct===null?Je=Ia:ct.sibling=Ia,ct=Ia,ut=Er}if(qt.done)return h(ne,ut),In&&Il(ne,mt),Je;if(ut===null){for(;!qt.done;mt++,qt=se.next())qt=we(ne,qt.value,Ce),qt!==null&&(Q=k(qt,Q,mt),ct===null?Je=qt:ct.sibling=qt,ct=qt);return In&&Il(ne,mt),Je}for(ut=y(ne,ut);!qt.done;mt++,qt=se.next())qt=Fe(ut,ne,mt,qt.value,Ce),qt!==null&&(a&&qt.alternate!==null&&ut.delete(qt.key===null?mt:qt.key),Q=k(qt,Q,mt),ct===null?Je=qt:ct.sibling=qt,ct=qt);return a&&ut.forEach(function(JD){return l(ne,JD)}),In&&Il(ne,mt),Je}function Yn(ne,Q,se,Ce){if(typeof se=="object"&&se!==null&&se.type===O&&se.key===null&&(se=se.props.children),typeof se=="object"&&se!==null){switch(se.$$typeof){case T:e:{for(var Je=se.key,ct=Q;ct!==null;){if(ct.key===Je){if(Je=se.type,Je===O){if(ct.tag===7){h(ne,ct.sibling),Q=x(ct,se.props.children),Q.return=ne,ne=Q;break e}}else if(ct.elementType===Je||typeof Je=="object"&&Je!==null&&Je.$$typeof===q&&tE(Je)===ct.type){h(ne,ct.sibling),Q=x(ct,se.props),Q.ref=qd(ne,ct,se),Q.return=ne,ne=Q;break e}h(ne,ct);break}else l(ne,ct);ct=ct.sibling}se.type===O?(Q=jl(se.props.children,ne.mode,Ce,se.key),Q.return=ne,ne=Q):(Ce=Hp(se.type,se.key,se.props,null,ne.mode,Ce),Ce.ref=qd(ne,Q,se),Ce.return=ne,ne=Ce)}return I(ne);case M:e:{for(ct=se.key;Q!==null;){if(Q.key===ct)if(Q.tag===4&&Q.stateNode.containerInfo===se.containerInfo&&Q.stateNode.implementation===se.implementation){h(ne,Q.sibling),Q=x(Q,se.children||[]),Q.return=ne,ne=Q;break e}else{h(ne,Q);break}else l(ne,Q);Q=Q.sibling}Q=Iy(se,ne.mode,Ce),Q.return=ne,ne=Q}return I(ne);case q:return ct=se._init,Yn(ne,Q,ct(se._payload),Ce)}if(Me(se))return Ke(ne,Q,se,Ce);if(X(se))return qe(ne,Q,se,Ce);yp(ne,se)}return typeof se=="string"&&se!==""||typeof se=="number"?(se=""+se,Q!==null&&Q.tag===6?(h(ne,Q.sibling),Q=x(Q,se),Q.return=ne,ne=Q):(h(ne,Q),Q=Ry(se,ne.mode,Ce),Q.return=ne,ne=Q),I(ne)):h(ne,Q)}return Yn}var Zc=nE(!0),rE=nE(!1),_p=wa(null),wp=null,Bc=null,zv=null;function Vv(){zv=Bc=wp=null}function Hv(a){var l=_p.current;En(_p),a._currentValue=l}function Uv(a,l,h){for(;a!==null;){var y=a.alternate;if((a.childLanes&l)!==l?(a.childLanes|=l,y!==null&&(y.childLanes|=l)):y!==null&&(y.childLanes&l)!==l&&(y.childLanes|=l),a===h)break;a=a.return}}function Wc(a,l){wp=a,zv=Bc=null,a=a.dependencies,a!==null&&a.firstContext!==null&&((a.lanes&l)!==0&&(bs=!0),a.firstContext=null)}function ii(a){var l=a._currentValue;if(zv!==a)if(a={context:a,memoizedValue:l,next:null},Bc===null){if(wp===null)throw Error(n(308));Bc=a,wp.dependencies={lanes:0,firstContext:a}}else Bc=Bc.next=a;return l}var Ol=null;function Zv(a){Ol===null?Ol=[a]:Ol.push(a)}function sE(a,l,h,y){var x=l.interleaved;return x===null?(h.next=h,Zv(l)):(h.next=x.next,x.next=h),l.interleaved=h,Ro(a,y)}function Ro(a,l){a.lanes|=l;var h=a.alternate;for(h!==null&&(h.lanes|=l),h=a,a=a.return;a!==null;)a.childLanes|=l,h=a.alternate,h!==null&&(h.childLanes|=l),h=a,a=a.return;return h.tag===3?h.stateNode:null}var Sa=!1;function Bv(a){a.updateQueue={baseState:a.memoizedState,firstBaseUpdate:null,lastBaseUpdate:null,shared:{pending:null,interleaved:null,lanes:0},effects:null}}function iE(a,l){a=a.updateQueue,l.updateQueue===a&&(l.updateQueue={baseState:a.baseState,firstBaseUpdate:a.firstBaseUpdate,lastBaseUpdate:a.lastBaseUpdate,shared:a.shared,effects:a.effects})}function Io(a,l){return{eventTime:a,lane:l,tag:0,payload:null,callback:null,next:null}}function Ea(a,l,h){var y=a.updateQueue;if(y===null)return null;if(y=y.shared,(Wt&2)!==0){var x=y.pending;return x===null?l.next=l:(l.next=x.next,x.next=l),y.pending=l,Ro(a,h)}return x=y.interleaved,x===null?(l.next=l,Zv(y)):(l.next=x.next,x.next=l),y.interleaved=l,Ro(a,h)}function bp(a,l,h){if(l=l.updateQueue,l!==null&&(l=l.shared,(h&4194240)!==0)){var y=l.lanes;y&=a.pendingLanes,h|=y,l.lanes=h,Rn(a,h)}}function oE(a,l){var h=a.updateQueue,y=a.alternate;if(y!==null&&(y=y.updateQueue,h===y)){var x=null,k=null;if(h=h.firstBaseUpdate,h!==null){do{var I={eventTime:h.eventTime,lane:h.lane,tag:h.tag,payload:h.payload,callback:h.callback,next:null};k===null?x=k=I:k=k.next=I,h=h.next}while(h!==null);k===null?x=k=l:k=k.next=l}else x=k=l;h={baseState:y.baseState,firstBaseUpdate:x,lastBaseUpdate:k,shared:y.shared,effects:y.effects},a.updateQueue=h;return}a=h.lastBaseUpdate,a===null?h.firstBaseUpdate=l:a.next=l,h.lastBaseUpdate=l}function xp(a,l,h,y){var x=a.updateQueue;Sa=!1;var k=x.firstBaseUpdate,I=x.lastBaseUpdate,z=x.shared.pending;if(z!==null){x.shared.pending=null;var K=z,ae=K.next;K.next=null,I===null?k=ae:I.next=ae,I=K;var _e=a.alternate;_e!==null&&(_e=_e.updateQueue,z=_e.lastBaseUpdate,z!==I&&(z===null?_e.firstBaseUpdate=ae:z.next=ae,_e.lastBaseUpdate=K))}if(k!==null){var we=x.baseState;I=0,_e=ae=K=null,z=k;do{var ye=z.lane,Fe=z.eventTime;if((y&ye)===ye){_e!==null&&(_e=_e.next={eventTime:Fe,lane:0,tag:z.tag,payload:z.payload,callback:z.callback,next:null});e:{var Ke=a,qe=z;switch(ye=l,Fe=h,qe.tag){case 1:if(Ke=qe.payload,typeof Ke=="function"){we=Ke.call(Fe,we,ye);break e}we=Ke;break e;case 3:Ke.flags=Ke.flags&-65537|128;case 0:if(Ke=qe.payload,ye=typeof Ke=="function"?Ke.call(Fe,we,ye):Ke,ye==null)break e;we=B({},we,ye);break e;case 2:Sa=!0}}z.callback!==null&&z.lane!==0&&(a.flags|=64,ye=x.effects,ye===null?x.effects=[z]:ye.push(z))}else Fe={eventTime:Fe,lane:ye,tag:z.tag,payload:z.payload,callback:z.callback,next:null},_e===null?(ae=_e=Fe,K=we):_e=_e.next=Fe,I|=ye;if(z=z.next,z===null){if(z=x.shared.pending,z===null)break;ye=z,z=ye.next,ye.next=null,x.lastBaseUpdate=ye,x.shared.pending=null}}while(!0);if(_e===null&&(K=we),x.baseState=K,x.firstBaseUpdate=ae,x.lastBaseUpdate=_e,l=x.shared.interleaved,l!==null){x=l;do I|=x.lane,x=x.next;while(x!==l)}else k===null&&(x.shared.lanes=0);Ll|=I,a.lanes=I,a.memoizedState=we}}function aE(a,l,h){if(a=l.effects,l.effects=null,a!==null)for(l=0;l<a.length;l++){var y=a[l],x=y.callback;if(x!==null){if(y.callback=null,y=h,typeof x!="function")throw Error(n(191,x));x.call(y)}}}var Yd={},Yi=wa(Yd),Qd=wa(Yd),Xd=wa(Yd);function Ml(a){if(a===Yd)throw Error(n(174));return a}function Wv(a,l){switch(bn(Xd,l),bn(Qd,a),bn(Yi,Yd),a=l.nodeType,a){case 9:case 11:l=(l=l.documentElement)?l.namespaceURI:gt(null,"");break;default:a=a===8?l.parentNode:l,l=a.namespaceURI||null,a=a.tagName,l=gt(l,a)}En(Yi),bn(Yi,l)}function Kc(){En(Yi),En(Qd),En(Xd)}function lE(a){Ml(Xd.current);var l=Ml(Yi.current),h=gt(l,a.type);l!==h&&(bn(Qd,a),bn(Yi,h))}function Kv(a){Qd.current===a&&(En(Yi),En(Qd))}var Ln=wa(0);function Sp(a){for(var l=a;l!==null;){if(l.tag===13){var h=l.memoizedState;if(h!==null&&(h=h.dehydrated,h===null||h.data==="$?"||h.data==="$!"))return l}else if(l.tag===19&&l.memoizedProps.revealOrder!==void 0){if((l.flags&128)!==0)return l}else if(l.child!==null){l.child.return=l,l=l.child;continue}if(l===a)break;for(;l.sibling===null;){if(l.return===null||l.return===a)return null;l=l.return}l.sibling.return=l.return,l=l.sibling}return null}var Gv=[];function qv(){for(var a=0;a<Gv.length;a++)Gv[a]._workInProgressVersionPrimary=null;Gv.length=0}var Ep=A.ReactCurrentDispatcher,Yv=A.ReactCurrentBatchConfig,Nl=0,$n=null,dr=null,xr=null,kp=!1,Jd=!1,ef=0,bD=0;function Kr(){throw Error(n(321))}function Qv(a,l){if(l===null)return!1;for(var h=0;h<l.length&&h<a.length;h++)if(!Si(a[h],l[h]))return!1;return!0}function Xv(a,l,h,y,x,k){if(Nl=k,$n=l,l.memoizedState=null,l.updateQueue=null,l.lanes=0,Ep.current=a===null||a.memoizedState===null?kD:CD,a=h(y,x),Jd){k=0;do{if(Jd=!1,ef=0,25<=k)throw Error(n(301));k+=1,xr=dr=null,l.updateQueue=null,Ep.current=PD,a=h(y,x)}while(Jd)}if(Ep.current=Ap,l=dr!==null&&dr.next!==null,Nl=0,xr=dr=$n=null,kp=!1,l)throw Error(n(300));return a}function Jv(){var a=ef!==0;return ef=0,a}function Qi(){var a={memoizedState:null,baseState:null,baseQueue:null,queue:null,next:null};return xr===null?$n.memoizedState=xr=a:xr=xr.next=a,xr}function oi(){if(dr===null){var a=$n.alternate;a=a!==null?a.memoizedState:null}else a=dr.next;var l=xr===null?$n.memoizedState:xr.next;if(l!==null)xr=l,dr=a;else{if(a===null)throw Error(n(310));dr=a,a={memoizedState:dr.memoizedState,baseState:dr.baseState,baseQueue:dr.baseQueue,queue:dr.queue,next:null},xr===null?$n.memoizedState=xr=a:xr=xr.next=a}return xr}function tf(a,l){return typeof l=="function"?l(a):l}function ey(a){var l=oi(),h=l.queue;if(h===null)throw Error(n(311));h.lastRenderedReducer=a;var y=dr,x=y.baseQueue,k=h.pending;if(k!==null){if(x!==null){var I=x.next;x.next=k.next,k.next=I}y.baseQueue=x=k,h.pending=null}if(x!==null){k=x.next,y=y.baseState;var z=I=null,K=null,ae=k;do{var _e=ae.lane;if((Nl&_e)===_e)K!==null&&(K=K.next={lane:0,action:ae.action,hasEagerState:ae.hasEagerState,eagerState:ae.eagerState,next:null}),y=ae.hasEagerState?ae.eagerState:a(y,ae.action);else{var we={lane:_e,action:ae.action,hasEagerState:ae.hasEagerState,eagerState:ae.eagerState,next:null};K===null?(z=K=we,I=y):K=K.next=we,$n.lanes|=_e,Ll|=_e}ae=ae.next}while(ae!==null&&ae!==k);K===null?I=y:K.next=z,Si(y,l.memoizedState)||(bs=!0),l.memoizedState=y,l.baseState=I,l.baseQueue=K,h.lastRenderedState=y}if(a=h.interleaved,a!==null){x=a;do k=x.lane,$n.lanes|=k,Ll|=k,x=x.next;while(x!==a)}else x===null&&(h.lanes=0);return[l.memoizedState,h.dispatch]}function ty(a){var l=oi(),h=l.queue;if(h===null)throw Error(n(311));h.lastRenderedReducer=a;var y=h.dispatch,x=h.pending,k=l.memoizedState;if(x!==null){h.pending=null;var I=x=x.next;do k=a(k,I.action),I=I.next;while(I!==x);Si(k,l.memoizedState)||(bs=!0),l.memoizedState=k,l.baseQueue===null&&(l.baseState=k),h.lastRenderedState=k}return[k,y]}function cE(){}function uE(a,l){var h=$n,y=oi(),x=l(),k=!Si(y.memoizedState,x);if(k&&(y.memoizedState=x,bs=!0),y=y.queue,ny(hE.bind(null,h,y,a),[a]),y.getSnapshot!==l||k||xr!==null&&xr.memoizedState.tag&1){if(h.flags|=2048,nf(9,fE.bind(null,h,y,x,l),void 0,null),Sr===null)throw Error(n(349));(Nl&30)!==0||dE(h,l,x)}return x}function dE(a,l,h){a.flags|=16384,a={getSnapshot:l,value:h},l=$n.updateQueue,l===null?(l={lastEffect:null,stores:null},$n.updateQueue=l,l.stores=[a]):(h=l.stores,h===null?l.stores=[a]:h.push(a))}function fE(a,l,h,y){l.value=h,l.getSnapshot=y,pE(l)&&mE(a)}function hE(a,l,h){return h(function(){pE(l)&&mE(a)})}function pE(a){var l=a.getSnapshot;a=a.value;try{var h=l();return!Si(a,h)}catch{return!0}}function mE(a){var l=Ro(a,1);l!==null&&Ai(l,a,1,-1)}function gE(a){var l=Qi();return typeof a=="function"&&(a=a()),l.memoizedState=l.baseState=a,a={pending:null,interleaved:null,lanes:0,dispatch:null,lastRenderedReducer:tf,lastRenderedState:a},l.queue=a,a=a.dispatch=ED.bind(null,$n,a),[l.memoizedState,a]}function nf(a,l,h,y){return a={tag:a,create:l,destroy:h,deps:y,next:null},l=$n.updateQueue,l===null?(l={lastEffect:null,stores:null},$n.updateQueue=l,l.lastEffect=a.next=a):(h=l.lastEffect,h===null?l.lastEffect=a.next=a:(y=h.next,h.next=a,a.next=y,l.lastEffect=a)),a}function vE(){return oi().memoizedState}function Cp(a,l,h,y){var x=Qi();$n.flags|=a,x.memoizedState=nf(1|l,h,void 0,y===void 0?null:y)}function Pp(a,l,h,y){var x=oi();y=y===void 0?null:y;var k=void 0;if(dr!==null){var I=dr.memoizedState;if(k=I.destroy,y!==null&&Qv(y,I.deps)){x.memoizedState=nf(l,h,k,y);return}}$n.flags|=a,x.memoizedState=nf(1|l,h,k,y)}function yE(a,l){return Cp(8390656,8,a,l)}function ny(a,l){return Pp(2048,8,a,l)}function _E(a,l){return Pp(4,2,a,l)}function wE(a,l){return Pp(4,4,a,l)}function bE(a,l){if(typeof l=="function")return a=a(),l(a),function(){l(null)};if(l!=null)return a=a(),l.current=a,function(){l.current=null}}function xE(a,l,h){return h=h!=null?h.concat([a]):null,Pp(4,4,bE.bind(null,l,a),h)}function ry(){}function SE(a,l){var h=oi();l=l===void 0?null:l;var y=h.memoizedState;return y!==null&&l!==null&&Qv(l,y[1])?y[0]:(h.memoizedState=[a,l],a)}function EE(a,l){var h=oi();l=l===void 0?null:l;var y=h.memoizedState;return y!==null&&l!==null&&Qv(l,y[1])?y[0]:(a=a(),h.memoizedState=[a,l],a)}function kE(a,l,h){return(Nl&21)===0?(a.baseState&&(a.baseState=!1,bs=!0),a.memoizedState=h):(Si(h,l)||(h=Ct(),$n.lanes|=h,Ll|=h,a.baseState=!0),l)}function xD(a,l){var h=it;it=h!==0&&4>h?h:4,a(!0);var y=Yv.transition;Yv.transition={};try{a(!1),l()}finally{it=h,Yv.transition=y}}function CE(){return oi().memoizedState}function SD(a,l,h){var y=Aa(a);if(h={lane:y,action:h,hasEagerState:!1,eagerState:null,next:null},PE(a))AE(l,h);else if(h=sE(a,l,h,y),h!==null){var x=as();Ai(h,a,y,x),TE(h,l,y)}}function ED(a,l,h){var y=Aa(a),x={lane:y,action:h,hasEagerState:!1,eagerState:null,next:null};if(PE(a))AE(l,x);else{var k=a.alternate;if(a.lanes===0&&(k===null||k.lanes===0)&&(k=l.lastRenderedReducer,k!==null))try{var I=l.lastRenderedState,z=k(I,h);if(x.hasEagerState=!0,x.eagerState=z,Si(z,I)){var K=l.interleaved;K===null?(x.next=x,Zv(l)):(x.next=K.next,K.next=x),l.interleaved=x;return}}catch{}finally{}h=sE(a,l,x,y),h!==null&&(x=as(),Ai(h,a,y,x),TE(h,l,y))}}function PE(a){var l=a.alternate;return a===$n||l!==null&&l===$n}function AE(a,l){Jd=kp=!0;var h=a.pending;h===null?l.next=l:(l.next=h.next,h.next=l),a.pending=l}function TE(a,l,h){if((h&4194240)!==0){var y=l.lanes;y&=a.pendingLanes,h|=y,l.lanes=h,Rn(a,h)}}var Ap={readContext:ii,useCallback:Kr,useContext:Kr,useEffect:Kr,useImperativeHandle:Kr,useInsertionEffect:Kr,useLayoutEffect:Kr,useMemo:Kr,useReducer:Kr,useRef:Kr,useState:Kr,useDebugValue:Kr,useDeferredValue:Kr,useTransition:Kr,useMutableSource:Kr,useSyncExternalStore:Kr,useId:Kr,unstable_isNewReconciler:!1},kD={readContext:ii,useCallback:function(a,l){return Qi().memoizedState=[a,l===void 0?null:l],a},useContext:ii,useEffect:yE,useImperativeHandle:function(a,l,h){return h=h!=null?h.concat([a]):null,Cp(4194308,4,bE.bind(null,l,a),h)},useLayoutEffect:function(a,l){return Cp(4194308,4,a,l)},useInsertionEffect:function(a,l){return Cp(4,2,a,l)},useMemo:function(a,l){var h=Qi();return l=l===void 0?null:l,a=a(),h.memoizedState=[a,l],a},useReducer:function(a,l,h){var y=Qi();return l=h!==void 0?h(l):l,y.memoizedState=y.baseState=l,a={pending:null,interleaved:null,lanes:0,dispatch:null,lastRenderedReducer:a,lastRenderedState:l},y.queue=a,a=a.dispatch=SD.bind(null,$n,a),[y.memoizedState,a]},useRef:function(a){var l=Qi();return a={current:a},l.memoizedState=a},useState:gE,useDebugValue:ry,useDeferredValue:function(a){return Qi().memoizedState=a},useTransition:function(){var a=gE(!1),l=a[0];return a=xD.bind(null,a[1]),Qi().memoizedState=a,[l,a]},useMutableSource:function(){},useSyncExternalStore:function(a,l,h){var y=$n,x=Qi();if(In){if(h===void 0)throw Error(n(407));h=h()}else{if(h=l(),Sr===null)throw Error(n(349));(Nl&30)!==0||dE(y,l,h)}x.memoizedState=h;var k={value:h,getSnapshot:l};return x.queue=k,yE(hE.bind(null,y,k,a),[a]),y.flags|=2048,nf(9,fE.bind(null,y,k,h,l),void 0,null),h},useId:function(){var a=Qi(),l=Sr.identifierPrefix;if(In){var h=To,y=Ao;h=(y&~(1<<32-is(y)-1)).toString(32)+h,l=":"+l+"R"+h,h=ef++,0<h&&(l+="H"+h.toString(32)),l+=":"}else h=bD++,l=":"+l+"r"+h.toString(32)+":";return a.memoizedState=l},unstable_isNewReconciler:!1},CD={readContext:ii,useCallback:SE,useContext:ii,useEffect:ny,useImperativeHandle:xE,useInsertionEffect:_E,useLayoutEffect:wE,useMemo:EE,useReducer:ey,useRef:vE,useState:function(){return ey(tf)},useDebugValue:ry,useDeferredValue:function(a){var l=oi();return kE(l,dr.memoizedState,a)},useTransition:function(){var a=ey(tf)[0],l=oi().memoizedState;return[a,l]},useMutableSource:cE,useSyncExternalStore:uE,useId:CE,unstable_isNewReconciler:!1},PD={readContext:ii,useCallback:SE,useContext:ii,useEffect:ny,useImperativeHandle:xE,useInsertionEffect:_E,useLayoutEffect:wE,useMemo:EE,useReducer:ty,useRef:vE,useState:function(){return ty(tf)},useDebugValue:ry,useDeferredValue:function(a){var l=oi();return dr===null?l.memoizedState=a:kE(l,dr.memoizedState,a)},useTransition:function(){var a=ty(tf)[0],l=oi().memoizedState;return[a,l]},useMutableSource:cE,useSyncExternalStore:uE,useId:CE,unstable_isNewReconciler:!1};function ki(a,l){if(a&&a.defaultProps){l=B({},l),a=a.defaultProps;for(var h in a)l[h]===void 0&&(l[h]=a[h]);return l}return l}function sy(a,l,h,y){l=a.memoizedState,h=h(y,l),h=h==null?l:B({},l,h),a.memoizedState=h,a.lanes===0&&(a.updateQueue.baseState=h)}var Tp={isMounted:function(a){return(a=a._reactInternals)?wr(a)===a:!1},enqueueSetState:function(a,l,h){a=a._reactInternals;var y=as(),x=Aa(a),k=Io(y,x);k.payload=l,h!=null&&(k.callback=h),l=Ea(a,k,x),l!==null&&(Ai(l,a,x,y),bp(l,a,x))},enqueueReplaceState:function(a,l,h){a=a._reactInternals;var y=as(),x=Aa(a),k=Io(y,x);k.tag=1,k.payload=l,h!=null&&(k.callback=h),l=Ea(a,k,x),l!==null&&(Ai(l,a,x,y),bp(l,a,x))},enqueueForceUpdate:function(a,l){a=a._reactInternals;var h=as(),y=Aa(a),x=Io(h,y);x.tag=2,l!=null&&(x.callback=l),l=Ea(a,x,y),l!==null&&(Ai(l,a,y,h),bp(l,a,y))}};function RE(a,l,h,y,x,k,I){return a=a.stateNode,typeof a.shouldComponentUpdate=="function"?a.shouldComponentUpdate(y,k,I):l.prototype&&l.prototype.isPureReactComponent?!Hd(h,y)||!Hd(x,k):!0}function IE(a,l,h){var y=!1,x=ba,k=l.contextType;return typeof k=="object"&&k!==null?k=ii(k):(x=ws(l)?Tl:Wr.current,y=l.contextTypes,k=(y=y!=null)?zc(a,x):ba),l=new l(h,k),a.memoizedState=l.state!==null&&l.state!==void 0?l.state:null,l.updater=Tp,a.stateNode=l,l._reactInternals=a,y&&(a=a.stateNode,a.__reactInternalMemoizedUnmaskedChildContext=x,a.__reactInternalMemoizedMaskedChildContext=k),l}function OE(a,l,h,y){a=l.state,typeof l.componentWillReceiveProps=="function"&&l.componentWillReceiveProps(h,y),typeof l.UNSAFE_componentWillReceiveProps=="function"&&l.UNSAFE_componentWillReceiveProps(h,y),l.state!==a&&Tp.enqueueReplaceState(l,l.state,null)}function iy(a,l,h,y){var x=a.stateNode;x.props=h,x.state=a.memoizedState,x.refs={},Bv(a);var k=l.contextType;typeof k=="object"&&k!==null?x.context=ii(k):(k=ws(l)?Tl:Wr.current,x.context=zc(a,k)),x.state=a.memoizedState,k=l.getDerivedStateFromProps,typeof k=="function"&&(sy(a,l,k,h),x.state=a.memoizedState),typeof l.getDerivedStateFromProps=="function"||typeof x.getSnapshotBeforeUpdate=="function"||typeof x.UNSAFE_componentWillMount!="function"&&typeof x.componentWillMount!="function"||(l=x.state,typeof x.componentWillMount=="function"&&x.componentWillMount(),typeof x.UNSAFE_componentWillMount=="function"&&x.UNSAFE_componentWillMount(),l!==x.state&&Tp.enqueueReplaceState(x,x.state,null),xp(a,h,x,y),x.state=a.memoizedState),typeof x.componentDidMount=="function"&&(a.flags|=4194308)}function Gc(a,l){try{var h="",y=l;do h+=ie(y),y=y.return;while(y);var x=h}catch(k){x=`
|
|
107
|
+
Error generating stack: `+k.message+`
|
|
108
|
+
`+k.stack}return{value:a,source:l,stack:x,digest:null}}function oy(a,l,h){return{value:a,source:null,stack:h??null,digest:l??null}}function ay(a,l){try{console.error(l.value)}catch(h){setTimeout(function(){throw h})}}var AD=typeof WeakMap=="function"?WeakMap:Map;function ME(a,l,h){h=Io(-1,h),h.tag=3,h.payload={element:null};var y=l.value;return h.callback=function(){$p||($p=!0,xy=y),ay(a,l)},h}function NE(a,l,h){h=Io(-1,h),h.tag=3;var y=a.type.getDerivedStateFromError;if(typeof y=="function"){var x=l.value;h.payload=function(){return y(x)},h.callback=function(){ay(a,l)}}var k=a.stateNode;return k!==null&&typeof k.componentDidCatch=="function"&&(h.callback=function(){ay(a,l),typeof y!="function"&&(Ca===null?Ca=new Set([this]):Ca.add(this));var I=l.stack;this.componentDidCatch(l.value,{componentStack:I!==null?I:""})}),h}function LE(a,l,h){var y=a.pingCache;if(y===null){y=a.pingCache=new AD;var x=new Set;y.set(l,x)}else x=y.get(l),x===void 0&&(x=new Set,y.set(l,x));x.has(h)||(x.add(h),a=HD.bind(null,a,l,h),l.then(a,a))}function $E(a){do{var l;if((l=a.tag===13)&&(l=a.memoizedState,l=l!==null?l.dehydrated!==null:!0),l)return a;a=a.return}while(a!==null);return null}function DE(a,l,h,y,x){return(a.mode&1)===0?(a===l?a.flags|=65536:(a.flags|=128,h.flags|=131072,h.flags&=-52805,h.tag===1&&(h.alternate===null?h.tag=17:(l=Io(-1,1),l.tag=2,Ea(h,l,1))),h.lanes|=1),a):(a.flags|=65536,a.lanes=x,a)}var TD=A.ReactCurrentOwner,bs=!1;function os(a,l,h,y){l.child=a===null?rE(l,null,h,y):Zc(l,a.child,h,y)}function FE(a,l,h,y,x){h=h.render;var k=l.ref;return Wc(l,x),y=Xv(a,l,h,y,k,x),h=Jv(),a!==null&&!bs?(l.updateQueue=a.updateQueue,l.flags&=-2053,a.lanes&=~x,Oo(a,l,x)):(In&&h&&Lv(l),l.flags|=1,os(a,l,y,x),l.child)}function jE(a,l,h,y,x){if(a===null){var k=h.type;return typeof k=="function"&&!Ty(k)&&k.defaultProps===void 0&&h.compare===null&&h.defaultProps===void 0?(l.tag=15,l.type=k,zE(a,l,k,y,x)):(a=Hp(h.type,null,y,l,l.mode,x),a.ref=l.ref,a.return=l,l.child=a)}if(k=a.child,(a.lanes&x)===0){var I=k.memoizedProps;if(h=h.compare,h=h!==null?h:Hd,h(I,y)&&a.ref===l.ref)return Oo(a,l,x)}return l.flags|=1,a=Ra(k,y),a.ref=l.ref,a.return=l,l.child=a}function zE(a,l,h,y,x){if(a!==null){var k=a.memoizedProps;if(Hd(k,y)&&a.ref===l.ref)if(bs=!1,l.pendingProps=y=k,(a.lanes&x)!==0)(a.flags&131072)!==0&&(bs=!0);else return l.lanes=a.lanes,Oo(a,l,x)}return ly(a,l,h,y,x)}function VE(a,l,h){var y=l.pendingProps,x=y.children,k=a!==null?a.memoizedState:null;if(y.mode==="hidden")if((l.mode&1)===0)l.memoizedState={baseLanes:0,cachePool:null,transitions:null},bn(Yc,Zs),Zs|=h;else{if((h&1073741824)===0)return a=k!==null?k.baseLanes|h:h,l.lanes=l.childLanes=1073741824,l.memoizedState={baseLanes:a,cachePool:null,transitions:null},l.updateQueue=null,bn(Yc,Zs),Zs|=a,null;l.memoizedState={baseLanes:0,cachePool:null,transitions:null},y=k!==null?k.baseLanes:h,bn(Yc,Zs),Zs|=y}else k!==null?(y=k.baseLanes|h,l.memoizedState=null):y=h,bn(Yc,Zs),Zs|=y;return os(a,l,x,h),l.child}function HE(a,l){var h=l.ref;(a===null&&h!==null||a!==null&&a.ref!==h)&&(l.flags|=512,l.flags|=2097152)}function ly(a,l,h,y,x){var k=ws(h)?Tl:Wr.current;return k=zc(l,k),Wc(l,x),h=Xv(a,l,h,y,k,x),y=Jv(),a!==null&&!bs?(l.updateQueue=a.updateQueue,l.flags&=-2053,a.lanes&=~x,Oo(a,l,x)):(In&&y&&Lv(l),l.flags|=1,os(a,l,h,x),l.child)}function UE(a,l,h,y,x){if(ws(h)){var k=!0;hp(l)}else k=!1;if(Wc(l,x),l.stateNode===null)Ip(a,l),IE(l,h,y),iy(l,h,y,x),y=!0;else if(a===null){var I=l.stateNode,z=l.memoizedProps;I.props=z;var K=I.context,ae=h.contextType;typeof ae=="object"&&ae!==null?ae=ii(ae):(ae=ws(h)?Tl:Wr.current,ae=zc(l,ae));var _e=h.getDerivedStateFromProps,we=typeof _e=="function"||typeof I.getSnapshotBeforeUpdate=="function";we||typeof I.UNSAFE_componentWillReceiveProps!="function"&&typeof I.componentWillReceiveProps!="function"||(z!==y||K!==ae)&&OE(l,I,y,ae),Sa=!1;var ye=l.memoizedState;I.state=ye,xp(l,y,I,x),K=l.memoizedState,z!==y||ye!==K||_s.current||Sa?(typeof _e=="function"&&(sy(l,h,_e,y),K=l.memoizedState),(z=Sa||RE(l,h,z,y,ye,K,ae))?(we||typeof I.UNSAFE_componentWillMount!="function"&&typeof I.componentWillMount!="function"||(typeof I.componentWillMount=="function"&&I.componentWillMount(),typeof I.UNSAFE_componentWillMount=="function"&&I.UNSAFE_componentWillMount()),typeof I.componentDidMount=="function"&&(l.flags|=4194308)):(typeof I.componentDidMount=="function"&&(l.flags|=4194308),l.memoizedProps=y,l.memoizedState=K),I.props=y,I.state=K,I.context=ae,y=z):(typeof I.componentDidMount=="function"&&(l.flags|=4194308),y=!1)}else{I=l.stateNode,iE(a,l),z=l.memoizedProps,ae=l.type===l.elementType?z:ki(l.type,z),I.props=ae,we=l.pendingProps,ye=I.context,K=h.contextType,typeof K=="object"&&K!==null?K=ii(K):(K=ws(h)?Tl:Wr.current,K=zc(l,K));var Fe=h.getDerivedStateFromProps;(_e=typeof Fe=="function"||typeof I.getSnapshotBeforeUpdate=="function")||typeof I.UNSAFE_componentWillReceiveProps!="function"&&typeof I.componentWillReceiveProps!="function"||(z!==we||ye!==K)&&OE(l,I,y,K),Sa=!1,ye=l.memoizedState,I.state=ye,xp(l,y,I,x);var Ke=l.memoizedState;z!==we||ye!==Ke||_s.current||Sa?(typeof Fe=="function"&&(sy(l,h,Fe,y),Ke=l.memoizedState),(ae=Sa||RE(l,h,ae,y,ye,Ke,K)||!1)?(_e||typeof I.UNSAFE_componentWillUpdate!="function"&&typeof I.componentWillUpdate!="function"||(typeof I.componentWillUpdate=="function"&&I.componentWillUpdate(y,Ke,K),typeof I.UNSAFE_componentWillUpdate=="function"&&I.UNSAFE_componentWillUpdate(y,Ke,K)),typeof I.componentDidUpdate=="function"&&(l.flags|=4),typeof I.getSnapshotBeforeUpdate=="function"&&(l.flags|=1024)):(typeof I.componentDidUpdate!="function"||z===a.memoizedProps&&ye===a.memoizedState||(l.flags|=4),typeof I.getSnapshotBeforeUpdate!="function"||z===a.memoizedProps&&ye===a.memoizedState||(l.flags|=1024),l.memoizedProps=y,l.memoizedState=Ke),I.props=y,I.state=Ke,I.context=K,y=ae):(typeof I.componentDidUpdate!="function"||z===a.memoizedProps&&ye===a.memoizedState||(l.flags|=4),typeof I.getSnapshotBeforeUpdate!="function"||z===a.memoizedProps&&ye===a.memoizedState||(l.flags|=1024),y=!1)}return cy(a,l,h,y,k,x)}function cy(a,l,h,y,x,k){HE(a,l);var I=(l.flags&128)!==0;if(!y&&!I)return x&&GS(l,h,!1),Oo(a,l,k);y=l.stateNode,TD.current=l;var z=I&&typeof h.getDerivedStateFromError!="function"?null:y.render();return l.flags|=1,a!==null&&I?(l.child=Zc(l,a.child,null,k),l.child=Zc(l,null,z,k)):os(a,l,z,k),l.memoizedState=y.state,x&&GS(l,h,!0),l.child}function ZE(a){var l=a.stateNode;l.pendingContext?WS(a,l.pendingContext,l.pendingContext!==l.context):l.context&&WS(a,l.context,!1),Wv(a,l.containerInfo)}function BE(a,l,h,y,x){return Uc(),jv(x),l.flags|=256,os(a,l,h,y),l.child}var uy={dehydrated:null,treeContext:null,retryLane:0};function dy(a){return{baseLanes:a,cachePool:null,transitions:null}}function WE(a,l,h){var y=l.pendingProps,x=Ln.current,k=!1,I=(l.flags&128)!==0,z;if((z=I)||(z=a!==null&&a.memoizedState===null?!1:(x&2)!==0),z?(k=!0,l.flags&=-129):(a===null||a.memoizedState!==null)&&(x|=1),bn(Ln,x&1),a===null)return Fv(l),a=l.memoizedState,a!==null&&(a=a.dehydrated,a!==null)?((l.mode&1)===0?l.lanes=1:a.data==="$!"?l.lanes=8:l.lanes=1073741824,null):(I=y.children,a=y.fallback,k?(y=l.mode,k=l.child,I={mode:"hidden",children:I},(y&1)===0&&k!==null?(k.childLanes=0,k.pendingProps=I):k=Up(I,y,0,null),a=jl(a,y,h,null),k.return=l,a.return=l,k.sibling=a,l.child=k,l.child.memoizedState=dy(h),l.memoizedState=uy,a):fy(l,I));if(x=a.memoizedState,x!==null&&(z=x.dehydrated,z!==null))return RD(a,l,I,y,z,x,h);if(k){k=y.fallback,I=l.mode,x=a.child,z=x.sibling;var K={mode:"hidden",children:y.children};return(I&1)===0&&l.child!==x?(y=l.child,y.childLanes=0,y.pendingProps=K,l.deletions=null):(y=Ra(x,K),y.subtreeFlags=x.subtreeFlags&14680064),z!==null?k=Ra(z,k):(k=jl(k,I,h,null),k.flags|=2),k.return=l,y.return=l,y.sibling=k,l.child=y,y=k,k=l.child,I=a.child.memoizedState,I=I===null?dy(h):{baseLanes:I.baseLanes|h,cachePool:null,transitions:I.transitions},k.memoizedState=I,k.childLanes=a.childLanes&~h,l.memoizedState=uy,y}return k=a.child,a=k.sibling,y=Ra(k,{mode:"visible",children:y.children}),(l.mode&1)===0&&(y.lanes=h),y.return=l,y.sibling=null,a!==null&&(h=l.deletions,h===null?(l.deletions=[a],l.flags|=16):h.push(a)),l.child=y,l.memoizedState=null,y}function fy(a,l){return l=Up({mode:"visible",children:l},a.mode,0,null),l.return=a,a.child=l}function Rp(a,l,h,y){return y!==null&&jv(y),Zc(l,a.child,null,h),a=fy(l,l.pendingProps.children),a.flags|=2,l.memoizedState=null,a}function RD(a,l,h,y,x,k,I){if(h)return l.flags&256?(l.flags&=-257,y=oy(Error(n(422))),Rp(a,l,I,y)):l.memoizedState!==null?(l.child=a.child,l.flags|=128,null):(k=y.fallback,x=l.mode,y=Up({mode:"visible",children:y.children},x,0,null),k=jl(k,x,I,null),k.flags|=2,y.return=l,k.return=l,y.sibling=k,l.child=y,(l.mode&1)!==0&&Zc(l,a.child,null,I),l.child.memoizedState=dy(I),l.memoizedState=uy,k);if((l.mode&1)===0)return Rp(a,l,I,null);if(x.data==="$!"){if(y=x.nextSibling&&x.nextSibling.dataset,y)var z=y.dgst;return y=z,k=Error(n(419)),y=oy(k,y,void 0),Rp(a,l,I,y)}if(z=(I&a.childLanes)!==0,bs||z){if(y=Sr,y!==null){switch(I&-I){case 4:x=2;break;case 16:x=8;break;case 64:case 128:case 256:case 512:case 1024:case 2048:case 4096:case 8192:case 16384:case 32768:case 65536:case 131072:case 262144:case 524288:case 1048576:case 2097152:case 4194304:case 8388608:case 16777216:case 33554432:case 67108864:x=32;break;case 536870912:x=268435456;break;default:x=0}x=(x&(y.suspendedLanes|I))!==0?0:x,x!==0&&x!==k.retryLane&&(k.retryLane=x,Ro(a,x),Ai(y,a,x,-1))}return Ay(),y=oy(Error(n(421))),Rp(a,l,I,y)}return x.data==="$?"?(l.flags|=128,l.child=a.child,l=UD.bind(null,a),x._reactRetry=l,null):(a=k.treeContext,Us=_a(x.nextSibling),Hs=l,In=!0,Ei=null,a!==null&&(ri[si++]=Ao,ri[si++]=To,ri[si++]=Rl,Ao=a.id,To=a.overflow,Rl=l),l=fy(l,y.children),l.flags|=4096,l)}function KE(a,l,h){a.lanes|=l;var y=a.alternate;y!==null&&(y.lanes|=l),Uv(a.return,l,h)}function hy(a,l,h,y,x){var k=a.memoizedState;k===null?a.memoizedState={isBackwards:l,rendering:null,renderingStartTime:0,last:y,tail:h,tailMode:x}:(k.isBackwards=l,k.rendering=null,k.renderingStartTime=0,k.last=y,k.tail=h,k.tailMode=x)}function GE(a,l,h){var y=l.pendingProps,x=y.revealOrder,k=y.tail;if(os(a,l,y.children,h),y=Ln.current,(y&2)!==0)y=y&1|2,l.flags|=128;else{if(a!==null&&(a.flags&128)!==0)e:for(a=l.child;a!==null;){if(a.tag===13)a.memoizedState!==null&&KE(a,h,l);else if(a.tag===19)KE(a,h,l);else if(a.child!==null){a.child.return=a,a=a.child;continue}if(a===l)break e;for(;a.sibling===null;){if(a.return===null||a.return===l)break e;a=a.return}a.sibling.return=a.return,a=a.sibling}y&=1}if(bn(Ln,y),(l.mode&1)===0)l.memoizedState=null;else switch(x){case"forwards":for(h=l.child,x=null;h!==null;)a=h.alternate,a!==null&&Sp(a)===null&&(x=h),h=h.sibling;h=x,h===null?(x=l.child,l.child=null):(x=h.sibling,h.sibling=null),hy(l,!1,x,h,k);break;case"backwards":for(h=null,x=l.child,l.child=null;x!==null;){if(a=x.alternate,a!==null&&Sp(a)===null){l.child=x;break}a=x.sibling,x.sibling=h,h=x,x=a}hy(l,!0,h,null,k);break;case"together":hy(l,!1,null,null,void 0);break;default:l.memoizedState=null}return l.child}function Ip(a,l){(l.mode&1)===0&&a!==null&&(a.alternate=null,l.alternate=null,l.flags|=2)}function Oo(a,l,h){if(a!==null&&(l.dependencies=a.dependencies),Ll|=l.lanes,(h&l.childLanes)===0)return null;if(a!==null&&l.child!==a.child)throw Error(n(153));if(l.child!==null){for(a=l.child,h=Ra(a,a.pendingProps),l.child=h,h.return=l;a.sibling!==null;)a=a.sibling,h=h.sibling=Ra(a,a.pendingProps),h.return=l;h.sibling=null}return l.child}function ID(a,l,h){switch(l.tag){case 3:ZE(l),Uc();break;case 5:lE(l);break;case 1:ws(l.type)&&hp(l);break;case 4:Wv(l,l.stateNode.containerInfo);break;case 10:var y=l.type._context,x=l.memoizedProps.value;bn(_p,y._currentValue),y._currentValue=x;break;case 13:if(y=l.memoizedState,y!==null)return y.dehydrated!==null?(bn(Ln,Ln.current&1),l.flags|=128,null):(h&l.child.childLanes)!==0?WE(a,l,h):(bn(Ln,Ln.current&1),a=Oo(a,l,h),a!==null?a.sibling:null);bn(Ln,Ln.current&1);break;case 19:if(y=(h&l.childLanes)!==0,(a.flags&128)!==0){if(y)return GE(a,l,h);l.flags|=128}if(x=l.memoizedState,x!==null&&(x.rendering=null,x.tail=null,x.lastEffect=null),bn(Ln,Ln.current),y)break;return null;case 22:case 23:return l.lanes=0,VE(a,l,h)}return Oo(a,l,h)}var qE,py,YE,QE;qE=function(a,l){for(var h=l.child;h!==null;){if(h.tag===5||h.tag===6)a.appendChild(h.stateNode);else if(h.tag!==4&&h.child!==null){h.child.return=h,h=h.child;continue}if(h===l)break;for(;h.sibling===null;){if(h.return===null||h.return===l)return;h=h.return}h.sibling.return=h.return,h=h.sibling}},py=function(){},YE=function(a,l,h,y){var x=a.memoizedProps;if(x!==y){a=l.stateNode,Ml(Yi.current);var k=null;switch(h){case"input":x=dn(a,x),y=dn(a,y),k=[];break;case"select":x=B({},x,{value:void 0}),y=B({},y,{value:void 0}),k=[];break;case"textarea":x=Te(a,x),y=Te(a,y),k=[];break;default:typeof x.onClick!="function"&&typeof y.onClick=="function"&&(a.onclick=up)}fn(h,y);var I;h=null;for(ae in x)if(!y.hasOwnProperty(ae)&&x.hasOwnProperty(ae)&&x[ae]!=null)if(ae==="style"){var z=x[ae];for(I in z)z.hasOwnProperty(I)&&(h||(h={}),h[I]="")}else ae!=="dangerouslySetInnerHTML"&&ae!=="children"&&ae!=="suppressContentEditableWarning"&&ae!=="suppressHydrationWarning"&&ae!=="autoFocus"&&(s.hasOwnProperty(ae)?k||(k=[]):(k=k||[]).push(ae,null));for(ae in y){var K=y[ae];if(z=x!=null?x[ae]:void 0,y.hasOwnProperty(ae)&&K!==z&&(K!=null||z!=null))if(ae==="style")if(z){for(I in z)!z.hasOwnProperty(I)||K&&K.hasOwnProperty(I)||(h||(h={}),h[I]="");for(I in K)K.hasOwnProperty(I)&&z[I]!==K[I]&&(h||(h={}),h[I]=K[I])}else h||(k||(k=[]),k.push(ae,h)),h=K;else ae==="dangerouslySetInnerHTML"?(K=K?K.__html:void 0,z=z?z.__html:void 0,K!=null&&z!==K&&(k=k||[]).push(ae,K)):ae==="children"?typeof K!="string"&&typeof K!="number"||(k=k||[]).push(ae,""+K):ae!=="suppressContentEditableWarning"&&ae!=="suppressHydrationWarning"&&(s.hasOwnProperty(ae)?(K!=null&&ae==="onScroll"&&Sn("scroll",a),k||z===K||(k=[])):(k=k||[]).push(ae,K))}h&&(k=k||[]).push("style",h);var ae=k;(l.updateQueue=ae)&&(l.flags|=4)}},QE=function(a,l,h,y){h!==y&&(l.flags|=4)};function rf(a,l){if(!In)switch(a.tailMode){case"hidden":l=a.tail;for(var h=null;l!==null;)l.alternate!==null&&(h=l),l=l.sibling;h===null?a.tail=null:h.sibling=null;break;case"collapsed":h=a.tail;for(var y=null;h!==null;)h.alternate!==null&&(y=h),h=h.sibling;y===null?l||a.tail===null?a.tail=null:a.tail.sibling=null:y.sibling=null}}function Gr(a){var l=a.alternate!==null&&a.alternate.child===a.child,h=0,y=0;if(l)for(var x=a.child;x!==null;)h|=x.lanes|x.childLanes,y|=x.subtreeFlags&14680064,y|=x.flags&14680064,x.return=a,x=x.sibling;else for(x=a.child;x!==null;)h|=x.lanes|x.childLanes,y|=x.subtreeFlags,y|=x.flags,x.return=a,x=x.sibling;return a.subtreeFlags|=y,a.childLanes=h,l}function OD(a,l,h){var y=l.pendingProps;switch($v(l),l.tag){case 2:case 16:case 15:case 0:case 11:case 7:case 8:case 12:case 9:case 14:return Gr(l),null;case 1:return ws(l.type)&&fp(),Gr(l),null;case 3:return y=l.stateNode,Kc(),En(_s),En(Wr),qv(),y.pendingContext&&(y.context=y.pendingContext,y.pendingContext=null),(a===null||a.child===null)&&(vp(l)?l.flags|=4:a===null||a.memoizedState.isDehydrated&&(l.flags&256)===0||(l.flags|=1024,Ei!==null&&(ky(Ei),Ei=null))),py(a,l),Gr(l),null;case 5:Kv(l);var x=Ml(Xd.current);if(h=l.type,a!==null&&l.stateNode!=null)YE(a,l,h,y,x),a.ref!==l.ref&&(l.flags|=512,l.flags|=2097152);else{if(!y){if(l.stateNode===null)throw Error(n(166));return Gr(l),null}if(a=Ml(Yi.current),vp(l)){y=l.stateNode,h=l.type;var k=l.memoizedProps;switch(y[qi]=l,y[Kd]=k,a=(l.mode&1)!==0,h){case"dialog":Sn("cancel",y),Sn("close",y);break;case"iframe":case"object":case"embed":Sn("load",y);break;case"video":case"audio":for(x=0;x<Zd.length;x++)Sn(Zd[x],y);break;case"source":Sn("error",y);break;case"img":case"image":case"link":Sn("error",y),Sn("load",y);break;case"details":Sn("toggle",y);break;case"input":an(y,k),Sn("invalid",y);break;case"select":y._wrapperState={wasMultiple:!!k.multiple},Sn("invalid",y);break;case"textarea":xt(y,k),Sn("invalid",y)}fn(h,k),x=null;for(var I in k)if(k.hasOwnProperty(I)){var z=k[I];I==="children"?typeof z=="string"?y.textContent!==z&&(k.suppressHydrationWarning!==!0&&cp(y.textContent,z,a),x=["children",z]):typeof z=="number"&&y.textContent!==""+z&&(k.suppressHydrationWarning!==!0&&cp(y.textContent,z,a),x=["children",""+z]):s.hasOwnProperty(I)&&z!=null&&I==="onScroll"&&Sn("scroll",y)}switch(h){case"input":Re(y),gn(y,k,!0);break;case"textarea":Re(y),$t(y);break;case"select":case"option":break;default:typeof k.onClick=="function"&&(y.onclick=up)}y=x,l.updateQueue=y,y!==null&&(l.flags|=4)}else{I=x.nodeType===9?x:x.ownerDocument,a==="http://www.w3.org/1999/xhtml"&&(a=ft(h)),a==="http://www.w3.org/1999/xhtml"?h==="script"?(a=I.createElement("div"),a.innerHTML="<script><\/script>",a=a.removeChild(a.firstChild)):typeof y.is=="string"?a=I.createElement(h,{is:y.is}):(a=I.createElement(h),h==="select"&&(I=a,y.multiple?I.multiple=!0:y.size&&(I.size=y.size))):a=I.createElementNS(a,h),a[qi]=l,a[Kd]=y,qE(a,l,!1,!1),l.stateNode=a;e:{switch(I=Ur(h,y),h){case"dialog":Sn("cancel",a),Sn("close",a),x=y;break;case"iframe":case"object":case"embed":Sn("load",a),x=y;break;case"video":case"audio":for(x=0;x<Zd.length;x++)Sn(Zd[x],a);x=y;break;case"source":Sn("error",a),x=y;break;case"img":case"image":case"link":Sn("error",a),Sn("load",a),x=y;break;case"details":Sn("toggle",a),x=y;break;case"input":an(a,y),x=dn(a,y),Sn("invalid",a);break;case"option":x=y;break;case"select":a._wrapperState={wasMultiple:!!y.multiple},x=B({},y,{value:void 0}),Sn("invalid",a);break;case"textarea":xt(a,y),x=Te(a,y),Sn("invalid",a);break;default:x=y}fn(h,x),z=x;for(k in z)if(z.hasOwnProperty(k)){var K=z[k];k==="style"?Hr(a,K):k==="dangerouslySetInnerHTML"?(K=K?K.__html:void 0,K!=null&&Js(a,K)):k==="children"?typeof K=="string"?(h!=="textarea"||K!=="")&&_n(a,K):typeof K=="number"&&_n(a,""+K):k!=="suppressContentEditableWarning"&&k!=="suppressHydrationWarning"&&k!=="autoFocus"&&(s.hasOwnProperty(k)?K!=null&&k==="onScroll"&&Sn("scroll",a):K!=null&&C(a,k,K,I))}switch(h){case"input":Re(a),gn(a,y,!1);break;case"textarea":Re(a),$t(a);break;case"option":y.value!=null&&a.setAttribute("value",""+ge(y.value));break;case"select":a.multiple=!!y.multiple,k=y.value,k!=null?Xe(a,!!y.multiple,k,!1):y.defaultValue!=null&&Xe(a,!!y.multiple,y.defaultValue,!0);break;default:typeof x.onClick=="function"&&(a.onclick=up)}switch(h){case"button":case"input":case"select":case"textarea":y=!!y.autoFocus;break e;case"img":y=!0;break e;default:y=!1}}y&&(l.flags|=4)}l.ref!==null&&(l.flags|=512,l.flags|=2097152)}return Gr(l),null;case 6:if(a&&l.stateNode!=null)QE(a,l,a.memoizedProps,y);else{if(typeof y!="string"&&l.stateNode===null)throw Error(n(166));if(h=Ml(Xd.current),Ml(Yi.current),vp(l)){if(y=l.stateNode,h=l.memoizedProps,y[qi]=l,(k=y.nodeValue!==h)&&(a=Hs,a!==null))switch(a.tag){case 3:cp(y.nodeValue,h,(a.mode&1)!==0);break;case 5:a.memoizedProps.suppressHydrationWarning!==!0&&cp(y.nodeValue,h,(a.mode&1)!==0)}k&&(l.flags|=4)}else y=(h.nodeType===9?h:h.ownerDocument).createTextNode(y),y[qi]=l,l.stateNode=y}return Gr(l),null;case 13:if(En(Ln),y=l.memoizedState,a===null||a.memoizedState!==null&&a.memoizedState.dehydrated!==null){if(In&&Us!==null&&(l.mode&1)!==0&&(l.flags&128)===0)eE(),Uc(),l.flags|=98560,k=!1;else if(k=vp(l),y!==null&&y.dehydrated!==null){if(a===null){if(!k)throw Error(n(318));if(k=l.memoizedState,k=k!==null?k.dehydrated:null,!k)throw Error(n(317));k[qi]=l}else Uc(),(l.flags&128)===0&&(l.memoizedState=null),l.flags|=4;Gr(l),k=!1}else Ei!==null&&(ky(Ei),Ei=null),k=!0;if(!k)return l.flags&65536?l:null}return(l.flags&128)!==0?(l.lanes=h,l):(y=y!==null,y!==(a!==null&&a.memoizedState!==null)&&y&&(l.child.flags|=8192,(l.mode&1)!==0&&(a===null||(Ln.current&1)!==0?fr===0&&(fr=3):Ay())),l.updateQueue!==null&&(l.flags|=4),Gr(l),null);case 4:return Kc(),py(a,l),a===null&&Bd(l.stateNode.containerInfo),Gr(l),null;case 10:return Hv(l.type._context),Gr(l),null;case 17:return ws(l.type)&&fp(),Gr(l),null;case 19:if(En(Ln),k=l.memoizedState,k===null)return Gr(l),null;if(y=(l.flags&128)!==0,I=k.rendering,I===null)if(y)rf(k,!1);else{if(fr!==0||a!==null&&(a.flags&128)!==0)for(a=l.child;a!==null;){if(I=Sp(a),I!==null){for(l.flags|=128,rf(k,!1),y=I.updateQueue,y!==null&&(l.updateQueue=y,l.flags|=4),l.subtreeFlags=0,y=h,h=l.child;h!==null;)k=h,a=y,k.flags&=14680066,I=k.alternate,I===null?(k.childLanes=0,k.lanes=a,k.child=null,k.subtreeFlags=0,k.memoizedProps=null,k.memoizedState=null,k.updateQueue=null,k.dependencies=null,k.stateNode=null):(k.childLanes=I.childLanes,k.lanes=I.lanes,k.child=I.child,k.subtreeFlags=0,k.deletions=null,k.memoizedProps=I.memoizedProps,k.memoizedState=I.memoizedState,k.updateQueue=I.updateQueue,k.type=I.type,a=I.dependencies,k.dependencies=a===null?null:{lanes:a.lanes,firstContext:a.firstContext}),h=h.sibling;return bn(Ln,Ln.current&1|2),l.child}a=a.sibling}k.tail!==null&&ln()>Qc&&(l.flags|=128,y=!0,rf(k,!1),l.lanes=4194304)}else{if(!y)if(a=Sp(I),a!==null){if(l.flags|=128,y=!0,h=a.updateQueue,h!==null&&(l.updateQueue=h,l.flags|=4),rf(k,!0),k.tail===null&&k.tailMode==="hidden"&&!I.alternate&&!In)return Gr(l),null}else 2*ln()-k.renderingStartTime>Qc&&h!==1073741824&&(l.flags|=128,y=!0,rf(k,!1),l.lanes=4194304);k.isBackwards?(I.sibling=l.child,l.child=I):(h=k.last,h!==null?h.sibling=I:l.child=I,k.last=I)}return k.tail!==null?(l=k.tail,k.rendering=l,k.tail=l.sibling,k.renderingStartTime=ln(),l.sibling=null,h=Ln.current,bn(Ln,y?h&1|2:h&1),l):(Gr(l),null);case 22:case 23:return Py(),y=l.memoizedState!==null,a!==null&&a.memoizedState!==null!==y&&(l.flags|=8192),y&&(l.mode&1)!==0?(Zs&1073741824)!==0&&(Gr(l),l.subtreeFlags&6&&(l.flags|=8192)):Gr(l),null;case 24:return null;case 25:return null}throw Error(n(156,l.tag))}function MD(a,l){switch($v(l),l.tag){case 1:return ws(l.type)&&fp(),a=l.flags,a&65536?(l.flags=a&-65537|128,l):null;case 3:return Kc(),En(_s),En(Wr),qv(),a=l.flags,(a&65536)!==0&&(a&128)===0?(l.flags=a&-65537|128,l):null;case 5:return Kv(l),null;case 13:if(En(Ln),a=l.memoizedState,a!==null&&a.dehydrated!==null){if(l.alternate===null)throw Error(n(340));Uc()}return a=l.flags,a&65536?(l.flags=a&-65537|128,l):null;case 19:return En(Ln),null;case 4:return Kc(),null;case 10:return Hv(l.type._context),null;case 22:case 23:return Py(),null;case 24:return null;default:return null}}var Op=!1,qr=!1,ND=typeof WeakSet=="function"?WeakSet:Set,Ze=null;function qc(a,l){var h=a.ref;if(h!==null)if(typeof h=="function")try{h(null)}catch(y){Wn(a,l,y)}else h.current=null}function my(a,l,h){try{h()}catch(y){Wn(a,l,y)}}var XE=!1;function LD(a,l){if(Pv=Gi,a=RS(),_v(a)){if("selectionStart"in a)var h={start:a.selectionStart,end:a.selectionEnd};else e:{h=(h=a.ownerDocument)&&h.defaultView||window;var y=h.getSelection&&h.getSelection();if(y&&y.rangeCount!==0){h=y.anchorNode;var x=y.anchorOffset,k=y.focusNode;y=y.focusOffset;try{h.nodeType,k.nodeType}catch{h=null;break e}var I=0,z=-1,K=-1,ae=0,_e=0,we=a,ye=null;t:for(;;){for(var Fe;we!==h||x!==0&&we.nodeType!==3||(z=I+x),we!==k||y!==0&&we.nodeType!==3||(K=I+y),we.nodeType===3&&(I+=we.nodeValue.length),(Fe=we.firstChild)!==null;)ye=we,we=Fe;for(;;){if(we===a)break t;if(ye===h&&++ae===x&&(z=I),ye===k&&++_e===y&&(K=I),(Fe=we.nextSibling)!==null)break;we=ye,ye=we.parentNode}we=Fe}h=z===-1||K===-1?null:{start:z,end:K}}else h=null}h=h||{start:0,end:0}}else h=null;for(Av={focusedElem:a,selectionRange:h},Gi=!1,Ze=l;Ze!==null;)if(l=Ze,a=l.child,(l.subtreeFlags&1028)!==0&&a!==null)a.return=l,Ze=a;else for(;Ze!==null;){l=Ze;try{var Ke=l.alternate;if((l.flags&1024)!==0)switch(l.tag){case 0:case 11:case 15:break;case 1:if(Ke!==null){var qe=Ke.memoizedProps,Yn=Ke.memoizedState,ne=l.stateNode,Q=ne.getSnapshotBeforeUpdate(l.elementType===l.type?qe:ki(l.type,qe),Yn);ne.__reactInternalSnapshotBeforeUpdate=Q}break;case 3:var se=l.stateNode.containerInfo;se.nodeType===1?se.textContent="":se.nodeType===9&&se.documentElement&&se.removeChild(se.documentElement);break;case 5:case 6:case 4:case 17:break;default:throw Error(n(163))}}catch(Ce){Wn(l,l.return,Ce)}if(a=l.sibling,a!==null){a.return=l.return,Ze=a;break}Ze=l.return}return Ke=XE,XE=!1,Ke}function sf(a,l,h){var y=l.updateQueue;if(y=y!==null?y.lastEffect:null,y!==null){var x=y=y.next;do{if((x.tag&a)===a){var k=x.destroy;x.destroy=void 0,k!==void 0&&my(l,h,k)}x=x.next}while(x!==y)}}function Mp(a,l){if(l=l.updateQueue,l=l!==null?l.lastEffect:null,l!==null){var h=l=l.next;do{if((h.tag&a)===a){var y=h.create;h.destroy=y()}h=h.next}while(h!==l)}}function gy(a){var l=a.ref;if(l!==null){var h=a.stateNode;switch(a.tag){case 5:a=h;break;default:a=h}typeof l=="function"?l(a):l.current=a}}function JE(a){var l=a.alternate;l!==null&&(a.alternate=null,JE(l)),a.child=null,a.deletions=null,a.sibling=null,a.tag===5&&(l=a.stateNode,l!==null&&(delete l[qi],delete l[Kd],delete l[Ov],delete l[vD],delete l[yD])),a.stateNode=null,a.return=null,a.dependencies=null,a.memoizedProps=null,a.memoizedState=null,a.pendingProps=null,a.stateNode=null,a.updateQueue=null}function ek(a){return a.tag===5||a.tag===3||a.tag===4}function tk(a){e:for(;;){for(;a.sibling===null;){if(a.return===null||ek(a.return))return null;a=a.return}for(a.sibling.return=a.return,a=a.sibling;a.tag!==5&&a.tag!==6&&a.tag!==18;){if(a.flags&2||a.child===null||a.tag===4)continue e;a.child.return=a,a=a.child}if(!(a.flags&2))return a.stateNode}}function vy(a,l,h){var y=a.tag;if(y===5||y===6)a=a.stateNode,l?h.nodeType===8?h.parentNode.insertBefore(a,l):h.insertBefore(a,l):(h.nodeType===8?(l=h.parentNode,l.insertBefore(a,h)):(l=h,l.appendChild(a)),h=h._reactRootContainer,h!=null||l.onclick!==null||(l.onclick=up));else if(y!==4&&(a=a.child,a!==null))for(vy(a,l,h),a=a.sibling;a!==null;)vy(a,l,h),a=a.sibling}function yy(a,l,h){var y=a.tag;if(y===5||y===6)a=a.stateNode,l?h.insertBefore(a,l):h.appendChild(a);else if(y!==4&&(a=a.child,a!==null))for(yy(a,l,h),a=a.sibling;a!==null;)yy(a,l,h),a=a.sibling}var Nr=null,Ci=!1;function ka(a,l,h){for(h=h.child;h!==null;)nk(a,l,h),h=h.sibling}function nk(a,l,h){if(Br&&typeof Br.onCommitFiberUnmount=="function")try{Br.onCommitFiberUnmount(So,h)}catch{}switch(h.tag){case 5:qr||qc(h,l);case 6:var y=Nr,x=Ci;Nr=null,ka(a,l,h),Nr=y,Ci=x,Nr!==null&&(Ci?(a=Nr,h=h.stateNode,a.nodeType===8?a.parentNode.removeChild(h):a.removeChild(h)):Nr.removeChild(h.stateNode));break;case 18:Nr!==null&&(Ci?(a=Nr,h=h.stateNode,a.nodeType===8?Iv(a.parentNode,h):a.nodeType===1&&Iv(a,h),Pt(a)):Iv(Nr,h.stateNode));break;case 4:y=Nr,x=Ci,Nr=h.stateNode.containerInfo,Ci=!0,ka(a,l,h),Nr=y,Ci=x;break;case 0:case 11:case 14:case 15:if(!qr&&(y=h.updateQueue,y!==null&&(y=y.lastEffect,y!==null))){x=y=y.next;do{var k=x,I=k.destroy;k=k.tag,I!==void 0&&((k&2)!==0||(k&4)!==0)&&my(h,l,I),x=x.next}while(x!==y)}ka(a,l,h);break;case 1:if(!qr&&(qc(h,l),y=h.stateNode,typeof y.componentWillUnmount=="function"))try{y.props=h.memoizedProps,y.state=h.memoizedState,y.componentWillUnmount()}catch(z){Wn(h,l,z)}ka(a,l,h);break;case 21:ka(a,l,h);break;case 22:h.mode&1?(qr=(y=qr)||h.memoizedState!==null,ka(a,l,h),qr=y):ka(a,l,h);break;default:ka(a,l,h)}}function rk(a){var l=a.updateQueue;if(l!==null){a.updateQueue=null;var h=a.stateNode;h===null&&(h=a.stateNode=new ND),l.forEach(function(y){var x=ZD.bind(null,a,y);h.has(y)||(h.add(y),y.then(x,x))})}}function Pi(a,l){var h=l.deletions;if(h!==null)for(var y=0;y<h.length;y++){var x=h[y];try{var k=a,I=l,z=I;e:for(;z!==null;){switch(z.tag){case 5:Nr=z.stateNode,Ci=!1;break e;case 3:Nr=z.stateNode.containerInfo,Ci=!0;break e;case 4:Nr=z.stateNode.containerInfo,Ci=!0;break e}z=z.return}if(Nr===null)throw Error(n(160));nk(k,I,x),Nr=null,Ci=!1;var K=x.alternate;K!==null&&(K.return=null),x.return=null}catch(ae){Wn(x,l,ae)}}if(l.subtreeFlags&12854)for(l=l.child;l!==null;)sk(l,a),l=l.sibling}function sk(a,l){var h=a.alternate,y=a.flags;switch(a.tag){case 0:case 11:case 14:case 15:if(Pi(l,a),Xi(a),y&4){try{sf(3,a,a.return),Mp(3,a)}catch(qe){Wn(a,a.return,qe)}try{sf(5,a,a.return)}catch(qe){Wn(a,a.return,qe)}}break;case 1:Pi(l,a),Xi(a),y&512&&h!==null&&qc(h,h.return);break;case 5:if(Pi(l,a),Xi(a),y&512&&h!==null&&qc(h,h.return),a.flags&32){var x=a.stateNode;try{_n(x,"")}catch(qe){Wn(a,a.return,qe)}}if(y&4&&(x=a.stateNode,x!=null)){var k=a.memoizedProps,I=h!==null?h.memoizedProps:k,z=a.type,K=a.updateQueue;if(a.updateQueue=null,K!==null)try{z==="input"&&k.type==="radio"&&k.name!=null&&kt(x,k),Ur(z,I);var ae=Ur(z,k);for(I=0;I<K.length;I+=2){var _e=K[I],we=K[I+1];_e==="style"?Hr(x,we):_e==="dangerouslySetInnerHTML"?Js(x,we):_e==="children"?_n(x,we):C(x,_e,we,ae)}switch(z){case"input":Gt(x,k);break;case"textarea":xe(x,k);break;case"select":var ye=x._wrapperState.wasMultiple;x._wrapperState.wasMultiple=!!k.multiple;var Fe=k.value;Fe!=null?Xe(x,!!k.multiple,Fe,!1):ye!==!!k.multiple&&(k.defaultValue!=null?Xe(x,!!k.multiple,k.defaultValue,!0):Xe(x,!!k.multiple,k.multiple?[]:"",!1))}x[Kd]=k}catch(qe){Wn(a,a.return,qe)}}break;case 6:if(Pi(l,a),Xi(a),y&4){if(a.stateNode===null)throw Error(n(162));x=a.stateNode,k=a.memoizedProps;try{x.nodeValue=k}catch(qe){Wn(a,a.return,qe)}}break;case 3:if(Pi(l,a),Xi(a),y&4&&h!==null&&h.memoizedState.isDehydrated)try{Pt(l.containerInfo)}catch(qe){Wn(a,a.return,qe)}break;case 4:Pi(l,a),Xi(a);break;case 13:Pi(l,a),Xi(a),x=a.child,x.flags&8192&&(k=x.memoizedState!==null,x.stateNode.isHidden=k,!k||x.alternate!==null&&x.alternate.memoizedState!==null||(by=ln())),y&4&&rk(a);break;case 22:if(_e=h!==null&&h.memoizedState!==null,a.mode&1?(qr=(ae=qr)||_e,Pi(l,a),qr=ae):Pi(l,a),Xi(a),y&8192){if(ae=a.memoizedState!==null,(a.stateNode.isHidden=ae)&&!_e&&(a.mode&1)!==0)for(Ze=a,_e=a.child;_e!==null;){for(we=Ze=_e;Ze!==null;){switch(ye=Ze,Fe=ye.child,ye.tag){case 0:case 11:case 14:case 15:sf(4,ye,ye.return);break;case 1:qc(ye,ye.return);var Ke=ye.stateNode;if(typeof Ke.componentWillUnmount=="function"){y=ye,h=ye.return;try{l=y,Ke.props=l.memoizedProps,Ke.state=l.memoizedState,Ke.componentWillUnmount()}catch(qe){Wn(y,h,qe)}}break;case 5:qc(ye,ye.return);break;case 22:if(ye.memoizedState!==null){ak(we);continue}}Fe!==null?(Fe.return=ye,Ze=Fe):ak(we)}_e=_e.sibling}e:for(_e=null,we=a;;){if(we.tag===5){if(_e===null){_e=we;try{x=we.stateNode,ae?(k=x.style,typeof k.setProperty=="function"?k.setProperty("display","none","important"):k.display="none"):(z=we.stateNode,K=we.memoizedProps.style,I=K!=null&&K.hasOwnProperty("display")?K.display:null,z.style.display=rs("display",I))}catch(qe){Wn(a,a.return,qe)}}}else if(we.tag===6){if(_e===null)try{we.stateNode.nodeValue=ae?"":we.memoizedProps}catch(qe){Wn(a,a.return,qe)}}else if((we.tag!==22&&we.tag!==23||we.memoizedState===null||we===a)&&we.child!==null){we.child.return=we,we=we.child;continue}if(we===a)break e;for(;we.sibling===null;){if(we.return===null||we.return===a)break e;_e===we&&(_e=null),we=we.return}_e===we&&(_e=null),we.sibling.return=we.return,we=we.sibling}}break;case 19:Pi(l,a),Xi(a),y&4&&rk(a);break;case 21:break;default:Pi(l,a),Xi(a)}}function Xi(a){var l=a.flags;if(l&2){try{e:{for(var h=a.return;h!==null;){if(ek(h)){var y=h;break e}h=h.return}throw Error(n(160))}switch(y.tag){case 5:var x=y.stateNode;y.flags&32&&(_n(x,""),y.flags&=-33);var k=tk(a);yy(a,k,x);break;case 3:case 4:var I=y.stateNode.containerInfo,z=tk(a);vy(a,z,I);break;default:throw Error(n(161))}}catch(K){Wn(a,a.return,K)}a.flags&=-3}l&4096&&(a.flags&=-4097)}function $D(a,l,h){Ze=a,ik(a)}function ik(a,l,h){for(var y=(a.mode&1)!==0;Ze!==null;){var x=Ze,k=x.child;if(x.tag===22&&y){var I=x.memoizedState!==null||Op;if(!I){var z=x.alternate,K=z!==null&&z.memoizedState!==null||qr;z=Op;var ae=qr;if(Op=I,(qr=K)&&!ae)for(Ze=x;Ze!==null;)I=Ze,K=I.child,I.tag===22&&I.memoizedState!==null?lk(x):K!==null?(K.return=I,Ze=K):lk(x);for(;k!==null;)Ze=k,ik(k),k=k.sibling;Ze=x,Op=z,qr=ae}ok(a)}else(x.subtreeFlags&8772)!==0&&k!==null?(k.return=x,Ze=k):ok(a)}}function ok(a){for(;Ze!==null;){var l=Ze;if((l.flags&8772)!==0){var h=l.alternate;try{if((l.flags&8772)!==0)switch(l.tag){case 0:case 11:case 15:qr||Mp(5,l);break;case 1:var y=l.stateNode;if(l.flags&4&&!qr)if(h===null)y.componentDidMount();else{var x=l.elementType===l.type?h.memoizedProps:ki(l.type,h.memoizedProps);y.componentDidUpdate(x,h.memoizedState,y.__reactInternalSnapshotBeforeUpdate)}var k=l.updateQueue;k!==null&&aE(l,k,y);break;case 3:var I=l.updateQueue;if(I!==null){if(h=null,l.child!==null)switch(l.child.tag){case 5:h=l.child.stateNode;break;case 1:h=l.child.stateNode}aE(l,I,h)}break;case 5:var z=l.stateNode;if(h===null&&l.flags&4){h=z;var K=l.memoizedProps;switch(l.type){case"button":case"input":case"select":case"textarea":K.autoFocus&&h.focus();break;case"img":K.src&&(h.src=K.src)}}break;case 6:break;case 4:break;case 12:break;case 13:if(l.memoizedState===null){var ae=l.alternate;if(ae!==null){var _e=ae.memoizedState;if(_e!==null){var we=_e.dehydrated;we!==null&&Pt(we)}}}break;case 19:case 17:case 21:case 22:case 23:case 25:break;default:throw Error(n(163))}qr||l.flags&512&&gy(l)}catch(ye){Wn(l,l.return,ye)}}if(l===a){Ze=null;break}if(h=l.sibling,h!==null){h.return=l.return,Ze=h;break}Ze=l.return}}function ak(a){for(;Ze!==null;){var l=Ze;if(l===a){Ze=null;break}var h=l.sibling;if(h!==null){h.return=l.return,Ze=h;break}Ze=l.return}}function lk(a){for(;Ze!==null;){var l=Ze;try{switch(l.tag){case 0:case 11:case 15:var h=l.return;try{Mp(4,l)}catch(K){Wn(l,h,K)}break;case 1:var y=l.stateNode;if(typeof y.componentDidMount=="function"){var x=l.return;try{y.componentDidMount()}catch(K){Wn(l,x,K)}}var k=l.return;try{gy(l)}catch(K){Wn(l,k,K)}break;case 5:var I=l.return;try{gy(l)}catch(K){Wn(l,I,K)}}}catch(K){Wn(l,l.return,K)}if(l===a){Ze=null;break}var z=l.sibling;if(z!==null){z.return=l.return,Ze=z;break}Ze=l.return}}var DD=Math.ceil,Np=A.ReactCurrentDispatcher,_y=A.ReactCurrentOwner,ai=A.ReactCurrentBatchConfig,Wt=0,Sr=null,tr=null,Lr=0,Zs=0,Yc=wa(0),fr=0,of=null,Ll=0,Lp=0,wy=0,af=null,xs=null,by=0,Qc=1/0,Mo=null,$p=!1,xy=null,Ca=null,Dp=!1,Pa=null,Fp=0,lf=0,Sy=null,jp=-1,zp=0;function as(){return(Wt&6)!==0?ln():jp!==-1?jp:jp=ln()}function Aa(a){return(a.mode&1)===0?1:(Wt&2)!==0&&Lr!==0?Lr&-Lr:wD.transition!==null?(zp===0&&(zp=Ct()),zp):(a=it,a!==0||(a=window.event,a=a===void 0?16:uS(a.type)),a)}function Ai(a,l,h,y){if(50<lf)throw lf=0,Sy=null,Error(n(185));Jt(a,h,y),((Wt&2)===0||a!==Sr)&&(a===Sr&&((Wt&2)===0&&(Lp|=h),fr===4&&Ta(a,Lr)),Ss(a,y),h===1&&Wt===0&&(l.mode&1)===0&&(Qc=ln()+500,pp&&xa()))}function Ss(a,l){var h=a.callbackNode;Ue(a,l);var y=ve(a,a===Sr?Lr:0);if(y===0)h!==null&&xl(h),a.callbackNode=null,a.callbackPriority=0;else if(l=y&-y,a.callbackPriority!==l){if(h!=null&&xl(h),l===1)a.tag===0?_D(uk.bind(null,a)):qS(uk.bind(null,a)),mD(function(){(Wt&6)===0&&xa()}),h=null;else{switch(Or(y)){case 1:h=Fs;break;case 4:h=Wi;break;case 16:h=Ir;break;case 536870912:h=El;break;default:h=Ir}h=yk(h,ck.bind(null,a))}a.callbackPriority=l,a.callbackNode=h}}function ck(a,l){if(jp=-1,zp=0,(Wt&6)!==0)throw Error(n(327));var h=a.callbackNode;if(Xc()&&a.callbackNode!==h)return null;var y=ve(a,a===Sr?Lr:0);if(y===0)return null;if((y&30)!==0||(y&a.expiredLanes)!==0||l)l=Vp(a,y);else{l=y;var x=Wt;Wt|=2;var k=fk();(Sr!==a||Lr!==l)&&(Mo=null,Qc=ln()+500,Dl(a,l));do try{zD();break}catch(z){dk(a,z)}while(!0);Vv(),Np.current=k,Wt=x,tr!==null?l=0:(Sr=null,Lr=0,l=fr)}if(l!==0){if(l===2&&(x=ht(a),x!==0&&(y=x,l=Ey(a,x))),l===1)throw h=of,Dl(a,0),Ta(a,y),Ss(a,ln()),h;if(l===6)Ta(a,y);else{if(x=a.current.alternate,(y&30)===0&&!FD(x)&&(l=Vp(a,y),l===2&&(k=ht(a),k!==0&&(y=k,l=Ey(a,k))),l===1))throw h=of,Dl(a,0),Ta(a,y),Ss(a,ln()),h;switch(a.finishedWork=x,a.finishedLanes=y,l){case 0:case 1:throw Error(n(345));case 2:Fl(a,xs,Mo);break;case 3:if(Ta(a,y),(y&130023424)===y&&(l=by+500-ln(),10<l)){if(ve(a,0)!==0)break;if(x=a.suspendedLanes,(x&y)!==y){as(),a.pingedLanes|=a.suspendedLanes&x;break}a.timeoutHandle=Rv(Fl.bind(null,a,xs,Mo),l);break}Fl(a,xs,Mo);break;case 4:if(Ta(a,y),(y&4194240)===y)break;for(l=a.eventTimes,x=-1;0<y;){var I=31-is(y);k=1<<I,I=l[I],I>x&&(x=I),y&=~k}if(y=x,y=ln()-y,y=(120>y?120:480>y?480:1080>y?1080:1920>y?1920:3e3>y?3e3:4320>y?4320:1960*DD(y/1960))-y,10<y){a.timeoutHandle=Rv(Fl.bind(null,a,xs,Mo),y);break}Fl(a,xs,Mo);break;case 5:Fl(a,xs,Mo);break;default:throw Error(n(329))}}}return Ss(a,ln()),a.callbackNode===h?ck.bind(null,a):null}function Ey(a,l){var h=af;return a.current.memoizedState.isDehydrated&&(Dl(a,l).flags|=256),a=Vp(a,l),a!==2&&(l=xs,xs=h,l!==null&&ky(l)),a}function ky(a){xs===null?xs=a:xs.push.apply(xs,a)}function FD(a){for(var l=a;;){if(l.flags&16384){var h=l.updateQueue;if(h!==null&&(h=h.stores,h!==null))for(var y=0;y<h.length;y++){var x=h[y],k=x.getSnapshot;x=x.value;try{if(!Si(k(),x))return!1}catch{return!1}}}if(h=l.child,l.subtreeFlags&16384&&h!==null)h.return=l,l=h;else{if(l===a)break;for(;l.sibling===null;){if(l.return===null||l.return===a)return!0;l=l.return}l.sibling.return=l.return,l=l.sibling}}return!0}function Ta(a,l){for(l&=~wy,l&=~Lp,a.suspendedLanes|=l,a.pingedLanes&=~l,a=a.expirationTimes;0<l;){var h=31-is(l),y=1<<h;a[h]=-1,l&=~y}}function uk(a){if((Wt&6)!==0)throw Error(n(327));Xc();var l=ve(a,0);if((l&1)===0)return Ss(a,ln()),null;var h=Vp(a,l);if(a.tag!==0&&h===2){var y=ht(a);y!==0&&(l=y,h=Ey(a,y))}if(h===1)throw h=of,Dl(a,0),Ta(a,l),Ss(a,ln()),h;if(h===6)throw Error(n(345));return a.finishedWork=a.current.alternate,a.finishedLanes=l,Fl(a,xs,Mo),Ss(a,ln()),null}function Cy(a,l){var h=Wt;Wt|=1;try{return a(l)}finally{Wt=h,Wt===0&&(Qc=ln()+500,pp&&xa())}}function $l(a){Pa!==null&&Pa.tag===0&&(Wt&6)===0&&Xc();var l=Wt;Wt|=1;var h=ai.transition,y=it;try{if(ai.transition=null,it=1,a)return a()}finally{it=y,ai.transition=h,Wt=l,(Wt&6)===0&&xa()}}function Py(){Zs=Yc.current,En(Yc)}function Dl(a,l){a.finishedWork=null,a.finishedLanes=0;var h=a.timeoutHandle;if(h!==-1&&(a.timeoutHandle=-1,pD(h)),tr!==null)for(h=tr.return;h!==null;){var y=h;switch($v(y),y.tag){case 1:y=y.type.childContextTypes,y!=null&&fp();break;case 3:Kc(),En(_s),En(Wr),qv();break;case 5:Kv(y);break;case 4:Kc();break;case 13:En(Ln);break;case 19:En(Ln);break;case 10:Hv(y.type._context);break;case 22:case 23:Py()}h=h.return}if(Sr=a,tr=a=Ra(a.current,null),Lr=Zs=l,fr=0,of=null,wy=Lp=Ll=0,xs=af=null,Ol!==null){for(l=0;l<Ol.length;l++)if(h=Ol[l],y=h.interleaved,y!==null){h.interleaved=null;var x=y.next,k=h.pending;if(k!==null){var I=k.next;k.next=x,y.next=I}h.pending=y}Ol=null}return a}function dk(a,l){do{var h=tr;try{if(Vv(),Ep.current=Ap,kp){for(var y=$n.memoizedState;y!==null;){var x=y.queue;x!==null&&(x.pending=null),y=y.next}kp=!1}if(Nl=0,xr=dr=$n=null,Jd=!1,ef=0,_y.current=null,h===null||h.return===null){fr=1,of=l,tr=null;break}e:{var k=a,I=h.return,z=h,K=l;if(l=Lr,z.flags|=32768,K!==null&&typeof K=="object"&&typeof K.then=="function"){var ae=K,_e=z,we=_e.tag;if((_e.mode&1)===0&&(we===0||we===11||we===15)){var ye=_e.alternate;ye?(_e.updateQueue=ye.updateQueue,_e.memoizedState=ye.memoizedState,_e.lanes=ye.lanes):(_e.updateQueue=null,_e.memoizedState=null)}var Fe=$E(I);if(Fe!==null){Fe.flags&=-257,DE(Fe,I,z,k,l),Fe.mode&1&&LE(k,ae,l),l=Fe,K=ae;var Ke=l.updateQueue;if(Ke===null){var qe=new Set;qe.add(K),l.updateQueue=qe}else Ke.add(K);break e}else{if((l&1)===0){LE(k,ae,l),Ay();break e}K=Error(n(426))}}else if(In&&z.mode&1){var Yn=$E(I);if(Yn!==null){(Yn.flags&65536)===0&&(Yn.flags|=256),DE(Yn,I,z,k,l),jv(Gc(K,z));break e}}k=K=Gc(K,z),fr!==4&&(fr=2),af===null?af=[k]:af.push(k),k=I;do{switch(k.tag){case 3:k.flags|=65536,l&=-l,k.lanes|=l;var ne=ME(k,K,l);oE(k,ne);break e;case 1:z=K;var Q=k.type,se=k.stateNode;if((k.flags&128)===0&&(typeof Q.getDerivedStateFromError=="function"||se!==null&&typeof se.componentDidCatch=="function"&&(Ca===null||!Ca.has(se)))){k.flags|=65536,l&=-l,k.lanes|=l;var Ce=NE(k,z,l);oE(k,Ce);break e}}k=k.return}while(k!==null)}pk(h)}catch(Je){l=Je,tr===h&&h!==null&&(tr=h=h.return);continue}break}while(!0)}function fk(){var a=Np.current;return Np.current=Ap,a===null?Ap:a}function Ay(){(fr===0||fr===3||fr===2)&&(fr=4),Sr===null||(Ll&268435455)===0&&(Lp&268435455)===0||Ta(Sr,Lr)}function Vp(a,l){var h=Wt;Wt|=2;var y=fk();(Sr!==a||Lr!==l)&&(Mo=null,Dl(a,l));do try{jD();break}catch(x){dk(a,x)}while(!0);if(Vv(),Wt=h,Np.current=y,tr!==null)throw Error(n(261));return Sr=null,Lr=0,fr}function jD(){for(;tr!==null;)hk(tr)}function zD(){for(;tr!==null&&!Tc();)hk(tr)}function hk(a){var l=vk(a.alternate,a,Zs);a.memoizedProps=a.pendingProps,l===null?pk(a):tr=l,_y.current=null}function pk(a){var l=a;do{var h=l.alternate;if(a=l.return,(l.flags&32768)===0){if(h=OD(h,l,Zs),h!==null){tr=h;return}}else{if(h=MD(h,l),h!==null){h.flags&=32767,tr=h;return}if(a!==null)a.flags|=32768,a.subtreeFlags=0,a.deletions=null;else{fr=6,tr=null;return}}if(l=l.sibling,l!==null){tr=l;return}tr=l=a}while(l!==null);fr===0&&(fr=5)}function Fl(a,l,h){var y=it,x=ai.transition;try{ai.transition=null,it=1,VD(a,l,h,y)}finally{ai.transition=x,it=y}return null}function VD(a,l,h,y){do Xc();while(Pa!==null);if((Wt&6)!==0)throw Error(n(327));h=a.finishedWork;var x=a.finishedLanes;if(h===null)return null;if(a.finishedWork=null,a.finishedLanes=0,h===a.current)throw Error(n(177));a.callbackNode=null,a.callbackPriority=0;var k=h.lanes|h.childLanes;if(pt(a,k),a===Sr&&(tr=Sr=null,Lr=0),(h.subtreeFlags&2064)===0&&(h.flags&2064)===0||Dp||(Dp=!0,yk(Ir,function(){return Xc(),null})),k=(h.flags&15990)!==0,(h.subtreeFlags&15990)!==0||k){k=ai.transition,ai.transition=null;var I=it;it=1;var z=Wt;Wt|=4,_y.current=null,LD(a,h),sk(h,a),aD(Av),Gi=!!Pv,Av=Pv=null,a.current=h,$D(h),ma(),Wt=z,it=I,ai.transition=k}else a.current=h;if(Dp&&(Dp=!1,Pa=a,Fp=x),k=a.pendingLanes,k===0&&(Ca=null),kl(h.stateNode),Ss(a,ln()),l!==null)for(y=a.onRecoverableError,h=0;h<l.length;h++)x=l[h],y(x.value,{componentStack:x.stack,digest:x.digest});if($p)throw $p=!1,a=xy,xy=null,a;return(Fp&1)!==0&&a.tag!==0&&Xc(),k=a.pendingLanes,(k&1)!==0?a===Sy?lf++:(lf=0,Sy=a):lf=0,xa(),null}function Xc(){if(Pa!==null){var a=Or(Fp),l=ai.transition,h=it;try{if(ai.transition=null,it=16>a?16:a,Pa===null)var y=!1;else{if(a=Pa,Pa=null,Fp=0,(Wt&6)!==0)throw Error(n(331));var x=Wt;for(Wt|=4,Ze=a.current;Ze!==null;){var k=Ze,I=k.child;if((Ze.flags&16)!==0){var z=k.deletions;if(z!==null){for(var K=0;K<z.length;K++){var ae=z[K];for(Ze=ae;Ze!==null;){var _e=Ze;switch(_e.tag){case 0:case 11:case 15:sf(8,_e,k)}var we=_e.child;if(we!==null)we.return=_e,Ze=we;else for(;Ze!==null;){_e=Ze;var ye=_e.sibling,Fe=_e.return;if(JE(_e),_e===ae){Ze=null;break}if(ye!==null){ye.return=Fe,Ze=ye;break}Ze=Fe}}}var Ke=k.alternate;if(Ke!==null){var qe=Ke.child;if(qe!==null){Ke.child=null;do{var Yn=qe.sibling;qe.sibling=null,qe=Yn}while(qe!==null)}}Ze=k}}if((k.subtreeFlags&2064)!==0&&I!==null)I.return=k,Ze=I;else e:for(;Ze!==null;){if(k=Ze,(k.flags&2048)!==0)switch(k.tag){case 0:case 11:case 15:sf(9,k,k.return)}var ne=k.sibling;if(ne!==null){ne.return=k.return,Ze=ne;break e}Ze=k.return}}var Q=a.current;for(Ze=Q;Ze!==null;){I=Ze;var se=I.child;if((I.subtreeFlags&2064)!==0&&se!==null)se.return=I,Ze=se;else e:for(I=Q;Ze!==null;){if(z=Ze,(z.flags&2048)!==0)try{switch(z.tag){case 0:case 11:case 15:Mp(9,z)}}catch(Je){Wn(z,z.return,Je)}if(z===I){Ze=null;break e}var Ce=z.sibling;if(Ce!==null){Ce.return=z.return,Ze=Ce;break e}Ze=z.return}}if(Wt=x,xa(),Br&&typeof Br.onPostCommitFiberRoot=="function")try{Br.onPostCommitFiberRoot(So,a)}catch{}y=!0}return y}finally{it=h,ai.transition=l}}return!1}function mk(a,l,h){l=Gc(h,l),l=ME(a,l,1),a=Ea(a,l,1),l=as(),a!==null&&(Jt(a,1,l),Ss(a,l))}function Wn(a,l,h){if(a.tag===3)mk(a,a,h);else for(;l!==null;){if(l.tag===3){mk(l,a,h);break}else if(l.tag===1){var y=l.stateNode;if(typeof l.type.getDerivedStateFromError=="function"||typeof y.componentDidCatch=="function"&&(Ca===null||!Ca.has(y))){a=Gc(h,a),a=NE(l,a,1),l=Ea(l,a,1),a=as(),l!==null&&(Jt(l,1,a),Ss(l,a));break}}l=l.return}}function HD(a,l,h){var y=a.pingCache;y!==null&&y.delete(l),l=as(),a.pingedLanes|=a.suspendedLanes&h,Sr===a&&(Lr&h)===h&&(fr===4||fr===3&&(Lr&130023424)===Lr&&500>ln()-by?Dl(a,0):wy|=h),Ss(a,l)}function gk(a,l){l===0&&((a.mode&1)===0?l=1:(l=N,N<<=1,(N&130023424)===0&&(N=4194304)));var h=as();a=Ro(a,l),a!==null&&(Jt(a,l,h),Ss(a,h))}function UD(a){var l=a.memoizedState,h=0;l!==null&&(h=l.retryLane),gk(a,h)}function ZD(a,l){var h=0;switch(a.tag){case 13:var y=a.stateNode,x=a.memoizedState;x!==null&&(h=x.retryLane);break;case 19:y=a.stateNode;break;default:throw Error(n(314))}y!==null&&y.delete(l),gk(a,h)}var vk;vk=function(a,l,h){if(a!==null)if(a.memoizedProps!==l.pendingProps||_s.current)bs=!0;else{if((a.lanes&h)===0&&(l.flags&128)===0)return bs=!1,ID(a,l,h);bs=(a.flags&131072)!==0}else bs=!1,In&&(l.flags&1048576)!==0&&YS(l,gp,l.index);switch(l.lanes=0,l.tag){case 2:var y=l.type;Ip(a,l),a=l.pendingProps;var x=zc(l,Wr.current);Wc(l,h),x=Xv(null,l,y,a,x,h);var k=Jv();return l.flags|=1,typeof x=="object"&&x!==null&&typeof x.render=="function"&&x.$$typeof===void 0?(l.tag=1,l.memoizedState=null,l.updateQueue=null,ws(y)?(k=!0,hp(l)):k=!1,l.memoizedState=x.state!==null&&x.state!==void 0?x.state:null,Bv(l),x.updater=Tp,l.stateNode=x,x._reactInternals=l,iy(l,y,a,h),l=cy(null,l,y,!0,k,h)):(l.tag=0,In&&k&&Lv(l),os(null,l,x,h),l=l.child),l;case 16:y=l.elementType;e:{switch(Ip(a,l),a=l.pendingProps,x=y._init,y=x(y._payload),l.type=y,x=l.tag=WD(y),a=ki(y,a),x){case 0:l=ly(null,l,y,a,h);break e;case 1:l=UE(null,l,y,a,h);break e;case 11:l=FE(null,l,y,a,h);break e;case 14:l=jE(null,l,y,ki(y.type,a),h);break e}throw Error(n(306,y,""))}return l;case 0:return y=l.type,x=l.pendingProps,x=l.elementType===y?x:ki(y,x),ly(a,l,y,x,h);case 1:return y=l.type,x=l.pendingProps,x=l.elementType===y?x:ki(y,x),UE(a,l,y,x,h);case 3:e:{if(ZE(l),a===null)throw Error(n(387));y=l.pendingProps,k=l.memoizedState,x=k.element,iE(a,l),xp(l,y,null,h);var I=l.memoizedState;if(y=I.element,k.isDehydrated)if(k={element:y,isDehydrated:!1,cache:I.cache,pendingSuspenseBoundaries:I.pendingSuspenseBoundaries,transitions:I.transitions},l.updateQueue.baseState=k,l.memoizedState=k,l.flags&256){x=Gc(Error(n(423)),l),l=BE(a,l,y,h,x);break e}else if(y!==x){x=Gc(Error(n(424)),l),l=BE(a,l,y,h,x);break e}else for(Us=_a(l.stateNode.containerInfo.firstChild),Hs=l,In=!0,Ei=null,h=rE(l,null,y,h),l.child=h;h;)h.flags=h.flags&-3|4096,h=h.sibling;else{if(Uc(),y===x){l=Oo(a,l,h);break e}os(a,l,y,h)}l=l.child}return l;case 5:return lE(l),a===null&&Fv(l),y=l.type,x=l.pendingProps,k=a!==null?a.memoizedProps:null,I=x.children,Tv(y,x)?I=null:k!==null&&Tv(y,k)&&(l.flags|=32),HE(a,l),os(a,l,I,h),l.child;case 6:return a===null&&Fv(l),null;case 13:return WE(a,l,h);case 4:return Wv(l,l.stateNode.containerInfo),y=l.pendingProps,a===null?l.child=Zc(l,null,y,h):os(a,l,y,h),l.child;case 11:return y=l.type,x=l.pendingProps,x=l.elementType===y?x:ki(y,x),FE(a,l,y,x,h);case 7:return os(a,l,l.pendingProps,h),l.child;case 8:return os(a,l,l.pendingProps.children,h),l.child;case 12:return os(a,l,l.pendingProps.children,h),l.child;case 10:e:{if(y=l.type._context,x=l.pendingProps,k=l.memoizedProps,I=x.value,bn(_p,y._currentValue),y._currentValue=I,k!==null)if(Si(k.value,I)){if(k.children===x.children&&!_s.current){l=Oo(a,l,h);break e}}else for(k=l.child,k!==null&&(k.return=l);k!==null;){var z=k.dependencies;if(z!==null){I=k.child;for(var K=z.firstContext;K!==null;){if(K.context===y){if(k.tag===1){K=Io(-1,h&-h),K.tag=2;var ae=k.updateQueue;if(ae!==null){ae=ae.shared;var _e=ae.pending;_e===null?K.next=K:(K.next=_e.next,_e.next=K),ae.pending=K}}k.lanes|=h,K=k.alternate,K!==null&&(K.lanes|=h),Uv(k.return,h,l),z.lanes|=h;break}K=K.next}}else if(k.tag===10)I=k.type===l.type?null:k.child;else if(k.tag===18){if(I=k.return,I===null)throw Error(n(341));I.lanes|=h,z=I.alternate,z!==null&&(z.lanes|=h),Uv(I,h,l),I=k.sibling}else I=k.child;if(I!==null)I.return=k;else for(I=k;I!==null;){if(I===l){I=null;break}if(k=I.sibling,k!==null){k.return=I.return,I=k;break}I=I.return}k=I}os(a,l,x.children,h),l=l.child}return l;case 9:return x=l.type,y=l.pendingProps.children,Wc(l,h),x=ii(x),y=y(x),l.flags|=1,os(a,l,y,h),l.child;case 14:return y=l.type,x=ki(y,l.pendingProps),x=ki(y.type,x),jE(a,l,y,x,h);case 15:return zE(a,l,l.type,l.pendingProps,h);case 17:return y=l.type,x=l.pendingProps,x=l.elementType===y?x:ki(y,x),Ip(a,l),l.tag=1,ws(y)?(a=!0,hp(l)):a=!1,Wc(l,h),IE(l,y,x),iy(l,y,x,h),cy(null,l,y,!0,a,h);case 19:return GE(a,l,h);case 22:return VE(a,l,h)}throw Error(n(156,l.tag))};function yk(a,l){return Ds(a,l)}function BD(a,l,h,y){this.tag=a,this.key=h,this.sibling=this.child=this.return=this.stateNode=this.type=this.elementType=null,this.index=0,this.ref=null,this.pendingProps=l,this.dependencies=this.memoizedState=this.updateQueue=this.memoizedProps=null,this.mode=y,this.subtreeFlags=this.flags=0,this.deletions=null,this.childLanes=this.lanes=0,this.alternate=null}function li(a,l,h,y){return new BD(a,l,h,y)}function Ty(a){return a=a.prototype,!(!a||!a.isReactComponent)}function WD(a){if(typeof a=="function")return Ty(a)?1:0;if(a!=null){if(a=a.$$typeof,a===H)return 11;if(a===V)return 14}return 2}function Ra(a,l){var h=a.alternate;return h===null?(h=li(a.tag,l,a.key,a.mode),h.elementType=a.elementType,h.type=a.type,h.stateNode=a.stateNode,h.alternate=a,a.alternate=h):(h.pendingProps=l,h.type=a.type,h.flags=0,h.subtreeFlags=0,h.deletions=null),h.flags=a.flags&14680064,h.childLanes=a.childLanes,h.lanes=a.lanes,h.child=a.child,h.memoizedProps=a.memoizedProps,h.memoizedState=a.memoizedState,h.updateQueue=a.updateQueue,l=a.dependencies,h.dependencies=l===null?null:{lanes:l.lanes,firstContext:l.firstContext},h.sibling=a.sibling,h.index=a.index,h.ref=a.ref,h}function Hp(a,l,h,y,x,k){var I=2;if(y=a,typeof a=="function")Ty(a)&&(I=1);else if(typeof a=="string")I=5;else e:switch(a){case O:return jl(h.children,x,k,l);case R:I=8,x|=8;break;case D:return a=li(12,h,l,x|2),a.elementType=D,a.lanes=k,a;case Y:return a=li(13,h,l,x),a.elementType=Y,a.lanes=k,a;case J:return a=li(19,h,l,x),a.elementType=J,a.lanes=k,a;case ee:return Up(h,x,k,l);default:if(typeof a=="object"&&a!==null)switch(a.$$typeof){case U:I=10;break e;case W:I=9;break e;case H:I=11;break e;case V:I=14;break e;case q:I=16,y=null;break e}throw Error(n(130,a==null?a:typeof a,""))}return l=li(I,h,l,x),l.elementType=a,l.type=y,l.lanes=k,l}function jl(a,l,h,y){return a=li(7,a,y,l),a.lanes=h,a}function Up(a,l,h,y){return a=li(22,a,y,l),a.elementType=ee,a.lanes=h,a.stateNode={isHidden:!1},a}function Ry(a,l,h){return a=li(6,a,null,l),a.lanes=h,a}function Iy(a,l,h){return l=li(4,a.children!==null?a.children:[],a.key,l),l.lanes=h,l.stateNode={containerInfo:a.containerInfo,pendingChildren:null,implementation:a.implementation},l}function KD(a,l,h,y,x){this.tag=l,this.containerInfo=a,this.finishedWork=this.pingCache=this.current=this.pendingChildren=null,this.timeoutHandle=-1,this.callbackNode=this.pendingContext=this.context=null,this.callbackPriority=0,this.eventTimes=Tt(0),this.expirationTimes=Tt(-1),this.entangledLanes=this.finishedLanes=this.mutableReadLanes=this.expiredLanes=this.pingedLanes=this.suspendedLanes=this.pendingLanes=0,this.entanglements=Tt(0),this.identifierPrefix=y,this.onRecoverableError=x,this.mutableSourceEagerHydrationData=null}function Oy(a,l,h,y,x,k,I,z,K){return a=new KD(a,l,h,z,K),l===1?(l=1,k===!0&&(l|=8)):l=0,k=li(3,null,null,l),a.current=k,k.stateNode=a,k.memoizedState={element:y,isDehydrated:h,cache:null,transitions:null,pendingSuspenseBoundaries:null},Bv(k),a}function GD(a,l,h){var y=3<arguments.length&&arguments[3]!==void 0?arguments[3]:null;return{$$typeof:M,key:y==null?null:""+y,children:a,containerInfo:l,implementation:h}}function _k(a){if(!a)return ba;a=a._reactInternals;e:{if(wr(a)!==a||a.tag!==1)throw Error(n(170));var l=a;do{switch(l.tag){case 3:l=l.stateNode.context;break e;case 1:if(ws(l.type)){l=l.stateNode.__reactInternalMemoizedMergedChildContext;break e}}l=l.return}while(l!==null);throw Error(n(171))}if(a.tag===1){var h=a.type;if(ws(h))return KS(a,h,l)}return l}function wk(a,l,h,y,x,k,I,z,K){return a=Oy(h,y,!0,a,x,k,I,z,K),a.context=_k(null),h=a.current,y=as(),x=Aa(h),k=Io(y,x),k.callback=l??null,Ea(h,k,x),a.current.lanes=x,Jt(a,x,y),Ss(a,y),a}function Zp(a,l,h,y){var x=l.current,k=as(),I=Aa(x);return h=_k(h),l.context===null?l.context=h:l.pendingContext=h,l=Io(k,I),l.payload={element:a},y=y===void 0?null:y,y!==null&&(l.callback=y),a=Ea(x,l,I),a!==null&&(Ai(a,x,I,k),bp(a,x,I)),I}function Bp(a){if(a=a.current,!a.child)return null;switch(a.child.tag){case 5:return a.child.stateNode;default:return a.child.stateNode}}function bk(a,l){if(a=a.memoizedState,a!==null&&a.dehydrated!==null){var h=a.retryLane;a.retryLane=h!==0&&h<l?h:l}}function My(a,l){bk(a,l),(a=a.alternate)&&bk(a,l)}function qD(){return null}var xk=typeof reportError=="function"?reportError:function(a){console.error(a)};function Ny(a){this._internalRoot=a}Wp.prototype.render=Ny.prototype.render=function(a){var l=this._internalRoot;if(l===null)throw Error(n(409));Zp(a,l,null,null)},Wp.prototype.unmount=Ny.prototype.unmount=function(){var a=this._internalRoot;if(a!==null){this._internalRoot=null;var l=a.containerInfo;$l(function(){Zp(null,a,null,null)}),l[Co]=null}};function Wp(a){this._internalRoot=a}Wp.prototype.unstable_scheduleHydration=function(a){if(a){var l=Ki();a={blockedOn:null,target:a,priority:l};for(var h=0;h<be.length&&l!==0&&l<be[h].priority;h++);be.splice(h,0,a),h===0&&er(a)}};function Ly(a){return!(!a||a.nodeType!==1&&a.nodeType!==9&&a.nodeType!==11)}function Kp(a){return!(!a||a.nodeType!==1&&a.nodeType!==9&&a.nodeType!==11&&(a.nodeType!==8||a.nodeValue!==" react-mount-point-unstable "))}function Sk(){}function YD(a,l,h,y,x){if(x){if(typeof y=="function"){var k=y;y=function(){var ae=Bp(I);k.call(ae)}}var I=wk(l,y,a,0,null,!1,!1,"",Sk);return a._reactRootContainer=I,a[Co]=I.current,Bd(a.nodeType===8?a.parentNode:a),$l(),I}for(;x=a.lastChild;)a.removeChild(x);if(typeof y=="function"){var z=y;y=function(){var ae=Bp(K);z.call(ae)}}var K=Oy(a,0,!1,null,null,!1,!1,"",Sk);return a._reactRootContainer=K,a[Co]=K.current,Bd(a.nodeType===8?a.parentNode:a),$l(function(){Zp(l,K,h,y)}),K}function Gp(a,l,h,y,x){var k=h._reactRootContainer;if(k){var I=k;if(typeof x=="function"){var z=x;x=function(){var K=Bp(I);z.call(K)}}Zp(l,I,a,x)}else I=YD(h,l,a,x,y);return Bp(I)}Eo=function(a){switch(a.tag){case 3:var l=a.stateNode;if(l.current.memoizedState.isDehydrated){var h=de(l.pendingLanes);h!==0&&(Rn(l,h|1),Ss(l,ln()),(Wt&6)===0&&(Qc=ln()+500,xa()))}break;case 13:$l(function(){var y=Ro(a,1);if(y!==null){var x=as();Ai(y,a,1,x)}}),My(a,1)}},ko=function(a){if(a.tag===13){var l=Ro(a,134217728);if(l!==null){var h=as();Ai(l,a,134217728,h)}My(a,134217728)}},Mr=function(a){if(a.tag===13){var l=Aa(a),h=Ro(a,l);if(h!==null){var y=as();Ai(h,a,l,y)}My(a,l)}},Ki=function(){return it},Cl=function(a,l){var h=it;try{return it=a,l()}finally{it=h}},Rr=function(a,l,h){switch(l){case"input":if(Gt(a,h),l=h.name,h.type==="radio"&&l!=null){for(h=a;h.parentNode;)h=h.parentNode;for(h=h.querySelectorAll("input[name="+JSON.stringify(""+l)+'][type="radio"]'),l=0;l<h.length;l++){var y=h[l];if(y!==a&&y.form===a.form){var x=dp(y);if(!x)throw Error(n(90));$e(y),Gt(y,x)}}}break;case"textarea":xe(a,h);break;case"select":l=h.value,l!=null&&Xe(a,!!h.multiple,l,!1)}},st=Cy,nn=$l;var QD={usingClientEntryPoint:!1,Events:[Gd,Fc,dp,qn,ss,Cy]},cf={findFiberByHostInstance:Al,bundleType:0,version:"18.3.1",rendererPackageName:"react-dom"},XD={bundleType:cf.bundleType,version:cf.version,rendererPackageName:cf.rendererPackageName,rendererConfig:cf.rendererConfig,overrideHookState:null,overrideHookStateDeletePath:null,overrideHookStateRenamePath:null,overrideProps:null,overridePropsDeletePath:null,overridePropsRenamePath:null,setErrorHandler:null,setSuspenseHandler:null,scheduleUpdate:null,currentDispatcherRef:A.ReactCurrentDispatcher,findHostInstanceByFiber:function(a){return a=ys(a),a===null?null:a.stateNode},findFiberByHostInstance:cf.findFiberByHostInstance||qD,findHostInstancesForRefresh:null,scheduleRefresh:null,scheduleRoot:null,setRefreshHandler:null,getCurrentFiber:null,reconcilerVersion:"18.3.1-next-f1338f8080-20240426"};if(typeof __REACT_DEVTOOLS_GLOBAL_HOOK__<"u"){var qp=__REACT_DEVTOOLS_GLOBAL_HOOK__;if(!qp.isDisabled&&qp.supportsFiber)try{So=qp.inject(XD),Br=qp}catch{}}return Es.__SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED=QD,Es.createPortal=function(a,l){var h=2<arguments.length&&arguments[2]!==void 0?arguments[2]:null;if(!Ly(l))throw Error(n(200));return GD(a,l,null,h)},Es.createRoot=function(a,l){if(!Ly(a))throw Error(n(299));var h=!1,y="",x=xk;return l!=null&&(l.unstable_strictMode===!0&&(h=!0),l.identifierPrefix!==void 0&&(y=l.identifierPrefix),l.onRecoverableError!==void 0&&(x=l.onRecoverableError)),l=Oy(a,1,!1,null,null,h,!1,y,x),a[Co]=l.current,Bd(a.nodeType===8?a.parentNode:a),new Ny(l)},Es.findDOMNode=function(a){if(a==null)return null;if(a.nodeType===1)return a;var l=a._reactInternals;if(l===void 0)throw typeof a.render=="function"?Error(n(188)):(a=Object.keys(a).join(","),Error(n(268,a)));return a=ys(l),a=a===null?null:a.stateNode,a},Es.flushSync=function(a){return $l(a)},Es.hydrate=function(a,l,h){if(!Kp(l))throw Error(n(200));return Gp(null,a,l,!0,h)},Es.hydrateRoot=function(a,l,h){if(!Ly(a))throw Error(n(405));var y=h!=null&&h.hydratedSources||null,x=!1,k="",I=xk;if(h!=null&&(h.unstable_strictMode===!0&&(x=!0),h.identifierPrefix!==void 0&&(k=h.identifierPrefix),h.onRecoverableError!==void 0&&(I=h.onRecoverableError)),l=wk(l,null,a,1,h??null,x,!1,k,I),a[Co]=l.current,Bd(a),y)for(a=0;a<y.length;a++)h=y[a],x=h._getVersion,x=x(h._source),l.mutableSourceEagerHydrationData==null?l.mutableSourceEagerHydrationData=[h,x]:l.mutableSourceEagerHydrationData.push(h,x);return new Wp(l)},Es.render=function(a,l,h){if(!Kp(l))throw Error(n(200));return Gp(null,a,l,!1,h)},Es.unmountComponentAtNode=function(a){if(!Kp(a))throw Error(n(40));return a._reactRootContainer?($l(function(){Gp(null,null,a,!1,function(){a._reactRootContainer=null,a[Co]=null})}),!0):!1},Es.unstable_batchedUpdates=Cy,Es.unstable_renderSubtreeIntoContainer=function(a,l,h,y){if(!Kp(h))throw Error(n(200));if(a==null||a._reactInternals===void 0)throw Error(n(38));return Gp(a,l,h,!1,y)},Es.version="18.3.1-next-f1338f8080-20240426",Es}var pA;function aL(){if(pA)return e_.exports;pA=1;function e(){if(!(typeof __REACT_DEVTOOLS_GLOBAL_HOOK__>"u"||typeof __REACT_DEVTOOLS_GLOBAL_HOOK__.checkDCE!="function"))try{__REACT_DEVTOOLS_GLOBAL_HOOK__.checkDCE(e)}catch(t){console.error(t)}}return e(),e_.exports=LJ(),e_.exports}var mA;function $J(){if(mA)return km;mA=1;var e=aL();return km.createRoot=e.createRoot,km.hydrateRoot=e.hydrateRoot,km}var DJ=$J();const FJ=Sg(DJ),jJ=e=>{const t=e==null?void 0:e.userId,n=e==null?void 0:e.email;g.useEffect(()=>{cM({userId:t,email:n})},[t,n])},Qo={BASE_URL:"/",DEV:!1,MODE:"production",PROD:!0,SSR:!1,VITE_SENTRY_DSN:""};function lL(e){return"init"in e}function m2(e){return typeof e.write=="function"}function zJ(e){return!!e.onMount}function gA(e){return"v"in e||"e"in e}function lg(e){if("e"in e)throw e.e;if((Qo?"production":void 0)!=="production"&&!("v"in e))throw new Error("[Bug] atom state is not initialized");return e.v}function cg(e){return typeof(e==null?void 0:e.then)=="function"}function VJ(e){if(!(e instanceof Error))return!1;const t=e.name,n=e.message.toLowerCase();return(t==="RangeError"||t==="InternalError")&&(n.includes("call stack")||n.includes("too much recursion")||n.includes("stack overflow"))}function cL(e,t,n){if(!n.p.has(e)){n.p.add(e);const r=()=>n.p.delete(e);t.then(r,r)}}function uL(e,t,n){const r=n.get(e),s=r==null?void 0:r.t,i=t.p;if(!(s!=null&&s.size))return i;if(!i.size)return s;const o=new Set(s);for(const c of i)o.add(c);return o}function HJ(e){return!!e.INTERNAL_onInit}const UJ=(e,t,n,...r)=>n.read(...r),ZJ=(e,t,n,...r)=>n.write(...r),BJ=(e,t,n)=>n.INTERNAL_onInit(t),WJ=(e,t,n,r)=>{var s;return(s=n.onMount)==null?void 0:s.call(n,r)},KJ=(e,t,n)=>{var r;const s=e[0];let i=s.get(n);if(!i){const o=e[6],c=e[9];i={d:new Map,p:new Set,n:0},s.set(n,i),(r=o.i)==null||r.call(o,n),HJ(n)&&c(e,t,n)}return i},GJ=(e,t)=>{var n;const r=e[1],s=e[3],i=e[4],o=e[5],c=e[6],u=e[13];if(!c.f&&!s.size&&!i.size&&!o.size)return;const d=[],f=p=>{try{p()}catch(m){d.push(m)}};do{c.f&&f(c.f);const p=new Set;for(const m of s){const v=(n=r.get(m))==null?void 0:n.l;if(v)for(const _ of v)p.add(_)}s.clear();for(const m of o)p.add(m);o.clear();for(const m of i)p.add(m);i.clear();for(const m of p)f(m);s.size&&u(e,t)}while(s.size||o.size||i.size);if(d.length)throw new AggregateError(d)},qJ=(e,t)=>{const n=e[1],r=e[2],s=e[3],i=e[11],o=e[14],c=e[17];if(!s.size)return;const u=[],d=[],f=new WeakSet,p=new WeakSet,m=[],v=[];for(const _ of s)m.push(_),v.push(i(e,t,_));for(;m.length;){const _=m.length-1,w=m[_],b=v[_];if(p.has(w)){m.pop(),v.pop();continue}if(f.has(w)){if(r.get(w)===b.n)u.push(w),d.push(b);else if((Qo?"production":void 0)!=="production"&&r.has(w))throw new Error("[Bug] invalidated atom exists");p.add(w),m.pop(),v.pop();continue}f.add(w);for(const S of uL(w,b,n))f.has(S)||(m.push(S),v.push(i(e,t,S)))}for(let _=u.length-1;_>=0;--_){const w=u[_],b=d[_];let S=!1;for(const E of b.d.keys())if(E!==w&&s.has(E)){S=!0;break}S&&(r.set(w,b.n),o(e,t,w),c(e,t,w)),r.delete(w)}},g2=new WeakSet,YJ=(e,t,n)=>{var r,s;const i=e[1],o=e[2],c=e[3],u=e[6],d=e[7],f=e[11],p=e[12],m=e[13],v=e[14],_=e[16],w=e[17],b=e[20],S=e[26],E=e[28],C=f(e,t,n),A=E[0];if(gA(C)){if(i.has(n)&&o.get(n)!==C.n||C.m===A)return C.m=A,C;let V=!1;for(const[q,ee]of C.d)if(v(e,t,q).n!==ee){V=!0;break}if(!V)return C.m=A,C}let T=!0;const M=new Set(C.d.keys()),O=()=>{for(const V of M)C.d.delete(V)},R=()=>{if(i.has(n)){const V=!c.size;w(e,t,n),V&&(m(e,t),p(e,t))}},D=V=>{var q;if(V===n){const F=f(e,t,V);if(!gA(F))if(lL(V))b(e,t,V,V.init);else throw new Error("no atom init");return lg(F)}const ee=v(e,t,V);try{return lg(ee)}finally{M.delete(V),C.d.set(V,ee.n),cg(C.v)&&cL(n,C.v,ee),i.has(n)&&((q=i.get(V))==null||q.t.add(n)),T||R()}};let U,W;const H={get signal(){return U||(U=new AbortController),U.signal},get setSelf(){return(Qo?"production":void 0)!=="production"&&console.warn("[DEPRECATED] setSelf is deprecated and will be removed in v3."),(Qo?"production":void 0)!=="production"&&!m2(n)&&console.warn("setSelf function cannot be used with read-only atom"),!W&&m2(n)&&(W=(...V)=>{if((Qo?"production":void 0)!=="production"&&T&&console.warn("setSelf function cannot be called in sync"),!T)try{return _(e,t,n,V)}finally{m(e,t),p(e,t)}}),W}},Y=C.n,J=o.get(n)===Y;try{(Qo?"production":void 0)!=="production"&&g2.delete(t);const V=d(e,t,n,D,H);if((Qo?"production":void 0)!=="production"&&g2.has(t)&&console.warn("Detected store mutation during atom read. This is not supported."),b(e,t,n,V),cg(V)){S(e,t,V,()=>U==null?void 0:U.abort());const q=()=>{O(),R()};V.then(q,q)}else O();return(r=u.r)==null||r.call(u,n),C.m=A,C}catch(V){if(VJ(V))throw V;return delete C.v,C.e=V,++C.n,C.m=A,C}finally{T=!1,C.n!==Y&&J&&(o.set(n,C.n),c.add(n),(s=u.c)==null||s.call(u,n))}},QJ=(e,t,n)=>{const r=e[1],s=e[2],i=e[11],o=[n];for(;o.length;){const c=o.pop(),u=i(e,t,c);for(const d of uL(c,u,r)){const f=i(e,t,d);s.get(d)!==f.n&&(s.set(d,f.n),o.push(d))}}},XJ=(e,t,n,r)=>{const s=e[3],i=e[6],o=e[8],c=e[11],u=e[12],d=e[13],f=e[14],p=e[15],m=e[16],v=e[17],_=e[20],w=e[28];let b=!0;const S=C=>lg(f(e,t,C)),E=(C,...A)=>{var T;const M=c(e,t,C);try{if(C===n){if(!lL(C))throw new Error("atom not writable");(Qo?"production":void 0)!=="production"&&g2.add(t);const O=M.n,R=A[0];_(e,t,C,R),v(e,t,C),O!==M.n&&(++w[0],s.add(C),p(e,t,C),(T=i.c)==null||T.call(i,C));return}else return m(e,t,C,A)}finally{b||(d(e,t),u(e,t))}};try{return o(e,t,n,S,E,...r)}finally{b=!1}},JJ=(e,t,n)=>{var r;const s=e[1],i=e[3],o=e[6],c=e[11],u=e[15],d=e[18],f=e[19],p=c(e,t,n),m=s.get(n);if(m&&p.d.size>0){for(const[v,_]of p.d)if(!m.d.has(v)){const w=c(e,t,v);d(e,t,v).t.add(n),m.d.add(v),_!==w.n&&(i.add(v),u(e,t,v),(r=o.c)==null||r.call(o,v))}for(const v of m.d)if(!p.d.has(v)){m.d.delete(v);const _=f(e,t,v);_==null||_.t.delete(n)}}},eee=(e,t,n)=>{var r;const s=e[1],i=e[4],o=e[6],c=e[10],u=e[11],d=e[12],f=e[13],p=e[14],m=e[16],v=e[18],_=u(e,t,n);let w=s.get(n);if(!w){p(e,t,n);for(const b of _.d.keys())v(e,t,b).t.add(n);if(w={l:new Set,d:new Set(_.d.keys()),t:new Set},s.set(n,w),m2(n)&&zJ(n)){const b=()=>{let S=!0;const E=(...C)=>{try{return m(e,t,n,C)}finally{S||(f(e,t),d(e,t))}};try{const C=c(e,t,n,E);C&&(w.u=()=>{S=!0;try{C()}finally{S=!1}})}finally{S=!1}};i.add(b)}(r=o.m)==null||r.call(o,n)}return w},tee=(e,t,n)=>{var r,s;const i=e[1],o=e[5],c=e[6],u=e[11],d=e[19],f=u(e,t,n);let p=i.get(n);if(!p||p.l.size)return p;let m=!1;for(const v of p.t)if((r=i.get(v))!=null&&r.d.has(n)){m=!0;break}if(!m){p.u&&o.add(p.u),p=void 0,i.delete(n);for(const v of f.d.keys()){const _=d(e,t,v);_==null||_.t.delete(n)}(s=c.u)==null||s.call(c,n);return}return p},nee=(e,t,n,r)=>{const s=e[11],i=e[27],o=s(e,t,n),c="v"in o,u=o.v;if(cg(r))for(const d of o.d.keys())cL(n,r,s(e,t,d));o.v=r,delete o.e,(!c||!Object.is(u,o.v))&&(++o.n,cg(u)&&i(e,t,u))},ree=(e,t,n)=>{const r=e[14];return lg(r(e,t,n))},see=(e,t,n,...r)=>{const s=e[3],i=e[12],o=e[13],c=e[16],u=s.size;try{return c(e,t,n,r)}finally{s.size!==u&&(o(e,t),i(e,t))}},iee=(e,t,n,r)=>{const s=e[12],i=e[13],o=e[18],c=e[19],d=o(e,t,n).l;return d.add(r),i(e,t),s(e,t),()=>{d.delete(r),c(e,t,n),i(e,t),s(e,t)}},oee=(e,t,n,r)=>{const s=e[25];let i=s.get(n);if(!i){i=new Set,s.set(n,i);const o=()=>s.delete(n);n.then(o,o)}i.add(r)},aee=(e,t,n)=>{const s=e[25].get(n);s==null||s.forEach(i=>i())},dL=new WeakMap;function lee(e){const t=dL.get(e);if((Qo?"production":void 0)!=="production"&&!t)throw new Error("Store must be created by buildStore to read its building blocks");const n=t[24];return n?n(t,e):t}function cee(...e){const t={get(o){return r(n,t,o)},set(o,...c){return s(n,t,o,...c)},sub(o,c){return i(n,t,o,c)}},n=[new WeakMap,new WeakMap,new WeakMap,new Set,new Set,new Set,{},UJ,ZJ,BJ,WJ,KJ,GJ,qJ,YJ,QJ,XJ,JJ,eee,tee,nee,ree,see,iee,void 0,new WeakMap,oee,aee,[0]].map((o,c)=>e[c]||o);dL.set(t,Object.freeze(n));const r=n[21],s=n[22],i=n[23];return t}const fL={};let uee=0;function on(e,t){const n=`atom${++uee}`,r={toString(){return(fL?"production":void 0)!=="production"&&this.debugLabel?n+":"+this.debugLabel:n}};return typeof e=="function"?r.read=e:(r.init=e,r.read=dee,r.write=fee),r}function dee(e){return e(this)}function fee(e,t,n){return t(this,typeof n=="function"?n(e(this)):n)}function hee(){return cee()}let kf;function pee(){return kf||(kf=hee(),(fL?"production":void 0)!=="production"&&(globalThis.__JOTAI_DEFAULT_STORE__||(globalThis.__JOTAI_DEFAULT_STORE__=kf),globalThis.__JOTAI_DEFAULT_STORE__!==kf&&console.warn("Detected multiple Jotai instances. It may cause unexpected behavior with the default store. https://github.com/pmndrs/jotai/discussions/2044"))),kf}const mee={},gee=g.createContext(void 0);function kx(e){return g.useContext(gee)||pee()}const v2=e=>typeof(e==null?void 0:e.then)=="function",y2=e=>{e.status||(e.status="pending",e.then(t=>{e.status="fulfilled",e.value=t},t=>{e.status="rejected",e.reason=t}))},vee=Ee.use||(e=>{if(e.status==="pending")throw e;if(e.status==="fulfilled")return e.value;throw e.status==="rejected"?e.reason:(y2(e),e)}),r_=new WeakMap,vA=(e,t,n)=>{const r=lee(e),s=r[26];let i=r_.get(t);return i||(i=new Promise((o,c)=>{let u=t;const d=m=>v=>{u===m&&o(v)},f=m=>v=>{u===m&&c(v)},p=()=>{try{const m=n();v2(m)?(r_.set(m,i),u=m,m.then(d(m),f(m)),s(r,e,m,p)):o(m)}catch(m){c(m)}};t.then(d(t),f(t)),s(r,e,t,p)}),r_.set(t,i)),i};function vt(e,t){const{delay:n,unstable_promiseStatus:r=!Ee.use}={},s=kx(),[[i,o,c],u]=g.useReducer(f=>{const p=s.get(e);return Object.is(f[0],p)&&f[1]===s&&f[2]===e?f:[p,s,e]},void 0,()=>[s.get(e),s,e]);let d=i;if((o!==s||c!==e)&&(u(),d=s.get(e)),g.useEffect(()=>{const f=s.sub(e,()=>{if(r)try{const p=s.get(e);v2(p)&&y2(vA(s,p,()=>s.get(e)))}catch{}if(typeof n=="number"){console.warn(`[DEPRECATED] delay option is deprecated and will be removed in v3.
|
|
109
|
+
|
|
110
|
+
Migration guide:
|
|
111
|
+
|
|
112
|
+
Create a custom hook like the following.
|
|
113
|
+
|
|
114
|
+
function useAtomValueWithDelay<Value>(
|
|
115
|
+
atom: Atom<Value>,
|
|
116
|
+
options: { delay: number },
|
|
117
|
+
): Value {
|
|
118
|
+
const { delay } = options
|
|
119
|
+
const store = useStore(options)
|
|
120
|
+
const [value, setValue] = useState(() => store.get(atom))
|
|
121
|
+
useEffect(() => {
|
|
122
|
+
const unsub = store.sub(atom, () => {
|
|
123
|
+
setTimeout(() => setValue(store.get(atom)), delay)
|
|
124
|
+
})
|
|
125
|
+
return unsub
|
|
126
|
+
}, [store, atom, delay])
|
|
127
|
+
return value
|
|
128
|
+
}
|
|
129
|
+
`),setTimeout(u,n);return}u()});return u(),f},[s,e,n,r]),g.useDebugValue(d),v2(d)){const f=vA(s,d,()=>s.get(e));return r&&y2(f),vee(f)}return d}function Nt(e,t){const n=kx();return g.useCallback((...s)=>{if((mee?"production":void 0)!=="production"&&!("write"in e))throw new Error("not writable atom");return n.set(e,...s)},[n,e])}function hL(e,t){return[vt(e),Nt(e)]}const yee=new Map([["bold",g.createElement(g.Fragment,null,g.createElement("path",{d:"M208.49,120.49a12,12,0,0,1-17,0L140,69V216a12,12,0,0,1-24,0V69L64.49,120.49a12,12,0,0,1-17-17l72-72a12,12,0,0,1,17,0l72,72A12,12,0,0,1,208.49,120.49Z"}))],["duotone",g.createElement(g.Fragment,null,g.createElement("path",{d:"M200,112H56l72-72Z",opacity:"0.2"}),g.createElement("path",{d:"M205.66,106.34l-72-72a8,8,0,0,0-11.32,0l-72,72A8,8,0,0,0,56,120h64v96a8,8,0,0,0,16,0V120h64a8,8,0,0,0,5.66-13.66ZM75.31,104,128,51.31,180.69,104Z"}))],["fill",g.createElement(g.Fragment,null,g.createElement("path",{d:"M207.39,115.06A8,8,0,0,1,200,120H136v96a8,8,0,0,1-16,0V120H56a8,8,0,0,1-5.66-13.66l72-72a8,8,0,0,1,11.32,0l72,72A8,8,0,0,1,207.39,115.06Z"}))],["light",g.createElement(g.Fragment,null,g.createElement("path",{d:"M204.24,116.24a6,6,0,0,1-8.48,0L134,54.49V216a6,6,0,0,1-12,0V54.49L60.24,116.24a6,6,0,0,1-8.48-8.48l72-72a6,6,0,0,1,8.48,0l72,72A6,6,0,0,1,204.24,116.24Z"}))],["regular",g.createElement(g.Fragment,null,g.createElement("path",{d:"M205.66,117.66a8,8,0,0,1-11.32,0L136,59.31V216a8,8,0,0,1-16,0V59.31L61.66,117.66a8,8,0,0,1-11.32-11.32l72-72a8,8,0,0,1,11.32,0l72,72A8,8,0,0,1,205.66,117.66Z"}))],["thin",g.createElement(g.Fragment,null,g.createElement("path",{d:"M202.83,114.83a4,4,0,0,1-5.66,0L132,49.66V216a4,4,0,0,1-8,0V49.66L58.83,114.83a4,4,0,0,1-5.66-5.66l72-72a4,4,0,0,1,5.66,0l72,72A4,4,0,0,1,202.83,114.83Z"}))]]),_ee=new Map([["bold",g.createElement(g.Fragment,null,g.createElement("path",{d:"M216.49,104.49l-80,80a12,12,0,0,1-17,0l-80-80a12,12,0,0,1,17-17L128,159l71.51-71.52a12,12,0,0,1,17,17Z"}))],["duotone",g.createElement(g.Fragment,null,g.createElement("path",{d:"M208,96l-80,80L48,96Z",opacity:"0.2"}),g.createElement("path",{d:"M215.39,92.94A8,8,0,0,0,208,88H48a8,8,0,0,0-5.66,13.66l80,80a8,8,0,0,0,11.32,0l80-80A8,8,0,0,0,215.39,92.94ZM128,164.69,67.31,104H188.69Z"}))],["fill",g.createElement(g.Fragment,null,g.createElement("path",{d:"M213.66,101.66l-80,80a8,8,0,0,1-11.32,0l-80-80A8,8,0,0,1,48,88H208a8,8,0,0,1,5.66,13.66Z"}))],["light",g.createElement(g.Fragment,null,g.createElement("path",{d:"M212.24,100.24l-80,80a6,6,0,0,1-8.48,0l-80-80a6,6,0,0,1,8.48-8.48L128,167.51l75.76-75.75a6,6,0,0,1,8.48,8.48Z"}))],["regular",g.createElement(g.Fragment,null,g.createElement("path",{d:"M213.66,101.66l-80,80a8,8,0,0,1-11.32,0l-80-80A8,8,0,0,1,53.66,90.34L128,164.69l74.34-74.35a8,8,0,0,1,11.32,11.32Z"}))],["thin",g.createElement(g.Fragment,null,g.createElement("path",{d:"M210.83,98.83l-80,80a4,4,0,0,1-5.66,0l-80-80a4,4,0,0,1,5.66-5.66L128,170.34l77.17-77.17a4,4,0,1,1,5.66,5.66Z"}))]]),wee=new Map([["bold",g.createElement(g.Fragment,null,g.createElement("path",{d:"M184.49,136.49l-80,80a12,12,0,0,1-17-17L159,128,87.51,56.49a12,12,0,1,1,17-17l80,80A12,12,0,0,1,184.49,136.49Z"}))],["duotone",g.createElement(g.Fragment,null,g.createElement("path",{d:"M176,128,96,208V48Z",opacity:"0.2"}),g.createElement("path",{d:"M181.66,122.34l-80-80A8,8,0,0,0,88,48V208a8,8,0,0,0,13.66,5.66l80-80A8,8,0,0,0,181.66,122.34ZM104,188.69V67.31L164.69,128Z"}))],["fill",g.createElement(g.Fragment,null,g.createElement("path",{d:"M181.66,133.66l-80,80A8,8,0,0,1,88,208V48a8,8,0,0,1,13.66-5.66l80,80A8,8,0,0,1,181.66,133.66Z"}))],["light",g.createElement(g.Fragment,null,g.createElement("path",{d:"M180.24,132.24l-80,80a6,6,0,0,1-8.48-8.48L167.51,128,91.76,52.24a6,6,0,0,1,8.48-8.48l80,80A6,6,0,0,1,180.24,132.24Z"}))],["regular",g.createElement(g.Fragment,null,g.createElement("path",{d:"M181.66,133.66l-80,80a8,8,0,0,1-11.32-11.32L164.69,128,90.34,53.66a8,8,0,0,1,11.32-11.32l80,80A8,8,0,0,1,181.66,133.66Z"}))],["thin",g.createElement(g.Fragment,null,g.createElement("path",{d:"M178.83,130.83l-80,80a4,4,0,0,1-5.66-5.66L170.34,128,93.17,50.83a4,4,0,0,1,5.66-5.66l80,80A4,4,0,0,1,178.83,130.83Z"}))]]),bee=new Map([["bold",g.createElement(g.Fragment,null,g.createElement("path",{d:"M128,20A108,108,0,0,0,31.85,177.23L21,209.66A20,20,0,0,0,46.34,235l32.43-10.81A108,108,0,1,0,128,20Zm0,192a84,84,0,0,1-42.06-11.27,12,12,0,0,0-6-1.62,12.1,12.1,0,0,0-3.8.62l-29.79,9.93,9.93-29.79a12,12,0,0,0-1-9.81A84,84,0,1,1,128,212Z"}))],["duotone",g.createElement(g.Fragment,null,g.createElement("path",{d:"M224,128A96,96,0,0,1,79.93,211.11h0L42.54,223.58a8,8,0,0,1-10.12-10.12l12.47-37.39h0A96,96,0,1,1,224,128Z",opacity:"0.2"}),g.createElement("path",{d:"M128,24A104,104,0,0,0,36.18,176.88L24.83,210.93a16,16,0,0,0,20.24,20.24l34.05-11.35A104,104,0,1,0,128,24Zm0,192a87.87,87.87,0,0,1-44.06-11.81,8,8,0,0,0-6.54-.67L40,216,52.47,178.6a8,8,0,0,0-.66-6.54A88,88,0,1,1,128,216Z"}))],["fill",g.createElement(g.Fragment,null,g.createElement("path",{d:"M232,128A104,104,0,0,1,79.12,219.82L45.07,231.17a16,16,0,0,1-20.24-20.24l11.35-34.05A104,104,0,1,1,232,128Z"}))],["light",g.createElement(g.Fragment,null,g.createElement("path",{d:"M128,26A102,102,0,0,0,38.35,176.69L26.73,211.56a14,14,0,0,0,17.71,17.71l34.87-11.62A102,102,0,1,0,128,26Zm0,192a90,90,0,0,1-45.06-12.08,6.09,6.09,0,0,0-3-.81,6.2,6.2,0,0,0-1.9.31L40.65,217.88a2,2,0,0,1-2.53-2.53L50.58,178a6,6,0,0,0-.5-4.91A90,90,0,1,1,128,218Z"}))],["regular",g.createElement(g.Fragment,null,g.createElement("path",{d:"M128,24A104,104,0,0,0,36.18,176.88L24.83,210.93a16,16,0,0,0,20.24,20.24l34.05-11.35A104,104,0,1,0,128,24Zm0,192a87.87,87.87,0,0,1-44.06-11.81,8,8,0,0,0-6.54-.67L40,216,52.47,178.6a8,8,0,0,0-.66-6.54A88,88,0,1,1,128,216Z"}))],["thin",g.createElement(g.Fragment,null,g.createElement("path",{d:"M128,28A100,100,0,0,0,40.53,176.5l-11.9,35.69a12,12,0,0,0,15.18,15.18l35.69-11.9A100,100,0,1,0,128,28Zm0,192a92,92,0,0,1-46.07-12.35,4.05,4.05,0,0,0-2-.54,3.93,3.93,0,0,0-1.27.21L41.28,219.78a4,4,0,0,1-5.06-5.06l12.46-37.38a4,4,0,0,0-.33-3.27A92,92,0,1,1,128,220Z"}))]]),xee=new Map([["bold",g.createElement(g.Fragment,null,g.createElement("path",{d:"M232.49,80.49l-128,128a12,12,0,0,1-17,0l-56-56a12,12,0,1,1,17-17L96,183,215.51,63.51a12,12,0,0,1,17,17Z"}))],["duotone",g.createElement(g.Fragment,null,g.createElement("path",{d:"M232,56V200a16,16,0,0,1-16,16H40a16,16,0,0,1-16-16V56A16,16,0,0,1,40,40H216A16,16,0,0,1,232,56Z",opacity:"0.2"}),g.createElement("path",{d:"M205.66,85.66l-96,96a8,8,0,0,1-11.32,0l-40-40a8,8,0,0,1,11.32-11.32L104,164.69l90.34-90.35a8,8,0,0,1,11.32,11.32Z"}))],["fill",g.createElement(g.Fragment,null,g.createElement("path",{d:"M216,40H40A16,16,0,0,0,24,56V200a16,16,0,0,0,16,16H216a16,16,0,0,0,16-16V56A16,16,0,0,0,216,40ZM205.66,85.66l-96,96a8,8,0,0,1-11.32,0l-40-40a8,8,0,0,1,11.32-11.32L104,164.69l90.34-90.35a8,8,0,0,1,11.32,11.32Z"}))],["light",g.createElement(g.Fragment,null,g.createElement("path",{d:"M228.24,76.24l-128,128a6,6,0,0,1-8.48,0l-56-56a6,6,0,0,1,8.48-8.48L96,191.51,219.76,67.76a6,6,0,0,1,8.48,8.48Z"}))],["regular",g.createElement(g.Fragment,null,g.createElement("path",{d:"M229.66,77.66l-128,128a8,8,0,0,1-11.32,0l-56-56a8,8,0,0,1,11.32-11.32L96,188.69,218.34,66.34a8,8,0,0,1,11.32,11.32Z"}))],["thin",g.createElement(g.Fragment,null,g.createElement("path",{d:"M226.83,74.83l-128,128a4,4,0,0,1-5.66,0l-56-56a4,4,0,0,1,5.66-5.66L96,194.34,221.17,69.17a4,4,0,1,1,5.66,5.66Z"}))]]),See=new Map([["bold",g.createElement(g.Fragment,null,g.createElement("path",{d:"M236,128a108,108,0,0,1-216,0c0-42.52,24.73-81.34,63-98.9A12,12,0,1,1,93,50.91C63.24,64.57,44,94.83,44,128a84,84,0,0,0,168,0c0-33.17-19.24-63.43-49-77.09A12,12,0,1,1,173,29.1C211.27,46.66,236,85.48,236,128Z"}))],["duotone",g.createElement(g.Fragment,null,g.createElement("path",{d:"M224,128a96,96,0,1,1-96-96A96,96,0,0,1,224,128Z",opacity:"0.2"}),g.createElement("path",{d:"M232,128a104,104,0,0,1-208,0c0-41,23.81-78.36,60.66-95.27a8,8,0,0,1,6.68,14.54C60.15,61.59,40,93.27,40,128a88,88,0,0,0,176,0c0-34.73-20.15-66.41-51.34-80.73a8,8,0,0,1,6.68-14.54C208.19,49.64,232,87,232,128Z"}))],["fill",g.createElement(g.Fragment,null,g.createElement("path",{d:"M128,24A104,104,0,1,0,232,128,104.11,104.11,0,0,0,128,24Zm0,176A72,72,0,0,1,92,65.64a8,8,0,0,1,8,13.85,56,56,0,1,0,56,0,8,8,0,0,1,8-13.85A72,72,0,0,1,128,200Z"}))],["light",g.createElement(g.Fragment,null,g.createElement("path",{d:"M230,128a102,102,0,0,1-204,0c0-40.18,23.35-76.86,59.5-93.45a6,6,0,0,1,5,10.9C58.61,60.09,38,92.49,38,128a90,90,0,0,0,180,0c0-35.51-20.61-67.91-52.5-82.55a6,6,0,0,1,5-10.9C206.65,51.14,230,87.82,230,128Z"}))],["regular",g.createElement(g.Fragment,null,g.createElement("path",{d:"M232,128a104,104,0,0,1-208,0c0-41,23.81-78.36,60.66-95.27a8,8,0,0,1,6.68,14.54C60.15,61.59,40,93.27,40,128a88,88,0,0,0,176,0c0-34.73-20.15-66.41-51.34-80.73a8,8,0,0,1,6.68-14.54C208.19,49.64,232,87,232,128Z"}))],["thin",g.createElement(g.Fragment,null,g.createElement("path",{d:"M228,128a100,100,0,0,1-200,0c0-39.4,22.9-75.37,58.33-91.63a4,4,0,1,1,3.34,7.27C57.07,58.6,36,91.71,36,128a92,92,0,0,0,184,0c0-36.29-21.07-69.4-53.67-84.36a4,4,0,1,1,3.34-7.27C205.1,52.63,228,88.6,228,128Z"}))]]),Eee=new Map([["bold",g.createElement(g.Fragment,null,g.createElement("path",{d:"M216,28H88A12,12,0,0,0,76,40V76H40A12,12,0,0,0,28,88V216a12,12,0,0,0,12,12H168a12,12,0,0,0,12-12V180h36a12,12,0,0,0,12-12V40A12,12,0,0,0,216,28ZM156,204H52V100H156Zm48-48H180V88a12,12,0,0,0-12-12H100V52H204Z"}))],["duotone",g.createElement(g.Fragment,null,g.createElement("path",{d:"M216,40V168H168V88H88V40Z",opacity:"0.2"}),g.createElement("path",{d:"M216,32H88a8,8,0,0,0-8,8V80H40a8,8,0,0,0-8,8V216a8,8,0,0,0,8,8H168a8,8,0,0,0,8-8V176h40a8,8,0,0,0,8-8V40A8,8,0,0,0,216,32ZM160,208H48V96H160Zm48-48H176V88a8,8,0,0,0-8-8H96V48H208Z"}))],["fill",g.createElement(g.Fragment,null,g.createElement("path",{d:"M216,32H88a8,8,0,0,0-8,8V80H40a8,8,0,0,0-8,8V216a8,8,0,0,0,8,8H168a8,8,0,0,0,8-8V176h40a8,8,0,0,0,8-8V40A8,8,0,0,0,216,32Zm-8,128H176V88a8,8,0,0,0-8-8H96V48H208Z"}))],["light",g.createElement(g.Fragment,null,g.createElement("path",{d:"M216,34H88a6,6,0,0,0-6,6V82H40a6,6,0,0,0-6,6V216a6,6,0,0,0,6,6H168a6,6,0,0,0,6-6V174h42a6,6,0,0,0,6-6V40A6,6,0,0,0,216,34ZM162,210H46V94H162Zm48-48H174V88a6,6,0,0,0-6-6H94V46H210Z"}))],["regular",g.createElement(g.Fragment,null,g.createElement("path",{d:"M216,32H88a8,8,0,0,0-8,8V80H40a8,8,0,0,0-8,8V216a8,8,0,0,0,8,8H168a8,8,0,0,0,8-8V176h40a8,8,0,0,0,8-8V40A8,8,0,0,0,216,32ZM160,208H48V96H160Zm48-48H176V88a8,8,0,0,0-8-8H96V48H208Z"}))],["thin",g.createElement(g.Fragment,null,g.createElement("path",{d:"M216,36H88a4,4,0,0,0-4,4V84H40a4,4,0,0,0-4,4V216a4,4,0,0,0,4,4H168a4,4,0,0,0,4-4V172h44a4,4,0,0,0,4-4V40A4,4,0,0,0,216,36ZM164,212H44V92H164Zm48-48H172V88a4,4,0,0,0-4-4H92V44H212Z"}))]]),kee=new Map([["bold",g.createElement(g.Fragment,null,g.createElement("path",{d:"M144,128a16,16,0,1,1-16-16A16,16,0,0,1,144,128ZM60,112a16,16,0,1,0,16,16A16,16,0,0,0,60,112Zm136,0a16,16,0,1,0,16,16A16,16,0,0,0,196,112Z"}))],["duotone",g.createElement(g.Fragment,null,g.createElement("path",{d:"M240,96v64a16,16,0,0,1-16,16H32a16,16,0,0,1-16-16V96A16,16,0,0,1,32,80H224A16,16,0,0,1,240,96Z",opacity:"0.2"}),g.createElement("path",{d:"M140,128a12,12,0,1,1-12-12A12,12,0,0,1,140,128Zm56-12a12,12,0,1,0,12,12A12,12,0,0,0,196,116ZM60,116a12,12,0,1,0,12,12A12,12,0,0,0,60,116Z"}))],["fill",g.createElement(g.Fragment,null,g.createElement("path",{d:"M224,80H32A16,16,0,0,0,16,96v64a16,16,0,0,0,16,16H224a16,16,0,0,0,16-16V96A16,16,0,0,0,224,80ZM60,140a12,12,0,1,1,12-12A12,12,0,0,1,60,140Zm68,0a12,12,0,1,1,12-12A12,12,0,0,1,128,140Zm68,0a12,12,0,1,1,12-12A12,12,0,0,1,196,140Z"}))],["light",g.createElement(g.Fragment,null,g.createElement("path",{d:"M138,128a10,10,0,1,1-10-10A10,10,0,0,1,138,128ZM60,118a10,10,0,1,0,10,10A10,10,0,0,0,60,118Zm136,0a10,10,0,1,0,10,10A10,10,0,0,0,196,118Z"}))],["regular",g.createElement(g.Fragment,null,g.createElement("path",{d:"M140,128a12,12,0,1,1-12-12A12,12,0,0,1,140,128Zm56-12a12,12,0,1,0,12,12A12,12,0,0,0,196,116ZM60,116a12,12,0,1,0,12,12A12,12,0,0,0,60,116Z"}))],["thin",g.createElement(g.Fragment,null,g.createElement("path",{d:"M136,128a8,8,0,1,1-8-8A8,8,0,0,1,136,128Zm-76-8a8,8,0,1,0,8,8A8,8,0,0,0,60,120Zm136,0a8,8,0,1,0,8,8A8,8,0,0,0,196,120Z"}))]]),Cee=new Map([["bold",g.createElement(g.Fragment,null,g.createElement("path",{d:"M248.23,112.31A20,20,0,0,0,232,104H220V88a20,20,0,0,0-20-20H132L105.34,48a20.12,20.12,0,0,0-12-4H40A20,20,0,0,0,20,64V208a12,12,0,0,0,12,12H211.1a12,12,0,0,0,11.33-8l28.49-81.47.06-.17A20,20,0,0,0,248.23,112.31ZM92,68l28.8,21.6A12,12,0,0,0,128,92h68v12H69.77a20,20,0,0,0-18.94,13.58L44,137.15V68ZM202.59,196H48.89l23.72-68H226.37Z"}))],["duotone",g.createElement(g.Fragment,null,g.createElement("path",{d:"M208,88v24H69.77a8,8,0,0,0-7.59,5.47L32,208V64a8,8,0,0,1,8-8H93.33a8,8,0,0,1,4.8,1.6L128,80h72A8,8,0,0,1,208,88Z",opacity:"0.2"}),g.createElement("path",{d:"M245,110.64A16,16,0,0,0,232,104H216V88a16,16,0,0,0-16-16H130.67L102.94,51.2a16.14,16.14,0,0,0-9.6-3.2H40A16,16,0,0,0,24,64V208a8,8,0,0,0,8,8H211.1a8,8,0,0,0,7.59-5.47l28.49-85.47A16.05,16.05,0,0,0,245,110.64ZM93.34,64,123.2,86.4A8,8,0,0,0,128,88h72v16H69.77a16,16,0,0,0-15.18,10.94L40,158.7V64Zm112,136H43.1l26.67-80H232Z"}))],["fill",g.createElement(g.Fragment,null,g.createElement("path",{d:"M245,110.64A16,16,0,0,0,232,104H216V88a16,16,0,0,0-16-16H130.67L102.94,51.2a16.14,16.14,0,0,0-9.6-3.2H40A16,16,0,0,0,24,64V208h0a8,8,0,0,0,8,8H211.1a8,8,0,0,0,7.59-5.47l28.49-85.47A16.05,16.05,0,0,0,245,110.64ZM93.34,64,123.2,86.4A8,8,0,0,0,128,88h72v16H69.77a16,16,0,0,0-15.18,10.94L40,158.7V64Z"}))],["light",g.createElement(g.Fragment,null,g.createElement("path",{d:"M243.36,111.81A14,14,0,0,0,232,106H214V88a14,14,0,0,0-14-14H130L101.74,52.8a14.06,14.06,0,0,0-8.4-2.8H40A14,14,0,0,0,26,64V208a6,6,0,0,0,6,6H211.1a6,6,0,0,0,5.69-4.1l28.49-85.47A14,14,0,0,0,243.36,111.81ZM40,62H93.34a2,2,0,0,1,1.2.4L124.4,84.8A6,6,0,0,0,128,86h72a2,2,0,0,1,2,2v18H69.77a14,14,0,0,0-13.28,9.57L38,171V64A2,2,0,0,1,40,62Zm193.9,58.63L206.78,202H40.33l27.54-82.63a2,2,0,0,1,1.9-1.37H232a2,2,0,0,1,1.9,2.63Z"}))],["regular",g.createElement(g.Fragment,null,g.createElement("path",{d:"M245,110.64A16,16,0,0,0,232,104H216V88a16,16,0,0,0-16-16H130.67L102.94,51.2a16.14,16.14,0,0,0-9.6-3.2H40A16,16,0,0,0,24,64V208h0a8,8,0,0,0,8,8H211.1a8,8,0,0,0,7.59-5.47l28.49-85.47A16.05,16.05,0,0,0,245,110.64ZM93.34,64,123.2,86.4A8,8,0,0,0,128,88h72v16H69.77a16,16,0,0,0-15.18,10.94L40,158.7V64Zm112,136H43.1l26.67-80H232Z"}))],["thin",g.createElement(g.Fragment,null,g.createElement("path",{d:"M241.72,113a11.88,11.88,0,0,0-9.73-5H212V88a12,12,0,0,0-12-12H129.33l-28.8-21.6a12.05,12.05,0,0,0-7.2-2.4H40A12,12,0,0,0,28,64V208a4,4,0,0,0,4,4H211.09a4,4,0,0,0,3.79-2.74l28.49-85.47A11.86,11.86,0,0,0,241.72,113ZM40,60H93.33a4,4,0,0,1,2.4.8L125.6,83.2a4,4,0,0,0,2.4.8h72a4,4,0,0,1,4,4v20H69.76a12,12,0,0,0-11.38,8.21L36,183.35V64A4,4,0,0,1,40,60Zm195.78,61.26L208.2,204H37.55L66,118.74A4,4,0,0,1,69.76,116H232a4,4,0,0,1,3.79,5.26Z"}))]]),Pee=new Map([["bold",g.createElement(g.Fragment,null,g.createElement("path",{d:"M216,68H132L105.33,48a20.12,20.12,0,0,0-12-4H40A20,20,0,0,0,20,64V200a20,20,0,0,0,20,20H216.89A19.13,19.13,0,0,0,236,200.89V88A20,20,0,0,0,216,68Zm-4,128H44V68H92l28.8,21.6A12,12,0,0,0,128,92h84Z"}))],["duotone",g.createElement(g.Fragment,null,g.createElement("path",{d:"M224,88V200.89a7.11,7.11,0,0,1-7.11,7.11H40a8,8,0,0,1-8-8V64a8,8,0,0,1,8-8H93.33a8,8,0,0,1,4.8,1.6L128,80h88A8,8,0,0,1,224,88Z",opacity:"0.2"}),g.createElement("path",{d:"M216,72H130.67L102.93,51.2a16.12,16.12,0,0,0-9.6-3.2H40A16,16,0,0,0,24,64V200a16,16,0,0,0,16,16H216.89A15.13,15.13,0,0,0,232,200.89V88A16,16,0,0,0,216,72Zm0,128H40V64H93.33L123.2,86.4A8,8,0,0,0,128,88h88Z"}))],["fill",g.createElement(g.Fragment,null,g.createElement("path",{d:"M232,88V200.89A15.13,15.13,0,0,1,216.89,216H40a16,16,0,0,1-16-16V64A16,16,0,0,1,40,48H93.33a16.12,16.12,0,0,1,9.6,3.2L130.67,72H216A16,16,0,0,1,232,88Z"}))],["light",g.createElement(g.Fragment,null,g.createElement("path",{d:"M216,74H130L101.73,52.8a14,14,0,0,0-8.4-2.8H40A14,14,0,0,0,26,64V200a14,14,0,0,0,14,14H216.89A13.12,13.12,0,0,0,230,200.89V88A14,14,0,0,0,216,74Zm2,126.89a1.11,1.11,0,0,1-1.11,1.11H40a2,2,0,0,1-2-2V64a2,2,0,0,1,2-2H93.33a2,2,0,0,1,1.2.4L124.4,84.8A6,6,0,0,0,128,86h88a2,2,0,0,1,2,2Z"}))],["regular",g.createElement(g.Fragment,null,g.createElement("path",{d:"M216,72H130.67L102.93,51.2a16.12,16.12,0,0,0-9.6-3.2H40A16,16,0,0,0,24,64V200a16,16,0,0,0,16,16H216.89A15.13,15.13,0,0,0,232,200.89V88A16,16,0,0,0,216,72Zm0,128H40V64H93.33L123.2,86.4A8,8,0,0,0,128,88h88Z"}))],["thin",g.createElement(g.Fragment,null,g.createElement("path",{d:"M216,76H129.33l-28.8-21.6a12.05,12.05,0,0,0-7.2-2.4H40A12,12,0,0,0,28,64V200a12,12,0,0,0,12,12H216.89A11.12,11.12,0,0,0,228,200.89V88A12,12,0,0,0,216,76Zm4,124.89a3.12,3.12,0,0,1-3.11,3.11H40a4,4,0,0,1-4-4V64a4,4,0,0,1,4-4H93.33a4,4,0,0,1,2.4.8L125.6,83.2a4,4,0,0,0,2.4.8h88a4,4,0,0,1,4,4Z"}))]]),Aee=new Map([["bold",g.createElement(g.Fragment,null,g.createElement("path",{d:"M224,84H180.2l7.61-41.85a12,12,0,0,0-23.62-4.3L155.8,84H116.2l7.61-41.85a12,12,0,1,0-23.62-4.3L91.8,84H48a12,12,0,0,0,0,24H87.44l-7.27,40H32a12,12,0,0,0,0,24H75.8l-7.61,41.85a12,12,0,0,0,9.66,14A11.43,11.43,0,0,0,80,228a12,12,0,0,0,11.8-9.86L100.2,172h39.6l-7.61,41.85a12,12,0,0,0,9.66,14,11.43,11.43,0,0,0,2.16.2,12,12,0,0,0,11.8-9.86L164.2,172H208a12,12,0,0,0,0-24H168.56l7.27-40H224a12,12,0,0,0,0-24Zm-79.83,64H104.56l7.27-40h39.61Z"}))],["duotone",g.createElement(g.Fragment,null,g.createElement("path",{d:"M165.82,96l-11.64,64h-64l11.64-64Z",opacity:"0.2"}),g.createElement("path",{d:"M224,88H175.4l8.47-46.57a8,8,0,0,0-15.74-2.86l-9,49.43H111.4l8.47-46.57a8,8,0,0,0-15.74-2.86L95.14,88H48a8,8,0,0,0,0,16H92.23L83.5,152H32a8,8,0,0,0,0,16H80.6l-8.47,46.57a8,8,0,0,0,6.44,9.3A7.79,7.79,0,0,0,80,224a8,8,0,0,0,7.86-6.57l9-49.43H144.6l-8.47,46.57a8,8,0,0,0,6.44,9.3A7.79,7.79,0,0,0,144,224a8,8,0,0,0,7.86-6.57l9-49.43H208a8,8,0,0,0,0-16H163.77l8.73-48H224a8,8,0,0,0,0-16Zm-76.5,64H99.77l8.73-48h47.73Z"}))],["fill",g.createElement(g.Fragment,null,g.createElement("path",{d:"M116.25,112h31.5l-8,32h-31.5ZM224,48V208a16,16,0,0,1-16,16H48a16,16,0,0,1-16-16V48A16,16,0,0,1,48,32H208A16,16,0,0,1,224,48Zm-16,56a8,8,0,0,0-8-8H168.25l7.51-30.06a8,8,0,0,0-15.52-3.88L151.75,96h-31.5l7.51-30.06a8,8,0,0,0-15.52-3.88L103.75,96H64a8,8,0,0,0,0,16H99.75l-8,32H56a8,8,0,0,0,0,16H87.75l-7.51,30.06a8,8,0,0,0,5.82,9.7,8.13,8.13,0,0,0,2,.24,8,8,0,0,0,7.75-6.06L104.25,160h31.5l-7.51,30.06a8,8,0,0,0,5.82,9.7A8.13,8.13,0,0,0,136,200a8,8,0,0,0,7.75-6.06L152.25,160H192a8,8,0,0,0,0-16H156.25l8-32H200A8,8,0,0,0,208,104Z"}))],["light",g.createElement(g.Fragment,null,g.createElement("path",{d:"M224,90H173l8.89-48.93a6,6,0,1,0-11.8-2.14L160.81,90H109l8.89-48.93a6,6,0,0,0-11.8-2.14L96.81,90H48a6,6,0,0,0,0,12H94.63l-9.46,52H32a6,6,0,0,0,0,12H83L74.1,214.93a6,6,0,0,0,4.83,7A5.64,5.64,0,0,0,80,222a6,6,0,0,0,5.89-4.93L95.19,166H147l-8.89,48.93a6,6,0,0,0,4.83,7,5.64,5.64,0,0,0,1.08.1,6,6,0,0,0,5.89-4.93L159.19,166H208a6,6,0,0,0,0-12H161.37l9.46-52H224a6,6,0,0,0,0-12Zm-74.83,64H97.37l9.46-52h51.8Z"}))],["regular",g.createElement(g.Fragment,null,g.createElement("path",{d:"M224,88H175.4l8.47-46.57a8,8,0,0,0-15.74-2.86l-9,49.43H111.4l8.47-46.57a8,8,0,0,0-15.74-2.86L95.14,88H48a8,8,0,0,0,0,16H92.23L83.5,152H32a8,8,0,0,0,0,16H80.6l-8.47,46.57a8,8,0,0,0,6.44,9.3A7.79,7.79,0,0,0,80,224a8,8,0,0,0,7.86-6.57l9-49.43H144.6l-8.47,46.57a8,8,0,0,0,6.44,9.3A7.79,7.79,0,0,0,144,224a8,8,0,0,0,7.86-6.57l9-49.43H208a8,8,0,0,0,0-16H163.77l8.73-48H224a8,8,0,0,0,0-16Zm-76.5,64H99.77l8.73-48h47.73Z"}))],["thin",g.createElement(g.Fragment,null,g.createElement("path",{d:"M224,92H170.61l9.33-51.28a4,4,0,1,0-7.88-1.44L162.48,92H106.61l9.33-51.28a4,4,0,1,0-7.88-1.44L98.48,92H48a4,4,0,0,0,0,8H97L86.84,156H32a4,4,0,0,0,0,8H85.39l-9.33,51.28a4,4,0,0,0,3.22,4.65A3.65,3.65,0,0,0,80,220a4,4,0,0,0,3.94-3.29L93.52,164h55.87l-9.33,51.28a4,4,0,0,0,3.22,4.65,3.65,3.65,0,0,0,.72.07,4,4,0,0,0,3.94-3.29L157.52,164H208a4,4,0,0,0,0-8H159l10.19-56H224a4,4,0,0,0,0-8Zm-73.16,64H95l10.19-56H161Z"}))]]),Tee=new Map([["bold",g.createElement(g.Fragment,null,g.createElement("path",{d:"M232.49,215.51,185,168a92.12,92.12,0,1,0-17,17l47.53,47.54a12,12,0,0,0,17-17ZM44,112a68,68,0,1,1,68,68A68.07,68.07,0,0,1,44,112Z"}))],["duotone",g.createElement(g.Fragment,null,g.createElement("path",{d:"M192,112a80,80,0,1,1-80-80A80,80,0,0,1,192,112Z",opacity:"0.2"}),g.createElement("path",{d:"M229.66,218.34,179.6,168.28a88.21,88.21,0,1,0-11.32,11.31l50.06,50.07a8,8,0,0,0,11.32-11.32ZM40,112a72,72,0,1,1,72,72A72.08,72.08,0,0,1,40,112Z"}))],["fill",g.createElement(g.Fragment,null,g.createElement("path",{d:"M168,112a56,56,0,1,1-56-56A56,56,0,0,1,168,112Zm61.66,117.66a8,8,0,0,1-11.32,0l-50.06-50.07a88,88,0,1,1,11.32-11.31l50.06,50.06A8,8,0,0,1,229.66,229.66ZM112,184a72,72,0,1,0-72-72A72.08,72.08,0,0,0,112,184Z"}))],["light",g.createElement(g.Fragment,null,g.createElement("path",{d:"M228.24,219.76l-51.38-51.38a86.15,86.15,0,1,0-8.48,8.48l51.38,51.38a6,6,0,0,0,8.48-8.48ZM38,112a74,74,0,1,1,74,74A74.09,74.09,0,0,1,38,112Z"}))],["regular",g.createElement(g.Fragment,null,g.createElement("path",{d:"M229.66,218.34l-50.07-50.06a88.11,88.11,0,1,0-11.31,11.31l50.06,50.07a8,8,0,0,0,11.32-11.32ZM40,112a72,72,0,1,1,72,72A72.08,72.08,0,0,1,40,112Z"}))],["thin",g.createElement(g.Fragment,null,g.createElement("path",{d:"M226.83,221.17l-52.7-52.7a84.1,84.1,0,1,0-5.66,5.66l52.7,52.7a4,4,0,0,0,5.66-5.66ZM36,112a76,76,0,1,1,76,76A76.08,76.08,0,0,1,36,112Z"}))]]),Ree=new Map([["bold",g.createElement(g.Fragment,null,g.createElement("path",{d:"M230.14,70.54,185.46,25.85a20,20,0,0,0-28.29,0L33.86,149.17A19.85,19.85,0,0,0,28,163.31V208a20,20,0,0,0,20,20H92.69a19.86,19.86,0,0,0,14.14-5.86L230.14,98.82a20,20,0,0,0,0-28.28ZM91,204H52V165l84-84,39,39ZM192,103,153,64l18.34-18.34,39,39Z"}))],["duotone",g.createElement(g.Fragment,null,g.createElement("path",{d:"M221.66,90.34,192,120,136,64l29.66-29.66a8,8,0,0,1,11.31,0L221.66,79A8,8,0,0,1,221.66,90.34Z",opacity:"0.2"}),g.createElement("path",{d:"M227.31,73.37,182.63,28.68a16,16,0,0,0-22.63,0L36.69,152A15.86,15.86,0,0,0,32,163.31V208a16,16,0,0,0,16,16H92.69A15.86,15.86,0,0,0,104,219.31L227.31,96a16,16,0,0,0,0-22.63ZM92.69,208H48V163.31l88-88L180.69,120ZM192,108.68,147.31,64l24-24L216,84.68Z"}))],["fill",g.createElement(g.Fragment,null,g.createElement("path",{d:"M227.31,73.37,182.63,28.68a16,16,0,0,0-22.63,0L36.69,152A15.86,15.86,0,0,0,32,163.31V208a16,16,0,0,0,16,16H92.69A15.86,15.86,0,0,0,104,219.31L227.31,96a16,16,0,0,0,0-22.63ZM192,108.68,147.31,64l24-24L216,84.68Z"}))],["light",g.createElement(g.Fragment,null,g.createElement("path",{d:"M225.9,74.78,181.21,30.09a14,14,0,0,0-19.8,0L38.1,153.41a13.94,13.94,0,0,0-4.1,9.9V208a14,14,0,0,0,14,14H92.69a13.94,13.94,0,0,0,9.9-4.1L225.9,94.58a14,14,0,0,0,0-19.8ZM94.1,209.41a2,2,0,0,1-1.41.59H48a2,2,0,0,1-2-2V163.31a2,2,0,0,1,.59-1.41L136,72.48,183.51,120ZM217.41,86.1,192,111.51,144.49,64,169.9,38.58a2,2,0,0,1,2.83,0l44.68,44.69a2,2,0,0,1,0,2.83Z"}))],["regular",g.createElement(g.Fragment,null,g.createElement("path",{d:"M227.31,73.37,182.63,28.68a16,16,0,0,0-22.63,0L36.69,152A15.86,15.86,0,0,0,32,163.31V208a16,16,0,0,0,16,16H92.69A15.86,15.86,0,0,0,104,219.31L227.31,96a16,16,0,0,0,0-22.63ZM92.69,208H48V163.31l88-88L180.69,120ZM192,108.68,147.31,64l24-24L216,84.68Z"}))],["thin",g.createElement(g.Fragment,null,g.createElement("path",{d:"M224.49,76.2,179.8,31.51a12,12,0,0,0-17,0L133.17,61.17h0L39.52,154.83A11.9,11.9,0,0,0,36,163.31V208a12,12,0,0,0,12,12H92.69a12,12,0,0,0,8.48-3.51L224.48,93.17a12,12,0,0,0,0-17Zm-129,134.63A4,4,0,0,1,92.69,212H48a4,4,0,0,1-4-4V163.31a4,4,0,0,1,1.17-2.83L136,69.65,186.34,120ZM218.83,87.51,192,114.34,141.66,64l26.82-26.83a4,4,0,0,1,5.66,0l44.69,44.68a4,4,0,0,1,0,5.66Z"}))]]),Iee=new Map([["bold",g.createElement(g.Fragment,null,g.createElement("path",{d:"M238.15,78.54,177.46,17.86a20,20,0,0,0-28.3,0L97.2,70c-12.43-3.33-36.68-5.72-61.74,14.5a20,20,0,0,0-1.6,29.73l45.46,45.47-39.8,39.8a12,12,0,0,0,17,17l39.8-39.81,45.47,45.46A20,20,0,0,0,155.91,228c.46,0,.93,0,1.4-.05A20,20,0,0,0,171.87,220c4.69-6.23,11-16.13,14.44-28s3.45-22.88.16-33.4l51.7-51.87A20,20,0,0,0,238.15,78.54Zm-74.26,68.79a12,12,0,0,0-2.23,13.84c3.43,6.86,6.9,21-6.28,40.65L54.08,100.53c21.09-14.59,39.53-6.64,41-6a11.67,11.67,0,0,0,13.81-2.29l54.43-54.61,55,55Z"}))],["duotone",g.createElement(g.Fragment,null,g.createElement("path",{d:"M229.66,98.34,172.39,155.8c11.46,22.93-1.72,45.86-10.11,57a8,8,0,0,1-12,.83L42.34,105.76A8,8,0,0,1,43,93.85c29.65-23.92,57.4-10,57.4-10l57.27-57.46a8,8,0,0,1,11.31,0L229.66,87A8,8,0,0,1,229.66,98.34Z",opacity:"0.2"}),g.createElement("path",{d:"M235.32,81.37,174.63,20.69a16,16,0,0,0-22.63,0L98.37,74.49c-10.66-3.34-35-7.37-60.4,13.14a16,16,0,0,0-1.29,23.78L85,159.71,42.34,202.34a8,8,0,0,0,11.32,11.32L96.29,171l48.29,48.29A16,16,0,0,0,155.9,224c.38,0,.75,0,1.13,0a15.93,15.93,0,0,0,11.64-6.33c19.64-26.1,17.75-47.32,13.19-60L235.33,104A16,16,0,0,0,235.32,81.37ZM224,92.69h0l-57.27,57.46a8,8,0,0,0-1.49,9.22c9.46,18.93-1.8,38.59-9.34,48.62L48,100.08c12.08-9.74,23.64-12.31,32.48-12.31A40.13,40.13,0,0,1,96.81,91a8,8,0,0,0,9.25-1.51L163.32,32,224,92.68Z"}))],["fill",g.createElement(g.Fragment,null,g.createElement("path",{d:"M235.33,104l-53.47,53.65c4.56,12.67,6.45,33.89-13.19,60A15.93,15.93,0,0,1,157,224c-.38,0-.75,0-1.13,0a16,16,0,0,1-11.32-4.69L96.29,171,53.66,213.66a8,8,0,0,1-11.32-11.32L85,159.71l-48.3-48.3A16,16,0,0,1,38,87.63c25.42-20.51,49.75-16.48,60.4-13.14L152,20.7a16,16,0,0,1,22.63,0l60.69,60.68A16,16,0,0,1,235.33,104Z"}))],["light",g.createElement(g.Fragment,null,g.createElement("path",{d:"M233.91,82.79,173.22,22.1a14,14,0,0,0-19.81,0L98.93,76.77c-9.52-3.25-34-8.34-59.71,12.41A14,14,0,0,0,38.1,110l49.71,49.71-44.05,44a6,6,0,1,0,8.48,8.48l44.05-44.05L146,217.89a14,14,0,0,0,9.9,4.11q.49,0,1,0a14,14,0,0,0,10.19-5.54c19.72-26.21,17.15-47.23,12.46-59.3l54.37-54.55A14,14,0,0,0,233.91,82.79ZM225.42,94.1h0l-57.27,57.46a6,6,0,0,0-1.11,6.92c9.94,19.88-1.71,40.32-9.54,50.72a2,2,0,0,1-3,.2L46.58,101.51a2,2,0,0,1,.18-3c12.5-10.09,24.5-12.76,33.7-12.76a42.13,42.13,0,0,1,17.25,3.41A6,6,0,0,0,104.64,88L161.9,30.59a2,2,0,0,1,2.83,0l60.69,60.68A2,2,0,0,1,225.42,94.1Z"}))],["regular",g.createElement(g.Fragment,null,g.createElement("path",{d:"M235.32,81.37,174.63,20.69a16,16,0,0,0-22.63,0L98.37,74.49c-10.66-3.34-35-7.37-60.4,13.14a16,16,0,0,0-1.29,23.78L85,159.71,42.34,202.34a8,8,0,0,0,11.32,11.32L96.29,171l48.29,48.29A16,16,0,0,0,155.9,224c.38,0,.75,0,1.13,0a15.93,15.93,0,0,0,11.64-6.33c19.64-26.1,17.75-47.32,13.19-60L235.33,104A16,16,0,0,0,235.32,81.37ZM224,92.69h0l-57.27,57.46a8,8,0,0,0-1.49,9.22c9.46,18.93-1.8,38.59-9.34,48.62L48,100.08c12.08-9.74,23.64-12.31,32.48-12.31A40.13,40.13,0,0,1,96.81,91a8,8,0,0,0,9.25-1.51L163.32,32,224,92.68Z"}))],["thin",g.createElement(g.Fragment,null,g.createElement("path",{d:"M232.49,84.2,171.8,23.51a12,12,0,0,0-17,0L99.45,79.07c-8.08-3-32.79-9.45-59,11.67a12,12,0,0,0-1,17.84l51.13,51.13L45.17,205.17a4,4,0,0,0,5.66,5.66l45.46-45.47,51.12,51.12A12,12,0,0,0,155.9,220c.28,0,.57,0,.85,0a12,12,0,0,0,8.73-4.74c19.83-26.36,16.51-47.18,11.71-58.57l55.3-55.49A12,12,0,0,0,232.49,84.2Zm-5.66,11.31h0L169.56,153a4,4,0,0,0-.75,4.61c10.43,20.85-1.62,42-9.73,52.83a4,4,0,0,1-6,.4L45.17,102.93a4,4,0,0,1,.33-6C58.44,86.53,70.86,83.74,80.44,83.74A43.9,43.9,0,0,1,98.6,87.38a4,4,0,0,0,4.62-.75l57.27-57.46a4,4,0,0,1,5.66,0l60.68,60.69A4,4,0,0,1,226.83,95.51Z"}))]]),Oee=new Map([["bold",g.createElement(g.Fragment,null,g.createElement("path",{d:"M216,36H40A20,20,0,0,0,20,56V200a20,20,0,0,0,20,20H216a20,20,0,0,0,20-20V56A20,20,0,0,0,216,36ZM44,60H76V196H44ZM212,196H100V60H212Z"}))],["duotone",g.createElement(g.Fragment,null,g.createElement("path",{d:"M88,48V208H40a8,8,0,0,1-8-8V56a8,8,0,0,1,8-8Z",opacity:"0.2"}),g.createElement("path",{d:"M216,40H40A16,16,0,0,0,24,56V200a16,16,0,0,0,16,16H216a16,16,0,0,0,16-16V56A16,16,0,0,0,216,40ZM40,56H80V200H40ZM216,200H96V56H216V200Z"}))],["fill",g.createElement(g.Fragment,null,g.createElement("path",{d:"M216,40H40A16,16,0,0,0,24,56V200a16,16,0,0,0,16,16H216a16,16,0,0,0,16-16V56A16,16,0,0,0,216,40Zm0,160H88V56H216V200Z"}))],["light",g.createElement(g.Fragment,null,g.createElement("path",{d:"M216,42H40A14,14,0,0,0,26,56V200a14,14,0,0,0,14,14H216a14,14,0,0,0,14-14V56A14,14,0,0,0,216,42ZM38,200V56a2,2,0,0,1,2-2H82V202H40A2,2,0,0,1,38,200Zm180,0a2,2,0,0,1-2,2H94V54H216a2,2,0,0,1,2,2Z"}))],["regular",g.createElement(g.Fragment,null,g.createElement("path",{d:"M216,40H40A16,16,0,0,0,24,56V200a16,16,0,0,0,16,16H216a16,16,0,0,0,16-16V56A16,16,0,0,0,216,40ZM40,56H80V200H40ZM216,200H96V56H216V200Z"}))],["thin",g.createElement(g.Fragment,null,g.createElement("path",{d:"M216,44H40A12,12,0,0,0,28,56V200a12,12,0,0,0,12,12H216a12,12,0,0,0,12-12V56A12,12,0,0,0,216,44ZM36,200V56a4,4,0,0,1,4-4H84V204H40A4,4,0,0,1,36,200Zm184,0a4,4,0,0,1-4,4H92V52H216a4,4,0,0,1,4,4Z"}))]]),Mee=new Map([["bold",g.createElement(g.Fragment,null,g.createElement("path",{d:"M144.49,136.49l-40,40a12,12,0,0,1-17-17L107,140H24a12,12,0,0,1,0-24h83L87.51,96.49a12,12,0,0,1,17-17l40,40A12,12,0,0,1,144.49,136.49ZM200,28H136a12,12,0,0,0,0,24h52V204H136a12,12,0,0,0,0,24h64a12,12,0,0,0,12-12V40A12,12,0,0,0,200,28Z"}))],["duotone",g.createElement(g.Fragment,null,g.createElement("path",{d:"M200,40V216H40a16,16,0,0,1-16-16V56A16,16,0,0,1,40,40Z",opacity:"0.2"}),g.createElement("path",{d:"M141.66,133.66l-40,40a8,8,0,0,1-11.32-11.32L116.69,136H24a8,8,0,0,1,0-16h92.69L90.34,93.66a8,8,0,0,1,11.32-11.32l40,40A8,8,0,0,1,141.66,133.66ZM200,32H136a8,8,0,0,0,0,16h56V208H136a8,8,0,0,0,0,16h64a8,8,0,0,0,8-8V40A8,8,0,0,0,200,32Z"}))],["fill",g.createElement(g.Fragment,null,g.createElement("path",{d:"M141.66,133.66l-40,40A8,8,0,0,1,88,168V136H24a8,8,0,0,1,0-16H88V88a8,8,0,0,1,13.66-5.66l40,40A8,8,0,0,1,141.66,133.66ZM200,32H136a8,8,0,0,0,0,16h56V208H136a8,8,0,0,0,0,16h64a8,8,0,0,0,8-8V40A8,8,0,0,0,200,32Z"}))],["light",g.createElement(g.Fragment,null,g.createElement("path",{d:"M140.24,132.24l-40,40a6,6,0,0,1-8.48-8.48L121.51,134H24a6,6,0,0,1,0-12h97.51L91.76,92.24a6,6,0,0,1,8.48-8.48l40,40A6,6,0,0,1,140.24,132.24ZM200,34H136a6,6,0,0,0,0,12h58V210H136a6,6,0,0,0,0,12h64a6,6,0,0,0,6-6V40A6,6,0,0,0,200,34Z"}))],["regular",g.createElement(g.Fragment,null,g.createElement("path",{d:"M141.66,133.66l-40,40a8,8,0,0,1-11.32-11.32L116.69,136H24a8,8,0,0,1,0-16h92.69L90.34,93.66a8,8,0,0,1,11.32-11.32l40,40A8,8,0,0,1,141.66,133.66ZM200,32H136a8,8,0,0,0,0,16h56V208H136a8,8,0,0,0,0,16h64a8,8,0,0,0,8-8V40A8,8,0,0,0,200,32Z"}))],["thin",g.createElement(g.Fragment,null,g.createElement("path",{d:"M138.83,130.83l-40,40a4,4,0,0,1-5.66-5.66L126.34,132H24a4,4,0,0,1,0-8H126.34L93.17,90.83a4,4,0,0,1,5.66-5.66l40,40A4,4,0,0,1,138.83,130.83ZM200,36H136a4,4,0,0,0,0,8h60V212H136a4,4,0,0,0,0,8h64a4,4,0,0,0,4-4V40A4,4,0,0,0,200,36Z"}))]]),Nee=new Map([["bold",g.createElement(g.Fragment,null,g.createElement("path",{d:"M124,216a12,12,0,0,1-12,12H48a12,12,0,0,1-12-12V40A12,12,0,0,1,48,28h64a12,12,0,0,1,0,24H60V204h52A12,12,0,0,1,124,216Zm108.49-96.49-40-40a12,12,0,0,0-17,17L195,116H112a12,12,0,0,0,0,24h83l-19.52,19.51a12,12,0,0,0,17,17l40-40A12,12,0,0,0,232.49,119.51Z"}))],["duotone",g.createElement(g.Fragment,null,g.createElement("path",{d:"M224,56V200a16,16,0,0,1-16,16H48V40H208A16,16,0,0,1,224,56Z",opacity:"0.2"}),g.createElement("path",{d:"M120,216a8,8,0,0,1-8,8H48a8,8,0,0,1-8-8V40a8,8,0,0,1,8-8h64a8,8,0,0,1,0,16H56V208h56A8,8,0,0,1,120,216Zm109.66-93.66-40-40a8,8,0,0,0-11.32,11.32L204.69,120H112a8,8,0,0,0,0,16h92.69l-26.35,26.34a8,8,0,0,0,11.32,11.32l40-40A8,8,0,0,0,229.66,122.34Z"}))],["fill",g.createElement(g.Fragment,null,g.createElement("path",{d:"M120,216a8,8,0,0,1-8,8H48a8,8,0,0,1-8-8V40a8,8,0,0,1,8-8h64a8,8,0,0,1,0,16H56V208h56A8,8,0,0,1,120,216Zm109.66-93.66-40-40A8,8,0,0,0,176,88v32H112a8,8,0,0,0,0,16h64v32a8,8,0,0,0,13.66,5.66l40-40A8,8,0,0,0,229.66,122.34Z"}))],["light",g.createElement(g.Fragment,null,g.createElement("path",{d:"M118,216a6,6,0,0,1-6,6H48a6,6,0,0,1-6-6V40a6,6,0,0,1,6-6h64a6,6,0,0,1,0,12H54V210h58A6,6,0,0,1,118,216Zm110.24-92.24-40-40a6,6,0,0,0-8.48,8.48L209.51,122H112a6,6,0,0,0,0,12h97.51l-29.75,29.76a6,6,0,1,0,8.48,8.48l40-40A6,6,0,0,0,228.24,123.76Z"}))],["regular",g.createElement(g.Fragment,null,g.createElement("path",{d:"M120,216a8,8,0,0,1-8,8H48a8,8,0,0,1-8-8V40a8,8,0,0,1,8-8h64a8,8,0,0,1,0,16H56V208h56A8,8,0,0,1,120,216Zm109.66-93.66-40-40a8,8,0,0,0-11.32,11.32L204.69,120H112a8,8,0,0,0,0,16h92.69l-26.35,26.34a8,8,0,0,0,11.32,11.32l40-40A8,8,0,0,0,229.66,122.34Z"}))],["thin",g.createElement(g.Fragment,null,g.createElement("path",{d:"M116,216a4,4,0,0,1-4,4H48a4,4,0,0,1-4-4V40a4,4,0,0,1,4-4h64a4,4,0,0,1,0,8H52V212h60A4,4,0,0,1,116,216Zm110.83-90.83-40-40a4,4,0,0,0-5.66,5.66L214.34,124H112a4,4,0,0,0,0,8H214.34l-33.17,33.17a4,4,0,0,0,5.66,5.66l40-40A4,4,0,0,0,226.83,125.17Z"}))]]),Lee=new Map([["bold",g.createElement(g.Fragment,null,g.createElement("path",{d:"M100,36H56A20,20,0,0,0,36,56v44a20,20,0,0,0,20,20h44a20,20,0,0,0,20-20V56A20,20,0,0,0,100,36ZM96,96H60V60H96ZM200,36H156a20,20,0,0,0-20,20v44a20,20,0,0,0,20,20h44a20,20,0,0,0,20-20V56A20,20,0,0,0,200,36Zm-4,60H160V60h36Zm-96,40H56a20,20,0,0,0-20,20v44a20,20,0,0,0,20,20h44a20,20,0,0,0,20-20V156A20,20,0,0,0,100,136Zm-4,60H60V160H96Zm104-60H156a20,20,0,0,0-20,20v44a20,20,0,0,0,20,20h44a20,20,0,0,0,20-20V156A20,20,0,0,0,200,136Zm-4,60H160V160h36Z"}))],["duotone",g.createElement(g.Fragment,null,g.createElement("path",{d:"M112,56v48a8,8,0,0,1-8,8H56a8,8,0,0,1-8-8V56a8,8,0,0,1,8-8h48A8,8,0,0,1,112,56Zm88-8H152a8,8,0,0,0-8,8v48a8,8,0,0,0,8,8h48a8,8,0,0,0,8-8V56A8,8,0,0,0,200,48Zm-96,96H56a8,8,0,0,0-8,8v48a8,8,0,0,0,8,8h48a8,8,0,0,0,8-8V152A8,8,0,0,0,104,144Zm96,0H152a8,8,0,0,0-8,8v48a8,8,0,0,0,8,8h48a8,8,0,0,0,8-8V152A8,8,0,0,0,200,144Z",opacity:"0.2"}),g.createElement("path",{d:"M200,136H152a16,16,0,0,0-16,16v48a16,16,0,0,0,16,16h48a16,16,0,0,0,16-16V152A16,16,0,0,0,200,136Zm0,64H152V152h48v48ZM104,40H56A16,16,0,0,0,40,56v48a16,16,0,0,0,16,16h48a16,16,0,0,0,16-16V56A16,16,0,0,0,104,40Zm0,64H56V56h48v48Zm96-64H152a16,16,0,0,0-16,16v48a16,16,0,0,0,16,16h48a16,16,0,0,0,16-16V56A16,16,0,0,0,200,40Zm0,64H152V56h48v48Zm-96,32H56a16,16,0,0,0-16,16v48a16,16,0,0,0,16,16h48a16,16,0,0,0,16-16V152A16,16,0,0,0,104,136Zm0,64H56V152h48v48Z"}))],["fill",g.createElement(g.Fragment,null,g.createElement("path",{d:"M120,56v48a16,16,0,0,1-16,16H56a16,16,0,0,1-16-16V56A16,16,0,0,1,56,40h48A16,16,0,0,1,120,56Zm80-16H152a16,16,0,0,0-16,16v48a16,16,0,0,0,16,16h48a16,16,0,0,0,16-16V56A16,16,0,0,0,200,40Zm-96,96H56a16,16,0,0,0-16,16v48a16,16,0,0,0,16,16h48a16,16,0,0,0,16-16V152A16,16,0,0,0,104,136Zm96,0H152a16,16,0,0,0-16,16v48a16,16,0,0,0,16,16h48a16,16,0,0,0,16-16V152A16,16,0,0,0,200,136Z"}))],["light",g.createElement(g.Fragment,null,g.createElement("path",{d:"M104,42H56A14,14,0,0,0,42,56v48a14,14,0,0,0,14,14h48a14,14,0,0,0,14-14V56A14,14,0,0,0,104,42Zm2,62a2,2,0,0,1-2,2H56a2,2,0,0,1-2-2V56a2,2,0,0,1,2-2h48a2,2,0,0,1,2,2Zm94-62H152a14,14,0,0,0-14,14v48a14,14,0,0,0,14,14h48a14,14,0,0,0,14-14V56A14,14,0,0,0,200,42Zm2,62a2,2,0,0,1-2,2H152a2,2,0,0,1-2-2V56a2,2,0,0,1,2-2h48a2,2,0,0,1,2,2Zm-98,34H56a14,14,0,0,0-14,14v48a14,14,0,0,0,14,14h48a14,14,0,0,0,14-14V152A14,14,0,0,0,104,138Zm2,62a2,2,0,0,1-2,2H56a2,2,0,0,1-2-2V152a2,2,0,0,1,2-2h48a2,2,0,0,1,2,2Zm94-62H152a14,14,0,0,0-14,14v48a14,14,0,0,0,14,14h48a14,14,0,0,0,14-14V152A14,14,0,0,0,200,138Zm2,62a2,2,0,0,1-2,2H152a2,2,0,0,1-2-2V152a2,2,0,0,1,2-2h48a2,2,0,0,1,2,2Z"}))],["regular",g.createElement(g.Fragment,null,g.createElement("path",{d:"M104,40H56A16,16,0,0,0,40,56v48a16,16,0,0,0,16,16h48a16,16,0,0,0,16-16V56A16,16,0,0,0,104,40Zm0,64H56V56h48v48Zm96-64H152a16,16,0,0,0-16,16v48a16,16,0,0,0,16,16h48a16,16,0,0,0,16-16V56A16,16,0,0,0,200,40Zm0,64H152V56h48v48Zm-96,32H56a16,16,0,0,0-16,16v48a16,16,0,0,0,16,16h48a16,16,0,0,0,16-16V152A16,16,0,0,0,104,136Zm0,64H56V152h48v48Zm96-64H152a16,16,0,0,0-16,16v48a16,16,0,0,0,16,16h48a16,16,0,0,0,16-16V152A16,16,0,0,0,200,136Zm0,64H152V152h48v48Z"}))],["thin",g.createElement(g.Fragment,null,g.createElement("path",{d:"M104,44H56A12,12,0,0,0,44,56v48a12,12,0,0,0,12,12h48a12,12,0,0,0,12-12V56A12,12,0,0,0,104,44Zm4,60a4,4,0,0,1-4,4H56a4,4,0,0,1-4-4V56a4,4,0,0,1,4-4h48a4,4,0,0,1,4,4Zm92-60H152a12,12,0,0,0-12,12v48a12,12,0,0,0,12,12h48a12,12,0,0,0,12-12V56A12,12,0,0,0,200,44Zm4,60a4,4,0,0,1-4,4H152a4,4,0,0,1-4-4V56a4,4,0,0,1,4-4h48a4,4,0,0,1,4,4ZM104,140H56a12,12,0,0,0-12,12v48a12,12,0,0,0,12,12h48a12,12,0,0,0,12-12V152A12,12,0,0,0,104,140Zm4,60a4,4,0,0,1-4,4H56a4,4,0,0,1-4-4V152a4,4,0,0,1,4-4h48a4,4,0,0,1,4,4Zm92-60H152a12,12,0,0,0-12,12v48a12,12,0,0,0,12,12h48a12,12,0,0,0,12-12V152A12,12,0,0,0,200,140Zm4,60a4,4,0,0,1-4,4H152a4,4,0,0,1-4-4V152a4,4,0,0,1,4-4h48a4,4,0,0,1,4,4Z"}))]]),$ee=new Map([["bold",g.createElement(g.Fragment,null,g.createElement("path",{d:"M242.79,149.32,223.7,97.11A20,20,0,0,0,198.12,85.2l-61.31,22.22L147.7,45.18A20,20,0,0,0,131.55,22L76.87,12.31A19.94,19.94,0,0,0,53.76,28.55l-25,143.13A48,48,0,0,0,67.4,227.26a51.19,51.19,0,0,0,8.7.74H224a20,20,0,0,0,20-20V156.19A21.74,21.74,0,0,0,242.79,149.32ZM99,184.18a23.84,23.84,0,0,1-9.86,15.56,23.28,23.28,0,0,1-17.56,3.89,24,24,0,0,1-19.23-27.82L76.71,36.66,123.37,45,99,184.18Zm23.64,4.13,9.39-53.64,70.49-25.54,16.3,44.59-96.23,34.87C122.62,188.5,122.65,188.41,122.66,188.31ZM220,204H150.52L220,178.82ZM89.22,174.07l-1.4,8A12,12,0,0,1,76,192a12.35,12.35,0,0,1-2.08-.18,12,12,0,0,1-9.75-13.89l1.4-8a12,12,0,0,1,23.64,4.14Z"}))],["duotone",g.createElement(g.Fragment,null,g.createElement("path",{d:"M135.88,43.11l-25,143.14a35.71,35.71,0,0,1-41.34,29.2h0a36,36,0,0,1-28.95-41.71l25-143.13a8,8,0,0,1,9.19-6.49l54.67,9.73A8,8,0,0,1,135.88,43.11Z",opacity:"0.2"}),g.createElement("path",{d:"M88,180a12,12,0,1,1-12-12A12,12,0,0,1,88,180Zm152-23.81V208a16,16,0,0,1-16,16H76a46.36,46.36,0,0,1-7.94-.68,44,44,0,0,1-35.43-50.95l25-143.13a15.94,15.94,0,0,1,18.47-13L130.84,26a16,16,0,0,1,12.92,18.52l-12.08,69L199.49,89a16,16,0,0,1,20.45,9.52L239,150.69A18.35,18.35,0,0,1,240,156.19ZM103,184.87,128,41.74,73.46,32l-25,143.1A28,28,0,0,0,70.9,207.57,27.29,27.29,0,0,0,91.46,203,27.84,27.84,0,0,0,103,184.87ZM116.78,195,224,156.11,204.92,104,128.5,131.7l-9.78,55.92A44.63,44.63,0,0,1,116.78,195ZM224,173.12,127.74,208H224Z"}))],["fill",g.createElement(g.Fragment,null,g.createElement("path",{d:"M240,155.91a16,16,0,0,0-1-5.22L219.94,98.48A16,16,0,0,0,199.49,89l-67.81,24.57,12.08-69A16,16,0,0,0,130.84,26L76.17,16.25a15.94,15.94,0,0,0-18.47,13l-25,143.12A43.82,43.82,0,0,0,75.78,224H224a16,16,0,0,0,16-16ZM76,196a16,16,0,1,1,16-16A16,16,0,0,1,76,196Zm42.72-8.38,9.78-55.92L204.92,104,224,156.11,116.78,195A44.89,44.89,0,0,0,118.72,187.62ZM224,208H127.74L224,173.11Z"}))],["light",g.createElement(g.Fragment,null,g.createElement("path",{d:"M86,180a10,10,0,1,1-10-10A10,10,0,0,1,86,180Zm152-23.81V208a14,14,0,0,1-14,14H76a44.18,44.18,0,0,1-7.58-.65,42,42,0,0,1-33.81-48.64l25-143.13A13.94,13.94,0,0,1,75.82,18.22l54.67,9.72a14,14,0,0,1,11.3,16.21l-12.67,72.44,71-25.75a14,14,0,0,1,17.89,8.32l19.09,52.22A15.66,15.66,0,0,1,238,156.19Zm-133.07,29L130,42.08a2,2,0,0,0-1.58-2.32L73.72,30l-.34,0a1.84,1.84,0,0,0-1.07.35,2,2,0,0,0-.82,1.3l-25,143.13a30,30,0,0,0,24.09,34.76,29.25,29.25,0,0,0,22-4.89,29.81,29.81,0,0,0,12.33-19.44Zm8.25,13.17L224.71,158a2,2,0,0,0,1.11-1,1.86,1.86,0,0,0,.06-1.46l-19.09-52.21a2,2,0,0,0-2.53-1.17l-77.53,28.09-10,57.07A41.9,41.9,0,0,1,113.18,198.38ZM226,170.27,116.35,210H224a2,2,0,0,0,2-2Z"}))],["regular",g.createElement(g.Fragment,null,g.createElement("path",{d:"M88,180a12,12,0,1,1-12-12A12,12,0,0,1,88,180Zm152-23.81V208a16,16,0,0,1-16,16H76a46.36,46.36,0,0,1-7.94-.68,44,44,0,0,1-35.43-50.95l25-143.13a15.94,15.94,0,0,1,18.47-13L130.84,26a16,16,0,0,1,12.92,18.52l-12.08,69L199.49,89a16,16,0,0,1,20.45,9.52L239,150.69A18.35,18.35,0,0,1,240,156.19ZM103,184.87,128,41.74,73.46,32l-25,143.1A28,28,0,0,0,70.9,207.57,27.29,27.29,0,0,0,91.46,203,27.84,27.84,0,0,0,103,184.87ZM116.78,195,224,156.11,204.92,104,128.5,131.7l-9.78,55.92A44.63,44.63,0,0,1,116.78,195ZM224,173.12,127.74,208H224Z"}))],["thin",g.createElement(g.Fragment,null,g.createElement("path",{d:"M235.27,152.07,216.19,99.85a12,12,0,0,0-15.34-7.13l-74.3,26.92,13.27-75.83a12,12,0,0,0-9.68-13.9L75.47,20.19a11.75,11.75,0,0,0-8.89,2,11.9,11.9,0,0,0-4.94,7.77l-25,143.13A40,40,0,0,0,68.8,219.39,42.68,42.68,0,0,0,76,220H224a12,12,0,0,0,12-12V156.19A14,14,0,0,0,235.27,152.07Zm-31.7-51.83a4,4,0,0,1,5.1,2.36l19.09,52.21a3.9,3.9,0,0,1-.13,3,3.94,3.94,0,0,1-2.24,2L108.78,202.11a40,40,0,0,0,6-15.17L125,128.73ZM93.75,206.29a31.25,31.25,0,0,1-23.55,5.22,32,32,0,0,1-25.71-37.08l25-143.13a4,4,0,0,1,1.64-2.59A3.85,3.85,0,0,1,73.38,28a4,4,0,0,1,.69.06l54.67,9.73a4,4,0,0,1,3.2,4.64l-25,143.13h0A31.79,31.79,0,0,1,93.75,206.29ZM228,208a4,4,0,0,1-4,4H105l123-44.59ZM84,180a8,8,0,1,1-8-8A8,8,0,0,1,84,180Z"}))]]),Dee=new Map([["bold",g.createElement(g.Fragment,null,g.createElement("path",{d:"M216,48H180V36A28,28,0,0,0,152,8H104A28,28,0,0,0,76,36V48H40a12,12,0,0,0,0,24h4V208a20,20,0,0,0,20,20H192a20,20,0,0,0,20-20V72h4a12,12,0,0,0,0-24ZM100,36a4,4,0,0,1,4-4h48a4,4,0,0,1,4,4V48H100Zm88,168H68V72H188ZM116,104v64a12,12,0,0,1-24,0V104a12,12,0,0,1,24,0Zm48,0v64a12,12,0,0,1-24,0V104a12,12,0,0,1,24,0Z"}))],["duotone",g.createElement(g.Fragment,null,g.createElement("path",{d:"M200,56V208a8,8,0,0,1-8,8H64a8,8,0,0,1-8-8V56Z",opacity:"0.2"}),g.createElement("path",{d:"M216,48H176V40a24,24,0,0,0-24-24H104A24,24,0,0,0,80,40v8H40a8,8,0,0,0,0,16h8V208a16,16,0,0,0,16,16H192a16,16,0,0,0,16-16V64h8a8,8,0,0,0,0-16ZM96,40a8,8,0,0,1,8-8h48a8,8,0,0,1,8,8v8H96Zm96,168H64V64H192ZM112,104v64a8,8,0,0,1-16,0V104a8,8,0,0,1,16,0Zm48,0v64a8,8,0,0,1-16,0V104a8,8,0,0,1,16,0Z"}))],["fill",g.createElement(g.Fragment,null,g.createElement("path",{d:"M216,48H176V40a24,24,0,0,0-24-24H104A24,24,0,0,0,80,40v8H40a8,8,0,0,0,0,16h8V208a16,16,0,0,0,16,16H192a16,16,0,0,0,16-16V64h8a8,8,0,0,0,0-16ZM112,168a8,8,0,0,1-16,0V104a8,8,0,0,1,16,0Zm48,0a8,8,0,0,1-16,0V104a8,8,0,0,1,16,0Zm0-120H96V40a8,8,0,0,1,8-8h48a8,8,0,0,1,8,8Z"}))],["light",g.createElement(g.Fragment,null,g.createElement("path",{d:"M216,50H174V40a22,22,0,0,0-22-22H104A22,22,0,0,0,82,40V50H40a6,6,0,0,0,0,12H50V208a14,14,0,0,0,14,14H192a14,14,0,0,0,14-14V62h10a6,6,0,0,0,0-12ZM94,40a10,10,0,0,1,10-10h48a10,10,0,0,1,10,10V50H94ZM194,208a2,2,0,0,1-2,2H64a2,2,0,0,1-2-2V62H194ZM110,104v64a6,6,0,0,1-12,0V104a6,6,0,0,1,12,0Zm48,0v64a6,6,0,0,1-12,0V104a6,6,0,0,1,12,0Z"}))],["regular",g.createElement(g.Fragment,null,g.createElement("path",{d:"M216,48H176V40a24,24,0,0,0-24-24H104A24,24,0,0,0,80,40v8H40a8,8,0,0,0,0,16h8V208a16,16,0,0,0,16,16H192a16,16,0,0,0,16-16V64h8a8,8,0,0,0,0-16ZM96,40a8,8,0,0,1,8-8h48a8,8,0,0,1,8,8v8H96Zm96,168H64V64H192ZM112,104v64a8,8,0,0,1-16,0V104a8,8,0,0,1,16,0Zm48,0v64a8,8,0,0,1-16,0V104a8,8,0,0,1,16,0Z"}))],["thin",g.createElement(g.Fragment,null,g.createElement("path",{d:"M216,52H172V40a20,20,0,0,0-20-20H104A20,20,0,0,0,84,40V52H40a4,4,0,0,0,0,8H52V208a12,12,0,0,0,12,12H192a12,12,0,0,0,12-12V60h12a4,4,0,0,0,0-8ZM92,40a12,12,0,0,1,12-12h48a12,12,0,0,1,12,12V52H92ZM196,208a4,4,0,0,1-4,4H64a4,4,0,0,1-4-4V60H196ZM108,104v64a4,4,0,0,1-8,0V104a4,4,0,0,1,8,0Zm48,0v64a4,4,0,0,1-8,0V104a4,4,0,0,1,8,0Z"}))]]),Fee=new Map([["bold",g.createElement(g.Fragment,null,g.createElement("path",{d:"M234.38,210a123.36,123.36,0,0,0-60.78-53.23,76,76,0,1,0-91.2,0A123.36,123.36,0,0,0,21.62,210a12,12,0,1,0,20.77,12c18.12-31.32,50.12-50,85.61-50s67.49,18.69,85.61,50a12,12,0,0,0,20.77-12ZM76,96a52,52,0,1,1,52,52A52.06,52.06,0,0,1,76,96Z"}))],["duotone",g.createElement(g.Fragment,null,g.createElement("path",{d:"M192,96a64,64,0,1,1-64-64A64,64,0,0,1,192,96Z",opacity:"0.2"}),g.createElement("path",{d:"M230.92,212c-15.23-26.33-38.7-45.21-66.09-54.16a72,72,0,1,0-73.66,0C63.78,166.78,40.31,185.66,25.08,212a8,8,0,1,0,13.85,8c18.84-32.56,52.14-52,89.07-52s70.23,19.44,89.07,52a8,8,0,1,0,13.85-8ZM72,96a56,56,0,1,1,56,56A56.06,56.06,0,0,1,72,96Z"}))],["fill",g.createElement(g.Fragment,null,g.createElement("path",{d:"M230.93,220a8,8,0,0,1-6.93,4H32a8,8,0,0,1-6.92-12c15.23-26.33,38.7-45.21,66.09-54.16a72,72,0,1,1,73.66,0c27.39,8.95,50.86,27.83,66.09,54.16A8,8,0,0,1,230.93,220Z"}))],["light",g.createElement(g.Fragment,null,g.createElement("path",{d:"M229.19,213c-15.81-27.32-40.63-46.49-69.47-54.62a70,70,0,1,0-63.44,0C67.44,166.5,42.62,185.67,26.81,213a6,6,0,1,0,10.38,6C56.4,185.81,90.34,166,128,166s71.6,19.81,90.81,53a6,6,0,1,0,10.38-6ZM70,96a58,58,0,1,1,58,58A58.07,58.07,0,0,1,70,96Z"}))],["regular",g.createElement(g.Fragment,null,g.createElement("path",{d:"M230.92,212c-15.23-26.33-38.7-45.21-66.09-54.16a72,72,0,1,0-73.66,0C63.78,166.78,40.31,185.66,25.08,212a8,8,0,1,0,13.85,8c18.84-32.56,52.14-52,89.07-52s70.23,19.44,89.07,52a8,8,0,1,0,13.85-8ZM72,96a56,56,0,1,1,56,56A56.06,56.06,0,0,1,72,96Z"}))],["thin",g.createElement(g.Fragment,null,g.createElement("path",{d:"M227.46,214c-16.52-28.56-43-48.06-73.68-55.09a68,68,0,1,0-51.56,0c-30.64,7-57.16,26.53-73.68,55.09a4,4,0,0,0,6.92,4C55,184.19,89.62,164,128,164s73,20.19,92.54,54a4,4,0,0,0,3.46,2,3.93,3.93,0,0,0,2-.54A4,4,0,0,0,227.46,214ZM68,96a60,60,0,1,1,60,60A60.07,60.07,0,0,1,68,96Z"}))]]),jee=new Map([["bold",g.createElement(g.Fragment,null,g.createElement("path",{d:"M128,20A108,108,0,1,0,236,128,108.12,108.12,0,0,0,128,20Zm0,192a84,84,0,1,1,84-84A84.09,84.09,0,0,1,128,212Zm-12-80V80a12,12,0,0,1,24,0v52a12,12,0,0,1-24,0Zm28,40a16,16,0,1,1-16-16A16,16,0,0,1,144,172Z"}))],["duotone",g.createElement(g.Fragment,null,g.createElement("path",{d:"M224,128a96,96,0,1,1-96-96A96,96,0,0,1,224,128Z",opacity:"0.2"}),g.createElement("path",{d:"M128,24A104,104,0,1,0,232,128,104.11,104.11,0,0,0,128,24Zm0,192a88,88,0,1,1,88-88A88.1,88.1,0,0,1,128,216Zm-8-80V80a8,8,0,0,1,16,0v56a8,8,0,0,1-16,0Zm20,36a12,12,0,1,1-12-12A12,12,0,0,1,140,172Z"}))],["fill",g.createElement(g.Fragment,null,g.createElement("path",{d:"M128,24A104,104,0,1,0,232,128,104.11,104.11,0,0,0,128,24Zm-8,56a8,8,0,0,1,16,0v56a8,8,0,0,1-16,0Zm8,104a12,12,0,1,1,12-12A12,12,0,0,1,128,184Z"}))],["light",g.createElement(g.Fragment,null,g.createElement("path",{d:"M128,26A102,102,0,1,0,230,128,102.12,102.12,0,0,0,128,26Zm0,192a90,90,0,1,1,90-90A90.1,90.1,0,0,1,128,218Zm-6-82V80a6,6,0,0,1,12,0v56a6,6,0,0,1-12,0Zm16,36a10,10,0,1,1-10-10A10,10,0,0,1,138,172Z"}))],["regular",g.createElement(g.Fragment,null,g.createElement("path",{d:"M128,24A104,104,0,1,0,232,128,104.11,104.11,0,0,0,128,24Zm0,192a88,88,0,1,1,88-88A88.1,88.1,0,0,1,128,216Zm-8-80V80a8,8,0,0,1,16,0v56a8,8,0,0,1-16,0Zm20,36a12,12,0,1,1-12-12A12,12,0,0,1,140,172Z"}))],["thin",g.createElement(g.Fragment,null,g.createElement("path",{d:"M128,28A100,100,0,1,0,228,128,100.11,100.11,0,0,0,128,28Zm0,192a92,92,0,1,1,92-92A92.1,92.1,0,0,1,128,220Zm-4-84V80a4,4,0,0,1,8,0v56a4,4,0,0,1-8,0Zm12,36a8,8,0,1,1-8-8A8,8,0,0,1,136,172Z"}))]]),zee=new Map([["bold",g.createElement(g.Fragment,null,g.createElement("path",{d:"M208.49,191.51a12,12,0,0,1-17,17L128,145,64.49,208.49a12,12,0,0,1-17-17L111,128,47.51,64.49a12,12,0,0,1,17-17L128,111l63.51-63.52a12,12,0,0,1,17,17L145,128Z"}))],["duotone",g.createElement(g.Fragment,null,g.createElement("path",{d:"M216,56V200a16,16,0,0,1-16,16H56a16,16,0,0,1-16-16V56A16,16,0,0,1,56,40H200A16,16,0,0,1,216,56Z",opacity:"0.2"}),g.createElement("path",{d:"M205.66,194.34a8,8,0,0,1-11.32,11.32L128,139.31,61.66,205.66a8,8,0,0,1-11.32-11.32L116.69,128,50.34,61.66A8,8,0,0,1,61.66,50.34L128,116.69l66.34-66.35a8,8,0,0,1,11.32,11.32L139.31,128Z"}))],["fill",g.createElement(g.Fragment,null,g.createElement("path",{d:"M208,32H48A16,16,0,0,0,32,48V208a16,16,0,0,0,16,16H208a16,16,0,0,0,16-16V48A16,16,0,0,0,208,32ZM181.66,170.34a8,8,0,0,1-11.32,11.32L128,139.31,85.66,181.66a8,8,0,0,1-11.32-11.32L116.69,128,74.34,85.66A8,8,0,0,1,85.66,74.34L128,116.69l42.34-42.35a8,8,0,0,1,11.32,11.32L139.31,128Z"}))],["light",g.createElement(g.Fragment,null,g.createElement("path",{d:"M204.24,195.76a6,6,0,1,1-8.48,8.48L128,136.49,60.24,204.24a6,6,0,0,1-8.48-8.48L119.51,128,51.76,60.24a6,6,0,0,1,8.48-8.48L128,119.51l67.76-67.75a6,6,0,0,1,8.48,8.48L136.49,128Z"}))],["regular",g.createElement(g.Fragment,null,g.createElement("path",{d:"M205.66,194.34a8,8,0,0,1-11.32,11.32L128,139.31,61.66,205.66a8,8,0,0,1-11.32-11.32L116.69,128,50.34,61.66A8,8,0,0,1,61.66,50.34L128,116.69l66.34-66.35a8,8,0,0,1,11.32,11.32L139.31,128Z"}))],["thin",g.createElement(g.Fragment,null,g.createElement("path",{d:"M202.83,197.17a4,4,0,0,1-5.66,5.66L128,133.66,58.83,202.83a4,4,0,0,1-5.66-5.66L122.34,128,53.17,58.83a4,4,0,0,1,5.66-5.66L128,122.34l69.17-69.17a4,4,0,1,1,5.66,5.66L133.66,128Z"}))]]),Vee=new Map([["bold",g.createElement(g.Fragment,null,g.createElement("path",{d:"M218.12,209.56l-61-95.8,59.72-65.69a12,12,0,0,0-17.76-16.14L143.81,92.77,106.12,33.56A12,12,0,0,0,96,28H48A12,12,0,0,0,37.88,46.44l61,95.8L39.12,207.93a12,12,0,1,0,17.76,16.14l55.31-60.84,37.69,59.21A12,12,0,0,0,160,228h48a12,12,0,0,0,10.12-18.44ZM166.59,204,69.86,52H89.41l96.73,152Z"}))],["duotone",g.createElement(g.Fragment,null,g.createElement("path",{d:"M208,216H160L48,40H96Z",opacity:"0.2"}),g.createElement("path",{d:"M214.75,211.71l-62.6-98.38,61.77-67.95a8,8,0,0,0-11.84-10.76L143.24,99.34,102.75,35.71A8,8,0,0,0,96,32H48a8,8,0,0,0-6.75,12.3l62.6,98.37-61.77,68a8,8,0,1,0,11.84,10.76l58.84-64.72,40.49,63.63A8,8,0,0,0,160,224h48a8,8,0,0,0,6.75-12.29ZM164.39,208,62.57,48h29L193.43,208Z"}))],["fill",g.createElement(g.Fragment,null,g.createElement("path",{d:"M215,219.85a8,8,0,0,1-7,4.15H160a8,8,0,0,1-6.75-3.71l-40.49-63.63L53.92,221.38a8,8,0,0,1-11.84-10.76l61.77-68L41.25,44.3A8,8,0,0,1,48,32H96a8,8,0,0,1,6.75,3.71l40.49,63.63,58.84-64.72a8,8,0,0,1,11.84,10.76l-61.77,67.95,62.6,98.38A8,8,0,0,1,215,219.85Z"}))],["light",g.createElement(g.Fragment,null,g.createElement("path",{d:"M213.06,212.78l-63.42-99.66L212.44,44A6,6,0,1,0,203.56,36L143,102.62l-41.9-65.84A6,6,0,0,0,96,34H48a6,6,0,0,0-5.06,9.22l63.42,99.66L43.56,212A6,6,0,0,0,52.44,220L113,153.38l41.9,65.84A6,6,0,0,0,160,222h48a6,6,0,0,0,5.06-9.22ZM163.29,210,58.93,46H92.71L197.07,210Z"}))],["regular",g.createElement(g.Fragment,null,g.createElement("path",{d:"M214.75,211.71l-62.6-98.38,61.77-67.95a8,8,0,0,0-11.84-10.76L143.24,99.34,102.75,35.71A8,8,0,0,0,96,32H48a8,8,0,0,0-6.75,12.3l62.6,98.37-61.77,68a8,8,0,1,0,11.84,10.76l58.84-64.72,40.49,63.63A8,8,0,0,0,160,224h48a8,8,0,0,0,6.75-12.29ZM164.39,208,62.57,48h29L193.43,208Z"}))],["thin",g.createElement(g.Fragment,null,g.createElement("path",{d:"M211.37,213.85,147.13,112.9,211,42.69A4,4,0,0,0,205,37.31L142.68,105.9,99.38,37.85A4,4,0,0,0,96,36H48a4,4,0,0,0-3.37,6.15L108.87,143.1,45,213.31A4,4,0,1,0,51,218.69l62.36-68.59,43.3,68.05A4,4,0,0,0,160,220h48a4,4,0,0,0,3.37-6.15ZM162.2,212,55.29,44H93.8L200.71,212Z"}))]]),Hee=g.createContext({color:"currentColor",size:"1em",weight:"regular",mirrored:!1}),An=g.forwardRef((e,t)=>{const{alt:n,color:r,size:s,weight:i,mirrored:o,children:c,weights:u,...d}=e,{color:f="currentColor",size:p,weight:m="regular",mirrored:v=!1,..._}=g.useContext(Hee);return g.createElement("svg",{ref:t,xmlns:"http://www.w3.org/2000/svg",width:s??p,height:s??p,fill:r??f,viewBox:"0 0 256 256",transform:o||v?"scale(-1, 1)":void 0,..._,...d},!!n&&g.createElement("title",null,n),c,u.get(i??m))});An.displayName="IconBase";const pL=g.forwardRef((e,t)=>g.createElement(An,{ref:t,...e,weights:yee}));pL.displayName="ArrowUpIcon";const Uee=pL,mL=g.forwardRef((e,t)=>g.createElement(An,{ref:t,...e,weights:_ee}));mL.displayName="CaretDownIcon";const Zee=mL,gL=g.forwardRef((e,t)=>g.createElement(An,{ref:t,...e,weights:wee}));gL.displayName="CaretRightIcon";const Bee=gL,vL=g.forwardRef((e,t)=>g.createElement(An,{ref:t,...e,weights:bee}));vL.displayName="ChatCircleIcon";const Wee=vL,yL=g.forwardRef((e,t)=>g.createElement(An,{ref:t,...e,weights:xee}));yL.displayName="CheckIcon";const Kee=yL,_L=g.forwardRef((e,t)=>g.createElement(An,{ref:t,...e,weights:See}));_L.displayName="CircleNotchIcon";const Cx=_L,wL=g.forwardRef((e,t)=>g.createElement(An,{ref:t,...e,weights:Eee}));wL.displayName="CopyIcon";const Ah=wL,bL=g.forwardRef((e,t)=>g.createElement(An,{ref:t,...e,weights:kee}));bL.displayName="DotsThreeIcon";const Gee=bL,xL=g.forwardRef((e,t)=>g.createElement(An,{ref:t,...e,weights:Cee}));xL.displayName="FolderOpenIcon";const qee=xL,SL=g.forwardRef((e,t)=>g.createElement(An,{ref:t,...e,weights:Pee}));SL.displayName="FolderSimpleIcon";const Yee=SL,EL=g.forwardRef((e,t)=>g.createElement(An,{ref:t,...e,weights:Aee}));EL.displayName="HashIcon";const Qee=EL,kL=g.forwardRef((e,t)=>g.createElement(An,{ref:t,...e,weights:Tee}));kL.displayName="MagnifyingGlassIcon";const Xee=kL,CL=g.forwardRef((e,t)=>g.createElement(An,{ref:t,...e,weights:Ree}));CL.displayName="PencilSimpleIcon";const PL=CL,AL=g.forwardRef((e,t)=>g.createElement(An,{ref:t,...e,weights:Iee}));AL.displayName="PushPinIcon";const _2=AL,TL=g.forwardRef((e,t)=>g.createElement(An,{ref:t,...e,weights:Oee}));TL.displayName="SidebarSimpleIcon";const Jee=TL,RL=g.forwardRef((e,t)=>g.createElement(An,{ref:t,...e,weights:Mee}));RL.displayName="SignInIcon";const ete=RL,IL=g.forwardRef((e,t)=>g.createElement(An,{ref:t,...e,weights:Nee}));IL.displayName="SignOutIcon";const tte=IL,OL=g.forwardRef((e,t)=>g.createElement(An,{ref:t,...e,weights:Lee}));OL.displayName="SquaresFourIcon";const nte=OL,ML=g.forwardRef((e,t)=>g.createElement(An,{ref:t,...e,weights:$ee}));ML.displayName="SwatchesIcon";const rte=ML,NL=g.forwardRef((e,t)=>g.createElement(An,{ref:t,...e,weights:Dee}));NL.displayName="TrashIcon";const LL=NL,$L=g.forwardRef((e,t)=>g.createElement(An,{ref:t,...e,weights:Fee}));$L.displayName="UserIcon";const ste=$L,DL=g.forwardRef((e,t)=>g.createElement(An,{ref:t,...e,weights:jee}));DL.displayName="WarningCircleIcon";const FL=DL,jL=g.forwardRef((e,t)=>g.createElement(An,{ref:t,...e,weights:zee}));jL.displayName="XIcon";const zL=jL,VL=g.forwardRef((e,t)=>g.createElement(An,{ref:t,...e,weights:Vee}));VL.displayName="XLogoIcon";const ite=VL,ote="/assets/arena-Db0j1set.png",ate="data:image/svg+xml,%3csvg%20width='38'%20height='42'%20viewBox='0%200%2038%2042'%20fill='none'%20xmlns='http://www.w3.org/2000/svg'%3e%3cg%20clip-path='url(%23clip0_2543_2)'%3e%3cmask%20id='mask0_2543_2'%20style='mask-type:luminance'%20maskUnits='userSpaceOnUse'%20x='0'%20y='0'%20width='38'%20height='42'%3e%3cpath%20d='M0%200H38V42H0V0Z'%20fill='white'/%3e%3c/mask%3e%3cg%20mask='url(%23mask0_2543_2)'%3e%3cpath%20d='M19.025%2011.898C22.321%2011.898%2024.995%209.237%2024.995%205.949C24.995%202.661%2022.324%200%2019.025%200C15.726%200%2013.055%202.662%2013.055%205.95C13.055%209.237%2015.726%2011.898%2019.025%2011.898ZM19.025%2041.945C22.321%2041.945%2024.995%2039.283%2024.995%2035.995C24.995%2032.708%2022.324%2030.046%2019.025%2030.046C15.726%2030.046%2013.055%2032.708%2013.055%2035.996C13.055%2039.283%2015.726%2041.945%2019.025%2041.945ZM5.97%2019.41C9.266%2019.41%2011.94%2016.748%2011.94%2013.46C11.94%2010.173%209.268%207.511%205.97%207.511C2.67%207.511%200%2010.175%200%2013.463C0%2016.752%202.67%2019.413%205.97%2019.413V19.41ZM32.08%2034.434C35.376%2034.434%2038.05%2031.772%2038.05%2028.484C38.05%2025.197%2035.379%2022.535%2032.08%2022.535C28.781%2022.535%2026.11%2025.197%2026.11%2028.485C26.11%2031.772%2028.781%2034.434%2032.08%2034.434ZM32.08%2019.41C35.376%2019.41%2038.05%2016.748%2038.05%2013.46C38.05%2010.174%2035.379%207.512%2032.08%207.512C28.781%207.512%2026.11%2010.174%2026.11%2013.461C26.11%2016.748%2028.781%2019.41%2032.08%2019.41ZM5.97%2034.433C9.266%2034.433%2011.94%2031.771%2011.94%2028.483C11.94%2025.196%209.268%2022.535%205.97%2022.535C2.67%2022.535%200%2025.202%200%2028.486C0%2031.771%202.67%2034.436%205.97%2034.436V34.433Z'%20fill='white'/%3e%3c/g%3e%3c/g%3e%3cdefs%3e%3cclipPath%20id='clip0_2543_2'%3e%3crect%20width='38'%20height='42'%20fill='white'/%3e%3c/clipPath%3e%3c/defs%3e%3c/svg%3e",lte="data:image/svg+xml,%3csvg%20xmlns='http://www.w3.org/2000/svg'%20viewBox='0%200%20500%20500'%3e%3cpath%20fill='%23fff'%20d='M250%20500%20C388.071%20500%20500%20388.071%20500%20250%20C500%20111.929%20388.071%200%20250%200%20C111.929%200%200%20111.929%200%20250%20C0%20388.071%20111.929%20500%20250%20500%20Z'/%3e%3cpath%20fill='%23000'%20d='M249.995%200%20C111.928%200%200%20111.932%200%20250.005%20C0%20355.287%2065.0787%20445.359%20157.197%20482.21%20C154.077%20453.779%20156.247%20426.449%20162.497%20400.208%20L187.496%20292.396%20C183.436%20279.266%20180.306%20264.265%20180.306%20249.265%20C180.306%20214.264%20197.186%20189.264%20223.746%20189.264%20C242.185%20189.264%20255.625%20202.074%20255.625%20226.765%20C255.625%20234.575%20254.065%20243.325%20250.935%20253.325%20L239.995%20289.266%20C237.805%20296.146%20236.875%20302.706%20236.875%20308.326%20C236.875%20333.327%20255.935%20347.387%20280.314%20347.387%20C323.754%20347.387%20354.693%20302.386%20354.693%20243.945%20C354.693%20178.944%20312.194%20137.383%20249.385%20137.383%20C179.386%20137.383%20135.017%20183.014%20135.017%20246.445%20C135.017%20272.065%20142.827%20295.816%20158.137%20312.066%20C153.137%20320.506%20147.827%20322.066%20139.697%20322.066%20C114.698%20322.066%2090.9482%20286.756%2090.9482%20238.625%20C90.9482%20155.493%20157.507%2089.2518%20250.945%2089.2518%20C349.063%2089.2518%20410.632%20157.693%20410.632%20242.065%20C410.632%20326.437%20350.633%20390.818%20285.944%20390.818%20C260.315%20390.818%20237.815%20379.878%20222.196%20360.187%20L209.386%20412.068%20C202.516%20438.939%20192.126%20464.359%20175.566%20488.73%20C199.076%20496.05%20224.086%20500%20250.005%20500%20C388.072%20500%20500%20388.068%20500%20249.995%20C500%20111.922%20388.062%200%20249.995%200%20Z'/%3e%3c/svg%3e";function HL(e){var t,n,r="";if(typeof e=="string"||typeof e=="number")r+=e;else if(typeof e=="object")if(Array.isArray(e)){var s=e.length;for(t=0;t<s;t++)e[t]&&(n=HL(e[t]))&&(r&&(r+=" "),r+=n)}else for(n in e)e[n]&&(r&&(r+=" "),r+=n);return r}function UL(){for(var e,t,n=0,r="",s=arguments.length;n<s;n++)(e=arguments[n])&&(t=HL(e))&&(r&&(r+=" "),r+=t);return r}const cte=(e,t)=>{const n=new Array(e.length+t.length);for(let r=0;r<e.length;r++)n[r]=e[r];for(let r=0;r<t.length;r++)n[e.length+r]=t[r];return n},ute=(e,t)=>({classGroupId:e,validator:t}),ZL=(e=new Map,t=null,n)=>({nextPart:e,validators:t,classGroupId:n}),ug="-",yA=[],dte="arbitrary..",fte=e=>{const t=pte(e),{conflictingClassGroups:n,conflictingClassGroupModifiers:r}=e;return{getClassGroupId:o=>{if(o.startsWith("[")&&o.endsWith("]"))return hte(o);const c=o.split(ug),u=c[0]===""&&c.length>1?1:0;return BL(c,u,t)},getConflictingClassGroupIds:(o,c)=>{if(c){const u=r[o],d=n[o];return u?d?cte(d,u):u:d||yA}return n[o]||yA}}},BL=(e,t,n)=>{if(e.length-t===0)return n.classGroupId;const s=e[t],i=n.nextPart.get(s);if(i){const d=BL(e,t+1,i);if(d)return d}const o=n.validators;if(o===null)return;const c=t===0?e.join(ug):e.slice(t).join(ug),u=o.length;for(let d=0;d<u;d++){const f=o[d];if(f.validator(c))return f.classGroupId}},hte=e=>e.slice(1,-1).indexOf(":")===-1?void 0:(()=>{const t=e.slice(1,-1),n=t.indexOf(":"),r=t.slice(0,n);return r?dte+r:void 0})(),pte=e=>{const{theme:t,classGroups:n}=e;return mte(n,t)},mte=(e,t)=>{const n=ZL();for(const r in e){const s=e[r];Px(s,n,r,t)}return n},Px=(e,t,n,r)=>{const s=e.length;for(let i=0;i<s;i++){const o=e[i];gte(o,t,n,r)}},gte=(e,t,n,r)=>{if(typeof e=="string"){vte(e,t,n);return}if(typeof e=="function"){yte(e,t,n,r);return}_te(e,t,n,r)},vte=(e,t,n)=>{const r=e===""?t:WL(t,e);r.classGroupId=n},yte=(e,t,n,r)=>{if(wte(e)){Px(e(r),t,n,r);return}t.validators===null&&(t.validators=[]),t.validators.push(ute(n,e))},_te=(e,t,n,r)=>{const s=Object.entries(e),i=s.length;for(let o=0;o<i;o++){const[c,u]=s[o];Px(u,WL(t,c),n,r)}},WL=(e,t)=>{let n=e;const r=t.split(ug),s=r.length;for(let i=0;i<s;i++){const o=r[i];let c=n.nextPart.get(o);c||(c=ZL(),n.nextPart.set(o,c)),n=c}return n},wte=e=>"isThemeGetter"in e&&e.isThemeGetter===!0,bte=e=>{if(e<1)return{get:()=>{},set:()=>{}};let t=0,n=Object.create(null),r=Object.create(null);const s=(i,o)=>{n[i]=o,t++,t>e&&(t=0,r=n,n=Object.create(null))};return{get(i){let o=n[i];if(o!==void 0)return o;if((o=r[i])!==void 0)return s(i,o),o},set(i,o){i in n?n[i]=o:s(i,o)}}},w2="!",_A=":",xte=[],wA=(e,t,n,r,s)=>({modifiers:e,hasImportantModifier:t,baseClassName:n,maybePostfixModifierPosition:r,isExternal:s}),Ste=e=>{const{prefix:t,experimentalParseClassName:n}=e;let r=s=>{const i=[];let o=0,c=0,u=0,d;const f=s.length;for(let w=0;w<f;w++){const b=s[w];if(o===0&&c===0){if(b===_A){i.push(s.slice(u,w)),u=w+1;continue}if(b==="/"){d=w;continue}}b==="["?o++:b==="]"?o--:b==="("?c++:b===")"&&c--}const p=i.length===0?s:s.slice(u);let m=p,v=!1;p.endsWith(w2)?(m=p.slice(0,-1),v=!0):p.startsWith(w2)&&(m=p.slice(1),v=!0);const _=d&&d>u?d-u:void 0;return wA(i,v,m,_)};if(t){const s=t+_A,i=r;r=o=>o.startsWith(s)?i(o.slice(s.length)):wA(xte,!1,o,void 0,!0)}if(n){const s=r;r=i=>n({className:i,parseClassName:s})}return r},Ete=e=>{const t=new Map;return e.orderSensitiveModifiers.forEach((n,r)=>{t.set(n,1e6+r)}),n=>{const r=[];let s=[];for(let i=0;i<n.length;i++){const o=n[i],c=o[0]==="[",u=t.has(o);c||u?(s.length>0&&(s.sort(),r.push(...s),s=[]),r.push(o)):s.push(o)}return s.length>0&&(s.sort(),r.push(...s)),r}},kte=e=>({cache:bte(e.cacheSize),parseClassName:Ste(e),sortModifiers:Ete(e),postfixLookupClassGroupIds:Cte(e),...fte(e)}),Cte=e=>{const t=Object.create(null),n=e.postfixLookupClassGroups;if(n)for(let r=0;r<n.length;r++)t[n[r]]=!0;return t},Pte=/\s+/,Ate=(e,t)=>{const{parseClassName:n,getClassGroupId:r,getConflictingClassGroupIds:s,sortModifiers:i,postfixLookupClassGroupIds:o}=t,c=[],u=e.trim().split(Pte);let d="";for(let f=u.length-1;f>=0;f-=1){const p=u[f],{isExternal:m,modifiers:v,hasImportantModifier:_,baseClassName:w,maybePostfixModifierPosition:b}=n(p);if(m){d=p+(d.length>0?" "+d:d);continue}let S=!!b,E;if(S){const O=w.substring(0,b);E=r(O);const R=E&&o[E]?r(w):void 0;R&&R!==E&&(E=R,S=!1)}else E=r(w);if(!E){if(!S){d=p+(d.length>0?" "+d:d);continue}if(E=r(w),!E){d=p+(d.length>0?" "+d:d);continue}S=!1}const C=v.length===0?"":v.length===1?v[0]:i(v).join(":"),A=_?C+w2:C,T=A+E;if(c.indexOf(T)>-1)continue;c.push(T);const M=s(E,S);for(let O=0;O<M.length;++O){const R=M[O];c.push(A+R)}d=p+(d.length>0?" "+d:d)}return d},Tte=(...e)=>{let t=0,n,r,s="";for(;t<e.length;)(n=e[t++])&&(r=KL(n))&&(s&&(s+=" "),s+=r);return s},KL=e=>{if(typeof e=="string")return e;let t,n="";for(let r=0;r<e.length;r++)e[r]&&(t=KL(e[r]))&&(n&&(n+=" "),n+=t);return n},Rte=(e,...t)=>{let n,r,s,i;const o=u=>{const d=t.reduce((f,p)=>p(f),e());return n=kte(d),r=n.cache.get,s=n.cache.set,i=c,c(u)},c=u=>{const d=r(u);if(d)return d;const f=Ate(u,n);return s(u,f),f};return i=o,(...u)=>i(Tte(...u))},Ite=[],hr=e=>{const t=n=>n[e]||Ite;return t.isThemeGetter=!0,t.themeKey=e,t},GL=/^\[(?:(\w[\w-]*):)?(.+)\]$/i,qL=/^\((?:(\w[\w-]*):)?(.+)\)$/i,Ote=/^\d+(?:\.\d+)?\/\d+(?:\.\d+)?$/,Mte=/^(\d+(\.\d+)?)?(xs|sm|md|lg|xl)$/,Nte=/\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$/,Lte=/^(rgba?|hsla?|hwb|(ok)?(lab|lch)|color-mix|color|light-dark)\(.+\)$/,$te=/^(inset_)?-?((\d+)?\.?(\d+)[a-z]+|0)_-?((\d+)?\.?(\d+)[a-z]+|0)/,Dte=/^(url|image|image-set|cross-fade|element|(repeating-)?(linear|radial|conic)-gradient)\(.+\)$/,Na=e=>Ote.test(e),Rt=e=>!!e&&!Number.isNaN(Number(e)),eo=e=>!!e&&Number.isInteger(Number(e)),s_=e=>e.endsWith("%")&&Rt(e.slice(0,-1)),Do=e=>Mte.test(e),YL=()=>!0,Fte=e=>Nte.test(e)&&!Lte.test(e),Ax=()=>!1,jte=e=>$te.test(e),zte=e=>Dte.test(e),Vte=e=>!Ve(e)&&!Be(e),Hte=e=>e.startsWith("@container")&&(e[10]==="/"&&e[11]!==void 0||e[11]==="s"&&e[16]!==void 0&&e.startsWith("-size/",10)||e[11]==="n"&&e[18]!==void 0&&e.startsWith("-normal/",10)),Ute=e=>wl(e,JL,Ax),Ve=e=>GL.test(e),Wl=e=>wl(e,e5,Fte),bA=e=>wl(e,Qte,Rt),Zte=e=>wl(e,n5,YL),Bte=e=>wl(e,t5,Ax),xA=e=>wl(e,QL,Ax),Wte=e=>wl(e,XL,zte),Cm=e=>wl(e,r5,jte),Be=e=>qL.test(e),Cf=e=>Pc(e,e5),Kte=e=>Pc(e,t5),SA=e=>Pc(e,QL),Gte=e=>Pc(e,JL),qte=e=>Pc(e,XL),Pm=e=>Pc(e,r5,!0),Yte=e=>Pc(e,n5,!0),wl=(e,t,n)=>{const r=GL.exec(e);return r?r[1]?t(r[1]):n(r[2]):!1},Pc=(e,t,n=!1)=>{const r=qL.exec(e);return r?r[1]?t(r[1]):n:!1},QL=e=>e==="position"||e==="percentage",XL=e=>e==="image"||e==="url",JL=e=>e==="length"||e==="size"||e==="bg-size",e5=e=>e==="length",Qte=e=>e==="number",t5=e=>e==="family-name",n5=e=>e==="number"||e==="weight",r5=e=>e==="shadow",Xte=()=>{const e=hr("color"),t=hr("font"),n=hr("text"),r=hr("font-weight"),s=hr("tracking"),i=hr("leading"),o=hr("breakpoint"),c=hr("container"),u=hr("spacing"),d=hr("radius"),f=hr("shadow"),p=hr("inset-shadow"),m=hr("text-shadow"),v=hr("drop-shadow"),_=hr("blur"),w=hr("perspective"),b=hr("aspect"),S=hr("ease"),E=hr("animate"),C=()=>["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"],T=()=>[...A(),Be,Ve],M=()=>["auto","hidden","clip","visible","scroll"],O=()=>["auto","contain","none"],R=()=>[Be,Ve,u],D=()=>[Na,"full","auto",...R()],U=()=>[eo,"none","subgrid",Be,Ve],W=()=>["auto",{span:["full",eo,Be,Ve]},eo,Be,Ve],H=()=>[eo,"auto",Be,Ve],Y=()=>["auto","min","max","fr",Be,Ve],J=()=>["start","end","center","between","around","evenly","stretch","baseline","center-safe","end-safe"],V=()=>["start","end","center","stretch","center-safe","end-safe"],q=()=>["auto",...R()],ee=()=>[Na,"auto","full","dvw","dvh","lvw","lvh","svw","svh","min","max","fit",...R()],F=()=>[c,Na,"screen","full","dvw","lvw","svw","min","max","fit",...R()],X=()=>[Na,"screen","full","lh","dvh","lvh","svh","min","max","fit",...R()],B=()=>[e,Be,Ve],L=()=>[...A(),SA,xA,{position:[Be,Ve]}],G=()=>["no-repeat",{repeat:["","x","y","space","round"]}],ue=()=>["auto","cover","contain",Gte,Ute,{size:[Be,Ve]}],te=()=>[s_,Cf,Wl],ie=()=>["","none","full",d,Be,Ve],he=()=>["",Rt,Cf,Wl],ke=()=>["solid","dashed","dotted","double"],ge=()=>["normal","multiply","screen","overlay","darken","lighten","color-dodge","color-burn","hard-light","soft-light","difference","exclusion","hue","saturation","color","luminosity"],pe=()=>[Rt,s_,SA,xA],Ne=()=>["","none",_,Be,Ve],Re=()=>["none",Rt,Be,Ve],$e=()=>["none",Rt,Be,Ve],Et=()=>[Rt,Be,Ve],dn=()=>[Na,"full",...R()];return{cacheSize:500,theme:{animate:["spin","ping","pulse","bounce"],aspect:["video"],blur:[Do],breakpoint:[Do],color:[YL],container:[Do],"drop-shadow":[Do],ease:["in","out","in-out"],font:[Vte],"font-weight":["thin","extralight","light","normal","medium","semibold","bold","extrabold","black"],"inset-shadow":[Do],leading:["none","tight","snug","normal","relaxed","loose"],perspective:["dramatic","near","normal","midrange","distant","none"],radius:[Do],shadow:[Do],spacing:["px",Rt],text:[Do],"text-shadow":[Do],tracking:["tighter","tight","normal","wide","wider","widest"]},classGroups:{aspect:[{aspect:["auto","square",Na,Ve,Be,b]}],container:["container"],"container-type":[{"@container":["","normal","size",Be,Ve]}],"container-named":[Hte],columns:[{columns:[Rt,"auto",Ve,Be,c]}],"break-after":[{"break-after":C()}],"break-before":[{"break-before":C()}],"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:T()}],overflow:[{overflow:M()}],"overflow-x":[{"overflow-x":M()}],"overflow-y":[{"overflow-y":M()}],overscroll:[{overscroll:O()}],"overscroll-x":[{"overscroll-x":O()}],"overscroll-y":[{"overscroll-y":O()}],position:["static","fixed","absolute","relative","sticky"],inset:[{inset:D()}],"inset-x":[{"inset-x":D()}],"inset-y":[{"inset-y":D()}],start:[{"inset-s":D(),start:D()}],end:[{"inset-e":D(),end:D()}],"inset-bs":[{"inset-bs":D()}],"inset-be":[{"inset-be":D()}],top:[{top:D()}],right:[{right:D()}],bottom:[{bottom:D()}],left:[{left:D()}],visibility:["visible","invisible","collapse"],z:[{z:[eo,"auto",Be,Ve]}],basis:[{basis:[Na,"full","auto",c,...R()]}],"flex-direction":[{flex:["row","row-reverse","col","col-reverse"]}],"flex-wrap":[{flex:["nowrap","wrap","wrap-reverse"]}],flex:[{flex:[Rt,Na,"auto","initial","none",Ve]}],grow:[{grow:["",Rt,Be,Ve]}],shrink:[{shrink:["",Rt,Be,Ve]}],order:[{order:[eo,"first","last","none",Be,Ve]}],"grid-cols":[{"grid-cols":U()}],"col-start-end":[{col:W()}],"col-start":[{"col-start":H()}],"col-end":[{"col-end":H()}],"grid-rows":[{"grid-rows":U()}],"row-start-end":[{row:W()}],"row-start":[{"row-start":H()}],"row-end":[{"row-end":H()}],"grid-flow":[{"grid-flow":["row","col","dense","row-dense","col-dense"]}],"auto-cols":[{"auto-cols":Y()}],"auto-rows":[{"auto-rows":Y()}],gap:[{gap:R()}],"gap-x":[{"gap-x":R()}],"gap-y":[{"gap-y":R()}],"justify-content":[{justify:[...J(),"normal"]}],"justify-items":[{"justify-items":[...V(),"normal"]}],"justify-self":[{"justify-self":["auto",...V()]}],"align-content":[{content:["normal",...J()]}],"align-items":[{items:[...V(),{baseline:["","last"]}]}],"align-self":[{self:["auto",...V(),{baseline:["","last"]}]}],"place-content":[{"place-content":J()}],"place-items":[{"place-items":[...V(),"baseline"]}],"place-self":[{"place-self":["auto",...V()]}],p:[{p:R()}],px:[{px:R()}],py:[{py:R()}],ps:[{ps:R()}],pe:[{pe:R()}],pbs:[{pbs:R()}],pbe:[{pbe:R()}],pt:[{pt:R()}],pr:[{pr:R()}],pb:[{pb:R()}],pl:[{pl:R()}],m:[{m:q()}],mx:[{mx:q()}],my:[{my:q()}],ms:[{ms:q()}],me:[{me:q()}],mbs:[{mbs:q()}],mbe:[{mbe:q()}],mt:[{mt:q()}],mr:[{mr:q()}],mb:[{mb:q()}],ml:[{ml:q()}],"space-x":[{"space-x":R()}],"space-x-reverse":["space-x-reverse"],"space-y":[{"space-y":R()}],"space-y-reverse":["space-y-reverse"],size:[{size:ee()}],"inline-size":[{inline:["auto",...F()]}],"min-inline-size":[{"min-inline":["auto",...F()]}],"max-inline-size":[{"max-inline":["none",...F()]}],"block-size":[{block:["auto",...X()]}],"min-block-size":[{"min-block":["auto",...X()]}],"max-block-size":[{"max-block":["none",...X()]}],w:[{w:[c,"screen",...ee()]}],"min-w":[{"min-w":[c,"screen","none",...ee()]}],"max-w":[{"max-w":[c,"screen","none","prose",{screen:[o]},...ee()]}],h:[{h:["screen","lh",...ee()]}],"min-h":[{"min-h":["screen","lh","none",...ee()]}],"max-h":[{"max-h":["screen","lh","none",...ee()]}],"font-size":[{text:["base",n,Cf,Wl]}],"font-smoothing":["antialiased","subpixel-antialiased"],"font-style":["italic","not-italic"],"font-weight":[{font:[r,Yte,Zte]}],"font-stretch":[{"font-stretch":["ultra-condensed","extra-condensed","condensed","semi-condensed","normal","semi-expanded","expanded","extra-expanded","ultra-expanded",s_,Ve]}],"font-family":[{font:[Kte,Bte,t]}],"font-features":[{"font-features":[Ve]}],"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:[s,Be,Ve]}],"line-clamp":[{"line-clamp":[Rt,"none",Be,bA]}],leading:[{leading:["none",i,...R()]}],"list-image":[{"list-image":["none",Be,Ve]}],"list-style-position":[{list:["inside","outside"]}],"list-style-type":[{list:["disc","decimal","none",Be,Ve]}],"text-alignment":[{text:["left","center","right","justify","start","end"]}],"placeholder-color":[{placeholder:B()}],"text-color":[{text:B()}],"text-decoration":["underline","overline","line-through","no-underline"],"text-decoration-style":[{decoration:[...ke(),"wavy"]}],"text-decoration-thickness":[{decoration:[Rt,"from-font","auto",Be,Wl]}],"text-decoration-color":[{decoration:B()}],"underline-offset":[{"underline-offset":[Rt,"auto",Be,Ve]}],"text-transform":["uppercase","lowercase","capitalize","normal-case"],"text-overflow":["truncate","text-ellipsis","text-clip"],"text-wrap":[{text:["wrap","nowrap","balance","pretty"]}],indent:[{indent:R()}],"tab-size":[{tab:[eo,Be,Ve]}],"vertical-align":[{align:["baseline","top","middle","bottom","text-top","text-bottom","sub","super",Be,Ve]}],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",Be,Ve]}],"bg-attachment":[{bg:["fixed","local","scroll"]}],"bg-clip":[{"bg-clip":["border","padding","content","text"]}],"bg-origin":[{"bg-origin":["border","padding","content"]}],"bg-position":[{bg:L()}],"bg-repeat":[{bg:G()}],"bg-size":[{bg:ue()}],"bg-image":[{bg:["none",{linear:[{to:["t","tr","r","br","b","bl","l","tl"]},eo,Be,Ve],radial:["",Be,Ve],conic:["",eo,Be,Ve]},qte,Wte]}],"bg-color":[{bg:B()}],"gradient-from-pos":[{from:te()}],"gradient-via-pos":[{via:te()}],"gradient-to-pos":[{to:te()}],"gradient-from":[{from:B()}],"gradient-via":[{via:B()}],"gradient-to":[{to:B()}],rounded:[{rounded:ie()}],"rounded-s":[{"rounded-s":ie()}],"rounded-e":[{"rounded-e":ie()}],"rounded-t":[{"rounded-t":ie()}],"rounded-r":[{"rounded-r":ie()}],"rounded-b":[{"rounded-b":ie()}],"rounded-l":[{"rounded-l":ie()}],"rounded-ss":[{"rounded-ss":ie()}],"rounded-se":[{"rounded-se":ie()}],"rounded-ee":[{"rounded-ee":ie()}],"rounded-es":[{"rounded-es":ie()}],"rounded-tl":[{"rounded-tl":ie()}],"rounded-tr":[{"rounded-tr":ie()}],"rounded-br":[{"rounded-br":ie()}],"rounded-bl":[{"rounded-bl":ie()}],"border-w":[{border:he()}],"border-w-x":[{"border-x":he()}],"border-w-y":[{"border-y":he()}],"border-w-s":[{"border-s":he()}],"border-w-e":[{"border-e":he()}],"border-w-bs":[{"border-bs":he()}],"border-w-be":[{"border-be":he()}],"border-w-t":[{"border-t":he()}],"border-w-r":[{"border-r":he()}],"border-w-b":[{"border-b":he()}],"border-w-l":[{"border-l":he()}],"divide-x":[{"divide-x":he()}],"divide-x-reverse":["divide-x-reverse"],"divide-y":[{"divide-y":he()}],"divide-y-reverse":["divide-y-reverse"],"border-style":[{border:[...ke(),"hidden","none"]}],"divide-style":[{divide:[...ke(),"hidden","none"]}],"border-color":[{border:B()}],"border-color-x":[{"border-x":B()}],"border-color-y":[{"border-y":B()}],"border-color-s":[{"border-s":B()}],"border-color-e":[{"border-e":B()}],"border-color-bs":[{"border-bs":B()}],"border-color-be":[{"border-be":B()}],"border-color-t":[{"border-t":B()}],"border-color-r":[{"border-r":B()}],"border-color-b":[{"border-b":B()}],"border-color-l":[{"border-l":B()}],"divide-color":[{divide:B()}],"outline-style":[{outline:[...ke(),"none","hidden"]}],"outline-offset":[{"outline-offset":[Rt,Be,Ve]}],"outline-w":[{outline:["",Rt,Cf,Wl]}],"outline-color":[{outline:B()}],shadow:[{shadow:["","inner","none",f,Pm,Cm]}],"shadow-color":[{shadow:B()}],"inset-shadow":[{"inset-shadow":["none",p,Pm,Cm]}],"inset-shadow-color":[{"inset-shadow":B()}],"ring-w":[{ring:he()}],"ring-w-inset":["ring-inset"],"ring-color":[{ring:B()}],"ring-offset-w":[{"ring-offset":[Rt,Wl]}],"ring-offset-color":[{"ring-offset":B()}],"inset-ring-w":[{"inset-ring":he()}],"inset-ring-color":[{"inset-ring":B()}],"text-shadow":[{"text-shadow":["none",m,Pm,Cm]}],"text-shadow-color":[{"text-shadow":B()}],opacity:[{opacity:[Rt,Be,Ve]}],"mix-blend":[{"mix-blend":[...ge(),"plus-darker","plus-lighter"]}],"bg-blend":[{"bg-blend":ge()}],"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":[Rt]}],"mask-image-linear-from-pos":[{"mask-linear-from":pe()}],"mask-image-linear-to-pos":[{"mask-linear-to":pe()}],"mask-image-linear-from-color":[{"mask-linear-from":B()}],"mask-image-linear-to-color":[{"mask-linear-to":B()}],"mask-image-t-from-pos":[{"mask-t-from":pe()}],"mask-image-t-to-pos":[{"mask-t-to":pe()}],"mask-image-t-from-color":[{"mask-t-from":B()}],"mask-image-t-to-color":[{"mask-t-to":B()}],"mask-image-r-from-pos":[{"mask-r-from":pe()}],"mask-image-r-to-pos":[{"mask-r-to":pe()}],"mask-image-r-from-color":[{"mask-r-from":B()}],"mask-image-r-to-color":[{"mask-r-to":B()}],"mask-image-b-from-pos":[{"mask-b-from":pe()}],"mask-image-b-to-pos":[{"mask-b-to":pe()}],"mask-image-b-from-color":[{"mask-b-from":B()}],"mask-image-b-to-color":[{"mask-b-to":B()}],"mask-image-l-from-pos":[{"mask-l-from":pe()}],"mask-image-l-to-pos":[{"mask-l-to":pe()}],"mask-image-l-from-color":[{"mask-l-from":B()}],"mask-image-l-to-color":[{"mask-l-to":B()}],"mask-image-x-from-pos":[{"mask-x-from":pe()}],"mask-image-x-to-pos":[{"mask-x-to":pe()}],"mask-image-x-from-color":[{"mask-x-from":B()}],"mask-image-x-to-color":[{"mask-x-to":B()}],"mask-image-y-from-pos":[{"mask-y-from":pe()}],"mask-image-y-to-pos":[{"mask-y-to":pe()}],"mask-image-y-from-color":[{"mask-y-from":B()}],"mask-image-y-to-color":[{"mask-y-to":B()}],"mask-image-radial":[{"mask-radial":[Be,Ve]}],"mask-image-radial-from-pos":[{"mask-radial-from":pe()}],"mask-image-radial-to-pos":[{"mask-radial-to":pe()}],"mask-image-radial-from-color":[{"mask-radial-from":B()}],"mask-image-radial-to-color":[{"mask-radial-to":B()}],"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":[Rt]}],"mask-image-conic-from-pos":[{"mask-conic-from":pe()}],"mask-image-conic-to-pos":[{"mask-conic-to":pe()}],"mask-image-conic-from-color":[{"mask-conic-from":B()}],"mask-image-conic-to-color":[{"mask-conic-to":B()}],"mask-mode":[{mask:["alpha","luminance","match"]}],"mask-origin":[{"mask-origin":["border","padding","content","fill","stroke","view"]}],"mask-position":[{mask:L()}],"mask-repeat":[{mask:G()}],"mask-size":[{mask:ue()}],"mask-type":[{"mask-type":["alpha","luminance"]}],"mask-image":[{mask:["none",Be,Ve]}],filter:[{filter:["","none",Be,Ve]}],blur:[{blur:Ne()}],brightness:[{brightness:[Rt,Be,Ve]}],contrast:[{contrast:[Rt,Be,Ve]}],"drop-shadow":[{"drop-shadow":["","none",v,Pm,Cm]}],"drop-shadow-color":[{"drop-shadow":B()}],grayscale:[{grayscale:["",Rt,Be,Ve]}],"hue-rotate":[{"hue-rotate":[Rt,Be,Ve]}],invert:[{invert:["",Rt,Be,Ve]}],saturate:[{saturate:[Rt,Be,Ve]}],sepia:[{sepia:["",Rt,Be,Ve]}],"backdrop-filter":[{"backdrop-filter":["","none",Be,Ve]}],"backdrop-blur":[{"backdrop-blur":Ne()}],"backdrop-brightness":[{"backdrop-brightness":[Rt,Be,Ve]}],"backdrop-contrast":[{"backdrop-contrast":[Rt,Be,Ve]}],"backdrop-grayscale":[{"backdrop-grayscale":["",Rt,Be,Ve]}],"backdrop-hue-rotate":[{"backdrop-hue-rotate":[Rt,Be,Ve]}],"backdrop-invert":[{"backdrop-invert":["",Rt,Be,Ve]}],"backdrop-opacity":[{"backdrop-opacity":[Rt,Be,Ve]}],"backdrop-saturate":[{"backdrop-saturate":[Rt,Be,Ve]}],"backdrop-sepia":[{"backdrop-sepia":["",Rt,Be,Ve]}],"border-collapse":[{border:["collapse","separate"]}],"border-spacing":[{"border-spacing":R()}],"border-spacing-x":[{"border-spacing-x":R()}],"border-spacing-y":[{"border-spacing-y":R()}],"table-layout":[{table:["auto","fixed"]}],caption:[{caption:["top","bottom"]}],transition:[{transition:["","all","colors","opacity","shadow","transform","none",Be,Ve]}],"transition-behavior":[{transition:["normal","discrete"]}],duration:[{duration:[Rt,"initial",Be,Ve]}],ease:[{ease:["linear","initial",S,Be,Ve]}],delay:[{delay:[Rt,Be,Ve]}],animate:[{animate:["none",E,Be,Ve]}],backface:[{backface:["hidden","visible"]}],perspective:[{perspective:[w,Be,Ve]}],"perspective-origin":[{"perspective-origin":T()}],rotate:[{rotate:Re()}],"rotate-x":[{"rotate-x":Re()}],"rotate-y":[{"rotate-y":Re()}],"rotate-z":[{"rotate-z":Re()}],scale:[{scale:$e()}],"scale-x":[{"scale-x":$e()}],"scale-y":[{"scale-y":$e()}],"scale-z":[{"scale-z":$e()}],"scale-3d":["scale-3d"],skew:[{skew:Et()}],"skew-x":[{"skew-x":Et()}],"skew-y":[{"skew-y":Et()}],transform:[{transform:[Be,Ve,"","none","gpu","cpu"]}],"transform-origin":[{origin:T()}],"transform-style":[{transform:["3d","flat"]}],translate:[{translate:dn()}],"translate-x":[{"translate-x":dn()}],"translate-y":[{"translate-y":dn()}],"translate-z":[{"translate-z":dn()}],"translate-none":["translate-none"],zoom:[{zoom:[eo,Be,Ve]}],accent:[{accent:B()}],appearance:[{appearance:["none","auto"]}],"caret-color":[{caret:B()}],"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",Be,Ve]}],"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":B()}],"scrollbar-track-color":[{"scrollbar-track":B()}],"scrollbar-gutter":[{"scrollbar-gutter":["auto","stable","both"]}],"scrollbar-w":[{scrollbar:["auto","thin","none"]}],"scroll-m":[{"scroll-m":R()}],"scroll-mx":[{"scroll-mx":R()}],"scroll-my":[{"scroll-my":R()}],"scroll-ms":[{"scroll-ms":R()}],"scroll-me":[{"scroll-me":R()}],"scroll-mbs":[{"scroll-mbs":R()}],"scroll-mbe":[{"scroll-mbe":R()}],"scroll-mt":[{"scroll-mt":R()}],"scroll-mr":[{"scroll-mr":R()}],"scroll-mb":[{"scroll-mb":R()}],"scroll-ml":[{"scroll-ml":R()}],"scroll-p":[{"scroll-p":R()}],"scroll-px":[{"scroll-px":R()}],"scroll-py":[{"scroll-py":R()}],"scroll-ps":[{"scroll-ps":R()}],"scroll-pe":[{"scroll-pe":R()}],"scroll-pbs":[{"scroll-pbs":R()}],"scroll-pbe":[{"scroll-pbe":R()}],"scroll-pt":[{"scroll-pt":R()}],"scroll-pr":[{"scroll-pr":R()}],"scroll-pb":[{"scroll-pb":R()}],"scroll-pl":[{"scroll-pl":R()}],"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",Be,Ve]}],fill:[{fill:["none",...B()]}],"stroke-w":[{stroke:[Rt,Cf,Wl,bA]}],stroke:[{stroke:["none",...B()]}],"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":["start","end","right","left"],"inset-y":["inset-bs","inset-be","top","bottom"],flex:["basis","grow","shrink"],gap:["gap-x","gap-y"],p:["px","py","ps","pe","pbs","pbe","pt","pr","pb","pl"],px:["ps","pe","pr","pl"],py:["pbs","pbe","pt","pb"],m:["mx","my","ms","me","mbs","mbe","mt","mr","mb","ml"],mx:["ms","me","mr","ml"],my:["mbs","mbe","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-s","border-w-e","border-w-r","border-w-l"],"border-w-y":["border-w-bs","border-w-be","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-s","border-color-e","border-color-r","border-color-l"],"border-color-y":["border-color-bs","border-color-be","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-ms","scroll-me","scroll-mr","scroll-ml"],"scroll-my":["scroll-mbs","scroll-mbe","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-ps","scroll-pe","scroll-pr","scroll-pl"],"scroll-py":["scroll-pbs","scroll-pbe","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"]}},Jte=Rte(Xte);function or(...e){return Jte(UL(e))}const ene="h-6 w-6",EA=e=>({className:n,color:r})=>P.jsx("span",{"aria-hidden":"true",className:or("bg-current forced-colors:bg-[CanvasText] forced-colors:forced-color-adjust-none",n),style:{color:r,WebkitMaskImage:`url("${e}")`,maskImage:`url("${e}")`,WebkitMaskSize:"contain",maskSize:"contain",WebkitMaskRepeat:"no-repeat",maskRepeat:"no-repeat",WebkitMaskPosition:"center",maskPosition:"center"}}),tne={x:{draw:({className:e,color:t})=>P.jsx(ite,{className:e,style:{color:t},"aria-hidden":"true"})},pinterest:{draw:({className:e})=>P.jsx("img",{src:lte,className:e,alt:"","aria-hidden":"true"})},arena:{brandColor:"#B1B1B1",draw:EA(ote)},cosmos:{draw:EA(ate)}},Lu=({provider:e,className:t})=>{const n=tne[e];return n.draw({className:or(ene,n.brandColor&&"forced-colors:text-[CanvasText]!",t),color:n.brandColor})},nne=e=>{const t=new URL(e).hostname.replace(/^www\./,"");return t==="are.na"?"arena":t==="pinterest.com"||t==="pin.it"?"pinterest":t==="x.com"?"x":t==="cosmos.so"?"cosmos":null},rne=({reference:e,imageUrl:t,onOpen:n})=>{const[r,s]=g.useState(!1),i=!!t&&!r,o=e.url?nne(e.url):null,c=e.url??(i?t:void 0),u=c?"a":"span",d=i&&e.url?new URL(e.url).hostname:e.title;return P.jsxs(u,{href:c,target:c?"_blank":void 0,rel:c?"noopener noreferrer":void 0,"aria-label":e.title,onPointerDown:f=>f.stopPropagation(),onKeyDown:f=>{(f.key!=="ArrowUp"&&f.key!=="ArrowDown"||f.altKey||f.ctrlKey||f.metaKey||f.shiftKey)&&f.stopPropagation()},onClick:f=>{f.stopPropagation(),c&&n()},className:or("border-surface-2 bg-muted text-foreground hover:border-soft-foreground/50 focus-visible:border-soft-foreground flex max-w-full min-w-0 shrink-0 items-center gap-1.5 overflow-hidden rounded-md border pr-1.5 text-xs focus-visible:outline-hidden",!i&&"py-1.5 pl-2"),children:[i?P.jsx("img",{src:t,alt:"",className:"h-8 w-12 shrink-0 object-contain",width:48,height:32,onError:()=>s(!0)}):null,o&&(i||o==="cosmos")?P.jsx(Lu,{provider:o,className:"h-3.5 w-3.5 shrink-0"}):null,!i||!o?P.jsx("span",{className:"max-w-40 truncate",children:d}):null]})},sne=({references:e,source:t,sessionId:n,variantId:r,projectPath:s,className:i})=>{const o=Ms(),c=KW(e);return c?P.jsx("div",{className:or("ph-no-capture flex min-w-0 flex-nowrap gap-1.5 overflow-x-auto pr-3 pb-2",i),"aria-label":"References",children:c.map(u=>{var p;const d=s?`?${new URLSearchParams({projectPath:s})}`:"",f=u.image&&n&&r?`/api/variants/${encodeURIComponent(n)}/${encodeURIComponent(r)}/references/${encodeURIComponent(u.id)}/image${d}`:void 0;return P.jsx(rne,{reference:u,imageUrl:f,onOpen:()=>o==null?void 0:o.capture("preview_reference_opened",{variant_source:t,reference_count:c.length})},`${u.id}:${((p=u.image)==null?void 0:p.hash)??""}:${f??""}`)})}):null},Yue=e=>{const t=e.pathname.split("/").filter(Boolean).map(decodeURIComponent),n=t[3];if(t[2]==="references")return{kind:"references"};if(t[2]!=="projects"||!n)return{kind:"library"};const r=t[4]==="variants"?t[5]:void 0,s=t[4]==="variants"?t[6]:void 0,i=new URLSearchParams(e.search);return r&&s&&i.get("edit")!=="1"?{kind:"preview",projectId:n,sessionId:r,variantId:s}:{kind:"workspace",projectId:n,sessionId:r,variantId:s}},Que=e=>{if(e.kind==="references")return"/rivet/library/references";if(e.kind==="library"||!e.projectId)return"/rivet/library";const t=`/rivet/library/projects/${encodeURIComponent(e.projectId)}`;return e.sessionId&&e.variantId?`${t}/variants/${encodeURIComponent(e.sessionId)}/${encodeURIComponent(e.variantId)}${e.kind==="workspace"?"?edit=1":""}`:t},ine=e=>{const t=new URLSearchParams(e),n=t.get("historySession"),r=t.get("historyVariant");return n&&r?{sessionId:n,variantId:r}:null},kA=e=>typeof e=="boolean"?`${e}`:e===0?"0":e,CA=UL,one=(e,t)=>n=>{var r;if((t==null?void 0:t.variants)==null)return CA(e,n==null?void 0:n.class,n==null?void 0:n.className);const{variants:s,defaultVariants:i}=t,o=Object.keys(s).map(d=>{const f=n==null?void 0:n[d],p=i==null?void 0:i[d];if(f===null)return null;const m=kA(f)||kA(p);return s[d][m]}),c=n&&Object.entries(n).reduce((d,f)=>{let[p,m]=f;return m===void 0||(d[p]=m),d},{}),u=t==null||(r=t.compoundVariants)===null||r===void 0?void 0:r.reduce((d,f)=>{let{class:p,className:m,...v}=f;return Object.entries(v).every(_=>{let[w,b]=_;return Array.isArray(b)?b.includes({...i,...c}[w]):{...i,...c}[w]===b})?[...d,p,m]:d},[]);return CA(e,o,u,n==null?void 0:n.class,n==null?void 0:n.className)},ane=one(["group/button relative isolate inline-flex cursor-pointer items-center justify-center focus-visible:outline-hidden","transition-colors duration-80 motion-reduce:transition-none","disabled:pointer-events-none disabled:opacity-50"],{variants:{variant:{primary:"text-background",secondary:"text-foreground",tertiary:"text-foreground",ghost:"text-muted-foreground hover:text-foreground focus-visible:text-foreground aria-expanded:text-foreground aria-pressed:text-foreground"},size:{default:"h-9 gap-1.5 px-4 text-[13px]",compact:"h-7 gap-1 px-3 text-[12px]",icon:"h-9 w-9 p-0 [&_svg]:h-4 [&_svg]:w-4","icon-compact":"h-7 w-7 p-0 [&_svg]:h-3.5 [&_svg]:w-3.5"},iconLeft:{true:""},iconRight:{true:""}},compoundVariants:[{size:"compact",iconLeft:!0,className:"pl-2"},{size:"default",iconLeft:!0,className:"pl-3"},{size:"compact",iconRight:!0,className:"pr-2"},{size:"default",iconRight:!0,className:"pr-3"}],defaultVariants:{variant:"secondary",size:"default"}}),PA={default:16,compact:14},lne={primary:"[--btn-bg:var(--foreground)] group-hover/button:[--btn-bg:color-mix(in_oklab,var(--foreground)_90%,var(--background))] group-focus-visible/button:[--btn-bg:color-mix(in_oklab,var(--foreground)_80%,var(--background))] group-active/button:[--btn-bg:color-mix(in_oklab,var(--foreground)_80%,var(--background))] bg-[var(--btn-bg)] shadow-[0_0_0_1px_var(--btn-bg)] group-active/button:shadow-[0_0_0_0px_var(--btn-bg)]",secondary:"[--btn-bg:var(--accent)] group-hover/button:[--btn-bg:color-mix(in_oklab,var(--accent)_80%,var(--background))] group-focus-visible/button:[--btn-bg:var(--selected)] group-active/button:[--btn-bg:var(--accent)] bg-[var(--btn-bg)] shadow-[0_0_0_1px_var(--btn-bg)] group-active/button:shadow-[0_0_0_0px_var(--btn-bg)]",tertiary:"bg-transparent shadow-[0_0_0_1px_var(--border),inset_0_0_0_0px_var(--border)] group-hover/button:bg-hover group-focus-visible/button:bg-active group-active/button:bg-active group-active/button:shadow-[0_0_0_0px_var(--border),inset_0_0_0_1px_var(--border)]",ghost:"bg-transparent shadow-[0_0_0_1px_transparent] group-hover/button:bg-hover group-hover/button:shadow-[0_0_0_1px_var(--hover)] group-focus-visible/button:bg-active group-focus-visible/button:shadow-[0_0_0_1px_var(--active)] group-active/button:bg-active group-active/button:shadow-[0_0_0_0px_var(--active)] group-aria-expanded/button:bg-active group-aria-expanded/button:shadow-[0_0_0_0px_var(--active)] group-aria-pressed/button:bg-active group-aria-pressed/button:shadow-[0_0_0_0px_var(--active)] group-aria-expanded/button:group-focus-visible/button:bg-selected group-aria-pressed/button:group-focus-visible/button:bg-selected"},s5=g.forwardRef(({className:e,variant:t,size:n,isLoading:r=!1,leadingIcon:s,trailingIcon:i,disabled:o,children:c,type:u="button",...d},f)=>{const p=t??"secondary",m=n??"default",v=m==="icon"||m==="icon-compact",_=m==="compact"||m==="icon-compact",w=_?PA.compact:PA.default;return P.jsxs("button",{...d,ref:f,type:u,disabled:o||r,"aria-busy":r||d["aria-busy"],className:or(ane({variant:p,size:m,iconLeft:!v&&!!s,iconRight:!v&&!!i}),"rounded-lg",e),children:[P.jsx("span",{"aria-hidden":!0,className:or("absolute inset-px rounded-[inherit] transition-[box-shadow,background-color] [transition-duration:180ms,80ms] [transition-timing-function:cubic-bezier(0.23,1,0.32,1),ease] group-active/button:[transition-duration:80ms,80ms] motion-reduce:transition-none",lne[p])}),P.jsxs("span",{className:"relative inline-flex items-center justify-center gap-[inherit]",children:[P.jsxs("span",{className:or("inline-flex items-center justify-center gap-[inherit]",r&&"opacity-0"),children:[s&&!v?P.jsx(s,{size:w,weight:"regular","aria-hidden":!0}):null,P.jsx("span",{className:"[text-box:trim-both_cap_alphabetic]",children:c}),i&&!v?P.jsx(i,{size:w,weight:"regular","aria-hidden":!0}):null]}),r?P.jsx("span",{"aria-hidden":!0,className:"absolute inset-0 flex items-center justify-center",children:P.jsx("svg",{className:_?"h-7 w-7":"h-9 w-9",viewBox:"0 0 24 24",fill:"none",children:P.jsx("path",{d:"M 12 12 C 14 8.5 19 8.5 19 12 C 19 15.5 14 15.5 12 12 C 10 8.5 5 8.5 5 12 C 5 15.5 10 15.5 12 12 Z",stroke:"currentColor",strokeWidth:"1.125",strokeLinecap:"round",pathLength:"100",className:"motion-safe:animate-[spinner-move_2s_linear_infinite,spinner-dash_4s_ease-in-out_infinite]",style:{strokeDasharray:"15 85"}})})}):null]})]})});s5.displayName="Button";var cne=Object.defineProperty,Rd=(e,t)=>cne(e,"name",{value:t,configurable:!0}),i5=!!(typeof window<"u"&&window.document&&window.document.createElement);function gr(e,t,{checkForDefaultPrevented:n=!0}={}){return Rd(function(s){if(e==null||e(s),n===!1||!s||!s.defaultPrevented)return t==null?void 0:t(s)},"handleEvent")}Rd(gr,"composeEventHandlers");function une(e){var t;if(!i5)throw new Error("Cannot access window outside of the DOM");return((t=e==null?void 0:e.ownerDocument)==null?void 0:t.defaultView)??window}Rd(une,"getOwnerWindow");function b2(e){if(!i5)throw new Error("Cannot access document outside of the DOM");return(e==null?void 0:e.ownerDocument)??document}Rd(b2,"getOwnerDocument");function o5(e,t=!1){const{activeElement:n}=b2(e);if(!(n!=null&&n.nodeName))return null;if(a5(n)&&n.contentDocument)return o5(n.contentDocument.body,t);if(t){const r=n.getAttribute("aria-activedescendant");if(r){const s=b2(n).getElementById(r);if(s)return s}}return n}Rd(o5,"getActiveElement");function a5(e){return e.tagName==="IFRAME"}Rd(a5,"isFrame");var dne=Object.defineProperty,Tx=(e,t)=>dne(e,"name",{value:t,configurable:!0});function x2(e,t){if(typeof e=="function")return e(t);e!=null&&(e.current=t)}Tx(x2,"setRef");function l5(...e){return t=>{let n=!1;const r=e.map(s=>{const i=x2(s,t);return!n&&typeof i=="function"&&(n=!0),i});if(n)return()=>{for(let s=0;s<r.length;s++){const i=r[s];typeof i=="function"?i():x2(e[s],null)}}}}Tx(l5,"composeRefs");function gs(...e){return g.useCallback(l5(...e),e)}Tx(gs,"useComposedRefs");var fne=Object.defineProperty,fi=(e,t)=>fne(e,"name",{value:t,configurable:!0});function hne(e,t){const n=g.createContext(t);n.displayName=e+"Context";const r=fi(i=>{const{children:o,...c}=i,u=g.useMemo(()=>c,Object.values(c));return P.jsx(n.Provider,{value:u,children:o})},"Provider");r.displayName=e+"Provider";function s(i,o={}){const{optional:c=!1}=o,u=g.useContext(n);if(u)return u;if(t!==void 0)return t;if(!c)throw new Error(`\`${i}\` must be used within \`${e}\``)}return fi(s,"useContext"),[r,s]}fi(hne,"createContext");function Gh(e,t=[]){let n=[];function r(i,o){const c=g.createContext(o);c.displayName=i+"Context";const u=n.length;n=[...n,o];const d=fi(p=>{var S;const{scope:m,children:v,..._}=p,w=((S=m==null?void 0:m[e])==null?void 0:S[u])||c,b=g.useMemo(()=>_,Object.values(_));return P.jsx(w.Provider,{value:b,children:v})},"Provider");d.displayName=i+"Provider";function f(p,m,v={}){var S;const{optional:_=!1}=v,w=((S=m==null?void 0:m[e])==null?void 0:S[u])||c,b=g.useContext(w);if(b)return b;if(o!==void 0)return o;if(!_)throw new Error(`\`${p}\` must be used within \`${i}\``)}return fi(f,"useContext"),[d,f]}fi(r,"createContext");const s=fi(()=>{const i=n.map(o=>g.createContext(o));return fi(function(c){const u=(c==null?void 0:c[e])||i;return g.useMemo(()=>({[`__scope${e}`]:{...c,[e]:u}}),[c,u])},"useScope")},"createScope");return s.scopeName=e,[r,c5(s,...t)]}fi(Gh,"createContextScope");function c5(...e){const t=e[0];if(e.length===1)return t;const n=fi(()=>{const r=e.map(s=>({useScope:s(),scopeName:s.scopeName}));return fi(function(i){const o=r.reduce((c,{useScope:u,scopeName:d})=>{const p=u(i)[`__scope${d}`];return{...c,...p}},{});return g.useMemo(()=>({[`__scope${t.scopeName}`]:o}),[o])},"useComposedScopes")},"createScope");return n.scopeName=t.scopeName,n}fi(c5,"composeContextScopes");var Id=aL();const pne=Sg(Id);var mne=Object.defineProperty,Qs=(e,t)=>mne(e,"name",{value:t,configurable:!0});function Hg(e){const t=g.forwardRef((n,r)=>{let{children:s,...i}=n,o=null,c=!1;const u=[];s=g5(s),g.Children.forEach(s,m=>{var v;if(p5(m)){c=!0;const _=m;let w="child"in _.props?_.props.child:_.props.children;for(;Rx(w)&&typeof dg=="function";)w=dg(w._payload);o=gne(_,w),u.push((v=o==null?void 0:o.props)==null?void 0:v.children)}else u.push(m)}),o?o=g.cloneElement(o,void 0,u):!c&&g.Children.count(s)===1&&g.isValidElement(s)&&(o=s);const d=o?h5(o):void 0,f=gs(r,d);if(!o){if(s||s===0)throw new Error(c?_ne(e):yne(e));return s}const p=f5(i,o.props??{});return o.type!==g.Fragment&&(p.ref=r?f:d),g.cloneElement(o,p)});return t.displayName=`${e}.Slot`,t}Qs(Hg,"createSlot");var u5=Symbol.for("radix.slottable");function d5(e){const t=Qs(n=>"child"in n?n.children(n.child):n.children,"Slottable");return t.displayName=`${e}.Slottable`,t.__radixId=u5,t}Qs(d5,"createSlottable");var gne=Qs((e,t)=>"child"in e.props?g.isValidElement(t)?g.cloneElement(t,void 0,e.props.children(t.props.children)):null:g.isValidElement(t)?t:null,"getSlottableElementFromSlottable");function f5(e,t){const n={...t};for(const r in t){const s=e[r],i=t[r];/^on[A-Z]/.test(r)?s&&i?n[r]=(...c)=>{const u=i(...c);return s(...c),u}:s&&(n[r]=s):r==="style"?n[r]={...s,...i}:r==="className"?n[r]=[s,i].filter(Boolean).join(" "):r==="aria-describedby"&&(n[r]=v5(i,s))}return{...e,...n}}Qs(f5,"mergeProps");function h5(e){var r,s;let t=(r=Object.getOwnPropertyDescriptor(e.props,"ref"))==null?void 0:r.get,n=t&&"isReactWarning"in t&&t.isReactWarning;return n?e.ref:(t=(s=Object.getOwnPropertyDescriptor(e,"ref"))==null?void 0:s.get,n=t&&"isReactWarning"in t&&t.isReactWarning,n?e.props.ref:e.props.ref||e.ref)}Qs(h5,"getElementRef");function p5(e){return g.isValidElement(e)&&typeof e.type=="function"&&"__radixId"in e.type&&e.type.__radixId===u5}Qs(p5,"isSlottable");var vne=Symbol.for("react.lazy");function Rx(e){return e!=null&&typeof e=="object"&&"$$typeof"in e&&e.$$typeof===vne&&"_payload"in e&&m5(e._payload)}Qs(Rx,"isLazyComponent");function m5(e){return typeof e=="object"&&e!==null&&"then"in e}Qs(m5,"isPromiseLike");function g5(e){let t=e;for(;Rx(t)&&typeof dg=="function";)t=dg(t._payload);return t}Qs(g5,"useUnwrappedLazy");function v5(...e){const t=new Set;for(const n of e)if(typeof n=="string")for(const r of String(n).trim().split(/\s+/))r&&t.add(r);return t.size>0?Array.from(t).join(" "):void 0}Qs(v5,"concatAriaDescribedby");var yne=Qs(e=>`${e} failed to slot onto its children. Expected a single React element child or \`Slottable\`.`,"createSlotError"),_ne=Qs(e=>`${e} failed to slot onto its \`Slottable\`. Expected \`Slottable\` to receive a single React element child.`,"createSlottableError"),dg=bd[" use ".trim().toString()],wne=Object.defineProperty,bne=(e,t)=>wne(e,"name",{value:t,configurable:!0}),xne=["a","button","div","form","h2","h3","img","input","label","li","nav","ol","p","select","span","svg","ul"],Xs=xne.reduce((e,t)=>{const n=Hg(`Primitive.${t}`),r=g.forwardRef((s,i)=>{const{asChild:o,...c}=s,u=o?n:t;return typeof window<"u"&&(window[Symbol.for("radix-ui")]=!0),P.jsx(u,{...c,ref:i})});return r.displayName=`Primitive.${t}`,{...e,[t]:r}},{});function y5(e,t){e&&Id.flushSync(()=>e.dispatchEvent(t))}bne(y5,"dispatchDiscreteCustomEvent");var Rs=globalThis!=null&&globalThis.document?g.useLayoutEffect:()=>{},Sne=Object.defineProperty,Ene=(e,t)=>Sne(e,"name",{value:t,configurable:!0}),AA=bd[" useInsertionEffect ".trim().toString()];function Ec(e){const t=g.useRef(e);return typeof AA=="function"?AA(()=>{t.current=e}):Rs(()=>{t.current=e}),g.useMemo(()=>((...n)=>{var r;return(r=t.current)==null?void 0:r.call(t,...n)}),[])}Ene(Ec,"useCallbackRef");var kne=Object.defineProperty,Tr=(e,t)=>kne(e,"name",{value:t,configurable:!0}),S2="dismissableLayer.update",Cne="dismissableLayer.pointerDownOutside",Pne="dismissableLayer.focusOutside",TA,_5=g.createContext({layers:new Set,layersWithOutsidePointerEventsDisabled:new Set,branches:new Set,dismissableSurfaces:new Set}),Ix=g.forwardRef(Tr(function(t,n){const{disableOutsidePointerEvents:r=!1,deferPointerDownOutside:s=!1,onEscapeKeyDown:i,onPointerDownOutside:o,onFocusOutside:c,onInteractOutside:u,onDismiss:d,...f}=t,p=g.useContext(_5),[m,v]=g.useState(null),_=(m==null?void 0:m.ownerDocument)??(globalThis==null?void 0:globalThis.document),[,w]=g.useState({}),b=gs(n,v),S=Array.from(p.layers),[E]=[...p.layersWithOutsidePointerEventsDisabled].slice(-1),C=E?S.indexOf(E):-1,A=m?S.indexOf(m):-1,T=p.layersWithOutsidePointerEventsDisabled.size>0,M=A>=C,O=g.useRef(!1),R=b5(H=>{o==null||o(H),u==null||u(H),H.defaultPrevented||d==null||d()},{ownerDocument:_,deferPointerDownOutside:s,isDeferredPointerDownOutsideRef:O,dismissableSurfaces:p.dismissableSurfaces,shouldHandlePointerDownOutside:g.useCallback(H=>{if(!(H instanceof Node))return!1;const Y=[...p.branches].some(J=>J.contains(H));return M&&!Y},[p.branches,M])}),D=x5(H=>{if(s&&O.current)return;const Y=H.target;[...p.branches].some(V=>V.contains(Y))||(c==null||c(H),u==null||u(H),H.defaultPrevented||d==null||d())},_),U=m?A===S.length-1:!1,W=Ec(H=>{H.key==="Escape"&&(i==null||i(H),!H.defaultPrevented&&d&&(H.preventDefault(),d()))});return g.useEffect(()=>{if(U)return _.addEventListener("keydown",W,{capture:!0}),()=>_.removeEventListener("keydown",W,{capture:!0})},[_,U,W]),g.useEffect(()=>{if(m)return r&&(p.layersWithOutsidePointerEventsDisabled.size===0&&(TA=_.body.style.pointerEvents,_.body.style.pointerEvents="none"),p.layersWithOutsidePointerEventsDisabled.add(m)),p.layers.add(m),E2(),()=>{r&&(p.layersWithOutsidePointerEventsDisabled.delete(m),p.layersWithOutsidePointerEventsDisabled.size===0&&(_.body.style.pointerEvents=TA))}},[m,_,r,p]),g.useEffect(()=>()=>{m&&(p.layers.delete(m),p.layersWithOutsidePointerEventsDisabled.delete(m),E2())},[m,p]),g.useEffect(()=>{const H=Tr(()=>w({}),"handleUpdate");return document.addEventListener(S2,H),()=>document.removeEventListener(S2,H)},[]),P.jsx(Xs.div,{...f,ref:b,style:{pointerEvents:T?M?"auto":"none":void 0,...t.style},onFocusCapture:gr(t.onFocusCapture,D.onFocusCapture),onBlurCapture:gr(t.onBlurCapture,D.onBlurCapture),onPointerDownCapture:gr(t.onPointerDownCapture,R.onPointerDownCapture)})},"DismissableLayer"));function w5(){const e=g.useContext(_5),[t,n]=g.useState(null);return g.useEffect(()=>{if(t)return e.dismissableSurfaces.add(t),()=>{e.dismissableSurfaces.delete(t)}},[t,e.dismissableSurfaces]),n}Tr(w5,"useDismissableLayerSurface");var Ane=Tr(()=>!0,"IS_TRUE");function b5(e,t){const{ownerDocument:n=globalThis==null?void 0:globalThis.document,deferPointerDownOutside:r=!1,isDeferredPointerDownOutsideRef:s,dismissableSurfaces:i,shouldHandlePointerDownOutside:o=Ane}=t,c=Ec(e),u=g.useRef(!1),d=g.useRef(!1),f=g.useRef(new Map),p=g.useRef(()=>{});return g.useEffect(()=>{function m(){d.current=!1,s.current=!1,f.current.clear()}Tr(m,"resetOutsideInteraction");function v(){return Array.from(f.current.values()).some(Boolean)}Tr(v,"isOutsideInteractionIntercepted");function _(C){if(!d.current)return;const A=C.target;A instanceof Node&&[...i].some(M=>M.contains(A))||f.current.set(C.type,!0),C.type==="click"&&window.setTimeout(()=>{d.current&&p.current()},0)}Tr(_,"handleInteractionCapture");function w(C){d.current&&f.current.set(C.type,!1)}Tr(w,"handleInteractionBubble");const b=Tr(C=>{if(C.target&&!u.current){let A=function(){n.removeEventListener("click",p.current);const M=v();m(),M||Ox(Cne,c,T,{discrete:!0})};if(Tr(A,"handleAndDispatchPointerDownOutsideEvent"),!o(C.target)){n.removeEventListener("click",p.current),m(),u.current=!1;return}const T={originalEvent:C};d.current=!0,s.current=r&&C.button===0,f.current.clear(),!r||C.button!==0?A():(n.removeEventListener("click",p.current),p.current=A,n.addEventListener("click",p.current,{once:!0}))}else n.removeEventListener("click",p.current),m();u.current=!1},"handlePointerDown"),S=["pointerup","mousedown","mouseup","touchstart","touchend","click"];for(const C of S)n.addEventListener(C,_,!0),n.addEventListener(C,w);const E=window.setTimeout(()=>{n.addEventListener("pointerdown",b)},0);return()=>{window.clearTimeout(E),n.removeEventListener("pointerdown",b),n.removeEventListener("click",p.current);for(const C of S)n.removeEventListener(C,_,!0),n.removeEventListener(C,w)}},[n,c,r,s,i,o]),{onPointerDownCapture:Tr(()=>u.current=!0,"onPointerDownCapture")}}Tr(b5,"usePointerDownOutside");function x5(e,t=globalThis==null?void 0:globalThis.document){const n=Ec(e),r=g.useRef(!1);return g.useEffect(()=>{const s=Tr(i=>{i.target&&!r.current&&Ox(Pne,n,{originalEvent:i},{discrete:!1})},"handleFocus");return t.addEventListener("focusin",s),()=>t.removeEventListener("focusin",s)},[t,n]),{onFocusCapture:Tr(()=>r.current=!0,"onFocusCapture"),onBlurCapture:Tr(()=>r.current=!1,"onBlurCapture")}}Tr(x5,"useFocusOutside");function E2(){const e=new CustomEvent(S2);document.dispatchEvent(e)}Tr(E2,"dispatchUpdate");function Ox(e,t,n,{discrete:r}){const s=n.originalEvent.target,i=new CustomEvent(e,{bubbles:!1,cancelable:!0,detail:n});t&&s.addEventListener(e,t,{once:!0}),r?y5(s,i):s.dispatchEvent(i)}Tr(Ox,"handleAndDispatchCustomEvent");var Tne=Object.defineProperty,ar=(e,t)=>Tne(e,"name",{value:t,configurable:!0}),i_="focusScope.autoFocusOnMount",o_="focusScope.autoFocusOnUnmount",RA={bubbles:!1,cancelable:!0},S5=g.forwardRef(ar(function(t,n){const{loop:r=!1,trapped:s=!1,branches:i,onMountAutoFocus:o,onUnmountAutoFocus:c,...u}=t,[d,f]=g.useState(null),p=Ec(o),m=Ec(c),v=g.useRef(null),_=gs(n,f),w=g.useRef(i);g.useEffect(()=>{w.current=i});const b=g.useCallback(C=>{var A;return C?d!=null&&d.contains(C)?!0:!!((A=w.current)!=null&&A.some(T=>T.contains(C))):!1},[d]),S=g.useRef({paused:!1,pause(){this.paused=!0},resume(){this.paused=!1}}).current;g.useEffect(()=>{if(s){let C=function(O){if(S.paused||!d)return;const R=O.target;b(R)?v.current=R:Bo(v.current,{select:!0})},A=function(O){if(S.paused||!d)return;const R=O.relatedTarget;R!==null&&(b(R)||Bo(v.current,{select:!0}))},T=function(O){if(document.activeElement===document.body)for(const D of O)D.removedNodes.length>0&&Bo(d)};ar(C,"handleFocusIn"),ar(A,"handleFocusOut"),ar(T,"handleMutations"),document.addEventListener("focusin",C),document.addEventListener("focusout",A);const M=new MutationObserver(T);return d&&M.observe(d,{childList:!0,subtree:!0}),()=>{document.removeEventListener("focusin",C),document.removeEventListener("focusout",A),M.disconnect()}}},[s,d,S.paused,b]),g.useEffect(()=>{if(d){IA.add(S);const C=document.activeElement;if(!d.contains(C)){const T=new CustomEvent(i_,RA);d.addEventListener(i_,p),d.dispatchEvent(T),T.defaultPrevented||(k5(R5($x(d)),{select:!0}),document.activeElement===C&&Bo(d))}return()=>{d.removeEventListener(i_,p);const T=d.ownerDocument,M=CustomEvent;setTimeout(()=>{const O=new M(o_,RA);d.addEventListener(o_,m),d.dispatchEvent(O),O.defaultPrevented||Bo(C??T.body,{select:!0}),d.removeEventListener(o_,m),IA.remove(S)},0)}}},[d,p,m,S]);const E=g.useCallback(C=>{if(!r&&!s||S.paused)return;const A=C.key==="Tab"&&!C.altKey&&!C.ctrlKey&&!C.metaKey,T=document.activeElement;if(A&&T){const M=C.currentTarget,[O,R]=C5(M);O&&R?!C.shiftKey&&T===R?(C.preventDefault(),r&&Bo(O,{select:!0})):C.shiftKey&&T===O&&(C.preventDefault(),r&&Bo(R,{select:!0})):T===M&&C.preventDefault()}},[r,s,S.paused]);return P.jsx(Xs.div,{tabIndex:-1,...u,ref:_,onKeyDown:E})},"FocusScope")),E5=g.createContext(null);function Mx({registry:e,children:t}){return e?P.jsx(E5.Provider,{value:e,children:t}):t}ar(Mx,"FocusScopeBranchProvider");function Nx(){const[e,t]=g.useState([]),n=g.useMemo(()=>({add:ar(r=>t(s=>s.includes(r)?s:[...s,r]),"add"),remove:ar(r=>t(s=>s.filter(i=>i!==r)),"remove")}),[]);return{nodes:e,registry:n}}ar(Nx,"useFocusScopeBranchRegistry");function Lx(e){const t=g.useContext(E5);g.useEffect(()=>{if(!(!e||!t))return t.add(e),()=>t.remove(e)},[e,t])}ar(Lx,"useFocusScopeBranch");function k5(e,{select:t=!1}={}){const n=document.activeElement;for(const r of e)if(Bo(r,{select:t}),document.activeElement!==n)return}ar(k5,"focusFirst");function C5(e){const t=$x(e),n=k2(t,e),r=k2(t.reverse(),e);return[n,r]}ar(C5,"getTabbableEdges");function $x(e){const t=[],r=e.ownerDocument.createTreeWalker(e,NodeFilter.SHOW_ELEMENT,{acceptNode:ar(s=>{const i=s.tagName==="INPUT"&&s.type==="hidden";return s.disabled||s.hidden||i?NodeFilter.FILTER_SKIP:s.tabIndex>=0?NodeFilter.FILTER_ACCEPT:NodeFilter.FILTER_SKIP},"acceptNode")});for(;r.nextNode();)t.push(r.currentNode);return t}ar($x,"getTabbableCandidates");function k2(e,t){const n=typeof t.checkVisibility=="function"&&t.checkVisibility({checkVisibilityCSS:!0});for(const r of e)if(!(n?!r.checkVisibility({checkVisibilityCSS:!0}):P5(r,{upTo:t})))return r}ar(k2,"findVisible");function P5(e,{upTo:t}){if(getComputedStyle(e).visibility==="hidden")return!0;for(;e;){if(t!==void 0&&e===t)return!1;if(getComputedStyle(e).display==="none")return!0;e=e.parentElement}return!1}ar(P5,"isHidden");function A5(e){return e.tagName==="INPUT"&&typeof e.select=="function"}ar(A5,"isSelectableInput");function Bo(e,{select:t=!1}={}){if(e&&e.focus){const r=(e.ownerDocument??document).activeElement;e.focus({preventScroll:!0}),e!==r&&A5(e)&&t&&e.select()}}ar(Bo,"focus");var IA=T5();function T5(){let e=[];return{add(t){const n=e[0];t!==n&&(n==null||n.pause()),e=C2(e,t),e.unshift(t)},remove(t){var n;e=C2(e,t),(n=e[0])==null||n.resume()}}}ar(T5,"createFocusScopesStack");function C2(e,t){const n=[...e],r=n.indexOf(t);return r!==-1&&n.splice(r,1),n}ar(C2,"arrayRemove");function R5(e){return e.filter(t=>t.tagName!=="A")}ar(R5,"removeLinks");var Rne=Object.defineProperty,Ine=(e,t)=>Rne(e,"name",{value:t,configurable:!0}),One=bd[" useId ".trim().toString()]||(()=>{}),Mne=0;function ol(e){const[t,n]=g.useState(One());return Rs(()=>{e||n(r=>r??String(Mne++))},[e]),e||(t?`radix-${t}`:"")}Ine(ol,"useId");const Nne=["top","right","bottom","left"],ml=Math.min,na=Math.max,fg=Math.round,Am=Math.floor,ra=e=>({x:e,y:e}),Lne={left:"right",right:"left",bottom:"top",top:"bottom"};function I5(e,t,n){return na(e,ml(t,n))}function la(e,t){return typeof e=="function"?e(t):e}function gl(e){return e.split("-")[0]}function Od(e){return e.split("-")[1]}function Dx(e){return e==="x"?"y":"x"}function Fx(e){return e==="y"?"height":"width"}function po(e){const t=e[0];return t==="t"||t==="b"?"y":"x"}function jx(e){return Dx(po(e))}function $ne(e,t,n){n===void 0&&(n=!1);const r=Od(e),s=jx(e),i=Fx(s);let o=s==="x"?r===(n?"end":"start")?"right":"left":r==="start"?"bottom":"top";return t.reference[i]>t.floating[i]&&(o=hg(o)),[o,hg(o)]}function Dne(e){const t=hg(e);return[P2(e),t,P2(t)]}function P2(e){return e.includes("start")?e.replace("start","end"):e.replace("end","start")}const OA=["left","right"],MA=["right","left"],Fne=["top","bottom"],jne=["bottom","top"];function zne(e,t,n){switch(e){case"top":case"bottom":return n?t?MA:OA:t?OA:MA;case"left":case"right":return t?Fne:jne;default:return[]}}function Vne(e,t,n,r){const s=Od(e);let i=zne(gl(e),n==="start",r);return s&&(i=i.map(o=>o+"-"+s),t&&(i=i.concat(i.map(P2)))),i}function hg(e){const t=gl(e);return Lne[t]+e.slice(t.length)}function Hne(e){var t,n,r,s;return{top:(t=e.top)!=null?t:0,right:(n=e.right)!=null?n:0,bottom:(r=e.bottom)!=null?r:0,left:(s=e.left)!=null?s:0}}function O5(e){return typeof e!="number"?Hne(e):{top:e,right:e,bottom:e,left:e}}function pg(e){const{x:t,y:n,width:r,height:s}=e;return{width:r,height:s,top:n,left:t,right:t+r,bottom:n+s,x:t,y:n}}function NA(e,t,n){let{reference:r,floating:s}=e;const i=po(t),o=jx(t),c=Fx(o),u=gl(t),d=i==="y",f=r.x+r.width/2-s.width/2,p=r.y+r.height/2-s.height/2,m=r[c]/2-s[c]/2;let v;switch(u){case"top":v={x:f,y:r.y-s.height};break;case"bottom":v={x:f,y:r.y+r.height};break;case"right":v={x:r.x+r.width,y:p};break;case"left":v={x:r.x-s.width,y:p};break;default:v={x:r.x,y:r.y}}const _=Od(t);return _&&(v[o]+=m*(_==="end"?1:-1)*(n&&d?-1:1)),v}async function Une(e,t){var n;t===void 0&&(t={});const{x:r,y:s,platform:i,rects:o,elements:c,strategy:u}=e,{boundary:d="clippingAncestors",rootBoundary:f="viewport",elementContext:p="floating",altBoundary:m=!1,padding:v=0}=la(t,e),_=O5(v),b=c[m?p==="floating"?"reference":"floating":p],S=pg(await i.getClippingRect({element:(n=await(i.isElement==null?void 0:i.isElement(b)))==null||n?b:b.contextElement||await(i.getDocumentElement==null?void 0:i.getDocumentElement(c.floating)),boundary:d,rootBoundary:f,strategy:u})),E=p==="floating"?{x:r,y:s,width:o.floating.width,height:o.floating.height}:o.reference,C=await(i.getOffsetParent==null?void 0:i.getOffsetParent(c.floating)),A=await(i.isElement==null?void 0:i.isElement(C))&&await(i.getScale==null?void 0:i.getScale(C))||{x:1,y:1},T=pg(i.convertOffsetParentRelativeRectToViewportRelativeRect?await i.convertOffsetParentRelativeRectToViewportRelativeRect({elements:c,rect:E,offsetParent:C,strategy:u}):E);return{top:(S.top-T.top+_.top)/A.y,bottom:(T.bottom-S.bottom+_.bottom)/A.y,left:(S.left-T.left+_.left)/A.x,right:(T.right-S.right+_.right)/A.x}}const Zne=50,Bne=async(e,t,n)=>{const{placement:r="bottom",strategy:s="absolute",middleware:i=[],platform:o}=n,c=o.detectOverflow?o:{...o,detectOverflow:Une},u=await(o.isRTL==null?void 0:o.isRTL(t));let d=await o.getElementRects({reference:e,floating:t,strategy:s}),{x:f,y:p}=NA(d,r,u),m=r,v=0;const _={};for(let w=0;w<i.length;w++){const b=i[w];if(!b)continue;const{name:S,fn:E}=b,{x:C,y:A,data:T,reset:M}=await E({x:f,y:p,initialPlacement:r,placement:m,strategy:s,middlewareData:_,rects:d,platform:c,elements:{reference:e,floating:t}});f=C??f,p=A??p,_[S]={..._[S],...T},M&&v<Zne&&(v++,typeof M=="object"&&(M.placement&&(m=M.placement),M.rects&&(d=M.rects===!0?await o.getElementRects({reference:e,floating:t,strategy:s}):M.rects),{x:f,y:p}=NA(d,m,u)),w=-1)}return{x:f,y:p,placement:m,strategy:s,middlewareData:_}},Wne=e=>({name:"arrow",options:e,async fn(t){const{x:n,y:r,placement:s,rects:i,platform:o,elements:c,middlewareData:u}=t,{element:d,padding:f=0}=la(e,t)||{};if(d==null)return{};const p=O5(f),m={x:n,y:r},v=jx(s),_=Fx(v),w=await o.getDimensions(d),b=v==="y",S=b?"top":"left",E=b?"bottom":"right",C=b?"clientHeight":"clientWidth",A=i.reference[_]+i.reference[v]-m[v]-i.floating[_],T=m[v]-i.reference[v],M=await(o.getOffsetParent==null?void 0:o.getOffsetParent(d));let O=M?M[C]:0;(!O||!await(o.isElement==null?void 0:o.isElement(M)))&&(O=c.floating[C]||i.floating[_]);const R=A/2-T/2,D=O/2-w[_]/2-1,U=ml(p[S],D),W=ml(p[E],D),H=O-w[_]-W,Y=O/2-w[_]/2+R,J=I5(U,Y,H),V=!u.arrow&&Od(s)!=null&&Y!==J&&i.reference[_]/2-(Y<U?U:W)-w[_]/2<0,q=V?Y<U?Y-U:Y-H:0;return{[v]:m[v]+q,data:{[v]:J,centerOffset:Y-J-q,...V&&{alignmentOffset:q}},reset:V}}}),Kne=function(e){return e===void 0&&(e={}),{name:"flip",options:e,async fn(t){var n,r;const{placement:s,middlewareData:i,rects:o,initialPlacement:c,platform:u,elements:d}=t,{mainAxis:f=!0,crossAxis:p=!0,fallbackPlacements:m,fallbackStrategy:v="bestFit",fallbackAxisSideDirection:_="none",flipAlignment:w=!0,...b}=la(e,t);if((n=i.arrow)!=null&&n.alignmentOffset)return{};const S=gl(s),E=po(c),C=gl(c)===c,A=await(u.isRTL==null?void 0:u.isRTL(d.floating)),T=m||(C||!w?[hg(c)]:Dne(c)),M=_!=="none";!m&&M&&T.push(...Vne(c,w,_,A));const O=[c,...T],R=await u.detectOverflow(t,b),D=[];let U=((r=i.flip)==null?void 0:r.overflows)||[];if(f&&D.push(R[S]),p){const J=$ne(s,o,A);D.push(R[J[0]],R[J[1]])}if(U=[...U,{placement:s,overflows:D}],!D.every(J=>J<=0)){var W,H;const J=(((W=i.flip)==null?void 0:W.index)||0)+1,V=O[J];if(V&&(!(p==="alignment"?E!==po(V):!1)||U.every(F=>po(F.placement)===E?F.overflows[0]>0:!0)))return{data:{index:J,overflows:U},reset:{placement:V}};let q=(H=U.filter(ee=>ee.overflows[0]<=0).sort((ee,F)=>ee.overflows[1]-F.overflows[1])[0])==null?void 0:H.placement;if(!q)switch(v){case"bestFit":{var Y;const ee=(Y=U.filter(F=>{if(M){const X=po(F.placement);return X===E||X==="y"}return!0}).map(F=>[F.placement,F.overflows.filter(X=>X>0).reduce((X,B)=>X+B,0)]).sort((F,X)=>F[1]-X[1])[0])==null?void 0:Y[0];ee&&(q=ee);break}case"initialPlacement":q=c;break}if(s!==q)return{reset:{placement:q}}}return{}}}};function LA(e,t){return{top:e.top-t.height,right:e.right-t.width,bottom:e.bottom-t.height,left:e.left-t.width}}function $A(e){return Nne.some(t=>e[t]>=0)}const Gne=function(e){return e===void 0&&(e={}),{name:"hide",options:e,async fn(t){const{rects:n,platform:r}=t,{strategy:s="referenceHidden",...i}=la(e,t);switch(s){case"referenceHidden":{const o=await r.detectOverflow(t,{...i,elementContext:"reference"}),c=LA(o,n.reference);return{data:{referenceHiddenOffsets:c,referenceHidden:$A(c)}}}case"escaped":{const o=await r.detectOverflow(t,{...i,altBoundary:!0}),c=LA(o,n.floating);return{data:{escapedOffsets:c,escaped:$A(c)}}}default:return{}}}}},M5=new Set(["left","top"]);async function qne(e,t){const{placement:n,platform:r,elements:s}=e,i=await(r.isRTL==null?void 0:r.isRTL(s.floating)),o=gl(n),c=Od(n),u=po(n)==="y",d=M5.has(o)?-1:1,f=i&&u?-1:1,p=la(t,e);let{mainAxis:m,crossAxis:v,alignmentAxis:_}=typeof p=="number"?{mainAxis:p,crossAxis:0,alignmentAxis:null}:{mainAxis:p.mainAxis||0,crossAxis:p.crossAxis||0,alignmentAxis:p.alignmentAxis};return c&&typeof _=="number"&&(v=c==="end"?_*-1:_),u?{x:v*f,y:m*d}:{x:m*d,y:v*f}}const Yne=function(e){return e===void 0&&(e=0),{name:"offset",options:e,async fn(t){var n,r;const{x:s,y:i,placement:o,middlewareData:c}=t,u=await qne(t,e);return o===((n=c.offset)==null?void 0:n.placement)&&(r=c.arrow)!=null&&r.alignmentOffset?{}:{x:s+u.x,y:i+u.y,data:{...u,placement:o}}}}},Qne=function(e){return e===void 0&&(e={}),{name:"shift",options:e,async fn(t){const{x:n,y:r,placement:s,platform:i}=t,{mainAxis:o=!0,crossAxis:c=!1,limiter:u={fn:E=>{let{x:C,y:A}=E;return{x:C,y:A}}},...d}=la(e,t),f={x:n,y:r},p=await i.detectOverflow(t,d),m=po(s),v=Dx(m);let _=f[v],w=f[m];const b=(E,C)=>I5(C+p[E==="y"?"top":"left"],C,C-p[E==="y"?"bottom":"right"]);o&&(_=b(v,_)),c&&(w=b(m,w));const S=u.fn({...t,[v]:_,[m]:w});return{...S,data:{x:S.x-n,y:S.y-r,enabled:{[v]:o,[m]:c}}}}}},Xne=function(e){return e===void 0&&(e={}),{options:e,fn(t){var n,r;const{x:s,y:i,placement:o,rects:c,middlewareData:u}=t,{offset:d=0,mainAxis:f=!0,crossAxis:p=!0}=la(e,t),m={x:s,y:i},v=po(o),_=Dx(v);let w=m[_],b=m[v];const S=la(d,t),E=typeof S=="number"?{mainAxis:S,crossAxis:0}:{mainAxis:(n=S.mainAxis)!=null?n:0,crossAxis:(r=S.crossAxis)!=null?r:0};if(f){const T=_==="y"?"height":"width",M=c.reference[_]-c.floating[T]+E.mainAxis,O=c.reference[_]+c.reference[T]-E.mainAxis;w<M?w=M:w>O&&(w=O)}if(p){var C,A;const T=_==="y"?"width":"height",M=M5.has(gl(o)),O=c.reference[v]-c.floating[T]+(M&&((C=u.offset)==null?void 0:C[v])||0)+(M?0:E.crossAxis),R=c.reference[v]+c.reference[T]+(M?0:((A=u.offset)==null?void 0:A[v])||0)-(M?E.crossAxis:0);b<O?b=O:b>R&&(b=R)}return{[_]:w,[v]:b}}}},Jne=function(e){return e===void 0&&(e={}),{name:"size",options:e,async fn(t){const{placement:n,rects:r,platform:s,elements:i}=t,{apply:o=()=>{},...c}=la(e,t),u=await s.detectOverflow(t,c),d=gl(n),f=Od(n),p=po(n)==="y",{width:m,height:v}=r.floating;let _,w;d==="top"||d==="bottom"?(_=d,w=f===(await(s.isRTL==null?void 0:s.isRTL(i.floating))?"start":"end")?"left":"right"):(w=d,_=f==="end"?"top":"bottom");const b=v-u.top-u.bottom,S=m-u.left-u.right,E=ml(v-u[_],b),C=ml(m-u[w],S),A=t.middlewareData.shift,T=!A;let M=E,O=C;A!=null&&A.enabled.x&&(O=S),A!=null&&A.enabled.y&&(M=b),T&&!f&&(p?O=m-2*na(u.left,u.right):M=v-2*na(u.top,u.bottom)),await o({...t,availableWidth:O,availableHeight:M});const R=await s.getDimensions(i.floating);return m!==R.width||v!==R.height?{reset:{rects:!0}}:{}}}};function Ug(){return typeof window<"u"}function Md(e){return N5(e)?(e.nodeName||"").toLowerCase():"#document"}function Is(e){var t;return(e==null||(t=e.ownerDocument)==null?void 0:t.defaultView)||window}function da(e){var t;return(t=(N5(e)?e.ownerDocument:e.document)||window.document)==null?void 0:t.documentElement}function N5(e){return Ug()?e instanceof Node||e instanceof Is(e).Node:!1}function bo(e){return Ug()?e instanceof Element||e instanceof Is(e).Element:!1}function bl(e){return Ug()?e instanceof HTMLElement||e instanceof Is(e).HTMLElement:!1}function DA(e){return!Ug()||typeof ShadowRoot>"u"?!1:e instanceof ShadowRoot||e instanceof Is(e).ShadowRoot}function Zg(e){const{overflow:t,overflowX:n,overflowY:r,display:s}=xo(e);return/auto|scroll|overlay|hidden|clip/.test(t+r+n)&&s!=="inline"&&s!=="contents"}function ere(e){return/^(table|td|th)$/.test(Md(e))}function Bg(e){try{if(e.matches(":popover-open"))return!0}catch{}try{return e.matches(":modal")}catch{return!1}}const tre=/transform|translate|scale|rotate|perspective|filter/,nre=/paint|layout|strict|content/,Kl=e=>!!e&&e!=="none";let a_;function zx(e){const t=bo(e)?xo(e):e;return Kl(t.transform)||Kl(t.translate)||Kl(t.scale)||Kl(t.rotate)||Kl(t.perspective)||!Vx()&&(Kl(t.backdropFilter)||Kl(t.filter))||tre.test(t.willChange||"")||nre.test(t.contain||"")}function rre(e){let t=kc(e);for(;bl(t)&&!Th(t);){if(zx(t))return t;if(Bg(t))return null;t=kc(t)}return null}function Vx(){return a_==null&&(a_=typeof CSS<"u"&&CSS.supports&&CSS.supports("-webkit-backdrop-filter","none")),a_}function Th(e){return/^(html|body|#document)$/.test(Md(e))}function xo(e){return Is(e).getComputedStyle(e)}function Wg(e){return bo(e)?{scrollLeft:e.scrollLeft,scrollTop:e.scrollTop}:{scrollLeft:e.scrollX,scrollTop:e.scrollY}}function kc(e){if(Md(e)==="html")return e;const t=e.assignedSlot||e.parentNode||DA(e)&&e.host||da(e);return DA(t)?t.host:t}function L5(e){const t=kc(e);return Th(t)?(e.ownerDocument||e).body:bl(t)&&Zg(t)?t:L5(t)}function Rh(e,t,n){var r;t===void 0&&(t=[]),n===void 0&&(n=!0);const s=L5(e),i=s===((r=e.ownerDocument)==null?void 0:r.body),o=Is(s);if(i){const c=A2(o);return t.concat(o,o.visualViewport||[],Zg(s)?s:[],c&&n?Rh(c):[])}else return t.concat(s,Rh(s,[],n))}function A2(e){return e.parent&&Object.getPrototypeOf(e.parent)?e.frameElement:null}function $5(e){const t=xo(e);let n=parseFloat(t.width)||0,r=parseFloat(t.height)||0;const s=bl(e),i=s?e.offsetWidth:n,o=s?e.offsetHeight:r,c=fg(n)!==i||fg(r)!==o;return c&&(n=i,r=o),{width:n,height:r,$:c}}function Hx(e){return bo(e)?e:e.contextElement}function $u(e){const t=Hx(e);if(!bl(t))return ra(1);const n=t.getBoundingClientRect(),{width:r,height:s,$:i}=$5(t);let o=(i?fg(n.width):n.width)/r,c=(i?fg(n.height):n.height)/s;return(!o||!Number.isFinite(o))&&(o=1),(!c||!Number.isFinite(c))&&(c=1),{x:o,y:c}}const sre=ra(0);function D5(e){const t=Is(e);return!Vx()||!t.visualViewport?sre:{x:t.visualViewport.offsetLeft,y:t.visualViewport.offsetTop}}function ire(e,t,n){return t===void 0&&(t=!1),!!n&&t&&n===Is(e)}function Cc(e,t,n,r){t===void 0&&(t=!1),n===void 0&&(n=!1);const s=e.getBoundingClientRect(),i=Hx(e);let o=ra(1);t&&(r?bo(r)&&(o=$u(r)):o=$u(e));const c=ire(i,n,r)?D5(i):ra(0);let u=(s.left+c.x)/o.x,d=(s.top+c.y)/o.y,f=s.width/o.x,p=s.height/o.y;if(i&&r){const m=Is(i),v=bo(r)?Is(r):r;let _=m,w=A2(_);for(;w&&v!==_;){const b=$u(w),S=w.getBoundingClientRect(),E=xo(w),C=S.left+(w.clientLeft+parseFloat(E.paddingLeft))*b.x,A=S.top+(w.clientTop+parseFloat(E.paddingTop))*b.y;u*=b.x,d*=b.y,f*=b.x,p*=b.y,u+=C,d+=A,_=Is(w),w=A2(_)}}return pg({width:f,height:p,x:u,y:d})}function Kg(e,t){const n=Wg(e).scrollLeft;return t?t.left+n:Cc(da(e)).left+n}function F5(e,t){const n=e.getBoundingClientRect(),r=n.left+t.scrollLeft-Kg(e,n),s=n.top+t.scrollTop;return{x:r,y:s}}function ore(e){let{elements:t,rect:n,offsetParent:r,strategy:s}=e;const i=s==="fixed",o=da(r),c=t?Bg(t.floating):!1;if(r===o||c&&i)return n;let u={scrollLeft:0,scrollTop:0},d=ra(1);const f=ra(0),p=bl(r);if((p||!i)&&((Md(r)!=="body"||Zg(o))&&(u=Wg(r)),p)){const v=Cc(r);d=$u(r),f.x=v.x+r.clientLeft,f.y=v.y+r.clientTop}const m=o&&!p&&!i?F5(o,u):ra(0);return{width:n.width*d.x,height:n.height*d.y,x:n.x*d.x-u.scrollLeft*d.x+f.x+m.x,y:n.y*d.y-u.scrollTop*d.y+f.y+m.y}}function are(e){return e.getClientRects?Array.from(e.getClientRects()):[]}function lre(e){const t=Wg(e),n=e.ownerDocument.body,r=na(e.scrollWidth,e.clientWidth,n.scrollWidth,n.clientWidth),s=na(e.scrollHeight,e.clientHeight,n.scrollHeight,n.clientHeight);let i=-t.scrollLeft+Kg(e);const o=-t.scrollTop;return xo(n).direction==="rtl"&&(i+=na(e.clientWidth,n.clientWidth)-r),{width:r,height:s,x:i,y:o}}const cre=25;function ure(e,t,n){n===void 0&&(n="viewport");const r=n==="layoutViewport",s=Is(e),i=da(e),o=s.visualViewport;let c=i.clientWidth,u=i.clientHeight,d=0,f=0;if(o){const m=!Vx()||t==="fixed";r?m||(d=-o.offsetLeft,f=-o.offsetTop):(c=o.width,u=o.height,m&&(d=o.offsetLeft,f=o.offsetTop))}if(Kg(i)<=0){const m=i.ownerDocument,v=m.body,_=getComputedStyle(v),w=m.compatMode==="CSS1Compat"&&parseFloat(_.marginLeft)+parseFloat(_.marginRight)||0,b=Math.abs(i.clientWidth-v.clientWidth-w),S=getComputedStyle(i).scrollbarGutter==="stable both-edges"?b/2:b;S<=cre&&(c-=S)}return{width:c,height:u,x:d,y:f}}function dre(e,t){const n=Cc(e,!0,t==="fixed"),r=n.top+e.clientTop,s=n.left+e.clientLeft,i=$u(e),o=e.clientWidth*i.x,c=e.clientHeight*i.y,u=s*i.x,d=r*i.y;return{width:o,height:c,x:u,y:d}}function FA(e,t,n){let r;if(t==="viewport"||t==="layoutViewport")r=ure(e,n,t);else if(t==="document")r=lre(da(e));else if(bo(t))r=dre(t,n);else{const s=D5(e);r={x:t.x-s.x,y:t.y-s.y,width:t.width,height:t.height}}return pg(r)}function fre(e,t){const n=t.get(e);if(n)return n;let r=Rh(e,[],!1).filter(c=>bo(c)&&Md(c)!=="body"),s=null;const i=xo(e).position==="fixed";let o=i?kc(e):e;for(;bo(o)&&!Th(o);){const c=xo(o),u=zx(o),d=s?s.position:i?"fixed":"";!u&&(d==="fixed"||d==="absolute"&&c.position==="static")?r=r.filter(p=>p!==o):s=c,o=kc(o)}return t.set(e,r),r}function hre(e){let{element:t,boundary:n,rootBoundary:r,strategy:s}=e;const o=[...n==="clippingAncestors"?Bg(t)?[]:fre(t,this._c):[].concat(n),r],c=FA(t,o[0],s);let u=c.top,d=c.right,f=c.bottom,p=c.left;for(let m=1;m<o.length;m++){const v=FA(t,o[m],s);u=na(v.top,u),d=ml(v.right,d),f=ml(v.bottom,f),p=na(v.left,p)}return{width:d-p,height:f-u,x:p,y:u}}function pre(e){const{width:t,height:n}=$5(e);return{width:t,height:n}}function mre(e,t,n){const r=bl(t),s=da(t),i=n==="fixed",o=Cc(e,!0,i,t);let c={scrollLeft:0,scrollTop:0};const u=ra(0);if((r||!i)&&((Md(t)!=="body"||Zg(s))&&(c=Wg(t)),r)){const m=Cc(t,!0,i,t);u.x=m.x+t.clientLeft,u.y=m.y+t.clientTop}!r&&s&&(u.x=Kg(s));const d=s&&!r&&!i?F5(s,c):ra(0),f=o.left+c.scrollLeft-u.x-d.x,p=o.top+c.scrollTop-u.y-d.y;return{x:f,y:p,width:o.width,height:o.height}}function l_(e){return xo(e).position==="static"}function jA(e,t){if(!bl(e)||xo(e).position==="fixed")return null;if(t)return t(e);let n=e.offsetParent;return da(e)===n&&(n=n.ownerDocument.body),n}function j5(e,t){const n=Is(e);if(Bg(e))return n;if(!bl(e)){let s=kc(e);for(;s&&!Th(s);){if(bo(s)&&!l_(s))return s;s=kc(s)}return n}let r=jA(e,t);for(;r&&ere(r)&&l_(r);)r=jA(r,t);return r&&Th(r)&&l_(r)&&!zx(r)?n:r||rre(e)||n}const gre=async function(e){const t=this.getOffsetParent||j5,n=this.getDimensions,r=await n(e.floating);return{reference:mre(e.reference,await t(e.floating),e.strategy),floating:{x:0,y:0,width:r.width,height:r.height}}};function vre(e){return xo(e).direction==="rtl"}const yre={convertOffsetParentRelativeRectToViewportRelativeRect:ore,getDocumentElement:da,getClippingRect:hre,getOffsetParent:j5,getElementRects:gre,getClientRects:are,getDimensions:pre,getScale:$u,isElement:bo,isRTL:vre};function z5(e,t){return e.x===t.x&&e.y===t.y&&e.width===t.width&&e.height===t.height}function _re(e,t,n){let r=null,s;const i=da(e);function o(){var f;clearTimeout(s),(f=r)==null||f.disconnect(),r=null}function c(f,p){f===void 0&&(f=!1),p===void 0&&(p=1),o();const m=e.getBoundingClientRect(),{left:v,top:_,width:w,height:b}=m;if(f||t(),!w||!b)return;const S=Am(_),E=Am(i.clientWidth-(v+w)),C=Am(i.clientHeight-(_+b)),A=Am(v),M={rootMargin:-S+"px "+-E+"px "+-C+"px "+-A+"px",threshold:na(0,ml(1,p))||1};let O=!0;function R(D){const U=D[0].intersectionRatio;if(!z5(m,e.getBoundingClientRect()))return c();if(U!==p){if(!O)return c();U?c(!1,U):s=setTimeout(()=>{c(!1,1e-7)},1e3)}O=!1}try{r=new IntersectionObserver(R,{...M,root:i.ownerDocument})}catch{r=new IntersectionObserver(R,M)}r.observe(e)}const u=Is(e),d=()=>c(n);return u.addEventListener("resize",d),c(!0),()=>{u.removeEventListener("resize",d),o()}}function wre(e,t,n,r){r===void 0&&(r={});const{ancestorScroll:s=!0,ancestorResize:i=!0,elementResize:o=typeof ResizeObserver=="function",layoutShift:c=typeof IntersectionObserver=="function",animationFrame:u=!1}=r,d=Hx(e),f=s||i?[...d?Rh(d):[],...t?Rh(t):[]]:[];f.forEach(S=>{s&&S.addEventListener("scroll",n),i&&S.addEventListener("resize",n)});const p=d&&c?_re(d,n,i):null;let m=-1,v=null;o&&(v=new ResizeObserver(S=>{let[E]=S;E&&E.target===d&&v&&t&&(v.unobserve(t),cancelAnimationFrame(m),m=requestAnimationFrame(()=>{var C;(C=v)==null||C.observe(t)})),n()}),d&&!u&&v.observe(d),t&&v.observe(t));let _,w=u?Cc(e):null;u&&b();function b(){const S=Cc(e);w&&!z5(w,S)&&n(),w=S,_=requestAnimationFrame(b)}return n(),()=>{var S;f.forEach(E=>{s&&E.removeEventListener("scroll",n),i&&E.removeEventListener("resize",n)}),p==null||p(),(S=v)==null||S.disconnect(),v=null,u&&cancelAnimationFrame(_)}}const bre=Yne,xre=Qne,Sre=Kne,Ere=Jne,kre=Gne,zA=Wne,Cre=Xne,Pre=(e,t,n)=>{const r=new Map,s=n??{},i={...yre,...s.platform,_c:r};return Bne(e,t,{...s,platform:i})};var Are=typeof document<"u",Tre=function(){},l0=Are?g.useLayoutEffect:Tre;function mg(e,t){if(e===t)return!0;if(typeof e!=typeof t)return!1;if(typeof e=="function"&&e.toString()===t.toString())return!0;let n,r,s;if(e&&t&&typeof e=="object"){if(Array.isArray(e)){if(n=e.length,n!==t.length)return!1;for(r=n;r--!==0;)if(!mg(e[r],t[r]))return!1;return!0}if(s=Object.keys(e),n=s.length,n!==Object.keys(t).length)return!1;for(r=n;r--!==0;)if(!{}.hasOwnProperty.call(t,s[r]))return!1;for(r=n;r--!==0;){const i=s[r];if(!(i==="_owner"&&e.$$typeof)&&!mg(e[i],t[i]))return!1}return!0}return e!==e&&t!==t}function V5(e){return typeof window>"u"?1:(e.ownerDocument.defaultView||window).devicePixelRatio||1}function VA(e,t){const n=V5(e);return Math.round(t*n)/n}function c_(e){const t=g.useRef(e);return l0(()=>{t.current=e}),t}function Rre(e){e===void 0&&(e={});const{placement:t="bottom",strategy:n="absolute",middleware:r=[],platform:s,elements:{reference:i,floating:o}={},transform:c=!0,whileElementsMounted:u,open:d}=e,[f,p]=g.useState({x:0,y:0,strategy:n,placement:t,middlewareData:{},isPositioned:!1}),[m,v]=g.useState(r);mg(m,r)||v(r);const[_,w]=g.useState(null),[b,S]=g.useState(null),E=g.useCallback(F=>{F!==M.current&&(M.current=F,w(F))},[]),C=g.useCallback(F=>{F!==O.current&&(O.current=F,S(F))},[]),A=i||_,T=o||b,M=g.useRef(null),O=g.useRef(null),R=g.useRef(f),D=u!=null,U=c_(u),W=c_(s),H=c_(d),Y=g.useCallback(()=>{if(!M.current||!O.current)return;const F={placement:t,strategy:n,middleware:m};W.current&&(F.platform=W.current),Pre(M.current,O.current,F).then(X=>{const B={...X,isPositioned:H.current!==!1};J.current&&!mg(R.current,B)&&(R.current=B,Id.flushSync(()=>{p(B)}))})},[m,t,n,W,H]);l0(()=>{d===!1&&R.current.isPositioned&&(R.current.isPositioned=!1,p(F=>({...F,isPositioned:!1})))},[d]);const J=g.useRef(!1);l0(()=>(J.current=!0,()=>{J.current=!1}),[]),l0(()=>{if(A&&(M.current=A),T&&(O.current=T),A&&T){if(U.current)return U.current(A,T,Y);Y()}},[A,T,Y,U,D]);const V=g.useMemo(()=>({reference:M,floating:O,setReference:E,setFloating:C}),[E,C]),q=g.useMemo(()=>({reference:A,floating:T}),[A,T]),ee=g.useMemo(()=>{const F={position:n,left:0,top:0};if(!q.floating)return F;const X=VA(q.floating,f.x),B=VA(q.floating,f.y);return c?{...F,transform:"translate("+X+"px, "+B+"px)",...V5(q.floating)>=1.5&&{willChange:"transform"}}:{position:n,left:X,top:B}},[n,c,q.floating,f.x,f.y]);return g.useMemo(()=>({...f,update:Y,refs:V,elements:q,floatingStyles:ee}),[f,Y,V,q,ee])}const Ire=e=>{function t(n){return{}.hasOwnProperty.call(n,"current")}return{name:"arrow",options:e,fn(n){const{element:r,padding:s}=typeof e=="function"?e(n):e;return r&&t(r)?r.current!=null?zA({element:r.current,padding:s}).fn(n):{}:r?zA({element:r,padding:s}).fn(n):{}}}},Ore=(e,t)=>{const n=bre(e);return{name:n.name,fn:n.fn,options:[e,t]}},Mre=(e,t)=>{const n=xre(e);return{name:n.name,fn:n.fn,options:[e,t]}},Nre=(e,t)=>({fn:Cre(e).fn,options:[e,t]}),Lre=(e,t)=>{const n=Sre(e);return{name:n.name,fn:n.fn,options:[e,t]}},$re=(e,t)=>{const n=Ere(e);return{name:n.name,fn:n.fn,options:[e,t]}},Dre=(e,t)=>{const n=kre(e);return{name:n.name,fn:n.fn,options:[e,t]}},Fre=(e,t)=>{const n=Ire(e);return{name:n.name,fn:n.fn,options:[e,t]}};var jre=Object.defineProperty,zre=(e,t)=>jre(e,"name",{value:t,configurable:!0});function H5(e){const[t,n]=g.useState(void 0);return Rs(()=>{if(e){n({width:e.offsetWidth,height:e.offsetHeight});let r=0;const s=new ResizeObserver(i=>{if(!Array.isArray(i)||!i.length)return;const o=i[0];window.cancelAnimationFrame(r),r=window.requestAnimationFrame(()=>{let c,u;if("borderBoxSize"in o){const d=o.borderBoxSize,f=Array.isArray(d)?d[0]:d;c=f.inlineSize,u=f.blockSize}else c=e.offsetWidth,u=e.offsetHeight;n({width:c,height:u})})});return s.observe(e,{box:"border-box"}),()=>{window.cancelAnimationFrame(r),s.unobserve(e)}}else n(void 0)},[e]),t}zre(H5,"useSize");var Vre=Object.defineProperty,al=(e,t)=>Vre(e,"name",{value:t,configurable:!0}),HA={Partial:"partial"},UA={Optimized:"optimized",Always:"always"},U5="Popper",[Z5,Gg]=Gh(U5),[Hre,B5]=Z5(U5),W5=al(e=>{const{__scopePopper:t,children:n}=e,[r,s]=g.useState(null),[i,o]=g.useState(void 0);return P.jsx(Hre,{scope:t,anchor:r,onAnchorChange:s,placementState:i,setPlacementState:o,children:n})},"Popper"),Ure="PopperAnchor",K5=g.forwardRef(al(function(t,n){const{__scopePopper:r,virtualRef:s,...i}=t,o=B5(Ure,r),c=g.useRef(null),u=o.onAnchorChange,d=g.useCallback(w=>{c.current=w,w&&u(w)},[u]),f=gs(n,d),p=g.useRef(null);g.useEffect(()=>{if(!s)return;const w=p.current;p.current=s.current,w!==p.current&&u(p.current)});const m=o.placementState&&qg(o.placementState),v=m==null?void 0:m[0],_=m==null?void 0:m[1];return s?null:P.jsx(Xs.div,{"data-radix-popper-side":v,"data-radix-popper-align":_,...i,ref:f})},"PopperAnchor")),G5="PopperContent",[Zre,Xue]=Z5(G5),q5=g.forwardRef(al(function(t,n){var pe,Ne,Re,$e,Et,dn,an;const{__scopePopper:r,side:s="bottom",sideOffset:i=0,align:o="center",alignOffset:c=0,arrowPadding:u=0,avoidCollisions:d=!0,collisionBoundary:f=[],collisionPadding:p=0,sticky:m=HA.Partial,hideWhenDetached:v=!1,updatePositionStrategy:_=UA.Optimized,onPlaced:w,...b}=t,S=B5(G5,r),[E,C]=g.useState(null),A=gs(n,C),[T,M]=g.useState(null),O=H5(T),R=(O==null?void 0:O.width)??0,D=(O==null?void 0:O.height)??0,U=s+(o!=="center"?"-"+o:""),W=typeof p=="number"?p:{top:0,right:0,bottom:0,left:0,...p},H=Array.isArray(f)?f:[f],Y=H.length>0,J={padding:W,boundary:H.filter(Y5),altBoundary:Y},{refs:V,floatingStyles:q,placement:ee,isPositioned:F,middlewareData:X}=Rre({strategy:"fixed",placement:U,whileElementsMounted:al((...kt)=>wre(...kt,{animationFrame:_===UA.Always}),"whileElementsMounted"),elements:{reference:S.anchor},middleware:[Ore({mainAxis:i+D,alignmentAxis:c}),d&&Mre({mainAxis:!0,crossAxis:!1,...m===HA.Partial?{limiter:Nre()}:{},...J}),d&&Lre({...J}),$re({...J,apply:al(({elements:kt,rects:Gt,availableWidth:gn,availableHeight:Qt})=>{const{width:Me,height:Xe}=Gt.reference,Te=kt.floating.style;Te.setProperty("--radix-popper-available-width",`${gn}px`),Te.setProperty("--radix-popper-available-height",`${Qt}px`),Te.setProperty("--radix-popper-anchor-width",`${Me}px`),Te.setProperty("--radix-popper-anchor-height",`${Xe}px`)},"apply")}),T&&Fre({element:T,padding:u}),Bre({arrowWidth:R,arrowHeight:D}),v&&Dre(Y?{strategy:"referenceHidden",...J}:{strategy:"referenceHidden",padding:J.padding,altBoundary:J.altBoundary})]}),B=S.setPlacementState;Rs(()=>(B(ee),()=>{B(void 0)}),[ee,B]);const[L,G]=qg(ee),ue=Ec(w);Rs(()=>{F&&(ue==null||ue())},[F,ue]);const te=(pe=X.arrow)==null?void 0:pe.x,ie=(Ne=X.arrow)==null?void 0:Ne.y,he=((Re=X.arrow)==null?void 0:Re.centerOffset)!==0,[ke,ge]=g.useState();return Rs(()=>{E&&ge(window.getComputedStyle(E).zIndex)},[E]),P.jsx("div",{ref:V.setFloating,"data-radix-popper-content-wrapper":"",style:{...q,transform:F?q.transform:"translate(0, -200%)",minWidth:"max-content",zIndex:ke,"--radix-popper-transform-origin":[($e=X.transformOrigin)==null?void 0:$e.x,(Et=X.transformOrigin)==null?void 0:Et.y].join(" "),...((dn=X.hide)==null?void 0:dn.referenceHidden)&&{visibility:"hidden",pointerEvents:"none"}},dir:t.dir,children:P.jsx(Zre,{scope:r,placedSide:L,placedAlign:G,onArrowChange:M,arrowX:te,arrowY:ie,shouldHideArrow:he,children:P.jsx(Xs.div,{"data-side":L,"data-align":G,...b,ref:A,style:{...b.style,animation:F?(an=b.style)==null?void 0:an.animation:"none"}})})})},"PopperContent"));function Y5(e){return e!==null}al(Y5,"isNotNull");var Bre=al(e=>({name:"transformOrigin",options:e,fn(t){var b,S,E;const{placement:n,rects:r,middlewareData:s}=t,o=((b=s.arrow)==null?void 0:b.centerOffset)!==0,c=o?0:e.arrowWidth,u=o?0:e.arrowHeight,[d,f]=qg(n),p={start:"0%",center:"50%",end:"100%"}[f],m=(((S=s.arrow)==null?void 0:S.x)??0)+c/2,v=(((E=s.arrow)==null?void 0:E.y)??0)+u/2;let _="",w="";return d==="bottom"?(_=o?p:`${m}px`,w=`${-u}px`):d==="top"?(_=o?p:`${m}px`,w=`${r.floating.height+u}px`):d==="right"?(_=`${-u}px`,w=o?p:`${v}px`):d==="left"&&(_=`${r.floating.width+u}px`,w=o?p:`${v}px`),{data:{x:_,y:w}}}}),"transformOrigin");function qg(e){const[t,n="center"]=e.split("-");return[t,n]}al(qg,"getSideAndAlignFromPlacement");var Wre=Object.defineProperty,Kre=(e,t)=>Wre(e,"name",{value:t,configurable:!0}),Ux=g.forwardRef(Kre(function(t,n){var u;const{container:r,...s}=t,[i,o]=g.useState(!1);Rs(()=>o(!0),[]);const c=r||i&&((u=globalThis==null?void 0:globalThis.document)==null?void 0:u.body);return c?Id.createPortal(P.jsx(Xs.div,{...s,ref:n}),c):null},"Portal")),Gre=Object.defineProperty,ca=(e,t)=>Gre(e,"name",{value:t,configurable:!0});function Q5(e,t){return g.useReducer((n,r)=>t[n][r]??n,e)}ca(Q5,"useStateMachine");var Ac=ca(e=>{const{present:t,children:n}=e,r=X5(t),s=typeof n=="function"?n({present:r.isPresent}):g.Children.only(n),i=J5(r.ref,e4(s));return typeof n=="function"||r.isPresent?g.cloneElement(s,{ref:i}):null},"Presence");function X5(e){const[t,n]=g.useState(),r=g.useRef(null),s=g.useRef(e),i=g.useRef("none"),o=g.useRef(void 0),c=e?"mounted":"unmounted",[u,d]=Q5(c,{mounted:{UNMOUNT:"unmounted",ANIMATION_OUT:"unmountSuspended"},unmountSuspended:{MOUNT:"mounted",ANIMATION_END:"unmounted"},unmounted:{MOUNT:"mounted"}});return g.useEffect(()=>{u==="mounted"?(i.current=o.current??_u(r.current),o.current=void 0):i.current="none"},[u]),Rs(()=>{const f=r.current,p=s.current;if(p!==e){const v=i.current,_=_u(f);e?(o.current=_,d("MOUNT")):_==="none"||(f==null?void 0:f.display)==="none"?d("UNMOUNT"):d(p&&v!==_?"ANIMATION_OUT":"UNMOUNT"),s.current=e}},[e,d]),Rs(()=>{if(t){let f;const p=t.ownerDocument.defaultView??window,m=ca(_=>{const b=_u(r.current).includes(CSS.escape(_.animationName));if(_.target===t&&b&&(d("ANIMATION_END"),!s.current)){const S=t.style.animationFillMode;t.style.animationFillMode="forwards",f=p.setTimeout(()=>{t.style.animationFillMode==="forwards"&&(t.style.animationFillMode=S)})}},"handleAnimationEnd"),v=ca(_=>{_.target===t&&(i.current=_u(r.current))},"handleAnimationStart");return t.addEventListener("animationstart",v),t.addEventListener("animationcancel",m),t.addEventListener("animationend",m),()=>{p.clearTimeout(f),t.removeEventListener("animationstart",v),t.removeEventListener("animationcancel",m),t.removeEventListener("animationend",m)}}else d("ANIMATION_END")},[t,d]),{isPresent:["mounted","unmountSuspended"].includes(u),ref:g.useCallback(f=>{if(f){const p=getComputedStyle(f);r.current=p,o.current=_u(p)}else r.current=null;n(f)},[])}}ca(X5,"usePresence");function T2(e,t){if(typeof e=="function")return e(t);e!=null&&(e.current=t)}ca(T2,"setRef");function J5(...e){const t=g.useRef(e);return t.current=e,g.useCallback(n=>{const r=t.current;let s=!1;const i=r.map(o=>{const c=T2(o,n);return!s&&typeof c=="function"&&(s=!0),c});if(s)return()=>{for(let o=0;o<i.length;o++){const c=i[o];typeof c=="function"?c():T2(r[o],null)}}},[])}ca(J5,"useStableComposedRefs");function _u(e){return(e==null?void 0:e.animationName)||"none"}ca(_u,"getAnimationName");function e4(e){var r,s;let t=(r=Object.getOwnPropertyDescriptor(e.props,"ref"))==null?void 0:r.get,n=t&&"isReactWarning"in t&&t.isReactWarning;return n?e.ref:(t=(s=Object.getOwnPropertyDescriptor(e,"ref"))==null?void 0:s.get,n=t&&"isReactWarning"in t&&t.isReactWarning,n?e.props.ref:e.props.ref||e.ref)}ca(e4,"getElementRef");var qre=Object.defineProperty,Yre=(e,t)=>qre(e,"name",{value:t,configurable:!0}),ZA=bd[" useEffectEvent ".trim().toString()],BA=bd[" useInsertionEffect ".trim().toString()];function t4(e){if(typeof ZA=="function")return ZA(e);const t=g.useRef(()=>{throw new Error("Cannot call an event handler while rendering.")});return typeof BA=="function"?BA(()=>{t.current=e}):Rs(()=>{t.current=e}),g.useMemo(()=>((...n)=>{var r;return(r=t.current)==null?void 0:r.call(t,...n)}),[])}Yre(t4,"useEffectEvent");var Qre=Object.defineProperty,qh=(e,t)=>Qre(e,"name",{value:t,configurable:!0}),Xre=bd[" useInsertionEffect ".trim().toString()]||Rs;function Yg({prop:e,defaultProp:t,onChange:n=qh(()=>{},"onChange"),caller:r}){const[s,i,o]=n4({defaultProp:t,onChange:n}),c=e!==void 0,u=c?e:s,d=g.useCallback(f=>{var p;if(c){const m=r4(f)?f(e):f;m!==e&&((p=o.current)==null||p.call(o,m))}else i(f)},[c,e,i,o]);return[u,d]}qh(Yg,"useControllableState");function n4({defaultProp:e,onChange:t}){const[n,r]=g.useState(e),s=g.useRef(n),i=g.useRef(t);return Xre(()=>{i.current=t},[t]),g.useEffect(()=>{var o;s.current!==n&&((o=i.current)==null||o.call(i,n),s.current=n)},[n,s]),[n,r,i]}qh(n4,"useUncontrolledState");function r4(e){return typeof e=="function"}qh(r4,"isFunction");var WA=Symbol("RADIX:SYNC_STATE");function Jre(e,t,n,r){const{prop:s,defaultProp:i,onChange:o,caller:c}=t,u=s!==void 0,d=t4(o),f=[{...n,state:i}];r&&f.push(r);const[p,m]=g.useReducer((b,S)=>{if(S.type===WA)return{...b,state:S.state};const E=e(b,S);return u&&!Object.is(E.state,b.state)&&d(E.state),E},...f),v=p.state,_=g.useRef(v);g.useEffect(()=>{_.current!==v&&(_.current=v,u||d(v))},[v,_,u]);const w=g.useMemo(()=>s!==void 0?{...p,state:s}:p,[p,s]);return g.useEffect(()=>{u&&!Object.is(s,p.state)&&m({type:WA,state:s})},[s,p.state,u]),[w,m]}qh(Jre,"useControllableStateReducer");var ese=Object.defineProperty,tse=(e,t)=>ese(e,"name",{value:t,configurable:!0}),nse=Object.freeze({position:"absolute",border:0,width:1,height:1,padding:0,margin:-1,overflow:"hidden",clip:"rect(0, 0, 0, 0)",whiteSpace:"nowrap",wordWrap:"normal"}),rse=g.forwardRef(tse(function(t,n){return P.jsx(Xs.span,{...t,ref:n,style:{...nse,...t.style}})},"VisuallyHidden")),sse=Object.defineProperty,vr=(e,t)=>sse(e,"name",{value:t,configurable:!0}),[Zx,Jue]=Gh("Tooltip",[Gg]),Bx=Gg(),ise="TooltipProvider",ose=700,R2="tooltip.open",[ase,Wx]=Zx(ise),lse=vr(e=>{const{__scopeTooltip:t,delayDuration:n=ose,skipDelayDuration:r=300,disableHoverableContent:s=!1,children:i}=e,o=g.useRef(!0),c=g.useRef(!1),u=g.useRef(0);return g.useEffect(()=>{const d=u.current;return()=>window.clearTimeout(d)},[]),P.jsx(ase,{scope:t,isOpenDelayedRef:o,delayDuration:n,onOpen:g.useCallback(()=>{r<=0||(window.clearTimeout(u.current),o.current=!1)},[r]),onClose:g.useCallback(()=>{r<=0||(window.clearTimeout(u.current),u.current=window.setTimeout(()=>o.current=!0,r))},[r]),isPointerInTransitRef:c,onPointerInTransitChange:g.useCallback(d=>{c.current=d},[]),disableHoverableContent:s,children:i})},"TooltipProvider"),I2="Tooltip",[cse,Yh]=Zx(I2),use=vr(e=>{const{__scopeTooltip:t,children:n,open:r,defaultOpen:s,onOpenChange:i,disableHoverableContent:o,delayDuration:c}=e,u=Wx(I2,e.__scopeTooltip),d=Bx(t),[f,p]=g.useState(null),[m,v]=g.useState(void 0),_=ol(),w=g.useRef(0),b=o??u.disableHoverableContent,S=c??u.delayDuration,E=g.useRef(!1),[C,A]=Yg({prop:r,defaultProp:s??!1,onChange:vr(U=>{U?(u.onOpen(),document.dispatchEvent(new CustomEvent(R2))):u.onClose(),i==null||i(U)},"onChange"),caller:I2}),T=g.useMemo(()=>C?E.current?"delayed-open":"instant-open":"closed",[C]),M=g.useCallback(()=>{window.clearTimeout(w.current),w.current=0,E.current=!1,A(!0)},[A]),O=g.useCallback(()=>{window.clearTimeout(w.current),w.current=0,A(!1)},[A]),R=g.useCallback(()=>{window.clearTimeout(w.current),w.current=window.setTimeout(()=>{E.current=!0,A(!0),w.current=0},S)},[S,A]);g.useEffect(()=>()=>{w.current&&(window.clearTimeout(w.current),w.current=0)},[]);const D=m??_;return P.jsx(W5,{...d,children:P.jsx(cse,{scope:t,contentId:D,setContentId:v,open:C,stateAttribute:T,trigger:f,onTriggerChange:p,onTriggerEnter:g.useCallback(()=>{u.isOpenDelayedRef.current?R():M()},[u.isOpenDelayedRef,R,M]),onTriggerLeave:g.useCallback(()=>{b?O():(window.clearTimeout(w.current),w.current=0)},[O,b]),onOpen:M,onClose:O,disableHoverableContent:b,children:n})})},"Tooltip"),KA="TooltipTrigger",dse=g.forwardRef(vr(function(t,n){const{__scopeTooltip:r,"aria-describedby":s,...i}=t,o=Yh(KA,r),c=Wx(KA,r),u=Bx(r),d=g.useRef(null),f=gs(n,d,o.onTriggerChange),p=g.useRef(!1),m=g.useRef(!1),v=g.useCallback(()=>p.current=!1,[]);return g.useEffect(()=>()=>document.removeEventListener("pointerup",v),[v]),P.jsx(K5,{asChild:!0,...u,children:P.jsx(Xs.button,{"aria-describedby":o.open?f4(s,o.contentId):s,"data-state":o.stateAttribute,...i,ref:f,onPointerMove:gr(t.onPointerMove,_=>{_.pointerType!=="touch"&&!m.current&&!c.isPointerInTransitRef.current&&(o.onTriggerEnter(),m.current=!0)}),onPointerLeave:gr(t.onPointerLeave,()=>{o.onTriggerLeave(),m.current=!1}),onPointerDown:gr(t.onPointerDown,()=>{o.open&&o.onClose(),p.current=!0,document.addEventListener("pointerup",v,{once:!0})}),onFocus:gr(t.onFocus,()=>{p.current||o.onOpen()}),onBlur:gr(t.onBlur,o.onClose),onClick:gr(t.onClick,o.onClose)})})},"TooltipTrigger")),s4="TooltipPortal",[fse,hse]=Zx(s4,{forceMount:void 0}),pse=vr(e=>{const{__scopeTooltip:t,forceMount:n,children:r,container:s}=e,i=Yh(s4,t);return P.jsx(fse,{scope:t,forceMount:n,children:P.jsx(Ac,{present:n||i.open,children:P.jsx(Ux,{asChild:!0,container:s,children:r})})})},"TooltipPortal"),Ih="TooltipContent",mse=g.forwardRef(vr(function(t,n){const r=hse(Ih,t.__scopeTooltip),{forceMount:s=r.forceMount,side:i="top",...o}=t,c=Yh(Ih,t.__scopeTooltip);return P.jsx(Ac,{present:s||c.open,children:c.disableHoverableContent?P.jsx(i4,{side:i,...o,ref:n}):P.jsx(gse,{side:i,...o,ref:n})})},"TooltipContent")),gse=g.forwardRef(vr(function(t,n){const r=Yh(Ih,t.__scopeTooltip),s=Wx(Ih,t.__scopeTooltip),i=g.useRef(null),o=gs(n,i),[c,u]=g.useState(null),{trigger:d,onClose:f}=r,p=i.current,{onPointerInTransitChange:m}=s,v=g.useCallback(()=>{u(null),m(!1)},[m]),_=g.useCallback((w,b)=>{const S=w.currentTarget,E={x:w.clientX,y:w.clientY},C=o4(E,S.getBoundingClientRect()),A=a4(E,C),T=l4(b.getBoundingClientRect()),M=u4([...A,...T]);u(M),m(!0)},[m]);return g.useEffect(()=>()=>v(),[v]),g.useEffect(()=>{if(d&&p){const w=vr(S=>_(S,p),"handleTriggerLeave"),b=vr(S=>_(S,d),"handleContentLeave");return d.addEventListener("pointerleave",w),p.addEventListener("pointerleave",b),()=>{d.removeEventListener("pointerleave",w),p.removeEventListener("pointerleave",b)}}},[d,p,_,v]),g.useEffect(()=>{if(c){const w=vr(b=>{const S=b.target,E={x:b.clientX,y:b.clientY},C=(d==null?void 0:d.contains(S))||(p==null?void 0:p.contains(S)),A=!c4(E,c);C?v():A&&(v(),f())},"handleTrackPointerGrace");return document.addEventListener("pointermove",w),()=>document.removeEventListener("pointermove",w)}},[d,p,c,f,v]),P.jsx(i4,{...t,ref:o})},"TooltipContentHoverable")),vse=d5("TooltipContent"),i4=g.forwardRef(vr(function(t,n){const{__scopeTooltip:r,children:s,"aria-label":i,id:o,onEscapeKeyDown:c,onPointerDownOutside:u,...d}=t,f=Yh(Ih,r),p=Bx(r),{onClose:m}=f,[v,_]=g.useState(null),w=gs(n,_);Lx(v),g.useEffect(()=>(document.addEventListener(R2,m),()=>document.removeEventListener(R2,m)),[m]),g.useEffect(()=>{if(f.trigger){const S=vr(E=>{E.target instanceof Node&&E.target.contains(f.trigger)&&m()},"handleScroll");return window.addEventListener("scroll",S,{capture:!0}),()=>window.removeEventListener("scroll",S,{capture:!0})}},[f.trigger,m]);const{setContentId:b}=f;return Rs(()=>(b(o),()=>{b(void 0)}),[o,b]),P.jsx(Ix,{asChild:!0,disableOutsidePointerEvents:!1,onEscapeKeyDown:c,onPointerDownOutside:u,onFocusOutside:S=>S.preventDefault(),onDismiss:m,children:P.jsxs(q5,{"data-state":f.stateAttribute,role:i?void 0:"tooltip",id:i?void 0:f.contentId,...p,...d,ref:w,style:{...d.style,"--radix-tooltip-content-transform-origin":"var(--radix-popper-transform-origin)","--radix-tooltip-content-available-width":"var(--radix-popper-available-width)","--radix-tooltip-content-available-height":"var(--radix-popper-available-height)","--radix-tooltip-trigger-width":"var(--radix-popper-anchor-width)","--radix-tooltip-trigger-height":"var(--radix-popper-anchor-height)"},children:[P.jsx(vse,{children:s}),i?P.jsx(rse,{id:f.contentId,role:"tooltip",children:i}):null]})})},"TooltipContentImpl"));function o4(e,t){const n=Math.abs(t.top-e.y),r=Math.abs(t.bottom-e.y),s=Math.abs(t.right-e.x),i=Math.abs(t.left-e.x);switch(Math.min(n,r,s,i)){case i:return"left";case s:return"right";case n:return"top";case r:return"bottom";default:throw new Error("unreachable")}}vr(o4,"getExitSideFromRect");function a4(e,t,n=5){const r=[];switch(t){case"top":r.push({x:e.x-n,y:e.y+n},{x:e.x+n,y:e.y+n});break;case"bottom":r.push({x:e.x-n,y:e.y-n},{x:e.x+n,y:e.y-n});break;case"left":r.push({x:e.x+n,y:e.y-n},{x:e.x+n,y:e.y+n});break;case"right":r.push({x:e.x-n,y:e.y-n},{x:e.x-n,y:e.y+n});break}return r}vr(a4,"getPaddedExitPoints");function l4(e){const{top:t,right:n,bottom:r,left:s}=e;return[{x:s,y:t},{x:n,y:t},{x:n,y:r},{x:s,y:r}]}vr(l4,"getPointsFromRect");function c4(e,t){const{x:n,y:r}=e;let s=!1;for(let i=0,o=t.length-1;i<t.length;o=i++){const c=t[i],u=t[o],d=c.x,f=c.y,p=u.x,m=u.y;f>r!=m>r&&n<(p-d)*(r-f)/(m-f)+d&&(s=!s)}return s}vr(c4,"isPointInPolygon");function u4(e){const t=e.slice();return t.sort((n,r)=>n.x<r.x?-1:n.x>r.x?1:n.y<r.y?-1:n.y>r.y?1:0),d4(t)}vr(u4,"getHull");function d4(e){if(e.length<=1)return e.slice();const t=[];for(let r=0;r<e.length;r++){const s=e[r];for(;t.length>=2;){const i=t[t.length-1],o=t[t.length-2];if((i.x-o.x)*(s.y-o.y)>=(i.y-o.y)*(s.x-o.x))t.pop();else break}t.push(s)}t.pop();const n=[];for(let r=e.length-1;r>=0;r--){const s=e[r];for(;n.length>=2;){const i=n[n.length-1],o=n[n.length-2];if((i.x-o.x)*(s.y-o.y)>=(i.y-o.y)*(s.x-o.x))n.pop();else break}n.push(s)}return n.pop(),t.length===1&&n.length===1&&t[0].x===n[0].x&&t[0].y===n[0].y?t:t.concat(n)}vr(d4,"getHullPresorted");function f4(...e){const t=new Set;for(const n of e)if(typeof n=="string")for(const r of String(n).trim().split(/\s+/))r&&t.add(r);return t.size>0?Array.from(t).join(" "):void 0}vr(f4,"concatAriaDescribedby");const yse={medium:"'wght' 450"},gg={fast:{type:"spring",duration:.08,bounce:0},moderate:{type:"spring",duration:.16,bounce:0},slow:{type:"spring",duration:.24,bounce:.12}},h4=g.createContext(null);function _se({value:e,children:t}){return P.jsx(h4.Provider,{value:e,children:t})}function wse(e){switch(e){case"top":return{y:4};case"bottom":return{y:-4};case"left":return{x:4};case"right":return{x:-4}}}function p4({content:e,children:t,side:n="top",sideOffset:r=8,delayDuration:s=200,className:i,forceOpen:o,onOpenChange:c}){const[u,d]=g.useState(!1),f=o!==void 0?o:u,[p,m]=g.useState(!1),v=g.useContext(h4);g.useEffect(()=>{f&&m(!0)},[f]);const _=()=>{f||m(!1)},w=wse(n);return P.jsx(lse,{delayDuration:s,children:P.jsxs(use,{open:f,onOpenChange:b=>{d(b),c==null||c(b)},children:[P.jsx(dse,{asChild:!0,children:t}),p&&P.jsx(pse,{forceMount:!0,container:v??void 0,children:P.jsx(mse,{side:n,sideOffset:r,forceMount:!0,className:"z-tooltip",children:P.jsx(ta.div,{className:or("bg-neutral-900 text-white text-[12px] px-2 py-1 border border-white/10 shadow-lg","rounded-lg",i),style:{fontVariationSettings:yse.medium},initial:{opacity:0,scale:.8,...w},animate:{opacity:f?1:0,scale:f?1:.9,x:0,y:0},transition:f?gg.slow:{duration:.1},onAnimationComplete:_,children:e})})})]})})}const ir=g.forwardRef(({title:e,shortcut:t,...n},r)=>{const s=P.jsx(s5,{ref:r,...n});return e?P.jsx(p4,{content:P.jsxs("div",{className:"flex flex-row items-center gap-2",children:[P.jsx("span",{children:e}),t?P.jsx("span",{className:"rounded bg-white/15 px-1.5 py-0.5 text-[11px]",children:t}):null]}),children:s}):s});ir.displayName="Button";var bse=Object.defineProperty,Kx=(e,t)=>bse(e,"name",{value:t,configurable:!0}),Tm=0,to=null;function xse(e){return Qg(),e.children}Kx(xse,"FocusGuards");function Qg(){g.useEffect(()=>{to||(to={start:O2(),end:O2()});const{start:e,end:t}=to;return document.body.firstElementChild!==e&&document.body.insertAdjacentElement("afterbegin",e),document.body.lastElementChild!==t&&document.body.insertAdjacentElement("beforeend",t),Tm++,()=>{Tm===1&&(to==null||to.start.remove(),to==null||to.end.remove(),to=null),Tm=Math.max(0,Tm-1)}},[])}Kx(Qg,"useFocusGuards");function O2(){const e=document.createElement("span");return e.setAttribute("data-radix-focus-guard",""),e.tabIndex=0,e.style.outline="none",e.style.opacity="0",e.style.position="fixed",e.style.pointerEvents="none",e}Kx(O2,"createFocusGuard");var fo=function(){return fo=Object.assign||function(t){for(var n,r=1,s=arguments.length;r<s;r++){n=arguments[r];for(var i in n)Object.prototype.hasOwnProperty.call(n,i)&&(t[i]=n[i])}return t},fo.apply(this,arguments)};function m4(e,t){var n={};for(var r in e)Object.prototype.hasOwnProperty.call(e,r)&&t.indexOf(r)<0&&(n[r]=e[r]);if(e!=null&&typeof Object.getOwnPropertySymbols=="function")for(var s=0,r=Object.getOwnPropertySymbols(e);s<r.length;s++)t.indexOf(r[s])<0&&Object.prototype.propertyIsEnumerable.call(e,r[s])&&(n[r[s]]=e[r[s]]);return n}function Sse(e,t,n){if(n||arguments.length===2)for(var r=0,s=t.length,i;r<s;r++)(i||!(r in t))&&(i||(i=Array.prototype.slice.call(t,0,r)),i[r]=t[r]);return e.concat(i||Array.prototype.slice.call(t))}var c0="right-scroll-bar-position",u0="width-before-scroll-bar",Ese="with-scroll-bars-hidden",kse="--removed-body-scroll-bar-size";function u_(e,t){return typeof e=="function"?e(t):e&&(e.current=t),e}function Cse(e,t){var n=g.useState(function(){return{value:e,callback:t,facade:{get current(){return n.value},set current(r){var s=n.value;s!==r&&(n.value=r,n.callback(r,s))}}}})[0];return n.callback=t,n.facade}var Pse=typeof window<"u"?g.useLayoutEffect:g.useEffect,GA=new WeakMap;function Ase(e,t){var n=Cse(null,function(r){return e.forEach(function(s){return u_(s,r)})});return Pse(function(){var r=GA.get(n);if(r){var s=new Set(r),i=new Set(e),o=n.current;s.forEach(function(c){i.has(c)||u_(c,null)}),i.forEach(function(c){s.has(c)||u_(c,o)})}GA.set(n,e)},[e]),n}function Tse(e){return e}function Rse(e,t){t===void 0&&(t=Tse);var n=[],r=!1,s={read:function(){if(r)throw new Error("Sidecar: could not `read` from an `assigned` medium. `read` could be used only with `useMedium`.");return n.length?n[n.length-1]:e},useMedium:function(i){var o=t(i,r);return n.push(o),function(){n=n.filter(function(c){return c!==o})}},assignSyncMedium:function(i){for(r=!0;n.length;){var o=n;n=[],o.forEach(i)}n={push:function(c){return i(c)},filter:function(){return n}}},assignMedium:function(i){r=!0;var o=[];if(n.length){var c=n;n=[],c.forEach(i),o=n}var u=function(){var f=o;o=[],f.forEach(i)},d=function(){return Promise.resolve().then(u)};d(),n={push:function(f){o.push(f),d()},filter:function(f){return o=o.filter(f),n}}}};return s}function Ise(e){e===void 0&&(e={});var t=Rse(null);return t.options=fo({async:!0,ssr:!1},e),t}var g4=function(e){var t=e.sideCar,n=m4(e,["sideCar"]);if(!t)throw new Error("Sidecar: please provide `sideCar` property to import the right car");var r=t.read();if(!r)throw new Error("Sidecar medium not found");return g.createElement(r,fo({},n))};g4.isSideCarExport=!0;function Ose(e,t){return e.useMedium(t),g4}var v4=Ise(),d_=function(){},Xg=g.forwardRef(function(e,t){var n=g.useRef(null),r=g.useState({onScrollCapture:d_,onWheelCapture:d_,onTouchMoveCapture:d_}),s=r[0],i=r[1],o=e.forwardProps,c=e.children,u=e.className,d=e.removeScrollBar,f=e.enabled,p=e.shards,m=e.sideCar,v=e.noRelative,_=e.noIsolation,w=e.inert,b=e.allowPinchZoom,S=e.as,E=S===void 0?"div":S,C=e.gapMode,A=m4(e,["forwardProps","children","className","removeScrollBar","enabled","shards","sideCar","noRelative","noIsolation","inert","allowPinchZoom","as","gapMode"]),T=m,M=Ase([n,t]),O=fo(fo({},A),s);return g.createElement(g.Fragment,null,f&&g.createElement(T,{sideCar:v4,removeScrollBar:d,shards:p,noRelative:v,noIsolation:_,inert:w,setCallbacks:i,allowPinchZoom:!!b,lockRef:n,gapMode:C}),o?g.cloneElement(g.Children.only(c),fo(fo({},O),{ref:M})):g.createElement(E,fo({},O,{className:u,ref:M}),c))});Xg.defaultProps={enabled:!0,removeScrollBar:!0,inert:!1};Xg.classNames={fullWidth:u0,zeroRight:c0};var Mse=function(){if(typeof __webpack_nonce__<"u")return __webpack_nonce__};function Nse(){if(!document)return null;var e=document.createElement("style");e.type="text/css";var t=Mse();return t&&e.setAttribute("nonce",t),e}function Lse(e,t){e.styleSheet?e.styleSheet.cssText=t:e.appendChild(document.createTextNode(t))}function $se(e){var t=document.head||document.getElementsByTagName("head")[0];t.appendChild(e)}var Dse=function(){var e=0,t=null;return{add:function(n){e==0&&(t=Nse())&&(Lse(t,n),$se(t)),e++},remove:function(){e--,!e&&t&&(t.parentNode&&t.parentNode.removeChild(t),t=null)}}},Fse=function(){var e=Dse();return function(t,n){g.useEffect(function(){return e.add(t),function(){e.remove()}},[t&&n])}},y4=function(){var e=Fse(),t=function(n){var r=n.styles,s=n.dynamic;return e(r,s),null};return t},jse={left:0,top:0,right:0,gap:0},f_=function(e){return parseInt(e||"",10)||0},zse=function(e){var t=window.getComputedStyle(document.body),n=t[e==="padding"?"paddingLeft":"marginLeft"],r=t[e==="padding"?"paddingTop":"marginTop"],s=t[e==="padding"?"paddingRight":"marginRight"];return[f_(n),f_(r),f_(s)]},Vse=function(e){if(e===void 0&&(e="margin"),typeof window>"u")return jse;var t=zse(e),n=document.documentElement.clientWidth,r=window.innerWidth;return{left:t[0],top:t[1],right:t[2],gap:Math.max(0,r-n+t[2]-t[0])}},Hse=y4(),Du="data-scroll-locked",Use=function(e,t,n,r){var s=e.left,i=e.top,o=e.right,c=e.gap;return n===void 0&&(n="margin"),`
|
|
130
|
+
.`.concat(Ese,` {
|
|
131
|
+
overflow: hidden `).concat(r,`;
|
|
132
|
+
padding-right: `).concat(c,"px ").concat(r,`;
|
|
133
|
+
}
|
|
134
|
+
body[`).concat(Du,`] {
|
|
135
|
+
overflow: hidden `).concat(r,`;
|
|
136
|
+
overscroll-behavior: contain;
|
|
137
|
+
`).concat([t&&"position: relative ".concat(r,";"),n==="margin"&&`
|
|
138
|
+
padding-left: `.concat(s,`px;
|
|
139
|
+
padding-top: `).concat(i,`px;
|
|
140
|
+
padding-right: `).concat(o,`px;
|
|
141
|
+
margin-left:0;
|
|
142
|
+
margin-top:0;
|
|
143
|
+
margin-right: `).concat(c,"px ").concat(r,`;
|
|
144
|
+
`),n==="padding"&&"padding-right: ".concat(c,"px ").concat(r,";")].filter(Boolean).join(""),`
|
|
145
|
+
}
|
|
146
|
+
|
|
147
|
+
.`).concat(c0,` {
|
|
148
|
+
right: `).concat(c,"px ").concat(r,`;
|
|
149
|
+
}
|
|
150
|
+
|
|
151
|
+
.`).concat(u0,` {
|
|
152
|
+
margin-right: `).concat(c,"px ").concat(r,`;
|
|
153
|
+
}
|
|
154
|
+
|
|
155
|
+
.`).concat(c0," .").concat(c0,` {
|
|
156
|
+
right: 0 `).concat(r,`;
|
|
157
|
+
}
|
|
158
|
+
|
|
159
|
+
.`).concat(u0," .").concat(u0,` {
|
|
160
|
+
margin-right: 0 `).concat(r,`;
|
|
161
|
+
}
|
|
162
|
+
|
|
163
|
+
body[`).concat(Du,`] {
|
|
164
|
+
`).concat(kse,": ").concat(c,`px;
|
|
165
|
+
}
|
|
166
|
+
`)},qA=function(){var e=parseInt(document.body.getAttribute(Du)||"0",10);return isFinite(e)?e:0},Zse=function(){g.useEffect(function(){return document.body.setAttribute(Du,(qA()+1).toString()),function(){var e=qA()-1;e<=0?document.body.removeAttribute(Du):document.body.setAttribute(Du,e.toString())}},[])},Bse=function(e){var t=e.noRelative,n=e.noImportant,r=e.gapMode,s=r===void 0?"margin":r;Zse();var i=g.useMemo(function(){return Vse(s)},[s]);return g.createElement(Hse,{styles:Use(i,!t,s,n?"":"!important")})},M2=!1;if(typeof window<"u")try{var Rm=Object.defineProperty({},"passive",{get:function(){return M2=!0,!0}});window.addEventListener("test",Rm,Rm),window.removeEventListener("test",Rm,Rm)}catch{M2=!1}var du=M2?{passive:!1}:!1,Wse=function(e){return e.tagName==="TEXTAREA"},_4=function(e,t){if(!(e instanceof Element))return!1;var n=window.getComputedStyle(e);return n[t]!=="hidden"&&!(n.overflowY===n.overflowX&&!Wse(e)&&n[t]==="visible")},Kse=function(e){return _4(e,"overflowY")},Gse=function(e){return _4(e,"overflowX")},YA=function(e,t){var n=t.ownerDocument,r=t;do{typeof ShadowRoot<"u"&&r instanceof ShadowRoot&&(r=r.host);var s=w4(e,r);if(s){var i=b4(e,r),o=i[1],c=i[2];if(o>c)return!0}r=r.parentNode}while(r&&r!==n.body);return!1},qse=function(e){var t=e.scrollTop,n=e.scrollHeight,r=e.clientHeight;return[t,n,r]},Yse=function(e){var t=e.scrollLeft,n=e.scrollWidth,r=e.clientWidth;return[t,n,r]},w4=function(e,t){return e==="v"?Kse(t):Gse(t)},b4=function(e,t){return e==="v"?qse(t):Yse(t)},Qse=function(e,t){return e==="h"&&t==="rtl"?-1:1},Xse=function(e,t,n,r,s){var i=Qse(e,window.getComputedStyle(t).direction),o=i*r,c=n.target,u=t.contains(c),d=!1,f=o>0,p=0,m=0;do{if(!c)break;var v=b4(e,c),_=v[0],w=v[1],b=v[2],S=w-b-i*_;(_||S)&&w4(e,c)&&(p+=S,m+=_);var E=c.parentNode;c=E&&E.nodeType===Node.DOCUMENT_FRAGMENT_NODE?E.host:E}while(!u&&c!==document.body||u&&(t.contains(c)||t===c));return(f&&Math.abs(p)<1||!f&&Math.abs(m)<1)&&(d=!0),d},Im=function(e){return"changedTouches"in e?[e.changedTouches[0].clientX,e.changedTouches[0].clientY]:[0,0]},QA=function(e){return[e.deltaX,e.deltaY]},XA=function(e){return e&&"current"in e?e.current:e},Jse=function(e,t){return e[0]===t[0]&&e[1]===t[1]},eie=function(e){return`
|
|
167
|
+
.block-interactivity-`.concat(e,` {pointer-events: none;}
|
|
168
|
+
.allow-interactivity-`).concat(e,` {pointer-events: all;}
|
|
169
|
+
`)},tie=0,fu=[];function nie(e){var t=g.useRef([]),n=g.useRef([0,0]),r=g.useRef(),s=g.useState(tie++)[0],i=g.useState(y4)[0],o=g.useRef(e);g.useEffect(function(){o.current=e},[e]),g.useEffect(function(){if(e.inert){document.body.classList.add("block-interactivity-".concat(s));var w=Sse([e.lockRef.current],(e.shards||[]).map(XA),!0).filter(Boolean);return w.forEach(function(b){return b.classList.add("allow-interactivity-".concat(s))}),function(){document.body.classList.remove("block-interactivity-".concat(s)),w.forEach(function(b){return b.classList.remove("allow-interactivity-".concat(s))})}}},[e.inert,e.lockRef.current,e.shards]);var c=g.useCallback(function(w,b){if("touches"in w&&w.touches.length===2||w.type==="wheel"&&w.ctrlKey)return!o.current.allowPinchZoom;var S=Im(w),E=n.current,C="deltaX"in w?w.deltaX:E[0]-S[0],A="deltaY"in w?w.deltaY:E[1]-S[1],T,M=w.target,O=Math.abs(C)>Math.abs(A)?"h":"v";if("touches"in w&&O==="h"&&M.type==="range")return!1;var R=window.getSelection(),D=R&&R.anchorNode,U=D?D===M||D.contains(M):!1;if(U)return!1;var W=YA(O,M);if(!W)return!0;if(W?T=O:(T=O==="v"?"h":"v",W=YA(O,M)),!W)return!1;if(!r.current&&"changedTouches"in w&&(C||A)&&(r.current=T),!T)return!0;var H=r.current||T;return Xse(H,b,w,H==="h"?C:A)},[]),u=g.useCallback(function(w){var b=w;if(!(!fu.length||fu[fu.length-1]!==i)){var S="deltaY"in b?QA(b):Im(b),E=t.current.filter(function(T){return T.name===b.type&&(T.target===b.target||b.target===T.shadowParent)&&Jse(T.delta,S)})[0];if(E&&E.should){b.cancelable&&b.preventDefault();return}if(!E){var C=(o.current.shards||[]).map(XA).filter(Boolean).filter(function(T){return T.contains(b.target)}),A=C.length>0?c(b,C[0]):!o.current.noIsolation;A&&b.cancelable&&b.preventDefault()}}},[]),d=g.useCallback(function(w,b,S,E){var C={name:w,delta:b,target:S,should:E,shadowParent:rie(S)};t.current.push(C),setTimeout(function(){t.current=t.current.filter(function(A){return A!==C})},1)},[]),f=g.useCallback(function(w){n.current=Im(w),r.current=void 0},[]),p=g.useCallback(function(w){d(w.type,QA(w),w.target,c(w,e.lockRef.current))},[]),m=g.useCallback(function(w){d(w.type,Im(w),w.target,c(w,e.lockRef.current))},[]);g.useEffect(function(){return fu.push(i),e.setCallbacks({onScrollCapture:p,onWheelCapture:p,onTouchMoveCapture:m}),document.addEventListener("wheel",u,du),document.addEventListener("touchmove",u,du),document.addEventListener("touchstart",f,du),function(){fu=fu.filter(function(w){return w!==i}),document.removeEventListener("wheel",u,du),document.removeEventListener("touchmove",u,du),document.removeEventListener("touchstart",f,du)}},[]);var v=e.removeScrollBar,_=e.inert;return g.createElement(g.Fragment,null,_?g.createElement(i,{styles:eie(s)}):null,v?g.createElement(Bse,{noRelative:e.noRelative,gapMode:e.gapMode}):null)}function rie(e){for(var t=null;e!==null;)e instanceof ShadowRoot&&(t=e.host,e=e.host),e=e.parentNode;return t}const sie=Ose(v4,nie);var Gx=g.forwardRef(function(e,t){return g.createElement(Xg,fo({},e,{ref:t,sideCar:sie}))});Gx.classNames=Xg.classNames;var iie=function(e){if(typeof document>"u")return null;var t=Array.isArray(e)?e[0]:e;return t.ownerDocument.body},hu=new WeakMap,Om=new WeakMap,Mm={},h_=0,x4=function(e){return e&&(e.host||x4(e.parentNode))},oie=function(e,t){return t.map(function(n){if(e.contains(n))return n;var r=x4(n);return r&&e.contains(r)?r:(console.error("aria-hidden",n,"in not contained inside",e,". Doing nothing"),null)}).filter(function(n){return!!n})},aie=function(e,t,n,r){var s=oie(t,Array.isArray(e)?e:[e]);Mm[n]||(Mm[n]=new WeakMap);var i=Mm[n],o=[],c=new Set,u=new Set(s),d=function(p){!p||c.has(p)||(c.add(p),d(p.parentNode))};s.forEach(d);var f=function(p){!p||u.has(p)||Array.prototype.forEach.call(p.children,function(m){if(c.has(m))f(m);else try{var v=m.getAttribute(r),_=v!==null&&v!=="false",w=(hu.get(m)||0)+1,b=(i.get(m)||0)+1;hu.set(m,w),i.set(m,b),o.push(m),w===1&&_&&Om.set(m,!0),b===1&&m.setAttribute(n,"true"),_||m.setAttribute(r,"true")}catch(S){console.error("aria-hidden: cannot operate on ",m,S)}})};return f(t),c.clear(),h_++,function(){o.forEach(function(p){var m=hu.get(p)-1,v=i.get(p)-1;hu.set(p,m),i.set(p,v),m||(Om.has(p)||p.removeAttribute(r),Om.delete(p)),v||p.removeAttribute(n)}),h_--,h_||(hu=new WeakMap,hu=new WeakMap,Om=new WeakMap,Mm={})}},S4=function(e,t,n){n===void 0&&(n="data-aria-hidden");var r=Array.from(Array.isArray(e)?e:[e]),s=iie(e);return s?(r.push.apply(r,Array.from(s.querySelectorAll("[aria-live], script"))),aie(r,s,n,"aria-hidden")):function(){return null}},lie=Object.defineProperty,Ns=(e,t)=>lie(e,"name",{value:t,configurable:!0}),qx="Dialog",[E4,ede]=Gh(qx),[cie,Hi]=E4(qx),uie=Ns(e=>{const{__scopeDialog:t,children:n,open:r,defaultOpen:s,onOpenChange:i,modal:o=!0}=e,c=g.useRef(null),u=g.useRef(null),{nodes:d,registry:f}=Nx(),[p,m]=Yg({prop:r,defaultProp:s??!1,onChange:i,caller:qx}),[v,_]=g.useState(0),[w,b]=g.useState(0);return P.jsx(cie,{scope:t,triggerRef:c,contentRef:u,contentId:ol(),titleId:ol(),descriptionId:ol(),titlePresent:v>0,descriptionPresent:w>0,setTitleCount:_,setDescriptionCount:b,open:p,onOpenChange:m,onOpenToggle:g.useCallback(()=>m(S=>!S),[m]),modal:o,branchNodes:d,branchRegistry:f,children:n})},"Dialog"),die="DialogTrigger",fie=g.forwardRef(Ns(function(t,n){const{__scopeDialog:r,...s}=t,i=Hi(die,r),o=gs(n,i.triggerRef);return P.jsx(Xs.button,{type:"button","aria-haspopup":"dialog","aria-expanded":i.open,"aria-controls":i.open?i.contentId:void 0,"data-state":Jg(i.open),...s,ref:o,onClick:gr(t.onClick,i.onOpenToggle)})},"DialogTrigger")),k4="DialogPortal",[hie,C4]=E4(k4,{forceMount:void 0}),pie=Ns(e=>{const{__scopeDialog:t,forceMount:n,children:r,container:s}=e,i=Hi(k4,t);return P.jsx(hie,{scope:t,forceMount:n,children:g.Children.map(r,o=>P.jsx(Ac,{present:n||i.open,children:P.jsx(Ux,{asChild:!0,container:s,children:o})}))})},"DialogPortal"),N2="DialogOverlay",mie=g.forwardRef(Ns(function(t,n){const r=C4(N2,t.__scopeDialog),{forceMount:s=r.forceMount,...i}=t,o=Hi(N2,t.__scopeDialog);return o.modal?P.jsx(Ac,{present:s||o.open,children:P.jsx(vie,{...i,ref:n})}):null},"DialogOverlay")),gie=Hg("DialogOverlay.RemoveScroll"),vie=g.forwardRef(Ns(function(t,n){const{__scopeDialog:r,...s}=t,i=Hi(N2,r),o=w5(),c=gs(n,o);return P.jsx(Gx,{as:gie,allowPinchZoom:!0,shards:g.useMemo(()=>[i.contentRef,...i.branchNodes.map(u=>({current:u}))],[i.contentRef,i.branchNodes]),children:P.jsx(Xs.div,{"data-state":Jg(i.open),...s,ref:c,style:{pointerEvents:"auto",...s.style}})})},"DialogOverlayImpl")),Oh="DialogContent",yie=g.forwardRef(Ns(function(t,n){const r=C4(Oh,t.__scopeDialog),{forceMount:s=r.forceMount,...i}=t,o=Hi(Oh,t.__scopeDialog);return P.jsx(Ac,{present:s||o.open,children:o.modal?P.jsx(_ie,{...i,ref:n}):P.jsx(wie,{...i,ref:n})})},"DialogContent")),_ie=g.forwardRef(Ns(function(t,n){const r=Hi(Oh,t.__scopeDialog),s=g.useRef(null),i=gs(n,r.contentRef,s);return g.useEffect(()=>{const o=s.current;if(o)return S4(o)},[]),P.jsx(P4,{...t,ref:i,trapFocus:r.open,disableOutsidePointerEvents:r.open,onCloseAutoFocus:gr(t.onCloseAutoFocus,o=>{var c;o.preventDefault(),(c=r.triggerRef.current)==null||c.focus()}),onPointerDownOutside:gr(t.onPointerDownOutside,o=>{const c=o.detail.originalEvent,u=c.button===0&&c.ctrlKey===!0;(c.button===2||u)&&o.preventDefault()}),onFocusOutside:gr(t.onFocusOutside,o=>o.preventDefault())})},"DialogContentModal")),wie=g.forwardRef(Ns(function(t,n){const r=Hi(Oh,t.__scopeDialog),s=g.useRef(!1),i=g.useRef(!1);return P.jsx(P4,{...t,ref:n,trapFocus:!1,disableOutsidePointerEvents:!1,onCloseAutoFocus:o=>{var c,u;(c=t.onCloseAutoFocus)==null||c.call(t,o),o.defaultPrevented||(s.current||(u=r.triggerRef.current)==null||u.focus(),o.preventDefault()),s.current=!1,i.current=!1},onInteractOutside:o=>{var d,f;(d=t.onInteractOutside)==null||d.call(t,o),o.defaultPrevented||(s.current=!0,o.detail.originalEvent.type==="pointerdown"&&(i.current=!0));const c=o.target;((f=r.triggerRef.current)==null?void 0:f.contains(c))&&o.preventDefault(),o.detail.originalEvent.type==="focusin"&&i.current&&o.preventDefault()}})},"DialogContentNonModal")),P4=g.forwardRef(Ns(function(t,n){const{__scopeDialog:r,trapFocus:s,onOpenAutoFocus:i,onCloseAutoFocus:o,"aria-describedby":c,children:u,...d}=t,f=Hi(Oh,r);return Qg(),P.jsx(Mx,{registry:f.branchRegistry,children:P.jsx(S5,{asChild:!0,loop:!0,trapped:s,branches:f.branchNodes,onMountAutoFocus:i,onUnmountAutoFocus:o,children:P.jsx(Ix,{role:"dialog",id:f.contentId,"aria-labelledby":f.titlePresent?f.titleId:void 0,"aria-describedby":f.descriptionPresent?T4(c,f.descriptionId):c,"data-state":Jg(f.open),...d,ref:n,deferPointerDownOutside:!0,onDismiss:()=>f.onOpenChange(!1),children:u})})})},"DialogContentImpl")),A4=g.forwardRef(Ns(function(t,n){const{__scopeDialog:r,...s}=t,i=Hi("DialogTitle",r),{setTitleCount:o}=i;return Rs(()=>(o(c=>c+1),()=>o(c=>c-1)),[o]),P.jsx(Xs.h2,{id:i.titleId,...s,ref:n})},"DialogTitle")),bie=g.forwardRef(Ns(function(t,n){const{__scopeDialog:r,...s}=t,i=Hi("DialogDescription",r),{setDescriptionCount:o}=i;return Rs(()=>(o(c=>c+1),()=>o(c=>c-1)),[o]),P.jsx(Xs.p,{id:i.descriptionId,...s,ref:n})},"DialogDescription")),xie="DialogClose",Sie=g.forwardRef(Ns(function(t,n){const{__scopeDialog:r,...s}=t,i=Hi(xie,r);return P.jsx(Xs.button,{type:"button",...s,ref:n,onClick:gr(t.onClick,()=>i.onOpenChange(!1))})},"DialogClose"));function T4(...e){const t=new Set;for(const n of e)if(typeof n=="string")for(const r of String(n).trim().split(/\s+/))r&&t.add(r);return t.size>0?Array.from(t).join(" "):void 0}Ns(T4,"concatAriaDescribedby");function Jg(e){return e?"open":"closed"}Ns(Jg,"getState");const JA="fixed top-1/2 left-1/2 -translate-x-1/2 -translate-y-1/2",Eie={editor:{overlay:"z-max fixed inset-0 bg-black/40",content:`z-max border-surface-2 bg-background font-main ${JA} rounded-lg border shadow-2xl outline-none`},library:{overlay:"z-modal fixed inset-0 bg-black/60",content:`bg-surface-2 text-foreground z-ui-secondary ${JA} rounded-xl p-6 shadow-lg forced-colors:border`},librarySheet:{overlay:"fixed inset-0 z-50 bg-black/55",content:"bg-background text-foreground fixed inset-y-0 right-0 z-50 flex flex-col border-l border-white/10 shadow-2xl outline-none"}},kie="bg-black/60",R4=g.createContext(null),Cie=4,Nm=[],e3=()=>document.activeElement===document.body?null:document.activeElement,ev=e=>{const t=e.open===!0,[n,r]=g.useState(()=>({isOpen:t,opener:t?e3():null}));return n.isOpen!==t&&r({isOpen:t,opener:t?e3():n.opener}),P.jsx(R4.Provider,{value:n.opener,children:P.jsx(uie,{...e})})},tde=fie,nde=Sie,Pie=A4,Yx=bie,tv=({surface:e="editor",isStacked:t=!1,className:n,children:r,onCloseAutoFocus:s,onOpenAutoFocus:i,onEscapeKeyDown:o,onBlur:c,...u})=>{const[d,f]=g.useState(null),p=g.useContext(R4),m=Eie[e],v=S=>{s==null||s(S),!S.defaultPrevented&&(!(p instanceof HTMLElement)||!p.isConnected||(S.preventDefault(),p.focus()))},_=S=>{c==null||c(S);const E=S.relatedTarget;E instanceof HTMLElement&&(S.currentTarget.contains(E)||(Nm.push(E),Nm.length>Cie&&Nm.shift()))},w=S=>{i==null||i(S);const E=S.currentTarget;if(S.defaultPrevented||!(E instanceof Element))return;const C=[...Nm].reverse().find(A=>A.isConnected&&E.contains(A));C&&(S.preventDefault(),C.focus())},b=S=>{o==null||o(S);const E=S.target;S.defaultPrevented||!(E instanceof Element)||!d||E===E.ownerDocument.body||d.contains(E)||S.preventDefault()};return P.jsxs(pie,{children:[P.jsx(mie,{className:or(m.overlay,t&&kie)}),P.jsx(yie,{...u,onCloseAutoFocus:v,onOpenAutoFocus:w,onEscapeKeyDown:b,onBlur:_,ref:f,className:or(m.content,n),children:P.jsx(_se,{value:d,children:r})})]})},Qx=({children:e,onClose:t,isCloseDisabled:n=!1})=>P.jsxs("div",{className:"border-surface-2 bg-card flex items-center justify-between rounded-t-lg border-b px-4 py-2",children:[P.jsx(A4,{className:"text-foreground text-base font-medium",children:e}),P.jsx(ir,{onClick:t,disabled:n,"aria-label":"Close",variant:"ghost",size:"icon-compact",children:P.jsx(zL,{className:"h-4 w-4",weight:"bold"})})]}),Aie="bg-destructive/15 text-destructive hover:bg-destructive/25 hover:text-destructive focus-visible:bg-destructive/25 focus-visible:text-destructive",Tie=e=>e.kind==="active"?e.variant.label.trim()||"this direction":e.kind==="run"?e.label.trim()||"this run":e.entry.label.trim()||"this direction",Rie=({target:e,fallbackFocus:t,isConfirming:n,onCancel:r,onConfirm:s})=>{if(!e)return null;const i=Tie(e),o=e.kind==="run",c=o?e.variants.length+e.entries.length:0,u=o?"Remove run":"Remove direction";return P.jsx(ev,{open:!0,onOpenChange:d=>{!d&&!n&&r()},children:P.jsx(tv,{className:"w-[360px]",onCloseAutoFocus:d=>{const f=[e.returnFocusTo,t==null?void 0:t.current].find(p=>p==null?void 0:p.isConnected);f&&(d.preventDefault(),f.focus())},children:P.jsxs("div",{className:"flex flex-col gap-3 p-4",children:[P.jsx(Pie,{className:"text-foreground text-base font-medium",children:o?"Remove run?":"Remove direction?"}),P.jsx(Yx,{className:"text-muted-foreground text-sm leading-5",children:o?`This removes all ${c} directions in “${i}”.`:`This removes “${i}” from the directions list.`}),P.jsxs("div",{className:"flex justify-end gap-2 pt-1",children:[P.jsx(ir,{variant:"ghost",onClick:r,disabled:n,children:"Cancel"}),P.jsx(ir,{variant:"ghost","aria-label":"Confirm remove direction",onClick:s,disabled:n,className:Aie,children:n?"Removing...":u})]})]})})})};var Iie=Object.defineProperty,fa=(e,t)=>Iie(e,"name",{value:t,configurable:!0}),Xx="Popover",[I4,rde]=Gh(Xx,[Gg]),Jx=Gg(),[Oie,Nd]=I4(Xx),Mie=fa(e=>{const{__scopePopover:t,children:n,open:r,defaultOpen:s,onOpenChange:i,modal:o=!1}=e,c=Jx(t),u=g.useRef(null),[d,f]=g.useState(!1),[p,m]=g.useState(0),[v,_]=g.useState(0),[w,b]=Yg({prop:r,defaultProp:s??!1,onChange:i,caller:Xx});return P.jsx(W5,{...c,children:P.jsx(Oie,{scope:t,contentId:ol(),titleId:ol(),descriptionId:ol(),titlePresent:p>0,descriptionPresent:v>0,setTitleCount:m,setDescriptionCount:_,triggerRef:u,open:w,onOpenChange:b,onOpenToggle:g.useCallback(()=>b(S=>!S),[b]),hasCustomAnchor:d,onCustomAnchorAdd:g.useCallback(()=>f(!0),[]),onCustomAnchorRemove:g.useCallback(()=>f(!1),[]),modal:o,children:n})})},"Popover"),Nie="PopoverTrigger",Lie=g.forwardRef(fa(function(t,n){const{__scopePopover:r,...s}=t,i=Nd(Nie,r),o=Jx(r),c=gs(n,i.triggerRef),u=P.jsx(Xs.button,{type:"button","aria-haspopup":"dialog","aria-expanded":i.open,"aria-controls":i.open?i.contentId:void 0,"data-state":eS(i.open),...s,ref:c,onClick:gr(t.onClick,i.onOpenToggle)});return i.hasCustomAnchor?u:P.jsx(K5,{asChild:!0,...o,children:u})},"PopoverTrigger")),O4="PopoverPortal",[$ie,Die]=I4(O4,{forceMount:void 0}),Fie=fa(e=>{const{__scopePopover:t,forceMount:n,children:r,container:s}=e,i=Nd(O4,t);return P.jsx($ie,{scope:t,forceMount:n,children:P.jsx(Ac,{present:n||i.open,children:P.jsx(Ux,{asChild:!0,container:s,children:r})})})},"PopoverPortal"),Mh="PopoverContent",jie=g.forwardRef(fa(function(t,n){const r=Die(Mh,t.__scopePopover),{forceMount:s=r.forceMount,...i}=t,o=Nd(Mh,t.__scopePopover);return P.jsx(Ac,{present:s||o.open,children:o.modal?P.jsx(Vie,{...i,ref:n}):P.jsx(Hie,{...i,ref:n})})},"PopoverContent")),zie=Hg("PopoverContent.RemoveScroll"),Vie=g.forwardRef(fa(function(t,n){const r=Nd(Mh,t.__scopePopover),s=g.useRef(null),i=gs(n,s),o=g.useRef(!1),{nodes:c,registry:u}=Nx();return g.useEffect(()=>{const d=s.current;if(d)return S4(d)},[]),P.jsx(Gx,{as:zie,allowPinchZoom:!0,shards:g.useMemo(()=>[s,...c.map(d=>({current:d}))],[s,c]),children:P.jsx(M4,{...t,ref:i,branchNodes:c,branchRegistry:u,trapFocus:r.open,disableOutsidePointerEvents:!0,onCloseAutoFocus:gr(t.onCloseAutoFocus,d=>{var f;d.preventDefault(),o.current||(f=r.triggerRef.current)==null||f.focus()}),onPointerDownOutside:gr(t.onPointerDownOutside,d=>{const f=d.detail.originalEvent,p=f.button===0&&f.ctrlKey===!0,m=f.button===2||p;o.current=m},{checkForDefaultPrevented:!1}),onFocusOutside:gr(t.onFocusOutside,d=>d.preventDefault(),{checkForDefaultPrevented:!1})})})},"PopoverContentModal")),Hie=g.forwardRef(fa(function(t,n){const r=Nd(Mh,t.__scopePopover),s=g.useRef(!1),i=g.useRef(!1);return P.jsx(M4,{...t,ref:n,trapFocus:!1,disableOutsidePointerEvents:!1,onCloseAutoFocus:o=>{var c,u;(c=t.onCloseAutoFocus)==null||c.call(t,o),o.defaultPrevented||(s.current||(u=r.triggerRef.current)==null||u.focus(),o.preventDefault()),s.current=!1,i.current=!1},onInteractOutside:o=>{var d,f;(d=t.onInteractOutside)==null||d.call(t,o),o.defaultPrevented||(s.current=!0,o.detail.originalEvent.type==="pointerdown"&&(i.current=!0));const c=o.target;((f=r.triggerRef.current)==null?void 0:f.contains(c))&&o.preventDefault(),o.detail.originalEvent.type==="focusin"&&i.current&&o.preventDefault()}})},"PopoverContentNonModal")),M4=g.forwardRef(fa(function(t,n){const{__scopePopover:r,trapFocus:s,onOpenAutoFocus:i,onCloseAutoFocus:o,disableOutsidePointerEvents:c,onEscapeKeyDown:u,onPointerDownOutside:d,onFocusOutside:f,onInteractOutside:p,"aria-describedby":m,branchNodes:v,branchRegistry:_,...w}=t,b=Nd(Mh,r),S=Jx(r),[E,C]=g.useState(null),A=gs(n,C);return Lx(E),Qg(),P.jsx(Mx,{registry:_,children:P.jsx(S5,{asChild:!0,loop:!0,trapped:s,branches:v,onMountAutoFocus:i,onUnmountAutoFocus:o,children:P.jsx(Ix,{asChild:!0,disableOutsidePointerEvents:c,onInteractOutside:p,onEscapeKeyDown:u,onPointerDownOutside:d,onFocusOutside:f,onDismiss:()=>b.onOpenChange(!1),deferPointerDownOutside:!0,children:P.jsx(q5,{"data-state":eS(b.open),role:"dialog",id:b.contentId,"aria-labelledby":b.titlePresent?b.titleId:void 0,"aria-describedby":b.descriptionPresent?N4(m,b.descriptionId):m,...S,...w,ref:A,style:{...w.style,"--radix-popover-content-transform-origin":"var(--radix-popper-transform-origin)","--radix-popover-content-available-width":"var(--radix-popper-available-width)","--radix-popover-content-available-height":"var(--radix-popper-available-height)","--radix-popover-trigger-width":"var(--radix-popper-anchor-width)","--radix-popover-trigger-height":"var(--radix-popper-anchor-height)"}})})})})},"PopoverContentImpl"));function eS(e){return e?"open":"closed"}fa(eS,"getState");function N4(...e){const t=new Set;for(const n of e)if(typeof n=="string")for(const r of String(n).trim().split(/\s+/))r&&t.add(r);return t.size>0?Array.from(t).join(" "):void 0}fa(N4,"concatAriaDescribedby");const Nh=e=>{const t=g.useRef(e);return g.useLayoutEffect(()=>{t.current=e}),t};let d0=0;const Uie=()=>{d0+=1;let e=!1;return()=>{e||(e=!0,d0=Math.max(0,d0-1))}},Zie=()=>d0>0,Bie='[data-menu-item]:not([disabled]):not([aria-disabled="true"])',Wie=({itemSelector:e=Bie,loop:t=!1,onDismiss:n}={})=>{const r=g.useRef(null),s=g.useRef(null),i=Nh(n),o=g.useRef(!1),c=g.useCallback(f=>{var p;if(r.current=f,f){o.current=!1;const m=Uie(),v=f.ownerDocument.defaultView;let _;const w=()=>{v==null||v.clearTimeout(_),_=v==null?void 0:v.setTimeout(()=>{const b=f.ownerDocument.activeElement;(b==null?void 0:b.tagName)==="IFRAME"&&!f.contains(b)&&i.current&&(o.current=!0,i.current())})};v==null||v.addEventListener("blur",w),s.current=()=>{v==null||v.removeEventListener("blur",w),v==null||v.clearTimeout(_),m()}}else(p=s.current)==null||p.call(s),s.current=null},[i]),u=f=>{o.current&&f.preventDefault()},d=g.useCallback(f=>{var E;const{key:p}=f;if(p!=="ArrowDown"&&p!=="ArrowUp"&&p!=="Home"&&p!=="End")return;const m=r.current;if(!m)return;const v=Array.from(m.querySelectorAll(e));if(v.length===0)return;f.preventDefault(),f.stopPropagation();const _=v.indexOf(document.activeElement),w=v.length-1,b=C=>{if(_===-1)return C===1?0:w;const A=_+C;return t?(A+v.length)%v.length:Math.min(Math.max(A,0),w)};let S;p==="Home"?S=0:p==="End"?S=w:p==="ArrowDown"?S=b(1):S=b(-1),(E=v[S])==null||E.focus()},[e,t]);return{containerRef:c,onKeyDown:d,onCloseAutoFocus:u}},Kie="bg-popover text-popover-foreground shadow-surface-4 z-max min-w-40 rounded-lg p-1",Gie="text-soft-foreground hover:bg-hover hover:text-foreground focus-visible:bg-active focus-visible:text-foreground flex w-full items-center gap-2 rounded-md px-3 py-1.5 text-left text-xs focus-visible:outline-hidden transition-colors duration-80 disabled:cursor-not-allowed disabled:opacity-50",qie=4,tS=g.createContext(()=>{}),nS=({isOpen:e,onOpenChange:t,children:n})=>P.jsx(tS.Provider,{value:t,children:P.jsx(Mie,{open:e,onOpenChange:t,children:n})}),nv=g.forwardRef((e,t)=>P.jsx(Lie,{ref:t,...e,"aria-haspopup":"menu"}));nv.displayName="MenuTrigger";const rS=({className:e,sideOffset:t=qie,onCloseAutoFocus:n,...r})=>{const s=g.useContext(tS),{containerRef:i,onKeyDown:o,onCloseAutoFocus:c}=Wie({onDismiss:()=>s(!1)});return P.jsx(Fie,{children:P.jsx(jie,{...r,sideOffset:t,className:or(Kie,e),ref:i,role:"menu",onKeyDown:o,onCloseAutoFocus:u=>{n==null||n(u),c(u)}})})},Va=g.forwardRef(({className:e,onClick:t,onSelect:n,...r},s)=>{const i=g.useContext(tS);return P.jsx("button",{ref:s,type:"button",...r,onClick:o=>{t==null||t(o),n&&(i(!1),n())},className:or(Gie,e),role:"menuitem","data-menu-item":!0})});Va.displayName="MenuItem";function Yie(e){if(typeof document>"u")return;let t=document.head||document.getElementsByTagName("head")[0],n=document.createElement("style");n.type="text/css",t.appendChild(n),n.styleSheet?n.styleSheet.cssText=e:n.appendChild(document.createTextNode(e))}const Qie=e=>{switch(e){case"success":return eoe;case"info":return noe;case"warning":return toe;case"error":return roe;default:return null}},Xie=Array(12).fill(0),Jie=({visible:e,className:t})=>Ee.createElement("div",{className:["sonner-loading-wrapper",t].filter(Boolean).join(" "),"data-visible":e},Ee.createElement("div",{className:"sonner-spinner"},Xie.map((n,r)=>Ee.createElement("div",{className:"sonner-loading-bar",key:`spinner-bar-${r}`})))),eoe=Ee.createElement("svg",{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 20 20",fill:"currentColor",height:"20",width:"20","aria-hidden":"true"},Ee.createElement("path",{fillRule:"evenodd",d:"M10 18a8 8 0 100-16 8 8 0 000 16zm3.857-9.809a.75.75 0 00-1.214-.882l-3.483 4.79-1.88-1.88a.75.75 0 10-1.06 1.061l2.5 2.5a.75.75 0 001.137-.089l4-5.5z",clipRule:"evenodd"})),toe=Ee.createElement("svg",{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24",fill:"currentColor",height:"20",width:"20","aria-hidden":"true"},Ee.createElement("path",{fillRule:"evenodd",d:"M9.401 3.003c1.155-2 4.043-2 5.197 0l7.355 12.748c1.154 2-.29 4.5-2.599 4.5H4.645c-2.309 0-3.752-2.5-2.598-4.5L9.4 3.003zM12 8.25a.75.75 0 01.75.75v3.75a.75.75 0 01-1.5 0V9a.75.75 0 01.75-.75zm0 8.25a.75.75 0 100-1.5.75.75 0 000 1.5z",clipRule:"evenodd"})),noe=Ee.createElement("svg",{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 20 20",fill:"currentColor",height:"20",width:"20","aria-hidden":"true"},Ee.createElement("path",{fillRule:"evenodd",d:"M18 10a8 8 0 11-16 0 8 8 0 0116 0zm-7-4a1 1 0 11-2 0 1 1 0 012 0zM9 9a.75.75 0 000 1.5h.253a.25.25 0 01.244.304l-.459 2.066A1.75 1.75 0 0010.747 15H11a.75.75 0 000-1.5h-.253a.25.25 0 01-.244-.304l.459-2.066A1.75 1.75 0 009.253 9H9z",clipRule:"evenodd"})),roe=Ee.createElement("svg",{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 20 20",fill:"currentColor",height:"20",width:"20","aria-hidden":"true"},Ee.createElement("path",{fillRule:"evenodd",d:"M18 10a8 8 0 11-16 0 8 8 0 0116 0zm-8-5a.75.75 0 01.75.75v4.5a.75.75 0 01-1.5 0v-4.5A.75.75 0 0110 5zm0 10a1 1 0 100-2 1 1 0 000 2z",clipRule:"evenodd"})),soe=Ee.createElement("svg",{xmlns:"http://www.w3.org/2000/svg",width:"12",height:"12",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"1.5",strokeLinecap:"round",strokeLinejoin:"round","aria-hidden":"true"},Ee.createElement("line",{x1:"18",y1:"6",x2:"6",y2:"18"}),Ee.createElement("line",{x1:"6",y1:"6",x2:"18",y2:"18"})),ioe=()=>{const[e,t]=Ee.useState(document.hidden);return Ee.useEffect(()=>{const n=()=>{t(document.hidden)};return document.addEventListener("visibilitychange",n),()=>document.removeEventListener("visibilitychange",n)},[]),e};let ooe=1;const aoe=100,t3=e=>{var t;return typeof(e==null?void 0:e.id)=="number"||(e==null||(t=e.id)==null?void 0:t.length)>0?e.id:ooe++};class loe{constructor(){this.subscribe=t=>(this.subscribers.push(t),this.getActiveToasts().forEach(n=>t(n)),()=>{const n=this.subscribers.indexOf(t);this.subscribers.splice(n,1)}),this.publish=t=>{this.subscribers.forEach(n=>n(t))},this.addToast=t=>{this.publish(t),this.toasts=[...this.toasts,t],this.trimHistory()},this.trimHistory=()=>{let t=this.toasts.length-aoe;t<=0||(this.toasts=this.toasts.filter(n=>t>0&&this.dismissedToasts.has(n.id)?(this.dismissedToasts.delete(n.id),t--,!1):!0))},this.create=t=>{const{message:n,...r}=t,s=t3(t),i=this.pendingDismissals.get(s);i!==void 0&&(cancelAnimationFrame(i),this.pendingDismissals.delete(s),this.dismissedToasts.delete(s));const o=this.dismissedToasts.has(s),c=t.dismissible===void 0?!0:t.dismissible;return o&&(this.dismissedToasts.delete(s),this.toasts=this.toasts.filter(d=>d.id!==s)),(o?void 0:this.toasts.find(d=>d.id===s))?this.toasts=this.toasts.map(d=>d.id===s?(this.publish({...d,...t,id:s,title:n}),{...d,...t,id:s,dismissible:c,title:n}):d):this.addToast({title:n,...r,dismissible:c,id:s}),s},this.dismiss=t=>{if(t==null)return this.getActiveToasts().forEach(r=>{this.dismissedToasts.add(r.id),this.subscribers.forEach(s=>s({id:r.id,dismiss:!0}))}),t;this.dismissedToasts.add(t);const n=this.pendingDismissals.get(t);return n!==void 0&&cancelAnimationFrame(n),this.pendingDismissals.set(t,requestAnimationFrame(()=>{this.pendingDismissals.delete(t),this.subscribers.forEach(r=>r({id:t,dismiss:!0}))})),t},this.message=(t,n)=>this.create({...n,message:t,type:void 0}),this.error=(t,n)=>this.create({...n,message:t,type:"error"}),this.success=(t,n)=>this.create({...n,type:"success",message:t}),this.info=(t,n)=>this.create({...n,type:"info",message:t}),this.warning=(t,n)=>this.create({...n,type:"warning",message:t}),this.loading=(t,n)=>this.create({...n,type:"loading",message:t}),this.promise=(t,n)=>{if(!n)return;let r;n.loading!==void 0&&(r=this.create({...n,promise:t,type:"loading",message:n.loading,description:typeof n.description!="function"?n.description:void 0}));const s=Promise.resolve(t instanceof Function?t():t);let i=r!==void 0,o;const c=s.then(async d=>{if(o=["resolve",d],Ee.isValidElement(d))i=!1,this.create({id:r,type:"default",message:d});else if(uoe(d)&&!d.ok){i=!1;const p=typeof n.error=="function"?await n.error(`HTTP error! status: ${d.status}`):n.error,m=typeof n.description=="function"?await n.description(`HTTP error! status: ${d.status}`):n.description,_=typeof p=="object"&&!Ee.isValidElement(p)?p:{message:p};this.create({id:r,type:"error",description:m,..._})}else if(d instanceof Error){i=!1;const p=typeof n.error=="function"?await n.error(d):n.error,m=typeof n.description=="function"?await n.description(d):n.description,_=typeof p=="object"&&!Ee.isValidElement(p)?p:{message:p};this.create({id:r,type:"error",description:m,..._})}else if(n.success!==void 0){i=!1;const p=typeof n.success=="function"?await n.success(d):n.success,m=typeof n.description=="function"?await n.description(d):n.description,_=typeof p=="object"&&!Ee.isValidElement(p)?p:{message:p};this.create({id:r,type:"success",description:m,..._})}}).catch(async d=>{if(o=["reject",d],n.error!==void 0){i=!1;const f=typeof n.error=="function"?await n.error(d):n.error,p=typeof n.description=="function"?await n.description(d):n.description,v=typeof f=="object"&&!Ee.isValidElement(f)?f:{message:f};this.create({id:r,type:"error",description:p,...v})}}).finally(()=>{i&&(this.dismiss(r),r=void 0),n.finally==null||n.finally.call(n)}),u=()=>new Promise((d,f)=>c.then(()=>o[0]==="reject"?f(o[1]):d(o[1])).catch(f));return typeof r!="string"&&typeof r!="number"?{unwrap:u}:Object.assign(r,{unwrap:u})},this.custom=(t,n)=>{const r=t3(n);return this.create({...n,jsx:t(r),id:r,type:void 0}),r},this.getActiveToasts=()=>this.toasts.filter(t=>!this.dismissedToasts.has(t.id)),this.subscribers=[],this.toasts=[],this.dismissedToasts=new Set,this.pendingDismissals=new Map}}const ks=new loe,coe=(e,t)=>ks.message(e,t),uoe=e=>e&&typeof e=="object"&&"ok"in e&&typeof e.ok=="boolean"&&"status"in e&&typeof e.status=="number",doe=coe,foe=()=>ks.toasts,hoe=()=>ks.getActiveToasts(),rn=Object.assign(doe,{success:ks.success,info:ks.info,warning:ks.warning,error:ks.error,custom:ks.custom,message:ks.message,promise:ks.promise,dismiss:ks.dismiss,loading:ks.loading},{getHistory:foe,getToasts:hoe});Yie("[data-sonner-toaster][dir=ltr],html[dir=ltr]{--toast-icon-margin-start:-3px;--toast-icon-margin-end:4px;--toast-svg-margin-start:-1px;--toast-svg-margin-end:0px;--toast-button-margin-start:auto;--toast-button-margin-end:0;--toast-close-button-start:0;--toast-close-button-end:unset;--toast-close-button-transform:translate(-35%, -35%)}[data-sonner-toaster][dir=rtl],html[dir=rtl]{--toast-icon-margin-start:4px;--toast-icon-margin-end:-3px;--toast-svg-margin-start:0px;--toast-svg-margin-end:-1px;--toast-button-margin-start:0;--toast-button-margin-end:auto;--toast-close-button-start:unset;--toast-close-button-end:0;--toast-close-button-transform:translate(35%, -35%)}[data-sonner-toaster]{position:fixed;width:var(--width);font-family:ui-sans-serif,system-ui,-apple-system,BlinkMacSystemFont,Segoe UI,Roboto,Helvetica Neue,Arial,Noto Sans,sans-serif,Apple Color Emoji,Segoe UI Emoji,Segoe UI Symbol,Noto Color Emoji;--gray1:hsl(0, 0%, 99%);--gray2:hsl(0, 0%, 97.3%);--gray3:hsl(0, 0%, 95.1%);--gray4:hsl(0, 0%, 93%);--gray5:hsl(0, 0%, 90.9%);--gray6:hsl(0, 0%, 88.7%);--gray7:hsl(0, 0%, 85.8%);--gray8:hsl(0, 0%, 78%);--gray9:hsl(0, 0%, 56.1%);--gray10:hsl(0, 0%, 52.3%);--gray11:hsl(0, 0%, 43.5%);--gray12:hsl(0, 0%, 9%);--border-radius:8px;box-sizing:border-box;padding:0;margin:0;list-style:none;outline:0;z-index:999999999;transition:transform .4s ease}@media (hover:none) and (pointer:coarse){[data-sonner-toaster][data-lifted=true]{transform:none}}[data-sonner-toaster][data-x-position=right]{right:var(--offset-right)}[data-sonner-toaster][data-x-position=left]{left:var(--offset-left)}[data-sonner-toaster][data-x-position=center]{left:50%;transform:translateX(-50%)}[data-sonner-toaster][data-y-position=top]{top:var(--offset-top)}[data-sonner-toaster][data-y-position=bottom]{bottom:var(--offset-bottom)}[data-sonner-toast]{--y:translateY(100%);--lift-amount:calc(var(--lift) * var(--gap));z-index:var(--z-index);position:absolute;opacity:0;transform:var(--y);touch-action:none;transition:transform .4s,opacity .4s,height .4s,box-shadow .2s;box-sizing:border-box;outline:0;overflow-wrap:anywhere}[data-sonner-toast][data-styled=true]{padding:16px;background:var(--normal-bg);border:1px solid var(--normal-border);color:var(--normal-text);border-radius:var(--border-radius);box-shadow:0 4px 12px rgba(0,0,0,.1);width:var(--width);font-size:13px;display:flex;align-items:center;gap:6px}[data-sonner-toast]:focus-visible{box-shadow:0 4px 12px rgba(0,0,0,.1),0 0 0 2px rgba(0,0,0,.2)}[data-sonner-toast][data-y-position=top]{top:0;--y:translateY(-100%);--lift:1;--lift-amount:calc(1 * var(--gap))}[data-sonner-toast][data-y-position=bottom]{bottom:0;--y:translateY(100%);--lift:-1;--lift-amount:calc(var(--lift) * var(--gap))}[data-sonner-toast][data-styled=true] [data-description]{font-weight:400;line-height:1.4;color:#3f3f3f}[data-rich-colors=true][data-sonner-toast][data-styled=true] [data-description]{color:inherit}[data-sonner-toaster][data-sonner-theme=dark] [data-description]{color:#e8e8e8}[data-sonner-toast][data-styled=true] [data-title]{font-weight:500;line-height:1.5;color:inherit}[data-sonner-toast][data-styled=true] [data-icon]{display:flex;height:16px;width:16px;position:relative;justify-content:flex-start;align-items:center;flex-shrink:0;margin-left:var(--toast-icon-margin-start);margin-right:var(--toast-icon-margin-end)}[data-sonner-toast][data-promise=true] [data-icon]>svg{opacity:0;transform:scale(.8);transform-origin:center;animation:sonner-fade-in .3s ease forwards}[data-sonner-toast][data-styled=true] [data-icon]>*{flex-shrink:0}[data-sonner-toast][data-styled=true] [data-icon] svg{margin-left:var(--toast-svg-margin-start);margin-right:var(--toast-svg-margin-end)}[data-sonner-toast][data-styled=true] [data-content]{display:flex;flex-direction:column;gap:2px;flex:1;min-width:0}[data-sonner-toast][data-styled=true] [data-button]{border-radius:4px;padding-left:8px;padding-right:8px;height:24px;font-size:12px;color:var(--normal-bg);background:var(--normal-text);margin-left:var(--toast-button-margin-start);margin-right:var(--toast-button-margin-end);border:none;font-weight:500;cursor:pointer;outline:0;display:flex;align-items:center;flex-shrink:0;transition:opacity .4s,box-shadow .2s}[data-sonner-toast][data-styled=true] [data-button]:focus-visible{box-shadow:0 0 0 2px rgba(0,0,0,.4)}[data-sonner-toast][data-styled=true] [data-button]:first-of-type{margin-left:var(--toast-button-margin-start);margin-right:var(--toast-button-margin-end)}[data-sonner-toast][data-styled=true] [data-cancel]{color:var(--normal-text);background:rgba(0,0,0,.08)}[data-sonner-toaster][data-sonner-theme=dark] [data-sonner-toast][data-styled=true] [data-cancel]{background:rgba(255,255,255,.3)}[data-sonner-toast][data-styled=true] [data-close-button]{position:absolute;left:var(--toast-close-button-start);right:var(--toast-close-button-end);top:0;height:20px;width:20px;display:flex;justify-content:center;align-items:center;padding:0;color:var(--normal-text);background:var(--normal-bg);border:1px solid var(--normal-border);transform:var(--toast-close-button-transform);border-radius:50%;cursor:pointer;z-index:1;transition:opacity .1s,background .2s,border-color .2s}[data-sonner-toast][data-styled=true] [data-close-button]:focus-visible{box-shadow:0 4px 12px rgba(0,0,0,.1),0 0 0 2px rgba(0,0,0,.2)}[data-sonner-toast][data-styled=true] [data-disabled=true]{cursor:not-allowed}[data-sonner-toast][data-styled=true]:hover [data-close-button]:hover{background:var(--gray2);border-color:var(--gray5)}[data-sonner-toast][data-swiping=true]::before{content:'';position:absolute;left:-100%;right:-100%;height:100%;z-index:-1}[data-sonner-toast][data-y-position=top][data-swiping=true]::before{bottom:50%;transform:scaleY(3) translateY(50%)}[data-sonner-toast][data-y-position=bottom][data-swiping=true]::before{top:50%;transform:scaleY(3) translateY(-50%)}[data-sonner-toast][data-swiping=false][data-removed=true]::before{content:'';position:absolute;inset:0;transform:scaleY(2)}[data-sonner-toast][data-expanded=true]::after{content:'';position:absolute;left:0;height:calc(var(--gap) + 1px);bottom:100%;width:100%}[data-sonner-toast][data-mounted=true]{--y:translateY(0);opacity:1}[data-sonner-toast][data-expanded=false][data-front=false]{--scale:var(--toasts-before) * 0.05 + 1;--y:translateY(calc(var(--lift-amount) * var(--toasts-before))) scale(calc(-1 * var(--scale)));height:var(--front-toast-height)}[data-sonner-toast]>*{transition:opacity .4s}[data-sonner-toast][data-x-position=right]{right:0}[data-sonner-toast][data-x-position=left]{left:0}[data-sonner-toast][data-expanded=false][data-front=false][data-styled=true]>*{opacity:0}[data-sonner-toast][data-visible=false]{opacity:0;pointer-events:none}[data-sonner-toast][data-mounted=true][data-expanded=true]{--y:translateY(calc(var(--lift) * var(--offset)));height:var(--initial-height)}[data-sonner-toast][data-removed=true][data-front=true][data-swipe-out=false]{--y:translateY(calc(var(--lift) * -100%));opacity:0}[data-sonner-toast][data-removed=true][data-front=false][data-swipe-out=false][data-expanded=true]{--y:translateY(calc(var(--lift) * var(--offset) + var(--lift) * -100%));opacity:0}[data-sonner-toast][data-removed=true][data-front=false][data-swipe-out=false][data-expanded=false]{--y:translateY(40%);opacity:0;transition:transform .5s,opacity .2s}[data-sonner-toast][data-removed=true][data-front=false]::before{height:calc(var(--initial-height) + 20%)}[data-sonner-toast][data-swiping=true]{transform:var(--y) translateY(var(--swipe-amount-y,0)) translateX(var(--swipe-amount-x,0));transition:none}[data-sonner-toast][data-swiped=true]{-webkit-user-select:none;user-select:none}[data-sonner-toast][data-swipe-out=true][data-y-position=bottom],[data-sonner-toast][data-swipe-out=true][data-y-position=top]{animation-duration:.2s;animation-timing-function:ease-out;animation-fill-mode:forwards}[data-sonner-toast][data-swipe-out=true][data-swipe-direction=left]{animation-name:swipe-out-left}[data-sonner-toast][data-swipe-out=true][data-swipe-direction=right]{animation-name:swipe-out-right}[data-sonner-toast][data-swipe-out=true][data-swipe-direction=up]{animation-name:swipe-out-up}[data-sonner-toast][data-swipe-out=true][data-swipe-direction=down]{animation-name:swipe-out-down}@keyframes swipe-out-left{from{transform:var(--y) translateX(var(--swipe-amount-x));opacity:1}to{transform:var(--y) translateX(calc(var(--swipe-amount-x) - 100%));opacity:0}}@keyframes swipe-out-right{from{transform:var(--y) translateX(var(--swipe-amount-x));opacity:1}to{transform:var(--y) translateX(calc(var(--swipe-amount-x) + 100%));opacity:0}}@keyframes swipe-out-up{from{transform:var(--y) translateY(var(--swipe-amount-y));opacity:1}to{transform:var(--y) translateY(calc(var(--swipe-amount-y) - 100%));opacity:0}}@keyframes swipe-out-down{from{transform:var(--y) translateY(var(--swipe-amount-y));opacity:1}to{transform:var(--y) translateY(calc(var(--swipe-amount-y) + 100%));opacity:0}}@media (max-width:600px){[data-sonner-toaster]{position:fixed;right:var(--mobile-offset-right);left:var(--mobile-offset-left);width:100%}[data-sonner-toaster][dir=rtl]{left:calc(var(--mobile-offset-left) * -1)}[data-sonner-toaster] [data-sonner-toast]{left:0;right:0;width:calc(100% - var(--mobile-offset-left) * 2)}[data-sonner-toaster][data-x-position=left]{left:var(--mobile-offset-left)}[data-sonner-toaster][data-y-position=bottom]{bottom:var(--mobile-offset-bottom)}[data-sonner-toaster][data-y-position=top]{top:var(--mobile-offset-top)}[data-sonner-toaster][data-x-position=center]{left:var(--mobile-offset-left);right:var(--mobile-offset-right);transform:none}}[data-sonner-toaster][data-sonner-theme=light]{--normal-bg:#fff;--normal-border:var(--gray4);--normal-text:var(--gray12);--success-bg:hsl(143, 85%, 96%);--success-border:hsl(145, 92%, 87%);--success-text:hsl(140, 100%, 27%);--info-bg:hsl(208, 100%, 97%);--info-border:hsl(221, 91%, 93%);--info-text:hsl(210, 92%, 45%);--warning-bg:hsl(49, 100%, 97%);--warning-border:hsl(49, 91%, 84%);--warning-text:hsl(31, 92%, 45%);--error-bg:hsl(359, 100%, 97%);--error-border:hsl(359, 100%, 94%);--error-text:hsl(360, 100%, 45%)}[data-sonner-toaster][data-sonner-theme=light] [data-sonner-toast][data-invert=true]{--normal-bg:#000;--normal-border:hsl(0, 0%, 20%);--normal-text:var(--gray1)}[data-sonner-toaster][data-sonner-theme=dark] [data-sonner-toast][data-invert=true]{--normal-bg:#fff;--normal-border:var(--gray3);--normal-text:var(--gray12)}[data-sonner-toaster][data-sonner-theme=dark]{--normal-bg:#000;--normal-bg-hover:hsl(0, 0%, 12%);--normal-border:hsl(0, 0%, 20%);--normal-border-hover:hsl(0, 0%, 25%);--normal-text:var(--gray1);--success-bg:hsl(150, 100%, 6%);--success-border:hsl(147, 100%, 12%);--success-text:hsl(150, 86%, 65%);--info-bg:hsl(215, 100%, 6%);--info-border:hsl(223, 43%, 17%);--info-text:hsl(216, 87%, 65%);--warning-bg:hsl(64, 100%, 6%);--warning-border:hsl(60, 100%, 9%);--warning-text:hsl(46, 87%, 65%);--error-bg:hsl(358, 76%, 10%);--error-border:hsl(357, 89%, 16%);--error-text:hsl(358, 100%, 81%)}[data-sonner-toaster][data-sonner-theme=dark] [data-sonner-toast] [data-close-button]{background:var(--normal-bg);border-color:var(--normal-border);color:var(--normal-text)}[data-sonner-toaster][data-sonner-theme=dark] [data-sonner-toast] [data-close-button]:hover{background:var(--normal-bg-hover);border-color:var(--normal-border-hover)}[data-rich-colors=true][data-sonner-toast][data-type=success]{background:var(--success-bg);border-color:var(--success-border);color:var(--success-text)}[data-rich-colors=true][data-sonner-toast][data-type=success] [data-close-button]{background:var(--success-bg);border-color:var(--success-border);color:var(--success-text)}[data-rich-colors=true][data-sonner-toast][data-type=info]{background:var(--info-bg);border-color:var(--info-border);color:var(--info-text)}[data-rich-colors=true][data-sonner-toast][data-type=info] [data-close-button]{background:var(--info-bg);border-color:var(--info-border);color:var(--info-text)}[data-rich-colors=true][data-sonner-toast][data-type=warning]{background:var(--warning-bg);border-color:var(--warning-border);color:var(--warning-text)}[data-rich-colors=true][data-sonner-toast][data-type=warning] [data-close-button]{background:var(--warning-bg);border-color:var(--warning-border);color:var(--warning-text)}[data-rich-colors=true][data-sonner-toast][data-type=error]{background:var(--error-bg);border-color:var(--error-border);color:var(--error-text)}[data-rich-colors=true][data-sonner-toast][data-type=error] [data-close-button]{background:var(--error-bg);border-color:var(--error-border);color:var(--error-text)}.sonner-loading-wrapper{--size:16px;height:var(--size);width:var(--size);position:absolute;inset:0;z-index:10}.sonner-loading-wrapper[data-visible=false]{transform-origin:center;animation:sonner-fade-out .2s ease forwards}.sonner-spinner{position:relative;top:50%;left:50%;height:var(--size);width:var(--size)}.sonner-loading-bar{animation:sonner-spin 1.2s linear infinite;background:var(--gray11);border-radius:6px;height:8%;left:-10%;position:absolute;top:-3.9%;width:24%}.sonner-loading-bar:first-child{animation-delay:-1.2s;transform:rotate(.0001deg) translate(146%)}.sonner-loading-bar:nth-child(2){animation-delay:-1.1s;transform:rotate(30deg) translate(146%)}.sonner-loading-bar:nth-child(3){animation-delay:-1s;transform:rotate(60deg) translate(146%)}.sonner-loading-bar:nth-child(4){animation-delay:-.9s;transform:rotate(90deg) translate(146%)}.sonner-loading-bar:nth-child(5){animation-delay:-.8s;transform:rotate(120deg) translate(146%)}.sonner-loading-bar:nth-child(6){animation-delay:-.7s;transform:rotate(150deg) translate(146%)}.sonner-loading-bar:nth-child(7){animation-delay:-.6s;transform:rotate(180deg) translate(146%)}.sonner-loading-bar:nth-child(8){animation-delay:-.5s;transform:rotate(210deg) translate(146%)}.sonner-loading-bar:nth-child(9){animation-delay:-.4s;transform:rotate(240deg) translate(146%)}.sonner-loading-bar:nth-child(10){animation-delay:-.3s;transform:rotate(270deg) translate(146%)}.sonner-loading-bar:nth-child(11){animation-delay:-.2s;transform:rotate(300deg) translate(146%)}.sonner-loading-bar:nth-child(12){animation-delay:-.1s;transform:rotate(330deg) translate(146%)}@keyframes sonner-fade-in{0%{opacity:0;transform:scale(.8)}100%{opacity:1;transform:scale(1)}}@keyframes sonner-fade-out{0%{opacity:1;transform:scale(1)}100%{opacity:0;transform:scale(.8)}}@keyframes sonner-spin{0%{opacity:1}100%{opacity:.15}}@media (prefers-reduced-motion){.sonner-loading-bar,[data-sonner-toast],[data-sonner-toast]>*{transition:none!important;animation:none!important}}.sonner-loader{position:absolute;top:50%;left:50%;transform:translate(-50%,-50%);transform-origin:center;transition:opacity .2s,transform .2s}.sonner-loader[data-visible=false]{opacity:0;transform:scale(.8) translate(-50%,-50%)}");function Lm(e){return e.label!==void 0}const poe=3,moe="24px",goe="16px",n3=4e3,voe=356,yoe=14,_oe=45,woe=200;function no(...e){return e.filter(Boolean).join(" ")}function boe(e){const[t,n]=e.split("-"),r=[];return t&&r.push(t),n&&r.push(n),r}const xoe=e=>{var t,n,r,s,i,o,c,u,d;const{invert:f,toast:p,unstyled:m,interacting:v,setHeights:_,visibleToasts:w,heights:b,index:S,toasts:E,expanded:C,removeToast:A,defaultRichColors:T,closeButton:M,style:O,cancelButtonStyle:R,actionButtonStyle:D,className:U="",descriptionClassName:W="",duration:H,position:Y,gap:J,expandByDefault:V,classNames:q,icons:ee,closeButtonAriaLabel:F="Close toast"}=e,[X,B]=Ee.useState(null),[L,G]=Ee.useState(null),[ue,te]=Ee.useState(!1),[ie,he]=Ee.useState(!1),[ke,ge]=Ee.useState(!1),[pe,Ne]=Ee.useState(!1),[Re,$e]=Ee.useState(!1),[Et,dn]=Ee.useState(0),[an,kt]=Ee.useState(0),Gt=Ee.useRef(p.duration||H||n3),gn=Ee.useRef(null),Qt=Ee.useRef(null),Me=S===0,Xe=S+1<=w,Te=p.type,xt=Te??"default",xe=p.dismissible!==!1,$t=p.className||"",ft=p.descriptionClassName||"",gt=Ee.useMemo(()=>b.findIndex(st=>st.toastId===p.id)||0,[b,p.id]),Hn=Ee.useMemo(()=>{var st;return(st=p.closeButton)!=null?st:M},[p.closeButton,M]),Js=Ee.useMemo(()=>p.duration||H||n3,[p.duration,H]),_n=Ee.useRef(0),Gn=Ee.useRef(0),_i=Ee.useRef(0),rs=Ee.useRef(null),[Hr,Un]=Y.split("-"),fn=Ee.useMemo(()=>b.reduce((st,nn,Xt)=>Xt>=gt?st:st+nn.height,0),[b,gt]),Ur=ioe(),Jn=Ee.useMemo(()=>{var st;return(st=e.swipeDirections)!=null?st:boe(Y)},[e.swipeDirections,Y]),Ui=p.invert||f,Rr=Te==="loading";Gn.current=Ee.useMemo(()=>gt*J+fn,[gt,fn]),Ee.useEffect(()=>{Gt.current=Js},[Js]),Ee.useEffect(()=>{te(!0)},[]),Ee.useEffect(()=>{const st=Qt.current;if(st){const nn=st.getBoundingClientRect().height;return kt(nn),_(Xt=>[{toastId:p.id,height:nn,position:p.position},...Xt]),()=>_(Xt=>Xt.filter(hn=>hn.toastId!==p.id))}},[_,p.id]),Ee.useLayoutEffect(()=>{if(!ue)return;const st=Qt.current,nn=st.style.height;st.style.height="auto";const Xt=st.getBoundingClientRect().height;st.style.height=nn,kt(Xt),_(hn=>hn.find(Bt=>Bt.toastId===p.id)?hn.map(Bt=>Bt.toastId===p.id?{...Bt,height:Xt}:Bt):[{toastId:p.id,height:Xt,position:p.position},...hn])},[ue,p.title,p.description,_,p.id,p.jsx,p.action,p.cancel]);const Zn=Ee.useCallback(()=>{he(!0),dn(Gn.current),_(st=>st.filter(nn=>nn.toastId!==p.id)),setTimeout(()=>{A(p)},woe)},[p,A,_,Gn]);Ee.useEffect(()=>{if(p.promise&&Te==="loading"||p.duration===1/0||p.type==="loading")return;let st;return C||v||Ur?(()=>{if(_i.current<_n.current){const hn=new Date().getTime()-_n.current;Gt.current=Gt.current-hn}_i.current=new Date().getTime()})():(()=>{Gt.current!==1/0&&(_n.current=new Date().getTime(),st=setTimeout(()=>{p.onAutoClose==null||p.onAutoClose.call(p,p),Zn()},Gt.current))})(),()=>clearTimeout(st)},[C,v,p,Te,Ur,Zn]),Ee.useEffect(()=>{p.delete&&(Zn(),p.onDismiss==null||p.onDismiss.call(p,p))},[Zn,p.delete]);function _r(){var st;if(ee!=null&&ee.loading){var nn;return Ee.createElement("div",{className:no(q==null?void 0:q.loader,p==null||(nn=p.classNames)==null?void 0:nn.loader,"sonner-loader"),"data-visible":Te==="loading"},ee.loading)}return Ee.createElement(Jie,{className:no(q==null?void 0:q.loader,p==null||(st=p.classNames)==null?void 0:st.loader),visible:Te==="loading"})}const $s=p.icon||(ee==null?void 0:ee[Te])||Qie(Te);var qn,ss;return Ee.createElement("li",{tabIndex:0,ref:Qt,className:no(U,$t,q==null?void 0:q.toast,p==null||(t=p.classNames)==null?void 0:t.toast,q==null?void 0:q[xt],p==null||(n=p.classNames)==null?void 0:n[xt]),"data-sonner-toast":"","data-rich-colors":(qn=p.richColors)!=null?qn:T,"data-styled":!(p.jsx||p.unstyled||m),"data-mounted":ue,"data-promise":!!p.promise,"data-swiped":Re,"data-removed":ie,"data-visible":Xe,"data-y-position":Hr,"data-x-position":Un,"data-index":S,"data-front":Me,"data-swiping":ke,"data-dismissible":xe,"data-type":Te,"data-invert":Ui,"data-swipe-out":pe,"data-swipe-direction":L,"data-expanded":!!(C||V&&ue),"data-testid":p.testId,style:{"--index":S,"--toasts-before":S,"--z-index":E.length-S,"--offset":`${ie?Et:Gn.current}px`,"--initial-height":V?"auto":`${an}px`,...O,...p.style},onDragEnd:()=>{ge(!1),B(null),rs.current=null},onPointerDown:st=>{st.button!==2&&(Rr||!xe||(gn.current=new Date,dn(Gn.current),st.target.setPointerCapture(st.pointerId),st.target.tagName!=="BUTTON"&&(ge(!0),rs.current={x:st.clientX,y:st.clientY})))},onPointerUp:()=>{var st,nn,Xt;if(pe||!xe)return;rs.current=null;const hn=Number(((st=Qt.current)==null?void 0:st.style.getPropertyValue("--swipe-amount-x").replace("px",""))||0),wn=Number(((nn=Qt.current)==null?void 0:nn.style.getPropertyValue("--swipe-amount-y").replace("px",""))||0),Bt=new Date().getTime()-((Xt=gn.current)==null?void 0:Xt.getTime()),Tn=X==="x"?hn:wn,Zr=Math.abs(Tn)/Bt;if((X==="x"?Jn.includes(hn>0?"right":"left"):Jn.includes(wn>0?"bottom":"top"))&&(Math.abs(Tn)>=_oe||Zr>.11)){dn(Gn.current),p.onDismiss==null||p.onDismiss.call(p,p),G(X==="x"?hn>0?"right":"left":wn>0?"down":"up"),Zn(),Ne(!0);return}else{var ur,Vt;(ur=Qt.current)==null||ur.style.setProperty("--swipe-amount-x","0px"),(Vt=Qt.current)==null||Vt.style.setProperty("--swipe-amount-y","0px")}$e(!1),ge(!1),B(null)},onPointerMove:st=>{var nn,Xt,hn;if(!rs.current||!xe||((nn=window.getSelection())==null?void 0:nn.toString().length)>0)return;const Bt=st.clientY-rs.current.y,Tn=st.clientX-rs.current.x;!X&&(Math.abs(Tn)>1||Math.abs(Bt)>1)&&B(Math.abs(Tn)>Math.abs(Bt)?"x":"y");let Zr={x:0,y:0};const Bn=ur=>1/(1.5+Math.abs(ur)/20);if(X==="y"){if(Jn.includes("top")||Jn.includes("bottom"))if(Jn.includes("top")&&Bt<0||Jn.includes("bottom")&&Bt>0)Zr.y=Bt;else{const ur=Bt*Bn(Bt);Zr.y=Math.abs(ur)<Math.abs(Bt)?ur:Bt}}else if(X==="x"&&(Jn.includes("left")||Jn.includes("right")))if(Jn.includes("left")&&Tn<0||Jn.includes("right")&&Tn>0)Zr.x=Tn;else{const ur=Tn*Bn(Tn);Zr.x=Math.abs(ur)<Math.abs(Tn)?ur:Tn}(Math.abs(Zr.x)>0||Math.abs(Zr.y)>0)&&$e(!0),(Xt=Qt.current)==null||Xt.style.setProperty("--swipe-amount-x",`${Zr.x}px`),(hn=Qt.current)==null||hn.style.setProperty("--swipe-amount-y",`${Zr.y}px`)}},Hn&&!p.jsx&&Te!=="loading"?Ee.createElement("button",{"aria-label":F,"data-disabled":Rr,"data-close-button":!0,onClick:Rr||!xe?()=>{}:()=>{Zn(),p.onDismiss==null||p.onDismiss.call(p,p)},className:no(q==null?void 0:q.closeButton,p==null||(r=p.classNames)==null?void 0:r.closeButton)},(ss=ee==null?void 0:ee.close)!=null?ss:soe):null,(Te||p.icon||p.promise)&&p.icon!==null&&((ee==null?void 0:ee[Te])!==null||p.icon)?Ee.createElement("div",{"data-icon":"",className:no(q==null?void 0:q.icon,p==null||(s=p.classNames)==null?void 0:s.icon)},Te==="loading"?p.icon||_r():p.promise?_r():null,Te!=="loading"?$s:null):null,Ee.createElement("div",{"data-content":"",className:no(q==null?void 0:q.content,p==null||(i=p.classNames)==null?void 0:i.content)},Ee.createElement("div",{"data-title":"",className:no(q==null?void 0:q.title,p==null||(o=p.classNames)==null?void 0:o.title)},p.jsx?p.jsx:typeof p.title=="function"?p.title():p.title),p.description?Ee.createElement("div",{"data-description":"",className:no(W,ft,q==null?void 0:q.description,p==null||(c=p.classNames)==null?void 0:c.description)},typeof p.description=="function"?p.description():p.description):null),Ee.isValidElement(p.cancel)?p.cancel:p.cancel&&Lm(p.cancel)?Ee.createElement("button",{"data-button":!0,"data-cancel":!0,style:p.cancelButtonStyle||R,onClick:st=>{Lm(p.cancel)&&xe&&(p.cancel.onClick==null||p.cancel.onClick.call(p.cancel,st),Zn())},className:no(q==null?void 0:q.cancelButton,p==null||(u=p.classNames)==null?void 0:u.cancelButton)},p.cancel.label):null,Ee.isValidElement(p.action)?p.action:p.action&&Lm(p.action)?Ee.createElement("button",{"data-button":!0,"data-action":!0,style:p.actionButtonStyle||D,onClick:st=>{Lm(p.action)&&(p.action.onClick==null||p.action.onClick.call(p.action,st),!st.defaultPrevented&&Zn())},className:no(q==null?void 0:q.actionButton,p==null||(d=p.classNames)==null?void 0:d.actionButton)},p.action.label):null)};function r3(){if(typeof window>"u"||typeof document>"u")return"ltr";const e=document.documentElement.getAttribute("dir");return e==="auto"||!e?window.getComputedStyle(document.documentElement).direction:e}function Soe(e,t){const n={};return[e,t].forEach((r,s)=>{const i=s===1,o=i?"--mobile-offset":"--offset",c=i?goe:moe;function u(d){["top","right","bottom","left"].forEach(f=>{n[`${o}-${f}`]=typeof d=="number"?`${d}px`:d})}typeof r=="number"||typeof r=="string"?u(r):typeof r=="object"?["top","right","bottom","left"].forEach(d=>{r[d]===void 0?n[`${o}-${d}`]=c:n[`${o}-${d}`]=typeof r[d]=="number"?`${r[d]}px`:r[d]}):u(c)}),n}const Eoe=Ee.forwardRef(function(t,n){const{id:r,invert:s,position:i="bottom-right",hotkey:o=["altKey","KeyT"],expand:c,closeButton:u,className:d,offset:f,mobileOffset:p,theme:m="light",richColors:v,duration:_,style:w,visibleToasts:b=poe,toastOptions:S,dir:E=r3(),gap:C=yoe,icons:A,customAriaLabel:T,containerAriaLabel:M="Notifications"}=t,[O,R]=Ee.useState([]),D=Ee.useMemo(()=>r?O.filter(te=>te.toasterId===r):O.filter(te=>!te.toasterId),[O,r]),U=Ee.useMemo(()=>Array.from(new Set([i].concat(D.filter(te=>te.position).map(te=>te.position)))),[D,i]),[W,H]=Ee.useState([]),[Y,J]=Ee.useState(!1),[V,q]=Ee.useState(!1),[ee,F]=Ee.useState(m!=="system"?m:typeof window<"u"&&window.matchMedia&&window.matchMedia("(prefers-color-scheme: dark)").matches?"dark":"light"),X=Ee.useRef(null),B=o.join("+").replace(/Key/g,"").replace(/Digit/g,""),L=Ee.useRef(null),G=Ee.useRef(!1),ue=Ee.useCallback(te=>{R(ie=>{var he;return(he=ie.find(ke=>ke.id===te.id))!=null&&he.delete||ks.dismiss(te.id),ie.filter(({id:ke})=>ke!==te.id)})},[]);return Ee.useEffect(()=>ks.subscribe(te=>{if(te.dismiss){requestAnimationFrame(()=>{R(ie=>ie.map(he=>he.id===te.id?{...he,delete:!0}:he))});return}setTimeout(()=>{pne.flushSync(()=>{R(ie=>{const he=ie.findIndex(ke=>ke.id===te.id);return he!==-1?[...ie.slice(0,he),{...ie[he],...te},...ie.slice(he+1)]:[te,...ie]})})})}),[]),Ee.useEffect(()=>{if(m!=="system"){F(m);return}if(m==="system"&&(window.matchMedia&&window.matchMedia("(prefers-color-scheme: dark)").matches?F("dark"):F("light")),typeof window>"u")return;const te=window.matchMedia("(prefers-color-scheme: dark)");try{te.addEventListener("change",({matches:ie})=>{F(ie?"dark":"light")})}catch{te.addListener(({matches:he})=>{try{F(he?"dark":"light")}catch(ke){console.error(ke)}})}},[m]),Ee.useEffect(()=>{O.length<=1&&J(!1)},[O]),Ee.useEffect(()=>{const te=ie=>{var he;if(o.length>0&&o.every(pe=>ie[pe]||ie.code===pe)){var ge;J(!0),(ge=X.current)==null||ge.focus()}ie.code==="Escape"&&(document.activeElement===X.current||(he=X.current)!=null&&he.contains(document.activeElement))&&J(!1)};return document.addEventListener("keydown",te),()=>document.removeEventListener("keydown",te)},[o]),Ee.useEffect(()=>{if(X.current)return()=>{L.current&&(L.current.focus({preventScroll:!0}),L.current=null,G.current=!1)}},[X.current]),Ee.createElement("section",{ref:n,"aria-label":T??`${M} ${B}`,tabIndex:-1,"aria-live":"polite","aria-relevant":"additions text","aria-atomic":"false",suppressHydrationWarning:!0,"data-react-aria-top-layer":!0},U.map((te,ie)=>{var he;const[ke,ge]=te.split("-");return D.length?Ee.createElement("ol",{key:te,dir:E==="auto"?r3():E,tabIndex:-1,ref:X,className:d,"data-sonner-toaster":!0,"data-sonner-theme":ee,"data-y-position":ke,"data-x-position":ge,style:{"--front-toast-height":`${((he=W[0])==null?void 0:he.height)||0}px`,"--width":`${voe}px`,"--gap":`${C}px`,...w,...Soe(f,p)},onBlur:pe=>{G.current&&!pe.currentTarget.contains(pe.relatedTarget)&&(G.current=!1,L.current&&(L.current.focus({preventScroll:!0}),L.current=null))},onFocus:pe=>{pe.target instanceof HTMLElement&&pe.target.dataset.dismissible==="false"||G.current||(G.current=!0,L.current=pe.relatedTarget)},onMouseEnter:()=>J(!0),onMouseMove:()=>J(!0),onMouseLeave:()=>{V||J(!1)},onDragEnd:()=>J(!1),onPointerDown:pe=>{pe.target instanceof HTMLElement&&pe.target.dataset.dismissible==="false"||q(!0)},onPointerUp:()=>q(!1)},D.filter(pe=>!pe.position&&ie===0||pe.position===te).map((pe,Ne)=>{var Re,$e;return Ee.createElement(xoe,{key:pe.id,icons:A,index:Ne,toast:pe,defaultRichColors:v,duration:(Re=S==null?void 0:S.duration)!=null?Re:_,className:S==null?void 0:S.className,descriptionClassName:S==null?void 0:S.descriptionClassName,invert:s,visibleToasts:b,closeButton:($e=S==null?void 0:S.closeButton)!=null?$e:u,interacting:V,position:te,style:S==null?void 0:S.style,unstyled:S==null?void 0:S.unstyled,classNames:S==null?void 0:S.classNames,cancelButtonStyle:S==null?void 0:S.cancelButtonStyle,actionButtonStyle:S==null?void 0:S.actionButtonStyle,closeButtonAriaLabel:S==null?void 0:S.closeButtonAriaLabel,removeToast:ue,toasts:D.filter(Et=>Et.position==pe.position),heights:W.filter(Et=>Et.position==pe.position),setHeights:H,expandByDefault:c,gap:C,expanded:Y,swipeDirections:t.swipeDirections})})):null}))}),koe="data-hover-dead-zone";function Coe(e,t={}){const{axis:n="y",snapTolerancePx:r=1/0}=t,s=g.useRef(new Map),[i,o]=g.useState(null),[c,u]=g.useState([]),d=g.useRef([]),f=g.useRef(0),p=g.useRef(null),m=g.useRef(null),v=g.useCallback(()=>{const C=[];return s.current.forEach((A,T)=>{C[T]={top:A.offsetTop,height:A.offsetHeight,left:A.offsetLeft,width:A.offsetWidth}}),C},[]),_=g.useCallback(()=>{if(!e.current)return;const A=v();d.current=A,u(A)},[e,v]),w=g.useCallback((C,A)=>{A?s.current.set(C,A):s.current.delete(C),m.current!==null&&cancelAnimationFrame(m.current),m.current=requestAnimationFrame(()=>{m.current=null,_()})},[_]),b=g.useCallback(C=>{const A=C.clientX,T=C.clientY,M=C.target instanceof Element&&C.target.closest(`[${koe}]`)!==null;p.current!==null&&cancelAnimationFrame(p.current),p.current=requestAnimationFrame(()=>{p.current=null;const O=e.current;if(!O)return;if(M){o(null);return}const R=v(),D=d.current;(R.length!==D.length||R.some((ue,te)=>{const ie=D[te];return!ie||!ue||ue.top!==ie.top||ue.height!==ie.height||ue.left!==ie.left||ue.width!==ie.width}))&&(d.current=R,u(R));const W=O.getBoundingClientRect(),H=n==="x"?A:T;let Y=null,J=1/0,V=null;const q=d.current,ee=n==="x"?O.scrollLeft:O.scrollTop,F=n==="x"?O.clientLeft:O.clientTop,X=n==="x"?W.left:W.top,B=n==="x"?O.offsetWidth:O.offsetHeight,L=n==="x"?W.width:W.height,G=B>0?L/B:1;for(let ue=0;ue<q.length;ue++){const te=q[ue];if(!te)continue;const ie=n==="x"?te.left:te.top,he=X+(F+ie-ee)*G,ke=(n==="x"?te.width:te.height)*G,ge=he+ke;H>=he&&H<=ge&&(V=ue);let pe=0;H<he?pe=he-H:H>ge&&(pe=H-ge),pe<J&&(J=pe,Y=ue)}o(V??(J<=r?Y:null))})},[n,e,r,v]),S=g.useCallback(()=>{f.current+=1,_()},[_]),E=g.useCallback(()=>{p.current!==null&&(cancelAnimationFrame(p.current),p.current=null),o(null)},[]);return g.useEffect(()=>()=>{p.current!==null&&cancelAnimationFrame(p.current),m.current!==null&&cancelAnimationFrame(m.current)},[]),{activeIndex:i,setActiveIndex:o,itemRects:c,sessionRef:f,handlers:{onMouseMove:b,onMouseEnter:S,onMouseLeave:E},registerItem:w,measureItems:_}}function Poe(e,t,n){g.useEffect(()=>(e(t,n.current),()=>e(t,null)),[t,e,n])}const L4=({queryKey:e,data:t})=>{const n=kd(),[r,s]=g.useState(null),i=r!==null&&r.base===t?r.value:t,o=Nh({queryKey:e,data:t,visible:i}),c=g.useCallback(u=>{const d=o.current,f=u(n.getQueryData(d.queryKey)??d.visible);return n.setQueryData(d.queryKey,f),o.current={...d,visible:f},s({base:d.data,value:f}),f},[n,o]);return{data:i,updateData:c}},L2=["project-library"],s3=[...L2,"history"],i3=["library-project-preview"],o3=["variants-history"],a3=["design-library"],l3=["design-reference-search"],yr={rivetConfig:["rivet-config"],featureFlags:["rivet-feature-flags"],account:["rivet-account"],serverConfig:["server-config"],integrations:["integrations"],referenceProfile:["reference-profile"],referenceDiscovery:e=>["reference-discovery",e],designLibraryAll:a3,designReferenceSearchAll:l3,previewUpstreamHealth:e=>["preview-upstream-health",e],variantsUiState:e=>["variants-ui-state",e],variantsHistory:{all:o3,list:e=>[...o3,e]},designLibrary:(e,t)=>[...a3,e,t],designReferenceSearch:({profileId:e,revision:t,references:n,search:r,sourceId:s})=>[...l3,e,t,n,r,s],designLibraryImage:({profileId:e,referenceId:t,hash:n})=>["design-library-image",e,t,n],projectLibrary:{all:L2,projects:[...L2,"projects"],histories:s3,history:e=>[...s3,e]},libraryProjectPreview:{project:e=>[...i3,e],thumbnail:(e,t)=>[...i3,e,t]},libraryWorkspace:e=>["library-workspace",e],libraryPreview:({projectId:e,sessionId:t,variantId:n})=>["library-preview",e,t,n]};var f0={exports:{}},Aoe=f0.exports,c3;function Toe(){return c3||(c3=1,(function(e){(function(t,n){e.exports?e.exports=n():t.log=n()})(Aoe,function(){var t=function(){},n="undefined",r=typeof window!==n&&typeof window.navigator!==n&&/Trident\/|MSIE /.test(window.navigator.userAgent),s=["trace","debug","info","warn","error"],i={},o=null;function c(w,b){var S=w[b];if(typeof S.bind=="function")return S.bind(w);try{return Function.prototype.bind.call(S,w)}catch{return function(){return Function.prototype.apply.apply(S,[w,arguments])}}}function u(){console.log&&(console.log.apply?console.log.apply(console,arguments):Function.prototype.apply.apply(console.log,[console,arguments])),console.trace&&console.trace()}function d(w){return w==="debug"&&(w="log"),typeof console===n?!1:w==="trace"&&r?u:console[w]!==void 0?c(console,w):console.log!==void 0?c(console,"log"):t}function f(){for(var w=this.getLevel(),b=0;b<s.length;b++){var S=s[b];this[S]=b<w?t:this.methodFactory(S,w,this.name)}if(this.log=this.debug,typeof console===n&&w<this.levels.SILENT)return"No console available for logging"}function p(w){return function(){typeof console!==n&&(f.call(this),this[w].apply(this,arguments))}}function m(w,b,S){return d(w)||p.apply(this,arguments)}function v(w,b){var S=this,E,C,A,T="loglevel";typeof w=="string"?T+=":"+w:typeof w=="symbol"&&(T=void 0);function M(W){var H=(s[W]||"silent").toUpperCase();if(!(typeof window===n||!T)){try{window.localStorage[T]=H;return}catch{}try{window.document.cookie=encodeURIComponent(T)+"="+H+";"}catch{}}}function O(){var W;if(!(typeof window===n||!T)){try{W=window.localStorage[T]}catch{}if(typeof W===n)try{var H=window.document.cookie,Y=encodeURIComponent(T),J=H.indexOf(Y+"=");J!==-1&&(W=/^([^;]+)/.exec(H.slice(J+Y.length+1))[1])}catch{}return S.levels[W]===void 0&&(W=void 0),W}}function R(){if(!(typeof window===n||!T)){try{window.localStorage.removeItem(T)}catch{}try{window.document.cookie=encodeURIComponent(T)+"=; expires=Thu, 01 Jan 1970 00:00:00 UTC"}catch{}}}function D(W){var H=W;if(typeof H=="string"&&S.levels[H.toUpperCase()]!==void 0&&(H=S.levels[H.toUpperCase()]),typeof H=="number"&&H>=0&&H<=S.levels.SILENT)return H;throw new TypeError("log.setLevel() called with invalid level: "+W)}S.name=w,S.levels={TRACE:0,DEBUG:1,INFO:2,WARN:3,ERROR:4,SILENT:5},S.methodFactory=b||m,S.getLevel=function(){return A??C??E},S.setLevel=function(W,H){return A=D(W),H!==!1&&M(A),f.call(S)},S.setDefaultLevel=function(W){C=D(W),O()||S.setLevel(W,!1)},S.resetLevel=function(){A=null,R(),f.call(S)},S.enableAll=function(W){S.setLevel(S.levels.TRACE,W)},S.disableAll=function(W){S.setLevel(S.levels.SILENT,W)},S.rebuild=function(){if(o!==S&&(E=D(o.getLevel())),f.call(S),o===S)for(var W in i)i[W].rebuild()},E=D(o?o.getLevel():"WARN");var U=O();U!=null&&(A=D(U)),f.call(S)}o=new v,o.getLogger=function(b){if(typeof b!="symbol"&&typeof b!="string"||b==="")throw new TypeError("You must supply a name when creating a logger.");var S=i[b];return S||(S=i[b]=new v(b,o.methodFactory)),S};var _=typeof window!==n?window.log:void 0;return o.noConflict=function(){return typeof window!==n&&window.log===o&&(window.log=_),o},o.getLoggers=function(){return i},o.default=o,o})})(f0)),f0.exports}var Roe=Toe();const Mi=Sg(Roe),Ioe="INFO",Ooe=Ioe.toUpperCase();Mi.setLevel(Mi.levels[Ooe]||Mi.levels.INFO);const Ls=e=>{const t=e?`[${e}] `:"";return{trace:(n,...r)=>Mi.trace(`${t}${n}`,...r),debug:(n,...r)=>Mi.debug(`${t}${n}`,...r),info:(n,...r)=>Mi.info(`${t}${n}`,...r),warn:(n,...r)=>Mi.warn(`${t}${n}`,...r),error:(n,...r)=>{Mi.error(`${t}${n}`,...r);try{const i=r.map(c=>ts(c)).join(" ").slice(0,512),o={source:"ui",error_message:n,service:e??"unknown",error_type:"logged_error",url:window.location.pathname,error_args_count:r.length,...i?{error_detail:i}:{}};Qe.capture("logger_error",o)}catch(s){console.error("[logger] Failed to send logger_error to PostHog:",s)}},api:(n,...r)=>Mi.info(`${t}API: ${n}`,...r),hook:(n,...r)=>Mi.debug(`${t}Hook: ${n}`,...r),mount:(n,...r)=>Mi.debug(`${t}Mount: ${n}`,...r)}},Moe=Ls("useVariantsHistory"),u3=[],Noe=(e,t)=>e.length===t.length&&e.every((n,r)=>{var i,o;const s=t[r];return n.sessionId===s.sessionId&&n.variantId===s.variantId&&n.requestId===s.requestId&&n.label===s.label&&n.brief===s.brief&&JSON.stringify(n.references)===JSON.stringify(s.references)&&n.runLabel===s.runLabel&&n.createdAt===s.createdAt&&((i=n.serve)==null?void 0:i.kind)===((o=s.serve)==null?void 0:o.kind)&&n.hasTree===s.hasTree}),Loe=({historyQuery:e,snapshotKey:t,isEnabled:n,isListed:r,onLoaded:s})=>{const i=yr.variantsHistory.list({historyQuery:e,snapshotKey:t}),o=Nh(s),c=Vi({queryKey:i,queryFn:async({signal:v})=>{let _;try{const b=await Dt(`/api/variants/history${e}`,{credentials:"same-origin",signal:v});if(!b.ok)return p.current;_=((await b.json()).variants??[]).filter(r)}catch(b){return v.aborted||Moe.warn("Failed to load past variants",b),p.current}if(v.aborted)return p.current;o.current(_);const w=p.current;return Noe(w,_)?w:_},enabled:n,placeholderData:zK,gcTime:0,retry:!1,refetchOnWindowFocus:!1,refetchOnReconnect:!1,networkMode:"always"}),{data:u,updateData:d}=L4({queryKey:i,data:c.data}),f=u??u3,p=Nh(f),m=g.useCallback(v=>{d(_=>v(_??u3))},[d]);return{pastVariants:f,setPastVariants:m}},d3=Ls("useVariantsUiState"),$oe={groups:[],rows:{}},h0={pinned:[],order:$oe},Vf="pinned",Doe="top",p_=e=>`rows:${e}`,m_=e=>({projectPath:e,mutations:[],preview:h0}),Foe=(e,t)=>t.reduce((n,r)=>r(n),e),$4=e=>e?`/api/variants/ui-state?projectPath=${encodeURIComponent(e)}`:"/api/variants/ui-state",joe=async e=>{const t=await Dt($4(e));if(!t.ok)throw new Error(`Failed to load variants UI state (${t.status})`);return xK.parse(await t.json()).uiState},zoe=async({projectPath:e,uiState:t})=>{await Dt($4(e),{method:"PUT",headers:{"Content-Type":"application/json"},body:JSON.stringify({uiState:t})})},f3=e=>t=>t.pinned.includes(e)?t:{...t,pinned:[...t.pinned,e]},Voe=e=>t=>({...t,pinned:t.pinned.filter(n=>n!==e)}),Hoe=(e,t)=>n=>{if(e===Vf){const r=new Set(t);return{...n,pinned:[...t,...n.pinned.filter(s=>!r.has(s))]}}return e===Doe?{...n,order:{...n.order,groups:t}}:{...n,order:{...n.order,rows:{...n.order.rows,[e.slice(5)]:t}}}},Uoe=e=>{const t=kd(),n=yr.variantsUiState(e),[r,s]=g.useState(()=>m_(e)),i=g.useRef(r),o=g.useCallback(A=>{i.current=A,s(A)},[]),c=g.useCallback(A=>i.current.projectPath===A?i.current:m_(A),[]),{mutate:u}=Ng({mutationFn:zoe,onError:A=>{d3.warn("persist failed — arrangement kept for this session only",A)}}),d=Vi({queryKey:n,queryFn:async()=>{let A;try{A=await joe(e)}catch(O){throw d3.warn("load failed — arrangement is session-local until reload",O),O}const{mutations:T}=c(e);if(T.length===0)return A;o(m_(e));const M=Foe(A,T);return e&&u({projectPath:e,uiState:M}),M},enabled:e!==null,gcTime:0,retry:!1,refetchOnWindowFocus:!1,refetchOnReconnect:!1,networkMode:"always"}),{data:f,updateData:p}=L4({queryKey:n,data:d.isSuccess?d.data:void 0}),m=g.useCallback(()=>{var A;return e!==null&&((A=t.getQueryState(yr.variantsUiState(e)))==null?void 0:A.status)==="success"},[e,t]),v=g.useCallback(()=>m()?t.getQueryData(yr.variantsUiState(e))??h0:c(e).preview,[m,e,t,c]),_=g.useCallback(A=>{if(e!==null&&m()){const M=p(O=>A(O??h0));u({projectPath:e,uiState:M});return}const T=c(e);o({projectPath:e,mutations:[...T.mutations,A],preview:A(T.preview)})},[m,u,e,c,o,p]),w=g.useCallback(A=>{const T=!v().pinned.includes(A);_(T?f3(A):Voe(A))},[_,v]),b=g.useCallback(A=>{v().pinned.includes(A)||_(f3(A))},[_,v]),S=g.useCallback((A,T)=>{_(Hoe(A,T))},[_]);let E=h0;f?E=f:r.projectPath===e&&(E=r.preview);const C=g.useMemo(()=>new Set(E.pinned),[E.pinned]);return{pinnedKeys:E.pinned,pinnedKeySet:C,listOrder:E.order,togglePin:w,pinItem:b,reorder:S}},Zoe=e=>{const{containerRef:t,dragged:n,yieldToSelector:r,restrictToSelector:s,onReorder:i}=e,[o,c]=g.useState(null),u=g.useCallback(p=>{const m=t.current;return m?Array.from(m.querySelectorAll(`[data-reorder-container="${CSS.escape(p)}"]`)):[]},[t]),d=g.useCallback(p=>{if(!n){o&&c(null);return}const m=t.current;if(!m)return;if(r){const S=m.querySelector(r);if(S){const E=S.getBoundingClientRect();if(p.clientY>=E.top&&p.clientY<=E.bottom){o&&c(null);return}}}if(s){const S=m.querySelector(s),E=S==null?void 0:S.getBoundingClientRect();if(!E||p.clientY<E.top||p.clientY>E.bottom){o&&c(null);return}}const v=u(n.container);if(v.length===0){o&&c(null);return}const _=m.getBoundingClientRect().top;let w=v.length;for(let S=0;S<v.length;S++){const E=v[S].getBoundingClientRect();if(p.clientY<E.top+E.height/2){w=S;break}}let b;w===0?b=v[0].getBoundingClientRect().top-_-1:w===v.length?b=v[v.length-1].getBoundingClientRect().bottom-_:b=(v[w-1].getBoundingClientRect().bottom+v[w].getBoundingClientRect().top)/2-_,(!o||o.index!==w||o.container!==n.container)&&c({container:n.container,index:w,top:b})},[t,n,o,u,r,s]),f=g.useCallback(()=>{if(!n||!o)return;c(null);const p=u(o.container).map(_=>_.dataset.reorderKey).filter(_=>!!_),m=p.indexOf(n.key);if(m===-1)return;p.splice(m,1);const v=o.index>m?o.index-1:o.index;p.splice(v,0,n.key),i(o.container,p)},[n,o,u,i]);return{dropTarget:o,onPointerMove:d,onPointerUp:f}},g_="rivet_launch_runtime",D4=()=>{if(typeof window>"u")return{runtime:null,isCaptured:!1};const t=new URLSearchParams(window.location.search).get("runtime");let n=null;try{if(t!==null){const s=oa.safeParse(t);s.success?window.sessionStorage.setItem(g_,s.data):window.sessionStorage.setItem(g_,"unknown")}else n=window.sessionStorage.getItem(g_)}catch{n=null}const r=oa.safeParse(t??n);return{runtime:r.success?r.data:null,isCaptured:t!==null||n!==null}},Boe=()=>D4().runtime,Woe={resize:{default:!1},variants:{default:!1},designSystemEditor:{default:!1},branchDiff:{default:!1},gitUi:{default:!0},createProject:{default:!1},share:{default:!1},deployPrototype:{default:!1},canvasShare:{default:!1},generativeControls:{default:!1},refineMode:{default:!1},inspectorUndoRedo:{default:!1}},F4=Object.fromEntries(Object.entries(Woe).map(([e,t])=>[e,{isEnabled:t.default}])),j4=on(!0),z4=on(null),V4=on(0),Koe=on({name:null,email:null}),$2=on(0),vg=on(null),D2=on(!1),F2=on(null),H4=on(!1),U4=on(!1),p0=on(null),m0=on(null),gd=on(null),sS=on(null),vl=on(null),Z4=on(!1),Qh=on({active:!1}),B4=on([]),j2=on(F4),Goe=on(!1),rv=on(null),qoe=on(null),sv=on(!0),Yoe=on(!1),W4=on(!1),iv=on(Boe()),Qoe=on(D4),Xoe=()=>{var e;return typeof window>"u"?null:((e=window.__RIVET_BOOTSTRAP__)==null?void 0:e.agentApplyMode)??null},ov=on(Xoe()),Joe=on(null);function eae(e){return e==="cursor"?"Cursor":e==="codex"?"Codex":e==="claude-desktop"?"Claude":"Claude Code"}const tae=e=>{var t;return[e.label.trim(),(t=e.description)==null?void 0:t.trim()].filter(n=>!!n).join(`
|
|
170
|
+
`)},K4=async({text:e,copyKind:t})=>{const n=e.trim();if(n)try{await navigator.clipboard.writeText(n),Qe.capture("variants_panel.copy_completed",{outcome:"success",copyKind:t}),rn.success("Copied")}catch(r){Qe.capture("variants_panel.copy_failed",{outcome:"failure",copyKind:t,errorName:r instanceof Error?r.name:"UnknownError"}),rn.error("Couldn't copy")}},nae=["⡡⠊⢔⠡","⠊⡰⡡⡘","⢔⢅⠈⢢","⡁⢂⠆⡍","⢔⠨⢑⢐","⠨⡑⡠⠊"],G4=({className:e,"data-testid":t}={})=>P.jsx("div",{className:`rivet-sparkle relative overflow-hidden font-mono leading-none ${e??"text-base text-primary"}`,style:{height:"1em",width:"4ch"},"aria-hidden":"true","data-testid":t,children:P.jsx("div",{className:"rivet-sparkle-strip",children:nae.map((n,r)=>P.jsx("span",{className:"block",style:{height:"1em",lineHeight:"1em"},children:n},r))})}),yg=({className:e=""})=>P.jsx("span",{"aria-hidden":"true",className:`rivet-skeleton block rounded ${e}`.trim()}),rae=({entry:e,deploying:t,deployedUrl:n,onDeploy:r,isDeployDisabled:s=!1})=>{const o=t?"Deploying…":n?"Copy link":"Share";return P.jsxs("div",{className:"border-surface-2 bg-card flex shrink-0 items-center justify-between gap-3 border-t px-3 py-4",children:[P.jsxs("div",{className:"min-w-0",children:[P.jsx("div",{className:"text-foreground truncate text-sm font-medium",children:e.label.trim()||"Untitled direction"}),n?P.jsx("div",{className:"text-soft-foreground text-[11px]",children:"Deployed — share link ready"}):null]}),P.jsxs("button",{type:"button",onClick:()=>r(e),disabled:t||s,title:n?`Copy share link (${n})`:"Deploy this direction and get a public link to share",className:"border-surface-2 text-foreground hover:bg-muted flex shrink-0 items-center gap-1 rounded-md border px-2 py-1.5 text-xs font-medium transition-colors disabled:cursor-not-allowed disabled:opacity-50",children:[n&&!t?P.jsx(Ah,{size:12,weight:"bold"}):null,o]})]})},sae=({primaryLabel:e,primaryIcon:t,primaryAction:n,isDisabled:r=!1,isDropdownDisabled:s=!1,isLoading:i=!1,loadingLabel:o,dropdownAriaLabel:c="More actions",dropdownItems:u})=>{const[d,f]=g.useState(!1),p=i?o??e:e,m=u.length>0;return P.jsxs("div",{className:"flex items-stretch",children:[P.jsxs("button",{onClick:n,disabled:r||i,className:`bg-selected hover:bg-muted focus-visible:bg-muted flex h-7 shrink-0 items-center gap-1.5 px-3 text-xs font-medium text-white focus-visible:outline-hidden transition-colors disabled:cursor-not-allowed disabled:opacity-50 ${m?"rounded-l-md":"rounded-md"}`,children:[t?P.jsx(t,{className:"h-3.5 w-3.5",weight:"bold"}):null,p]}),m?P.jsxs(nS,{isOpen:d,onOpenChange:f,children:[P.jsx(nv,{asChild:!0,children:P.jsx("button",{"aria-label":c,disabled:s||i,title:c,className:"bg-selected hover:bg-muted focus-visible:bg-muted h-7 shrink-0 rounded-r-md border-l border-white/20 px-1.5 text-white focus-visible:outline-hidden transition-colors disabled:cursor-not-allowed disabled:opacity-50",children:P.jsx(Zee,{className:"h-3.5 w-3.5",weight:"bold"})})}),P.jsx(rS,{align:"end",children:u.map(v=>{const _=v.icon;return P.jsxs(Va,{onSelect:v.onClick,disabled:v.isDisabled,children:[_?P.jsx(_,{className:"h-3.5 w-3.5",weight:"bold"}):null,v.label]},v.label)})})]}):null]})},vd=({label:e,children:t,side:n="top",sideOffset:r=8,delayDuration:s=300,disabled:i=!1,forceOpen:o})=>i?P.jsx(P.Fragment,{children:t}):P.jsx(p4,{content:e,side:n,sideOffset:r,delayDuration:s,forceOpen:o,children:t}),iae=32,oae=2048,q4=ku().max(oae).refine(e=>{let t;try{t=decodeURIComponent(e.split(/[?#]/)[0])}catch{return!1}return e.startsWith("/")&&!e.startsWith("//")&&!e.includes("\\")&&!/^\/%(?:2f|5c)/i.test(e)&&!t.includes("\\")&&!t.split("/").some(n=>n==="."||n==="..")&&![...e].some(n=>n<=" "||n==="")},"Expected an app-relative preview route");ZW(q4).min(1).max(iae).transform(e=>[...new Set(e)]);const av="/__rivet/preview",h3=`${av}/variant/`,p3=`${av}/history/`,Y4=e=>e?e.startsWith("/")?e:`/${e}`:"/",Q4=(e,t)=>{if(!t)return e;const n=q4.parse(t);if(e.includes("?")||e.includes("#"))throw new Error("Preview target must not contain an application query or hash");return e.replace(/\/$/,"")+n},m3=(e,t)=>{const n=new URLSearchParams(t);return n.set("targetAddressed","1"),`/api/variants/history/${encodeURIComponent(e.sessionId)}/${encodeURIComponent(e.variantId)}/run?${n}`},aae=e=>{const t="/api/variants/history/"+encodeURIComponent(e.sessionId)+"/"+encodeURIComponent(e.variantId);return e.routePath?Q4(t+"/site/"+encodeURIComponent(e.projectPath??"current"),e.routePath):t+"/preview"+(e.projectPath?"?projectPath="+encodeURIComponent(e.projectPath):"")},lae=e=>`${av}/variant/${encodeURIComponent(e.sessionId)}/${encodeURIComponent(e.variantId)}${Y4(e.routePath)}`,g3=e=>`${av}/history/${encodeURIComponent(e.sessionId)}/${encodeURIComponent(e.variantId)}${Y4(e.routePath)}`,v3=e=>{try{const t=new URL(e,"http://localhost");return t.pathname.startsWith(h3)||t.pathname.startsWith(p3)}catch{return e.startsWith(h3)||e.startsWith(p3)}},yc=e=>{var s,i,o,c,u,d;const{sessionId:t,variant:n,projectContext:r}=e;return n.status!=="succeeded"?null:((s=n.preview)==null?void 0:s.kind)==="static_artifact"?Q4(n.preview.url,(i=n.previewRoutes)==null?void 0:i[0]):t&&(((o=n.preview)==null?void 0:o.kind)==="dev_server"||typeof n.port=="number")?lae({sessionId:t,variantId:n.workItemId,routePath:((c=n.previewRoutes)==null?void 0:c[0])??((r==null?void 0:r.kind)==="fresh"?"/":e.routePath)}):t&&(r==null?void 0:r.kind)==="fresh"&&((u=r.executionPlan)==null?void 0:u.mode)!=="vite_app"&&((d=n.preview)==null?void 0:d.kind)!=="dev_server"?`/api/variants/${t}/static/${n.workItemId}`:null},y3="/rivet/",X4=e=>{if(!e.startsWith(y3))return null;const t=e.slice(y3.length);return!t||t==="/"?null:`/${t}`},Fu=e=>{var t;return!!e.hasTree&&((t=e.serve)==null?void 0:t.kind)==="dev-server"},cae=e=>{var t,n;return((t=e.preview)==null?void 0:t.kind)==="static"||((n=e.serve)==null?void 0:n.kind)==="static"||Fu(e)},uae=e=>[...e].sort((t,n)=>new Date(n.createdAt).getTime()-new Date(t.createdAt).getTime()).find(t=>!Fu(t)),Lh=e=>{var t,n;return e.status!=="succeeded"?!1:((n=(t=e.actions)==null?void 0:t.view)==null?void 0:n.enabled)??(!!e.preview||typeof e.port=="number")},_3=e=>{var t,n;return Lh(e)&&(((t=e.preview)==null?void 0:t.kind)==="static_artifact"||((n=e.preview)==null?void 0:n.kind)==="dev_server")},J4=({entry:e,projectPath:t})=>{var n;return aae({sessionId:e.sessionId,variantId:e.variantId,projectPath:t,routePath:(n=e.previewRoutes)==null?void 0:n[0]})},dae=({entry:e,projectPath:t})=>({selectedPastVariant:{sessionId:e.sessionId,variantId:e.variantId,previewKind:"static",references:e.references,projectPath:t??void 0},previewUrl:J4({entry:e,projectPath:t})}),fae=({incomingSessionId:e,previousSessionId:t,isIncomingSessionPreviewable:n,selectedPastVariant:r,displayedLiveVariantId:s,pastVariants:i})=>{if(n)return{kind:"clear"};if(r)return r.sessionId===e?{kind:"clear"}:{kind:"keep_selected"};const o=i.find(c=>c.sessionId===t&&c.variantId===s&&!Fu(c));return o?{kind:"show_saved",entry:o}:{kind:"clear"}},yd=(e,t=Dt)=>{if((e==null?void 0:e.source)!=="history-dev-server")return;const n=new URLSearchParams({sessionId:e.sessionId,variantId:e.variantId});t(`/api/variants/history/replay/stop?${n.toString()}`,{method:"POST"}).catch(()=>{})},hae=(e,t=Dt)=>{const n=new Set;for(const r of[e==null?void 0:e.left,e==null?void 0:e.right]){if((r==null?void 0:r.source)!=="history-dev-server")continue;const s=`${r.sessionId}:${r.variantId}`;n.has(s)||(n.add(s),yd(r,t))}},_g=(e,t)=>{const n=t==null?void 0:t.left,r=t==null?void 0:t.right;return{event:`visual_editor_variant_compare_${e}`,properties:{bound_side_count:+!!n+ +!!r,is_cross_session:!!(n&&r&&n.sessionId!==r.sessionId),left_session_id:n==null?void 0:n.sessionId,left_source:n==null?void 0:n.source,left_variant_id:n==null?void 0:n.variantId,right_session_id:r==null?void 0:r.sessionId,right_source:r==null?void 0:r.source,right_variant_id:r==null?void 0:r.variantId}}},w3=6,e$="original",iS="Original",t$="The original state of your app before any variants were generated.",b3=200,n$="h-6 w-6 rounded",x3={size:13,weight:"fill",className:"text-soft-foreground shrink-0"},z2=[.33,1,.68,1],V2=.22,$r=Ls("AgentVariantsPanel"),v_=()=>{var e;(e=window.getSelection())==null||e.removeAllRanges()},pae=e=>{var t;return e?e.kind==="existing"?!0:((t=e.executionPlan)==null?void 0:t.mode)==="vite_app":!1};function y_(e,...t){return e?t.some(n=>(n??"").toLowerCase().includes(e)):!0}const mae=(e,t)=>{if(e.kind==="original")return null;const n=e.kind==="active"?e.variant.runLabel:e.entry.runLabel,r=n==null?void 0:n.trim();return r?e.kind==="active"?t?{label:r,run:e.variant.requestId?{sessionId:t,requestId:e.variant.requestId}:{sessionId:t,runLabel:r}}:null:{label:r,run:e.entry.requestId?{sessionId:e.entry.sessionId,requestId:e.entry.requestId}:{sessionId:e.entry.sessionId,runLabel:r}}:null},r$=e=>{const t="requestId"in e?["request",e.requestId]:["label",e.runLabel];return`run:${JSON.stringify([e.sessionId,...t])}`},gae="original",H2="pinned-section";function s$(e){return`rivet:collapsedRuns:${e}`}function $m(e){try{const t=window.localStorage.getItem(s$(e)),n=t?JSON.parse(t):null;return Array.isArray(n)?new Set(n.filter(r=>typeof r=="string")):new Set}catch{return new Set}}function __(e,t){try{window.localStorage.setItem(s$(e),JSON.stringify([...t]))}catch{}}const S3=(e,t)=>{const n=[],r=new Map;for(const s of e){const i=mae(s,t);let o="";s.kind==="original"?o=gae:i&&(o=r$(i.run));let c=r.get(o);c||(c={key:o,label:(i==null?void 0:i.label)??null,run:(i==null?void 0:i.run)??null,rows:[]},r.set(o,c),n.push(c)),c.rows.push(s)}return n};async function Fo(e){try{const t=await e.json();return{message:typeof t.message=="string"?t.message:null,errorCode:typeof t.errorCode=="string"?t.errorCode:null}}catch{return{message:null,errorCode:null}}}const i$=e=>e.status==="succeeded",o$=e=>{var t;return((t=e.previewUnavailable)==null?void 0:t.reason)==="idle_timeout"},vae=e=>e.status==="succeeded"&&!Lh(e)&&(!e.previewUnavailable||o$(e)),w_=e=>{var t,n;return((t=e.preview)==null?void 0:t.kind)==="static_artifact"?"static_artifact":((n=e.preview)==null?void 0:n.kind)==="dev_server"||typeof e.port=="number"?"dev_server":"none"},E3=(e,t,n)=>{const r=new URL(e,window.location.origin);return r.searchParams.set(t,n),`${r.pathname}${r.search}${r.hash}`},yae=e=>{var t;return i$(e)&&((t=e.preview)==null?void 0:t.kind)==="static_artifact"},k3=(e,t)=>e.map(n=>`${n.workItemId}:${t[n.workItemId]??""}`).join("|"),_ae=()=>{var Ic,Pl,bi;const e=kx(),t=vt(Qh),n=vt(Z4),r=g.useRef(!1),s=vt(B4),i=vt(rv),o=vt(sv),c=vt(j2),u=((Ic=c.share)==null?void 0:Ic.isEnabled)??!1,d=((Pl=c.deployPrototype)==null?void 0:Pl.isEnabled)??!1,f=((bi=c.canvasShare)==null?void 0:bi.isEnabled)??!1,p=vt(W4),m=vt(iv),v=Nt($2),_=Nt(vg),w=Nt(D2),b=Nt(F2),S=Nt(H4),E=Nt(U4),C=Nt(gd),A=vt(gd),T=Nt(sS),M=Nt(z4);g.useEffect(()=>(M("Directions"),()=>M(null)),[M]);const O=vt(vl),R=Nt(vl),D=g.useCallback((j=!1)=>{if(hae(O),R(null),j&&O){const oe=_g("ended",O);Qe.capture(oe.event,oe.properties)}},[R,O]),U=vt(p0),W=Nt(p0),H=vt(m0),Y=Nt(m0),J=H?`${H.sessionId}:${H.variantId}`:null,[V,q]=g.useState(""),[ee,F]=g.useReducer(j=>j+1,0),X=g.useMemo(()=>i!==null?$m(i):new Set,[i,ee]),B=g.useCallback(j=>{if(i===null)return;const oe=new Set($m(i));oe.delete(j)||oe.add(j),__(i,oe),F()},[i]),[L,G]=g.useState(null),[ue,te]=g.useState(null),[ie,he]=g.useState(!1),[ke,ge]=g.useState({}),[pe,Ne]=g.useState(null),[Re,$e]=g.useState({}),[Et,dn]=g.useState(null),[an,kt]=g.useState(!1),[Gt]=g.useState(()=>ine(window.location.search)),gn=g.useRef(!1),Qt=Gt!==null||H!==null||U!==null||an,Me=g.useMemo(()=>t.active?t.variants:[],[t]),Xe=g.useMemo(()=>Me.filter(yae),[Me]),Te=g.useMemo(()=>k3(Xe,ke),[Xe,ke]),xt=(pe==null?void 0:pe.key)===Te?pe.shareUrl:null,xe=t.active?t.sessionId:null,$t=g.useMemo(()=>{const j=new Set;for(const oe of Me)oe.adoptedSource&&j.add(`${oe.adoptedSource.sessionId}:${oe.adoptedSource.variantId}`);return j},[Me]),ft=t.active?t.projectContext:null,gt=(ft==null?void 0:ft.kind)==="fresh"?ft.workspacePath:i,Hn=g.useMemo(()=>gt?`?projectPath=${encodeURIComponent(gt)}`:"",[gt]),Js=t.active?`${t.sessionId}:${t.stage}`:"inactive",_n=g.useMemo(()=>{var oe;if(an||J)return null;const j=U?Me.find(Oe=>Oe.workItemId===U):null;return U&&!j?null:j?Lh(j)?j.workItemId:null:t.active?((oe=Me.find(_3))==null?void 0:oe.workItemId)??null:null},[U,J,an,t,Me]),Gn=g.useCallback(j=>{const oe=dae({entry:j,projectPath:gt});Y(oe.selectedPastVariant),kt(!1),_(oe.previewUrl)},[gt,_,Y]),_i=g.useRef(!1),rs=j=>{if(!_i.current&&!Qt&&_n===null&&j.length>0&&j.every(oe=>oe.projectKind==="fresh")){const oe=uae(j);oe&&(_i.current=!0,Gn(oe))}Y(oe=>{if(!oe)return oe;const Oe=j.find(Pe=>Pe.sessionId===oe.sessionId&&Pe.variantId===oe.variantId);return!Oe||JSON.stringify(oe.references)===JSON.stringify(Oe.references)?oe:{...oe,references:Oe.references}})},{pastVariants:Hr,setPastVariants:Un}=Loe({historyQuery:Hn,snapshotKey:Js,isEnabled:!o,isListed:cae,onLoaded:rs}),fn=g.useMemo(()=>[...Hr.filter(oe=>oe.sessionId!==xe&&!$t.has(`${oe.sessionId}:${oe.variantId}`))].sort((oe,Oe)=>{const Pe=new Date(oe.createdAt).getTime(),be=new Date(Oe.createdAt).getTime();return(Number.isNaN(be)?0:be)-(Number.isNaN(Pe)?0:Pe)}),[$t,Hr,xe]),Ur=g.useMemo(()=>H?Me.find(j=>{var oe,Oe;return((oe=j.adoptedSource)==null?void 0:oe.sessionId)===H.sessionId&&((Oe=j.adoptedSource)==null?void 0:Oe.variantId)===H.variantId})??null:null,[H,Me]),Jn=g.useMemo(()=>H?fn.find(j=>j.sessionId===H.sessionId&&j.variantId===H.variantId)??null:null,[H,fn]),Ui=!t.active&&fn.length>0&&fn.every(j=>j.projectKind==="fresh"),Rr=t.active?pae(ft):!!i&&!Ui,{pinnedKeys:Zn,pinnedKeySet:_r,listOrder:$s,togglePin:qn,pinItem:ss,reorder:st}=Uoe(gt),nn=g.useRef(null),Xt=g.useRef(null),hn=typeof window>"u"?"/":X4(window.location.pathname)??"/",wn=g.useRef(null),Bt=g.useRef(!1),Tn=g.useCallback((j,oe)=>{oe.button!==0&&oe.pointerType==="mouse"||(oe.preventDefault(),v_(),wn.current={kind:"live",variantId:j,startX:oe.clientX,startY:oe.clientY,committed:!1})},[]),Zr=g.useCallback((j,oe)=>{oe.button!==0&&oe.pointerType==="mouse"||(oe.preventDefault(),v_(),wn.current={kind:"past",entry:j,startX:oe.clientX,startY:oe.clientY,committed:!1})},[]);g.useEffect(()=>{const j=Pe=>{var at;const be=wn.current;if(!be)return;const De=Pe.clientX-be.startX,St=Pe.clientY-be.startY;if(!be.committed){if(De*De+St*St<w3*w3)return;if(v_(),be.kind==="live"){const wt=Me.find(br=>br.workItemId===be.variantId);if(!wt||wt.status!=="succeeded"){wn.current=null;return}const er=yc({sessionId:xe,variant:wt,projectContext:ft,routePath:hn});C({sessionId:xe??"",variantId:wt.workItemId,label:wt.label||"Direction",url:er,source:"live",runLabel:wt.runLabel,description:wt.description})}else{const{entry:wt}=be,er=Fu(wt),br=er?g3({sessionId:wt.sessionId,variantId:wt.variantId,routePath:((at=wt.previewRoutes)==null?void 0:at[0])??hn}):J4({entry:wt,projectPath:gt});if(C({sessionId:wt.sessionId,variantId:wt.variantId,label:wt.label||"Direction",url:br,source:er?"history-dev-server":"history-static",runLabel:wt.runLabel,description:wt.brief}),er){const js=m3(wt,Hn);(async()=>{try{if(!(await Dt(js,{method:"POST"})).ok)return;const Ft=E3(br,"replay",String(Date.now()));C(Pt=>!Pt||Pt.sessionId!==wt.sessionId||Pt.variantId!==wt.variantId||Pt.source!=="history-dev-server"?Pt:{...Pt,url:Ft}),R(Pt=>{if(!Pt)return Pt;const xi=Gi=>!Gi||Gi.sessionId!==wt.sessionId||Gi.variantId!==wt.variantId?Gi:{...Gi,url:Ft};return{...Pt,left:xi(Pt.left),right:xi(Pt.right)}})}catch(zs){$r.warn("history replay drag boot failed",zs)}})()}}be.committed=!0}T({x:Pe.clientX,y:Pe.clientY})},oe=()=>{const Pe=wn.current;Pe!=null&&Pe.committed&&(Bt.current=!0,window.setTimeout(()=>{Bt.current=!1},0)),wn.current=null,T(null)},Oe=Pe=>{if(Pe.key!=="Escape")return;const be=wn.current;be!=null&&be.committed&&(be.kind==="past"&&Fu(be.entry)&&yd({sessionId:be.entry.sessionId,variantId:be.entry.variantId,source:"history-dev-server"}),wn.current=null,C(null),T(null))};return window.addEventListener("pointermove",j),window.addEventListener("pointerup",oe),window.addEventListener("pointercancel",oe),window.addEventListener("keydown",Oe),()=>{window.removeEventListener("pointermove",j),window.removeEventListener("pointerup",oe),window.removeEventListener("pointercancel",oe),window.removeEventListener("keydown",Oe)}},[Me,xe,ft,hn,Hn,gt,C,T,R]);const Bn=g.useCallback(()=>{var j;(j=wn.current)!=null&&j.committed&&(Bt.current=!0,window.setTimeout(()=>{Bt.current=!1},0)),wn.current=null,T(null),A&&(A.source==="history-dev-server"&&yd({sessionId:A.sessionId,variantId:A.variantId,source:"history-dev-server"}),C(null))},[A,C,T]),ur=g.useCallback((j,oe)=>{const Oe=!_r.has(j);Qe.capture(Oe?"variants_panel.direction_pinned":"variants_panel.direction_unpinned",{method:oe}),qn(j)},[_r,qn]),Vt=g.useCallback(()=>{A&&(Qe.capture("variants_panel.direction_pinned",{method:"drag"}),ss(`row:past:${A.sessionId}:${A.variantId}`),Bn())},[A,Bn,ss]),ei=g.useCallback(j=>{Qe.capture("variants_panel.direction_unpinned",{method:"drag"}),qn(j),Bn()},[qn,Bn]),Ld=g.useCallback((j,oe)=>{st(j,oe),Bn()},[st,Bn]),ha=an||Rr&&U===null&&J===null&&_n===null,Zi=g.useCallback(async j=>{var Oe,Pe,be,De,St;if(!xe)return;const oe=(j==null?void 0:j.workItemId)??null;G({kind:"switch",variantId:oe??void 0});try{if(((Oe=j==null?void 0:j.preview)==null?void 0:Oe.kind)==="static_artifact"){const wt=yc({sessionId:xe,variant:j,projectContext:t.active?t.projectContext:null})??j.preview.url;w(!1),b(null),((Pe=j.refinement)==null?void 0:Pe.status)==="succeeded"&&!((be=j.previewRoutes)!=null&&be.length)?_(E3(wt,"refinement",j.refinement.workItemId)):_(wt);return}if(oe&&xe&&t.active&&t.projectContext.kind==="fresh"&&((De=t.projectContext.executionPlan)==null?void 0:De.mode)!=="vite_app"&&((St=j==null?void 0:j.preview)==null?void 0:St.kind)!=="dev_server"){w(!1),b(null),_(`/api/variants/${xe}/static/${oe}`);return}const at=j&&oe?yc({sessionId:xe,variant:j,projectContext:t.active?t.projectContext:null,routePath:hn}):null;if(at){w(!1),b(null),_(at);return}Qe.capture("variants_panel.preview_display_failed",{sessionId:xe,variantId:oe,previewKind:j?w_(j):"none",hasPreview:!!(j!=null&&j.preview),hasPort:typeof(j==null?void 0:j.port)=="number",errorMessage:"No addressable dev-server preview URL"}),w(!1),b(null)}catch(at){$r.warn("preview display failed",at),Qe.capture("variants_panel.preview_display_failed",{sessionId:xe,variantId:oe,previewKind:j?w_(j):"none",hasPreview:!!(j!=null&&j.preview),hasPort:typeof(j==null?void 0:j.port)=="number",errorMessage:at instanceof Error?at.message:String(at)}),w(!1),b(null)}finally{G(null)}},[xe,t,hn,_,w,b]),wr=g.useRef(0),ti=g.useCallback(()=>{wr.current++,G(j=>(j==null?void 0:j.kind)==="switch"?null:j),S(!1),E(!1)},[S,E]),vs=g.useCallback(async j=>{if(xe){G({kind:"switch",variantId:j.workItemId});try{const oe=await Dt(`/api/variants/${xe}/preview-port`,{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({variantId:j.workItemId})});if(!oe.ok){const Oe=await Fo(oe);throw new Error(Oe.message??`Preview restoration failed (${oe.status})`)}}catch(oe){$r.warn("preview restoration failed",oe),Qe.capture("variants_panel.preview_display_failed",{sessionId:xe,variantId:j.workItemId,previewKind:"dev_server",hasPreview:!1,hasPort:!1,errorMessage:oe instanceof Error?oe.message:String(oe)})}finally{G(null)}}},[xe]),wi=g.useCallback(j=>{var De,St,at,wt,er;if(Bt.current){Bt.current=!1;return}const oe=Lh(j),Oe=j.status==="pending"||j.status==="running"||vae(j);ti();const Pe=w_(j),be=Me.find(br=>br.workItemId===U);Qe.capture("variants_panel.preview_requested",{sessionId:xe,fromVariantId:be==null?void 0:be.workItemId,toVariantId:j.workItemId,variantStatus:j.status,isPreviewReady:oe,isArmed:Oe,previewKind:Pe,hasPreview:!!j.preview,hasPort:typeof j.port=="number",viewEnabled:((St=(De=j.actions)==null?void 0:De.view)==null?void 0:St.enabled)??null,previewUnavailableReason:((at=j.previewUnavailable)==null?void 0:at.reason)??null}),W(j.workItemId),Y(null),oe?(Xt.current=j.workItemId,kt(!1),D(!0),Zi(j)):(Xt.current=null,kt(!1),_(null),w(!1),Oe&&Qe.capture("variants_panel.preview_armed",{sessionId:xe,fromVariantId:be==null?void 0:be.workItemId,toVariantId:j.workItemId,variantStatus:j.status,previewKind:Pe,hasPreview:!!j.preview,hasPort:typeof j.port=="number",viewEnabled:((er=(wt=j.actions)==null?void 0:wt.view)==null?void 0:er.enabled)??null}),o$(j)&&vs(j)),Qe.capture("variants_panel.preview_switched",{sessionId:xe,fromVariantId:be==null?void 0:be.workItemId,toVariantId:j.workItemId,armed:Oe})},[U,xe,D,W,Y,ti,vs,Zi,Me,_,w]),ys=g.useCallback(j=>{if(Bt.current){Bt.current=!1;return}if(D(!0),W(null),Fu(j)){Y({sessionId:j.sessionId,variantId:j.variantId,previewKind:"dev_server",references:j.references,projectPath:gt??void 0}),kt(!1);const oe=++wr.current;S(!0),E(!0),(async()=>{var Pe;G({kind:"switch"}),Qe.capture("variants_panel.history_replay_started",{sessionId:j.sessionId,variantId:j.variantId});const Oe=(be,De)=>{Qe.capture("variants_panel.history_replay_failed",{sessionId:j.sessionId,variantId:j.variantId,...De}),S(!1),E(!1),Y(St=>St?{...St,previewError:be}:null),_(null)};try{const be=await Dt(m3(j,Hn),{method:"POST"});if(oe!==wr.current)return;if(!be.ok){const{message:St,errorCode:at}=await Fo(be);if(oe!==wr.current)return;$r.warn(`history replay failed: HTTP ${be.status} ${at??""}`),Oe(St??`Preview startup failed (${be.status})`,{httpStatus:be.status,errorCode:at});return}const De=await be.json();if(oe!==wr.current)return;E(!1),w(!1),b(null),_(g3({sessionId:j.sessionId,variantId:j.variantId,routePath:((Pe=j.previewRoutes)==null?void 0:Pe[0])??hn})),De.alreadyRunning||v(St=>St+1),Qe.capture("variants_panel.history_replay_ready",{sessionId:j.sessionId,variantId:j.variantId})}catch(be){if(oe!==wr.current)return;$r.warn("history replay failed",be);const De=ts(be,"Preview startup failed");Oe(De,{errorMessage:De})}finally{oe===wr.current&&G(null)}})();return}ti(),w(!1),b(null),Gn(j)},[gt,hn,Gn,G,S,E,v,Y,W,_,b,D,w,ti,Hn]);g.useEffect(()=>{if(!Gt||gn.current)return;const j=Hr.find(oe=>oe.sessionId===Gt.sessionId&&oe.variantId===Gt.variantId);j&&(gn.current=!0,ys(j))},[Gt,Hr,ys]);const pa=g.useCallback(async()=>{ti();const j=()=>{D(!0),W(null),Y(null),kt(!0),Xt.current=null,w(!1),b(null),_(null)};if(!xe){j();return}G({kind:"switch"});try{const oe=await Dt(`/api/variants/${xe}/preview-port`,{method:"POST",headers:{"content-type":"application/json"},body:JSON.stringify({variantId:null})});if(!oe.ok){$r.warn(`switch to original failed: HTTP ${oe.status}`);return}j(),w(!0),Qe.capture("variants_panel.preview_switched",{sessionId:xe,fromVariantId:U,toVariantId:null,target:"original",armed:!1})}catch(oe){$r.warn("preview-port original switch failed",oe)}finally{G(null)}},[U,xe,W,Y,_,b,D,w,ti]),Ds=g.useCallback(async(j,oe,Oe)=>{Qe.capture("variants_panel.deploy_clicked",{sessionId:j,variantId:oe,variantLabel:Oe});try{const Pe=await Dt(`/api/variants/${j}/deploy`,{method:"POST",headers:{"content-type":"application/json"},body:JSON.stringify({variantId:oe,...i?{projectPath:i}:{}})});if(!Pe.ok){const{message:St,errorCode:at}=await Fo(Pe);return $r.warn(`deploy failed: HTTP ${Pe.status} ${at??""} ${St??""}`),Qe.capture("variants_panel.deploy_failed",{sessionId:j,variantId:oe,httpStatus:Pe.status,errorCode:at??null,errorMessage:St??null}),rn.error("Couldn't deploy this direction",{description:St??`The server rejected the request (HTTP ${Pe.status}). Try again.`}),null}const be=await Pe.json().catch(()=>null),De=be==null?void 0:be.shareUrl;return De?(await navigator.clipboard.writeText(De).catch(()=>{}),Qe.capture("variants_panel.deploy_succeeded",{sessionId:j,variantId:oe}),rn.success(`"${Oe}" is live — link copied`,{action:{label:"Open",onClick:()=>window.open(De,"_blank","noopener")}}),De):(rn.error("Couldn't deploy this direction",{description:"The deploy host returned an unexpected response."}),null)}catch(Pe){return $r.warn("deploy failed",Pe),Qe.capture("variants_panel.deploy_failed",{sessionId:j,variantId:oe,httpStatus:null,errorCode:"NETWORK_ERROR",errorMessage:Pe instanceof Error?Pe.message:String(Pe)}),rn.error("Couldn't deploy this direction",{description:"Network or server error. Check that the Rivet backend is reachable and try again."}),null}},[i]),xl=g.useCallback(async j=>{if(!xe)return;const oe=ke[j.workItemId];if(oe){await navigator.clipboard.writeText(oe).catch(()=>{}),rn.success("Share link copied",{action:{label:"Open",onClick:()=>window.open(oe,"_blank","noopener")}});return}G({kind:"deploy",variantId:j.workItemId});try{const Oe=await Ds(xe,j.workItemId,j.label);Oe&&ge(Pe=>({...Pe,[j.workItemId]:Oe}))}finally{G(null)}},[xe,ke,Ds]),Tc=g.useCallback(async()=>{if(!(!xe||Xe.length===0)){if(xt){await navigator.clipboard.writeText(xt).catch(()=>{}),rn.success("Canvas link copied",{action:{label:"Open",onClick:()=>window.open(xt,"_blank","noopener")}});return}Qe.capture("variants_panel.deploy_clicked",{sessionId:xe,variantId:"canvas",variantLabel:"Canvas",variantCount:Xe.length}),G({kind:"deploy-canvas"});try{const j=await Dt(`/api/variants/${xe}/canvas/deploy`,{method:"POST",headers:{"content-type":"application/json"},body:JSON.stringify({variantIds:Xe.map(De=>De.workItemId),...i?{projectPath:i}:{}})});if(!j.ok){const{message:De,errorCode:St}=await Fo(j);$r.warn(`canvas deploy failed: HTTP ${j.status} ${St??""} ${De??""}`),Qe.capture("variants_panel.deploy_failed",{sessionId:xe,variantId:"canvas",httpStatus:j.status,errorCode:St??null,errorMessage:De??null,variantCount:Xe.length}),rn.error("Couldn't share this canvas",{description:De??`The server rejected the request (HTTP ${j.status}). Try again.`});return}const oe=await j.json().catch(()=>null),Oe=oe==null?void 0:oe.shareUrl;if(!Oe){rn.error("Couldn't share this canvas",{description:"The deploy host returned an unexpected response."});return}const Pe=Object.fromEntries(((oe==null?void 0:oe.variants)??[]).filter(De=>typeof De.variantId=="string"&&typeof De.shareUrl=="string").map(De=>[De.variantId,De.shareUrl])),be=Object.keys(Pe).length>0?{...ke,...Pe}:ke;be!==ke&&ge(be),await navigator.clipboard.writeText(Oe).catch(()=>{}),Ne({key:k3(Xe,be),shareUrl:Oe}),Qe.capture("variants_panel.deploy_succeeded",{sessionId:xe,variantId:"canvas",variantCount:Xe.length}),rn.success("Canvas is live — link copied",{action:{label:"Open",onClick:()=>window.open(Oe,"_blank","noopener")}})}catch(j){$r.warn("canvas deploy failed",j),Qe.capture("variants_panel.deploy_failed",{sessionId:xe,variantId:"canvas",httpStatus:null,errorCode:"NETWORK_ERROR",errorMessage:j instanceof Error?j.message:String(j),variantCount:Xe.length}),rn.error("Couldn't share this canvas",{description:"Network or server error. Check that the Rivet backend is reachable and try again."})}finally{G(null)}}},[xt,Xe,ke,i,xe]),ma=g.useCallback(async j=>{const oe=`${j.sessionId}:${j.variantId}`,Oe=Re[oe];if(Oe){await navigator.clipboard.writeText(Oe).catch(()=>{}),rn.success("Share link copied",{action:{label:"Open",onClick:()=>window.open(Oe,"_blank","noopener")}});return}dn(oe);try{const Pe=await Ds(j.sessionId,j.variantId,j.label);Pe&&$e(be=>({...be,[oe]:Pe}))}finally{dn(null)}},[Re,Ds]),ln=g.useCallback(async j=>{if(xe){Qe.capture("variants_panel.remove_clicked",{sessionId:xe,variantId:j.workItemId,variantLabelLength:j.label.length}),G({kind:"remove",variantId:j.workItemId});try{const oe=await Dt(`/api/variants/${xe}/${j.workItemId}/remove`,{method:"POST",headers:{"content-type":"application/json"},body:"{}"});if(!oe.ok){const{message:Oe}=await Fo(oe);$r.warn(`remove failed: HTTP ${oe.status} ${Oe??""}`),rn.error("Couldn't remove direction",{description:Oe??`The server rejected the request (HTTP ${oe.status}). Try again.`});return}(j.workItemId===_n||j.workItemId===U)&&(W(null),_(null),w(!1),v(Oe=>Oe+1))}catch(oe){$r.warn("remove failed",oe),rn.error("Couldn't remove direction",{description:"Network or server error. Try again."})}finally{G(null)}}},[xe,U,_n,W,_,w,v]),Bi=g.useCallback(async j=>{if(!gt){rn.error("Couldn't remove direction",{description:"No project path available."});return}Qe.capture("variants_panel.remove_past_clicked",{sessionId:j.sessionId,variantId:j.variantId});const oe=`${j.sessionId}:${j.variantId}`,Oe=Pe=>Pe.sessionId===j.sessionId&&Pe.variantId===j.variantId;G({kind:"remove",variantId:oe}),Un(Pe=>Pe.filter(be=>!Oe(be))),J===oe&&(Y(null),_(null),w(!1),v(Pe=>Pe+1));try{const Pe=await Dt(`/api/variants/history/${encodeURIComponent(j.sessionId)}/${encodeURIComponent(j.variantId)}/remove`,{method:"POST",headers:{"content-type":"application/json"},body:JSON.stringify({projectPath:gt})});if(!Pe.ok){const{message:be}=await Fo(Pe);Un(De=>De.some(Oe)?De:[...De,j]),rn.error("Couldn't remove direction",{description:be??`The server rejected the request (HTTP ${Pe.status}). Try again.`})}}catch(Pe){$r.warn("remove past failed",Pe),Un(be=>be.some(Oe)?be:[...be,j]),rn.error("Couldn't remove direction",{description:"Network or server error. Try again."})}finally{G(null)}},[gt,J,Y,_,w,v,Un]),Fs=g.useCallback(j=>{te(j)},[]),Wi=g.useCallback((j,oe)=>{if(!j.label||!j.run)return;const Oe=j.rows.flatMap(be=>be.kind==="active"?[be.variant]:[]),Pe=j.rows.flatMap(be=>be.kind==="past"?[be.entry]:[]);Oe.length===0&&Pe.length===0||te({kind:"run",label:j.label,variants:Oe,entries:Pe,returnFocusTo:oe})},[]),Ir=g.useCallback(async()=>{if(!(!ue||ie)){he(!0);try{if(ue.kind==="active")await ln(ue.variant);else if(ue.kind==="past")await Bi(ue.entry);else{for(const j of ue.variants)await ln(j);for(const j of ue.entries)await Bi(j)}}finally{he(!1),te(null)}}},[ue,ie,ln,Bi]),[Sl,El]=g.useState(null),[So,Br]=g.useState(null),kl=g.useRef(null),is=g.useCallback(j=>{Br(j)},[]),$d=g.useCallback(()=>{Br(null)},[]),Rc=g.useCallback(async(j,oe)=>{Br(null);const Oe=oe.trim();if(!Oe||j.kind==="original")return;if(j.kind==="active"){if(!xe||Oe===j.variant.label)return;Qe.capture("variants_panel.rename",{sessionId:xe,variantId:j.variant.workItemId,labelLength:Oe.length,past:!1});try{const De=await Dt(`/api/variants/${xe}/${j.variant.workItemId}/rename`,{method:"POST",headers:{"content-type":"application/json"},body:JSON.stringify({label:Oe})});if(!De.ok){const{message:St}=await Fo(De);rn.error("Couldn't rename direction",{description:St??`The server rejected the request (HTTP ${De.status}). Try again.`})}}catch(De){$r.warn("rename failed",De),rn.error("Couldn't rename direction",{description:"Network or server error. Try again."})}return}const{entry:Pe}=j;if(Oe===Pe.label.trim())return;if(!gt){rn.error("Couldn't rename direction",{description:"No project path available."});return}Qe.capture("variants_panel.rename",{sessionId:Pe.sessionId,variantId:Pe.variantId,labelLength:Oe.length,past:!0});const be=De=>De.sessionId===Pe.sessionId&&De.variantId===Pe.variantId;Un(De=>De.map(St=>be(St)?{...St,label:Oe}:St));try{const De=await Dt(`/api/variants/history/${encodeURIComponent(Pe.sessionId)}/${encodeURIComponent(Pe.variantId)}/rename`,{method:"POST",headers:{"content-type":"application/json"},body:JSON.stringify({label:Oe,projectPath:gt})});if(!De.ok){const{message:St}=await Fo(De);Un(at=>at.map(wt=>be(wt)?{...wt,label:Pe.label}:wt)),rn.error("Couldn't rename direction",{description:St??`The server rejected the request (HTTP ${De.status}). Try again.`})}}catch(De){$r.warn("rename failed",De),Un(St=>St.map(at=>be(at)?{...at,label:Pe.label}:at)),rn.error("Couldn't rename direction",{description:"Network or server error. Try again."})}},[xe,gt,Un]),[ga,ni]=g.useState(null),N=g.useCallback(j=>{ni(j)},[]),de=g.useCallback(()=>{ni(null)},[]),ve=g.useCallback(async(j,oe)=>{if(ni(null),!j.label||!j.run)return;const Oe=j.label,Pe=oe.trim();if(!Pe||Pe===Oe)return;Qe.capture("variants_panel.rename_run",{runLabelLength:Pe.length});const be="requestId"in j.run?j.run.requestId:void 0,De=be?j.key:r$({sessionId:j.run.sessionId,runLabel:Pe}),St=De!==j.key;let at=!1,wt=!1;if(i!==null&&St){const Ft=$m(i);at=Ft.has(j.key),wt=Ft.has(De),at&&(Ft.add(De),__(i,Ft),F())}const er=Ft=>{if(i===null||!St)return;const Pt=$m(i);Ft?Pt.delete(j.key):(at?Pt.add(j.key):Pt.delete(j.key),wt?Pt.add(De):Pt.delete(De)),__(i,Pt),F()},br=new Set(j.rows.flatMap(Ft=>Ft.kind==="past"?[`${Ft.entry.sessionId}:${Ft.entry.variantId}`]:[])),js=Ft=>br.has(`${Ft.sessionId}:${Ft.variantId}`);Un(Ft=>Ft.map(Pt=>js(Pt)?{...Pt,runLabel:Pe}:Pt));const zs=()=>Un(Ft=>Ft.map(Pt=>js(Pt)?{...Pt,runLabel:Oe}:Pt));try{const Ft=await Dt("/api/variants/runs/rename",{method:"POST",headers:{"content-type":"application/json"},body:JSON.stringify({sessionId:j.run.sessionId,...be?{requestId:be}:{},runLabel:Oe,label:Pe,...gt?{projectPath:gt}:{}})});if(Ft.ok)er(!0);else{const{message:Pt}=await Fo(Ft);zs(),er(!1),rn.error("Couldn't rename run",{description:Pt??`The server rejected the request (HTTP ${Ft.status}). Try again.`})}}catch(Ft){$r.warn("run rename failed",Ft),zs(),er(!1),rn.error("Couldn't rename run",{description:"Network or server error. Try again."})}},[gt,i,Un]);g.useEffect(()=>{const j=n&&!r.current;if(r.current=n,nn.current!==xe){const Oe=nn.current===null,Pe=nn.current;nn.current=xe;const be=e.get(m0);if(j&&Gt&&(be==null?void 0:be.sessionId)===Gt.sessionId&&(be==null?void 0:be.variantId)===Gt.variantId)return;const De=fae({incomingSessionId:xe,previousSessionId:Pe,isIncomingSessionPreviewable:t.active&&Me.some(_3),selectedPastVariant:be,displayedLiveVariantId:e.get(p0)??Xt.current,pastVariants:Hr});switch(Xt.current=null,Ne(null),w(!1),b(null),D(),W(null),kt(!1),_i.current=!1,De.kind){case"keep_selected":break;case"show_saved":Gn(De.entry);break;case"clear":_(null),Y(null);break;default:{const St=De;throw new Error(`Unhandled session preview: ${String(St)}`)}}if(!Oe)return}if(J||an||!_n||t.active!==!0||Xt.current===_n)return;const oe=Me.find(Oe=>Oe.workItemId===_n);oe&&(Xt.current=_n,D(),Zi(oe))},[xe,n,Gt,e,J,an,_n,t,Me,Zi,D,Hr,W,Y,_,Gn,b,w]),g.useEffect(()=>{!H||!Ur||(Xt.current=null,Y(null),W(Ur.workItemId))},[Ur,H,xe,W,Y]),g.useEffect(()=>{!H||Ur||Jn||Y(null)},[Ur,H,Jn,xe,Y,fn]),g.useEffect(()=>{const j=V.trim().toLowerCase(),oe=[...Me.map(at=>({kind:"active",variant:at})),...fn.map(at=>({kind:"past",entry:at})),...Rr?[{kind:"original"}]:[]],Oe=j?oe.filter(at=>C3(at,j)):oe,{pinned:Pe,unpinned:be}=P3(T3(S3(Oe,xe),$s),Zn,xe),De=[...X.has(H2)?[]:Pe,...be.flatMap(at=>at.key!==""&&X.has(at.key)?[]:at.rows)];return De.length===0?void 0:IJ(at=>{if(Zie())return;if(at.key==="Enter"){const Pt=Me.find(xi=>xi.workItemId===Sl);Pt&&(at.preventDefault(),wi(Pt));return}if(at.key!=="ArrowUp"&&at.key!=="ArrowDown")return;at.preventDefault();const wt=U??_n;let er=wt?`live:${wt}`:null;J?er=`past:${J}`:ha&&(er=e$);const br=er?De.findIndex(Pt=>_d(Pt)===er):-1;let js;if(br===-1?js=at.key==="ArrowDown"?0:De.length-1:at.key==="ArrowDown"?js=Math.min(br+1,De.length-1):js=Math.max(br-1,0),js===br)return;const zs=De[js];zs.kind==="active"?wi(zs.variant):zs.kind==="past"?ys(zs.entry):pa();const Ft=document.querySelector(`[data-variant-key="${_d(zs)}"]`);Ft instanceof HTMLElement&&Ft.focus({preventScroll:!0})})},[Me,fn,V,Rr,X,Zn,$s,xe,U,J,ha,_n,Sl,wi,ys,pa]);const Se=Me.find(j=>j.workItemId===_n)??null,Ue=J?fn.find(j=>`${j.sessionId}:${j.variantId}`===J)??null:null,ht=!!Ue,Tt=[...(t.active?Me:[]).map(j=>({kind:"active",variant:j})),...fn.map(j=>({kind:"past",entry:j})),...Rr?[{kind:"original"}]:[]],Jt=V.trim().toLowerCase(),pt=Jt?Tt.filter(j=>C3(j,Jt)):Tt,Rn=T3(S3(pt,xe),$s),{pinned:it,unpinned:Or}=P3(Rn,Zn,xe);let Eo=null;A&&(Eo=A.source==="live"?`live:${A.variantId}`:`past:${A.sessionId}:${A.variantId}`);const ko=new Set(Me.map(j=>j.requestId).filter(Boolean)),Mr=s.filter(j=>!ko.has(j.requestId)),Ki=Mr.length>0,Cl=o&&!Ki&&Tt.length===0;return P.jsxs("div",{className:"flex h-full min-h-0 flex-col",children:[Tt.length>0?P.jsx("div",{className:"pt-2 pr-5 pb-1 pl-3",children:P.jsxs("div",{className:"relative",children:[P.jsx(Xee,{size:13,className:"text-soft-foreground pointer-events-none absolute top-1/2 left-2 -translate-y-1/2"}),P.jsx("input",{type:"text",value:V,onChange:j=>q(j.target.value),placeholder:"Search directions…","aria-label":"Search directions",className:"border-surface-2 bg-muted/40 text-foreground placeholder:text-soft-foreground focus:border-soft-foreground w-full rounded-md border py-1.5 pr-2 pl-7 text-xs transition-colors focus-visible:outline-hidden"})]})}):null,P.jsxs("div",{ref:kl,role:"region","aria-label":"Directions",tabIndex:-1,className:"flex-1 [scrollbar-gutter:stable] overflow-y-auto px-3 py-2 outline-none forced-colors:focus-visible:outline-2 forced-colors:focus-visible:-outline-offset-2 forced-colors:focus-visible:outline-solid",children:[Ki?P.jsx(Pae,{groups:Mr}):null,Cl?P.jsx(Aae,{}):null,t.active&&Tt.length===0&&!Ki&&!Cl?P.jsx(Tae,{}):null,!t.active&&!Ki&&!Cl&&fn.length===0&&!Rr?P.jsx(Rae,{isMCPSession:p,mcpEditor:m}):null,Tt.length>0&&pt.length===0?P.jsxs("p",{className:"text-soft-foreground px-1 py-6 text-center text-xs",children:["No directions match “",V.trim(),"”."]}):null,pt.length>0?P.jsx(Sae,{groups:Or,pinned:it,pinnedKeys:_r,draggedRowKey:Eo,onDropPin:Vt,onDropUnpin:ei,onTogglePin:ur,onReorder:Ld,collapsedRuns:X,onToggleRun:B,activeVariantId:U??_n,activePastKey:J,isOriginalSelected:ha,busy:L,editingKey:So,onSelectActive:wi,onSelectPast:ys,onSelectOriginal:pa,onActivePointerDown:Tn,onPastPointerDown:Zr,onHover:El,onRemove:(j,oe)=>Fs({kind:"active",variant:j,returnFocusTo:oe}),onRemovePast:(j,oe)=>Fs({kind:"past",entry:j,returnFocusTo:oe}),onStartRename:is,onCommitRename:Rc,onCancelRename:$d,editingRunKey:ga,onStartRunRename:N,onCommitRunRename:ve,onCancelRunRename:de,onRemoveRun:Wi,onCopyVariantContext:K4,activeSessionId:t.active?t.sessionId:null,projectPath:gt}):null]}),u&&ht&&Ue?P.jsx(rae,{entry:Ue,deploying:Et===J,deployedUrl:J?Re[J]??null:null,onDeploy:ma,isDeployDisabled:!d}):null,!ht&&t.active?P.jsx(Cae,{selectedVariant:Se,busy:L,onDeploy:xl,onDeployCanvas:Tc,canShare:u,canDeploy:d&&(ft==null?void 0:ft.kind)==="fresh",canDeployCanvas:d&&f&&(ft==null?void 0:ft.kind)==="fresh",canvasVariantCount:Xe.length,canvasDeployedUrl:xt,deployedUrl:Se?ke[Se.workItemId]??null:null}):null,P.jsx(Rie,{target:ue,fallbackFocus:kl,isConfirming:ie,onCancel:()=>te(null),onConfirm:Ir})]})},_d=e=>e.kind==="active"?`live:${e.variant.workItemId}`:e.kind==="past"?`past:${e.entry.sessionId}:${e.entry.variantId}`:e$,C3=(e,t)=>e.kind==="active"?y_(t,e.variant.label,e.variant.runLabel):e.kind==="past"?y_(t,e.entry.label,e.entry.runLabel,e.entry.brief):y_(t,iS,t$),a$=(e,t)=>e.startsWith("live:")?`row:past:${t??""}:${e.slice(5)}`:`row:${e}`,l$=(e,t)=>a$(_d(e),t),P3=(e,t,n)=>{if(t.length===0)return{pinned:[],unpinned:e};const r=new Set(t),s=new Map,i=[];for(const c of e){const u=[];for(const d of c.rows){const f=l$(d,n);r.has(f)?s.set(f,d):u.push(d)}u.length>0&&i.push(u.length===c.rows.length?c:{...c,rows:u})}return{pinned:t.flatMap(c=>{const u=s.get(c);return u?[u]:[]}),unpinned:i}},A3=(e,t,n)=>{if(!t||t.length===0)return e;const r=new Map(t.map((o,c)=>[o,c])),s=e.filter(o=>!r.has(n(o)));if(s.length===e.length)return e;const i=e.flatMap(o=>{const c=r.get(n(o));return c===void 0?[]:[{item:o,index:c}]}).sort((o,c)=>o.index-c.index).map(({item:o})=>o);return[...s,...i]},T3=(e,t)=>{const n=e.map(r=>{const s=t.rows[r.key];return!s||s.length===0?r:{...r,rows:A3(r.rows,s,_d)}});return A3(n,t.groups,r=>r.key)},wae=e=>e.length<=b3?e:`${e.slice(0,b3-1)}…`,bae=(e,t)=>e.kind==="active"?t?`${t}:${e.variant.workItemId}`:null:e.kind==="past"?`${e.entry.sessionId}:${e.entry.variantId}`:null,xae=e=>e.kind==="active"?e.variant.directionRef??null:e.kind==="past"?e.entry.directionRef??null:null,Sae=({groups:e,pinned:t,pinnedKeys:n,draggedRowKey:r,onDropPin:s,onDropUnpin:i,onTogglePin:o,onReorder:c,collapsedRuns:u,onToggleRun:d,activeVariantId:f,activePastKey:p,isOriginalSelected:m,busy:v,editingKey:_,onSelectActive:w,onSelectPast:b,onSelectOriginal:S,onActivePointerDown:E,onPastPointerDown:C,onHover:A,onRemove:T,onRemovePast:M,onStartRename:O,onCommitRename:R,onCancelRename:D,editingRunKey:U,onStartRunRename:W,onCommitRunRename:H,onCancelRunRename:Y,onRemoveRun:J,onCopyVariantContext:V,activeSessionId:q,projectPath:ee})=>{const F=g.useRef(null),{activeIndex:X,itemRects:B,handlers:L,registerItem:G}=Coe(F,{snapTolerancePx:5}),[ue,te]=g.useState(0),[ie,he]=g.useState(!1),[ke,ge]=g.useState(!1),pe=u.has(H2),Ne=r!==null,Re=g.useMemo(()=>{if(!r)return null;const Te=a$(r,q);if(n.has(Te))return{container:Vf,key:Te};const xt=e.find(xe=>xe.rows.some($t=>_d($t)===r));return xt?{container:p_(xt.key),key:r}:null},[r,n,e,q]),$e=(Re==null?void 0:Re.container)===Vf,{dropTarget:Et,onPointerMove:dn,onPointerUp:an}=Zoe({containerRef:F,dragged:Re,yieldToSelector:$e?void 0:"[data-pinned-drop-zone]",restrictToSelector:$e?"[data-pinned-drop-zone]":void 0,onReorder:c}),kt=X!==null?B[X]:null,Gt=Te=>Te.kind==="active"?Te.variant.workItemId===f:Te.kind==="past"?`${Te.entry.sessionId}:${Te.entry.variantId}`===p:m,gn=(Te,xt,xe,$t)=>{const ft=_d(Te),gt=l$(Te,q);return P.jsx(kae,{rowKey:ft,row:Te,index:xt,isSelected:Gt(Te),isEditing:_===ft,isPinned:n.has(gt),onTogglePin:Hn=>o(gt,Hn),reorderContainer:xe,reorderKey:xe===Vf?gt:ft,isNested:$t,busy:v,registerItem:G,onSelectActive:w,onSelectPast:b,onSelectOriginal:S,onActivePointerDown:E,onPastPointerDown:C,onHover:A,onRemove:T,onRemovePast:M,onStartRename:O,onCommitRename:R,onCancelRename:D,onCopyVariantContext:V,activeSessionId:q,projectPath:ee},ft)};let Qt=0;const Me=Te=>{if(Te.key==="")return Te.rows.map(ft=>gn(ft,Qt++,p_(Te.key),!1));const xt=u.has(Te.key),xe=xt?null:Te.rows.map(ft=>gn(ft,Qt++,p_(Te.key),!0)),$t=Te.label;return P.jsx(Eae,{label:$t??iS,collapsed:xt,onToggle:()=>d(Te.key),directionCount:Te.rows.length,isEditing:$t!==null&&U===Te.key,onStartRename:$t!==null?()=>W(Te.key):void 0,onCommitRename:$t!==null?ft=>H(Te,ft):void 0,onCancelRename:Y,onRemove:$t!==null?ft=>J(Te,ft):void 0,children:xe},Te.key)},Xe=t.length>0||Ne;return P.jsxs("div",{ref:F,className:"relative",onMouseEnter:()=>{te(Te=>Te+1),L.onMouseEnter()},onMouseMove:L.onMouseMove,onMouseLeave:L.onMouseLeave,onPointerMove:dn,onPointerUp:Te=>{var xt;if($e&&Re){const xe=(xt=F.current)==null?void 0:xt.querySelector("[data-pinned-drop-zone]"),$t=xe==null?void 0:xe.getBoundingClientRect();if(!($t!==void 0&&Te.clientY>=$t.top&&Te.clientY<=$t.bottom)){i(Re.key);return}}an()},children:[Re&&Et?P.jsx("div",{className:"bg-soft-foreground pointer-events-none absolute right-1 left-1 z-20 h-0.5 rounded-full",style:{top:Et.top}}):null,P.jsx(Nu,{children:kt&&P.jsx(ta.div,{className:"bg-hover pointer-events-none absolute z-0 rounded-md",initial:{opacity:0,top:kt.top,left:kt.left,width:kt.width,height:kt.height},animate:{opacity:1,top:kt.top,left:kt.left,width:kt.width,height:kt.height},exit:{opacity:0,transition:{duration:.06}},transition:{...gg.fast,opacity:{duration:.08}}},ue)}),P.jsxs("ul",{className:"relative flex flex-col gap-2",children:[P.jsx(Nu,{initial:!1,children:Xe?P.jsxs(ta.li,{initial:{height:0,opacity:0},animate:{height:"auto",opacity:1},exit:{height:0,opacity:0},transition:{duration:V2,ease:z2},"data-pinned-drop-zone":"",className:or("overflow-hidden rounded-lg bg-white/[0.012] transition-shadow",Ne&&"ring-soft-foreground/30 ring-1",Ne&&ie&&"ring-soft-foreground/70 bg-white/[0.03]"),onPointerEnter:Ne?()=>he(!0):void 0,onPointerLeave:Ne?()=>he(!1):void 0,onPointerUp:Ne?()=>{he(!1),s()}:void 0,children:[P.jsx("div",{"data-hover-dead-zone":"",children:P.jsxs("button",{type:"button",onClick:()=>d(H2),"aria-expanded":!pe,"aria-label":`${pe?"Expand":"Collapse"} pinned items`,className:"focus-visible:bg-active flex w-full items-center gap-2 px-3 py-2 text-left transition-colors duration-80 hover:bg-white/[0.03] focus-visible:outline-hidden",children:[P.jsx(_2,{...x3}),P.jsx("span",{className:"text-foreground min-w-0 flex-1 truncate text-sm font-medium",children:"Pinned"})]})}),P.jsx(Nu,{initial:!1,children:!pe&&P.jsx(ta.div,{initial:{height:0,opacity:0},animate:{height:"auto",opacity:1},exit:{height:0,opacity:0},transition:{duration:V2,ease:z2},className:"overflow-hidden",children:t.length>0?P.jsx("ul",{className:"flex flex-col gap-2",children:t.map(Te=>gn(Te,Qt++,Vf,!1))}):null},"body")})]},"pinned-section"):null}),Xe&&e.length>0?P.jsxs("li",{className:or("mt-2 overflow-hidden rounded-lg bg-white/[0.012] transition-shadow",$e&&"ring-soft-foreground/30 ring-1",$e&&ke&&"ring-soft-foreground/70 bg-white/[0.03]"),onPointerEnter:$e?()=>ge(!0):void 0,onPointerLeave:$e?()=>ge(!1):void 0,onPointerUp:$e?()=>ge(!1):void 0,children:[P.jsxs("div",{"data-hover-dead-zone":"",className:"flex w-full items-center gap-2 px-3 py-2",children:[P.jsx(nte,{...x3}),P.jsx("span",{className:"text-foreground min-w-0 flex-1 truncate text-sm font-medium",children:"Directions"})]}),P.jsx("ul",{className:"flex flex-col gap-2",children:e.map(Te=>Me(Te))})]}):e.map(Te=>Me(Te))]})]})},c$=({open:e,onOpenChange:t,triggerLabel:n,actions:r})=>{const s=g.useRef(null);return P.jsxs(nS,{isOpen:e,onOpenChange:t,children:[P.jsx(vd,{label:n,children:P.jsx(nv,{asChild:!0,children:P.jsx(ir,{ref:s,type:"button",variant:"ghost",size:"icon-compact","aria-label":n,onClick:i=>i.stopPropagation(),onPointerDown:i=>i.stopPropagation(),className:n$,children:P.jsx(Gee,{size:15,weight:"bold"})})})}),P.jsx(rS,{side:"bottom",align:"end",onCloseAutoFocus:i=>i.preventDefault(),children:r.map(i=>P.jsxs(Va,{disabled:i.disabled,onClick:o=>o.stopPropagation(),onSelect:()=>i.onSelect(s.current),onPointerDown:o=>o.stopPropagation(),children:[i.icon,i.label,i.detail?P.jsx("span",{className:"text-soft-foreground ml-auto pl-3 font-mono",children:i.detail}):null]},i.key))})]})},Eae=({label:e,collapsed:t,directionCount:n,onToggle:r,isEditing:s=!1,onStartRename:i,onCommitRename:o,onCancelRename:c,onRemove:u,children:d})=>{const f=Ms(),[p,m]=g.useState(!1),v=[...i?[{key:"rename",label:"Rename",icon:P.jsx(PL,{size:13,weight:"bold"}),onSelect:i}]:[],...u?[{key:"remove",label:"Remove",icon:P.jsx(LL,{size:13,weight:"bold"}),onSelect:u}]:[]],_=t?P.jsx(Yee,{size:13,weight:"fill",className:"shrink-0 text-sky-400"}):P.jsx(qee,{size:13,weight:"fill",className:"shrink-0 text-sky-400"});return s&&o&&c?P.jsxs("li",{className:"overflow-hidden rounded-lg bg-white/[0.012]",children:[P.jsxs("div",{"data-hover-dead-zone":"",className:"bg-muted flex w-full items-center gap-2 px-3 py-2",children:[_,P.jsx("span",{className:"min-w-0 flex-1",children:P.jsx(u$,{initial:e,onCommit:o,onCancel:c})})]}),P.jsx(Nu,{initial:!1,children:!t&&P.jsx(ta.ul,{className:"overflow-hidden",children:d},"body")})]}):P.jsxs("li",{className:"overflow-hidden rounded-lg bg-white/[0.012]",children:[P.jsxs("div",{"data-hover-dead-zone":"",className:"group relative",children:[P.jsxs("button",{type:"button",onClick:w=>{if((w.metaKey||w.ctrlKey)&&v.length>0){m(!0);return}f==null||f.capture("variants_panel.folder_toggled",{isCollapsed:!t,directionCount:n}),r()},"aria-expanded":!t,"aria-label":`${t?"Expand":"Collapse"} ${e} directions`,className:"focus-visible:bg-active flex w-full items-center gap-2 px-3 py-2 text-left transition-colors duration-80 hover:bg-white/[0.03] focus-visible:outline-hidden",children:[_,P.jsx("span",{className:"text-foreground min-w-0 flex-1 truncate text-sm font-medium",children:e})]}),v.length>0&&P.jsx("div",{className:or("absolute top-1.5 right-2 flex items-center gap-0.5 transition-opacity duration-80","pointer-events-none opacity-0 group-hover:pointer-events-auto group-hover:opacity-100 has-[:focus-visible]:pointer-events-auto has-[:focus-visible]:opacity-100",p&&"pointer-events-auto opacity-100"),children:P.jsx(c$,{open:p,onOpenChange:m,triggerLabel:`${e} run actions`,actions:v})})]}),P.jsx(Nu,{initial:!1,children:!t&&P.jsx(ta.ul,{initial:{height:0,opacity:0},animate:{height:"auto",opacity:1},exit:{height:0,opacity:0},transition:{duration:V2,ease:z2},className:"overflow-hidden",children:d},"body")})]})},kae=({rowKey:e,row:t,index:n,isSelected:r,isEditing:s,isPinned:i,onTogglePin:o,reorderContainer:c,reorderKey:u,isNested:d,busy:f,registerItem:p,onSelectActive:m,onSelectPast:v,onSelectOriginal:_,onActivePointerDown:w,onPastPointerDown:b,onHover:S,onRemove:E,onRemovePast:C,onStartRename:A,onCommitRename:T,onCancelRename:M,onCopyVariantContext:O,activeSessionId:R,projectPath:D})=>{var pe,Ne;const U=g.useRef(null);Poe(p,n,U);const[W,H]=g.useState(!1),Y=t.kind==="active",J=t.kind==="original",V=t.kind==="active"?t.variant:null,q=t.kind==="past"?t.entry:null,ee=V?V.status==="succeeded":!0,F=V?Lh(V):!0,X=V!==null&&(V.status==="pending"||V.status==="running"),B=(V==null?void 0:V.status)==="failed",L=(V==null?void 0:V.status)==="cancelled",G=V!==null&&(f==null?void 0:f.kind)==="remove"&&f.variantId===V.workItemId,ue=V!==null&&(((pe=V.refinement)==null?void 0:pe.status)==="pending"||((Ne=V.refinement)==null?void 0:Ne.status)==="running");let te=iS;V?te=V.label||`Direction ${n+1}`:q&&(te=q.label.trim()||"Untitled direction");let ie=t$;V?ie=V.description:q&&(ie=q.brief);const he=ie?wae(ie):null,ke=xae(t),ge=ke??bae(t,R);return s?P.jsx("li",{ref:U,"data-proximity-index":n,"data-reorder-container":c,"data-reorder-key":u,className:"group relative z-10",children:P.jsx("div",{className:or("bg-muted flex w-full items-start gap-2 rounded-md py-2 pr-3",d?"pl-[33px]":"pl-3"),children:P.jsxs("span",{className:"min-w-0 flex-1",children:[P.jsx(u$,{initial:te,onCommit:Re=>T(t,Re),onCancel:M}),he&&P.jsx("span",{className:"text-soft-foreground mt-1 line-clamp-2 block text-xs leading-snug",children:he})]})})}):P.jsxs("li",{ref:U,"data-proximity-index":n,"data-reorder-container":c,"data-reorder-key":u,className:or("group relative z-10 rounded-md",r&&"bg-muted"),onMouseEnter:V?()=>S(V.workItemId):void 0,onMouseLeave:Y?()=>S(null):void 0,children:[P.jsx("div",{role:"button",tabIndex:0,"data-variant-id":V==null?void 0:V.workItemId,"data-variant-key":e,onClick:Re=>{if(Re.metaKey||Re.ctrlKey){H(!0);return}const $e=window.getSelection();$e&&!$e.isCollapsed||(t.kind==="active"?m(t.variant):t.kind==="past"?v(t.entry):_())},onKeyDown:Re=>{(Re.key==="Enter"||Re.key===" ")&&(Re.preventDefault(),Re.stopPropagation(),t.kind==="active"?m(t.variant):t.kind==="past"?v(t.entry):_())},onPointerDown:Re=>{Re.metaKey||Re.ctrlKey||(t.kind==="active"?F&&w(t.variant.workItemId,Re):t.kind==="past"&&b(t.entry,Re))},"aria-pressed":r,"aria-disabled":Y?!1:void 0,"aria-busy":X||ue,className:or("focus-visible:bg-active flex w-full items-start gap-2 rounded-md py-2 pr-3 text-left transition-colors focus-visible:outline-hidden",d?"pl-[33px]":"pl-3",F&&"cursor-grab active:cursor-grabbing",!F&&"cursor-pointer"),style:F?{touchAction:"none"}:void 0,children:P.jsxs("span",{className:"min-w-0 flex-1",children:[P.jsxs("span",{className:"flex items-center gap-2 pr-12",children:[(X||ue)&&P.jsx(G4,{className:"text-soft-foreground shrink-0 text-sm","data-testid":ue&&!X?"variant-refining":void 0}),P.jsx(vd,{label:"Double-click to rename",disabled:J,children:P.jsx("span",{onDoubleClick:Re=>{Re.stopPropagation(),J||A(e)},className:or("min-w-0 flex-1 truncate text-sm font-medium select-text",J?"cursor-default":"cursor-text",ee||r?"text-foreground":"text-soft-foreground"),children:te})}),B&&P.jsx(vd,{label:(V==null?void 0:V.errorMessage)??(V==null?void 0:V.errorCode)??"Failed",disabled:!(V!=null&&V.errorMessage)&&!(V!=null&&V.errorCode),children:P.jsx("span",{className:"shrink-0",children:P.jsx(R3,{label:"Failed"})})}),L&&P.jsx(R3,{label:"Cancelled"})]}),he&&P.jsx("span",{className:"text-soft-foreground mt-0.5 line-clamp-2 block cursor-text text-xs leading-snug select-text",children:he})]})}),J?null:P.jsx(sne,{references:(V==null?void 0:V.references)??(q==null?void 0:q.references),source:Y?"active":"history",sessionId:(q==null?void 0:q.sessionId)??R,variantId:(q==null?void 0:q.variantId)??(V==null?void 0:V.workItemId),projectPath:D,className:d?"pl-[33px]":"pl-3"}),P.jsxs("div",{className:or("absolute top-1.5 right-2 flex items-center gap-0.5 transition-opacity duration-80 motion-reduce:transition-none","pointer-events-none opacity-0 group-hover:pointer-events-auto group-hover:opacity-100 has-[:focus-visible]:pointer-events-auto has-[:focus-visible]:opacity-100",W&&"pointer-events-auto opacity-100"),children:[P.jsx(ir,{variant:"ghost",size:"icon-compact",title:i?"Unpin direction":"Pin direction","aria-label":i?"Unpin direction":"Pin direction","aria-pressed":i,onPointerDown:Re=>Re.stopPropagation(),onKeyDown:Re=>{(Re.key!=="ArrowUp"&&Re.key!=="ArrowDown"||Re.altKey||Re.ctrlKey||Re.metaKey||Re.shiftKey)&&Re.stopPropagation()},onClick:Re=>{Re.stopPropagation(),o("button")},className:n$,children:P.jsx(_2,{weight:i?"fill":"bold"})}),P.jsx(c$,{open:W,onOpenChange:H,triggerLabel:"Direction actions",actions:[...ge?[{key:"copy-ref",label:"Copy ref",detail:ge,icon:P.jsx(Qee,{size:13,weight:"bold"}),onSelect:()=>O({text:ge,copyKind:ke?"direction_ref":"reference"})}]:[],...!ge&&ie?[{key:"copy",label:"Copy description",icon:P.jsx(Ah,{size:13,weight:"bold"}),onSelect:()=>O({text:tae({label:te,description:ie}),copyKind:"description"})}]:[],{key:"pin",label:i?"Unpin":"Pin",icon:P.jsx(_2,{size:13,weight:"bold"}),onSelect:()=>o("menu")},...J?[]:[{key:"rename",label:"Rename",icon:P.jsx(PL,{size:13,weight:"bold"}),onSelect:()=>A(e)},{key:"remove",label:"Remove",icon:P.jsx(LL,{size:13,weight:"bold"}),disabled:G,onSelect:Re=>{t.kind==="active"?E(t.variant,Re):t.kind==="past"&&C(t.entry,Re)}}]]})]})]})},u$=({initial:e,onCommit:t,onCancel:n})=>{const[r,s]=g.useState(e),i=g.useRef(!1),o=g.useCallback(u=>{u&&(u.focus(),u.select())},[]),c=u=>{i.current||(i.current=!0,u?t(r):n())};return P.jsx("input",{ref:o,type:"text",value:r,maxLength:120,"aria-label":"Rename direction",onChange:u=>s(u.target.value),onKeyDown:u=>{u.stopPropagation(),u.key==="Enter"?(u.preventDefault(),c(!0)):u.key==="Escape"&&(u.preventDefault(),c(!1))},onBlur:()=>c(!0),onClick:u=>u.stopPropagation(),onPointerDown:u=>u.stopPropagation(),className:"border-soft-foreground/40 bg-background text-foreground focus:border-soft-foreground w-full rounded border px-1.5 py-0.5 text-sm font-medium focus-visible:outline-hidden transition-colors"})},R3=({label:e})=>P.jsx("span",{className:"bg-muted text-soft-foreground shrink-0 rounded-full px-1.5 py-0.5 text-[10px] font-medium tracking-wide uppercase",children:e}),Cae=({selectedVariant:e,busy:t,onDeploy:n,onDeployCanvas:r,canShare:s,canDeploy:i,canDeployCanvas:o,canvasVariantCount:c,canvasDeployedUrl:u,deployedUrl:d})=>{const f=e?i$(e):!1,p=(t==null?void 0:t.kind)==="deploy"&&t.variantId===(e==null?void 0:e.workItemId),m=(t==null?void 0:t.kind)==="deploy-canvas",v=!i||!f||t!==null,_=o&&c>0,b=p?"Deploying…":d?"Copy link":"Share",E=m?"Sharing…":u?"Copy canvas link":"Share canvas";return P.jsxs("div",{className:"border-surface-2 bg-card flex shrink-0 items-center justify-between gap-3 border-t px-3 py-4",children:[P.jsx("div",{className:"min-w-0",children:e?P.jsxs(P.Fragment,{children:[P.jsx("div",{className:"text-foreground truncate text-sm font-medium",children:e.label.trim()||"Untitled direction"}),d?P.jsx("div",{className:"text-soft-foreground text-[11px]",children:"Deployed — share link ready"}):null]}):null}),P.jsx("div",{className:"flex shrink-0 items-center gap-2",children:s?P.jsx(sae,{primaryLabel:b,primaryIcon:d&&!p?Ah:void 0,primaryAction:()=>{e&&n(e)},isDisabled:v,isDropdownDisabled:t!==null,isLoading:p,loadingLabel:"Deploying…",dropdownAriaLabel:"More share actions",dropdownItems:_?[{label:E,icon:u&&!m?Ah:void 0,onClick:r,isDisabled:t!==null}]:[]}):null})]})},d$=()=>P.jsx("div",{"data-testid":"direction-skeleton-row","aria-hidden":"true",className:"flex w-full items-start rounded-md px-3 py-2",children:P.jsxs("span",{className:"min-w-0 flex-1",children:[P.jsxs("span",{className:"flex items-center gap-2",children:[P.jsx(G4,{className:"text-soft-foreground shrink-0 text-sm"}),P.jsx(yg,{className:"h-3.5 w-28"})]}),P.jsx("span",{className:"mt-1.5 flex",children:P.jsx(yg,{className:"h-2.5 w-full max-w-[14rem]"})})]})}),Pae=({groups:e})=>P.jsx("div",{className:"space-y-0.5",children:e.flatMap(t=>Array.from({length:Math.max(1,t.count)}).map((n,r)=>P.jsx(d$,{},`${t.requestId}-${r}`)))}),Aae=()=>P.jsx("div",{"data-testid":"direction-boot-skeletons",className:"space-y-0.5",children:Array.from({length:3}).map((e,t)=>P.jsx(d$,{},t))}),Tae=()=>P.jsxs("div",{className:"flex flex-col items-center gap-2 px-4 py-8 text-center",children:[P.jsx("div",{className:"text-foreground text-sm",children:"No directions yet"}),P.jsx("div",{className:"text-soft-foreground text-xs",children:"They’ll appear here as they generate."})]}),I3="Try different ways to create a dropdown that feels fluid and dynamic",Rae=({isMCPSession:e=!1,mcpEditor:t=null})=>{const[n,r]=g.useState(!1),s=eae(t),i=e?s:"your coding agent",o=()=>{navigator.clipboard.writeText(I3).then(()=>{r(!0),setTimeout(()=>r(!1),2e3)})};return P.jsxs("div",{className:"flex flex-col items-start gap-3 px-2 py-2",children:[P.jsx("p",{className:"text-foreground text-sm font-medium",children:"Create your first direction"}),P.jsxs("p",{className:"text-soft-foreground text-xs",children:["Use ",i," to generate directions."]}),P.jsxs("div",{className:"w-full",children:[P.jsx("p",{className:"text-soft-foreground mb-2 text-xs",children:"Here's a sample prompt to use:"}),P.jsxs("div",{className:"border-surface-2 bg-muted relative rounded-md border px-3 py-2.5 pr-9",children:[P.jsxs("p",{className:"text-soft-foreground text-xs leading-snug",children:["“",I3,"”"]}),P.jsx(ir,{variant:"ghost",size:"icon-compact",onClick:o,"aria-label":"Copy sample prompt",title:"Copy to clipboard",className:"absolute top-1 right-1",children:n?P.jsx(Kee,{"data-testid":"sample-prompt-copied",className:"text-accent-success",weight:"bold"}):P.jsx(Ah,{weight:"bold"})})]})]})]})},Iae="Open Rivet",U2="Close Rivet",Oae=(e,t)=>{const n=new URL(e),r=oa.safeParse(t);return n.searchParams.set("runtime",r.success?r.data:"unknown"),n.toString()},Mae=".",Nae=229,Lae=/Mac|iPhone|iPad|iPod/,$ae={ariaKeyShortcuts:"Meta+.",modifier:"metaKey"},Dae={ariaKeyShortcuts:"Control+.",modifier:"ctrlKey"},oS=()=>typeof navigator<"u"&&Lae.test(navigator.platform)?$ae:Dae,Fae=e=>{const{modifier:t}=oS();return e.key===Mae&&!e.isComposing&&e.keyCode!==Nae&&e.metaKey===(t==="metaKey")&&e.ctrlKey===(t==="ctrlKey")&&!e.altKey&&!e.shiftKey},jae="rivet:show-projects",zae=e=>{const t=new URLSearchParams(e),n=t.get("libraryOrigin");if(t.get("library")!=="1"||!n)return null;try{const r=new URL(n);return r.protocol!=="http:"&&r.protocol!=="https:"?null:r.origin}catch{return null}},Vae=({onClose:e,libraryOrigin:t})=>{const n=Ms(),r=vt(z4),s=vt(rv),i=vt(iv),o=zae(window.location.search),c=window.parent!==window&&o!==null,u=(s==null?void 0:s.split(/[\\/]/).filter(Boolean).pop())??"Project";if(!e)return null;let d=r?P.jsx("span",{className:"text-foreground min-w-0 truncate text-sm font-medium",title:r,children:r}):P.jsx("span",{});if(c||t){const p=P.jsxs("ol",{className:"flex min-w-0 items-center gap-1 text-xs",children:[P.jsx("li",{className:"shrink-0",children:P.jsx("button",{type:"button",onClick:async()=>{if(c&&o)window.parent.postMessage(jae,o);else{try{const m=await Dt("/api/library/browser-launches",{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({view:"projects"})});if(!m.ok)throw new Error("The project library could not be opened.");const{url:v}=yK.parse(await m.json());window.location.assign(Oae(v,i))}catch{rn.error("Could not open the project library. Please try again.");return}n==null||n.capture("library_view_changed",{view:"projects"})}},className:"text-muted-foreground hover:bg-muted hover:text-foreground focus-visible:bg-muted focus-visible:text-foreground rounded px-1 py-1 transition-colors focus-visible:outline-hidden",children:"Projects"})}),P.jsx("li",{"aria-hidden":!0,className:"text-muted-foreground shrink-0",children:P.jsx(Bee,{className:"h-3 w-3"})}),P.jsx("li",{className:"min-w-0",children:P.jsx("span",{"aria-current":"page",title:u,className:"text-foreground block truncate font-medium",children:u})})]});d=P.jsx("nav",{"aria-label":"Project breadcrumb",className:"ph-no-capture min-w-0 flex-1","data-rivet-private":!0,children:p})}const f=oS();return P.jsxs("div",{className:"border-surface-2 bg-card z-10 flex flex-shrink-0 items-center justify-between gap-2 border-b px-2.5 py-2.5",children:[d,P.jsx(vd,{label:U2,side:"bottom",children:P.jsx(ir,{variant:"ghost",size:"icon-compact",onClick:e,"aria-label":U2,"aria-keyshortcuts":f.ariaKeyShortcuts,className:"shrink-0",children:P.jsx(Jee,{weight:"bold"})})})]})},Hae=ze({agentModeAvailable:Ts(),email:re().optional(),userId:re().optional(),name:re().optional(),isMCPSession:Ts(),mcpEditor:re().nullable(),agentApplyMode:zt(["embedded","external"]).nullable().optional(),queueAccessToken:re().nullable().optional(),projectPath:re(),projectName:re().optional(),projectId:re().uuid().nullable().optional(),libraryOrigin:re().url().nullable()}),f$=async({signal:e})=>{const t=await Dt("/api/config",{signal:e});if(!t.ok)throw new Error(`Failed to fetch config: ${t.statusText}`);return Hae.parse(await t.json())},h$=5e3,Uae=async({signal:e})=>{const t=await Dt("/api/account",{signal:e});if(!t.ok)throw new Error("Could not load your account.");return bK.parse(await t.json())},Zae=e=>({isAuthenticated:e.agentModeAvailable,name:e.name,email:e.email,userId:e.userId}),Bae=e=>Vi({queryKey:yr.account,queryFn:Uae,enabled:e,refetchInterval:h$,retry:!1}),Wae=e=>Vi({queryKey:yr.rivetConfig,queryFn:f$,select:Zae,enabled:e,refetchInterval:h$,retry:!1}),Kae=()=>{const e=window.location.pathname.startsWith("/rivet/library"),t=Bae(e),n=Wae(!e);return e?t:n},wg="rivet_just_signed_in",Z2="https://rivet-proxy.onrender.com",Gae=e=>{const t=e.toLowerCase();return t.includes("timed out")?"timeout":t.includes("pop-up blocked")?"popup_blocked":t.includes("window was closed")?"popup_closed":t.includes("store session")?"credential_store_failed":"provider_failed"},b_=({outcome:e,authAttemptId:t,startedAt:n,now:r,failureReason:s,entryPoint:i="editor_gate"})=>({event:`visual_editor_auth_${e}`,properties:{auth_attempt_id:t,duration_ms:r-n,entry_point:i,method:"google_oauth",...s?{failure_reason:s}:{}}}),O3=Ls("useLogin"),qae=2e3,Yae=60,M3="Connecting to Google...",Qae=`<!doctype html>
|
|
171
|
+
<html lang="en">
|
|
172
|
+
<head>
|
|
173
|
+
<meta charset="utf-8" />
|
|
174
|
+
<meta name="viewport" content="width=device-width, initial-scale=1" />
|
|
175
|
+
<title>${M3}</title>
|
|
176
|
+
<style>
|
|
177
|
+
:root { color-scheme: light dark; }
|
|
178
|
+
body {
|
|
179
|
+
margin: 0;
|
|
180
|
+
min-height: 100vh;
|
|
181
|
+
display: grid;
|
|
182
|
+
place-items: center;
|
|
183
|
+
font-family: Inter, system-ui, -apple-system, Segoe UI, sans-serif;
|
|
184
|
+
background: #111215;
|
|
185
|
+
color: #f3f4f6;
|
|
186
|
+
}
|
|
187
|
+
.panel {
|
|
188
|
+
border: 1px solid rgba(255, 255, 255, 0.16);
|
|
189
|
+
border-radius: 12px;
|
|
190
|
+
padding: 18px 22px;
|
|
191
|
+
background: rgba(255, 255, 255, 0.06);
|
|
192
|
+
font-size: 14px;
|
|
193
|
+
}
|
|
194
|
+
</style>
|
|
195
|
+
</head>
|
|
196
|
+
<body>
|
|
197
|
+
<div class="panel">${M3}</div>
|
|
198
|
+
</body>
|
|
199
|
+
</html>`,Xae=ze({success:Ts(),authUrl:re().optional(),sessionId:re().optional(),pollSecret:re().optional(),error:re().optional(),message:re().optional()}),Jae=ze({success:Ts(),token:re().optional(),refreshToken:re().optional(),user:ze({id:re().optional(),email:re().optional()}).optional(),error:re().optional(),message:re().optional()}),ele="/api/auth/install-ref",tle=ze({installRef:re().nullable()}),nle=async()=>{try{const e=await fetch(ele);if(!e.ok)return;const t=tle.safeParse(await e.json());return t.success?t.data.installRef??void 0:void 0}catch{return}},p$=(e="editor_gate",t)=>{const n=Ms(),[r,s]=g.useState(!1),[i,o]=g.useState(null);return{startLogin:g.useCallback(async()=>{var m;const u=globalThis.crypto.randomUUID(),d=Date.now();s(!0),o(null);const f=b_({outcome:"started",authAttemptId:u,entryPoint:e,startedAt:d,now:d});n==null||n.capture(f.event,f.properties);let p=null;try{if(p=window.open("","_blank"),!p)throw new Error("Pop-up blocked. Please allow pop-ups and try again.");try{p.document.open(),p.document.write(Qae),p.document.close()}catch(S){O3.warn("Failed to render loading state in auth popup:",S)}const v=await nle(),_=await fetch(`${Z2}/api/auth/google/start`,{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({source:"core",...v?{ref:v}:{}})}),w=Xae.safeParse(await _.json());if(!w.success)throw new Error("Invalid Google login response");const b=w.data;if(!_.ok||!b.success||!b.authUrl||!b.sessionId||!b.pollSecret)throw new Error(b.error||b.message||"Failed to start Google login");if(p.closed)throw new Error("Sign-in window was closed before Google login started.");p.location.href=b.authUrl;for(let S=0;S<Yae;S+=1){if(p.closed)throw new Error("Sign-in window was closed before authentication completed.");const E=await fetch(`${Z2}/api/auth/google/token`,{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({session:b.sessionId,pollSecret:b.pollSecret})}),C=Jae.safeParse(await E.json());if(!C.success)throw new Error("Invalid Google token response");const A=C.data;if(A.success&&A.token&&((m=A.user)!=null&&m.email)){const T={email:A.user.email,token:A.token,refreshToken:A.refreshToken,userId:A.user.id,...v?{installRef:v}:{}};if(t)await t(T);else if(!(await Dt("/api/auth/store",{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify(T)})).ok)throw new Error("Signed in, but failed to store session locally.");p.close(),window.sessionStorage.setItem(wg,"1");const M=b_({outcome:"completed",authAttemptId:u,entryPoint:e,startedAt:d,now:Date.now()});n==null||n.capture(M.event,M.properties),window.location.reload();return}if(A.error&&A.error!=="Pending")throw new Error(A.error||"Google login failed");await new Promise(T=>setTimeout(T,qae))}throw new Error("Authentication timed out. Please try again.")}catch(v){p&&!p.closed&&p.close();const _=ts(v,"Failed to start login flow");O3.warn("Login failed:",_);const w=b_({outcome:"failed",authAttemptId:u,entryPoint:e,startedAt:d,now:Date.now(),failureReason:Gae(_)});n==null||n.capture(w.event,w.properties),o(_),s(!1)}},[n,e,t]),isStartingLogin:r,loginError:i}},rle=Ls("useIntegrations"),sle=ze({provider:re(),status:re(),externalUsername:re().nullable(),connectedAt:re()}),ile=ze({integrations:At(sle).optional()}),ole=ze({authUrl:re().min(1).optional(),error:re().optional()}),ale="rivet:connect-result",lle=e=>typeof e=="object"&&e!==null&&e.type===ale,cle=on(null),N3=async()=>{const e=await Dt("/api/integrations");if(!e.ok)throw new Error(`Failed to load integrations (${e.status})`);return ile.parse(await e.json()).integrations??[]},ule=async e=>{const t=await Dt(`/api/integrations/${e}`,{method:"DELETE"});if(!t.ok){const n=eM.safeParse(await t.json().catch(()=>({})));throw new Error(n.success&&n.data.error||`Could not disconnect ${e}`)}},dle=()=>{const e=kd(),[t,n]=hL(cle),r=Vi({queryKey:yr.integrations,queryFn:N3,staleTime:1e4}),s=g.useCallback(async()=>(await e.invalidateQueries({queryKey:yr.integrations,refetchType:"none"}),e.fetchQuery({queryKey:yr.integrations,queryFn:N3})),[e]),i=g.useCallback(async u=>{const d=window.open("","_blank","width=560,height=720");if(!d)throw new Error("Popup blocked. Allow popups to connect.");n(u);try{const f=await Dt(`/api/integrations/${u}/connect`,{method:"POST"}),p=ole.safeParse(await f.json().catch(()=>({}))),m=p.success?p.data:{};if(!f.ok||!m.authUrl)throw d.close(),new Error(m.error||`Could not connect ${u}`);return d.location.href=m.authUrl,await new Promise(v=>{let _=!1,w=null;const b=async(E,C=!1)=>{if(!_){_=!0,window.removeEventListener("message",S),w&&clearInterval(w);try{const T=(await s()).some(M=>M.provider===u&&M.status==="connected");v(C&&T?"connected":E)}catch{v(E)}}},S=E=>{if(lle(E.data)&&E.data.provider===u){if(E.data.status==="error"){rle.warn(`Connect failed for ${u}:`,E.data.message),b("failed");return}b("connected")}};window.addEventListener("message",S),w=setInterval(()=>{d.closed&&b("closed",!0)},500)})}finally{n(null)}},[s,n]),{mutateAsync:o}=Ng({mutationFn:ule,onSuccess:s}),c=g.useCallback(async u=>{n(u);try{await o(u)}finally{n(null)}},[o,n]);return{integrations:r.data??[],isLoading:r.isPending,error:r.error instanceof Error?r.error.message:null,pendingProvider:t,connect:i,disconnect:c,refetch:s}},pu=({action:e,outcome:t,provider:n,entryPoint:r,durationMs:s,failureReason:i})=>({event:`visual_editor_reference_${e==="connect"?"connection":"disconnection"}_${t}`,properties:{provider:n,entry_point:r,...s!==void 0?{duration_ms:s}:{},...i?{failure_reason:i}:{}}}),fle=["pinterest","arena","x"],hle=({integrations:e,profileSources:t})=>{const n=fle.filter(r=>e.some(s=>s.provider===r&&s.status==="connected"));return t.some(r=>r.provider==="cosmos")&&n.push("cosmos"),n.sort()},Xh=async(e,{schema:t,method:n="GET",body:r,signal:s})=>{if(window.location.pathname.startsWith("/rivet/library"))return CK(e,{schema:t,method:n,body:r,signal:s});const i=await Dt(e.replace(/^\/profile/,"/api/reference-profiles"),{method:n,signal:s,headers:{"Content-Type":"application/json"},...r!==void 0?{body:JSON.stringify(r)}:{}});return aM(i,t)},aS=()=>Xh("/profile",{schema:tM}),ple=e=>Vi({queryKey:yr.referenceProfile,queryFn:aS,enabled:e}),mle=(e,t)=>Xh("/profile/discoveries",{schema:wK,method:"POST",body:e,signal:t}),gle=({discoveryId:e,collectionIds:t,runtime:n})=>Xh("/profile/import-plans",{schema:nM,method:"POST",body:{discoveryId:e,collectionIds:t,runtime:n}}),vle=e=>Xh("/profile",{schema:tM,method:"PATCH",body:{isEnabled:!0,runtime:e}}),yle=e=>Xh(`/profile/import-plans/${e.id}/imports`,{schema:nM,method:"POST",body:{revision:e.revision,isApproved:!0}}),_le=0,wle=(e,t)=>e!=="cosmos"?{provider:e}:t?{url:t}:null,ble=(e,t)=>{const n=Ms(),r=g.useId(),s=wle(e,t);return Vi({queryKey:yr.referenceDiscovery({viewId:r,source:s}),enabled:s!==null,retry:!1,staleTime:1/0,gcTime:_le,refetchOnWindowFocus:!1,refetchOnReconnect:!1,queryFn:async({signal:i})=>{if(!s)throw new Error("Choose a reference source first.");n==null||n.capture("visual_editor_reference_discovery_started",{provider:e});try{const o=await mle(s,i);return"status"in o?n==null||n.capture("visual_editor_reference_discovery_failed",{provider:e}):n==null||n.capture("visual_editor_reference_discovery_completed",{provider:e,collection_count:o.collections.length}),o}catch(o){throw i.aborted||n==null||n.capture("visual_editor_reference_discovery_failed",{provider:e}),o}}})},xle={cosmos:{name:"Cosmos",collection:"collection",collections:"collections"},pinterest:{name:"Pinterest",collection:"board",collections:"boards"},arena:{name:"Are.na",collection:"channel",collections:"channels"},x:{name:"X",collection:"collection",collections:"collections"}},Sle=e=>{const{isOpen:t,onClose:n,onImported:r,provider:s}=e,i=xle[s],[o,c]=g.useState(""),[u,d]=g.useState(null),[f,p]=g.useState([]),m=vt(iv),v=oa.safeParse(m),_=v.success?v.data:null,[w,b]=g.useState(null),S=(w==null?void 0:w.plan)??null,[E,C]=g.useState(null),[A,T]=g.useState(!1),M=g.useRef(0),O=Ms(),R=Ng({mutationFn:async({plan:te,runtime:ie})=>{(await aS()).profile.isEnabled||await vle(ie),await yle(te)},onSuccess:(te,{plan:ie})=>{O==null||O.capture("visual_editor_reference_import_accepted",{provider:s,reference_count:ie.referenceCount}),r(),rn.success("Import queued",{description:"Check References as your import is processed."})},onError:()=>O==null?void 0:O.capture("visual_editor_reference_import_failed",{provider:s})}),D=ble(s,u),U=D.data,W=U&&!("status"in U)?U:null,H=!!(D.isSuccess&&U&&"status"in U),Y=A||D.isFetching||R.isPending,J=D.error?ts(D.error,`Could not find ${i.collections}`):null,V=H?`Reconnect ${i.name} to choose your ${i.collections}.`:null,q=E??J??V,ee=()=>{M.current+=1,c(""),d(null),p([]),b(null),C(null),T(!1),R.reset()},F=()=>{O==null||O.capture("visual_editor_reference_import_modal_closed",{provider:s}),ee(),n()},X=async te=>{te.preventDefault(),C(null);try{const ie=Db(o.trim()).url;u===ie?await D.refetch():d(ie)}catch(ie){C(ts(ie,"Invalid Cosmos profile URL"))}},B=async()=>{if(e.provider==="cosmos")return;const te=++M.current;C(null),T(!0);try{const ie=await e.onReconnect();if(te!==M.current)return;ie?await D.refetch():C("Connection was not completed. Try again.")}catch(ie){te===M.current&&C(ts(ie,"Could not reconnect. Try again."))}finally{te===M.current&&T(!1)}},L=async()=>{if(!W||f.length===0||!_)return;C(null),O==null||O.capture("visual_editor_reference_plan_started",{provider:s,collection_count:f.length,runtime:_});const te=++M.current;T(!0);try{const ie=await gle({discoveryId:W.id,collectionIds:f,runtime:_});if(te!==M.current)return;b({plan:ie,runtime:_}),O==null||O.capture("visual_editor_reference_plan_completed",{provider:s,collection_count:ie.collectionCount,reference_count:ie.referenceCount})}catch(ie){if(te!==M.current)return;C(ts(ie,"Could not prepare import plan")),O==null||O.capture("visual_editor_reference_plan_failed",{provider:s})}finally{te===M.current&&T(!1)}},G=()=>{if(!w)return;const te=w.plan;C(null),O==null||O.capture("visual_editor_reference_import_started",{provider:s,collection_count:te.collectionCount,reference_count:te.referenceCount}),R.mutate(w,{onSuccess:()=>{ee(),n()},onError:ie=>C(ts(ie,"Could not start import"))})},ue=te=>{p(ie=>ie.includes(te)?ie.filter(he=>he!==te):[...ie,te]),b(null),O==null||O.capture("visual_editor_reference_collection_toggled",{provider:s})};return P.jsx(ev,{open:t,onOpenChange:te=>{te||F()},children:P.jsxs(tv,{isStacked:!0,"aria-describedby":void 0,onCloseAutoFocus:()=>{M.current+=1},className:"max-h-[min(680px,calc(100vh-32px))] w-[min(440px,calc(100vw-32px))] overflow-y-auto",children:[P.jsx(Qx,{onClose:F,children:P.jsxs("span",{className:"flex items-center gap-2",children:[P.jsx(Lu,{provider:s,className:"size-5 flex-none"}),P.jsxs("span",{children:["Import from ",i.name]})]})}),P.jsxs("div",{className:"space-y-4 p-4",children:[!W&&s==="cosmos"?P.jsxs("form",{onSubmit:te=>void X(te),className:"space-y-4",children:[P.jsx("label",{className:"text-foreground block text-sm font-medium",htmlFor:"cosmos-profile-url",children:"Cosmos profile URL"}),P.jsx("input",{id:"cosmos-profile-url",type:"url",required:!0,autoFocus:!0,value:o,onChange:te=>c(te.target.value),placeholder:"https://www.cosmos.so/username",className:"border-surface-2 bg-muted text-foreground placeholder:text-soft-foreground hover:border-soft-foreground/50 focus-visible:border-soft-foreground w-full rounded-md border px-3 py-2 text-sm transition-colors focus-visible:outline-hidden motion-reduce:transition-none"}),P.jsx(ir,{type:"submit",variant:"secondary",disabled:Y,children:D.isFetching?"Finding collections…":"Find collections"})]}):null,!W&&s!=="cosmos"?P.jsxs("div",{className:"space-y-3",children:[Y||!q?P.jsxs("p",{role:"status",className:"text-muted-foreground text-sm",children:["Finding ",i.collections,"…"]}):null,q?P.jsx(ir,{variant:"secondary",disabled:Y,onClick:()=>{H?B():D.refetch()},children:H?`Reconnect ${i.name}`:"Try again"}):null]}):null,W?P.jsxs("div",{className:"space-y-4",children:[P.jsxs("p",{className:"text-foreground text-sm font-medium",children:["Choose ",i.collections," from"," ",W.profile.title||W.profile.username]}),W.collections.length>0?P.jsx("div",{className:"border-surface-2 has-[:focus-visible]:border-soft-foreground max-h-60 divide-y overflow-y-auto rounded-md border transition-colors motion-reduce:transition-none",children:W.collections.map(te=>P.jsxs("label",{className:"text-foreground hover:bg-card has-[:focus-visible]:bg-active flex cursor-pointer items-center gap-3 px-3 py-2 text-sm transition-colors motion-reduce:transition-none",children:[P.jsx("input",{type:"checkbox",className:"focus-visible:outline-hidden",checked:f.includes(te.id),disabled:Y||S!==null,onChange:()=>ue(te.id)}),P.jsx("span",{className:"min-w-0 flex-1 truncate",children:te.title})]},te.id))}):null,W.collections.length===0?P.jsxs("p",{className:"text-soft-foreground text-sm",children:["No ",i.collections," available to import from this profile."]}):null,W.collections.length>0&&!S?P.jsxs(P.Fragment,{children:[P.jsxs("p",{className:"text-soft-foreground text-xs",role:"status",children:[f.length===0?"Select content to continue.":`${f.length} selected`,_?null:" Open Rivet from Codex, Claude, or Cursor to import references."]}),P.jsxs("div",{className:"flex items-center gap-2",children:[P.jsx(ir,{variant:"secondary",onClick:()=>void L(),disabled:Y||f.length===0||!_,children:A?"Preparing plan…":"Review selection"}),P.jsx(ir,{variant:"ghost",onClick:()=>{s==="cosmos"?(O==null||O.capture("visual_editor_reference_profile_changed",{provider:s}),ee()):F()},disabled:Y,children:s==="cosmos"?"Use another profile":"Back"})]})]}):null,W.collections.length===0?P.jsx(ir,{variant:"ghost",onClick:()=>{s==="cosmos"?ee():F()},children:s==="cosmos"?"Use another profile":"Back"}):null]}):null,S?P.jsxs("div",{className:"space-y-4 text-sm",children:[P.jsxs("p",{className:"text-foreground",children:[S.collectionCount," ",S.collectionCount===1?i.collection:i.collections," ","· ",S.referenceCount," ",S.referenceCount===1?"reference":"references"]}),P.jsxs("div",{className:"flex items-center gap-2",children:[P.jsx(ir,{variant:"secondary",onClick:()=>void G(),disabled:Y,children:R.isPending?"Starting import…":`Import ${S.referenceCount} ${S.referenceCount===1?"reference":"references"}`}),P.jsx(ir,{variant:"ghost",onClick:()=>{O==null||O.capture("visual_editor_reference_plan_revised",{provider:s}),b(null),C(null)},disabled:Y,children:"Edit selection"})]})]}):null,q?P.jsx("p",{role:"alert",className:"text-muted-foreground text-sm",children:q}):null]})]})})},Ele=e=>e.isOpen?P.jsx(Sle,{...e},e.provider):null,L3=Ls("ConnectorsModal");let x_=0;const kle=[{provider:"x",name:"X",icon:P.jsx(Lu,{provider:"x"})},{provider:"pinterest",name:"Pinterest",icon:P.jsx(Lu,{provider:"pinterest"})},{provider:"arena",name:"Are.na",icon:P.jsx(Lu,{provider:"arena"})}],Cle={name:"Cosmos",icon:P.jsx(Lu,{provider:"cosmos"})},$3=({meta:e,status:t,action:n,actionLabel:r,buttonLabel:s,isDisabled:i,isHighlighted:o,onAction:c})=>P.jsxs("li",{className:`flex min-h-[64px] items-center gap-3 py-3 ${o?"ring-secondary -mx-2 rounded-md px-2 ring-2":""}`,children:[P.jsx("span",{className:"text-foreground grid h-7 w-7 flex-none place-items-center","aria-hidden":"true",children:e.icon}),P.jsxs("div",{className:"min-w-0 flex-1",children:[P.jsx("span",{className:"text-foreground block text-sm font-medium",children:e.name}),P.jsx("span",{className:"text-soft-foreground block truncate text-xs",children:t})]}),P.jsx(ir,{variant:n==="Connect"?"tertiary":"secondary",size:"compact","aria-label":r,onClick:c,disabled:i,className:"w-24 flex-none",children:s})]}),Ple=({isOpen:e,onClose:t,context:n="menu",highlightProvider:r=null})=>{var q;const{integrations:s,isLoading:i,error:o,pendingProvider:c,connect:u,refetch:d}=dle(),f=Ms(),[p,m]=g.useState(null),[v,_]=g.useState(null),w=v||o,b=ple(e),S=kd(),E=g.useRef(null),C=()=>{R.reset(),m(null),_(null)},A=()=>{C(),t()},T=ee=>s.find(F=>F.provider===ee),M=g.useCallback(async()=>{const ee=++x_;try{const[F,X]=await Promise.all([d(),S.cancelQueries({queryKey:yr.referenceProfile}).then(()=>S.fetchQuery({queryKey:yr.referenceProfile,queryFn:aS}))]);if(ee!==x_)return;f==null||f.setPersonProperties({connected_providers:hle({integrations:F,profileSources:X.sources})})}catch(F){if(ee!==x_)return;L3.warn("Connected providers unavailable:",ts(F,"Could not read connection status."))}},[f,S,d]),O=g.useCallback(ee=>{const F=Date.now(),X=pu({action:"connect",outcome:"started",provider:ee,entryPoint:n});return f==null||f.capture(X.event,X.properties),u(ee).then(B=>{const L=Date.now()-F;if(B==="connected"){const ue=pu({action:"connect",outcome:"completed",provider:ee,entryPoint:n,durationMs:L});return f==null||f.capture(ue.event,ue.properties),M(),!0}const G=pu({action:"connect",outcome:"failed",provider:ee,entryPoint:n,durationMs:L,failureReason:B==="closed"?"popup_closed":"provider_failed"});return f==null||f.capture(G.event,G.properties),!1}).catch(B=>{const L=ts(B,"Could not connect."),G=pu({action:"connect",outcome:"failed",provider:ee,entryPoint:n,durationMs:Date.now()-F,failureReason:L.includes("Popup blocked")?"popup_blocked":"request_failed"});throw f==null||f.capture(G.event,G.properties),L3.warn(`Connect error for ${ee}:`,L),B})},[u,n,f,M]),R=Ng({mutationFn:O}),D=g.useCallback(()=>{E.current=Date.now();const ee=pu({action:"connect",outcome:"started",provider:"cosmos",entryPoint:n});f==null||f.capture(ee.event,ee.properties)},[n,f]),U=(ee,F)=>{_(null);const X=()=>{f==null||f.capture("visual_editor_reference_import_modal_opened",{provider:ee}),m(ee)};if(ee==="cosmos"&&D(),ee==="cosmos"||F){X();return}R.mutate(ee,{onSuccess:B=>{B?X():_("Connection was not completed. Try again.")},onError:B=>_(ts(B,"Could not connect."))})},W=()=>{const ee=pu({action:"connect",outcome:"completed",provider:"cosmos",entryPoint:n,...E.current===null?{}:{durationMs:Date.now()-E.current}});f==null||f.capture(ee.event,ee.properties),M()},H=n==="onboarding";let J=((q=b.data)==null?void 0:q.sources.some(ee=>ee.provider==="cosmos"))?"Profiles added":"Public profiles · No sign-in needed";b.isError&&(J="Status unavailable"),b.isPending&&(J="Checking status…");const V=p&&p!=="cosmos"?{provider:p,onReconnect:()=>O(p)}:{provider:"cosmos"};return P.jsxs(P.Fragment,{children:[P.jsx(ev,{open:e,onOpenChange:ee=>{ee||A()},children:P.jsxs(tv,{className:"w-[min(440px,calc(100vw-32px))]",children:[P.jsx(Qx,{onClose:A,children:"Add references"}),P.jsxs("div",{className:"flex flex-col gap-4 p-4",children:[P.jsx(Yx,{className:"text-muted-foreground text-sm",children:"Choose a source, then select and review what to import."}),w?P.jsxs("p",{role:"alert",className:"bg-surface-3 text-muted-foreground flex items-center gap-2 rounded-lg px-4 py-3 text-[13px] font-medium",children:[P.jsx(FL,{"aria-hidden":!0,className:"text-muted-foreground size-4 shrink-0"}),w]}):null,P.jsxs("ul",{className:"divide-surface-2 divide-y","aria-label":"Design reference services",children:[kle.map(ee=>{const F=T(ee.provider),X=(F==null?void 0:F.status)==="connected",B=F==null?void 0:F.externalUsername;let L=X?`Connected${B?` as @${B}`:""}`:"Not connected";i&&(L="Checking status…"),o&&(L="Status unavailable");const G=c===ee.provider,ue=X?"Import":"Connect";let te=ue;return G&&(te="Connecting…"),P.jsx($3,{meta:ee,status:L,action:ue,actionLabel:X?`Import from ${ee.name}`:`Connect ${ee.name}`,buttonLabel:te,isDisabled:i||c!==null,isHighlighted:r===ee.provider,onAction:()=>U(ee.provider,X)},ee.provider)}),P.jsx($3,{meta:Cle,status:J,action:"Import",actionLabel:"Import from Cosmos",buttonLabel:"Import",isDisabled:c!==null,isHighlighted:!1,onAction:()=>{U("cosmos",!0)}})]}),H?P.jsxs("div",{className:"flex items-center justify-between gap-4",children:[P.jsx("p",{className:"text-muted-foreground text-xs",children:"You can always do this later from the account menu."}),P.jsx(ir,{variant:"secondary",onClick:A,className:"flex-none",children:"Skip for now"})]}):null]})]})}),e&&p?P.jsx(Ele,{...V,isOpen:!0,onClose:()=>m(null),onImported:()=>{p==="cosmos"?W():b.refetch(),S.invalidateQueries({queryKey:yr.designLibraryAll}),S.invalidateQueries({queryKey:yr.designReferenceSearchAll})}}):null]})},B2=e=>e.isOpen?P.jsx(Ple,{...e}):null,Ale=Ls("SupportTicketModal"),D3=5e3,S_="feedback",Tle=e=>{var r;if(!e)return null;const t=(r=e.formErrors)==null?void 0:r[0];if(t)return t;const n=e.fieldErrors??{};for(const s of Object.values(n)){const i=s==null?void 0:s[0];if(i)return i}return null},Rle=async e=>{let t;try{const n=gK.safeParse(await e.json());t=n.success?n.data:void 0}catch{t=void 0}if(e.status===400){if(typeof(t==null?void 0:t.details)=="string"&&t.details.trim())return t.details;if(typeof(t==null?void 0:t.details)=="object"&&t.details!==null){const n=Tle(t.details);if(n)return n}return"Please check your feedback and try again."}return e.status>=500?typeof(t==null?void 0:t.details)=="string"&&t.details.trim()?t.details:"Could not send feedback right now. Please try again later.":typeof(t==null?void 0:t.error)=="string"&&t.error.trim()?t.error:`HTTP ${e.status}`},Ile=({isOpen:e,onClose:t,contactEmail:n})=>{const r=Ms(),[s,i]=g.useState(""),[o,c]=g.useState(!1),u=g.useCallback(()=>{i("")},[]),d=g.useCallback(()=>{o||(u(),t())},[o,t,u]),f=g.useCallback(async()=>{const _=s.trim();if(!(!_||o)){c(!0);try{const w=typeof(r==null?void 0:r.get_session_id)=="function"?r.get_session_id():void 0,b=typeof(r==null?void 0:r.get_distinct_id)=="function"?r.get_distinct_id():void 0,S=n==null?void 0:n.trim(),E=await Dt("/api/support/tickets",{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({type:S_,message:_,contactEmail:S||void 0,metadata:{posthogSessionId:w??void 0,posthogDistinctId:b??void 0,appVersion:"0.28.3",appEnvironment:"production",pageUrl:window.location.href,userAgent:navigator.userAgent,submittedAt:new Date().toISOString()}})});if(!E.ok){const C=await Rle(E);throw new Error(C)}r==null||r.capture("support_ticket_submitted",{ticket_type:S_,has_posthog_session_id:!!w}),rn.success("Feedback sent",{description:"Thanks for sharing this."}),u(),t()}catch(w){const b=ts(w,"Failed to send message");r==null||r.capture("support_ticket_submit_failed",{ticket_type:S_,error:b}),Ale.error("Failed to submit support ticket:",b),rn.error("Could not send feedback",{description:b})}finally{c(!1)}}},[n,o,s,t,r,u]),p=g.useCallback(_=>{_.key==="Enter"&&(_.metaKey||_.ctrlKey)&&(_.preventDefault(),f())},[f]),m=D3-s.length,v=o||s.trim().length===0;return P.jsx(ev,{open:e,onOpenChange:_=>!_&&d(),children:P.jsxs(tv,{className:"w-[440px]",children:[P.jsx(Qx,{onClose:d,isCloseDisabled:o,children:"Send feedback"}),P.jsxs("div",{className:"flex flex-col gap-3 p-4",children:[P.jsx(Yx,{className:"text-muted-foreground text-sm",children:"Tell us what happened or what we can improve."}),P.jsxs("div",{className:"bg-muted rounded-lg border border-transparent transition-colors focus-within:border-soft-foreground forced-colors:focus-within:outline-2 forced-colors:focus-within:outline-solid",children:[P.jsx("textarea",{id:"support-ticket-message","aria-label":"Your feedback",value:s,onChange:_=>i(_.target.value),onKeyDown:p,maxLength:D3,rows:6,disabled:o,placeholder:"What happened?",className:"text-foreground placeholder-muted-foreground max-h-64 w-full resize-none overflow-y-auto bg-transparent pt-3 pr-3 pb-1 pl-3 text-sm focus:outline-none disabled:opacity-50"}),P.jsxs("div",{className:"flex items-center justify-between px-3 pt-1 pb-3",children:[P.jsx("span",{className:"text-muted-foreground text-xs",children:"Context details are included automatically."}),P.jsxs("div",{className:"flex items-center gap-2",children:[m<=500&&P.jsx("span",{className:"text-muted-foreground text-xs",children:m}),P.jsx(ir,{onClick:f,disabled:v,title:"Send feedback",shortcut:"⌘↵","aria-label":"Send feedback",variant:"primary",size:"icon-compact",children:o?P.jsx(Cx,{className:"h-5 w-5 animate-spin",weight:"bold"}):P.jsx(Uee,{className:"h-5 w-5",weight:"bold"})})]})]})]})]})]})})},Ole=Ls("ProfileAvatar"),m$=(e,t)=>{const n=(e??"").trim();if(n)return n.split(/\s+/).filter(Boolean)[0]??"";const s=((t??"").split("@")[0]??"").split(/[._\-+]/).filter(Boolean)[0]??"";return s?s[0].toUpperCase()+s.slice(1):""},Mle=(e,t)=>m$(e,t).charAt(0).toUpperCase(),Nle=({className:e="",side:t="bottom",align:n="end"})=>{var W,H,Y;const r=Kae(),s=((W=r.data)==null?void 0:W.name)??null,i=((H=r.data)==null?void 0:H.email)??null,o=((Y=r.data)==null?void 0:Y.isAuthenticated)===!0,c=Ms(),{startLogin:u,isStartingLogin:d,loginError:f}=p$("account_menu"),[p,m]=g.useState(!1),[v,_]=g.useState(null),w=g.useRef(null),b=g.useRef(null),[S,E]=g.useState(!1),C=Mle(s,i);if(r.isPending)return P.jsxs("span",{"data-testid":"profile-avatar-skeleton","aria-hidden":"true",className:`flex shrink-0 items-center gap-2 ${e}`.trim(),children:[P.jsx(yg,{className:"h-8 w-8 rounded-full"}),P.jsx(yg,{className:"h-3.5 w-16"})]});const A=m$(s,i),T=(s==null?void 0:s.trim())||null,M=(i==null?void 0:i.trim())||null,O=async()=>{E(!0);try{const J=await Dt("/api/auth/logout",{method:"POST",credentials:"same-origin"});if(!J.ok)throw new Error(`Logout failed: ${J.status}`);window.location.pathname.startsWith("/rivet/library")&&iM()}catch(J){Ole.warn("Logout request failed",J),rn.error("Could not log out. Please try again."),E(!1);return}window.location.reload()};let R="Log in";o&&(R=A||"Account"),r.error&&!r.data&&(R="Account unavailable");const D=()=>{var J;Id.flushSync(()=>_(null)),(J=b.current)==null||J.focus()},U=J=>{m(J),c==null||c.capture(`visual_editor_account_menu_${J?"opened":"closed"}`,{is_authenticated:o})};return P.jsxs(P.Fragment,{children:[P.jsxs(nS,{isOpen:p,onOpenChange:U,children:[P.jsx(nv,{asChild:!0,children:P.jsxs("button",{ref:b,type:"button","aria-label":"Account","data-rivet-private":!0,className:`group/account ph-no-capture text-soft-foreground hover:text-foreground focus-visible:text-foreground flex shrink-0 items-center gap-2 transition-colors select-none focus-visible:outline-hidden ${e}`,children:[P.jsx("span",{className:"border-surface-2 bg-muted group-focus-visible/account:border-foreground flex h-8 w-8 items-center justify-center rounded-full border text-xs leading-none font-semibold",children:C||P.jsx(ste,{className:"h-4 w-4",weight:"bold"})}),P.jsx("span",{className:"max-w-[8rem] truncate text-sm font-medium",children:R})]})}),P.jsxs(rS,{"data-rivet-private":!0,className:"ph-no-capture min-w-44",side:t,align:n,onCloseAutoFocus:J=>{var q;const V=w.current;V&&(w.current=null,J.preventDefault(),(q=b.current)==null||q.focus(),_(V))},children:[T||M?P.jsxs("div",{className:"border-surface-2 mb-1 border-b px-3 py-2",children:[T?P.jsx("div",{className:"text-foreground truncate text-sm font-medium",children:T}):null,M?P.jsx("div",{className:"text-soft-foreground truncate text-xs",children:M}):null]}):null,P.jsxs(Va,{onSelect:()=>{w.current="connectors"},disabled:!o,children:[P.jsx(rte,{className:"h-3.5 w-3.5",weight:"bold"}),"Add references"]}),P.jsxs(Va,{onSelect:()=>{w.current="support"},children:[P.jsx(Wee,{className:"h-3.5 w-3.5",weight:"bold"}),"Share feedback"]}),o?P.jsxs(Va,{onClick:O,disabled:S,children:[P.jsx(tte,{className:"h-3.5 w-3.5",weight:"bold"}),S?"Logging out…":"Log out"]}):null,!o&&!r.error?P.jsxs(Va,{onClick:()=>{u()},disabled:d,children:[P.jsx(ete,{className:"h-3.5 w-3.5",weight:"bold"}),d?"Logging in…":"Log in"]}):null,r.error?P.jsx(Va,{onClick:()=>{r.refetch()},children:"Retry account"}):null,f?P.jsx("p",{role:"alert",className:"text-muted-foreground max-w-64 px-3 py-2 text-xs",children:f}):null]})]}),v==="connectors"?P.jsx(B2,{isOpen:!0,onClose:D}):null,P.jsx(Ile,{isOpen:v==="support",onClose:D,contactEmail:i??void 0})]})},Lle=({onClose:e,libraryOrigin:t})=>P.jsxs("div",{className:"bg-background font-main scrollbar-hide relative flex h-full w-full cursor-auto flex-col overflow-hidden shadow-2xl","data-cy":"element-inspector",children:[P.jsx(Vae,{onClose:e,libraryOrigin:t}),P.jsx("div",{className:"flex min-h-0 flex-1 flex-col",children:P.jsx(_ae,{})}),P.jsx("div",{className:"border-surface-2 bg-card flex flex-shrink-0 items-center border-t px-2.5 py-2.5",children:P.jsx(Nle,{side:"top",align:"start"})})]}),$le=5e3,Dle="150px",Fle=20,jle={"--error-bg":"var(--normal-bg)","--error-border":"var(--normal-border)","--error-text":"var(--normal-text)"},zle=()=>P.jsx(Eoe,{duration:$le,richColors:!0,style:jle,icons:{error:P.jsx(FL,{"aria-hidden":!0,weight:"bold",size:Fle,className:"text-muted-foreground"})},toastOptions:{style:{maxHeight:Dle,overflow:"hidden"}}}),F3=Ls("useServerConfig"),$h=[250,500,1e3,2e3,4e3],Vle=$h.length+1,Hle=async()=>{var n;const e=await Dt("/api/health");if(!e.ok)throw new Error(`Failed to fetch config: ${e.status}`);const t=await e.json();if(!t.framework)throw new Error("Server did not return framework information");return{userPort:((n=t.ports)==null?void 0:n.userDevServer)||3e3,framework:t.framework}},Ule=(e,t)=>e<$h.length?(F3.warn(`Server config fetch failed (attempt ${e+1}); retrying in ${$h[e]}ms`,t),!0):(F3.warn("Error fetching server config:",t),Qe==null||Qe.capture("preview_config_load_failed",{message:ts(t,"unknown_error"),attempts:Vle}),!1),Zle=e=>$h[Math.min(e,$h.length-1)],Ble=()=>{const e=Vi({queryKey:yr.serverConfig,queryFn:Hle,retry:Ule,retryDelay:Zle,staleTime:1/0,refetchOnWindowFocus:!1,refetchOnReconnect:!1,networkMode:"always"}),t=e.isFetching&&!e.data,{refetch:n}=e;return{config:e.data??null,isLoading:t,error:e.error&&!t?e.error.message:null,retry:()=>{n()}}},Wle="#1C1C20",jo=[118,118,124],j3=.85,Kle=3,Gle=.15,Dm=36,qle=4.4,Yle=.7,Qle=3.5,Xle=.8,z3=9,Jle=11,ece=[1.35,1.12,.95,.85],tce=[0,1.1,2.3,3.1],nce=[0,.35,.16,.13],rce=[.9,.5,.4,.35],Gl=3,E_=[[{x1:.1,y1:.08,x2:.9,y2:.92,level:0},{x1:.14,y1:.13,x2:.86,y2:.23,level:1},{x1:.14,y1:.28,x2:.3,y2:.87,level:1},{x1:.34,y1:.28,x2:.86,y2:.87,level:1},{x1:.165,y1:.155,x2:.225,y2:.205,level:2},{x1:.7,y1:.155,x2:.755,y2:.205,level:2},{x1:.775,y1:.155,x2:.83,y2:.205,level:2},{x1:.165,y1:.32,x2:.275,y2:.375,level:2},{x1:.165,y1:.415,x2:.275,y2:.47,level:2},{x1:.165,y1:.51,x2:.275,y2:.565,level:2},{x1:.37,y1:.32,x2:.585,y2:.56,level:2},{x1:.615,y1:.32,x2:.83,y2:.56,level:2},{x1:.37,y1:.61,x2:.83,y2:.83,level:2},{hline:!0,x1:.39,x2:.81,y:.685,level:3},{hline:!0,x1:.39,x2:.75,y:.755,level:3}],[{x1:.1,y1:.08,x2:.9,y2:.92,level:0},{x1:.16,y1:.17,x2:.52,y2:.45,level:1},{x1:.58,y1:.17,x2:.685,y2:.29,level:1},{x1:.715,y1:.17,x2:.84,y2:.29,level:1},{x1:.58,y1:.33,x2:.685,y2:.45,level:1},{x1:.715,y1:.33,x2:.84,y2:.45,level:1},{x1:.16,y1:.55,x2:.84,y2:.85,level:1},{x1:.19,y1:.21,x2:.36,y2:.33,level:2},{hline:!0,x1:.19,x2:.48,y:.37,level:3},{hline:!0,x1:.19,x2:.42,y:.42,level:3},{x1:.19,y1:.6,x2:.49,y2:.8,level:2},{hline:!0,x1:.53,x2:.8,y:.63,level:3},{hline:!0,x1:.53,x2:.76,y:.7,level:3},{hline:!0,x1:.53,x2:.79,y:.77,level:3}],[{x1:.1,y1:.08,x2:.9,y2:.92,level:0},{x1:.14,y1:.13,x2:.86,y2:.22,level:1},{x1:.14,y1:.28,x2:.36,y2:.87,level:1},{x1:.39,y1:.28,x2:.61,y2:.87,level:1},{x1:.64,y1:.28,x2:.86,y2:.87,level:1},{x1:.165,y1:.15,x2:.225,y2:.2,level:2},{x1:.165,y1:.32,x2:.335,y2:.52,level:2},{x1:.415,y1:.32,x2:.585,y2:.52,level:2},{x1:.665,y1:.32,x2:.835,y2:.52,level:2},{hline:!0,x1:.165,x2:.335,y:.6,level:3},{hline:!0,x1:.165,x2:.3,y:.67,level:3},{hline:!0,x1:.415,x2:.585,y:.6,level:3},{hline:!0,x1:.415,x2:.55,y:.67,level:3},{hline:!0,x1:.665,x2:.835,y:.6,level:3},{hline:!0,x1:.665,x2:.8,y:.67,level:3}],[{x1:.1,y1:.08,x2:.9,y2:.92,level:0},{x1:.3,y1:.22,x2:.7,y2:.74,level:1},{x1:.34,y1:.27,x2:.55,y2:.34,level:2},{hline:!0,x1:.36,x2:.64,y:.42,level:3},{hline:!0,x1:.36,x2:.6,y:.49,level:3},{hline:!0,x1:.36,x2:.62,y:.56,level:3},{x1:.5,y1:.63,x2:.575,y2:.69,level:2},{x1:.595,y1:.63,x2:.66,y2:.69,level:2}]],Fm=e=>{let t=e|0;return t=Math.imul(t^t>>>16,73244475),t=Math.imul(t^t>>>16,73244475),t^=t>>>16,(t>>>0)/4294967296},g0=e=>{const t=Math.min(1,Math.max(0,e));return t*t*(3-2*t)},ql=(e,t)=>(Math.round(e/t-.5)+.5)*t,sce=Math.sin(Math.PI/3),V3=(e,t,n,r,s)=>{if(e.beginPath(),t===0)e.arc(n,r,s,0,Math.PI*2);else if(t===1){const i=s*sce;e.moveTo(n,r-s),e.lineTo(n+i,r+s/2),e.lineTo(n-i,r+s/2),e.closePath()}else{const i=s*.85;e.rect(n-i,r-i,i*2,i*2)}e.fill()},ice=(e,t,n)=>{let r;if(n.hline){const s=Math.max(n.x1-e,e-n.x2,0),i=Math.abs(t-n.y1);r=Math.hypot(s,i)-z3}else{const s=Math.max(n.x1-e,e-n.x2,0),i=Math.max(n.y1-t,t-n.y2,0);s===0&&i===0?r=-Math.min(e-n.x1,n.x2-e,t-n.y1,n.y2-t):r=Math.hypot(s,i),r=Math.abs(r)-z3}return g0(.5-r/(2*Jle))},g$=({className:e="",trackGlobalLoaderCount:t=!0})=>{const n=Nt(V4),r=g.useRef(null),s=g.useCallback(i=>{var U;if((U=r.current)==null||U.call(r),r.current=null,!i)return;const o=i.getContext("2d");if(!o)return;t&&n(W=>W+1);const c=window.matchMedia("(prefers-reduced-motion: reduce)").matches;let u=[],d=0,f=0,p=Dm,m=Dm,v=null,_=null,w=0,b=-1;const S=new Array(33),E=W=>{const H=Math.round(W*32);let Y=S[H];if(!Y){const J=H/32,V=Math.round(jo[0]+(255-jo[0])*J),q=Math.round(jo[1]+(255-jo[1])*J),ee=Math.round(jo[2]+(255-jo[2])*J);Y=`rgba(${V}, ${q}, ${ee}, ${j3})`,S[H]=Y}return Y},C=W=>{const H=1-.35*W,Y=Math.round(jo[0]*H),J=Math.round(jo[1]*H),V=Math.round(jo[2]*H);return`rgba(${Y}, ${J}, ${V}, ${j3})`},A=W=>{let H=Math.floor(Math.random()*E_.length);H===b&&(H=(H+1)%E_.length),b=H;const Y=[0,0,0,0],J=E_[H].map((L,G)=>{const ue=L.level,te=Y[ue]++,ie=tce[ue]+te*nce[ue],he=rce[ue]+Fm(H*131+G*17+5)*.2;if(L.hline){const pe=ql((L.y??0)*f,m);return{hline:!0,x1:ql(L.x1*d,p),x2:ql(L.x2*d,p),y1:pe,y2:pe,level:ue,start:ie,dur:he}}const ke=ql(L.x1*d,p),ge=ql((L.y1??0)*f,m);return{hline:!1,x1:ke,y1:ge,x2:Math.max(ql(L.x2*d,p),ke+p),y2:Math.max(ql((L.y2??0)*f,m),ge+m),level:ue,start:ie,dur:he}}),V=J.reduce((L,G)=>Math.max(L,G.start+G.dur),0),q=u.length,ee=new Float32Array(q*Gl),F=new Int16Array(q*Gl).fill(-1),X=new Uint8Array(q),B=J[0];for(let L=0;L<q;L++){const G=u[L];G.x>B.x1&&G.x<B.x2&&G.y>B.y1&&G.y<B.y2&&(X[L]=1);const ue=L*Gl;for(let te=0;te<J.length;te++){const ie=ice(G.x,G.y,J[te]);if(ie<=.02)continue;let he=ue;for(let ke=ue;ke<ue+Gl;ke++){if(F[ke]===-1){he=ke;break}ee[ke]<ee[he]&&(he=ke)}(F[he]===-1||ie>ee[he])&&(ee[he]=ie,F[he]=te)}}return{startT:W,buildEnd:V,els:J,frame:B,cellQ:ee,cellEl:F,inFrame:X}},T=()=>{const W=i.getBoundingClientRect();d=Math.max(1,W.width),f=Math.max(1,W.height);const H=Math.min(2,window.devicePixelRatio||1);i.width=Math.round(d*H),i.height=Math.round(f*H),o.setTransform(H,0,0,H,0,0);const Y=Math.max(8,Math.round(d/Dm)),J=Math.max(6,Math.round(f/Dm));p=d/Y,m=f/J,u=[];for(let V=0;V<J;V++){const q=J>1?V/(J-1):.5,ee=qle*(1+Yle*.4*(q*2-1));for(let F=0;F<Y;F++){const X=V*8191+F*131+1,B={x:(F+.5)*p,y:(V+.5)*m,size:ee,seed:X,phase:Fm(X),kind:0};B.kind=Math.floor(Fm(X*97)*3),u.push(B)}}_=null,v=null},M=new Float32Array(32),O=W=>{o.fillStyle=Wle,o.fillRect(0,0,d,f),v||(v=A(W+.2)),W>=v.startT+v.buildEnd+Qle&&(_=v,w=W,v=A(W+.2));let H=0;_&&(H=1-g0((W-w)/Xle),H<=0&&(_=null));const Y=v;for(let B=0;B<Y.els.length;B++){const L=Y.els[B];M[B]=g0(Math.min(1,Math.max(0,(W-Y.startT-L.start)/L.dur)))}const J=M[0],V=C(0),q=C(J),ee=H>0?C(H):V,F=H>0?C(Math.max(J,H)):q,X=u.length;for(let B=0;B<X;B++){const L=u[B];let G=0,ue=0;const te=B*Gl;for(let Re=te;Re<te+Gl;Re++){const $e=Y.cellEl[Re];if($e<0)break;const Et=Y.cellQ[Re]*M[$e];Et>G&&(G=Et,ue=Y.els[$e].level)}if(_)for(let Re=te;Re<te+Gl;Re++){const $e=_.cellEl[Re];if($e<0)break;const Et=_.cellQ[Re]*H;Et>G&&(G=Et,ue=_.els[$e].level)}const ie=W/Kle+L.phase,he=Math.floor(ie),ke=ie-he,ge=g0(Math.min(ke,1-ke)/Gle),pe=Math.floor(Fm(L.seed*97+he*7919)*3);pe!==L.kind&&G<.02&&ge<.05&&(L.kind=pe);const Ne=Math.max(ge*(1-G),G);if(!(Ne<.01))if(G<.02){const Re=Y.inFrame[B]===1,$e=_?_.inFrame[B]===1:!1;Re?o.fillStyle=$e?F:q:o.fillStyle=$e?ee:V;const Et=Math.max(Re?J:0,$e?H:0);V3(o,L.kind,L.x,L.y,L.size*Ne*(1-.2*Et))}else{o.fillStyle=E(G);const Re=1+(ece[ue]-1)*G;V3(o,L.kind,L.x,L.y,L.size*Ne*Re)}}};T();let R=0;if(c)v=A(-100),O(0);else{const W=performance.now(),H=Y=>{O((Y-W)/1e3),R=requestAnimationFrame(H)};R=requestAnimationFrame(H)}const D=new ResizeObserver(()=>{T(),c&&(v=A(-100),O(0))});D.observe(i),r.current=()=>{cancelAnimationFrame(R),D.disconnect(),t&&n(W=>W-1)}},[t,n]);return P.jsx("canvas",{ref:s,"aria-hidden":"true",className:`h-full w-full ${e}`.trim()})},oce=[["Problem","problem"],["Reason code","reasonCode"],["Rivet detail","reasonDetail"],["Next step","nextStep"],["Rivet version","rivetVersion"],["Node.js version (Rivet runtime)","nodeVersion"],["Direction","directionLabel"],["Direction ref","directionRef"],["Rivet session","sessionId"]],ace=e=>{var n;const t=[];for(const[r,s]of oce){const i=(n=e[s])==null?void 0:n.trim();i&&t.push(`${r}: ${i}`)}return t.join(`
|
|
200
|
+
`)},H3={kind:"base"};function U3(e){return e.kind==="base"?"base":`variant:${e.sessionId}:${e.variantId}`}const lce=async(e=null)=>{if(e)return cce(e);let t;try{t=await Dt("/api/mcp/status")}catch{return{isOk:!1,unavailableReason:"rivet_unreachable",upstreamStatus:null}}if(t.status===404||!(t.headers.get("content-type")??"").toLowerCase().includes("application/json"))return jm();if(!t.ok)return{isOk:!1,unavailableReason:"rivet_unreachable",upstreamStatus:null};let r;try{r=await t.json()}catch{return jm()}const s=r.devServerHealth;return s?s.ownership==="none"?{isOk:!1,unavailableReason:"upstream_unreachable",upstreamStatus:null}:s.isReachable===!0?{isOk:!0,unavailableReason:"upstream_unreachable",upstreamStatus:null}:{isOk:!1,unavailableReason:s.reason==="rivet_unreachable"?"rivet_unreachable":"upstream_unreachable",upstreamStatus:null}:jm()},v$=async e=>{try{const t=await fetch(e);return{isOk:t.status!==502&&t.status!==503,unavailableReason:"upstream_unreachable",upstreamStatus:t.status}}catch{return{isOk:!1,unavailableReason:"rivet_unreachable",upstreamStatus:null}}},cce=e=>v$(e),jm=()=>v$("/"),k_=Ls("usePreviewUpstreamHealth"),uce=500,dce=4e3,fce=15e3,hce=3,pce={completedProbeCount:0,isUpstreamReady:!1,unavailableReason:"upstream_unreachable",isFirstUnreachableWindowExceeded:!1,hasCapturedFirstReady:!1,hasCapturedUnreachable:!1,downSince:null,everReady:!1,consecutiveServerErrors:0,hasFiredPersistentErrorHook:!1,lastUpstreamStatus:null},mce=({history:e,outcome:t,now:n,startedAt:r,firstUnreachableCaptureAfterMs:s})=>{const i=[],{upstreamStatus:o}=t,c=t.isOk&&o!==null&&o>=500;let u=e.consecutiveServerErrors;c&&e.everReady?u+=1:t.isOk&&!c&&(u=0);const d=u>=hce;let f=e.hasFiredPersistentErrorHook;d&&!f&&o!==null&&(f=!0,i.push({kind:"persistent_server_errors",upstreamStatus:o,consecutiveCount:u}));const p={...e,completedProbeCount:e.completedProbeCount+1,lastUpstreamStatus:o,consecutiveServerErrors:u,hasFiredPersistentErrorHook:f};if(t.isOk&&!d)return e.hasCapturedFirstReady?e.isUpstreamReady||i.push({kind:"restored"}):i.push({kind:"first_ready",readyAfterMs:n-r}),{history:{...p,everReady:p.everReady||!c,hasFiredPersistentErrorHook:p.hasFiredPersistentErrorHook&&c,isUpstreamReady:!0,unavailableReason:null,downSince:null,hasCapturedUnreachable:!1,isFirstUnreachableWindowExceeded:!1,hasCapturedFirstReady:!0},events:i};const m=e.downSince===null,v=e.downSince??n;let _=m?!1:e.hasCapturedUnreachable,w=m?!1:e.isFirstUnreachableWindowExceeded;e.isUpstreamReady&&i.push({kind:"lost",upstreamStatus:o});const b=n-v;return b>=s&&!_&&(_=!0,w=!0,i.push({kind:"first_unreachable",elapsedMs:b,upstreamStatus:o})),{history:{...p,isUpstreamReady:!1,unavailableReason:t.unavailableReason,downSince:v,hasCapturedUnreachable:_,isFirstUnreachableWindowExceeded:w},events:i}},Z3=(e,t)=>({id:t,identity:e,startedAt:Date.now()}),gce=(e,t={})=>{const n=g.useId(),r=t.probeMsWhileDown??uce,s=t.probeMsWhileUp??dce,i=t.firstUnreachableCaptureAfterMs??fce,o=t.probePath??null,c=t.skip??!1,u=e!=="static"&&!c,d=Nh(t.onPersistentUpstreamServerErrors),f=u?JSON.stringify([e,o,r,s,i]):null,[p,m]=g.useState(()=>Z3(f,0)),v=p.identity===f?p:Z3(f,p.id+1);v!==p&&m(v);const[_,w]=g.useState(0),b=g.useRef(null),S=A=>{var T;switch(A.kind){case"persistent_server_errors":Qe==null||Qe.capture("preview_upstream_error_responses",{framework:e,upstream_status:A.upstreamStatus,consecutive_count:A.consecutiveCount}),k_.warn(`Preview upstream is listening but has served ${A.consecutiveCount} consecutive ${A.upstreamStatus} responses`),(T=d.current)==null||T.call(d,{upstreamStatus:A.upstreamStatus,consecutiveCount:A.consecutiveCount});return;case"first_ready":Qe==null||Qe.capture("preview_dev_server_ready",{framework:e,ready_after_ms:A.readyAfterMs});return;case"restored":Qe==null||Qe.capture("preview_upstream_restored",{framework:e});return;case"lost":Qe==null||Qe.capture("preview_upstream_lost",{framework:e,upstream_status:A.upstreamStatus}),w(M=>M+1),k_.warn("Preview upstream became unavailable after it was ready");return;case"first_unreachable":Qe==null||Qe.capture("preview_dev_server_unreachable",{framework:e,elapsed_ms:A.elapsedMs,upstream_status:A.upstreamStatus}),k_.warn("Dev server did not become ready within timeout window");return;default:{const M=A;throw new Error(`Unhandled probe event: ${String(M)}`)}}},E=Vi({queryKey:yr.previewUpstreamHealth({instanceId:n,sessionId:v.id,rerunVersion:t.rerunProbeImmediatelyOnVersion??null}),queryFn:async({signal:A})=>{var D;const T=await lce(o),M=((D=b.current)==null?void 0:D.sessionId)===v.id?b.current.history:pce;if(A.aborted)return M;const{history:O,events:R}=mce({history:M,outcome:T,now:Date.now(),startedAt:v.startedAt,firstUnreachableCaptureAfterMs:i});return b.current={sessionId:v.id,history:O},R.forEach(S),O},enabled:u,placeholderData:(A,T)=>(T==null?void 0:T.queryKey[1].sessionId)===v.id?A:void 0,refetchInterval:A=>{var T;return(T=A.state.data)!=null&&T.isUpstreamReady?s:r},refetchIntervalInBackground:!0,refetchOnWindowFocus:!1,refetchOnReconnect:!1,retry:!1,gcTime:0,networkMode:"always"});if(e==="static")return{isUpstreamReady:!0,iframeRemountKey:_,probeStartedAt:null,probeAttemptCount:0,isFirstUnreachableWindowExceeded:!1,initialProbeComplete:!0,unavailableReason:null};if(c)return{isUpstreamReady:!1,iframeRemountKey:_,probeStartedAt:null,probeAttemptCount:0,isFirstUnreachableWindowExceeded:!1,initialProbeComplete:!0,unavailableReason:"upstream_unreachable"};const C=E.data;return{isUpstreamReady:(C==null?void 0:C.isUpstreamReady)??!1,iframeRemountKey:_,probeStartedAt:v.startedAt,probeAttemptCount:((C==null?void 0:C.completedProbeCount)??0)+(E.isFetching?1:0),isFirstUnreachableWindowExceeded:(C==null?void 0:C.isFirstUnreachableWindowExceeded)??!1,initialProbeComplete:C!==void 0,unavailableReason:C?C.unavailableReason:"upstream_unreachable"}};function vce(e){return e.enteringSplit&&e.isExistingSession&&e.hasActiveVariantProxy}const y$=e=>{var r;if(typeof window>"u")return"";const t=(r=window.__RIVET_BOOTSTRAP__)==null?void 0:r.previewOrigin;if(t)return t;const n=new URL(window.location.origin);return n.hostname="localhost",n.origin},W2=({agentApplyMode:e,url:t})=>t.startsWith("/")?`${y$()}${t}`:t,yce="allow-scripts allow-same-origin allow-forms allow-popups allow-modals",_ce=e=>yce,wce=Ls("PreviewSurface"),Pf=(e,t)=>e==="about:blank"?"blank":e.includes("/api/variants/")?"static_artifact":t.kind==="variant"?"dev_server":"original",K2=({target:e,src:t,framework:n,remountKey:r,isActive:s=!0})=>{vt(ov);const i=Ms(),o=g.useRef(!1),c=g.useRef(s),u=g.useCallback(f=>{e.kind==="variant"&&(i==null||i.capture("variants_panel.preview_displayed",{sessionId:e.sessionId,variantId:e.variantId,renderedTarget:"variant",iframeSrcKind:Pf(t,e),framework:n,isReused:f}))},[n,i,t,e]),d=g.useCallback(f=>{f&&(s&&!c.current&&o.current&&u(!0),c.current=s)},[u,s]);return P.jsx("div",{ref:d,className:"relative h-full w-full",children:P.jsx("iframe",{src:t,className:"h-full w-full border-none",title:s?"Project Preview":"Retained Project Preview",tabIndex:s?void 0:-1,sandbox:_ce(),onLoad:()=>{o.current=!0,i==null||i.capture("preview_iframe_loaded",{framework:n,src_kind:Pf(t,e)}),s&&u(!1)},onError:()=>{i==null||i.capture("preview_iframe_load_failed",{framework:n,src_kind:Pf(t,e)}),s&&e.kind==="variant"&&(i==null||i.capture("variants_panel.preview_display_failed",{sessionId:e.sessionId,variantId:e.variantId,renderedTarget:"variant",iframeSrcKind:Pf(t,e),framework:n})),wce.warn("Preview iframe failed to load",{framework:n,src_kind:Pf(t,e)})}},r)})},bce=7,xce=e=>{const t=U3(e.target),n=`${t}:${e.src}`,r=e.src==="about:blank",[s,i]=g.useState(()=>({selectedKey:n,remountKey:e.remountKey,selection:0,frames:r?[]:[{key:n,props:e,lastSelected:0}]}));if(s.selectedKey!==n||s.remountKey!==e.remountKey){const o=s.selection+1,c=s.remountKey!==e.remountKey;let u=s.frames.filter(d=>!c||U3(d.props.target)!==t);if(!r){const d=u.find(f=>f.key===n);if(d?u=u.map(f=>f===d?{...f,lastSelected:o}:f):u=[...u,{key:n,props:e,lastSelected:o}],u.length>bce){const f=u.reduce((p,m)=>m.lastSelected<p.lastSelected?m:p);u=u.filter(p=>p!==f)}}i({selectedKey:n,remountKey:e.remountKey,selection:o,frames:u})}return P.jsxs("div",{className:"relative h-full w-full",children:[s.frames.map(o=>{const c=!r&&o.key===n;return P.jsx("div",{className:"absolute inset-0",style:{visibility:c?"visible":"hidden",pointerEvents:c?"auto":"none"},"aria-hidden":!c,children:P.jsx(K2,{...o.props,isActive:c})},`${o.key}:${o.props.remountKey??""}`)}),r?P.jsx(K2,{...e}):null]})},Sce={surface:"relative flex h-full w-full items-center justify-center bg-background px-6",overlay:"absolute inset-0 z-10 flex items-center justify-center bg-background/90 px-6",page:"relative flex h-screen w-full items-center justify-center bg-background px-6"},Ece={sm:"text-lg font-semibold text-foreground",md:"text-2xl font-semibold text-foreground",lg:"text-3xl font-semibold text-foreground"},kce={neutral:"rounded-md border border-border-strong bg-transparent px-5 py-2 text-sm font-medium text-foreground transition-colors hover:bg-surface-3",ghost:"rounded-md px-5 py-2 text-sm font-medium text-soft-foreground transition-colors hover:text-foreground"},wd=({backdrop:e,media:t,title:n,description:r,actions:s,tone:i="neutral",fill:o="surface",size:c="md",children:u,state:d,role:f="status",busy:p=!1,className:m=""})=>{const v=g.useCallback(w=>{w&&d&&(Qe==null||Qe.capture("status_surface_shown",{state:d,tone:i,fill:o}))},[d,i,o]),_=!!(t||n||r||u||s!=null&&s.length);return P.jsxs("div",{ref:v,className:`${Sce[o]} ${m}`.trim(),role:f,"aria-live":"polite","aria-busy":p||void 0,"data-state":d,children:[e?P.jsx("div",{className:"absolute inset-0",children:e}):null,_?P.jsxs("div",{className:"relative z-10 flex max-w-sm flex-col items-center gap-5 text-center",children:[t,n?P.jsx("h2",{className:Ece[c],children:n}):null,r?P.jsx("p",{className:"text-soft-foreground text-base leading-relaxed",children:r}):null,u,s!=null&&s.length?P.jsx("div",{className:"flex flex-row items-center gap-3",children:s.map(w=>P.jsx("button",{type:"button",onClick:w.onClick,className:kce[w.variant??"neutral"],children:w.label},w.label))}):null]}):null]})},B3=({loader:e="coalesce",trackGlobalLoaderCount:t,size:n="lg",...r})=>e==="coalesce"?P.jsx(wd,{...r,size:n,busy:!0,backdrop:P.jsx(g$,{trackGlobalLoaderCount:t})}):P.jsx(wd,{...r,size:n,busy:!0,media:P.jsx(Cx,{"aria-hidden":!0,className:"text-foreground h-8 w-8 shrink-0 animate-spin",weight:"bold"})}),Cce=({icon:e,...t})=>P.jsx(wd,{...t,tone:"neutral",media:e?P.jsx("div",{className:"text-soft-foreground",children:e}):void 0}),_$=e=>P.jsx(wd,{...e,tone:"error",role:"alert"}),W3="/static/",Pce=e=>{try{return new URL(e,"http://localhost").pathname.endsWith(W3)}catch{return e.endsWith(W3)}},K3="The direction is saved, but Rivet couldn’t prepare its preview.",Ace={spawn_error:{summary:"The direction is saved, but its preview process didn’t start."},exited:{summary:"The direction is saved, but its preview stopped before it was ready."},timeout:{summary:"The direction is saved, but its preview took too long to become ready."},dependency_install_failed:{summary:"The direction is saved, but its dependencies couldn’t be prepared.",nextStep:"Fix the installation error, then retry the preview."},compile_error:{summary:"The direction is saved, but its app couldn’t compile.",nextStep:"Fix the app error, then retry the preview."},missing_dev_script:{summary:"The direction is saved, but Rivet couldn’t find a dev script to preview it."},missing_static_entry:{summary:"The direction is saved, but Rivet couldn’t find an HTML entry to preview it."},idle_timeout:{summary:K3},unknown:{summary:K3}},Tce=e=>e.nextStep?`${e.summary} ${e.nextStep}`:e.summary,Rce=e=>({label:"Copy for agent",onClick:()=>void K4({text:e,copyKind:"failure_report"})}),Ice=(e,t)=>{if(e.status==="failed"&&e.errorCode==="VARIANT_VERIFICATION_UNAVAILABLE")return{state:"variant_verification_unavailable",title:"Rivet couldn’t verify this direction",description:"The worker completed, but Rivet couldn’t inspect its generated files.",detail:e.errorMessage??e.errorCode,isError:!0};if(e.status==="failed"&&e.errorCode==="VARIANT_QA_FAILED")return{state:"variant_output_integrity_failed",title:"This direction couldn’t be verified",description:"The worker completed, but Rivet found a structural problem in the generated files.",detail:e.errorMessage??e.errorCode,isError:!0};if(e.status==="failed")return{state:"variant_worker_failed",title:"This direction didn’t complete",description:"The worker stopped before producing a usable result.",detail:e.errorMessage??e.errorCode,isError:!0};if(e.status==="cancelled")return{state:"variant_cancelled",title:"Direction was cancelled",description:"Rivet stopped before a preview was ready. Your other directions are unchanged.",isError:!1};if(e.status==="succeeded"&&e.previewUnavailable&&e.previewUnavailable.reason!=="idle_timeout"){const n=e.previewUnavailable,r=n.portInUse?"The preview port was already in use.":void 0,s=Ace[n.reason],i="Rivet couldn’t preview this direction";return{state:"preview_unavailable",title:i,description:Tce(s),detail:n.detail??r,isError:!0,agentPastePackage:ace({problem:`${i}. ${s.summary}`,reasonCode:n.reasonCode,reasonDetail:n.reasonDetail,nextStep:s.nextStep,rivetVersion:"0.28.3",nodeVersion:n.nodeVersion,directionLabel:e.label,directionRef:e.directionRef,sessionId:t})}}return null},Oce=({issue:e,retryTarget:t})=>{const n=Ms(),r=g.useRef(!1),[s,i]=g.useState(!1),[o,c]=g.useState(null),u=async()=>{if(!(!t||r.current)){r.current=!0,i(!0),c(null),n==null||n.capture("preview_retry_clicked",{session_id:t.sessionId,variant_id:t.variantId});try{const f=await Dt(`/api/variants/${encodeURIComponent(t.sessionId)}/preview-port`,{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({variantId:t.variantId,retry:!0})});if(!f.ok){const p=mK.safeParse(await f.json().catch(()=>({})));throw new Error(p.success?p.data.message:"The preview could not restart. Try again.")}}catch(f){c(ts(f,"The preview could not restart. Try again."))}finally{r.current=!1,i(!1)}}},d=[...t&&!s?[{label:"Retry preview",onClick:()=>void u()}]:[],...e.agentPastePackage?[Rce(e.agentPastePackage)]:[]];return P.jsxs(wd,{fill:"overlay",size:"sm",state:e.state,role:e.isError?"alert":"status",tone:e.isError?"error":"neutral",title:e.title,description:e.description,busy:s,actions:d,children:[s?P.jsx("p",{className:"text-muted-foreground text-xs",children:"Starting preview…"}):null,o?P.jsx("p",{className:"text-muted-foreground text-xs",children:o}):null,e.detail?P.jsx("p",{"data-rivet-private":!0,className:"ph-no-capture text-muted-foreground max-h-40 overflow-auto text-xs leading-relaxed break-words whitespace-pre-wrap",children:e.detail}):null]})},Mce=({isInteractionDisabled:e=!1,framework:t,userPort:n})=>{var Qt;const r=vt(rv),s=vt($2),i=Nt($2),o=vt(vg),c=Nt(vg),u=vt(Qh),d=vt(ov),f=vt(D2),p=vt(F2),m=vt(H4),v=vt(U4),_=Nt(F2),w=vt(vl),b=vt(m0),S=Nt(D2),E=u.active&&u.projectContext.kind==="fresh",C=vt(p0),A=u.active?u.variants.find(Me=>Me.workItemId===C&&(Me.status==="pending"||Me.status==="running"||Me.status==="succeeded"&&!Me.preview&&typeof Me.port!="number"&&(!Me.previewUnavailable||Me.previewUnavailable.reason==="idle_timeout")))??null:null,T=u.active&&u.variants.some(Me=>Me.status==="pending"||Me.status==="running"),M=E||T,O=u.active?u.variants.find(Me=>Me.workItemId===C)??null:null,R=u.active&&O?Ice(O,u.sessionId):null,D=t==="static"&&o!==null&&Pce(o);g.useEffect(()=>{u.active||S(!1)},[u.active,S]);const U=g.useRef(!1);g.useEffect(()=>{const Me=!!(w!=null&&w.left||w!=null&&w.right),Xe=Me&&!U.current;U.current=Me;const Te=u.active?u.sessionId:null;!Te||!vce({enteringSplit:Xe,isExistingSession:u.active&&u.projectContext.kind==="existing",hasActiveVariantProxy:f&&p!==null})||(S(!1),_(null),i(xt=>xt+1),Dt(`/api/variants/${encodeURIComponent(Te)}/preview-port`,{method:"POST",headers:{"content-type":"application/json"},body:JSON.stringify({variantId:null})}).catch(()=>{}))},[w,u,f,p,S,_,i]);const H=g.useMemo(()=>{var $t;if(f||o&&!D||!u.active)return null;const{stage:Me,variants:Xe}=u,Te=Me==="ready"||Me==="degraded",xt=Xe.some(ft=>{var gt,Hn;return((gt=ft.refinement)==null?void 0:gt.status)==="pending"||((Hn=ft.refinement)==null?void 0:Hn.status)==="running"});if(!Te&&!xt)return null;const xe=Xe.find(ft=>{var gt;return ft.status==="succeeded"&&((gt=ft.preview)==null?void 0:gt.kind)==="static_artifact"});return(($t=xe==null?void 0:xe.preview)==null?void 0:$t.kind)==="static_artifact"?yc({sessionId:u.sessionId,variant:xe,projectContext:u.projectContext}):null},[D,o,f,u])??o,Y=g.useMemo(()=>!u.active||!H?null:u.variants.find(Me=>{var Xe;return((Xe=Me.preview)==null?void 0:Xe.kind)==="static_artifact"&&H.startsWith(Me.preview.url)})??null,[H,u]),J=g.useMemo(()=>{if((b==null?void 0:b.previewKind)==="static"||(b==null?void 0:b.previewKind)==="dev_server"&&b.previewError||(b==null?void 0:b.previewKind)==="dev_server"&&H&&v3(H))return{kind:"variant",sessionId:b.sessionId,variantId:b.variantId};if(!u.active)return H3;if(Y)return{kind:"variant",sessionId:u.sessionId,variantId:Y.workItemId};if(H){const Xe=H.match(/\/__rivet\/preview\/variant\/([^/]+)\/([^/?#]+)/),Te=Xe!=null&&Xe[1]?decodeURIComponent(Xe[1]):null,xt=Xe!=null&&Xe[2]?decodeURIComponent(Xe[2]):null;if(Te===u.sessionId&&xt&&u.variants.some(ft=>ft.workItemId===xt))return{kind:"variant",sessionId:u.sessionId,variantId:xt};const xe=H.match(/\/api\/variants\/[^/]+\/static\/([^/?#]+)/),$t=xe!=null&&xe[1]?decodeURIComponent(xe[1]):null;if($t&&u.variants.some(ft=>ft.workItemId===$t))return{kind:"variant",sessionId:u.sessionId,variantId:$t}}const Me=!!(w!=null&&w.left||w!=null&&w.right);return(!Me||E)&&!H&&f&&p&&u.variants.some(Xe=>Xe.workItemId===p)?{kind:"variant",sessionId:u.sessionId,variantId:p}:(!Me||E)&&!H&&C&&u.variants.some(Xe=>Xe.workItemId===C)?{kind:"variant",sessionId:u.sessionId,variantId:C}:H3},[b,Y,u,f,p,H,w,E,C]),V=g.useRef(null);g.useEffect(()=>{var xt,xe,$t;if(!Y||((xt=Y.preview)==null?void 0:xt.kind)!=="static_artifact"||((xe=Y.refinement)==null?void 0:xe.status)!=="succeeded")return;const Me=`${Y.workItemId}:${Y.refinement.workItemId}`;if(V.current===Me)return;if(V.current=Me,($t=Y.previewRoutes)!=null&&$t.length){i(ft=>ft+1);return}const Xe=Y.preview.url.includes("?")?"&":"?",Te=`${Y.preview.url}${Xe}refinement=${encodeURIComponent(Y.refinement.workItemId)}`;H!==Te&&(c(Te),i(ft=>ft+1))},[H,Y,i,c,u]);const q=H!==null&&v3(H),ee=H!==null&&!q||E&&!f&&!q,{isUpstreamReady:F,iframeRemountKey:X,probeAttemptCount:B,initialProbeComplete:L}=gce(t,{rerunProbeImmediatelyOnVersion:s,probePath:q?H:null,skip:ee}),[G,ue]=g.useState(()=>m&&F?s:null),[te,ie]=g.useState(null);m?G!==s&&((te==null?void 0:te.remountKey)!==s?ie({remountKey:s,probeAttemptCount:B}):F&&B>te.probeAttemptCount&&ue(s)):(te!==null&&ie(null),G!==null&&ue(null));const ke=H!==null&&!q||F,pe=v||m&&!q&&G!==s||m&&!ke,Ne=`${X}:${s}`,Re=X4(window.location.pathname),$e=t==="static"?`/static${Re??"/"}`:Re??"/",Et=y$();let dn=null;H&&(dn=W2({agentApplyMode:d,url:H}));const an=q&&!ke?"about:blank":dn,kt=A||R||b!=null&&b.previewError||pe?"about:blank":an??(ke?`${Et}${$e}`:"about:blank"),Gt=!!A||!!R||!ke&&L;let gn=null;if(b!=null&&b.previewError)gn=P.jsx(wd,{fill:"overlay",size:"sm",state:"preview_replay_failed",role:"alert",tone:"error",title:"Rivet couldn’t preview this direction",description:"Select the direction again to retry.",children:P.jsx("p",{className:"text-muted-foreground text-xs leading-relaxed break-words",children:b.previewError})});else if(pe)gn=P.jsx(B3,{fill:"overlay",loader:"coalesce",trackGlobalLoaderCount:!1,state:"preview_replay_boot"});else if(A)gn=P.jsx(B3,{fill:"overlay",loader:"coalesce",trackGlobalLoaderCount:!1,state:"variant_building",children:P.jsx("span",{className:"sr-only",children:"Building your direction"})});else if(R){const Me=u.active&&O&&R.state==="preview_unavailable"&&((Qt=O.previewUnavailable)==null?void 0:Qt.reason)!=="missing_static_entry"?{sessionId:u.sessionId,variantId:O.workItemId}:void 0;gn=P.jsx(Oce,{issue:R,retryTarget:Me},O==null?void 0:O.workItemId)}else Gt&&(gn=M?P.jsx(Cce,{fill:"overlay",state:"preview_no_selection",title:"Nothing to preview yet",description:"Pick a direction from the panel."}):P.jsx(_$,{fill:"overlay",state:"preview_offline",title:"Preview isn't connected",description:"Rivet lost connection to your project.",actions:[{label:"Reload",onClick:()=>window.location.reload()}]}));return P.jsx("div",{className:"relative flex h-full min-h-0 w-full flex-col",children:P.jsxs("div",{className:"relative min-h-0 flex-1",children:[gn,P.jsx(xce,{target:J,src:kt,framework:t,remountKey:Ne},r)]})})};function G3({side:e,sessionId:t,variantId:n,url:r,label:s,source:i,isFallback:o=!1}){var C;const c=vt(vl),u=Nt(vl),d=Ms(),f=vt(Qh),p=vt(ov),m=g.useRef(!1),v=g.useCallback(()=>{m.current||(m.current=!0,yd({source:i,sessionId:t,variantId:n}))},[i,t,n]),_=g.useCallback(()=>{if(o){u(null);const O=_g("ended",c);d==null||d.capture(O.event,O.properties);return}v();const A={...c};delete A[e];const T=A.left||A.right?A:null;u(T);const M=_g(T?"updated":"ended",T??c);d==null||d.capture(M.event,M.properties)},[o,d,u,e,c,v]),w=g.useMemo(()=>({kind:"variant",sessionId:t,variantId:n}),[t,n]),b=g.useMemo(()=>!f.active||f.sessionId!==t?null:f.variants.find(A=>A.workItemId===n)??null,[t,n,f]),S=g.useMemo(()=>{var T,M,O;let A=r;if(((T=b==null?void 0:b.preview)==null?void 0:T.kind)==="static_artifact"&&((M=b.refinement)==null?void 0:M.status)==="succeeded"){if((O=b.previewRoutes)!=null&&O.length)return W2({agentApplyMode:p,url:yc({sessionId:t,variant:b,projectContext:null})??r});const R=b.preview.url.includes("?")?"&":"?";A=`${b.preview.url}${R}refinement=${encodeURIComponent(b.refinement.workItemId)}`}return W2({agentApplyMode:p,url:A})},[p,b,t,r]),E=((C=b==null?void 0:b.refinement)==null?void 0:C.status)==="succeeded"?`${n}:${b.refinement.workItemId}`:n;return P.jsxs("div",{className:"variant-split-secondary","data-cy":"variant-split-pane","data-variant-id":n,children:[P.jsxs("div",{className:"variant-split-secondary-toolbar",children:[P.jsx("span",{className:"variant-split-secondary-label",title:s,children:s}),P.jsx(vd,{label:"Collapse",children:P.jsx(ir,{variant:"ghost",size:"icon-compact",onClick:_,"aria-label":"Collapse split view",children:P.jsx(zL,{weight:"bold","aria-hidden":!0})})})]}),P.jsx("div",{className:"variant-split-secondary-body relative min-h-0 flex-1",children:P.jsx(K2,{target:w,src:S,framework:"static",remountKey:E})})]})}function Nce(){const e=vt(gd),t=vt(sS);return!e||!t?null:Id.createPortal(P.jsx("div",{"aria-hidden":"true",className:"border-surface-2 bg-background pointer-events-none fixed top-0 left-0 z-[70] flex max-w-60 items-center gap-2 rounded-md border px-3 py-1.5 shadow-lg",style:{transform:`translate3d(${t.x+12}px, ${t.y+12}px, 0)`},children:P.jsx("span",{className:"text-foreground truncate text-sm font-medium",children:e.label})}),document.body)}const q3=(e,t)=>{if(!e)return null;const n=e.getBoundingClientRect(),{x:r,y:s}=t;return r<n.left||r>n.right||s<n.top||s>n.bottom?null:r<(n.left+n.right)/2?"left":"right"};function Lce(){const e=vt(gd),t=vt(sS),n=vt(vl),r=Nt(gd),s=Nt(vl),i=Ms(),o=g.useRef(null),[c,u]=g.useState(null),[d,f]=g.useState("hidden");if(!e&&(d!=="hidden"||c!==null)&&(f("hidden"),u(null)),g.useEffect(()=>{if(!e||!t)return;const m=q3(o.current,t);u(v=>v===m?v:m),f(v=>{if(v==="exiting")return v;const _=m!==null?"visible":"hidden";return v===_?v:_})},[e,t]),g.useEffect(()=>{if(!e)return;const m=v=>{const _=q3(o.current,{x:v.clientX,y:v.clientY});if(_&&e.url){const w={sessionId:e.sessionId,variantId:e.variantId,label:e.label,url:e.url,source:e.source},b=n==null?void 0:n[_];b&&(b.sessionId!==w.sessionId||b.variantId!==w.variantId)&&yd(b);const S={...n??{},[_]:w};s(S);const E=_g(n?"updated":"started",S);i==null||i.capture(E.event,E.properties),f("exiting"),window.setTimeout(()=>r(null),220)}else yd(e),f("exiting"),window.setTimeout(()=>r(null),220)};return window.addEventListener("pointerup",m),window.addEventListener("pointercancel",m),()=>{window.removeEventListener("pointerup",m),window.removeEventListener("pointercancel",m)}},[e,i,r,s,n]),!e)return null;const p=["variant-drop-zones",d==="visible"&&"is-visible",d==="exiting"&&"is-exiting"].filter(Boolean).join(" ");return P.jsxs("div",{ref:o,className:p,"aria-hidden":"true",children:[P.jsx(Y3,{side:"left",hovered:c==="left",canDrop:!!e.url,label:e.label}),P.jsx(Y3,{side:"right",hovered:c==="right",canDrop:!!e.url,label:e.label})]})}function Y3({side:e,hovered:t,canDrop:n,label:r}){return P.jsxs("div",{className:["variant-drop-zone",`is-${e}`,t&&"is-hover",!n&&"is-disabled"].filter(Boolean).join(" "),children:[P.jsxs("div",{className:"variant-drop-zone-inner",children:[P.jsx("div",{className:`variant-drop-zone-icon is-${e}`}),P.jsx("div",{className:"variant-drop-zone-caption",children:n?`Add ${e} split`:"Split unavailable for this direction"})]}),P.jsx("div",{className:"variant-drop-zone-preview","aria-hidden":"true",children:P.jsx("div",{className:"variant-drop-zone-preview-label",children:r})}),P.jsx("div",{className:"variant-drop-zone-border"})]})}const w$=(e,t,n)=>{var i,o,c;if(!e.active||e.sessionId!==t)return null;const r=e.variants.find(u=>u.workItemId===n);if(((i=r==null?void 0:r.preview)==null?void 0:i.kind)!=="static_artifact")return null;if((o=r.previewRoutes)!=null&&o.length)return yc({sessionId:t,variant:r,projectContext:e.projectContext});if(((c=r.refinement)==null?void 0:c.status)!=="succeeded")return r.preview.url;const s=r.preview.url.includes("?")?"&":"?";return`${r.preview.url}${s}refinement=${encodeURIComponent(r.refinement.workItemId)}`},Q3=(e,t)=>{if(!e)return;const n=w$(t,e.sessionId,e.variantId);return!n||n===e.url?e:{...e,url:n}},$ce=()=>P.jsx("div",{"data-testid":"preview-boot-skeleton",role:"status","aria-busy":"true","aria-label":"Loading preview",className:"bg-background flex h-full min-h-0 w-full flex-1 flex-col p-3",children:P.jsx("div",{className:"border-surface-2 relative min-h-0 flex-1 overflow-hidden rounded-lg border",children:P.jsx(g$,{trackGlobalLoaderCount:!1})})}),Dce=({isLoading:e=!1,isInteractionDisabled:t=!1})=>{const{config:n,retry:r,isLoading:s,error:i}=Ble();return s?P.jsx($ce,{}):i||!n?P.jsx(_$,{fill:"surface",size:"sm",state:"preview_config_error",title:"Couldn't load preview",description:"We couldn't load the preview configuration.",actions:[{label:"Retry",onClick:()=>{Qe==null||Qe.capture("preview_config_retry_clicked"),r()}}]}):P.jsx(Fce,{isLoading:e,isInteractionDisabled:t,framework:n.framework,userPort:n.userPort})};function Fce(e){const t=vt(vl),n=vt(gd),r=vt(Qh),s=vt(vg),i=t==null?void 0:t.left,o=t==null?void 0:t.right,c=g.useMemo(()=>{var T,M;if(!r.active||r.projectContext.kind!=="fresh"||!(!!i!=!!o))return;const w=(T=i??o)==null?void 0:T.variantId,b=r.variants.filter(O=>{var R;return O.status==="succeeded"&&((R=O.preview)==null?void 0:R.kind)==="static_artifact"&&O.workItemId!==w}),S=s==null?void 0:s.replace(/[?&]refinement=[^&]*$/,""),C=b.find(O=>{var R;return((R=O.preview)==null?void 0:R.kind)==="static_artifact"&&(O.preview.url===S||yc({sessionId:r.sessionId,variant:O,projectContext:r.projectContext})===s)})??b[0];if(((M=C==null?void 0:C.preview)==null?void 0:M.kind)!=="static_artifact")return;const A=w$(r,r.sessionId,C.workItemId);if(A)return{sessionId:r.sessionId,variantId:C.workItemId,label:C.label,url:A,source:"live"}},[r,i,o,s]),u=Q3(i,r)??(o?c:void 0),d=Q3(o,r)??(i?c:void 0),f=!i&&!!u,p=!o&&!!d,m=!!(u||d),v=P.jsx(Mce,{isInteractionDisabled:e.isInteractionDisabled,framework:e.framework,userPort:e.userPort});return P.jsx("div",{className:"relative flex h-full min-h-0 w-full flex-1 flex-col",children:P.jsxs("div",{className:`variant-preview-region relative flex h-full min-h-0 w-full flex-1 flex-col ${n?"is-dragging":""} ${m?"is-split":""}`,children:[P.jsxs("div",{className:"variant-preview-row flex h-full min-h-0 w-full flex-1",children:[u&&P.jsx(G3,{side:"left",sessionId:u.sessionId,variantId:u.variantId,url:u.url,label:u.label,source:u.source,isFallback:f},`left-${u.sessionId}:${u.variantId}:${u.url}`),P.jsx("div",{className:"variant-preview-primary flex h-full min-h-0 flex-1 flex-col",style:{display:u&&d?"none":void 0},"aria-hidden":!!(u&&d),children:v}),d&&P.jsx(G3,{side:"right",sessionId:d.sessionId,variantId:d.variantId,url:d.url,label:d.label,source:d.source,isFallback:p},`right-${d.sessionId}:${d.variantId}:${d.url}`)]}),P.jsx("div",{className:"variant-preview-atmosphere","aria-hidden":"true"}),P.jsx(Lce,{}),P.jsx(Nce,{})]})})}const jce="/assets/google-g-CpxN0HWb.png",b$="data:image/svg+xml,%3csvg%20width='128'%20height='128'%20viewBox='0%200%20128%20128'%20fill='none'%20xmlns='http://www.w3.org/2000/svg'%3e%3cpath%20d='M70.5245%206.60961C66.8741%202.95923%2060.9556%202.95922%2057.3053%206.60961L8.61753%2055.2973C4.96715%2058.9477%204.96714%2064.8662%208.61752%2068.5166L26.3518%2086.2508C30.0022%2089.9012%2035.9206%2089.9012%2039.571%2086.2508L92.033%2033.7889C93.5989%2032.2229%2093.5989%2029.684%2092.033%2028.1181L70.5245%206.60961Z'%20fill='%23EC4423'%20fill-opacity='0.8'/%3e%3cpath%20d='M119.208%2068.5159C122.858%2064.8655%20122.858%2058.947%20119.208%2055.2966L70.5199%206.60891C66.8695%202.95853%2060.951%202.95851%2057.3007%206.6089L32.8391%2031.0705L88.1364%2086.3678C91.7868%2090.0182%2097.7053%2090.0182%20101.356%2086.3678L119.208%2068.5159Z'%20fill='%23EC4423'%20fill-opacity='0.8'/%3e%3cpath%20d='M64.0164%2077.3398L44.0436%2097.3127C41.1057%20100.251%2041.1057%20105.014%2044.0436%20107.952L58.5067%20122.415C61.4446%20125.353%2066.2079%20125.353%2069.1458%20122.415L83.7991%20107.762C86.737%20104.824%2086.737%20100.06%2083.7991%2097.1225L64.0164%2077.3398Z'%20fill='%23EC4423'%20fill-opacity='0.8'/%3e%3c/svg%3e",x$="/assets/rivet-wordmark-orange-CYKVQDmG.svg",zce=({isSigningIn:e,onStartSignIn:t,errorMessage:n=null})=>P.jsxs("main",{className:"relative flex min-h-screen items-center justify-center bg-background-sunken px-6 py-28 text-white",children:[P.jsx("header",{className:"absolute inset-x-0 top-10 flex justify-center",children:P.jsx("img",{src:x$,alt:"Rivet",className:"h-6 w-auto object-contain"})}),P.jsxs("div",{className:"flex min-h-80 w-full max-w-sm flex-col justify-center rounded-2xl border border-white/10 bg-white/[0.04] p-8 text-center shadow-2xl",children:[P.jsx("img",{src:b$,alt:"","aria-hidden":!0,className:"mx-auto mb-5 size-10 object-contain"}),P.jsx("h1",{className:"text-2xl font-semibold tracking-tight",children:"Sign in"}),P.jsx("p",{className:"mt-1 text-sm leading-6 text-white/60",children:"Welcome to Rivet."}),P.jsx(ir,{variant:"primary",onClick:t,isLoading:e,className:"mt-7 w-full",children:P.jsxs("span",{className:"flex items-center gap-2",children:[P.jsx("img",{src:jce,alt:"","aria-hidden":!0,className:"size-5 object-contain p-0.5"}),P.jsx("span",{children:e?"Connecting…":"Sign in with Google"})]})}),n?P.jsx("p",{role:"alert",className:"text-muted-foreground mt-4 text-sm",children:n}):null]})]}),Vce=({message:e})=>P.jsx("div",{className:"relative flex min-h-screen flex-col items-center justify-center overflow-hidden bg-background font-main text-white",children:P.jsxs("div",{className:"flex flex-col items-center gap-10",children:[P.jsx("img",{src:x$,alt:"Rivet",className:"h-8 w-auto object-contain"}),P.jsxs("div",{className:"glass-panel flex items-center gap-3 rounded-xl px-8 py-3.5 text-sm font-medium",children:[P.jsx(Cx,{className:"h-5 w-5 shrink-0 animate-spin text-primary",weight:"bold"}),P.jsx("span",{children:e})]})]})}),bg=44,Af=8,zm=16,Hce=4,X3=-18,Uce=.18,Zce=[.22,1,.36,1],J3=.92,Bce=1,Wce=.95,Kce=.4,Gce=[.19,1,.22,1],C_=0,qce=1,Yce=0,Qce=0,Xce=0,S$=({position:e,viewport:t,boundsLeft:n=0})=>{const r=n+Af,s=Math.max(r,t.width-bg-Af),i=Math.max(Af,t.height-bg-Af);return{x:Math.min(s,Math.max(r,e.x)),y:Math.min(i,Math.max(Af,e.y))}},lS=()=>({width:window.innerWidth,height:window.innerHeight}),Jce=({position:e,boundsLeftPx:t=0})=>S$({position:e,viewport:lS(),boundsLeft:t}),eue=()=>{if(typeof window>"u")return{x:zm,y:zm};const e=lS();return{x:e.width-bg-zm,y:e.height-bg-zm}},tue=({deltaX:e,deltaY:t})=>Math.hypot(e,t)>=Hce,nue=e=>e.button===void 0||e.button<=Xce,eT=e=>{const t=e.nativeEvent;return{x:Number.isFinite(e.clientX)?e.clientX:t.clientX,y:Number.isFinite(e.clientY)?e.clientY:t.clientY}},rue=({isVisible:e,isPanelOpen:t,isReducedMotion:n,position:r,dragBoundsLeftPx:s=0,onToggle:i,onPositionChange:o})=>{const c=g.useRef(null),u=g.useRef(!1),[d,f]=g.useState(!1),[p,m]=g.useState(!1),[v,_]=g.useState(!1),w=n?!1:{opacity:C_,scale:J3,x:X3},b=n?{opacity:C_}:{opacity:C_,scale:J3,x:X3},S=n?{duration:Qce}:{duration:Uce,ease:Zce,scale:{duration:Kce,ease:Gce}},E=g.useCallback(()=>{const D=c.current;D&&(u.current=D.hasMoved),c.current=null,f(!1)},[]),C=g.useCallback(D=>{const U=c.current;if(!U)return;const W=eT(D),H=W.x-U.startPointer.x,Y=W.y-U.startPointer.y,J=U.hasMoved||tue({deltaX:H,deltaY:Y});c.current={...U,hasMoved:J},J&&o(S$({position:{x:U.startPosition.x+H,y:U.startPosition.y+Y},viewport:lS(),boundsLeft:s}))},[o,s]),A=g.useCallback(D=>{if(c.current||!nue(D))return;const U=eT(D);c.current={startPointer:U,startPosition:r,hasMoved:!1},f(!0)},[r]),T=g.useCallback(()=>{if(u.current){u.current=!1;return}i()},[i]),M=t?U2:Iae,O=oS(),R=!d&&(p||v);return P.jsxs(P.Fragment,{children:[d?P.jsx("div",{className:"fixed inset-0 z-40 cursor-grabbing","data-cy":"rivet-panel-launcher-drag-surface",onPointerMove:C,onPointerUp:E,onPointerCancel:E,onMouseMove:C,onMouseUp:E}):null,P.jsx(Nu,{children:e?P.jsx(vd,{label:M,side:"top",forceOpen:R?void 0:!1,children:P.jsx(ta.button,{type:"button","aria-label":M,"aria-keyshortcuts":O.ariaKeyShortcuts,"data-cy":"reopen-panel",onMouseEnter:()=>m(!0),onMouseLeave:()=>m(!1),onFocus:D=>_(D.currentTarget.matches(":focus-visible")),onBlur:()=>_(!1),initial:w,animate:{opacity:qce,scale:Bce,x:Yce},whileTap:{scale:Wce},exit:b,transition:S,onPointerDown:A,onMouseDown:A,onPointerMove:C,onPointerUp:E,onPointerCancel:E,onMouseMove:C,onMouseUp:E,onClick:T,className:`bg-background absolute z-50 flex h-11 w-11 touch-none items-center justify-center overflow-hidden rounded-full border border-white/10 shadow-[0_2px_8px_rgba(0,0,0,0.2),0_4px_16px_rgba(0,0,0,0.1)] focus-visible:outline-hidden transition-[background-color,border-color,box-shadow] duration-150 select-none hover:bg-surface-3 focus-visible:border-white/40 focus-visible:bg-surface-3 ${d?"cursor-grabbing shadow-[0_4px_12px_rgba(0,0,0,0.28),0_10px_24px_rgba(0,0,0,0.16)]":"cursor-grab"}`,style:{left:r.x,top:r.y,willChange:"left, top, transform"},children:P.jsx("img",{src:b$,alt:"","aria-hidden":"true",draggable:!1,className:"h-4 w-4 brightness-0 invert"})})}):null})]})},P_=Ls("useConfig"),sue=300*1e3,iue=1800*1e3,oue=60*1e3,aue=300*1e3,lue=()=>{var e;return typeof window>"u"?null:((e=window.__RIVET_BOOTSTRAP__)==null?void 0:e.queueAccessToken)??null},cue=()=>{var e;return typeof window>"u"?null:((e=window.__RIVET_BOOTSTRAP__)==null?void 0:e.agentApplyMode)??null},uue=ze({featureFlags:Nb(re(),ze({isEnabled:Ts()})).optional()}),due=async()=>{const e=await Dt("/api/feature-flags");if(!e.ok)throw new Error(`Failed to fetch feature flags: ${e.statusText}`);return uue.parse(await e.json())},fue=e=>({...F4,...e??{}}),hue=()=>{const e=vt(Qoe),t=vt(j2),n=Nt(j2),r=Nt(W4),s=Nt(iv),i=Nt(ov),o=Nt(Joe),c=Nt(Yoe),u=Nt(Goe),d=Nt(sv),f=Nt(Koe),p=Nt(qoe),m=g.useCallback(E=>{c(E.agentModeAvailable),p(E.projectId??null),f({name:E.name??null,email:E.email??null}),E.isMCPSession&&r(!0),s(e.isCaptured?e.runtime:E.mcpEditor),i(E.agentApplyMode??cue()??null),o(E.queueAccessToken??lue())},[i,c,r,s,o,p,f,e]),v=Vi({queryKey:yr.rivetConfig,queryFn:f$,staleTime:sue,gcTime:iue}),_=Vi({queryKey:yr.featureFlags,queryFn:due,staleTime:oue,gcTime:aue}),{refetch:w}=v,{refetch:b}=_;g.useLayoutEffect(()=>{v.data&&(m(v.data),d(!1),P_.info("Config loaded:",v.data)),_.data&&(n(fue(_.data.featureFlags)),u(!0)),v.error&&(u(!0),d(!1),P_.warn("Failed to load config:",v.error.message)),_.error&&(u(!0),P_.warn("Failed to load feature flags:",_.error.message))},[v.data,v.error,_.data,_.error,m,d,n,u]);const S=g.useCallback(async()=>{const[E]=await Promise.all([w(),b()]);return E.data?E.data:null},[w,b]);return{config:v.data??null,featureFlags:t,loading:v.isPending||!v.error&&_.isPending,error:v.error?v.error.message:null,refetchConfig:S}},mu=Ls("useOAuthCallback"),pue=()=>{const[e,t]=g.useState({isProcessing:!1,isComplete:!1,error:null});return g.useEffect(()=>{const n=new AbortController;let r=!1;return(async()=>{var c,u,d;const i=window.location.hash,o=window.location.search;if(!(!i||!i.includes("access_token"))&&!r){t({isProcessing:!0,isComplete:!1,error:null});try{mu.info("Processing OAuth callback...");const f=new URLSearchParams(i.substring(1)),p=f.get("access_token"),m=f.get("refresh_token"),_=new URLSearchParams(o).get("session");if(!p)throw new Error("No access token found in URL");if(!_)throw new Error("No session ID found in URL");mu.info(`Completing OAuth with session: ${_}`);const w=await fetch(`${Z2}/api/auth/google/complete`,{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({sessionId:_,accessToken:p,refreshToken:m}),signal:n.signal}),b=await w.json();if(!w.ok||!b.success)throw new Error(b.error||b.message||"Failed to complete authentication");if(mu.info("OAuth authentication completed successfully"),r)return;if(cM({userId:(c=b.user)==null?void 0:c.id,email:(u=b.user)==null?void 0:u.email}),(d=b.user)!=null&&d.email&&p)try{const E=await Dt("/api/auth/store",{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({email:b.user.email,token:p,refreshToken:m,userId:b.user.id}),signal:n.signal});E.ok||mu.warn(`Local auth store returned ${E.status}`)}catch(E){if(r)return;mu.warn("Failed to store auth locally:",E)}if(r)return;window.sessionStorage.setItem(wg,"1");const S=window.location.pathname;window.history.replaceState({},document.title,S),t({isProcessing:!1,isComplete:!0,error:null})}catch(f){if(r)return;mu.warn("OAuth callback error:",f),t({isProcessing:!1,isComplete:!1,error:ts(f,"Unknown error occurred")})}}})(),()=>{r=!0,n.abort()}},[]),e},mue=3e3,gue=(e,t=Dt)=>{const n=new AbortController;let r;const s={onmessage:null,onerror:null,close:()=>{n.abort(),clearTimeout(r)}},i=async()=>{var c,u,d;let o=!1;try{const f=await t(e,{signal:n.signal,headers:{Accept:"text/event-stream"}});if(o=f.status===401||f.status===403,!f.ok||!f.body)throw await((c=f.body)==null?void 0:c.cancel()),new Error(`Event stream request failed (${f.status}).`);const p=f.body.getReader(),m=new TextDecoder;let v="",_=[];try{for(;!n.signal.aborted;){const w=await p.read();if(w.done)break;v+=m.decode(w.value,{stream:!0});let b=v.indexOf(`
|
|
201
|
+
`);for(;b!==-1;){const S=v.slice(0,b).replace(/\r$/,"");v=v.slice(b+1),S===""?(_.length>0&&!n.signal.aborted&&((u=s.onmessage)==null||u.call(s,{data:_.join(`
|
|
202
|
+
`)})),_=[]):S.startsWith("data:")&&_.push(S.slice(5).replace(/^ /,"")),b=v.indexOf(`
|
|
203
|
+
`)}}}finally{await p.cancel().catch(()=>{}),p.releaseLock()}}catch(f){n.signal.aborted||(d=s.onerror)==null||d.call(s,f)}!n.signal.aborted&&!o&&(r=setTimeout(()=>void i(),mue))};return i(),s},A_=Ls("useAgentVariantsSession"),vue=({enabled:e=!0}={})=>{const t=Nt(Qh),n=Nt(Z4),r=Nt(j4),s=Nt(B4),i=g.useRef(null);g.useEffect(()=>{if(n(!1),!e)return;const o=gue("/api/variants/events");return o.onmessage=c=>{try{const u=JSON.parse(c.data),d=i.current;if(u.active){const p=new Set(u.variants.map(m=>m.requestId).filter(m=>!!m));s(m=>m.filter(_=>!p.has(_.requestId))),u.sessionId!==i.current&&(i.current=u.sessionId,r(!0))}else i.current=null;t(u),n(!0),u.active&&u.sessionId!==d&&Dt(`/api/variants/${u.sessionId}/preview-port`,{method:"POST",headers:{"content-type":"application/json"},body:JSON.stringify({variantId:null})}).catch(p=>A_.warn("failed to reset preview-port on session switch",p))}catch(u){A_.warn("failed to parse SSE event payload",u)}},o.onerror=c=>{A_.warn("SSE error (auto-reconnects)",c)},()=>{o.close()}},[e,t,n,r,s])},yue=({name:e,projectPath:t})=>{const n=t==null?void 0:t.split(/[\\/]/).filter(Boolean).pop(),r=(e==null?void 0:e.trim())||n;return r?`${r} — Rivet`:"Rivet"},_ue=e=>(document.title=e,()=>{document.title="Rivet"}),G2=274,xg=395,T_=Math.min(xg,Math.round((G2+xg)/2*1.1)),tT="rivet:panelWidth:v2",wue=({libraryOrigin:e})=>{const t=vt(V4)>0,[n,r]=hL(j4),s=Ms(),i=pJ(),o=g.useCallback(R=>{const D=!n;s==null||s.capture("editor.ui_toggled",{source:R,isOpen:D}),r(D)},[n,s,r]),[c,u]=g.useState(()=>{if(typeof window>"u")return T_;const R=Number(window.localStorage.getItem(tT));return Number.isFinite(R)&&R>=G2&&R<=xg?R:T_}),[d,f]=g.useState(!1),[p,m]=g.useState(eue),v=n?c:0,_=n?gg.slow:gg.moderate,[w,b]=g.useState(n);!n&&w&&b(!1);const[S,E]=g.useState(0);v!==S&&(E(v),n&&m(R=>Jce({position:R,boundsLeftPx:c}))),g.useEffect(()=>{window.localStorage.setItem(tT,String(c))},[c]),g.useEffect(()=>{const R=D=>{if(!oL(D.target)){if(Fae(D)){D.preventDefault(),o("shortcut");return}D.key!=="Escape"||!n||(D.preventDefault(),r(!1))}};return window.addEventListener("keydown",R),()=>window.removeEventListener("keydown",R)},[n,r,o]);const C=g.useCallback(R=>{R.preventDefault(),R.stopPropagation();const D=R.clientX,U=c;f(!0);const W=Y=>{const J=Math.min(xg,Math.max(G2,U+(Y.clientX-D)));u(J)},H=()=>{window.removeEventListener("pointermove",W),window.removeEventListener("pointerup",H),window.removeEventListener("pointercancel",H),f(!1)};window.addEventListener("pointermove",W),window.addEventListener("pointerup",H),window.addEventListener("pointercancel",H)},[c]),A=g.useCallback(()=>u(T_),[]),T=pue(),M=vt(sv);vue({enabled:!M});const O=T.isProcessing?"Completing authentication...":null;return P.jsxs(ta.div,{className:"relative flex h-screen overflow-hidden",initial:!1,animate:{opacity:1},transition:{duration:.5,ease:"easeOut"},"data-cy":"rivet-app",children:[O!==null?P.jsx("div",{className:"absolute inset-0 z-50",children:P.jsx(Vce,{message:O})}):null,P.jsx(Dce,{}),P.jsx(P.Fragment,{children:t?null:P.jsxs(P.Fragment,{children:[P.jsx("div",{className:"relative order-first h-full flex-shrink-0",style:{width:w?c:0},children:P.jsxs(ta.div,{className:"absolute inset-y-0 left-0 z-30",initial:!1,animate:{x:n?0:-c},transition:i?{duration:0}:_,onAnimationComplete:()=>{n&&b(!0)},style:{width:c,willChange:"transform"},children:[P.jsx(Lle,{onClose:()=>r(!1),libraryOrigin:e}),P.jsx("div",{role:"separator","aria-orientation":"vertical","aria-label":"Resize panel",onPointerDown:C,onDoubleClick:A,className:"group/resize absolute inset-y-0 right-0 z-20 flex w-3 cursor-col-resize touch-none justify-end",children:P.jsx("span",{className:`h-full transition-all duration-150 ${d?"bg-soft-foreground w-0.5":"bg-border-strong group-hover/resize:bg-soft-foreground w-px group-hover/resize:w-0.5"}`})})]})}),d&&P.jsx("div",{className:"fixed inset-0 z-[100] cursor-col-resize"}),P.jsx(rue,{isVisible:!0,isPanelOpen:n,isReducedMotion:!!i,position:p,dragBoundsLeftPx:v,onPositionChange:m,onToggle:()=>o("click")})]})}),P.jsx(zle,{})]})},q2="rivet_connect_deep_link",bue=()=>{if(typeof window>"u")return null;const e=new URLSearchParams(window.location.search),t=e.get("connect"),n=t??window.sessionStorage.getItem(q2);if(n!=="pinterest"&&n!=="arena"&&n!=="x")return null;if(window.sessionStorage.setItem(q2,n),t){e.delete("connect");const r=e.toString();window.history.replaceState(null,document.title,window.location.pathname+(r?`?${r}`:"")+window.location.hash)}return n},xue=bue(),Sue=()=>{const[e]=g.useState(()=>typeof window<"u"&&window.sessionStorage.getItem(wg)==="1"),[t,n]=g.useState(!1),[r,s]=g.useState(xue);g.useEffect(()=>{e&&window.sessionStorage.removeItem(wg)},[e]);const{config:i,refetchConfig:o,loading:c,error:u}=hue(),d=Nt(rv);g.useEffect(()=>(d((i==null?void 0:i.projectPath)??null),_ue(yue({name:i==null?void 0:i.projectName,projectPath:i==null?void 0:i.projectPath}))),[i==null?void 0:i.projectPath,i==null?void 0:i.projectName,d]);const f=Nt(sv),{startLogin:p,isStartingLogin:m,loginError:v}=p$(),[_,w]=g.useState(!1);jJ(i??void 0),g.useEffect(()=>{i&&Qe.register({source:"visual_editor",surface:"visual_editor"})},[i]);const b=i!=null&&i.agentModeAvailable!==!0,S=g.useCallback(async()=>{w(!0),f(!0);try{await o()}finally{f(!1),w(!1)}},[o,f]);if(!c&&i===null&&!_){const T=u||"Could not load Rivet configuration.";return P.jsx("div",{className:"bg-background flex h-screen items-center justify-center px-6",children:P.jsxs("div",{className:"border-border-strong bg-background w-full max-w-md rounded-lg border p-6 text-center shadow-lg",children:[P.jsx("p",{className:"text-foreground text-sm font-medium",children:"We could not start Rivet yet."}),P.jsx("p",{className:"text-soft-foreground mt-2 text-xs",children:T}),P.jsx("button",{type:"button",className:"border-border-strong text-foreground hover:bg-background/80 mt-4 rounded-md border px-3 py-1.5 text-xs",onClick:()=>{S()},children:"Retry"})]})})}if(b)return P.jsx(zce,{isSigningIn:m,onStartSignIn:()=>{p()},errorMessage:v});const C=(i==null?void 0:i.agentModeAvailable)===!0&&r!==null,A=(i==null?void 0:i.agentModeAvailable)===!0&&e&&!t&&!C;return P.jsxs(P.Fragment,{children:[P.jsx(wue,{libraryOrigin:(i==null?void 0:i.libraryOrigin)??null}),P.jsx(B2,{context:"onboarding",isOpen:A,onClose:()=>n(!0)}),P.jsx(B2,{context:"menu",isOpen:C,highlightProvider:r,onClose:()=>{window.sessionStorage.removeItem(q2),s(null)}})]})};d9();const Eue=g.lazy(()=>r9(()=>import("./LibraryEntry-CSU5OJwC.js"),[])),cS=window.location.pathname.startsWith("/rivet/library");cS||OJ();const kue=new iG,Cue=()=>P.jsx("div",{style:{display:"flex",height:"100vh",alignItems:"center",justifyContent:"center"},children:P.jsx("p",{style:{fontSize:"14px",color:"var(--foreground)"},children:"Something went wrong. Please reload the page."})}),E$=document.getElementById("root");if(!E$)throw new Error("Rivet root element is missing");const Pue=()=>FJ.createRoot(E$).render(P.jsx(Ee.StrictMode,{children:P.jsx(uX,{reducedMotion:"user",children:P.jsx(yJ,{client:Qe,children:P.jsx(EJ,{fallback:P.jsx(Cue,{}),children:P.jsx(MK,{client:kue,children:cS?P.jsx(g.Suspense,{fallback:P.jsx("div",{className:"bg-background h-screen"}),children:P.jsx(Eue,{})}):P.jsx(Sue,{})})})})})})),Aue=async()=>{cS&&await kK(),await OK(),Pue()};Aue();export{$b as $,Yx as A,ir as B,rn as C,ev as D,ts as E,b$ as F,Id as G,Xee as H,qee as I,oM as J,Vi as K,UL as L,nS as M,yr as N,Kee as O,Oue as P,JK as Q,Lu as R,Cd as S,Ah as T,ze as U,Iue as V,Rue as W,At as X,oa as Y,Pn as Z,re as _,oG as a,Ts as a0,tde as a1,nde as a2,CK as a3,Kae as a4,B2 as a5,or as a6,Ng as a7,$ue as a8,Lue as a9,zce as aA,Dt as aB,eM as aC,EK as aD,SK as aE,Bue as aF,vt as aa,jJ as ab,Yue as ac,yue as ad,Que as ae,_ue as af,Cx as ag,Oae as ah,Nle as ai,Eoe as aj,Hue as ak,Uue as al,jae as am,FL as an,Vue as ao,Fue as ap,Due as aq,iv as ar,Nue as as,Mue as at,jue as au,zue as av,Kue as aw,Wue as ax,Zue as ay,p$ as az,cG as b,g as c,uG as d,hG as e,dG as f,fs as g,pG as h,mG as i,fG as j,Ms as k,P as l,_2 as m,mr as n,nv as o,An as p,Gee as q,pM as r,Xm as s,rS as t,kd as u,Va as v,PL as w,zL as x,tv as y,Pie as z};
|
|
204
|
+
//# sourceMappingURL=main-DeCxjHC1.js.map
|