rivet-design 0.27.0 → 0.27.1
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/agent-variants/DirectionRefReservations.d.ts +11 -0
- package/dist/agent-variants/DirectionRefReservations.js +47 -0
- package/dist/agent-variants/SessionStore.d.ts +10 -1
- package/dist/agent-variants/SessionStore.js +25 -2
- package/dist/agent-variants/WorkItemRequestTimes.d.ts +6 -0
- package/dist/agent-variants/WorkItemRequestTimes.js +21 -0
- package/dist/agent-variants/WorktreeOrchestrator.d.ts +2 -1
- package/dist/agent-variants/WorktreeOrchestrator.js +92 -78
- package/dist/agent-variants/contracts.d.ts +4 -0
- package/dist/agent-variants/existingStaticEntry.d.ts +34 -0
- package/dist/agent-variants/existingStaticEntry.js +136 -0
- package/dist/agent-variants/staticPreviewFiles.js +1 -1
- package/dist/agent-variants/variant-project-runtime.d.ts +2 -1
- package/dist/agent-variants/variantsTelemetry.d.ts +4 -0
- package/dist/agent-variants/variantsTelemetry.js +2 -0
- package/dist/agent-variants/workItemInput.d.ts +22 -0
- package/dist/agent-variants/workItemInput.js +12 -1
- package/dist/cli/commands/directionTarget.d.ts +23 -0
- package/dist/cli/commands/directionTarget.js +87 -0
- package/dist/cli/commands/open.js +28 -4
- package/dist/cli/commands/variants.js +36 -43
- package/dist/cli/envelope.d.ts +1 -1
- package/dist/cli/envelope.js +1 -0
- package/dist/cli/projectRuntimeUpgrade.d.ts +11 -0
- package/dist/cli/projectRuntimeUpgrade.js +43 -11
- package/dist/config/pluginMetrics.js +2 -0
- package/dist/mcp/explorationSchema.js +1 -1
- package/dist/mcp/getExploration.js +11 -5
- package/dist/proxy-middleware/proxy-config.js +7 -0
- package/dist/routes/agentVariants.js +4 -0
- package/dist/routes/cli.js +10 -1
- package/dist/server.js +12 -6
- package/dist/services/ProjectLibrary.d.ts +4 -1
- package/dist/services/ProjectLibrary.js +14 -9
- package/dist/services/ProjectRuntimeService.d.ts +8 -0
- package/dist/services/ProjectRuntimeService.js +15 -2
- package/dist/services/TelemetryService.d.ts +5 -0
- package/dist/services/TelemetryService.js +19 -0
- package/dist/services/VariantHistoryService.d.ts +8 -0
- package/dist/services/VariantHistoryService.js +40 -0
- package/dist/services/WorktreeManager.d.ts +1 -0
- package/dist/services/WorktreeManager.js +12 -0
- package/dist/services/createAgentVariantsOrchestrator.js +9 -2
- package/dist/services/directionRefs.d.ts +21 -0
- package/dist/services/directionRefs.js +148 -0
- package/dist/services/projectDirections.d.ts +22 -0
- package/dist/services/projectDirections.js +38 -0
- package/dist/types/direction-ref.d.ts +36 -0
- package/dist/types/direction-ref.js +3 -0
- package/dist/types/variant-history.d.ts +3 -1
- package/dist/utils/skills/cli-guidance.js +4 -3
- package/dist/utils/subprocessEnvironment.d.ts +1 -1
- package/dist/utils/subprocessEnvironment.js +0 -1
- package/package.json +3 -3
- package/src/ui/dist/assets/LibraryEntry-BZ5EdFgA.js +37 -0
- package/src/ui/dist/assets/main-MepMmTwb.css +1 -0
- package/src/ui/dist/assets/main-RriU35pI.js +497 -0
- package/src/ui/dist/index.html +2 -2
- package/dist/services/StaticPreviewServer.d.ts +0 -8
- package/dist/services/StaticPreviewServer.js +0 -207
- package/src/ui/dist/assets/LibraryEntry-RI9Lc7P3.js +0 -37
- package/src/ui/dist/assets/main-D0UmAaUe.css +0 -1
- package/src/ui/dist/assets/main-DgrLzS5j.js +0 -497
- package/src/ui/dist/fonts/Goldman-Bold.woff2 +0 -0
- package/src/ui/dist/fonts/Goldman-Regular.woff2 +0 -0
|
@@ -1,497 +0,0 @@
|
|
|
1
|
-
var H8=t=>{throw TypeError(t)};var Z_=(t,e,n)=>e.has(t)||H8("Cannot "+n);var W=(t,e,n)=>(Z_(t,e,"read from private field"),n?n.call(t):e.get(t)),st=(t,e,n)=>e.has(t)?H8("Cannot add the same private member more than once"):e instanceof WeakSet?e.add(t):e.set(t,n),Me=(t,e,n,r)=>(Z_(t,e,"write to private field"),r?r.call(t,n):e.set(t,n),n),Pt=(t,e,n)=>(Z_(t,e,"access private method"),n);var H0=(t,e,n,r)=>({set _(s){Me(t,e,s,n)},get _(){return W(t,e,r)}});function aH(t,e){for(var n=0;n<e.length;n++){const r=e[n];if(typeof r!="string"&&!Array.isArray(r)){for(const s in r)if(s!=="default"&&!(s in t)){const i=Object.getOwnPropertyDescriptor(r,s);i&&Object.defineProperty(t,s,i.get?i:{enumerable:!0,get:()=>r[s]})}}}return Object.freeze(Object.defineProperty(t,Symbol.toStringTag,{value:"Module"}))}(function(){const e=document.createElement("link").relList;if(e&&e.supports&&e.supports("modulepreload"))return;for(const 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 lH="modulepreload",cH=function(t){return"/"+t},U8={},q4=function(e,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(h=>({status:"fulfilled",value:h}),h=>({status:"rejected",reason:h}))))};document.getElementsByTagName("link");const l=document.querySelector("meta[property=csp-nonce]"),c=(l==null?void 0:l.nonce)||(l==null?void 0:l.getAttribute("nonce"));s=o(n.map(d=>{if(d=cH(d),d in U8)return;U8[d]=!0;const f=d.endsWith(".css"),h=f?'[rel="stylesheet"]':"";if(document.querySelector(`link[href="${d}"]${h}`))return;const m=document.createElement("link");if(m.rel=f?"stylesheet":lH,f||(m.as="script"),m.crossOrigin="",m.href=d,c&&m.setAttribute("nonce",c),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 l=new Event("vite:preloadError",{cancelable:!0});if(l.payload=o,window.dispatchEvent(l),!l.defaultPrevented)throw o}return s.then(o=>{for(const l of o||[])l.status==="rejected"&&i(l.reason);return e().catch(i)})};function E1(t){return t&&t.__esModule&&Object.prototype.hasOwnProperty.call(t,"default")?t.default:t}var W_={exports:{}},Oh={},q_={exports:{}},Mt={};/**
|
|
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 B8;function uH(){if(B8)return Mt;B8=1;var t=Symbol.for("react.element"),e=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"),l=Symbol.for("react.forward_ref"),c=Symbol.for("react.suspense"),d=Symbol.for("react.memo"),f=Symbol.for("react.lazy"),h=Symbol.iterator;function m(D){return D===null||typeof D!="object"?null:(D=h&&D[h]||D["@@iterator"],typeof D=="function"?D:null)}var v={isMounted:function(){return!1},enqueueForceUpdate:function(){},enqueueReplaceState:function(){},enqueueSetState:function(){}},_=Object.assign,y={};function w(D,K,de){this.props=D,this.context=K,this.refs=y,this.updater=de||v}w.prototype.isReactComponent={},w.prototype.setState=function(D,K){if(typeof D!="object"&&typeof D!="function"&&D!=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,D,K,"setState")},w.prototype.forceUpdate=function(D){this.updater.enqueueForceUpdate(this,D,"forceUpdate")};function x(){}x.prototype=w.prototype;function k(D,K,de){this.props=D,this.context=K,this.refs=y,this.updater=de||v}var P=k.prototype=new x;P.constructor=k,_(P,w.prototype),P.isPureReactComponent=!0;var C=Array.isArray,T=Object.prototype.hasOwnProperty,O={current:null},I={key:!0,ref:!0,__self:!0,__source:!0};function R(D,K,de){var ie,ce={},he=null,xe=null;if(K!=null)for(ie in K.ref!==void 0&&(xe=K.ref),K.key!==void 0&&(he=""+K.key),K)T.call(K,ie)&&!I.hasOwnProperty(ie)&&(ce[ie]=K[ie]);var oe=arguments.length-2;if(oe===1)ce.children=de;else if(1<oe){for(var re=Array(oe),Se=0;Se<oe;Se++)re[Se]=arguments[Se+2];ce.children=re}if(D&&D.defaultProps)for(ie in oe=D.defaultProps,oe)ce[ie]===void 0&&(ce[ie]=oe[ie]);return{$$typeof:t,type:D,key:he,ref:xe,props:ce,_owner:O.current}}function N(D,K){return{$$typeof:t,type:D.type,key:K,ref:D.ref,props:D.props,_owner:D._owner}}function L(D){return typeof D=="object"&&D!==null&&D.$$typeof===t}function z(D){var K={"=":"=0",":":"=2"};return"$"+D.replace(/[=:]/g,function(de){return K[de]})}var $=/\/+/g;function G(D,K){return typeof D=="object"&&D!==null&&D.key!=null?z(""+D.key):K.toString(36)}function X(D,K,de,ie,ce){var he=typeof D;(he==="undefined"||he==="boolean")&&(D=null);var xe=!1;if(D===null)xe=!0;else switch(he){case"string":case"number":xe=!0;break;case"object":switch(D.$$typeof){case t:case e:xe=!0}}if(xe)return xe=D,ce=ce(xe),D=ie===""?"."+G(xe,0):ie,C(ce)?(de="",D!=null&&(de=D.replace($,"$&/")+"/"),X(ce,K,de,"",function(Se){return Se})):ce!=null&&(L(ce)&&(ce=N(ce,de+(!ce.key||xe&&xe.key===ce.key?"":(""+ce.key).replace($,"$&/")+"/")+D)),K.push(ce)),1;if(xe=0,ie=ie===""?".":ie+":",C(D))for(var oe=0;oe<D.length;oe++){he=D[oe];var re=ie+G(he,oe);xe+=X(he,K,de,re,ce)}else if(re=m(D),typeof re=="function")for(D=re.call(D),oe=0;!(he=D.next()).done;)he=he.value,re=ie+G(he,oe++),xe+=X(he,K,de,re,ce);else if(he==="object")throw K=String(D),Error("Objects are not valid as a React child (found: "+(K==="[object Object]"?"object with keys {"+Object.keys(D).join(", ")+"}":K)+"). If you meant to render a collection of children, use an array instead.");return xe}function q(D,K,de){if(D==null)return D;var ie=[],ce=0;return X(D,ie,"","",function(he){return K.call(de,he,ce++)}),ie}function H(D){if(D._status===-1){var K=D._result;K=K(),K.then(function(de){(D._status===0||D._status===-1)&&(D._status=1,D._result=de)},function(de){(D._status===0||D._status===-1)&&(D._status=2,D._result=de)}),D._status===-1&&(D._status=0,D._result=K)}if(D._status===1)return D._result.default;throw D._result}var ee={current:null},V={transition:null},Q={ReactCurrentDispatcher:ee,ReactCurrentBatchConfig:V,ReactCurrentOwner:O};function U(){throw Error("act(...) is not supported in production builds of React.")}return Mt.Children={map:q,forEach:function(D,K,de){q(D,function(){K.apply(this,arguments)},de)},count:function(D){var K=0;return q(D,function(){K++}),K},toArray:function(D){return q(D,function(K){return K})||[]},only:function(D){if(!L(D))throw Error("React.Children.only expected to receive a single React element child.");return D}},Mt.Component=w,Mt.Fragment=n,Mt.Profiler=s,Mt.PureComponent=k,Mt.StrictMode=r,Mt.Suspense=c,Mt.__SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED=Q,Mt.act=U,Mt.cloneElement=function(D,K,de){if(D==null)throw Error("React.cloneElement(...): The argument must be a React element, but you passed "+D+".");var ie=_({},D.props),ce=D.key,he=D.ref,xe=D._owner;if(K!=null){if(K.ref!==void 0&&(he=K.ref,xe=O.current),K.key!==void 0&&(ce=""+K.key),D.type&&D.type.defaultProps)var oe=D.type.defaultProps;for(re in K)T.call(K,re)&&!I.hasOwnProperty(re)&&(ie[re]=K[re]===void 0&&oe!==void 0?oe[re]:K[re])}var re=arguments.length-2;if(re===1)ie.children=de;else if(1<re){oe=Array(re);for(var Se=0;Se<re;Se++)oe[Se]=arguments[Se+2];ie.children=oe}return{$$typeof:t,type:D.type,key:ce,ref:he,props:ie,_owner:xe}},Mt.createContext=function(D){return D={$$typeof:o,_currentValue:D,_currentValue2:D,_threadCount:0,Provider:null,Consumer:null,_defaultValue:null,_globalName:null},D.Provider={$$typeof:i,_context:D},D.Consumer=D},Mt.createElement=R,Mt.createFactory=function(D){var K=R.bind(null,D);return K.type=D,K},Mt.createRef=function(){return{current:null}},Mt.forwardRef=function(D){return{$$typeof:l,render:D}},Mt.isValidElement=L,Mt.lazy=function(D){return{$$typeof:f,_payload:{_status:-1,_result:D},_init:H}},Mt.memo=function(D,K){return{$$typeof:d,type:D,compare:K===void 0?null:K}},Mt.startTransition=function(D){var K=V.transition;V.transition={};try{D()}finally{V.transition=K}},Mt.unstable_act=U,Mt.useCallback=function(D,K){return ee.current.useCallback(D,K)},Mt.useContext=function(D){return ee.current.useContext(D)},Mt.useDebugValue=function(){},Mt.useDeferredValue=function(D){return ee.current.useDeferredValue(D)},Mt.useEffect=function(D,K){return ee.current.useEffect(D,K)},Mt.useId=function(){return ee.current.useId()},Mt.useImperativeHandle=function(D,K,de){return ee.current.useImperativeHandle(D,K,de)},Mt.useInsertionEffect=function(D,K){return ee.current.useInsertionEffect(D,K)},Mt.useLayoutEffect=function(D,K){return ee.current.useLayoutEffect(D,K)},Mt.useMemo=function(D,K){return ee.current.useMemo(D,K)},Mt.useReducer=function(D,K,de){return ee.current.useReducer(D,K,de)},Mt.useRef=function(D){return ee.current.useRef(D)},Mt.useState=function(D){return ee.current.useState(D)},Mt.useSyncExternalStore=function(D,K,de){return ee.current.useSyncExternalStore(D,K,de)},Mt.useTransition=function(){return ee.current.useTransition()},Mt.version="18.3.1",Mt}var Z8;function $S(){return Z8||(Z8=1,q_.exports=uH()),q_.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 W8;function dH(){if(W8)return Oh;W8=1;var t=$S(),e=Symbol.for("react.element"),n=Symbol.for("react.fragment"),r=Object.prototype.hasOwnProperty,s=t.__SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED.ReactCurrentOwner,i={key:!0,ref:!0,__self:!0,__source:!0};function o(l,c,d){var f,h={},m=null,v=null;d!==void 0&&(m=""+d),c.key!==void 0&&(m=""+c.key),c.ref!==void 0&&(v=c.ref);for(f in c)r.call(c,f)&&!i.hasOwnProperty(f)&&(h[f]=c[f]);if(l&&l.defaultProps)for(f in c=l.defaultProps,c)h[f]===void 0&&(h[f]=c[f]);return{$$typeof:e,type:l,key:m,ref:v,props:h,_owner:s.current}}return Oh.Fragment=n,Oh.jsx=o,Oh.jsxs=o,Oh}var q8;function fH(){return q8||(q8=1,W_.exports=dH()),W_.exports}var S=fH();const hH="x-rivet-editor-token",G8="editorToken",pH=["/api/account","/api/config","/api/auth/store","/api/auth/logout","/api/library/browser-launches","/api/integrations","/api/reference-profiles"],mH=/^\/api\/variants\/(?:[^/]+\/static\/|history\/[^/]+\/[^/]+\/(?:preview(?:\/|$)|site\/)|[^/]+\/[^/]+\/references\/[^/]+\/image\/?$)/,gH=(t,e="GET")=>{const n=t.split(/[?#]/)[0].toLowerCase();return/^\/api\/variants(?:\/|$)/.test(n)?!["GET","HEAD"].includes(e.toUpperCase())||!mH.test(n):pH.some(r=>n===r||n.startsWith(`${r}/`))},Qw="rivet_editor_token";let Jw;const vH=()=>{if(window.location.pathname.startsWith("/rivet/library"))return;const t=new URLSearchParams(window.location.hash.slice(1)),e=t.get(G8);if(e===null)return;Jw=e||null,t.delete(G8);const n=t.toString();window.history.replaceState(null,"",`${window.location.pathname}${window.location.search}${n?`#${n}`:""}`);try{e?window.sessionStorage.setItem(Qw,e):window.sessionStorage.removeItem(Qw)}catch{}},yH=()=>{if(Jw!==void 0)return Jw;try{return window.sessionStorage.getItem(Qw)}catch{return null}};var g=$S();const Ae=E1(g),qf=aH({__proto__:null,default:Ae},[g]);var _H={};const le="u">typeof window?window:void 0,bs="u">typeof globalThis?globalThis:le,Jr=bs==null?void 0:bs.navigator,Oe=bs==null?void 0:bs.document,dn=bs==null?void 0:bs.location,jp=bs==null?void 0:bs.fetch,jS=bs!=null&&bs.XMLHttpRequest&&"withCredentials"in new bs.XMLHttpRequest?bs.XMLHttpRequest:void 0,K8=bs==null?void 0:bs.AbortController,wH=bs==null?void 0:bs.CompressionStream,Os=Jr==null?void 0:Jr.userAgent,Mh=typeof globalThis<"u"?globalThis:le;Mh&&typeof self>"u"&&(Mh.self=Mh),Mh&&typeof File>"u"&&(Mh.File=function(){});const tt=le??{},bH="0.10.6",Za={DEBUG:!1,LIB_VERSION:bH,LIB_NAME:"browser-common"};var Ho=(function(t){return t.AnonymousId="anonymous_id",t.DistinctId="distinct_id",t.Props="props",t.EnablePersonProcessing="enable_person_processing",t.PersonMode="person_mode",t.FeatureFlagDetails="feature_flag_details",t.FeatureFlags="feature_flags",t.FeatureFlagPayloads="feature_flag_payloads",t.BootstrapFeatureFlagDetails="bootstrap_feature_flag_details",t.BootstrapFeatureFlags="bootstrap_feature_flags",t.BootstrapFeatureFlagPayloads="bootstrap_feature_flag_payloads",t.OverrideFeatureFlags="override_feature_flags",t.Queue="queue",t.AiQueue="ai_queue",t.AiCaptureQueue="ai_capture_queue",t.LogsQueue="logs_queue",t.OptedOut="opted_out",t.SessionId="session_id",t.SessionStartTimestamp="session_start_timestamp",t.SessionLastTimestamp="session_timestamp",t.PersonProperties="person_properties",t.GroupProperties="group_properties",t.InstalledAppBuild="installed_app_build",t.InstalledAppVersion="installed_app_version",t.SessionReplay="session_replay",t.PushRegistered="push_registered",t.SessionReplayEventTriggerActivatedSession="session_replay_event_trigger_activated_session",t.SurveyLastSeenDate="survey_last_seen_date",t.SurveysInProgress="surveys_in_progress",t.SurveysSeen="surveys_seen",t.Surveys="surveys",t.RemoteConfig="remote_config",t.FlagsEndpointWasHit="flags_endpoint_was_hit",t.DeviceId="device_id",t})({}),eb=(function(t){return t.GZipJS="gzip-js",t.Base64="base64",t})({});const xH=["$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"],SH=["token"];function Ze(t,e){return t.indexOf(e)!==-1}const _f=function(t){return t.trim()},tb=function(t){return t.replace(/^\$/,"")};function G4(t){var e;const n=[];return(e=JSON.stringify(t,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&&e!==void 0?e:"null"}const K4=Object.prototype,FS=K4.hasOwnProperty,C1=K4.toString,We=Array.isArray||function(t){return C1.call(t)==="[object Array]"},zn=t=>typeof t=="function",dt=t=>t===Object(t)&&!We(t),Ws=t=>{if(dt(t)){for(const e in t)if(FS.call(t,e))return!1;return!0}return!1},ue=t=>t===void 0,ht=t=>C1.call(t)=="[object String]",hp=t=>ht(t)&&t.trim().length===0,Mn=t=>t===null,at=t=>ue(t)||Mn(t),Xn=t=>C1.call(t)=="[object Number]"&&t==t,Oa=t=>Xn(t)&&t>0,Ns=t=>C1.call(t)==="[object Boolean]",kH=t=>Ze(xH,t),EH=t=>Ze(SH,t);function Y4(t){return t===null||typeof t!="object"}function hv(t,e){return{}.toString.call(t)===`[object ${e}]`}function Gf(t){switch({}.toString.call(t)){case"[object Error]":case"[object Exception]":case"[object DOMException]":case"[object DOMError]":case"[object WebAssembly.Exception]":return!0;default:return X4(t,Error)}}function zS(t){return"u">typeof Event&&X4(t,Event)}function X4(t,e){try{return t instanceof e}catch{return!1}}const CH=[!0,"true",1,"1","yes"],G_=t=>Ze(CH,t),PH=[!1,"false",0,"0","no"];function Y8(t,e,n,r,s,i,o){try{var l=t[i](o),c=l.value}catch(d){return void n(d)}l.done?e(c):Promise.resolve(c).then(r,s)}function hn(t){return function(){var e=this,n=arguments;return new Promise(function(r,s){var i=t.apply(e,n);function o(c){Y8(i,r,s,o,l,"next",c)}function l(c){Y8(i,r,s,o,l,"throw",c)}o(void 0)})}}const AH=["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"],U0=new Map,X8=function(t,e=[]){if(!t)return!1;const n=(function(o,l){let c="";for(let d=0;l.length>d;d++){const f=l[d];c+=f.length+":"+f}return o.length+":"+o+"|"+l.length+":"+c})(t,e),r=U0.get(n);if(r!==void 0)return r;const s=t.toLowerCase(),i=AH.concat(e).some(o=>s.indexOf(o.toLowerCase())!==-1);return 256>U0.size||U0.clear(),U0.set(n,i),i};function Qo(t,e,n,r,s){return e>n&&(r.warn("min cannot be greater than max."),e=n),Xn(t)?t>n?(r.warn(" cannot be greater than max: "+n+". Using max value instead."),n):e>t?(r.warn(" cannot be less than min: "+e+". Using min value instead."),e):t:(r.warn(" must be a number. using max or fallback. max: "+n+", fallback: "+s),Qo(s??n,e,n,r))}var TH=class{constructor(t){this.C={},this.I=t.I,this.R=Qo(t.bucketSize,0,100,t.A),this.O=Qo(t.refillRate,0,this.R,t.A),this.$=Qo(t.refillInterval,0,864e5,t.A)}F(t,e){const n=Math.floor((e-t.lastAccess)/this.$);n>0&&(t.tokens=Math.min(t.tokens+n*this.O,this.R),t.lastAccess=t.lastAccess+n*this.$)}consumeRateLimit(t){var e;const n=Date.now(),r=String(t);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&&((e=this.I)===null||e===void 0||e.call(this,t)),s.tokens===0)}stop(){this.C={}}};const wf="Mobile",Fp="Android",pv="Tablet",Q4="Android Tablet",J4="iPad",eO="Apple Watch",Ig="Safari",P1="BlackBerry",tO="Samsung Internet",Og="Chrome",nO="Chrome iOS",rO="Internet Explorer",sO="Internet Explorer Mobile",iO="Opera",oO="Microsoft Edge",Mg="Firefox",aO="Firefox iOS",mv="Nintendo",gv="PlayStation",A1="Xbox",lO="Android Mobile",cO="Mobile Safari",K_="Windows",uO="Windows Phone",Q8="Nokia",nb="Ouya",RH="Generic "+wf.toLowerCase(),dO="Generic "+pv.toLowerCase(),rb="Konqueror",fO="Oculus Browser",hO="Vivaldi",pO="Yandex",mO="Whale",gO="DuckDuckGo",vO="Pale Moon",yO="Waterfox",sb="Brave",_O="Claude",wO="Codex",bO="ChatGPT",xO="Google Search App",Y_=new RegExp("Version/(\\d+(\\.\\d+)?)"),X_=new RegExp("(Claude|Codex|ChatGPT)\\/(\\d+(\\.\\d+)?)"),IH=new RegExp(A1,"i"),OH=new RegExp("PlayStation \\w+","i"),MH=new RegExp("Nintendo \\w+","i"),VS=new RegExp("BlackBerry|PlayBook|BB10","i"),NH={"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"},SO=function(t,e,n,r){return e=e||"",(function(i){return i!=null&&i.brave?sb:null})(n)||(r!=null&&r.detectGoogleSearchApp&&Ze(t,"GSA/")?xO:Ze(t," OPR/")&&Ze(t,"Mini")?"Opera Mini":Ze(t," OPR/")?iO:VS.test(t)?P1:Ze(t,"IEMobile")||Ze(t,"WPDesktop")?sO:Ze(t,"OculusBrowser")?fO:Ze(t,"SamsungBrowser")?tO:Ze(t,"Edge")||Ze(t,"Edg/")?oO:Ze(t,"Vivaldi/")?hO:Ze(t,"YaBrowser/")?pO:Ze(t,"Whale/")?mO:Ze(t,"DuckDuckGo/")||Ze(t,"Ddg/")?gO:Ze(t,"Claude/")?_O:Ze(t,"Codex/")?wO:Ze(t,"ChatGPT/")?bO:Ze(t,"FBIOS")?"Facebook Mobile":Ze(t,"UCWEB")||Ze(t,"UCBrowser")?"UC Browser":Ze(t,"CriOS")?nO:Ze(t,"CrMo")||Ze(t,Og)?Og:Ze(t,Fp)&&Ze(t,Ig)?lO:Ze(t,"FxiOS")?aO:Ze(t.toLowerCase(),rb.toLowerCase())?rb:Ze(t,"Brave/")?sb:((i,o)=>o&&Ze(o,"Apple")||(function(l){return Ze(l,Ig)&&!Ze(l,Og)&&!Ze(l,Fp)})(i))(t,e)?Ze(t,wf)?cO:Ig:Ze(t,"PaleMoon/")?vO:Ze(t,"Waterfox/")?yO:Ze(t,Mg)?Mg:Ze(t,"MSIE")||Ze(t,"Trident/")?rO:Ze(t,"Gecko")?Mg:"")},LH={[sO]:[new RegExp("rv:(\\d+(\\.\\d+)?)")],[oO]:[new RegExp("Edge?\\/(\\d+(\\.\\d+)?)")],[Og]:[new RegExp("(Chrome|CrMo)\\/(\\d+(\\.\\d+)?)")],[nO]:[new RegExp("CriOS\\/(\\d+(\\.\\d+)?)")],"UC Browser":[new RegExp("(UCBrowser|UCWEB)\\/(\\d+(\\.\\d+)?)")],[Ig]:[Y_],[cO]:[Y_],[iO]:[new RegExp("(Opera|OPR)\\/(\\d+(\\.\\d+)?)")],[Mg]:[new RegExp("Firefox\\/(\\d+(\\.\\d+)?)")],[aO]:[new RegExp("FxiOS\\/(\\d+(\\.\\d+)?)")],[rb]:[new RegExp("Konqueror[:/]?(\\d+(\\.\\d+)?)","i")],[P1]:[new RegExp("BlackBerry (\\d+(\\.\\d+)?)"),Y_],[lO]:[new RegExp("android\\s(\\d+(\\.\\d+)?)","i")],[tO]:[new RegExp("SamsungBrowser\\/(\\d+(\\.\\d+)?)")],[fO]:[new RegExp("OculusBrowser\\/(\\d+(\\.\\d+)?)")],[hO]:[new RegExp("Vivaldi\\/(\\d+(\\.\\d+)?)")],[pO]:[new RegExp("YaBrowser\\/(\\d+(\\.\\d+)?)")],[mO]:[new RegExp("Whale\\/(\\d+(\\.\\d+)?)")],[sb]:[new RegExp("Brave\\/(\\d+(\\.\\d+)?)")],[_O]:[X_],[wO]:[X_],[bO]:[X_],[gO]:[new RegExp("(DuckDuckGo|Ddg)\\/(\\d+(\\.\\d+)?)")],[vO]:[new RegExp("PaleMoon\\/(\\d+(\\.\\d+)?)")],[yO]:[new RegExp("Waterfox\\/(\\d+(\\.\\d+)?)")],[xO]:[new RegExp("GSA\\/(\\d+(\\.\\d+)?)")],[rO]:[new RegExp("(rv:|MSIE )(\\d+(\\.\\d+)?)")],Mozilla:[new RegExp("rv:(\\d+(\\.\\d+)?)")]},DH=function(t,e,n,r){const s=SO(t,e,n,r),i=LH[s];if(ue(i))return null;for(let o=0;i.length>o;o++){const l=t.match(i[o]);if(l)return parseFloat(l[l.length-2])}return null},J8=[[new RegExp("Xbox; Xbox (.*?)[);]","i"),t=>[A1,t&&t[1]||""]],[new RegExp(mv,"i"),[mv,""]],[new RegExp(gv,"i"),[gv,""]],[VS,[P1,""]],[new RegExp(K_,"i"),(t,e)=>{if(/Phone/.test(e)||/WPDesktop/.test(e))return[uO,""];if(new RegExp(wf).test(e)&&!/IEMobile\b/.test(e))return["Windows Mobile",""];const n=/Windows NT ([0-9.]+)/i.exec(e);if(n&&n[1]){let r=NH[n[1]]||"";return/arm/i.test(e)&&(r="RT"),[K_,r]}return[K_,""]}],[/((iPhone|iPad|iPod).*?OS (\d+)_(\d+)_?(\d+)?|iPhone)/,t=>t&&t[3]?["iOS",[t[3],t[4],t[5]||"0"].join(".")]:["iOS",""]],[/(watch.*\/(\d+\.\d+\.\d+)|watch os,(\d+\.\d+),)/i,t=>{let e="";return t&&t.length>=3&&(e=ue(t[2])?t[3]:t[2]),["watchOS",e]}],[new RegExp("(Android (\\d+)\\.(\\d+)\\.?(\\d+)?|Android)","i"),t=>t&&t[2]?[Fp,[t[2],t[3],t[4]||"0"].join(".")]:[Fp,""]],[/Mac OS X (\d+)[_.](\d+)[_.]?(\d+)?/i,t=>{const e=["Mac OS X",""];return t&&t[1]&&(e[1]=[t[1],t[2],t[3]||"0"].join(".")),e}],[/Mac/i,["Mac OS X",""]],[/CrOS/,["Chrome OS",""]],[/Linux|debian/i,["Linux",""]]],kO=function(t){for(let e=0;J8.length>e;e++){const[n,r]=J8[e],s=n.exec(t),i=s&&(zn(r)?r(s,t):r);if(i)return i}return["",""]},EO=function(t){return MH.test(t)?mv:OH.test(t)?gv:IH.test(t)?A1:new RegExp(nb,"i").test(t)?nb:new RegExp("(Windows Phone|WPDesktop)","i").test(t)?uO:/iPad/.test(t)?J4:/iPod/.test(t)?"iPod Touch":/iPhone/.test(t)?"iPhone":/(watch)(?: ?os[,/]|\d,\d\/)[\d.]+/i.test(t)?eO:VS.test(t)?P1:/(kobo)\s(ereader|touch)/i.test(t)?"Kobo":new RegExp(Q8,"i").test(t)?Q8:/(kf[a-z]{2}wi|aeo[c-r]{2})( bui|\))/i.test(t)||/(kf[a-z]+)( bui|\)).+silk\//i.test(t)?"Kindle Fire":/(Android|ZTE)/i.test(t)?new RegExp(wf).test(t)&&!/(9138B|TB782B|Nexus [97]|pixel c|HUAWEISHT|BTV|noble nook|smart ultra 6)/i.test(t)||/pixel[\daxl ]{1,6}/i.test(t)&&!/pixel c/i.test(t)||/(huaweimed-al00|tah-|APA|SM-G92|i980|zte|U304AA)/i.test(t)||/lmy47v/i.test(t)&&!/QTAQZ3/i.test(t)?Fp:Q4:new RegExp("(pda|Mobile)","i").test(t)?RH:new RegExp(pv,"i").test(t)&&!new RegExp("Tablet pc","i").test(t)?dO:""},$H=function(t,e){var n;const r=EO(t);return r===J4||r===Q4||r==="Kobo"||r==="Kindle Fire"||r===dO?pv:r===mv||r===A1||r===gv||r===nb?"Console":r===eO?"Wearable":r?wf:(e==null?void 0:e.userAgentDataPlatform)==="Android"&&((n=e==null?void 0:e.maxTouchPoints)!==null&&n!==void 0?n:0)>0?600>Math.min((s=e==null?void 0:e.screenWidth)!==null&&s!==void 0?s:0,(i=e==null?void 0:e.screenHeight)!==null&&i!==void 0?i:0)/((o=e==null?void 0:e.devicePixelRatio)!==null&&o!==void 0?o:1)?wf:pv:"Desktop";var s,i,o},Q_=/\bFBAV\/(\d+(?:\.\d+)*)/i,eP=[[/\bInstagram(?:[ /](\d+(?:\.\d+)*))?\b/i,"Instagram"],[/\bBarcelona[ /](\d+(?:\.\d+)*)?/i,"Threads"],[/\b(?:MessengerForiOS|(?:FBAN|FB_IAB)\/Orca-Android)\b/i,"Messenger",Q_],[/\bFBAN\/EMA\b/i,"Facebook Lite",Q_],[/\b(?:FBIOS|(?:FBAN|FB_IAB)\/(?:FB4A|FBIOS))\b/i,"Facebook",Q_],[/\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"]],ib="[Truncated]",Pm="[Unserializable]";function Kd(t){let e="";for(let n=0;t.length>n;n++){const r=t.charCodeAt(n);if(55296>r||r>56319)e+=56320>r||r>57343?t[n]:"�";else{const s=t.charCodeAt(n+1);56320>s||s>57343?e+="�":(e+=t[n]+t[n+1],n++)}}return e}function CO(t,e){if(!e)return t;let n=[];try{n=Object.keys(e)}catch{n=[]}for(const r of n){let s;try{s=e[r]}catch{s=Pm}Object.defineProperty(t,r,{value:s,enumerable:!0,writable:!0,configurable:!0})}return t}const J_=3e5;var PO=class{record(t){if(t.kind==="too-large")return;if(t.kind!=="retry-later")return void this.reset();if(!t.retryAfterMs)return;const e=this.isOpen(),n=Date.now(),r=Math.min(t.retryAfterMs,J_);if(!e)return this.ts=n,void(this.es=n+r);this.es=Math.max(this.es,Math.min(n+r,this.ts+J_))}remainingMs(){const t=Date.now();if(this.ts-5e3>t)return this.reset(),0;const e=Math.min(J_,Math.max(0,this.es-t));return e===0&&this.reset(),e}isOpen(){return this.remainingMs()>0}reset(){this.es=0,this.ts=0}constructor(){this.es=0,this.ts=0}};const jH=/^[0-9a-f]{8}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{12}$/i;function tP(t,e){return typeof(n=t)=="string"&&jH.test(n)?t:e();var n}function AO(t,e){const n=new Error(e);try{Object.defineProperty(n,"name",{value:t,writable:!0,enumerable:!0,configurable:!0})}catch{}return n}function oc(t){return t&&t.split("#")[0]}function nP(t){try{return t()}catch{return}}function TO(t,e){const n=setTimeout(t,e);return n!=null&&n.unref&&(n==null||n.unref()),n}function rP(t,e,n){return RO.apply(this,arguments)}function RO(){return(RO=hn(function*(t,e,n){let r;try{return yield Promise.race([t,new Promise((s,i)=>{r=TO(()=>{try{n==null||n(),s()}catch(o){i(o)}},e)})])}finally{clearTimeout(r)}})).apply(this,arguments)}function pp(t){return pp=typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?function(e){return typeof e}:function(e){return e&&typeof Symbol=="function"&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e},pp(t)}function FH(t,e,n){return(e=(function(r){var s=(function(i){if(pp(i)!="object"||!i)return i;var o=i[Symbol.toPrimitive];if(o!==void 0){var l=o.call(i,"string");if(pp(l)!="object")return l;throw new TypeError("@@toPrimitive must return a primitive value.")}return String(i)})(r);return pp(s)=="symbol"?s:s+""})(e))in t?Object.defineProperty(t,e,{value:n,enumerable:!0,configurable:!0,writable:!0}):t[e]=n,t}function sP(t,e){var n=Object.keys(t);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(t);e&&(r=r.filter(function(s){return Object.getOwnPropertyDescriptor(t,s).enumerable})),n.push.apply(n,r)}return n}function j(t){for(var e=1;arguments.length>e;e++){var n=arguments[e]!=null?arguments[e]:{};e%2?sP(Object(n),!0).forEach(function(r){FH(t,r,n[r])}):Object.getOwnPropertyDescriptors?Object.defineProperties(t,Object.getOwnPropertyDescriptors(n)):sP(Object(n)).forEach(function(r){Object.defineProperty(t,r,Object.getOwnPropertyDescriptor(n,r))})}return t}let Nh,iP,oP,gd;function zH(t){var e;const n=globalThis._posthogChunkIds,r=globalThis._debugIds;if(!n&&!r)return;const s=n?Object.keys(n):[],i=r?Object.keys(r):[];if(gd&&aP(n,s,iP)&&aP(r,i,oP))return gd;iP=n?j({},n):void 0,oP=r?j({},r):void 0,gd={},(e=Nh)!==null&&e!==void 0||(Nh={});const o=(l,c)=>{for(const f of l){const h=c[f];if(!h)continue;const m=Nh==null?void 0:Nh[f];if(m){gd[m]=h;continue}const v=t(f);for(let _=v.length-1;_>=0;_--){var d;const y=(d=v[_])===null||d===void 0?void 0:d.filename;if(y){gd[y]=h,Nh[f]=y;break}}}};return r&&o(i,r),n&&o(s,n),gd}function aP(t,e,n){return t&&n?e.length===Object.keys(n).length&&e.every(r=>t[r]===n[r]):t===n}var VH=class{constructor(t,e,n=[]){this.coercers=t,this.stackParser=e,this.modifiers=n}buildFromUnknown(t,e={}){const n=e&&e.mechanism||{handled:!0,type:"generic"},r=this.buildCoercingContext(n,e,0).apply(t),s=this.buildParsingContext(e),i=this.parseStacktrace(r,s);return{$exception_list:this.convertToExceptionList(i,n),$exception_level:"error"}}modifyFrames(t){var e=this;return hn(function*(){for(const n of t)n.stacktrace&&n.stacktrace.frames&&We(n.stacktrace.frames)&&(n.stacktrace.frames=yield e.applyModifiers(n.stacktrace.frames));return t})()}coerceFallback(t){var e;return{type:"Error",value:"Unknown error",stack:(e=t.syntheticException)===null||e===void 0?void 0:e.stack,synthetic:!0}}parseStacktrace(t,e){var n;let r,s;if(t.cause!=null&&(r=this.parseStacktrace(t.cause,e)),t.stack!=""&&t.stack!=null)try{s=this.applyChunkIds(this.stackParser(t.stack,t.synthetic?e.skipFirstLines:0),e.chunkIdMap)}catch{}return j(j({},t),{},{cause:r,stack:s,errors:(n=t.errors)===null||n===void 0?void 0:n.map(i=>this.parseStacktrace(i,e))})}applyChunkIds(t,e){return t.map(n=>(n.filename&&e&&(n.chunk_id=e[n.filename]),n))}applyCoercers(t,e){for(const n of this.coercers)if(n.match(t))return n.coerce(t,e);return this.coerceFallback(e)}applyModifiers(t){var e=this;return hn(function*(){let n=t;for(const r of e.modifiers)n=yield r(n);return n})()}convertToExceptionList(t,e){const n=[],r=(s,i,o)=>{var l;const c=n.length,d=i===void 0?j(j({type:typeof e.type=="string"&&e.type.length>0?e.type:"generic"},typeof e.handled=="boolean"?{handled:e.handled}:e.handled===void 0?{handled:!0}:{}),{},{synthetic:typeof e.synthetic=="boolean"?e.synthetic:s.synthetic,exception_id:c}):{type:"chained",source:o,synthetic:s.synthetic,exception_id:c,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,c,"cause");for(const h of(l=s.errors)!==null&&l!==void 0?l:[])r(h,c,"member")};return r(t),n}buildParsingContext(t){var e;return{chunkIdMap:zH(this.stackParser),skipFirstLines:(e=t.skipFirstLines)!==null&&e!==void 0?e:1}}getAggregateErrors(t){try{if(Gf(t)){let n=Object.getPrototypeOf(t);for(let r=0;n&&100>r;r++){var e;const s=(e=Object.getOwnPropertyDescriptor(n,"constructor"))===null||e===void 0?void 0:e.value;if(typeof s=="function"&&s.name==="AggregateError"){const i=t.errors;return We(i)?i:void 0}n=Object.getPrototypeOf(n)}}}catch{}}buildCoercingContext(t,e,n=0){let r=0,s=0,i=!1;const o=new Set,l=[],c={},d=(m,v,_=0)=>{const y=f(v,_),w=y.apply;if(y.apply=O=>{l.push(m);try{return w(O)}finally{l.pop()}},_>4||_>0&&l.indexOf(m)!==-1)return this.coerceFallback(y);const x=typeof m=="object"&&m!==null||typeof m=="function";if(_===0&&r>=50||x&&o.has(m))return;x&&o.add(m),_===0&&r++;const k=this.getAggregateErrors(m);let P,C;i||(i=!!k);try{if(P=this.applyCoercers(m,y),!P)throw c}catch(O){if(O===c)return void(_===0&&r--);if(!i)throw O;P=this.coerceFallback(y)}if(!k||r>=50)return P;try{C=k.length}catch{return P}if(!Number.isInteger(C)||0>C||C>4294967295)return P;const T=[];for(let O=0;50>r&&1e3>s&&C>O;O++){let I;s++;try{I=y.next(k[O])}catch{r++,I=this.coerceFallback(f(v+1))}I&&T.push(I)}return j(j({},P),{},{errors:T})},f=(m,v=0)=>j(j({},e),{},{syntheticException:m==0?e.syntheticException:void 0,mechanism:m==0?t:{},apply(_){const y=d(_,m,v+1);if(!y)throw c;return y},next:_=>d(_,m+1)}),h=f(n);return j(j({},h),{},{apply:m=>{var v;return(v=d(m,n))!==null&&v!==void 0?v:this.coerceFallback(h)}})}};const HH=/^([a-z][a-z0-9.+-]+):/i,UH=["http","https","file","blob","app","capacitor","ionic","webpack","webpack-internal","ng"];function BH(t){if(!t||t==="<anonymous>")return!1;const e=HH.exec(t);return!e||UH.includes(e[1].toLowerCase())}function ob(t,e,n,r,s){const i={platform:t,filename:e,function:n==="<anonymous>"?"?":n,in_app:BH(e)};return ue(r)||(i.lineno=r),ue(s)||(i.colno=s),i}const IO=(t,e)=>{const n=t.indexOf("safari-extension")!==-1,r=t.indexOf("safari-web-extension")!==-1;return n||r?[t.indexOf("@")!==-1?t.split("@")[0]:"?",n?`safari-extension:${e}`:`safari-web-extension:${e}`]:[t,e]},ZH=/^\s*at (\S+?)(?::(\d+))(?::(\d+))\s*$/i,WH=/^\s*at (?:(.+?\)(?: \[.+\])?|.*?) ?\((?:address at )?)?(?:async )?((?:<anonymous>|[-a-z]+:|.*bundle|\/)?.*?)(?::(\d+))?(?::(\d+))?\)?\s*$/i,qH=/\((\S*)(?::(\d+))(?::(\d+))\)/,GH=(t,e)=>{const n=ZH.exec(t);if(n){const[,s,i,o]=n;return ob(e,s,"?",+i,+o)}const r=WH.exec(t);if(r){if(r[2]&&r[2].indexOf("eval")===0){const o=qH.exec(r[2]);o&&(r[2]=o[1],r[3]=o[2],r[4]=o[3])}const[s,i]=IO(r[1]||"?",r[2]);return ob(e,i,s,r[3]?+r[3]:void 0,r[4]?+r[4]:void 0)}},KH=/^\s*(.*?)(?:\((.*?)\))?(?:^|@)?((?:[-a-z]+)?:\/.*?|\[native code\]|[^@]*(?:bundle|\d+\.js)|\/[\w\-. /=]+)(?::(\d+))?(?::(\d+))?\s*$/i,YH=/(\S+) line (\d+)(?: > eval line \d+)* > eval/i,XH=(t,e)=>{const n=KH.exec(t);if(n){if(n[3]&&n[3].indexOf(" > eval")>-1){const i=YH.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]=IO(s,r),ob(e,r,s,n[4]?+n[4]:void 0,n[5]?+n[5]:void 0)}},lP=/\(error: (.*)\)/;function HS(t,e){return t.filename===e.filename&&t.function===e.function&&t.module===e.module&&t.lineno===e.lineno&&t.colno===e.colno}function QH(t){for(let e=1;10>=e;e++){const n=t.length-2*e;if(0>n)break;let r=!0;for(let s=0;e>s;s++)if(!HS(t[n+s],t[n+e+s])){r=!1;break}if(r){for(let s=0;e>s;s++)t[n+s]=t[n+e+s];return t.length=n+e,{start:n,length:e}}}}function JH(t,e){const n=e.start+e.length,r=MO(t,e);r&&t.splice(n+r===t.length?n:e.start,r)}function OO(t,e){let n=e.start;for(;n>0&&HS(t[n-1],t[n-1+e.length]);)n--;return e.start-n}function MO(t,e){const n=e.start+e.length;let r=n;for(;t.length>r&&HS(t[r],t[r-e.length]);)r++;return r-n}function eU(t,e){const n=e[0];let r=t.length-(n?OO(t,n):0);for(const s of e)r-=MO(t,s);return r}function tU(t,e,n){for(let r=0;t.length>r;r++){const s=t[(e+r)%t.length],i=t[(n+r)%t.length];if(s!==i)return i>s}return!1}var nU=class{match(t){return this.isDOMException(t)||this.isDOMError(t)}coerce(t,e){const n=ht(t.stack);return{type:this.getType(t),value:this.getValue(t),stack:n?t.stack:void 0,cause:t.cause?e.next(t.cause):void 0,synthetic:!1}}getType(t){return this.isDOMError(t)?"DOMError":"DOMException"}getValue(t){const e=t.name||(this.isDOMError(t)?"DOMError":"DOMException");return t.message?`${e}: ${t.message}`:e}isDOMException(t){return hv(t,"DOMException")}isDOMError(t){return hv(t,"DOMError")}},rU=class{match(t){return Gf(t)}coerce(t,e){var n;const r=this.getStack(t),s=r===void 0?(n=e.syntheticException)===null||n===void 0?void 0:n.stack:void 0,i=!!s;return{type:this.getType(t),value:this.getMessage(t,e),stack:r??s,cause:t.cause?e.next(t.cause):void 0,synthetic:i}}getType(t){return t.name||t.constructor.name}getMessage(t,e){const n=t.message;return String(n.error&&typeof n.error.message=="string"?n.error.message:n)}getStack(t){try{const e=t.stacktrace;if(typeof e=="string"&&e.length>0)return e;const n=t.stack;return typeof n=="string"&&n.length>0?n:void 0}catch{return}}},sU=class{match(t){return!!hv(t,"ErrorEvent")&&(t.error!=null||this.gr(t))}coerce(t,e){var n;if(t.error!=null)return e.apply(t.error);const r=e.apply(t.message);return j(j({},r),{},{stack:(n=this.yr(t))!==null&&n!==void 0?n:r.stack,synthetic:!0})}gr(t){return ht(t.message)&&t.message.length>0}yr(t){var e,n;const r=t,s=(e=r.lineno)!==null&&e!==void 0?e:0,i=(n=r.colno)!==null&&n!==void 0?n:0;if(ht(r.filename)&&r.filename.length!==0&&s!==0)return`Error
|
|
18
|
-
at ${r.filename}:${s}:${i}`}};const iU=/^(?:[Uu]ncaught (?:exception: )?)?(?:((?:Eval|Internal|Range|Reference|Syntax|Type|URI|)Error): )?(.*)$/i;var oU=class{match(t){return typeof t=="string"}coerce(t,e){var n;const[r,s]=this.getInfos(t);return{type:r??"Error",value:s??t,stack:(n=e.syntheticException)===null||n===void 0?void 0:n.stack,synthetic:!0}}getInfos(t){let e="Error",n=t;const r=t.match(iU);return r&&(e=r[1],n=r[2]),[e,n]}};const aU=["fatal","error","warning","log","info","debug"];function NO(t,e=40){const n=Object.keys(t);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(e>=s.length)return r===n.length?s:s.length>e?`${s.slice(0,e)}...`:s}return""}var lU=class{match(t){return typeof t=="object"&&t!==null}coerce(t,e){var n,r;const s=this.getErrorPropertyFromObject(t);return s?e.apply(s):{type:this.getType(t),value:this.getValue(t),stack:(n=this.getStack(t))!==null&&n!==void 0?n:(r=e.syntheticException)===null||r===void 0?void 0:r.stack,level:this.isSeverityLevel(t.level)?t.level:"error",synthetic:!0}}getType(t){if(zS(t))return t.constructor.name;const e="name"in t?t.name:void 0;return ht(e)&&!hp(e)?e:"Error"}getValue(t){if("name"in t&&typeof t.name=="string"){let n=`'${t.name}' captured as exception`;return"message"in t&&typeof t.message=="string"&&(n+=` with message: '${t.message}'`),n}if("message"in t&&typeof t.message=="string")return t.message;const e=this.getObjectClassName(t);return`${e&&e!=="Object"?`'${e}'`:"Object"} captured as exception with keys: ${NO(t)}`}isSeverityLevel(t){return ht(t)&&!hp(t)&&aU.indexOf(t)>=0}getStack(t){try{return ht(t.stacktrace)&&t.stacktrace.length>0?t.stacktrace:ht(t.stack)&&t.stack.length>0?t.stack:void 0}catch{return}}getErrorPropertyFromObject(t){for(const e in t)if({}.hasOwnProperty.call(t,e)){const n=t[e];if(Gf(n))return n}}getObjectClassName(t){try{const e=Object.getPrototypeOf(t);return e?e.constructor.name:void 0}catch{return}}},cU=class{match(t){return zS(t)}coerce(t,e){var n;const r=t.constructor.name;return{type:r,value:`${r} captured as exception with keys: ${NO(t)}`,stack:(n=e.syntheticException)===null||n===void 0?void 0:n.stack,synthetic:!0}}},uU=class{match(t){return Y4(t)}coerce(t,e){var n;return{type:"Error",value:`Primitive value captured as exception: ${String(t)}`,stack:(n=e.syntheticException)===null||n===void 0?void 0:n.stack,synthetic:!0}}},dU=class{match(t){return hv(t,"PromiseRejectionEvent")||this.isCustomEventWrappingRejection(t)}isCustomEventWrappingRejection(t){if(!zS(t))return!1;try{const e=t.detail;return e!=null&&typeof e=="object"&&"reason"in e}catch{return!1}}coerce(t,e){var n;const r=this.getUnhandledRejectionReason(t);return Y4(r)?{type:"UnhandledRejection",value:`Non-Error promise rejection captured with value: ${String(r)}`,stack:(n=e.syntheticException)===null||n===void 0?void 0:n.stack,synthetic:!0}:e.apply(r)}getUnhandledRejectionReason(t){try{if("reason"in t)return t.reason;if("detail"in t&&t.detail!=null&&typeof t.detail=="object"&&"reason"in t.detail)return t.detail.reason}catch{}return t}};const vv="$message",yv="$timestamp",fU=new Set([vv,yv]),e2={enabled:!0,max_bytes:32768};function _v(t){var e;return t?{enabled:(e=t.enabled)!==null&&e!==void 0?e:e2.enabled,max_bytes:pU(t.max_bytes,e2.max_bytes)}:j({},e2)}var hU=class{constructor(t){this.ns=[],this.ss=0,this.Pr=_v(t)}setConfig(t){this.Pr=_v(t),this.rs()}add(t){const e=(function(r){let s;try{s=G4(r)}catch{return}try{const i=JSON.parse(s);if(!dt(i))return;const o=i,l=o[vv],c=o[yv];return!ht(l)||l.trim().length===0||!ht(c)&&!Xn(c)?void 0:{step:o,json:s}}catch{return}})(t);if(!e)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})(e.json);n>this.Pr.max_bytes||(this.ns.push({step:e.step,bytes:n}),this.ss+=n,this.rs())}getAttachable(){return this.ns.map(t=>t.step)}clear(){this.ns=[],this.ss=0}size(){return this.ns.length}rs(){for(;this.ss>this.Pr.max_bytes&&this.ns.length>0;){const t=this.ns.shift();t&&(this.ss-=t.bytes)}}};function pU(t,e){if(!Xn(t)||t===1/0||t===-1/0)return e;const n=Math.floor(t);return 0>n?e:n}const cP=t=>{if(typeof t!="string")return t;try{return JSON.parse(t)}catch{return t}};function uP(t){return typeof t=="string"||t}function dP(t){return typeof t=="string"?t:void 0}const mU=["$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"],LO="NativeGzipValidationError",ab=t=>t.length>=2&&t[0]===31&&t[1]===139,fP=(t,e)=>t===eb.GZipJS||e===eb.GZipJS||e==="gzip",hP=t=>!(!t||typeof t!="object")&&("name"in t?String(t.name):"")==="NotReadableError";let Lh;const B0=t=>{throw AO(LO,`Native gzip produced invalid output: ${t}`)},gU=(function(){var t=hn(function*(e,n){18>e.size&&B0("too-short");const r=new Uint8Array(yield e.slice(0,10).arrayBuffer());ab(r)&&r[2]===8||B0("invalid-header");const s=new DataView(yield e.slice(e.size-8).arrayBuffer());s.getUint32(0,!0)!==(o=>{const l=(()=>{if(Lh)return Lh;Lh=[];for(let d=0;256>d;d++){let f=d;for(let h=0;8>h;h++)f=1&f?3988292384^f>>>1:f>>>1;Lh[d]=f>>>0}return Lh})();let c=4294967295;for(let d=0;o.length>d;d++)c=l[255&(c^o[d])]^c>>>8;return(4294967295^c)>>>0})(n)&&B0("invalid-crc");const i=n.length>>>0;s.getUint32(4,!0)!==i&&B0("invalid-size")});return function(e,n){return t.apply(this,arguments)}})();function lb(){return lb=hn(function*(t,e=!0,n){try{const s=new TextEncoder().encode(t),i=new globalThis.CompressionStream("gzip"),o=i.writable.getWriter(),l=o.write(s).then(()=>o.close()).catch((r=hn(function*(f){try{yield o.abort(f)}catch{}throw f}),function(f){return r.apply(this,arguments)})),c=new Response(i.readable).blob(),[d]=yield Promise.all([c,l]);return yield gU(d,s),d}catch(s){if(n!=null&&n.rethrow)throw s;return e&&console.error("Failed to gzip compress data",s),null}var r}),lb.apply(this,arguments)}function DO(t,e){if(t==null)return{};var n,r,s=(function(o,l){if(o==null)return{};var c={};for(var d in o)if({}.hasOwnProperty.call(o,d)){if(l.includes(d))continue;c[d]=o[d]}return c})(t,e);if(Object.getOwnPropertySymbols){var i=Object.getOwnPropertySymbols(t);for(r=0;i.length>r;r++)e.includes(n=i[r])||{}.propertyIsEnumerable.call(t,n)&&(s[n]=t[n])}return s}const _s="[redacted]",vU=/^[A-Za-z0-9+/\n\r]+=*$/,yU=/^[A-Za-z0-9_-]+={0,2}$/,_U=/[-_]/,wU=/^data:[^,\s]*;base64,/i,bU=/^[A-Za-z0-9+/_-]+={0,2}$/,xU=/\bph[a-z]_[A-Za-z0-9_-]{20,}\b/g,SU=/^(authorization|cookie|set-cookie|x-api-key|api[-_]?key|api[-_]?token|access[-_]?token|refresh[-_]?token|token|password|secret|client[-_]?secret|private[-_]?key)$/i,$O=/[a-z][a-z0-9+.-]{0,63}:[^\s<>"]+/gi,kU=/[\s<>"]/,jO=new RegExp($O.source,"i"),FO=/[a-z][a-z0-9+.-]{0,63}:\/\//i,EU=new RegExp(`^${FO.source}`,"i"),CU=new RegExp(FO.source,"gi"),PU=/(^|[-_./;])(auth|token|secret|password|passwd|pwd|credential|signature|sig|key|hmac|sas|bearer|jwt|session|sessionid)([-_./;]|$)/i,AU=/^(code|AWSAccessKeyId|GoogleAccessId|Policy)$/i,TU=/[\u00A0\u1680\u2000-\u200A\u202F\u205F\u3000]/g,RU=/[A-Za-z0-9._%+-]{1,64}@[A-Za-z0-9.-]{1,255}\.[A-Za-z]{2,24}/g,IU=/\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,OU=/(^|[^\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,MU=/\b\d{3}[ .-]\d{2}[ .-]\d{4}\b/g,NU=/\b\d(?:[ ./-]?\d){12,}\b/g,pP=/\d+/g,LU=/(^|[^\w+])((?:\+?1[ ./-]?)?(?:\(\d{3}\)[ ./-]?|\d{3}[ ./-])\d{3}[ ./-]\d{4})(?![\w])/g,DU=/(^|[^\w])(\+\d{1,3}(?:[ ./()-]{0,2}\d){7,13})(?![\w])/g;function cb(t){return(function(e){return SU.test(e)})(t)||PU.test(t)||AU.test(t)}function t2(t){return t.split("&",129).length>128}function $U(t,e,n){return cb(t)||e.includes(";")&&(function(r){return r.split(";").some(s=>cb(s.split("=",1)[0]))})(e)?_s:jO.test(e)?n?US(e,{allowNestedUrls:!1,stripPunctuation:!0}):_s:e}function zO(t,e){const n=new URLSearchParams;let r=!1,s=!1;for(const[i,o]of new URLSearchParams(t)){const l=wv(i),c=wv(o);r||(r=l!==i||c!==o);const d=$U(l,c,e);r||(r=d!==c),s=cb(l)||d!==c,n.append(l,d)}return{changed:r,lastFieldSensitive:s,serialized:n.toString()}}function mP(t,e){if(!t.includes("="))return{value:jU(t,e),lastFieldSensitive:!1};const n=zO(t,e);return{value:n.changed?n.serialized:t,lastFieldSensitive:n.lastFieldSensitive}}function jU(t,e){return e?US(t,{allowNestedUrls:!1,stripPunctuation:!0}):jO.test(t)?_s:t}function FU(t,e,n){return t==="#"?!e.fragment&&(e.fragment=!0):t==="?"&&(e.fragment?n!=="="&&!e.fragmentQuery&&(e.fragmentQuery=!0):!e.query&&(e.query=!0))}function n2(t,e){var n;if(t.length>8192&&EU.test(t))return _s;const{address:r,suffix:s}=e.stripPunctuation?(function(w){let x=w.length;for(;x>0&&".,;:!?)]}'".includes(w[x-1]);)x--;return{address:w.slice(0,x),suffix:w.slice(x)}})(t):{address:t,suffix:""};let i;try{i=new URL(r)}catch{return _s+s}const o=i.search.slice(1),l=i.hash!=="",c=(function(w){const x=w.slice(1),k=x.indexOf("?");return 0>k?{head:x,tail:null}:{head:x.slice(0,k),tail:x.slice(k+1)}})(i.hash);if(t2(o)||t2(c.head)||t2((n=c.tail)!==null&&n!==void 0?n:""))return _s+s;let d=!1;(i.username||i.password)&&(i.username=_s,i.password="",d=!0);const f=zO(o,e.allowNestedUrls);f.changed&&(i.search=f.serialized,d=!0);const h=mP(c.head,e.allowNestedUrls),m=c.tail===null?null:(v=c.tail,h.lastFieldSensitive?{value:v===""?"":_s,lastFieldSensitive:!0}:mP(v,e.allowNestedUrls));var v;const _=m===null?h.value:`${h.value}?${m.value}`;_!==i.hash.slice(1)&&(i.hash=_,d=!0);const y=l?m??h:f;return(d?wv(i.toString()):r)+(y.lastFieldSensitive?"":s)}function US(t,e){return t.replace($O,n=>(function(r,s){const i=(function(c){if(!c.includes("://"))return[];const d=[...c.matchAll(CU)].map(y=>y.index),f=[],h={query:!1,fragment:!1,fragmentQuery:!1};let m=0,v=!1,_="";for(let y=0;c.length>y&&d.length>m;y++){d[m]===y&&(y>0&&_!=="="&&f.push(y),m++);const w=c[y];FU(w,h,_)?(_=w,v=!0):v&&"=&".includes(w)&&(_=w)}return f})(r);if(i.length===0)return n2(r,s);let o="",l=0;for(const c of i)o+=n2(r.slice(l,c),j(j({},s),{},{stripPunctuation:!1})),l=c;return o+n2(r.slice(l),s)})(n,j(j({},e),{},{stripPunctuation:e.stripPunctuation&&n.length!==t.length})))}function wv(t){return t.replace(xU,_s)}function VO(t,e){return(function(n){return n.length>=10240&&(vU.test(n)||(function(r){const s=wU.exec(r);if(!s)return!1;let i;try{i=decodeURIComponent(r.slice(s[0].length))}catch{return!1}return bU.test(i.replace(/[\r\n]/g,""))})(n)||_U.test(n)&&yU.test(n))})(t)?"[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(l,c){let d=c;for(;d>0&&!kU.test(l[d-1]);)d--;return d})(n,i)));if(o.length>=2*s.maxStringLength)return o+s.truncationSuffix}return r(n)})(t,n=>(function(r){return US(r,{allowNestedUrls:!0,stripPunctuation:!0})})((function(r){let s=r.replace(TU," ");return s=s.replace(RU,_s),s=s.replace(IU,_s),s=s.replace(OU,`$1${_s}`),s=s.replace(NU,VU),s=s.replace(MU,_s),s=s.replace(LU,`$1${_s}`),s=s.replace(DU,`$1${_s}`),s})(wv(n))),e)}function zU(t){let e=0,n=!1;for(let r=t.length-1;r>=0;r--){let s=t.charCodeAt(r)-48;if(0>s||s>9)return!1;n&&(s*=2,s>9&&(s-=9)),e+=s,n=!n}return e%10==0}function VU(t){const e=[];for(let i=pP.exec(t);i!==null;i=pP.exec(t))e.push({digits:i[0],start:i.index,end:i.index+i[0].length});let n="",r=0,s=0;for(;e.length>s;){let i="",o=-1;for(let l=s;e.length>l&&(i+=e[l].digits,19>=i.length);l++)i.length>=13&&zU(i)&&(o=l);0>o?s++:(n+=t.slice(r,e[s].start)+_s,r=e[o].end,s=o+1)}return n+t.slice(r)}const HU={}.propertyIsEnumerable;function bv(t,e){try{return HO(t,e,{ancestors:new WeakSet,remainingNodes:1e4},0)}catch{return[]}}function BS(t,e,n,r){if(0>=n.remainingNodes)return{stringValue:ib};if(n.remainingNodes--,Ns(t))return{boolValue:t};if(typeof t=="bigint")return(function(s,i){const o=s.toString(),l=BigInt("9223372036854775808");return s>=l||-l>s?(i==null||i.debug(`Attribute ${o} is outside the int64 range; encoding it as a string`),{stringValue:o}):{intValue:o}})(t,e);if(typeof t=="number"){if(!Number.isFinite(t))return{stringValue:String(t)};if(Number.isInteger(t)){if(Number.isSafeInteger(t))return{intValue:String(t)};if(typeof BigInt>"u")return{stringValue:String(t)};const s=BigInt(t).toString();return t>=9223372036854776e3||-9223372036854776e3>t?(e==null||e.debug(`Attribute ${s} is outside the int64 range; encoding it as a string`),{stringValue:s}):{intValue:s}}return{doubleValue:t}}if(typeof t=="string")return{stringValue:Kd(t)};if(typeof t=="function")return{stringValue:"[Function]"};if(typeof t=="symbol")return{stringValue:String(t)};if(typeof t=="object"&&t!==null){if(n.ancestors.has(t))return{stringValue:"[Circular]"};if(r>=20)return{stringValue:ib};if(t instanceof Date){const s=t.getTime(),i=Number.isFinite(s)?t.toISOString():String(t);return{stringValue:typeof i=="string"?Kd(i):String(i)}}n.ancestors.add(t);try{try{const s=t.toJSON;if(typeof s=="function")return BS(s.call(t),e,n,r+1)}catch{}return We(t)?{arrayValue:{values:UU(t,e,n,r+1)}}:{kvlistValue:{values:HO(t,e,n,r+1)}}}finally{n.ancestors.delete(t)}}return{stringValue:Kd(String(t))}}function UU(t,e,n,r){const s=[],i=Math.min(t.length,1e3);let o=0;for(;i>o&&n.remainingNodes>0;o++)try{const l=o in t?t[o]:void 0;if(at(l))continue;s.push(BS(l,e,n,r))}catch{s.push({stringValue:Pm})}return t.length>o&&s.push({stringValue:ib}),s}function HO(t,e,n,r){const s=[];for(const i in t)if(HU.call(t,i)){if(!i){e==null||e.debug("Dropping an attribute with an empty key");continue}if(s.length>=1e3||0>=n.remainingNodes){e==null||e.debug("Attributes truncated: the value exceeds the OTLP encoder budget");break}try{const o=t[i];if(Mn(o)||ue(o))continue;s.push({key:Kd(i),value:BS(o,e,n,r)})}catch{s.push({key:Kd(i),value:{stringValue:Pm}})}}return s}function UO(t,e,n){return j(j(j(j({},CO({},t.resourceAttributes)),{},{"service.name":t.serviceName||"unknown_service"},t.environment&&{"deployment.environment":t.environment}),t.serviceVersion&&{"service.version":t.serviceVersion}),{},{"telemetry.sdk.name":e,"telemetry.sdk.version":n})}const BU=["service.name","deployment.environment","service.version","telemetry.sdk.name","telemetry.sdk.version"];function BO(t,e){const n=CO({},t),r={};for(const s of BU)({}).hasOwnProperty.call(n,s)&&(r[s]=n[s],delete n[s]);return[...bv(n,e),...bv(r,e)]}const gP={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"},ZO={trace:{text:"TRACE",number:1},debug:{text:"DEBUG",number:5},info:{text:"INFO",number:9},warn:{text:"WARN",number:13},error:{text:"ERROR",number:17},fatal:{text:"FATAL",number:21}},ZU=ZO.info;function WU(t){try{return Kd(String(t))}catch{return Pm}}function qU(t,e,n,r){const s=t.level||"info",{text:i,number:o}=ZO[s]||ZU,l=(function(m=Date.now()){return String(m)+"000000"})(Xn(r)?r:void 0),c={};e.distinctId&&(c.posthogDistinctId=e.distinctId),e.sessionId&&(c.sessionId=e.sessionId),e.windowId&&(c["window.id"]=e.windowId),at(e.sessionStartTimestamp)||(c.sessionStartTimestamp=String(e.sessionStartTimestamp)),at(e.lastActivityTimestamp)||(c.lastActivityTimestamp=String(e.lastActivityTimestamp)),e.currentUrl&&(c["url.full"]=e.currentUrl),e.screenName&&(c["screen.name"]=e.screenName),e.appState&&(c["app.state"]=e.appState),e.activeFeatureFlags&&e.activeFeatureFlags.length>0&&(c.feature_flags=e.activeFeatureFlags);const d=j({},c),f=t.attributes;if(f){let m=[];try{m=Object.keys(f)}catch{m=[]}for(const v of m){let _;try{_=f[v]}catch{_=Pm}Object.defineProperty(d,v,{value:_,enumerable:!0,writable:!0,configurable:!0})}}const h={timeUnixNano:l,observedTimeUnixNano:l,severityNumber:o,severityText:i,body:{stringValue:WU(t.body)},attributes:bv(d,n)};return t.trace_id&&(h.traceId=t.trace_id),t.span_id&&(h.spanId=t.span_id),ue(t.trace_flags)||(h.flags=t.trace_flags),h}function WO(t,e,n){return UO(t,e,n)}function qO(t,e,n,r){return{resourceLogs:[{resource:{attributes:BO(e)},scopeLogs:[{scope:{name:n,version:r},logRecords:t}]}]}}var GO=class{constructor(t){this.ls=t,this.us=0}get pending(){return!!this.cs}arm(t){this.clear(),this.us=Date.now()+t,this.cs=TO(()=>{this.cs=void 0,this.ls()},t)}armNoEarlierThan(t){this.cs&&Date.now()+t<=this.us||this.arm(t)}clear(){this.cs&&(clearTimeout(this.cs),this.cs=void 0)}};function KO(){return .75+.5*Math.random()}function YO(t,e,n,r){const s=Math.min(Math.max(0,e-1),6),i=t*Math.pow(2,s);return Math.round(Math.min(i,Math.max(r,t))*n)}var GU=class{constructor(t,e,n,r,s,i=()=>Promise.resolve(),o){var l;this._instance=t,this.Pr=e,this.A=n,this.hs=r,this.ds=s,this.vs=i,this.fs=o,this.ps=new GO(()=>this.gs()),this.ys=null,this.bs=0,this._s=0,this.ws=new PO,this.ks=0,this.Ss=1,this.xs=0,this.$s=0,this.Cs=!1,this.Ts=e.maxBufferSize,this.Is=Math.max((l=e.maxQueueSize)!==null&&l!==void 0?l:e.maxBufferSize,e.maxBufferSize),this.Ms=e.flushIntervalMs,this.Es=e.maxBatchRecordsPerPost,this.As=e.rateCapWindowMs,this.Rs=e.maxLogsPerInterval}clearQueue(){this._s++,this._instance.setPersistedProperty(Ho.LogsQueue,[])}reset(){this.ps.clear(),this.xs=0,this.$s=0,this.Cs=!1,this.ks=0,this.Ss=1,this.ws.reset(),this.Es=this.Pr.maxBatchRecordsPerPost}onReconnect(){this.ks=0,this.Ss=1,this.ws.isOpen()?this.Ps()&&this.Os():this.gs()}captureLog(t,e){var n;if(this._instance.isDisabled||this._instance.optedOut||!(t!=null&&t.body))return;const r=this.Fs(t);if(r===null)return;if(!r.body)return void this.A.info("Log was rejected in beforeSend function");if(!this.Ds())return;const s={record:qU(r,(n=e==null?void 0:e.context)!==null&&n!==void 0?n:this.hs(),this.A,e==null?void 0:e.occurredAtMs)};this.ds(()=>this.Ls(s))}Fs(t){const e=this.Pr.beforeSend;if(!e)return t;const n=We(e)?e:[e];let r=t;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}Ds(){if(this.Rs===void 0)return!0;const t=Date.now(),e=t-this.xs;return this.As>e&&e>=0||(this.xs=t,this.$s=0,this.Cs=!1),this.Rs>this.$s?(this.$s++,!0):(this.Cs||(this.A.warn(`captureLog dropping logs: exceeded ${this.Rs} logs per ${this.As}ms`),this.Cs=!0),!1)}flush(){var t=this;return hn(function*(){if(!t._instance.isDisabled)return t.ys||(t.ys=t.Ns().finally(()=>{t.ys=null})),t.ys})()}Ns(){var t=this;return hn(function*(){var e;t.ps.clear();let n=(e=t._instance.getPersistedProperty(Ho.LogsQueue))!==null&&e!==void 0?e:[];if(n.length===0)return;const r=n.length;let s=0;for(;n.length>0&&r>s;){var i,o;const l=t._s;t.bs=0;const c=Math.min(n.length,t.Es),d=n.slice(0,c),f=qO(d.map(m=>m.record),t.js(),(i=t.fs)!==null&&i!==void 0?i:t._instance.getLibraryId(),t._instance.getLibraryVersion()),h=yield t._instance.qs(f);if(t._s!==l)return;if(h.kind==="too-large"&&d.length>1)t.Es=Math.max(1,Math.floor(d.length/2)),t.A.warn(`Logs batch of size ${d.length} was too large for the ingestion endpoint, reducing batch size to ${t.Es}`);else if(t.ws.record(h),t.ps.pending&&t.ps.arm(Math.max(t.Ms,t.ws.remainingMs())),h.kind==="retry-later"||(h.kind==="too-large"?t.A.warn("Dropping a single log record with batch size 1 — the record is larger than the server cap and cannot be split further."):h.kind==="ok"&&t.Pr.maxBatchRecordsPerPost>t.Es&&(t.Es=Math.min(t.Pr.maxBatchRecordsPerPost,t.Es+1)),yield t.Bs(d.length),n=(o=t._instance.getPersistedProperty(Ho.LogsQueue))!==null&&o!==void 0?o:[],s+=d.length,h.kind==="fatal"))throw h.error}})()}Bs(t){var e=this;return hn(function*(){var n;const r=Math.max(0,t-e.bs),s=(n=e._instance.getPersistedProperty(Ho.LogsQueue))!==null&&n!==void 0?n:[];e._instance.setPersistedProperty(Ho.LogsQueue,s.slice(r)),yield e.vs()})()}js(){return WO(this.Pr,this._instance.getLibraryId(),this._instance.getLibraryVersion())}Ls(t){var e;if(this._instance.optedOut)return;const n=(e=this._instance.getPersistedProperty(Ho.LogsQueue))!==null&&e!==void 0?e:[];this.Is>n.length||(n.shift(),this.bs++,this.A.info("Logs queue is full, dropping oldest record.")),n.push(t),this._instance.setPersistedProperty(Ho.LogsQueue,n),this.Ts>n.length||this.ws.isOpen()?this.Os():this.gs()}Os(){this.ps.pending||this.ps.arm(Math.max(this.Ms,this.ws.remainingMs()))}zs(){return Math.max(YO(this.Ms,this.ks,this.Ss,3e4),this.ws.remainingMs())}Ps(){const t=this._instance.getPersistedProperty(Ho.LogsQueue);return!!t&&t.length>0}shutdown(t){var e=this;return hn(function*(){e.ps.clear();const n=e.flush().catch(()=>{});t!==void 0?yield rP(n,t):yield n})()}flushWithTimeout(t){var e=this;return hn(function*(){const n=e.flush();yield rP(n,t,()=>{n.catch(()=>{})})})()}gs(){this.flush().then(()=>{this.ks=0,this.Ss=1},t=>{this.ks++,this.Ss=KO(),this.A.error("PostHog logs flush failed:",t)}).finally(()=>{!this._instance.isDisabled&&this.Ps()&&this.ps.armNoEarlierThan(this.zs())})}};const KU=/^[0-9a-f]+$/;function vP(t,e,n){return typeof t=="string"&&t.length===e&&t!==n&&KU.test(t)}const YU=/^([0-9a-f]{2})-([0-9a-f]{32})-([0-9a-f]{16})-([0-9a-f]{2})(-.*)?$/,XU="00",r2=[0,5,10,25,50,75,100,250,500,750,1e3,2500,5e3,7500,1e4];function ub(t){return String(t)+"000000"}function yP(t,e,n,r){let s="";return r&&(s=Object.keys(r).sort().map(i=>`${JSON.stringify(i)}:${JSON.stringify(r[i])}`).join(",")),`${t}\0${e}\0${n??""}\0${s}`}var QU=class{constructor(t,e,n){this._instance=t,this.Pr=e,this.A=n,this.Hs=new Map,this.ps=new GO(()=>this.flush().catch(r=>{this.A.error("Metrics flush failed:",r)})),this.ys=null,this.Us=!1,this.Ws=new Map,this.Vs=new Set,this.ws=new PO,this.ks=0,this.Ss=1,this.Gs=0}count(t,e=1,n){this.Qs({name:t,type:"count",value:e,unit:n==null?void 0:n.unit,attributes:n==null?void 0:n.attributes})}gauge(t,e,n){this.Qs({name:t,type:"gauge",value:e,unit:n==null?void 0:n.unit,attributes:n==null?void 0:n.attributes})}histogram(t,e,n){this.Qs({name:t,type:"histogram",value:e,unit:n==null?void 0:n.unit,attributes:n==null?void 0:n.attributes})}flush(){var t=this;const e=this.ys,n=(function(){var r=hn(function*(){e&&(yield e.catch(()=>{})),yield t.Js()});return function(){return r.apply(this,arguments)}})()().finally(()=>{this.ys===n&&(this.ys=null)});return this.ys=n,n}drainWindow(){if(this.Hs.size===0)return null;const t=this.Hs;return this.Hs=new Map,this.Us=!1,this.Ws=new Map,this.Vs=new Set,this.Zs(t)}reset(){this.Gs++,this.ws.reset(),this.ks=0,this.Ss=1,this.ps.clear(),this.Hs=new Map,this.ys=null,this.Us=!1,this.Ws=new Map,this.Vs=new Set}Qs(t){if(this._instance.isDisabled||this._instance.optedOut)return;const e=this.Fs(t);if(e===null)return;if(!e.name||typeof e.name!="string")return void this.A.warn("Dropping metric with empty name");if(typeof e.value!="number"||!Number.isFinite(e.value))return void this.A.warn(`Dropping metric '${e.name}': value must be a finite number`);if(e.type==="count"&&0>e.value)return void this.A.warn(`Dropping count '${e.name}': counters are monotonic, value must be >= 0`);let n,r;try{n=e.attributes?j({},e.attributes):void 0,r=yP(e.type,e.name,e.unit,n)}catch(l){return void this.A.warn(`Dropping metric '${e.name}': attributes could not be serialized`,l)}let s=this.Hs.get(r);if(!s){if(!this.Ks())return;s={name:e.name,type:e.type,unit:e.unit,attributes:n,windowStartMs:Date.now()},this.Hs.set(r,s)}const i=this.Ws.get(e.name);i===void 0?this.Ws.set(e.name,e.type):i===e.type||this.Vs.has(e.name)||(this.Vs.add(e.name),this.A.warn(`Metric name '${e.name}' is already used as a ${i}; recording it as a ${e.type} too will blend both series in charts. Use a distinct name.`)),this.Ys(s,e.value);const o=this.Xs();o&&(s.exemplar=j(j({},o),{},{value:e.value,timeMs:Date.now()})),this.Os()}Xs(){try{var t,e;const n=(function(r){const s=(function(o){if(typeof o!="string")return;const l=YU.exec(o.trim());if(!l)return;const[,c,d,f,h,m]=l;return c==="ff"||c==="00"&&m||!(function(v){return vP(v,32,"00000000000000000000000000000000")})(d)||!(function(v){return vP(v,16,"0000000000000000")})(f)?void 0:{version:c,traceId:d,spanId:f,flags:h}})(r);return s&&{traceId:s.traceId,spanId:s.spanId,flags:(i=s.flags,1&parseInt(i,16)?"01":XU)};var i})((t=(e=this._instance).getActiveSpan)===null||t===void 0||(t=t.call(e))===null||t===void 0?void 0:t.traceparent());if(n&&n.flags==="01")return{traceId:n.traceId,spanId:n.spanId}}catch{}}Ks(){return this.Pr.maxSeriesPerFlush>this.Hs.size||(this.Us||(this.Us=!0,this.A.warn(`Metric series cap reached (${this.Pr.maxSeriesPerFlush} per flush window); dropping new series until the next flush. Reduce attribute cardinality.`)),!1)}Ys(t,e){switch(t.type){case"count":var n;t.total=((n=t.total)!==null&&n!==void 0?n:0)+e;break;case"gauge":t.last=e;break;case"histogram":{t.hist||(t.hist={count:0,sum:0,min:e,max:e,bucketCounts:new Array(r2.length+1).fill(0)});const r=t.hist;r.count+=1,r.sum+=e,r.min=Math.min(r.min,e),r.max=Math.max(r.max,e),r.bucketCounts[(function(s,i){for(let o=0;i.length>o;o++)if(i[o]>=s)return o;return i.length})(e,r2)]+=1;break}}}Fs(t){const e=this.Pr.beforeSend;if(!e)return t;const n=We(e)?e:[e];let r=t;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}Os(){this.ps.pending||this.ps.arm(this.zs())}zs(){return Math.max(YO(this.Pr.flushIntervalMs,this.ks,this.Ss,3e4),this.ws.remainingMs())}Js(){var t=this;return hn(function*(){if(t.ps.clear(),t.Hs.size===0)return;const e=t.Hs;t.Hs=new Map,t.Us=!1,t.Ws=new Map,t.Vs=new Set;const n=t.Gs,r=yield t._instance._o(t.Zs(e));if(n===t.Gs)switch(t.ws.record(r),r.kind==="retry-later"?(t.ks++,t.Ss=KO()):(t.ks=0,t.Ss=1),t.ps.pending&&t.ps.arm(t.zs()),r.kind){case"ok":return;case"retry-later":return t.wo(e),void t.ps.armNoEarlierThan(t.zs());case"too-large":return void t.A.warn("Metrics batch exceeded the server size limit and was dropped");case"fatal":return void t.A.error("Failed to send metrics batch:",r.error)}})()}Zs(t){return e=this.ko(t),n=(function(i,o,l){return UO(i,o,l)})(this.Pr,this._instance.getLibraryId(),this._instance.getLibraryVersion()),r=this._instance.getLibraryId(),s=this._instance.getLibraryVersion(),{resourceMetrics:[{resource:{attributes:BO(n)},scopeMetrics:[{scope:{name:r,version:s},metrics:e}]}]};var e,n,r,s}ko(t){const e=ub(Date.now()),n=new Map;for(const o of t.values()){var r;const l=yP(o.type,o.name,o.unit,void 0);let c=n.get(l);c||(c=j({name:o.name},o.unit&&{unit:o.unit}),o.type==="count"?c.sum={aggregationTemporality:1,isMonotonic:!0,dataPoints:[]}:o.type==="gauge"?c.gauge={dataPoints:[]}:c.histogram={aggregationTemporality:1,dataPoints:[]},n.set(l,c));const d=bv((r=o.attributes)!==null&&r!==void 0?r:{},this.A),f=ub(o.windowStartMs),h=JU(o.exemplar);if(o.type==="count"){var s;const m=j({attributes:d,startTimeUnixNano:f,timeUnixNano:e,asDouble:(s=o.total)!==null&&s!==void 0?s:0},h);c.sum.dataPoints.push(m)}else if(o.type==="gauge"){var i;const m=j({attributes:d,timeUnixNano:e,asDouble:(i=o.last)!==null&&i!==void 0?i:0},h);c.gauge.dataPoints.push(m)}else if(o.hist){const m=j({attributes:d,startTimeUnixNano:f,timeUnixNano:e,count:o.hist.count,sum:o.hist.sum,min:o.hist.min,max:o.hist.max,bucketCounts:o.hist.bucketCounts,explicitBounds:r2},h);c.histogram.dataPoints.push(m)}}return Array.from(n.values())}wo(t){for(const[s,i]of t){var e;const o=this.Hs.get(s);if(o)switch(o.windowStartMs=Math.min(o.windowStartMs,i.windowStartMs),o.exemplar=(e=o.exemplar)!==null&&e!==void 0?e: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":if(i.hist)if(o.hist){o.hist.count+=i.hist.count,o.hist.sum+=i.hist.sum,o.hist.min=Math.min(o.hist.min,i.hist.min),o.hist.max=Math.max(o.hist.max,i.hist.max);for(let l=0;o.hist.bucketCounts.length>l;l++)o.hist.bucketCounts[l]+=i.hist.bucketCounts[l]}else o.hist=i.hist}else this.Ks()&&this.Hs.set(s,i)}}};function JU(t){return t?{exemplars:[{filteredAttributes:[],timeUnixNano:ub(t.timeMs),asDouble:t.value,traceId:t.traceId,spanId:t.spanId}]}:{}}const XO=(t,{debugEnabled:e}={})=>{const n={N(r,...s){let i;try{i=typeof window>"u"?void 0:window}catch{return}i&&(Za.DEBUG||i.POSTHOG_DEBUG||e)&&!ue(i.console)&&i.console&&("__rrweb_original__"in i.console[r]?i.console[r].__rrweb_original__:i.console[r])(t,...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(t,...r)},uninitializedWarning(r){n.error(`You must initialize PostHog before calling ${r}`)},createLogger:(r,s)=>XO(`${t} ${r}`,s)};return n},ye=XO("[PostHog.js]"),Pn=ye.createLogger,eB=Pn("[ExternalScriptsLoader]"),xv=t=>{const e=Oe==null?void 0:Oe.querySelectorAll("script");if(e){for(let n=0;e.length>n;n++)if(e[n].src===t||e[n].getAttribute("src")===t)return e[n]}},vd=(t,e,n)=>{if(t.config.disable_external_dependency_loading)return eB.warn(`${e} was requested but loading of external scripts is disabled.`),n("Loading of external scripts is disabled");const r=()=>{if(Oe==null||Oe.removeEventListener("DOMContentLoaded",r),t.config.disable_external_dependency_loading)return n("Loading of external scripts is disabled");if(!Oe)return n("document not found");let i=Oe.createElement("script");if(i.type="text/javascript",i.crossOrigin="anonymous",i.src=e,i.onload=c=>{i.__posthog_loading_callback_fired=!0,n(void 0,c)},i.onerror=c=>{i.__posthog_loading_error=c,n(c)},t.config.prepare_external_dependency_script&&(i=t.config.prepare_external_dependency_script(i)),!i)return n("prepare_external_dependency_script returned null");if(t.config.disable_external_dependency_loading)return n("Loading of external scripts is disabled");const o=xv(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 c=o.__posthog_loading_error;return c?n(c):(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(!Oe.body)return s();if(t.config.external_scripts_inject_target==="head")Oe.head.appendChild(i);else{const c=Oe.querySelectorAll("body > script");var l;c.length>0?(l=c[0].parentNode)===null||l===void 0||l.insertBefore(i,c[0]):Oe.body.appendChild(i)}},s=()=>{Oe==null||Oe.addEventListener("DOMContentLoaded",r)};Oe!=null&&Oe.body||xv(e)?r():s()},s2={},_P=(t,e)=>{let n=`/static/${e}.js?v=${t.version}`;return e==="toolbar"&&(n=`${n}&t=${Math.floor(Date.now()/3e5)*3e5}`),t.requestRouter.endpointFor("assets",n)};tt.__PosthogExtensions__=tt.__PosthogExtensions__||{},tt.__PosthogExtensions__.loadExternalDependency=(t,e,n)=>{if(e==="remote-config"){const s=t.requestRouter.endpointFor("assets",`/array/${t.config.token}/config.js`);return void vd(t,s,n)}const r=t.config.strict_script_versioning;if(r){const s=t.requestRouter.endpointFor("assets",`/static/${t.version}/${e}.js`),i=s2[s];if(r==="fallback"&&i){if(xv(i))return void vd(t,i,n);delete s2[s]}return void vd(t,s,r==="fallback"?(o,l)=>{if(o)if(typeof o=="string")n(o);else{var c;const d=_P(t,e);s2[s]=d;const f=xv(s);f==null||(c=f.parentNode)===null||c===void 0||c.removeChild(f),vd(t,d,n)}else n(void 0,l)}:n)}vd(t,_P(t,e),n)},tt.__PosthogExtensions__.loadSiteApp=(t,e,n)=>{const r=t.requestRouter.endpointFor("api",e);vd(t,r,n)},Za.DEBUG=!1,Za.LIB_VERSION="1.445.5",Za.LIB_NAME="web";var Zs=Za;const db="$early_access_features",Ha="$active_feature_flags",wu="$feature_flag_details",zp="$feature_flag_errors",ec="$feature_flag_evaluated_at",bu="$feature_flag_request_id",mp="$minimal_flag_called_events",bo="$enabled_feature_flags",Wl="$stored_group_properties",ql="$stored_person_properties",Go="$flag_call_reported",Jh="$flag_call_reported_session_id",Gl="$feature_flag_payloads",Vo="$override_feature_flags",ru="$override_feature_flag_payloads",Yd="visibilitychange",QO="$autocapture_disabled_server_side",ep="$surveys",Sv="$surveys_loaded_at",ZS="PostHog loadExternalDependency extension not found.",fb="$surveys_activated",Ng="$surveys_activated_session",Lg="$surveys_activated_timestamps",tB="$people_distinct_id",Wi="distinct_id",WS="$device_id",i2="$device_model",kv="__alias",nB="__cmpns",wP="$fbc",Xd="$fbc_persistence",bP="$fbp",gp="$fbp_persistence",hb="__timers",pb="$heatmaps_enabled_server_side",mb="$exception_capture_enabled_server_side",JO="$error_tracking_suppression_rules",gb="$error_tracking_capture_extension_exceptions",vb="$web_vitals_enabled_server_side",qS="$dead_clicks_enabled_server_side",GS="$product_tours_enabled_server_side",e5="$logs_capture_enabled_server_side",t5="$web_vitals_allowed_metrics",vp="$session_recording_remote_config",rB="$session_recording_enabled_server_side",sB="$replay_sample_rate",iB="$replay_override_sampling",oB="$replay_override_linked_flag",aB="$replay_override_url_trigger",lB="$replay_override_event_trigger",jd="$sesid",n5="$session_is_sampled",cB="$session_past_minimum_duration",uB="$session_recording_url_trigger_activated_session",dB="$session_recording_event_trigger_activated_session",fB="$debug_first_full_snapshot_timestamp",hB="$sess_rec_flush_size",r5="$groups",yb="ph_product_tours",pB="$product_tours_activated",mB="$product_tours_activated_session",gB="$conversations_widget_session_id",vB="$conversations_ticket_id",yB="$conversations_widget_state",_B="$conversations_user_traits",ys="$user_state",_b="$client_session_props",s5="$capture_rate_limit",i5="$initial_campaign_params",o5="$initial_referrer_info",Fd="$initial_person_info",KS="$epp",o2="$posthog_cookieless",a5="$cookieless_mode",l5="$sdk_debug_extensions_init_method",c5="$sdk_debug_extensions_init_time_ms",YS="$sdk_debug_recording_script_not_loaded",XS="$sdk_debug_replay_stale_config",u5="$sdk_debug_replay_event_trigger_status",d5="$sdk_debug_replay_linked_flag_trigger_status",f5="$sdk_debug_replay_matched_recording_trigger_groups",h5="$sdk_debug_replay_pending_trigger_conditions",p5="$sdk_debug_replay_remote_trigger_matching_config",m5="$sdk_debug_replay_trigger_groups_count",g5="$sdk_debug_replay_url_trigger_status",wB="$session_recording_start_reason",Ua="anonymous",Dg="identified",v5="identified_only",Ev="beforeunload",QS="$pageview",xP="$pageleave",y5="$identify",SP="$groupidentify";function zd(t,e){We(t)&&t.forEach(e)}function Wt(t,e){if(!at(t))if(We(t))t.forEach(e);else if((n=>n instanceof FormData)(t))t.forEach((n,r)=>e(n,r));else for(const n in t)FS.call(t,n)&&e(t[n],n)}const bn=function(t,...e){for(const n of e)for(const r in n)n[r]!==void 0&&(t[r]=n[r]);return t};function $g(t){const e=Object.keys(t);let n=e.length;const r=new Array(n);for(;n--;)r[n]=[e[n],t[e[n]]];return r}const bB=function(t){return function(...e){try{return t.apply(this,e)}catch(n){ye.critical("Implementation error. Please turn on debug mode and open a ticket on https://app.posthog.com/home#panel=support%3Asupport%3A."),ye.critical(n)}}},JS=function(t){const e={};return Wt(t,function(n,r){(ht(n)&&n.length>0||Xn(n))&&(e[r]=n)}),e};function _5(t){const e=j({},t);for(const n of["name","message","stack","cause","errors"])try{n in t&&(e[n]=t[n])}catch{}return e}const xB=["herokuapp.com","vercel.app","netlify.app"];function SB(t){const e=t==null?void 0:t.hostname;if(!ht(e))return!1;const n=e.split(".").slice(-2).join(".");for(const r of xB)if(n===r)return!1;return!0}function Dt(t,e,n,r){const{capture:s=!1,passive:i=!0}=r??{};t==null||t.addEventListener(e,n,{capture:s,passive:i})}function wb(t){return t.name==="ph_toolbar_internal"}const yp=t=>{if(Oe){try{const e=t+"=",n=Oe.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(e)===0)return decodeURIComponent(s.substring(e.length,s.length))}}catch{}return null}};var kB=class bb{constructor(e){if(this.bytes=e,e.length!==16)throw new TypeError("not 128-bit length")}static fromFieldsV7(e,n,r,s){if(!Number.isInteger(e)||!Number.isInteger(n)||!Number.isInteger(r)||!Number.isInteger(s)||0>e||0>n||0>r||0>s||e>0xffffffffffff||n>4095||r>1073741823||s>4294967295)throw new RangeError("invalid field value");const i=new Uint8Array(16);return i[0]=e/Math.pow(2,40),i[1]=e/Math.pow(2,32),i[2]=e/Math.pow(2,24),i[3]=e/Math.pow(2,16),i[4]=e/256,i[5]=e,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 bb(i)}toString(){let e="";for(let n=0;this.bytes.length>n;n++)e=e+(this.bytes[n]>>>4).toString(16)+(15&this.bytes[n]).toString(16),n!==3&&n!==5&&n!==7&&n!==9||(e+="-");if(e.length!==36)throw new Error("Invalid UUIDv7 was generated");return e}clone(){return new bb(this.bytes.slice(0))}equals(e){return this.compareTo(e)===0}compareTo(e){for(let n=0;16>n;n++){const r=this.bytes[n]-e.bytes[n];if(r!==0)return Math.sign(r)}return 0}},EB=class{generate(){const t=this.generateOrAbort();if(!ue(t))return t;{this.Tt=0;const e=this.generateOrAbort();if(ue(e))throw new Error("Could not generate UUID after timestamp reset");return e}}generateOrAbort(){const t=(()=>{const e=Date.now();return Xn(e)&&isFinite(e)?Math.min(Math.max(Math.floor(e),0),0xffffffffffff):0})();if(t>this.Tt)this.Tt=t,this.It();else{if(this.Tt>=t+1e4)return;this.Mt++,this.Mt>4398046511103&&(this.Tt++,this.It())}return kB.fromFieldsV7(this.Tt,Math.trunc(this.Mt/Math.pow(2,30)),this.Mt&Math.pow(2,30)-1,this.Rt.nextUint32())}It(){this.Mt=1024*this.Rt.nextUint32()+(1023&this.Rt.nextUint32())}constructor(){this.Tt=0,this.Mt=0,this.Rt=new CB}};const kP=t=>{if("u">typeof UUIDV7_DENY_WEAK_RNG&&UUIDV7_DENY_WEAK_RNG)throw new Error("no cryptographically strong RNG available");for(let e=0;t.length>e;e++)t[e]=65536*Math.trunc(65536*Math.random())+Math.trunc(65536*Math.random());return t};let EP;var CB=class{nextUint32(){var t;return this.At.length>this.Et||(((t=EP)!==null&&t!==void 0?t:EP="u">typeof window&&!ue(window.crypto)&&crypto.getRandomValues?e=>{try{return crypto.getRandomValues(e)}catch{return kP(e)}}:kP)(this.At),this.Et=0),this.At[this.Et++]}constructor(){this.At=new Uint32Array(8),this.Et=1/0}};let CP;const xo=()=>PB().toString(),PB=()=>(CP||(CP=new EB)).generate();let Dh="";const AB=/[a-z0-9][a-z0-9-]+\.[a-z]{2,}$/i;let yd=null;const _n={Ot(){if(!Mn(yd))return yd;if(yd=!1,Oe)try{const t=`__ph_cookie_support_${xo()}`;_n.$t(t,"xyz"),yd=yp(t)==='"xyz"',_n.Dt(t)}catch{yd=!1}return yd},Pt(t){ye.error("cookieStore error: "+t)},Lt:yp,Ft(t){let e;try{e=JSON.parse(_n.Lt(t))||{}}catch{}return e},$t(t,e,n,r,s){if(!Oe)return!1;try{let i="",o="";const l=(function(d,f){if(f){let h=(function(m,v=Oe){if(Dh)return Dh;if(!v||["localhost","127.0.0.1"].includes(m))return"";const _=m.split(".");let y=Math.min(_.length,8);const w="dmn_chk_"+xo();for(;!Dh&&y--;){const x=_.slice(y).join("."),k=w+"=1;domain=."+x+";path=/";v.cookie=k+";max-age=3",v.cookie.includes(w)&&(v.cookie=k+";max-age=0",Dh=x)}return Dh})(d);if(!h){const m=(v=>{const _=v.match(AB);return _?_[0]:""})(d);m!==h&&ye.info("Warning: cookie subdomain discovery mismatch",m,h),h=m}return h?"; domain=."+h:""}return""})(Oe.location.hostname,r);if(n){const d=new Date;d.setTime(d.getTime()+864e5*n),i="; expires="+d.toUTCString()}s&&(o="; secure");const c=t+"="+encodeURIComponent(JSON.stringify(e))+i+"; SameSite=Lax; path=/"+l+o;return c.length>3686.4&&ye.warn("cookieStore warning: large cookie, len="+c.length),Oe.cookie=c,!0}catch{return!1}},Dt(t,e){if(Oe!=null&&Oe.cookie&&(!e||!Mn(yp(t))))try{_n.$t(t,"",-1,e)}catch{return}}};let a2=null;const It={Ot(){if(!Mn(a2))return a2;let t=!0;if(ue(le))t=!1;else try{const e="__mplssupport__";It.$t(e,"xyz"),It.Lt(e)!=='"xyz"'&&(t=!1),It.Dt(e)}catch{t=!1}return t||ye.error("localStorage unsupported; falling back to cookie store"),a2=t,t},Pt(t){ye.error("localStorage error: "+t)},Lt(t){try{return le==null?void 0:le.localStorage.getItem(t)}catch(e){It.Pt(e)}return null},Ft(t){try{return JSON.parse(It.Lt(t))||{}}catch{}return null},$t(t,e){try{return le==null||le.localStorage.setItem(t,JSON.stringify(e)),!0}catch(n){It.Pt(n)}return!1},Dt(t){try{le==null||le.localStorage.removeItem(t)}catch(e){It.Pt(e)}}},l2=[ql,Ha,bo,wu,Gl,bu,ec,zp,Go],su=[WS,Wi,jd,n5,KS,Fd,Xd,ys],_p=t=>t+"_cpm",TB=["__proto__","constructor","prototype"],c2=t=>{if(!dt(t))return{};const e={};return Object.keys(t).forEach(n=>{TB.indexOf(n)===-1&&(e[n]=t[n])}),e},u2=(t,e=[])=>{const n={};return[...su,...e].forEach(r=>{const s=t[r];ue(s)||Mn(s)||s===""||(n[r]=s)}),n},w5=t=>{let e=5381,n=2166136261;for(let r=0;t.length>r;r++){const s=t.charCodeAt(r);e=33*e^s,n=Math.imul(n^s,16777619)}return t.length.toString(36)+"."+(e>>>0).toString(36)+"."+(n>>>0).toString(36)},PP=(t,e)=>({p:e,f:w5(JSON.stringify(t))}),AP=(t,e)=>{if(!e)return{properties:[],isValid:!1};try{const n=_n.Ft(_p(t)),r=(n==null?void 0:n.f)===w5(e)&&We(n.p);return{properties:r?n.p:[],isValid:r}}catch{return{properties:[],isValid:!1}}},d2=(t,e)=>e+"|"+(_n.Lt(_p(t))||""),_d={},xb={Ot:()=>!0,Pt(t){ye.error("memoryStorage error: "+t)},Lt:t=>t in _d?_d[t]:null,Ft:t=>t in _d?_d[t]:null,$t:(t,e)=>(_d[t]=e,!0),Dt(t){delete _d[t]}};let Uc=null;const fn={Ot(){if(!Mn(Uc))return Uc;if(Uc=!0,ue(le))Uc=!1;else try{const t="__support__";fn.$t(t,"xyz"),fn.Lt(t)!=='"xyz"'&&(Uc=!1),fn.Dt(t)}catch{Uc=!1}return Uc},Pt(t){ye.error("sessionStorage error: ",t)},Lt(t){try{return le==null?void 0:le.sessionStorage.getItem(t)}catch(e){fn.Pt(e)}return null},Ft(t){try{return JSON.parse(fn.Lt(t))||null}catch{}return null},$t(t,e){try{return le==null||le.sessionStorage.setItem(t,JSON.stringify(e)),!0}catch(n){fn.Pt(n)}return!1},Dt(t){try{le==null||le.sessionStorage.removeItem(t)}catch(e){fn.Pt(e)}}};var RB=class{constructor(t){this._instance=t}get Pr(){return this._instance.config}get consent(){return this.Il()?0:this.Ml}isOptedOut(){return this.Pr.cookieless_mode==="always"||this.isRejected()||this.consent===-1&&this.Pr.cookieless_mode==="on_reject"}isOptedIn(){return!this.isOptedOut()}isExplicitlyOptedOut(){return this.consent===0}isRejected(){return this.consent===0||this.consent===-1&&this.Pr.opt_out_capturing_by_default}optInOut(t){this.El.$t(this.Al,t?1:0,this.Pr.cookie_expiration,this.Pr.cross_subdomain_cookie,this.Pr.secure_cookie)}reset(){this.El.Dt(this.Al,this.Pr.cross_subdomain_cookie)}get Al(){const{token:t,opt_out_capturing_cookie_prefix:e,consent_persistence_name:n}=this._instance.config;return n||(e?e+t:"__ph_opt_in_out_"+t)}get Ml(){const t=this.El.Lt(this.Al);return G_(t)?1:Ze(PH,t)?0:-1}get El(){const t=this.Pr.opt_out_capturing_persistence_type,e=t==="localStorage"?It:_n,n=e.Ot()?e:xb;if(!this.Rl||this.Rl!==n){this.Rl=n;const r=t==="localStorage"?_n:It;r.Lt(this.Al)&&(this.Rl.Lt(this.Al)||this.optInOut(G_(r.Lt(this.Al))),r.Dt(this.Al,this.Pr.cross_subdomain_cookie))}return this.Rl}Il(){return!!this.Pr.respect_dnt&&[Jr==null?void 0:Jr.doNotTrack,Jr==null?void 0:Jr.msDoNotTrack,tt.doNotTrack,Jr==null?void 0:Jr.globalPrivacyControl].some(t=>G_(t))}};function b5(t,e){var n;const r=t==null||(n=t.config)===null||n===void 0?void 0:n.get_current_url;if(!zn(r))return e;try{const s=r(e);return ht(s)&&s?s:e}catch(s){return ye.error("Error in get_current_url, falling back to window.location.href",s),e}}function TP(t){var e;return t instanceof Element&&(t.id==="__POSTHOG_TOOLBAR__"||!!(!((e=t.closest)===null||e===void 0)&&e.call(t,".toolbar-global-fade-container")))}function Ji(t){return!!t&&t.nodeType===1}function cr(t,e){return!!t&&!!t.tagName&&t.tagName.toLowerCase()===e.toLowerCase()}function x5(t){return!!t&&t.nodeType===3}function Cv(t){return!!t&&t.nodeType===11&&Ji(t.host)}function ek(t){return t?_f(t).split(/\s+/):[]}function RP(t,e){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 ue(o)?void 0:b5(r,o)})(e);return!!(n&&t&&t.some(r=>n.match(r)))}function xu(t){let e="";switch(typeof t.className){case"string":e=t.className;break;case"object":e=(t.className&&"baseVal"in t.className?t.className.baseVal:null)||t.getAttribute("class")||"";break;default:e=""}return ek(e)}function S5(t){return at(t)?null:_f(t).split(/(\s+)/).filter(e=>Qd(e)).join("").replace(/[\r\n]/g," ").replace(/[ ]+/g," ").substring(0,255)}function Vp(t){let e="";return tc(t)&&!bf(t)&&t.childNodes&&t.childNodes.length&&Wt(t.childNodes,function(n){var r;x5(n)&&n.textContent&&(e+=(r=S5(n.textContent))!==null&&r!==void 0?r:"")}),_f(e)}function wp(t){var e;return ue(t.target)?t.srcElement||null:!((e=t.target)===null||e===void 0)&&e.shadowRoot?t.composedPath()[0]||null:t.target||null}const tk=["a","button","form","input","select","textarea","label"];function tp(t,e){const n=t.matches||t.matchesSelector||t.msMatchesSelector||t.mozMatchesSelector||t.webkitMatchesSelector||t.oMatchesSelector;try{return!!n&&n.call(t,e)}catch{return!1}}function Sb(t,e){if(ue(e))return!0;for(const n of t)if(e.some(r=>tp(n,r)))return!0;return!1}function k5(t){const e=t.parentNode;return!(!e||!Ji(e))&&e}const Z0=[".ph-no-autocapture","[data-ph-no-autocapture]"],E5=["next","previous","prev",">","<","→","←","›","‹","»","«","▶","◀","❯","❮"],nk=[...E5,"+","-","−","–"],IP=nk.length+10,IB=["button","a","input","select","textarea","label"],OB=["button","link","tab","menuitem","option"],OP=(t,e)=>/[a-z0-9]/i.test(e)?Ze(nk,e)?new RegExp(`\\b${e}\\b`).test(t):t.includes(e):t===e,MB=t=>Ze(IB,t.tagName.toLowerCase())||Ze(OB,(t.getAttribute("role")||"").toLowerCase());function f2(t){let e="",n="";const r=o=>{Ji(o)&&tc(o)&&!bf(o)&&(e+=` ${Vp(o)}`,n=n||o.getAttribute("aria-label")||"",Wt(o.childNodes,r))};r(t),e=_f(e.replace(/\s+/g," "));const s=(Qd(e)?e:"").toLowerCase(),i=t.getAttribute("aria-label")||(s?"":n);return{safeText:s,ariaLabel:_f(i).toLowerCase()}}const MP=[".ph-no-rageclick",".ph-no-capture"],NB=["","text","search","email","password","url","tel","number"];function C5(t,e){if(!(!(typeof window>"u")&&window)||rk(t))return!1;let n,r,s;var i,o;if(Ns(e)?(n=!!e&&MP,r=void 0,s=!1):(n=(i=e==null?void 0:e.css_selector_ignorelist)!==null&&i!==void 0?i:MP,r=e==null?void 0:e.content_ignorelist,s=(o=e==null?void 0:e.ignore_text_selection)!==null&&o!==void 0&&o),n===!1||s&&(function(c){return!(!c||!Ji(c))&&(!!cr(c,"textarea")||(cr(c,"input")?Ze(NB,(c.getAttribute("type")||"").toLowerCase()):(function(d){var f;if(d.isContentEditable)return!0;const h=(f=d.getAttribute)===null||f===void 0?void 0:f.call(d,"contenteditable");return h==="true"||h===""})(c)))})(t))return!1;const{targetElementList:l}=P5(t,!1);return!(r&&(function(c,{safeText:d,ariaLabel:f}){let h;if(c===!0)h=E5;else{if(!We(c))return!1;if(c.length>IP)return ye.error(`[PostHog] content_ignorelist array cannot exceed ${IP} items. Use css_selector_ignorelist for more complex matching.`),!1;h=c.map(m=>m.toLowerCase())}return h.some(m=>OP(d,m)||OP(f,m))})(r,(function(c,d){for(const h of d)if(MB(h))return f2(h);for(const h of d){try{var f;if(((f=window)===null||f===void 0?void 0:f.getComputedStyle(h).getPropertyValue("cursor"))!=="pointer")break}catch{break}const m=f2(h);if(m.safeText||m.ariaLabel)return m}return f2(c)})(t,l))||Sb(l,n))}const rk=t=>!t||cr(t,"html")||!Ji(t),P5=(t,e)=>{const n=typeof window>"u"?void 0:window;if(!n||rk(t))return{parentIsUsefulElement:!1,targetElementList:[]};let r=!1;const s=[t];let i=t;for(;i.parentNode&&!cr(i,"body");){if(Cv(i.parentNode)){s.push(i.parentNode.host),i=i.parentNode.host;continue}const o=k5(i);if(!o)break;if(e||tk.indexOf(o.tagName.toLowerCase())>-1)r=!0;else try{const l=n.getComputedStyle(o);l&&l.getPropertyValue("cursor")==="pointer"&&(r=!0)}catch{}s.push(o),i=o}return{parentIsUsefulElement:r,targetElementList:s}};function tc(t){const e=new Set;let n=0;for(let i=t;i.parentNode&&!cr(i,"body");i=i.parentNode){if(n++>=1e3||e.has(i))return!1;e.add(i);const o=xu(i);if(Ze(o,"ph-sensitive")||Ze(o,"ph-no-capture"))return!1}if(Ze(xu(t),"ph-include"))return!0;const r=t.type||"";if(ht(r))switch(r.toLowerCase()){case"hidden":case"password":return!1}const s=t.name||t.id||"";return!ht(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 bf(t){return!!(cr(t,"input")&&!["button","checkbox","submit","reset"].includes(t.type)||cr(t,"select")||cr(t,"textarea")||t.getAttribute("contenteditable")==="true")}const NP=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}))$"),LP=/(^|[^0-9A-Za-z_])([0-9][0-9 -]*[0-9])(?=$|[^0-9A-Za-z_])/g,LB=[16,15,14,13],DB=new RegExp("^(\\d{3}-?\\d{2}-?\\d{4})$"),DP=new RegExp("(^|[^0-9])((?!000|666)[0-9]{3}-?(?!00)[0-9]{2}-?(?!0000)[0-9]{4})(?=$|([^0-9]))","g"),$P=/[0-9A-Za-z_]/;function $B(t){let e=0,n=!1;for(let r=t.length-1;r>=0;r--){let s=t.charCodeAt(r)-48;n&&(s*=2,s>9&&(s-=9)),e+=s,n=!n}return e%10==0}function Qd(t,e=!0){return!(at(t)||ht(t)&&(t=_f(t),(e?NP.test((t||"").replace(/[- ]/g,"")):(function(n){let r;for(LP.lastIndex=0;r=LP.exec(n);){const s=r[2];if(!s)continue;const i=s.replace(/[- ]/g,"");for(let o=0;i.length>o;o++)for(const l of LB){const c=o+l;if(i.length>=c){const d=i.slice(o,c);if(NP.test(d)&&$B(d))return!0}}}return!1})(t))||(e?DB.test(t):(function(n){let r;for(DP.lastIndex=0;r=DP.exec(n);){const s=r[1],i=r[3];if(!(s&&i&&$P.test(s)&&$P.test(i)))return!0}return!1})(t))))}function jP(t){let e=Vp(t);return e=`${e} ${A5(t)}`.trim(),Qd(e)?e:""}function A5(t){let e="";return t&&t.childNodes&&t.childNodes.length&&Wt(t.childNodes,function(n){var r;if(n&&((r=n.tagName)===null||r===void 0?void 0:r.toLowerCase())==="span")try{const s=Vp(n);e=`${e} ${s}`.trim(),n.childNodes&&n.childNodes.length&&(e=`${e} ${A5(n)}`.trim())}catch(s){ye.error("[AutoCapture]",s)}}),e}function FP(t){return t.replace(/"|\\"/g,'\\"')}function jB(t){const e=t.attr__class;if(e)return We(e)?e:ek(e)}const W0=Pn("[Dead Clicks]"),FB=()=>!0,zB=t=>{var e;const n=!!(!((e=t.instance.persistence)===null||e===void 0)&&e.get_property(qS)),r=t.instance.config.capture_dead_clicks;return Ns(r)?r:!!dt(r)||n};var zP=class{get lazyLoadedDeadClicksAutocapture(){return this.Pl}constructor(t,e,n){this.instance=t,this.isEnabled=e,this.onCapture=n,this.startIfEnabledOrStop()}onRemoteConfig(t){if(!t.ok)return;const e=t.config;"captureDeadClicks"in e&&(this.instance.persistence&&this.instance.persistence.register({[qS]:e.captureDeadClicks}),this.startIfEnabledOrStop())}startIfEnabledOrStop(){this.isEnabled(this)?this.Ol(()=>{this.Fl()}):this.stop()}Ol(t){var e,n,r;!((e=tt.__PosthogExtensions__)===null||e===void 0)&&e.initDeadClicksAutocapture?t():(n=tt.__PosthogExtensions__)===null||n===void 0||(r=n.loadExternalDependency)===null||r===void 0||r.call(n,this.instance,"dead-clicks-autocapture",s=>{s?W0.error("failed to load script",s):t()})}Fl(){var t;if(Oe){if(!this.Pl&&(!((t=tt.__PosthogExtensions__)===null||t===void 0)&&t.initDeadClicksAutocapture)){const e=dt(this.instance.config.capture_dead_clicks)?j({},this.instance.config.capture_dead_clicks):{};e.__onCapture=this.onCapture,this.onCapture&&(e.capture_dead_swipes=!1),this.Pl=tt.__PosthogExtensions__.initDeadClicksAutocapture(this.instance,e),this.Pl.start(Oe),W0.info("starting...")}}else W0.error("`document` not found. Cannot start.")}stop(){this.Pl&&(this.Pl.stop(),this.Pl=void 0,W0.info("stopping..."))}};const $h=Pn("[SegmentIntegration]");function VP(t,e,n=!0){const r=t.config.segment;if(!r)return e();const{analytics:s,filterProperties:i}=(l=>zn(l.register))(o=r)?{analytics:o}:o;var o;(function(l,c,d,f){const h=v=>{const _=()=>v.anonymousId()||xo();l.config.get_device_id=_,f&&v.id()&&(l.register({distinct_id:v.id(),$device_id:_()}),l.persistence.set_property(ys,Dg)),d(f?void 0:v.anonymousId()||void 0)},m=c.user();"then"in m&&zn(m.then)?m.then(h):h(m)})(t,s,l=>{s.register(((c,d,{filterProperties:f}={})=>{typeof Promise<"u"&&Promise.resolve||$h.warn("This browser does not have Promise support, and can not use the segment integration");const h=(m,v)=>{if(!v)return m;const _=!!d&&m.event.anonymousId===d&&!m.event.userId;_||m.event.userId||m.event.anonymousId===c.get_distinct_id()||($h.info("No userId set, resetting PostHog"),c.reset()),_||(d=void 0),m.event.userId&&m.event.userId!==c.get_distinct_id()&&($h.info("UserId set, identifying with PostHog"),c.identify(m.event.userId));let y=c.calculateEventProperties(v,m.event.properties);if(!at(f)){const w=m.event.properties||{},x={};for(const P of Object.keys(y))FS.call(w,P)||(x[P]=y[P]);const k=((P,C)=>{const T=We(P)?P:[P];let O=j({},C);for(const I of T)try{if(O=I(O),at(O))return null}catch(R){return $h.error("Error in Segment filterProperties:",R),null}return O})(f,x);if(at(k))return m;y=k}return m.event.properties=Object.assign({},y,m.event.properties),m};return{name:"PostHog JS",type:"enrichment",version:"1.0.0",isLoaded(){return!0},load(){return Promise.resolve()},track(m){return h(m,m.event.event)},page(m){return h(m,QS)},identify(m){return h(m,y5)},screen(m){return h(m,"$screen")}}})(t,l,{filterProperties:i})).then(()=>{e()},c=>{$h.error("Failed to register the Segment integration",c),e()})},n)}const T5="posthog-js";function R5(t,{organization:e,projectId:n,prefix:r,severityAllowList:s=["error"],sendExceptionsToPostHog:i=!0}={}){return o=>{var l,c,d,f,h;if(s!=="*"&&!s.includes(o.level)||!t.__loaded)return o;o.tags||(o.tags={});const m=t.requestRouter.endpointFor("ui",`/project/${t.config.token}/person/${t.get_distinct_id()}`);o.tags["PostHog Person URL"]=m,t.sessionRecordingStarted()&&(o.tags["PostHog Recording URL"]=t.get_session_replay_url({withTimestamp:!0}));const v=((l=o.exception)===null||l===void 0?void 0:l.values)||[],_=v.map(x=>j(j({},x),{},{stacktrace:x.stacktrace?j(j({},x.stacktrace),{},{type:"raw",frames:(x.stacktrace.frames||[]).map(k=>j(j({},k),{},{platform:"web:javascript"}))}):void 0})),y={$exception_message:((c=v[0])===null||c===void 0?void 0:c.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:(h=v[0])===null||h===void 0?void 0:h.type,$sentry_tags:o.tags};var w;return e&&n&&(y.$sentry_url=(r||"https://sentry.io/organizations/")+e+"/issues/?project="+n+"&query="+o.event_id),i&&((w=t.exceptions)===null||w===void 0||w.sendExceptionEvent(y)),o}}var VB=class{constructor(t,e,n,r,s,i){this.name=T5,this.setupOnce=function(o){o(R5(t,{organization:e,projectId:n,prefix:r,severityAllowList:s,sendExceptionsToPostHog:i==null||i}))}}},HP=class{constructor(t){this.Dl=(e,n,r)=>{r&&(r.noSessionId||r.activityTimeout||r.sessionPastMaximumLength||r.crossTabAdoption)&&(ye.info("[PageViewManager] Session rotated, clearing pageview state",{sessionId:e,changeReason:r}),this.Ll=void 0,this._instance.scrollManager.resetContext())},this._instance=t,this.Nl()}Nl(){var t;this.jl=(t=this._instance.sessionManager)===null||t===void 0?void 0:t.onSessionId(this.Dl)}destroy(){var t;(t=this.jl)===null||t===void 0||t.call(this),this.jl=void 0}doPageView(t,e){var n;const r=this.ql(t,e);return this.Ll={pathname:(n=le==null?void 0:le.location.pathname)!==null&&n!==void 0?n:"",pageViewId:e,timestamp:t},this._instance.scrollManager.resetContext(),r}doPageLeave(t){var e;return this.ql(t,(e=this.Ll)===null||e===void 0?void 0:e.pageViewId)}doEvent(){var t;return{$pageview_id:(t=this.Ll)===null||t===void 0?void 0:t.pageViewId}}ql(t,e){const n=this.Ll;if(!n)return{$pageview_id:e};let r={$pageview_id:e,$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:l,maxContentHeight:c,lastContentY:d,maxContentY:f}=s;if(!(ue(i)||ue(o)||ue(l)||ue(c)||ue(d)||ue(f))){i=Math.ceil(i),o=Math.ceil(o),l=Math.ceil(l),c=Math.ceil(c),d=Math.ceil(d),f=Math.ceil(f);const h=i>1?Qo(o/i,0,1,ye):1,m=i>1?Qo(l/i,0,1,ye):1,v=c>1?Qo(d/c,0,1,ye):1,_=c>1?Qo(f/c,0,1,ye):1;r=bn(r,{$prev_pageview_last_scroll:o,$prev_pageview_last_scroll_percentage:h,$prev_pageview_max_scroll:l,$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=(t.getTime()-n.timestamp.getTime())/1e3),r}};const jh=["flags","surveys"],HB={[tB]:{exposure:"hidden"},[kv]:{exposure:"hidden"},[nB]:{exposure:"hidden"},[hb]:{exposure:"hidden"},[Xd]:{exposure:"hidden"},[gp]:{exposure:"hidden"},[QO]:{exposure:"event"},[pb]:{exposure:"hidden"},[e5]:{exposure:"hidden"},[mb]:{exposure:"event"},[JO]:{exposure:"hidden"},[gb]:{exposure:"event"},[vb]:{exposure:"event"},[qS]:{exposure:"event"},[GS]:{exposure:"hidden"},[t5]:{exposure:"event"},[vp]:{exposure:"hidden"},[rB]:{exposure:"hidden"},[jd]:{exposure:"hidden"},[n5]:{exposure:"event"},[sB]:{exposure:"event",shouldSkipFromEventProperties:t=>Mn(t)},[cB]:{exposure:"event"},[uB]:{exposure:"event"},[dB]:{exposure:"event"},[fB]:{exposure:"event"},[hB]:{exposure:"hidden"},[bo]:{exposure:"hidden",storageGroup:"flags"},[Ha]:{exposure:"hidden",storageGroup:"flags"},[db]:{exposure:"hidden"},[wu]:{exposure:"hidden",storageGroup:"flags"},[Gl]:{exposure:"hidden",storageGroup:"flags"},[bu]:{exposure:"hidden",storageGroup:"flags",volatile:!0},[mp]:{exposure:"hidden",storageGroup:"flags"},[Vo]:{exposure:"hidden"},[ru]:{exposure:"hidden"},[ql]:{exposure:"hidden"},[Wl]:{exposure:"hidden"},[ep]:{exposure:"hidden",storageGroup:"surveys"},[Sv]:{exposure:"hidden",storageGroup:"surveys",volatile:!0},[fb]:{exposure:"event"},[Ng]:{exposure:"hidden"},[Lg]:{exposure:"hidden"},[yb]:{exposure:"hidden"},[pB]:{exposure:"hidden"},[mB]:{exposure:"hidden"},[gB]:{exposure:"event"},[vB]:{exposure:"event"},[yB]:{exposure:"event"},[_B]:{exposure:"event"},[Go]:{exposure:"hidden"},[Jh]:{exposure:"hidden"},[r5]:{exposure:"event"},[zp]:{exposure:"hidden"},[ec]:{exposure:"hidden",storageGroup:"flags",volatile:!0},[ys]:{exposure:"hidden"},[_b]:{exposure:"hidden"},[s5]:{exposure:"hidden"},[i5]:{exposure:"hidden"},[o5]:{exposure:"hidden"},[Fd]:{exposure:"hidden"},[KS]:{exposure:"hidden"},[iB]:{exposure:"event"},[oB]:{exposure:"event"},[aB]:{exposure:"event"},[lB]:{exposure:"event"},[l5]:{exposure:"event"},[c5]:{exposure:"event"},[YS]:{exposure:"hidden"},[XS]:{exposure:"hidden"},[u5]:{exposure:"hidden"},[d5]:{exposure:"hidden"},[f5]:{exposure:"hidden"},[h5]:{exposure:"hidden"},[p5]:{exposure:"hidden"},[m5]:{exposure:"hidden"},[g5]:{exposure:"hidden"},[wB]:{exposure:"event"}},UB=[["$posthog_sr_group_event_trigger_",{exposure:"hidden"}],["$posthog_sr_group_url_trigger_",{exposure:"hidden"}],["$posthog_sr_group_sampling_",{exposure:"hidden"}]],jr=t=>{const e=HB[t];if(e)return e;for(const[n,r]of UB)if(t.indexOf(n)===0)return r};function I5(){try{return Intl.DateTimeFormat().resolvedOptions().timeZone}catch{return}}const Ya=t=>{const e=typeof document>"u"?void 0:document,n=e==null?void 0:e.createElement("a");return ue(n)?null:(n.href=t,n)},O5=()=>{try{return"u">typeof window&&window.navigator.onLine!==!1}catch{return!1}},M5=(t,e)=>t>=e&&O5(),N5=(t,e,n,r)=>{if(t===0){if(O5()){const s=e+1;return s===n&&r(),s}return e}return 0},Vd=(t,e)=>{try{let n;return JSON.stringify(t,(r,s)=>{var i;return Gf(s)?((i=n)!==null&&i!==void 0||(n=new WeakMap),n.has(s)||n.set(s,_5(s)),n.get(s)):typeof s=="bigint"?s.toString():s},e)}catch{return G4(t)}},xf=function(t,e){const n=((t.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]===e){r=i;break}}if(!We(r)||2>r.length)return"";{let s=r[1].replace(/\+/g," ");try{s=decodeURIComponent(s)}catch{ye.error("Skipping decoding for malformed query param: "+s)}return s}},Hp=function(t,e,n){if(!t||!e||!e.length)return t;const r=t.split(/#(.*)/),s=r[1],i=(r[0]||"").split(/\?(.*)/),o=i[1],l=i[0],c=(o||"").split("&"),d=[];for(let h=0;c.length>h;h++){const m=c[h].split("?");let v=0;for(;m.length>v&&!e.includes(m[v].split("=")[0]);)v++;d.push(m.length>v?m.slice(0,v).concat(m[v].split("=")[0]+"="+n).join("?"):c[h])}let f=l;return o!=null&&(f+="?"+d.join("&")),s!=null&&(f+="#"+s),f},Pv=function(t,e){const n=t.match(new RegExp(e+"=([^&]*)"));return n?n[1]:null},Sf=["gclid","gclsrc","dclid","gbraid","wbraid","fbclid","msclkid","twclid","li_fat_id","igshid","ttclid","rdt_cid","epik","qclid","sccid","oppref","bfcid","irclid","_kx"],BB=["utm_source","utm_medium","utm_campaign","utm_content","utm_term","gad_source","mc_cid",...Sf],Up="<masked>",ZB=["li_fat_id"];function L5(t,e,n){if(!Oe)return{};const r=e?[...Sf,...n||[]]:[],s=D5(Hp(Oe.URL,r,Up),t),i=(function(){const o={};return Wt(ZB,function(l){const c=yp(l);o[l]=c||null}),o})();return bn(i,s)}function D5(t,e){const n=BB.concat(e||[]),r={};return Wt(n,function(s){const i=xf(t,s);r[s]=i||null}),r}function $5(t){const e=(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})(t),n=e!="yahoo"?"q":"p",r={};if(!Mn(e)){r.$search_engine=e;const s=Oe?xf(Oe.referrer,n):"";s.length&&(r.ph_keyword=s)}return r}function j5(){return navigator.language||navigator.userLanguage}function WB(){const t=j5();return typeof t=="string"?t.split("-")[0]:void 0}const Av="$direct";function F5(){return(Oe==null?void 0:Oe.referrer)||Av}function z5(t,e,n=!1){const r=t?[...Sf,...e||[]]:[],s=n?oc(dn==null?void 0:dn.href):dn==null?void 0:dn.href,i=s==null?void 0:s.substring(0,1e3);return{r:F5().substring(0,1e3),u:i?Hp(i,r,Up):void 0}}function V5(t,e=!1){var n;const{r,u:s}=t,i=e?oc(s):s,o={$referrer:r,$referring_domain:r==null?void 0:r==Av?Av:(n=Ya(r))===null||n===void 0?void 0:n.host};if(i){o.$current_url=i;const l=Ya(i);o.$host=l==null?void 0:l.host,o.$pathname=l==null?void 0:l.pathname;const c=D5(i);bn(o,c)}if(r){const l=$5(r);bn(o,l)}return o}function qB(){try{return new Date().getTimezoneOffset()}catch{return}}const GB={flags:ec,surveys:Sv},KB=["cookie","localstorage","localstorage+cookie","sessionstorage","memory"],q0=t=>`${t}_cookie_identity_change_pending`,G0=t=>{let e="",n=0;for(const r of t){const s=encodeURIComponent(JSON.stringify(r).slice(1,-1)).length;if(n+s>1e3)break;e+=r,n+=s}return e},pr="main",Ma=[bo,Ha,wu,Gl,bu,ec,mp,ql],h2=t=>Ma.indexOf(t)!==-1,H5=[Xd,gp],UP=t=>H5.indexOf(t)!==-1,Pl=(t,e)=>{try{return JSON.stringify(t)===JSON.stringify(e)}catch{return t===e}},wd=t=>{if(!t)return{};const e=JSON.parse(t);return dt(e)?e:{}},BP=(t,e)=>{Wt(t,(n,r)=>{const s=jr(r);s&&s.exposure!=="event"||{}.hasOwnProperty.call(e,r)||delete t[r]})};var p2=class{constructor(t,e,n=!0,r=!t.cookieless_mode){if(this.Bl={},this.zl=!1,this.Hl=!1,this.Ul=!1,this.Wl=!1,this.Vl=!1,this.Gl=new Map,this.Ql=!1,this.Jl=!1,this.Zl=!1,this.Kl=new Set,this.Yl=new Set,this.Pr=t,this.Xl=n,this.props={},this.tu=void 0,this.eu=(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"})(t),this.fi=t.disable_persistence||!!e,this.El=this.iu(t),this.Ul=this.nu(t),this.load(r),this.su(),t.debug&&ye.info("Persistence loaded",t.persistence,j({},this.props)),this.update_config(t,t,e),this.save(),le){const s=()=>this.flush();Dt(le,"beforeunload",s,{capture:!1}),Dt(le,"pagehide",s,{capture:!1}),this.ru=i=>{if(this.zl&&(!i.storageArea||i.storageArea===(le==null?void 0:le.localStorage))&&i.key)if(i.key!==this.eu){if(this.Ul){const o=jh.find(l=>i.key===this.ou(l));o&&this.au(i.key,o)}}else this.au(i.key,pr)},Dt(le,"storage",this.ru)}}markCrossTabFeatureFlagChanges(t){Object.entries(t).forEach(([e,n])=>{const r=this.Gl.get(e);if(!h2(e)||r===!0)return;if(n===!0)return void this.lu(e,!0);const s=new Set(r||[]);n.forEach(i=>s.add(i)),s.size&&this.lu(e,s)})}onCrossTabFeatureFlagChange(t){return this.Yl.add(t),()=>this.Yl.delete(t)}destroy(){this.ru&&le&&(le.removeEventListener("storage",this.ru),this.ru=void 0),this.Yl.clear()}au(t,e,n=!0){if(this.fi)return!1;let r,s;try{if(s=It.Lt(t),Mn(s)){const l=this.uu(e);return l.storageValue=null,e!==pr&&(l.persisted=!1),!1}r=wd(s)}catch{return!1}const i=e===pr?r:It.Ft(this.eu);if(i&&this.cu(i))return!1;const o=this.hu(r,e,n);return e===pr&&this.Ul&&!Pl(this.du().main,r)||this.vu(r,e,!0,s),o}cu(t){const e=this.props[Wi],n=t[Wi];return!ue(e)&&!ue(n)&&e!==n}vu(t,e,n,r){const s=this.uu(e);s.storageValue=r,e!==pr&&(s.persisted=n);try{s.fingerprint=this.fu(t,e)}catch{s.fingerprint=void 0}}hu(t,e,n){let r=!1;return Ma.forEach(s=>{var i;const o=(i=jr(s))===null||i===void 0?void 0:i.storageGroup;if(e===pr&&this.Ul&&o||e!==pr&&o!==e)return;const l=s in t,c=this.pu(s,l?t[s]:void 0),d=this.Gl.has(s)?s in this.props:l;d===s in this.props&&Pl(c,this.props[s])||(d?this.gu(s,c,!1):this.mu(s,!1),r=!0)}),r&&n&&this.Yl.forEach(s=>s()),r}yu(){if(!this.zl)return!1;try{this.Zl=!1;const t=It.Lt(this.eu),e=this.uu(pr);let n,r=!1,s=!1;if(t!==e.storageValue)if(Mn(t))e.storageValue=null;else{if(n=wd(t),this.Zl=!this.Jl&&this.cu(n),this.Zl)return!1;s=this.hu(n,pr,!1),!this.Ul||Pl(this.du().main,n)?this.vu(n,pr,!0,t):e.storageValue=t,r=!0}return this.Ul&&jh.forEach(i=>{const o=It.Lt(this.ou(i)),l=this.uu(i),c=n||{},d=r&&Ma.some(h=>{var m;return((m=jr(h))===null||m===void 0?void 0:m.storageGroup)===i&&h in c});if(o===l.storageValue&&!d)return;if(Mn(o))return l.storageValue=null,l.persisted=!1,void(d&&(s=this.hu(c,i,!1)||s));const f=wd(o);s=this.hu(f,i,!1)||s,this.vu(f,i,!0,o)}),s}catch{return!1}}lu(t,e){this.Gl.set(t,e);const n=jr(t);n!=null&&n.volatile||(this.uu((this.Ul?n==null?void 0:n.storageGroup:void 0)||pr).fingerprint=void 0,this.bu(t))}_u(){Ma.forEach(t=>this.Gl.set(t,!0))}su(){if(this.zl)try{const t=It.Lt(this.eu),e=wd(t);this.uu(pr).storageValue=t,Ma.forEach(n=>{var r;const s=this.Ul?(r=jr(n))===null||r===void 0?void 0:r.storageGroup:void 0,i=s?It.Lt(this.ou(s)):null;if(s){const l=this.uu(s);l.storageValue=i,l.persisted=!Mn(i)}const o=s&&!Mn(i)?wd(i):e;n in this.props?this.wu(n,o[n],this.props[n]):n in o&&this.lu(n,!0)})}catch{}}pu(t,e){const n=this.Gl.get(t);if(!n)return e;if(n===!0)return this.props[t];if(t==="$active_feature_flags"){const i=new Set(We(e)?e:[]),o=new Set(We(this.props[t])?this.props[t]:[]);return n.forEach(l=>o.has(l)?i.add(l):i.delete(l)),Array.from(i)}const r=dt(e)?j({},e):{},s=dt(this.props[t])?this.props[t]:{};return n.forEach(i=>{i in s?r[i]=s[i]:delete r[i]}),r}wu(t,e,n){if(!h2(t))return;const r=this.Gl.get(t);if(r===!0)return;let s=e;if(this.zl)try{var i;const l=this.Ul?(i=jr(t))===null||i===void 0?void 0:i.storageGroup:void 0,c=l?this.ou(l):this.eu;s=wd(It.Lt(c))[t]}catch{}const o=new Set(r||[]);if(t==="$active_feature_flags"){if(!ue(e)&&!We(e)||!ue(s)&&!We(s)||!We(n))return void this.lu(t,!0);const l=new Set(e||[]),c=new Set(s||[]),d=new Set(n);new Set([...l,...d]).forEach(f=>{l.has(f)!==d.has(f)&&o.add(f)}),o.forEach(f=>{c.has(f)===d.has(f)&&o.delete(f)})}else{if(!dt(n))return void(Pl(s,n)?this.Gl.delete(t):this.lu(t,!0));{if(!ue(e)&&!dt(e)||ue(e)&&Ws(n)&&ue(s))return void this.lu(t,!0);const l=dt(e)?e:{},c=dt(s)?s:{};new Set([...Object.keys(l),...Object.keys(n)]).forEach(d=>{d in l==d in n&&Pl(l[d],n[d])||o.add(d)}),o.forEach(d=>{d in c==d in n&&Pl(c[d],n[d])&&o.delete(d)})}}o.size?this.lu(t,o):this.Gl.delete(t)}ku(){var t;const e=(t=this.Pr)===null||t===void 0?void 0:t.persistence_save_debounce_ms;return Xn(e)&&e>0?e:0}Su(t){if(this.Pr.cookieWinsOnConflict&&this.Pr.persistence.toLowerCase()==="localstorage+cookie")if(t)try{const e=u2(t,this.Pr.cookie_persisted_properties||[]),n=PP(e,this.Pr.cookie_persisted_properties||[]),r=JSON.stringify(e)+"|"+JSON.stringify(n),s=_n.Lt(this.eu)||void 0;s&&d2(this.eu,s)===r&&(this.xu=r,this.$u=s)}catch{}else try{const e=_n.Lt(this.eu)||void 0;this.xu=e?d2(this.eu,e):void 0,this.$u=e}catch{}}syncCookieProperties(){return this.Cu(this.Pr)}Cu(t,e=!1){if(this.fi&&!e||this.Vl||!t.cookieWinsOnConflict||t.persistence.toLowerCase()!=="localstorage+cookie")return!1;let n;try{n=_n.Lt(this.eu)||void 0}catch{}if(!n||n===this.$u)return!1;const r=d2(this.eu,n);let s;try{s=c2(JSON.parse(n))}catch{return!1}if((_n.Lt(this.eu)||void 0)!==n)return!1;this.xu=r,this.$u=n;const i=AP(this.eu,n),o=[...su,...i.properties],l={};if(Object.keys(s).forEach(y=>{const w=s[y];(ue(w)||Mn(w)||w===""||y==="$user_state"&&w!=="anonymous"&&w!=="identified")&&(l[y]=!0,delete s[y])}),Ws(s))return!1;const c="distinct_id"in s||s.$user_state==="anonymous"||s.$user_state==="identified",d=this.props,f=d[Wi],h=d[ys],m=bn({},d);[...su,...t.cookie_persisted_properties||[]].forEach(y=>{if(o.indexOf(y)!==-1&&!(y in s)&&!l[y]&&(c||y!=="distinct_id"&&y!=="$user_state")){const w=m[y];(i.isValid||su.indexOf(y)===-1||w!==!1&&w!==0)&&delete m[y]}}),this.props=bn(m,s),Ma.forEach(y=>{const w=y in this.props;y in d===w&&Pl(d[y],this.props[y])||(w?this.wu(y,d[y],this.props[y]):this.lu(y,!0))}),!c||"$user_state"in s||"$user_state"in this.props||this.gu(ys,Ua);const v=this.props[Wi],_=this.props[ys];return!c||v===f&&_===h||(this.Jl=!0,this.Wl=!0,fn.$t(q0(this.eu),!0),this.mu(ql),this.mu(Ha),this.mu(bo),this.mu(wu),this.mu(Gl),this.mu(bu),this.mu(ec),this.mu(zp),this.mu(Go),_!=="anonymous"||h!=="identified"&&s.$user_state!=="anonymous"&&(ue(f)||v===f)||(BP(this.props,s),this.mu(Wl)),_==="identified"?this.props.$user_id=v:delete this.props.$user_id,this.mu(kv)),!0}consumeCookieIdentityChange(){const t=q0(this.eu),e=this.Wl||!!fn.Lt(t);return this.Wl=!1,e&&fn.Dt(t),e}Tu(t=!1){return!(this.Vl||this.fi&&!t||!this.Pr.cookieWinsOnConflict||this.Pr.persistence.toLowerCase()!=="localstorage+cookie"||(this.Vl=!0,0))}Iu(){this.Vl&&(ue(this.Mu)||(clearTimeout(this.Mu),this.Mu=void 0),delete this.Bl[pr],this.Eu(!0))}Au(t=!0){if(this.Vl)try{t?this.Iu():ue(this.Mu)||(clearTimeout(this.Mu),this.Mu=void 0)}finally{this.Vl=!1}}isDisabled(){return!!this.fi}iu(t){KB.indexOf(t.persistence.toLowerCase())===-1&&(ye.critical("Unknown persistence type "+t.persistence+"; falling back to localStorage+cookie"),t.persistence="localStorage+cookie");const e=((o=[],l=!1,c=()=>!1)=>{const d=[...su,...o];return j(j({},It),{},{Ru(f){return[_n.Lt(f),_n.Lt(_p(f)),It.Lt(f)].join("\0")},Ft(f){try{let m,v={};try{m=_n.Lt(f)||void 0,v=m?c2(JSON.parse(m)):{}}catch{}const _=JSON.parse(It.Lt(f)||"{}");let y;if(l){const w=AP(f,m),x=[...su,...w.properties],k={};Object.keys(v).forEach(C=>{const T=v[C];Mn(T)||T===""||C==="$user_state"&&T!=="anonymous"&&T!=="identified"||(k[C]=T)});const P="distinct_id"in k||k.$user_state==="anonymous"||k.$user_state==="identified";if(Object.keys(k).length>0){var h;const C=_[Wi],T=(h=_.$user_state)!==null&&h!==void 0?h:Ua;d.forEach(O=>{if(x.indexOf(O)!==-1&&!(O in v)&&(P||O!=="distinct_id"&&O!=="$user_state")){const I=_[O];(w.isValid||su.indexOf(O)===-1||I!==!1&&I!==0)&&delete _[O]}}),!P||"$user_state"in v||"$user_state"in _||(_[ys]=Ua),!P||("distinct_id"in k?k[Wi]:_[Wi])===C&&("$user_state"in k?k[ys]:_[ys])===T||(l2.forEach(O=>delete _[O]),k.$user_state==="identified"&&"distinct_id"in k?_.$user_id=k[Wi]:delete _.$user_id,k.$user_state!=="identified"&&(delete _[r5],delete _[Wl]),delete _.__alias)}y=bn(_,k)}else y=bn(v,_);return c()||It.$t(f,y),y}catch{}return null},$t(f,h,m,v,_,y){const w=It.$t(f,h,void 0,void 0,y);try{const x=u2(h,o);if(Object.keys(x).length){if(l){const k=_p(f),P=PP(x,o);if(_n.$t(k,P,m,v,_,y),_n.Lt(k)!==JSON.stringify(P)){_n.Dt(k,v);const C=u2(h);return _n.$t(f,C,m,v,_,y),w}}_n.$t(f,x,m,v,_,y)}}catch(x){It.Pt(x)}return w},Dt(f,h){try{le==null||le.localStorage.removeItem(f),_n.Dt(f,h),_n.Dt(_p(f),h)}catch(m){It.Pt(m)}}})})(t.cookie_persisted_properties||[],t.cookieWinsOnConflict,()=>!!this.fi);let n,r=!1,s=!1;const i=t.persistence.toLowerCase();return i==="localstorage"&&It.Ot()?(n=It,s=!0):i==="localstorage+cookie"&&e.Ot()?(n=e,s=!0,r=!0):i==="sessionstorage"&&fn.Ot()?n=fn:i==="memory"?n=xb:i==="cookie"&&_n.Ot()?(n=_n,r=!0):e.Ot()?(n=e,s=!0,r=!0):_n.Ot()?(n=_n,r=!0):n=xb,this.zl=s,this.Hl=r,n}ou(t){return`${this.eu}__${t}`}nu(t){return this.zl&&!!t.split_storage}properties(){const t={};return Wt(this.props,(e,n)=>{const r=jr(n);if(!r||r.exposure==="event"){var s;if(!(r==null||(s=r.shouldSkipFromEventProperties)===null||s===void 0)&&s.call(r,e))return;t[n]=e}}),t}load(t=!1){if(this.fi&&!t)return;const e=this.Pr.cookieWinsOnConflict&&this.Pr.persistence.toLowerCase()==="localstorage+cookie",n=e?It.Ft(this.eu):null;let r={};if(e)try{r=c2(_n.Ft(this.eu)),Wt(r,(l,c)=>{(ue(l)||Mn(l)||l==="")&&delete r[c]})}catch{}const s=this.El.Ft(this.eu);if(s&&(this.props=bn({},s)),this.Ul&&this.Pu(),e&&s){var i,o;const l=n==null?void 0:n[Wi],c=(i=n==null?void 0:n.$user_state)!==null&&i!==void 0?i:Ua,d=s[Wi],f=(o=s.$user_state)!==null&&o!==void 0?o:Ua;if(d!==l||f!==c){this.Wl=!0,this.fi||fn.$t(q0(this.eu),!0);const h=bn({},this.props);l2.forEach(v=>delete h[v]),f!=="anonymous"||c!=="identified"&&r.$user_state!=="anonymous"&&(ue(l)||d===l)||(BP(h,r),delete h[Wl]),this.props=h;const m=new Set;l2.forEach(v=>{var _;const y=(_=jr(v))===null||_===void 0?void 0:_.storageGroup;y&&m.add(y)}),m.forEach(v=>{if(this.fi)return;const _={};Wt(this.props,(y,w)=>{var x;((x=jr(w))===null||x===void 0?void 0:x.storageGroup)===v&&(_[w]=y)}),Ws(_)?(It.Dt(this.ou(v)),this.Bl[v]={}):It.$t(this.ou(v),_)&&(this.Bl[v]={persisted:!0,fingerprint:this.fu(_,v)})})}}fn.Lt(q0(this.eu))&&(this.Wl=!0)}Pu(){for(const t of jh){const e=It.Ft(this.ou(t));if(e&&!Ws(e)){const n=this.uu(t);n.persisted=!0,this.Ou(t)||(n.fingerprint=this.fu(e,t)),this.Fu(t,e)||bn(this.props,e)}}}Ou(t){return Object.keys(this.props).some(e=>{var n;return((n=jr(e))===null||n===void 0?void 0:n.storageGroup)===t})}Fu(t,e){const n=GB[t];if(!n)return!1;const r=e[n],s=this.props[n];return Xn(r)&&Xn(s)&&s>r}refreshKey(t){this.Du([t])}Du(t){if(this.fi)return;let e,n=!1;const r=()=>(n||(e=this.El.Ft(this.eu),n=!0),e);t.forEach(s=>{var i;if(this.Kl.has(s))return;const o=this.Ul?(i=jr(s))===null||i===void 0?void 0:i.storageGroup:void 0,l=o?It.Ft(this.ou(o)):r();if(l&&s in l)this.gu(s,l[s],!1);else{if(o){const c=r();if(c&&s in c)return void this.gu(s,c[s],!1)}this.mu(s,!1)}})}refreshMetaIdentifiers(){if(this.fi)return;const t=this.Lu();(ue(t)||t!==this.Nu)&&(this.Du(H5),this.ju(t))}ju(t=this.Lu()){this.Nu=this.Kl.size===0?t:void 0}Lu(){const t=this.El.Ru?this.El.Ru(this.eu):this.El.Lt(this.eu);return ht(t)?t:void 0}save(){if(this.fi)return;const t=this.ku();t>0?ue(this.Mu)&&(this.Mu=setTimeout(()=>{this.Mu=void 0,this.Eu()},t)):this.Eu()}flush(){ue(this.Mu)||(clearTimeout(this.Mu),this.Mu=void 0,this.Eu())}Eu(t=!1){if(this.fi||this.Vl&&!t)return;t||(this.syncCookieProperties(),this.Pr.cookieWinsOnConflict&&this.Pr.persistence.toLowerCase()==="localstorage+cookie"||this.refreshMetaIdentifiers());const e=!t&&!this.Ql;e||(this.Zl=!1);const n=!!e&&this.yu();if(this.Zl)return void(this.Pr.debug&&ye.warn("skipping persistence write because storage belongs to a different distinct ID"));if(this.Ul)return this.qu(),void(n&&this.Yl.forEach(s=>s()));const r=this.Bu(this.El,this.eu,this.props,pr);r==="written"&&this.Su(this.props),r!=="failed"&&(this.Gl.clear(),this.Jl=!1,this.Kl.clear()),r==="written"&&this.ju(),n&&this.Yl.forEach(s=>s())}qu(){const{main:t,groups:e}=this.du(),n=this.Bu(this.El,this.eu,t,pr);n==="written"&&this.Su(t),n!=="failed"&&(this.Jl=!1,this.Kl.clear(),Ma.forEach(s=>{var i;!((i=jr(s))===null||i===void 0)&&i.storageGroup||this.Gl.delete(s)})),n==="written"&&this.ju();for(const s of jh){var r;const i=e[s];if(Ws(i)&&!(!((r=this.Bl[s])===null||r===void 0)&&r.persisted)){Ma.forEach(l=>{var c;((c=jr(l))===null||c===void 0?void 0:c.storageGroup)===s&&this.Gl.delete(l)});continue}const o=this.Bu(It,this.ou(s),i,s);o!=="failed"&&Ma.forEach(l=>{const c=jr(l);(c==null?void 0:c.storageGroup)!==s||o!=="written"&&c.volatile||this.Gl.delete(l)})}}du(){const t={},e={flags:{},surveys:{}};return Wt(this.props,(n,r)=>{var s;const i=(s=jr(r))===null||s===void 0?void 0:s.storageGroup;i?e[i][r]=n:t[r]=n}),{main:t,groups:e}}fu(t,e){if(e===pr)return JSON.stringify(t)+"|"+this.zu+"|"+this.Hu+"|"+this.Uu;const n={};return Wt(t,(r,s)=>{var i;n[s]=!((i=jr(s))===null||i===void 0)&&i.volatile?"__volatile__":r}),JSON.stringify(n)}Bu(t,e,n,r){const s=this.uu(r);if(r!==pr&&!s.dirty&&!ue(s.fingerprint))return"skipped";let i;try{if(i=this.fu(n,r),i===s.fingerprint)return s.dirty=!1,"skipped"}catch{i=void 0}return t.$t(e,n,this.zu,this.Hu,this.Uu,this.Pr.debug)?(s.dirty=!1,r!==pr&&(s.persisted=!0),ue(i)||(s.fingerprint=i),this.zl&&(s.storageValue=It.Lt(e)),"written"):(this.Pr.debug&&ye.warn(`failed to persist storage entry "${e}"; will retry on next save`),"failed")}remove({keepGroupEntries:t=!1}={}){if(this._u(),ue(this.Mu)||(clearTimeout(this.Mu),this.Mu=void 0),this.El.Dt(this.eu,!1),this.El.Dt(this.eu,!0),!t&&this.Xl)for(const e of jh)It.Dt(this.ou(e));t?delete this.Bl[pr]:this.Bl={},this.xu=void 0,this.$u=void 0}clear(){this.remove(),this.props={}}register_once(t,e,n){if(dt(t)){this.syncCookieProperties(),ue(e)&&(e="None"),this.zu=ue(n)?this.Wu:n;let r=!1;if(Wt(t,(s,i)=>{this.props.hasOwnProperty(i)&&this.props[i]!==e||(this.gu(i,s),r=!0)}),r)return this.save(),!0}return!1}register(t,e){if(dt(t)){this.syncCookieProperties(),this.zu=ue(e)?this.Wu:e;let n=!1;if(Wt(t,(r,s)=>{t.hasOwnProperty(s)&&(this.props[s]!==r||dt(r)||We(r))&&(this.gu(s,r),n=!0)}),n)return this.save(),!0}return!1}unregister(t){this.syncCookieProperties();const e=typeof t=="string"?[t]:t;let n=!1;for(const r of e)r in this.props&&(this.mu(r),n=!0);n&&this.save()}update_campaign_params(){const t=Oe==null?void 0:Oe.URL;if(t===this.tu)return;const e=L5(this.Pr.custom_campaign_params,this.Pr.mask_personal_data_properties,this.Pr.custom_personal_data_properties),n=!Ws(JS(e));return n&&this.register(e),this.tu=t,n?e:void 0}update_search_keyword(){this.register((function(){const t=Oe==null?void 0:Oe.referrer;return t?$5(t):{}})())}update_referrer_info(){var t;this.register_once({$referrer:F5(),$referring_domain:(Oe==null?void 0:Oe.referrer)&&((t=Ya(Oe.referrer))===null||t===void 0?void 0:t.host)||Av},void 0)}set_initial_person_info(){if(this.props.$initial_campaign_params||this.props.$initial_referrer_info)return;const t=z5(this.Pr.mask_personal_data_properties,this.Pr.custom_personal_data_properties,this.Pr.disable_capture_url_hashes);this.register_once({[Fd]:this.Hl?{r:G0(t.r),u:t.u?G0(t.u):void 0}:t},void 0)}get_initial_props(){const t={};Wt([o5,i5],n=>{const r=this.props[n];r&&Wt(r,function(s,i){t["$initial_"+tb(i)]=s})});const e=this.props[Fd];if(e){const n=(function(r,s=!1){const i=V5(r,s),o={};return Wt(i,function(l,c){o[`$initial_${tb(c)}`]=l}),o})(e,this.Pr.disable_capture_url_hashes);bn(t,n)}return t}safe_merge(t){return Wt(this.props,function(e,n){n in t||(t[n]=e)}),t}update_config(t,e,n){const r=t.persistence!==e.persistence,s=!((v,_)=>{if(v.length!==_.length)return!1;const y=[...v].sort(),w=[..._].sort();return y.every((x,k)=>x===w[k])})(t.cookie_persisted_properties||[],e.cookie_persisted_properties||[]),i=r||s,o=t.cookieWinsOnConflict!==e.cookieWinsOnConflict,l=t.disable_persistence||!!n,c=!!this.fi&&!l;l||this.Cu(e,c),this.Pr=t,!l&&(r||s||o)&&(this.xu=void 0,this.$u=void 0,this.Cu(j(j({},t),{},{cookie_persisted_properties:e.cookie_persisted_properties}),c));const d=i||o?this.iu(t):this.El;this.Vu();const f=this.nu(t),h=i||f!==this.Ul,m=!l&&(h||t.cross_subdomain_cookie!==this.Hu||t.secure_cookie!==this.Uu)&&this.Tu(c);this.Ql=h;try{if(this.Wu=this.zu=t.cookie_expiration,this.set_disabled(l),this.set_cross_subdomain(t.cross_subdomain_cookie),this.set_secure(t.secure_cookie),h){const v=this.props;this.clear(),this.El=d,this.Ul=f,this.props=v,this.save()}else o&&(this.El=d,l||(delete this.Bl[pr],this.Eu()))}finally{this.Ql=!1,m&&this.Au()}}Vu(){const t=this.props[Fd];if(!this.Hl||!dt(t)||typeof t.r!="string")return;const e=G0(t.r),n=typeof t.u=="string"?G0(t.u):t.u;e===t.r&&n===t.u||this.gu(Fd,j(j({},t),{},{r:e,u:n}))}set_disabled(t){this.fi=t,this.fi?this.remove():this.save()}set_cross_subdomain(t){t!==this.Hu&&(this.Hu=t,this.remove({keepGroupEntries:!0}),this.save())}set_secure(t){t!==this.Uu&&(this.Uu=t,this.remove({keepGroupEntries:!0}),this.save())}set_event_timer(t,e){const n=this.props.__timers||{};n[t]=e,this.gu(hb,n),this.save()}remove_event_timer(t){const e=this.props.__timers||{},n=e[t];return ue(n)||(delete e[t],this.gu(hb,e),this.save()),n}get_property(t){return this.props[t]}set_property(t,e){this.gu(t,e),this.save()}gu(t,e,n=!0){var r;const s=this.props[t];this.props[t]=e,n&&(t!=="distinct_id"&&t!=="$user_state"||s===e||(this.Jl=!0),UP(t)&&!Pl(s,e)&&this.Kl.add(t),this.wu(t,s,e),!((r=jr(t))===null||r===void 0)&&r.volatile||this.bu(t))}mu(t,e=!0){delete this.props[t],e&&(h2(t)&&this.lu(t,!0),UP(t)&&this.Kl.add(t),this.bu(t))}bu(t){var e;const n=(e=jr(t))===null||e===void 0?void 0:e.storageGroup;n&&(this.uu(n).dirty=!0)}uu(t){return this.Bl[t]||(this.Bl[t]={})}};const vi={GZipJS:"gzip-js",Base64:"base64"},Fh={Activation:"events",Cancellation:"cancelEvents"},m2={Popover:"popover",API:"api",Widget:"widget"},gi={SHOWN:"survey shown",DISMISSED:"survey dismissed",SENT:"survey sent"},g2={SURVEY_ID:"$survey_id",SURVEY_ITERATION:"$survey_iteration",SURVEY_LAST_SEEN_DATE:"$survey_last_seen_date"},kb={Popover:"popover",Inline:"inline"};function K0(t){let e=!0;return{dispose(){if(e){e=!1;const n=t();n&&zn(n.then)&&n.then(void 0,()=>{})}}}}const YB={SHOWN:"product tour shown"},ZP={TOUR_LAST_SEEN_DATE:"$product_tour_last_seen_date",TOUR_TYPE:"$product_tour_type"},WP=Pn("[RateLimiter]");var XB=class{constructor(t){this.serverLimits={},this.lastEventRateLimited=!1,this.checkForLimiting=e=>{const n=e.text;if(n&&n.length)try{(JSON.parse(n).quota_limited||[]).forEach(r=>{WP.info(`${r||"events"} is quota limited.`),this.serverLimits[r]=new Date().getTime()+6e4})}catch(r){return void WP.warn(`could not rate limit - continuing. Error: "${r==null?void 0:r.message}"`,{text:n})}},this.instance=t,this.lastEventRateLimited=this.clientRateLimitContext(!0).isRateLimited}get captureEventsPerSecond(){var t;return((t=this.instance.config.rate_limiting)===null||t===void 0?void 0:t.events_per_second)||10}get captureEventsBurstLimit(){var t;return Math.max(((t=this.instance.config.rate_limiting)===null||t===void 0?void 0:t.events_burst_limit)||10*this.captureEventsPerSecond,this.captureEventsPerSecond)}get isClientRateLimited(){return 1>this.Gu().tokens}clientRateLimitContext(t=!1){var e;const n=this.Gu(),r=1>n.tokens;if(r||t||(n.tokens=Math.max(0,n.tokens-1)),r&&!t){const s=(Xn(n.dropped)?n.dropped:0)+1;n.dropped=s,!this.lastEventRateLimited&&this.Qu(s)&&(n.dropped=0)}return this.lastEventRateLimited=r,(e=this.instance.persistence)===null||e===void 0||e.set_property("$capture_rate_limit",n),{isRateLimited:r,remainingTokens:n.tokens}}Gu(){var t;const{captureEventsBurstLimit:e,captureEventsPerSecond:n}=this,r=new Date().getTime(),s=(t=this.instance.persistence)===null||t===void 0?void 0:t.get_property(s5),i=s?j({},s):{tokens:e,last:r};return i.tokens+=Math.max(0,r-i.last)/1e3*n,i.last=Math.max(i.last,r),i.tokens>e&&(i.tokens=e),i}Ju(t){const e=this.instance.config.property_denylist;return!We(e)||!e.includes(t)}Zu(){var t;if(this.Ju("$current_url")&&this.Ju("$pathname")&&(dn!=null&&dn.pathname))return`${(t=dn.origin)!==null&&t!==void 0?t:""}${dn.pathname}`}Qu(t){var e,n;const{captureEventsBurstLimit:r,captureEventsPerSecond:s}=this,i=this.Zu(),o=this.Ju("$session_id")?(e=(n=this.instance).get_session_id)===null||e===void 0?void 0:e.call(n):void 0,l=[`${t} 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: ${l}. Config is set to ${s} events per second and ${r} events burst limit.`},{skip_client_rate_limiting:!0})}isServerRateLimited(t){const e=this.serverLimits[t||"events"]||!1;return e!==!1&&new Date().getTime()<e}};const Al=Pn("[RemoteConfig]");var U5=class{constructor(t){this._instance=t}get remoteConfig(){var t;return(t=tt._POSTHOG_REMOTE_CONFIG)===null||t===void 0||(t=t[this._instance.config.token])===null||t===void 0?void 0:t.config}Ku(t){var e,n,r;!((e=tt.__PosthogExtensions__)===null||e===void 0)&&e.loadExternalDependency?(n=tt.__PosthogExtensions__)===null||n===void 0||(r=n.loadExternalDependency)===null||r===void 0||r.call(n,this._instance,"remote-config",()=>t(this.remoteConfig)):t()}Yu(t){this._instance._send_request({method:"GET",url:this._instance.requestRouter.endpointFor("assets",`/array/${this._instance.config.token}/config`),callback:t})}load(){try{if(this.remoteConfig)return Al.info("Using preloaded remote config",this.remoteConfig),void this.Xu(this.remoteConfig);if(this._instance.tc())return void Al.warn("Remote config is disabled. Falling back to local config.");this.Ku(t=>{if(!t)return Al.info("No config found after loading remote JS config. Falling back to JSON."),void this.Yu(e=>{this.Xu(e.json,e)});this.Xu(t)})}catch(t){Al.error("Error loading remote config",t),this.Xu()}}Xu(t,e){!t&&e&&(e.statusCode===0?e.error||Al.warn("Failed to fetch remote config from PostHog."):Al.error("Failed to fetch remote config from PostHog."));try{this._instance.Xu(t?{ok:!0,config:t}:{ok:!1})}catch(r){Al.error("Error applying remote config",r)}if((t==null?void 0:t.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){Al.error("Error loading feature flags",r)}}},eo=Uint8Array,Gs=Uint16Array,kf=Uint32Array,sk=new eo([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]),ik=new eo([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]),qP=new eo([16,17,18,0,8,7,9,6,10,5,11,4,12,3,13,2,14,1,15]),B5=function(t,e){for(var n=new Gs(31),r=0;31>r;++r)n[r]=e+=1<<t[r-1];var s=new kf(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]},Z5=B5(sk,2),Eb=Z5[1];Z5[0][28]=258,Eb[258]=28;for(var GP=B5(ik,0)[1],W5=new Gs(32768),Nn=0;32768>Nn;++Nn){var bd=(43690&Nn)>>>1|(21845&Nn)<<1;W5[Nn]=((65280&(bd=(61680&(bd=(52428&bd)>>>2|(13107&bd)<<2))>>>4|(3855&bd)<<4))>>>8|(255&bd)<<8)>>>1}var bp=function(t,e,n){for(var r=t.length,s=0,i=new Gs(e);r>s;++s)++i[t[s]-1];var o,l=new Gs(e);for(s=0;e>s;++s)l[s]=l[s-1]+i[s-1]<<1;for(o=new Gs(r),s=0;r>s;++s)o[s]=W5[l[t[s]-1]++]>>>15-t[s];return o},Nu=new eo(288);for(Nn=0;144>Nn;++Nn)Nu[Nn]=8;for(Nn=144;256>Nn;++Nn)Nu[Nn]=9;for(Nn=256;280>Nn;++Nn)Nu[Nn]=7;for(Nn=280;288>Nn;++Nn)Nu[Nn]=8;var Tv=new eo(32);for(Nn=0;32>Nn;++Nn)Tv[Nn]=5;var QB=bp(Nu,9),JB=bp(Tv,5),q5=function(t){return(t/8|0)+(7&t&&1)},G5=function(t,e,n){(n==null||n>t.length)&&(n=t.length);var r=new(t instanceof Gs?Gs:t instanceof kf?kf:eo)(n-e);return r.set(t.subarray(e,n)),r},Ca=function(t,e,n){var r=e/8|0;t[r]|=n<<=7&e,t[r+1]|=n>>>8},zh=function(t,e,n){var r=e/8|0;t[r]|=n<<=7&e,t[r+1]|=n>>>8,t[r+2]|=n>>>16},v2=function(t,e){for(var n=[],r=0;t.length>r;++r)t[r]&&n.push({s:r,f:t[r]});var s=n.length,i=n.slice();if(!s)return[new eo(0),0];if(s==1){var o=new eo(n[0].s+1);return o[n[0].s]=1,[o,1]}n.sort(function(T,O){return T.f-O.f}),n.push({s:-1,f:25001});var l=n[0],c=n[1],d=0,f=1,h=2;for(n[0]={s:-1,f:l.f+c.f,l,r:c};f!=s-1;)l=n[n[h].f>n[d].f?d++:h++],c=n[d!=f&&n[h].f>n[d].f?d++:h++],n[f++]={s:-1,f:l.f+c.f,l,r:c};var m=i[0].s;for(r=1;s>r;++r)i[r].s>m&&(m=i[r].s);var v=new Gs(m+1),_=Cb(n[f-1],v,0);if(_>e){r=0;var y=0,w=_-e,x=1<<w;for(i.sort(function(T,O){return v[O.s]-v[T.s]||T.f-O.f});s>r;++r){var k=i[r].s;if(e>=v[k])break;y+=x-(1<<_-v[k]),v[k]=e}for(y>>>=w;y>0;){var P=i[r].s;e>v[P]?y-=1<<e-v[P]++-1:++r}for(;r>=0&&y;--r){var C=i[r].s;v[C]==e&&(--v[C],++y)}_=e}return[new eo(v),_]},Cb=function(t,e,n){return t.s==-1?Math.max(Cb(t.l,e,n+1),Cb(t.r,e,n+1)):e[t.s]=n},KP=function(t){for(var e=t.length;e&&!t[--e];);for(var n=new Gs(++e),r=0,s=t[0],i=1,o=function(c){n[r++]=c},l=1;e>=l;++l)if(t[l]==s&&l!=e)++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=t[l]}return[n.subarray(0,r),e]},Vh=function(t,e){for(var n=0,r=0;e.length>r;++r)n+=t[r]*e[r];return n},Pb=function(t,e,n){var r=n.length,s=q5(e+2);t[s]=255&r,t[s+1]=r>>>8,t[s+2]=255^t[s],t[s+3]=255^t[s+1];for(var i=0;r>i;++i)t[s+i+4]=n[i];return 8*(s+4+r)},YP=function(t,e,n,r,s,i,o,l,c,d,f){Ca(e,f++,n),++s[256];for(var h=v2(s,15),m=h[0],v=h[1],_=v2(i,15),y=_[0],w=_[1],x=KP(m),k=x[0],P=x[1],C=KP(y),T=C[0],O=C[1],I=new Gs(19),R=0;k.length>R;++R)I[31&k[R]]++;for(R=0;T.length>R;++R)I[31&T[R]]++;for(var N=v2(I,7),L=N[0],z=N[1],$=19;$>4&&!L[qP[$-1]];--$);var G,X,q,H,ee=d+5<<3,V=Vh(s,Nu)+Vh(i,Tv)+o,Q=Vh(s,m)+Vh(i,y)+o+14+3*$+Vh(I,L)+(2*I[16]+3*I[17]+7*I[18]);if(V>=ee&&Q>=ee)return Pb(e,f,t.subarray(c,c+d));if(Ca(e,f,1+(V>Q)),f+=2,V>Q){G=bp(m,v),X=m,q=bp(y,w),H=y;var U=bp(L,z);for(Ca(e,f,P-257),Ca(e,f+5,O-1),Ca(e,f+10,$-4),f+=14,R=0;$>R;++R)Ca(e,f+3*R,L[qP[R]]);f+=3*$;for(var D=[k,T],K=0;2>K;++K){var de=D[K];for(R=0;de.length>R;++R)Ca(e,f,U[ie=31&de[R]]),f+=L[ie],ie>15&&(Ca(e,f,de[R]>>>5&127),f+=de[R]>>>12)}}else G=QB,X=Nu,q=JB,H=Tv;for(R=0;l>R;++R)if(r[R]>255){var ie;zh(e,f,G[257+(ie=r[R]>>>18&31)]),f+=X[ie+257],ie>7&&(Ca(e,f,r[R]>>>23&31),f+=sk[ie]);var ce=31&r[R];zh(e,f,q[ce]),f+=H[ce],ce>3&&(zh(e,f,r[R]>>>5&8191),f+=ik[ce])}else zh(e,f,G[r[R]]),f+=X[r[R]];return zh(e,f,G[256]),f+X[256]},eZ=new kf([65540,131080,131088,131104,262176,1048704,1048832,2114560,2117632]),tZ=(function(){for(var t=new kf(256),e=0;256>e;++e){for(var n=e,r=9;--r;)n=(1&n&&3988292384)^n>>>1;t[e]=n}return t})(),y2=function(t,e,n){for(;n;++e)t[e]=n,n>>>=8};function nZ(t,e){e===void 0&&(e={});var n=(function(){var h=4294967295;return{p(m){for(var v=h,_=0;m.length>_;++_)v=tZ[255&v^m[_]]^v>>>8;h=v},d(){return 4294967295^h}}})(),r=t.length;n.p(t);var s,i,o,l,c,d=(l=10+((s=e).filename&&s.filename.length+1||0),c=8,(function(h,m,v,_,y,w){var x=h.length,k=new eo(_+x+5*(1+Math.floor(x/7e3))+y),P=k.subarray(_,k.length-y),C=0;if(!m||8>x)for(var T=0;x>=T;T+=65535){var O=T+65535;x>O?C=Pb(P,C,h.subarray(T,O)):(P[T]=w,C=Pb(P,C,h.subarray(T,x)))}else{for(var I=eZ[m-1],R=I>>>13,N=8191&I,L=(1<<v)-1,z=new Gs(32768),$=new Gs(L+1),G=Math.ceil(v/3),X=2*G,q=function(St){return(h[St]^h[St+1]<<G^h[St+2]<<X)&L},H=new kf(25e3),ee=new Gs(288),V=new Gs(32),Q=0,U=0,D=(T=0,0),K=0,de=0;x>T;++T){var ie=q(T),ce=32767&T,he=$[ie];if(z[ce]=he,$[ie]=ce,T>=K){var xe=x-T;if((Q>7e3||D>24576)&&xe>423){C=YP(h,P,0,H,ee,V,U,D,de,T-de,C),D=Q=U=0,de=T;for(var oe=0;286>oe;++oe)ee[oe]=0;for(oe=0;30>oe;++oe)V[oe]=0}var re=2,Se=0,ze=N,ke=ce-he&32767;if(xe>2&&ie==q(T-ke))for(var gt=Math.min(R,xe)-1,on=Math.min(32767,T),Tt=Math.min(258,xe);on>=ke&&--ze&&ce!=he;){if(h[T+re]==h[T+re-ke]){for(var $t=0;Tt>$t&&h[T+$t]==h[T+$t-ke];++$t);if($t>re){if(re=$t,Se=ke,$t>gt)break;var xt=Math.min(ke,$t-2),An=0;for(oe=0;xt>oe;++oe){var Be=T-ke+oe+32768&32767,je=Be-z[Be]+32768&32767;je>An&&(An=je,he=Be)}}}ke+=(ce=he)-(he=z[ce])+32768&32767}if(Se){H[D++]=268435456|Eb[re]<<18|GP[Se];var Ie=31&Eb[re],nt=31&GP[Se];U+=sk[Ie]+ik[nt],++ee[257+Ie],++V[nt],K=T+re,++Q}else H[D++]=h[T],++ee[h[T]]}}C=YP(h,P,w,H,ee,V,U,D,de,T-de,C)}return G5(k,0,_+q5(C)+y)})(i=t,(o=e).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,l,c,!0)),f=d.length;return(function(h,m){var v=m.filename;if(h[0]=31,h[1]=139,h[2]=8,h[8]=2>m.level?4:m.level==9?2:0,h[9]=3,m.mtime!=0&&y2(h,4,Math.floor(new Date(m.mtime||Date.now())/1e3)),v){h[3]=8;for(var _=0;v.length>=_;++_)h[_+10]=v.charCodeAt(_)}})(d,e),y2(d,f-8,n.d()),y2(d,f-4,r),d}const rZ=!!jS||!!jp,K5=new WeakMap,Y5="text/plain";let _2=0,jg=!1;const X5=(t,e)=>{const[n,r]=t.split("#"),[s,i]=n.split("?");if(!i)return t;const o=i.split("&").filter(l=>l.split("=")[0]!==e).join("&");return`${s}${o?`?${o}`:""}${r?`#${r}`:""}`},T1=(t,e,n=!0)=>{var r;const[s,i]=t.split("?"),o=j({},e),l=(r=i==null?void 0:i.split("&").map(d=>{var f;const[h,m]=d.split("="),v=n&&(f=o[h])!==null&&f!==void 0?f:m;return delete o[h],`${h}=${v}`}))!==null&&r!==void 0?r:[],c=(function(d,f="&"){let h,m;const v=[];return Wt(d,function(_,y){ue(_)||ue(y)||y==="undefined"||(h=encodeURIComponent((w=>w instanceof File)(_)?_.name:_.toString()),m=encodeURIComponent(y),v[v.length]=m+"="+h)}),v.join(f)})(o);return c&&l.push(c),l.length>0?`${s}?${l.join("&")}`:s},w2=t=>{if(t.cr)return t.cr;const{data:e,compression:n}=t;if(!e)return;if(n===vi.GZipJS){const s=nZ((function(i){var o=i.length;if(typeof TextEncoder<"u")return new TextEncoder().encode(i);for(var l=new eo(i.length+(i.length>>>1)),c=0,d=function(v){l[c++]=v},f=0;o>f;++f){if(c+5>l.length){var h=new eo(c+8+(o-f<<1));h.set(l),l=h}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 G5(l,0,c)})(Vd(e)),{mtime:0});return{contentType:Y5,body:s.buffer.slice(s.byteOffset,s.byteOffset+s.byteLength),estimatedSize:s.byteLength}}if(n===vi.Base64){const s=(function(o){return o&&btoa(encodeURIComponent(o).replace(/%([0-9A-F]{2})/g,(l,c)=>String.fromCharCode(parseInt(c,16))))})(Vd(e)),i=(o=>"data="+encodeURIComponent(typeof o=="string"?o:Vd(o)))(s);return{contentType:"application/x-www-form-urlencoded",body:i,estimatedSize:new Blob([i]).size}}const r=Vd(e);return{contentType:"application/json",body:r,estimatedSize:new Blob([r]).size}},Q5=t=>{const e=()=>t.transport==="sendBeacon"?{url:T1(t.url,{compression:vi.Base64}),encodedBody:w2(j(j({},t),{},{compression:vi.Base64,cr:void 0}))}:{url:X5(t.url,"compression"),encodedBody:w2(j(j({},t),{},{compression:void 0,cr:void 0}))};let n;try{n=w2(t)}catch(s){if(fP(t.compression,xf(t.url,"compression")))return ye.error("Failed to gzip request body, sending uncompressed payload",s),e();throw s}return n&&fP(t.compression,xf(t.url,"compression"))&&!((r=n.body)instanceof ArrayBuffer?ab(new Uint8Array(r)):ArrayBuffer.isView(r)&&ab(new Uint8Array(r.buffer,r.byteOffset,r.byteLength)))?(jg=!0,e()):{url:t.url,encodedBody:n};var r},J5=t=>{try{return Q5(t)}catch(n){var e;return ye.error(n),void((e=t.callback)===null||e===void 0||e.call(t,{statusCode:0,error:n}))}},sZ=(function(){var t=hn(function*(e){const n=yield(function(s){return lb.apply(this,arguments)})(Vd(e.data),Zs.DEBUG,{rethrow:!0});if(!n)return e;const r=yield n.arrayBuffer();return j(j({},e),{},{cr:{contentType:Y5,body:r,estimatedSize:r.byteLength}})});return function(e){return t.apply(this,arguments)}})(),iZ=/Failed to fetch|NetworkError|Load failed/i,eM=t=>(t==null?void 0:t.name)==="TypeError"&&iZ.test((t==null?void 0:t.message)||""),tM=t=>{try{const e=(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 l=/^\w{3} \w{3} /.test(o)?o+" GMT":o,c=Date.parse(l)-r;return Number.isFinite(c)&&c>0?Math.min(c,s):void 0})(t());return ue(e)?void 0:Math.min(e,3e4)}catch{return}},nM=t=>{const e=J5(t);if(!e)return;const n=new jS;K5.set(n,!0);const{url:r,encodedBody:s}=e;n.open(t.method||"GET",r,!0);const{contentType:i,body:o}=s??{};Wt(t.headers,function(l,c){n.setRequestHeader(c,l)}),i&&n.setRequestHeader("Content-Type",i),t.timeout&&(n.timeout=t.timeout),n.onreadystatechange=()=>{if(n.readyState===4){var l;const c={statusCode:n.status,text:n.responseText};if(n.status===200)try{c.json=JSON.parse(n.responseText)}catch{}(l=t.callback)===null||l===void 0||l.call(t,c,tM(()=>n.getResponseHeader("Retry-After")))}},n.send(o)},rM=t=>{const e=J5(t);if(!e)return;const{url:n,encodedBody:r}=e,{contentType:s,body:i,estimatedSize:o}=r??{},l=new Headers;Wt(t.headers,function(_,y){l.append(y,_)}),s&&l.append("Content-Type",s);let c=null,d=!1;if(K8){const _=new K8;c={signal:_.signal,timeout:setTimeout(()=>{d=!0;try{_.abort(AO("AbortError","PostHog request timed out"+((y=t.timeout)?` after ${y}ms`:"")))}catch(w){h(w)}var y},t.timeout)}}let f=!1;const h=_=>{var y;f||(f=!0,d&&(_==null?void 0:_.name)==="AbortError"||eM(_)?ye.warn(_):ye.error(_),(y=t.callback)===null||y===void 0||y.call(t,{statusCode:0,error:_}))};let m=0;const v=()=>{_2-=m,m=0,c&&clearTimeout(c.timeout)};try{const _=j({method:(t==null?void 0:t.method)||"GET",headers:l,referrerPolicy:"strict-origin",body:i,signal:c==null?void 0:c.signal},t.fetchOptions),y=o??(ue(i)?0:void 0);_.keepalive=_.method==="POST"&&!t.Tl&&_.keepalive!==!1&&_.body===i&&!ue(y)&&y>=0&&52428.8>_2+y,_.keepalive&&(m=y,_2+=m),jp(n,_).then(w=>w.text().then(x=>{var k;if(f)return;const P={statusCode:w.status,text:x};if(w.status===200)try{P.json=JSON.parse(x)}catch(C){ye.error(C)}f=!0,v(),(k=t.callback)===null||k===void 0||k.call(t,P,tM(()=>w.headers.get("Retry-After")))})).catch(w=>{v(),h(w)}).finally(v)}catch(_){v(),h(_)}},Ab=t=>{try{var e;const{url:n,encodedBody:r}=Q5(t),{contentType:s,body:i,estimatedSize:o}=r??{};if(!i)return;const l=i instanceof Blob?i:new Blob([i],{type:s});if(Jr.sendBeacon(n,l))return;const c=We(t.data)?t.data:(e=t.data)===null||e===void 0?void 0:e.batch;if(We(c)&&c.length>1&&(o??0)>16384){const d=Math.ceil(c.length/2),f=h=>We(t.data)?h:j(j({},t.data),{},{batch:h});return Ab(j(j({},t),{},{data:f(c.slice(0,d))})),void Ab(j(j({},t),{},{data:f(c.slice(d))}))}ye.warn(`Beacon of ~${o??0} bytes was rejected by the browser, falling back to ${jp?"fetch":"XHR"}`),jp?rM(j(j({},t),{},{Tl:!0})):nM(t)}catch(n){ye.warn("Beacon send failed",n)}},XP=(t,e,n,r)=>{const s=r==="query"?e==="POST"?"sent_at":"_":void 0;return T1(n===vi.GZipJS?X5(t,"compression"):t,j(j({},s?{[s]:Date.now().toString()}:{}),n===vi.GZipJS?{}:{compression:n}))},oZ=(()=>{const t=[];return jp&&t.push({transport:"fetch",method:rM}),jS&&t.push({transport:"XHR",method:nM}),Jr!=null&&Jr.sendBeacon&&t.push({transport:"sendBeacon",method:Ab}),t})();let sM=!rZ&&(Os==null?void 0:Os.indexOf("MSIE"))===-1&&(Os==null?void 0:Os.indexOf("Mozilla"))===-1;function iM(t,e,n){var r,s,i;n&&(e=j(j({},e),{},{callback:o=>n(o)})),t.__loaded?sM?t.__request_queue.push(e):t.rateLimiter.isServerRateLimited(e.batchKey)?e.fireCallbackOnDrop&&((s=e.callback)===null||s===void 0||s.call(e,{statusCode:429})):(e.transport=e.transport||t.config.api_transport,e.headers=j(j({},t.config.request_headers),e.headers),e.compression=e.compression==="best-available"?(r=t.compression)!==null&&r!==void 0?r:e.compressionFallback:e.compression,(ue(t.config.disable_beacon)?t.config.__preview_disable_beacon:t.config.disable_beacon)&&(e.disableTransport=["sendBeacon"]),e.fetchOptions=e.fetchOptions||t.config.fetch_options,((o,l)=>{var c,d,f;const h=j(j({},o),{},{callback:l??(w=>{var x;return(x=o.callback)===null||x===void 0?void 0:x.call(o,w)})});h.timeout=h.timeout||6e4;const m=(c=h.transport)!==null&&c!==void 0?c:"fetch";m==="sendBeacon"&&ue(h.compression)&&h.data&&(h.compression=vi.Base64),h.method==="POST"&&h.data&&(h.timestampMode==="capture-body"?h.data=(w=>{var x,k;const P=(We(w)?w:[w]).map(T=>j(j({},T),T.timestamp instanceof Date&&!isNaN(T.timestamp.getTime())?{timestamp:T.timestamp.toISOString()}:{})),C=P[0];return{api_key:(x=C==null||(k=C.properties)===null||k===void 0?void 0:k.token)!==null&&x!==void 0?x:C==null?void 0:C.token,batch:P,sent_at:new Date().toISOString()}})(h.data):h.timestampMode==="body"&&(h.data=((w,x=new Date().toISOString())=>We(w)?w.map(k=>j(j({},k),{},{sent_at:x})):j(j({},w),{},{sent_at:x}))(h.data))),h.url=XP(h.url,h.method,h.compression,h.timestampMode);const v=oZ.filter(w=>!h.disableTransport||!w.transport||!h.disableTransport.includes(w.transport)),_=(d=(f=(function(w,x){for(let k=0;w.length>k;k++)if(x(w[k]))return w[k]})(v,w=>w.transport===m))===null||f===void 0?void 0:f.method)!==null&&d!==void 0?d:v[0].method;if(!_)throw new Error("No available transport method");const y=w=>{try{_(w)}catch(k){var x;eM(k)?ye.warn(k):ye.error(k),(x=h.callback)===null||x===void 0||x.call(h,{statusCode:0,error:k})}};m!=="sendBeacon"&&!h.preferSyncCompression&&h.data&&h.compression===vi.GZipJS&&wH&&typeof Promise<"u"&&!jg?sZ(h).then(w=>{y(w)}).catch(w=>{if(hP(w))return jg=!0,void y(j(j({},h),{},{compression:void 0,url:XP(o.url,o.method,void 0,o.timestampMode)}));(x=>{if(!x||typeof x!="object")return!1;const k="name"in x?String(x.name):"";return hP(x)||k===LO})(w)&&(jg=!0),y(h)}):y(h)})(e,(o,l)=>{var c,d,f;t.rateLimiter.checkForLimiting(o),400>o.statusCode||(c=(d=t.config).on_request_error)===null||c===void 0||c.call(d,o),n?n(o,l):(f=e.callback)===null||f===void 0||f.call(e,o)})):e.fireCallbackOnDrop&&((i=e.callback)===null||i===void 0||i.call(e,{statusCode:0}))}var aZ=class{constructor(t,e){this.ec=!0,this.nc=[],this.sc=Qo((e==null?void 0:e.flush_interval_ms)||3e3,250,5e3,ye.createLogger("flush interval"),3e3),this.rc=t}enqueue(t){this.nc.push(t),this.oc||this.ac()}unload(){this.lc();const t=this.nc.length>0?this.uc():{},e=Object.values(t);[...e.filter(n=>n.url.indexOf("/e")===0),...e.filter(n=>n.url.indexOf("/e")!==0)].map(n=>{this.cc(j(j({},n),{},{callback:void 0}),"sendBeacon")})}enable(){this.ec=!1,this.ac()}ac(){this.ec||(this.oc=setTimeout(()=>{this.lc(),this.hc()},this.sc))}hc(){if(this.nc.length>0){const t=this.uc();for(const e in t)this.cc(t[e])}}cc(t,e){try{this.rc(t,e)}catch(n){ye.error(n)}}lc(){clearTimeout(this.oc),this.oc=void 0}uc(){const t={},e={};Wt(this.nc,n=>{var r;const s=n,i=((s?s.batchKey:null)||s.url)+(s.batchGroup?`:${s.batchGroup}`:"");ue(t[i])&&(t[i]=j(j({},s),{},{data:[],callback:void 0,fireCallbackOnDrop:void 0}),e[i]=[]),(r=t[i].data)===null||r===void 0||r.push(s.data),s.callback&&e[i].push(s.callback)});for(const n in e){const r=e[n];r.length&&(t[n].callback=s=>{for(const i of r)i(s)})}return this.nc=[],t}};const lZ=["retriesPerformedSoFar"];var cZ=class{constructor(t){this._instance=t,this.dc=!1,this.vc=3e3,this.nc=[],this.nc=[],this.fc=!0,this.resume()}resume(){if(!ue(le)&&"onLine"in le.navigator){if(this.fc=le.navigator.onLine,this.gc)return;this.gc=()=>{this.fc=!0,this.hc()},this.mc=()=>{this.fc=!1},Dt(le,"online",this.gc),Dt(le,"offline",this.mc)}}get length(){return this.nc.length}retriableRequest(t,e){let{retriesPerformedSoFar:n}=t,r=DO(t,lZ);Oa(n)&&(r.url=T1(r.url,{retry_count:n})),iM(this._instance,e?j(j({},r),{},{transport:e}):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.Ls(j({retriesPerformedSoFar:n},r),i);s.statusCode===0&&ye.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)})}Ls(t,e){const n=t.retriesPerformedSoFar||0;t.retriesPerformedSoFar=n+1;const r=Math.max((function(o){const l=3e3*Math.pow(2,o),c=l/2,d=Math.min(18e5,l),f=(Math.random()-.5)*(d-c);return Math.ceil(d+f)})(n),e??0),s=Date.now()+r;this.nc.push({retryAt:s,requestOptions:t});let i=`Enqueued failed request for retry in ${r}`;navigator.onLine||(i+=" (Browser is offline)"),ye.warn(i),this.dc||(this.dc=!0,this.yc())}yc(){if(this.bc&&clearTimeout(this.bc),this.nc.length===0)return this.dc=!1,void(this.bc=void 0);this.bc=setTimeout(()=>{this.fc&&this.nc.length>0&&this.hc(),this.yc()},this.vc)}hc(){const t=Date.now(),e=[],n=this.nc.filter(r=>t>r.retryAt||(e.push(r),!1));if(this.nc=e,n.length>0)for(const{requestOptions:r}of n)this.retriableRequest(r)}unload(){this.bc&&(clearTimeout(this.bc),this.bc=void 0),this.dc=!1,ue(le)||(this.gc&&(le.removeEventListener("online",this.gc),this.gc=void 0),this.mc&&(le.removeEventListener("offline",this.mc),this.mc=void 0));for(const{requestOptions:t}of this.nc)try{this._instance._send_request(j(j({},t),{},{callback:We(t.data)?void 0:t.callback,transport:"sendBeacon"}))}catch(e){ye.error(e)}this.nc=[]}},uZ=class{constructor(t){this._instance=t,this._c=()=>{var e,n,r,s;this.wc||(this.wc={});const i=this.scrollElement(),o=this.scrollY(),l=i?Math.max(0,i.scrollHeight-i.clientHeight):0,c=o+((i==null?void 0:i.clientHeight)||0),d=(i==null?void 0:i.scrollHeight)||0;this.wc.lastScrollY=Math.ceil(o),this.wc.maxScrollY=Math.max(o,(e=this.wc.maxScrollY)!==null&&e!==void 0?e:0),this.wc.maxScrollHeight=Math.max(l,(n=this.wc.maxScrollHeight)!==null&&n!==void 0?n:0),this.wc.lastContentY=c,this.wc.maxContentY=Math.max(c,(r=this.wc.maxContentY)!==null&&r!==void 0?r:0),this.wc.maxContentHeight=Math.max(d,(s=this.wc.maxContentHeight)!==null&&s!==void 0?s:0)}}get kc(){return this._instance.config.scroll_root_selector}getContext(){return this.wc}resetContext(){const t=this.wc;return this.wc=void 0,setTimeout(this._c,0),t}startMeasuringScrollPosition(){Dt(le,"scroll",this._c,{capture:!0}),Dt(le,"scrollend",this._c,{capture:!0}),Dt(le,"resize",this._c)}scrollElement(){if(this.kc){const n=We(this.kc)?this.kc:[this.kc];for(const r of n){var t;const s=le==null||(t=le.document)===null||t===void 0?void 0:t.querySelector(r);if(s)return s}return}var e;return le==null||(e=le.document)===null||e===void 0?void 0:e.documentElement}Sc(t){var e,n;const r=t==="y"?"scrollTop":"scrollLeft";if(this.kc){const s=this.scrollElement();return s&&s[r]||0}return le?t==="y"?le.scrollY||le.pageYOffset||((e=le.document)===null||e===void 0||(e=e.documentElement)===null||e===void 0?void 0:e.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.Sc("y")}scrollX(){return this.Sc("x")}};const dZ=t=>z5(t==null?void 0:t.config.mask_personal_data_properties,t==null?void 0:t.config.custom_personal_data_properties,t==null?void 0:t.config.disable_capture_url_hashes);var QP=class{constructor(t,e,n,r){this.je=s=>{const i=this.xc();if(i&&i.sessionId===s)return;const o={sessionId:s,props:this.$c(this._instance)};this.Cc.register({[_b]:o})},this._instance=t,this.Tc=e,this.Cc=n,this.$c=r||dZ,this.Tc.onSessionId(this.je)}xc(){return this.Cc.props[_b]}getSetOnceProps(){var t;const e=(t=this.xc())===null||t===void 0?void 0:t.props;return e?"r"in e?V5(e,this._instance.config.disable_capture_url_hashes):{$referring_domain:e.referringDomain,$pathname:e.initialPathName,utm_source:e.utm_source,utm_campaign:e.utm_campaign,utm_medium:e.utm_medium,utm_content:e.utm_content,utm_term:e.utm_term}:{}}getSessionProps(){const t={};return Wt(JS(this.getSetOnceProps()),(e,n)=>{n==="$current_url"&&(n="url"),t[`$session_entry_${tb(n)}`]=e}),t}},Rv=class{on(t,e){return this.So[t]||(this.So[t]=[]),this.So[t].push(e),()=>{this.So[t]=this.So[t].filter(n=>n!==e)}}emit(t,e){for(const n of this.So[t]||[])n(e);for(const n of this.So["*"]||[])n(t,e)}constructor(){this.So={}}};const xd=Pn("[SessionId]"),JP=864e5;var e3=class{on(t,e){return this.Ic.on(t,e)}constructor(t,e,n){var r;if(this.Mc=null,this.Ec=null,this.Ac=[],this.Rc=void 0,this.Pc=!1,this.Ic=new Rv,this.Oc=(i,o)=>!(!Oa(i)||!Oa(o))&&Math.abs(i-o)>this.sessionTimeoutMs,!t.persistence)throw new Error("SessionIdManager requires a PostHogPersistence instance");if(t.config.cookieless_mode==="always")throw new Error('SessionIdManager cannot be used with cookieless_mode="always"');this.Pr=t.config,this.Cc=t.persistence,this.Be=void 0,this.Xt=void 0,this._sessionStartTimestamp=null,this.Fc=void 0,this._sessionActivityTimestamp=null,this.Dc=e||xo,this.Lc=n||xo;const s=this.Pr.persistence_name||this.Pr.token;if(this._sessionTimeoutMs=1e3*Qo(this.Pr.session_idle_timeout_seconds||1800,60,36e3,xd.createLogger("session_idle_timeout_seconds"),1800),t.register({$configured_session_timeout_ms:this._sessionTimeoutMs}),this.Nc(),this.jc="ph_"+s+"_window_id",this.qc="ph_"+s+"_primary_window_exists",this.Bc()){const i=fn.Ft(this.jc),o=fn.Ft(this.qc);i&&!o?this.Be=i:fn.Dt(this.jc),fn.$t(this.qc,!0)}!((r=this.Pr.bootstrap)===null||r===void 0)&&r.sessionID&&this.setBootstrapSessionId(this.Pr.bootstrap.sessionID),this.zc()}get sessionTimeoutMs(){return this._sessionTimeoutMs}onSessionId(t){return ue(this.Ac)&&(this.Ac=[]),this.Ac.push(t),this.Xt&&t(this.Xt,this.Be),()=>{this.Ac=this.Ac.filter(e=>e!==t)}}Bc(){return this.Pr.persistence!=="memory"&&!this.Cc.fi&&fn.Ot()}Hc(t){t!==this.Be&&(this.Be=t,this.Bc()&&fn.$t(this.jc,t))}Uc(){return this.Be?this.Be:this.Bc()?fn.Ft(this.jc):null}Wc(t){const e=this.Mc;return!Mn(e)&&!Mn(t)&&5e3>Math.abs(t-e)}Vc(t,e,n){const r=e!==this._sessionActivityTimestamp,s=!(t!==this.Xt||n!==this._sessionStartTimestamp);this._sessionStartTimestamp=n,this._sessionActivityTimestamp=e,this.Xt=t,s&&!r||s&&this.Wc(e)||(this.Mc=e,this.Cc.register({[jd]:[e,t,n]}))}Gc(){var t;const e=(t=this.Pr)===null||t===void 0?void 0:t.persistence_save_debounce_ms;return Oa(e)&&e>0}Qc(){this.Gc()?this.Cc.refreshKey(jd):(this.Cc.flush(),this.Cc.load())}Jc(){var t;if(Mn(this._sessionActivityTimestamp)||this._sessionActivityTimestamp===this.Mc)return;this.Qc();const[,e,n]=this.Zc();e===this.Xt&&n===this._sessionStartTimestamp&&(this.Mc=this._sessionActivityTimestamp,this.Cc.register({[jd]:[this._sessionActivityTimestamp,(t=this.Xt)!==null&&t!==void 0?t:null,this._sessionStartTimestamp]}),this.Cc.flush())}Kc(){const[t]=this.Zc(),e=Oa(t)?t:0,n=Oa(this._sessionActivityTimestamp)?this._sessionActivityTimestamp:0;return Math.max(e,n)}Yc(t){return this.Qc(),this.Oc(t,this.Kc())}Zc(){const t=this.Cc.props[jd];return We(t)&&t.length===2&&t.push(t[0]),t||[0,null,0]}resetSessionId(){this.Mc=null,this.Fc=void 0,clearTimeout(this.Xc),this.Xc=void 0,this.Vc(null,null,null)}setBootstrapSessionId(t,e=!1){const n=((r,s=new Date().getTime())=>{try{const i=(o=>{const l=o.replace(/-/g,"");if(l.length!==32)throw new Error("Not a valid UUID");if(l[12]!=="7")throw new Error("Not a UUIDv7");return parseInt(l.substring(0,12),16)})(r);return i>s+6e4?void xd.error("Bootstrap sessionID cannot be in the future"):i}catch(i){return void xd.error("Invalid sessionID in bootstrap",i)}})(t);return!ue(n)&&(e?this.Fc={sessionId:t,sessionStartTimestamp:n}:this.Vc(t,new Date().getTime(),n),!0)}destroy(){this.Pc=!0,this.Jc(),clearTimeout(this.Xc),this.Xc=void 0,this.Rc&&le&&(le.removeEventListener(Ev,this.Rc,{capture:!1}),this.Rc=void 0),this.Ac=[]}zc(){this.Rc=()=>{this.Jc(),this.Bc()&&fn.Dt(this.qc)},Dt(le,Ev,this.Rc,{capture:!1})}checkAndGetSessionAndWindowId(t=!1,e=null,n=!1){if(this.Pr.cookieless_mode==="always")throw new Error('checkAndGetSessionAndWindowId should not be called with cookieless_mode="always"');const r=e||new Date().getTime(),s=this.Xt;if(n)this.Ec=r;else if(Mn(this.Ec)||this.Ec>r||r-this.Ec>=1e3){var i,o;(i=(o=this.Cc).syncCookieProperties)===null||i===void 0||i.call(o),this.Ec=r}let[,l,c]=this.Zc();const d=!ue(s)&&l!==s,f=this.Kc();let h=this.Uc();const m=this.Fc,v=!!m&&(m.sessionStartTimestamp>r+6e4||r-m.sessionStartTimestamp>JP),_=m?v:Oa(c)&&Math.abs(r-c)>JP;let y=!1,w=d,x=!l||!!m;const k=l;let P=!x&&!t&&this.Oc(r,f);if(P&&(P=this.Yc(r),P||xd.info("cross-tab refresh kept the session alive",{sessionId:l}),[,l,c]=this.Zc(),P||(x=!l||!!m)),x||P||_){w=!1;const I=m&&!v;l=I?m.sessionId:this.Dc(),h=this.Lc(),xd.info("new session ID assigned",{sessionId:l,windowId:h,bootstrapped:!!I,changeReason:{noSessionId:x,activityTimeout:P,sessionPastMaximumLength:_}}),c=I?m.sessionStartTimestamp:r,this.Fc=void 0,y=!0}else h||(h=this.Lc(),y=!0),w=w||l!==k,w&&(xd.info("adopted cross-tab session id",{sessionId:l,windowId:h}),y=!0);const C=Oa(f)&&t&&!_?f:r,T=Oa(c)?c:new Date().getTime();this.Hc(h),this.Vc(l,C,T),t||this.Nc();const O={noSessionId:x,activityTimeout:P,sessionPastMaximumLength:_,crossTabAdoption:w};return y&&this.Ac.forEach(I=>I(l,h,O)),{sessionId:l,windowId:h,sessionStartTimestamp:T,changeReason:y?O:void 0,lastActivityTimestamp:f}}Nc(){this.Pc||(clearTimeout(this.Xc),this.Xc=setTimeout(()=>{if(!this.Pc)if(this.Yc(new Date().getTime())){const t=this.Xt;this.resetSessionId(),this.Ic.emit("forcedIdleReset",{idleSessionId:t})}else this.Nc()},1.1*this.sessionTimeoutMs))}};const t3=Object.freeze(["2026-08-30","2026-08-29","2026-06-25","2026-05-30","2026-01-30","2025-11-30","2025-05-24"]),oM=function(t,e){if(!t)return!1;const n=t.userAgent;if(n&&X8(n,e))return!0;try{const r=t==null?void 0:t.userAgentData;if(r!=null&&r.brands&&r.brands.some(s=>X8(s==null?void 0:s.brand,e)))return!0}catch{}return!!t.webdriver};function aM(){return(aM=hn(function*(){const t=Jr==null?void 0:Jr.userAgentData;if(t!=null&&t.getHighEntropyValues)try{const e=yield t.getHighEntropyValues(["model"]),n=e==null?void 0:e.model;return ht(n)&&n.length>0?n:void 0}catch(e){return void ye.info("Unable to resolve $device_model from userAgentData.getHighEntropyValues",e)}})).apply(this,arguments)}function fZ(t,e){let n=`$survey_${e}/${t.id}`;return t.current_iteration&&t.current_iteration>0&&(n=`$survey_${e}/${t.id}/${t.current_iteration}`),n}function lM(t){var e;return!!(!((e=t.conditions)===null||e===void 0||(e=e.events)===null||e===void 0||(e=e.values)===null||e===void 0)&&e.length)}const Iv=(t,e)=>{if(!(n=>{try{new RegExp(n)}catch{return!1}return!0})(e))return!1;try{return new RegExp(e).test(t)}catch{return!1}},Y0=t=>t.toLowerCase(),cM={exact:(t,e)=>e.some(n=>t.some(r=>n===r)),is_not:(t,e)=>e.every(n=>t.every(r=>n!==r)),regex:(t,e)=>e.some(n=>t.some(r=>Iv(n,r))),not_regex:(t,e)=>e.every(n=>t.every(r=>!Iv(n,r))),icontains:(t,e)=>e.map(Y0).some(n=>t.map(Y0).some(r=>n.includes(r))),not_icontains:(t,e)=>e.map(Y0).every(n=>t.map(Y0).every(r=>!n.includes(r))),gt:(t,e)=>e.some(n=>{const r=parseFloat(n);return!isNaN(r)&&t.some(s=>r>parseFloat(s))}),lt:(t,e)=>e.some(n=>{const r=parseFloat(n);return!isNaN(r)&&t.some(s=>r<parseFloat(s))})};function uM(t,e){return!t||Object.entries(t).every(([n,r])=>{const s=e==null?void 0:e[n];if(s==null)return!1;const i=cM[r.operator];return!!i&&i(r.values.map(String),[String(s)])})}function b2(t,e,n){return Vd({distinct_id:t,userPropertiesToSet:e,userPropertiesToSetOnce:n})}const Tb="custom",n3="i.posthog.com",hZ=/^\/static\//,pZ=["/s/","/e/","/i/"];var mZ=class{constructor(t){this.eh={},this.instance=t}get apiHost(){const t=this.instance.config.api_host.trim().replace(/\/$/,"");return t==="https://app.posthog.com"?"https://us.i.posthog.com":t}get flagsApiHost(){const t=this.instance.config.flags_api_host;return t?t.trim().replace(/\/$/,""):this.apiHost}get uiHost(){var t;let e=(t=this.instance.config.ui_host)===null||t===void 0?void 0:t.replace(/\/$/,"");return e||(e=this.apiHost.replace(`.${n3}`,".posthog.com")),e==="https://app.posthog.com"?"https://us.posthog.com":e}get region(){return this.eh[this.apiHost]||(this.eh[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":Tb),this.eh[this.apiHost]}ih(t){if(!hZ.test(t))return;const e=this.instance.config.asset_host;return typeof e=="string"&&e.trim().replace(/\/$/,"")||void 0}nh(t){const e=Ya(t);return e?e.protocol+"//"+e.host+e.pathname:void 0}sh(t,e,n){if(t==="ui")return n;let r=n;const s=this.instance.config.rewriteRequestPath;if(s){var i;const o=((i=Ya(n))===null||i===void 0?void 0:i.href)||n;r=s(new URL(o)).toString()}if(s&&t==="api"&&pZ.some(o=>e.indexOf(o)===0)){const o=this.nh(r);if(o){const l=this.apiHost;let c=this.rh;(c==null?void 0:c.apiHost)===l&&c.rewriteRequestPath===s||(c={apiHost:l,rewriteRequestPath:s,urls:new Set},this.rh=c),c.urls.add(o)}}return r}isIngestionEndpoint(t){const e=this.rh,n=this.nh(t);return(e==null?void 0:e.apiHost)===this.apiHost&&e.rewriteRequestPath===this.instance.config.rewriteRequestPath&&!!n&&e.urls.has(n)}endpointFor(t,e=""){if(e&&(e=e[0]==="/"?e:`/${e}`),t==="ui")return this.sh(t,e,this.uiHost+e);if(t==="flags")return this.sh(t,e,this.flagsApiHost+e);if(t==="assets"){const r=this.ih(e);if(r)return this.sh(t,e,`${r}${e}`)}if(this.region===Tb)return this.sh(t,e,this.apiHost+e);const n=n3+e;switch(t){case"assets":return this.sh(t,e,`https://${this.region}-assets.${n}`);case"api":return this.sh(t,e,`https://${this.region}.${n}`)}}};const Zt=Pn("[Surveys]"),dM=t=>{try{const e=(n=>((r,s)=>`seenSurvey_${(function(i){return i.current_iteration&&i.current_iteration>0?`${i.id}_${i.current_iteration}`:i.id})(s)}`)(0,n))(t);if(localStorage.getItem(e))return;localStorage.setItem(e,"true")}catch(e){Zt.error("Failed to persist survey seen state",e)}},gZ=[m2.Popover,m2.Widget,m2.API],vZ={ignoreConditions:!1,ignoreDelay:!1,displayType:kb.Popover},yZ=Pn("[PostHog ExternalIntegrations]"),_Z={intercom:"intercom-integration",crispChat:"crisp-chat-integration"};var wZ=class{constructor(t){this._instance=t}Ol(t,e){var n,r;(n=tt.__PosthogExtensions__)===null||n===void 0||(r=n.loadExternalDependency)===null||r===void 0||r.call(n,this._instance,t,s=>{if(s)return yZ.error("failed to load script",s);e()})}startIfEnabledOrStop(){var t;for(const[s,i]of Object.entries((t=this._instance.config.integrations)!==null&&t!==void 0?t:{})){var e,n,r;i&&!(!((e=tt.__PosthogExtensions__)===null||e===void 0||(e=e.integrations)===null||e===void 0)&&e[s])&&this.Ol(_Z[s],()=>{var o;(o=tt.__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=tt.__PosthogExtensions__)===null||n===void 0||(n=n.integrations)===null||n===void 0)&&n[s])&&((r=tt.__PosthogExtensions__)===null||r===void 0||(r=r.integrations)===null||r===void 0||(r=r[s])===null||r===void 0||r.stop())}}},fM=class{constructor(t){this.disabled=t===!1;const e=dt(t)?t:{};this.thresholdPx=e.threshold_px||30,this.timeoutMs=e.timeout_ms||1e3,this.clickCount=e.click_count||3,this.clicks=[]}isRageClick(t,e,n){if(this.disabled)return!1;const r=this.clicks[this.clicks.length-1];if(r&&Math.abs(t-r.x)+Math.abs(e-r.y)<this.thresholdPx&&this.timeoutMs>n-r.timestamp){if(this.clicks.push({x:t,y:e,timestamp:n}),this.clicks.length===this.clickCount)return!0}else this.clicks=[{x:t,y:e,timestamp:n}];return!1}};const Rb=()=>typeof window>"u"?void 0:window,Hh=()=>typeof document>"u"?void 0:document,x2="$copy_autocapture",bZ=["password","hidden","file","checkbox","button","submit","reset","image"],X0=Pn("[AutoCapture]");function S2(t,e){return e.length>t?e.slice(0,t)+"...":e}function xZ(t){if(t.previousElementSibling)return t.previousElementSibling;let e=t;do e=e.previousSibling;while(e&&!Ji(e));return e}function SZ(t,{e,maskAllElementAttributes:n,maskAllText:r,elementAttributeIgnoreList:s,elementsChainAsString:i,disableCaptureUrlHashes:o}){var l,c;if(!Ji(t))return{props:{}};const d=[t],f=new Set([t]);let h=t;for(;h.parentNode&&!cr(h,"body")&&1e3>d.length;){if(Cv(h.parentNode)){const O=h.parentNode.host;if(f.has(O))break;f.add(O),d.push(O),h=O;continue}if(!Ji(h.parentNode)||f.has(h.parentNode))break;f.add(h.parentNode),d.push(h.parentNode),h=h.parentNode}const m=e.type==="click"&&t.namespaceURI==="http://www.w3.org/2000/svg"?d.findIndex(O=>cr(O,"button")||cr(O,"a")):-1;m>0&&(r=r||d.slice(0,m+1).some(O=>!tc(O)||bf(O)));const v=[],_={};let y,w=!1,x=!1;if(Wt(d,O=>{const I=tc(O);if(cr(O,"a")&&!n&&!(s!=null&&s.includes("href"))){const R=O.getAttribute("href");w=!!(I&&R&&Qd(R))&&(o?oc(R):R)}Ze(xu(O),"ph-no-capture")&&(x=!0),v.push((function(R,N,L,z,$=!1){const G=R.tagName.toLowerCase(),X={tag_name:G};tk.indexOf(G)>-1&&!L&&(X.$el_text=G.toLowerCase()==="a"||G.toLowerCase()==="button"?S2(1024,jP(R)):S2(1024,Vp(R)));const q=xu(R);N||z!=null&&z.includes("class")||0>=q.length||(X.classes=q.filter(function(Q){return Q!==""})),Wt(R.attributes,function(Q){var U;if((!bf(R)||["name","id","class","aria-label"].indexOf(Q.name)!==-1)&&!(z!=null&&z.includes(Q.name))&&!N&&Qd(Q.value)&&(!ht(U=Q.name)||U.substring(0,10)!=="_ngcontent"&&U.substring(0,7)!=="_nghost")){let D=Q.value;Q.name==="class"&&(D=ek(D).join(" ")),X["attr__"+Q.name]=S2(1024,Q.name==="href"&&$?oc(D):D)}});let H=1,ee=1,V=R;for(;V=xZ(V);)H++,V.tagName===R.tagName&&ee++;return X.nth_child=H,X.nth_of_type=ee,X})(O,n,r,s,o)),Wt((function(R){if(!tc(R))return{};const N={};return Wt(R.attributes,function(L){if(L.name&&L.name.indexOf("data-ph-capture-attribute")===0){const z=L.name.replace("data-ph-capture-attribute-",""),$=L.value;z&&$&&Qd($)&&(N[z]=$)}}),N})(O),(R,N)=>{({}).hasOwnProperty.call(_,N)||(_[N]=R)})}),x)return{props:{},explicitNoCapture:x};if(m>0&&(t=d[m],v.splice(0,m)),r||(v[0].$el_text=cr(t,"a")||cr(t,"button")?jP(t):Vp(t)),w){var k,P;v[0].attr__href=w;const O=(k=Ya(w))===null||k===void 0?void 0:k.host,I=(P=Rb())===null||P===void 0||(P=P.location)===null||P===void 0?void 0:P.host;O&&I&&O!==I&&(y=w)}return{props:bn((T=e.type,{$event_type:T,$ce_version:1}),i?{}:{$elements:v},{$elements_chain:(C=v,We(C)?(function(O){return O.map(I=>{var R,N;let L="";if(I.tag_name&&(L+=I.tag_name),I.attr_class){I.attr_class.sort();for(const G of I.attr_class)L+=`.${G.replace(/"/g,"")}`}const z=j(j(j(j({},I.text?{text:I.text}:{}),{},{"nth-child":(R=I.nth_child)!==null&&R!==void 0?R:0,"nth-of-type":(N=I.nth_of_type)!==null&&N!==void 0?N:0},I.href?{href:I.href}:{}),I.attr_id?{attr_id:I.attr_id}:{}),I.attributes),$={};return $g(z).sort(([G],[X])=>(function(q,H){return H>q?-1:q>H?1:0})(G,X)).forEach(([G,X])=>$[FP(G.toString())]=FP(X.toString())),L+=":",L+=$g($).map(([G,X])=>`${G}="${X}"`).join(""),L}).join(";")})((function(O){return O.map(I=>{var R,N;const L={text:(R=I.$el_text)===null||R===void 0?void 0:R.slice(0,400),tag_name:I.tag_name,href:(N=I.attr__href)===null||N===void 0?void 0:N.slice(0,2048),attr_class:jB(I),attr_id:I.attr__id,nth_child:I.nth_child,nth_of_type:I.nth_of_type,attributes:{}};return $g(I).filter(([z])=>z.indexOf("attr__")===0).forEach(([z,$])=>L.attributes[z]=$),L})})(C)):"")},!((l=v[0])===null||l===void 0)&&l.$el_text?{$el_text:(c=v[0])===null||c===void 0?void 0:c.$el_text}:{},y&&e.type==="click"?{$external_click_url:y}:{},_),target:t};var C,T}const hM="autocapture";var kZ=class{rl(){this.al=void 0,clearTimeout(this.ll),this.ll=void 0}ul(t){var e;if(!tc(t))return!0;const n=(e=this.cl().css_selector_ignorelist)!==null&&e!==void 0?e:Z0,r=new Set;let s=t;for(;s;){if(r.size>=1e3||r.has(s))return!0;r.add(s);const i=s,o=xu(i);if(Ze(o,"ph-no-capture")||Ze(o,"ph-sensitive")||bf(i)||n.some(c=>tp(i,c)))return!0;const l=s.parentNode;s=Cv(l)?l.host:l&&Ji(l)?l:null}return!1}hl(t){if(!this.isEnabled||t.type==="pointercancel")return void this.rl();if(t.type==="pointerdown"){var e;this.rl();const r=wp(t);return void(t.isPrimary&&t.button===0&&!t.ctrlKey&&r&&Ji(r)&&(this.al={target:r,excluded:this.ul(r),id:t.pointerId,x:t.clientX,y:t.clientY,released:!1,distinctId:(e=this.Ia)===null||e===void 0?void 0:e.distinctId}))}const n=this.al;n&&(t.pointerId!==n.id||Math.abs(t.clientX-n.x)>5||Math.abs(t.clientY-n.y)>5?this.rl():t.type==="pointerup"&&(n.released=!0,this.ll=setTimeout(()=>this.rl(),0)))}dl(t){var e;const n=this.al;this.rl();const r=wp(t);if(n!=null&&n.released&&n.target.isConnected&&n.distinctId===((e=this.Ia)===null||e===void 0?void 0:e.distinctId)&&t.pointerId===n.id&&(t.detail>0||t.pointerType==="touch"||t.pointerType==="pen")&&t.button===0&&5>=Math.abs(t.clientX-n.x)&&5>=Math.abs(t.clientY-n.y)&&r&&(cr(r,"html")||cr(r,"body"))){var s,i,o;if(n.excluded)return null;const l=(s=this.cl().css_selector_ignorelist)!==null&&s!==void 0?s:Z0;return[r,(i=Hh())===null||i===void 0?void 0:i.documentElement,(o=Hh())===null||o===void 0?void 0:o.body].some(c=>{if(!c)return!1;const d=xu(c);return Ze(d,"ph-no-capture")||Ze(d,"ph-sensitive")||!tc(c)||bf(c)||l.some(f=>tp(c,f))})?null:n.target}}constructor(t){this.Aa=t,this.name=hM,this.vl=!1,this.fl=null,this.pl=!1,this.gl=new Map,this.ml=!1,this.Pr={enabled:!1,rageclick:!1,maskAllElementAttributes:!1,maskAllText:!1,disableCaptureUrlHashes:!1,remoteRequestsDisabled:!1},this.Ti=!1,this.Aa.refresh(this.Pr),this.rageclicks=new fM(this.Pr.rageclick),this.yl=null}setup(t){this.bl(),this.Ia=t;const e=t.onRemoteConfig(this.onRemoteConfig.bind(this));this.Ti?e.dispose():(this.Ha=e,this.startIfEnabled())}dispose(){var t;this.Ti||(this.Ti=!0,this.Ia=void 0,(t=this.Ha)===null||t===void 0||t.dispose(),this.Ha=void 0,this.gl.clear(),this.yl=null,this._l())}cl(){return this.Aa.refresh(this.Pr),this.Pr}bl(){var t,e;return this.cl(),this.Pr.url_allowlist=(t=this.Pr.url_allowlist)===null||t===void 0?void 0:t.map(n=>new RegExp(n)),this.Pr.url_ignorelist=(e=this.Pr.url_ignorelist)===null||e===void 0?void 0:e.map(n=>new RegExp(n)),this.Pr}wl(){const t=Rb(),e=Hh();if(!this.isBrowserSupported())return void X0.info("Disabling Automatic Event Collection because this browser is not supported");if(!t||!e)return;this.kl=t,this.Sl=e;const n=this.xl=r=>{r=r||(t==null?void 0:t.event);try{if(r.type==="blur")return void this.rl();if(r.type.indexOf("pointer")===0)return void this.hl(r);const s=r.type==="click"?this.dl(r):void 0;if(Mn(s))return;this.$l(r,"$autocapture",s)}catch(s){X0.error("Failed to capture event",s)}};if(Dt(t,"blur",n),Dt(e,"submit",n,{capture:!0}),Dt(e,"change",n,{capture:!0}),Dt(e,"click",n,{capture:!0}),Wt(["pointerdown","pointermove","pointerup","pointercancel"],r=>{Dt(e,r,n,{capture:!0})}),this.cl().capture_copied_text){const r=this.Cl=s=>{s=s||(t==null?void 0:t.event);try{this.$l(s,x2)}catch(i){X0.error("Failed to capture clipboard event",i)}};Dt(e,"copy",r,{capture:!0}),Dt(e,"cut",r,{capture:!0}),Dt(e,"paste",r,{capture:!0})}}_l(){const t=this.kl,e=this.Sl;this.rl(),this.xl&&(t==null||t.removeEventListener("blur",this.xl),Wt(["pointerdown","pointermove","pointerup","pointercancel"],n=>{e==null||e.removeEventListener(n,this.xl,!0)}),e==null||e.removeEventListener("submit",this.xl,!0),e==null||e.removeEventListener("change",this.xl,!0),e==null||e.removeEventListener("click",this.xl,!0),this.xl=void 0),this.Cl&&(e==null||e.removeEventListener("copy",this.Cl,!0),e==null||e.removeEventListener("cut",this.Cl,!0),e==null||e.removeEventListener("paste",this.Cl,!0),this.Cl=void 0),this.kl=void 0,this.Sl=void 0,this.vl=!1}startIfEnabled(){this.isEnabled||this.rl(),!this.Ti&&this.Ia&&this.isEnabled&&!this.vl&&(this.wl(),this.vl=!0)}onRemoteConfig(t){if(this.Ti)return;if(this.pl=!0,!t.ok)return void this.startIfEnabled();const e=t.config;e.elementsChainAsString&&(this.ml=e.elementsChainAsString);const n=e.autocapture_opt_out;var r;Ns(n)&&((r=this.Ia)===null||r===void 0||r.kv.set("$autocapture_disabled_server_side",n),this.fl=n),this.startIfEnabled()}setElementSelectors(t,e=this){if(this.Ti)return;t.size?this.gl.set(e,new Set(t)):this.gl.delete(e);const n=new Set;this.gl.forEach(r=>{r.forEach(s=>n.add(s))}),this.yl=n}getElementSelectors(t,e){var n;const r=[];return(n=this.yl)===null||n===void 0||n.forEach(s=>{var i;const o=(i=Hh())===null||i===void 0?void 0:i.querySelectorAll(s);o==null||o.forEach(l=>{t!==l&&e!==l||Ze(r,s)||r.push(s)})}),r}get isEnabled(){var t,e;if(this.Ti)return!1;const n=(t=this.Ia)===null||t===void 0?void 0:t.kv.get(QO),r=this.fl,s=this.cl();if(!s.remoteRequestsDisabled&&!this.pl)return!1;const i=s.remoteRequestsDisabled&&!this.pl;if(Mn(r)&&!Ns(n)&&!i)return!1;const o=(e=this.fl)!==null&&e!==void 0?e:!!n;return!!s.enabled&&!o}$l(t,e="$autocapture",n){if(!this.isEnabled)return void this.rl();let r=n||wp(t);x5(r)&&(r=r.parentNode||null);const s=this.bl();var i;e==="$autocapture"&&t.type==="click"&&t instanceof MouseEvent&&s.rageclick&&(!((i=this.rageclicks)===null||i===void 0)&&i.isRageClick(t.clientX,t.clientY,t.timeStamp||new Date().getTime()))&&C5(r,s.rageclick)&&this.$l(t,"$rageclick",n);const o=e===x2,l=o?j(j({},s),{},{dom_event_allowlist:void 0}):s;if(r&&(function(m,v,_,y,w,x){var k;const P=typeof window>"u"?void 0:window;if(!P||rk(m)||_!=null&&_.url_allowlist&&!RP(_.url_allowlist,x)||_!=null&&_.url_ignorelist&&RP(_.url_ignorelist,x))return!1;if(_!=null&&_.dom_event_allowlist){const I=_.dom_event_allowlist;if(I&&!I.some(R=>v.type===R))return!1}const{parentIsUsefulElement:C,targetElementList:T}=P5(m,y);if(!(function(I,R){const N=R==null?void 0:R.element_allowlist;if(ue(N))return!0;for(const L of I)if(N.some(z=>L.tagName.toLowerCase()===z))return!0;return!1})(T,_)||!Sb(T,_==null?void 0:_.css_selector_allowlist)||Sb(T,(k=_==null?void 0:_.css_selector_ignorelist)!==null&&k!==void 0?k:Z0))return!1;try{const I=P.getComputedStyle(m);if(I&&I.getPropertyValue("cursor")==="pointer"&&v.type==="click")return!0}catch{}const O=m.tagName.toLowerCase();switch(O){case"html":return!1;case"form":return(w||["submit"]).indexOf(v.type)>=0;case"input":case"select":case"textarea":return(w||["change","click"]).indexOf(v.type)>=0;default:return C?(w||["click"]).indexOf(v.type)>=0:(w||["click"]).indexOf(v.type)>=0&&(tk.indexOf(O)>-1||m.getAttribute("contenteditable")==="true")}})(r,t,l,o,o?["copy","cut","paste"]:void 0,{config:{get_current_url:s.getCurrentUrl}})){var c;const{props:m,explicitNoCapture:v,target:_}=SZ(r,{e:t,maskAllElementAttributes:s.maskAllElementAttributes,maskAllText:s.maskAllText,elementAttributeIgnoreList:s.element_attribute_ignorelist,elementsChainAsString:this.ml,disableCaptureUrlHashes:s.disableCaptureUrlHashes});if(v)return!1;const y=this.getElementSelectors(r,_);if(y&&y.length>0&&(m.$element_selectors=y),e===x2){const w=t.type||"clipboard";if(w!=="paste"){var d,f;const x=(d=Rb())===null||d===void 0||(d=d.getSelection())===null||d===void 0?void 0:d.toString(),k=S5(x);if(!k)return!1;m.$selected_content=k,m.$clipboard_text_length=(f=x==null?void 0:x.length)!==null&&f!==void 0?f:0}m.$copy_type=w}if(e==="$autocapture"&&t.type==="change"&&s.capture_value_css_selector_allowlist&&!s.maskAllText&&(cr(h=r,"input")?!Ze(bZ,h.type):cr(h,"textarea")||cr(h,"select")&&!h.multiple)&&(function(w,x){var k;if(!tc(w))return!1;const P=(k=x.css_selector_ignorelist)!==null&&k!==void 0?k:Z0,C=new Set;let T=w;for(cr(w,"select")&&(T=w.options[w.selectedIndex]||w);T;){const O=T,I=xu(O);if(C.size>=1e3||C.has(T)||Ze(I,"ph-sensitive")||Ze(I,"ph-no-capture")||P.some(N=>tp(O,N)))return!1;C.add(T);const R=T.assignedSlot||T.parentNode;T=Cv(R)?R.host:R&&Ji(R)?R:null}return!0})(r,s)&&!r.querySelector(".ph-no-capture, .ph-sensitive")){const w=s.capture_value_css_selector_allowlist;let x=!1;try{x=zn(w)?!!w(r):We(w)&&w.some(k=>tp(r,k))}catch(k){X0.error("capture_value_css_selector_allowlist threw",k)}x&&(m.$input_value=r.value)}return(c=this.Ia)===null||c===void 0||c.capture(e,m),!0}var h}isBrowserSupported(){var t;return zn((t=Hh())===null||t===void 0?void 0:t.querySelectorAll)}};const pM="featureFlags",mM="logs";var EZ=class{constructor(t){this._instance=t}initialize(){}get(t){const e=this._instance.persistence;if(typeof t=="string")return e==null?void 0:e.get_property(t);const n={};for(const r of t){const s=e==null?void 0:e.get_property(r);ue(s)||(n[r]=s)}return n}set(t,e){var n;(n=this._instance.persistence)===null||n===void 0||n.register(typeof t=="string"?{[t]:e}:t)}remove(t){var e;(e=this._instance.persistence)===null||e===void 0||e.unregister(t)}},CZ=class{constructor(t){this.instance=t,this.A=ye,this.kv=new EZ(t),this.onSession=e=>K0(this.instance.onSessionId(n=>{try{e(n)}catch(r){this.A.error("Browser extension session listener failed",r)}})),this.onEvent=e=>K0(this.instance._addCaptureHook((n,r)=>{if(r)try{e({event:n,properties:r.properties})}catch(s){this.A.error("Browser extension event listener failed",s)}})),this.onRemoteConfig=e=>{const n=s=>{try{e(s)}catch(i){this.A.error("Browser extension remote config listener failed",i)}},r=this.instance.dr.on("extensionsRemoteConfig",n);return this.instance.vr&&n(this.instance.vr),K0(r)}}get logger(){return this.A}get distinctId(){return this.instance.get_distinct_id()}get anonymousId(){var t;return(t=this.instance.get_property("$device_id"))!==null&&t!==void 0?t:this.distinctId}get deviceId(){const t=this.instance.get_property(WS);return typeof t=="string"?t:void 0}get library(){return{name:Zs.LIB_NAME,version:Zs.LIB_VERSION}}get initialPersonProperties(){var t,e;return(t=(e=this.instance.persistence)===null||e===void 0?void 0:e.get_initial_props())!==null&&t!==void 0?t:{}}get groups(){return this.instance.getGroups()}get session(){try{var t,e,n,r,s;const i=(t=this.instance.sessionManager)===null||t===void 0?void 0:t.checkAndGetSessionAndWindowId(!0);return{sessionId:(e=i==null?void 0:i.sessionId)!==null&&e!==void 0?e:"",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 zn(this.instance.is_capturing)?this.instance.is_capturing():!this.isOptedOut}get isRateLimited(){var t;return!!(!((t=this.instance.rateLimiter)===null||t===void 0)&&t.isClientRateLimited)}get projectToken(){return this.instance.config.token}getExtension(t){let e;switch(t){case pM:case"featureFlagsCommon":e=this.instance.featureFlags;break;case mM:e=this.instance.logs;break;case"surveys":e=this.instance.surveys;break;case hM:e=this.instance.autocapture}return e}capture(t,e,n){if(!n)return this.pr(this.instance.capture(t,e));const r=j({timestamp:n.timestamp,uuid:n.uuid,$set:n.set,$set_once:n.setOnce},n.delivery==="unload"?{transport:"sendBeacon",send_instantly:!0}:{});return this.pr(this.instance.capture(t,e,r))}pr(t){var e;return!ue(t)||!(!((e=this.instance.rateLimiter)===null||e===void 0)&&e.lastEventRateLimited)}registerDynamicEventProperties(t){return K0(this.instance.mr(t))}sendRequest(t){var e=this;return hn(function*(n,r={}){var s;const i=(s=r.target)!==null&&s!==void 0?s:"api",o=r.query?T1(n,r.query):n,l=e.instance.requestRouter.endpointFor(i,o),c={method:r.method,url:l,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"?eb.Base64:void 0,timestampMode:r.sentAt};return i==="api"&&n==="/i/v1/logs"&&(c.batchKey="logs"),r.transport==="sendBeacon"?(e.instance._send_request(c),{statusCode:202}):new Promise(d=>{c.callback=d,e.instance._send_request(c)})}).apply(this,arguments)}};const xp={};let k2=0;const Sp=()=>{},r3='Consent opt in/out is not valid with cookieless_mode="always" and will be ignored',Sd="Surveys module not available",s3="sanitize_properties is deprecated. Use before_send instead",gM="Invalid value for property_denylist config: ",PZ=["$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"],AZ=["$feature_flag_called","$$heatmap","$snapshot"],i3=t=>t.charAt(0)==="$"&&!Ze(AZ,t),TZ=/^[A-Za-z0-9_-]{1,400}$/,o3=/^fb\.[0-9]+\.[0-9]+\.[A-Za-z0-9_-]+(?:\.[A-Za-z0-9_-]+)?$/,a3=/^fb\.[0-9]+\.[0-9]+\.[0-9]+$/,RZ=["token","distinct_id",a5],np="posthog",IZ=[...t3].sort()[t3.length-1],OZ=t=>{const e={};return t&&t!=="unset"&&("2025-11-30">t||(e.strictMinimumDuration=!0),"2026-05-30">t||(e.canvasCapture={resolutionScale:.6}),"2026-06-25">t||(e.streamNetworkBody=!0),"2026-08-30">t||(e.captureJsonLd=!0)),e},E2=t=>{var e;return j({api_host:"https://us.i.posthog.com",flags_api_host:null,ui_host:null,asset_host:null,token:"",autocapture:!0,cross_subdomain_cookie:SB(Oe==null?void 0:Oe.location),persistence:"localStorage+cookie",persistence_name:"",cookie_persisted_properties:[],loaded:Sp,save_campaign_params:!0,custom_campaign_params:[],custom_blocked_useragents:[],save_referrer:!0,capture_pageleave:"if_capture_pageview",defaults:t??"unset",__preview_deferred_init_extensions:!1,__preview_replay_sync_fetch:!0,__preview_external_dependency_versioned_paths:!1,__preview_cookie_wins_on_conflict:!1,debug:dn&&ht(dn==null?void 0:dn.search)&&dn.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||(e=le.location)===null||e===void 0?void 0:e.protocol)==="https:",ip:!1,opt_out_capturing_by_default:!1,opt_out_persistence_by_default:!1,opt_out_useragent_filter:!1,opt_out_capturing_persistence_type:"localStorage",consent_persistence_name:null,opt_out_capturing_cookie_prefix:null,opt_in_site_apps:!1,property_denylist:[],respect_dnt:!1,sanitize_properties:null,request_headers:{},request_batching:!0,properties_string_max_length:65535,mask_all_element_attributes:!1,mask_all_text:!1,mask_personal_data_properties:!1,custom_personal_data_properties:[],advanced_disable_flags:!1,advanced_disable_decide:!1,advanced_disable_feature_flags:!1,advanced_disable_feature_flags_on_first_load:!1,advanced_only_evaluate_survey_feature_flags:!1,advanced_feature_flags_dedup_per_session:!1,advanced_enable_surveys:!1,advanced_disable_toolbar_metrics:!1,feature_flag_request_timeout_ms:3e3,feature_flag_request_max_retries:1,surveys_request_timeout_ms:1e4,on_request_error(n){ye.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:v5,before_send:void 0,get_current_url:void 0,request_queue_config:{flush_interval_ms:3e3},error_tracking:{},_onCapture:Sp},(n=>({rageclick:n&&n>="2026-05-30"?{content_ignorelist:nk,ignore_text_selection:!0}:!n||"2025-11-30">n||{content_ignorelist:!0},capture_pageview:!n||"2025-05-24">n||"history_change",session_recording:OZ(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)}))(t))},MZ=[["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"]],l3=t=>{const e={};for(const[s,i]of MZ)ue(t[s])||(e[i]=t[s]);const n=bn({},e,t),r=t.__preview_external_dependency_versioned_paths;return ue(r)||(ue(t.strict_script_versioning)&&(n.strict_script_versioning=!!r),ht(r)&&ue(t.asset_host)&&(n.asset_host=r)),We(t.property_blacklist)&&(ue(t.property_denylist)?n.property_denylist=t.property_blacklist:We(t.property_denylist)?n.property_denylist=[...t.property_blacklist,...t.property_denylist]:ye.error(gM+t.property_denylist)),n};var NZ=class{constructor(){this.__forceAllowLocalhost=!1}get oh(){return this.__forceAllowLocalhost}set oh(t){ye.error("WebPerformanceObserver is deprecated and has no impact on network capture. Use `_forceAllowLocalhostNetworkCapture` on `posthog.sessionRecording`"),this.__forceAllowLocalhost=t}},kp=class Il{ah(e){if(!e)return;const n=this.uh.indexOf(e);n!==-1&&this.uh.splice(n,1)}hh(e,n){var r;return this.ah(e),this.uh.push(n),(r=n.initialize)===null||r===void 0||r.call(n),n}dh(){return this.config.cookieless_mode==="always"||this.config.cookieless_mode==="on_reject"&&this.consent.isRejected()}fh(){if(this.ph||this.config.reuseAnonymousId||this.config.segment||this.dh())return;const e=this.config.persistence==="memory"||this.config.persistence==="sessionStorage";if(!e&&!this.config.disable_persistence||this.gh)return;let n,r,s;e?(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.ph=!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}`)}mh(){const e=this.persistence;if(!e||this.yh)return;if(this.dh())return void(this.config.cookieless_mode==="on_reject"&&this.get_distinct_id()!=="$posthog_cookieless"&&(this.bh(),this._h()));if(this.get_distinct_id()!=="$posthog_cookieless")return;this.wh()||e.load(!0);const n=this.get_distinct_id();if(!n||n==="$posthog_cookieless"){const r=this.config.get_device_id(xo());this.register({distinct_id:r,$device_id:r}),e.set_property(ys,Ua)}this.bh()}get decideEndpointWasHit(){var e,n;return(e=(n=this.featureFlags)===null||n===void 0?void 0:n.hasLoadedFlags)!==null&&e!==void 0&&e}get flagsEndpointWasHit(){var e,n;return(e=(n=this.featureFlags)===null||n===void 0?void 0:n.hasLoadedFlags)!==null&&e!==void 0&&e}constructor(){var e;this.kh=!1,this.Sh=!1,this.webPerformance=new NZ,this.xh=!1,this.version=Zs.LIB_VERSION,this.$h=new Set,this.Ch="",this.dr=new Rv,this.uh=[],this.Th=[],this.Ih=!1,this.gh=!1,this.ph=!1,this.yh=!1,this._calculate_event_properties=this.calculateEventProperties.bind(this),this.config=E2(),this.SentryIntegration=VB,this.sentryIntegration=r=>(function(s,i){const o=R5(s,i);return{name:T5,processEvent:l=>o(l)}})(this,r),this.__request_queue=[],this.__loaded=!1,this.analyticsDefaultEndpoint="/e/",this.Mh=!1,this.Eh=null,this.Ah=null,this.Rh=null,this.scrollManager=new uZ(this),this.pageViewManager=new HP(this),this.rateLimiter=new XB(this),this.requestRouter=new mZ(this),this.consent=new RB(this),this.externalIntegrations=new wZ(this);const n=(e=Il.__defaultExtensionClasses)!==null&&e!==void 0?e:{};this.featureFlags=n.featureFlags&&new n.featureFlags(this),this.toolbar=n.toolbar&&new n.toolbar(this),this.surveys=n.surveys&&new n.surveys(this),this.conversations=n.conversations&&new n.conversations(this),this.logs=n.logs&&new n.logs(this),this.metrics=n.metrics&&new n.metrics(this),this.experiments=n.experiments&&new n.experiments(this),this.exceptions=n.exceptions&&new n.exceptions(this),this.people={set:(r,s,i)=>{const o=ht(r)?{[r]:s}:r;this.setPersonProperties(o),i==null||i({})},set_once:(r,s,i)=>{const o=ht(r)?{[r]:s}:r;this.setPersonProperties(void 0,o),i==null||i({})}},this.on("eventCaptured",r=>ye.info(`send "${r==null?void 0:r.event}"`,r))}init(e,n,r){if(r&&r!==np){var s;const i=(s=xp[r])!==null&&s!==void 0?s:new Il;return i._init(e,n,r),xp[r]=i,xp[np][r]=i,i}return this._init(e,n,r)}_init(e,n={},r){var s,i,o;const l=ht(e)?e.trim():"";if(!l)return ye.critical("PostHog was initialized without a token. This likely indicates a misconfiguration. Please check the first argument passed to posthog.init()"),this;var c;if(this.__loaded)return l!==((c=this.config)===null||c===void 0?void 0:c.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('${l}', { ... }, 'project2')`):console.warn("[PostHog.js]","You have already initialized PostHog! Re-initializing is a no-op"),this;this.__loaded=!0,this.config=E2(n.defaults),n.debug=this.Ph(n.debug),this.Oh=n,this.Fh=[],n.person_profiles?this.Ah=n.person_profiles:n.process_person&&(this.Ah=n.process_person);const d=E2(n.defaults),f=l3(n),h=bn({},d,f,{name:r,token:l});dt(d.rageclick)&&dt(f.rageclick)&&(h.rageclick=bn({},d.rageclick,f.rageclick)),dt(d.session_recording)&&dt(f.session_recording)&&(h.session_recording=bn({},d.session_recording,f.session_recording)),this.set_config(h),this.config.on_xhr_error&&ye.error("on_xhr_error is deprecated. Use on_request_error instead"),this.compression=n.disable_compression?void 0:vi.GZipJS;const m=this.wh(),v=!this.dh();if(this.persistence=new p2(this.config,m,!0,v),this.sessionPersistence=this.config.persistence==="sessionStorage"||this.config.persistence==="memory"?this.persistence:new p2(j(j({},this.config),{},{persistence:"sessionStorage"}),m,!1,v),this.Ch="ph_"+(this.config.persistence_name||this.config.token)+"_session_registered_properties",this.config.persistence!=="memory"&&!m&&fn.Ot()){const k=fn.Ft(this.Ch);We(k)&&k.forEach(P=>{ht(P)&&this.$h.add(P)})}else fn.Dt(this.Ch);const _=j({},this.persistence.props),y=j({},this.sessionPersistence.props);this.register({$initialization_time:new Date().toISOString()}),this.Dh=new aZ((k,P)=>this.Lh(k,P),this.config.request_queue_config),this.Nh=new cZ(this),this.__request_queue=[];const w=this.dh();w||(this.sessionManager=new e3(this),this.sessionPropsManager=new QP(this,this.sessionManager,this.persistence),this.sessionManager.onSessionId((k,P,C)=>{(C!=null&&C.activityTimeout||C!=null&&C.sessionPastMaximumLength||C!=null&&C.crossTabAdoption)&&this.jh()})),this.qh(),this.config.__preview_deferred_init_extensions?(ye.info("Deferring extension initialization to improve startup performance"),this.Bh=setTimeout(()=>{this.Bh=void 0,this.zh(w)},0)):(ye.info("Initializing extensions synchronously"),this.zh(w)),Zs.DEBUG=Zs.DEBUG||this.config.debug,Zs.DEBUG&&ye.info("Starting in debug mode",{this:this,config:n,thisC:j({},this.config),p:_,s:y}),this.config.identity_distinct_id&&!(!((s=n.bootstrap)===null||s===void 0)&&s.distinctID)&&(n.bootstrap=j(j({},n.bootstrap),{},{distinctID:this.config.identity_distinct_id,isIdentifiedID:!0}));const x=(i=n.bootstrap)===null||i===void 0?void 0:i.distinctID;if(this.gh=!!x&&!hp(x),(o=n.bootstrap)===null||o===void 0?void 0:o.distinctID){const k=n.bootstrap.distinctID,P=this.get_distinct_id(),C=this.persistence.get_property(ys);if(n.bootstrap.isIdentifiedID&&P!=null&&P!==k&&C==="anonymous")this.identify(k);else if(n.bootstrap.isIdentifiedID&&P!=null&&P!==k&&C==="identified")ye.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(xo()),O=n.bootstrap.isIdentifiedID?T:k;this.persistence.set_property(ys,n.bootstrap.isIdentifiedID?Dg:Ua),this.register({distinct_id:k,$device_id:O})}}if(w)this.register_once({distinct_id:o2,$device_id:null},"");else if(!this.get_distinct_id()){const k=this.config.get_device_id(xo());this.register_once({distinct_id:k,$device_id:k},""),this.persistence.set_property(ys,Ua)}return Dt(le,"onpagehide"in self?"pagehide":"unload",this._handle_unload.bind(this),{passive:!1}),Dt(le,"pageshow",k=>{if(this.kh=!1,!this.Sh){var P;if(k.persisted&&this.persistence){const C=this.persistence.get_property(Wi),T=this.persistence.get_property(ys);this.persistence.load(),this.Hh()||C===this.persistence.get_property("distinct_id")&&T===this.persistence.get_property("$user_state")||this.Uh()}(P=this.Nh)===null||P===void 0||P.resume()}}),n.segment?VP(this,()=>this.Wh()):this.Wh(),zn(this.config._onCapture)&&this.config._onCapture!==Sp&&(ye.warn("onCapture is deprecated. Please use `before_send` instead"),this.on("eventCaptured",k=>this.config._onCapture(k.event,k))),this.config.ip&&ye.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 aM.apply(this,arguments)})().then(k=>{k&&this.register({[i2]:k})}).catch(Sp),this}Vh(e){const n=e;return ht(n.name)&&zn(n.setup)}Gh(e,n){var r=this;this.Vh(e)?n.push(hn(function*(){try{yield e.setup(r.Qh())}catch(i){ye.error(`Failed to set up extension "${e.name}"`,i);try{var s;yield(s=e.dispose)===null||s===void 0?void 0:s.call(e)}catch(o){ye.error(`Failed to dispose extension "${e.name}"`,o)}}})):this.uh.push(e)}qh(){var e,n,r,s=this;const i=(e=(n=this.config.__extensionClasses)===null||n===void 0?void 0:n.featureFlags)!==null&&e!==void 0?e:(r=Il.__defaultExtensionClasses)===null||r===void 0?void 0:r.featureFlags;var o,l,c;if(i)if(this.featureFlags&&this.featureFlags instanceof i||((o=this.Jh)===null||o===void 0||o.call(this),this.Jh=void 0,this.featureFlags=new i(this)),zn(this.featureFlags.onReloading)&&zn(this.featureFlags.setup)){if(!this.Jh){this.Jh=this.featureFlags.onReloading(()=>{this.dr.emit("featureFlagsReloading",!0)});const d=this.featureFlags;hn(function*(){try{yield d.setup(s.Qh())}catch(f){ye.error("Failed to set up feature flags",f);const h=s.Jh;s.Jh=void 0;try{h==null||h()}catch(m){ye.error("Failed to unsubscribe feature flag reloading",m)}try{yield d.dispose()}catch(m){ye.error("Failed to dispose feature flags",m)}}})()}}else(l=(c=this.featureFlags).initialize)===null||l===void 0||l.call(c)}zh(e){const n=performance.now(),r=j(j({},Il.__defaultExtensionClasses),this.config.__extensionClasses),s=[];var i,o,l,c,d,f,h,m;r.exceptions&&this.uh.push(this.exceptions=(i=this.exceptions)!==null&&i!==void 0?i:new r.exceptions(this)),r.historyAutocapture&&this.uh.push(this.historyAutocapture=new r.historyAutocapture(this)),r.tracingHeaders&&this.uh.push(this.tracingHeaders=new r.tracingHeaders(this)),r.siteApps&&this.uh.push(this.siteApps=new r.siteApps(this)),r.sessionRecording&&!e&&this.uh.push(this.sessionRecording=new r.sessionRecording(this)),this.config.disable_scroll_properties||s.push(()=>{this.scrollManager.startMeasuringScrollPosition()}),r.autocapture&&this.Gh(this.autocapture=new r.autocapture(this),s),r.surveys&&this.Gh(this.surveys=(o=this.surveys)!==null&&o!==void 0?o:new r.surveys(this),s),r.logs&&this.Gh(this.logs=(l=this.logs)!==null&&l!==void 0?l:new r.logs(this),s),r.metrics&&this.uh.push(this.metrics=(c=this.metrics)!==null&&c!==void 0?c:new r.metrics(this)),r.conversations&&this.uh.push(this.conversations=(d=this.conversations)!==null&&d!==void 0?d:new r.conversations(this)),r.productTours&&this.uh.push(this.productTours=new r.productTours(this)),r.heatmaps&&this.uh.push(this.heatmaps=new r.heatmaps(this)),r.webVitalsAutocapture&&this.uh.push(this.webVitalsAutocapture=new r.webVitalsAutocapture(this)),r.exceptionObserver&&this.uh.push(this.exceptionObserver=new r.exceptionObserver(this)),r.deadClicksAutocapture&&this.uh.push(this.deadClicksAutocapture=new r.deadClicksAutocapture(this,zB)),r.toolbar&&this.uh.push(this.toolbar=(f=this.toolbar)!==null&&f!==void 0?f:new r.toolbar(this)),r.experiments&&this.uh.push(this.experiments=(h=this.experiments)!==null&&h!==void 0?h:new r.experiments(this)),r.webMCP&&this.uh.push(this.webMCP=(m=this.webMCP)!==null&&m!==void 0?m:new r.webMCP(this)),this.uh.forEach(v=>{v.initialize&&s.push(()=>{var _;(_=v.initialize)===null||_===void 0||_.call(v)})}),s.push(()=>{if(this.Zh){const v=this.Zh;this.Zh=void 0,this.uh.forEach(_=>{var y;return(y=_.onRemoteConfig)===null||y===void 0?void 0:y.call(_,v)})}}),this.Kh(s,n)}Kh(e,n){for(;e.length>0;){if(this.config.__preview_deferred_init_extensions&&performance.now()-n>=30&&e.length>0)return void(this.Bh=setTimeout(()=>{this.Bh=void 0,this.Kh(e,n)},0));const s=e.shift();if(s)try{s()}catch(i){ye.error("Error initializing extension:",i)}}const r=Math.round(performance.now()-n);this.register_for_session({[l5]:this.config.__preview_deferred_init_extensions?"deferred":"synchronous",[c5]:r}),this.config.__preview_deferred_init_extensions&&ye.info(`PostHog extensions initialized (${r}ms)`)}Xu(e){if(!Oe||!Oe.body)return ye.info("document not ready yet, trying again in 500 milliseconds..."),void setTimeout(()=>{this.Xu(e)},500);if(this.config.__preview_deferred_init_extensions&&(this.Zh=e),this.vr=e,this.compression=void 0,e.ok){var n;const r=e.config;r.supportedCompression&&!this.config.disable_compression&&(this.compression=Ze(r.supportedCompression,vi.GZipJS)?vi.GZipJS:Ze(r.supportedCompression,vi.Base64)?vi.Base64:void 0),!((n=r.analytics)===null||n===void 0)&&n.endpoint&&(this.analyticsDefaultEndpoint=r.analytics.endpoint)}this.set_config({person_profiles:this.Ah?this.Ah:v5}),this.dr.emit("extensionsRemoteConfig",e),this.uh.forEach(r=>{var s;return(s=r.onRemoteConfig)===null||s===void 0?void 0:s.call(r,e)})}Wh(){try{this.config.loaded(this)}catch(e){ye.critical("`loaded` function failed",e)}if(this.Yh(),this.config.internal_or_test_user_hostname&&(dn==null?void 0:dn.hostname)){const e=dn.hostname,n=this.config.internal_or_test_user_hostname;(typeof n=="string"?e===n:n.test(e))&&this.setInternalOrTestUser()}this.config.capture_pageview&&setTimeout(()=>{(this.consent.isOptedIn()||this.dh())&&this.Xh()},1),this.ed=new U5(this),this.ed.load()}Yh(){var e;this.is_capturing()&&this.config.request_batching&&((e=this.Dh)===null||e===void 0||e.enable())}_dom_loaded(){this.is_capturing()&&zd(this.__request_queue,e=>this.Lh(e)),this.__request_queue=[],this.Yh()}_handle_unload(){var e,n,r,s,i,o;this.kh=!0,(e=this.surveys)===null||e===void 0||(n=e.handlePageUnload)===null||n===void 0||n.call(e),(r=this.metrics)===null||r===void 0||r.flush("sendBeacon"),this.config.request_batching?(this.nd()&&this.capture(xP),(s=this.logs)===null||s===void 0||s.flushLogs("sendBeacon"),(i=this.Dh)===null||i===void 0||i.unload(),(o=this.Nh)===null||o===void 0||o.unload()):this.nd()&&this.capture(xP,null,{transport:"sendBeacon"})}_send_request(e){iM(this,e)}Lh(e,n){this.Nh?this.Nh.retriableRequest(e,n):this._send_request(n?j(j({},e),{},{transport:n}):e)}_execute_array(e){k2++;try{let n;const r=[],s=[],i=[];zd(e,l=>{if(l)if(n=l[0],We(n))i.push(l);else if(zn(l))try{l.call(this)}catch(c){ye.error("Error executing queued PostHog call",l,c)}else We(l)&&n==="alias"?r.push(l):We(l)&&n.indexOf("capture")!==-1&&zn(this[n])?i.push(l):s.push(l)});const o=function(l,c){zd(l,function(d){try{if(We(d[0])){let f=c;Wt(d,function(h){f=f[h[0]].apply(f,h.slice(1))})}else c[d[0]].apply(c,d.slice(1))}catch(f){ye.error("Error executing queued PostHog call",d,f)}})};o(r,this),o(s,this),o(i,this)}finally{k2--}}push(e){if(k2>0&&We(e)&&ht(e[0])){const n=Il.prototype[e[0]];return void(zn(n)&&n.apply(this,e.slice(1)))}this._execute_array([e])}get sd(){return{property:wP,persistenceKey:Xd,cookieName:"_fbc",pattern:o3,register:(e,n)=>{var r;return(r=this.persistence)===null||r===void 0?void 0:r.register({[Xd]:{value:e,delivered:n}})},unregister:()=>{var e;return(e=this.persistence)===null||e===void 0?void 0:e.unregister(Xd)}}}get rd(){return{property:bP,persistenceKey:gp,cookieName:"_fbp",pattern:a3,register:(e,n)=>{var r;return(r=this.persistence)===null||r===void 0?void 0:r.register({[gp]:{value:e,delivered:n}})},unregister:()=>{var e;return(e=this.persistence)===null||e===void 0?void 0:e.unregister(gp)}}}od(e){var n;const r=(n=this.persistence)===null||n===void 0?void 0:n.get_property(e.persistenceKey);return ht(r)&&e.pattern.test(r)?{value:r,delivered:!1}:dt(r)&&ht(r.value)&&e.pattern.test(r.value)?{value:r.value,delivered:r.delivered===!0}:void 0}ad(e,n,r){return n===(r==null?void 0:r.value)?{value:n,pending:!r.delivered}:(e.register(n,!1),{value:n,pending:!0})}ld(e){if(!this.config.save_campaign_params||this.dh())return;const n=yp(e.cookieName);return ht(n)&&e.pattern.test(n)?n:void 0}ud(e,n,r,s){if(!this.persistence)return;const i=this.sd;this.persistence.refreshMetaIdentifiers();const o=this.od(i);if(s)return void i.unregister();if(r)return ht(n)&&o3.test(n)?this.ad(i,n,o):void i.unregister();const l=ht(e)&&TZ.test(e)?e:void 0,c=this.ld(i);return c&&((d,f,h)=>{const m=d.split(".");if(f)return m[3]===f;if(!h)return!0;const v=h.value.split(".");return m[3]===v[3]||Number(m[2])>Number(v[2])})(c,l,o)?this.ad(i,c,o):l?(o==null?void 0:o.value.split(".")[3])===l?{value:o.value,pending:!o.delivered}:this.ad(i,`fb.1.${Date.now()}.${l}`,o):o?{value:o.value,pending:!o.delivered}:void 0}hd(e,n,r){if(!this.persistence)return;const s=this.rd;this.persistence.refreshMetaIdentifiers();const i=this.od(s);if(r)return void s.unregister();if(n)return ht(e)&&a3.test(e)?this.ad(s,e,i):void s.unregister();const o=this.ld(s);return o?this.ad(s,o,i):i?{value:i.value,pending:!i.delivered}:void 0}dd(e,n){if(!this.persistence)return;this.persistence.refreshMetaIdentifiers();const r=this.od(e);(r==null?void 0:r.value)!==n||r.delivered||e.register(n,!0)}capture(e,n,r){var s,i,o;if(!(this.__loaded&&this.persistence&&this.sessionPersistence&&this.Dh))return void ye.uninitializedWarning("posthog.capture");if(!this.is_capturing())return void ye.info(`Event "${e}" was not captured because capturing is disabled (opted out or consent pending).`);if(ue(e)||!ht(e))return void ye.error("No event name provided to posthog.capture");if(this.mh(),e==="$snapshot"&&this.dh())return;const l=!this.config.opt_out_useragent_filter&&this._is_bot();if(l&&!this.config.__preview_capture_bot_pageviews)return void ye.info(`Event "${e}" was not captured because the user agent looks like a bot. Set \`opt_out_useragent_filter: true\` to capture it.`);const c=r!=null&&r.skip_client_rate_limiting?void 0:this.rateLimiter.clientRateLimitContext();if(c!=null&&c.isRateLimited)return void ye.critical("This capture call is ignored due to client rate limiting.");let d;n!=null&&n.$current_url&&!ht(n==null?void 0:n.$current_url)&&(ye.error("Invalid `$current_url` property provided to `posthog.capture`. Input must be a string. Ignoring provided value."),n==null||delete n.$current_url),e!=="$exception"||r!=null&&r.vd||ye.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,h=(r==null?void 0:r.timestamp)||f,m=tP(r==null?void 0:r.uuid,xo);let v={uuid:m,event:e,properties:this.calculateEventProperties(e,n||{},h,m)};e==="$pageview"&&this.config.__preview_capture_bot_pageviews&&l&&(v.event="$bot_pageview",v.properties.$browser_type="bot"),c&&(v.properties.$lib_rate_limit_remaining_tokens=c.remainingTokens);const _=e==="$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 y=dt(n==null?void 0:n.$set)?n.$set:void 0,w=We(n==null?void 0:n.$unset)?n.$unset:[],x=(r==null?void 0:r.$unset)||[],k=q=>{var H;const ee=!!(r!=null&&r.$set)&&q in r.$set;return{hasProvided:ee||!!y&&q in y,provided:ee?r==null||(H=r.$set)===null||H===void 0?void 0:H[q]:y==null?void 0:y[q],unset:w.indexOf(q)!==-1||x.indexOf(q)!==-1}},P=k(wP),C=k(bP),T=[{channel:this.sd,hasProvided:P.hasProvided,update:this.ud(d==null?void 0:d.fbclid,P.provided,P.hasProvided,P.unset)},{channel:this.rd,hasProvided:C.hasProvided,update:this.hd(C.provided,C.hasProvided,C.unset)}];for(const{channel:q,hasProvided:H,update:ee}of T)ee&&v.properties.$process_person_profile===!0&&ee.pending&&!H&&!_&&(v.$set=j({[q.property]:ee.value},v.$set));const O=r==null?void 0:r.$unset;O&&(v.$unset=O);const I=_?void 0:this.fd(r==null?void 0:r.$set_once,e!==SP,e===y5);if(I&&(v.$set_once=I),r!=null&&r._noTruncate||(R=this.config.properties_string_max_length,v=(function(q,H){const ee=new Set;return(function V(Q,U){if(Q!==Object(Q))return H?H(Q):Q;if(ee.has(Q))return;let D;if(ee.add(Q),We(Q))D=[],zd(Q,K=>{D.push(V(K))});else{const K={};Wt(Gf(Q)?_5(Q):Q,(de,ie)=>{ee.has(de)||(K[ie]=V(de))}),D=K}return D})(q)})(v,q=>ht(q)?q.slice(0,R):q)),v.timestamp=h,ue(r==null?void 0:r.timestamp)||(v.properties.$event_time_override_provided=!0,v.properties.$event_time_override_system_time=f),_&&(v.properties=((q,H=[])=>{const ee={},V=Q=>{q[Q]!==void 0&&(ee[Q]=q[Q])};return mU.forEach(V),H.forEach(V),ee})(v.properties,RZ)),e===gi.DISMISSED||e===gi.SENT){const q=n==null?void 0:n[g2.SURVEY_ID],H=n==null?void 0:n[g2.SURVEY_ITERATION];dM({id:q,current_iteration:H}),v.$set=j(j({},v.$set),{},{[fZ({id:q,current_iteration:H},e===gi.SENT?"responded":"dismissed")]:!0})}else e===gi.SHOWN&&(v.$set=j(j({},v.$set),{},{[g2.SURVEY_LAST_SEEN_DATE]:new Date().toISOString()}));var R;if(e===YB.SHOWN){const q=n==null?void 0:n[ZP.TOUR_TYPE];q&&(v.$set=j(j({},v.$set),{},{[`${ZP.TOUR_LAST_SEEN_DATE}/${q}`]:new Date().toISOString()}))}const N=j(j({},v.properties.$set),v.$set);if(Ws(N)||this.setPersonPropertiesForFlags(N),!at(this.config.before_send)){const q=this.Fs(v);if(!q)return;v=q,v.uuid=tP(v.uuid,xo)}this.sessionRecording&&!this.Ih&&i3(e)&&(this.Ih=!0,setTimeout(()=>this.Ih=!1,3e4));const L=T.filter(({channel:q,update:H})=>{var ee,V,Q;const U=(ee=(V=v.$set)===null||V===void 0?void 0:V[q.property])!==null&&ee!==void 0?ee:dt((Q=v.properties)===null||Q===void 0?void 0:Q.$set)?v.properties.$set[q.property]:void 0;return(H==null?void 0:H.pending)&&U===H.value});this.dr.emit("eventCaptured",v);const z=(s=r==null?void 0:r._url)!==null&&s!==void 0?s:this.requestRouter.endpointFor("api",this.analyticsDefaultEndpoint),$=(r==null?void 0:r._batchKey)==="recordings"||/\/s\/(?:\?|$)/.test(z),G=j(j(j({method:"POST",url:z,data:v,compression:"best-available",preferSyncCompression:r==null?void 0:r.send_instantly,timestampMode:$?"body":"capture-body",batchKey:r==null?void 0:r._batchKey},$&&(!((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}:{}),L.length?{fireCallbackOnDrop:!0,callback:q=>{if(q.statusCode>=200&&300>q.statusCode)for(const{channel:H,update:ee}of L)this.dd(H,ee.value)}}:{});if(!this.config.request_batching||r&&!(r!=null&&r._batchKey)||r!=null&&r.send_instantly){var X;let q;!G.transport&&!G.callback&&Ws((X=this.config.request_headers)!==null&&X!==void 0?X:{})&&this.kh&&(q="sendBeacon"),this.Lh(G,q)}else this.Dh.enqueue(G);return(o=this.featureFlags)===null||o===void 0||o.sendFlagCallsPendingCapture(),v}_addCaptureHook(e){return this.on("eventCaptured",n=>e(n.event,n))}getExtension(e){var n;return(n=this.pd)===null||n===void 0?void 0:n.getExtension(e)}Qh(){var e;return(e=this.pd)!==null&&e!==void 0?e:this.pd=new CZ(this)}mr(e){this.Th.push(e);let n=!0;return()=>{if(!n)return;n=!1;const r=this.Th.indexOf(e);r!==-1&&this.Th.splice(r,1)}}Hh(e=!0){var n;return!!(!((n=this.persistence)===null||n===void 0)&&n.consumeCookieIdentityChange())&&(this.Uh(e),!0)}Uh(e=!0){var n,r,s;this.Rh=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.$h.clear(),this.gd()),(r=this.featureFlags)===null||r===void 0||r.reset(),e&&this.reloadFeatureFlags()}calculateEventProperties(e,n,r,s,i){if(r=r||new Date,!this.persistence||!this.sessionPersistence)return n;this.mh(),this.persistence.syncCookieProperties(),this.Hh();const o=i?void 0:this.persistence.remove_event_timer(e);let l=j({},n);if(l.token=this.config.token,l.$config_defaults=this.config.defaults==="latest"?IZ:this.config.defaults,this.dh()&&(l[a5]=!0),e==="$snapshot"){const k=j(j({},this.persistence.properties()),this.sessionPersistence.properties());return l.distinct_id=k.distinct_id,(!ht(l.distinct_id)&&!Xn(l.distinct_id)||hp(l.distinct_id))&&ye.error("Invalid distinct_id for replay event. This indicates a bug in your implementation"),l}const c=(function(k,P,C,T=!1){var O,I,R,N;if(!Os)return{};const L=k?[...Sf,...P||[]]:[],[z,$]=kO(Os),[G,X]=(function(ie){for(let ce=0;eP.length>ce;ce++){const[he,xe,oe]=eP[ce],re=ie.match(he);if(re){const Se=oe&&ie.match(oe)||re;return[xe,(Se==null?void 0:Se[1])||""]}}return["",""]})(Os),q=(function(){const ie="u">typeof navigator?navigator:void 0;return ie!=null&&ie.brave?{brave:!0}:{}})(),H={};ue(C)||(H.detectGoogleSearchApp=C);const ee={},V=(O=navigator)===null||O===void 0||(O=O.userAgentData)===null||O===void 0?void 0:O.platform,Q=(I=navigator)===null||I===void 0?void 0:I.maxTouchPoints,U=le==null||(R=le.screen)===null||R===void 0?void 0:R.width,D=le==null||(N=le.screen)===null||N===void 0?void 0:N.height,K=le==null?void 0:le.devicePixelRatio;ue(V)||(ee.userAgentDataPlatform=V),ue(Q)||(ee.maxTouchPoints=Q),ue(U)||(ee.screenWidth=U),ue(D)||(ee.screenHeight=D),ue(K)||(ee.devicePixelRatio=K);const de=bn(JS({$os:z,$os_version:$,$browser:SO(Os,navigator.vendor,q,H),$webview_app:G,$webview_app_version:X,$device:EO(Os),$device_type:$H(Os,ee),$timezone:I5(),$timezone_offset:qB()}),{$current_url:Hp(T?oc(dn==null?void 0:dn.href):dn==null?void 0:dn.href,L,Up),$host:dn==null?void 0:dn.host,$pathname:dn==null?void 0:dn.pathname,$raw_user_agent:Os.length>1e3?Os.substring(0,997)+"...":Os,$browser_version:DH(Os,navigator.vendor,q,H),$browser_language:j5(),$browser_language_prefix:WB(),$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:Za.LIB_NAME,$lib_version:Za.LIB_VERSION,$insert_id:Math.random().toString(36).substring(2,10)+Math.random().toString(36).substring(2,10),$time:Date.now()/1e3});return Za.SDK_DIST_CHANNEL&&(de.$sdk_dist_channel=Za.SDK_DIST_CHANNEL),de})(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:k,windowId:P}=this.sessionManager.checkAndGetSessionAndWindowId(i,r.getTime(),!0);l.$session_id=k,l.$window_id=P}this.sessionPropsManager&&bn(l,this.sessionPropsManager.getSessionProps());try{var d;if(this.sessionRecording){const k=this.sessionRecording.sdkDebugProperties,P=!this.Ih&&i3(e);for(const C in k)(P||Ze(PZ,C))&&(l[C]=k[C])}l.$sdk_debug_retry_queue_size=(d=this.Nh)===null||d===void 0?void 0:d.length}catch(k){l.$sdk_debug_error_capturing_properties=String(k)}let f;if(this.requestRouter.region===Tb&&(l.$lib_custom_api_host=this.config.api_host),f=e!=="$pageview"||i?e!=="$pageleave"||i?this.pageViewManager.doEvent():this.pageViewManager.doPageLeave(r):this.pageViewManager.doPageView(r,s),l=bn(l,f),e==="$pageview"&&Oe&&(l.title=Oe.title),!ue(o)){const k=r.getTime()-o;l.$duration=parseFloat((k/1e3).toFixed(3))}Os&&this.config.opt_out_useragent_filter&&(l.$browser_type=this._is_bot()?"bot":"browser");const h=this.persistence.properties(),m=this.sessionPersistence.properties(),v=l.$groups,_=h.$groups;dt(v)&&!Ws(v)&&(l.$groups=j(j({},dt(_)?_:{}),v)),Wt(["$referrer","$referring_domain"],k=>{k in h&&delete m[k]});const y={};if(this.Th.length>0)for(const k of this.Th.slice())try{bn(y,k())}catch(P){ye.error("Failed to produce browser extension event properties",P)}l=bn({},c,h,m,j(j({},y),l)),l.$is_identified=this._isIdentified(),We(this.config.property_denylist)?Wt(this.config.property_denylist,function(k){delete l[k]}):ye.error(gM+this.config.property_denylist+" or property_blacklist config: "+this.config.property_blacklist);const w=this.config.sanitize_properties;w&&(ye.error(s3),l=w(l,e));const x=this.md();return l.$process_person_profile=x,x&&!i&&this.yd("_calculate_event_properties"),l}fd(e,n=!0,r=!1){var s;if(!this.persistence||!this.md()||this.xh&&!r)return e;const i=this.persistence.get_initial_props(),o=(s=this.sessionPropsManager)===null||s===void 0?void 0:s.getSetOnceProps();let l=bn({},i,o||{},e||{});const c=this.config.sanitize_properties;return c&&(ye.error(s3),l=c(l,"$set_once")),n&&(this.xh=!0),Ws(l)?void 0:l}register(e,n){var r;(r=this.persistence)===null||r===void 0||r.register(e,n)}register_once(e,n,r){var s;(s=this.persistence)===null||s===void 0||s.register_once(e,n,r)}register_for_session(e){var n,r;(n=this.persistence)===null||n===void 0||n.syncCookieProperties(),this.Hh(),(r=this.sessionPersistence)===null||r===void 0||r.register(e),Object.keys(e).forEach(s=>this.$h.add(s)),this.gd()}unregister(e){var n;(n=this.persistence)===null||n===void 0||n.unregister(e)}unregister_for_session(e){var n;(n=this.sessionPersistence)===null||n===void 0||n.unregister(e),this.$h.delete(e),this.gd()}bd(e,n){this.register({[e]:n})}jh(){this.$h.forEach(e=>{var n;(n=this.sessionPersistence)===null||n===void 0||n.unregister(e)}),this.$h.clear(),this.gd()}gd(){var e;if(!this.Ch)return;if(this.config.persistence==="memory"||!((e=this.sessionPersistence)===null||e===void 0)&&e.fi||!fn.Ot())return void fn.Dt(this.Ch);const n=[];this.$h.forEach(r=>n.push(r)),n.length>0?fn.$t(this.Ch,n):fn.Dt(this.Ch)}getFeatureFlag(e,n){var r;return(r=this.featureFlags)===null||r===void 0?void 0:r.getFeatureFlag(e,n)}getFeatureFlagPayload(e){var n;return(n=this.featureFlags)===null||n===void 0?void 0:n.getFeatureFlagPayload(e)}getFeatureFlagResult(e,n){var r;return(r=this.featureFlags)===null||r===void 0?void 0:r.getFeatureFlagResult(e,n)}getAllFeatureFlags(){var e,n;return(e=(n=this.featureFlags)===null||n===void 0?void 0:n.getAllFeatureFlags())!==null&&e!==void 0?e:[]}isFeatureEnabled(e,n){var r,s;return(r=(s=this.featureFlags)===null||s===void 0?void 0:s.isFeatureEnabled(e,n))!==null&&r!==void 0?r:n==null?void 0:n.defaultValue}reloadFeatureFlags(){var e;(e=this.featureFlags)===null||e===void 0||e.reloadFeatureFlags()}updateFlags(e,n,r){var s;(s=this.featureFlags)===null||s===void 0||s.updateFlags(e,n,r)}updateEarlyAccessFeatureEnrollment(e,n,r){var s;(s=this.featureFlags)===null||s===void 0||s.updateEarlyAccessFeatureEnrollment(e,n,r)}getEarlyAccessFeatures(e,n=!1,r){var s;return(s=this.featureFlags)===null||s===void 0?void 0:s.getEarlyAccessFeatures(e,n,r)}on(e,n){return this.dr.on(e,n)}onFeatureFlags(e){return this.featureFlags?this.featureFlags.onFeatureFlags(e):(e([],{},{errorsLoading:!0}),()=>{})}onSurveysLoaded(e){return this.surveys?this.surveys.onSurveysLoaded(e):(e([],{isLoaded:!1,error:Sd}),()=>{})}onSessionId(e){var n,r;return(n=(r=this.sessionManager)===null||r===void 0?void 0:r.onSessionId(e))!==null&&n!==void 0?n:()=>{}}getSurveys(e,n=!1){this.surveys?this.surveys.getSurveys(e,n):e([],{isLoaded:!1,error:Sd})}getActiveMatchingSurveys(e,n=!1){this.surveys?this.surveys.getActiveMatchingSurveys(e,n):e([],{isLoaded:!1,error:Sd})}onActiveMatchingSurveysChanged(e){return this.surveys?this.surveys.onActiveMatchingSurveysChanged(e):(e([],{isLoaded:!1,error:Sd}),()=>{})}renderSurvey(e,n){var r;(r=this.surveys)===null||r===void 0||r.renderSurvey(e,n)}displaySurvey(e,n=vZ){var r;(r=this.surveys)===null||r===void 0||r.displaySurvey(e,n)}cancelPendingSurvey(e){var n;(n=this.surveys)===null||n===void 0||n.cancelPendingSurvey(e)}canRenderSurvey(e){var n,r;return(n=(r=this.surveys)===null||r===void 0?void 0:r.canRenderSurvey(e))!==null&&n!==void 0?n:{visible:!1,disabledReason:Sd}}canRenderSurveyAsync(e,n=!1){var r,s;return(r=(s=this.surveys)===null||s===void 0?void 0:s.canRenderSurveyAsync(e,n))!==null&&r!==void 0?r:Promise.resolve({visible:!1,disabledReason:Sd})}_d(e){return!e||hp(e)?(ye.critical("Unique user id has not been set in posthog.identify"),!1):e==="$posthog_cookieless"?(ye.critical(`The string "${e}" was set in posthog.identify which indicates an error. This ID is only used as a sentinel value.`),!1):!["distinct_id","distinctid"].includes(e.toLowerCase())&&!["undefined","null"].includes(e.toLowerCase())||(ye.critical(`The string "${e}" was set in posthog.identify which indicates an error. This ID should be unique to the user and not a hardcoded string.`),!1)}identify(e,n,r){if(!this.__loaded||!this.persistence)return ye.uninitializedWarning("posthog.identify");if(Xn(e)&&(e=e.toString(),ye.warn("The first argument to posthog.identify was a number, but it should be a string. It has been converted to a string.")),!this._d(e)||!this.yd("posthog.identify"))return;this.mh();const s=this.get_distinct_id(),i=this.persistence.syncCookieProperties()&&this.get_distinct_id()!==s,o=this.Hh(!1),l=this.persistence.Tu();let c=!1;try{const f=this.get_distinct_id();this.register({$user_id:e}),this.get_property("$device_id")||this.register_once({$had_persisted_distinct_id:!0,$device_id:f},""),e!==f&&e!==this.get_property("__alias")&&(this.unregister(kv),this.register({distinct_id:e}));const h=(this.persistence.get_property("$user_state")||"anonymous")===Ua,m=e!==f,v=!m&&h;if(m&&h){var d;const _=this.config.reuseAnonymousId?{distinct_id:e}:{distinct_id:e,$anon_distinct_id:f};this.persistence.set_property(ys,Dg),this.setPersonPropertiesForFlags({$set:n||{},$set_once:r||{}},!1),this.config.cookieWinsOnConflict&&this.persistence.Iu(),this.capture("$identify",_,{$set:n||{},$set_once:r||{}})&&(this.Rh=b2(e,n,r)),(d=this.featureFlags)===null||d===void 0||d.setAnonymousDistinctId(this.config.reuseAnonymousId?void 0:f)}else if(v){this.persistence.set_property(ys,Dg);const _=n||{},y=r||{};this.setPersonPropertiesForFlags({$set:_,$set_once:y},!1),this.config.cookieWinsOnConflict&&this.persistence.Iu(),this.capture("$set",{$set:_,$set_once:y})&&(this.Rh=b2(e,n,r))}else(n||r)&&this.setPersonProperties(n,r);m||i||o?(this.reloadFeatureFlags(),this.featureFlags?this.featureFlags.resetFlagCallReported():this.unregister(Go)):v&&(n||r)&&this.reloadFeatureFlags(),c=!0}finally{l&&this.persistence.Au(c)}}setPersonProperties(e,n){if(!e&&!n||!this.yd("posthog.setPersonProperties"))return;const r=b2(this.get_distinct_id(),e,n);this.Rh!==r?(this.setPersonPropertiesForFlags({$set:e||{},$set_once:n||{}},!0),this.capture("$set",{$set:e||{},$set_once:n||{}})&&(this.Rh=r)):ye.info("A duplicate setPersonProperties call was made with the same properties. It has been ignored.")}unsetPersonProperties(e){var n;const r=(We(e)?e:[e]).filter(s=>ht(s)&&s.length>0);r.length!==0&&this.yd("posthog.unsetPersonProperties")&&((n=this.featureFlags)===null||n===void 0||n.unsetPersonPropertiesForFlags(r,!0),this.capture("$set",{$unset:r}),this.Rh=null)}group(e,n,r){var s;if(!e||!n)return void ye.error("posthog.group requires a group type and group key");(s=this.persistence)===null||s===void 0||s.syncCookieProperties(),this.Hh();const i=this.getGroups(),o=i[e]!==n;if(o&&this.resetGroupPropertiesForFlags(e),this.register({$groups:j(j({},i),{},{[e]:n})}),(o||r)&&this.md()){const l={$group_type:e,$group_key:n};r&&(l.$group_set=r),this.capture(SP,l)}r&&this.setGroupPropertiesForFlags({[e]:r}),o&&!r&&this.reloadFeatureFlags()}resetGroups(){this.register({$groups:{}}),this.resetGroupPropertiesForFlags(),this.reloadFeatureFlags()}setPersonPropertiesForFlags(e,n=!0){var r;(r=this.featureFlags)===null||r===void 0||r.setPersonPropertiesForFlags(e,n)}resetPersonPropertiesForFlags(e=!0){var n;(n=this.featureFlags)===null||n===void 0||n.resetPersonPropertiesForFlags(e)}setGroupPropertiesForFlags(e,n=!0){var r;this.yd("posthog.setGroupPropertiesForFlags")&&((r=this.featureFlags)===null||r===void 0||r.setGroupPropertiesForFlags(e,n))}resetGroupPropertiesForFlags(e){var n;(n=this.featureFlags)===null||n===void 0||n.resetGroupPropertiesForFlags(e)}reset(e){const n=Ns(e)?e:e==null?void 0:e.resetDeviceID,r=Ns(e)||e==null?void 0:e.bootstrap;this.wd(n,!1,r)}wd(e,n=!1,r){var s,i,o,l,c,d;if(ye.info("reset"),!this.__loaded)return ye.uninitializedWarning("posthog.reset");const f=r==null?void 0:r.sessionID;this.config.bootstrap=r||((s=this.Oh)===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.tc());const h=this.get_property(WS),m=this.get_property(i2),v=this.get_property(vp);(l=this.sessionRecording)===null||l===void 0||l.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 y=(c=this.persistence)===null||c===void 0||(d=c.Tu)===null||d===void 0?void 0:d.call(c),w=this.yh;this.yh=w||n;let x=!1;try{var k,P,C,T,O,I,R,N,L,z,$,G,X;if((k=this.persistence)===null||k===void 0||k.clear(),(P=this.sessionPersistence)===null||P===void 0||P.clear(),this.$h.clear(),this.gd(),ue(v)||(z=this.persistence)===null||z===void 0||z.register({$session_recording_remote_config:v}),(C=this.surveys)===null||C===void 0||C.reset(),(T=this.featureFlags)===null||T===void 0||T.reset(),(O=this.conversations)===null||O===void 0||O.reset(),(I=this.logs)===null||I===void 0||I.reset(),(R=this.metrics)===null||R===void 0||R.reset(),(N=this.persistence)===null||N===void 0||N.set_property("$user_state","anonymous"),(L=this.sessionManager)===null||L===void 0||L.resetSessionId(),this.Rh=null,this.config.cookieless_mode==="always")this.register_once({distinct_id:o2,$device_id:null},"");else{const V=this.config.get_device_id(xo());this.register_once({distinct_id:V,$device_id:e?V:h},""),e||ue(m)||this.register({[i2]:m})}if(this.register({$last_posthog_reset:new Date().toISOString()},1),r&&(r.distinctID&&!this.dh()&&((X=this.persistence)===null||X===void 0||X.set_property("$user_state",r.isIdentifiedID?"identified":"anonymous"),this.register({distinct_id:r.distinctID})),($=this.featureFlags)===null||$===void 0||$.initialize(),!at(f)&&!(!((G=this.sessionManager)===null||G===void 0)&&G.setBootstrapSessionId(f,!0)))){const V=j({},r);delete V.sessionID,this.config.bootstrap=V}delete this.config.identity_distinct_id,delete this.config.identity_hash,delete this.config.identity_claims,x=!0}finally{var q,H;this.yh=w,y&&((q=this.persistence)===null||q===void 0||(H=q.Au)===null||H===void 0||H.call(q,x))}var ee;this.vr&&((ee=this.conversations)===null||ee===void 0||ee.onRemoteConfig(this.vr)),this.reloadFeatureFlags()}shutdown(e){var n=this;return hn(function*(){if(!n.__loaded)return void ye.uninitializedWarning("posthog.shutdown");n.Sh=!0,clearTimeout(n.Bh),n.Bh=void 0;const r=n.Jh;n.Jh=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.Dh)===null||i===void 0?void 0:i.unload()},()=>{var i;return(i=n.Nh)===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&&zn(i.then)&&i.then(void 0,o=>{ye.error("Error during shutdown",o)})}catch(i){ye.error("Error during shutdown",i)}})()}setIdentity(e,n){var r;delete this.config.identity_claims,this.config.identity_distinct_id=e,this.config.identity_hash=n,this.alias(e),(r=this.conversations)===null||r===void 0||r.kd()}clearIdentity(){var e;delete this.config.identity_distinct_id,delete this.config.identity_hash,delete this.config.identity_claims,(e=this.conversations)===null||e===void 0||e.Sd()}get_distinct_id(){return this.get_property("distinct_id")}getGroups(){return this.get_property("$groups")||{}}get_session_id(){var e,n;return(e=(n=this.sessionManager)===null||n===void 0?void 0:n.checkAndGetSessionAndWindowId(!0).sessionId)!==null&&e!==void 0?e:""}get_session_replay_url(e){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(e!=null&&e.withTimestamp&&r){var i;const o=(i=e.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(e,n){return e===this.get_property("$people_distinct_id")?(ye.critical("Attempting to create alias for existing People user - aborting."),-2):this.yd("posthog.alias")?(ue(n)&&(n=this.get_distinct_id()),e!==n?(this.bd(kv,e),this.capture("$create_alias",{alias:e,distinct_id:n})):(ye.warn("alias matches current distinct_id - skipping api call."),this.identify(e),-1)):void 0}set_config(e){const n=j({},this.config);if(dt(e)){var r,s,i,o,l,c,d,f,h,m,v,_,y,w;bn(this.config,l3(e));const T=this.wh();if(this.persistence){const I=this.config.persistence==="sessionStorage"||this.config.persistence==="memory";var x,k;if(I&&this.sessionPersistence!==this.persistence&&((x=this.sessionPersistence)===null||x===void 0||x.remove(),(k=this.sessionPersistence)===null||k===void 0||k.destroy()),this.persistence.update_config(this.config,n,T),I)this.sessionPersistence=this.persistence;else if(this.sessionPersistence===this.persistence)this.sessionPersistence=new p2(j(j({},this.config),{},{persistence:"sessionStorage"}),T,!1);else{var P;(P=this.sessionPersistence)===null||P===void 0||P.update_config(j(j({},this.config),{},{persistence:"sessionStorage"}),j(j({},n),{},{persistence:"sessionStorage"}),T)}}const O=this.Ph(this.config.debug);var C;Ns(O)&&(this.config.debug=O),Ns(this.config.debug)&&(this.config.debug?(Zs.DEBUG=!0,It.Ot()&&It.$t("ph_debug",!0),ye.info("set_config",{config:e,oldConfig:n,newConfig:j({},this.config)})):(Zs.DEBUG=!1,It.Ot()&&It.Dt("ph_debug"))),(r=this.featureFlags)===null||r===void 0||(s=r.updateConfig)===null||s===void 0||s.call(r,this.config,this.tc()),(i=this.exceptionObserver)===null||i===void 0||i.onConfigChange(),(o=this.exceptions)===null||o===void 0||o.onConfigChange(),(l=this.metrics)===null||l===void 0||l.onConfigChange(),(c=this.webMCP)===null||c===void 0||c.startIfEnabled(),(d=this.sessionRecording)===null||d===void 0||d.startIfEnabledOrStop(),(f=this.tracingHeaders)===null||f===void 0||f.startIfEnabledOrStop(),(h=this.autocapture)===null||h===void 0||h.startIfEnabled(),(m=this.heatmaps)===null||m===void 0||m.startIfEnabled(),("capture_pageview"in e||"disable_capture_url_hashes"in e)&&((C=this.historyAutocapture)===null||C===void 0||C.startIfEnabledOrStop()),(v=this.exceptionObserver)===null||v===void 0||v.startIfEnabledOrStop(),(_=this.deadClicksAutocapture)===null||_===void 0||_.startIfEnabledOrStop(),(y=this.surveys)===null||y===void 0||y.loadIfEnabled(),this.bh(),(w=this.externalIntegrations)===null||w===void 0||w.startIfEnabledOrStop(),!n.segment&&this.config.segment&&this.persistence&&VP(this,Sp,!1)}}_overrideSDKInfo(e,n){Zs.LIB_NAME=e,Zs.LIB_VERSION=n}startSessionRecording(e){const n=e===!0,r={sampling:n||!!(e!=null&&e.sampling),linked_flag:n||!!(e!=null&&e.linked_flag),url_trigger:n||!!(e!=null&&e.url_trigger),event_trigger:n||!!(e!=null&&e.event_trigger)};var s,i,o,l,c;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&&((l=this.sessionRecording)===null||l===void 0||l.overrideTrigger("url")),r.event_trigger&&((c=this.sessionRecording)===null||c===void 0||c.overrideTrigger("event"))),this.set_config({disable_session_recording:!1})}stopSessionRecording(){this.set_config({disable_session_recording:!0})}sessionRecordingStarted(){var e;return!!(!((e=this.sessionRecording)===null||e===void 0)&&e.started)}captureException(e,n){try{if(!this.exceptions)return;const r=this.exceptions.buildProperties(e,{handled:!0,syntheticException:new Error("PostHog syntheticException")});return this.exceptions.sendExceptionEvent(j(j({},r),n))}catch{return}}addExceptionStep(e,n){var r;(r=this.exceptions)===null||r===void 0||r.addExceptionStep(e,n)}captureLog(e){var n;(n=this.logs)===null||n===void 0||n.captureLog(e)}get logger(){var e,n;return(e=(n=this.logs)===null||n===void 0?void 0:n.logger)!==null&&e!==void 0?e:Il.xd}startExceptionAutocapture(e){this.set_config({capture_exceptions:e==null||e})}stopExceptionAutocapture(){this.set_config({capture_exceptions:!1})}loadToolbar(e){var n,r;return(n=(r=this.toolbar)===null||r===void 0?void 0:r.loadToolbar(e))!==null&&n!==void 0&&n}get_property(e){var n;return(n=this.persistence)===null||n===void 0?void 0:n.props[e]}getSessionProperty(e){var n;return(n=this.sessionPersistence)===null||n===void 0?void 0:n.props[e]}toString(){var e;let n=(e=this.config.name)!==null&&e!==void 0?e:np;return n!==np&&(n="posthog."+n),n}_isIdentified(){var e,n;return((e=this.persistence)===null||e===void 0?void 0:e.get_property("$user_state"))==="identified"||((n=this.sessionPersistence)===null||n===void 0?void 0:n.get_property("$user_state"))==="identified"}md(){var e,n;return!(this.config.person_profiles==="never"||this.config.person_profiles==="identified_only"&&!this._isIdentified()&&Ws(this.getGroups())&&!(!((e=this.persistence)===null||e===void 0||(e=e.props)===null||e===void 0)&&e.__alias)&&!(!((n=this.persistence)===null||n===void 0||(n=n.props)===null||n===void 0)&&n.$epp))}nd(){return this.config.capture_pageleave===!0||this.config.capture_pageleave==="if_capture_pageview"&&!!this.config.capture_pageview}createPersonProfile(){this.md()||this.yd("posthog.createPersonProfile")&&this.setPersonProperties({},{})}setInternalOrTestUser(){this.yd("posthog.setInternalOrTestUser")&&this.setPersonProperties({$internal_or_test_user:!0})}yd(e){return this.config.person_profiles==="never"?(ye.error(e+' was called, but process_person is set to "never". This call will be ignored.'),!1):(this.fh(),this.bd(KS,!0),!0)}wh(){if(this.config.cookieless_mode==="always")return!0;const e=this.consent.isOptedOut();return this.config.disable_persistence||e&&!(!this.config.opt_out_persistence_by_default&&this.config.cookieless_mode!=="on_reject")}bh(){var e,n;const r=this.wh();var s,i,o;return this.is_capturing()||(s=this.logs)===null||s===void 0||s.$d(),((e=this.persistence)===null||e===void 0?void 0:e.fi)!==r&&((i=this.persistence)===null||i===void 0||i.set_disabled(r)),((n=this.sessionPersistence)===null||n===void 0?void 0:n.fi)!==r&&((o=this.sessionPersistence)===null||o===void 0||o.set_disabled(r)),this.gd(),r}opt_in_capturing(e){var n,r,s;if(this.config.cookieless_mode==="always")return void ye.warn(r3);if(this.dh()){var i,o,l,c,d,f;(i=this.sessionRecording)===null||i===void 0||i.dispose({discardBufferedEvents:!0}),this.wd(!0,!0),(o=this.sessionManager)===null||o===void 0||o.destroy(),(l=this.pageViewManager)===null||l===void 0||l.destroy(),this.sessionManager=new e3(this),this.pageViewManager=new HP(this),this.persistence&&(this.sessionPropsManager=new QP(this,this.sessionManager,this.persistence));const x=(c=(d=this.config.__extensionClasses)===null||d===void 0?void 0:d.sessionRecording)!==null&&c!==void 0?c:(f=Il.__defaultExtensionClasses)===null||f===void 0?void 0:f.sessionRecording;var h,m;x&&(this.sessionRecording=this.hh(this.sessionRecording,new x(this)),this.vr&&((h=this.sessionRecording)===null||h===void 0||(m=h.onRemoteConfig)===null||m===void 0||m.call(h,this.vr)))}const v=this.consent.consent===1;var _,y,w;v&&this.mh(),this.consent.optInOut(!0),this.bh(),this.Yh(),(n=this.sessionRecording)===null||n===void 0||n.startIfEnabledOrStop(),this.config.cookieless_mode=="on_reject"&&((_=this.surveys)===null||_===void 0||_.loadIfEnabled(),(y=this.conversations)===null||y===void 0||y.loadIfEnabled()),v||!ue(e==null?void 0:e.captureEventName)&&!(e!=null&&e.captureEventName)||this.capture((w=e==null?void 0:e.captureEventName)!==null&&w!==void 0?w:"$opt_in",e==null?void 0:e.captureProperties,{send_instantly:!0}),(r=this.persistence)===null||r===void 0||r.syncCookieProperties(),this.Hh(),(s=this.featureFlags)===null||s===void 0||s.sendFlagCallsPendingCapture(),this.config.capture_pageview&&this.Xh()}opt_out_capturing(){this.config.cookieless_mode!=="always"?(this.consent.optInOut(!1),this.bh(),this.config.cookieless_mode==="on_reject"&&this._h()):ye.warn(r3)}_h(){var e,n;const r=this.sessionRecording;r==null||r.dispose({discardBufferedEvents:!0}),this.get_distinct_id()!=="$posthog_cookieless"&&this.wd(!0,!0),this.register({distinct_id:o2,$device_id:null}),this.ah(r),this.sessionRecording=void 0,(e=this.sessionManager)===null||e===void 0||e.destroy(),(n=this.pageViewManager)===null||n===void 0||n.destroy(),this.sessionManager=void 0,this.sessionPropsManager=void 0,this.config.capture_pageview&&this.Xh(),this.Yh()}has_opted_in_capturing(){return this.consent.isOptedIn()}has_opted_out_capturing(){return this.consent.isOptedOut()}get_explicit_consent_status(){const e=this.consent.consent;return e===1?"granted":e===0?"denied":"pending"}is_capturing(){return!this.yh&&(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.bh()}_is_bot(){return Jr?oM(Jr,this.config.custom_blocked_useragents):void 0}Xh(){Oe&&(Oe.visibilityState==="visible"?this.Mh||(this.Mh=!0,this.capture(QS,{title:Oe.title},{send_instantly:!0}),this.Eh&&(Oe.removeEventListener(Yd,this.Eh),this.Eh=null)):this.Eh||(this.Eh=this.Xh.bind(this),Dt(Oe,Yd,this.Eh)))}debug(e){e===!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}))}tc(){const e=this.Oh||{};return"advanced_disable_flags"in e?!!e.advanced_disable_flags:this.config.advanced_disable_flags!==!1?!!this.config.advanced_disable_flags:this.config.advanced_disable_decide===!0?(ye.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 l=r in n&&!at(n[r]),c=s in n&&!at(n[s]);return l?n[r]:!!c&&(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])})(e,"advanced_disable_flags","advanced_disable_decide",0,ye)}Fs(e){var n;if(at(this.config.before_send))return e;const r=Object.keys((n=e.properties)!==null&&n!==void 0?n:{}).filter(EH),s=We(this.config.before_send)?this.config.before_send:[this.config.before_send];let i=e;for(const o of s)try{if(i=o(i),at(i)){const l=`Event '${e.event}' was rejected in beforeSend function`;return kH(e.event)?ye.warn(`${l}. This can cause unexpected behavior.`):ye.info(l),null}i.properties&&!Ws(i.properties)||ye.warn(`Event '${e.event}' has no properties after beforeSend function, this is likely an error.`)}catch(l){return ye.error(`Error in beforeSend function for event '${e.event}':`,l),null}for(const o of r)if(i.properties&&at(i.properties[o]))return ye.warn(`Event '${e.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 e;return(e=this.pageViewManager.Ll)===null||e===void 0?void 0:e.pageViewId}captureTraceFeedback(e,n){this.capture("$ai_feedback",{$ai_trace_id:String(e),$ai_feedback_text:n})}captureTraceMetric(e,n,r){this.capture("$ai_metric",{$ai_trace_id:String(e),$ai_metric_name:n,$ai_metric_value:String(r)})}Ph(e){const n=Ns(e)&&!e,r=It.Ot()&&It.Lt("ph_debug")==="true";return!n&&(!!r||e)}};kp.__defaultExtensionClasses={},kp.xd=(()=>{const t=()=>{};return{trace:t,debug:t,info:t,warn:t,error:t,fatal:t}})(),(function(t,e){for(let n=0;e.length>n;n++)t.prototype[e[n]]=bB(t.prototype[e[n]])})(kp,["identify"]);const LZ=["[data-ph-capture-value]"];var DZ=class{constructor(t){this._instance=t}refresh(t){var e;const n=this._instance.config,r=dt(n.autocapture)?n.autocapture:void 0;t.enabled=!!n.autocapture,t.rageclick=n.rageclick,t.maskAllElementAttributes=n.mask_all_element_attributes,t.maskAllText=n.mask_all_text,t.disableCaptureUrlHashes=n.disable_capture_url_hashes,t.getCurrentUrl=n.get_current_url,t.remoteRequestsDisabled=this._instance.tc(),t.url_allowlist=r==null?void 0:r.url_allowlist,t.url_ignorelist=r==null?void 0:r.url_ignorelist,t.dom_event_allowlist=r==null?void 0:r.dom_event_allowlist,t.element_allowlist=r==null?void 0:r.element_allowlist,t.css_selector_allowlist=r==null?void 0:r.css_selector_allowlist,t.css_selector_ignorelist=r==null?void 0:r.css_selector_ignorelist,t.element_attribute_ignorelist=r==null?void 0:r.element_attribute_ignorelist,t.capture_copied_text=r==null?void 0:r.capture_copied_text,t.capture_value_css_selector_allowlist=(e=r==null?void 0:r.capture_value_css_selector_allowlist)!==null&&e!==void 0?e:LZ}};const Uh=Pn("[ExceptionAutocapture]"),c3=()=>{},u3=t=>{var e;if(zn(t))return(e=t.__posthog_layer__)!==null&&e!==void 0?e:t.__rrweb_layer__};function Ef(t,e,n){try{if(!(e in t))return c3;const r={next:t[e]},s=n(function(...i){return r.next.apply(this,i)});return zn(s)&&(s.prototype=s.prototype||{},Object.defineProperties(s,{__posthog_wrapped__:{enumerable:!1,value:!0},__posthog_layer__:{enumerable:!1,value:r}})),t[e]=s,()=>{if(t[e]===s)return void(t[e]=r.next);let i=t[e],o=u3(i);for(;o;){if(o.next===s)return void(o.next=r.next);i=o.next,o=u3(i)}}}catch{return c3}}const $Z=Pn("[TracingHeaders]"),Bc=Pn("[Web Vitals]"),d3=9e5,f3=["CLS","FCP","INP","LCP"],jZ=["INP","LCP"],FZ=["interactionTarget","interactionType","inputDelay","processingDuration","presentationDelay","loadState","target","url","timeToFirstByte","resourceLoadDelay","resourceLoadDuration","elementRenderDelay","largestShiftTarget","largestShiftTime","largestShiftValue","firstByteToFCP"],C2="disabled",h3="lazy_loading",Pa=Pn("[SessionRecording]"),zZ=[YS,XS,u5,d5,f5,h5,p5,m5,g5],VZ=Pn("[Heatmaps]");function P2(t){return dt(t)&&"clientX"in t&&"clientY"in t&&Xn(t.clientX)&&Xn(t.clientY)}const Q0=Pn("[Product Tours]"),A2=t=>{var e;return!t.config.disable_product_tours&&!!(!((e=t.persistence)===null||e===void 0)&&e.get_property(GS))},HZ=["$set_once","$set"],$o=Pn("[SiteApps]"),p3="Error while initializing PostHog app with config id ";function kd(t,e,n){if(at(t))return!1;switch(n){case"exact":return t===e;case"contains":{const r=e.replace(/[.*+?^${}()|[\]\\]/g,"\\$&").replace(/_/g,".").replace(/%/g,".*");return new RegExp(r,"i").test(t)}case"regex":try{return new RegExp(e).test(t)}catch{return!1}default:return!1}}var UZ=class{constructor(t){this.$i=t,this.xo=new Set,this.$o=new Set,this.Co=new Rv,this.To=(e,n)=>this.Io(e,n)&&this.Mo(e,n)&&this.Eo(e,n)&&this.Ao(e,n),this.Io=(e,n)=>!(n!=null&&n.event)||(e==null?void 0:e.event)===(n==null?void 0:n.event)}init(){var t,e;ue((t=this.$i)===null||t===void 0?void 0:t.subscribeCapture)||(this.Ro=(e=this.$i)===null||e===void 0?void 0:e.subscribeCapture((n,r)=>{this.on(n,r)}))}dispose(){var t,e,n;(t=this.Ro)===null||t===void 0||t.call(this),this.Ro=void 0,(e=this.$i)===null||e===void 0||(n=e.setElementSelectors)===null||n===void 0||n.call(e,new Set,this),this.Co=new Rv}register(t){var e,n;if(!ue((e=this.$i)===null||e===void 0?void 0:e.subscribeCapture)&&(t.forEach(r=>{var s;this.xo.add(r),(s=r.steps)===null||s===void 0||s.forEach(i=>{this.$o.add((i==null?void 0:i.event)||"")})}),(n=this.$i)===null||n===void 0?void 0:n.setElementSelectors)){const r=new Set;this.xo.forEach(s=>{var i;(i=s.steps)===null||i===void 0||i.forEach(o=>{o!=null&&o.selector&&r.add(o.selector)})}),this.$i.setElementSelectors(r,this)}}replace(t){this.xo.clear(),this.$o.clear(),this.register(t)}on(t,e){e!=null&&t.length!=0&&(this.$o.has(t)||this.$o.has(e.event))&&this.xo.forEach(n=>{this.Po(e,n)&&this.Co.emit("actionCaptured",n.name)})}Oo(t){this.onAction("actionCaptured",e=>t(e))}Po(t,e){if((e==null?void 0:e.steps)==null)return!1;for(const n of e.steps)if(this.To(t,n))return!0;return!1}onAction(t,e){return this.Co.on(t,e)}Mo(t,e){if(e!=null&&e.url){var n;let i=t==null||(n=t.properties)===null||n===void 0?void 0:n.$current_url;if(!(t!=null&&t.properties)||!("$current_url"in t.properties))try{var r,s;i=(r=this.$i)===null||r===void 0||(s=r.getActionUrl)===null||s===void 0?void 0:s.call(r)}catch{return!1}if(!i||typeof i!="string"||!kd(i,e.url,e.url_matching||"contains"))return!1}return!0}Eo(t,e){return!!this.Fo(t,e)&&!!this.Do(t,e)&&!!this.Lo(t,e)}Fo(t,e){var n;if(!(e!=null&&e.href))return!0;const r=this.No(t);if(r.length>0)return r.some(i=>kd(i.href,e.href,e.href_matching||"exact"));const s=(t==null||(n=t.properties)===null||n===void 0?void 0:n.$elements_chain)||"";return!!s&&kd((function(i){const o=i.match(/(?::|")href="(.*?)"/);return o?o[1]:""})(s),e.href,e.href_matching||"exact")}Do(t,e){var n;if(!(e!=null&&e.text))return!0;const r=this.No(t);if(r.length>0)return r.some(c=>kd(c.text,e.text,e.text_matching||"exact")||kd(c.$el_text,e.text,e.text_matching||"exact"));const s=(t==null||(n=t.properties)===null||n===void 0?void 0:n.$elements_chain)||"";return!!s&&(i=(function(c){const d=[],f=/(?::|")text="(.*?)"/g;let h;for(;!at(h=f.exec(c));)d.includes(h[1])||d.push(h[1]);return d})(s),o=e.text,l=e.text_matching||"exact",i.some(c=>kd(c,o,l)));var i,o,l}Lo(t,e){var n,r;if(!(e!=null&&e.selector))return!0;const s=t==null||(n=t.properties)===null||n===void 0?void 0:n.$element_selectors;if(s!=null&&s.includes(e.selector))return!0;const i=(t==null||(r=t.properties)===null||r===void 0?void 0:r.$elements_chain)||"";if(e.selector_regex&&i)try{return new RegExp(e.selector_regex).test(i)}catch{}return!1}No(t){var e;return(t==null||(e=t.properties)===null||e===void 0?void 0:e.$elements)==null?[]:t==null?void 0:t.properties.$elements}Ao(t,e){return!(e!=null&&e.properties)||e.properties.length===0||uM(e.properties.reduce((n,r)=>{const s=We(r.value)?r.value.map(String):r.value!=null?[String(r.value)]:[];return n[r.key]={values:s,operator:r.operator||"exact"},n},{}),t==null?void 0:t.properties)}},BZ=class{constructor(t,e){this.jo=e,this.qo=[],this.$i=t,this.Bo=new Map,this.zo=new Map,this.Ho=new Map}Uo(){var t,e;this.Wo=(t=(e=this.$i).subscribeSession)===null||t===void 0?void 0:t.call(e,n=>this.Vo(n))}Go(t){return!1}Qo(){return null}Jo(t){}Zo(){}Ko(t,e){return!!t&&uM(t.propertyFilters,e==null?void 0:e.properties)}Yo(t,e){const n=new Map;return t.forEach(r=>{var s;(s=r.conditions)===null||s===void 0||(s=s[e])===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}Xo(t,e,n){const r=(n===Fh.Activation?this.Bo:this.zo).get(t);let s=[];return this.ta(i=>{s=i.filter(o=>r==null?void 0:r.includes(o.id))}),s.filter(i=>{var o;const l=(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(c=>c.name===t);return this.Ko(l,e)})}register(t){this.ea(t,!1)}replace(t){this.ea(t,!0)}ea(t,e){ue(this.$i.subscribeCapture)||(this.ia(t,e),this.na(t,e))}na(t,e){const n=t.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(e&&this.Ho.clear(),n.length===0)return void(e&&((r=this.sa)===null||r===void 0||r.replace([])));this.sa||(this.sa=new UZ(this.$i),this.sa.init(),this.sa.Oo(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(l=>{if(s.push(l),l.name){var c;const d=(c=this.Ho.get(l.name))!==null&&c!==void 0?c:[];d.includes(i.id)||d.push(i.id),this.Ho.set(l.name,d)}})}),e?this.sa.replace(s):this.sa.register(s)}ra(t,e){e.forEach((n,r)=>{var s;const i=(s=t.get(r))!==null&&s!==void 0?s:[];n.forEach(o=>{i.includes(o)||i.push(o)}),t.set(r,i)})}ia(t,e){var n,r,s;const i=t.filter(d=>{var f,h;return((f=d.conditions)===null||f===void 0?void 0:f.events)&&((h=d.conditions)===null||h===void 0||(h=h.events)===null||h===void 0||(h=h.values)===null||h===void 0?void 0:h.length)>0}),o=t.filter(d=>{var f,h;return((f=d.conditions)===null||f===void 0?void 0:f.cancelEvents)&&((h=d.conditions)===null||h===void 0||(h=h.cancelEvents)===null||h===void 0||(h=h.values)===null||h===void 0?void 0:h.length)>0}),l=this.Yo(t,Fh.Activation),c=this.Yo(t,Fh.Cancellation);e?(this.Bo=l,this.zo=c):(this.ra(this.Bo,l),this.ra(this.zo,c)),(i.length!==0||o.length!==0||t.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.Ro)!==null&&n!==void 0||(this.Ro=(r=(s=this.$i).subscribeCapture)===null||r===void 0?void 0:r.call(s,(d,f)=>{this.onEvent(d,f)})))}onEvent(t,e){var n,r;const s=this.oa(),i=(e==null||(n=e.properties)===null||n===void 0?void 0:n.$survey_id)||(e==null||(r=e.properties)===null||r===void 0?void 0:r.$product_tour_id);if(i&&this.getActivatedIds().includes(i)){const l=this.aa(t,i,e);if(l==="consume")return s.info("event consumed activated item, removing it",{event:t,itemId:i}),void this.la([i]);if(l==="persist")return s.info("shown item promoted to persisted activation",{event:t,itemId:i}),this.ua(i),void this.ca([i])}if(this.zo.has(t)){const l=this.Xo(t,e,Fh.Cancellation);l.length>0&&(s.info("cancel event matched, cancelling items",{event:t,itemsToCancel:l.map(c=>c.id)}),this.la(l.map(c=>c.id)),l.forEach(c=>this.ha(c.id)))}if(!this.Bo.has(t))return;s.info("event name matched",{event:t,eventPayload:e,items:this.Bo.get(t)});const o=this.Xo(t,e,Fh.Activation);this.da(o.map(l=>l.id))}onAction(t){this.Ho.has(t)&&this.da(this.Ho.get(t)||[])}da(t){if(t.length===0)return;const e=!!this.$i.getSessionId(),n=[];for(const r of t)e&&this.Go(r)?this.ua(r)&&this.va(r):n.push(r);n.length>0&&(this.qo=[...new Set([...this.qo,...n])]),this.oa().info("updating activated items",{activatedItems:this.getActivatedIds()}),this.fa()}ua(t){this.qo=this.qo.filter(n=>n!==t);const e=this.pa();return!e.includes(t)&&(this.ga([...e,t]),this.ma(),!0)}la(t){const e=new Set(t);this.qo=this.qo.filter(s=>!e.has(s));const n=this.ya(),r=n.filter(s=>!e.has(s));r.length!==n.length&&(this.ga(r),r.length===0&&this.ba()),this.ca(t),this.fa()}fa(){try{var t;(t=this.jo)===null||t===void 0||t.call(this)}catch(e){this.oa().error("Error while handling activated items change",e)}}_a(){const t=this.Qo();if(!t)return{};const e=this.$i.getProperty(t);return e&&typeof e=="object"?e:{}}va(t){if(!this.Qo())return;const e=this._a();this.Jo(j(j({},e),{},{[t]:Date.now()}))}ca(t){if(!this.Qo())return;const e=this._a(),n={};let r=!1;for(const[s,i]of Object.entries(e))t.includes(s)?r=!0:n[s]=i;r&&(Ws(n)?this.Zo():this.Jo(n))}wa(){this.Qo()&&this.Zo()}getActivationTimestamp(t){if(!this.pa().includes(t))return;const e=this._a()[t];return Xn(e)?e:void 0}ya(){const t=this.ka();return this.$i.getProperty(t)||[]}pa(){const t=this.ya();if(t.length===0)return[];const e=this.$i.getProperty(this.Sa()),n=this.$i.getSessionId();return n&&e===n?t:[]}ma(){const t=this.$i.getSessionId();t&&this.xa(t)}ba(){this.$a()}Vo(t){const e=this.$i.getProperty(this.Sa());if(e&&e!==t){const n=this.ya(),r=this._a();n.length>0&&(this.ga([]),n.filter(s=>Xn(r[s])).forEach(s=>this.ha(s))),this.ba(),this.wa(),n.length>0&&this.fa()}}getActivatedIds(){return[...new Set([...this.pa(),...this.qo])].filter(t=>!this.Ca(t))}dispose(){var t,e,n;(t=this.Wo)===null||t===void 0||t.call(this),this.Wo=void 0,(e=this.Ro)===null||e===void 0||e.call(this),this.Ro=void 0,(n=this.sa)===null||n===void 0||n.dispose(),this.sa=void 0}reset(){this.qo=[],this.ya().length>0&&this.ga([]),this.ba(),this.wa(),this.fa()}getEventToItemsMap(){return this.Bo}Ta(){return this.sa}},ZZ=class extends BZ{constructor(t,e,n,r){var s;super({subscribeCapture(i){const o=t.onEvent(l=>i(l.event,l));return()=>o.dispose()},subscribeSession(i){const o=t.onSession(i);return()=>o.dispose()},getSessionId(){var i;return(i=t.session)===null||i===void 0?void 0:i.sessionId},getProperty:i=>t.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 l;return(l=t.getExtension("autocapture"))===null||l===void 0?void 0:l.setElementSelectors(i,o)}},r),this.Ia=t,this.Ma=e,this.Uo()}ka(){return fb}Sa(){return Ng}Qo(){return Lg}Jo(t){this.Ia.kv.set({[Lg]:t})}Zo(){this.Ia.kv.remove(Lg)}Go(t){var e;let n;this.ta(s=>{n=s.find(i=>i.id===t)});const r=n==null||(e=n.appearance)===null||e===void 0?void 0:e.surveyPopupDelaySeconds;return Xn(r)&&r>0}Ea(){return gi.SHOWN}ta(t){this.Ma.getSurveys(t)}ha(t){this.Ma.cancelPendingSurvey(t)}oa(){return Zt}ga(t){this.Ia.kv.set({[fb]:t})}xa(t){this.Ia.kv.set({[Ng]:t})}$a(){this.Ia.kv.remove(Ng)}Ca(){return!1}aa(t,e,n){var r;if(t===gi.SENT&&(n==null||(r=n.properties)===null||r===void 0?void 0:r.$survey_completed)===!1)return"ignore";let s;return this.ta(i=>{s=i.find(o=>o.id===e)}),!s||(function(i){var o;return lM(i)&&!!(!((o=i.conditions)===null||o===void 0||(o=o.events)===null||o===void 0)&&o.repeatedActivation)||i.schedule==="always"})(s)?t===gi.SHOWN?"consume":"ignore":t===gi.SHOWN?"persist":t===gi.DISMISSED||t===gi.SENT?"consume":"ignore"}getSurveys(){return this.getActivatedIds()}getEventToSurveys(){return this.getEventToItemsMap()}};const ok=(t,e)=>t!=null&&t.then?t.then(e):e(t),Ed="SDK is not enabled or survey functionality is not yet loaded",m3="Disabled. Not loading surveys.";var WZ=class{constructor(t){this.Aa=t,this.name="surveys",this._surveyEventReceiver=null,this._surveyManager=null,this.Ra=!1,this.Pa=!1,this.Oa=[],this.Fa=[],this.Da=null,this.La=null,this.Ti=!1,this.Na=new Set,this.onRemoteConfig=e=>{if(this.Ti||this.Pr.disableSurveys)return;if(!e.ok)return this.Pa=!0,this.ja({isLoaded:!1,error:"Remote config unavailable. Not loading surveys."}),Zt.warn("Remote config unavailable. Not loading surveys.");const n=e.config.surveys;if(at(n))return Zt.warn("Flags not loaded yet. Not loading surveys.");this.qa=Ns(n)?n:n.length>0,Zt.info(`flags response received, isSurveysEnabled: ${this.qa}`),this.loadIfEnabled()},this.ja=e=>{this.Fa.slice().forEach(n=>this.Ba(n,e))}}setup(t){if(!this.Ti)return this.za=t,ok(t.kv.initialize(),()=>{if(this.za!==t||this.Ti)return;this.za=void 0,this.Ia=t;const e=t.onRemoteConfig(this.onRemoteConfig);this.Ti?e.dispose():(this.Ha=e,this.loadIfEnabled())})}dispose(){var t,e,n,r,s;this.Ti||(this.Ti=!0,this.za=void 0,this.Ia=void 0,(t=this.Ha)===null||t===void 0||t.dispose(),this.Ha=void 0,(e=this._surveyEventReceiver)===null||e===void 0||e.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.Oa=[],this.Fa.forEach(i=>{i.active=!1}),this.Fa=[],(s=this.Ua)===null||s===void 0||s.call(this),this.Ua=void 0,this.Da=null,this.Na.forEach(i=>clearTimeout(i)),this.Na.clear())}get Pr(){return this.Aa.get()}getRenderContext(){if(!this.Ia)return;const t=this;return{client:this.Ia,get config(){return t.Pr},surveys:t}}initialize(){this.loadIfEnabled()}reset(){var t,e;(t=this._surveyManager)===null||t===void 0||(e=t.clearInMemoryInProgressSurveyState)===null||e===void 0||e.call(t);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.ja()}loadIfEnabled(){if(this.Ti||!this.Ia)return;const t=this.Pr;if(this._surveyManager)return;if(this.Ra)return void Zt.info("Already initializing surveys, skipping...");if(t.disableSurveys)return void Zt.info(m3);if(t.cookielessMode&&this.Ia.isOptedOut)return void Zt.info("Not loading surveys in cookieless mode without consent.");const e=this.Aa.getExtensions();if(!e)return void this.Wa("PostHog Extensions not found.");if(ue(this.qa)&&!t.advancedEnableSurveys)return;const n=this.qa||t.advancedEnableSurveys;this.Ra=!0,this.Pa=!1;try{const r=e.generateSurveys;if(r)return this.Va(r,n),void(this.Ra=!1);const s=e.loadExternalDependency;if(!s)return this.Wa(ZS),void(this.Ra=!1);s(i=>{try{if(this.Ti)return;const o=this.Aa.getExtensions();i||!(o!=null&&o.generateSurveys)?this.Wa("Could not load surveys script",i):this.Va(o.generateSurveys,n)}finally{this.Ra=!1}})}catch(r){throw this.Ra=!1,this.Wa("Error initializing surveys",r),r}}Va(t,e){var n;if(this.Ti)return;this._surveyManager=t(e),this._surveyEventReceiver=this.Ga(this.Ia,this.ja);const r=(n=this.Ia)===null||n===void 0?void 0:n.kv.get(ep);r&&this.Qa(r),Zt.info("Surveys loaded successfully"),this.Ja(),this.ja(),this.Za({isLoaded:!0})}Ga(t,e){return new ZZ(t,this,void 0,e)}Wa(t,e){this.Pa=!0,Zt.error(t,e),this.ja({isLoaded:!1,error:t}),this.Za({isLoaded:!1,error:t})}onSurveysLoaded(t){return this.Oa.push(t),this._surveyManager&&this.Za({isLoaded:!0}),()=>{this.Oa=this.Oa.filter(e=>e!==t)}}getSurveys(t,e=!1){if(this.Ti)return;const n=this.Ia;if(!n)return t([],{isLoaded:!1,error:Ed});if(this.Pr.disableSurveys)return Zt.info(m3),t([]);const r=n.kv.get(ep);if(r&&!e)return t(r,{isLoaded:!0}),void(this.Ka()&&this.getSurveys(()=>{},!0));if(this.Da)return void this.Da.then(({surveys:o,context:l})=>{this.Ti||t(o,l)}).catch(o=>Zt.error("Error in survey callback",o));const s=n.sendRequest("/api/surveys/",{method:"GET",query:{token:n.projectToken},sentAt:"query",timeoutMs:this.Pr.requestTimeoutMs}).then(o=>{try{return this.Ya(n,o)}catch(l){return Zt.error("Error processing surveys response",l),this.Ya(n,{statusCode:0,error:l})}},o=>this.Ya(n,{statusCode:0,error:o}));this.Da=s;const i=()=>{this.Da===s&&(this.Da=null)};s.then(o=>{i(),this.Ti||(this.ja(o.context),t(o.surveys,o.context))},i).catch(o=>Zt.error("Error in survey callback",o))}Ya(t,e){if(this.Ti)return{surveys:[],context:{isLoaded:!1,error:Ed}};const n=e.statusCode;if(n!==200||!e.json){const s=`Surveys API could not be loaded, status: ${n}`;return n!==0?Zt.error(s):e.error||Zt.warn(s),this.La=Date.now(),{surveys:[],context:{isLoaded:!1,error:s}}}this.La=null;const r=e.json.surveys||[];return t.kv.set({[ep]:r,[Sv]:Date.now()}),this.Qa(r),{surveys:r,context:{isLoaded:!0}}}Qa(t){const e=t.filter(n=>(function(r){return!(!r.start_date||r.end_date)})(n)&&(lM(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.Xa(e)}Xa(t){var e;(e=this._surveyEventReceiver)===null||e===void 0||e.replace(t)}Ka(){return this.tl()&&!this.Da&&!this.el()}tl(){var t;const e=(t=this.Ia)===null||t===void 0?void 0:t.kv.get(Sv);return Xn(e)&&Date.now()-e>3e5}el(){return Xn(this.La)&&3e5>Date.now()-this.La}markSurveyAsSeen(t,e){var n;const r={id:t,current_iteration:(n=e==null?void 0:e.iteration)!==null&&n!==void 0?n:null};dM(r);try{localStorage.setItem("lastSeenSurveyDate",new Date().toISOString())}catch{}this.ja()}Za(t){for(const e of this.Oa){if(this.Ti)return;try{t.isLoaded?this.getSurveys(e):e([],t)}catch(n){Zt.error("Error in survey callback",n)}}}getActiveMatchingSurveys(t,e=!1){if(!at(this._surveyManager))return this._surveyManager.getActiveMatchingSurveys(t,e);Zt.warn("init was not called")}onActiveMatchingSurveysChanged(t){var e;if(this.Ti)return()=>{};const n={callback:t,active:!0,revision:0};this.Fa.push(n),this.Ja();const r=(e=this.Ia)===null||e===void 0?void 0:e.kv.get(ep);return this.Pr.disableSurveys||!this._surveyManager&&this.Pa&&!this.Ra||!r&&!at(this.La)&&!this.Da?this.Ba(n,{isLoaded:!1}):this._surveyManager&&this.Ba(n),()=>{var s;n.active=!1,this.Fa=this.Fa.filter(i=>i!==n),this.Fa.length===0&&((s=this.Ua)===null||s===void 0||s.call(this),this.Ua=void 0)}}Ja(){var t,e,n;this._surveyManager&&this.Fa.length>0&&((t=this.Ua)!==null&&t!==void 0||(this.Ua=(e=(n=this.Aa).onMatchingConditionsChanged)===null||e===void 0?void 0:e.call(n,this.ja)))}Ba(t,e){if(this.Ti||!t.active)return;const n=++t.revision,r=s=>{if(!this.Ti&&t.active&&n===t.revision)try{const i=e??{isLoaded:!0},o=JSON.stringify([s,i]);if(o===t.lastResult)return;t.lastResult=o,t.callback(s,i)}catch(i){Zt.error("Error in active matching surveys callback",i)}};try{e&&!e.isLoaded?r([]):this.getActiveMatchingSurveys(r)}catch(s){Zt.error("Error in active matching surveys callback",s)}}il(t){let e=null;return this.getSurveys(n=>{var r;e=(r=n.find(s=>s.id===t))!==null&&r!==void 0?r:null}),e}nl(t){if(at(this._surveyManager))return{eligible:!1,reason:Ed};const e=typeof t=="string"?this.il(t):t;return e?this._surveyManager.checkSurveyEligibility(e):{eligible:!1,reason:"Survey not found"}}sl(t){var e;if(!(!((e=this.Ia)===null||e===void 0)&&e.canCapture))return{eligible:!1,reason:"PostHog is not capturing, so a survey response cannot be recorded"};if(at(this._surveyManager))return{eligible:!1,reason:Ed};const n=typeof t=="string"?this.il(t):t;return n?this._surveyManager.checkSurveyRenderability(n):{eligible:!1,reason:"Survey not found"}}canRenderSurvey(t){if(at(this._surveyManager))return Zt.warn("init was not called"),{visible:!1,disabledReason:Ed};const e=this.sl(t);return{visible:e.eligible,disabledReason:e.reason}}canRenderSurveyAsync(t,e){return at(this._surveyManager)?(Zt.warn("init was not called"),Promise.resolve({visible:!1,disabledReason:Ed})):new Promise(n=>{this.getSurveys(r=>{var s;const i=(s=r.find(o=>o.id===t))!==null&&s!==void 0?s:null;if(i){const o=this.sl(i);n({visible:o.eligible,disabledReason:o.reason})}else n({visible:!1,disabledReason:"Survey not found"})},e)})}renderSurvey(t,e,n){var r,s,i;if(!(!((r=this.Ia)===null||r===void 0)&&r.canCapture))return;if(at(this._surveyManager))return void Zt.warn("init was not called");const o=typeof t=="string"?this.il(t):t;if(!(o!=null&&o.id))return void Zt.warn("Survey not found");if(!gZ.includes(o.type))return void Zt.warn(`Surveys of type ${o.type} cannot be rendered in the app`);const l=(s=typeof document>"u"?void 0:document)===null||s===void 0?void 0:s.querySelector(e);if(l){if(!((i=o.appearance)===null||i===void 0)&&i.surveyPopupDelaySeconds){Zt.info(`Rendering survey ${o.id} with delay of ${o.appearance.surveyPopupDelaySeconds} seconds`);const c=setTimeout(()=>{var d,f,h;this.Na.delete(c),!this.Ti&&(!((d=this.Ia)===null||d===void 0)&&d.canCapture)&&(Zt.info(`Rendering survey ${o.id} with delay of ${(f=o.appearance)===null||f===void 0?void 0:f.surveyPopupDelaySeconds} seconds`),(h=this._surveyManager)===null||h===void 0||h.renderSurvey(o,l,n),Zt.info(`Survey ${o.id} rendered`))},1e3*o.appearance.surveyPopupDelaySeconds);return void this.Na.add(c)}this._surveyManager.renderSurvey(o,l,n)}else Zt.warn("Survey element not found")}displaySurvey(t,e){var n,r;if(!(!((n=this.Ia)===null||n===void 0)&&n.canCapture))return;if(at(this._surveyManager))return void Zt.warn("init was not called");const s=this.il(t);if(!s)return void Zt.warn("Survey not found");let i=s;if(!((r=s.appearance)===null||r===void 0)&&r.surveyPopupDelaySeconds&&e.ignoreDelay&&(i=j(j({},s),{},{appearance:j(j({},s.appearance),{},{surveyPopupDelaySeconds:0})})),e.displayType!==kb.Popover&&e.initialResponses&&Zt.warn("initialResponses is only supported for popover surveys. prefill will not be applied."),e.ignoreConditions===!1){const o=this.nl(s);if(!o.eligible)return void Zt.warn("Survey is not eligible to be displayed: ",o.reason)}e.displayType!==kb.Inline?this._surveyManager.handlePopoverSurvey(i,e):this.renderSurvey(i,e.selector,e.properties)}cancelPendingSurvey(t){at(this._surveyManager)?Zt.warn("init was not called"):this._surveyManager.cancelSurvey(t)}handlePageUnload(){var t,e;(t=this._surveyManager)===null||t===void 0||(e=t.handlePageUnload)===null||e===void 0||e.call(t)}},qZ=class{constructor(t){this._instance=t}get(){var t,e,n,r;const s=(t=this._instance)===null||t===void 0?void 0:t.config;return{disableSurveys:!!(s!=null&&s.disable_surveys),cookielessMode:!!(s!=null&&s.cookieless_mode),advancedEnableSurveys:!!(s!=null&&s.advanced_enable_surveys),requestTimeoutMs:(e=s==null?void 0:s.surveys_request_timeout_ms)!==null&&e!==void 0?e: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 t=tt==null?void 0:tt.__PosthogExtensions__;if(!t||!this._instance)return;const e=this._instance,{generateSurveys:n,loadExternalDependency:r}=t;return{generateSurveys:n?s=>n(e,s):void 0,loadExternalDependency:r?s=>r(e,"surveys",s):void 0}}onMatchingConditionsChanged(t){var e,n;const r=(e=this._instance)===null||e===void 0?void 0:e._addCaptureHook(l=>{l!=="$pageview"&&l!==gi.SHOWN&&l!==gi.DISMISSED&&l!==gi.SENT||t()}),s=()=>t();Dt(le,"PHSurveyShown",s);let i=!1;const o=(n=this._instance)===null||n===void 0?void 0:n.onFeatureFlags(()=>{i&&t()});return i=!0,()=>{i=!1,r==null||r(),o==null||o(),le==null||le.removeEventListener("PHSurveyShown",s)}}};const GZ=le!=null&&le.location?Pv(le.location.hash,"__posthog")||Pv(location.hash,"state"):null,g3="_postHogToolbarParams",v3=Pn("[Toolbar]"),y3=Pn("[FeatureFlags]"),Zc=Pn("[FeatureFlags]",{debugEnabled:!0}),T2=`" failed. Feature flags didn't load in time.`,KZ=[502,504],_3=["click","keydown","wheel","touchstart","pointerdown"],w3="connection_error",b3=t=>{const e={};for(let n=0;t.length>n;n++)e[t[n]]=!0;return e},x3=t=>{const e={};for(const[n,r]of $g(t||{}))r&&(e[n]=r);return e},YZ=(t,e)=>t.distinctId===e.distinctId&&t.sessionId===e.sessionId&&((n,r)=>{const s=Object.keys(n);return s.length===Object.keys(r).length&&s.every(i=>n[i]===r[i])})(t.groups,e.groups);var XZ=class{constructor(t){this.name="featureFlags",this.Cd=!1,this.featureFlagEventHandlers=[],this.A=y3,this.Td={},this.Id={},this.Md=[],this.Ed=new Set,this.Ad=new Set,this.Rd=!1,this.Pd=!1,this.Od=0,this.Fd=!1,this.Dd=!1,this.Ld=!1,this.Nd=new Map,this.jd=!1,this.qd=!1,this.Bd=!1,this.zd=0,this.Hd=!1,this.sn=()=>{const e=this.Ud();this.zd=0,e&&this.reloadFeatureFlags()},this.Wd=()=>{var e,n;const r=this.Vd,s=(e=this.Gd)!==null&&e!==void 0?e:r;ue(r)||ue(s)||this.Pr.remoteRequestsDisabled||!this.Qd||this.Qd.visibilityState==="hidden"||Date.now()-((n=this.Jd)!==null&&n!==void 0?n:0)<s||(this.Gd=this.Hd||!this.Pr.idleRefreshBackoff?r:Math.min(2*s,36e5),this.Hd=!1,this.reloadFeatureFlags(),this.Zd())},this.Kd=()=>{this.Hd&&this.Gd===this.Vd||this.Yd()},this.an=()=>{var e;((e=this.Qd)===null||e===void 0?void 0:e.visibilityState)==="visible"&&this.Yd()},this.Aa=t}get Xd(){}tv(){this.Ia&&this.ev()}setup(t){try{this.iv=typeof window>"u"?void 0:window,this.Qd=typeof document>"u"?void 0:document}catch{this.iv=void 0,this.Qd=void 0}return this.za=t,this.A=t.logger.createLogger("[FeatureFlags]"),ok(t.kv.initialize(),()=>{this.za===t&&(this.za=void 0,this.Ia=t,this.nv(t))})}nv(t){var e;if(this.Ia===t)return this.iv&&Dt(this.iv,"online",this.sn),this.ev(),this.sv=t.registerDynamicEventProperties(()=>this.rv()?this.Td:this.Id),this.ov=(e=this.Xd)===null||e===void 0?void 0:e.onCrossTabFeatureFlagChange(()=>{this.av(),this.lv(),this.uv()}),this.lv(),this.initialize()}Yd(){this.Hd=!0,this.Gd=this.Vd,this.Wd()}ev(){var t;const e=this.Pr.refreshIntervalMs,n=!this.Pr.remoteRequestsDisabled&&this.Qd&&!ue(e)&&e>0?e:void 0;this.Pr.idleRefreshBackoff||(this.Gd=n),n!==this.Vd&&(this.hv(),ue(n)||(this.Vd=n,this.Gd=n,this.Zd(),!((t=this.Qd)===null||t===void 0)&&t.addEventListener&&(Dt(this.Qd,Yd,this.an),zd(_3,r=>{Dt(this.Qd,r,this.Kd,{capture:!0})}))))}Zd(){ue(this.Vd)||(ue(this.dv)||clearInterval(this.dv),this.Jd=Date.now(),this.dv=setInterval(this.Wd,this.Vd))}hv(){var t,e;ue(this.dv)||(clearInterval(this.dv),this.dv=void 0,(t=this.Qd)===null||t===void 0||(e=t.removeEventListener)===null||e===void 0||e.call(t,"visibilitychange",this.an),zd(_3,n=>{var r,s;(r=this.Qd)===null||r===void 0||(s=r.removeEventListener)===null||s===void 0||s.call(r,n,this.Kd,{capture:!0})})),this.Vd=void 0,this.Gd=void 0,this.Hd=!1,this.Jd=void 0}destroy(){this.vv()}dispose(){this.vv()}vv(){var t,e,n;this.hv(),this.Od++,this.Dd=!1,this.za=void 0,this.fv(this.Ed,"cancelled"),this.fv(this.Ad,"cancelled"),this.Ia&&(this.pv(),(t=this.sv)===null||t===void 0||t.dispose(),this.sv=void 0,(e=this.ov)===null||e===void 0||e.call(this),this.ov=void 0,this.Md=[],(n=this.iv)===null||n===void 0||n.removeEventListener("online",this.sn),this.Ia=void 0)}get Pr(){return this.Aa.get()}gv(t){var e;return this.mv&&t in this.mv?this.mv[t]:(e=this.Ia)===null||e===void 0?void 0:e.kv.get(t)}av(){return!!this.mv&&(this.mv=void 0,!0)}yv(){var t;return!ue((t=this.Ia)===null||t===void 0?void 0:t.kv.get("$enabled_feature_flags"))&&this.av()}$t(t){this.bv(()=>{var e;return(e=this.Ia)===null||e===void 0?void 0:e.kv.set(t)})}_v(t,e,n){if(!this.Xd||!t.$enabled_feature_flags)return;const r=this.gv("$enabled_feature_flags")||{},s=t.$enabled_feature_flags||{},i=e.flags||e.featureFlags,o=e.flags?Object.entries(e.flags).filter(([,w])=>!(w!=null&&w.failed)).map(([w])=>w):[],l=!!e.errorsWhileComputingFlags&&!!e.flags,c=l?o:n&&!We(i)?Object.keys(i||{}):Array.from(new Set([...Object.keys(r),...Object.keys(s)])),d=this.gv("$feature_flag_payloads")||{},f=t.$feature_flag_payloads||{},h=l||n?c:Array.from(new Set([...Object.keys(d),...Object.keys(f)])),m=!l&&!n,v=!!m||c,_=!!m||h,y={[Ha]:v,[bo]:v,[Gl]:_};t.$feature_flag_details&&(y[wu]=v);for(const w of[bu,ec,mp])ue(t[w])||(y[w]=!0);this.Xd.markCrossTabFeatureFlagChanges(y)}Dt(t){this.bv(()=>{var e;return(e=this.Ia)===null||e===void 0?void 0:e.kv.remove(t)})}bv(t){try{t()}catch(e){this.A.error("Failed to update feature flag persistence",e)}}lv(){const t={};for(const r of[Ha,Gl,bu,Vo]){const s=this.gv(r);ue(s)||(t[r]=s)}this.Td=t;const e=j({},t),n=this.gv(bo);if(n)for(const[r,s]of Object.entries(n))e[`$feature/${r}`]=s;this.Id=e}rv(){const t=this.Pr.cacheTtlMs;if(!t||0>=t)return!1;const e=this.gv(ec);return typeof e!="number"||Date.now()-e>t}wv(){return!!this.rv()&&(this.Bd||this.Pd||(this.Bd=!0,this.A.warn("Feature flag cache is stale, triggering refresh..."),this.reloadFeatureFlags()),!0)}Sv(){const t=this.Pr.evaluationContexts;return t!=null&&t.length?t.filter(e=>{const n=e&&typeof e=="string"&&e.trim().length>0;return n||this.A.error("Invalid evaluation context found:",e,"Expected non-empty string"),n}):[]}xv(){const t=this.Pr.flagKeys;if(!ue(t))return t.filter(e=>{const n=e&&typeof e=="string"&&e.trim().length>0;return n||this.A.error("Invalid flag key found:",e,"Expected non-empty string"),n})}initialize(){var t,e;const n=this.Pr,r=(t=(e=n.bootstrap)===null||e===void 0?void 0:e.featureFlags)!==null&&t!==void 0?t:{};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:{},l=Object.keys(r).filter(d=>!ue(r[d])).reduce((d,f)=>(d[f]=r[f],d),{}),c=Object.keys(o).filter(d=>l[d]).reduce((d,f)=>(d[f]=o[f],d),{});return this.$v({featureFlags:l,featureFlagPayloads:c},void 0,{persist:!1})}}updateFlags(t,e,n){var r,s;const i=n!=null&&n.merge&&(r=this.gv("$enabled_feature_flags"))!==null&&r!==void 0?r:{},o=n!=null&&n.merge&&(s=this.gv("$feature_flag_payloads"))!==null&&s!==void 0?s:{},l=j(j({},i),t),c=j(j({},o),e),d={};for(const[f,h]of Object.entries(l))d[f]={key:f,enabled:uP(h),variant:dP(h),reason:void 0,metadata:ue(c==null?void 0:c[f])?void 0:{id:0,version:void 0,description:void 0,payload:c[f]}};this.$v({flags:d})}get hasLoadedFlags(){return this.Rd}getFlags(){return Object.keys(this.getFlagVariants())}getFlagsWithDetails(){const t=this.gv(wu),e=this.gv(Vo),n=this.gv(ru);if(!n&&!e)return t||{};const r=bn({},t||{}),s=[...new Set([...Object.keys(n||{}),...Object.keys(e||{})])];for(const l of s){var i,o;const c=r[l],d=e==null?void 0:e[l],f=ue(d)?(i=c==null?void 0:c.enabled)!==null&&i!==void 0&&i:!!d,h=ue(d)?c==null?void 0:c.variant:typeof d=="string"?d:void 0,m=n==null?void 0:n[l],v=j(j({},c),{},{enabled:f,variant:f?h??(c==null?void 0:c.variant):void 0});f!==(c==null?void 0:c.enabled)&&(v.original_enabled=c==null?void 0:c.enabled),h!==(c==null?void 0:c.variant)&&(v.original_variant=c==null?void 0:c.variant),m&&(v.metadata=j(j({},c==null?void 0:c.metadata),{},{payload:m,original_payload:c==null||(o=c.metadata)===null||o===void 0?void 0:o.payload})),r[l]=v}return this.Cd||(this.A.warn(" Overriding feature flag details!",{flagDetails:t,overriddenPayloads:n,finalDetails:r}),this.Cd=!0),r}getAllFeatureFlags(){const t=this.getFlagVariants(),e=this.getFlagPayloads();return Object.keys(t).map(n=>{const r=t[n];return{key:n,enabled:uP(r),variant:dP(r),payload:cP(e[n])}})}getFlagVariants(){const t=this.gv(bo),e=this.gv(Vo);if(!e)return t||{};const n=bn({},t||{}),r=Object.keys(e);for(let s=0;r.length>s;s++)n[r[s]]=e[r[s]];return this.Cd||(this.A.warn(" Overriding feature flags!",{enabledFlags:t,overriddenFlags:e,finalFlags:n}),this.Cd=!0),n}getFlagPayloads(){const t=this.gv(Gl),e=this.gv(ru);if(!e)return t||{};const n=bn({},t||{}),r=Object.keys(e);for(let s=0;r.length>s;s++)n[r[s]]=e[r[s]];return this.Cd||(this.A.warn(" Overriding feature flag payloads!",{flagPayloads:t,overriddenPayloads:e,finalPayloads:n}),this.Cd=!0),n}reloadFeatureFlags(){this.Fd||this.Pr.featureFlagsDisabled||this.Ud()||(this.Ld&&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.Pd&&(this.Dd=!0),this.Cv||(this.Md.slice().forEach(t=>{try{t()}catch(e){this.A.error("Error while running feature flags reloading callback",e)}}),this.Cv=setTimeout(()=>{this.Tv()},5)))}reloadFeatureFlagsAsync(){return!this.Ia||this.Fd||this.Pr.featureFlagsDisabled||this.Pr.remoteRequestsDisabled||this.Ud()?Promise.resolve({status:"skipped"}):new Promise(t=>{this.Ed.add(t),this.reloadFeatureFlags()})}fv(t,e){t.forEach(n=>n({status:e})),t.clear()}pv(){clearTimeout(this.Cv),this.Cv=void 0}onReloading(t){return this.Md.push(t),()=>{this.Md=this.Md.filter(e=>e!==t)}}ensureFlagsLoaded(){this.Rd||this.Pd||this.Cv||this.reloadFeatureFlags()}setAnonymousDistinctId(t){this.$anon_distinct_id=t}setReloadingPaused(t){this.Fd=t}resetFlagCallReported(){this.Dt(Go),this.Nd=new Map}sendFlagCallsPendingCapture(){var t;if(this.Nd.size!==0&&!this.jd&&(!((t=this.Ia)===null||t===void 0)&&t.canCapture)&&!this.Ia.isRateLimited){this.jd=!0;try{const e=this.getFlagVariants();for(const n of Array.from(this.Nd.keys())){const r=this.Nd.get(n);if(r){if(r.value!==String(e[n])||!YZ(r.context,this.Iv())){this.Nd.delete(n);continue}if(this.getFeatureFlagResult(n),this.Nd.has(n))break}}}finally{this.jd=!1}}}Tv(t){var e;this.pv();const n=this.Ia;if(!n||this.Pr.remoteRequestsDisabled||this.Ud())return void this.fv(this.Ed,"skipped");if(this.Pd)return void(this.Dd=!0);const r={token:n.projectToken,distinct_id:n.distinctId,groups:n.groups,$anon_distinct_id:this.$anon_distinct_id,person_properties:j(j(j({},n.initialPersonProperties),this.gv("$stored_person_properties")||{}),{},{$lib:n.library.name,$lib_version:n.library.version}),group_properties:this.gv(Wl),timezone:I5()};ue(n.deviceId)||(r.$device_id=n.deviceId),(t!=null&&t.disableFlags||this.Pr.featureFlagsDisabled)&&(r.disable_flags=!0);const s=this.Sv();s.length&&(r.evaluation_contexts=s);const i=this.xv();ue(i)||(r.flag_keys=i);const o=this.Pr.onlyEvaluateSurveyFeatureFlags,l="/flags/?v=2"+(o?"&only_evaluate_survey_feature_flags=true":""),c=this.Od,d=this.Ed;this.Ed=new Set,this.Ad=d,this.Pd=!0;const f=()=>{this.Dd&&(this.Dd=!1,this.Tv())},h=w=>{var x,k;const P=(x=w.json)!==null&&x!==void 0?x:{},C=w.statusCode!==200;if(this.Pd=!1,c!==this.Od)return void f();if(this.Mv(w.statusCode),C||this.Dd||(this.$anon_distinct_id=void 0),r.disable_flags&&!this.Dd)return void this.fv(d,"skipped");this.qd=!C;const T=[];w.error?T.push(w.error instanceof Error&&w.error.name==="AbortError"?"timeout":w.error instanceof Error?w3:"unknown_error"):w.statusCode!==200&&T.push(`api_error_${w.statusCode}`),P.errorsWhileComputingFlags&&T.push("errors_while_computing_flags");const O=!!(!((k=P.quotaLimited)===null||k===void 0)&&k.includes("feature_flags"));O&&T.push("quota_limited"),this.$t({[zp]:T}),O?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.$v(P,C,{partialResponse:o}),this.fv(d,r.disable_flags?"skipped":T.length||!P.flags&&!P.featureFlags?"error":"loaded"),f()},m=w=>{this.Pd=!1,c===this.Od&&(this.$t({[zp]:[w3]}),this.A.error("Feature flag request failed",w),this.yv()&&this.uv(!0),this.fv(d,"error")),f()};let v=(e=this.Pr.requestMaxRetries)!==null&&e!==void 0?e:1;const _=()=>v>0&&c===this.Od,y=()=>{if(c!==this.Od||!this.Ia||this.Pr.remoteRequestsDisabled)return this.Pd=!1,this.fv(d,"skipped"),void f();try{n.sendRequest(l,{target:"flags",method:"POST",body:r,compression:this.Pr.compression,sentAt:"body",timeoutMs:this.Pr.requestTimeoutMs}).then(w=>{if((x=>KZ.includes(x.statusCode)||(k=>k.statusCode===0&&k.error instanceof Error&&k.error.name==="AbortError")(x))(w)&&_())return v--,void setTimeout(y,500);h(w)}).catch(m)}catch(w){m(w)}};y()}Ud(){return M5(this.zd,3)}Mv(t){this.zd=N5(t,this.zd,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(t,e={}){var n;if(e.fresh&&!this.qd)return;if(!(this.Rd||this.getFlags()&&this.getFlags().length>0))return void this.A.warn('getFeatureFlag for key "'+t+T2);if(this.wv())return;const r=this.getFeatureFlagResult(t,e);return(n=r==null?void 0:r.variant)!==null&&n!==void 0?n:r==null?void 0:r.enabled}getFeatureFlagDetails(t){return this.getFlagsWithDetails()[t]}getFeatureFlagPayload(t){const e=this.getFeatureFlagResult(t,{send_event:!1});return e==null?void 0:e.payload}getFeatureFlagResult(t,e={}){if(e.fresh&&!this.qd)return;if(!(this.Rd||this.getFlags()&&this.getFlags().length>0))return void this.A.warn('getFeatureFlagResult for key "'+t+T2);if(this.wv())return;const n=this.getFlagVariants(),r=t in n,s=n[t],i=this.getFlagPayloads()[t],o=String(s),l=this.gv("$feature_flag_request_id")||void 0,c=this.gv("$feature_flag_evaluated_at")||void 0;let d,f=this.gv("$flag_call_reported")||{};if(this.Pr.deduplicateCallsPerSession){var h;const G=(h=this.Ia)===null||h===void 0||(h=h.session)===null||h===void 0?void 0:h.sessionId,X=this.gv(Jh);G&&G!==X&&(f={},d=G)}if(!e.send_event&&"send_event"in e)d&&this.$t({[Go]:f,[Jh]:d});else{var m,v,_;const G=!(!((m=this.Ia)===null||m===void 0)&&m.canCapture),X=!G&&!(!((v=this.Ia)===null||v===void 0)&&v.isRateLimited);var y;if(X?this.Nd.delete(t):(G&&Object.keys(f).length>0&&(f={},this.$t({[Go]:f})),!((y=f[t])===null||y===void 0)&&y.includes(o)||this.Ev(t,o)),X&&!(!((_=f[t])===null||_===void 0)&&_.includes(o))){var w,x,k,P,C,T,O,I,R,N,L,z,$;We(f[t])?f[t].push(o):f[t]=[o],this.$t(j({[Go]:f},d?{[Jh]:d}:{}));const q=this.getFeatureFlagDetails(t),H=[...(w=this.gv("$feature_flag_errors"))!==null&&w!==void 0?w:[]];ue(s)&&H.push("flag_missing");const ee={$feature_flag:t,$feature_flag_response:s,$feature_flag_payload:i??null,$feature_flag_request_id:l,$feature_flag_evaluated_at:c,$feature_flag_bootstrapped_response:(x=(k=this.Pr.bootstrap)===null||k===void 0||(k=k.featureFlags)===null||k===void 0?void 0:k[t])!==null&&x!==void 0?x:null,$feature_flag_bootstrapped_payload:(P=(C=this.Pr.bootstrap)===null||C===void 0||(C=C.featureFlagPayloads)===null||C===void 0?void 0:C[t])!==null&&P!==void 0?P:null,$used_bootstrap_value:!this.qd};ue(q==null||(T=q.metadata)===null||T===void 0?void 0:T.has_experiment)||(ee.$feature_flag_has_experiment=q.metadata.has_experiment),ue(q==null||(O=q.metadata)===null||O===void 0?void 0:O.version)||(ee.$feature_flag_version=q.metadata.version);const V=(I=q==null||(R=q.reason)===null||R===void 0?void 0:R.description)!==null&&I!==void 0?I:q==null||(N=q.reason)===null||N===void 0?void 0:N.code;V&&(ee.$feature_flag_reason=V),!(q==null||(L=q.metadata)===null||L===void 0)&&L.id&&(ee.$feature_flag_id=q.metadata.id),ue(q==null?void 0:q.original_variant)&&ue(q==null?void 0:q.original_enabled)||(ee.$feature_flag_original_response=ue(q.original_variant)?q.original_enabled:q.original_variant),!(q==null||(z=q.metadata)===null||z===void 0)&&z.original_payload&&(ee.$feature_flag_original_payload=q==null||($=q.metadata)===null||$===void 0?void 0:$.original_payload),H.length&&(ee.$feature_flag_error=H.join(",")),this.Av(ee)||(this.Rv(t,o),this.Ev(t,o))}else d&&this.$t({[Go]:f,[Jh]:d})}return r?{key:t,enabled:!!s,variant:typeof s=="string"?s:void 0,payload:cP(i)}:void 0}Av(t){try{var e;return((e=this.Ia)===null||e===void 0?void 0:e.capture("$feature_flag_called",t))!==!1}catch(n){return this.A.error("Failed to capture feature flag call",n),!0}}Ev(t,e){this.Nd.set(t,{value:e,context:this.Iv()})}Iv(){var t,e,n;return{distinctId:(t=this.Ia)===null||t===void 0?void 0:t.distinctId,groups:j({},(e=this.Ia)===null||e===void 0?void 0:e.groups),sessionId:this.Pr.deduplicateCallsPerSession?(n=this.Ia)===null||n===void 0||(n=n.session)===null||n===void 0?void 0:n.sessionId:void 0}}Rv(t,e){const n=this.gv("$flag_call_reported")||{},r=n[t];We(r)&&r.includes(e)&&(n[t]=r.filter(s=>s!==e),this.$t({[Go]:n}))}getRemoteConfigPayload(t,e){this.Pv(t,e)}Pv(t,e){var n=this;return hn(function*(){const r=n.Ia;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.Sv();i.length&&(s.evaluation_contexts=i);const o=n.xv();let l;ue(o)||(s.flag_keys=o);try{var c;const d=(c=(yield r.sendRequest("/flags/?v=2",{target:"flags",method:"POST",body:s,compression:n.Pr.compression,sentAt:"body",timeoutMs:n.Pr.requestTimeoutMs})).json)===null||c===void 0?void 0:c.featureFlagPayloads;l=(d==null?void 0:d[t])||void 0}catch(d){return void n.A.error("Remote config feature flag request failed",d)}try{e(l)}catch(d){n.A.error("Remote config feature flag callback failed",d)}})()}isFeatureEnabled(t,e={}){if(e.fresh&&!this.qd)return e.defaultValue;if(!(this.Rd||this.getFlags()&&this.getFlags().length>0))return this.A.warn('isFeatureEnabled for key "'+t+T2),e.defaultValue;const n=this.getFeatureFlag(t,e);return ue(n)?e.defaultValue:!!n}addFeatureFlagsHandler(t){this.featureFlagEventHandlers.push(t)}removeFeatureFlagsHandler(t){this.featureFlagEventHandlers=this.featureFlagEventHandlers.filter(e=>e!==t)}receivedFeatureFlags(t,e,n){this.$v(t,e,n)}$v(t,e,n){if(!this.Ia)return;this.Rd=!0;const r=((s,i={},o={},l={},c,d=y3)=>{const f=((P,C)=>{const T=P.flags;if(T){const O=Object.fromEntries(Object.keys(T).map(R=>{var N;return[R,(N=T[R].variant)!==null&&N!==void 0?N:T[R].enabled]})),I=Object.fromEntries(Object.keys(T).filter(R=>T[R].enabled).filter(R=>{var N;return!ue((N=T[R].metadata)===null||N===void 0?void 0:N.payload)}).map(R=>{var N;return[R,(N=T[R].metadata)===null||N===void 0?void 0:N.payload]}));return j(j({},P),{},{featureFlags:O,featureFlagPayloads:I})}return P.featureFlags&&C.warn("Using an older version of the feature flags endpoint. Please upgrade your PostHog server to the latest version"),P})(s,d),h=f.flags,m=f.featureFlags,v=f.featureFlagPayloads;if(!m)return;const _=s.requestId,y=s.evaluatedAt;if(We(m)){d.warn("v1 of the feature flags endpoint is deprecated. Please use the latest version.");const P={};if(m)for(let C=0;m.length>C;C++)P[m[C]]=!0;return{[Ha]:m,[bo]:P,[mp]:!1}}let w=m,x=v,k=h;if(c!=null&&c.partialResponse){const P=Object.keys(w),C=x||{};w=j(j({},i),w),x=j(j({},o),C),P.forEach(T=>{T in C||x==null||delete x[T]}),k=j(j({},l),k)}else if(s.errorsWhileComputingFlags)if(h){const P=new Set(Object.keys(h).filter(T=>{var O;return!(!((O=h[T])===null||O===void 0)&&O.failed)}));w=j(j({},i),Object.fromEntries(Object.entries(w).filter(([T])=>P.has(T))));const C=Object.fromEntries(Object.entries(x||{}).filter(([T])=>P.has(T)));x=j(j({},o),C),P.forEach(T=>{T in C||x==null||delete x[T]}),k=j(j({},l),Object.fromEntries(Object.entries(k||{}).filter(([T])=>P.has(T))))}else w=j(j({},i),w),x=j(j({},o),x),k=j(j({},l),k);return j(j({[Ha]:Object.keys(x3(w)),[bo]:w||{},[Gl]:x||{},[wu]:k||{},[mp]:s.minimalFlagCalledEvents===!0},_?{[bu]:_}:{}),y?{[ec]:y}:{})})(t,this.getFlagVariants(),this.getFlagPayloads(),this.getFlagsWithDetails(),n,this.A);if(r)if((n==null?void 0:n.persist)===!1){const s=!ue(this.Ia.kv.get(bo));this.mv=r,s||this.$t(r)}else this.av(),this._v(r,t,!!(n!=null&&n.partialResponse)),this.$t(r);else e&&this.yv();e||(this.Bd=!1),this.uv(e)}override(t,e=!1){this.A.warn("override is deprecated. Please use overrideFeatureFlags instead."),this.overrideFeatureFlags({flags:t,suppressWarning:e})}overrideFeatureFlags(t){this.Ov(t)}Ov(t){if(this.Ia){if(t===!1)return this.Dt([Vo,ru]),this.uv(),void Zc.info("All overrides cleared");if(We(t))return this.$t({[Vo]:b3(t)}),this.uv(),void Zc.info("Flag overrides set",{flags:t});if(t&&typeof t=="object"&&("flags"in t||"payloads"in t)){var e;const n=t;this.Cd=!!((e=n.suppressWarning)!==null&&e!==void 0&&e);const r={},s=n.flags,i=n.payloads;return s&&(r[Vo]=We(s)?b3(s):s),i&&(r[ru]=i),Object.keys(r).length&&this.$t(r),s===!1&&i===!1?this.Dt([Vo,ru]):s===!1?this.Dt(Vo):i===!1&&this.Dt(ru),this.uv(),s===!1?Zc.info("Flag overrides cleared"):s&&Zc.info("Flag overrides set",{flags:s}),void(i===!1?Zc.info("Payload overrides cleared"):i&&Zc.info("Payload overrides set",{payloads:i}))}if(t&&typeof t=="object")return this.$t({[Vo]:t}),this.uv(),void Zc.info("Flag overrides set",{flags:t});this.A.warn("Invalid overrideOptions provided to overrideFeatureFlags",{overrideOptions:t})}else this.A.warn("posthog.featureFlags.overrideFeatureFlags called before feature flags were ready")}onFeatureFlags(t){if(this.addFeatureFlagsHandler(t),this.Rd){const{flags:e,flagVariants:n}=this.Fv();try{t(e,n)}catch(r){this.A.error("Error while running feature flags callback",r)}}return()=>this.removeFeatureFlagsHandler(t)}updateEarlyAccessFeatureEnrollment(t,e,n){var r;const s=(this.gv("$early_access_features")||[]).find(d=>d.flagKey===t),i={[`$feature_enrollment/${t}`]:e},o={$feature_flag:t,$feature_enrollment:e,$set:i};s&&(o.$early_access_feature_name=s.name),n&&(o.$feature_enrollment_stage=n);const l=j(j({},this.getFlagVariants()),{},{[t]:e});(r=this.Xd)===null||r===void 0||r.markCrossTabFeatureFlagChanges({$active_feature_flags:[t],$enabled_feature_flags:[t],$stored_person_properties:Object.keys(i)}),this.$t({[Ha]:Object.keys(x3(l)),[bo]:l,[ql]:j(j({},this.gv("$stored_person_properties")||{}),i)}),this.uv();try{var c;(c=this.Ia)===null||c===void 0||c.capture("$feature_enrollment_update",o)}catch(d){this.A.error("Failed to capture early access feature enrollment",d)}}getEarlyAccessFeatures(t,e=!1,n){const r=this.gv(db);!r||e?this.Dv(t,n):t(r)}Dv(t,e){var n=this;return hn(function*(){const r=n.Ia;if(!r)return;const s=e?`&${e.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({[db]:i})}catch(o){return void n.A.error("Early access feature request failed",o)}try{t(i)}catch(o){n.A.error("Early access feature callback failed",o)}})()}Fv(){const t=this.getFlags(),e=this.getFlagVariants();return{flags:t.filter(n=>e[n]),flagVariants:Object.keys(e).filter(n=>e[n]).reduce((n,r)=>(n[r]=e[r],n),{})}}uv(t){this.lv();const{flags:e,flagVariants:n}=this.Fv(),r=this.Ld;this.Ld=!0,this.featureFlagEventHandlers.forEach(s=>{try{s(e,n,{errorsLoading:t})}catch(i){this.A.error("Error while running feature flags callback",i)}}),this.Ld=r}setPersonPropertiesForFlags(t,e=!0){this.Lv(t,e)}Lv(t,e=!0){const n=this.gv("$stored_person_properties")||{},r=(t==null?void 0:t.$set)||(t!=null&&t.$set_once?{}:t),s=t==null?void 0:t.$set_once,i={};if(s)for(const o in s)({}).hasOwnProperty.call(s,o)&&(o in n||(i[o]=s[o]));this.$t({[ql]:j(j(j({},n),i),r)}),e&&this.reloadFeatureFlags()}unsetPersonPropertiesForFlags(t,e=!0){const n=j({},this.gv("$stored_person_properties")||{});t.forEach(r=>{delete n[r]}),this.$t({[ql]:n}),e&&this.reloadFeatureFlags()}resetPersonPropertiesForFlags(t=!0){this.Dt(ql),t&&this.reloadFeatureFlags()}setGroupPropertiesForFlags(t,e=!0){const n=this.gv("$stored_group_properties")||{},r=j({},n);for(const s of Object.keys(t))r[s]=j(j({},n[s]),t[s]);this.$t({[Wl]:r}),e&&this.reloadFeatureFlags()}resetGroupPropertiesForFlags(t){if(t){const e=this.gv("$stored_group_properties")||{};this.$t({[Wl]:j(j({},e),{},{[t]:{}})})}else this.Dt(Wl)}reset(){this.Od++,this.fv(this.Ed,"cancelled"),this.fv(this.Ad,"cancelled"),this.Dd=!1,this.Td={},this.Id={},this.mv=void 0,this.Rd=!1,this.Fd=!1,this.qd=!1,this.$anon_distinct_id=void 0,this.pv(),this.Cd=!1,this.zd=0,this.Nd=new Map}};const S3=Pn("[FeatureFlags]");var QZ=class{constructor(t,e=!1){this.Nv=!1,this.update(t,e)}update(t,e){this.jv=((n,r)=>{var s,i,o,l,c,d,f,h;return{bootstrap:{featureFlags:(s=(i=n.bootstrap)===null||i===void 0?void 0:i.featureFlags)!==null&&s!==void 0?s:void 0,featureFlagPayloads:(o=(l=n.bootstrap)===null||l===void 0?void 0:l.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:(c=n.remote_config_refresh_interval_ms)!==null&&c!==void 0?c:3e5,idleRefreshBackoff:ue(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=(h=n.evaluation_contexts)!==null&&h!==void 0?h:n.evaluation_environments)!==null&&f!==void 0?f:[],flagKeys:We(n.flag_keys)?n.flag_keys:void 0}})(t,e),!t.evaluation_environments||t.evaluation_contexts||this.Nv||(S3.warn("evaluation_environments is deprecated. Use evaluation_contexts instead. evaluation_environments will be removed in a future version."),this.Nv=!0),ue(t.flag_keys)||We(t.flag_keys)||S3.error("Invalid flag_keys found:",t.flag_keys,"Expected array of non-empty strings")}get(){return this.jv}};const k3=t=>Gf(t)&&(t.name==="RangeError"&&t.message.indexOf("Maximum call stack size exceeded")===0||t.name==="InternalError"&&t.message==="too much recursion"),ho=Pn("[Error tracking]"),Ib="webkit-masked-url:",JZ=[{value:"isolatedAPI.contexts.topHostname",exact:!1},{value:"No response from target",exact:!0}],eW=["chrome-extension://","moz-extension://","safari-extension:","safari-web-extension:",Ib],tW=["__firefox__","__gCrWeb"];function E3(t,e){(e==null||e>t.length)&&(e=t.length);for(var n=0,r=Array(e);e>n;n++)r[n]=t[n];return r}function nW(t,e){return(function(n){if(Array.isArray(n))return n})(t)||(function(n,r){var s=n==null?null:typeof Symbol<"u"&&n[Symbol.iterator]||n["@@iterator"];if(s!=null){var i,o,l,c,d=[],f=!0,h=!1;try{if(l=(s=s.call(n)).next,r!==0)for(;!(f=(i=l.call(s)).done)&&(d.push(i.value),d.length!==r);f=!0);}catch(m){h=!0,o=m}finally{try{if(!f&&s.return!=null&&(c=s.return(),Object(c)!==c))return}finally{if(h)throw o}}return d}})(t,e)||(function(n,r){if(n){if(typeof n=="string")return E3(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)?E3(n,r):void 0}})(t,e)||(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 vM=Object.entries,C3=Object.setPrototypeOf,rW=Object.isFrozen,sW=Object.getPrototypeOf,iW=Object.getOwnPropertyDescriptor;let es=Object.freeze,rs=Object.seal,Md=Object.create,yM=typeof Reflect<"u"&&Reflect,Ob=yM.apply,Mb=yM.construct;es||(es=function(t){return t}),rs||(rs=function(t){return t}),Ob||(Ob=function(t,e){for(var n=arguments.length,r=new Array(n>2?n-2:0),s=2;n>s;s++)r[s-2]=arguments[s];return t.apply(e,r)}),Mb||(Mb=function(t){for(var e=arguments.length,n=new Array(e>1?e-1:0),r=1;e>r;r++)n[r-1]=arguments[r];return new t(...n)});const Cd=br([].forEach),oW=br([].lastIndexOf),P3=br([].pop),Pd=br([].push),aW=br([].splice),Dl=Array.isArray,rp=br("".toLowerCase),R2=br("".toString),A3=br("".match),Bh=br("".replace),T3=br("".indexOf),lW=br("".trim),cW=br(0 .toString),uW=br(Boolean.prototype.toString),R3=typeof BigInt>"u"?null:br(BigInt.prototype.toString),I3=typeof Symbol>"u"?null:br(Symbol.prototype.toString),Fr=br({}.hasOwnProperty),J0=br({}.toString),$r=br(/t/.test),Wc=(O3=TypeError,function(){for(var t=arguments.length,e=new Array(t),n=0;t>n;n++)e[n]=arguments[n];return Mb(O3,e)});var O3;function br(t){return function(e){e instanceof RegExp&&(e.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 Ob(t,e,r)}}function Bt(t,e){let n=arguments.length>2&&arguments[2]!==void 0?arguments[2]:rp;if(C3&&C3(t,null),!Dl(e))return t;let r=e.length;for(;r--;){let s=e[r];if(typeof s=="string"){const i=n(s);i!==s&&(rW(e)||(e[r]=i),s=i)}t[s]=!0}return t}function dW(t){for(let e=0;t.length>e;e++)Fr(t,e)||(t[e]=null);return t}function ms(t){const e=Md(null);for(const r of vM(t)){var n=nW(r,2);const s=n[0],i=n[1];Fr(t,s)&&(e[s]=Dl(i)?dW(i):i&&typeof i=="object"&&i.constructor===Object?ms(i):i)}return e}function po(t,e){for(;t!==null;){const n=iW(t,e);if(n){if(n.get)return br(n.get);if(typeof n.value=="function")return br(n.value)}t=sW(t)}return function(){return null}}const M3=es(["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"]),I2=es(["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"]),O2=es(["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"]),fW=es(["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"]),M2=es(["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"]),hW=es(["maction","maligngroup","malignmark","mlongdiv","mscarries","mscarry","msgroup","mstack","msline","msrow","semantics","annotation","annotation-xml","mprescripts","none"]),N3=es(["#text"]),L3=es(["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"]),N2=es(["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"]),D3=es(["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"]),eg=es(["xlink:href","xml:id","xlink:title","xml:space","xmlns:xlink"]),pW=rs(/{{[\w\W]*|^[\w\W]*}}/g),mW=rs(/<%[\w\W]*|^[\w\W]*%>/g),gW=rs(/\${[\w\W]*/g),vW=rs(/^data-[\-\w.\u00B7-\uFFFF]+$/),yW=rs(/^aria-[\-\w]+$/),$3=rs(/^(?:(?:(?:f|ht)tps?|mailto|tel|callto|sms|cid|xmpp|matrix):|[^a-z]|[a-z+.\-]+(?:[^a-z+.\-:]|$))/i),_W=rs(/^(?:\w+script|data):/i),wW=rs(/[\u0000-\u0020\u00A0\u1680\u180E\u2000-\u2029\u205F\u3000]/g),bW=rs(/^html$/i),xW=rs(/^[a-z][.\w]*(-[.\w]+)+$/i),j3=rs(/<[/\w!]/g),F3=rs(/<[/\w]/g),SW=rs(/<\/no(script|embed|frames)/i),kW=rs(/\/>/i),EW=function(){return typeof window>"u"?null:window},Tl=function(t,e,n,r){return Fr(t,e)&&Dl(t[e])?Bt(r.base?ms(r.base):{},t[e],r.transform):n};var CW=(function t(){let e=arguments.length>0&&arguments[0]!==void 0?arguments[0]:EW();const n=F=>t(F);if(n.version="3.4.13",n.removed=[],!e||!e.document||e.document.nodeType!==9||!e.Element)return n.isSupported=!1,n;let r=e.document;const s=r,i=s.currentScript,o=e.HTMLTemplateElement,l=e.Node,c=e.NodeFilter,d=e.DOMParser,f=e.trustedTypes,h=e.Element.prototype,m=po(h,"cloneNode"),v=po(h,"remove"),_=po(h,"nextSibling"),y=po(h,"childNodes"),w=po(h,"parentNode"),x=po(h,"shadowRoot"),k=po(h,"attributes"),P=l&&l.prototype?po(l.prototype,"nodeType"):null,C=l&&l.prototype?po(l.prototype,"nodeName"):null,T=l&&l.prototype?po(l.prototype,"ownerDocument"):null;if(typeof o=="function"){const F=r.createElement("template");F.content&&F.content.ownerDocument&&(r=F.content.ownerDocument)}let O,I,R="",N=!1,L=0;const z=function(){if(L>0)throw Wc('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.')},$=function(F){z(),L++;try{return O.createHTML(F)}finally{L--}},G=r.implementation,X=r.createNodeIterator,q=r.createDocumentFragment,H=r.getElementsByTagName,ee=s.importNode;let V={afterSanitizeAttributes:[],afterSanitizeElements:[],afterSanitizeShadowDOM:[],beforeSanitizeAttributes:[],beforeSanitizeElements:[],beforeSanitizeShadowDOM:[],uponSanitizeAttribute:[],uponSanitizeElement:[],uponSanitizeShadowNode:[]};n.isSupported=typeof vM=="function"&&typeof w=="function"&&G&&G.createHTMLDocument!==void 0;const Q=pW,U=mW,D=gW,K=vW,de=yW,ie=_W,ce=wW,he=xW;let xe=$3,oe=null;const re=Bt({},[...M3,...I2,...O2,...M2,...N3]);let Se=null;const ze=Bt({},[...L3,...N2,...D3,...eg]);let ke=Object.seal(Md(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}})),gt=null,on=null;const Tt=Object.seal(Md(null,{tagCheck:{writable:!0,configurable:!1,enumerable:!0,value:null},attributeCheck:{writable:!0,configurable:!1,enumerable:!0,value:null}}));let $t=!0,xt=!0,An=!1,Be=!0,je=!1,Ie=!0,nt=!1,St=!1,Ce=null,Ot=null,Qt=!1,Et=!1,Ur=!1,ai=!1,ss=!0,Br=!1;const Ri="user-content-";let Tn=!0,ur=!1,is={},dr=null;const Ii=Bt({},["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 Un=null;const Oi=Bt({},["audio","video","img","source","image","track"]);let ks=null;const nr=Bt({},["alt","class","for","id","label","name","pattern","placeholder","role","summary","title","value","style","xmlns"]),xr="http://www.w3.org/1998/Math/MathML",Mi="http://www.w3.org/2000/svg",Sr="http://www.w3.org/1999/xhtml";let os=Sr,rt=!1,qt=null;const Gt=Bt({},[xr,Mi,Sr],R2),ln=es(["mi","mo","mn","ms","mtext"]);let Zr=Bt({},ln);const kn=es(["annotation-xml"]);let cn=Bt({},kn);const as=Bt({},["title","style","font","a","script"]);let Wr=null;const kr=["application/xhtml+xml","text/html"];let Ut=null,Bn=null;const Ac=r.createElement("form"),pa=function(F){return F instanceof RegExp||F instanceof Function},li=function(){let F=arguments.length>0&&arguments[0]!==void 0?arguments[0]:{};if(Bn&&Bn===F)return;F&&typeof F=="object"||(F={}),F=ms(F),Wr=kr.indexOf(F.PARSER_MEDIA_TYPE)===-1?"text/html":F.PARSER_MEDIA_TYPE,Ut=Wr==="application/xhtml+xml"?R2:rp,oe=Tl(F,"ALLOWED_TAGS",re,{transform:Ut}),Se=Tl(F,"ALLOWED_ATTR",ze,{transform:Ut}),qt=Tl(F,"ALLOWED_NAMESPACES",Gt,{transform:R2}),ks=Tl(F,"ADD_URI_SAFE_ATTR",nr,{transform:Ut,base:nr}),Un=Tl(F,"ADD_DATA_URI_TAGS",Oi,{transform:Ut,base:Oi}),dr=Tl(F,"FORBID_CONTENTS",Ii,{transform:Ut}),gt=Tl(F,"FORBID_TAGS",ms({}),{transform:Ut}),on=Tl(F,"FORBID_ATTR",ms({}),{transform:Ut}),is=!!Fr(F,"USE_PROFILES")&&(F.USE_PROFILES&&typeof F.USE_PROFILES=="object"?ms(F.USE_PROFILES):F.USE_PROFILES),$t=F.ALLOW_ARIA_ATTR!==!1,xt=F.ALLOW_DATA_ATTR!==!1,An=F.ALLOW_UNKNOWN_PROTOCOLS||!1,Be=F.ALLOW_SELF_CLOSE_IN_ATTR!==!1,je=F.SAFE_FOR_TEMPLATES||!1,Ie=F.SAFE_FOR_XML!==!1,nt=F.WHOLE_DOCUMENT||!1,Et=F.RETURN_DOM||!1,Ur=F.RETURN_DOM_FRAGMENT||!1,ai=F.RETURN_TRUSTED_TYPE||!1,Qt=F.FORCE_BODY||!1,ss=F.SANITIZE_DOM!==!1,Br=F.SANITIZE_NAMED_PROPS||!1,Tn=F.KEEP_CONTENT!==!1,ur=F.IN_PLACE||!1,xe=(function(ge){try{return $r(ge,""),!0}catch{return!1}})(F.ALLOWED_URI_REGEXP)?F.ALLOWED_URI_REGEXP:$3,os=typeof F.NAMESPACE=="string"?F.NAMESPACE:Sr,Zr=Fr(F,"MATHML_TEXT_INTEGRATION_POINTS")&&F.MATHML_TEXT_INTEGRATION_POINTS&&typeof F.MATHML_TEXT_INTEGRATION_POINTS=="object"?ms(F.MATHML_TEXT_INTEGRATION_POINTS):Bt({},ln),cn=Fr(F,"HTML_INTEGRATION_POINTS")&&F.HTML_INTEGRATION_POINTS&&typeof F.HTML_INTEGRATION_POINTS=="object"?ms(F.HTML_INTEGRATION_POINTS):Bt({},kn);const pe=Fr(F,"CUSTOM_ELEMENT_HANDLING")&&F.CUSTOM_ELEMENT_HANDLING&&typeof F.CUSTOM_ELEMENT_HANDLING=="object"?ms(F.CUSTOM_ELEMENT_HANDLING):Md(null);if(ke=Md(null),Fr(pe,"tagNameCheck")&&pa(pe.tagNameCheck)&&(ke.tagNameCheck=pe.tagNameCheck),Fr(pe,"attributeNameCheck")&&pa(pe.attributeNameCheck)&&(ke.attributeNameCheck=pe.attributeNameCheck),Fr(pe,"allowCustomizedBuiltInElements")&&typeof pe.allowCustomizedBuiltInElements=="boolean"&&(ke.allowCustomizedBuiltInElements=pe.allowCustomizedBuiltInElements),rs(ke),je&&(xt=!1),Ur&&(Et=!0),is&&(oe=Bt({},N3),Se=Md(null),is.html===!0&&(Bt(oe,M3),Bt(Se,L3)),is.svg===!0&&(Bt(oe,I2),Bt(Se,N2),Bt(Se,eg)),is.svgFilters===!0&&(Bt(oe,O2),Bt(Se,N2),Bt(Se,eg)),is.mathMl===!0&&(Bt(oe,M2),Bt(Se,D3),Bt(Se,eg))),Tt.tagCheck=null,Tt.attributeCheck=null,Fr(F,"ADD_TAGS")&&(typeof F.ADD_TAGS=="function"?Tt.tagCheck=F.ADD_TAGS:Dl(F.ADD_TAGS)&&(oe===re&&(oe=ms(oe)),Bt(oe,F.ADD_TAGS,Ut))),Fr(F,"ADD_ATTR")&&(typeof F.ADD_ATTR=="function"?Tt.attributeCheck=F.ADD_ATTR:Dl(F.ADD_ATTR)&&(Se===ze&&(Se=ms(Se)),Bt(Se,F.ADD_ATTR,Ut))),Fr(F,"ADD_URI_SAFE_ATTR")&&Dl(F.ADD_URI_SAFE_ATTR)&&Bt(ks,F.ADD_URI_SAFE_ATTR,Ut),Fr(F,"FORBID_CONTENTS")&&Dl(F.FORBID_CONTENTS)&&(dr===Ii&&(dr=ms(dr)),Bt(dr,F.FORBID_CONTENTS,Ut)),Fr(F,"ADD_FORBID_CONTENTS")&&Dl(F.ADD_FORBID_CONTENTS)&&(dr===Ii&&(dr=ms(dr)),Bt(dr,F.ADD_FORBID_CONTENTS,Ut)),Tn&&(oe["#text"]=!0),nt&&Bt(oe,["html","head","body"]),oe.table&&(Bt(oe,["tbody"]),delete gt.tbody),F.TRUSTED_TYPES_POLICY){if(typeof F.TRUSTED_TYPES_POLICY.createHTML!="function")throw Wc('TRUSTED_TYPES_POLICY configuration option must provide a "createHTML" hook.');if(typeof F.TRUSTED_TYPES_POLICY.createScriptURL!="function")throw Wc('TRUSTED_TYPES_POLICY configuration option must provide a "createScriptURL" hook.');const ge=O;O=F.TRUSTED_TYPES_POLICY;try{R=$("")}catch(Pe){throw O=ge,Pe}}else F.TRUSTED_TYPES_POLICY===null?(O=void 0,R=""):(O===void 0&&(N||(I=(function(ge,Pe){if(typeof ge!="object"||typeof ge.createPolicy!="function")return null;let Ke=null;const ft="data-tt-policy-suffix";Pe&&Pe.hasAttribute(ft)&&(Ke=Pe.getAttribute(ft));const Ct="dompurify"+(Ke?"#"+Ke:"");try{return ge.createPolicy(Ct,{createHTML:jt=>jt,createScriptURL:jt=>jt})}catch{return console.warn("TrustedTypes policy "+Ct+" could not be created."),null}})(f,i),N=!0),O=I),O&&typeof R=="string"&&(R=$("")));es&&es(F),Bn=F},qr=Bt({},[...I2,...O2,...fW]),al=Bt({},[...M2,...hW]),ls=function(F){Pd(n.removed,{element:F});try{w(F).removeChild(F)}catch{if(v(F),!w(F))throw Wc("a node selected for removal could not be detached from its tree and cannot be safely returned; refusing to sanitize in place")}},Ni=function(F){To(F);const pe=y(F);if(pe){const Pe=[];Cd(pe,Ke=>{Pd(Pe,Ke)}),Cd(Pe,Ke=>{try{v(Ke)}catch{}})}const ge=k(F);if(ge)for(let Pe=ge.length-1;Pe>=0;--Pe){const Ke=ge[Pe],ft=Ke&&Ke.name;if(typeof ft=="string")try{F.removeAttribute(ft)}catch{}}},Li=function(F,pe){try{Pd(n.removed,{attribute:pe.getAttributeNode(F),from:pe})}catch{Pd(n.removed,{attribute:null,from:pe})}if(pe.removeAttribute(F),F==="is")if(Et||Ur)try{ls(pe)}catch{}else try{pe.setAttribute(F,"")}catch{}},ma=function(F){const pe=k(F);if(pe)for(let ge=pe.length-1;ge>=0;--ge){const Pe=pe[ge],Ke=Pe&&Pe.name;if(typeof Ke=="string"&&!Se[Ut(Ke)])try{F.removeAttribute(Ke)}catch{}}},To=function(F){const pe=[F];for(;pe.length>0;){const ge=pe.pop();(P?P(ge):ge.nodeType)===1&&ma(ge);const Pe=y(ge);if(Pe)for(let Ke=Pe.length-1;Ke>=0;--Ke)pe.push(Pe[Ke])}},Tc=function(F){let pe=null,ge=null;if(Qt)F="<remove></remove>"+F;else{const ft=A3(F,/^[\r\n\t ]+/);ge=ft&&ft[0]}Wr==="application/xhtml+xml"&&os===Sr&&(F='<html xmlns="http://www.w3.org/1999/xhtml"><head></head><body>'+F+"</body></html>");const Pe=O?$(F):F;if(os===Sr)try{pe=new d().parseFromString(Pe,Wr)}catch{}if(!pe||!pe.documentElement){pe=G.createDocument(os,"template",null);try{pe.documentElement.innerHTML=rt?R:Pe}catch{}}const Ke=pe.body||pe.documentElement;return F&&ge&&Ke.insertBefore(r.createTextNode(ge),Ke.childNodes[0]||null),os===Sr?H.call(pe,nt?"html":"body")[0]:nt?pe.documentElement:Ke},Bu=function(F){const pe=T?T(F):F.ownerDocument;return X.call(pe||F,F,c.SHOW_ELEMENT|c.SHOW_COMMENT|c.SHOW_TEXT|c.SHOW_PROCESSING_INSTRUCTION|c.SHOW_CDATA_SECTION,null)},Ro=function(F){return F=Bh(F,Q," "),F=Bh(F,U," "),Bh(F,D," ")},un=function(F){var pe;F.normalize();const ge=T?T(F):F.ownerDocument,Pe=X.call(ge||F,F,c.SHOW_TEXT|c.SHOW_COMMENT|c.SHOW_CDATA_SECTION|c.SHOW_PROCESSING_INSTRUCTION,null);let Ke=Pe.nextNode();for(;Ke;)Ke.data=Ro(Ke.data),Ke=Pe.nextNode();const ft=(pe=F.querySelectorAll)===null||pe===void 0?void 0:pe.call(F,"template");ft&&Cd(ft,Ct=>{Di(Ct.content)&&un(Ct.content)})},ga=function(F){const pe=C?C(F):null;return typeof pe=="string"&&Ut(pe)==="form"&&(typeof F.nodeName!="string"||typeof F.textContent!="string"||typeof F.removeChild!="function"||F.attributes!==k(F)||typeof F.removeAttribute!="function"||typeof F.setAttribute!="function"||typeof F.namespaceURI!="string"||typeof F.insertBefore!="function"||typeof F.hasChildNodes!="function"||F.nodeType!==P(F)||F.childNodes!==y(F))},Di=function(F){if(!P||typeof F!="object"||F===null)return!1;try{return P(F)===11}catch{return!1}},Io=function(F){if(!P||typeof F!="object"||F===null)return!1;try{return typeof P(F)=="number"}catch{return!1}};function Or(F,pe,ge){F.length!==0&&Cd(F,Pe=>{Pe.call(n,pe,ge,Bn)})}const Zu=function(F,pe,ge,Pe){return F.length===0?pe:pe===ge||pe===Pe?ms(pe):pe},Rc=function(F,pe){if(Or(V.beforeSanitizeElements,F,null),F!==pe&&w(F)===null)return ur&&To(F),!0;if(ga(F))return ls(F),!0;const ge=Ut(C?C(F):F.nodeName);if(oe=Zu(V.uponSanitizeElement,oe,re,Ce),Or(V.uponSanitizeElement,F,{tagName:ge,allowedTags:oe}),F!==pe&&w(F)===null)return ur&&To(F),!0;if((function(Pe,Ke){return!!(Ie&&Pe.hasChildNodes()&&!Io(Pe.firstElementChild)&&$r(j3,Pe.textContent)&&$r(j3,Pe.innerHTML))||!(!Ie||Pe.namespaceURI!==Sr||Ke!=="style"||!Io(Pe.firstElementChild))||Pe.nodeType===7||!(!Ie||Pe.nodeType!==8||!$r(F3,Pe.data))})(F,ge))return ls(F),!0;if(gt[ge]||!(Tt.tagCheck instanceof Function&&Tt.tagCheck(ge))&&!oe[ge]){const Pe=(function(Ke,ft,Ct){if(!gt[ft]&&Wu(ft)&&(ke.tagNameCheck instanceof RegExp&&$r(ke.tagNameCheck,ft)||ke.tagNameCheck instanceof Function&&ke.tagNameCheck(ft)))return!1;if(Tn&&!dr[ft]){const jt=w(Ke),an=y(Ke);if(an&&jt)for(let vt=an.length-1;vt>=0;--vt){const $n=Ke===Ct?m(an[vt],!0):an[vt];jt.insertBefore($n,_(Ke))}}return ls(Ke),!0})(F,ge,pe);return Pe===!1&&Or(V.afterSanitizeElements,F,null),Pe}if((P?P(F):F.nodeType)===1&&!(function(Pe){let Ke=w(Pe);Ke&&Ke.tagName||(Ke={namespaceURI:os,tagName:"template"});const ft=rp(Pe.tagName),Ct=rp(Ke.tagName);return!!qt[Pe.namespaceURI]&&(Pe.namespaceURI===Mi?(function(jt,an,vt){return an.namespaceURI===Sr?jt==="svg":an.namespaceURI===xr?jt==="svg"&&(vt==="annotation-xml"||Zr[vt]):!!qr[jt]})(ft,Ke,Ct):Pe.namespaceURI===xr?(function(jt,an,vt){return an.namespaceURI===Sr?jt==="math":an.namespaceURI===Mi?jt==="math"&&cn[vt]:!!al[jt]})(ft,Ke,Ct):Pe.namespaceURI===Sr?(function(jt,an,vt){return!(an.namespaceURI===Mi&&!cn[vt])&&!(an.namespaceURI===xr&&!Zr[vt])&&!al[jt]&&(as[jt]||!qr[jt])})(ft,Ke,Ct):!(Wr!=="application/xhtml+xml"||!qt[Pe.namespaceURI]))})(F)||(ge==="noscript"||ge==="noembed"||ge==="noframes")&&$r(SW,F.innerHTML))return ls(F),!0;if(je&&F.nodeType===3){const Pe=Ro(F.textContent);F.textContent!==Pe&&(Pd(n.removed,{element:F.cloneNode()}),F.textContent=Pe)}return Or(V.afterSanitizeElements,F,null),!1},io=function(F,pe,ge){if(on[pe]||Ie&&pe==="patchsrc"||Ie&&pe==="for"&&F!=="label"&&F!=="output"||ss&&(pe==="id"||pe==="name")&&(ge in r||ge in Ac))return!1;const Pe=Se[pe]||Tt.attributeCheck instanceof Function&&Tt.attributeCheck(pe,F);if(!(xt&&$r(K,pe))){if(!($t&&$r(de,pe))){if(Pe){if(!ks[pe]){if(!$r(xe,Bh(ge,ce,""))){if((pe!=="src"&&pe!=="xlink:href"&&pe!=="href"||F==="script"||T3(ge,"data:")!==0||!Un[F])&&!(An&&!$r(ie,Bh(ge,ce,"")))){if(ge)return!1}}}}else if(!(Wu(F)&&(ke.tagNameCheck instanceof RegExp&&$r(ke.tagNameCheck,F)||ke.tagNameCheck instanceof Function&&ke.tagNameCheck(F))&&(ke.attributeNameCheck instanceof RegExp&&$r(ke.attributeNameCheck,pe)||ke.attributeNameCheck instanceof Function&&ke.attributeNameCheck(pe,F))||pe==="is"&&ke.allowCustomizedBuiltInElements&&(ke.tagNameCheck instanceof RegExp&&$r(ke.tagNameCheck,ge)||ke.tagNameCheck instanceof Function&&ke.tagNameCheck(ge))))return!1}}return!0},$s=Bt({},["annotation-xml","color-profile","font-face","font-face-format","font-face-name","font-face-src","font-face-uri","missing-glyph"]),Wu=function(F){return!$s[rp(F)]&&$r(he,F)},Es=function(F,pe,ge,Pe){if(O&&typeof f=="object"&&typeof f.getAttributeType=="function"&&!ge)switch(f.getAttributeType(F,pe)){case"TrustedHTML":return $(Pe);case"TrustedScriptURL":return(function(Ke){z(),L++;try{return O.createScriptURL(Ke)}finally{L--}})(Pe)}return Pe},ih=function(F,pe,ge,Pe){try{ge?F.setAttributeNS(ge,pe,Pe):F.setAttribute(pe,Pe),ga(F)?ls(F):P3(n.removed)}catch{Li(pe,F)}},ll=function(F){Or(V.beforeSanitizeAttributes,F,null);const pe=F.attributes;if(!pe||ga(F))return;Se=Zu(V.uponSanitizeAttribute,Se,ze,Ot);const ge={attrName:"",attrValue:"",keepAttr:!0,allowedAttributes:Se,forceKeepAttr:void 0};let Pe=pe.length;const Ke=Ut(F.nodeName);for(;Pe--;){const ft=pe[Pe],Ct=ft.name,jt=ft.namespaceURI,an=ft.value,vt=Ut(Ct),$n=an;let ot=Ct==="value"?$n:lW($n);ge.attrName=vt,ge.attrValue=ot,ge.keepAttr=!0,ge.forceKeepAttr=void 0,Or(V.uponSanitizeAttribute,F,ge),ot=ge.attrValue,!Br||vt!=="id"&&vt!=="name"||T3(ot,Ri)===0||(Li(Ct,F),ot=Ri+ot),Ie&&$r(/((--!?|])>)|<\/(style|script|title|xmp|textarea|noscript|iframe|noembed|noframes)/i,ot)||vt==="attributename"&&A3(ot,"href")?Li(Ct,F):ge.forceKeepAttr||(!ge.keepAttr||!Be&&$r(kW,ot)?Li(Ct,F):(je&&(ot=Ro(ot)),io(Ke,vt,ot)?(ot=Es(Ke,vt,jt,ot),ot!==$n&&ih(F,Ct,jt,ot)):Li(Ct,F)))}Or(V.afterSanitizeAttributes,F,null)},cl=function(F){let pe=null;const ge=Bu(F);for(Or(V.beforeSanitizeShadowDOM,F,null);pe=ge.nextNode();)if(Or(V.uponSanitizeShadowNode,pe,null),Rc(pe,F),ll(pe),Di(pe.content)&&cl(pe.content),(P?P(pe):pe.nodeType)===1){const Pe=x(pe);Di(Pe)&&(Oo(Pe),cl(Pe))}Or(V.afterSanitizeShadowDOM,F,null)},Oo=function(F){const pe=[{node:F,shadow:null}];for(;pe.length>0;){const ge=pe.pop();if(ge.shadow){cl(ge.shadow);continue}const Pe=ge.node,Ke=(P?P(Pe):Pe.nodeType)===1,ft=y(Pe);if(ft)for(let Ct=ft.length-1;Ct>=0;--Ct)pe.push({node:ft[Ct],shadow:null});if(Ke){const Ct=C?C(Pe):null;if(typeof Ct=="string"&&Ut(Ct)==="template"){const jt=Pe.content;Di(jt)&&pe.push({node:jt,shadow:null})}}if(Ke){const Ct=x(Pe);Di(Ct)&&pe.push({node:null,shadow:Ct},{node:Ct,shadow:null})}}};return n.sanitize=function(F){let pe=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{},ge=null,Pe=null,Ke=null,ft=null;if(rt=!F,rt&&(F="<!-->"),typeof F!="string"&&!Io(F)&&typeof(F=(function(vt){switch(typeof vt){case"string":return vt;case"number":return cW(vt);case"boolean":return uW(vt);case"bigint":return R3?R3(vt):"0";case"symbol":return I3?I3(vt):"Symbol()";case"undefined":default:return J0(vt);case"function":case"object":{if(vt===null)return J0(vt);const $n=vt,ot=po($n,"toString");if(typeof ot=="function"){const Gr=ot($n);return typeof Gr=="string"?Gr:J0(Gr)}return J0(vt)}}})(F))!="string")throw Wc("dirty is not a string, aborting");if(!n.isSupported)return F;St?(oe=Ce,Se=Ot):li(pe),(V.uponSanitizeElement.length>0||V.uponSanitizeAttribute.length>0)&&(oe=ms(oe)),V.uponSanitizeAttribute.length>0&&(Se=ms(Se)),n.removed=[];const Ct=ur&&typeof F!="string"&&Io(F);if(Ct){(function($n){if(!Ie)return;const ot=[$n];for(;ot.length>0;){const Gr=ot.pop(),va=P?P(Gr):Gr.nodeType;if(va===7||va===8&&$r(F3,Gr.data)){try{v(Gr)}catch{}continue}if(va===1){const Mr=Gr,ul=Ut(C?C(Gr):Gr.nodeName);try{Mr.hasAttribute&&Mr.hasAttribute("patchsrc")&&Mr.removeAttribute("patchsrc"),Mr.hasAttribute&&Mr.hasAttribute("for")&&ul!=="label"&&ul!=="output"&&Mr.removeAttribute("for")}catch{}}const $i=y(Gr);if($i)for(let Mr=$i.length-1;Mr>=0;--Mr)ot.push($i[Mr])}})(F);const vt=C?C(F):F.nodeName;if(typeof vt=="string"){const $n=Ut(vt);if(!oe[$n]||gt[$n])throw Ni(F),Wc("root node is forbidden and cannot be sanitized in-place")}if(ga(F))throw Ni(F),Wc("root node is clobbered and cannot be sanitized in-place");try{Oo(F)}catch($n){throw Ni(F),$n}}else if(Io(F))ge=Tc("<!---->"),Pe=ge.ownerDocument.importNode(F,!0),Pe.nodeType===1&&Pe.nodeName==="BODY"||Pe.nodeName==="HTML"?ge=Pe:ge.appendChild(Pe),Oo(Pe);else{if(!Et&&!je&&!nt&&F.indexOf("<")===-1)return O&&ai?$(F):F;if(ge=Tc(F),!ge)return Et?null:ai?R:""}ge&&Qt&&ls(ge.firstChild);const jt=Ct?F:ge;try{const vt=Bu(jt);for(;Ke=vt.nextNode();)Rc(Ke,jt),ll(Ke),Di(Ke.content)&&cl(Ke.content)}catch(vt){throw Ct&&(Ni(F),Cd(n.removed,$n=>{$n.element&&To($n.element)})),vt}if(Ct)return Cd(n.removed,vt=>{vt.element&&To(vt.element)}),je&&un(F),F;if(Et){if(je&&un(ge),Ur)for(ft=q.call(ge.ownerDocument);ge.firstChild;)ft.appendChild(ge.firstChild);else ft=ge;return(Se.shadowroot||Se.shadowrootmode)&&(ft=ee.call(s,ft,!0)),ft}let an=nt?ge.outerHTML:ge.innerHTML;return nt&&oe["!doctype"]&&ge.ownerDocument&&ge.ownerDocument.doctype&&ge.ownerDocument.doctype.name&&$r(bW,ge.ownerDocument.doctype.name)&&(an="<!DOCTYPE "+ge.ownerDocument.doctype.name+`>
|
|
20
|
-
`+an),je&&(an=Ro(an)),O&&ai?$(an):an},n.setConfig=function(){li(arguments.length>0&&arguments[0]!==void 0?arguments[0]:{}),St=!0,Ce=oe,Ot=Se},n.clearConfig=function(){Bn=null,St=!1,Ce=null,Ot=null,O=I,R=""},n.isValidAttribute=function(F,pe,ge){Bn||li({});const Pe=Ut(F),Ke=Ut(pe);return io(Pe,Ke,ge)},n.addHook=function(F,pe){typeof pe=="function"&&Fr(V,F)&&Pd(V[F],pe)},n.removeHook=function(F,pe){if(Fr(V,F)){if(pe!==void 0){const ge=oW(V[F],pe);return ge===-1?void 0:aW(V[F],ge,1)[0]}return P3(V[F])}},n.removeHooks=function(F){Fr(V,F)&&(V[F]=[])},n.removeAllHooks=function(){V={afterSanitizeAttributes:[],afterSanitizeElements:[],afterSanitizeShadowDOM:[],beforeSanitizeAttributes:[],beforeSanitizeElements:[],beforeSanitizeShadowDOM:[],uponSanitizeAttribute:[],uponSanitizeElement:[],uponSanitizeShadowNode:[]}},n})();const z3="Refusing to render web experiment since the viewer is a likely bot",V3={ADD_ATTR:(t,e)=>t==="target"&&e==="a"||t==="form"&&/^(button|fieldset|input|output|select|textarea)$/.test(e),ADD_URI_SAFE_ATTR:["form"]};let H3;const PW={icontains:(t,e)=>e.toLowerCase().indexOf(t.toLowerCase())>-1,not_icontains:(t,e)=>e.toLowerCase().indexOf(t.toLowerCase())===-1,regex:(t,e)=>Iv(e,t),not_regex:(t,e)=>!Iv(e,t),exact:(t,e)=>e===t,is_not:(t,e)=>e!==t},Zi=Pn("[Conversations]"),qc="Conversations not available yet.";function U3(t,e){var n,r,s,i,o,l,c;const d=(n=t==null?void 0:t.flushIntervalMs)!==null&&n!==void 0?n:3e3,f=(r=t==null?void 0:t.maxBufferSize)!==null&&r!==void 0?r:100,h=e!=null&&e.consoleCapture?void 0:(s=t==null?void 0:t.maxLogsPerInterval)!==null&&s!==void 0?s:1e3,m=ue(h)?Math.max(f,2048):Math.max(f,h),v=j(j({},(function(){let _="",y="";try{var w;const x="u">typeof globalThis?globalThis:"u">typeof window?window:void 0,k=x==null||(w=x.navigator)===null||w===void 0?void 0:w.userAgent;k&&([_,y]=kO(k))}catch{}return(function(x,k){const P=(function(C){if(C)return{}.hasOwnProperty.call(gP,C)?gP[C]:C})(x);return j(j({},P?{"os.name":P}:{}),k?{"os.version":k}:{})})(_,y)})()),t==null?void 0:t.resourceAttributes);return{serviceName:(i=(o=v==null?void 0:v["service.name"])!==null&&o!==void 0?o:t==null?void 0:t.serviceName)!==null&&i!==void 0?i:e==null?void 0:e.serviceNameDefault,serviceVersion:(l=v==null?void 0:v["service.version"])!==null&&l!==void 0?l:t==null?void 0:t.serviceVersion,environment:(c=v==null?void 0:v["deployment.environment"])!==null&&c!==void 0?c:t==null?void 0:t.environment,resourceAttributes:v,beforeSend:t==null?void 0:t.beforeSend,flushIntervalMs:d,maxBufferSize:f,maxQueueSize:m,maxBatchRecordsPerPost:100,rateCapWindowMs:d,maxLogsPerInterval:h,backgroundFlushBudgetMs:0,terminationFlushBudgetMs:0}}const AW=["debug","log","warn","error","info"],TW=t=>{for(;t!=null&&t.__rrweb_original__;)t=t.__rrweb_original__;return t},B3="console",_M="__posthogHandledLogsRequestError",L2=(t,e)=>{const n=t instanceof Error?t:new Error(e);return n[_M]=!0,n},Z3=t=>!!t&&typeof t=="object"&&t[_M]===!0;var RW=class{get qv(){return j(j({},this.A),{},{error:(...t)=>{t.some(Z3)||this.A.error(...t)}})}constructor(t,e){var n;this.Aa=t,this.Bv=e,this.name="logs",this.zv=!1,this.Hv=!1,this.Uv=!1,this.A=Pn("[logs]"),this.nc=[],this.Wv=[],this.zd=0,this.Vv=!1,this.Ti=!1,this.Gv=[],this.Qv=[],this.Jv=!1,this.Zv=!1,this.Kv=!1,this.Yv=()=>{var r,s;this.Ti||(this.zd=0,(r=this.Xv)===null||r===void 0||r.onReconnect(),(s=this.tf)===null||s===void 0||s.onReconnect())},this.zv=!!(!((n=t.get())===null||n===void 0)&&n.captureConsoleLogs)}get ef(){return!0}if(){}nf(){if(!this.Kv){try{this.iv=typeof window>"u"?void 0:window}catch{this.iv=void 0}this.iv&&(Dt(this.iv,"online",this.Yv),this.Kv=!0)}}sf(t,e,n,r){this.nf();const s=U3(this.Aa.get(),n);return[new GU(this.rf(t,e),s,this.qv,()=>this.Bv(),i=>i(),void 0,r),s]}af(){const t=this.Aa.get();var e;return this.Xv&&this.lf===t||((e=this.Xv)===null||e===void 0||e.reset(),this.lf=t,[this.Xv,this.uf]=this.sf(()=>this.nc,n=>{this.nc=n})),this.Xv}cf(){const t=this.Aa.get();var e;return this.tf&&this.hf===t||((e=this.tf)===null||e===void 0||e.reset(),this.hf=t,[this.tf,this.df]=this.sf(()=>this.Wv,n=>{this.Wv=n},{serviceNameDefault:"posthog-browser-logs",consoleCapture:!0},B3)),this.tf}setup(t){if(!this.Ti&&!this.Vv)return this.Vv=!0,this.Ia=t,this.A=t.logger.createLogger("[logs]"),ok(t.kv.initialize(),()=>{this.Ti||this.nv(t)})}nv(t){var e;this.nf(),!((e=this.Aa.get())===null||e===void 0)&&e.captureConsoleLogs&&(this.zv=!0),(this.zv||this.Aa.remoteConfigWillArrive&&t.kv.get(this.Aa.captureHintKey))&&this.vf();let n=!1;const r=t.onRemoteConfig(s=>{var i;n=s.ok&&((i=s.config.logs)===null||i===void 0?void 0:i.captureConsoleLogs)===!0,this.onRemoteConfig(s)});this.Ti?r.dispose():(this.Ha=r,n||this.loadIfEnabled())}dispose(){var t,e,n,r,s,i,o;this.Ti||(this.Ti=!0,this.ff(),(t=this.Ha)===null||t===void 0||t.dispose(),this.Ha=void 0,this.Ia=void 0,this.Uv=!1,(e=this.iv)===null||e===void 0||e.removeEventListener("online",this.Yv),(n=this.pf)===null||n===void 0||n.call(this),this.pf=void 0,(r=this.Xv)===null||r===void 0||r.clearQueue(),(s=this.tf)===null||s===void 0||s.clearQueue(),(i=this.Xv)===null||i===void 0||i.reset(),(o=this.tf)===null||o===void 0||o.reset())}onRemoteConfig(t){var e,n;if(this.Ti)return;const r=t.ok?(e=t.config.logs)===null||e===void 0?void 0:e.captureConsoleLogs:void 0;at(r)?this.gf():((n=this.Ia)===null||n===void 0||n.kv.set(this.Aa.captureHintKey,!!r),r?(this.zv=!0,this.Hv||this.vf(),this.loadIfEnabled()):this.gf())}reset(){var t,e,n,r;this.ff(),(t=this.Xv)===null||t===void 0||t.clearQueue(),this.nc=[],(e=this.Xv)===null||e===void 0||e.reset(),(n=this.tf)===null||n===void 0||n.clearQueue(),this.Wv=[],(r=this.tf)===null||r===void 0||r.reset(),this.zd=0}captureLog(t){!this.Ti&&this.Ia&&this.af().captureLog(t)}captureConsoleLog(t){!this.Ti&&this.Ia&&this.cf().captureLog(t)}captureBufferedConsoleLog(t,e,n){!this.Ti&&this.Ia&&this.cf().captureLog(t,{context:e,occurredAtMs:n})}$d(){var t;this.ff(),(t=this.tf)===null||t===void 0||t.clearQueue(),this.Wv=[]}gf(){this.zv||this.ff()}vf(){var t;if(this.Jv||!(!((t=this.iv)===null||t===void 0)&&t.console))return;const e=U3(this.Aa.get()).maxBufferSize;let n=!0;this.Qv.push(()=>{n=!1});for(const r of AW){let s;try{s=TW(this.iv.console[r])}catch{continue}s&&this.Qv.push(Ef(this.iv.console,r,i=>{const o=(...l)=>{try{n&&this.mf(r,l,e)}catch{}return i.apply(this.iv.console,l)};return o.__rrweb_original__=s,o}))}this.Jv=!0,this.yf=setTimeout(()=>{this.ff()},3e4)}mf(t,e,n){var r;if(this.Jv&&!this.Zv&&e.length!==0)if(!((r=this.Ia)===null||r===void 0)&&r.canCapture){if(n>this.Gv.length){this.Zv=!0;try{this.Gv.push({level:t,args:e,occurredAtMs:Date.now(),context:this.Bv()})}finally{this.Zv=!1}}}else this.ff()}ff(){if(this.Gv=[],this.Jv){this.Jv=!1,this.yf&&(clearTimeout(this.yf),this.yf=void 0);for(const t of this.Qv)t();this.Qv=[]}}bf(){const t=this.Gv;return this.ff(),t}get logger(){return this._f||(this._f={trace:(t,e)=>this.captureLog({body:t,level:"trace",attributes:e}),debug:(t,e)=>this.captureLog({body:t,level:"debug",attributes:e}),info:(t,e)=>this.captureLog({body:t,level:"info",attributes:e}),warn:(t,e)=>this.captureLog({body:t,level:"warn",attributes:e}),error:(t,e)=>this.captureLog({body:t,level:"error",attributes:e}),fatal:(t,e)=>this.captureLog({body:t,level:"fatal",attributes:e})}),this._f}flushLogs(t){this.Ia&&(t?this.wf(t):(this.Xv&&this.Xv.flush().catch(e=>this.kf(e)),this.tf&&this.tf.flush().catch(e=>this.kf(e))))}flush(){var t=this;return hn(function*(){var e,n;const r=(e=t.Xv)===null||e===void 0?void 0:e.flush().catch(i=>t.kf(i)),s=(n=t.tf)===null||n===void 0?void 0:n.flush().catch(i=>t.kf(i));yield r,yield s})()}kf(t){Z3(t)||this.A.error("PostHog logs flush failed:",t)}loadIfEnabled(){if(this.Ti||!this.zv||this.Hv||this.Uv)return;const t=this.if();if(t){this.Uv=!0;try{t((e,n)=>{if(this.Uv=!1,!this.Ti&&this.zv)if(e||!n)this.A.error("Could not load logs script",e),this.ff();else{const r=this.bf();this.pf=n.initialize(this.Ia),this.Hv=!0,r.length>0&&n.replay(this.Ia,r)}})}catch(e){throw this.Uv=!1,e}}else this.ff()}rf(t,e){const n=this.Ia;return{get isDisabled(){return!1},get optedOut(){return!n.canCapture},getPersistedProperty:r=>r===Ho.LogsQueue?t():void 0,setPersistedProperty(r,s){r===Ho.LogsQueue&&e(s??[])},qs:r=>this.qs(r),getLibraryId:()=>n.library.name,getLibraryVersion:()=>n.library.version}}qs(t){return new Promise(e=>{if(M5(this.zd,3))return void e({kind:"fatal",error:L2(void 0,"logs endpoint is unreachable, dropping batch")});let n=!1;const r=o=>{n||(n=!0,clearTimeout(s),e(o))},s=setTimeout(()=>{this.A.warn("Logs request timed out before receiving a response"),r({kind:"retry-later",error:L2(void 0,"logs request timed out")})},9e4),i=this.ef;this.Ia.sendRequest("/i/v1/logs",{method:"POST",query:{token:this.Ia.projectToken},body:t,compression:"best-available",timeoutMs:6e4}).then(o=>{var l;const c=o.statusCode;this.Sf(c,i),c>=200&&300>c?r({kind:"ok"}):c===413?r({kind:"too-large"}):c!==0&&c!==408&&c!==429&&500>c?r({kind:"fatal",error:new Error(`logs request failed with status ${c}`)}):c===0?(o.error||this.A.warn("Logs request failed before receiving an HTTP response"),r({kind:"retry-later",error:L2(o.error,"logs request failed before receiving an HTTP response")})):r({kind:"retry-later",error:(l=o.error)!==null&&l!==void 0?l:new Error(`logs request failed with status ${c}`)})},o=>{r({kind:"retry-later",error:o})})})}Sf(t,e){(t!==0||e)&&(this.zd=N5(t,this.zd,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.")))}wf(t){this.nc.length>0&&this.xf(t,this.nc,this.uf,this.Ia.library.name,e=>{this.nc=e}),this.Wv.length>0&&this.xf(t,this.Wv,this.df,B3,e=>{this.Wv=e})}xf(t,e,n,r,s){if(e.length===0)return;const i=e.map(l=>l.record);s([]);const o=qO(i,WO(n,this.Ia.library.name,this.Ia.library.version),r,this.Ia.library.version);this.Ia.sendRequest("/i/v1/logs",{method:"POST",query:{token:this.Ia.projectToken},body:o,compression:"best-available",transport:t,timeoutMs:6e4}).catch(l=>this.kf(l))}};const Ov=Pn("[NetworkMetrics]"),ak=()=>{var t;return!(le==null||(t=le.performance)===null||t===void 0)&&t.now?le.performance.now():Date.now()},IW={"http:":80,"https:":443},OW=new Set(["CONNECT","DELETE","GET","HEAD","OPTIONS","PATCH","POST","PUT","TRACE"]),wM=(t,e)=>{var n;const r=String(e);return{method:String(t).toUpperCase(),url:((n=Ya(r))===null||n===void 0?void 0:n.href)||r}},Nb=(t,e,n,r,s,i,o=!1)=>{try{var l,c;const d=s();if(!d)return;const f=n||void 0,h=ak()-r,m=Ya(e.url);if(m&&m.protocol!=="http:"&&m.protocol!=="https:")return;const v={url:(m==null?void 0:m.href)||e.url,method:e.method},_=zn(d.name)?d.name(v):ht(d.name)?d.name:"http.client.request.duration";if(!_)return;const y=o&&!f?void 0:((x,k)=>x?400>x?void 0:String(x):(k==null?void 0:k.name)||"_OTHER")(f,i),w=j(j(j(j(j({},(x=>{const k=OW.has(x)?x:"_OTHER";return j({"http.request.method":k},k==="_OTHER"&&x!==k?{"http.request.method_original":x}:{})})(v.method)),m?(x=>{return{"server.address":x.hostname.startsWith("[")&&x.hostname.endsWith("]")?x.hostname.slice(1,-1):x.hostname,"server.port":Number(x.port)||IW[x.protocol],"url.scheme":x.protocol.slice(0,-1),"url.template":(k=x.pathname,k.split("/").map(P=>(C=>/^\d+$/.test(C)||C.length>=8&&/^[0-9a-f-]*\d[0-9a-f-]*$/i.test(C))(P)?":id":P).join("/"))};var k})(m):{}),f?{"http.response.status_code":f}:{}),y?{"error.type":y}:{}),(l=d.attributes)===null||l===void 0?void 0:l.call(d,v,{status:f,durationMs:h}));(c=t.metrics)===null||c===void 0||c.histogram(_,h,{unit:"ms",attributes:w})}catch(d){Ov.error("Failed to record network metric",d)}},bM=()=>{},MW=(t,e)=>zn(le==null?void 0:le.fetch)?Ef(le,"fetch",n=>function(...r){const s=ak(),i=n.apply(this,r);if(!e())return i;try{var o,l,c;const[d,f]=r,h=wM((o=(l=f==null?void 0:f.method)!==null&&l!==void 0?l:d==null?void 0:d.method)!==null&&o!==void 0?o:"GET",(c=d==null?void 0:d.url)!==null&&c!==void 0?c:d);return i.then(m=>(Nb(t,h,m==null?void 0:m.status,s,e,void 0,!0),m),m=>{throw Nb(t,h,void 0,s,e,m),m})}catch(d){return Ov.error("Failed to observe fetch",d),i}}):bM,NW=(t,e)=>{var n;const r=le==null||(n=le.XMLHttpRequest)===null||n===void 0?void 0:n.prototype;if(!r)return bM;const s=new WeakMap,i=Ef(r,"open",l=>function(...c){try{K5.has(this)||s.set(this,wM(c[0],c[1]))}catch(d){Ov.error("Failed to observe XHR open",d)}return l.apply(this,c)}),o=Ef(r,"send",l=>function(...c){let d;try{const f=s.get(this);if(f&&e()){const h=ak();d=()=>{this.removeEventListener("loadend",d),Nb(t,f,this.status,h,e)},Dt(this,"loadend",d)}}catch(f){Ov.error("Failed to observe XHR send",f)}try{return l.apply(this,c)}catch(f){throw d&&this.removeEventListener("loadend",d),f}});return()=>{i(),o()}},W3=new WeakMap,LW=new Set(["$comment","$defs","$id","$schema","additionalProperties","default","definitions","deprecated","description","examples","minProperties","properties","readOnly","required","title","type","writeOnly"]),DW={maxStringLength:2048,truncationSuffix:"..."},$W={maxStringLength:2048,truncationSuffix:"..."};function q3(t){if(t)return t===!0?{intent:!0,model:!0}:{intent:t.intent!==!1,model:t.model!==!1}}function D2(t,e){return{}.hasOwnProperty.call(t,e)}function $2(t,e){const n=Object.create(t);return e&&Object.defineProperty(n,"inputSchema",{configurable:!0,enumerable:!0,writable:!0,value:e}),n}function G3(t,e,n=!1){if(!ht(t))return;const r=t.trim();return r?(n?VO(r,DW):r).slice(0,e):void 0}function K3(t){try{return dt(t)&&t.isError===!0}catch{return!1}}function xM(t){return VO(t||"Unknown error",$W).slice(0,2048)}function jW(t,e){try{return xM(e?(function(n){try{return!dt(n)||!We(n.content)?void 0:n.content.filter(r=>dt(r)&&r.type==="text"&&ht(r.text)).map(r=>r.text).join(" ").trim()||void 0}catch{return}})(t):dt(t)&&ht(t.message)?t.message:ht(t)?t:String(t))}catch{return"Unknown error"}}function FW(t,e,n){return e.errorResult?[{type:"Error",value:n,mechanism:{type:"generic",handled:!0,synthetic:!0,exception_id:0}}]:t.buildProperties(e.error,{handled:!0}).$exception_list.map(r=>j(j({},r),{},{value:xM(r.value)}))}function zW(t,e){if(e)return"Error";try{if(!dt(t))return"Error";let n=ht(t.name)?t.name.trim():"";const r=t.constructor;return n&&n!=="Error"||!zn(r)||r.name==="Error"||(n=r.name),(n||"Error").slice(0,256)}catch{return"Error"}}function VW(t,e){return{message:jW(t,e),type:zW(t,e)}}const R1={featureFlags:class extends XZ{constructor(t){const e=new QZ(t.config,t.tc());super(e),this.name=pM,this._instance=t,this.$f=e}get Xd(){return this._instance.persistence}updateConfig(t,e){this.$f.update(t,e),this.tv()}}},HW={sessionRecording:class{get Pr(){return this._instance.config}get Cc(){return this._instance.persistence}get started(){var t;return!!(!((t=this.Cf)===null||t===void 0)&&t.isStarted)}get status(){var t,e;return this.Tf==="awaiting_config"||this.Tf==="missing_config"?this.Tf:(t=(e=this.Cf)===null||e===void 0?void 0:e.status)!==null&&t!==void 0?t:this.Tf}constructor(t){if(this._instance=t,this._forceAllowLocalhostNetworkCapture=!1,this.Tf=C2,this.If=void 0,this.Mf=!1,this.Ye=(()=>{var e,n;if(!(Oe!=null&&Oe.visibilityState)||Oe.visibilityState==="visible")return!0;const r=le==null||(e=le.performance)===null||e===void 0||(n=e.getEntriesByType)===null||n===void 0?void 0:n.call(e,"visibility-state");return!(r!=null&&r.length)||r.some(s=>s.name==="visible")})(),this.an=()=>{var e,n;(Oe==null?void 0:Oe.visibilityState)==="visible"&&(this.Ye=!0,(e=this.Cf)===null||e===void 0||(n=e.setDocumentWasEverVisible)===null||n===void 0||n.call(e,!0))},!this._instance.sessionManager)throw Pa.error("started without valid sessionManager"),new Error("[SessionRecording] started without valid sessionManager. This is a bug.");if(this.Pr.cookieless_mode==="always")throw new Error('[SessionRecording] cannot be used with cookieless_mode="always"');Oe!=null&&Oe.addEventListener&&Dt(Oe,"visibilitychange",this.an)}initialize(){this.startIfEnabledOrStop()}dispose({discardBufferedEvents:t=!1}={}){var e;this.Mf=!0,Oe==null||(e=Oe.removeEventListener)===null||e===void 0||e.call(Oe,"visibilitychange",this.an),t?this.Ef(!0):this.stopRecording()}get Af(){var t;const e=!!(!((t=this._instance.get_property("$session_recording_remote_config"))===null||t===void 0)&&t.enabled),n=!this.Pr.disable_session_recording,r=this.Pr.disable_session_recording||this._instance.consent.isOptedOut();return le&&e&&n&&!r}startIfEnabledOrStop(t){var e;if(this.Mf||this.Af&&(!((e=this.Cf)===null||e===void 0)&&e.isStarted))return;const n=!ue(Object.assign)&&!ue(Array.from);this.Af&&n?(this.Rf(t),Pa.info("starting")):(this.Tf=C2,this.stopRecording())}Rf(t){var e,n;if(this.Af)if(this.Tf!=="awaiting_config"&&this.Tf!=="missing_config"&&(this.Tf=h3),(tt==null||(e=tt.__PosthogExtensions__)===null||e===void 0||(e=e.rrweb)===null||e===void 0?void 0:e.record)&&((n=tt.__PosthogExtensions__)===null||n===void 0?void 0:n.initSessionRecording))this.Pf(t);else{var r,s;const i=this._instance.sessionManager;(r=tt.__PosthogExtensions__)===null||r===void 0||(s=r.loadExternalDependency)===null||s===void 0||s.call(r,this._instance,this.Of,o=>{if(!this.Mf&&this.Af&&this._instance.sessionManager===i)return o?(this._instance.register_for_session({$sdk_debug_recording_script_not_loaded:!0}),Pa.error("could not load recorder",o)):void this.Pf(t);this.Tf="disabled"})}}stopRecording(){var t,e;(t=this.If)===null||t===void 0||t.call(this),this.If=void 0,(e=this.Cf)===null||e===void 0||e.stop()}Ef(t=!1){var e,n;(e=this.If)===null||e===void 0||e.call(this),this.If=void 0,(n=this.Cf)===null||n===void 0||n.discard({discardProducerEvents:t})}Ff(){var t,e;(t=this.Cc)===null||t===void 0||t.unregister("$session_is_sampled"),(e=this.Cc)===null||e===void 0||e.unregister("$replay_sample_rate")}Df(t,e){if(at(t))return null;const n=Xn(t)?t:parseFloat(t);return typeof(r=n)!="number"||!Number.isFinite(r)||0>r||r>1?(Pa.warn(`${e} must be between 0 and 1. Ignoring invalid value:`,t),null):n;var r}Lf(t){if(this.Cc){var e,n;const r=this.Cc,s=()=>{var i;const o=t.sessionRecording===!1?void 0:t.sessionRecording,l=this.Df((i=this.Pr.session_recording)===null||i===void 0?void 0:i.sampleRate,"session_recording.sampleRate"),c=this.Df(o==null?void 0:o.sampleRate,"remote config sampleRate"),d=l??c;at(d)&&this.Ff();const f=o==null?void 0:o.minimumDurationMilliseconds;r.register({[vp]:j(j({cache_timestamp:Date.now(),enabled:!!o},o),{},{networkPayloadCapture:j({capturePerformance:t.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:ue(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(),(e=this.If)===null||e===void 0||e.call(this),this.If=(n=this._instance.sessionManager)===null||n===void 0?void 0:n.onSessionId(s)}}onRemoteConfig(t){const e=t.ok?t.config:void 0;return e&&"sessionRecording"in e?e.sessionRecording===!1?(this.Lf(e),void this.Ef()):(this.Lf(e),void this.startIfEnabledOrStop()):(this.Tf==="awaiting_config"&&(this.Tf="missing_config",this._instance.register_for_session({[XS]:!0}),Pa.warn("config refresh failed, recording will not start until page reload")),void this.startIfEnabledOrStop())}log(t,e="log"){var n;!((n=this.Cf)===null||n===void 0)&&n.log?this.Cf.log(t,e):Pa.warn("log called before recorder was ready")}get Of(){var t,e;const n=(t=this._instance)===null||t===void 0||(t=t.persistence)===null||t===void 0?void 0:t.get_property(vp);return(n==null||(e=n.scriptConfig)===null||e===void 0?void 0:e.script)||"lazy-recorder"}Nf(){const t=this._instance.get_property(vp);if(!t)return!1;let e;try{e=typeof t=="object"?t:JSON.parse(t)}catch(n){return Pa.warn("persisted remote config for session recording is invalid and will be ignored",n),!1}return!at(e.cache_timestamp)&&36e5>=Date.now()-e.cache_timestamp}Pf(t){var e,n,r;if(!this.Mf&&this.Af&&this._instance.sessionManager){if(!(!((e=tt.__PosthogExtensions__)===null||e===void 0)&&e.initSessionRecording))return Pa.warn("Called on script loaded before session recording is available. This can be caused by adblockers."),void this._instance.register_for_session({[YS]:!0});var s;if(this.Cf||(this.Cf=(s=tt.__PosthogExtensions__)===null||s===void 0?void 0:s.initSessionRecording(this._instance,this.Ye),this.Cf._forceAllowLocalhostNetworkCapture=this._forceAllowLocalhostNetworkCapture),!this.Nf())return this.Tf==="missing_config"||this.Tf==="awaiting_config"?void 0:(this.Tf="awaiting_config",Pa.info("persisted remote config is stale, requesting fresh config before starting"),void new U5(this._instance).load());this.Tf=h3,(n=(r=this.Cf).setDocumentWasEverVisible)===null||n===void 0||n.call(r,this.Ye),this.Cf.start(t)}else this.Tf=C2}onRRwebEmit(t){var e,n;(e=this.Cf)===null||e===void 0||(n=e.onRRwebEmit)===null||n===void 0||n.call(e,t)}overrideLinkedFlag(){var t,e;this.Cf||(e=this.Cc)===null||e===void 0||e.register({$replay_override_linked_flag:!0}),(t=this.Cf)===null||t===void 0||t.overrideLinkedFlag()}overrideSampling(){var t,e;this.Cf||(e=this.Cc)===null||e===void 0||e.register({$replay_override_sampling:!0}),(t=this.Cf)===null||t===void 0||t.overrideSampling()}overrideTrigger(t){var e,n;this.Cf||(n=this.Cc)===null||n===void 0||n.register({[t==="url"?"$replay_override_url_trigger":"$replay_override_event_trigger"]:!0}),(e=this.Cf)===null||e===void 0||e.overrideTrigger(t)}get sdkDebugProperties(){var t;const e={};for(const r of zZ){var n;const s=(n=this._instance.sessionPersistence)===null||n===void 0?void 0:n.get_property(r);ue(s)||(e[r]=s)}return j(j({},e),((t=this.Cf)===null||t===void 0?void 0:t.sdkDebugProperties)||{$recording_status:this.status})}tryAddCustomEvent(t,e){var n;return!!(!((n=this.Cf)===null||n===void 0)&&n.tryAddCustomEvent(t,e))}flushBeforeIdentityReset(){var t,e;(t=this.Cf)===null||t===void 0||(e=t.flushBeforeIdentityReset)===null||e===void 0||e.call(t)}}},UW={autocapture:class extends kZ{constructor(t){super(new DZ(t)),this.instance=t}},historyAutocapture:class{constructor(t){this.jf=!1,this._instance=t,this.qf=this.Bf()}initialize(){this.startIfEnabled()}get isEnabled(){const t=this.zf();return!!(t.path||t.search||this.Hf(t))}startIfEnabled(){this.isEnabled&&(ye.info("History API monitoring enabled, starting..."),this.monitorHistoryChanges())}startIfEnabledOrStop(){this.stop(),this.qf=this.Bf(),this.startIfEnabled()}stop(){this.Uf&&this.Uf(),this.Uf=void 0,this.Wf&&this.Wf(),this.Wf=void 0,ye.info("History API monitoring stopped")}monitorHistoryChanges(){le&&le.history&&(this.Vf("pushState"),this.Vf("replaceState"),this.Gf(),this.Hf()&&this.Qf())}Vf(t){var e;if(!le||!((e=le.history[t])===null||e===void 0)&&e.__posthog_wrapped__)return;const n=this;Ef(le.history,t,r=>function(s,i,o){var l;n.Jf(o)&&n.Zf(),r.call(this,s,i,o),n.Kf(t,!n.jf&&(le==null||(l=le.event)===null||l===void 0?void 0:l.type)!=="popstate")})}Bf(){const t=le==null?void 0:le.location;if(t!=null&&t.pathname)return{pathname:t.pathname,search:t.search,hash:t.hash}}zf(){const t=this._instance.config.capture_pageview;return t==="history_change"?{path:!0}:dt(t)?t:{}}Hf(t=this.zf()){return!!t.hash&&!this._instance.config.disable_capture_url_hashes}Yf(t){const e=this.zf(),n=this.qf;return!(!n||!(e.path&&t.pathname!==n.pathname||e.search&&t.search!==n.search||this.Hf(e)&&t.hash!==n.hash))}Kf(t,e=!1){try{e||this.Zf();const n=this.Bf();if(!n)return;if(this.Yf(n)){const r=()=>this._instance.capture(QS,{navigation_type:t});e?(this.Xf=r,Promise.resolve().then(()=>this.Zf())):r()}this.qf=n}catch(n){ye.error(`Error capturing ${t} pageview`,n)}}Jf(t){var e,n;return!(at(t)||!le)&&((e=Ya(String(t)))===null||e===void 0?void 0:e.href)!==((n=le.location)===null||n===void 0?void 0:n.href)}Zf(){const t=this.Xf;if(t){this.Xf=void 0,this.jf=!0;try{t()}catch(e){ye.error("Error capturing deferred pageview",e)}finally{this.jf=!1}this.qf=this.Bf()}}Gf(){if(this.Uf)return;const t=()=>{this.Kf("popstate")};Dt(le,"popstate",t),this.Uf=()=>{le&&le.removeEventListener("popstate",t)}}Qf(){if(this.Wf)return;const t=()=>{this.Kf("hashchange")};Dt(le,"hashchange",t),this.Wf=()=>{le&&le.removeEventListener("hashchange",t)}}},heatmaps:class{get Pr(){return this.instance.config}constructor(t){var e;this.tp=!1,this.vl=!1,this.ep=null,this.instance=t,this.tp=!!(!((e=this.instance.persistence)===null||e===void 0)&&e.props[pb]),this.rageclicks=new fM(t.config.rageclick)}initialize(){this.startIfEnabled()}get flushIntervalMilliseconds(){let t=5e3;return dt(this.Pr.capture_heatmaps)&&this.Pr.capture_heatmaps.flush_interval_milliseconds&&(t=this.Pr.capture_heatmaps.flush_interval_milliseconds),t}get isEnabled(){return at(this.Pr.capture_heatmaps)?at(this.Pr.enable_heatmaps)?this.tp:this.Pr.enable_heatmaps:this.Pr.capture_heatmaps!==!1}startIfEnabled(){if(this.isEnabled){if(this.vl)return;VZ.info("starting..."),this.np(),this.an()}else{var t;clearInterval((t=this.ep)!==null&&t!==void 0?t:void 0),this.sp(),this.getAndClearBuffer()}}onRemoteConfig(t){if(!t.ok)return;const e=t.config;if(!("heatmaps"in e))return;const n=!!e.heatmaps;this.instance.persistence&&this.instance.persistence.register({[pb]:n}),this.tp=n,this.startIfEnabled()}getAndClearBuffer(){const t=this.At;return this.At=void 0,t}rp(t){P2(t.originalEvent)&&this.Dr(t.originalEvent,"deadclick")}an(){this.ep&&clearInterval(this.ep),this.ep=(Oe==null?void 0:Oe.visibilityState)==="visible"?setInterval(this.hc.bind(this),this.flushIntervalMilliseconds):null}np(){le&&Oe&&(this.op=this.hc.bind(this),Dt(le,Ev,this.op),this.ap=t=>this.Dr(t||(le==null?void 0:le.event)),Dt(Oe,"click",this.ap,{capture:!0}),this.lp=t=>this.up(t||(le==null?void 0:le.event)),Dt(Oe,"mousemove",this.lp,{capture:!0}),this.cp=new zP(this.instance,FB,this.rp.bind(this)),this.cp.startIfEnabledOrStop(),this.hp=this.an.bind(this),Dt(Oe,Yd,this.hp),this.vl=!0)}sp(){var t;le&&Oe&&(this.op&&le.removeEventListener(Ev,this.op),this.ap&&Oe.removeEventListener("click",this.ap,{capture:!0}),this.lp&&Oe.removeEventListener("mousemove",this.lp,{capture:!0}),this.hp&&Oe.removeEventListener(Yd,this.hp),clearTimeout(this.dp),(t=this.cp)===null||t===void 0||t.stop(),this.vl=!1)}vp(t,e){const n=this.instance.scrollManager.scrollY(),r=this.instance.scrollManager.scrollX(),s=this.instance.scrollManager.scrollElement(),i=(function(o,l,c){let d=o;for(;d&&Ji(d)&&!cr(d,"body");){if(d===c)return!1;let v;try{var f,h,m;v=(f=(h=(m=d.ownerDocument)===null||m===void 0?void 0:m.defaultView)!==null&&h!==void 0?h:le)===null||f===void 0?void 0:f.getComputedStyle(d).position}catch{return!1}if(Ze(l,v))return!0;d=k5(d)}return!1})(wp(t),["fixed","sticky"],s);return{x:t.clientX+(i?0:r),y:t.clientY+(i?0:n),target_fixed:i,type:e}}Dr(t,e="click"){var n;if(TP(t.target)||!P2(t))return;const r=this.vp(t,e);!((n=this.rageclicks)===null||n===void 0)&&n.isRageClick(t.clientX,t.clientY,new Date().getTime())&&C5(wp(t),this.instance.config.rageclick)&&this.Qs(j(j({},r),{},{type:"rageclick"})),this.Qs(r)}up(t){!TP(t.target)&&P2(t)&&(clearTimeout(this.dp),this.dp=setTimeout(()=>{this.Qs(this.vp(t,"mousemove"))},500))}Qs(t){if(!le)return;const e=this.Pr.disable_capture_url_hashes?oc(le.location.href):le.location.href,n=this.Pr.custom_personal_data_properties,r=this.Pr.mask_personal_data_properties?[...Sf,...n||[]]:[],s=Hp(e,r,Up);this.At=this.At||{},this.At[s]||(this.At[s]=[]),this.At[s].push(t)}hc(){this.At&&!Ws(this.At)&&this.instance.capture("$$heatmap",{$heatmap_data:this.getAndClearBuffer()})}},deadClicksAutocapture:zP,webVitalsAutocapture:class{constructor(t){var e;this._instance=t,this.tp=!1,this.vl=!1,this.At={navigationKey:void 0,url:void 0,metrics:[],firstMetricTimestamp:void 0},this.fp=(n=!1)=>{clearTimeout(this.pp),this.pp=void 0,this.At.metrics.length!==0&&(this._instance.capture("$web_vitals",j({$current_url:this.At.url},this.At.metrics.reduce((r,s)=>j(j({},r),{},{[`$web_vitals_${s.name}_event`]:j({},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.gp=n=>{var r;if(this.At=this.At||{navigationKey:void 0,url:void 0,metrics:[],firstMetricTimestamp:void 0},at(n==null?void 0:n.name)||at(n==null?void 0:n.value))return void Bc.error("Invalid metric received",n);const s=typeof n.navigationURL=="string"?n.navigationURL:void 0,i=this.mp(s);if(ue(i))return;const o=Xn(n.navigationId)||typeof n.navigationId=="string"?`navigation:${n.navigationId}`:`url:${i}`;if(this.yp&&n.value>=this.yp)return void Bc.error("Ignoring metric with value >= "+this.yp,n);this.At.navigationKey!==o&&(this.fp(),this.pp=setTimeout(this.fp,this.flushToCaptureTimeoutMs)),ue(this.At.navigationKey)&&(this.At.navigationKey=o,this.At.url=i),this.At.firstMetricTimestamp=ue(this.At.firstMetricTimestamp)?Date.now():this.At.firstMetricTimestamp;const l=(r=this._instance.sessionManager)===null||r===void 0?void 0:r.checkAndGetSessionAndWindowId(!0),c=j(j(j({},n),s?{navigationURL:i}:{}),{},{$current_url:i,timestamp:Date.now()});if(delete c.entries,dt(n.attribution)&&this.attributionMetrics.indexOf(n.name)>-1){const d={};for(const f of FZ){const h=f==="url"&&typeof n.attribution[f]=="string"?this.mp(n.attribution[f]):n.attribution[f];ue(h)||(d[f]=h)}c.attribution=d}else delete c.attribution;ue(l)||(c.$session_id=l.sessionId,c.$window_id=l.windowId),this.At.metrics.push(c),this.At.metrics.length===this.allowedMetrics.length&&this.fp()},this.bp=()=>{if(this.vl)return;let n,r,s,i,o=!1;const l=tt.__PosthogExtensions__,c=l==null?void 0:l.postHogWebVitalsCallbacksByFlavor,d=(c==null?void 0:c[this._p])||(this._p==="web-vitals"&&ue(c)?l==null?void 0:l.postHogWebVitalsCallbacks:void 0);if(!ue(d)){const v=d.withoutAttribution,_=this.attributionMetrics;o=!ue(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 Bc.error("web vitals callbacks not loaded - not starting");const f={reportSoftNavs:this.useSoftNavs},h=o&&this.attributionMetrics.indexOf("INP")>-1?j(j({},f),{},{includeProcessedEventEntries:!1}):f;this.allowedMetrics.indexOf("LCP")>-1&&n(this.gp.bind(this),f),this.allowedMetrics.indexOf("CLS")>-1&&r(this.gp.bind(this),f),this.allowedMetrics.indexOf("FCP")>-1&&s(this.gp.bind(this),f),this.allowedMetrics.indexOf("INP")>-1&&i(this.gp.bind(this),h);const m=le==null?void 0:le.document;Dt(m,Yd,()=>{(m==null?void 0:m.visibilityState)==="hidden"&&this.fp(!0)}),Dt(le,"pagehide",()=>this.fp(!0)),this.vl=!0},this.tp=!!(!((e=this._instance.persistence)===null||e===void 0)&&e.props[vb]),this.startIfEnabled()}get wp(){return this._instance.config.capture_performance}get allowedMetrics(){var t,e;const n=dt(this.wp)?(t=this.wp)===null||t===void 0?void 0:t.web_vitals_allowed_metrics:void 0;return at(n)?((e=this._instance.persistence)===null||e===void 0?void 0:e.props.$web_vitals_allowed_metrics)||f3:n}get flushToCaptureTimeoutMs(){return(dt(this.wp)?this.wp.web_vitals_delayed_flush_ms:void 0)||5e3}get attributionMetrics(){const t=dt(this.wp)?this.wp.web_vitals_attribution:void 0;return Ns(t)?t?f3:[]:We(t)?t:jZ}get useAttribution(){return this.attributionMetrics.length>0}get useSoftNavs(){const t=dt(this.wp)?this.wp.__preview_web_vitals_soft_navs:void 0;return t!=null&&t}get yp(){const t=dt(this.wp)&&Xn(this.wp.__web_vitals_max_value)?this.wp.__web_vitals_max_value:d3;return t>0&&6e4>=t?d3:t}get isEnabled(){const t=dn==null?void 0:dn.protocol;if(t!=="http:"&&t!=="https:")return Bc.info("Web Vitals are disabled on non-http/https protocols"),!1;const e=dt(this.wp)?this.wp.web_vitals:Ns(this.wp)?this.wp:void 0;return Ns(e)?e:this.tp}startIfEnabled(){this.isEnabled&&!this.vl&&(Bc.info("enabled, starting..."),this.Ol(this.bp))}onRemoteConfig(t){if(!t.ok)return;const e=t.config;if(!("capturePerformance"in e))return;const n=dt(e.capturePerformance)&&!!e.capturePerformance.web_vitals,r=dt(e.capturePerformance)?e.capturePerformance.web_vitals_allowed_metrics:void 0;this._instance.persistence&&(this._instance.persistence.register({[vb]:n}),this._instance.persistence.register({[t5]:r})),this.tp=n,this.startIfEnabled()}get _p(){return this.useSoftNavs?this.useAttribution?"web-vitals-with-attribution-soft-navs":"web-vitals-soft-navs":this.useAttribution?"web-vitals-with-attribution":"web-vitals"}Ol(t){var e;const n=tt.__PosthogExtensions__,r=this._p,s=n==null?void 0:n.postHogWebVitalsCallbacksByFlavor;s!=null&&s[r]||r==="web-vitals"&&ue(s)&&(n!=null&&n.postHogWebVitalsCallbacks)?t():n==null||(e=n.loadExternalDependency)===null||e===void 0||e.call(n,this._instance,r,i=>{i?Bc.error("failed to load script",i):t()})}mp(t){const e=t||(le==null?void 0:le.location.href);if(!e)return void Bc.error("Could not determine current URL");const n=this._instance.config.disable_capture_url_hashes?oc(e):e,r=this._instance.config.custom_personal_data_properties,s=this._instance.config.mask_personal_data_properties?[...Sf,...r||[]]:[];return Hp(n,s,Up)}}},BW={exceptionObserver:class{constructor(t){var e;this.bp=()=>{var n;if(!le||!this.isEnabled||!(!((n=tt.__PosthogExtensions__)===null||n===void 0)&&n.errorWrappingFunctions))return;const r=tt.__PosthogExtensions__.errorWrappingFunctions.wrapOnError,s=tt.__PosthogExtensions__.errorWrappingFunctions.wrapUnhandledRejection,i=tt.__PosthogExtensions__.errorWrappingFunctions.wrapConsoleError;try{!this.kp&&this.Pr.capture_unhandled_errors&&(this.kp=r(this.captureException.bind(this))),!this.Sp&&this.Pr.capture_unhandled_rejections&&(this.Sp=s(this.captureException.bind(this))),!this.xp&&this.Pr.capture_console_errors&&(this.xp=i(this.captureException.bind(this)))}catch(o){Uh.error("failed to start",o),this.$p()}},this._instance=t,this.Cp=!!(!((e=this._instance.persistence)===null||e===void 0)&&e.props[mb]),this.kt=new TH(j(j({},(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:Uh})),this.Pr=this.Tp(),this.startIfEnabledOrStop()}Tp(){const t=this._instance.config.capture_exceptions;let e={capture_unhandled_errors:!1,capture_unhandled_rejections:!1,capture_console_errors:!1};return dt(t)?e=j(j({},e),t):(ue(t)?this.Cp:t)&&(e=j(j({},e),{},{capture_unhandled_errors:!0,capture_unhandled_rejections:!0})),e}get isEnabled(){return this.Pr.capture_console_errors||this.Pr.capture_unhandled_errors||this.Pr.capture_unhandled_rejections}startIfEnabledOrStop(){this.isEnabled?(Uh.info("enabled"),this.$p(),this.Ol(this.bp)):this.$p()}Ol(t){var e,n,r;!((e=tt.__PosthogExtensions__)===null||e===void 0)&&e.errorWrappingFunctions?t():(n=tt.__PosthogExtensions__)===null||n===void 0||(r=n.loadExternalDependency)===null||r===void 0||r.call(n,this._instance,"exception-autocapture",s=>{if(s)return Uh.error("failed to load script",s);t()})}$p(){var t,e,n;(t=this.kp)===null||t===void 0||t.call(this),this.kp=void 0,(e=this.Sp)===null||e===void 0||e.call(this),this.Sp=void 0,(n=this.xp)===null||n===void 0||n.call(this),this.xp=void 0}onRemoteConfig(t){if(!t.ok)return;const e=t.config;"autocaptureExceptions"in e&&(this.Cp=!!e.autocaptureExceptions||!1,this._instance.persistence&&this._instance.persistence.register({[mb]:this.Cp}),this.Pr=this.Tp(),this.startIfEnabledOrStop())}onConfigChange(){this.Pr=this.Tp()}captureException(t){try{var e,n,r;const s=(e=t==null||(n=t.$exception_list)===null||n===void 0||(n=n[0])===null||n===void 0?void 0:n.type)!==null&&e!==void 0?e:"Exception";if(this.kt.consumeRateLimit(s))return void Uh.info("Skipping exception capture because of client rate limiting.",{exception:s});(r=this._instance.exceptions)===null||r===void 0||r.sendExceptionEvent(t)}catch{}}},exceptions:class{constructor(t){var e,n;this.Ip=[],this.Mp=new VH([new nU,new dU,new sU,new rU,new cU,new lU,new oU,new uU],(function(r,...s){return(i,o=0)=>{const l=[],c=i.split(`
|
|
21
|
-
`),d=Math.min(c.length,o+1e3),f=[];for(let v=o;d>v;v++){const _=c[v];if(_.length>1024)continue;const y=lP.test(_)?_.replace(lP,"$1"):_;if(!y.match(/\S*Error: /)){for(const w of s){const x=w(y,r);if(x){l.push(x);const k=QH(l);if(k){for(let P=f.length-1;P>=0;P--){const C=f[P];if(k.start>=C.start+C.length)break;f.pop()}f.push(k)}break}}if(eU(l,f)>=50)break}}const h=[...f].sort((v,_)=>_.start-v.start),m=h[h.length-1];if(m){const v=OO(l,m);l.splice(m.start-v,v);for(const _ of h)_.start-=v}for(const v of h)JH(l,v);return f.some(v=>v.start===0&&l.length===v.length)&&(function(v){const _=v.map(w=>`${w.function}|${w.filename}|${w.lineno}|${w.colno}|${w.module}`);let y=0;for(let w=1;_.length>w;w++)tU(_,w,y)&&(y=w);v.push(...v.splice(0,y))})(l),(function(v){if(!v.length)return[];const _=Array.from(v);return _.reverse(),_.slice(0,50).map(y=>{return j(j({},y),{},{filename:y.filename||(w=_,w[w.length-1]||{}).filename,function:y.function||"?"});var w})})(l)}})("web:javascript",GH,XH)),this._instance=t,this.Ip=(e=(n=this._instance.persistence)===null||n===void 0?void 0:n.get_property("$error_tracking_suppression_rules"))!==null&&e!==void 0?e:[],this.Ep=_v(this.Ap()),this.Rp=new hU(this.Ep)}onConfigChange(){this.Ep=_v(this.Ap()),this.Rp.setConfig(this.Ep)}onRemoteConfig(t){var e,n,r;if(!t.ok)return;const s=t.config;if(!("errorTracking"in s))return;const i=(e=(n=s.errorTracking)===null||n===void 0?void 0:n.suppressionRules)!==null&&e!==void 0?e:[],o=(r=s.errorTracking)===null||r===void 0?void 0:r.captureExtensionExceptions;this.Ip=i,this._instance.persistence&&this._instance.persistence.register({[JO]:this.Ip,[gb]:o})}get Pp(){var t;const e=!!this._instance.get_property(gb),n=this._instance.config.error_tracking.captureExtensionExceptions;return(t=n??e)!==null&&t!==void 0&&t}buildProperties(t,e){return this.Mp.buildFromUnknown(t,{syntheticException:e==null?void 0:e.syntheticException,mechanism:{handled:e==null?void 0:e.handled}})}addExceptionStep(t,e){if(this.Ep.enabled)try{if(!ht(t)||t.trim().length===0)return void ho.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,l)=>fU.has(l)?(i.push(l),o):(o[l]=s[l],o),{}),droppedKeys:i}})(this.Op(e));r.length>0&&ho.warn("Ignoring reserved exception step fields",{droppedKeys:r}),this.Rp.add(j({[vv]:t,[yv]:new Date().toISOString()},n))}catch(n){ho.error("Failed to add exception step. Ignoring breadcrumb.",n)}}sendExceptionEvent(t){try{const e=t.$exception_list;if(this.Fp(e)){if(this.Dp(e))return this.Lp("Exception dropped: matched a suppression rule"),void ho.info("Skipping exception capture because a suppression rule matched");if(!this.Pp&&this.Np(e))return this.Lp("Exception dropped: thrown by a browser extension"),void ho.info("Skipping exception capture because it was thrown by an extension");if(!this.Pp&&this.jp(e))return this.Lp("Exception dropped: thrown by an injected browser script"),void ho.info("Skipping exception capture because it was thrown by an injected browser script");if(!this._instance.config.error_tracking.__capturePostHogExceptions&&this.qp(e))return this.Lp("Exception dropped: thrown by the PostHog SDK"),void ho.info("Skipping exception capture because it was thrown by the PostHog SDK")}const n=this.Ep.enabled&&at(t.$exception_steps)?this.Bp(t):t,r=(function(){if("u">typeof process){var s;const o=(s=_H.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",vd:!0});return s&&this.Rp.clear(),s}catch(s){return k3(s)||ho.error("Failed to capture exception event. Dropping this exception.",s),void this.Rp.clear()}}catch(e){return void(k3(e)||ho.error("Failed to process exception event. Ignoring this exception.",e))}}Bp(t){try{const e=this.Rp.getAttachable();return e.length===0?t:j(j({},t),{},{$exception_steps:e})}catch(e){return ho.error("Failed to read buffered exception steps. Capturing exception without steps.",e),t}}Lp(t){this.Ep.enabled&&this.Rp.add({[vv]:t,[yv]:new Date().toISOString()})}Op(t){return dt(t)?j({},t):{}}Ap(){var t,e;return(t=(e=this._instance.config.error_tracking)===null||e===void 0?void 0:e.exception_steps)!==null&&t!==void 0?t:{}}Dp(t){if(t.length===0)return!1;try{const e=t.reduce((n,{type:r,value:s})=>(ht(r)&&r.length>0&&n.$exception_types.push(r),ht(s)&&s.length>0&&n.$exception_values.push(s),n),{$exception_types:[],$exception_values:[]});return this.Ip.some(n=>{const r=n.values.map(s=>{const i=cM[s.operator],o=e[s.key];if(!i||!o)return!1;const l=We(s.value)?s.value:[s.value];return l.length>0&&i(l,o)});return n.type==="OR"?r.some(Boolean):r.every(Boolean)})}catch(e){return ho.warn("Failed to evaluate suppression rules. Capturing the exception.",e),!1}}Np(t){const e=t.flatMap(r=>{var s,i;return(s=(i=r.stacktrace)===null||i===void 0?void 0:i.frames)!==null&&s!==void 0?s:[]}),n=e.filter(({filename:r})=>!!r&&eW.some(s=>r.startsWith(s)));return n.length!==0&&(!n.every(({filename:r})=>!!r&&r.startsWith(Ib))||t.some(({type:r,value:s})=>r==="NoResponse"||ht(s)&&JZ.some(({value:i,exact:o})=>o?s===i:s.includes(i)))&&!e.some(({in_app:r,filename:s})=>r&&!(s!=null&&s.startsWith(Ib))))}jp(t){return t.some(({value:e})=>ht(e)&&tW.some(n=>e.includes(n)))}qp(t){if(t.length>0){var e,n,r,s;const i=(e=(n=t[0].stacktrace)===null||n===void 0?void 0:n.frames)!==null&&e!==void 0?e:[],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}Fp(t){return!at(t)&&We(t)}}},ZW=j({productTours:class{get Cc(){return this._instance.persistence}constructor(t){this.zp=null,this.Hp=null,this._instance=t}initialize(){this.loadIfEnabled()}onRemoteConfig(t){if(!t.ok)return;const e=t.config;if("productTours"in e){var n,r;if(this.Cc&&this.Cc.register({[GS]:!!e.productTours}),!A2(this._instance))return!this.zp&&at((n=this.Cc)===null||n===void 0?void 0:n.props.ph_product_tours)||Q0.info("product tours disabled; stopping and clearing cached tours"),(r=this.zp)===null||r===void 0||r.stop(),this.zp=null,void this.clearCache();this.loadIfEnabled()}}loadIfEnabled(){!this.zp&&A2(this._instance)&&this.Ol(()=>this.Up())}Ol(t){var e,n,r;!((e=tt.__PosthogExtensions__)===null||e===void 0)&&e.generateProductTours?t():(n=tt.__PosthogExtensions__)===null||n===void 0||(r=n.loadExternalDependency)===null||r===void 0||r.call(n,this._instance,"product-tours",s=>{s?Q0.error("Could not load product tours script",s):t()})}Up(){var t;!this.zp&&(!((t=tt.__PosthogExtensions__)===null||t===void 0)&&t.generateProductTours)&&(this.zp=tt.__PosthogExtensions__.generateProductTours(this._instance,!0))}getProductTours(t,e=!1){if(We(this.Hp)&&!e)return void t(this.Hp,{isLoaded:!0});const n=this.Cc;if(n){const r=n.props[yb];if(We(r)&&!e)return this.Hp=r,void t(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(!A2(this._instance))return void t([],{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||Q0.warn(o):Q0.error(o),void t([],{isLoaded:!1,error:o})}const i=We(r.json.product_tours)?r.json.product_tours:[];this.Hp=i,n&&n.register({[yb]:i}),t(i,{isLoaded:!0})}})}getActiveProductTours(t){at(this.zp)?t([],{isLoaded:!1,error:"Product tours not loaded"}):this.zp.getActiveProductTours(t)}showProductTour(t){var e;(e=this.zp)===null||e===void 0||e.showTourById(t)}previewTour(t){this.zp?this.zp.previewTour(t):this.Ol(()=>{var e;this.Up(),(e=this.zp)===null||e===void 0||e.previewTour(t)})}dismissProductTour(){var t;(t=this.zp)===null||t===void 0||t.dismissTour("user_clicked_skip")}nextStep(){var t;(t=this.zp)===null||t===void 0||t.nextStep()}previousStep(){var t;(t=this.zp)===null||t===void 0||t.previousStep()}clearCache(){var t;this.Hp=null,(t=this.Cc)===null||t===void 0||t.unregister("ph_product_tours")}resetTour(t){var e;(e=this.zp)===null||e===void 0||e.resetTour(t)}resetAllTours(){var t;(t=this.zp)===null||t===void 0||t.resetAllTours()}cancelPendingTour(t){var e;(e=this.zp)===null||e===void 0||e.cancelPendingTour(t)}}},R1),WW={siteApps:class{constructor(t){this._instance=t,this.Wp=0,this.Vp=[],this.apps={}}get isEnabled(){return!!this._instance.config.opt_in_site_apps}Gp(t,e){if(!e)return;const n=this.globalsForEvent(e);this.Vp.push(n),this.Vp.length>1e3&&(this.Vp=this.Vp.slice(10))}get siteAppLoaders(){var t;return(t=tt._POSTHOG_REMOTE_CONFIG)===null||t===void 0||(t=t[this._instance.config.token])===null||t===void 0?void 0:t.siteApps}initialize(){if(this.isEnabled){const t=this._instance._addCaptureHook(this.Gp.bind(this));this.Qp=()=>{t(),this.Vp=[],this.Qp=void 0}}}globalsForEvent(t){var e,n,r,s,i,o,l;if(!t)throw new Error("Event payload is required");const c={},d=this._instance.get_property("$groups")||[],f=this._instance.get_property("$stored_group_properties")||{};for(const[v,_]of Object.entries(f))c[v]={id:d[v],type:v,properties:_};const{$set_once:h,$set:m}=t;return{event:j(j({},DO(t,HZ)),{},{properties:j(j(j({},t.properties),m?{$set:j(j({},(e=(n=t.properties)===null||n===void 0?void 0:n.$set)!==null&&e!==void 0?e:{}),m)}:{}),h?{$set_once:j(j({},(r=(s=t.properties)===null||s===void 0?void 0:s.$set_once)!==null&&r!==void 0?r:{}),h)}:{}),elements_chain:(i=(o=t.properties)===null||o===void 0?void 0:o.$elements_chain)!==null&&i!==void 0?i:"",distinct_id:(l=t.properties)===null||l===void 0?void 0:l.distinct_id}),person:{properties:this._instance.get_property("$stored_person_properties")},groups:c}}Jp(t){var e;const n=(e=t.tagName)===null||e===void 0?void 0:e.toLowerCase();return n==="style"&&this._instance.config.prepare_external_dependency_stylesheet?this._instance.config.prepare_external_dependency_stylesheet(t)||($o.error("prepare_external_dependency_stylesheet returned null"),null):n==="script"&&this._instance.config.prepare_external_dependency_script?this._instance.config.prepare_external_dependency_script(t)||($o.error("prepare_external_dependency_script returned null"),null):t}Zp(){var t,e,n,r,s,i,o,l;if(!this._instance.config.prepare_external_dependency_stylesheet&&!this._instance.config.prepare_external_dependency_script)return()=>{};const c=Oe==null?void 0:Oe.defaultView,d=c==null||(t=c.Node)===null||t===void 0?void 0:t.prototype;if(!c||!d)return()=>{};if(this.Wp++,this.Kp)return this.Yp();const f=[],h=this,m=new WeakSet,v=(w,x,k)=>{if(!(w!=null&&w[x]))return;const P=w[x];w[x]=k(P),f.push(()=>{w[x]=P})},_=w=>{if(m.has(w))return w;const x=h.Jp(w);return x&&m.add(x),x},y=w=>w.map(x=>typeof x=="string"?x:_(x)).filter(x=>!Mn(x));return v(d,"appendChild",w=>function(x){const k=_(x);return k?w.call(this,k):x}),v(d,"insertBefore",w=>function(x,k){const P=_(x);return P?w.call(this,P,k):x}),v(d,"replaceChild",w=>function(x,k){const P=_(x);return P?w.call(this,P,k):k}),[(e=c.Element)===null||e===void 0?void 0:e.prototype,(n=c.Document)===null||n===void 0?void 0:n.prototype,(r=c.DocumentFragment)===null||r===void 0?void 0:r.prototype].forEach(w=>{v(w,"append",x=>function(...k){return x.apply(this,y(k))}),v(w,"prepend",x=>function(...k){return x.apply(this,y(k))})}),[(s=c.Element)===null||s===void 0?void 0:s.prototype,(i=c.CharacterData)===null||i===void 0?void 0:i.prototype,(o=c.DocumentType)===null||o===void 0?void 0:o.prototype].forEach(w=>{v(w,"before",x=>function(...k){return x.apply(this,y(k))}),v(w,"after",x=>function(...k){return x.apply(this,y(k))}),v(w,"replaceWith",x=>function(...k){const P=y(k);return k.length&&!P.length?void 0:x.apply(this,P)})}),v((l=c.Element)===null||l===void 0?void 0:l.prototype,"insertAdjacentElement",w=>function(x,k){const P=_(k);return P?w.call(this,x,P):null}),this.Kp=()=>{f.forEach(w=>w()),this.Kp=void 0},this.Yp()}Yp(){let t=!1;return()=>{var e;t||(t=!0,this.Wp--,this.Wp===0&&((e=this.Kp)===null||e===void 0||e.call(this)))}}Xp(t,e=!0){const n=this.Zp();try{const r=t(n);return e&&n(),r}catch(r){throw n(),r}}setupSiteApp(t){const e=this.apps[t.id],n=()=>{var i;!e.errored&&this.Vp.length&&($o.info(`Processing ${this.Vp.length} events for site app with id ${t.id}`),this.Vp.forEach(o=>this.Xp(()=>{var l;return(l=e.processEvent)===null||l===void 0?void 0:l.call(e,o)})),e.processedBuffer=!0),Object.values(this.apps).every(o=>o.processedBuffer||o.errored)&&((i=this.Qp)===null||i===void 0||i.call(this))};let r=!1;const s=i=>{e.errored=!i,e.loaded=!0,$o.info(`Site app with id ${t.id} ${i?"loaded":"errored"}`),r&&n()};try{const{processEvent:i}=this.Xp(o=>t.init({posthog:this._instance,callback(l){o(),s(l)}}),!1);i&&(e.processEvent=i),r=!0}catch(i){$o.error(p3+t.id,i),s(!1)}if(r&&e.loaded)try{n()}catch(i){$o.error(`Error while processing buffered events PostHog app with config id ${t.id}`,i),e.errored=!0}}tg(){const t=this.siteAppLoaders||[];for(const e of t)this.apps[e.id]={id:e.id,loaded:!1,errored:!1,processedBuffer:!1};for(const e of t)this.setupSiteApp(e)}eg(t){if(Object.keys(this.apps).length===0)return;const e=this.globalsForEvent(t);for(const n of Object.values(this.apps))try{this.Xp(()=>{var r;return(r=n.processEvent)===null||r===void 0?void 0:r.call(n,e)})}catch(r){$o.error(`Error while processing event ${t.event} for site app ${n.id}`,r)}}onRemoteConfig(t){var e,n,r;if(!((e=this.siteAppLoaders)===null||e===void 0)&&e.length)return this.isEnabled?(this.tg(),void this._instance.on("eventCaptured",l=>this.eg(l))):void $o.error('PostHog site apps are disabled. Enable the "opt_in_site_apps" config to proceed.');if((n=this.Qp)===null||n===void 0||n.call(this),!t.ok)return;const s=t.config;if(!((r=s.siteApps)===null||r===void 0)&&r.length)if(this.isEnabled)for(const{id:l,url:c}of s.siteApps){var i,o;tt[`__$$ph_site_app_${l}`]=this._instance,(i=tt.__PosthogExtensions__)===null||i===void 0||(o=i.loadSiteApp)===null||o===void 0||o.call(i,this._instance,c,d=>{if(d)return $o.error(p3+l,d)})}else $o.error('PostHog site apps are disabled. Enable the "opt_in_site_apps" config to proceed.')}}},qW={tracingHeaders:class{constructor(t){this._instance=t,this.ig=void 0,this.ng=void 0,this.sg=void 0,this.bp=()=>{const e=this.rg();var n,r;e?(ue(this.ig)&&(this.ig=(n=tt.__PosthogExtensions__)===null||n===void 0||(n=n.tracingHeadersPatchFns)===null||n===void 0?void 0:n._patchXHR(e,()=>this._instance.get_distinct_id(),this._instance.sessionManager)),ue(this.ng)&&(this.ng=(r=tt.__PosthogExtensions__)===null||r===void 0||(r=r.tracingHeadersPatchFns)===null||r===void 0?void 0:r._patchFetch(e,()=>this._instance.get_distinct_id(),this._instance.sessionManager))):this.$p()}}initialize(){this.startIfEnabledOrStop()}Ol(t){var e,n,r;!((e=tt.__PosthogExtensions__)===null||e===void 0)&&e.tracingHeadersPatchFns?t():(n=tt.__PosthogExtensions__)===null||n===void 0||(r=n.loadExternalDependency)===null||r===void 0||r.call(n,this._instance,"tracing-headers",s=>{if(s)return $Z.error("failed to load script",s);t()})}og(){var t,e;return(t=(e=this._instance.config.tracing_headers)!==null&&e!==void 0?e:this._instance.config.addTracingHeaders)!==null&&t!==void 0?t:this._instance.config.__add_tracing_headers}rg(){const t=this.og();return We(t)?(We(this.sg)?this.sg.splice(0,this.sg.length,...t):this.sg=[...t],t.length>0?this.sg:void 0):(We(this.sg)&&this.sg.splice(0),this.sg=t||void 0,this.sg)}$p(){var t,e;(t=this.ig)===null||t===void 0||t.call(this),(e=this.ng)===null||e===void 0||e.call(this),this.ig=void 0,this.ng=void 0}startIfEnabledOrStop(){this.rg()?this.Ol(this.bp):this.$p()}}},GW=j({surveys:class extends WZ{constructor(t){super(new qZ(t))}}},R1),KW={toolbar:class{constructor(t){this.instance=t}ag(t){tt.ph_toolbar_state=t}lg(){var t;return(t=tt.ph_toolbar_state)!==null&&t!==void 0?t:0}initialize(){return this.maybeLoadToolbar()}maybeLoadToolbar(t=void 0,e=void 0,n=void 0){var r,s;if(wb(this.instance.config)||!le||!Oe)return!1;t=(r=t)!==null&&r!==void 0?r:le.location,n=(s=n)!==null&&s!==void 0?s:le.history;try{if(!e){try{le.localStorage.setItem("test","test"),le.localStorage.removeItem("test")}catch{return!1}e=le==null?void 0:le.localStorage}const i=GZ||Pv(t.hash,"__posthog")||Pv(t.hash,"state");let o;const l=i?nP(()=>JSON.parse(atob(decodeURIComponent(i))))||nP(()=>JSON.parse(decodeURIComponent(i))):null;return l&&l.action==="ph_authorize"?(o=l,o.source="url",o&&Object.keys(o).length>0&&(l.desiredHash?t.hash=l.desiredHash:n?n.replaceState(n.state,"",t.pathname+t.search):t.hash="")):(o=JSON.parse(e.getItem(g3)||"{}"),o.source="localstorage",delete o.userIntent),!(!o.token||this.instance.config.token!==o.token||(this.loadToolbar(o),0))}catch{return!1}}ug(t){const e=tt.ph_load_toolbar||tt.ph_load_editor;!at(e)&&zn(e)?e(t,this.instance):v3.warn("No toolbar load function found")}loadToolbar(t){const e=!!(Oe!=null&&Oe.getElementById("__POSTHOG_TOOLBAR__"));if(!le||e)return!1;const n=this.instance.requestRouter.region==="custom"&&this.instance.config.advanced_disable_toolbar_metrics,r=j(j({token:this.instance.config.token},t),{},{apiURL:this.instance.requestRouter.endpointFor("ui")},n?{instrument:!1}:{});if(le.localStorage.setItem(g3,JSON.stringify(j(j({},r),{},{source:void 0}))),this.lg()===2)this.ug(r);else if(this.lg()===0){var s,i;this.ag(1),(s=tt.__PosthogExtensions__)===null||s===void 0||(i=s.loadExternalDependency)===null||i===void 0||i.call(s,this.instance,"toolbar",o=>{if(o)return v3.error("[Toolbar] Failed to load",o),void this.ag(0);this.ag(2),this.ug(r)}),Dt(le,"turbolinks:load",()=>{this.ag(0),this.loadToolbar(r)})}return!0}cg(t){return this.loadToolbar(t)}maybeLoadEditor(t=void 0,e=void 0,n=void 0){return this.maybeLoadToolbar(t,e,n)}}},YW=j({experiments:class mr{get Pr(){return this._instance.config}constructor(e){this._instance=e,this.getWebExperimentsAndEvaluateDisplayLogic=(n=!1)=>{this.getWebExperiments(r=>{mr.hg("retrieved web experiments from the server"),this.dg=new Map,r.forEach(s=>{if(s.feature_flag_key){var i;this.dg&&(mr.hg("setting flag key ",s.feature_flag_key," to web experiment ",s),(i=this.dg)===null||i===void 0||i.set(s.feature_flag_key,s));const o=this._instance.getFeatureFlag(s.feature_flag_key);ht(o)&&s.variants[o]&&this.vg(s,o)}else if(s.variants)for(const o in s.variants){const l=s.variants[o];mr.fg(l,this._instance)&&this.pg(s.name,o,l.transforms)}})},n)},this._instance.onFeatureFlags(n=>{this.onFeatureFlags(n)})}initialize(){}onFeatureFlags(e){if(this._is_bot())mr.hg(z3);else if(!this.Pr.disable_web_experiments){if(at(this.dg))return this.dg=new Map,this.loadIfEnabled(),void this.previewWebExperiment();mr.hg("applying feature flags",e),e.forEach(n=>{var r;if(this.dg&&(!((r=this.dg)===null||r===void 0)&&r.has(n))){var s;const i=this._instance.getFeatureFlag(n),o=(s=this.dg)===null||s===void 0?void 0:s.get(n);i&&(o!=null&&o.variants[i])&&this.vg(o,i)}})}}previewWebExperiment(){const e=mr.getWindowLocation();if(e!=null&&e.search){const n=xf(e==null?void 0:e.search,"__experiment_id"),r=xf(e==null?void 0:e.search,"__experiment_variant");n&&r&&(mr.hg(`previewing web experiments ${n} && ${r}`),this.getWebExperiments(s=>{this.gg(parseInt(n),r,s)},!1,!0))}}loadIfEnabled(){this.Pr.disable_web_experiments||this.getWebExperimentsAndEvaluateDisplayLogic()}getWebExperiments(e,n,r){if(this.Pr.disable_web_experiments&&!r)return e([]);const s=this._instance.get_property("$web_experiments");if(s&&!n)return e(s);this._instance._send_request({url:this._instance.requestRouter.endpointFor("api",`/api/web_experiments/?token=${this.Pr.token}`),method:"GET",timestampMode:"query",callback:i=>e(i.statusCode===200&&i.json&&i.json.experiments||[])})}gg(e,n,r){const s=r.filter(i=>i.id===e);s&&s.length>0&&(mr.hg(`Previewing web experiment [${s[0].name}] with variant [${n}]`),this.pg(s[0].name,n,s[0].variants[n].transforms))}vg(e,n){const r=e.variants[n];mr.mg(r,this._instance)?this.pg(e.name,n,r.transforms):mr.hg(`skipping variant ${n} of experiment ${e.name} because this page does not match its url conditions`)}static fg(e,n){return!at(e.conditions)&&mr.mg(e,n)&&mr.yg(e)}static mg(e,n){var r;if(at(e.conditions)||at((r=e.conditions)===null||r===void 0?void 0:r.url))return!0;const s=mr.getWindowLocation();if(s){var i,o,l;const c=b5(n,s.href);return!(!((i=e.conditions)===null||i===void 0)&&i.url)||PW[(o=(l=e.conditions)===null||l===void 0?void 0:l.urlMatchType)!==null&&o!==void 0?o:"icontains"](e.conditions.url,c)}return!1}static getWindowLocation(){return le==null?void 0:le.location}static yg(e){var n;if(at(e.conditions)||at((n=e.conditions)===null||n===void 0?void 0:n.utm))return!0;const r=L5();if(r.utm_source){var s,i,o,l,c,d,f,h;const m=!(!((s=e.conditions)===null||s===void 0||(s=s.utm)===null||s===void 0)&&s.utm_campaign)||((i=e.conditions)===null||i===void 0||(i=i.utm)===null||i===void 0?void 0:i.utm_campaign)==r.utm_campaign,v=!(!((o=e.conditions)===null||o===void 0||(o=o.utm)===null||o===void 0)&&o.utm_source)||((l=e.conditions)===null||l===void 0||(l=l.utm)===null||l===void 0?void 0:l.utm_source)==r.utm_source,_=!(!((c=e.conditions)===null||c===void 0||(c=c.utm)===null||c===void 0)&&c.utm_medium)||((d=e.conditions)===null||d===void 0||(d=d.utm)===null||d===void 0?void 0:d.utm_medium)==r.utm_medium,y=!(!((f=e.conditions)===null||f===void 0||(f=f.utm)===null||f===void 0)&&f.utm_term)||((h=e.conditions)===null||h===void 0||(h=h.utm)===null||h===void 0?void 0:h.utm_term)==r.utm_term;return m&&_&&y&&v}return!1}static hg(e,...n){ye.info(`[WebExperiments] ${e}`,n)}static bg(e,...n){ye.warn(`[WebExperiments] ${e}`,n)}static _g(e){(e.namespaceURI==="http://www.w3.org/1999/xhtml"&&e.localName==="template"?e.content:e).querySelectorAll("a[target], template").forEach(n=>{var r;if(n.localName==="template")return void(n.namespaceURI==="http://www.w3.org/1999/xhtml"&&mr._g(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(" "))})}pg(e,n,r){this._is_bot()?mr.hg(z3):n!=="control"?r.forEach(s=>{if(s.selector){var i;mr.hg(`applying transform of variant ${n} for experiment ${e} `,s);const o=(i=document)===null||i===void 0?void 0:i.querySelectorAll(s.selector);if(!(o!=null&&o.length))return void mr.bg(`no element on this page matches selector ${s.selector} of variant ${n} for experiment ${e}`);const l=new Map;o==null||o.forEach(c=>{if(c.localName.toLowerCase()==="script")return;const d=c;if(s.html){var f;const m=c.namespaceURI==="http://www.w3.org/1998/Math/MathML"&&c.localName==="annotation-xml"&&((f=c.getAttribute("encoding"))===null||f===void 0?void 0:f.toLowerCase())||"",v=JSON.stringify([c.namespaceURI,c.localName,m]);let _=l.get(v);if(at(_)){var h;const y=(h=H3)!==null&&h!==void 0?h:H3=CW(),w=c.ownerDocument.implementation.createHTMLDocument(""),x=w.createElementNS(c.namespaceURI,c.localName);m&&x.setAttribute("encoding",m);const k=w.createRange();k.selectNodeContents(x);const P=c.namespaceURI==="http://www.w3.org/2000/svg"&&/^(foreignObject|desc|title)$/.test(c.localName)||/^(text\/html|application\/xhtml\+xml)$/.test(m)?"http://www.w3.org/1999/xhtml":c.namespaceURI,C=k.createContextualFragment(s.html);c.namespaceURI==="http://www.w3.org/1998/Math/MathML"&&/^(mi|mo|mn|ms|mtext)$/.test(c.localName)?(x.appendChild(C),y.sanitize(x,j(j({},V3),{},{NAMESPACE:P||void 0,IN_PLACE:!0}))):(x.namespaceURI==="http://www.w3.org/1999/xhtml"&&x.localName==="template"?x.content:x).appendChild(y.sanitize(C,j(j({},V3),{},{NAMESPACE:P||void 0,RETURN_DOM_FRAGMENT:!0}))),mr._g(x),_=x.innerHTML,l.set(v,_)}d.innerHTML=_}s.css&&d.setAttribute("style",s.css)})}}):mr.hg("Control variants leave the page unmodified.")}_is_bot(){return Jr&&this._instance?oM(Jr,this.Pr.custom_blocked_useragents):void 0}}},R1),XW={conversations:class{constructor(t){this._instance=t,this.wg=void 0,this._conversationsManager=null,this.kg=!1,this.ie=null,this.Sg=!1,this.xg=0,this.$g=null,this.Cg=null}initialize(){this.loadIfEnabled()}onRemoteConfig(t){if(this._instance.config.disable_conversations)return void(this.$g=null);if(this.Tg=t.ok,!t.ok)return;const e=t.config.conversations;at(e)?this.$g=null:(Ns(e)?this.wg=e:(this.wg=e.enabled,this.ie=e),this.wg||(this.$g=null),this.loadIfEnabled())}reset(){var t;(t=this._conversationsManager)===null||t===void 0||t.reset(),this._conversationsManager=null,this.xg++,this.wg=void 0,this.ie=null,this.Tg=void 0,this.Sg=!1,this.$g=null}loadIfEnabled(){if(this._conversationsManager||this.kg||this._instance.config.disable_conversations||wb(this._instance.config)||this._instance.config.cookieless_mode&&this._instance.consent.isOptedOut())return;const t=tt==null?void 0:tt.__PosthogExtensions__;if(t&&!ue(this.wg)&&this.wg)if(this.ie&&this.ie.token){this.kg=!0;try{const e=t.initConversations;if(e)return this.Ig(e),void(this.kg=!1);const n=t.loadExternalDependency;if(!n)return void this.Mg(ZS);const r=this.xg;n(this._instance,"conversations",s=>{if(r!==this.xg)return this.kg=!1,void this.loadIfEnabled();s||!t.initConversations?this.Mg("Could not load conversations script",s):this.Ig(t.initConversations),this.kg=!1})}catch(e){this.Mg("Error initializing conversations",e),this.kg=!1}}else Zi.error("Conversations enabled but missing token in remote config.")}Ig(t){if(this.ie){try{this._conversationsManager=t(this.ie,this._instance),this.Sg=!1,Zi.info("Conversations loaded successfully")}catch(e){return void this.Mg("Error completing conversations initialization",e)}this.Cg&&this._conversationsManager.setTheme(this.Cg),this.Eg()}else Zi.error("Cannot complete initialization: remote config is null")}Eg(){const t=this.$g;this.$g=null,this._conversationsManager&&t&&(t==="open"?this._conversationsManager.open():this._conversationsManager.close())}Mg(t,e){Zi.error(t,e),this._conversationsManager=null,this.kg=!1,this.Sg=!0}show(){this._conversationsManager?this._conversationsManager.show():Zi.warn("Conversations not loaded yet.")}hide(){this.$g==="open"&&(this.$g=null),this._conversationsManager&&this._conversationsManager.hide()}open(){this._conversationsManager?(this.$g=null,this._conversationsManager.open()):this.$g="open"}close(){this._conversationsManager?(this.$g=null,this._conversationsManager.close()):this.$g="close"}setTheme(t){var e,n;this.Cg=j(j(j({},this.Cg),t),{},{dark:j(j({},(e=this.Cg)===null||e===void 0?void 0:e.dark),t==null?void 0:t.dark)}),(n=this._conversationsManager)===null||n===void 0||n.setTheme(t)}isAvailable(){return this.wg===!0&&!Mn(this._conversationsManager)}getUnavailableReason(){return this.isAvailable()?null:this._instance.config.disable_conversations?"disabled_by_config":wb(this._instance.config)?"disabled_for_toolbar":this._instance.config.cookieless_mode&&this._instance.consent.isOptedOut()?"consent_opted_out":this.Tg===!1?"remote_config_failed":ue(this.wg)?this.Tg?"disabled_in_project":"remote_config_pending":this.wg?at(this.ie)||!this.ie.token?"missing_token":tt!=null&&tt.__PosthogExtensions__?this.kg?"initializing":this.Sg?"load_failed":"not_loaded":"extensions_unavailable":"disabled_in_project"}isVisible(){var t,e;return(t=(e=this._conversationsManager)===null||e===void 0?void 0:e.isVisible())!==null&&t!==void 0&&t}sendMessage(t,e,n){var r=this;return hn(function*(){return r._conversationsManager?r._conversationsManager.sendMessage(t,e,n):(Zi.warn(qc),null)})()}getMessages(t,e){var n=this;return hn(function*(){return n._conversationsManager?n._conversationsManager.getMessages(t,e):(Zi.warn(qc),null)})()}markAsRead(t){var e=this;return hn(function*(){return e._conversationsManager?e._conversationsManager.markAsRead(t):(Zi.warn(qc),null)})()}getTickets(t){var e=this;return hn(function*(){return e._conversationsManager?e._conversationsManager.getTickets(t):(Zi.warn(qc),null)})()}requestRestoreLink(t){var e=this;return hn(function*(){return e._conversationsManager?e._conversationsManager.requestRestoreLink(t):(Zi.warn(qc),null)})()}restoreFromToken(t){var e=this;return hn(function*(){return e._conversationsManager?e._conversationsManager.restoreFromToken(t):(Zi.warn(qc),null)})()}restoreFromUrlToken(){var t=this;return hn(function*(){return t._conversationsManager?t._conversationsManager.restoreFromUrlToken():(Zi.warn(qc),null)})()}getCurrentTicketId(){var t,e;return(t=(e=this._conversationsManager)===null||e===void 0?void 0:e.getCurrentTicketId())!==null&&t!==void 0?t:null}getWidgetSessionId(){var t,e;return(t=(e=this._conversationsManager)===null||e===void 0?void 0:e.getWidgetSessionId())!==null&&t!==void 0?t:null}kd(){var t;(t=this._conversationsManager)===null||t===void 0||t.setIdentity()}Sd(){var t;(t=this._conversationsManager)===null||t===void 0||t.clearIdentity()}}},QW={logs:class extends RW{constructor(t){super({get(){var e;return t==null||(e=t.config)===null||e===void 0?void 0:e.logs},captureHintKey:e5,get remoteConfigWillArrive(){var e,n;return!(!((e=t.tc)===null||e===void 0)&&e.call(t))||!!(!((n=tt._POSTHOG_REMOTE_CONFIG)===null||n===void 0||(n=n[t.config.token])===null||n===void 0)&&n.config)}},()=>(function(e){var n;const r={};if(r.distinctId=e.get_distinct_id(),e.sessionManager){const{sessionId:s,windowId:i,sessionStartTimestamp:o,lastActivityTimestamp:l}=e.sessionManager.checkAndGetSessionAndWindowId(!0);r.sessionId=s,r.windowId=i,at(o)||(r.sessionStartTimestamp=o),at(l)||(r.lastActivityTimestamp=l)}if(!(tt==null||(n=tt.location)===null||n===void 0)&&n.href&&(r.currentUrl=e.config.disable_capture_url_hashes?oc(tt.location.href):tt.location.href),e.featureFlags){const s=e.featureFlags.getFlags();s&&s.length>0&&(r.activeFeatureFlags=s)}return r})(t)),this._instance=t,this.name=mM,this.nf()}get ef(){return this._instance.__loaded}if(){const t=Pn("[logs]"),e=tt==null?void 0:tt.__PosthogExtensions__;if(!e)return void t.error("PostHog Extensions not found.");const n=e.loadExternalDependency;if(n)return r=>{n(this._instance,"logs",s=>{const i=e.logs;r(s,i!=null&&i.initializeLogs?{initialize:o=>i.initializeLogs(o),replay(o,l){var c;return(c=i.replayConsoleBuffer)===null||c===void 0?void 0:c.call(i,o,l)}}:void 0)})};t.error(ZS)}}},JW={metrics:class{constructor(t){this._instance=t,this.A=Pn("[metrics]"),this.Ti=!1}initialize(){this.onConfigChange()}onConfigChange(){var t;if(this.Ti)return;const e=!!(!((t=this._instance.config.metrics)===null||t===void 0)&&t.network);e&&!this.Ag?this.Ag=(n=>{let r=!0;const s=()=>r?(l=>{var c;const d=(c=l.config.metrics)===null||c===void 0?void 0:c.network;return d===!0?{}:d||void 0})(n):void 0,i=MW(n,s),o=NW(n,s);return()=>{r=!1,i(),o()}})(this._instance):!e&&this.Ag&&(this.Ag(),this.Ag=void 0)}af(){var t;const e=(t=this._instance)===null||t===void 0||(t=t.config)===null||t===void 0?void 0:t.metrics;var n;return this.Xv&&this.lf===e||((n=this.Xv)===null||n===void 0||n.reset(),this.lf=e,this.Xv=new QU(this.rf(),(function(r){var s,i,o,l,c;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:(l=r==null?void 0:r.flushIntervalMs)!==null&&l!==void 0?l:1e4,maxSeriesPerFlush:(c=r==null?void 0:r.maxSeriesPerFlush)!==null&&c!==void 0?c:1e3}})(e),this.A)),this.Xv}count(t,e=1,n){this.af().count(t,e,n)}gauge(t,e,n){this.af().gauge(t,e,n)}histogram(t,e,n){this.af().histogram(t,e,n)}flush(t){if(!this.Xv)return Promise.resolve();if(t){const e=this.Xv.drainWindow();return e&&this._o(e,t),Promise.resolve()}return this.Xv.flush().catch(e=>this.A.error("PostHog metrics flush failed:",e))}reset(){var t;(t=this.Xv)===null||t===void 0||t.reset()}dispose(){var t,e;this.Ti=!0,(t=this.Ag)===null||t===void 0||t.call(this),this.Ag=void 0,(e=this.Xv)===null||e===void 0||e.reset()}rf(){const t=this._instance,e=this;return{get isDisabled(){return!1},get optedOut(){return!t.is_capturing()},_o:n=>e._o(n),getLibraryId:()=>Zs.LIB_NAME,getLibraryVersion:()=>Zs.LIB_VERSION}}_o(t,e){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(j(j({method:"POST",url:this.Rg(),data:t,compression:"best-available",batchKey:"metrics"},e&&{transport:e}),{},{fireCallbackOnDrop:!0,callback(o){const l=o.statusCode;if(l>=200&&300>l)s({kind:"ok"});else if(l===413)s({kind:"too-large"});else if(l!==0&&l!==408&&l!==429&&500>l)s({kind:"fatal",error:new Error(`metrics request failed with status ${l}`)});else{var c;s({kind:"retry-later",error:(c=o.error)!==null&&c!==void 0?c:new Error(`metrics request failed with status ${l}`)})}}}))})}Rg(){return this._instance.requestRouter.endpointFor("api","/i/v1/metrics")+"?token="+encodeURIComponent(this._instance.config.token)}}},eq={webMCP:class{constructor(t){this._instance=t,this.Pg=!1}initialize(){this.startIfEnabled()}startIfEnabled(){if(!this._instance.config.capture_webmcp||this.Pg)return;const t=Oe==null?void 0:Oe.modelContext;if(!t||!zn(t.registerTool))return;const e=W3.get(t);if(e)return e.instances.add(this._instance),void(this.Pg=!0);const n={instances:new Set([this._instance])},r=t.registerTool,s=this;Ef(t,"registerTool",i=>{const o=i;return function(l,...c){let d=l;try{d=s.Og(l,n)}catch{return o.call(this,l,...c)}return o.call(this,d,...c)}}),t.registerTool!==r&&(W3.set(t,n),this.Pg=!0)}Og(t,e){if(!t||!zn(t.execute))return t;const n=t.execute,r=this,{tool:s,injected:i}=(function(o,l){const c={intent:!1,model:!1},d=o.inputSchema;if(!(function(_){return!!ue(_)||dt(_)&&Object.keys(_).every(y=>LW.has(y)||y.startsWith("x-"))&&_.additionalProperties!==!0&&!dt(_.additionalProperties)&&(!_.type||_.type==="object")&&(!_.properties||dt(_.properties))&&(!_.required||We(_.required))})(d))return{tool:$2(o),injected:c};const f=(d==null?void 0:d.properties)||{},h=_=>D2(f,_)||We(d==null?void 0:d.required)&&d.required.includes(_);if(c.intent=l.intent&&!h("context"),c.model=l.model&&!h("llm_model"),!c.intent&&!c.model)return{tool:$2(o),injected:c};const m=j({},f),v=We(d==null?void 0:d.required)?[...d.required]:[];return c.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")),c.model&&(m.llm_model={type:"string",description:'The exact model identifier you are running as, taken from your system prompt or environment. Pass "unknown" if you do not know it. Never guess.'},v.includes("llm_model")||v.push("llm_model")),{tool:$2(o,j(j({},d),{},{type:(d==null?void 0:d.type)||"object",properties:m,required:v})),injected:c}})(t,(function(o){const l={intent:!1,model:!1};for(const c of o.instances){const d=q3(c.config.capture_webmcp);l.intent||(l.intent=(d==null?void 0:d.intent)===!0),l.model||(l.model=(d==null?void 0:d.model)===!0)}return l})(e));return Object.defineProperty(s,"execute",{configurable:!0,enumerable:!0,writable:!0,value(...o){const l=new Date,c=(function(v,_){if(!dt(v))return{};try{const y=_.intent?G3(v.context,2048,!0):void 0,w=_.model?G3(v.llm_model,256):void 0;return j(j({},y&&y!=="{}"?{intent:y}:{}),w&&w.toLowerCase()!=="unknown"?{model:w}:{})}catch{return{}}})(o[0],i),d=(function(v,_){const y=v[0];if(!dt(y))return v;try{const w=_.intent&&D2(y,"context"),x=_.model&&D2(y,"llm_model");if(!w&&!x)return v;const k=j({},y);return w&&delete k.context,x&&delete k.llm_model,[k,...v.slice(1)]}catch{return v}})(o,i);let f;try{f=n.apply(this===s?t:this,d)}catch(v){throw r.Fg(e,s,l,{error:v,errorResult:!1},c),v}if((h=f)&&typeof h.then=="function")return Promise.resolve(f).then(v=>{const _=K3(v)?{error:v,errorResult:!0}:void 0;return r.Fg(e,s,l,_,c),v},v=>{throw r.Fg(e,s,l,{error:v,errorResult:!1},c),v});var h;const m=K3(f)?{error:f,errorResult:!0}:void 0;return r.Fg(e,s,l,m,c),f}}),s}Fg(t,e,n,r,s){const i=Date.now()-n.getTime();let o;for(const c of t.instances){var l;const d=q3(c.config.capture_webmcp);if(d){r&&!o&&(o=VW(r.error,r.errorResult));try{c.capture("$mcp_tool_call",j(j(j({$mcp_source:"posthog_mcp_analytics",$mcp_interface:"webmcp",$mcp_tool_name:e.name,$mcp_resource_name:e.name,$mcp_tool_description:e.description,$mcp_server_name:dn==null?void 0:dn.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&&c.exceptions&&(!((l=c.exceptionObserver)===null||l===void 0)&&l.isEnabled))try{const f={$exception_list:FW(c.exceptions,r,o.message),$exception_level:"error",$exception_source:"mcp.tool_call",$mcp_interface:"webmcp",$mcp_tool_name:e.name,$mcp_resource_name:e.name,$mcp_tool_description:e.description,$mcp_server_name:dn==null?void 0:dn.hostname};c.exceptionObserver.captureException(f)}catch{}}}}}};kp.__defaultExtensionClasses=j({},j(j(j(j(j(j(j(j(j(j(j(j(j(j({},R1),HW),UW),BW),ZW),WW),GW),qW),KW),YW),XW),QW),JW),eq));const tq=(function(){Zs.SDK_DIST_CHANNEL="npm";const t=xp[np]=new kp;return(function(){function e(){e.done||(e.done=!0,sM=!1,Wt(xp,function(n){n._dom_loaded()}))}Oe!=null&&Oe.addEventListener?Oe.readyState==="complete"?e():Dt(Oe,"DOMContentLoaded",e,{capture:!1}):le&&ye.error("Browser doesn't support `document.addEventListener` so PostHog couldn't be initialized")})(),t})();var Qe=tq;function Lb(t){const e=Object.values(t).filter(r=>typeof r=="number");return Object.entries(t).filter(([r,s])=>e.indexOf(+r)===-1).map(([r,s])=>s)}function Y3(t,e="|"){return t.map(n=>PM(n)).join(e)}function Db(t,e){return typeof e=="bigint"?e.toString():e}class nq{constructor(e){this._getter=e,this._value=void 0}get value(){const e=this._getter;return e!==void 0&&(this._value=e(),this._getter=void 0),this._value}}function I1(t){return new nq(t)}function rq(t){return t==null}function lk(t){const e=t.startsWith("^")?1:0,n=t.endsWith("$")?t.length-1:t.length;return t.slice(e,n)}function sq(t,e){const n=t/e,r=Math.round(n),s=4*Number.EPSILON*Math.max(Math.abs(n),1);return Math.abs(n-r)<s?0:n-r}function sl(t,e,n){Object.defineProperty(t,e,{value:n,writable:!0,enumerable:!0,configurable:!0})}function ck(t){const e=Object.getOwnPropertyDescriptor(t,"shape");return e!=null&&e.get?e.get.raw:e==null?void 0:e.value}function Xa(t){return ck(t._zod.def)??t._zod.def.shape}function SM(t,e,n){Object.defineProperty(t,e,{get(){const r=n();return sl(this,e,r),r},enumerable:!0,configurable:!0})}function kM(t,e,n){e in t?sl(t,e,n):t[e]=n}function Lu(t,e,n,r){const s=Xa(e);for(const i of n){const o=Object.getOwnPropertyDescriptor(s,i);o.enumerable&&(o.get?SM(t,i,()=>{const l=e._zod.def.shape[i];return r?r(l,i):l}):kM(t,i,r?r(o.value,i):o.value))}}function iq(t,e){for(const n of Reflect.ownKeys(e)){const r=Object.getOwnPropertyDescriptor(e,n);r.enumerable&&(r.get?SM(t,n,()=>e[n]):kM(t,n,r.value))}}function yi(...t){const e={};for(const n of t){const r=Object.getOwnPropertyDescriptors(n);Object.assign(e,r)}return Object.defineProperties({},e)}function oq(t){return JSON.stringify(t)}function aq(t){return t.toLowerCase().trim().replace(/[^\w\s-]/g,"").replace(/[\s_-]+/g,"-").replace(/^-+|-+$/g,"")}const EM="captureStackTrace"in Error?Error.captureStackTrace:(...t)=>{};function Bp(t){return typeof t=="object"&&t!==null&&!Array.isArray(t)}const lq=I1(()=>{var t;if(Po.jitless||typeof navigator<"u"&&((t=navigator==null?void 0:navigator.userAgent)!=null&&t.includes("Cloudflare")))return!1;try{const e=Function;return new e(""),!0}catch{return!1}});function Cf(t){if(Bp(t)===!1)return!1;const e=t.constructor;if(e===void 0||typeof e!="function")return!0;const n=e.prototype;return!(Bp(n)===!1||Object.prototype.hasOwnProperty.call(n,"isPrototypeOf")===!1)}function CM(t){return Cf(t)?{...t}:Array.isArray(t)?[...t]:t instanceof Map?new Map(t):t instanceof Set?new Set(t):t}const cq=new Set(["string","number","symbol"]);function Pf(t){return t.replace(/[.*+?^${}()|[\]\\]/g,"\\$&")}function bc(t,e,n){const r=new t._zod.constr(e??t._zod.def);return(!e||n!=null&&n.parent)&&(r._zod.parent=t),r}function it(t){const e=t;if(!e)return{};if(typeof e=="string")return{error:()=>e};if((e==null?void 0:e.message)!==void 0){if((e==null?void 0:e.error)!==void 0)throw new Error("Cannot specify both `message` and `error` params");e.error=e.message}return delete e.message,typeof e.error=="string"?{...e,error:()=>e.error}:e}function PM(t){return typeof t=="bigint"?t.toString()+"n":typeof t=="string"?`"${t}"`:`${t}`}function uq(t){return Object.keys(t).filter(e=>t[e]._zod.optin!==void 0&&t[e]._zod.optout==="optional")}const AM={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]},dq={int64:[BigInt("-9223372036854775808"),BigInt("9223372036854775807")],uint64:[BigInt(0),BigInt("18446744073709551615")]};function fq(t,e){const n=t._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 Lu(i,t,O1(t,e)),bc(t,yi(n,{shape:i,checks:[]}))}function O1(t,e){var s;const n=Xa(t),r=[];for(const i of Reflect.ownKeys(e)){if(!((s=Object.getOwnPropertyDescriptor(n,i))!=null&&s.enumerable))throw new Error(`Unrecognized key: "${String(i)}"`);e[i]&&r.push(i)}return r}function hq(t,e){const n=t._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(O1(t,e)),o={};return Lu(o,t,Reflect.ownKeys(Xa(t)).filter(l=>!i.has(l))),bc(t,yi(n,{shape:o,checks:[]}))}function pq(t,e){if(!Cf(e))throw new Error("Invalid input to extend: expected a plain object");const n=t._zod.def.checks;if(n&&n.length>0){const s=Xa(t);for(const i of Reflect.ownKeys(e))if(Object.getOwnPropertyDescriptor(s,i)!==void 0)throw new Error("Cannot overwrite keys on object schemas containing refinements. Use `.safeExtend()` instead.")}return bc(t,yi(t._zod.def,{shape:TM(t,e)}))}function TM(t,e){const n={};return Lu(n,t,Reflect.ownKeys(Xa(t))),iq(n,e),n}function mq(t,e){if(!Cf(e))throw new Error("Invalid input to safeExtend: expected a plain object");return bc(t,yi(t._zod.def,{shape:TM(t,e)}))}function gq(t,e){var s,i;if(!((s=e==null?void 0:e._zod)!=null&&s.def))throw new Error("Invalid input to merge: expected an object schema. To merge a plain shape, use `.extend()`.");if((i=t._zod.def.checks)!=null&&i.length)throw new Error(".merge() cannot be used on object schemas containing refinements. Use .safeExtend() instead.");const n={};Lu(n,t,Reflect.ownKeys(Xa(t))),Lu(n,e,Reflect.ownKeys(Xa(e)));const r=yi(t._zod.def,{shape:n,get catchall(){return e._zod.def.catchall},checks:e._zod.def.checks??[]});return bc(t,r)}function X3(t,e,n,r="partial"){const i=e._zod.def.checks;if(i&&i.length>0)throw new Error(`.${r}() cannot be used on object schemas containing refinements`);const l=n?new Set(O1(e,n)):void 0,c={};return Lu(c,e,Reflect.ownKeys(Xa(e)),t&&((d,f)=>l&&!l.has(f)?d:new t({type:"optional",innerType:d}))),bc(e,yi(e._zod.def,{shape:c,checks:[]}))}function vq(t,e,n){const r=n?new Set(O1(e,n)):void 0,s={};return Lu(s,e,Reflect.ownKeys(Xa(e)),(i,o)=>r&&!r.has(o)?i:new t({type:"nonoptional",innerType:i})),bc(e,yi(e._zod.def,{shape:s}))}function Wa(t,e=0){var n;if(t.aborted===!0)return!0;for(let r=e;r<t.issues.length;r++)if(((n=t.issues[r])==null?void 0:n.continue)!==!0)return!0;return!1}function yq(t,e=0){var n;if(t.aborted===!0)return!0;for(let r=e;r<t.issues.length;r++)if(((n=t.issues[r])==null?void 0:n.continue)===!1)return!0;return!1}function Hd(t,e){return e.map(n=>{var r;return(r=n).path??(r.path=[]),n.path.unshift(t),n})}function Zh(t){return typeof t=="string"?t:t==null?void 0:t.message}function Q3(t){const e=[];for(const n of t??[]){const r=n._zod.def;if(!/_(length|size)$|_equals$/.test(r.check))break;const s=r.maximum??r.length??r.size;s>=0&&e.push([s,n])}return e}function $b(t,e,n){var r;for(let s=e;s<t.length;s++)(r=t[s]).schema??(r.schema=n)}function ac(t,e,n){var c,d,f,h,m,v,_,y,w,x;var r;const s=(d=(c=t.inst)==null?void 0:c._zod)==null?void 0:d.traits;s!=null&&s.has("$ZodType")&&(s.has("$ZodCheck")?(r=t).schema??(r.schema=t.inst):t.schema=t.inst);const i=t.schema!==t.inst?(h=(f=t.schema)==null?void 0:f._zod.def)==null?void 0:h.error:void 0,o=t.message?t.message:Zh((_=(v=(m=t.inst)==null?void 0:m._zod.def)==null?void 0:v.error)==null?void 0:_.call(v,t))??Zh(i==null?void 0:i(t))??Zh((y=e==null?void 0:e.error)==null?void 0:y.call(e,t))??Zh((w=n.customError)==null?void 0:w.call(n,t))??Zh((x=n.localeError)==null?void 0:x.call(n,t))??"Invalid input",l={};for(const k of Object.keys(t))k==="inst"||k==="schema"||k==="continue"||k==="input"||k==="__proto__"||(l[k]=t[k]);return l.path??(l.path=[]),l.message=o,e!=null&&e.reportInput&&(l.input=t.input),l}const _q=/[\uD800-\uDBFF]/;function uk(t){const e=t.length;if(!_q.test(t))return e;let n=e;for(let r=0;r<e-1;r++)(t.charCodeAt(r)&64512)===55296&&(t.charCodeAt(r+1)&64512)===56320&&(n--,r++);return n}function dk(t){return Array.isArray(t)?"array":typeof t=="string"?"string":"unknown"}function wq(t){const e=typeof t;switch(e){case"number":return Number.isNaN(t)?"nan":"number";case"object":{if(t===null)return"null";if(Array.isArray(t))return"array";const n=t;if(n&&Object.getPrototypeOf(n)!==Object.prototype&&"constructor"in n&&n.constructor)return n.constructor.name}}return e}function Zp(...t){const[e,n,r]=t;return typeof e=="string"?{message:e,code:"custom",input:n,inst:r}:{...e}}function bq(t,e){for(const n in e){const r=Object.getOwnPropertyDescriptor(e,n);r.get?Object.defineProperty(t,n,{...r,enumerable:!1}):xq(t,n,r.value)}}function lc(t,e,n,r=!0){return Object.defineProperty(t,e,{configurable:!0,writable:!0,enumerable:r,value:n}),n}function RM(t,e,n){return lc(t,e,n,!1)}function IM(t,e){for(const n in t){const r=t[n];Object.defineProperty(e,n,{configurable:!0,enumerable:!0,get(){return lc(this,n,r(this))},set(s){lc(this,n,s)}})}return e}function xq(t,e,n){Object.defineProperty(t,e,{configurable:!0,get(){return this==null?n:lc(this,e,n.bind(this))},set(r){lc(this,e,r)}})}function Sq(t,e){const n=Object.getPrototypeOf(t);return e in n?void 0:n}let j2,Ol=!1;const kq={configurable:!0,get(){Ol=!0}};function rn(t,e,n){const r=Object.getPrototypeOf(t._zod);if(e in r&&j2!==t._zod){j2=void 0;return}j2=t._zod,Object.defineProperty(r,e,{configurable:!0,get(){Object.defineProperty(this,e,kq);const s=Ol;Ol=!1;try{const i=n(this);return Ol?delete this[e]:Object.defineProperty(this,e,{configurable:!0,writable:!0,value:i}),Ol=Ol||s,i}catch(i){throw delete this[e],Ol=Ol||s,i}},set(s){Object.defineProperty(this,e,{configurable:!0,writable:!0,value:s})}})}function Eq(t,e,n,r){const s=Sq(t,e);s&&Object.defineProperty(s,e,{configurable:!0,get(){const i={configurable:!0,writable:!0,enumerable:r,value:void 0};return Object.defineProperty(this,e,i),i.value=n(this),Object.defineProperty(this,e,i),i.value},set(i){Object.defineProperty(this,e,{configurable:!0,writable:!0,enumerable:r,value:i})}})}const Cq="~constantCatch";function Pq(t){const e=()=>t;return e[Cq]=!0,e}var J3;const OM=Object.freeze({status:"aborted"}),F2={value:void 0,enumerable:!1};let eA="captureStackTrace"in Error?Error:null;function Aq(t){const e=eA;if(e){const n=e.stackTraceLimit;if(typeof n=="number"){try{e.stackTraceLimit=0}catch{return eA=null,new t}try{return new t}finally{e.stackTraceLimit=n}}}return new t}function me(t,e,n,r){const s={};function i(m){this.def=m,this.constr=h,this.traits=new Set}i.prototype=s;const o=n,l=o&&new WeakSet;function c(m,v){if(m._zod){if(m._zod.traits.has(t))return}else{F2.value=new i(v);try{Object.defineProperty(m,"_zod",F2)}finally{F2.value=void 0}}if(m._zod.traits.add(t),e(m,v),l){const y=Object.getPrototypeOf(m),w=m._zod.constr.prototype;let x=y;for(;x&&x!==w;)x=Object.getPrototypeOf(x);const k=x??y;l.has(k)||(l.add(k),bq(k,o))}const _=h.prototype;for(const y in _)Object.prototype.hasOwnProperty.call(_,y)&&(y in m||(m[y]=_[y].bind(m)))}const d=(r==null?void 0:r.Parent)??Object;class f extends d{}Object.defineProperty(f,"name",{value:t});function h(m){var w;const v=r!=null&&r.Parent?Aq(f):this;c(v,m);const _=v._zod.deferred;if(_){for(const x of _)x();v._zod.deferred=void 0}const y=(w=globalThis.__zod_globalConfig)==null?void 0:w.postProcessor;return y&&y(v),v}return Object.defineProperty(h,"init",{value:c}),Object.defineProperty(h,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(t)}}),Object.defineProperty(h,"name",{value:t}),h}class Su extends Error{constructor(){super("Encountered Promise during synchronous parse. Use .parseAsync() instead.")}}class MM extends Error{constructor(e){super(`Encountered unidirectional transform during encode: ${e}`),this.name="ZodEncodeError"}}(J3=globalThis).__zod_globalConfig??(J3.__zod_globalConfig={});const Po=globalThis.__zod_globalConfig;function oa(t){return t&&Object.assign(Po,t),Po}function Tq(){const t=this._zod;return t.message??(t.message=JSON.stringify(t.def,Db,2)),t.message}function Rq(t){this._zod.message=t}const Iq={get:Tq,set:Rq,enumerable:!0,configurable:!0},z2={value:void 0,enumerable:!1},tA=new WeakSet([Object.prototype,Error.prototype]),Oq=(t,e)=>{t.name="$ZodError",z2.value=e,Object.defineProperty(t,"issues",z2),z2.value=void 0,Object.defineProperty(t,"message",Iq);const n=Object.getPrototypeOf(t);tA.has(n)||(tA.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})}}))},Mq=me("$ZodError",Oq);function Nq(t,e,n){return Object.prototype.hasOwnProperty.call(t,e)||(e==="__proto__"?Object.defineProperty(t,e,{value:n(),writable:!0,enumerable:!0,configurable:!0}):t[e]=n()),t[e]}function Lq(t,e=n=>n.message){const n={},r=[];for(const s of t.issues)s.path.length>0?Nq(n,s.path[0],()=>[]).push(e(s)):r.push(e(s));return{formErrors:r,fieldErrors:n}}function Dq(t,e=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(l=>r({issues:l},[...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 l=[...i,...o.path];if(l.length===0)n._errors.push(e(o));else{let c=n,d=0;for(;d<l.length;){const f=l[d],h=d===l.length-1;if(f==="_errors"){h&&c._errors.push(e(o)),d++;continue}Object.prototype.hasOwnProperty.call(c,f)||Object.defineProperty(c,f,{value:{_errors:[]},enumerable:!0,writable:!0,configurable:!0});const m=c[f];h&&m._errors.push(e(o)),c=m,d++}}}};return r(t),n}function M1(t,e){return{callee:(e==null?void 0:e.callee)??t,Err:e==null?void 0:e.Err}}const fk=t=>{const e=(n,r,s,i)=>{const o=s?{...s,async:!1}:{async:!1},l=n._zod.run({value:r,issues:[]},o);if(l instanceof Promise)throw new Su;if(l.issues.length){const c=new((i==null?void 0:i.Err)??t)(l.issues.map(d=>ac(d,o,oa())));throw EM(c,(i==null?void 0:i.callee)??e),c}return l.value};return e},hk=t=>{const e=async(n,r,s,i)=>{const o=s?{...s,async:!0}:{async:!0};let l=n._zod.run({value:r,issues:[]},o);if(l instanceof Promise&&(l=await l),l.issues.length){const c=new((i==null?void 0:i.Err)??t)(l.issues.map(d=>ac(d,o,oa())));throw EM(c,(i==null?void 0:i.callee)??e),c}return l.value};return e},pk=t=>(e,n,r)=>{const s=r?{...r,async:!1}:{async:!1},i=e._zod.run({value:n,issues:[]},s);if(i instanceof Promise)throw new Su;return i.issues.length?NM(t,i.issues,s):{success:!0,data:i.value}};function NM(t,e,n){let r;return{success:!1,get error(){return r||(r=new t(e.map(s=>ac(s,n,oa()))),e=void 0,n=void 0),r},set error(s){r=s,e=void 0,n=void 0}}}const mk=t=>async(e,n,r)=>{const s=r?{...r,async:!0}:{async:!0};let i=e._zod.run({value:n,issues:[]},s);return i instanceof Promise&&(i=await i),i.issues.length?NM(t,i.issues,s):{success:!0,data:i.value}},$q=Symbol.for("zod.compile.invalid"),jq=Symbol.for("zod.compile.fallback"),Fq=((t,e,n)=>{const r=t._zod.bag.validator;if(r!==void 0){if(r(e)!==$q)return!0;if(r.definite===!0&&n===void 0)return!1}return zq(t,e,n)});function zq(t,e,n){const r=n?{...n,async:!1,abortEarly:!0}:{async:!1,abortEarly:!0},s=t._zod.bag.fallbackRun;let i;if(s?(r[jq]=!0,i=s({value:e,issues:[]},r)):i=t._zod.run({value:e,issues:[]},r),i instanceof Promise)throw new Su;return i.issues.length===0}const Vq=async(t,e,n)=>{const r=n?{...n,async:!0,abortEarly:!0}:{async:!0,abortEarly:!0};let s=t._zod.run({value:e,issues:[]},r);return s instanceof Promise&&(s=await s),s.issues.length===0},Hq=t=>{const e=fk(t),n=(r,s,i,o)=>{const l=i?{...i,direction:"backward"}:{direction:"backward"};return e(r,s,l,M1(n,o))};return n},Uq=t=>{const e=fk(t),n=(r,s,i,o)=>e(r,s,i,M1(n,o));return n},Bq=t=>{const e=hk(t),n=async(r,s,i,o)=>{const l=i?{...i,direction:"backward"}:{direction:"backward"};return await e(r,s,l,M1(n,o))};return n},Zq=t=>{const e=hk(t),n=async(r,s,i,o)=>await e(r,s,i,M1(n,o));return n},Wq=t=>(e,n,r)=>{const s=r?{...r,direction:"backward"}:{direction:"backward"};return pk(t)(e,n,s)},qq=t=>(e,n,r)=>pk(t)(e,n,r),Gq=t=>async(e,n,r)=>{const s=r?{...r,direction:"backward"}:{direction:"backward"};return mk(t)(e,n,s)},Kq=t=>async(e,n,r)=>mk(t)(e,n,r),Yq=/^[cC][0-9a-z]{6,}$/,Xq=/^[0-9a-z]+$/,Qq=/^[0-7][0-9A-HJKMNP-TV-Za-hjkmnp-tv-z]{25}$/,Jq=/^[0-9a-vA-V]{20}$/,eG=/^[A-Za-z0-9]{27}$/,tG=/^[a-zA-Z0-9_-]{21}$/;function nG(t){return new RegExp(`^[a-zA-Z0-9_-]{${t}}$`)}const rG=/^P(?:(\d+W)|(?!.*W)(?=\d|T\d)(\d+Y)?(\d+M)?(\d+D)?(T(?=\d)(\d+H)?(\d+M)?(\d+([.,]\d+)?S)?)?)$/,sG=/^([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})$/,nA=t=>t?new RegExp(`^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-${t}[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)$/,iG=/^(?:[A-Za-z0-9_'+\-]+\.)*[A-Za-z0-9_'+\-]*[A-Za-z0-9_+-]@(?:[A-Za-z0-9][A-Za-z0-9\-]*\.)+[A-Za-z]{2,}$/,oG="^(?=[\\s\\S]*[\\p{Extended_Pictographic}\\p{Regional_Indicator}\\u20E3])[\\p{Extended_Pictographic}\\p{Emoji_Component}]+$";function aG(){return new RegExp(oG,"u")}const lG=/^(?:(?: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])$/,cG=/^(([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}|:))$/,uG=/^((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])$/,dG=/^(([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])$/,fG=/^$|^(?:[0-9a-zA-Z+/]{4})*(?:(?:[0-9a-zA-Z+/]{2}==)|(?:[0-9a-zA-Z+/]{3}=))?$/,hG=/^(?:[A-Za-z0-9_-]{4})*(?:[A-Za-z0-9_-]{2,3})?$/,pG=/^https?$/,mG=/^\+[1-9]\d{6,14}$/,LM="(?:(?:\\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 gG(t){return new RegExp(`^${t}$`)}const vG=gG(LM);function jb(t){const e="(?:[01]\\d|2[0-3]):[0-5]\\d";return typeof t.precision=="number"?t.precision===-1?`${e}`:t.precision===0?`${e}:[0-5]\\d`:`${e}:[0-5]\\d\\.\\d{${t.precision}}`:t.seconds?`${e}:[0-5]\\d(?:\\.\\d+)?`:`${e}(?::[0-5]\\d(?:\\.\\d+)?)?`}function yG(t){return new RegExp(`^${jb(t)}$`)}function _G(t){const e=["Z"];t.offset&&e.push("([+-](?:[01]\\d|2[0-3]):[0-5]\\d)");const n=`${jb({precision:t.precision,seconds:!0})}(?:${e.join("|")})`,r=t.local?`${n}|${jb({precision:t.precision})}`:n;return new RegExp(`^${LM}T(?:${r})$`)}const wG=/^[\s\S]{0,}$/,bG=/^-?\d+$/,gk=/^-?\d+(?:\.\d+)?$/,xG=/^(?:true|false)$/i,SG=/^[^A-Z]*$/,kG=/^[^a-z]*$/,si=me("$ZodCheck",(t,e)=>{var n;t._zod??(t._zod={}),t._zod.def=e,(n=t._zod).onattach??(n.onattach=[])}),vk=t=>{const e=t.value;return!rq(e)&&e.length!==void 0},Mv={number:"number",bigint:"bigint",object:"date"},DM=me("$ZodCheckLessThan",(t,e)=>{si.init(t,e);const n=Mv[typeof e.value];t._zod.check=r=>{(e.inclusive?r.value<=e.value:r.value<e.value)||r.issues.push({origin:Mv[typeof r.value]??n,code:"too_big",maximum:typeof e.value=="object"?e.value.getTime():e.value,input:r.value,inclusive:e.inclusive,inst:t,continue:!e.abort})}}),$M=me("$ZodCheckGreaterThan",(t,e)=>{si.init(t,e);const n=Mv[typeof e.value];t._zod.check=r=>{(e.inclusive?r.value>=e.value:r.value>e.value)||r.issues.push({origin:Mv[typeof r.value]??n,code:"too_small",minimum:typeof e.value=="object"?e.value.getTime():e.value,input:r.value,inclusive:e.inclusive,inst:t,continue:!e.abort})}}),EG=me("$ZodCheckMultipleOf",(t,e)=>{si.init(t,e),t._zod.check=n=>{if(typeof n.value!=typeof e.value)throw new Error("Cannot mix number and bigint in multiple_of check.");(typeof n.value=="bigint"?e.value!==BigInt(0)&&n.value%e.value===BigInt(0):sq(n.value,e.value)===0)||n.issues.push({origin:typeof n.value,code:"not_multiple_of",divisor:e.value,input:n.value,inst:t,continue:!e.abort})}}),CG=me("$ZodCheckNumberFormat",(t,e)=>{var o;si.init(t,e),e.format=e.format||"float64";const n=(o=e.format)==null?void 0:o.includes("int"),r=n?"int":"number",[s,i]=AM[e.format];t._zod.check=l=>{const c=l.value;if(n){if(!Number.isInteger(c)){l.issues.push({expected:r,format:e.format,code:"invalid_type",continue:!1,input:c,inst:t});return}if(!Number.isSafeInteger(c)){c>0?l.issues.push({input:c,code:"too_big",maximum:Number.MAX_SAFE_INTEGER,note:"Integers must be within the safe integer range.",inst:t,origin:r,inclusive:!0,continue:!e.abort}):l.issues.push({input:c,code:"too_small",minimum:Number.MIN_SAFE_INTEGER,note:"Integers must be within the safe integer range.",inst:t,origin:r,inclusive:!0,continue:!e.abort});return}}c<s&&l.issues.push({origin:"number",input:c,code:"too_small",minimum:s,inclusive:!0,inst:t,continue:!e.abort}),c>i&&l.issues.push({origin:"number",input:c,code:"too_big",maximum:i,inclusive:!0,inst:t,continue:!e.abort})}}),PG=me("$ZodCheckMaxLength",(t,e)=>{var n;si.init(t,e),(n=t._zod.def).when??(n.when=vk),t._zod.check=r=>{const s=r.value,i=s.length;if((typeof s=="string"&&i>e.maximum?uk(s):i)<=e.maximum)return;const l=dk(s);r.issues.push({origin:l,code:"too_big",maximum:e.maximum,inclusive:!0,input:s,inst:t,continue:!e.abort})}}),AG=me("$ZodCheckMinLength",(t,e)=>{var n;si.init(t,e),(n=t._zod.def).when??(n.when=vk),t._zod.check=r=>{const s=r.value,i=s.length;if((typeof s=="string"&&i>=e.minimum&&i<e.minimum*2?uk(s):i)>=e.minimum)return;const l=dk(s);r.issues.push({origin:l,code:"too_small",minimum:e.minimum,inclusive:!0,input:s,inst:t,continue:!e.abort})}}),TG=me("$ZodCheckLengthEquals",(t,e)=>{var n;si.init(t,e),(n=t._zod.def).when??(n.when=vk),t._zod.check=r=>{const s=r.value,i=s.length,o=typeof s=="string"&&i>=e.length&&i<=e.length*2?uk(s):i;if(o===e.length)return;const l=dk(s),c=o>e.length;r.issues.push({origin:l,...c?{code:"too_big",maximum:e.length}:{code:"too_small",minimum:e.length},inclusive:!0,exact:!0,input:r.value,inst:t,continue:!e.abort})}}),N1=me("$ZodCheckStringFormat",(t,e)=>{var n,r;si.init(t,e),e.pattern?(n=t._zod).check??(n.check=s=>{e.pattern.lastIndex=0,!e.pattern.test(s.value)&&s.issues.push({origin:"string",code:"invalid_format",format:e.format,input:s.value,...e.pattern?{pattern:e.pattern.toString()}:{},inst:t,continue:!e.abort})}):(r=t._zod).check??(r.check=()=>{})}),RG=me("$ZodCheckRegex",(t,e)=>{N1.init(t,e),t._zod.check=n=>{e.pattern.lastIndex=0,!e.pattern.test(n.value)&&n.issues.push({origin:"string",code:"invalid_format",format:"regex",input:n.value,pattern:e.pattern.toString(),inst:t,continue:!e.abort})}}),IG=me("$ZodCheckLowerCase",(t,e)=>{e.pattern??(e.pattern=SG),N1.init(t,e)}),OG=me("$ZodCheckUpperCase",(t,e)=>{e.pattern??(e.pattern=kG),N1.init(t,e)}),MG=me("$ZodCheckIncludes",(t,e)=>{si.init(t,e);const n=Pf(e.includes),r=new RegExp(typeof e.position=="number"?`^.{${e.position},}${n}`:n);e.pattern=r,t._zod.check=s=>{s.value.includes(e.includes,e.position)||s.issues.push({origin:"string",code:"invalid_format",format:"includes",includes:e.includes,input:s.value,inst:t,continue:!e.abort})}}),NG=me("$ZodCheckStartsWith",(t,e)=>{si.init(t,e);const n=new RegExp(`^${Pf(e.prefix)}.*`);e.pattern??(e.pattern=n),t._zod.check=r=>{r.value.startsWith(e.prefix)||r.issues.push({origin:"string",code:"invalid_format",format:"starts_with",prefix:e.prefix,input:r.value,inst:t,continue:!e.abort})}}),LG=me("$ZodCheckEndsWith",(t,e)=>{si.init(t,e);const n=new RegExp(`.*${Pf(e.suffix)}$`);e.pattern??(e.pattern=n),t._zod.check=r=>{r.value.endsWith(e.suffix)||r.issues.push({origin:"string",code:"invalid_format",format:"ends_with",suffix:e.suffix,input:r.value,inst:t,continue:!e.abort})}}),DG=me("$ZodCheckOverwrite",(t,e)=>{si.init(t,e),t._zod.check=n=>{n.value=e.tx(n.value)}});class $G{constructor(e=[],n={}){this.content=[],this.indent=0,this.args=e,this.closed=n}indented(e){this.indent+=1;try{e(this)}finally{this.indent-=1}}write(e){if(typeof e=="function"){e(this,{execution:"sync"}),e(this,{execution:"async"});return}const r=e.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 e=Function,n=(this==null?void 0:this.content)??[""];return new e(...Object.keys(this.closed),`return function (${this.args.join(", ")}) {
|
|
23
|
-
${n.join(`
|
|
24
|
-
`)}
|
|
25
|
-
};`)(...Object.values(this.closed))}}const jG={major:4,minor:6,patch:7},Qn=me("$ZodType",(t,e)=>{var i;var n;t??(t={}),t._zod.def=e,t._zod.bag=t._zod.bag||{},t._zod.version=jG;const r=t._zod.def.checks,s=t._zod.traits.has("$ZodCheck")?[t,...r??[]]:r!=null&&r.length?[...r]:[];for(const o of s)for(const l of o._zod.onattach)l(t);if(s.length===0)(n=t._zod).deferred??(n.deferred=[]),(i=t._zod.deferred)==null||i.push(()=>{t._zod.run=t._zod.parse});else{const o=(c,d,f)=>{if(c.memo)return c;let h=Wa(c),m;for(const v of d){if(v._zod.def.when){if(yq(c)||!v._zod.def.when(c))continue}else if(h)continue;const _=c.issues.length,y=v._zod.check(c);if(y instanceof Promise&&(f==null?void 0:f.async)===!1)throw new Su;if(m||y instanceof Promise)m=(m??Promise.resolve()).then(async()=>{await y,c.issues.length!==_&&($b(c.issues,_,t),h||(h=Wa(c,_)))});else{if(c.issues.length===_)continue;$b(c.issues,_,t),h||(h=Wa(c,_))}}return m?m.then(()=>c):c},l=(c,d,f)=>{if(Wa(c))return c.aborted=!0,c;const h=o(d,s,f);if(h instanceof Promise){if(f.async===!1)throw new Su;return h.then(m=>t._zod.parse(m,f))}return t._zod.parse(h,f)};t._zod.run=(c,d)=>{if(d.skipChecks)return t._zod.parse(c,d);if(d.direction==="backward"){const h=t._zod.parse({value:c.value,issues:[]},{...d,skipChecks:!0});return h instanceof Promise?h.then(m=>l(m,c,d)):l(h,c,d)}const f=t._zod.parse(c,d);if(f instanceof Promise){if(d.async===!1)throw new Su;return f.then(h=>o(h,s,d))}return o(f,s,d)}}},{get"~standard"(){return RM(this,"~standard",FM(this))},set"~standard"(t){lc(this,"~standard",t)}}),jM=(t,e)=>t.issues.length?{issues:t.issues.map(n=>ac(n,e,oa()))}:{value:t.value};async function FG(t,e){const n={async:!0};return jM(await t._zod.run({value:e,issues:[]},n),n)}function FM(t){return{validate:e=>{const n={async:!1};try{const r=t._zod.run({value:e,issues:[]},n);if(!(r instanceof Promise))return jM(r,n)}catch{}return FG(t,e)},vendor:"zod",version:1}}const yk=me("$ZodString",(t,e)=>{Qn.init(t,e),t._zod.pattern=e.pattern??wG,t._zod.parse=(n,r)=>{if(e.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:t}),n}}),Hn=me("$ZodStringFormat",(t,e)=>{N1.init(t,e),yk.init(t,e)}),zG=me("$ZodGUID",(t,e)=>{e.pattern??(e.pattern=sG),Hn.init(t,e)}),VG=me("$ZodUUID",(t,e)=>{if(e.version){const r={v1:1,v2:2,v3:3,v4:4,v5:5,v6:6,v7:7,v8:8}[e.version];if(r===void 0)throw new Error(`Invalid UUID version: "${e.version}"`);e.pattern??(e.pattern=nA(r))}else e.pattern??(e.pattern=nA());Hn.init(t,e)}),HG=me("$ZodEmail",(t,e)=>{e.pattern??(e.pattern=iG),Hn.init(t,e)}),zM=1,Nv=2;function VM(t){try{return typeof URL<"u"&&typeof URL.canParse=="function"?URL.canParse(t):(new URL(t),!0)}catch{return!1}}function UG(t,e){return!("normalize"in e)&&!("hostname"in e)&&!("protocol"in e)?VM(t)||Nv:BG(t,e)}function BG(t,e){var n;if(!e.normalize&&((n=e.protocol)==null?void 0:n.source)===pG.source&&!/^https?:\/\//i.test(t))return zM;try{if(typeof URL<"u"){const r=URL;if(typeof r.parse=="function")return r.parse(t)??Nv}return new URL(t)}catch{return Nv}}const ZG=/[\t\n\r]/g;function rA(t){return t.replace(ZG,"")}function WG(t,e){return e.lastIndex=0,e.test(t.hostname)}function qG(t,e){return e.lastIndex=0,e.test(t.protocol.endsWith(":")?t.protocol.slice(0,-1):t.protocol)}const GG=me("$ZodURL",(t,e)=>{Hn.init(t,e),t._zod.check=n=>{try{const r=n.value.trim(),s=UG(r,e);if(s===zM){n.issues.push({code:"invalid_format",format:"url",note:"Invalid URL format",input:n.value,inst:t,continue:!e.abort});return}if(s===Nv){n.issues.push({code:"invalid_format",format:"url",input:n.value,inst:t,continue:!e.abort});return}if(s===!0){n.value=rA(r);return}e.hostname&&!WG(s,e.hostname)&&n.issues.push({code:"invalid_format",format:"url",note:"Invalid hostname",pattern:e.hostname.source,input:n.value,inst:t,continue:!e.abort}),e.protocol&&!qG(s,e.protocol)&&n.issues.push({code:"invalid_format",format:"url",note:"Invalid protocol",pattern:e.protocol.source,input:n.value,inst:t,continue:!e.abort}),n.value=e.normalize?s.href:rA(r);return}catch{n.issues.push({code:"invalid_format",format:"url",input:n.value,inst:t,continue:!e.abort})}}}),KG=me("$ZodEmoji",(t,e)=>{e.pattern??(e.pattern=aG()),Hn.init(t,e)}),YG=me("$ZodNanoID",(t,e)=>{if(e.length!==void 0&&(!Number.isInteger(e.length)||e.length<1))throw new Error(`Invalid nanoid length: ${e.length}`);e.pattern??(e.pattern=e.length===void 0?tG:nG(e.length)),Hn.init(t,e)}),XG=me("$ZodCUID",(t,e)=>{e.pattern??(e.pattern=Yq),Hn.init(t,e)}),QG=me("$ZodCUID2",(t,e)=>{e.pattern??(e.pattern=Xq),Hn.init(t,e)}),JG=me("$ZodULID",(t,e)=>{e.pattern??(e.pattern=Qq),Hn.init(t,e)}),eK=me("$ZodXID",(t,e)=>{e.pattern??(e.pattern=Jq),Hn.init(t,e)}),tK=me("$ZodKSUID",(t,e)=>{e.pattern??(e.pattern=eG),Hn.init(t,e)}),nK=me("$ZodISODateTime",(t,e)=>{e.pattern??(e.pattern=_G(e)),Hn.init(t,e)}),rK=me("$ZodISODate",(t,e)=>{e.pattern??(e.pattern=vG),Hn.init(t,e)}),sK=me("$ZodISOTime",(t,e)=>{e.pattern??(e.pattern=yG(e)),Hn.init(t,e)}),iK=me("$ZodISODuration",(t,e)=>{e.pattern??(e.pattern=rG),Hn.init(t,e)}),oK=me("$ZodIPv4",(t,e)=>{e.pattern??(e.pattern=lG),Hn.init(t,e)}),aK=/^[0-9a-fA-F:.]+$/;function HM(t){return aK.test(t)?VM(`http://[${t}]`):!1}const lK=me("$ZodIPv6",(t,e)=>{e.pattern??(e.pattern=cG),Hn.init(t,e),t._zod.check=n=>{HM(n.value)||n.issues.push({code:"invalid_format",format:"ipv6",input:n.value,inst:t,continue:!e.abort})}}),cK=me("$ZodCIDRv4",(t,e)=>{e.pattern??(e.pattern=uG),Hn.init(t,e)});function uK(t){const e=t.split("/");if(e.length!==2)return!1;const[n,r]=e;if(!r)return!1;const s=Number(r);return`${s}`!==r||s<0||s>128?!1:HM(n)}const dK=me("$ZodCIDRv6",(t,e)=>{e.pattern??(e.pattern=dG),Hn.init(t,e),t._zod.check=n=>{uK(n.value)||n.issues.push({code:"invalid_format",format:"cidrv6",input:n.value,inst:t,continue:!e.abort})}});function UM(t){if(t==="")return!0;if(/\s/.test(t)||t.length%4!==0)return!1;try{return atob(t),!0}catch{return!1}}const BM=/^[0-9a-zA-Z+/]*={0,2}$/,fK=me("$ZodBase64",(t,e)=>{e.pattern??(e.pattern=BM),Hn.init(t,e),t._zod.check=n=>{UM(n.value)||n.issues.push({code:"invalid_format",format:"base64",input:n.value,inst:t,continue:!e.abort})}}),_k=/^[A-Za-z0-9_-]*$/;function hK(t){if(!_k.test(t))return!1;const e=t.replace(/[-_]/g,r=>r==="-"?"+":"/"),n=e.padEnd(Math.ceil(e.length/4)*4,"=");return UM(n)}const pK=me("$ZodBase64URL",(t,e)=>{e.pattern??(e.pattern=_k),Hn.init(t,e),t._zod.check=n=>{hK(n.value)||n.issues.push({code:"invalid_format",format:"base64url",input:n.value,inst:t,continue:!e.abort})}}),mK=me("$ZodE164",(t,e)=>{e.pattern??(e.pattern=mG),Hn.init(t,e)});function gK(t,e=null){try{const n=t.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||e&&(!("alg"in s)||s.alg!==e))}catch{return!1}}const vK=me("$ZodJWT",(t,e)=>{Hn.init(t,e),t._zod.check=n=>{gK(n.value,e.alg)||n.issues.push({code:"invalid_format",format:"jwt",input:n.value,inst:t,continue:!e.abort})}}),ZM=me("$ZodNumber",(t,e)=>{Qn.init(t,e),t._zod.pattern=gk,t._zod.parse=(n,r)=>{if(e.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:t,...i?{received:i}:{}}),n}}),yK=me("$ZodNumberFormat",(t,e)=>{CG.init(t,e),ZM.init(t,e)}),_K=me("$ZodBoolean",(t,e)=>{Qn.init(t,e),t._zod.pattern=xG,t._zod.parse=(n,r)=>{if(e.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:t}),n}}),wK=me("$ZodUnknown",(t,e)=>{Qn.init(t,e),t._zod.parse=n=>n}),bK=me("$ZodNever",(t,e)=>{Qn.init(t,e),t._zod.parse=(n,r)=>(n.issues.push({expected:"never",code:"invalid_type",input:n.value,inst:t}),n)});function xK(t,e){const n=Q3(t._zod.def.checks);if(!n.length)return;const r=Math.min(...n.map(i=>i[0])),s=t._zod.parse;t._zod.parse=(i,o)=>{const l=e(i.value);if(l>r&&!(o!=null&&o.skipChecks)&&(o==null?void 0:o.direction)!=="backward"){for(const[c,d]of Q3(t._zod.def.checks))if(l>c&&d._zod.def.when(i)){const f=i.issues.length;return d._zod.check(i),i.issues[f].continue=!1,$b(i.issues,f,t),i}}return s(i,o)}}const SK=t=>Array.isArray(t)?t.length:-1;function sA(t,e,n){t.issues.length&&e.issues.push(...Hd(n,t.issues)),e.value[n]=t.value}const kK=me("$ZodArray",(t,e)=>{Qn.init(t,e);const n=Po.memoizer;n==null||n.attach(t),t._zod.parse=(r,s)=>{const i=r.value;if(!Array.isArray(i))return r.issues.push({expected:"array",code:"invalid_type",input:i,inst:t}),r;r.value=n?n.alloc(t,r,Array(i.length),s):Array(i.length);const o=[],l=s==null?void 0:s.abortEarly;for(let c=0;c<i.length;c++){const d=i[c],f=e.element._zod.run({value:d,issues:[]},s);if(f instanceof Promise)o.push(f.then(h=>sA(h,r,c)));else if(sA(f,r,c),l&&f.issues.length!==0&&Wa(f))break}return o.length?Promise.all(o).then(()=>r):r},xK(t,SK)});function Lv(t,e,n,r,s,i){const o=n in r,l=i==="optional";if(!(!o&&l&&s==="optional")){if(t.issues.length){if(s!==void 0&&l&&!o)return;e.issues.push(...Hd(n,t.issues))}if(!o&&s===void 0){t.issues.length||e.issues.push({code:"invalid_type",expected:"nonoptional",input:void 0,path:[n]});return}t.value===void 0?(o||s==="defaulted"&&!l)&&(e.value[n]=void 0):e.value[n]=t.value}}const EK=[];function WM(t){var o,l,c,d;const e=Object.keys(t.shape),n=Object.getOwnPropertySymbols(t.shape),r=n.length?n:EK,s=r.length?[...e,...r]:e;for(const f of s)if(!((d=(c=(l=(o=t.shape)==null?void 0:o[f])==null?void 0:l._zod)==null?void 0:c.traits)!=null&&d.has("$ZodType")))throw new Error(`Invalid element at key "${String(f)}": expected a Zod schema`);const i=uq(t.shape);return{...t,allKeys:s,symbolKeys:r,keySet:new Set(e),numKeys:e.length,optionalKeys:new Set(i)}}function qM(t,e,n,r,s,i,o){const l=[],c=s.keySet,d=s.catchall._zod,f=d.def.type,h=d.optin,m=d.optout;let v=0;for(const _ in e){if(o&&n.issues.length!==v){if(Wa(n,v))break;v=n.issues.length}if(c.has(_))continue;if(_==="__proto__"){f==="never"&&l.push(_);continue}if(f==="never"){l.push(_);continue}const y=d.run({value:e[_],issues:[]},r);y instanceof Promise?t.push(y.then(w=>Lv(w,n,_,e,h,m))):Lv(y,n,_,e,h,m)}return l.length&&n.issues.push({code:"unrecognized_keys",keys:l,input:e,inst:i,continue:!0}),t.length?Promise.all(t).then(()=>n):n}const CK=me("$ZodObject",(t,e)=>{Qn.init(t,e);const n=Object.getOwnPropertyDescriptor(e,"shape"),r=n!=null&&n.get?n.get.raw:e.shape??{};if(r){const d=()=>{const f={...r};return Object.defineProperty(e,"shape",{value:f}),d.raw=f,f};d.raw=r,Object.defineProperty(e,"shape",{get:d})}const s=I1(()=>WM(e));rn(t,"propValues",d=>{const f=d.def.shape,h={};for(const m in f){const v=f[m]._zod;if(v.values){Object.prototype.hasOwnProperty.call(h,m)||sl(h,m,new Set);for(const _ of v.values)h[m].add(_);v.optin!==void 0&&h[m].add(void 0)}}return h});const i=Bp,o=e.catchall;let l;const c=Po.memoizer;c==null||c.attach(t),t._zod.parse=(d,f)=>{l??(l=s.value);const h=d.value;if(!i(h))return d.issues.push({expected:"object",code:"invalid_type",input:h,inst:t}),d;d.value=c?c.alloc(t,d,{},f):{};const m=[],v=l.shape,_=f==null?void 0:f.abortEarly;let y=d.issues.length;for(const w of l.allKeys){if(_&&d.issues.length!==y){if(Wa(d,y))break;y=d.issues.length}if(w==="__proto__")continue;const x=v[w],k=x._zod.optin,P=x._zod.optout,C=x._zod.run({value:h[w],issues:[]},f);C instanceof Promise?m.push(C.then(T=>Lv(T,d,w,h,k,P))):Lv(C,d,w,h,k,P)}return o?qM(m,h,d,f,s.value,t,_===!0):m.length?Promise.all(m).then(()=>d):d}}),PK=me("$ZodObjectJIT",(t,e)=>{CK.init(t,e);const n=t._zod.parse,r=I1(()=>WM(e)),s=Po.memoizer,i=v=>{var T,O;const _=r.value,y=_.symbolKeys,w=new $G(["payload","ctx"],{shape:v,inst:t,memo:s,syms:y}),x=I=>`shape[${I}]._zod.run({ value: input[${I}], issues: [] }, ctx)`,k=(I,R)=>`
|
|
26
|
-
let ${I}_ab = false;
|
|
27
|
-
for (let i = 0; i < ${I}.issues.length; i++) {
|
|
28
|
-
const iss = ${I}.issues[i];
|
|
29
|
-
iss.path = iss.path ? [${R}, ...iss.path] : [${R}];
|
|
30
|
-
payload.issues.push(iss);
|
|
31
|
-
if (iss.continue !== true) ${I}_ab = true;
|
|
32
|
-
}
|
|
33
|
-
if (${I}_ab && ctx && ctx.abortEarly) {
|
|
34
|
-
payload.value = newResult;
|
|
35
|
-
return payload;
|
|
36
|
-
}`;w.write("const input = payload.value;");const P=Object.create(null);let C=0;for(const I of _.allKeys)P[I]=`key_${C++}`;w.write(s?"const newResult = memo.alloc(inst, payload, {}, ctx);":"const newResult = {};");for(const I of _.allKeys){if(I==="__proto__")continue;const R=P[I],N=typeof I=="symbol"?`syms[${y.indexOf(I)}]`:oq(I),L=`${N} in input`,z=v[I],$=(T=z==null?void 0:z._zod)==null?void 0:T.optin,G=$!==void 0,X=((O=z==null?void 0:z._zod)==null?void 0:O.optout)==="optional";if(w.write(`const ${R} = ${x(N)};`),G&&X){const q=$==="optional"?`${R}_present`:`${R}.value !== undefined || ${R}_present`;w.write(`
|
|
37
|
-
const ${R}_present = ${L};
|
|
38
|
-
if (!${R}.issues.length || ${R}_present) {
|
|
39
|
-
if (${R}.issues.length) {${k(R,N)}
|
|
40
|
-
}
|
|
41
|
-
|
|
42
|
-
if (${q}) {
|
|
43
|
-
newResult[${N}] = ${R}.value;
|
|
44
|
-
}
|
|
45
|
-
}
|
|
46
|
-
|
|
47
|
-
`)}else G?(w.write(`
|
|
48
|
-
if (${R}.issues.length) {${k(R,N)}
|
|
49
|
-
}
|
|
50
|
-
`),$==="defaulted"?w.write(`newResult[${N}] = ${R}.value;`):w.write(`
|
|
51
|
-
if (${R}.value !== undefined || ${L}) {
|
|
52
|
-
newResult[${N}] = ${R}.value;
|
|
53
|
-
}
|
|
54
|
-
`)):w.write(`
|
|
55
|
-
const ${R}_present = ${L};
|
|
56
|
-
if (${R}.issues.length) {${k(R,N)}
|
|
57
|
-
}
|
|
58
|
-
if (!${R}_present && !${R}.issues.length) {
|
|
59
|
-
payload.issues.push({
|
|
60
|
-
code: "invalid_type",
|
|
61
|
-
expected: "nonoptional",
|
|
62
|
-
input: undefined,
|
|
63
|
-
path: [${N}]
|
|
64
|
-
});
|
|
65
|
-
if (ctx && ctx.abortEarly) {
|
|
66
|
-
payload.value = newResult;
|
|
67
|
-
return payload;
|
|
68
|
-
}
|
|
69
|
-
}
|
|
70
|
-
|
|
71
|
-
if (${R}_present) {
|
|
72
|
-
newResult[${N}] = ${R}.value;
|
|
73
|
-
}
|
|
74
|
-
|
|
75
|
-
`)}return w.write("payload.value = newResult;"),w.write("return payload;"),w.compile()};let o;const l=Bp,c=!Po.jitless,f=c&&lq.value,h=e.catchall;let m;t._zod.parse=(v,_)=>{m??(m=r.value);const y=v.value;return l(y)?c&&f&&(_==null?void 0:_.async)===!1&&_.jitless!==!0?(o||(o=i(e.shape)),v=o(v,_),h?qM([],y,v,_,m,t,(_==null?void 0:_.abortEarly)===!0):v):n(v,_):(v.issues.push({expected:"object",code:"invalid_type",input:y,inst:t}),v)}});function iA(t,e,n,r){for(const i of t)if(i.issues.length===0)return e.value=i.value,e;const s=t.filter(i=>!Wa(i));return s.length===1?(e.value=s[0].value,s[0]):(e.issues.push({code:"invalid_union",input:e.value,inst:n,errors:t.map(i=>i.issues.map(o=>ac(o,r,oa())))}),e)}const GM=me("$ZodUnion",(t,e)=>{Qn.init(t,e),rn(t,"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),rn(t,"optout",r=>r.def.options.some(s=>s._zod.optout==="optional")?"optional":void 0),rn(t,"values",r=>{if(r.def.options.every(s=>s._zod.values))return new Set(r.def.options.flatMap(s=>Array.from(s._zod.values)))}),rn(t,"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=>lk(i.source)).join("|")})$`)}});const n=e.options.length===1?e.options[0]._zod.run:null;t._zod.parse=(r,s)=>{if(n)return n(r,s);let i=!1;const o=[];for(const l of e.options){const c=l._zod.run({value:r.value,issues:[]},s);if(c instanceof Promise)o.push(c),i=!0;else{if(c.issues.length===0)return c;o.push(c)}}return i?Promise.all(o).then(l=>iA(l,r,t,s)):iA(o,r,t,s)}});function AK(t){var n;const e=new Map;for(const r of t.options){const s=(n=r._zod.propValues)==null?void 0:n[t.discriminator];if(!s||s.size===0)throw new Error(`Invalid discriminated union option at index "${t.options.indexOf(r)}"`);for(const i of s)if(e.has(i)){if(i!==void 0)throw new Error(`Duplicate discriminator value "${String(i)}"`);e.set(i,null)}else e.set(i,r)}return e}const TK=me("$ZodDiscriminatedUnion",(t,e)=>{e.inclusive=!1,GM.init(t,e);const n=t._zod.parse;rn(t,"propValues",s=>{var l,c;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)}"`);(l=f[s.def.discriminator])!=null&&l.has(void 0)&&o++;for(const[h,m]of Object.entries(f)){Object.prototype.hasOwnProperty.call(i,h)||sl(i,h,new Set);for(const v of m)i[h].add(v)}}return!s.def.unionFallback&&o>1&&((c=i[s.def.discriminator])==null||c.delete(void 0)),i}),e.options.forEach((s,i)=>{const o=ck(s._zod.def);if(o&&!Object.prototype.hasOwnProperty.call(o,e.discriminator))throw new Error(`Invalid discriminated union option at index "${i}"`)});const r=I1(()=>AK(e));t._zod.parse=(s,i)=>{const o=s.value;if(!Bp(o))return s.issues.push({code:"invalid_type",expected:"object",input:o,inst:t}),s;const l=o==null?void 0:o[e.discriminator],c=r.value.get(l);return c&&(l!==void 0||i.direction!=="backward")?c._zod.run(s,i):e.unionFallback||i.direction==="backward"?n(s,i):(s.issues.push({code:"invalid_union",errors:[],note:"No matching discriminator",discriminator:e.discriminator,options:Array.from(r.value.keys()).filter(d=>r.value.get(d)!==null),input:o,path:[e.discriminator],inst:t}),s)}}),RK=me("$ZodIntersection",(t,e)=>{Qn.init(t,e),t._zod.parse=(n,r)=>{const s=n.value,i=e.left._zod.run({value:s,issues:[]},r),o=e.right._zod.run({value:s,issues:[]},r);return i instanceof Promise||o instanceof Promise?Promise.all([i,o]).then(([c,d])=>oA(n,c,d)):oA(n,i,o)}});function Fb(t,e){if(t===e)return{valid:!0,data:t};if(t instanceof Date&&e instanceof Date&&+t==+e)return{valid:!0,data:t};if(Cf(t)&&Cf(e)){const n=Object.keys(e),r=Object.keys(t).filter(i=>n.indexOf(i)!==-1),s={...t,...e};Object.prototype.hasOwnProperty.call(s,"__proto__")&&delete s.__proto__;for(const i of r){if(i==="__proto__")continue;const o=Fb(t[i],e[i]);if(!o.valid)return{valid:!1,mergeErrorPath:[i,...o.mergeErrorPath]};s[i]=o.data}return{valid:!0,data:s}}if(Array.isArray(t)&&Array.isArray(e)){if(t.length!==e.length)return{valid:!1,mergeErrorPath:[]};const n=[];for(let r=0;r<t.length;r++){const s=t[r],i=e[r],o=Fb(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 oA(t,e,n){const r=new Map;let s;const i=new Map,o=(d,f)=>{var m,v;let h;if(d.code==="unrecognized_keys"&&!((m=d.path)!=null&&m.length))s??(s=d),h=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),h=[_]}else return!1;for(const _ of h)r.has(_)||r.set(_,{}),r.get(_)[f]=!0;return!0};for(const d of e.issues)o(d,"l")||t.issues.push(d);for(const d of n.issues)o(d,"r")||t.issues.push(d);const l=[...r].filter(([,d])=>d.l&&d.r).map(([d])=>d);if(l.length){const d=s?l.filter(f=>s.keys.includes(f)):[];d.length&&t.issues.push({...s,keys:d});for(const f of l)!d.includes(f)&&i.has(f)&&t.issues.push(i.get(f))}const c=Fb(e.value,n.value);if(!c.valid){if(Wa(t))return t;throw new Error(`Unmergable intersection. Error path: ${JSON.stringify(c.mergeErrorPath)}`)}return t.value=c.data,t}const IK=me("$ZodRecord",(t,e)=>{Qn.init(t,e);const n=Po.memoizer;n==null||n.attach(t),t._zod.parse=(r,s)=>{const i=r.value;if(!Cf(i))return r.issues.push({expected:"record",code:"invalid_type",input:i,inst:t}),r;const o=[],l=e.keyType._zod.values;if(l&&!e.partial){r.value=n?n.alloc(t,r,{},s):{};const c=new Set;for(const f of l)if(typeof f=="string"||typeof f=="number"||typeof f=="symbol"){if(c.add(typeof f=="number"?f.toString():f),f==="__proto__")continue;const h=e.keyType._zod.run({value:f,issues:[]},s);if(h instanceof Promise)throw new Error("Async schemas not supported in object keys currently");if(h.issues.length){r.issues.push({code:"invalid_key",origin:"record",issues:h.issues.map(_=>ac(_,s,oa())),input:f,path:[f],inst:t});continue}const m=h.value;if(m==="__proto__")continue;const v=e.valueType._zod.run({value:i[f],issues:[]},s);v instanceof Promise?o.push(v.then(_=>{_.issues.length&&r.issues.push(...Hd(f,_.issues)),r.value[m]=_.value})):(v.issues.length&&r.issues.push(...Hd(f,v.issues)),r.value[m]=v.value)}let d;for(const f in i)if(!c.has(f))if(e.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:t,keys:d,continue:!0})}else{r.value=n?n.alloc(t,r,{},s):{};let c;for(const d of Reflect.ownKeys(i)){if(d==="__proto__"||!Object.prototype.propertyIsEnumerable.call(i,d))continue;let f=e.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"&&gk.test(d)&&f.issues.length){const _=e.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){e.mode==="loose"?r.value[d]=i[d]:l?(c=c??[],c.push(d)):r.issues.push({code:"invalid_key",origin:"record",issues:f.issues.map(_=>ac(_,s,oa())),input:d,path:[d],inst:t});continue}const m=f.value;if(m==="__proto__")continue;const v=e.valueType._zod.run({value:i[d],issues:[]},s);v instanceof Promise?o.push(v.then(_=>{_.issues.length&&r.issues.push(...Hd(d,_.issues)),r.value[m]=_.value})):(v.issues.length&&r.issues.push(...Hd(d,v.issues)),r.value[m]=v.value)}c&&c.length>0&&r.issues.push({code:"unrecognized_keys",input:i,inst:t,keys:c,continue:!0})}return o.length?Promise.all(o).then(()=>r):r}}),OK=me("$ZodEnum",(t,e)=>{Qn.init(t,e);const n=Lb(e.entries),r=new Set(n);t._zod.values=r,rn(t,"pattern",s=>{const i=Lb(s.def.entries).filter(o=>cq.has(typeof o));return new RegExp(i.length?`^(${i.map(o=>Pf(o.toString())).join("|")})$`:"^[^\\s\\S]$")}),t._zod.parse=(s,i)=>{const o=s.value;return r.has(o)||s.issues.push({code:"invalid_value",values:n,input:o,inst:t}),s}}),MK=me("$ZodLiteral",(t,e)=>{Qn.init(t,e);const n=new Set(e.values);t._zod.values=n,rn(t,"pattern",r=>{const s=r.def.values;return new RegExp(s.length?`^(${s.map(i=>typeof i=="string"?Pf(i):i?Pf(i.toString()):String(i)).join("|")})$`:"^[^\\s\\S]$")}),t._zod.parse=(r,s)=>{const i=r.value;return n.has(i)||r.issues.push({code:"invalid_value",values:e.values,input:i,inst:t}),r}}),NK=me("$ZodTransform",(t,e)=>{var n;Qn.init(t,e),t._zod.optin="optional",(n=Po.memoizer)==null||n.guard(t),t._zod.parse=(r,s)=>{if(s.direction==="backward")throw new MM(t.constructor.name);const i=e.transform(r.value,r);if(s.async)return(i instanceof Promise?i:Promise.resolve(i)).then(l=>(r.value=l,r));if(i instanceof Promise)throw new Su;return r.value=i,r}});function aA(t,e){return t.value=e.issues.length?void 0:e.value,t}const KM=me("$ZodOptional",(t,e)=>{Qn.init(t,e),rn(t,"optin",n=>n.def.innerType._zod.optin==="defaulted"?"defaulted":"optional"),t._zod.optout="optional",rn(t,"values",n=>{const r=n.def.innerType._zod.values;return r?new Set([...r,void 0]):void 0}),rn(t,"pattern",n=>{const r=n.def.innerType._zod.pattern;return r?new RegExp(`^(${lk(r.source)})?$`):void 0}),t._zod.parse=(n,r)=>{if(n.value===void 0){if(e.innerType._zod.optin!=="defaulted")return n;const s=e.innerType._zod.run({value:n.value,issues:[]},r);return s instanceof Promise?s.then(i=>aA(n,i)):aA(n,s)}return e.innerType._zod.run(n,r)}}),LK=me("$ZodExactOptional",(t,e)=>{KM.init(t,e),rn(t,"values",n=>n.def.innerType._zod.values),rn(t,"pattern",n=>n.def.innerType._zod.pattern),t._zod.parse=(n,r)=>e.innerType._zod.run(n,r)}),DK=me("$ZodNullable",(t,e)=>{Qn.init(t,e),rn(t,"optin",n=>n.def.innerType._zod.optin),rn(t,"optout",n=>n.def.innerType._zod.optout),rn(t,"pattern",n=>{const r=n.def.innerType._zod.pattern;return r?new RegExp(`^(${lk(r.source)}|null)$`):void 0}),rn(t,"values",n=>n.def.innerType._zod.values?new Set([...n.def.innerType._zod.values,null]):void 0),t._zod.parse=(n,r)=>n.value===null?n:e.innerType._zod.run(n,r)}),$K=me("$ZodDefault",(t,e)=>{Qn.init(t,e),t._zod.optin="defaulted",rn(t,"values",n=>n.def.innerType._zod.values),t._zod.parse=(n,r)=>{if(r.direction==="backward")return e.innerType._zod.run(n,r);if(n.value===void 0)return n.value=e.defaultValue,n;const s=e.innerType._zod.run(n,r);return s instanceof Promise?s.then(i=>lA(i,e)):lA(s,e)}});function lA(t,e){return t.value===void 0&&(t.value=e.defaultValue),t}const jK=me("$ZodPrefault",(t,e)=>{Qn.init(t,e),t._zod.optin="defaulted",rn(t,"values",n=>n.def.innerType._zod.values),t._zod.parse=(n,r)=>(r.direction==="backward"||n.value===void 0&&(n.value=e.defaultValue),e.innerType._zod.run(n,r))}),FK=me("$ZodNonOptional",(t,e)=>{Qn.init(t,e),rn(t,"values",n=>{const r=n.def.innerType._zod.values;return r?new Set([...r].filter(s=>s!==void 0)):void 0}),t._zod.parse=(n,r)=>{const s=e.innerType._zod.run(n,r);return s instanceof Promise?s.then(i=>cA(i,t)):cA(s,t)}});function cA(t,e){return!t.issues.length&&t.value===void 0&&t.issues.push({code:"invalid_type",expected:"nonoptional",input:t.value,inst:e}),t}function uA(t,e,n,r){return e.issues.length?(t.value=n.catchValue({...e,value:t.value,error:{issues:e.issues.map(s=>ac(s,r,oa()))},input:t.value}),t):(t.value=e.value,e.memo&&(t.memo=!0),t)}const zK=me("$ZodCatch",(t,e)=>{Qn.init(t,e),rn(t,"optin",n=>n.def.innerType._zod.optin==="defaulted"?"defaulted":"optional"),rn(t,"optout",n=>n.def.innerType._zod.optout),rn(t,"values",n=>n.def.innerType._zod.values),t._zod.parse=(n,r)=>{if(r.direction==="backward")return e.innerType._zod.run(n,r);const s=e.innerType._zod.run({value:n.value,issues:[]},r);return s instanceof Promise?s.then(i=>uA(n,i,e,r)):uA(n,s,e,r)}}),VK=me("$ZodPipe",(t,e)=>{Qn.init(t,e),rn(t,"values",n=>n.def.in._zod.values),rn(t,"optin",n=>n.def.in._zod.optin),rn(t,"optout",n=>n.def.out._zod.optout),rn(t,"propValues",n=>n.def.in._zod.propValues),t._zod.parse=(n,r)=>{if(r.direction==="backward"){const i=e.out._zod.run(n,r);return i instanceof Promise?i.then(o=>tg(o,e.in,r)):tg(i,e.in,r)}const s=e.in._zod.run(n,r);return s instanceof Promise?s.then(i=>tg(i,e.out,r)):tg(s,e.out,r)}});function tg(t,e,n){return t.issues.some(r=>r.code!=="unrecognized_keys")?(t.aborted=!0,t):e._zod.run({value:t.value,issues:t.issues},n)}const HK=me("$ZodReadonly",(t,e)=>{Qn.init(t,e),rn(t,"propValues",n=>n.def.innerType._zod.propValues),rn(t,"values",n=>n.def.innerType._zod.values),rn(t,"optin",n=>{var r,s;return(s=(r=n.def.innerType)==null?void 0:r._zod)==null?void 0:s.optin}),rn(t,"optout",n=>{var r,s;return(s=(r=n.def.innerType)==null?void 0:r._zod)==null?void 0:s.optout}),t._zod.parse=(n,r)=>{if(r.direction==="backward")return e.innerType._zod.run(n,r);const s=e.innerType._zod.run(n,r);return s instanceof Promise?s.then(dA):dA(s)}});function dA(t){return t.memo||(t.value=Object.freeze(t.value)),t}const UK=me("$ZodCustom",(t,e)=>{si.init(t,e),Qn.init(t,e),t._zod.parse=(n,r)=>n,t._zod.check=n=>{const r=n.value,s=e.fn(r);if(s instanceof Promise)return s.then(i=>fA(i,n,r,t));fA(s,n,r,t)}});function fA(t,e,n,r){if(!t){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),e.issues.push(Zp(s))}}class BK extends Error{constructor(){super("Cannot parse a reference cycle that closes through a transform"),this.name="ZodCyclicError"}}const zb="~memo",hA=[];function YM(t){return t!==null&&typeof t=="object"}function V2(t){return t.map(e=>e.path?{...e,path:e.path.slice()}:{...e})}const XM=new WeakMap,sp=0,Fg=1,Ep=2;function zg(t,e,n){const r=XM.get(t);if(r!==void 0)return r?Ep:sp;if(e.has(t))return Ep;e.add(t);let s=sp;const i=f=>{if(s!==Ep&&(f!=null&&f._zod)){const h=zg(f,e);h>s&&(s=h)}},o=(f,h)=>{var v;let m=sp;for(const _ of Reflect.ownKeys(f)){const y=Object.getOwnPropertyDescriptor(f,_);if(!y.enumerable)continue;const w=y.get?Fg:(v=y.value)!=null&&v._zod?zg(y.value,e):sp;w>m&&(m=w)}return m},l=f=>{f>s&&(s=f)},c=t._zod.def;switch(c.type){case"object":{const f=ck(c);l(f?o(f):Fg),i(c.catchall);break}case"array":i(c.element);break;case"tuple":for(const f of c.items)i(f);i(c.rest);break;case"record":case"map":i(c.keyType),i(c.valueType);break;case"set":i(c.valueType);break;case"union":for(const f of c.options)i(f);break;case"intersection":i(c.left),i(c.right);break;case"optional":case"nullable":case"default":case"prefault":case"catch":case"readonly":case"nonoptional":case"promise":case"success":i(c.innerType);break;case"pipe":i(c.in),i(c.out);break;case"function":i(c.input),i(c.output);break;case"lazy":{const f=c._cachedInner??void 0;l(f?zg(f,e):Fg);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 c){const h=Object.getOwnPropertyDescriptor(c,f);if(!h||h.get)continue;const m=h.value;if(!(!m||typeof m!="object")){if(m._zod)i(m);else if(Array.isArray(m))for(const v of m)i(v)}}}return e.delete(t),ZK(t,s)}function ZK(t,e){return e!==Fg&&XM.set(t,e===Ep),e}function WK(t,e){let n=t.buckets.get(e);return n||(n=new WeakMap,t.buckets.set(e,n)),n}let ng;const rg=[],qK={alloc(t,e,n){const r=ng;if(!r)return n;ng=void 0;const s={value:n,issues:null};return r.set(e.value,s),rg.push(s),n},guard(t){var e;(e=t._zod).deferred??(e.deferred=[]),t._zod.deferred.push(()=>{const n=t._zod.parse,r=(s,i)=>{if(i.direction!=="backward"&&KK(i,s.value))throw new BK;return n(s,i)};t._zod.parse=r,t._zod.run===n&&(t._zod.run=r)})},attach(t){var e;let n,r=!1,s,i;(e=t._zod).deferred??(e.deferred=[]),t._zod.deferred.push(()=>{const o=t._zod.parse,l=(c,d)=>{if(n===void 0){const x=zg(t,new Set);if(x===sp)return t._zod.parse=o,t._zod.run===l&&(t._zod.run=o),o(c,d);x===Ep||r?n=!0:r=!0}const f=c.value;if(!YM(f))return o(c,d);let h=d[zb];h||(h={buckets:new WeakMap,backEdges:void 0},d[zb]=h);let m;s===d?m=i:(m=WK(h,t),s=d,i=m);const v=m.get(f);if(v)return c.value=v.value,v.issues?v.issues.length&&c.issues.push(...V2(v.issues)):(c.memo=!0,h.backEdges??(h.backEdges=new WeakSet),h.backEdges.add(v.value)),c;ng=m;const _=rg.length,y=o(c,d);ng=void 0;const w=rg.length>_?rg.pop():void 0;return y instanceof Promise?y.then(x=>(w&&(w.issues=x.issues.length?V2(x.issues):hA),x)):(w&&(w.issues=y.issues.length?V2(y.issues):hA),y)};t._zod.parse=l,t._zod.run===o&&(t._zod.run=l)})}};function GK(){return qK}function KK(t,e){var r;const n=(r=t[zb])==null?void 0:r.backEdges;return n!==void 0&&YM(e)&&n.has(e)}const YK=()=>{const t={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 e(i){return t[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),l=wq(i.input),c=s(l,i.input);return`Invalid input: expected ${o}, received ${c}`}case"invalid_value":return i.values.length===1?`Invalid input: expected ${PM(i.values[0])}`:`Invalid option: expected one of ${Y3(i.values,"|")}`;case"too_big":{const o=i.exact?"exactly ":i.inclusive?"<=":"<",l=e(i.origin);return l?`Too big: expected ${i.origin??"value"} to have ${o}${i.maximum.toString()} ${l.unit??"elements"}`:`Too big: expected ${i.origin??"value"} to be ${o}${i.maximum.toString()}`}case"too_small":{const o=i.exact?"exactly ":i.inclusive?">=":">",l=e(i.origin);return l?`Too small: expected ${i.origin} to have ${o}${i.minimum.toString()} ${l.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":""}: ${Y3(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(l=>`'${l}'`).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 XK(){return{localeError:YK()}}var pA;class QK{constructor(){this._map=new WeakMap,this._idmap=new Map}add(e,...n){const r=n[0];return this._map.set(e,r),r&&typeof r=="object"&&"id"in r&&this._idmap.set(r.id,e),this}clear(){return this._map=new WeakMap,this._idmap=new Map,this}remove(e){const n=this._map.get(e);return n&&typeof n=="object"&&"id"in n&&this._idmap.delete(n.id),this._map.delete(e),this}get(e){const n=e._zod.parent;if(n){const r={...this.get(n)??{}};delete r.id;const s={...r,...this._map.get(e)};return Object.keys(s).length?s:void 0}return this._map.get(e)}has(e){return this._map.has(e)}}function JK(){return new QK}(pA=globalThis).__zod_globalRegistry??(pA.__zod_globalRegistry=JK());const ip=globalThis.__zod_globalRegistry;function QM(t){return t.checks&&(t.checks=[...t.checks]),t}function eY(t,e){return new t(QM({type:"string",...it(e)}))}function tY(t,e){return new t({type:"string",format:"email",check:"string_format",abort:!1,...it(e)})}function nY(t,e){return new t({type:"string",format:"guid",check:"string_format",abort:!1,...it(e)})}function rY(t,e){return new t({type:"string",format:"uuid",check:"string_format",abort:!1,...it(e)})}function sY(t,e){return new t({type:"string",format:"uuid",check:"string_format",abort:!1,version:"v4",...it(e)})}function iY(t,e){return new t({type:"string",format:"uuid",check:"string_format",abort:!1,version:"v6",...it(e)})}function oY(t,e){return new t({type:"string",format:"uuid",check:"string_format",abort:!1,version:"v7",...it(e)})}function aY(t,e){return new t({type:"string",format:"url",check:"string_format",abort:!1,...it(e)})}function lY(t,e){return new t({type:"string",format:"emoji",check:"string_format",abort:!1,...it(e)})}function cY(t,e){return new t({type:"string",format:"nanoid",check:"string_format",abort:!1,...it(e)})}function uY(t,e){return new t({type:"string",format:"cuid",check:"string_format",abort:!1,...it(e)})}function dY(t,e){return new t({type:"string",format:"cuid2",check:"string_format",abort:!1,...it(e)})}function fY(t,e){return new t({type:"string",format:"ulid",check:"string_format",abort:!1,...it(e)})}function hY(t,e){return new t({type:"string",format:"xid",check:"string_format",abort:!1,...it(e)})}function pY(t,e){return new t({type:"string",format:"ksuid",check:"string_format",abort:!1,...it(e)})}function mY(t,e){return new t({type:"string",format:"ipv4",check:"string_format",abort:!1,...it(e)})}function gY(t,e){return new t({type:"string",format:"ipv6",check:"string_format",abort:!1,...it(e)})}function vY(t,e){return new t({type:"string",format:"cidrv4",check:"string_format",abort:!1,...it(e)})}function yY(t,e){return new t({type:"string",format:"cidrv6",check:"string_format",abort:!1,...it(e)})}function _Y(t,e){return new t({type:"string",format:"base64",check:"string_format",abort:!1,...it(e)})}function wY(t,e){return new t({type:"string",format:"base64url",check:"string_format",abort:!1,...it(e)})}function bY(t,e){return new t({type:"string",format:"e164",check:"string_format",abort:!1,...it(e)})}function xY(t,e){return new t({type:"string",format:"jwt",check:"string_format",abort:!1,...it(e)})}function SY(t,e){return new t({type:"string",format:"datetime",check:"string_format",offset:!1,local:!1,precision:null,...it(e)})}function kY(t,e){return new t({type:"string",format:"date",check:"string_format",...it(e)})}function EY(t,e){return new t({type:"string",format:"time",check:"string_format",precision:null,...it(e)})}function CY(t,e){return new t({type:"string",format:"duration",check:"string_format",...it(e)})}function PY(t,e){return new t(QM({type:"number",checks:[],...it(e)}))}function AY(t,e){return new t({type:"number",check:"number_format",abort:!1,format:"safeint",...it(e)})}function TY(t,e){return new t({type:"boolean",...it(e)})}function RY(t){return new t({type:"unknown"})}function IY(t,e){return new t({type:"never",...it(e)})}function mA(t,e){return new DM({check:"less_than",...it(e),value:t,inclusive:!1})}function H2(t,e){return new DM({check:"less_than",...it(e),value:t,inclusive:!0})}function gA(t,e){return new $M({check:"greater_than",...it(e),value:t,inclusive:!1})}function U2(t,e){return new $M({check:"greater_than",...it(e),value:t,inclusive:!0})}function vA(t,e){return new EG({check:"multiple_of",...it(e),value:t})}function JM(t,e){return new PG({check:"max_length",...it(e),maximum:t})}function Dv(t,e){return new AG({check:"min_length",...it(e),minimum:t})}function eN(t,e){return new TG({check:"length_equals",...it(e),length:t})}function OY(t,e){return new RG({check:"string_format",format:"regex",...it(e),pattern:t})}function MY(t){return new IG({check:"string_format",format:"lowercase",...it(t)})}function NY(t){return new OG({check:"string_format",format:"uppercase",...it(t)})}function LY(t,e){return new MG({check:"string_format",format:"includes",...it(e),includes:t})}function DY(t,e){return new NG({check:"string_format",format:"starts_with",...it(e),prefix:t})}function $Y(t,e){return new LG({check:"string_format",format:"ends_with",...it(e),suffix:t})}function Kf(t){return new DG({check:"overwrite",tx:t})}function jY(t){return Kf(e=>e.normalize(t))}function FY(){return Kf(t=>t.trim())}function zY(){return Kf(t=>t.toLowerCase())}function VY(){return Kf(t=>t.toUpperCase())}function HY(){return Kf(t=>aq(t))}function UY(t,e,n){return new t({type:"array",element:e,...it(n)})}function BY(t,e,n){return new t({type:"custom",check:"custom",fn:e,...it(n)})}function ZY(t,e){const n=WY(r=>(r.addIssue=s=>{if(typeof s=="string")r.issues.push(Zp(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(Zp(i))}},t(r.value,r)),e);return n}function WY(t,e){const n=new si({check:"custom",...it(e)});return n._zod.check=t,n}function Cp(t,...e){for(const n of e)for(const r of Reflect.ownKeys(n))Object.prototype.propertyIsEnumerable.call(n,r)&&sl(t,r,n[r]);return t}function tN(t){let e=(t==null?void 0:t.target)??"draft-2020-12";return e==="draft-4"&&(e="draft-04"),e==="draft-7"&&(e="draft-07"),{processors:t.processors??{},metadataRegistry:(t==null?void 0:t.metadata)??ip,target:e,unrepresentable:(t==null?void 0:t.unrepresentable)??"throw",override:(t==null?void 0:t.override)??(()=>{}),io:(t==null?void 0:t.io)??"output",counter:0,seen:new Map,sharedDefsExtractedFor:void 0,sharedEmitDoneFor:void 0,cycles:(t==null?void 0:t.cycles)??"ref",reused:(t==null?void 0:t.reused)??"inline",intersections:[],deferred:[],external:(t==null?void 0:t.external)??void 0}}function cc(t,e,n,r,s){const i=typeof e.unrepresentable=="function"?e.unrepresentable({zodSchema:t,path:r.path,message:s}):e.unrepresentable;if(i==="any")return!1;if(i===void 0||i==="throw")throw new Error(s);return Object.assign(n,i),!0}function wr(t,e,n={path:[],schemaPath:[]}){var f,h;var r;const s=t._zod.def,i=e.seen.get(t);if(i)return i.count++,n.schemaPath.includes(t)&&(i.cycle=n.path),i.schema;const o={schema:{},count:1,cycle:void 0,path:n.path};e.seen.set(t,o),e.sharedDefsExtractedFor=void 0,e.sharedEmitDoneFor=void 0;const l=(h=(f=t._zod).toJSONSchema)==null?void 0:h.call(f);if(l)o.schema=l;else{const m={...n,schemaPath:[...n.schemaPath,t],path:n.path};if(t._zod.processJSONSchema)t._zod.processJSONSchema(e,o.schema,m);else{const _=o.schema,y=e.processors[s.type];if(!y)throw new Error(`[toJSONSchema]: Non-representable type encountered: ${s.type}`);y(t,e,_,m)}const v=t._zod.parent;v&&(o.ref||(o.ref=v),wr(v,e,m),e.seen.get(v).isParent=!0)}const c=e.metadataRegistry.get(t);return c&&Cp(o.schema,c),e.io==="input"&&Ts(t)&&(delete o.schema.examples,delete o.schema.default),e.io==="input"&&"_prefault"in o.schema&&((r=o.schema).default??(r.default=o.schema._prefault)),delete o.schema._prefault,e.seen.get(t).schema}function yA(t){return t.replace(/~/g,"~0").replace(/\//g,"~1")}function nN(t,e){var o,l,c,d;const n=t.seen.get(e);if(!n)throw new Error("Unprocessed schema. This is a bug in Zod.");if(t.external&&t.sharedDefsExtractedFor===t.external)return;const r=new Map;for(const f of t.seen.entries()){const h=(o=t.metadataRegistry.get(f[0]))==null?void 0:o.id;if(h){const m=r.get(h);if(m&&m!==f[0])throw new Error(`Duplicate schema id "${h}" detected during JSON Schema conversion. Two different schemas cannot share the same id when converted together.`);r.set(h,f[0])}}const s=f=>{var y;const h=t.target==="draft-2020-12"?"$defs":"definitions";if(t.external){const w=(y=t.external.registry.get(f[0]))==null?void 0:y.id,x=t.external.uri??(P=>P);if(w)return{ref:x(w)};const k=f[1].defId??f[1].schema.id??`schema${t.counter++}`;return f[1].defId=k,{defId:k,ref:`${x("__shared")}#/${h}/${yA(k)}`}}const m="#",v=`${m}/${h}/`;if(f[1]===n&&!f[1].schema.id)return{ref:m};const _=f[1].schema.id??`__schema${t.counter++}`;return{defId:_,ref:v+yA(_)}},i=f=>{if(f[1].schema.$ref)return;const h=f[1],{ref:m,defId:v}=s(f);h.def={...h.schema},v&&(h.defId=v);const _=h.schema;for(const y in _)delete _[y];_.$ref=m};if(t.cycles==="throw")for(const f of t.seen.entries()){const h=f[1];if(h.cycle)throw new Error(`Cycle detected: #/${(l=h.cycle)==null?void 0:l.join("/")}/<root>
|
|
76
|
-
|
|
77
|
-
Set the \`cycles\` parameter to \`"ref"\` to resolve cyclical schemas with defs.`)}for(const f of t.seen.entries()){const h=f[1];if(e===f[0]){i(f);continue}if(t.external){const v=(c=t.external.registry.get(f[0]))==null?void 0:c.id;if(e!==f[0]&&v){i(f);continue}}if((d=t.metadataRegistry.get(f[0]))==null?void 0:d.id){i(f);continue}if(h.cycle){i(f);continue}h.count>1&&t.reused==="ref"&&i(f)}t.external&&(t.sharedDefsExtractedFor=t.external)}function rN(t){const e=t.anyOf;if(!Array.isArray(e)||e.length===0||t.type!==void 0)return;const n=[];for(const r of e){if(!r||typeof r!="object")return;rN(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 t.anyOf,t.type=n.length===1?n[0]:n}const sN=new Set(["type","properties","required","additionalProperties"]),_A=["oneOf","anyOf"];function wA(t){const e=t.additionalProperties;return e===void 0||e===!1||typeof e!="object"||e===null?null:Object.keys(e).length?e:null}function Vb(t){var i;const e=[];for(const o of t){if(typeof o!="object"||o.type!=="object")return null;for(const l in o)if(!sN.has(l))return null;e.push(o)}const n={},r=new Set;for(const o of e){for(const l in o.properties){if(Object.prototype.hasOwnProperty.call(n,l))continue;const c=[];for(const f of e){const h=((i=f.properties)==null?void 0:i[l])??wA(f);h!=null&&(c.some(m=>JSON.stringify(m)===JSON.stringify(h))||c.push(h))}const d=c.length===1?c[0]:Vb(c)??{allOf:c};sl(n,l,d)}for(const l of o.required??[])r.add(l)}const s={type:"object",properties:n};if(r.size&&(s.required=[...r]),e.every(o=>o.additionalProperties===!1))s.additionalProperties=!1;else{const o=[];for(const l of e){const c=wA(l);c&&!o.some(d=>JSON.stringify(d)===JSON.stringify(c))&&o.push(c)}o.length===1?s.additionalProperties=o[0]:o.length>1&&(s.additionalProperties={allOf:o})}return s}function qY(t){const e=t.allOf;if(!Array.isArray(e)||e.length<2)return;for(const s of sN)if(s in t)return;const n=e.filter(s=>_A.some(i=>Array.isArray(s[i])));let r=null;if(!n.length)r=Vb(e);else{const s=n[0],i=_A.find(c=>Array.isArray(s[c]));if(Object.keys(s).length!==1)return;const o=e.filter(c=>c!==s),l=s[i].map(c=>Vb([...o,c]));if(l.some(c=>!c))return;r={[i]:l}}r&&(delete t.allOf,Cp(t,r))}function iN(t,e){var l,c,d,f;const n=t.seen.get(e);if(!n)throw new Error("Unprocessed schema. This is a bug in Zod.");const r=h=>{const m=t.seen.get(h);if(m.ref===null)return;const v=m.def??m.schema,_={...v},y=m.ref;if(m.ref=null,y){r(y);const x=t.seen.get(y),k=x.schema;if(k.$ref&&(t.target==="draft-07"||t.target==="draft-04"||t.target==="openapi-3.0")?(v.allOf=v.allOf??[],v.allOf.push(k)):Cp(v,k),Cp(v,_),h._zod.parent===y)for(const C in v)C==="$ref"||C==="allOf"||C in _||delete v[C];if(k.$ref&&x.def)for(const C in v)C==="$ref"||C==="allOf"||C in x.def&&JSON.stringify(v[C])===JSON.stringify(x.def[C])&&delete v[C]}const w=h._zod.parent;if(w&&w!==y){r(w);const x=t.seen.get(w);if(x!=null&&x.schema.$ref&&(v.$ref=x.schema.$ref,x.def))for(const k in v)k==="$ref"||k==="allOf"||k in x.def&&JSON.stringify(v[k])===JSON.stringify(x.def[k])&&delete v[k]}t.override({zodSchema:h,jsonSchema:v,path:m.path??[]})};if(!t.external||t.sharedEmitDoneFor!==t.external){for(const h of[...t.seen.entries()].reverse())r(h[0]);if(t.target!=="openapi-3.0")for(const h of t.seen.entries())rN(h[1].def??h[1].schema);for(const h of t.deferred)h();if(t.intersections.length){const h=new Map;for(const m of t.seen.values())for(const v of[m.schema,m.def]){const _=v==null?void 0:v.allOf;if(!Array.isArray(_))continue;const y=h.get(_);y?y.push(v):h.set(_,[v])}for(const m of t.intersections)for(const v of h.get(m)??[])qY(v)}}const s={};if(t.target==="draft-2020-12"?s.$schema="https://json-schema.org/draft/2020-12/schema":t.target==="draft-07"?s.$schema="http://json-schema.org/draft-07/schema#":t.target==="draft-04"?s.$schema="http://json-schema.org/draft-04/schema#":t.target,(l=t.external)!=null&&l.uri){const h=(c=t.external.registry.get(e))==null?void 0:c.id;if(!h)throw new Error("Schema is missing an `id` property");s.$id=t.external.uri(h)}Cp(s,n.defId?n.schema:n.def??n.schema);const i=(d=t.metadataRegistry.get(e))==null?void 0:d.id;i!==void 0&&s.id===i&&delete s.id;const o=((f=t.external)==null?void 0:f.defs)??{};if(!t.external||t.sharedEmitDoneFor!==t.external)for(const h of t.seen.entries()){const m=h[1];m.def&&m.defId&&(m.def.id===m.defId&&delete m.def.id,sl(o,m.defId,m.def))}t.external&&(t.sharedEmitDoneFor=t.external),t.external||Object.keys(o).length>0&&(t.target==="draft-2020-12"?s.$defs=o:s.definitions=o);try{const h=JSON.parse(JSON.stringify(s));return Object.defineProperty(h,"~standard",{value:{...e["~standard"],jsonSchema:{input:$v(e,"input",t.processors),output:$v(e,"output",t.processors)}},enumerable:!1,writable:!1}),h}catch{throw new Error("Error converting schema to JSON.")}}function Ts(t,e){const n=e??{seen:new Set};if(n.seen.has(t))return!1;n.seen.add(t);const r=t._zod.def;if(r.type==="transform")return!0;if(r.type==="array")return Ts(r.element,n);if(r.type==="set")return Ts(r.valueType,n);if(r.type==="lazy")return Ts(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 Ts(r.innerType,n);if(r.type==="intersection")return Ts(r.left,n)||Ts(r.right,n);if(r.type==="record"||r.type==="map")return Ts(r.keyType,n)||Ts(r.valueType,n);if(r.type==="pipe")return t._zod.traits.has("$ZodCodec")?!0:Ts(r.in,n)||Ts(r.out,n);if(r.type==="object"){for(const s in r.shape)if(Ts(r.shape[s],n))return!0;return!1}if(r.type==="union"){for(const s of r.options)if(Ts(s,n))return!0;return!1}if(r.type==="tuple"){for(const s of r.items)if(Ts(s,n))return!0;return!!(r.rest&&Ts(r.rest,n))}return!1}const GY=(t,e={})=>n=>{const r=tN({...n,processors:e});return wr(t,r),nN(r,t),iN(r,t)},$v=(t,e,n={})=>r=>{const{libraryOptions:s,target:i}=r??{},o=tN({...s??{},target:i,io:e,processors:n});return wr(t,o),nN(o,t),iN(o,t)},Af=(t,e,n)=>{(t[e]===void 0||n>t[e])&&(t[e]=n)},Tf=(t,e,n)=>{(t[e]===void 0||n<t[e])&&(t[e]=n)},bA=(t,e)=>{Af(t,"minimum",e),Tf(t,"maximum",e)},oN=(t,e)=>{t.multipleOf??(t.multipleOf=[]),t.multipleOf.includes(e)||t.multipleOf.push(e)},aN=(t,e)=>{t.patterns??(t.patterns=new Set),t.patterns.add(e)},lN=(t,e)=>{t.mime=t.mime?t.mime.filter(n=>e.includes(n)):[...e]},cN=(t,e)=>{t.format=e,e.includes("int")&&(t.isInt=!0)},xA=(t,e)=>Af(t,"minimum",e.minimum),SA=(t,e)=>Tf(t,"maximum",e.maximum),kA=t=>(e,n)=>{cN(e,n.format);const[r,s]=t[n.format];Af(e,"minimum",r),Tf(e,"maximum",s)},B2={greater_than:(t,e)=>Af(t,e.inclusive?"minimum":"exclusiveMinimum",e.value),less_than:(t,e)=>Tf(t,e.inclusive?"maximum":"exclusiveMaximum",e.value),multiple_of:(t,e)=>oN(t,e.value),number_format:kA(AM),bigint_format:kA(dq),min_length:xA,max_length:SA,length_equals:(t,e)=>bA(t,e.length),min_size:xA,max_size:SA,size_equals:(t,e)=>bA(t,e.size),string_format:(t,e)=>{cN(t,e.format),e.pattern&&aN(t,e.pattern),(e.format==="base64"||e.format==="base64url")&&(t.contentEncoding=e.format),(e.local||e.precision===-1)&&(t.laxFormat=!0)},mime_type:(t,e)=>lN(t,e.mime)};function So(t){var i;const e={},n=t._zod.def,r=t._zod.traits.has("$ZodCheck")?[t,...n.checks??[]]:n.checks??[];for(const o of r)(i=B2[o._zod.def.check])==null||i.call(B2,e,o._zod.def);const s=t._zod.bag;s.minimum!==void 0&&Af(e,"minimum",s.minimum),s.exclusiveMinimum!==void 0&&Af(e,"exclusiveMinimum",s.exclusiveMinimum),s.maximum!==void 0&&Tf(e,"maximum",s.maximum),s.exclusiveMaximum!==void 0&&Tf(e,"exclusiveMaximum",s.exclusiveMaximum),s.multipleOf!==void 0&&oN(e,s.multipleOf),s.format!==void 0&&(e.format??(e.format=s.format),s.format.includes("int")&&(e.isInt=!0)),s.mime&&lN(e,s.mime);for(const o of s.patterns??[])aN(e,o);return e}const KY={guid:"uuid",url:"uri",datetime:"date-time",json_string:"json-string",regex:""},YY=new Map([[BM,fG],[_k,hG]]),uN=t=>YY.get(t)??t,XY=(t,e,n,r)=>{const s=n;s.type="string";const{minimum:i,maximum:o,format:l,patterns:c,contentEncoding:d,laxFormat:f}=So(t);if(typeof i=="number"&&(s.minLength=i),typeof o=="number"&&(s.maxLength=o),l&&(s.format=KY[l]??l,s.format===""&&delete s.format,(l==="time"||f)&&delete s.format),d&&(s.contentEncoding=d),c&&c.size>0){const h=[...c].map(uN);h.length===1?s.pattern=h[0].source:h.length>1&&(s.allOf=[...h.map(m=>({...e.target==="draft-07"||e.target==="draft-04"||e.target==="openapi-3.0"?{type:"string"}:{},pattern:m.source}))])}},QY=(t,e,n,r)=>{const s=n,{minimum:i,maximum:o,multipleOf:l,exclusiveMaximum:c,exclusiveMinimum:d,isInt:f}=So(t);s.type=f?"integer":"number";const h=typeof d=="number"&&d>=(i??Number.NEGATIVE_INFINITY),m=typeof c=="number"&&c<=(o??Number.POSITIVE_INFINITY),v=e.target==="draft-04"||e.target==="openapi-3.0";if(h?v?(s.minimum=d,s.exclusiveMinimum=!0):s.exclusiveMinimum=d:typeof i=="number"&&(s.minimum=i),m?v?(s.maximum=c,s.exclusiveMaximum=!0):s.exclusiveMaximum=c:typeof o=="number"&&(s.maximum=o),l){const _=new Set;for(const x of l)Number.isFinite(x)&&x!==0?_.add(Math.abs(x)):cc(t,e,s,r,`A multipleOf divisor of ${x} cannot be represented in JSON Schema`);const[y,...w]=_;y!==void 0&&(s.multipleOf=y),w.length&&(s.allOf=[...s.allOf??[],...w.map(x=>({multipleOf:x}))])}},JY=(t,e,n,r)=>{n.type="boolean"},eX=(t,e,n,r)=>{n.not={}},tX=(t,e,n,r)=>{},nX=(t,e,n,r)=>{const s=t._zod.def,i=Lb(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},rX=(t,e,n,r)=>{const s=t._zod.def;if(s.values.length===0){n.not={};return}const i=[];for(const o of s.values)if(o===void 0){if(cc(t,e,n,r,"Literal `undefined` cannot be represented in JSON Schema"))return}else if(typeof o=="bigint"){if(cc(t,e,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,e.target==="draft-04"||e.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},sX=(t,e,n,r)=>{cc(t,e,n,r,"Custom types cannot be represented in JSON Schema")},iX=(t,e,n,r)=>{cc(t,e,n,r,"Transforms cannot be represented in JSON Schema")},oX=(t,e,n,r)=>{const s=n,i=t._zod.def,{minimum:o,maximum:l}=So(t);typeof o=="number"&&(s.minItems=o),typeof l=="number"&&(s.maxItems=l),s.type="array",s.items=wr(i.element,e,{...r,path:[...r.path,"items"]})};function jv(t){const e=t._zod.def;return e.type==="pipe"&&e.in._zod.traits.has("$ZodTransform")?jv(e.out):e.type==="catch"?jv(e.innerType):t._zod.optin}const aX=(t,e,n,r)=>{var d;const s=n,i=t._zod.def,o=i.shape;if(Object.getOwnPropertySymbols(o).length&&cc(t,e,s,r,"Symbol keys cannot be represented in JSON Schema"))return;s.type="object",s.properties={};for(const f in o)sl(s.properties,f,wr(o[f],e,{...r,path:[...r.path,"properties",f]}));const c=[];for(const f of Object.keys(o)){const h=i.shape[f];(e.io==="input"?jv(h)===void 0:h._zod.optout===void 0)&&c.push(f)}c.length>0&&(s.required=c),((d=i.catchall)==null?void 0:d._zod.def.type)==="never"?s.additionalProperties=!1:i.catchall?i.catchall&&(s.additionalProperties=wr(i.catchall,e,{...r,path:[...r.path,"additionalProperties"]})):e.io==="output"&&(s.additionalProperties=!1)},lX=(t,e,n,r)=>{const s=t._zod.def,i=s.inclusive===!1,o=s.options.map((l,c)=>wr(l,e,{...r,path:[...r.path,i?"oneOf":"anyOf",c]}));i?n.oneOf=o:n.anyOf=o},cX=(t,e,n,r)=>{const s=t._zod.def,i=wr(s.left,e,{...r,path:[...r.path,"allOf",0]}),o=wr(s.right,e,{...r,path:[...r.path,"allOf",1]}),l=d=>"allOf"in d&&Object.keys(d).length===1,c=[...l(i)?i.allOf:[i],...l(o)?o.allOf:[o]];n.allOf=c,e.intersections.push(c)};function Hb(t,e,n){var _;if(e.$ref){if(n.has(e))return e;n.add(e);const y=(_=t.get(e))==null?void 0:_.def;if(!y)return e;const w=Hb(t,y,n);return w===y?e:w}for(const y of["anyOf","oneOf"]){const w=e[y];if(!Array.isArray(w))continue;const x=w.map(k=>Hb(t,k,n));x.some((k,P)=>k!==w[P])&&(e={...e,[y]:x})}const r=Array.isArray(e.type)?e.type:[e.type],s=!r.includes("string")&&r.some(y=>y==="number"||y==="integer"),i=e.enum??(e.const!==void 0?[e.const]:void 0);if(!s&&!(i!=null&&i.some(y=>typeof y=="number")))return e;const{minimum:o,maximum:l,exclusiveMinimum:c,exclusiveMaximum:d,multipleOf:f,format:h,id:m,...v}=e;return v.enum?v.enum=v.enum.map(y=>typeof y=="number"?String(y):y):typeof v.const=="number"&&(v.const=String(v.const)),s&&(v.type="string",i||(v.pattern=(r.includes("number")?gk:bG).source)),v}const Ub=new WeakMap;function uX(t){var r;const e=new Map;for(const s of t.seen.values())s.def&&!e.has(s.schema)&&e.set(s.schema,s);const n=new Map;for(const s of Ub.get(t)??[]){const i=t.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 l=Hb(e,o,new Set);l!==o&&n.set(o,l)}if(n.size)for(const s of t.seen.values())for(const i of[s.schema,s.def]){const o=i&&n.get(i.propertyNames);o&&(i.propertyNames=o)}}const dX=(t,e,n,r)=>{const s=n,i=t._zod.def;s.type="object";const o=i.keyType,l=So(o).patterns;if(i.mode==="loose"&&l&&l.size>0){const f=wr(i.valueType,e,{...r,path:[...r.path,"patternProperties","*"]});s.patternProperties={};for(const h of l)sl(s.patternProperties,uN(h).source,f)}else{if(e.target==="draft-07"||e.target==="draft-2020-12"){s.propertyNames=wr(i.keyType,e,{...r,path:[...r.path,"propertyNames"]});let f=Ub.get(e);f||(f=[],Ub.set(e,f),e.deferred.push(()=>uX(e))),f.push(t)}s.additionalProperties=wr(i.valueType,e,{...r,path:[...r.path,"additionalProperties"]})}const c=o._zod.values,d=e.io==="input"&&jv(i.valueType)!==void 0;if(c&&!i.partial&&!d){const f=[...c].filter(h=>typeof h=="string"||typeof h=="number");f.length>0&&(s.required=f.map(String))}},fX=(t,e,n,r)=>{const s=t._zod.def,i=wr(s.innerType,e,r),o=e.seen.get(t);e.target==="openapi-3.0"?(o.ref=s.innerType,n.nullable=!0):n.anyOf=[i,{type:"null"}]},hX=(t,e,n,r)=>{const s=t._zod.def;wr(s.innerType,e,r);const i=e.seen.get(t);i.ref=s.innerType},wk=Symbol();function dN(t,e,n,r,s){let i=!1;const o=JSON.stringify(t,(l,c)=>typeof c!="bigint"?c:(i=!0,null));return i?(cc(e,n,r,s,"BigInt defaults cannot be represented in JSON Schema"),wk):JSON.parse(o)}const pX=(t,e,n,r)=>{const s=t._zod.def;wr(s.innerType,e,r);const i=e.seen.get(t);i.ref=s.innerType;const o=dN(s.defaultValue,t,e,n,r);o!==wk&&(n.default=o)},mX=(t,e,n,r)=>{const s=t._zod.def;wr(s.innerType,e,r);const i=e.seen.get(t);if(i.ref=s.innerType,e.io!=="input")return;const o=dN(s.defaultValue,t,e,n,r);o!==wk&&(n._prefault=o)},gX=(t,e,n,r)=>{const s=t._zod.def;wr(s.innerType,e,r);const i=e.seen.get(t);i.ref=s.innerType;let o;try{o=s.catchValue(void 0)}catch{cc(t,e,n,r,"Dynamic catch values are not supported in JSON Schema");return}n.default=o},vX=(t,e,n,r)=>{const s=t._zod.def,i=s.in._zod.traits.has("$ZodTransform"),o=e.io==="input"?i?s.out:s.in:s.out;wr(o,e,r);const l=e.seen.get(t);l.ref=o},yX=(t,e,n,r)=>{const s=t._zod.def;wr(s.innerType,e,r);const i=e.seen.get(t);i.ref=s.innerType,n.readOnly=!0},fN=(t,e,n,r)=>{const s=t._zod.def;wr(s.innerType,e,r);const i=e.seen.get(t);i.ref=s.innerType},EA=new WeakSet([Object.prototype,Error.prototype]);function sg(t,e,n){Object.defineProperty(t,e,{configurable:!0,enumerable:!1,get(){const r=n(this);return Object.defineProperty(this,e,{value:r,configurable:!0,writable:!0}),r},set(r){Object.defineProperty(this,e,{value:r,configurable:!0,writable:!0})}})}const _X=(t,e)=>{Mq.init(t,e),t.name="ZodError";const n=Object.getPrototypeOf(t);EA.has(n)||(EA.add(n),sg(n,"format",r=>s=>Dq(r,s)),sg(n,"flatten",r=>s=>Lq(r,s)),sg(n,"addIssue",r=>s=>{r.issues.push(s),r.message=JSON.stringify(r.issues,Db,2)}),sg(n,"addIssues",r=>s=>{r.issues.push(...s),r.message=JSON.stringify(r.issues,Db,2)}),Object.defineProperty(n,"isEmpty",{configurable:!0,enumerable:!1,get(){return this.issues.length===0}}))},no=me("ZodError",_X,void 0,{Parent:Error}),wX=fk(no),bX=hk(no),xX=pk(no),SX=mk(no),kX=Hq(no),EX=Uq(no),CX=Bq(no),PX=Zq(no),AX=Wq(no),TX=qq(no),RX=Gq(no),IX=Kq(no);function OX(){Po.localeError||oa(XK())}function L1(){Po.memoizer||oa({memoizer:GK()})}const Jn=me("ZodType",(t,e)=>(OX(),Qn.init(t,e),t.def=e,t.type=e.type,t),{check(...t){const e=this.def;return this.clone(yi(e,{checks:[...e.checks??[],...t.map(n=>typeof n=="function"?{_zod:{check:n,def:{check:"custom"},onattach:[]}}:n)]}),{parent:!0})},with(...t){return this.check(...t)},clone(t,e){return bc(this,t,e)},brand(){return this},register(t,e){return t.add(this,e),this},refine(t,e){return this.check(TQ(t,e))},superRefine(t,e){return this.check(RQ(t,e))},overwrite(t){return this.check(Kf(t))},optional(){return AA(this)},exactOptional(){return gQ(this)},nullable(){return TA(this)},nullish(){return AA(TA(this))},nonoptional(t){return xQ(this,t)},array(){return At(this)},or(t){return Am([this,t])},and(t){return fQ(this,t)},transform(t){return RA(this,mQ(t))},default(t){return _Q(this,t)},prefault(t){return bQ(this,t)},catch(t){return kQ(this,t)},pipe(t){return RA(this,t)},readonly(){return PQ(this)},describe(t){const e=this.clone();return ip.add(e,{description:t}),e},meta(...t){if(t.length===0)return ip.get(this);const e=this.clone();return ip.add(e,t[0]),e},isOptional(){return this.safeParse(void 0).success},isNullable(){return this.safeParse(null).success},apply(t,...e){return e.length===0?t(this):t(this,...e)},get"~standard"(){return RM(this,"~standard",{...FM(this),jsonSchema:{input:$v(this,"input"),output:$v(this,"output")}})},set"~standard"(t){lc(this,"~standard",t)},parse:function t(e,n){return wX(this,e,n,{callee:t})},parseAsync:async function t(e,n){return await bX(this,e,n,{callee:t})},safeParse(t,e){return xX(this,t,e)},async safeParseAsync(t,e){return SX(this,t,e)},get spa(){return this==null?void 0:this.safeParseAsync},set spa(t){lc(this,"spa",t)},validate(t,e){return Fq(this,t,e)},validateAsync(t,e){return Vq(this,t,e)},encode:function t(e,n){return kX(this,e,n,{callee:t})},decode:function t(e,n){return EX(this,e,n,{callee:t})},encodeAsync:async function t(e,n){return await CX(this,e,n,{callee:t})},decodeAsync:async function t(e,n){return await PX(this,e,n,{callee:t})},safeEncode(t,e){return AX(this,t,e)},safeDecode(t,e){return TX(this,t,e)},async safeEncodeAsync(t,e){return RX(this,t,e)},async safeDecodeAsync(t,e){return IX(this,t,e)},toJSONSchema(t){return GY(this,{})(t)},get description(){var t;return(t=ip.get(this))==null?void 0:t.description},get _def(){return this._zod.def}}),hN=me("_ZodString",(t,e)=>{yk.init(t,e),Jn.init(t,e),t._zod.processJSONSchema=(n,r,s)=>XY(t,n,r)},IM({format:t=>So(t).format??null,minLength:t=>So(t).minimum??null,maxLength:t=>So(t).maximum??null},{regex(...t){return this.check(OY(...t))},includes(...t){return this.check(LY(...t))},startsWith(...t){return this.check(DY(...t))},endsWith(...t){return this.check($Y(...t))},min(...t){return this.check(Dv(...t))},max(...t){return this.check(JM(...t))},length(...t){return this.check(eN(...t))},nonempty(...t){return this.check(Dv(1,...t))},lowercase(t){return this.check(MY(t))},uppercase(t){return this.check(NY(t))},trim(){return this.check(FY())},normalize(...t){return this.check(jY(...t))},toLowerCase(){return this.check(zY())},toUpperCase(){return this.check(VY())},slugify(){return this.check(HY())}})),MX=me("ZodString",(t,e)=>{yk.init(t,e),hN.init(t,e)},{email(t){return this.check(tY(jX,t))},url(t){return this.check(aY(zX,t))},jwt(t){return this.check(xY(tQ,t))},emoji(t){return this.check(lY(VX,t))},guid(t){return this.check(nY(FX,t))},uuid(t){return this.check(rY(ig,t))},uuidv4(t){return this.check(sY(ig,t))},uuidv6(t){return this.check(iY(ig,t))},uuidv7(t){return this.check(oY(ig,t))},nanoid(t){return this.check(cY(HX,t))},cuid(t){return this.check(uY(UX,t))},cuid2(t){return this.check(dY(BX,t))},ulid(t){return this.check(fY(ZX,t))},base64(t){return this.check(_Y(QX,t))},base64url(t){return this.check(wY(JX,t))},xid(t){return this.check(hY(WX,t))},ksuid(t){return this.check(pY(qX,t))},ipv4(t){return this.check(mY(GX,t))},ipv6(t){return this.check(gY(KX,t))},cidrv4(t){return this.check(vY(YX,t))},cidrv6(t){return this.check(yY(XX,t))},e164(t){return this.check(bY(eQ,t))},datetime(t){return this.check(SY(NX,t))},date(t){return this.check(kY(LX,t))},time(t){return this.check(EY(DX,t))},duration(t){return this.check(CY($X,t))}});function se(t){return eY(MX,t)}const er=me("ZodStringFormat",(t,e)=>{Hn.init(t,e),hN.init(t,e)}),NX=me("ZodISODateTime",(t,e)=>{nK.init(t,e),er.init(t,e)}),LX=me("ZodISODate",(t,e)=>{rK.init(t,e),er.init(t,e)}),DX=me("ZodISOTime",(t,e)=>{sK.init(t,e),er.init(t,e)}),$X=me("ZodISODuration",(t,e)=>{iK.init(t,e),er.init(t,e)}),jX=me("ZodEmail",(t,e)=>{HG.init(t,e),er.init(t,e)}),FX=me("ZodGUID",(t,e)=>{zG.init(t,e),er.init(t,e)}),ig=me("ZodUUID",(t,e)=>{VG.init(t,e),er.init(t,e)}),zX=me("ZodURL",(t,e)=>{GG.init(t,e),er.init(t,e)}),VX=me("ZodEmoji",(t,e)=>{KG.init(t,e),er.init(t,e)}),HX=me("ZodNanoID",(t,e)=>{YG.init(t,e),er.init(t,e)}),UX=me("ZodCUID",(t,e)=>{XG.init(t,e),er.init(t,e)}),BX=me("ZodCUID2",(t,e)=>{QG.init(t,e),er.init(t,e)}),ZX=me("ZodULID",(t,e)=>{JG.init(t,e),er.init(t,e)}),WX=me("ZodXID",(t,e)=>{eK.init(t,e),er.init(t,e)}),qX=me("ZodKSUID",(t,e)=>{tK.init(t,e),er.init(t,e)}),GX=me("ZodIPv4",(t,e)=>{oK.init(t,e),er.init(t,e)}),KX=me("ZodIPv6",(t,e)=>{lK.init(t,e),er.init(t,e)}),YX=me("ZodCIDRv4",(t,e)=>{cK.init(t,e),er.init(t,e)}),XX=me("ZodCIDRv6",(t,e)=>{dK.init(t,e),er.init(t,e)}),QX=me("ZodBase64",(t,e)=>{fK.init(t,e),er.init(t,e)}),JX=me("ZodBase64URL",(t,e)=>{pK.init(t,e),er.init(t,e)}),eQ=me("ZodE164",(t,e)=>{mK.init(t,e),er.init(t,e)}),tQ=me("ZodJWT",(t,e)=>{vK.init(t,e),er.init(t,e)}),pN=me("ZodNumber",(t,e)=>{ZM.init(t,e),Jn.init(t,e),t._zod.processJSONSchema=(n,r,s)=>QY(t,n,r,s),t.isFinite=!0},IM({minValue:t=>{const{minimum:e,exclusiveMinimum:n}=So(t);return Math.max(e??Number.NEGATIVE_INFINITY,n??Number.NEGATIVE_INFINITY)},maxValue:t=>{const{maximum:e,exclusiveMaximum:n}=So(t);return Math.min(e??Number.POSITIVE_INFINITY,n??Number.POSITIVE_INFINITY)},isInt:t=>{const{isInt:e,multipleOf:n}=So(t);return!!e||!!(n!=null&&n.some(Number.isSafeInteger))},format:t=>So(t).format??null},{gt(t,e){return this.check(gA(t,e))},gte(t,e){return this.check(U2(t,e))},min(t,e){return this.check(U2(t,e))},lt(t,e){return this.check(mA(t,e))},lte(t,e){return this.check(H2(t,e))},max(t,e){return this.check(H2(t,e))},int(t){return this.check(CA(t))},safe(t){return this.check(CA(t))},positive(t){return this.check(gA(0,t))},nonnegative(t){return this.check(U2(0,t))},negative(t){return this.check(mA(0,t))},nonpositive(t){return this.check(H2(0,t))},multipleOf(t,e){return this.check(vA(t,e))},step(t,e){return this.check(vA(t,e))},finite(){return this}}));function Ln(t){return PY(pN,t)}const nQ=me("ZodNumberFormat",(t,e)=>{yK.init(t,e),pN.init(t,e)});function CA(t){return AY(nQ,t)}const rQ=me("ZodBoolean",(t,e)=>{_K.init(t,e),Jn.init(t,e),t._zod.processJSONSchema=(n,r,s)=>JY(t,n,r)});function Ys(t){return TY(rQ,t)}const sQ=me("ZodUnknown",(t,e)=>{wK.init(t,e),Jn.init(t,e),t._zod.processJSONSchema=(n,r,s)=>tX()});function Bb(){return RY(sQ)}const iQ=me("ZodNever",(t,e)=>{bK.init(t,e),Jn.init(t,e),t._zod.processJSONSchema=(n,r,s)=>eX(t,n,r)});function oQ(t){return IY(iQ,t)}const aQ=me("ZodArray",(t,e)=>{L1(),kK.init(t,e),Jn.init(t,e),t._zod.processJSONSchema=(n,r,s)=>oX(t,n,r,s),t.element=e.element},{min(t,e){return this.check(Dv(t,e))},nonempty(t){return this.check(Dv(1,t))},max(t,e){return this.check(JM(t,e))},length(t,e){return this.check(eN(t,e))},unwrap(){return this.element}});function At(t,e){return UY(aQ,t,e)}const lQ=me("ZodObject",(t,e)=>{L1(),PK.init(t,e),Jn.init(t,e),t._zod.processJSONSchema=(n,r,s)=>aX(t,n,r,s),Eq(t,"shape",n=>n._zod.def.shape,!1)},{keyof(){return Vt(Object.keys(this._zod.def.shape))},catchall(t){return this.clone(yi(this._zod.def,{catchall:t}))},passthrough(){return this.clone(yi(this._zod.def,{catchall:Bb()}))},loose(){return this.clone(yi(this._zod.def,{catchall:Bb()}))},strict(){return this.clone(yi(this._zod.def,{catchall:oQ()}))},strip(){return this.clone(yi(this._zod.def,{catchall:void 0}))},extend(t){return pq(this,t)},safeExtend(t){return mq(this,t)},merge(t){return gq(this,t)},pick(t){return fq(this,t)},omit(t){return hq(this,t)},partial(...t){return X3(gN,this,t[0])},exactPartial(...t){return X3(vN,this,t[0],"exactPartial")},required(...t){return vq(yN,this,t[0])}});function Fe(t,e){const n={type:"object",shape:t??{},...it(e)};return new lQ(n)}const mN=me("ZodUnion",(t,e)=>{GM.init(t,e),Jn.init(t,e),t._zod.processJSONSchema=(n,r,s)=>lX(t,n,r,s),t.options=e.options});function Am(t,e){return new mN({type:"union",options:t,...it(e)})}const cQ=me("ZodDiscriminatedUnion",(t,e)=>{mN.init(t,e),TK.init(t,e)});function uQ(t,e,n){return new cQ({type:"union",options:e,discriminator:t,...it(n)})}const dQ=me("ZodIntersection",(t,e)=>{RK.init(t,e),Jn.init(t,e),t._zod.processJSONSchema=(n,r,s)=>cX(t,n,r,s)});function fQ(t,e){return new dQ({type:"intersection",left:t,right:e})}const PA=me("ZodRecord",(t,e)=>{L1(),IK.init(t,e),Jn.init(t,e),t._zod.processJSONSchema=(n,r,s)=>dX(t,n,r,s),t.keyType=e.keyType,t.valueType=e.valueType});function bk(t,e,n){return!e||!e._zod?new PA({type:"record",keyType:se(),valueType:t,...it(e)}):new PA({type:"record",keyType:t,valueType:e,...it(n)})}const Zb=me("ZodEnum",(t,e)=>{OK.init(t,e),Jn.init(t,e),t._zod.processJSONSchema=(r,s,i)=>nX(t,r,s),t.enum=e.entries,t.options=[...t._zod.values];const n=new Set(Object.keys(e.entries));t.extract=(r,s)=>{const i={};for(const o of r)if(n.has(o))i[o]=e.entries[o];else throw new Error(`Key ${o} not found in enum`);return new Zb({...e,checks:[],...it(s),entries:i})},t.exclude=(r,s)=>{const i={...e.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 Zb({...e,checks:[],...it(s),entries:i})}});function Vt(t,e){const n=Array.isArray(t)?Object.fromEntries(t.map(r=>[r,r])):t;return new Zb({type:"enum",entries:n,...it(e)})}const hQ=me("ZodLiteral",(t,e)=>{MK.init(t,e),Jn.init(t,e),t._zod.processJSONSchema=(n,r,s)=>rX(t,n,r,s),t.values=new Set(e.values),Object.defineProperty(t,"value",{get(){if(e.values.length>1)throw new Error("This schema contains multiple valid literal values. Use `.values` instead.");return e.values[0]}})});function Rf(t,e){return new hQ({type:"literal",values:Array.isArray(t)?t:[t],...it(e)})}const pQ=me("ZodTransform",(t,e)=>{L1(),NK.init(t,e),Jn.init(t,e),t._zod.processJSONSchema=(n,r,s)=>iX(t,n,r,s),t._zod.parse=(n,r)=>{if(r.direction==="backward")throw new MM(t.constructor.name);n.addIssue=i=>{if(typeof i=="string")n.issues.push(Zp(i,n.value,e));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=t),n.issues.push(Zp(o))}};const s=e.transform(n.value,n);return s instanceof Promise?s.then(i=>(n.value=i,n)):(n.value=s,n)}});function mQ(t){return new pQ({type:"transform",transform:t})}const gN=me("ZodOptional",(t,e)=>{KM.init(t,e),Jn.init(t,e),t._zod.processJSONSchema=(n,r,s)=>fN(t,n,r,s),t.unwrap=()=>t._zod.def.innerType});function AA(t){return new gN({type:"optional",innerType:t})}const vN=me("ZodExactOptional",(t,e)=>{LK.init(t,e),Jn.init(t,e),t._zod.processJSONSchema=(n,r,s)=>fN(t,n,r,s),t.unwrap=()=>t._zod.def.innerType});function gQ(t){return new vN({type:"optional",innerType:t})}const vQ=me("ZodNullable",(t,e)=>{DK.init(t,e),Jn.init(t,e),t._zod.processJSONSchema=(n,r,s)=>fX(t,n,r,s),t.unwrap=()=>t._zod.def.innerType});function TA(t){return new vQ({type:"nullable",innerType:t})}const yQ=me("ZodDefault",(t,e)=>{$K.init(t,e),Jn.init(t,e),t._zod.processJSONSchema=(n,r,s)=>pX(t,n,r,s),t.unwrap=()=>t._zod.def.innerType,t.removeDefault=t.unwrap});function _Q(t,e){return new yQ({type:"default",innerType:t,get defaultValue(){return typeof e=="function"?e():CM(e)}})}const wQ=me("ZodPrefault",(t,e)=>{jK.init(t,e),Jn.init(t,e),t._zod.processJSONSchema=(n,r,s)=>mX(t,n,r,s),t.unwrap=()=>t._zod.def.innerType});function bQ(t,e){return new wQ({type:"prefault",innerType:t,get defaultValue(){return typeof e=="function"?e():CM(e)}})}const yN=me("ZodNonOptional",(t,e)=>{FK.init(t,e),Jn.init(t,e),t._zod.processJSONSchema=(n,r,s)=>hX(t,n,r,s),t.unwrap=()=>t._zod.def.innerType});function xQ(t,e){return new yN({type:"nonoptional",innerType:t,...it(e)})}const SQ=me("ZodCatch",(t,e)=>{zK.init(t,e),Jn.init(t,e),t._zod.processJSONSchema=(n,r,s)=>gX(t,n,r,s),t.unwrap=()=>t._zod.def.innerType,t.removeCatch=t.unwrap});function kQ(t,e){return new SQ({type:"catch",innerType:t,catchValue:typeof e=="function"?e:Pq(e)})}const EQ=me("ZodPipe",(t,e)=>{VK.init(t,e),Jn.init(t,e),t._zod.processJSONSchema=(n,r,s)=>vX(t,n,r,s),t.in=e.in,t.out=e.out});function RA(t,e){return new EQ({type:"pipe",in:t,out:e})}const CQ=me("ZodReadonly",(t,e)=>{HK.init(t,e),Jn.init(t,e),t._zod.processJSONSchema=(n,r,s)=>yX(t,n,r,s),t.unwrap=()=>t._zod.def.innerType});function PQ(t){return new CQ({type:"readonly",innerType:t})}const AQ=me("ZodCustom",(t,e)=>{UK.init(t,e),Jn.init(t,e),t._zod.processJSONSchema=(n,r,s)=>sX(t,n,r,s)});function TQ(t,e={}){return BY(AQ,t,e)}function RQ(t,e){return ZY(t,e)}const _N={custom:"custom"},Ks=(t,e=String(t))=>t instanceof Error?t.message:e,IQ=["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","installer_unstoppable","inputs_changed"],wN=["ENOENT","EACCES","EPERM","EEXIST","ENOTDIR","EISDIR","ELOOP","ENOSPC","EMFILE","EADDRINUSE","ECONNREFUSED","ECONNRESET","ETIMEDOUT","EBUSY","ENOTSUP","EINVAL","ENOTEMPTY","EROFS","EAI_AGAIN"],OQ=["timeout","aborted","unknown"],bN=[...IQ,...wN,...OQ];new Set(bN);new Set(wN);const hi=Ln().finite().nonnegative().max(Number.MAX_SAFE_INTEGER),MQ=Fe({command:Vt(["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:Vt(["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:Vt(["claude","codex","cursor","unknown","other"]).optional(),mcp_editor:Vt(["claude","claude-desktop","codex","cursor","unknown","other"]).optional(),source:Vt(["cli","mcp","core","ui","visual_editor"]).optional(),surface:Vt(["cli","mcp","visual_editor"]).optional(),mode:Vt(["initial_generation","zero_to_one","source_grounded","comment_refine","vary","history_adoption","commit","unknown"]).optional(),entry_point:Vt(["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:Vt(["existing","fresh"]).optional(),preview_kind:Vt(["dev_server","static_artifact"]).optional(),provider:Vt(["pinterest","arena","cosmos","x"]).optional(),request_status:Vt(["accepted","rejected","completed","failed","cancelled","degraded","superseded"]).optional(),error_code:Vt(["OPERATION_FAILED","USAGE_ERROR","AUTH_REQUIRED","SERVER_UNAVAILABLE","WAIT_TIMEOUT","SESSION_NOT_FOUND","WORK_ITEM_NOT_FOUND","MCP_REMOVED","STATIC_PREVIEW_FAILED","DEV_SERVER_FAILED","PREVIEW_UNAVAILABLE","DEPENDENCY_INSTALL_FAILED","DEV_SERVER_START_FAILED","DEV_SCRIPT_MISSING"]).optional(),reason_code:Vt(bN).optional(),failure_reason:Vt(["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","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:Vt(["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:hi.int().optional(),verification_duration_ms:hi.optional(),ok:Ys().optional(),is_recoverable:Ys().optional(),is_fresh:Ys().optional(),duration_ms:hi.optional(),dwell_ms_from_terminal:hi.optional(),exit_code:hi.optional(),requested_count:hi.optional(),accepted_count:hi.optional(),work_item_count:hi.optional(),completed_count:hi.optional(),failed_count:hi.optional(),cancelled_count:hi.optional(),reference_count:hi.optional(),changed_files_count:hi.optional()}),NQ=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"]),LQ=(t,e)=>{if(!NQ.has(t))return null;const n={};for(const[r,s]of Object.entries(MQ.shape)){const i=s.safeParse(e[r]);i.success&&i.data!==void 0&&(n[r]=i.data)}return n};var tn;(function(t){t.assertEqual=s=>{};function e(s){}t.assertIs=e;function n(s){throw new Error}t.assertNever=n,t.arrayToEnum=s=>{const i={};for(const o of s)i[o]=o;return i},t.getValidEnumValues=s=>{const i=t.objectKeys(s).filter(l=>typeof s[s[l]]!="number"),o={};for(const l of i)o[l]=s[l];return t.objectValues(o)},t.objectValues=s=>t.objectKeys(s).map(function(i){return s[i]}),t.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},t.find=(s,i)=>{for(const o of s)if(i(o))return o},t.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)}t.joinValues=r,t.jsonStringifyReplacer=(s,i)=>typeof i=="bigint"?i.toString():i})(tn||(tn={}));var IA;(function(t){t.mergeShapes=(e,n)=>({...e,...n})})(IA||(IA={}));const Xe=tn.arrayToEnum(["string","nan","number","integer","float","boolean","date","bigint","symbol","function","undefined","null","array","object","unknown","promise","void","never","map","set"]),Ll=t=>{switch(typeof t){case"undefined":return Xe.undefined;case"string":return Xe.string;case"number":return Number.isNaN(t)?Xe.nan:Xe.number;case"boolean":return Xe.boolean;case"function":return Xe.function;case"bigint":return Xe.bigint;case"symbol":return Xe.symbol;case"object":return Array.isArray(t)?Xe.array:t===null?Xe.null:t.then&&typeof t.then=="function"&&t.catch&&typeof t.catch=="function"?Xe.promise:typeof Map<"u"&&t instanceof Map?Xe.map:typeof Set<"u"&&t instanceof Set?Xe.set:typeof Date<"u"&&t instanceof Date?Xe.date:Xe.object;default:return Xe.unknown}},Re=tn.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 Qa extends Error{get errors(){return this.issues}constructor(e){super(),this.issues=[],this.addIssue=r=>{this.issues=[...this.issues,r]},this.addIssues=(r=[])=>{this.issues=[...this.issues,...r]};const n=new.target.prototype;Object.setPrototypeOf?Object.setPrototypeOf(this,n):this.__proto__=n,this.name="ZodError",this.issues=e}format(e){const n=e||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 l=r,c=0;for(;c<o.path.length;){const d=o.path[c],f=c===o.path.length-1;if(d==="_errors"){f&&l._errors.push(n(o)),c++;continue}Object.prototype.hasOwnProperty.call(l,d)||(d==="__proto__"?Object.defineProperty(l,d,{value:{_errors:[]},writable:!0,enumerable:!0,configurable:!0}):l[d]={_errors:[]}),l=l[d],f&&l._errors.push(n(o)),c++}}};return s(this),r}static assert(e){if(!(e instanceof Qa))throw new Error(`Not a ZodError: ${e}`)}toString(){return this.message}get message(){return JSON.stringify(this.issues,tn.jsonStringifyReplacer,2)}get isEmpty(){return this.issues.length===0}flatten(e=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(e(s))}else r.push(e(s));return{formErrors:r,fieldErrors:n}}get formErrors(){return this.flatten()}}Qa.create=t=>new Qa(t);const Wb=(t,e)=>{let n;switch(t.code){case Re.invalid_type:t.received===Xe.undefined?n="Required":n=`Expected ${t.expected}, received ${t.received}`;break;case Re.invalid_literal:n=`Invalid literal value, expected ${JSON.stringify(t.expected,tn.jsonStringifyReplacer)}`;break;case Re.unrecognized_keys:n=`Unrecognized key(s) in object: ${tn.joinValues(t.keys,", ")}`;break;case Re.invalid_union:n="Invalid input";break;case Re.invalid_union_discriminator:n=`Invalid discriminator value. Expected ${tn.joinValues(t.options)}`;break;case Re.invalid_enum_value:n=`Invalid enum value. Expected ${tn.joinValues(t.options)}, received '${t.received}'`;break;case Re.invalid_arguments:n="Invalid function arguments";break;case Re.invalid_return_type:n="Invalid function return type";break;case Re.invalid_date:n="Invalid date";break;case Re.invalid_string:typeof t.validation=="object"?"includes"in t.validation?(n=`Invalid input: must include "${t.validation.includes}"`,typeof t.validation.position=="number"&&(n=`${n} at one or more positions greater than or equal to ${t.validation.position}`)):"startsWith"in t.validation?n=`Invalid input: must start with "${t.validation.startsWith}"`:"endsWith"in t.validation?n=`Invalid input: must end with "${t.validation.endsWith}"`:tn.assertNever(t.validation):t.validation!=="regex"?n=`Invalid ${t.validation}`:n="Invalid";break;case Re.too_small:t.type==="array"?n=`Array must contain ${t.exact?"exactly":t.inclusive?"at least":"more than"} ${t.minimum} element(s)`:t.type==="string"?n=`String must contain ${t.exact?"exactly":t.inclusive?"at least":"over"} ${t.minimum} character(s)`:t.type==="number"?n=`Number must be ${t.exact?"exactly equal to ":t.inclusive?"greater than or equal to ":"greater than "}${t.minimum}`:t.type==="bigint"?n=`Number must be ${t.exact?"exactly equal to ":t.inclusive?"greater than or equal to ":"greater than "}${t.minimum}`:t.type==="date"?n=`Date must be ${t.exact?"exactly equal to ":t.inclusive?"greater than or equal to ":"greater than "}${new Date(Number(t.minimum))}`:n="Invalid input";break;case Re.too_big:t.type==="array"?n=`Array must contain ${t.exact?"exactly":t.inclusive?"at most":"less than"} ${t.maximum} element(s)`:t.type==="string"?n=`String must contain ${t.exact?"exactly":t.inclusive?"at most":"under"} ${t.maximum} character(s)`:t.type==="number"?n=`Number must be ${t.exact?"exactly":t.inclusive?"less than or equal to":"less than"} ${t.maximum}`:t.type==="bigint"?n=`BigInt must be ${t.exact?"exactly":t.inclusive?"less than or equal to":"less than"} ${t.maximum}`:t.type==="date"?n=`Date must be ${t.exact?"exactly":t.inclusive?"smaller than or equal to":"smaller than"} ${new Date(Number(t.maximum))}`:n="Invalid input";break;case Re.custom:n="Invalid input";break;case Re.invalid_intersection_types:n="Intersection results could not be merged";break;case Re.not_multiple_of:n=`Number must be a multiple of ${t.multipleOf}`;break;case Re.not_finite:n="Number must be finite";break;default:n=e.defaultError,tn.assertNever(t)}return{message:n}};let DQ=Wb;function $Q(){return DQ}const jQ=t=>{const{data:e,path:n,errorMaps:r,issueData:s}=t,i=[...n,...s.path||[]],o={...s,path:i};if(s.message!==void 0)return{...s,path:i,message:s.message};let l="";const c=r.filter(d=>!!d).slice().reverse();for(const d of c)l=d(o,{data:e,defaultError:l}).message;return{...s,path:i,message:l}};function $e(t,e){const n=$Q(),r=jQ({issueData:e,data:t.data,path:t.path,errorMaps:[t.common.contextualErrorMap,t.schemaErrorMap,n,n===Wb?void 0:Wb].filter(s=>!!s)});t.common.issues.push(r)}class Ci{constructor(){this.value="valid"}dirty(){this.value==="valid"&&(this.value="dirty")}abort(){this.value!=="aborted"&&(this.value="aborted")}static mergeArray(e,n){const r=[];for(const s of n){if(s.status==="aborted")return wt;s.status==="dirty"&&e.dirty(),r.push(s.value)}return{status:e.value,value:r}}static async mergeObjectAsync(e,n){const r=[];for(const s of n){const i=await s.key,o=await s.value;r.push({key:i,value:o})}return Ci.mergeObjectSync(e,r)}static mergeObjectSync(e,n){const r={};for(const s of n){const{key:i,value:o}=s;if(i.status==="aborted"||o.status==="aborted")return wt;i.status==="dirty"&&e.dirty(),o.status==="dirty"&&e.dirty(),i.value!=="__proto__"&&(typeof o.value<"u"||s.alwaysSet)&&(r[i.value]=o.value)}return{status:e.value,value:r}}}const wt=Object.freeze({status:"aborted"}),op=t=>({status:"dirty",value:t}),ro=t=>({status:"valid",value:t}),OA=t=>t.status==="aborted",MA=t=>t.status==="dirty",If=t=>t.status==="valid",Fv=t=>typeof Promise<"u"&&t instanceof Promise;var et;(function(t){t.errToObj=e=>typeof e=="string"?{message:e}:e||{},t.toString=e=>typeof e=="string"?e:e==null?void 0:e.message})(et||(et={}));class uc{constructor(e,n,r,s){this._cachedPath=[],this.parent=e,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 NA=(t,e)=>{if(If(e))return{success:!0,data:e.value};if(!t.common.issues.length)throw new Error("Validation failed but no issues detected.");return{success:!1,get error(){if(this._error)return this._error;const n=new Qa(t.common.issues);return this._error=n,this._error}}};function Nt(t){if(!t)return{};const{errorMap:e,invalid_type_error:n,required_error:r,description:s}=t;if(e&&(n||r))throw new Error(`Can't use "invalid_type_error" or "required_error" in conjunction with custom error map.`);return e?{errorMap:e,description:s}:{errorMap:(o,l)=>{const{message:c}=t;return o.code==="invalid_enum_value"?{message:c??l.defaultError}:typeof l.data>"u"?{message:c??r??l.defaultError}:o.code!=="invalid_type"?{message:l.defaultError}:{message:c??n??l.defaultError}},description:s}}class Xt{get description(){return this._def.description}_getType(e){return Ll(e.data)}_getOrReturnCtx(e,n){return n||{common:e.parent.common,data:e.data,parsedType:Ll(e.data),schemaErrorMap:this._def.errorMap,path:e.path,parent:e.parent}}_processInputParams(e){return{status:new Ci,ctx:{common:e.parent.common,data:e.data,parsedType:Ll(e.data),schemaErrorMap:this._def.errorMap,path:e.path,parent:e.parent}}}_parseSync(e){const n=this._parse(e);if(Fv(n))throw new Error("Synchronous parse encountered promise.");return n}_parseAsync(e){const n=this._parse(e);return Promise.resolve(n)}parse(e,n){const r=this.safeParse(e,n);if(r.success)return r.data;throw r.error}safeParse(e,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:e,parsedType:Ll(e)},s=this._parseSync({data:e,path:r.path,parent:r});return NA(r,s)}"~validate"(e){var r,s;const n={common:{issues:[],async:!!this["~standard"].async},path:[],schemaErrorMap:this._def.errorMap,parent:null,data:e,parsedType:Ll(e)};if(!this["~standard"].async)try{const i=this._parseSync({data:e,path:[],parent:n});return If(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:e,path:[],parent:n}).then(i=>If(i)?{value:i.value}:{issues:n.common.issues})}async parseAsync(e,n){const r=await this.safeParseAsync(e,n);if(r.success)return r.data;throw r.error}async safeParseAsync(e,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:e,parsedType:Ll(e)},s=this._parse({data:e,path:r.path,parent:r}),i=await(Fv(s)?s:Promise.resolve(s));return NA(r,i)}refine(e,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=e(s),l=()=>i.addIssue({code:Re.custom,...r(s)});return typeof Promise<"u"&&o instanceof Promise?o.then(c=>c?!0:(l(),!1)):o?!0:(l(),!1)})}refinement(e,n){return this._refinement((r,s)=>e(r)?!0:(s.addIssue(typeof n=="function"?n(r,s):n),!1))}_refinement(e){return new Mf({schema:this,typeName:bt.ZodEffects,effect:{type:"refinement",refinement:e}})}superRefine(e){return this._refinement(e)}constructor(e){this.spa=this.safeParseAsync,this._def=e,this.parse=this.parse.bind(this),this.safeParse=this.safeParse.bind(this),this.parseAsync=this.parseAsync.bind(this),this.safeParseAsync=this.safeParseAsync.bind(this),this.spa=this.spa.bind(this),this.refine=this.refine.bind(this),this.refinement=this.refinement.bind(this),this.superRefine=this.superRefine.bind(this),this.optional=this.optional.bind(this),this.nullable=this.nullable.bind(this),this.nullish=this.nullish.bind(this),this.array=this.array.bind(this),this.promise=this.promise.bind(this),this.or=this.or.bind(this),this.and=this.and.bind(this),this.transform=this.transform.bind(this),this.brand=this.brand.bind(this),this.default=this.default.bind(this),this.catch=this.catch.bind(this),this.describe=this.describe.bind(this),this.pipe=this.pipe.bind(this),this.readonly=this.readonly.bind(this),this.isNullable=this.isNullable.bind(this),this.isOptional=this.isOptional.bind(this),this["~standard"]={version:1,vendor:"zod",validate:n=>this["~validate"](n)}}optional(){return nc.create(this,this._def)}nullable(){return Nf.create(this,this._def)}nullish(){return this.nullable().optional()}array(){return na.create(this)}promise(){return Uv.create(this,this._def)}or(e){return Vv.create([this,e],this._def)}and(e){return Hv.create(this,e,this._def)}transform(e){return new Mf({...Nt(this._def),schema:this,typeName:bt.ZodEffects,effect:{type:"transform",transform:e}})}default(e){const n=typeof e=="function"?e:()=>e;return new Gb({...Nt(this._def),innerType:this,defaultValue:n,typeName:bt.ZodDefault})}brand(){return new aJ({typeName:bt.ZodBranded,type:this,...Nt(this._def)})}catch(e){const n=typeof e=="function"?e:()=>e;return new Kb({...Nt(this._def),innerType:this,catchValue:n,typeName:bt.ZodCatch})}describe(e){const n=this.constructor;return new n({...this._def,description:e})}pipe(e){return xk.create(this,e)}readonly(){return Yb.create(this)}isOptional(){return this.safeParse(void 0).success}isNullable(){return this.safeParse(null).success}}const FQ=/^c[^\s-]{8,}$/i,zQ=/^[0-9a-z]+$/,VQ=/^[0-9A-HJKMNP-TV-Z]{26}$/i,HQ=/^[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,UQ=/^[a-z0-9_-]{21}$/i,BQ=/^[A-Za-z0-9-_]+\.[A-Za-z0-9-_]+\.[A-Za-z0-9-_]*$/,ZQ=/^[-+]?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)?)??$/,WQ=/^(?!\.)(?!.*\.\.)([A-Z0-9_'+\-\.]*)[A-Z0-9_+-]@([A-Z0-9][A-Z0-9\-]*\.)+[A-Z]{2,}$/i,qQ="^[\\p{Extended_Pictographic}\\p{Emoji_Component}]+$";let Z2;const GQ=/^(?:(?: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])$/,KQ=/^(?:(?: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])$/,YQ=/^(([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]))$/,XQ=/^(([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])$/,QQ=/^([0-9a-zA-Z+/]{4})*(([0-9a-zA-Z+/]{2}==)|([0-9a-zA-Z+/]{3}=))?$/,JQ=/^([0-9a-zA-Z-_]{4})*(([0-9a-zA-Z-_]{2}(==)?)|([0-9a-zA-Z-_]{3}(=)?))?$/,xN="((\\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])))",eJ=new RegExp(`^${xN}$`);function SN(t){let e="[0-5]\\d";t.precision?e=`${e}\\.\\d{${t.precision}}`:t.precision==null&&(e=`${e}(\\.\\d+)?`);const n=t.precision?"+":"?";return`([01]\\d|2[0-3]):[0-5]\\d(:${e})${n}`}function tJ(t){return new RegExp(`^${SN(t)}$`)}function nJ(t){let e=`${xN}T${SN(t)}`;const n=[];return n.push(t.local?"Z?":"Z"),t.offset&&n.push("([+-]\\d{2}:?\\d{2})"),e=`${e}(${n.join("|")})`,new RegExp(`^${e}$`)}function rJ(t,e){return!!((e==="v4"||!e)&&GQ.test(t)||(e==="v6"||!e)&&YQ.test(t))}function sJ(t,e){if(!BQ.test(t))return!1;try{const[n]=t.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||e&&s.alg!==e)}catch{return!1}}function iJ(t,e){return!!((e==="v4"||!e)&&KQ.test(t)||(e==="v6"||!e)&&XQ.test(t))}class Kl extends Xt{_parse(e){if(this._def.coerce&&(e.data=String(e.data)),this._getType(e)!==Xe.string){const i=this._getOrReturnCtx(e);return $e(i,{code:Re.invalid_type,expected:Xe.string,received:i.parsedType}),wt}const r=new Ci;let s;for(const i of this._def.checks)if(i.kind==="min")e.data.length<i.value&&(s=this._getOrReturnCtx(e,s),$e(s,{code:Re.too_small,minimum:i.value,type:"string",inclusive:!0,exact:!1,message:i.message}),r.dirty());else if(i.kind==="max")e.data.length>i.value&&(s=this._getOrReturnCtx(e,s),$e(s,{code:Re.too_big,maximum:i.value,type:"string",inclusive:!0,exact:!1,message:i.message}),r.dirty());else if(i.kind==="length"){const o=e.data.length>i.value,l=e.data.length<i.value;(o||l)&&(s=this._getOrReturnCtx(e,s),o?$e(s,{code:Re.too_big,maximum:i.value,type:"string",inclusive:!0,exact:!0,message:i.message}):l&&$e(s,{code:Re.too_small,minimum:i.value,type:"string",inclusive:!0,exact:!0,message:i.message}),r.dirty())}else if(i.kind==="email")WQ.test(e.data)||(s=this._getOrReturnCtx(e,s),$e(s,{validation:"email",code:Re.invalid_string,message:i.message}),r.dirty());else if(i.kind==="emoji")Z2||(Z2=new RegExp(qQ,"u")),Z2.test(e.data)||(s=this._getOrReturnCtx(e,s),$e(s,{validation:"emoji",code:Re.invalid_string,message:i.message}),r.dirty());else if(i.kind==="uuid")HQ.test(e.data)||(s=this._getOrReturnCtx(e,s),$e(s,{validation:"uuid",code:Re.invalid_string,message:i.message}),r.dirty());else if(i.kind==="nanoid")UQ.test(e.data)||(s=this._getOrReturnCtx(e,s),$e(s,{validation:"nanoid",code:Re.invalid_string,message:i.message}),r.dirty());else if(i.kind==="cuid")FQ.test(e.data)||(s=this._getOrReturnCtx(e,s),$e(s,{validation:"cuid",code:Re.invalid_string,message:i.message}),r.dirty());else if(i.kind==="cuid2")zQ.test(e.data)||(s=this._getOrReturnCtx(e,s),$e(s,{validation:"cuid2",code:Re.invalid_string,message:i.message}),r.dirty());else if(i.kind==="ulid")VQ.test(e.data)||(s=this._getOrReturnCtx(e,s),$e(s,{validation:"ulid",code:Re.invalid_string,message:i.message}),r.dirty());else if(i.kind==="url")try{new URL(e.data)}catch{s=this._getOrReturnCtx(e,s),$e(s,{validation:"url",code:Re.invalid_string,message:i.message}),r.dirty()}else i.kind==="regex"?(i.regex.lastIndex=0,i.regex.test(e.data)||(s=this._getOrReturnCtx(e,s),$e(s,{validation:"regex",code:Re.invalid_string,message:i.message}),r.dirty())):i.kind==="trim"?e.data=e.data.trim():i.kind==="includes"?e.data.includes(i.value,i.position)||(s=this._getOrReturnCtx(e,s),$e(s,{code:Re.invalid_string,validation:{includes:i.value,position:i.position},message:i.message}),r.dirty()):i.kind==="toLowerCase"?e.data=e.data.toLowerCase():i.kind==="toUpperCase"?e.data=e.data.toUpperCase():i.kind==="startsWith"?e.data.startsWith(i.value)||(s=this._getOrReturnCtx(e,s),$e(s,{code:Re.invalid_string,validation:{startsWith:i.value},message:i.message}),r.dirty()):i.kind==="endsWith"?e.data.endsWith(i.value)||(s=this._getOrReturnCtx(e,s),$e(s,{code:Re.invalid_string,validation:{endsWith:i.value},message:i.message}),r.dirty()):i.kind==="datetime"?nJ(i).test(e.data)||(s=this._getOrReturnCtx(e,s),$e(s,{code:Re.invalid_string,validation:"datetime",message:i.message}),r.dirty()):i.kind==="date"?eJ.test(e.data)||(s=this._getOrReturnCtx(e,s),$e(s,{code:Re.invalid_string,validation:"date",message:i.message}),r.dirty()):i.kind==="time"?tJ(i).test(e.data)||(s=this._getOrReturnCtx(e,s),$e(s,{code:Re.invalid_string,validation:"time",message:i.message}),r.dirty()):i.kind==="duration"?ZQ.test(e.data)||(s=this._getOrReturnCtx(e,s),$e(s,{validation:"duration",code:Re.invalid_string,message:i.message}),r.dirty()):i.kind==="ip"?rJ(e.data,i.version)||(s=this._getOrReturnCtx(e,s),$e(s,{validation:"ip",code:Re.invalid_string,message:i.message}),r.dirty()):i.kind==="jwt"?sJ(e.data,i.alg)||(s=this._getOrReturnCtx(e,s),$e(s,{validation:"jwt",code:Re.invalid_string,message:i.message}),r.dirty()):i.kind==="cidr"?iJ(e.data,i.version)||(s=this._getOrReturnCtx(e,s),$e(s,{validation:"cidr",code:Re.invalid_string,message:i.message}),r.dirty()):i.kind==="base64"?QQ.test(e.data)||(s=this._getOrReturnCtx(e,s),$e(s,{validation:"base64",code:Re.invalid_string,message:i.message}),r.dirty()):i.kind==="base64url"?JQ.test(e.data)||(s=this._getOrReturnCtx(e,s),$e(s,{validation:"base64url",code:Re.invalid_string,message:i.message}),r.dirty()):tn.assertNever(i);return{status:r.value,value:e.data}}_regex(e,n,r){return this.refinement(s=>e.test(s),{validation:n,code:Re.invalid_string,...et.errToObj(r)})}_addCheck(e){return new Kl({...this._def,checks:[...this._def.checks,e]})}email(e){return this._addCheck({kind:"email",...et.errToObj(e)})}url(e){return this._addCheck({kind:"url",...et.errToObj(e)})}emoji(e){return this._addCheck({kind:"emoji",...et.errToObj(e)})}uuid(e){return this._addCheck({kind:"uuid",...et.errToObj(e)})}nanoid(e){return this._addCheck({kind:"nanoid",...et.errToObj(e)})}cuid(e){return this._addCheck({kind:"cuid",...et.errToObj(e)})}cuid2(e){return this._addCheck({kind:"cuid2",...et.errToObj(e)})}ulid(e){return this._addCheck({kind:"ulid",...et.errToObj(e)})}base64(e){return this._addCheck({kind:"base64",...et.errToObj(e)})}base64url(e){return this._addCheck({kind:"base64url",...et.errToObj(e)})}jwt(e){return this._addCheck({kind:"jwt",...et.errToObj(e)})}ip(e){return this._addCheck({kind:"ip",...et.errToObj(e)})}cidr(e){return this._addCheck({kind:"cidr",...et.errToObj(e)})}datetime(e){return typeof e=="string"?this._addCheck({kind:"datetime",precision:null,offset:!1,local:!1,message:e}):this._addCheck({kind:"datetime",precision:typeof(e==null?void 0:e.precision)>"u"?null:e==null?void 0:e.precision,offset:(e==null?void 0:e.offset)??!1,local:(e==null?void 0:e.local)??!1,...et.errToObj(e==null?void 0:e.message)})}date(e){return this._addCheck({kind:"date",message:e})}time(e){return typeof e=="string"?this._addCheck({kind:"time",precision:null,message:e}):this._addCheck({kind:"time",precision:typeof(e==null?void 0:e.precision)>"u"?null:e==null?void 0:e.precision,...et.errToObj(e==null?void 0:e.message)})}duration(e){return this._addCheck({kind:"duration",...et.errToObj(e)})}regex(e,n){return this._addCheck({kind:"regex",regex:e,...et.errToObj(n)})}includes(e,n){return this._addCheck({kind:"includes",value:e,position:n==null?void 0:n.position,...et.errToObj(n==null?void 0:n.message)})}startsWith(e,n){return this._addCheck({kind:"startsWith",value:e,...et.errToObj(n)})}endsWith(e,n){return this._addCheck({kind:"endsWith",value:e,...et.errToObj(n)})}min(e,n){return this._addCheck({kind:"min",value:e,...et.errToObj(n)})}max(e,n){return this._addCheck({kind:"max",value:e,...et.errToObj(n)})}length(e,n){return this._addCheck({kind:"length",value:e,...et.errToObj(n)})}nonempty(e){return this.min(1,et.errToObj(e))}trim(){return new Kl({...this._def,checks:[...this._def.checks,{kind:"trim"}]})}toLowerCase(){return new Kl({...this._def,checks:[...this._def.checks,{kind:"toLowerCase"}]})}toUpperCase(){return new Kl({...this._def,checks:[...this._def.checks,{kind:"toUpperCase"}]})}get isDatetime(){return!!this._def.checks.find(e=>e.kind==="datetime")}get isDate(){return!!this._def.checks.find(e=>e.kind==="date")}get isTime(){return!!this._def.checks.find(e=>e.kind==="time")}get isDuration(){return!!this._def.checks.find(e=>e.kind==="duration")}get isEmail(){return!!this._def.checks.find(e=>e.kind==="email")}get isURL(){return!!this._def.checks.find(e=>e.kind==="url")}get isEmoji(){return!!this._def.checks.find(e=>e.kind==="emoji")}get isUUID(){return!!this._def.checks.find(e=>e.kind==="uuid")}get isNANOID(){return!!this._def.checks.find(e=>e.kind==="nanoid")}get isCUID(){return!!this._def.checks.find(e=>e.kind==="cuid")}get isCUID2(){return!!this._def.checks.find(e=>e.kind==="cuid2")}get isULID(){return!!this._def.checks.find(e=>e.kind==="ulid")}get isIP(){return!!this._def.checks.find(e=>e.kind==="ip")}get isCIDR(){return!!this._def.checks.find(e=>e.kind==="cidr")}get isBase64(){return!!this._def.checks.find(e=>e.kind==="base64")}get isBase64url(){return!!this._def.checks.find(e=>e.kind==="base64url")}get minLength(){let e=null;for(const n of this._def.checks)n.kind==="min"&&(e===null||n.value>e)&&(e=n.value);return e}get maxLength(){let e=null;for(const n of this._def.checks)n.kind==="max"&&(e===null||n.value<e)&&(e=n.value);return e}}Kl.create=t=>new Kl({checks:[],typeName:bt.ZodString,coerce:(t==null?void 0:t.coerce)??!1,...Nt(t)});function oJ(t,e){const n=(t.toString().split(".")[1]||"").length,r=(e.toString().split(".")[1]||"").length,s=n>r?n:r,i=Number.parseInt(t.toFixed(s).replace(".","")),o=Number.parseInt(e.toFixed(s).replace(".",""));return i%o/10**s}class Wp extends Xt{constructor(){super(...arguments),this.min=this.gte,this.max=this.lte,this.step=this.multipleOf}_parse(e){if(this._def.coerce&&(e.data=Number(e.data)),this._getType(e)!==Xe.number){const i=this._getOrReturnCtx(e);return $e(i,{code:Re.invalid_type,expected:Xe.number,received:i.parsedType}),wt}let r;const s=new Ci;for(const i of this._def.checks)i.kind==="int"?tn.isInteger(e.data)||(r=this._getOrReturnCtx(e,r),$e(r,{code:Re.invalid_type,expected:"integer",received:"float",message:i.message}),s.dirty()):i.kind==="min"?(i.inclusive?e.data<i.value:e.data<=i.value)&&(r=this._getOrReturnCtx(e,r),$e(r,{code:Re.too_small,minimum:i.value,type:"number",inclusive:i.inclusive,exact:!1,message:i.message}),s.dirty()):i.kind==="max"?(i.inclusive?e.data>i.value:e.data>=i.value)&&(r=this._getOrReturnCtx(e,r),$e(r,{code:Re.too_big,maximum:i.value,type:"number",inclusive:i.inclusive,exact:!1,message:i.message}),s.dirty()):i.kind==="multipleOf"?oJ(e.data,i.value)!==0&&(r=this._getOrReturnCtx(e,r),$e(r,{code:Re.not_multiple_of,multipleOf:i.value,message:i.message}),s.dirty()):i.kind==="finite"?Number.isFinite(e.data)||(r=this._getOrReturnCtx(e,r),$e(r,{code:Re.not_finite,message:i.message}),s.dirty()):tn.assertNever(i);return{status:s.value,value:e.data}}gte(e,n){return this.setLimit("min",e,!0,et.toString(n))}gt(e,n){return this.setLimit("min",e,!1,et.toString(n))}lte(e,n){return this.setLimit("max",e,!0,et.toString(n))}lt(e,n){return this.setLimit("max",e,!1,et.toString(n))}setLimit(e,n,r,s){return new Wp({...this._def,checks:[...this._def.checks,{kind:e,value:n,inclusive:r,message:et.toString(s)}]})}_addCheck(e){return new Wp({...this._def,checks:[...this._def.checks,e]})}int(e){return this._addCheck({kind:"int",message:et.toString(e)})}positive(e){return this._addCheck({kind:"min",value:0,inclusive:!1,message:et.toString(e)})}negative(e){return this._addCheck({kind:"max",value:0,inclusive:!1,message:et.toString(e)})}nonpositive(e){return this._addCheck({kind:"max",value:0,inclusive:!0,message:et.toString(e)})}nonnegative(e){return this._addCheck({kind:"min",value:0,inclusive:!0,message:et.toString(e)})}multipleOf(e,n){return this._addCheck({kind:"multipleOf",value:e,message:et.toString(n)})}finite(e){return this._addCheck({kind:"finite",message:et.toString(e)})}safe(e){return this._addCheck({kind:"min",inclusive:!0,value:Number.MIN_SAFE_INTEGER,message:et.toString(e)})._addCheck({kind:"max",inclusive:!0,value:Number.MAX_SAFE_INTEGER,message:et.toString(e)})}get minValue(){let e=null;for(const n of this._def.checks)n.kind==="min"&&(e===null||n.value>e)&&(e=n.value);return e}get maxValue(){let e=null;for(const n of this._def.checks)n.kind==="max"&&(e===null||n.value<e)&&(e=n.value);return e}get isInt(){return!!this._def.checks.find(e=>e.kind==="int"||e.kind==="multipleOf"&&tn.isInteger(e.value))}get isFinite(){let e=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"&&(e===null||r.value<e)&&(e=r.value)}return Number.isFinite(n)&&Number.isFinite(e)}}Wp.create=t=>new Wp({checks:[],typeName:bt.ZodNumber,coerce:(t==null?void 0:t.coerce)||!1,...Nt(t)});class qp extends Xt{constructor(){super(...arguments),this.min=this.gte,this.max=this.lte}_parse(e){if(this._def.coerce)try{e.data=BigInt(e.data)}catch{return this._getInvalidInput(e)}if(this._getType(e)!==Xe.bigint)return this._getInvalidInput(e);let r;const s=new Ci;for(const i of this._def.checks)i.kind==="min"?(i.inclusive?e.data<i.value:e.data<=i.value)&&(r=this._getOrReturnCtx(e,r),$e(r,{code:Re.too_small,type:"bigint",minimum:i.value,inclusive:i.inclusive,message:i.message}),s.dirty()):i.kind==="max"?(i.inclusive?e.data>i.value:e.data>=i.value)&&(r=this._getOrReturnCtx(e,r),$e(r,{code:Re.too_big,type:"bigint",maximum:i.value,inclusive:i.inclusive,message:i.message}),s.dirty()):i.kind==="multipleOf"?e.data%i.value!==BigInt(0)&&(r=this._getOrReturnCtx(e,r),$e(r,{code:Re.not_multiple_of,multipleOf:i.value,message:i.message}),s.dirty()):tn.assertNever(i);return{status:s.value,value:e.data}}_getInvalidInput(e){const n=this._getOrReturnCtx(e);return $e(n,{code:Re.invalid_type,expected:Xe.bigint,received:n.parsedType}),wt}gte(e,n){return this.setLimit("min",e,!0,et.toString(n))}gt(e,n){return this.setLimit("min",e,!1,et.toString(n))}lte(e,n){return this.setLimit("max",e,!0,et.toString(n))}lt(e,n){return this.setLimit("max",e,!1,et.toString(n))}setLimit(e,n,r,s){return new qp({...this._def,checks:[...this._def.checks,{kind:e,value:n,inclusive:r,message:et.toString(s)}]})}_addCheck(e){return new qp({...this._def,checks:[...this._def.checks,e]})}positive(e){return this._addCheck({kind:"min",value:BigInt(0),inclusive:!1,message:et.toString(e)})}negative(e){return this._addCheck({kind:"max",value:BigInt(0),inclusive:!1,message:et.toString(e)})}nonpositive(e){return this._addCheck({kind:"max",value:BigInt(0),inclusive:!0,message:et.toString(e)})}nonnegative(e){return this._addCheck({kind:"min",value:BigInt(0),inclusive:!0,message:et.toString(e)})}multipleOf(e,n){return this._addCheck({kind:"multipleOf",value:e,message:et.toString(n)})}get minValue(){let e=null;for(const n of this._def.checks)n.kind==="min"&&(e===null||n.value>e)&&(e=n.value);return e}get maxValue(){let e=null;for(const n of this._def.checks)n.kind==="max"&&(e===null||n.value<e)&&(e=n.value);return e}}qp.create=t=>new qp({checks:[],typeName:bt.ZodBigInt,coerce:(t==null?void 0:t.coerce)??!1,...Nt(t)});class LA extends Xt{_parse(e){if(this._def.coerce&&(e.data=!!e.data),this._getType(e)!==Xe.boolean){const r=this._getOrReturnCtx(e);return $e(r,{code:Re.invalid_type,expected:Xe.boolean,received:r.parsedType}),wt}return ro(e.data)}}LA.create=t=>new LA({typeName:bt.ZodBoolean,coerce:(t==null?void 0:t.coerce)||!1,...Nt(t)});class zv extends Xt{_parse(e){if(this._def.coerce&&(e.data=new Date(e.data)),this._getType(e)!==Xe.date){const i=this._getOrReturnCtx(e);return $e(i,{code:Re.invalid_type,expected:Xe.date,received:i.parsedType}),wt}if(Number.isNaN(e.data.getTime())){const i=this._getOrReturnCtx(e);return $e(i,{code:Re.invalid_date}),wt}const r=new Ci;let s;for(const i of this._def.checks)i.kind==="min"?e.data.getTime()<i.value&&(s=this._getOrReturnCtx(e,s),$e(s,{code:Re.too_small,message:i.message,inclusive:!0,exact:!1,minimum:i.value,type:"date"}),r.dirty()):i.kind==="max"?e.data.getTime()>i.value&&(s=this._getOrReturnCtx(e,s),$e(s,{code:Re.too_big,message:i.message,inclusive:!0,exact:!1,maximum:i.value,type:"date"}),r.dirty()):tn.assertNever(i);return{status:r.value,value:new Date(e.data.getTime())}}_addCheck(e){return new zv({...this._def,checks:[...this._def.checks,e]})}min(e,n){return this._addCheck({kind:"min",value:e.getTime(),message:et.toString(n)})}max(e,n){return this._addCheck({kind:"max",value:e.getTime(),message:et.toString(n)})}get minDate(){let e=null;for(const n of this._def.checks)n.kind==="min"&&(e===null||n.value>e)&&(e=n.value);return e!=null?new Date(e):null}get maxDate(){let e=null;for(const n of this._def.checks)n.kind==="max"&&(e===null||n.value<e)&&(e=n.value);return e!=null?new Date(e):null}}zv.create=t=>new zv({checks:[],coerce:(t==null?void 0:t.coerce)||!1,typeName:bt.ZodDate,...Nt(t)});class DA extends Xt{_parse(e){if(this._getType(e)!==Xe.symbol){const r=this._getOrReturnCtx(e);return $e(r,{code:Re.invalid_type,expected:Xe.symbol,received:r.parsedType}),wt}return ro(e.data)}}DA.create=t=>new DA({typeName:bt.ZodSymbol,...Nt(t)});class $A extends Xt{_parse(e){if(this._getType(e)!==Xe.undefined){const r=this._getOrReturnCtx(e);return $e(r,{code:Re.invalid_type,expected:Xe.undefined,received:r.parsedType}),wt}return ro(e.data)}}$A.create=t=>new $A({typeName:bt.ZodUndefined,...Nt(t)});class jA extends Xt{_parse(e){if(this._getType(e)!==Xe.null){const r=this._getOrReturnCtx(e);return $e(r,{code:Re.invalid_type,expected:Xe.null,received:r.parsedType}),wt}return ro(e.data)}}jA.create=t=>new jA({typeName:bt.ZodNull,...Nt(t)});class FA extends Xt{constructor(){super(...arguments),this._any=!0}_parse(e){return ro(e.data)}}FA.create=t=>new FA({typeName:bt.ZodAny,...Nt(t)});class zA extends Xt{constructor(){super(...arguments),this._unknown=!0}_parse(e){return ro(e.data)}}zA.create=t=>new zA({typeName:bt.ZodUnknown,...Nt(t)});class dc extends Xt{_parse(e){const n=this._getOrReturnCtx(e);return $e(n,{code:Re.invalid_type,expected:Xe.never,received:n.parsedType}),wt}}dc.create=t=>new dc({typeName:bt.ZodNever,...Nt(t)});class VA extends Xt{_parse(e){if(this._getType(e)!==Xe.undefined){const r=this._getOrReturnCtx(e);return $e(r,{code:Re.invalid_type,expected:Xe.void,received:r.parsedType}),wt}return ro(e.data)}}VA.create=t=>new VA({typeName:bt.ZodVoid,...Nt(t)});class na extends Xt{_parse(e){const{ctx:n,status:r}=this._processInputParams(e),s=this._def;if(n.parsedType!==Xe.array)return $e(n,{code:Re.invalid_type,expected:Xe.array,received:n.parsedType}),wt;if(s.exactLength!==null){const o=n.data.length>s.exactLength.value,l=n.data.length<s.exactLength.value;(o||l)&&($e(n,{code:o?Re.too_big:Re.too_small,minimum:l?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&&($e(n,{code:Re.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&&($e(n,{code:Re.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,l)=>s.type._parseAsync(new uc(n,o,n.path,l)))).then(o=>Ci.mergeArray(r,o));const i=[...n.data].map((o,l)=>s.type._parseSync(new uc(n,o,n.path,l)));return Ci.mergeArray(r,i)}get element(){return this._def.type}min(e,n){return new na({...this._def,minLength:{value:e,message:et.toString(n)}})}max(e,n){return new na({...this._def,maxLength:{value:e,message:et.toString(n)}})}length(e,n){return new na({...this._def,exactLength:{value:e,message:et.toString(n)}})}nonempty(e){return this.min(1,e)}}na.create=(t,e)=>new na({type:t,minLength:null,maxLength:null,exactLength:null,typeName:bt.ZodArray,...Nt(e)});function Nd(t){if(t instanceof gr){const e={};for(const n in t.shape){const r=t.shape[n];e[n]=nc.create(Nd(r))}return new gr({...t._def,shape:()=>e})}else return t instanceof na?new na({...t._def,type:Nd(t.element)}):t instanceof nc?nc.create(Nd(t.unwrap())):t instanceof Nf?Nf.create(Nd(t.unwrap())):t instanceof Du?Du.create(t.items.map(e=>Nd(e))):t}class gr extends Xt{constructor(){super(...arguments),this._cached=null,this.nonstrict=this.passthrough,this.augment=this.extend}_getCached(){if(this._cached!==null)return this._cached;const e=this._def.shape(),n=tn.objectKeys(e);return this._cached={shape:e,keys:n},this._cached}_parse(e){if(this._getType(e)!==Xe.object){const d=this._getOrReturnCtx(e);return $e(d,{code:Re.invalid_type,expected:Xe.object,received:d.parsedType}),wt}const{status:r,ctx:s}=this._processInputParams(e),{shape:i,keys:o}=this._getCached(),l=[];if(!(this._def.catchall instanceof dc&&this._def.unknownKeys==="strip"))for(const d in s.data)o.includes(d)||l.push(d);const c=[];for(const d of o){const f=i[d],h=s.data[d];c.push({key:{status:"valid",value:d},value:f._parse(new uc(s,h,s.path,d)),alwaysSet:d in s.data})}if(this._def.catchall instanceof dc){const d=this._def.unknownKeys;if(d==="passthrough")for(const f of l)c.push({key:{status:"valid",value:f},value:{status:"valid",value:s.data[f]}});else if(d==="strict")l.length>0&&($e(s,{code:Re.unrecognized_keys,keys:l}),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 l){const h=s.data[f];c.push({key:{status:"valid",value:f},value:d._parse(new uc(s,h,s.path,f)),alwaysSet:f in s.data})}}return s.common.async?Promise.resolve().then(async()=>{const d=[];for(const f of c){const h=await f.key,m=await f.value;d.push({key:h,value:m,alwaysSet:f.alwaysSet})}return d}).then(d=>Ci.mergeObjectSync(r,d)):Ci.mergeObjectSync(r,c)}get shape(){return this._def.shape()}strict(e){return et.errToObj,new gr({...this._def,unknownKeys:"strict",...e!==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:et.errToObj(e).message??s}:{message:s}}}:{}})}strip(){return new gr({...this._def,unknownKeys:"strip"})}passthrough(){return new gr({...this._def,unknownKeys:"passthrough"})}extend(e){return new gr({...this._def,shape:()=>({...this._def.shape(),...e})})}merge(e){return new gr({unknownKeys:e._def.unknownKeys,catchall:e._def.catchall,shape:()=>({...this._def.shape(),...e._def.shape()}),typeName:bt.ZodObject})}setKey(e,n){return this.augment({[e]:n})}catchall(e){return new gr({...this._def,catchall:e})}pick(e){const n={};for(const r of tn.objectKeys(e))e[r]&&this.shape[r]&&(n[r]=this.shape[r]);return new gr({...this._def,shape:()=>n})}omit(e){const n={};for(const r of tn.objectKeys(this.shape))e[r]||(n[r]=this.shape[r]);return new gr({...this._def,shape:()=>n})}deepPartial(){return Nd(this)}partial(e){const n={};for(const r of tn.objectKeys(this.shape)){const s=this.shape[r];e&&!e[r]?n[r]=s:n[r]=s.optional()}return new gr({...this._def,shape:()=>n})}required(e){const n={};for(const r of tn.objectKeys(this.shape))if(e&&!e[r])n[r]=this.shape[r];else{let i=this.shape[r];for(;i instanceof nc;)i=i._def.innerType;n[r]=i}return new gr({...this._def,shape:()=>n})}keyof(){return kN(tn.objectKeys(this.shape))}}gr.create=(t,e)=>new gr({shape:()=>t,unknownKeys:"strip",catchall:dc.create(),typeName:bt.ZodObject,...Nt(e)});gr.strictCreate=(t,e)=>new gr({shape:()=>t,unknownKeys:"strict",catchall:dc.create(),typeName:bt.ZodObject,...Nt(e)});gr.lazycreate=(t,e)=>new gr({shape:t,unknownKeys:"strip",catchall:dc.create(),typeName:bt.ZodObject,...Nt(e)});class Vv extends Xt{_parse(e){const{ctx:n}=this._processInputParams(e),r=this._def.options;function s(i){for(const l of i)if(l.result.status==="valid")return l.result;for(const l of i)if(l.result.status==="dirty")return n.common.issues.push(...l.ctx.common.issues),l.result;const o=i.map(l=>new Qa(l.ctx.common.issues));return $e(n,{code:Re.invalid_union,unionErrors:o}),wt}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 c of r){const d={...n,common:{...n.common,issues:[]},parent:null},f=c._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 l=o.map(c=>new Qa(c));return $e(n,{code:Re.invalid_union,unionErrors:l}),wt}}get options(){return this._def.options}}Vv.create=(t,e)=>new Vv({options:t,typeName:bt.ZodUnion,...Nt(e)});function qb(t,e){const n=Ll(t),r=Ll(e);if(t===e)return{valid:!0,data:t};if(n===Xe.object&&r===Xe.object){const s=tn.objectKeys(e),i=tn.objectKeys(t).filter(l=>s.indexOf(l)!==-1),o={...t,...e};Object.prototype.hasOwnProperty.call(o,"__proto__")&&delete o.__proto__;for(const l of i){if(l==="__proto__")continue;const c=qb(t[l],e[l]);if(!c.valid)return{valid:!1};o[l]=c.data}return{valid:!0,data:o}}else if(n===Xe.array&&r===Xe.array){if(t.length!==e.length)return{valid:!1};const s=[];for(let i=0;i<t.length;i++){const o=t[i],l=e[i],c=qb(o,l);if(!c.valid)return{valid:!1};s.push(c.data)}return{valid:!0,data:s}}else return n===Xe.date&&r===Xe.date&&+t==+e?{valid:!0,data:t}:{valid:!1}}class Hv extends Xt{_parse(e){const{status:n,ctx:r}=this._processInputParams(e),s=(i,o)=>{if(OA(i)||OA(o))return wt;const l=qb(i.value,o.value);return l.valid?((MA(i)||MA(o))&&n.dirty(),{status:n.value,value:l.data}):($e(r,{code:Re.invalid_intersection_types}),wt)};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}))}}Hv.create=(t,e,n)=>new Hv({left:t,right:e,typeName:bt.ZodIntersection,...Nt(n)});class Du extends Xt{_parse(e){const{status:n,ctx:r}=this._processInputParams(e);if(r.parsedType!==Xe.array)return $e(r,{code:Re.invalid_type,expected:Xe.array,received:r.parsedType}),wt;if(r.data.length<this._def.items.length)return $e(r,{code:Re.too_small,minimum:this._def.items.length,inclusive:!0,exact:!1,type:"array"}),wt;!this._def.rest&&r.data.length>this._def.items.length&&($e(r,{code:Re.too_big,maximum:this._def.items.length,inclusive:!0,exact:!1,type:"array"}),n.dirty());const i=[...r.data].map((o,l)=>{const c=this._def.items[l]||this._def.rest;return c?c._parse(new uc(r,o,r.path,l)):null}).filter(o=>!!o);return r.common.async?Promise.all(i).then(o=>Ci.mergeArray(n,o)):Ci.mergeArray(n,i)}get items(){return this._def.items}rest(e){return new Du({...this._def,rest:e})}}Du.create=(t,e)=>{if(!Array.isArray(t))throw new Error("You must pass an array of schemas to z.tuple([ ... ])");return new Du({items:t,typeName:bt.ZodTuple,rest:null,...Nt(e)})};class HA extends Xt{get keySchema(){return this._def.keyType}get valueSchema(){return this._def.valueType}_parse(e){const{status:n,ctx:r}=this._processInputParams(e);if(r.parsedType!==Xe.map)return $e(r,{code:Re.invalid_type,expected:Xe.map,received:r.parsedType}),wt;const s=this._def.keyType,i=this._def.valueType,o=[...r.data.entries()].map(([l,c],d)=>({key:s._parse(new uc(r,l,r.path,[d,"key"])),value:i._parse(new uc(r,c,r.path,[d,"value"]))}));if(r.common.async){const l=new Map;return Promise.resolve().then(async()=>{for(const c of o){const d=await c.key,f=await c.value;if(d.status==="aborted"||f.status==="aborted")return wt;(d.status==="dirty"||f.status==="dirty")&&n.dirty(),l.set(d.value,f.value)}return{status:n.value,value:l}})}else{const l=new Map;for(const c of o){const d=c.key,f=c.value;if(d.status==="aborted"||f.status==="aborted")return wt;(d.status==="dirty"||f.status==="dirty")&&n.dirty(),l.set(d.value,f.value)}return{status:n.value,value:l}}}}HA.create=(t,e,n)=>new HA({valueType:e,keyType:t,typeName:bt.ZodMap,...Nt(n)});class Gp extends Xt{_parse(e){const{status:n,ctx:r}=this._processInputParams(e);if(r.parsedType!==Xe.set)return $e(r,{code:Re.invalid_type,expected:Xe.set,received:r.parsedType}),wt;const s=this._def;s.minSize!==null&&r.data.size<s.minSize.value&&($e(r,{code:Re.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&&($e(r,{code:Re.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(c){const d=new Set;for(const f of c){if(f.status==="aborted")return wt;f.status==="dirty"&&n.dirty(),d.add(f.value)}return{status:n.value,value:d}}const l=[...r.data.values()].map((c,d)=>i._parse(new uc(r,c,r.path,d)));return r.common.async?Promise.all(l).then(c=>o(c)):o(l)}min(e,n){return new Gp({...this._def,minSize:{value:e,message:et.toString(n)}})}max(e,n){return new Gp({...this._def,maxSize:{value:e,message:et.toString(n)}})}size(e,n){return this.min(e,n).max(e,n)}nonempty(e){return this.min(1,e)}}Gp.create=(t,e)=>new Gp({valueType:t,minSize:null,maxSize:null,typeName:bt.ZodSet,...Nt(e)});class UA extends Xt{get schema(){return this._def.getter()}_parse(e){const{ctx:n}=this._processInputParams(e);return this._def.getter()._parse({data:n.data,path:n.path,parent:n})}}UA.create=(t,e)=>new UA({getter:t,typeName:bt.ZodLazy,...Nt(e)});class BA extends Xt{_parse(e){if(e.data!==this._def.value){const n=this._getOrReturnCtx(e);return $e(n,{received:n.data,code:Re.invalid_literal,expected:this._def.value}),wt}return{status:"valid",value:e.data}}get value(){return this._def.value}}BA.create=(t,e)=>new BA({value:t,typeName:bt.ZodLiteral,...Nt(e)});function kN(t,e){return new Of({values:t,typeName:bt.ZodEnum,...Nt(e)})}class Of extends Xt{_parse(e){if(typeof e.data!="string"){const n=this._getOrReturnCtx(e),r=this._def.values;return $e(n,{expected:tn.joinValues(r),received:n.parsedType,code:Re.invalid_type}),wt}if(this._cache||(this._cache=new Set(this._def.values)),!this._cache.has(e.data)){const n=this._getOrReturnCtx(e),r=this._def.values;return $e(n,{received:n.data,code:Re.invalid_enum_value,options:r}),wt}return ro(e.data)}get options(){return this._def.values}get enum(){const e={};for(const n of this._def.values)e[n]=n;return e}get Values(){const e={};for(const n of this._def.values)e[n]=n;return e}get Enum(){const e={};for(const n of this._def.values)e[n]=n;return e}extract(e,n=this._def){return Of.create(e,{...this._def,...n})}exclude(e,n=this._def){return Of.create(this.options.filter(r=>!e.includes(r)),{...this._def,...n})}}Of.create=kN;class ZA extends Xt{_parse(e){const n=tn.getValidEnumValues(this._def.values),r=this._getOrReturnCtx(e);if(r.parsedType!==Xe.string&&r.parsedType!==Xe.number){const s=tn.objectValues(n);return $e(r,{expected:tn.joinValues(s),received:r.parsedType,code:Re.invalid_type}),wt}if(this._cache||(this._cache=new Set(tn.getValidEnumValues(this._def.values))),!this._cache.has(e.data)){const s=tn.objectValues(n);return $e(r,{received:r.data,code:Re.invalid_enum_value,options:s}),wt}return ro(e.data)}get enum(){return this._def.values}}ZA.create=(t,e)=>new ZA({values:t,typeName:bt.ZodNativeEnum,...Nt(e)});class Uv extends Xt{unwrap(){return this._def.type}_parse(e){const{ctx:n}=this._processInputParams(e);if(n.parsedType!==Xe.promise&&n.common.async===!1)return $e(n,{code:Re.invalid_type,expected:Xe.promise,received:n.parsedType}),wt;const r=n.parsedType===Xe.promise?n.data:Promise.resolve(n.data);return ro(r.then(s=>this._def.type.parseAsync(s,{path:n.path,errorMap:n.common.contextualErrorMap})))}}Uv.create=(t,e)=>new Uv({type:t,typeName:bt.ZodPromise,...Nt(e)});class Mf extends Xt{innerType(){return this._def.schema}sourceType(){return this._def.schema._def.typeName===bt.ZodEffects?this._def.schema.sourceType():this._def.schema}_parse(e){const{status:n,ctx:r}=this._processInputParams(e),s=this._def.effect||null,i={addIssue:o=>{$e(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 l=>{if(n.value==="aborted")return wt;const c=await this._def.schema._parseAsync({data:l,path:r.path,parent:r});return c.status==="aborted"?wt:c.status==="dirty"||n.value==="dirty"?op(c.value):c});{if(n.value==="aborted")return wt;const l=this._def.schema._parseSync({data:o,path:r.path,parent:r});return l.status==="aborted"?wt:l.status==="dirty"||n.value==="dirty"?op(l.value):l}}if(s.type==="refinement"){const o=l=>{const c=s.refinement(l,i);if(r.common.async)return Promise.resolve(c);if(c instanceof Promise)throw new Error("Async refinement encountered during synchronous parse operation. Use .parseAsync instead.");return l};if(r.common.async===!1){const l=this._def.schema._parseSync({data:r.data,path:r.path,parent:r});return l.status==="aborted"?wt:(l.status==="dirty"&&n.dirty(),o(l.value),{status:n.value,value:l.value})}else return this._def.schema._parseAsync({data:r.data,path:r.path,parent:r}).then(l=>l.status==="aborted"?wt:(l.status==="dirty"&&n.dirty(),o(l.value).then(()=>({status:n.value,value:l.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(!If(o))return wt;const l=s.transform(o.value,i);if(l instanceof Promise)throw new Error("Asynchronous transform encountered during synchronous parse operation. Use .parseAsync instead.");return{status:n.value,value:l}}else return this._def.schema._parseAsync({data:r.data,path:r.path,parent:r}).then(o=>If(o)?Promise.resolve(s.transform(o.value,i)).then(l=>({status:n.value,value:l})):wt);tn.assertNever(s)}}Mf.create=(t,e,n)=>new Mf({schema:t,typeName:bt.ZodEffects,effect:e,...Nt(n)});Mf.createWithPreprocess=(t,e,n)=>new Mf({schema:e,effect:{type:"preprocess",transform:t},typeName:bt.ZodEffects,...Nt(n)});class nc extends Xt{_parse(e){return this._getType(e)===Xe.undefined?ro(void 0):this._def.innerType._parse(e)}unwrap(){return this._def.innerType}}nc.create=(t,e)=>new nc({innerType:t,typeName:bt.ZodOptional,...Nt(e)});class Nf extends Xt{_parse(e){return this._getType(e)===Xe.null?ro(null):this._def.innerType._parse(e)}unwrap(){return this._def.innerType}}Nf.create=(t,e)=>new Nf({innerType:t,typeName:bt.ZodNullable,...Nt(e)});class Gb extends Xt{_parse(e){const{ctx:n}=this._processInputParams(e);let r=n.data;return n.parsedType===Xe.undefined&&(r=this._def.defaultValue()),this._def.innerType._parse({data:r,path:n.path,parent:n})}removeDefault(){return this._def.innerType}}Gb.create=(t,e)=>new Gb({innerType:t,typeName:bt.ZodDefault,defaultValue:typeof e.default=="function"?e.default:()=>e.default,...Nt(e)});class Kb extends Xt{_parse(e){const{ctx:n}=this._processInputParams(e),r={...n,common:{...n.common,issues:[]}},s=this._def.innerType._parse({data:r.data,path:r.path,parent:{...r}});return Fv(s)?s.then(i=>({status:"valid",value:i.status==="valid"?i.value:this._def.catchValue({get error(){return new Qa(r.common.issues)},input:r.data})})):{status:"valid",value:s.status==="valid"?s.value:this._def.catchValue({get error(){return new Qa(r.common.issues)},input:r.data})}}removeCatch(){return this._def.innerType}}Kb.create=(t,e)=>new Kb({innerType:t,typeName:bt.ZodCatch,catchValue:typeof e.catch=="function"?e.catch:()=>e.catch,...Nt(e)});class WA extends Xt{_parse(e){if(this._getType(e)!==Xe.nan){const r=this._getOrReturnCtx(e);return $e(r,{code:Re.invalid_type,expected:Xe.nan,received:r.parsedType}),wt}return{status:"valid",value:e.data}}}WA.create=t=>new WA({typeName:bt.ZodNaN,...Nt(t)});class aJ extends Xt{_parse(e){const{ctx:n}=this._processInputParams(e),r=n.data;return this._def.type._parse({data:r,path:n.path,parent:n})}unwrap(){return this._def.type}}class xk extends Xt{_parse(e){const{status:n,ctx:r}=this._processInputParams(e);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"?wt:i.status==="dirty"?(n.dirty(),op(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"?wt:s.status==="dirty"?(n.dirty(),{status:"dirty",value:s.value}):this._def.out._parseSync({data:s.value,path:r.path,parent:r})}}static create(e,n){return new xk({in:e,out:n,typeName:bt.ZodPipeline})}}class Yb extends Xt{_parse(e){const n=this._def.innerType._parse(e),r=s=>(If(s)&&(s.value=Object.freeze(s.value)),s);return Fv(n)?n.then(s=>r(s)):r(n)}unwrap(){return this._def.innerType}}Yb.create=(t,e)=>new Yb({innerType:t,typeName:bt.ZodReadonly,...Nt(e)});var bt;(function(t){t.ZodString="ZodString",t.ZodNumber="ZodNumber",t.ZodNaN="ZodNaN",t.ZodBigInt="ZodBigInt",t.ZodBoolean="ZodBoolean",t.ZodDate="ZodDate",t.ZodSymbol="ZodSymbol",t.ZodUndefined="ZodUndefined",t.ZodNull="ZodNull",t.ZodAny="ZodAny",t.ZodUnknown="ZodUnknown",t.ZodNever="ZodNever",t.ZodVoid="ZodVoid",t.ZodArray="ZodArray",t.ZodObject="ZodObject",t.ZodUnion="ZodUnion",t.ZodDiscriminatedUnion="ZodDiscriminatedUnion",t.ZodIntersection="ZodIntersection",t.ZodTuple="ZodTuple",t.ZodRecord="ZodRecord",t.ZodMap="ZodMap",t.ZodSet="ZodSet",t.ZodFunction="ZodFunction",t.ZodLazy="ZodLazy",t.ZodLiteral="ZodLiteral",t.ZodEnum="ZodEnum",t.ZodEffects="ZodEffects",t.ZodNativeEnum="ZodNativeEnum",t.ZodOptional="ZodOptional",t.ZodNullable="ZodNullable",t.ZodDefault="ZodDefault",t.ZodCatch="ZodCatch",t.ZodPromise="ZodPromise",t.ZodBranded="ZodBranded",t.ZodPipeline="ZodPipeline",t.ZodReadonly="ZodReadonly"})(bt||(bt={}));const Ud=Kl.create;dc.create;const lJ=na.create,EN=gr.create;Vv.create;Hv.create;Du.create;const cJ=Of.create;Uv.create;nc.create;Nf.create;const uJ=EN({hash:Ud().regex(/^[a-f0-9]{64}$/),mimeType:cJ(["image/png","image/jpeg","image/webp","image/gif","image/avif"])}),CN=EN({id:Ud().min(1),title:Ud().trim().min(1),url:Ud().url().refine(t=>{try{const e=new URL(t);return["http:","https:"].includes(e.protocol)&&!e.username&&!e.password}catch{return!1}}).optional(),reason:Ud().optional(),image:uJ.optional().catch(void 0)}).refine(t=>!!(t.url||t.image),{message:"A reference requires a public URL or an image"}),dJ=(...t)=>{const e=[],n=new Set,r=new Set;for(const s of t.flatMap(i=>i??[])){const i=CN.safeParse(s);if(!i.success)continue;const o=i.data,l=o.url?new URL(o.url).href:void 0;if(n.has(o.id)||l&&r.has(l)){const c=e.find(d=>d.url===l&&(l!==void 0||d.id===o.id));c&&!c.image&&o.image&&(c.id===o.id||!n.has(o.id))&&(c.id=o.id,c.image=o.image,n.add(o.id));continue}e.push({...o,...l?{url:l}:{}}),n.add(o.id),l&&r.add(l)}return e.length?e:void 0},fJ=6,Kp=100,qA=100,hJ=35*1024*1024,GA=Math.ceil(hJ/3)*4,pJ=Vt(["pinterest","arena","x","cosmos"]),Sk=Vt(["image",...pJ.options,"text","pdf","variant"]),Tm=Vt(["codex","claude","cursor"]),PN=Fe({projectId:se().min(1).max(200),sessionId:se().min(1).max(200),variantId:se().min(1).max(200)}).strict();PN.extend({runtime:Tm,note:se().trim().max(500).optional(),imageFile:se().min(1).max(2048).optional()});const AN=PN.extend({treeSha:se().max(100).optional()}),mJ=Fe({hash:se().regex(/^[a-f0-9]{64}$/),mimeType:Vt(["image/png","image/jpeg","image/webp","image/gif"]),bytes:Ln().int().positive(),representation:Vt(["image","video-cover","page","variant"]).default("image"),page:Ln().int().positive().optional()});Fe({provider:Sk,remoteId:se().trim().min(1).max(2048),title:se().trim().min(1).max(500),url:se().url().optional()});const TN=Fe({provider:Sk,remoteId:se().trim().min(1).max(2048),title:se().max(1e3),text:se().max(1e5),url:se().url().optional(),media:At(mJ).max(100),remoteImages:At(se().url()).max(100).optional(),remoteImageRepresentations:At(Vt(["image","video-cover"])).max(100).optional(),unsupportedReason:se().max(1e3).optional(),variant:AN.optional(),note:se().max(500).optional()}),RN=Fe({inputTokens:Ln().nonnegative().optional(),outputTokens:Ln().nonnegative().optional(),cachedInputTokens:Ln().nonnegative().optional(),allocation:Rf("equal-share").optional()}),A1e=Fe({referenceId:se().min(1),revision:Ln().int().positive(),description:se().trim().min(1).max(8e3),runtime:Am([Tm,Rf("user")]),evidence:Vt(["observation","preference"]),usage:RN.optional()}),T1e=TN.extend({id:se(),revision:Ln()}),gJ=Fe({requestId:se().min(1).max(200),instruction:se().min(1).max(3e4),runtime:Tm,mode:Vt(["auto","off","uploads"]).default("off"),excludedSourceIds:At(se()).max(100).default([]),excludedReferenceIds:At(se()).max(100).default([]),excludedMediaHashes:At(se()).max(100).default([]),suppliedInputHashes:At(se().regex(/^[a-f0-9]{64}$/)).max(Kp).optional()});gJ.extend({mode:Vt(["auto","off","uploads"]).default("uploads"),uploads:At(se().max(GA+qA)).max(Kp).optional()}).refine(t=>(t.uploads??[]).reduce((e,n)=>e+n.length,0)<=GA+Kp*qA,"Supplied images exceed the profile upload budget");const vJ=Bb().transform((t,e)=>{const n=CN.safeParse(t);return n.success?n.data:(e.addIssue({code:_N.custom,message:"Invalid supplied image reference"}),OM)}),KA=Fe({suppliedReferences:At(vJ).max(Kp).optional(),failedUploadCount:Ln().int().min(0).max(Kp).optional(),usage:RN.optional(),requestId:se(),status:Vt(["selected","empty","off","unavailable","timeout"]),queries:At(se()),candidateIds:At(se()),selected:At(Fe({id:se(),revision:Ln(),title:se().optional(),url:se().url().optional(),mediaHashes:At(se().regex(/^[a-f0-9]{64}$/)).optional(),reason:se(),sourceTitles:At(se()),variant:AN.optional()})),contextText:se().max(6e3),images:At(Fe({path:se(),hash:se().regex(/^[a-f0-9]{64}$/),mimeType:Vt(["image/png","image/jpeg","image/webp","image/gif"])})).max(fJ),durationMs:Ln()});KA.pick({requestId:!0,suppliedReferences:!0,failedUploadCount:!0,status:!0,selected:!0,images:!0,durationMs:!0}).extend({requestId:se().min(1).max(200),selected:KA.shape.selected.max(3)});const R1e=200,kk=Fe({id:se(),name:se(),pinnedAt:se().nullable().optional(),lastOpenedAt:se(),projectPath:se(),isAvailable:Ys(),storageKind:Vt(["project","bundle"]),issue:se().optional(),historyIssue:se().optional()}),yJ=Fe({dataUrl:se(),label:se(),capturedAt:se()}),_J=Fe({projectId:se(),sessionId:se(),variantId:se(),label:se(),brief:se(),createdAt:se(),hasStaticPreview:Ys(),hasInteractivePreview:Ys()}),I1e=Fe({projects:At(kk),variants:At(_J)}),IN=Fe({error:se()}),wJ=Fe({errorCode:se(),message:se()}),bJ=Fe({error:se().optional(),details:Am([se(),Fe({formErrors:At(se()).optional(),fieldErrors:bk(se(),At(se()).optional()).optional()})]).optional()}),xJ=Fe({token:se().min(1)}),SJ=Fe({url:se().url()}),O1e=Fe({projects:At(kk)}),M1e=Fe({project:kk}),N1e=Fe({projectId:se()}),L1e=Fe({preview:yJ.nullable()}),D1e=Fe({projectPath:se().nullable()}),$1e=Fe({editorUrl:se()}),j1e=Fe({url:se()}),F1e=Fe({saved:Rf(!0)}),kJ=Fe({requestId:se(),sequence:Ln(),projectId:se().optional(),sessionId:se().optional(),variantId:se().optional()}),z1e=Fe({navigations:At(kJ)}),V1e=Fe({acknowledged:Ys()}),ON=Fe({profile:Fe({isEnabled:Ys()}),sources:At(Fe({provider:Sk,title:se(),url:se().nullable()}))}),MN=Fe({id:se(),revision:se(),collectionCount:Ln(),referenceCount:Ln(),imageCount:Ln(),reusableCount:Ln(),unsupportedCount:Ln(),scopeDisclosure:se(),usageDisclosure:se()}),EJ=Fe({isAuthenticated:Ys(),email:se().optional(),name:se().optional(),userId:se().optional()}),W2=se().min(1).max(500),NN=Fe({pinned:At(W2).max(1e3),order:Fe({groups:At(W2).max(1e3),rows:bk(se(),At(W2).max(1e3))})}),CJ=Fe({projectPath:se(),uiState:NN});Fe({uiState:NN,projectPath:se().optional()});const PJ=t=>xJ.parse(t).token,YA="The library returned an invalid response.",D1="rivet_library_token";let Ja="",Lf=0,ko=null,XA=!1;const Xb=new Set,Yp=()=>Xb.forEach(t=>t()),H1e=()=>ko,U1e=()=>Lf,Xp=()=>{try{const t=window.localStorage.getItem(D1)??"";Ja!==t&&(Lf+=1),Ja=t,ko=null}catch{ko="Rivet cannot access browser storage. Allow site storage and try again."}},LN=()=>{XA||(window.addEventListener("storage",t=>{t.key!==D1&&t.key!==null||(Xp(),Yp())}),XA=!0)},B1e=()=>!!Ja,Z1e=t=>(LN(),Xb.add(t),()=>Xb.delete(t)),AJ=(t,e)=>{if(e!==void 0&&Xp(),e!==void 0&&e!==Lf)throw new Error("Sign-in was cancelled because the browser login changed.");try{window.localStorage.setItem(D1,t)}catch{throw ko="Rivet cannot save browser access. Allow site storage and try again.",Yp(),new Error(ko)}Ja=t,Lf+=1,ko=null,Yp()},DN=()=>{Ja="",Lf+=1,ko=null;try{window.localStorage.removeItem(D1)}catch{ko="Rivet cannot clear browser storage. Allow site storage and try again."}Yp()},TJ=async()=>{if(!window.location.pathname.startsWith("/rivet/library"))return;LN(),Xp();const t=Lf,e=new URLSearchParams(window.location.hash.slice(1)).get("code");if(e){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:e})});if(n.ok){AJ(PJ(await n.json()),t);return}n.status>=500&&!Ja&&(ko="Rivet is temporarily unavailable. Please retry this link.")}catch{!Ja&&!ko&&(ko="Rivet could not open this link. Please retry when the server is available.")}}Yp()},$N=async(t,e={})=>{Xp();const n=Ja,r=new Headers(e.headers);r.set("Authorization",`Bearer ${n}`);const s=await fetch(t,{...e,headers:r});return s.status===401&&(Xp(),Ja===n&&DN()),s},RJ=async(t,{schema:e,...n})=>{const r=await $N(`/api/library${t}`,{method:n.method??"GET",signal:n.signal,headers:{"Content-Type":"application/json"},...n.body!==void 0?{body:JSON.stringify(n.body)}:{}});return IJ(r,e)},IJ=async(t,e)=>{const n=await t.text();let r;try{r=JSON.parse(n)}catch{if(t.ok)throw new Error(YA)}if(!t.ok){if(t.status===401)throw new Error("Sign in to access this library.");const i=IN.safeParse(r),o=i.success&&i.data.error.trim()?i.data.error:`Library request failed (${t.status}).`;throw new Error(o)}const s=e.safeParse(r);if(!s.success)throw new Error(YA);return s.data},Ft=(t,e={})=>{if(!window.location.pathname.startsWith("/rivet/library")){const n=new Headers(e.headers),r=yH();return r&&gH(t,e.method)&&n.set(hH,r),fetch(t,{...e,headers:n,redirect:"error"})}return $N(t,e)};let jN="off";const QA=t=>{jN=t},OJ=()=>jN==="full",FN=({userId:t,email:e})=>{OJ()&&(t?(Qe.identify(t,e?{email:e}:{}),e&&Qe.alias(e,t)):e&&Qe.identify(e,{email:e}))},MJ="phc_Ntj9tXHbS64XgYxlTfhglRmFivFsfm0AERph4ZlnNH",NJ=3e3,LJ=/^plugin-[0-9a-f]{8}-[0-9a-f]{4}-4[0-9a-f]{3}-[89ab][0-9a-f]{3}-[0-9a-f]{12}$/,DJ=t=>({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:t,isIdentifiedID:!1},before_send:e=>{const n=LQ(e.event,e.properties);return n&&Ft("/api/telemetry/events",{method:"POST",credentials:"same-origin",headers:{"Content-Type":"application/json"},body:JSON.stringify({event:e.event,properties:n}),keepalive:!0}).catch(()=>{}),null}}),$J=async()=>{try{const t=await Ft("/api/telemetry",{signal:AbortSignal.timeout(NJ),cache:"no-store"});if(!t.ok)return;const e=await t.json();if(e.mode!=="full"&&e.mode!=="metrics"||e.mode==="metrics"&&(typeof e.distinctId!="string"||!LJ.test(e.distinctId)))return;const n=e.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.27.0",env:"production"})};n==="metrics"&&Object.assign(s,DJ(e.distinctId),{api_host:window.location.origin}),Qe.init(MJ,s),QA(n)}catch{QA("off")}},zN=g.createContext(void 0),Rm=t=>{const e=g.useContext(zN);if(!e)throw new Error("No QueryClient set, use QueryClientProvider to set one");return e},jJ=({client:t,children:e})=>(g.useEffect(()=>(t.mount(),()=>{t.unmount()}),[t]),S.jsx(zN.Provider,{value:t,children:e})),FJ={setTimeout:(t,e)=>setTimeout(t,e),clearTimeout:t=>clearTimeout(t),setInterval:(t,e)=>setInterval(t,e),clearInterval:t=>clearInterval(t)};var $l,DS,D4,zJ=(D4=class{constructor(){st(this,$l,FJ);st(this,DS,!1)}setTimeoutProvider(t){Me(this,$l,t)}setTimeout(t,e){return W(this,$l).setTimeout(t,e)}clearTimeout(t){W(this,$l).clearTimeout(t)}setInterval(t,e){return W(this,$l).setInterval(t,e)}clearInterval(t){W(this,$l).clearInterval(t)}},$l=new WeakMap,DS=new WeakMap,D4);const au=new zJ;function VJ(t){setTimeout(t,0)}const HJ=typeof window>"u"||"Deno"in globalThis;function Ms(){}function UJ(t,e){return typeof t=="function"?t(e):t}function VN(t){return typeof t=="number"&&t>=0&&t!==1/0}function HN(t,e){return Math.max(t+(e||0)-Date.now(),0)}function Fn(t,e){return typeof t=="function"?t(e):t}function JA(t,e){const{type:n="all",exact:r,fetchStatus:s,predicate:i,queryKey:o,stale:l}=t;if(o){if(r){if(e.queryHash!==Ek(o,e.options))return!1}else if(!Df(e.queryKey,o))return!1}if(n!=="all"){const c=e.isActive();if(n==="active"&&!c||n==="inactive"&&c)return!1}return!(typeof l=="boolean"&&e.isStale()!==l||s&&s!==e.state.fetchStatus||i&&!i(e))}function eT(t,e){const{exact:n,status:r,predicate:s,mutationKey:i}=t;if(i){if(!e.options.mutationKey)return!1;if(n){if($u(e.options.mutationKey)!==$u(i))return!1}else if(!Df(e.options.mutationKey,i))return!1}return!(r&&e.state.status!==r||s&&!s(e))}function Ek(t,e){return((e==null?void 0:e.queryKeyHashFn)||$u)(t)}function $u(t){return JSON.stringify(t,(e,n)=>Qb(n)?Object.keys(n).sort().reduce((r,s)=>(r[s]=n[s],r),{}):n)}function Df(t,e){if(t===e)return!0;if(typeof t!=typeof e)return!1;if(t&&e&&typeof t=="object"&&typeof e=="object"){if(Array.isArray(t)&&Array.isArray(e)){if(e.length>t.length)return!1;for(let r=0;r<e.length;r++)if(!Df(t[r],e[r]))return!1;return!0}const n=Object.keys(e);for(const r of n)if(!Df(t[r],e[r]))return!1;return!0}return!1}const UN=Object.prototype.hasOwnProperty;function BN(t,e,n=0){if(t===e)return t;if(n>500)return e;const r=tT(t)&&tT(e);if(!r&&!(Qb(t)&&Qb(e)))return e;const s=(r?t:Object.keys(t)).length,i=r?e:Object.keys(e),o=i.length,l=r?new Array(o):{};let c=0;for(let d=0;d<o;d++){const f=r?d:i[d],h=t[f],m=e[f];if(h===m){l[f]=h,(r?d<s:UN.call(t,f))&&c++;continue}if(h===null||m===null||typeof h!="object"||typeof m!="object"){l[f]=m;continue}const v=BN(h,m,n+1);l[f]=v,v===h&&c++}return s===o&&c===s?t:l}function Vg(t,e){if(!e||Object.keys(t).length!==Object.keys(e).length)return!1;for(const n of Object.keys(t))if(!UN.call(e,n)||t[n]!==e[n])return!1;return!0}function tT(t){return Array.isArray(t)&&t.length===Object.keys(t).length}function Qb(t){if(!nT(t))return!1;const e=Object.getPrototypeOf(t),n=e==null?void 0:e.constructor;if(n===void 0)return!0;if(typeof n!="function")return!1;const r=n.prototype;return!(!nT(r)||!r.hasOwnProperty("isPrototypeOf")||e!==Object.prototype)}function nT(t){return Object.prototype.toString.call(t)==="[object Object]"}function BJ(t){return new Promise(e=>{au.setTimeout(e,t)})}function Jb(t,e,n){return typeof n.structuralSharing=="function"?n.structuralSharing(t,e):n.structuralSharing!==!1?BN(t,e):e}function ZJ(t){return t}function WJ(t,e,n=0){const r=[...t,e];return n&&r.length>n?r.slice(-n):r}function qJ(t,e,n=0){const r=[e,...t];return n&&r.length>n?r.slice(0,n):r}const Ck=Symbol();function ZN(t,e){return!t.queryFn&&(e!=null&&e.initialPromise)?()=>e.initialPromise:!t.queryFn||t.queryFn===Ck?()=>Promise.reject(new Error(`Missing queryFn: '${t.queryHash}'`)):t.queryFn}function Pk(t,e){return typeof t=="function"?t(...e):!!t}const Ak=Symbol();function GJ(t,e,n,r){let s=!1,i;return Object.defineProperties(t,{[Ak]:{value:r},signal:{enumerable:!0,get:()=>(i??(i=e()),s||(s=!0,i.aborted?n():i.addEventListener("abort",n,{once:!0})),i)}}),t}let KJ=()=>HJ;const Tk=()=>KJ();var Yf=class{constructor(){this.listeners=new Set,this.subscribe=this.subscribe.bind(this)}subscribe(t){return this.listeners.add(t),this.onSubscribe(),()=>{this.listeners.delete(t),this.onUnsubscribe()}}hasListeners(){return this.listeners.size>0}onSubscribe(){}onUnsubscribe(){}},du,jl,of,$4,YJ=($4=class extends Yf{constructor(){super();st(this,du);st(this,jl);st(this,of);Me(this,of,e=>{if(typeof window<"u"&&window.addEventListener){const n=()=>e();return window.addEventListener("visibilitychange",n,!1),()=>{window.removeEventListener("visibilitychange",n)}}})}onSubscribe(){W(this,jl)||this.setEventListener(W(this,of))}onUnsubscribe(){var e;this.hasListeners()||((e=W(this,jl))==null||e.call(this),Me(this,jl,void 0))}setEventListener(e){var n;Me(this,of,e),(n=W(this,jl))==null||n.call(this),Me(this,jl,e(r=>{typeof r=="boolean"?this.setFocused(r):this.onFocus()}))}setFocused(e){W(this,du)!==e&&(Me(this,du,e),this.onFocus())}onFocus(){const e=this.isFocused();this.listeners.forEach(n=>{n(e)})}isFocused(){var e;return typeof W(this,du)=="boolean"?W(this,du):((e=globalThis.document)==null?void 0:e.visibilityState)!=="hidden"}},du=new WeakMap,jl=new WeakMap,of=new WeakMap,$4);const Rk=new YJ,XJ=VJ;function QJ(){let t=[],e=0,n=l=>{l()},r=l=>{l()},s=XJ;const i=l=>{e?t.push(l):s(()=>{n(l)})},o=()=>{const l=t;t=[],l.length&&s(()=>{r(()=>{l.forEach(c=>{n(c)})})})};return{batch:l=>{let c;e++;try{c=l()}finally{e--,e||o()}return c},batchCalls:l=>(...c)=>{i(()=>{l(...c)})},schedule:i,setNotifyFunction:l=>{n=l},setBatchNotifyFunction:l=>{r=l},setScheduler:l=>{s=l}}}const Tr=QJ();var af,Fl,lf,j4,JJ=(j4=class extends Yf{constructor(){super();st(this,af,!0);st(this,Fl);st(this,lf);Me(this,lf,e=>{if(typeof window<"u"&&window.addEventListener){const n=()=>e(!0),r=()=>e(!1);return window.addEventListener("online",n,!1),window.addEventListener("offline",r,!1),()=>{window.removeEventListener("online",n),window.removeEventListener("offline",r)}}})}onSubscribe(){W(this,Fl)||this.setEventListener(W(this,lf))}onUnsubscribe(){var e;this.hasListeners()||((e=W(this,Fl))==null||e.call(this),Me(this,Fl,void 0))}setEventListener(e){var n;Me(this,lf,e),(n=W(this,Fl))==null||n.call(this),Me(this,Fl,e(this.setOnline.bind(this)))}setOnline(e){W(this,af)!==e&&(Me(this,af,e),this.listeners.forEach(n=>{n(e)}))}isOnline(){return W(this,af)}},af=new WeakMap,Fl=new WeakMap,lf=new WeakMap,j4);const Bv=new JJ;function eee(t){return Math.min(1e3*2**t,3e4)}function WN(t){return(t??"online")==="online"?Bv.isOnline():!0}var ex=class extends Error{constructor(t){super("CancelledError"),this.revert=t==null?void 0:t.revert,this.silent=t==null?void 0:t.silent}};function qN(t){let e=!1,n=0,r,s="pending",i,o;const l=new Promise((k,P)=>{i=k,o=P});l.catch(Ms);const c=()=>s!=="pending",d=k=>{var P;if(!c()){const C=new ex(k);y(C),(P=t.onCancel)==null||P.call(t,C)}},f=()=>{e=!0},h=()=>{e=!1},m=()=>Rk.isFocused()&&(t.networkMode==="always"||Bv.isOnline())&&t.canRun(),v=()=>WN(t.networkMode)&&t.canRun(),_=k=>{c()||(r==null||r(),s="resolved",i(k))},y=k=>{c()||(r==null||r(),s="rejected",o(k))},w=k=>new Promise(P=>{var C;r=T=>{(c()||k())&&P(T)},(C=t.onPause)==null||C.call(t)}).then(()=>{var P;r=void 0,c()||(P=t.onContinue)==null||P.call(t)}),x=()=>{if(c())return;let k;const P=n===0?t.initialPromise:void 0;try{k=P??t.fn()}catch(C){k=Promise.reject(C)}Promise.resolve(k).then(_).catch(C=>{var N;if(c())return;const T=t.retry??(Tk()?0:3),O=t.retryDelay??eee,I=typeof O=="function"?O(n,C):O,R=T===!0||typeof T=="number"&&n<T||typeof T=="function"&&T(n,C);if(e||!R){y(C);return}n++,(N=t.onFail)==null||N.call(t,n,C),BJ(I).then(()=>c()||m()?void 0:w(m)).then(()=>{e?y(C):x()})})};return{promise:l,status:()=>s,cancel:d,continue:()=>(r==null||r(),l),cancelRetry:f,continueRetry:h,canStart:v,start:()=>(v()?x():w(v).then(x),l)}}var fu,F4,GN=(F4=class{constructor(){st(this,fu)}destroy(){this.clearGcTimeout()}scheduleGc(){this.clearGcTimeout(),VN(this.gcTime)&&Me(this,fu,au.setTimeout(()=>{this.optionalRemove()},this.gcTime))}updateGcTime(t){this.gcTime=Math.max(this.gcTime||0,t??(Tk()?1/0:3e5))}clearGcTimeout(){W(this,fu)!==void 0&&(au.clearTimeout(W(this,fu)),Me(this,fu,void 0))}},fu=new WeakMap,F4);function tee(t){return{onFetch:(e,n)=>{var f,h,m,v,_;const r=e.options,s=(m=(h=(f=e.fetchOptions)==null?void 0:f.meta)==null?void 0:h.fetchMore)==null?void 0:m.direction,i=((v=e.state.data)==null?void 0:v.pages)||[],o=((_=e.state.data)==null?void 0:_.pageParams)||[];let l={pages:[],pageParams:[]},c=0;const d=async()=>{let y=!1;const w=e,x=C=>{GJ(C,()=>e.signal,()=>y=!0,w[Ak])},k=ZN(e.options,e.fetchOptions),P=async(C,T,O)=>{if(y)return Promise.reject(e.signal.reason);if(T==null&&C.pages.length)return Promise.resolve(C);const R=(()=>{const $={client:e.client,queryKey:e.queryKey,pageParam:T,direction:O?"backward":"forward",meta:e.options.meta};return x($),$})(),N=await k(R),{maxPages:L}=e.options,z=O?qJ:WJ;return{pages:z(C.pages,N,L),pageParams:z(C.pageParams,T,L)}};if(s&&i.length){const C=s==="backward",T=C?nee:rT,O={pages:i,pageParams:o};l=await P(O,T(r,O),C)}else{const C=t??i.length;do{const T=c===0?o[0]===void 0?r.initialPageParam:o[0]:rT(r,l);if(c>0&&T==null)break;l=await P(l,T),c++}while(c<C)}return l};e.options.persister?e.fetchFn=()=>{var y,w;return(w=(y=e.options).persister)==null?void 0:w.call(y,d,{client:e.client,queryKey:e.queryKey,meta:e.options.meta,signal:e.signal},n)}:e.fetchFn=d}}}function rT(t,{pages:e,pageParams:n}){const r=e.length-1;return e.length>0?t.getNextPageParam(e[r],e,n[r],n):void 0}function nee(t,{pages:e,pageParams:n}){var r;return e.length>0?(r=t.getPreviousPageParam)==null?void 0:r.call(t,e[0],e,n[0],n):void 0}var cf,hu,uf,Gi,pu,zr,Fa,bm,mu,_o,Na,z4,ree=(z4=class extends GN{constructor(e){super();st(this,_o);st(this,cf);st(this,hu);st(this,uf);st(this,Gi);st(this,pu);st(this,zr);st(this,Fa);st(this,bm);st(this,mu);Me(this,mu,!1),Me(this,bm,e.defaultOptions),this.setOptions(e.options),this.observers=[],Me(this,pu,e.client),Me(this,Gi,W(this,pu).getQueryCache()),this.queryKey=e.queryKey,this.queryHash=e.queryHash,Me(this,hu,iT(this.options)),this.state=e.state??W(this,hu),this.scheduleGc()}get meta(){return this.options.meta}get queryType(){return W(this,cf)}get promise(){var e;return(e=W(this,zr))==null?void 0:e.promise}setOptions(e){if(this.options={...W(this,bm),...e},e!=null&&e._type&&Me(this,cf,e._type),this.updateGcTime(this.options.gcTime),this.state&&this.state.data===void 0){const n=iT(this.options);n.data!==void 0&&(this.setState(sT(n.data,n.dataUpdatedAt)),Me(this,hu,n))}}optionalRemove(){!this.observers.length&&this.state.fetchStatus==="idle"&&W(this,Gi).remove(this)}setData(e,n){const r=Jb(this.state.data,e,this.options);return Pt(this,_o,Na).call(this,{data:r,type:"success",dataUpdatedAt:n==null?void 0:n.updatedAt,manual:n==null?void 0:n.manual}),r}setState(e){Pt(this,_o,Na).call(this,{type:"setState",state:e})}cancel(e){var r,s;const n=(r=W(this,zr))==null?void 0:r.promise;return(s=W(this,zr))==null||s.cancel(e),n?n.then(Ms).catch(Ms):Promise.resolve()}destroy(){super.destroy(),this.cancel({silent:!0})}get resetState(){return W(this,hu)}reset(){this.destroy(),this.setState(this.resetState)}isActive(){return this.observers.some(e=>Fn(e.options.enabled,this)!==!1)}isDisabled(){return this.getObserversCount()>0?!this.isActive():this.options.queryFn===Ck||!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(e=>Fn(e.options.staleTime,this)==="static"):!1}isStale(){return this.getObserversCount()>0?this.observers.some(e=>e.getCurrentResult().isStale):this.state.data===void 0||this.state.isInvalidated}isStaleByTime(e=0){return this.state.data===void 0?!0:e==="static"?!1:this.state.isInvalidated?!0:!HN(this.state.dataUpdatedAt,e)}onFocus(){var e,n;(e=this.observers.find(r=>r.shouldFetchOnWindowFocus()))==null||e.refetch({cancelRefetch:!1}),(n=W(this,zr))==null||n.continue()}onOnline(){var e,n;(e=this.observers.find(r=>r.shouldFetchOnReconnect()))==null||e.refetch({cancelRefetch:!1}),(n=W(this,zr))==null||n.continue()}addObserver(e){this.observers.includes(e)||(this.observers.push(e),this.clearGcTimeout(),W(this,Gi).notify({type:"observerAdded",query:this,observer:e}))}removeObserver(e){const n=this.observers.indexOf(e);n!==-1&&(this.observers.splice(n,1),this.observers.length||(W(this,zr)&&(W(this,mu)||this.state.fetchStatus==="paused"&&this.state.status==="pending"?W(this,zr).cancel({revert:!0}):W(this,zr).cancelRetry()),this.scheduleGc()),W(this,Gi).notify({type:"observerRemoved",query:this,observer:e}))}getObserversCount(){return this.observers.length}invalidate(){this.state.isInvalidated||Pt(this,_o,Na).call(this,{type:"invalidate"})}async fetch(e,n){var f,h,m,v;if(this.state.fetchStatus!=="idle"&&((f=W(this,zr))==null?void 0:f.status())!=="rejected"){if(this.state.data!==void 0&&(n!=null&&n.cancelRefetch))this.cancel({silent:!0});else if(W(this,zr)&&W(this,Fa))return W(this,zr).continueRetry(),W(this,Fa)}if(e&&this.setOptions(e),!this.options.queryFn){const _=this.observers.find(y=>y.options.queryFn);_&&this.setOptions(_.options)}const r=new AbortController,s=_=>{Object.defineProperties(_,{[Ak]:{value:r.signal,enumerable:!0},signal:{enumerable:!0,get:()=>(Me(this,mu,!0),r.signal)}})},i=()=>{const _=ZN(this.options,n),w=(()=>{const x={client:W(this,pu),queryKey:this.queryKey,meta:this.meta};return s(x),x})();return Me(this,mu,!1),this.options.persister?this.options.persister(_,w,this):_(w)},l=(()=>{const _={fetchOptions:n,options:this.options,queryKey:this.queryKey,client:W(this,pu),state:this.state,fetchFn:i};return s(_),_})();(h=W(this,cf)==="infinite"?tee(this.options.pages):this.options.behavior)==null||h.onFetch(l,this),Me(this,uf,this.state),(this.state.fetchStatus==="idle"||this.state.fetchMeta!==((m=l.fetchOptions)==null?void 0:m.meta))&&Pt(this,_o,Na).call(this,{type:"fetch",meta:(v=l.fetchOptions)==null?void 0:v.meta});const c=Me(this,zr,qN({initialPromise:n==null?void 0:n.initialPromise,fn:l.fetchFn,onCancel:_=>{_ instanceof ex&&_.revert&&this.setState({...W(this,uf),fetchStatus:"idle"}),r.abort()},onFail:(_,y)=>{Pt(this,_o,Na).call(this,{type:"failed",failureCount:_,error:y})},onPause:()=>{Pt(this,_o,Na).call(this,{type:"pause"})},onContinue:()=>{Pt(this,_o,Na).call(this,{type:"continue"})},retry:l.options.retry,retryDelay:l.options.retryDelay,networkMode:l.options.networkMode,canRun:()=>!0})),d=(async()=>{var _,y,w,x,k,P,C,T;try{const O=await c.promise;if(O===void 0)throw new Error(`${this.queryHash} data is undefined`);return this.setData(O),(y=(_=W(this,Gi).config).onSuccess)==null||y.call(_,O,this),(x=(w=W(this,Gi).config).onSettled)==null||x.call(w,O,this.state.error,this),O}catch(O){if(O instanceof ex){if(O.silent){if(W(this,zr)!==c&&W(this,Fa))return W(this,Fa);throw O}else if(O.revert){if(this.state.data===void 0)throw O;return this.state.data}}throw Pt(this,_o,Na).call(this,{type:"error",error:O}),(P=(k=W(this,Gi).config).onError)==null||P.call(k,O,this),(T=(C=W(this,Gi).config).onSettled)==null||T.call(C,this.state.data,O,this),O}finally{W(this,zr)===c&&(Me(this,zr,void 0),Me(this,Fa,void 0)),this.scheduleGc()}})();return Me(this,Fa,d),c.start(),d}},cf=new WeakMap,hu=new WeakMap,uf=new WeakMap,Gi=new WeakMap,pu=new WeakMap,zr=new WeakMap,Fa=new WeakMap,bm=new WeakMap,mu=new WeakMap,_o=new WeakSet,Na=function(e){const n=r=>{switch(e.type){case"failed":return{...r,fetchFailureCount:e.failureCount,fetchFailureReason:e.error};case"pause":return{...r,fetchStatus:"paused"};case"continue":return{...r,fetchStatus:"fetching"};case"fetch":return{...r,...KN(r.data,this.options),fetchMeta:e.meta??null};case"success":const s={...r,...sT(e.data,e.dataUpdatedAt),dataUpdateCount:r.dataUpdateCount+1,...!e.manual&&{fetchStatus:"idle",fetchFailureCount:0,fetchFailureReason:null}};return Me(this,uf,e.manual?s:void 0),s;case"error":const i=e.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,...e.state}}};this.state=n(this.state),Tr.batch(()=>{this.observers.slice().forEach(r=>{r.onQueryUpdate()}),W(this,Gi).notify({query:this,type:"updated",action:e})})},z4);function KN(t,e){return{fetchFailureCount:0,fetchFailureReason:null,fetchStatus:WN(e.networkMode)?"fetching":"paused",...t===void 0&&{error:null,status:"pending"}}}function sT(t,e){return{data:t,dataUpdatedAt:e??Date.now(),error:null,isInvalidated:!1,status:"success"}}function iT(t){const e=typeof t.initialData=="function"?t.initialData():t.initialData,n=e!==void 0,r=n?typeof t.initialDataUpdatedAt=="function"?t.initialDataUpdatedAt():t.initialDataUpdatedAt:0;return{data:e,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 Rs,zt,xm,Is,gu,df,za,Sm,ff,hf,vu,yu,zl,pf,sn,ap,tx,nx,rx,sx,ix,ox,ax,lx,V4,see=(V4=class extends Yf{constructor(e,n){super();st(this,sn);st(this,Rs);st(this,zt);st(this,xm);st(this,Is);st(this,gu);st(this,df);st(this,za);st(this,Sm);st(this,ff);st(this,hf);st(this,vu);st(this,yu);st(this,zl);st(this,pf,new Set);this.options=n,Me(this,Rs,e),Me(this,za,null),this.bindMethods(),this.setOptions(n)}bindMethods(){this.refetch=this.refetch.bind(this)}onSubscribe(){this.listeners.size===1&&(W(this,zt).addObserver(this),oT(W(this,zt),this.options)?Pt(this,sn,ap).call(this):this.updateResult(),Pt(this,sn,ix).call(this))}onUnsubscribe(){this.hasListeners()||this.destroy()}shouldFetchOnReconnect(){return cx(W(this,zt),this.options,this.options.refetchOnReconnect)}shouldFetchOnWindowFocus(){return cx(W(this,zt),this.options,this.options.refetchOnWindowFocus)}destroy(){this.listeners=new Set,Pt(this,sn,ox).call(this),Pt(this,sn,ax).call(this),W(this,zt).removeObserver(this)}setOptions(e){const n=this.options,r=W(this,zt);if(this.options=W(this,Rs).defaultQueryOptions(e),this.options.enabled!==void 0&&typeof this.options.enabled!="boolean"&&typeof this.options.enabled!="function"&&typeof Fn(this.options.enabled,W(this,zt))!="boolean")throw new Error("Expected enabled to be a boolean or a callback that returns a boolean");Pt(this,sn,lx).call(this),W(this,zt).setOptions(this.options),n._defaulted&&!Vg(this.options,n)&&W(this,Rs).getQueryCache().notify({type:"observerOptionsUpdated",query:W(this,zt),observer:this});const s=this.hasListeners();s&&aT(W(this,zt),r,this.options,n)&&Pt(this,sn,ap).call(this),this.updateResult(),s&&(W(this,zt)!==r||Fn(this.options.enabled,W(this,zt))!==Fn(n.enabled,W(this,zt))||Fn(this.options.staleTime,W(this,zt))!==Fn(n.staleTime,W(this,zt)))&&Pt(this,sn,nx).call(this);const i=Pt(this,sn,rx).call(this);s&&(W(this,zt)!==r||Fn(this.options.enabled,W(this,zt))!==Fn(n.enabled,W(this,zt))||i!==W(this,zl))&&Pt(this,sn,sx).call(this,i)}getOptimisticResult(e){const n=W(this,Rs).getQueryCache().build(W(this,Rs),e),r=this.createResult(n,e);return Vg(this.getCurrentResult(),r)||(Me(this,Is,r),Me(this,df,this.options),Me(this,gu,W(this,zt).state)),r}getCurrentResult(){return W(this,Is)}trackResult(e,n){return new Proxy(e,{get:(r,s)=>(this.trackProp(s),n==null||n(s),Reflect.get(r,s))})}trackProp(e){W(this,pf).add(e)}getCurrentQuery(){return W(this,zt)}refetch({...e}={}){return this.fetch({...e})}fetchOptimistic(e){const n=W(this,Rs).defaultQueryOptions(e),r=W(this,Rs).getQueryCache().build(W(this,Rs),n);let s=()=>{},i;const o=new Promise(l=>{i=l,s=W(this,Rs).getQueryCache().subscribe(c=>{c.type==="updated"&&c.query.queryHash===r.queryHash&&r.state.data!==void 0&&(s(),l(this.createResult(r,n)))})});return Promise.race([r.fetch(n).then(()=>{const l=this.createResult(r,n);return i==null||i(l),l}).finally(()=>{s()}),o])}fetch(e){return Pt(this,sn,ap).call(this,{...e,cancelRefetch:e.cancelRefetch??!0}).then(()=>(this.updateResult(),W(this,Is)))}createResult(e,n){var O;const r=W(this,zt),s=this.options,i=W(this,Is),o=W(this,gu),l=W(this,df),c=e!==r?e.state:W(this,xm),{state:d}=e;let f={...d},h=!1,m;if(n._optimisticResults){const I=this.hasListeners(),R=!I&&oT(e,n),N=I&&aT(e,r,n,s);(R||N)&&(f={...f,...KN(d.data,e.options)}),n._optimisticResults==="isRestoring"&&(f.fetchStatus="idle")}let{error:v,errorUpdatedAt:_,status:y}=f;m=f.data;let w=!1;if(n.placeholderData!==void 0&&m===void 0&&y==="pending"){let I;i!=null&&i.isPlaceholderData&&n.placeholderData===(l==null?void 0:l.placeholderData)?(I=i.data,w=!0):I=typeof n.placeholderData=="function"?n.placeholderData((O=W(this,hf))==null?void 0:O.state.data,W(this,hf)):n.placeholderData,I!==void 0&&(y="success",m=Jb(i==null?void 0:i.data,I,n),h=!0)}if(n.select&&m!==void 0&&!w)if(i&&m===(o==null?void 0:o.data)&&n.select===W(this,Sm))m=W(this,ff);else try{Me(this,Sm,n.select),m=n.select(m),m=Jb(i==null?void 0:i.data,m,n),Me(this,ff,m),Me(this,za,null)}catch(I){Me(this,za,I)}else m===void 0&&Me(this,za,null);W(this,za)&&(v=W(this,za),m=W(this,ff),_=Date.now(),y="error",h=!1);const x=f.fetchStatus==="fetching",k=y==="pending",P=y==="error",C=k&&x,T=m!==void 0;return{status:y,fetchStatus:f.fetchStatus,isPending:k,isSuccess:y==="success",isError:P,isInitialLoading:C,isLoading:C,data:m,dataUpdatedAt:f.dataUpdatedAt,error:v,errorUpdatedAt:_,failureCount:f.fetchFailureCount,failureReason:f.fetchFailureReason,errorUpdateCount:f.errorUpdateCount,isFetched:e.isFetched(),isFetchedAfterMount:f.dataUpdateCount>c.dataUpdateCount||f.errorUpdateCount>c.errorUpdateCount,isFetching:x,isRefetching:x&&!k,isLoadingError:P&&!T,isPaused:f.fetchStatus==="paused",isPlaceholderData:h,isRefetchError:P&&T,isStale:Ik(e,n),refetch:this.refetch,isEnabled:Fn(n.enabled,e)!==!1}}updateResult(){const e=W(this,Is),n=this.createResult(W(this,zt),this.options);if(Me(this,gu,W(this,zt).state),Me(this,df,this.options),W(this,gu).data!==void 0&&Me(this,hf,W(this,zt)),Vg(n,e))return;Me(this,Is,n);const s=(()=>{if(!e)return!0;const{notifyOnChangeProps:i}=this.options,o=typeof i=="function"?i():i;if(o==="all"||!o&&!W(this,pf).size||this.options.throwOnError&&W(this,Is).error!==e.error)return!0;for(const l of o??W(this,pf))if(W(this,Is)[l]!==e[l])return!0;return!1})();Tr.batch(()=>{s&&this.listeners.forEach(i=>{i(W(this,Is))}),W(this,Rs).getQueryCache().notify({query:W(this,zt),type:"observerResultsUpdated"})})}onQueryUpdate(){this.updateResult(),this.hasListeners()&&Pt(this,sn,ix).call(this)}},Rs=new WeakMap,zt=new WeakMap,xm=new WeakMap,Is=new WeakMap,gu=new WeakMap,df=new WeakMap,za=new WeakMap,Sm=new WeakMap,ff=new WeakMap,hf=new WeakMap,vu=new WeakMap,yu=new WeakMap,zl=new WeakMap,pf=new WeakMap,sn=new WeakSet,ap=function(e){Pt(this,sn,lx).call(this);let n=W(this,zt).fetch(this.options,e);return e!=null&&e.throwOnError||(n=n.catch(Ms)),n},tx=function(e){return!Tk()&&Fn(this.options.enabled,W(this,zt))!==!1&&VN(e)},nx=function(){Pt(this,sn,ox).call(this);const e=Fn(this.options.staleTime,W(this,zt));if(W(this,Is).isStale||!Pt(this,sn,tx).call(this,e))return;const n=HN(W(this,Is).dataUpdatedAt,e)+1;Me(this,vu,au.setTimeout(()=>{W(this,Is).isStale||this.updateResult()},n))},rx=function(){return Fn(this.options.refetchInterval,W(this,zt))??!1},sx=function(e){Pt(this,sn,ax).call(this),Me(this,zl,e),!(W(this,zl)===0||!Pt(this,sn,tx).call(this,W(this,zl)))&&Me(this,yu,au.setInterval(()=>{(this.options.refetchIntervalInBackground||Rk.isFocused())&&Pt(this,sn,ap).call(this)},W(this,zl)))},ix=function(){Pt(this,sn,nx).call(this),Pt(this,sn,sx).call(this,Pt(this,sn,rx).call(this))},ox=function(){W(this,vu)!==void 0&&(au.clearTimeout(W(this,vu)),Me(this,vu,void 0))},ax=function(){W(this,yu)!==void 0&&(au.clearInterval(W(this,yu)),Me(this,yu,void 0))},lx=function(){const e=W(this,Rs).getQueryCache().build(W(this,Rs),this.options);if(e===W(this,zt))return;const n=W(this,zt);Me(this,zt,e),Me(this,xm,e.state),this.hasListeners()&&(n==null||n.removeObserver(this),e.addObserver(this))},V4);function iee(t,e){return Fn(e.enabled,t)!==!1&&t.state.data===void 0&&!(t.state.status==="error"&&Fn(e.retryOnMount,t)===!1)}function oT(t,e){return iee(t,e)||t.state.data!==void 0&&cx(t,e,e.refetchOnMount)}function cx(t,e,n){if(Fn(e.enabled,t)!==!1&&Fn(e.staleTime,t)!=="static"){const r=Fn(n,t);return r==="always"||r!==!1&&Ik(t,e)}return!1}function aT(t,e,n,r){return(t!==e||Fn(r.enabled,t)===!1)&&(!n.suspense||t.state.status!=="error")&&Ik(t,n)}function Ik(t,e){return Fn(e.enabled,t)!==!1&&t.isStaleByTime(Fn(e.staleTime,t))}var km,Zo,gs,_u,Wo,Ml,H4,oee=(H4=class extends GN{constructor(e){super();st(this,Wo);st(this,km);st(this,Zo);st(this,gs);st(this,_u);Me(this,km,e.client),this.mutationId=e.mutationId,Me(this,gs,e.mutationCache),Me(this,Zo,[]),this.state=e.state||YN(),this.setOptions(e.options),this.scheduleGc()}setOptions(e){this.options=e,this.updateGcTime(this.options.gcTime)}get meta(){return this.options.meta}addObserver(e){W(this,Zo).includes(e)||(W(this,Zo).push(e),this.clearGcTimeout(),W(this,gs).notify({type:"observerAdded",mutation:this,observer:e}))}removeObserver(e){Me(this,Zo,W(this,Zo).filter(n=>n!==e)),this.scheduleGc(),W(this,gs).notify({type:"observerRemoved",mutation:this,observer:e})}optionalRemove(){W(this,Zo).length||(this.state.status==="pending"?this.scheduleGc():W(this,gs).remove(this))}continue(){var e;return((e=W(this,_u))==null?void 0:e.continue())??(this.state.status==="pending"?this.execute(this.state.variables):Promise.resolve())}async execute(e){var l,c,d,f,h,m,v,_,y,w,x,k,P,C,T,O,I,R;const n=()=>{Pt(this,Wo,Ml).call(this,{type:"continue"})},r={client:W(this,km),meta:this.options.meta,mutationKey:this.options.mutationKey},s=Me(this,_u,qN({fn:()=>this.options.mutationFn?this.options.mutationFn(e,r):Promise.reject(new Error("No mutationFn found")),onFail:(N,L)=>{Pt(this,Wo,Ml).call(this,{type:"failed",failureCount:N,error:L})},onPause:()=>{Pt(this,Wo,Ml).call(this,{type:"pause"})},onContinue:n,retry:this.options.retry??0,retryDelay:this.options.retryDelay,networkMode:this.options.networkMode,canRun:()=>W(this,gs).canRun(this)})),i=this.state.status==="pending",o=!s.canStart();try{if(i)n();else{Pt(this,Wo,Ml).call(this,{type:"pending",variables:e,isPaused:o}),W(this,gs).config.onMutate&&await W(this,gs).config.onMutate(e,this,r);const L=await((c=(l=this.options).onMutate)==null?void 0:c.call(l,e,r));L!==this.state.context&&Pt(this,Wo,Ml).call(this,{type:"pending",context:L,variables:e,isPaused:o})}this.state.isPaused&&s.canStart()&&n();const N=await s.start();return await((f=(d=W(this,gs).config).onSuccess)==null?void 0:f.call(d,N,e,this.state.context,this,r)),await((m=(h=this.options).onSuccess)==null?void 0:m.call(h,N,e,this.state.context,r)),await((_=(v=W(this,gs).config).onSettled)==null?void 0:_.call(v,N,null,this.state.variables,this.state.context,this,r)),await((w=(y=this.options).onSettled)==null?void 0:w.call(y,N,null,e,this.state.context,r)),Pt(this,Wo,Ml).call(this,{type:"success",data:N}),N}catch(N){try{await((k=(x=W(this,gs).config).onError)==null?void 0:k.call(x,N,e,this.state.context,this,r))}catch(L){Promise.reject(L)}try{await((C=(P=this.options).onError)==null?void 0:C.call(P,N,e,this.state.context,r))}catch(L){Promise.reject(L)}try{await((O=(T=W(this,gs).config).onSettled)==null?void 0:O.call(T,void 0,N,this.state.variables,this.state.context,this,r))}catch(L){Promise.reject(L)}try{await((R=(I=this.options).onSettled)==null?void 0:R.call(I,void 0,N,e,this.state.context,r))}catch(L){Promise.reject(L)}throw Pt(this,Wo,Ml).call(this,{type:"error",error:N}),N}finally{W(this,_u)===s&&Me(this,_u,void 0),W(this,gs).runNext(this)}}},km=new WeakMap,Zo=new WeakMap,gs=new WeakMap,_u=new WeakMap,Wo=new WeakSet,Ml=function(e){const n=r=>{switch(e.type){case"failed":return{...r,failureCount:e.failureCount,failureReason:e.error};case"pause":return{...r,isPaused:!0};case"continue":return{...r,isPaused:!1};case"pending":return{...r,context:e.context,data:void 0,failureCount:0,failureReason:null,error:null,isPaused:e.isPaused,status:"pending",variables:e.variables,submittedAt:Date.now()};case"success":return{...r,data:e.data,failureCount:0,failureReason:null,error:null,status:"success",isPaused:!1};case"error":return{...r,data:void 0,error:e.error,failureCount:r.failureCount+1,failureReason:e.error,isPaused:!1,status:"error"}}};this.state=n(this.state),Tr.batch(()=>{W(this,Zo).forEach(r=>{r.onMutationUpdate(e)}),W(this,gs).notify({mutation:this,type:"updated",action:e})})},H4);function YN(){return{context:void 0,data:void 0,error:null,failureCount:0,failureReason:null,isPaused:!1,status:"idle",variables:void 0,submittedAt:0}}var Vl,wo,Em,U4,aee=(U4=class extends Yf{constructor(e={}){super();st(this,Vl);st(this,wo);st(this,Em);this.config=e,Me(this,Vl,new Set),Me(this,wo,new Map),Me(this,Em,0)}build(e,n,r){const s=new oee({client:e,mutationCache:this,mutationId:++H0(this,Em)._,options:e.defaultMutationOptions(n),state:r});return this.add(s),s}add(e){W(this,Vl).add(e);const n=og(e);if(typeof n=="string"){const r=W(this,wo).get(n);r?r.push(e):W(this,wo).set(n,[e])}this.notify({type:"added",mutation:e})}remove(e){if(W(this,Vl).delete(e)){const n=og(e);if(typeof n=="string"){const r=W(this,wo).get(n);if(r)if(r.length>1){const s=r.indexOf(e);s!==-1&&r.splice(s,1)}else r[0]===e&&W(this,wo).delete(n)}}this.notify({type:"removed",mutation:e})}canRun(e){var r;const n=og(e);if(typeof n=="string"){const s=(r=W(this,wo).get(n))==null?void 0:r.find(i=>i.state.status==="pending");return!s||s===e}else return!0}runNext(e){var r,s;const n=og(e);return typeof n=="string"?((s=(r=W(this,wo).get(n))==null?void 0:r.find(i=>i!==e&&i.state.isPaused))==null?void 0:s.continue())??Promise.resolve():Promise.resolve()}clear(){Tr.batch(()=>{const e=this.getAll();W(this,Vl).clear(),W(this,wo).clear(),e.forEach(n=>{this.notify({type:"removed",mutation:n})})})}getAll(){return Array.from(W(this,Vl))}find(e){const n={exact:!0,...e};return this.getAll().find(r=>eT(n,r))}findAll(e={}){return this.getAll().filter(n=>eT(e,n))}notify(e){Tr.batch(()=>{this.listeners.forEach(n=>{n(e)})})}resumePausedMutations(){const e=this.getAll().filter(n=>n.state.isPaused);return Tr.batch(()=>Promise.all(e.map(n=>n.continue().catch(Ms))))}},Vl=new WeakMap,wo=new WeakMap,Em=new WeakMap,U4);function og(t){var e;return(e=t.options.scope)==null?void 0:e.id}var Va,Hl,vs,Cm,ta,lp,ux,B4,lee=(B4=class extends Yf{constructor(n,r){super();st(this,ta);st(this,Va);st(this,Hl);st(this,vs);st(this,Cm);Me(this,Va,n),this.setOptions(r),this.bindMethods(),Pt(this,ta,lp).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=W(this,Va).defaultMutationOptions(n),Vg(this.options,r)||W(this,Va).getMutationCache().notify({type:"observerOptionsUpdated",mutation:W(this,vs),observer:this}),r!=null&&r.mutationKey&&this.options.mutationKey&&$u(r.mutationKey)!==$u(this.options.mutationKey)?this.reset():((s=W(this,vs))==null?void 0:s.state.status)==="pending"&&W(this,vs).setOptions(this.options)}onSubscribe(){this.listeners.size===1&&W(this,vs)&&(W(this,vs).addObserver(this),Pt(this,ta,lp).call(this))}onUnsubscribe(){var n;this.hasListeners()||(n=W(this,vs))==null||n.removeObserver(this)}onMutationUpdate(n){Pt(this,ta,lp).call(this),Pt(this,ta,ux).call(this,n)}getCurrentResult(){return W(this,Hl)}reset(){var n;(n=W(this,vs))==null||n.removeObserver(this),Me(this,vs,void 0),Pt(this,ta,lp).call(this),Pt(this,ta,ux).call(this)}mutate(n,r){var s;return Me(this,Cm,r),(s=W(this,vs))==null||s.removeObserver(this),Me(this,vs,W(this,Va).getMutationCache().build(W(this,Va),this.options)),W(this,vs).addObserver(this),W(this,vs).execute(n)}},Va=new WeakMap,Hl=new WeakMap,vs=new WeakMap,Cm=new WeakMap,ta=new WeakSet,lp=function(){var r;const n=((r=W(this,vs))==null?void 0:r.state)??YN();Me(this,Hl,{...n,isPending:n.status==="pending",isSuccess:n.status==="success",isError:n.status==="error",isIdle:n.status==="idle",mutate:this.mutate,reset:this.reset})},ux=function(n){Tr.batch(()=>{var s,i,o,l;const r=W(this,Cm);if(r&&this.hasListeners()){const c=W(this,Hl).variables,d=W(this,Hl).context,f={client:W(this,Va),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,c,d,f)}catch(h){Promise.reject(h)}try{(i=r.onSettled)==null||i.call(r,n.data,null,c,d,f)}catch(h){Promise.reject(h)}}else if((n==null?void 0:n.type)==="error"){try{(o=r.onError)==null||o.call(r,n.error,c,d,f)}catch(h){Promise.reject(h)}try{(l=r.onSettled)==null||l.call(r,void 0,n.error,c,d,f)}catch(h){Promise.reject(h)}}}this.listeners.forEach(c=>{c(W(this,Hl))})})},B4),qo,Z4,cee=(Z4=class extends Yf{constructor(e={}){super();st(this,qo);this.config=e,Me(this,qo,new Map)}build(e,n,r){const s=n.queryKey,i=n.queryHash??Ek(s,n);let o=this.get(i);return o||(o=new ree({client:e,queryKey:s,queryHash:i,options:e.defaultQueryOptions(n),state:r,defaultOptions:e.getQueryDefaults(s)}),this.add(o)),o}add(e){W(this,qo).has(e.queryHash)||(W(this,qo).set(e.queryHash,e),this.notify({type:"added",query:e}))}remove(e){W(this,qo).get(e.queryHash)===e&&(e.destroy(),W(this,qo).delete(e.queryHash),this.notify({type:"removed",query:e}))}clear(){Tr.batch(()=>{this.getAll().forEach(e=>{this.remove(e)})})}get(e){return W(this,qo).get(e)}getAll(){return[...W(this,qo).values()]}find(e){const n={exact:!0,...e};return this.getAll().find(r=>JA(n,r))}findAll(e={}){const n=this.getAll();return Object.keys(e).length>0?n.filter(r=>JA(e,r)):n}notify(e){Tr.batch(()=>{this.listeners.forEach(n=>{n(e)})})}onFocus(){Tr.batch(()=>{this.getAll().forEach(e=>{e.onFocus()})})}onOnline(){Tr.batch(()=>{this.getAll().forEach(e=>{e.onOnline()})})}},qo=new WeakMap,Z4),qn,Ul,Bl,mf,gf,Zl,vf,yf,W4,uee=(W4=class{constructor(t={}){st(this,qn);st(this,Ul);st(this,Bl);st(this,mf);st(this,gf);st(this,Zl);st(this,vf);st(this,yf);Me(this,qn,t.queryCache||new cee),Me(this,Ul,t.mutationCache||new aee),Me(this,Bl,t.defaultOptions||{}),Me(this,mf,new Map),Me(this,gf,new Map),Me(this,Zl,0)}mount(){H0(this,Zl)._++,W(this,Zl)===1&&(Me(this,vf,Rk.subscribe(async t=>{t&&(await this.resumePausedMutations(),W(this,qn).onFocus())})),Me(this,yf,Bv.subscribe(async t=>{t&&(await this.resumePausedMutations(),W(this,qn).onOnline())})))}unmount(){var t,e;H0(this,Zl)._--,W(this,Zl)===0&&((t=W(this,vf))==null||t.call(this),Me(this,vf,void 0),(e=W(this,yf))==null||e.call(this),Me(this,yf,void 0))}isFetching(t){return W(this,qn).findAll({...t,fetchStatus:"fetching"}).length}isMutating(t){return W(this,Ul).findAll({...t,status:"pending"}).length}getQueryData(t){var n;const e=this.defaultQueryOptions({queryKey:t});return(n=W(this,qn).get(e.queryHash))==null?void 0:n.state.data}ensureQueryData(t){const e=this.defaultQueryOptions(t),n=W(this,qn).build(this,e),r=n.state.data;return r===void 0?this.fetchQuery(t):(t.revalidateIfStale&&n.isStaleByTime(Fn(e.staleTime,n))&&this.prefetchQuery(e),Promise.resolve(r))}getQueriesData(t){return W(this,qn).findAll(t).map(({queryKey:e,state:n})=>[e,n.data])}setQueryData(t,e,n){var o;const r=this.defaultQueryOptions({queryKey:t}),s=(o=W(this,qn).get(r.queryHash))==null?void 0:o.state.data,i=UJ(e,s);if(i!==void 0)return W(this,qn).build(this,r).setData(i,{...n,manual:!0})}setQueriesData(t,e,n){return Tr.batch(()=>W(this,qn).findAll(t).map(({queryKey:r})=>[r,this.setQueryData(r,e,n)]))}getQueryState(t){var n;const e=this.defaultQueryOptions({queryKey:t});return(n=W(this,qn).get(e.queryHash))==null?void 0:n.state}removeQueries(t){const e=W(this,qn);Tr.batch(()=>{e.findAll(t).forEach(n=>{e.remove(n)})})}resetQueries(t,e){const n=W(this,qn);return Tr.batch(()=>{const r=n.findAll(t),s=new Set(r);return r.forEach(i=>{i.reset()}),this.refetchQueries({type:"active",predicate:i=>s.has(i)},e)})}cancelQueries(t,e={}){const n={revert:!0,...e},r=Tr.batch(()=>W(this,qn).findAll(t).map(s=>s.cancel(n)));return Promise.all(r).then(Ms).catch(Ms)}invalidateQueries(t,e={}){return Tr.batch(()=>(W(this,qn).findAll(t).forEach(n=>{n.invalidate()}),(t==null?void 0:t.refetchType)==="none"?Promise.resolve():this.refetchQueries({...t,type:(t==null?void 0:t.refetchType)??(t==null?void 0:t.type)??"active"},e)))}refetchQueries(t,e={}){const n={...e,cancelRefetch:e.cancelRefetch??!0},r=Tr.batch(()=>W(this,qn).findAll(t).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(Ms)),o?Promise.resolve():i}));return Promise.all(r).then(Ms)}async query(t){const e=this.defaultQueryOptions(t);e.retry===void 0&&(e.retry=!1);const n=W(this,qn).build(this,e),r=n.isStaleByTime(Fn(e.staleTime,n))?await n.fetch(e):n.state.data,s=e.select;return s?s(r):r}fetchQuery(t){const e=this.defaultQueryOptions(t);e.retry===void 0&&(e.retry=!1);const n=W(this,qn).build(this,e);return n.isStaleByTime(Fn(e.staleTime,n))?n.fetch(e):Promise.resolve(n.state.data)}prefetchQuery(t){return this.fetchQuery(t).then(Ms).catch(Ms)}infiniteQuery(t){return t._type="infinite",this.query(t)}fetchInfiniteQuery(t){return t._type="infinite",this.fetchQuery(t)}prefetchInfiniteQuery(t){return this.fetchInfiniteQuery(t).then(Ms).catch(Ms)}ensureInfiniteQueryData(t){return t._type="infinite",this.ensureQueryData(t)}resumePausedMutations(){return Bv.isOnline()?W(this,Ul).resumePausedMutations():Promise.resolve()}getQueryCache(){return W(this,qn)}getMutationCache(){return W(this,Ul)}getDefaultOptions(){return W(this,Bl)}setDefaultOptions(t){Me(this,Bl,t)}setQueryDefaults(t,e){W(this,mf).set($u(t),{queryKey:t,defaultOptions:e})}getQueryDefaults(t){const e=[...W(this,mf).values()],n={};return e.forEach(r=>{Df(t,r.queryKey)&&Object.assign(n,r.defaultOptions)}),n}setMutationDefaults(t,e){W(this,gf).set($u(t),{mutationKey:t,defaultOptions:e})}getMutationDefaults(t){const e=[...W(this,gf).values()],n={};return e.forEach(r=>{Df(t,r.mutationKey)&&Object.assign(n,r.defaultOptions)}),n}defaultQueryOptions(t){if(t._defaulted)return t;const e={...W(this,Bl).queries,...this.getQueryDefaults(t.queryKey),...t,_defaulted:!0};return e.queryHash||(e.queryHash=Ek(e.queryKey,e)),e.refetchOnReconnect===void 0&&(e.refetchOnReconnect=e.networkMode!=="always"),e.throwOnError===void 0&&(e.throwOnError=!!e.suspense),!e.networkMode&&e.persister&&(e.networkMode="offlineFirst"),e.queryFn===Ck&&(e.enabled=!1),e}defaultMutationOptions(t){return t!=null&&t._defaulted?t:{...W(this,Bl).mutations,...(t==null?void 0:t.mutationKey)&&this.getMutationDefaults(t.mutationKey),...t,_defaulted:!0}}clear(){W(this,qn).clear(),W(this,Ul).clear()}},qn=new WeakMap,Ul=new WeakMap,Bl=new WeakMap,mf=new WeakMap,gf=new WeakMap,Zl=new WeakMap,vf=new WeakMap,yf=new WeakMap,W4);const XN=g.createContext(!1),dee=()=>g.useContext(XN);XN.Provider;function fee(){let t=!1;return{clearReset:()=>{t=!1},reset:()=>{t=!0},isReset:()=>t}}const hee=g.createContext(fee()),pee=()=>g.useContext(hee),mee=(t,e,n)=>{const r=(n==null?void 0:n.state.status)==="error"&&typeof t.throwOnError=="function"?Pk(t.throwOnError,[n.state.error,n]):t.throwOnError;(t.suspense||r)&&(e.isReset()||(t.retryOnMount=!1))},gee=t=>{g.useEffect(()=>{t.clearReset()},[t])},vee=({result:t,errorResetBoundary:e,throwOnError:n,query:r,suspense:s})=>t.isError&&!e.isReset()&&!t.isFetching&&r&&(s&&t.data===void 0||Pk(n,[t.error,r])),yee=t=>{if(t.suspense){const n=s=>s==="static"?s:Math.max(s??1e3,1e3),r=t.staleTime;t.staleTime=typeof r=="function"?(...s)=>n(r(...s)):n(r),typeof t.gcTime=="number"&&(t.gcTime=Math.max(t.gcTime,1e3))}},_ee=(t,e)=>(t==null?void 0:t.suspense)&&e.isPending,wee=(t,e,n)=>e.fetchOptimistic(t).catch(()=>{n.clearReset()});function bee(t,e,n){const r=dee(),s=pee(),i=Rm(),o=i.defaultQueryOptions(t),l=i.getQueryCache().get(o.queryHash),c=t.subscribed!==!1;o._optimisticResults=r?"isRestoring":c?"optimistic":void 0,yee(o),mee(o,s,l),gee(s);const[d]=g.useState(()=>new e(i,o)),f=d.getOptimisticResult(o);g.useEffect(()=>{d.setOptions(o)},[o,d]);const h=!r&&c;if(g.useSyncExternalStore(g.useCallback(m=>{const v=h?d.subscribe(Tr.batchCalls(m)):Ms;return d.updateResult(),v},[d,h]),()=>d.getCurrentResult(),()=>d.getCurrentResult()),_ee(o,f))throw wee(o,d,s);if(vee({result:f,errorResetBoundary:s,throwOnError:o.throwOnError,query:l,suspense:o.suspense}))throw f.error;return o.notifyOnChangeProps?f:d.trackResult(f)}function aa(t,e){return bee(t,see)}function QN(t,e){const n=Rm(),[r]=g.useState(()=>new lee(n,t));g.useEffect(()=>{r.setOptions(t)},[r,t]);const s=g.useSyncExternalStore(g.useCallback(o=>r.subscribe(Tr.batchCalls(o)),[r]),()=>r.getCurrentResult(),()=>r.getCurrentResult()),i=g.useCallback((...o)=>{r.mutate(o[0],o[1]).catch(Ms)},[r]);if(s.error&&Pk(r.options.throwOnError,[s.error]))throw s.error;return{...s,mutate:i,mutateAsync:s.mutate}}var xee=(function(){var t=function(e,n){return t=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])},t(e,n)};return function(e,n){if(typeof n!="function"&&n!==null)throw new TypeError("Class extends value "+String(n)+" is not a constructor or null");t(e,n);function r(){this.constructor=e}e.prototype=n===null?Object.create(n):(r.prototype=n.prototype,new r)}})();var See=function(t,e,n){return typeof e=="symbol"&&(e=e.description?"[".concat(e.description,"]"):""),Object.defineProperty(t,"name",{configurable:!0,value:n?"".concat(n," ",e):e})},ag,lT="__POSTHOG_REACT_SHARED_STATE__",cT=typeof globalThis<"u"?globalThis:typeof window<"u"?window:{},Qp;try{Qp=cT[lT]=cT[lT]||new WeakMap}catch{Qp=new WeakMap}Qp.has(g.createContext)||Qp.set(g.createContext,{});var ku=Qp.get(g.createContext),dx;function kee(t){(!ku.defaultPostHogInstance||ku.defaultPostHogInstance===dx)&&(ku.defaultPostHogInstance=t),dx=t}function fx(){return dx}ku.context||(ku.context=g.createContext({get client(){return fx()||ku.defaultPostHogInstance},bootstrap:void 0}));var Ok=ku.context;function JN(t,e,n){if(n===void 0&&(n=new WeakMap),t===e)return!0;if(typeof t!="object"||t===null||typeof e!="object"||e===null)return!1;if(n.has(t)&&n.get(t)===e)return!0;n.set(t,e);var r=Object.keys(t),s=Object.keys(e);if(r.length!==s.length)return!1;for(var i=0,o=r;i<o.length;i++){var l=o[i];if(!s.includes(l)||!JN(t[l],e[l],n))return!1}return!0}function Eee(t){var e,n,r=t.children,s=t.client,i=t.apiKey,o=t.options,l=g.useRef(null),c=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=fx();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=fx(),f=l.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&&!JN(o,f.options)&&d.set_config(o),l.current={apiKey:i,options:o??{}}):(d.__loaded&&console.warn("[PostHog.js] `posthog` was already loaded elsewhere. This may cause issues."),d.init(i,o),l.current={apiKey:i,options:o??{}})}},[s,i,JSON.stringify(o)]),Ae.createElement(Ok.Provider,{value:{client:c,bootstrap:(e=o==null?void 0:o.bootstrap)!==null&&e!==void 0?e:(n=s==null?void 0:s.config)===null||n===void 0?void 0:n.bootstrap}},r)}var q2=function(t){return typeof t=="function"},Cee=function(t){return t===void 0},so=function(){var t=g.useContext(Ok).client;return t},Hg=function(t){var e=Object.prototype.toString.call(t);return t instanceof Error||e==="[object Error]"||e==="[object Exception]"||e==="[object DOMException]"||e==="[object DOMError]"},Pee=function(t,e){try{Object.defineProperty(t,"name",{value:e,writable:!0,enumerable:!0,configurable:!0})}catch{}},Aee=function(t,e){for(var n=new WeakSet,r=t;!n.has(r);){if(n.add(r),!Hg(r.cause)){Cee(r.cause)||(e.cause=r.cause),r.cause=e;return}r=r.cause}},Tee=function(t,e){if(!e)return t;var n=new Error(Hg(t)?t.message:"Primitive value captured as exception: ".concat(String(t)));return Pee(n,"React ErrorBoundary ".concat(Hg(t)?t.name:"Error")),n.stack=e,Hg(t)?(Aee(t,n),t):n},uT={componentStack:null,exceptionEvent:null,error:null},Ree={INVALID_FALLBACK:"[PostHog.js][PostHogErrorBoundary] Invalid fallback prop, provide a valid React element or a function that returns a valid React element."},Iee=(ag=(function(t){xee(e,t);function e(n){var r=t.call(this,n)||this;return r._resetError=function(){r.setState(uT)},r.state=uT,r}return e.prototype.componentDidCatch=function(n,r){var s=this.props.additionalProperties,i;q2(s)?i=s(n,r):typeof s=="object"&&(i=s);var o=this.context.client,l=r.componentStack,c=o.captureException(Tee(n,l),i);this.setState({error:n,componentStack:l??null,exceptionEvent:c})},e.prototype.render=function(){var n=this.props,r=n.children,s=n.fallback,i=this.state;if(i.componentStack==null)return q2(r)?r():r;var o=q2(s)?Ae.createElement(s,{error:i.error,componentStack:i.componentStack,exceptionEvent:i.exceptionEvent,resetError:this._resetError}):s;return Ae.isValidElement(o)?o:(console.warn(Ree.INVALID_FALLBACK),Ae.createElement(Ae.Fragment,null))},e})(Ae.Component),See(ag,"PostHogErrorBoundary"),(function(){ag.contextType=Ok})(),ag);kee(Qe);const Oee="rivet-preview-bridge",Mee=["ArrowUp","ArrowDown"],Nee=new Set(["INPUT","TEXTAREA","SELECT"]),eL=t=>!t||!("tagName"in t)||typeof t.tagName!="string"?!1:Nee.has(t.tagName.toUpperCase())||"isContentEditable"in t&&t.isContentEditable===!0,Lee=t=>typeof t!="object"||t===null||!("channel"in t)||t.channel!==Oee||!("direction"in t)||t.direction!=="event"||!("type"in t)||t.type!=="keydown"||!("key"in t)?null:Mee.find(e=>e===t.key)??null,Dee=t=>{try{return new URL(t.src,window.location.href).origin}catch{return null}},$ee=t=>t.source===null?null:Array.from(document.querySelectorAll("iframe")).find(e=>e.contentWindow===t.source&&Dee(e)===t.origin)??null,jee=t=>{const e=n=>{eL(n.target)||t(n)};return window.addEventListener("keydown",e),()=>window.removeEventListener("keydown",e)},Fee=()=>{const t=e=>{const n=Lee(e.data),r=n?$ee(e):null;!n||!r||r.dispatchEvent(new KeyboardEvent("keydown",{key:n,bubbles:!0,cancelable:!0}))};return window.addEventListener("message",t),()=>window.removeEventListener("message",t)};var lg={},G2={exports:{}},Us={},K2={exports:{}},Y2={};/**
|
|
78
|
-
* @license React
|
|
79
|
-
* scheduler.production.min.js
|
|
80
|
-
*
|
|
81
|
-
* Copyright (c) Facebook, Inc. and its affiliates.
|
|
82
|
-
*
|
|
83
|
-
* This source code is licensed under the MIT license found in the
|
|
84
|
-
* LICENSE file in the root directory of this source tree.
|
|
85
|
-
*/var dT;function zee(){return dT||(dT=1,(function(t){function e(V,Q){var U=V.length;V.push(Q);e:for(;0<U;){var D=U-1>>>1,K=V[D];if(0<s(K,Q))V[D]=Q,V[U]=K,U=D;else break e}}function n(V){return V.length===0?null:V[0]}function r(V){if(V.length===0)return null;var Q=V[0],U=V.pop();if(U!==Q){V[0]=U;e:for(var D=0,K=V.length,de=K>>>1;D<de;){var ie=2*(D+1)-1,ce=V[ie],he=ie+1,xe=V[he];if(0>s(ce,U))he<K&&0>s(xe,ce)?(V[D]=xe,V[he]=U,D=he):(V[D]=ce,V[ie]=U,D=ie);else if(he<K&&0>s(xe,U))V[D]=xe,V[he]=U,D=he;else break e}}return Q}function s(V,Q){var U=V.sortIndex-Q.sortIndex;return U!==0?U:V.id-Q.id}if(typeof performance=="object"&&typeof performance.now=="function"){var i=performance;t.unstable_now=function(){return i.now()}}else{var o=Date,l=o.now();t.unstable_now=function(){return o.now()-l}}var c=[],d=[],f=1,h=null,m=3,v=!1,_=!1,y=!1,w=typeof setTimeout=="function"?setTimeout:null,x=typeof clearTimeout=="function"?clearTimeout:null,k=typeof setImmediate<"u"?setImmediate:null;typeof navigator<"u"&&navigator.scheduling!==void 0&&navigator.scheduling.isInputPending!==void 0&&navigator.scheduling.isInputPending.bind(navigator.scheduling);function P(V){for(var Q=n(d);Q!==null;){if(Q.callback===null)r(d);else if(Q.startTime<=V)r(d),Q.sortIndex=Q.expirationTime,e(c,Q);else break;Q=n(d)}}function C(V){if(y=!1,P(V),!_)if(n(c)!==null)_=!0,H(T);else{var Q=n(d);Q!==null&&ee(C,Q.startTime-V)}}function T(V,Q){_=!1,y&&(y=!1,x(R),R=-1),v=!0;var U=m;try{for(P(Q),h=n(c);h!==null&&(!(h.expirationTime>Q)||V&&!z());){var D=h.callback;if(typeof D=="function"){h.callback=null,m=h.priorityLevel;var K=D(h.expirationTime<=Q);Q=t.unstable_now(),typeof K=="function"?h.callback=K:h===n(c)&&r(c),P(Q)}else r(c);h=n(c)}if(h!==null)var de=!0;else{var ie=n(d);ie!==null&&ee(C,ie.startTime-Q),de=!1}return de}finally{h=null,m=U,v=!1}}var O=!1,I=null,R=-1,N=5,L=-1;function z(){return!(t.unstable_now()-L<N)}function $(){if(I!==null){var V=t.unstable_now();L=V;var Q=!0;try{Q=I(!0,V)}finally{Q?G():(O=!1,I=null)}}else O=!1}var G;if(typeof k=="function")G=function(){k($)};else if(typeof MessageChannel<"u"){var X=new MessageChannel,q=X.port2;X.port1.onmessage=$,G=function(){q.postMessage(null)}}else G=function(){w($,0)};function H(V){I=V,O||(O=!0,G())}function ee(V,Q){R=w(function(){V(t.unstable_now())},Q)}t.unstable_IdlePriority=5,t.unstable_ImmediatePriority=1,t.unstable_LowPriority=4,t.unstable_NormalPriority=3,t.unstable_Profiling=null,t.unstable_UserBlockingPriority=2,t.unstable_cancelCallback=function(V){V.callback=null},t.unstable_continueExecution=function(){_||v||(_=!0,H(T))},t.unstable_forceFrameRate=function(V){0>V||125<V?console.error("forceFrameRate takes a positive int between 0 and 125, forcing frame rates higher than 125 fps is not supported"):N=0<V?Math.floor(1e3/V):5},t.unstable_getCurrentPriorityLevel=function(){return m},t.unstable_getFirstCallbackNode=function(){return n(c)},t.unstable_next=function(V){switch(m){case 1:case 2:case 3:var Q=3;break;default:Q=m}var U=m;m=Q;try{return V()}finally{m=U}},t.unstable_pauseExecution=function(){},t.unstable_requestPaint=function(){},t.unstable_runWithPriority=function(V,Q){switch(V){case 1:case 2:case 3:case 4:case 5:break;default:V=3}var U=m;m=V;try{return Q()}finally{m=U}},t.unstable_scheduleCallback=function(V,Q,U){var D=t.unstable_now();switch(typeof U=="object"&&U!==null?(U=U.delay,U=typeof U=="number"&&0<U?D+U:D):U=D,V){case 1:var K=-1;break;case 2:K=250;break;case 5:K=1073741823;break;case 4:K=1e4;break;default:K=5e3}return K=U+K,V={id:f++,callback:Q,priorityLevel:V,startTime:U,expirationTime:K,sortIndex:-1},U>D?(V.sortIndex=U,e(d,V),n(c)===null&&V===n(d)&&(y?(x(R),R=-1):y=!0,ee(C,U-D))):(V.sortIndex=K,e(c,V),_||v||(_=!0,H(T))),V},t.unstable_shouldYield=z,t.unstable_wrapCallback=function(V){var Q=m;return function(){var U=m;m=Q;try{return V.apply(this,arguments)}finally{m=U}}}})(Y2)),Y2}var fT;function Vee(){return fT||(fT=1,K2.exports=zee()),K2.exports}/**
|
|
86
|
-
* @license React
|
|
87
|
-
* react-dom.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 hT;function Hee(){if(hT)return Us;hT=1;var t=$S(),e=Vee();function n(a){for(var u="https://reactjs.org/docs/error-decoder.html?invariant="+a,p=1;p<arguments.length;p++)u+="&args[]="+encodeURIComponent(arguments[p]);return"Minified React error #"+a+"; visit "+u+" 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,u){o(a,u),o(a+"Capture",u)}function o(a,u){for(s[a]=u,a=0;a<u.length;a++)r.add(u[a])}var l=!(typeof window>"u"||typeof window.document>"u"||typeof window.document.createElement>"u"),c=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={},h={};function m(a){return c.call(h,a)?!0:c.call(f,a)?!1:d.test(a)?h[a]=!0:(f[a]=!0,!1)}function v(a,u,p,b){if(p!==null&&p.type===0)return!1;switch(typeof u){case"function":case"symbol":return!0;case"boolean":return b?!1:p!==null?!p.acceptsBooleans:(a=a.toLowerCase().slice(0,5),a!=="data-"&&a!=="aria-");default:return!1}}function _(a,u,p,b){if(u===null||typeof u>"u"||v(a,u,p,b))return!0;if(b)return!1;if(p!==null)switch(p.type){case 3:return!u;case 4:return u===!1;case 5:return isNaN(u);case 6:return isNaN(u)||1>u}return!1}function y(a,u,p,b,E,A,M){this.acceptsBooleans=u===2||u===3||u===4,this.attributeName=b,this.attributeNamespace=E,this.mustUseProperty=p,this.propertyName=a,this.type=u,this.sanitizeURL=A,this.removeEmptyString=M}var w={};"children dangerouslySetInnerHTML defaultValue defaultChecked innerHTML suppressContentEditableWarning suppressHydrationWarning style".split(" ").forEach(function(a){w[a]=new y(a,0,!1,a,null,!1,!1)}),[["acceptCharset","accept-charset"],["className","class"],["htmlFor","for"],["httpEquiv","http-equiv"]].forEach(function(a){var u=a[0];w[u]=new y(u,1,!1,a[1],null,!1,!1)}),["contentEditable","draggable","spellCheck","value"].forEach(function(a){w[a]=new y(a,2,!1,a.toLowerCase(),null,!1,!1)}),["autoReverse","externalResourcesRequired","focusable","preserveAlpha"].forEach(function(a){w[a]=new y(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){w[a]=new y(a,3,!1,a.toLowerCase(),null,!1,!1)}),["checked","multiple","muted","selected"].forEach(function(a){w[a]=new y(a,3,!0,a,null,!1,!1)}),["capture","download"].forEach(function(a){w[a]=new y(a,4,!1,a,null,!1,!1)}),["cols","rows","size","span"].forEach(function(a){w[a]=new y(a,6,!1,a,null,!1,!1)}),["rowSpan","start"].forEach(function(a){w[a]=new y(a,5,!1,a.toLowerCase(),null,!1,!1)});var x=/[\-:]([a-z])/g;function k(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 u=a.replace(x,k);w[u]=new y(u,1,!1,a,null,!1,!1)}),"xlink:actuate xlink:arcrole xlink:role xlink:show xlink:title xlink:type".split(" ").forEach(function(a){var u=a.replace(x,k);w[u]=new y(u,1,!1,a,"http://www.w3.org/1999/xlink",!1,!1)}),["xml:base","xml:lang","xml:space"].forEach(function(a){var u=a.replace(x,k);w[u]=new y(u,1,!1,a,"http://www.w3.org/XML/1998/namespace",!1,!1)}),["tabIndex","crossOrigin"].forEach(function(a){w[a]=new y(a,1,!1,a.toLowerCase(),null,!1,!1)}),w.xlinkHref=new y("xlinkHref",1,!1,"xlink:href","http://www.w3.org/1999/xlink",!0,!1),["src","href","action","formAction"].forEach(function(a){w[a]=new y(a,1,!1,a.toLowerCase(),null,!0,!0)});function P(a,u,p,b){var E=w.hasOwnProperty(u)?w[u]:null;(E!==null?E.type!==0:b||!(2<u.length)||u[0]!=="o"&&u[0]!=="O"||u[1]!=="n"&&u[1]!=="N")&&(_(u,p,E,b)&&(p=null),b||E===null?m(u)&&(p===null?a.removeAttribute(u):a.setAttribute(u,""+p)):E.mustUseProperty?a[E.propertyName]=p===null?E.type===3?!1:"":p:(u=E.attributeName,b=E.attributeNamespace,p===null?a.removeAttribute(u):(E=E.type,p=E===3||E===4&&p===!0?"":""+p,b?a.setAttributeNS(b,u,p):a.setAttribute(u,p))))}var C=t.__SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED,T=Symbol.for("react.element"),O=Symbol.for("react.portal"),I=Symbol.for("react.fragment"),R=Symbol.for("react.strict_mode"),N=Symbol.for("react.profiler"),L=Symbol.for("react.provider"),z=Symbol.for("react.context"),$=Symbol.for("react.forward_ref"),G=Symbol.for("react.suspense"),X=Symbol.for("react.suspense_list"),q=Symbol.for("react.memo"),H=Symbol.for("react.lazy"),ee=Symbol.for("react.offscreen"),V=Symbol.iterator;function Q(a){return a===null||typeof a!="object"?null:(a=V&&a[V]||a["@@iterator"],typeof a=="function"?a:null)}var U=Object.assign,D;function K(a){if(D===void 0)try{throw Error()}catch(p){var u=p.stack.trim().match(/\n( *(at )?)/);D=u&&u[1]||""}return`
|
|
94
|
-
`+D+a}var de=!1;function ie(a,u){if(!a||de)return"";de=!0;var p=Error.prepareStackTrace;Error.prepareStackTrace=void 0;try{if(u)if(u=function(){throw Error()},Object.defineProperty(u.prototype,"props",{set:function(){throw Error()}}),typeof Reflect=="object"&&Reflect.construct){try{Reflect.construct(u,[])}catch(ae){var b=ae}Reflect.construct(a,[],u)}else{try{u.call()}catch(ae){b=ae}a.call(u.prototype)}else{try{throw Error()}catch(ae){b=ae}a()}}catch(ae){if(ae&&b&&typeof ae.stack=="string"){for(var E=ae.stack.split(`
|
|
95
|
-
`),A=b.stack.split(`
|
|
96
|
-
`),M=E.length-1,Z=A.length-1;1<=M&&0<=Z&&E[M]!==A[Z];)Z--;for(;1<=M&&0<=Z;M--,Z--)if(E[M]!==A[Z]){if(M!==1||Z!==1)do if(M--,Z--,0>Z||E[M]!==A[Z]){var Y=`
|
|
97
|
-
`+E[M].replace(" at new "," at ");return a.displayName&&Y.includes("<anonymous>")&&(Y=Y.replace("<anonymous>",a.displayName)),Y}while(1<=M&&0<=Z);break}}}finally{de=!1,Error.prepareStackTrace=p}return(a=a?a.displayName||a.name:"")?K(a):""}function ce(a){switch(a.tag){case 5:return K(a.type);case 16:return K("Lazy");case 13:return K("Suspense");case 19:return K("SuspenseList");case 0:case 2:case 15:return a=ie(a.type,!1),a;case 11:return a=ie(a.type.render,!1),a;case 1:return a=ie(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 I:return"Fragment";case O:return"Portal";case N:return"Profiler";case R:return"StrictMode";case G:return"Suspense";case X:return"SuspenseList"}if(typeof a=="object")switch(a.$$typeof){case z:return(a.displayName||"Context")+".Consumer";case L:return(a._context.displayName||"Context")+".Provider";case $:var u=a.render;return a=a.displayName,a||(a=u.displayName||u.name||"",a=a!==""?"ForwardRef("+a+")":"ForwardRef"),a;case q:return u=a.displayName||null,u!==null?u:he(a.type)||"Memo";case H:u=a._payload,a=a._init;try{return he(a(u))}catch{}}return null}function xe(a){var u=a.type;switch(a.tag){case 24:return"Cache";case 9:return(u.displayName||"Context")+".Consumer";case 10:return(u._context.displayName||"Context")+".Provider";case 18:return"DehydratedFragment";case 11:return a=u.render,a=a.displayName||a.name||"",u.displayName||(a!==""?"ForwardRef("+a+")":"ForwardRef");case 7:return"Fragment";case 5:return u;case 4:return"Portal";case 3:return"Root";case 6:return"Text";case 16:return he(u);case 8:return u===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 u=="function")return u.displayName||u.name||null;if(typeof u=="string")return u}return null}function oe(a){switch(typeof a){case"boolean":case"number":case"string":case"undefined":return a;case"object":return a;default:return""}}function re(a){var u=a.type;return(a=a.nodeName)&&a.toLowerCase()==="input"&&(u==="checkbox"||u==="radio")}function Se(a){var u=re(a)?"checked":"value",p=Object.getOwnPropertyDescriptor(a.constructor.prototype,u),b=""+a[u];if(!a.hasOwnProperty(u)&&typeof p<"u"&&typeof p.get=="function"&&typeof p.set=="function"){var E=p.get,A=p.set;return Object.defineProperty(a,u,{configurable:!0,get:function(){return E.call(this)},set:function(M){b=""+M,A.call(this,M)}}),Object.defineProperty(a,u,{enumerable:p.enumerable}),{getValue:function(){return b},setValue:function(M){b=""+M},stopTracking:function(){a._valueTracker=null,delete a[u]}}}}function ze(a){a._valueTracker||(a._valueTracker=Se(a))}function ke(a){if(!a)return!1;var u=a._valueTracker;if(!u)return!0;var p=u.getValue(),b="";return a&&(b=re(a)?a.checked?"true":"false":a.value),a=b,a!==p?(u.setValue(a),!0):!1}function gt(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 on(a,u){var p=u.checked;return U({},u,{defaultChecked:void 0,defaultValue:void 0,value:void 0,checked:p??a._wrapperState.initialChecked})}function Tt(a,u){var p=u.defaultValue==null?"":u.defaultValue,b=u.checked!=null?u.checked:u.defaultChecked;p=oe(u.value!=null?u.value:p),a._wrapperState={initialChecked:b,initialValue:p,controlled:u.type==="checkbox"||u.type==="radio"?u.checked!=null:u.value!=null}}function $t(a,u){u=u.checked,u!=null&&P(a,"checked",u,!1)}function xt(a,u){$t(a,u);var p=oe(u.value),b=u.type;if(p!=null)b==="number"?(p===0&&a.value===""||a.value!=p)&&(a.value=""+p):a.value!==""+p&&(a.value=""+p);else if(b==="submit"||b==="reset"){a.removeAttribute("value");return}u.hasOwnProperty("value")?Be(a,u.type,p):u.hasOwnProperty("defaultValue")&&Be(a,u.type,oe(u.defaultValue)),u.checked==null&&u.defaultChecked!=null&&(a.defaultChecked=!!u.defaultChecked)}function An(a,u,p){if(u.hasOwnProperty("value")||u.hasOwnProperty("defaultValue")){var b=u.type;if(!(b!=="submit"&&b!=="reset"||u.value!==void 0&&u.value!==null))return;u=""+a._wrapperState.initialValue,p||u===a.value||(a.value=u),a.defaultValue=u}p=a.name,p!==""&&(a.name=""),a.defaultChecked=!!a._wrapperState.initialChecked,p!==""&&(a.name=p)}function Be(a,u,p){(u!=="number"||gt(a.ownerDocument)!==a)&&(p==null?a.defaultValue=""+a._wrapperState.initialValue:a.defaultValue!==""+p&&(a.defaultValue=""+p))}var je=Array.isArray;function Ie(a,u,p,b){if(a=a.options,u){u={};for(var E=0;E<p.length;E++)u["$"+p[E]]=!0;for(p=0;p<a.length;p++)E=u.hasOwnProperty("$"+a[p].value),a[p].selected!==E&&(a[p].selected=E),E&&b&&(a[p].defaultSelected=!0)}else{for(p=""+oe(p),u=null,E=0;E<a.length;E++){if(a[E].value===p){a[E].selected=!0,b&&(a[E].defaultSelected=!0);return}u!==null||a[E].disabled||(u=a[E])}u!==null&&(u.selected=!0)}}function nt(a,u){if(u.dangerouslySetInnerHTML!=null)throw Error(n(91));return U({},u,{value:void 0,defaultValue:void 0,children:""+a._wrapperState.initialValue})}function St(a,u){var p=u.value;if(p==null){if(p=u.children,u=u.defaultValue,p!=null){if(u!=null)throw Error(n(92));if(je(p)){if(1<p.length)throw Error(n(93));p=p[0]}u=p}u==null&&(u=""),p=u}a._wrapperState={initialValue:oe(p)}}function Ce(a,u){var p=oe(u.value),b=oe(u.defaultValue);p!=null&&(p=""+p,p!==a.value&&(a.value=p),u.defaultValue==null&&a.defaultValue!==p&&(a.defaultValue=p)),b!=null&&(a.defaultValue=""+b)}function Ot(a){var u=a.textContent;u===a._wrapperState.initialValue&&u!==""&&u!==null&&(a.value=u)}function Qt(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 Et(a,u){return a==null||a==="http://www.w3.org/1999/xhtml"?Qt(u):a==="http://www.w3.org/2000/svg"&&u==="foreignObject"?"http://www.w3.org/1999/xhtml":a}var Ur,ai=(function(a){return typeof MSApp<"u"&&MSApp.execUnsafeLocalFunction?function(u,p,b,E){MSApp.execUnsafeLocalFunction(function(){return a(u,p,b,E)})}:a})(function(a,u){if(a.namespaceURI!=="http://www.w3.org/2000/svg"||"innerHTML"in a)a.innerHTML=u;else{for(Ur=Ur||document.createElement("div"),Ur.innerHTML="<svg>"+u.valueOf().toString()+"</svg>",u=Ur.firstChild;a.firstChild;)a.removeChild(a.firstChild);for(;u.firstChild;)a.appendChild(u.firstChild)}});function ss(a,u){if(u){var p=a.firstChild;if(p&&p===a.lastChild&&p.nodeType===3){p.nodeValue=u;return}}a.textContent=u}var Br={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},Ri=["Webkit","ms","Moz","O"];Object.keys(Br).forEach(function(a){Ri.forEach(function(u){u=u+a.charAt(0).toUpperCase()+a.substring(1),Br[u]=Br[a]})});function Tn(a,u,p){return u==null||typeof u=="boolean"||u===""?"":p||typeof u!="number"||u===0||Br.hasOwnProperty(a)&&Br[a]?(""+u).trim():u+"px"}function ur(a,u){a=a.style;for(var p in u)if(u.hasOwnProperty(p)){var b=p.indexOf("--")===0,E=Tn(p,u[p],b);p==="float"&&(p="cssFloat"),b?a.setProperty(p,E):a[p]=E}}var is=U({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 dr(a,u){if(u){if(is[a]&&(u.children!=null||u.dangerouslySetInnerHTML!=null))throw Error(n(137,a));if(u.dangerouslySetInnerHTML!=null){if(u.children!=null)throw Error(n(60));if(typeof u.dangerouslySetInnerHTML!="object"||!("__html"in u.dangerouslySetInnerHTML))throw Error(n(61))}if(u.style!=null&&typeof u.style!="object")throw Error(n(62))}}function Ii(a,u){if(a.indexOf("-")===-1)return typeof u.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 Un=null;function Oi(a){return a=a.target||a.srcElement||window,a.correspondingUseElement&&(a=a.correspondingUseElement),a.nodeType===3?a.parentNode:a}var ks=null,nr=null,xr=null;function Mi(a){if(a=vh(a)){if(typeof ks!="function")throw Error(n(280));var u=a.stateNode;u&&(u=r0(u),ks(a.stateNode,a.type,u))}}function Sr(a){nr?xr?xr.push(a):xr=[a]:nr=a}function os(){if(nr){var a=nr,u=xr;if(xr=nr=null,Mi(a),u)for(a=0;a<u.length;a++)Mi(u[a])}}function rt(a,u){return a(u)}function qt(){}var Gt=!1;function ln(a,u,p){if(Gt)return a(u,p);Gt=!0;try{return rt(a,u,p)}finally{Gt=!1,(nr!==null||xr!==null)&&(qt(),os())}}function Zr(a,u){var p=a.stateNode;if(p===null)return null;var b=r0(p);if(b===null)return null;p=b[u];e:switch(u){case"onClick":case"onClickCapture":case"onDoubleClick":case"onDoubleClickCapture":case"onMouseDown":case"onMouseDownCapture":case"onMouseMove":case"onMouseMoveCapture":case"onMouseUp":case"onMouseUpCapture":case"onMouseEnter":(b=!b.disabled)||(a=a.type,b=!(a==="button"||a==="input"||a==="select"||a==="textarea")),a=!b;break e;default:a=!1}if(a)return null;if(p&&typeof p!="function")throw Error(n(231,u,typeof p));return p}var kn=!1;if(l)try{var cn={};Object.defineProperty(cn,"passive",{get:function(){kn=!0}}),window.addEventListener("test",cn,cn),window.removeEventListener("test",cn,cn)}catch{kn=!1}function as(a,u,p,b,E,A,M,Z,Y){var ae=Array.prototype.slice.call(arguments,3);try{u.apply(p,ae)}catch(be){this.onError(be)}}var Wr=!1,kr=null,Ut=!1,Bn=null,Ac={onError:function(a){Wr=!0,kr=a}};function pa(a,u,p,b,E,A,M,Z,Y){Wr=!1,kr=null,as.apply(Ac,arguments)}function li(a,u,p,b,E,A,M,Z,Y){if(pa.apply(this,arguments),Wr){if(Wr){var ae=kr;Wr=!1,kr=null}else throw Error(n(198));Ut||(Ut=!0,Bn=ae)}}function qr(a){var u=a,p=a;if(a.alternate)for(;u.return;)u=u.return;else{a=u;do u=a,(u.flags&4098)!==0&&(p=u.return),a=u.return;while(a)}return u.tag===3?p:null}function al(a){if(a.tag===13){var u=a.memoizedState;if(u===null&&(a=a.alternate,a!==null&&(u=a.memoizedState)),u!==null)return u.dehydrated}return null}function ls(a){if(qr(a)!==a)throw Error(n(188))}function Ni(a){var u=a.alternate;if(!u){if(u=qr(a),u===null)throw Error(n(188));return u!==a?null:a}for(var p=a,b=u;;){var E=p.return;if(E===null)break;var A=E.alternate;if(A===null){if(b=E.return,b!==null){p=b;continue}break}if(E.child===A.child){for(A=E.child;A;){if(A===p)return ls(E),a;if(A===b)return ls(E),u;A=A.sibling}throw Error(n(188))}if(p.return!==b.return)p=E,b=A;else{for(var M=!1,Z=E.child;Z;){if(Z===p){M=!0,p=E,b=A;break}if(Z===b){M=!0,b=E,p=A;break}Z=Z.sibling}if(!M){for(Z=A.child;Z;){if(Z===p){M=!0,p=A,b=E;break}if(Z===b){M=!0,b=A,p=E;break}Z=Z.sibling}if(!M)throw Error(n(189))}}if(p.alternate!==b)throw Error(n(190))}if(p.tag!==3)throw Error(n(188));return p.stateNode.current===p?a:u}function Li(a){return a=Ni(a),a!==null?ma(a):null}function ma(a){if(a.tag===5||a.tag===6)return a;for(a=a.child;a!==null;){var u=ma(a);if(u!==null)return u;a=a.sibling}return null}var To=e.unstable_scheduleCallback,Tc=e.unstable_cancelCallback,Bu=e.unstable_shouldYield,Ro=e.unstable_requestPaint,un=e.unstable_now,ga=e.unstable_getCurrentPriorityLevel,Di=e.unstable_ImmediatePriority,Io=e.unstable_UserBlockingPriority,Or=e.unstable_NormalPriority,Zu=e.unstable_LowPriority,Rc=e.unstable_IdlePriority,io=null,$s=null;function Wu(a){if($s&&typeof $s.onCommitFiberRoot=="function")try{$s.onCommitFiberRoot(io,a,void 0,(a.current.flags&128)===128)}catch{}}var Es=Math.clz32?Math.clz32:cl,ih=Math.log,ll=Math.LN2;function cl(a){return a>>>=0,a===0?32:31-(ih(a)/ll|0)|0}var Oo=64,F=4194304;function pe(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 ge(a,u){var p=a.pendingLanes;if(p===0)return 0;var b=0,E=a.suspendedLanes,A=a.pingedLanes,M=p&268435455;if(M!==0){var Z=M&~E;Z!==0?b=pe(Z):(A&=M,A!==0&&(b=pe(A)))}else M=p&~E,M!==0?b=pe(M):A!==0&&(b=pe(A));if(b===0)return 0;if(u!==0&&u!==b&&(u&E)===0&&(E=b&-b,A=u&-u,E>=A||E===16&&(A&4194240)!==0))return u;if((b&4)!==0&&(b|=p&16),u=a.entangledLanes,u!==0)for(a=a.entanglements,u&=b;0<u;)p=31-Es(u),E=1<<p,b|=a[p],u&=~E;return b}function Pe(a,u){switch(a){case 1:case 2:case 4:return u+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 u+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 Ke(a,u){for(var p=a.suspendedLanes,b=a.pingedLanes,E=a.expirationTimes,A=a.pendingLanes;0<A;){var M=31-Es(A),Z=1<<M,Y=E[M];Y===-1?((Z&p)===0||(Z&b)!==0)&&(E[M]=Pe(Z,u)):Y<=u&&(a.expiredLanes|=Z),A&=~Z}}function ft(a){return a=a.pendingLanes&-1073741825,a!==0?a:a&1073741824?1073741824:0}function Ct(){var a=Oo;return Oo<<=1,(Oo&4194240)===0&&(Oo=64),a}function jt(a){for(var u=[],p=0;31>p;p++)u.push(a);return u}function an(a,u,p){a.pendingLanes|=u,u!==536870912&&(a.suspendedLanes=0,a.pingedLanes=0),a=a.eventTimes,u=31-Es(u),a[u]=p}function vt(a,u){var p=a.pendingLanes&~u;a.pendingLanes=u,a.suspendedLanes=0,a.pingedLanes=0,a.expiredLanes&=u,a.mutableReadLanes&=u,a.entangledLanes&=u,u=a.entanglements;var b=a.eventTimes;for(a=a.expirationTimes;0<p;){var E=31-Es(p),A=1<<E;u[E]=0,b[E]=-1,a[E]=-1,p&=~A}}function $n(a,u){var p=a.entangledLanes|=u;for(a=a.entanglements;p;){var b=31-Es(p),E=1<<b;E&u|a[b]&u&&(a[b]|=u),p&=~E}}var ot=0;function Gr(a){return a&=-a,1<a?4<a?(a&268435455)!==0?16:536870912:4:1}var va,$i,Mr,ul,qu,Gu=!1,B=[],fe=null,_e=null,ve=null,Ne=new Map,Le=new Map,yt=[],lt="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 Rn(a,u){switch(a){case"focusin":case"focusout":fe=null;break;case"dragenter":case"dragleave":_e=null;break;case"mouseover":case"mouseout":ve=null;break;case"pointerover":case"pointerout":Ne.delete(u.pointerId);break;case"gotpointercapture":case"lostpointercapture":Le.delete(u.pointerId)}}function kt(a,u,p,b,E,A){return a===null||a.nativeEvent!==A?(a={blockedOn:u,domEventName:p,eventSystemFlags:b,nativeEvent:A,targetContainers:[E]},u!==null&&(u=vh(u),u!==null&&$i(u)),a):(a.eventSystemFlags|=b,u=a.targetContainers,E!==null&&u.indexOf(E)===-1&&u.push(E),a)}function cs(a,u,p,b,E){switch(u){case"focusin":return fe=kt(fe,a,u,p,b,E),!0;case"dragenter":return _e=kt(_e,a,u,p,b,E),!0;case"mouseover":return ve=kt(ve,a,u,p,b,E),!0;case"pointerover":var A=E.pointerId;return Ne.set(A,kt(Ne.get(A)||null,a,u,p,b,E)),!0;case"gotpointercapture":return A=E.pointerId,Le.set(A,kt(Le.get(A)||null,a,u,p,b,E)),!0}return!1}function us(a){var u=Ic(a.target);if(u!==null){var p=qr(u);if(p!==null){if(u=p.tag,u===13){if(u=al(p),u!==null){a.blockedOn=u,qu(a.priority,function(){Mr(p)});return}}else if(u===3&&p.stateNode.current.memoizedState.isDehydrated){a.blockedOn=p.tag===3?p.stateNode.containerInfo:null;return}}}a.blockedOn=null}function Cs(a){if(a.blockedOn!==null)return!1;for(var u=a.targetContainers;0<u.length;){var p=yy(a.domEventName,a.eventSystemFlags,u[0],a.nativeEvent);if(p===null){p=a.nativeEvent;var b=new p.constructor(p.type,p);Un=b,p.target.dispatchEvent(b),Un=null}else return u=vh(p),u!==null&&$i(u),a.blockedOn=p,!1;u.shift()}return!0}function Jt(a,u,p){Cs(a)&&p.delete(u)}function En(){Gu=!1,fe!==null&&Cs(fe)&&(fe=null),_e!==null&&Cs(_e)&&(_e=null),ve!==null&&Cs(ve)&&(ve=null),Ne.forEach(Jt),Le.forEach(Jt)}function fr(a,u){a.blockedOn===u&&(a.blockedOn=null,Gu||(Gu=!0,e.unstable_scheduleCallback(e.unstable_NormalPriority,En)))}function dl(a){function u(E){return fr(E,a)}if(0<B.length){fr(B[0],a);for(var p=1;p<B.length;p++){var b=B[p];b.blockedOn===a&&(b.blockedOn=null)}}for(fe!==null&&fr(fe,a),_e!==null&&fr(_e,a),ve!==null&&fr(ve,a),Ne.forEach(u),Le.forEach(u),p=0;p<yt.length;p++)b=yt[p],b.blockedOn===a&&(b.blockedOn=null);for(;0<yt.length&&(p=yt[0],p.blockedOn===null);)us(p),p.blockedOn===null&&yt.shift()}var ji=C.ReactCurrentBatchConfig,Bm=!0;function Oz(a,u,p,b){var E=ot,A=ji.transition;ji.transition=null;try{ot=1,vy(a,u,p,b)}finally{ot=E,ji.transition=A}}function Mz(a,u,p,b){var E=ot,A=ji.transition;ji.transition=null;try{ot=4,vy(a,u,p,b)}finally{ot=E,ji.transition=A}}function vy(a,u,p,b){if(Bm){var E=yy(a,u,p,b);if(E===null)Ly(a,u,b,Zm,p),Rn(a,b);else if(cs(E,a,u,p,b))b.stopPropagation();else if(Rn(a,b),u&4&&-1<lt.indexOf(a)){for(;E!==null;){var A=vh(E);if(A!==null&&va(A),A=yy(a,u,p,b),A===null&&Ly(a,u,b,Zm,p),A===E)break;E=A}E!==null&&b.stopPropagation()}else Ly(a,u,b,null,p)}}var Zm=null;function yy(a,u,p,b){if(Zm=null,a=Oi(b),a=Ic(a),a!==null)if(u=qr(a),u===null)a=null;else if(p=u.tag,p===13){if(a=al(u),a!==null)return a;a=null}else if(p===3){if(u.stateNode.current.memoizedState.isDehydrated)return u.tag===3?u.stateNode.containerInfo:null;a=null}else u!==a&&(a=null);return Zm=a,null}function A6(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(ga()){case Di:return 1;case Io:return 4;case Or:case Zu:return 16;case Rc:return 536870912;default:return 16}default:return 16}}var fl=null,_y=null,Wm=null;function T6(){if(Wm)return Wm;var a,u=_y,p=u.length,b,E="value"in fl?fl.value:fl.textContent,A=E.length;for(a=0;a<p&&u[a]===E[a];a++);var M=p-a;for(b=1;b<=M&&u[p-b]===E[A-b];b++);return Wm=E.slice(a,1<b?1-b:void 0)}function qm(a){var u=a.keyCode;return"charCode"in a?(a=a.charCode,a===0&&u===13&&(a=13)):a=u,a===10&&(a=13),32<=a||a===13?a:0}function Gm(){return!0}function R6(){return!1}function ci(a){function u(p,b,E,A,M){this._reactName=p,this._targetInst=E,this.type=b,this.nativeEvent=A,this.target=M,this.currentTarget=null;for(var Z in a)a.hasOwnProperty(Z)&&(p=a[Z],this[Z]=p?p(A):A[Z]);return this.isDefaultPrevented=(A.defaultPrevented!=null?A.defaultPrevented:A.returnValue===!1)?Gm:R6,this.isPropagationStopped=R6,this}return U(u.prototype,{preventDefault:function(){this.defaultPrevented=!0;var p=this.nativeEvent;p&&(p.preventDefault?p.preventDefault():typeof p.returnValue!="unknown"&&(p.returnValue=!1),this.isDefaultPrevented=Gm)},stopPropagation:function(){var p=this.nativeEvent;p&&(p.stopPropagation?p.stopPropagation():typeof p.cancelBubble!="unknown"&&(p.cancelBubble=!0),this.isPropagationStopped=Gm)},persist:function(){},isPersistent:Gm}),u}var Ku={eventPhase:0,bubbles:0,cancelable:0,timeStamp:function(a){return a.timeStamp||Date.now()},defaultPrevented:0,isTrusted:0},wy=ci(Ku),oh=U({},Ku,{view:0,detail:0}),Nz=ci(oh),by,xy,ah,Km=U({},oh,{screenX:0,screenY:0,clientX:0,clientY:0,pageX:0,pageY:0,ctrlKey:0,shiftKey:0,altKey:0,metaKey:0,getModifierState:ky,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!==ah&&(ah&&a.type==="mousemove"?(by=a.screenX-ah.screenX,xy=a.screenY-ah.screenY):xy=by=0,ah=a),by)},movementY:function(a){return"movementY"in a?a.movementY:xy}}),I6=ci(Km),Lz=U({},Km,{dataTransfer:0}),Dz=ci(Lz),$z=U({},oh,{relatedTarget:0}),Sy=ci($z),jz=U({},Ku,{animationName:0,elapsedTime:0,pseudoElement:0}),Fz=ci(jz),zz=U({},Ku,{clipboardData:function(a){return"clipboardData"in a?a.clipboardData:window.clipboardData}}),Vz=ci(zz),Hz=U({},Ku,{data:0}),O6=ci(Hz),Uz={Esc:"Escape",Spacebar:" ",Left:"ArrowLeft",Up:"ArrowUp",Right:"ArrowRight",Down:"ArrowDown",Del:"Delete",Win:"OS",Menu:"ContextMenu",Apps:"ContextMenu",Scroll:"ScrollLock",MozPrintableKey:"Unidentified"},Bz={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"},Zz={Alt:"altKey",Control:"ctrlKey",Meta:"metaKey",Shift:"shiftKey"};function Wz(a){var u=this.nativeEvent;return u.getModifierState?u.getModifierState(a):(a=Zz[a])?!!u[a]:!1}function ky(){return Wz}var qz=U({},oh,{key:function(a){if(a.key){var u=Uz[a.key]||a.key;if(u!=="Unidentified")return u}return a.type==="keypress"?(a=qm(a),a===13?"Enter":String.fromCharCode(a)):a.type==="keydown"||a.type==="keyup"?Bz[a.keyCode]||"Unidentified":""},code:0,location:0,ctrlKey:0,shiftKey:0,altKey:0,metaKey:0,repeat:0,locale:0,getModifierState:ky,charCode:function(a){return a.type==="keypress"?qm(a):0},keyCode:function(a){return a.type==="keydown"||a.type==="keyup"?a.keyCode:0},which:function(a){return a.type==="keypress"?qm(a):a.type==="keydown"||a.type==="keyup"?a.keyCode:0}}),Gz=ci(qz),Kz=U({},Km,{pointerId:0,width:0,height:0,pressure:0,tangentialPressure:0,tiltX:0,tiltY:0,twist:0,pointerType:0,isPrimary:0}),M6=ci(Kz),Yz=U({},oh,{touches:0,targetTouches:0,changedTouches:0,altKey:0,metaKey:0,ctrlKey:0,shiftKey:0,getModifierState:ky}),Xz=ci(Yz),Qz=U({},Ku,{propertyName:0,elapsedTime:0,pseudoElement:0}),Jz=ci(Qz),eV=U({},Km,{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}),tV=ci(eV),nV=[9,13,27,32],Ey=l&&"CompositionEvent"in window,lh=null;l&&"documentMode"in document&&(lh=document.documentMode);var rV=l&&"TextEvent"in window&&!lh,N6=l&&(!Ey||lh&&8<lh&&11>=lh),L6=" ",D6=!1;function $6(a,u){switch(a){case"keyup":return nV.indexOf(u.keyCode)!==-1;case"keydown":return u.keyCode!==229;case"keypress":case"mousedown":case"focusout":return!0;default:return!1}}function j6(a){return a=a.detail,typeof a=="object"&&"data"in a?a.data:null}var Yu=!1;function sV(a,u){switch(a){case"compositionend":return j6(u);case"keypress":return u.which!==32?null:(D6=!0,L6);case"textInput":return a=u.data,a===L6&&D6?null:a;default:return null}}function iV(a,u){if(Yu)return a==="compositionend"||!Ey&&$6(a,u)?(a=T6(),Wm=_y=fl=null,Yu=!1,a):null;switch(a){case"paste":return null;case"keypress":if(!(u.ctrlKey||u.altKey||u.metaKey)||u.ctrlKey&&u.altKey){if(u.char&&1<u.char.length)return u.char;if(u.which)return String.fromCharCode(u.which)}return null;case"compositionend":return N6&&u.locale!=="ko"?null:u.data;default:return null}}var oV={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 F6(a){var u=a&&a.nodeName&&a.nodeName.toLowerCase();return u==="input"?!!oV[a.type]:u==="textarea"}function z6(a,u,p,b){Sr(b),u=e0(u,"onChange"),0<u.length&&(p=new wy("onChange","change",null,p,b),a.push({event:p,listeners:u}))}var ch=null,uh=null;function aV(a){sC(a,0)}function Ym(a){var u=td(a);if(ke(u))return a}function lV(a,u){if(a==="change")return u}var V6=!1;if(l){var Cy;if(l){var Py="oninput"in document;if(!Py){var H6=document.createElement("div");H6.setAttribute("oninput","return;"),Py=typeof H6.oninput=="function"}Cy=Py}else Cy=!1;V6=Cy&&(!document.documentMode||9<document.documentMode)}function U6(){ch&&(ch.detachEvent("onpropertychange",B6),uh=ch=null)}function B6(a){if(a.propertyName==="value"&&Ym(uh)){var u=[];z6(u,uh,a,Oi(a)),ln(aV,u)}}function cV(a,u,p){a==="focusin"?(U6(),ch=u,uh=p,ch.attachEvent("onpropertychange",B6)):a==="focusout"&&U6()}function uV(a){if(a==="selectionchange"||a==="keyup"||a==="keydown")return Ym(uh)}function dV(a,u){if(a==="click")return Ym(u)}function fV(a,u){if(a==="input"||a==="change")return Ym(u)}function hV(a,u){return a===u&&(a!==0||1/a===1/u)||a!==a&&u!==u}var oo=typeof Object.is=="function"?Object.is:hV;function dh(a,u){if(oo(a,u))return!0;if(typeof a!="object"||a===null||typeof u!="object"||u===null)return!1;var p=Object.keys(a),b=Object.keys(u);if(p.length!==b.length)return!1;for(b=0;b<p.length;b++){var E=p[b];if(!c.call(u,E)||!oo(a[E],u[E]))return!1}return!0}function Z6(a){for(;a&&a.firstChild;)a=a.firstChild;return a}function W6(a,u){var p=Z6(a);a=0;for(var b;p;){if(p.nodeType===3){if(b=a+p.textContent.length,a<=u&&b>=u)return{node:p,offset:u-a};a=b}e:{for(;p;){if(p.nextSibling){p=p.nextSibling;break e}p=p.parentNode}p=void 0}p=Z6(p)}}function q6(a,u){return a&&u?a===u?!0:a&&a.nodeType===3?!1:u&&u.nodeType===3?q6(a,u.parentNode):"contains"in a?a.contains(u):a.compareDocumentPosition?!!(a.compareDocumentPosition(u)&16):!1:!1}function G6(){for(var a=window,u=gt();u instanceof a.HTMLIFrameElement;){try{var p=typeof u.contentWindow.location.href=="string"}catch{p=!1}if(p)a=u.contentWindow;else break;u=gt(a.document)}return u}function Ay(a){var u=a&&a.nodeName&&a.nodeName.toLowerCase();return u&&(u==="input"&&(a.type==="text"||a.type==="search"||a.type==="tel"||a.type==="url"||a.type==="password")||u==="textarea"||a.contentEditable==="true")}function pV(a){var u=G6(),p=a.focusedElem,b=a.selectionRange;if(u!==p&&p&&p.ownerDocument&&q6(p.ownerDocument.documentElement,p)){if(b!==null&&Ay(p)){if(u=b.start,a=b.end,a===void 0&&(a=u),"selectionStart"in p)p.selectionStart=u,p.selectionEnd=Math.min(a,p.value.length);else if(a=(u=p.ownerDocument||document)&&u.defaultView||window,a.getSelection){a=a.getSelection();var E=p.textContent.length,A=Math.min(b.start,E);b=b.end===void 0?A:Math.min(b.end,E),!a.extend&&A>b&&(E=b,b=A,A=E),E=W6(p,A);var M=W6(p,b);E&&M&&(a.rangeCount!==1||a.anchorNode!==E.node||a.anchorOffset!==E.offset||a.focusNode!==M.node||a.focusOffset!==M.offset)&&(u=u.createRange(),u.setStart(E.node,E.offset),a.removeAllRanges(),A>b?(a.addRange(u),a.extend(M.node,M.offset)):(u.setEnd(M.node,M.offset),a.addRange(u)))}}for(u=[],a=p;a=a.parentNode;)a.nodeType===1&&u.push({element:a,left:a.scrollLeft,top:a.scrollTop});for(typeof p.focus=="function"&&p.focus(),p=0;p<u.length;p++)a=u[p],a.element.scrollLeft=a.left,a.element.scrollTop=a.top}}var mV=l&&"documentMode"in document&&11>=document.documentMode,Xu=null,Ty=null,fh=null,Ry=!1;function K6(a,u,p){var b=p.window===p?p.document:p.nodeType===9?p:p.ownerDocument;Ry||Xu==null||Xu!==gt(b)||(b=Xu,"selectionStart"in b&&Ay(b)?b={start:b.selectionStart,end:b.selectionEnd}:(b=(b.ownerDocument&&b.ownerDocument.defaultView||window).getSelection(),b={anchorNode:b.anchorNode,anchorOffset:b.anchorOffset,focusNode:b.focusNode,focusOffset:b.focusOffset}),fh&&dh(fh,b)||(fh=b,b=e0(Ty,"onSelect"),0<b.length&&(u=new wy("onSelect","select",null,u,p),a.push({event:u,listeners:b}),u.target=Xu)))}function Xm(a,u){var p={};return p[a.toLowerCase()]=u.toLowerCase(),p["Webkit"+a]="webkit"+u,p["Moz"+a]="moz"+u,p}var Qu={animationend:Xm("Animation","AnimationEnd"),animationiteration:Xm("Animation","AnimationIteration"),animationstart:Xm("Animation","AnimationStart"),transitionend:Xm("Transition","TransitionEnd")},Iy={},Y6={};l&&(Y6=document.createElement("div").style,"AnimationEvent"in window||(delete Qu.animationend.animation,delete Qu.animationiteration.animation,delete Qu.animationstart.animation),"TransitionEvent"in window||delete Qu.transitionend.transition);function Qm(a){if(Iy[a])return Iy[a];if(!Qu[a])return a;var u=Qu[a],p;for(p in u)if(u.hasOwnProperty(p)&&p in Y6)return Iy[a]=u[p];return a}var X6=Qm("animationend"),Q6=Qm("animationiteration"),J6=Qm("animationstart"),eC=Qm("transitionend"),tC=new Map,nC="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 hl(a,u){tC.set(a,u),i(u,[a])}for(var Oy=0;Oy<nC.length;Oy++){var My=nC[Oy],gV=My.toLowerCase(),vV=My[0].toUpperCase()+My.slice(1);hl(gV,"on"+vV)}hl(X6,"onAnimationEnd"),hl(Q6,"onAnimationIteration"),hl(J6,"onAnimationStart"),hl("dblclick","onDoubleClick"),hl("focusin","onFocus"),hl("focusout","onBlur"),hl(eC,"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 hh="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(" "),yV=new Set("cancel close invalid load scroll toggle".split(" ").concat(hh));function rC(a,u,p){var b=a.type||"unknown-event";a.currentTarget=p,li(b,u,void 0,a),a.currentTarget=null}function sC(a,u){u=(u&4)!==0;for(var p=0;p<a.length;p++){var b=a[p],E=b.event;b=b.listeners;e:{var A=void 0;if(u)for(var M=b.length-1;0<=M;M--){var Z=b[M],Y=Z.instance,ae=Z.currentTarget;if(Z=Z.listener,Y!==A&&E.isPropagationStopped())break e;rC(E,Z,ae),A=Y}else for(M=0;M<b.length;M++){if(Z=b[M],Y=Z.instance,ae=Z.currentTarget,Z=Z.listener,Y!==A&&E.isPropagationStopped())break e;rC(E,Z,ae),A=Y}}}if(Ut)throw a=Bn,Ut=!1,Bn=null,a}function In(a,u){var p=u[Vy];p===void 0&&(p=u[Vy]=new Set);var b=a+"__bubble";p.has(b)||(iC(u,a,2,!1),p.add(b))}function Ny(a,u,p){var b=0;u&&(b|=4),iC(p,a,b,u)}var Jm="_reactListening"+Math.random().toString(36).slice(2);function ph(a){if(!a[Jm]){a[Jm]=!0,r.forEach(function(p){p!=="selectionchange"&&(yV.has(p)||Ny(p,!1,a),Ny(p,!0,a))});var u=a.nodeType===9?a:a.ownerDocument;u===null||u[Jm]||(u[Jm]=!0,Ny("selectionchange",!1,u))}}function iC(a,u,p,b){switch(A6(u)){case 1:var E=Oz;break;case 4:E=Mz;break;default:E=vy}p=E.bind(null,u,p,a),E=void 0,!kn||u!=="touchstart"&&u!=="touchmove"&&u!=="wheel"||(E=!0),b?E!==void 0?a.addEventListener(u,p,{capture:!0,passive:E}):a.addEventListener(u,p,!0):E!==void 0?a.addEventListener(u,p,{passive:E}):a.addEventListener(u,p,!1)}function Ly(a,u,p,b,E){var A=b;if((u&1)===0&&(u&2)===0&&b!==null)e:for(;;){if(b===null)return;var M=b.tag;if(M===3||M===4){var Z=b.stateNode.containerInfo;if(Z===E||Z.nodeType===8&&Z.parentNode===E)break;if(M===4)for(M=b.return;M!==null;){var Y=M.tag;if((Y===3||Y===4)&&(Y=M.stateNode.containerInfo,Y===E||Y.nodeType===8&&Y.parentNode===E))return;M=M.return}for(;Z!==null;){if(M=Ic(Z),M===null)return;if(Y=M.tag,Y===5||Y===6){b=A=M;continue e}Z=Z.parentNode}}b=b.return}ln(function(){var ae=A,be=Oi(p),Ee=[];e:{var we=tC.get(a);if(we!==void 0){var De=wy,qe=a;switch(a){case"keypress":if(qm(p)===0)break e;case"keydown":case"keyup":De=Gz;break;case"focusin":qe="focus",De=Sy;break;case"focusout":qe="blur",De=Sy;break;case"beforeblur":case"afterblur":De=Sy;break;case"click":if(p.button===2)break e;case"auxclick":case"dblclick":case"mousedown":case"mousemove":case"mouseup":case"mouseout":case"mouseover":case"contextmenu":De=I6;break;case"drag":case"dragend":case"dragenter":case"dragexit":case"dragleave":case"dragover":case"dragstart":case"drop":De=Dz;break;case"touchcancel":case"touchend":case"touchmove":case"touchstart":De=Xz;break;case X6:case Q6:case J6:De=Fz;break;case eC:De=Jz;break;case"scroll":De=Nz;break;case"wheel":De=tV;break;case"copy":case"cut":case"paste":De=Vz;break;case"gotpointercapture":case"lostpointercapture":case"pointercancel":case"pointerdown":case"pointermove":case"pointerout":case"pointerover":case"pointerup":De=M6}var Ye=(u&4)!==0,or=!Ye&&a==="scroll",te=Ye?we!==null?we+"Capture":null:we;Ye=[];for(var J=ae,ne;J!==null;){ne=J;var Te=ne.stateNode;if(ne.tag===5&&Te!==null&&(ne=Te,te!==null&&(Te=Zr(J,te),Te!=null&&Ye.push(mh(J,Te,ne)))),or)break;J=J.return}0<Ye.length&&(we=new De(we,qe,null,p,be),Ee.push({event:we,listeners:Ye}))}}if((u&7)===0){e:{if(we=a==="mouseover"||a==="pointerover",De=a==="mouseout"||a==="pointerout",we&&p!==Un&&(qe=p.relatedTarget||p.fromElement)&&(Ic(qe)||qe[ya]))break e;if((De||we)&&(we=be.window===be?be:(we=be.ownerDocument)?we.defaultView||we.parentWindow:window,De?(qe=p.relatedTarget||p.toElement,De=ae,qe=qe?Ic(qe):null,qe!==null&&(or=qr(qe),qe!==or||qe.tag!==5&&qe.tag!==6)&&(qe=null)):(De=null,qe=ae),De!==qe)){if(Ye=I6,Te="onMouseLeave",te="onMouseEnter",J="mouse",(a==="pointerout"||a==="pointerover")&&(Ye=M6,Te="onPointerLeave",te="onPointerEnter",J="pointer"),or=De==null?we:td(De),ne=qe==null?we:td(qe),we=new Ye(Te,J+"leave",De,p,be),we.target=or,we.relatedTarget=ne,Te=null,Ic(be)===ae&&(Ye=new Ye(te,J+"enter",qe,p,be),Ye.target=ne,Ye.relatedTarget=or,Te=Ye),or=Te,De&&qe)t:{for(Ye=De,te=qe,J=0,ne=Ye;ne;ne=Ju(ne))J++;for(ne=0,Te=te;Te;Te=Ju(Te))ne++;for(;0<J-ne;)Ye=Ju(Ye),J--;for(;0<ne-J;)te=Ju(te),ne--;for(;J--;){if(Ye===te||te!==null&&Ye===te.alternate)break t;Ye=Ju(Ye),te=Ju(te)}Ye=null}else Ye=null;De!==null&&oC(Ee,we,De,Ye,!1),qe!==null&&or!==null&&oC(Ee,or,qe,Ye,!0)}}e:{if(we=ae?td(ae):window,De=we.nodeName&&we.nodeName.toLowerCase(),De==="select"||De==="input"&&we.type==="file")var Je=lV;else if(F6(we))if(V6)Je=fV;else{Je=uV;var ct=cV}else(De=we.nodeName)&&De.toLowerCase()==="input"&&(we.type==="checkbox"||we.type==="radio")&&(Je=dV);if(Je&&(Je=Je(a,ae))){z6(Ee,Je,p,be);break e}ct&&ct(a,we,ae),a==="focusout"&&(ct=we._wrapperState)&&ct.controlled&&we.type==="number"&&Be(we,"number",we.value)}switch(ct=ae?td(ae):window,a){case"focusin":(F6(ct)||ct.contentEditable==="true")&&(Xu=ct,Ty=ae,fh=null);break;case"focusout":fh=Ty=Xu=null;break;case"mousedown":Ry=!0;break;case"contextmenu":case"mouseup":case"dragend":Ry=!1,K6(Ee,p,be);break;case"selectionchange":if(mV)break;case"keydown":case"keyup":K6(Ee,p,be)}var ut;if(Ey)e:{switch(a){case"compositionstart":var pt="onCompositionStart";break e;case"compositionend":pt="onCompositionEnd";break e;case"compositionupdate":pt="onCompositionUpdate";break e}pt=void 0}else Yu?$6(a,p)&&(pt="onCompositionEnd"):a==="keydown"&&p.keyCode===229&&(pt="onCompositionStart");pt&&(N6&&p.locale!=="ko"&&(Yu||pt!=="onCompositionStart"?pt==="onCompositionEnd"&&Yu&&(ut=T6()):(fl=be,_y="value"in fl?fl.value:fl.textContent,Yu=!0)),ct=e0(ae,pt),0<ct.length&&(pt=new O6(pt,a,null,p,be),Ee.push({event:pt,listeners:ct}),ut?pt.data=ut:(ut=j6(p),ut!==null&&(pt.data=ut)))),(ut=rV?sV(a,p):iV(a,p))&&(ae=e0(ae,"onBeforeInput"),0<ae.length&&(be=new O6("onBeforeInput","beforeinput",null,p,be),Ee.push({event:be,listeners:ae}),be.data=ut))}sC(Ee,u)})}function mh(a,u,p){return{instance:a,listener:u,currentTarget:p}}function e0(a,u){for(var p=u+"Capture",b=[];a!==null;){var E=a,A=E.stateNode;E.tag===5&&A!==null&&(E=A,A=Zr(a,p),A!=null&&b.unshift(mh(a,A,E)),A=Zr(a,u),A!=null&&b.push(mh(a,A,E))),a=a.return}return b}function Ju(a){if(a===null)return null;do a=a.return;while(a&&a.tag!==5);return a||null}function oC(a,u,p,b,E){for(var A=u._reactName,M=[];p!==null&&p!==b;){var Z=p,Y=Z.alternate,ae=Z.stateNode;if(Y!==null&&Y===b)break;Z.tag===5&&ae!==null&&(Z=ae,E?(Y=Zr(p,A),Y!=null&&M.unshift(mh(p,Y,Z))):E||(Y=Zr(p,A),Y!=null&&M.push(mh(p,Y,Z)))),p=p.return}M.length!==0&&a.push({event:u,listeners:M})}var _V=/\r\n?/g,wV=/\u0000|\uFFFD/g;function aC(a){return(typeof a=="string"?a:""+a).replace(_V,`
|
|
98
|
-
`).replace(wV,"")}function t0(a,u,p){if(u=aC(u),aC(a)!==u&&p)throw Error(n(425))}function n0(){}var Dy=null,$y=null;function jy(a,u){return a==="textarea"||a==="noscript"||typeof u.children=="string"||typeof u.children=="number"||typeof u.dangerouslySetInnerHTML=="object"&&u.dangerouslySetInnerHTML!==null&&u.dangerouslySetInnerHTML.__html!=null}var Fy=typeof setTimeout=="function"?setTimeout:void 0,bV=typeof clearTimeout=="function"?clearTimeout:void 0,lC=typeof Promise=="function"?Promise:void 0,xV=typeof queueMicrotask=="function"?queueMicrotask:typeof lC<"u"?function(a){return lC.resolve(null).then(a).catch(SV)}:Fy;function SV(a){setTimeout(function(){throw a})}function zy(a,u){var p=u,b=0;do{var E=p.nextSibling;if(a.removeChild(p),E&&E.nodeType===8)if(p=E.data,p==="/$"){if(b===0){a.removeChild(E),dl(u);return}b--}else p!=="$"&&p!=="$?"&&p!=="$!"||b++;p=E}while(p);dl(u)}function pl(a){for(;a!=null;a=a.nextSibling){var u=a.nodeType;if(u===1||u===3)break;if(u===8){if(u=a.data,u==="$"||u==="$!"||u==="$?")break;if(u==="/$")return null}}return a}function cC(a){a=a.previousSibling;for(var u=0;a;){if(a.nodeType===8){var p=a.data;if(p==="$"||p==="$!"||p==="$?"){if(u===0)return a;u--}else p==="/$"&&u++}a=a.previousSibling}return null}var ed=Math.random().toString(36).slice(2),Mo="__reactFiber$"+ed,gh="__reactProps$"+ed,ya="__reactContainer$"+ed,Vy="__reactEvents$"+ed,kV="__reactListeners$"+ed,EV="__reactHandles$"+ed;function Ic(a){var u=a[Mo];if(u)return u;for(var p=a.parentNode;p;){if(u=p[ya]||p[Mo]){if(p=u.alternate,u.child!==null||p!==null&&p.child!==null)for(a=cC(a);a!==null;){if(p=a[Mo])return p;a=cC(a)}return u}a=p,p=a.parentNode}return null}function vh(a){return a=a[Mo]||a[ya],!a||a.tag!==5&&a.tag!==6&&a.tag!==13&&a.tag!==3?null:a}function td(a){if(a.tag===5||a.tag===6)return a.stateNode;throw Error(n(33))}function r0(a){return a[gh]||null}var Hy=[],nd=-1;function ml(a){return{current:a}}function On(a){0>nd||(a.current=Hy[nd],Hy[nd]=null,nd--)}function Cn(a,u){nd++,Hy[nd]=a.current,a.current=u}var gl={},ds=ml(gl),js=ml(!1),Oc=gl;function rd(a,u){var p=a.type.contextTypes;if(!p)return gl;var b=a.stateNode;if(b&&b.__reactInternalMemoizedUnmaskedChildContext===u)return b.__reactInternalMemoizedMaskedChildContext;var E={},A;for(A in p)E[A]=u[A];return b&&(a=a.stateNode,a.__reactInternalMemoizedUnmaskedChildContext=u,a.__reactInternalMemoizedMaskedChildContext=E),E}function Fs(a){return a=a.childContextTypes,a!=null}function s0(){On(js),On(ds)}function uC(a,u,p){if(ds.current!==gl)throw Error(n(168));Cn(ds,u),Cn(js,p)}function dC(a,u,p){var b=a.stateNode;if(u=u.childContextTypes,typeof b.getChildContext!="function")return p;b=b.getChildContext();for(var E in b)if(!(E in u))throw Error(n(108,xe(a)||"Unknown",E));return U({},p,b)}function i0(a){return a=(a=a.stateNode)&&a.__reactInternalMemoizedMergedChildContext||gl,Oc=ds.current,Cn(ds,a),Cn(js,js.current),!0}function fC(a,u,p){var b=a.stateNode;if(!b)throw Error(n(169));p?(a=dC(a,u,Oc),b.__reactInternalMemoizedMergedChildContext=a,On(js),On(ds),Cn(ds,a)):On(js),Cn(js,p)}var _a=null,o0=!1,Uy=!1;function hC(a){_a===null?_a=[a]:_a.push(a)}function CV(a){o0=!0,hC(a)}function vl(){if(!Uy&&_a!==null){Uy=!0;var a=0,u=ot;try{var p=_a;for(ot=1;a<p.length;a++){var b=p[a];do b=b(!0);while(b!==null)}_a=null,o0=!1}catch(E){throw _a!==null&&(_a=_a.slice(a+1)),To(Di,vl),E}finally{ot=u,Uy=!1}}return null}var sd=[],id=0,a0=null,l0=0,Fi=[],zi=0,Mc=null,wa=1,ba="";function Nc(a,u){sd[id++]=l0,sd[id++]=a0,a0=a,l0=u}function pC(a,u,p){Fi[zi++]=wa,Fi[zi++]=ba,Fi[zi++]=Mc,Mc=a;var b=wa;a=ba;var E=32-Es(b)-1;b&=~(1<<E),p+=1;var A=32-Es(u)+E;if(30<A){var M=E-E%5;A=(b&(1<<M)-1).toString(32),b>>=M,E-=M,wa=1<<32-Es(u)+E|p<<E|b,ba=A+a}else wa=1<<A|p<<E|b,ba=a}function By(a){a.return!==null&&(Nc(a,1),pC(a,1,0))}function Zy(a){for(;a===a0;)a0=sd[--id],sd[id]=null,l0=sd[--id],sd[id]=null;for(;a===Mc;)Mc=Fi[--zi],Fi[zi]=null,ba=Fi[--zi],Fi[zi]=null,wa=Fi[--zi],Fi[zi]=null}var ui=null,di=null,jn=!1,ao=null;function mC(a,u){var p=Bi(5,null,null,0);p.elementType="DELETED",p.stateNode=u,p.return=a,u=a.deletions,u===null?(a.deletions=[p],a.flags|=16):u.push(p)}function gC(a,u){switch(a.tag){case 5:var p=a.type;return u=u.nodeType!==1||p.toLowerCase()!==u.nodeName.toLowerCase()?null:u,u!==null?(a.stateNode=u,ui=a,di=pl(u.firstChild),!0):!1;case 6:return u=a.pendingProps===""||u.nodeType!==3?null:u,u!==null?(a.stateNode=u,ui=a,di=null,!0):!1;case 13:return u=u.nodeType!==8?null:u,u!==null?(p=Mc!==null?{id:wa,overflow:ba}:null,a.memoizedState={dehydrated:u,treeContext:p,retryLane:1073741824},p=Bi(18,null,null,0),p.stateNode=u,p.return=a,a.child=p,ui=a,di=null,!0):!1;default:return!1}}function Wy(a){return(a.mode&1)!==0&&(a.flags&128)===0}function qy(a){if(jn){var u=di;if(u){var p=u;if(!gC(a,u)){if(Wy(a))throw Error(n(418));u=pl(p.nextSibling);var b=ui;u&&gC(a,u)?mC(b,p):(a.flags=a.flags&-4097|2,jn=!1,ui=a)}}else{if(Wy(a))throw Error(n(418));a.flags=a.flags&-4097|2,jn=!1,ui=a}}}function vC(a){for(a=a.return;a!==null&&a.tag!==5&&a.tag!==3&&a.tag!==13;)a=a.return;ui=a}function c0(a){if(a!==ui)return!1;if(!jn)return vC(a),jn=!0,!1;var u;if((u=a.tag!==3)&&!(u=a.tag!==5)&&(u=a.type,u=u!=="head"&&u!=="body"&&!jy(a.type,a.memoizedProps)),u&&(u=di)){if(Wy(a))throw yC(),Error(n(418));for(;u;)mC(a,u),u=pl(u.nextSibling)}if(vC(a),a.tag===13){if(a=a.memoizedState,a=a!==null?a.dehydrated:null,!a)throw Error(n(317));e:{for(a=a.nextSibling,u=0;a;){if(a.nodeType===8){var p=a.data;if(p==="/$"){if(u===0){di=pl(a.nextSibling);break e}u--}else p!=="$"&&p!=="$!"&&p!=="$?"||u++}a=a.nextSibling}di=null}}else di=ui?pl(a.stateNode.nextSibling):null;return!0}function yC(){for(var a=di;a;)a=pl(a.nextSibling)}function od(){di=ui=null,jn=!1}function Gy(a){ao===null?ao=[a]:ao.push(a)}var PV=C.ReactCurrentBatchConfig;function yh(a,u,p){if(a=p.ref,a!==null&&typeof a!="function"&&typeof a!="object"){if(p._owner){if(p=p._owner,p){if(p.tag!==1)throw Error(n(309));var b=p.stateNode}if(!b)throw Error(n(147,a));var E=b,A=""+a;return u!==null&&u.ref!==null&&typeof u.ref=="function"&&u.ref._stringRef===A?u.ref:(u=function(M){var Z=E.refs;M===null?delete Z[A]:Z[A]=M},u._stringRef=A,u)}if(typeof a!="string")throw Error(n(284));if(!p._owner)throw Error(n(290,a))}return a}function u0(a,u){throw a=Object.prototype.toString.call(u),Error(n(31,a==="[object Object]"?"object with keys {"+Object.keys(u).join(", ")+"}":a))}function _C(a){var u=a._init;return u(a._payload)}function wC(a){function u(te,J){if(a){var ne=te.deletions;ne===null?(te.deletions=[J],te.flags|=16):ne.push(J)}}function p(te,J){if(!a)return null;for(;J!==null;)u(te,J),J=J.sibling;return null}function b(te,J){for(te=new Map;J!==null;)J.key!==null?te.set(J.key,J):te.set(J.index,J),J=J.sibling;return te}function E(te,J){return te=El(te,J),te.index=0,te.sibling=null,te}function A(te,J,ne){return te.index=ne,a?(ne=te.alternate,ne!==null?(ne=ne.index,ne<J?(te.flags|=2,J):ne):(te.flags|=2,J)):(te.flags|=1048576,J)}function M(te){return a&&te.alternate===null&&(te.flags|=2),te}function Z(te,J,ne,Te){return J===null||J.tag!==6?(J=F_(ne,te.mode,Te),J.return=te,J):(J=E(J,ne),J.return=te,J)}function Y(te,J,ne,Te){var Je=ne.type;return Je===I?be(te,J,ne.props.children,Te,ne.key):J!==null&&(J.elementType===Je||typeof Je=="object"&&Je!==null&&Je.$$typeof===H&&_C(Je)===J.type)?(Te=E(J,ne.props),Te.ref=yh(te,J,ne),Te.return=te,Te):(Te=N0(ne.type,ne.key,ne.props,null,te.mode,Te),Te.ref=yh(te,J,ne),Te.return=te,Te)}function ae(te,J,ne,Te){return J===null||J.tag!==4||J.stateNode.containerInfo!==ne.containerInfo||J.stateNode.implementation!==ne.implementation?(J=z_(ne,te.mode,Te),J.return=te,J):(J=E(J,ne.children||[]),J.return=te,J)}function be(te,J,ne,Te,Je){return J===null||J.tag!==7?(J=Hc(ne,te.mode,Te,Je),J.return=te,J):(J=E(J,ne),J.return=te,J)}function Ee(te,J,ne){if(typeof J=="string"&&J!==""||typeof J=="number")return J=F_(""+J,te.mode,ne),J.return=te,J;if(typeof J=="object"&&J!==null){switch(J.$$typeof){case T:return ne=N0(J.type,J.key,J.props,null,te.mode,ne),ne.ref=yh(te,null,J),ne.return=te,ne;case O:return J=z_(J,te.mode,ne),J.return=te,J;case H:var Te=J._init;return Ee(te,Te(J._payload),ne)}if(je(J)||Q(J))return J=Hc(J,te.mode,ne,null),J.return=te,J;u0(te,J)}return null}function we(te,J,ne,Te){var Je=J!==null?J.key:null;if(typeof ne=="string"&&ne!==""||typeof ne=="number")return Je!==null?null:Z(te,J,""+ne,Te);if(typeof ne=="object"&&ne!==null){switch(ne.$$typeof){case T:return ne.key===Je?Y(te,J,ne,Te):null;case O:return ne.key===Je?ae(te,J,ne,Te):null;case H:return Je=ne._init,we(te,J,Je(ne._payload),Te)}if(je(ne)||Q(ne))return Je!==null?null:be(te,J,ne,Te,null);u0(te,ne)}return null}function De(te,J,ne,Te,Je){if(typeof Te=="string"&&Te!==""||typeof Te=="number")return te=te.get(ne)||null,Z(J,te,""+Te,Je);if(typeof Te=="object"&&Te!==null){switch(Te.$$typeof){case T:return te=te.get(Te.key===null?ne:Te.key)||null,Y(J,te,Te,Je);case O:return te=te.get(Te.key===null?ne:Te.key)||null,ae(J,te,Te,Je);case H:var ct=Te._init;return De(te,J,ne,ct(Te._payload),Je)}if(je(Te)||Q(Te))return te=te.get(ne)||null,be(J,te,Te,Je,null);u0(J,Te)}return null}function qe(te,J,ne,Te){for(var Je=null,ct=null,ut=J,pt=J=0,Dr=null;ut!==null&&pt<ne.length;pt++){ut.index>pt?(Dr=ut,ut=null):Dr=ut.sibling;var en=we(te,ut,ne[pt],Te);if(en===null){ut===null&&(ut=Dr);break}a&&ut&&en.alternate===null&&u(te,ut),J=A(en,J,pt),ct===null?Je=en:ct.sibling=en,ct=en,ut=Dr}if(pt===ne.length)return p(te,ut),jn&&Nc(te,pt),Je;if(ut===null){for(;pt<ne.length;pt++)ut=Ee(te,ne[pt],Te),ut!==null&&(J=A(ut,J,pt),ct===null?Je=ut:ct.sibling=ut,ct=ut);return jn&&Nc(te,pt),Je}for(ut=b(te,ut);pt<ne.length;pt++)Dr=De(ut,te,pt,ne[pt],Te),Dr!==null&&(a&&Dr.alternate!==null&&ut.delete(Dr.key===null?pt:Dr.key),J=A(Dr,J,pt),ct===null?Je=Dr:ct.sibling=Dr,ct=Dr);return a&&ut.forEach(function(Cl){return u(te,Cl)}),jn&&Nc(te,pt),Je}function Ye(te,J,ne,Te){var Je=Q(ne);if(typeof Je!="function")throw Error(n(150));if(ne=Je.call(ne),ne==null)throw Error(n(151));for(var ct=Je=null,ut=J,pt=J=0,Dr=null,en=ne.next();ut!==null&&!en.done;pt++,en=ne.next()){ut.index>pt?(Dr=ut,ut=null):Dr=ut.sibling;var Cl=we(te,ut,en.value,Te);if(Cl===null){ut===null&&(ut=Dr);break}a&&ut&&Cl.alternate===null&&u(te,ut),J=A(Cl,J,pt),ct===null?Je=Cl:ct.sibling=Cl,ct=Cl,ut=Dr}if(en.done)return p(te,ut),jn&&Nc(te,pt),Je;if(ut===null){for(;!en.done;pt++,en=ne.next())en=Ee(te,en.value,Te),en!==null&&(J=A(en,J,pt),ct===null?Je=en:ct.sibling=en,ct=en);return jn&&Nc(te,pt),Je}for(ut=b(te,ut);!en.done;pt++,en=ne.next())en=De(ut,te,pt,en.value,Te),en!==null&&(a&&en.alternate!==null&&ut.delete(en.key===null?pt:en.key),J=A(en,J,pt),ct===null?Je=en:ct.sibling=en,ct=en);return a&&ut.forEach(function(oH){return u(te,oH)}),jn&&Nc(te,pt),Je}function or(te,J,ne,Te){if(typeof ne=="object"&&ne!==null&&ne.type===I&&ne.key===null&&(ne=ne.props.children),typeof ne=="object"&&ne!==null){switch(ne.$$typeof){case T:e:{for(var Je=ne.key,ct=J;ct!==null;){if(ct.key===Je){if(Je=ne.type,Je===I){if(ct.tag===7){p(te,ct.sibling),J=E(ct,ne.props.children),J.return=te,te=J;break e}}else if(ct.elementType===Je||typeof Je=="object"&&Je!==null&&Je.$$typeof===H&&_C(Je)===ct.type){p(te,ct.sibling),J=E(ct,ne.props),J.ref=yh(te,ct,ne),J.return=te,te=J;break e}p(te,ct);break}else u(te,ct);ct=ct.sibling}ne.type===I?(J=Hc(ne.props.children,te.mode,Te,ne.key),J.return=te,te=J):(Te=N0(ne.type,ne.key,ne.props,null,te.mode,Te),Te.ref=yh(te,J,ne),Te.return=te,te=Te)}return M(te);case O:e:{for(ct=ne.key;J!==null;){if(J.key===ct)if(J.tag===4&&J.stateNode.containerInfo===ne.containerInfo&&J.stateNode.implementation===ne.implementation){p(te,J.sibling),J=E(J,ne.children||[]),J.return=te,te=J;break e}else{p(te,J);break}else u(te,J);J=J.sibling}J=z_(ne,te.mode,Te),J.return=te,te=J}return M(te);case H:return ct=ne._init,or(te,J,ct(ne._payload),Te)}if(je(ne))return qe(te,J,ne,Te);if(Q(ne))return Ye(te,J,ne,Te);u0(te,ne)}return typeof ne=="string"&&ne!==""||typeof ne=="number"?(ne=""+ne,J!==null&&J.tag===6?(p(te,J.sibling),J=E(J,ne),J.return=te,te=J):(p(te,J),J=F_(ne,te.mode,Te),J.return=te,te=J),M(te)):p(te,J)}return or}var ad=wC(!0),bC=wC(!1),d0=ml(null),f0=null,ld=null,Ky=null;function Yy(){Ky=ld=f0=null}function Xy(a){var u=d0.current;On(d0),a._currentValue=u}function Qy(a,u,p){for(;a!==null;){var b=a.alternate;if((a.childLanes&u)!==u?(a.childLanes|=u,b!==null&&(b.childLanes|=u)):b!==null&&(b.childLanes&u)!==u&&(b.childLanes|=u),a===p)break;a=a.return}}function cd(a,u){f0=a,Ky=ld=null,a=a.dependencies,a!==null&&a.firstContext!==null&&((a.lanes&u)!==0&&(zs=!0),a.firstContext=null)}function Vi(a){var u=a._currentValue;if(Ky!==a)if(a={context:a,memoizedValue:u,next:null},ld===null){if(f0===null)throw Error(n(308));ld=a,f0.dependencies={lanes:0,firstContext:a}}else ld=ld.next=a;return u}var Lc=null;function Jy(a){Lc===null?Lc=[a]:Lc.push(a)}function xC(a,u,p,b){var E=u.interleaved;return E===null?(p.next=p,Jy(u)):(p.next=E.next,E.next=p),u.interleaved=p,xa(a,b)}function xa(a,u){a.lanes|=u;var p=a.alternate;for(p!==null&&(p.lanes|=u),p=a,a=a.return;a!==null;)a.childLanes|=u,p=a.alternate,p!==null&&(p.childLanes|=u),p=a,a=a.return;return p.tag===3?p.stateNode:null}var yl=!1;function e_(a){a.updateQueue={baseState:a.memoizedState,firstBaseUpdate:null,lastBaseUpdate:null,shared:{pending:null,interleaved:null,lanes:0},effects:null}}function SC(a,u){a=a.updateQueue,u.updateQueue===a&&(u.updateQueue={baseState:a.baseState,firstBaseUpdate:a.firstBaseUpdate,lastBaseUpdate:a.lastBaseUpdate,shared:a.shared,effects:a.effects})}function Sa(a,u){return{eventTime:a,lane:u,tag:0,payload:null,callback:null,next:null}}function _l(a,u,p){var b=a.updateQueue;if(b===null)return null;if(b=b.shared,(Kt&2)!==0){var E=b.pending;return E===null?u.next=u:(u.next=E.next,E.next=u),b.pending=u,xa(a,p)}return E=b.interleaved,E===null?(u.next=u,Jy(b)):(u.next=E.next,E.next=u),b.interleaved=u,xa(a,p)}function h0(a,u,p){if(u=u.updateQueue,u!==null&&(u=u.shared,(p&4194240)!==0)){var b=u.lanes;b&=a.pendingLanes,p|=b,u.lanes=p,$n(a,p)}}function kC(a,u){var p=a.updateQueue,b=a.alternate;if(b!==null&&(b=b.updateQueue,p===b)){var E=null,A=null;if(p=p.firstBaseUpdate,p!==null){do{var M={eventTime:p.eventTime,lane:p.lane,tag:p.tag,payload:p.payload,callback:p.callback,next:null};A===null?E=A=M:A=A.next=M,p=p.next}while(p!==null);A===null?E=A=u:A=A.next=u}else E=A=u;p={baseState:b.baseState,firstBaseUpdate:E,lastBaseUpdate:A,shared:b.shared,effects:b.effects},a.updateQueue=p;return}a=p.lastBaseUpdate,a===null?p.firstBaseUpdate=u:a.next=u,p.lastBaseUpdate=u}function p0(a,u,p,b){var E=a.updateQueue;yl=!1;var A=E.firstBaseUpdate,M=E.lastBaseUpdate,Z=E.shared.pending;if(Z!==null){E.shared.pending=null;var Y=Z,ae=Y.next;Y.next=null,M===null?A=ae:M.next=ae,M=Y;var be=a.alternate;be!==null&&(be=be.updateQueue,Z=be.lastBaseUpdate,Z!==M&&(Z===null?be.firstBaseUpdate=ae:Z.next=ae,be.lastBaseUpdate=Y))}if(A!==null){var Ee=E.baseState;M=0,be=ae=Y=null,Z=A;do{var we=Z.lane,De=Z.eventTime;if((b&we)===we){be!==null&&(be=be.next={eventTime:De,lane:0,tag:Z.tag,payload:Z.payload,callback:Z.callback,next:null});e:{var qe=a,Ye=Z;switch(we=u,De=p,Ye.tag){case 1:if(qe=Ye.payload,typeof qe=="function"){Ee=qe.call(De,Ee,we);break e}Ee=qe;break e;case 3:qe.flags=qe.flags&-65537|128;case 0:if(qe=Ye.payload,we=typeof qe=="function"?qe.call(De,Ee,we):qe,we==null)break e;Ee=U({},Ee,we);break e;case 2:yl=!0}}Z.callback!==null&&Z.lane!==0&&(a.flags|=64,we=E.effects,we===null?E.effects=[Z]:we.push(Z))}else De={eventTime:De,lane:we,tag:Z.tag,payload:Z.payload,callback:Z.callback,next:null},be===null?(ae=be=De,Y=Ee):be=be.next=De,M|=we;if(Z=Z.next,Z===null){if(Z=E.shared.pending,Z===null)break;we=Z,Z=we.next,we.next=null,E.lastBaseUpdate=we,E.shared.pending=null}}while(!0);if(be===null&&(Y=Ee),E.baseState=Y,E.firstBaseUpdate=ae,E.lastBaseUpdate=be,u=E.shared.interleaved,u!==null){E=u;do M|=E.lane,E=E.next;while(E!==u)}else A===null&&(E.shared.lanes=0);jc|=M,a.lanes=M,a.memoizedState=Ee}}function EC(a,u,p){if(a=u.effects,u.effects=null,a!==null)for(u=0;u<a.length;u++){var b=a[u],E=b.callback;if(E!==null){if(b.callback=null,b=p,typeof E!="function")throw Error(n(191,E));E.call(b)}}}var _h={},No=ml(_h),wh=ml(_h),bh=ml(_h);function Dc(a){if(a===_h)throw Error(n(174));return a}function t_(a,u){switch(Cn(bh,u),Cn(wh,a),Cn(No,_h),a=u.nodeType,a){case 9:case 11:u=(u=u.documentElement)?u.namespaceURI:Et(null,"");break;default:a=a===8?u.parentNode:u,u=a.namespaceURI||null,a=a.tagName,u=Et(u,a)}On(No),Cn(No,u)}function ud(){On(No),On(wh),On(bh)}function CC(a){Dc(bh.current);var u=Dc(No.current),p=Et(u,a.type);u!==p&&(Cn(wh,a),Cn(No,p))}function n_(a){wh.current===a&&(On(No),On(wh))}var Zn=ml(0);function m0(a){for(var u=a;u!==null;){if(u.tag===13){var p=u.memoizedState;if(p!==null&&(p=p.dehydrated,p===null||p.data==="$?"||p.data==="$!"))return u}else if(u.tag===19&&u.memoizedProps.revealOrder!==void 0){if((u.flags&128)!==0)return u}else if(u.child!==null){u.child.return=u,u=u.child;continue}if(u===a)break;for(;u.sibling===null;){if(u.return===null||u.return===a)return null;u=u.return}u.sibling.return=u.return,u=u.sibling}return null}var r_=[];function s_(){for(var a=0;a<r_.length;a++)r_[a]._workInProgressVersionPrimary=null;r_.length=0}var g0=C.ReactCurrentDispatcher,i_=C.ReactCurrentBatchConfig,$c=0,Wn=null,Er=null,Nr=null,v0=!1,xh=!1,Sh=0,AV=0;function fs(){throw Error(n(321))}function o_(a,u){if(u===null)return!1;for(var p=0;p<u.length&&p<a.length;p++)if(!oo(a[p],u[p]))return!1;return!0}function a_(a,u,p,b,E,A){if($c=A,Wn=u,u.memoizedState=null,u.updateQueue=null,u.lanes=0,g0.current=a===null||a.memoizedState===null?OV:MV,a=p(b,E),xh){A=0;do{if(xh=!1,Sh=0,25<=A)throw Error(n(301));A+=1,Nr=Er=null,u.updateQueue=null,g0.current=NV,a=p(b,E)}while(xh)}if(g0.current=w0,u=Er!==null&&Er.next!==null,$c=0,Nr=Er=Wn=null,v0=!1,u)throw Error(n(300));return a}function l_(){var a=Sh!==0;return Sh=0,a}function Lo(){var a={memoizedState:null,baseState:null,baseQueue:null,queue:null,next:null};return Nr===null?Wn.memoizedState=Nr=a:Nr=Nr.next=a,Nr}function Hi(){if(Er===null){var a=Wn.alternate;a=a!==null?a.memoizedState:null}else a=Er.next;var u=Nr===null?Wn.memoizedState:Nr.next;if(u!==null)Nr=u,Er=a;else{if(a===null)throw Error(n(310));Er=a,a={memoizedState:Er.memoizedState,baseState:Er.baseState,baseQueue:Er.baseQueue,queue:Er.queue,next:null},Nr===null?Wn.memoizedState=Nr=a:Nr=Nr.next=a}return Nr}function kh(a,u){return typeof u=="function"?u(a):u}function c_(a){var u=Hi(),p=u.queue;if(p===null)throw Error(n(311));p.lastRenderedReducer=a;var b=Er,E=b.baseQueue,A=p.pending;if(A!==null){if(E!==null){var M=E.next;E.next=A.next,A.next=M}b.baseQueue=E=A,p.pending=null}if(E!==null){A=E.next,b=b.baseState;var Z=M=null,Y=null,ae=A;do{var be=ae.lane;if(($c&be)===be)Y!==null&&(Y=Y.next={lane:0,action:ae.action,hasEagerState:ae.hasEagerState,eagerState:ae.eagerState,next:null}),b=ae.hasEagerState?ae.eagerState:a(b,ae.action);else{var Ee={lane:be,action:ae.action,hasEagerState:ae.hasEagerState,eagerState:ae.eagerState,next:null};Y===null?(Z=Y=Ee,M=b):Y=Y.next=Ee,Wn.lanes|=be,jc|=be}ae=ae.next}while(ae!==null&&ae!==A);Y===null?M=b:Y.next=Z,oo(b,u.memoizedState)||(zs=!0),u.memoizedState=b,u.baseState=M,u.baseQueue=Y,p.lastRenderedState=b}if(a=p.interleaved,a!==null){E=a;do A=E.lane,Wn.lanes|=A,jc|=A,E=E.next;while(E!==a)}else E===null&&(p.lanes=0);return[u.memoizedState,p.dispatch]}function u_(a){var u=Hi(),p=u.queue;if(p===null)throw Error(n(311));p.lastRenderedReducer=a;var b=p.dispatch,E=p.pending,A=u.memoizedState;if(E!==null){p.pending=null;var M=E=E.next;do A=a(A,M.action),M=M.next;while(M!==E);oo(A,u.memoizedState)||(zs=!0),u.memoizedState=A,u.baseQueue===null&&(u.baseState=A),p.lastRenderedState=A}return[A,b]}function PC(){}function AC(a,u){var p=Wn,b=Hi(),E=u(),A=!oo(b.memoizedState,E);if(A&&(b.memoizedState=E,zs=!0),b=b.queue,d_(IC.bind(null,p,b,a),[a]),b.getSnapshot!==u||A||Nr!==null&&Nr.memoizedState.tag&1){if(p.flags|=2048,Eh(9,RC.bind(null,p,b,E,u),void 0,null),Lr===null)throw Error(n(349));($c&30)!==0||TC(p,u,E)}return E}function TC(a,u,p){a.flags|=16384,a={getSnapshot:u,value:p},u=Wn.updateQueue,u===null?(u={lastEffect:null,stores:null},Wn.updateQueue=u,u.stores=[a]):(p=u.stores,p===null?u.stores=[a]:p.push(a))}function RC(a,u,p,b){u.value=p,u.getSnapshot=b,OC(u)&&MC(a)}function IC(a,u,p){return p(function(){OC(u)&&MC(a)})}function OC(a){var u=a.getSnapshot;a=a.value;try{var p=u();return!oo(a,p)}catch{return!0}}function MC(a){var u=xa(a,1);u!==null&&fo(u,a,1,-1)}function NC(a){var u=Lo();return typeof a=="function"&&(a=a()),u.memoizedState=u.baseState=a,a={pending:null,interleaved:null,lanes:0,dispatch:null,lastRenderedReducer:kh,lastRenderedState:a},u.queue=a,a=a.dispatch=IV.bind(null,Wn,a),[u.memoizedState,a]}function Eh(a,u,p,b){return a={tag:a,create:u,destroy:p,deps:b,next:null},u=Wn.updateQueue,u===null?(u={lastEffect:null,stores:null},Wn.updateQueue=u,u.lastEffect=a.next=a):(p=u.lastEffect,p===null?u.lastEffect=a.next=a:(b=p.next,p.next=a,a.next=b,u.lastEffect=a)),a}function LC(){return Hi().memoizedState}function y0(a,u,p,b){var E=Lo();Wn.flags|=a,E.memoizedState=Eh(1|u,p,void 0,b===void 0?null:b)}function _0(a,u,p,b){var E=Hi();b=b===void 0?null:b;var A=void 0;if(Er!==null){var M=Er.memoizedState;if(A=M.destroy,b!==null&&o_(b,M.deps)){E.memoizedState=Eh(u,p,A,b);return}}Wn.flags|=a,E.memoizedState=Eh(1|u,p,A,b)}function DC(a,u){return y0(8390656,8,a,u)}function d_(a,u){return _0(2048,8,a,u)}function $C(a,u){return _0(4,2,a,u)}function jC(a,u){return _0(4,4,a,u)}function FC(a,u){if(typeof u=="function")return a=a(),u(a),function(){u(null)};if(u!=null)return a=a(),u.current=a,function(){u.current=null}}function zC(a,u,p){return p=p!=null?p.concat([a]):null,_0(4,4,FC.bind(null,u,a),p)}function f_(){}function VC(a,u){var p=Hi();u=u===void 0?null:u;var b=p.memoizedState;return b!==null&&u!==null&&o_(u,b[1])?b[0]:(p.memoizedState=[a,u],a)}function HC(a,u){var p=Hi();u=u===void 0?null:u;var b=p.memoizedState;return b!==null&&u!==null&&o_(u,b[1])?b[0]:(a=a(),p.memoizedState=[a,u],a)}function UC(a,u,p){return($c&21)===0?(a.baseState&&(a.baseState=!1,zs=!0),a.memoizedState=p):(oo(p,u)||(p=Ct(),Wn.lanes|=p,jc|=p,a.baseState=!0),u)}function TV(a,u){var p=ot;ot=p!==0&&4>p?p:4,a(!0);var b=i_.transition;i_.transition={};try{a(!1),u()}finally{ot=p,i_.transition=b}}function BC(){return Hi().memoizedState}function RV(a,u,p){var b=Sl(a);if(p={lane:b,action:p,hasEagerState:!1,eagerState:null,next:null},ZC(a))WC(u,p);else if(p=xC(a,u,p,b),p!==null){var E=As();fo(p,a,b,E),qC(p,u,b)}}function IV(a,u,p){var b=Sl(a),E={lane:b,action:p,hasEagerState:!1,eagerState:null,next:null};if(ZC(a))WC(u,E);else{var A=a.alternate;if(a.lanes===0&&(A===null||A.lanes===0)&&(A=u.lastRenderedReducer,A!==null))try{var M=u.lastRenderedState,Z=A(M,p);if(E.hasEagerState=!0,E.eagerState=Z,oo(Z,M)){var Y=u.interleaved;Y===null?(E.next=E,Jy(u)):(E.next=Y.next,Y.next=E),u.interleaved=E;return}}catch{}finally{}p=xC(a,u,E,b),p!==null&&(E=As(),fo(p,a,b,E),qC(p,u,b))}}function ZC(a){var u=a.alternate;return a===Wn||u!==null&&u===Wn}function WC(a,u){xh=v0=!0;var p=a.pending;p===null?u.next=u:(u.next=p.next,p.next=u),a.pending=u}function qC(a,u,p){if((p&4194240)!==0){var b=u.lanes;b&=a.pendingLanes,p|=b,u.lanes=p,$n(a,p)}}var w0={readContext:Vi,useCallback:fs,useContext:fs,useEffect:fs,useImperativeHandle:fs,useInsertionEffect:fs,useLayoutEffect:fs,useMemo:fs,useReducer:fs,useRef:fs,useState:fs,useDebugValue:fs,useDeferredValue:fs,useTransition:fs,useMutableSource:fs,useSyncExternalStore:fs,useId:fs,unstable_isNewReconciler:!1},OV={readContext:Vi,useCallback:function(a,u){return Lo().memoizedState=[a,u===void 0?null:u],a},useContext:Vi,useEffect:DC,useImperativeHandle:function(a,u,p){return p=p!=null?p.concat([a]):null,y0(4194308,4,FC.bind(null,u,a),p)},useLayoutEffect:function(a,u){return y0(4194308,4,a,u)},useInsertionEffect:function(a,u){return y0(4,2,a,u)},useMemo:function(a,u){var p=Lo();return u=u===void 0?null:u,a=a(),p.memoizedState=[a,u],a},useReducer:function(a,u,p){var b=Lo();return u=p!==void 0?p(u):u,b.memoizedState=b.baseState=u,a={pending:null,interleaved:null,lanes:0,dispatch:null,lastRenderedReducer:a,lastRenderedState:u},b.queue=a,a=a.dispatch=RV.bind(null,Wn,a),[b.memoizedState,a]},useRef:function(a){var u=Lo();return a={current:a},u.memoizedState=a},useState:NC,useDebugValue:f_,useDeferredValue:function(a){return Lo().memoizedState=a},useTransition:function(){var a=NC(!1),u=a[0];return a=TV.bind(null,a[1]),Lo().memoizedState=a,[u,a]},useMutableSource:function(){},useSyncExternalStore:function(a,u,p){var b=Wn,E=Lo();if(jn){if(p===void 0)throw Error(n(407));p=p()}else{if(p=u(),Lr===null)throw Error(n(349));($c&30)!==0||TC(b,u,p)}E.memoizedState=p;var A={value:p,getSnapshot:u};return E.queue=A,DC(IC.bind(null,b,A,a),[a]),b.flags|=2048,Eh(9,RC.bind(null,b,A,p,u),void 0,null),p},useId:function(){var a=Lo(),u=Lr.identifierPrefix;if(jn){var p=ba,b=wa;p=(b&~(1<<32-Es(b)-1)).toString(32)+p,u=":"+u+"R"+p,p=Sh++,0<p&&(u+="H"+p.toString(32)),u+=":"}else p=AV++,u=":"+u+"r"+p.toString(32)+":";return a.memoizedState=u},unstable_isNewReconciler:!1},MV={readContext:Vi,useCallback:VC,useContext:Vi,useEffect:d_,useImperativeHandle:zC,useInsertionEffect:$C,useLayoutEffect:jC,useMemo:HC,useReducer:c_,useRef:LC,useState:function(){return c_(kh)},useDebugValue:f_,useDeferredValue:function(a){var u=Hi();return UC(u,Er.memoizedState,a)},useTransition:function(){var a=c_(kh)[0],u=Hi().memoizedState;return[a,u]},useMutableSource:PC,useSyncExternalStore:AC,useId:BC,unstable_isNewReconciler:!1},NV={readContext:Vi,useCallback:VC,useContext:Vi,useEffect:d_,useImperativeHandle:zC,useInsertionEffect:$C,useLayoutEffect:jC,useMemo:HC,useReducer:u_,useRef:LC,useState:function(){return u_(kh)},useDebugValue:f_,useDeferredValue:function(a){var u=Hi();return Er===null?u.memoizedState=a:UC(u,Er.memoizedState,a)},useTransition:function(){var a=u_(kh)[0],u=Hi().memoizedState;return[a,u]},useMutableSource:PC,useSyncExternalStore:AC,useId:BC,unstable_isNewReconciler:!1};function lo(a,u){if(a&&a.defaultProps){u=U({},u),a=a.defaultProps;for(var p in a)u[p]===void 0&&(u[p]=a[p]);return u}return u}function h_(a,u,p,b){u=a.memoizedState,p=p(b,u),p=p==null?u:U({},u,p),a.memoizedState=p,a.lanes===0&&(a.updateQueue.baseState=p)}var b0={isMounted:function(a){return(a=a._reactInternals)?qr(a)===a:!1},enqueueSetState:function(a,u,p){a=a._reactInternals;var b=As(),E=Sl(a),A=Sa(b,E);A.payload=u,p!=null&&(A.callback=p),u=_l(a,A,E),u!==null&&(fo(u,a,E,b),h0(u,a,E))},enqueueReplaceState:function(a,u,p){a=a._reactInternals;var b=As(),E=Sl(a),A=Sa(b,E);A.tag=1,A.payload=u,p!=null&&(A.callback=p),u=_l(a,A,E),u!==null&&(fo(u,a,E,b),h0(u,a,E))},enqueueForceUpdate:function(a,u){a=a._reactInternals;var p=As(),b=Sl(a),E=Sa(p,b);E.tag=2,u!=null&&(E.callback=u),u=_l(a,E,b),u!==null&&(fo(u,a,b,p),h0(u,a,b))}};function GC(a,u,p,b,E,A,M){return a=a.stateNode,typeof a.shouldComponentUpdate=="function"?a.shouldComponentUpdate(b,A,M):u.prototype&&u.prototype.isPureReactComponent?!dh(p,b)||!dh(E,A):!0}function KC(a,u,p){var b=!1,E=gl,A=u.contextType;return typeof A=="object"&&A!==null?A=Vi(A):(E=Fs(u)?Oc:ds.current,b=u.contextTypes,A=(b=b!=null)?rd(a,E):gl),u=new u(p,A),a.memoizedState=u.state!==null&&u.state!==void 0?u.state:null,u.updater=b0,a.stateNode=u,u._reactInternals=a,b&&(a=a.stateNode,a.__reactInternalMemoizedUnmaskedChildContext=E,a.__reactInternalMemoizedMaskedChildContext=A),u}function YC(a,u,p,b){a=u.state,typeof u.componentWillReceiveProps=="function"&&u.componentWillReceiveProps(p,b),typeof u.UNSAFE_componentWillReceiveProps=="function"&&u.UNSAFE_componentWillReceiveProps(p,b),u.state!==a&&b0.enqueueReplaceState(u,u.state,null)}function p_(a,u,p,b){var E=a.stateNode;E.props=p,E.state=a.memoizedState,E.refs={},e_(a);var A=u.contextType;typeof A=="object"&&A!==null?E.context=Vi(A):(A=Fs(u)?Oc:ds.current,E.context=rd(a,A)),E.state=a.memoizedState,A=u.getDerivedStateFromProps,typeof A=="function"&&(h_(a,u,A,p),E.state=a.memoizedState),typeof u.getDerivedStateFromProps=="function"||typeof E.getSnapshotBeforeUpdate=="function"||typeof E.UNSAFE_componentWillMount!="function"&&typeof E.componentWillMount!="function"||(u=E.state,typeof E.componentWillMount=="function"&&E.componentWillMount(),typeof E.UNSAFE_componentWillMount=="function"&&E.UNSAFE_componentWillMount(),u!==E.state&&b0.enqueueReplaceState(E,E.state,null),p0(a,p,E,b),E.state=a.memoizedState),typeof E.componentDidMount=="function"&&(a.flags|=4194308)}function dd(a,u){try{var p="",b=u;do p+=ce(b),b=b.return;while(b);var E=p}catch(A){E=`
|
|
99
|
-
Error generating stack: `+A.message+`
|
|
100
|
-
`+A.stack}return{value:a,source:u,stack:E,digest:null}}function m_(a,u,p){return{value:a,source:null,stack:p??null,digest:u??null}}function g_(a,u){try{console.error(u.value)}catch(p){setTimeout(function(){throw p})}}var LV=typeof WeakMap=="function"?WeakMap:Map;function XC(a,u,p){p=Sa(-1,p),p.tag=3,p.payload={element:null};var b=u.value;return p.callback=function(){A0||(A0=!0,I_=b),g_(a,u)},p}function QC(a,u,p){p=Sa(-1,p),p.tag=3;var b=a.type.getDerivedStateFromError;if(typeof b=="function"){var E=u.value;p.payload=function(){return b(E)},p.callback=function(){g_(a,u)}}var A=a.stateNode;return A!==null&&typeof A.componentDidCatch=="function"&&(p.callback=function(){g_(a,u),typeof b!="function"&&(bl===null?bl=new Set([this]):bl.add(this));var M=u.stack;this.componentDidCatch(u.value,{componentStack:M!==null?M:""})}),p}function JC(a,u,p){var b=a.pingCache;if(b===null){b=a.pingCache=new LV;var E=new Set;b.set(u,E)}else E=b.get(u),E===void 0&&(E=new Set,b.set(u,E));E.has(p)||(E.add(p),a=KV.bind(null,a,u,p),u.then(a,a))}function e8(a){do{var u;if((u=a.tag===13)&&(u=a.memoizedState,u=u!==null?u.dehydrated!==null:!0),u)return a;a=a.return}while(a!==null);return null}function t8(a,u,p,b,E){return(a.mode&1)===0?(a===u?a.flags|=65536:(a.flags|=128,p.flags|=131072,p.flags&=-52805,p.tag===1&&(p.alternate===null?p.tag=17:(u=Sa(-1,1),u.tag=2,_l(p,u,1))),p.lanes|=1),a):(a.flags|=65536,a.lanes=E,a)}var DV=C.ReactCurrentOwner,zs=!1;function Ps(a,u,p,b){u.child=a===null?bC(u,null,p,b):ad(u,a.child,p,b)}function n8(a,u,p,b,E){p=p.render;var A=u.ref;return cd(u,E),b=a_(a,u,p,b,A,E),p=l_(),a!==null&&!zs?(u.updateQueue=a.updateQueue,u.flags&=-2053,a.lanes&=~E,ka(a,u,E)):(jn&&p&&By(u),u.flags|=1,Ps(a,u,b,E),u.child)}function r8(a,u,p,b,E){if(a===null){var A=p.type;return typeof A=="function"&&!j_(A)&&A.defaultProps===void 0&&p.compare===null&&p.defaultProps===void 0?(u.tag=15,u.type=A,s8(a,u,A,b,E)):(a=N0(p.type,null,b,u,u.mode,E),a.ref=u.ref,a.return=u,u.child=a)}if(A=a.child,(a.lanes&E)===0){var M=A.memoizedProps;if(p=p.compare,p=p!==null?p:dh,p(M,b)&&a.ref===u.ref)return ka(a,u,E)}return u.flags|=1,a=El(A,b),a.ref=u.ref,a.return=u,u.child=a}function s8(a,u,p,b,E){if(a!==null){var A=a.memoizedProps;if(dh(A,b)&&a.ref===u.ref)if(zs=!1,u.pendingProps=b=A,(a.lanes&E)!==0)(a.flags&131072)!==0&&(zs=!0);else return u.lanes=a.lanes,ka(a,u,E)}return v_(a,u,p,b,E)}function i8(a,u,p){var b=u.pendingProps,E=b.children,A=a!==null?a.memoizedState:null;if(b.mode==="hidden")if((u.mode&1)===0)u.memoizedState={baseLanes:0,cachePool:null,transitions:null},Cn(hd,fi),fi|=p;else{if((p&1073741824)===0)return a=A!==null?A.baseLanes|p:p,u.lanes=u.childLanes=1073741824,u.memoizedState={baseLanes:a,cachePool:null,transitions:null},u.updateQueue=null,Cn(hd,fi),fi|=a,null;u.memoizedState={baseLanes:0,cachePool:null,transitions:null},b=A!==null?A.baseLanes:p,Cn(hd,fi),fi|=b}else A!==null?(b=A.baseLanes|p,u.memoizedState=null):b=p,Cn(hd,fi),fi|=b;return Ps(a,u,E,p),u.child}function o8(a,u){var p=u.ref;(a===null&&p!==null||a!==null&&a.ref!==p)&&(u.flags|=512,u.flags|=2097152)}function v_(a,u,p,b,E){var A=Fs(p)?Oc:ds.current;return A=rd(u,A),cd(u,E),p=a_(a,u,p,b,A,E),b=l_(),a!==null&&!zs?(u.updateQueue=a.updateQueue,u.flags&=-2053,a.lanes&=~E,ka(a,u,E)):(jn&&b&&By(u),u.flags|=1,Ps(a,u,p,E),u.child)}function a8(a,u,p,b,E){if(Fs(p)){var A=!0;i0(u)}else A=!1;if(cd(u,E),u.stateNode===null)S0(a,u),KC(u,p,b),p_(u,p,b,E),b=!0;else if(a===null){var M=u.stateNode,Z=u.memoizedProps;M.props=Z;var Y=M.context,ae=p.contextType;typeof ae=="object"&&ae!==null?ae=Vi(ae):(ae=Fs(p)?Oc:ds.current,ae=rd(u,ae));var be=p.getDerivedStateFromProps,Ee=typeof be=="function"||typeof M.getSnapshotBeforeUpdate=="function";Ee||typeof M.UNSAFE_componentWillReceiveProps!="function"&&typeof M.componentWillReceiveProps!="function"||(Z!==b||Y!==ae)&&YC(u,M,b,ae),yl=!1;var we=u.memoizedState;M.state=we,p0(u,b,M,E),Y=u.memoizedState,Z!==b||we!==Y||js.current||yl?(typeof be=="function"&&(h_(u,p,be,b),Y=u.memoizedState),(Z=yl||GC(u,p,Z,b,we,Y,ae))?(Ee||typeof M.UNSAFE_componentWillMount!="function"&&typeof M.componentWillMount!="function"||(typeof M.componentWillMount=="function"&&M.componentWillMount(),typeof M.UNSAFE_componentWillMount=="function"&&M.UNSAFE_componentWillMount()),typeof M.componentDidMount=="function"&&(u.flags|=4194308)):(typeof M.componentDidMount=="function"&&(u.flags|=4194308),u.memoizedProps=b,u.memoizedState=Y),M.props=b,M.state=Y,M.context=ae,b=Z):(typeof M.componentDidMount=="function"&&(u.flags|=4194308),b=!1)}else{M=u.stateNode,SC(a,u),Z=u.memoizedProps,ae=u.type===u.elementType?Z:lo(u.type,Z),M.props=ae,Ee=u.pendingProps,we=M.context,Y=p.contextType,typeof Y=="object"&&Y!==null?Y=Vi(Y):(Y=Fs(p)?Oc:ds.current,Y=rd(u,Y));var De=p.getDerivedStateFromProps;(be=typeof De=="function"||typeof M.getSnapshotBeforeUpdate=="function")||typeof M.UNSAFE_componentWillReceiveProps!="function"&&typeof M.componentWillReceiveProps!="function"||(Z!==Ee||we!==Y)&&YC(u,M,b,Y),yl=!1,we=u.memoizedState,M.state=we,p0(u,b,M,E);var qe=u.memoizedState;Z!==Ee||we!==qe||js.current||yl?(typeof De=="function"&&(h_(u,p,De,b),qe=u.memoizedState),(ae=yl||GC(u,p,ae,b,we,qe,Y)||!1)?(be||typeof M.UNSAFE_componentWillUpdate!="function"&&typeof M.componentWillUpdate!="function"||(typeof M.componentWillUpdate=="function"&&M.componentWillUpdate(b,qe,Y),typeof M.UNSAFE_componentWillUpdate=="function"&&M.UNSAFE_componentWillUpdate(b,qe,Y)),typeof M.componentDidUpdate=="function"&&(u.flags|=4),typeof M.getSnapshotBeforeUpdate=="function"&&(u.flags|=1024)):(typeof M.componentDidUpdate!="function"||Z===a.memoizedProps&&we===a.memoizedState||(u.flags|=4),typeof M.getSnapshotBeforeUpdate!="function"||Z===a.memoizedProps&&we===a.memoizedState||(u.flags|=1024),u.memoizedProps=b,u.memoizedState=qe),M.props=b,M.state=qe,M.context=Y,b=ae):(typeof M.componentDidUpdate!="function"||Z===a.memoizedProps&&we===a.memoizedState||(u.flags|=4),typeof M.getSnapshotBeforeUpdate!="function"||Z===a.memoizedProps&&we===a.memoizedState||(u.flags|=1024),b=!1)}return y_(a,u,p,b,A,E)}function y_(a,u,p,b,E,A){o8(a,u);var M=(u.flags&128)!==0;if(!b&&!M)return E&&fC(u,p,!1),ka(a,u,A);b=u.stateNode,DV.current=u;var Z=M&&typeof p.getDerivedStateFromError!="function"?null:b.render();return u.flags|=1,a!==null&&M?(u.child=ad(u,a.child,null,A),u.child=ad(u,null,Z,A)):Ps(a,u,Z,A),u.memoizedState=b.state,E&&fC(u,p,!0),u.child}function l8(a){var u=a.stateNode;u.pendingContext?uC(a,u.pendingContext,u.pendingContext!==u.context):u.context&&uC(a,u.context,!1),t_(a,u.containerInfo)}function c8(a,u,p,b,E){return od(),Gy(E),u.flags|=256,Ps(a,u,p,b),u.child}var __={dehydrated:null,treeContext:null,retryLane:0};function w_(a){return{baseLanes:a,cachePool:null,transitions:null}}function u8(a,u,p){var b=u.pendingProps,E=Zn.current,A=!1,M=(u.flags&128)!==0,Z;if((Z=M)||(Z=a!==null&&a.memoizedState===null?!1:(E&2)!==0),Z?(A=!0,u.flags&=-129):(a===null||a.memoizedState!==null)&&(E|=1),Cn(Zn,E&1),a===null)return qy(u),a=u.memoizedState,a!==null&&(a=a.dehydrated,a!==null)?((u.mode&1)===0?u.lanes=1:a.data==="$!"?u.lanes=8:u.lanes=1073741824,null):(M=b.children,a=b.fallback,A?(b=u.mode,A=u.child,M={mode:"hidden",children:M},(b&1)===0&&A!==null?(A.childLanes=0,A.pendingProps=M):A=L0(M,b,0,null),a=Hc(a,b,p,null),A.return=u,a.return=u,A.sibling=a,u.child=A,u.child.memoizedState=w_(p),u.memoizedState=__,a):b_(u,M));if(E=a.memoizedState,E!==null&&(Z=E.dehydrated,Z!==null))return $V(a,u,M,b,Z,E,p);if(A){A=b.fallback,M=u.mode,E=a.child,Z=E.sibling;var Y={mode:"hidden",children:b.children};return(M&1)===0&&u.child!==E?(b=u.child,b.childLanes=0,b.pendingProps=Y,u.deletions=null):(b=El(E,Y),b.subtreeFlags=E.subtreeFlags&14680064),Z!==null?A=El(Z,A):(A=Hc(A,M,p,null),A.flags|=2),A.return=u,b.return=u,b.sibling=A,u.child=b,b=A,A=u.child,M=a.child.memoizedState,M=M===null?w_(p):{baseLanes:M.baseLanes|p,cachePool:null,transitions:M.transitions},A.memoizedState=M,A.childLanes=a.childLanes&~p,u.memoizedState=__,b}return A=a.child,a=A.sibling,b=El(A,{mode:"visible",children:b.children}),(u.mode&1)===0&&(b.lanes=p),b.return=u,b.sibling=null,a!==null&&(p=u.deletions,p===null?(u.deletions=[a],u.flags|=16):p.push(a)),u.child=b,u.memoizedState=null,b}function b_(a,u){return u=L0({mode:"visible",children:u},a.mode,0,null),u.return=a,a.child=u}function x0(a,u,p,b){return b!==null&&Gy(b),ad(u,a.child,null,p),a=b_(u,u.pendingProps.children),a.flags|=2,u.memoizedState=null,a}function $V(a,u,p,b,E,A,M){if(p)return u.flags&256?(u.flags&=-257,b=m_(Error(n(422))),x0(a,u,M,b)):u.memoizedState!==null?(u.child=a.child,u.flags|=128,null):(A=b.fallback,E=u.mode,b=L0({mode:"visible",children:b.children},E,0,null),A=Hc(A,E,M,null),A.flags|=2,b.return=u,A.return=u,b.sibling=A,u.child=b,(u.mode&1)!==0&&ad(u,a.child,null,M),u.child.memoizedState=w_(M),u.memoizedState=__,A);if((u.mode&1)===0)return x0(a,u,M,null);if(E.data==="$!"){if(b=E.nextSibling&&E.nextSibling.dataset,b)var Z=b.dgst;return b=Z,A=Error(n(419)),b=m_(A,b,void 0),x0(a,u,M,b)}if(Z=(M&a.childLanes)!==0,zs||Z){if(b=Lr,b!==null){switch(M&-M){case 4:E=2;break;case 16:E=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:E=32;break;case 536870912:E=268435456;break;default:E=0}E=(E&(b.suspendedLanes|M))!==0?0:E,E!==0&&E!==A.retryLane&&(A.retryLane=E,xa(a,E),fo(b,a,E,-1))}return $_(),b=m_(Error(n(421))),x0(a,u,M,b)}return E.data==="$?"?(u.flags|=128,u.child=a.child,u=YV.bind(null,a),E._reactRetry=u,null):(a=A.treeContext,di=pl(E.nextSibling),ui=u,jn=!0,ao=null,a!==null&&(Fi[zi++]=wa,Fi[zi++]=ba,Fi[zi++]=Mc,wa=a.id,ba=a.overflow,Mc=u),u=b_(u,b.children),u.flags|=4096,u)}function d8(a,u,p){a.lanes|=u;var b=a.alternate;b!==null&&(b.lanes|=u),Qy(a.return,u,p)}function x_(a,u,p,b,E){var A=a.memoizedState;A===null?a.memoizedState={isBackwards:u,rendering:null,renderingStartTime:0,last:b,tail:p,tailMode:E}:(A.isBackwards=u,A.rendering=null,A.renderingStartTime=0,A.last=b,A.tail=p,A.tailMode=E)}function f8(a,u,p){var b=u.pendingProps,E=b.revealOrder,A=b.tail;if(Ps(a,u,b.children,p),b=Zn.current,(b&2)!==0)b=b&1|2,u.flags|=128;else{if(a!==null&&(a.flags&128)!==0)e:for(a=u.child;a!==null;){if(a.tag===13)a.memoizedState!==null&&d8(a,p,u);else if(a.tag===19)d8(a,p,u);else if(a.child!==null){a.child.return=a,a=a.child;continue}if(a===u)break e;for(;a.sibling===null;){if(a.return===null||a.return===u)break e;a=a.return}a.sibling.return=a.return,a=a.sibling}b&=1}if(Cn(Zn,b),(u.mode&1)===0)u.memoizedState=null;else switch(E){case"forwards":for(p=u.child,E=null;p!==null;)a=p.alternate,a!==null&&m0(a)===null&&(E=p),p=p.sibling;p=E,p===null?(E=u.child,u.child=null):(E=p.sibling,p.sibling=null),x_(u,!1,E,p,A);break;case"backwards":for(p=null,E=u.child,u.child=null;E!==null;){if(a=E.alternate,a!==null&&m0(a)===null){u.child=E;break}a=E.sibling,E.sibling=p,p=E,E=a}x_(u,!0,p,null,A);break;case"together":x_(u,!1,null,null,void 0);break;default:u.memoizedState=null}return u.child}function S0(a,u){(u.mode&1)===0&&a!==null&&(a.alternate=null,u.alternate=null,u.flags|=2)}function ka(a,u,p){if(a!==null&&(u.dependencies=a.dependencies),jc|=u.lanes,(p&u.childLanes)===0)return null;if(a!==null&&u.child!==a.child)throw Error(n(153));if(u.child!==null){for(a=u.child,p=El(a,a.pendingProps),u.child=p,p.return=u;a.sibling!==null;)a=a.sibling,p=p.sibling=El(a,a.pendingProps),p.return=u;p.sibling=null}return u.child}function jV(a,u,p){switch(u.tag){case 3:l8(u),od();break;case 5:CC(u);break;case 1:Fs(u.type)&&i0(u);break;case 4:t_(u,u.stateNode.containerInfo);break;case 10:var b=u.type._context,E=u.memoizedProps.value;Cn(d0,b._currentValue),b._currentValue=E;break;case 13:if(b=u.memoizedState,b!==null)return b.dehydrated!==null?(Cn(Zn,Zn.current&1),u.flags|=128,null):(p&u.child.childLanes)!==0?u8(a,u,p):(Cn(Zn,Zn.current&1),a=ka(a,u,p),a!==null?a.sibling:null);Cn(Zn,Zn.current&1);break;case 19:if(b=(p&u.childLanes)!==0,(a.flags&128)!==0){if(b)return f8(a,u,p);u.flags|=128}if(E=u.memoizedState,E!==null&&(E.rendering=null,E.tail=null,E.lastEffect=null),Cn(Zn,Zn.current),b)break;return null;case 22:case 23:return u.lanes=0,i8(a,u,p)}return ka(a,u,p)}var h8,S_,p8,m8;h8=function(a,u){for(var p=u.child;p!==null;){if(p.tag===5||p.tag===6)a.appendChild(p.stateNode);else if(p.tag!==4&&p.child!==null){p.child.return=p,p=p.child;continue}if(p===u)break;for(;p.sibling===null;){if(p.return===null||p.return===u)return;p=p.return}p.sibling.return=p.return,p=p.sibling}},S_=function(){},p8=function(a,u,p,b){var E=a.memoizedProps;if(E!==b){a=u.stateNode,Dc(No.current);var A=null;switch(p){case"input":E=on(a,E),b=on(a,b),A=[];break;case"select":E=U({},E,{value:void 0}),b=U({},b,{value:void 0}),A=[];break;case"textarea":E=nt(a,E),b=nt(a,b),A=[];break;default:typeof E.onClick!="function"&&typeof b.onClick=="function"&&(a.onclick=n0)}dr(p,b);var M;p=null;for(ae in E)if(!b.hasOwnProperty(ae)&&E.hasOwnProperty(ae)&&E[ae]!=null)if(ae==="style"){var Z=E[ae];for(M in Z)Z.hasOwnProperty(M)&&(p||(p={}),p[M]="")}else ae!=="dangerouslySetInnerHTML"&&ae!=="children"&&ae!=="suppressContentEditableWarning"&&ae!=="suppressHydrationWarning"&&ae!=="autoFocus"&&(s.hasOwnProperty(ae)?A||(A=[]):(A=A||[]).push(ae,null));for(ae in b){var Y=b[ae];if(Z=E!=null?E[ae]:void 0,b.hasOwnProperty(ae)&&Y!==Z&&(Y!=null||Z!=null))if(ae==="style")if(Z){for(M in Z)!Z.hasOwnProperty(M)||Y&&Y.hasOwnProperty(M)||(p||(p={}),p[M]="");for(M in Y)Y.hasOwnProperty(M)&&Z[M]!==Y[M]&&(p||(p={}),p[M]=Y[M])}else p||(A||(A=[]),A.push(ae,p)),p=Y;else ae==="dangerouslySetInnerHTML"?(Y=Y?Y.__html:void 0,Z=Z?Z.__html:void 0,Y!=null&&Z!==Y&&(A=A||[]).push(ae,Y)):ae==="children"?typeof Y!="string"&&typeof Y!="number"||(A=A||[]).push(ae,""+Y):ae!=="suppressContentEditableWarning"&&ae!=="suppressHydrationWarning"&&(s.hasOwnProperty(ae)?(Y!=null&&ae==="onScroll"&&In("scroll",a),A||Z===Y||(A=[])):(A=A||[]).push(ae,Y))}p&&(A=A||[]).push("style",p);var ae=A;(u.updateQueue=ae)&&(u.flags|=4)}},m8=function(a,u,p,b){p!==b&&(u.flags|=4)};function Ch(a,u){if(!jn)switch(a.tailMode){case"hidden":u=a.tail;for(var p=null;u!==null;)u.alternate!==null&&(p=u),u=u.sibling;p===null?a.tail=null:p.sibling=null;break;case"collapsed":p=a.tail;for(var b=null;p!==null;)p.alternate!==null&&(b=p),p=p.sibling;b===null?u||a.tail===null?a.tail=null:a.tail.sibling=null:b.sibling=null}}function hs(a){var u=a.alternate!==null&&a.alternate.child===a.child,p=0,b=0;if(u)for(var E=a.child;E!==null;)p|=E.lanes|E.childLanes,b|=E.subtreeFlags&14680064,b|=E.flags&14680064,E.return=a,E=E.sibling;else for(E=a.child;E!==null;)p|=E.lanes|E.childLanes,b|=E.subtreeFlags,b|=E.flags,E.return=a,E=E.sibling;return a.subtreeFlags|=b,a.childLanes=p,u}function FV(a,u,p){var b=u.pendingProps;switch(Zy(u),u.tag){case 2:case 16:case 15:case 0:case 11:case 7:case 8:case 12:case 9:case 14:return hs(u),null;case 1:return Fs(u.type)&&s0(),hs(u),null;case 3:return b=u.stateNode,ud(),On(js),On(ds),s_(),b.pendingContext&&(b.context=b.pendingContext,b.pendingContext=null),(a===null||a.child===null)&&(c0(u)?u.flags|=4:a===null||a.memoizedState.isDehydrated&&(u.flags&256)===0||(u.flags|=1024,ao!==null&&(N_(ao),ao=null))),S_(a,u),hs(u),null;case 5:n_(u);var E=Dc(bh.current);if(p=u.type,a!==null&&u.stateNode!=null)p8(a,u,p,b,E),a.ref!==u.ref&&(u.flags|=512,u.flags|=2097152);else{if(!b){if(u.stateNode===null)throw Error(n(166));return hs(u),null}if(a=Dc(No.current),c0(u)){b=u.stateNode,p=u.type;var A=u.memoizedProps;switch(b[Mo]=u,b[gh]=A,a=(u.mode&1)!==0,p){case"dialog":In("cancel",b),In("close",b);break;case"iframe":case"object":case"embed":In("load",b);break;case"video":case"audio":for(E=0;E<hh.length;E++)In(hh[E],b);break;case"source":In("error",b);break;case"img":case"image":case"link":In("error",b),In("load",b);break;case"details":In("toggle",b);break;case"input":Tt(b,A),In("invalid",b);break;case"select":b._wrapperState={wasMultiple:!!A.multiple},In("invalid",b);break;case"textarea":St(b,A),In("invalid",b)}dr(p,A),E=null;for(var M in A)if(A.hasOwnProperty(M)){var Z=A[M];M==="children"?typeof Z=="string"?b.textContent!==Z&&(A.suppressHydrationWarning!==!0&&t0(b.textContent,Z,a),E=["children",Z]):typeof Z=="number"&&b.textContent!==""+Z&&(A.suppressHydrationWarning!==!0&&t0(b.textContent,Z,a),E=["children",""+Z]):s.hasOwnProperty(M)&&Z!=null&&M==="onScroll"&&In("scroll",b)}switch(p){case"input":ze(b),An(b,A,!0);break;case"textarea":ze(b),Ot(b);break;case"select":case"option":break;default:typeof A.onClick=="function"&&(b.onclick=n0)}b=E,u.updateQueue=b,b!==null&&(u.flags|=4)}else{M=E.nodeType===9?E:E.ownerDocument,a==="http://www.w3.org/1999/xhtml"&&(a=Qt(p)),a==="http://www.w3.org/1999/xhtml"?p==="script"?(a=M.createElement("div"),a.innerHTML="<script><\/script>",a=a.removeChild(a.firstChild)):typeof b.is=="string"?a=M.createElement(p,{is:b.is}):(a=M.createElement(p),p==="select"&&(M=a,b.multiple?M.multiple=!0:b.size&&(M.size=b.size))):a=M.createElementNS(a,p),a[Mo]=u,a[gh]=b,h8(a,u,!1,!1),u.stateNode=a;e:{switch(M=Ii(p,b),p){case"dialog":In("cancel",a),In("close",a),E=b;break;case"iframe":case"object":case"embed":In("load",a),E=b;break;case"video":case"audio":for(E=0;E<hh.length;E++)In(hh[E],a);E=b;break;case"source":In("error",a),E=b;break;case"img":case"image":case"link":In("error",a),In("load",a),E=b;break;case"details":In("toggle",a),E=b;break;case"input":Tt(a,b),E=on(a,b),In("invalid",a);break;case"option":E=b;break;case"select":a._wrapperState={wasMultiple:!!b.multiple},E=U({},b,{value:void 0}),In("invalid",a);break;case"textarea":St(a,b),E=nt(a,b),In("invalid",a);break;default:E=b}dr(p,E),Z=E;for(A in Z)if(Z.hasOwnProperty(A)){var Y=Z[A];A==="style"?ur(a,Y):A==="dangerouslySetInnerHTML"?(Y=Y?Y.__html:void 0,Y!=null&&ai(a,Y)):A==="children"?typeof Y=="string"?(p!=="textarea"||Y!=="")&&ss(a,Y):typeof Y=="number"&&ss(a,""+Y):A!=="suppressContentEditableWarning"&&A!=="suppressHydrationWarning"&&A!=="autoFocus"&&(s.hasOwnProperty(A)?Y!=null&&A==="onScroll"&&In("scroll",a):Y!=null&&P(a,A,Y,M))}switch(p){case"input":ze(a),An(a,b,!1);break;case"textarea":ze(a),Ot(a);break;case"option":b.value!=null&&a.setAttribute("value",""+oe(b.value));break;case"select":a.multiple=!!b.multiple,A=b.value,A!=null?Ie(a,!!b.multiple,A,!1):b.defaultValue!=null&&Ie(a,!!b.multiple,b.defaultValue,!0);break;default:typeof E.onClick=="function"&&(a.onclick=n0)}switch(p){case"button":case"input":case"select":case"textarea":b=!!b.autoFocus;break e;case"img":b=!0;break e;default:b=!1}}b&&(u.flags|=4)}u.ref!==null&&(u.flags|=512,u.flags|=2097152)}return hs(u),null;case 6:if(a&&u.stateNode!=null)m8(a,u,a.memoizedProps,b);else{if(typeof b!="string"&&u.stateNode===null)throw Error(n(166));if(p=Dc(bh.current),Dc(No.current),c0(u)){if(b=u.stateNode,p=u.memoizedProps,b[Mo]=u,(A=b.nodeValue!==p)&&(a=ui,a!==null))switch(a.tag){case 3:t0(b.nodeValue,p,(a.mode&1)!==0);break;case 5:a.memoizedProps.suppressHydrationWarning!==!0&&t0(b.nodeValue,p,(a.mode&1)!==0)}A&&(u.flags|=4)}else b=(p.nodeType===9?p:p.ownerDocument).createTextNode(b),b[Mo]=u,u.stateNode=b}return hs(u),null;case 13:if(On(Zn),b=u.memoizedState,a===null||a.memoizedState!==null&&a.memoizedState.dehydrated!==null){if(jn&&di!==null&&(u.mode&1)!==0&&(u.flags&128)===0)yC(),od(),u.flags|=98560,A=!1;else if(A=c0(u),b!==null&&b.dehydrated!==null){if(a===null){if(!A)throw Error(n(318));if(A=u.memoizedState,A=A!==null?A.dehydrated:null,!A)throw Error(n(317));A[Mo]=u}else od(),(u.flags&128)===0&&(u.memoizedState=null),u.flags|=4;hs(u),A=!1}else ao!==null&&(N_(ao),ao=null),A=!0;if(!A)return u.flags&65536?u:null}return(u.flags&128)!==0?(u.lanes=p,u):(b=b!==null,b!==(a!==null&&a.memoizedState!==null)&&b&&(u.child.flags|=8192,(u.mode&1)!==0&&(a===null||(Zn.current&1)!==0?Cr===0&&(Cr=3):$_())),u.updateQueue!==null&&(u.flags|=4),hs(u),null);case 4:return ud(),S_(a,u),a===null&&ph(u.stateNode.containerInfo),hs(u),null;case 10:return Xy(u.type._context),hs(u),null;case 17:return Fs(u.type)&&s0(),hs(u),null;case 19:if(On(Zn),A=u.memoizedState,A===null)return hs(u),null;if(b=(u.flags&128)!==0,M=A.rendering,M===null)if(b)Ch(A,!1);else{if(Cr!==0||a!==null&&(a.flags&128)!==0)for(a=u.child;a!==null;){if(M=m0(a),M!==null){for(u.flags|=128,Ch(A,!1),b=M.updateQueue,b!==null&&(u.updateQueue=b,u.flags|=4),u.subtreeFlags=0,b=p,p=u.child;p!==null;)A=p,a=b,A.flags&=14680066,M=A.alternate,M===null?(A.childLanes=0,A.lanes=a,A.child=null,A.subtreeFlags=0,A.memoizedProps=null,A.memoizedState=null,A.updateQueue=null,A.dependencies=null,A.stateNode=null):(A.childLanes=M.childLanes,A.lanes=M.lanes,A.child=M.child,A.subtreeFlags=0,A.deletions=null,A.memoizedProps=M.memoizedProps,A.memoizedState=M.memoizedState,A.updateQueue=M.updateQueue,A.type=M.type,a=M.dependencies,A.dependencies=a===null?null:{lanes:a.lanes,firstContext:a.firstContext}),p=p.sibling;return Cn(Zn,Zn.current&1|2),u.child}a=a.sibling}A.tail!==null&&un()>pd&&(u.flags|=128,b=!0,Ch(A,!1),u.lanes=4194304)}else{if(!b)if(a=m0(M),a!==null){if(u.flags|=128,b=!0,p=a.updateQueue,p!==null&&(u.updateQueue=p,u.flags|=4),Ch(A,!0),A.tail===null&&A.tailMode==="hidden"&&!M.alternate&&!jn)return hs(u),null}else 2*un()-A.renderingStartTime>pd&&p!==1073741824&&(u.flags|=128,b=!0,Ch(A,!1),u.lanes=4194304);A.isBackwards?(M.sibling=u.child,u.child=M):(p=A.last,p!==null?p.sibling=M:u.child=M,A.last=M)}return A.tail!==null?(u=A.tail,A.rendering=u,A.tail=u.sibling,A.renderingStartTime=un(),u.sibling=null,p=Zn.current,Cn(Zn,b?p&1|2:p&1),u):(hs(u),null);case 22:case 23:return D_(),b=u.memoizedState!==null,a!==null&&a.memoizedState!==null!==b&&(u.flags|=8192),b&&(u.mode&1)!==0?(fi&1073741824)!==0&&(hs(u),u.subtreeFlags&6&&(u.flags|=8192)):hs(u),null;case 24:return null;case 25:return null}throw Error(n(156,u.tag))}function zV(a,u){switch(Zy(u),u.tag){case 1:return Fs(u.type)&&s0(),a=u.flags,a&65536?(u.flags=a&-65537|128,u):null;case 3:return ud(),On(js),On(ds),s_(),a=u.flags,(a&65536)!==0&&(a&128)===0?(u.flags=a&-65537|128,u):null;case 5:return n_(u),null;case 13:if(On(Zn),a=u.memoizedState,a!==null&&a.dehydrated!==null){if(u.alternate===null)throw Error(n(340));od()}return a=u.flags,a&65536?(u.flags=a&-65537|128,u):null;case 19:return On(Zn),null;case 4:return ud(),null;case 10:return Xy(u.type._context),null;case 22:case 23:return D_(),null;case 24:return null;default:return null}}var k0=!1,ps=!1,VV=typeof WeakSet=="function"?WeakSet:Set,He=null;function fd(a,u){var p=a.ref;if(p!==null)if(typeof p=="function")try{p(null)}catch(b){rr(a,u,b)}else p.current=null}function k_(a,u,p){try{p()}catch(b){rr(a,u,b)}}var g8=!1;function HV(a,u){if(Dy=Bm,a=G6(),Ay(a)){if("selectionStart"in a)var p={start:a.selectionStart,end:a.selectionEnd};else e:{p=(p=a.ownerDocument)&&p.defaultView||window;var b=p.getSelection&&p.getSelection();if(b&&b.rangeCount!==0){p=b.anchorNode;var E=b.anchorOffset,A=b.focusNode;b=b.focusOffset;try{p.nodeType,A.nodeType}catch{p=null;break e}var M=0,Z=-1,Y=-1,ae=0,be=0,Ee=a,we=null;t:for(;;){for(var De;Ee!==p||E!==0&&Ee.nodeType!==3||(Z=M+E),Ee!==A||b!==0&&Ee.nodeType!==3||(Y=M+b),Ee.nodeType===3&&(M+=Ee.nodeValue.length),(De=Ee.firstChild)!==null;)we=Ee,Ee=De;for(;;){if(Ee===a)break t;if(we===p&&++ae===E&&(Z=M),we===A&&++be===b&&(Y=M),(De=Ee.nextSibling)!==null)break;Ee=we,we=Ee.parentNode}Ee=De}p=Z===-1||Y===-1?null:{start:Z,end:Y}}else p=null}p=p||{start:0,end:0}}else p=null;for($y={focusedElem:a,selectionRange:p},Bm=!1,He=u;He!==null;)if(u=He,a=u.child,(u.subtreeFlags&1028)!==0&&a!==null)a.return=u,He=a;else for(;He!==null;){u=He;try{var qe=u.alternate;if((u.flags&1024)!==0)switch(u.tag){case 0:case 11:case 15:break;case 1:if(qe!==null){var Ye=qe.memoizedProps,or=qe.memoizedState,te=u.stateNode,J=te.getSnapshotBeforeUpdate(u.elementType===u.type?Ye:lo(u.type,Ye),or);te.__reactInternalSnapshotBeforeUpdate=J}break;case 3:var ne=u.stateNode.containerInfo;ne.nodeType===1?ne.textContent="":ne.nodeType===9&&ne.documentElement&&ne.removeChild(ne.documentElement);break;case 5:case 6:case 4:case 17:break;default:throw Error(n(163))}}catch(Te){rr(u,u.return,Te)}if(a=u.sibling,a!==null){a.return=u.return,He=a;break}He=u.return}return qe=g8,g8=!1,qe}function Ph(a,u,p){var b=u.updateQueue;if(b=b!==null?b.lastEffect:null,b!==null){var E=b=b.next;do{if((E.tag&a)===a){var A=E.destroy;E.destroy=void 0,A!==void 0&&k_(u,p,A)}E=E.next}while(E!==b)}}function E0(a,u){if(u=u.updateQueue,u=u!==null?u.lastEffect:null,u!==null){var p=u=u.next;do{if((p.tag&a)===a){var b=p.create;p.destroy=b()}p=p.next}while(p!==u)}}function E_(a){var u=a.ref;if(u!==null){var p=a.stateNode;switch(a.tag){case 5:a=p;break;default:a=p}typeof u=="function"?u(a):u.current=a}}function v8(a){var u=a.alternate;u!==null&&(a.alternate=null,v8(u)),a.child=null,a.deletions=null,a.sibling=null,a.tag===5&&(u=a.stateNode,u!==null&&(delete u[Mo],delete u[gh],delete u[Vy],delete u[kV],delete u[EV])),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 y8(a){return a.tag===5||a.tag===3||a.tag===4}function _8(a){e:for(;;){for(;a.sibling===null;){if(a.return===null||y8(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 C_(a,u,p){var b=a.tag;if(b===5||b===6)a=a.stateNode,u?p.nodeType===8?p.parentNode.insertBefore(a,u):p.insertBefore(a,u):(p.nodeType===8?(u=p.parentNode,u.insertBefore(a,p)):(u=p,u.appendChild(a)),p=p._reactRootContainer,p!=null||u.onclick!==null||(u.onclick=n0));else if(b!==4&&(a=a.child,a!==null))for(C_(a,u,p),a=a.sibling;a!==null;)C_(a,u,p),a=a.sibling}function P_(a,u,p){var b=a.tag;if(b===5||b===6)a=a.stateNode,u?p.insertBefore(a,u):p.appendChild(a);else if(b!==4&&(a=a.child,a!==null))for(P_(a,u,p),a=a.sibling;a!==null;)P_(a,u,p),a=a.sibling}var Kr=null,co=!1;function wl(a,u,p){for(p=p.child;p!==null;)w8(a,u,p),p=p.sibling}function w8(a,u,p){if($s&&typeof $s.onCommitFiberUnmount=="function")try{$s.onCommitFiberUnmount(io,p)}catch{}switch(p.tag){case 5:ps||fd(p,u);case 6:var b=Kr,E=co;Kr=null,wl(a,u,p),Kr=b,co=E,Kr!==null&&(co?(a=Kr,p=p.stateNode,a.nodeType===8?a.parentNode.removeChild(p):a.removeChild(p)):Kr.removeChild(p.stateNode));break;case 18:Kr!==null&&(co?(a=Kr,p=p.stateNode,a.nodeType===8?zy(a.parentNode,p):a.nodeType===1&&zy(a,p),dl(a)):zy(Kr,p.stateNode));break;case 4:b=Kr,E=co,Kr=p.stateNode.containerInfo,co=!0,wl(a,u,p),Kr=b,co=E;break;case 0:case 11:case 14:case 15:if(!ps&&(b=p.updateQueue,b!==null&&(b=b.lastEffect,b!==null))){E=b=b.next;do{var A=E,M=A.destroy;A=A.tag,M!==void 0&&((A&2)!==0||(A&4)!==0)&&k_(p,u,M),E=E.next}while(E!==b)}wl(a,u,p);break;case 1:if(!ps&&(fd(p,u),b=p.stateNode,typeof b.componentWillUnmount=="function"))try{b.props=p.memoizedProps,b.state=p.memoizedState,b.componentWillUnmount()}catch(Z){rr(p,u,Z)}wl(a,u,p);break;case 21:wl(a,u,p);break;case 22:p.mode&1?(ps=(b=ps)||p.memoizedState!==null,wl(a,u,p),ps=b):wl(a,u,p);break;default:wl(a,u,p)}}function b8(a){var u=a.updateQueue;if(u!==null){a.updateQueue=null;var p=a.stateNode;p===null&&(p=a.stateNode=new VV),u.forEach(function(b){var E=XV.bind(null,a,b);p.has(b)||(p.add(b),b.then(E,E))})}}function uo(a,u){var p=u.deletions;if(p!==null)for(var b=0;b<p.length;b++){var E=p[b];try{var A=a,M=u,Z=M;e:for(;Z!==null;){switch(Z.tag){case 5:Kr=Z.stateNode,co=!1;break e;case 3:Kr=Z.stateNode.containerInfo,co=!0;break e;case 4:Kr=Z.stateNode.containerInfo,co=!0;break e}Z=Z.return}if(Kr===null)throw Error(n(160));w8(A,M,E),Kr=null,co=!1;var Y=E.alternate;Y!==null&&(Y.return=null),E.return=null}catch(ae){rr(E,u,ae)}}if(u.subtreeFlags&12854)for(u=u.child;u!==null;)x8(u,a),u=u.sibling}function x8(a,u){var p=a.alternate,b=a.flags;switch(a.tag){case 0:case 11:case 14:case 15:if(uo(u,a),Do(a),b&4){try{Ph(3,a,a.return),E0(3,a)}catch(Ye){rr(a,a.return,Ye)}try{Ph(5,a,a.return)}catch(Ye){rr(a,a.return,Ye)}}break;case 1:uo(u,a),Do(a),b&512&&p!==null&&fd(p,p.return);break;case 5:if(uo(u,a),Do(a),b&512&&p!==null&&fd(p,p.return),a.flags&32){var E=a.stateNode;try{ss(E,"")}catch(Ye){rr(a,a.return,Ye)}}if(b&4&&(E=a.stateNode,E!=null)){var A=a.memoizedProps,M=p!==null?p.memoizedProps:A,Z=a.type,Y=a.updateQueue;if(a.updateQueue=null,Y!==null)try{Z==="input"&&A.type==="radio"&&A.name!=null&&$t(E,A),Ii(Z,M);var ae=Ii(Z,A);for(M=0;M<Y.length;M+=2){var be=Y[M],Ee=Y[M+1];be==="style"?ur(E,Ee):be==="dangerouslySetInnerHTML"?ai(E,Ee):be==="children"?ss(E,Ee):P(E,be,Ee,ae)}switch(Z){case"input":xt(E,A);break;case"textarea":Ce(E,A);break;case"select":var we=E._wrapperState.wasMultiple;E._wrapperState.wasMultiple=!!A.multiple;var De=A.value;De!=null?Ie(E,!!A.multiple,De,!1):we!==!!A.multiple&&(A.defaultValue!=null?Ie(E,!!A.multiple,A.defaultValue,!0):Ie(E,!!A.multiple,A.multiple?[]:"",!1))}E[gh]=A}catch(Ye){rr(a,a.return,Ye)}}break;case 6:if(uo(u,a),Do(a),b&4){if(a.stateNode===null)throw Error(n(162));E=a.stateNode,A=a.memoizedProps;try{E.nodeValue=A}catch(Ye){rr(a,a.return,Ye)}}break;case 3:if(uo(u,a),Do(a),b&4&&p!==null&&p.memoizedState.isDehydrated)try{dl(u.containerInfo)}catch(Ye){rr(a,a.return,Ye)}break;case 4:uo(u,a),Do(a);break;case 13:uo(u,a),Do(a),E=a.child,E.flags&8192&&(A=E.memoizedState!==null,E.stateNode.isHidden=A,!A||E.alternate!==null&&E.alternate.memoizedState!==null||(R_=un())),b&4&&b8(a);break;case 22:if(be=p!==null&&p.memoizedState!==null,a.mode&1?(ps=(ae=ps)||be,uo(u,a),ps=ae):uo(u,a),Do(a),b&8192){if(ae=a.memoizedState!==null,(a.stateNode.isHidden=ae)&&!be&&(a.mode&1)!==0)for(He=a,be=a.child;be!==null;){for(Ee=He=be;He!==null;){switch(we=He,De=we.child,we.tag){case 0:case 11:case 14:case 15:Ph(4,we,we.return);break;case 1:fd(we,we.return);var qe=we.stateNode;if(typeof qe.componentWillUnmount=="function"){b=we,p=we.return;try{u=b,qe.props=u.memoizedProps,qe.state=u.memoizedState,qe.componentWillUnmount()}catch(Ye){rr(b,p,Ye)}}break;case 5:fd(we,we.return);break;case 22:if(we.memoizedState!==null){E8(Ee);continue}}De!==null?(De.return=we,He=De):E8(Ee)}be=be.sibling}e:for(be=null,Ee=a;;){if(Ee.tag===5){if(be===null){be=Ee;try{E=Ee.stateNode,ae?(A=E.style,typeof A.setProperty=="function"?A.setProperty("display","none","important"):A.display="none"):(Z=Ee.stateNode,Y=Ee.memoizedProps.style,M=Y!=null&&Y.hasOwnProperty("display")?Y.display:null,Z.style.display=Tn("display",M))}catch(Ye){rr(a,a.return,Ye)}}}else if(Ee.tag===6){if(be===null)try{Ee.stateNode.nodeValue=ae?"":Ee.memoizedProps}catch(Ye){rr(a,a.return,Ye)}}else if((Ee.tag!==22&&Ee.tag!==23||Ee.memoizedState===null||Ee===a)&&Ee.child!==null){Ee.child.return=Ee,Ee=Ee.child;continue}if(Ee===a)break e;for(;Ee.sibling===null;){if(Ee.return===null||Ee.return===a)break e;be===Ee&&(be=null),Ee=Ee.return}be===Ee&&(be=null),Ee.sibling.return=Ee.return,Ee=Ee.sibling}}break;case 19:uo(u,a),Do(a),b&4&&b8(a);break;case 21:break;default:uo(u,a),Do(a)}}function Do(a){var u=a.flags;if(u&2){try{e:{for(var p=a.return;p!==null;){if(y8(p)){var b=p;break e}p=p.return}throw Error(n(160))}switch(b.tag){case 5:var E=b.stateNode;b.flags&32&&(ss(E,""),b.flags&=-33);var A=_8(a);P_(a,A,E);break;case 3:case 4:var M=b.stateNode.containerInfo,Z=_8(a);C_(a,Z,M);break;default:throw Error(n(161))}}catch(Y){rr(a,a.return,Y)}a.flags&=-3}u&4096&&(a.flags&=-4097)}function UV(a,u,p){He=a,S8(a)}function S8(a,u,p){for(var b=(a.mode&1)!==0;He!==null;){var E=He,A=E.child;if(E.tag===22&&b){var M=E.memoizedState!==null||k0;if(!M){var Z=E.alternate,Y=Z!==null&&Z.memoizedState!==null||ps;Z=k0;var ae=ps;if(k0=M,(ps=Y)&&!ae)for(He=E;He!==null;)M=He,Y=M.child,M.tag===22&&M.memoizedState!==null?C8(E):Y!==null?(Y.return=M,He=Y):C8(E);for(;A!==null;)He=A,S8(A),A=A.sibling;He=E,k0=Z,ps=ae}k8(a)}else(E.subtreeFlags&8772)!==0&&A!==null?(A.return=E,He=A):k8(a)}}function k8(a){for(;He!==null;){var u=He;if((u.flags&8772)!==0){var p=u.alternate;try{if((u.flags&8772)!==0)switch(u.tag){case 0:case 11:case 15:ps||E0(5,u);break;case 1:var b=u.stateNode;if(u.flags&4&&!ps)if(p===null)b.componentDidMount();else{var E=u.elementType===u.type?p.memoizedProps:lo(u.type,p.memoizedProps);b.componentDidUpdate(E,p.memoizedState,b.__reactInternalSnapshotBeforeUpdate)}var A=u.updateQueue;A!==null&&EC(u,A,b);break;case 3:var M=u.updateQueue;if(M!==null){if(p=null,u.child!==null)switch(u.child.tag){case 5:p=u.child.stateNode;break;case 1:p=u.child.stateNode}EC(u,M,p)}break;case 5:var Z=u.stateNode;if(p===null&&u.flags&4){p=Z;var Y=u.memoizedProps;switch(u.type){case"button":case"input":case"select":case"textarea":Y.autoFocus&&p.focus();break;case"img":Y.src&&(p.src=Y.src)}}break;case 6:break;case 4:break;case 12:break;case 13:if(u.memoizedState===null){var ae=u.alternate;if(ae!==null){var be=ae.memoizedState;if(be!==null){var Ee=be.dehydrated;Ee!==null&&dl(Ee)}}}break;case 19:case 17:case 21:case 22:case 23:case 25:break;default:throw Error(n(163))}ps||u.flags&512&&E_(u)}catch(we){rr(u,u.return,we)}}if(u===a){He=null;break}if(p=u.sibling,p!==null){p.return=u.return,He=p;break}He=u.return}}function E8(a){for(;He!==null;){var u=He;if(u===a){He=null;break}var p=u.sibling;if(p!==null){p.return=u.return,He=p;break}He=u.return}}function C8(a){for(;He!==null;){var u=He;try{switch(u.tag){case 0:case 11:case 15:var p=u.return;try{E0(4,u)}catch(Y){rr(u,p,Y)}break;case 1:var b=u.stateNode;if(typeof b.componentDidMount=="function"){var E=u.return;try{b.componentDidMount()}catch(Y){rr(u,E,Y)}}var A=u.return;try{E_(u)}catch(Y){rr(u,A,Y)}break;case 5:var M=u.return;try{E_(u)}catch(Y){rr(u,M,Y)}}}catch(Y){rr(u,u.return,Y)}if(u===a){He=null;break}var Z=u.sibling;if(Z!==null){Z.return=u.return,He=Z;break}He=u.return}}var BV=Math.ceil,C0=C.ReactCurrentDispatcher,A_=C.ReactCurrentOwner,Ui=C.ReactCurrentBatchConfig,Kt=0,Lr=null,hr=null,Yr=0,fi=0,hd=ml(0),Cr=0,Ah=null,jc=0,P0=0,T_=0,Th=null,Vs=null,R_=0,pd=1/0,Ea=null,A0=!1,I_=null,bl=null,T0=!1,xl=null,R0=0,Rh=0,O_=null,I0=-1,O0=0;function As(){return(Kt&6)!==0?un():I0!==-1?I0:I0=un()}function Sl(a){return(a.mode&1)===0?1:(Kt&2)!==0&&Yr!==0?Yr&-Yr:PV.transition!==null?(O0===0&&(O0=Ct()),O0):(a=ot,a!==0||(a=window.event,a=a===void 0?16:A6(a.type)),a)}function fo(a,u,p,b){if(50<Rh)throw Rh=0,O_=null,Error(n(185));an(a,p,b),((Kt&2)===0||a!==Lr)&&(a===Lr&&((Kt&2)===0&&(P0|=p),Cr===4&&kl(a,Yr)),Hs(a,b),p===1&&Kt===0&&(u.mode&1)===0&&(pd=un()+500,o0&&vl()))}function Hs(a,u){var p=a.callbackNode;Ke(a,u);var b=ge(a,a===Lr?Yr:0);if(b===0)p!==null&&Tc(p),a.callbackNode=null,a.callbackPriority=0;else if(u=b&-b,a.callbackPriority!==u){if(p!=null&&Tc(p),u===1)a.tag===0?CV(A8.bind(null,a)):hC(A8.bind(null,a)),xV(function(){(Kt&6)===0&&vl()}),p=null;else{switch(Gr(b)){case 1:p=Di;break;case 4:p=Io;break;case 16:p=Or;break;case 536870912:p=Rc;break;default:p=Or}p=D8(p,P8.bind(null,a))}a.callbackPriority=u,a.callbackNode=p}}function P8(a,u){if(I0=-1,O0=0,(Kt&6)!==0)throw Error(n(327));var p=a.callbackNode;if(md()&&a.callbackNode!==p)return null;var b=ge(a,a===Lr?Yr:0);if(b===0)return null;if((b&30)!==0||(b&a.expiredLanes)!==0||u)u=M0(a,b);else{u=b;var E=Kt;Kt|=2;var A=R8();(Lr!==a||Yr!==u)&&(Ea=null,pd=un()+500,zc(a,u));do try{qV();break}catch(Z){T8(a,Z)}while(!0);Yy(),C0.current=A,Kt=E,hr!==null?u=0:(Lr=null,Yr=0,u=Cr)}if(u!==0){if(u===2&&(E=ft(a),E!==0&&(b=E,u=M_(a,E))),u===1)throw p=Ah,zc(a,0),kl(a,b),Hs(a,un()),p;if(u===6)kl(a,b);else{if(E=a.current.alternate,(b&30)===0&&!ZV(E)&&(u=M0(a,b),u===2&&(A=ft(a),A!==0&&(b=A,u=M_(a,A))),u===1))throw p=Ah,zc(a,0),kl(a,b),Hs(a,un()),p;switch(a.finishedWork=E,a.finishedLanes=b,u){case 0:case 1:throw Error(n(345));case 2:Vc(a,Vs,Ea);break;case 3:if(kl(a,b),(b&130023424)===b&&(u=R_+500-un(),10<u)){if(ge(a,0)!==0)break;if(E=a.suspendedLanes,(E&b)!==b){As(),a.pingedLanes|=a.suspendedLanes&E;break}a.timeoutHandle=Fy(Vc.bind(null,a,Vs,Ea),u);break}Vc(a,Vs,Ea);break;case 4:if(kl(a,b),(b&4194240)===b)break;for(u=a.eventTimes,E=-1;0<b;){var M=31-Es(b);A=1<<M,M=u[M],M>E&&(E=M),b&=~A}if(b=E,b=un()-b,b=(120>b?120:480>b?480:1080>b?1080:1920>b?1920:3e3>b?3e3:4320>b?4320:1960*BV(b/1960))-b,10<b){a.timeoutHandle=Fy(Vc.bind(null,a,Vs,Ea),b);break}Vc(a,Vs,Ea);break;case 5:Vc(a,Vs,Ea);break;default:throw Error(n(329))}}}return Hs(a,un()),a.callbackNode===p?P8.bind(null,a):null}function M_(a,u){var p=Th;return a.current.memoizedState.isDehydrated&&(zc(a,u).flags|=256),a=M0(a,u),a!==2&&(u=Vs,Vs=p,u!==null&&N_(u)),a}function N_(a){Vs===null?Vs=a:Vs.push.apply(Vs,a)}function ZV(a){for(var u=a;;){if(u.flags&16384){var p=u.updateQueue;if(p!==null&&(p=p.stores,p!==null))for(var b=0;b<p.length;b++){var E=p[b],A=E.getSnapshot;E=E.value;try{if(!oo(A(),E))return!1}catch{return!1}}}if(p=u.child,u.subtreeFlags&16384&&p!==null)p.return=u,u=p;else{if(u===a)break;for(;u.sibling===null;){if(u.return===null||u.return===a)return!0;u=u.return}u.sibling.return=u.return,u=u.sibling}}return!0}function kl(a,u){for(u&=~T_,u&=~P0,a.suspendedLanes|=u,a.pingedLanes&=~u,a=a.expirationTimes;0<u;){var p=31-Es(u),b=1<<p;a[p]=-1,u&=~b}}function A8(a){if((Kt&6)!==0)throw Error(n(327));md();var u=ge(a,0);if((u&1)===0)return Hs(a,un()),null;var p=M0(a,u);if(a.tag!==0&&p===2){var b=ft(a);b!==0&&(u=b,p=M_(a,b))}if(p===1)throw p=Ah,zc(a,0),kl(a,u),Hs(a,un()),p;if(p===6)throw Error(n(345));return a.finishedWork=a.current.alternate,a.finishedLanes=u,Vc(a,Vs,Ea),Hs(a,un()),null}function L_(a,u){var p=Kt;Kt|=1;try{return a(u)}finally{Kt=p,Kt===0&&(pd=un()+500,o0&&vl())}}function Fc(a){xl!==null&&xl.tag===0&&(Kt&6)===0&&md();var u=Kt;Kt|=1;var p=Ui.transition,b=ot;try{if(Ui.transition=null,ot=1,a)return a()}finally{ot=b,Ui.transition=p,Kt=u,(Kt&6)===0&&vl()}}function D_(){fi=hd.current,On(hd)}function zc(a,u){a.finishedWork=null,a.finishedLanes=0;var p=a.timeoutHandle;if(p!==-1&&(a.timeoutHandle=-1,bV(p)),hr!==null)for(p=hr.return;p!==null;){var b=p;switch(Zy(b),b.tag){case 1:b=b.type.childContextTypes,b!=null&&s0();break;case 3:ud(),On(js),On(ds),s_();break;case 5:n_(b);break;case 4:ud();break;case 13:On(Zn);break;case 19:On(Zn);break;case 10:Xy(b.type._context);break;case 22:case 23:D_()}p=p.return}if(Lr=a,hr=a=El(a.current,null),Yr=fi=u,Cr=0,Ah=null,T_=P0=jc=0,Vs=Th=null,Lc!==null){for(u=0;u<Lc.length;u++)if(p=Lc[u],b=p.interleaved,b!==null){p.interleaved=null;var E=b.next,A=p.pending;if(A!==null){var M=A.next;A.next=E,b.next=M}p.pending=b}Lc=null}return a}function T8(a,u){do{var p=hr;try{if(Yy(),g0.current=w0,v0){for(var b=Wn.memoizedState;b!==null;){var E=b.queue;E!==null&&(E.pending=null),b=b.next}v0=!1}if($c=0,Nr=Er=Wn=null,xh=!1,Sh=0,A_.current=null,p===null||p.return===null){Cr=1,Ah=u,hr=null;break}e:{var A=a,M=p.return,Z=p,Y=u;if(u=Yr,Z.flags|=32768,Y!==null&&typeof Y=="object"&&typeof Y.then=="function"){var ae=Y,be=Z,Ee=be.tag;if((be.mode&1)===0&&(Ee===0||Ee===11||Ee===15)){var we=be.alternate;we?(be.updateQueue=we.updateQueue,be.memoizedState=we.memoizedState,be.lanes=we.lanes):(be.updateQueue=null,be.memoizedState=null)}var De=e8(M);if(De!==null){De.flags&=-257,t8(De,M,Z,A,u),De.mode&1&&JC(A,ae,u),u=De,Y=ae;var qe=u.updateQueue;if(qe===null){var Ye=new Set;Ye.add(Y),u.updateQueue=Ye}else qe.add(Y);break e}else{if((u&1)===0){JC(A,ae,u),$_();break e}Y=Error(n(426))}}else if(jn&&Z.mode&1){var or=e8(M);if(or!==null){(or.flags&65536)===0&&(or.flags|=256),t8(or,M,Z,A,u),Gy(dd(Y,Z));break e}}A=Y=dd(Y,Z),Cr!==4&&(Cr=2),Th===null?Th=[A]:Th.push(A),A=M;do{switch(A.tag){case 3:A.flags|=65536,u&=-u,A.lanes|=u;var te=XC(A,Y,u);kC(A,te);break e;case 1:Z=Y;var J=A.type,ne=A.stateNode;if((A.flags&128)===0&&(typeof J.getDerivedStateFromError=="function"||ne!==null&&typeof ne.componentDidCatch=="function"&&(bl===null||!bl.has(ne)))){A.flags|=65536,u&=-u,A.lanes|=u;var Te=QC(A,Z,u);kC(A,Te);break e}}A=A.return}while(A!==null)}O8(p)}catch(Je){u=Je,hr===p&&p!==null&&(hr=p=p.return);continue}break}while(!0)}function R8(){var a=C0.current;return C0.current=w0,a===null?w0:a}function $_(){(Cr===0||Cr===3||Cr===2)&&(Cr=4),Lr===null||(jc&268435455)===0&&(P0&268435455)===0||kl(Lr,Yr)}function M0(a,u){var p=Kt;Kt|=2;var b=R8();(Lr!==a||Yr!==u)&&(Ea=null,zc(a,u));do try{WV();break}catch(E){T8(a,E)}while(!0);if(Yy(),Kt=p,C0.current=b,hr!==null)throw Error(n(261));return Lr=null,Yr=0,Cr}function WV(){for(;hr!==null;)I8(hr)}function qV(){for(;hr!==null&&!Bu();)I8(hr)}function I8(a){var u=L8(a.alternate,a,fi);a.memoizedProps=a.pendingProps,u===null?O8(a):hr=u,A_.current=null}function O8(a){var u=a;do{var p=u.alternate;if(a=u.return,(u.flags&32768)===0){if(p=FV(p,u,fi),p!==null){hr=p;return}}else{if(p=zV(p,u),p!==null){p.flags&=32767,hr=p;return}if(a!==null)a.flags|=32768,a.subtreeFlags=0,a.deletions=null;else{Cr=6,hr=null;return}}if(u=u.sibling,u!==null){hr=u;return}hr=u=a}while(u!==null);Cr===0&&(Cr=5)}function Vc(a,u,p){var b=ot,E=Ui.transition;try{Ui.transition=null,ot=1,GV(a,u,p,b)}finally{Ui.transition=E,ot=b}return null}function GV(a,u,p,b){do md();while(xl!==null);if((Kt&6)!==0)throw Error(n(327));p=a.finishedWork;var E=a.finishedLanes;if(p===null)return null;if(a.finishedWork=null,a.finishedLanes=0,p===a.current)throw Error(n(177));a.callbackNode=null,a.callbackPriority=0;var A=p.lanes|p.childLanes;if(vt(a,A),a===Lr&&(hr=Lr=null,Yr=0),(p.subtreeFlags&2064)===0&&(p.flags&2064)===0||T0||(T0=!0,D8(Or,function(){return md(),null})),A=(p.flags&15990)!==0,(p.subtreeFlags&15990)!==0||A){A=Ui.transition,Ui.transition=null;var M=ot;ot=1;var Z=Kt;Kt|=4,A_.current=null,HV(a,p),x8(p,a),pV($y),Bm=!!Dy,$y=Dy=null,a.current=p,UV(p),Ro(),Kt=Z,ot=M,Ui.transition=A}else a.current=p;if(T0&&(T0=!1,xl=a,R0=E),A=a.pendingLanes,A===0&&(bl=null),Wu(p.stateNode),Hs(a,un()),u!==null)for(b=a.onRecoverableError,p=0;p<u.length;p++)E=u[p],b(E.value,{componentStack:E.stack,digest:E.digest});if(A0)throw A0=!1,a=I_,I_=null,a;return(R0&1)!==0&&a.tag!==0&&md(),A=a.pendingLanes,(A&1)!==0?a===O_?Rh++:(Rh=0,O_=a):Rh=0,vl(),null}function md(){if(xl!==null){var a=Gr(R0),u=Ui.transition,p=ot;try{if(Ui.transition=null,ot=16>a?16:a,xl===null)var b=!1;else{if(a=xl,xl=null,R0=0,(Kt&6)!==0)throw Error(n(331));var E=Kt;for(Kt|=4,He=a.current;He!==null;){var A=He,M=A.child;if((He.flags&16)!==0){var Z=A.deletions;if(Z!==null){for(var Y=0;Y<Z.length;Y++){var ae=Z[Y];for(He=ae;He!==null;){var be=He;switch(be.tag){case 0:case 11:case 15:Ph(8,be,A)}var Ee=be.child;if(Ee!==null)Ee.return=be,He=Ee;else for(;He!==null;){be=He;var we=be.sibling,De=be.return;if(v8(be),be===ae){He=null;break}if(we!==null){we.return=De,He=we;break}He=De}}}var qe=A.alternate;if(qe!==null){var Ye=qe.child;if(Ye!==null){qe.child=null;do{var or=Ye.sibling;Ye.sibling=null,Ye=or}while(Ye!==null)}}He=A}}if((A.subtreeFlags&2064)!==0&&M!==null)M.return=A,He=M;else e:for(;He!==null;){if(A=He,(A.flags&2048)!==0)switch(A.tag){case 0:case 11:case 15:Ph(9,A,A.return)}var te=A.sibling;if(te!==null){te.return=A.return,He=te;break e}He=A.return}}var J=a.current;for(He=J;He!==null;){M=He;var ne=M.child;if((M.subtreeFlags&2064)!==0&&ne!==null)ne.return=M,He=ne;else e:for(M=J;He!==null;){if(Z=He,(Z.flags&2048)!==0)try{switch(Z.tag){case 0:case 11:case 15:E0(9,Z)}}catch(Je){rr(Z,Z.return,Je)}if(Z===M){He=null;break e}var Te=Z.sibling;if(Te!==null){Te.return=Z.return,He=Te;break e}He=Z.return}}if(Kt=E,vl(),$s&&typeof $s.onPostCommitFiberRoot=="function")try{$s.onPostCommitFiberRoot(io,a)}catch{}b=!0}return b}finally{ot=p,Ui.transition=u}}return!1}function M8(a,u,p){u=dd(p,u),u=XC(a,u,1),a=_l(a,u,1),u=As(),a!==null&&(an(a,1,u),Hs(a,u))}function rr(a,u,p){if(a.tag===3)M8(a,a,p);else for(;u!==null;){if(u.tag===3){M8(u,a,p);break}else if(u.tag===1){var b=u.stateNode;if(typeof u.type.getDerivedStateFromError=="function"||typeof b.componentDidCatch=="function"&&(bl===null||!bl.has(b))){a=dd(p,a),a=QC(u,a,1),u=_l(u,a,1),a=As(),u!==null&&(an(u,1,a),Hs(u,a));break}}u=u.return}}function KV(a,u,p){var b=a.pingCache;b!==null&&b.delete(u),u=As(),a.pingedLanes|=a.suspendedLanes&p,Lr===a&&(Yr&p)===p&&(Cr===4||Cr===3&&(Yr&130023424)===Yr&&500>un()-R_?zc(a,0):T_|=p),Hs(a,u)}function N8(a,u){u===0&&((a.mode&1)===0?u=1:(u=F,F<<=1,(F&130023424)===0&&(F=4194304)));var p=As();a=xa(a,u),a!==null&&(an(a,u,p),Hs(a,p))}function YV(a){var u=a.memoizedState,p=0;u!==null&&(p=u.retryLane),N8(a,p)}function XV(a,u){var p=0;switch(a.tag){case 13:var b=a.stateNode,E=a.memoizedState;E!==null&&(p=E.retryLane);break;case 19:b=a.stateNode;break;default:throw Error(n(314))}b!==null&&b.delete(u),N8(a,p)}var L8;L8=function(a,u,p){if(a!==null)if(a.memoizedProps!==u.pendingProps||js.current)zs=!0;else{if((a.lanes&p)===0&&(u.flags&128)===0)return zs=!1,jV(a,u,p);zs=(a.flags&131072)!==0}else zs=!1,jn&&(u.flags&1048576)!==0&&pC(u,l0,u.index);switch(u.lanes=0,u.tag){case 2:var b=u.type;S0(a,u),a=u.pendingProps;var E=rd(u,ds.current);cd(u,p),E=a_(null,u,b,a,E,p);var A=l_();return u.flags|=1,typeof E=="object"&&E!==null&&typeof E.render=="function"&&E.$$typeof===void 0?(u.tag=1,u.memoizedState=null,u.updateQueue=null,Fs(b)?(A=!0,i0(u)):A=!1,u.memoizedState=E.state!==null&&E.state!==void 0?E.state:null,e_(u),E.updater=b0,u.stateNode=E,E._reactInternals=u,p_(u,b,a,p),u=y_(null,u,b,!0,A,p)):(u.tag=0,jn&&A&&By(u),Ps(null,u,E,p),u=u.child),u;case 16:b=u.elementType;e:{switch(S0(a,u),a=u.pendingProps,E=b._init,b=E(b._payload),u.type=b,E=u.tag=JV(b),a=lo(b,a),E){case 0:u=v_(null,u,b,a,p);break e;case 1:u=a8(null,u,b,a,p);break e;case 11:u=n8(null,u,b,a,p);break e;case 14:u=r8(null,u,b,lo(b.type,a),p);break e}throw Error(n(306,b,""))}return u;case 0:return b=u.type,E=u.pendingProps,E=u.elementType===b?E:lo(b,E),v_(a,u,b,E,p);case 1:return b=u.type,E=u.pendingProps,E=u.elementType===b?E:lo(b,E),a8(a,u,b,E,p);case 3:e:{if(l8(u),a===null)throw Error(n(387));b=u.pendingProps,A=u.memoizedState,E=A.element,SC(a,u),p0(u,b,null,p);var M=u.memoizedState;if(b=M.element,A.isDehydrated)if(A={element:b,isDehydrated:!1,cache:M.cache,pendingSuspenseBoundaries:M.pendingSuspenseBoundaries,transitions:M.transitions},u.updateQueue.baseState=A,u.memoizedState=A,u.flags&256){E=dd(Error(n(423)),u),u=c8(a,u,b,p,E);break e}else if(b!==E){E=dd(Error(n(424)),u),u=c8(a,u,b,p,E);break e}else for(di=pl(u.stateNode.containerInfo.firstChild),ui=u,jn=!0,ao=null,p=bC(u,null,b,p),u.child=p;p;)p.flags=p.flags&-3|4096,p=p.sibling;else{if(od(),b===E){u=ka(a,u,p);break e}Ps(a,u,b,p)}u=u.child}return u;case 5:return CC(u),a===null&&qy(u),b=u.type,E=u.pendingProps,A=a!==null?a.memoizedProps:null,M=E.children,jy(b,E)?M=null:A!==null&&jy(b,A)&&(u.flags|=32),o8(a,u),Ps(a,u,M,p),u.child;case 6:return a===null&&qy(u),null;case 13:return u8(a,u,p);case 4:return t_(u,u.stateNode.containerInfo),b=u.pendingProps,a===null?u.child=ad(u,null,b,p):Ps(a,u,b,p),u.child;case 11:return b=u.type,E=u.pendingProps,E=u.elementType===b?E:lo(b,E),n8(a,u,b,E,p);case 7:return Ps(a,u,u.pendingProps,p),u.child;case 8:return Ps(a,u,u.pendingProps.children,p),u.child;case 12:return Ps(a,u,u.pendingProps.children,p),u.child;case 10:e:{if(b=u.type._context,E=u.pendingProps,A=u.memoizedProps,M=E.value,Cn(d0,b._currentValue),b._currentValue=M,A!==null)if(oo(A.value,M)){if(A.children===E.children&&!js.current){u=ka(a,u,p);break e}}else for(A=u.child,A!==null&&(A.return=u);A!==null;){var Z=A.dependencies;if(Z!==null){M=A.child;for(var Y=Z.firstContext;Y!==null;){if(Y.context===b){if(A.tag===1){Y=Sa(-1,p&-p),Y.tag=2;var ae=A.updateQueue;if(ae!==null){ae=ae.shared;var be=ae.pending;be===null?Y.next=Y:(Y.next=be.next,be.next=Y),ae.pending=Y}}A.lanes|=p,Y=A.alternate,Y!==null&&(Y.lanes|=p),Qy(A.return,p,u),Z.lanes|=p;break}Y=Y.next}}else if(A.tag===10)M=A.type===u.type?null:A.child;else if(A.tag===18){if(M=A.return,M===null)throw Error(n(341));M.lanes|=p,Z=M.alternate,Z!==null&&(Z.lanes|=p),Qy(M,p,u),M=A.sibling}else M=A.child;if(M!==null)M.return=A;else for(M=A;M!==null;){if(M===u){M=null;break}if(A=M.sibling,A!==null){A.return=M.return,M=A;break}M=M.return}A=M}Ps(a,u,E.children,p),u=u.child}return u;case 9:return E=u.type,b=u.pendingProps.children,cd(u,p),E=Vi(E),b=b(E),u.flags|=1,Ps(a,u,b,p),u.child;case 14:return b=u.type,E=lo(b,u.pendingProps),E=lo(b.type,E),r8(a,u,b,E,p);case 15:return s8(a,u,u.type,u.pendingProps,p);case 17:return b=u.type,E=u.pendingProps,E=u.elementType===b?E:lo(b,E),S0(a,u),u.tag=1,Fs(b)?(a=!0,i0(u)):a=!1,cd(u,p),KC(u,b,E),p_(u,b,E,p),y_(null,u,b,!0,a,p);case 19:return f8(a,u,p);case 22:return i8(a,u,p)}throw Error(n(156,u.tag))};function D8(a,u){return To(a,u)}function QV(a,u,p,b){this.tag=a,this.key=p,this.sibling=this.child=this.return=this.stateNode=this.type=this.elementType=null,this.index=0,this.ref=null,this.pendingProps=u,this.dependencies=this.memoizedState=this.updateQueue=this.memoizedProps=null,this.mode=b,this.subtreeFlags=this.flags=0,this.deletions=null,this.childLanes=this.lanes=0,this.alternate=null}function Bi(a,u,p,b){return new QV(a,u,p,b)}function j_(a){return a=a.prototype,!(!a||!a.isReactComponent)}function JV(a){if(typeof a=="function")return j_(a)?1:0;if(a!=null){if(a=a.$$typeof,a===$)return 11;if(a===q)return 14}return 2}function El(a,u){var p=a.alternate;return p===null?(p=Bi(a.tag,u,a.key,a.mode),p.elementType=a.elementType,p.type=a.type,p.stateNode=a.stateNode,p.alternate=a,a.alternate=p):(p.pendingProps=u,p.type=a.type,p.flags=0,p.subtreeFlags=0,p.deletions=null),p.flags=a.flags&14680064,p.childLanes=a.childLanes,p.lanes=a.lanes,p.child=a.child,p.memoizedProps=a.memoizedProps,p.memoizedState=a.memoizedState,p.updateQueue=a.updateQueue,u=a.dependencies,p.dependencies=u===null?null:{lanes:u.lanes,firstContext:u.firstContext},p.sibling=a.sibling,p.index=a.index,p.ref=a.ref,p}function N0(a,u,p,b,E,A){var M=2;if(b=a,typeof a=="function")j_(a)&&(M=1);else if(typeof a=="string")M=5;else e:switch(a){case I:return Hc(p.children,E,A,u);case R:M=8,E|=8;break;case N:return a=Bi(12,p,u,E|2),a.elementType=N,a.lanes=A,a;case G:return a=Bi(13,p,u,E),a.elementType=G,a.lanes=A,a;case X:return a=Bi(19,p,u,E),a.elementType=X,a.lanes=A,a;case ee:return L0(p,E,A,u);default:if(typeof a=="object"&&a!==null)switch(a.$$typeof){case L:M=10;break e;case z:M=9;break e;case $:M=11;break e;case q:M=14;break e;case H:M=16,b=null;break e}throw Error(n(130,a==null?a:typeof a,""))}return u=Bi(M,p,u,E),u.elementType=a,u.type=b,u.lanes=A,u}function Hc(a,u,p,b){return a=Bi(7,a,b,u),a.lanes=p,a}function L0(a,u,p,b){return a=Bi(22,a,b,u),a.elementType=ee,a.lanes=p,a.stateNode={isHidden:!1},a}function F_(a,u,p){return a=Bi(6,a,null,u),a.lanes=p,a}function z_(a,u,p){return u=Bi(4,a.children!==null?a.children:[],a.key,u),u.lanes=p,u.stateNode={containerInfo:a.containerInfo,pendingChildren:null,implementation:a.implementation},u}function eH(a,u,p,b,E){this.tag=u,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=jt(0),this.expirationTimes=jt(-1),this.entangledLanes=this.finishedLanes=this.mutableReadLanes=this.expiredLanes=this.pingedLanes=this.suspendedLanes=this.pendingLanes=0,this.entanglements=jt(0),this.identifierPrefix=b,this.onRecoverableError=E,this.mutableSourceEagerHydrationData=null}function V_(a,u,p,b,E,A,M,Z,Y){return a=new eH(a,u,p,Z,Y),u===1?(u=1,A===!0&&(u|=8)):u=0,A=Bi(3,null,null,u),a.current=A,A.stateNode=a,A.memoizedState={element:b,isDehydrated:p,cache:null,transitions:null,pendingSuspenseBoundaries:null},e_(A),a}function tH(a,u,p){var b=3<arguments.length&&arguments[3]!==void 0?arguments[3]:null;return{$$typeof:O,key:b==null?null:""+b,children:a,containerInfo:u,implementation:p}}function $8(a){if(!a)return gl;a=a._reactInternals;e:{if(qr(a)!==a||a.tag!==1)throw Error(n(170));var u=a;do{switch(u.tag){case 3:u=u.stateNode.context;break e;case 1:if(Fs(u.type)){u=u.stateNode.__reactInternalMemoizedMergedChildContext;break e}}u=u.return}while(u!==null);throw Error(n(171))}if(a.tag===1){var p=a.type;if(Fs(p))return dC(a,p,u)}return u}function j8(a,u,p,b,E,A,M,Z,Y){return a=V_(p,b,!0,a,E,A,M,Z,Y),a.context=$8(null),p=a.current,b=As(),E=Sl(p),A=Sa(b,E),A.callback=u??null,_l(p,A,E),a.current.lanes=E,an(a,E,b),Hs(a,b),a}function D0(a,u,p,b){var E=u.current,A=As(),M=Sl(E);return p=$8(p),u.context===null?u.context=p:u.pendingContext=p,u=Sa(A,M),u.payload={element:a},b=b===void 0?null:b,b!==null&&(u.callback=b),a=_l(E,u,M),a!==null&&(fo(a,E,M,A),h0(a,E,M)),M}function $0(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 F8(a,u){if(a=a.memoizedState,a!==null&&a.dehydrated!==null){var p=a.retryLane;a.retryLane=p!==0&&p<u?p:u}}function H_(a,u){F8(a,u),(a=a.alternate)&&F8(a,u)}function nH(){return null}var z8=typeof reportError=="function"?reportError:function(a){console.error(a)};function U_(a){this._internalRoot=a}j0.prototype.render=U_.prototype.render=function(a){var u=this._internalRoot;if(u===null)throw Error(n(409));D0(a,u,null,null)},j0.prototype.unmount=U_.prototype.unmount=function(){var a=this._internalRoot;if(a!==null){this._internalRoot=null;var u=a.containerInfo;Fc(function(){D0(null,a,null,null)}),u[ya]=null}};function j0(a){this._internalRoot=a}j0.prototype.unstable_scheduleHydration=function(a){if(a){var u=ul();a={blockedOn:null,target:a,priority:u};for(var p=0;p<yt.length&&u!==0&&u<yt[p].priority;p++);yt.splice(p,0,a),p===0&&us(a)}};function B_(a){return!(!a||a.nodeType!==1&&a.nodeType!==9&&a.nodeType!==11)}function F0(a){return!(!a||a.nodeType!==1&&a.nodeType!==9&&a.nodeType!==11&&(a.nodeType!==8||a.nodeValue!==" react-mount-point-unstable "))}function V8(){}function rH(a,u,p,b,E){if(E){if(typeof b=="function"){var A=b;b=function(){var ae=$0(M);A.call(ae)}}var M=j8(u,b,a,0,null,!1,!1,"",V8);return a._reactRootContainer=M,a[ya]=M.current,ph(a.nodeType===8?a.parentNode:a),Fc(),M}for(;E=a.lastChild;)a.removeChild(E);if(typeof b=="function"){var Z=b;b=function(){var ae=$0(Y);Z.call(ae)}}var Y=V_(a,0,!1,null,null,!1,!1,"",V8);return a._reactRootContainer=Y,a[ya]=Y.current,ph(a.nodeType===8?a.parentNode:a),Fc(function(){D0(u,Y,p,b)}),Y}function z0(a,u,p,b,E){var A=p._reactRootContainer;if(A){var M=A;if(typeof E=="function"){var Z=E;E=function(){var Y=$0(M);Z.call(Y)}}D0(u,M,a,E)}else M=rH(p,u,a,E,b);return $0(M)}va=function(a){switch(a.tag){case 3:var u=a.stateNode;if(u.current.memoizedState.isDehydrated){var p=pe(u.pendingLanes);p!==0&&($n(u,p|1),Hs(u,un()),(Kt&6)===0&&(pd=un()+500,vl()))}break;case 13:Fc(function(){var b=xa(a,1);if(b!==null){var E=As();fo(b,a,1,E)}}),H_(a,1)}},$i=function(a){if(a.tag===13){var u=xa(a,134217728);if(u!==null){var p=As();fo(u,a,134217728,p)}H_(a,134217728)}},Mr=function(a){if(a.tag===13){var u=Sl(a),p=xa(a,u);if(p!==null){var b=As();fo(p,a,u,b)}H_(a,u)}},ul=function(){return ot},qu=function(a,u){var p=ot;try{return ot=a,u()}finally{ot=p}},ks=function(a,u,p){switch(u){case"input":if(xt(a,p),u=p.name,p.type==="radio"&&u!=null){for(p=a;p.parentNode;)p=p.parentNode;for(p=p.querySelectorAll("input[name="+JSON.stringify(""+u)+'][type="radio"]'),u=0;u<p.length;u++){var b=p[u];if(b!==a&&b.form===a.form){var E=r0(b);if(!E)throw Error(n(90));ke(b),xt(b,E)}}}break;case"textarea":Ce(a,p);break;case"select":u=p.value,u!=null&&Ie(a,!!p.multiple,u,!1)}},rt=L_,qt=Fc;var sH={usingClientEntryPoint:!1,Events:[vh,td,r0,Sr,os,L_]},Ih={findFiberByHostInstance:Ic,bundleType:0,version:"18.3.1",rendererPackageName:"react-dom"},iH={bundleType:Ih.bundleType,version:Ih.version,rendererPackageName:Ih.rendererPackageName,rendererConfig:Ih.rendererConfig,overrideHookState:null,overrideHookStateDeletePath:null,overrideHookStateRenamePath:null,overrideProps:null,overridePropsDeletePath:null,overridePropsRenamePath:null,setErrorHandler:null,setSuspenseHandler:null,scheduleUpdate:null,currentDispatcherRef:C.ReactCurrentDispatcher,findHostInstanceByFiber:function(a){return a=Li(a),a===null?null:a.stateNode},findFiberByHostInstance:Ih.findFiberByHostInstance||nH,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 V0=__REACT_DEVTOOLS_GLOBAL_HOOK__;if(!V0.isDisabled&&V0.supportsFiber)try{io=V0.inject(iH),$s=V0}catch{}}return Us.__SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED=sH,Us.createPortal=function(a,u){var p=2<arguments.length&&arguments[2]!==void 0?arguments[2]:null;if(!B_(u))throw Error(n(200));return tH(a,u,null,p)},Us.createRoot=function(a,u){if(!B_(a))throw Error(n(299));var p=!1,b="",E=z8;return u!=null&&(u.unstable_strictMode===!0&&(p=!0),u.identifierPrefix!==void 0&&(b=u.identifierPrefix),u.onRecoverableError!==void 0&&(E=u.onRecoverableError)),u=V_(a,1,!1,null,null,p,!1,b,E),a[ya]=u.current,ph(a.nodeType===8?a.parentNode:a),new U_(u)},Us.findDOMNode=function(a){if(a==null)return null;if(a.nodeType===1)return a;var u=a._reactInternals;if(u===void 0)throw typeof a.render=="function"?Error(n(188)):(a=Object.keys(a).join(","),Error(n(268,a)));return a=Li(u),a=a===null?null:a.stateNode,a},Us.flushSync=function(a){return Fc(a)},Us.hydrate=function(a,u,p){if(!F0(u))throw Error(n(200));return z0(null,a,u,!0,p)},Us.hydrateRoot=function(a,u,p){if(!B_(a))throw Error(n(405));var b=p!=null&&p.hydratedSources||null,E=!1,A="",M=z8;if(p!=null&&(p.unstable_strictMode===!0&&(E=!0),p.identifierPrefix!==void 0&&(A=p.identifierPrefix),p.onRecoverableError!==void 0&&(M=p.onRecoverableError)),u=j8(u,null,a,1,p??null,E,!1,A,M),a[ya]=u.current,ph(a),b)for(a=0;a<b.length;a++)p=b[a],E=p._getVersion,E=E(p._source),u.mutableSourceEagerHydrationData==null?u.mutableSourceEagerHydrationData=[p,E]:u.mutableSourceEagerHydrationData.push(p,E);return new j0(u)},Us.render=function(a,u,p){if(!F0(u))throw Error(n(200));return z0(null,a,u,!1,p)},Us.unmountComponentAtNode=function(a){if(!F0(a))throw Error(n(40));return a._reactRootContainer?(Fc(function(){z0(null,null,a,!1,function(){a._reactRootContainer=null,a[ya]=null})}),!0):!1},Us.unstable_batchedUpdates=L_,Us.unstable_renderSubtreeIntoContainer=function(a,u,p,b){if(!F0(p))throw Error(n(200));if(a==null||a._reactInternals===void 0)throw Error(n(38));return z0(a,u,p,!1,b)},Us.version="18.3.1-next-f1338f8080-20240426",Us}var pT;function tL(){if(pT)return G2.exports;pT=1;function t(){if(!(typeof __REACT_DEVTOOLS_GLOBAL_HOOK__>"u"||typeof __REACT_DEVTOOLS_GLOBAL_HOOK__.checkDCE!="function"))try{__REACT_DEVTOOLS_GLOBAL_HOOK__.checkDCE(t)}catch(e){console.error(e)}}return t(),G2.exports=Hee(),G2.exports}var mT;function Uee(){if(mT)return lg;mT=1;var t=tL();return lg.createRoot=t.createRoot,lg.hydrateRoot=t.hydrateRoot,lg}var Bee=Uee();const Zee=E1(Bee),Wee=t=>{const e=t==null?void 0:t.userId,n=t==null?void 0:t.email;g.useEffect(()=>{FN({userId:e,email:n})},[e,n])},Ba={BASE_URL:"/",DEV:!1,MODE:"production",PROD:!0,SSR:!1,VITE_SENTRY_DSN:""};function nL(t){return"init"in t}function hx(t){return typeof t.write=="function"}function qee(t){return!!t.onMount}function gT(t){return"v"in t||"e"in t}function Zv(t){if("e"in t)throw t.e;if((Ba?"production":void 0)!=="production"&&!("v"in t))throw new Error("[Bug] atom state is not initialized");return t.v}function Wv(t){return typeof(t==null?void 0:t.then)=="function"}function Gee(t){if(!(t instanceof Error))return!1;const e=t.name,n=t.message.toLowerCase();return(e==="RangeError"||e==="InternalError")&&(n.includes("call stack")||n.includes("too much recursion")||n.includes("stack overflow"))}function rL(t,e,n){if(!n.p.has(t)){n.p.add(t);const r=()=>n.p.delete(t);e.then(r,r)}}function sL(t,e,n){const r=n.get(t),s=r==null?void 0:r.t,i=e.p;if(!(s!=null&&s.size))return i;if(!i.size)return s;const o=new Set(s);for(const l of i)o.add(l);return o}function Kee(t){return!!t.INTERNAL_onInit}const Yee=(t,e,n,...r)=>n.read(...r),Xee=(t,e,n,...r)=>n.write(...r),Qee=(t,e,n)=>n.INTERNAL_onInit(e),Jee=(t,e,n,r)=>{var s;return(s=n.onMount)==null?void 0:s.call(n,r)},ete=(t,e,n)=>{var r;const s=t[0];let i=s.get(n);if(!i){const o=t[6],l=t[9];i={d:new Map,p:new Set,n:0},s.set(n,i),(r=o.i)==null||r.call(o,n),Kee(n)&&l(t,e,n)}return i},tte=(t,e)=>{var n;const r=t[1],s=t[3],i=t[4],o=t[5],l=t[6],c=t[13];if(!l.f&&!s.size&&!i.size&&!o.size)return;const d=[],f=h=>{try{h()}catch(m){d.push(m)}};do{l.f&&f(l.f);const h=new Set;for(const m of s){const v=(n=r.get(m))==null?void 0:n.l;if(v)for(const _ of v)h.add(_)}s.clear();for(const m of o)h.add(m);o.clear();for(const m of i)h.add(m);i.clear();for(const m of h)f(m);s.size&&c(t,e)}while(s.size||o.size||i.size);if(d.length)throw new AggregateError(d)},nte=(t,e)=>{const n=t[1],r=t[2],s=t[3],i=t[11],o=t[14],l=t[17];if(!s.size)return;const c=[],d=[],f=new WeakSet,h=new WeakSet,m=[],v=[];for(const _ of s)m.push(_),v.push(i(t,e,_));for(;m.length;){const _=m.length-1,y=m[_],w=v[_];if(h.has(y)){m.pop(),v.pop();continue}if(f.has(y)){if(r.get(y)===w.n)c.push(y),d.push(w);else if((Ba?"production":void 0)!=="production"&&r.has(y))throw new Error("[Bug] invalidated atom exists");h.add(y),m.pop(),v.pop();continue}f.add(y);for(const x of sL(y,w,n))f.has(x)||(m.push(x),v.push(i(t,e,x)))}for(let _=c.length-1;_>=0;--_){const y=c[_],w=d[_];let x=!1;for(const k of w.d.keys())if(k!==y&&s.has(k)){x=!0;break}x&&(r.set(y,w.n),o(t,e,y),l(t,e,y)),r.delete(y)}},px=new WeakSet,rte=(t,e,n)=>{var r,s;const i=t[1],o=t[2],l=t[3],c=t[6],d=t[7],f=t[11],h=t[12],m=t[13],v=t[14],_=t[16],y=t[17],w=t[20],x=t[26],k=t[28],P=f(t,e,n),C=k[0];if(gT(P)){if(i.has(n)&&o.get(n)!==P.n||P.m===C)return P.m=C,P;let q=!1;for(const[H,ee]of P.d)if(v(t,e,H).n!==ee){q=!0;break}if(!q)return P.m=C,P}let T=!0;const O=new Set(P.d.keys()),I=()=>{for(const q of O)P.d.delete(q)},R=()=>{if(i.has(n)){const q=!l.size;y(t,e,n),q&&(m(t,e),h(t,e))}},N=q=>{var H;if(q===n){const V=f(t,e,q);if(!gT(V))if(nL(q))w(t,e,q,q.init);else throw new Error("no atom init");return Zv(V)}const ee=v(t,e,q);try{return Zv(ee)}finally{O.delete(q),P.d.set(q,ee.n),Wv(P.v)&&rL(n,P.v,ee),i.has(n)&&((H=i.get(q))==null||H.t.add(n)),T||R()}};let L,z;const $={get signal(){return L||(L=new AbortController),L.signal},get setSelf(){return(Ba?"production":void 0)!=="production"&&console.warn("[DEPRECATED] setSelf is deprecated and will be removed in v3."),(Ba?"production":void 0)!=="production"&&!hx(n)&&console.warn("setSelf function cannot be used with read-only atom"),!z&&hx(n)&&(z=(...q)=>{if((Ba?"production":void 0)!=="production"&&T&&console.warn("setSelf function cannot be called in sync"),!T)try{return _(t,e,n,q)}finally{m(t,e),h(t,e)}}),z}},G=P.n,X=o.get(n)===G;try{(Ba?"production":void 0)!=="production"&&px.delete(e);const q=d(t,e,n,N,$);if((Ba?"production":void 0)!=="production"&&px.has(e)&&console.warn("Detected store mutation during atom read. This is not supported."),w(t,e,n,q),Wv(q)){x(t,e,q,()=>L==null?void 0:L.abort());const H=()=>{I(),R()};q.then(H,H)}else I();return(r=c.r)==null||r.call(c,n),P.m=C,P}catch(q){if(Gee(q))throw q;return delete P.v,P.e=q,++P.n,P.m=C,P}finally{T=!1,P.n!==G&&X&&(o.set(n,P.n),l.add(n),(s=c.c)==null||s.call(c,n))}},ste=(t,e,n)=>{const r=t[1],s=t[2],i=t[11],o=[n];for(;o.length;){const l=o.pop(),c=i(t,e,l);for(const d of sL(l,c,r)){const f=i(t,e,d);s.get(d)!==f.n&&(s.set(d,f.n),o.push(d))}}},ite=(t,e,n,r)=>{const s=t[3],i=t[6],o=t[8],l=t[11],c=t[12],d=t[13],f=t[14],h=t[15],m=t[16],v=t[17],_=t[20],y=t[28];let w=!0;const x=P=>Zv(f(t,e,P)),k=(P,...C)=>{var T;const O=l(t,e,P);try{if(P===n){if(!nL(P))throw new Error("atom not writable");(Ba?"production":void 0)!=="production"&&px.add(e);const I=O.n,R=C[0];_(t,e,P,R),v(t,e,P),I!==O.n&&(++y[0],s.add(P),h(t,e,P),(T=i.c)==null||T.call(i,P));return}else return m(t,e,P,C)}finally{w||(d(t,e),c(t,e))}};try{return o(t,e,n,x,k,...r)}finally{w=!1}},ote=(t,e,n)=>{var r;const s=t[1],i=t[3],o=t[6],l=t[11],c=t[15],d=t[18],f=t[19],h=l(t,e,n),m=s.get(n);if(m&&h.d.size>0){for(const[v,_]of h.d)if(!m.d.has(v)){const y=l(t,e,v);d(t,e,v).t.add(n),m.d.add(v),_!==y.n&&(i.add(v),c(t,e,v),(r=o.c)==null||r.call(o,v))}for(const v of m.d)if(!h.d.has(v)){m.d.delete(v);const _=f(t,e,v);_==null||_.t.delete(n)}}},ate=(t,e,n)=>{var r;const s=t[1],i=t[4],o=t[6],l=t[10],c=t[11],d=t[12],f=t[13],h=t[14],m=t[16],v=t[18],_=c(t,e,n);let y=s.get(n);if(!y){h(t,e,n);for(const w of _.d.keys())v(t,e,w).t.add(n);if(y={l:new Set,d:new Set(_.d.keys()),t:new Set},s.set(n,y),hx(n)&&qee(n)){const w=()=>{let x=!0;const k=(...P)=>{try{return m(t,e,n,P)}finally{x||(f(t,e),d(t,e))}};try{const P=l(t,e,n,k);P&&(y.u=()=>{x=!0;try{P()}finally{x=!1}})}finally{x=!1}};i.add(w)}(r=o.m)==null||r.call(o,n)}return y},lte=(t,e,n)=>{var r,s;const i=t[1],o=t[5],l=t[6],c=t[11],d=t[19],f=c(t,e,n);let h=i.get(n);if(!h||h.l.size)return h;let m=!1;for(const v of h.t)if((r=i.get(v))!=null&&r.d.has(n)){m=!0;break}if(!m){h.u&&o.add(h.u),h=void 0,i.delete(n);for(const v of f.d.keys()){const _=d(t,e,v);_==null||_.t.delete(n)}(s=l.u)==null||s.call(l,n);return}return h},cte=(t,e,n,r)=>{const s=t[11],i=t[27],o=s(t,e,n),l="v"in o,c=o.v;if(Wv(r))for(const d of o.d.keys())rL(n,r,s(t,e,d));o.v=r,delete o.e,(!l||!Object.is(c,o.v))&&(++o.n,Wv(c)&&i(t,e,c))},ute=(t,e,n)=>{const r=t[14];return Zv(r(t,e,n))},dte=(t,e,n,...r)=>{const s=t[3],i=t[12],o=t[13],l=t[16],c=s.size;try{return l(t,e,n,r)}finally{s.size!==c&&(o(t,e),i(t,e))}},fte=(t,e,n,r)=>{const s=t[12],i=t[13],o=t[18],l=t[19],d=o(t,e,n).l;return d.add(r),i(t,e),s(t,e),()=>{d.delete(r),l(t,e,n),i(t,e),s(t,e)}},hte=(t,e,n,r)=>{const s=t[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)},pte=(t,e,n)=>{const s=t[25].get(n);s==null||s.forEach(i=>i())},iL=new WeakMap;function mte(t){const e=iL.get(t);if((Ba?"production":void 0)!=="production"&&!e)throw new Error("Store must be created by buildStore to read its building blocks");const n=e[24];return n?n(e,t):e}function gte(...t){const e={get(o){return r(n,e,o)},set(o,...l){return s(n,e,o,...l)},sub(o,l){return i(n,e,o,l)}},n=[new WeakMap,new WeakMap,new WeakMap,new Set,new Set,new Set,{},Yee,Xee,Qee,Jee,ete,tte,nte,rte,ste,ite,ote,ate,lte,cte,ute,dte,fte,void 0,new WeakMap,hte,pte,[0]].map((o,l)=>t[l]||o);iL.set(e,Object.freeze(n));const r=n[21],s=n[22],i=n[23];return e}const oL={};let vte=0;function mn(t,e){const n=`atom${++vte}`,r={toString(){return(oL?"production":void 0)!=="production"&&this.debugLabel?n+":"+this.debugLabel:n}};return typeof t=="function"?r.read=t:(r.init=t,r.read=yte,r.write=_te),r}function yte(t){return t(this)}function _te(t,e,n){return e(this,typeof n=="function"?n(t(this)):n)}function wte(){return gte()}let Wh;function bte(){return Wh||(Wh=wte(),(oL?"production":void 0)!=="production"&&(globalThis.__JOTAI_DEFAULT_STORE__||(globalThis.__JOTAI_DEFAULT_STORE__=Wh),globalThis.__JOTAI_DEFAULT_STORE__!==Wh&&console.warn("Detected multiple Jotai instances. It may cause unexpected behavior with the default store. https://github.com/pmndrs/jotai/discussions/2044"))),Wh}const xte={},Ste=g.createContext(void 0);function Mk(t){return g.useContext(Ste)||bte()}const mx=t=>typeof(t==null?void 0:t.then)=="function",gx=t=>{t.status||(t.status="pending",t.then(e=>{t.status="fulfilled",t.value=e},e=>{t.status="rejected",t.reason=e}))},kte=Ae.use||(t=>{if(t.status==="pending")throw t;if(t.status==="fulfilled")return t.value;throw t.status==="rejected"?t.reason:(gx(t),t)}),X2=new WeakMap,vT=(t,e,n)=>{const r=mte(t),s=r[26];let i=X2.get(e);return i||(i=new Promise((o,l)=>{let c=e;const d=m=>v=>{c===m&&o(v)},f=m=>v=>{c===m&&l(v)},h=()=>{try{const m=n();mx(m)?(X2.set(m,i),c=m,m.then(d(m),f(m)),s(r,t,m,h)):o(m)}catch(m){l(m)}};e.then(d(e),f(e)),s(r,t,e,h)}),X2.set(e,i)),i};function _t(t,e){const{delay:n,unstable_promiseStatus:r=!Ae.use}={},s=Mk(),[[i,o,l],c]=g.useReducer(f=>{const h=s.get(t);return Object.is(f[0],h)&&f[1]===s&&f[2]===t?f:[h,s,t]},void 0,()=>[s.get(t),s,t]);let d=i;if((o!==s||l!==t)&&(c(),d=s.get(t)),g.useEffect(()=>{const f=s.sub(t,()=>{if(r)try{const h=s.get(t);mx(h)&&gx(vT(s,h,()=>s.get(t)))}catch{}if(typeof n=="number"){console.warn(`[DEPRECATED] delay option is deprecated and will be removed in v3.
|
|
101
|
-
|
|
102
|
-
Migration guide:
|
|
103
|
-
|
|
104
|
-
Create a custom hook like the following.
|
|
105
|
-
|
|
106
|
-
function useAtomValueWithDelay<Value>(
|
|
107
|
-
atom: Atom<Value>,
|
|
108
|
-
options: { delay: number },
|
|
109
|
-
): Value {
|
|
110
|
-
const { delay } = options
|
|
111
|
-
const store = useStore(options)
|
|
112
|
-
const [value, setValue] = useState(() => store.get(atom))
|
|
113
|
-
useEffect(() => {
|
|
114
|
-
const unsub = store.sub(atom, () => {
|
|
115
|
-
setTimeout(() => setValue(store.get(atom)), delay)
|
|
116
|
-
})
|
|
117
|
-
return unsub
|
|
118
|
-
}, [store, atom, delay])
|
|
119
|
-
return value
|
|
120
|
-
}
|
|
121
|
-
`),setTimeout(c,n);return}c()});return c(),f},[s,t,n,r]),g.useDebugValue(d),mx(d)){const f=vT(s,d,()=>s.get(t));return r&&gx(f),kte(f)}return d}function Lt(t,e){const n=Mk();return g.useCallback((...s)=>{if((xte?"production":void 0)!=="production"&&!("write"in t))throw new Error("not writable atom");return n.set(t,...s)},[n,t])}function aL(t,e){return[_t(t),Lt(t)]}const Nk=g.createContext({});function Lk(t){const e=g.useRef(null);return e.current===null&&(e.current=t()),e.current}const Ete=typeof window<"u",Dk=Ete?g.useLayoutEffect:g.useEffect,$1=g.createContext(null);function $k(t,e){t.indexOf(e)===-1&&t.push(e)}function qv(t,e){const n=t.indexOf(e);n>-1&&t.splice(n,1)}const la=(t,e,n)=>n>e?e:n<t?t:n;let j1=()=>{};const fc={},lL=t=>/^-?(?:\d+(?:\.\d+)?|\.\d+)$/u.test(t),cL=t=>typeof t=="object"&&t!==null,uL=t=>/^0[^.\s]+$/u.test(t);function dL(t){let e;return()=>(e===void 0&&(e=t()),e)}const to=t=>t,Im=(...t)=>t.reduce((e,n)=>r=>n(e(r))),Jp=(t,e,n)=>{const r=e-t;return r?(n-t)/r:1};class jk{constructor(){this.subscriptions=[]}add(e){return $k(this.subscriptions,e),()=>qv(this.subscriptions,e)}notify(e,n,r){const s=this.subscriptions.length;if(s)if(s===1)this.subscriptions[0](e,n,r);else for(let i=0;i<s;i++){const o=this.subscriptions[i];o&&o(e,n,r)}}getSize(){return this.subscriptions.length}clear(){this.subscriptions.length=0}}const xi=t=>t*1e3,Yi=t=>t/1e3,fL=(t,e)=>e?t*(1e3/e):0,hL=(t,e,n)=>(((1-3*n+3*e)*t+(3*n-6*e))*t+3*e)*t,Cte=1e-7,Pte=12;function Ate(t,e,n,r,s){let i,o,l=0;do o=e+(n-e)/2,i=hL(o,r,s)-t,i>0?n=o:e=o;while(Math.abs(i)>Cte&&++l<Pte);return o}function Om(t,e,n,r){if(t===e&&n===r)return to;const s=i=>Ate(i,0,1,t,n);return i=>i===0||i===1?i:hL(s(i),e,r)}const pL=t=>e=>e<=.5?t(2*e)/2:(2-t(2*(1-e)))/2,mL=t=>e=>1-t(1-e),gL=Om(.33,1.53,.69,.99),Fk=mL(gL),vL=pL(Fk),yL=t=>t>=1?1:(t*=2)<1?.5*Fk(t):.5*(2-Math.pow(2,-10*(t-1))),zk=t=>1-Math.sin(Math.acos(t)),_L=mL(zk),wL=pL(zk),Tte=Om(.42,0,1,1),Rte=Om(0,0,.58,1),bL=Om(.42,0,.58,1),Ite=t=>Array.isArray(t)&&typeof t[0]!="number",xL=t=>Array.isArray(t)&&typeof t[0]=="number",Ote={linear:to,easeIn:Tte,easeInOut:bL,easeOut:Rte,circIn:zk,circInOut:wL,circOut:_L,backIn:Fk,backInOut:vL,backOut:gL,anticipate:yL},Mte=t=>typeof t=="string",yT=t=>{if(xL(t)){j1(t.length===4);const[e,n,r,s]=t;return Om(e,n,r,s)}else if(Mte(t))return Ote[t];return t},cg=["setup","read","resolveKeyframes","preUpdate","update","preRender","render","postRender"];function Nte(t){let e=new Set,n=new Set,r=!1,s=!1;const i=new WeakSet;let o={delta:0,timestamp:0,isProcessing:!1};function l(d){i.has(d)&&(c.schedule(d),t()),d(o)}const c={schedule:(d,f=!1,h=!1)=>{const v=h&&r?e: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=e;e=n,n=f,e.forEach(l),e.clear(),r=!1,s&&(s=!1,c.process(d))}};return c}const Lte=40;function SL(t,e){let n=!1,r=!0;const s={delta:0,timestamp:0,isProcessing:!1},i=()=>n=!0,o=cg.reduce((P,C)=>(P[C]=Nte(i),P),{}),{setup:l,read:c,resolveKeyframes:d,preUpdate:f,update:h,preRender:m,render:v,postRender:_}=o,y=()=>{const P=fc.useManualTiming,C=P?s.timestamp:performance.now();n=!1,P||(s.delta=r?1e3/60:Math.max(Math.min(C-s.timestamp,Lte),1)),s.timestamp=C,s.isProcessing=!0,l.process(s),c.process(s),d.process(s),f.process(s),h.process(s),m.process(s),v.process(s),_.process(s),s.isProcessing=!1,n&&e&&(r=!1,t(y))},w=()=>{n=!0,r=!0,s.isProcessing||t(y)};return{schedule:cg.reduce((P,C)=>{const T=o[C];return P[C]=(O,I=!1,R=!1)=>(n||w(),T.schedule(O,I,R)),P},{}),cancel:P=>{for(let C=0;C<cg.length;C++)o[cg[C]].cancel(P)},state:s,steps:o}}const{schedule:Sn,cancel:hc,state:Qr,steps:Q2}=SL(typeof requestAnimationFrame<"u"?requestAnimationFrame:to,!0);let Ug;function Dte(){Ug=void 0}const Ls={now:()=>(Ug===void 0&&Ls.set(Qr.isProcessing||fc.useManualTiming?Qr.timestamp:performance.now()),Ug),set:t=>{Ug=t,queueMicrotask(Dte)}},kL=t=>e=>typeof e=="string"&&e.startsWith(t),EL=kL("--"),$te=kL("var(--"),Vk=t=>$te(t)?jte.test(t.split("/*")[0].trim()):!1,jte=/var\(--(?:[\w-]+\s*|[\w-]+\s*,(?:\s*[^)(\s]|\s*\((?:[^)(]|\([^)(]*\))*\))+\s*)\)$/iu;function _T(t){return typeof t!="string"?!1:t.split("/*")[0].includes("var(--")}const Xf={test:t=>typeof t=="number",parse:parseFloat,transform:t=>t},em={...Xf,transform:t=>la(0,1,t)},ug={...Xf,default:1},Pp=t=>Math.round(t*1e5)/1e5,Hk=/-?(?:\d+(?:\.\d+)?|\.\d+)/gu;function Fte(t){return t==null}const zte=/^(?:#[\da-f]{3,8}|(?:rgb|hsl)a?\((?:-?[\d.]+%?[,\s]+){2}-?[\d.]+%?\s*(?:[,/]\s*)?(?:\b\d+(?:\.\d+)?|\.\d+)?%?\))$/iu,Uk=(t,e)=>n=>!!(typeof n=="string"&&zte.test(n)&&n.startsWith(t)||e&&!Fte(n)&&Object.prototype.hasOwnProperty.call(n,e)),CL=(t,e,n)=>r=>{if(typeof r!="string")return r;const[s,i,o,l]=r.match(Hk);return{[t]:parseFloat(s),[e]:parseFloat(i),[n]:parseFloat(o),alpha:l!==void 0?parseFloat(l):1}},Vte=t=>la(0,255,t),J2={...Xf,transform:t=>Math.round(Vte(t))},lu={test:Uk("rgb","red"),parse:CL("red","green","blue"),transform:({red:t,green:e,blue:n,alpha:r=1})=>"rgba("+J2.transform(t)+", "+J2.transform(e)+", "+J2.transform(n)+", "+Pp(em.transform(r))+")"};function Hte(t){let e="",n="",r="",s="";return t.length>5?(e=t.substring(1,3),n=t.substring(3,5),r=t.substring(5,7),s=t.substring(7,9)):(e=t.substring(1,2),n=t.substring(2,3),r=t.substring(3,4),s=t.substring(4,5),e+=e,n+=n,r+=r,s+=s),{red:parseInt(e,16),green:parseInt(n,16),blue:parseInt(r,16),alpha:s?parseInt(s,16)/255:1}}const vx={test:Uk("#"),parse:Hte,transform:lu.transform},Mm=t=>({test:e=>typeof e=="string"&&e.endsWith(t)&&e.split(" ").length===1,parse:parseFloat,transform:e=>`${e}${t}`}),La=Mm("deg"),ra=Mm("%"),Ge=Mm("px"),Ute=Mm("vh"),Bte=Mm("vw"),wT={...ra,parse:t=>ra.parse(t)/100,transform:t=>ra.transform(t*100)},Bd={test:Uk("hsl","hue"),parse:CL("hue","saturation","lightness"),transform:({hue:t,saturation:e,lightness:n,alpha:r=1})=>"hsla("+Math.round(t)+", "+ra.transform(Pp(e))+", "+ra.transform(Pp(n))+", "+Pp(em.transform(r))+")"},vr={test:t=>lu.test(t)||vx.test(t)||Bd.test(t),parse:t=>lu.test(t)?lu.parse(t):Bd.test(t)?Bd.parse(t):vx.parse(t),transform:t=>typeof t=="string"?t:t.hasOwnProperty("red")?lu.transform(t):Bd.transform(t),getAnimatableNone:t=>{const e=vr.parse(t);return e.alpha=0,vr.transform(e)}},Zte=/(?:#[\da-f]{3,8}|(?:rgb|hsl)a?\((?:-?[\d.]+%?[,\s]+){2}-?[\d.]+%?\s*(?:[,/]\s*)?(?:\b\d+(?:\.\d+)?|\.\d+)?%?\))/giu;function Wte(t){var e,n;return isNaN(t)&&typeof t=="string"&&(((e=t.match(Hk))==null?void 0:e.length)||0)+(((n=t.match(Zte))==null?void 0:n.length)||0)>0}const PL="number",AL="color",qte="var",Gte="var(",bT="${}",Kte=/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 $f(t){const e=t.toString(),n=[],r={color:[],number:[],var:[]},s=[];let i=0;const l=e.replace(Kte,c=>(vr.test(c)?(r.color.push(i),s.push(AL),n.push(vr.parse(c))):c.startsWith(Gte)?(r.var.push(i),s.push(qte),n.push(c)):(r.number.push(i),s.push(PL),n.push(parseFloat(c))),++i,bT)).split(bT);return{values:n,split:l,indexes:r,types:s}}function Yte(t){return $f(t).values}function TL({split:t,types:e}){const n=t.length;return r=>{let s="";for(let i=0;i<n;i++)if(s+=t[i],r[i]!==void 0){const o=e[i];o===PL?s+=Pp(r[i]):o===AL?s+=vr.transform(r[i]):s+=r[i]}return s}}function Xte(t){return TL($f(t))}const Qte=t=>typeof t=="number"?0:vr.test(t)?vr.getAnimatableNone(t):t,Jte=(t,e)=>typeof t=="number"?e!=null&&e.trim().endsWith("/")?t:0:Qte(t);function ene(t){const e=$f(t);return TL(e)(e.values.map((r,s)=>Jte(r,e.split[s])))}const Eo={test:Wte,parse:Yte,createTransformer:Xte,getAnimatableNone:ene};function ew(t,e,n){return n<0&&(n+=1),n>1&&(n-=1),n<1/6?t+(e-t)*6*n:n<1/2?e:n<2/3?t+(e-t)*(2/3-n)*6:t}function tne({hue:t,saturation:e,lightness:n,alpha:r}){t/=360,e/=100,n/=100;let s=0,i=0,o=0;if(!e)s=i=o=n;else{const l=n<.5?n*(1+e):n+e-n*e,c=2*n-l;s=ew(c,l,t+1/3),i=ew(c,l,t),o=ew(c,l,t-1/3)}return{red:Math.round(s*255),green:Math.round(i*255),blue:Math.round(o*255),alpha:r}}function Gv(t,e){return n=>n>0?e:t}const xn=(t,e,n)=>t+(e-t)*n,tw=(t,e,n)=>{const r=t*t,s=n*(e*e-r)+r;return s<0?0:Math.sqrt(s)},nne=[vx,lu,Bd],rne=t=>nne.find(e=>e.test(t));function xT(t){const e=rne(t);if(!e)return!1;let n=e.parse(t);return e===Bd&&(n=tne(n)),n}const ST=(t,e)=>{const n=xT(t),r=xT(e);if(!n||!r)return Gv(t,e);const s={...n};return i=>(s.red=tw(n.red,r.red,i),s.green=tw(n.green,r.green,i),s.blue=tw(n.blue,r.blue,i),s.alpha=xn(n.alpha,r.alpha,i),lu.transform(s))},yx=new Set(["none","hidden"]);function sne(t,e){return yx.has(t)?n=>n<=0?t:e:n=>n>=1?e:t}function ine(t,e){return n=>xn(t,e,n)}function Bk(t){return typeof t=="number"?ine:typeof t=="string"?Vk(t)?Gv:vr.test(t)?ST:lne:Array.isArray(t)?RL:typeof t=="object"?vr.test(t)?ST:one:Gv}function RL(t,e){const n=[...t],r=n.length,s=t.map((i,o)=>Bk(i)(i,e[o]));return i=>{for(let o=0;o<r;o++)n[o]=s[o](i);return n}}function one(t,e){const n={...t,...e},r={};for(const s in n)t[s]!==void 0&&e[s]!==void 0&&(r[s]=Bk(t[s])(t[s],e[s]));return s=>{for(const i in r)n[i]=r[i](s);return n}}function ane(t,e){const n=[],r={color:0,var:0,number:0};for(let s=0;s<e.values.length;s++){const i=e.types[s],o=t.indexes[i][r[i]],l=t.values[o]??0;n[s]=l,r[i]++}return n}const lne=(t,e)=>{const n=Eo.createTransformer(e),r=$f(t),s=$f(e);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?yx.has(t)&&!s.values.length||yx.has(e)&&!r.values.length?sne(t,e):Im(RL(ane(r,s),s.values),n):Gv(t,e)};function IL(t,e,n){return typeof t=="number"&&typeof e=="number"&&typeof n=="number"?xn(t,e,n):Bk(t)(t,e)}const cne=t=>{const e=({timestamp:n})=>t(n);return{start:(n=!0)=>Sn.update(e,n),stop:()=>hc(e),now:()=>Qr.isProcessing?Qr.timestamp:Ls.now()}},OL=(t,e,n=10)=>{let r="";const s=Math.max(Math.round(e/n),2);for(let i=0;i<s;i++)r+=Math.round(t(i/(s-1))*1e4)/1e4+", ";return`linear(${r.substring(0,r.length-2)})`},Kv=2e4;function Zk(t){let e=0;const n=50;let r=t.next(e);for(;!r.done&&e<Kv;)e+=n,r=t.next(e);return e>=Kv?1/0:e}function une(t,e=100,n){const r=n({...t,keyframes:[0,e]}),s=Math.min(Zk(r),Kv);return{type:"keyframes",ease:i=>r.next(s*i).value/e,duration:Yi(s)}}const sr={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 _x(t,e){return t*Math.sqrt(1-e*e)}const dne=12;function fne(t,e,n){let r=n;for(let s=1;s<dne;s++)r=r-t(r)/e(r);return r}const nw=.001;function hne({duration:t=sr.duration,bounce:e=sr.bounce,velocity:n=sr.velocity,mass:r=sr.mass}){let s,i,o=1-e;o=la(sr.minDamping,sr.maxDamping,o),t=la(sr.minDuration,sr.maxDuration,Yi(t)),o<1?(s=d=>{const f=d*o,h=f*t,m=f-n,v=_x(d,o),_=Math.exp(-h);return nw-m/v*_},i=d=>{const h=d*o*t,m=h*n+n,v=Math.pow(o,2)*Math.pow(d,2)*t,_=Math.exp(-h),y=_x(Math.pow(d,2),o);return(-s(d)+nw>0?-1:1)*((m-v)*_)/y}):(s=d=>{const f=Math.exp(-d*t),h=(d-n)*t+1;return-nw+f*h},i=d=>{const f=Math.exp(-d*t),h=(n-d)*(t*t);return f*h});const l=5/t,c=fne(s,i,l);if(t=xi(t),isNaN(c))return{stiffness:sr.stiffness,damping:sr.damping,duration:t};{const d=Math.pow(c,2)*r;return{stiffness:d,damping:o*2*Math.sqrt(r*d),duration:t}}}const pne=["duration","bounce"],mne=["stiffness","damping","mass"];function kT(t,e){return e.some(n=>t[n]!==void 0)}function gne(t){let e={velocity:sr.velocity,stiffness:sr.stiffness,damping:sr.damping,mass:sr.mass,isResolvedFromDuration:!1,...t};if(!kT(t,mne)&&kT(t,pne))if(e.velocity=0,t.visualDuration){const n=t.visualDuration,r=2*Math.PI/(n*1.2),s=r*r,i=2*la(.05,1,1-(t.bounce||0))*Math.sqrt(s);e={...e,mass:sr.mass,stiffness:s,damping:i}}else{const n=hne({...t,velocity:0});e={...e,...n,mass:sr.mass},e.isResolvedFromDuration=!0}return e}function Yv(t=sr.visualDuration,e=sr.bounce){const n=typeof t!="object"?{visualDuration:t,keyframes:[0,1],bounce:e}:t;let{restSpeed:r,restDelta:s}=n;const i=n.keyframes[0],o=n.keyframes[n.keyframes.length-1],l={done:!1,value:i},{stiffness:c,damping:d,mass:f,duration:h,velocity:m,isResolvedFromDuration:v}=gne({...n,velocity:-Yi(n.velocity||0)}),_=m||0,y=d/(2*Math.sqrt(c*f)),w=o-i,x=Yi(Math.sqrt(c/f)),k=Math.abs(w)<5;r||(r=k?sr.restSpeed.granular:sr.restSpeed.default),s||(s=k?sr.restDelta.granular:sr.restDelta.default);let P,C,T,O,I,R;if(y<1)T=_x(x,y),O=(_+y*x*w)/T,P=L=>{const z=Math.exp(-y*x*L);return o-z*(O*Math.sin(T*L)+w*Math.cos(T*L))},I=y*x*O+w*T,R=y*x*w-O*T,C=L=>Math.exp(-y*x*L)*(I*Math.sin(T*L)+R*Math.cos(T*L));else if(y===1){P=z=>o-Math.exp(-x*z)*(w+(_+x*w)*z);const L=_+x*w;C=z=>Math.exp(-x*z)*(x*L*z-_)}else{const L=x*Math.sqrt(y*y-1);P=X=>{const q=Math.exp(-y*x*X),H=Math.min(L*X,300);return o-q*((_+y*x*w)*Math.sinh(H)+L*w*Math.cosh(H))/L};const z=(_+y*x*w)/L,$=y*x*z-w*L,G=y*x*w-z*L;C=X=>{const q=Math.exp(-y*x*X),H=Math.min(L*X,300);return q*($*Math.sinh(H)+G*Math.cosh(H))}}const N={calculatedDuration:v&&h||null,velocity:L=>xi(C(L)),next:L=>{if(!v&&y<1){const $=Math.exp(-y*x*L),G=Math.sin(T*L),X=Math.cos(T*L),q=o-$*(O*G+w*X),H=xi($*(I*G+R*X));return l.done=Math.abs(H)<=r&&Math.abs(o-q)<=s,l.value=l.done?o:q,l}const z=P(L);if(v)l.done=L>=h;else{const $=xi(C(L));l.done=Math.abs($)<=r&&Math.abs(o-z)<=s}return l.value=l.done?o:z,l},toString:()=>{const L=Math.min(Zk(N),Kv),z=OL($=>N.next(L*$).value,L,30);return L+"ms "+z},toTransition:()=>{}};return N}Yv.applyToOptions=t=>{const e=une(t,100,Yv);return t.ease=e.ease,t.duration=xi(e.duration),t.type="keyframes",t};const vne=5;function ML(t,e,n){const r=Math.max(e-vne,0);return fL(n-t(r),e-r)}function wx({keyframes:t,velocity:e=0,power:n=.8,timeConstant:r=325,bounceDamping:s=10,bounceStiffness:i=500,modifyTarget:o,min:l,max:c,restDelta:d=.5,restSpeed:f}){const h=t[0],m={done:!1,value:h},v=R=>l!==void 0&&R<l||c!==void 0&&R>c,_=R=>l===void 0?c:c===void 0||Math.abs(l-R)<Math.abs(c-R)?l:c;let y=n*e;const w=h+y,x=o===void 0?w:o(w);x!==w&&(y=x-h);const k=R=>-y*Math.exp(-R/r),P=R=>x+k(R),C=R=>{const N=k(R),L=P(R);m.done=Math.abs(N)<=d,m.value=m.done?x:L};let T,O;const I=R=>{v(m.value)&&(T=R,O=Yv({keyframes:[m.value,_(m.value)],velocity:ML(P,R,m.value),damping:s,stiffness:i,restDelta:d,restSpeed:f}))};return I(0),{calculatedDuration:null,next:R=>{let N=!1;return!O&&T===void 0&&(N=!0,C(R),I(R)),T!==void 0&&R>=T?O.next(R-T):(!N&&C(R),m)}}}function yne(t,e,n){const r=[],s=n||fc.mix||IL,i=t.length-1;for(let o=0;o<i;o++){let l=s(t[o],t[o+1]);if(e){const c=Array.isArray(e)?e[o]||to:e;l=Im(c,l)}r.push(l)}return r}function _ne(t,e,{clamp:n=!0,ease:r,mixer:s}={}){const i=t.length;if(j1(i===e.length),i===1)return()=>e[0];if(i===2&&e[0]===e[1])return()=>e[1];const o=t[0]===t[1];t[0]>t[i-1]&&(t=[...t].reverse(),e=[...e].reverse());const l=yne(e,r,s),c=l.length,d=f=>{if(o&&f<t[0])return e[0];let h=0;if(c>1)for(;h<t.length-2&&!(f<t[h+1]);h++);const m=Jp(t[h],t[h+1],f);return l[h](m)};return n?f=>d(la(t[0],t[i-1],f)):d}function wne(t,e){const n=t[t.length-1];for(let r=1;r<=e;r++){const s=Jp(0,e,r);t.push(xn(n,1,s))}}function bne(t){const e=[0];return wne(e,t.length-1),e}function xne(t,e){return t.map(n=>n*e)}function Sne(t,e){return t.map(()=>e||bL).splice(0,t.length-1)}function Ap({duration:t=300,keyframes:e,times:n,ease:r="easeInOut"}){const s=Ite(r)?r.map(yT):yT(r),i={done:!1,value:e[0]},o=xne(n&&n.length===e.length?n:bne(e),t),l=_ne(o,e,{ease:Array.isArray(s)?s:Sne(e,s)});return{calculatedDuration:t,next:c=>(i.value=l(c),i.done=c>=t,i)}}const kne=t=>t!==null;function F1(t,{repeat:e,repeatType:n="loop"},r,s=1){const i=t.filter(kne),l=s<0||e&&n!=="loop"&&e%2===1?0:i.length-1;return!l||r===void 0?i[l]:r}const Ene={decay:wx,inertia:wx,tween:Ap,keyframes:Ap,spring:Yv};function NL(t){typeof t.type=="string"&&(t.type=Ene[t.type])}class Wk{constructor(){this.updateFinished()}get finished(){return this._finished}updateFinished(){this._finished=new Promise(e=>{this.resolve=e})}notifyFinished(){this.resolve()}then(e,n){return this.finished.then(e,n)}}const Cne=t=>t/100;class Xv extends Wk{constructor(e){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!==Ls.now()&&this.tick(Ls.now()),this.isStopped=!0,this.state!=="idle"&&(this.teardown(),(s=(r=this.options).onStop)==null||s.call(r))},this.options=e,this.initAnimation(),this.play(),e.autoplay===!1&&this.pause()}initAnimation(){const{options:e}=this;NL(e);const{type:n=Ap,repeat:r=0,repeatDelay:s=0,repeatType:i,velocity:o=0}=e;let{keyframes:l}=e;const c=n||Ap;c!==Ap&&typeof l[0]!="number"&&(this.mixKeyframes=Im(Cne,IL(l[0],l[1])),l=[0,100]);const d=c({...e,keyframes:l});i==="mirror"&&(this.mirroredGenerator=c({...e,keyframes:[...l].reverse(),velocity:-o})),d.calculatedDuration===null&&(d.calculatedDuration=Zk(d));const{calculatedDuration:f}=d;this.calculatedDuration=f,this.resolvedDuration=f+s,this.totalDuration=this.resolvedDuration*(r+1)-s,this.generator=d}updateTime(e){const n=Math.round(e-this.startTime)*this.playbackSpeed;this.holdTime!==null?this.currentTime=this.holdTime:this.currentTime=n}tick(e,n=!1){const{generator:r,totalDuration:s,mixKeyframes:i,mirroredGenerator:o,resolvedDuration:l,calculatedDuration:c}=this;if(this.startTime===null)return r.next(0);const{delay:d=0,keyframes:f,repeat:h,repeatType:m,repeatDelay:v,type:_,onUpdate:y,finalKeyframe:w}=this.options;this.speed>0?this.startTime=Math.min(this.startTime,e):this.speed<0&&(this.startTime=Math.min(e-s/this.speed,this.startTime)),n?this.currentTime=e:this.updateTime(e);const x=this.currentTime-d*(this.playbackSpeed>=0?1:-1),k=this.playbackSpeed>=0?x<0:x>s;this.currentTime=Math.max(x,0),this.state==="finished"&&this.holdTime===null&&(this.currentTime=s);let P=this.currentTime,C=r;if(h){const R=Math.min(this.currentTime,s)/l;let N=Math.floor(R),L=R%1;!L&&R>=1&&(L=1),L===1&&N--,N=Math.min(N,h+1),!!(N%2)&&(m==="reverse"?(L=1-L,v&&(L-=v/l)):m==="mirror"&&(C=o)),P=la(0,1,L)*l}let T;k?(this.delayState.value=f[0],T=this.delayState):T=C.next(P),i&&!k&&(T.value=i(T.value));let{done:O}=T;!k&&c!==null&&(O=this.playbackSpeed>=0?this.currentTime>=s:this.currentTime<=0);const I=this.holdTime===null&&(this.state==="finished"||this.state==="running"&&O);return I&&_!==wx&&(T.value=F1(f,this.options,w,this.speed)),y&&y(T.value),I&&this.finish(),T}then(e,n){return this.finished.then(e,n)}get duration(){return Yi(this.calculatedDuration)}get iterationDuration(){const{delay:e=0}=this.options||{};return this.duration+Yi(e)}get time(){return Yi(this.currentTime)}set time(e){e=xi(e),this.currentTime=e,this.startTime===null||this.holdTime!==null||this.playbackSpeed===0?this.holdTime=e:this.driver&&(this.startTime=this.driver.now()-e/this.playbackSpeed),this.driver?this.driver.start(!1):(this.startTime=0,this.state="paused",this.holdTime=e,this.tick(e))}getGeneratorVelocity(){const e=this.currentTime;if(e<=0)return this.options.velocity||0;if(this.generator.velocity)return this.generator.velocity(e);const n=this.generator.next(e).value;return ML(r=>this.generator.next(r).value,e,n)}get speed(){return this.playbackSpeed}set speed(e){const n=this.playbackSpeed!==e;n&&this.driver&&this.updateTime(Ls.now()),this.playbackSpeed=e,n&&this.driver&&(this.time=Yi(this.currentTime))}play(){var s,i;if(this.isStopped)return;const{driver:e=cne,startTime:n}=this.options;this.driver||(this.driver=e(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(Ls.now()),this.holdTime=this.currentTime}complete(){this.state!=="running"&&this.play(),this.state="finished",this.holdTime=null}finish(){var e,n;this.notifyFinished(),this.teardown(),this.state="finished",(n=(e=this.options).onComplete)==null||n.call(e)}cancel(){var e,n;this.holdTime=null,this.startTime=0,this.tick(0),this.teardown(),(n=(e=this.options).onCancel)==null||n.call(e)}teardown(){this.state="idle",this.stopDriver(),this.startTime=this.holdTime=null}stopDriver(){this.driver&&(this.driver.stop(),this.driver=void 0)}sample(e){return this.startTime=0,this.tick(e,!0)}attachTimeline(e){var n;return this.options.allowFlatten&&(this.options.type="keyframes",this.options.ease="linear",this.initAnimation()),(n=this.driver)==null||n.stop(),e.observe(this)}}function Pne(t){for(let e=1;e<t.length;e++)t[e]??(t[e]=t[e-1])}const cu=t=>t*180/Math.PI,bx=t=>{const e=cu(Math.atan2(t[1],t[0]));return xx(e)},Ane={x:4,y:5,translateX:4,translateY:5,scaleX:0,scaleY:3,scale:t=>(Math.abs(t[0])+Math.abs(t[3]))/2,rotate:bx,rotateZ:bx,skewX:t=>cu(Math.atan(t[1])),skewY:t=>cu(Math.atan(t[2])),skew:t=>(Math.abs(t[1])+Math.abs(t[2]))/2},xx=t=>(t=t%360,t<0&&(t+=360),t),ET=bx,CT=t=>Math.sqrt(t[0]*t[0]+t[1]*t[1]),PT=t=>Math.sqrt(t[4]*t[4]+t[5]*t[5]),Tne={x:12,y:13,z:14,translateX:12,translateY:13,translateZ:14,scaleX:CT,scaleY:PT,scale:t=>(CT(t)+PT(t))/2,rotateX:t=>xx(cu(Math.atan2(t[6],t[5]))),rotateY:t=>xx(cu(Math.atan2(-t[2],t[0]))),rotateZ:ET,rotate:ET,skewX:t=>cu(Math.atan(t[4])),skewY:t=>cu(Math.atan(t[1])),skew:t=>(Math.abs(t[1])+Math.abs(t[4]))/2};function Sx(t){return t.includes("scale")?1:0}function kx(t,e){if(!t||t==="none")return Sx(e);const n=t.match(/^matrix3d\(([-\d.e\s,]+)\)$/u);let r,s;if(n)r=Tne,s=n;else{const l=t.match(/^matrix\(([-\d.e\s,]+)\)$/u);r=Ane,s=l}if(!s)return Sx(e);const i=r[e],o=s[1].split(",").map(Ine);return typeof i=="function"?i(o):o[i]}const Rne=(t,e)=>{const{transform:n="none"}=getComputedStyle(t);return kx(n,e)};function Ine(t){return parseFloat(t.trim())}const Qf=["transformPerspective","x","y","z","translateX","translateY","translateZ","scale","scaleX","scaleY","rotate","rotateX","rotateY","rotateZ","skew","skewX","skewY"],Jf=new Set([...Qf,"pathRotation"]),AT=t=>t===Xf||t===Ge,One=new Set(["x","y","z"]),Mne=Qf.filter(t=>!One.has(t));function Nne(t){const e=[];return Mne.forEach(n=>{const r=t.getValue(n);r!==void 0&&(e.push([n,r.get()]),r.set(n.startsWith("scale")?1:0))}),e}const Yl={width:({x:t},{paddingLeft:e="0",paddingRight:n="0",boxSizing:r})=>{const s=t.max-t.min;return r==="border-box"?s:s-parseFloat(e)-parseFloat(n)},height:({y:t},{paddingTop:e="0",paddingBottom:n="0",boxSizing:r})=>{const s=t.max-t.min;return r==="border-box"?s:s-parseFloat(e)-parseFloat(n)},top:(t,{top:e})=>parseFloat(e),left:(t,{left:e})=>parseFloat(e),bottom:({y:t},{top:e})=>parseFloat(e)+(t.max-t.min),right:({x:t},{left:e})=>parseFloat(e)+(t.max-t.min),x:(t,{transform:e})=>kx(e,"x"),y:(t,{transform:e})=>kx(e,"y")};Yl.translateX=Yl.x;Yl.translateY=Yl.y;const Eu=new Set;let Ex=!1,Cx=!1,Px=!1;function LL(){if(Cx){const t=Array.from(Eu).filter(r=>r.needsMeasurement),e=new Set(t.map(r=>r.element)),n=new Map;e.forEach(r=>{const s=Nne(r);s.length&&(n.set(r,s),r.render())}),t.forEach(r=>r.measureInitialState()),e.forEach(r=>{r.render();const s=n.get(r);s&&s.forEach(([i,o])=>{var l;(l=r.getValue(i))==null||l.set(o)})}),t.forEach(r=>r.measureEndState()),t.forEach(r=>{r.suspendedScrollY!==void 0&&window.scrollTo(0,r.suspendedScrollY)})}Cx=!1,Ex=!1,Eu.forEach(t=>t.complete(Px)),Eu.clear()}function DL(){Eu.forEach(t=>{t.readKeyframes(),t.needsMeasurement&&(Cx=!0)})}function Lne(){Px=!0,DL(),LL(),Px=!1}class qk{constructor(e,n,r,s,i,o=!1){this.state="pending",this.isAsync=!1,this.needsMeasurement=!1,this.unresolvedKeyframes=[...e],this.onComplete=n,this.name=r,this.motionValue=s,this.element=i,this.isAsync=o}scheduleResolve(){this.state="scheduled",this.isAsync?(Eu.add(this),Ex||(Ex=!0,Sn.read(DL),Sn.resolveKeyframes(LL))):(this.readKeyframes(),this.complete())}readKeyframes(){const{unresolvedKeyframes:e,name:n,element:r,motionValue:s}=this;if(e[0]===null){const i=s==null?void 0:s.get(),o=e[e.length-1];if(i!==void 0)e[0]=i;else if(r&&n){const l=r.readValue(n,o);l!=null&&(e[0]=l)}e[0]===void 0&&(e[0]=o),s&&i===void 0&&s.set(e[0])}Pne(e)}setFinalKeyframe(){}measureInitialState(){}renderEndStyles(){}measureEndState(){}complete(e=!1){this.state="complete",this.onComplete(this.unresolvedKeyframes,this.finalKeyframe,e),Eu.delete(this)}cancel(){this.state==="scheduled"&&(Eu.delete(this),this.state="pending")}resume(){this.state==="pending"&&this.scheduleResolve()}}const Dne=t=>t.startsWith("--");function $L(t,e,n){Dne(e)?t.style.setProperty(e,n):t.style[e]=n}const $ne={};function jL(t,e){const n=dL(t);return()=>$ne[e]??n()}const jne=jL(()=>window.ScrollTimeline!==void 0,"scrollTimeline"),FL=jL(()=>{try{document.createElement("div").animate({opacity:0},{easing:"linear(0, 1)"})}catch{return!1}return!0},"linearEasing"),cp=([t,e,n,r])=>`cubic-bezier(${t}, ${e}, ${n}, ${r})`,TT={linear:"linear",ease:"ease",easeIn:"ease-in",easeOut:"ease-out",easeInOut:"ease-in-out",circIn:cp([0,.65,.55,1]),circOut:cp([.55,0,1,.45]),backIn:cp([.31,.01,.66,-.59]),backOut:cp([.33,1.53,.69,.99])};function zL(t,e){if(t)return typeof t=="function"?FL()?OL(t,e):"ease-out":xL(t)?cp(t):Array.isArray(t)?t.map(n=>zL(n,e)||TT.easeOut):TT[t]}function Fne(t,e,n,{delay:r=0,duration:s=300,repeat:i=0,repeatType:o="loop",ease:l="easeOut",times:c}={},d=void 0){const f={[e]:n};c&&(f.offset=c);const h=zL(l,s);Array.isArray(h)&&(f.easing=h);const m={delay:r,duration:s,easing:Array.isArray(h)?"linear":h,fill:"both",iterations:i+1,direction:o==="reverse"?"alternate":"normal"};return d&&(m.pseudoElement=d),t.animate(f,m)}function VL(t){return typeof t=="function"&&"applyToOptions"in t}function zne({type:t,...e}){return VL(t)&&FL()?t.applyToOptions(e):(e.duration??(e.duration=300),e.ease??(e.ease="easeOut"),e)}class HL extends Wk{constructor(e){if(super(),this.finishedTime=null,this.isStopped=!1,this.manualStartTime=null,!e)return;const{element:n,name:r,keyframes:s,pseudoElement:i,allowFlatten:o=!1,finalKeyframe:l,onComplete:c}=e;this.isPseudoElement=!!i,this.allowFlatten=o,this.options=e,j1(typeof e.type!="string");const d=zne(e);this.animation=Fne(n,r,s,d,i),d.autoplay===!1&&this.animation.pause(),this.animation.onfinish=()=>{if(this.finishedTime=this.time,!i){const f=F1(s,this.options,l,this.speed);this.updateMotionValue&&this.updateMotionValue(f),$L(n,r,f),this.animation.cancel()}c==null||c(),this.notifyFinished()}}play(){this.isStopped||(this.manualStartTime=null,this.animation.play(),this.state==="finished"&&this.updateFinished())}pause(){this.animation.pause()}complete(){var e,n;(n=(e=this.animation).finish)==null||n.call(e)}cancel(){try{this.animation.cancel()}catch{}}stop(){if(this.isStopped)return;this.isStopped=!0;const{state:e}=this;e==="idle"||e==="finished"||(this.updateMotionValue?this.updateMotionValue():this.commitStyles(),this.isPseudoElement||this.cancel())}commitStyles(){var n,r,s;const e=(n=this.options)==null?void 0:n.element;!this.isPseudoElement&&(e!=null&&e.isConnected)&&((s=(r=this.animation).commitStyles)==null||s.call(r))}get duration(){var n,r;const e=((r=(n=this.animation.effect)==null?void 0:n.getComputedTiming)==null?void 0:r.call(n).duration)||0;return Yi(Number(e))}get iterationDuration(){const{delay:e=0}=this.options||{};return this.duration+Yi(e)}get time(){return Yi(Number(this.animation.currentTime)||0)}set time(e){const n=this.finishedTime!==null;this.manualStartTime=null,this.finishedTime=null,this.animation.currentTime=xi(e),n&&this.animation.pause()}get speed(){return this.animation.playbackRate}set speed(e){e<0&&(this.finishedTime=null),this.animation.playbackRate=e}get state(){return this.finishedTime!==null?"finished":this.animation.playState}get startTime(){return this.manualStartTime??Number(this.animation.startTime)}set startTime(e){this.manualStartTime=this.animation.startTime=e}attachTimeline({timeline:e,rangeStart:n,rangeEnd:r,observe:s}){var i;return this.allowFlatten&&((i=this.animation.effect)==null||i.updateTiming({easing:"linear"})),this.animation.onfinish=null,e&&jne()?(this.animation.timeline=e,n&&(this.animation.rangeStart=n),r&&(this.animation.rangeEnd=r),to):s(this)}}const UL={anticipate:yL,backInOut:vL,circInOut:wL};function Vne(t){return t in UL}function Hne(t){typeof t.ease=="string"&&Vne(t.ease)&&(t.ease=UL[t.ease])}const rw=10;class Une extends HL{constructor(e){Hne(e),NL(e),super(e),e.startTime!==void 0&&e.autoplay!==!1&&(this.startTime=e.startTime),this.options=e}updateMotionValue(e){const{motionValue:n,onUpdate:r,onComplete:s,element:i,...o}=this.options;if(!n)return;if(e!==void 0){n.set(e);return}const l=new Xv({...o,autoplay:!1}),c=Math.max(rw,Ls.now()-this.startTime),d=la(0,rw,c-rw),f=l.sample(c).value,{name:h}=this.options;i&&h&&$L(i,h,f),n.setWithVelocity(l.sample(Math.max(0,c-d)).value,f,d),l.stop()}}const RT=(t,e)=>e==="zIndex"?!1:!!(typeof t=="number"||Array.isArray(t)||typeof t=="string"&&(Eo.test(t)||t==="0")&&!t.startsWith("url("));function Bne(t){const e=t[0];if(t.length===1)return!0;for(let n=0;n<t.length;n++)if(t[n]!==e)return!0}function Zne(t,e,n,r){const s=t[0];if(s===null)return!1;if(e==="display"||e==="visibility")return!0;const i=t[t.length-1],o=RT(s,e),l=RT(i,e);return!o||!l?!1:Bne(t)||(n==="spring"||VL(n))&&r}function Ax(t){t.duration=0,t.type="keyframes"}const BL=new Set(["opacity","clipPath","filter","transform","backgroundColor"]),Wne=/^(?:oklch|oklab|lab|lch|color|color-mix|light-dark)\(/;function qne(t){for(let e=0;e<t.length;e++)if(typeof t[e]=="string"&&Wne.test(t[e]))return!0;return!1}const Gne=new Set(["color","backgroundColor","outlineColor","fill","stroke","borderColor","borderTopColor","borderRightColor","borderBottomColor","borderLeftColor"]),Kne=dL(()=>Object.hasOwnProperty.call(Element.prototype,"animate"));function Yne(t){var h;const{motionValue:e,name:n,repeatDelay:r,repeatType:s,damping:i,type:o,keyframes:l}=t,c=(h=e==null?void 0:e.owner)==null?void 0:h.current;if(!(c instanceof HTMLElement)&&!(c instanceof SVGElement))return!1;const{onUpdate:d,transformTemplate:f}=e.owner.getProps();return Kne()&&n&&(BL.has(n)||Gne.has(n)&&qne(l))&&(n!=="transform"||!f)&&!d&&!r&&s!=="mirror"&&i!==0&&o!=="inertia"}const Xne=40;class Qne extends Wk{constructor({autoplay:e=!0,delay:n=0,type:r="keyframes",repeat:s=0,repeatDelay:i=0,repeatType:o="loop",keyframes:l,name:c,motionValue:d,element:f,...h}){var _;super(),this.stop=()=>{var y,w;this._animation&&(this._animation.stop(),(y=this.stopTimeline)==null||y.call(this)),(w=this.keyframeResolver)==null||w.cancel()},this.createdAt=Ls.now();const m={autoplay:e,delay:n,type:r,repeat:s,repeatDelay:i,repeatType:o,name:c,motionValue:d,element:f,...h},v=(f==null?void 0:f.KeyframeResolver)||qk;this.keyframeResolver=new v(l,(y,w,x)=>this.onKeyframesResolved(y,w,m,!x),c,d,f),(_=this.keyframeResolver)==null||_.scheduleResolve()}onKeyframesResolved(e,n,r,s){var x,k;this.keyframeResolver=void 0;const{name:i,type:o,velocity:l,delay:c,isHandoff:d,onUpdate:f}=r;this.resolvedAt=Ls.now();let h=!0;Zne(e,i,o,l)||(h=!1,(fc.instantAnimations||!c)&&(f==null||f(F1(e,r,n))),e[0]=e[e.length-1],Ax(r),r.repeat=0);const v={startTime:s?this.resolvedAt?this.resolvedAt-this.createdAt>Xne?this.resolvedAt:this.createdAt:this.createdAt:void 0,finalKeyframe:n,...r,keyframes:e},_=h&&!d&&Yne(v),y=(k=(x=v.motionValue)==null?void 0:x.owner)==null?void 0:k.current;let w;if(_)try{w=new Une({...v,element:y})}catch{w=new Xv(v)}else w=new Xv(v);w.finished.then(()=>{this.notifyFinished()}).catch(to),this.pendingTimeline&&(this.stopTimeline=w.attachTimeline(this.pendingTimeline),this.pendingTimeline=void 0),this._animation=w}get finished(){return this._animation?this.animation.finished:this._finished}then(e,n){return this.finished.finally(e).then(()=>{})}get animation(){var e;return this._animation||((e=this.keyframeResolver)==null||e.resume(),Lne()),this._animation}get duration(){return this.animation.duration}get iterationDuration(){return this.animation.iterationDuration}get time(){return this.animation.time}set time(e){this.animation.time=e}get speed(){return this.animation.speed}get state(){return this.animation.state}set speed(e){this.animation.speed=e}get startTime(){return this.animation.startTime}attachTimeline(e){return this._animation?this.stopTimeline=this.animation.attachTimeline(e):this.pendingTimeline=e,()=>this.stop()}play(){this.animation.play()}pause(){this.animation.pause()}complete(){this.animation.complete()}cancel(){var e;this._animation&&this.animation.cancel(),(e=this.keyframeResolver)==null||e.cancel()}}function ZL(t,e,n,r=0,s=1){const i=Array.from(t).sort((d,f)=>d.sortNodePosition(f)).indexOf(e),o=t.size,l=(o-1)*r;return typeof n=="function"?n(i,o):s===1?i*r:l-i*r}const IT=30,Jne=t=>!isNaN(parseFloat(t));class ere{constructor(e,n={}){this.canTrackVelocity=null,this.events={},this.updateAndNotify=r=>{var i;const s=Ls.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(e),this.owner=n.owner}setCurrent(e){this.current=e,this.updatedAt=Ls.now(),this.canTrackVelocity===null&&e!==void 0&&(this.canTrackVelocity=Jne(this.current))}setPrevFrameValue(e=this.current){this.prevFrameValue=e,this.prevUpdatedAt=this.updatedAt}onChange(e){return this.on("change",e)}on(e,n){this.events[e]||(this.events[e]=new jk);const r=this.events[e].add(n);return e==="change"?()=>{r(),Sn.read(()=>{this.events.change.getSize()||this.stop()})}:r}clearListeners(){for(const e in this.events)this.events[e].clear()}attach(e,n){this.passiveEffect=e,this.stopPassiveEffect=n}set(e){this.passiveEffect?this.passiveEffect(e,this.updateAndNotify):this.updateAndNotify(e)}setWithVelocity(e,n,r){this.set(n),this.prev=void 0,this.prevFrameValue=e,this.prevUpdatedAt=this.updatedAt-r}jump(e,n=!0){this.updateAndNotify(e),this.prev=e,this.prevUpdatedAt=this.prevFrameValue=void 0,n&&this.stop(),this.stopPassiveEffect&&this.stopPassiveEffect()}dirty(){var e;(e=this.events.change)==null||e.notify(this.current)}addDependent(e){this.dependents||(this.dependents=new Set),this.dependents.add(e)}removeDependent(e){this.dependents&&this.dependents.delete(e)}get(){return this.current}getPrevious(){return this.prev}getVelocity(){const e=Ls.now();if(!this.canTrackVelocity||this.prevFrameValue===void 0||e-this.updatedAt>IT)return 0;const n=Math.min(this.updatedAt-this.prevUpdatedAt,IT);return fL(parseFloat(this.current)-parseFloat(this.prevFrameValue),n)}start(e){return this.stop(),new Promise(n=>{this.hasAnimated=!0,this.animation=e(n),this.events.animationStart&&this.events.animationStart.notify()}).then(()=>{this.events.animationComplete&&this.events.animationComplete.notify(),this.clearAnimation()})}stop(){this.animation&&(this.animation.stop(),this.events.animationCancel&&this.events.animationCancel.notify()),this.clearAnimation()}isAnimating(){return!!this.animation}clearAnimation(){delete this.animation}destroy(){var e,n;(e=this.dependents)==null||e.clear(),(n=this.events.destroy)==null||n.notify(),this.clearListeners(),this.stop(),this.stopPassiveEffect&&this.stopPassiveEffect()}}function jf(t,e){return new ere(t,e)}function WL(t,e){if(t!=null&&t.inherit&&e){const{inherit:n,...r}=t;return{...e,...r}}return t}function Gk(t,e){const n=(t==null?void 0:t[e])??(t==null?void 0:t.default)??t;return n!==t?WL(n,t):n}const tre={type:"spring",stiffness:500,damping:25,restSpeed:10},nre=t=>({type:"spring",stiffness:550,damping:t===0?2*Math.sqrt(550):30,restSpeed:10}),rre={type:"keyframes",duration:.8},sre={type:"keyframes",ease:[.25,.1,.35,1],duration:.3},ire=(t,{keyframes:e})=>e.length>2?rre:Jf.has(t)?t.startsWith("scale")?nre(e[1]):tre:sre,ore=new Set(["when","delay","delayChildren","staggerChildren","staggerDirection","repeat","repeatType","repeatDelay","from","elapsed"]);function are(t){for(const e in t)if(!ore.has(e))return!0;return!1}const Kk=(t,e,n,r={},s,i)=>o=>{const l=Gk(r,t)||{},c=l.delay||r.delay||0;let{elapsed:d=0}=r;d=d-xi(c);const f={keyframes:Array.isArray(n)?n:[null,n],ease:"easeOut",velocity:e.getVelocity(),...l,delay:-d,onUpdate:m=>{e.set(m),l.onUpdate&&l.onUpdate(m)},onComplete:()=>{o(),l.onComplete&&l.onComplete()},name:t,motionValue:e,element:i?void 0:s};are(l)||Object.assign(f,ire(t,f)),f.duration&&(f.duration=xi(f.duration)),f.repeatDelay&&(f.repeatDelay=xi(f.repeatDelay)),f.from!==void 0&&(f.keyframes[0]=f.from);let h=!1;if((f.type===!1||f.duration===0&&!f.repeatDelay)&&(Ax(f),f.delay===0&&(h=!0)),(fc.instantAnimations||fc.skipAnimations||s!=null&&s.shouldSkipAnimations||l.skipAnimations)&&(h=!0,Ax(f),f.delay=0),f.allowFlatten=!l.type&&!l.ease,h&&!i&&e.get()!==void 0){const m=F1(f.keyframes,l);if(m!==void 0){Sn.update(()=>{f.onUpdate(m),f.onComplete()});return}}return l.isSync?new Xv(f):new Qne(f)},lre=/^var\(--(?:([\w-]+)|([\w-]+), ?([a-zA-Z\d ()%#.,-]+))\)/u;function cre(t){const e=lre.exec(t);if(!e)return[,];const[,n,r,s]=e;return[`--${n??r}`,s]}function qL(t,e,n=1){const[r,s]=cre(t);if(!r)return;const i=window.getComputedStyle(e).getPropertyValue(r);if(i){const o=i.trim();return lL(o)?parseFloat(o):o}return Vk(s)?qL(s,e,n+1):s}function OT(t){const e=[{},{}];return t==null||t.values.forEach((n,r)=>{e[0][r]=n.get(),e[1][r]=n.getVelocity()}),e}function Yk(t,e,n,r){if(typeof e=="function"){const[s,i]=OT(r);e=e(n!==void 0?n:t.custom,s,i)}if(typeof e=="string"&&(e=t.variants&&t.variants[e]),typeof e=="function"){const[s,i]=OT(r);e=e(n!==void 0?n:t.custom,s,i)}return e}function Cu(t,e,n){const r=t.getProps();return Yk(r,e,n!==void 0?n:r.custom,t)}const GL=new Set(["width","height","top","left","right","bottom",...Qf]),Tx=t=>Array.isArray(t);function ure(t,e,n){t.hasValue(e)?t.getValue(e).set(n):t.addValue(e,jf(n))}function dre(t){return Tx(t)?t[t.length-1]||0:t}function fre(t,e){const n=Cu(t,e);let{transitionEnd:r={},transition:s={},...i}=n||{};i={...i,...r};for(const o in i){const l=dre(i[o]);ure(t,o,l)}}const ts=t=>!!(t&&t.getVelocity);function hre(t){return!!(ts(t)&&t.add)}function Rx(t,e){const n=t.getValue("willChange");if(hre(n))return n.add(e);if(!n&&fc.WillChange){const r=new fc.WillChange("auto");t.addValue("willChange",r),r.add(e)}}function Xk(t){return t.replace(/([A-Z])/g,e=>`-${e.toLowerCase()}`)}const pre="framerAppearId",KL="data-"+Xk(pre);function YL(t){return t.props[KL]}function mre({protectedKeys:t,needsAnimating:e},n){const r=t.hasOwnProperty(n)&&e[n]!==!0;return e[n]=!1,r}function XL(t,e,{delay:n=0,transitionOverride:r,type:s}={}){let{transition:i,transitionEnd:o,...l}=e;const c=t.getDefaultTransition();i=i?WL(i,c):c;const d=i==null?void 0:i.reduceMotion,f=i==null?void 0:i.skipAnimations;r&&(i=r);const h=[],m=s&&t.animationState&&t.animationState.getState()[s],v=i==null?void 0:i.path;v&&v.animateVisualElement(t,l,i,n,h);for(const _ in l){const y=t.getValue(_,t.latestValues[_]??null),w=l[_];if(w===void 0||m&&mre(m,_))continue;const x={delay:n,...Gk(i||{},_)};f&&(x.skipAnimations=!0);const k=y.get();if(k!==void 0&&!y.isAnimating()&&!Array.isArray(w)&&w===k&&!x.velocity){Sn.update(()=>y.set(w));continue}let P=!1;if(window.MotionHandoffAnimation){const O=YL(t);if(O){const I=window.MotionHandoffAnimation(O,_,Sn);I!==null&&(x.startTime=I,P=!0)}}Rx(t,_);const C=d??t.shouldReduceMotion;y.start(Kk(_,y,w,C&&GL.has(_)?{type:!1}:x,t,P));const T=y.animation;T&&h.push(T)}if(o){const _=()=>Sn.update(()=>{o&&fre(t,o)});h.length?Promise.all(h).then(_):_()}return h}function Ix(t,e,n={}){var c;const r=Cu(t,e,n.type==="exit"?(c=t.presenceContext)==null?void 0:c.custom:void 0);let{transition:s=t.getDefaultTransition()||{}}=r||{};n.transitionOverride&&(s=n.transitionOverride);const i=r?()=>Promise.all(XL(t,r,n)):()=>Promise.resolve(),o=t.variantChildren&&t.variantChildren.size?(d=0)=>{const{delayChildren:f=0,staggerChildren:h,staggerDirection:m}=s;return gre(t,e,d,f,h,m,n)}:()=>Promise.resolve(),{when:l}=s;if(l){const[d,f]=l==="beforeChildren"?[i,o]:[o,i];return d().then(()=>f())}else return Promise.all([i(),o(n.delay)])}function gre(t,e,n=0,r=0,s=0,i=1,o){const l=[];for(const c of t.variantChildren)c.notify("AnimationStart",e),l.push(Ix(c,e,{...o,delay:n+(typeof r=="function"?0:r)+ZL(t.variantChildren,c,r,s,i)}).then(()=>c.notify("AnimationComplete",e)));return Promise.all(l)}function vre(t,e,n={}){t.notify("AnimationStart",e);let r;if(Array.isArray(e)){const s=e.map(i=>Ix(t,i,n));r=Promise.all(s)}else if(typeof e=="string")r=Ix(t,e,n);else{const s=typeof e=="function"?Cu(t,e,n.custom):e;r=Promise.all(XL(t,s,n))}return r.then(()=>{t.notify("AnimationComplete",e)})}const yre={test:t=>t==="auto",parse:t=>t},QL=t=>e=>e.test(t),JL=[Xf,Ge,ra,La,Bte,Ute,yre],MT=t=>JL.find(QL(t));function _re(t){return typeof t=="number"?t===0:t!==null?t==="none"||t==="0"||uL(t):!0}const wre=new Set(["brightness","contrast","saturate","opacity"]);function bre(t){const[e,n]=t.slice(0,-1).split("(");if(e==="drop-shadow")return t;const[r]=n.match(Hk)||[];if(!r)return t;const s=n.replace(r,"");let i=wre.has(e)?1:0;return r!==n&&(i*=100),e+"("+i+s+")"}const xre=/\b([a-z-]*)\(.*?\)/gu,Ox={...Eo,getAnimatableNone:t=>{const e=t.match(xre);return e?e.map(bre).join(" "):t}},Mx={...Eo,getAnimatableNone:t=>{const e=Eo.parse(t);return Eo.createTransformer(t)(e.map(r=>typeof r=="number"?0:typeof r=="object"?{...r,alpha:1}:r))}},NT={...Xf,transform:Math.round},Sre={rotate:La,pathRotation:La,rotateX:La,rotateY:La,rotateZ:La,scale:ug,scaleX:ug,scaleY:ug,scaleZ:ug,skew:La,skewX:La,skewY:La,distance:Ge,translateX:Ge,translateY:Ge,translateZ:Ge,x:Ge,y:Ge,z:Ge,perspective:Ge,transformPerspective:Ge,opacity:em,originX:wT,originY:wT,originZ:Ge},Qv={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,...Sre,zIndex:NT,fillOpacity:em,strokeOpacity:em,numOctaves:NT},kre={...Qv,color:vr,backgroundColor:vr,outlineColor:vr,fill:vr,stroke:vr,borderColor:vr,borderTopColor:vr,borderRightColor:vr,borderBottomColor:vr,borderLeftColor:vr,filter:Ox,WebkitFilter:Ox,mask:Mx,WebkitMask:Mx},e9=t=>kre[t],Ere=new Set([Ox,Mx]);function t9(t,e){let n=e9(t);return Ere.has(n)||(n=Eo),n.getAnimatableNone?n.getAnimatableNone(e):void 0}const Cre=new Set(["auto","none","0"]);function Pre(t,e,n){let r=0,s;for(;r<t.length&&!s;){const i=t[r];typeof i=="string"&&!Cre.has(i)&&$f(i).values.length&&(s=t[r]),r++}if(s&&n)for(const i of e)t[i]=t9(n,s)}class Are extends qk{constructor(e,n,r,s,i){super(e,n,r,s,i,!0)}readKeyframes(){const{unresolvedKeyframes:e,element:n,name:r}=this;if(!n||!n.current)return;super.readKeyframes();for(let f=0;f<e.length;f++){let h=e[f];if(typeof h=="string"&&(h=h.trim(),Vk(h))){const m=qL(h,n.current);m!==void 0&&(e[f]=m),f===e.length-1&&(this.finalKeyframe=h)}}if(this.resolveNoneKeyframes(),!GL.has(r)||e.length!==2)return;const[s,i]=e,o=MT(s),l=MT(i),c=_T(s),d=_T(i);if(c!==d&&Yl[r]){this.needsMeasurement=!0;return}if(o!==l)if(AT(o)&&AT(l))for(let f=0;f<e.length;f++){const h=e[f];typeof h=="string"&&(e[f]=parseFloat(h))}else Yl[r]&&(this.needsMeasurement=!0)}resolveNoneKeyframes(){const{unresolvedKeyframes:e,name:n}=this,r=[];for(let s=0;s<e.length;s++)(e[s]===null||_re(e[s]))&&r.push(s);r.length&&Pre(e,r,n)}measureInitialState(){const{element:e,unresolvedKeyframes:n,name:r}=this;if(!e||!e.current)return;r==="height"&&(this.suspendedScrollY=window.pageYOffset),this.measuredOrigin=Yl[r](e.measureViewportBox(),window.getComputedStyle(e.current)),n[0]=this.measuredOrigin;const s=n[n.length-1];s!==void 0&&e.getValue(r,s).jump(s,!1)}measureEndState(){var l;const{element:e,name:n,unresolvedKeyframes:r}=this;if(!e||!e.current)return;const s=e.getValue(n);s&&s.jump(this.measuredOrigin,!1);const i=r.length-1,o=r[i];r[i]=Yl[n](e.measureViewportBox(),window.getComputedStyle(e.current)),o!==null&&this.finalKeyframe===void 0&&(this.finalKeyframe=o),(l=this.removedTransforms)!=null&&l.length&&this.removedTransforms.forEach(([c,d])=>{e.getValue(c).set(d)}),this.resolveNoneKeyframes()}}const Qk=["borderTopLeftRadius","borderTopRightRadius","borderBottomRightRadius","borderBottomLeftRadius"];function n9(t,e,n){if(t==null)return[];if(t instanceof EventTarget)return[t];if(typeof t=="string"){let r=document;const s=(n==null?void 0:n[t])??r.querySelectorAll(t);return s?Array.from(s):[]}return Array.from(t).filter(r=>r!=null)}const Nx=(t,e)=>e&&typeof t=="number"?e.transform(t):t;function Bg(t){return cL(t)&&"offsetHeight"in t&&!("ownerSVGElement"in t)}const{schedule:Jk}=SL(queueMicrotask,!1),vo={x:!1,y:!1};function r9(){return vo.x||vo.y}function Tre(t){return t==="x"||t==="y"?vo[t]?null:(vo[t]=!0,()=>{vo[t]=!1}):vo.x||vo.y?null:(vo.x=vo.y=!0,()=>{vo.x=vo.y=!1})}function s9(t,e){const n=n9(t),r=new AbortController,s={passive:!0,...e,signal:r.signal};return[n,s,()=>r.abort()]}function Rre(t){return!(t.pointerType==="touch"||r9())}function Ire(t,e,n={}){const[r,s,i]=s9(t,n);return r.forEach(o=>{let l=!1,c=!1,d;const f=()=>{o.removeEventListener("pointerleave",_)},h=w=>{d&&(d(w),d=void 0),f()},m=w=>{l=!1,window.removeEventListener("pointerup",m),window.removeEventListener("pointercancel",m),c&&(c=!1,h(w))},v=()=>{l=!0,window.addEventListener("pointerup",m,s),window.addEventListener("pointercancel",m,s)},_=w=>{if(w.pointerType!=="touch"){if(l){c=!0;return}h(w)}},y=w=>{if(!Rre(w))return;c=!1;const x=e(o,w);typeof x=="function"&&(d=x,o.addEventListener("pointerleave",_,s))};o.addEventListener("pointerenter",y,s),o.addEventListener("pointerdown",v,s)}),i}const i9=(t,e)=>e?t===e?!0:i9(t,e.parentElement):!1,eE=t=>t.pointerType==="mouse"?typeof t.button!="number"||t.button<=0:t.isPrimary!==!1,Ore=new Set(["BUTTON","INPUT","SELECT","TEXTAREA","A"]);function Mre(t){return Ore.has(t.tagName)||t.isContentEditable===!0}const Nre=new Set(["INPUT","SELECT","TEXTAREA"]);function Lre(t){return Nre.has(t.tagName)||t.isContentEditable===!0}const Zg=new WeakSet;function LT(t){return e=>{e.key==="Enter"&&t(e)}}function sw(t,e){t.dispatchEvent(new PointerEvent("pointer"+e,{isPrimary:!0,bubbles:!0}))}const Dre=(t,e)=>{const n=t.currentTarget;if(!n)return;const r=LT(()=>{if(Zg.has(n))return;sw(n,"down");const s=LT(()=>{sw(n,"up")}),i=()=>sw(n,"cancel");n.addEventListener("keyup",s,e),n.addEventListener("blur",i,e)});n.addEventListener("keydown",r,e),n.addEventListener("blur",()=>n.removeEventListener("keydown",r),e)};function DT(t){return eE(t)&&!r9()}const $T=new WeakSet;function $re(t,e,n={}){const[r,s,i]=s9(t,n),o=l=>{const c=l.currentTarget;if(!DT(l)||$T.has(l))return;Zg.add(c),n.stopPropagation&&$T.add(l);const d=e(c,l),f={...s,capture:!0},h=(_,y)=>{window.removeEventListener("pointerup",m,f),window.removeEventListener("pointercancel",v,f),Zg.has(c)&&Zg.delete(c),DT(_)&&typeof d=="function"&&d(_,{success:y})},m=_=>{h(_,c===window||c===document||n.useGlobalTarget||i9(c,_.target))},v=_=>{h(_,!1)};window.addEventListener("pointerup",m,f),window.addEventListener("pointercancel",v,f)};return r.forEach(l=>{(n.useGlobalTarget?window:l).addEventListener("pointerdown",o,s),Bg(l)&&(l.addEventListener("focus",d=>Dre(d,s)),!Mre(l)&&!l.hasAttribute("tabindex")&&(l.tabIndex=0))}),i}function tE(t){return cL(t)&&"ownerSVGElement"in t}const Wg=new WeakMap;let Nl;const o9=(t,e,n)=>(r,s)=>s&&s[0]?s[0][t+"Size"]:tE(r)&&"getBBox"in r?r.getBBox()[e]:r[n],jre=o9("inline","width","offsetWidth"),Fre=o9("block","height","offsetHeight");function zre({target:t,borderBoxSize:e}){var n;(n=Wg.get(t))==null||n.forEach(r=>{r(t,{get width(){return jre(t,e)},get height(){return Fre(t,e)}})})}function Vre(t){t.forEach(zre)}function Hre(){typeof ResizeObserver>"u"||(Nl=new ResizeObserver(Vre))}function Ure(t,e){Nl||Hre();const n=n9(t);return n.forEach(r=>{let s=Wg.get(r);s||(s=new Set,Wg.set(r,s)),s.add(e),Nl==null||Nl.observe(r)}),()=>{n.forEach(r=>{const s=Wg.get(r);s==null||s.delete(e),s!=null&&s.size||Nl==null||Nl.unobserve(r)})}}const qg=new Set;let Zd;function Bre(){Zd=()=>{const t={get width(){return window.innerWidth},get height(){return window.innerHeight}};qg.forEach(e=>e(t))},window.addEventListener("resize",Zd)}function Zre(t){return qg.add(t),Zd||Bre(),()=>{qg.delete(t),!qg.size&&typeof Zd=="function"&&(window.removeEventListener("resize",Zd),Zd=void 0)}}function jT(t,e){return typeof t=="function"?Zre(t):Ure(t,e)}function Wre(t){return tE(t)&&t.tagName==="svg"}const qre=[...JL,vr,Eo],Gre=t=>qre.find(QL(t)),FT=()=>({translate:0,scale:1,origin:0,originPoint:0}),Wd=()=>({x:FT(),y:FT()}),zT=()=>({min:0,max:0}),Ar=()=>({x:zT(),y:zT()}),Kre=new WeakMap;function z1(t){return t!==null&&typeof t=="object"&&typeof t.start=="function"}function tm(t){return typeof t=="string"||Array.isArray(t)}const nE=["animate","whileInView","whileFocus","whileHover","whileTap","whileDrag","exit"],rE=["initial",...nE];function V1(t){return z1(t.animate)||rE.some(e=>tm(t[e]))}function a9(t){return!!(V1(t)||t.variants)}function Yre(t,e,n){for(const r in e){const s=e[r],i=n[r];if(ts(s))t.addValue(r,s);else if(ts(i))t.addValue(r,jf(s,{owner:t}));else if(i!==s)if(t.hasValue(r)){const o=t.getValue(r);o.liveStyle===!0?o.jump(s):o.hasAnimated||o.set(s)}else{const o=t.getStaticValue(r);t.addValue(r,jf(o!==void 0?o:s,{owner:t}))}}for(const r in n)e[r]===void 0&&t.removeValue(r);return e}const Jv={current:null},sE={current:!1},Xre=typeof window<"u";function l9(){if(sE.current=!0,!!Xre)if(window.matchMedia){const t=window.matchMedia("(prefers-reduced-motion)"),e=()=>Jv.current=t.matches;t.addEventListener("change",e),e()}else Jv.current=!1}const VT=["AnimationStart","AnimationComplete","Update","BeforeLayoutMeasure","LayoutMeasure","LayoutAnimationStart","LayoutAnimationComplete"];let e1={};function c9(t){e1=t}function Qre(){return e1}class Jre{scrapeMotionValuesFromProps(e,n,r){return{}}constructor({parent:e,props:n,presenceContext:r,reducedMotionConfig:s,skipAnimations:i,blockInitialAnimation:o,visualState:l},c={}){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=qk,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=Ls.now();this.renderScheduledAt<v&&(this.renderScheduledAt=v,Sn.render(this.render,!1,!0))};const{latestValues:d,renderState:f}=l;this.latestValues=d,this.baseTarget={...d},this.initialValues=n.initial?{...d}:{},this.renderState=f,this.parent=e,this.props=n,this.presenceContext=r,this.depth=e?e.depth+1:0,this.reducedMotionConfig=s,this.skipAnimationsConfig=i,this.options=c,this.blockInitialAnimation=!!o,this.isControllingVariants=V1(n),this.isVariantNode=a9(n),this.isVariantNode&&(this.variantChildren=new Set),this.manuallyAnimateOnMount=!!(e&&e.current);const{willChange:h,...m}=this.scrapeMotionValuesFromProps(n,{},this);for(const v in m){const _=m[v];d[v]!==void 0&&ts(_)&&_.set(d[v])}}mount(e){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=e,Kre.set(e,this),this.projection&&!this.projection.instance&&this.projection.mount(e),this.parent&&this.isVariantNode&&!this.isControllingVariants&&(this.removeFromVariantTree=this.parent.addVariantChild(this)),this.values.forEach((s,i)=>this.bindToMotionValue(i,s)),this.reducedMotionConfig==="never"?this.shouldReduceMotion=!1:this.reducedMotionConfig==="always"?this.shouldReduceMotion=!0:(sE.current||l9(),this.shouldReduceMotion=Jv.current),this.shouldSkipAnimations=this.skipAnimationsConfig??!1,(r=this.parent)==null||r.addChild(this),this.update(this.props,this.presenceContext),this.hasBeenMounted=!0}unmount(){var e;this.projection&&this.projection.unmount(),hc(this.notifyUpdate),hc(this.render),this.valueSubscriptions.forEach(n=>n()),this.valueSubscriptions.clear(),this.removeFromVariantTree&&this.removeFromVariantTree(),(e=this.parent)==null||e.removeChild(this);for(const n in this.events)this.events[n].clear();for(const n in this.features){const r=this.features[n];r&&(r.unmount(),r.isMounted=!1)}this.current=null}addChild(e){this.children.add(e),this.enteringChildren??(this.enteringChildren=new Set),this.enteringChildren.add(e)}removeChild(e){this.children.delete(e),this.enteringChildren&&this.enteringChildren.delete(e)}bindToMotionValue(e,n){if(this.valueSubscriptions.has(e)&&this.valueSubscriptions.get(e)(),n.accelerate&&BL.has(e)&&this.current instanceof HTMLElement){const{factory:o,keyframes:l,times:c,ease:d,duration:f}=n.accelerate,h=new HL({element:this.current,name:e,keyframes:l,times:c,ease:d,duration:xi(f)}),m=o(h);this.valueSubscriptions.set(e,()=>{m(),h.cancel()});return}const r=Jf.has(e);r&&this.onBindTransform&&this.onBindTransform();const s=n.on("change",o=>{this.latestValues[e]=o,this.props.onUpdate&&Sn.preRender(this.notifyUpdate),r&&this.projection&&(this.projection.isTransformDirty=!0),this.scheduleRender()});let i;typeof window<"u"&&window.MotionCheckAppearSync&&(i=window.MotionCheckAppearSync(this,e,n)),this.valueSubscriptions.set(e,()=>{s(),i&&i()})}sortNodePosition(e){return!this.current||!this.sortInstanceNodePosition||this.type!==e.type?0:this.sortInstanceNodePosition(this.current,e.current)}updateFeatures(){let e="animation";for(e in e1){const n=e1[e];if(!n)continue;const{isEnabled:r,Feature:s}=n;if(!this.features[e]&&s&&r(this.props)&&(this.features[e]=new s(this)),this.features[e]){const i=this.features[e];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):Ar()}getStaticValue(e){return this.latestValues[e]}setStaticValue(e,n){this.latestValues[e]=n}update(e,n){(e.transformTemplate||this.props.transformTemplate)&&this.scheduleRender(),this.prevProps=this.props,this.props=e,this.prevPresenceContext=this.presenceContext,this.presenceContext=n;for(let r=0;r<VT.length;r++){const s=VT[r];this.propEventSubscriptions[s]&&(this.propEventSubscriptions[s](),delete this.propEventSubscriptions[s]);const i="on"+s,o=e[i];o&&(this.propEventSubscriptions[s]=this.on(s,o))}this.prevMotionValues=Yre(this,this.scrapeMotionValuesFromProps(e,this.prevProps||{},this),this.prevMotionValues),this.handleChildMotionValue&&this.handleChildMotionValue()}getProps(){return this.props}getVariant(e){return this.props.variants?this.props.variants[e]:void 0}getDefaultTransition(){return this.props.transition}getTransformPagePoint(){return this.props.transformPagePoint}getClosestVariantNode(){return this.isVariantNode?this:this.parent?this.parent.getClosestVariantNode():void 0}addVariantChild(e){const n=this.getClosestVariantNode();if(n)return n.variantChildren&&n.variantChildren.add(e),()=>n.variantChildren.delete(e)}addValue(e,n){const r=this.values.get(e);n!==r&&(r&&this.removeValue(e),this.bindToMotionValue(e,n),this.values.set(e,n),this.latestValues[e]=n.get())}removeValue(e){this.values.delete(e);const n=this.valueSubscriptions.get(e);n&&(n(),this.valueSubscriptions.delete(e)),delete this.latestValues[e],this.removeValueFromRenderState(e,this.renderState)}hasValue(e){return this.values.has(e)}getValue(e,n){if(this.props.values&&this.props.values[e])return this.props.values[e];let r=this.values.get(e);return r===void 0&&n!==void 0&&(r=jf(n===null?void 0:n,{owner:this}),this.addValue(e,r)),r}readValue(e,n){let r=this.latestValues[e]!==void 0||!this.current?this.latestValues[e]:this.getBaseTargetFromProps(this.props,e)??this.readValueFromInstance(this.current,e,this.options);return r!=null&&(typeof r=="string"&&(lL(r)||uL(r))?r=parseFloat(r):!Gre(r)&&Eo.test(n)&&(r=t9(e,n)),this.setBaseTarget(e,ts(r)?r.get():r)),ts(r)?r.get():r}setBaseTarget(e,n){this.baseTarget[e]=n}getBaseTarget(e){var i;const{initial:n}=this.props;let r;if(typeof n=="string"||typeof n=="object"){const o=Yk(this.props,n,(i=this.presenceContext)==null?void 0:i.custom);o&&(r=o[e])}if(n&&r!==void 0)return r;const s=this.getBaseTargetFromProps(this.props,e);return s!==void 0&&!ts(s)?s:this.initialValues[e]!==void 0&&r===void 0?void 0:this.baseTarget[e]}on(e,n){return this.events[e]||(this.events[e]=new jk),this.events[e].add(n)}notify(e,...n){this.events[e]&&this.events[e].notify(...n)}scheduleRenderMicrotask(){Jk.render(this.render)}}class u9 extends Jre{constructor(){super(...arguments),this.KeyframeResolver=Are}sortInstanceNodePosition(e,n){return e.compareDocumentPosition(n)&2?1:-1}getBaseTargetFromProps(e,n){const r=e.style;return r?r[n]:void 0}removeValueFromRenderState(e,{vars:n,style:r}){delete n[e],delete r[e]}handleChildMotionValue(){this.childSubscription&&(this.childSubscription(),delete this.childSubscription);const{children:e}=this.props;ts(e)&&(this.childSubscription=e.on("change",n=>{this.current&&(this.current.textContent=`${n}`)}))}}class xc{constructor(e){this.isMounted=!1,this.node=e}update(){}}function d9({top:t,left:e,right:n,bottom:r}){return{x:{min:e,max:n},y:{min:t,max:r}}}function ese({x:t,y:e}){return{top:e.min,right:t.max,bottom:e.max,left:t.min}}function tse(t,e){if(!e)return t;const n=e({x:t.left,y:t.top}),r=e({x:t.right,y:t.bottom});return{top:n.y,left:n.x,bottom:r.y,right:r.x}}function iw(t){return t===void 0||t===1}function Lx({scale:t,scaleX:e,scaleY:n}){return!iw(t)||!iw(e)||!iw(n)}function iu(t){return Lx(t)||f9(t)||t.z||t.rotate||t.rotateX||t.rotateY||t.skewX||t.skewY}function f9(t){return HT(t.x)||HT(t.y)}function HT(t){return t&&t!=="0%"}function t1(t,e,n){const r=t-n,s=e*r;return n+s}function UT(t,e,n,r,s){return s!==void 0&&(t=t1(t,s,r)),t1(t,n,r)+e}function Dx(t,e=0,n=1,r,s){t.min=UT(t.min,e,n,r,s),t.max=UT(t.max,e,n,r,s)}function h9(t,{x:e,y:n}){Dx(t.x,e.translate,e.scale,e.originPoint),Dx(t.y,n.translate,n.scale,n.originPoint)}const BT=.999999999999,ZT=1.0000000000001;function nse(t,e,n,r=!1){var l;const s=n.length;if(!s)return;e.x=e.y=1;let i,o;for(let c=0;c<s;c++){i=n[c],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&&(Ko(t.x,-i.scroll.offset.x),Ko(t.y,-i.scroll.offset.y)),o&&(e.x*=o.x.scale,e.y*=o.y.scale,h9(t,o)),r&&iu(i.latestValues)&&Gg(t,i.latestValues,(l=i.layout)==null?void 0:l.layoutBox))}e.x<ZT&&e.x>BT&&(e.x=1),e.y<ZT&&e.y>BT&&(e.y=1)}function Ko(t,e){t.min+=e,t.max+=e}function WT(t,e,n,r,s=.5){const i=xn(t.min,t.max,s);Dx(t,e,n,i,r)}function qT(t,e){return typeof t=="string"?parseFloat(t)/100*(e.max-e.min):t}function Gg(t,e,n){const r=n??t;WT(t.x,qT(e.x,r.x),e.scaleX,e.scale,e.originX),WT(t.y,qT(e.y,r.y),e.scaleY,e.scale,e.originY)}function p9(t,e){return d9(tse(t.getBoundingClientRect(),e))}function rse(t,e,n){const r=p9(t,n),{scroll:s}=e;return s&&(Ko(r.x,s.offset.x),Ko(r.y,s.offset.y)),r}const sse={x:"translateX",y:"translateY",z:"translateZ",transformPerspective:"perspective"},ise=Qf.length;function ose(t,e,n){let r="",s=!0;for(let o=0;o<ise;o++){const l=Qf[o],c=t[l];if(c===void 0)continue;let d=!0;if(typeof c=="number")d=c===(l.startsWith("scale")?1:0);else{const f=parseFloat(c);d=l.startsWith("scale")?f===1:f===0}if(!d||n){const f=Nx(c,Qv[l]);if(!d){s=!1;const h=sse[l]||l;r+=`${h}(${f}) `}n&&(e[l]=f)}}const i=t.pathRotation;return i&&(s=!1,r+=`rotate(${Nx(i,Qv.pathRotation)}) `),r=r.trim(),n?r=n(e,s?"":r):s&&(r="none"),r}function iE(t,e,n){const{style:r,vars:s,transformOrigin:i}=t;let o=!1,l=!1;for(const c in e){const d=e[c];if(Jf.has(c)){o=!0;continue}else if(EL(c)){s[c]=d;continue}else{const f=Nx(d,Qv[c]);c.startsWith("origin")?(l=!0,i[c]=f):r[c]=f}}if(e.transform||(o||n?r.transform=ose(e,t.transform,n):r.transform&&(r.transform="none")),l){const{originX:c="50%",originY:d="50%",originZ:f=0}=i;r.transformOrigin=`${c} ${d} ${f}`}}function m9(t,{style:e,vars:n},r,s){const i=t.style;let o;for(o in e)i[o]=e[o];s==null||s.applyProjectionStyles(i,r);for(o in n)i.setProperty(o,n[o])}function GT(t,e){return e.max===e.min?0:t/(e.max-e.min)*100}const qh={correct:(t,e)=>{if(!e.target)return t;if(typeof t=="string")if(Ge.test(t))t=parseFloat(t);else return t;const n=GT(t,e.target.x),r=GT(t,e.target.y);return`${n}% ${r}%`}},ase={correct:(t,{treeScale:e,projectionDelta:n})=>{const r=t,s=Eo.parse(t);if(s.length>5)return r;const i=Eo.createTransformer(t),o=typeof s[0]!="number"?1:0,l=n.x.scale*e.x,c=n.y.scale*e.y;s[0+o]/=l,s[1+o]/=c;const d=xn(l,c,.5);return typeof s[2+o]=="number"&&(s[2+o]/=d),typeof s[3+o]=="number"&&(s[3+o]/=d),i(s)}},$x={borderRadius:{...qh,applyTo:[...Qk]},borderTopLeftRadius:qh,borderTopRightRadius:qh,borderBottomLeftRadius:qh,borderBottomRightRadius:qh,boxShadow:ase};function g9(t,{layout:e,layoutId:n}){return Jf.has(t)||t.startsWith("origin")||(e||n!==void 0)&&(!!$x[t]||t==="opacity")}function oE(t,e,n){var o;const r=t.style,s=e==null?void 0:e.style,i={};if(!r)return i;for(const l in r)(ts(r[l])||s&&ts(s[l])||g9(l,t)||((o=n==null?void 0:n.getValue(l))==null?void 0:o.liveStyle)!==void 0)&&(i[l]=r[l]);return i}function lse(t){return window.getComputedStyle(t)}class cse extends u9{constructor(){super(...arguments),this.type="html",this.renderInstance=m9}mount(e){j1(!!e.style),super.mount(e)}readValueFromInstance(e,n){var r;if(Jf.has(n))return(r=this.projection)!=null&&r.isProjecting?Sx(n):Rne(e,n);{const s=lse(e),i=(EL(n)?s.getPropertyValue(n):s[n])||0;return typeof i=="string"?i.trim():i}}measureInstanceViewportBox(e,{transformPagePoint:n}){return p9(e,n)}build(e,n,r){iE(e,n,r.transformTemplate)}scrapeMotionValuesFromProps(e,n,r){return oE(e,n,r)}}const use={offset:"stroke-dashoffset",array:"stroke-dasharray"},dse={offset:"strokeDashoffset",array:"strokeDasharray"};function fse(t,e,n=1,r=0,s=!0){t.pathLength=1;const i=s?use:dse;t[i.offset]=`${-r}`,t[i.array]=`${e} ${n}`}const hse=["offsetDistance","offsetPath","offsetRotate","offsetAnchor"];function v9(t,{attrX:e,attrY:n,attrScale:r,pathLength:s,pathSpacing:i=1,pathOffset:o=0,...l},c,d,f){if(iE(t,l,d),c){t.style.viewBox&&(t.attrs.viewBox=t.style.viewBox);return}t.attrs=t.style,t.style={};const{attrs:h,style:m}=t;h.transform&&(m.transform=h.transform,delete h.transform),(m.transform||h.transformOrigin)&&(m.transformOrigin=h.transformOrigin??"50% 50%",delete h.transformOrigin),m.transform&&(m.transformBox=(f==null?void 0:f.transformBox)??"fill-box",delete h.transformBox);for(const v of hse)h[v]!==void 0&&(m[v]=h[v],delete h[v]);e!==void 0&&(h.x=e),n!==void 0&&(h.y=n),r!==void 0&&(h.scale=r),s!==void 0&&fse(h,s,i,o,!1)}const y9=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"]),_9=t=>typeof t=="string"&&t.toLowerCase()==="svg";function pse(t,e,n,r){m9(t,e,void 0,r);for(const s in e.attrs)t.setAttribute(y9.has(s)?s:Xk(s),e.attrs[s])}function w9(t,e,n){const r=oE(t,e,n);for(const s in t)if(ts(t[s])||ts(e[s])){const i=Qf.indexOf(s)!==-1?"attr"+s.charAt(0).toUpperCase()+s.substring(1):s;r[i]=t[s]}return r}class mse extends u9{constructor(){super(...arguments),this.type="svg",this.isSVGTag=!1,this.measureInstanceViewportBox=Ar}getBaseTargetFromProps(e,n){return e[n]}readValueFromInstance(e,n){if(Jf.has(n)){const r=e9(n);return r&&r.default||0}return n=y9.has(n)?n:Xk(n),e.getAttribute(n)}scrapeMotionValuesFromProps(e,n,r){return w9(e,n,r)}build(e,n,r){v9(e,n,this.isSVGTag,r.transformTemplate,r.style)}renderInstance(e,n,r,s){pse(e,n,r,s)}mount(e){this.isSVGTag=_9(e.tagName),super.mount(e)}}const gse=rE.length;function b9(t){if(!t)return;if(!t.isControllingVariants){const n=t.parent?b9(t.parent)||{}:{};return t.props.initial!==void 0&&(n.initial=t.props.initial),n}const e={};for(let n=0;n<gse;n++){const r=rE[n],s=t.props[r];(tm(s)||s===!1)&&(e[r]=s)}return e}function x9(t,e){if(!Array.isArray(e))return!1;const n=e.length;if(n!==t.length)return!1;for(let r=0;r<n;r++)if(e[r]!==t[r])return!1;return!0}const vse=[...nE].reverse(),yse=nE.length;function _se(t){return e=>Promise.all(e.map(({animation:n,options:r})=>vre(t,n,r)))}function wse(t){let e=_se(t),n=KT(),r=!0,s=!1;const i=d=>(f,h)=>{var v;const m=Cu(t,h,d==="exit"?(v=t.presenceContext)==null?void 0:v.custom:void 0);if(m){const{transition:_,transitionEnd:y,...w}=m;f={...f,...w,...y}}return f};function o(d){e=d(t)}function l(d){const{props:f}=t,h=b9(t.parent)||{},m=[],v=new Set;let _={},y=1/0;for(let x=0;x<yse;x++){const k=vse[x],P=n[k],C=f[k]!==void 0?f[k]:h[k],T=tm(C),O=k===d?P.isActive:null;O===!1&&(y=x);let I=C===h[k]&&C!==f[k]&&T;if(I&&(r||s)&&t.manuallyAnimateOnMount&&(I=!1),P.protectedKeys={..._},!P.isActive&&O===null||!C&&!P.prevProp||z1(C)||typeof C=="boolean")continue;if(k==="exit"&&P.isActive&&O!==!0){P.prevResolvedValues&&(_={..._,...P.prevResolvedValues});continue}const R=bse(P.prevProp,C);let N=R||k===d&&P.isActive&&!I&&T||x>y&&T,L=!1;const z=Array.isArray(C)?C:[C];let $=z.reduce(i(k),{});O===!1&&($={});const{prevResolvedValues:G={}}=P,X={...G,...$},q=V=>{N=!0,v.has(V)&&(L=!0,v.delete(V)),P.needsAnimating[V]=!0;const Q=t.getValue(V);Q&&(Q.liveStyle=!1)};for(const V in X){const Q=$[V],U=G[V];if(_.hasOwnProperty(V))continue;let D=!1;Tx(Q)&&Tx(U)?D=!x9(Q,U)||R:D=Q!==U,D?Q!=null?q(V):v.add(V):Q!==void 0&&v.has(V)?q(V):P.protectedKeys[V]=!0}P.prevProp=C,P.prevResolvedValues=$,P.isActive&&(_={..._,...$}),(r||s)&&t.blockInitialAnimation&&(N=!1);const H=I&&R;N&&(!H||L)&&m.push(...z.map(V=>{const Q={type:k};if(typeof V=="string"&&(r||s)&&!H&&t.manuallyAnimateOnMount&&t.parent){const{parent:U}=t,D=Cu(U,V);if(U.enteringChildren&&D){const{delayChildren:K}=D.transition||{};Q.delay=ZL(U.enteringChildren,t,K)}}return{animation:V,options:Q}}))}if(v.size){const x={};if(typeof f.initial!="boolean"){const k=Cu(t,Array.isArray(f.initial)?f.initial[0]:f.initial);k&&k.transition&&(x.transition=k.transition)}v.forEach(k=>{const P=t.getBaseTarget(k),C=t.getValue(k);C&&(C.liveStyle=!0),x[k]=P??null}),m.push({animation:x})}let w=!!m.length;return r&&(f.initial===!1||f.initial===f.animate)&&!t.manuallyAnimateOnMount&&(w=!1),r=!1,s=!1,w?e(m):Promise.resolve()}function c(d,f){var m;if(n[d].isActive===f)return Promise.resolve();(m=t.variantChildren)==null||m.forEach(v=>{var _;return(_=v.animationState)==null?void 0:_.setActive(d,f)}),n[d].isActive=f;const h=l(d);for(const v in n)n[v].protectedKeys={};return h}return{animateChanges:l,setActive:c,setAnimateFunction:o,getState:()=>n,reset:()=>{n=KT(),s=!0}}}function bse(t,e){return typeof e=="string"?e!==t:Array.isArray(e)?!x9(e,t):!1}function Gc(t=!1){return{isActive:t,protectedKeys:{},needsAnimating:{},prevResolvedValues:{}}}function KT(){return{animate:Gc(!0),whileInView:Gc(),whileHover:Gc(),whileTap:Gc(),whileDrag:Gc(),whileFocus:Gc(),exit:Gc()}}function jx(t,e){t.min=e.min,t.max=e.max}function mo(t,e){jx(t.x,e.x),jx(t.y,e.y)}function YT(t,e){t.translate=e.translate,t.scale=e.scale,t.originPoint=e.originPoint,t.origin=e.origin}const S9=1e-4,xse=1-S9,Sse=1+S9,k9=.01,kse=0-k9,Ese=0+k9;function Ds(t){return t.max-t.min}function Cse(t,e,n){return Math.abs(t-e)<=n}function XT(t,e,n,r=.5){t.origin=r,t.originPoint=xn(e.min,e.max,t.origin),t.scale=Ds(n)/Ds(e),t.translate=xn(n.min,n.max,t.origin)-t.originPoint,(t.scale>=xse&&t.scale<=Sse||isNaN(t.scale))&&(t.scale=1),(t.translate>=kse&&t.translate<=Ese||isNaN(t.translate))&&(t.translate=0)}function Tp(t,e,n,r){XT(t.x,e.x,n.x,r?r.originX:void 0),XT(t.y,e.y,n.y,r?r.originY:void 0)}function QT(t,e,n,r=0){const s=r?xn(n.min,n.max,r):n.min;t.min=s+e.min,t.max=t.min+Ds(e)}function Pse(t,e,n,r){QT(t.x,e.x,n.x,r==null?void 0:r.x),QT(t.y,e.y,n.y,r==null?void 0:r.y)}function JT(t,e,n,r=0){const s=r?xn(n.min,n.max,r):n.min;t.min=e.min-s,t.max=t.min+Ds(e)}function n1(t,e,n,r){JT(t.x,e.x,n.x,r==null?void 0:r.x),JT(t.y,e.y,n.y,r==null?void 0:r.y)}function eR(t,e,n,r,s){return t-=e,t=t1(t,1/n,r),s!==void 0&&(t=t1(t,1/s,r)),t}function Ase(t,e=0,n=1,r=.5,s,i=t,o=t){if(ra.test(e)&&(e=parseFloat(e),e=xn(o.min,o.max,e/100)-o.min),typeof e!="number")return;let l=xn(i.min,i.max,r);t===i&&(l-=e),t.min=eR(t.min,e,n,l,s),t.max=eR(t.max,e,n,l,s)}function tR(t,e,[n,r,s],i,o){Ase(t,e[n],e[r],e[s],e.scale,i,o)}const Tse=["x","scaleX","originX"],Rse=["y","scaleY","originY"];function nR(t,e,n,r){tR(t.x,e,Tse,n?n.x:void 0,r?r.x:void 0),tR(t.y,e,Rse,n?n.y:void 0,r?r.y:void 0)}function rR(t){return t.translate===0&&t.scale===1}function E9(t){return rR(t.x)&&rR(t.y)}function sR(t,e){return t.min===e.min&&t.max===e.max}function Ise(t,e){return sR(t.x,e.x)&&sR(t.y,e.y)}function iR(t,e){return Math.round(t.min)===Math.round(e.min)&&Math.round(t.max)===Math.round(e.max)}function C9(t,e){return iR(t.x,e.x)&&iR(t.y,e.y)}function oR(t){return Ds(t.x)/Ds(t.y)}function aR(t,e){return t.translate===e.translate&&t.scale===e.scale&&t.originPoint===e.originPoint}function Uo(t){return[t("x"),t("y")]}function Ose(t,e,n){let r="";const s=t.x.translate/e.x,i=t.y.translate/e.y,o=(n==null?void 0:n.z)||0;if((s||i||o)&&(r=`translate3d(${s}px, ${i}px, ${o}px) `),(e.x!==1||e.y!==1)&&(r+=`scale(${1/e.x}, ${1/e.y}) `),n){const{transformPerspective:d,rotate:f,pathRotation:h,rotateX:m,rotateY:v,skewX:_,skewY:y}=n;d&&(r=`perspective(${d}px) ${r}`),f&&(r+=`rotate(${f}deg) `),h&&(r+=`rotate(${h}deg) `),m&&(r+=`rotateX(${m}deg) `),v&&(r+=`rotateY(${v}deg) `),_&&(r+=`skewX(${_}deg) `),y&&(r+=`skewY(${y}deg) `)}const l=t.x.scale*e.x,c=t.y.scale*e.y;return(l!==1||c!==1)&&(r+=`scale(${l}, ${c})`),r||"none"}const Mse=Qk.length,lR=t=>typeof t=="string"?parseFloat(t):t,cR=t=>typeof t=="number"||Ge.test(t);function Nse(t,e,n,r,s,i){s?(t.opacity=xn(0,n.opacity??1,Lse(r)),t.opacityExit=xn(e.opacity??1,0,Dse(r))):i&&(t.opacity=xn(e.opacity??1,n.opacity??1,r));for(let o=0;o<Mse;o++){const l=Qk[o];let c=uR(e,l),d=uR(n,l);if(c===void 0&&d===void 0)continue;c||(c=0),d||(d=0),c===0||d===0||cR(c)===cR(d)?(t[l]=Math.max(xn(lR(c),lR(d),r),0),(ra.test(d)||ra.test(c))&&(t[l]+="%")):t[l]=d}(e.rotate||n.rotate)&&(t.rotate=xn(e.rotate||0,n.rotate||0,r))}function uR(t,e){return t[e]!==void 0?t[e]:t.borderRadius}const Lse=P9(0,.5,_L),Dse=P9(.5,.95,to);function P9(t,e,n){return r=>r<t?0:r>e?1:n(Jp(t,e,r))}function $se(t,e,n){const r=ts(t)?t:jf(t);return r.start(Kk("",r,e,n)),r.animation}function nm(t,e,n,r={passive:!0}){return t.addEventListener(e,n,r),()=>t.removeEventListener(e,n,r)}const jse=(t,e)=>t.depth-e.depth;class Fse{constructor(){this.children=[],this.isDirty=!1}add(e){$k(this.children,e),this.isDirty=!0}remove(e){qv(this.children,e),this.isDirty=!0}forEach(e){this.isDirty&&this.children.sort(jse),this.isDirty=!1,this.children.forEach(e)}}function zse(t,e){const n=Ls.now(),r=({timestamp:s})=>{const i=s-n;i>=e&&(hc(r),t(i-e))};return Sn.setup(r,!0),()=>hc(r)}function Kg(t){return ts(t)?t.get():t}class Vse{constructor(){this.members=[]}add(e){$k(this.members,e);for(let n=this.members.length-1;n>=0;n--){const r=this.members[n];if(r===e||r===this.lead||r===this.prevLead)continue;const s=r.instance;(!s||s.isConnected===!1)&&!r.snapshot&&(qv(this.members,r),r.unmount())}e.scheduleRender()}remove(e){if(qv(this.members,e),e===this.prevLead&&(this.prevLead=void 0),e===this.lead){const n=this.members[this.members.length-1];n&&this.promote(n)}}relegate(e){var n;for(let r=this.members.indexOf(e)-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(e,n){var s;const r=this.lead;if(e!==r&&(this.prevLead=r,this.lead=e,e.show(),r)){r.updateSnapshot(),e.scheduleRender();const{layoutDependency:i}=r.options,{layoutDependency:o}=e.options;(i===void 0||i!==o)&&(e.resumeFrom=r,n&&(r.preserveOpacity=!0),r.snapshot&&(e.snapshot=r.snapshot,e.snapshot.latestValues=r.animationValues||r.latestValues),(s=e.root)!=null&&s.isUpdating&&(e.isLayoutDirty=!0)),e.options.crossfade===!1&&r.hide()}}exitAnimationComplete(){this.members.forEach(e=>{var n,r,s,i,o;(r=(n=e.options).onExitComplete)==null||r.call(n),(o=(s=e.resumingFrom)==null?void 0:(i=s.options).onExitComplete)==null||o.call(i)})}scheduleRender(){this.members.forEach(e=>e.instance&&e.scheduleRender(!1))}removeLeadSnapshot(){var e;(e=this.lead)!=null&&e.snapshot&&(this.lead.snapshot=void 0)}}const Yg={hasAnimatedSinceResize:!0,hasEverUpdated:!1},ow=["","X","Y","Z"],Hse=1e3;let Use=0;function aw(t,e,n,r){const{latestValues:s}=e;s[t]&&(n[t]=s[t],e.setStaticValue(t,0),r&&(r[t]=0))}function A9(t){if(t.hasCheckedOptimisedAppear=!0,t.root===t)return;const{visualElement:e}=t.options;if(!e)return;const n=YL(e);if(window.MotionHasOptimisedAnimation(n,"transform")){const{layout:s,layoutId:i}=t.options;window.MotionCancelOptimisedAnimation(n,"transform",Sn,!(s||i))}const{parent:r}=t;r&&!r.hasCheckedOptimisedAppear&&A9(r)}function T9({attachResizeListener:t,defaultParent:e,measureScroll:n,checkIsScrollRoot:r,resetTransform:s}){return class{constructor(o={},l=e==null?void 0:e()){this.id=Use++,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(Wse),this.nodes.forEach(Qse),this.nodes.forEach(Jse),this.nodes.forEach(qse)},this.resolvedRelativeTargetAt=0,this.linkedParentVersion=0,this.hasProjected=!1,this.isVisible=!0,this.animationProgress=0,this.sharedNodes=new Map,this.latestValues=o,this.root=l?l.root||l:this,this.path=l?[...l.path,l]:[],this.parent=l,this.depth=l?l.depth+1:0;for(let c=0;c<this.path.length;c++)this.path[c].shouldResetTransform=!0;this.root===this&&(this.nodes=new Fse)}addEventListener(o,l){return this.eventHandlers.has(o)||this.eventHandlers.set(o,new jk),this.eventHandlers.get(o).add(l)}notifyListeners(o,...l){const c=this.eventHandlers.get(o);c&&c.notify(...l)}hasListeners(o){return this.eventHandlers.has(o)}mount(o){if(this.instance)return;this.isSVG=tE(o)&&!Wre(o),this.instance=o;const{layoutId:l,layout:c,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&&(c||l)&&(this.isLayoutDirty=!0),t){let f,h=0;const m=()=>this.root.updateBlockedByResize=!1;Sn.read(()=>{h=window.innerWidth}),t(o,()=>{const v=window.innerWidth;v!==h&&(h=v,this.root.updateBlockedByResize=!0,f&&f(),f=zse(m,250),Yg.hasAnimatedSinceResize&&(Yg.hasAnimatedSinceResize=!1,this.nodes.forEach(hR)))})}l&&this.root.registerSharedNode(l,this),this.options.animate!==!1&&d&&(l||c)&&this.addEventListener("didUpdate",({delta:f,hasLayoutChanged:h,hasRelativeLayoutChanged:m,layout:v})=>{if(this.isTreeAnimationBlocked()){this.target=void 0,this.relativeTarget=void 0;return}const _=this.options.transition||d.getDefaultTransition()||sie,{onLayoutAnimationStart:y,onLayoutAnimationComplete:w}=d.getProps(),x=!this.targetLayout||!C9(this.targetLayout,v),k=!h&&m;if(this.options.layoutRoot||this.resumeFrom||k||h&&(x||!this.currentAnimation)){this.resumeFrom&&(this.resumingFrom=this.resumeFrom,this.resumingFrom.resumingFrom=void 0);const P={...Gk(_,"layout"),onPlay:y,onComplete:w};(d.shouldReduceMotion||this.options.layoutRoot)&&(P.delay=0,P.type=!1),this.startAnimation(P),this.setAnimationOrigin(f,k,P.path)}else h||hR(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(),hc(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(eie),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&&A9(this),!this.root.isUpdating&&this.root.startUpdate(),this.isLayoutDirty)return;this.isLayoutDirty=!0;for(let f=0;f<this.path.length;f++){const h=this.path[f];h.shouldResetTransform=!0,(typeof h.latestValues.x=="string"||typeof h.latestValues.y=="string")&&(h.isLayoutDirty=!0),h.updateScroll("snapshot"),h.options.layoutRoot&&h.willUpdate(!1)}const{layoutId:l,layout:c}=this.options;if(l===void 0&&!c)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 c=this.updateBlockedByResize;this.unblockUpdate(),this.updateBlockedByResize=!1,this.clearAllSnapshots(),c&&this.nodes.forEach(Kse),this.nodes.forEach(dR);return}if(this.animationId<=this.animationCommitId){this.nodes.forEach(fR);return}this.animationCommitId=this.animationId,this.isUpdating?(this.isUpdating=!1,this.nodes.forEach(Yse),this.nodes.forEach(Xse),this.nodes.forEach(Bse),this.nodes.forEach(Zse)):this.nodes.forEach(fR),this.clearAllSnapshots();const l=Ls.now();Qr.delta=la(0,1e3/60,l-Qr.timestamp),Qr.timestamp=l,Qr.isProcessing=!0,Q2.update.process(Qr),Q2.preRender.process(Qr),Q2.render.process(Qr),Qr.isProcessing=!1}didUpdate(){this.updateScheduled||(this.updateScheduled=!0,Jk.read(this.scheduleUpdate))}clearAllSnapshots(){this.nodes.forEach(Gse),this.sharedNodes.forEach(tie)}scheduleUpdateProjection(){this.projectionUpdateScheduled||(this.projectionUpdateScheduled=!0,Sn.preRender(this.updateProjection,!1,!0))}scheduleCheckAfterUnmount(){Sn.postRender(()=>{this.isLayoutDirty?this.root.didUpdate():this.root.checkUpdateFailed()})}updateSnapshot(){this.snapshot||!this.instance||(this.snapshot=this.measure(),this.snapshot&&!Ds(this.snapshot.measuredBox.x)&&!Ds(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 c=0;c<this.path.length;c++)this.path[c].updateScroll();const o=this.layout;this.layout=this.measure(!1),this.layoutVersion++,this.layoutCorrected||(this.layoutCorrected=Ar()),this.isLayoutDirty=!1,this.projectionDelta=void 0,this.notifyListeners("measure",this.layout.layoutBox);const{visualElement:l}=this.options;l&&l.notify("LayoutMeasure",this.layout.layoutBox,o?o.layoutBox:void 0)}updateScroll(o="measure"){let l=!!(this.options.layoutScroll&&this.instance);if(this.scroll&&this.scroll.animationId===this.root.animationId&&this.scroll.phase===o&&(l=!1),l&&this.instance){const c=r(this.instance);this.scroll={animationId:this.root.animationId,phase:o,isRoot:c,offset:n(this.instance),wasRoot:this.scroll?this.scroll.isRoot:c}}}resetTransform(){if(!s)return;const o=this.isLayoutDirty||this.shouldResetTransform||this.options.alwaysMeasureLayout,l=this.projectionDelta&&!E9(this.projectionDelta),c=this.getTransformTemplate(),d=c?c(this.latestValues,""):void 0,f=d!==this.prevTransformTemplateValue;o&&this.instance&&(l||iu(this.latestValues)||f)&&(s(this.instance,d),this.shouldResetTransform=!1,this.scheduleRender())}measure(o=!0){const l=this.measurePageBox();let c=this.removeElementScroll(l);return o&&(c=this.removeTransform(c)),iie(c),{animationId:this.root.animationId,measuredBox:l,layoutBox:c,latestValues:{},source:this.id}}measurePageBox(){var d;const{visualElement:o}=this.options;if(!o)return Ar();const l=o.measureViewportBox();if(!(((d=this.scroll)==null?void 0:d.wasRoot)||this.path.some(oie))){const{scroll:f}=this.root;f&&(Ko(l.x,f.offset.x),Ko(l.y,f.offset.y))}return l}removeElementScroll(o){var c;const l=Ar();if(mo(l,o),(c=this.scroll)!=null&&c.wasRoot)return l;for(let d=0;d<this.path.length;d++){const f=this.path[d],{scroll:h,options:m}=f;f!==this.root&&h&&m.layoutScroll&&(h.wasRoot&&mo(l,o),Ko(l.x,h.offset.x),Ko(l.y,h.offset.y))}return l}applyTransform(o,l=!1,c){var f,h;const d=c||Ar();mo(d,o);for(let m=0;m<this.path.length;m++){const v=this.path[m];!l&&v.options.layoutScroll&&v.scroll&&v!==v.root&&(Ko(d.x,-v.scroll.offset.x),Ko(d.y,-v.scroll.offset.y)),iu(v.latestValues)&&Gg(d,v.latestValues,(f=v.layout)==null?void 0:f.layoutBox)}return iu(this.latestValues)&&Gg(d,this.latestValues,(h=this.layout)==null?void 0:h.layoutBox),d}removeTransform(o){var c;const l=Ar();mo(l,o);for(let d=0;d<this.path.length;d++){const f=this.path[d];if(!iu(f.latestValues))continue;let h;f.instance&&(Lx(f.latestValues)&&f.updateSnapshot(),h=Ar(),mo(h,f.measurePageBox())),nR(l,f.latestValues,(c=f.snapshot)==null?void 0:c.layoutBox,h)}return iu(this.latestValues)&&nR(l,this.latestValues),l}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!==Qr.timestamp&&this.relativeParent.resolveTargetDelta(!0)}resolveTargetDelta(o=!1){var v;const l=this.getLead();this.isProjectionDirty||(this.isProjectionDirty=l.isProjectionDirty),this.isTransformDirty||(this.isTransformDirty=l.isTransformDirty),this.isSharedProjectionDirty||(this.isSharedProjectionDirty=l.isSharedProjectionDirty);const c=!!this.resumingFrom||this!==l;if(!(o||c&&this.isSharedProjectionDirty||this.isProjectionDirty||(v=this.parent)!=null&&v.isProjectionDirty||this.attemptToResolveRelativeTarget||this.root.updateBlockedByResize))return;const{layout:f,layoutId:h}=this.options;if(!this.layout||!(f||h))return;this.resolvedRelativeTargetAt=Qr.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=Ar(),this.targetWithTransforms=Ar()),this.relativeTarget&&this.relativeTargetOrigin&&this.relativeParent&&this.relativeParent.target?(this.forceRelativeParentToResolveTarget(),Pse(this.target,this.relativeTarget,this.relativeParent.target,this.options.layoutAnchor||void 0)):this.targetDelta?(this.resumingFrom?this.applyTransform(this.layout.layoutBox,!1,this.target):mo(this.target,this.layout.layoutBox),h9(this.target,this.targetDelta)):mo(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||Lx(this.parent.latestValues)||f9(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,l,c){this.relativeParent=o,this.linkedParentVersion=o.layoutVersion,this.forceRelativeParentToResolveTarget(),this.relativeTarget=Ar(),this.relativeTargetOrigin=Ar(),n1(this.relativeTargetOrigin,l,c,this.options.layoutAnchor||void 0),mo(this.relativeTarget,this.relativeTargetOrigin)}removeRelativeTarget(){this.relativeParent=this.relativeTarget=void 0}calcProjection(){var _;const o=this.getLead(),l=!!this.resumingFrom||this!==o;let c=!0;if((this.isProjectionDirty||(_=this.parent)!=null&&_.isProjectionDirty)&&(c=!1),l&&(this.isSharedProjectionDirty||this.isTransformDirty)&&(c=!1),this.resolvedRelativeTargetAt===Qr.timestamp&&(c=!1),c)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;mo(this.layoutCorrected,this.layout.layoutBox);const h=this.treeScale.x,m=this.treeScale.y;nse(this.layoutCorrected,this.treeScale,this.path,l),o.layout&&!o.target&&(this.treeScale.x!==1||this.treeScale.y!==1)&&(o.target=o.layout.layoutBox,o.targetWithTransforms=Ar());const{target:v}=o;if(!v){this.prevProjectionDelta&&(this.createProjectionDeltas(),this.scheduleRender());return}!this.projectionDelta||!this.prevProjectionDelta?this.createProjectionDeltas():(YT(this.prevProjectionDelta.x,this.projectionDelta.x),YT(this.prevProjectionDelta.y,this.projectionDelta.y)),Tp(this.projectionDelta,this.layoutCorrected,v,this.latestValues),(this.treeScale.x!==h||this.treeScale.y!==m||!aR(this.projectionDelta.x,this.prevProjectionDelta.x)||!aR(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 l;if((l=this.options.visualElement)==null||l.scheduleRender(),o){const c=this.getStack();c&&c.scheduleRender()}this.resumingFrom&&!this.resumingFrom.instance&&(this.resumingFrom=void 0)}createProjectionDeltas(){this.prevProjectionDelta=Wd(),this.projectionDelta=Wd(),this.projectionDeltaWithTransform=Wd()}setAnimationOrigin(o,l=!1,c){const d=this.snapshot,f=d?d.latestValues:{},h={...this.latestValues},m=Wd();(!this.relativeParent||!this.relativeParent.options.layoutRoot)&&(this.relativeTarget=this.relativeTargetOrigin=void 0),this.attemptToResolveRelativeTarget=!l;const v=Ar(),_=d?d.source:void 0,y=this.layout?this.layout.source:void 0,w=_!==y,x=this.getStack(),k=!x||x.members.length<=1,P=!!(w&&!k&&this.options.crossfade===!0&&!this.path.some(rie));this.animationProgress=0;let C;const T=c==null?void 0:c.interpolateProjection(o);this.mixTargetDelta=O=>{const I=O/1e3,R=T==null?void 0:T(I);R?(m.x.translate=R.x,m.x.scale=xn(o.x.scale,1,I),m.x.origin=o.x.origin,m.x.originPoint=o.x.originPoint,m.y.translate=R.y,m.y.scale=xn(o.y.scale,1,I),m.y.origin=o.y.origin,m.y.originPoint=o.y.originPoint):(pR(m.x,o.x,I),pR(m.y,o.y,I)),this.setTargetDelta(m),this.relativeTarget&&this.relativeTargetOrigin&&this.layout&&this.relativeParent&&this.relativeParent.layout&&(n1(v,this.layout.layoutBox,this.relativeParent.layout.layoutBox,this.options.layoutAnchor||void 0),nie(this.relativeTarget,this.relativeTargetOrigin,v,I),C&&Ise(this.relativeTarget,C)&&(this.isProjectionDirty=!1),C||(C=Ar()),mo(C,this.relativeTarget)),w&&(this.animationValues=h,Nse(h,f,this.latestValues,I,P,k)),R&&R.rotate!==void 0&&(this.animationValues||(this.animationValues=h),this.animationValues.pathRotation=R.rotate),this.root.scheduleUpdateProjection(),this.scheduleRender(),this.animationProgress=I},this.mixTargetDelta(this.options.layoutRoot?1e3:0)}startAnimation(o){var l,c,d;this.notifyListeners("animationStart"),(l=this.currentAnimation)==null||l.stop(),(d=(c=this.resumingFrom)==null?void 0:c.currentAnimation)==null||d.stop(),this.pendingAnimation&&(hc(this.pendingAnimation),this.pendingAnimation=void 0),this.pendingAnimation=Sn.update(()=>{Yg.hasAnimatedSinceResize=!0,this.motionValue||(this.motionValue=jf(0)),this.motionValue.jump(0,!1),this.currentAnimation=$se(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(Hse),this.currentAnimation.stop()),this.completeAnimation()}applyTransformsToTarget(){const o=this.getLead();let{targetWithTransforms:l,target:c,layout:d,latestValues:f}=o;if(!(!l||!c||!d)){if(this!==o&&this.layout&&d&&R9(this.options.animationType,this.layout.layoutBox,d.layoutBox)){c=this.target||Ar();const h=Ds(this.layout.layoutBox.x);c.x.min=o.target.x.min,c.x.max=c.x.min+h;const m=Ds(this.layout.layoutBox.y);c.y.min=o.target.y.min,c.y.max=c.y.min+m}mo(l,c),Gg(l,f),Tp(this.projectionDeltaWithTransform,this.layoutCorrected,l,f)}}registerSharedNode(o,l){this.sharedNodes.has(o)||this.sharedNodes.set(o,new Vse),this.sharedNodes.get(o).add(l);const d=l.options.initialPromotionConfig;l.promote({transition:d?d.transition:void 0,preserveFollowOpacity:d&&d.shouldPreserveFollowOpacity?d.shouldPreserveFollowOpacity(l):void 0})}isLead(){const o=this.getStack();return o?o.lead===this:!0}getLead(){var l;const{layoutId:o}=this.options;return o?((l=this.getStack())==null?void 0:l.lead)||this:this}getPrevLead(){var l;const{layoutId:o}=this.options;return o?(l=this.getStack())==null?void 0:l.prevLead:void 0}getStack(){const{layoutId:o}=this.options;if(o)return this.root.sharedNodes.get(o)}promote({needsReset:o,transition:l,preserveFollowOpacity:c}={}){const d=this.getStack();d&&d.promote(this,c),o&&(this.projectionDelta=void 0,this.needsReset=!0),l&&this.setOptions({transition:l})}relegate(){const o=this.getStack();return o?o.relegate(this):!1}resetSkewAndRotation(){const{visualElement:o}=this.options;if(!o)return;let l=!1;const{latestValues:c}=o;if((c.z||c.rotate||c.rotateX||c.rotateY||c.rotateZ||c.skewX||c.skewY)&&(l=!0),!l)return;const d={};c.z&&aw("z",o,d,this.animationValues);for(let f=0;f<ow.length;f++)aw(`rotate${ow[f]}`,o,d,this.animationValues),aw(`skew${ow[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,l){if(!this.instance||this.isSVG)return;if(!this.isVisible){o.visibility="hidden";return}const c=this.getTransformTemplate();if(this.needsReset){this.needsReset=!1,o.visibility="",o.opacity="",o.pointerEvents=Kg(l==null?void 0:l.pointerEvents)||"",o.transform=c?c(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=Kg(l==null?void 0:l.pointerEvents)||""),this.hasProjected&&!iu(this.latestValues)&&(o.transform=c?c({},""):"none",this.hasProjected=!1);return}o.visibility="";const f=d.animationValues||d.latestValues;this.applyTransformsToTarget();let h=Ose(this.projectionDeltaWithTransform,this.treeScale,f);c&&(h=c(f,h)),o.transform=h;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 $x){if(f[_]===void 0)continue;const{correct:y,applyTo:w,isCSSVariable:x}=$x[_],k=h==="none"?f[_]:y(f[_],d);if(w){const P=w.length;for(let C=0;C<P;C++)o[w[C]]=k}else x?this.options.visualElement.renderState.vars[_]=k:o[_]=k}this.options.layoutId&&(o.pointerEvents=d===this?Kg(l==null?void 0:l.pointerEvents)||"":"none")}clearSnapshot(){this.resumeFrom=this.snapshot=void 0}resetTree(){this.root.nodes.forEach(o=>{var l;return(l=o.currentAnimation)==null?void 0:l.stop()}),this.root.nodes.forEach(dR),this.root.sharedNodes.clear()}}}function Bse(t){t.updateLayout()}function Zse(t){var n;const e=((n=t.resumeFrom)==null?void 0:n.snapshot)||t.snapshot;if(t.isLead()&&t.layout&&e&&t.hasListeners("didUpdate")){const{layoutBox:r,measuredBox:s}=t.layout,{animationType:i}=t.options,o=e.source!==t.layout.source;if(i==="size")Uo(h=>{const m=o?e.measuredBox[h]:e.layoutBox[h],v=Ds(m);m.min=r[h].min,m.max=m.min+v});else if(i==="x"||i==="y"){const h=i==="x"?"y":"x";jx(o?e.measuredBox[h]:e.layoutBox[h],r[h])}else R9(i,e.layoutBox,r)&&Uo(h=>{const m=o?e.measuredBox[h]:e.layoutBox[h],v=Ds(r[h]);m.max=m.min+v,t.relativeTarget&&!t.currentAnimation&&(t.isProjectionDirty=!0,t.relativeTarget[h].max=t.relativeTarget[h].min+v)});const l=Wd();Tp(l,r,e.layoutBox);const c=Wd();o?Tp(c,t.applyTransform(s,!0),e.measuredBox):Tp(c,r,e.layoutBox);const d=!E9(l);let f=!1;if(!t.resumeFrom){const h=t.getClosestProjectingParent();if(h&&!h.resumeFrom){const{snapshot:m,layout:v}=h;if(m&&v){const _=t.options.layoutAnchor||void 0,y=Ar();n1(y,e.layoutBox,m.layoutBox,_);const w=Ar();n1(w,r,v.layoutBox,_),C9(y,w)||(f=!0),h.options.layoutRoot&&(t.relativeTarget=w,t.relativeTargetOrigin=y,t.relativeParent=h)}}}t.notifyListeners("didUpdate",{layout:r,snapshot:e,delta:c,layoutDelta:l,hasLayoutChanged:d,hasRelativeLayoutChanged:f})}else if(t.isLead()){const{onExitComplete:r}=t.options;r&&r()}t.options.transition=void 0}function Wse(t){t.parent&&(t.isProjecting()||(t.isProjectionDirty=t.parent.isProjectionDirty),t.isSharedProjectionDirty||(t.isSharedProjectionDirty=!!(t.isProjectionDirty||t.parent.isProjectionDirty||t.parent.isSharedProjectionDirty)),t.isTransformDirty||(t.isTransformDirty=t.parent.isTransformDirty))}function qse(t){t.isProjectionDirty=t.isSharedProjectionDirty=t.isTransformDirty=!1}function Gse(t){t.clearSnapshot()}function dR(t){t.clearMeasurements()}function Kse(t){t.isLayoutDirty=!0,t.updateLayout()}function fR(t){t.isLayoutDirty=!1}function Yse(t){t.isAnimationBlocked&&t.layout&&!t.isLayoutDirty&&(t.snapshot=t.layout,t.isLayoutDirty=!0)}function Xse(t){const{visualElement:e}=t.options;e&&e.getProps().onBeforeLayoutMeasure&&e.notify("BeforeLayoutMeasure"),t.resetTransform()}function hR(t){t.finishAnimation(),t.targetDelta=t.relativeTarget=t.target=void 0,t.isProjectionDirty=!0}function Qse(t){t.resolveTargetDelta()}function Jse(t){t.calcProjection()}function eie(t){t.resetSkewAndRotation()}function tie(t){t.removeLeadSnapshot()}function pR(t,e,n){t.translate=xn(e.translate,0,n),t.scale=xn(e.scale,1,n),t.origin=e.origin,t.originPoint=e.originPoint}function mR(t,e,n,r){t.min=xn(e.min,n.min,r),t.max=xn(e.max,n.max,r)}function nie(t,e,n,r){mR(t.x,e.x,n.x,r),mR(t.y,e.y,n.y,r)}function rie(t){return t.animationValues&&t.animationValues.opacityExit!==void 0}const sie={duration:.45,ease:[.4,0,.1,1]},gR=t=>typeof navigator<"u"&&navigator.userAgent&&navigator.userAgent.toLowerCase().includes(t),vR=gR("applewebkit/")&&!gR("chrome/")?Math.round:to;function yR(t){t.min=vR(t.min),t.max=vR(t.max)}function iie(t){yR(t.x),yR(t.y)}function R9(t,e,n){return t==="position"||t==="preserve-aspect"&&!Cse(oR(e),oR(n),.2)}function oie(t){var e;return t!==t.root&&((e=t.scroll)==null?void 0:e.wasRoot)}const aie=T9({attachResizeListener:(t,e)=>nm(t,"resize",e),measureScroll:()=>{var t,e;return{x:document.documentElement.scrollLeft||((t=document.body)==null?void 0:t.scrollLeft)||0,y:document.documentElement.scrollTop||((e=document.body)==null?void 0:e.scrollTop)||0}},checkIsScrollRoot:()=>!0}),lw={current:void 0},I9=T9({measureScroll:t=>({x:t.scrollLeft,y:t.scrollTop}),defaultParent:()=>{if(!lw.current){const t=new aie({});t.mount(window),t.setOptions({layoutScroll:!0}),lw.current=t}return lw.current},resetTransform:(t,e)=>{t.style.transform=e!==void 0?e:"none"},checkIsScrollRoot:t=>window.getComputedStyle(t).position==="fixed"}),aE=g.createContext({transformPagePoint:t=>t,isStatic:!1,reducedMotion:"never"});function _R(t,e){if(typeof t=="function")return t(e);t!=null&&(t.current=e)}function lie(...t){return e=>{let n=!1;const r=t.map(s=>{const i=_R(s,e);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():_R(t[s],null)}}}}function cie(...t){return g.useCallback(lie(...t),t)}class uie extends g.Component{getSnapshotBeforeUpdate(e){const n=this.props.childRef.current;if(Bg(n)&&e.isPresent&&!this.props.isPresent&&this.props.pop!==!1){const r=n.offsetParent,s=Bg(r)&&r.offsetWidth||0,i=Bg(r)&&r.offsetHeight||0,o=getComputedStyle(n),l=this.props.sizeRef.current;l.height=parseFloat(o.height),l.width=parseFloat(o.width),l.top=n.offsetTop,l.left=n.offsetLeft,l.right=s-l.width-l.left,l.bottom=i-l.height-l.top,l.direction=o.direction}return null}componentDidUpdate(){}render(){return this.props.children}}function die({children:t,isPresent:e,anchorX:n,anchorY:r,root:s,pop:i}){var m;const o=g.useId(),l=g.useRef(null),c=g.useRef({width:0,height:0,top:0,left:0,right:0,bottom:0,direction:"ltr"}),{nonce:d}=g.useContext(aE),f=i!==!1?((m=t.props)==null?void 0:m.ref)??(t==null?void 0:t.ref):void 0,h=cie(l,f);return g.useInsertionEffect(()=>{const{width:v,height:_,top:y,left:w,right:x,bottom:k,direction:P}=c.current;if(e||i===!1||!l.current||!v||!_)return;const C=P==="rtl",T=n==="left"?C?`right: ${x}`:`left: ${w}`:C?`left: ${w}`:`right: ${x}`,O=r==="bottom"?`bottom: ${k}`:`top: ${y}`;l.current.dataset.motionPopId=o;const I=document.createElement("style");d&&(I.nonce=d);const R=s??document.head;return R.appendChild(I),I.sheet&&I.sheet.insertRule(`
|
|
122
|
-
[data-motion-pop-id="${o}"] {
|
|
123
|
-
position: absolute !important;
|
|
124
|
-
width: ${v}px !important;
|
|
125
|
-
height: ${_}px !important;
|
|
126
|
-
${T}px !important;
|
|
127
|
-
${O}px !important;
|
|
128
|
-
}
|
|
129
|
-
`),()=>{var N;(N=l.current)==null||N.removeAttribute("data-motion-pop-id"),R.contains(I)&&R.removeChild(I)}},[e]),S.jsx(uie,{isPresent:e,childRef:l,sizeRef:c,pop:i,children:i===!1?t:g.cloneElement(t,{ref:h})})}const fie=({children:t,initial:e,isPresent:n,onExitComplete:r,custom:s,presenceAffectsLayout:i,mode:o,anchorX:l,anchorY:c,root:d})=>{const f=Lk(hie),h=g.useId(),m=g.useRef(n),v=g.useRef(r);Dk(()=>{m.current=n,v.current=r});let _=!0,y=g.useMemo(()=>(_=!1,{id:h,initial:e,isPresent:n,custom:s,onExitComplete:w=>{f.set(w,!0);for(const x of f.values())if(!x)return;r&&r()},register:w=>(f.set(w,!1),()=>{var x;f.delete(w),!m.current&&!f.size&&((x=v.current)==null||x.call(v))})}),[n,f,r]);return i&&_&&(y={...y}),g.useMemo(()=>{f.forEach((w,x)=>f.set(x,!1))},[n]),g.useEffect(()=>{!n&&!f.size&&r&&r()},[n]),t=S.jsx(die,{pop:o==="popLayout",isPresent:n,anchorX:l,anchorY:c,root:d,children:t}),S.jsx($1.Provider,{value:y,children:t})};function hie(){return new Map}function O9(t=!0){const e=g.useContext($1);if(e===null)return[!0,null];const{isPresent:n,onExitComplete:r,register:s}=e,i=g.useId();g.useEffect(()=>{if(t)return s(i)},[t]);const o=g.useCallback(()=>t&&r&&r(i),[i,r,t]);return!n&&r?[!1,o]:[!0]}const dg=t=>t.key||"";function wR(t){const e=[];return g.Children.forEach(t,n=>{g.isValidElement(n)&&e.push(n)}),e}const Si=({children:t,custom:e,initial:n=!0,onExitComplete:r,presenceAffectsLayout:s=!0,mode:i="sync",propagate:o=!1,anchorX:l="left",anchorY:c="top",root:d})=>{const[f,h]=O9(o),m=g.useMemo(()=>wR(t),[t]),v=o&&!f?[]:m.map(dg),_=g.useRef(!0),y=g.useRef(m),w=Lk(()=>new Map),x=g.useRef(new Set),[k,P]=g.useState(m),[C,T]=g.useState(m);Dk(()=>{_.current=!1,y.current=m;for(let R=0;R<C.length;R++){const N=dg(C[R]);v.includes(N)?(w.delete(N),x.current.delete(N)):w.get(N)!==!0&&w.set(N,!1)}},[C,v.length,v.join("-")]);const O=[];if(m!==k){let R=[...m];for(let N=0;N<C.length;N++){const L=C[N],z=dg(L);v.includes(z)||(R.splice(N,0,L),O.push(L))}return i==="wait"&&O.length&&(R=O),T(wR(R)),P(m),null}const{forceRender:I}=g.useContext(Nk);return S.jsx(S.Fragment,{children:C.map(R=>{const N=dg(R),L=o&&!f?!1:m===C||v.includes(N),z=()=>{if(x.current.has(N))return;if(w.has(N))x.current.add(N),w.set(N,!0);else return;let $=!0;w.forEach(G=>{G||($=!1)}),$&&(I==null||I(),T(y.current),o&&(h==null||h()),r&&r())};return S.jsx(fie,{isPresent:L,initial:!_.current||n?void 0:!1,custom:e,presenceAffectsLayout:s,mode:i,root:d,onExitComplete:L?void 0:z,anchorX:l,anchorY:c,children:R},N)})})},M9=g.createContext({strict:!1}),bR={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 xR=!1;function pie(){if(xR)return;const t={};for(const e in bR)t[e]={isEnabled:n=>bR[e].some(r=>!!n[r])};c9(t),xR=!0}function N9(){return pie(),Qre()}function mie(t){const e=N9();for(const n in t)e[n]={...e[n],...t[n]};c9(e)}const gie=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 r1(t){return t.startsWith("while")||t.startsWith("drag")&&t!=="draggable"||t.startsWith("layout")||t.startsWith("onTap")||t.startsWith("onPan")||t.startsWith("onLayout")||gie.has(t)}let L9=t=>!r1(t);function vie(t){typeof t=="function"&&(L9=e=>e.startsWith("on")?!r1(e):t(e))}try{vie(require("@emotion/is-prop-valid").default)}catch{}function yie(t,e,n){const r={};for(const s in t)s==="values"&&typeof t.values=="object"||ts(t[s])||(L9(s)||n===!0&&r1(s)||!e&&!r1(s)||t.draggable&&s.startsWith("onDrag"))&&(r[s]=t[s]);return r}const H1=g.createContext({});function _ie(t,e){if(V1(t)){const{initial:n,animate:r}=t;return{initial:n===!1||tm(n)?n:void 0,animate:tm(r)?r:void 0}}return t.inherit!==!1?e:{}}function wie(t){const{initial:e,animate:n}=_ie(t,g.useContext(H1));return g.useMemo(()=>({initial:e,animate:n}),[SR(e),SR(n)])}function SR(t){return Array.isArray(t)?t.join(" "):t}const lE=()=>({style:{},transform:{},transformOrigin:{},vars:{}});function D9(t,e,n){for(const r in e)!ts(e[r])&&!g9(r,n)&&(t[r]=e[r])}function bie({transformTemplate:t},e){return g.useMemo(()=>{const n=lE();return iE(n,e,t),Object.assign({},n.vars,n.style)},[e])}function xie(t,e){const n=t.style||{},r={};return D9(r,n,t),Object.assign(r,bie(t,e)),r}function Sie(t,e){const n={},r=xie(t,e);return t.drag&&t.dragListener!==!1&&(n.draggable=!1,r.userSelect=r.WebkitUserSelect=r.WebkitTouchCallout="none",r.touchAction=t.drag===!0?"none":`pan-${t.drag==="x"?"y":"x"}`),t.tabIndex===void 0&&(t.onTap||t.onTapStart||t.whileTap)&&(n.tabIndex=0),n.style=r,n}const $9=()=>({...lE(),attrs:{}});function kie(t,e,n,r){const s=g.useMemo(()=>{const i=$9();return v9(i,e,_9(r),t.transformTemplate,t.style),{...i.attrs,style:{...i.style}}},[e]);if(t.style){const i={};D9(i,t.style,t),s.style={...i,...s.style}}return s}const Eie=["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 cE(t){return typeof t!="string"||t.includes("-")?!1:!!(Eie.indexOf(t)>-1||/[A-Z]/u.test(t))}function Cie(t,e,n,{latestValues:r},s,i=!1,o){const c=(o??cE(t)?kie:Sie)(e,r,s,t),d=yie(e,typeof t=="string",i),f=t!==g.Fragment?{...d,...c,ref:n}:{},{children:h}=e,m=g.useMemo(()=>ts(h)?h.get():h,[h]);return g.createElement(t,{...f,children:m})}function Pie({scrapeMotionValuesFromProps:t,createRenderState:e},n,r,s){return{latestValues:Aie(n,r,s,t),renderState:e()}}function Aie(t,e,n,r){const s={},i=r(t,{});for(const m in i)s[m]=Kg(i[m]);let{initial:o,animate:l}=t;const c=V1(t),d=a9(t);e&&d&&!c&&t.inherit!==!1&&(o===void 0&&(o=e.initial),l===void 0&&(l=e.animate));let f=n?n.initial===!1:!1;f=f||o===!1;const h=f?l:o;if(h&&typeof h!="boolean"&&!z1(h)){const m=Array.isArray(h)?h:[h];for(let v=0;v<m.length;v++){const _=Yk(t,m[v]);if(_){const{transitionEnd:y,transition:w,...x}=_;for(const k in x){let P=x[k];if(Array.isArray(P)){const C=f?P.length-1:0;P=P[C]}P!==null&&(s[k]=P)}for(const k in y)s[k]=y[k]}}}return s}const j9=t=>(e,n)=>{const r=g.useContext(H1),s=g.useContext($1),i=()=>Pie(t,e,r,s);return n?i():Lk(i)},Tie=j9({scrapeMotionValuesFromProps:oE,createRenderState:lE}),Rie=j9({scrapeMotionValuesFromProps:w9,createRenderState:$9}),Iie=Symbol.for("motionComponentSymbol");function Oie(t,e,n){const r=g.useRef(n);g.useInsertionEffect(()=>{r.current=n});const s=g.useRef(null);return g.useCallback(i=>{var l;i&&((l=t.onMount)==null||l.call(t,i)),e&&(i?e.mount(i):e.unmount());const o=r.current;if(typeof o=="function")if(i){const c=o(i);typeof c=="function"&&(s.current=c)}else s.current?(s.current(),s.current=null):o(i);else o&&(o.current=i)},[e])}const F9=g.createContext({});function Ld(t){return t&&typeof t=="object"&&Object.prototype.hasOwnProperty.call(t,"current")}function Mie(t,e,n,r,s,i){var P,C;const{visualElement:o}=g.useContext(H1),l=g.useContext(M9),c=g.useContext($1),d=g.useContext(aE),f=d.reducedMotion,h=d.skipAnimations,m=g.useRef(null),v=g.useRef(!1);r=r||l.renderer,!m.current&&r&&(m.current=r(t,{visualState:e,parent:o,props:n,presenceContext:c,blockInitialAnimation:c?c.initial===!1:!1,reducedMotionConfig:f,skipAnimations:h,isSVG:i}),v.current&&m.current&&(m.current.manuallyAnimateOnMount=!0));const _=m.current,y=g.useContext(F9);_&&!_.projection&&s&&(_.type==="html"||_.type==="svg")&&Nie(m.current,n,s,y);const w=g.useRef(!1);g.useInsertionEffect(()=>{_&&w.current&&_.update(n,c)});const x=n[KL],k=g.useRef(!!x&&typeof window<"u"&&!((P=window.MotionHandoffIsComplete)!=null&&P.call(window,x))&&((C=window.MotionHasOptimisedAnimation)==null?void 0:C.call(window,x)));return Dk(()=>{v.current=!0,_&&(w.current=!0,window.MotionIsMounted=!0,_.updateFeatures(),_.scheduleRenderMicrotask(),k.current&&_.animationState&&_.animationState.animateChanges())}),g.useEffect(()=>{_&&(!k.current&&_.animationState&&_.animationState.animateChanges(),k.current&&(queueMicrotask(()=>{var T;(T=window.MotionHandoffMarkAsComplete)==null||T.call(window,x)}),k.current=!1),_.enteringChildren=void 0)}),_}function Nie(t,e,n,r){const{layoutId:s,layout:i,drag:o,dragConstraints:l,layoutScroll:c,layoutRoot:d,layoutAnchor:f,layoutCrossfade:h}=e;t.projection=new n(t.latestValues,e["data-framer-portal-id"]?void 0:z9(t.parent)),t.projection.setOptions({layoutId:s,layout:i,alwaysMeasureLayout:!!o||l&&Ld(l),visualElement:t,animationType:typeof i=="string"?i:"both",initialPromotionConfig:r,crossfade:h,layoutScroll:c,layoutRoot:d,layoutAnchor:f})}function z9(t){if(t)return t.options.allowProjection!==!1?t.projection:z9(t.parent)}function cw(t,{forwardMotionProps:e=!1,type:n}={},r,s){r&&mie(r);const i=n?n==="svg":cE(t),o=i?Rie:Tie;function l(d,f){let h;const m={...g.useContext(aE),...d,layoutId:Lie(d)},{isStatic:v}=m,_=wie(d),y=o(d,v);if(!v&&typeof window<"u"){Die();const w=$ie(m);h=w.MeasureLayout,_.visualElement=Mie(t,y,m,s,w.ProjectionNode,i)}return S.jsxs(H1.Provider,{value:_,children:[h&&_.visualElement?S.jsx(h,{visualElement:_.visualElement,...m}):null,Cie(t,d,Oie(y,_.visualElement,f),y,v,e,i)]})}l.displayName=`motion.${typeof t=="string"?t:`create(${t.displayName??t.name??""})`}`;const c=g.forwardRef(l);return c[Iie]=t,c}function Lie({layoutId:t}){const e=g.useContext(Nk).id;return e&&t!==void 0?e+"-"+t:t}function Die(t,e){g.useContext(M9).strict}function $ie(t){const e=N9(),{drag:n,layout:r}=e;if(!n&&!r)return{};const s={...n,...r};return{MeasureLayout:n!=null&&n.isEnabled(t)||r!=null&&r.isEnabled(t)?s.MeasureLayout:void 0,ProjectionNode:s.ProjectionNode}}function jie(t,e){if(typeof Proxy>"u")return cw;const n=new Map,r=(i,o)=>cw(i,o,t,e),s=(i,o)=>r(i,o);return new Proxy(s,{get:(i,o)=>o==="create"?r:(n.has(o)||n.set(o,cw(o,void 0,t,e)),n.get(o))})}const Fie=(t,e)=>e.isSVG??cE(t)?new mse(e):new cse(e,{allowProjection:t!==g.Fragment});class zie extends xc{constructor(e){super(e),e.animationState||(e.animationState=wse(e))}updateAnimationControlsSubscription(){const{animate:e}=this.node.getProps();z1(e)&&(this.unmountControls=e.subscribe(this.node))}mount(){this.updateAnimationControlsSubscription()}update(){const{animate:e}=this.node.getProps(),{animate:n}=this.node.prevProps||{};e!==n&&this.updateAnimationControlsSubscription()}unmount(){var e;this.node.animationState.reset(),(e=this.unmountControls)==null||e.call(this)}}let Vie=0;class Hie extends xc{constructor(){super(...arguments),this.id=Vie++,this.isExitComplete=!1}update(){var i;if(!this.node.presenceContext)return;const{isPresent:e,onExitComplete:n}=this.node.presenceContext,{isPresent:r}=this.node.prevPresenceContext||{};if(!this.node.animationState||e===r)return;if(e&&r===!1){if(this.isExitComplete){const{initial:o,custom:l}=this.node.getProps();if(typeof o=="string"||typeof o=="object"&&o!==null&&!Array.isArray(o)){const c=Cu(this.node,o,l);if(c){const{transition:d,transitionEnd:f,...h}=c;for(const m in h)(i=this.node.getValue(m))==null||i.jump(h[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",!e);n&&!e&&s.then(()=>{this.isExitComplete=!0,n(this.id)})}mount(){const{register:e,onExitComplete:n}=this.node.presenceContext||{};n&&n(this.id),e&&(this.unmount=e(this.id))}unmount(){}}const Uie={animation:{Feature:zie},exit:{Feature:Hie}};function Nm(t){return{point:{x:t.pageX,y:t.pageY}}}const Bie=t=>e=>eE(e)&&t(e,Nm(e));function Rp(t,e,n,r){return nm(t,e,Bie(n),r)}const V9=({current:t})=>t?t.ownerDocument.defaultView:null,kR=(t,e)=>Math.abs(t-e);function Zie(t,e){const n=kR(t.x,e.x),r=kR(t.y,e.y);return Math.sqrt(n**2+r**2)}const ER=new Set(["auto","scroll"]);class H9{constructor(e,n,{transformPagePoint:r,contextWindow:s=window,dragSnapToOrigin:i=!1,distanceThreshold:o=3,element:l}={}){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=fg(this.lastRawMoveEventInfo,this.transformPagePoint));const _=uw(this.lastMoveEventInfo,this.history),y=this.startEvent!==null,w=Zie(_.offset,{x:0,y:0})>=this.distanceThreshold;if(!y&&!w)return;const{point:x}=_,{timestamp:k}=Qr;this.history.push({...x,timestamp:k});const{onStart:P,onMove:C}=this.handlers;y||(P&&P(this.lastMoveEvent,_),this.startEvent=this.lastMoveEvent),C&&C(this.lastMoveEvent,_)},this.handlePointerMove=(_,y)=>{this.lastMoveEvent=_,this.lastRawMoveEventInfo=y,this.lastMoveEventInfo=fg(y,this.transformPagePoint),Sn.update(this.updatePoint,!0)},this.handlePointerUp=(_,y)=>{this.end();const{onEnd:w,onSessionEnd:x,resumeAnimation:k}=this.handlers;if((this.dragSnapToOrigin||!this.startEvent)&&k&&k(),!(this.lastMoveEvent&&this.lastMoveEventInfo))return;const P=uw(_.type==="pointercancel"?this.lastMoveEventInfo:fg(y,this.transformPagePoint),this.history);this.startEvent&&w&&w(_,P),x&&x(_,P)},!eE(e))return;this.dragSnapToOrigin=i,this.handlers=n,this.transformPagePoint=r,this.distanceThreshold=o,this.contextWindow=s||window;const c=Nm(e),d=fg(c,this.transformPagePoint),{point:f}=d,{timestamp:h}=Qr;this.history=[{...f,timestamp:h}];const{onSessionStart:m}=n;m&&m(e,uw(d,this.history));const v={passive:!0,capture:!0};this.removeListeners=Im(Rp(this.contextWindow,"pointermove",this.handlePointerMove,v),Rp(this.contextWindow,"pointerup",this.handlePointerUp,v),Rp(this.contextWindow,"pointercancel",this.handlePointerUp,v)),l&&this.startScrollTracking(l)}startScrollTracking(e){let n=e.parentElement;for(;n;){const r=getComputedStyle(n);(ER.has(r.overflowX)||ER.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(e){const n=this.scrollPositions.get(e);if(!n)return;const r=e===window,s=r?{x:window.scrollX,y:window.scrollY}:{x:e.scrollLeft,y:e.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(e,s),Sn.update(this.updatePoint,!0))}updateHandlers(e){this.handlers=e}end(){this.removeListeners&&this.removeListeners(),this.removeScrollListeners&&this.removeScrollListeners(),this.scrollPositions.clear(),hc(this.updatePoint)}}function fg(t,e){return e?{point:e(t.point)}:t}function CR(t,e){return{x:t.x-e.x,y:t.y-e.y}}function uw({point:t},e){return{point:t,delta:CR(t,U9(e)),offset:CR(t,Wie(e)),velocity:qie(e,.1)}}function Wie(t){return t[0]}function U9(t){return t[t.length-1]}function qie(t,e){if(t.length<2)return{x:0,y:0};let n=t.length-1,r=null;const s=U9(t);for(;n>=0&&(r=t[n],!(s.timestamp-r.timestamp>xi(e)));)n--;if(!r)return{x:0,y:0};r===t[0]&&t.length>2&&s.timestamp-r.timestamp>xi(e)*2&&(r=t[1]);const i=Yi(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 Gie(t,{min:e,max:n},r){return e!==void 0&&t<e?t=r?xn(e,t,r.min):Math.max(t,e):n!==void 0&&t>n&&(t=r?xn(n,t,r.max):Math.min(t,n)),t}function PR(t,e,n){return{min:e!==void 0?t.min+e:void 0,max:n!==void 0?t.max+n-(t.max-t.min):void 0}}function Kie(t,{top:e,left:n,bottom:r,right:s}){return{x:PR(t.x,n,s),y:PR(t.y,e,r)}}function AR(t,e){let n=e.min-t.min,r=e.max-t.max;return e.max-e.min<t.max-t.min&&([n,r]=[r,n]),{min:n,max:r}}function Yie(t,e){return{x:AR(t.x,e.x),y:AR(t.y,e.y)}}function Xie(t,e){let n=.5;const r=Ds(t),s=Ds(e);return s>r?n=Jp(e.min,e.max-r,t.min):r>s&&(n=Jp(t.min,t.max-s,e.min)),la(0,1,n)}function Qie(t,e){const n={};return e.min!==void 0&&(n.min=e.min-t.min),e.max!==void 0&&(n.max=e.max-t.min),n}const Fx=.35;function Jie(t=Fx){return t===!1?t=0:t===!0&&(t=Fx),{x:TR(t,"left","right"),y:TR(t,"top","bottom")}}function TR(t,e,n){return{min:RR(t,e),max:RR(t,n)}}function RR(t,e){return typeof t=="number"?t:t[e]||0}const eoe=new WeakMap;class toe{constructor(e){this.openDragLock=null,this.isDragging=!1,this.currentDirection=null,this.originPoint={x:0,y:0},this.constraints=!1,this.hasMutatedConstraints=!1,this.elastic=Ar(),this.latestPointerEvent=null,this.latestPanInfo=null,this.visualElement=e}start(e,{snapToCursor:n=!1,distanceThreshold:r}={}){const{presenceContext:s}=this.visualElement;if(s&&s.isPresent===!1)return;const i=h=>{n&&this.snapToCursor(Nm(h).point),this.stopAnimation()},o=(h,m)=>{const{drag:v,dragPropagation:_,onDragStart:y}=this.getProps();if(v&&!_&&(this.openDragLock&&this.openDragLock(),this.openDragLock=Tre(v),!this.openDragLock))return;this.latestPointerEvent=h,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),Uo(x=>{let k=this.getAxisMotionValue(x).get()||0;if(ra.test(k)){const{projection:P}=this.visualElement;if(P&&P.layout){const C=P.layout.layoutBox[x];C&&(k=Ds(C)*(parseFloat(k)/100))}}this.originPoint[x]=k}),y&&Sn.update(()=>y(h,m),!1,!0),Rx(this.visualElement,"transform");const{animationState:w}=this.visualElement;w&&w.setActive("whileDrag",!0)},l=(h,m)=>{this.latestPointerEvent=h,this.latestPanInfo=m;const{dragPropagation:v,dragDirectionLock:_,onDirectionLock:y,onDrag:w}=this.getProps();if(!v&&!this.openDragLock)return;const{offset:x}=m;if(_&&this.currentDirection===null){this.currentDirection=roe(x),this.currentDirection!==null&&y&&y(this.currentDirection);return}this.updateAxis("x",m.point,x),this.updateAxis("y",m.point,x),this.visualElement.render(),w&&Sn.update(()=>w(h,m),!1,!0)},c=(h,m)=>{this.latestPointerEvent=h,this.latestPanInfo=m,this.stop(h,m),this.latestPointerEvent=null,this.latestPanInfo=null},d=()=>{const{dragSnapToOrigin:h}=this.getProps();(h||this.constraints)&&this.startAnimation({x:0,y:0})},{dragSnapToOrigin:f}=this.getProps();this.panSession=new H9(e,{onSessionStart:i,onStart:o,onMove:l,onSessionEnd:c,resumeAnimation:d},{transformPagePoint:this.visualElement.getTransformPagePoint(),dragSnapToOrigin:f,distanceThreshold:r,contextWindow:V9(this.visualElement),element:this.visualElement.current})}stop(e,n){const r=e||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:l}=this.getProps();l&&Sn.postRender(()=>l(r,s))}cancel(){this.isDragging=!1;const{projection:e,animationState:n}=this.visualElement;e&&(e.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(e,n,r){const{drag:s}=this.getProps();if(!r||!hg(e,s,this.currentDirection))return;const i=this.getAxisMotionValue(e);let o=this.originPoint[e]+r[e];this.constraints&&this.constraints[e]&&(o=Gie(o,this.constraints[e],this.elastic[e])),i.set(o)}resolveConstraints(){var i;const{dragConstraints:e,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;e&&Ld(e)?this.constraints||(this.constraints=this.resolveRefConstraints()):e&&r?this.constraints=Kie(r.layoutBox,e):this.constraints=!1,this.elastic=Jie(n),s!==this.constraints&&!Ld(e)&&r&&this.constraints&&!this.hasMutatedConstraints&&Uo(o=>{this.constraints!==!1&&this.getAxisMotionValue(o)&&(this.constraints[o]=Qie(r.layoutBox[o],this.constraints[o]))})}resolveRefConstraints(){const{dragConstraints:e,onMeasureDragConstraints:n}=this.getProps();if(!e||!Ld(e))return!1;const r=e.current,{projection:s}=this.visualElement;if(!s||!s.layout)return!1;s.root&&(s.root.scroll=void 0,s.root.updateScroll());const i=rse(r,s.root,this.visualElement.getTransformPagePoint());let o=Yie(s.layout.layoutBox,i);if(n){const l=n(ese(o));this.hasMutatedConstraints=!!l,l&&(o=d9(l))}return o}startAnimation(e){const{drag:n,dragMomentum:r,dragElastic:s,dragTransition:i,dragSnapToOrigin:o,onDragTransitionEnd:l}=this.getProps(),c=this.constraints||{},d=Uo(f=>{if(!hg(f,n,this.currentDirection))return;let h=c&&c[f]||{};(o===!0||o===f)&&(h={min:0,max:0});const m=s?200:1e6,v=s?40:1e7,_={type:"inertia",velocity:r?e[f]:0,bounceStiffness:m,bounceDamping:v,timeConstant:750,restDelta:1,restSpeed:10,...i,...h};return this.startAxisValueAnimation(f,_)});return Promise.all(d).then(l)}startAxisValueAnimation(e,n){const r=this.getAxisMotionValue(e);return Rx(this.visualElement,e),r.start(Kk(e,r,0,n,this.visualElement,!1))}stopAnimation(){Uo(e=>this.getAxisMotionValue(e).stop())}getAxisMotionValue(e){const n=`_drag${e.toUpperCase()}`,s=this.visualElement.getProps()[n];return s||this.visualElement.getValue(e,this.visualElement.latestValues[e]??0)}snapToCursor(e){Uo(n=>{const{drag:r}=this.getProps();if(!hg(n,r,this.currentDirection))return;const{projection:s}=this.visualElement,i=this.getAxisMotionValue(n);if(s&&s.layout){const{min:o,max:l}=s.layout.layoutBox[n],c=i.get()||0;i.set(e[n]-xn(o,l,.5)+c)}})}scalePositionWithinConstraints(){if(!this.visualElement.current)return;const{drag:e,dragConstraints:n}=this.getProps(),{projection:r}=this.visualElement;if(!Ld(n)||!r||!this.constraints)return;this.stopAnimation();const s={x:0,y:0};Uo(o=>{const l=this.getAxisMotionValue(o);if(l&&this.constraints!==!1){const c=l.get();s[o]=Xie({min:c,max:c},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(),Uo(o=>{if(!hg(o,e,null))return;const l=this.getAxisMotionValue(o),{min:c,max:d}=this.constraints[o];l.set(xn(c,d,s[o]))}),this.visualElement.render()}addListeners(){if(!this.visualElement.current)return;eoe.set(this.visualElement,this);const e=this.visualElement.current,n=Rp(e,"pointerdown",d=>{const{drag:f,dragListener:h=!0}=this.getProps(),m=d.target,v=m!==e&&Lre(m);f&&h&&!v&&this.start(d)});let r;const s=()=>{const{dragConstraints:d}=this.getProps();Ld(d)&&d.current&&(this.constraints=this.resolveRefConstraints(),r||(r=noe(e,d.current,()=>this.scalePositionWithinConstraints())))},{projection:i}=this.visualElement,o=i.addEventListener("measure",s);i&&!i.layout&&(i.root&&i.root.updateScroll(),i.updateLayout()),Sn.read(s);const l=nm(window,"resize",()=>this.scalePositionWithinConstraints()),c=i.addEventListener("didUpdate",(({delta:d,hasLayoutChanged:f})=>{this.isDragging&&f&&(Uo(h=>{const m=this.getAxisMotionValue(h);m&&(this.originPoint[h]+=d[h].translate,m.set(m.get()+d[h].translate))}),this.visualElement.render())}));return()=>{l(),n(),o(),c&&c(),r&&r()}}getProps(){const e=this.visualElement.getProps(),{drag:n=!1,dragDirectionLock:r=!1,dragPropagation:s=!1,dragConstraints:i=!1,dragElastic:o=Fx,dragMomentum:l=!0}=e;return{...e,drag:n,dragDirectionLock:r,dragPropagation:s,dragConstraints:i,dragElastic:o,dragMomentum:l}}}function IR(t){let e=!0;return()=>{if(e){e=!1;return}t()}}function noe(t,e,n){const r=jT(t,IR(n)),s=jT(e,IR(n));return()=>{r(),s()}}function hg(t,e,n){return(e===!0||e===t)&&(n===null||n===t)}function roe(t,e=10){let n=null;return Math.abs(t.y)>e?n="y":Math.abs(t.x)>e&&(n="x"),n}class soe extends xc{constructor(e){super(e),this.removeGroupControls=to,this.removeListeners=to,this.controls=new toe(e)}mount(){const{dragControls:e}=this.node.getProps();e&&(this.removeGroupControls=e.subscribe(this.controls)),this.removeListeners=this.controls.addListeners()||to}update(){const{dragControls:e}=this.node.getProps(),{dragControls:n}=this.node.prevProps||{};e!==n&&(this.removeGroupControls(),e&&(this.removeGroupControls=e.subscribe(this.controls)))}unmount(){this.removeGroupControls(),this.removeListeners(),this.controls.isDragging||this.controls.endPanSession()}}const dw=t=>(e,n)=>{t&&Sn.update(()=>t(e,n),!1,!0)};class ioe extends xc{constructor(){super(...arguments),this.removePointerDownListener=to}onPointerDown(e){this.session=new H9(e,this.createPanHandlers(),{transformPagePoint:this.node.getTransformPagePoint(),contextWindow:V9(this.node)})}createPanHandlers(){const{onPanSessionStart:e,onPanStart:n,onPan:r,onPanEnd:s}=this.node.getProps();return{onSessionStart:dw(e),onStart:dw(n),onMove:dw(r),onEnd:(i,o)=>{delete this.session,s&&Sn.postRender(()=>s(i,o))}}}mount(){this.removePointerDownListener=Rp(this.node.current,"pointerdown",e=>this.onPointerDown(e))}update(){this.session&&this.session.updateHandlers(this.createPanHandlers())}unmount(){this.removePointerDownListener(),this.session&&this.session.end()}}let fw=!1;class ooe extends g.Component{componentDidMount(){const{visualElement:e,layoutGroup:n,switchLayoutGroup:r,layoutId:s}=this.props,{projection:i}=e;i&&(n.group&&n.group.add(i),r&&r.register&&s&&r.register(i),fw&&i.root.didUpdate(),i.addEventListener("animationComplete",()=>{this.safeToRemove()}),i.setOptions({...i.options,layoutDependency:this.props.layoutDependency,onExitComplete:()=>this.safeToRemove()})),Yg.hasEverUpdated=!0}getSnapshotBeforeUpdate(e){const{layoutDependency:n,visualElement:r,drag:s,isPresent:i}=this.props,{projection:o}=r;return o&&(o.isPresent=i,e.layoutDependency!==n&&o.setOptions({...o.options,layoutDependency:n}),fw=!0,s||e.layoutDependency!==n||n===void 0||e.isPresent!==i?o.willUpdate():this.safeToRemove(),e.isPresent!==i&&(i?o.promote():o.relegate()||Sn.postRender(()=>{const l=o.getStack();(!l||!l.members.length)&&this.safeToRemove()}))),null}componentDidUpdate(){const{visualElement:e,layoutAnchor:n}=this.props,{projection:r}=e;r&&(r.options.layoutAnchor=n,r.root.didUpdate(),Jk.postRender(()=>{!r.currentAnimation&&r.isLead()&&this.safeToRemove()}))}componentWillUnmount(){const{visualElement:e,layoutGroup:n,switchLayoutGroup:r}=this.props,{projection:s}=e;fw=!0,s&&(s.scheduleCheckAfterUnmount(),n&&n.group&&n.group.remove(s),r&&r.deregister&&r.deregister(s))}safeToRemove(){const{safeToRemove:e}=this.props;e&&e()}render(){return null}}function B9(t){const[e,n]=O9(),r=g.useContext(Nk);return S.jsx(ooe,{...t,layoutGroup:r,switchLayoutGroup:g.useContext(F9),isPresent:e,safeToRemove:n})}const aoe={pan:{Feature:ioe},drag:{Feature:soe,ProjectionNode:I9,MeasureLayout:B9}};function OR(t,e,n){const{props:r}=t;t.animationState&&r.whileHover&&t.animationState.setActive("whileHover",n==="Start");const s="onHover"+n,i=r[s];i&&Sn.postRender(()=>i(e,Nm(e)))}class loe extends xc{mount(){const{current:e}=this.node;e&&(this.unmount=Ire(e,(n,r)=>(OR(this.node,r,"Start"),s=>OR(this.node,s,"End"))))}unmount(){}}class coe extends xc{constructor(){super(...arguments),this.isActive=!1}onFocus(){let e=!1;try{e=this.node.current.matches(":focus-visible")}catch{e=!0}!e||!this.node.animationState||(this.node.animationState.setActive("whileFocus",!0),this.isActive=!0)}onBlur(){!this.isActive||!this.node.animationState||(this.node.animationState.setActive("whileFocus",!1),this.isActive=!1)}mount(){this.unmount=Im(nm(this.node.current,"focus",()=>this.onFocus()),nm(this.node.current,"blur",()=>this.onBlur()))}unmount(){}}function MR(t,e,n){const{props:r}=t;if(t.current instanceof HTMLButtonElement&&t.current.disabled)return;t.animationState&&r.whileTap&&t.animationState.setActive("whileTap",n==="Start");const s="onTap"+(n==="End"?"":n),i=r[s];i&&Sn.postRender(()=>i(e,Nm(e)))}class uoe extends xc{mount(){const{current:e}=this.node;if(!e)return;const{globalTapTarget:n,propagate:r}=this.node.props;this.unmount=$re(e,(s,i)=>(MR(this.node,i,"Start"),(o,{success:l})=>MR(this.node,o,l?"End":"Cancel")),{useGlobalTarget:n,stopPropagation:(r==null?void 0:r.tap)===!1})}unmount(){}}const zx=new WeakMap,hw=new WeakMap,doe=t=>{const e=zx.get(t.target);e&&e(t)},foe=t=>{t.forEach(doe)};function hoe({root:t,...e}){const n=t||document;hw.has(n)||hw.set(n,{});const r=hw.get(n),s=JSON.stringify(e);return r[s]||(r[s]=new IntersectionObserver(foe,{root:t,...e})),r[s]}function poe(t,e,n){const r=hoe(e);return zx.set(t,n),r.observe(t),()=>{zx.delete(t),r.unobserve(t)}}const moe={some:0,all:1};class goe extends xc{constructor(){super(...arguments),this.hasEnteredView=!1,this.isInView=!1}startObserver(){var c;(c=this.stopObserver)==null||c.call(this);const{viewport:e={}}=this.node.getProps(),{root:n,margin:r,amount:s="some",once:i}=e,o={root:n?n.current:void 0,rootMargin:r,threshold:typeof s=="number"?s:moe[s]},l=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:h,onViewportLeave:m}=this.node.getProps(),v=f?h:m;v&&v(d)};this.stopObserver=poe(this.node.current,o,l)}mount(){this.startObserver()}update(){if(typeof IntersectionObserver>"u")return;const{props:e,prevProps:n}=this.node;["amount","margin","root"].some(voe(e,n))&&this.startObserver()}unmount(){var e;(e=this.stopObserver)==null||e.call(this),this.hasEnteredView=!1,this.isInView=!1}}function voe({viewport:t={}},{viewport:e={}}={}){return n=>t[n]!==e[n]}const yoe={inView:{Feature:goe},tap:{Feature:uoe},focus:{Feature:coe},hover:{Feature:loe}},_oe={layout:{ProjectionNode:I9,MeasureLayout:B9}},woe={...Uie,...yoe,...aoe,..._oe},qa=jie(woe,Fie);function boe(){!sE.current&&l9();const[t]=g.useState(Jv.current);return t}const Co=qa;var Lm=tL();const xoe=E1(Lm);function Soe(t){if(typeof document>"u")return;let e=document.head||document.getElementsByTagName("head")[0],n=document.createElement("style");n.type="text/css",e.appendChild(n),n.styleSheet?n.styleSheet.cssText=t:n.appendChild(document.createTextNode(t))}const koe=t=>{switch(t){case"success":return Poe;case"info":return Toe;case"warning":return Aoe;case"error":return Roe;default:return null}},Eoe=Array(12).fill(0),Coe=({visible:t,className:e})=>Ae.createElement("div",{className:["sonner-loading-wrapper",e].filter(Boolean).join(" "),"data-visible":t},Ae.createElement("div",{className:"sonner-spinner"},Eoe.map((n,r)=>Ae.createElement("div",{className:"sonner-loading-bar",key:`spinner-bar-${r}`})))),Poe=Ae.createElement("svg",{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 20 20",fill:"currentColor",height:"20",width:"20","aria-hidden":"true"},Ae.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"})),Aoe=Ae.createElement("svg",{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24",fill:"currentColor",height:"20",width:"20","aria-hidden":"true"},Ae.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"})),Toe=Ae.createElement("svg",{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 20 20",fill:"currentColor",height:"20",width:"20","aria-hidden":"true"},Ae.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=Ae.createElement("svg",{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 20 20",fill:"currentColor",height:"20",width:"20","aria-hidden":"true"},Ae.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"})),Ioe=Ae.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"},Ae.createElement("line",{x1:"18",y1:"6",x2:"6",y2:"18"}),Ae.createElement("line",{x1:"6",y1:"6",x2:"18",y2:"18"})),Ooe=()=>{const[t,e]=Ae.useState(document.hidden);return Ae.useEffect(()=>{const n=()=>{e(document.hidden)};return document.addEventListener("visibilitychange",n),()=>document.removeEventListener("visibilitychange",n)},[]),t};let Moe=1;const Noe=100,NR=t=>{var e;return typeof(t==null?void 0:t.id)=="number"||(t==null||(e=t.id)==null?void 0:e.length)>0?t.id:Moe++};class Loe{constructor(){this.subscribe=e=>(this.subscribers.push(e),this.getActiveToasts().forEach(n=>e(n)),()=>{const n=this.subscribers.indexOf(e);this.subscribers.splice(n,1)}),this.publish=e=>{this.subscribers.forEach(n=>n(e))},this.addToast=e=>{this.publish(e),this.toasts=[...this.toasts,e],this.trimHistory()},this.trimHistory=()=>{let e=this.toasts.length-Noe;e<=0||(this.toasts=this.toasts.filter(n=>e>0&&this.dismissedToasts.has(n.id)?(this.dismissedToasts.delete(n.id),e--,!1):!0))},this.create=e=>{const{message:n,...r}=e,s=NR(e),i=this.pendingDismissals.get(s);i!==void 0&&(cancelAnimationFrame(i),this.pendingDismissals.delete(s),this.dismissedToasts.delete(s));const o=this.dismissedToasts.has(s),l=e.dismissible===void 0?!0:e.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,...e,id:s,title:n}),{...d,...e,id:s,dismissible:l,title:n}):d):this.addToast({title:n,...r,dismissible:l,id:s}),s},this.dismiss=e=>{if(e==null)return this.getActiveToasts().forEach(r=>{this.dismissedToasts.add(r.id),this.subscribers.forEach(s=>s({id:r.id,dismiss:!0}))}),e;this.dismissedToasts.add(e);const n=this.pendingDismissals.get(e);return n!==void 0&&cancelAnimationFrame(n),this.pendingDismissals.set(e,requestAnimationFrame(()=>{this.pendingDismissals.delete(e),this.subscribers.forEach(r=>r({id:e,dismiss:!0}))})),e},this.message=(e,n)=>this.create({...n,message:e,type:void 0}),this.error=(e,n)=>this.create({...n,message:e,type:"error"}),this.success=(e,n)=>this.create({...n,type:"success",message:e}),this.info=(e,n)=>this.create({...n,type:"info",message:e}),this.warning=(e,n)=>this.create({...n,type:"warning",message:e}),this.loading=(e,n)=>this.create({...n,type:"loading",message:e}),this.promise=(e,n)=>{if(!n)return;let r;n.loading!==void 0&&(r=this.create({...n,promise:e,type:"loading",message:n.loading,description:typeof n.description!="function"?n.description:void 0}));const s=Promise.resolve(e instanceof Function?e():e);let i=r!==void 0,o;const l=s.then(async d=>{if(o=["resolve",d],Ae.isValidElement(d))i=!1,this.create({id:r,type:"default",message:d});else if($oe(d)&&!d.ok){i=!1;const h=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 h=="object"&&!Ae.isValidElement(h)?h:{message:h};this.create({id:r,type:"error",description:m,..._})}else if(d instanceof Error){i=!1;const h=typeof n.error=="function"?await n.error(d):n.error,m=typeof n.description=="function"?await n.description(d):n.description,_=typeof h=="object"&&!Ae.isValidElement(h)?h:{message:h};this.create({id:r,type:"error",description:m,..._})}else if(n.success!==void 0){i=!1;const h=typeof n.success=="function"?await n.success(d):n.success,m=typeof n.description=="function"?await n.description(d):n.description,_=typeof h=="object"&&!Ae.isValidElement(h)?h:{message:h};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,h=typeof n.description=="function"?await n.description(d):n.description,v=typeof f=="object"&&!Ae.isValidElement(f)?f:{message:f};this.create({id:r,type:"error",description:h,...v})}}).finally(()=>{i&&(this.dismiss(r),r=void 0),n.finally==null||n.finally.call(n)}),c=()=>new Promise((d,f)=>l.then(()=>o[0]==="reject"?f(o[1]):d(o[1])).catch(f));return typeof r!="string"&&typeof r!="number"?{unwrap:c}:Object.assign(r,{unwrap:c})},this.custom=(e,n)=>{const r=NR(n);return this.create({...n,jsx:e(r),id:r,type:void 0}),r},this.getActiveToasts=()=>this.toasts.filter(e=>!this.dismissedToasts.has(e.id)),this.subscribers=[],this.toasts=[],this.dismissedToasts=new Set,this.pendingDismissals=new Map}}const Bs=new Loe,Doe=(t,e)=>Bs.message(t,e),$oe=t=>t&&typeof t=="object"&&"ok"in t&&typeof t.ok=="boolean"&&"status"in t&&typeof t.status=="number",joe=Doe,Foe=()=>Bs.toasts,zoe=()=>Bs.getActiveToasts(),nn=Object.assign(joe,{success:Bs.success,info:Bs.info,warning:Bs.warning,error:Bs.error,custom:Bs.custom,message:Bs.message,promise:Bs.promise,dismiss:Bs.dismiss,loading:Bs.loading},{getHistory:Foe,getToasts:zoe});Soe("[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 pg(t){return t.label!==void 0}const Voe=3,Hoe="24px",Uoe="16px",LR=4e3,Boe=356,Zoe=14,Woe=45,qoe=200;function jo(...t){return t.filter(Boolean).join(" ")}function Goe(t){const[e,n]=t.split("-"),r=[];return e&&r.push(e),n&&r.push(n),r}const Koe=t=>{var e,n,r,s,i,o,l,c,d;const{invert:f,toast:h,unstyled:m,interacting:v,setHeights:_,visibleToasts:y,heights:w,index:x,toasts:k,expanded:P,removeToast:C,defaultRichColors:T,closeButton:O,style:I,cancelButtonStyle:R,actionButtonStyle:N,className:L="",descriptionClassName:z="",duration:$,position:G,gap:X,expandByDefault:q,classNames:H,icons:ee,closeButtonAriaLabel:V="Close toast"}=t,[Q,U]=Ae.useState(null),[D,K]=Ae.useState(null),[de,ie]=Ae.useState(!1),[ce,he]=Ae.useState(!1),[xe,oe]=Ae.useState(!1),[re,Se]=Ae.useState(!1),[ze,ke]=Ae.useState(!1),[gt,on]=Ae.useState(0),[Tt,$t]=Ae.useState(0),xt=Ae.useRef(h.duration||$||LR),An=Ae.useRef(null),Be=Ae.useRef(null),je=x===0,Ie=x+1<=y,nt=h.type,St=nt??"default",Ce=h.dismissible!==!1,Ot=h.className||"",Qt=h.descriptionClassName||"",Et=Ae.useMemo(()=>w.findIndex(rt=>rt.toastId===h.id)||0,[w,h.id]),Ur=Ae.useMemo(()=>{var rt;return(rt=h.closeButton)!=null?rt:O},[h.closeButton,O]),ai=Ae.useMemo(()=>h.duration||$||LR,[h.duration,$]),ss=Ae.useRef(0),Br=Ae.useRef(0),Ri=Ae.useRef(0),Tn=Ae.useRef(null),[ur,is]=G.split("-"),dr=Ae.useMemo(()=>w.reduce((rt,qt,Gt)=>Gt>=Et?rt:rt+qt.height,0),[w,Et]),Ii=Ooe(),Un=Ae.useMemo(()=>{var rt;return(rt=t.swipeDirections)!=null?rt:Goe(G)},[t.swipeDirections,G]),Oi=h.invert||f,ks=nt==="loading";Br.current=Ae.useMemo(()=>Et*X+dr,[Et,dr]),Ae.useEffect(()=>{xt.current=ai},[ai]),Ae.useEffect(()=>{ie(!0)},[]),Ae.useEffect(()=>{const rt=Be.current;if(rt){const qt=rt.getBoundingClientRect().height;return $t(qt),_(Gt=>[{toastId:h.id,height:qt,position:h.position},...Gt]),()=>_(Gt=>Gt.filter(ln=>ln.toastId!==h.id))}},[_,h.id]),Ae.useLayoutEffect(()=>{if(!de)return;const rt=Be.current,qt=rt.style.height;rt.style.height="auto";const Gt=rt.getBoundingClientRect().height;rt.style.height=qt,$t(Gt),_(ln=>ln.find(kn=>kn.toastId===h.id)?ln.map(kn=>kn.toastId===h.id?{...kn,height:Gt}:kn):[{toastId:h.id,height:Gt,position:h.position},...ln])},[de,h.title,h.description,_,h.id,h.jsx,h.action,h.cancel]);const nr=Ae.useCallback(()=>{he(!0),on(Br.current),_(rt=>rt.filter(qt=>qt.toastId!==h.id)),setTimeout(()=>{C(h)},qoe)},[h,C,_,Br]);Ae.useEffect(()=>{if(h.promise&&nt==="loading"||h.duration===1/0||h.type==="loading")return;let rt;return P||v||Ii?(()=>{if(Ri.current<ss.current){const ln=new Date().getTime()-ss.current;xt.current=xt.current-ln}Ri.current=new Date().getTime()})():(()=>{xt.current!==1/0&&(ss.current=new Date().getTime(),rt=setTimeout(()=>{h.onAutoClose==null||h.onAutoClose.call(h,h),nr()},xt.current))})(),()=>clearTimeout(rt)},[P,v,h,nt,Ii,nr]),Ae.useEffect(()=>{h.delete&&(nr(),h.onDismiss==null||h.onDismiss.call(h,h))},[nr,h.delete]);function xr(){var rt;if(ee!=null&&ee.loading){var qt;return Ae.createElement("div",{className:jo(H==null?void 0:H.loader,h==null||(qt=h.classNames)==null?void 0:qt.loader,"sonner-loader"),"data-visible":nt==="loading"},ee.loading)}return Ae.createElement(Coe,{className:jo(H==null?void 0:H.loader,h==null||(rt=h.classNames)==null?void 0:rt.loader),visible:nt==="loading"})}const Mi=h.icon||(ee==null?void 0:ee[nt])||koe(nt);var Sr,os;return Ae.createElement("li",{tabIndex:0,ref:Be,className:jo(L,Ot,H==null?void 0:H.toast,h==null||(e=h.classNames)==null?void 0:e.toast,H==null?void 0:H[St],h==null||(n=h.classNames)==null?void 0:n[St]),"data-sonner-toast":"","data-rich-colors":(Sr=h.richColors)!=null?Sr:T,"data-styled":!(h.jsx||h.unstyled||m),"data-mounted":de,"data-promise":!!h.promise,"data-swiped":ze,"data-removed":ce,"data-visible":Ie,"data-y-position":ur,"data-x-position":is,"data-index":x,"data-front":je,"data-swiping":xe,"data-dismissible":Ce,"data-type":nt,"data-invert":Oi,"data-swipe-out":re,"data-swipe-direction":D,"data-expanded":!!(P||q&&de),"data-testid":h.testId,style:{"--index":x,"--toasts-before":x,"--z-index":k.length-x,"--offset":`${ce?gt:Br.current}px`,"--initial-height":q?"auto":`${Tt}px`,...I,...h.style},onDragEnd:()=>{oe(!1),U(null),Tn.current=null},onPointerDown:rt=>{rt.button!==2&&(ks||!Ce||(An.current=new Date,on(Br.current),rt.target.setPointerCapture(rt.pointerId),rt.target.tagName!=="BUTTON"&&(oe(!0),Tn.current={x:rt.clientX,y:rt.clientY})))},onPointerUp:()=>{var rt,qt,Gt;if(re||!Ce)return;Tn.current=null;const ln=Number(((rt=Be.current)==null?void 0:rt.style.getPropertyValue("--swipe-amount-x").replace("px",""))||0),Zr=Number(((qt=Be.current)==null?void 0:qt.style.getPropertyValue("--swipe-amount-y").replace("px",""))||0),kn=new Date().getTime()-((Gt=An.current)==null?void 0:Gt.getTime()),cn=Q==="x"?ln:Zr,as=Math.abs(cn)/kn;if((Q==="x"?Un.includes(ln>0?"right":"left"):Un.includes(Zr>0?"bottom":"top"))&&(Math.abs(cn)>=Woe||as>.11)){on(Br.current),h.onDismiss==null||h.onDismiss.call(h,h),K(Q==="x"?ln>0?"right":"left":Zr>0?"down":"up"),nr(),Se(!0);return}else{var kr,Ut;(kr=Be.current)==null||kr.style.setProperty("--swipe-amount-x","0px"),(Ut=Be.current)==null||Ut.style.setProperty("--swipe-amount-y","0px")}ke(!1),oe(!1),U(null)},onPointerMove:rt=>{var qt,Gt,ln;if(!Tn.current||!Ce||((qt=window.getSelection())==null?void 0:qt.toString().length)>0)return;const kn=rt.clientY-Tn.current.y,cn=rt.clientX-Tn.current.x;!Q&&(Math.abs(cn)>1||Math.abs(kn)>1)&&U(Math.abs(cn)>Math.abs(kn)?"x":"y");let as={x:0,y:0};const Wr=kr=>1/(1.5+Math.abs(kr)/20);if(Q==="y"){if(Un.includes("top")||Un.includes("bottom"))if(Un.includes("top")&&kn<0||Un.includes("bottom")&&kn>0)as.y=kn;else{const kr=kn*Wr(kn);as.y=Math.abs(kr)<Math.abs(kn)?kr:kn}}else if(Q==="x"&&(Un.includes("left")||Un.includes("right")))if(Un.includes("left")&&cn<0||Un.includes("right")&&cn>0)as.x=cn;else{const kr=cn*Wr(cn);as.x=Math.abs(kr)<Math.abs(cn)?kr:cn}(Math.abs(as.x)>0||Math.abs(as.y)>0)&&ke(!0),(Gt=Be.current)==null||Gt.style.setProperty("--swipe-amount-x",`${as.x}px`),(ln=Be.current)==null||ln.style.setProperty("--swipe-amount-y",`${as.y}px`)}},Ur&&!h.jsx&&nt!=="loading"?Ae.createElement("button",{"aria-label":V,"data-disabled":ks,"data-close-button":!0,onClick:ks||!Ce?()=>{}:()=>{nr(),h.onDismiss==null||h.onDismiss.call(h,h)},className:jo(H==null?void 0:H.closeButton,h==null||(r=h.classNames)==null?void 0:r.closeButton)},(os=ee==null?void 0:ee.close)!=null?os:Ioe):null,(nt||h.icon||h.promise)&&h.icon!==null&&((ee==null?void 0:ee[nt])!==null||h.icon)?Ae.createElement("div",{"data-icon":"",className:jo(H==null?void 0:H.icon,h==null||(s=h.classNames)==null?void 0:s.icon)},nt==="loading"?h.icon||xr():h.promise?xr():null,nt!=="loading"?Mi:null):null,Ae.createElement("div",{"data-content":"",className:jo(H==null?void 0:H.content,h==null||(i=h.classNames)==null?void 0:i.content)},Ae.createElement("div",{"data-title":"",className:jo(H==null?void 0:H.title,h==null||(o=h.classNames)==null?void 0:o.title)},h.jsx?h.jsx:typeof h.title=="function"?h.title():h.title),h.description?Ae.createElement("div",{"data-description":"",className:jo(z,Qt,H==null?void 0:H.description,h==null||(l=h.classNames)==null?void 0:l.description)},typeof h.description=="function"?h.description():h.description):null),Ae.isValidElement(h.cancel)?h.cancel:h.cancel&&pg(h.cancel)?Ae.createElement("button",{"data-button":!0,"data-cancel":!0,style:h.cancelButtonStyle||R,onClick:rt=>{pg(h.cancel)&&Ce&&(h.cancel.onClick==null||h.cancel.onClick.call(h.cancel,rt),nr())},className:jo(H==null?void 0:H.cancelButton,h==null||(c=h.classNames)==null?void 0:c.cancelButton)},h.cancel.label):null,Ae.isValidElement(h.action)?h.action:h.action&&pg(h.action)?Ae.createElement("button",{"data-button":!0,"data-action":!0,style:h.actionButtonStyle||N,onClick:rt=>{pg(h.action)&&(h.action.onClick==null||h.action.onClick.call(h.action,rt),!rt.defaultPrevented&&nr())},className:jo(H==null?void 0:H.actionButton,h==null||(d=h.classNames)==null?void 0:d.actionButton)},h.action.label):null)};function DR(){if(typeof window>"u"||typeof document>"u")return"ltr";const t=document.documentElement.getAttribute("dir");return t==="auto"||!t?window.getComputedStyle(document.documentElement).direction:t}function Yoe(t,e){const n={};return[t,e].forEach((r,s)=>{const i=s===1,o=i?"--mobile-offset":"--offset",l=i?Uoe:Hoe;function c(d){["top","right","bottom","left"].forEach(f=>{n[`${o}-${f}`]=typeof d=="number"?`${d}px`:d})}typeof r=="number"||typeof r=="string"?c(r):typeof r=="object"?["top","right","bottom","left"].forEach(d=>{r[d]===void 0?n[`${o}-${d}`]=l:n[`${o}-${d}`]=typeof r[d]=="number"?`${r[d]}px`:r[d]}):c(l)}),n}const Xoe=Ae.forwardRef(function(e,n){const{id:r,invert:s,position:i="bottom-right",hotkey:o=["altKey","KeyT"],expand:l,closeButton:c,className:d,offset:f,mobileOffset:h,theme:m="light",richColors:v,duration:_,style:y,visibleToasts:w=Voe,toastOptions:x,dir:k=DR(),gap:P=Zoe,icons:C,customAriaLabel:T,containerAriaLabel:O="Notifications"}=e,[I,R]=Ae.useState([]),N=Ae.useMemo(()=>r?I.filter(ie=>ie.toasterId===r):I.filter(ie=>!ie.toasterId),[I,r]),L=Ae.useMemo(()=>Array.from(new Set([i].concat(N.filter(ie=>ie.position).map(ie=>ie.position)))),[N,i]),[z,$]=Ae.useState([]),[G,X]=Ae.useState(!1),[q,H]=Ae.useState(!1),[ee,V]=Ae.useState(m!=="system"?m:typeof window<"u"&&window.matchMedia&&window.matchMedia("(prefers-color-scheme: dark)").matches?"dark":"light"),Q=Ae.useRef(null),U=o.join("+").replace(/Key/g,"").replace(/Digit/g,""),D=Ae.useRef(null),K=Ae.useRef(!1),de=Ae.useCallback(ie=>{R(ce=>{var he;return(he=ce.find(xe=>xe.id===ie.id))!=null&&he.delete||Bs.dismiss(ie.id),ce.filter(({id:xe})=>xe!==ie.id)})},[]);return Ae.useEffect(()=>Bs.subscribe(ie=>{if(ie.dismiss){requestAnimationFrame(()=>{R(ce=>ce.map(he=>he.id===ie.id?{...he,delete:!0}:he))});return}setTimeout(()=>{xoe.flushSync(()=>{R(ce=>{const he=ce.findIndex(xe=>xe.id===ie.id);return he!==-1?[...ce.slice(0,he),{...ce[he],...ie},...ce.slice(he+1)]:[ie,...ce]})})})}),[]),Ae.useEffect(()=>{if(m!=="system"){V(m);return}if(m==="system"&&(window.matchMedia&&window.matchMedia("(prefers-color-scheme: dark)").matches?V("dark"):V("light")),typeof window>"u")return;const ie=window.matchMedia("(prefers-color-scheme: dark)");try{ie.addEventListener("change",({matches:ce})=>{V(ce?"dark":"light")})}catch{ie.addListener(({matches:he})=>{try{V(he?"dark":"light")}catch(xe){console.error(xe)}})}},[m]),Ae.useEffect(()=>{I.length<=1&&X(!1)},[I]),Ae.useEffect(()=>{const ie=ce=>{var he;if(o.length>0&&o.every(re=>ce[re]||ce.code===re)){var oe;X(!0),(oe=Q.current)==null||oe.focus()}ce.code==="Escape"&&(document.activeElement===Q.current||(he=Q.current)!=null&&he.contains(document.activeElement))&&X(!1)};return document.addEventListener("keydown",ie),()=>document.removeEventListener("keydown",ie)},[o]),Ae.useEffect(()=>{if(Q.current)return()=>{D.current&&(D.current.focus({preventScroll:!0}),D.current=null,K.current=!1)}},[Q.current]),Ae.createElement("section",{ref:n,"aria-label":T??`${O} ${U}`,tabIndex:-1,"aria-live":"polite","aria-relevant":"additions text","aria-atomic":"false",suppressHydrationWarning:!0,"data-react-aria-top-layer":!0},L.map((ie,ce)=>{var he;const[xe,oe]=ie.split("-");return N.length?Ae.createElement("ol",{key:ie,dir:k==="auto"?DR():k,tabIndex:-1,ref:Q,className:d,"data-sonner-toaster":!0,"data-sonner-theme":ee,"data-y-position":xe,"data-x-position":oe,style:{"--front-toast-height":`${((he=z[0])==null?void 0:he.height)||0}px`,"--width":`${Boe}px`,"--gap":`${P}px`,...y,...Yoe(f,h)},onBlur:re=>{K.current&&!re.currentTarget.contains(re.relatedTarget)&&(K.current=!1,D.current&&(D.current.focus({preventScroll:!0}),D.current=null))},onFocus:re=>{re.target instanceof HTMLElement&&re.target.dataset.dismissible==="false"||K.current||(K.current=!0,D.current=re.relatedTarget)},onMouseEnter:()=>X(!0),onMouseMove:()=>X(!0),onMouseLeave:()=>{q||X(!1)},onDragEnd:()=>X(!1),onPointerDown:re=>{re.target instanceof HTMLElement&&re.target.dataset.dismissible==="false"||H(!0)},onPointerUp:()=>H(!1)},N.filter(re=>!re.position&&ce===0||re.position===ie).map((re,Se)=>{var ze,ke;return Ae.createElement(Koe,{key:re.id,icons:C,index:Se,toast:re,defaultRichColors:v,duration:(ze=x==null?void 0:x.duration)!=null?ze:_,className:x==null?void 0:x.className,descriptionClassName:x==null?void 0:x.descriptionClassName,invert:s,visibleToasts:w,closeButton:(ke=x==null?void 0:x.closeButton)!=null?ke:c,interacting:q,position:ie,style:x==null?void 0:x.style,unstyled:x==null?void 0:x.unstyled,classNames:x==null?void 0:x.classNames,cancelButtonStyle:x==null?void 0:x.cancelButtonStyle,actionButtonStyle:x==null?void 0:x.actionButtonStyle,closeButtonAriaLabel:x==null?void 0:x.closeButtonAriaLabel,removeToast:de,toasts:N.filter(gt=>gt.position==re.position),heights:z.filter(gt=>gt.position==re.position),setHeights:$,expandByDefault:l,gap:P,expanded:G,swipeDirections:e.swipeDirections})})):null}))}),Qoe=new Map([["bold",g.createElement(g.Fragment,null,g.createElement("path",{d:"M228,128a12,12,0,0,1-12,12H69l51.52,51.51a12,12,0,0,1-17,17l-72-72a12,12,0,0,1,0-17l72-72a12,12,0,0,1,17,17L69,116H216A12,12,0,0,1,228,128Z"}))],["duotone",g.createElement(g.Fragment,null,g.createElement("path",{d:"M112,56V200L40,128Z",opacity:"0.2"}),g.createElement("path",{d:"M216,120H120V56a8,8,0,0,0-13.66-5.66l-72,72a8,8,0,0,0,0,11.32l72,72A8,8,0,0,0,120,200V136h96a8,8,0,0,0,0-16ZM104,180.69,51.31,128,104,75.31Z"}))],["fill",g.createElement(g.Fragment,null,g.createElement("path",{d:"M224,128a8,8,0,0,1-8,8H120v64a8,8,0,0,1-13.66,5.66l-72-72a8,8,0,0,1,0-11.32l72-72A8,8,0,0,1,120,56v64h96A8,8,0,0,1,224,128Z"}))],["light",g.createElement(g.Fragment,null,g.createElement("path",{d:"M222,128a6,6,0,0,1-6,6H54.49l61.75,61.76a6,6,0,1,1-8.48,8.48l-72-72a6,6,0,0,1,0-8.48l72-72a6,6,0,0,1,8.48,8.48L54.49,122H216A6,6,0,0,1,222,128Z"}))],["regular",g.createElement(g.Fragment,null,g.createElement("path",{d:"M224,128a8,8,0,0,1-8,8H59.31l58.35,58.34a8,8,0,0,1-11.32,11.32l-72-72a8,8,0,0,1,0-11.32l72-72a8,8,0,0,1,11.32,11.32L59.31,120H216A8,8,0,0,1,224,128Z"}))],["thin",g.createElement(g.Fragment,null,g.createElement("path",{d:"M220,128a4,4,0,0,1-4,4H49.66l65.17,65.17a4,4,0,0,1-5.66,5.66l-72-72a4,4,0,0,1,0-5.66l72-72a4,4,0,0,1,5.66,5.66L49.66,124H216A4,4,0,0,1,220,128Z"}))]]),Joe=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"}))]]),eae=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"}))]]),tae=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"}))]]),nae=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"}))]]),rae=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"}))]]),sae=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"}))]]),iae=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"}))]]),oae=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"}))]]),aae=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"}))]]),lae=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"}))]]),cae=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"}))]]),uae=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"}))]]),dae=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"}))]]),fae=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"}))]]),hae=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"}))]]),pae=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"}))]]),mae=new Map([["bold",g.createElement(g.Fragment,null,g.createElement("path",{d:"M199,125.31l-49.88-18.39L130.69,57a19.92,19.92,0,0,0-37.38,0L74.92,106.92,25,125.31a19.92,19.92,0,0,0,0,37.38l49.88,18.39L93.31,231a19.92,19.92,0,0,0,37.38,0l18.39-49.88L199,162.69a19.92,19.92,0,0,0,0-37.38Zm-63.38,35.16a12,12,0,0,0-7.11,7.11L112,212.28l-16.47-44.7a12,12,0,0,0-7.11-7.11L43.72,144l44.7-16.47a12,12,0,0,0,7.11-7.11L112,75.72l16.47,44.7a12,12,0,0,0,7.11,7.11L180.28,144ZM140,40a12,12,0,0,1,12-12h12V16a12,12,0,0,1,24,0V28h12a12,12,0,0,1,0,24H188V64a12,12,0,0,1-24,0V52H152A12,12,0,0,1,140,40ZM252,88a12,12,0,0,1-12,12h-4v4a12,12,0,0,1-24,0v-4h-4a12,12,0,0,1,0-24h4V72a12,12,0,0,1,24,0v4h4A12,12,0,0,1,252,88Z"}))],["duotone",g.createElement(g.Fragment,null,g.createElement("path",{d:"M194.82,151.43l-55.09,20.3-20.3,55.09a7.92,7.92,0,0,1-14.86,0l-20.3-55.09-55.09-20.3a7.92,7.92,0,0,1,0-14.86l55.09-20.3,20.3-55.09a7.92,7.92,0,0,1,14.86,0l20.3,55.09,55.09,20.3A7.92,7.92,0,0,1,194.82,151.43Z",opacity:"0.2"}),g.createElement("path",{d:"M197.58,129.06,146,110l-19-51.62a15.92,15.92,0,0,0-29.88,0L78,110l-51.62,19a15.92,15.92,0,0,0,0,29.88L78,178l19,51.62a15.92,15.92,0,0,0,29.88,0L146,178l51.62-19a15.92,15.92,0,0,0,0-29.88ZM137,164.22a8,8,0,0,0-4.74,4.74L112,223.85,91.78,169A8,8,0,0,0,87,164.22L32.15,144,87,123.78A8,8,0,0,0,91.78,119L112,64.15,132.22,119a8,8,0,0,0,4.74,4.74L191.85,144ZM144,40a8,8,0,0,1,8-8h16V16a8,8,0,0,1,16,0V32h16a8,8,0,0,1,0,16H184V64a8,8,0,0,1-16,0V48H152A8,8,0,0,1,144,40ZM248,88a8,8,0,0,1-8,8h-8v8a8,8,0,0,1-16,0V96h-8a8,8,0,0,1,0-16h8V72a8,8,0,0,1,16,0v8h8A8,8,0,0,1,248,88Z"}))],["fill",g.createElement(g.Fragment,null,g.createElement("path",{d:"M208,144a15.78,15.78,0,0,1-10.42,14.94L146,178l-19,51.62a15.92,15.92,0,0,1-29.88,0L78,178l-51.62-19a15.92,15.92,0,0,1,0-29.88L78,110l19-51.62a15.92,15.92,0,0,1,29.88,0L146,110l51.62,19A15.78,15.78,0,0,1,208,144ZM152,48h16V64a8,8,0,0,0,16,0V48h16a8,8,0,0,0,0-16H184V16a8,8,0,0,0-16,0V32H152a8,8,0,0,0,0,16Zm88,32h-8V72a8,8,0,0,0-16,0v8h-8a8,8,0,0,0,0,16h8v8a8,8,0,0,0,16,0V96h8a8,8,0,0,0,0-16Z"}))],["light",g.createElement(g.Fragment,null,g.createElement("path",{d:"M196.89,130.94,144.4,111.6,125.06,59.11a13.92,13.92,0,0,0-26.12,0L79.6,111.6,27.11,130.94a13.92,13.92,0,0,0,0,26.12L79.6,176.4l19.34,52.49a13.92,13.92,0,0,0,26.12,0L144.4,176.4l52.49-19.34a13.92,13.92,0,0,0,0-26.12Zm-4.15,14.86-55.08,20.3a6,6,0,0,0-3.56,3.56l-20.3,55.08a1.92,1.92,0,0,1-3.6,0L89.9,169.66a6,6,0,0,0-3.56-3.56L31.26,145.8a1.92,1.92,0,0,1,0-3.6l55.08-20.3a6,6,0,0,0,3.56-3.56l20.3-55.08a1.92,1.92,0,0,1,3.6,0l20.3,55.08a6,6,0,0,0,3.56,3.56l55.08,20.3a1.92,1.92,0,0,1,0,3.6ZM146,40a6,6,0,0,1,6-6h18V16a6,6,0,0,1,12,0V34h18a6,6,0,0,1,0,12H182V64a6,6,0,0,1-12,0V46H152A6,6,0,0,1,146,40ZM246,88a6,6,0,0,1-6,6H230v10a6,6,0,0,1-12,0V94H208a6,6,0,0,1,0-12h10V72a6,6,0,0,1,12,0V82h10A6,6,0,0,1,246,88Z"}))],["regular",g.createElement(g.Fragment,null,g.createElement("path",{d:"M197.58,129.06,146,110l-19-51.62a15.92,15.92,0,0,0-29.88,0L78,110l-51.62,19a15.92,15.92,0,0,0,0,29.88L78,178l19,51.62a15.92,15.92,0,0,0,29.88,0L146,178l51.62-19a15.92,15.92,0,0,0,0-29.88ZM137,164.22a8,8,0,0,0-4.74,4.74L112,223.85,91.78,169A8,8,0,0,0,87,164.22L32.15,144,87,123.78A8,8,0,0,0,91.78,119L112,64.15,132.22,119a8,8,0,0,0,4.74,4.74L191.85,144ZM144,40a8,8,0,0,1,8-8h16V16a8,8,0,0,1,16,0V32h16a8,8,0,0,1,0,16H184V64a8,8,0,0,1-16,0V48H152A8,8,0,0,1,144,40ZM248,88a8,8,0,0,1-8,8h-8v8a8,8,0,0,1-16,0V96h-8a8,8,0,0,1,0-16h8V72a8,8,0,0,1,16,0v8h8A8,8,0,0,1,248,88Z"}))],["thin",g.createElement(g.Fragment,null,g.createElement("path",{d:"M196.2,132.81l-53.36-19.65L123.19,59.8a11.93,11.93,0,0,0-22.38,0L81.16,113.16,27.8,132.81a11.93,11.93,0,0,0,0,22.38l53.36,19.65,19.65,53.36a11.93,11.93,0,0,0,22.38,0l19.65-53.36,53.36-19.65a11.93,11.93,0,0,0,0-22.38Zm-2.77,14.87L138.35,168a4,4,0,0,0-2.37,2.37l-20.3,55.08a3.92,3.92,0,0,1-7.36,0L88,170.35A4,4,0,0,0,85.65,168l-55.08-20.3a3.92,3.92,0,0,1,0-7.36L85.65,120A4,4,0,0,0,88,117.65l20.3-55.08a3.92,3.92,0,0,1,7.36,0L136,117.65a4,4,0,0,0,2.37,2.37l55.08,20.3a3.92,3.92,0,0,1,0,7.36ZM148,40a4,4,0,0,1,4-4h20V16a4,4,0,0,1,8,0V36h20a4,4,0,0,1,0,8H180V64a4,4,0,0,1-8,0V44H152A4,4,0,0,1,148,40Zm96,48a4,4,0,0,1-4,4H228v12a4,4,0,0,1-8,0V92H208a4,4,0,0,1,0-8h12V72a4,4,0,0,1,8,0V84h12A4,4,0,0,1,244,88Z"}))]]),gae=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"}))]]),vae=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"}))]]),yae=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"}))]]),_ae=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"}))]]),wae=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"}))]]),bae=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"}))]]),xae=g.createContext({color:"currentColor",size:"1em",weight:"regular",mirrored:!1}),Dn=g.forwardRef((t,e)=>{const{alt:n,color:r,size:s,weight:i,mirrored:o,children:l,weights:c,...d}=t,{color:f="currentColor",size:h,weight:m="regular",mirrored:v=!1,..._}=g.useContext(xae);return g.createElement("svg",{ref:e,xmlns:"http://www.w3.org/2000/svg",width:s??h,height:s??h,fill:r??f,viewBox:"0 0 256 256",transform:o||v?"scale(-1, 1)":void 0,..._,...d},!!n&&g.createElement("title",null,n),l,c.get(i??m))});Dn.displayName="IconBase";const Z9=g.forwardRef((t,e)=>g.createElement(Dn,{ref:e,...t,weights:Qoe}));Z9.displayName="ArrowLeftIcon";const Sae=Z9,W9=g.forwardRef((t,e)=>g.createElement(Dn,{ref:e,...t,weights:Joe}));W9.displayName="ArrowUpIcon";const kae=W9,q9=g.forwardRef((t,e)=>g.createElement(Dn,{ref:e,...t,weights:eae}));q9.displayName="CaretDownIcon";const Eae=q9,G9=g.forwardRef((t,e)=>g.createElement(Dn,{ref:e,...t,weights:tae}));G9.displayName="CaretRightIcon";const Cae=G9,K9=g.forwardRef((t,e)=>g.createElement(Dn,{ref:e,...t,weights:nae}));K9.displayName="ChatCircleIcon";const Pae=K9,Y9=g.forwardRef((t,e)=>g.createElement(Dn,{ref:e,...t,weights:rae}));Y9.displayName="CheckIcon";const Aae=Y9,X9=g.forwardRef((t,e)=>g.createElement(Dn,{ref:e,...t,weights:sae}));X9.displayName="CircleNotchIcon";const U1=X9,Q9=g.forwardRef((t,e)=>g.createElement(Dn,{ref:e,...t,weights:iae}));Q9.displayName="CopyIcon";const rm=Q9,J9=g.forwardRef((t,e)=>g.createElement(Dn,{ref:e,...t,weights:oae}));J9.displayName="DotsThreeIcon";const Tae=J9,eD=g.forwardRef((t,e)=>g.createElement(Dn,{ref:e,...t,weights:aae}));eD.displayName="FolderOpenIcon";const Rae=eD,tD=g.forwardRef((t,e)=>g.createElement(Dn,{ref:e,...t,weights:lae}));tD.displayName="FolderSimpleIcon";const Iae=tD,nD=g.forwardRef((t,e)=>g.createElement(Dn,{ref:e,...t,weights:cae}));nD.displayName="MagnifyingGlassIcon";const Oae=nD,rD=g.forwardRef((t,e)=>g.createElement(Dn,{ref:e,...t,weights:uae}));rD.displayName="PencilSimpleIcon";const sD=rD,iD=g.forwardRef((t,e)=>g.createElement(Dn,{ref:e,...t,weights:dae}));iD.displayName="PushPinIcon";const Vx=iD,oD=g.forwardRef((t,e)=>g.createElement(Dn,{ref:e,...t,weights:fae}));oD.displayName="SidebarSimpleIcon";const Mae=oD,aD=g.forwardRef((t,e)=>g.createElement(Dn,{ref:e,...t,weights:hae}));aD.displayName="SignInIcon";const Nae=aD,lD=g.forwardRef((t,e)=>g.createElement(Dn,{ref:e,...t,weights:pae}));lD.displayName="SignOutIcon";const Lae=lD,cD=g.forwardRef((t,e)=>g.createElement(Dn,{ref:e,...t,weights:mae}));cD.displayName="SparkleIcon";const pw=cD,uD=g.forwardRef((t,e)=>g.createElement(Dn,{ref:e,...t,weights:gae}));uD.displayName="SquaresFourIcon";const Dae=uD,dD=g.forwardRef((t,e)=>g.createElement(Dn,{ref:e,...t,weights:vae}));dD.displayName="SwatchesIcon";const fD=dD,hD=g.forwardRef((t,e)=>g.createElement(Dn,{ref:e,...t,weights:yae}));hD.displayName="TrashIcon";const pD=hD,mD=g.forwardRef((t,e)=>g.createElement(Dn,{ref:e,...t,weights:_ae}));mD.displayName="UserIcon";const $ae=mD,gD=g.forwardRef((t,e)=>g.createElement(Dn,{ref:e,...t,weights:wae}));gD.displayName="XIcon";const uE=gD,vD=g.forwardRef((t,e)=>g.createElement(Dn,{ref:e,...t,weights:bae}));vD.displayName="XLogoIcon";const jae=vD,Fae="/assets/arena-Db0j1set.png",zae="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";function yD(t){var e,n,r="";if(typeof t=="string"||typeof t=="number")r+=t;else if(typeof t=="object")if(Array.isArray(t)){var s=t.length;for(e=0;e<s;e++)t[e]&&(n=yD(t[e]))&&(r&&(r+=" "),r+=n)}else for(n in t)t[n]&&(r&&(r+=" "),r+=n);return r}function _D(){for(var t,e,n=0,r="",s=arguments.length;n<s;n++)(t=arguments[n])&&(e=yD(t))&&(r&&(r+=" "),r+=e);return r}const Vae=(t,e)=>{const n=new Array(t.length+e.length);for(let r=0;r<t.length;r++)n[r]=t[r];for(let r=0;r<e.length;r++)n[t.length+r]=e[r];return n},Hae=(t,e)=>({classGroupId:t,validator:e}),wD=(t=new Map,e=null,n)=>({nextPart:t,validators:e,classGroupId:n}),s1="-",$R=[],Uae="arbitrary..",Bae=t=>{const e=Wae(t),{conflictingClassGroups:n,conflictingClassGroupModifiers:r}=t;return{getClassGroupId:o=>{if(o.startsWith("[")&&o.endsWith("]"))return Zae(o);const l=o.split(s1),c=l[0]===""&&l.length>1?1:0;return bD(l,c,e)},getConflictingClassGroupIds:(o,l)=>{if(l){const c=r[o],d=n[o];return c?d?Vae(d,c):c:d||$R}return n[o]||$R}}},bD=(t,e,n)=>{if(t.length-e===0)return n.classGroupId;const s=t[e],i=n.nextPart.get(s);if(i){const d=bD(t,e+1,i);if(d)return d}const o=n.validators;if(o===null)return;const l=e===0?t.join(s1):t.slice(e).join(s1),c=o.length;for(let d=0;d<c;d++){const f=o[d];if(f.validator(l))return f.classGroupId}},Zae=t=>t.slice(1,-1).indexOf(":")===-1?void 0:(()=>{const e=t.slice(1,-1),n=e.indexOf(":"),r=e.slice(0,n);return r?Uae+r:void 0})(),Wae=t=>{const{theme:e,classGroups:n}=t;return qae(n,e)},qae=(t,e)=>{const n=wD();for(const r in t){const s=t[r];dE(s,n,r,e)}return n},dE=(t,e,n,r)=>{const s=t.length;for(let i=0;i<s;i++){const o=t[i];Gae(o,e,n,r)}},Gae=(t,e,n,r)=>{if(typeof t=="string"){Kae(t,e,n);return}if(typeof t=="function"){Yae(t,e,n,r);return}Xae(t,e,n,r)},Kae=(t,e,n)=>{const r=t===""?e:xD(e,t);r.classGroupId=n},Yae=(t,e,n,r)=>{if(Qae(t)){dE(t(r),e,n,r);return}e.validators===null&&(e.validators=[]),e.validators.push(Hae(n,t))},Xae=(t,e,n,r)=>{const s=Object.entries(t),i=s.length;for(let o=0;o<i;o++){const[l,c]=s[o];dE(c,xD(e,l),n,r)}},xD=(t,e)=>{let n=t;const r=e.split(s1),s=r.length;for(let i=0;i<s;i++){const o=r[i];let l=n.nextPart.get(o);l||(l=wD(),n.nextPart.set(o,l)),n=l}return n},Qae=t=>"isThemeGetter"in t&&t.isThemeGetter===!0,Jae=t=>{if(t<1)return{get:()=>{},set:()=>{}};let e=0,n=Object.create(null),r=Object.create(null);const s=(i,o)=>{n[i]=o,e++,e>t&&(e=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)}}},Hx="!",jR=":",ele=[],FR=(t,e,n,r,s)=>({modifiers:t,hasImportantModifier:e,baseClassName:n,maybePostfixModifierPosition:r,isExternal:s}),tle=t=>{const{prefix:e,experimentalParseClassName:n}=t;let r=s=>{const i=[];let o=0,l=0,c=0,d;const f=s.length;for(let y=0;y<f;y++){const w=s[y];if(o===0&&l===0){if(w===jR){i.push(s.slice(c,y)),c=y+1;continue}if(w==="/"){d=y;continue}}w==="["?o++:w==="]"?o--:w==="("?l++:w===")"&&l--}const h=i.length===0?s:s.slice(c);let m=h,v=!1;h.endsWith(Hx)?(m=h.slice(0,-1),v=!0):h.startsWith(Hx)&&(m=h.slice(1),v=!0);const _=d&&d>c?d-c:void 0;return FR(i,v,m,_)};if(e){const s=e+jR,i=r;r=o=>o.startsWith(s)?i(o.slice(s.length)):FR(ele,!1,o,void 0,!0)}if(n){const s=r;r=i=>n({className:i,parseClassName:s})}return r},nle=t=>{const e=new Map;return t.orderSensitiveModifiers.forEach((n,r)=>{e.set(n,1e6+r)}),n=>{const r=[];let s=[];for(let i=0;i<n.length;i++){const o=n[i],l=o[0]==="[",c=e.has(o);l||c?(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}},rle=t=>({cache:Jae(t.cacheSize),parseClassName:tle(t),sortModifiers:nle(t),postfixLookupClassGroupIds:sle(t),...Bae(t)}),sle=t=>{const e=Object.create(null),n=t.postfixLookupClassGroups;if(n)for(let r=0;r<n.length;r++)e[n[r]]=!0;return e},ile=/\s+/,ole=(t,e)=>{const{parseClassName:n,getClassGroupId:r,getConflictingClassGroupIds:s,sortModifiers:i,postfixLookupClassGroupIds:o}=e,l=[],c=t.trim().split(ile);let d="";for(let f=c.length-1;f>=0;f-=1){const h=c[f],{isExternal:m,modifiers:v,hasImportantModifier:_,baseClassName:y,maybePostfixModifierPosition:w}=n(h);if(m){d=h+(d.length>0?" "+d:d);continue}let x=!!w,k;if(x){const I=y.substring(0,w);k=r(I);const R=k&&o[k]?r(y):void 0;R&&R!==k&&(k=R,x=!1)}else k=r(y);if(!k){if(!x){d=h+(d.length>0?" "+d:d);continue}if(k=r(y),!k){d=h+(d.length>0?" "+d:d);continue}x=!1}const P=v.length===0?"":v.length===1?v[0]:i(v).join(":"),C=_?P+Hx:P,T=C+k;if(l.indexOf(T)>-1)continue;l.push(T);const O=s(k,x);for(let I=0;I<O.length;++I){const R=O[I];l.push(C+R)}d=h+(d.length>0?" "+d:d)}return d},ale=(...t)=>{let e=0,n,r,s="";for(;e<t.length;)(n=t[e++])&&(r=SD(n))&&(s&&(s+=" "),s+=r);return s},SD=t=>{if(typeof t=="string")return t;let e,n="";for(let r=0;r<t.length;r++)t[r]&&(e=SD(t[r]))&&(n&&(n+=" "),n+=e);return n},lle=(t,...e)=>{let n,r,s,i;const o=c=>{const d=e.reduce((f,h)=>h(f),t());return n=rle(d),r=n.cache.get,s=n.cache.set,i=l,l(c)},l=c=>{const d=r(c);if(d)return d;const f=ole(c,n);return s(c,f),f};return i=o,(...c)=>i(ale(...c))},cle=[],Pr=t=>{const e=n=>n[t]||cle;return e.isThemeGetter=!0,e.themeKey=t,e},kD=/^\[(?:(\w[\w-]*):)?(.+)\]$/i,ED=/^\((?:(\w[\w-]*):)?(.+)\)$/i,ule=/^\d+(?:\.\d+)?\/\d+(?:\.\d+)?$/,dle=/^(\d+(\.\d+)?)?(xs|sm|md|lg|xl)$/,fle=/\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$/,hle=/^(rgba?|hsla?|hwb|(ok)?(lab|lch)|color-mix|color|light-dark)\(.+\)$/,ple=/^(inset_)?-?((\d+)?\.?(\d+)[a-z]+|0)_-?((\d+)?\.?(\d+)[a-z]+|0)/,mle=/^(url|image|image-set|cross-fade|element|(repeating-)?(linear|radial|conic)-gradient)\(.+\)$/,Rl=t=>ule.test(t),Rt=t=>!!t&&!Number.isNaN(Number(t)),Fo=t=>!!t&&Number.isInteger(Number(t)),mw=t=>t.endsWith("%")&&Rt(t.slice(0,-1)),Aa=t=>dle.test(t),CD=()=>!0,gle=t=>fle.test(t)&&!hle.test(t),fE=()=>!1,vle=t=>ple.test(t),yle=t=>mle.test(t),_le=t=>!Ve(t)&&!Ue(t),wle=t=>t.startsWith("@container")&&(t[10]==="/"&&t[11]!==void 0||t[11]==="s"&&t[16]!==void 0&&t.startsWith("-size/",10)||t[11]==="n"&&t[18]!==void 0&&t.startsWith("-normal/",10)),ble=t=>Sc(t,TD,fE),Ve=t=>kD.test(t),Kc=t=>Sc(t,RD,gle),zR=t=>Sc(t,Tle,Rt),xle=t=>Sc(t,OD,CD),Sle=t=>Sc(t,ID,fE),VR=t=>Sc(t,PD,fE),kle=t=>Sc(t,AD,yle),mg=t=>Sc(t,MD,vle),Ue=t=>ED.test(t),Gh=t=>Hu(t,RD),Ele=t=>Hu(t,ID),HR=t=>Hu(t,PD),Cle=t=>Hu(t,TD),Ple=t=>Hu(t,AD),gg=t=>Hu(t,MD,!0),Ale=t=>Hu(t,OD,!0),Sc=(t,e,n)=>{const r=kD.exec(t);return r?r[1]?e(r[1]):n(r[2]):!1},Hu=(t,e,n=!1)=>{const r=ED.exec(t);return r?r[1]?e(r[1]):n:!1},PD=t=>t==="position"||t==="percentage",AD=t=>t==="image"||t==="url",TD=t=>t==="length"||t==="size"||t==="bg-size",RD=t=>t==="length",Tle=t=>t==="number",ID=t=>t==="family-name",OD=t=>t==="number"||t==="weight",MD=t=>t==="shadow",Rle=()=>{const t=Pr("color"),e=Pr("font"),n=Pr("text"),r=Pr("font-weight"),s=Pr("tracking"),i=Pr("leading"),o=Pr("breakpoint"),l=Pr("container"),c=Pr("spacing"),d=Pr("radius"),f=Pr("shadow"),h=Pr("inset-shadow"),m=Pr("text-shadow"),v=Pr("drop-shadow"),_=Pr("blur"),y=Pr("perspective"),w=Pr("aspect"),x=Pr("ease"),k=Pr("animate"),P=()=>["auto","avoid","all","avoid-page","page","left","right","column"],C=()=>["center","top","bottom","left","right","top-left","left-top","top-right","right-top","bottom-right","right-bottom","bottom-left","left-bottom"],T=()=>[...C(),Ue,Ve],O=()=>["auto","hidden","clip","visible","scroll"],I=()=>["auto","contain","none"],R=()=>[Ue,Ve,c],N=()=>[Rl,"full","auto",...R()],L=()=>[Fo,"none","subgrid",Ue,Ve],z=()=>["auto",{span:["full",Fo,Ue,Ve]},Fo,Ue,Ve],$=()=>[Fo,"auto",Ue,Ve],G=()=>["auto","min","max","fr",Ue,Ve],X=()=>["start","end","center","between","around","evenly","stretch","baseline","center-safe","end-safe"],q=()=>["start","end","center","stretch","center-safe","end-safe"],H=()=>["auto",...R()],ee=()=>[Rl,"auto","full","dvw","dvh","lvw","lvh","svw","svh","min","max","fit",...R()],V=()=>[l,Rl,"screen","full","dvw","lvw","svw","min","max","fit",...R()],Q=()=>[Rl,"screen","full","lh","dvh","lvh","svh","min","max","fit",...R()],U=()=>[t,Ue,Ve],D=()=>[...C(),HR,VR,{position:[Ue,Ve]}],K=()=>["no-repeat",{repeat:["","x","y","space","round"]}],de=()=>["auto","cover","contain",Cle,ble,{size:[Ue,Ve]}],ie=()=>[mw,Gh,Kc],ce=()=>["","none","full",d,Ue,Ve],he=()=>["",Rt,Gh,Kc],xe=()=>["solid","dashed","dotted","double"],oe=()=>["normal","multiply","screen","overlay","darken","lighten","color-dodge","color-burn","hard-light","soft-light","difference","exclusion","hue","saturation","color","luminosity"],re=()=>[Rt,mw,HR,VR],Se=()=>["","none",_,Ue,Ve],ze=()=>["none",Rt,Ue,Ve],ke=()=>["none",Rt,Ue,Ve],gt=()=>[Rt,Ue,Ve],on=()=>[Rl,"full",...R()];return{cacheSize:500,theme:{animate:["spin","ping","pulse","bounce"],aspect:["video"],blur:[Aa],breakpoint:[Aa],color:[CD],container:[Aa],"drop-shadow":[Aa],ease:["in","out","in-out"],font:[_le],"font-weight":["thin","extralight","light","normal","medium","semibold","bold","extrabold","black"],"inset-shadow":[Aa],leading:["none","tight","snug","normal","relaxed","loose"],perspective:["dramatic","near","normal","midrange","distant","none"],radius:[Aa],shadow:[Aa],spacing:["px",Rt],text:[Aa],"text-shadow":[Aa],tracking:["tighter","tight","normal","wide","wider","widest"]},classGroups:{aspect:[{aspect:["auto","square",Rl,Ve,Ue,w]}],container:["container"],"container-type":[{"@container":["","normal","size",Ue,Ve]}],"container-named":[wle],columns:[{columns:[Rt,"auto",Ve,Ue,l]}],"break-after":[{"break-after":P()}],"break-before":[{"break-before":P()}],"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:O()}],"overflow-x":[{"overflow-x":O()}],"overflow-y":[{"overflow-y":O()}],overscroll:[{overscroll:I()}],"overscroll-x":[{"overscroll-x":I()}],"overscroll-y":[{"overscroll-y":I()}],position:["static","fixed","absolute","relative","sticky"],inset:[{inset:N()}],"inset-x":[{"inset-x":N()}],"inset-y":[{"inset-y":N()}],start:[{"inset-s":N(),start:N()}],end:[{"inset-e":N(),end:N()}],"inset-bs":[{"inset-bs":N()}],"inset-be":[{"inset-be":N()}],top:[{top:N()}],right:[{right:N()}],bottom:[{bottom:N()}],left:[{left:N()}],visibility:["visible","invisible","collapse"],z:[{z:[Fo,"auto",Ue,Ve]}],basis:[{basis:[Rl,"full","auto",l,...R()]}],"flex-direction":[{flex:["row","row-reverse","col","col-reverse"]}],"flex-wrap":[{flex:["nowrap","wrap","wrap-reverse"]}],flex:[{flex:[Rt,Rl,"auto","initial","none",Ve]}],grow:[{grow:["",Rt,Ue,Ve]}],shrink:[{shrink:["",Rt,Ue,Ve]}],order:[{order:[Fo,"first","last","none",Ue,Ve]}],"grid-cols":[{"grid-cols":L()}],"col-start-end":[{col:z()}],"col-start":[{"col-start":$()}],"col-end":[{"col-end":$()}],"grid-rows":[{"grid-rows":L()}],"row-start-end":[{row:z()}],"row-start":[{"row-start":$()}],"row-end":[{"row-end":$()}],"grid-flow":[{"grid-flow":["row","col","dense","row-dense","col-dense"]}],"auto-cols":[{"auto-cols":G()}],"auto-rows":[{"auto-rows":G()}],gap:[{gap:R()}],"gap-x":[{"gap-x":R()}],"gap-y":[{"gap-y":R()}],"justify-content":[{justify:[...X(),"normal"]}],"justify-items":[{"justify-items":[...q(),"normal"]}],"justify-self":[{"justify-self":["auto",...q()]}],"align-content":[{content:["normal",...X()]}],"align-items":[{items:[...q(),{baseline:["","last"]}]}],"align-self":[{self:["auto",...q(),{baseline:["","last"]}]}],"place-content":[{"place-content":X()}],"place-items":[{"place-items":[...q(),"baseline"]}],"place-self":[{"place-self":["auto",...q()]}],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:H()}],mx:[{mx:H()}],my:[{my:H()}],ms:[{ms:H()}],me:[{me:H()}],mbs:[{mbs:H()}],mbe:[{mbe:H()}],mt:[{mt:H()}],mr:[{mr:H()}],mb:[{mb:H()}],ml:[{ml:H()}],"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",...V()]}],"min-inline-size":[{"min-inline":["auto",...V()]}],"max-inline-size":[{"max-inline":["none",...V()]}],"block-size":[{block:["auto",...Q()]}],"min-block-size":[{"min-block":["auto",...Q()]}],"max-block-size":[{"max-block":["none",...Q()]}],w:[{w:[l,"screen",...ee()]}],"min-w":[{"min-w":[l,"screen","none",...ee()]}],"max-w":[{"max-w":[l,"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,Gh,Kc]}],"font-smoothing":["antialiased","subpixel-antialiased"],"font-style":["italic","not-italic"],"font-weight":[{font:[r,Ale,xle]}],"font-stretch":[{"font-stretch":["ultra-condensed","extra-condensed","condensed","semi-condensed","normal","semi-expanded","expanded","extra-expanded","ultra-expanded",mw,Ve]}],"font-family":[{font:[Ele,Sle,e]}],"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,Ue,Ve]}],"line-clamp":[{"line-clamp":[Rt,"none",Ue,zR]}],leading:[{leading:["none",i,...R()]}],"list-image":[{"list-image":["none",Ue,Ve]}],"list-style-position":[{list:["inside","outside"]}],"list-style-type":[{list:["disc","decimal","none",Ue,Ve]}],"text-alignment":[{text:["left","center","right","justify","start","end"]}],"placeholder-color":[{placeholder:U()}],"text-color":[{text:U()}],"text-decoration":["underline","overline","line-through","no-underline"],"text-decoration-style":[{decoration:[...xe(),"wavy"]}],"text-decoration-thickness":[{decoration:[Rt,"from-font","auto",Ue,Kc]}],"text-decoration-color":[{decoration:U()}],"underline-offset":[{"underline-offset":[Rt,"auto",Ue,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:[Fo,Ue,Ve]}],"vertical-align":[{align:["baseline","top","middle","bottom","text-top","text-bottom","sub","super",Ue,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",Ue,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:D()}],"bg-repeat":[{bg:K()}],"bg-size":[{bg:de()}],"bg-image":[{bg:["none",{linear:[{to:["t","tr","r","br","b","bl","l","tl"]},Fo,Ue,Ve],radial:["",Ue,Ve],conic:["",Fo,Ue,Ve]},Ple,kle]}],"bg-color":[{bg:U()}],"gradient-from-pos":[{from:ie()}],"gradient-via-pos":[{via:ie()}],"gradient-to-pos":[{to:ie()}],"gradient-from":[{from:U()}],"gradient-via":[{via:U()}],"gradient-to":[{to:U()}],rounded:[{rounded:ce()}],"rounded-s":[{"rounded-s":ce()}],"rounded-e":[{"rounded-e":ce()}],"rounded-t":[{"rounded-t":ce()}],"rounded-r":[{"rounded-r":ce()}],"rounded-b":[{"rounded-b":ce()}],"rounded-l":[{"rounded-l":ce()}],"rounded-ss":[{"rounded-ss":ce()}],"rounded-se":[{"rounded-se":ce()}],"rounded-ee":[{"rounded-ee":ce()}],"rounded-es":[{"rounded-es":ce()}],"rounded-tl":[{"rounded-tl":ce()}],"rounded-tr":[{"rounded-tr":ce()}],"rounded-br":[{"rounded-br":ce()}],"rounded-bl":[{"rounded-bl":ce()}],"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:[...xe(),"hidden","none"]}],"divide-style":[{divide:[...xe(),"hidden","none"]}],"border-color":[{border:U()}],"border-color-x":[{"border-x":U()}],"border-color-y":[{"border-y":U()}],"border-color-s":[{"border-s":U()}],"border-color-e":[{"border-e":U()}],"border-color-bs":[{"border-bs":U()}],"border-color-be":[{"border-be":U()}],"border-color-t":[{"border-t":U()}],"border-color-r":[{"border-r":U()}],"border-color-b":[{"border-b":U()}],"border-color-l":[{"border-l":U()}],"divide-color":[{divide:U()}],"outline-style":[{outline:[...xe(),"none","hidden"]}],"outline-offset":[{"outline-offset":[Rt,Ue,Ve]}],"outline-w":[{outline:["",Rt,Gh,Kc]}],"outline-color":[{outline:U()}],shadow:[{shadow:["","inner","none",f,gg,mg]}],"shadow-color":[{shadow:U()}],"inset-shadow":[{"inset-shadow":["none",h,gg,mg]}],"inset-shadow-color":[{"inset-shadow":U()}],"ring-w":[{ring:he()}],"ring-w-inset":["ring-inset"],"ring-color":[{ring:U()}],"ring-offset-w":[{"ring-offset":[Rt,Kc]}],"ring-offset-color":[{"ring-offset":U()}],"inset-ring-w":[{"inset-ring":he()}],"inset-ring-color":[{"inset-ring":U()}],"text-shadow":[{"text-shadow":["none",m,gg,mg]}],"text-shadow-color":[{"text-shadow":U()}],opacity:[{opacity:[Rt,Ue,Ve]}],"mix-blend":[{"mix-blend":[...oe(),"plus-darker","plus-lighter"]}],"bg-blend":[{"bg-blend":oe()}],"mask-clip":[{"mask-clip":["border","padding","content","fill","stroke","view"]},"mask-no-clip"],"mask-composite":[{mask:["add","subtract","intersect","exclude"]}],"mask-image-linear-pos":[{"mask-linear":[Rt]}],"mask-image-linear-from-pos":[{"mask-linear-from":re()}],"mask-image-linear-to-pos":[{"mask-linear-to":re()}],"mask-image-linear-from-color":[{"mask-linear-from":U()}],"mask-image-linear-to-color":[{"mask-linear-to":U()}],"mask-image-t-from-pos":[{"mask-t-from":re()}],"mask-image-t-to-pos":[{"mask-t-to":re()}],"mask-image-t-from-color":[{"mask-t-from":U()}],"mask-image-t-to-color":[{"mask-t-to":U()}],"mask-image-r-from-pos":[{"mask-r-from":re()}],"mask-image-r-to-pos":[{"mask-r-to":re()}],"mask-image-r-from-color":[{"mask-r-from":U()}],"mask-image-r-to-color":[{"mask-r-to":U()}],"mask-image-b-from-pos":[{"mask-b-from":re()}],"mask-image-b-to-pos":[{"mask-b-to":re()}],"mask-image-b-from-color":[{"mask-b-from":U()}],"mask-image-b-to-color":[{"mask-b-to":U()}],"mask-image-l-from-pos":[{"mask-l-from":re()}],"mask-image-l-to-pos":[{"mask-l-to":re()}],"mask-image-l-from-color":[{"mask-l-from":U()}],"mask-image-l-to-color":[{"mask-l-to":U()}],"mask-image-x-from-pos":[{"mask-x-from":re()}],"mask-image-x-to-pos":[{"mask-x-to":re()}],"mask-image-x-from-color":[{"mask-x-from":U()}],"mask-image-x-to-color":[{"mask-x-to":U()}],"mask-image-y-from-pos":[{"mask-y-from":re()}],"mask-image-y-to-pos":[{"mask-y-to":re()}],"mask-image-y-from-color":[{"mask-y-from":U()}],"mask-image-y-to-color":[{"mask-y-to":U()}],"mask-image-radial":[{"mask-radial":[Ue,Ve]}],"mask-image-radial-from-pos":[{"mask-radial-from":re()}],"mask-image-radial-to-pos":[{"mask-radial-to":re()}],"mask-image-radial-from-color":[{"mask-radial-from":U()}],"mask-image-radial-to-color":[{"mask-radial-to":U()}],"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":C()}],"mask-image-conic-pos":[{"mask-conic":[Rt]}],"mask-image-conic-from-pos":[{"mask-conic-from":re()}],"mask-image-conic-to-pos":[{"mask-conic-to":re()}],"mask-image-conic-from-color":[{"mask-conic-from":U()}],"mask-image-conic-to-color":[{"mask-conic-to":U()}],"mask-mode":[{mask:["alpha","luminance","match"]}],"mask-origin":[{"mask-origin":["border","padding","content","fill","stroke","view"]}],"mask-position":[{mask:D()}],"mask-repeat":[{mask:K()}],"mask-size":[{mask:de()}],"mask-type":[{"mask-type":["alpha","luminance"]}],"mask-image":[{mask:["none",Ue,Ve]}],filter:[{filter:["","none",Ue,Ve]}],blur:[{blur:Se()}],brightness:[{brightness:[Rt,Ue,Ve]}],contrast:[{contrast:[Rt,Ue,Ve]}],"drop-shadow":[{"drop-shadow":["","none",v,gg,mg]}],"drop-shadow-color":[{"drop-shadow":U()}],grayscale:[{grayscale:["",Rt,Ue,Ve]}],"hue-rotate":[{"hue-rotate":[Rt,Ue,Ve]}],invert:[{invert:["",Rt,Ue,Ve]}],saturate:[{saturate:[Rt,Ue,Ve]}],sepia:[{sepia:["",Rt,Ue,Ve]}],"backdrop-filter":[{"backdrop-filter":["","none",Ue,Ve]}],"backdrop-blur":[{"backdrop-blur":Se()}],"backdrop-brightness":[{"backdrop-brightness":[Rt,Ue,Ve]}],"backdrop-contrast":[{"backdrop-contrast":[Rt,Ue,Ve]}],"backdrop-grayscale":[{"backdrop-grayscale":["",Rt,Ue,Ve]}],"backdrop-hue-rotate":[{"backdrop-hue-rotate":[Rt,Ue,Ve]}],"backdrop-invert":[{"backdrop-invert":["",Rt,Ue,Ve]}],"backdrop-opacity":[{"backdrop-opacity":[Rt,Ue,Ve]}],"backdrop-saturate":[{"backdrop-saturate":[Rt,Ue,Ve]}],"backdrop-sepia":[{"backdrop-sepia":["",Rt,Ue,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",Ue,Ve]}],"transition-behavior":[{transition:["normal","discrete"]}],duration:[{duration:[Rt,"initial",Ue,Ve]}],ease:[{ease:["linear","initial",x,Ue,Ve]}],delay:[{delay:[Rt,Ue,Ve]}],animate:[{animate:["none",k,Ue,Ve]}],backface:[{backface:["hidden","visible"]}],perspective:[{perspective:[y,Ue,Ve]}],"perspective-origin":[{"perspective-origin":T()}],rotate:[{rotate:ze()}],"rotate-x":[{"rotate-x":ze()}],"rotate-y":[{"rotate-y":ze()}],"rotate-z":[{"rotate-z":ze()}],scale:[{scale:ke()}],"scale-x":[{"scale-x":ke()}],"scale-y":[{"scale-y":ke()}],"scale-z":[{"scale-z":ke()}],"scale-3d":["scale-3d"],skew:[{skew:gt()}],"skew-x":[{"skew-x":gt()}],"skew-y":[{"skew-y":gt()}],transform:[{transform:[Ue,Ve,"","none","gpu","cpu"]}],"transform-origin":[{origin:T()}],"transform-style":[{transform:["3d","flat"]}],translate:[{translate:on()}],"translate-x":[{"translate-x":on()}],"translate-y":[{"translate-y":on()}],"translate-z":[{"translate-z":on()}],"translate-none":["translate-none"],zoom:[{zoom:[Fo,Ue,Ve]}],accent:[{accent:U()}],appearance:[{appearance:["none","auto"]}],"caret-color":[{caret:U()}],"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",Ue,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":U()}],"scrollbar-track-color":[{"scrollbar-track":U()}],"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",Ue,Ve]}],fill:[{fill:["none",...U()]}],"stroke-w":[{stroke:[Rt,Gh,Kc,zR]}],stroke:[{stroke:["none",...U()]}],"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"]}},Ile=lle(Rle);function pn(...t){return Ile(_D(t))}const Ip=({provider:t,className:e})=>{if(t==="x")return S.jsx(jae,{className:pn("h-6 w-6",e),"aria-hidden":"true"});if(t==="pinterest")return S.jsx("svg",{viewBox:"0 0 24 24",className:pn("h-6 w-6",e),"aria-hidden":"true",children:S.jsx("path",{fill:"currentColor",d:"M12 0C5.373 0 0 5.372 0 12c0 5.084 3.163 9.426 7.627 11.174-.105-.949-.2-2.405.042-3.441.218-.937 1.407-5.965 1.407-5.965s-.359-.719-.359-1.781c0-1.669.967-2.915 2.171-2.915 1.024 0 1.518.769 1.518 1.69 0 1.029-.655 2.568-.994 3.995-.283 1.194.599 2.169 1.777 2.169 2.132 0 3.772-2.249 3.772-5.495 0-2.873-2.064-4.882-5.012-4.882-3.414 0-5.418 2.561-5.418 5.207 0 1.031.397 2.137.893 2.739.098.119.112.223.083.344-.091.379-.293 1.194-.333 1.361-.052.22-.174.266-.401.16-1.499-.698-2.436-2.889-2.436-4.649 0-3.785 2.75-7.262 7.929-7.262 4.163 0 7.398 2.967 7.398 6.931 0 4.136-2.607 7.464-6.227 7.464-1.216 0-2.36-.631-2.75-1.378l-.748 2.853c-.271 1.043-1.002 2.35-1.492 3.146A12.004 12.004 0 0 0 12 24c6.627 0 12-5.373 12-12C24 5.372 18.627 0 12 0z"})});const n=t==="cosmos"?zae:Fae;return S.jsx("span",{"aria-hidden":"true",className:pn("h-6 w-6",t==="cosmos"?"bg-current":"bg-[#b1b1b1]",e),style:{WebkitMaskImage:`url("${n}")`,maskImage:`url("${n}")`,WebkitMaskSize:"contain",maskSize:"contain",WebkitMaskRepeat:"no-repeat",maskRepeat:"no-repeat",WebkitMaskPosition:"center",maskPosition:"center"}})},Ole=t=>{const e=new URL(t).hostname.replace(/^www\./,"");return e==="are.na"?"arena":e==="pinterest.com"||e==="pin.it"?"pinterest":e==="x.com"?"x":e==="cosmos.so"?"cosmos":null},Mle=({reference:t,imageUrl:e,onOpen:n})=>{const[r,s]=g.useState(!1),i=!!e&&!r,o=t.url?Ole(t.url):null,l=t.url??(i?e:void 0),c=l?"a":"span",d=i&&t.url?new URL(t.url).hostname:t.title;return S.jsxs(c,{href:l,target:l?"_blank":void 0,rel:l?"noopener noreferrer":void 0,"aria-label":t.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(),l&&n()},className:pn("border-main-border bg-main-input text-content hover:border-content-muted/50 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-2 focus-visible:-outline-offset-2",!i&&"py-1.5 pl-2"),children:[i?S.jsx("img",{src:e,alt:"",className:"h-8 w-12 shrink-0 object-contain",width:48,height:32,onError:()=>s(!0)}):null,o&&(i||o==="cosmos")?S.jsx(Ip,{provider:o,className:pn("h-3.5 w-3.5 shrink-0",o==="pinterest"&&"text-[#e60023]")}):null,!i||!o?S.jsx("span",{className:"max-w-40 truncate",children:d}):null]})},Nle=({references:t,source:e,sessionId:n,variantId:r,projectPath:s,className:i})=>{const o=so(),l=dJ(t);return l?S.jsx("div",{className:pn("ph-no-capture flex min-w-0 flex-nowrap gap-1.5 overflow-x-auto pr-3 pb-2",i),"aria-label":"References",children:l.map(c=>{var h;const d=s?`?${new URLSearchParams({projectPath:s})}`:"",f=c.image&&n&&r?`/api/variants/${encodeURIComponent(n)}/${encodeURIComponent(r)}/references/${encodeURIComponent(c.id)}/image${d}`:void 0;return S.jsx(Mle,{reference:c,imageUrl:f,onOpen:()=>o==null?void 0:o.capture("preview_reference_opened",{variant_source:e,reference_count:l.length})},`${c.id}:${((h=c.image)==null?void 0:h.hash)??""}:${f??""}`)})}):null},G1e=t=>{const e=t.pathname.split("/").filter(Boolean).map(decodeURIComponent),n=e[3];if(e[2]==="references")return{kind:"references"};if(e[2]!=="projects"||!n)return{kind:"library"};const r=e[4]==="variants"?e[5]:void 0,s=e[4]==="variants"?e[6]:void 0,i=new URLSearchParams(t.search);return r&&s&&i.get("edit")!=="1"?{kind:"preview",projectId:n,sessionId:r,variantId:s}:{kind:"workspace",projectId:n,sessionId:r,variantId:s}},K1e=t=>{if(t.kind==="references")return"/rivet/library/references";if(t.kind==="library"||!t.projectId)return"/rivet/library";const e=`/rivet/library/projects/${encodeURIComponent(t.projectId)}`;return t.sessionId&&t.variantId?`${e}/variants/${encodeURIComponent(t.sessionId)}/${encodeURIComponent(t.variantId)}${t.kind==="workspace"?"?edit=1":""}`:e},Lle=t=>{const e=new URLSearchParams(t),n=e.get("historySession"),r=e.get("historyVariant");return n&&r?{sessionId:n,variantId:r}:null},UR=t=>typeof t=="boolean"?`${t}`:t===0?"0":t,BR=_D,Dle=(t,e)=>n=>{var r;if((e==null?void 0:e.variants)==null)return BR(t,n==null?void 0:n.class,n==null?void 0:n.className);const{variants:s,defaultVariants:i}=e,o=Object.keys(s).map(d=>{const f=n==null?void 0:n[d],h=i==null?void 0:i[d];if(f===null)return null;const m=UR(f)||UR(h);return s[d][m]}),l=n&&Object.entries(n).reduce((d,f)=>{let[h,m]=f;return m===void 0||(d[h]=m),d},{}),c=e==null||(r=e.compoundVariants)===null||r===void 0?void 0:r.reduce((d,f)=>{let{class:h,className:m,...v}=f;return Object.entries(v).every(_=>{let[y,w]=_;return Array.isArray(w)?w.includes({...i,...l}[y]):{...i,...l}[y]===w})?[...d,h,m]:d},[]);return BR(t,o,c,n==null?void 0:n.class,n==null?void 0:n.className)},ND={pill:{item:"rounded-[20px]",bg:"rounded-[20px]",focusRing:"rounded-[22px]",mergedBg:"rounded-2xl",container:"rounded-3xl",button:"rounded-[20px]",input:"rounded-[20px]"},rounded:{item:"rounded-lg",bg:"rounded-lg",focusRing:"rounded-[10px]",mergedBg:"rounded-lg",container:"rounded-xl",button:"rounded-lg",input:"rounded-lg"}},LD=g.createContext(null);function Dm(){const t=g.useContext(LD);return t?t.classes:ND.pill}function $le(t){const e=document.documentElement;e.classList.add("transitioning"),e.offsetHeight,t(),setTimeout(()=>e.classList.remove("transitioning"),200)}function jle({children:t,defaultShape:e="pill"}){const[n,r]=g.useState(e),s=g.useCallback(i=>{$le(()=>r(i))},[]);return S.jsx(LD.Provider,{value:{shape:n,setShape:s,classes:ND[n]},children:t})}const Fle=Dle(["group/button relative isolate inline-flex cursor-pointer items-center justify-center outline-none","transition-colors duration-80 motion-reduce:transition-none","disabled:pointer-events-none disabled:opacity-50","focus-visible:ring-1 focus-visible:ring-[color:var(--focus-ring,#6B97FF)]"],{variants:{variant:{primary:"text-background",secondary:"text-foreground",tertiary:"text-foreground",ghost:"text-muted-foreground hover: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"}}),ZR={default:16,compact:14},zle={primary:"[--btn-bg:var(--foreground)] group-hover/button:[--btn-bg:color-mix(in_oklab,var(--foreground)_90%,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-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-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-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)]"},DD=g.forwardRef(({className:t,variant:e,size:n,isLoading:r=!1,leadingIcon:s,trailingIcon:i,disabled:o,children:l,type:c="button",...d},f)=>{const h=e??"secondary",m=n??"default",v=m==="icon"||m==="icon-compact",_=m==="compact"||m==="icon-compact",y=_?ZR.compact:ZR.default,w=Dm();return S.jsxs("button",{...d,ref:f,type:c,disabled:o||r,"aria-busy":r||d["aria-busy"],className:pn(Fle({variant:h,size:m,iconLeft:!v&&!!s,iconRight:!v&&!!i}),w.button,t),children:[S.jsx("span",{"aria-hidden":!0,className:pn("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",zle[h])}),S.jsxs("span",{className:"relative inline-flex items-center justify-center gap-[inherit]",children:[S.jsxs("span",{className:pn("inline-flex items-center justify-center gap-[inherit]",r&&"opacity-0"),children:[s&&!v?S.jsx(s,{size:y,strokeWidth:1.5,"aria-hidden":!0}):null,S.jsx("span",{className:"[text-box:trim-both_cap_alphabetic]",children:l}),i&&!v?S.jsx(i,{size:y,strokeWidth:1.5,"aria-hidden":!0}):null]}),r?S.jsx("span",{"aria-hidden":!0,className:"absolute inset-0 flex items-center justify-center",children:S.jsx("svg",{className:_?"h-7 w-7":"h-9 w-9",viewBox:"0 0 24 24",fill:"none",children:S.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]})]})});DD.displayName="Button";var Vle=Object.defineProperty,eh=(t,e)=>Vle(t,"name",{value:e,configurable:!0}),$D=!!(typeof window<"u"&&window.document&&window.document.createElement);function vn(t,e,{checkForDefaultPrevented:n=!0}={}){return eh(function(s){if(t==null||t(s),n===!1||!s||!s.defaultPrevented)return e==null?void 0:e(s)},"handleEvent")}eh(vn,"composeEventHandlers");function Hle(t){var e;if(!$D)throw new Error("Cannot access window outside of the DOM");return((e=t==null?void 0:t.ownerDocument)==null?void 0:e.defaultView)??window}eh(Hle,"getOwnerWindow");function Ux(t){if(!$D)throw new Error("Cannot access document outside of the DOM");return(t==null?void 0:t.ownerDocument)??document}eh(Ux,"getOwnerDocument");function jD(t,e=!1){const{activeElement:n}=Ux(t);if(!(n!=null&&n.nodeName))return null;if(FD(n)&&n.contentDocument)return jD(n.contentDocument.body,e);if(e){const r=n.getAttribute("aria-activedescendant");if(r){const s=Ux(n).getElementById(r);if(s)return s}}return n}eh(jD,"getActiveElement");function FD(t){return t.tagName==="IFRAME"}eh(FD,"isFrame");var Ule=Object.defineProperty,hE=(t,e)=>Ule(t,"name",{value:e,configurable:!0});function Bx(t,e){if(typeof t=="function")return t(e);t!=null&&(t.current=e)}hE(Bx,"setRef");function zD(...t){return e=>{let n=!1;const r=t.map(s=>{const i=Bx(s,e);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():Bx(t[s],null)}}}}hE(zD,"composeRefs");function yn(...t){return g.useCallback(zD(...t),t)}hE(yn,"useComposedRefs");var Ble=Object.defineProperty,Ki=(t,e)=>Ble(t,"name",{value:e,configurable:!0});function Zle(t,e){const n=g.createContext(e);n.displayName=t+"Context";const r=Ki(i=>{const{children:o,...l}=i,c=g.useMemo(()=>l,Object.values(l));return S.jsx(n.Provider,{value:c,children:o})},"Provider");r.displayName=t+"Provider";function s(i,o={}){const{optional:l=!1}=o,c=g.useContext(n);if(c)return c;if(e!==void 0)return e;if(!l)throw new Error(`\`${i}\` must be used within \`${t}\``)}return Ki(s,"useContext"),[r,s]}Ki(Zle,"createContext");function fa(t,e=[]){let n=[];function r(i,o){const l=g.createContext(o);l.displayName=i+"Context";const c=n.length;n=[...n,o];const d=Ki(h=>{var x;const{scope:m,children:v,..._}=h,y=((x=m==null?void 0:m[t])==null?void 0:x[c])||l,w=g.useMemo(()=>_,Object.values(_));return S.jsx(y.Provider,{value:w,children:v})},"Provider");d.displayName=i+"Provider";function f(h,m,v={}){var x;const{optional:_=!1}=v,y=((x=m==null?void 0:m[t])==null?void 0:x[c])||l,w=g.useContext(y);if(w)return w;if(o!==void 0)return o;if(!_)throw new Error(`\`${h}\` must be used within \`${i}\``)}return Ki(f,"useContext"),[d,f]}Ki(r,"createContext");const s=Ki(()=>{const i=n.map(o=>g.createContext(o));return Ki(function(l){const c=(l==null?void 0:l[t])||i;return g.useMemo(()=>({[`__scope${t}`]:{...l,[t]:c}}),[l,c])},"useScope")},"createScope");return s.scopeName=t,[r,VD(s,...e)]}Ki(fa,"createContextScope");function VD(...t){const e=t[0];if(t.length===1)return e;const n=Ki(()=>{const r=t.map(s=>({useScope:s(),scopeName:s.scopeName}));return Ki(function(i){const o=r.reduce((l,{useScope:c,scopeName:d})=>{const h=c(i)[`__scope${d}`];return{...l,...h}},{});return g.useMemo(()=>({[`__scope${e.scopeName}`]:o}),[o])},"useComposedScopes")},"createScope");return n.scopeName=e.scopeName,n}Ki(VD,"composeContextScopes");var Wle=Object.defineProperty,Ti=(t,e)=>Wle(t,"name",{value:e,configurable:!0});function pc(t){const e=g.forwardRef((n,r)=>{let{children:s,...i}=n,o=null,l=!1;const c=[];s=GD(s),g.Children.forEach(s,m=>{var v;if(WD(m)){l=!0;const _=m;let y="child"in _.props?_.props.child:_.props.children;for(;pE(y)&&typeof i1=="function";)y=i1(y._payload);o=qle(_,y),c.push((v=o==null?void 0:o.props)==null?void 0:v.children)}else c.push(m)}),o?o=g.cloneElement(o,void 0,c):!l&&g.Children.count(s)===1&&g.isValidElement(s)&&(o=s);const d=o?ZD(o):void 0,f=yn(r,d);if(!o){if(s||s===0)throw new Error(l?Yle(t):Kle(t));return s}const h=BD(i,o.props??{});return o.type!==g.Fragment&&(h.ref=r?f:d),g.cloneElement(o,h)});return e.displayName=`${t}.Slot`,e}Ti(pc,"createSlot");var HD=Symbol.for("radix.slottable");function UD(t){const e=Ti(n=>"child"in n?n.children(n.child):n.children,"Slottable");return e.displayName=`${t}.Slottable`,e.__radixId=HD,e}Ti(UD,"createSlottable");var qle=Ti((t,e)=>"child"in t.props?g.isValidElement(e)?g.cloneElement(e,void 0,t.props.children(e.props.children)):null:g.isValidElement(e)?e:null,"getSlottableElementFromSlottable");function BD(t,e){const n={...e};for(const r in e){const s=t[r],i=e[r];/^on[A-Z]/.test(r)?s&&i?n[r]=(...l)=>{const c=i(...l);return s(...l),c}:s&&(n[r]=s):r==="style"?n[r]={...s,...i}:r==="className"?n[r]=[s,i].filter(Boolean).join(" "):r==="aria-describedby"&&(n[r]=KD(i,s))}return{...t,...n}}Ti(BD,"mergeProps");function ZD(t){var r,s;let e=(r=Object.getOwnPropertyDescriptor(t.props,"ref"))==null?void 0:r.get,n=e&&"isReactWarning"in e&&e.isReactWarning;return n?t.ref:(e=(s=Object.getOwnPropertyDescriptor(t,"ref"))==null?void 0:s.get,n=e&&"isReactWarning"in e&&e.isReactWarning,n?t.props.ref:t.props.ref||t.ref)}Ti(ZD,"getElementRef");function WD(t){return g.isValidElement(t)&&typeof t.type=="function"&&"__radixId"in t.type&&t.type.__radixId===HD}Ti(WD,"isSlottable");var Gle=Symbol.for("react.lazy");function pE(t){return t!=null&&typeof t=="object"&&"$$typeof"in t&&t.$$typeof===Gle&&"_payload"in t&&qD(t._payload)}Ti(pE,"isLazyComponent");function qD(t){return typeof t=="object"&&t!==null&&"then"in t}Ti(qD,"isPromiseLike");function GD(t){let e=t;for(;pE(e)&&typeof i1=="function";)e=i1(e._payload);return e}Ti(GD,"useUnwrappedLazy");function KD(...t){const e=new Set;for(const n of t)if(typeof n=="string")for(const r of String(n).trim().split(/\s+/))r&&e.add(r);return e.size>0?Array.from(e).join(" "):void 0}Ti(KD,"concatAriaDescribedby");var Kle=Ti(t=>`${t} failed to slot onto its children. Expected a single React element child or \`Slottable\`.`,"createSlotError"),Yle=Ti(t=>`${t} failed to slot onto its \`Slottable\`. Expected \`Slottable\` to receive a single React element child.`,"createSlottableError"),i1=qf[" use ".trim().toString()],Xle=Object.defineProperty,Qle=(t,e)=>Xle(t,"name",{value:e,configurable:!0}),Jle=["a","button","div","form","h2","h3","img","input","label","li","nav","ol","p","select","span","svg","ul"],tr=Jle.reduce((t,e)=>{const n=pc(`Primitive.${e}`),r=g.forwardRef((s,i)=>{const{asChild:o,...l}=s,c=o?n:e;return typeof window<"u"&&(window[Symbol.for("radix-ui")]=!0),S.jsx(c,{...l,ref:i})});return r.displayName=`Primitive.${e}`,{...t,[e]:r}},{});function YD(t,e){t&&Lm.flushSync(()=>t.dispatchEvent(e))}Qle(YD,"dispatchDiscreteCustomEvent");var xs=globalThis!=null&&globalThis.document?g.useLayoutEffect:()=>{},ece=Object.defineProperty,tce=(t,e)=>ece(t,"name",{value:e,configurable:!0}),WR=qf[" useInsertionEffect ".trim().toString()];function ju(t){const e=g.useRef(t);return typeof WR=="function"?WR(()=>{e.current=t}):xs(()=>{e.current=t}),g.useMemo(()=>((...n)=>{var r;return(r=e.current)==null?void 0:r.call(e,...n)}),[])}tce(ju,"useCallbackRef");var nce=Object.defineProperty,Vr=(t,e)=>nce(t,"name",{value:e,configurable:!0}),Zx="dismissableLayer.update",rce="dismissableLayer.pointerDownOutside",sce="dismissableLayer.focusOutside",qR,XD=g.createContext({layers:new Set,layersWithOutsidePointerEventsDisabled:new Set,branches:new Set,dismissableSurfaces:new Set}),mE=g.forwardRef(Vr(function(e,n){const{disableOutsidePointerEvents:r=!1,deferPointerDownOutside:s=!1,onEscapeKeyDown:i,onPointerDownOutside:o,onFocusOutside:l,onInteractOutside:c,onDismiss:d,...f}=e,h=g.useContext(XD),[m,v]=g.useState(null),_=(m==null?void 0:m.ownerDocument)??(globalThis==null?void 0:globalThis.document),[,y]=g.useState({}),w=yn(n,v),x=Array.from(h.layers),[k]=[...h.layersWithOutsidePointerEventsDisabled].slice(-1),P=k?x.indexOf(k):-1,C=m?x.indexOf(m):-1,T=h.layersWithOutsidePointerEventsDisabled.size>0,O=C>=P,I=g.useRef(!1),R=JD($=>{o==null||o($),c==null||c($),$.defaultPrevented||d==null||d()},{ownerDocument:_,deferPointerDownOutside:s,isDeferredPointerDownOutsideRef:I,dismissableSurfaces:h.dismissableSurfaces,shouldHandlePointerDownOutside:g.useCallback($=>{if(!($ instanceof Node))return!1;const G=[...h.branches].some(X=>X.contains($));return O&&!G},[h.branches,O])}),N=e$($=>{if(s&&I.current)return;const G=$.target;[...h.branches].some(q=>q.contains(G))||(l==null||l($),c==null||c($),$.defaultPrevented||d==null||d())},_),L=m?C===x.length-1:!1,z=ju($=>{$.key==="Escape"&&(i==null||i($),!$.defaultPrevented&&d&&($.preventDefault(),d()))});return g.useEffect(()=>{if(L)return _.addEventListener("keydown",z,{capture:!0}),()=>_.removeEventListener("keydown",z,{capture:!0})},[_,L,z]),g.useEffect(()=>{if(m)return r&&(h.layersWithOutsidePointerEventsDisabled.size===0&&(qR=_.body.style.pointerEvents,_.body.style.pointerEvents="none"),h.layersWithOutsidePointerEventsDisabled.add(m)),h.layers.add(m),Wx(),()=>{r&&(h.layersWithOutsidePointerEventsDisabled.delete(m),h.layersWithOutsidePointerEventsDisabled.size===0&&(_.body.style.pointerEvents=qR))}},[m,_,r,h]),g.useEffect(()=>()=>{m&&(h.layers.delete(m),h.layersWithOutsidePointerEventsDisabled.delete(m),Wx())},[m,h]),g.useEffect(()=>{const $=Vr(()=>y({}),"handleUpdate");return document.addEventListener(Zx,$),()=>document.removeEventListener(Zx,$)},[]),S.jsx(tr.div,{...f,ref:w,style:{pointerEvents:T?O?"auto":"none":void 0,...e.style},onFocusCapture:vn(e.onFocusCapture,N.onFocusCapture),onBlurCapture:vn(e.onBlurCapture,N.onBlurCapture),onPointerDownCapture:vn(e.onPointerDownCapture,R.onPointerDownCapture)})},"DismissableLayer"));function QD(){const t=g.useContext(XD),[e,n]=g.useState(null);return g.useEffect(()=>{if(e)return t.dismissableSurfaces.add(e),()=>{t.dismissableSurfaces.delete(e)}},[e,t.dismissableSurfaces]),n}Vr(QD,"useDismissableLayerSurface");var ice=Vr(()=>!0,"IS_TRUE");function JD(t,e){const{ownerDocument:n=globalThis==null?void 0:globalThis.document,deferPointerDownOutside:r=!1,isDeferredPointerDownOutsideRef:s,dismissableSurfaces:i,shouldHandlePointerDownOutside:o=ice}=e,l=ju(t),c=g.useRef(!1),d=g.useRef(!1),f=g.useRef(new Map),h=g.useRef(()=>{});return g.useEffect(()=>{function m(){d.current=!1,s.current=!1,f.current.clear()}Vr(m,"resetOutsideInteraction");function v(){return Array.from(f.current.values()).some(Boolean)}Vr(v,"isOutsideInteractionIntercepted");function _(P){if(!d.current)return;const C=P.target;C instanceof Node&&[...i].some(O=>O.contains(C))||f.current.set(P.type,!0),P.type==="click"&&window.setTimeout(()=>{d.current&&h.current()},0)}Vr(_,"handleInteractionCapture");function y(P){d.current&&f.current.set(P.type,!1)}Vr(y,"handleInteractionBubble");const w=Vr(P=>{if(P.target&&!c.current){let C=function(){n.removeEventListener("click",h.current);const O=v();m(),O||gE(rce,l,T,{discrete:!0})};if(Vr(C,"handleAndDispatchPointerDownOutsideEvent"),!o(P.target)){n.removeEventListener("click",h.current),m(),c.current=!1;return}const T={originalEvent:P};d.current=!0,s.current=r&&P.button===0,f.current.clear(),!r||P.button!==0?C():(n.removeEventListener("click",h.current),h.current=C,n.addEventListener("click",h.current,{once:!0}))}else n.removeEventListener("click",h.current),m();c.current=!1},"handlePointerDown"),x=["pointerup","mousedown","mouseup","touchstart","touchend","click"];for(const P of x)n.addEventListener(P,_,!0),n.addEventListener(P,y);const k=window.setTimeout(()=>{n.addEventListener("pointerdown",w)},0);return()=>{window.clearTimeout(k),n.removeEventListener("pointerdown",w),n.removeEventListener("click",h.current);for(const P of x)n.removeEventListener(P,_,!0),n.removeEventListener(P,y)}},[n,l,r,s,i,o]),{onPointerDownCapture:Vr(()=>c.current=!0,"onPointerDownCapture")}}Vr(JD,"usePointerDownOutside");function e$(t,e=globalThis==null?void 0:globalThis.document){const n=ju(t),r=g.useRef(!1);return g.useEffect(()=>{const s=Vr(i=>{i.target&&!r.current&&gE(sce,n,{originalEvent:i},{discrete:!1})},"handleFocus");return e.addEventListener("focusin",s),()=>e.removeEventListener("focusin",s)},[e,n]),{onFocusCapture:Vr(()=>r.current=!0,"onFocusCapture"),onBlurCapture:Vr(()=>r.current=!1,"onBlurCapture")}}Vr(e$,"useFocusOutside");function Wx(){const t=new CustomEvent(Zx);document.dispatchEvent(t)}Vr(Wx,"dispatchUpdate");function gE(t,e,n,{discrete:r}){const s=n.originalEvent.target,i=new CustomEvent(t,{bubbles:!1,cancelable:!0,detail:n});e&&s.addEventListener(t,e,{once:!0}),r?YD(s,i):s.dispatchEvent(i)}Vr(gE,"handleAndDispatchCustomEvent");var oce=Object.defineProperty,_r=(t,e)=>oce(t,"name",{value:e,configurable:!0}),gw="focusScope.autoFocusOnMount",vw="focusScope.autoFocusOnUnmount",GR={bubbles:!1,cancelable:!0},t$=g.forwardRef(_r(function(e,n){const{loop:r=!1,trapped:s=!1,branches:i,onMountAutoFocus:o,onUnmountAutoFocus:l,...c}=e,[d,f]=g.useState(null),h=ju(o),m=ju(l),v=g.useRef(null),_=yn(n,f),y=g.useRef(i);g.useEffect(()=>{y.current=i});const w=g.useCallback(P=>{var C;return P?d!=null&&d.contains(P)?!0:!!((C=y.current)!=null&&C.some(T=>T.contains(P))):!1},[d]),x=g.useRef({paused:!1,pause(){this.paused=!0},resume(){this.paused=!1}}).current;g.useEffect(()=>{if(s){let P=function(I){if(x.paused||!d)return;const R=I.target;w(R)?v.current=R:Da(v.current,{select:!0})},C=function(I){if(x.paused||!d)return;const R=I.relatedTarget;R!==null&&(w(R)||Da(v.current,{select:!0}))},T=function(I){if(document.activeElement===document.body)for(const N of I)N.removedNodes.length>0&&Da(d)};_r(P,"handleFocusIn"),_r(C,"handleFocusOut"),_r(T,"handleMutations"),document.addEventListener("focusin",P),document.addEventListener("focusout",C);const O=new MutationObserver(T);return d&&O.observe(d,{childList:!0,subtree:!0}),()=>{document.removeEventListener("focusin",P),document.removeEventListener("focusout",C),O.disconnect()}}},[s,d,x.paused,w]),g.useEffect(()=>{if(d){KR.add(x);const P=document.activeElement;if(!d.contains(P)){const T=new CustomEvent(gw,GR);d.addEventListener(gw,h),d.dispatchEvent(T),T.defaultPrevented||(r$(l$(wE(d)),{select:!0}),document.activeElement===P&&Da(d))}return()=>{d.removeEventListener(gw,h);const T=d.ownerDocument,O=CustomEvent;setTimeout(()=>{const I=new O(vw,GR);d.addEventListener(vw,m),d.dispatchEvent(I),I.defaultPrevented||Da(P??T.body,{select:!0}),d.removeEventListener(vw,m),KR.remove(x)},0)}}},[d,h,m,x]);const k=g.useCallback(P=>{if(!r&&!s||x.paused)return;const C=P.key==="Tab"&&!P.altKey&&!P.ctrlKey&&!P.metaKey,T=document.activeElement;if(C&&T){const O=P.currentTarget,[I,R]=s$(O);I&&R?!P.shiftKey&&T===R?(P.preventDefault(),r&&Da(I,{select:!0})):P.shiftKey&&T===I&&(P.preventDefault(),r&&Da(R,{select:!0})):T===O&&P.preventDefault()}},[r,s,x.paused]);return S.jsx(tr.div,{tabIndex:-1,...c,ref:_,onKeyDown:k})},"FocusScope")),n$=g.createContext(null);function vE({registry:t,children:e}){return t?S.jsx(n$.Provider,{value:t,children:e}):e}_r(vE,"FocusScopeBranchProvider");function yE(){const[t,e]=g.useState([]),n=g.useMemo(()=>({add:_r(r=>e(s=>s.includes(r)?s:[...s,r]),"add"),remove:_r(r=>e(s=>s.filter(i=>i!==r)),"remove")}),[]);return{nodes:t,registry:n}}_r(yE,"useFocusScopeBranchRegistry");function _E(t){const e=g.useContext(n$);g.useEffect(()=>{if(!(!t||!e))return e.add(t),()=>e.remove(t)},[t,e])}_r(_E,"useFocusScopeBranch");function r$(t,{select:e=!1}={}){const n=document.activeElement;for(const r of t)if(Da(r,{select:e}),document.activeElement!==n)return}_r(r$,"focusFirst");function s$(t){const e=wE(t),n=qx(e,t),r=qx(e.reverse(),t);return[n,r]}_r(s$,"getTabbableEdges");function wE(t){const e=[],r=t.ownerDocument.createTreeWalker(t,NodeFilter.SHOW_ELEMENT,{acceptNode:_r(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();)e.push(r.currentNode);return e}_r(wE,"getTabbableCandidates");function qx(t,e){const n=typeof e.checkVisibility=="function"&&e.checkVisibility({checkVisibilityCSS:!0});for(const r of t)if(!(n?!r.checkVisibility({checkVisibilityCSS:!0}):i$(r,{upTo:e})))return r}_r(qx,"findVisible");function i$(t,{upTo:e}){if(getComputedStyle(t).visibility==="hidden")return!0;for(;t;){if(e!==void 0&&t===e)return!1;if(getComputedStyle(t).display==="none")return!0;t=t.parentElement}return!1}_r(i$,"isHidden");function o$(t){return t.tagName==="INPUT"&&typeof t.select=="function"}_r(o$,"isSelectableInput");function Da(t,{select:e=!1}={}){if(t&&t.focus){const r=(t.ownerDocument??document).activeElement;t.focus({preventScroll:!0}),t!==r&&o$(t)&&e&&t.select()}}_r(Da,"focus");var KR=a$();function a$(){let t=[];return{add(e){const n=t[0];e!==n&&(n==null||n.pause()),t=Gx(t,e),t.unshift(e)},remove(e){var n;t=Gx(t,e),(n=t[0])==null||n.resume()}}}_r(a$,"createFocusScopesStack");function Gx(t,e){const n=[...t],r=n.indexOf(e);return r!==-1&&n.splice(r,1),n}_r(Gx,"arrayRemove");function l$(t){return t.filter(e=>e.tagName!=="A")}_r(l$,"removeLinks");var ace=Object.defineProperty,lce=(t,e)=>ace(t,"name",{value:e,configurable:!0}),cce=qf[" useId ".trim().toString()]||(()=>{}),uce=0;function sa(t){const[e,n]=g.useState(cce());return xs(()=>{t||n(r=>r??String(uce++))},[t]),t||(e?`radix-${e}`:"")}lce(sa,"useId");const dce=["top","right","bottom","left"],mc=Math.min,Ga=Math.max,o1=Math.round,vg=Math.floor,Ka=t=>({x:t,y:t}),fce={left:"right",right:"left",bottom:"top",top:"bottom"};function c$(t,e,n){return Ga(t,mc(e,n))}function el(t,e){return typeof t=="function"?t(e):t}function gc(t){return t.split("-")[0]}function th(t){return t.split("-")[1]}function bE(t){return t==="x"?"y":"x"}function xE(t){return t==="y"?"height":"width"}function Jo(t){const e=t[0];return e==="t"||e==="b"?"y":"x"}function SE(t){return bE(Jo(t))}function hce(t,e,n){n===void 0&&(n=!1);const r=th(t),s=SE(t),i=xE(s);let o=s==="x"?r===(n?"end":"start")?"right":"left":r==="start"?"bottom":"top";return e.reference[i]>e.floating[i]&&(o=a1(o)),[o,a1(o)]}function pce(t){const e=a1(t);return[Kx(t),e,Kx(e)]}function Kx(t){return t.includes("start")?t.replace("start","end"):t.replace("end","start")}const YR=["left","right"],XR=["right","left"],mce=["top","bottom"],gce=["bottom","top"];function vce(t,e,n){switch(t){case"top":case"bottom":return n?e?XR:YR:e?YR:XR;case"left":case"right":return e?mce:gce;default:return[]}}function yce(t,e,n,r){const s=th(t);let i=vce(gc(t),n==="start",r);return s&&(i=i.map(o=>o+"-"+s),e&&(i=i.concat(i.map(Kx)))),i}function a1(t){const e=gc(t);return fce[e]+t.slice(e.length)}function _ce(t){var e,n,r,s;return{top:(e=t.top)!=null?e:0,right:(n=t.right)!=null?n:0,bottom:(r=t.bottom)!=null?r:0,left:(s=t.left)!=null?s:0}}function u$(t){return typeof t!="number"?_ce(t):{top:t,right:t,bottom:t,left:t}}function l1(t){const{x:e,y:n,width:r,height:s}=t;return{width:r,height:s,top:n,left:e,right:e+r,bottom:n+s,x:e,y:n}}function QR(t,e,n){let{reference:r,floating:s}=t;const i=Jo(e),o=SE(e),l=xE(o),c=gc(e),d=i==="y",f=r.x+r.width/2-s.width/2,h=r.y+r.height/2-s.height/2,m=r[l]/2-s[l]/2;let v;switch(c){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:h};break;case"left":v={x:r.x-s.width,y:h};break;default:v={x:r.x,y:r.y}}const _=th(e);return _&&(v[o]+=m*(_==="end"?1:-1)*(n&&d?-1:1)),v}async function wce(t,e){var n;e===void 0&&(e={});const{x:r,y:s,platform:i,rects:o,elements:l,strategy:c}=t,{boundary:d="clippingAncestors",rootBoundary:f="viewport",elementContext:h="floating",altBoundary:m=!1,padding:v=0}=el(e,t),_=u$(v),w=l[m?h==="floating"?"reference":"floating":h],x=l1(await i.getClippingRect({element:(n=await(i.isElement==null?void 0:i.isElement(w)))==null||n?w:w.contextElement||await(i.getDocumentElement==null?void 0:i.getDocumentElement(l.floating)),boundary:d,rootBoundary:f,strategy:c})),k=h==="floating"?{x:r,y:s,width:o.floating.width,height:o.floating.height}:o.reference,P=await(i.getOffsetParent==null?void 0:i.getOffsetParent(l.floating)),C=await(i.isElement==null?void 0:i.isElement(P))&&await(i.getScale==null?void 0:i.getScale(P))||{x:1,y:1},T=l1(i.convertOffsetParentRelativeRectToViewportRelativeRect?await i.convertOffsetParentRelativeRectToViewportRelativeRect({elements:l,rect:k,offsetParent:P,strategy:c}):k);return{top:(x.top-T.top+_.top)/C.y,bottom:(T.bottom-x.bottom+_.bottom)/C.y,left:(x.left-T.left+_.left)/C.x,right:(T.right-x.right+_.right)/C.x}}const bce=50,xce=async(t,e,n)=>{const{placement:r="bottom",strategy:s="absolute",middleware:i=[],platform:o}=n,l=o.detectOverflow?o:{...o,detectOverflow:wce},c=await(o.isRTL==null?void 0:o.isRTL(e));let d=await o.getElementRects({reference:t,floating:e,strategy:s}),{x:f,y:h}=QR(d,r,c),m=r,v=0;const _={};for(let y=0;y<i.length;y++){const w=i[y];if(!w)continue;const{name:x,fn:k}=w,{x:P,y:C,data:T,reset:O}=await k({x:f,y:h,initialPlacement:r,placement:m,strategy:s,middlewareData:_,rects:d,platform:l,elements:{reference:t,floating:e}});f=P??f,h=C??h,_[x]={..._[x],...T},O&&v<bce&&(v++,typeof O=="object"&&(O.placement&&(m=O.placement),O.rects&&(d=O.rects===!0?await o.getElementRects({reference:t,floating:e,strategy:s}):O.rects),{x:f,y:h}=QR(d,m,c)),y=-1)}return{x:f,y:h,placement:m,strategy:s,middlewareData:_}},Sce=t=>({name:"arrow",options:t,async fn(e){const{x:n,y:r,placement:s,rects:i,platform:o,elements:l,middlewareData:c}=e,{element:d,padding:f=0}=el(t,e)||{};if(d==null)return{};const h=u$(f),m={x:n,y:r},v=SE(s),_=xE(v),y=await o.getDimensions(d),w=v==="y",x=w?"top":"left",k=w?"bottom":"right",P=w?"clientHeight":"clientWidth",C=i.reference[_]+i.reference[v]-m[v]-i.floating[_],T=m[v]-i.reference[v],O=await(o.getOffsetParent==null?void 0:o.getOffsetParent(d));let I=O?O[P]:0;(!I||!await(o.isElement==null?void 0:o.isElement(O)))&&(I=l.floating[P]||i.floating[_]);const R=C/2-T/2,N=I/2-y[_]/2-1,L=mc(h[x],N),z=mc(h[k],N),$=I-y[_]-z,G=I/2-y[_]/2+R,X=c$(L,G,$),q=!c.arrow&&th(s)!=null&&G!==X&&i.reference[_]/2-(G<L?L:z)-y[_]/2<0,H=q?G<L?G-L:G-$:0;return{[v]:m[v]+H,data:{[v]:X,centerOffset:G-X-H,...q&&{alignmentOffset:H}},reset:q}}}),kce=function(t){return t===void 0&&(t={}),{name:"flip",options:t,async fn(e){var n,r;const{placement:s,middlewareData:i,rects:o,initialPlacement:l,platform:c,elements:d}=e,{mainAxis:f=!0,crossAxis:h=!0,fallbackPlacements:m,fallbackStrategy:v="bestFit",fallbackAxisSideDirection:_="none",flipAlignment:y=!0,...w}=el(t,e);if((n=i.arrow)!=null&&n.alignmentOffset)return{};const x=gc(s),k=Jo(l),P=gc(l)===l,C=await(c.isRTL==null?void 0:c.isRTL(d.floating)),T=m||(P||!y?[a1(l)]:pce(l)),O=_!=="none";!m&&O&&T.push(...yce(l,y,_,C));const I=[l,...T],R=await c.detectOverflow(e,w),N=[];let L=((r=i.flip)==null?void 0:r.overflows)||[];if(f&&N.push(R[x]),h){const X=hce(s,o,C);N.push(R[X[0]],R[X[1]])}if(L=[...L,{placement:s,overflows:N}],!N.every(X=>X<=0)){var z,$;const X=(((z=i.flip)==null?void 0:z.index)||0)+1,q=I[X];if(q&&(!(h==="alignment"?k!==Jo(q):!1)||L.every(V=>Jo(V.placement)===k?V.overflows[0]>0:!0)))return{data:{index:X,overflows:L},reset:{placement:q}};let H=($=L.filter(ee=>ee.overflows[0]<=0).sort((ee,V)=>ee.overflows[1]-V.overflows[1])[0])==null?void 0:$.placement;if(!H)switch(v){case"bestFit":{var G;const ee=(G=L.filter(V=>{if(O){const Q=Jo(V.placement);return Q===k||Q==="y"}return!0}).map(V=>[V.placement,V.overflows.filter(Q=>Q>0).reduce((Q,U)=>Q+U,0)]).sort((V,Q)=>V[1]-Q[1])[0])==null?void 0:G[0];ee&&(H=ee);break}case"initialPlacement":H=l;break}if(s!==H)return{reset:{placement:H}}}return{}}}};function JR(t,e){return{top:t.top-e.height,right:t.right-e.width,bottom:t.bottom-e.height,left:t.left-e.width}}function eI(t){return dce.some(e=>t[e]>=0)}const Ece=function(t){return t===void 0&&(t={}),{name:"hide",options:t,async fn(e){const{rects:n,platform:r}=e,{strategy:s="referenceHidden",...i}=el(t,e);switch(s){case"referenceHidden":{const o=await r.detectOverflow(e,{...i,elementContext:"reference"}),l=JR(o,n.reference);return{data:{referenceHiddenOffsets:l,referenceHidden:eI(l)}}}case"escaped":{const o=await r.detectOverflow(e,{...i,altBoundary:!0}),l=JR(o,n.floating);return{data:{escapedOffsets:l,escaped:eI(l)}}}default:return{}}}}},d$=new Set(["left","top"]);async function Cce(t,e){const{placement:n,platform:r,elements:s}=t,i=await(r.isRTL==null?void 0:r.isRTL(s.floating)),o=gc(n),l=th(n),c=Jo(n)==="y",d=d$.has(o)?-1:1,f=i&&c?-1:1,h=el(e,t);let{mainAxis:m,crossAxis:v,alignmentAxis:_}=typeof h=="number"?{mainAxis:h,crossAxis:0,alignmentAxis:null}:{mainAxis:h.mainAxis||0,crossAxis:h.crossAxis||0,alignmentAxis:h.alignmentAxis};return l&&typeof _=="number"&&(v=l==="end"?_*-1:_),c?{x:v*f,y:m*d}:{x:m*d,y:v*f}}const Pce=function(t){return t===void 0&&(t=0),{name:"offset",options:t,async fn(e){var n,r;const{x:s,y:i,placement:o,middlewareData:l}=e,c=await Cce(e,t);return o===((n=l.offset)==null?void 0:n.placement)&&(r=l.arrow)!=null&&r.alignmentOffset?{}:{x:s+c.x,y:i+c.y,data:{...c,placement:o}}}}},Ace=function(t){return t===void 0&&(t={}),{name:"shift",options:t,async fn(e){const{x:n,y:r,placement:s,platform:i}=e,{mainAxis:o=!0,crossAxis:l=!1,limiter:c={fn:k=>{let{x:P,y:C}=k;return{x:P,y:C}}},...d}=el(t,e),f={x:n,y:r},h=await i.detectOverflow(e,d),m=Jo(s),v=bE(m);let _=f[v],y=f[m];const w=(k,P)=>c$(P+h[k==="y"?"top":"left"],P,P-h[k==="y"?"bottom":"right"]);o&&(_=w(v,_)),l&&(y=w(m,y));const x=c.fn({...e,[v]:_,[m]:y});return{...x,data:{x:x.x-n,y:x.y-r,enabled:{[v]:o,[m]:l}}}}}},Tce=function(t){return t===void 0&&(t={}),{options:t,fn(e){var n,r;const{x:s,y:i,placement:o,rects:l,middlewareData:c}=e,{offset:d=0,mainAxis:f=!0,crossAxis:h=!0}=el(t,e),m={x:s,y:i},v=Jo(o),_=bE(v);let y=m[_],w=m[v];const x=el(d,e),k=typeof x=="number"?{mainAxis:x,crossAxis:0}:{mainAxis:(n=x.mainAxis)!=null?n:0,crossAxis:(r=x.crossAxis)!=null?r:0};if(f){const T=_==="y"?"height":"width",O=l.reference[_]-l.floating[T]+k.mainAxis,I=l.reference[_]+l.reference[T]-k.mainAxis;y<O?y=O:y>I&&(y=I)}if(h){var P,C;const T=_==="y"?"width":"height",O=d$.has(gc(o)),I=l.reference[v]-l.floating[T]+(O&&((P=c.offset)==null?void 0:P[v])||0)+(O?0:k.crossAxis),R=l.reference[v]+l.reference[T]+(O?0:((C=c.offset)==null?void 0:C[v])||0)-(O?k.crossAxis:0);w<I?w=I:w>R&&(w=R)}return{[_]:y,[v]:w}}}},Rce=function(t){return t===void 0&&(t={}),{name:"size",options:t,async fn(e){const{placement:n,rects:r,platform:s,elements:i}=e,{apply:o=()=>{},...l}=el(t,e),c=await s.detectOverflow(e,l),d=gc(n),f=th(n),h=Jo(n)==="y",{width:m,height:v}=r.floating;let _,y;d==="top"||d==="bottom"?(_=d,y=f===(await(s.isRTL==null?void 0:s.isRTL(i.floating))?"start":"end")?"left":"right"):(y=d,_=f==="end"?"top":"bottom");const w=v-c.top-c.bottom,x=m-c.left-c.right,k=mc(v-c[_],w),P=mc(m-c[y],x),C=e.middlewareData.shift,T=!C;let O=k,I=P;C!=null&&C.enabled.x&&(I=x),C!=null&&C.enabled.y&&(O=w),T&&!f&&(h?I=m-2*Ga(c.left,c.right):O=v-2*Ga(c.top,c.bottom)),await o({...e,availableWidth:I,availableHeight:O});const R=await s.getDimensions(i.floating);return m!==R.width||v!==R.height?{reset:{rects:!0}}:{}}}};function B1(){return typeof window<"u"}function nh(t){return f$(t)?(t.nodeName||"").toLowerCase():"#document"}function Xs(t){var e;return(t==null||(e=t.ownerDocument)==null?void 0:e.defaultView)||window}function il(t){var e;return(e=(f$(t)?t.ownerDocument:t.document)||window.document)==null?void 0:e.documentElement}function f$(t){return B1()?t instanceof Node||t instanceof Xs(t).Node:!1}function ca(t){return B1()?t instanceof Element||t instanceof Xs(t).Element:!1}function kc(t){return B1()?t instanceof HTMLElement||t instanceof Xs(t).HTMLElement:!1}function tI(t){return!B1()||typeof ShadowRoot>"u"?!1:t instanceof ShadowRoot||t instanceof Xs(t).ShadowRoot}function Z1(t){const{overflow:e,overflowX:n,overflowY:r,display:s}=ua(t);return/auto|scroll|overlay|hidden|clip/.test(e+r+n)&&s!=="inline"&&s!=="contents"}function Ice(t){return/^(table|td|th)$/.test(nh(t))}function W1(t){try{if(t.matches(":popover-open"))return!0}catch{}try{return t.matches(":modal")}catch{return!1}}const Oce=/transform|translate|scale|rotate|perspective|filter/,Mce=/paint|layout|strict|content/,Yc=t=>!!t&&t!=="none";let yw;function kE(t){const e=ca(t)?ua(t):t;return Yc(e.transform)||Yc(e.translate)||Yc(e.scale)||Yc(e.rotate)||Yc(e.perspective)||!EE()&&(Yc(e.backdropFilter)||Yc(e.filter))||Oce.test(e.willChange||"")||Mce.test(e.contain||"")}function Nce(t){let e=Fu(t);for(;kc(e)&&!sm(e);){if(kE(e))return e;if(W1(e))return null;e=Fu(e)}return null}function EE(){return yw==null&&(yw=typeof CSS<"u"&&CSS.supports&&CSS.supports("-webkit-backdrop-filter","none")),yw}function sm(t){return/^(html|body|#document)$/.test(nh(t))}function ua(t){return Xs(t).getComputedStyle(t)}function q1(t){return ca(t)?{scrollLeft:t.scrollLeft,scrollTop:t.scrollTop}:{scrollLeft:t.scrollX,scrollTop:t.scrollY}}function Fu(t){if(nh(t)==="html")return t;const e=t.assignedSlot||t.parentNode||tI(t)&&t.host||il(t);return tI(e)?e.host:e}function h$(t){const e=Fu(t);return sm(e)?(t.ownerDocument||t).body:kc(e)&&Z1(e)?e:h$(e)}function im(t,e,n){var r;e===void 0&&(e=[]),n===void 0&&(n=!0);const s=h$(t),i=s===((r=t.ownerDocument)==null?void 0:r.body),o=Xs(s);if(i){const l=Yx(o);return e.concat(o,o.visualViewport||[],Z1(s)?s:[],l&&n?im(l):[])}else return e.concat(s,im(s,[],n))}function Yx(t){return t.parent&&Object.getPrototypeOf(t.parent)?t.frameElement:null}function p$(t){const e=ua(t);let n=parseFloat(e.width)||0,r=parseFloat(e.height)||0;const s=kc(t),i=s?t.offsetWidth:n,o=s?t.offsetHeight:r,l=o1(n)!==i||o1(r)!==o;return l&&(n=i,r=o),{width:n,height:r,$:l}}function CE(t){return ca(t)?t:t.contextElement}function Jd(t){const e=CE(t);if(!kc(e))return Ka(1);const n=e.getBoundingClientRect(),{width:r,height:s,$:i}=p$(e);let o=(i?o1(n.width):n.width)/r,l=(i?o1(n.height):n.height)/s;return(!o||!Number.isFinite(o))&&(o=1),(!l||!Number.isFinite(l))&&(l=1),{x:o,y:l}}const Lce=Ka(0);function m$(t){const e=Xs(t);return!EE()||!e.visualViewport?Lce:{x:e.visualViewport.offsetLeft,y:e.visualViewport.offsetTop}}function Dce(t,e,n){return e===void 0&&(e=!1),!!n&&e&&n===Xs(t)}function zu(t,e,n,r){e===void 0&&(e=!1),n===void 0&&(n=!1);const s=t.getBoundingClientRect(),i=CE(t);let o=Ka(1);e&&(r?ca(r)&&(o=Jd(r)):o=Jd(t));const l=Dce(i,n,r)?m$(i):Ka(0);let c=(s.left+l.x)/o.x,d=(s.top+l.y)/o.y,f=s.width/o.x,h=s.height/o.y;if(i&&r){const m=Xs(i),v=ca(r)?Xs(r):r;let _=m,y=Yx(_);for(;y&&v!==_;){const w=Jd(y),x=y.getBoundingClientRect(),k=ua(y),P=x.left+(y.clientLeft+parseFloat(k.paddingLeft))*w.x,C=x.top+(y.clientTop+parseFloat(k.paddingTop))*w.y;c*=w.x,d*=w.y,f*=w.x,h*=w.y,c+=P,d+=C,_=Xs(y),y=Yx(_)}}return l1({width:f,height:h,x:c,y:d})}function G1(t,e){const n=q1(t).scrollLeft;return e?e.left+n:zu(il(t)).left+n}function g$(t,e){const n=t.getBoundingClientRect(),r=n.left+e.scrollLeft-G1(t,n),s=n.top+e.scrollTop;return{x:r,y:s}}function $ce(t){let{elements:e,rect:n,offsetParent:r,strategy:s}=t;const i=s==="fixed",o=il(r),l=e?W1(e.floating):!1;if(r===o||l&&i)return n;let c={scrollLeft:0,scrollTop:0},d=Ka(1);const f=Ka(0),h=kc(r);if((h||!i)&&((nh(r)!=="body"||Z1(o))&&(c=q1(r)),h)){const v=zu(r);d=Jd(r),f.x=v.x+r.clientLeft,f.y=v.y+r.clientTop}const m=o&&!h&&!i?g$(o,c):Ka(0);return{width:n.width*d.x,height:n.height*d.y,x:n.x*d.x-c.scrollLeft*d.x+f.x+m.x,y:n.y*d.y-c.scrollTop*d.y+f.y+m.y}}function jce(t){return t.getClientRects?Array.from(t.getClientRects()):[]}function Fce(t){const e=q1(t),n=t.ownerDocument.body,r=Ga(t.scrollWidth,t.clientWidth,n.scrollWidth,n.clientWidth),s=Ga(t.scrollHeight,t.clientHeight,n.scrollHeight,n.clientHeight);let i=-e.scrollLeft+G1(t);const o=-e.scrollTop;return ua(n).direction==="rtl"&&(i+=Ga(t.clientWidth,n.clientWidth)-r),{width:r,height:s,x:i,y:o}}const zce=25;function Vce(t,e,n){n===void 0&&(n="viewport");const r=n==="layoutViewport",s=Xs(t),i=il(t),o=s.visualViewport;let l=i.clientWidth,c=i.clientHeight,d=0,f=0;if(o){const m=!EE()||e==="fixed";r?m||(d=-o.offsetLeft,f=-o.offsetTop):(l=o.width,c=o.height,m&&(d=o.offsetLeft,f=o.offsetTop))}if(G1(i)<=0){const m=i.ownerDocument,v=m.body,_=getComputedStyle(v),y=m.compatMode==="CSS1Compat"&&parseFloat(_.marginLeft)+parseFloat(_.marginRight)||0,w=Math.abs(i.clientWidth-v.clientWidth-y),x=getComputedStyle(i).scrollbarGutter==="stable both-edges"?w/2:w;x<=zce&&(l-=x)}return{width:l,height:c,x:d,y:f}}function Hce(t,e){const n=zu(t,!0,e==="fixed"),r=n.top+t.clientTop,s=n.left+t.clientLeft,i=Jd(t),o=t.clientWidth*i.x,l=t.clientHeight*i.y,c=s*i.x,d=r*i.y;return{width:o,height:l,x:c,y:d}}function nI(t,e,n){let r;if(e==="viewport"||e==="layoutViewport")r=Vce(t,n,e);else if(e==="document")r=Fce(il(t));else if(ca(e))r=Hce(e,n);else{const s=m$(t);r={x:e.x-s.x,y:e.y-s.y,width:e.width,height:e.height}}return l1(r)}function Uce(t,e){const n=e.get(t);if(n)return n;let r=im(t,[],!1).filter(l=>ca(l)&&nh(l)!=="body"),s=null;const i=ua(t).position==="fixed";let o=i?Fu(t):t;for(;ca(o)&&!sm(o);){const l=ua(o),c=kE(o),d=s?s.position:i?"fixed":"";!c&&(d==="fixed"||d==="absolute"&&l.position==="static")?r=r.filter(h=>h!==o):s=l,o=Fu(o)}return e.set(t,r),r}function Bce(t){let{element:e,boundary:n,rootBoundary:r,strategy:s}=t;const o=[...n==="clippingAncestors"?W1(e)?[]:Uce(e,this._c):[].concat(n),r],l=nI(e,o[0],s);let c=l.top,d=l.right,f=l.bottom,h=l.left;for(let m=1;m<o.length;m++){const v=nI(e,o[m],s);c=Ga(v.top,c),d=mc(v.right,d),f=mc(v.bottom,f),h=Ga(v.left,h)}return{width:d-h,height:f-c,x:h,y:c}}function Zce(t){const{width:e,height:n}=p$(t);return{width:e,height:n}}function Wce(t,e,n){const r=kc(e),s=il(e),i=n==="fixed",o=zu(t,!0,i,e);let l={scrollLeft:0,scrollTop:0};const c=Ka(0);if((r||!i)&&((nh(e)!=="body"||Z1(s))&&(l=q1(e)),r)){const m=zu(e,!0,i,e);c.x=m.x+e.clientLeft,c.y=m.y+e.clientTop}!r&&s&&(c.x=G1(s));const d=s&&!r&&!i?g$(s,l):Ka(0),f=o.left+l.scrollLeft-c.x-d.x,h=o.top+l.scrollTop-c.y-d.y;return{x:f,y:h,width:o.width,height:o.height}}function _w(t){return ua(t).position==="static"}function rI(t,e){if(!kc(t)||ua(t).position==="fixed")return null;if(e)return e(t);let n=t.offsetParent;return il(t)===n&&(n=n.ownerDocument.body),n}function v$(t,e){const n=Xs(t);if(W1(t))return n;if(!kc(t)){let s=Fu(t);for(;s&&!sm(s);){if(ca(s)&&!_w(s))return s;s=Fu(s)}return n}let r=rI(t,e);for(;r&&Ice(r)&&_w(r);)r=rI(r,e);return r&&sm(r)&&_w(r)&&!kE(r)?n:r||Nce(t)||n}const qce=async function(t){const e=this.getOffsetParent||v$,n=this.getDimensions,r=await n(t.floating);return{reference:Wce(t.reference,await e(t.floating),t.strategy),floating:{x:0,y:0,width:r.width,height:r.height}}};function Gce(t){return ua(t).direction==="rtl"}const Kce={convertOffsetParentRelativeRectToViewportRelativeRect:$ce,getDocumentElement:il,getClippingRect:Bce,getOffsetParent:v$,getElementRects:qce,getClientRects:jce,getDimensions:Zce,getScale:Jd,isElement:ca,isRTL:Gce};function y$(t,e){return t.x===e.x&&t.y===e.y&&t.width===e.width&&t.height===e.height}function Yce(t,e,n){let r=null,s;const i=il(t);function o(){var f;clearTimeout(s),(f=r)==null||f.disconnect(),r=null}function l(f,h){f===void 0&&(f=!1),h===void 0&&(h=1),o();const m=t.getBoundingClientRect(),{left:v,top:_,width:y,height:w}=m;if(f||e(),!y||!w)return;const x=vg(_),k=vg(i.clientWidth-(v+y)),P=vg(i.clientHeight-(_+w)),C=vg(v),O={rootMargin:-x+"px "+-k+"px "+-P+"px "+-C+"px",threshold:Ga(0,mc(1,h))||1};let I=!0;function R(N){const L=N[0].intersectionRatio;if(!y$(m,t.getBoundingClientRect()))return l();if(L!==h){if(!I)return l();L?l(!1,L):s=setTimeout(()=>{l(!1,1e-7)},1e3)}I=!1}try{r=new IntersectionObserver(R,{...O,root:i.ownerDocument})}catch{r=new IntersectionObserver(R,O)}r.observe(t)}const c=Xs(t),d=()=>l(n);return c.addEventListener("resize",d),l(!0),()=>{c.removeEventListener("resize",d),o()}}function Xce(t,e,n,r){r===void 0&&(r={});const{ancestorScroll:s=!0,ancestorResize:i=!0,elementResize:o=typeof ResizeObserver=="function",layoutShift:l=typeof IntersectionObserver=="function",animationFrame:c=!1}=r,d=CE(t),f=s||i?[...d?im(d):[],...e?im(e):[]]:[];f.forEach(x=>{s&&x.addEventListener("scroll",n),i&&x.addEventListener("resize",n)});const h=d&&l?Yce(d,n,i):null;let m=-1,v=null;o&&(v=new ResizeObserver(x=>{let[k]=x;k&&k.target===d&&v&&e&&(v.unobserve(e),cancelAnimationFrame(m),m=requestAnimationFrame(()=>{var P;(P=v)==null||P.observe(e)})),n()}),d&&!c&&v.observe(d),e&&v.observe(e));let _,y=c?zu(t):null;c&&w();function w(){const x=zu(t);y&&!y$(y,x)&&n(),y=x,_=requestAnimationFrame(w)}return n(),()=>{var x;f.forEach(k=>{s&&k.removeEventListener("scroll",n),i&&k.removeEventListener("resize",n)}),h==null||h(),(x=v)==null||x.disconnect(),v=null,c&&cancelAnimationFrame(_)}}const Qce=Pce,Jce=Ace,eue=kce,tue=Rce,nue=Ece,sI=Sce,rue=Tce,sue=(t,e,n)=>{const r=new Map,s=n??{},i={...Kce,...s.platform,_c:r};return xce(t,e,{...s,platform:i})};var iue=typeof document<"u",oue=function(){},Xg=iue?g.useLayoutEffect:oue;function c1(t,e){if(t===e)return!0;if(typeof t!=typeof e)return!1;if(typeof t=="function"&&t.toString()===e.toString())return!0;let n,r,s;if(t&&e&&typeof t=="object"){if(Array.isArray(t)){if(n=t.length,n!==e.length)return!1;for(r=n;r--!==0;)if(!c1(t[r],e[r]))return!1;return!0}if(s=Object.keys(t),n=s.length,n!==Object.keys(e).length)return!1;for(r=n;r--!==0;)if(!{}.hasOwnProperty.call(e,s[r]))return!1;for(r=n;r--!==0;){const i=s[r];if(!(i==="_owner"&&t.$$typeof)&&!c1(t[i],e[i]))return!1}return!0}return t!==t&&e!==e}function _$(t){return typeof window>"u"?1:(t.ownerDocument.defaultView||window).devicePixelRatio||1}function iI(t,e){const n=_$(t);return Math.round(e*n)/n}function ww(t){const e=g.useRef(t);return Xg(()=>{e.current=t}),e}function aue(t){t===void 0&&(t={});const{placement:e="bottom",strategy:n="absolute",middleware:r=[],platform:s,elements:{reference:i,floating:o}={},transform:l=!0,whileElementsMounted:c,open:d}=t,[f,h]=g.useState({x:0,y:0,strategy:n,placement:e,middlewareData:{},isPositioned:!1}),[m,v]=g.useState(r);c1(m,r)||v(r);const[_,y]=g.useState(null),[w,x]=g.useState(null),k=g.useCallback(V=>{V!==O.current&&(O.current=V,y(V))},[]),P=g.useCallback(V=>{V!==I.current&&(I.current=V,x(V))},[]),C=i||_,T=o||w,O=g.useRef(null),I=g.useRef(null),R=g.useRef(f),N=c!=null,L=ww(c),z=ww(s),$=ww(d),G=g.useCallback(()=>{if(!O.current||!I.current)return;const V={placement:e,strategy:n,middleware:m};z.current&&(V.platform=z.current),sue(O.current,I.current,V).then(Q=>{const U={...Q,isPositioned:$.current!==!1};X.current&&!c1(R.current,U)&&(R.current=U,Lm.flushSync(()=>{h(U)}))})},[m,e,n,z,$]);Xg(()=>{d===!1&&R.current.isPositioned&&(R.current.isPositioned=!1,h(V=>({...V,isPositioned:!1})))},[d]);const X=g.useRef(!1);Xg(()=>(X.current=!0,()=>{X.current=!1}),[]),Xg(()=>{if(C&&(O.current=C),T&&(I.current=T),C&&T){if(L.current)return L.current(C,T,G);G()}},[C,T,G,L,N]);const q=g.useMemo(()=>({reference:O,floating:I,setReference:k,setFloating:P}),[k,P]),H=g.useMemo(()=>({reference:C,floating:T}),[C,T]),ee=g.useMemo(()=>{const V={position:n,left:0,top:0};if(!H.floating)return V;const Q=iI(H.floating,f.x),U=iI(H.floating,f.y);return l?{...V,transform:"translate("+Q+"px, "+U+"px)",..._$(H.floating)>=1.5&&{willChange:"transform"}}:{position:n,left:Q,top:U}},[n,l,H.floating,f.x,f.y]);return g.useMemo(()=>({...f,update:G,refs:q,elements:H,floatingStyles:ee}),[f,G,q,H,ee])}const lue=t=>{function e(n){return{}.hasOwnProperty.call(n,"current")}return{name:"arrow",options:t,fn(n){const{element:r,padding:s}=typeof t=="function"?t(n):t;return r&&e(r)?r.current!=null?sI({element:r.current,padding:s}).fn(n):{}:r?sI({element:r,padding:s}).fn(n):{}}}},cue=(t,e)=>{const n=Qce(t);return{name:n.name,fn:n.fn,options:[t,e]}},uue=(t,e)=>{const n=Jce(t);return{name:n.name,fn:n.fn,options:[t,e]}},due=(t,e)=>({fn:rue(t).fn,options:[t,e]}),fue=(t,e)=>{const n=eue(t);return{name:n.name,fn:n.fn,options:[t,e]}},hue=(t,e)=>{const n=tue(t);return{name:n.name,fn:n.fn,options:[t,e]}},pue=(t,e)=>{const n=nue(t);return{name:n.name,fn:n.fn,options:[t,e]}},mue=(t,e)=>{const n=lue(t);return{name:n.name,fn:n.fn,options:[t,e]}};var gue=Object.defineProperty,vue=(t,e)=>gue(t,"name",{value:e,configurable:!0});function PE(t){const[e,n]=g.useState(void 0);return xs(()=>{if(t){n({width:t.offsetWidth,height:t.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 l,c;if("borderBoxSize"in o){const d=o.borderBoxSize,f=Array.isArray(d)?d[0]:d;l=f.inlineSize,c=f.blockSize}else l=t.offsetWidth,c=t.offsetHeight;n({width:l,height:c})})});return s.observe(t,{box:"border-box"}),()=>{window.cancelAnimationFrame(r),s.unobserve(t)}}else n(void 0)},[t]),e}vue(PE,"useSize");var yue=Object.defineProperty,rc=(t,e)=>yue(t,"name",{value:e,configurable:!0}),oI={Partial:"partial"},aI={Optimized:"optimized",Always:"always"},w$="Popper",[b$,K1]=fa(w$),[_ue,x$]=b$(w$),S$=rc(t=>{const{__scopePopper:e,children:n}=t,[r,s]=g.useState(null),[i,o]=g.useState(void 0);return S.jsx(_ue,{scope:e,anchor:r,onAnchorChange:s,placementState:i,setPlacementState:o,children:n})},"Popper"),wue="PopperAnchor",k$=g.forwardRef(rc(function(e,n){const{__scopePopper:r,virtualRef:s,...i}=e,o=x$(wue,r),l=g.useRef(null),c=o.onAnchorChange,d=g.useCallback(y=>{l.current=y,y&&c(y)},[c]),f=yn(n,d),h=g.useRef(null);g.useEffect(()=>{if(!s)return;const y=h.current;h.current=s.current,y!==h.current&&c(h.current)});const m=o.placementState&&Y1(o.placementState),v=m==null?void 0:m[0],_=m==null?void 0:m[1];return s?null:S.jsx(tr.div,{"data-radix-popper-side":v,"data-radix-popper-align":_,...i,ref:f})},"PopperAnchor")),E$="PopperContent",[bue,Y1e]=b$(E$),C$=g.forwardRef(rc(function(e,n){var re,Se,ze,ke,gt,on,Tt;const{__scopePopper:r,side:s="bottom",sideOffset:i=0,align:o="center",alignOffset:l=0,arrowPadding:c=0,avoidCollisions:d=!0,collisionBoundary:f=[],collisionPadding:h=0,sticky:m=oI.Partial,hideWhenDetached:v=!1,updatePositionStrategy:_=aI.Optimized,onPlaced:y,...w}=e,x=x$(E$,r),[k,P]=g.useState(null),C=yn(n,P),[T,O]=g.useState(null),I=PE(T),R=(I==null?void 0:I.width)??0,N=(I==null?void 0:I.height)??0,L=s+(o!=="center"?"-"+o:""),z=typeof h=="number"?h:{top:0,right:0,bottom:0,left:0,...h},$=Array.isArray(f)?f:[f],G=$.length>0,X={padding:z,boundary:$.filter(P$),altBoundary:G},{refs:q,floatingStyles:H,placement:ee,isPositioned:V,middlewareData:Q}=aue({strategy:"fixed",placement:L,whileElementsMounted:rc((...$t)=>Xce(...$t,{animationFrame:_===aI.Always}),"whileElementsMounted"),elements:{reference:x.anchor},middleware:[cue({mainAxis:i+N,alignmentAxis:l}),d&&uue({mainAxis:!0,crossAxis:!1,...m===oI.Partial?{limiter:due()}:{},...X}),d&&fue({...X}),hue({...X,apply:rc(({elements:$t,rects:xt,availableWidth:An,availableHeight:Be})=>{const{width:je,height:Ie}=xt.reference,nt=$t.floating.style;nt.setProperty("--radix-popper-available-width",`${An}px`),nt.setProperty("--radix-popper-available-height",`${Be}px`),nt.setProperty("--radix-popper-anchor-width",`${je}px`),nt.setProperty("--radix-popper-anchor-height",`${Ie}px`)},"apply")}),T&&mue({element:T,padding:c}),xue({arrowWidth:R,arrowHeight:N}),v&&pue(G?{strategy:"referenceHidden",...X}:{strategy:"referenceHidden",padding:X.padding,altBoundary:X.altBoundary})]}),U=x.setPlacementState;xs(()=>(U(ee),()=>{U(void 0)}),[ee,U]);const[D,K]=Y1(ee),de=ju(y);xs(()=>{V&&(de==null||de())},[V,de]);const ie=(re=Q.arrow)==null?void 0:re.x,ce=(Se=Q.arrow)==null?void 0:Se.y,he=((ze=Q.arrow)==null?void 0:ze.centerOffset)!==0,[xe,oe]=g.useState();return xs(()=>{k&&oe(window.getComputedStyle(k).zIndex)},[k]),S.jsx("div",{ref:q.setFloating,"data-radix-popper-content-wrapper":"",style:{...H,transform:V?H.transform:"translate(0, -200%)",minWidth:"max-content",zIndex:xe,"--radix-popper-transform-origin":[(ke=Q.transformOrigin)==null?void 0:ke.x,(gt=Q.transformOrigin)==null?void 0:gt.y].join(" "),...((on=Q.hide)==null?void 0:on.referenceHidden)&&{visibility:"hidden",pointerEvents:"none"}},dir:e.dir,children:S.jsx(bue,{scope:r,placedSide:D,placedAlign:K,onArrowChange:O,arrowX:ie,arrowY:ce,shouldHideArrow:he,children:S.jsx(tr.div,{"data-side":D,"data-align":K,...w,ref:C,style:{...w.style,animation:V?(Tt=w.style)==null?void 0:Tt.animation:"none"}})})})},"PopperContent"));function P$(t){return t!==null}rc(P$,"isNotNull");var xue=rc(t=>({name:"transformOrigin",options:t,fn(e){var w,x,k;const{placement:n,rects:r,middlewareData:s}=e,o=((w=s.arrow)==null?void 0:w.centerOffset)!==0,l=o?0:t.arrowWidth,c=o?0:t.arrowHeight,[d,f]=Y1(n),h={start:"0%",center:"50%",end:"100%"}[f],m=(((x=s.arrow)==null?void 0:x.x)??0)+l/2,v=(((k=s.arrow)==null?void 0:k.y)??0)+c/2;let _="",y="";return d==="bottom"?(_=o?h:`${m}px`,y=`${-c}px`):d==="top"?(_=o?h:`${m}px`,y=`${r.floating.height+c}px`):d==="right"?(_=`${-c}px`,y=o?h:`${v}px`):d==="left"&&(_=`${r.floating.width+c}px`,y=o?h:`${v}px`),{data:{x:_,y}}}}),"transformOrigin");function Y1(t){const[e,n="center"]=t.split("-");return[e,n]}rc(Y1,"getSideAndAlignFromPlacement");var Sue=Object.defineProperty,kue=(t,e)=>Sue(t,"name",{value:e,configurable:!0}),AE=g.forwardRef(kue(function(e,n){var c;const{container:r,...s}=e,[i,o]=g.useState(!1);xs(()=>o(!0),[]);const l=r||i&&((c=globalThis==null?void 0:globalThis.document)==null?void 0:c.body);return l?Lm.createPortal(S.jsx(tr.div,{...s,ref:n}),l):null},"Portal")),Eue=Object.defineProperty,tl=(t,e)=>Eue(t,"name",{value:e,configurable:!0});function A$(t,e){return g.useReducer((n,r)=>e[n][r]??n,t)}tl(A$,"useStateMachine");var Ec=tl(t=>{const{present:e,children:n}=t,r=T$(e),s=typeof n=="function"?n({present:r.isPresent}):g.Children.only(n),i=R$(r.ref,I$(s));return typeof n=="function"||r.isPresent?g.cloneElement(s,{ref:i}):null},"Presence");function T$(t){const[e,n]=g.useState(),r=g.useRef(null),s=g.useRef(t),i=g.useRef("none"),o=g.useRef(void 0),l=t?"mounted":"unmounted",[c,d]=A$(l,{mounted:{UNMOUNT:"unmounted",ANIMATION_OUT:"unmountSuspended"},unmountSuspended:{MOUNT:"mounted",ANIMATION_END:"unmounted"},unmounted:{MOUNT:"mounted"}});return g.useEffect(()=>{c==="mounted"?(i.current=o.current??Dd(r.current),o.current=void 0):i.current="none"},[c]),xs(()=>{const f=r.current,h=s.current;if(h!==t){const v=i.current,_=Dd(f);t?(o.current=_,d("MOUNT")):_==="none"||(f==null?void 0:f.display)==="none"?d("UNMOUNT"):d(h&&v!==_?"ANIMATION_OUT":"UNMOUNT"),s.current=t}},[t,d]),xs(()=>{if(e){let f;const h=e.ownerDocument.defaultView??window,m=tl(_=>{const w=Dd(r.current).includes(CSS.escape(_.animationName));if(_.target===e&&w&&(d("ANIMATION_END"),!s.current)){const x=e.style.animationFillMode;e.style.animationFillMode="forwards",f=h.setTimeout(()=>{e.style.animationFillMode==="forwards"&&(e.style.animationFillMode=x)})}},"handleAnimationEnd"),v=tl(_=>{_.target===e&&(i.current=Dd(r.current))},"handleAnimationStart");return e.addEventListener("animationstart",v),e.addEventListener("animationcancel",m),e.addEventListener("animationend",m),()=>{h.clearTimeout(f),e.removeEventListener("animationstart",v),e.removeEventListener("animationcancel",m),e.removeEventListener("animationend",m)}}else d("ANIMATION_END")},[e,d]),{isPresent:["mounted","unmountSuspended"].includes(c),ref:g.useCallback(f=>{if(f){const h=getComputedStyle(f);r.current=h,o.current=Dd(h)}else r.current=null;n(f)},[])}}tl(T$,"usePresence");function Xx(t,e){if(typeof t=="function")return t(e);t!=null&&(t.current=e)}tl(Xx,"setRef");function R$(...t){const e=g.useRef(t);return e.current=t,g.useCallback(n=>{const r=e.current;let s=!1;const i=r.map(o=>{const l=Xx(o,n);return!s&&typeof l=="function"&&(s=!0),l});if(s)return()=>{for(let o=0;o<i.length;o++){const l=i[o];typeof l=="function"?l():Xx(r[o],null)}}},[])}tl(R$,"useStableComposedRefs");function Dd(t){return(t==null?void 0:t.animationName)||"none"}tl(Dd,"getAnimationName");function I$(t){var r,s;let e=(r=Object.getOwnPropertyDescriptor(t.props,"ref"))==null?void 0:r.get,n=e&&"isReactWarning"in e&&e.isReactWarning;return n?t.ref:(e=(s=Object.getOwnPropertyDescriptor(t,"ref"))==null?void 0:s.get,n=e&&"isReactWarning"in e&&e.isReactWarning,n?t.props.ref:t.props.ref||t.ref)}tl(I$,"getElementRef");var Cue=Object.defineProperty,Pue=(t,e)=>Cue(t,"name",{value:e,configurable:!0}),lI=qf[" useEffectEvent ".trim().toString()],cI=qf[" useInsertionEffect ".trim().toString()];function O$(t){if(typeof lI=="function")return lI(t);const e=g.useRef(()=>{throw new Error("Cannot call an event handler while rendering.")});return typeof cI=="function"?cI(()=>{e.current=t}):xs(()=>{e.current=t}),g.useMemo(()=>((...n)=>{var r;return(r=e.current)==null?void 0:r.call(e,...n)}),[])}Pue(O$,"useEffectEvent");var Aue=Object.defineProperty,$m=(t,e)=>Aue(t,"name",{value:e,configurable:!0}),Tue=qf[" useInsertionEffect ".trim().toString()]||xs;function Cc({prop:t,defaultProp:e,onChange:n=$m(()=>{},"onChange"),caller:r}){const[s,i,o]=M$({defaultProp:e,onChange:n}),l=t!==void 0,c=l?t:s,d=g.useCallback(f=>{var h;if(l){const m=N$(f)?f(t):f;m!==t&&((h=o.current)==null||h.call(o,m))}else i(f)},[l,t,i,o]);return[c,d]}$m(Cc,"useControllableState");function M$({defaultProp:t,onChange:e}){const[n,r]=g.useState(t),s=g.useRef(n),i=g.useRef(e);return Tue(()=>{i.current=e},[e]),g.useEffect(()=>{var o;s.current!==n&&((o=i.current)==null||o.call(i,n),s.current=n)},[n,s]),[n,r,i]}$m(M$,"useUncontrolledState");function N$(t){return typeof t=="function"}$m(N$,"isFunction");var uI=Symbol("RADIX:SYNC_STATE");function Rue(t,e,n,r){const{prop:s,defaultProp:i,onChange:o,caller:l}=e,c=s!==void 0,d=O$(o),f=[{...n,state:i}];r&&f.push(r);const[h,m]=g.useReducer((w,x)=>{if(x.type===uI)return{...w,state:x.state};const k=t(w,x);return c&&!Object.is(k.state,w.state)&&d(k.state),k},...f),v=h.state,_=g.useRef(v);g.useEffect(()=>{_.current!==v&&(_.current=v,c||d(v))},[v,_,c]);const y=g.useMemo(()=>s!==void 0?{...h,state:s}:h,[h,s]);return g.useEffect(()=>{c&&!Object.is(s,h.state)&&m({type:uI,state:s})},[s,h.state,c]),[y,m]}$m(Rue,"useControllableStateReducer");var Iue=Object.defineProperty,Oue=(t,e)=>Iue(t,"name",{value:e,configurable:!0}),Mue=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"}),Nue=g.forwardRef(Oue(function(e,n){return S.jsx(tr.span,{...e,ref:n,style:{...Mue,...e.style}})},"VisuallyHidden")),Lue=Object.defineProperty,Ir=(t,e)=>Lue(t,"name",{value:e,configurable:!0}),[TE,X1e]=fa("Tooltip",[K1]),RE=K1(),Due="TooltipProvider",$ue=700,Qx="tooltip.open",[jue,IE]=TE(Due),Fue=Ir(t=>{const{__scopeTooltip:e,delayDuration:n=$ue,skipDelayDuration:r=300,disableHoverableContent:s=!1,children:i}=t,o=g.useRef(!0),l=g.useRef(!1),c=g.useRef(0);return g.useEffect(()=>{const d=c.current;return()=>window.clearTimeout(d)},[]),S.jsx(jue,{scope:e,isOpenDelayedRef:o,delayDuration:n,onOpen:g.useCallback(()=>{r<=0||(window.clearTimeout(c.current),o.current=!1)},[r]),onClose:g.useCallback(()=>{r<=0||(window.clearTimeout(c.current),c.current=window.setTimeout(()=>o.current=!0,r))},[r]),isPointerInTransitRef:l,onPointerInTransitChange:g.useCallback(d=>{l.current=d},[]),disableHoverableContent:s,children:i})},"TooltipProvider"),Jx="Tooltip",[zue,jm]=TE(Jx),Vue=Ir(t=>{const{__scopeTooltip:e,children:n,open:r,defaultOpen:s,onOpenChange:i,disableHoverableContent:o,delayDuration:l}=t,c=IE(Jx,t.__scopeTooltip),d=RE(e),[f,h]=g.useState(null),[m,v]=g.useState(void 0),_=sa(),y=g.useRef(0),w=o??c.disableHoverableContent,x=l??c.delayDuration,k=g.useRef(!1),[P,C]=Cc({prop:r,defaultProp:s??!1,onChange:Ir(L=>{L?(c.onOpen(),document.dispatchEvent(new CustomEvent(Qx))):c.onClose(),i==null||i(L)},"onChange"),caller:Jx}),T=g.useMemo(()=>P?k.current?"delayed-open":"instant-open":"closed",[P]),O=g.useCallback(()=>{window.clearTimeout(y.current),y.current=0,k.current=!1,C(!0)},[C]),I=g.useCallback(()=>{window.clearTimeout(y.current),y.current=0,C(!1)},[C]),R=g.useCallback(()=>{window.clearTimeout(y.current),y.current=window.setTimeout(()=>{k.current=!0,C(!0),y.current=0},x)},[x,C]);g.useEffect(()=>()=>{y.current&&(window.clearTimeout(y.current),y.current=0)},[]);const N=m??_;return S.jsx(S$,{...d,children:S.jsx(zue,{scope:e,contentId:N,setContentId:v,open:P,stateAttribute:T,trigger:f,onTriggerChange:h,onTriggerEnter:g.useCallback(()=>{c.isOpenDelayedRef.current?R():O()},[c.isOpenDelayedRef,R,O]),onTriggerLeave:g.useCallback(()=>{w?I():(window.clearTimeout(y.current),y.current=0)},[I,w]),onOpen:O,onClose:I,disableHoverableContent:w,children:n})})},"Tooltip"),dI="TooltipTrigger",Hue=g.forwardRef(Ir(function(e,n){const{__scopeTooltip:r,"aria-describedby":s,...i}=e,o=jm(dI,r),l=IE(dI,r),c=RE(r),d=g.useRef(null),f=yn(n,d,o.onTriggerChange),h=g.useRef(!1),m=g.useRef(!1),v=g.useCallback(()=>h.current=!1,[]);return g.useEffect(()=>()=>document.removeEventListener("pointerup",v),[v]),S.jsx(k$,{asChild:!0,...c,children:S.jsx(tr.button,{"aria-describedby":o.open?U$(s,o.contentId):s,"data-state":o.stateAttribute,...i,ref:f,onPointerMove:vn(e.onPointerMove,_=>{_.pointerType!=="touch"&&!m.current&&!l.isPointerInTransitRef.current&&(o.onTriggerEnter(),m.current=!0)}),onPointerLeave:vn(e.onPointerLeave,()=>{o.onTriggerLeave(),m.current=!1}),onPointerDown:vn(e.onPointerDown,()=>{o.open&&o.onClose(),h.current=!0,document.addEventListener("pointerup",v,{once:!0})}),onFocus:vn(e.onFocus,()=>{h.current||o.onOpen()}),onBlur:vn(e.onBlur,o.onClose),onClick:vn(e.onClick,o.onClose)})})},"TooltipTrigger")),L$="TooltipPortal",[Uue,Bue]=TE(L$,{forceMount:void 0}),Zue=Ir(t=>{const{__scopeTooltip:e,forceMount:n,children:r,container:s}=t,i=jm(L$,e);return S.jsx(Uue,{scope:e,forceMount:n,children:S.jsx(Ec,{present:n||i.open,children:S.jsx(AE,{asChild:!0,container:s,children:r})})})},"TooltipPortal"),om="TooltipContent",Wue=g.forwardRef(Ir(function(e,n){const r=Bue(om,e.__scopeTooltip),{forceMount:s=r.forceMount,side:i="top",...o}=e,l=jm(om,e.__scopeTooltip);return S.jsx(Ec,{present:s||l.open,children:l.disableHoverableContent?S.jsx(D$,{side:i,...o,ref:n}):S.jsx(que,{side:i,...o,ref:n})})},"TooltipContent")),que=g.forwardRef(Ir(function(e,n){const r=jm(om,e.__scopeTooltip),s=IE(om,e.__scopeTooltip),i=g.useRef(null),o=yn(n,i),[l,c]=g.useState(null),{trigger:d,onClose:f}=r,h=i.current,{onPointerInTransitChange:m}=s,v=g.useCallback(()=>{c(null),m(!1)},[m]),_=g.useCallback((y,w)=>{const x=y.currentTarget,k={x:y.clientX,y:y.clientY},P=$$(k,x.getBoundingClientRect()),C=j$(k,P),T=F$(w.getBoundingClientRect()),O=V$([...C,...T]);c(O),m(!0)},[m]);return g.useEffect(()=>()=>v(),[v]),g.useEffect(()=>{if(d&&h){const y=Ir(x=>_(x,h),"handleTriggerLeave"),w=Ir(x=>_(x,d),"handleContentLeave");return d.addEventListener("pointerleave",y),h.addEventListener("pointerleave",w),()=>{d.removeEventListener("pointerleave",y),h.removeEventListener("pointerleave",w)}}},[d,h,_,v]),g.useEffect(()=>{if(l){const y=Ir(w=>{const x=w.target,k={x:w.clientX,y:w.clientY},P=(d==null?void 0:d.contains(x))||(h==null?void 0:h.contains(x)),C=!z$(k,l);P?v():C&&(v(),f())},"handleTrackPointerGrace");return document.addEventListener("pointermove",y),()=>document.removeEventListener("pointermove",y)}},[d,h,l,f,v]),S.jsx(D$,{...e,ref:o})},"TooltipContentHoverable")),Gue=UD("TooltipContent"),D$=g.forwardRef(Ir(function(e,n){const{__scopeTooltip:r,children:s,"aria-label":i,id:o,onEscapeKeyDown:l,onPointerDownOutside:c,...d}=e,f=jm(om,r),h=RE(r),{onClose:m}=f,[v,_]=g.useState(null),y=yn(n,_);_E(v),g.useEffect(()=>(document.addEventListener(Qx,m),()=>document.removeEventListener(Qx,m)),[m]),g.useEffect(()=>{if(f.trigger){const x=Ir(k=>{k.target instanceof Node&&k.target.contains(f.trigger)&&m()},"handleScroll");return window.addEventListener("scroll",x,{capture:!0}),()=>window.removeEventListener("scroll",x,{capture:!0})}},[f.trigger,m]);const{setContentId:w}=f;return xs(()=>(w(o),()=>{w(void 0)}),[o,w]),S.jsx(mE,{asChild:!0,disableOutsidePointerEvents:!1,onEscapeKeyDown:l,onPointerDownOutside:c,onFocusOutside:x=>x.preventDefault(),onDismiss:m,children:S.jsxs(C$,{"data-state":f.stateAttribute,role:i?void 0:"tooltip",id:i?void 0:f.contentId,...h,...d,ref:y,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:[S.jsx(Gue,{children:s}),i?S.jsx(Nue,{id:f.contentId,role:"tooltip",children:i}):null]})})},"TooltipContentImpl"));function $$(t,e){const n=Math.abs(e.top-t.y),r=Math.abs(e.bottom-t.y),s=Math.abs(e.right-t.x),i=Math.abs(e.left-t.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")}}Ir($$,"getExitSideFromRect");function j$(t,e,n=5){const r=[];switch(e){case"top":r.push({x:t.x-n,y:t.y+n},{x:t.x+n,y:t.y+n});break;case"bottom":r.push({x:t.x-n,y:t.y-n},{x:t.x+n,y:t.y-n});break;case"left":r.push({x:t.x+n,y:t.y-n},{x:t.x+n,y:t.y+n});break;case"right":r.push({x:t.x-n,y:t.y-n},{x:t.x-n,y:t.y+n});break}return r}Ir(j$,"getPaddedExitPoints");function F$(t){const{top:e,right:n,bottom:r,left:s}=t;return[{x:s,y:e},{x:n,y:e},{x:n,y:r},{x:s,y:r}]}Ir(F$,"getPointsFromRect");function z$(t,e){const{x:n,y:r}=t;let s=!1;for(let i=0,o=e.length-1;i<e.length;o=i++){const l=e[i],c=e[o],d=l.x,f=l.y,h=c.x,m=c.y;f>r!=m>r&&n<(h-d)*(r-f)/(m-f)+d&&(s=!s)}return s}Ir(z$,"isPointInPolygon");function V$(t){const e=t.slice();return e.sort((n,r)=>n.x<r.x?-1:n.x>r.x?1:n.y<r.y?-1:n.y>r.y?1:0),H$(e)}Ir(V$,"getHull");function H$(t){if(t.length<=1)return t.slice();const e=[];for(let r=0;r<t.length;r++){const s=t[r];for(;e.length>=2;){const i=e[e.length-1],o=e[e.length-2];if((i.x-o.x)*(s.y-o.y)>=(i.y-o.y)*(s.x-o.x))e.pop();else break}e.push(s)}e.pop();const n=[];for(let r=t.length-1;r>=0;r--){const s=t[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(),e.length===1&&n.length===1&&e[0].x===n[0].x&&e[0].y===n[0].y?e:e.concat(n)}Ir(H$,"getHullPresorted");function U$(...t){const e=new Set;for(const n of t)if(typeof n=="string")for(const r of String(n).trim().split(/\s+/))r&&e.add(r);return e.size>0?Array.from(e).join(" "):void 0}Ir(U$,"concatAriaDescribedby");const Op={normal:"'wght' 400",medium:"'wght' 450",semibold:"'wght' 550"},B$=g.createContext(null);function Z$({value:t,children:e}){return S.jsx(B$.Provider,{value:t,children:e})}function Kue(t){switch(t){case"top":return{y:4};case"bottom":return{y:-4};case"left":return{x:4};case"right":return{x:-4}}}function OE({content:t,children:e,side:n="top",sideOffset:r=8,delayDuration:s=200,className:i,forceOpen:o,onOpenChange:l}){const[c,d]=g.useState(!1),f=o!==void 0?o:c,[h,m]=g.useState(!1),v=Dm(),_=g.useContext(B$);g.useEffect(()=>{f&&m(!0)},[f]);const y=()=>{f||m(!1)},w=Kue(n);return S.jsx(Fue,{delayDuration:s,children:S.jsxs(Vue,{open:f,onOpenChange:x=>{d(x),l==null||l(x)},children:[S.jsx(Hue,{asChild:!0,children:e}),h&&S.jsx(Zue,{forceMount:!0,container:_??void 0,children:S.jsx(Wue,{side:n,sideOffset:r,forceMount:!0,className:"z-tooltip",children:S.jsx(qa.div,{className:pn("bg-neutral-900 text-white text-[12px] px-2 py-1 border border-white/10 shadow-lg",v.bg,i),style:{fontVariationSettings:Op.medium},initial:{opacity:0,scale:.8,...w},animate:{opacity:f?1:0,scale:f?1:.9,x:0,y:0},transition:f?{type:"spring",duration:.34,bounce:.55}:{duration:.1},onAnimationComplete:y,children:t})})})]})})}const ia=g.forwardRef(({title:t,shortcut:e,...n},r)=>{const s=S.jsx(DD,{ref:r,...n});return t?S.jsx(OE,{content:S.jsxs("div",{className:"flex flex-row items-center gap-2",children:[S.jsx("span",{children:t}),e?S.jsx("span",{className:"rounded bg-white/15 px-1.5 py-0.5 text-[11px]",children:e}):null]}),children:s}):s});ia.displayName="Button";var Yue=Object.defineProperty,ME=(t,e)=>Yue(t,"name",{value:e,configurable:!0}),yg=0,zo=null;function Xue(t){return X1(),t.children}ME(Xue,"FocusGuards");function X1(){g.useEffect(()=>{zo||(zo={start:eS(),end:eS()});const{start:t,end:e}=zo;return document.body.firstElementChild!==t&&document.body.insertAdjacentElement("afterbegin",t),document.body.lastElementChild!==e&&document.body.insertAdjacentElement("beforeend",e),yg++,()=>{yg===1&&(zo==null||zo.start.remove(),zo==null||zo.end.remove(),zo=null),yg=Math.max(0,yg-1)}},[])}ME(X1,"useFocusGuards");function eS(){const t=document.createElement("span");return t.setAttribute("data-radix-focus-guard",""),t.tabIndex=0,t.style.outline="none",t.style.opacity="0",t.style.position="fixed",t.style.pointerEvents="none",t}ME(eS,"createFocusGuard");var Yo=function(){return Yo=Object.assign||function(e){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)&&(e[i]=n[i])}return e},Yo.apply(this,arguments)};function W$(t,e){var n={};for(var r in t)Object.prototype.hasOwnProperty.call(t,r)&&e.indexOf(r)<0&&(n[r]=t[r]);if(t!=null&&typeof Object.getOwnPropertySymbols=="function")for(var s=0,r=Object.getOwnPropertySymbols(t);s<r.length;s++)e.indexOf(r[s])<0&&Object.prototype.propertyIsEnumerable.call(t,r[s])&&(n[r[s]]=t[r[s]]);return n}function Que(t,e,n){if(n||arguments.length===2)for(var r=0,s=e.length,i;r<s;r++)(i||!(r in e))&&(i||(i=Array.prototype.slice.call(e,0,r)),i[r]=e[r]);return t.concat(i||Array.prototype.slice.call(e))}var Qg="right-scroll-bar-position",Jg="width-before-scroll-bar",Jue="with-scroll-bars-hidden",ede="--removed-body-scroll-bar-size";function bw(t,e){return typeof t=="function"?t(e):t&&(t.current=e),t}function tde(t,e){var n=g.useState(function(){return{value:t,callback:e,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=e,n.facade}var nde=typeof window<"u"?g.useLayoutEffect:g.useEffect,fI=new WeakMap;function rde(t,e){var n=tde(null,function(r){return t.forEach(function(s){return bw(s,r)})});return nde(function(){var r=fI.get(n);if(r){var s=new Set(r),i=new Set(t),o=n.current;s.forEach(function(l){i.has(l)||bw(l,null)}),i.forEach(function(l){s.has(l)||bw(l,o)})}fI.set(n,t)},[t]),n}function sde(t){return t}function ide(t,e){e===void 0&&(e=sde);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]:t},useMedium:function(i){var o=e(i,r);return n.push(o),function(){n=n.filter(function(l){return l!==o})}},assignSyncMedium:function(i){for(r=!0;n.length;){var o=n;n=[],o.forEach(i)}n={push:function(l){return i(l)},filter:function(){return n}}},assignMedium:function(i){r=!0;var o=[];if(n.length){var l=n;n=[],l.forEach(i),o=n}var c=function(){var f=o;o=[],f.forEach(i)},d=function(){return Promise.resolve().then(c)};d(),n={push:function(f){o.push(f),d()},filter:function(f){return o=o.filter(f),n}}}};return s}function ode(t){t===void 0&&(t={});var e=ide(null);return e.options=Yo({async:!0,ssr:!1},t),e}var q$=function(t){var e=t.sideCar,n=W$(t,["sideCar"]);if(!e)throw new Error("Sidecar: please provide `sideCar` property to import the right car");var r=e.read();if(!r)throw new Error("Sidecar medium not found");return g.createElement(r,Yo({},n))};q$.isSideCarExport=!0;function ade(t,e){return t.useMedium(e),q$}var G$=ode(),xw=function(){},Q1=g.forwardRef(function(t,e){var n=g.useRef(null),r=g.useState({onScrollCapture:xw,onWheelCapture:xw,onTouchMoveCapture:xw}),s=r[0],i=r[1],o=t.forwardProps,l=t.children,c=t.className,d=t.removeScrollBar,f=t.enabled,h=t.shards,m=t.sideCar,v=t.noRelative,_=t.noIsolation,y=t.inert,w=t.allowPinchZoom,x=t.as,k=x===void 0?"div":x,P=t.gapMode,C=W$(t,["forwardProps","children","className","removeScrollBar","enabled","shards","sideCar","noRelative","noIsolation","inert","allowPinchZoom","as","gapMode"]),T=m,O=rde([n,e]),I=Yo(Yo({},C),s);return g.createElement(g.Fragment,null,f&&g.createElement(T,{sideCar:G$,removeScrollBar:d,shards:h,noRelative:v,noIsolation:_,inert:y,setCallbacks:i,allowPinchZoom:!!w,lockRef:n,gapMode:P}),o?g.cloneElement(g.Children.only(l),Yo(Yo({},I),{ref:O})):g.createElement(k,Yo({},I,{className:c,ref:O}),l))});Q1.defaultProps={enabled:!0,removeScrollBar:!0,inert:!1};Q1.classNames={fullWidth:Jg,zeroRight:Qg};var lde=function(){if(typeof __webpack_nonce__<"u")return __webpack_nonce__};function cde(){if(!document)return null;var t=document.createElement("style");t.type="text/css";var e=lde();return e&&t.setAttribute("nonce",e),t}function ude(t,e){t.styleSheet?t.styleSheet.cssText=e:t.appendChild(document.createTextNode(e))}function dde(t){var e=document.head||document.getElementsByTagName("head")[0];e.appendChild(t)}var fde=function(){var t=0,e=null;return{add:function(n){t==0&&(e=cde())&&(ude(e,n),dde(e)),t++},remove:function(){t--,!t&&e&&(e.parentNode&&e.parentNode.removeChild(e),e=null)}}},hde=function(){var t=fde();return function(e,n){g.useEffect(function(){return t.add(e),function(){t.remove()}},[e&&n])}},K$=function(){var t=hde(),e=function(n){var r=n.styles,s=n.dynamic;return t(r,s),null};return e},pde={left:0,top:0,right:0,gap:0},Sw=function(t){return parseInt(t||"",10)||0},mde=function(t){var e=window.getComputedStyle(document.body),n=e[t==="padding"?"paddingLeft":"marginLeft"],r=e[t==="padding"?"paddingTop":"marginTop"],s=e[t==="padding"?"paddingRight":"marginRight"];return[Sw(n),Sw(r),Sw(s)]},gde=function(t){if(t===void 0&&(t="margin"),typeof window>"u")return pde;var e=mde(t),n=document.documentElement.clientWidth,r=window.innerWidth;return{left:e[0],top:e[1],right:e[2],gap:Math.max(0,r-n+e[2]-e[0])}},vde=K$(),ef="data-scroll-locked",yde=function(t,e,n,r){var s=t.left,i=t.top,o=t.right,l=t.gap;return n===void 0&&(n="margin"),`
|
|
130
|
-
.`.concat(Jue,` {
|
|
131
|
-
overflow: hidden `).concat(r,`;
|
|
132
|
-
padding-right: `).concat(l,"px ").concat(r,`;
|
|
133
|
-
}
|
|
134
|
-
body[`).concat(ef,`] {
|
|
135
|
-
overflow: hidden `).concat(r,`;
|
|
136
|
-
overscroll-behavior: contain;
|
|
137
|
-
`).concat([e&&"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(l,"px ").concat(r,`;
|
|
144
|
-
`),n==="padding"&&"padding-right: ".concat(l,"px ").concat(r,";")].filter(Boolean).join(""),`
|
|
145
|
-
}
|
|
146
|
-
|
|
147
|
-
.`).concat(Qg,` {
|
|
148
|
-
right: `).concat(l,"px ").concat(r,`;
|
|
149
|
-
}
|
|
150
|
-
|
|
151
|
-
.`).concat(Jg,` {
|
|
152
|
-
margin-right: `).concat(l,"px ").concat(r,`;
|
|
153
|
-
}
|
|
154
|
-
|
|
155
|
-
.`).concat(Qg," .").concat(Qg,` {
|
|
156
|
-
right: 0 `).concat(r,`;
|
|
157
|
-
}
|
|
158
|
-
|
|
159
|
-
.`).concat(Jg," .").concat(Jg,` {
|
|
160
|
-
margin-right: 0 `).concat(r,`;
|
|
161
|
-
}
|
|
162
|
-
|
|
163
|
-
body[`).concat(ef,`] {
|
|
164
|
-
`).concat(ede,": ").concat(l,`px;
|
|
165
|
-
}
|
|
166
|
-
`)},hI=function(){var t=parseInt(document.body.getAttribute(ef)||"0",10);return isFinite(t)?t:0},_de=function(){g.useEffect(function(){return document.body.setAttribute(ef,(hI()+1).toString()),function(){var t=hI()-1;t<=0?document.body.removeAttribute(ef):document.body.setAttribute(ef,t.toString())}},[])},wde=function(t){var e=t.noRelative,n=t.noImportant,r=t.gapMode,s=r===void 0?"margin":r;_de();var i=g.useMemo(function(){return gde(s)},[s]);return g.createElement(vde,{styles:yde(i,!e,s,n?"":"!important")})},tS=!1;if(typeof window<"u")try{var _g=Object.defineProperty({},"passive",{get:function(){return tS=!0,!0}});window.addEventListener("test",_g,_g),window.removeEventListener("test",_g,_g)}catch{tS=!1}var Ad=tS?{passive:!1}:!1,bde=function(t){return t.tagName==="TEXTAREA"},Y$=function(t,e){if(!(t instanceof Element))return!1;var n=window.getComputedStyle(t);return n[e]!=="hidden"&&!(n.overflowY===n.overflowX&&!bde(t)&&n[e]==="visible")},xde=function(t){return Y$(t,"overflowY")},Sde=function(t){return Y$(t,"overflowX")},pI=function(t,e){var n=e.ownerDocument,r=e;do{typeof ShadowRoot<"u"&&r instanceof ShadowRoot&&(r=r.host);var s=X$(t,r);if(s){var i=Q$(t,r),o=i[1],l=i[2];if(o>l)return!0}r=r.parentNode}while(r&&r!==n.body);return!1},kde=function(t){var e=t.scrollTop,n=t.scrollHeight,r=t.clientHeight;return[e,n,r]},Ede=function(t){var e=t.scrollLeft,n=t.scrollWidth,r=t.clientWidth;return[e,n,r]},X$=function(t,e){return t==="v"?xde(e):Sde(e)},Q$=function(t,e){return t==="v"?kde(e):Ede(e)},Cde=function(t,e){return t==="h"&&e==="rtl"?-1:1},Pde=function(t,e,n,r,s){var i=Cde(t,window.getComputedStyle(e).direction),o=i*r,l=n.target,c=e.contains(l),d=!1,f=o>0,h=0,m=0;do{if(!l)break;var v=Q$(t,l),_=v[0],y=v[1],w=v[2],x=y-w-i*_;(_||x)&&X$(t,l)&&(h+=x,m+=_);var k=l.parentNode;l=k&&k.nodeType===Node.DOCUMENT_FRAGMENT_NODE?k.host:k}while(!c&&l!==document.body||c&&(e.contains(l)||e===l));return(f&&Math.abs(h)<1||!f&&Math.abs(m)<1)&&(d=!0),d},wg=function(t){return"changedTouches"in t?[t.changedTouches[0].clientX,t.changedTouches[0].clientY]:[0,0]},mI=function(t){return[t.deltaX,t.deltaY]},gI=function(t){return t&&"current"in t?t.current:t},Ade=function(t,e){return t[0]===e[0]&&t[1]===e[1]},Tde=function(t){return`
|
|
167
|
-
.block-interactivity-`.concat(t,` {pointer-events: none;}
|
|
168
|
-
.allow-interactivity-`).concat(t,` {pointer-events: all;}
|
|
169
|
-
`)},Rde=0,Td=[];function Ide(t){var e=g.useRef([]),n=g.useRef([0,0]),r=g.useRef(),s=g.useState(Rde++)[0],i=g.useState(K$)[0],o=g.useRef(t);g.useEffect(function(){o.current=t},[t]),g.useEffect(function(){if(t.inert){document.body.classList.add("block-interactivity-".concat(s));var y=Que([t.lockRef.current],(t.shards||[]).map(gI),!0).filter(Boolean);return y.forEach(function(w){return w.classList.add("allow-interactivity-".concat(s))}),function(){document.body.classList.remove("block-interactivity-".concat(s)),y.forEach(function(w){return w.classList.remove("allow-interactivity-".concat(s))})}}},[t.inert,t.lockRef.current,t.shards]);var l=g.useCallback(function(y,w){if("touches"in y&&y.touches.length===2||y.type==="wheel"&&y.ctrlKey)return!o.current.allowPinchZoom;var x=wg(y),k=n.current,P="deltaX"in y?y.deltaX:k[0]-x[0],C="deltaY"in y?y.deltaY:k[1]-x[1],T,O=y.target,I=Math.abs(P)>Math.abs(C)?"h":"v";if("touches"in y&&I==="h"&&O.type==="range")return!1;var R=window.getSelection(),N=R&&R.anchorNode,L=N?N===O||N.contains(O):!1;if(L)return!1;var z=pI(I,O);if(!z)return!0;if(z?T=I:(T=I==="v"?"h":"v",z=pI(I,O)),!z)return!1;if(!r.current&&"changedTouches"in y&&(P||C)&&(r.current=T),!T)return!0;var $=r.current||T;return Pde($,w,y,$==="h"?P:C)},[]),c=g.useCallback(function(y){var w=y;if(!(!Td.length||Td[Td.length-1]!==i)){var x="deltaY"in w?mI(w):wg(w),k=e.current.filter(function(T){return T.name===w.type&&(T.target===w.target||w.target===T.shadowParent)&&Ade(T.delta,x)})[0];if(k&&k.should){w.cancelable&&w.preventDefault();return}if(!k){var P=(o.current.shards||[]).map(gI).filter(Boolean).filter(function(T){return T.contains(w.target)}),C=P.length>0?l(w,P[0]):!o.current.noIsolation;C&&w.cancelable&&w.preventDefault()}}},[]),d=g.useCallback(function(y,w,x,k){var P={name:y,delta:w,target:x,should:k,shadowParent:Ode(x)};e.current.push(P),setTimeout(function(){e.current=e.current.filter(function(C){return C!==P})},1)},[]),f=g.useCallback(function(y){n.current=wg(y),r.current=void 0},[]),h=g.useCallback(function(y){d(y.type,mI(y),y.target,l(y,t.lockRef.current))},[]),m=g.useCallback(function(y){d(y.type,wg(y),y.target,l(y,t.lockRef.current))},[]);g.useEffect(function(){return Td.push(i),t.setCallbacks({onScrollCapture:h,onWheelCapture:h,onTouchMoveCapture:m}),document.addEventListener("wheel",c,Ad),document.addEventListener("touchmove",c,Ad),document.addEventListener("touchstart",f,Ad),function(){Td=Td.filter(function(y){return y!==i}),document.removeEventListener("wheel",c,Ad),document.removeEventListener("touchmove",c,Ad),document.removeEventListener("touchstart",f,Ad)}},[]);var v=t.removeScrollBar,_=t.inert;return g.createElement(g.Fragment,null,_?g.createElement(i,{styles:Tde(s)}):null,v?g.createElement(wde,{noRelative:t.noRelative,gapMode:t.gapMode}):null)}function Ode(t){for(var e=null;t!==null;)t instanceof ShadowRoot&&(e=t.host,t=t.host),t=t.parentNode;return e}const Mde=ade(G$,Ide);var NE=g.forwardRef(function(t,e){return g.createElement(Q1,Yo({},t,{ref:e,sideCar:Mde}))});NE.classNames=Q1.classNames;var Nde=function(t){if(typeof document>"u")return null;var e=Array.isArray(t)?t[0]:t;return e.ownerDocument.body},Rd=new WeakMap,bg=new WeakMap,xg={},kw=0,J$=function(t){return t&&(t.host||J$(t.parentNode))},Lde=function(t,e){return e.map(function(n){if(t.contains(n))return n;var r=J$(n);return r&&t.contains(r)?r:(console.error("aria-hidden",n,"in not contained inside",t,". Doing nothing"),null)}).filter(function(n){return!!n})},Dde=function(t,e,n,r){var s=Lde(e,Array.isArray(t)?t:[t]);xg[n]||(xg[n]=new WeakMap);var i=xg[n],o=[],l=new Set,c=new Set(s),d=function(h){!h||l.has(h)||(l.add(h),d(h.parentNode))};s.forEach(d);var f=function(h){!h||c.has(h)||Array.prototype.forEach.call(h.children,function(m){if(l.has(m))f(m);else try{var v=m.getAttribute(r),_=v!==null&&v!=="false",y=(Rd.get(m)||0)+1,w=(i.get(m)||0)+1;Rd.set(m,y),i.set(m,w),o.push(m),y===1&&_&&bg.set(m,!0),w===1&&m.setAttribute(n,"true"),_||m.setAttribute(r,"true")}catch(x){console.error("aria-hidden: cannot operate on ",m,x)}})};return f(e),l.clear(),kw++,function(){o.forEach(function(h){var m=Rd.get(h)-1,v=i.get(h)-1;Rd.set(h,m),i.set(h,v),m||(bg.has(h)||h.removeAttribute(r),bg.delete(h)),v||h.removeAttribute(n)}),kw--,kw||(Rd=new WeakMap,Rd=new WeakMap,bg=new WeakMap,xg={})}},ej=function(t,e,n){n===void 0&&(n="data-aria-hidden");var r=Array.from(Array.isArray(t)?t:[t]),s=Nde(t);return s?(r.push.apply(r,Array.from(s.querySelectorAll("[aria-live], script"))),Dde(r,s,n,"aria-hidden")):function(){return null}},$de=Object.defineProperty,ii=(t,e)=>$de(t,"name",{value:e,configurable:!0}),LE="Dialog",[tj,Q1e]=fa(LE),[jde,Ao]=tj(LE),J1=ii(t=>{const{__scopeDialog:e,children:n,open:r,defaultOpen:s,onOpenChange:i,modal:o=!0}=t,l=g.useRef(null),c=g.useRef(null),{nodes:d,registry:f}=yE(),[h,m]=Cc({prop:r,defaultProp:s??!1,onChange:i,caller:LE}),[v,_]=g.useState(0),[y,w]=g.useState(0);return S.jsx(jde,{scope:e,triggerRef:l,contentRef:c,contentId:sa(),titleId:sa(),descriptionId:sa(),titlePresent:v>0,descriptionPresent:y>0,setTitleCount:_,setDescriptionCount:w,open:h,onOpenChange:m,onOpenToggle:g.useCallback(()=>m(x=>!x),[m]),modal:o,branchNodes:d,branchRegistry:f,children:n})},"Dialog"),Fde="DialogTrigger",J1e=g.forwardRef(ii(function(e,n){const{__scopeDialog:r,...s}=e,i=Ao(Fde,r),o=yn(n,i.triggerRef);return S.jsx(tr.button,{type:"button","aria-haspopup":"dialog","aria-expanded":i.open,"aria-controls":i.open?i.contentId:void 0,"data-state":iy(i.open),...s,ref:o,onClick:vn(e.onClick,i.onOpenToggle)})},"DialogTrigger")),nj="DialogPortal",[zde,rj]=tj(nj,{forceMount:void 0}),ey=ii(t=>{const{__scopeDialog:e,forceMount:n,children:r,container:s}=t,i=Ao(nj,e);return S.jsx(zde,{scope:e,forceMount:n,children:g.Children.map(r,o=>S.jsx(Ec,{present:n||i.open,children:S.jsx(AE,{asChild:!0,container:s,children:o})}))})},"DialogPortal"),nS="DialogOverlay",ty=g.forwardRef(ii(function(e,n){const r=rj(nS,e.__scopeDialog),{forceMount:s=r.forceMount,...i}=e,o=Ao(nS,e.__scopeDialog);return o.modal?S.jsx(Ec,{present:s||o.open,children:S.jsx(Hde,{...i,ref:n})}):null},"DialogOverlay")),Vde=pc("DialogOverlay.RemoveScroll"),Hde=g.forwardRef(ii(function(e,n){const{__scopeDialog:r,...s}=e,i=Ao(nS,r),o=QD(),l=yn(n,o);return S.jsx(NE,{as:Vde,allowPinchZoom:!0,shards:g.useMemo(()=>[i.contentRef,...i.branchNodes.map(c=>({current:c}))],[i.contentRef,i.branchNodes]),children:S.jsx(tr.div,{"data-state":iy(i.open),...s,ref:l,style:{pointerEvents:"auto",...s.style}})})},"DialogOverlayImpl")),am="DialogContent",ny=g.forwardRef(ii(function(e,n){const r=rj(am,e.__scopeDialog),{forceMount:s=r.forceMount,...i}=e,o=Ao(am,e.__scopeDialog);return S.jsx(Ec,{present:s||o.open,children:o.modal?S.jsx(Ude,{...i,ref:n}):S.jsx(Bde,{...i,ref:n})})},"DialogContent")),Ude=g.forwardRef(ii(function(e,n){const r=Ao(am,e.__scopeDialog),s=g.useRef(null),i=yn(n,r.contentRef,s);return g.useEffect(()=>{const o=s.current;if(o)return ej(o)},[]),S.jsx(sj,{...e,ref:i,trapFocus:r.open,disableOutsidePointerEvents:r.open,onCloseAutoFocus:vn(e.onCloseAutoFocus,o=>{var l;o.preventDefault(),(l=r.triggerRef.current)==null||l.focus()}),onPointerDownOutside:vn(e.onPointerDownOutside,o=>{const l=o.detail.originalEvent,c=l.button===0&&l.ctrlKey===!0;(l.button===2||c)&&o.preventDefault()}),onFocusOutside:vn(e.onFocusOutside,o=>o.preventDefault())})},"DialogContentModal")),Bde=g.forwardRef(ii(function(e,n){const r=Ao(am,e.__scopeDialog),s=g.useRef(!1),i=g.useRef(!1);return S.jsx(sj,{...e,ref:n,trapFocus:!1,disableOutsidePointerEvents:!1,onCloseAutoFocus:o=>{var l,c;(l=e.onCloseAutoFocus)==null||l.call(e,o),o.defaultPrevented||(s.current||(c=r.triggerRef.current)==null||c.focus(),o.preventDefault()),s.current=!1,i.current=!1},onInteractOutside:o=>{var d,f;(d=e.onInteractOutside)==null||d.call(e,o),o.defaultPrevented||(s.current=!0,o.detail.originalEvent.type==="pointerdown"&&(i.current=!0));const l=o.target;((f=r.triggerRef.current)==null?void 0:f.contains(l))&&o.preventDefault(),o.detail.originalEvent.type==="focusin"&&i.current&&o.preventDefault()}})},"DialogContentNonModal")),sj=g.forwardRef(ii(function(e,n){const{__scopeDialog:r,trapFocus:s,onOpenAutoFocus:i,onCloseAutoFocus:o,"aria-describedby":l,children:c,...d}=e,f=Ao(am,r);return X1(),S.jsx(vE,{registry:f.branchRegistry,children:S.jsx(t$,{asChild:!0,loop:!0,trapped:s,branches:f.branchNodes,onMountAutoFocus:i,onUnmountAutoFocus:o,children:S.jsx(mE,{role:"dialog",id:f.contentId,"aria-labelledby":f.titlePresent?f.titleId:void 0,"aria-describedby":f.descriptionPresent?ij(l,f.descriptionId):l,"data-state":iy(f.open),...d,ref:n,deferPointerDownOutside:!0,onDismiss:()=>f.onOpenChange(!1),children:c})})})},"DialogContentImpl")),ry=g.forwardRef(ii(function(e,n){const{__scopeDialog:r,...s}=e,i=Ao("DialogTitle",r),{setTitleCount:o}=i;return xs(()=>(o(l=>l+1),()=>o(l=>l-1)),[o]),S.jsx(tr.h2,{id:i.titleId,...s,ref:n})},"DialogTitle")),sy=g.forwardRef(ii(function(e,n){const{__scopeDialog:r,...s}=e,i=Ao("DialogDescription",r),{setDescriptionCount:o}=i;return xs(()=>(o(l=>l+1),()=>o(l=>l-1)),[o]),S.jsx(tr.p,{id:i.descriptionId,...s,ref:n})},"DialogDescription")),Zde="DialogClose",eye=g.forwardRef(ii(function(e,n){const{__scopeDialog:r,...s}=e,i=Ao(Zde,r);return S.jsx(tr.button,{type:"button",...s,ref:n,onClick:vn(e.onClick,()=>i.onOpenChange(!1))})},"DialogClose"));function ij(...t){const e=new Set;for(const n of t)if(typeof n=="string")for(const r of String(n).trim().split(/\s+/))r&&e.add(r);return e.size>0?Array.from(e).join(" "):void 0}ii(ij,"concatAriaDescribedby");function iy(t){return t?"open":"closed"}ii(iy,"getState");var Wde=Object.defineProperty,ol=(t,e)=>Wde(t,"name",{value:e,configurable:!0}),DE="Popover",[oj,tye]=fa(DE,[K1]),$E=K1(),[qde,rh]=oj(DE),jE=ol(t=>{const{__scopePopover:e,children:n,open:r,defaultOpen:s,onOpenChange:i,modal:o=!1}=t,l=$E(e),c=g.useRef(null),[d,f]=g.useState(!1),[h,m]=g.useState(0),[v,_]=g.useState(0),[y,w]=Cc({prop:r,defaultProp:s??!1,onChange:i,caller:DE});return S.jsx(S$,{...l,children:S.jsx(qde,{scope:e,contentId:sa(),titleId:sa(),descriptionId:sa(),titlePresent:h>0,descriptionPresent:v>0,setTitleCount:m,setDescriptionCount:_,triggerRef:c,open:y,onOpenChange:w,onOpenToggle:g.useCallback(()=>w(x=>!x),[w]),hasCustomAnchor:d,onCustomAnchorAdd:g.useCallback(()=>f(!0),[]),onCustomAnchorRemove:g.useCallback(()=>f(!1),[]),modal:o,children:n})})},"Popover"),Gde="PopoverTrigger",FE=g.forwardRef(ol(function(e,n){const{__scopePopover:r,...s}=e,i=rh(Gde,r),o=$E(r),l=yn(n,i.triggerRef),c=S.jsx(tr.button,{type:"button","aria-haspopup":"dialog","aria-expanded":i.open,"aria-controls":i.open?i.contentId:void 0,"data-state":HE(i.open),...s,ref:l,onClick:vn(e.onClick,i.onOpenToggle)});return i.hasCustomAnchor?c:S.jsx(k$,{asChild:!0,...o,children:c})},"PopoverTrigger")),aj="PopoverPortal",[Kde,Yde]=oj(aj,{forceMount:void 0}),zE=ol(t=>{const{__scopePopover:e,forceMount:n,children:r,container:s}=t,i=rh(aj,e);return S.jsx(Kde,{scope:e,forceMount:n,children:S.jsx(Ec,{present:n||i.open,children:S.jsx(AE,{asChild:!0,container:s,children:r})})})},"PopoverPortal"),lm="PopoverContent",VE=g.forwardRef(ol(function(e,n){const r=Yde(lm,e.__scopePopover),{forceMount:s=r.forceMount,...i}=e,o=rh(lm,e.__scopePopover);return S.jsx(Ec,{present:s||o.open,children:o.modal?S.jsx(Qde,{...i,ref:n}):S.jsx(Jde,{...i,ref:n})})},"PopoverContent")),Xde=pc("PopoverContent.RemoveScroll"),Qde=g.forwardRef(ol(function(e,n){const r=rh(lm,e.__scopePopover),s=g.useRef(null),i=yn(n,s),o=g.useRef(!1),{nodes:l,registry:c}=yE();return g.useEffect(()=>{const d=s.current;if(d)return ej(d)},[]),S.jsx(NE,{as:Xde,allowPinchZoom:!0,shards:g.useMemo(()=>[s,...l.map(d=>({current:d}))],[s,l]),children:S.jsx(lj,{...e,ref:i,branchNodes:l,branchRegistry:c,trapFocus:r.open,disableOutsidePointerEvents:!0,onCloseAutoFocus:vn(e.onCloseAutoFocus,d=>{var f;d.preventDefault(),o.current||(f=r.triggerRef.current)==null||f.focus()}),onPointerDownOutside:vn(e.onPointerDownOutside,d=>{const f=d.detail.originalEvent,h=f.button===0&&f.ctrlKey===!0,m=f.button===2||h;o.current=m},{checkForDefaultPrevented:!1}),onFocusOutside:vn(e.onFocusOutside,d=>d.preventDefault(),{checkForDefaultPrevented:!1})})})},"PopoverContentModal")),Jde=g.forwardRef(ol(function(e,n){const r=rh(lm,e.__scopePopover),s=g.useRef(!1),i=g.useRef(!1);return S.jsx(lj,{...e,ref:n,trapFocus:!1,disableOutsidePointerEvents:!1,onCloseAutoFocus:o=>{var l,c;(l=e.onCloseAutoFocus)==null||l.call(e,o),o.defaultPrevented||(s.current||(c=r.triggerRef.current)==null||c.focus(),o.preventDefault()),s.current=!1,i.current=!1},onInteractOutside:o=>{var d,f;(d=e.onInteractOutside)==null||d.call(e,o),o.defaultPrevented||(s.current=!0,o.detail.originalEvent.type==="pointerdown"&&(i.current=!0));const l=o.target;((f=r.triggerRef.current)==null?void 0:f.contains(l))&&o.preventDefault(),o.detail.originalEvent.type==="focusin"&&i.current&&o.preventDefault()}})},"PopoverContentNonModal")),lj=g.forwardRef(ol(function(e,n){const{__scopePopover:r,trapFocus:s,onOpenAutoFocus:i,onCloseAutoFocus:o,disableOutsidePointerEvents:l,onEscapeKeyDown:c,onPointerDownOutside:d,onFocusOutside:f,onInteractOutside:h,"aria-describedby":m,branchNodes:v,branchRegistry:_,...y}=e,w=rh(lm,r),x=$E(r),[k,P]=g.useState(null),C=yn(n,P);return _E(k),X1(),S.jsx(vE,{registry:_,children:S.jsx(t$,{asChild:!0,loop:!0,trapped:s,branches:v,onMountAutoFocus:i,onUnmountAutoFocus:o,children:S.jsx(mE,{asChild:!0,disableOutsidePointerEvents:l,onInteractOutside:h,onEscapeKeyDown:c,onPointerDownOutside:d,onFocusOutside:f,onDismiss:()=>w.onOpenChange(!1),deferPointerDownOutside:!0,children:S.jsx(C$,{"data-state":HE(w.open),role:"dialog",id:w.contentId,"aria-labelledby":w.titlePresent?w.titleId:void 0,"aria-describedby":w.descriptionPresent?cj(m,w.descriptionId):m,...x,...y,ref:C,style:{...y.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 HE(t){return t?"open":"closed"}ol(HE,"getState");function cj(...t){const e=new Set;for(const n of t)if(typeof n=="string")for(const r of String(n).trim().split(/\s+/))r&&e.add(r);return e.size>0?Array.from(e).join(" "):void 0}ol(cj,"concatAriaDescribedby");const cm={fast:{type:"spring",duration:.08,bounce:0},moderate:{type:"spring",duration:.16,bounce:.15}},efe="data-hover-dead-zone";function uj(t,e={}){const{axis:n="y",snapTolerancePx:r=1/0}=e,s=g.useRef(new Map),[i,o]=g.useState(null),[l,c]=g.useState([]),d=g.useRef([]),f=g.useRef(0),h=g.useRef(null),m=g.useRef(null),v=g.useCallback(()=>{const P=[];return s.current.forEach((C,T)=>{P[T]={top:C.offsetTop,height:C.offsetHeight,left:C.offsetLeft,width:C.offsetWidth}}),P},[]),_=g.useCallback(()=>{if(!t.current)return;const C=v();d.current=C,c(C)},[t,v]),y=g.useCallback((P,C)=>{C?s.current.set(P,C):s.current.delete(P),m.current!==null&&cancelAnimationFrame(m.current),m.current=requestAnimationFrame(()=>{m.current=null,_()})},[_]),w=g.useCallback(P=>{const C=P.clientX,T=P.clientY,O=P.target instanceof Element&&P.target.closest(`[${efe}]`)!==null;h.current!==null&&cancelAnimationFrame(h.current),h.current=requestAnimationFrame(()=>{h.current=null;const I=t.current;if(!I)return;if(O){o(null);return}const R=v(),N=d.current;(R.length!==N.length||R.some((de,ie)=>{const ce=N[ie];return!ce||!de||de.top!==ce.top||de.height!==ce.height||de.left!==ce.left||de.width!==ce.width}))&&(d.current=R,c(R));const z=I.getBoundingClientRect(),$=n==="x"?C:T;let G=null,X=1/0,q=null;const H=d.current,ee=n==="x"?I.scrollLeft:I.scrollTop,V=n==="x"?I.clientLeft:I.clientTop,Q=n==="x"?z.left:z.top,U=n==="x"?I.offsetWidth:I.offsetHeight,D=n==="x"?z.width:z.height,K=U>0?D/U:1;for(let de=0;de<H.length;de++){const ie=H[de];if(!ie)continue;const ce=n==="x"?ie.left:ie.top,he=Q+(V+ce-ee)*K,xe=(n==="x"?ie.width:ie.height)*K,oe=he+xe;$>=he&&$<=oe&&(q=de);let re=0;$<he?re=he-$:$>oe&&(re=$-oe),re<X&&(X=re,G=de)}o(q??(X<=r?G:null))})},[n,t,r,v]),x=g.useCallback(()=>{f.current+=1,_()},[_]),k=g.useCallback(()=>{h.current!==null&&(cancelAnimationFrame(h.current),h.current=null),o(null)},[]);return g.useEffect(()=>()=>{h.current!==null&&cancelAnimationFrame(h.current),m.current!==null&&cancelAnimationFrame(m.current)},[]),{activeIndex:i,setActiveIndex:o,itemRects:l,sessionRef:f,handlers:{onMouseMove:w,onMouseEnter:x,onMouseLeave:k},registerItem:y,measureItems:_}}function tfe(t,e,n){g.useEffect(()=>(t(e,n.current),()=>t(e,null)),[e,t,n])}let ev=0;const nfe=()=>{ev+=1;let t=!1;return()=>{t||(t=!0,ev=Math.max(0,ev-1))}},rfe=()=>ev>0,sfe='[data-menu-item]:not([disabled]):not([aria-disabled="true"])',dj=({itemSelector:t=sfe,loop:e=!1,onDismiss:n}={})=>{const r=g.useRef(null),s=g.useRef(null),i=g.useRef(n),o=g.useRef(!1);i.current=n;const l=g.useCallback(f=>{var h;if(r.current=f,f){o.current=!1;const m=nfe(),v=f.ownerDocument.defaultView;let _;const y=()=>{v==null||v.clearTimeout(_),_=v==null?void 0:v.setTimeout(()=>{const w=f.ownerDocument.activeElement;(w==null?void 0:w.tagName)==="IFRAME"&&!f.contains(w)&&i.current&&(o.current=!0,i.current())})};v==null||v.addEventListener("blur",y),s.current=()=>{v==null||v.removeEventListener("blur",y),v==null||v.clearTimeout(_),m()}}else(h=s.current)==null||h.call(s),s.current=null},[]),c=f=>{o.current&&f.preventDefault()},d=g.useCallback(f=>{var k;const{key:h}=f;if(h!=="ArrowDown"&&h!=="ArrowUp"&&h!=="Home"&&h!=="End")return;const m=r.current;if(!m)return;const v=Array.from(m.querySelectorAll(t));if(v.length===0)return;f.preventDefault(),f.stopPropagation();const _=v.indexOf(document.activeElement),y=v.length-1,w=P=>{if(_===-1)return P===1?0:y;const C=_+P;return e?(C+v.length)%v.length:Math.min(Math.max(C,0),y)};let x;h==="Home"?x=0:h==="End"?x=y:h==="ArrowDown"?x=w(1):x=w(-1),(k=v[x])==null||k.focus()},[t,e]);return{containerRef:l,onKeyDown:d,onCloseAutoFocus:c}},fj=({queryKey:t,data:e})=>{const n=Rm(),[r,s]=g.useState(null),i=r!==null&&r.base===e?r.value:e,o=g.useRef({queryKey:t,data:e,visible:i});o.current={queryKey:t,data:e,visible:i};const l=g.useCallback(c=>{const d=o.current,f=c(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]);return{data:i,updateData:l}},rS=["project-library"],vI=[...rS,"history"],yI=["library-project-preview"],_I=["variants-history"],Qs={rivetConfig:["rivet-config"],featureFlags:["rivet-feature-flags"],account:["rivet-account"],serverConfig:["server-config"],integrations:["integrations"],cosmosProfile:["cosmos-profile"],previewUpstreamHealth:t=>["preview-upstream-health",t],variantsUiState:t=>["variants-ui-state",t],variantsHistory:{all:_I,list:t=>[..._I,t]},designLibrary:(t,e)=>["design-library",t,e],designReferenceSearch:({profileId:t,revision:e,references:n,search:r,sourceId:s})=>["design-reference-search",t,e,n,r,s],designLibraryImage:({profileId:t,referenceId:e,hash:n})=>["design-library-image",t,e,n],projectLibrary:{all:rS,projects:[...rS,"projects"],histories:vI,history:t=>[...vI,t]},libraryProjectPreview:{project:t=>[...yI,t],thumbnail:(t,e)=>[...yI,t,e]},libraryWorkspace:t=>["library-workspace",t],libraryPreview:({projectId:t,sessionId:e,variantId:n})=>["library-preview",t,e,n]};var tv={exports:{}},ife=tv.exports,wI;function ofe(){return wI||(wI=1,(function(t){(function(e,n){t.exports?t.exports=n():e.log=n()})(ife,function(){var e=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 l(y,w){var x=y[w];if(typeof x.bind=="function")return x.bind(y);try{return Function.prototype.bind.call(x,y)}catch{return function(){return Function.prototype.apply.apply(x,[y,arguments])}}}function c(){console.log&&(console.log.apply?console.log.apply(console,arguments):Function.prototype.apply.apply(console.log,[console,arguments])),console.trace&&console.trace()}function d(y){return y==="debug"&&(y="log"),typeof console===n?!1:y==="trace"&&r?c:console[y]!==void 0?l(console,y):console.log!==void 0?l(console,"log"):e}function f(){for(var y=this.getLevel(),w=0;w<s.length;w++){var x=s[w];this[x]=w<y?e:this.methodFactory(x,y,this.name)}if(this.log=this.debug,typeof console===n&&y<this.levels.SILENT)return"No console available for logging"}function h(y){return function(){typeof console!==n&&(f.call(this),this[y].apply(this,arguments))}}function m(y,w,x){return d(y)||h.apply(this,arguments)}function v(y,w){var x=this,k,P,C,T="loglevel";typeof y=="string"?T+=":"+y:typeof y=="symbol"&&(T=void 0);function O(z){var $=(s[z]||"silent").toUpperCase();if(!(typeof window===n||!T)){try{window.localStorage[T]=$;return}catch{}try{window.document.cookie=encodeURIComponent(T)+"="+$+";"}catch{}}}function I(){var z;if(!(typeof window===n||!T)){try{z=window.localStorage[T]}catch{}if(typeof z===n)try{var $=window.document.cookie,G=encodeURIComponent(T),X=$.indexOf(G+"=");X!==-1&&(z=/^([^;]+)/.exec($.slice(X+G.length+1))[1])}catch{}return x.levels[z]===void 0&&(z=void 0),z}}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 N(z){var $=z;if(typeof $=="string"&&x.levels[$.toUpperCase()]!==void 0&&($=x.levels[$.toUpperCase()]),typeof $=="number"&&$>=0&&$<=x.levels.SILENT)return $;throw new TypeError("log.setLevel() called with invalid level: "+z)}x.name=y,x.levels={TRACE:0,DEBUG:1,INFO:2,WARN:3,ERROR:4,SILENT:5},x.methodFactory=w||m,x.getLevel=function(){return C??P??k},x.setLevel=function(z,$){return C=N(z),$!==!1&&O(C),f.call(x)},x.setDefaultLevel=function(z){P=N(z),I()||x.setLevel(z,!1)},x.resetLevel=function(){C=null,R(),f.call(x)},x.enableAll=function(z){x.setLevel(x.levels.TRACE,z)},x.disableAll=function(z){x.setLevel(x.levels.SILENT,z)},x.rebuild=function(){if(o!==x&&(k=N(o.getLevel())),f.call(x),o===x)for(var z in i)i[z].rebuild()},k=N(o?o.getLevel():"WARN");var L=I();L!=null&&(C=N(L)),f.call(x)}o=new v,o.getLogger=function(w){if(typeof w!="symbol"&&typeof w!="string"||w==="")throw new TypeError("You must supply a name when creating a logger.");var x=i[w];return x||(x=i[w]=new v(w,o.methodFactory)),x};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})})(tv)),tv.exports}var afe=ofe();const yo=E1(afe),lfe="INFO",cfe=lfe.toUpperCase();yo.setLevel(yo.levels[cfe]||yo.levels.INFO);const oi=t=>{const e=t?`[${t}] `:"";return{trace:(n,...r)=>yo.trace(`${e}${n}`,...r),debug:(n,...r)=>yo.debug(`${e}${n}`,...r),info:(n,...r)=>yo.info(`${e}${n}`,...r),warn:(n,...r)=>yo.warn(`${e}${n}`,...r),error:(n,...r)=>{yo.error(`${e}${n}`,...r);try{const i=r.map(l=>Ks(l)).join(" ").slice(0,512),o={source:"ui",error_message:n,service:t??"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)=>yo.info(`${e}API: ${n}`,...r),hook:(n,...r)=>yo.debug(`${e}Hook: ${n}`,...r),mount:(n,...r)=>yo.debug(`${e}Mount: ${n}`,...r)}},ufe=oi("useVariantsHistory"),Ew=[],dfe=(t,e)=>t.length===e.length&&t.every((n,r)=>{var i,o;const s=e[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}),ffe=({historyQuery:t,snapshotKey:e,isEnabled:n,isListed:r,onLoaded:s})=>{const i=Qs.variantsHistory.list({historyQuery:t,snapshotKey:e}),o=g.useRef(s);o.current=s;const l=g.useRef(Ew),c=aa({queryKey:i,queryFn:async({signal:v})=>{let _;try{const w=await Ft(`/api/variants/history${t}`,{credentials:"same-origin",signal:v});if(!w.ok)return l.current;_=((await w.json()).variants??[]).filter(r)}catch(w){return v.aborted||ufe.warn("Failed to load past variants",w),l.current}if(v.aborted)return l.current;o.current(_);const y=l.current;return dfe(y,_)?y:_},enabled:n,placeholderData:ZJ,gcTime:0,retry:!1,refetchOnWindowFocus:!1,refetchOnReconnect:!1,networkMode:"always"}),{data:d,updateData:f}=fj({queryKey:i,data:c.data}),h=d??Ew;l.current=h;const m=g.useCallback(v=>{f(_=>v(_??Ew))},[f]);return{pastVariants:h,setPastVariants:m}},bI=oi("useVariantsUiState"),hfe={groups:[],rows:{}},nv={pinned:[],order:hfe},up="pinned",pfe="top",Cw=t=>`rows:${t}`,Pw=t=>({projectPath:t,mutations:[],preview:nv}),mfe=(t,e)=>e.reduce((n,r)=>r(n),t),hj=t=>t?`/api/variants/ui-state?projectPath=${encodeURIComponent(t)}`:"/api/variants/ui-state",gfe=async t=>{const e=await Ft(hj(t));if(!e.ok)throw new Error(`Failed to load variants UI state (${e.status})`);return CJ.parse(await e.json()).uiState},vfe=async({projectPath:t,uiState:e})=>{await Ft(hj(t),{method:"PUT",headers:{"Content-Type":"application/json"},body:JSON.stringify({uiState:e})})},xI=t=>e=>e.pinned.includes(t)?e:{...e,pinned:[...e.pinned,t]},yfe=t=>e=>({...e,pinned:e.pinned.filter(n=>n!==t)}),_fe=(t,e)=>n=>{if(t===up){const r=new Set(e);return{...n,pinned:[...e,...n.pinned.filter(s=>!r.has(s))]}}return t===pfe?{...n,order:{...n.order,groups:e}}:{...n,order:{...n.order,rows:{...n.order.rows,[t.slice(5)]:e}}}},wfe=t=>{const e=Rm(),n=Qs.variantsUiState(t),[r,s]=g.useState(()=>Pw(t)),i=g.useRef(r),o=g.useCallback(C=>{i.current=C,s(C)},[]),l=g.useCallback(C=>i.current.projectPath===C?i.current:Pw(C),[]),{mutate:c}=QN({mutationFn:vfe,onError:C=>{bI.warn("persist failed — arrangement kept for this session only",C)}}),d=aa({queryKey:n,queryFn:async()=>{let C;try{C=await gfe(t)}catch(I){throw bI.warn("load failed — arrangement is session-local until reload",I),I}const{mutations:T}=l(t);if(T.length===0)return C;o(Pw(t));const O=mfe(C,T);return t&&c({projectPath:t,uiState:O}),O},enabled:t!==null,gcTime:0,retry:!1,refetchOnWindowFocus:!1,refetchOnReconnect:!1,networkMode:"always"}),{data:f,updateData:h}=fj({queryKey:n,data:d.isSuccess?d.data:void 0}),m=g.useCallback(()=>{var C;return t!==null&&((C=e.getQueryState(Qs.variantsUiState(t)))==null?void 0:C.status)==="success"},[t,e]),v=g.useCallback(()=>m()?e.getQueryData(Qs.variantsUiState(t))??nv:l(t).preview,[m,t,e,l]),_=g.useCallback(C=>{if(t!==null&&m()){const O=h(I=>C(I??nv));c({projectPath:t,uiState:O});return}const T=l(t);o({projectPath:t,mutations:[...T.mutations,C],preview:C(T.preview)})},[m,c,t,l,o,h]),y=g.useCallback(C=>{const T=!v().pinned.includes(C);_(T?xI(C):yfe(C))},[_,v]),w=g.useCallback(C=>{v().pinned.includes(C)||_(xI(C))},[_,v]),x=g.useCallback((C,T)=>{_(_fe(C,T))},[_]);let k=nv;f?k=f:r.projectPath===t&&(k=r.preview);const P=g.useMemo(()=>new Set(k.pinned),[k.pinned]);return{pinnedKeys:k.pinned,pinnedKeySet:P,listOrder:k.order,togglePin:y,pinItem:w,reorder:x}},bfe=t=>{const{containerRef:e,dragged:n,yieldToSelector:r,restrictToSelector:s,onReorder:i}=t,[o,l]=g.useState(null),c=g.useCallback(h=>{const m=e.current;return m?Array.from(m.querySelectorAll(`[data-reorder-container="${CSS.escape(h)}"]`)):[]},[e]),d=g.useCallback(h=>{if(!n){o&&l(null);return}const m=e.current;if(!m)return;if(r){const x=m.querySelector(r);if(x){const k=x.getBoundingClientRect();if(h.clientY>=k.top&&h.clientY<=k.bottom){o&&l(null);return}}}if(s){const x=m.querySelector(s),k=x==null?void 0:x.getBoundingClientRect();if(!k||h.clientY<k.top||h.clientY>k.bottom){o&&l(null);return}}const v=c(n.container);if(v.length===0){o&&l(null);return}const _=m.getBoundingClientRect().top;let y=v.length;for(let x=0;x<v.length;x++){const k=v[x].getBoundingClientRect();if(h.clientY<k.top+k.height/2){y=x;break}}let w;y===0?w=v[0].getBoundingClientRect().top-_-1:y===v.length?w=v[v.length-1].getBoundingClientRect().bottom-_:w=(v[y-1].getBoundingClientRect().bottom+v[y].getBoundingClientRect().top)/2-_,(!o||o.index!==y||o.container!==n.container)&&l({container:n.container,index:y,top:w})},[e,n,o,c,r,s]),f=g.useCallback(()=>{if(!n||!o)return;l(null);const h=c(o.container).map(_=>_.dataset.reorderKey).filter(_=>!!_),m=h.indexOf(n.key);if(m===-1)return;h.splice(m,1);const v=o.index>m?o.index-1:o.index;h.splice(v,0,n.key),i(o.container,h)},[n,o,c,i]);return{dropTarget:o,onPointerMove:d,onPointerUp:f}},xfe={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}},pj=Object.fromEntries(Object.entries(xfe).map(([t,e])=>[t,{isEnabled:e.default}])),mj=mn(!0),gj=mn(null),vj=mn(0),Sfe=mn({name:null,email:null}),sS=mn(0),u1=mn(null),iS=mn(!1),oS=mn(null),yj=mn(!1),_j=mn(!1),aS=mn(null),rv=mn(null),Ff=mn(null),UE=mn(null),vc=mn(null),wj=mn(!1),Fm=mn({active:!1}),bj=mn([]),lS=mn(pj),kfe=mn(!1),oy=mn(null),xj=mn(null),ay=mn(!0),Efe=mn(!1),Sj=mn(!1),kj=mn(null),Cfe=()=>{var t;return typeof window>"u"?null:((t=window.__RIVET_BOOTSTRAP__)==null?void 0:t.agentApplyMode)??null},ly=mn(Cfe()),Pfe=mn(null);function Afe(t){return t==="cursor"?"Cursor":t==="codex"?"Codex":t==="claude-desktop"?"Claude":"Claude Code"}const Tfe=async({text:t,copyKind:e})=>{const n=t.trim();if(n)try{await navigator.clipboard.writeText(n),Qe.capture("variants_panel.copy_completed",{outcome:"success",copyKind:e}),nn.success("Copied")}catch(r){Qe.capture("variants_panel.copy_failed",{outcome:"failure",copyKind:e,errorName:r instanceof Error?r.name:"UnknownError"}),nn.error("Couldn't copy")}},Rfe=["⡡⠊⢔⠡","⠊⡰⡡⡘","⢔⢅⠈⢢","⡁⢂⠆⡍","⢔⠨⢑⢐","⠨⡑⡠⠊"],BE=({className:t,"data-testid":e}={})=>S.jsx("div",{className:`rivet-sparkle relative overflow-hidden font-mono leading-none ${t??"text-base text-primary"}`,style:{height:"1em",width:"4ch"},"aria-hidden":"true","data-testid":e,children:S.jsx("div",{className:"rivet-sparkle-strip",children:Rfe.map((n,r)=>S.jsx("span",{className:"block",style:{height:"1em",lineHeight:"1em"},children:n},r))})}),Ife=({entry:t,deploying:e,deployedUrl:n,onDeploy:r,isDeployDisabled:s=!1})=>{const o=e?"Deploying…":n?"Copy link":"Share";return S.jsxs("div",{className:"border-main-border bg-main-light flex shrink-0 items-center justify-between gap-3 border-t px-3 py-4",children:[S.jsxs("div",{className:"min-w-0",children:[S.jsx("div",{className:"text-content truncate text-sm font-medium",children:t.label.trim()||"Untitled direction"}),n?S.jsx("div",{className:"text-content-muted text-[11px]",children:"Deployed — share link ready"}):null]}),S.jsxs("button",{type:"button",onClick:()=>r(t),disabled:e||s,title:n?`Copy share link (${n})`:"Deploy this direction and get a public link to share",className:"border-main-border text-content hover:bg-main-input 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&&!e?S.jsx(rm,{size:12,weight:"bold"}):null,o]})]})},Ej=({primaryLabel:t,primaryIcon:e,primaryAction:n,isDisabled:r=!1,isDropdownDisabled:s=!1,isLoading:i=!1,loadingLabel:o,dropdownAriaLabel:l="More actions",dropdownItems:c})=>{const[d,f]=g.useState(!1),h=i?o??t:t,m=c.length>0;return S.jsxs("div",{className:"flex items-stretch",children:[S.jsxs("button",{onClick:n,disabled:r||i,className:`bg-main-hover hover:bg-main-input flex h-7 shrink-0 items-center gap-1.5 px-3 text-xs font-medium text-white transition-colors disabled:cursor-not-allowed disabled:opacity-50 ${m?"rounded-l-md":"rounded-md"}`,children:[e?S.jsx(e,{className:"h-3.5 w-3.5",weight:"bold"}):null,h]}),m?S.jsxs(jE,{open:d,onOpenChange:f,children:[S.jsx(FE,{asChild:!0,children:S.jsx("button",{"aria-label":l,disabled:s||i,title:l,className:"bg-main-hover hover:bg-main-input h-7 shrink-0 rounded-r-md border-l border-white/20 px-1.5 text-white transition-colors disabled:cursor-not-allowed disabled:opacity-50",children:S.jsx(Eae,{className:"h-3.5 w-3.5",weight:"bold"})})}),S.jsx(zE,{children:S.jsx(VE,{className:"border-divider bg-main z-[60] min-w-[140px] rounded-lg border p-1 shadow-lg",sideOffset:5,align:"end",children:c.map(v=>{const _=v.icon;return S.jsxs("button",{onClick:()=>{v.isDisabled||(v.onClick(),f(!1))},disabled:v.isDisabled,className:"text-content hover:bg-hover flex w-full items-center gap-2 rounded px-3 py-1.5 text-xs transition-colors disabled:cursor-not-allowed disabled:opacity-50",children:[_?S.jsx(_,{className:"h-3.5 w-3.5",weight:"bold"}):null,v.label]},v.label)})})})]}):null]})},Vu=({label:t,children:e,side:n="top",sideOffset:r=8,delayDuration:s=300,disabled:i=!1,forceOpen:o})=>i?S.jsx(S.Fragment,{children:e}):S.jsx(OE,{content:t,side:n,sideOffset:r,delayDuration:s,forceOpen:o,children:e}),Ofe=32,Mfe=2048,Cj=Ud().max(Mfe).refine(t=>{let e;try{e=decodeURIComponent(t.split(/[?#]/)[0])}catch{return!1}return t.startsWith("/")&&!t.startsWith("//")&&!t.includes("\\")&&!/^\/%(?:2f|5c)/i.test(t)&&!e.includes("\\")&&!e.split("/").some(n=>n==="."||n==="..")&&![...t].some(n=>n<=" "||n==="")},"Expected an app-relative preview route");lJ(Cj).min(1).max(Ofe).transform(t=>[...new Set(t)]);const cy="/__rivet/preview",SI=`${cy}/variant/`,kI=`${cy}/history/`,Pj=t=>t?t.startsWith("/")?t:`/${t}`:"/",Aj=(t,e)=>{if(!e)return t;const n=Cj.parse(e);if(t.includes("?")||t.includes("#"))throw new Error("Preview target must not contain an application query or hash");return t.replace(/\/$/,"")+n},EI=(t,e)=>{const n=new URLSearchParams(e);return n.set("targetAddressed","1"),`/api/variants/history/${encodeURIComponent(t.sessionId)}/${encodeURIComponent(t.variantId)}/run?${n}`},Aw=t=>{const e="/api/variants/history/"+encodeURIComponent(t.sessionId)+"/"+encodeURIComponent(t.variantId);return t.routePath?Aj(e+"/site/"+encodeURIComponent(t.projectPath??"current"),t.routePath):e+"/preview"+(t.projectPath?"?projectPath="+encodeURIComponent(t.projectPath):"")},Nfe=t=>`${cy}/variant/${encodeURIComponent(t.sessionId)}/${encodeURIComponent(t.variantId)}${Pj(t.routePath)}`,CI=t=>`${cy}/history/${encodeURIComponent(t.sessionId)}/${encodeURIComponent(t.variantId)}${Pj(t.routePath)}`,PI=t=>{try{const e=new URL(t,"http://localhost");return e.pathname.startsWith(SI)||e.pathname.startsWith(kI)}catch{return t.startsWith(SI)||t.startsWith(kI)}},Pu=t=>{var s,i,o,l,c,d;const{sessionId:e,variant:n,projectContext:r}=t;return n.status!=="succeeded"?null:((s=n.preview)==null?void 0:s.kind)==="static_artifact"?Aj(n.preview.url,(i=n.previewRoutes)==null?void 0:i[0]):e&&(((o=n.preview)==null?void 0:o.kind)==="dev_server"||typeof n.port=="number")?Nfe({sessionId:e,variantId:n.workItemId,routePath:((l=n.previewRoutes)==null?void 0:l[0])??((r==null?void 0:r.kind)==="fresh"?"/":t.routePath)}):e&&(r==null?void 0:r.kind)==="fresh"&&((c=r.executionPlan)==null?void 0:c.mode)!=="vite_app"&&((d=n.preview)==null?void 0:d.kind)!=="dev_server"?`/api/variants/${e}/static/${n.workItemId}`:null},AI="/rivet/",Tj=t=>{if(!t.startsWith(AI))return null;const e=t.slice(AI.length);return!e||e==="/"?null:`/${e}`},zf=(t,e=Ft)=>{if((t==null?void 0:t.source)!=="history-dev-server")return;const n=new URLSearchParams({sessionId:t.sessionId,variantId:t.variantId});e(`/api/variants/history/replay/stop?${n.toString()}`,{method:"POST"}).catch(()=>{})},Lfe=(t,e=Ft)=>{const n=new Set;for(const r of[t==null?void 0:t.left,t==null?void 0:t.right]){if((r==null?void 0:r.source)!=="history-dev-server")continue;const s=`${r.sessionId}:${r.variantId}`;n.has(s)||(n.add(s),zf(r,e))}},d1=(t,e)=>{const n=e==null?void 0:e.left,r=e==null?void 0:e.right;return{event:`visual_editor_variant_compare_${t}`,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}}},TI=6,Rj="original",ZE="Original",Ij="The original state of your app before any variants were generated.",RI=200,Oj="h-6 w-6 rounded",cS=[.33,1,.68,1],uS=.22,Xr=oi("AgentVariantsPanel"),Tw=()=>{var t;(t=window.getSelection())==null||t.removeAllRanges()},$d=t=>{var e;return!!t.hasTree&&((e=t.serve)==null?void 0:e.kind)==="dev-server"},Dfe=t=>{var e,n;return((e=t.preview)==null?void 0:e.kind)==="static"||((n=t.serve)==null?void 0:n.kind)==="static"||$d(t)},$fe=t=>{var e;return t?t.kind==="existing"?!0:((e=t.executionPlan)==null?void 0:e.mode)==="vite_app":!1};function Rw(t,...e){return t?e.some(n=>(n??"").toLowerCase().includes(t)):!0}const jfe=(t,e)=>{if(t.kind==="original")return null;const n=t.kind==="active"?t.variant.runLabel:t.entry.runLabel,r=n==null?void 0:n.trim();return r?t.kind==="active"?e?{label:r,run:t.variant.requestId?{sessionId:e,requestId:t.variant.requestId}:{sessionId:e,runLabel:r}}:null:{label:r,run:t.entry.requestId?{sessionId:t.entry.sessionId,requestId:t.entry.requestId}:{sessionId:t.entry.sessionId,runLabel:r}}:null},Mj=t=>{const e="requestId"in t?["request",t.requestId]:["label",t.runLabel];return`run:${JSON.stringify([t.sessionId,...e])}`},Ffe="original",dS="pinned-section";function Nj(t){return`rivet:collapsedRuns:${t}`}function Sg(t){try{const e=window.localStorage.getItem(Nj(t)),n=e?JSON.parse(e):null;return Array.isArray(n)?new Set(n.filter(r=>typeof r=="string")):new Set}catch{return new Set}}function Iw(t,e){try{window.localStorage.setItem(Nj(t),JSON.stringify([...e]))}catch{}}const II=(t,e)=>{const n=[],r=new Map;for(const s of t){const i=jfe(s,e);let o="";s.kind==="original"?o=Ffe:i&&(o=Mj(i.run));let l=r.get(o);l||(l={key:o,label:(i==null?void 0:i.label)??null,run:(i==null?void 0:i.run)??null,rows:[]},r.set(o,l),n.push(l)),l.rows.push(s)}return n};async function Ta(t){try{const e=await t.json();return{message:typeof e.message=="string"?e.message:null,errorCode:typeof e.errorCode=="string"?e.errorCode:null}}catch{return{message:null,errorCode:null}}}const Lj=t=>t.status==="succeeded",Mp=t=>{var e,n;return t.status!=="succeeded"?!1:((n=(e=t.actions)==null?void 0:e.view)==null?void 0:n.enabled)??(!!t.preview||typeof t.port=="number")},Dj=t=>{var e;return((e=t.previewUnavailable)==null?void 0:e.reason)==="idle_timeout"},zfe=t=>t.status==="succeeded"&&!Mp(t)&&(!t.previewUnavailable||Dj(t)),Ow=t=>{var e,n;return((e=t.preview)==null?void 0:e.kind)==="static_artifact"?"static_artifact":((n=t.preview)==null?void 0:n.kind)==="dev_server"||typeof t.port=="number"?"dev_server":"none"},OI=(t,e,n)=>{const r=new URL(t,window.location.origin);return r.searchParams.set(e,n),`${r.pathname}${r.search}${r.hash}`},Vfe=t=>{var e;return Lj(t)&&((e=t.preview)==null?void 0:e.kind)==="static_artifact"},MI=(t,e)=>t.map(n=>`${n.workItemId}:${e[n.workItemId]??""}`).join("|"),Hfe=()=>{var ul,qu,Gu;const t=Mk(),e=_t(Fm),n=_t(wj),r=g.useRef(!1),s=_t(bj),i=_t(oy),o=_t(ay),l=_t(lS),c=((ul=l.share)==null?void 0:ul.isEnabled)??!1,d=((qu=l.deployPrototype)==null?void 0:qu.isEnabled)??!1,f=((Gu=l.canvasShare)==null?void 0:Gu.isEnabled)??!1,h=_t(Sj),m=_t(kj),v=Lt(sS),_=Lt(u1),y=Lt(iS),w=Lt(oS),x=Lt(yj),k=Lt(_j),P=Lt(Ff),C=_t(Ff),T=Lt(UE),O=Lt(gj);g.useEffect(()=>(O("Directions"),()=>O(null)),[O]);const I=_t(vc),R=Lt(vc),N=g.useCallback((B=!1)=>{if(Lfe(I),R(null),B&&I){const fe=d1("ended",I);Qe.capture(fe.event,fe.properties)}},[R,I]),L=_t(aS),z=Lt(aS),$=_t(rv),G=Lt(rv),X=$?`${$.sessionId}:${$.variantId}`:null,[q,H]=g.useState(""),[ee,V]=g.useReducer(B=>B+1,0),Q=g.useMemo(()=>i!==null?Sg(i):new Set,[i,ee]),U=g.useCallback(B=>{if(i===null)return;const fe=new Set(Sg(i));fe.delete(B)||fe.add(B),Iw(i,fe),V()},[i]),[D,K]=g.useState(null),[de,ie]=g.useState(null),[ce,he]=g.useState(!1),[xe,oe]=g.useState({}),[re,Se]=g.useState(null),[ze,ke]=g.useState({}),[gt,on]=g.useState(null),[Tt,$t]=g.useState(!1),[xt]=g.useState(()=>Lle(window.location.search)),An=g.useRef(!1),Be=g.useRef(!1);Be.current=xt!==null||$!==null||L!==null||Tt;const je=g.useMemo(()=>e.active?e.variants:[],[e]),Ie=g.useMemo(()=>je.filter(Vfe),[je]),nt=g.useMemo(()=>MI(Ie,xe),[Ie,xe]),St=(re==null?void 0:re.key)===nt?re.shareUrl:null,Ce=e.active?e.sessionId:null,Ot=g.useMemo(()=>{const B=new Set;for(const fe of je)fe.adoptedSource&&B.add(`${fe.adoptedSource.sessionId}:${fe.adoptedSource.variantId}`);return B},[je]),Qt=e.active?e.projectContext:null,Et=(Qt==null?void 0:Qt.kind)==="fresh"?Qt.workspacePath:i,Ur=g.useMemo(()=>Et?`?projectPath=${encodeURIComponent(Et)}`:"",[Et]),ai=e.active?`${e.sessionId}:${e.stage}`:"inactive",ss=g.useRef(!1),Br=B=>{var fe;if(!ss.current&&!Be.current&&ai==="inactive"&&B.length>0&&B.every(_e=>_e.projectKind==="fresh")){const _e=[...B].sort((ve,Ne)=>new Date(Ne.createdAt).getTime()-new Date(ve.createdAt).getTime()).find(ve=>!$d(ve));_e&&(ss.current=!0,G({sessionId:_e.sessionId,variantId:_e.variantId,previewKind:"static",references:_e.references,projectPath:Et??void 0}),$t(!1),_(Aw({sessionId:_e.sessionId,variantId:_e.variantId,projectPath:Et,routePath:(fe=_e.previewRoutes)==null?void 0:fe[0]})))}G(_e=>{if(!_e)return _e;const ve=B.find(Ne=>Ne.sessionId===_e.sessionId&&Ne.variantId===_e.variantId);return!ve||JSON.stringify(_e.references)===JSON.stringify(ve.references)?_e:{..._e,references:ve.references}})},{pastVariants:Ri,setPastVariants:Tn}=ffe({historyQuery:Ur,snapshotKey:ai,isEnabled:!o,isListed:Dfe,onLoaded:Br}),ur=g.useMemo(()=>[...Ri.filter(fe=>fe.sessionId!==Ce&&!Ot.has(`${fe.sessionId}:${fe.variantId}`))].sort((fe,_e)=>{const ve=new Date(fe.createdAt).getTime(),Ne=new Date(_e.createdAt).getTime();return(Number.isNaN(Ne)?0:Ne)-(Number.isNaN(ve)?0:ve)}),[Ot,Ri,Ce]),is=g.useMemo(()=>$?je.find(B=>{var fe,_e;return((fe=B.adoptedSource)==null?void 0:fe.sessionId)===$.sessionId&&((_e=B.adoptedSource)==null?void 0:_e.variantId)===$.variantId})??null:null,[$,je]),dr=g.useMemo(()=>$?ur.find(B=>B.sessionId===$.sessionId&&B.variantId===$.variantId)??null:null,[$,ur]),Ii=!e.active&&ur.length>0&&ur.every(B=>B.projectKind==="fresh"),Un=e.active?$fe(Qt):!!i&&!Ii,{pinnedKeys:Oi,pinnedKeySet:ks,listOrder:nr,togglePin:xr,pinItem:Mi,reorder:Sr}=wfe(Et),os=g.useRef(null),rt=g.useRef(null),qt=typeof window>"u"?"/":Tj(window.location.pathname)??"/",Gt=g.useRef(null),ln=g.useRef(!1),Zr=g.useCallback((B,fe)=>{fe.button!==0&&fe.pointerType==="mouse"||(fe.preventDefault(),Tw(),Gt.current={kind:"live",variantId:B,startX:fe.clientX,startY:fe.clientY,committed:!1})},[]),kn=g.useCallback((B,fe)=>{fe.button!==0&&fe.pointerType==="mouse"||(fe.preventDefault(),Tw(),Gt.current={kind:"past",entry:B,startX:fe.clientX,startY:fe.clientY,committed:!1})},[]);g.useEffect(()=>{const B=ve=>{var lt,Rn;const Ne=Gt.current;if(!Ne)return;const Le=ve.clientX-Ne.startX,yt=ve.clientY-Ne.startY;if(!Ne.committed){if(Le*Le+yt*yt<TI*TI)return;if(Tw(),Ne.kind==="live"){const kt=je.find(us=>us.workItemId===Ne.variantId);if(!kt||kt.status!=="succeeded"){Gt.current=null;return}const cs=Pu({sessionId:Ce,variant:kt,projectContext:Qt,routePath:qt});P({sessionId:Ce??"",variantId:kt.workItemId,label:kt.label||"Direction",url:cs,source:"live",runLabel:kt.runLabel,description:kt.description})}else{const{entry:kt}=Ne,cs=$d(kt),us=cs?CI({sessionId:kt.sessionId,variantId:kt.variantId,routePath:((lt=kt.previewRoutes)==null?void 0:lt[0])??qt}):Aw({sessionId:kt.sessionId,variantId:kt.variantId,projectPath:Et,routePath:(Rn=kt.previewRoutes)==null?void 0:Rn[0]});if(P({sessionId:kt.sessionId,variantId:kt.variantId,label:kt.label||"Direction",url:us,source:cs?"history-dev-server":"history-static",runLabel:kt.runLabel,description:kt.brief}),cs){const Cs=EI(kt,Ur);(async()=>{try{if(!(await Ft(Cs,{method:"POST"})).ok)return;const En=OI(us,"replay",String(Date.now()));P(fr=>!fr||fr.sessionId!==kt.sessionId||fr.variantId!==kt.variantId||fr.source!=="history-dev-server"?fr:{...fr,url:En}),R(fr=>{if(!fr)return fr;const dl=ji=>!ji||ji.sessionId!==kt.sessionId||ji.variantId!==kt.variantId?ji:{...ji,url:En};return{...fr,left:dl(fr.left),right:dl(fr.right)}})}catch(Jt){Xr.warn("history replay drag boot failed",Jt)}})()}}Ne.committed=!0}T({x:ve.clientX,y:ve.clientY})},fe=()=>{const ve=Gt.current;ve!=null&&ve.committed&&(ln.current=!0,window.setTimeout(()=>{ln.current=!1},0)),Gt.current=null,T(null)},_e=ve=>{if(ve.key!=="Escape")return;const Ne=Gt.current;Ne!=null&&Ne.committed&&(Ne.kind==="past"&&$d(Ne.entry)&&zf({sessionId:Ne.entry.sessionId,variantId:Ne.entry.variantId,source:"history-dev-server"}),Gt.current=null,P(null),T(null))};return window.addEventListener("pointermove",B),window.addEventListener("pointerup",fe),window.addEventListener("pointercancel",fe),window.addEventListener("keydown",_e),()=>{window.removeEventListener("pointermove",B),window.removeEventListener("pointerup",fe),window.removeEventListener("pointercancel",fe),window.removeEventListener("keydown",_e)}},[je,Ce,Qt,qt,Ur,Et,P,T,R]);const cn=g.useCallback(()=>{var B;(B=Gt.current)!=null&&B.committed&&(ln.current=!0,window.setTimeout(()=>{ln.current=!1},0)),Gt.current=null,T(null),C&&(C.source==="history-dev-server"&&zf({sessionId:C.sessionId,variantId:C.variantId,source:"history-dev-server"}),P(null))},[C,P,T]),as=g.useCallback((B,fe)=>{const _e=!ks.has(B);Qe.capture(_e?"variants_panel.direction_pinned":"variants_panel.direction_unpinned",{method:fe}),xr(B)},[ks,xr]),Wr=g.useCallback(()=>{C&&(Qe.capture("variants_panel.direction_pinned",{method:"drag"}),Mi(`row:past:${C.sessionId}:${C.variantId}`),cn())},[C,cn,Mi]),kr=g.useCallback(B=>{Qe.capture("variants_panel.direction_unpinned",{method:"drag"}),xr(B),cn()},[xr,cn]),Ut=g.useCallback((B,fe)=>{Sr(B,fe),cn()},[Sr,cn]),Bn=g.useMemo(()=>{var fe;if(Tt||X)return null;const B=L?je.find(_e=>_e.workItemId===L):null;return L&&!B?null:B?Mp(B)?B.workItemId:null:e.active?((fe=je.find(_e=>{var ve,Ne;return Mp(_e)&&(((ve=_e.preview)==null?void 0:ve.kind)==="static_artifact"||((Ne=_e.preview)==null?void 0:Ne.kind)==="dev_server")}))==null?void 0:fe.workItemId)??null:null},[L,X,Tt,e,je]),Ac=Tt||Un&&L===null&&X===null&&Bn===null,pa=g.useCallback(async B=>{var _e,ve,Ne,Le,yt;if(!Ce)return;const fe=(B==null?void 0:B.workItemId)??null;K({kind:"switch",variantId:fe??void 0});try{if(((_e=B==null?void 0:B.preview)==null?void 0:_e.kind)==="static_artifact"){const Rn=Pu({sessionId:Ce,variant:B,projectContext:e.active?e.projectContext:null})??B.preview.url;y(!1),w(null),((ve=B.refinement)==null?void 0:ve.status)==="succeeded"&&!((Ne=B.previewRoutes)!=null&&Ne.length)?_(OI(Rn,"refinement",B.refinement.workItemId)):_(Rn);return}if(fe&&Ce&&e.active&&e.projectContext.kind==="fresh"&&((Le=e.projectContext.executionPlan)==null?void 0:Le.mode)!=="vite_app"&&((yt=B==null?void 0:B.preview)==null?void 0:yt.kind)!=="dev_server"){y(!1),w(null),_(`/api/variants/${Ce}/static/${fe}`);return}const lt=B&&fe?Pu({sessionId:Ce,variant:B,projectContext:e.active?e.projectContext:null,routePath:qt}):null;if(lt){y(!1),w(null),_(lt);return}Qe.capture("variants_panel.preview_display_failed",{sessionId:Ce,variantId:fe,previewKind:B?Ow(B):"none",hasPreview:!!(B!=null&&B.preview),hasPort:typeof(B==null?void 0:B.port)=="number",errorMessage:"No addressable dev-server preview URL"}),y(!1),w(null)}catch(lt){Xr.warn("preview display failed",lt),Qe.capture("variants_panel.preview_display_failed",{sessionId:Ce,variantId:fe,previewKind:B?Ow(B):"none",hasPreview:!!(B!=null&&B.preview),hasPort:typeof(B==null?void 0:B.port)=="number",errorMessage:lt instanceof Error?lt.message:String(lt)}),y(!1),w(null)}finally{K(null)}},[Ce,e,qt,_,y,w]),li=g.useRef(0),qr=g.useCallback(()=>{li.current++,K(B=>(B==null?void 0:B.kind)==="switch"?null:B),x(!1),k(!1)},[x,k]),al=g.useCallback(async B=>{if(Ce){K({kind:"switch",variantId:B.workItemId});try{const fe=await Ft(`/api/variants/${Ce}/preview-port`,{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({variantId:B.workItemId})});if(!fe.ok){const _e=await Ta(fe);throw new Error(_e.message??`Preview restoration failed (${fe.status})`)}}catch(fe){Xr.warn("preview restoration failed",fe),Qe.capture("variants_panel.preview_display_failed",{sessionId:Ce,variantId:B.workItemId,previewKind:"dev_server",hasPreview:!1,hasPort:!1,errorMessage:fe instanceof Error?fe.message:String(fe)})}finally{K(null)}}},[Ce]),ls=g.useCallback(B=>{var Le,yt,lt,Rn,kt;if(ln.current){ln.current=!1;return}const fe=Mp(B),_e=B.status==="pending"||B.status==="running"||zfe(B);qr();const ve=Ow(B),Ne=je.find(cs=>cs.workItemId===L);Qe.capture("variants_panel.preview_requested",{sessionId:Ce,fromVariantId:Ne==null?void 0:Ne.workItemId,toVariantId:B.workItemId,variantStatus:B.status,isPreviewReady:fe,isArmed:_e,previewKind:ve,hasPreview:!!B.preview,hasPort:typeof B.port=="number",viewEnabled:((yt=(Le=B.actions)==null?void 0:Le.view)==null?void 0:yt.enabled)??null,previewUnavailableReason:((lt=B.previewUnavailable)==null?void 0:lt.reason)??null}),z(B.workItemId),G(null),fe?(rt.current=B.workItemId,$t(!1),N(!0),pa(B)):(rt.current=null,$t(!1),_(null),y(!1),_e&&Qe.capture("variants_panel.preview_armed",{sessionId:Ce,fromVariantId:Ne==null?void 0:Ne.workItemId,toVariantId:B.workItemId,variantStatus:B.status,previewKind:ve,hasPreview:!!B.preview,hasPort:typeof B.port=="number",viewEnabled:((kt=(Rn=B.actions)==null?void 0:Rn.view)==null?void 0:kt.enabled)??null}),Dj(B)&&al(B)),Qe.capture("variants_panel.preview_switched",{sessionId:Ce,fromVariantId:Ne==null?void 0:Ne.workItemId,toVariantId:B.workItemId,armed:_e})},[L,Ce,N,z,G,qr,al,pa,je,_,y]),Ni=g.useCallback(B=>{var fe;if(ln.current){ln.current=!1;return}if(N(!0),G({sessionId:B.sessionId,variantId:B.variantId,previewKind:$d(B)?"dev_server":"static",references:B.references,projectPath:Et??void 0}),z(null),$t(!1),$d(B)){const _e=++li.current;x(!0),k(!0),(async()=>{var Ne;K({kind:"switch"}),Qe.capture("variants_panel.history_replay_started",{sessionId:B.sessionId,variantId:B.variantId});const ve=(Le,yt)=>{Qe.capture("variants_panel.history_replay_failed",{sessionId:B.sessionId,variantId:B.variantId,...yt}),x(!1),k(!1),G(lt=>lt?{...lt,previewError:Le}:null),_(null)};try{const Le=await Ft(EI(B,Ur),{method:"POST"});if(_e!==li.current)return;if(!Le.ok){const{message:lt,errorCode:Rn}=await Ta(Le);if(_e!==li.current)return;Xr.warn(`history replay failed: HTTP ${Le.status} ${Rn??""}`),ve(lt??`Preview startup failed (${Le.status})`,{httpStatus:Le.status,errorCode:Rn});return}const yt=await Le.json();if(_e!==li.current)return;k(!1),y(!1),w(null),_(CI({sessionId:B.sessionId,variantId:B.variantId,routePath:((Ne=B.previewRoutes)==null?void 0:Ne[0])??qt})),yt.alreadyRunning||v(lt=>lt+1),Qe.capture("variants_panel.history_replay_ready",{sessionId:B.sessionId,variantId:B.variantId})}catch(Le){if(_e!==li.current)return;Xr.warn("history replay failed",Le);const yt=Ks(Le,"Preview startup failed");ve(yt,{errorMessage:yt})}finally{_e===li.current&&K(null)}})();return}qr(),y(!1),w(null),_(Aw({sessionId:B.sessionId,variantId:B.variantId,projectPath:Et,routePath:(fe=B.previewRoutes)==null?void 0:fe[0]}))},[Et,qt,K,x,k,v,G,z,_,w,N,y,qr,Ur]);g.useEffect(()=>{if(!xt||An.current)return;const B=Ri.find(fe=>fe.sessionId===xt.sessionId&&fe.variantId===xt.variantId);B&&(An.current=!0,Ni(B))},[xt,Ri,Ni]);const Li=g.useCallback(async()=>{qr();const B=()=>{N(!0),z(null),G(null),$t(!0),rt.current=null,y(!1),w(null),_(null)};if(!Ce){B();return}K({kind:"switch"});try{const fe=await Ft(`/api/variants/${Ce}/preview-port`,{method:"POST",headers:{"content-type":"application/json"},body:JSON.stringify({variantId:null})});if(!fe.ok){Xr.warn(`switch to original failed: HTTP ${fe.status}`);return}B(),y(!0),Qe.capture("variants_panel.preview_switched",{sessionId:Ce,fromVariantId:L,toVariantId:null,target:"original",armed:!1})}catch(fe){Xr.warn("preview-port original switch failed",fe)}finally{K(null)}},[L,Ce,z,G,_,w,N,y,qr]),ma=g.useCallback(async(B,fe,_e)=>{Qe.capture("variants_panel.deploy_clicked",{sessionId:B,variantId:fe,variantLabel:_e});try{const ve=await Ft(`/api/variants/${B}/deploy`,{method:"POST",headers:{"content-type":"application/json"},body:JSON.stringify({variantId:fe,...i?{projectPath:i}:{}})});if(!ve.ok){const{message:yt,errorCode:lt}=await Ta(ve);return Xr.warn(`deploy failed: HTTP ${ve.status} ${lt??""} ${yt??""}`),Qe.capture("variants_panel.deploy_failed",{sessionId:B,variantId:fe,httpStatus:ve.status,errorCode:lt??null,errorMessage:yt??null}),nn.error("Couldn't deploy this direction",{description:yt??`The server rejected the request (HTTP ${ve.status}). Try again.`}),null}const Ne=await ve.json().catch(()=>null),Le=Ne==null?void 0:Ne.shareUrl;return Le?(await navigator.clipboard.writeText(Le).catch(()=>{}),Qe.capture("variants_panel.deploy_succeeded",{sessionId:B,variantId:fe}),nn.success(`"${_e}" is live — link copied`,{action:{label:"Open",onClick:()=>window.open(Le,"_blank","noopener")}}),Le):(nn.error("Couldn't deploy this direction",{description:"The deploy host returned an unexpected response."}),null)}catch(ve){return Xr.warn("deploy failed",ve),Qe.capture("variants_panel.deploy_failed",{sessionId:B,variantId:fe,httpStatus:null,errorCode:"NETWORK_ERROR",errorMessage:ve instanceof Error?ve.message:String(ve)}),nn.error("Couldn't deploy this direction",{description:"Network or server error. Check that the Rivet backend is reachable and try again."}),null}},[i]),To=g.useCallback(async B=>{if(!Ce)return;const fe=xe[B.workItemId];if(fe){await navigator.clipboard.writeText(fe).catch(()=>{}),nn.success("Share link copied",{action:{label:"Open",onClick:()=>window.open(fe,"_blank","noopener")}});return}K({kind:"deploy",variantId:B.workItemId});try{const _e=await ma(Ce,B.workItemId,B.label);_e&&oe(ve=>({...ve,[B.workItemId]:_e}))}finally{K(null)}},[Ce,xe,ma]),Tc=g.useCallback(async()=>{if(!(!Ce||Ie.length===0)){if(St){await navigator.clipboard.writeText(St).catch(()=>{}),nn.success("Canvas link copied",{action:{label:"Open",onClick:()=>window.open(St,"_blank","noopener")}});return}Qe.capture("variants_panel.deploy_clicked",{sessionId:Ce,variantId:"canvas",variantLabel:"Canvas",variantCount:Ie.length}),K({kind:"deploy-canvas"});try{const B=await Ft(`/api/variants/${Ce}/canvas/deploy`,{method:"POST",headers:{"content-type":"application/json"},body:JSON.stringify({variantIds:Ie.map(Le=>Le.workItemId),...i?{projectPath:i}:{}})});if(!B.ok){const{message:Le,errorCode:yt}=await Ta(B);Xr.warn(`canvas deploy failed: HTTP ${B.status} ${yt??""} ${Le??""}`),Qe.capture("variants_panel.deploy_failed",{sessionId:Ce,variantId:"canvas",httpStatus:B.status,errorCode:yt??null,errorMessage:Le??null,variantCount:Ie.length}),nn.error("Couldn't share this canvas",{description:Le??`The server rejected the request (HTTP ${B.status}). Try again.`});return}const fe=await B.json().catch(()=>null),_e=fe==null?void 0:fe.shareUrl;if(!_e){nn.error("Couldn't share this canvas",{description:"The deploy host returned an unexpected response."});return}const ve=Object.fromEntries(((fe==null?void 0:fe.variants)??[]).filter(Le=>typeof Le.variantId=="string"&&typeof Le.shareUrl=="string").map(Le=>[Le.variantId,Le.shareUrl])),Ne=Object.keys(ve).length>0?{...xe,...ve}:xe;Ne!==xe&&oe(Ne),await navigator.clipboard.writeText(_e).catch(()=>{}),Se({key:MI(Ie,Ne),shareUrl:_e}),Qe.capture("variants_panel.deploy_succeeded",{sessionId:Ce,variantId:"canvas",variantCount:Ie.length}),nn.success("Canvas is live — link copied",{action:{label:"Open",onClick:()=>window.open(_e,"_blank","noopener")}})}catch(B){Xr.warn("canvas deploy failed",B),Qe.capture("variants_panel.deploy_failed",{sessionId:Ce,variantId:"canvas",httpStatus:null,errorCode:"NETWORK_ERROR",errorMessage:B instanceof Error?B.message:String(B),variantCount:Ie.length}),nn.error("Couldn't share this canvas",{description:"Network or server error. Check that the Rivet backend is reachable and try again."})}finally{K(null)}}},[St,Ie,xe,i,Ce]),Bu=g.useCallback(async B=>{const fe=`${B.sessionId}:${B.variantId}`,_e=ze[fe];if(_e){await navigator.clipboard.writeText(_e).catch(()=>{}),nn.success("Share link copied",{action:{label:"Open",onClick:()=>window.open(_e,"_blank","noopener")}});return}on(fe);try{const ve=await ma(B.sessionId,B.variantId,B.label);ve&&ke(Ne=>({...Ne,[fe]:ve}))}finally{on(null)}},[ze,ma]),Ro=g.useCallback(async B=>{if(Ce){Qe.capture("variants_panel.remove_clicked",{sessionId:Ce,variantId:B.workItemId,variantLabelLength:B.label.length}),K({kind:"remove",variantId:B.workItemId});try{const fe=await Ft(`/api/variants/${Ce}/${B.workItemId}/remove`,{method:"POST",headers:{"content-type":"application/json"},body:"{}"});if(!fe.ok){const{message:_e}=await Ta(fe);Xr.warn(`remove failed: HTTP ${fe.status} ${_e??""}`),nn.error("Couldn't remove direction",{description:_e??`The server rejected the request (HTTP ${fe.status}). Try again.`});return}(B.workItemId===Bn||B.workItemId===L)&&(z(null),_(null),y(!1),v(_e=>_e+1))}catch(fe){Xr.warn("remove failed",fe),nn.error("Couldn't remove direction",{description:"Network or server error. Try again."})}finally{K(null)}}},[Ce,L,Bn,z,_,y,v]),un=g.useCallback(async B=>{if(!Et){nn.error("Couldn't remove direction",{description:"No project path available."});return}Qe.capture("variants_panel.remove_past_clicked",{sessionId:B.sessionId,variantId:B.variantId});const fe=`${B.sessionId}:${B.variantId}`,_e=ve=>ve.sessionId===B.sessionId&&ve.variantId===B.variantId;K({kind:"remove",variantId:fe}),Tn(ve=>ve.filter(Ne=>!_e(Ne))),X===fe&&(G(null),_(null),y(!1),v(ve=>ve+1));try{const ve=await Ft(`/api/variants/history/${encodeURIComponent(B.sessionId)}/${encodeURIComponent(B.variantId)}/remove`,{method:"POST",headers:{"content-type":"application/json"},body:JSON.stringify({projectPath:Et})});if(!ve.ok){const{message:Ne}=await Ta(ve);Tn(Le=>Le.some(_e)?Le:[...Le,B]),nn.error("Couldn't remove direction",{description:Ne??`The server rejected the request (HTTP ${ve.status}). Try again.`})}}catch(ve){Xr.warn("remove past failed",ve),Tn(Ne=>Ne.some(_e)?Ne:[...Ne,B]),nn.error("Couldn't remove direction",{description:"Network or server error. Try again."})}finally{K(null)}},[Et,X,G,_,y,v,Tn]),ga=g.useCallback(B=>{ie(B)},[]),Di=g.useCallback(B=>{if(!B.label||!B.run)return;const fe=B.rows.flatMap(ve=>ve.kind==="active"?[ve.variant]:[]),_e=B.rows.flatMap(ve=>ve.kind==="past"?[ve.entry]:[]);fe.length===0&&_e.length===0||ie({kind:"run",label:B.label,variants:fe,entries:_e})},[]),Io=g.useCallback(async()=>{if(!(!de||ce)){he(!0);try{if(de.kind==="active")await Ro(de.variant);else if(de.kind==="past")await un(de.entry);else{for(const B of de.variants)await Ro(B);for(const B of de.entries)await un(B)}}finally{he(!1),ie(null)}}},[de,ce,Ro,un]),[Or,Zu]=g.useState(null),[Rc,io]=g.useState(null),$s=g.useCallback(B=>{io(B)},[]),Wu=g.useCallback(()=>{io(null)},[]),Es=g.useCallback(async(B,fe)=>{io(null);const _e=fe.trim();if(!_e||B.kind==="original")return;if(B.kind==="active"){if(!Ce||_e===B.variant.label)return;Qe.capture("variants_panel.rename",{sessionId:Ce,variantId:B.variant.workItemId,labelLength:_e.length,past:!1});try{const Le=await Ft(`/api/variants/${Ce}/${B.variant.workItemId}/rename`,{method:"POST",headers:{"content-type":"application/json"},body:JSON.stringify({label:_e})});if(!Le.ok){const{message:yt}=await Ta(Le);nn.error("Couldn't rename direction",{description:yt??`The server rejected the request (HTTP ${Le.status}). Try again.`})}}catch(Le){Xr.warn("rename failed",Le),nn.error("Couldn't rename direction",{description:"Network or server error. Try again."})}return}const{entry:ve}=B;if(_e===ve.label.trim())return;if(!Et){nn.error("Couldn't rename direction",{description:"No project path available."});return}Qe.capture("variants_panel.rename",{sessionId:ve.sessionId,variantId:ve.variantId,labelLength:_e.length,past:!0});const Ne=Le=>Le.sessionId===ve.sessionId&&Le.variantId===ve.variantId;Tn(Le=>Le.map(yt=>Ne(yt)?{...yt,label:_e}:yt));try{const Le=await Ft(`/api/variants/history/${encodeURIComponent(ve.sessionId)}/${encodeURIComponent(ve.variantId)}/rename`,{method:"POST",headers:{"content-type":"application/json"},body:JSON.stringify({label:_e,projectPath:Et})});if(!Le.ok){const{message:yt}=await Ta(Le);Tn(lt=>lt.map(Rn=>Ne(Rn)?{...Rn,label:ve.label}:Rn)),nn.error("Couldn't rename direction",{description:yt??`The server rejected the request (HTTP ${Le.status}). Try again.`})}}catch(Le){Xr.warn("rename failed",Le),Tn(yt=>yt.map(lt=>Ne(lt)?{...lt,label:ve.label}:lt)),nn.error("Couldn't rename direction",{description:"Network or server error. Try again."})}},[Ce,Et,Tn]),[ih,ll]=g.useState(null),cl=g.useCallback(B=>{ll(B)},[]),Oo=g.useCallback(()=>{ll(null)},[]),F=g.useCallback(async(B,fe)=>{if(ll(null),!B.label||!B.run)return;const _e=B.label,ve=fe.trim();if(!ve||ve===_e)return;Qe.capture("variants_panel.rename_run",{runLabelLength:ve.length});const Ne="requestId"in B.run?B.run.requestId:void 0,Le=Ne?B.key:Mj({sessionId:B.run.sessionId,runLabel:ve}),yt=Le!==B.key;let lt=!1,Rn=!1;if(i!==null&&yt){const Jt=Sg(i);lt=Jt.has(B.key),Rn=Jt.has(Le),lt&&(Jt.add(Le),Iw(i,Jt),V())}const kt=Jt=>{if(i===null||!yt)return;const En=Sg(i);Jt?En.delete(B.key):(lt?En.add(B.key):En.delete(B.key),Rn?En.add(Le):En.delete(Le)),Iw(i,En),V()},cs=new Set(B.rows.flatMap(Jt=>Jt.kind==="past"?[`${Jt.entry.sessionId}:${Jt.entry.variantId}`]:[])),us=Jt=>cs.has(`${Jt.sessionId}:${Jt.variantId}`);Tn(Jt=>Jt.map(En=>us(En)?{...En,runLabel:ve}:En));const Cs=()=>Tn(Jt=>Jt.map(En=>us(En)?{...En,runLabel:_e}:En));try{const Jt=await Ft("/api/variants/runs/rename",{method:"POST",headers:{"content-type":"application/json"},body:JSON.stringify({sessionId:B.run.sessionId,...Ne?{requestId:Ne}:{},runLabel:_e,label:ve,...Et?{projectPath:Et}:{}})});if(Jt.ok)kt(!0);else{const{message:En}=await Ta(Jt);Cs(),kt(!1),nn.error("Couldn't rename run",{description:En??`The server rejected the request (HTTP ${Jt.status}). Try again.`})}}catch(Jt){Xr.warn("run rename failed",Jt),Cs(),kt(!1),nn.error("Couldn't rename run",{description:"Network or server error. Try again."})}},[Et,i,Tn]);g.useEffect(()=>{const B=n&&!r.current;if(r.current=n,os.current!==Ce){const _e=os.current===null;os.current=Ce;const ve=t.get(rv);if(B&&xt&&(ve==null?void 0:ve.sessionId)===xt.sessionId&&(ve==null?void 0:ve.variantId)===xt.variantId||(rt.current=null,Se(null),_(null),y(!1),w(null),N(),z(null),G(null),$t(!1),ss.current=!1,!_e))return}if(X||Tt||!Bn||e.active!==!0||rt.current===Bn)return;const fe=je.find(_e=>_e.workItemId===Bn);fe&&(rt.current=Bn,N(),pa(fe))},[Ce,n,xt,t,X,Tt,Bn,e,je,pa,N,z,G,_,w,y]),g.useEffect(()=>{!$||!is||(rt.current=null,G(null),z(is.workItemId),$t(!1))},[is,$,Ce,z,G]),g.useEffect(()=>{!$||is||dr||G(null)},[is,$,dr,Ce,G,ur]),g.useEffect(()=>{const B=q.trim().toLowerCase(),fe=[...je.map(lt=>({kind:"active",variant:lt})),...ur.map(lt=>({kind:"past",entry:lt})),...Un?[{kind:"original"}]:[]],_e=B?fe.filter(lt=>NI(lt,B)):fe,{pinned:ve,unpinned:Ne}=LI($I(II(_e,Ce),nr),Oi,Ce),Le=[...Q.has(dS)?[]:ve,...Ne.flatMap(lt=>lt.key!==""&&Q.has(lt.key)?[]:lt.rows)];return Le.length===0?void 0:jee(lt=>{if(rfe())return;if(lt.key==="Enter"){const En=je.find(fr=>fr.workItemId===Or);En&&(lt.preventDefault(),ls(En));return}if(lt.key!=="ArrowUp"&<.key!=="ArrowDown")return;lt.preventDefault();const Rn=L??Bn;let kt=Rn?`live:${Rn}`:null;X?kt=`past:${X}`:Ac&&(kt=Rj);const cs=kt?Le.findIndex(En=>Vf(En)===kt):-1;let us;if(cs===-1?us=lt.key==="ArrowDown"?0:Le.length-1:lt.key==="ArrowDown"?us=Math.min(cs+1,Le.length-1):us=Math.max(cs-1,0),us===cs)return;const Cs=Le[us];Cs.kind==="active"?ls(Cs.variant):Cs.kind==="past"?Ni(Cs.entry):Li();const Jt=document.querySelector(`[data-variant-key="${Vf(Cs)}"]`);Jt instanceof HTMLElement&&Jt.focus({preventScroll:!0})})},[je,ur,q,Un,Q,Oi,nr,Ce,L,X,Ac,Bn,Or,ls,Ni,Li]);const pe=je.find(B=>B.workItemId===Bn)??null,ge=X?ur.find(B=>`${B.sessionId}:${B.variantId}`===X)??null:null,Pe=!!ge,ft=[...(e.active?je:[]).map(B=>({kind:"active",variant:B})),...ur.map(B=>({kind:"past",entry:B})),...Un?[{kind:"original"}]:[]],Ct=q.trim().toLowerCase(),jt=Ct?ft.filter(B=>NI(B,Ct)):ft,an=$I(II(jt,Ce),nr),{pinned:vt,unpinned:$n}=LI(an,Oi,Ce);let ot=null;C&&(ot=C.source==="live"?`live:${C.variantId}`:`past:${C.sessionId}:${C.variantId}`);const Gr=new Set(je.map(B=>B.requestId).filter(Boolean)),va=s.filter(B=>!Gr.has(B.requestId)),$i=va.length>0,Mr=o&&!$i&&ft.length===0;return S.jsxs("div",{className:"flex h-full min-h-0 flex-col",children:[ft.length>0?S.jsx("div",{className:"pt-2 pr-5 pb-1 pl-3",children:S.jsxs("div",{className:"relative",children:[S.jsx(Oae,{size:13,className:"text-content-muted pointer-events-none absolute top-1/2 left-2 -translate-y-1/2"}),S.jsx("input",{type:"text",value:q,onChange:B=>H(B.target.value),placeholder:"Search directions…","aria-label":"Search directions",className:"border-main-border bg-main-input/40 text-content placeholder:text-content-muted focus:ring-content-muted/40 w-full rounded-md border py-1.5 pr-2 pl-7 text-xs focus:ring-1 focus:outline-none"})]})}):null,S.jsxs("div",{className:"flex-1 [scrollbar-gutter:stable] overflow-y-auto px-3 py-2",children:[$i?S.jsx(Qfe,{groups:va}):null,Mr?S.jsx(Jfe,{}):null,e.active&&ft.length===0&&!$i&&!Mr?S.jsx(ehe,{}):null,!e.active&&!$i&&!Mr&&ur.length===0&&!Un?S.jsx(the,{isMCPSession:h,mcpEditor:m}):null,ft.length>0&&jt.length===0?S.jsxs("p",{className:"text-content-muted px-1 py-6 text-center text-xs",children:["No directions match “",q.trim(),"”."]}):null,jt.length>0?S.jsx(Gfe,{groups:$n,pinned:vt,pinnedKeys:ks,draggedRowKey:ot,onDropPin:Wr,onDropUnpin:kr,onTogglePin:as,onReorder:Ut,collapsedRuns:Q,onToggleRun:U,activeVariantId:L??Bn,activePastKey:X,isOriginalSelected:Ac,busy:D,editingKey:Rc,onSelectActive:ls,onSelectPast:Ni,onSelectOriginal:Li,onActivePointerDown:Zr,onPastPointerDown:kn,onHover:Zu,onRemove:B=>ga({kind:"active",variant:B}),onRemovePast:B=>ga({kind:"past",entry:B}),onStartRename:$s,onCommitRename:Es,onCancelRename:Wu,editingRunKey:ih,onStartRunRename:cl,onCommitRunRename:F,onCancelRunRename:Oo,onRemoveRun:Di,onCopyVariantContext:Tfe,activeSessionId:e.active?e.sessionId:null,projectPath:Et}):null]}),c&&Pe&&ge?S.jsx(Ife,{entry:ge,deploying:gt===X,deployedUrl:X?ze[X]??null:null,onDeploy:Bu,isDeployDisabled:!d}):null,!Pe&&e.active?S.jsx(Xfe,{selectedVariant:pe,busy:D,onDeploy:To,onDeployCanvas:Tc,canShare:c,canDeploy:d&&(Qt==null?void 0:Qt.kind)==="fresh",canDeployCanvas:d&&f&&(Qt==null?void 0:Qt.kind)==="fresh",canvasVariantCount:Ie.length,canvasDeployedUrl:St,deployedUrl:pe?xe[pe.workItemId]??null:null}):null,S.jsx(Bfe,{target:de,isConfirming:ce,onCancel:()=>ie(null),onConfirm:Io})]})},Ufe=t=>t.kind==="active"?t.variant.label.trim()||"this direction":t.kind==="run"?t.label.trim()||"this run":t.entry.label.trim()||"this direction",Bfe=({target:t,isConfirming:e,onCancel:n,onConfirm:r})=>{if(!t)return null;const s=Ufe(t),i=t.kind==="run",o=i?t.variants.length+t.entries.length:0,l=i?"Remove run":"Remove direction";return S.jsx(J1,{open:!0,onOpenChange:c=>{!c&&!e&&n()},children:S.jsxs(ey,{children:[S.jsx(ty,{className:"z-max fixed inset-0 bg-black/40"}),S.jsx(ny,{className:"z-max border-main-border bg-main font-main fixed top-1/2 left-1/2 w-[360px] -translate-x-1/2 -translate-y-1/2 rounded-lg border shadow-2xl outline-none",children:S.jsxs("div",{className:"flex flex-col gap-3 p-4",children:[S.jsx(ry,{className:"text-content text-base font-medium",children:i?"Remove run?":"Remove direction?"}),S.jsx(sy,{className:"text-content-subtle text-sm leading-5",children:i?`This removes all ${o} directions in “${s}”.`:`This removes “${s}” from the directions list.`}),S.jsxs("div",{className:"flex justify-end gap-2 pt-1",children:[S.jsx("button",{type:"button",onClick:n,disabled:e,className:"text-content-subtle hover:bg-main-hover hover:text-content rounded-md px-3 py-1.5 text-sm font-medium transition-colors disabled:cursor-not-allowed disabled:opacity-50",children:"Cancel"}),S.jsx("button",{type:"button","aria-label":"Confirm remove direction",onClick:r,disabled:e,className:"rounded-md bg-red-500/15 px-3 py-1.5 text-sm font-medium text-red-200 transition-colors hover:bg-red-500/25 disabled:cursor-not-allowed disabled:opacity-50",children:e?"Removing...":l})]})]})})]})})},Vf=t=>t.kind==="active"?`live:${t.variant.workItemId}`:t.kind==="past"?`past:${t.entry.sessionId}:${t.entry.variantId}`:Rj,NI=(t,e)=>t.kind==="active"?Rw(e,t.variant.label,t.variant.runLabel):t.kind==="past"?Rw(e,t.entry.label,t.entry.runLabel,t.entry.brief):Rw(e,ZE,Ij),$j=(t,e)=>t.startsWith("live:")?`row:past:${e??""}:${t.slice(5)}`:`row:${t}`,jj=(t,e)=>$j(Vf(t),e),LI=(t,e,n)=>{if(e.length===0)return{pinned:[],unpinned:t};const r=new Set(e),s=new Map,i=[];for(const l of t){const c=[];for(const d of l.rows){const f=jj(d,n);r.has(f)?s.set(f,d):c.push(d)}c.length>0&&i.push(c.length===l.rows.length?l:{...l,rows:c})}return{pinned:e.flatMap(l=>{const c=s.get(l);return c?[c]:[]}),unpinned:i}},DI=(t,e,n)=>{if(!e||e.length===0)return t;const r=new Map(e.map((o,l)=>[o,l])),s=t.filter(o=>!r.has(n(o)));if(s.length===t.length)return t;const i=t.flatMap(o=>{const l=r.get(n(o));return l===void 0?[]:[{item:o,index:l}]}).sort((o,l)=>o.index-l.index).map(({item:o})=>o);return[...s,...i]},$I=(t,e)=>{const n=t.map(r=>{const s=e.rows[r.key];return!s||s.length===0?r:{...r,rows:DI(r.rows,s,Vf)}});return DI(n,e.groups,r=>r.key)},Zfe=t=>t.length<=RI?t:`${t.slice(0,RI-1)}…`,Wfe=(t,e)=>t.kind==="active"?e?`${e}:${t.variant.workItemId}`:null:t.kind==="past"?`${t.entry.sessionId}:${t.entry.variantId}`:null,qfe=t=>{var s,i;const e=[t.label.trim(),(s=t.description)==null?void 0:s.trim()].filter(o=>!!o).join(`
|
|
170
|
-
`);if(!t.reference)return e;if(t.projectId)return`rivet variants get ${t.projectId}/${t.reference}`;const n=((i=t.projectPath)==null?void 0:i.trim())??"",r=n?` --project '${n.replace(/'/g,"'\\''")}'`:"";return`rivet variants get ${t.reference}${r}`},Gfe=({groups:t,pinned:e,pinnedKeys:n,draggedRowKey:r,onDropPin:s,onDropUnpin:i,onTogglePin:o,onReorder:l,collapsedRuns:c,onToggleRun:d,activeVariantId:f,activePastKey:h,isOriginalSelected:m,busy:v,editingKey:_,onSelectActive:y,onSelectPast:w,onSelectOriginal:x,onActivePointerDown:k,onPastPointerDown:P,onHover:C,onRemove:T,onRemovePast:O,onStartRename:I,onCommitRename:R,onCancelRename:N,editingRunKey:L,onStartRunRename:z,onCommitRunRename:$,onCancelRunRename:G,onRemoveRun:X,onCopyVariantContext:q,activeSessionId:H,projectPath:ee})=>{const V=g.useRef(null),{activeIndex:Q,itemRects:U,sessionRef:D,handlers:K,registerItem:de}=uj(V,{snapTolerancePx:5}),[ie,ce]=g.useState(!1),[he,xe]=g.useState(!1),oe=c.has(dS),re=r!==null,Se=g.useMemo(()=>{if(!r)return null;const Ie=$j(r,H);if(n.has(Ie))return{container:up,key:Ie};const nt=t.find(St=>St.rows.some(Ce=>Vf(Ce)===r));return nt?{container:Cw(nt.key),key:r}:null},[r,n,t,H]),ze=(Se==null?void 0:Se.container)===up,{dropTarget:ke,onPointerMove:gt,onPointerUp:on}=bfe({containerRef:V,dragged:Se,yieldToSelector:ze?void 0:"[data-pinned-drop-zone]",restrictToSelector:ze?"[data-pinned-drop-zone]":void 0,onReorder:l}),Tt=Q!==null?U[Q]:null,$t=Ie=>Ie.kind==="active"?Ie.variant.workItemId===f:Ie.kind==="past"?`${Ie.entry.sessionId}:${Ie.entry.variantId}`===h:m,xt=(Ie,nt,St,Ce)=>{const Ot=Vf(Ie),Qt=jj(Ie,H);return S.jsx(Yfe,{rowKey:Ot,row:Ie,index:nt,isSelected:$t(Ie),isEditing:_===Ot,isPinned:n.has(Qt),onTogglePin:Et=>o(Qt,Et),reorderContainer:St,reorderKey:St===up?Qt:Ot,isNested:Ce,busy:v,registerItem:de,onSelectActive:y,onSelectPast:w,onSelectOriginal:x,onActivePointerDown:k,onPastPointerDown:P,onHover:C,onRemove:T,onRemovePast:O,onStartRename:I,onCommitRename:R,onCancelRename:N,onCopyVariantContext:q,activeSessionId:H,projectPath:ee},Ot)};let An=0;const Be=Ie=>{if(Ie.key==="")return Ie.rows.map(Ot=>xt(Ot,An++,Cw(Ie.key),!1));const nt=c.has(Ie.key),St=nt?null:Ie.rows.map(Ot=>xt(Ot,An++,Cw(Ie.key),!0)),Ce=Ie.label;return S.jsx(Kfe,{label:Ce??ZE,collapsed:nt,onToggle:()=>d(Ie.key),directionCount:Ie.rows.length,isEditing:Ce!==null&&L===Ie.key,onStartRename:Ce!==null?()=>z(Ie.key):void 0,onCommitRename:Ce!==null?Ot=>$(Ie,Ot):void 0,onCancelRename:G,onRemove:Ce!==null?()=>X(Ie):void 0,children:St},Ie.key)},je=e.length>0||re;return S.jsxs("div",{ref:V,className:"relative",onMouseEnter:K.onMouseEnter,onMouseMove:K.onMouseMove,onMouseLeave:K.onMouseLeave,onPointerMove:gt,onPointerUp:Ie=>{var nt;if(ze&&Se){const St=(nt=V.current)==null?void 0:nt.querySelector("[data-pinned-drop-zone]"),Ce=St==null?void 0:St.getBoundingClientRect();if(!(Ce!==void 0&&Ie.clientY>=Ce.top&&Ie.clientY<=Ce.bottom)){i(Se.key);return}}on()},children:[Se&&ke?S.jsx("div",{className:"bg-content-muted pointer-events-none absolute right-1 left-1 z-20 h-0.5 rounded-full",style:{top:ke.top}}):null,S.jsx(Si,{children:Tt&&S.jsx(Co.div,{className:"bg-hover pointer-events-none absolute z-0 rounded-md",initial:{opacity:0,top:Tt.top,left:Tt.left,width:Tt.width,height:Tt.height},animate:{opacity:1,top:Tt.top,left:Tt.left,width:Tt.width,height:Tt.height},exit:{opacity:0,transition:{duration:.06}},transition:{...cm.fast,opacity:{duration:.08}}},D.current)}),S.jsxs("ul",{className:"relative flex flex-col gap-2",children:[S.jsx(Si,{initial:!1,children:je?S.jsxs(Co.li,{initial:{height:0,opacity:0},animate:{height:"auto",opacity:1},exit:{height:0,opacity:0},transition:{duration:uS,ease:cS},"data-pinned-drop-zone":"",className:pn("overflow-hidden rounded-lg bg-white/[0.012] transition-shadow",re&&"ring-content-muted/30 ring-1",re&&ie&&"ring-content-muted/70 bg-white/[0.03]"),onPointerEnter:re?()=>ce(!0):void 0,onPointerLeave:re?()=>ce(!1):void 0,onPointerUp:re?()=>{ce(!1),s()}:void 0,children:[S.jsx("div",{"data-hover-dead-zone":"",children:S.jsxs("button",{type:"button",onClick:()=>d(dS),"aria-expanded":!oe,"aria-label":`${oe?"Expand":"Collapse"} pinned items`,className:"focus-visible:ring-content-muted/40 flex w-full items-center gap-2 px-3 py-2 text-left transition-colors hover:bg-white/[0.03] focus:outline-none focus-visible:ring-1 focus-visible:ring-inset",children:[S.jsx(Vx,{size:13,weight:"fill",className:"text-content-muted shrink-0"}),S.jsx("span",{className:"text-content min-w-0 flex-1 truncate text-sm font-medium",children:"Pinned"})]})}),S.jsx(Si,{initial:!1,children:!oe&&S.jsx(Co.div,{initial:{height:0,opacity:0},animate:{height:"auto",opacity:1},exit:{height:0,opacity:0},transition:{duration:uS,ease:cS},className:"overflow-hidden",children:e.length>0?S.jsx("ul",{className:"flex flex-col gap-2",children:e.map(Ie=>xt(Ie,An++,up,!1))}):null},"body")})]},"pinned-section"):null}),je&&t.length>0?S.jsxs("li",{className:pn("mt-2 overflow-hidden rounded-lg bg-white/[0.012] transition-shadow",ze&&"ring-content-muted/30 ring-1",ze&&he&&"ring-content-muted/70 bg-white/[0.03]"),onPointerEnter:ze?()=>xe(!0):void 0,onPointerLeave:ze?()=>xe(!1):void 0,onPointerUp:ze?()=>xe(!1):void 0,children:[S.jsxs("div",{"data-hover-dead-zone":"",className:"flex w-full items-center gap-2 px-3 py-2",children:[S.jsx(Dae,{size:13,weight:"fill",className:"text-content-muted shrink-0"}),S.jsx("span",{className:"text-content min-w-0 flex-1 truncate text-sm font-medium",children:"Directions"})]}),S.jsx("ul",{className:"flex flex-col gap-2",children:t.map(Ie=>Be(Ie))})]}):t.map(Ie=>Be(Ie))]})]})},Fj=({open:t,onOpenChange:e,triggerLabel:n,actions:r})=>{const{containerRef:s,onKeyDown:i}=dj({onDismiss:()=>e(!1)});return S.jsxs(jE,{open:t,onOpenChange:e,children:[S.jsx(Vu,{label:n,children:S.jsx(FE,{asChild:!0,children:S.jsx(ia,{type:"button",variant:"ghost",size:"icon-compact","aria-label":n,onClick:o=>o.stopPropagation(),onPointerDown:o=>o.stopPropagation(),className:Oj,children:S.jsx(Tae,{size:15,weight:"bold"})})})}),S.jsx(zE,{children:S.jsx(VE,{ref:s,onKeyDown:i,role:"menu",side:"bottom",align:"end",sideOffset:4,onCloseAutoFocus:o=>o.preventDefault(),className:"bg-popover shadow-surface-4 z-[60] min-w-[160px] rounded-lg p-1",children:r.map(o=>S.jsxs("button",{type:"button",role:"menuitem","data-menu-item":!0,disabled:o.disabled,onClick:l=>{l.stopPropagation(),e(!1),o.onSelect()},onPointerDown:l=>l.stopPropagation(),className:"text-content hover:bg-hover focus:bg-hover flex w-full items-center gap-2 rounded-md px-3 py-1.5 text-xs transition-colors focus:outline-none disabled:cursor-not-allowed disabled:opacity-50",children:[o.icon,o.label]},o.key))})})]})},Kfe=({label:t,collapsed:e,directionCount:n,onToggle:r,isEditing:s=!1,onStartRename:i,onCommitRename:o,onCancelRename:l,onRemove:c,children:d})=>{const f=so(),[h,m]=g.useState(!1),v=[...i?[{key:"rename",label:"Rename",icon:S.jsx(sD,{size:13,weight:"bold"}),onSelect:i}]:[],...c?[{key:"remove",label:"Remove",icon:S.jsx(pD,{size:13,weight:"bold"}),onSelect:c}]:[]],_=e?S.jsx(Iae,{size:13,weight:"fill",className:"shrink-0 text-sky-400"}):S.jsx(Rae,{size:13,weight:"fill",className:"shrink-0 text-sky-400"});return s&&o&&l?S.jsxs("li",{className:"overflow-hidden rounded-lg bg-white/[0.012]",children:[S.jsxs("div",{"data-hover-dead-zone":"",className:"bg-main-input flex w-full items-center gap-2 px-3 py-2",children:[_,S.jsx("span",{className:"min-w-0 flex-1",children:S.jsx(zj,{initial:t,onCommit:o,onCancel:l})})]}),S.jsx(Si,{initial:!1,children:!e&&S.jsx(Co.ul,{className:"overflow-hidden",children:d},"body")})]}):S.jsxs("li",{className:"overflow-hidden rounded-lg bg-white/[0.012]",children:[S.jsxs("div",{"data-hover-dead-zone":"",className:"group relative",children:[S.jsxs("button",{type:"button",onClick:y=>{if((y.metaKey||y.ctrlKey)&&v.length>0){m(!0);return}f==null||f.capture("variants_panel.folder_toggled",{isCollapsed:!e,directionCount:n}),r()},"aria-expanded":!e,"aria-label":`${e?"Expand":"Collapse"} ${t} directions`,className:"focus-visible:ring-content-muted/40 flex w-full items-center gap-2 px-3 py-2 text-left transition-colors hover:bg-white/[0.03] focus:outline-none focus-visible:ring-1 focus-visible:ring-inset",children:[_,S.jsx("span",{className:"text-content min-w-0 flex-1 truncate text-sm font-medium",children:t})]}),v.length>0&&S.jsx("div",{className:pn("absolute top-1.5 right-2 flex items-center gap-0.5 transition-opacity duration-150","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",h&&"pointer-events-auto opacity-100"),children:S.jsx(Fj,{open:h,onOpenChange:m,triggerLabel:`${t} run actions`,actions:v})})]}),S.jsx(Si,{initial:!1,children:!e&&S.jsx(Co.ul,{initial:{height:0,opacity:0},animate:{height:"auto",opacity:1},exit:{height:0,opacity:0},transition:{duration:uS,ease:cS},className:"overflow-hidden",children:d},"body")})]})},Yfe=({rowKey:t,row:e,index:n,isSelected:r,isEditing:s,isPinned:i,onTogglePin:o,reorderContainer:l,reorderKey:c,isNested:d,busy:f,registerItem:h,onSelectActive:m,onSelectPast:v,onSelectOriginal:_,onActivePointerDown:y,onPastPointerDown:w,onHover:x,onRemove:k,onRemovePast:P,onStartRename:C,onCommitRename:T,onCancelRename:O,onCopyVariantContext:I,activeSessionId:R,projectPath:N})=>{var Se,ze;const L=_t(xj),z=g.useRef(null);tfe(h,n,z);const[$,G]=g.useState(!1),X=e.kind==="active",q=e.kind==="original",H=e.kind==="active"?e.variant:null,ee=e.kind==="past"?e.entry:null,V=H?H.status==="succeeded":!0,Q=H?Mp(H):!0,U=H!==null&&(H.status==="pending"||H.status==="running"),D=(H==null?void 0:H.status)==="failed",K=(H==null?void 0:H.status)==="cancelled",de=H!==null&&(f==null?void 0:f.kind)==="remove"&&f.variantId===H.workItemId,ie=H!==null&&(((Se=H.refinement)==null?void 0:Se.status)==="pending"||((ze=H.refinement)==null?void 0:ze.status)==="running");let ce=ZE;H?ce=H.label||`Direction ${n+1}`:ee&&(ce=ee.label.trim()||"Untitled direction");let he=Ij;H?he=H.description:ee&&(he=ee.brief);const xe=he?Zfe(he):null,oe=Wfe(e,R),re=oe?"Copy variant reference":"Copy description";return s?S.jsx("li",{ref:z,"data-proximity-index":n,"data-reorder-container":l,"data-reorder-key":c,className:"group relative z-10",children:S.jsx("div",{className:pn("bg-main-input flex w-full items-start gap-2 rounded-md py-2 pr-3",d?"pl-[33px]":"pl-3"),children:S.jsxs("span",{className:"min-w-0 flex-1",children:[S.jsx(zj,{initial:ce,onCommit:ke=>T(e,ke),onCancel:O}),xe&&S.jsx("span",{className:"text-content-muted mt-1 line-clamp-2 block text-xs leading-snug",children:xe})]})})}):S.jsxs("li",{ref:z,"data-proximity-index":n,"data-reorder-container":l,"data-reorder-key":c,className:pn("group relative z-10 rounded-md",r&&"bg-main-input"),onMouseEnter:H?()=>x(H.workItemId):void 0,onMouseLeave:X?()=>x(null):void 0,children:[S.jsx("div",{role:"button",tabIndex:0,"data-variant-id":H==null?void 0:H.workItemId,"data-variant-key":t,onClick:ke=>{if(ke.metaKey||ke.ctrlKey){G(!0);return}const gt=window.getSelection();gt&&!gt.isCollapsed||(e.kind==="active"?m(e.variant):e.kind==="past"?v(e.entry):_())},onKeyDown:ke=>{(ke.key==="Enter"||ke.key===" ")&&(ke.preventDefault(),ke.stopPropagation(),e.kind==="active"?m(e.variant):e.kind==="past"?v(e.entry):_())},onPointerDown:ke=>{ke.metaKey||ke.ctrlKey||(e.kind==="active"?Q&&y(e.variant.workItemId,ke):e.kind==="past"&&w(e.entry,ke))},"aria-pressed":r,"aria-disabled":X?!1:void 0,"aria-busy":U||ie,className:pn("flex w-full items-start gap-2 rounded-md py-2 pr-3 text-left transition-colors focus:outline-none",d?"pl-[33px]":"pl-3",Q&&"cursor-grab active:cursor-grabbing",!Q&&"cursor-pointer"),style:Q?{touchAction:"none"}:void 0,children:S.jsxs("span",{className:"min-w-0 flex-1",children:[S.jsxs("span",{className:"flex items-center gap-2 pr-12",children:[(U||ie)&&S.jsx(BE,{className:"text-content-muted shrink-0 text-sm","data-testid":ie&&!U?"variant-refining":void 0}),S.jsx(Vu,{label:"Double-click to rename",disabled:q,children:S.jsx("span",{onDoubleClick:ke=>{ke.stopPropagation(),q||C(t)},className:pn("min-w-0 flex-1 truncate text-sm font-medium select-text",q?"cursor-default":"cursor-text",V||r?"text-content":"text-content-muted"),children:ce})}),D&&S.jsx(Vu,{label:(H==null?void 0:H.errorMessage)??(H==null?void 0:H.errorCode)??"Failed",disabled:!(H!=null&&H.errorMessage)&&!(H!=null&&H.errorCode),children:S.jsx("span",{className:"shrink-0",children:S.jsx(jI,{label:"Failed"})})}),K&&S.jsx(jI,{label:"Cancelled"})]}),xe&&S.jsx("span",{className:"text-content-muted mt-0.5 line-clamp-2 block cursor-text text-xs leading-snug select-text",children:xe})]})}),q?null:S.jsx(Nle,{references:(H==null?void 0:H.references)??(ee==null?void 0:ee.references),source:X?"active":"history",sessionId:(ee==null?void 0:ee.sessionId)??R,variantId:(ee==null?void 0:ee.variantId)??(H==null?void 0:H.workItemId),projectPath:N,className:d?"pl-[33px]":"pl-3"}),S.jsxs("div",{className:pn("absolute top-1.5 right-2 flex items-center gap-0.5 transition-opacity duration-150 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",$&&"pointer-events-auto opacity-100"),children:[S.jsx(ia,{variant:"ghost",size:"icon-compact",title:i?"Unpin direction":"Pin direction","aria-label":i?"Unpin direction":"Pin direction","aria-pressed":i,onPointerDown:ke=>ke.stopPropagation(),onKeyDown:ke=>{(ke.key!=="ArrowUp"&&ke.key!=="ArrowDown"||ke.altKey||ke.ctrlKey||ke.metaKey||ke.shiftKey)&&ke.stopPropagation()},onClick:ke=>{ke.stopPropagation(),o("button")},className:Oj,children:S.jsx(Vx,{weight:i?"fill":"bold"})}),S.jsx(Fj,{open:$,onOpenChange:G,triggerLabel:"Direction actions",actions:[...he||oe?[{key:"copy",label:re,icon:S.jsx(rm,{size:13,weight:"bold"}),onSelect:()=>I({text:qfe({label:ce,description:he,reference:oe,projectId:L,projectPath:N}),copyKind:oe?"reference":"description"})}]:[],{key:"pin",label:i?"Unpin":"Pin",icon:S.jsx(Vx,{size:13,weight:"bold"}),onSelect:()=>o("menu")},...q?[]:[{key:"rename",label:"Rename",icon:S.jsx(sD,{size:13,weight:"bold"}),onSelect:()=>C(t)},{key:"remove",label:"Remove",icon:S.jsx(pD,{size:13,weight:"bold"}),disabled:de,onSelect:()=>{e.kind==="active"?k(e.variant):e.kind==="past"&&P(e.entry)}}]]})]})]})},zj=({initial:t,onCommit:e,onCancel:n})=>{const[r,s]=g.useState(t),i=g.useRef(!1),o=g.useCallback(c=>{c&&(c.focus(),c.select())},[]),l=c=>{i.current||(i.current=!0,c?e(r):n())};return S.jsx("input",{ref:o,type:"text",value:r,maxLength:120,"aria-label":"Rename direction",onChange:c=>s(c.target.value),onKeyDown:c=>{c.stopPropagation(),c.key==="Enter"?(c.preventDefault(),l(!0)):c.key==="Escape"&&(c.preventDefault(),l(!1))},onBlur:()=>l(!0),onClick:c=>c.stopPropagation(),onPointerDown:c=>c.stopPropagation(),className:"border-content-muted/40 bg-main text-content focus:ring-content-muted/50 w-full rounded border px-1.5 py-0.5 text-sm font-medium focus:ring-1 focus:outline-none"})},jI=({label:t})=>S.jsx("span",{className:"bg-main-input text-content-muted shrink-0 rounded-full px-1.5 py-0.5 text-[10px] font-medium tracking-wide uppercase",children:t}),Xfe=({selectedVariant:t,busy:e,onDeploy:n,onDeployCanvas:r,canShare:s,canDeploy:i,canDeployCanvas:o,canvasVariantCount:l,canvasDeployedUrl:c,deployedUrl:d})=>{const f=t?Lj(t):!1,h=(e==null?void 0:e.kind)==="deploy"&&e.variantId===(t==null?void 0:t.workItemId),m=(e==null?void 0:e.kind)==="deploy-canvas",v=!i||!f||e!==null,_=o&&l>0,w=h?"Deploying…":d?"Copy link":"Share",k=m?"Sharing…":c?"Copy canvas link":"Share canvas";return S.jsxs("div",{className:"border-main-border bg-main-light flex shrink-0 items-center justify-between gap-3 border-t px-3 py-4",children:[S.jsx("div",{className:"min-w-0",children:t?S.jsxs(S.Fragment,{children:[S.jsx("div",{className:"text-content truncate text-sm font-medium",children:t.label.trim()||"Untitled direction"}),d?S.jsx("div",{className:"text-content-muted text-[11px]",children:"Deployed — share link ready"}):null]}):null}),S.jsx("div",{className:"flex shrink-0 items-center gap-2",children:s?S.jsx(Ej,{primaryLabel:w,primaryIcon:d&&!h?rm:void 0,primaryAction:()=>{t&&n(t)},isDisabled:v,isDropdownDisabled:e!==null,isLoading:h,loadingLabel:"Deploying…",dropdownAriaLabel:"More share actions",dropdownItems:_?[{label:k,icon:c&&!m?rm:void 0,onClick:r,isDisabled:e!==null}]:[]}):null})]})},Vj=()=>S.jsx("div",{"data-testid":"direction-skeleton-row","aria-hidden":"true",className:"flex w-full items-start rounded-md px-3 py-2",children:S.jsxs("span",{className:"min-w-0 flex-1",children:[S.jsxs("span",{className:"flex items-center gap-2",children:[S.jsx(BE,{className:"text-content-muted shrink-0 text-sm"}),S.jsx("span",{className:"bg-muted-foreground/15 h-3.5 w-28 animate-pulse rounded"})]}),S.jsx("span",{className:"mt-1.5 flex",children:S.jsx("span",{className:"bg-muted-foreground/10 h-2.5 w-full max-w-[14rem] animate-pulse rounded"})})]})}),Qfe=({groups:t})=>S.jsx("div",{className:"space-y-0.5",children:t.flatMap(e=>Array.from({length:Math.max(1,e.count)}).map((n,r)=>S.jsx(Vj,{},`${e.requestId}-${r}`)))}),Jfe=()=>S.jsx("div",{"data-testid":"direction-boot-skeletons",className:"space-y-0.5",children:Array.from({length:3}).map((t,e)=>S.jsx(Vj,{},e))}),ehe=()=>S.jsxs("div",{className:"flex flex-col items-center gap-2 px-4 py-8 text-center",children:[S.jsx("div",{className:"text-content text-sm",children:"No directions yet"}),S.jsx("div",{className:"text-content-muted text-xs",children:"They’ll appear here as they generate."})]}),FI="Try different ways to create a dropdown that feels fluid and dynamic",the=({isMCPSession:t=!1,mcpEditor:e=null})=>{const[n,r]=g.useState(!1),s=Afe(e),i=t?s:"your coding agent",o=()=>{navigator.clipboard.writeText(FI).then(()=>{r(!0),setTimeout(()=>r(!1),2e3)})};return S.jsxs("div",{className:"flex flex-col items-start gap-3 px-2 py-2",children:[S.jsx("p",{className:"text-content text-sm font-medium",children:"Create your first direction"}),S.jsxs("p",{className:"text-content-muted text-xs",children:["Use ",i," to generate directions."]}),S.jsxs("div",{className:"w-full",children:[S.jsx("p",{className:"text-content-muted mb-2 text-xs",children:"Here's a sample prompt to use:"}),S.jsxs("div",{className:"border-main-border bg-main-input relative rounded-md border px-3 py-2.5 pr-8",children:[S.jsxs("p",{className:"text-content-muted text-xs leading-snug",children:["“",FI,"”"]}),S.jsx("button",{type:"button",onClick:o,className:"text-content-muted hover:bg-main-border hover:text-content absolute top-2 right-2 rounded p-0.5 transition-colors",title:"Copy to clipboard",children:n?S.jsx(Aae,{className:"h-3.5 w-3.5 text-emerald-500",weight:"bold"}):S.jsx(rm,{className:"h-3.5 w-3.5",weight:"bold"})})]})]})]})},nhe="rivet:show-projects",rhe=t=>{const e=new URLSearchParams(t),n=e.get("libraryOrigin");if(e.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}},she=({onClose:t,libraryOrigin:e})=>{const n=so(),r=_t(gj),s=_t(oy),i=rhe(window.location.search),o=window.parent!==window&&i!==null,l=(s==null?void 0:s.split(/[\\/]/).filter(Boolean).pop())??"Project";if(!t)return null;let c=r?S.jsx("span",{className:"text-content min-w-0 truncate text-sm font-medium",title:r,children:r}):S.jsx("span",{});if(o||e){const d=S.jsxs("ol",{className:"flex min-w-0 items-center gap-1 text-xs",children:[S.jsx("li",{className:"shrink-0",children:S.jsx("button",{type:"button",onClick:async()=>{if(o&&i)window.parent.postMessage(nhe,i);else{try{const f=await Ft("/api/library/browser-launches",{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({view:"projects"})});if(!f.ok)throw new Error("The project library could not be opened.");const{url:h}=SJ.parse(await f.json());window.location.assign(h)}catch{nn.error("Could not open the project library. Please try again.");return}n==null||n.capture("library_view_changed",{view:"projects"})}},className:"text-content-subtle hover:bg-main-input hover:text-content focus-visible:outline-content rounded px-1 py-1 focus-visible:outline focus-visible:outline-2",children:"Projects"})}),S.jsx("li",{"aria-hidden":!0,className:"text-content-subtle shrink-0",children:S.jsx(Cae,{className:"h-3 w-3"})}),S.jsx("li",{className:"min-w-0",children:S.jsx("span",{"aria-current":"page",title:l,className:"text-content block truncate font-medium",children:l})})]});c=S.jsx("nav",{"aria-label":"Project breadcrumb",className:"ph-no-capture min-w-0 flex-1","data-rivet-private":!0,children:d})}return S.jsxs("div",{className:"border-main-border bg-main-light z-10 flex flex-shrink-0 items-center justify-between gap-2 border-b px-2.5 py-2.5",children:[c,S.jsx(Vu,{label:"Close panel",side:"bottom",children:S.jsx("button",{onClick:t,"aria-label":"Close panel",className:"text-content-subtle hover:bg-main-input hover:text-content flex h-6 w-6 flex-shrink-0 items-center justify-center rounded p-1 transition-colors",children:S.jsx(Mae,{className:"h-4 w-4",weight:"bold"})})})]})},ihe=Fe({agentModeAvailable:Ys(),email:se().optional(),userId:se().optional(),name:se().optional(),isMCPSession:Ys(),mcpEditor:se().nullable(),agentApplyMode:Vt(["embedded","external"]).nullable().optional(),queueAccessToken:se().nullable().optional(),projectPath:se(),projectId:se().uuid().nullable().optional(),libraryOrigin:se().url().nullable()}),Hj=async({signal:t})=>{const e=await Ft("/api/config",{signal:t});if(!e.ok)throw new Error(`Failed to fetch config: ${e.statusText}`);return ihe.parse(await e.json())},Uj=5e3,ohe=async({signal:t})=>{const e=await Ft("/api/account",{signal:t});if(!e.ok)throw new Error("Could not load your account.");return EJ.parse(await e.json())},ahe=t=>({isAuthenticated:t.agentModeAvailable,name:t.name,email:t.email,userId:t.userId}),lhe=t=>aa({queryKey:Qs.account,queryFn:ohe,enabled:t,refetchInterval:Uj,retry:!1}),che=t=>aa({queryKey:Qs.rivetConfig,queryFn:Hj,select:ahe,enabled:t,refetchInterval:Uj,retry:!1}),uhe=()=>{const t=window.location.pathname.startsWith("/rivet/library"),e=lhe(t),n=che(!t);return t?e:n},f1="rivet_just_signed_in",fS="https://rivet-proxy.onrender.com",dhe=t=>{const e=t.toLowerCase();return e.includes("timed out")?"timeout":e.includes("pop-up blocked")?"popup_blocked":e.includes("window was closed")?"popup_closed":e.includes("store session")?"credential_store_failed":"provider_failed"},Mw=({outcome:t,authAttemptId:e,startedAt:n,now:r,failureReason:s,entryPoint:i="editor_gate"})=>({event:`visual_editor_auth_${t}`,properties:{auth_attempt_id:e,duration_ms:r-n,entry_point:i,method:"google_oauth",...s?{failure_reason:s}:{}}}),zI=oi("useLogin"),fhe=2e3,hhe=60,VI="Connecting to Google...",phe=`<!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>${VI}</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">${VI}</div>
|
|
198
|
-
</body>
|
|
199
|
-
</html>`,mhe=Fe({success:Ys(),authUrl:se().optional(),sessionId:se().optional(),pollSecret:se().optional(),error:se().optional(),message:se().optional()}),ghe=Fe({success:Ys(),token:se().optional(),refreshToken:se().optional(),user:Fe({id:se().optional(),email:se().optional()}).optional(),error:se().optional(),message:se().optional()}),vhe="/api/auth/install-ref",yhe=Fe({installRef:se().nullable()}),_he=async()=>{try{const t=await fetch(vhe);if(!t.ok)return;const e=yhe.safeParse(await t.json());return e.success?e.data.installRef??void 0:void 0}catch{return}},Bj=(t="editor_gate",e)=>{const n=so(),[r,s]=g.useState(!1),[i,o]=g.useState(null);return{startLogin:g.useCallback(async()=>{var m;const c=globalThis.crypto.randomUUID(),d=Date.now();s(!0),o(null);const f=Mw({outcome:"started",authAttemptId:c,entryPoint:t,startedAt:d,now:d});n==null||n.capture(f.event,f.properties);let h=null;try{if(h=window.open("","_blank"),!h)throw new Error("Pop-up blocked. Please allow pop-ups and try again.");try{h.document.open(),h.document.write(phe),h.document.close()}catch(x){zI.warn("Failed to render loading state in auth popup:",x)}const v=await _he(),_=await fetch(`${fS}/api/auth/google/start`,{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({source:"core",...v?{ref:v}:{}})}),y=mhe.safeParse(await _.json());if(!y.success)throw new Error("Invalid Google login response");const w=y.data;if(!_.ok||!w.success||!w.authUrl||!w.sessionId||!w.pollSecret)throw new Error(w.error||w.message||"Failed to start Google login");if(h.closed)throw new Error("Sign-in window was closed before Google login started.");h.location.href=w.authUrl;for(let x=0;x<hhe;x+=1){if(h.closed)throw new Error("Sign-in window was closed before authentication completed.");const k=await fetch(`${fS}/api/auth/google/token`,{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({session:w.sessionId,pollSecret:w.pollSecret})}),P=ghe.safeParse(await k.json());if(!P.success)throw new Error("Invalid Google token response");const C=P.data;if(C.success&&C.token&&((m=C.user)!=null&&m.email)){const T={email:C.user.email,token:C.token,refreshToken:C.refreshToken,userId:C.user.id,...v?{installRef:v}:{}};if(e)await e(T);else if(!(await Ft("/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.");h.close(),window.sessionStorage.setItem(f1,"1");const O=Mw({outcome:"completed",authAttemptId:c,entryPoint:t,startedAt:d,now:Date.now()});n==null||n.capture(O.event,O.properties),window.location.reload();return}if(C.error&&C.error!=="Pending")throw new Error(C.error||"Google login failed");await new Promise(T=>setTimeout(T,fhe))}throw new Error("Authentication timed out. Please try again.")}catch(v){h&&!h.closed&&h.close();const _=Ks(v,"Failed to start login flow");zI.warn("Login failed:",_);const y=Mw({outcome:"failed",authAttemptId:c,entryPoint:t,startedAt:d,now:Date.now(),failureReason:dhe(_)});n==null||n.capture(y.event,y.properties),o(_),s(!1)}},[n,t,e]),isStartingLogin:r,loginError:i}},whe=oi("useIntegrations"),bhe=Fe({provider:se(),status:se(),externalUsername:se().nullable(),connectedAt:se()}),xhe=Fe({integrations:At(bhe).optional()}),She=Fe({authUrl:se().min(1).optional(),error:se().optional()}),khe="rivet:connect-result",Ehe=t=>typeof t=="object"&&t!==null&&t.type===khe,Che=mn(null),HI=async()=>{const t=await Ft("/api/integrations");if(!t.ok)throw new Error(`Failed to load integrations (${t.status})`);return xhe.parse(await t.json()).integrations??[]},Phe=async t=>{const e=await Ft(`/api/integrations/${t}`,{method:"DELETE"});if(!e.ok){const n=IN.safeParse(await e.json().catch(()=>({})));throw new Error(n.success&&n.data.error||`Could not disconnect ${t}`)}},Ahe=()=>{const t=Rm(),[e,n]=aL(Che),r=aa({queryKey:Qs.integrations,queryFn:HI,staleTime:1e4}),s=g.useCallback(async()=>(await t.invalidateQueries({queryKey:Qs.integrations,refetchType:"none"}),t.fetchQuery({queryKey:Qs.integrations,queryFn:HI})),[t]),i=g.useCallback(async c=>{const d=window.open("","_blank","width=560,height=720");if(!d)throw new Error("Popup blocked. Allow popups to connect.");n(c);try{const f=await Ft(`/api/integrations/${c}/connect`,{method:"POST"}),h=She.safeParse(await f.json().catch(()=>({}))),m=h.success?h.data:{};if(!f.ok||!m.authUrl)throw d.close(),new Error(m.error||`Could not connect ${c}`);return d.location.href=m.authUrl,await new Promise(v=>{let _=!1,y=null;const w=async(k,P=!1)=>{if(!_){_=!0,window.removeEventListener("message",x),y&&clearInterval(y);try{const T=(await s()).some(O=>O.provider===c&&O.status==="connected");v(P&&T?"connected":k)}catch{v(k)}}},x=k=>{if(Ehe(k.data)&&k.data.provider===c){if(k.data.status==="error"){whe.warn(`Connect failed for ${c}:`,k.data.message),w("failed");return}w("connected")}};window.addEventListener("message",x),y=setInterval(()=>{d.closed&&w("closed",!0)},500)})}finally{n(null)}},[s,n]),{mutateAsync:o}=QN({mutationFn:Phe,onSuccess:s}),l=g.useCallback(async c=>{n(c);try{await o(c)}finally{n(null)}},[o,n]);return{integrations:r.data??[],isLoading:r.isPending,error:r.error instanceof Error?r.error.message:null,pendingProvider:e,connect:i,disconnect:l,refetch:s}},Xc=({action:t,outcome:e,provider:n,entryPoint:r,durationMs:s,failureReason:i})=>({event:`visual_editor_reference_${t==="connect"?"connection":"disconnection"}_${e}`,properties:{provider:n,entry_point:r,...s!==void 0?{duration_ms:s}:{},...i?{failure_reason:i}:{}}}),Au=se().regex(/^[1-9]\d{0,15}$/).refine(t=>Number.isSafeInteger(Number(t))),Zj=se().min(1).max(4096),WE=t=>{const e=()=>new Error("Use an HTTPS Cosmos profile URL such as https://www.cosmos.so/username");let n;try{n=new URL(t)}catch{throw e()}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 e();let s;try{s=decodeURIComponent(r[0])}catch{throw e()}if(!/^[a-zA-Z0-9_.-]{1,100}$/.test(s)||["e","login","signup","explore","search","collections","settings","api","profile"].includes(s.toLowerCase()))throw e();return{username:s,url:`https://www.cosmos.so/${encodeURIComponent(s)}`}},Wj=se().max(2048).transform((t,e)=>{try{return WE(t).url}catch(n){return e.addIssue({code:_N.custom,message:Ks(n,"Invalid Cosmos profile URL")}),OM}}),qj=t=>{const e=()=>new Error("Use an HTTPS Cosmos collection URL such as https://www.cosmos.so/owner/collection");let n;try{n=new URL(t)}catch{throw e()}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 e();let s;try{s=r.map(i=>decodeURIComponent(i))}catch{throw e()}if(s.some(i=>!i.length||i.length>300||/[/\\\p{Cc}]/u.test(i)))throw e();return{ownerUsername:s[0],slug:s[1],subcollectionSlug:s[2],url:`https://www.cosmos.so/${s.map(encodeURIComponent).join("/")}`}},The=se().url().refine(t=>{const e=new URL(t);return e.protocol==="https:"&&e.hostname==="cdn.cosmos.so"&&!e.username&&!e.password&&!e.port}),Rhe=Fe({id:Au,title:se().min(1).max(500),url:se().url().transform(t=>qj(t).url),children:At(Au)}),Ihe=Fe({id:Au,url:se().url(),title:se().max(1e3),text:se().max(1e5),author:se().nullable(),owner:se().nullable(),sourceUrl:se().url().nullable(),images:At(Fe({url:The,representation:Vt(["image","video-cover"])})).max(100),unsupportedReason:se().optional()}),Ohe=Fe({collection:Rhe,elements:At(Ihe),total:Ln().int().nonnegative(),nextCursor:Zj.nullable()});uQ("status",[Ohe.extend({status:Rf("ok")}),Fe({status:Rf("error"),message:se(),reason:Vt(["rate_limited","provider_unavailable","collection_unavailable"]).optional(),retryAfterMs:Ln().nonnegative().optional()})]);const Gj=Fe({id:Au,username:se().min(1).max(100),title:se().max(500),url:se().transform(t=>WE(t).url)}),Mhe=Fe({id:Au,title:se().min(1).max(500),description:se().max(1e4).nullable(),url:se().transform(t=>qj(t).url),total:Ln().int().nonnegative(),parentId:Au.nullable(),children:At(Au).max(1e4)});Fe({profile:Gj,collections:At(Mhe),total:Ln().int().nonnegative(),nextCursor:Zj.nullable()});const Kj=Vt(["pinterest","arena","x"]),Nhe=Vt(["cosmos","pinterest","arena","x"]),tf=se().min(1).max(200).regex(/^[a-zA-Z0-9:_-]+$/),Yj={"www.cosmos.so":"cosmos","www.pinterest.com":"pinterest","www.are.na":"arena","x.com":"x"},Lhe=se().url().refine(t=>{const e=new URL(t);return e.protocol==="https:"&&!e.username&&!e.password&&!e.port&&!e.search&&!e.hash&&Kj.safeParse(Yj[e.hostname]).success&&/^\/[a-zA-Z0-9_-]+\/?$/.test(e.pathname)},"Use a canonical reference provider profile URL"),qE=Fe({id:tf,username:se().min(1).max(100),title:se().max(500),url:Am([Wj,Lhe])}).transform(t=>Yj[new URL(t.url).hostname]==="cosmos"?Gj.parse(t):t),GE=Fe({id:tf,title:se().min(1).max(500),description:se().max(1e4).nullable(),url:se().url().nullable(),total:Ln().int().nonnegative().nullable(),parentId:tf.nullable(),children:At(tf).max(1e4)});Am([Fe({url:Wj}).strict(),Fe({provider:Kj}).strict()]);const Dhe=Fe({collections:At(GE),total:Ln().int().nonnegative().nullable(),nextCursor:se().min(1).max(4096).nullable()});Dhe.extend({profile:qE});const um=1e3,$he=1e4,jhe=Fe({profile:qE,collections:At(GE).max(um),total:Ln().int().nonnegative().max(um)}),Fhe=jhe.extend({id:se().uuid(),createdAt:se().datetime()}),zhe=Fe({collection:GE,collectionIds:At(tf).min(1).max(um),references:At(TN.extend({provider:Nhe})).max($he)}),Vhe=Fe({discoveryId:se().uuid(),runtime:Tm,sources:At(zhe).min(1).max(um),reusableCount:Ln().int().nonnegative()});Vhe.extend({id:se().uuid(),profile:qE,revision:se().regex(/^[a-f0-9]{64}$/),createdAt:se().datetime(),expiresAt:se().datetime(),approvedAt:se().datetime().nullable(),jobIds:At(se().uuid())});Fe({discoveryId:se().uuid(),collectionIds:At(tf).min(1).max(um),runtime:Tm}).strict();Fe({id:se().uuid(),revision:se().regex(/^[a-f0-9]{64}$/),isApproved:Rf(!0)}).strict();Vt(["later","dismiss","reset"]);const zm=async(t,e,n="GET",r)=>{if(window.location.pathname.startsWith("/rivet/library"))return RJ(t,{schema:e,method:n,body:r});const s=await Ft(t.replace(/^\/profile/,"/api/reference-profiles"),{method:n,headers:{"Content-Type":"application/json"},...r!==void 0?{body:JSON.stringify(r)}:{}}),i=await s.text();let o;try{o=JSON.parse(i)}catch{throw new Error(`Reference profile request failed (${s.status})`)}if(!s.ok)throw new Error(o.error??`Request failed (${s.status})`);return o},Xj=()=>zm("/profile",ON),Hhe=t=>aa({queryKey:Qs.cosmosProfile,queryFn:Xj,enabled:t}),Uhe=t=>zm("/profile/discoveries",Fhe,"POST",{url:t}),Bhe=({discoveryId:t,collectionIds:e,runtime:n})=>zm("/profile/import-plans",MN,"POST",{discoveryId:t,collectionIds:e,runtime:n}),Zhe=t=>zm("/profile",ON,"PATCH",{isEnabled:!0,runtime:t}),Whe=t=>zm(`/profile/import-plans/${t.id}/imports`,MN,"POST",{revision:t.revision,isApproved:!0}),qhe=({isOpen:t,onClose:e,onImported:n})=>{const[r,s]=g.useState(""),[i,o]=g.useState(null),[l,c]=g.useState([]),[d,f]=g.useState(""),[h,m]=g.useState(null),[v,_]=g.useState(null),[y,w]=g.useState(!1),x=g.useRef(0),k=so(),P=()=>{x.current+=1,s(""),o(null),c([]),f(""),m(null),_(null),w(!1)},C=()=>{k==null||k.capture("visual_editor_cosmos_modal_closed"),P(),e()},T=async N=>{N.preventDefault(),_(null);let L;try{L=WE(r.trim()).url}catch($){_(Ks($,"Invalid Cosmos profile URL"));return}k==null||k.capture("visual_editor_cosmos_discovery_started");const z=++x.current;w(!0);try{const $=await Uhe(L);if(z!==x.current)return;o($),c([]),k==null||k.capture("visual_editor_cosmos_discovery_completed",{collection_count:$.collections.length})}catch($){if(z!==x.current)return;_(Ks($,"Could not find Cosmos profile")),k==null||k.capture("visual_editor_cosmos_discovery_failed")}finally{z===x.current&&w(!1)}},O=async()=>{if(!i||l.length===0||!d)return;_(null),k==null||k.capture("visual_editor_cosmos_plan_started",{collection_count:l.length,runtime:d});const N=++x.current;w(!0);try{const L=await Bhe({discoveryId:i.id,collectionIds:l,runtime:d});if(N!==x.current)return;m(L),k==null||k.capture("visual_editor_cosmos_plan_completed",{collection_count:L.collectionCount,reference_count:L.referenceCount})}catch(L){if(N!==x.current)return;_(Ks(L,"Could not prepare import plan")),k==null||k.capture("visual_editor_cosmos_plan_failed")}finally{N===x.current&&w(!1)}},I=async()=>{if(!h||!d)return;_(null),k==null||k.capture("visual_editor_cosmos_import_started",{collection_count:h.collectionCount,reference_count:h.referenceCount});const N=++x.current;w(!0);try{if((await Xj()).profile.isEnabled||await Zhe(d),await Whe(h),k==null||k.capture("visual_editor_cosmos_import_completed",{reference_count:h.referenceCount}),n(),N!==x.current)return;P(),e()}catch(L){if(k==null||k.capture("visual_editor_cosmos_import_failed"),N!==x.current)return;_(Ks(L,"Could not start Cosmos import"))}finally{N===x.current&&w(!1)}},R=N=>{c(L=>L.includes(N)?L.filter(z=>z!==N):[...L,N]),k==null||k.capture("visual_editor_cosmos_collection_toggled")};return S.jsx(J1,{open:t,onOpenChange:N=>!N&&C(),children:S.jsxs(ey,{children:[S.jsx(ty,{className:"z-max fixed inset-0 bg-black/60"}),S.jsxs(ny,{className:"z-max border-main-border bg-main font-main fixed top-1/2 left-1/2 max-h-[min(680px,calc(100vh-32px))] w-[min(440px,calc(100vw-32px))] -translate-x-1/2 -translate-y-1/2 overflow-y-auto rounded-lg border shadow-2xl outline-none",children:[S.jsxs("div",{className:"border-main-border bg-main-light flex items-center justify-between rounded-t-lg border-b px-4 py-2",children:[S.jsx(ry,{className:"text-content text-base font-medium",children:"Connect Cosmos"}),S.jsx(ia,{onClick:C,title:"Close","aria-label":"Close",variant:"ghost",size:"icon-compact",children:S.jsx(uE,{className:"h-4 w-4",weight:"bold"})})]}),S.jsxs("div",{className:"space-y-4 p-4",children:[S.jsx(sy,{className:"text-content-subtle text-sm",children:"Add public collections from a Cosmos profile to your design references."}),i?null:S.jsxs("form",{onSubmit:N=>void T(N),className:"space-y-4",children:[S.jsx("label",{className:"text-content block text-sm font-medium",htmlFor:"cosmos-profile-url",children:"Cosmos profile URL"}),S.jsx("input",{id:"cosmos-profile-url",type:"url",required:!0,autoFocus:!0,value:r,onChange:N=>s(N.target.value),placeholder:"https://www.cosmos.so/username",className:"border-main-border bg-main-input text-content placeholder:text-content-muted focus:border-secondary w-full rounded-md border px-3 py-2 text-sm outline-none"}),S.jsx("button",{type:"submit",disabled:y,className:"bg-secondary text-secondary-foreground hover:bg-accent rounded-md px-4 py-2 text-sm font-medium disabled:opacity-50",children:y?"Finding collections…":"Continue"})]}),i&&!h?S.jsxs("div",{className:"space-y-4",children:[S.jsxs("p",{className:"text-content text-sm font-medium",children:["Choose collections from"," ",i.profile.title||i.profile.username]}),S.jsx("div",{className:"border-main-border max-h-60 divide-y overflow-y-auto rounded-md border",children:i.collections.map(N=>S.jsxs("label",{className:"text-content hover:bg-main-light flex cursor-pointer items-center gap-3 px-3 py-2 text-sm",children:[S.jsx("input",{type:"checkbox",checked:l.includes(N.id),disabled:y,onChange:()=>R(N.id)}),S.jsx("span",{className:"min-w-0 flex-1 truncate",children:N.title}),S.jsx("span",{className:"text-content-muted text-xs",children:N.total??"—"})]},N.id))}),i.collections.length===0?S.jsx("p",{className:"text-content-muted text-sm",children:"No public collections found for this profile."}):null,S.jsxs("label",{className:"text-content flex items-center justify-between gap-3 text-sm",children:["Analysis runtime",S.jsxs("select",{value:d,disabled:y,onChange:N=>{const L=N.target.value;f(L),k==null||k.capture("visual_editor_cosmos_runtime_selected",{runtime:L})},className:"border-main-border bg-main-input rounded-md border px-2 py-1.5",children:[S.jsx("option",{value:"",disabled:!0,children:"Select a runtime"}),S.jsx("option",{value:"codex",children:"Codex"}),S.jsx("option",{value:"claude",children:"Claude"}),S.jsx("option",{value:"cursor",children:"Cursor"})]})]}),S.jsx("button",{type:"button",onClick:()=>void O(),disabled:y||l.length===0||!d,className:"bg-secondary text-secondary-foreground hover:bg-accent rounded-md px-4 py-2 text-sm font-medium disabled:opacity-50",children:y?"Preparing plan…":"Review import plan"}),S.jsx("button",{type:"button",onClick:()=>{k==null||k.capture("visual_editor_cosmos_profile_changed"),P()},disabled:y,className:"text-content-muted hover:text-content ml-3 text-sm",children:"Use another profile"})]}):null,h?S.jsxs("div",{className:"space-y-4 text-sm",children:[S.jsxs("p",{className:"text-content",children:[h.collectionCount," ",h.collectionCount===1?"collection":"collections"," ·"," ",h.referenceCount," ",h.referenceCount===1?"reference":"references"," ·"," ",h.imageCount," ",h.imageCount===1?"image":"images"]}),S.jsx("p",{className:"text-content-subtle",children:h.scopeDisclosure}),S.jsx("p",{className:"text-content-subtle",children:h.usageDisclosure}),S.jsxs("p",{className:"text-content-muted text-xs",children:[h.reusableCount," reusable · ",h.unsupportedCount," ","unsupported · runtime: ",d]}),S.jsx("button",{type:"button",onClick:()=>void I(),disabled:y,className:"bg-secondary text-secondary-foreground hover:bg-accent rounded-md px-4 py-2 text-sm font-medium disabled:opacity-50",children:y?"Starting import…":"Approve and import"}),S.jsx("button",{type:"button",onClick:()=>{k==null||k.capture("visual_editor_cosmos_plan_revised"),m(null)},disabled:y,className:"text-content-muted hover:text-content ml-3 text-sm",children:"Change selection"})]}):null,v?S.jsx("p",{role:"alert",className:"text-sm text-red-300",children:v}):null]})]})]})})},UI=oi("ConnectorsModal"),Ghe=[{provider:"x",name:"X",iconClassName:"text-content",icon:S.jsx(Ip,{provider:"x"})},{provider:"pinterest",name:"Pinterest",iconClassName:"text-[#e60023]",icon:S.jsx(Ip,{provider:"pinterest"})},{provider:"arena",name:"Are.na",iconClassName:"text-content",icon:S.jsx(Ip,{provider:"arena"})}],Khe={name:"Cosmos",iconClassName:"text-content",icon:S.jsx(Ip,{provider:"cosmos"})},BI=({meta:t,status:e,actionLabel:n,buttonLabel:r,isDisabled:s,isHighlighted:i,onAction:o})=>S.jsxs("li",{className:`flex min-h-[64px] items-center gap-3 py-3 ${i?"ring-secondary -mx-2 rounded-md px-2 ring-2":""}`,children:[S.jsx("span",{className:`grid h-7 w-7 flex-none place-items-center ${t.iconClassName}`,"aria-hidden":"true",children:t.icon}),S.jsxs("div",{className:"min-w-0 flex-1",children:[S.jsx("span",{className:"text-content block text-sm font-medium",children:t.name}),S.jsx("span",{className:"text-content-muted block truncate text-xs",children:e})]}),S.jsx("button",{type:"button","aria-label":n,onClick:o,disabled:s,className:"active-push bg-main-input text-content hover:bg-main-input/80 inline-flex min-h-8 w-24 flex-none items-center justify-center rounded-md px-3 text-xs font-medium transition-colors disabled:cursor-not-allowed disabled:opacity-50",children:r})]}),hS=({isOpen:t,onClose:e,context:n="menu",highlightProvider:r=null})=>{var O;const{integrations:s,isLoading:i,error:o,pendingProvider:l,connect:c,disconnect:d}=Ahe(),f=so(),[h,m]=g.useState(null),[v,_]=g.useState(!1),y=Hhe(t),w=I=>s.find(R=>R.provider===I),x=g.useCallback(I=>{const R=Date.now(),N=Xc({action:"connect",outcome:"started",provider:I,entryPoint:n});f==null||f.capture(N.event,N.properties),c(I).then(L=>{const z=Date.now()-R;if(L==="connected"){const G=Xc({action:"connect",outcome:"completed",provider:I,entryPoint:n,durationMs:z});f==null||f.capture(G.event,G.properties);return}const $=Xc({action:"connect",outcome:"failed",provider:I,entryPoint:n,durationMs:z,failureReason:L==="closed"?"popup_closed":"provider_failed"});f==null||f.capture($.event,$.properties)}).catch(L=>{const z=Ks(L,"Could not connect."),$=Xc({action:"connect",outcome:"failed",provider:I,entryPoint:n,durationMs:Date.now()-R,failureReason:z.includes("Popup blocked")?"popup_blocked":"request_failed"});f==null||f.capture($.event,$.properties),UI.warn(`Connect error for ${I}:`,z),nn.error(z)})},[c,n,f]),k=g.useCallback(I=>{const R=Date.now(),N=Xc({action:"disconnect",outcome:"started",provider:I,entryPoint:n});f==null||f.capture(N.event,N.properties),d(I).then(()=>{const L=Xc({action:"disconnect",outcome:"completed",provider:I,entryPoint:n,durationMs:Date.now()-R});f==null||f.capture(L.event,L.properties)}).catch(L=>{const z=Ks(L,"Could not disconnect."),$=Xc({action:"disconnect",outcome:"failed",provider:I,entryPoint:n,durationMs:Date.now()-R,failureReason:"request_failed"});f==null||f.capture($.event,$.properties),UI.warn(`Disconnect error for ${I}:`,z),nn.error(z)})},[n,d,f]),P=n==="onboarding",C=(O=y.data)==null?void 0:O.sources.some(I=>I.provider==="cosmos");let T=C?"Connected":"Not connected";return y.isError&&(T="Status unavailable"),y.isPending&&(T="Checking status…"),S.jsxs(S.Fragment,{children:[S.jsx(J1,{open:t,onOpenChange:I=>!I&&e(),children:S.jsxs(ey,{children:[S.jsx(ty,{className:"z-max fixed inset-0 bg-black/40"}),S.jsx(ny,{ref:m,className:"z-max border-main-border bg-main font-main fixed top-1/2 left-1/2 w-[min(440px,calc(100vw-32px))] -translate-x-1/2 -translate-y-1/2 rounded-lg border shadow-2xl outline-none",children:S.jsxs(Z$,{value:h,children:[S.jsxs("div",{className:"border-main-border bg-main-light flex items-center justify-between rounded-t-lg border-b px-4 py-2",children:[S.jsx(ry,{className:"text-content text-base font-medium",children:"Connect design references"}),S.jsx(ia,{onClick:e,title:"Close","aria-label":"Close",variant:"ghost",size:"icon-compact",children:S.jsx(uE,{className:"h-4 w-4",weight:"bold"})})]}),S.jsxs("div",{className:"flex flex-col gap-4 p-4",children:[S.jsx(sy,{className:"text-content-subtle text-sm",children:"Connect your references to add them to your Rivet library. Rivet can use them to inspire new design directions."}),o?S.jsx("p",{className:"rounded-lg bg-red-500/10 px-4 py-3 text-[13px] font-medium text-red-300",children:o}):null,S.jsxs("ul",{className:"divide-main-border divide-y","aria-label":"Design reference services",children:[Ghe.map(I=>{const R=w(I.provider),N=(R==null?void 0:R.status)==="connected",L=R==null?void 0:R.externalUsername;let z=N?`Connected${L?` as @${L}`:""}`:"Not connected";i&&(z="Checking status…");const $=l===I.provider,G=N?"Disconnect":"Connect";return S.jsx(BI,{meta:I,status:z,actionLabel:`${G} ${I.name}`,buttonLabel:$?`${G}ing…`:G,isDisabled:i||$,isHighlighted:r===I.provider,onAction:()=>N?k(I.provider):x(I.provider)},I.provider)}),S.jsx(BI,{meta:Khe,status:T,actionLabel:C?"Add Cosmos profile":"Connect Cosmos",buttonLabel:C?"Add profile":"Connect",isDisabled:!1,isHighlighted:!1,onAction:()=>{f==null||f.capture("visual_editor_cosmos_modal_opened"),_(!0)}})]}),P?S.jsxs("div",{className:"flex items-center justify-between gap-4",children:[S.jsx("p",{className:"text-content-subtle text-xs",children:"You can always do this later from the account menu."}),S.jsx("button",{type:"button",onClick:e,className:"active-push bg-secondary text-secondary-foreground hover:bg-accent flex-none rounded-lg px-3.5 py-2 text-[13px] font-medium transition-colors",children:"Skip for now"})]}):null]})]})})]})}),S.jsx(qhe,{isOpen:v,onClose:()=>_(!1),onImported:()=>{y.refetch()}})]})},ZI=({className:t=""})=>S.jsx("span",{"aria-hidden":"true",className:`rivet-skeleton block rounded ${t}`.trim()}),Yhe=oi("SupportTicketModal"),WI=5e3,Nw="feedback",Xhe=t=>{var r;if(!t)return null;const e=(r=t.formErrors)==null?void 0:r[0];if(e)return e;const n=t.fieldErrors??{};for(const s of Object.values(n)){const i=s==null?void 0:s[0];if(i)return i}return null},Qhe=async t=>{let e;try{const n=bJ.safeParse(await t.json());e=n.success?n.data:void 0}catch{e=void 0}if(t.status===400){if(typeof(e==null?void 0:e.details)=="string"&&e.details.trim())return e.details;if(typeof(e==null?void 0:e.details)=="object"&&e.details!==null){const n=Xhe(e.details);if(n)return n}return"Please check your feedback and try again."}return t.status>=500?typeof(e==null?void 0:e.details)=="string"&&e.details.trim()?e.details:"Could not send feedback right now. Please try again later.":typeof(e==null?void 0:e.error)=="string"&&e.error.trim()?e.error:`HTTP ${t.status}`},Jhe=({isOpen:t,onClose:e,contactEmail:n})=>{const r=so(),[s,i]=g.useState(""),[o,l]=g.useState(!1),[c,d]=g.useState(null),f=g.useCallback(()=>{i("")},[]),h=g.useCallback(()=>{o||(f(),e())},[o,e,f]),m=g.useCallback(async()=>{const w=s.trim();if(!(!w||o)){l(!0);try{const x=typeof(r==null?void 0:r.get_session_id)=="function"?r.get_session_id():void 0,k=typeof(r==null?void 0:r.get_distinct_id)=="function"?r.get_distinct_id():void 0,P=n==null?void 0:n.trim(),C=await Ft("/api/support/tickets",{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({type:Nw,message:w,contactEmail:P||void 0,metadata:{posthogSessionId:x??void 0,posthogDistinctId:k??void 0,appVersion:"0.27.0",appEnvironment:"production",pageUrl:window.location.href,userAgent:navigator.userAgent,submittedAt:new Date().toISOString()}})});if(!C.ok){const T=await Qhe(C);throw new Error(T)}r==null||r.capture("support_ticket_submitted",{ticket_type:Nw,has_posthog_session_id:!!x}),nn.success("Feedback sent",{description:"Thanks for sharing this."}),f(),e()}catch(x){const k=Ks(x,"Failed to send message");r==null||r.capture("support_ticket_submit_failed",{ticket_type:Nw,error:k}),Yhe.error("Failed to submit support ticket:",k),nn.error("Could not send feedback",{description:k})}finally{l(!1)}}},[n,o,s,e,r,f]),v=g.useCallback(w=>{w.key==="Enter"&&(w.metaKey||w.ctrlKey)&&(w.preventDefault(),m())},[m]),_=WI-s.length,y=o||s.trim().length===0;return S.jsx(J1,{open:t,onOpenChange:w=>!w&&h(),children:S.jsxs(ey,{children:[S.jsx(ty,{className:"z-max fixed inset-0 bg-black/40"}),S.jsx(ny,{ref:d,className:"z-max border-main-border bg-main font-main fixed top-1/2 left-1/2 w-[440px] -translate-x-1/2 -translate-y-1/2 rounded-lg border shadow-2xl outline-none",children:S.jsxs(Z$,{value:c,children:[S.jsxs("div",{className:"border-main-border bg-main-light flex items-center justify-between rounded-t-lg border-b px-4 py-2",children:[S.jsx(ry,{className:"text-content text-base font-medium",children:"Send feedback"}),S.jsx(ia,{onClick:h,disabled:o,title:"Close","aria-label":"Close",variant:"ghost",size:"icon-compact",children:S.jsx(uE,{className:"h-4 w-4",weight:"bold"})})]}),S.jsxs("div",{className:"flex flex-col gap-3 p-4",children:[S.jsx(sy,{className:"text-content-subtle text-sm",children:"Tell us what happened or what we can improve."}),S.jsxs("div",{className:"bg-main-input rounded-lg outline outline-1 outline-transparent transition-[outline-color] focus-within:outline-white/20",children:[S.jsx("textarea",{id:"support-ticket-message","aria-label":"Your feedback",value:s,onChange:w=>i(w.target.value),onKeyDown:v,maxLength:WI,rows:6,disabled:o,placeholder:"What happened?",className:"text-content placeholder-content-subtle 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"}),S.jsxs("div",{className:"flex items-center justify-between px-3 pt-1 pb-3",children:[S.jsx("span",{className:"text-content-subtle text-xs",children:"Context details are included automatically."}),S.jsxs("div",{className:"flex items-center gap-2",children:[_<=500&&S.jsx("span",{className:"text-content-subtle text-xs",children:_}),S.jsx(ia,{onClick:m,disabled:y,title:"Send feedback",shortcut:"⌘↵","aria-label":"Send feedback",size:"icon-compact",children:o?S.jsx(U1,{className:"h-5 w-5 animate-spin",weight:"bold"}):S.jsx(kae,{className:"h-5 w-5",weight:"bold"})})]})]})]})]})]})})]})})},epe=oi("ProfileAvatar"),Qj=(t,e)=>{const n=(t??"").trim();if(n)return n.split(/\s+/).filter(Boolean)[0]??"";const s=((e??"").split("@")[0]??"").split(/[._\-+]/).filter(Boolean)[0]??"";return s?s[0].toUpperCase()+s.slice(1):""},tpe=(t,e)=>Qj(t,e).charAt(0).toUpperCase(),npe=({className:t="",side:e="bottom",align:n="end"})=>{var G,X,q;const r=uhe(),s=((G=r.data)==null?void 0:G.name)??null,i=((X=r.data)==null?void 0:X.email)??null,o=((q=r.data)==null?void 0:q.isAuthenticated)===!0,l=so(),{startLogin:c,isStartingLogin:d,loginError:f}=Bj("account_menu"),[h,m]=g.useState(!1),[v,_]=g.useState(!1),[y,w]=g.useState(!1),[x,k]=g.useState(!1),{containerRef:P,onKeyDown:C,onCloseAutoFocus:T}=dj({onDismiss:()=>$(!1)}),O=tpe(s,i);if(r.isPending)return S.jsxs("span",{"data-testid":"profile-avatar-skeleton","aria-hidden":"true",className:`flex shrink-0 items-center gap-2 ${t}`.trim(),children:[S.jsx(ZI,{className:"h-8 w-8 rounded-full"}),S.jsx(ZI,{className:"h-3.5 w-16"})]});const I=Qj(s,i),R=(s==null?void 0:s.trim())||null,N=(i==null?void 0:i.trim())||null,L=async()=>{k(!0);try{const H=await Ft("/api/auth/logout",{method:"POST",credentials:"same-origin"});if(!H.ok)throw new Error(`Logout failed: ${H.status}`);window.location.pathname.startsWith("/rivet/library")&&DN()}catch(H){epe.warn("Logout request failed",H),nn.error("Could not log out. Please try again."),k(!1);return}window.location.reload()};let z="Log in";o&&(z=I||"Account"),r.error&&!r.data&&(z="Account unavailable");const $=H=>{m(H),l==null||l.capture(`visual_editor_account_menu_${H?"opened":"closed"}`,{is_authenticated:o})};return S.jsxs(S.Fragment,{children:[S.jsxs(jE,{open:h,onOpenChange:$,children:[S.jsx(FE,{asChild:!0,children:S.jsxs("button",{type:"button","aria-label":"Account","data-rivet-private":!0,className:`ph-no-capture text-content-muted hover:text-content flex shrink-0 items-center gap-2 transition-colors select-none ${t}`,children:[S.jsx("span",{className:"border-main-border bg-main-input flex h-8 w-8 items-center justify-center rounded-full border text-xs leading-none font-semibold",children:O||S.jsx($ae,{className:"h-4 w-4",weight:"bold"})}),S.jsx("span",{className:"max-w-[8rem] truncate text-sm font-medium",children:z})]})}),S.jsx(zE,{children:S.jsxs(VE,{"data-rivet-private":!0,ref:P,onKeyDown:C,onCloseAutoFocus:T,role:"menu",className:"ph-no-capture bg-popover shadow-surface-4 z-[60] min-w-[180px] rounded-lg p-1",side:e,sideOffset:6,align:n,children:[R||N?S.jsxs("div",{className:"border-main-border border-b px-3 py-2",children:[R?S.jsx("div",{className:"text-content truncate text-sm font-medium",children:R}):null,N?S.jsx("div",{className:"text-content-muted truncate text-xs",children:N}):null]}):null,S.jsxs("button",{type:"button",role:"menuitem","data-menu-item":!0,onClick:()=>{$(!1),_(!0)},disabled:!o,className:"text-content hover:bg-hover focus-visible:bg-hover mt-1 flex w-full items-center gap-2 rounded-md px-3 py-1.5 text-sm transition-colors focus:outline-none disabled:cursor-not-allowed disabled:opacity-50",children:[S.jsx(fD,{className:"h-4 w-4",weight:"bold"}),"Connect design references"]}),S.jsxs("button",{type:"button",role:"menuitem","data-menu-item":!0,onClick:()=>{$(!1),w(!0)},className:"text-content hover:bg-hover focus-visible:bg-hover mt-1 flex w-full items-center gap-2 rounded-md px-3 py-1.5 text-sm transition-colors focus:outline-none",children:[S.jsx(Pae,{className:"h-4 w-4",weight:"bold"}),"Share feedback"]}),o?S.jsxs("button",{type:"button",role:"menuitem","data-menu-item":!0,onClick:L,disabled:x,className:"text-content hover:bg-hover focus-visible:bg-hover mt-1 flex w-full items-center gap-2 rounded-md px-3 py-1.5 text-sm transition-colors focus:outline-none disabled:cursor-not-allowed disabled:opacity-50",children:[S.jsx(Lae,{className:"h-4 w-4",weight:"bold"}),x?"Logging out…":"Log out"]}):null,!o&&!r.error?S.jsxs("button",{type:"button",role:"menuitem","data-menu-item":!0,onClick:()=>{c()},disabled:d,className:"text-content hover:bg-hover focus-visible:bg-hover mt-1 flex w-full items-center gap-2 rounded-md px-3 py-1.5 text-sm focus:outline-none disabled:opacity-50",children:[S.jsx(Nae,{className:"h-4 w-4",weight:"bold"}),d?"Logging in…":"Log in"]}):null,r.error?S.jsx("button",{type:"button",role:"menuitem","data-menu-item":!0,onClick:()=>{r.refetch()},className:"text-content mt-1 px-3 py-1.5 text-sm",children:"Retry account"}):null,f?S.jsx("p",{role:"alert",className:"max-w-64 px-3 py-2 text-sm text-red-300",children:f}):null]})})]}),v?S.jsx(hS,{isOpen:!0,onClose:()=>_(!1)}):null,S.jsx(Jhe,{isOpen:y,onClose:()=>w(!1),contactEmail:i??void 0})]})},rpe=({onClose:t,libraryOrigin:e})=>S.jsxs("div",{className:"bg-main font-main scrollbar-hide relative flex h-full w-full cursor-auto flex-col overflow-hidden shadow-2xl","data-cy":"element-inspector",children:[S.jsx(she,{onClose:t,libraryOrigin:e}),S.jsx("div",{className:"flex min-h-0 flex-1 flex-col",children:S.jsx(Hfe,{})}),S.jsx("div",{className:"border-main-border bg-main-light flex flex-shrink-0 items-center border-t px-2.5 py-2.5",children:S.jsx(npe,{side:"top",align:"start"})})]}),qI=oi("useServerConfig"),dm=[250,500,1e3,2e3,4e3],spe=dm.length+1,ipe=async()=>{var n;const t=await Ft("/api/health");if(!t.ok)throw new Error(`Failed to fetch config: ${t.status}`);const e=await t.json();if(!e.framework)throw new Error("Server did not return framework information");return{userPort:((n=e.ports)==null?void 0:n.userDevServer)||3e3,framework:e.framework}},ope=(t,e)=>t<dm.length?(qI.warn(`Server config fetch failed (attempt ${t+1}); retrying in ${dm[t]}ms`,e),!0):(qI.warn("Error fetching server config:",e),Qe==null||Qe.capture("preview_config_load_failed",{message:Ks(e,"unknown_error"),attempts:spe}),!1),ape=t=>dm[Math.min(t,dm.length-1)],lpe=()=>{const t=aa({queryKey:Qs.serverConfig,queryFn:ipe,retry:ope,retryDelay:ape,staleTime:1/0,refetchOnWindowFocus:!1,refetchOnReconnect:!1,networkMode:"always"}),e=t.isFetching&&!t.data,{refetch:n}=t;return{config:t.data??null,isLoading:e,error:t.error&&!e?t.error.message:null,retry:()=>{n()}}},cpe="#1C1C20",Ra=[118,118,124],GI=.85,upe=3,dpe=.15,kg=36,fpe=4.4,hpe=.7,ppe=3.5,mpe=.8,KI=9,gpe=11,vpe=[1.35,1.12,.95,.85],ype=[0,1.1,2.3,3.1],_pe=[0,.35,.16,.13],wpe=[.9,.5,.4,.35],Qc=3,Lw=[[{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}]],Eg=t=>{let e=t|0;return e=Math.imul(e^e>>>16,73244475),e=Math.imul(e^e>>>16,73244475),e^=e>>>16,(e>>>0)/4294967296},sv=t=>{const e=Math.min(1,Math.max(0,t));return e*e*(3-2*e)},Jc=(t,e)=>(Math.round(t/e-.5)+.5)*e,bpe=Math.sin(Math.PI/3),YI=(t,e,n,r,s)=>{if(t.beginPath(),e===0)t.arc(n,r,s,0,Math.PI*2);else if(e===1){const i=s*bpe;t.moveTo(n,r-s),t.lineTo(n+i,r+s/2),t.lineTo(n-i,r+s/2),t.closePath()}else{const i=s*.85;t.rect(n-i,r-i,i*2,i*2)}t.fill()},xpe=(t,e,n)=>{let r;if(n.hline){const s=Math.max(n.x1-t,t-n.x2,0),i=Math.abs(e-n.y1);r=Math.hypot(s,i)-KI}else{const s=Math.max(n.x1-t,t-n.x2,0),i=Math.max(n.y1-e,e-n.y2,0);s===0&&i===0?r=-Math.min(t-n.x1,n.x2-t,e-n.y1,n.y2-e):r=Math.hypot(s,i),r=Math.abs(r)-KI}return sv(.5-r/(2*gpe))},Jj=({className:t="",trackGlobalLoaderCount:e=!0})=>{const n=Lt(vj),r=g.useRef(null),s=g.useCallback(i=>{var L;if((L=r.current)==null||L.call(r),r.current=null,!i)return;const o=i.getContext("2d");if(!o)return;e&&n(z=>z+1);const l=window.matchMedia("(prefers-reduced-motion: reduce)").matches;let c=[],d=0,f=0,h=kg,m=kg,v=null,_=null,y=0,w=-1;const x=new Array(33),k=z=>{const $=Math.round(z*32);let G=x[$];if(!G){const X=$/32,q=Math.round(Ra[0]+(255-Ra[0])*X),H=Math.round(Ra[1]+(255-Ra[1])*X),ee=Math.round(Ra[2]+(255-Ra[2])*X);G=`rgba(${q}, ${H}, ${ee}, ${GI})`,x[$]=G}return G},P=z=>{const $=1-.35*z,G=Math.round(Ra[0]*$),X=Math.round(Ra[1]*$),q=Math.round(Ra[2]*$);return`rgba(${G}, ${X}, ${q}, ${GI})`},C=z=>{let $=Math.floor(Math.random()*Lw.length);$===w&&($=($+1)%Lw.length),w=$;const G=[0,0,0,0],X=Lw[$].map((D,K)=>{const de=D.level,ie=G[de]++,ce=ype[de]+ie*_pe[de],he=wpe[de]+Eg($*131+K*17+5)*.2;if(D.hline){const re=Jc((D.y??0)*f,m);return{hline:!0,x1:Jc(D.x1*d,h),x2:Jc(D.x2*d,h),y1:re,y2:re,level:de,start:ce,dur:he}}const xe=Jc(D.x1*d,h),oe=Jc((D.y1??0)*f,m);return{hline:!1,x1:xe,y1:oe,x2:Math.max(Jc(D.x2*d,h),xe+h),y2:Math.max(Jc((D.y2??0)*f,m),oe+m),level:de,start:ce,dur:he}}),q=X.reduce((D,K)=>Math.max(D,K.start+K.dur),0),H=c.length,ee=new Float32Array(H*Qc),V=new Int16Array(H*Qc).fill(-1),Q=new Uint8Array(H),U=X[0];for(let D=0;D<H;D++){const K=c[D];K.x>U.x1&&K.x<U.x2&&K.y>U.y1&&K.y<U.y2&&(Q[D]=1);const de=D*Qc;for(let ie=0;ie<X.length;ie++){const ce=xpe(K.x,K.y,X[ie]);if(ce<=.02)continue;let he=de;for(let xe=de;xe<de+Qc;xe++){if(V[xe]===-1){he=xe;break}ee[xe]<ee[he]&&(he=xe)}(V[he]===-1||ce>ee[he])&&(ee[he]=ce,V[he]=ie)}}return{startT:z,buildEnd:q,els:X,frame:U,cellQ:ee,cellEl:V,inFrame:Q}},T=()=>{const z=i.getBoundingClientRect();d=Math.max(1,z.width),f=Math.max(1,z.height);const $=Math.min(2,window.devicePixelRatio||1);i.width=Math.round(d*$),i.height=Math.round(f*$),o.setTransform($,0,0,$,0,0);const G=Math.max(8,Math.round(d/kg)),X=Math.max(6,Math.round(f/kg));h=d/G,m=f/X,c=[];for(let q=0;q<X;q++){const H=X>1?q/(X-1):.5,ee=fpe*(1+hpe*.4*(H*2-1));for(let V=0;V<G;V++){const Q=q*8191+V*131+1,U={x:(V+.5)*h,y:(q+.5)*m,size:ee,seed:Q,phase:Eg(Q),kind:0};U.kind=Math.floor(Eg(Q*97)*3),c.push(U)}}_=null,v=null},O=new Float32Array(32),I=z=>{o.fillStyle=cpe,o.fillRect(0,0,d,f),v||(v=C(z+.2)),z>=v.startT+v.buildEnd+ppe&&(_=v,y=z,v=C(z+.2));let $=0;_&&($=1-sv((z-y)/mpe),$<=0&&(_=null));const G=v;for(let U=0;U<G.els.length;U++){const D=G.els[U];O[U]=sv(Math.min(1,Math.max(0,(z-G.startT-D.start)/D.dur)))}const X=O[0],q=P(0),H=P(X),ee=$>0?P($):q,V=$>0?P(Math.max(X,$)):H,Q=c.length;for(let U=0;U<Q;U++){const D=c[U];let K=0,de=0;const ie=U*Qc;for(let ze=ie;ze<ie+Qc;ze++){const ke=G.cellEl[ze];if(ke<0)break;const gt=G.cellQ[ze]*O[ke];gt>K&&(K=gt,de=G.els[ke].level)}if(_)for(let ze=ie;ze<ie+Qc;ze++){const ke=_.cellEl[ze];if(ke<0)break;const gt=_.cellQ[ze]*$;gt>K&&(K=gt,de=_.els[ke].level)}const ce=z/upe+D.phase,he=Math.floor(ce),xe=ce-he,oe=sv(Math.min(xe,1-xe)/dpe),re=Math.floor(Eg(D.seed*97+he*7919)*3);re!==D.kind&&K<.02&&oe<.05&&(D.kind=re);const Se=Math.max(oe*(1-K),K);if(!(Se<.01))if(K<.02){const ze=G.inFrame[U]===1,ke=_?_.inFrame[U]===1:!1;ze?o.fillStyle=ke?V:H:o.fillStyle=ke?ee:q;const gt=Math.max(ze?X:0,ke?$:0);YI(o,D.kind,D.x,D.y,D.size*Se*(1-.2*gt))}else{o.fillStyle=k(K);const ze=1+(vpe[de]-1)*K;YI(o,D.kind,D.x,D.y,D.size*Se*ze)}}};T();let R=0;if(l)v=C(-100),I(0);else{const z=performance.now(),$=G=>{I((G-z)/1e3),R=requestAnimationFrame($)};R=requestAnimationFrame($)}const N=new ResizeObserver(()=>{T(),l&&(v=C(-100),I(0))});N.observe(i),r.current=()=>{cancelAnimationFrame(R),N.disconnect(),e&&n(z=>z-1)}},[e,n]);return S.jsx("canvas",{ref:s,"aria-hidden":"true",className:`h-full w-full ${t}`.trim()})},XI={kind:"base"};function QI(t){return t.kind==="base"?"base":`variant:${t.sessionId}:${t.variantId}`}const Spe=async(t=null)=>{if(t)return kpe(t);let e;try{e=await Ft("/api/mcp/status")}catch{return{isOk:!1,unavailableReason:"rivet_unreachable",upstreamStatus:null}}if(e.status===404||!(e.headers.get("content-type")??"").toLowerCase().includes("application/json"))return Cg();if(!e.ok)return{isOk:!1,unavailableReason:"rivet_unreachable",upstreamStatus:null};let r;try{r=await e.json()}catch{return Cg()}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}:Cg()},eF=async t=>{try{const e=await fetch(t);return{isOk:e.status!==502&&e.status!==503,unavailableReason:"upstream_unreachable",upstreamStatus:e.status}}catch{return{isOk:!1,unavailableReason:"rivet_unreachable",upstreamStatus:null}}},kpe=t=>eF(t),Cg=()=>eF("/"),Dw=oi("usePreviewUpstreamHealth"),Epe=500,Cpe=4e3,Ppe=15e3,Ape=3,Tpe={completedProbeCount:0,isUpstreamReady:!1,unavailableReason:"upstream_unreachable",isFirstUnreachableWindowExceeded:!1,hasCapturedFirstReady:!1,hasCapturedUnreachable:!1,downSince:null,everReady:!1,consecutiveServerErrors:0,hasFiredPersistentErrorHook:!1,lastUpstreamStatus:null},Rpe=({history:t,outcome:e,now:n,startedAt:r,firstUnreachableCaptureAfterMs:s})=>{const i=[],{upstreamStatus:o}=e,l=e.isOk&&o!==null&&o>=500;let c=t.consecutiveServerErrors;l&&t.everReady?c+=1:e.isOk&&!l&&(c=0);const d=c>=Ape;let f=t.hasFiredPersistentErrorHook;d&&!f&&o!==null&&(f=!0,i.push({kind:"persistent_server_errors",upstreamStatus:o,consecutiveCount:c}));const h={...t,completedProbeCount:t.completedProbeCount+1,lastUpstreamStatus:o,consecutiveServerErrors:c,hasFiredPersistentErrorHook:f};if(e.isOk&&!d)return t.hasCapturedFirstReady?t.isUpstreamReady||i.push({kind:"restored"}):i.push({kind:"first_ready",readyAfterMs:n-r}),{history:{...h,everReady:h.everReady||!l,hasFiredPersistentErrorHook:h.hasFiredPersistentErrorHook&&l,isUpstreamReady:!0,unavailableReason:null,downSince:null,hasCapturedUnreachable:!1,isFirstUnreachableWindowExceeded:!1,hasCapturedFirstReady:!0},events:i};const m=t.downSince===null,v=t.downSince??n;let _=m?!1:t.hasCapturedUnreachable,y=m?!1:t.isFirstUnreachableWindowExceeded;t.isUpstreamReady&&i.push({kind:"lost",upstreamStatus:o});const w=n-v;return w>=s&&!_&&(_=!0,y=!0,i.push({kind:"first_unreachable",elapsedMs:w,upstreamStatus:o})),{history:{...h,isUpstreamReady:!1,unavailableReason:e.unavailableReason,downSince:v,hasCapturedUnreachable:_,isFirstUnreachableWindowExceeded:y},events:i}},JI=(t,e)=>({id:e,identity:t,startedAt:Date.now()}),Ipe=(t,e={})=>{const n=g.useId(),r=e.probeMsWhileDown??Epe,s=e.probeMsWhileUp??Cpe,i=e.firstUnreachableCaptureAfterMs??Ppe,o=e.probePath??null,l=e.skip??!1,c=t!=="static"&&!l,d=g.useRef(e.onPersistentUpstreamServerErrors);d.current=e.onPersistentUpstreamServerErrors;const f=c?JSON.stringify([t,o,r,s,i]):null,[h,m]=g.useState(()=>JI(f,0)),v=h.identity===f?h:JI(f,h.id+1);v!==h&&m(v);const[_,y]=g.useState(0),w=g.useRef(null),x=C=>{var T;switch(C.kind){case"persistent_server_errors":Qe==null||Qe.capture("preview_upstream_error_responses",{framework:t,upstream_status:C.upstreamStatus,consecutive_count:C.consecutiveCount}),Dw.warn(`Preview upstream is listening but has served ${C.consecutiveCount} consecutive ${C.upstreamStatus} responses`),(T=d.current)==null||T.call(d,{upstreamStatus:C.upstreamStatus,consecutiveCount:C.consecutiveCount});return;case"first_ready":Qe==null||Qe.capture("preview_dev_server_ready",{framework:t,ready_after_ms:C.readyAfterMs});return;case"restored":Qe==null||Qe.capture("preview_upstream_restored",{framework:t});return;case"lost":Qe==null||Qe.capture("preview_upstream_lost",{framework:t,upstream_status:C.upstreamStatus}),y(O=>O+1),Dw.warn("Preview upstream became unavailable after it was ready");return;case"first_unreachable":Qe==null||Qe.capture("preview_dev_server_unreachable",{framework:t,elapsed_ms:C.elapsedMs,upstream_status:C.upstreamStatus}),Dw.warn("Dev server did not become ready within timeout window");return;default:{const O=C;throw new Error(`Unhandled probe event: ${String(O)}`)}}},k=aa({queryKey:Qs.previewUpstreamHealth({instanceId:n,sessionId:v.id,rerunVersion:e.rerunProbeImmediatelyOnVersion??null}),queryFn:async({signal:C})=>{var N;const T=await Spe(o),O=((N=w.current)==null?void 0:N.sessionId)===v.id?w.current.history:Tpe;if(C.aborted)return O;const{history:I,events:R}=Rpe({history:O,outcome:T,now:Date.now(),startedAt:v.startedAt,firstUnreachableCaptureAfterMs:i});return w.current={sessionId:v.id,history:I},R.forEach(x),I},enabled:c,placeholderData:(C,T)=>(T==null?void 0:T.queryKey[1].sessionId)===v.id?C:void 0,refetchInterval:C=>{var T;return(T=C.state.data)!=null&&T.isUpstreamReady?s:r},refetchIntervalInBackground:!0,refetchOnWindowFocus:!1,refetchOnReconnect:!1,retry:!1,gcTime:0,networkMode:"always"});if(t==="static")return{isUpstreamReady:!0,iframeRemountKey:_,probeStartedAt:null,probeAttemptCount:0,isFirstUnreachableWindowExceeded:!1,initialProbeComplete:!0,unavailableReason:null};if(l)return{isUpstreamReady:!1,iframeRemountKey:_,probeStartedAt:null,probeAttemptCount:0,isFirstUnreachableWindowExceeded:!1,initialProbeComplete:!0,unavailableReason:"upstream_unreachable"};const P=k.data;return{isUpstreamReady:(P==null?void 0:P.isUpstreamReady)??!1,iframeRemountKey:_,probeStartedAt:v.startedAt,probeAttemptCount:((P==null?void 0:P.completedProbeCount)??0)+(k.isFetching?1:0),isFirstUnreachableWindowExceeded:(P==null?void 0:P.isFirstUnreachableWindowExceeded)??!1,initialProbeComplete:P!==void 0,unavailableReason:P?P.unavailableReason:"upstream_unreachable"}};function Ope(t){return t.enteringSplit&&t.isExistingSession&&t.hasActiveVariantProxy}const tF=t=>{var r;if(typeof window>"u")return"";const e=(r=window.__RIVET_BOOTSTRAP__)==null?void 0:r.previewOrigin;if(e)return e;const n=new URL(window.location.origin);return n.hostname="localhost",n.origin},pS=({agentApplyMode:t,url:e})=>e.startsWith("/")?`${tF()}${e}`:e,Mpe="allow-scripts allow-same-origin allow-forms allow-popups allow-modals",Npe=t=>Mpe,Lpe=oi("PreviewSurface"),Kh=(t,e)=>t==="about:blank"?"blank":t.includes("/api/variants/")?"static_artifact":e.kind==="variant"?"dev_server":"original",mS=({target:t,src:e,framework:n,remountKey:r,isActive:s=!0})=>{_t(ly);const i=so(),o=g.useRef(!1),l=g.useRef(s),c=g.useCallback(f=>{t.kind==="variant"&&(i==null||i.capture("variants_panel.preview_displayed",{sessionId:t.sessionId,variantId:t.variantId,renderedTarget:"variant",iframeSrcKind:Kh(e,t),framework:n,isReused:f}))},[n,i,e,t]),d=g.useCallback(f=>{f&&(s&&!l.current&&o.current&&c(!0),l.current=s)},[c,s]);return S.jsx("div",{ref:d,className:"relative h-full w-full",children:S.jsx("iframe",{src:e,className:"h-full w-full border-none",title:s?"Project Preview":"Retained Project Preview",tabIndex:s?void 0:-1,sandbox:Npe(),onLoad:()=>{o.current=!0,i==null||i.capture("preview_iframe_loaded",{framework:n,src_kind:Kh(e,t)}),s&&c(!1)},onError:()=>{i==null||i.capture("preview_iframe_load_failed",{framework:n,src_kind:Kh(e,t)}),s&&t.kind==="variant"&&(i==null||i.capture("variants_panel.preview_display_failed",{sessionId:t.sessionId,variantId:t.variantId,renderedTarget:"variant",iframeSrcKind:Kh(e,t),framework:n})),Lpe.warn("Preview iframe failed to load",{framework:n,src_kind:Kh(e,t)})}},r)})},Dpe=7,$pe=t=>{const e=QI(t.target),n=`${e}:${t.src}`,r=t.src==="about:blank",[s,i]=g.useState(()=>({selectedKey:n,remountKey:t.remountKey,selection:0,frames:r?[]:[{key:n,props:t,lastSelected:0}]}));if(s.selectedKey!==n||s.remountKey!==t.remountKey){const o=s.selection+1,l=s.remountKey!==t.remountKey;let c=s.frames.filter(d=>!l||QI(d.props.target)!==e);if(!r){const d=c.find(f=>f.key===n);if(d?c=c.map(f=>f===d?{...f,lastSelected:o}:f):c=[...c,{key:n,props:t,lastSelected:o}],c.length>Dpe){const f=c.reduce((h,m)=>m.lastSelected<h.lastSelected?m:h);c=c.filter(h=>h!==f)}}i({selectedKey:n,remountKey:t.remountKey,selection:o,frames:c})}return S.jsxs("div",{className:"relative h-full w-full",children:[s.frames.map(o=>{const l=!r&&o.key===n;return S.jsx("div",{className:"absolute inset-0",style:{visibility:l?"visible":"hidden",pointerEvents:l?"auto":"none"},"aria-hidden":!l,children:S.jsx(mS,{...o.props,isActive:l})},`${o.key}:${o.props.remountKey??""}`)}),r?S.jsx(mS,{...t}):null]})},jpe=g.lazy(()=>q4(()=>Promise.resolve().then(()=>_0e),void 0)),Fpe={surface:"relative flex h-full w-full items-center justify-center bg-main px-6",overlay:"absolute inset-0 z-10 flex items-center justify-center bg-main/90 px-6",page:"relative flex h-screen w-full items-center justify-center bg-main px-6"},zpe={sm:"text-lg font-semibold text-content",md:"text-2xl font-semibold text-content",lg:"text-3xl font-semibold text-content"},Vpe={neutral:"rounded-md border border-divider bg-transparent px-5 py-2 text-sm font-medium text-content transition-colors hover:bg-surface-3",ghost:"rounded-md px-5 py-2 text-sm font-medium text-content-muted transition-colors hover:text-content"},Tu=({backdrop:t,media:e,title:n,description:r,actions:s,tone:i="neutral",fill:o="surface",size:l="md",children:c,state:d,role:f="status",busy:h=!1,className:m=""})=>{const v=g.useCallback(y=>{y&&d&&(Qe==null||Qe.capture("status_surface_shown",{state:d,tone:i,fill:o}))},[d,i,o]),_=!!(e||n||r||c||s!=null&&s.length);return S.jsxs("div",{ref:v,className:`${Fpe[o]} ${m}`.trim(),role:f,"aria-live":"polite","aria-busy":h||void 0,"data-state":d,children:[t?S.jsx("div",{className:"absolute inset-0",children:t}):null,_?S.jsxs("div",{className:"relative z-10 flex max-w-sm flex-col items-center gap-5 text-center",children:[e,n?S.jsx("h2",{className:zpe[l],children:n}):null,r?S.jsx("p",{className:"text-content-muted text-base leading-relaxed",children:r}):null,c,s!=null&&s.length?S.jsx("div",{className:"flex flex-row items-center gap-3",children:s.map(y=>S.jsx("button",{type:"button",onClick:y.onClick,className:Vpe[y.variant??"neutral"],children:y.label},y.label))}):null]}):null]})},gS=({loader:t="coalesce",trackGlobalLoaderCount:e,size:n="lg",...r})=>t==="coalesce"?S.jsx(Tu,{...r,size:n,busy:!0,backdrop:S.jsx(Jj,{trackGlobalLoaderCount:e})}):t==="logo"?S.jsx(Tu,{...r,size:n,busy:!0,backdrop:S.jsx(g.Suspense,{fallback:null,children:S.jsx(jpe,{className:"absolute inset-0"})})}):S.jsx(Tu,{...r,size:n,busy:!0,media:S.jsx(U1,{"aria-hidden":!0,className:"text-content h-8 w-8 shrink-0 animate-spin",weight:"bold"})}),nF=({icon:t,...e})=>S.jsx(Tu,{...e,tone:"neutral",media:t?S.jsx("div",{className:"text-content-muted",children:t}):void 0}),KE=t=>S.jsx(Tu,{...t,tone:"error",role:"alert"}),e4="/static/",Hpe=t=>{try{return new URL(t,"http://localhost").pathname.endsWith(e4)}catch{return t.endsWith(e4)}},Upe=t=>t==="spawn_error"?"The direction is saved, but its preview process didn’t start.":t==="exited"?"The direction is saved, but its preview stopped before it was ready.":t==="timeout"?"The direction is saved, but its preview took too long to become ready.":t==="dependency_install_failed"?"The direction is saved, but its dependencies couldn’t be prepared. Fix the installation error, then retry the preview.":t==="compile_error"?"The direction is saved, but its app couldn’t compile. Fix the app error, then retry the preview.":t==="missing_dev_script"?"The direction is saved, but Rivet couldn’t find a dev script to preview it.":t==="missing_static_entry"?"The direction is saved, but Rivet couldn’t find an HTML entry to preview it.":"The direction is saved, but Rivet couldn’t prepare its preview.",Bpe=t=>{if(t.status==="failed"&&t.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:t.errorMessage??t.errorCode,isError:!0};if(t.status==="failed"&&t.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:t.errorMessage??t.errorCode,isError:!0};if(t.status==="failed")return{state:"variant_worker_failed",title:"This direction didn’t complete",description:"The worker stopped before producing a usable result.",detail:t.errorMessage??t.errorCode,isError:!0};if(t.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(t.status==="succeeded"&&t.previewUnavailable&&t.previewUnavailable.reason!=="idle_timeout"){const e=t.previewUnavailable.portInUse?"The preview port was already in use.":void 0;return{state:"preview_unavailable",title:"Rivet couldn’t preview this direction",description:Upe(t.previewUnavailable.reason),detail:t.previewUnavailable.detail??e,isError:!0}}return null},Zpe=({issue:t,retryTarget:e})=>{const n=so(),r=g.useRef(!1),[s,i]=g.useState(!1),[o,l]=g.useState(null),c=async()=>{if(!(!e||r.current)){r.current=!0,i(!0),l(null),n==null||n.capture("preview_retry_clicked",{session_id:e.sessionId,variant_id:e.variantId});try{const d=await Ft(`/api/variants/${encodeURIComponent(e.sessionId)}/preview-port`,{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({variantId:e.variantId,retry:!0})});if(!d.ok){const f=wJ.safeParse(await d.json().catch(()=>({})));throw new Error(f.success?f.data.message:"The preview could not restart. Try again.")}}catch(d){l(Ks(d,"The preview could not restart. Try again."))}finally{r.current=!1,i(!1)}}};return S.jsxs(Tu,{fill:"overlay",size:"sm",state:t.state,role:t.isError?"alert":"status",tone:t.isError?"error":"neutral",title:t.title,description:t.description,busy:s,actions:e&&!s?[{label:"Retry preview",onClick:()=>void c()}]:void 0,children:[s?S.jsx("p",{className:"text-content-subtle text-xs",children:"Starting preview…"}):null,o?S.jsx("p",{className:"text-content-subtle text-xs",children:o}):null,t.detail?S.jsx("p",{"data-rivet-private":!0,className:"ph-no-capture text-content-subtle max-h-40 overflow-auto text-xs leading-relaxed break-words whitespace-pre-wrap",children:t.detail}):null]})},Wpe=({isInteractionDisabled:t=!1,framework:e,userPort:n})=>{var An;const r=_t(oy),s=_t(sS),i=Lt(sS),o=_t(u1),l=Lt(u1),c=_t(Fm),d=_t(ly),f=_t(iS),h=_t(oS),m=_t(yj),v=_t(_j),_=Lt(oS),y=_t(vc),w=_t(rv),x=Lt(iS),k=c.active&&c.projectContext.kind==="fresh",P=_t(aS),C=c.active?c.variants.find(Be=>Be.workItemId===P&&(Be.status==="pending"||Be.status==="running"||Be.status==="succeeded"&&!Be.preview&&typeof Be.port!="number"&&(!Be.previewUnavailable||Be.previewUnavailable.reason==="idle_timeout")))??null:null,T=c.active&&c.variants.some(Be=>Be.status==="pending"||Be.status==="running"),O=k||T,I=c.active?c.variants.find(Be=>Be.workItemId===P)??null:null,R=I?Bpe(I):null,N=e==="static"&&o!==null&&Hpe(o);g.useEffect(()=>{c.active||x(!1)},[c.active,x]);const L=g.useRef(!1);g.useEffect(()=>{const Be=!!(y!=null&&y.left||y!=null&&y.right),je=Be&&!L.current;L.current=Be;const Ie=c.active?c.sessionId:null;!Ie||!Ope({enteringSplit:je,isExistingSession:c.active&&c.projectContext.kind==="existing",hasActiveVariantProxy:f&&h!==null})||(x(!1),_(null),i(nt=>nt+1),Ft(`/api/variants/${encodeURIComponent(Ie)}/preview-port`,{method:"POST",headers:{"content-type":"application/json"},body:JSON.stringify({variantId:null})}).catch(()=>{}))},[y,c,f,h,x,_,i]);const $=g.useMemo(()=>{var Ce;if(f||o&&!N||!c.active)return null;const{stage:Be,variants:je}=c,Ie=Be==="ready"||Be==="degraded",nt=je.some(Ot=>{var Qt,Et;return((Qt=Ot.refinement)==null?void 0:Qt.status)==="pending"||((Et=Ot.refinement)==null?void 0:Et.status)==="running"});if(!Ie&&!nt)return null;const St=je.find(Ot=>{var Qt;return Ot.status==="succeeded"&&((Qt=Ot.preview)==null?void 0:Qt.kind)==="static_artifact"});return((Ce=St==null?void 0:St.preview)==null?void 0:Ce.kind)==="static_artifact"?Pu({sessionId:c.sessionId,variant:St,projectContext:c.projectContext}):null},[N,o,f,c])??o,G=g.useMemo(()=>!c.active||!$?null:c.variants.find(Be=>{var je;return((je=Be.preview)==null?void 0:je.kind)==="static_artifact"&&$.startsWith(Be.preview.url)})??null,[$,c]),X=g.useMemo(()=>{if((w==null?void 0:w.previewKind)==="static"||(w==null?void 0:w.previewKind)==="dev_server"&&w.previewError||(w==null?void 0:w.previewKind)==="dev_server"&&$&&PI($))return{kind:"variant",sessionId:w.sessionId,variantId:w.variantId};if(!c.active)return XI;if(G)return{kind:"variant",sessionId:c.sessionId,variantId:G.workItemId};if($){const je=$.match(/\/__rivet\/preview\/variant\/([^/]+)\/([^/?#]+)/),Ie=je!=null&&je[1]?decodeURIComponent(je[1]):null,nt=je!=null&&je[2]?decodeURIComponent(je[2]):null;if(Ie===c.sessionId&&nt&&c.variants.some(Ot=>Ot.workItemId===nt))return{kind:"variant",sessionId:c.sessionId,variantId:nt};const St=$.match(/\/api\/variants\/[^/]+\/static\/([^/?#]+)/),Ce=St!=null&&St[1]?decodeURIComponent(St[1]):null;if(Ce&&c.variants.some(Ot=>Ot.workItemId===Ce))return{kind:"variant",sessionId:c.sessionId,variantId:Ce}}const Be=!!(y!=null&&y.left||y!=null&&y.right);return(!Be||k)&&!$&&f&&h&&c.variants.some(je=>je.workItemId===h)?{kind:"variant",sessionId:c.sessionId,variantId:h}:(!Be||k)&&!$&&P&&c.variants.some(je=>je.workItemId===P)?{kind:"variant",sessionId:c.sessionId,variantId:P}:XI},[w,G,c,f,h,$,y,k,P]),q=g.useRef(null);g.useEffect(()=>{var nt,St,Ce;if(!G||((nt=G.preview)==null?void 0:nt.kind)!=="static_artifact"||((St=G.refinement)==null?void 0:St.status)!=="succeeded")return;const Be=`${G.workItemId}:${G.refinement.workItemId}`;if(q.current===Be)return;if(q.current=Be,(Ce=G.previewRoutes)!=null&&Ce.length){i(Ot=>Ot+1);return}const je=G.preview.url.includes("?")?"&":"?",Ie=`${G.preview.url}${je}refinement=${encodeURIComponent(G.refinement.workItemId)}`;$!==Ie&&(l(Ie),i(Ot=>Ot+1))},[$,G,i,l,c]);const H=$!==null&&PI($),ee=$!==null&&!H||k&&!f&&!H,{isUpstreamReady:V,iframeRemountKey:Q,probeAttemptCount:U,initialProbeComplete:D}=Ipe(e,{rerunProbeImmediatelyOnVersion:s,probePath:H?$:null,skip:ee}),[K,de]=g.useState(()=>m&&V?s:null),ie=g.useRef(null);g.useEffect(()=>{if(!m){ie.current=null,de(null);return}if(K===s){ie.current=null;return}const Be=ie.current;if(!Be||Be.remountKey!==s){ie.current={remountKey:s,probeAttemptCount:U};return}V&&U>Be.probeAttemptCount&&(ie.current=null,de(s))},[K,s,m,U,V]);const he=$!==null&&!H||V,oe=v||m&&!H&&K!==s||m&&!he,re=`${Q}:${s}`,Se=Tj(window.location.pathname),ze=e==="static"?`/static${Se??"/"}`:Se??"/",ke=tF();let gt=null;$&&(gt=pS({agentApplyMode:d,url:$}));const on=H&&!he?"about:blank":gt,Tt=C||R||w!=null&&w.previewError||oe?"about:blank":on??(he?`${ke}${ze}`:"about:blank"),$t=!!C||!!R||!he&&D;let xt=null;if(w!=null&&w.previewError)xt=S.jsx(Tu,{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:S.jsx("p",{className:"text-content-subtle text-xs leading-relaxed break-words",children:w.previewError})});else if(oe)xt=S.jsx(gS,{fill:"overlay",loader:"coalesce",trackGlobalLoaderCount:!1,state:"preview_replay_boot"});else if(C)xt=S.jsx(gS,{fill:"overlay",loader:"coalesce",trackGlobalLoaderCount:!1,state:"variant_building",children:S.jsx("span",{className:"sr-only",children:"Building your direction"})});else if(R){const Be=c.active&&I&&R.state==="preview_unavailable"&&((An=I.previewUnavailable)==null?void 0:An.reason)!=="missing_static_entry"?{sessionId:c.sessionId,variantId:I.workItemId}:void 0;xt=S.jsx(Zpe,{issue:R,retryTarget:Be},I==null?void 0:I.workItemId)}else $t&&(xt=O?S.jsx(nF,{fill:"overlay",state:"preview_no_selection",title:"Nothing to preview yet",description:"Pick a direction from the panel."}):S.jsx(KE,{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 S.jsx("div",{className:"relative flex h-full min-h-0 w-full flex-col",children:S.jsxs("div",{className:"relative min-h-0 flex-1",children:[xt,S.jsx($pe,{target:X,src:Tt,framework:e,remountKey:re},r)]})})};function t4({side:t,sessionId:e,variantId:n,url:r,label:s,source:i,isFallback:o=!1}){var P;const l=_t(vc),c=Lt(vc),d=so(),f=_t(Fm),h=_t(ly),m=g.useRef(!1),v=g.useCallback(()=>{m.current||(m.current=!0,zf({source:i,sessionId:e,variantId:n}))},[i,e,n]),_=g.useCallback(()=>{if(o){c(null);const I=d1("ended",l);d==null||d.capture(I.event,I.properties);return}v();const C={...l};delete C[t];const T=C.left||C.right?C:null;c(T);const O=d1(T?"updated":"ended",T??l);d==null||d.capture(O.event,O.properties)},[o,d,c,t,l,v]),y=g.useMemo(()=>({kind:"variant",sessionId:e,variantId:n}),[e,n]),w=g.useMemo(()=>!f.active||f.sessionId!==e?null:f.variants.find(C=>C.workItemId===n)??null,[e,n,f]),x=g.useMemo(()=>{var T,O,I;let C=r;if(((T=w==null?void 0:w.preview)==null?void 0:T.kind)==="static_artifact"&&((O=w.refinement)==null?void 0:O.status)==="succeeded"){if((I=w.previewRoutes)!=null&&I.length)return pS({agentApplyMode:h,url:Pu({sessionId:e,variant:w,projectContext:null})??r});const R=w.preview.url.includes("?")?"&":"?";C=`${w.preview.url}${R}refinement=${encodeURIComponent(w.refinement.workItemId)}`}return pS({agentApplyMode:h,url:C})},[h,w,e,r]),k=((P=w==null?void 0:w.refinement)==null?void 0:P.status)==="succeeded"?`${n}:${w.refinement.workItemId}`:n;return S.jsxs("div",{className:"variant-split-secondary","data-cy":"variant-split-pane","data-variant-id":n,children:[S.jsxs("div",{className:"variant-split-secondary-toolbar",children:[S.jsx("span",{className:"variant-split-secondary-label",title:s,children:s}),S.jsx(Vu,{label:"Collapse",children:S.jsx("button",{type:"button",className:"variant-split-secondary-close",onClick:_,"aria-label":"Collapse split view",children:S.jsx("svg",{width:"12",height:"12",viewBox:"0 0 12 12","aria-hidden":"true",focusable:"false",children:S.jsx("path",{d:"M2.5 2.5 L9.5 9.5 M9.5 2.5 L2.5 9.5",stroke:"currentColor",strokeWidth:"1.4",strokeLinecap:"round"})})})})]}),S.jsx("div",{className:"variant-split-secondary-body relative min-h-0 flex-1",children:S.jsx(mS,{target:y,src:x,framework:"static",remountKey:k})})]})}function qpe(){const t=_t(Ff),e=_t(UE);return!t||!e?null:Lm.createPortal(S.jsx("div",{"aria-hidden":"true",className:"border-main-border bg-main 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(${e.x+12}px, ${e.y+12}px, 0)`},children:S.jsx("span",{className:"text-content truncate text-sm font-medium",children:t.label})}),document.body)}function Gpe(){const t=_t(Ff),e=_t(UE),n=_t(vc),r=Lt(Ff),s=Lt(vc),i=so(),o=g.useRef(null),[l,c]=g.useState(null),[d,f]=g.useState("hidden");g.useEffect(()=>{t||(f("hidden"),c(null))},[t]);const h=g.useCallback((v,_)=>{const y=o.current;if(!y)return null;const w=y.getBoundingClientRect();return v<w.left||v>w.right||_<w.top||_>w.bottom?null:v<(w.left+w.right)/2?"left":"right"},[]);if(g.useEffect(()=>{if(!t||!e)return;const v=h(e.x,e.y);c(_=>_===v?_:v),f(_=>{if(_==="exiting")return _;const y=v!==null?"visible":"hidden";return _===y?_:y})},[t,e,h]),g.useEffect(()=>{if(!t)return;const v=_=>{const y=h(_.clientX,_.clientY);if(y&&t.url){const w={sessionId:t.sessionId,variantId:t.variantId,label:t.label,url:t.url,source:t.source},x=n==null?void 0:n[y];x&&(x.sessionId!==w.sessionId||x.variantId!==w.variantId)&&zf(x);const k={...n??{},[y]:w};s(k);const P=d1(n?"updated":"started",k);i==null||i.capture(P.event,P.properties),f("exiting"),window.setTimeout(()=>r(null),220)}else zf(t),f("exiting"),window.setTimeout(()=>r(null),220)};return window.addEventListener("pointerup",v),window.addEventListener("pointercancel",v),()=>{window.removeEventListener("pointerup",v),window.removeEventListener("pointercancel",v)}},[t,h,i,r,s,n]),!t)return null;const m=["variant-drop-zones",d==="visible"&&"is-visible",d==="exiting"&&"is-exiting"].filter(Boolean).join(" ");return S.jsxs("div",{ref:o,className:m,"aria-hidden":"true",children:[S.jsx(n4,{side:"left",hovered:l==="left",canDrop:!!t.url,label:t.label}),S.jsx(n4,{side:"right",hovered:l==="right",canDrop:!!t.url,label:t.label})]})}function n4({side:t,hovered:e,canDrop:n,label:r}){return S.jsxs("div",{className:["variant-drop-zone",`is-${t}`,e&&"is-hover",!n&&"is-disabled"].filter(Boolean).join(" "),children:[S.jsxs("div",{className:"variant-drop-zone-inner",children:[S.jsx("div",{className:`variant-drop-zone-icon is-${t}`}),S.jsx("div",{className:"variant-drop-zone-caption",children:n?`Add ${t} split`:"Split unavailable for this direction"})]}),S.jsx("div",{className:"variant-drop-zone-preview","aria-hidden":"true",children:S.jsx("div",{className:"variant-drop-zone-preview-label",children:r})}),S.jsx("div",{className:"variant-drop-zone-border"})]})}const rF=(t,e,n)=>{var i,o,l;if(!t.active||t.sessionId!==e)return null;const r=t.variants.find(c=>c.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 Pu({sessionId:e,variant:r,projectContext:t.projectContext});if(((l=r.refinement)==null?void 0:l.status)!=="succeeded")return r.preview.url;const s=r.preview.url.includes("?")?"&":"?";return`${r.preview.url}${s}refinement=${encodeURIComponent(r.refinement.workItemId)}`},r4=(t,e)=>{if(!t)return;const n=rF(e,t.sessionId,t.variantId);return!n||n===t.url?t:{...t,url:n}},Kpe=()=>S.jsx("div",{"data-testid":"preview-boot-skeleton",role:"status","aria-busy":"true","aria-label":"Loading preview",className:"bg-main flex h-full min-h-0 w-full flex-1 flex-col p-3",children:S.jsx("div",{className:"border-main-border relative min-h-0 flex-1 overflow-hidden rounded-lg border",children:S.jsx(Jj,{trackGlobalLoaderCount:!1})})}),Ype=({isLoading:t=!1,isInteractionDisabled:e=!1})=>{const{config:n,retry:r,isLoading:s,error:i}=lpe();return s?S.jsx(Kpe,{}):i||!n?S.jsx(KE,{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()}}]}):S.jsx(Xpe,{isLoading:t,isInteractionDisabled:e,framework:n.framework,userPort:n.userPort})};function Xpe(t){const e=_t(vc),n=_t(Ff),r=_t(Fm),s=_t(u1),i=e==null?void 0:e.left,o=e==null?void 0:e.right,l=g.useMemo(()=>{var T,O;if(!r.active||r.projectContext.kind!=="fresh"||!(!!i!=!!o))return;const y=(T=i??o)==null?void 0:T.variantId,w=r.variants.filter(I=>{var R;return I.status==="succeeded"&&((R=I.preview)==null?void 0:R.kind)==="static_artifact"&&I.workItemId!==y}),x=s==null?void 0:s.replace(/[?&]refinement=[^&]*$/,""),P=w.find(I=>{var R;return((R=I.preview)==null?void 0:R.kind)==="static_artifact"&&(I.preview.url===x||Pu({sessionId:r.sessionId,variant:I,projectContext:r.projectContext})===s)})??w[0];if(((O=P==null?void 0:P.preview)==null?void 0:O.kind)!=="static_artifact")return;const C=rF(r,r.sessionId,P.workItemId);if(C)return{sessionId:r.sessionId,variantId:P.workItemId,label:P.label,url:C,source:"live"}},[r,i,o,s]),c=r4(i,r)??(o?l:void 0),d=r4(o,r)??(i?l:void 0),f=!i&&!!c,h=!o&&!!d,m=!!(c||d),v=S.jsx(Wpe,{isInteractionDisabled:t.isInteractionDisabled,framework:t.framework,userPort:t.userPort});return S.jsx("div",{className:"relative flex h-full min-h-0 w-full flex-1 flex-col",children:S.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:[S.jsxs("div",{className:"variant-preview-row flex h-full min-h-0 w-full flex-1",children:[c&&S.jsx(t4,{side:"left",sessionId:c.sessionId,variantId:c.variantId,url:c.url,label:c.label,source:c.source,isFallback:f},`left-${c.sessionId}:${c.variantId}:${c.url}`),S.jsx("div",{className:"variant-preview-primary flex h-full min-h-0 flex-1 flex-col",style:{display:c&&d?"none":void 0},"aria-hidden":!!(c&&d),children:v}),d&&S.jsx(t4,{side:"right",sessionId:d.sessionId,variantId:d.variantId,url:d.url,label:d.label,source:d.source,isFallback:h},`right-${d.sessionId}:${d.variantId}:${d.url}`)]}),S.jsx("div",{className:"variant-preview-atmosphere","aria-hidden":"true"}),S.jsx(Gpe,{}),S.jsx(qpe,{})]})})}function $a(t){if(t===void 0)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return t}function sF(t,e){t.prototype=Object.create(e.prototype),t.prototype.constructor=t,t.__proto__=e}/*!
|
|
200
|
-
* GSAP 3.15.1
|
|
201
|
-
* https://gsap.com
|
|
202
|
-
*
|
|
203
|
-
* @license Copyright 2008-2026, GreenSock. All rights reserved.
|
|
204
|
-
* Subject to the terms at https://gsap.com/standard-license
|
|
205
|
-
* @author: Jack Doyle, jack@greensock.com
|
|
206
|
-
*/var ki={autoSleep:120,force3D:"auto",nullTargetWarn:1,units:{lineHeight:""}},fm={duration:.5,overwrite:!1,delay:0},YE,ns,Vn,Xi=1e8,gn=1/Xi,vS=Math.PI*2,Qpe=vS/4,Jpe=0,iF=Math.sqrt,eme=Math.cos,tme=Math.sin,Hr=function(e){return typeof e=="string"},ir=function(e){return typeof e=="function"},nl=function(e){return typeof e=="number"},XE=function(e){return typeof e>"u"},da=function(e){return typeof e=="object"},Js=function(e){return e!==!1},QE=function(){return typeof window<"u"},Pg=function(e){return ir(e)||Hr(e)},oF=typeof ArrayBuffer=="function"&&ArrayBuffer.isView||function(){},Ss=Array.isArray,nme=/random\([^)]+\)/g,rme=/,\s*/g,s4=/(?:-?\.?\d|\.)+/gi,aF=/[-+=.]*\d+[.e\-+]*\d*[e\-+]*\d*/g,qd=/[-+=.]*\d+[.e-]*\d*[a-z%]*/g,$w=/[-+=.]*\d+\.?\d*(?:e-|e\+)?\d*/gi,lF=/[+-]=-?[.\d]+/,sme=/[^,'"\[\]\s]+/gi,ime=/^[+\-=e\s\d]*\d+[.\d]*([a-z]*|%)\s*$/i,Kn,Bo,yS,JE,Pi={},h1={},cF,uF=function(e){return(h1=Hf(e,Pi))&&ri},e6=function(e,n){return console.warn("Invalid property",e,"set to",n,"Missing plugin? gsap.registerPlugin()")},hm=function(e,n){return!n&&console.warn(e)},dF=function(e,n){return e&&(Pi[e]=n)&&h1&&(h1[e]=n)||Pi},pm=function(){return 0},ome={suppressEvents:!0,isStart:!0,kill:!1},iv={suppressEvents:!0,kill:!1},ame={suppressEvents:!0},t6={},sc=[],_S={},fF,mi={},jw={},i4=30,ov=[],n6="",r6=function(e){var n=e[0],r,s;if(da(n)||ir(n)||(e=[e]),!(r=(n._gsap||{}).harness)){for(s=ov.length;s--&&!ov[s].targetTest(n););r=ov[s]}for(s=e.length;s--;)e[s]&&(e[s]._gsap||(e[s]._gsap=new NF(e[s],r)))||e.splice(s,1);return e},Ru=function(e){return e._gsap||r6(Qi(e))[0]._gsap},hF=function(e,n,r){return(r=e[n])&&ir(r)?e[n]():XE(r)&&e.getAttribute&&e.getAttribute(n)||r},ei=function(e,n){return(e=e.split(",")).forEach(n)||e},lr=function(e){return Math.round(e*1e5)/1e5||0},Gn=function(e){return Math.round(e*1e7)/1e7||0},nf=function(e,n){var r=n.charAt(0),s=parseFloat(n.substr(2));return e=parseFloat(e),r==="+"?e+s:r==="-"?e-s:r==="*"?e*s:e/s},lme=function(e,n){for(var r=n.length,s=0;e.indexOf(n[s])<0&&++s<r;);return s<r},p1=function(){var e=sc.length,n=sc.slice(0),r,s;for(_S={},sc.length=0,r=0;r<e;r++)s=n[r],s&&s._lazy&&(s.render(s._lazy[0],s._lazy[1],!0)._lazy=0)},s6=function(e){return!!(e._initted||e._startAt||e.add)},pF=function(e,n,r,s){sc.length&&!ns&&p1(),e.render(n,r,!!(ns&&n<0&&s6(e))),sc.length&&!ns&&p1()},mF=function(e){var n=parseFloat(e);return(n||n===0)&&(e+"").match(sme).length<2?n:Hr(e)?e.trim():e},gF=function(e){return e},Ai=function(e,n){for(var r in n)r in e||(e[r]=n[r]);return e},cme=function(e){return function(n,r){for(var s in r)s in n||s==="duration"&&e||s==="ease"||(n[s]=r[s])}},Hf=function(e,n){for(var r in n)e[r]=n[r];return e},o4=function t(e,n){for(var r in n)r!=="__proto__"&&r!=="constructor"&&r!=="prototype"&&(e[r]=da(n[r])?t(e[r]||(e[r]={}),n[r]):n[r]);return e},m1=function(e,n){var r={},s;for(s in e)s in n||(r[s]=e[s]);return r},Np=function(e){var n=e.parent||Kn,r=e.keyframes?cme(Ss(e.keyframes)):Ai;if(Js(e.inherit))for(;n;)r(e,n.vars.defaults),n=n.parent||n._dp;return e},ume=function(e,n){for(var r=e.length,s=r===n.length;s&&r--&&e[r]===n[r];);return r<0},vF=function(e,n,r,s,i){var o=e[s],l;if(i)for(l=n[i];o&&o[i]>l;)o=o._prev;return o?(n._next=o._next,o._next=n):(n._next=e[r],e[r]=n),n._next?n._next._prev=n:e[s]=n,n._prev=o,n.parent=n._dp=e,n},uy=function(e,n,r,s){r===void 0&&(r="_first"),s===void 0&&(s="_last");var i=n._prev,o=n._next;i?i._next=o:e[r]===n&&(e[r]=o),o?o._prev=i:e[s]===n&&(e[s]=i),n._next=n._prev=n.parent=null},yc=function(e,n){e.parent&&(!n||e.parent.autoRemoveChildren)&&e.parent.remove&&e.parent.remove(e),e._act=0},Iu=function(e,n){if(e&&(!n||n._end>e._dur||n._start<0))for(var r=e;r;)r._dirty=1,r=r.parent;return e},dme=function(e){for(var n=e.parent;n&&n.parent;)n._dirty=1,n.totalDuration(),n=n.parent;return e},wS=function(e,n,r,s){return e._startAt&&(ns?e._startAt.revert(iv):e.vars.immediateRender&&!e.vars.autoRevert||e._startAt.render(n,!0,s))},fme=function t(e){return!e||e._ts&&t(e.parent)},a4=function(e){return e._repeat?Uf(e._tTime,e=e.duration()+e._rDelay)*e:0},Uf=function(e,n){var r=Math.floor(e=Gn(e/n));return e&&r===e?r-1:r},g1=function(e,n){return(e-n._start)*n._ts+(n._ts>=0?0:n._dirty?n.totalDuration():n._tDur)},dy=function(e){return e._end=Gn(e._start+(e._tDur/Math.abs(e._ts||e._rts||gn)||0))},fy=function(e,n){var r=e._dp;return r&&r.smoothChildTiming&&e._ts&&(e._start=Gn(r._time-(e._ts>0?n/e._ts:((e._dirty?e.totalDuration():e._tDur)-n)/-e._ts)),dy(e),r._dirty||Iu(r,e)),e},yF=function(e,n){var r;if((n._time||!n._dur&&n._initted||n._start<e._time&&(n._dur||!n.add))&&(r=g1(e.rawTime(),n),(!n._dur||Vm(0,n.totalDuration(),r)-n._tTime>gn)&&n.render(r,!0)),Iu(e,n)._dp&&e._initted&&e._time>=e._dur&&e._ts){if(e._dur<e.duration())for(r=e;r._dp;)r.rawTime()>=0&&r.totalTime(r._tTime),r=r._dp;e._zTime=-gn}},Xo=function(e,n,r,s){return n.parent&&yc(n),n._start=Gn((nl(r)?r:!r&&v1(n)&&(!e._last||e._last._start>=e._time)?e._last?e._last._start:e._time:r||e!==Kn?qi(e,r,n):e._time)+n._delay),n._end=Gn(n._start+(n.totalDuration()/Math.abs(n.timeScale())||0)),vF(e,n,"_first","_last",e._sort?"_start":0),v1(n)||(e._recent=n),s||yF(e,n),e._ts<0&&fy(e,e._tTime),e},_F=function(e,n){return(Pi.ScrollTrigger||e6("scrollTrigger",n))&&Pi.ScrollTrigger.create(n,e)},wF=function(e,n,r,s,i){if(o6(e,n,i),!e._initted)return 1;if(!r&&e._pt&&!ns&&(e._dur&&e.vars.lazy!==!1||!e._dur&&e.vars.lazy)&&fF!==_i.frame)return sc.push(e),e._lazy=[i,s],1},hme=function t(e){var n=e.parent;return n&&n._ts&&n._initted&&!n._lock&&(n.rawTime()<0||t(n))},v1=function(e){var n=e.data;return n==="isFromStart"||n==="isStart"},pme=function(e,n,r,s){var i=e.ratio,o=n<0||!n&&(!e._start&&hme(e)&&!(!e._initted&&v1(e))||(e._ts<0||e._dp._ts<0)&&!v1(e))?0:1,l=e._rDelay,c=0,d,f,h;if(l&&e._repeat&&(c=Vm(0,e._tDur,n),f=Uf(c,l),e._yoyo&&f&1&&(o=1-o),f!==Uf(e._tTime,l)&&(i=1-o,e.vars.repeatRefresh&&e._initted&&e.invalidate())),o!==i||ns||s||e._zTime===gn||!n&&e._zTime){if(!e._initted&&wF(e,n,s,r,c))return;for(h=e._zTime,e._zTime=n||(r?gn:0),r||(r=n&&!h),e.ratio=o,e._from&&(o=1-o),e._time=0,e._tTime=c,d=e._pt;d;)d.r(o,d.d),d=d._next;n<0&&wS(e,n,r,!0),e._onUpdate&&!r&&wi(e,"onUpdate"),c&&e._repeat&&!r&&e.parent&&wi(e,"onRepeat"),(n>=e._tDur||n<0)&&e.ratio===o&&(o&&yc(e,1),!r&&!ns&&(wi(e,o?"onComplete":"onReverseComplete",!0),e._prom&&e._prom()))}else e._zTime||(e._zTime=n)},mme=function(e,n,r){var s;if(r>n)for(s=e._first;s&&s._start<=r;){if(s.data==="isPause"&&s._start>n)return s;s=s._next}else for(s=e._last;s&&s._start>=r;){if(s.data==="isPause"&&s._start<n)return s;s=s._prev}},Bf=function(e,n,r,s){var i=e._repeat,o=Gn(n)||0,l=e._tTime/e._tDur;return l&&!s&&(e._time*=o/e._dur),e._dur=o,e._tDur=i?i<0?1e10:Gn(o*(i+1)+e._rDelay*i):o,l>0&&!s&&fy(e,e._tTime=e._tDur*l),e.parent&&dy(e),r||Iu(e.parent,e),e},l4=function(e){return e instanceof qs?Iu(e):Bf(e,e._dur)},gme={_start:0,endTime:pm,totalDuration:pm},qi=function t(e,n,r){var s=e.labels,i=e._recent||gme,o=e.duration()>=Xi?i.endTime(!1):e._dur,l,c,d;return Hr(n)&&(isNaN(n)||n in s)?(c=n.charAt(0),d=n.substr(-1)==="%",l=n.indexOf("="),c==="<"||c===">"?(l>=0&&(n=n.replace(/=/,"")),(c==="<"?i._start:i.endTime(i._repeat>=0))+(parseFloat(n.substr(1))||0)*(d?(l<0?i:r).totalDuration()/100:1)):l<0?(n in s||(s[n]=o),s[n]):(c=parseFloat(n.charAt(l-1)+n.substr(l+1)),d&&r&&(c=c/100*(Ss(r)?r[0]:r).totalDuration()),l>1?t(e,n.substr(0,l-1),r)+c:o+c)):n==null?o:+n},Lp=function(e,n,r){var s=nl(n[1]),i=(s?2:1)+(e<2?0:1),o=n[i],l,c;if(s&&(o.duration=n[1]),o.parent=r,e){for(l=o,c=r;c&&!("immediateRender"in l);)l=c.vars.defaults||{},c=Js(c.vars.inherit)&&c.parent;o.immediateRender=Js(l.immediateRender),e<2?o.runBackwards=1:o.startAt=n[i-1]}return new yr(n[0],o,n[i+1])},Pc=function(e,n){return e||e===0?n(e):n},Vm=function(e,n,r){return r<e?e:r>n?n:r},ws=function(e,n){return!Hr(e)||!(n=ime.exec(e))?"":n[1]},vme=function(e,n,r){return Pc(r,function(s){return Vm(e,n,s)})},bS=[].slice,bF=function(e,n){return e&&da(e)&&"length"in e&&(!n&&!e.length||e.length-1 in e&&da(e[0]))&&!e.nodeType&&e!==Bo},yme=function(e,n,r){return r===void 0&&(r=[]),e.forEach(function(s){var i;return Hr(s)&&!n||bF(s,1)?(i=r).push.apply(i,Qi(s)):r.push(s)})||r},Qi=function(e,n,r){return Vn&&!n&&Vn.selector?Vn.selector(e):Hr(e)&&!r&&(yS||!Zf())?bS.call((n||JE).querySelectorAll(e),0):Ss(e)?yme(e,r):bF(e)?bS.call(e,0):e?[e]:[]},xS=function(e){return e=Qi(e)[0]||hm("Invalid scope")||{},function(n){var r=e.current||e.nativeElement||e;return Qi(n,r.querySelectorAll?r:r===e?hm("Invalid scope")||JE.createElement("div"):e)}},xF=function(e){return e.sort(function(){return .5-Math.random()})},SF=function(e){if(ir(e))return e;var n=da(e)?e:{each:e},r=Ou(n.ease),s=n.from||0,i=parseFloat(n.base)||0,o={},l=s>0&&s<1,c=isNaN(s)||l,d=n.axis,f=s,h=s;return Hr(s)?f=h={center:.5,edges:.5,end:1}[s]||0:!l&&c&&(f=s[0],h=s[1]),function(m,v,_){var y=(_||n).length,w=o[y],x,k,P,C,T,O,I,R,N;if(!w){if(N=n.grid==="auto"?0:(n.grid||[1,Xi])[1],!N){for(I=-Xi;I<(I=_[N++].getBoundingClientRect().left)&&N<y;);N<y&&N--}for(w=o[y]=[],x=c?Math.min(N,y)*f-.5:s%N,k=N===Xi?0:c?y*h/N-.5:s/N|0,I=0,R=Xi,O=0;O<y;O++)P=O%N-x,C=k-(O/N|0),w[O]=T=d?Math.abs(d==="y"?C:P):iF(P*P+C*C),T>I&&(I=T),T<R&&(R=T);s==="random"&&xF(w),w.max=I-R,w.min=R,w.v=y=(parseFloat(n.amount)||parseFloat(n.each)*(N>y?y-1:d?d==="y"?y/N:N:Math.max(N,y/N))||0)*(s==="edges"?-1:1),w.b=y<0?i-y:i,w.u=ws(n.amount||n.each)||0,r=r&&y<0?Ime(r):r}return y=(w[m]-w.min)/w.max||0,Gn(w.b+(r?r(y):y)*w.v)+w.u}},SS=function(e){var n=Math.pow(10,((e+"").split(".")[1]||"").length);return function(r){var s=Gn(Math.round(parseFloat(r)/e)*e*n);return(s-s%1)/n+(nl(r)?0:ws(r))}},kF=function(e,n){var r=Ss(e),s,i;return!r&&da(e)&&(s=r=e.radius||Xi,e.values?(e=Qi(e.values),(i=!nl(e[0]))&&(s*=s)):e=SS(e.increment)),Pc(n,r?ir(e)?function(o){return i=e(o),Math.abs(i-o)<=s?i:o}:function(o){for(var l=parseFloat(i?o.x:o),c=parseFloat(i?o.y:0),d=Xi,f=0,h=e.length,m,v;h--;)i?(m=e[h].x-l,v=e[h].y-c,m=m*m+v*v):m=Math.abs(e[h]-l),m<d&&(d=m,f=h);return f=!s||d<=s?e[f]:o,i||f===o||nl(o)?f:f+ws(o)}:SS(e))},EF=function(e,n,r,s){return Pc(Ss(e)?!n:r===!0?!!(r=0):!s,function(){return Ss(e)?e[~~(Math.random()*e.length)]:(r=r||1e-5)&&(s=r<1?Math.pow(10,(r+"").length-2):1)&&Math.floor(Math.round((e-r/2+Math.random()*(n-e+r*.99))/r)*r*s)/s})},_me=function(){for(var e=arguments.length,n=new Array(e),r=0;r<e;r++)n[r]=arguments[r];return function(s){return n.reduce(function(i,o){return o(i)},s)}},wme=function(e,n){return function(r){return e(parseFloat(r))+(n||ws(r))}},bme=function(e,n,r){return PF(e,n,0,1,r)},CF=function(e,n,r){return Pc(r,function(s){return e[~~n(s)]})},xme=function t(e,n,r){var s=n-e;return Ss(e)?CF(e,t(0,e.length),n):Pc(r,function(i){return(s+(i-e)%s)%s+e})},Sme=function t(e,n,r){var s=n-e,i=s*2;return Ss(e)?CF(e,t(0,e.length-1),n):Pc(r,function(o){return o=(i+(o-e)%i)%i||0,e+(o>s?i-o:o)})},mm=function(e){return e.replace(nme,function(n){var r=n.indexOf("[")+1,s=n.substring(r||7,r?n.indexOf("]"):n.length-1).split(rme);return EF(r?s:+s[0],r?0:+s[1],+s[2]||1e-5)})},PF=function(e,n,r,s,i){var o=n-e,l=s-r;return Pc(i,function(c){return r+((c-e)/o*l||0)})},kme=function t(e,n,r,s){var i=isNaN(e+n)?0:function(v){return(1-v)*e+v*n};if(!i){var o=Hr(e),l={},c,d,f,h,m;if(r===!0&&(s=1)&&(r=null),o)e={p:e},n={p:n};else if(Ss(e)&&!Ss(n)){for(f=[],h=e.length,m=h-2,d=1;d<h;d++)f.push(t(e[d-1],e[d]));h--,i=function(_){_*=h;var y=Math.min(m,~~_);return f[y](_-y)},r=n}else s||(e=Hf(Ss(e)?[]:{},e));if(!f){for(c in n)i6.call(l,e,c,"get",n[c]);i=function(_){return c6(_,l)||(o?e.p:e)}}}return Pc(r,i)},c4=function(e,n,r){var s=e.labels,i=Xi,o,l,c;for(o in s)l=s[o]-n,l<0==!!r&&l&&i>(l=Math.abs(l))&&(c=o,i=l);return c},wi=function(e,n,r){var s=e.vars,i=s[n],o=Vn,l=e._ctx,c,d,f;if(i)return c=s[n+"Params"],d=s.callbackScope||e,r&&sc.length&&p1(),l&&(Vn=l),f=c?i.apply(d,c):i.call(d),Vn=o,f},dp=function(e){return yc(e),e.scrollTrigger&&e.scrollTrigger.kill(!!ns),e.progress()<1&&wi(e,"onInterrupt"),e},Gd,AF=[],TF=function(e){if(e)if(e=!e.name&&e.default||e,QE()||e.headless){var n=e.name,r=ir(e),s=n&&!r&&e.init?function(){this._props=[]}:e,i={init:pm,render:c6,add:i6,kill:Vme,modifier:zme,rawVars:0},o={targetTest:0,get:0,getSetter:l6,aliases:{},register:0};if(Zf(),e!==s){if(mi[n])return;Ai(s,Ai(m1(e,i),o)),Hf(s.prototype,Hf(i,m1(e,o))),mi[s.prop=n]=s,e.targetTest&&(ov.push(s),t6[n]=1),n=(n==="css"?"CSS":n.charAt(0).toUpperCase()+n.substr(1))+"Plugin"}dF(n,s),e.register&&e.register(ri,s,ti)}else AF.push(e)},wn=255,fp={aqua:[0,wn,wn],lime:[0,wn,0],silver:[192,192,192],black:[0,0,0],maroon:[128,0,0],teal:[0,128,128],blue:[0,0,wn],navy:[0,0,128],white:[wn,wn,wn],olive:[128,128,0],yellow:[wn,wn,0],orange:[wn,165,0],gray:[128,128,128],purple:[128,0,128],green:[0,128,0],red:[wn,0,0],pink:[wn,192,203],cyan:[0,wn,wn],transparent:[wn,wn,wn,0]},Fw=function(e,n,r){return e+=e<0?1:e>1?-1:0,(e*6<1?n+(r-n)*e*6:e<.5?r:e*3<2?n+(r-n)*(2/3-e)*6:n)*wn+.5|0},RF=function(e,n,r){var s=e?nl(e)?[e>>16,e>>8&wn,e&wn]:0:fp.black,i,o,l,c,d,f,h,m,v,_;if(!s){if(e.substr(-1)===","&&(e=e.substr(0,e.length-1)),fp[e])s=fp[e];else if(e.charAt(0)==="#"){if(e.length<6&&(i=e.charAt(1),o=e.charAt(2),l=e.charAt(3),e="#"+i+i+o+o+l+l+(e.length===5?e.charAt(4)+e.charAt(4):"")),e.length===9)return s=parseInt(e.substr(1,6),16),[s>>16,s>>8&wn,s&wn,parseInt(e.substr(7),16)/255];e=parseInt(e.substr(1),16),s=[e>>16,e>>8&wn,e&wn]}else if(e.substr(0,3)==="hsl"){if(s=_=e.match(s4),!n)c=+s[0]%360/360,d=+s[1]/100,f=+s[2]/100,o=f<=.5?f*(d+1):f+d-f*d,i=f*2-o,s.length>3&&(s[3]*=1),s[0]=Fw(c+1/3,i,o),s[1]=Fw(c,i,o),s[2]=Fw(c-1/3,i,o);else if(~e.indexOf("="))return s=e.match(aF),r&&s.length<4&&(s[3]=1),s}else s=e.match(s4)||fp.transparent;s=s.map(Number)}return n&&!_&&(i=s[0]/wn,o=s[1]/wn,l=s[2]/wn,h=Math.max(i,o,l),m=Math.min(i,o,l),f=(h+m)/2,h===m?c=d=0:(v=h-m,d=f>.5?v/(2-h-m):v/(h+m),c=h===i?(o-l)/v+(o<l?6:0):h===o?(l-i)/v+2:(i-o)/v+4,c*=60),s[0]=~~(c+.5),s[1]=~~(d*100+.5),s[2]=~~(f*100+.5)),r&&s.length<4&&(s[3]=1),s},IF=function(e){var n=[],r=[],s=-1;return e.split(ic).forEach(function(i){var o=i.match(qd)||[];n.push.apply(n,o),r.push(s+=o.length+1)}),n.c=r,n},u4=function(e,n,r){var s="",i=(e+s).match(ic),o=n?"hsla(":"rgba(",l=0,c,d,f,h;if(!i)return e;if(i=i.map(function(m){return(m=RF(m,n,1))&&o+(n?m[0]+","+m[1]+"%,"+m[2]+"%,"+m[3]:m.join(","))+")"}),r&&(f=IF(e),c=r.c,c.join(s)!==f.c.join(s)))for(d=e.replace(ic,"1").split(qd),h=d.length-1;l<h;l++)s+=d[l]+(~c.indexOf(l)?i.shift()||o+"0,0,0,0)":(f.length?f:i.length?i:r).shift());if(!d)for(d=e.split(ic),h=d.length-1;l<h;l++)s+=d[l]+i[l];return s+d[h]},ic=(function(){var t="(?:\\b(?:(?:rgb|rgba|hsl|hsla)\\(.+?\\))|\\B#(?:[0-9a-f]{3,4}){1,2}\\b",e;for(e in fp)t+="|"+e+"\\b";return new RegExp(t+")","gi")})(),Eme=/hsl[a]?\(/,OF=function(e){var n=e.join(" "),r;if(ic.lastIndex=0,ic.test(n))return r=Eme.test(n),e[1]=u4(e[1],r),e[0]=u4(e[0],r,IF(e[1])),!0},gm,_i=(function(){var t=Date.now,e=500,n=33,r=t(),s=r,i=1e3/240,o=i,l=[],c,d,f,h,m,v,_=function y(w){var x=t()-s,k=w===!0,P,C,T,O;if((x>e||x<0)&&(r+=x-n),s+=x,T=s-r,P=T-o,(P>0||k)&&(O=++h.frame,m=T-h.time*1e3,h.time=T=T/1e3,o+=P+(P>=i?0:i-P),C=1),k||(c=d(y)),C)for(v=0;v<l.length;v++)l[v](T,m,O,w)};return h={time:0,frame:0,tick:function(){_(!0)},deltaRatio:function(w){return m/(1e3/(w||60))},wake:function(){cF&&(!yS&&QE()&&(Bo=yS=window,JE=Bo.document||{},Pi.gsap=ri,(Bo.gsapVersions||(Bo.gsapVersions=[])).push(ri.version),uF(h1||Bo.GreenSockGlobals||!Bo.gsap&&Bo||{}),AF.forEach(TF)),f=typeof requestAnimationFrame<"u"&&requestAnimationFrame,c&&h.sleep(),d=f||function(w){return setTimeout(w,o-h.time*1e3+1|0)},gm=1,_(2))},sleep:function(){(f?cancelAnimationFrame:clearTimeout)(c),gm=0,d=pm},lagSmoothing:function(w,x){e=w||1/0,n=Math.min(x||33,e)},fps:function(w){i=1e3/(w||240),o=h.time*1e3+i},add:function(w,x,k){var P=x?function(C,T,O,I){w(C,T,O,I),h.remove(P)}:w;return h.remove(w),l[k?"unshift":"push"](P),Zf(),P},remove:function(w,x){~(x=l.indexOf(w))&&l.splice(x,1)&&v>=x&&v--},_listeners:l},h})(),Zf=function(){return!gm&&_i.wake()},Ht={},Cme=/^[\d.\-M][\d.\-,\s]/,Pme=/["']/g,Ame=function(e){for(var n={},r=e.substr(1,e.length-3).split(":"),s=r[0],i=1,o=r.length,l,c,d;i<o;i++)c=r[i],l=i!==o-1?c.lastIndexOf(","):c.length,d=c.substr(0,l),n[s]=isNaN(d)?d.replace(Pme,"").trim():+d,s=c.substr(l+1).trim();return n},Tme=function(e){var n=e.indexOf("(")+1,r=e.indexOf(")"),s=e.indexOf("(",n);return e.substring(n,~s&&s<r?e.indexOf(")",r+1):r)},Rme=function(e){var n=(e+"").split("("),r=Ht[n[0]];return r&&n.length>1&&r.config?r.config.apply(null,~e.indexOf("{")?[Ame(n[1])]:Tme(e).split(",").map(mF)):Ht._CE&&Cme.test(e)?Ht._CE("",e):r},Ime=function(e){return function(n){return 1-e(1-n)}},Ou=function(e,n){return e&&(ir(e)?e:Ht[e]||Rme(e))||n},Uu=function(e,n,r,s){r===void 0&&(r=function(c){return 1-n(1-c)}),s===void 0&&(s=function(c){return c<.5?n(c*2)/2:1-n((1-c)*2)/2});var i={easeIn:n,easeOut:r,easeInOut:s},o;return ei(e,function(l){Ht[l]=Pi[l]=i,Ht[o=l.toLowerCase()]=r;for(var c in i)Ht[o+(c==="easeIn"?".in":c==="easeOut"?".out":".inOut")]=Ht[l+"."+c]=i[c]}),i},MF=function(e){return function(n){return n<.5?(1-e(1-n*2))/2:.5+e((n-.5)*2)/2}},zw=function t(e,n,r){var s=n>=1?n:1,i=(r||(e?.3:.45))/(n<1?n:1),o=i/vS*(Math.asin(1/s)||0),l=function(f){return f===1?1:s*Math.pow(2,-10*f)*tme((f-o)*i)+1},c=e==="out"?l:e==="in"?function(d){return 1-l(1-d)}:MF(l);return i=vS/i,c.config=function(d,f){return t(e,d,f)},c},Vw=function t(e,n){n===void 0&&(n=1.70158);var r=function(o){return o?--o*o*((n+1)*o+n)+1:0},s=e==="out"?r:e==="in"?function(i){return 1-r(1-i)}:MF(r);return s.config=function(i){return t(e,i)},s};ei("Linear,Quad,Cubic,Quart,Quint,Strong",function(t,e){var n=e<5?e+1:e;Uu(t+",Power"+(n-1),e?function(r){return Math.pow(r,n)}:function(r){return r},function(r){return 1-Math.pow(1-r,n)},function(r){return r<.5?Math.pow(r*2,n)/2:1-Math.pow((1-r)*2,n)/2})});Ht.Linear.easeNone=Ht.none=Ht.Linear.easeIn;Uu("Elastic",zw("in"),zw("out"),zw());(function(t,e){var n=1/e,r=2*n,s=2.5*n,i=function(l){return l<n?t*l*l:l<r?t*Math.pow(l-1.5/e,2)+.75:l<s?t*(l-=2.25/e)*l+.9375:t*Math.pow(l-2.625/e,2)+.984375};Uu("Bounce",function(o){return 1-i(1-o)},i)})(7.5625,2.75);Uu("Expo",function(t){return Math.pow(2,10*(t-1))*t+t*t*t*t*t*t*(1-t)});Uu("Circ",function(t){return-(iF(1-t*t)-1)});Uu("Sine",function(t){return t===1?1:-eme(t*Qpe)+1});Uu("Back",Vw("in"),Vw("out"),Vw());Ht.SteppedEase=Ht.steps=Pi.SteppedEase={config:function(e,n){e===void 0&&(e=1);var r=1/e,s=e+(n?0:1),i=n?1:0,o=1-gn;return function(l){return((s*Vm(0,o,l)|0)+i)*r}}};fm.ease=Ht["quad.out"];ei("onComplete,onUpdate,onStart,onRepeat,onReverseComplete,onInterrupt",function(t){return n6+=t+","+t+"Params,"});var NF=function(e,n){this.id=Jpe++,e._gsap=this,this.target=e,this.harness=n,this.get=n?n.get:hF,this.set=n?n.getSetter:l6},vm=(function(){function t(n){this.vars=n,this._delay=+n.delay||0,(this._repeat=n.repeat===1/0?-2:n.repeat||0)&&(this._rDelay=n.repeatDelay||0,this._yoyo=!!n.yoyo||!!n.yoyoEase),this._ts=1,Bf(this,+n.duration,1,1),this.data=n.data,Vn&&(this._ctx=Vn,Vn.data.push(this)),gm||_i.wake()}var e=t.prototype;return e.delay=function(r){return r||r===0?(this.parent&&this.parent.smoothChildTiming&&this.startTime(this._start+r-this._delay),this._delay=r,this):this._delay},e.duration=function(r){return arguments.length?this.totalDuration(this._repeat>0?r+(r+this._rDelay)*this._repeat:r):this.totalDuration()&&this._dur},e.totalDuration=function(r){return arguments.length?(this._dirty=0,Bf(this,this._repeat<0?r:(r-this._repeat*this._rDelay)/(this._repeat+1))):this._tDur},e.totalTime=function(r,s){if(Zf(),!arguments.length)return this._tTime;var i=this._dp;if(i&&i.smoothChildTiming&&this._ts){for(fy(this,r),!i._dp||i.parent||yF(i,this);i&&i.parent;)i.parent._time!==i._start+(i._ts>=0?i._tTime/i._ts:(i.totalDuration()-i._tTime)/-i._ts)&&i.totalTime(i._tTime,!0),i=i.parent;!this.parent&&this._dp.autoRemoveChildren&&(this._ts>0&&r<this._tDur||this._ts<0&&r>0||!this._tDur&&!r)&&Xo(this._dp,this,this._start-this._delay)}return(this._tTime!==r||!this._dur&&!s||this._initted&&Math.abs(this._zTime)===gn||!this._initted&&this._dur&&r||!r&&!this._initted&&(this.add||this._ptLookup))&&(this._ts||(this._pTime=r),pF(this,r,s)),this},e.time=function(r,s){return arguments.length?this.totalTime(Math.min(this.totalDuration(),r+a4(this))%(this._dur+this._rDelay)||(r?this._dur:0),s):this._time},e.totalProgress=function(r,s){return arguments.length?this.totalTime(this.totalDuration()*r,s):this.totalDuration()?Math.min(1,this._tTime/this._tDur):this.rawTime()>=0&&this._initted?1:0},e.progress=function(r,s){return arguments.length?this.totalTime(this.duration()*(this._yoyo&&!(this.iteration()&1)?1-r:r)+a4(this),s):this.duration()?Math.min(1,this._time/this._dur):this.rawTime()>0?1:0},e.iteration=function(r,s){var i=this.duration()+this._rDelay;return arguments.length?this.totalTime(this._time+(r-1)*i,s):this._repeat?Uf(this._tTime,i)+1:1},e.timeScale=function(r,s){if(!arguments.length)return this._rts===-gn?0:this._rts;if(this._rts===r)return this;var i=this.parent&&this._ts?g1(this.parent._time,this):this._tTime,o=this._rts<0;this._rts=+r||0,this._ts=this._ps||r===-gn?0:this._rts;var l=this.totalDuration();return(o!==this._rts<0||i>0&&i<l)&&this.totalTime(Vm(-Math.abs(this._delay),l,i),s!==!1),dy(this),dme(this)},e.paused=function(r){if(!arguments.length)return this._ps;if(this._ps!==r)if(this._ps=r,r)this._pTime=this._tTime||Math.max(-this._delay,this.rawTime()),this._ts=this._act=0;else{Zf(),this._ts=this._rts;var s=this.parent&&!this.parent.smoothChildTiming?this.rawTime():this._tTime||this._pTime,i=this.progress()===1&&Math.abs(this._zTime)!==gn,o;if(i)for(this._tTime-=gn,o=this._first;o;){if(!o._dur&&o._zTime<0&&o._ts&&o._start<=s+gn){i=!1;break}o=o._next}this.totalTime(s,i)}return this},e.startTime=function(r){if(arguments.length){this._start=Gn(r);var s=this.parent||this._dp;return s&&(s._sort||!this.parent)&&Xo(s,this,this._start-this._delay),this}return this._start},e.endTime=function(r){return this._start+(Js(r)?this.totalDuration():this.duration())/Math.abs(this._ts||1)},e.rawTime=function(r){var s=this.parent||this._dp;return s?r&&(!this._ts||this._repeat&&this._time&&this.totalProgress()<1)?this._tTime%(this._dur+this._rDelay):this._ts?g1(s.rawTime(r),this):this._tTime:this._tTime},e.revert=function(r){r===void 0&&(r=ame);var s=ns;return ns=r,s6(this)&&(this.timeline&&this.timeline.revert(r),this.totalTime(-.01,r.suppressEvents)),this.data!=="nested"&&r.kill!==!1&&this.kill(),ns=s,this},e.globalTime=function(r){for(var s=this,i=arguments.length?r:s.rawTime();s;)i=s._start+i/(Math.abs(s._ts)||1),s=s._dp;return!this.parent&&this._sat?this._sat.globalTime(r):i},e.repeat=function(r){return arguments.length?(this._repeat=r===1/0?-2:r,l4(this)):this._repeat===-2?1/0:this._repeat},e.repeatDelay=function(r){if(arguments.length){var s=this._time;return this._rDelay=r,l4(this),s?this.time(s):this}return this._rDelay},e.yoyo=function(r){return arguments.length?(this._yoyo=r,this):this._yoyo},e.seek=function(r,s){return this.totalTime(qi(this,r),Js(s))},e.restart=function(r,s){return this.play().totalTime(r?-this._delay:0,Js(s)),this._dur||(this._zTime=-gn),this},e.play=function(r,s){return r!=null&&this.seek(r,s),this.reversed(!1).paused(!1)},e.reverse=function(r,s){return r!=null&&this.seek(r||this.totalDuration(),s),this.reversed(!0).paused(!1)},e.pause=function(r,s){return r!=null&&this.seek(r,s),this.paused(!0)},e.resume=function(){return this.paused(!1)},e.reversed=function(r){return arguments.length?(!!r!==this.reversed()&&this.timeScale(-this._rts||(r?-gn:0)),this):this._rts<0},e.invalidate=function(){return this._initted=this._act=0,this._zTime=-gn,this},e.isActive=function(){var r=this.parent||this._dp,s=this._start,i;return!!(!r||this._ts&&this._initted&&r.isActive()&&(i=r.rawTime(!0))>=s&&i<this.endTime(!0)-gn)},e.eventCallback=function(r,s,i){var o=this.vars;return arguments.length>1?(s?(o[r]=s,i&&(o[r+"Params"]=i),r==="onUpdate"&&(this._onUpdate=s)):delete o[r],this):o[r]},e.then=function(r){var s=this,i=s._prom;return new Promise(function(o){var l=ir(r)?r:gF,c=function(){var f=s.then;s.then=null,i&&i(),ir(l)&&(l=l(s))&&(l.then||l===s)&&(s.then=f),o(l),s.then=f};s._initted&&s.totalProgress()===1&&s._ts>=0||!s._tTime&&s._ts<0?c():s._prom=c})},e.kill=function(){dp(this)},t})();Ai(vm.prototype,{_time:0,_start:0,_end:0,_tTime:0,_tDur:0,_dirty:0,_repeat:0,_yoyo:!1,parent:null,_initted:!1,_rDelay:0,_ts:1,_dp:0,ratio:0,_zTime:-gn,_prom:0,_ps:!1,_rts:1});var qs=(function(t){sF(e,t);function e(r,s){var i;return r===void 0&&(r={}),i=t.call(this,r)||this,i.labels={},i.smoothChildTiming=!!r.smoothChildTiming,i.autoRemoveChildren=!!r.autoRemoveChildren,i._sort=Js(r.sortChildren),Kn&&Xo(r.parent||Kn,$a(i),s),r.reversed&&i.reverse(),r.paused&&i.paused(!0),r.scrollTrigger&&_F($a(i),r.scrollTrigger),i}var n=e.prototype;return n.to=function(s,i,o){return Lp(0,arguments,this),this},n.from=function(s,i,o){return Lp(1,arguments,this),this},n.fromTo=function(s,i,o,l){return Lp(2,arguments,this),this},n.set=function(s,i,o){return i.duration=0,i.parent=this,Np(i).repeatDelay||(i.repeat=0),i.immediateRender=!!i.immediateRender,new yr(s,i,qi(this,o),1),this},n.call=function(s,i,o){return Xo(this,yr.delayedCall(0,s,i),o)},n.staggerTo=function(s,i,o,l,c,d,f){return o.duration=i,o.stagger=o.stagger||l,o.onComplete=d,o.onCompleteParams=f,o.parent=this,new yr(s,o,qi(this,c)),this},n.staggerFrom=function(s,i,o,l,c,d,f){return o.runBackwards=1,Np(o).immediateRender=Js(o.immediateRender),this.staggerTo(s,i,o,l,c,d,f)},n.staggerFromTo=function(s,i,o,l,c,d,f,h){return l.startAt=o,Np(l).immediateRender=Js(l.immediateRender),this.staggerTo(s,i,l,c,d,f,h)},n.render=function(s,i,o){var l=this._time,c=this._dirty?this.totalDuration():this._tDur,d=this._dur,f=s<=0?0:Gn(s),h=this._zTime<0!=s<0&&(this._initted||!d),m,v,_,y,w,x,k,P,C,T,O,I;if(this!==Kn&&f>c&&s>=0&&(f=c),f!==this._tTime||o||h){if(l!==this._time&&d&&(f+=this._time-l,s+=this._time-l),m=f,C=this._start,P=this._ts,x=!P,h&&(d||(l=this._zTime),(s||!i)&&(this._zTime=s)),this._repeat){if(O=this._yoyo,w=d+this._rDelay,this._repeat<-1&&s<0)return this.totalTime(w*100+s,i,o);if(m=Gn(f%w),f===c?(y=this._repeat,m=d):(T=Gn(f/w),y=~~T,y&&y===T&&(m=d,y--),m>d&&(m=d)),T=Uf(this._tTime,w),!l&&this._tTime&&T!==y&&this._tTime-T*w-this._dur<=0&&(T=y),O&&y&1&&(m=d-m,I=1),y!==T&&!this._lock){var R=O&&T&1,N=R===(O&&y&1);if(y<T&&(R=!R),l=R?0:f%d?d:f,this._lock=1,this.render(l||(I?0:Gn(y*w)),i,!d)._lock=0,this._tTime=f,!i&&this.parent&&wi(this,"onRepeat"),this.vars.repeatRefresh&&!I&&(this.invalidate()._lock=1,T=y),l&&l!==this._time||x!==!this._ts||this.vars.onRepeat&&!this.parent&&!this._act)return this;if(d=this._dur,c=this._tDur,N&&(this._lock=2,l=R?d:-1e-4,this.render(l,!0),this.vars.repeatRefresh&&!I&&this.invalidate()),this._lock=0,!this._ts&&!x)return this}}if(this._hasPause&&!this._forcing&&this._lock<2&&(k=mme(this,Gn(l),Gn(m)),k&&(f-=m-(m=k._start))),this._tTime=f,this._time=m,this._act=!!P,this._initted||(this._onUpdate=this.vars.onUpdate,this._initted=1,this._zTime=s,l=0),!l&&f&&d&&!i&&!T&&(wi(this,"onStart"),this._tTime!==f))return this;if(m>=l&&s>=0)for(v=this._first;v;){if(_=v._next,(v._act||m>=v._start)&&v._ts&&k!==v){if(v.parent!==this)return this.render(s,i,o);if(v.render(v._ts>0?(m-v._start)*v._ts:(v._dirty?v.totalDuration():v._tDur)+(m-v._start)*v._ts,i,o),m!==this._time||!this._ts&&!x){k=0,_&&(f+=this._zTime=-gn);break}}v=_}else{v=this._last;for(var L=s<0?s:m;v;){if(_=v._prev,(v._act||L<=v._end)&&v._ts&&k!==v){if(v.parent!==this)return this.render(s,i,o);if(v.render(v._ts>0?(L-v._start)*v._ts:(v._dirty?v.totalDuration():v._tDur)+(L-v._start)*v._ts,i,o||ns&&s6(v)),m!==this._time||!this._ts&&!x){k=0,_&&(f+=this._zTime=L?-gn:gn);break}}v=_}}if(k&&!i&&(this.pause(),k.render(m>=l?0:-gn)._zTime=m>=l?1:-1,this._ts))return this._start=C,dy(this),this.render(s,i,o);this._onUpdate&&!i&&wi(this,"onUpdate",!0),(f===c&&this._tTime>=this.totalDuration()||!f&&l)&&(C===this._start||Math.abs(P)!==Math.abs(this._ts))&&(this._lock||((s||!d)&&(f===c&&this._ts>0||!f&&this._ts<0)&&yc(this,1),!i&&!(s<0&&!l)&&(f||l||!c)&&(wi(this,f===c&&s>=0?"onComplete":"onReverseComplete",!0),this._prom&&!(f<c&&this.timeScale()>0)&&this._prom())))}return this},n.add=function(s,i){var o=this;if(nl(i)||(i=qi(this,i,s)),!(s instanceof vm)){if(Ss(s))return s.forEach(function(l){return o.add(l,i)}),this;if(Hr(s))return this.addLabel(s,i);if(ir(s))s=yr.delayedCall(0,s);else return this}return this!==s?Xo(this,s,i):this},n.getChildren=function(s,i,o,l){s===void 0&&(s=!0),i===void 0&&(i=!0),o===void 0&&(o=!0),l===void 0&&(l=-Xi);for(var c=[],d=this._first;d;)d._start>=l&&(d instanceof yr?i&&c.push(d):(o&&c.push(d),s&&c.push.apply(c,d.getChildren(!0,i,o)))),d=d._next;return c},n.getById=function(s){for(var i=this.getChildren(1,1,1),o=i.length;o--;)if(i[o].vars.id===s)return i[o]},n.remove=function(s){return Hr(s)?this.removeLabel(s):ir(s)?this.killTweensOf(s):(s.parent===this&&uy(this,s),s===this._recent&&(this._recent=this._last),Iu(this))},n.totalTime=function(s,i){return arguments.length?(this._forcing=1,!this._dp&&this._ts&&(this._start=Gn(_i.time-(this._ts>0?s/this._ts:(this.totalDuration()-s)/-this._ts))),t.prototype.totalTime.call(this,s,i),this._forcing=0,this):this._tTime},n.addLabel=function(s,i){return this.labels[s]=qi(this,i),this},n.removeLabel=function(s){return delete this.labels[s],this},n.addPause=function(s,i,o){var l=yr.delayedCall(0,i||pm,o);return l.data="isPause",this._hasPause=1,Xo(this,l,qi(this,s))},n.removePause=function(s){var i=this._first;for(s=qi(this,s);i;)i._start===s&&i.data==="isPause"&&yc(i),i=i._next},n.killTweensOf=function(s,i,o){for(var l=this.getTweensOf(s,o),c=l.length;c--;)Xl!==l[c]&&l[c].kill(s,i);return this},n.getTweensOf=function(s,i){for(var o=[],l=Qi(s),c=this._first,d=nl(i),f;c;)c instanceof yr?lme(c._targets,l)&&(d?(!Xl||c._initted&&c._ts)&&c.globalTime(0)<=i&&c.globalTime(c.totalDuration())>i:!i||c.isActive())&&o.push(c):(f=c.getTweensOf(l,i)).length&&o.push.apply(o,f),c=c._next;return o},n.tweenTo=function(s,i){i=i||{};var o=this,l=qi(o,s),c=i,d=c.startAt,f=c.onStart,h=c.onStartParams,m=c.immediateRender,v,_=yr.to(o,Ai({ease:i.ease||"none",lazy:!1,immediateRender:!1,time:l,overwrite:"auto",duration:i.duration||Math.abs((l-(d&&"time"in d?d.time:o._time))/o.timeScale())||gn,onStart:function(){if(o.pause(),!v){var w=i.duration||Math.abs((l-(d&&"time"in d?d.time:o._time))/o.timeScale());_._dur!==w&&Bf(_,w,0,1).render(_._time,!0,!0),v=1}f&&f.apply(_,h||[])}},i));return m?_.render(0):_},n.tweenFromTo=function(s,i,o){return this.tweenTo(i,Ai({startAt:{time:qi(this,s)}},o))},n.recent=function(){return this._recent},n.nextLabel=function(s){return s===void 0&&(s=this._time),c4(this,qi(this,s))},n.previousLabel=function(s){return s===void 0&&(s=this._time),c4(this,qi(this,s),1)},n.currentLabel=function(s){return arguments.length?this.seek(s,!0):this.previousLabel(this._time+gn)},n.shiftChildren=function(s,i,o){o===void 0&&(o=0);var l=this._first,c=this.labels,d;for(s=Gn(s);l;)l._start>=o&&(l._start+=s,l._end+=s),l=l._next;if(i)for(d in c)c[d]>=o&&(c[d]+=s);return Iu(this)},n.invalidate=function(s){var i=this._first;for(this._lock=0;i;)i.invalidate(s),i=i._next;return t.prototype.invalidate.call(this,s)},n.clear=function(s){s===void 0&&(s=!0);for(var i=this._first,o;i;)o=i._next,this.remove(i),i=o;return this._dp&&(this._time=this._tTime=this._pTime=0),s&&(this.labels={}),Iu(this)},n.totalDuration=function(s){var i=0,o=this,l=o._last,c=Xi,d,f,h;if(arguments.length)return o.timeScale((o._repeat<0?o.duration():o.totalDuration())/(o.reversed()?-s:s));if(o._dirty){for(h=o.parent;l;)d=l._prev,l._dirty&&l.totalDuration(),f=l._start,f>c&&o._sort&&l._ts&&!o._lock?(o._lock=1,Xo(o,l,f-l._delay,1)._lock=0):c=f,f<0&&l._ts&&(i-=f,(!h&&!o._dp||h&&h.smoothChildTiming)&&(o._start+=Gn(f/o._ts),o._time-=f,o._tTime-=f),o.shiftChildren(-f,!1,-1/0),c=0),l._end>i&&l._ts&&(i=l._end),l=d;Bf(o,o===Kn&&o._time>i?o._time:i,1,1),o._dirty=0}return o._tDur},e.updateRoot=function(s){if(Kn._ts&&(pF(Kn,g1(s,Kn)),fF=_i.frame),_i.frame>=i4){i4+=ki.autoSleep||120;var i=Kn._first;if((!i||!i._ts)&&ki.autoSleep&&_i._listeners.length<2){for(;i&&!i._ts;)i=i._next;i||_i.sleep()}}},e})(vm);Ai(qs.prototype,{_lock:0,_hasPause:0,_forcing:0});var Ome=function(e,n,r,s,i,o,l){var c=new ti(this._pt,e,n,0,1,FF,null,i),d=0,f=0,h,m,v,_,y,w,x,k;for(c.b=r,c.e=s,r+="",s+="",(x=~s.indexOf("random("))&&(s=mm(s)),o&&(k=[r,s],o(k,e,n),r=k[0],s=k[1]),m=r.match($w)||[];h=$w.exec(s);)_=h[0],y=s.substring(d,h.index),v?v=(v+1)%5:y.substr(-5)==="rgba("&&(v=1),_!==m[f++]&&(w=parseFloat(m[f-1])||0,c._pt={_next:c._pt,p:y||f===1?y:",",s:w,c:_.charAt(1)==="="?nf(w,_)-w:parseFloat(_)-w,m:v&&v<4?Math.round:0},d=$w.lastIndex);return c.c=d<s.length?s.substring(d,s.length):"",c.fp=l,(lF.test(s)||x)&&(c.e=0),this._pt=c,c},i6=function(e,n,r,s,i,o,l,c,d,f){ir(s)&&(s=s(i||0,e,o));var h=e[n],m=r!=="get"?r:ir(h)?d?e[n.indexOf("set")||!ir(e["get"+n.substr(3)])?n:"get"+n.substr(3)](d):e[n]():h,v=ir(h)?d?$me:$F:a6,_;if(Hr(s)&&(~s.indexOf("random(")&&(s=mm(s)),s.charAt(1)==="="&&(_=nf(m,s)+(ws(m)||0),(_||_===0)&&(s=_))),!f||m!==s||kS)return!isNaN(m*s)&&s!==""?(_=new ti(this._pt,e,n,+m||0,s-(m||0),typeof h=="boolean"?Fme:jF,0,v),d&&(_.fp=d),l&&_.modifier(l,this,e),this._pt=_):(!h&&!(n in e)&&e6(n,s),Ome.call(this,e,n,m,s,v,c||ki.stringFilter,d))},Mme=function(e,n,r,s,i){if(ir(e)&&(e=Dp(e,i,n,r,s)),!da(e)||e.style&&e.nodeType||Ss(e)||oF(e))return Hr(e)?Dp(e,i,n,r,s):e;var o={},l;for(l in e)o[l]=Dp(e[l],i,n,r,s);return o},LF=function(e,n,r,s,i,o){var l,c,d,f;if(mi[e]&&(l=new mi[e]).init(i,l.rawVars?n[e]:Mme(n[e],s,i,o,r),r,s,o)!==!1&&(r._pt=c=new ti(r._pt,i,e,0,1,l.render,l,0,l.priority),r!==Gd))for(d=r._ptLookup[r._targets.indexOf(i)],f=l._props.length;f--;)d[l._props[f]]=c;return l},Xl,kS,o6=function t(e,n,r){var s=e.vars,i=s.ease,o=s.startAt,l=s.immediateRender,c=s.lazy,d=s.onUpdate,f=s.runBackwards,h=s.yoyoEase,m=s.keyframes,v=s.autoRevert,_=e._dur,y=e._startAt,w=e._targets,x=e.parent,k=x&&x.data==="nested"?x.vars.targets:w,P=e._overwrite==="auto"&&!YE,C=e.timeline,T=s.easeReverse||h,O,I,R,N,L,z,$,G,X,q,H,ee,V;if(C&&(!m||!i)&&(i="none"),e._ease=Ou(i,fm.ease),e._rEase=T&&(Ou(T)||e._ease),e._from=!C&&!!s.runBackwards,e._from&&(e.ratio=1),!C||m&&!s.stagger){if(G=w[0]?Ru(w[0]).harness:0,ee=G&&s[G.prop],O=m1(s,t6),y&&(y._zTime<0&&y.progress(1),n<0&&f&&l&&!v?y.render(-1,!0):y.revert(f&&_?iv:ome),y._lazy=0),o){if(yc(e._startAt=yr.set(w,Ai({data:"isStart",overwrite:!1,parent:x,immediateRender:!0,lazy:!y&&Js(c),startAt:null,delay:0,onUpdate:d&&function(){return wi(e,"onUpdate")},stagger:0},o))),e._startAt._dp=0,e._startAt._sat=e,n<0&&(ns||!l&&!v)&&e._startAt.revert(iv),l&&_&&n<=0&&r<=0){n&&(e._zTime=n);return}}else if(f&&_&&!y){if(n&&(l=!1),R=Ai({overwrite:!1,data:"isFromStart",lazy:l&&!y&&Js(c),immediateRender:l,stagger:0,parent:x},O),ee&&(R[G.prop]=ee),yc(e._startAt=yr.set(w,R)),e._startAt._dp=0,e._startAt._sat=e,n<0&&(ns?e._startAt.revert(iv):e._startAt.render(-1,!0)),e._zTime=n,!l)t(e._startAt,gn,gn);else if(!n)return}for(e._pt=e._ptCache=0,c=_&&Js(c)||c&&!_,I=0;I<w.length;I++){if(L=w[I],$=L._gsap||r6(w)[I]._gsap,e._ptLookup[I]=q={},_S[$.id]&&sc.length&&p1(),H=k===w?I:k.indexOf(L),G&&(X=new G).init(L,ee||O,e,H,k)!==!1&&(e._pt=N=new ti(e._pt,L,X.name,0,1,X.render,X,0,X.priority),X._props.forEach(function(Q){q[Q]=N}),X.priority&&(z=1)),!G||ee)for(R in O)mi[R]&&(X=LF(R,O,e,H,L,k))?X.priority&&(z=1):q[R]=N=i6.call(e,L,R,"get",O[R],H,k,0,s.stringFilter);e._op&&e._op[I]&&e.kill(L,e._op[I]),P&&e._pt&&(Xl=e,Kn.killTweensOf(L,q,e.globalTime(n)),V=!e.parent,Xl=0),e._pt&&c&&(_S[$.id]=1)}z&&zF(e),e._onInit&&e._onInit(e)}e._onUpdate=d,e._initted=(!e._op||e._pt)&&!V,m&&n<=0&&C.render(Xi,!0,!0)},Nme=function(e,n,r,s,i,o,l,c){var d=(e._pt&&e._ptCache||(e._ptCache={}))[n],f,h,m,v;if(!d)for(d=e._ptCache[n]=[],m=e._ptLookup,v=e._targets.length;v--;){if(f=m[v][n],f&&f.d&&f.d._pt)for(f=f.d._pt;f&&f.p!==n&&f.fp!==n;)f=f._next;if(!f)return kS=1,e.vars[n]="+=0",o6(e,l),kS=0,c?hm(n+" not eligible for reset. Try splitting into individual properties"):1;d.push(f)}for(v=d.length;v--;)h=d[v],f=h._pt||h,f.s=(s||s===0)&&!i?s:f.s+(s||0)+o*f.c,f.c=r-f.s,h.e&&(h.e=lr(r)+ws(h.e)),h.b&&(h.b=f.s+ws(h.b))},Lme=function(e,n){var r=e[0]?Ru(e[0]).harness:0,s=r&&r.aliases,i,o,l,c;if(!s)return n;i=Hf({},n);for(o in s)if(o in i)for(c=s[o].split(","),l=c.length;l--;)i[c[l]]=i[o];return i},Dme=function(e,n,r,s){var i=n.ease||s||"power1.inOut",o,l;if(Ss(n))l=r[e]||(r[e]=[]),n.forEach(function(c,d){return l.push({t:d/(n.length-1)*100,v:c,e:i})});else for(o in n)l=r[o]||(r[o]=[]),o==="ease"||l.push({t:parseFloat(e),v:n[o],e:i})},Dp=function(e,n,r,s,i){return ir(e)?e.call(n,r,s,i):Hr(e)&&~e.indexOf("random(")?mm(e):e},y1=n6+"repeat,repeatDelay,yoyo,repeatRefresh,yoyoEase,easeReverse,autoRevert",DF={};ei(y1+",id,stagger,delay,duration,paused,scrollTrigger",function(t){return DF[t]=1});y1=y1.split(",");var yr=(function(t){sF(e,t);function e(r,s,i,o){var l;typeof s=="number"&&(i.duration=s,s=i,i=null),l=t.call(this,o?s:Np(s))||this;var c=l.vars,d=c.duration,f=c.delay,h=c.immediateRender,m=c.stagger,v=c.overwrite,_=c.keyframes,y=c.defaults,w=c.scrollTrigger,x=s.parent||Kn,k=(Ss(r)||oF(r)?nl(r[0]):"length"in s)?[r]:Qi(r),P,C,T,O,I,R,N,L;if(l._targets=k.length?r6(k):hm("GSAP target "+r+" not found. https://gsap.com",!ki.nullTargetWarn)||[],l._ptLookup=[],l._overwrite=v,_||m||Pg(d)||Pg(f)){s=l.vars;var z=s.easeReverse||s.yoyoEase;if(P=l.timeline=new qs({data:"nested",defaults:y||{},targets:x&&x.data==="nested"?x.vars.targets:k}),P.kill(),P.parent=P._dp=$a(l),P._start=0,m||Pg(d)||Pg(f)){if(O=k.length,N=m&&SF(m),da(m))for(I in m)~y1.indexOf(I)&&(L||(L={}),L[I]=m[I]);for(C=0;C<O;C++)T=m1(s,DF),T.stagger=0,z&&(T.easeReverse=z),L&&Hf(T,L),R=k[C],T.duration=+Dp(d,$a(l),C,R,k),T.delay=(+Dp(f,$a(l),C,R,k)||0)-l._delay,!m&&O===1&&T.delay&&(l._delay=f=T.delay,l._start+=f,T.delay=0),P.to(R,T,N?N(C,R,k):0),P._ease=Ht.none;P.duration()?d=f=0:l.timeline=0}else if(_){Np(Ai(P.vars.defaults,{ease:"none"})),P._ease=Ou(_.ease||s.ease||"none");var $=0,G,X,q;if(Ss(_))_.forEach(function(H){return P.to(k,H,">")}),P.duration();else{T={};for(I in _)I==="ease"||I==="easeEach"||Dme(I,_[I],T,_.easeEach);for(I in T)for(G=T[I].sort(function(H,ee){return H.t-ee.t}),$=0,C=0;C<G.length;C++)X=G[C],q={ease:X.e,duration:(X.t-(C?G[C-1].t:0))/100*d},q[I]=X.v,P.to(k,q,$),$+=q.duration;P.duration()<d&&P.to({},{duration:d-P.duration()})}}d||l.duration(d=P.duration())}else l.timeline=0;return v===!0&&!YE&&(Xl=$a(l),Kn.killTweensOf(k),Xl=0),Xo(x,$a(l),i),s.reversed&&l.reverse(),s.paused&&l.paused(!0),(h||!d&&!_&&l._start===Gn(x._time)&&Js(h)&&fme($a(l))&&x.data!=="nested")&&(l._tTime=-gn,l.render(Math.max(0,-f)||0)),w&&_F($a(l),w),l}var n=e.prototype;return n.render=function(s,i,o){var l=this._time,c=this._tDur,d=this._dur,f=s<0,h=s>c-gn&&!f?c:s<gn?0:s,m,v,_,y,w,x,k,P;if(!d)pme(this,s,i,o);else if(h!==this._tTime||!s||o||!this._initted&&this._tTime||this._startAt&&this._zTime<0!==f||this._lazy){if(m=h,P=this.timeline,this._repeat){if(y=d+this._rDelay,this._repeat<-1&&f)return this.totalTime(y*100+s,i,o);if(m=Gn(h%y),h===c?(_=this._repeat,m=d):(w=Gn(h/y),_=~~w,_&&_===w?(m=d,_--):m>d&&(m=d)),x=this._yoyo&&_&1,x&&(m=d-m),w=Uf(this._tTime,y),m===l&&!o&&this._initted&&_===w)return this._tTime=h,this;_!==w&&this.vars.repeatRefresh&&!x&&!this._lock&&m!==y&&this._initted&&(this._lock=o=1,this.render(Gn(y*_),!0).invalidate()._lock=0)}if(!this._initted){if(wF(this,f?s:m,o,i,h))return this._tTime=0,this;if(l!==this._time&&!(o&&this.vars.repeatRefresh&&_!==w))return this;if(d!==this._dur)return this.render(s,i,o)}if(this._rEase){var C=m<l;if(C!==this._inv){var T=C?l:d-l;this._inv=C,this._from&&(this.ratio=1-this.ratio),this._invRatio=this.ratio,this._invTime=l,this._invRecip=T?(C?-1:1)/T:0,this._invScale=C?-this.ratio:1-this.ratio,this._invEase=C?this._rEase:this._ease}this.ratio=k=this._invRatio+this._invScale*this._invEase((m-this._invTime)*this._invRecip)}else this.ratio=k=this._ease(m/d);if(this._from&&(this.ratio=k=1-k),this._tTime=h,this._time=m,!this._act&&this._ts&&(this._act=1,this._lazy=0),!l&&h&&!i&&!w&&(wi(this,"onStart"),this._tTime!==h))return this;for(v=this._pt;v;)v.r(k,v.d),v=v._next;P&&P.render(s<0?s:P._dur*P._ease(m/this._dur),i,o)||this._startAt&&(this._zTime=s),this._onUpdate&&!i&&(f&&wS(this,s,i,o),wi(this,"onUpdate")),this._repeat&&_!==w&&this.vars.onRepeat&&!i&&this.parent&&wi(this,"onRepeat"),(h===this._tDur||!h)&&this._tTime===h&&(f&&!this._onUpdate&&wS(this,s,!0,!0),(s||!d)&&(h===this._tDur&&this._ts>0||!h&&this._ts<0)&&yc(this,1),!i&&!(f&&!l)&&(h||l||x)&&(wi(this,h===c?"onComplete":"onReverseComplete",!0),this._prom&&!(h<c&&this.timeScale()>0)&&this._prom()))}return this},n.targets=function(){return this._targets},n.invalidate=function(s){return(!s||!this.vars.runBackwards)&&(this._startAt=0),this._pt=this._op=this._onUpdate=this._lazy=this.ratio=0,this._ptLookup=[],this.timeline&&this.timeline.invalidate(s),t.prototype.invalidate.call(this,s)},n.resetTo=function(s,i,o,l,c){gm||_i.wake(),this._ts||this.play();var d=Math.min(this._dur,(this._dp._time-this._start)*this._ts),f;return this._initted||o6(this,d),f=this._ease(d/this._dur),Nme(this,s,i,o,l,f,d,c)?this.resetTo(s,i,o,l,1):(fy(this,0),this.parent||vF(this._dp,this,"_first","_last",this._dp._sort?"_start":0),this.render(0))},n.kill=function(s,i){if(i===void 0&&(i="all"),!s&&(!i||i==="all"))return this._lazy=this._pt=0,this.parent?dp(this):this.scrollTrigger&&this.scrollTrigger.kill(!!ns),this;if(this.timeline){var o=this.timeline.totalDuration();return this.timeline.killTweensOf(s,i,Xl&&Xl.vars.overwrite!==!0)._first||dp(this),this.parent&&o!==this.timeline.totalDuration()&&Bf(this,this._dur*this.timeline._tDur/o,0,1),this}var l=this._targets,c=s?Qi(s):l,d=this._ptLookup,f=this._pt,h,m,v,_,y,w,x;if((!i||i==="all")&&ume(l,c))return i==="all"&&(this._pt=0),dp(this);for(h=this._op=this._op||[],i!=="all"&&(Hr(i)&&(y={},ei(i,function(k){return y[k]=1}),i=y),i=Lme(l,i)),x=l.length;x--;)if(~c.indexOf(l[x])){m=d[x],i==="all"?(h[x]=i,_=m,v={}):(v=h[x]=h[x]||{},_=i);for(y in _)w=m&&m[y],w&&((!("kill"in w.d)||w.d.kill(y)===!0)&&uy(this,w,"_pt"),delete m[y]),v!=="all"&&(v[y]=1)}return this._initted&&!this._pt&&f&&dp(this),this},e.to=function(s,i){return new e(s,i,arguments[2])},e.from=function(s,i){return Lp(1,arguments)},e.delayedCall=function(s,i,o,l){return new e(i,0,{immediateRender:!1,lazy:!1,overwrite:!1,delay:s,onComplete:i,onReverseComplete:i,onCompleteParams:o,onReverseCompleteParams:o,callbackScope:l})},e.fromTo=function(s,i,o){return Lp(2,arguments)},e.set=function(s,i){return i.duration=0,i.repeatDelay||(i.repeat=0),new e(s,i)},e.killTweensOf=function(s,i,o){return Kn.killTweensOf(s,i,o)},e})(vm);Ai(yr.prototype,{_targets:[],_lazy:0,_startAt:0,_op:0,_onInit:0});ei("staggerTo,staggerFrom,staggerFromTo",function(t){yr[t]=function(){var e=new qs,n=bS.call(arguments,0);return n.splice(t==="staggerFromTo"?5:4,0,0),e[t].apply(e,n)}});var a6=function(e,n,r){return e[n]=r},$F=function(e,n,r){return e[n](r)},$me=function(e,n,r,s){return e[n](s.fp,r)},jme=function(e,n,r){return e.setAttribute(n,r)},l6=function(e,n){return ir(e[n])?$F:XE(e[n])&&e.setAttribute?jme:a6},jF=function(e,n){return n.set(n.t,n.p,Math.round((n.s+n.c*e)*1e6)/1e6,n)},Fme=function(e,n){return n.set(n.t,n.p,!!(n.s+n.c*e),n)},FF=function(e,n){var r=n._pt,s="";if(!e&&n.b)s=n.b;else if(e===1&&n.e)s=n.e;else{for(;r;)s=r.p+(r.m?r.m(r.s+r.c*e):Math.round((r.s+r.c*e)*1e4)/1e4)+s,r=r._next;s+=n.c}n.set(n.t,n.p,s,n)},c6=function(e,n){for(var r=n._pt;r;)r.r(e,r.d),r=r._next},zme=function(e,n,r,s){for(var i=this._pt,o;i;)o=i._next,i.p===s&&i.modifier(e,n,r),i=o},Vme=function(e){for(var n=this._pt,r,s;n;)s=n._next,n.p===e&&!n.op||n.op===e?uy(this,n,"_pt"):n.dep||(r=1),n=s;return!r},Hme=function(e,n,r,s){s.mSet(e,n,s.m.call(s.tween,r,s.mt),s)},zF=function(e){for(var n=e._pt,r,s,i,o;n;){for(r=n._next,s=i;s&&s.pr>n.pr;)s=s._next;(n._prev=s?s._prev:o)?n._prev._next=n:i=n,(n._next=s)?s._prev=n:o=n,n=r}e._pt=i},ti=(function(){function t(n,r,s,i,o,l,c,d,f){this.t=r,this.s=i,this.c=o,this.p=s,this.r=l||jF,this.d=c||this,this.set=d||a6,this.pr=f||0,this._next=n,n&&(n._prev=this)}var e=t.prototype;return e.modifier=function(r,s,i){this.mSet=this.mSet||this.set,this.set=Hme,this.m=r,this.mt=i,this.tween=s},t})();ei(n6+"parent,duration,ease,delay,overwrite,runBackwards,startAt,yoyo,immediateRender,repeat,repeatDelay,data,paused,reversed,lazy,callbackScope,stringFilter,id,yoyoEase,stagger,inherit,repeatRefresh,keyframes,autoRevert,scrollTrigger,easeReverse",function(t){return t6[t]=1});Pi.TweenMax=Pi.TweenLite=yr;Pi.TimelineLite=Pi.TimelineMax=qs;Kn=new qs({sortChildren:!1,defaults:fm,autoRemoveChildren:!0,id:"root",smoothChildTiming:!0});ki.stringFilter=OF;var Mu=[],av={},Ume=[],d4=0,Bme=0,Hw=function(e){return(av[e]||Ume).map(function(n){return n()})},ym=function(){var e=Date.now(),n=[];e-d4>2&&(Hw("matchMediaInit"),Mu.forEach(function(r){var s=r.queries,i=r.conditions,o,l,c,d;for(l in s)o=Bo.matchMedia(s[l]).matches,o&&(c=1),o!==i[l]&&(i[l]=o,d=1);d&&(r.revert(),c&&n.push(r))}),Hw("matchMediaRevert"),n.forEach(function(r){return r.onMatch(r,function(s){return r.add(null,s)})}),d4=e,Hw("matchMedia"))},VF=(function(){function t(n,r){this.selector=r&&xS(r),this.data=[],this._r=[],this.isReverted=!1,this.id=Bme++,n&&this.add(n)}var e=t.prototype;return e.add=function(r,s,i){ir(r)&&(i=s,s=r,r=ir);var o=this,l=function(){var d=Vn,f=o.selector,h;return d&&d!==o&&d.data.push(o),i&&(o.selector=xS(i)),Vn=o,h=s.apply(o,arguments),ir(h)&&o._r.push(h),Vn=d,o.selector=f,o.isReverted=!1,h};return o.last=l,r===ir?l(o,function(c){return o.add(null,c)}):r?o[r]=l:l},e.ignore=function(r){var s=Vn;Vn=null,r(this),Vn=s},e.getTweens=function(){var r=[];return this.data.forEach(function(s){return s instanceof t?r.push.apply(r,s.getTweens()):s instanceof yr&&!(s.parent&&s.parent.data==="nested")&&r.push(s)}),r},e.clear=function(){this._r.length=this.data.length=0},e.kill=function(r,s){var i=this;if(r?(function(){for(var l=i.getTweens(),c=i.data.length,d;c--;)d=i.data[c],d.data==="isFlip"&&(d.revert(),d.getChildren(!0,!0,!1).forEach(function(f){return l.splice(l.indexOf(f),1)}));for(l.map(function(f){return{g:f._dur||f._delay||f._sat&&!f._sat.vars.immediateRender?f.globalTime(0):-1/0,t:f}}).sort(function(f,h){return h.g-f.g||-1/0}).forEach(function(f){return f.t.revert(r)}),c=i.data.length;c--;)d=i.data[c],d instanceof qs?d.data!=="nested"&&(d.scrollTrigger&&d.scrollTrigger.revert(),d.kill()):!(d instanceof yr)&&d.revert&&d.revert(r);i._r.forEach(function(f){return f(r,i)}),i.isReverted=!0})():this.data.forEach(function(l){return l.kill&&l.kill()}),this.clear(),s){for(var o=Mu.length;o--;)Mu[o].id===this.id&&Mu.splice(o,1);this._mqs&&this._mqs.forEach(function(l){return l.removeListener?l.removeListener(ym):l.removeEventListener("change",ym)}),this._mqs=null}},e.revert=function(r){this.kill(r||{})},t})(),Zme=(function(){function t(n){this.contexts=[],this.scope=n,Vn&&Vn.data.push(this)}var e=t.prototype;return e.add=function(r,s,i){da(r)||(r={matches:r});var o=new VF(0,i||this.scope),l=o.conditions={},c,d,f;Vn&&!o.selector&&(o.selector=Vn.selector),this.contexts.push(o),s=o.add("onMatch",s),o.queries=r;for(d in r)d==="all"?f=1:(c=Bo.matchMedia(r[d]),c&&(Mu.indexOf(o)<0&&Mu.push(o),(l[d]=c.matches)&&(f=1),c.addListener?c.addListener(ym):c.addEventListener("change",ym),(o._mqs||(o._mqs=[])).push(c)));return f&&s(o,function(h){return o.add(null,h)}),this},e.revert=function(r){this.kill(r||{})},e.kill=function(r){this.contexts.forEach(function(s){return s.kill(r,!0)})},t})(),_1={registerPlugin:function(){for(var e=arguments.length,n=new Array(e),r=0;r<e;r++)n[r]=arguments[r];n.forEach(function(s){return TF(s)})},timeline:function(e){return new qs(e)},getTweensOf:function(e,n){return Kn.getTweensOf(e,n)},getProperty:function(e,n,r,s){Hr(e)&&(e=Qi(e)[0]);var i=Ru(e||{}).get,o=r?gF:mF;return r==="native"&&(r=""),e&&(n?o((mi[n]&&mi[n].get||i)(e,n,r,s)):function(l,c,d){return o((mi[l]&&mi[l].get||i)(e,l,c,d))})},quickSetter:function(e,n,r){if(e=Qi(e),e.length>1){var s=e.map(function(f){return ri.quickSetter(f,n,r)}),i=s.length;return function(f){for(var h=i;h--;)s[h](f)}}e=e[0]||{};var o=mi[n],l=Ru(e),c=l.harness&&(l.harness.aliases||{})[n]||n,d=o?function(f){var h=new o;Gd._pt=0,h.init(e,r?f+r:f,Gd,0,[e]),h.render(1,h),Gd._pt&&c6(1,Gd)}:l.set(e,c);return o?d:function(f){return d(e,c,r?f+r:f,l,1)}},quickTo:function(e,n,r){var s,i=ri.to(e,Ai((s={},s[n]="+=0.1",s.paused=!0,s.stagger=0,s),r||{})),o=function(c,d,f){return i.resetTo(n,c,d,f)};return o.tween=i,o},isTweening:function(e){return Kn.getTweensOf(e,!0).length>0},defaults:function(e){return e&&e.ease&&(e.ease=Ou(e.ease,fm.ease)),o4(fm,e||{})},config:function(e){return o4(ki,e||{})},registerEffect:function(e){var n=e.name,r=e.effect,s=e.plugins,i=e.defaults,o=e.extendTimeline;(s||"").split(",").forEach(function(l){return l&&!mi[l]&&!Pi[l]&&hm(n+" effect requires "+l+" plugin.")}),jw[n]=function(l,c,d){return r(Qi(l),Ai(c||{},i),d)},o&&(qs.prototype[n]=function(l,c,d){return this.add(jw[n](l,da(c)?c:(d=c)&&{},this),d)})},registerEase:function(e,n){Ht[e]=Ou(n)},parseEase:function(e,n){return arguments.length?Ou(e,n):Ht},getById:function(e){return Kn.getById(e)},exportRoot:function(e,n){e===void 0&&(e={});var r=new qs(e),s,i;for(r.smoothChildTiming=Js(e.smoothChildTiming),Kn.remove(r),r._dp=0,r._time=r._tTime=Kn._time,s=Kn._first;s;)i=s._next,(n||!(!s._dur&&s instanceof yr&&s.vars.onComplete===s._targets[0]))&&Xo(r,s,s._start-s._delay),s=i;return Xo(Kn,r,0),r},context:function(e,n){return e?new VF(e,n):Vn},matchMedia:function(e){return new Zme(e)},matchMediaRefresh:function(){return Mu.forEach(function(e){var n=e.conditions,r,s;for(s in n)n[s]&&(n[s]=!1,r=1);r&&e.revert()})||ym()},addEventListener:function(e,n){var r=av[e]||(av[e]=[]);~r.indexOf(n)||r.push(n)},removeEventListener:function(e,n){var r=av[e],s=r&&r.indexOf(n);s>=0&&r.splice(s,1)},utils:{wrap:xme,wrapYoyo:Sme,distribute:SF,random:EF,snap:kF,normalize:bme,getUnit:ws,clamp:vme,splitColor:RF,toArray:Qi,selector:xS,mapRange:PF,pipe:_me,unitize:wme,interpolate:kme,shuffle:xF},install:uF,effects:jw,ticker:_i,updateRoot:qs.updateRoot,plugins:mi,globalTimeline:Kn,core:{PropTween:ti,globals:dF,Tween:yr,Timeline:qs,Animation:vm,getCache:Ru,_removeLinkedListItem:uy,reverting:function(){return ns},context:function(e){return e&&Vn&&(Vn.data.push(e),e._ctx=Vn),Vn},suppressOverwrites:function(e){return YE=e}}};ei("to,from,fromTo,delayedCall,set,killTweensOf",function(t){return _1[t]=yr[t]});_i.add(qs.updateRoot);Gd=_1.to({},{duration:0});var Wme=function(e,n){for(var r=e._pt;r&&r.p!==n&&r.op!==n&&r.fp!==n;)r=r._next;return r},qme=function(e,n){var r=e._targets,s,i,o;for(s in n)for(i=r.length;i--;)o=e._ptLookup[i][s],o&&(o=o.d)&&(o._pt&&(o=Wme(o,s)),o&&o.modifier&&o.modifier(n[s],e,r[i],s))},Uw=function(e,n){return{name:e,headless:1,rawVars:1,init:function(s,i,o){o._onInit=function(l){var c,d;if(Hr(i)&&(c={},ei(i,function(f){return c[f]=1}),i=c),n){c={};for(d in i)c[d]=n(i[d]);i=c}qme(l,i)}}}},ri=_1.registerPlugin({name:"attr",init:function(e,n,r,s,i){var o,l,c;this.tween=r;for(o in n)c=e.getAttribute(o)||"",l=this.add(e,"setAttribute",(c||0)+"",n[o],s,i,0,0,o),l.op=o,l.b=c,this._props.push(o)},render:function(e,n){for(var r=n._pt;r;)ns?r.set(r.t,r.p,r.b,r):r.r(e,r.d),r=r._next}},{name:"endArray",headless:1,init:function(e,n){for(var r=n.length;r--;)this.add(e,r,e[r]||0,n[r],0,0,0,0,0,1)}},Uw("roundProps",SS),Uw("modifiers"),Uw("snap",kF))||_1;yr.version=qs.version=ri.version="3.15.1";cF=1;QE()&&Zf();Ht.Power0;Ht.Power1;Ht.Power2;Ht.Power3;Ht.Power4;Ht.Linear;Ht.Quad;Ht.Cubic;Ht.Quart;Ht.Quint;Ht.Strong;Ht.Elastic;Ht.Back;Ht.SteppedEase;Ht.Bounce;Ht.Sine;Ht.Expo;Ht.Circ;/*!
|
|
207
|
-
* CSSPlugin 3.15.1
|
|
208
|
-
* https://gsap.com
|
|
209
|
-
*
|
|
210
|
-
* Copyright 2008-2026, GreenSock. All rights reserved.
|
|
211
|
-
* Subject to the terms at https://gsap.com/standard-license
|
|
212
|
-
* @author: Jack Doyle, jack@greensock.com
|
|
213
|
-
*/var f4,Ql,rf,u6,uu,h4,d6,Gme=function(){return typeof window<"u"},rl={},ou=180/Math.PI,sf=Math.PI/180,Id=Math.atan2,p4=1e8,f6=/([A-Z])/g,Kme=/(left|right|width|margin|padding|x)/i,Yme=/[\s,\(]\S/,ea={autoAlpha:"opacity,visibility",scale:"scaleX,scaleY",alpha:"opacity"},ES=function(e,n){return n.set(n.t,n.p,Math.round((n.s+n.c*e)*1e4)/1e4+n.u,n)},Xme=function(e,n){return n.set(n.t,n.p,e===1?n.e:Math.round((n.s+n.c*e)*1e4)/1e4+n.u,n)},Qme=function(e,n){return n.set(n.t,n.p,e?Math.round((n.s+n.c*e)*1e4)/1e4+n.u:n.b,n)},Jme=function(e,n){return n.set(n.t,n.p,e===1?n.e:e?Math.round((n.s+n.c*e)*1e4)/1e4+n.u:n.b,n)},e0e=function(e,n){var r=n.s+n.c*e;n.set(n.t,n.p,~~(r+(r<0?-.5:.5))+n.u,n)},HF=function(e,n){return n.set(n.t,n.p,e?n.e:n.b,n)},UF=function(e,n){return n.set(n.t,n.p,e!==1?n.b:n.e,n)},t0e=function(e,n,r){return e.style[n]=r},n0e=function(e,n,r){return e.style.setProperty(n,r)},r0e=function(e,n,r){return e._gsap[n]=r},s0e=function(e,n,r){return e._gsap.scaleX=e._gsap.scaleY=r},i0e=function(e,n,r,s,i){var o=e._gsap;o.scaleX=o.scaleY=r,o.renderTransform(i,o)},o0e=function(e,n,r,s,i){var o=e._gsap;o[n]=r,o.renderTransform(i,o)},Yn="transform",ni=Yn+"Origin",a0e=function t(e,n){var r=this,s=this.target,i=s.style,o=s._gsap;if(e in rl&&i){if(this.tfm=this.tfm||{},e!=="transform")e=ea[e]||e,~e.indexOf(",")?e.split(",").forEach(function(l){return r.tfm[l]=ja(s,l)}):this.tfm[e]=o.x?o[e]:ja(s,e),e===ni&&(this.tfm.zOrigin=o.zOrigin);else return ea.transform.split(",").forEach(function(l){return t.call(r,l,n)});if(this.props.indexOf(Yn)>=0)return;o.svg&&(this.svgo=s.getAttribute("data-svg-origin"),this.props.push(ni,n,"")),e=Yn}(i||n)&&this.props.push(e,n,i[e])},BF=function(e){e.translate&&(e.removeProperty("translate"),e.removeProperty("scale"),e.removeProperty("rotate"))},l0e=function(){var e=this.props,n=this.target,r=n.style,s=n._gsap,i,o;for(i=0;i<e.length;i+=3)e[i+1]?e[i+1]===2?n[e[i]](e[i+2]):n[e[i]]=e[i+2]:e[i+2]?r[e[i]]=e[i+2]:r.removeProperty(e[i].substr(0,2)==="--"?e[i]:e[i].replace(f6,"-$1").toLowerCase());if(this.tfm){for(o in this.tfm)s[o]=this.tfm[o];s.svg&&(s.renderTransform(),n.setAttribute("data-svg-origin",this.svgo||"")),i=d6(),(!i||!i.isStart)&&!r[Yn]&&(BF(r),s.zOrigin&&r[ni]&&(r[ni]+=" "+s.zOrigin+"px",s.zOrigin=0,s.renderTransform()),s.uncache=1)}},ZF=function(e,n){var r={target:e,props:[],revert:l0e,save:a0e};return e._gsap||ri.core.getCache(e),n&&e.style&&e.nodeType&&n.split(",").forEach(function(s){return r.save(s)}),r},WF,CS=function(e,n){var r=Ql.createElementNS?Ql.createElementNS((n||"http://www.w3.org/1999/xhtml").replace(/^https/,"http"),e):Ql.createElement(e);return r&&r.style?r:Ql.createElement(e)},bi=function t(e,n,r){var s=getComputedStyle(e);return s[n]||s.getPropertyValue(n.replace(f6,"-$1").toLowerCase())||s.getPropertyValue(n)||!r&&t(e,Wf(n)||n,1)||""},m4="O,Moz,ms,Ms,Webkit".split(","),Wf=function(e,n,r){var s=n||uu,i=s.style,o=5;if(e in i&&!r)return e;for(e=e.charAt(0).toUpperCase()+e.substr(1);o--&&!(m4[o]+e in i););return o<0?null:(o===3?"ms":o>=0?m4[o]:"")+e},PS=function(){Gme()&&window.document&&(f4=window,Ql=f4.document,rf=Ql.documentElement,uu=CS("div")||{style:{}},CS("div"),Yn=Wf(Yn),ni=Yn+"Origin",uu.style.cssText="border-width:0;line-height:0;position:absolute;padding:0",WF=!!Wf("perspective"),d6=ri.core.reverting,u6=1)},g4=function(e){var n=e.ownerSVGElement,r=CS("svg",n&&n.getAttribute("xmlns")||"http://www.w3.org/2000/svg"),s=e.cloneNode(!0),i;s.style.display="block",r.appendChild(s),rf.appendChild(r);try{i=s.getBBox()}catch{}return r.removeChild(s),rf.removeChild(r),i},v4=function(e,n){for(var r=n.length;r--;)if(e.hasAttribute(n[r]))return e.getAttribute(n[r])},qF=function(e){var n,r;try{n=e.getBBox()}catch{n=g4(e),r=1}return n&&(n.width||n.height)||r||(n=g4(e)),n&&!n.width&&!n.x&&!n.y?{x:+v4(e,["x","cx","x1"])||0,y:+v4(e,["y","cy","y1"])||0,width:0,height:0}:n},GF=function(e){return!!(e.getCTM&&(!e.parentNode||e.ownerSVGElement)&&qF(e))},_c=function(e,n){if(n){var r=e.style,s;n in rl&&n!==ni&&(n=Yn),r.removeProperty?(s=n.substr(0,2),(s==="ms"||n.substr(0,6)==="webkit")&&(n="-"+n),r.removeProperty(s==="--"?n:n.replace(f6,"-$1").toLowerCase())):r.removeAttribute(n)}},Jl=function(e,n,r,s,i,o){var l=new ti(e._pt,n,r,0,1,o?UF:HF);return e._pt=l,l.b=s,l.e=i,e._props.push(r),l},y4={deg:1,rad:1,turn:1},c0e={grid:1,flex:1},wc=function t(e,n,r,s){var i=parseFloat(r)||0,o=(r+"").trim().substr((i+"").length)||"px",l=uu.style,c=Kme.test(n),d=e.tagName.toLowerCase()==="svg",f=(d?"client":"offset")+(c?"Width":"Height"),h=100,m=s==="px",v=s==="%",_,y,w,x;if(s===o||!i||y4[s]||y4[o])return i;if(o!=="px"&&!m&&(i=t(e,n,r,"px")),x=e.getCTM&&GF(e),(v||o==="%")&&(rl[n]||~n.indexOf("adius")))return _=x?e.getBBox()[c?"width":"height"]:e[f],lr(v?i/_*h:i/100*_);if(l[c?"width":"height"]=h+(m?o:s),y=s!=="rem"&&~n.indexOf("adius")||s==="em"&&e.appendChild&&!d?e:e.parentNode,x&&(y=(e.ownerSVGElement||{}).parentNode),(!y||y===Ql||!y.appendChild)&&(y=Ql.body),w=y._gsap,w&&v&&w.width&&c&&w.time===_i.time&&!w.uncache)return lr(i/w.width*h);if(v&&(n==="height"||n==="width")){var k=e.style[n];e.style[n]=h+s,_=e[f],k?e.style[n]=k:_c(e,n)}else(v||o==="%")&&!c0e[bi(y,"display")]&&(l.position=bi(e,"position")),y===e&&(l.position="static"),y.appendChild(uu),_=uu[f],y.removeChild(uu),l.position="absolute";return c&&v&&(w=Ru(y),w.time=_i.time,w.width=y[f]),lr(m?_*i/h:_&&i?h/_*i:0)},ja=function(e,n,r,s){var i;return u6||PS(),n in ea&&n!=="transform"&&(n=ea[n],~n.indexOf(",")&&(n=n.split(",")[0])),rl[n]&&n!=="transform"?(i=wm(e,s),i=n!=="transformOrigin"?i[n]:i.svg?i.origin:b1(bi(e,ni))+" "+i.zOrigin+"px"):(i=e.style[n],(!i||i==="auto"||s||~(i+"").indexOf("calc("))&&(i=w1[n]&&w1[n](e,n,r)||bi(e,n)||hF(e,n)||(n==="opacity"?1:0))),r&&!~(i+"").trim().indexOf(" ")?wc(e,n,i,r)+r:i},u0e=function(e,n,r,s){if(!r||r==="none"){var i=Wf(n,e,1),o=i&&bi(e,i,1);o&&o!==r?(n=i,r=o):n==="borderColor"&&(r=bi(e,"borderTopColor"))}var l=new ti(this._pt,e.style,n,0,1,FF),c=0,d=0,f,h,m,v,_,y,w,x,k,P,C,T;if(l.b=r,l.e=s,r+="",s+="",s.substring(0,6)==="var(--"&&(s=bi(e,s.substring(4,s.indexOf(")")))),s==="auto"&&(y=e.style[n],e.style[n]=s,s=bi(e,n)||s,y?e.style[n]=y:_c(e,n)),f=[r,s],OF(f),r=f[0],s=f[1],m=r.match(qd)||[],T=s.match(qd)||[],T.length){for(;h=qd.exec(s);)w=h[0],k=s.substring(c,h.index),_?_=(_+1)%5:(k.substr(-5)==="rgba("||k.substr(-5)==="hsla(")&&(_=1),w!==(y=m[d++]||"")&&(v=parseFloat(y)||0,C=y.substr((v+"").length),w.charAt(1)==="="&&(w=nf(v,w)+C),x=parseFloat(w),P=w.substr((x+"").length),c=qd.lastIndex-P.length,P||(P=P||ki.units[n]||C,c===s.length&&(s+=P,l.e+=P)),C!==P&&(v=wc(e,n,y,P)||0),l._pt={_next:l._pt,p:k||d===1?k:",",s:v,c:x-v,m:_&&_<4||n==="zIndex"?Math.round:0});l.c=c<s.length?s.substring(c,s.length):""}else l.r=n==="display"&&s==="none"?UF:HF;return lF.test(s)&&(l.e=0),this._pt=l,l},_4={top:"0%",bottom:"100%",left:"0%",right:"100%",center:"50%"},d0e=function(e){var n=e.split(" "),r=n[0],s=n[1]||"50%";return(r==="top"||r==="bottom"||s==="left"||s==="right")&&(e=r,r=s,s=e),n[0]=_4[r]||r,n[1]=_4[s]||s,n.join(" ")},f0e=function(e,n){if(n.tween&&n.tween._time===n.tween._dur){var r=n.t,s=r.style,i=n.u,o=r._gsap,l,c,d;if(i==="all"||i===!0)s.cssText="",c=1;else for(i=i.split(","),d=i.length;--d>-1;)l=i[d],rl[l]&&(c=1,l=l==="transformOrigin"?ni:Yn),_c(r,l);c&&(_c(r,Yn),o&&(o.svg&&r.removeAttribute("transform"),s.scale=s.rotate=s.translate="none",wm(r,1),o.uncache=1,BF(s)))}},w1={clearProps:function(e,n,r,s,i){if(i.data!=="isFromStart"){var o=e._pt=new ti(e._pt,n,r,0,0,f0e);return o.u=s,o.pr=-10,o.tween=i,e._props.push(r),1}}},_m=[1,0,0,1,0,0],KF={},YF=function(e){return e==="matrix(1, 0, 0, 1, 0, 0)"||e==="none"||!e},w4=function(e){var n=bi(e,Yn);return YF(n)?_m:n.substr(7).match(aF).map(lr)},h6=function(e,n){var r=e._gsap||Ru(e),s=e.style,i=w4(e),o,l,c,d;return r.svg&&e.getAttribute("transform")?(c=e.transform.baseVal.consolidate().matrix,i=[c.a,c.b,c.c,c.d,c.e,c.f],i.join(",")==="1,0,0,1,0,0"?_m:i):(i===_m&&!e.offsetParent&&e!==rf&&!r.svg&&(c=s.display,s.display="block",o=e.parentNode,(!o||!e.offsetParent&&!e.getBoundingClientRect().width)&&(d=1,l=e.nextElementSibling,rf.appendChild(e)),i=w4(e),c?s.display=c:_c(e,"display"),d&&(l?o.insertBefore(e,l):o?o.appendChild(e):rf.removeChild(e))),n&&i.length>6?[i[0],i[1],i[4],i[5],i[12],i[13]]:i)},AS=function(e,n,r,s,i,o){var l=e._gsap,c=i||h6(e,!0),d=l.xOrigin||0,f=l.yOrigin||0,h=l.xOffset||0,m=l.yOffset||0,v=c[0],_=c[1],y=c[2],w=c[3],x=c[4],k=c[5],P=n.split(" "),C=parseFloat(P[0])||0,T=parseFloat(P[1])||0,O,I,R,N;r?c!==_m&&(I=v*w-_*y)&&(R=C*(w/I)+T*(-y/I)+(y*k-w*x)/I,N=C*(-_/I)+T*(v/I)-(v*k-_*x)/I,C=R,T=N):(O=qF(e),C=O.x+(~P[0].indexOf("%")?C/100*O.width:C),T=O.y+(~(P[1]||P[0]).indexOf("%")?T/100*O.height:T)),s||s!==!1&&l.smooth?(x=C-d,k=T-f,l.xOffset=h+(x*v+k*y)-x,l.yOffset=m+(x*_+k*w)-k):l.xOffset=l.yOffset=0,l.xOrigin=C,l.yOrigin=T,l.smooth=!!s,l.origin=n,l.originIsAbsolute=!!r,e.style[ni]="0px 0px",o&&(Jl(o,l,"xOrigin",d,C),Jl(o,l,"yOrigin",f,T),Jl(o,l,"xOffset",h,l.xOffset),Jl(o,l,"yOffset",m,l.yOffset)),e.setAttribute("data-svg-origin",C+" "+T)},wm=function(e,n){var r=e._gsap||new NF(e);if("x"in r&&!n&&!r.uncache)return r;var s=e.style,i=r.scaleX<0,o="px",l="deg",c=getComputedStyle(e),d=bi(e,ni)||"0",f,h,m,v,_,y,w,x,k,P,C,T,O,I,R,N,L,z,$,G,X,q,H,ee,V,Q,U,D,K,de,ie,ce;return f=h=m=y=w=x=k=P=C=0,v=_=1,r.svg=!!(e.getCTM&&GF(e)),c.translate&&((c.translate!=="none"||c.scale!=="none"||c.rotate!=="none")&&(s[Yn]=(c.translate!=="none"?"translate3d("+(c.translate+" 0 0").split(" ").slice(0,3).join(", ")+") ":"")+(c.rotate!=="none"?"rotate("+c.rotate+") ":"")+(c.scale!=="none"?"scale("+c.scale.split(" ").join(",")+") ":"")+(c[Yn]!=="none"?c[Yn]:"")),s.scale=s.rotate=s.translate="none"),I=h6(e,r.svg),r.svg&&(r.uncache?(V=e.getBBox(),d=r.xOrigin-V.x+"px "+(r.yOrigin-V.y)+"px",ee=""):ee=!n&&e.getAttribute("data-svg-origin"),AS(e,ee||d,!!ee||r.originIsAbsolute,r.smooth!==!1,I)),T=r.xOrigin||0,O=r.yOrigin||0,I!==_m&&(z=I[0],$=I[1],G=I[2],X=I[3],f=q=I[4],h=H=I[5],I.length===6?(v=Math.sqrt(z*z+$*$),_=Math.sqrt(X*X+G*G),y=z||$?Id($,z)*ou:0,k=G||X?Id(G,X)*ou+y:0,k&&(_*=Math.abs(Math.cos(k*sf))),r.svg&&(f-=T-(T*z+O*G),h-=O-(T*$+O*X))):(ce=I[6],de=I[7],U=I[8],D=I[9],K=I[10],ie=I[11],f=I[12],h=I[13],m=I[14],R=Id(ce,K),w=R*ou,R&&(N=Math.cos(-R),L=Math.sin(-R),ee=q*N+U*L,V=H*N+D*L,Q=ce*N+K*L,U=q*-L+U*N,D=H*-L+D*N,K=ce*-L+K*N,ie=de*-L+ie*N,q=ee,H=V,ce=Q),R=Id(-G,K),x=R*ou,R&&(N=Math.cos(-R),L=Math.sin(-R),ee=z*N-U*L,V=$*N-D*L,Q=G*N-K*L,ie=X*L+ie*N,z=ee,$=V,G=Q),R=Id($,z),y=R*ou,R&&(N=Math.cos(R),L=Math.sin(R),ee=z*N+$*L,V=q*N+H*L,$=$*N-z*L,H=H*N-q*L,z=ee,q=V),w&&Math.abs(w)+Math.abs(y)>359.9&&(w=y=0,x=180-x),v=lr(Math.sqrt(z*z+$*$+G*G)),_=lr(Math.sqrt(H*H+ce*ce)),R=Id(q,H),k=Math.abs(R)>2e-4?R*ou:0,C=ie?1/(ie<0?-ie:ie):0),r.svg&&(ee=e.getAttribute("transform"),r.forceCSS=e.setAttribute("transform","")||!YF(bi(e,Yn)),ee&&e.setAttribute("transform",ee))),Math.abs(k)>90&&Math.abs(k)<270&&(i?(v*=-1,k+=y<=0?180:-180,y+=y<=0?180:-180):(_*=-1,k+=k<=0?180:-180)),n=n||r.uncache,r.x=f-((r.xPercent=f&&(!n&&r.xPercent||(Math.round(e.offsetWidth/2)===Math.round(-f)?-50:0)))?e.offsetWidth*r.xPercent/100:0)+o,r.y=h-((r.yPercent=h&&(!n&&r.yPercent||(Math.round(e.offsetHeight/2)===Math.round(-h)?-50:0)))?e.offsetHeight*r.yPercent/100:0)+o,r.z=m+o,r.scaleX=lr(v),r.scaleY=lr(_),r.rotation=lr(y)+l,r.rotationX=lr(w)+l,r.rotationY=lr(x)+l,r.skewX=k+l,r.skewY=P+l,r.transformPerspective=C+o,(r.zOrigin=parseFloat(d.split(" ")[2])||!n&&r.zOrigin||0)&&(s[ni]=b1(d)),r.xOffset=r.yOffset=0,r.force3D=ki.force3D,r.renderTransform=r.svg?p0e:WF?XF:h0e,r.uncache=0,r},b1=function(e){return(e=e.split(" "))[0]+" "+e[1]},Bw=function(e,n,r){var s=ws(n);return lr(parseFloat(n)+parseFloat(wc(e,"x",r+"px",s)))+s},h0e=function(e,n){n.z="0px",n.rotationY=n.rotationX="0deg",n.force3D=0,XF(e,n)},eu="0deg",Yh="0px",tu=") ",XF=function(e,n){var r=n||this,s=r.xPercent,i=r.yPercent,o=r.x,l=r.y,c=r.z,d=r.rotation,f=r.rotationY,h=r.rotationX,m=r.skewX,v=r.skewY,_=r.scaleX,y=r.scaleY,w=r.transformPerspective,x=r.force3D,k=r.target,P=r.zOrigin,C="",T=x==="auto"&&e&&e!==1||x===!0;if(P&&(h!==eu||f!==eu)){var O=parseFloat(f)*sf,I=Math.sin(O),R=Math.cos(O),N;O=parseFloat(h)*sf,N=Math.cos(O),o=Bw(k,o,I*N*-P),l=Bw(k,l,-Math.sin(O)*-P),c=Bw(k,c,R*N*-P+P)}w!==Yh&&(C+="perspective("+w+tu),(s||i)&&(C+="translate("+s+"%, "+i+"%) "),(T||o!==Yh||l!==Yh||c!==Yh)&&(C+=c!==Yh||T?"translate3d("+o+", "+l+", "+c+") ":"translate("+o+", "+l+tu),d!==eu&&(C+="rotate("+d+tu),f!==eu&&(C+="rotateY("+f+tu),h!==eu&&(C+="rotateX("+h+tu),(m!==eu||v!==eu)&&(C+="skew("+m+", "+v+tu),(_!==1||y!==1)&&(C+="scale("+_+", "+y+tu),k.style[Yn]=C||"translate(0, 0)"},p0e=function(e,n){var r=n||this,s=r.xPercent,i=r.yPercent,o=r.x,l=r.y,c=r.rotation,d=r.skewX,f=r.skewY,h=r.scaleX,m=r.scaleY,v=r.target,_=r.xOrigin,y=r.yOrigin,w=r.xOffset,x=r.yOffset,k=r.forceCSS,P=parseFloat(o),C=parseFloat(l),T,O,I,R,N;c=parseFloat(c),d=parseFloat(d),f=parseFloat(f),f&&(f=parseFloat(f),d+=f,c+=f),c||d?(c*=sf,d*=sf,T=Math.cos(c)*h,O=Math.sin(c)*h,I=Math.sin(c-d)*-m,R=Math.cos(c-d)*m,d&&(f*=sf,N=Math.tan(d-f),N=Math.sqrt(1+N*N),I*=N,R*=N,f&&(N=Math.tan(f),N=Math.sqrt(1+N*N),T*=N,O*=N)),T=lr(T),O=lr(O),I=lr(I),R=lr(R)):(T=h,R=m,O=I=0),(P&&!~(o+"").indexOf("px")||C&&!~(l+"").indexOf("px"))&&(P=wc(v,"x",o,"px"),C=wc(v,"y",l,"px")),(_||y||w||x)&&(P=lr(P+_-(_*T+y*I)+w),C=lr(C+y-(_*O+y*R)+x)),(s||i)&&(N=v.getBBox(),P=lr(P+s/100*N.width),C=lr(C+i/100*N.height)),N="matrix("+T+","+O+","+I+","+R+","+P+","+C+")",v.setAttribute("transform",N),k&&(v.style[Yn]=N)},m0e=function(e,n,r,s,i){var o=360,l=Hr(i),c=parseFloat(i)*(l&&~i.indexOf("rad")?ou:1),d=c-s,f=s+d+"deg",h,m;return l&&(h=i.split("_")[1],h==="short"&&(d%=o,d!==d%(o/2)&&(d+=d<0?o:-o)),h==="cw"&&d<0?d=(d+o*p4)%o-~~(d/o)*o:h==="ccw"&&d>0&&(d=(d-o*p4)%o-~~(d/o)*o)),e._pt=m=new ti(e._pt,n,r,s,d,Xme),m.e=f,m.u="deg",e._props.push(r),m},b4=function(e,n){for(var r in n)e[r]=n[r];return e},g0e=function(e,n,r){var s=b4({},r._gsap),i="perspective,force3D,transformOrigin,svgOrigin",o=r.style,l,c,d,f,h,m,v,_;s.svg?(d=r.getAttribute("transform"),r.setAttribute("transform",""),o[Yn]=n,l=wm(r,1),_c(r,Yn),r.setAttribute("transform",d)):(d=getComputedStyle(r)[Yn],o[Yn]=n,l=wm(r,1),o[Yn]=d);for(c in rl)d=s[c],f=l[c],d!==f&&i.indexOf(c)<0&&(v=ws(d),_=ws(f),h=v!==_?wc(r,c,d,_):parseFloat(d),m=parseFloat(f),e._pt=new ti(e._pt,l,c,h,m-h,ES),e._pt.u=_||0,e._props.push(c));b4(l,s)};ei("padding,margin,Width,Radius",function(t,e){var n="Top",r="Right",s="Bottom",i="Left",o=(e<3?[n,r,s,i]:[n+i,n+r,s+r,s+i]).map(function(l){return e<2?t+l:"border"+l+t});w1[e>1?"border"+t:t]=function(l,c,d,f,h){var m,v;if(arguments.length<4)return m=o.map(function(_){return ja(l,_,d)}),v=m.join(" "),v.split(m[0]).length===5?m[0]:v;m=(f+"").split(" "),v={},o.forEach(function(_,y){return v[_]=m[y]=m[y]||m[(y-1)/2|0]}),l.init(c,v,h)}});var QF={name:"css",register:PS,targetTest:function(e){return e.style&&e.nodeType},init:function(e,n,r,s,i){var o=this._props,l=e.style,c=r.vars.startAt,d,f,h,m,v,_,y,w,x,k,P,C,T,O,I,R,N;u6||PS(),this.styles=this.styles||ZF(e),R=this.styles.props,this.tween=r;for(y in n)if(y!=="autoRound"&&(f=n[y],!(mi[y]&&LF(y,n,r,s,e,i)))){if(v=typeof f,_=w1[y],v==="function"&&(f=f.call(r,s,e,i),v=typeof f),v==="string"&&~f.indexOf("random(")&&(f=mm(f)),_)_(this,e,y,f,r)&&(I=1);else if(y.substr(0,2)==="--")d=(getComputedStyle(e).getPropertyValue(y)+"").trim(),f+="",ic.lastIndex=0,ic.test(d)||(w=ws(d),x=ws(f),x?w!==x&&(d=wc(e,y,d,x)+x):w&&(f+=w)),this.add(l,"setProperty",d,f,s,i,0,0,y),o.push(y),R.push(y,0,l[y]);else if(v!=="undefined"){if(c&&y in c?(d=typeof c[y]=="function"?c[y].call(r,s,e,i):c[y],Hr(d)&&~d.indexOf("random(")&&(d=mm(d)),ws(d+"")||d==="auto"||(d+=ki.units[y]||ws(ja(e,y))||""),(d+"").charAt(1)==="="&&(d=ja(e,y))):d=ja(e,y),m=parseFloat(d),k=v==="string"&&f.charAt(1)==="="&&f.substr(0,2),k&&(f=f.substr(2)),h=parseFloat(f),y in ea&&(y==="autoAlpha"&&(m===1&&ja(e,"visibility")==="hidden"&&h&&(m=0),R.push("visibility",0,l.visibility),Jl(this,l,"visibility",m?"inherit":"hidden",h?"inherit":"hidden",!h)),y!=="scale"&&y!=="transform"&&(y=ea[y],~y.indexOf(",")&&(y=y.split(",")[0]))),P=y in rl,P){if(this.styles.save(y),N=f,v==="string"&&f.substring(0,6)==="var(--"){if(f=bi(e,f.substring(4,f.indexOf(")"))),f.substring(0,5)==="calc("){var L=e.style.perspective;e.style.perspective=f,f=bi(e,"perspective"),L?e.style.perspective=L:_c(e,"perspective")}h=parseFloat(f)}if(C||(T=e._gsap,T.renderTransform&&!n.parseTransform||wm(e,n.parseTransform),O=n.smoothOrigin!==!1&&T.smooth,C=this._pt=new ti(this._pt,l,Yn,0,1,T.renderTransform,T,0,-1),C.dep=1),y==="scale")this._pt=new ti(this._pt,T,"scaleY",T.scaleY,(k?nf(T.scaleY,k+h):h)-T.scaleY||0,ES),this._pt.u=0,o.push("scaleY",y),y+="X";else if(y==="transformOrigin"){R.push(ni,0,l[ni]),f=d0e(f),T.svg?AS(e,f,0,O,0,this):(x=parseFloat(f.split(" ")[2])||0,x!==T.zOrigin&&Jl(this,T,"zOrigin",T.zOrigin,x),Jl(this,l,y,b1(d),b1(f)));continue}else if(y==="svgOrigin"){AS(e,f,1,O,0,this);continue}else if(y in KF){m0e(this,T,y,m,k?nf(m,k+f):f);continue}else if(y==="smoothOrigin"){Jl(this,T,"smooth",T.smooth,f);continue}else if(y==="force3D"){T[y]=f;continue}else if(y==="transform"){g0e(this,f,e);continue}}else y in l||(y=Wf(y)||y);if(P||(h||h===0)&&(m||m===0)&&!Yme.test(f)&&y in l)w=(d+"").substr((m+"").length),h||(h=0),x=ws(f)||(y in ki.units?ki.units[y]:w),w!==x&&(m=wc(e,y,d,x)),this._pt=new ti(this._pt,P?T:l,y,m,(k?nf(m,k+h):h)-m,!P&&(x==="px"||y==="zIndex")&&n.autoRound!==!1?e0e:ES),this._pt.u=x||0,P&&N!==f?(this._pt.b=d,this._pt.e=N,this._pt.r=Jme):w!==x&&x!=="%"&&(this._pt.b=d,this._pt.r=Qme);else if(y in l)u0e.call(this,e,y,d,k?k+f:f);else if(y in e)this.add(e,y,d||e[y],k?k+f:f,s,i);else if(y!=="parseTransform"){e6(y,f);continue}P||(y in l?R.push(y,0,l[y]):typeof e[y]=="function"?R.push(y,2,e[y]()):R.push(y,1,d||e[y])),o.push(y)}}I&&zF(this)},render:function(e,n){if(n.tween._time||!d6())for(var r=n._pt;r;)r.r(e,r.d),r=r._next;else n.styles.revert()},get:ja,aliases:ea,getSetter:function(e,n,r){var s=ea[n];return s&&s.indexOf(",")<0&&(n=s),n in rl&&n!==ni&&(e._gsap.x||ja(e,"x"))?r&&h4===r?n==="scale"?s0e:r0e:(h4=r||{})&&(n==="scale"?i0e:o0e):e.style&&!XE(e.style[n])?t0e:~n.indexOf("-")?n0e:l6(e,n)},core:{_removeProperty:_c,_getMatrix:h6}};ri.utils.checkPrefix=Wf;ri.core.getStyleSaver=ZF;(function(t,e,n,r){var s=ei(t+","+e+","+n,function(i){rl[i]=1});ei(e,function(i){ki.units[i]="deg",KF[i]=1}),ea[s[13]]=t+","+e,ei(r,function(i){var o=i.split(":");ea[o[1]]=s[o[0]]})})("x,y,z,scale,scaleX,scaleY,xPercent,yPercent","rotation,rotationX,rotationY,skewX,skewY","transform,transformOrigin,svgOrigin,force3D,smoothOrigin,transformPerspective","0:translateX,1:translateY,2:translateZ,8:rotate,8:rotationZ,8:rotateZ,9:rotateX,10:rotateY");ei("x,y,z,top,right,bottom,left,width,height,fontSize,padding,margin,perspective",function(t){ki.units[t]="px"});ri.registerPlugin(QF);var go=ri.registerPlugin(QF)||ri;go.core.Tween;const lv="/assets/logo-animation",Zw=1280,v0e=[{id:"eraser",src:`${lv}/eraser.png`,cssW:189,cssH:74,rot:-90,fit:337,localX:60,localY:168,seaX:.2,seaY:.27,seaRot:-8},{id:"clasp",src:`${lv}/clasp.png`,cssW:170,cssH:170,rot:-248,fit:205,flip:!0,localX:188,localY:97,seaX:.8,seaY:.24,seaRot:-18},{id:"ball",src:`${lv}/playdough.png`,cssW:236,cssH:206,rot:5,fit:150,localX:182,localY:277,seaX:.52,seaY:.79,seaRot:6}],y0e=[{k:"pot",x:.075,y:.2,r:-12,w:152},{k:"chair",x:.1,y:.52,r:8,w:150},{k:"mug",x:.11,y:.84,r:-6,w:140},{k:"cart",x:.3,y:.13,r:10,w:178},{k:"terracotta-1",x:.345,y:.45,r:-18,w:122},{k:"pitcher",x:.285,y:.71,r:14,w:128},{k:"desk",x:.46,y:.25,r:-8,w:198},{k:"startac",x:.475,y:.55,r:16,w:140},{k:"vhsplant",x:.4,y:.9,r:-6,w:188},{k:"bubblephone",x:.63,y:.12,r:12,w:150},{k:"terracotta-2",x:.61,y:.43,r:20,w:122},{k:"pot",x:.675,y:.68,r:14,w:140},{k:"chair",x:.71,y:.91,r:-12,w:140},{k:"mug",x:.91,y:.15,r:8,w:136},{k:"cart",x:.905,y:.47,r:-10,w:166},{k:"startac",x:.88,y:.76,r:18,w:136}],TS=({className:t})=>{const e=g.useRef(null),n=g.useRef(null),r=g.useRef(null);return g.useEffect(()=>{const s=e.current,i=n.current,o=r.current;if(!s||!i||!o)return;const l=window.matchMedia("(prefers-reduced-motion: reduce)").matches,c=(x,k)=>x+Math.random()*(k-x);let d=null,f,h=1;const m=v0e.map(x=>({...x})),v=()=>{s.querySelectorAll(".la-obj").forEach(R=>R.remove());const x=s.getBoundingClientRect(),k=x.width||Zw,P=x.height||Zw*.64;h=k/Zw,i.style.width=`${242*h}px`,i.style.height=`${250*h}px`;const T=250*h/337,O=[],I=(R,N,L)=>{const z=document.createElement("div");return z.className="la-obj",z.style.width=`${N}px`,z.innerHTML=`<img src="${R}" alt="" style="${L?"transform:scaleX(-1)":""}">`,s.appendChild(z),z};return y0e.forEach((R,N)=>{const L=R.w*h,z=I(`${lv}/sea/${R.k}.png`,L,N%2===0);go.set(z,{x:R.x*k-L/2,y:R.y*P-L/2,rotation:R.r,opacity:1,scale:0,transformOrigin:"50% 50%"}),O.push({el:z,hero:!1,rest:1})}),m.forEach(R=>{const N=R.cssW*h;R.el=I(R.src,N,!!R.flip),R.finalScale=R.fit*T/(R.cssW*h),go.set(R.el,{x:R.seaX*k-N/2,y:R.seaY*P-R.cssH*h/2,rotation:R.seaRot,opacity:1,scale:0,transformOrigin:"50% 50%",zIndex:30}),O.push({el:R.el,hero:!0,rest:150/R.cssW})}),O},_=(x,k)=>{const P=s.getBoundingClientRect(),C=o.getBoundingClientRect();return{x:C.left-P.left+x/326*C.width,y:C.top-P.top+k/337*C.height}},y=()=>{d&&d.revert();const x=v();if(l){d=go.context(()=>{x.filter(C=>!C.hero).forEach(C=>go.set(C.el,{scale:0})),m.forEach(C=>{if(!C.el)return;const T=_(C.localX,C.localY);go.set(C.el,{x:T.x-C.cssW*h/2,y:T.y-C.cssH*h/2,rotation:C.rot,scale:C.finalScale})})},s);return}const k=[],P=[];d=go.context(()=>{const C=go.timeline();C.to(x.map(T=>T.el),{scale:T=>x[T].rest,duration:.5,ease:"steps(4)",stagger:{each:.045,from:"random"}}),C.add(()=>{x.forEach(({el:T,hero:O},I)=>{const R=O?k:P,N=I%2?1:-1;R.push(go.to(T,{rotation:"+="+c(2.5,6)*N,duration:c(.5,.9),repeat:-1,yoyo:!0,ease:"steps(2)",delay:c(0,.4)}),go.to(T,{y:"+="+c(5,11)*N,x:"+="+c(4,9)*-N,duration:c(.7,1.2),repeat:-1,yoyo:!0,ease:"steps(3)",delay:c(0,.4)}))})},"<0.1"),C.to({},{duration:1.1}),C.add("pick"),m.forEach((T,O)=>{T.el&&C.to(T.el,{scale:150/T.cssW*1.2,duration:.28,ease:"steps(3)",yoyo:!0,repeat:1},"pick+="+O*.08)}),C.add("clear","pick+=0.7"),C.add(()=>P.forEach(T=>T.kill()),"clear"),C.to(x.filter(T=>!T.hero).map(T=>T.el),{scale:0,rotation:"+=40",duration:.5,ease:"steps(5)",overwrite:"auto",stagger:{each:.025,from:"random"}},"clear"),C.add("assemble","clear+=0.25"),C.add(()=>k.forEach(T=>T.kill()),"assemble"),m.forEach((T,O)=>{if(!T.el||T.finalScale===void 0)return;const I=_(T.localX,T.localY);C.to(T.el,{x:I.x-T.cssW*h/2,y:I.y-T.cssH*h/2,rotation:T.rot,scale:T.finalScale,duration:1.05,ease:"steps(9)",overwrite:"auto"},"assemble+="+O*.12)}),m.forEach(T=>{!T.el||T.finalScale===void 0||C.to(T.el,{scale:T.finalScale*1.03,duration:.16,ease:"steps(2)",yoyo:!0,repeat:1},"assemble+=1.45")})},s)};go.ticker.fps(12),y();const w=()=>{clearTimeout(f),f=setTimeout(y,250)};return window.addEventListener("resize",w),()=>{window.removeEventListener("resize",w),clearTimeout(f),d==null||d.revert(),s.querySelectorAll(".la-obj").forEach(x=>x.remove())}},[]),S.jsx("div",{ref:e,className:`la-scene ${t??""}`,children:S.jsx("div",{ref:n,className:"la-logo-stage",children:S.jsx("svg",{ref:r,className:"la-mark",viewBox:"0 0 326 337","aria-hidden":"true"})})})},_0e=Object.freeze(Object.defineProperty({__proto__:null,default:TS},Symbol.toStringTag,{value:"Module"})),x4=({isSigningIn:t})=>t?S.jsxs(S.Fragment,{children:[S.jsx("div",{className:"h-5 w-5 animate-spin rounded-full border-2 border-current border-t-transparent"}),S.jsx("span",{children:"Signing in..."})]}):S.jsxs(S.Fragment,{children:[S.jsx("img",{src:"https://www.gstatic.com/firebasejs/ui/2.0.0/images/auth/google.svg",alt:"Google",className:"h-5 w-5"}),S.jsx("span",{children:"Sign in with Google"})]}),w0e=({isSigningIn:t,onStartSignIn:e,errorMessage:n=null,displayMode:r="full"})=>r==="modal"?S.jsxs("div",{className:"glass-panel relative w-full max-w-sm overflow-hidden rounded-2xl border border-white/10 font-main text-white shadow-2xl",children:[S.jsx(TS,{className:"relative z-0 h-44 w-full"}),S.jsxs("div",{className:"relative z-10 flex flex-col items-center gap-6 px-8 pb-12 pt-8",children:[S.jsxs("div",{className:"flex flex-col items-center gap-2 text-center",children:[S.jsx("h1",{className:"text-xl font-medium text-content",children:"Welcome to Rivet"}),S.jsx("p",{className:"text-sm leading-relaxed text-content-muted",children:"Rivet understands your references, and then explores dozens of design directions with you."})]}),S.jsx("button",{onClick:e,disabled:t,className:"glass-panel active-push flex cursor-pointer items-center gap-3 rounded-xl px-8 py-3.5 text-sm font-medium transition-colors hover:bg-main-hover disabled:cursor-not-allowed disabled:opacity-50",children:S.jsx(x4,{isSigningIn:t})}),n?S.jsx("p",{className:"text-center text-xs text-red-200",children:n}):null]})]}):S.jsxs("div",{className:"relative flex min-h-screen flex-col items-center justify-center overflow-hidden bg-white font-main text-[#18181b]",children:[S.jsx(TS,{className:"absolute inset-0 z-0"}),S.jsxs("div",{className:"pointer-events-none absolute inset-x-0 bottom-0 z-10 flex flex-col items-center gap-5 pb-[14vh]",children:[S.jsxs("div",{className:"flex flex-col items-center gap-2 px-6 text-center",children:[S.jsx("h1",{className:"text-xl font-medium tracking-tight text-[#18181b]",children:"Welcome to Rivet"}),S.jsx("p",{className:"max-w-md text-sm leading-relaxed text-[#71717a]",children:"Rivet understands your references, and then explores dozens of design directions with you."})]}),S.jsx("button",{onClick:e,disabled:t,className:"active-push pointer-events-auto flex cursor-pointer items-center gap-3 rounded-full border border-black/10 bg-white px-8 py-3.5 text-sm font-medium text-[#18181b] shadow-[0_8px_24px_rgba(40,33,28,0.14)] transition-colors hover:bg-[#faf9f7] disabled:cursor-not-allowed disabled:opacity-50",children:S.jsx(x4,{isSigningIn:t})}),n?S.jsx("p",{className:"text-center text-xs text-red-500",children:n}):null]})]}),b0e="data:image/svg+xml,%3csvg%20width='94'%20height='24'%20viewBox='0%200%2094%2024'%20fill='none'%20xmlns='http://www.w3.org/2000/svg'%3e%3cpath%20d='M-0.000156164%2023.832V7.704H5.11184L6.47984%208.424C7.58384%207.704%209.04784%207.344%2010.8718%207.344C12.0718%207.344%2013.1278%207.476%2014.0398%207.74C14.9518%207.98%2015.6838%208.244%2016.2358%208.532C16.8118%208.82%2017.1718%209.024%2017.3158%209.144L15.5158%2013.824C15.2758%2013.656%2014.8198%2013.428%2014.1478%2013.14C13.4998%2012.852%2012.7318%2012.588%2011.8438%2012.348C10.9558%2012.084%2010.0198%2011.952%209.03584%2011.952H8.63984C7.96784%2011.952%207.45184%2012.072%207.09184%2012.312C6.73184%2012.528%206.55184%2013.02%206.55184%2013.788V23.832H-0.000156164ZM23.464%206.156C21.04%206.156%2019.828%205.124%2019.828%203.06C19.828%201.908%2020.128%201.116%2020.728%200.684C21.352%200.227999%2022.264%20-1.43051e-06%2023.464%20-1.43051e-06C24.736%20-1.43051e-06%2025.66%200.227999%2026.236%200.684C26.836%201.116%2027.136%201.908%2027.136%203.06C27.136%205.124%2025.912%206.156%2023.464%206.156ZM20.152%2023.832V7.704H26.704V23.832H20.152ZM37.4767%2023.832L29.6647%207.704H36.9007L40.3207%2016.524L41.2567%2019.116H41.6167L42.5527%2016.524L46.0087%207.704H53.1727L52.5967%209.9L45.4327%2023.832H37.4767ZM61.1953%2023.832C59.6113%2023.832%2058.3873%2023.604%2057.5233%2023.148C56.6833%2022.692%2056.1073%2022.068%2055.7953%2021.276C55.4833%2020.46%2055.3273%2019.524%2055.3273%2018.468V13.032C55.3273%2012.072%2055.4833%2011.196%2055.7953%2010.404C56.1313%209.588%2056.7193%208.94%2057.5593%208.46C58.3993%207.956%2059.6113%207.704%2061.1953%207.704H68.6473C70.5193%207.704%2071.9473%207.932%2072.9313%208.388C73.9393%208.82%2074.6233%209.444%2074.9833%2010.26C75.3673%2011.052%2075.5593%2011.976%2075.5593%2013.032V17.64H69.2593C67.0993%2017.64%2065.4553%2017.592%2064.3273%2017.496C63.2233%2017.4%2062.4433%2017.34%2061.9873%2017.316V17.856C61.9633%2018.816%2062.5393%2019.296%2063.7153%2019.296H64.8313C66.7513%2019.296%2068.5273%2019.26%2070.1593%2019.188C71.7913%2019.092%2073.0033%2019.008%2073.7953%2018.936L75.9553%2022.356C75.9553%2022.596%2075.7513%2022.824%2075.3433%2023.04C74.9353%2023.256%2074.2153%2023.448%2073.1833%2023.616C72.1753%2023.76%2070.7353%2023.832%2068.8633%2023.832H61.1953ZM61.9873%2014.184H68.8993V13.68C68.8993%2013.2%2068.8513%2012.864%2068.7553%2012.672C68.6833%2012.48%2068.4313%2012.36%2067.9993%2012.312C67.5673%2012.264%2066.8353%2012.24%2065.8033%2012.24H63.7153C62.5633%2012.24%2061.9873%2012.72%2061.9873%2013.68V14.184ZM85.8224%2023.832C83.9984%2023.832%2082.7504%2023.448%2082.0784%2022.68C81.4064%2021.912%2081.0704%2020.76%2081.0704%2019.224V12.24H78.1184V7.704H79.6304C80.0384%207.704%2080.3624%207.632%2080.6024%207.488C80.8664%207.32%2081.0344%207.032%2081.1064%206.624L81.7904%202.772H87.6944V7.704H93.7064V12.24H87.6944V17.82C87.6944%2018.42%2087.8384%2018.816%2088.1264%2019.008C88.4144%2019.2%2088.8464%2019.296%2089.4224%2019.296H93.0224L93.7424%2023.472C93.2384%2023.544%2092.4704%2023.628%2091.4384%2023.724C90.4064%2023.796%2089.2784%2023.832%2088.0544%2023.832H85.8224Z'%20fill='%23FF3300'/%3e%3c/svg%3e",x0e=({message:t})=>S.jsx("div",{className:"relative flex min-h-screen flex-col items-center justify-center overflow-hidden bg-[#1c1c20] font-main text-white",children:S.jsxs("div",{className:"flex flex-col items-center gap-10",children:[S.jsx("img",{src:b0e,alt:"Rivet",className:"h-8 w-auto object-contain"}),S.jsxs("div",{className:"glass-panel flex items-center gap-3 rounded-xl px-8 py-3.5 text-sm font-medium",children:[S.jsx(U1,{className:"h-5 w-5 shrink-0 animate-spin text-primary",weight:"bold"}),S.jsx("span",{children:t})]})]})}),S0e="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",x1=44,Xh=8,Ag=16,k0e=4,S4=-18,E0e=.18,C0e=[.22,1,.36,1],k4=.92,P0e=1,A0e=.95,T0e=.4,R0e=[.19,1,.22,1],Ww=0,I0e=1,O0e=0,M0e=0,N0e=0,JF=({position:t,viewport:e,boundsLeft:n=0})=>{const r=n+Xh,s=Math.max(r,e.width-x1-Xh),i=Math.max(Xh,e.height-x1-Xh);return{x:Math.min(s,Math.max(r,t.x)),y:Math.min(i,Math.max(Xh,t.y))}},p6=()=>({width:window.innerWidth,height:window.innerHeight}),L0e=({position:t,boundsLeftPx:e=0})=>JF({position:t,viewport:p6(),boundsLeft:e}),D0e=()=>{if(typeof window>"u")return{x:Ag,y:Ag};const t=p6();return{x:t.width-x1-Ag,y:t.height-x1-Ag}},$0e=({deltaX:t,deltaY:e})=>Math.hypot(t,e)>=k0e,j0e=t=>t.button===void 0||t.button<=N0e,E4=t=>{const e=t.nativeEvent;return{x:Number.isFinite(t.clientX)?t.clientX:e.clientX,y:Number.isFinite(t.clientY)?t.clientY:e.clientY}},F0e=({isVisible:t,isPanelOpen:e,isReducedMotion:n,position:r,dragBoundsLeftPx:s=0,onToggle:i,onPositionChange:o})=>{const l=g.useRef(null),c=g.useRef(!1),[d,f]=g.useState(!1),[h,m]=g.useState(!1),v=n?!1:{opacity:Ww,scale:k4,x:S4},_=n?{opacity:Ww}:{opacity:Ww,scale:k4,x:S4},y=n?{duration:M0e}:{duration:E0e,ease:C0e,scale:{duration:T0e,ease:R0e}},w=g.useCallback(()=>{const T=l.current;T&&(c.current=T.hasMoved),l.current=null,f(!1)},[]),x=g.useCallback(T=>{const O=l.current;if(!O)return;const I=E4(T),R=I.x-O.startPointer.x,N=I.y-O.startPointer.y,L=O.hasMoved||$0e({deltaX:R,deltaY:N});l.current={...O,hasMoved:L},L&&o(JF({position:{x:O.startPosition.x+R,y:O.startPosition.y+N},viewport:p6(),boundsLeft:s}))},[o,s]),k=g.useCallback(T=>{if(l.current||!j0e(T))return;const O=E4(T);l.current={startPointer:O,startPosition:r,hasMoved:!1},f(!0)},[r]),P=g.useCallback(()=>{if(c.current){c.current=!1;return}i()},[i]),C=e?"Close panel":"Open panel";return S.jsxs(S.Fragment,{children:[d?S.jsx("div",{className:"fixed inset-0 z-40 cursor-grabbing","data-cy":"rivet-panel-launcher-drag-surface",onPointerMove:x,onPointerUp:w,onPointerCancel:w,onMouseMove:x,onMouseUp:w}):null,S.jsx(Si,{children:t?S.jsx(Vu,{label:C,side:"top",forceOpen:h&&!d?void 0:!1,children:S.jsx(Co.button,{type:"button","aria-label":C,"data-cy":"reopen-panel",onMouseEnter:()=>m(!0),onMouseLeave:()=>m(!1),initial:v,animate:{opacity:I0e,scale:P0e,x:O0e},whileTap:{scale:A0e},exit:_,transition:y,onPointerDown:k,onMouseDown:k,onPointerMove:x,onPointerUp:w,onPointerCancel:w,onMouseMove:x,onMouseUp:w,onClick:P,className:`bg-main absolute z-50 flex h-11 w-11 touch-none select-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)] transition-[background-color,box-shadow] duration-150 hover:bg-[#2a2a2a] focus:outline-none focus-visible:ring-2 focus-visible:ring-white/75 ${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:S.jsx("img",{src:S0e,alt:"","aria-hidden":"true",draggable:!1,className:"h-4 w-4 brightness-0 invert"})})}):null})]})},qw=oi("useConfig"),z0e=300*1e3,V0e=1800*1e3,H0e=60*1e3,U0e=300*1e3,B0e=()=>{var t;return typeof window>"u"?null:((t=window.__RIVET_BOOTSTRAP__)==null?void 0:t.queueAccessToken)??null},Z0e=()=>{var t;return typeof window>"u"?null:((t=window.__RIVET_BOOTSTRAP__)==null?void 0:t.agentApplyMode)??null},W0e=Fe({featureFlags:bk(se(),Fe({isEnabled:Ys()})).optional()}),q0e=async()=>{const t=await Ft("/api/feature-flags");if(!t.ok)throw new Error(`Failed to fetch feature flags: ${t.statusText}`);return W0e.parse(await t.json())},G0e=t=>({...pj,...t??{}}),K0e=()=>{const t=_t(lS),e=Lt(lS),n=Lt(Sj),r=Lt(kj),s=Lt(ly),i=Lt(Pfe),o=Lt(Efe),l=Lt(kfe),c=Lt(ay),d=Lt(Sfe),f=Lt(xj),h=g.useCallback(x=>{o(x.agentModeAvailable),f(x.projectId??null),d({name:x.name??null,email:x.email??null}),x.isMCPSession&&n(!0),x.mcpEditor&&r(x.mcpEditor),s(x.agentApplyMode??Z0e()??null),i(x.queueAccessToken??B0e())},[s,o,n,r,i,f,d]),m=aa({queryKey:Qs.rivetConfig,queryFn:Hj,staleTime:z0e,gcTime:V0e}),v=aa({queryKey:Qs.featureFlags,queryFn:q0e,staleTime:H0e,gcTime:U0e}),{refetch:_}=m,{refetch:y}=v;g.useLayoutEffect(()=>{m.data&&(h(m.data),c(!1),qw.info("Config loaded:",m.data)),v.data&&(e(G0e(v.data.featureFlags)),l(!0)),m.error&&(l(!0),c(!1),qw.warn("Failed to load config:",m.error.message)),v.error&&(l(!0),qw.warn("Failed to load feature flags:",v.error.message))},[m.data,m.error,v.data,v.error,h,c,e,l]);const w=g.useCallback(async()=>{const[x]=await Promise.all([_(),y()]);return x.data?x.data:null},[_,y]);return{config:m.data??null,featureFlags:t,loading:m.isPending||!m.error&&v.isPending,error:m.error?m.error.message:null,refetchConfig:w}},Od=oi("useOAuthCallback"),Y0e=()=>{const[t,e]=g.useState({isProcessing:!1,isComplete:!1,error:null});return g.useEffect(()=>{const n=new AbortController;let r=!1;return(async()=>{var l,c,d;const i=window.location.hash,o=window.location.search;if(!(!i||!i.includes("access_token"))&&!r){e({isProcessing:!0,isComplete:!1,error:null});try{Od.info("Processing OAuth callback...");const f=new URLSearchParams(i.substring(1)),h=f.get("access_token"),m=f.get("refresh_token"),_=new URLSearchParams(o).get("session");if(!h)throw new Error("No access token found in URL");if(!_)throw new Error("No session ID found in URL");Od.info(`Completing OAuth with session: ${_}`);const y=await fetch(`${fS}/api/auth/google/complete`,{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({sessionId:_,accessToken:h,refreshToken:m}),signal:n.signal}),w=await y.json();if(!y.ok||!w.success)throw new Error(w.error||w.message||"Failed to complete authentication");if(Od.info("OAuth authentication completed successfully"),r)return;if(FN({userId:(l=w.user)==null?void 0:l.id,email:(c=w.user)==null?void 0:c.email}),(d=w.user)!=null&&d.email&&h)try{const k=await Ft("/api/auth/store",{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({email:w.user.email,token:h,refreshToken:m,userId:w.user.id}),signal:n.signal});k.ok||Od.warn(`Local auth store returned ${k.status}`)}catch(k){if(r)return;Od.warn("Failed to store auth locally:",k)}if(r)return;window.sessionStorage.setItem(f1,"1");const x=window.location.pathname;window.history.replaceState({},document.title,x),e({isProcessing:!1,isComplete:!0,error:null})}catch(f){if(r)return;Od.warn("OAuth callback error:",f),e({isProcessing:!1,isComplete:!1,error:Ks(f,"Unknown error occurred")})}}})(),()=>{r=!0,n.abort()}},[]),t},X0e=3e3,Q0e=(t,e=Ft)=>{const n=new AbortController;let r;const s={onmessage:null,onerror:null,close:()=>{n.abort(),clearTimeout(r)}},i=async()=>{var l,c,d;let o=!1;try{const f=await e(t,{signal:n.signal,headers:{Accept:"text/event-stream"}});if(o=f.status===401||f.status===403,!f.ok||!f.body)throw await((l=f.body)==null?void 0:l.cancel()),new Error(`Event stream request failed (${f.status}).`);const h=f.body.getReader(),m=new TextDecoder;let v="",_=[];try{for(;!n.signal.aborted;){const y=await h.read();if(y.done)break;v+=m.decode(y.value,{stream:!0});let w=v.indexOf(`
|
|
214
|
-
`);for(;w!==-1;){const x=v.slice(0,w).replace(/\r$/,"");v=v.slice(w+1),x===""?(_.length>0&&!n.signal.aborted&&((c=s.onmessage)==null||c.call(s,{data:_.join(`
|
|
215
|
-
`)})),_=[]):x.startsWith("data:")&&_.push(x.slice(5).replace(/^ /,"")),w=v.indexOf(`
|
|
216
|
-
`)}}}finally{await h.cancel().catch(()=>{}),h.releaseLock()}}catch(f){n.signal.aborted||(d=s.onerror)==null||d.call(s,f)}!n.signal.aborted&&!o&&(r=setTimeout(()=>void i(),X0e))};return i(),s},Gw=oi("useAgentVariantsSession"),J0e=({enabled:t=!0}={})=>{const e=Lt(Fm),n=Lt(wj),r=Lt(mj),s=Lt(bj),i=g.useRef(null);g.useEffect(()=>{if(n(!1),!t)return;const o=Q0e("/api/variants/events");return o.onmessage=l=>{try{const c=JSON.parse(l.data),d=i.current;if(c.active){const h=new Set(c.variants.map(m=>m.requestId).filter(m=>!!m));s(m=>m.filter(_=>!h.has(_.requestId))),c.sessionId!==i.current&&(i.current=c.sessionId,r(!0))}else i.current=null;e(c),n(!0),c.active&&c.sessionId!==d&&Ft(`/api/variants/${c.sessionId}/preview-port`,{method:"POST",headers:{"content-type":"application/json"},body:JSON.stringify({variantId:null})}).catch(h=>Gw.warn("failed to reset preview-port on session switch",h))}catch(c){Gw.warn("failed to parse SSE event payload",c)}},o.onerror=l=>{Gw.warn("SSE error (auto-reconnects)",l)},()=>{o.close()}},[t,e,n,r,s])};var ege=Object.defineProperty,Rr=(t,e)=>ege(t,"name",{value:e,configurable:!0});function e7(t){const e=t+"CollectionProvider",[n,r]=fa(e),[s,i]=n(e,{collectionRef:{current:null},itemMap:new Map}),o=Rr(y=>{const{scope:w,children:x}=y,k=g.useRef(null),P=g.useRef(new Map).current;return S.jsx(s,{scope:w,itemMap:P,collectionRef:k,children:x})},"CollectionProvider");o.displayName=e;const l=t+"CollectionSlot",c=pc(l),d=g.forwardRef((y,w)=>{const{scope:x,children:k}=y,P=i(l,x),C=yn(w,P.collectionRef);return S.jsx(c,{ref:C,children:k})});d.displayName=l;const f=t+"CollectionItemSlot",h="data-radix-collection-item",m=pc(f),v=g.forwardRef((y,w)=>{const{scope:x,children:k,...P}=y,C=g.useRef(null),T=yn(w,C),O=i(f,x);return g.useEffect(()=>(O.itemMap.set(C,{ref:C,...P}),()=>void O.itemMap.delete(C))),S.jsx(m,{[h]:"",ref:T,children:k})});v.displayName=f;function _(y){const w=i(t+"CollectionConsumer",y);return g.useCallback(()=>{const k=w.collectionRef.current;if(!k)return[];const P=Array.from(k.querySelectorAll(`[${h}]`));return Array.from(w.itemMap.values()).sort((O,I)=>P.indexOf(O.ref.current)-P.indexOf(I.ref.current))},[w.collectionRef,w.itemMap])}return Rr(_,"useCollection"),[{Provider:o,Slot:d,ItemSlot:v},_,r]}Rr(e7,"createCollection");var C4=new WeakMap,ar,pi,Tg=(pi=class extends Map{constructor(n){super(n);st(this,ar);Me(this,ar,[...super.keys()]),C4.set(this,!0)}set(n,r){return C4.get(this)&&!this.has(n)&&W(this,ar).push(n),super.set(n,r),this}insert(n,r,s){const i=this.has(r),o=i?this.size:this.size+1,l=m6(n),c=l>=0?Math.min(l,o-1):Math.max(o+l,0);if(i?W(this,ar).indexOf(r)===c:c===this.size)return this.set(r,s),this;const d=W(this,ar).filter(h=>h!==r);d.splice(c,0,r);const f=d.map(h=>[h,h===r?s:this.get(h)]);this.clear();for(const[h,m]of f)this.set(h,m);return this}with(n,r,s){const i=new pi(this);return i.insert(n,r,s),i}before(n){const r=W(this,ar).indexOf(n)-1;if(!(r<0))return this.entryAt(r)}setBefore(n,r,s){const i=W(this,ar).indexOf(n);if(i===-1)return this;const o=W(this,ar).indexOf(r),l=o!==-1&&o<i?i-1:i;return this.insert(l,r,s)}after(n){let r=W(this,ar).indexOf(n);if(r=r===-1||r===this.size-1?-1:r+1,r!==-1)return this.entryAt(r)}setAfter(n,r,s){const i=W(this,ar).indexOf(n);if(i===-1)return this;const o=W(this,ar).indexOf(r),l=o!==-1&&o<=i?i:i+1;return this.insert(l,r,s)}first(){return this.entryAt(0)}last(){return this.entryAt(-1)}clear(){return Me(this,ar,[]),super.clear()}delete(n){const r=super.delete(n);return r&&W(this,ar).splice(W(this,ar).indexOf(n),1),r}deleteAt(n){const r=this.keyAt(n);return r!==void 0?this.delete(r):!1}at(n){const r=cv(W(this,ar),n);if(r!==void 0)return this.get(r)}entryAt(n){const r=cv(W(this,ar),n);if(r!==void 0)return[r,this.get(r)]}indexOf(n){return W(this,ar).indexOf(n)}keyAt(n){return cv(W(this,ar),n)}from(n,r){const s=this.indexOf(n);if(s===-1)return;let i=s+r;return i<0&&(i=0),i>=this.size&&(i=this.size-1),this.at(i)}keyFrom(n,r){const s=this.indexOf(n);if(s===-1)return;let i=s+r;return i<0&&(i=0),i>=this.size&&(i=this.size-1),this.keyAt(i)}find(n,r){let s=0;for(const i of this){if(Reflect.apply(n,r,[i,s,this]))return i;s++}}findIndex(n,r){let s=0;for(const i of this){if(Reflect.apply(n,r,[i,s,this]))return s;s++}return-1}filter(n,r){const s=[];let i=0;for(const o of this)Reflect.apply(n,r,[o,i,this])&&s.push(o),i++;return new pi(s)}map(n,r){const s=[];let i=0;for(const o of this)s.push([o[0],Reflect.apply(n,r,[o,i,this])]),i++;return new pi(s)}reduce(...n){const[r,s]=n,i=n.length>1;if(!i&&this.size===0)throw new TypeError("Reduce of empty OrderedDict with no initial value");let o=0,l=s;for(const c of this)o===0&&!i?l=c:l=Reflect.apply(r,this,[l,c,o,this]),o++;return l}reduceRight(...n){const[r,s]=n,i=n.length>1;if(!i&&this.size===0)throw new TypeError("Reduce of empty OrderedDict with no initial value");let o=s;for(let l=this.size-1;l>=0;l--){const c=this.entryAt(l);l===this.size-1&&!i?o=c:o=Reflect.apply(r,this,[o,c,l,this])}return o}sort(n){if(typeof n!="function")throw new TypeError("OrderedDict.sort requires a compare function");const r=[...this.entries()].sort(n);this.clear();for(const[s,i]of r)this.set(s,i);return this}toSorted(n){if(typeof n!="function")throw new TypeError("OrderedDict.toSorted requires a compare function");const r=[...this.entries()].sort(n);return new pi(r)}toReversed(){const n=new pi;for(let r=this.size-1;r>=0;r--){const s=this.keyAt(r),i=this.get(s);n.set(s,i)}return n}toSpliced(...n){const r=[...this.entries()];return r.splice(...n),new pi(r)}slice(n,r){const s=new pi;for(const i of W(this,ar).slice(n,r))s.set(i,this.get(i));return s}every(n,r){let s=0;for(const i of this){if(!Reflect.apply(n,r,[i,s,this]))return!1;s++}return!0}some(n,r){let s=0;for(const i of this){if(Reflect.apply(n,r,[i,s,this]))return!0;s++}return!1}},ar=new WeakMap,Rr(pi,"OrderedDict"),pi);function cv(t,e){if("at"in Array.prototype)return Array.prototype.at.call(t,e);const n=t7(t,e);return n===-1?void 0:t[n]}Rr(cv,"at");function t7(t,e){const n=t.length,r=m6(e),s=r>=0?r:n+r;return s<0||s>=n?-1:s}Rr(t7,"toSafeIndex");function m6(t){return t!==t||t===0?0:Math.trunc(t)}Rr(m6,"toSafeInteger");function n7(t){const e=t+"CollectionProvider",[n,r]=fa(e),[s,i]=n(e);s.displayName=t+"CollectionStableContextProvider";const[o,l]=n(e);o.displayName=t+"CollectionStatefulContextProvider";const c=Rr(({state:O,...I})=>O?S.jsx(f,{...I,state:O}):S.jsx(d,{...I}),"CollectionProvider");c.displayName=e;const d=Rr(O=>{const I=k();return S.jsx(f,{...O,state:I})},"CollectionInit");d.displayName=t+"CollectionInit";const f=Rr(O=>{const{scope:I,children:R,state:N}=O,L=g.useRef(null),[z,$]=g.useState(null),G=yn(L,$),[X,q]=N,H=g.useRef(new Tg),ee=g.useCallback(()=>{const V=H.current;return i7(V)||V.sort(uv),V},[]);return g.useEffect(()=>{if(!z)return;const V=o7(()=>{q(Q=>{const U=Q.toSorted(uv);return U.some(([K],de)=>Q.keyAt(de)!==K)?U:Q})});return V.observe(z,{childList:!0,subtree:!0}),()=>{V.disconnect()}},[z,q]),S.jsx(s,{scope:I,collectionElementRef:G,collectionElementRefObject:L,getCollection:ee,setCollection:q,registryRef:H,children:S.jsx(o,{scope:I,collectionElement:z,collection:X,children:R})})},"CollectionProviderImpl");f.displayName=t+"CollectionProviderImpl";const h=t+"CollectionSlot",m=pc(h),v=g.forwardRef((O,I)=>{const{scope:R,children:N}=O,L=i(h,R),z=yn(I,L.collectionElementRef);return S.jsx(m,{ref:z,children:N})});v.displayName=h;const _=t+"CollectionItemSlot",y="data-radix-collection-item",w=pc(_),x=g.forwardRef((O,I)=>{const{scope:R,children:N,...L}=O,z=g.useRef(null),$=i(_,R),{setCollection:G,registryRef:X}=$,q=g.useRef(L);r7(q.current,L)||(q.current=L);const H=q.current,ee=g.useCallback(U=>{const D=X.current;U?D.set(U,{...q.current,element:U}):z.current&&D.delete(z.current)},[X]),V=yn(I,ee,z);xs(()=>{const U=z.current,D=X.current;U&&D.has(U)&&D.set(U,{...H,element:U})},[H,X]);const Q=g.useRef(null);return g.useEffect(()=>{const U=z.current,D=Q.current;((D==null?void 0:D.element)??null)===U&&(!U||(D==null?void 0:D.itemData)===H)||(Q.current=U?{element:U,itemData:H}:null,G(K=>{const de=new Tg(K);return D&&D.element!==U&&de.delete(D.element),U&&de.set(U,{...H,element:U}),de.sort(uv)}))}),g.useEffect(()=>()=>{const U=Q.current;Q.current=null,U&&G(D=>{if(!D.has(U.element))return D;const K=new Tg(D);return K.delete(U.element),K})},[G]),S.jsx(w,{[y]:"",ref:V,children:N})});x.displayName=_;function k(){return g.useState(new Tg)}Rr(k,"useInitCollection");function P(O){const{collection:I}=l(t+"CollectionConsumer",O);return I}Rr(P,"useCollection");function C(O){const{getCollection:I}=i(t+"CollectionConsumer",O);return I}return Rr(C,"useGetCollection"),[{Provider:c,Slot:v,ItemSlot:x},{createCollectionScope:r,useCollection:P,useGetCollection:C,useInitCollection:k}]}Rr(n7,"createCollection");function r7(t,e){if(t===e)return!0;if(typeof t!="object"||typeof e!="object"||t==null||e==null)return!1;const n=Object.keys(t),r=Object.keys(e);if(n.length!==r.length)return!1;for(const s of n)if(!Object.prototype.hasOwnProperty.call(e,s)||t[s]!==e[s])return!1;return!0}Rr(r7,"shallowEqual");function s7(t,e){return!!(e.compareDocumentPosition(t)&Node.DOCUMENT_POSITION_PRECEDING)}Rr(s7,"isElementPreceding");function i7(t){let e;for(const n of t.keys()){if(e){const r=e.compareDocumentPosition(n);if(!(r&Node.DOCUMENT_POSITION_DISCONNECTED)&&r&Node.DOCUMENT_POSITION_PRECEDING)return!1}e=n}return!0}Rr(i7,"isInDocumentOrder");function uv(t,e){return!t[1].element||!e[1].element?0:s7(t[1].element,e[1].element)?-1:1}Rr(uv,"sortByDocumentPosition");function o7(t){return new MutationObserver(n=>{for(const r of n)if(r.type==="childList"){t();return}})}Rr(o7,"getChildListObserver");var tge=Object.defineProperty,Hm=(t,e)=>tge(t,"name",{value:e,configurable:!0}),g6="Collapsible",[nge,a7]=fa(g6),[rge,v6]=nge(g6),sge=g.forwardRef(Hm(function(e,n){const{__scopeCollapsible:r,open:s,defaultOpen:i,disabled:o,onOpenChange:l,...c}=e,[d,f]=Cc({prop:s,defaultProp:i??!1,onChange:l,caller:g6});return S.jsx(rge,{scope:r,disabled:o,contentId:sa(),open:d,onOpenToggle:g.useCallback(()=>f(h=>!h),[f]),children:S.jsx(tr.div,{"data-state":hy(d),"data-disabled":o?"":void 0,...c,ref:n})})},"Collapsible")),ige="CollapsibleTrigger",oge=g.forwardRef(Hm(function(e,n){const{__scopeCollapsible:r,...s}=e,i=v6(ige,r);return S.jsx(tr.button,{type:"button","aria-controls":i.open?i.contentId:void 0,"aria-expanded":i.open||!1,"data-state":hy(i.open),"data-disabled":i.disabled?"":void 0,disabled:i.disabled,...s,ref:n,onClick:vn(e.onClick,i.onOpenToggle)})},"CollapsibleTrigger")),l7="CollapsibleContent",age=g.forwardRef(Hm(function(e,n){const{forceMount:r,...s}=e,i=v6(l7,e.__scopeCollapsible);return S.jsx(Ec,{present:r||i.open,children:({present:o})=>S.jsx(lge,{...s,ref:n,present:o})})},"CollapsibleContent")),lge=g.forwardRef(Hm(function(e,n){const{__scopeCollapsible:r,present:s,children:i,...o}=e,l=v6(l7,r),[c,d]=g.useState(s),f=g.useRef(null),h=yn(n,f),m=g.useRef(0),v=m.current,_=g.useRef(0),y=_.current,w=l.open||c,x=g.useRef(w),k=g.useRef(void 0);return g.useEffect(()=>{const P=requestAnimationFrame(()=>x.current=!1);return()=>cancelAnimationFrame(P)},[]),xs(()=>{const P=f.current;if(P){k.current=k.current||{transitionDuration:P.style.transitionDuration,animationName:P.style.animationName},P.style.transitionDuration="0s",P.style.animationName="none";const C=P.getBoundingClientRect();m.current=C.height,_.current=C.width,x.current||(P.style.transitionDuration=k.current.transitionDuration,P.style.animationName=k.current.animationName),d(s)}},[l.open,s]),S.jsx(tr.div,{"data-state":hy(l.open),"data-disabled":l.disabled?"":void 0,id:l.contentId,hidden:!w,...o,ref:h,style:{"--radix-collapsible-content-height":v?`${v}px`:void 0,"--radix-collapsible-content-width":y?`${y}px`:void 0,...e.style},children:w&&i})},"CollapsibleContentImpl"));function hy(t){return t?"open":"closed"}Hm(hy,"getState");var cge=Object.defineProperty,uge=(t,e)=>cge(t,"name",{value:e,configurable:!0}),dge={LTR:"ltr"},fge=g.createContext(void 0);function y6(t){const e=g.useContext(fge);return t||e||dge.LTR}uge(y6,"useDirection");var hge=Object.defineProperty,Ei=(t,e)=>hge(t,"name",{value:e,configurable:!0}),pge={Multiple:"multiple"},Qh={Vertical:"vertical",Horizontal:"horizontal"},mge={LTR:"ltr"},ha="Accordion",gge=["Home","End","ArrowDown","ArrowUp","ArrowLeft","ArrowRight"],[_6,{useGetCollection:vge,createCollectionScope:yge}]=n7(ha),[py,nye]=fa(ha,[yge,a7]),w6=a7(),c7=g.forwardRef(Ei(function(e,n){const{type:r,...s}=e,i=s,o=s;return S.jsx(_6.Provider,{scope:e.__scopeAccordion,children:r===pge.Multiple?S.jsx(xge,{...o,ref:n}):S.jsx(bge,{...i,ref:n})})},"Accordion")),[u7,_ge]=py(ha),[d7,wge]=py(ha,{collapsible:!1}),bge=g.forwardRef(Ei(function(e,n){const{value:r,defaultValue:s,onValueChange:i=Ei(()=>{},"onValueChange"),collapsible:o=!1,...l}=e,[c,d]=Cc({prop:r,defaultProp:s??"",onChange:i,caller:ha});return S.jsx(u7,{scope:e.__scopeAccordion,value:g.useMemo(()=>c?[c]:[],[c]),onItemOpen:d,onItemClose:g.useCallback(()=>o&&d(""),[o,d]),children:S.jsx(d7,{scope:e.__scopeAccordion,collapsible:o,children:S.jsx(f7,{...l,ref:n})})})},"AccordionImplSingle")),xge=g.forwardRef(Ei(function(e,n){const{value:r,defaultValue:s,onValueChange:i=Ei(()=>{},"onValueChange"),...o}=e,[l,c]=Cc({prop:r,defaultProp:s??[],onChange:i,caller:ha}),d=g.useCallback(h=>c((m=[])=>[...m,h]),[c]),f=g.useCallback(h=>c((m=[])=>m.filter(v=>v!==h)),[c]);return S.jsx(u7,{scope:e.__scopeAccordion,value:l,onItemOpen:d,onItemClose:f,children:S.jsx(d7,{scope:e.__scopeAccordion,collapsible:!0,children:S.jsx(f7,{...o,ref:n})})})},"AccordionImplMultiple")),[Sge,my]=py(ha),f7=g.forwardRef(Ei(function(e,n){const{__scopeAccordion:r,disabled:s,dir:i,orientation:o=Qh.Vertical,...l}=e,c=g.useRef(null),d=yn(c,n),f=vge(r),m=y6(i)===mge.LTR,v=vn(e.onKeyDown,_=>{var L;if(!gge.includes(_.key))return;const y=f(),w=_.target,x=y.filter(([,z])=>!z.element.disabled),k=x.findIndex(([,z])=>z.element===w),P=x.size;if(k===-1)return;_.preventDefault();let C=k;const T=0,O=P-1,I=Ei(()=>{C=k+1,C>O&&(C=T)},"moveNext"),R=Ei(()=>{C=k-1,C<T&&(C=O)},"movePrev");switch(_.key){case"Home":C=T;break;case"End":C=O;break;case"ArrowRight":o===Qh.Horizontal&&(m?I():R());break;case"ArrowDown":o===Qh.Vertical&&I();break;case"ArrowLeft":o===Qh.Horizontal&&(m?R():I());break;case"ArrowUp":o===Qh.Vertical&&R();break}const N=C%P;(L=x.at(N))==null||L.element.focus()});return S.jsx(Sge,{scope:r,disabled:s,direction:i,orientation:o,children:S.jsx(_6.Slot,{scope:r,children:S.jsx(tr.div,{...l,"data-orientation":o,ref:d,onKeyDown:s?void 0:v})})})},"AccordionImpl")),RS="AccordionItem",[kge,b6]=py(RS),Ege=g.forwardRef(Ei(function(e,n){const{__scopeAccordion:r,value:s,...i}=e,o=my(RS,r),l=_ge(RS,r),c=w6(r),d=sa(),f=s&&l.value.includes(s)||!1,h=o.disabled||e.disabled;return S.jsx(kge,{scope:r,open:f,disabled:h,triggerId:d,children:S.jsx(sge,{"data-orientation":o.orientation,"data-state":x6(f),...c,...i,ref:n,disabled:h,open:f,onOpenChange:m=>{m?l.onItemOpen(s):l.onItemClose(s)}})})},"AccordionItem")),Cge="AccordionHeader",Pge=g.forwardRef(Ei(function(e,n){const{__scopeAccordion:r,...s}=e,i=my(ha,r),o=b6(Cge,r);return S.jsx(tr.h3,{"data-orientation":i.orientation,"data-state":x6(o.open),"data-disabled":o.disabled?"":void 0,...s,ref:n})},"AccordionHeader")),P4="AccordionTrigger",Age=g.forwardRef(Ei(function(e,n){const{__scopeAccordion:r,...s}=e,i=my(ha,r),o=b6(P4,r),l=wge(P4,r),c=w6(r);return S.jsx(_6.ItemSlot,{scope:r,children:S.jsx(oge,{"aria-disabled":o.open&&!l.collapsible||void 0,"data-orientation":i.orientation,id:o.triggerId,...c,...s,ref:n})})},"AccordionTrigger")),Tge="AccordionContent",Rge=g.forwardRef(Ei(function(e,n){const{__scopeAccordion:r,...s}=e,i=my(ha,r),o=b6(Tge,r),l=w6(r);return S.jsx(age,{role:"region","aria-labelledby":o.triggerId,"data-orientation":i.orientation,...l,...s,ref:n,style:{"--radix-accordion-content-height":"var(--radix-collapsible-content-height)","--radix-accordion-content-width":"var(--radix-collapsible-content-width)",...e.style}})},"AccordionContent"));function x6(t){return t?"open":"closed"}Ei(x6,"getState");/**
|
|
217
|
-
* @license lucide-react v1.68.0 - ISC
|
|
218
|
-
*
|
|
219
|
-
* This source code is licensed under the ISC license.
|
|
220
|
-
* See the LICENSE file in the root directory of this source tree.
|
|
221
|
-
*/const Ige=t=>t==null?void 0:t.replace(/([a-z0-9])([A-Z])/g,"$1-$2").toLowerCase();/**
|
|
222
|
-
* @license lucide-react v1.68.0 - ISC
|
|
223
|
-
*
|
|
224
|
-
* This source code is licensed under the ISC license.
|
|
225
|
-
* See the LICENSE file in the root directory of this source tree.
|
|
226
|
-
*/function Oge(t,e,n=[]){if(e==null)throw new Error("[lucide]: iconNode is required when icon name is used");return{name:Ige(t),size:24,node:e,...n.length>0?{aliases:n}:{}}}/**
|
|
227
|
-
* @license lucide-react v1.68.0 - ISC
|
|
228
|
-
*
|
|
229
|
-
* This source code is licensed under the ISC license.
|
|
230
|
-
* See the LICENSE file in the root directory of this source tree.
|
|
231
|
-
*/const Mge=t=>{let e="",n=!1;for(const r of t){if(r==="-"||r==="_"||r<=" "){n=e.length>0;continue}e.length===0?e+=r.toLowerCase():e+=n?r.toUpperCase():r,n=!1}return e};/**
|
|
232
|
-
* @license lucide-react v1.68.0 - ISC
|
|
233
|
-
*
|
|
234
|
-
* This source code is licensed under the ISC license.
|
|
235
|
-
* See the LICENSE file in the root directory of this source tree.
|
|
236
|
-
*/const Nge=t=>{const e=Mge(t);return e.charAt(0).toUpperCase()+e.slice(1)};/**
|
|
237
|
-
* @license lucide-react v1.68.0 - ISC
|
|
238
|
-
*
|
|
239
|
-
* This source code is licensed under the ISC license.
|
|
240
|
-
* See the LICENSE file in the root directory of this source tree.
|
|
241
|
-
*/const IS=(...t)=>t.filter((e,n,r)=>!!e&&e.trim()!==""&&r.indexOf(e)===n).join(" ").trim();/**
|
|
242
|
-
* @license lucide-react v1.68.0 - ISC
|
|
243
|
-
*
|
|
244
|
-
* This source code is licensed under the ISC license.
|
|
245
|
-
* See the LICENSE file in the root directory of this source tree.
|
|
246
|
-
*/const nu={xmlns:"http://www.w3.org/2000/svg",width:24,height:24,viewBox:"0 0 24 24",fill:"none",stroke:"currentColor","stroke-width":2,"stroke-linecap":"round","stroke-linejoin":"round"};/**
|
|
247
|
-
* @license lucide-react v1.68.0 - ISC
|
|
248
|
-
*
|
|
249
|
-
* This source code is licensed under the ISC license.
|
|
250
|
-
* See the LICENSE file in the root directory of this source tree.
|
|
251
|
-
*/function Kw(t){return t!=null}function Lge(t,e={}){var m,v;const n=e.attributeNames??{},r=_=>n[_]??_,s=t.size??t.width??nu.width,i=t.size??t.height??nu.height,o=((m=t.aliases)==null?void 0:m.filter(_=>typeof _=="string"&&_.trim()!=="").map(_=>`lucide-${_}`))??[],l=[...t.name?[`lucide-${t.name}`]:[],...o],c=((v=e.className)==null?void 0:v.split(" ").filter(Boolean))??[],d=e.includeDefaultClasses===!1?IS(...c):IS("lucide",...l,...c),f=e.absoluteStrokeWidth?Number(e.strokeWidth??nu["stroke-width"])*Number(t.size??t.width??nu.width)/Number(e.size??e.width??nu.width):e.strokeWidth??nu["stroke-width"];return["svg",{...Object.entries(nu).reduce((_,[y,w])=>(_[r(y)]=w,_),{}),..."color"in e&&e.color&&{[r("stroke")]:e.color},..."size"in e&&Kw(e.size)&&{[r("width")]:e.size,[r("height")]:e.size},..."width"in e&&Kw(e.width)&&{[r("width")]:e.width},..."height"in e&&Kw(e.height)&&{[r("height")]:e.height},[r("stroke-width")]:f,...d&&{[r("class")]:d},[r("viewBox")]:`0 0 ${s} ${i}`,...e.hasA11yProp===!1?{[r("aria-hidden")]:"true"}:{},..."attributes"in e&&e.attributes},t.node.map(_=>{const[y,w,x]=_,k=e.nonScalingStroke?{[r("vector-effect")]:"non-scaling-stroke",...w}:w;return x?[y,k,x]:[y,k]})]}/**
|
|
252
|
-
* @license lucide-react v1.68.0 - ISC
|
|
253
|
-
*
|
|
254
|
-
* This source code is licensed under the ISC license.
|
|
255
|
-
* See the LICENSE file in the root directory of this source tree.
|
|
256
|
-
*/function Dge(t,e={}){return Lge(t,{...e,attributeNames:{...e.attributeNames,class:"className","stroke-width":"strokeWidth","stroke-linecap":"strokeLinecap","stroke-linejoin":"strokeLinejoin","vector-effect":"vectorEffect"}})}/**
|
|
257
|
-
* @license lucide-react v1.68.0 - ISC
|
|
258
|
-
*
|
|
259
|
-
* This source code is licensed under the ISC license.
|
|
260
|
-
* See the LICENSE file in the root directory of this source tree.
|
|
261
|
-
*/const $ge=t=>{for(const e in t)if(e.startsWith("aria-")||e==="role"||e==="title")return!0;return!1},jge=g.createContext({}),Fge=()=>g.useContext(jge),zge=g.forwardRef(({color:t,size:e,width:n,height:r,strokeWidth:s,absoluteStrokeWidth:i,nonScalingStroke:o,className:l="",children:c,iconNode:d=[],icon:f={node:d,aliases:[],size:24},...h},m)=>{const{size:v=24,strokeWidth:_=2,absoluteStrokeWidth:y=!1,nonScalingStroke:w=!1,color:x="currentColor",className:k=""}=Fge()??{},P=!!c||$ge(h),[C,T,O=[]]=Dge(f,{color:t??x,width:n??e??v,height:r??e??v,strokeWidth:s??_,absoluteStrokeWidth:i??y,nonScalingStroke:o??w,className:IS(k,l),hasA11yProp:P,attributes:h});return g.createElement(C,{ref:m,...T},[...O.map(([I,R])=>g.createElement(I,R)),...Array.isArray(c)?c:[c]])});/**
|
|
262
|
-
* @license lucide-react v1.68.0 - ISC
|
|
263
|
-
*
|
|
264
|
-
* This source code is licensed under the ISC license.
|
|
265
|
-
* See the LICENSE file in the root directory of this source tree.
|
|
266
|
-
*/function mt(t,e=[],n=[]){const r=typeof t=="string"?Oge(t,e,n):t,s=g.forwardRef(({className:i,...o},l)=>g.createElement(zge,{ref:l,icon:r,className:i,...o}));return r.name&&(s.displayName=Nge(r.name)),s}/**
|
|
267
|
-
* @license lucide-react v1.68.0 - ISC
|
|
268
|
-
*
|
|
269
|
-
* This source code is licensed under the ISC license.
|
|
270
|
-
* See the LICENSE file in the root directory of this source tree.
|
|
271
|
-
*/const h7={name:"arrow-left",size:24,node:[["path",{d:"m12 19-7-7 7-7",key:"1l729n"}],["path",{d:"M19 12H5",key:"x3x0zl"}]]};h7.node;const Vge=mt(h7);/**
|
|
272
|
-
* @license lucide-react v1.68.0 - ISC
|
|
273
|
-
*
|
|
274
|
-
* This source code is licensed under the ISC license.
|
|
275
|
-
* See the LICENSE file in the root directory of this source tree.
|
|
276
|
-
*/const p7={name:"arrow-right",size:24,node:[["path",{d:"M5 12h14",key:"1ays0h"}],["path",{d:"m12 5 7 7-7 7",key:"xquz4c"}]]};p7.node;const Hge=mt(p7);/**
|
|
277
|
-
* @license lucide-react v1.68.0 - ISC
|
|
278
|
-
*
|
|
279
|
-
* This source code is licensed under the ISC license.
|
|
280
|
-
* See the LICENSE file in the root directory of this source tree.
|
|
281
|
-
*/const m7={name:"arrow-up",size:24,node:[["path",{d:"m5 12 7-7 7 7",key:"hav0vg"}],["path",{d:"M12 19V5",key:"x0mq9r"}]]};m7.node;const Uge=mt(m7);/**
|
|
282
|
-
* @license lucide-react v1.68.0 - ISC
|
|
283
|
-
*
|
|
284
|
-
* This source code is licensed under the ISC license.
|
|
285
|
-
* See the LICENSE file in the root directory of this source tree.
|
|
286
|
-
*/const g7={name:"bell",size:24,node:[["path",{d:"M10.268 21a2 2 0 0 0 3.464 0",key:"vwvbt9"}],["path",{d:"M3.262 15.326A1 1 0 0 0 4 17h16a1 1 0 0 0 .74-1.673C19.41 13.956 18 12.499 18 8A6 6 0 0 0 6 8c0 4.499-1.411 5.956-2.738 7.326",key:"11g9vi"}]]};g7.node;const Bge=mt(g7);/**
|
|
287
|
-
* @license lucide-react v1.68.0 - ISC
|
|
288
|
-
*
|
|
289
|
-
* This source code is licensed under the ISC license.
|
|
290
|
-
* See the LICENSE file in the root directory of this source tree.
|
|
291
|
-
*/const v7={name:"brain",size:24,node:[["path",{d:"M12 18V5",key:"adv99a"}],["path",{d:"M15 13a4.17 4.17 0 01-3-4 4.17 4.17 0 01-3 4",key:"5nuw1p"}],["path",{d:"M17.707 6.294A3 3 0 1012 5a3 3 0 10-5.707 1.294",key:"18ldcf"}],["path",{d:"M17.996 5.125a4 4 0 012.526 5.77",key:"1sdu8q"}],["path",{d:"M18 18a4 4 0 002-7.465",key:"7xqqvr"}],["path",{d:"M19.967 17.482a4 4 0 11-7.967.517 4 4 0 11-7.967-.517",key:"t46ysz"}],["path",{d:"M6 18a4 4 0 01-2-7.465",key:"1y2m15"}],["path",{d:"M6.004 5.125a4 4 0 00-2.526 5.77",key:"3cw1ss"}]]};v7.node;const Zge=mt(v7);/**
|
|
292
|
-
* @license lucide-react v1.68.0 - ISC
|
|
293
|
-
*
|
|
294
|
-
* This source code is licensed under the ISC license.
|
|
295
|
-
* See the LICENSE file in the root directory of this source tree.
|
|
296
|
-
*/const y7={name:"check",size:24,node:[["path",{d:"M20 6 9 17l-5-5",key:"1gmf2c"}]]};y7.node;const Wge=mt(y7);/**
|
|
297
|
-
* @license lucide-react v1.68.0 - ISC
|
|
298
|
-
*
|
|
299
|
-
* This source code is licensed under the ISC license.
|
|
300
|
-
* See the LICENSE file in the root directory of this source tree.
|
|
301
|
-
*/const _7={name:"chevron-down",size:24,node:[["path",{d:"m6 9 6 6 6-6",key:"qrunsl"}]]};_7.node;const qge=mt(_7);/**
|
|
302
|
-
* @license lucide-react v1.68.0 - ISC
|
|
303
|
-
*
|
|
304
|
-
* This source code is licensed under the ISC license.
|
|
305
|
-
* See the LICENSE file in the root directory of this source tree.
|
|
306
|
-
*/const w7={name:"chevron-right",size:24,node:[["path",{d:"m9 18 6-6-6-6",key:"mthhwq"}]]};w7.node;const Gge=mt(w7);/**
|
|
307
|
-
* @license lucide-react v1.68.0 - ISC
|
|
308
|
-
*
|
|
309
|
-
* This source code is licensed under the ISC license.
|
|
310
|
-
* See the LICENSE file in the root directory of this source tree.
|
|
311
|
-
*/const b7={name:"circle",size:24,node:[["circle",{cx:"12",cy:"12",r:"10",key:"1mglay"}]]};b7.node;const Kge=mt(b7);/**
|
|
312
|
-
* @license lucide-react v1.68.0 - ISC
|
|
313
|
-
*
|
|
314
|
-
* This source code is licensed under the ISC license.
|
|
315
|
-
* See the LICENSE file in the root directory of this source tree.
|
|
316
|
-
*/const x7={name:"clock",size:24,node:[["circle",{cx:"12",cy:"12",r:"10",key:"1mglay"}],["path",{d:"M12 6v6l4 2",key:"mmk7yg"}]]};x7.node;const Yge=mt(x7);/**
|
|
317
|
-
* @license lucide-react v1.68.0 - ISC
|
|
318
|
-
*
|
|
319
|
-
* This source code is licensed under the ISC license.
|
|
320
|
-
* See the LICENSE file in the root directory of this source tree.
|
|
321
|
-
*/const S7={name:"copy",size:24,node:[["rect",{width:"14",height:"14",x:"8",y:"8",rx:"2",ry:"2",key:"17jyea"}],["path",{d:"M4 16c-1.1 0-2-.9-2-2V4c0-1.1.9-2 2-2h10c1.1 0 2 .9 2 2",key:"zix9uf"}]]};S7.node;const Xge=mt(S7);/**
|
|
322
|
-
* @license lucide-react v1.68.0 - ISC
|
|
323
|
-
*
|
|
324
|
-
* This source code is licensed under the ISC license.
|
|
325
|
-
* See the LICENSE file in the root directory of this source tree.
|
|
326
|
-
*/const k7={name:"dot",size:24,node:[["circle",{cx:"12",cy:"12",r:"1",key:"41hilf"}]]};k7.node;const Qge=mt(k7);/**
|
|
327
|
-
* @license lucide-react v1.68.0 - ISC
|
|
328
|
-
*
|
|
329
|
-
* This source code is licensed under the ISC license.
|
|
330
|
-
* See the LICENSE file in the root directory of this source tree.
|
|
331
|
-
*/const E7={name:"globe",size:24,node:[["circle",{cx:"12",cy:"12",r:"10",key:"1mglay"}],["path",{d:"M12 2a14.5 14.5 0 0 0 0 20 14.5 14.5 0 0 0 0-20",key:"13o1zl"}],["path",{d:"M2 12h20",key:"9i4pu4"}]]};E7.node;const Jge=mt(E7);/**
|
|
332
|
-
* @license lucide-react v1.68.0 - ISC
|
|
333
|
-
*
|
|
334
|
-
* This source code is licensed under the ISC license.
|
|
335
|
-
* See the LICENSE file in the root directory of this source tree.
|
|
336
|
-
*/const C7={name:"heart",size:24,node:[["path",{d:"M2 9.5a5.5 5.5 0 0 1 9.591-3.676.56.56 0 0 0 .818 0A5.49 5.49 0 0 1 22 9.5c0 2.29-1.5 4-3 5.5l-5.492 5.313a2 2 0 0 1-3 .019L5 15c-1.5-1.5-3-3.2-3-5.5",key:"mvr1a0"}]]};C7.node;const eve=mt(C7);/**
|
|
337
|
-
* @license lucide-react v1.68.0 - ISC
|
|
338
|
-
*
|
|
339
|
-
* This source code is licensed under the ISC license.
|
|
340
|
-
* See the LICENSE file in the root directory of this source tree.
|
|
341
|
-
*/const P7={name:"house",size:24,node:[["path",{d:"M15 21v-8a1 1 0 0 0-1-1h-4a1 1 0 0 0-1 1v8",key:"5wwlr5"}],["path",{d:"M3 10a2 2 0 0 1 .709-1.528l7-6a2 2 0 0 1 2.582 0l7 6A2 2 0 0 1 21 10v9a2 2 0 0 1-2 2H5a2 2 0 0 1-2-2z",key:"r6nss1"}]],aliases:["home"]};P7.node;const tve=mt(P7);/**
|
|
342
|
-
* @license lucide-react v1.68.0 - ISC
|
|
343
|
-
*
|
|
344
|
-
* This source code is licensed under the ISC license.
|
|
345
|
-
* See the LICENSE file in the root directory of this source tree.
|
|
346
|
-
*/const A7={name:"image",size:24,node:[["rect",{width:"18",height:"18",x:"3",y:"3",rx:"2",ry:"2",key:"1m3agn"}],["circle",{cx:"9",cy:"9",r:"2",key:"af1f0g"}],["path",{d:"m21 15-3.086-3.086a2 2 0 0 0-2.828 0L6 21",key:"1xmnt7"}]]};A7.node;const nve=mt(A7);/**
|
|
347
|
-
* @license lucide-react v1.68.0 - ISC
|
|
348
|
-
*
|
|
349
|
-
* This source code is licensed under the ISC license.
|
|
350
|
-
* See the LICENSE file in the root directory of this source tree.
|
|
351
|
-
*/const T7={name:"inbox",size:24,node:[["polyline",{points:"22 12 16 12 14 15 10 15 8 12 2 12",key:"o97t9d"}],["path",{d:"M5.45 5.11 2 12v6a2 2 0 0 0 2 2h16a2 2 0 0 0 2-2v-6l-3.45-6.89A2 2 0 0 0 16.76 4H7.24a2 2 0 0 0-1.79 1.11z",key:"oot6mr"}]]};T7.node;const rve=mt(T7);/**
|
|
352
|
-
* @license lucide-react v1.68.0 - ISC
|
|
353
|
-
*
|
|
354
|
-
* This source code is licensed under the ISC license.
|
|
355
|
-
* See the LICENSE file in the root directory of this source tree.
|
|
356
|
-
*/const R7={name:"lightbulb",size:24,node:[["path",{d:"M15 14c.2-1 .7-1.7 1.5-2.5 1-.9 1.5-2.2 1.5-3.5A6 6 0 0 0 6 8c0 1 .2 2.2 1.5 3.5.7.7 1.3 1.5 1.5 2.5",key:"1gvzjb"}],["path",{d:"M9 18h6",key:"x1upvd"}],["path",{d:"M10 22h4",key:"ceow96"}]]};R7.node;const sve=mt(R7);/**
|
|
357
|
-
* @license lucide-react v1.68.0 - ISC
|
|
358
|
-
*
|
|
359
|
-
* This source code is licensed under the ISC license.
|
|
360
|
-
* See the LICENSE file in the root directory of this source tree.
|
|
361
|
-
*/const I7={name:"link",size:24,node:[["path",{d:"M10 13a5 5 0 0 0 7.54.54l3-3a5 5 0 0 0-7.07-7.07l-1.72 1.71",key:"1cjeqo"}],["path",{d:"M14 11a5 5 0 0 0-7.54-.54l-3 3a5 5 0 0 0 7.07 7.07l1.71-1.71",key:"19qd67"}]]};I7.node;const ive=mt(I7);/**
|
|
362
|
-
* @license lucide-react v1.68.0 - ISC
|
|
363
|
-
*
|
|
364
|
-
* This source code is licensed under the ISC license.
|
|
365
|
-
* See the LICENSE file in the root directory of this source tree.
|
|
366
|
-
*/const O7={name:"loader",size:24,node:[["path",{d:"M12 2v4",key:"3427ic"}],["path",{d:"m16.2 7.8 2.9-2.9",key:"r700ao"}],["path",{d:"M18 12h4",key:"wj9ykh"}],["path",{d:"m16.2 16.2 2.9 2.9",key:"1bxg5t"}],["path",{d:"M12 18v4",key:"jadmvz"}],["path",{d:"m4.9 19.1 2.9-2.9",key:"bwix9q"}],["path",{d:"M2 12h4",key:"j09sii"}],["path",{d:"m4.9 4.9 2.9 2.9",key:"giyufr"}]]};O7.node;const ove=mt(O7);/**
|
|
367
|
-
* @license lucide-react v1.68.0 - ISC
|
|
368
|
-
*
|
|
369
|
-
* This source code is licensed under the ISC license.
|
|
370
|
-
* See the LICENSE file in the root directory of this source tree.
|
|
371
|
-
*/const M7={name:"lock",size:24,node:[["rect",{width:"18",height:"11",x:"3",y:"11",rx:"2",ry:"2",key:"1w4ew1"}],["path",{d:"M7 11V7a5 5 0 0 1 10 0v4",key:"fwvmzm"}]]};M7.node;const ave=mt(M7);/**
|
|
372
|
-
* @license lucide-react v1.68.0 - ISC
|
|
373
|
-
*
|
|
374
|
-
* This source code is licensed under the ISC license.
|
|
375
|
-
* See the LICENSE file in the root directory of this source tree.
|
|
376
|
-
*/const N7={name:"mail",size:24,node:[["path",{d:"m22 7-8.991 5.727a2 2 0 0 1-2.009 0L2 7",key:"132q7q"}],["rect",{x:"2",y:"4",width:"20",height:"16",rx:"2",key:"izxlao"}]]};N7.node;const lve=mt(N7);/**
|
|
377
|
-
* @license lucide-react v1.68.0 - ISC
|
|
378
|
-
*
|
|
379
|
-
* This source code is licensed under the ISC license.
|
|
380
|
-
* See the LICENSE file in the root directory of this source tree.
|
|
381
|
-
*/const L7={name:"menu",size:24,node:[["path",{d:"M4 5h16",key:"1tepv9"}],["path",{d:"M4 12h16",key:"1lakjw"}],["path",{d:"M4 19h16",key:"1djgab"}]]};L7.node;const cve=mt(L7);/**
|
|
382
|
-
* @license lucide-react v1.68.0 - ISC
|
|
383
|
-
*
|
|
384
|
-
* This source code is licensed under the ISC license.
|
|
385
|
-
* See the LICENSE file in the root directory of this source tree.
|
|
386
|
-
*/const D7={name:"message-circle",size:24,node:[["path",{d:"M2.992 16.342a2 2 0 0 1 .094 1.167l-1.065 3.29a1 1 0 0 0 1.236 1.168l3.413-.998a2 2 0 0 1 1.099.092 10 10 0 1 0-4.777-4.719",key:"1sd12s"}]]};D7.node;const uve=mt(D7);/**
|
|
387
|
-
* @license lucide-react v1.68.0 - ISC
|
|
388
|
-
*
|
|
389
|
-
* This source code is licensed under the ISC license.
|
|
390
|
-
* See the LICENSE file in the root directory of this source tree.
|
|
391
|
-
*/const $7={name:"monitor",size:24,node:[["rect",{width:"20",height:"14",x:"2",y:"3",rx:"2",key:"48i651"}],["line",{x1:"8",x2:"16",y1:"21",y2:"21",key:"1svkeh"}],["line",{x1:"12",x2:"12",y1:"17",y2:"21",key:"vw1qmm"}]]};$7.node;const dve=mt($7);/**
|
|
392
|
-
* @license lucide-react v1.68.0 - ISC
|
|
393
|
-
*
|
|
394
|
-
* This source code is licensed under the ISC license.
|
|
395
|
-
* See the LICENSE file in the root directory of this source tree.
|
|
396
|
-
*/const j7={name:"moon",size:24,node:[["path",{d:"M20.985 12.486a9 9 0 1 1-9.473-9.472c.405-.022.617.46.402.803a6 6 0 0 0 8.268 8.268c.344-.215.825-.004.803.401",key:"kfwtm"}]]};j7.node;const fve=mt(j7);/**
|
|
397
|
-
* @license lucide-react v1.68.0 - ISC
|
|
398
|
-
*
|
|
399
|
-
* This source code is licensed under the ISC license.
|
|
400
|
-
* See the LICENSE file in the root directory of this source tree.
|
|
401
|
-
*/const F7={name:"paintbrush",size:24,node:[["path",{d:"m14.622 17.897-10.68-2.913",key:"vj2p1u"}],["path",{d:"M18.376 2.622a1 1 0 1 1 3.002 3.002L17.36 9.643a.5.5 0 0 0 0 .707l.944.944a2.41 2.41 0 0 1 0 3.408l-.944.944a.5.5 0 0 1-.707 0L8.354 7.348a.5.5 0 0 1 0-.707l.944-.944a2.41 2.41 0 0 1 3.408 0l.944.944a.5.5 0 0 0 .707 0z",key:"18tc5c"}],["path",{d:"M9 8c-1.804 2.71-3.97 3.46-6.583 3.948a.507.507 0 0 0-.302.819l7.32 8.883a1 1 0 0 0 1.185.204C12.735 20.405 16 16.792 16 15",key:"ytzfxy"}]]};F7.node;const hve=mt(F7);/**
|
|
402
|
-
* @license lucide-react v1.68.0 - ISC
|
|
403
|
-
*
|
|
404
|
-
* This source code is licensed under the ISC license.
|
|
405
|
-
* See the LICENSE file in the root directory of this source tree.
|
|
406
|
-
*/const z7={name:"palette",size:24,node:[["path",{d:"M12 22a1 1 0 0 1 0-20 10 9 0 0 1 10 9 5 5 0 0 1-5 5h-2.25a1.75 1.75 0 0 0-1.4 2.8l.3.4a1.75 1.75 0 0 1-1.4 2.8z",key:"e79jfc"}],["circle",{cx:"13.5",cy:"6.5",r:".5",fill:"currentColor",key:"1okk4w"}],["circle",{cx:"17.5",cy:"10.5",r:".5",fill:"currentColor",key:"f64h9f"}],["circle",{cx:"6.5",cy:"12.5",r:".5",fill:"currentColor",key:"qy21gx"}],["circle",{cx:"8.5",cy:"7.5",r:".5",fill:"currentColor",key:"fotxhn"}]]};z7.node;const pve=mt(z7);/**
|
|
407
|
-
* @license lucide-react v1.68.0 - ISC
|
|
408
|
-
*
|
|
409
|
-
* This source code is licensed under the ISC license.
|
|
410
|
-
* See the LICENSE file in the root directory of this source tree.
|
|
411
|
-
*/const V7={name:"pause",size:24,node:[["rect",{x:"14",y:"3",width:"5",height:"18",rx:"1",key:"kaeet6"}],["rect",{x:"5",y:"3",width:"5",height:"18",rx:"1",key:"1wsw3u"}]]};V7.node;const mve=mt(V7);/**
|
|
412
|
-
* @license lucide-react v1.68.0 - ISC
|
|
413
|
-
*
|
|
414
|
-
* This source code is licensed under the ISC license.
|
|
415
|
-
* See the LICENSE file in the root directory of this source tree.
|
|
416
|
-
*/const H7={name:"pencil",size:24,node:[["path",{d:"M21.174 6.812a1 1 0 0 0-3.986-3.987L3.842 16.174a2 2 0 0 0-.5.83l-1.321 4.352a.5.5 0 0 0 .623.622l4.353-1.32a2 2 0 0 0 .83-.497z",key:"1a8usu"}],["path",{d:"m15 5 4 4",key:"1mk7zo"}]]};H7.node;const gve=mt(H7);/**
|
|
417
|
-
* @license lucide-react v1.68.0 - ISC
|
|
418
|
-
*
|
|
419
|
-
* This source code is licensed under the ISC license.
|
|
420
|
-
* See the LICENSE file in the root directory of this source tree.
|
|
421
|
-
*/const U7={name:"pipette",size:24,node:[["path",{d:"m12 9-8.414 8.414A2 2 0 0 0 3 18.828v1.344a2 2 0 0 1-.586 1.414A2 2 0 0 1 3.828 21h1.344a2 2 0 0 0 1.414-.586L15 12",key:"1y3wsu"}],["path",{d:"m18 9 .4.4a1 1 0 1 1-3 3l-3.8-3.8a1 1 0 1 1 3-3l.4.4 3.4-3.4a1 1 0 1 1 3 3z",key:"110lr1"}],["path",{d:"m2 22 .414-.414",key:"jhxm08"}]]};U7.node;const vve=mt(U7);/**
|
|
422
|
-
* @license lucide-react v1.68.0 - ISC
|
|
423
|
-
*
|
|
424
|
-
* This source code is licensed under the ISC license.
|
|
425
|
-
* See the LICENSE file in the root directory of this source tree.
|
|
426
|
-
*/const B7={name:"play",size:24,node:[["path",{d:"M5 5a2 2 0 0 1 3.008-1.728l11.997 6.998a2 2 0 0 1 .003 3.458l-12 7A2 2 0 0 1 5 19z",key:"10ikf1"}]]};B7.node;const yve=mt(B7);/**
|
|
427
|
-
* @license lucide-react v1.68.0 - ISC
|
|
428
|
-
*
|
|
429
|
-
* This source code is licensed under the ISC license.
|
|
430
|
-
* See the LICENSE file in the root directory of this source tree.
|
|
431
|
-
*/const Z7={name:"plus",size:24,node:[["path",{d:"M5 12h14",key:"1ays0h"}],["path",{d:"M12 5v14",key:"s699le"}]]};Z7.node;const _ve=mt(Z7);/**
|
|
432
|
-
* @license lucide-react v1.68.0 - ISC
|
|
433
|
-
*
|
|
434
|
-
* This source code is licensed under the ISC license.
|
|
435
|
-
* See the LICENSE file in the root directory of this source tree.
|
|
436
|
-
*/const W7={name:"rectangle-horizontal",size:24,node:[["rect",{width:"20",height:"12",x:"2",y:"6",rx:"2",key:"9lu3g6"}]]};W7.node;const wve=mt(W7);/**
|
|
437
|
-
* @license lucide-react v1.68.0 - ISC
|
|
438
|
-
*
|
|
439
|
-
* This source code is licensed under the ISC license.
|
|
440
|
-
* See the LICENSE file in the root directory of this source tree.
|
|
441
|
-
*/const q7={name:"rocket",size:24,node:[["path",{d:"M12 15v5s3.03-.55 4-2c1.08-1.62 0-5 0-5",key:"qeys4"}],["path",{d:"M4.5 16.5c-1.5 1.26-2 5-2 5s3.74-.5 5-2c.71-.84.7-2.13-.09-2.91a2.18 2.18 0 0 0-2.91-.09",key:"u4xsad"}],["path",{d:"M9 12a22 22 0 0 1 2-3.95A12.88 12.88 0 0 1 22 2c0 2.72-.78 7.5-6 11a22.4 22.4 0 0 1-4 2z",key:"676m9"}],["path",{d:"M9 12H4s.55-3.03 2-4c1.62-1.08 5 .05 5 .05",key:"92ym6u"}]]};q7.node;const bve=mt(q7);/**
|
|
442
|
-
* @license lucide-react v1.68.0 - ISC
|
|
443
|
-
*
|
|
444
|
-
* This source code is licensed under the ISC license.
|
|
445
|
-
* See the LICENSE file in the root directory of this source tree.
|
|
446
|
-
*/const G7={name:"rotate-ccw",size:24,node:[["path",{d:"M3 12a9 9 0 1 0 9-9 9.75 9.75 0 0 0-6.74 2.74L3 8",key:"1357e3"}],["path",{d:"M3 3v5h5",key:"1xhq8a"}]]};G7.node;const xve=mt(G7);/**
|
|
447
|
-
* @license lucide-react v1.68.0 - ISC
|
|
448
|
-
*
|
|
449
|
-
* This source code is licensed under the ISC license.
|
|
450
|
-
* See the LICENSE file in the root directory of this source tree.
|
|
451
|
-
*/const K7={name:"search",size:24,node:[["path",{d:"m21 21-4.34-4.34",key:"14j7rj"}],["circle",{cx:"11",cy:"11",r:"8",key:"4ej97u"}]]};K7.node;const Sve=mt(K7);/**
|
|
452
|
-
* @license lucide-react v1.68.0 - ISC
|
|
453
|
-
*
|
|
454
|
-
* This source code is licensed under the ISC license.
|
|
455
|
-
* See the LICENSE file in the root directory of this source tree.
|
|
456
|
-
*/const Y7={name:"settings",size:24,node:[["path",{d:"M9.671 4.136a2.34 2.34 0 0 1 4.659 0 2.34 2.34 0 0 0 3.319 1.915 2.34 2.34 0 0 1 2.33 4.033 2.34 2.34 0 0 0 0 3.831 2.34 2.34 0 0 1-2.33 4.033 2.34 2.34 0 0 0-3.319 1.915 2.34 2.34 0 0 1-4.659 0 2.34 2.34 0 0 0-3.32-1.915 2.34 2.34 0 0 1-2.33-4.033 2.34 2.34 0 0 0 0-3.831A2.34 2.34 0 0 1 6.35 6.051a2.34 2.34 0 0 0 3.319-1.915",key:"1i5ecw"}],["circle",{cx:"12",cy:"12",r:"3",key:"1v7zrd"}]]};Y7.node;const kve=mt(Y7);/**
|
|
457
|
-
* @license lucide-react v1.68.0 - ISC
|
|
458
|
-
*
|
|
459
|
-
* This source code is licensed under the ISC license.
|
|
460
|
-
* See the LICENSE file in the root directory of this source tree.
|
|
461
|
-
*/const X7={name:"shield",size:24,node:[["path",{d:"M20 13c0 5-3.5 7.5-7.66 8.95a1 1 0 0 1-.67-.01C7.5 20.5 4 18 4 13V6a1 1 0 0 1 1-1c2 0 4.5-1.2 6.24-2.72a1.17 1.17 0 0 1 1.52 0C14.51 3.81 17 5 19 5a1 1 0 0 1 1 1z",key:"oel41y"}]]};X7.node;const Eve=mt(X7);/**
|
|
462
|
-
* @license lucide-react v1.68.0 - ISC
|
|
463
|
-
*
|
|
464
|
-
* This source code is licensed under the ISC license.
|
|
465
|
-
* See the LICENSE file in the root directory of this source tree.
|
|
466
|
-
*/const Q7={name:"skip-forward",size:24,node:[["path",{d:"M21 4v16",key:"7j8fe9"}],["path",{d:"M6.029 4.285A2 2 0 0 0 3 6v12a2 2 0 0 0 3.029 1.715l9.997-5.998a2 2 0 0 0 .003-3.432z",key:"zs4d6"}]]};Q7.node;const Cve=mt(Q7);/**
|
|
467
|
-
* @license lucide-react v1.68.0 - ISC
|
|
468
|
-
*
|
|
469
|
-
* This source code is licensed under the ISC license.
|
|
470
|
-
* See the LICENSE file in the root directory of this source tree.
|
|
471
|
-
*/const J7={name:"square-library",size:24,node:[["rect",{width:"18",height:"18",x:"3",y:"3",rx:"2",key:"afitv7"}],["path",{d:"M7 7v10",key:"d5nglc"}],["path",{d:"M11 7v10",key:"pptsnr"}],["path",{d:"m15 7 2 10",key:"1m7qm5"}]],aliases:["library-square"]};J7.node;const Pve=mt(J7);/**
|
|
472
|
-
* @license lucide-react v1.68.0 - ISC
|
|
473
|
-
*
|
|
474
|
-
* This source code is licensed under the ISC license.
|
|
475
|
-
* See the LICENSE file in the root directory of this source tree.
|
|
476
|
-
*/const ez={name:"star",size:24,node:[["path",{d:"M11.525 2.295a.53.53 0 0 1 .95 0l2.31 4.679a2.123 2.123 0 0 0 1.595 1.16l5.166.756a.53.53 0 0 1 .294.904l-3.736 3.638a2.123 2.123 0 0 0-.611 1.878l.882 5.14a.53.53 0 0 1-.771.56l-4.618-2.428a2.122 2.122 0 0 0-1.973 0L6.396 21.01a.53.53 0 0 1-.77-.56l.881-5.139a2.122 2.122 0 0 0-.611-1.879L2.16 9.795a.53.53 0 0 1 .294-.906l5.165-.755a2.122 2.122 0 0 0 1.597-1.16z",key:"r04s7s"}]]};ez.node;const Ave=mt(ez);/**
|
|
477
|
-
* @license lucide-react v1.68.0 - ISC
|
|
478
|
-
*
|
|
479
|
-
* This source code is licensed under the ISC license.
|
|
480
|
-
* See the LICENSE file in the root directory of this source tree.
|
|
481
|
-
*/const tz={name:"sun",size:24,node:[["circle",{cx:"12",cy:"12",r:"4",key:"4exip2"}],["path",{d:"M12 2v2",key:"tus03m"}],["path",{d:"M12 20v2",key:"1lh1kg"}],["path",{d:"m4.93 4.93 1.41 1.41",key:"149t6j"}],["path",{d:"m17.66 17.66 1.41 1.41",key:"ptbguv"}],["path",{d:"M2 12h2",key:"1t8f8n"}],["path",{d:"M20 12h2",key:"1q8mjw"}],["path",{d:"m6.34 17.66-1.41 1.41",key:"1m8zz5"}],["path",{d:"m19.07 4.93-1.41 1.41",key:"1shlcs"}]]};tz.node;const Tve=mt(tz);/**
|
|
482
|
-
* @license lucide-react v1.68.0 - ISC
|
|
483
|
-
*
|
|
484
|
-
* This source code is licensed under the ISC license.
|
|
485
|
-
* See the LICENSE file in the root directory of this source tree.
|
|
486
|
-
*/const nz={name:"user",size:24,node:[["path",{d:"M19 21v-2a4 4 0 0 0-4-4H9a4 4 0 0 0-4 4v2",key:"975kel"}],["circle",{cx:"12",cy:"7",r:"4",key:"17ys0d"}]]};nz.node;const Rve=mt(nz);/**
|
|
487
|
-
* @license lucide-react v1.68.0 - ISC
|
|
488
|
-
*
|
|
489
|
-
* This source code is licensed under the ISC license.
|
|
490
|
-
* See the LICENSE file in the root directory of this source tree.
|
|
491
|
-
*/const rz={name:"users",size:24,node:[["path",{d:"M16 21v-2a4 4 0 0 0-4-4H6a4 4 0 0 0-4 4v2",key:"1yyitq"}],["path",{d:"M16 3.128a4 4 0 0 1 0 7.744",key:"16gr8j"}],["path",{d:"M22 21v-2a4 4 0 0 0-3-3.87",key:"kshegd"}],["circle",{cx:"9",cy:"7",r:"4",key:"nufk8"}]]};rz.node;const Ive=mt(rz);/**
|
|
492
|
-
* @license lucide-react v1.68.0 - ISC
|
|
493
|
-
*
|
|
494
|
-
* This source code is licensed under the ISC license.
|
|
495
|
-
* See the LICENSE file in the root directory of this source tree.
|
|
496
|
-
*/const sz={name:"x",size:24,node:[["path",{d:"M18 6 6 18",key:"1bl5f8"}],["path",{d:"m6 6 12 12",key:"d8bk6v"}]]};sz.node;const Ove=mt(sz),Mve={"chevron-right":Gge,"chevron-down":qge,pipette:vve,x:Ove,copy:Xge,menu:cve,dot:Qge,monitor:dve,sun:Tve,moon:fve,"rectangle-horizontal":wve,circle:Kge,"square-library":Pve,clock:Yge,star:Ave,settings:kve,plus:_ve,"arrow-left":Vge,"arrow-right":Hge,"arrow-up":Uge,search:Sve,loader:ove,users:Ive,lock:ave,mail:lve,bell:Bge,shield:Eve,palette:pve,lightbulb:sve,rocket:bve,heart:eve,paintbrush:hve,brain:Zge,globe:Jge,user:Rve,image:nve,link:ive,check:Wge,"rotate-ccw":xve,play:yve,pause:mve,home:tve,"message-circle":uve,inbox:rve,pencil:gve,"skip-forward":Cve},A4={lucide:Mve},iz=g.createContext(null);function Nve(t){const e=g.useContext(iz);return e?A4[e.iconLibrary][t]:A4.lucide[t]}function Lve({children:t,defaultLibrary:e="lucide"}){const[n,r]=g.useState(e),s=g.useCallback(i=>{r(i)},[]);return S.jsx(iz.Provider,{value:{iconLibrary:n,setIconLibrary:s},children:t})}const oz=g.createContext(null);function S6(){return g.useContext(oz)}const az=g.createContext(null);function lz(){const t=g.useContext(az);if(!t)throw new Error("AccordionTrigger/AccordionContent must be used within an AccordionItem");return t}const Dve=g.forwardRef((t,e)=>{const{children:n,type:r="single",className:s,...i}=t,o=g.useRef(null),l=g.useRef(new Map),[c,d]=g.useState(new Map),{activeIndex:f,setActiveIndex:h,itemRects:m,sessionRef:v,handlers:_,registerItem:y,measureItems:w}=uj(o),x=g.useCallback((oe,re)=>{re?l.current.set(oe,re):l.current.delete(oe)},[]),k=g.useCallback(()=>{if(!o.current)return;const oe=new Map;l.current.forEach((re,Se)=>{oe.set(Se,{top:re.offsetTop,left:re.offsetLeft,width:re.offsetWidth,height:re.offsetHeight})}),d(oe)},[]),[P,C]=g.useState(()=>r==="single"?t.defaultValue??"":""),[T,O]=g.useState(()=>r==="multiple"?t.defaultValue??[]:[]),I=t.onValueChange,R=t.onValueChange,N=t.value,L=new Set(r==="multiple"?t.value??T:(()=>{const oe=t.value??P;return oe?[oe]:[]})()),z=g.useCallback(oe=>{const re=t;re.onValueChange?re.onValueChange(oe):C(oe)},[I]),$=g.useCallback(oe=>{const re=t;re.onValueChange?re.onValueChange(oe):O(oe)},[R]),G=g.useCallback(oe=>{if(r==="multiple"){const re=t.value??T;$(re.filter(Se=>Se!==oe))}else z("")},[r,z,$,T,N]);g.useEffect(()=>{w(),k()},[w,k,n]);const X=[...L].join(",");g.useEffect(()=>{w(),k()},[w,k,X]);const[q,H]=g.useState(null),ee=f!==null?m[f]:null,V=q!==null?m[q]:null,Q=f!==null&&!c.has(f),U=Dm(),{value:D,defaultValue:K,onValueChange:de,collapsible:ie,type:ce,...he}=i,xe=r==="multiple"?{type:"multiple",value:t.value??T,onValueChange:$}:{type:"single",collapsible:t.collapsible??!0,value:t.value??P,onValueChange:z};return S.jsx(oz.Provider,{value:{registerItem:y,registerFullItem:x,activeIndex:f,grouped:!0,remeasure:()=>{w(),k()},openValues:L,openItemRects:c,toggleValue:G},children:S.jsx(c7,{...xe,asChild:!0,children:S.jsxs("div",{ref:oe=>{o.current=oe,typeof e=="function"?e(oe):e&&(e.current=oe)},onMouseEnter:_.onMouseEnter,onMouseMove:oe=>{const re=o.current;if(re){const Se=re.getBoundingClientRect(),ze=re.offsetHeight,ke=Se.height,gt=ze>0?ke/ze:1,on=(oe.clientY-Se.top)/gt+re.scrollTop;for(const[Tt,$t]of c){const xt=m[Tt];if(!xt)continue;const An=xt.top+xt.height,Be=$t.top+$t.height;if(on>=An&&on<=Be){h(null);return}}}_.onMouseMove(oe)},onMouseLeave:_.onMouseLeave,onFocus:oe=>{var Se;const re=(Se=oe.target.closest("[data-proximity-index]"))==null?void 0:Se.getAttribute("data-proximity-index");if(re!=null){const ze=Number(re);h(ze),H(oe.target.matches(":focus-visible")?ze:null)}},onBlur:oe=>{var re;(re=o.current)!=null&&re.contains(oe.relatedTarget)||(H(null),h(null))},className:pn("relative flex flex-col gap-0.5 w-72 max-w-full",s),...he,children:[S.jsx(Si,{children:[...c.entries()].map(([oe,re])=>S.jsx(qa.div,{className:`absolute ${U.bg} bg-accent/20 dark:bg-accent/12 pointer-events-none`,initial:!1,animate:{top:re.top,left:re.left,width:re.width,height:re.height,opacity:Q?.7:1},exit:{opacity:0,transition:{duration:.12}},transition:{top:{duration:0},left:{duration:0},width:{duration:0},height:{duration:0},opacity:{duration:.08}}},`expanded-${oe}`))}),S.jsx(Si,{children:ee&&S.jsx(qa.div,{className:`absolute ${U.bg} bg-hover pointer-events-none`,initial:{opacity:0,top:ee.top,left:ee.left,width:ee.width,height:ee.height},animate:{opacity:1,top:ee.top,left:ee.left,width:ee.width,height:ee.height},exit:{opacity:0,transition:{duration:.06}},transition:{...cm.fast,opacity:{duration:.08}}},v.current)}),S.jsx(Si,{children:V&&S.jsx(qa.div,{className:`absolute ${U.focusRing} pointer-events-none z-20 border border-[#6B97FF]`,initial:!1,animate:{left:V.left-2,top:V.top-2,width:V.width+4,height:V.height+4},exit:{opacity:0,transition:{duration:.06}},transition:{...cm.fast,opacity:{duration:.08}}})}),n]})})})});Dve.displayName="AccordionGroup";const cz=g.forwardRef(({children:t,type:e="single",collapsible:n=!0,defaultValue:r,value:s,onValueChange:i,className:o,...l},c)=>{const[d,f]=g.useState(()=>e==="single"?r??"":""),[h,m]=g.useState(()=>e==="multiple"?r??[]:[]),v=new Set(e==="multiple"?s??h:(()=>{const k=s??d;return k?[k]:[]})()),_=g.useCallback(k=>{i?i(k):f(k)},[i]),y=g.useCallback(k=>{i?i(k):m(k)},[i]),w=g.useCallback(k=>{e==="multiple"?y((s??h).filter(C=>C!==k)):_("")},[e,s,h,_,y]),x=e==="multiple"?{type:"multiple",value:s??h,defaultValue:r,onValueChange:y}:{type:"single",collapsible:n,value:s??d,defaultValue:r,onValueChange:_};return S.jsx(c7,{...x,asChild:!0,children:S.jsx("div",{ref:c,className:pn("w-72 max-w-full flex flex-col gap-0.5",o),...l,children:S.jsx(uz.Provider,{value:v,children:S.jsx(dz.Provider,{value:w,children:t})})})})});cz.displayName="Accordion";const uz=g.createContext(new Set),dz=g.createContext(()=>{}),fz=g.forwardRef(({value:t,index:e,disabled:n,children:r,className:s,...i},o)=>{const l=g.useRef(null),c=S6(),d=g.useContext(uz),f=g.useContext(dz),h=Dm(),m=c!=null&&c.grouped?c.openValues.has(t):d.has(t),v=g.useRef(null),_=g.useCallback(()=>{c!=null&&c.grouped?c.toggleValue(t):f(t)},[c,f,t]);return g.useEffect(()=>{if(c!=null&&c.grouped&&e!==void 0)return c.registerItem(e,v.current),()=>c.registerItem(e,null)},[e,c]),g.useEffect(()=>{if(c!=null&&c.grouped&&e!==void 0)return m?c.registerFullItem(e,l.current):c.registerFullItem(e,null),()=>c.registerFullItem(e,null)},[e,c,m]),S.jsx(az.Provider,{value:{index:e,value:t,isOpen:m,onToggle:_,triggerRef:v},children:S.jsxs(Ege,{ref:y=>{l.current=y,typeof o=="function"?o(y):o&&(o.current=y)},value:t,disabled:n,"data-proximity-index":e,className:pn(!(c!=null&&c.grouped)&&"relative",s),...i,children:[!(c!=null&&c.grouped)&&S.jsx(Si,{children:m&&S.jsx(qa.div,{className:`absolute inset-0 ${h.bg} bg-accent/20 dark:bg-accent/12 pointer-events-none`,initial:{opacity:0},animate:{opacity:1},exit:{opacity:0,transition:{duration:.06}},transition:{duration:.08}})}),r]})})});fz.displayName="AccordionItem";const hz=g.forwardRef(({children:t,className:e,...n},r)=>{const s=Nve("chevron-right"),i=S6(),{index:o,isOpen:l,triggerRef:c}=lz(),d=Dm(),[f,h]=g.useState(!1),m=i!=null&&i.grouped?i.activeIndex===o:f,v=S.jsx(Pge,{asChild:!0,children:S.jsx("div",{children:S.jsxs(Age,{ref:r,className:pn(`relative z-10 flex items-center gap-2.5 ${d.item} px-3 py-2 w-full cursor-pointer outline-none select-none`,!(i!=null&&i.grouped)&&"focus-visible:ring-1 focus-visible:ring-[#6B97FF] focus-visible:ring-offset-0",e),...n,children:[S.jsxs("span",{className:"inline-grid text-[13px] flex-1 text-left",children:[S.jsx("span",{className:"col-start-1 row-start-1 invisible",style:{fontVariationSettings:Op.semibold},"aria-hidden":"true",children:t}),S.jsx("span",{className:pn("col-start-1 row-start-1 transition-[color,font-variation-settings] duration-80",l||m?"text-foreground":"text-muted-foreground"),style:{fontVariationSettings:l?Op.semibold:Op.normal},children:t})]}),S.jsx(qa.span,{className:"shrink-0 inline-flex items-center justify-center",animate:{rotate:l?90:0},transition:cm.fast,children:S.jsx(s,{size:16,strokeWidth:l||m?2:1.5,className:pn("transition-[color,stroke-width] duration-80",l||m?"text-foreground":"text-muted-foreground")})})]})})});return i!=null&&i.grouped?S.jsx("div",{ref:c,children:v}):S.jsxs("div",{className:"relative",onMouseEnter:()=>h(!0),onMouseLeave:()=>h(!1),children:[S.jsx(Si,{children:f&&S.jsx(qa.div,{className:`absolute inset-0 ${d.bg} bg-hover pointer-events-none`,initial:{opacity:0},animate:{opacity:1},exit:{opacity:0,transition:{duration:.06}},transition:{duration:.08}})}),v]})});hz.displayName="AccordionTrigger";const pz=g.forwardRef(({children:t,className:e,...n},r)=>{const s=S6(),{isOpen:i}=lz();return S.jsx(Si,{initial:!1,children:i&&S.jsx(Rge,{forceMount:!0,asChild:!0,...n,children:S.jsx(qa.div,{ref:r,className:pn("overflow-hidden",e),initial:{height:0},animate:{height:"auto"},exit:{height:0},transition:{...cm.moderate,bounce:0},onUpdate:()=>{s==null||s.remeasure()},onAnimationComplete:()=>{s==null||s.remeasure()},children:S.jsx("div",{className:"px-3 pb-3 pt-1 text-[13px] text-muted-foreground",children:t})})})})});pz.displayName="AccordionContent";const dv=({children:t,defaultValue:e=[],className:n=""})=>S.jsx(cz,{type:"multiple",defaultValue:e,className:pn("w-full",n),children:t}),$ve=({value:t,title:e,description:n,dataCy:r,icon:s,children:i,className:o=""})=>{const l=o.includes("first-item");return S.jsxs(fz,{value:t,className:pn("w-full",!l&&"border-t border-main-border"),children:[S.jsxs(hz,{"data-cy":r,children:[s?S.jsx("span",{className:"mr-1 inline-flex items-center",children:s}):null,e]}),S.jsxs(pz,{children:[n?S.jsx("p",{className:"pb-2 text-sm text-content-subtle",children:n}):null,i]})]})};dv.Item=$ve;const jve=({message:t,isLoading:e=!0})=>S.jsxs("div",{className:"flex items-center gap-2 text-sm text-content",children:[e?S.jsx(U1,{className:"h-4 w-4 shrink-0 animate-spin text-primary",weight:"bold"}):null,S.jsx("span",{className:"whitespace-pre-wrap font-sans",children:t})]}),Fve=()=>{const t=g.useRef(Date.now()),[e,n]=g.useState(0);return g.useEffect(()=>{const r=()=>n(Math.max(0,Math.floor((Date.now()-t.current)/1e3)));r();const s=setInterval(r,1e3);return()=>clearInterval(s)},[]),e},zve=t=>{const e=Math.floor(t/60),n=t%60;return`${e}:${n.toString().padStart(2,"0")}`},T4="M 12 8 C 14.21 8 16 9.79 16 12 C 16 14.21 14.21 16 12 16 C 9.79 16 8 14.21 8 12 C 8 9.79 9.79 8 12 8 Z",R4="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",Vve="M 12 16 C 14.21 16 16 14.21 16 12 C 16 9.79 14.21 8 12 8 C 9.79 8 8 9.79 8 12 C 8 14.21 9.79 16 12 16 Z",fv=["Applying","Thinking","Planning","Crafting"],Hve=fv.reduce((t,e)=>t.length>=e.length?t:e),Uve=20,Bve="Still working — runs can take a few minutes.",Zve=({hint:t,showElapsed:e=!0})=>{const[n,r]=g.useState(0),s=Fve();g.useEffect(()=>{const o=setInterval(()=>{r(l=>(l+1)%fv.length)},4e3);return()=>clearInterval(o)},[]);const i=t??(e&&s>=Uve?Bve:null);return S.jsxs("div",{role:"status",className:"flex items-center gap-2 px-3 py-1","data-cy":"thinking-indicator",children:[S.jsx(Co.svg,{"aria-hidden":!0,width:20,height:20,viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:1.5,strokeLinecap:"round",strokeLinejoin:"round",className:"shrink-0 text-muted-foreground",children:S.jsx(Co.path,{animate:{d:[T4,R4,Vve,R4,T4]},transition:{d:{duration:6,ease:"easeInOut",repeat:1/0,times:[0,.25,.5,.75,1]}}})}),S.jsxs("span",{className:"inline-grid overflow-hidden text-sm font-medium",style:{fontVariationSettings:Op.medium},children:[S.jsx("span",{className:"shimmer-text invisible col-start-1 row-start-1","aria-hidden":"true",children:Hve}),S.jsx(Si,{mode:"popLayout",initial:!1,children:S.jsx(Co.span,{className:"shimmer-text col-start-1 row-start-1",initial:{y:"80%",opacity:0},animate:{y:0,opacity:1,transition:{duration:.24,ease:[.4,0,.2,1]}},exit:{y:"-80%",opacity:0,transition:{duration:.16,ease:[.4,0,.2,1]}},children:fv[n]},fv[n])})]}),e?S.jsx("span",{className:"text-xs tabular-nums text-content-subtle","data-cy":"thinking-elapsed",children:zve(s)}):null,i?S.jsx("span",{className:"text-xs text-content-subtle",children:i}):null]})};var Wve=Object.defineProperty,qve=(t,e)=>Wve(t,"name",{value:e,configurable:!0});function S1(t,[e,n]){return Math.min(n,Math.max(e,t))}qve(S1,"clamp");var Gve=Object.defineProperty,Yt=(t,e)=>Gve(t,"name",{value:e,configurable:!0}),I4={Horizontal:"horizontal"},Kve={LTR:"ltr"},mz=["PageUp","PageDown"],gz=["ArrowUp","ArrowDown","ArrowLeft","ArrowRight"],vz={"from-left":["Home","PageDown","ArrowDown","ArrowLeft"],"from-right":["Home","PageDown","ArrowDown","ArrowRight"],"from-bottom":["Home","PageDown","ArrowDown","ArrowLeft"],"from-top":["Home","PageDown","ArrowUp","ArrowLeft"]},Um="Slider",[OS,Yve,Xve]=e7(Um),[k6,rye]=fa(Um,[Xve]),[Qve,sh]=k6(Um),Jve=g.forwardRef(Yt(function(e,n){const{name:r,min:s=0,max:i=100,step:o=1,orientation:l=I4.Horizontal,disabled:c=!1,minStepsBetweenThumbs:d=0,preserveThumbOrder:f=!1,defaultValue:h=[s],value:m,onValueChange:v=Yt(()=>{},"onValueChange"),onValueCommit:_=Yt(()=>{},"onValueCommit"),inverted:y=!1,form:w,...x}=e,k=g.useRef(new Set),P=g.useRef(0),C=g.useRef(!1),[T,O]=g.useState(null),R=l===I4.Horizontal?e1e:t1e,[N,L]=g.useState(null),z=yn(n,L),[$=[],G]=Cc({prop:m,defaultProp:h,onChange:Yt(U=>{var K;(K=[...k.current][P.current])==null||K.focus({preventScroll:!0,focusVisible:C.current}),C.current=!1,v(U)},"onChange")}),X=g.useRef($),q=g.useRef($);g.useEffect(()=>{const U=w?N==null?void 0:N.ownerDocument.getElementById(w):N==null?void 0:N.closest("form");if(U instanceof HTMLFormElement){const D=Yt(()=>G(q.current),"reset");return U.addEventListener("reset",D),()=>U.removeEventListener("reset",D)}},[N,w,G]);function H(U){const D=Ez($,U);Q(U,D)}Yt(H,"handleSlideStart");function ee(U){Q(U,P.current)}Yt(ee,"handleSlideMove");function V(){String($)!==String(X.current)&&_($)}Yt(V,"handleSlideEnd");function Q(U,D,{commit:K}={commit:!1}){const de=C6(o),ie=$p(Math.round((U-s)/o)*o+s,de),ce=S1(ie,[s,i]),he=d*o;function xe(re){const Se=f?S1(ce,[re[D-1]===void 0?s:re[D-1]+he,re[D+1]===void 0?i:re[D+1]-he]):ce,ze=Sz(re,Se,D);return Az(ze,he)?{nextValues:ze,changedIndex:f?D:ze.indexOf(Se),hasChanged:String(ze)!==String(re)}:null}Yt(xe,"getNextValues");const oe=xe($);oe!=null&&oe.hasChanged&&O(oe.nextValues),G((re=[])=>{const Se=xe(re);return Se?(P.current=Se.changedIndex,Se.hasChanged&&K&&_(Se.nextValues),Se.hasChanged?Se.nextValues:re):re})}return Yt(Q,"updateValues"),S.jsx(Qve,{scope:e.__scopeSlider,name:r,disabled:c,min:s,max:i,valueIndexToChangeRef:P,thumbs:k.current,values:$,orientation:l,form:w,userRequestedValues:T,children:S.jsx(OS.Provider,{scope:e.__scopeSlider,children:S.jsx(OS.Slot,{scope:e.__scopeSlider,children:S.jsx(R,{"aria-disabled":c,"data-disabled":c?"":void 0,...x,ref:z,onPointerDown:vn(x.onPointerDown,()=>{c||(X.current=$,C.current=!1)}),min:s,max:i,inverted:y,onSlideStart:c?void 0:H,onSlideMove:c?void 0:ee,onSlideEnd:c?void 0:V,onHomeKeyDown:()=>{c||(C.current=!0,Q(s,0,{commit:!0}))},onEndKeyDown:()=>{c||(C.current=!0,Q(i,$.length-1,{commit:!0}))},onStepKeyDown:({event:U,direction:D})=>{if(!c){C.current=!0;const ie=mz.includes(U.key)||U.shiftKey&&gz.includes(U.key)?10:1,ce=P.current,he=$[ce],xe=Tz(he,{min:s,step:o,direction:D,multiplier:ie});Q(xe,ce,{commit:!0})}}})})})})},"Slider")),[yz,_z]=k6(Um,{startEdge:"left",endEdge:"right",size:"width",direction:1}),e1e=g.forwardRef(Yt(function(e,n){const{min:r,max:s,dir:i,inverted:o,onSlideStart:l,onSlideMove:c,onSlideEnd:d,onStepKeyDown:f,...h}=e,[m,v]=g.useState(null),_=yn(n,v),y=g.useRef(void 0),w=y6(i),x=w===Kve.LTR,k=x&&!o||!x&&o;function P(C){const T=y.current||m.getBoundingClientRect(),O=[0,T.width],R=gy(O,k?[r,s]:[s,r]);return y.current=T,R(C-T.left)}return Yt(P,"getValueFromPointer"),S.jsx(yz,{scope:e.__scopeSlider,startEdge:k?"left":"right",endEdge:k?"right":"left",direction:k?1:-1,size:"width",children:S.jsx(wz,{dir:w,"data-orientation":"horizontal",...h,ref:_,style:{...h.style,"--radix-slider-thumb-transform":"translateX(-50%)"},onSlideStart:C=>{const T=P(C.clientX);l==null||l(T)},onSlideMove:C=>{const T=P(C.clientX);c==null||c(T)},onSlideEnd:()=>{y.current=void 0,d==null||d()},onStepKeyDown:C=>{const O=vz[k?"from-left":"from-right"].includes(C.key);f==null||f({event:C,direction:O?-1:1})}})})},"SliderHorizontal")),t1e=g.forwardRef(Yt(function(e,n){const{min:r,max:s,inverted:i,onSlideStart:o,onSlideMove:l,onSlideEnd:c,onStepKeyDown:d,...f}=e,h=g.useRef(null),m=yn(n,h),v=g.useRef(void 0),_=!i;function y(w){const x=v.current||h.current.getBoundingClientRect(),k=[0,x.height],C=gy(k,_?[s,r]:[r,s]);return v.current=x,C(w-x.top)}return Yt(y,"getValueFromPointer"),S.jsx(yz,{scope:e.__scopeSlider,startEdge:_?"bottom":"top",endEdge:_?"top":"bottom",size:"height",direction:_?1:-1,children:S.jsx(wz,{"data-orientation":"vertical",...f,ref:m,style:{...f.style,"--radix-slider-thumb-transform":"translateY(50%)"},onSlideStart:w=>{const x=y(w.clientY);o==null||o(x)},onSlideMove:w=>{const x=y(w.clientY);l==null||l(x)},onSlideEnd:()=>{v.current=void 0,c==null||c()},onStepKeyDown:w=>{const k=vz[_?"from-bottom":"from-top"].includes(w.key);d==null||d({event:w,direction:k?-1:1})}})})},"SliderVertical")),wz=g.forwardRef(Yt(function(e,n){const{__scopeSlider:r,onSlideStart:s,onSlideMove:i,onSlideEnd:o,onHomeKeyDown:l,onEndKeyDown:c,onStepKeyDown:d,...f}=e,h=sh(Um,r);return S.jsx(tr.span,{...f,ref:n,onKeyDown:vn(e.onKeyDown,m=>{m.key==="Home"?(l(m),m.preventDefault()):m.key==="End"?(c(m),m.preventDefault()):mz.concat(gz).includes(m.key)&&(d(m),m.preventDefault())}),onPointerDown:vn(e.onPointerDown,m=>{const v=m.target;v.setPointerCapture(m.pointerId),m.preventDefault(),h.thumbs.has(v)?v.focus({preventScroll:!0,focusVisible:!1}):s(m)}),onPointerMove:vn(e.onPointerMove,m=>{m.target.hasPointerCapture(m.pointerId)&&i(m)}),onPointerUp:vn(e.onPointerUp,m=>{const v=m.target;v.hasPointerCapture(m.pointerId)&&(v.releasePointerCapture(m.pointerId),o(m))})})},"SliderImpl")),n1e="SliderTrack",r1e=g.forwardRef(Yt(function(e,n){const{__scopeSlider:r,...s}=e,i=sh(n1e,r);return S.jsx(tr.span,{"data-disabled":i.disabled?"":void 0,"data-orientation":i.orientation,...s,ref:n})},"SliderTrack")),O4="SliderRange",s1e=g.forwardRef(Yt(function(e,n){const{__scopeSlider:r,...s}=e,i=sh(O4,r),o=_z(O4,r),l=g.useRef(null),c=yn(n,l),d=i.values.length,f=i.values.map(v=>E6(v,i.min,i.max)),h=d>1?Math.min(...f):0,m=100-Math.max(...f);return S.jsx(tr.span,{"data-orientation":i.orientation,"data-disabled":i.disabled?"":void 0,...s,ref:c,style:{...e.style,[o.startEdge]:h+"%",[o.endEdge]:m+"%"}})},"SliderRange")),i1e="SliderThumb",[o1e,bz]=k6(i1e),a1e="SliderThumbProvider";function xz(t){const{__scopeSlider:e,name:n,children:r,internal_do_not_use_render:s}=t,i=sh(a1e,e),o=Yve(e),[l,c]=g.useState(null),d=g.useMemo(()=>l?o().findIndex(w=>w.ref.current===l):-1,[o,l]),f=PE(l),h=l?!!i.form||!!l.closest("form"):!0,m=i.values[d],v=n??(i.name?i.name+(i.values.length>1?"[]":""):void 0),_=m===void 0?0:E6(m,i.min,i.max);g.useEffect(()=>{if(l)return i.thumbs.add(l),()=>{i.thumbs.delete(l)}},[l,i.thumbs]);const y={value:m,name:v,form:i.form,isFormControl:h,index:d,thumb:l,onThumbChange:c,percent:_,size:f};return S.jsx(o1e,{scope:e,...y,children:Rz(s)?s(y):r})}Yt(xz,"SliderThumbProvider");var Yw="SliderThumbTrigger",l1e=g.forwardRef(Yt(function(e,n){const{__scopeSlider:r,...s}=e,i=sh(Yw,r),o=_z(Yw,r),{index:l,value:c,percent:d,size:f,onThumbChange:h}=bz(Yw,r),m=yn(n,h),v=kz(l,i.values.length),_=f==null?void 0:f[o.size],y=_?Cz(_,d,o.direction):0;return S.jsx("span",{style:{transform:"var(--radix-slider-thumb-transform)",position:"absolute",[o.startEdge]:`calc(${d}% + ${y}px)`},children:S.jsx(OS.ItemSlot,{scope:r,children:S.jsx(tr.span,{role:"slider","aria-label":e["aria-label"]||v,"aria-valuemin":i.min,"aria-valuenow":c,"aria-valuemax":i.max,"aria-orientation":i.orientation,"data-orientation":i.orientation,"data-disabled":i.disabled?"":void 0,tabIndex:i.disabled?void 0:0,...s,ref:m,style:c===void 0?{display:"none"}:e.style,onFocus:vn(e.onFocus,()=>{i.valueIndexToChangeRef.current=l})})})})},"SliderThumbTrigger")),c1e=g.forwardRef(Yt(function(e,n){const{__scopeSlider:r,name:s,...i}=e;return S.jsx(xz,{__scopeSlider:r,name:s,internal_do_not_use_render:({index:o,isFormControl:l})=>S.jsxs(S.Fragment,{children:[S.jsx(l1e,{...i,ref:n,__scopeSlider:r}),l?S.jsx(u1e,{__scopeSlider:r},o):null]})})},"SliderThumb")),M4="SliderBubbleInput",u1e=g.forwardRef(Yt(function({__scopeSlider:e,onInput:n,...r},s){const{index:i,value:o,name:l,form:c}=bz(M4,e),{userRequestedValues:d}=sh(M4,e),f=g.useRef(null),h=yn(f,s),m=g.useRef(!1),v=g.useRef(o),_=g.useRef(d),y=g.useRef(d);return g.useEffect(()=>{const w=f.current;if(!w)return;const x=window.HTMLInputElement.prototype,P=Object.getOwnPropertyDescriptor(x,"value").set,C=v.current,T=C!==o;v.current=o;const O=d!==y.current;if(y.current=d,T&&P){const I=d!==_.current;_.current=d;const R=d==null?void 0:d[i],N=I&&(O&&R!==C||R===o);m.current=!N;const L=new Event("input",{bubbles:!0});P.call(w,o),w.dispatchEvent(L),m.current=!1}},[i,o,d]),S.jsx(tr.input,{style:{display:"none"},name:l,form:c,...r,ref:h,defaultValue:o,onInput:vn(n,w=>{m.current&&w.stopPropagation()})})},"SliderBubbleInput"));function Sz(t=[],e,n){const r=[...t];return r[n]=e,r.sort((s,i)=>s-i)}Yt(Sz,"getNextSortedValues");function E6(t,e,n){const i=100/(n-e)*(t-e);return S1(i,[0,100])}Yt(E6,"convertValueToPercentage");function kz(t,e){return e>2?`Value ${t+1} of ${e}`:e===2?["Minimum","Maximum"][t]:void 0}Yt(kz,"getLabel");function Ez(t,e){if(t.length===1)return 0;const n=t.map(s=>Math.abs(s-e)),r=Math.min(...n);return n.indexOf(r)}Yt(Ez,"getClosestValueIndex");function Cz(t,e,n){const r=t/2,i=gy([0,50],[0,r]);return(r-i(e)*n)*n}Yt(Cz,"getThumbInBoundsOffset");function Pz(t){return t.slice(0,-1).map((e,n)=>t[n+1]-e)}Yt(Pz,"getStepsBetweenValues");function Az(t,e){if(e>0){const n=Pz(t);return Math.min(...n)>=e}return!0}Yt(Az,"hasMinStepsBetweenValues");function gy(t,e){return n=>{if(t[0]===t[1]||e[0]===e[1])return e[0];const r=(e[1]-e[0])/(t[1]-t[0]);return e[0]+r*(n-t[0])}}Yt(gy,"linearScale");function C6(t){if(!Number.isFinite(t))return 0;const e=t.toString();if(e.includes("e")){const[r,s]=e.split("e"),i=r.split(".")[1]||"",o=Number(s);return Math.max(0,i.length-o)}const n=e.split(".")[1];return n?n.length:0}Yt(C6,"getDecimalCount");function $p(t,e){const n=Math.pow(10,e);return Math.round(t*n)/n}Yt($p,"roundValue");function Tz(t,{min:e,step:n,direction:r,multiplier:s}){const i=C6(n),o=(t-e)/n,l=Math.round(o),c=$p(l*n+e,i)===$p(t,i);let d;return c?d=l+s*r:r>0?d=Math.ceil(o):d=Math.floor(o),$p(d*n+e,i)}Yt(Tz,"getNextStepValue");function Rz(t){return typeof t=="function"}Yt(Rz,"isFunction");const MS=g.forwardRef(({className:t,...e},n)=>S.jsxs(Jve,{ref:n,className:pn("relative flex w-full touch-none select-none items-center","data-[disabled]:opacity-50",t),...e,children:[S.jsx(r1e,{className:"relative h-1 w-full grow overflow-hidden rounded-full bg-input",children:S.jsx(s1e,{className:"absolute h-full bg-primary"})}),S.jsx(c1e,{className:pn("block h-3.5 w-3.5 rounded-full border border-border bg-foreground shadow-sm","transition-transform hover:scale-110 active:scale-95","focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-[#6B97FF]","disabled:pointer-events-none")})]}));MS.displayName="Slider";const d1e=[{name:"surface-1",utility:"bg-surface-1",className:"bg-surface-1"},{name:"surface-2",utility:"bg-surface-2",className:"bg-surface-2"},{name:"surface-3",utility:"bg-surface-3",className:"bg-surface-3"},{name:"surface-4",utility:"bg-surface-4",className:"bg-surface-4"},{name:"surface-5",utility:"bg-surface-5",className:"bg-surface-5"},{name:"surface-6",utility:"bg-surface-6",className:"bg-surface-6"}],f1e=[{name:"primary",utility:"bg-primary",className:"bg-primary"},{name:"selected",utility:"bg-selected",className:"bg-selected"},{name:"accent",utility:"bg-accent",className:"bg-accent"},{name:"success",utility:"bg-accent-success",className:"bg-accent-success"},{name:"warning",utility:"bg-accent-warning",className:"bg-accent-warning"},{name:"error",utility:"bg-accent-error",className:"bg-accent-error"}],h1e=[{name:"gap-1",className:"w-1"},{name:"gap-2",className:"w-2"},{name:"gap-3",className:"w-3"},{name:"gap-4",className:"w-4"},{name:"gap-6",className:"w-6"},{name:"gap-8",className:"w-8"}],Rg=[{name:"Accordion",path:"components/Accordion.tsx",status:"showcased",note:"Reusable primitive shown with local item composition."},{name:"AgentVariantsPanel",path:"components/AgentVariantsPanel.tsx",status:"feature-only",note:"Requires live variant session state and editor atoms."},{name:"AuthProgressScreen",path:"components/AuthProgressScreen.tsx",status:"feature-only",note:"Auth flow surface; represented through progress treatment."},{name:"AuthScreenView",path:"components/AuthScreenView.tsx",status:"feature-only",note:"Auth flow surface that depends on sign-in actions."},{name:"Button",path:"components/Button.tsx",status:"showcased",note:"Reusable tooltip-wrapped button shown in multiple states."},{name:"CommentCarouselLayer",path:"components/CommentCarouselLayer.tsx",status:"feature-only",note:"Preview overlay layer tied to iframe geometry."},{name:"ElementInspector",path:"components/ElementInspector.tsx",status:"feature-only",note:"Primary editor surface with many app-level dependencies."},{name:"GitHome",path:"components/GitHome.tsx",status:"feature-only",note:"Git dashboard tied to repository state."},{name:"IframePreview",path:"components/IframePreview.tsx",status:"unsuitable",note:"Needs live iframe target and cross-window integration."},{name:"PreviewFrame",path:"components/PreviewFrame.tsx",status:"unsuitable",note:"Requires proxied app URL and iframe lifecycle."},{name:"PreviewSurface",path:"components/PreviewSurface.tsx",status:"unsuitable",note:"Requires preview iframe and overlay orchestration."},{name:"ProfileAvatar",path:"components/ProfileAvatar.tsx",status:"feature-only",note:"Account chrome tied to user identity data."},{name:"Progress",path:"components/Progress.tsx",status:"showcased",note:"Reusable inline loading/status primitive."},{name:"SecondaryVariantIframe",path:"components/SecondaryVariantIframe.tsx",status:"unsuitable",note:"Requires variant preview iframe lifecycle."},{name:"SparkleLoader",path:"components/SparkleLoader.tsx",status:"showcased",note:"Reusable loading animation shown in feedback states."},{name:"SplitButton",path:"components/SplitButton.tsx",status:"showcased",note:"Reusable compound action button shown with dropdown."},{name:"StatusSurface",path:"components/StatusSurface.tsx",status:"showcased",note:"Unified full-surface primitive: LoadingSurface / EmptyState / ErrorState."},{name:"SupportTicketModal",path:"components/SupportTicketModal.tsx",status:"feature-only",note:"Support workflow modal tied to form submission."},{name:"ThinkingIndicator",path:"components/ThinkingIndicator.tsx",status:"showcased",note:"Reusable thinking/loading indicator shown in feedback states."},{name:"Tooltip",path:"components/Tooltip.tsx",status:"showcased",note:"Reusable tooltip API shown with hover target."},{name:"VariantDragGhost",path:"components/VariantDragGhost.tsx",status:"feature-only",note:"Drag visual tied to variant split interactions."},{name:"VariantSplitDropZones",path:"components/VariantSplitDropZones.tsx",status:"feature-only",note:"Drop-zone visual tied to variant split interactions."},{name:"ui/accordion",path:"components/ui/accordion.tsx",status:"showcased",note:"Radix accordion primitive backing the local Accordion showcase."},{name:"ui/slider",path:"components/ui/slider.tsx",status:"showcased",note:"Radix slider primitive shown in enabled and disabled states."},{name:"ui/tooltip",path:"components/ui/tooltip.tsx",status:"showcased",note:"Radix tooltip primitive shown with forced-open preview."}],p1e=()=>{window.location.hash=""},Ia=({title:t,eyebrow:e,description:n,children:r})=>S.jsxs("section",{className:"border-border bg-card shadow-surface-3 rounded-2xl border p-5",children:[S.jsxs("div",{className:"mb-5 max-w-2xl",children:[S.jsx("p",{className:"text-primary text-xs font-semibold tracking-[0.18em] uppercase",children:e}),S.jsx("h2",{className:"text-foreground mt-2 text-xl font-semibold",children:t}),S.jsx("p",{className:"text-muted-foreground mt-2 text-sm leading-6",children:n})]}),r]}),N4=({swatches:t})=>S.jsx("div",{className:"grid gap-3 sm:grid-cols-2 lg:grid-cols-3",children:t.map(e=>S.jsxs("div",{className:"border-border bg-surface-2 rounded-xl border p-3",children:[S.jsx("div",{className:`h-16 rounded-lg ${e.className}`}),S.jsxs("div",{className:"mt-3 flex items-center justify-between gap-3",children:[S.jsx("span",{className:"text-foreground text-sm font-medium",children:e.name}),S.jsx("code",{className:"bg-muted text-muted-foreground rounded px-2 py-1 text-xs",children:e.utility})]})]},e.name))}),m1e=t=>t==="showcased"?"border-accent-success/40 bg-accent-success/10 text-accent-success":t==="cataloged"?"border-primary/40 bg-primary/10 text-primary":t==="generated"?"border-accent/40 bg-accent/10 text-accent":t==="unsuitable"?"border-accent-warning/40 bg-accent-warning/10 text-accent-warning":"border-border bg-surface-4 text-content-muted",g1e=()=>{const t=Rg.filter(n=>n.status==="showcased").length,e=Rg.filter(n=>n.status==="cataloged").length;return S.jsx("main",{className:"bg-main font-main text-content h-screen overflow-y-auto",children:S.jsxs("div",{className:"mx-auto flex w-full max-w-6xl flex-col gap-6 px-6 py-6 lg:px-8",children:[S.jsxs("header",{className:"border-border bg-surface-2 shadow-surface-4 rounded-3xl border p-6",children:[S.jsxs("button",{type:"button",onClick:p1e,className:"text-content-subtle hover:text-content mb-6 inline-flex items-center gap-2 text-sm transition-colors",children:[S.jsx(Sae,{className:"h-4 w-4",weight:"bold"}),"Back to editor"]}),S.jsxs("div",{className:"flex flex-col gap-5 lg:flex-row lg:items-end lg:justify-between",children:[S.jsxs("div",{className:"max-w-3xl",children:[S.jsx("p",{className:"text-primary text-xs font-semibold tracking-[0.22em] uppercase",children:"Local component gallery"}),S.jsx("h1",{className:"text-foreground mt-3 text-4xl font-semibold tracking-tight",children:"Rivet design system"}),S.jsx("p",{className:"text-muted-foreground mt-3 text-base leading-7",children:"A Storybook-like route for checking the current UI primitives, tokens, and interaction states inside the Vite app."})]}),S.jsx("div",{className:"border-border bg-surface-3 rounded-2xl border p-4",children:S.jsxs("div",{className:"text-content-muted flex items-center gap-3 text-sm",children:[S.jsx(fD,{className:"text-primary h-5 w-5",weight:"bold"}),"Open with ",S.jsx("code",{className:"text-content",children:"#/design-system"})]})})]})]}),S.jsx(Ia,{eyebrow:"Controls",title:"Button, split button, and tooltip",description:"Rivet's shared Button exposes variants and sizes backed by Fluid Functionalism, alongside the split button and tooltip controls.",children:S.jsxs("div",{className:"grid gap-4 lg:grid-cols-[1fr_1fr]",children:[S.jsxs("div",{className:"border-border bg-surface-2 rounded-xl border p-4",children:[S.jsx("p",{className:"text-foreground mb-3 text-sm font-medium",children:"Rivet Button"}),S.jsxs("div",{className:"flex flex-wrap items-center gap-3",children:[S.jsx(ia,{title:"Primary action",shortcut:"D",variant:"primary",children:"Design action"}),S.jsx(ia,{title:"Secondary action",variant:"secondary",children:"Secondary"}),S.jsx(ia,{title:"Disabled action",disabled:!0,variant:"tertiary",children:"Disabled"}),S.jsx(Ej,{primaryLabel:"Ship",primaryIcon:pw,primaryAction:()=>{},dropdownItems:[{label:"Create PR",onClick:()=>{}},{label:"Copy branch",onClick:()=>{}}]})]})]}),S.jsxs("div",{className:"border-border bg-surface-2 rounded-xl border p-4",children:[S.jsx("p",{className:"text-foreground mb-3 text-sm font-medium",children:"Tooltip states"}),S.jsxs("div",{className:"flex flex-wrap items-center gap-4",children:[S.jsx(Vu,{label:"Rivet tooltip API",side:"bottom",children:S.jsx("button",{className:"border-border bg-surface-4 text-content rounded-lg border px-4 py-2 text-sm",children:"Hover target"})}),S.jsx(OE,{content:"Forced open preview",forceOpen:!0,side:"right",children:S.jsx("button",{className:"bg-selected text-content rounded-lg px-4 py-2 text-sm",children:"UI tooltip"})})]})]})]})}),S.jsx(Ia,{eyebrow:"Tokens",title:"Surface ladder",description:"Surface tokens move from the base app background toward raised panels without leaving the dark Rivet palette.",children:S.jsx(N4,{swatches:d1e})}),S.jsx(Ia,{eyebrow:"Tokens",title:"Color roles",description:"Named roles should communicate purpose: brand, selection, neutral accent, and outcome colors.",children:S.jsx(N4,{swatches:f1e})}),S.jsx(Ia,{eyebrow:"Type",title:"Typography",description:"Satoshi remains the default UI voice with clear hierarchy and muted support text.",children:S.jsxs("div",{className:"grid gap-4 lg:grid-cols-3",children:[S.jsxs("div",{className:"border-border bg-surface-2 rounded-xl border p-4",children:[S.jsx("p",{className:"text-primary text-xs tracking-[0.18em] uppercase",children:"Display"}),S.jsx("p",{className:"text-foreground mt-2 text-3xl font-semibold tracking-tight",children:"Visual edits, quickly"})]}),S.jsxs("div",{className:"border-border bg-surface-2 rounded-xl border p-4",children:[S.jsx("p",{className:"text-foreground text-sm font-semibold",children:"Panel heading"}),S.jsx("p",{className:"text-muted-foreground mt-2 text-sm leading-6",children:"Body copy uses compact line height and muted contrast for dense inspector panels."})]}),S.jsxs("div",{className:"border-border bg-surface-2 rounded-xl border p-4",children:[S.jsx("p",{className:"text-content-subtle text-xs font-medium tracking-[0.16em] uppercase",children:"Micro label"}),S.jsx("code",{className:"bg-muted text-muted-foreground mt-3 block rounded-lg px-3 py-2 text-xs",children:"font-main text-content"})]})]})}),S.jsx(Ia,{eyebrow:"Layout",title:"Spacing rhythm",description:"A compact spacing scale keeps editor chrome dense while preserving scannable groupings.",children:S.jsx("div",{className:"border-border bg-surface-2 rounded-xl border p-4",children:S.jsx("div",{className:"flex flex-col gap-3",children:h1e.map(n=>S.jsxs("div",{className:"flex items-center gap-4",children:[S.jsx("code",{className:"text-muted-foreground w-16 text-xs",children:n.name}),S.jsx("div",{className:`${n.className} bg-primary h-4 rounded`}),S.jsx("div",{className:"bg-border h-px flex-1"})]},n.name))})})}),S.jsx(Ia,{eyebrow:"Primitives",title:"Accordion and slider",description:"Representative Radix primitives styled through the local component layer.",children:S.jsxs("div",{className:"grid gap-4 lg:grid-cols-2",children:[S.jsxs(dv,{defaultValue:["foundations"],className:"border-border bg-surface-2 rounded-xl border p-2",children:[S.jsx(dv.Item,{value:"foundations",title:"Foundations",description:"Tokens, surfaces, type, and spacing.",className:"first-item",icon:S.jsx(pw,{className:"text-primary h-4 w-4"}),children:S.jsx("p",{children:"Use these pieces before adding one-off visual rules."})}),S.jsx(dv.Item,{value:"components",title:"Components",description:"Buttons, tooltips, accordions, sliders.",children:S.jsx("p",{children:"Keep states visible in this route as the system evolves."})})]}),S.jsxs("div",{className:"border-border bg-surface-2 rounded-xl border p-5",children:[S.jsx("p",{className:"text-foreground mb-5 text-sm font-medium",children:"Slider states"}),S.jsxs("div",{className:"space-y-6",children:[S.jsx(MS,{defaultValue:[64],max:100,step:1}),S.jsx(MS,{defaultValue:[36],max:100,step:1,disabled:!0})]})]})]})}),S.jsx(Ia,{eyebrow:"Feedback",title:"Motion and loading",description:"Loading states use existing CSS animation utilities and avoid per-frame React work where possible.",children:S.jsxs("div",{className:"grid gap-4 sm:grid-cols-3",children:[S.jsxs("div",{className:"border-border bg-surface-2 rounded-xl border p-4",children:[S.jsx("p",{className:"text-foreground mb-4 text-sm font-medium",children:"Progress"}),S.jsx(jve,{message:"Applying visual change..."})]}),S.jsxs("div",{className:"border-border bg-surface-2 rounded-xl border p-4",children:[S.jsx("p",{className:"text-foreground mb-4 text-sm font-medium",children:"Sparkle strip"}),S.jsx(BE,{className:"text-primary text-xl"})]}),S.jsxs("div",{className:"border-border bg-surface-2 rounded-xl border p-4",children:[S.jsx("p",{className:"text-foreground mb-4 text-sm font-medium",children:"Shimmer text"}),S.jsx("span",{className:"shimmer-text text-sm font-medium",children:"Generating variants"})]}),S.jsx("div",{className:"border-border bg-surface-2 rounded-xl border p-4 sm:col-span-3",children:S.jsx(Zve,{hint:"Reading selected elements"})})]})}),S.jsx(Ia,{eyebrow:"Feedback",title:"Status surfaces",description:"The unified full-surface system: one StatusSurface primitive with LoadingSurface / EmptyState / ErrorState wrappers. Every full-page loading, empty, and error state routes through these so they share layout, copy tone, and a single status_surface_shown impression event. Inline loaders (Sparkle, ThinkingIndicator, above) stay inline and are deliberately not part of this system.",children:S.jsxs("div",{className:"grid gap-4 sm:grid-cols-2",children:[S.jsx("div",{className:"border-border relative h-56 overflow-hidden rounded-xl border",children:S.jsx(gS,{fill:"surface",loader:"coalesce",trackGlobalLoaderCount:!1})}),S.jsx("div",{className:"border-border relative h-56 overflow-hidden rounded-xl border",children:S.jsx(nF,{icon:S.jsx(pw,{size:32}),title:"Nothing to preview yet",description:"Pick a direction from the panel."})}),S.jsx("div",{className:"border-border relative h-56 overflow-hidden rounded-xl border",children:S.jsx(KE,{fill:"surface",size:"sm",title:"Preview isn't connected",description:"Rivet lost connection to your project.",actions:[{label:"Reload",onClick:()=>{}}]})})]})}),S.jsxs(Ia,{eyebrow:"Inventory",title:"Component coverage",description:"Every current component file is accounted for here. Reusable primitives are rendered above; app surfaces that need live editor, git, auth, iframe, or generated state are cataloged instead of mounted unsafely.",children:[S.jsxs("div",{className:"mb-4 grid gap-3 sm:grid-cols-3",children:[S.jsxs("div",{className:"border-border bg-surface-2 rounded-xl border p-4",children:[S.jsx("p",{className:"text-content-subtle text-xs tracking-[0.16em] uppercase",children:"Total components"}),S.jsx("p",{className:"text-foreground mt-2 text-2xl font-semibold",children:Rg.length})]}),S.jsxs("div",{className:"border-border bg-surface-2 rounded-xl border p-4",children:[S.jsx("p",{className:"text-content-subtle text-xs tracking-[0.16em] uppercase",children:"Showcased"}),S.jsx("p",{className:"text-accent-success mt-2 text-2xl font-semibold",children:t})]}),S.jsxs("div",{className:"border-border bg-surface-2 rounded-xl border p-4",children:[S.jsx("p",{className:"text-content-subtle text-xs tracking-[0.16em] uppercase",children:"Cataloged"}),S.jsx("p",{className:"text-primary mt-2 text-2xl font-semibold",children:e})]})]}),S.jsxs("div",{className:"border-border overflow-hidden rounded-xl border",children:[S.jsxs("div",{className:"border-border bg-surface-3 text-content-subtle grid grid-cols-[minmax(140px,1fr)_minmax(110px,auto)_minmax(220px,2fr)] border-b px-4 py-3 text-xs font-semibold tracking-[0.14em] uppercase",children:[S.jsx("span",{children:"Component"}),S.jsx("span",{children:"Status"}),S.jsx("span",{children:"Coverage note"})]}),S.jsx("div",{className:"divide-border bg-surface-2 divide-y",children:Rg.map(n=>S.jsxs("div",{className:"grid grid-cols-[minmax(140px,1fr)_minmax(110px,auto)_minmax(220px,2fr)] gap-3 px-4 py-3 text-sm",children:[S.jsxs("div",{children:[S.jsx("p",{className:"text-foreground font-medium",children:n.name}),S.jsx("code",{className:"text-muted-foreground text-xs",children:n.path})]}),S.jsx("div",{children:S.jsx("span",{className:`inline-flex rounded-full border px-2 py-1 text-xs font-medium ${m1e(n.status)}`,children:n.status})}),S.jsx("p",{className:"text-muted-foreground",children:n.note})]},n.path))})]})]})]})})},v1e=t=>(t.startsWith("#/")?t.slice(2):t.slice(1)).split("?")[0]==="design-system"?"design-system":"editor",NS=274,k1=395,Xw=Math.min(k1,Math.round((NS+k1)/2*1.1)),L4="rivet:panelWidth:v2",y1e=({projectPath:t,libraryOrigin:e})=>{const n=_t(vj)>0,[r,s]=aL(mj),i=boe(),[o,l]=g.useState(()=>{if(typeof window>"u")return Xw;const T=Number(window.localStorage.getItem(L4));return Number.isFinite(T)&&T>=NS&&T<=k1?T:Xw}),[c,d]=g.useState(!1),[f,h]=g.useState(D0e),m=r?o:0,[v,_]=g.useState(r);g.useEffect(()=>{if(!r){_(!1);return}h(T=>L0e({position:T,boundsLeftPx:o}))},[r,o]),g.useEffect(()=>{window.localStorage.setItem(L4,String(o))},[o]),g.useEffect(()=>{if(!r)return;const T=O=>{O.key==="Escape"&&(eL(O.target)||(O.preventDefault(),s(!1)))};return window.addEventListener("keydown",T),()=>window.removeEventListener("keydown",T)},[r,s]);const y=g.useCallback(T=>{T.preventDefault(),T.stopPropagation();const O=T.clientX,I=o;d(!0);const R=L=>{const z=Math.min(k1,Math.max(NS,I+(L.clientX-O)));l(z)},N=()=>{window.removeEventListener("pointermove",R),window.removeEventListener("pointerup",N),window.removeEventListener("pointercancel",N),d(!1)};window.addEventListener("pointermove",R),window.addEventListener("pointerup",N),window.addEventListener("pointercancel",N)},[o]),w=g.useCallback(()=>l(Xw),[]),x=Y0e(),k=_t(ay);J0e({enabled:!k});const P=x.isProcessing?"Completing authentication...":null,C=Lt(oy);return g.useEffect(()=>{C(t??null)},[t,C]),S.jsxs(Co.div,{className:"relative flex h-screen overflow-hidden",initial:!1,animate:{opacity:1},transition:{duration:.5,ease:"easeOut"},"data-cy":"rivet-app",children:[P!==null?S.jsx("div",{className:"absolute inset-0 z-50",children:S.jsx(x0e,{message:P})}):null,S.jsx(Ype,{}),S.jsx(S.Fragment,{children:n?null:S.jsxs(S.Fragment,{children:[S.jsx("div",{className:"relative order-first h-full flex-shrink-0",style:{width:v?o:0},children:S.jsxs(Co.div,{className:"absolute inset-y-0 left-0 z-30",initial:!1,animate:{x:r?0:-o},transition:i?{duration:0}:{duration:.2,ease:[.22,1,.36,1]},onAnimationComplete:()=>{r&&_(!0)},style:{width:o,willChange:"transform"},children:[S.jsx(rpe,{onClose:()=>s(!1),libraryOrigin:e}),S.jsx("div",{role:"separator","aria-orientation":"vertical","aria-label":"Resize panel",onPointerDown:y,onDoubleClick:w,className:"group/resize absolute inset-y-0 right-0 z-20 flex w-3 cursor-col-resize touch-none justify-end",children:S.jsx("span",{className:`h-full transition-all duration-150 ${c?"bg-content-muted w-0.5":"bg-divider group-hover/resize:bg-content-muted w-px group-hover/resize:w-0.5"}`})})]})}),c&&S.jsx("div",{className:"fixed inset-0 z-[100] cursor-col-resize"}),S.jsx(F0e,{isVisible:!0,isPanelOpen:r,isReducedMotion:!!i,position:f,dragBoundsLeftPx:m,onPositionChange:h,onToggle:()=>s(T=>!T)})]})}),S.jsx(Xoe,{duration:5e3,richColors:!0,toastOptions:{style:{maxHeight:"150px",overflow:"hidden"}}})]})},LS="rivet_connect_deep_link",_1e=()=>{if(typeof window>"u")return null;const t=new URLSearchParams(window.location.search),e=t.get("connect"),n=e??window.sessionStorage.getItem(LS);if(n!=="pinterest"&&n!=="arena"&&n!=="x")return null;if(window.sessionStorage.setItem(LS,n),e){t.delete("connect");const r=t.toString();window.history.replaceState(null,document.title,window.location.pathname+(r?`?${r}`:"")+window.location.hash)}return n},w1e=_1e(),b1e=()=>{const[t,e]=g.useState(window.location.hash),[n]=g.useState(()=>typeof window<"u"&&window.sessionStorage.getItem(f1)==="1"),[r,s]=g.useState(!1),[i,o]=g.useState(w1e);g.useEffect(()=>{n&&window.sessionStorage.removeItem(f1)},[n]);const{config:l,refetchConfig:c,loading:d,error:f}=K0e(),h=Lt(ay),{startLogin:m,isStartingLogin:v,loginError:_}=Bj(),[y,w]=g.useState(!1);Wee(l??void 0),g.useEffect(()=>{l&&Qe.register({source:"visual_editor",surface:"visual_editor"})},[l]);const x=l!=null&&l.agentModeAvailable!==!0,k=v1e(t),P=g.useCallback(async()=>{w(!0),h(!0);try{await c()}finally{h(!1),w(!1)}},[c,h]);if(g.useEffect(()=>{const I=()=>{const R=window.location.hash;e(R)};return window.addEventListener("hashchange",I),()=>window.removeEventListener("hashchange",I)},[]),k==="design-system")return S.jsx(g1e,{});if(!d&&l===null&&!y){const I=f||"Could not load Rivet configuration.";return S.jsx("div",{className:"bg-main flex h-screen items-center justify-center px-6",children:S.jsxs("div",{className:"border-divider bg-main w-full max-w-md rounded-lg border p-6 text-center shadow-lg",children:[S.jsx("p",{className:"text-content text-sm font-medium",children:"We could not start Rivet yet."}),S.jsx("p",{className:"text-content-muted mt-2 text-xs",children:I}),S.jsx("button",{type:"button",className:"border-divider text-content hover:bg-main/80 mt-4 rounded-md border px-3 py-1.5 text-xs",onClick:()=>{P()},children:"Retry"})]})})}if(x)return S.jsx(w0e,{isSigningIn:v,onStartSignIn:()=>{m()},errorMessage:_,displayMode:"full"});const T=(l==null?void 0:l.agentModeAvailable)===!0&&i!==null,O=(l==null?void 0:l.agentModeAvailable)===!0&&n&&!r&&!T;return S.jsxs(S.Fragment,{children:[S.jsx(y1e,{projectPath:l==null?void 0:l.projectPath,libraryOrigin:(l==null?void 0:l.libraryOrigin)??null}),S.jsx(hS,{context:"onboarding",isOpen:O,onClose:()=>s(!0)}),S.jsx(hS,{context:"menu",isOpen:T,highlightProvider:i,onClose:()=>{window.sessionStorage.removeItem(LS),o(null)}})]})};vH();const x1e=g.lazy(()=>q4(()=>import("./LibraryEntry-RI9Lc7P3.js"),[])),P6=window.location.pathname.startsWith("/rivet/library");P6||Fee();const S1e=new uee,k1e=()=>S.jsx("div",{style:{display:"flex",height:"100vh",alignItems:"center",justifyContent:"center"},children:S.jsx("p",{style:{fontSize:"14px",color:"#6b7280"},children:"Something went wrong. Please reload the page."})}),Iz=document.getElementById("root");if(!Iz)throw new Error("Rivet root element is missing");const E1e=()=>Zee.createRoot(Iz).render(S.jsx(Ae.StrictMode,{children:S.jsx(Eee,{client:Qe,children:S.jsx(Iee,{fallback:S.jsx(k1e,{}),children:S.jsx(jJ,{client:S1e,children:S.jsx(jle,{defaultShape:"rounded",children:S.jsx(Lve,{defaultLibrary:"lucide",children:P6?S.jsx(g.Suspense,{fallback:S.jsx("div",{className:"bg-background h-screen"}),children:S.jsx(x1e,{})}):S.jsx(b1e,{})})})})})})})),C1e=async()=>{P6&&await TJ(),await $J(),E1e()};C1e();export{Sk as $,ry as A,ia as B,sy as C,J1 as D,R1e as E,nn as F,Ks as G,S0e as H,Lm as I,Sve as J,$N as K,aa as L,_D as M,Qs as N,Wge as O,jE as P,see as Q,Ip as R,Yf as S,Fe as T,T1e as U,A1e as V,At as W,Ove as X,Tm as Y,Ln as Z,se as _,dee as a,Ys as a0,J1e as a1,eye as a2,RJ as a3,uhe as a4,pn as a5,QN as a6,N1e as a7,M1e as a8,Wee as a9,G1e as aa,K1e as ab,Vge as ac,npe as ad,Xoe as ae,z1e as af,V1e as ag,nhe as ah,F1e as ai,D1e as aj,L1e as ak,O1e as al,I1e as am,$1e as an,j1e as ao,Z1e as ap,B1e as aq,H1e as ar,Bj as as,Ft as at,IN as au,AJ as av,PJ as aw,U1e as ax,pee as b,g as c,mee as d,yee as e,gee as f,Ms as g,_ee as h,wee as i,vee as j,mt as k,so as l,dj as m,Tr as n,S as o,Vx as p,FE as q,BN as r,Vg as s,zE as t,Rm as u,VE as v,gve as w,ey as x,ty as y,ny as z};
|
|
497
|
-
//# sourceMappingURL=main-DgrLzS5j.js.map
|