rivet-design 0.21.6 → 0.21.7
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/services/HistoryReplayService.js +1 -1
- package/package.json +1 -1
- package/src/ui/dist/assets/{LibraryEntry-CGTHi-gi.js → LibraryEntry-CcZDyWE6.js} +1 -1
- package/src/ui/dist/assets/main-D2BhjJwI.js +435 -0
- package/src/ui/dist/index.html +1 -1
- package/src/ui/dist/assets/main-C9MzoKvC.js +0 -435
|
@@ -0,0 +1,435 @@
|
|
|
1
|
+
var aj=Object.defineProperty;var h8=t=>{throw TypeError(t)};var lj=(t,e,n)=>e in t?aj(t,e,{enumerable:!0,configurable:!0,writable:!0,value:n}):t[e]=n;var wa=(t,e,n)=>lj(t,typeof e!="symbol"?e+"":e,n),ly=(t,e,n)=>e.has(t)||h8("Cannot "+n);var W=(t,e,n)=>(ly(t,e,"read from private field"),n?n.call(t):e.get(t)),tt=(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),Te=(t,e,n,r)=>(ly(t,e,"write to private field"),r?r.call(t,n):e.set(t,n),n),_t=(t,e,n)=>(ly(t,e,"access private method"),n);var m0=(t,e,n,r)=>({set _(s){Te(t,e,s,n)},get _(){return W(t,e,r)}});function cj(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 uj="modulepreload",dj=function(t){return"/"+t},p8={},aA=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]"),u=(l==null?void 0:l.nonce)||(l==null?void 0:l.getAttribute("nonce"));s=o(n.map(d=>{if(d=dj(d),d in p8)return;p8[d]=!0;const f=d.endsWith(".css"),h=f?'[rel="stylesheet"]':"";if(document.querySelector(`link[href="${d}"]${h}`))return;const g=document.createElement("link");if(g.rel=f?"stylesheet":uj,f||(g.as="script"),g.crossOrigin="",g.href=d,u&&g.setAttribute("nonce",u),document.head.appendChild(g),f)return new Promise((v,x)=>{g.addEventListener("load",v),g.addEventListener("error",()=>x(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 $g(t){return t&&t.__esModule&&Object.prototype.hasOwnProperty.call(t,"default")?t.default:t}var cy={exports:{}},gf={},uy={exports:{}},gt={};/**
|
|
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 m8;function fj(){if(m8)return gt;m8=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"),u=Symbol.for("react.suspense"),d=Symbol.for("react.memo"),f=Symbol.for("react.lazy"),h=Symbol.iterator;function g(N){return N===null||typeof N!="object"?null:(N=h&&N[h]||N["@@iterator"],typeof N=="function"?N:null)}var v={isMounted:function(){return!1},enqueueForceUpdate:function(){},enqueueReplaceState:function(){},enqueueSetState:function(){}},x=Object.assign,_={};function w(N,Y,ae){this.props=N,this.context=Y,this.refs=_,this.updater=ae||v}w.prototype.isReactComponent={},w.prototype.setState=function(N,Y){if(typeof N!="object"&&typeof N!="function"&&N!=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,N,Y,"setState")},w.prototype.forceUpdate=function(N){this.updater.enqueueForceUpdate(this,N,"forceUpdate")};function S(){}S.prototype=w.prototype;function k(N,Y,ae){this.props=N,this.context=Y,this.refs=_,this.updater=ae||v}var E=k.prototype=new S;E.constructor=k,x(E,w.prototype),E.isPureReactComponent=!0;var P=Array.isArray,T=Object.prototype.hasOwnProperty,I={current:null},M={key:!0,ref:!0,__self:!0,__source:!0};function R(N,Y,ae){var se,ie={},de=null,ge=null;if(Y!=null)for(se in Y.ref!==void 0&&(ge=Y.ref),Y.key!==void 0&&(de=""+Y.key),Y)T.call(Y,se)&&!M.hasOwnProperty(se)&&(ie[se]=Y[se]);var ue=arguments.length-2;if(ue===1)ie.children=ae;else if(1<ue){for(var re=Array(ue),Pe=0;Pe<ue;Pe++)re[Pe]=arguments[Pe+2];ie.children=re}if(N&&N.defaultProps)for(se in ue=N.defaultProps,ue)ie[se]===void 0&&(ie[se]=ue[se]);return{$$typeof:t,type:N,key:de,ref:ge,props:ie,_owner:I.current}}function O(N,Y){return{$$typeof:t,type:N.type,key:Y,ref:N.ref,props:N.props,_owner:N._owner}}function D(N){return typeof N=="object"&&N!==null&&N.$$typeof===t}function $(N){var Y={"=":"=0",":":"=2"};return"$"+N.replace(/[=:]/g,function(ae){return Y[ae]})}var V=/\/+/g;function q(N,Y){return typeof N=="object"&&N!==null&&N.key!=null?$(""+N.key):Y.toString(36)}function B(N,Y,ae,se,ie){var de=typeof N;(de==="undefined"||de==="boolean")&&(N=null);var ge=!1;if(N===null)ge=!0;else switch(de){case"string":case"number":ge=!0;break;case"object":switch(N.$$typeof){case t:case e:ge=!0}}if(ge)return ge=N,ie=ie(ge),N=se===""?"."+q(ge,0):se,P(ie)?(ae="",N!=null&&(ae=N.replace(V,"$&/")+"/"),B(ie,Y,ae,"",function(Pe){return Pe})):ie!=null&&(D(ie)&&(ie=O(ie,ae+(!ie.key||ge&&ge.key===ie.key?"":(""+ie.key).replace(V,"$&/")+"/")+N)),Y.push(ie)),1;if(ge=0,se=se===""?".":se+":",P(N))for(var ue=0;ue<N.length;ue++){de=N[ue];var re=se+q(de,ue);ge+=B(de,Y,ae,re,ie)}else if(re=g(N),typeof re=="function")for(N=re.call(N),ue=0;!(de=N.next()).done;)de=de.value,re=se+q(de,ue++),ge+=B(de,Y,ae,re,ie);else if(de==="object")throw Y=String(N),Error("Objects are not valid as a React child (found: "+(Y==="[object Object]"?"object with keys {"+Object.keys(N).join(", ")+"}":Y)+"). If you meant to render a collection of children, use an array instead.");return ge}function K(N,Y,ae){if(N==null)return N;var se=[],ie=0;return B(N,se,"","",function(de){return Y.call(ae,de,ie++)}),se}function z(N){if(N._status===-1){var Y=N._result;Y=Y(),Y.then(function(ae){(N._status===0||N._status===-1)&&(N._status=1,N._result=ae)},function(ae){(N._status===0||N._status===-1)&&(N._status=2,N._result=ae)}),N._status===-1&&(N._status=0,N._result=Y)}if(N._status===1)return N._result.default;throw N._result}var X={current:null},Z={transition:null},J={ReactCurrentDispatcher:X,ReactCurrentBatchConfig:Z,ReactCurrentOwner:I};function H(){throw Error("act(...) is not supported in production builds of React.")}return gt.Children={map:K,forEach:function(N,Y,ae){K(N,function(){Y.apply(this,arguments)},ae)},count:function(N){var Y=0;return K(N,function(){Y++}),Y},toArray:function(N){return K(N,function(Y){return Y})||[]},only:function(N){if(!D(N))throw Error("React.Children.only expected to receive a single React element child.");return N}},gt.Component=w,gt.Fragment=n,gt.Profiler=s,gt.PureComponent=k,gt.StrictMode=r,gt.Suspense=u,gt.__SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED=J,gt.act=H,gt.cloneElement=function(N,Y,ae){if(N==null)throw Error("React.cloneElement(...): The argument must be a React element, but you passed "+N+".");var se=x({},N.props),ie=N.key,de=N.ref,ge=N._owner;if(Y!=null){if(Y.ref!==void 0&&(de=Y.ref,ge=I.current),Y.key!==void 0&&(ie=""+Y.key),N.type&&N.type.defaultProps)var ue=N.type.defaultProps;for(re in Y)T.call(Y,re)&&!M.hasOwnProperty(re)&&(se[re]=Y[re]===void 0&&ue!==void 0?ue[re]:Y[re])}var re=arguments.length-2;if(re===1)se.children=ae;else if(1<re){ue=Array(re);for(var Pe=0;Pe<re;Pe++)ue[Pe]=arguments[Pe+2];se.children=ue}return{$$typeof:t,type:N.type,key:ie,ref:de,props:se,_owner:ge}},gt.createContext=function(N){return N={$$typeof:o,_currentValue:N,_currentValue2:N,_threadCount:0,Provider:null,Consumer:null,_defaultValue:null,_globalName:null},N.Provider={$$typeof:i,_context:N},N.Consumer=N},gt.createElement=R,gt.createFactory=function(N){var Y=R.bind(null,N);return Y.type=N,Y},gt.createRef=function(){return{current:null}},gt.forwardRef=function(N){return{$$typeof:l,render:N}},gt.isValidElement=D,gt.lazy=function(N){return{$$typeof:f,_payload:{_status:-1,_result:N},_init:z}},gt.memo=function(N,Y){return{$$typeof:d,type:N,compare:Y===void 0?null:Y}},gt.startTransition=function(N){var Y=Z.transition;Z.transition={};try{N()}finally{Z.transition=Y}},gt.unstable_act=H,gt.useCallback=function(N,Y){return X.current.useCallback(N,Y)},gt.useContext=function(N){return X.current.useContext(N)},gt.useDebugValue=function(){},gt.useDeferredValue=function(N){return X.current.useDeferredValue(N)},gt.useEffect=function(N,Y){return X.current.useEffect(N,Y)},gt.useId=function(){return X.current.useId()},gt.useImperativeHandle=function(N,Y,ae){return X.current.useImperativeHandle(N,Y,ae)},gt.useInsertionEffect=function(N,Y){return X.current.useInsertionEffect(N,Y)},gt.useLayoutEffect=function(N,Y){return X.current.useLayoutEffect(N,Y)},gt.useMemo=function(N,Y){return X.current.useMemo(N,Y)},gt.useReducer=function(N,Y,ae){return X.current.useReducer(N,Y,ae)},gt.useRef=function(N){return X.current.useRef(N)},gt.useState=function(N){return X.current.useState(N)},gt.useSyncExternalStore=function(N,Y,ae){return X.current.useSyncExternalStore(N,Y,ae)},gt.useTransition=function(){return X.current.useTransition()},gt.version="18.3.1",gt}var g8;function Ax(){return g8||(g8=1,uy.exports=fj()),uy.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 v8;function hj(){if(v8)return gf;v8=1;var t=Ax(),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,u,d){var f,h={},g=null,v=null;d!==void 0&&(g=""+d),u.key!==void 0&&(g=""+u.key),u.ref!==void 0&&(v=u.ref);for(f in u)r.call(u,f)&&!i.hasOwnProperty(f)&&(h[f]=u[f]);if(l&&l.defaultProps)for(f in u=l.defaultProps,u)h[f]===void 0&&(h[f]=u[f]);return{$$typeof:e,type:l,key:g,ref:v,props:h,_owner:s.current}}return gf.Fragment=n,gf.jsx=o,gf.jsxs=o,gf}var y8;function pj(){return y8||(y8=1,cy.exports=hj()),cy.exports}var b=pj(),m=Ax();const xe=$g(m),Ad=cj({__proto__:null,default:xe},[m]),lA=m.createContext(void 0),cA=t=>{const e=m.useContext(lA);if(!e)throw new Error("No QueryClient set, use QueryClientProvider to set one");return e},mj=({client:t,children:e})=>(m.useEffect(()=>(t.mount(),()=>{t.unmount()}),[t]),b.jsx(lA.Provider,{value:t,children:e})),gj={setTimeout:(t,e)=>setTimeout(t,e),clearTimeout:t=>clearTimeout(t),setInterval:(t,e)=>setInterval(t,e),clearInterval:t=>clearInterval(t)};var Aa,Px,Q5,vj=(Q5=class{constructor(){tt(this,Aa,gj);tt(this,Px,!1)}setTimeoutProvider(t){Te(this,Aa,t)}setTimeout(t,e){return W(this,Aa).setTimeout(t,e)}clearTimeout(t){W(this,Aa).clearTimeout(t)}setInterval(t,e){return W(this,Aa).setInterval(t,e)}clearInterval(t){W(this,Aa).clearInterval(t)}},Aa=new WeakMap,Px=new WeakMap,Q5);const Yl=new vj;function yj(t){setTimeout(t,0)}const _j=typeof window>"u"||"Deno"in globalThis;function es(){}function wj(t,e){return typeof t=="function"?t(e):t}function uA(t){return typeof t=="number"&&t>=0&&t!==1/0}function dA(t,e){return Math.max(t+(e||0)-Date.now(),0)}function dn(t,e){return typeof t=="function"?t(e):t}function _8(t,e){const{type:n="all",exact:r,fetchStatus:s,predicate:i,queryKey:o,stale:l}=t;if(o){if(r){if(e.queryHash!==Tx(o,e.options))return!1}else if(!id(e.queryKey,o))return!1}if(n!=="all"){const u=e.isActive();if(n==="active"&&!u||n==="inactive"&&u)return!1}return!(typeof l=="boolean"&&e.isStale()!==l||s&&s!==e.state.fetchStatus||i&&!i(e))}function w8(t,e){const{exact:n,status:r,predicate:s,mutationKey:i}=t;if(i){if(!e.options.mutationKey)return!1;if(n){if(uh(e.options.mutationKey)!==uh(i))return!1}else if(!id(e.options.mutationKey,i))return!1}return!(r&&e.state.status!==r||s&&!s(e))}function Tx(t,e){return((e==null?void 0:e.queryKeyHashFn)||uh)(t)}function uh(t){return JSON.stringify(t,(e,n)=>s2(n)?Object.keys(n).sort().reduce((r,s)=>(r[s]=n[s],r),{}):n)}function id(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(!id(t[r],e[r]))return!1;return!0}const n=Object.keys(e);for(const r of n)if(!id(t[r],e[r]))return!1;return!0}return!1}const xj=Object.prototype.hasOwnProperty;function fA(t,e,n=0){if(t===e)return t;if(n>500)return e;const r=x8(t)&&x8(e);if(!r&&!(s2(t)&&s2(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 u=0;for(let d=0;d<o;d++){const f=r?d:i[d],h=t[f],g=e[f];if(h===g){l[f]=h,(r?d<s:xj.call(t,f))&&u++;continue}if(h===null||g===null||typeof h!="object"||typeof g!="object"){l[f]=g;continue}const v=fA(h,g,n+1);l[f]=v,v===h&&u++}return s===o&&u===s?t:l}function dy(t,e){if(!e||Object.keys(t).length!==Object.keys(e).length)return!1;for(const n in t)if(t[n]!==e[n])return!1;return!0}function x8(t){return Array.isArray(t)&&t.length===Object.keys(t).length}function s2(t){if(!b8(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!(!b8(r)||!r.hasOwnProperty("isPrototypeOf")||e!==Object.prototype)}function b8(t){return Object.prototype.toString.call(t)==="[object Object]"}function bj(t){return new Promise(e=>{Yl.setTimeout(e,t)})}function i2(t,e,n){return typeof n.structuralSharing=="function"?n.structuralSharing(t,e):n.structuralSharing!==!1?fA(t,e):e}function Sj(t,e,n=0){const r=[...t,e];return n&&r.length>n?r.slice(1):r}function kj(t,e,n=0){const r=[e,...t];return n&&r.length>n?r.slice(0,-1):r}const Rx=Symbol();function hA(t,e){return!t.queryFn&&(e!=null&&e.initialPromise)?()=>e.initialPromise:!t.queryFn||t.queryFn===Rx?()=>Promise.reject(new Error(`Missing queryFn: '${t.queryHash}'`)):t.queryFn}function pA(t,e){return typeof t=="function"?t(...e):!!t}function Cj(t,e,n){let r=!1,s;return Object.defineProperty(t,"signal",{enumerable:!0,get:()=>(s??(s=e()),r||(r=!0,s.aborted?n():s.addEventListener("abort",n,{once:!0})),s)}),t}let Ej=()=>_j;const Mx=()=>Ej();var Qh=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(){}},ec,Ta,Wu,X5,Pj=(X5=class extends Qh{constructor(){super();tt(this,ec);tt(this,Ta);tt(this,Wu);Te(this,Wu,e=>{if(typeof window<"u"&&window.addEventListener){const n=()=>e();return window.addEventListener("visibilitychange",n,!1),()=>{window.removeEventListener("visibilitychange",n)}}})}onSubscribe(){W(this,Ta)||this.setEventListener(W(this,Wu))}onUnsubscribe(){var e;this.hasListeners()||((e=W(this,Ta))==null||e.call(this),Te(this,Ta,void 0))}setEventListener(e){var n;Te(this,Wu,e),(n=W(this,Ta))==null||n.call(this),Te(this,Ta,e(r=>{typeof r=="boolean"?this.setFocused(r):this.onFocus()}))}setFocused(e){W(this,ec)!==e&&(Te(this,ec,e),this.onFocus())}onFocus(){const e=this.isFocused();this.listeners.forEach(n=>{n(e)})}isFocused(){var e;return typeof W(this,ec)=="boolean"?W(this,ec):((e=globalThis.document)==null?void 0:e.visibilityState)!=="hidden"}},ec=new WeakMap,Ta=new WeakMap,Wu=new WeakMap,X5);const Ix=new Pj,Aj=yj;function Tj(){let t=[],e=0,n=l=>{l()},r=l=>{l()},s=Aj;const i=l=>{e?t.push(l):s(()=>{n(l)})},o=()=>{const l=t;t=[],l.length&&s(()=>{r(()=>{l.forEach(u=>{n(u)})})})};return{batch:l=>{let u;e++;try{u=l()}finally{e--,e||o()}return u},batchCalls:l=>(...u)=>{i(()=>{l(...u)})},schedule:i,setNotifyFunction:l=>{n=l},setBatchNotifyFunction:l=>{r=l},setScheduler:l=>{s=l}}}const mr=Tj();var qu,Ra,Gu,J5,Rj=(J5=class extends Qh{constructor(){super();tt(this,qu,!0);tt(this,Ra);tt(this,Gu);Te(this,Gu,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,Ra)||this.setEventListener(W(this,Gu))}onUnsubscribe(){var e;this.hasListeners()||((e=W(this,Ra))==null||e.call(this),Te(this,Ra,void 0))}setEventListener(e){var n;Te(this,Gu,e),(n=W(this,Ra))==null||n.call(this),Te(this,Ra,e(this.setOnline.bind(this)))}setOnline(e){W(this,qu)!==e&&(Te(this,qu,e),this.listeners.forEach(n=>{n(e)}))}isOnline(){return W(this,qu)}},qu=new WeakMap,Ra=new WeakMap,Gu=new WeakMap,J5);const Pm=new Rj;function Mj(t){return Math.min(1e3*2**t,3e4)}function mA(t){return(t??"online")==="online"?Pm.isOnline():!0}var o2=class extends Error{constructor(t){super("CancelledError"),this.revert=t==null?void 0:t.revert,this.silent=t==null?void 0:t.silent}};function gA(t){let e=!1,n=0,r,s="pending",i,o;const l=new Promise((k,E)=>{i=k,o=E});l.catch(es);const u=()=>s!=="pending",d=k=>{var E;if(!u()){const P=new o2(k);_(P),(E=t.onCancel)==null||E.call(t,P)}},f=()=>{e=!0},h=()=>{e=!1},g=()=>Ix.isFocused()&&(t.networkMode==="always"||Pm.isOnline())&&t.canRun(),v=()=>mA(t.networkMode)&&t.canRun(),x=k=>{u()||(r==null||r(),s="resolved",i(k))},_=k=>{u()||(r==null||r(),s="rejected",o(k))},w=k=>new Promise(E=>{var P;r=T=>{(u()||k())&&E(T)},(P=t.onPause)==null||P.call(t)}).then(()=>{var E;r=void 0,u()||(E=t.onContinue)==null||E.call(t)}),S=()=>{if(u())return;let k;const E=n===0?t.initialPromise:void 0;try{k=E??t.fn()}catch(P){k=Promise.reject(P)}Promise.resolve(k).then(x).catch(P=>{var O;if(u())return;const T=t.retry??(Mx()?0:3),I=t.retryDelay??Mj,M=typeof I=="function"?I(n,P):I,R=T===!0||typeof T=="number"&&n<T||typeof T=="function"&&T(n,P);if(e||!R){_(P);return}n++,(O=t.onFail)==null||O.call(t,n,P),bj(M).then(()=>g()?void 0:w(g)).then(()=>{e?_(P):S()})})};return{promise:l,status:()=>s,cancel:d,continue:()=>(r==null||r(),l),cancelRetry:f,continueRetry:h,canStart:v,start:()=>(v()?S():w(v).then(S),l)}}var tc,eA,vA=(eA=class{constructor(){tt(this,tc)}destroy(){this.clearGcTimeout()}scheduleGc(){this.clearGcTimeout(),uA(this.gcTime)&&Te(this,tc,Yl.setTimeout(()=>{this.optionalRemove()},this.gcTime))}updateGcTime(t){this.gcTime=Math.max(this.gcTime||0,t??(Mx()?1/0:3e5))}clearGcTimeout(){W(this,tc)!==void 0&&(Yl.clearTimeout(W(this,tc)),Te(this,tc,void 0))}},tc=new WeakMap,eA);function Ij(t){return{onFetch:(e,n)=>{var f,h,g,v,x;const r=e.options,s=(g=(h=(f=e.fetchOptions)==null?void 0:f.meta)==null?void 0:h.fetchMore)==null?void 0:g.direction,i=((v=e.state.data)==null?void 0:v.pages)||[],o=((x=e.state.data)==null?void 0:x.pageParams)||[];let l={pages:[],pageParams:[]},u=0;const d=async()=>{let _=!1;const w=E=>{Cj(E,()=>e.signal,()=>_=!0)},S=hA(e.options,e.fetchOptions),k=async(E,P,T)=>{if(_)return Promise.reject(e.signal.reason);if(P==null&&E.pages.length)return Promise.resolve(E);const M=(()=>{const $={client:e.client,queryKey:e.queryKey,pageParam:P,direction:T?"backward":"forward",meta:e.options.meta};return w($),$})(),R=await S(M),{maxPages:O}=e.options,D=T?kj:Sj;return{pages:D(E.pages,R,O),pageParams:D(E.pageParams,P,O)}};if(s&&i.length){const E=s==="backward",P=E?Oj:S8,T={pages:i,pageParams:o};l=await k(T,P(r,T),E)}else{const E=t??i.length;do{const P=u===0?o[0]??r.initialPageParam:S8(r,l);if(u>0&&P==null)break;l=await k(l,P),u++}while(u<E)}return l};e.options.persister?e.fetchFn=()=>{var _,w;return(w=(_=e.options).persister)==null?void 0:w.call(_,d,{client:e.client,queryKey:e.queryKey,meta:e.options.meta,signal:e.signal},n)}:e.fetchFn=d}}}function S8(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 Oj(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 Ku,nc,Yu,Zs,rc,Qn,Wh,sc,vi,Co,tA,Lj=(tA=class extends vA{constructor(e){super();tt(this,vi);tt(this,Ku);tt(this,nc);tt(this,Yu);tt(this,Zs);tt(this,rc);tt(this,Qn);tt(this,Wh);tt(this,sc);Te(this,sc,!1),Te(this,Wh,e.defaultOptions),this.setOptions(e.options),this.observers=[],Te(this,rc,e.client),Te(this,Zs,W(this,rc).getQueryCache()),this.queryKey=e.queryKey,this.queryHash=e.queryHash,Te(this,nc,C8(this.options)),this.state=e.state??W(this,nc),this.scheduleGc()}get meta(){return this.options.meta}get queryType(){return W(this,Ku)}get promise(){var e;return(e=W(this,Qn))==null?void 0:e.promise}setOptions(e){if(this.options={...W(this,Wh),...e},e!=null&&e._type&&Te(this,Ku,e._type),this.updateGcTime(this.options.gcTime),this.state&&this.state.data===void 0){const n=C8(this.options);n.data!==void 0&&(this.setState(k8(n.data,n.dataUpdatedAt)),Te(this,nc,n))}}optionalRemove(){!this.observers.length&&this.state.fetchStatus==="idle"&&W(this,Zs).remove(this)}setData(e,n){const r=i2(this.state.data,e,this.options);return _t(this,vi,Co).call(this,{data:r,type:"success",dataUpdatedAt:n==null?void 0:n.updatedAt,manual:n==null?void 0:n.manual}),r}setState(e){_t(this,vi,Co).call(this,{type:"setState",state:e})}cancel(e){var r,s;const n=(r=W(this,Qn))==null?void 0:r.promise;return(s=W(this,Qn))==null||s.cancel(e),n?n.then(es).catch(es):Promise.resolve()}destroy(){super.destroy(),this.cancel({silent:!0})}get resetState(){return W(this,nc)}reset(){this.destroy(),this.setState(this.resetState)}isActive(){return this.observers.some(e=>dn(e.options.enabled,this)!==!1)}isDisabled(){return this.getObserversCount()>0?!this.isActive():this.options.queryFn===Rx||!this.isFetched()}isFetched(){return this.state.dataUpdateCount+this.state.errorUpdateCount>0}isStatic(){return this.getObserversCount()>0?this.observers.some(e=>dn(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:!dA(this.state.dataUpdatedAt,e)}onFocus(){var e,n;(e=this.observers.find(r=>r.shouldFetchOnWindowFocus()))==null||e.refetch({cancelRefetch:!1}),(n=W(this,Qn))==null||n.continue()}onOnline(){var e,n;(e=this.observers.find(r=>r.shouldFetchOnReconnect()))==null||e.refetch({cancelRefetch:!1}),(n=W(this,Qn))==null||n.continue()}addObserver(e){this.observers.includes(e)||(this.observers.push(e),this.clearGcTimeout(),W(this,Zs).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,Qn)&&(W(this,sc)||this.state.fetchStatus==="paused"&&this.state.status==="pending"?W(this,Qn).cancel({revert:!0}):W(this,Qn).cancelRetry()),this.scheduleGc()),W(this,Zs).notify({type:"observerRemoved",query:this,observer:e}))}getObserversCount(){return this.observers.length}invalidate(){this.state.isInvalidated||_t(this,vi,Co).call(this,{type:"invalidate"})}async fetch(e,n){var d,f,h,g,v,x,_,w,S,k,E,P;if(this.state.fetchStatus!=="idle"&&((d=W(this,Qn))==null?void 0:d.status())!=="rejected"){if(this.state.data!==void 0&&(n!=null&&n.cancelRefetch))this.cancel({silent:!0});else if(W(this,Qn))return W(this,Qn).continueRetry(),W(this,Qn).promise}if(e&&this.setOptions(e),!this.options.queryFn){const T=this.observers.find(I=>I.options.queryFn);T&&this.setOptions(T.options)}const r=new AbortController,s=T=>{Object.defineProperty(T,"signal",{enumerable:!0,get:()=>(Te(this,sc,!0),r.signal)})},i=()=>{const T=hA(this.options,n),M=(()=>{const R={client:W(this,rc),queryKey:this.queryKey,meta:this.meta};return s(R),R})();return Te(this,sc,!1),this.options.persister?this.options.persister(T,M,this):T(M)},l=(()=>{const T={fetchOptions:n,options:this.options,queryKey:this.queryKey,client:W(this,rc),state:this.state,fetchFn:i};return s(T),T})();(f=W(this,Ku)==="infinite"?Ij(this.options.pages):this.options.behavior)==null||f.onFetch(l,this),Te(this,Yu,this.state),(this.state.fetchStatus==="idle"||this.state.fetchMeta!==((h=l.fetchOptions)==null?void 0:h.meta))&&_t(this,vi,Co).call(this,{type:"fetch",meta:(g=l.fetchOptions)==null?void 0:g.meta});const u=Te(this,Qn,gA({initialPromise:n==null?void 0:n.initialPromise,fn:l.fetchFn,onCancel:T=>{T instanceof o2&&T.revert&&this.setState({...W(this,Yu),fetchStatus:"idle"}),r.abort()},onFail:(T,I)=>{_t(this,vi,Co).call(this,{type:"failed",failureCount:T,error:I})},onPause:()=>{_t(this,vi,Co).call(this,{type:"pause"})},onContinue:()=>{_t(this,vi,Co).call(this,{type:"continue"})},retry:l.options.retry,retryDelay:l.options.retryDelay,networkMode:l.options.networkMode,canRun:()=>!0}));try{const T=await u.start();if(T===void 0)throw new Error(`${this.queryHash} data is undefined`);return this.setData(T),(x=(v=W(this,Zs).config).onSuccess)==null||x.call(v,T,this),(w=(_=W(this,Zs).config).onSettled)==null||w.call(_,T,this.state.error,this),T}catch(T){if(T instanceof o2){if(T.silent)return W(this,Qn).promise;if(T.revert){if(this.state.data===void 0)throw T;return this.state.data}}throw _t(this,vi,Co).call(this,{type:"error",error:T}),(k=(S=W(this,Zs).config).onError)==null||k.call(S,T,this),(P=(E=W(this,Zs).config).onSettled)==null||P.call(E,this.state.data,T,this),T}finally{W(this,Qn)===u&&Te(this,Qn,void 0),this.scheduleGc()}}},Ku=new WeakMap,nc=new WeakMap,Yu=new WeakMap,Zs=new WeakMap,rc=new WeakMap,Qn=new WeakMap,Wh=new WeakMap,sc=new WeakMap,vi=new WeakSet,Co=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,...yA(r.data,this.options),fetchMeta:e.meta??null};case"success":const s={...r,...k8(e.data,e.dataUpdatedAt),dataUpdateCount:r.dataUpdateCount+1,...!e.manual&&{fetchStatus:"idle",fetchFailureCount:0,fetchFailureReason:null}};return Te(this,Yu,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),mr.batch(()=>{this.observers.slice().forEach(r=>{r.onQueryUpdate()}),W(this,Zs).notify({query:this,type:"updated",action:e})})},tA);function yA(t,e){return{fetchFailureCount:0,fetchFailureReason:null,fetchStatus:mA(e.networkMode)?"fetching":"paused",...t===void 0&&{error:null,status:"pending"}}}function k8(t,e){return{data:t,dataUpdatedAt:e??Date.now(),error:null,isInvalidated:!1,status:"success"}}function C8(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 jr,bt,qh,$r,ic,Qu,Oo,Gh,Xu,Ju,oc,ac,Ma,ed,$t,Of,a2,l2,c2,u2,d2,f2,h2,p2,nA,Nj=(nA=class extends Qh{constructor(e,n){super();tt(this,$t);tt(this,jr);tt(this,bt);tt(this,qh);tt(this,$r);tt(this,ic);tt(this,Qu);tt(this,Oo);tt(this,Gh);tt(this,Xu);tt(this,Ju);tt(this,oc);tt(this,ac);tt(this,Ma);tt(this,ed,new Set);this.options=n,Te(this,jr,e),Te(this,Oo,null),this.bindMethods(),this.setOptions(n)}bindMethods(){this.refetch=this.refetch.bind(this)}onSubscribe(){this.listeners.size===1&&(W(this,bt).addObserver(this),E8(W(this,bt),this.options)?_t(this,$t,Of).call(this):this.updateResult(),_t(this,$t,d2).call(this))}onUnsubscribe(){this.hasListeners()||this.destroy()}shouldFetchOnReconnect(){return m2(W(this,bt),this.options,this.options.refetchOnReconnect)}shouldFetchOnWindowFocus(){return m2(W(this,bt),this.options,this.options.refetchOnWindowFocus)}destroy(){this.listeners=new Set,_t(this,$t,f2).call(this),_t(this,$t,h2).call(this),W(this,bt).removeObserver(this)}setOptions(e){const n=this.options,r=W(this,bt);if(this.options=W(this,jr).defaultQueryOptions(e),this.options.enabled!==void 0&&typeof this.options.enabled!="boolean"&&typeof this.options.enabled!="function"&&typeof dn(this.options.enabled,W(this,bt))!="boolean")throw new Error("Expected enabled to be a boolean or a callback that returns a boolean");_t(this,$t,p2).call(this),W(this,bt).setOptions(this.options),n._defaulted&&!dy(this.options,n)&&W(this,jr).getQueryCache().notify({type:"observerOptionsUpdated",query:W(this,bt),observer:this});const s=this.hasListeners();s&&P8(W(this,bt),r,this.options,n)&&_t(this,$t,Of).call(this),this.updateResult(),s&&(W(this,bt)!==r||dn(this.options.enabled,W(this,bt))!==dn(n.enabled,W(this,bt))||dn(this.options.staleTime,W(this,bt))!==dn(n.staleTime,W(this,bt)))&&_t(this,$t,l2).call(this);const i=_t(this,$t,c2).call(this);s&&(W(this,bt)!==r||dn(this.options.enabled,W(this,bt))!==dn(n.enabled,W(this,bt))||i!==W(this,Ma))&&_t(this,$t,u2).call(this,i)}getOptimisticResult(e){const n=W(this,jr).getQueryCache().build(W(this,jr),e),r=this.createResult(n,e);return dy(this.getCurrentResult(),r)||(Te(this,$r,r),Te(this,Qu,this.options),Te(this,ic,W(this,bt).state)),r}getCurrentResult(){return W(this,$r)}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,ed).add(e)}getCurrentQuery(){return W(this,bt)}refetch({...e}={}){return this.fetch({...e})}fetchOptimistic(e){const n=W(this,jr).defaultQueryOptions(e),r=W(this,jr).getQueryCache().build(W(this,jr),n);let s=()=>{},i;const o=new Promise(l=>{i=l,s=W(this,jr).getQueryCache().subscribe(u=>{u.type==="updated"&&u.query.queryHash===r.queryHash&&r.state.data!==void 0&&(s(),l(this.createResult(r,n)))})});return Promise.race([r.fetch().then(()=>{const l=this.createResult(r,n);return i==null||i(l),l}).finally(()=>{s()}),o])}fetch(e){return _t(this,$t,Of).call(this,{...e,cancelRefetch:e.cancelRefetch??!0}).then(()=>(this.updateResult(),W(this,$r)))}createResult(e,n){var I;const r=W(this,bt),s=this.options,i=W(this,$r),o=W(this,ic),l=W(this,Qu),u=e!==r?e.state:W(this,qh),{state:d}=e;let f={...d},h=!1,g;if(n._optimisticResults){const M=this.hasListeners(),R=!M&&E8(e,n),O=M&&P8(e,r,n,s);(R||O)&&(f={...f,...yA(d.data,e.options)}),n._optimisticResults==="isRestoring"&&(f.fetchStatus="idle")}let{error:v,errorUpdatedAt:x,status:_}=f;g=f.data;let w=!1;if(n.placeholderData!==void 0&&g===void 0&&_==="pending"){let M;i!=null&&i.isPlaceholderData&&n.placeholderData===(l==null?void 0:l.placeholderData)?(M=i.data,w=!0):M=typeof n.placeholderData=="function"?n.placeholderData((I=W(this,Ju))==null?void 0:I.state.data,W(this,Ju)):n.placeholderData,M!==void 0&&(_="success",g=i2(i==null?void 0:i.data,M,n),h=!0)}if(n.select&&g!==void 0&&!w)if(i&&g===(o==null?void 0:o.data)&&n.select===W(this,Gh))g=W(this,Xu);else try{Te(this,Gh,n.select),g=n.select(g),g=i2(i==null?void 0:i.data,g,n),Te(this,Xu,g),Te(this,Oo,null)}catch(M){Te(this,Oo,M)}else g===void 0&&Te(this,Oo,null);W(this,Oo)&&(v=W(this,Oo),g=W(this,Xu),x=Date.now(),_="error",h=!1);const S=f.fetchStatus==="fetching",k=_==="pending",E=_==="error",P=k&&S,T=g!==void 0;return{status:_,fetchStatus:f.fetchStatus,isPending:k,isSuccess:_==="success",isError:E,isInitialLoading:P,isLoading:P,data:g,dataUpdatedAt:f.dataUpdatedAt,error:v,errorUpdatedAt:x,failureCount:f.fetchFailureCount,failureReason:f.fetchFailureReason,errorUpdateCount:f.errorUpdateCount,isFetched:e.isFetched(),isFetchedAfterMount:f.dataUpdateCount>u.dataUpdateCount||f.errorUpdateCount>u.errorUpdateCount,isFetching:S,isRefetching:S&&!k,isLoadingError:E&&!T,isPaused:f.fetchStatus==="paused",isPlaceholderData:h,isRefetchError:E&&T,isStale:Ox(e,n),refetch:this.refetch,isEnabled:dn(n.enabled,e)!==!1}}updateResult(){const e=W(this,$r),n=this.createResult(W(this,bt),this.options);if(Te(this,ic,W(this,bt).state),Te(this,Qu,this.options),W(this,ic).data!==void 0&&Te(this,Ju,W(this,bt)),dy(n,e))return;Te(this,$r,n);const s=(()=>{if(!e)return!0;const{notifyOnChangeProps:i}=this.options,o=typeof i=="function"?i():i;if(o==="all"||!o&&!W(this,ed).size)return!0;const l=new Set(o??W(this,ed));return this.options.throwOnError&&l.add("error"),Object.keys(W(this,$r)).some(u=>{const d=u;return W(this,$r)[d]!==e[d]&&l.has(d)})})();mr.batch(()=>{s&&this.listeners.forEach(i=>{i(W(this,$r))}),W(this,jr).getQueryCache().notify({query:W(this,bt),type:"observerResultsUpdated"})})}onQueryUpdate(){this.updateResult(),this.hasListeners()&&_t(this,$t,d2).call(this)}},jr=new WeakMap,bt=new WeakMap,qh=new WeakMap,$r=new WeakMap,ic=new WeakMap,Qu=new WeakMap,Oo=new WeakMap,Gh=new WeakMap,Xu=new WeakMap,Ju=new WeakMap,oc=new WeakMap,ac=new WeakMap,Ma=new WeakMap,ed=new WeakMap,$t=new WeakSet,Of=function(e){_t(this,$t,p2).call(this);let n=W(this,bt).fetch(this.options,e);return e!=null&&e.throwOnError||(n=n.catch(es)),n},a2=function(e){return!Mx()&&dn(this.options.enabled,W(this,bt))!==!1&&uA(e)},l2=function(){_t(this,$t,f2).call(this);const e=dn(this.options.staleTime,W(this,bt));if(W(this,$r).isStale||!_t(this,$t,a2).call(this,e))return;const n=dA(W(this,$r).dataUpdatedAt,e)+1;Te(this,oc,Yl.setTimeout(()=>{W(this,$r).isStale||this.updateResult()},n))},c2=function(){return dn(this.options.refetchInterval,W(this,bt))??!1},u2=function(e){_t(this,$t,h2).call(this),Te(this,Ma,e),!(W(this,Ma)===0||!_t(this,$t,a2).call(this,W(this,Ma)))&&Te(this,ac,Yl.setInterval(()=>{(this.options.refetchIntervalInBackground||Ix.isFocused())&&_t(this,$t,Of).call(this)},W(this,Ma)))},d2=function(){_t(this,$t,l2).call(this),_t(this,$t,u2).call(this,_t(this,$t,c2).call(this))},f2=function(){W(this,oc)!==void 0&&(Yl.clearTimeout(W(this,oc)),Te(this,oc,void 0))},h2=function(){W(this,ac)!==void 0&&(Yl.clearInterval(W(this,ac)),Te(this,ac,void 0))},p2=function(){const e=W(this,jr).getQueryCache().build(W(this,jr),this.options);if(e===W(this,bt))return;const n=W(this,bt);Te(this,bt,e),Te(this,qh,e.state),this.hasListeners()&&(n==null||n.removeObserver(this),e.addObserver(this))},nA);function Dj(t,e){return dn(e.enabled,t)!==!1&&t.state.data===void 0&&!(t.state.status==="error"&&dn(e.retryOnMount,t)===!1)}function E8(t,e){return Dj(t,e)||t.state.data!==void 0&&m2(t,e,e.refetchOnMount)}function m2(t,e,n){if(dn(e.enabled,t)!==!1&&dn(e.staleTime,t)!=="static"){const r=dn(n,t);return r==="always"||r!==!1&&Ox(t,e)}return!1}function P8(t,e,n,r){return(t!==e||dn(r.enabled,t)===!1)&&(!n.suspense||t.state.status!=="error")&&Ox(t,n)}function Ox(t,e){return dn(e.enabled,t)!==!1&&t.isStaleByTime(dn(e.staleTime,t))}var Kh,Hi,Pr,lc,zi,ka,rA,jj=(rA=class extends vA{constructor(e){super();tt(this,zi);tt(this,Kh);tt(this,Hi);tt(this,Pr);tt(this,lc);Te(this,Kh,e.client),this.mutationId=e.mutationId,Te(this,Pr,e.mutationCache),Te(this,Hi,[]),this.state=e.state||$j(),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,Hi).includes(e)||(W(this,Hi).push(e),this.clearGcTimeout(),W(this,Pr).notify({type:"observerAdded",mutation:this,observer:e}))}removeObserver(e){Te(this,Hi,W(this,Hi).filter(n=>n!==e)),this.scheduleGc(),W(this,Pr).notify({type:"observerRemoved",mutation:this,observer:e})}optionalRemove(){W(this,Hi).length||(this.state.status==="pending"?this.scheduleGc():W(this,Pr).remove(this))}continue(){var e;return((e=W(this,lc))==null?void 0:e.continue())??(this.state.status==="pending"?this.execute(this.state.variables):Promise.resolve())}async execute(e){var l,u,d,f,h,g,v,x,_,w,S,k,E,P,T,I,M,R;const n=()=>{_t(this,zi,ka).call(this,{type:"continue"})},r={client:W(this,Kh),meta:this.options.meta,mutationKey:this.options.mutationKey},s=Te(this,lc,gA({fn:()=>this.options.mutationFn?this.options.mutationFn(e,r):Promise.reject(new Error("No mutationFn found")),onFail:(O,D)=>{_t(this,zi,ka).call(this,{type:"failed",failureCount:O,error:D})},onPause:()=>{_t(this,zi,ka).call(this,{type:"pause"})},onContinue:n,retry:this.options.retry??0,retryDelay:this.options.retryDelay,networkMode:this.options.networkMode,canRun:()=>W(this,Pr).canRun(this)})),i=this.state.status==="pending",o=!s.canStart();try{if(i)n();else{_t(this,zi,ka).call(this,{type:"pending",variables:e,isPaused:o}),W(this,Pr).config.onMutate&&await W(this,Pr).config.onMutate(e,this,r);const D=await((u=(l=this.options).onMutate)==null?void 0:u.call(l,e,r));D!==this.state.context&&_t(this,zi,ka).call(this,{type:"pending",context:D,variables:e,isPaused:o})}const O=await s.start();return await((f=(d=W(this,Pr).config).onSuccess)==null?void 0:f.call(d,O,e,this.state.context,this,r)),await((g=(h=this.options).onSuccess)==null?void 0:g.call(h,O,e,this.state.context,r)),await((x=(v=W(this,Pr).config).onSettled)==null?void 0:x.call(v,O,null,this.state.variables,this.state.context,this,r)),await((w=(_=this.options).onSettled)==null?void 0:w.call(_,O,null,e,this.state.context,r)),_t(this,zi,ka).call(this,{type:"success",data:O}),O}catch(O){try{await((k=(S=W(this,Pr).config).onError)==null?void 0:k.call(S,O,e,this.state.context,this,r))}catch(D){Promise.reject(D)}try{await((P=(E=this.options).onError)==null?void 0:P.call(E,O,e,this.state.context,r))}catch(D){Promise.reject(D)}try{await((I=(T=W(this,Pr).config).onSettled)==null?void 0:I.call(T,void 0,O,this.state.variables,this.state.context,this,r))}catch(D){Promise.reject(D)}try{await((R=(M=this.options).onSettled)==null?void 0:R.call(M,void 0,O,e,this.state.context,r))}catch(D){Promise.reject(D)}throw _t(this,zi,ka).call(this,{type:"error",error:O}),O}finally{W(this,lc)===s&&Te(this,lc,void 0),W(this,Pr).runNext(this)}}},Kh=new WeakMap,Hi=new WeakMap,Pr=new WeakMap,lc=new WeakMap,zi=new WeakSet,ka=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),mr.batch(()=>{W(this,Hi).forEach(r=>{r.onMutationUpdate(e)}),W(this,Pr).notify({mutation:this,type:"updated",action:e})})},rA);function $j(){return{context:void 0,data:void 0,error:null,failureCount:0,failureReason:null,isPaused:!1,status:"idle",variables:void 0,submittedAt:0}}var Lo,yi,Yh,sA,Fj=(sA=class extends Qh{constructor(e={}){super();tt(this,Lo);tt(this,yi);tt(this,Yh);this.config=e,Te(this,Lo,new Set),Te(this,yi,new Map),Te(this,Yh,0)}build(e,n,r){const s=new jj({client:e,mutationCache:this,mutationId:++m0(this,Yh)._,options:e.defaultMutationOptions(n),state:r});return this.add(s),s}add(e){W(this,Lo).add(e);const n=g0(e);if(typeof n=="string"){const r=W(this,yi).get(n);r?r.push(e):W(this,yi).set(n,[e])}this.notify({type:"added",mutation:e})}remove(e){if(W(this,Lo).delete(e)){const n=g0(e);if(typeof n=="string"){const r=W(this,yi).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,yi).delete(n)}}this.notify({type:"removed",mutation:e})}canRun(e){var r;const n=g0(e);if(typeof n=="string"){const s=(r=W(this,yi).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=g0(e);return typeof n=="string"?((s=(r=W(this,yi).get(n))==null?void 0:r.find(i=>i!==e&&i.state.isPaused))==null?void 0:s.continue())??Promise.resolve():Promise.resolve()}clear(){mr.batch(()=>{W(this,Lo).forEach(e=>{this.notify({type:"removed",mutation:e})}),W(this,Lo).clear(),W(this,yi).clear()})}getAll(){return Array.from(W(this,Lo))}find(e){const n={exact:!0,...e};return this.getAll().find(r=>w8(n,r))}findAll(e={}){return this.getAll().filter(n=>w8(e,n))}notify(e){mr.batch(()=>{this.listeners.forEach(n=>{n(e)})})}resumePausedMutations(){const e=this.getAll().filter(n=>n.state.isPaused);return mr.batch(()=>Promise.all(e.map(n=>n.continue().catch(es))))}},Lo=new WeakMap,yi=new WeakMap,Yh=new WeakMap,sA);function g0(t){var e;return(e=t.options.scope)==null?void 0:e.id}var Ui,iA,Vj=(iA=class extends Qh{constructor(e={}){super();tt(this,Ui);this.config=e,Te(this,Ui,new Map)}build(e,n,r){const s=n.queryKey,i=n.queryHash??Tx(s,n);let o=this.get(i);return o||(o=new Lj({client:e,queryKey:s,queryHash:i,options:e.defaultQueryOptions(n),state:r,defaultOptions:e.getQueryDefaults(s)}),this.add(o)),o}add(e){W(this,Ui).has(e.queryHash)||(W(this,Ui).set(e.queryHash,e),this.notify({type:"added",query:e}))}remove(e){W(this,Ui).get(e.queryHash)===e&&(e.destroy(),W(this,Ui).delete(e.queryHash),this.notify({type:"removed",query:e}))}clear(){mr.batch(()=>{this.getAll().forEach(e=>{this.remove(e)})})}get(e){return W(this,Ui).get(e)}getAll(){return[...W(this,Ui).values()]}find(e){const n={exact:!0,...e};return this.getAll().find(r=>_8(n,r))}findAll(e={}){const n=this.getAll();return Object.keys(e).length>0?n.filter(r=>_8(e,r)):n}notify(e){mr.batch(()=>{this.listeners.forEach(n=>{n(e)})})}onFocus(){mr.batch(()=>{this.getAll().forEach(e=>{e.onFocus()})})}onOnline(){mr.batch(()=>{this.getAll().forEach(e=>{e.onOnline()})})}},Ui=new WeakMap,iA),_n,Ia,Oa,td,nd,La,rd,sd,oA,Hj=(oA=class{constructor(t={}){tt(this,_n);tt(this,Ia);tt(this,Oa);tt(this,td);tt(this,nd);tt(this,La);tt(this,rd);tt(this,sd);Te(this,_n,t.queryCache||new Vj),Te(this,Ia,t.mutationCache||new Fj),Te(this,Oa,t.defaultOptions||{}),Te(this,td,new Map),Te(this,nd,new Map),Te(this,La,0)}mount(){m0(this,La)._++,W(this,La)===1&&(Te(this,rd,Ix.subscribe(async t=>{t&&(await this.resumePausedMutations(),W(this,_n).onFocus())})),Te(this,sd,Pm.subscribe(async t=>{t&&(await this.resumePausedMutations(),W(this,_n).onOnline())})))}unmount(){var t,e;m0(this,La)._--,W(this,La)===0&&((t=W(this,rd))==null||t.call(this),Te(this,rd,void 0),(e=W(this,sd))==null||e.call(this),Te(this,sd,void 0))}isFetching(t){return W(this,_n).findAll({...t,fetchStatus:"fetching"}).length}isMutating(t){return W(this,Ia).findAll({...t,status:"pending"}).length}getQueryData(t){var n;const e=this.defaultQueryOptions({queryKey:t});return(n=W(this,_n).get(e.queryHash))==null?void 0:n.state.data}ensureQueryData(t){const e=this.defaultQueryOptions(t),n=W(this,_n).build(this,e),r=n.state.data;return r===void 0?this.fetchQuery(t):(t.revalidateIfStale&&n.isStaleByTime(dn(e.staleTime,n))&&this.prefetchQuery(e),Promise.resolve(r))}getQueriesData(t){return W(this,_n).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,_n).get(r.queryHash))==null?void 0:o.state.data,i=wj(e,s);if(i!==void 0)return W(this,_n).build(this,r).setData(i,{...n,manual:!0})}setQueriesData(t,e,n){return mr.batch(()=>W(this,_n).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,_n).get(e.queryHash))==null?void 0:n.state}removeQueries(t){const e=W(this,_n);mr.batch(()=>{e.findAll(t).forEach(n=>{e.remove(n)})})}resetQueries(t,e){const n=W(this,_n);return mr.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=mr.batch(()=>W(this,_n).findAll(t).map(s=>s.cancel(n)));return Promise.all(r).then(es).catch(es)}invalidateQueries(t,e={}){return mr.batch(()=>(W(this,_n).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=mr.batch(()=>W(this,_n).findAll(t).filter(s=>!s.isDisabled()&&!s.isStatic()).map(s=>{let i=s.fetch(void 0,n);return n.throwOnError||(i=i.catch(es)),s.state.fetchStatus==="paused"?Promise.resolve():i}));return Promise.all(r).then(es)}async query(t){const e=this.defaultQueryOptions(t);e.retry===void 0&&(e.retry=!1);const n=W(this,_n).build(this,e),r=n.isStaleByTime(dn(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,_n).build(this,e);return n.isStaleByTime(dn(e.staleTime,n))?n.fetch(e):Promise.resolve(n.state.data)}prefetchQuery(t){return this.fetchQuery(t).then(es).catch(es)}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(es).catch(es)}ensureInfiniteQueryData(t){return t._type="infinite",this.ensureQueryData(t)}resumePausedMutations(){return Pm.isOnline()?W(this,Ia).resumePausedMutations():Promise.resolve()}getQueryCache(){return W(this,_n)}getMutationCache(){return W(this,Ia)}getDefaultOptions(){return W(this,Oa)}setDefaultOptions(t){Te(this,Oa,t)}setQueryDefaults(t,e){W(this,td).set(uh(t),{queryKey:t,defaultOptions:e})}getQueryDefaults(t){const e=[...W(this,td).values()],n={};return e.forEach(r=>{id(t,r.queryKey)&&Object.assign(n,r.defaultOptions)}),n}setMutationDefaults(t,e){W(this,nd).set(uh(t),{mutationKey:t,defaultOptions:e})}getMutationDefaults(t){const e=[...W(this,nd).values()],n={};return e.forEach(r=>{id(t,r.mutationKey)&&Object.assign(n,r.defaultOptions)}),n}defaultQueryOptions(t){if(t._defaulted)return t;const e={...W(this,Oa).queries,...this.getQueryDefaults(t.queryKey),...t,_defaulted:!0};return e.queryHash||(e.queryHash=Tx(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===Rx&&(e.enabled=!1),e}defaultMutationOptions(t){return t!=null&&t._defaulted?t:{...W(this,Oa).mutations,...(t==null?void 0:t.mutationKey)&&this.getMutationDefaults(t.mutationKey),...t,_defaulted:!0}}clear(){W(this,_n).clear(),W(this,Ia).clear()}},_n=new WeakMap,Ia=new WeakMap,Oa=new WeakMap,td=new WeakMap,nd=new WeakMap,La=new WeakMap,rd=new WeakMap,sd=new WeakMap,oA);const _A=m.createContext(!1),zj=()=>m.useContext(_A);_A.Provider;function Uj(){let t=!1;return{clearReset:()=>{t=!1},reset:()=>{t=!0},isReset:()=>t}}const Bj=m.createContext(Uj()),Zj=()=>m.useContext(Bj),Wj=(t,e,n)=>{const r=n!=null&&n.state.error&&typeof t.throwOnError=="function"?pA(t.throwOnError,[n.state.error,n]):t.throwOnError;(t.suspense||r)&&(e.isReset()||(t.retryOnMount=!1))},qj=t=>{m.useEffect(()=>{t.clearReset()},[t])},Gj=({result:t,errorResetBoundary:e,throwOnError:n,query:r,suspense:s})=>t.isError&&!e.isReset()&&!t.isFetching&&r&&(s&&t.data===void 0||pA(n,[t.error,r])),Kj=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))}},Yj=(t,e)=>(t==null?void 0:t.suspense)&&e.isPending,Qj=(t,e,n)=>e.fetchOptimistic(t).catch(()=>{n.clearReset()});function Xj(t,e,n){const r=zj(),s=Zj(),i=cA(),o=i.defaultQueryOptions(t),l=i.getQueryCache().get(o.queryHash),u=t.subscribed!==!1;o._optimisticResults=r?"isRestoring":u?"optimistic":void 0,Kj(o),Wj(o,s,l),qj(s);const[d]=m.useState(()=>new e(i,o)),f=d.getOptimisticResult(o),h=!r&&u;if(m.useSyncExternalStore(m.useCallback(g=>{const v=h?d.subscribe(mr.batchCalls(g)):es;return d.updateResult(),v},[d,h]),()=>d.getCurrentResult(),()=>d.getCurrentResult()),m.useEffect(()=>{d.setOptions(o)},[o,d]),Yj(o,f))throw Qj(o,d,s);if(Gj({result:f,errorResetBoundary:s,throwOnError:o.throwOnError,query:l,suspense:o.suspense}))throw f.error;return o.notifyOnChangeProps?f:d.trackResult(f)}function dh(t,e){return Xj(t,Nj)}var Jj={};const te="u">typeof window?window:void 0,Rr="u">typeof globalThis?globalThis:te,gr=Rr==null?void 0:Rr.navigator,he=Rr==null?void 0:Rr.document,qt=Rr==null?void 0:Rr.location,fh=Rr==null?void 0:Rr.fetch,Lx=Rr!=null&&Rr.XMLHttpRequest&&"withCredentials"in new Rr.XMLHttpRequest?Rr.XMLHttpRequest:void 0,A8=Rr==null?void 0:Rr.AbortController,e$=Rr==null?void 0:Rr.CompressionStream,Fr=gr==null?void 0:gr.userAgent,vf=typeof globalThis<"u"?globalThis:te;vf&&typeof self>"u"&&(vf.self=vf),vf&&typeof File>"u"&&(vf.File=function(){});const We=te??{},t$="0.9.5",$o={DEBUG:!1,LIB_VERSION:t$,LIB_NAME:"browser-common"};var $i=(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})({}),g2=(function(t){return t.GZipJS="gzip-js",t.Base64="base64",t})({});const n$=["$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"],r$=["token"];function Ue(t,e){return t.indexOf(e)!==-1}const od=function(t){return t.trim()},v2=function(t){return t.replace(/^\$/,"")};function wA(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 xA=Object.prototype,Nx=xA.hasOwnProperty,Fg=xA.toString,He=Array.isArray||function(t){return Fg.call(t)==="[object Array]"},xn=t=>typeof t=="function",nt=t=>t===Object(t)&&!He(t),ns=t=>{if(nt(t)){for(const e in t)if(Nx.call(t,e))return!1;return!0}return!1},le=t=>t===void 0,st=t=>Fg.call(t)=="[object String]",zf=t=>st(t)&&t.trim().length===0,ln=t=>t===null,Xe=t=>le(t)||ln(t),hn=t=>Fg.call(t)=="[object Number]"&&t==t,Eo=t=>hn(t)&&t>0,Hr=t=>Fg.call(t)==="[object Boolean]",s$=t=>Ue(n$,t),i$=t=>Ue(r$,t);function bA(t){return t===null||typeof t!="object"}function Am(t,e){return{}.toString.call(t)===`[object ${e}]`}function Td(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 SA(t,Error)}}function Dx(t){return"u">typeof Event&&SA(t,Event)}function SA(t,e){try{return t instanceof e}catch{return!1}}const o$=[!0,"true",1,"1","yes"],fy=t=>Ue(o$,t),a$=[!1,"false",0,"0","no"];function T8(t,e,n,r,s,i,o){try{var l=t[i](o),u=l.value}catch(d){return void n(d)}l.done?e(u):Promise.resolve(u).then(r,s)}function Ht(t){return function(){var e=this,n=arguments;return new Promise(function(r,s){var i=t.apply(e,n);function o(u){T8(i,r,s,o,l,"next",u)}function l(u){T8(i,r,s,o,l,"throw",u)}o(void 0)})}}const l$=["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","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"],v0=new Map,R8=function(t,e=[]){if(!t)return!1;const n=(function(o,l){let u="";for(let d=0;l.length>d;d++){const f=l[d];u+=f.length+":"+f}return o.length+":"+o+"|"+l.length+":"+u})(t,e),r=v0.get(n);if(r!==void 0)return r;const s=t.toLowerCase(),i=l$.concat(e).some(o=>s.indexOf(o.toLowerCase())!==-1);return 256>v0.size||v0.clear(),v0.set(n,i),i};function qi(t,e,n,r,s){return e>n&&(r.warn("min cannot be greater than max."),e=n),hn(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),qi(s??n,e,n,r))}var c$=class{constructor(t){this.C={},this.I=t.I,this.R=qi(t.bucketSize,0,100,t.A),this.$=qi(t.refillRate,0,this.R,t.A),this.O=qi(t.refillInterval,0,864e5,t.A)}F(t,e){const n=Math.floor((e-t.lastAccess)/this.O);n>0&&(t.tokens=Math.min(t.tokens+n*this.$,this.R),t.lastAccess=t.lastAccess+n*this.O)}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 ad="Mobile",hh="Android",Tm="Tablet",kA="Android Tablet",CA="iPad",EA="Apple Watch",Y0="Safari",Vg="BlackBerry",PA="Samsung Internet",Q0="Chrome",AA="Chrome iOS",TA="Internet Explorer",RA="Internet Explorer Mobile",MA="Opera",IA="Microsoft Edge",X0="Firefox",OA="Firefox iOS",Rm="Nintendo",Mm="PlayStation",Hg="Xbox",LA="Android Mobile",NA="Mobile Safari",hy="Windows",DA="Windows Phone",M8="Nokia",y2="Ouya",u$="Generic "+ad.toLowerCase(),jA="Generic "+Tm.toLowerCase(),_2="Konqueror",$A="Oculus Browser",FA="Vivaldi",VA="Yandex",HA="Whale",zA="DuckDuckGo",UA="Pale Moon",BA="Waterfox",w2="Brave",ZA="Claude",WA="Codex",qA="ChatGPT",GA="Google Search App",py=new RegExp("Version/(\\d+(\\.\\d+)?)"),my=new RegExp("(Claude|Codex|ChatGPT)\\/(\\d+(\\.\\d+)?)"),d$=new RegExp(Hg,"i"),f$=new RegExp("PlayStation \\w+","i"),h$=new RegExp("Nintendo \\w+","i"),jx=new RegExp("BlackBerry|PlayBook|BB10","i"),p$={"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"},KA=function(t,e,n,r){return e=e||"",(function(i){return i!=null&&i.brave?w2:null})(n)||(r!=null&&r.detectGoogleSearchApp&&Ue(t,"GSA/")?GA:Ue(t," OPR/")&&Ue(t,"Mini")?"Opera Mini":Ue(t," OPR/")?MA:jx.test(t)?Vg:Ue(t,"IEMobile")||Ue(t,"WPDesktop")?RA:Ue(t,"OculusBrowser")?$A:Ue(t,"SamsungBrowser")?PA:Ue(t,"Edge")||Ue(t,"Edg/")?IA:Ue(t,"Vivaldi/")?FA:Ue(t,"YaBrowser/")?VA:Ue(t,"Whale/")?HA:Ue(t,"DuckDuckGo/")||Ue(t,"Ddg/")?zA:Ue(t,"Claude/")?ZA:Ue(t,"Codex/")?WA:Ue(t,"ChatGPT/")?qA:Ue(t,"FBIOS")?"Facebook Mobile":Ue(t,"UCWEB")||Ue(t,"UCBrowser")?"UC Browser":Ue(t,"CriOS")?AA:Ue(t,"CrMo")||Ue(t,Q0)?Q0:Ue(t,hh)&&Ue(t,Y0)?LA:Ue(t,"FxiOS")?OA:Ue(t.toLowerCase(),_2.toLowerCase())?_2:Ue(t,"Brave/")?w2:((i,o)=>o&&Ue(o,"Apple")||(function(l){return Ue(l,Y0)&&!Ue(l,Q0)&&!Ue(l,hh)})(i))(t,e)?Ue(t,ad)?NA:Y0:Ue(t,"PaleMoon/")?UA:Ue(t,"Waterfox/")?BA:Ue(t,X0)?X0:Ue(t,"MSIE")||Ue(t,"Trident/")?TA:Ue(t,"Gecko")?X0:"")},m$={[RA]:[new RegExp("rv:(\\d+(\\.\\d+)?)")],[IA]:[new RegExp("Edge?\\/(\\d+(\\.\\d+)?)")],[Q0]:[new RegExp("(Chrome|CrMo)\\/(\\d+(\\.\\d+)?)")],[AA]:[new RegExp("CriOS\\/(\\d+(\\.\\d+)?)")],"UC Browser":[new RegExp("(UCBrowser|UCWEB)\\/(\\d+(\\.\\d+)?)")],[Y0]:[py],[NA]:[py],[MA]:[new RegExp("(Opera|OPR)\\/(\\d+(\\.\\d+)?)")],[X0]:[new RegExp("Firefox\\/(\\d+(\\.\\d+)?)")],[OA]:[new RegExp("FxiOS\\/(\\d+(\\.\\d+)?)")],[_2]:[new RegExp("Konqueror[:/]?(\\d+(\\.\\d+)?)","i")],[Vg]:[new RegExp("BlackBerry (\\d+(\\.\\d+)?)"),py],[LA]:[new RegExp("android\\s(\\d+(\\.\\d+)?)","i")],[PA]:[new RegExp("SamsungBrowser\\/(\\d+(\\.\\d+)?)")],[$A]:[new RegExp("OculusBrowser\\/(\\d+(\\.\\d+)?)")],[FA]:[new RegExp("Vivaldi\\/(\\d+(\\.\\d+)?)")],[VA]:[new RegExp("YaBrowser\\/(\\d+(\\.\\d+)?)")],[HA]:[new RegExp("Whale\\/(\\d+(\\.\\d+)?)")],[w2]:[new RegExp("Brave\\/(\\d+(\\.\\d+)?)")],[ZA]:[my],[WA]:[my],[qA]:[my],[zA]:[new RegExp("(DuckDuckGo|Ddg)\\/(\\d+(\\.\\d+)?)")],[UA]:[new RegExp("PaleMoon\\/(\\d+(\\.\\d+)?)")],[BA]:[new RegExp("Waterfox\\/(\\d+(\\.\\d+)?)")],[GA]:[new RegExp("GSA\\/(\\d+(\\.\\d+)?)")],[TA]:[new RegExp("(rv:|MSIE )(\\d+(\\.\\d+)?)")],Mozilla:[new RegExp("rv:(\\d+(\\.\\d+)?)")]},g$=function(t,e,n,r){const s=KA(t,e,n,r),i=m$[s];if(le(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},I8=[[new RegExp("Xbox; Xbox (.*?)[);]","i"),t=>[Hg,t&&t[1]||""]],[new RegExp(Rm,"i"),[Rm,""]],[new RegExp(Mm,"i"),[Mm,""]],[jx,[Vg,""]],[new RegExp(hy,"i"),(t,e)=>{if(/Phone/.test(e)||/WPDesktop/.test(e))return[DA,""];if(new RegExp(ad).test(e)&&!/IEMobile\b/.test(e))return["Windows Mobile",""];const n=/Windows NT ([0-9.]+)/i.exec(e);if(n&&n[1]){let r=p$[n[1]]||"";return/arm/i.test(e)&&(r="RT"),[hy,r]}return[hy,""]}],[/((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=le(t[2])?t[3]:t[2]),["watchOS",e]}],[new RegExp("(Android (\\d+)\\.(\\d+)\\.?(\\d+)?|Android)","i"),t=>t&&t[2]?[hh,[t[2],t[3],t[4]||"0"].join(".")]:[hh,""]],[/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",""]]],YA=function(t){for(let e=0;I8.length>e;e++){const[n,r]=I8[e],s=n.exec(t),i=s&&(xn(r)?r(s,t):r);if(i)return i}return["",""]},QA=function(t){return h$.test(t)?Rm:f$.test(t)?Mm:d$.test(t)?Hg:new RegExp(y2,"i").test(t)?y2:new RegExp("(Windows Phone|WPDesktop)","i").test(t)?DA:/iPad/.test(t)?CA:/iPod/.test(t)?"iPod Touch":/iPhone/.test(t)?"iPhone":/(watch)(?: ?os[,/]|\d,\d\/)[\d.]+/i.test(t)?EA:jx.test(t)?Vg:/(kobo)\s(ereader|touch)/i.test(t)?"Kobo":new RegExp(M8,"i").test(t)?M8:/(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(ad).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)?hh:kA:new RegExp("(pda|Mobile)","i").test(t)?u$:new RegExp(Tm,"i").test(t)&&!new RegExp("Tablet pc","i").test(t)?jA:""},v$=function(t,e){var n;const r=QA(t);return r===CA||r===kA||r==="Kobo"||r==="Kindle Fire"||r===jA?Tm:r===Rm||r===Hg||r===Mm||r===y2?"Console":r===EA?"Wearable":r?ad:(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)?ad:Tm:"Desktop";var s,i,o},gy=/\bFBAV\/(\d+(?:\.\d+)*)/i,O8=[[/\bInstagram(?:[ /](\d+(?:\.\d+)*))?\b/i,"Instagram"],[/\bBarcelona[ /](\d+(?:\.\d+)*)?/i,"Threads"],[/\b(?:MessengerForiOS|(?:FBAN|FB_IAB)\/Orca-Android)\b/i,"Messenger",gy],[/\bFBAN\/EMA\b/i,"Facebook Lite",gy],[/\b(?:FBIOS|(?:FBAN|FB_IAB)\/(?:FB4A|FBIOS))\b/i,"Facebook",gy],[/\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"]],x2="[Truncated]",Xh="[Unserializable]";function ju(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 XA(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=Xh}Object.defineProperty(t,r,{value:s,enumerable:!0,writable:!0,configurable:!0})}return t}const J0=3e5;var JA=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,J0);if(!e)return this.ts=n,void(this.es=n+r);this.es=Math.max(this.es,Math.min(n+r,this.ts+J0))}remainingMs(){const t=Date.now();if(this.ts-5e3>t)return this.reset(),0;const e=Math.min(J0,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 y$=/^[0-9a-f]{8}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{12}$/i;function L8(t,e){return typeof(n=t)=="string"&&y$.test(n)?t:e();var n}function eT(t,e){const n=new Error(e);try{Object.defineProperty(n,"name",{value:t,writable:!0,enumerable:!0,configurable:!0})}catch{}return n}function qa(t){return t&&t.split("#")[0]}function N8(t){try{return t()}catch{return}}function tT(t,e){const n=setTimeout(t,e);return n!=null&&n.unref&&(n==null||n.unref()),n}function D8(t,e,n){return nT.apply(this,arguments)}function nT(){return(nT=Ht(function*(t,e,n){let r;try{return yield Promise.race([t,new Promise((s,i)=>{r=tT(()=>{try{n==null||n(),s()}catch(o){i(o)}},e)})])}finally{clearTimeout(r)}})).apply(this,arguments)}function Uf(t){return Uf=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},Uf(t)}function _$(t,e,n){return(e=(function(r){var s=(function(i){if(Uf(i)!="object"||!i)return i;var o=i[Symbol.toPrimitive];if(o!==void 0){var l=o.call(i,"string");if(Uf(l)!="object")return l;throw new TypeError("@@toPrimitive must return a primitive value.")}return String(i)})(r);return Uf(s)=="symbol"?s:s+""})(e))in t?Object.defineProperty(t,e,{value:n,enumerable:!0,configurable:!0,writable:!0}):t[e]=n,t}function j8(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?j8(Object(n),!0).forEach(function(r){_$(t,r,n[r])}):Object.getOwnPropertyDescriptors?Object.defineProperties(t,Object.getOwnPropertyDescriptors(n)):j8(Object(n)).forEach(function(r){Object.defineProperty(t,r,Object.getOwnPropertyDescriptor(n,r))})}return t}let yf,$8,F8,uu;function w$(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(uu&&V8(n,s,$8)&&V8(r,i,F8))return uu;$8=n?j({},n):void 0,F8=r?j({},r):void 0,uu={},(e=yf)!==null&&e!==void 0||(yf={});const o=(l,u)=>{for(const f of l){const h=u[f];if(!h)continue;const g=yf==null?void 0:yf[f];if(g){uu[g]=h;continue}const v=t(f);for(let x=v.length-1;x>=0;x--){var d;const _=(d=v[x])===null||d===void 0?void 0:d.filename;if(_){uu[_]=h,yf[f]=_;break}}}};return r&&o(i,r),n&&o(s,n),uu}function V8(t,e,n){return t&&n?e.length===Object.keys(n).length&&e.every(r=>t[r]===n[r]):t===n}var x$=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 Ht(function*(){for(const n of t)n.stacktrace&&n.stacktrace.frames&&He(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 Ht(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 u=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:u}):{type:"chained",source:o,synthetic:s.synthetic,exception_id:u,parent_id:i},f={type:s.type,value:s.value,mechanism:d};s.stack&&(f.stacktrace={type:"raw",frames:s.stack}),n.push(f),s.cause&&r(s.cause,u,"cause");for(const h of(l=s.errors)!==null&&l!==void 0?l:[])r(h,u,"member")};return r(t),n}buildParsingContext(t){var e;return{chunkIdMap:w$(this.stackParser),skipFirstLines:(e=t.skipFirstLines)!==null&&e!==void 0?e:1}}getAggregateErrors(t){try{if(Td(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 He(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=[],u={},d=(g,v,x=0)=>{const _=f(v,x),w=_.apply;if(_.apply=I=>{l.push(g);try{return w(I)}finally{l.pop()}},x>4||x>0&&l.indexOf(g)!==-1)return this.coerceFallback(_);const S=typeof g=="object"&&g!==null||typeof g=="function";if(x===0&&r>=50||S&&o.has(g))return;S&&o.add(g),x===0&&r++;const k=this.getAggregateErrors(g);let E,P;i||(i=!!k);try{if(E=this.applyCoercers(g,_),!E)throw u}catch(I){if(I===u)return void(x===0&&r--);if(!i)throw I;E=this.coerceFallback(_)}if(!k||r>=50)return E;try{P=k.length}catch{return E}if(!Number.isInteger(P)||0>P||P>4294967295)return E;const T=[];for(let I=0;50>r&&1e3>s&&P>I;I++){let M;s++;try{M=_.next(k[I])}catch{r++,M=this.coerceFallback(f(v+1))}M&&T.push(M)}return j(j({},E),{},{errors:T})},f=(g,v=0)=>j(j({},e),{},{syntheticException:g==0?e.syntheticException:void 0,mechanism:g==0?t:{},apply(x){const _=d(x,g,v+1);if(!_)throw u;return _},next:x=>d(x,g+1)}),h=f(n);return j(j({},h),{},{apply:g=>{var v;return(v=d(g,n))!==null&&v!==void 0?v:this.coerceFallback(h)}})}};const b$=/^([a-z][a-z0-9.+-]+):/i,S$=["http","https","file","blob","app","capacitor","ionic","webpack","webpack-internal","ng"];function k$(t){if(!t||t==="<anonymous>")return!1;const e=b$.exec(t);return!e||S$.includes(e[1].toLowerCase())}function b2(t,e,n,r,s){const i={platform:t,filename:e,function:n==="<anonymous>"?"?":n,in_app:k$(e)};return le(r)||(i.lineno=r),le(s)||(i.colno=s),i}const rT=(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]},C$=/^\s*at (\S+?)(?::(\d+))(?::(\d+))\s*$/i,E$=/^\s*at (?:(.+?\)(?: \[.+\])?|.*?) ?\((?:address at )?)?(?:async )?((?:<anonymous>|[-a-z]+:|.*bundle|\/)?.*?)(?::(\d+))?(?::(\d+))?\)?\s*$/i,P$=/\((\S*)(?::(\d+))(?::(\d+))\)/,A$=(t,e)=>{const n=C$.exec(t);if(n){const[,s,i,o]=n;return b2(e,s,"?",+i,+o)}const r=E$.exec(t);if(r){if(r[2]&&r[2].indexOf("eval")===0){const o=P$.exec(r[2]);o&&(r[2]=o[1],r[3]=o[2],r[4]=o[3])}const[s,i]=rT(r[1]||"?",r[2]);return b2(e,i,s,r[3]?+r[3]:void 0,r[4]?+r[4]:void 0)}},T$=/^\s*(.*?)(?:\((.*?)\))?(?:^|@)?((?:[-a-z]+)?:\/.*?|\[native code\]|[^@]*(?:bundle|\d+\.js)|\/[\w\-. /=]+)(?::(\d+))?(?::(\d+))?\s*$/i,R$=/(\S+) line (\d+)(?: > eval line \d+)* > eval/i,M$=(t,e)=>{const n=T$.exec(t);if(n){if(n[3]&&n[3].indexOf(" > eval")>-1){const i=R$.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]=rT(s,r),b2(e,r,s,n[4]?+n[4]:void 0,n[5]?+n[5]:void 0)}},H8=/\(error: (.*)\)/;function $x(t,e){return t.filename===e.filename&&t.function===e.function&&t.module===e.module&&t.lineno===e.lineno&&t.colno===e.colno}function I$(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(!$x(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 O$(t,e){const n=e.start+e.length,r=iT(t,e);r&&t.splice(n+r===t.length?n:e.start,r)}function sT(t,e){let n=e.start;for(;n>0&&$x(t[n-1],t[n-1+e.length]);)n--;return e.start-n}function iT(t,e){const n=e.start+e.length;let r=n;for(;t.length>r&&$x(t[r],t[r-e.length]);)r++;return r-n}function L$(t,e){const n=e[0];let r=t.length-(n?sT(t,n):0);for(const s of e)r-=iT(t,s);return r}function N$(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 D$=class{match(t){return this.isDOMException(t)||this.isDOMError(t)}coerce(t,e){const n=st(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 Am(t,"DOMException")}isDOMError(t){return Am(t,"DOMError")}},j$=class{match(t){return Td(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}}},$$=class{match(t){return!!Am(t,"ErrorEvent")&&(t.error!=null||this.ar(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.lr(t))!==null&&n!==void 0?n:r.stack,synthetic:!0})}ar(t){return st(t.message)&&t.message.length>0}lr(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(st(r.filename)&&r.filename.length!==0&&s!==0)return`Error
|
|
18
|
+
at ${r.filename}:${s}:${i}`}};const F$=/^(?:[Uu]ncaught (?:exception: )?)?(?:((?:Eval|Internal|Range|Reference|Syntax|Type|URI|)Error): )?(.*)$/i;var V$=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(F$);return r&&(e=r[1],n=r[2]),[e,n]}};const H$=["fatal","error","warning","log","info","debug"];function oT(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 z$=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(Dx(t))return t.constructor.name;const e="name"in t?t.name:void 0;return st(e)&&!zf(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: ${oT(t)}`}isSeverityLevel(t){return st(t)&&!zf(t)&&H$.indexOf(t)>=0}getStack(t){try{return st(t.stacktrace)&&t.stacktrace.length>0?t.stacktrace:st(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(Td(n))return n}}getObjectClassName(t){try{const e=Object.getPrototypeOf(t);return e?e.constructor.name:void 0}catch{return}}},U$=class{match(t){return Dx(t)}coerce(t,e){var n;const r=t.constructor.name;return{type:r,value:`${r} captured as exception with keys: ${oT(t)}`,stack:(n=e.syntheticException)===null||n===void 0?void 0:n.stack,synthetic:!0}}},B$=class{match(t){return bA(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}}},Z$=class{match(t){return Am(t,"PromiseRejectionEvent")||this.isCustomEventWrappingRejection(t)}isCustomEventWrappingRejection(t){if(!Dx(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 bA(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 Im="$message",Om="$timestamp",W$=new Set([Im,Om]),vy={enabled:!0,max_bytes:32768};function Lm(t){var e;return t?{enabled:(e=t.enabled)!==null&&e!==void 0?e:vy.enabled,max_bytes:G$(t.max_bytes,vy.max_bytes)}:j({},vy)}var q$=class{constructor(t){this.ns=[],this.ss=0,this.Mr=Lm(t)}setConfig(t){this.Mr=Lm(t),this.rs()}add(t){const e=(function(r){let s;try{s=wA(r)}catch{return}try{const i=JSON.parse(s);if(!nt(i))return;const o=i,l=o[Im],u=o[Om];return!st(l)||l.trim().length===0||!st(u)&&!hn(u)?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.Mr.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.Mr.max_bytes&&this.ns.length>0;){const t=this.ns.shift();t&&(this.ss-=t.bytes)}}};function G$(t,e){if(!hn(t)||t===1/0||t===-1/0)return e;const n=Math.floor(t);return 0>n?e:n}const z8=t=>{if(typeof t!="string")return t;try{return JSON.parse(t)}catch{return t}};function U8(t){return typeof t=="string"||t}function B8(t){return typeof t=="string"?t:void 0}const K$=["$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"],aT="NativeGzipValidationError",S2=t=>t.length>=2&&t[0]===31&&t[1]===139,Z8=(t,e)=>t===g2.GZipJS||e===g2.GZipJS||e==="gzip",W8=t=>!(!t||typeof t!="object")&&("name"in t?String(t.name):"")==="NotReadableError";let _f;const y0=t=>{throw eT(aT,`Native gzip produced invalid output: ${t}`)},Y$=(q8=Ht(function*(t,e){18>t.size&&y0("too-short");const n=new Uint8Array(yield t.slice(0,10).arrayBuffer());S2(n)&&n[2]===8||y0("invalid-header");const r=new DataView(yield t.slice(t.size-8).arrayBuffer());r.getUint32(0,!0)!==(i=>{const o=(()=>{if(_f)return _f;_f=[];for(let u=0;256>u;u++){let d=u;for(let f=0;8>f;f++)d=1&d?3988292384^d>>>1:d>>>1;_f[u]=d>>>0}return _f})();let l=4294967295;for(let u=0;i.length>u;u++)l=o[255&(l^i[u])]^l>>>8;return(4294967295^l)>>>0})(e)&&y0("invalid-crc");const s=e.length>>>0;r.getUint32(4,!0)!==s&&y0("invalid-size")}),function(t,e){return q8.apply(this,arguments)});var q8;function k2(){return k2=Ht(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=Ht(function*(f){try{yield o.abort(f)}catch{}throw f}),function(f){return r.apply(this,arguments)})),u=new Response(i.readable).blob(),[d]=yield Promise.all([u,l]);return yield Y$(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}),k2.apply(this,arguments)}function lT(t,e){if(t==null)return{};var n,r,s=(function(o,l){if(o==null)return{};var u={};for(var d in o)if({}.hasOwnProperty.call(o,d)){if(l.includes(d))continue;u[d]=o[d]}return u})(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 Ar="[redacted]",Q$=/^[A-Za-z0-9+/\n\r]+=*$/,X$=/^[A-Za-z0-9_-]+={0,2}$/,J$=/[-_]/,eF=/^data:[^,\s]*;base64,/i,tF=/^[A-Za-z0-9+/_-]+={0,2}$/,nF=/\bph[a-z]_[A-Za-z0-9_-]{20,}\b/g,rF=/^(authorization|cookie|set-cookie|x-api-key|api[-_]?key|api[-_]?token|access[-_]?token|refresh[-_]?token|token|password|secret|client[-_]?secret|private[-_]?key)$/i,cT=/[a-z][a-z0-9+.-]{0,63}:[^\s<>"]+/gi,sF=/[\s<>"]/,uT=new RegExp(cT.source,"i"),dT=/[a-z][a-z0-9+.-]{0,63}:\/\//i,iF=new RegExp(`^${dT.source}`,"i"),oF=new RegExp(dT.source,"gi"),aF=/(^|[-_./;])(auth|token|secret|password|passwd|pwd|credential|signature|sig|key|hmac|sas|bearer|jwt|session|sessionid)([-_./;]|$)/i,lF=/^(code|AWSAccessKeyId|GoogleAccessId|Policy)$/i,cF=/[\u00A0\u1680\u2000-\u200A\u202F\u205F\u3000]/g,uF=/[A-Za-z0-9._%+-]{1,64}@[A-Za-z0-9.-]{1,255}\.[A-Za-z]{2,24}/g,dF=/\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,fF=/(^|[^\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,hF=/\b\d{3}[ .-]\d{2}[ .-]\d{4}\b/g,pF=/\b\d(?:[ ./-]?\d){12,}\b/g,G8=/\d+/g,mF=/(^|[^\w+])((?:\+?1[ ./-]?)?(?:\(\d{3}\)[ ./-]?|\d{3}[ ./-])\d{3}[ ./-]\d{4})(?![\w])/g,gF=/(^|[^\w])(\+\d{1,3}(?:[ ./()-]{0,2}\d){7,13})(?![\w])/g;function C2(t){return(function(e){return rF.test(e)})(t)||aF.test(t)||lF.test(t)}function yy(t){return t.split("&",129).length>128}function vF(t,e,n){return C2(t)||e.includes(";")&&(function(r){return r.split(";").some(s=>C2(s.split("=",1)[0]))})(e)?Ar:uT.test(e)?n?Fx(e,{allowNestedUrls:!1,stripPunctuation:!0}):Ar:e}function fT(t,e){const n=new URLSearchParams;let r=!1,s=!1;for(const[i,o]of new URLSearchParams(t)){const l=Nm(i),u=Nm(o);r||(r=l!==i||u!==o);const d=vF(l,u,e);r||(r=d!==u),s=C2(l)||d!==u,n.append(l,d)}return{changed:r,lastFieldSensitive:s,serialized:n.toString()}}function K8(t,e){if(!t.includes("="))return{value:yF(t,e),lastFieldSensitive:!1};const n=fT(t,e);return{value:n.changed?n.serialized:t,lastFieldSensitive:n.lastFieldSensitive}}function yF(t,e){return e?Fx(t,{allowNestedUrls:!1,stripPunctuation:!0}):uT.test(t)?Ar:t}function _F(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 _y(t,e){var n;if(t.length>8192&&iF.test(t))return Ar;const{address:r,suffix:s}=e.stripPunctuation?(function(w){let S=w.length;for(;S>0&&".,;:!?)]}'".includes(w[S-1]);)S--;return{address:w.slice(0,S),suffix:w.slice(S)}})(t):{address:t,suffix:""};let i;try{i=new URL(r)}catch{return Ar+s}const o=i.search.slice(1),l=i.hash!=="",u=(function(w){const S=w.slice(1),k=S.indexOf("?");return 0>k?{head:S,tail:null}:{head:S.slice(0,k),tail:S.slice(k+1)}})(i.hash);if(yy(o)||yy(u.head)||yy((n=u.tail)!==null&&n!==void 0?n:""))return Ar+s;let d=!1;(i.username||i.password)&&(i.username=Ar,i.password="",d=!0);const f=fT(o,e.allowNestedUrls);f.changed&&(i.search=f.serialized,d=!0);const h=K8(u.head,e.allowNestedUrls),g=u.tail===null?null:(v=u.tail,h.lastFieldSensitive?{value:v===""?"":Ar,lastFieldSensitive:!0}:K8(v,e.allowNestedUrls));var v;const x=g===null?h.value:`${h.value}?${g.value}`;x!==i.hash.slice(1)&&(i.hash=x,d=!0);const _=l?g??h:f;return(d?Nm(i.toString()):r)+(_.lastFieldSensitive?"":s)}function Fx(t,e){return t.replace(cT,n=>(function(r,s){const i=(function(u){if(!u.includes("://"))return[];const d=[...u.matchAll(oF)].map(_=>_.index),f=[],h={query:!1,fragment:!1,fragmentQuery:!1};let g=0,v=!1,x="";for(let _=0;u.length>_&&d.length>g;_++){d[g]===_&&(_>0&&x!=="="&&f.push(_),g++);const w=u[_];_F(w,h,x)?(x=w,v=!0):v&&"=&".includes(w)&&(x=w)}return f})(r);if(i.length===0)return _y(r,s);let o="",l=0;for(const u of i)o+=_y(r.slice(l,u),j(j({},s),{},{stripPunctuation:!1})),l=u;return o+_y(r.slice(l),s)})(n,j(j({},e),{},{stripPunctuation:e.stripPunctuation&&n.length!==t.length})))}function Nm(t){return t.replace(nF,Ar)}function hT(t,e){return(function(n){return n.length>=10240&&(Q$.test(n)||(function(r){const s=eF.exec(r);if(!s)return!1;let i;try{i=decodeURIComponent(r.slice(s[0].length))}catch{return!1}return tF.test(i.replace(/[\r\n]/g,""))})(n)||J$.test(n)&&X$.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,u){let d=u;for(;d>0&&!sF.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 Fx(r,{allowNestedUrls:!0,stripPunctuation:!0})})((function(r){let s=r.replace(cF," ");return s=s.replace(uF,Ar),s=s.replace(dF,Ar),s=s.replace(fF,`$1${Ar}`),s=s.replace(pF,xF),s=s.replace(hF,Ar),s=s.replace(mF,`$1${Ar}`),s=s.replace(gF,`$1${Ar}`),s})(Nm(n))),e)}function wF(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 xF(t){const e=[];for(let i=G8.exec(t);i!==null;i=G8.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&&wF(i)&&(o=l);0>o?s++:(n+=t.slice(r,e[s].start)+Ar,r=e[o].end,s=o+1)}return n+t.slice(r)}const bF={}.propertyIsEnumerable;function Dm(t,e){try{return pT(t,e,{ancestors:new WeakSet,remainingNodes:1e4},0)}catch{return[]}}function Vx(t,e,n,r){if(0>=n.remainingNodes)return{stringValue:x2};if(n.remainingNodes--,Hr(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:ju(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:x2};if(t instanceof Date){const s=t.getTime(),i=Number.isFinite(s)?t.toISOString():String(t);return{stringValue:typeof i=="string"?ju(i):String(i)}}n.ancestors.add(t);try{try{const s=t.toJSON;if(typeof s=="function")return Vx(s.call(t),e,n,r+1)}catch{}return He(t)?{arrayValue:{values:SF(t,e,n,r+1)}}:{kvlistValue:{values:pT(t,e,n,r+1)}}}finally{n.ancestors.delete(t)}}return{stringValue:ju(String(t))}}function SF(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(Xe(l))continue;s.push(Vx(l,e,n,r))}catch{s.push({stringValue:Xh})}return t.length>o&&s.push({stringValue:x2}),s}function pT(t,e,n,r){const s=[];for(const i in t)if(bF.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(ln(o)||le(o))continue;s.push({key:ju(i),value:Vx(o,e,n,r)})}catch{s.push({key:ju(i),value:{stringValue:Xh}})}}return s}function mT(t,e,n){return j(j(j(j({},XA({},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 kF=["service.name","deployment.environment","service.version","telemetry.sdk.name","telemetry.sdk.version"];function gT(t,e){const n=XA({},t),r={};for(const s of kF)({}).hasOwnProperty.call(n,s)&&(r[s]=n[s],delete n[s]);return[...Dm(n,e),...Dm(r,e)]}const Y8={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"},vT={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}},CF=vT.info;function EF(t){try{return ju(String(t))}catch{return Xh}}function PF(t,e,n,r){const s=t.level||"info",{text:i,number:o}=vT[s]||CF,l=(function(g=Date.now()){return String(g)+"000000"})(hn(r)?r:void 0),u={};e.distinctId&&(u.posthogDistinctId=e.distinctId),e.sessionId&&(u.sessionId=e.sessionId),e.windowId&&(u["window.id"]=e.windowId),Xe(e.sessionStartTimestamp)||(u.sessionStartTimestamp=String(e.sessionStartTimestamp)),Xe(e.lastActivityTimestamp)||(u.lastActivityTimestamp=String(e.lastActivityTimestamp)),e.currentUrl&&(u["url.full"]=e.currentUrl),e.screenName&&(u["screen.name"]=e.screenName),e.appState&&(u["app.state"]=e.appState),e.activeFeatureFlags&&e.activeFeatureFlags.length>0&&(u.feature_flags=e.activeFeatureFlags);const d=j({},u),f=t.attributes;if(f){let g=[];try{g=Object.keys(f)}catch{g=[]}for(const v of g){let x;try{x=f[v]}catch{x=Xh}Object.defineProperty(d,v,{value:x,enumerable:!0,writable:!0,configurable:!0})}}const h={timeUnixNano:l,observedTimeUnixNano:l,severityNumber:o,severityText:i,body:{stringValue:EF(t.body)},attributes:Dm(d,n)};return t.trace_id&&(h.traceId=t.trace_id),t.span_id&&(h.spanId=t.span_id),le(t.trace_flags)||(h.flags=t.trace_flags),h}function yT(t,e,n){return mT(t,e,n)}function _T(t,e,n,r){return{resourceLogs:[{resource:{attributes:gT(e)},scopeLogs:[{scope:{name:n,version:r},logRecords:t}]}]}}var wT=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=tT(()=>{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 xT(){return .75+.5*Math.random()}function bT(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 AF=class{constructor(t,e,n,r,s,i=()=>Promise.resolve(),o){var l;this._instance=t,this.Mr=e,this.A=n,this.hs=r,this.ds=s,this.vs=i,this.fs=o,this.ps=new wT(()=>this.gs()),this.ys=null,this.bs=0,this._s=0,this.ws=new JA,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.Ps=e.rateCapWindowMs,this.Rs=e.maxLogsPerInterval}clearQueue(){this._s++,this._instance.setPersistedProperty($i.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.Mr.maxBatchRecordsPerPost}onReconnect(){this.ks=0,this.Ss=1,this.ws.isOpen()?this.As()&&this.Fs():this.gs()}captureLog(t,e){var n;if(this._instance.isDisabled||this._instance.optedOut||!(t!=null&&t.body))return;const r=this.Os(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:PF(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))}Os(t){const e=this.Mr.beforeSend;if(!e)return t;const n=He(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.Ps>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.Ps}ms`),this.Cs=!0),!1)}flush(){var t=this;return Ht(function*(){if(!t._instance.isDisabled)return t.ys||(t.ys=t.Ns().finally(()=>{t.ys=null})),t.ys})()}Ns(){var t=this;return Ht(function*(){var e;t.ps.clear();let n=(e=t._instance.getPersistedProperty($i.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 u=Math.min(n.length,t.Es),d=n.slice(0,u),f=_T(d.map(g=>g.record),t.qs(),(i=t.fs)!==null&&i!==void 0?i:t._instance.getLibraryId(),t._instance.getLibraryVersion()),h=yield t._instance.js(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.Mr.maxBatchRecordsPerPost>t.Es&&(t.Es=Math.min(t.Mr.maxBatchRecordsPerPost,t.Es+1)),yield t.Bs(d.length),n=(o=t._instance.getPersistedProperty($i.LogsQueue))!==null&&o!==void 0?o:[],s+=d.length,h.kind==="fatal"))throw h.error}})()}Bs(t){var e=this;return Ht(function*(){var n;const r=Math.max(0,t-e.bs),s=(n=e._instance.getPersistedProperty($i.LogsQueue))!==null&&n!==void 0?n:[];e._instance.setPersistedProperty($i.LogsQueue,s.slice(r)),yield e.vs()})()}qs(){return yT(this.Mr,this._instance.getLibraryId(),this._instance.getLibraryVersion())}Ls(t){var e;if(this._instance.optedOut)return;const n=(e=this._instance.getPersistedProperty($i.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($i.LogsQueue,n),this.Ts>n.length||this.ws.isOpen()?this.Fs():this.gs()}Fs(){this.ps.pending||this.ps.arm(Math.max(this.Ms,this.ws.remainingMs()))}zs(){return Math.max(bT(this.Ms,this.ks,this.Ss,3e4),this.ws.remainingMs())}As(){const t=this._instance.getPersistedProperty($i.LogsQueue);return!!t&&t.length>0}shutdown(t){var e=this;return Ht(function*(){e.ps.clear();const n=e.flush().catch(()=>{});t!==void 0?yield D8(n,t):yield n})()}flushWithTimeout(t){var e=this;return Ht(function*(){const n=e.flush();yield D8(n,t,()=>{n.catch(()=>{})})})()}gs(){this.flush().then(()=>{this.ks=0,this.Ss=1},t=>{this.ks++,this.Ss=xT(),this.A.error("PostHog logs flush failed:",t)}).finally(()=>{!this._instance.isDisabled&&this.As()&&this.ps.armNoEarlierThan(this.zs())})}};const TF=/^[0-9a-f]+$/;function Q8(t,e,n){return typeof t=="string"&&t.length===e&&t!==n&&TF.test(t)}const RF=/^([0-9a-f]{2})-([0-9a-f]{32})-([0-9a-f]{16})-([0-9a-f]{2})(-.*)?$/,MF="00",wy=[0,5,10,25,50,75,100,250,500,750,1e3,2500,5e3,7500,1e4];function E2(t){return String(t)+"000000"}function X8(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 IF=class{constructor(t,e,n){this._instance=t,this.Mr=e,this.A=n,this.Hs=new Map,this.ps=new wT(()=>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 JA,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=Ht(function*(){e&&(yield e.catch(()=>{})),yield t.Zs()});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.Js(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.Os(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=X8(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.Xs(s,e.value);const o=this.Ys();o&&(s.exemplar=j(j({},o),{},{value:e.value,timeMs:Date.now()})),this.Fs()}Ys(){try{var t,e;const n=(function(r){const s=(function(o){if(typeof o!="string")return;const l=RF.exec(o.trim());if(!l)return;const[,u,d,f,h,g]=l;return u==="ff"||u==="00"&&g||!(function(v){return Q8(v,32,"00000000000000000000000000000000")})(d)||!(function(v){return Q8(v,16,"0000000000000000")})(f)?void 0:{version:u,traceId:d,spanId:f,flags:h}})(r);return s&&{traceId:s.traceId,spanId:s.spanId,flags:(i=s.flags,1&parseInt(i,16)?"01":MF)};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.Mr.maxSeriesPerFlush>this.Hs.size||(this.Us||(this.Us=!0,this.A.warn(`Metric series cap reached (${this.Mr.maxSeriesPerFlush} per flush window); dropping new series until the next flush. Reduce attribute cardinality.`)),!1)}Xs(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(wy.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,wy)]+=1;break}}}Os(t){const e=this.Mr.beforeSend;if(!e)return t;const n=He(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}Fs(){this.ps.pending||this.ps.arm(this.zs())}zs(){return Math.max(bT(this.Mr.flushIntervalMs,this.ks,this.Ss,3e4),this.ws.remainingMs())}Zs(){var t=this;return Ht(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.co(t.Js(e));if(n===t.Gs)switch(t.ws.record(r),r.kind==="retry-later"?(t.ks++,t.Ss=xT()):(t.ks=0,t.Ss=1),t.ps.pending&&t.ps.arm(t.zs()),r.kind){case"ok":return;case"retry-later":return t.ho(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)}})()}Js(t){return e=this.do(t),n=(function(i,o,l){return mT(i,o,l)})(this.Mr,this._instance.getLibraryId(),this._instance.getLibraryVersion()),r=this._instance.getLibraryId(),s=this._instance.getLibraryVersion(),{resourceMetrics:[{resource:{attributes:gT(n)},scopeMetrics:[{scope:{name:r,version:s},metrics:e}]}]};var e,n,r,s}do(t){const e=E2(Date.now()),n=new Map;for(const o of t.values()){var r;const l=X8(o.type,o.name,o.unit,void 0);let u=n.get(l);u||(u=j({name:o.name},o.unit&&{unit:o.unit}),o.type==="count"?u.sum={aggregationTemporality:1,isMonotonic:!0,dataPoints:[]}:o.type==="gauge"?u.gauge={dataPoints:[]}:u.histogram={aggregationTemporality:1,dataPoints:[]},n.set(l,u));const d=Dm((r=o.attributes)!==null&&r!==void 0?r:{},this.A),f=E2(o.windowStartMs),h=OF(o.exemplar);if(o.type==="count"){var s;const g=j({attributes:d,startTimeUnixNano:f,timeUnixNano:e,asDouble:(s=o.total)!==null&&s!==void 0?s:0},h);u.sum.dataPoints.push(g)}else if(o.type==="gauge"){var i;const g=j({attributes:d,timeUnixNano:e,asDouble:(i=o.last)!==null&&i!==void 0?i:0},h);u.gauge.dataPoints.push(g)}else if(o.hist){const g=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:wy},h);u.histogram.dataPoints.push(g)}}return Array.from(n.values())}ho(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 OF(t){return t?{exemplars:[{filteredAttributes:[],timeUnixNano:E2(t.timeMs),asDouble:t.value,traceId:t.traceId,spanId:t.spanId}]}:{}}const ST=(t,{debugEnabled:e}={})=>{const n={N(r,...s){let i;try{i=typeof window>"u"?void 0:window}catch{return}i&&($o.DEBUG||i.POSTHOG_DEBUG||e)&&!le(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)=>ST(`${t} ${r}`,s)};return n},me=ST("[PostHog.js]"),tn=me.createLogger,LF=tn("[ExternalScriptsLoader]"),jm=t=>{const e=he==null?void 0:he.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]}},Zl=(t,e,n)=>{if(t.config.disable_external_dependency_loading)return LF.warn(`${e} was requested but loading of external scripts is disabled.`),n("Loading of external scripts is disabled");const r=jm(e);if(r){if(r.__posthog_loading_callback_fired)return n();const i=r.__posthog_loading_error;return i?n(i):(r.addEventListener("load",o=>{r.__posthog_loading_callback_fired=!0,n(void 0,o)}),void r.addEventListener("error",o=>{r.__posthog_loading_error=o,n(o)}))}const s=()=>{if(!he)return n("document not found");if(jm(e))return Zl(t,e,n);let i=he.createElement("script");if(i.type="text/javascript",i.crossOrigin="anonymous",i.src=e,i.onload=l=>{i.__posthog_loading_callback_fired=!0,n(void 0,l)},i.onerror=l=>{i.__posthog_loading_error=l,n(l)},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.external_scripts_inject_target==="head")he.head.appendChild(i);else{const l=he.querySelectorAll("body > script");var o;l.length>0?(o=l[0].parentNode)===null||o===void 0||o.insertBefore(i,l[0]):he.body.appendChild(i)}};he!=null&&he.body?s():he==null||he.addEventListener("DOMContentLoaded",s)},xy={},J8=(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)};We.__PosthogExtensions__=We.__PosthogExtensions__||{},We.__PosthogExtensions__.loadExternalDependency=(t,e,n)=>{if(e==="remote-config"){const s=t.requestRouter.endpointFor("assets",`/array/${t.config.token}/config.js`);return void Zl(t,s,n)}const r=t.config.strict_script_versioning;if(r){const s=t.requestRouter.endpointFor("assets",`/static/${t.version}/${e}.js`),i=xy[s];if(r==="fallback"&&i){if(jm(i))return void Zl(t,i,n);delete xy[s]}return void Zl(t,s,r==="fallback"?(o,l)=>{if(o)if(typeof o=="string")n(o);else{var u;const d=J8(t,e);xy[s]=d;const f=jm(s);f==null||(u=f.parentNode)===null||u===void 0||u.removeChild(f),Zl(t,d,n)}else n(void 0,l)}:n)}Zl(t,J8(t,e),n)},We.__PosthogExtensions__.loadSiteApp=(t,e,n)=>{const r=t.requestRouter.endpointFor("api",e);Zl(t,r,n)},$o.DEBUG=!1,$o.LIB_VERSION="1.438.10",$o.LIB_NAME="web";var ts=$o;const P2="$early_access_features",No="$active_feature_flags",cc="$feature_flag_details",ph="$feature_flag_errors",Ua="$feature_flag_evaluated_at",uc="$feature_flag_request_id",Bf="$minimal_flag_called_events",_i="$enabled_feature_flags",Na="$stored_group_properties",Da="$stored_person_properties",ja="$flag_call_reported",Lf="$flag_call_reported_session_id",$a="$feature_flag_payloads",ji="$override_feature_flags",Wl="$override_feature_flag_payloads",mh="visibilitychange",NF="$people_distinct_id",hi="distinct_id",Hx="$device_id",by="$device_model",$m="__alias",DF="__cmpns",ek="$fbc",$u="$fbc_persistence",tk="$fbp",Zf="$fbp_persistence",A2="__timers",kT="$autocapture_disabled_server_side",T2="$heatmaps_enabled_server_side",R2="$exception_capture_enabled_server_side",CT="$error_tracking_suppression_rules",M2="$error_tracking_capture_extension_exceptions",I2="$web_vitals_enabled_server_side",zx="$dead_clicks_enabled_server_side",Ux="$product_tours_enabled_server_side",ET="$logs_capture_enabled_server_side",PT="$web_vitals_allowed_metrics",Wf="$session_recording_remote_config",jF="$session_recording_enabled_server_side",$F="$replay_sample_rate",FF="$replay_override_sampling",VF="$replay_override_linked_flag",HF="$replay_override_url_trigger",zF="$replay_override_event_trigger",Au="$sesid",AT="$session_is_sampled",UF="$session_past_minimum_duration",BF="$session_recording_url_trigger_activated_session",ZF="$session_recording_event_trigger_activated_session",WF="$debug_first_full_snapshot_timestamp",qF="$sess_rec_flush_size",TT="$groups",Nf="$surveys",Fm="$surveys_loaded_at",RT="$surveys_activated",MT="$surveys_activated_session",IT="$surveys_activated_timestamps",O2="ph_product_tours",GF="$product_tours_activated",KF="$product_tours_activated_session",YF="$conversations_widget_session_id",QF="$conversations_ticket_id",XF="$conversations_widget_state",JF="$conversations_user_traits",Vr="$user_state",L2="$client_session_props",eV="$capture_rate_limit",OT="$initial_campaign_params",LT="$initial_referrer_info",Tu="$initial_person_info",Bx="$epp",Sy="$posthog_cookieless",NT="$cookieless_mode",DT="$sdk_debug_extensions_init_method",jT="$sdk_debug_extensions_init_time_ms",Zx="$sdk_debug_recording_script_not_loaded",Wx="$sdk_debug_replay_stale_config",$T="$sdk_debug_replay_event_trigger_status",FT="$sdk_debug_replay_linked_flag_trigger_status",VT="$sdk_debug_replay_matched_recording_trigger_groups",HT="$sdk_debug_replay_pending_trigger_conditions",zT="$sdk_debug_replay_remote_trigger_matching_config",UT="$sdk_debug_replay_trigger_groups_count",BT="$sdk_debug_replay_url_trigger_status",tV="$session_recording_start_reason",qx="PostHog loadExternalDependency extension not found.",Do="anonymous",em="identified",ZT="identified_only",Vm="beforeunload",Gx="$pageview",nk="$pageleave",WT="$identify",rk="$groupidentify";function Ru(t,e){He(t)&&t.forEach(e)}function At(t,e){if(!Xe(t))if(He(t))t.forEach(e);else if((n=>n instanceof FormData)(t))t.forEach((n,r)=>e(n,r));else for(const n in t)Nx.call(t,n)&&e(t[n],n)}const Gt=function(t,...e){for(const n of e)for(const r in n)n[r]!==void 0&&(t[r]=n[r]);return t};function tm(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 nV=function(t){return function(...e){try{return t.apply(this,e)}catch(n){me.critical("Implementation error. Please turn on debug mode and open a ticket on https://app.posthog.com/home#panel=support%3Asupport%3A."),me.critical(n)}}},Kx=function(t){const e={};return At(t,function(n,r){(st(n)&&n.length>0||hn(n))&&(e[r]=n)}),e};function qT(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 rV=["herokuapp.com","vercel.app","netlify.app"];function sV(t){const e=t==null?void 0:t.hostname;if(!st(e))return!1;const n=e.split(".").slice(-2).join(".");for(const r of rV)if(n===r)return!1;return!0}function St(t,e,n,r){const{capture:s=!1,passive:i=!0}=r??{};t==null||t.addEventListener(e,n,{capture:s,passive:i})}function N2(t){return t.name==="ph_toolbar_internal"}const qf=t=>{if(he){try{const e=t+"=",n=he.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}};Math.trunc||(Math.trunc=function(t){return 0>t?Math.ceil(t):Math.floor(t)}),Number.isInteger||(Number.isInteger=function(t){return hn(t)&&isFinite(t)&&Math.floor(t)===t});var iV=class D2{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 D2(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 D2(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}},oV=class{generate(){const t=this.generateOrAbort();if(!le(t))return t;{this.Ct=0;const e=this.generateOrAbort();if(le(e))throw new Error("Could not generate UUID after timestamp reset");return e}}generateOrAbort(){const t=(()=>{const e=Date.now();return hn(e)&&isFinite(e)?Math.min(Math.max(Math.floor(e),0),0xffffffffffff):0})();if(t>this.Ct)this.Ct=t,this.It();else{if(this.Ct>=t+1e4)return;this.Mt++,this.Mt>4398046511103&&(this.Ct++,this.It())}return iV.fromFieldsV7(this.Ct,Math.trunc(this.Mt/Math.pow(2,30)),this.Mt&Math.pow(2,30)-1,this.Tt.nextUint32())}It(){this.Mt=1024*this.Tt.nextUint32()+(1023&this.Tt.nextUint32())}constructor(){this.Ct=0,this.Mt=0,this.Tt=new aV}};let GT=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};te&&!le(te.crypto)&&crypto.getRandomValues&&(GT=t=>crypto.getRandomValues(t));var aV=class{nextUint32(){return this.Rt.length>this.Et||(GT(this.Rt),this.Et=0),this.Rt[this.Et++]}constructor(){this.Rt=new Uint32Array(8),this.Et=1/0}};let sk;const wi=()=>lV().toString(),lV=()=>(sk||(sk=new oV)).generate();let wf="";const cV=/[a-z0-9][a-z0-9-]+\.[a-z]{2,}$/i;let du=null;const an={At(){if(!ln(du))return du;if(du=!1,he)try{const t=`__ph_cookie_support_${wi()}`;an.$t(t,"xyz"),du=qf(t)==='"xyz"',an.Pt(t)}catch{du=!1}return du},Lt(t){me.error("cookieStore error: "+t)},Ot:qf,Dt(t){let e;try{e=JSON.parse(an.Ot(t))||{}}catch{}return e},$t(t,e,n,r,s){if(!he)return!1;try{let i="",o="";const l=(function(d,f){if(f){let h=(function(g,v=he){if(wf)return wf;if(!v||["localhost","127.0.0.1"].includes(g))return"";const x=g.split(".");let _=Math.min(x.length,8);const w="dmn_chk_"+wi();for(;!wf&&_--;){const S=x.slice(_).join("."),k=w+"=1;domain=."+S+";path=/";v.cookie=k+";max-age=3",v.cookie.includes(w)&&(v.cookie=k+";max-age=0",wf=S)}return wf})(d);if(!h){const g=(v=>{const x=v.match(cV);return x?x[0]:""})(d);g!==h&&me.info("Warning: cookie subdomain discovery mismatch",g,h),h=g}return h?"; domain=."+h:""}return""})(he.location.hostname,r);if(n){const d=new Date;d.setTime(d.getTime()+864e5*n),i="; expires="+d.toUTCString()}s&&(o="; secure");const u=t+"="+encodeURIComponent(JSON.stringify(e))+i+"; SameSite=Lax; path=/"+l+o;return u.length>3686.4&&me.warn("cookieStore warning: large cookie, len="+u.length),he.cookie=u,!0}catch{return!1}},Pt(t,e){if(he!=null&&he.cookie&&(!e||!ln(qf(t))))try{an.$t(t,"",-1,e)}catch{return}}};let ky=null;const vt={At(){if(!ln(ky))return ky;let t=!0;if(le(te))t=!1;else try{const e="__mplssupport__";vt.$t(e,"xyz"),vt.Ot(e)!=='"xyz"'&&(t=!1),vt.Pt(e)}catch{t=!1}return t||me.error("localStorage unsupported; falling back to cookie store"),ky=t,t},Lt(t){me.error("localStorage error: "+t)},Ot(t){try{return te==null?void 0:te.localStorage.getItem(t)}catch(e){vt.Lt(e)}return null},Dt(t){try{return JSON.parse(vt.Ot(t))||{}}catch{}return null},$t(t,e){try{return te==null||te.localStorage.setItem(t,JSON.stringify(e)),!0}catch(n){vt.Lt(n)}return!1},Pt(t){try{te==null||te.localStorage.removeItem(t)}catch(e){vt.Lt(e)}}},Cy=[Da,No,_i,cc,$a,uc,Ua,ph,ja],ql=[Hx,hi,Au,AT,Bx,Tu,$u,Vr],Hm=t=>t+"_cpm",uV=["__proto__","constructor","prototype"],Ey=t=>{if(!nt(t))return{};const e={};return Object.keys(t).forEach(n=>{uV.indexOf(n)===-1&&(e[n]=t[n])}),e},Py=(t,e=[])=>{const n={};return[...ql,...e].forEach(r=>{const s=t[r];le(s)||ln(s)||s===""||(n[r]=s)}),n},KT=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)},ik=(t,e)=>({p:e,f:KT(JSON.stringify(t))}),ok=(t,e)=>{if(!e)return{properties:[],isValid:!1};try{const n=an.Dt(Hm(t)),r=(n==null?void 0:n.f)===KT(e)&&He(n.p);return{properties:r?n.p:[],isValid:r}}catch{return{properties:[],isValid:!1}}},Ay=(t,e)=>e+"|"+(an.Ot(Hm(t))||""),fu={},j2={At:()=>!0,Lt(t){me.error("memoryStorage error: "+t)},Ot:t=>t in fu?fu[t]:null,Dt:t=>t in fu?fu[t]:null,$t:(t,e)=>(fu[t]=e,!0),Pt(t){delete fu[t]}};let Il=null;const Vt={At(){if(!ln(Il))return Il;if(Il=!0,le(te))Il=!1;else try{const t="__support__";Vt.$t(t,"xyz"),Vt.Ot(t)!=='"xyz"'&&(Il=!1),Vt.Pt(t)}catch{Il=!1}return Il},Lt(t){me.error("sessionStorage error: ",t)},Ot(t){try{return te==null?void 0:te.sessionStorage.getItem(t)}catch(e){Vt.Lt(e)}return null},Dt(t){try{return JSON.parse(Vt.Ot(t))||null}catch{}return null},$t(t,e){try{return te==null||te.sessionStorage.setItem(t,JSON.stringify(e)),!0}catch(n){Vt.Lt(n)}return!1},Pt(t){try{te==null||te.sessionStorage.removeItem(t)}catch(e){Vt.Lt(e)}}};var dV=class{constructor(t){this._instance=t}get Mr(){return this._instance.config}get consent(){return this.Lo()?0:this.No}isOptedOut(){return this.Mr.cookieless_mode==="always"||this.isRejected()||this.consent===-1&&this.Mr.cookieless_mode==="on_reject"}isOptedIn(){return!this.isOptedOut()}isExplicitlyOptedOut(){return this.consent===0}isRejected(){return this.consent===0||this.consent===-1&&this.Mr.opt_out_capturing_by_default}optInOut(t){this.qo.$t(this.jo,t?1:0,this.Mr.cookie_expiration,this.Mr.cross_subdomain_cookie,this.Mr.secure_cookie)}reset(){this.qo.Pt(this.jo,this.Mr.cross_subdomain_cookie)}get jo(){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 No(){const t=this.qo.Ot(this.jo);return fy(t)?1:Ue(a$,t)?0:-1}get qo(){const t=this.Mr.opt_out_capturing_persistence_type,e=t==="localStorage"?vt:an,n=e.At()?e:j2;if(!this.Bo||this.Bo!==n){this.Bo=n;const r=t==="localStorage"?an:vt;r.Ot(this.jo)&&(this.Bo.Ot(this.jo)||this.optInOut(fy(r.Ot(this.jo))),r.Pt(this.jo,this.Mr.cross_subdomain_cookie))}return this.Bo}Lo(){return!!this.Mr.respect_dnt&&[gr==null?void 0:gr.doNotTrack,gr==null?void 0:gr.msDoNotTrack,We.doNotTrack,gr==null?void 0:gr.globalPrivacyControl].some(t=>fy(t))}};function YT(t,e){var n;const r=t==null||(n=t.config)===null||n===void 0?void 0:n.get_current_url;if(!xn(r))return e;try{const s=r(e);return st(s)&&s?s:e}catch(s){return me.error("Error in get_current_url, falling back to window.location.href",s),e}}function ak(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 ki(t){return!!t&&t.nodeType===1}function vr(t,e){return!!t&&!!t.tagName&&t.tagName.toLowerCase()===e.toLowerCase()}function QT(t){return!!t&&t.nodeType===3}function Yx(t){return!!t&&t.nodeType===11&&ki(t.host)}function Qx(t){return t?od(t).split(/\s+/):[]}function lk(t,e){const n=(function(r){var s;const i=te==null||(s=te.location)===null||s===void 0?void 0:s.href;return le(i)?void 0:YT(r,i)})(e);return!!(n&&t&&t.some(r=>n.match(r)))}function ld(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 Qx(e)}function XT(t){return Xe(t)?null:od(t).split(/(\s+)/).filter(e=>Fu(e)).join("").replace(/[\r\n]/g," ").replace(/[ ]+/g," ").substring(0,255)}function gh(t){let e="";return dc(t)&&!cd(t)&&t.childNodes&&t.childNodes.length&&At(t.childNodes,function(n){var r;QT(n)&&n.textContent&&(e+=(r=XT(n.textContent))!==null&&r!==void 0?r:"")}),od(e)}function Gf(t){var e;return le(t.target)?t.srcElement||null:!((e=t.target)===null||e===void 0)&&e.shadowRoot?t.composedPath()[0]||null:t.target||null}const Xx=["a","button","form","input","select","textarea","label"];function $2(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 F2(t,e){if(le(e))return!0;for(const n of t)if(e.some(r=>$2(n,r)))return!0;return!1}function JT(t){const e=t.parentNode;return!(!e||!ki(e))&&e}const Ty=[".ph-no-autocapture","[data-ph-no-autocapture]"],eR=["next","previous","prev",">","<","→","←","›","‹","»","«","▶","◀","❯","❮"],Jx=[...eR,"+","-","−","–"],ck=Jx.length+10,fV=["button","a","input","select","textarea","label"],hV=["button","link","tab","menuitem","option"],uk=(t,e)=>/[a-z0-9]/i.test(e)?Ue(Jx,e)?new RegExp(`\\b${e}\\b`).test(t):t.includes(e):t===e,pV=t=>Ue(fV,t.tagName.toLowerCase())||Ue(hV,(t.getAttribute("role")||"").toLowerCase());function Ry(t){let e="",n="";const r=o=>{ki(o)&&dc(o)&&!cd(o)&&(e+=` ${gh(o)}`,n=n||o.getAttribute("aria-label")||"",At(o.childNodes,r))};r(t),e=od(e.replace(/\s+/g," "));const s=(Fu(e)?e:"").toLowerCase(),i=t.getAttribute("aria-label")||(s?"":n);return{safeText:s,ariaLabel:od(i).toLowerCase()}}const dk=[".ph-no-rageclick",".ph-no-capture"],mV=["","text","search","email","password","url","tel","number"];function tR(t,e){if(!te||eb(t))return!1;let n,r,s;var i,o;if(Hr(e)?(n=!!e&&dk,r=void 0,s=!1):(n=(i=e==null?void 0:e.css_selector_ignorelist)!==null&&i!==void 0?i:dk,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(u){return!(!u||!ki(u))&&(!!vr(u,"textarea")||(vr(u,"input")?Ue(mV,(u.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===""})(u)))})(t))return!1;const{targetElementList:l}=nR(t,!1);return!(r&&(function(u,{safeText:d,ariaLabel:f}){let h;if(u===!0)h=eR;else{if(!He(u))return!1;if(u.length>ck)return me.error(`[PostHog] content_ignorelist array cannot exceed ${ck} items. Use css_selector_ignorelist for more complex matching.`),!1;h=u.map(g=>g.toLowerCase())}return h.some(g=>uk(d,g)||uk(f,g))})(r,(function(u,d){for(const f of d)if(pV(f))return Ry(f);for(const f of d){try{if((te==null?void 0:te.getComputedStyle(f).getPropertyValue("cursor"))!=="pointer")break}catch{break}const h=Ry(f);if(h.safeText||h.ariaLabel)return h}return Ry(u)})(t,l))||F2(l,n))}const eb=t=>!t||vr(t,"html")||!ki(t),nR=(t,e)=>{if(!te||eb(t))return{parentIsUsefulElement:!1,targetElementList:[]};let n=!1;const r=[t];let s=t;for(;s.parentNode&&!vr(s,"body");){if(Yx(s.parentNode)){r.push(s.parentNode.host),s=s.parentNode.host;continue}const i=JT(s);if(!i)break;if(e||Xx.indexOf(i.tagName.toLowerCase())>-1)n=!0;else try{const o=te.getComputedStyle(i);o&&o.getPropertyValue("cursor")==="pointer"&&(n=!0)}catch{}r.push(i),s=i}return{parentIsUsefulElement:n,targetElementList:r}};function dc(t){const e=new Set;let n=0;for(let i=t;i.parentNode&&!vr(i,"body");i=i.parentNode){if(n++>=1e3||e.has(i))return!1;e.add(i);const o=ld(i);if(Ue(o,"ph-sensitive")||Ue(o,"ph-no-capture"))return!1}if(Ue(ld(t),"ph-include"))return!0;const r=t.type||"";if(st(r))switch(r.toLowerCase()){case"hidden":case"password":return!1}const s=t.name||t.id||"";return!st(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 cd(t){return!!(vr(t,"input")&&!["button","checkbox","submit","reset"].includes(t.type)||vr(t,"select")||vr(t,"textarea")||t.getAttribute("contenteditable")==="true")}const fk=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}))$"),hk=/(^|[^0-9A-Za-z_])([0-9][0-9 -]*[0-9])(?=$|[^0-9A-Za-z_])/g,gV=[16,15,14,13],vV=new RegExp("^(\\d{3}-?\\d{2}-?\\d{4})$"),pk=new RegExp("(^|[^0-9])((?!000|666)[0-9]{3}-?(?!00)[0-9]{2}-?(?!0000)[0-9]{4})(?=$|([^0-9]))","g"),mk=/[0-9A-Za-z_]/;function yV(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 Fu(t,e=!0){return!(Xe(t)||st(t)&&(t=od(t),(e?fk.test((t||"").replace(/[- ]/g,"")):(function(n){let r;for(hk.lastIndex=0;r=hk.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 gV){const u=o+l;if(i.length>=u){const d=i.slice(o,u);if(fk.test(d)&&yV(d))return!0}}}return!1})(t))||(e?vV.test(t):(function(n){let r;for(pk.lastIndex=0;r=pk.exec(n);){const s=r[1],i=r[3];if(!(s&&i&&mk.test(s)&&mk.test(i)))return!0}return!1})(t))))}function gk(t){let e=gh(t);return e=`${e} ${rR(t)}`.trim(),Fu(e)?e:""}function rR(t){let e="";return t&&t.childNodes&&t.childNodes.length&&At(t.childNodes,function(n){var r;if(n&&((r=n.tagName)===null||r===void 0?void 0:r.toLowerCase())==="span")try{const s=gh(n);e=`${e} ${s}`.trim(),n.childNodes&&n.childNodes.length&&(e=`${e} ${rR(n)}`.trim())}catch(s){me.error("[AutoCapture]",s)}}),e}function vk(t){return t.replace(/"|\\"/g,'\\"')}function _V(t){const e=t.attr__class;if(e)return He(e)?e:Qx(e)}const _0=tn("[Dead Clicks]"),wV=()=>!0,xV=t=>{var e;const n=!!(!((e=t.instance.persistence)===null||e===void 0)&&e.get_property(zx)),r=t.instance.config.capture_dead_clicks;return Hr(r)?r:!!nt(r)||n};var yk=class{get lazyLoadedDeadClicksAutocapture(){return this.zo}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({[zx]:e.captureDeadClicks}),this.startIfEnabledOrStop())}startIfEnabledOrStop(){this.isEnabled(this)?this.Ho(()=>{this.Uo()}):this.stop()}Ho(t){var e,n,r;!((e=We.__PosthogExtensions__)===null||e===void 0)&&e.initDeadClicksAutocapture?t():(n=We.__PosthogExtensions__)===null||n===void 0||(r=n.loadExternalDependency)===null||r===void 0||r.call(n,this.instance,"dead-clicks-autocapture",s=>{s?_0.error("failed to load script",s):t()})}Uo(){var t;if(he){if(!this.zo&&(!((t=We.__PosthogExtensions__)===null||t===void 0)&&t.initDeadClicksAutocapture)){const e=nt(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.zo=We.__PosthogExtensions__.initDeadClicksAutocapture(this.instance,e),this.zo.start(he),_0.info("starting...")}}else _0.error("`document` not found. Cannot start.")}stop(){this.zo&&(this.zo.stop(),this.zo=void 0,_0.info("stopping..."))}};const xf=tn("[SegmentIntegration]");function _k(t,e,n=!0){const r=t.config.segment;if(!r)return e();const{analytics:s,filterProperties:i}=(l=>xn(l.register))(o=r)?{analytics:o}:o;var o;(function(l,u,d,f){const h=v=>{const x=()=>v.anonymousId()||wi();l.config.get_device_id=x,f&&v.id()&&(l.register({distinct_id:v.id(),$device_id:x()}),l.persistence.set_property(Vr,em)),d(f?void 0:v.anonymousId()||void 0)},g=u.user();"then"in g&&xn(g.then)?g.then(h):h(g)})(t,s,l=>{s.register(((u,d,{filterProperties:f}={})=>{typeof Promise<"u"&&Promise.resolve||xf.warn("This browser does not have Promise support, and can not use the segment integration");const h=(g,v)=>{if(!v)return g;const x=!!d&&g.event.anonymousId===d&&!g.event.userId;x||g.event.userId||g.event.anonymousId===u.get_distinct_id()||(xf.info("No userId set, resetting PostHog"),u.reset()),x||(d=void 0),g.event.userId&&g.event.userId!==u.get_distinct_id()&&(xf.info("UserId set, identifying with PostHog"),u.identify(g.event.userId));let _=u.calculateEventProperties(v,g.event.properties);if(!Xe(f)){const w=g.event.properties||{},S={};for(const E of Object.keys(_))Nx.call(w,E)||(S[E]=_[E]);const k=((E,P)=>{const T=He(E)?E:[E];let I=j({},P);for(const M of T)try{if(I=M(I),Xe(I))return null}catch(R){return xf.error("Error in Segment filterProperties:",R),null}return I})(f,S);if(Xe(k))return g;_=k}return g.event.properties=Object.assign({},_,g.event.properties),g};return{name:"PostHog JS",type:"enrichment",version:"1.0.0",isLoaded(){return!0},load(){return Promise.resolve()},track(g){return h(g,g.event.event)},page(g){return h(g,Gx)},identify(g){return h(g,WT)},screen(g){return h(g,"$screen")}}})(t,l,{filterProperties:i})).then(()=>{e()},u=>{xf.error("Failed to register the Segment integration",u),e()})},n)}const sR="posthog-js";function iR(t,{organization:e,projectId:n,prefix:r,severityAllowList:s=["error"],sendExceptionsToPostHog:i=!0}={}){return o=>{var l,u,d,f,h;if(s!=="*"&&!s.includes(o.level)||!t.__loaded)return o;o.tags||(o.tags={});const g=t.requestRouter.endpointFor("ui",`/project/${t.config.token}/person/${t.get_distinct_id()}`);o.tags["PostHog Person URL"]=g,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)||[],x=v.map(S=>j(j({},S),{},{stacktrace:S.stacktrace?j(j({},S.stacktrace),{},{type:"raw",frames:(S.stacktrace.frames||[]).map(k=>j(j({},k),{},{platform:"web:javascript"}))}):void 0})),_={$exception_message:((u=v[0])===null||u===void 0?void 0:u.value)||o.message,$exception_type:(d=v[0])===null||d===void 0?void 0:d.type,$exception_level:o.level,$exception_list:x,$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&&(_.$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(_)),o}}var bV=class{constructor(t,e,n,r,s,i){this.name=sR,this.setupOnce=function(o){o(iR(t,{organization:e,projectId:n,prefix:r,severityAllowList:s,sendExceptionsToPostHog:i==null||i}))}}},wk=class{constructor(t){this.Wo=(e,n,r)=>{r&&(r.noSessionId||r.activityTimeout||r.sessionPastMaximumLength||r.crossTabAdoption)&&(me.info("[PageViewManager] Session rotated, clearing pageview state",{sessionId:e,changeReason:r}),this.Vo=void 0,this._instance.scrollManager.resetContext())},this._instance=t,this.Go()}Go(){var t;this.Qo=(t=this._instance.sessionManager)===null||t===void 0?void 0:t.onSessionId(this.Wo)}destroy(){var t;(t=this.Qo)===null||t===void 0||t.call(this),this.Qo=void 0}doPageView(t,e){var n;const r=this.Zo(t,e);return this.Vo={pathname:(n=te==null?void 0:te.location.pathname)!==null&&n!==void 0?n:"",pageViewId:e,timestamp:t},this._instance.scrollManager.resetContext(),r}doPageLeave(t){var e;return this.Zo(t,(e=this.Vo)===null||e===void 0?void 0:e.pageViewId)}doEvent(){var t;return{$pageview_id:(t=this.Vo)===null||t===void 0?void 0:t.pageViewId}}Zo(t,e){const n=this.Vo;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:u,lastContentY:d,maxContentY:f}=s;if(!(le(i)||le(o)||le(l)||le(u)||le(d)||le(f))){i=Math.ceil(i),o=Math.ceil(o),l=Math.ceil(l),u=Math.ceil(u),d=Math.ceil(d),f=Math.ceil(f);const h=i>1?qi(o/i,0,1,me):1,g=i>1?qi(l/i,0,1,me):1,v=u>1?qi(d/u,0,1,me):1,x=u>1?qi(f/u,0,1,me):1;r=Gt(r,{$prev_pageview_last_scroll:o,$prev_pageview_last_scroll_percentage:h,$prev_pageview_max_scroll:l,$prev_pageview_max_scroll_percentage:g,$prev_pageview_last_content:d,$prev_pageview_last_content_percentage:v,$prev_pageview_max_content:f,$prev_pageview_max_content_percentage:x})}}return n.pathname&&(r.$prev_pageview_pathname=n.pathname),n.timestamp&&(r.$prev_pageview_duration=(t.getTime()-n.timestamp.getTime())/1e3),r}};const bf=["flags","surveys"],SV={[NF]:{exposure:"hidden"},[$m]:{exposure:"hidden"},[DF]:{exposure:"hidden"},[A2]:{exposure:"hidden"},[$u]:{exposure:"hidden"},[Zf]:{exposure:"hidden"},[kT]:{exposure:"event"},[T2]:{exposure:"hidden"},[ET]:{exposure:"hidden"},[R2]:{exposure:"event"},[CT]:{exposure:"hidden"},[M2]:{exposure:"event"},[I2]:{exposure:"event"},[zx]:{exposure:"event"},[Ux]:{exposure:"hidden"},[PT]:{exposure:"event"},[Wf]:{exposure:"hidden"},[jF]:{exposure:"hidden"},[Au]:{exposure:"hidden"},[AT]:{exposure:"event"},[$F]:{exposure:"event",shouldSkipFromEventProperties:t=>ln(t)},[UF]:{exposure:"event"},[BF]:{exposure:"event"},[ZF]:{exposure:"event"},[WF]:{exposure:"event"},[qF]:{exposure:"hidden"},[_i]:{exposure:"hidden",storageGroup:"flags"},[No]:{exposure:"hidden",storageGroup:"flags"},[P2]:{exposure:"hidden"},[cc]:{exposure:"hidden",storageGroup:"flags"},[$a]:{exposure:"hidden",storageGroup:"flags"},[uc]:{exposure:"hidden",storageGroup:"flags",volatile:!0},[Bf]:{exposure:"hidden",storageGroup:"flags"},[ji]:{exposure:"hidden"},[Wl]:{exposure:"hidden"},[Da]:{exposure:"hidden"},[Na]:{exposure:"hidden"},[Nf]:{exposure:"hidden",storageGroup:"surveys"},[Fm]:{exposure:"hidden",storageGroup:"surveys",volatile:!0},[RT]:{exposure:"event"},[MT]:{exposure:"hidden"},[IT]:{exposure:"hidden"},[O2]:{exposure:"hidden"},[GF]:{exposure:"hidden"},[KF]:{exposure:"hidden"},[YF]:{exposure:"event"},[QF]:{exposure:"event"},[XF]:{exposure:"event"},[JF]:{exposure:"event"},[ja]:{exposure:"hidden"},[Lf]:{exposure:"hidden"},[TT]:{exposure:"event"},[ph]:{exposure:"hidden"},[Ua]:{exposure:"hidden",storageGroup:"flags",volatile:!0},[Vr]:{exposure:"hidden"},[L2]:{exposure:"hidden"},[eV]:{exposure:"hidden"},[OT]:{exposure:"hidden"},[LT]:{exposure:"hidden"},[Tu]:{exposure:"hidden"},[Bx]:{exposure:"hidden"},[FF]:{exposure:"event"},[VF]:{exposure:"event"},[HF]:{exposure:"event"},[zF]:{exposure:"event"},[DT]:{exposure:"event"},[jT]:{exposure:"event"},[Zx]:{exposure:"hidden"},[Wx]:{exposure:"hidden"},[$T]:{exposure:"hidden"},[FT]:{exposure:"hidden"},[VT]:{exposure:"hidden"},[HT]:{exposure:"hidden"},[zT]:{exposure:"hidden"},[UT]:{exposure:"hidden"},[BT]:{exposure:"hidden"},[tV]:{exposure:"event"}},kV=[["$posthog_sr_group_event_trigger_",{exposure:"hidden"}],["$posthog_sr_group_url_trigger_",{exposure:"hidden"}],["$posthog_sr_group_sampling_",{exposure:"hidden"}]],ar=t=>{const e=SV[t];if(e)return e;for(const[n,r]of kV)if(t.indexOf(n)===0)return r};function oR(){try{return Intl.DateTimeFormat().resolvedOptions().timeZone}catch{return}}const aR=()=>{try{return"u">typeof window&&window.navigator.onLine!==!1}catch{return!1}},lR=(t,e)=>t>=e&&aR(),cR=(t,e,n,r)=>{if(t===0){if(aR()){const s=e+1;return s===n&&r(),s}return e}return 0},Mu=(t,e)=>{try{let n;return JSON.stringify(t,(r,s)=>{var i;return Td(s)?((i=n)!==null&&i!==void 0||(n=new WeakMap),n.has(s)||n.set(s,qT(s)),n.get(s)):typeof s=="bigint"?s.toString():s},e)}catch{return wA(t)}},Bo=t=>{const e=he==null?void 0:he.createElement("a");return le(e)?null:(e.href=t,e)},ud=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(!He(r)||2>r.length)return"";{let s=r[1];try{s=decodeURIComponent(s)}catch{me.error("Skipping decoding for malformed query param: "+s)}return s.replace(/\+/g," ")}},vh=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],u=(o||"").split("&"),d=[];for(let h=0;u.length>h;h++){const g=u[h].split("=");He(g)&&(e.includes(g[0])?d.push(g[0]+"="+n):d.push(u[h]))}let f=l;return o!=null&&(f+="?"+d.join("&")),s!=null&&(f+="#"+s),f},zm=function(t,e){const n=t.match(new RegExp(e+"=([^&]*)"));return n?n[1]:null},dd=["gclid","gclsrc","dclid","gbraid","wbraid","fbclid","msclkid","twclid","li_fat_id","igshid","ttclid","rdt_cid","epik","qclid","sccid","oppref","bfcid","irclid","_kx"],CV=["utm_source","utm_medium","utm_campaign","utm_content","utm_term","gad_source","mc_cid",...dd],yh="<masked>",EV=["li_fat_id"];function uR(t,e,n){if(!he)return{};const r=e?[...dd,...n||[]]:[],s=dR(vh(he.URL,r,yh),t),i=(function(){const o={};return At(EV,function(l){const u=qf(l);o[l]=u||null}),o})();return Gt(i,s)}function dR(t,e){const n=CV.concat(e||[]),r={};return At(n,function(s){const i=ud(t,s);r[s]=i||null}),r}function fR(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(!ln(e)){r.$search_engine=e;const s=he?ud(he.referrer,n):"";s.length&&(r.ph_keyword=s)}return r}function hR(){return navigator.language||navigator.userLanguage}function PV(){const t=hR();return typeof t=="string"?t.split("-")[0]:void 0}const Um="$direct";function pR(){return(he==null?void 0:he.referrer)||Um}function mR(t,e,n=!1){const r=t?[...dd,...e||[]]:[],s=n?qa(qt==null?void 0:qt.href):qt==null?void 0:qt.href,i=s==null?void 0:s.substring(0,1e3);return{r:pR().substring(0,1e3),u:i?vh(i,r,yh):void 0}}function gR(t,e=!1){var n;const{r,u:s}=t,i=e?qa(s):s,o={$referrer:r,$referring_domain:r==null?void 0:r==Um?Um:(n=Bo(r))===null||n===void 0?void 0:n.host};if(i){o.$current_url=i;const l=Bo(i);o.$host=l==null?void 0:l.host,o.$pathname=l==null?void 0:l.pathname;const u=dR(i);Gt(o,u)}if(r){const l=fR(r);Gt(o,l)}return o}function AV(){try{return new Date().getTimezoneOffset()}catch{return}}const TV={flags:Ua,surveys:Fm},RV=["cookie","localstorage","localstorage+cookie","sessionstorage","memory"],w0=t=>`${t}_cookie_identity_change_pending`,x0=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},Hn="main",Po=[_i,No,cc,$a,uc,Ua,Bf,Da],My=t=>Po.indexOf(t)!==-1,vR=[$u,Zf],xk=t=>vR.indexOf(t)!==-1,xa=(t,e)=>{try{return JSON.stringify(t)===JSON.stringify(e)}catch{return t===e}},hu=t=>{if(!t)return{};const e=JSON.parse(t);return nt(e)?e:{}},bk=(t,e)=>{At(t,(n,r)=>{const s=ar(r);s&&s.exposure!=="event"||{}.hasOwnProperty.call(e,r)||delete t[r]})};var Iy=class{constructor(t,e,n=!0,r=!t.cookieless_mode){if(this.Jo={},this.Ko=!1,this.Xo=!1,this.Yo=!1,this.ta=!1,this.ea=!1,this.ia=new Map,this.na=!1,this.sa=!1,this.ra=!1,this.oa=new Set,this.aa=new Set,this.Mr=t,this.la=n,this.props={},this.ua=void 0,this.ca=(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.hi=t.disable_persistence||!!e,this.qo=this.ha(t),this.Yo=this.da(t),this.load(r),this.va(),t.debug&&me.info("Persistence loaded",t.persistence,j({},this.props)),this.update_config(t,t,e),this.save(),te){const s=()=>this.flush();St(te,"beforeunload",s,{capture:!1}),St(te,"pagehide",s,{capture:!1}),this.fa=i=>{if(this.Ko&&(!i.storageArea||i.storageArea===(te==null?void 0:te.localStorage))&&i.key)if(i.key!==this.ca){if(this.Yo){const o=bf.find(l=>i.key===this.pa(l));o&&this.ga(i.key,o)}}else this.ga(i.key,Hn)},St(te,"storage",this.fa)}}markCrossTabFeatureFlagChanges(t){Object.entries(t).forEach(([e,n])=>{const r=this.ia.get(e);if(!My(e)||r===!0)return;if(n===!0)return void this.ma(e,!0);const s=new Set(r||[]);n.forEach(i=>s.add(i)),s.size&&this.ma(e,s)})}onCrossTabFeatureFlagChange(t){return this.aa.add(t),()=>this.aa.delete(t)}destroy(){this.fa&&te&&(te.removeEventListener("storage",this.fa),this.fa=void 0),this.aa.clear()}ga(t,e,n=!0){if(this.hi)return!1;let r,s;try{if(s=vt.Ot(t),ln(s)){const l=this.ya(e);return l.storageValue=null,e!==Hn&&(l.persisted=!1),!1}r=hu(s)}catch{return!1}const i=e===Hn?r:vt.Dt(this.ca);if(i&&this.ba(i))return!1;const o=this._a(r,e,n);return e===Hn&&this.Yo&&!xa(this.wa().main,r)||this.ka(r,e,!0,s),o}ba(t){const e=this.props[hi],n=t[hi];return!le(e)&&!le(n)&&e!==n}ka(t,e,n,r){const s=this.ya(e);s.storageValue=r,e!==Hn&&(s.persisted=n);try{s.fingerprint=this.Sa(t,e)}catch{s.fingerprint=void 0}}_a(t,e,n){let r=!1;return Po.forEach(s=>{var i;const o=(i=ar(s))===null||i===void 0?void 0:i.storageGroup;if(e===Hn&&this.Yo&&o||e!==Hn&&o!==e)return;const l=s in t,u=this.xa(s,l?t[s]:void 0),d=this.ia.has(s)?s in this.props:l;d===s in this.props&&xa(u,this.props[s])||(d?this.$a(s,u,!1):this.Ca(s,!1),r=!0)}),r&&n&&this.aa.forEach(s=>s()),r}Ta(){if(!this.Ko)return!1;try{this.ra=!1;const t=vt.Ot(this.ca),e=this.ya(Hn);let n,r=!1,s=!1;if(t!==e.storageValue)if(ln(t))e.storageValue=null;else{if(n=hu(t),this.ra=!this.sa&&this.ba(n),this.ra)return!1;s=this._a(n,Hn,!1),!this.Yo||xa(this.wa().main,n)?this.ka(n,Hn,!0,t):e.storageValue=t,r=!0}return this.Yo&&bf.forEach(i=>{const o=vt.Ot(this.pa(i)),l=this.ya(i),u=n||{},d=r&&Po.some(h=>{var g;return((g=ar(h))===null||g===void 0?void 0:g.storageGroup)===i&&h in u});if(o===l.storageValue&&!d)return;if(ln(o))return l.storageValue=null,l.persisted=!1,void(d&&(s=this._a(u,i,!1)||s));const f=hu(o);s=this._a(f,i,!1)||s,this.ka(f,i,!0,o)}),s}catch{return!1}}ma(t,e){this.ia.set(t,e);const n=ar(t);n!=null&&n.volatile||(this.ya((this.Yo?n==null?void 0:n.storageGroup:void 0)||Hn).fingerprint=void 0,this.Ia(t))}Ma(){Po.forEach(t=>this.ia.set(t,!0))}va(){if(this.Ko)try{const t=vt.Ot(this.ca),e=hu(t);this.ya(Hn).storageValue=t,Po.forEach(n=>{var r;const s=this.Yo?(r=ar(n))===null||r===void 0?void 0:r.storageGroup:void 0,i=s?vt.Ot(this.pa(s)):null;if(s){const l=this.ya(s);l.storageValue=i,l.persisted=!ln(i)}const o=s&&!ln(i)?hu(i):e;n in this.props?this.Ea(n,o[n],this.props[n]):n in o&&this.ma(n,!0)})}catch{}}xa(t,e){const n=this.ia.get(t);if(!n)return e;if(n===!0)return this.props[t];if(t==="$active_feature_flags"){const i=new Set(He(e)?e:[]),o=new Set(He(this.props[t])?this.props[t]:[]);return n.forEach(l=>o.has(l)?i.add(l):i.delete(l)),Array.from(i)}const r=nt(e)?j({},e):{},s=nt(this.props[t])?this.props[t]:{};return n.forEach(i=>{i in s?r[i]=s[i]:delete r[i]}),r}Ea(t,e,n){if(!My(t))return;const r=this.ia.get(t);if(r===!0)return;let s=e;if(this.Ko)try{var i;const l=this.Yo?(i=ar(t))===null||i===void 0?void 0:i.storageGroup:void 0,u=l?this.pa(l):this.ca;s=hu(vt.Ot(u))[t]}catch{}const o=new Set(r||[]);if(t==="$active_feature_flags"){if(!le(e)&&!He(e)||!le(s)&&!He(s)||!He(n))return void this.ma(t,!0);const l=new Set(e||[]),u=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=>{u.has(f)===d.has(f)&&o.delete(f)})}else{if(!nt(n))return void(xa(s,n)?this.ia.delete(t):this.ma(t,!0));{if(!le(e)&&!nt(e)||le(e)&&ns(n)&&le(s))return void this.ma(t,!0);const l=nt(e)?e:{},u=nt(s)?s:{};new Set([...Object.keys(l),...Object.keys(n)]).forEach(d=>{d in l==d in n&&xa(l[d],n[d])||o.add(d)}),o.forEach(d=>{d in u==d in n&&xa(u[d],n[d])&&o.delete(d)})}}o.size?this.ma(t,o):this.ia.delete(t)}Pa(){var t;const e=(t=this.Mr)===null||t===void 0?void 0:t.persistence_save_debounce_ms;return hn(e)&&e>0?e:0}Ra(t){if(this.Mr.cookieWinsOnConflict&&this.Mr.persistence.toLowerCase()==="localstorage+cookie")if(t)try{const e=Py(t,this.Mr.cookie_persisted_properties||[]),n=ik(e,this.Mr.cookie_persisted_properties||[]),r=JSON.stringify(e)+"|"+JSON.stringify(n),s=an.Ot(this.ca)||void 0;s&&Ay(this.ca,s)===r&&(this.Aa=r,this.Fa=s)}catch{}else try{const e=an.Ot(this.ca)||void 0;this.Aa=e?Ay(this.ca,e):void 0,this.Fa=e}catch{}}syncCookieProperties(){return this.Oa(this.Mr)}Oa(t,e=!1){if(this.hi&&!e||this.ea||!t.cookieWinsOnConflict||t.persistence.toLowerCase()!=="localstorage+cookie")return!1;let n;try{n=an.Ot(this.ca)||void 0}catch{}if(!n||n===this.Fa)return!1;const r=Ay(this.ca,n);let s;try{s=Ey(JSON.parse(n))}catch{return!1}if((an.Ot(this.ca)||void 0)!==n)return!1;this.Aa=r,this.Fa=n;const i=ok(this.ca,n),o=[...ql,...i.properties],l={};if(Object.keys(s).forEach(_=>{const w=s[_];(le(w)||ln(w)||w===""||_==="$user_state"&&w!=="anonymous"&&w!=="identified")&&(l[_]=!0,delete s[_])}),ns(s))return!1;const u="distinct_id"in s||s.$user_state==="anonymous"||s.$user_state==="identified",d=this.props,f=d[hi],h=d[Vr],g=Gt({},d);[...ql,...t.cookie_persisted_properties||[]].forEach(_=>{if(o.indexOf(_)!==-1&&!(_ in s)&&!l[_]&&(u||_!=="distinct_id"&&_!=="$user_state")){const w=g[_];(i.isValid||ql.indexOf(_)===-1||w!==!1&&w!==0)&&delete g[_]}}),this.props=Gt(g,s),Po.forEach(_=>{const w=_ in this.props;_ in d===w&&xa(d[_],this.props[_])||(w?this.Ea(_,d[_],this.props[_]):this.ma(_,!0))}),!u||"$user_state"in s||"$user_state"in this.props||this.$a(Vr,Do);const v=this.props[hi],x=this.props[Vr];return!u||v===f&&x===h||(this.sa=!0,this.ta=!0,Vt.$t(w0(this.ca),!0),this.Ca(Da),this.Ca(No),this.Ca(_i),this.Ca(cc),this.Ca($a),this.Ca(uc),this.Ca(Ua),this.Ca(ph),this.Ca(ja),x!=="anonymous"||h!=="identified"&&s.$user_state!=="anonymous"&&(le(f)||v===f)||(bk(this.props,s),this.Ca(Na)),x==="identified"?this.props.$user_id=v:delete this.props.$user_id,this.Ca($m)),!0}consumeCookieIdentityChange(){const t=w0(this.ca),e=this.ta||!!Vt.Ot(t);return this.ta=!1,e&&Vt.Pt(t),e}Da(t=!1){return!(this.ea||this.hi&&!t||!this.Mr.cookieWinsOnConflict||this.Mr.persistence.toLowerCase()!=="localstorage+cookie"||(this.ea=!0,0))}La(){this.ea&&(le(this.Na)||(clearTimeout(this.Na),this.Na=void 0),delete this.Jo[Hn],this.qa(!0))}ja(t=!0){if(this.ea)try{t?this.La():le(this.Na)||(clearTimeout(this.Na),this.Na=void 0)}finally{this.ea=!1}}isDisabled(){return!!this.hi}ha(t){RV.indexOf(t.persistence.toLowerCase())===-1&&(me.critical("Unknown persistence type "+t.persistence+"; falling back to localStorage+cookie"),t.persistence="localStorage+cookie");const e=((o=[],l=!1,u=()=>!1)=>{const d=[...ql,...o];return j(j({},vt),{},{Dt(f){try{let g,v={};try{g=an.Ot(f)||void 0,v=g?Ey(JSON.parse(g)):{}}catch{}const x=JSON.parse(vt.Ot(f)||"{}");let _;if(l){const w=ok(f,g),S=[...ql,...w.properties],k={};Object.keys(v).forEach(P=>{const T=v[P];ln(T)||T===""||P==="$user_state"&&T!=="anonymous"&&T!=="identified"||(k[P]=T)});const E="distinct_id"in k||k.$user_state==="anonymous"||k.$user_state==="identified";if(Object.keys(k).length>0){var h;const P=x[hi],T=(h=x.$user_state)!==null&&h!==void 0?h:Do;d.forEach(I=>{if(S.indexOf(I)!==-1&&!(I in v)&&(E||I!=="distinct_id"&&I!=="$user_state")){const M=x[I];(w.isValid||ql.indexOf(I)===-1||M!==!1&&M!==0)&&delete x[I]}}),!E||"$user_state"in v||"$user_state"in x||(x[Vr]=Do),!E||("distinct_id"in k?k[hi]:x[hi])===P&&("$user_state"in k?k[Vr]:x[Vr])===T||(Cy.forEach(I=>delete x[I]),k.$user_state==="identified"&&"distinct_id"in k?x.$user_id=k[hi]:delete x.$user_id,k.$user_state!=="identified"&&(delete x[TT],delete x[Na]),delete x.__alias)}_=Gt(x,k)}else _=Gt(v,x);return u()||vt.$t(f,_),_}catch{}return null},$t(f,h,g,v,x,_){const w=vt.$t(f,h,void 0,void 0,_);try{const S=Py(h,o);if(Object.keys(S).length){if(l){const k=Hm(f),E=ik(S,o);if(an.$t(k,E,g,v,x,_),an.Ot(k)!==JSON.stringify(E)){an.Pt(k,v);const P=Py(h);return an.$t(f,P,g,v,x,_),w}}an.$t(f,S,g,v,x,_)}}catch(S){vt.Lt(S)}return w},Pt(f,h){try{te==null||te.localStorage.removeItem(f),an.Pt(f,h),an.Pt(Hm(f),h)}catch(g){vt.Lt(g)}}})})(t.cookie_persisted_properties||[],t.cookieWinsOnConflict,()=>!!this.hi);let n,r=!1,s=!1;const i=t.persistence.toLowerCase();return i==="localstorage"&&vt.At()?(n=vt,s=!0):i==="localstorage+cookie"&&e.At()?(n=e,s=!0,r=!0):i==="sessionstorage"&&Vt.At()?n=Vt:i==="memory"?n=j2:i==="cookie"&&an.At()?(n=an,r=!0):e.At()?(n=e,s=!0,r=!0):an.At()?(n=an,r=!0):n=j2,this.Ko=s,this.Xo=r,n}pa(t){return`${this.ca}__${t}`}da(t){return this.Ko&&!!t.split_storage}properties(){const t={};return At(this.props,(e,n)=>{const r=ar(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.hi&&!t)return;const e=this.Mr.cookieWinsOnConflict&&this.Mr.persistence.toLowerCase()==="localstorage+cookie",n=e?vt.Dt(this.ca):null;let r={};if(e)try{r=Ey(an.Dt(this.ca)),At(r,(l,u)=>{(le(l)||ln(l)||l==="")&&delete r[u]})}catch{}const s=this.qo.Dt(this.ca);if(s&&(this.props=Gt({},s)),this.Yo&&this.Ba(),e&&s){var i,o;const l=n==null?void 0:n[hi],u=(i=n==null?void 0:n.$user_state)!==null&&i!==void 0?i:Do,d=s[hi],f=(o=s.$user_state)!==null&&o!==void 0?o:Do;if(d!==l||f!==u){this.ta=!0,this.hi||Vt.$t(w0(this.ca),!0);const h=Gt({},this.props);Cy.forEach(v=>delete h[v]),f!=="anonymous"||u!=="identified"&&r.$user_state!=="anonymous"&&(le(l)||d===l)||(bk(h,r),delete h[Na]),this.props=h;const g=new Set;Cy.forEach(v=>{var x;const _=(x=ar(v))===null||x===void 0?void 0:x.storageGroup;_&&g.add(_)}),g.forEach(v=>{if(this.hi)return;const x={};At(this.props,(_,w)=>{var S;((S=ar(w))===null||S===void 0?void 0:S.storageGroup)===v&&(x[w]=_)}),ns(x)?(vt.Pt(this.pa(v)),this.Jo[v]={}):vt.$t(this.pa(v),x)&&(this.Jo[v]={persisted:!0,fingerprint:this.Sa(x,v)})})}}Vt.Ot(w0(this.ca))&&(this.ta=!0)}Ba(){for(const t of bf){const e=vt.Dt(this.pa(t));if(e&&!ns(e)){const n=this.ya(t);n.persisted=!0,this.za(t)||(n.fingerprint=this.Sa(e,t)),this.Ha(t,e)||Gt(this.props,e)}}}za(t){return Object.keys(this.props).some(e=>{var n;return((n=ar(e))===null||n===void 0?void 0:n.storageGroup)===t})}Ha(t,e){const n=TV[t];if(!n)return!1;const r=e[n],s=this.props[n];return hn(r)&&hn(s)&&s>r}refreshKey(t){var e;if(this.hi||this.oa.has(t))return;const n=this.Yo?(e=ar(t))===null||e===void 0?void 0:e.storageGroup:void 0,r=n?vt.Dt(this.pa(n)):this.qo.Dt(this.ca);if(r&&t in r)this.$a(t,r[t],!1);else{if(n){const s=this.qo.Dt(this.ca);if(s&&t in s)return void this.$a(t,s[t],!1)}this.Ca(t,!1)}}save(){if(this.hi)return;const t=this.Pa();t>0?le(this.Na)&&(this.Na=setTimeout(()=>{this.Na=void 0,this.qa()},t)):this.qa()}flush(){le(this.Na)||(clearTimeout(this.Na),this.Na=void 0,this.qa())}qa(t=!1){if(this.hi||this.ea&&!t)return;t||(this.syncCookieProperties(),this.Mr.cookieWinsOnConflict&&this.Mr.persistence.toLowerCase()==="localstorage+cookie"||vR.forEach(s=>this.refreshKey(s)));const e=!t&&!this.na;e||(this.ra=!1);const n=!!e&&this.Ta();if(this.ra)return void(this.Mr.debug&&me.warn("skipping persistence write because storage belongs to a different distinct ID"));if(this.Yo)return this.Ua(),void(n&&this.aa.forEach(s=>s()));const r=this.Wa(this.qo,this.ca,this.props,Hn);r==="written"&&this.Ra(this.props),r!=="failed"&&(this.ia.clear(),this.sa=!1,this.oa.clear()),n&&this.aa.forEach(s=>s())}Ua(){const{main:t,groups:e}=this.wa(),n=this.Wa(this.qo,this.ca,t,Hn);n==="written"&&this.Ra(t),n!=="failed"&&(this.sa=!1,this.oa.clear(),Po.forEach(s=>{var i;!((i=ar(s))===null||i===void 0)&&i.storageGroup||this.ia.delete(s)}));for(const s of bf){var r;const i=e[s];if(ns(i)&&!(!((r=this.Jo[s])===null||r===void 0)&&r.persisted)){Po.forEach(l=>{var u;((u=ar(l))===null||u===void 0?void 0:u.storageGroup)===s&&this.ia.delete(l)});continue}const o=this.Wa(vt,this.pa(s),i,s);o!=="failed"&&Po.forEach(l=>{const u=ar(l);(u==null?void 0:u.storageGroup)!==s||o!=="written"&&u.volatile||this.ia.delete(l)})}}wa(){const t={},e={flags:{},surveys:{}};return At(this.props,(n,r)=>{var s;const i=(s=ar(r))===null||s===void 0?void 0:s.storageGroup;i?e[i][r]=n:t[r]=n}),{main:t,groups:e}}Sa(t,e){if(e===Hn)return JSON.stringify(t)+"|"+this.Va+"|"+this.Ga+"|"+this.Qa;const n={};return At(t,(r,s)=>{var i;n[s]=!((i=ar(s))===null||i===void 0)&&i.volatile?"__volatile__":r}),JSON.stringify(n)}Wa(t,e,n,r){const s=this.ya(r);if(r!==Hn&&!s.dirty&&!le(s.fingerprint))return"skipped";let i;try{if(i=this.Sa(n,r),i===s.fingerprint)return s.dirty=!1,"skipped"}catch{i=void 0}return t.$t(e,n,this.Va,this.Ga,this.Qa,this.Mr.debug)?(s.dirty=!1,r!==Hn&&(s.persisted=!0),le(i)||(s.fingerprint=i),this.Ko&&(s.storageValue=vt.Ot(e)),"written"):(this.Mr.debug&&me.warn(`failed to persist storage entry "${e}"; will retry on next save`),"failed")}remove({keepGroupEntries:t=!1}={}){if(this.Ma(),le(this.Na)||(clearTimeout(this.Na),this.Na=void 0),this.qo.Pt(this.ca,!1),this.qo.Pt(this.ca,!0),!t&&this.la)for(const e of bf)vt.Pt(this.pa(e));t?delete this.Jo[Hn]:this.Jo={},this.Aa=void 0,this.Fa=void 0}clear(){this.remove(),this.props={}}register_once(t,e,n){if(nt(t)){this.syncCookieProperties(),le(e)&&(e="None"),this.Va=le(n)?this.Za:n;let r=!1;if(At(t,(s,i)=>{this.props.hasOwnProperty(i)&&this.props[i]!==e||(this.$a(i,s),r=!0)}),r)return this.save(),!0}return!1}register(t,e){if(nt(t)){this.syncCookieProperties(),this.Va=le(e)?this.Za:e;let n=!1;if(At(t,(r,s)=>{t.hasOwnProperty(s)&&(this.props[s]!==r||nt(r)||He(r))&&(this.$a(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.Ca(r),n=!0);n&&this.save()}update_campaign_params(){const t=he==null?void 0:he.URL;if(t===this.ua)return;const e=uR(this.Mr.custom_campaign_params,this.Mr.mask_personal_data_properties,this.Mr.custom_personal_data_properties),n=!ns(Kx(e));return n&&this.register(e),this.ua=t,n?e:void 0}update_search_keyword(){this.register((function(){const t=he==null?void 0:he.referrer;return t?fR(t):{}})())}update_referrer_info(){var t;this.register_once({$referrer:pR(),$referring_domain:(he==null?void 0:he.referrer)&&((t=Bo(he.referrer))===null||t===void 0?void 0:t.host)||Um},void 0)}set_initial_person_info(){if(this.props.$initial_campaign_params||this.props.$initial_referrer_info)return;const t=mR(this.Mr.mask_personal_data_properties,this.Mr.custom_personal_data_properties,this.Mr.disable_capture_url_hashes);this.register_once({[Tu]:this.Xo?{r:x0(t.r),u:t.u?x0(t.u):void 0}:t},void 0)}get_initial_props(){const t={};At([LT,OT],n=>{const r=this.props[n];r&&At(r,function(s,i){t["$initial_"+v2(i)]=s})});const e=this.props[Tu];if(e){const n=(function(r,s=!1){const i=gR(r,s),o={};return At(i,function(l,u){o[`$initial_${v2(u)}`]=l}),o})(e,this.Mr.disable_capture_url_hashes);Gt(t,n)}return t}safe_merge(t){return At(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,x)=>{if(v.length!==x.length)return!1;const _=[...v].sort(),w=[...x].sort();return _.every((S,k)=>S===w[k])})(t.cookie_persisted_properties||[],e.cookie_persisted_properties||[]),i=r||s,o=t.cookieWinsOnConflict!==e.cookieWinsOnConflict,l=t.disable_persistence||!!n,u=!!this.hi&&!l;l||this.Oa(e,u),this.Mr=t,!l&&(r||s||o)&&(this.Aa=void 0,this.Fa=void 0,this.Oa(j(j({},t),{},{cookie_persisted_properties:e.cookie_persisted_properties}),u));const d=i||o?this.ha(t):this.qo;this.Ja();const f=this.da(t),h=i||f!==this.Yo,g=!l&&(h||t.cross_subdomain_cookie!==this.Ga||t.secure_cookie!==this.Qa)&&this.Da(u);this.na=h;try{if(this.Za=this.Va=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.qo=d,this.Yo=f,this.props=v,this.save()}else o&&(this.qo=d,l||(delete this.Jo[Hn],this.qa()))}finally{this.na=!1,g&&this.ja()}}Ja(){const t=this.props[Tu];if(!this.Xo||!nt(t)||typeof t.r!="string")return;const e=x0(t.r),n=typeof t.u=="string"?x0(t.u):t.u;e===t.r&&n===t.u||this.$a(Tu,j(j({},t),{},{r:e,u:n}))}set_disabled(t){this.hi=t,this.hi?this.remove():this.save()}set_cross_subdomain(t){t!==this.Ga&&(this.Ga=t,this.remove({keepGroupEntries:!0}),this.save())}set_secure(t){t!==this.Qa&&(this.Qa=t,this.remove({keepGroupEntries:!0}),this.save())}set_event_timer(t,e){const n=this.props.__timers||{};n[t]=e,this.$a(A2,n),this.save()}remove_event_timer(t){const e=this.props.__timers||{},n=e[t];return le(n)||(delete e[t],this.$a(A2,e),this.save()),n}get_property(t){return this.props[t]}set_property(t,e){this.$a(t,e),this.save()}$a(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.sa=!0),xk(t)&&!xa(s,e)&&this.oa.add(t),this.Ea(t,s,e),!((r=ar(t))===null||r===void 0)&&r.volatile||this.Ia(t))}Ca(t,e=!0){delete this.props[t],e&&(My(t)&&this.ma(t,!0),xk(t)&&this.oa.add(t),this.Ia(t))}Ia(t){var e;const n=(e=ar(t))===null||e===void 0?void 0:e.storageGroup;n&&(this.ya(n).dirty=!0)}ya(t){return this.Jo[t]||(this.Jo[t]={})}};const xs={GZipJS:"gzip-js",Base64:"base64"},Sf={Activation:"events",Cancellation:"cancelEvents"},Oy={Popover:"popover",API:"api",Widget:"widget"},ws={SHOWN:"survey shown",DISMISSED:"survey dismissed",SENT:"survey sent"},Ly={SURVEY_ID:"$survey_id",SURVEY_ITERATION:"$survey_iteration",SURVEY_LAST_SEEN_DATE:"$survey_last_seen_date"},V2={Popover:"popover",Inline:"inline"};function Ny(t){let e=!0;return{dispose(){if(e){e=!1;const n=t();n&&xn(n.then)&&n.then(void 0,()=>{})}}}}const MV={SHOWN:"product tour shown"},Sk={TOUR_LAST_SEEN_DATE:"$product_tour_last_seen_date",TOUR_TYPE:"$product_tour_type"},kk=tn("[RateLimiter]");var IV=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=>{kk.info(`${r||"events"} is quota limited.`),this.serverLimits[r]=new Date().getTime()+6e4})}catch(r){return void kk.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)}clientRateLimitContext(t=!1){var e,n,r;const{captureEventsBurstLimit:s,captureEventsPerSecond:i}=this,o=new Date().getTime(),l=(e=(n=this.instance.persistence)===null||n===void 0?void 0:n.get_property("$capture_rate_limit"))!==null&&e!==void 0?e:{tokens:s,last:o};l.tokens+=(o-l.last)/1e3*i,l.last=o,l.tokens>s&&(l.tokens=s);const u=1>l.tokens;if(u||t||(l.tokens=Math.max(0,l.tokens-1)),u&&!t){const d=(hn(l.dropped)?l.dropped:0)+1;l.dropped=d,!this.lastEventRateLimited&&this.Ka(d)&&(l.dropped=0)}return this.lastEventRateLimited=u,(r=this.instance.persistence)===null||r===void 0||r.set_property("$capture_rate_limit",l),{isRateLimited:u,remainingTokens:l.tokens}}Xa(t){const e=this.instance.config.property_denylist;return!He(e)||!e.includes(t)}Ya(){var t;if(this.Xa("$current_url")&&this.Xa("$pathname")&&(qt!=null&&qt.pathname))return`${(t=qt.origin)!==null&&t!==void 0?t:""}${qt.pathname}`}Ka(t){var e,n;const{captureEventsBurstLimit:r,captureEventsPerSecond:s}=this,i=this.Ya(),o=this.Xa("$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 ba=tn("[RemoteConfig]");var yR=class{constructor(t){this._instance=t}get remoteConfig(){var t;return(t=We._POSTHOG_REMOTE_CONFIG)===null||t===void 0||(t=t[this._instance.config.token])===null||t===void 0?void 0:t.config}tl(t){var e,n,r;!((e=We.__PosthogExtensions__)===null||e===void 0)&&e.loadExternalDependency?(n=We.__PosthogExtensions__)===null||n===void 0||(r=n.loadExternalDependency)===null||r===void 0||r.call(n,this._instance,"remote-config",()=>t(this.remoteConfig)):t()}el(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 ba.info("Using preloaded remote config",this.remoteConfig),void this.il(this.remoteConfig);if(this._instance.nl())return void ba.warn("Remote config is disabled. Falling back to local config.");this.tl(t=>{if(!t)return ba.info("No config found after loading remote JS config. Falling back to JSON."),void this.el(e=>{this.il(e.json,e)});this.il(t)})}catch(t){ba.error("Error loading remote config",t),this.il()}}il(t,e){!t&&e&&(e.statusCode===0?e.error||ba.warn("Failed to fetch remote config from PostHog."):ba.error("Failed to fetch remote config from PostHog."));try{this._instance.il(t?{ok:!0,config:t}:{ok:!1})}catch(r){ba.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){ba.error("Error loading feature flags",r)}}},Ys=Uint8Array,ss=Uint16Array,fd=Uint32Array,tb=new Ys([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]),nb=new Ys([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]),Ck=new Ys([16,17,18,0,8,7,9,6,10,5,11,4,12,3,13,2,14,1,15]),_R=function(t,e){for(var n=new ss(31),r=0;31>r;++r)n[r]=e+=1<<t[r-1];var s=new fd(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]},wR=_R(tb,2),H2=wR[1];wR[0][28]=258,H2[258]=28;for(var Ek=_R(nb,0)[1],xR=new ss(32768),cn=0;32768>cn;++cn){var pu=(43690&cn)>>>1|(21845&cn)<<1;xR[cn]=((65280&(pu=(61680&(pu=(52428&pu)>>>2|(13107&pu)<<2))>>>4|(3855&pu)<<4))>>>8|(255&pu)<<8)>>>1}var Kf=function(t,e,n){for(var r=t.length,s=0,i=new ss(e);r>s;++s)++i[t[s]-1];var o,l=new ss(e);for(s=0;e>s;++s)l[s]=l[s-1]+i[s-1]<<1;for(o=new ss(r),s=0;r>s;++s)o[s]=xR[l[t[s]-1]++]>>>15-t[s];return o},_c=new Ys(288);for(cn=0;144>cn;++cn)_c[cn]=8;for(cn=144;256>cn;++cn)_c[cn]=9;for(cn=256;280>cn;++cn)_c[cn]=7;for(cn=280;288>cn;++cn)_c[cn]=8;var Bm=new Ys(32);for(cn=0;32>cn;++cn)Bm[cn]=5;var OV=Kf(_c,9),LV=Kf(Bm,5),bR=function(t){return(t/8|0)+(7&t&&1)},SR=function(t,e,n){(n==null||n>t.length)&&(n=t.length);var r=new(t instanceof ss?ss:t instanceof fd?fd:Ys)(n-e);return r.set(t.subarray(e,n)),r},wo=function(t,e,n){var r=e/8|0;t[r]|=n<<=7&e,t[r+1]|=n>>>8},kf=function(t,e,n){var r=e/8|0;t[r]|=n<<=7&e,t[r+1]|=n>>>8,t[r+2]|=n>>>16},Dy=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 Ys(0),0];if(s==1){var o=new Ys(n[0].s+1);return o[n[0].s]=1,[o,1]}n.sort(function(T,I){return T.f-I.f}),n.push({s:-1,f:25001});var l=n[0],u=n[1],d=0,f=1,h=2;for(n[0]={s:-1,f:l.f+u.f,l,r:u};f!=s-1;)l=n[n[h].f>n[d].f?d++:h++],u=n[d!=f&&n[h].f>n[d].f?d++:h++],n[f++]={s:-1,f:l.f+u.f,l,r:u};var g=i[0].s;for(r=1;s>r;++r)i[r].s>g&&(g=i[r].s);var v=new ss(g+1),x=z2(n[f-1],v,0);if(x>e){r=0;var _=0,w=x-e,S=1<<w;for(i.sort(function(T,I){return v[I.s]-v[T.s]||T.f-I.f});s>r;++r){var k=i[r].s;if(e>=v[k])break;_+=S-(1<<x-v[k]),v[k]=e}for(_>>>=w;_>0;){var E=i[r].s;e>v[E]?_-=1<<e-v[E]++-1:++r}for(;r>=0&&_;--r){var P=i[r].s;v[P]==e&&(--v[P],++_)}x=e}return[new Ys(v),x]},z2=function(t,e,n){return t.s==-1?Math.max(z2(t.l,e,n+1),z2(t.r,e,n+1)):e[t.s]=n},Pk=function(t){for(var e=t.length;e&&!t[--e];);for(var n=new ss(++e),r=0,s=t[0],i=1,o=function(u){n[r++]=u},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]},Cf=function(t,e){for(var n=0,r=0;e.length>r;++r)n+=t[r]*e[r];return n},U2=function(t,e,n){var r=n.length,s=bR(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)},Ak=function(t,e,n,r,s,i,o,l,u,d,f){wo(e,f++,n),++s[256];for(var h=Dy(s,15),g=h[0],v=h[1],x=Dy(i,15),_=x[0],w=x[1],S=Pk(g),k=S[0],E=S[1],P=Pk(_),T=P[0],I=P[1],M=new ss(19),R=0;k.length>R;++R)M[31&k[R]]++;for(R=0;T.length>R;++R)M[31&T[R]]++;for(var O=Dy(M,7),D=O[0],$=O[1],V=19;V>4&&!D[Ck[V-1]];--V);var q,B,K,z,X=d+5<<3,Z=Cf(s,_c)+Cf(i,Bm)+o,J=Cf(s,g)+Cf(i,_)+o+14+3*V+Cf(M,D)+(2*M[16]+3*M[17]+7*M[18]);if(Z>=X&&J>=X)return U2(e,f,t.subarray(u,u+d));if(wo(e,f,1+(Z>J)),f+=2,Z>J){q=Kf(g,v),B=g,K=Kf(_,w),z=_;var H=Kf(D,$);for(wo(e,f,E-257),wo(e,f+5,I-1),wo(e,f+10,V-4),f+=14,R=0;V>R;++R)wo(e,f+3*R,D[Ck[R]]);f+=3*V;for(var N=[k,T],Y=0;2>Y;++Y){var ae=N[Y];for(R=0;ae.length>R;++R)wo(e,f,H[se=31&ae[R]]),f+=D[se],se>15&&(wo(e,f,ae[R]>>>5&127),f+=ae[R]>>>12)}}else q=OV,B=_c,K=LV,z=Bm;for(R=0;l>R;++R)if(r[R]>255){var se;kf(e,f,q[257+(se=r[R]>>>18&31)]),f+=B[se+257],se>7&&(wo(e,f,r[R]>>>23&31),f+=tb[se]);var ie=31&r[R];kf(e,f,K[ie]),f+=z[ie],ie>3&&(kf(e,f,r[R]>>>5&8191),f+=nb[ie])}else kf(e,f,q[r[R]]),f+=B[r[R]];return kf(e,f,q[256]),f+B[256]},NV=new fd([65540,131080,131088,131104,262176,1048704,1048832,2114560,2117632]),DV=(function(){for(var t=new fd(256),e=0;256>e;++e){for(var n=e,r=9;--r;)n=(1&n&&3988292384)^n>>>1;t[e]=n}return t})(),jy=function(t,e,n){for(;n;++e)t[e]=n,n>>>=8};function jV(t,e){e===void 0&&(e={});var n=(function(){var h=4294967295;return{p(g){for(var v=h,x=0;g.length>x;++x)v=DV[255&v^g[x]]^v>>>8;h=v},d(){return 4294967295^h}}})(),r=t.length;n.p(t);var s,i,o,l,u,d=(l=10+((s=e).filename&&s.filename.length+1||0),u=8,(function(h,g,v,x,_,w){var S=h.length,k=new Ys(x+S+5*(1+Math.floor(S/7e3))+_),E=k.subarray(x,k.length-_),P=0;if(!g||8>S)for(var T=0;S>=T;T+=65535){var I=T+65535;S>I?P=U2(E,P,h.subarray(T,I)):(E[T]=w,P=U2(E,P,h.subarray(T,S)))}else{for(var M=NV[g-1],R=M>>>13,O=8191&M,D=(1<<v)-1,$=new ss(32768),V=new ss(D+1),q=Math.ceil(v/3),B=2*q,K=function(Et){return(h[Et]^h[Et+1]<<q^h[Et+2]<<B)&D},z=new fd(25e3),X=new ss(288),Z=new ss(32),J=0,H=0,N=(T=0,0),Y=0,ae=0;S>T;++T){var se=K(T),ie=32767&T,de=V[se];if($[ie]=de,V[se]=ie,T>=Y){var ge=S-T;if((J>7e3||N>24576)&&ge>423){P=Ak(h,E,0,z,X,Z,H,N,ae,T-ae,P),N=J=H=0,ae=T;for(var ue=0;286>ue;++ue)X[ue]=0;for(ue=0;30>ue;++ue)Z[ue]=0}var re=2,Pe=0,$e=O,Ee=ie-de&32767;if(ge>2&&se==K(T-Ee))for(var dt=Math.min(R,ge)-1,Tt=Math.min(32767,T),rn=Math.min(258,ge);Tt>=Ee&&--$e&&ie!=de;){if(h[T+re]==h[T+re-Ee]){for(var jt=0;rn>jt&&h[T+jt]==h[T+jt-Ee];++jt);if(jt>re){if(re=jt,Pe=Ee,jt>dt)break;var xt=Math.min(Ee,jt-2),Xt=0;for(ue=0;xt>ue;++ue){var Ct=T-Ee+ue+32768&32767,qe=Ct-$[Ct]+32768&32767;qe>Xt&&(Xt=qe,de=Ct)}}}Ee+=(ie=de)-(de=$[ie])+32768&32767}if(Pe){z[N++]=268435456|H2[re]<<18|Ek[Pe];var ke=31&H2[re],rt=31&Ek[Pe];H+=tb[ke]+nb[rt],++X[257+ke],++Z[rt],Y=T+re,++J}else z[N++]=h[T],++X[h[T]]}}P=Ak(h,E,w,z,X,Z,H,N,ae,T-ae,P)}return SR(k,0,x+bR(P)+_)})(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,u,!0)),f=d.length;return(function(h,g){var v=g.filename;if(h[0]=31,h[1]=139,h[2]=8,h[8]=2>g.level?4:g.level==9?2:0,h[9]=3,g.mtime!=0&&jy(h,4,Math.floor(new Date(g.mtime||Date.now())/1e3)),v){h[3]=8;for(var x=0;v.length>=x;++x)h[x+10]=v.charCodeAt(x)}})(d,e),jy(d,f-8,n.d()),jy(d,f-4,r),d}const $V=!!Lx||!!fh,kR=new WeakMap,CR="text/plain";let $y=0,nm=!1;const ER=(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}`:""}`},Jh=(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,g]=d.split("="),v=n&&(f=o[h])!==null&&f!==void 0?f:g;return delete o[h],`${h}=${v}`}))!==null&&r!==void 0?r:[],u=(function(d,f="&"){let h,g;const v=[];return At(d,function(x,_){le(x)||le(_)||_==="undefined"||(h=encodeURIComponent((w=>w instanceof File)(x)?x.name:x.toString()),g=encodeURIComponent(_),v[v.length]=g+"="+h)}),v.join(f)})(o);return u&&l.push(u),l.length>0?`${s}?${l.join("&")}`:s},Fy=t=>{if(t.sl)return t.sl;const{data:e,compression:n}=t;if(!e)return;if(n===xs.GZipJS){const s=jV((function(i){var o=i.length;if(typeof TextEncoder<"u")return new TextEncoder().encode(i);for(var l=new Ys(i.length+(i.length>>>1)),u=0,d=function(v){l[u++]=v},f=0;o>f;++f){if(u+5>l.length){var h=new Ys(u+8+(o-f<<1));h.set(l),l=h}var g=i.charCodeAt(f);128>g?d(g):2048>g?(d(192|g>>>6),d(128|63&g)):g>55295&&57344>g?(d(240|(g=65536+(1047552&g)|1023&i.charCodeAt(++f))>>>18),d(128|g>>>12&63),d(128|g>>>6&63),d(128|63&g)):(d(224|g>>>12),d(128|g>>>6&63),d(128|63&g))}return SR(l,0,u)})(Mu(e)),{mtime:0});return{contentType:CR,body:s.buffer.slice(s.byteOffset,s.byteOffset+s.byteLength),estimatedSize:s.byteLength}}if(n===xs.Base64){const s=(function(o){return o&&btoa(encodeURIComponent(o).replace(/%([0-9A-F]{2})/g,(l,u)=>String.fromCharCode(parseInt(u,16))))})(Mu(e)),i=(o=>"data="+encodeURIComponent(typeof o=="string"?o:Mu(o)))(s);return{contentType:"application/x-www-form-urlencoded",body:i,estimatedSize:new Blob([i]).size}}const r=Mu(e);return{contentType:"application/json",body:r,estimatedSize:new Blob([r]).size}},PR=t=>{const e=()=>t.transport==="sendBeacon"?{url:Jh(t.url,{compression:xs.Base64}),encodedBody:Fy(j(j({},t),{},{compression:xs.Base64,sl:void 0}))}:{url:ER(t.url,"compression"),encodedBody:Fy(j(j({},t),{},{compression:void 0,sl:void 0}))};let n;try{n=Fy(t)}catch(s){if(Z8(t.compression,ud(t.url,"compression")))return me.error("Failed to gzip request body, sending uncompressed payload",s),e();throw s}return n&&Z8(t.compression,ud(t.url,"compression"))&&!((r=n.body)instanceof ArrayBuffer?S2(new Uint8Array(r)):ArrayBuffer.isView(r)&&S2(new Uint8Array(r.buffer,r.byteOffset,r.byteLength)))?(nm=!0,e()):{url:t.url,encodedBody:n};var r},AR=t=>{try{return PR(t)}catch(n){var e;return me.error(n),void((e=t.callback)===null||e===void 0||e.call(t,{statusCode:0,error:n}))}},FV=(function(){var t=Ht(function*(e){const n=yield(function(s){return k2.apply(this,arguments)})(Mu(e.data),ts.DEBUG,{rethrow:!0});if(!n)return e;const r=yield n.arrayBuffer();return j(j({},e),{},{sl:{contentType:CR,body:r,estimatedSize:r.byteLength}})});return function(e){return t.apply(this,arguments)}})(),VV=/Failed to fetch|NetworkError|Load failed/i,TR=t=>(t==null?void 0:t.name)==="TypeError"&&VV.test((t==null?void 0:t.message)||""),RR=t=>{try{const e=(function(n,r=Date.now()){if(typeof n!="string"||!n)return;const s=n.trim(),i=/^\d+\s*,/.test(s)?s.slice(0,s.indexOf(",")).trim():s;if(/^\d+$/.test(i)){const u=1e3*Math.min(Number(i),300);return u>0?u:void 0}if(!/^(Mon|Tue|Wed|Thu|Fri|Sat|Sun)[a-z]*[ ,]/.test(i))return;const o=/^\w{3} \w{3} /.test(i)?i+" GMT":i,l=Date.parse(o)-r;return Number.isFinite(l)&&l>0?Math.min(l,J0):void 0})(t());return le(e)?void 0:Math.min(e,3e4)}catch{return}},MR=t=>{const e=AR(t);if(!e)return;const n=new Lx;kR.set(n,!0);const{url:r,encodedBody:s}=e;n.open(t.method||"GET",r,!0);const{contentType:i,body:o}=s??{};At(t.headers,function(l,u){n.setRequestHeader(u,l)}),i&&n.setRequestHeader("Content-Type",i),t.timeout&&(n.timeout=t.timeout),n.onreadystatechange=()=>{if(n.readyState===4){var l;const u={statusCode:n.status,text:n.responseText};if(n.status===200)try{u.json=JSON.parse(n.responseText)}catch{}(l=t.callback)===null||l===void 0||l.call(t,u,RR(()=>n.getResponseHeader("Retry-After")))}},n.send(o)},IR=t=>{const e=AR(t);if(!e)return;const{url:n,encodedBody:r}=e,{contentType:s,body:i,estimatedSize:o}=r??{},l=new Headers;At(t.headers,function(x,_){l.append(_,x)}),s&&l.append("Content-Type",s);let u=null,d=!1;if(A8){const x=new A8;u={signal:x.signal,timeout:setTimeout(()=>{d=!0;try{x.abort(eT("AbortError","PostHog request timed out"+((_=t.timeout)?` after ${_}ms`:"")))}catch(w){h(w)}var _},t.timeout)}}let f=!1;const h=x=>{var _;f||(f=!0,d&&(x==null?void 0:x.name)==="AbortError"||TR(x)?me.warn(x):me.error(x),(_=t.callback)===null||_===void 0||_.call(t,{statusCode:0,error:x}))};let g=0;const v=()=>{$y-=g,g=0,u&&clearTimeout(u.timeout)};try{const x=j({method:(t==null?void 0:t.method)||"GET",headers:l,referrerPolicy:"strict-origin",body:i,signal:u==null?void 0:u.signal},t.fetchOptions),_=o??(le(i)?0:void 0);x.keepalive=x.method==="POST"&&!t.rl&&x.keepalive!==!1&&x.body===i&&!le(_)&&_>=0&&52428.8>$y+_,x.keepalive&&(g=_,$y+=g),fh(n,x).then(w=>w.text().then(S=>{var k;if(f)return;const E={statusCode:w.status,text:S};if(w.status===200)try{E.json=JSON.parse(S)}catch(P){me.error(P)}f=!0,v(),(k=t.callback)===null||k===void 0||k.call(t,E,RR(()=>w.headers.get("Retry-After")))})).catch(w=>{v(),h(w)}).finally(v)}catch(x){v(),h(x)}},B2=t=>{try{var e;const{url:n,encodedBody:r}=PR(t),{contentType:s,body:i,estimatedSize:o}=r??{};if(!i)return;const l=i instanceof Blob?i:new Blob([i],{type:s});if(gr.sendBeacon(n,l))return;const u=He(t.data)?t.data:(e=t.data)===null||e===void 0?void 0:e.batch;if(He(u)&&u.length>1&&(o??0)>16384){const d=Math.ceil(u.length/2),f=h=>He(t.data)?h:j(j({},t.data),{},{batch:h});return B2(j(j({},t),{},{data:f(u.slice(0,d))})),void B2(j(j({},t),{},{data:f(u.slice(d))}))}me.warn(`Beacon of ~${o??0} bytes was rejected by the browser, falling back to ${fh?"fetch":"XHR"}`),fh?IR(j(j({},t),{},{rl:!0})):MR(t)}catch(n){me.warn("Beacon send failed",n)}},Tk=(t,e,n,r)=>{const s=r==="query"?e==="POST"?"sent_at":"_":void 0;return Jh(n===xs.GZipJS?ER(t,"compression"):t,j(j({},s?{[s]:Date.now().toString()}:{}),n===xs.GZipJS?{}:{compression:n}))},HV=(()=>{const t=[];return fh&&t.push({transport:"fetch",method:IR}),Lx&&t.push({transport:"XHR",method:MR}),gr!=null&&gr.sendBeacon&&t.push({transport:"sendBeacon",method:B2}),t})();let OR=!$V&&(Fr==null?void 0:Fr.indexOf("MSIE"))===-1&&(Fr==null?void 0:Fr.indexOf("Mozilla"))===-1;function LR(t,e,n){var r,s,i;n&&(e=j(j({},e),{},{callback:o=>n(o)})),t.__loaded?OR?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,(le(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 u,d,f;const h=j(j({},o),{},{callback:l??(w=>{var S;return(S=o.callback)===null||S===void 0?void 0:S.call(o,w)})});h.timeout=h.timeout||6e4;const g=(u=h.transport)!==null&&u!==void 0?u:"fetch";g==="sendBeacon"&&le(h.compression)&&h.data&&(h.compression=xs.Base64),h.method==="POST"&&h.data&&(h.timestampMode==="capture-body"?h.data=(w=>{var S,k;const E=(He(w)?w:[w]).map(T=>j(j({},T),T.timestamp instanceof Date&&!isNaN(T.timestamp.getTime())?{timestamp:T.timestamp.toISOString()}:{})),P=E[0];return{api_key:(S=P==null||(k=P.properties)===null||k===void 0?void 0:k.token)!==null&&S!==void 0?S:P==null?void 0:P.token,batch:E,sent_at:new Date().toISOString()}})(h.data):h.timestampMode==="body"&&(h.data=((w,S=new Date().toISOString())=>He(w)?w.map(k=>j(j({},k),{},{sent_at:S})):j(j({},w),{},{sent_at:S}))(h.data))),h.url=Tk(h.url,h.method,h.compression,h.timestampMode);const v=HV.filter(w=>!h.disableTransport||!w.transport||!h.disableTransport.includes(w.transport)),x=(d=(f=(function(w,S){for(let k=0;w.length>k;k++)if(S(w[k]))return w[k]})(v,w=>w.transport===g))===null||f===void 0?void 0:f.method)!==null&&d!==void 0?d:v[0].method;if(!x)throw new Error("No available transport method");const _=w=>{try{x(w)}catch(k){var S;TR(k)?me.warn(k):me.error(k),(S=h.callback)===null||S===void 0||S.call(h,{statusCode:0,error:k})}};g!=="sendBeacon"&&!h.preferSyncCompression&&h.data&&h.compression===xs.GZipJS&&e$&&typeof Promise<"u"&&!nm?FV(h).then(w=>{_(w)}).catch(w=>{if(W8(w))return nm=!0,void _(j(j({},h),{},{compression:void 0,url:Tk(o.url,o.method,void 0,o.timestampMode)}));(S=>{if(!S||typeof S!="object")return!1;const k="name"in S?String(S.name):"";return W8(S)||k===aT})(w)&&(nm=!0),_(h)}):_(h)})(e,(o,l)=>{var u,d,f;t.rateLimiter.checkForLimiting(o),400>o.statusCode||(u=(d=t.config).on_request_error)===null||u===void 0||u.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 zV=class{constructor(t,e){this.ol=!0,this.al=[],this.ll=qi((e==null?void 0:e.flush_interval_ms)||3e3,250,5e3,me.createLogger("flush interval"),3e3),this.ul=t}enqueue(t){this.al.push(t),this.cl||this.hl()}unload(){this.dl();const t=this.al.length>0?this.vl():{},e=Object.values(t);[...e.filter(n=>n.url.indexOf("/e")===0),...e.filter(n=>n.url.indexOf("/e")!==0)].map(n=>{this.fl(j(j({},n),{},{callback:void 0}),"sendBeacon")})}enable(){this.ol=!1,this.hl()}hl(){this.ol||(this.cl=setTimeout(()=>{this.dl(),this.pl()},this.ll))}pl(){if(this.al.length>0){const t=this.vl();for(const e in t)this.fl(t[e])}}fl(t,e){try{this.ul(t,e)}catch(n){me.error(n)}}dl(){clearTimeout(this.cl),this.cl=void 0}vl(){const t={},e={};At(this.al,n=>{var r;const s=n,i=((s?s.batchKey:null)||s.url)+(s.batchGroup?`:${s.batchGroup}`:"");le(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.al=[],t}};const UV=["retriesPerformedSoFar"];var BV=class{constructor(t){this._instance=t,this.gl=!1,this.ml=3e3,this.al=[],this.al=[],this.yl=!0,this.resume()}resume(){if(!le(te)&&"onLine"in te.navigator){if(this.yl=te.navigator.onLine,this.bl)return;this.bl=()=>{this.yl=!0,this.pl()},this._l=()=>{this.yl=!1},St(te,"online",this.bl),St(te,"offline",this._l)}}get length(){return this.al.length}retriableRequest(t,e){let{retriesPerformedSoFar:n}=t,r=lT(t,UV);Eo(n)&&(r.url=Jh(r.url,{retry_count:n})),LR(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&&me.warn(`Request failed before receiving an HTTP response; this can happen due to network issues, CORS, browser blocking, or ad blockers. Stopped retrying after ${n??0} retries.`)}(o=r.callback)===null||o===void 0||o.call(r,s)})}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),u=l/2,d=Math.min(18e5,l),f=(Math.random()-.5)*(d-u);return Math.ceil(d+f)})(n),e??0),s=Date.now()+r;this.al.push({retryAt:s,requestOptions:t});let i=`Enqueued failed request for retry in ${r}`;navigator.onLine||(i+=" (Browser is offline)"),me.warn(i),this.gl||(this.gl=!0,this.wl())}wl(){if(this.kl&&clearTimeout(this.kl),this.al.length===0)return this.gl=!1,void(this.kl=void 0);this.kl=setTimeout(()=>{this.yl&&this.al.length>0&&this.pl(),this.wl()},this.ml)}pl(){const t=Date.now(),e=[],n=this.al.filter(r=>t>r.retryAt||(e.push(r),!1));if(this.al=e,n.length>0)for(const{requestOptions:r}of n)this.retriableRequest(r)}unload(){this.kl&&(clearTimeout(this.kl),this.kl=void 0),this.gl=!1,le(te)||(this.bl&&(te.removeEventListener("online",this.bl),this.bl=void 0),this._l&&(te.removeEventListener("offline",this._l),this._l=void 0));for(const{requestOptions:t}of this.al)try{this._instance._send_request(j(j({},t),{},{callback:He(t.data)?void 0:t.callback,transport:"sendBeacon"}))}catch(e){me.error(e)}this.al=[]}},ZV=class{constructor(t){this._instance=t,this.Sl=()=>{var e,n,r,s;this.xl||(this.xl={});const i=this.scrollElement(),o=this.scrollY(),l=i?Math.max(0,i.scrollHeight-i.clientHeight):0,u=o+((i==null?void 0:i.clientHeight)||0),d=(i==null?void 0:i.scrollHeight)||0;this.xl.lastScrollY=Math.ceil(o),this.xl.maxScrollY=Math.max(o,(e=this.xl.maxScrollY)!==null&&e!==void 0?e:0),this.xl.maxScrollHeight=Math.max(l,(n=this.xl.maxScrollHeight)!==null&&n!==void 0?n:0),this.xl.lastContentY=u,this.xl.maxContentY=Math.max(u,(r=this.xl.maxContentY)!==null&&r!==void 0?r:0),this.xl.maxContentHeight=Math.max(d,(s=this.xl.maxContentHeight)!==null&&s!==void 0?s:0)}}get $l(){return this._instance.config.scroll_root_selector}getContext(){return this.xl}resetContext(){const t=this.xl;return this.xl=void 0,setTimeout(this.Sl,0),t}startMeasuringScrollPosition(){St(te,"scroll",this.Sl,{capture:!0}),St(te,"scrollend",this.Sl,{capture:!0}),St(te,"resize",this.Sl)}scrollElement(){if(this.$l){const n=He(this.$l)?this.$l:[this.$l];for(const r of n){var t;const s=te==null||(t=te.document)===null||t===void 0?void 0:t.querySelector(r);if(s)return s}return}var e;return te==null||(e=te.document)===null||e===void 0?void 0:e.documentElement}Cl(t){var e,n;const r=t==="y"?"scrollTop":"scrollLeft";if(this.$l){const s=this.scrollElement();return s&&s[r]||0}return te?t==="y"?te.scrollY||te.pageYOffset||((e=te.document)===null||e===void 0||(e=e.documentElement)===null||e===void 0?void 0:e.scrollTop)||0:te.scrollX||te.pageXOffset||((n=te.document)===null||n===void 0||(n=n.documentElement)===null||n===void 0?void 0:n.scrollLeft)||0:0}scrollY(){return this.Cl("y")}scrollX(){return this.Cl("x")}};const WV=t=>mR(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 Rk=class{constructor(t,e,n,r){this.qe=s=>{const i=this.Tl();if(i&&i.sessionId===s)return;const o={sessionId:s,props:this.Il(this._instance)};this.Ml.register({[L2]:o})},this._instance=t,this.El=e,this.Ml=n,this.Il=r||WV,this.El.onSessionId(this.qe)}Tl(){return this.Ml.props[L2]}getSetOnceProps(){var t;const e=(t=this.Tl())===null||t===void 0?void 0:t.props;return e?"r"in e?gR(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 At(Kx(this.getSetOnceProps()),(e,n)=>{n==="$current_url"&&(n="url"),t[`$session_entry_${v2(n)}`]=e}),t}},Zm=class{on(t,e){return this.Pl[t]||(this.Pl[t]=[]),this.Pl[t].push(e),()=>{this.Pl[t]=this.Pl[t].filter(n=>n!==e)}}emit(t,e){for(const n of this.Pl[t]||[])n(e);for(const n of this.Pl["*"]||[])n(t,e)}constructor(){this.Pl={}}};const mu=tn("[SessionId]"),Mk=864e5;var Ik=class{on(t,e){return this.Rl.on(t,e)}constructor(t,e,n){var r;if(this.Al=null,this.Fl=null,this.Ol=[],this.Dl=void 0,this.Ll=!1,this.Rl=new Zm,this.Nl=(i,o)=>!(!Eo(i)||!Eo(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.Mr=t.config,this.Ml=t.persistence,this.je=void 0,this.Xt=void 0,this._sessionStartTimestamp=null,this.ql=void 0,this._sessionActivityTimestamp=null,this.jl=e||wi,this.Bl=n||wi;const s=this.Mr.persistence_name||this.Mr.token;if(this._sessionTimeoutMs=1e3*qi(this.Mr.session_idle_timeout_seconds||1800,60,36e3,mu.createLogger("session_idle_timeout_seconds"),1800),t.register({$configured_session_timeout_ms:this._sessionTimeoutMs}),this.zl(),this.Hl="ph_"+s+"_window_id",this.Ul="ph_"+s+"_primary_window_exists",this.Wl()){const i=Vt.Dt(this.Hl),o=Vt.Dt(this.Ul);i&&!o?this.je=i:Vt.Pt(this.Hl),Vt.$t(this.Ul,!0)}!((r=this.Mr.bootstrap)===null||r===void 0)&&r.sessionID&&this.setBootstrapSessionId(this.Mr.bootstrap.sessionID),this.Vl()}get sessionTimeoutMs(){return this._sessionTimeoutMs}onSessionId(t){return le(this.Ol)&&(this.Ol=[]),this.Ol.push(t),this.Xt&&t(this.Xt,this.je),()=>{this.Ol=this.Ol.filter(e=>e!==t)}}Wl(){return this.Mr.persistence!=="memory"&&!this.Ml.hi&&Vt.At()}Gl(t){t!==this.je&&(this.je=t,this.Wl()&&Vt.$t(this.Hl,t))}Ql(){return this.je?this.je:this.Wl()?Vt.Dt(this.Hl):null}Zl(t){const e=this.Al;return!ln(e)&&!ln(t)&&5e3>Math.abs(t-e)}Jl(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.Zl(e)||(this.Al=e,this.Ml.register({[Au]:[e,t,n]}))}Kl(){var t;const e=(t=this.Mr)===null||t===void 0?void 0:t.persistence_save_debounce_ms;return Eo(e)&&e>0}Xl(){this.Kl()?this.Ml.refreshKey(Au):(this.Ml.flush(),this.Ml.load())}Yl(){var t;if(ln(this._sessionActivityTimestamp)||this._sessionActivityTimestamp===this.Al)return;this.Xl();const[,e,n]=this.tu();e===this.Xt&&n===this._sessionStartTimestamp&&(this.Al=this._sessionActivityTimestamp,this.Ml.register({[Au]:[this._sessionActivityTimestamp,(t=this.Xt)!==null&&t!==void 0?t:null,this._sessionStartTimestamp]}),this.Ml.flush())}eu(){const[t]=this.tu(),e=Eo(t)?t:0,n=Eo(this._sessionActivityTimestamp)?this._sessionActivityTimestamp:0;return Math.max(e,n)}iu(t){return this.Xl(),this.Nl(t,this.eu())}tu(){const t=this.Ml.props[Au];return He(t)&&t.length===2&&t.push(t[0]),t||[0,null,0]}resetSessionId(){this.Al=null,this.ql=void 0,clearTimeout(this.nu),this.nu=void 0,this.Jl(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 mu.error("Bootstrap sessionID cannot be in the future"):i}catch(i){return void mu.error("Invalid sessionID in bootstrap",i)}})(t);return!le(n)&&(e?this.ql={sessionId:t,sessionStartTimestamp:n}:this.Jl(t,new Date().getTime(),n),!0)}destroy(){this.Ll=!0,this.Yl(),clearTimeout(this.nu),this.nu=void 0,this.Dl&&te&&(te.removeEventListener(Vm,this.Dl,{capture:!1}),this.Dl=void 0),this.Ol=[]}Vl(){this.Dl=()=>{this.Yl(),this.Wl()&&Vt.Pt(this.Ul)},St(te,Vm,this.Dl,{capture:!1})}checkAndGetSessionAndWindowId(t=!1,e=null,n=!1){if(this.Mr.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.Fl=r;else if(ln(this.Fl)||this.Fl>r||r-this.Fl>=1e3){var i,o;(i=(o=this.Ml).syncCookieProperties)===null||i===void 0||i.call(o),this.Fl=r}let[,l,u]=this.tu();const d=!le(s)&&l!==s,f=this.eu();let h=this.Ql();const g=this.ql,v=!!g&&(g.sessionStartTimestamp>r+6e4||r-g.sessionStartTimestamp>Mk),x=g?v:Eo(u)&&Math.abs(r-u)>Mk;let _=!1,w=d,S=!l||!!g;const k=l;let E=!S&&!t&&this.Nl(r,f);if(E&&(E=this.iu(r),E||mu.info("cross-tab refresh kept the session alive",{sessionId:l}),[,l,u]=this.tu(),E||(S=!l||!!g)),S||E||x){w=!1;const M=g&&!v;l=M?g.sessionId:this.jl(),h=this.Bl(),mu.info("new session ID assigned",{sessionId:l,windowId:h,bootstrapped:!!M,changeReason:{noSessionId:S,activityTimeout:E,sessionPastMaximumLength:x}}),u=M?g.sessionStartTimestamp:r,this.ql=void 0,_=!0}else h||(h=this.Bl(),_=!0),w=w||l!==k,w&&(mu.info("adopted cross-tab session id",{sessionId:l,windowId:h}),_=!0);const P=Eo(f)&&t&&!x?f:r,T=Eo(u)?u:new Date().getTime();this.Gl(h),this.Jl(l,P,T),t||this.zl();const I={noSessionId:S,activityTimeout:E,sessionPastMaximumLength:x,crossTabAdoption:w};return _&&this.Ol.forEach(M=>M(l,h,I)),{sessionId:l,windowId:h,sessionStartTimestamp:T,changeReason:_?I:void 0,lastActivityTimestamp:f}}zl(){this.Ll||(clearTimeout(this.nu),this.nu=setTimeout(()=>{if(!this.Ll)if(this.iu(new Date().getTime())){const t=this.Xt;this.resetSessionId(),this.Rl.emit("forcedIdleReset",{idleSessionId:t})}else this.zl()},1.1*this.sessionTimeoutMs))}};const NR=function(t,e){if(!t)return!1;const n=t.userAgent;if(n&&R8(n,e))return!0;try{const r=t==null?void 0:t.userAgentData;if(r!=null&&r.brands&&r.brands.some(s=>R8(s==null?void 0:s.brand,e)))return!0}catch{}return!!t.webdriver};function DR(){return(DR=Ht(function*(){const t=gr==null?void 0:gr.userAgentData;if(t!=null&&t.getHighEntropyValues)try{const e=yield t.getHighEntropyValues(["model"]),n=e==null?void 0:e.model;return st(n)&&n.length>0?n:void 0}catch(e){return void me.info("Unable to resolve $device_model from userAgentData.getHighEntropyValues",e)}})).apply(this,arguments)}function qV(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 jR(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 Wm=(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}},b0=t=>t.toLowerCase(),$R={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=>Wm(n,r))),not_regex:(t,e)=>e.every(n=>t.every(r=>!Wm(n,r))),icontains:(t,e)=>e.map(b0).some(n=>t.map(b0).some(r=>n.includes(r))),not_icontains:(t,e)=>e.map(b0).every(n=>t.map(b0).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 FR(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=$R[r.operator];return!!i&&i(r.values.map(String),[String(s)])})}function Vy(t,e,n){return Mu({distinct_id:t,userPropertiesToSet:e,userPropertiesToSetOnce:n})}const Z2="custom",Ok="i.posthog.com",GV=/^\/static\//,KV=["/s/","/e/","/i/"];var YV=class{constructor(t){this.su={},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(`.${Ok}`,".posthog.com")),e==="https://app.posthog.com"?"https://us.posthog.com":e}get region(){return this.su[this.apiHost]||(this.su[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":Z2),this.su[this.apiHost]}ru(t){if(!GV.test(t))return;const e=this.instance.config.asset_host;return typeof e=="string"&&e.trim().replace(/\/$/,"")||void 0}ou(t){const e=Bo(t);return e?e.protocol+"//"+e.host+e.pathname:void 0}au(t,e,n){if(t==="ui")return n;let r=n;const s=this.instance.config.rewriteRequestPath;if(s){var i;const o=((i=Bo(n))===null||i===void 0?void 0:i.href)||n;r=s(new URL(o)).toString()}if(s&&t==="api"&&KV.some(o=>e.indexOf(o)===0)){const o=this.ou(r);if(o){const l=this.apiHost;let u=this.lu;(u==null?void 0:u.apiHost)===l&&u.rewriteRequestPath===s||(u={apiHost:l,rewriteRequestPath:s,urls:new Set},this.lu=u),u.urls.add(o)}}return r}isIngestionEndpoint(t){const e=this.lu,n=this.ou(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.au(t,e,this.uiHost+e);if(t==="flags")return this.au(t,e,this.flagsApiHost+e);if(t==="assets"){const r=this.ru(e);if(r)return this.au(t,e,`${r}${e}`)}if(this.region===Z2)return this.au(t,e,this.apiHost+e);const n=Ok+e;switch(t){case"assets":return this.au(t,e,`https://${this.region}-assets.${n}`);case"api":return this.au(t,e,`https://${this.region}.${n}`)}}};const Pt=tn("[Surveys]"),VR=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){Pt.error("Failed to persist survey seen state",e)}},QV=[Oy.Popover,Oy.Widget,Oy.API],XV={ignoreConditions:!1,ignoreDelay:!1,displayType:V2.Popover},JV=tn("[PostHog ExternalIntegrations]"),eH={intercom:"intercom-integration",crispChat:"crisp-chat-integration"};var tH=class{constructor(t){this._instance=t}Ho(t,e){var n,r;(n=We.__PosthogExtensions__)===null||n===void 0||(r=n.loadExternalDependency)===null||r===void 0||r.call(n,this._instance,t,s=>{if(s)return JV.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=We.__PosthogExtensions__)===null||e===void 0||(e=e.integrations)===null||e===void 0)&&e[s])&&this.Ho(eH[s],()=>{var o;(o=We.__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=We.__PosthogExtensions__)===null||n===void 0||(n=n.integrations)===null||n===void 0)&&n[s])&&((r=We.__PosthogExtensions__)===null||r===void 0||(r=r.integrations)===null||r===void 0||(r=r[s])===null||r===void 0||r.stop())}}};const HR="autocapture",zR="featureFlags",UR="logs",BR="surveys";var nH=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);le(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)}},rH=class{constructor(t){this.instance=t,this.A=me,this.kv=new nH(t),this.onEvent=e=>Ny(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.uu.on("extensionsRemoteConfig",n);return this.instance.cu&&n(this.instance.cu),Ny(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(Hx);return typeof t=="string"?t:void 0}get library(){return{name:ts.LIB_NAME,version:ts.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 xn(this.instance.is_capturing)?this.instance.is_capturing():!this.isOptedOut}get projectToken(){return this.instance.config.token}getExtension(t){let e;switch(t){case zR:case"featureFlagsCommon":e=this.instance.featureFlags;break;case UR:e=this.instance.logs;break;case BR:e=this.instance.surveys;break;case HR:e=this.instance.autocapture}return e}capture(t,e,n){n?this.instance.capture(t,e,{timestamp:n.timestamp,uuid:n.uuid,$set:n.set,$set_once:n.setOnce}):this.instance.capture(t,e)}registerDynamicEventProperties(t){return Ny(this.instance.hu(t))}sendRequest(t){var e=this;return Ht(function*(n,r={}){var s;const i=(s=r.target)!==null&&s!==void 0?s:"api",o=e.instance.requestRouter.endpointFor(i,n),l=i==="api"&&n==="/i/v1/logs",u={method:r.method,url:r.query?Jh(o,r.query):o,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"?g2.Base64:void 0,timestampMode:r.sentAt};return l&&(u.batchKey="logs"),r.transport==="sendBeacon"?(e.instance._send_request(u),{statusCode:202}):new Promise(d=>{u.callback=d,e.instance._send_request(u)})}).apply(this,arguments)}};const Yf={};let Hy=0;const Qf=()=>{},Lk='Consent opt in/out is not valid with cookieless_mode="always" and will be ignored',gu="Surveys module not available",Nk="sanitize_properties is deprecated. Use before_send instead",ZR="Invalid value for property_denylist config: ",sH=["$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"],iH=["$feature_flag_called","$$heatmap","$snapshot"],Dk=t=>t.charAt(0)==="$"&&!Ue(iH,t),oH=/^[A-Za-z0-9_-]{1,400}$/,jk=/^fb\.[0-9]+\.[0-9]+\.[A-Za-z0-9_-]+(?:\.[A-Za-z0-9_-]+)?$/,$k=/^fb\.[0-9]+\.[0-9]+\.[0-9]+$/,aH=["token","distinct_id",NT],Df="posthog",lH=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},zy=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:sV(he==null?void 0:he.location),persistence:"localStorage+cookie",persistence_name:"",cookie_persisted_properties:[],loaded:Qf,save_campaign_params:!0,custom_campaign_params:[],custom_blocked_useragents:[],save_referrer:!0,capture_pageleave:"if_capture_pageview",defaults:t??"unset",__preview_deferred_init_extensions:!1,__preview_replay_sync_fetch:!1,__preview_external_dependency_versioned_paths:!1,__preview_cookie_wins_on_conflict:!1,debug:qt&&st(qt==null?void 0:qt.search)&&qt.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:(te==null||(e=te.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){me.error("Bad HTTP status: "+n.statusCode+" "+n.text)},get_device_id:n=>n,capture_performance:void 0,name:"posthog",bootstrap:{},disable_compression:!1,session_idle_timeout_seconds:1800,person_profiles:ZT,before_send:void 0,get_current_url:void 0,request_queue_config:{flush_interval_ms:3e3},error_tracking:{},_onCapture:Qf},(n=>({rageclick:n&&n>="2026-05-30"?{content_ignorelist:Jx,ignore_text_selection:!0}:!n||"2025-11-30">n||{content_ignorelist:!0},capture_pageview:!n||"2025-05-24">n||"history_change",session_recording:lH(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))},cH=[["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"]],Fk=t=>{const e={};for(const[s,i]of cH)le(t[s])||(e[i]=t[s]);const n=Gt({},e,t),r=t.__preview_external_dependency_versioned_paths;return le(r)||(le(t.strict_script_versioning)&&(n.strict_script_versioning=!!r),st(r)&&le(t.asset_host)&&(n.asset_host=r)),He(t.property_blacklist)&&(le(t.property_denylist)?n.property_denylist=t.property_blacklist:He(t.property_denylist)?n.property_denylist=[...t.property_blacklist,...t.property_denylist]:me.error(ZR+t.property_denylist)),n};var uH=class{constructor(){this.__forceAllowLocalhost=!1}get du(){return this.__forceAllowLocalhost}set du(t){me.error("WebPerformanceObserver is deprecated and has no impact on network capture. Use `_forceAllowLocalhostNetworkCapture` on `posthog.sessionRecording`"),this.__forceAllowLocalhost=t}},Xf=class Ca{vu(e){if(!e)return;const n=this.fu.indexOf(e);n!==-1&&this.fu.splice(n,1)}pu(e,n){var r;return this.vu(e),this.fu.push(n),(r=n.initialize)===null||r===void 0||r.call(n),n}gu(){return this.config.cookieless_mode==="always"||this.config.cookieless_mode==="on_reject"&&this.consent.isRejected()}mu(){if(this.yu||this.config.reuseAnonymousId||this.config.segment||this.gu())return;const e=this.config.persistence==="memory"||this.config.persistence==="sessionStorage";if(!e&&!this.config.disable_persistence||this.bu)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.yu=!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}`)}_u(){const e=this.persistence;if(!e||this.wu)return;if(this.gu())return void(this.config.cookieless_mode==="on_reject"&&this.get_distinct_id()!=="$posthog_cookieless"&&(this.ku(),this.Su()));if(this.get_distinct_id()!=="$posthog_cookieless")return;this.xu()||e.load(!0);const n=this.get_distinct_id();if(!n||n==="$posthog_cookieless"){const r=this.config.get_device_id(wi());this.register({distinct_id:r,$device_id:r}),e.set_property(Vr,Do)}this.ku()}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.$u=!1,this.Cu=!1,this.webPerformance=new uH,this.Tu=!1,this.version=ts.LIB_VERSION,this.Iu=new Set,this.Mu="",this.uu=new Zm,this.fu=[],this.Eu=[],this.Pu=!1,this.bu=!1,this.yu=!1,this.wu=!1,this._calculate_event_properties=this.calculateEventProperties.bind(this),this.config=zy(),this.SentryIntegration=bV,this.sentryIntegration=r=>(function(s,i){const o=iR(s,i);return{name:sR,processEvent:l=>o(l)}})(this,r),this.__request_queue=[],this.__loaded=!1,this.analyticsDefaultEndpoint="/e/",this.Ru=!1,this.Au=null,this.Fu=null,this.Ou=null,this.scrollManager=new ZV(this),this.pageViewManager=new wk(this),this.rateLimiter=new IV(this),this.requestRouter=new YV(this),this.consent=new dV(this),this.externalIntegrations=new tH(this);const n=(e=Ca.__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=st(r)?{[r]:s}:r;this.setPersonProperties(o),i==null||i({})},set_once:(r,s,i)=>{const o=st(r)?{[r]:s}:r;this.setPersonProperties(void 0,o),i==null||i({})}},this.on("eventCaptured",r=>me.info(`send "${r==null?void 0:r.event}"`,r))}init(e,n,r){if(r&&r!==Df){var s;const i=(s=Yf[r])!==null&&s!==void 0?s:new Ca;return i._init(e,n,r),Yf[r]=i,Yf[Df][r]=i,i}return this._init(e,n,r)}_init(e,n={},r){var s,i,o;const l=st(e)?e.trim():"";if(!l)return me.critical("PostHog was initialized without a token. This likely indicates a misconfiguration. Please check the first argument passed to posthog.init()"),this;var u;if(this.__loaded)return l!==((u=this.config)===null||u===void 0?void 0:u.token)?console.warn("[PostHog.js]",`You have already initialized PostHog with a different project token! Re-initializing is a no-op, so events will keep going to the project this instance was initialized with. To capture into a second project, load PostHog once, then initialize a named instance after the SDK has loaded, e.g. posthog.init('${l}', { ... }, 'project2')`):console.warn("[PostHog.js]","You have already initialized PostHog! Re-initializing is a no-op"),this;this.__loaded=!0,this.config=zy(n.defaults),n.debug=this.Du(n.debug),this.Lu=n,this.Nu=[],n.person_profiles?this.Fu=n.person_profiles:n.process_person&&(this.Fu=n.process_person);const d=zy(n.defaults),f=Fk(n),h=Gt({},d,f,{name:r,token:l});nt(d.rageclick)&&nt(f.rageclick)&&(h.rageclick=Gt({},d.rageclick,f.rageclick)),nt(d.session_recording)&&nt(f.session_recording)&&(h.session_recording=Gt({},d.session_recording,f.session_recording)),this.set_config(h),this.config.on_xhr_error&&me.error("on_xhr_error is deprecated. Use on_request_error instead"),this.compression=n.disable_compression?void 0:xs.GZipJS;const g=this.xu(),v=!this.gu();if(this.persistence=new Iy(this.config,g,!0,v),this.sessionPersistence=this.config.persistence==="sessionStorage"||this.config.persistence==="memory"?this.persistence:new Iy(j(j({},this.config),{},{persistence:"sessionStorage"}),g,!1,v),this.Mu="ph_"+(this.config.persistence_name||this.config.token)+"_session_registered_properties",this.config.persistence!=="memory"&&!g&&Vt.At()){const k=Vt.Dt(this.Mu);He(k)&&k.forEach(E=>{st(E)&&this.Iu.add(E)})}else Vt.Pt(this.Mu);const x=j({},this.persistence.props),_=j({},this.sessionPersistence.props);this.register({$initialization_time:new Date().toISOString()}),this.qu=new zV((k,E)=>this.ju(k,E),this.config.request_queue_config),this.Bu=new BV(this),this.__request_queue=[];const w=this.gu();w||(this.sessionManager=new Ik(this),this.sessionPropsManager=new Rk(this,this.sessionManager,this.persistence),this.sessionManager.onSessionId((k,E,P)=>{(P!=null&&P.activityTimeout||P!=null&&P.sessionPastMaximumLength||P!=null&&P.crossTabAdoption)&&this.zu()})),this.Hu(),this.config.__preview_deferred_init_extensions?(me.info("Deferring extension initialization to improve startup performance"),this.Uu=setTimeout(()=>{this.Uu=void 0,this.Wu(w)},0)):(me.info("Initializing extensions synchronously"),this.Wu(w)),ts.DEBUG=ts.DEBUG||this.config.debug,ts.DEBUG&&me.info("Starting in debug mode",{this:this,config:n,thisC:j({},this.config),p:x,s:_}),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 S=(i=n.bootstrap)===null||i===void 0?void 0:i.distinctID;if(this.bu=!!S&&!zf(S),(o=n.bootstrap)===null||o===void 0?void 0:o.distinctID){const k=n.bootstrap.distinctID,E=this.get_distinct_id(),P=this.persistence.get_property(Vr);if(n.bootstrap.isIdentifiedID&&E!=null&&E!==k&&P==="anonymous")this.identify(k);else if(n.bootstrap.isIdentifiedID&&E!=null&&E!==k&&P==="identified")me.warn("Bootstrap distinctID differs from an already-identified user. The existing identity is preserved. Call reset() before reinitializing if you intend to switch users.");else{const T=this.config.get_device_id(wi()),I=n.bootstrap.isIdentifiedID?T:k;this.persistence.set_property(Vr,n.bootstrap.isIdentifiedID?em:Do),this.register({distinct_id:k,$device_id:I})}}if(w)this.register_once({distinct_id:Sy,$device_id:null},"");else if(!this.get_distinct_id()){const k=this.config.get_device_id(wi());this.register_once({distinct_id:k,$device_id:k},""),this.persistence.set_property(Vr,Do)}return St(te,"onpagehide"in self?"pagehide":"unload",this._handle_unload.bind(this),{passive:!1}),St(te,"pageshow",()=>{var k;this.$u=!1,this.Cu||(k=this.Bu)===null||k===void 0||k.resume()}),n.segment?_k(this,()=>this.Vu()):this.Vu(),xn(this.config._onCapture)&&this.config._onCapture!==Qf&&(me.warn("onCapture is deprecated. Please use `before_send` instead"),this.on("eventCaptured",k=>this.config._onCapture(k.event,k))),this.config.ip&&me.warn('The `ip` config option has NO EFFECT AT ALL and has been deprecated. Use a custom transformation or "Discard IP data" project setting instead. See https://posthog.com/tutorials/web-redact-properties#hiding-customer-ip-address for more information.'),this.config.disableDeviceModel||(function(){return DR.apply(this,arguments)})().then(k=>{k&&this.register({[by]:k})}).catch(Qf),this}Gu(e){const n=e;return st(n.name)&&xn(n.setup)}Qu(e,n){var r=this;this.Gu(e)?n.push(Ht(function*(){try{yield e.setup(r.Zu())}catch(i){me.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){me.error(`Failed to dispose extension "${e.name}"`,o)}}})):this.fu.push(e)}Hu(){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=Ca.__defaultExtensionClasses)===null||r===void 0?void 0:r.featureFlags;var o,l,u;if(i)if(this.featureFlags&&this.featureFlags instanceof i||((o=this.Ju)===null||o===void 0||o.call(this),this.Ju=void 0,this.featureFlags=new i(this)),xn(this.featureFlags.onReloading)&&xn(this.featureFlags.setup)){if(!this.Ju){this.Ju=this.featureFlags.onReloading(()=>{this.uu.emit("featureFlagsReloading",!0)});const d=this.featureFlags;Ht(function*(){try{yield d.setup(s.Zu())}catch(f){me.error("Failed to set up feature flags",f);const h=s.Ju;s.Ju=void 0;try{h==null||h()}catch(g){me.error("Failed to unsubscribe feature flag reloading",g)}try{yield d.dispose()}catch(g){me.error("Failed to dispose feature flags",g)}}})()}}else(l=(u=this.featureFlags).initialize)===null||l===void 0||l.call(u)}Wu(e){const n=performance.now(),r=j(j({},Ca.__defaultExtensionClasses),this.config.__extensionClasses),s=[];var i,o,l,u,d,f,h,g;r.exceptions&&this.fu.push(this.exceptions=(i=this.exceptions)!==null&&i!==void 0?i:new r.exceptions(this)),r.historyAutocapture&&this.fu.push(this.historyAutocapture=new r.historyAutocapture(this)),r.tracingHeaders&&this.fu.push(this.tracingHeaders=new r.tracingHeaders(this)),r.siteApps&&this.fu.push(this.siteApps=new r.siteApps(this)),r.sessionRecording&&!e&&this.fu.push(this.sessionRecording=new r.sessionRecording(this)),this.config.disable_scroll_properties||s.push(()=>{this.scrollManager.startMeasuringScrollPosition()}),r.autocapture&&this.Qu(this.autocapture=new r.autocapture(this),s),r.surveys&&this.Qu(this.surveys=(o=this.surveys)!==null&&o!==void 0?o:new r.surveys(this),s),r.logs&&this.Qu(this.logs=(l=this.logs)!==null&&l!==void 0?l:new r.logs(this),s),r.metrics&&this.fu.push(this.metrics=(u=this.metrics)!==null&&u!==void 0?u:new r.metrics(this)),r.conversations&&this.fu.push(this.conversations=(d=this.conversations)!==null&&d!==void 0?d:new r.conversations(this)),r.productTours&&this.fu.push(this.productTours=new r.productTours(this)),r.heatmaps&&this.fu.push(this.heatmaps=new r.heatmaps(this)),r.webVitalsAutocapture&&this.fu.push(this.webVitalsAutocapture=new r.webVitalsAutocapture(this)),r.exceptionObserver&&this.fu.push(this.exceptionObserver=new r.exceptionObserver(this)),r.deadClicksAutocapture&&this.fu.push(this.deadClicksAutocapture=new r.deadClicksAutocapture(this,xV)),r.toolbar&&this.fu.push(this.toolbar=(f=this.toolbar)!==null&&f!==void 0?f:new r.toolbar(this)),r.experiments&&this.fu.push(this.experiments=(h=this.experiments)!==null&&h!==void 0?h:new r.experiments(this)),r.webMCP&&this.fu.push(this.webMCP=(g=this.webMCP)!==null&&g!==void 0?g:new r.webMCP(this)),this.fu.forEach(v=>{v.initialize&&s.push(()=>{var x;(x=v.initialize)===null||x===void 0||x.call(v)})}),s.push(()=>{if(this.Ku){const v=this.Ku;this.Ku=void 0,this.fu.forEach(x=>{var _;return(_=x.onRemoteConfig)===null||_===void 0?void 0:_.call(x,v)})}}),this.Xu(s,n)}Xu(e,n){for(;e.length>0;){if(this.config.__preview_deferred_init_extensions&&performance.now()-n>=30&&e.length>0)return void(this.Uu=setTimeout(()=>{this.Uu=void 0,this.Xu(e,n)},0));const s=e.shift();if(s)try{s()}catch(i){me.error("Error initializing extension:",i)}}const r=Math.round(performance.now()-n);this.register_for_session({[DT]:this.config.__preview_deferred_init_extensions?"deferred":"synchronous",[jT]:r}),this.config.__preview_deferred_init_extensions&&me.info(`PostHog extensions initialized (${r}ms)`)}il(e){if(!he||!he.body)return me.info("document not ready yet, trying again in 500 milliseconds..."),void setTimeout(()=>{this.il(e)},500);if(this.config.__preview_deferred_init_extensions&&(this.Ku=e),this.cu=e,this.compression=void 0,e.ok){var n;const r=e.config;r.supportedCompression&&!this.config.disable_compression&&(this.compression=Ue(r.supportedCompression,xs.GZipJS)?xs.GZipJS:Ue(r.supportedCompression,xs.Base64)?xs.Base64:void 0),!((n=r.analytics)===null||n===void 0)&&n.endpoint&&(this.analyticsDefaultEndpoint=r.analytics.endpoint)}this.set_config({person_profiles:this.Fu?this.Fu:ZT}),this.uu.emit("extensionsRemoteConfig",e),this.fu.forEach(r=>{var s;return(s=r.onRemoteConfig)===null||s===void 0?void 0:s.call(r,e)})}Vu(){try{this.config.loaded(this)}catch(e){me.critical("`loaded` function failed",e)}if(this.Yu(),this.config.internal_or_test_user_hostname&&(qt==null?void 0:qt.hostname)){const e=qt.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.gu())&&this.tc()},1),this.ec=new yR(this),this.ec.load()}Yu(){var e;this.is_capturing()&&this.config.request_batching&&((e=this.qu)===null||e===void 0||e.enable())}_dom_loaded(){this.is_capturing()&&Ru(this.__request_queue,e=>this.ju(e)),this.__request_queue=[],this.Yu()}_handle_unload(){var e,n,r,s,i,o;this.$u=!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.nc()&&this.capture(nk),(s=this.logs)===null||s===void 0||s.flushLogs("sendBeacon"),(i=this.qu)===null||i===void 0||i.unload(),(o=this.Bu)===null||o===void 0||o.unload()):this.nc()&&this.capture(nk,null,{transport:"sendBeacon"})}_send_request(e){LR(this,e)}ju(e,n){this.Bu?this.Bu.retriableRequest(e,n):this._send_request(n?j(j({},e),{},{transport:n}):e)}_execute_array(e){Hy++;try{let n;const r=[],s=[],i=[];Ru(e,l=>{if(l)if(n=l[0],He(n))i.push(l);else if(xn(l))try{l.call(this)}catch(u){me.error("Error executing queued PostHog call",l,u)}else He(l)&&n==="alias"?r.push(l):He(l)&&n.indexOf("capture")!==-1&&xn(this[n])?i.push(l):s.push(l)});const o=function(l,u){Ru(l,function(d){try{if(He(d[0])){let f=u;At(d,function(h){f=f[h[0]].apply(f,h.slice(1))})}else u[d[0]].apply(u,d.slice(1))}catch(f){me.error("Error executing queued PostHog call",d,f)}})};o(r,this),o(s,this),o(i,this)}finally{Hy--}}push(e){if(Hy>0&&He(e)&&st(e[0])){const n=Ca.prototype[e[0]];return void(xn(n)&&n.apply(this,e.slice(1)))}this._execute_array([e])}get sc(){return{property:ek,persistenceKey:$u,cookieName:"_fbc",pattern:jk,register:(e,n)=>{var r;return(r=this.persistence)===null||r===void 0?void 0:r.register({[$u]:{value:e,delivered:n}})},unregister:()=>{var e;return(e=this.persistence)===null||e===void 0?void 0:e.unregister($u)}}}get rc(){return{property:tk,persistenceKey:Zf,cookieName:"_fbp",pattern:$k,register:(e,n)=>{var r;return(r=this.persistence)===null||r===void 0?void 0:r.register({[Zf]:{value:e,delivered:n}})},unregister:()=>{var e;return(e=this.persistence)===null||e===void 0?void 0:e.unregister(Zf)}}}oc(e){var n;const r=(n=this.persistence)===null||n===void 0?void 0:n.get_property(e.persistenceKey);return st(r)&&e.pattern.test(r)?{value:r,delivered:!1}:nt(r)&&st(r.value)&&e.pattern.test(r.value)?{value:r.value,delivered:r.delivered===!0}:void 0}ac(e,n,r){return n===(r==null?void 0:r.value)?{value:n,pending:!r.delivered}:(e.register(n,!1),{value:n,pending:!0})}lc(e){if(!this.config.save_campaign_params||this.gu())return;const n=qf(e.cookieName);return st(n)&&e.pattern.test(n)?n:void 0}uc(e,n,r,s){if(!this.persistence)return;const i=this.sc;this.persistence.refreshKey(i.persistenceKey);const o=this.oc(i);if(s)return void i.unregister();if(r)return st(n)&&jk.test(n)?this.ac(i,n,o):void i.unregister();const l=st(e)&&oH.test(e)?e:void 0,u=this.lc(i);return u&&((d,f,h)=>{const g=d.split(".");if(f)return g[3]===f;if(!h)return!0;const v=h.value.split(".");return g[3]===v[3]||Number(g[2])>Number(v[2])})(u,l,o)?this.ac(i,u,o):l?(o==null?void 0:o.value.split(".")[3])===l?{value:o.value,pending:!o.delivered}:this.ac(i,`fb.1.${Date.now()}.${l}`,o):o?{value:o.value,pending:!o.delivered}:void 0}cc(e,n,r){if(!this.persistence)return;const s=this.rc;this.persistence.refreshKey(s.persistenceKey);const i=this.oc(s);if(r)return void s.unregister();if(n)return st(e)&&$k.test(e)?this.ac(s,e,i):void s.unregister();const o=this.lc(s);return o?this.ac(s,o,i):i?{value:i.value,pending:!i.delivered}:void 0}hc(e,n){if(!this.persistence)return;this.persistence.refreshKey(e.persistenceKey);const r=this.oc(e);(r==null?void 0:r.value)!==n||r.delivered||e.register(n,!0)}capture(e,n,r){var s,i;if(!(this.__loaded&&this.persistence&&this.sessionPersistence&&this.qu))return void me.uninitializedWarning("posthog.capture");if(!this.is_capturing())return;if(le(e)||!st(e))return void me.error("No event name provided to posthog.capture");if(this._u(),e==="$snapshot"&&this.gu())return;const o=!this.config.opt_out_useragent_filter&&this._is_bot();if(o&&!this.config.__preview_capture_bot_pageviews)return;const l=r!=null&&r.skip_client_rate_limiting?void 0:this.rateLimiter.clientRateLimitContext();if(l!=null&&l.isRateLimited)return void me.critical("This capture call is ignored due to client rate limiting.");let u;n!=null&&n.$current_url&&!st(n==null?void 0:n.$current_url)&&(me.error("Invalid `$current_url` property provided to `posthog.capture`. Input must be a string. Ignoring provided value."),n==null||delete n.$current_url),e!=="$exception"||r!=null&&r.dc||me.warn("Using `posthog.capture('$exception')` is unreliable because it does not attach required metadata. Use `posthog.captureException(error)` instead, which attaches required metadata automatically."),this.sessionPersistence.update_search_keyword(),this.config.save_campaign_params&&(u=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 d=new Date,f=(r==null?void 0:r.timestamp)||d,h=L8(r==null?void 0:r.uuid,wi);let g={uuid:h,event:e,properties:this.calculateEventProperties(e,n||{},f,h)};e==="$pageview"&&this.config.__preview_capture_bot_pageviews&&o&&(g.event="$bot_pageview",g.properties.$browser_type="bot"),l&&(g.properties.$lib_rate_limit_remaining_tokens=l.remainingTokens);const v=e==="$feature_flag_called"&&g.properties.$feature_flag_has_experiment===!1&&this.get_property("$minimal_flag_called_events")===!0;r!=null&&r.$set&&!v&&(g.$set=r==null?void 0:r.$set);const x=nt(n==null?void 0:n.$set)?n.$set:void 0,_=He(n==null?void 0:n.$unset)?n.$unset:[],w=(r==null?void 0:r.$unset)||[],S=B=>{var K;const z=!!(r!=null&&r.$set)&&B in r.$set;return{hasProvided:z||!!x&&B in x,provided:z?r==null||(K=r.$set)===null||K===void 0?void 0:K[B]:x==null?void 0:x[B],unset:_.indexOf(B)!==-1||w.indexOf(B)!==-1}},k=S(ek),E=S(tk),P=[{channel:this.sc,hasProvided:k.hasProvided,update:this.uc(u==null?void 0:u.fbclid,k.provided,k.hasProvided,k.unset)},{channel:this.rc,hasProvided:E.hasProvided,update:this.cc(E.provided,E.hasProvided,E.unset)}];for(const{channel:B,hasProvided:K,update:z}of P)z&&g.properties.$process_person_profile===!0&&z.pending&&!K&&!v&&(g.$set=j({[B.property]:z.value},g.$set));const T=r==null?void 0:r.$unset;T&&(g.$unset=T);const I=v?void 0:this.vc(r==null?void 0:r.$set_once,e!==rk,e===WT);if(I&&(g.$set_once=I),r!=null&&r._noTruncate||(M=this.config.properties_string_max_length,g=(function(B,K){const z=new Set;return(function X(Z,J){if(Z!==Object(Z))return K?K(Z):Z;if(z.has(Z))return;let H;if(z.add(Z),He(Z))H=[],Ru(Z,N=>{H.push(X(N))});else{const N={};At(Td(Z)?qT(Z):Z,(Y,ae)=>{z.has(Y)||(N[ae]=X(Y))}),H=N}return H})(B)})(g,B=>st(B)?B.slice(0,M):B)),g.timestamp=f,le(r==null?void 0:r.timestamp)||(g.properties.$event_time_override_provided=!0,g.properties.$event_time_override_system_time=d),v&&(g.properties=((B,K=[])=>{const z={},X=Z=>{B[Z]!==void 0&&(z[Z]=B[Z])};return K$.forEach(X),K.forEach(X),z})(g.properties,aH)),e===ws.DISMISSED||e===ws.SENT){const B=n==null?void 0:n[Ly.SURVEY_ID],K=n==null?void 0:n[Ly.SURVEY_ITERATION];VR({id:B,current_iteration:K}),g.$set=j(j({},g.$set),{},{[qV({id:B,current_iteration:K},e===ws.SENT?"responded":"dismissed")]:!0})}else e===ws.SHOWN&&(g.$set=j(j({},g.$set),{},{[Ly.SURVEY_LAST_SEEN_DATE]:new Date().toISOString()}));var M;if(e===MV.SHOWN){const B=n==null?void 0:n[Sk.TOUR_TYPE];B&&(g.$set=j(j({},g.$set),{},{[`${Sk.TOUR_LAST_SEEN_DATE}/${B}`]:new Date().toISOString()}))}const R=j(j({},g.properties.$set),g.$set);if(ns(R)||this.setPersonPropertiesForFlags(R),!Xe(this.config.before_send)){const B=this.Os(g);if(!B)return;g=B,g.uuid=L8(g.uuid,wi)}this.sessionRecording&&!this.Pu&&Dk(e)&&(this.Pu=!0,setTimeout(()=>this.Pu=!1,3e4));const O=P.filter(({channel:B,update:K})=>{var z,X,Z;const J=(z=(X=g.$set)===null||X===void 0?void 0:X[B.property])!==null&&z!==void 0?z:nt((Z=g.properties)===null||Z===void 0?void 0:Z.$set)?g.properties.$set[B.property]:void 0;return(K==null?void 0:K.pending)&&J===K.value});this.uu.emit("eventCaptured",g);const D=(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(D),V=j(j(j({method:"POST",url:D,data:g,compression:"best-available",preferSyncCompression:r==null?void 0:r.send_instantly,timestampMode:$?"body":"capture-body",batchKey:r==null?void 0:r._batchKey},$&&(!((i=g.properties)===null||i===void 0)&&i.$session_id)?{batchGroup:g.properties.$session_id+(g.properties.$window_id?`-${g.properties.$window_id}`:"")}:{}),r!=null&&r.transport?{transport:r.transport}:{}),O.length?{fireCallbackOnDrop:!0,callback:B=>{if(B.statusCode>=200&&300>B.statusCode)for(const{channel:K,update:z}of O)this.hc(K,z.value)}}:{});if(!this.config.request_batching||r&&!(r!=null&&r._batchKey)||r!=null&&r.send_instantly){var q;let B;!V.transport&&!V.callback&&ns((q=this.config.request_headers)!==null&&q!==void 0?q:{})&&this.$u&&(B="sendBeacon"),this.ju(V,B)}else this.qu.enqueue(V);return g}_addCaptureHook(e){return this.on("eventCaptured",n=>e(n.event,n))}getExtension(e){var n;return(n=this.fc)===null||n===void 0?void 0:n.getExtension(e)}Zu(){var e;return(e=this.fc)!==null&&e!==void 0?e:this.fc=new rH(this)}hu(e){this.Eu.push(e);let n=!0;return()=>{if(!n)return;n=!1;const r=this.Eu.indexOf(e);r!==-1&&this.Eu.splice(r,1)}}gc(e=!0){var n,r,s;return!!(!((n=this.persistence)===null||n===void 0)&&n.consumeCookieIdentityChange())&&(this.Ou=null,this.persistence.get_property("$user_state")==="anonymous"&&((s=this.sessionPersistence)===null||s===void 0||s.clear(),this.Iu.clear(),this.mc()),(r=this.featureFlags)===null||r===void 0||r.reset(),e&&this.reloadFeatureFlags(),!0)}calculateEventProperties(e,n,r,s,i){if(r=r||new Date,!this.persistence||!this.sessionPersistence)return n;this._u(),this.persistence.syncCookieProperties(),this.gc();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,this.gu()&&(l[NT]=!0),e==="$snapshot"){const k=j(j({},this.persistence.properties()),this.sessionPersistence.properties());return l.distinct_id=k.distinct_id,(!st(l.distinct_id)&&!hn(l.distinct_id)||zf(l.distinct_id))&&me.error("Invalid distinct_id for replay event. This indicates a bug in your implementation"),l}const u=(function(k,E,P,T=!1){var I,M,R,O;if(!Fr)return{};const D=k?[...dd,...E||[]]:[],[$,V]=YA(Fr),[q,B]=(function(se){for(let ie=0;O8.length>ie;ie++){const[de,ge,ue]=O8[ie],re=se.match(de);if(re){const Pe=ue&&se.match(ue)||re;return[ge,(Pe==null?void 0:Pe[1])||""]}}return["",""]})(Fr),K=(function(){const se="u">typeof navigator?navigator:void 0;return se!=null&&se.brave?{brave:!0}:{}})(),z={};le(P)||(z.detectGoogleSearchApp=P);const X={},Z=(I=navigator)===null||I===void 0||(I=I.userAgentData)===null||I===void 0?void 0:I.platform,J=(M=navigator)===null||M===void 0?void 0:M.maxTouchPoints,H=te==null||(R=te.screen)===null||R===void 0?void 0:R.width,N=te==null||(O=te.screen)===null||O===void 0?void 0:O.height,Y=te==null?void 0:te.devicePixelRatio;le(Z)||(X.userAgentDataPlatform=Z),le(J)||(X.maxTouchPoints=J),le(H)||(X.screenWidth=H),le(N)||(X.screenHeight=N),le(Y)||(X.devicePixelRatio=Y);const ae=Gt(Kx({$os:$,$os_version:V,$browser:KA(Fr,navigator.vendor,K,z),$webview_app:q,$webview_app_version:B,$device:QA(Fr),$device_type:v$(Fr,X),$timezone:oR(),$timezone_offset:AV()}),{$current_url:vh(T?qa(qt==null?void 0:qt.href):qt==null?void 0:qt.href,D,yh),$host:qt==null?void 0:qt.host,$pathname:qt==null?void 0:qt.pathname,$raw_user_agent:Fr.length>1e3?Fr.substring(0,997)+"...":Fr,$browser_version:g$(Fr,navigator.vendor,K,z),$browser_language:hR(),$browser_language_prefix:PV(),$screen_height:te==null?void 0:te.screen.height,$screen_width:te==null?void 0:te.screen.width,$viewport_height:te==null?void 0:te.innerHeight,$viewport_width:te==null?void 0:te.innerWidth,$lib:$o.LIB_NAME,$lib_version:$o.LIB_VERSION,$insert_id:Math.random().toString(36).substring(2,10)+Math.random().toString(36).substring(2,10),$time:Date.now()/1e3});return $o.SDK_DIST_CHANNEL&&(ae.$sdk_dist_channel=$o.SDK_DIST_CHANNEL),ae})(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:E}=this.sessionManager.checkAndGetSessionAndWindowId(i,r.getTime(),!0);l.$session_id=k,l.$window_id=E}this.sessionPropsManager&&Gt(l,this.sessionPropsManager.getSessionProps());try{var d;if(this.sessionRecording){const k=this.sessionRecording.sdkDebugProperties,E=!this.Pu&&Dk(e);for(const P in k)(E||Ue(sH,P))&&(l[P]=k[P])}l.$sdk_debug_retry_queue_size=(d=this.Bu)===null||d===void 0?void 0:d.length}catch(k){l.$sdk_debug_error_capturing_properties=String(k)}let f;if(this.requestRouter.region===Z2&&(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=Gt(l,f),e==="$pageview"&&he&&(l.title=he.title),!le(o)){const k=r.getTime()-o;l.$duration=parseFloat((k/1e3).toFixed(3))}Fr&&this.config.opt_out_useragent_filter&&(l.$browser_type=this._is_bot()?"bot":"browser");const h=this.persistence.properties(),g=this.sessionPersistence.properties(),v=l.$groups,x=h.$groups;nt(v)&&!ns(v)&&(l.$groups=j(j({},nt(x)?x:{}),v)),At(["$referrer","$referring_domain"],k=>{k in h&&delete g[k]});const _={};if(this.Eu.length>0)for(const k of this.Eu.slice())try{Gt(_,k())}catch(E){me.error("Failed to produce browser extension event properties",E)}l=Gt({},u,h,g,j(j({},_),l)),l.$is_identified=this._isIdentified(),He(this.config.property_denylist)?At(this.config.property_denylist,function(k){delete l[k]}):me.error(ZR+this.config.property_denylist+" or property_blacklist config: "+this.config.property_blacklist);const w=this.config.sanitize_properties;w&&(me.error(Nk),l=w(l,e));const S=this.yc();return l.$process_person_profile=S,S&&!i&&this.bc("_calculate_event_properties"),l}vc(e,n=!0,r=!1){var s;if(!this.persistence||!this.yc()||this.Tu&&!r)return e;const i=this.persistence.get_initial_props(),o=(s=this.sessionPropsManager)===null||s===void 0?void 0:s.getSetOnceProps();let l=Gt({},i,o||{},e||{});const u=this.config.sanitize_properties;return u&&(me.error(Nk),l=u(l,"$set_once")),n&&(this.Tu=!0),ns(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.gc(),(r=this.sessionPersistence)===null||r===void 0||r.register(e),Object.keys(e).forEach(s=>this.Iu.add(s)),this.mc()}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.Iu.delete(e),this.mc()}_c(e,n){this.register({[e]:n})}zu(){this.Iu.forEach(e=>{var n;(n=this.sessionPersistence)===null||n===void 0||n.unregister(e)}),this.Iu.clear(),this.mc()}mc(){var e;if(!this.Mu)return;if(this.config.persistence==="memory"||!((e=this.sessionPersistence)===null||e===void 0)&&e.hi||!Vt.At())return void Vt.Pt(this.Mu);const n=[];this.Iu.forEach(r=>n.push(r)),n.length>0?Vt.$t(this.Mu,n):Vt.Pt(this.Mu)}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.uu.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:gu}),()=>{})}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:gu})}getActiveMatchingSurveys(e,n=!1){this.surveys?this.surveys.getActiveMatchingSurveys(e,n):e([],{isLoaded:!1,error:gu})}onActiveMatchingSurveysChanged(e){return this.surveys?this.surveys.onActiveMatchingSurveysChanged(e):(e([],{isLoaded:!1,error:gu}),()=>{})}renderSurvey(e,n){var r;(r=this.surveys)===null||r===void 0||r.renderSurvey(e,n)}displaySurvey(e,n=XV){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:gu}}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:gu})}wc(e){return!e||zf(e)?(me.critical("Unique user id has not been set in posthog.identify"),!1):e==="$posthog_cookieless"?(me.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())||(me.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 me.uninitializedWarning("posthog.identify");if(hn(e)&&(e=e.toString(),me.warn("The first argument to posthog.identify was a number, but it should be a string. It has been converted to a string.")),!this.wc(e)||!this.bc("posthog.identify"))return;this._u();const s=this.get_distinct_id(),i=this.persistence.syncCookieProperties()&&this.get_distinct_id()!==s,o=this.gc(!1),l=this.persistence.Da();let u=!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($m),this.register({distinct_id:e}));const h=(this.persistence.get_property("$user_state")||"anonymous")===Do,g=e!==f,v=!g&&h;if(g&&h){var d;const x=this.config.reuseAnonymousId?{distinct_id:e}:{distinct_id:e,$anon_distinct_id:f};this.persistence.set_property(Vr,em),this.setPersonPropertiesForFlags({$set:n||{},$set_once:r||{}},!1),this.config.cookieWinsOnConflict&&this.persistence.La(),this.capture("$identify",x,{$set:n||{},$set_once:r||{}})&&(this.Ou=Vy(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(Vr,em);const x=n||{},_=r||{};this.setPersonPropertiesForFlags({$set:x,$set_once:_},!1),this.config.cookieWinsOnConflict&&this.persistence.La(),this.capture("$set",{$set:x,$set_once:_})&&(this.Ou=Vy(e,n,r))}else(n||r)&&this.setPersonProperties(n,r);g||i||o?(this.reloadFeatureFlags(),this.featureFlags?this.featureFlags.resetFlagCallReported():this.unregister(ja)):v&&(n||r)&&this.reloadFeatureFlags(),u=!0}finally{l&&this.persistence.ja(u)}}setPersonProperties(e,n){if(!e&&!n||!this.bc("posthog.setPersonProperties"))return;const r=Vy(this.get_distinct_id(),e,n);this.Ou!==r?(this.setPersonPropertiesForFlags({$set:e||{},$set_once:n||{}},!0),this.capture("$set",{$set:e||{},$set_once:n||{}})&&(this.Ou=r)):me.info("A duplicate setPersonProperties call was made with the same properties. It has been ignored.")}unsetPersonProperties(e){var n;const r=(He(e)?e:[e]).filter(s=>st(s)&&s.length>0);r.length!==0&&this.bc("posthog.unsetPersonProperties")&&((n=this.featureFlags)===null||n===void 0||n.unsetPersonPropertiesForFlags(r,!0),this.capture("$set",{$unset:r}),this.Ou=null)}group(e,n,r){var s;if(!e||!n)return void me.error("posthog.group requires a group type and group key");(s=this.persistence)===null||s===void 0||s.syncCookieProperties(),this.gc();const i=this.getGroups(),o=i[e]!==n;if(o&&this.resetGroupPropertiesForFlags(e),this.register({$groups:j(j({},i),{},{[e]:n})}),(o||r)&&this.yc()){const l={$group_type:e,$group_key:n};r&&(l.$group_set=r),this.capture(rk,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.bc("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=Hr(e)?e:e==null?void 0:e.resetDeviceID,r=Hr(e)||e==null?void 0:e.bootstrap;this.kc(n,!1,r)}kc(e,n=!1,r){var s,i,o,l,u,d;if(me.info("reset"),!this.__loaded)return me.uninitializedWarning("posthog.reset");const f=r==null?void 0:r.sessionID;this.config.bootstrap=r||((s=this.Lu)===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.nl());const h=this.get_property(Hx),g=this.get_property(by),v=this.get_property(Wf);(l=this.sessionRecording)===null||l===void 0||l.flushBeforeIdentityReset();const x=this.is_capturing();n||this.consent.reset(),n||!x||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 _=(u=this.persistence)===null||u===void 0||(d=u.Da)===null||d===void 0?void 0:d.call(u),w=this.wu;this.wu=w||n;let S=!1;try{var k,E,P,T,I,M,R,O,D,$,V,q,B;if((k=this.persistence)===null||k===void 0||k.clear(),(E=this.sessionPersistence)===null||E===void 0||E.clear(),this.Iu.clear(),this.mc(),le(v)||($=this.persistence)===null||$===void 0||$.register({$session_recording_remote_config:v}),(P=this.surveys)===null||P===void 0||P.reset(),(T=this.featureFlags)===null||T===void 0||T.reset(),(I=this.conversations)===null||I===void 0||I.reset(),(M=this.logs)===null||M===void 0||M.reset(),(R=this.metrics)===null||R===void 0||R.reset(),(O=this.persistence)===null||O===void 0||O.set_property("$user_state","anonymous"),(D=this.sessionManager)===null||D===void 0||D.resetSessionId(),this.Ou=null,this.config.cookieless_mode==="always")this.register_once({distinct_id:Sy,$device_id:null},"");else{const X=this.config.get_device_id(wi());this.register_once({distinct_id:X,$device_id:e?X:h},""),e||le(g)||this.register({[by]:g})}if(this.register({$last_posthog_reset:new Date().toISOString()},1),r&&(r.distinctID&&!this.gu()&&((B=this.persistence)===null||B===void 0||B.set_property("$user_state",r.isIdentifiedID?"identified":"anonymous"),this.register({distinct_id:r.distinctID})),(V=this.featureFlags)===null||V===void 0||V.initialize(),!Xe(f)&&!(!((q=this.sessionManager)===null||q===void 0)&&q.setBootstrapSessionId(f,!0)))){const X=j({},r);delete X.sessionID,this.config.bootstrap=X}delete this.config.identity_distinct_id,delete this.config.identity_hash,delete this.config.identity_claims,S=!0}finally{var K,z;this.wu=w,_&&((K=this.persistence)===null||K===void 0||(z=K.ja)===null||z===void 0||z.call(K,S))}this.reloadFeatureFlags()}shutdown(e){var n=this;return Ht(function*(){if(!n.__loaded)return void me.uninitializedWarning("posthog.shutdown");n.Cu=!0,clearTimeout(n.Uu),n.Uu=void 0;const r=n.Ju;n.Ju=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.qu)===null||i===void 0?void 0:i.unload()},()=>{var i;return(i=n.Bu)===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&&xn(i.then)&&i.then(void 0,o=>{me.error("Error during shutdown",o)})}catch(i){me.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.Sc()}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.xc()}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")?(me.critical("Attempting to create alias for existing People user - aborting."),-2):this.bc("posthog.alias")?(le(n)&&(n=this.get_distinct_id()),e!==n?(this._c($m,e),this.capture("$create_alias",{alias:e,distinct_id:n})):(me.warn("alias matches current distinct_id - skipping api call."),this.identify(e),-1)):void 0}set_config(e){const n=j({},this.config);if(nt(e)){var r,s,i,o,l,u,d,f,h,g,v,x,_,w;Gt(this.config,Fk(e));const T=this.xu();if(this.persistence){const M=this.config.persistence==="sessionStorage"||this.config.persistence==="memory";var S,k;if(M&&this.sessionPersistence!==this.persistence&&((S=this.sessionPersistence)===null||S===void 0||S.remove(),(k=this.sessionPersistence)===null||k===void 0||k.destroy()),this.persistence.update_config(this.config,n,T),M)this.sessionPersistence=this.persistence;else if(this.sessionPersistence===this.persistence)this.sessionPersistence=new Iy(j(j({},this.config),{},{persistence:"sessionStorage"}),T,!1);else{var E;(E=this.sessionPersistence)===null||E===void 0||E.update_config(j(j({},this.config),{},{persistence:"sessionStorage"}),j(j({},n),{},{persistence:"sessionStorage"}),T)}}const I=this.Du(this.config.debug);var P;Hr(I)&&(this.config.debug=I),Hr(this.config.debug)&&(this.config.debug?(ts.DEBUG=!0,vt.At()&&vt.$t("ph_debug",!0),me.info("set_config",{config:e,oldConfig:n,newConfig:j({},this.config)})):(ts.DEBUG=!1,vt.At()&&vt.Pt("ph_debug"))),(r=this.featureFlags)===null||r===void 0||(s=r.updateConfig)===null||s===void 0||s.call(r,this.config,this.nl()),(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(),(u=this.webMCP)===null||u===void 0||u.startIfEnabled(),(d=this.sessionRecording)===null||d===void 0||d.startIfEnabledOrStop(),(f=this.tracingHeaders)===null||f===void 0||f.startIfEnabledOrStop(),(h=this.autocapture)===null||h===void 0||h.startIfEnabled(),(g=this.heatmaps)===null||g===void 0||g.startIfEnabled(),("capture_pageview"in e||"disable_capture_url_hashes"in e)&&((P=this.historyAutocapture)===null||P===void 0||P.startIfEnabledOrStop()),(v=this.exceptionObserver)===null||v===void 0||v.startIfEnabledOrStop(),(x=this.deadClicksAutocapture)===null||x===void 0||x.startIfEnabledOrStop(),(_=this.surveys)===null||_===void 0||_.loadIfEnabled(),this.ku(),(w=this.externalIntegrations)===null||w===void 0||w.startIfEnabledOrStop(),!n.segment&&this.config.segment&&this.persistence&&_k(this,Qf,!1)}}_overrideSDKInfo(e,n){ts.LIB_NAME=e,ts.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,u;Object.values(r).some(Boolean)&&((s=this.sessionManager)===null||s===void 0||s.checkAndGetSessionAndWindowId(),r.sampling&&((i=this.sessionRecording)===null||i===void 0||i.overrideSampling()),r.linked_flag&&((o=this.sessionRecording)===null||o===void 0||o.overrideLinkedFlag()),r.url_trigger&&((l=this.sessionRecording)===null||l===void 0||l.overrideTrigger("url")),r.event_trigger&&((u=this.sessionRecording)===null||u===void 0||u.overrideTrigger("event"))),this.set_config({disable_session_recording:!1})}stopSessionRecording(){this.set_config({disable_session_recording:!0})}sessionRecordingStarted(){var 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:Ca.$c}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:Df;return n!==Df&&(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"}yc(){var e,n;return!(this.config.person_profiles==="never"||this.config.person_profiles==="identified_only"&&!this._isIdentified()&&ns(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))}nc(){return this.config.capture_pageleave===!0||this.config.capture_pageleave==="if_capture_pageview"&&!!this.config.capture_pageview}createPersonProfile(){this.yc()||this.bc("posthog.createPersonProfile")&&this.setPersonProperties({},{})}setInternalOrTestUser(){this.bc("posthog.setInternalOrTestUser")&&this.setPersonProperties({$internal_or_test_user:!0})}bc(e){return this.config.person_profiles==="never"?(me.error(e+' was called, but process_person is set to "never". This call will be ignored.'),!1):(this.mu(),this._c(Bx,!0),!0)}xu(){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")}ku(){var e,n;const r=this.xu();var s,i,o;return this.is_capturing()||(s=this.logs)===null||s===void 0||s.Cc(),((e=this.persistence)===null||e===void 0?void 0:e.hi)!==r&&((i=this.persistence)===null||i===void 0||i.set_disabled(r)),((n=this.sessionPersistence)===null||n===void 0?void 0:n.hi)!==r&&((o=this.sessionPersistence)===null||o===void 0||o.set_disabled(r)),this.mc(),r}opt_in_capturing(e){var n;if(this.config.cookieless_mode!=="always"){if(this.gu()){var r,s,i,o,l,u;(r=this.sessionRecording)===null||r===void 0||r.dispose({discardBufferedEvents:!0}),this.kc(!0,!0),(s=this.sessionManager)===null||s===void 0||s.destroy(),(i=this.pageViewManager)===null||i===void 0||i.destroy(),this.sessionManager=new Ik(this),this.pageViewManager=new wk(this),this.persistence&&(this.sessionPropsManager=new Rk(this,this.sessionManager,this.persistence));const v=(o=(l=this.config.__extensionClasses)===null||l===void 0?void 0:l.sessionRecording)!==null&&o!==void 0?o:(u=Ca.__defaultExtensionClasses)===null||u===void 0?void 0:u.sessionRecording;var d,f;v&&(this.sessionRecording=this.pu(this.sessionRecording,new v(this)),this.cu&&((d=this.sessionRecording)===null||d===void 0||(f=d.onRemoteConfig)===null||f===void 0||f.call(d,this.cu)))}var h,g;this.consent.optInOut(!0),this.ku(),this.Yu(),(n=this.sessionRecording)===null||n===void 0||n.startIfEnabledOrStop(),this.config.cookieless_mode=="on_reject"&&((h=this.surveys)===null||h===void 0||h.loadIfEnabled()),(le(e==null?void 0:e.captureEventName)||e!=null&&e.captureEventName)&&this.capture((g=e==null?void 0:e.captureEventName)!==null&&g!==void 0?g:"$opt_in",e==null?void 0:e.captureProperties,{send_instantly:!0}),this.config.capture_pageview&&this.tc()}else me.warn(Lk)}opt_out_capturing(){this.config.cookieless_mode!=="always"?(this.consent.optInOut(!1),this.ku(),this.config.cookieless_mode==="on_reject"&&this.Su()):me.warn(Lk)}Su(){var e,n;const r=this.sessionRecording;r==null||r.dispose({discardBufferedEvents:!0}),this.get_distinct_id()!=="$posthog_cookieless"&&this.kc(!0,!0),this.register({distinct_id:Sy,$device_id:null}),this.vu(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.tc(),this.Yu()}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.wu&&(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.ku()}_is_bot(){return gr?NR(gr,this.config.custom_blocked_useragents):void 0}tc(){he&&(he.visibilityState==="visible"?this.Ru||(this.Ru=!0,this.capture(Gx,{title:he.title},{send_instantly:!0}),this.Au&&(he.removeEventListener(mh,this.Au),this.Au=null)):this.Au||(this.Au=this.tc.bind(this),St(he,mh,this.Au)))}debug(e){e===!1?(te==null||te.console.log("You've disabled debug mode."),this.set_config({debug:!1})):(te==null||te.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}))}nl(){const e=this.Lu||{};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?(me.warn("Config field 'advanced_disable_decide' is deprecated. Please use 'advanced_disable_flags' instead. The old field will be removed in a future major version."),!0):(function(n,r,s,i,o){const l=r in n&&!Xe(n[r]),u=s in n&&!Xe(n[s]);return l?n[r]:!!u&&(o&&o.warn(`Config field '${s}' is deprecated. Please use '${r}' instead. The old field will be removed in a future major version.`),n[s])})(e,"advanced_disable_flags","advanced_disable_decide",0,me)}Os(e){var n;if(Xe(this.config.before_send))return e;const r=Object.keys((n=e.properties)!==null&&n!==void 0?n:{}).filter(i$),s=He(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),Xe(i)){const l=`Event '${e.event}' was rejected in beforeSend function`;return s$(e.event)?me.warn(`${l}. This can cause unexpected behavior.`):me.info(l),null}i.properties&&!ns(i.properties)||me.warn(`Event '${e.event}' has no properties after beforeSend function, this is likely an error.`)}catch(l){return me.error(`Error in beforeSend function for event '${e.event}':`,l),null}for(const o of r)if(i.properties&&Xe(i.properties[o]))return me.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.Vo)===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)})}Du(e){const n=Hr(e)&&!e,r=vt.At()&&vt.Ot("ph_debug")==="true";return!n&&(!!r||e)}};Xf.__defaultExtensionClasses={},Xf.$c=(()=>{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]]=nV(t.prototype[e[n]])})(Xf,["identify"]);var WR=class{constructor(t){this.disabled=t===!1;const e=nt(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 Uy="$copy_autocapture",By=tn("[AutoCapture]");function Zy(t,e){return e.length>t?e.slice(0,t)+"...":e}function dH(t){if(t.previousElementSibling)return t.previousElementSibling;let e=t;do e=e.previousSibling;while(e&&!ki(e));return e}function fH(t,{e,maskAllElementAttributes:n,maskAllText:r,elementAttributeIgnoreList:s,elementsChainAsString:i,disableCaptureUrlHashes:o}){var l,u;if(!ki(t))return{props:{}};const d=[t],f=new Set([t]);let h=t;for(;h.parentNode&&!vr(h,"body")&&1e3>d.length;){if(Yx(h.parentNode)){const I=h.parentNode.host;if(f.has(I))break;f.add(I),d.push(I),h=I;continue}if(!ki(h.parentNode)||f.has(h.parentNode))break;f.add(h.parentNode),d.push(h.parentNode),h=h.parentNode}const g=e.type==="click"&&t.namespaceURI==="http://www.w3.org/2000/svg"?d.findIndex(I=>vr(I,"button")||vr(I,"a")):-1;g>0&&(r=r||d.slice(0,g+1).some(I=>!dc(I)||cd(I)));const v=[],x={};let _,w=!1,S=!1;if(At(d,I=>{const M=dc(I);if(vr(I,"a")&&!n&&!(s!=null&&s.includes("href"))){const R=I.getAttribute("href");w=!!(M&&R&&Fu(R))&&(o?qa(R):R)}Ue(ld(I),"ph-no-capture")&&(S=!0),v.push((function(R,O,D,$,V=!1){const q=R.tagName.toLowerCase(),B={tag_name:q};Xx.indexOf(q)>-1&&!D&&(B.$el_text=q.toLowerCase()==="a"||q.toLowerCase()==="button"?Zy(1024,gk(R)):Zy(1024,gh(R)));const K=ld(R);O||$!=null&&$.includes("class")||0>=K.length||(B.classes=K.filter(function(J){return J!==""})),At(R.attributes,function(J){var H;if((!cd(R)||["name","id","class","aria-label"].indexOf(J.name)!==-1)&&!($!=null&&$.includes(J.name))&&!O&&Fu(J.value)&&(!st(H=J.name)||H.substring(0,10)!=="_ngcontent"&&H.substring(0,7)!=="_nghost")){let N=J.value;J.name==="class"&&(N=Qx(N).join(" ")),B["attr__"+J.name]=Zy(1024,J.name==="href"&&V?qa(N):N)}});let z=1,X=1,Z=R;for(;Z=dH(Z);)z++,Z.tagName===R.tagName&&X++;return B.nth_child=z,B.nth_of_type=X,B})(I,n,r,s,o)),At((function(R){if(!dc(R))return{};const O={};return At(R.attributes,function(D){if(D.name&&D.name.indexOf("data-ph-capture-attribute")===0){const $=D.name.replace("data-ph-capture-attribute-",""),V=D.value;$&&V&&Fu(V)&&(O[$]=V)}}),O})(I),(R,O)=>{({}).hasOwnProperty.call(x,O)||(x[O]=R)})}),S)return{props:{},explicitNoCapture:S};if(g>0&&(t=d[g],v.splice(0,g)),r||(v[0].$el_text=vr(t,"a")||vr(t,"button")?gk(t):gh(t)),w){var k,E;v[0].attr__href=w;const I=(k=Bo(w))===null||k===void 0?void 0:k.host,M=te==null||(E=te.location)===null||E===void 0?void 0:E.host;I&&M&&I!==M&&(_=w)}return{props:Gt((T=e.type,{$event_type:T,$ce_version:1}),i?{}:{$elements:v},{$elements_chain:(P=v,He(P)?(function(I){return I.map(M=>{var R,O;let D="";if(M.tag_name&&(D+=M.tag_name),M.attr_class){M.attr_class.sort();for(const q of M.attr_class)D+=`.${q.replace(/"/g,"")}`}const $=j(j(j(j({},M.text?{text:M.text}:{}),{},{"nth-child":(R=M.nth_child)!==null&&R!==void 0?R:0,"nth-of-type":(O=M.nth_of_type)!==null&&O!==void 0?O:0},M.href?{href:M.href}:{}),M.attr_id?{attr_id:M.attr_id}:{}),M.attributes),V={};return tm($).sort(([q],[B])=>(function(K,z){return z>K?-1:K>z?1:0})(q,B)).forEach(([q,B])=>V[vk(q.toString())]=vk(B.toString())),D+=":",D+=tm(V).map(([q,B])=>`${q}="${B}"`).join(""),D}).join(";")})((function(I){return I.map(M=>{var R,O;const D={text:(R=M.$el_text)===null||R===void 0?void 0:R.slice(0,400),tag_name:M.tag_name,href:(O=M.attr__href)===null||O===void 0?void 0:O.slice(0,2048),attr_class:_V(M),attr_id:M.attr__id,nth_child:M.nth_child,nth_of_type:M.nth_of_type,attributes:{}};return tm(M).filter(([$])=>$.indexOf("attr__")===0).forEach(([$,V])=>D.attributes[$]=V),D})})(P)):"")},!((l=v[0])===null||l===void 0)&&l.$el_text?{$el_text:(u=v[0])===null||u===void 0?void 0:u.$el_text}:{},_&&e.type==="click"?{$external_click_url:_}:{},x),target:t};var P,T}var hH=class{vo(){this.fo=void 0,clearTimeout(this.po),this.po=void 0}mo(t){var e;if(!dc(t))return!0;const n=(e=this.yo().css_selector_ignorelist)!==null&&e!==void 0?e:Ty,r=new Set;let s=t;for(;s;){if(r.size>=1e3||r.has(s))return!0;r.add(s);const i=s,o=ld(i);if(Ue(o,"ph-no-capture")||Ue(o,"ph-sensitive")||cd(i)||n.some(u=>$2(i,u)))return!0;const l=s.parentNode;s=Yx(l)?l.host:l&&ki(l)?l:null}return!1}bo(t){if(!this.isEnabled||t.type==="pointercancel")return void this.vo();if(t.type==="pointerdown"){this.vo();const r=Gf(t);var e;return void(t.isPrimary&&t.button===0&&!t.ctrlKey&&r&&ki(r)&&(this.fo={target:r,excluded:this.mo(r),id:t.pointerId,x:t.clientX,y:t.clientY,released:!1,distinctId:(e=this._o)===null||e===void 0?void 0:e.distinctId}))}const n=this.fo;n&&(t.pointerId!==n.id||Math.abs(t.clientX-n.x)>5||Math.abs(t.clientY-n.y)>5?this.vo():t.type==="pointerup"&&(n.released=!0,this.po=setTimeout(()=>this.vo(),0)))}wo(t){var e;const n=this.fo;this.vo();const r=Gf(t);if(n!=null&&n.released&&n.target.isConnected&&n.distinctId===((e=this._o)===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&&(vr(r,"html")||vr(r,"body"))){var s;if(n.excluded)return null;const i=(s=this.yo().css_selector_ignorelist)!==null&&s!==void 0?s:Ty;return[r,he==null?void 0:he.documentElement,he==null?void 0:he.body].some(o=>{if(!o)return!1;const l=ld(o);return Ue(l,"ph-no-capture")||Ue(l,"ph-sensitive")||!dc(o)||cd(o)||i.some(u=>$2(o,u))})?null:n.target}}constructor(t){this.ko=t,this.name=HR,this.So=!1,this.xo=null,this.$o=!1,this.Co=new Map,this.To=!1,this.Mr={enabled:!1,rageclick:!1,maskAllElementAttributes:!1,maskAllText:!1,disableCaptureUrlHashes:!1,remoteRequestsDisabled:!1},this.Io=!1,this.ko.refresh(this.Mr),this.rageclicks=new WR(this.Mr.rageclick),this.Mo=null}setup(t){this.Eo(),this._o=t;const e=t.onRemoteConfig(this.onRemoteConfig.bind(this));this.Io?e.dispose():(this.Po=e,this.startIfEnabled())}dispose(){var t;this.Io||(this.Io=!0,this._o=void 0,(t=this.Po)===null||t===void 0||t.dispose(),this.Po=void 0,this.Co.clear(),this.Mo=null,this.Ro())}yo(){return this.ko.refresh(this.Mr),this.Mr}Eo(){var t,e;return this.yo(),this.Mr.url_allowlist=(t=this.Mr.url_allowlist)===null||t===void 0?void 0:t.map(n=>new RegExp(n)),this.Mr.url_ignorelist=(e=this.Mr.url_ignorelist)===null||e===void 0?void 0:e.map(n=>new RegExp(n)),this.Mr}Ao(){if(!this.isBrowserSupported())return void By.info("Disabling Automatic Event Collection because this browser is not supported");if(!te||!he)return;const t=this.Fo=e=>{e=e||(te==null?void 0:te.event);try{if(e.type==="blur")return void this.vo();if(e.type.indexOf("pointer")===0)return void this.bo(e);const n=e.type==="click"?this.wo(e):void 0;if(ln(n))return;this.Oo(e,"$autocapture",n)}catch(n){By.error("Failed to capture event",n)}};if(St(te,"blur",t),St(he,"submit",t,{capture:!0}),St(he,"change",t,{capture:!0}),St(he,"click",t,{capture:!0}),At(["pointerdown","pointermove","pointerup","pointercancel"],e=>{St(he,e,t,{capture:!0})}),this.yo().capture_copied_text){const e=this.Do=n=>{n=n||(te==null?void 0:te.event);try{this.Oo(n,Uy)}catch(r){By.error("Failed to capture clipboard event",r)}};St(he,"copy",e,{capture:!0}),St(he,"cut",e,{capture:!0}),St(he,"paste",e,{capture:!0})}}Ro(){this.vo(),this.Fo&&(te==null||te.removeEventListener("blur",this.Fo),At(["pointerdown","pointermove","pointerup","pointercancel"],t=>{he==null||he.removeEventListener(t,this.Fo,!0)}),he==null||he.removeEventListener("submit",this.Fo,!0),he==null||he.removeEventListener("change",this.Fo,!0),he==null||he.removeEventListener("click",this.Fo,!0),this.Fo=void 0),this.Do&&(he==null||he.removeEventListener("copy",this.Do,!0),he==null||he.removeEventListener("cut",this.Do,!0),he==null||he.removeEventListener("paste",this.Do,!0),this.Do=void 0),this.So=!1}startIfEnabled(){this.isEnabled||this.vo(),!this.Io&&this._o&&this.isEnabled&&!this.So&&(this.Ao(),this.So=!0)}onRemoteConfig(t){if(this.Io)return;if(this.$o=!0,!t.ok)return void this.startIfEnabled();const e=t.config;e.elementsChainAsString&&(this.To=e.elementsChainAsString);const n=e.autocapture_opt_out;var r;Hr(n)&&((r=this._o)===null||r===void 0||r.kv.set("$autocapture_disabled_server_side",n),this.xo=n),this.startIfEnabled()}setElementSelectors(t,e=this){if(this.Io)return;t.size?this.Co.set(e,new Set(t)):this.Co.delete(e);const n=new Set;this.Co.forEach(r=>{r.forEach(s=>n.add(s))}),this.Mo=n}getElementSelectors(t,e){var n;const r=[];return(n=this.Mo)===null||n===void 0||n.forEach(s=>{const i=he==null?void 0:he.querySelectorAll(s);i==null||i.forEach(o=>{t!==o&&e!==o||Ue(r,s)||r.push(s)})}),r}get isEnabled(){var t,e;if(this.Io)return!1;const n=(t=this._o)===null||t===void 0?void 0:t.kv.get(kT),r=this.xo,s=this.yo();if(!s.remoteRequestsDisabled&&!this.$o)return!1;const i=s.remoteRequestsDisabled&&!this.$o;if(ln(r)&&!Hr(n)&&!i)return!1;const o=(e=this.xo)!==null&&e!==void 0?e:!!n;return!!s.enabled&&!o}Oo(t,e="$autocapture",n){if(!this.isEnabled)return void this.vo();let r=n||Gf(t);QT(r)&&(r=r.parentNode||null);const s=this.Eo();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()))&&tR(r,s.rageclick)&&this.Oo(t,"$rageclick",n);const o=e===Uy,l=o?j(j({},s),{},{dom_event_allowlist:void 0}):s;if(r&&(function(h,g,v,x,_,w){var S;if(!te||eb(h)||v!=null&&v.url_allowlist&&!lk(v.url_allowlist,w)||v!=null&&v.url_ignorelist&&lk(v.url_ignorelist,w))return!1;if(v!=null&&v.dom_event_allowlist){const T=v.dom_event_allowlist;if(T&&!T.some(I=>g.type===I))return!1}const{parentIsUsefulElement:k,targetElementList:E}=nR(h,x);if(!(function(T,I){const M=I==null?void 0:I.element_allowlist;if(le(M))return!0;for(const R of T)if(M.some(O=>R.tagName.toLowerCase()===O))return!0;return!1})(E,v)||!F2(E,v==null?void 0:v.css_selector_allowlist)||F2(E,(S=v==null?void 0:v.css_selector_ignorelist)!==null&&S!==void 0?S:Ty))return!1;try{const T=te.getComputedStyle(h);if(T&&T.getPropertyValue("cursor")==="pointer"&&g.type==="click")return!0}catch{}const P=h.tagName.toLowerCase();switch(P){case"html":return!1;case"form":return(_||["submit"]).indexOf(g.type)>=0;case"input":case"select":case"textarea":return(_||["change","click"]).indexOf(g.type)>=0;default:return k?(_||["click"]).indexOf(g.type)>=0:(_||["click"]).indexOf(g.type)>=0&&(Xx.indexOf(P)>-1||h.getAttribute("contenteditable")==="true")}})(r,t,l,o,o?["copy","cut","paste"]:void 0,{config:{get_current_url:s.getCurrentUrl}})){var u;const{props:h,explicitNoCapture:g,target:v}=fH(r,{e:t,maskAllElementAttributes:s.maskAllElementAttributes,maskAllText:s.maskAllText,elementAttributeIgnoreList:s.element_attribute_ignorelist,elementsChainAsString:this.To,disableCaptureUrlHashes:s.disableCaptureUrlHashes});if(g)return!1;const x=this.getElementSelectors(r,v);if(x&&x.length>0&&(h.$element_selectors=x),e===Uy){const _=t.type||"clipboard";if(_!=="paste"){var d,f;const w=te==null||(d=te.getSelection())===null||d===void 0?void 0:d.toString(),S=XT(w);if(!S)return!1;h.$selected_content=S,h.$clipboard_text_length=(f=w==null?void 0:w.length)!==null&&f!==void 0?f:0}h.$copy_type=_}return(u=this._o)===null||u===void 0||u.capture(e,h),!0}}isBrowserSupported(){return xn(he==null?void 0:he.querySelectorAll)}},pH=class{constructor(t){this._instance=t}refresh(t){const e=this._instance.config,n=nt(e.autocapture)?e.autocapture:void 0;t.enabled=!!e.autocapture,t.rageclick=e.rageclick,t.maskAllElementAttributes=e.mask_all_element_attributes,t.maskAllText=e.mask_all_text,t.disableCaptureUrlHashes=e.disable_capture_url_hashes,t.getCurrentUrl=e.get_current_url,t.remoteRequestsDisabled=this._instance.nl(),t.url_allowlist=n==null?void 0:n.url_allowlist,t.url_ignorelist=n==null?void 0:n.url_ignorelist,t.dom_event_allowlist=n==null?void 0:n.dom_event_allowlist,t.element_allowlist=n==null?void 0:n.element_allowlist,t.css_selector_allowlist=n==null?void 0:n.css_selector_allowlist,t.css_selector_ignorelist=n==null?void 0:n.css_selector_ignorelist,t.element_attribute_ignorelist=n==null?void 0:n.element_attribute_ignorelist,t.capture_copied_text=n==null?void 0:n.capture_copied_text}};const Ef=tn("[ExceptionAutocapture]"),Vk=()=>{},Hk=t=>{var e;if(xn(t))return(e=t.__posthog_layer__)!==null&&e!==void 0?e:t.__rrweb_layer__};function hd(t,e,n){try{if(!(e in t))return Vk;const r={next:t[e]},s=n(function(...i){return r.next.apply(this,i)});return xn(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=Hk(i);for(;o;){if(o.next===s)return void(o.next=r.next);i=o.next,o=Hk(i)}}}catch{return Vk}}const mH=tn("[TracingHeaders]"),Ol=tn("[Web Vitals]"),zk=9e5,Uk=["CLS","FCP","INP","LCP"],gH=["INP","LCP"],vH=["interactionTarget","interactionType","inputDelay","processingDuration","presentationDelay","loadState","target","url","timeToFirstByte","resourceLoadDelay","resourceLoadDuration","elementRenderDelay","largestShiftTarget","largestShiftTime","largestShiftValue","firstByteToFCP"],Wy="disabled",Bk="lazy_loading",xo=tn("[SessionRecording]"),yH=[Zx,Wx,$T,FT,VT,HT,zT,UT,BT],_H=tn("[Heatmaps]");function qy(t){return nt(t)&&"clientX"in t&&"clientY"in t&&hn(t.clientX)&&hn(t.clientY)}const S0=tn("[Product Tours]"),Gy=t=>{var e;return!t.config.disable_product_tours&&!!(!((e=t.persistence)===null||e===void 0)&&e.get_property(Ux))},wH=["$set_once","$set"],Ii=tn("[SiteApps]"),Zk="Error while initializing PostHog app with config id ",rb=(t,e)=>t!=null&&t.then?t.then(e):e(t),vu="SDK is not enabled or survey functionality is not yet loaded",Wk="Disabled. Not loading surveys.";var xH=class{constructor(t,e){this.ko=t,this.Tc=e,this.name=BR,this._surveyEventReceiver=null,this._surveyManager=null,this.Ic=!1,this.Mc=!1,this.Ec=[],this.Pc=[],this.Rc=null,this.Ac=null,this.Io=!1,this.Fc=new Set,this.onRemoteConfig=n=>{if(this.Io||this.Mr.disableSurveys)return;if(!n.ok)return this.Mc=!0,this.Oc({isLoaded:!1,error:"Remote config unavailable. Not loading surveys."}),Pt.warn("Remote config unavailable. Not loading surveys.");const r=n.config.surveys;if(Xe(r))return Pt.warn("Flags not loaded yet. Not loading surveys.");this.Dc=Hr(r)?r:r.length>0,Pt.info(`flags response received, isSurveysEnabled: ${this.Dc}`),this.loadIfEnabled()},this.Oc=n=>{this.Pc.slice().forEach(r=>this.Lc(r,n))}}setup(t){if(!this.Io)return this.Nc=t,rb(t.kv.initialize(),()=>{if(this.Nc!==t||this.Io)return;this.Nc=void 0,this._o=t;const e=t.onRemoteConfig(this.onRemoteConfig);this.Io?e.dispose():(this.Po=e,this.loadIfEnabled())})}dispose(){var t,e,n,r,s;this.Io||(this.Io=!0,this.Nc=void 0,this._o=void 0,(t=this.Po)===null||t===void 0||t.dispose(),this.Po=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.Ec=[],this.Pc.forEach(i=>{i.active=!1}),this.Pc=[],(s=this.qc)===null||s===void 0||s.call(this),this.qc=void 0,this.Rc=null,this.Fc.forEach(i=>clearTimeout(i)),this.Fc.clear())}get Mr(){return this.ko.get()}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.Oc()}loadIfEnabled(){if(this.Io||!this._o)return;const t=this.Mr;if(this._surveyManager)return;if(this.Ic)return void Pt.info("Already initializing surveys, skipping...");if(t.disableSurveys)return void Pt.info(Wk);if(t.cookielessMode&&this.ko.isOptedOut())return void Pt.info("Not loading surveys in cookieless mode without consent.");const e=this.ko.getExtensions();if(!e)return void this.jc("PostHog Extensions not found.");if(le(this.Dc)&&!t.advancedEnableSurveys)return;const n=this.Dc||t.advancedEnableSurveys;this.Ic=!0,this.Mc=!1;try{const r=e.generateSurveys;if(r)return this.Bc(r,n),void(this.Ic=!1);const s=e.loadExternalDependency;if(!s)return this.jc(qx),void(this.Ic=!1);s(i=>{try{if(this.Io)return;const o=this.ko.getExtensions();i||!(o!=null&&o.generateSurveys)?this.jc("Could not load surveys script",i):this.Bc(o.generateSurveys,n)}finally{this.Ic=!1}})}catch(r){throw this.Ic=!1,this.jc("Error initializing surveys",r),r}}Bc(t,e){var n,r;if(this.Io)return;this._surveyManager=t(e),this._surveyEventReceiver=this.ko.createEventReceiver(this.Oc);const s=(n=(r=this._o)!==null&&r!==void 0?r:this.Tc)===null||n===void 0?void 0:n.kv.get(Nf);s&&this.zc(s),Pt.info("Surveys loaded successfully"),this.Hc(),this.Oc(),this.Uc({isLoaded:!0})}jc(t,e){this.Mc=!0,Pt.error(t,e),this.Oc({isLoaded:!1,error:t}),this.Uc({isLoaded:!1,error:t})}onSurveysLoaded(t){return this.Ec.push(t),this._surveyManager&&this.Uc({isLoaded:!0}),()=>{this.Ec=this.Ec.filter(e=>e!==t)}}getSurveys(t,e=!1){var n;const r=(n=this._o)!==null&&n!==void 0?n:this.Tc;if(!r||this.Io)return;if(this.Mr.disableSurveys)return Pt.info(Wk),t([]);const s=r.kv.get(Nf);if(s&&!e)return t(s,{isLoaded:!0}),void(this.Wc()&&this.getSurveys(()=>{},!0));if(this.Rc)return void this.Rc.then(({surveys:l,context:u})=>{this.Io||t(l,u)}).catch(l=>Pt.error("Error in survey callback",l));const i=this.Vc("/api/surveys/",{method:"GET",query:{token:r.projectToken},sentAt:"query",timeoutMs:this.Mr.requestTimeoutMs}).then(l=>{try{return this.Gc(r,l)}catch(u){return Pt.error("Error processing surveys response",u),this.Gc(r,{statusCode:0,error:u})}},l=>this.Gc(r,{statusCode:0,error:l}));this.Rc=i;const o=()=>{this.Rc===i&&(this.Rc=null)};i.then(l=>{o(),this.Io||(this.Oc(l.context),t(l.surveys,l.context))},o).catch(l=>Pt.error("Error in survey callback",l))}Vc(t,e){const n=this._o;return n?n.sendRequest(t,e):new Promise(r=>r({statusCode:0,error:new Error(vu)}))}Gc(t,e){if(this.Io)return{surveys:[],context:{isLoaded:!1,error:vu}};const n=e.statusCode;if(n!==200||!e.json){const s=`Surveys API could not be loaded, status: ${n}`;return n!==0?Pt.error(s):e.error||Pt.warn(s),this.Ac=Date.now(),{surveys:[],context:{isLoaded:!1,error:s}}}this.Ac=null;const r=e.json.surveys||[];return t.kv.set({[Nf]:r,[Fm]:Date.now()}),this.zc(r),{surveys:r,context:{isLoaded:!0}}}zc(t){var e;const n=t.filter(r=>(function(s){return!(!s.start_date||s.end_date)})(r)&&(jR(r)||(function(s){var i;return!!(!((i=s.conditions)===null||i===void 0||(i=i.actions)===null||i===void 0||(i=i.values)===null||i===void 0)&&i.length)})(r)));(e=this._surveyEventReceiver)===null||e===void 0||e.replace(n)}Wc(){return this.Qc()&&!this.Rc&&!this.Zc()}Qc(){var t,e;const n=(t=(e=this._o)!==null&&e!==void 0?e:this.Tc)===null||t===void 0?void 0:t.kv.get(Fm);return hn(n)&&Date.now()-n>3e5}Zc(){return hn(this.Ac)&&3e5>Date.now()-this.Ac}markSurveyAsSeen(t,e){var n;const r={id:t,current_iteration:(n=e==null?void 0:e.iteration)!==null&&n!==void 0?n:null};VR(r);try{localStorage.setItem("lastSeenSurveyDate",new Date().toISOString())}catch{}this.Oc()}Uc(t){for(const e of this.Ec)try{if(!t.isLoaded)return e([],t);this.getSurveys(e)}catch(n){Pt.error("Error in survey callback",n)}}getActiveMatchingSurveys(t,e=!1){if(!Xe(this._surveyManager))return this._surveyManager.getActiveMatchingSurveys(t,e);Pt.warn("init was not called")}onActiveMatchingSurveysChanged(t){var e,n;if(this.Io)return()=>{};const r={callback:t,active:!0,revision:0};this.Pc.push(r),this.Hc();const s=(e=(n=this._o)!==null&&n!==void 0?n:this.Tc)===null||e===void 0?void 0:e.kv.get(Nf);return this.Mr.disableSurveys||!this._surveyManager&&this.Mc&&!this.Ic||!s&&!Xe(this.Ac)&&!this.Rc?this.Lc(r,{isLoaded:!1}):this._surveyManager&&this.Lc(r),()=>{var i;r.active=!1,this.Pc=this.Pc.filter(o=>o!==r),this.Pc.length===0&&((i=this.qc)===null||i===void 0||i.call(this),this.qc=void 0)}}Hc(){var t,e,n;this._surveyManager&&this.Pc.length>0&&((t=this.qc)!==null&&t!==void 0||(this.qc=(e=(n=this.ko).onMatchingConditionsChanged)===null||e===void 0?void 0:e.call(n,this.Oc)))}Lc(t,e){if(this.Io||!t.active)return;const n=++t.revision,r=s=>{if(!this.Io&&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){Pt.error("Error in active matching surveys callback",i)}};try{e&&!e.isLoaded?r([]):this.getActiveMatchingSurveys(r)}catch(s){Pt.error("Error in active matching surveys callback",s)}}Jc(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}Kc(t){if(Xe(this._surveyManager))return{eligible:!1,reason:vu};const e=typeof t=="string"?this.Jc(t):t;return e?this._surveyManager.checkSurveyEligibility(e):{eligible:!1,reason:"Survey not found"}}Xc(t){if(!this.ko.isCapturing())return{eligible:!1,reason:"PostHog is not capturing, so a survey response cannot be recorded"};if(Xe(this._surveyManager))return{eligible:!1,reason:vu};const e=typeof t=="string"?this.Jc(t):t;return e?this._surveyManager.checkSurveyRenderability(e):{eligible:!1,reason:"Survey not found"}}canRenderSurvey(t){if(Xe(this._surveyManager))return Pt.warn("init was not called"),{visible:!1,disabledReason:vu};const e=this.Xc(t);return{visible:e.eligible,disabledReason:e.reason}}canRenderSurveyAsync(t,e){return Xe(this._surveyManager)?(Pt.warn("init was not called"),Promise.resolve({visible:!1,disabledReason:vu})):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.Xc(i);n({visible:o.eligible,disabledReason:o.reason})}else n({visible:!1,disabledReason:"Survey not found"})},e)})}renderSurvey(t,e,n){var r;if(!this.ko.isCapturing())return;if(Xe(this._surveyManager))return void Pt.warn("init was not called");const s=typeof t=="string"?this.Jc(t):t;if(!(s!=null&&s.id))return void Pt.warn("Survey not found");if(!QV.includes(s.type))return void Pt.warn(`Surveys of type ${s.type} cannot be rendered in the app`);const i=he==null?void 0:he.querySelector(e);if(i){if(!((r=s.appearance)===null||r===void 0)&&r.surveyPopupDelaySeconds){Pt.info(`Rendering survey ${s.id} with delay of ${s.appearance.surveyPopupDelaySeconds} seconds`);const o=setTimeout(()=>{var l,u;this.Fc.delete(o),!this.Io&&this.ko.isCapturing()&&(Pt.info(`Rendering survey ${s.id} with delay of ${(l=s.appearance)===null||l===void 0?void 0:l.surveyPopupDelaySeconds} seconds`),(u=this._surveyManager)===null||u===void 0||u.renderSurvey(s,i,n),Pt.info(`Survey ${s.id} rendered`))},1e3*s.appearance.surveyPopupDelaySeconds);return void this.Fc.add(o)}this._surveyManager.renderSurvey(s,i,n)}else Pt.warn("Survey element not found")}displaySurvey(t,e){var n;if(!this.ko.isCapturing())return;if(Xe(this._surveyManager))return void Pt.warn("init was not called");const r=this.Jc(t);if(!r)return void Pt.warn("Survey not found");let s=r;if(!((n=r.appearance)===null||n===void 0)&&n.surveyPopupDelaySeconds&&e.ignoreDelay&&(s=j(j({},r),{},{appearance:j(j({},r.appearance),{},{surveyPopupDelaySeconds:0})})),e.displayType!==V2.Popover&&e.initialResponses&&Pt.warn("initialResponses is only supported for popover surveys. prefill will not be applied."),e.ignoreConditions===!1){const i=this.Kc(r);if(!i.eligible)return void Pt.warn("Survey is not eligible to be displayed: ",i.reason)}e.displayType!==V2.Inline?this._surveyManager.handlePopoverSurvey(s,e):this.renderSurvey(s,e.selector,e.properties)}cancelPendingSurvey(t){Xe(this._surveyManager)?Pt.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)}};function yu(t,e,n){if(Xe(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 bH=class{constructor(t){this._instance=t,this.Yc=new Set,this.th=new Set,this.eh=new Zm,this.ih=(e,n)=>this.nh(e,n)&&this.sh(e,n)&&this.rh(e,n)&&this.oh(e,n),this.nh=(e,n)=>!(n!=null&&n.event)||(e==null?void 0:e.event)===(n==null?void 0:n.event)}init(){var t,e;le((t=this._instance)===null||t===void 0?void 0:t._addCaptureHook)||(this.ah=(e=this._instance)===null||e===void 0?void 0:e._addCaptureHook((n,r)=>{this.on(n,r)}))}dispose(){var t,e;(t=this.ah)===null||t===void 0||t.call(this),this.ah=void 0,(e=this._instance)===null||e===void 0||(e=e.autocapture)===null||e===void 0||e.setElementSelectors(new Set,this),this.eh=new Zm}register(t){var e,n;if(!le((e=this._instance)===null||e===void 0?void 0:e._addCaptureHook)&&(t.forEach(r=>{var s;this.Yc.add(r),(s=r.steps)===null||s===void 0||s.forEach(i=>{this.th.add((i==null?void 0:i.event)||"")})}),(n=this._instance)===null||n===void 0?void 0:n.autocapture)){const r=new Set;this.Yc.forEach(s=>{var i;(i=s.steps)===null||i===void 0||i.forEach(o=>{o!=null&&o.selector&&r.add(o.selector)})}),this._instance.autocapture.setElementSelectors(r,this)}}replace(t){this.Yc.clear(),this.th.clear(),this.register(t)}on(t,e){e!=null&&t.length!=0&&(this.th.has(t)||this.th.has(e.event))&&this.Yc.forEach(n=>{this.uh(e,n)&&this.eh.emit("actionCaptured",n.name)})}hh(t){this.onAction("actionCaptured",e=>t(e))}uh(t,e){if((e==null?void 0:e.steps)==null)return!1;for(const n of e.steps)if(this.ih(t,n))return!0;return!1}onAction(t,e){return this.eh.on(t,e)}sh(t,e){if(e!=null&&e.url){var n;const r=t==null||(n=t.properties)===null||n===void 0?void 0:n.$current_url;if(!r||typeof r!="string"||!yu(r,e.url,e.url_matching||"contains"))return!1}return!0}rh(t,e){return!!this.dh(t,e)&&!!this.fh(t,e)&&!!this.ph(t,e)}dh(t,e){var n;if(!(e!=null&&e.href))return!0;const r=this.gh(t);if(r.length>0)return r.some(i=>yu(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&&yu((function(i){const o=i.match(/(?::|")href="(.*?)"/);return o?o[1]:""})(s),e.href,e.href_matching||"exact")}fh(t,e){var n;if(!(e!=null&&e.text))return!0;const r=this.gh(t);if(r.length>0)return r.some(u=>yu(u.text,e.text,e.text_matching||"exact")||yu(u.$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(u){const d=[],f=/(?::|")text="(.*?)"/g;let h;for(;!Xe(h=f.exec(u));)d.includes(h[1])||d.push(h[1]);return d})(s),o=e.text,l=e.text_matching||"exact",i.some(u=>yu(u,o,l)));var i,o,l}ph(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}return!1}gh(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}oh(t,e){return!(e!=null&&e.properties)||e.properties.length===0||FR(e.properties.reduce((n,r)=>{const s=He(r.value)?r.value.map(String):r.value!=null?[String(r.value)]:[];return n[r.key]={values:s,operator:r.operator||"exact"},n},{}),t==null?void 0:t.properties)}},SH=class{constructor(t,e){var n,r;this.mh=[],this._instance=t,this.yh=e,this.bh=new Map,this._h=new Map,this.wh=new Map,this.kh=(n=this._instance)===null||n===void 0||(r=n.onSessionId)===null||r===void 0?void 0:r.call(n,s=>this.Sh(s))}xh(t){return!1}$h(){return null}Ch(t){}Th(){}Ih(t,e){return!!t&&FR(t.propertyFilters,e==null?void 0:e.properties)}Mh(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}Eh(t,e,n){const r=(n===Sf.Activation?this.bh:this._h).get(t);let s=[];return this.Ph(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(u=>u.name===t);return this.Ih(l,e)})}register(t){this.Rh(t,!1)}replace(t){this.Rh(t,!0)}Rh(t,e){var n;le((n=this._instance)===null||n===void 0?void 0:n._addCaptureHook)||(this.Ah(t,e),this.Fh(t,e))}Fh(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.wh.clear(),n.length===0)return void(e&&((r=this.Oh)===null||r===void 0||r.replace([])));this.Oh||(this.Oh=new bH(this._instance),this.Oh.init(),this.Oh.hh(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 u;const d=(u=this.wh.get(l.name))!==null&&u!==void 0?u:[];d.includes(i.id)||d.push(i.id),this.wh.set(l.name,d)}})}),e?this.Oh.replace(s):this.Oh.register(s)}Dh(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)})}Ah(t,e){var n,r;const s=t.filter(u=>{var d,f;return((d=u.conditions)===null||d===void 0?void 0:d.events)&&((f=u.conditions)===null||f===void 0||(f=f.events)===null||f===void 0||(f=f.values)===null||f===void 0?void 0:f.length)>0}),i=t.filter(u=>{var d,f;return((d=u.conditions)===null||d===void 0?void 0:d.cancelEvents)&&((f=u.conditions)===null||f===void 0||(f=f.cancelEvents)===null||f===void 0||(f=f.values)===null||f===void 0?void 0:f.length)>0}),o=this.Mh(t,Sf.Activation),l=this.Mh(t,Sf.Cancellation);e?(this.bh=o,this._h=l):(this.Dh(this.bh,o),this.Dh(this._h,l)),(s.length!==0||i.length!==0||t.some(u=>{var d;return(d=u.conditions)===null||d===void 0||(d=d.actions)===null||d===void 0||(d=d.values)===null||d===void 0?void 0:d.length}))&&((n=this.ah)!==null&&n!==void 0||(this.ah=(r=this._instance)===null||r===void 0?void 0:r._addCaptureHook((u,d)=>{this.onEvent(u,d)})))}onEvent(t,e){var n,r;const s=this.Lh(),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.Nh(t,i,e);if(l==="consume")return s.info("event consumed activated item, removing it",{event:t,itemId:i}),void this.qh([i]);if(l==="persist")return s.info("shown item promoted to persisted activation",{event:t,itemId:i}),this.jh(i),void this.Bh([i])}if(this._h.has(t)){const l=this.Eh(t,e,Sf.Cancellation);l.length>0&&(s.info("cancel event matched, cancelling items",{event:t,itemsToCancel:l.map(u=>u.id)}),this.qh(l.map(u=>u.id)),l.forEach(u=>this.zh(u.id)))}if(!this.bh.has(t))return;s.info("event name matched",{event:t,eventPayload:e,items:this.bh.get(t)});const o=this.Eh(t,e,Sf.Activation);this.Hh(o.map(l=>l.id))}onAction(t){this.wh.has(t)&&this.Hh(this.wh.get(t)||[])}Hh(t){var e,n;if(t.length===0)return;const r=!!(!((e=this._instance)===null||e===void 0||(n=e.get_session_id)===null||n===void 0)&&n.call(e)),s=[];for(const i of t)r&&this.xh(i)?this.jh(i)&&this.Uh(i):s.push(i);s.length>0&&(this.mh=[...new Set([...this.mh,...s])]),this.Lh().info("updating activated items",{activatedItems:this.getActivatedIds()}),this.Wh()}jh(t){this.mh=this.mh.filter(n=>n!==t);const e=this.Vh();return!e.includes(t)&&(this.Gh([...e,t]),this.Qh(),!0)}qh(t){const e=new Set(t);this.mh=this.mh.filter(s=>!e.has(s));const n=this.Zh(),r=n.filter(s=>!e.has(s));r.length!==n.length&&(this.Gh(r),r.length===0&&this.Jh()),this.Bh(t),this.Wh()}Wh(){try{var t;(t=this.yh)===null||t===void 0||t.call(this)}catch(e){this.Lh().error("Error while handling activated items change",e)}}Kh(){var t;const e=this.$h();if(!e)return{};const n=(t=this._instance)===null||t===void 0||(t=t.persistence)===null||t===void 0?void 0:t.props[e];return n&&typeof n=="object"?n:{}}Uh(t){if(!this.$h())return;const e=this.Kh();this.Ch(j(j({},e),{},{[t]:Date.now()}))}Bh(t){if(!this.$h())return;const e=this.Kh(),n={};let r=!1;for(const[s,i]of Object.entries(e))t.includes(s)?r=!0:n[s]=i;r&&(ns(n)?this.Th():this.Ch(n))}Xh(){this.$h()&&this.Th()}getActivationTimestamp(t){if(!this.Vh().includes(t))return;const e=this.Kh()[t];return hn(e)?e:void 0}Zh(){var t;const e=this.Yh();return((t=this._instance)===null||t===void 0||(t=t.persistence)===null||t===void 0?void 0:t.props[e])||[]}Vh(){var t,e,n;const r=this.Zh();if(r.length===0)return[];const s=(t=this._instance)===null||t===void 0||(t=t.persistence)===null||t===void 0?void 0:t.props[this.td()],i=(e=this._instance)===null||e===void 0||(n=e.get_session_id)===null||n===void 0?void 0:n.call(e);return i&&s===i?r:[]}Qh(){var t,e;const n=(t=this._instance)===null||t===void 0||(e=t.get_session_id)===null||e===void 0?void 0:e.call(t);n&&this.ed(n)}Jh(){this.nd()}Sh(t){var e;const n=(e=this._instance)===null||e===void 0||(e=e.persistence)===null||e===void 0?void 0:e.props[this.td()];if(n&&n!==t){const r=this.Zh(),s=this.Kh();r.length>0&&(this.Gh([]),r.filter(i=>hn(s[i])).forEach(i=>this.zh(i))),this.Jh(),this.Xh(),r.length>0&&this.Wh()}}getActivatedIds(){return[...new Set([...this.Vh(),...this.mh])].filter(t=>!this.sd(t))}dispose(){var t,e,n;(t=this.kh)===null||t===void 0||t.call(this),this.kh=void 0,(e=this.ah)===null||e===void 0||e.call(this),this.ah=void 0,(n=this.Oh)===null||n===void 0||n.dispose(),this.Oh=void 0}reset(){this.mh=[],this.Zh().length>0&&this.Gh([]),this.Jh(),this.Xh(),this.Wh()}getEventToItemsMap(){return this.bh}rd(){return this.Oh}},kH=class extends SH{constructor(t,e){super(t,e)}Yh(){return RT}td(){return MT}$h(){return IT}Ch(t){var e;(e=this._instance)===null||e===void 0||(e=e.persistence)===null||e===void 0||e.register({$surveys_activated_timestamps:t})}Th(){var t;(t=this._instance)===null||t===void 0||(t=t.persistence)===null||t===void 0||t.unregister("$surveys_activated_timestamps")}xh(t){var e;let n;this.Ph(s=>{n=s.find(i=>i.id===t)});const r=n==null||(e=n.appearance)===null||e===void 0?void 0:e.surveyPopupDelaySeconds;return hn(r)&&r>0}od(){return ws.SHOWN}Ph(t){var e;(e=this._instance)===null||e===void 0||e.getSurveys(t)}zh(t){var e;(e=this._instance)===null||e===void 0||e.cancelPendingSurvey(t)}Lh(){return Pt}Gh(t){var e;(e=this._instance)===null||e===void 0||(e=e.persistence)===null||e===void 0||e.register({$surveys_activated:t})}ed(t){var e;(e=this._instance)===null||e===void 0||(e=e.persistence)===null||e===void 0||e.register({$surveys_activated_session:t})}nd(){var t;(t=this._instance)===null||t===void 0||(t=t.persistence)===null||t===void 0||t.unregister("$surveys_activated_session")}sd(){return!1}Nh(t,e,n){var r;if(t===ws.SENT&&(n==null||(r=n.properties)===null||r===void 0?void 0:r.$survey_completed)===!1)return"ignore";let s;return this.Ph(i=>{s=i.find(o=>o.id===e)}),!s||(function(i){var o;return jR(i)&&!!(!((o=i.conditions)===null||o===void 0||(o=o.events)===null||o===void 0)&&o.repeatedActivation)||i.schedule==="always"})(s)?t===ws.SHOWN?"consume":"ignore":t===ws.SHOWN?"persist":t===ws.DISMISSED||t===ws.SENT?"consume":"ignore"}getSurveys(){return this.getActivatedIds()}getEventToSurveys(){return this.getEventToItemsMap()}},CH=class{constructor(t){this._instance=t}initialize(){}get(t){if(typeof t=="string")return this._instance.get_property(t);const e={};for(const n of t){const r=this._instance.get_property(n);le(r)||(e[n]=r)}return e}set(t,e){this._instance.register(typeof t=="string"?{[t]:e}:t)}remove(t){typeof t!="string"?t.forEach(e=>this._instance.unregister(e)):this._instance.unregister(t)}},EH=class{constructor(t){this._instance=t}get(){const t=this._instance.config;return{disableSurveys:t.disable_surveys,cookielessMode:!!t.cookieless_mode,advancedEnableSurveys:t.advanced_enable_surveys,requestTimeoutMs:t.surveys_request_timeout_ms}}isOptedOut(){return this._instance.consent.isOptedOut()}isCapturing(){return this._instance.is_capturing()}getExtensions(){const t=We==null?void 0:We.__PosthogExtensions__;if(!t)return;const{generateSurveys:e,loadExternalDependency:n}=t;return{generateSurveys:e?r=>e(this._instance,r):void 0,loadExternalDependency:n?r=>n(this._instance,"surveys",r):void 0}}createEventReceiver(t){return new kH(this._instance,t)}onMatchingConditionsChanged(t){const e=this._instance._addCaptureHook(i=>{i!=="$pageview"&&i!==ws.SHOWN&&i!==ws.DISMISSED&&i!==ws.SENT||t()}),n=()=>t();St(te,"PHSurveyShown",n);let r=!1;const s=this._instance.onFeatureFlags(()=>{r&&t()});return r=!0,()=>{r=!1,e(),s(),te==null||te.removeEventListener("PHSurveyShown",n)}}};const PH=te!=null&&te.location?zm(te.location.hash,"__posthog")||zm(location.hash,"state"):null,qk="_postHogToolbarParams",Gk=tn("[Toolbar]"),Kk=tn("[FeatureFlags]"),Ll=tn("[FeatureFlags]",{debugEnabled:!0}),Ky=`" failed. Feature flags didn't load in time.`,AH=[502,504],Yk=["click","keydown","wheel","touchstart","pointerdown"],Qk="connection_error",Xk=t=>{const e={};for(let n=0;t.length>n;n++)e[t[n]]=!0;return e},Jk=t=>{const e={};for(const[n,r]of tm(t||{}))r&&(e[n]=r);return e};var TH=class{constructor(t){this.name="featureFlags",this.ad=!1,this.featureFlagEventHandlers=[],this.A=Kk,this.ld={},this.ud={},this.hd=[],this.dd=new Set,this.vd=new Set,this.fd=!1,this.pd=!1,this.gd=0,this.md=!1,this.yd=!1,this.bd=!1,this._d=!1,this.wd=0,this.kd=!1,this.rn=()=>{const e=this.Sd();this.wd=0,e&&this.reloadFeatureFlags()},this.xd=()=>{var e,n;const r=this.$d,s=(e=this.Cd)!==null&&e!==void 0?e:r;le(r)||le(s)||this.Mr.remoteRequestsDisabled||!this.Td||this.Td.visibilityState==="hidden"||Date.now()-((n=this.Id)!==null&&n!==void 0?n:0)<s||(this.Cd=this.kd||!this.Mr.idleRefreshBackoff?r:Math.min(2*s,36e5),this.kd=!1,this.reloadFeatureFlags(),this.Md())},this.Ed=()=>{this.kd&&this.Cd===this.$d||this.Pd()},this.sn=()=>{var e;((e=this.Td)===null||e===void 0?void 0:e.visibilityState)==="visible"&&this.Pd()},this.ko=t}get Rd(){}Ad(){this._o&&this.Fd()}setup(t){try{this.Od=typeof window>"u"?void 0:window,this.Td=typeof document>"u"?void 0:document}catch{this.Od=void 0,this.Td=void 0}return this.Nc=t,this.A=t.logger.createLogger("[FeatureFlags]"),rb(t.kv.initialize(),()=>{this.Nc===t&&(this.Nc=void 0,this._o=t,this.Dd(t))})}Dd(t){var e;if(this._o===t)return this.Od&&St(this.Od,"online",this.rn),this.Fd(),this.Ld=t.registerDynamicEventProperties(()=>this.Nd()?this.ld:this.ud),this.qd=(e=this.Rd)===null||e===void 0?void 0:e.onCrossTabFeatureFlagChange(()=>{this.jd(),this.Bd(),this.zd()}),this.Bd(),this.initialize()}Pd(){this.kd=!0,this.Cd=this.$d,this.xd()}Fd(){var t;const e=this.Mr.refreshIntervalMs,n=!this.Mr.remoteRequestsDisabled&&this.Td&&!le(e)&&e>0?e:void 0;this.Mr.idleRefreshBackoff||(this.Cd=n),n!==this.$d&&(this.Hd(),le(n)||(this.$d=n,this.Cd=n,this.Md(),!((t=this.Td)===null||t===void 0)&&t.addEventListener&&(St(this.Td,mh,this.sn),Ru(Yk,r=>{St(this.Td,r,this.Ed,{capture:!0})}))))}Md(){le(this.$d)||(le(this.Ud)||clearInterval(this.Ud),this.Id=Date.now(),this.Ud=setInterval(this.xd,this.$d))}Hd(){var t,e;le(this.Ud)||(clearInterval(this.Ud),this.Ud=void 0,(t=this.Td)===null||t===void 0||(e=t.removeEventListener)===null||e===void 0||e.call(t,"visibilitychange",this.sn),Ru(Yk,n=>{var r,s;(r=this.Td)===null||r===void 0||(s=r.removeEventListener)===null||s===void 0||s.call(r,n,this.Ed,{capture:!0})})),this.$d=void 0,this.Cd=void 0,this.kd=!1,this.Id=void 0}destroy(){this.Wd()}dispose(){this.Wd()}Wd(){var t,e,n;this.Hd(),this.gd++,this.yd=!1,this.Nc=void 0,this.Vd(this.dd,"cancelled"),this.Vd(this.vd,"cancelled"),this._o&&(this.Gd(),(t=this.Ld)===null||t===void 0||t.dispose(),this.Ld=void 0,(e=this.qd)===null||e===void 0||e.call(this),this.qd=void 0,this.hd=[],(n=this.Od)===null||n===void 0||n.removeEventListener("online",this.rn),this._o=void 0)}get Mr(){return this.ko.get()}Qd(t){var e;return this.Zd&&t in this.Zd?this.Zd[t]:(e=this._o)===null||e===void 0?void 0:e.kv.get(t)}jd(){return!!this.Zd&&(this.Zd=void 0,!0)}Jd(){var t;return!le((t=this._o)===null||t===void 0?void 0:t.kv.get("$enabled_feature_flags"))&&this.jd()}$t(t){this.Kd(()=>{var e;return(e=this._o)===null||e===void 0?void 0:e.kv.set(t)})}Xd(t,e,n){if(!this.Rd||!t.$enabled_feature_flags)return;const r=this.Qd("$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,u=l?o:n&&!He(i)?Object.keys(i||{}):Array.from(new Set([...Object.keys(r),...Object.keys(s)])),d=this.Qd("$feature_flag_payloads")||{},f=t.$feature_flag_payloads||{},h=l||n?u:Array.from(new Set([...Object.keys(d),...Object.keys(f)])),g=!l&&!n,v=!!g||u,x=!!g||h,_={[No]:v,[_i]:v,[$a]:x};t.$feature_flag_details&&(_[cc]=v);for(const w of[uc,Ua,Bf])le(t[w])||(_[w]=!0);this.Rd.markCrossTabFeatureFlagChanges(_)}Pt(t){this.Kd(()=>{var e;return(e=this._o)===null||e===void 0?void 0:e.kv.remove(t)})}Kd(t){try{t()}catch(e){this.A.error("Failed to update feature flag persistence",e)}}Bd(){const t={};for(const r of[No,$a,uc,ji]){const s=this.Qd(r);le(s)||(t[r]=s)}this.ld=t;const e=j({},t),n=this.Qd(_i);if(n)for(const[r,s]of Object.entries(n))e[`$feature/${r}`]=s;this.ud=e}Nd(){const t=this.Mr.cacheTtlMs;if(!t||0>=t)return!1;const e=this.Qd(Ua);return typeof e!="number"||Date.now()-e>t}Yd(){return!!this.Nd()&&(this._d||this.pd||(this._d=!0,this.A.warn("Feature flag cache is stale, triggering refresh..."),this.reloadFeatureFlags()),!0)}tv(){const t=this.Mr.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}):[]}ev(){const t=this.Mr.flagKeys;if(!le(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.Mr,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=>!le(r[d])).reduce((d,f)=>(d[f]=r[f],d),{}),u=Object.keys(o).filter(d=>l[d]).reduce((d,f)=>(d[f]=o[f],d),{});return this.iv({featureFlags:l,featureFlagPayloads:u},void 0,{persist:!1})}}updateFlags(t,e,n){var r,s;const i=n!=null&&n.merge&&(r=this.Qd("$enabled_feature_flags"))!==null&&r!==void 0?r:{},o=n!=null&&n.merge&&(s=this.Qd("$feature_flag_payloads"))!==null&&s!==void 0?s:{},l=j(j({},i),t),u=j(j({},o),e),d={};for(const[f,h]of Object.entries(l))d[f]={key:f,enabled:U8(h),variant:B8(h),reason:void 0,metadata:le(u==null?void 0:u[f])?void 0:{id:0,version:void 0,description:void 0,payload:u[f]}};this.iv({flags:d})}get hasLoadedFlags(){return this.fd}getFlags(){return Object.keys(this.getFlagVariants())}getFlagsWithDetails(){const t=this.Qd(cc),e=this.Qd(ji),n=this.Qd(Wl);if(!n&&!e)return t||{};const r=Gt({},t||{}),s=[...new Set([...Object.keys(n||{}),...Object.keys(e||{})])];for(const l of s){var i,o;const u=r[l],d=e==null?void 0:e[l],f=le(d)?(i=u==null?void 0:u.enabled)!==null&&i!==void 0&&i:!!d,h=le(d)?u==null?void 0:u.variant:typeof d=="string"?d:void 0,g=n==null?void 0:n[l],v=j(j({},u),{},{enabled:f,variant:f?h??(u==null?void 0:u.variant):void 0});f!==(u==null?void 0:u.enabled)&&(v.original_enabled=u==null?void 0:u.enabled),h!==(u==null?void 0:u.variant)&&(v.original_variant=u==null?void 0:u.variant),g&&(v.metadata=j(j({},u==null?void 0:u.metadata),{},{payload:g,original_payload:u==null||(o=u.metadata)===null||o===void 0?void 0:o.payload})),r[l]=v}return this.ad||(this.A.warn(" Overriding feature flag details!",{flagDetails:t,overriddenPayloads:n,finalDetails:r}),this.ad=!0),r}getAllFeatureFlags(){const t=this.getFlagVariants(),e=this.getFlagPayloads();return Object.keys(t).map(n=>{const r=t[n];return{key:n,enabled:U8(r),variant:B8(r),payload:z8(e[n])}})}getFlagVariants(){const t=this.Qd(_i),e=this.Qd(ji);if(!e)return t||{};const n=Gt({},t||{}),r=Object.keys(e);for(let s=0;r.length>s;s++)n[r[s]]=e[r[s]];return this.ad||(this.A.warn(" Overriding feature flags!",{enabledFlags:t,overriddenFlags:e,finalFlags:n}),this.ad=!0),n}getFlagPayloads(){const t=this.Qd($a),e=this.Qd(Wl);if(!e)return t||{};const n=Gt({},t||{}),r=Object.keys(e);for(let s=0;r.length>s;s++)n[r[s]]=e[r[s]];return this.ad||(this.A.warn(" Overriding feature flag payloads!",{flagPayloads:t,overriddenPayloads:e,finalPayloads:n}),this.ad=!0),n}reloadFeatureFlags(){this.md||this.Mr.featureFlagsDisabled||this.Sd()||(this.pd&&(this.yd=!0),this.nv||(this.hd.slice().forEach(t=>{try{t()}catch(e){this.A.error("Error while running feature flags reloading callback",e)}}),this.nv=setTimeout(()=>{this.sv()},5)))}reloadFeatureFlagsAsync(){return!this._o||this.md||this.Mr.featureFlagsDisabled||this.Mr.remoteRequestsDisabled||this.Sd()?Promise.resolve({status:"skipped"}):new Promise(t=>{this.dd.add(t),this.reloadFeatureFlags()})}Vd(t,e){t.forEach(n=>n({status:e})),t.clear()}Gd(){clearTimeout(this.nv),this.nv=void 0}onReloading(t){return this.hd.push(t),()=>{this.hd=this.hd.filter(e=>e!==t)}}ensureFlagsLoaded(){this.fd||this.pd||this.nv||this.reloadFeatureFlags()}setAnonymousDistinctId(t){this.$anon_distinct_id=t}setReloadingPaused(t){this.md=t}resetFlagCallReported(){this.Pt(ja)}sv(t){var e;this.Gd();const n=this._o;if(!n||this.Mr.remoteRequestsDisabled||this.Sd())return void this.Vd(this.dd,"skipped");if(this.pd)return void(this.yd=!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.Qd("$stored_person_properties")||{}),{},{$lib:n.library.name,$lib_version:n.library.version}),group_properties:this.Qd(Na),timezone:oR()};le(n.deviceId)||(r.$device_id=n.deviceId),(t!=null&&t.disableFlags||this.Mr.featureFlagsDisabled)&&(r.disable_flags=!0);const s=this.tv();s.length&&(r.evaluation_contexts=s);const i=this.ev();le(i)||(r.flag_keys=i);const o=this.Mr.onlyEvaluateSurveyFeatureFlags,l="/flags/?v=2"+(o?"&only_evaluate_survey_feature_flags=true":""),u=this.gd,d=this.dd;this.dd=new Set,this.vd=d,this.pd=!0;const f=()=>{this.yd&&(this.yd=!1,this.sv())},h=w=>{var S,k;const E=(S=w.json)!==null&&S!==void 0?S:{},P=w.statusCode!==200;if(this.pd=!1,u!==this.gd)return void f();if(this.rv(w.statusCode),P||this.yd||(this.$anon_distinct_id=void 0),r.disable_flags&&!this.yd)return void this.Vd(d,"skipped");this.bd=!P;const T=[];w.error?T.push(w.error instanceof Error&&w.error.name==="AbortError"?"timeout":w.error instanceof Error?Qk:"unknown_error"):w.statusCode!==200&&T.push(`api_error_${w.statusCode}`),E.errorsWhileComputingFlags&&T.push("errors_while_computing_flags");const I=!!(!((k=E.quotaLimited)===null||k===void 0)&&k.includes("feature_flags"));I&&T.push("quota_limited"),this.$t({[ph]:T}),I?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.iv(E,P,{partialResponse:o}),this.Vd(d,r.disable_flags?"skipped":T.length||!E.flags&&!E.featureFlags?"error":"loaded"),f()},g=w=>{this.pd=!1,u===this.gd&&(this.$t({[ph]:[Qk]}),this.A.error("Feature flag request failed",w),this.Jd()&&this.zd(!0),this.Vd(d,"error")),f()};let v=(e=this.Mr.requestMaxRetries)!==null&&e!==void 0?e:1;const x=()=>v>0&&u===this.gd,_=()=>{if(u!==this.gd||!this._o||this.Mr.remoteRequestsDisabled)return this.pd=!1,this.Vd(d,"skipped"),void f();try{n.sendRequest(l,{target:"flags",method:"POST",body:r,compression:this.Mr.compression,sentAt:"body",timeoutMs:this.Mr.requestTimeoutMs}).then(w=>{if((S=>AH.includes(S.statusCode)||(k=>k.statusCode===0&&k.error instanceof Error&&k.error.name==="AbortError")(S))(w)&&x())return v--,void setTimeout(_,500);h(w)}).catch(g)}catch(w){g(w)}};_()}Sd(){return lR(this.wd,3)}rv(t){this.wd=cR(t,this.wd,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.bd)return;if(!(this.fd||this.getFlags()&&this.getFlags().length>0))return void this.A.warn('getFeatureFlag for key "'+t+Ky);if(this.Yd())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.bd)return;if(!(this.fd||this.getFlags()&&this.getFlags().length>0))return void this.A.warn('getFeatureFlagResult for key "'+t+Ky);if(this.Yd())return;const n=this.getFlagVariants(),r=t in n,s=n[t],i=this.getFlagPayloads()[t],o=String(s),l=this.Qd("$feature_flag_request_id")||void 0,u=this.Qd("$feature_flag_evaluated_at")||void 0;let d,f=this.Qd("$flag_call_reported")||{};if(this.Mr.deduplicateCallsPerSession){var h;const O=(h=this._o)===null||h===void 0||(h=h.session)===null||h===void 0?void 0:h.sessionId,D=this.Qd(Lf);O&&O!==D&&(f={},d=O)}if(!e.send_event&&"send_event"in e)d&&this.$t({[ja]:f,[Lf]:d});else if(t in f&&f[t].includes(o))d&&this.$t({[ja]:f,[Lf]:d});else{var g,v,x,_,w,S,k,E,P,T,I,M,R;He(f[t])?f[t].push(o):f[t]=[o],this.$t(j({[ja]:f},d?{[Lf]:d}:{}));const O=this.getFeatureFlagDetails(t),D=[...(g=this.Qd("$feature_flag_errors"))!==null&&g!==void 0?g:[]];le(s)&&D.push("flag_missing");const $={$feature_flag:t,$feature_flag_response:s,$feature_flag_payload:i??null,$feature_flag_request_id:l,$feature_flag_evaluated_at:u,$feature_flag_bootstrapped_response:(v=(x=this.Mr.bootstrap)===null||x===void 0||(x=x.featureFlags)===null||x===void 0?void 0:x[t])!==null&&v!==void 0?v:null,$feature_flag_bootstrapped_payload:(_=(w=this.Mr.bootstrap)===null||w===void 0||(w=w.featureFlagPayloads)===null||w===void 0?void 0:w[t])!==null&&_!==void 0?_:null,$used_bootstrap_value:!this.bd};le(O==null||(S=O.metadata)===null||S===void 0?void 0:S.has_experiment)||($.$feature_flag_has_experiment=O.metadata.has_experiment),le(O==null||(k=O.metadata)===null||k===void 0?void 0:k.version)||($.$feature_flag_version=O.metadata.version);const V=(E=O==null||(P=O.reason)===null||P===void 0?void 0:P.description)!==null&&E!==void 0?E:O==null||(T=O.reason)===null||T===void 0?void 0:T.code;V&&($.$feature_flag_reason=V),!(O==null||(I=O.metadata)===null||I===void 0)&&I.id&&($.$feature_flag_id=O.metadata.id),le(O==null?void 0:O.original_variant)&&le(O==null?void 0:O.original_enabled)||($.$feature_flag_original_response=le(O.original_variant)?O.original_enabled:O.original_variant),!(O==null||(M=O.metadata)===null||M===void 0)&&M.original_payload&&($.$feature_flag_original_payload=O==null||(R=O.metadata)===null||R===void 0?void 0:R.original_payload),D.length&&($.$feature_flag_error=D.join(",")),this.ov($)}return r?{key:t,enabled:!!s,variant:typeof s=="string"?s:void 0,payload:z8(i)}:void 0}ov(t){try{var e;(e=this._o)===null||e===void 0||e.capture("$feature_flag_called",t)}catch(n){this.A.error("Failed to capture feature flag call",n)}}getRemoteConfigPayload(t,e){this.av(t,e)}av(t,e){var n=this;return Ht(function*(){const r=n._o;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.tv();i.length&&(s.evaluation_contexts=i);const o=n.ev();let l;le(o)||(s.flag_keys=o);try{var u;const d=(u=(yield r.sendRequest("/flags/?v=2",{target:"flags",method:"POST",body:s,compression:n.Mr.compression,sentAt:"body",timeoutMs:n.Mr.requestTimeoutMs})).json)===null||u===void 0?void 0:u.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.bd)return e.defaultValue;if(!(this.fd||this.getFlags()&&this.getFlags().length>0))return this.A.warn('isFeatureEnabled for key "'+t+Ky),e.defaultValue;const n=this.getFeatureFlag(t,e);return le(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.iv(t,e,n)}iv(t,e,n){if(!this._o)return;this.fd=!0;const r=((s,i={},o={},l={},u,d=Kk)=>{const f=((E,P)=>{const T=E.flags;if(T){const I=Object.fromEntries(Object.keys(T).map(R=>{var O;return[R,(O=T[R].variant)!==null&&O!==void 0?O:T[R].enabled]})),M=Object.fromEntries(Object.keys(T).filter(R=>T[R].enabled).filter(R=>{var O;return!le((O=T[R].metadata)===null||O===void 0?void 0:O.payload)}).map(R=>{var O;return[R,(O=T[R].metadata)===null||O===void 0?void 0:O.payload]}));return j(j({},E),{},{featureFlags:I,featureFlagPayloads:M})}return E.featureFlags&&P.warn("Using an older version of the feature flags endpoint. Please upgrade your PostHog server to the latest version"),E})(s,d),h=f.flags,g=f.featureFlags,v=f.featureFlagPayloads;if(!g)return;const x=s.requestId,_=s.evaluatedAt;if(He(g)){d.warn("v1 of the feature flags endpoint is deprecated. Please use the latest version.");const E={};if(g)for(let P=0;g.length>P;P++)E[g[P]]=!0;return{[No]:g,[_i]:E,[Bf]:!1}}let w=g,S=v,k=h;if(u!=null&&u.partialResponse){const E=Object.keys(w),P=S||{};w=j(j({},i),w),S=j(j({},o),P),E.forEach(T=>{T in P||S==null||delete S[T]}),k=j(j({},l),k)}else if(s.errorsWhileComputingFlags)if(h){const E=new Set(Object.keys(h).filter(T=>{var I;return!(!((I=h[T])===null||I===void 0)&&I.failed)}));w=j(j({},i),Object.fromEntries(Object.entries(w).filter(([T])=>E.has(T))));const P=Object.fromEntries(Object.entries(S||{}).filter(([T])=>E.has(T)));S=j(j({},o),P),E.forEach(T=>{T in P||S==null||delete S[T]}),k=j(j({},l),Object.fromEntries(Object.entries(k||{}).filter(([T])=>E.has(T))))}else w=j(j({},i),w),S=j(j({},o),S),k=j(j({},l),k);return j(j({[No]:Object.keys(Jk(w)),[_i]:w||{},[$a]:S||{},[cc]:k||{},[Bf]:s.minimalFlagCalledEvents===!0},x?{[uc]:x}:{}),_?{[Ua]:_}:{})})(t,this.getFlagVariants(),this.getFlagPayloads(),this.getFlagsWithDetails(),n,this.A);if(r)if((n==null?void 0:n.persist)===!1){const s=!le(this._o.kv.get(_i));this.Zd=r,s||this.$t(r)}else this.jd(),this.Xd(r,t,!!(n!=null&&n.partialResponse)),this.$t(r);else e&&this.Jd();e||(this._d=!1),this.zd(e)}override(t,e=!1){this.A.warn("override is deprecated. Please use overrideFeatureFlags instead."),this.overrideFeatureFlags({flags:t,suppressWarning:e})}overrideFeatureFlags(t){this.lv(t)}lv(t){if(this._o){if(t===!1)return this.Pt([ji,Wl]),this.zd(),void Ll.info("All overrides cleared");if(He(t))return this.$t({[ji]:Xk(t)}),this.zd(),void Ll.info("Flag overrides set",{flags:t});if(t&&typeof t=="object"&&("flags"in t||"payloads"in t)){var e;const n=t;this.ad=!!((e=n.suppressWarning)!==null&&e!==void 0&&e);const r={},s=n.flags,i=n.payloads;return s&&(r[ji]=He(s)?Xk(s):s),i&&(r[Wl]=i),Object.keys(r).length&&this.$t(r),s===!1&&i===!1?this.Pt([ji,Wl]):s===!1?this.Pt(ji):i===!1&&this.Pt(Wl),this.zd(),s===!1?Ll.info("Flag overrides cleared"):s&&Ll.info("Flag overrides set",{flags:s}),void(i===!1?Ll.info("Payload overrides cleared"):i&&Ll.info("Payload overrides set",{payloads:i}))}if(t&&typeof t=="object")return this.$t({[ji]:t}),this.zd(),void Ll.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.fd){const{flags:e,flagVariants:n}=this.uv();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.Qd("$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.Rd)===null||r===void 0||r.markCrossTabFeatureFlagChanges({$active_feature_flags:[t],$enabled_feature_flags:[t],$stored_person_properties:Object.keys(i)}),this.$t({[No]:Object.keys(Jk(l)),[_i]:l,[Da]:j(j({},this.Qd("$stored_person_properties")||{}),i)}),this.zd();try{var u;(u=this._o)===null||u===void 0||u.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.Qd(P2);!r||e?this.hv(t,n):t(r)}hv(t,e){var n=this;return Ht(function*(){const r=n._o;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({[P2]: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)}})()}uv(){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),{})}}zd(t){this.Bd();const{flags:e,flagVariants:n}=this.uv();this.featureFlagEventHandlers.forEach(r=>{try{r(e,n,{errorsLoading:t})}catch(s){this.A.error("Error while running feature flags callback",s)}})}setPersonPropertiesForFlags(t,e=!0){this.dv(t,e)}dv(t,e=!0){const n=this.Qd("$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({[Da]:j(j(j({},n),i),r)}),e&&this.reloadFeatureFlags()}unsetPersonPropertiesForFlags(t,e=!0){const n=j({},this.Qd("$stored_person_properties")||{});t.forEach(r=>{delete n[r]}),this.$t({[Da]:n}),e&&this.reloadFeatureFlags()}resetPersonPropertiesForFlags(t=!0){this.Pt(Da),t&&this.reloadFeatureFlags()}setGroupPropertiesForFlags(t,e=!0){const n=this.Qd("$stored_group_properties")||{},r=j({},n);for(const s of Object.keys(t))r[s]=j(j({},n[s]),t[s]);this.$t({[Na]:r}),e&&this.reloadFeatureFlags()}resetGroupPropertiesForFlags(t){if(t){const e=this.Qd("$stored_group_properties")||{};this.$t({[Na]:j(j({},e),{},{[t]:{}})})}else this.Pt(Na)}reset(){this.gd++,this.Vd(this.dd,"cancelled"),this.Vd(this.vd,"cancelled"),this.yd=!1,this.ld={},this.ud={},this.Zd=void 0,this.fd=!1,this.md=!1,this.bd=!1,this.$anon_distinct_id=void 0,this.Gd(),this.ad=!1,this.wd=0}};const eC=tn("[FeatureFlags]");var RH=class{constructor(t,e=!1){this.vv=!1,this.update(t,e)}update(t,e){this.fv=((n,r)=>{var s,i,o,l,u,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:(u=n.remote_config_refresh_interval_ms)!==null&&u!==void 0?u:3e5,idleRefreshBackoff:le(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:He(n.flag_keys)?n.flag_keys:void 0}})(t,e),!t.evaluation_environments||t.evaluation_contexts||this.vv||(eC.warn("evaluation_environments is deprecated. Use evaluation_contexts instead. evaluation_environments will be removed in a future version."),this.vv=!0),le(t.flag_keys)||He(t.flag_keys)||eC.error("Invalid flag_keys found:",t.flag_keys,"Expected array of non-empty strings")}get(){return this.fv}};const tC=t=>Td(t)&&(t.name==="RangeError"&&t.message.indexOf("Maximum call stack size exceeded")===0||t.name==="InternalError"&&t.message==="too much recursion"),di=tn("[Error tracking]"),W2="webkit-masked-url:",MH=[{value:"isolatedAPI.contexts.topHostname",exact:!1},{value:"No response from target",exact:!0}],IH=["chrome-extension://","moz-extension://","safari-extension:","safari-web-extension:",W2],OH=["__firefox__","__gCrWeb"],nC="Refusing to render web experiment since the viewer is a likely bot",LH={icontains:(t,e)=>e.toLowerCase().indexOf(t.toLowerCase())>-1,not_icontains:(t,e)=>e.toLowerCase().indexOf(t.toLowerCase())===-1,regex:(t,e)=>Wm(e,t),not_regex:(t,e)=>!Wm(e,t),exact:(t,e)=>e===t,is_not:(t,e)=>e!==t},Us=tn("[Conversations]"),Nl="Conversations not available yet.";function rC(t,e){var n,r,s,i,o,l,u;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,g=le(h)?Math.max(f,2048):Math.max(f,h),v=j(j({},(function(){let x="",_="";try{var w;const S="u">typeof globalThis?globalThis:"u">typeof window?window:void 0,k=S==null||(w=S.navigator)===null||w===void 0?void 0:w.userAgent;k&&([x,_]=YA(k))}catch{}return(function(S,k){const E=(function(P){if(P)return{}.hasOwnProperty.call(Y8,P)?Y8[P]:P})(S);return j(j({},E?{"os.name":E}:{}),k?{"os.version":k}:{})})(x,_)})()),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:(u=v==null?void 0:v["deployment.environment"])!==null&&u!==void 0?u:t==null?void 0:t.environment,resourceAttributes:v,beforeSend:t==null?void 0:t.beforeSend,flushIntervalMs:d,maxBufferSize:f,maxQueueSize:g,maxBatchRecordsPerPost:100,rateCapWindowMs:d,maxLogsPerInterval:h,backgroundFlushBudgetMs:0,terminationFlushBudgetMs:0}}const NH=["debug","log","warn","error","info"],DH=t=>{for(;t!=null&&t.__rrweb_original__;)t=t.__rrweb_original__;return t},sC="console",qR="__posthogHandledLogsRequestError",Yy=(t,e)=>{const n=t instanceof Error?t:new Error(e);return n[qR]=!0,n},iC=t=>!!t&&typeof t=="object"&&t[qR]===!0;var jH=class{get pv(){return j(j({},this.A),{},{error:(...t)=>{t.some(iC)||this.A.error(...t)}})}constructor(t,e){var n;this.ko=t,this.gv=e,this.name="logs",this.mv=!1,this.yv=!1,this.bv=!1,this.A=tn("[logs]"),this.al=[],this._v=[],this.wd=0,this.wv=!1,this.Io=!1,this.Sv=[],this.xv=[],this.$v=!1,this.Cv=!1,this.Tv=!1,this.Iv=()=>{var r,s;this.Io||(this.wd=0,(r=this.Mv)===null||r===void 0||r.onReconnect(),(s=this.Ev)===null||s===void 0||s.onReconnect())},this.mv=!!(!((n=t.get())===null||n===void 0)&&n.captureConsoleLogs)}get Pv(){return!0}Rv(){}Av(){if(!this.Tv){try{this.Od=typeof window>"u"?void 0:window}catch{this.Od=void 0}this.Od&&(St(this.Od,"online",this.Iv),this.Tv=!0)}}Fv(t,e,n,r){this.Av();const s=rC(this.ko.get(),n);return[new AF(this.Ov(t,e),s,this.pv,()=>this.gv(),i=>i(),void 0,r),s]}Dv(){const t=this.ko.get();var e;return this.Mv&&this.Lv===t||((e=this.Mv)===null||e===void 0||e.reset(),this.Lv=t,[this.Mv,this.Nv]=this.Fv(()=>this.al,n=>{this.al=n})),this.Mv}qv(){const t=this.ko.get();var e;return this.Ev&&this.jv===t||((e=this.Ev)===null||e===void 0||e.reset(),this.jv=t,[this.Ev,this.Bv]=this.Fv(()=>this._v,n=>{this._v=n},{serviceNameDefault:"posthog-browser-logs",consoleCapture:!0},sC)),this.Ev}setup(t){if(!this.Io&&!this.wv)return this.wv=!0,this._o=t,this.A=t.logger.createLogger("[logs]"),rb(t.kv.initialize(),()=>{this.Io||this.Dd(t)})}Dd(t){var e;this.Av(),!((e=this.ko.get())===null||e===void 0)&&e.captureConsoleLogs&&(this.mv=!0),(this.mv||this.ko.remoteConfigWillArrive&&t.kv.get(this.ko.captureHintKey))&&this.zv();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.Io?r.dispose():(this.Po=r,n||this.loadIfEnabled())}dispose(){var t,e,n,r,s,i,o;this.Io||(this.Io=!0,this.Hv(),(t=this.Po)===null||t===void 0||t.dispose(),this.Po=void 0,this._o=void 0,this.bv=!1,(e=this.Od)===null||e===void 0||e.removeEventListener("online",this.Iv),(n=this.Uv)===null||n===void 0||n.call(this),this.Uv=void 0,(r=this.Mv)===null||r===void 0||r.clearQueue(),(s=this.Ev)===null||s===void 0||s.clearQueue(),(i=this.Mv)===null||i===void 0||i.reset(),(o=this.Ev)===null||o===void 0||o.reset())}onRemoteConfig(t){var e,n;if(this.Io)return;const r=t.ok?(e=t.config.logs)===null||e===void 0?void 0:e.captureConsoleLogs:void 0;Xe(r)?this.Wv():((n=this._o)===null||n===void 0||n.kv.set(this.ko.captureHintKey,!!r),r?(this.mv=!0,this.yv||this.zv(),this.loadIfEnabled()):this.Wv())}reset(){var t,e,n,r;this.Hv(),(t=this.Mv)===null||t===void 0||t.clearQueue(),this.al=[],(e=this.Mv)===null||e===void 0||e.reset(),(n=this.Ev)===null||n===void 0||n.clearQueue(),this._v=[],(r=this.Ev)===null||r===void 0||r.reset(),this.wd=0}captureLog(t){!this.Io&&this._o&&this.Dv().captureLog(t)}captureConsoleLog(t){!this.Io&&this._o&&this.qv().captureLog(t)}captureBufferedConsoleLog(t,e,n){!this.Io&&this._o&&this.qv().captureLog(t,{context:e,occurredAtMs:n})}Cc(){var t;this.Hv(),(t=this.Ev)===null||t===void 0||t.clearQueue(),this._v=[]}Wv(){this.mv||this.Hv()}zv(){var t;if(this.$v||!(!((t=this.Od)===null||t===void 0)&&t.console))return;const e=rC(this.ko.get()).maxBufferSize;let n=!0;this.xv.push(()=>{n=!1});for(const r of NH){let s;try{s=DH(this.Od.console[r])}catch{continue}s&&this.xv.push(hd(this.Od.console,r,i=>{const o=(...l)=>{try{n&&this.Vv(r,l,e)}catch{}return i.apply(this.Od.console,l)};return o.__rrweb_original__=s,o}))}this.$v=!0,this.Gv=setTimeout(()=>{this.Hv()},3e4)}Vv(t,e,n){var r;if(this.$v&&!this.Cv&&e.length!==0)if(!((r=this._o)===null||r===void 0)&&r.canCapture){if(n>this.Sv.length){this.Cv=!0;try{this.Sv.push({level:t,args:e,occurredAtMs:Date.now(),context:this.gv()})}finally{this.Cv=!1}}}else this.Hv()}Hv(){if(this.Sv=[],this.$v){this.$v=!1,this.Gv&&(clearTimeout(this.Gv),this.Gv=void 0);for(const t of this.xv)t();this.xv=[]}}Qv(){const t=this.Sv;return this.Hv(),t}get logger(){return this.Zv||(this.Zv={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.Zv}flushLogs(t){this._o&&(t?this.Jv(t):(this.Mv&&this.Mv.flush().catch(e=>this.Kv(e)),this.Ev&&this.Ev.flush().catch(e=>this.Kv(e))))}flush(){var t=this;return Ht(function*(){var e,n;const r=(e=t.Mv)===null||e===void 0?void 0:e.flush().catch(i=>t.Kv(i)),s=(n=t.Ev)===null||n===void 0?void 0:n.flush().catch(i=>t.Kv(i));yield r,yield s})()}Kv(t){iC(t)||this.A.error("PostHog logs flush failed:",t)}loadIfEnabled(){if(this.Io||!this.mv||this.yv||this.bv)return;const t=this.Rv();if(t){this.bv=!0;try{t((e,n)=>{if(this.bv=!1,!this.Io&&this.mv)if(e||!n)this.A.error("Could not load logs script",e),this.Hv();else{const r=this.Qv();this.Uv=n.initialize(this._o),this.yv=!0,r.length>0&&n.replay(this._o,r)}})}catch(e){throw this.bv=!1,e}}else this.Hv()}Ov(t,e){const n=this._o;return{get isDisabled(){return!1},get optedOut(){return!n.canCapture},getPersistedProperty:r=>r===$i.LogsQueue?t():void 0,setPersistedProperty(r,s){r===$i.LogsQueue&&e(s??[])},js:r=>this.js(r),getLibraryId:()=>n.library.name,getLibraryVersion:()=>n.library.version}}js(t){return new Promise(e=>{if(lR(this.wd,3))return void e({kind:"fatal",error:Yy(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:Yy(void 0,"logs request timed out")})},9e4),i=this.Pv;this._o.sendRequest("/i/v1/logs",{method:"POST",query:{token:this._o.projectToken},body:t,compression:"best-available",timeoutMs:6e4}).then(o=>{var l;const u=o.statusCode;this.Xv(u,i),u>=200&&300>u?r({kind:"ok"}):u===413?r({kind:"too-large"}):u!==0&&u!==408&&u!==429&&500>u?r({kind:"fatal",error:new Error(`logs request failed with status ${u}`)}):u===0?(o.error||this.A.warn("Logs request failed before receiving an HTTP response"),r({kind:"retry-later",error:Yy(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 ${u}`)})},o=>{r({kind:"retry-later",error:o})})})}Xv(t,e){(t!==0||e)&&(this.wd=cR(t,this.wd,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.")))}Jv(t){this.al.length>0&&this.Yv(t,this.al,this.Nv,this._o.library.name,e=>{this.al=e}),this._v.length>0&&this.Yv(t,this._v,this.Bv,sC,e=>{this._v=e})}Yv(t,e,n,r,s){if(e.length===0)return;const i=e.map(l=>l.record);s([]);const o=_T(i,yT(n,this._o.library.name,this._o.library.version),r,this._o.library.version);this._o.sendRequest("/i/v1/logs",{method:"POST",query:{token:this._o.projectToken},body:o,compression:"best-available",transport:t,timeoutMs:6e4}).catch(l=>this.Kv(l))}};const qm=tn("[NetworkMetrics]"),sb=()=>{var t;return!(te==null||(t=te.performance)===null||t===void 0)&&t.now?te.performance.now():Date.now()},$H={"http:":80,"https:":443},FH=new Set(["CONNECT","DELETE","GET","HEAD","OPTIONS","PATCH","POST","PUT","TRACE"]),GR=(t,e)=>{var n;const r=String(e);return{method:String(t).toUpperCase(),url:((n=Bo(r))===null||n===void 0?void 0:n.href)||r}},q2=(t,e,n,r,s,i,o=!1)=>{try{var l,u;const d=s();if(!d)return;const f=n||void 0,h=sb()-r,g=Bo(e.url);if(g&&g.protocol!=="http:"&&g.protocol!=="https:")return;const v={url:(g==null?void 0:g.href)||e.url,method:e.method},x=xn(d.name)?d.name(v):st(d.name)?d.name:"http.client.request.duration";if(!x)return;const _=o&&!f?void 0:((S,k)=>S?400>S?void 0:String(S):(k==null?void 0:k.name)||"_OTHER")(f,i),w=j(j(j(j(j({},(S=>{const k=FH.has(S)?S:"_OTHER";return j({"http.request.method":k},k==="_OTHER"&&S!==k?{"http.request.method_original":S}:{})})(v.method)),g?(S=>{return{"server.address":S.hostname.startsWith("[")&&S.hostname.endsWith("]")?S.hostname.slice(1,-1):S.hostname,"server.port":Number(S.port)||$H[S.protocol],"url.scheme":S.protocol.slice(0,-1),"url.template":(k=S.pathname,k.split("/").map(E=>(P=>/^\d+$/.test(P)||P.length>=8&&/^[0-9a-f-]*\d[0-9a-f-]*$/i.test(P))(E)?":id":E).join("/"))};var k})(g):{}),f?{"http.response.status_code":f}:{}),_?{"error.type":_}:{}),(l=d.attributes)===null||l===void 0?void 0:l.call(d,v,{status:f,durationMs:h}));(u=t.metrics)===null||u===void 0||u.histogram(x,h,{unit:"ms",attributes:w})}catch(d){qm.error("Failed to record network metric",d)}},KR=()=>{},VH=(t,e)=>xn(te==null?void 0:te.fetch)?hd(te,"fetch",n=>function(...r){const s=sb(),i=n.apply(this,r);if(!e())return i;try{var o,l,u;const[d,f]=r,h=GR((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",(u=d==null?void 0:d.url)!==null&&u!==void 0?u:d);return i.then(g=>(q2(t,h,g==null?void 0:g.status,s,e,void 0,!0),g),g=>{throw q2(t,h,void 0,s,e,g),g})}catch(d){return qm.error("Failed to observe fetch",d),i}}):KR,HH=(t,e)=>{var n;const r=te==null||(n=te.XMLHttpRequest)===null||n===void 0?void 0:n.prototype;if(!r)return KR;const s=new WeakMap,i=hd(r,"open",l=>function(...u){try{kR.has(this)||s.set(this,GR(u[0],u[1]))}catch(d){qm.error("Failed to observe XHR open",d)}return l.apply(this,u)}),o=hd(r,"send",l=>function(...u){let d;try{const f=s.get(this);if(f&&e()){const h=sb();d=()=>{this.removeEventListener("loadend",d),q2(t,f,this.status,h,e)},St(this,"loadend",d)}}catch(f){qm.error("Failed to observe XHR send",f)}try{return l.apply(this,u)}catch(f){throw d&&this.removeEventListener("loadend",d),f}});return()=>{i(),o()}},oC=new WeakMap,zH=new Set(["$comment","$defs","$id","$schema","additionalProperties","default","definitions","deprecated","description","examples","minProperties","properties","readOnly","required","title","type","writeOnly"]),UH={maxStringLength:2048,truncationSuffix:"..."},BH={maxStringLength:2048,truncationSuffix:"..."};function aC(t){if(t)return t===!0?{intent:!0,model:!0}:{intent:t.intent!==!1,model:t.model!==!1}}function Qy(t,e){return{}.hasOwnProperty.call(t,e)}function Xy(t,e){const n=Object.create(t);return e&&Object.defineProperty(n,"inputSchema",{configurable:!0,enumerable:!0,writable:!0,value:e}),n}function lC(t,e,n=!1){if(!st(t))return;const r=t.trim();return r?(n?hT(r,UH):r).slice(0,e):void 0}function cC(t){try{return nt(t)&&t.isError===!0}catch{return!1}}function ZH(t,e){try{return hT((e?(function(n){try{return!nt(n)||!He(n.content)?void 0:n.content.filter(r=>nt(r)&&r.type==="text"&&st(r.text)).map(r=>r.text).join(" ").trim()||void 0}catch{return}})(t):nt(t)&&st(t.message)?t.message:st(t)?t:String(t))||"Unknown error",BH).slice(0,2048)}catch{return"Unknown error"}}function WH(t,e){if(e)return"Error";try{if(!nt(t))return"Error";let n=st(t.name)?t.name.trim():"";const r=t.constructor;return n&&n!=="Error"||!xn(r)||r.name==="Error"||(n=r.name),(n||"Error").slice(0,256)}catch{return"Error"}}function qH(t,e){return{message:ZH(t,e),type:WH(t,e)}}const zg={featureFlags:class extends TH{constructor(t){const e=new RH(t.config,t.nl());super(e),this.name=zR,this._instance=t,this.tf=e}get Rd(){return this._instance.persistence}updateConfig(t,e){this.tf.update(t,e),this.Ad()}}},GH={sessionRecording:class{get Mr(){return this._instance.config}get Ml(){return this._instance.persistence}get started(){var t;return!!(!((t=this.ef)===null||t===void 0)&&t.isStarted)}get status(){var t,e;return this.if==="awaiting_config"||this.if==="missing_config"?this.if:(t=(e=this.ef)===null||e===void 0?void 0:e.status)!==null&&t!==void 0?t:this.if}constructor(t){if(this._instance=t,this._forceAllowLocalhostNetworkCapture=!1,this.if=Wy,this.nf=void 0,this.sf=!1,this.Je=(()=>{var e,n;if(!(he!=null&&he.visibilityState)||he.visibilityState==="visible")return!0;const r=te==null||(e=te.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.sn=()=>{var e,n;(he==null?void 0:he.visibilityState)==="visible"&&(this.Je=!0,(e=this.ef)===null||e===void 0||(n=e.setDocumentWasEverVisible)===null||n===void 0||n.call(e,!0))},!this._instance.sessionManager)throw xo.error("started without valid sessionManager"),new Error("[SessionRecording] started without valid sessionManager. This is a bug.");if(this.Mr.cookieless_mode==="always")throw new Error('[SessionRecording] cannot be used with cookieless_mode="always"');he!=null&&he.addEventListener&&St(he,"visibilitychange",this.sn)}initialize(){this.startIfEnabledOrStop()}dispose({discardBufferedEvents:t=!1}={}){var e;this.sf=!0,he==null||(e=he.removeEventListener)===null||e===void 0||e.call(he,"visibilitychange",this.sn),t?this.rf(!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.Mr.disable_session_recording,r=this.Mr.disable_session_recording||this._instance.consent.isOptedOut();return te&&e&&n&&!r}startIfEnabledOrStop(t){var e;if(this.sf||this.af&&(!((e=this.ef)===null||e===void 0)&&e.isStarted))return;const n=!le(Object.assign)&&!le(Array.from);this.af&&n?(this.lf(t),xo.info("starting")):(this.if=Wy,this.stopRecording())}lf(t){var e,n;if(this.af)if(this.if!=="awaiting_config"&&this.if!=="missing_config"&&(this.if=Bk),(We==null||(e=We.__PosthogExtensions__)===null||e===void 0||(e=e.rrweb)===null||e===void 0?void 0:e.record)&&((n=We.__PosthogExtensions__)===null||n===void 0?void 0:n.initSessionRecording))this.uf(t);else{var r,s;const i=this._instance.sessionManager;(r=We.__PosthogExtensions__)===null||r===void 0||(s=r.loadExternalDependency)===null||s===void 0||s.call(r,this._instance,this.cf,o=>{if(!this.sf&&this.af&&this._instance.sessionManager===i)return o?(this._instance.register_for_session({$sdk_debug_recording_script_not_loaded:!0}),xo.error("could not load recorder",o)):void this.uf(t);this.if="disabled"})}}stopRecording(){var t,e;(t=this.nf)===null||t===void 0||t.call(this),this.nf=void 0,(e=this.ef)===null||e===void 0||e.stop()}rf(t=!1){var e,n;(e=this.nf)===null||e===void 0||e.call(this),this.nf=void 0,(n=this.ef)===null||n===void 0||n.discard({discardProducerEvents:t})}hf(){var t,e;(t=this.Ml)===null||t===void 0||t.unregister("$session_is_sampled"),(e=this.Ml)===null||e===void 0||e.unregister("$replay_sample_rate")}df(t,e){if(Xe(t))return null;const n=hn(t)?t:parseFloat(t);return typeof(r=n)!="number"||!Number.isFinite(r)||0>r||r>1?(xo.warn(`${e} must be between 0 and 1. Ignoring invalid value:`,t),null):n;var r}vf(t){if(this.Ml){var e,n;const r=this.Ml,s=()=>{var i;const o=t.sessionRecording===!1?void 0:t.sessionRecording,l=this.df((i=this.Mr.session_recording)===null||i===void 0?void 0:i.sampleRate,"session_recording.sampleRate"),u=this.df(o==null?void 0:o.sampleRate,"remote config sampleRate"),d=l??u;Xe(d)&&this.hf();const f=o==null?void 0:o.minimumDurationMilliseconds;r.register({[Wf]: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:le(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.nf)===null||e===void 0||e.call(this),this.nf=(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.vf(e),void this.rf()):(this.vf(e),void this.startIfEnabledOrStop()):(this.if==="awaiting_config"&&(this.if="missing_config",this._instance.register_for_session({[Wx]:!0}),xo.warn("config refresh failed, recording will not start until page reload")),void this.startIfEnabledOrStop())}log(t,e="log"){var n;!((n=this.ef)===null||n===void 0)&&n.log?this.ef.log(t,e):xo.warn("log called before recorder was ready")}get cf(){var t,e;const n=(t=this._instance)===null||t===void 0||(t=t.persistence)===null||t===void 0?void 0:t.get_property(Wf);return(n==null||(e=n.scriptConfig)===null||e===void 0?void 0:e.script)||"lazy-recorder"}ff(){const t=this._instance.get_property(Wf);if(!t)return!1;let e;try{e=typeof t=="object"?t:JSON.parse(t)}catch(n){return xo.warn("persisted remote config for session recording is invalid and will be ignored",n),!1}return!Xe(e.cache_timestamp)&&36e5>=Date.now()-e.cache_timestamp}uf(t){var e,n,r;if(!this.sf&&this.af&&this._instance.sessionManager){if(!(!((e=We.__PosthogExtensions__)===null||e===void 0)&&e.initSessionRecording))return xo.warn("Called on script loaded before session recording is available. This can be caused by adblockers."),void this._instance.register_for_session({[Zx]:!0});var s;if(this.ef||(this.ef=(s=We.__PosthogExtensions__)===null||s===void 0?void 0:s.initSessionRecording(this._instance,this.Je),this.ef._forceAllowLocalhostNetworkCapture=this._forceAllowLocalhostNetworkCapture),!this.ff())return this.if==="missing_config"||this.if==="awaiting_config"?void 0:(this.if="awaiting_config",xo.info("persisted remote config is stale, requesting fresh config before starting"),void new yR(this._instance).load());this.if=Bk,(n=(r=this.ef).setDocumentWasEverVisible)===null||n===void 0||n.call(r,this.Je),this.ef.start(t)}else this.if=Wy}onRRwebEmit(t){var e,n;(e=this.ef)===null||e===void 0||(n=e.onRRwebEmit)===null||n===void 0||n.call(e,t)}overrideLinkedFlag(){var t,e;this.ef||(e=this.Ml)===null||e===void 0||e.register({$replay_override_linked_flag:!0}),(t=this.ef)===null||t===void 0||t.overrideLinkedFlag()}overrideSampling(){var t,e;this.ef||(e=this.Ml)===null||e===void 0||e.register({$replay_override_sampling:!0}),(t=this.ef)===null||t===void 0||t.overrideSampling()}overrideTrigger(t){var e,n;this.ef||(n=this.Ml)===null||n===void 0||n.register({[t==="url"?"$replay_override_url_trigger":"$replay_override_event_trigger"]:!0}),(e=this.ef)===null||e===void 0||e.overrideTrigger(t)}get sdkDebugProperties(){var t;const e={};for(const r of yH){var n;const s=(n=this._instance.sessionPersistence)===null||n===void 0?void 0:n.get_property(r);le(s)||(e[r]=s)}return j(j({},e),((t=this.ef)===null||t===void 0?void 0:t.sdkDebugProperties)||{$recording_status:this.status})}tryAddCustomEvent(t,e){var n;return!!(!((n=this.ef)===null||n===void 0)&&n.tryAddCustomEvent(t,e))}flushBeforeIdentityReset(){var t,e;(t=this.ef)===null||t===void 0||(e=t.flushBeforeIdentityReset)===null||e===void 0||e.call(t)}}},KH={autocapture:class extends hH{constructor(t){super(new pH(t)),this.instance=t}},historyAutocapture:class{constructor(t){this.pf=!1,this._instance=t,this.gf=this.mf()}initialize(){this.startIfEnabled()}get isEnabled(){const t=this.yf();return!!(t.path||t.search||this.bf(t))}startIfEnabled(){this.isEnabled&&(me.info("History API monitoring enabled, starting..."),this.monitorHistoryChanges())}startIfEnabledOrStop(){this.stop(),this.gf=this.mf(),this.startIfEnabled()}stop(){this._f&&this._f(),this._f=void 0,this.wf&&this.wf(),this.wf=void 0,me.info("History API monitoring stopped")}monitorHistoryChanges(){te&&te.history&&(this.kf("pushState"),this.kf("replaceState"),this.Sf(),this.bf()&&this.xf())}kf(t){var e;if(!te||!((e=te.history[t])===null||e===void 0)&&e.__posthog_wrapped__)return;const n=this;hd(te.history,t,r=>function(s,i,o){var l;n.$f(o)&&n.Cf(),r.call(this,s,i,o),n.Tf(t,!n.pf&&(te==null||(l=te.event)===null||l===void 0?void 0:l.type)!=="popstate")})}mf(){const t=te==null?void 0:te.location;if(t!=null&&t.pathname)return{pathname:t.pathname,search:t.search,hash:t.hash}}yf(){const t=this._instance.config.capture_pageview;return t==="history_change"?{path:!0}:nt(t)?t:{}}bf(t=this.yf()){return!!t.hash&&!this._instance.config.disable_capture_url_hashes}If(t){const e=this.yf(),n=this.gf;return!(!n||!(e.path&&t.pathname!==n.pathname||e.search&&t.search!==n.search||this.bf(e)&&t.hash!==n.hash))}Tf(t,e=!1){try{e||this.Cf();const n=this.mf();if(!n)return;if(this.If(n)){const r=()=>this._instance.capture(Gx,{navigation_type:t});e?(this.Mf=r,Promise.resolve().then(()=>this.Cf())):r()}this.gf=n}catch(n){me.error(`Error capturing ${t} pageview`,n)}}$f(t){var e,n;return!(Xe(t)||!te)&&((e=Bo(String(t)))===null||e===void 0?void 0:e.href)!==((n=te.location)===null||n===void 0?void 0:n.href)}Cf(){const t=this.Mf;if(t){this.Mf=void 0,this.pf=!0;try{t()}catch(e){me.error("Error capturing deferred pageview",e)}finally{this.pf=!1}this.gf=this.mf()}}Sf(){if(this._f)return;const t=()=>{this.Tf("popstate")};St(te,"popstate",t),this._f=()=>{te&&te.removeEventListener("popstate",t)}}xf(){if(this.wf)return;const t=()=>{this.Tf("hashchange")};St(te,"hashchange",t),this.wf=()=>{te&&te.removeEventListener("hashchange",t)}}},heatmaps:class{get Mr(){return this.instance.config}constructor(t){var e;this.Ef=!1,this.So=!1,this.Pf=null,this.instance=t,this.Ef=!!(!((e=this.instance.persistence)===null||e===void 0)&&e.props[T2]),this.rageclicks=new WR(t.config.rageclick)}initialize(){this.startIfEnabled()}get flushIntervalMilliseconds(){let t=5e3;return nt(this.Mr.capture_heatmaps)&&this.Mr.capture_heatmaps.flush_interval_milliseconds&&(t=this.Mr.capture_heatmaps.flush_interval_milliseconds),t}get isEnabled(){return Xe(this.Mr.capture_heatmaps)?Xe(this.Mr.enable_heatmaps)?this.Ef:this.Mr.enable_heatmaps:this.Mr.capture_heatmaps!==!1}startIfEnabled(){if(this.isEnabled){if(this.So)return;_H.info("starting..."),this.Rf(),this.sn()}else{var t;clearInterval((t=this.Pf)!==null&&t!==void 0?t:void 0),this.Af(),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({[T2]:n}),this.Ef=n,this.startIfEnabled()}getAndClearBuffer(){const t=this.Rt;return this.Rt=void 0,t}Ff(t){qy(t.originalEvent)&&this.Ir(t.originalEvent,"deadclick")}sn(){this.Pf&&clearInterval(this.Pf),this.Pf=(he==null?void 0:he.visibilityState)==="visible"?setInterval(this.pl.bind(this),this.flushIntervalMilliseconds):null}Rf(){te&&he&&(this.Of=this.pl.bind(this),St(te,Vm,this.Of),this.Df=t=>this.Ir(t||(te==null?void 0:te.event)),St(he,"click",this.Df,{capture:!0}),this.Lf=t=>this.Nf(t||(te==null?void 0:te.event)),St(he,"mousemove",this.Lf,{capture:!0}),this.qf=new yk(this.instance,wV,this.Ff.bind(this)),this.qf.startIfEnabledOrStop(),this.jf=this.sn.bind(this),St(he,mh,this.jf),this.So=!0)}Af(){var t;te&&he&&(this.Of&&te.removeEventListener(Vm,this.Of),this.Df&&he.removeEventListener("click",this.Df,{capture:!0}),this.Lf&&he.removeEventListener("mousemove",this.Lf,{capture:!0}),this.jf&&he.removeEventListener(mh,this.jf),clearTimeout(this.Bf),(t=this.qf)===null||t===void 0||t.stop(),this.So=!1)}zf(t,e){const n=this.instance.scrollManager.scrollY(),r=this.instance.scrollManager.scrollX(),s=this.instance.scrollManager.scrollElement(),i=(function(o,l,u){let d=o;for(;d&&ki(d)&&!vr(d,"body");){if(d===u)return!1;let v;try{var f,h,g;v=(f=(h=(g=d.ownerDocument)===null||g===void 0?void 0:g.defaultView)!==null&&h!==void 0?h:te)===null||f===void 0?void 0:f.getComputedStyle(d).position}catch{return!1}if(Ue(l,v))return!0;d=JT(d)}return!1})(Gf(t),["fixed","sticky"],s);return{x:t.clientX+(i?0:r),y:t.clientY+(i?0:n),target_fixed:i,type:e}}Ir(t,e="click"){var n;if(ak(t.target)||!qy(t))return;const r=this.zf(t,e);!((n=this.rageclicks)===null||n===void 0)&&n.isRageClick(t.clientX,t.clientY,new Date().getTime())&&tR(Gf(t),this.instance.config.rageclick)&&this.Qs(j(j({},r),{},{type:"rageclick"})),this.Qs(r)}Nf(t){!ak(t.target)&&qy(t)&&(clearTimeout(this.Bf),this.Bf=setTimeout(()=>{this.Qs(this.zf(t,"mousemove"))},500))}Qs(t){if(!te)return;const e=this.Mr.disable_capture_url_hashes?qa(te.location.href):te.location.href,n=this.Mr.custom_personal_data_properties,r=this.Mr.mask_personal_data_properties?[...dd,...n||[]]:[],s=vh(e,r,yh);this.Rt=this.Rt||{},this.Rt[s]||(this.Rt[s]=[]),this.Rt[s].push(t)}pl(){this.Rt&&!ns(this.Rt)&&this.instance.capture("$$heatmap",{$heatmap_data:this.getAndClearBuffer()})}},deadClicksAutocapture:yk,webVitalsAutocapture:class{constructor(t){var e;this._instance=t,this.Ef=!1,this.So=!1,this.Rt={navigationKey:void 0,url:void 0,metrics:[],firstMetricTimestamp:void 0},this.Hf=()=>{clearTimeout(this.Uf),this.Uf=void 0,this.Rt.metrics.length!==0&&(this._instance.capture("$web_vitals",j({$current_url:this.Rt.url},this.Rt.metrics.reduce((n,r)=>j(j({},n),{},{[`$web_vitals_${r.name}_event`]:j({},r),[`$web_vitals_${r.name}_value`]:r.value}),{}))),this.Rt={navigationKey:void 0,url:void 0,metrics:[],firstMetricTimestamp:void 0})},this.Wf=n=>{var r;if(this.Rt=this.Rt||{navigationKey:void 0,url:void 0,metrics:[],firstMetricTimestamp:void 0},Xe(n==null?void 0:n.name)||Xe(n==null?void 0:n.value))return void Ol.error("Invalid metric received",n);const s=typeof n.navigationURL=="string"?n.navigationURL:void 0,i=this.Vf(s);if(le(i))return;const o=hn(n.navigationId)||typeof n.navigationId=="string"?`navigation:${n.navigationId}`:`url:${i}`;if(this.Gf&&n.value>=this.Gf)return void Ol.error("Ignoring metric with value >= "+this.Gf,n);this.Rt.navigationKey!==o&&(this.Hf(),this.Uf=setTimeout(this.Hf,this.flushToCaptureTimeoutMs)),le(this.Rt.navigationKey)&&(this.Rt.navigationKey=o,this.Rt.url=i),this.Rt.firstMetricTimestamp=le(this.Rt.firstMetricTimestamp)?Date.now():this.Rt.firstMetricTimestamp;const l=(r=this._instance.sessionManager)===null||r===void 0?void 0:r.checkAndGetSessionAndWindowId(!0),u=j(j(j({},n),s?{navigationURL:i}:{}),{},{$current_url:i,timestamp:Date.now()});if(delete u.entries,nt(n.attribution)&&this.attributionMetrics.indexOf(n.name)>-1){const d={};for(const f of vH){const h=f==="url"&&typeof n.attribution[f]=="string"?this.Vf(n.attribution[f]):n.attribution[f];le(h)||(d[f]=h)}u.attribution=d}else delete u.attribution;le(l)||(u.$session_id=l.sessionId,u.$window_id=l.windowId),this.Rt.metrics.push(u),this.Rt.metrics.length===this.allowedMetrics.length&&this.Hf()},this.Qf=()=>{if(this.So)return;let n,r,s,i,o=!1;const l=We.__PosthogExtensions__,u=l==null?void 0:l.postHogWebVitalsCallbacksByFlavor,d=(u==null?void 0:u[this.Zf])||(this.Zf==="web-vitals"&&le(u)?l==null?void 0:l.postHogWebVitalsCallbacks:void 0);if(!le(d)){const g=d.withoutAttribution,v=this.attributionMetrics;o=!le(g),n=v.indexOf("LCP")>-1?d.onLCP:(g==null?void 0:g.onLCP)||d.onLCP,r=v.indexOf("CLS")>-1?d.onCLS:(g==null?void 0:g.onCLS)||d.onCLS,s=v.indexOf("FCP")>-1?d.onFCP:(g==null?void 0:g.onFCP)||d.onFCP,i=v.indexOf("INP")>-1?d.onINP:(g==null?void 0:g.onINP)||d.onINP}if(!(n&&r&&s&&i))return void Ol.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.Wf.bind(this),f),this.allowedMetrics.indexOf("CLS")>-1&&r(this.Wf.bind(this),f),this.allowedMetrics.indexOf("FCP")>-1&&s(this.Wf.bind(this),f),this.allowedMetrics.indexOf("INP")>-1&&i(this.Wf.bind(this),h),this.So=!0},this.Ef=!!(!((e=this._instance.persistence)===null||e===void 0)&&e.props[I2]),this.startIfEnabled()}get Jf(){return this._instance.config.capture_performance}get allowedMetrics(){var t,e;const n=nt(this.Jf)?(t=this.Jf)===null||t===void 0?void 0:t.web_vitals_allowed_metrics:void 0;return Xe(n)?((e=this._instance.persistence)===null||e===void 0?void 0:e.props.$web_vitals_allowed_metrics)||Uk:n}get flushToCaptureTimeoutMs(){return(nt(this.Jf)?this.Jf.web_vitals_delayed_flush_ms:void 0)||5e3}get attributionMetrics(){const t=nt(this.Jf)?this.Jf.web_vitals_attribution:void 0;return Hr(t)?t?Uk:[]:He(t)?t:gH}get useAttribution(){return this.attributionMetrics.length>0}get useSoftNavs(){const t=nt(this.Jf)?this.Jf.__preview_web_vitals_soft_navs:void 0;return t!=null&&t}get Gf(){const t=nt(this.Jf)&&hn(this.Jf.__web_vitals_max_value)?this.Jf.__web_vitals_max_value:zk;return t>0&&6e4>=t?zk:t}get isEnabled(){const t=qt==null?void 0:qt.protocol;if(t!=="http:"&&t!=="https:")return Ol.info("Web Vitals are disabled on non-http/https protocols"),!1;const e=nt(this.Jf)?this.Jf.web_vitals:Hr(this.Jf)?this.Jf:void 0;return Hr(e)?e:this.Ef}startIfEnabled(){this.isEnabled&&!this.So&&(Ol.info("enabled, starting..."),this.Ho(this.Qf))}onRemoteConfig(t){if(!t.ok)return;const e=t.config;if(!("capturePerformance"in e))return;const n=nt(e.capturePerformance)&&!!e.capturePerformance.web_vitals,r=nt(e.capturePerformance)?e.capturePerformance.web_vitals_allowed_metrics:void 0;this._instance.persistence&&(this._instance.persistence.register({[I2]:n}),this._instance.persistence.register({[PT]:r})),this.Ef=n,this.startIfEnabled()}get Zf(){return this.useSoftNavs?this.useAttribution?"web-vitals-with-attribution-soft-navs":"web-vitals-soft-navs":this.useAttribution?"web-vitals-with-attribution":"web-vitals"}Ho(t){var e;const n=We.__PosthogExtensions__,r=this.Zf,s=n==null?void 0:n.postHogWebVitalsCallbacksByFlavor;s!=null&&s[r]||r==="web-vitals"&&le(s)&&(n!=null&&n.postHogWebVitalsCallbacks)?t():n==null||(e=n.loadExternalDependency)===null||e===void 0||e.call(n,this._instance,r,i=>{i?Ol.error("failed to load script",i):t()})}Vf(t){const e=t||(te==null?void 0:te.location.href);if(!e)return void Ol.error("Could not determine current URL");const n=this._instance.config.disable_capture_url_hashes?qa(e):e,r=this._instance.config.custom_personal_data_properties,s=this._instance.config.mask_personal_data_properties?[...dd,...r||[]]:[];return vh(n,s,yh)}}},YH={exceptionObserver:class{constructor(t){var e;this.Qf=()=>{var n;if(!te||!this.isEnabled||!(!((n=We.__PosthogExtensions__)===null||n===void 0)&&n.errorWrappingFunctions))return;const r=We.__PosthogExtensions__.errorWrappingFunctions.wrapOnError,s=We.__PosthogExtensions__.errorWrappingFunctions.wrapUnhandledRejection,i=We.__PosthogExtensions__.errorWrappingFunctions.wrapConsoleError;try{!this.Kf&&this.Mr.capture_unhandled_errors&&(this.Kf=r(this.captureException.bind(this))),!this.Xf&&this.Mr.capture_unhandled_rejections&&(this.Xf=s(this.captureException.bind(this))),!this.Yf&&this.Mr.capture_console_errors&&(this.Yf=i(this.captureException.bind(this)))}catch(o){Ef.error("failed to start",o),this.tp()}},this._instance=t,this.ep=!!(!((e=this._instance.persistence)===null||e===void 0)&&e.props[R2]),this.wt=new c$(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:Ef})),this.Mr=this.np(),this.startIfEnabledOrStop()}np(){const t=this._instance.config.capture_exceptions;let e={capture_unhandled_errors:!1,capture_unhandled_rejections:!1,capture_console_errors:!1};return nt(t)?e=j(j({},e),t):(le(t)?this.ep:t)&&(e=j(j({},e),{},{capture_unhandled_errors:!0,capture_unhandled_rejections:!0})),e}get isEnabled(){return this.Mr.capture_console_errors||this.Mr.capture_unhandled_errors||this.Mr.capture_unhandled_rejections}startIfEnabledOrStop(){this.isEnabled?(Ef.info("enabled"),this.tp(),this.Ho(this.Qf)):this.tp()}Ho(t){var e,n,r;!((e=We.__PosthogExtensions__)===null||e===void 0)&&e.errorWrappingFunctions?t():(n=We.__PosthogExtensions__)===null||n===void 0||(r=n.loadExternalDependency)===null||r===void 0||r.call(n,this._instance,"exception-autocapture",s=>{if(s)return Ef.error("failed to load script",s);t()})}tp(){var t,e,n;(t=this.Kf)===null||t===void 0||t.call(this),this.Kf=void 0,(e=this.Xf)===null||e===void 0||e.call(this),this.Xf=void 0,(n=this.Yf)===null||n===void 0||n.call(this),this.Yf=void 0}onRemoteConfig(t){if(!t.ok)return;const e=t.config;"autocaptureExceptions"in e&&(this.ep=!!e.autocaptureExceptions||!1,this._instance.persistence&&this._instance.persistence.register({[R2]:this.ep}),this.Mr=this.np(),this.startIfEnabledOrStop())}onConfigChange(){this.Mr=this.np()}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.wt.consumeRateLimit(s))return void Ef.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.sp=[],this.rp=new x$([new D$,new Z$,new $$,new j$,new U$,new z$,new V$,new B$],(function(r,...s){return(i,o=0)=>{const l=[],u=i.split(`
|
|
19
|
+
`),d=Math.min(u.length,o+1e3),f=[];for(let v=o;d>v;v++){const x=u[v];if(x.length>1024)continue;const _=H8.test(x)?x.replace(H8,"$1"):x;if(!_.match(/\S*Error: /)){for(const w of s){const S=w(_,r);if(S){l.push(S);const k=I$(l);if(k){for(let E=f.length-1;E>=0;E--){const P=f[E];if(k.start>=P.start+P.length)break;f.pop()}f.push(k)}break}}if(L$(l,f)>=50)break}}const h=[...f].sort((v,x)=>x.start-v.start),g=h[h.length-1];if(g){const v=sT(l,g);l.splice(g.start-v,v);for(const x of h)x.start-=v}for(const v of h)O$(l,v);return f.some(v=>v.start===0&&l.length===v.length)&&(function(v){const x=v.map(w=>`${w.function}|${w.filename}|${w.lineno}|${w.colno}|${w.module}`);let _=0;for(let w=1;x.length>w;w++)N$(x,w,_)&&(_=w);v.push(...v.splice(0,_))})(l),(function(v){if(!v.length)return[];const x=Array.from(v);return x.reverse(),x.slice(0,50).map(_=>{return j(j({},_),{},{filename:_.filename||(w=x,w[w.length-1]||{}).filename,function:_.function||"?"});var w})})(l)}})("web:javascript",A$,M$)),this._instance=t,this.sp=(e=(n=this._instance.persistence)===null||n===void 0?void 0:n.get_property("$error_tracking_suppression_rules"))!==null&&e!==void 0?e:[],this.op=Lm(this.ap()),this.lp=new q$(this.op)}onConfigChange(){this.op=Lm(this.ap()),this.lp.setConfig(this.op)}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.sp=i,this._instance.persistence&&this._instance.persistence.register({[CT]:this.sp,[M2]:o})}get up(){var t;const e=!!this._instance.get_property(M2),n=this._instance.config.error_tracking.captureExtensionExceptions;return(t=n??e)!==null&&t!==void 0&&t}buildProperties(t,e){return this.rp.buildFromUnknown(t,{syntheticException:e==null?void 0:e.syntheticException,mechanism:{handled:e==null?void 0:e.handled}})}addExceptionStep(t,e){if(this.op.enabled)try{if(!st(t)||t.trim().length===0)return void di.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)=>W$.has(l)?(i.push(l),o):(o[l]=s[l],o),{}),droppedKeys:i}})(this.cp(e));r.length>0&&di.warn("Ignoring reserved exception step fields",{droppedKeys:r}),this.lp.add(j({[Im]:t,[Om]:new Date().toISOString()},n))}catch(n){di.error("Failed to add exception step. Ignoring breadcrumb.",n)}}sendExceptionEvent(t){try{const e=t.$exception_list;if(this.hp(e)){if(this.dp(e))return this.vp("Exception dropped: matched a suppression rule"),void di.info("Skipping exception capture because a suppression rule matched");if(!this.up&&this.fp(e))return this.vp("Exception dropped: thrown by a browser extension"),void di.info("Skipping exception capture because it was thrown by an extension");if(!this.up&&this.pp(e))return this.vp("Exception dropped: thrown by an injected browser script"),void di.info("Skipping exception capture because it was thrown by an injected browser script");if(!this._instance.config.error_tracking.__capturePostHogExceptions&&this.gp(e))return this.vp("Exception dropped: thrown by the PostHog SDK"),void di.info("Skipping exception capture because it was thrown by the PostHog SDK")}const n=this.op.enabled&&Xe(t.$exception_steps)?this.mp(t):t,r=(function(){if("u">typeof process){var s;const o=(s=Jj.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",dc:!0});return s&&this.lp.clear(),s}catch(s){return tC(s)||di.error("Failed to capture exception event. Dropping this exception.",s),void this.lp.clear()}}catch(e){return void(tC(e)||di.error("Failed to process exception event. Ignoring this exception.",e))}}mp(t){try{const e=this.lp.getAttachable();return e.length===0?t:j(j({},t),{},{$exception_steps:e})}catch(e){return di.error("Failed to read buffered exception steps. Capturing exception without steps.",e),t}}vp(t){this.op.enabled&&this.lp.add({[Im]:t,[Om]:new Date().toISOString()})}cp(t){return nt(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})=>(st(r)&&r.length>0&&n.$exception_types.push(r),st(s)&&s.length>0&&n.$exception_values.push(s),n),{$exception_types:[],$exception_values:[]});return this.sp.some(n=>{const r=n.values.map(s=>{const i=$R[s.operator],o=e[s.key];if(!i||!o)return!1;const l=He(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 di.warn("Failed to evaluate suppression rules. Capturing the exception.",e),!1}}fp(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&&IH.some(s=>r.startsWith(s)));return n.length!==0&&(!n.every(({filename:r})=>!!r&&r.startsWith(W2))||t.some(({type:r,value:s})=>r==="NoResponse"||st(s)&&MH.some(({value:i,exact:o})=>o?s===i:s.includes(i)))&&!e.some(({in_app:r,filename:s})=>r&&!(s!=null&&s.startsWith(W2))))}pp(t){return t.some(({value:e})=>st(e)&&OH.some(n=>e.includes(n)))}gp(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}hp(t){return!Xe(t)&&He(t)}}},QH=j({productTours:class{get Ml(){return this._instance.persistence}constructor(t){this.yp=null,this.bp=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.Ml&&this.Ml.register({[Ux]:!!e.productTours}),!Gy(this._instance))return!this.yp&&Xe((n=this.Ml)===null||n===void 0?void 0:n.props.ph_product_tours)||S0.info("product tours disabled; stopping and clearing cached tours"),(r=this.yp)===null||r===void 0||r.stop(),this.yp=null,void this.clearCache();this.loadIfEnabled()}}loadIfEnabled(){!this.yp&&Gy(this._instance)&&this.Ho(()=>this._p())}Ho(t){var e,n,r;!((e=We.__PosthogExtensions__)===null||e===void 0)&&e.generateProductTours?t():(n=We.__PosthogExtensions__)===null||n===void 0||(r=n.loadExternalDependency)===null||r===void 0||r.call(n,this._instance,"product-tours",s=>{s?S0.error("Could not load product tours script",s):t()})}_p(){var t;!this.yp&&(!((t=We.__PosthogExtensions__)===null||t===void 0)&&t.generateProductTours)&&(this.yp=We.__PosthogExtensions__.generateProductTours(this._instance,!0))}getProductTours(t,e=!1){if(He(this.bp)&&!e)return void t(this.bp,{isLoaded:!0});const n=this.Ml;if(n){const r=n.props[O2];if(He(r)&&!e)return this.bp=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(!Gy(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||S0.warn(o):S0.error(o),void t([],{isLoaded:!1,error:o})}const i=He(r.json.product_tours)?r.json.product_tours:[];this.bp=i,n&&n.register({[O2]:i}),t(i,{isLoaded:!0})}})}getActiveProductTours(t){Xe(this.yp)?t([],{isLoaded:!1,error:"Product tours not loaded"}):this.yp.getActiveProductTours(t)}showProductTour(t){var e;(e=this.yp)===null||e===void 0||e.showTourById(t)}previewTour(t){this.yp?this.yp.previewTour(t):this.Ho(()=>{var e;this._p(),(e=this.yp)===null||e===void 0||e.previewTour(t)})}dismissProductTour(){var t;(t=this.yp)===null||t===void 0||t.dismissTour("user_clicked_skip")}nextStep(){var t;(t=this.yp)===null||t===void 0||t.nextStep()}previousStep(){var t;(t=this.yp)===null||t===void 0||t.previousStep()}clearCache(){var t;this.bp=null,(t=this.Ml)===null||t===void 0||t.unregister("ph_product_tours")}resetTour(t){var e;(e=this.yp)===null||e===void 0||e.resetTour(t)}resetAllTours(){var t;(t=this.yp)===null||t===void 0||t.resetAllTours()}cancelPendingTour(t){var e;(e=this.yp)===null||e===void 0||e.cancelPendingTour(t)}}},zg),XH={siteApps:class{constructor(t){this._instance=t,this.wp=0,this.kp=[],this.apps={}}get isEnabled(){return!!this._instance.config.opt_in_site_apps}Sp(t,e){if(!e)return;const n=this.globalsForEvent(e);this.kp.push(n),this.kp.length>1e3&&(this.kp=this.kp.slice(10))}get siteAppLoaders(){var t;return(t=We._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.Sp.bind(this));this.xp=()=>{t(),this.kp=[],this.xp=void 0}}}globalsForEvent(t){var e,n,r,s,i,o,l;if(!t)throw new Error("Event payload is required");const u={},d=this._instance.get_property("$groups")||[],f=this._instance.get_property("$stored_group_properties")||{};for(const[v,x]of Object.entries(f))u[v]={id:d[v],type:v,properties:x};const{$set_once:h,$set:g}=t;return{event:j(j({},lT(t,wH)),{},{properties:j(j(j({},t.properties),g?{$set:j(j({},(e=(n=t.properties)===null||n===void 0?void 0:n.$set)!==null&&e!==void 0?e:{}),g)}:{}),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:u}}$p(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)||(Ii.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)||(Ii.error("prepare_external_dependency_script returned null"),null):t}Cp(){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 u=he==null?void 0:he.defaultView,d=u==null||(t=u.Node)===null||t===void 0?void 0:t.prototype;if(!u||!d)return()=>{};if(this.wp++,this.Tp)return this.Ip();const f=[],h=this,g=new WeakSet,v=(w,S,k)=>{if(!(w!=null&&w[S]))return;const E=w[S];w[S]=k(E),f.push(()=>{w[S]=E})},x=w=>{if(g.has(w))return w;const S=h.$p(w);return S&&g.add(S),S},_=w=>w.map(S=>typeof S=="string"?S:x(S)).filter(S=>!ln(S));return v(d,"appendChild",w=>function(S){const k=x(S);return k?w.call(this,k):S}),v(d,"insertBefore",w=>function(S,k){const E=x(S);return E?w.call(this,E,k):S}),v(d,"replaceChild",w=>function(S,k){const E=x(S);return E?w.call(this,E,k):k}),[(e=u.Element)===null||e===void 0?void 0:e.prototype,(n=u.Document)===null||n===void 0?void 0:n.prototype,(r=u.DocumentFragment)===null||r===void 0?void 0:r.prototype].forEach(w=>{v(w,"append",S=>function(...k){return S.apply(this,_(k))}),v(w,"prepend",S=>function(...k){return S.apply(this,_(k))})}),[(s=u.Element)===null||s===void 0?void 0:s.prototype,(i=u.CharacterData)===null||i===void 0?void 0:i.prototype,(o=u.DocumentType)===null||o===void 0?void 0:o.prototype].forEach(w=>{v(w,"before",S=>function(...k){return S.apply(this,_(k))}),v(w,"after",S=>function(...k){return S.apply(this,_(k))}),v(w,"replaceWith",S=>function(...k){const E=_(k);return k.length&&!E.length?void 0:S.apply(this,E)})}),v((l=u.Element)===null||l===void 0?void 0:l.prototype,"insertAdjacentElement",w=>function(S,k){const E=x(k);return E?w.call(this,S,E):null}),this.Tp=()=>{f.forEach(w=>w()),this.Tp=void 0},this.Ip()}Ip(){let t=!1;return()=>{var e;t||(t=!0,this.wp--,this.wp===0&&((e=this.Tp)===null||e===void 0||e.call(this)))}}Mp(t,e=!0){const n=this.Cp();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.kp.length&&(Ii.info(`Processing ${this.kp.length} events for site app with id ${t.id}`),this.kp.forEach(o=>this.Mp(()=>{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.xp)===null||i===void 0||i.call(this))};let r=!1;const s=i=>{e.errored=!i,e.loaded=!0,Ii.info(`Site app with id ${t.id} ${i?"loaded":"errored"}`),r&&n()};try{const{processEvent:i}=this.Mp(o=>t.init({posthog:this._instance,callback(l){o(),s(l)}}),!1);i&&(e.processEvent=i),r=!0}catch(i){Ii.error(Zk+t.id,i),s(!1)}if(r&&e.loaded)try{n()}catch(i){Ii.error(`Error while processing buffered events PostHog app with config id ${t.id}`,i),e.errored=!0}}Ep(){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)}Pp(t){if(Object.keys(this.apps).length===0)return;const e=this.globalsForEvent(t);for(const n of Object.values(this.apps))try{this.Mp(()=>{var r;return(r=n.processEvent)===null||r===void 0?void 0:r.call(n,e)})}catch(r){Ii.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.Ep(),void this._instance.on("eventCaptured",l=>this.Pp(l))):void Ii.error('PostHog site apps are disabled. Enable the "opt_in_site_apps" config to proceed.');if((n=this.xp)===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:u}of s.siteApps){var i,o;We[`__$$ph_site_app_${l}`]=this._instance,(i=We.__PosthogExtensions__)===null||i===void 0||(o=i.loadSiteApp)===null||o===void 0||o.call(i,this._instance,u,d=>{if(d)return Ii.error(Zk+l,d)})}else Ii.error('PostHog site apps are disabled. Enable the "opt_in_site_apps" config to proceed.')}}},JH={tracingHeaders:class{constructor(t){this._instance=t,this.Rp=void 0,this.Ap=void 0,this.Fp=void 0,this.Qf=()=>{const e=this.Op();var n,r;e?(le(this.Rp)&&(this.Rp=(n=We.__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)),le(this.Ap)&&(this.Ap=(r=We.__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.tp()}}initialize(){this.startIfEnabledOrStop()}Ho(t){var e,n,r;!((e=We.__PosthogExtensions__)===null||e===void 0)&&e.tracingHeadersPatchFns?t():(n=We.__PosthogExtensions__)===null||n===void 0||(r=n.loadExternalDependency)===null||r===void 0||r.call(n,this._instance,"tracing-headers",s=>{if(s)return mH.error("failed to load script",s);t()})}Dp(){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}Op(){const t=this.Dp();return He(t)?(He(this.Fp)?this.Fp.splice(0,this.Fp.length,...t):this.Fp=[...t],t.length>0?this.Fp:void 0):(He(this.Fp)&&this.Fp.splice(0),this.Fp=t||void 0,this.Fp)}tp(){var t,e;(t=this.Rp)===null||t===void 0||t.call(this),(e=this.Ap)===null||e===void 0||e.call(this),this.Rp=void 0,this.Ap=void 0}startIfEnabledOrStop(){this.Op()?this.Ho(this.Qf):this.tp()}}},ez=j({surveys:class extends xH{constructor(t){var e;super(new EH(t),(e=t,{get projectToken(){return e.config.token},kv:new CH(e)})),this._instance=t}Vc(t,e){const n=e.query?Jh(t,e.query):t;return new Promise(r=>{var s;this._instance._send_request({method:e.method,url:this._instance.requestRouter.endpointFor((s=e.target)!==null&&s!==void 0?s:"api",n),data:e.body,headers:e.headers,timeout:e.timeoutMs,fireCallbackOnDrop:!0,transport:e.transport,compression:e.compression,timestampMode:e.sentAt,callback:r})})}}},zg),tz={toolbar:class{constructor(t){this.instance=t}Lp(t){We.ph_toolbar_state=t}Np(){var t;return(t=We.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(N2(this.instance.config)||!te||!he)return!1;t=(r=t)!==null&&r!==void 0?r:te.location,n=(s=n)!==null&&s!==void 0?s:te.history;try{if(!e){try{te.localStorage.setItem("test","test"),te.localStorage.removeItem("test")}catch{return!1}e=te==null?void 0:te.localStorage}const i=PH||zm(t.hash,"__posthog")||zm(t.hash,"state");let o;const l=i?N8(()=>JSON.parse(atob(decodeURIComponent(i))))||N8(()=>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(qk)||"{}"),o.source="localstorage",delete o.userIntent),!(!o.token||this.instance.config.token!==o.token||(this.loadToolbar(o),0))}catch{return!1}}qp(t){const e=We.ph_load_toolbar||We.ph_load_editor;!Xe(e)&&xn(e)?e(t,this.instance):Gk.warn("No toolbar load function found")}loadToolbar(t){const e=!!(he!=null&&he.getElementById("__POSTHOG_TOOLBAR__"));if(!te||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(te.localStorage.setItem(qk,JSON.stringify(j(j({},r),{},{source:void 0}))),this.Np()===2)this.qp(r);else if(this.Np()===0){var s,i;this.Lp(1),(s=We.__PosthogExtensions__)===null||s===void 0||(i=s.loadExternalDependency)===null||i===void 0||i.call(s,this.instance,"toolbar",o=>{if(o)return Gk.error("[Toolbar] Failed to load",o),void this.Lp(0);this.Lp(2),this.qp(r)}),St(te,"turbolinks:load",()=>{this.Lp(0),this.loadToolbar(r)})}return!0}jp(t){return this.loadToolbar(t)}maybeLoadEditor(t=void 0,e=void 0,n=void 0){return this.maybeLoadToolbar(t,e,n)}}},nz=j({experiments:class Dr{get Mr(){return this._instance.config}constructor(e){this._instance=e,this.getWebExperimentsAndEvaluateDisplayLogic=(n=!1)=>{this.getWebExperiments(r=>{Dr.Bp("retrieved web experiments from the server"),this.zp=new Map,r.forEach(s=>{if(s.feature_flag_key){var i;this.zp&&(Dr.Bp("setting flag key ",s.feature_flag_key," to web experiment ",s),(i=this.zp)===null||i===void 0||i.set(s.feature_flag_key,s));const o=this._instance.getFeatureFlag(s.feature_flag_key);st(o)&&s.variants[o]&&this.Hp(s.name,o,s.variants[o].transforms)}else if(s.variants)for(const o in s.variants){const l=s.variants[o];Dr.Up(l,this._instance)&&this.Hp(s.name,o,l.transforms)}})},n)},this._instance.onFeatureFlags(n=>{this.onFeatureFlags(n)})}initialize(){}onFeatureFlags(e){if(this._is_bot())Dr.Bp(nC);else if(!this.Mr.disable_web_experiments){if(Xe(this.zp))return this.zp=new Map,this.loadIfEnabled(),void this.previewWebExperiment();Dr.Bp("applying feature flags",e),e.forEach(n=>{var r;if(this.zp&&(!((r=this.zp)===null||r===void 0)&&r.has(n))){var s;const i=this._instance.getFeatureFlag(n),o=(s=this.zp)===null||s===void 0?void 0:s.get(n);i&&(o!=null&&o.variants[i])&&this.Hp(o.name,i,o.variants[i].transforms)}})}}previewWebExperiment(){const e=Dr.getWindowLocation();if(e!=null&&e.search){const n=ud(e==null?void 0:e.search,"__experiment_id"),r=ud(e==null?void 0:e.search,"__experiment_variant");n&&r&&(Dr.Bp(`previewing web experiments ${n} && ${r}`),this.getWebExperiments(s=>{this.Wp(parseInt(n),r,s)},!1,!0))}}loadIfEnabled(){this.Mr.disable_web_experiments||this.getWebExperimentsAndEvaluateDisplayLogic()}getWebExperiments(e,n,r){if(this.Mr.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.Mr.token}`),method:"GET",timestampMode:"query",callback:i=>e(i.statusCode===200&&i.json&&i.json.experiments||[])})}Wp(e,n,r){const s=r.filter(i=>i.id===e);s&&s.length>0&&(Dr.Bp(`Previewing web experiment [${s[0].name}] with variant [${n}]`),this.Hp(s[0].name,n,s[0].variants[n].transforms))}static Up(e,n){return!Xe(e.conditions)&&Dr.Vp(e,n)&&Dr.Gp(e)}static Vp(e,n){var r;if(Xe(e.conditions)||Xe((r=e.conditions)===null||r===void 0?void 0:r.url))return!0;const s=Dr.getWindowLocation();if(s){var i,o,l;const u=YT(n,s.href);return!(!((i=e.conditions)===null||i===void 0)&&i.url)||LH[(o=(l=e.conditions)===null||l===void 0?void 0:l.urlMatchType)!==null&&o!==void 0?o:"icontains"](e.conditions.url,u)}return!1}static getWindowLocation(){return te==null?void 0:te.location}static Gp(e){var n;if(Xe(e.conditions)||Xe((n=e.conditions)===null||n===void 0?void 0:n.utm))return!0;const r=uR();if(r.utm_source){var s,i,o,l,u,d,f,h;const g=!(!((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,x=!(!((u=e.conditions)===null||u===void 0||(u=u.utm)===null||u===void 0)&&u.utm_medium)||((d=e.conditions)===null||d===void 0||(d=d.utm)===null||d===void 0?void 0:d.utm_medium)==r.utm_medium,_=!(!((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 g&&x&&_&&v}return!1}static Bp(e,...n){me.info(`[WebExperiments] ${e}`,n)}Hp(e,n,r){this._is_bot()?Dr.Bp(nC):n!=="control"?r.forEach(s=>{if(s.selector){var i;Dr.Bp(`applying transform of variant ${n} for experiment ${e} `,s);const o=(i=document)===null||i===void 0?void 0:i.querySelectorAll(s.selector);o==null||o.forEach(l=>{const u=l;s.html&&(u.innerHTML=s.html),s.css&&u.setAttribute("style",s.css)})}}):Dr.Bp("Control variants leave the page unmodified.")}_is_bot(){return gr&&this._instance?NR(gr,this.Mr.custom_blocked_useragents):void 0}}},zg),rz={conversations:class{constructor(t){this._instance=t,this.Qp=void 0,this._conversationsManager=null,this.Zp=!1,this.ne=null,this.Jp=!1}initialize(){this.loadIfEnabled()}onRemoteConfig(t){if(this._instance.config.disable_conversations||(this.Kp=t.ok,!t.ok))return;const e=t.config.conversations;Xe(e)||(Hr(e)?this.Qp=e:(this.Qp=e.enabled,this.ne=e),this.loadIfEnabled())}reset(){var t;(t=this._conversationsManager)===null||t===void 0||t.reset(),this._conversationsManager=null,this.Qp=void 0,this.ne=null,this.Kp=void 0,this.Jp=!1}loadIfEnabled(){if(this._conversationsManager||this.Zp||this._instance.config.disable_conversations||N2(this._instance.config)||this._instance.config.cookieless_mode&&this._instance.consent.isOptedOut())return;const t=We==null?void 0:We.__PosthogExtensions__;if(t&&!le(this.Qp)&&this.Qp)if(this.ne&&this.ne.token){this.Zp=!0;try{const e=t.initConversations;if(e)return this.Xp(e),void(this.Zp=!1);const n=t.loadExternalDependency;if(!n)return void this.Yp(qx);n(this._instance,"conversations",r=>{r||!t.initConversations?this.Yp("Could not load conversations script",r):this.Xp(t.initConversations),this.Zp=!1})}catch(e){this.Yp("Error initializing conversations",e),this.Zp=!1}}else Us.error("Conversations enabled but missing token in remote config.")}Xp(t){if(this.ne)try{this._conversationsManager=t(this.ne,this._instance),this.Jp=!1,Us.info("Conversations loaded successfully")}catch(e){this.Yp("Error completing conversations initialization",e)}else Us.error("Cannot complete initialization: remote config is null")}Yp(t,e){Us.error(t,e),this._conversationsManager=null,this.Zp=!1,this.Jp=!0}show(){this._conversationsManager?this._conversationsManager.show():Us.warn("Conversations not loaded yet.")}hide(){this._conversationsManager&&this._conversationsManager.hide()}isAvailable(){return this.Qp===!0&&!ln(this._conversationsManager)}getUnavailableReason(){return this.isAvailable()?null:this._instance.config.disable_conversations?"disabled_by_config":N2(this._instance.config)?"disabled_for_toolbar":this._instance.config.cookieless_mode&&this._instance.consent.isOptedOut()?"consent_opted_out":this.Kp===!1?"remote_config_failed":le(this.Qp)?this.Kp?"disabled_in_project":"remote_config_pending":this.Qp?Xe(this.ne)||!this.ne.token?"missing_token":We!=null&&We.__PosthogExtensions__?this.Zp?"initializing":this.Jp?"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 Ht(function*(){return r._conversationsManager?r._conversationsManager.sendMessage(t,e,n):(Us.warn(Nl),null)})()}getMessages(t,e){var n=this;return Ht(function*(){return n._conversationsManager?n._conversationsManager.getMessages(t,e):(Us.warn(Nl),null)})()}markAsRead(t){var e=this;return Ht(function*(){return e._conversationsManager?e._conversationsManager.markAsRead(t):(Us.warn(Nl),null)})()}getTickets(t){var e=this;return Ht(function*(){return e._conversationsManager?e._conversationsManager.getTickets(t):(Us.warn(Nl),null)})()}requestRestoreLink(t){var e=this;return Ht(function*(){return e._conversationsManager?e._conversationsManager.requestRestoreLink(t):(Us.warn(Nl),null)})()}restoreFromToken(t){var e=this;return Ht(function*(){return e._conversationsManager?e._conversationsManager.restoreFromToken(t):(Us.warn(Nl),null)})()}restoreFromUrlToken(){var t=this;return Ht(function*(){return t._conversationsManager?t._conversationsManager.restoreFromUrlToken():(Us.warn(Nl),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}Sc(){var t;(t=this._conversationsManager)===null||t===void 0||t.setIdentity()}xc(){var t;(t=this._conversationsManager)===null||t===void 0||t.clearIdentity()}}},sz={logs:class extends jH{constructor(t){super({get(){var e;return t==null||(e=t.config)===null||e===void 0?void 0:e.logs},captureHintKey:ET,get remoteConfigWillArrive(){var e,n;return!(!((e=t.nl)===null||e===void 0)&&e.call(t))||!!(!((n=We._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,Xe(o)||(r.sessionStartTimestamp=o),Xe(l)||(r.lastActivityTimestamp=l)}if(!(We==null||(n=We.location)===null||n===void 0)&&n.href&&(r.currentUrl=e.config.disable_capture_url_hashes?qa(We.location.href):We.location.href),e.featureFlags){const s=e.featureFlags.getFlags();s&&s.length>0&&(r.activeFeatureFlags=s)}return r})(t)),this._instance=t,this.name=UR,this.Av()}get Pv(){return this._instance.__loaded}Rv(){const t=tn("[logs]"),e=We==null?void 0:We.__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 u;return(u=i.replayConsoleBuffer)===null||u===void 0?void 0:u.call(i,o,l)}}:void 0)})};t.error(qx)}}},iz={metrics:class{constructor(t){this._instance=t,this.A=tn("[metrics]"),this.Io=!1}initialize(){this.onConfigChange()}onConfigChange(){var t;if(this.Io)return;const e=!!(!((t=this._instance.config.metrics)===null||t===void 0)&&t.network);e&&!this.tg?this.tg=(n=>{let r=!0;const s=()=>r?(l=>{var u;const d=(u=l.config.metrics)===null||u===void 0?void 0:u.network;return d===!0?{}:d||void 0})(n):void 0,i=VH(n,s),o=HH(n,s);return()=>{r=!1,i(),o()}})(this._instance):!e&&this.tg&&(this.tg(),this.tg=void 0)}Dv(){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.Mv&&this.Lv===e||((n=this.Mv)===null||n===void 0||n.reset(),this.Lv=e,this.Mv=new IF(this.Ov(),(function(r){var s,i,o,l,u;const d=r==null?void 0:r.resourceAttributes;return{serviceName:(s=d==null?void 0:d["service.name"])!==null&&s!==void 0?s:r==null?void 0:r.serviceName,serviceVersion:(i=d==null?void 0:d["service.version"])!==null&&i!==void 0?i:r==null?void 0:r.serviceVersion,environment:(o=d==null?void 0:d["deployment.environment"])!==null&&o!==void 0?o:r==null?void 0:r.environment,resourceAttributes:d,beforeSend:r==null?void 0:r.beforeSend,flushIntervalMs:(l=r==null?void 0:r.flushIntervalMs)!==null&&l!==void 0?l:1e4,maxSeriesPerFlush:(u=r==null?void 0:r.maxSeriesPerFlush)!==null&&u!==void 0?u:1e3}})(e),this.A)),this.Mv}count(t,e=1,n){this.Dv().count(t,e,n)}gauge(t,e,n){this.Dv().gauge(t,e,n)}histogram(t,e,n){this.Dv().histogram(t,e,n)}flush(t){if(!this.Mv)return Promise.resolve();if(t){const e=this.Mv.drainWindow();return e&&this.co(e,t),Promise.resolve()}return this.Mv.flush().catch(e=>this.A.error("PostHog metrics flush failed:",e))}reset(){var t;(t=this.Mv)===null||t===void 0||t.reset()}dispose(){var t,e;this.Io=!0,(t=this.tg)===null||t===void 0||t.call(this),this.tg=void 0,(e=this.Mv)===null||e===void 0||e.reset()}Ov(){const t=this._instance,e=this;return{get isDisabled(){return!1},get optedOut(){return!t.is_capturing()},co:n=>e.co(n),getLibraryId:()=>ts.LIB_NAME,getLibraryVersion:()=>ts.LIB_VERSION}}co(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.eg(),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 u;s({kind:"retry-later",error:(u=o.error)!==null&&u!==void 0?u:new Error(`metrics request failed with status ${l}`)})}}}))})}eg(){return this._instance.requestRouter.endpointFor("api","/i/v1/metrics")+"?token="+encodeURIComponent(this._instance.config.token)}}},oz={webMCP:class{constructor(t){this._instance=t,this.ig=!1}initialize(){this.startIfEnabled()}startIfEnabled(){if(!this._instance.config.capture_webmcp||this.ig)return;const t=he==null?void 0:he.modelContext;if(!t||!xn(t.registerTool))return;const e=oC.get(t);if(e)return e.instances.add(this._instance),void(this.ig=!0);const n={instances:new Set([this._instance])},r=t.registerTool,s=this;hd(t,"registerTool",i=>{const o=i;return function(l,...u){let d=l;try{d=s.ng(l,n)}catch{return o.call(this,l,...u)}return o.call(this,d,...u)}}),t.registerTool!==r&&(oC.set(t,n),this.ig=!0)}ng(t,e){if(!t||!xn(t.execute))return t;const n=t.execute,r=this,{tool:s,injected:i}=(function(o,l){const u={intent:!1,model:!1},d=o.inputSchema;if(!(function(x){return!!le(x)||nt(x)&&Object.keys(x).every(_=>zH.has(_)||_.startsWith("x-"))&&x.additionalProperties!==!0&&!nt(x.additionalProperties)&&(!x.type||x.type==="object")&&(!x.properties||nt(x.properties))&&(!x.required||He(x.required))})(d))return{tool:Xy(o),injected:u};const f=(d==null?void 0:d.properties)||{},h=x=>Qy(f,x)||He(d==null?void 0:d.required)&&d.required.includes(x);if(u.intent=l.intent&&!h("context"),u.model=l.model&&!h("llm_model"),!u.intent&&!u.model)return{tool:Xy(o),injected:u};const g=j({},f),v=He(d==null?void 0:d.required)?[...d.required]:[];return u.intent&&(g.context={type:"string",description:`Explain why this tool is called and how it supports the user's goal. Describe the abstract purpose only. Do not include personal or identifying information. Generalize specific entities as roles such as "a customer".`},v.includes("context")||v.push("context")),u.model&&(g.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:Xy(o,j(j({},d),{},{type:(d==null?void 0:d.type)||"object",properties:g,required:v})),injected:u}})(t,(function(o){const l={intent:!1,model:!1};for(const u of o.instances){const d=aC(u.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,u=(function(v,x){if(!nt(v))return{};try{const _=x.intent?lC(v.context,2048,!0):void 0,w=x.model?lC(v.llm_model,256):void 0;return j(j({},_&&_!=="{}"?{intent:_}:{}),w&&w.toLowerCase()!=="unknown"?{model:w}:{})}catch{return{}}})(o[0],i),d=(function(v,x){const _=v[0];if(!nt(_))return v;try{const w=x.intent&&Qy(_,"context"),S=x.model&&Qy(_,"llm_model");if(!w&&!S)return v;const k=j({},_);return w&&delete k.context,S&&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.sg(e,s,l,{error:v,errorResult:!1},u),v}if((h=f)&&typeof h.then=="function")return Promise.resolve(f).then(v=>{const x=cC(v)?{error:v,errorResult:!0}:void 0;return r.sg(e,s,l,x,u),v},v=>{throw r.sg(e,s,l,{error:v,errorResult:!1},u),v});var h;const g=cC(f)?{error:f,errorResult:!0}:void 0;return r.sg(e,s,l,g,u),f}}),s}sg(t,e,n,r,s){const i=Date.now()-n.getTime();let o;for(const l of t.instances){const u=aC(l.config.capture_webmcp);if(u){r&&!o&&(o=qH(r.error,r.errorResult));try{l.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:qt==null?void 0:qt.hostname,$mcp_duration_ms:i,$mcp_is_error:!!r},o?{$mcp_error_type:o.type,$mcp_error_message:o.message}:{}),u.intent&&s.intent?{$mcp_intent:s.intent,$mcp_intent_source:"context_parameter"}:{}),u.model&&s.model?{$mcp_llm_model:s.model,$mcp_llm_model_source:"self_reported"}:{}),{timestamp:n})}catch{continue}}}}}};Xf.__defaultExtensionClasses=j({},j(j(j(j(j(j(j(j(j(j(j(j(j(j({},zg),GH),KH),YH),QH),XH),ez),JH),tz),nz),rz),sz),iz),oz));const az=(function(){ts.SDK_DIST_CHANNEL="npm";const t=Yf[Df]=new Xf;return(function(){function e(){e.done||(e.done=!0,OR=!1,At(Yf,function(n){n._dom_loaded()}))}he!=null&&he.addEventListener?he.readyState==="complete"?e():St(he,"DOMContentLoaded",e,{capture:!1}):te&&me.error("Browser doesn't support `document.addEventListener` so PostHog couldn't be initialized")})(),t})();var Ie=az,lz=(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 cz=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})},k0,uC="__POSTHOG_REACT_SHARED_STATE__",dC=typeof globalThis<"u"?globalThis:typeof window<"u"?window:{},_h;try{_h=dC[uC]=dC[uC]||new WeakMap}catch{_h=new WeakMap}_h.has(m.createContext)||_h.set(m.createContext,{});var fc=_h.get(m.createContext),G2;function uz(t){(!fc.defaultPostHogInstance||fc.defaultPostHogInstance===G2)&&(fc.defaultPostHogInstance=t),G2=t}function K2(){return G2}fc.context||(fc.context=m.createContext({get client(){return K2()||fc.defaultPostHogInstance},bootstrap:void 0}));var ib=fc.context;function YR(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)||!YR(t[l],e[l],n))return!1}return!0}function dz(t){var e,n,r=t.children,s=t.client,i=t.apiKey,o=t.options,l=m.useRef(null),u=m.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=K2();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 m.useEffect(function(){if(!(s||!i)){var d=K2(),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&&!YR(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)]),xe.createElement(ib.Provider,{value:{client:u,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 Jy=function(t){return typeof t=="function"},fz=function(t){return t===void 0},Xs=function(){var t=m.useContext(ib).client;return t},rm=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]"},hz=function(t,e){try{Object.defineProperty(t,"name",{value:e,writable:!0,enumerable:!0,configurable:!0})}catch{}},pz=function(t,e){for(var n=new WeakSet,r=t;!n.has(r);){if(n.add(r),!rm(r.cause)){fz(r.cause)||(e.cause=r.cause),r.cause=e;return}r=r.cause}},mz=function(t,e){if(!e)return t;var n=new Error(rm(t)?t.message:"Primitive value captured as exception: ".concat(String(t)));return hz(n,"React ErrorBoundary ".concat(rm(t)?t.name:"Error")),n.stack=e,rm(t)?(pz(t,n),t):n},fC={componentStack:null,exceptionEvent:null,error:null},gz={INVALID_FALLBACK:"[PostHog.js][PostHogErrorBoundary] Invalid fallback prop, provide a valid React element or a function that returns a valid React element."},vz=(k0=(function(t){lz(e,t);function e(n){var r=t.call(this,n)||this;return r._resetError=function(){r.setState(fC)},r.state=fC,r}return e.prototype.componentDidCatch=function(n,r){var s=this.props.additionalProperties,i;Jy(s)?i=s(n,r):typeof s=="object"&&(i=s);var o=this.context.client,l=r.componentStack,u=o.captureException(mz(n,l),i);this.setState({error:n,componentStack:l??null,exceptionEvent:u})},e.prototype.render=function(){var n=this.props,r=n.children,s=n.fallback,i=this.state;if(i.componentStack==null)return Jy(r)?r():r;var o=Jy(s)?xe.createElement(s,{error:i.error,componentStack:i.componentStack,exceptionEvent:i.exceptionEvent,resetError:this._resetError}):s;return xe.isValidElement(o)?o:(console.warn(gz.INVALID_FALLBACK),xe.createElement(xe.Fragment,null))},e})(xe.Component),cz(k0,"PostHogErrorBoundary"),(function(){k0.contextType=ib})(),k0);uz(Ie);var Ot;(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})(Ot||(Ot={}));var hC;(function(t){t.mergeShapes=(e,n)=>({...e,...n})})(hC||(hC={}));const je=Ot.arrayToEnum(["string","nan","number","integer","float","boolean","date","bigint","symbol","function","undefined","null","array","object","unknown","promise","void","never","map","set"]),Pa=t=>{switch(typeof t){case"undefined":return je.undefined;case"string":return je.string;case"number":return Number.isNaN(t)?je.nan:je.number;case"boolean":return je.boolean;case"function":return je.function;case"bigint":return je.bigint;case"symbol":return je.symbol;case"object":return Array.isArray(t)?je.array:t===null?je.null:t.then&&typeof t.then=="function"&&t.catch&&typeof t.catch=="function"?je.promise:typeof Map<"u"&&t instanceof Map?je.map:typeof Set<"u"&&t instanceof Set?je.set:typeof Date<"u"&&t instanceof Date?je.date:je.object;default:return je.unknown}},be=Ot.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 Zo 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,u=0;for(;u<o.path.length;){const d=o.path[u];u===o.path.length-1?(l[d]=l[d]||{_errors:[]},l[d]._errors.push(n(o))):l[d]=l[d]||{_errors:[]},l=l[d],u++}}};return s(this),r}static assert(e){if(!(e instanceof Zo))throw new Error(`Not a ZodError: ${e}`)}toString(){return this.message}get message(){return JSON.stringify(this.issues,Ot.jsonStringifyReplacer,2)}get isEmpty(){return this.issues.length===0}flatten(e=n=>n.message){const n={},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()}}Zo.create=t=>new Zo(t);const Y2=(t,e)=>{let n;switch(t.code){case be.invalid_type:t.received===je.undefined?n="Required":n=`Expected ${t.expected}, received ${t.received}`;break;case be.invalid_literal:n=`Invalid literal value, expected ${JSON.stringify(t.expected,Ot.jsonStringifyReplacer)}`;break;case be.unrecognized_keys:n=`Unrecognized key(s) in object: ${Ot.joinValues(t.keys,", ")}`;break;case be.invalid_union:n="Invalid input";break;case be.invalid_union_discriminator:n=`Invalid discriminator value. Expected ${Ot.joinValues(t.options)}`;break;case be.invalid_enum_value:n=`Invalid enum value. Expected ${Ot.joinValues(t.options)}, received '${t.received}'`;break;case be.invalid_arguments:n="Invalid function arguments";break;case be.invalid_return_type:n="Invalid function return type";break;case be.invalid_date:n="Invalid date";break;case be.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}"`:Ot.assertNever(t.validation):t.validation!=="regex"?n=`Invalid ${t.validation}`:n="Invalid";break;case be.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 be.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 be.custom:n="Invalid input";break;case be.invalid_intersection_types:n="Intersection results could not be merged";break;case be.not_multiple_of:n=`Number must be a multiple of ${t.multipleOf}`;break;case be.not_finite:n="Number must be finite";break;default:n=e.defaultError,Ot.assertNever(t)}return{message:n}};let yz=Y2;function _z(){return yz}const wz=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 u=r.filter(d=>!!d).slice().reverse();for(const d of u)l=d(o,{data:e,defaultError:l}).message;return{...s,path:i,message:l}};function Ae(t,e){const n=_z(),r=wz({issueData:e,data:t.data,path:t.path,errorMaps:[t.common.contextualErrorMap,t.schemaErrorMap,n,n===Y2?void 0:Y2].filter(s=>!!s)});t.common.issues.push(r)}class Zr{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 it;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 Zr.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 it;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 it=Object.freeze({status:"aborted"}),jf=t=>({status:"dirty",value:t}),Js=t=>({status:"valid",value:t}),pC=t=>t.status==="aborted",mC=t=>t.status==="dirty",pd=t=>t.status==="valid",Gm=t=>typeof Promise<"u"&&t instanceof Promise;var Ze;(function(t){t.errToObj=e=>typeof e=="string"?{message:e}:e||{},t.toString=e=>typeof e=="string"?e:e==null?void 0:e.message})(Ze||(Ze={}));class eo{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 gC=(t,e)=>{if(pd(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 Zo(t.common.issues);return this._error=n,this._error}}};function ht(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:u}=t;return o.code==="invalid_enum_value"?{message:u??l.defaultError}:typeof l.data>"u"?{message:u??r??l.defaultError}:o.code!=="invalid_type"?{message:l.defaultError}:{message:u??n??l.defaultError}},description:s}}class wt{get description(){return this._def.description}_getType(e){return Pa(e.data)}_getOrReturnCtx(e,n){return n||{common:e.parent.common,data:e.data,parsedType:Pa(e.data),schemaErrorMap:this._def.errorMap,path:e.path,parent:e.parent}}_processInputParams(e){return{status:new Zr,ctx:{common:e.parent.common,data:e.data,parsedType:Pa(e.data),schemaErrorMap:this._def.errorMap,path:e.path,parent:e.parent}}}_parseSync(e){const n=this._parse(e);if(Gm(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:Pa(e)},s=this._parseSync({data:e,path:r.path,parent:r});return gC(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:Pa(e)};if(!this["~standard"].async)try{const i=this._parseSync({data:e,path:[],parent:n});return pd(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=>pd(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:Pa(e)},s=this._parse({data:e,path:r.path,parent:r}),i=await(Gm(s)?s:Promise.resolve(s));return gC(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:be.custom,...r(s)});return typeof Promise<"u"&&o instanceof Promise?o.then(u=>u?!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 bc({schema:this,typeName:at.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 Vo.create(this,this._def)}nullable(){return Sc.create(this,this._def)}nullish(){return this.nullable().optional()}array(){return Yi.create(this)}promise(){return eg.create(this,this._def)}or(e){return Ym.create([this,e],this._def)}and(e){return Qm.create(this,e,this._def)}transform(e){return new bc({...ht(this._def),schema:this,typeName:at.ZodEffects,effect:{type:"transform",transform:e}})}default(e){const n=typeof e=="function"?e:()=>e;return new tg({...ht(this._def),innerType:this,defaultValue:n,typeName:at.ZodDefault})}brand(){return new eM({typeName:at.ZodBranded,type:this,...ht(this._def)})}catch(e){const n=typeof e=="function"?e:()=>e;return new ng({...ht(this._def),innerType:this,catchValue:n,typeName:at.ZodCatch})}describe(e){const n=this.constructor;return new n({...this._def,description:e})}pipe(e){return ab.create(this,e)}readonly(){return rg.create(this)}isOptional(){return this.safeParse(void 0).success}isNullable(){return this.safeParse(null).success}}const xz=/^c[^\s-]{8,}$/i,bz=/^[0-9a-z]+$/,Sz=/^[0-9A-HJKMNP-TV-Z]{26}$/i,kz=/^[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,Cz=/^[a-z0-9_-]{21}$/i,Ez=/^[A-Za-z0-9-_]+\.[A-Za-z0-9-_]+\.[A-Za-z0-9-_]*$/,Pz=/^[-+]?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)?)??$/,Az=/^(?!\.)(?!.*\.\.)([A-Z0-9_'+\-\.]*)[A-Z0-9_+-]@([A-Z0-9][A-Z0-9\-]*\.)+[A-Z]{2,}$/i,Tz="^(\\p{Extended_Pictographic}|\\p{Emoji_Component})+$";let e_;const Rz=/^(?:(?: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])$/,Mz=/^(?:(?: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])$/,Iz=/^(([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]))$/,Oz=/^(([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])$/,Lz=/^([0-9a-zA-Z+/]{4})*(([0-9a-zA-Z+/]{2}==)|([0-9a-zA-Z+/]{3}=))?$/,Nz=/^([0-9a-zA-Z-_]{4})*(([0-9a-zA-Z-_]{2}(==)?)|([0-9a-zA-Z-_]{3}(=)?))?$/,QR="((\\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])))",Dz=new RegExp(`^${QR}$`);function XR(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 jz(t){return new RegExp(`^${XR(t)}$`)}function $z(t){let e=`${QR}T${XR(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 Fz(t,e){return!!((e==="v4"||!e)&&Rz.test(t)||(e==="v6"||!e)&&Iz.test(t))}function Vz(t,e){if(!Ez.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 Hz(t,e){return!!((e==="v4"||!e)&&Mz.test(t)||(e==="v6"||!e)&&Oz.test(t))}class Fo extends wt{_parse(e){if(this._def.coerce&&(e.data=String(e.data)),this._getType(e)!==je.string){const i=this._getOrReturnCtx(e);return Ae(i,{code:be.invalid_type,expected:je.string,received:i.parsedType}),it}const r=new Zr;let s;for(const i of this._def.checks)if(i.kind==="min")e.data.length<i.value&&(s=this._getOrReturnCtx(e,s),Ae(s,{code:be.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),Ae(s,{code:be.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?Ae(s,{code:be.too_big,maximum:i.value,type:"string",inclusive:!0,exact:!0,message:i.message}):l&&Ae(s,{code:be.too_small,minimum:i.value,type:"string",inclusive:!0,exact:!0,message:i.message}),r.dirty())}else if(i.kind==="email")Az.test(e.data)||(s=this._getOrReturnCtx(e,s),Ae(s,{validation:"email",code:be.invalid_string,message:i.message}),r.dirty());else if(i.kind==="emoji")e_||(e_=new RegExp(Tz,"u")),e_.test(e.data)||(s=this._getOrReturnCtx(e,s),Ae(s,{validation:"emoji",code:be.invalid_string,message:i.message}),r.dirty());else if(i.kind==="uuid")kz.test(e.data)||(s=this._getOrReturnCtx(e,s),Ae(s,{validation:"uuid",code:be.invalid_string,message:i.message}),r.dirty());else if(i.kind==="nanoid")Cz.test(e.data)||(s=this._getOrReturnCtx(e,s),Ae(s,{validation:"nanoid",code:be.invalid_string,message:i.message}),r.dirty());else if(i.kind==="cuid")xz.test(e.data)||(s=this._getOrReturnCtx(e,s),Ae(s,{validation:"cuid",code:be.invalid_string,message:i.message}),r.dirty());else if(i.kind==="cuid2")bz.test(e.data)||(s=this._getOrReturnCtx(e,s),Ae(s,{validation:"cuid2",code:be.invalid_string,message:i.message}),r.dirty());else if(i.kind==="ulid")Sz.test(e.data)||(s=this._getOrReturnCtx(e,s),Ae(s,{validation:"ulid",code:be.invalid_string,message:i.message}),r.dirty());else if(i.kind==="url")try{new URL(e.data)}catch{s=this._getOrReturnCtx(e,s),Ae(s,{validation:"url",code:be.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),Ae(s,{validation:"regex",code:be.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),Ae(s,{code:be.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),Ae(s,{code:be.invalid_string,validation:{startsWith:i.value},message:i.message}),r.dirty()):i.kind==="endsWith"?e.data.endsWith(i.value)||(s=this._getOrReturnCtx(e,s),Ae(s,{code:be.invalid_string,validation:{endsWith:i.value},message:i.message}),r.dirty()):i.kind==="datetime"?$z(i).test(e.data)||(s=this._getOrReturnCtx(e,s),Ae(s,{code:be.invalid_string,validation:"datetime",message:i.message}),r.dirty()):i.kind==="date"?Dz.test(e.data)||(s=this._getOrReturnCtx(e,s),Ae(s,{code:be.invalid_string,validation:"date",message:i.message}),r.dirty()):i.kind==="time"?jz(i).test(e.data)||(s=this._getOrReturnCtx(e,s),Ae(s,{code:be.invalid_string,validation:"time",message:i.message}),r.dirty()):i.kind==="duration"?Pz.test(e.data)||(s=this._getOrReturnCtx(e,s),Ae(s,{validation:"duration",code:be.invalid_string,message:i.message}),r.dirty()):i.kind==="ip"?Fz(e.data,i.version)||(s=this._getOrReturnCtx(e,s),Ae(s,{validation:"ip",code:be.invalid_string,message:i.message}),r.dirty()):i.kind==="jwt"?Vz(e.data,i.alg)||(s=this._getOrReturnCtx(e,s),Ae(s,{validation:"jwt",code:be.invalid_string,message:i.message}),r.dirty()):i.kind==="cidr"?Hz(e.data,i.version)||(s=this._getOrReturnCtx(e,s),Ae(s,{validation:"cidr",code:be.invalid_string,message:i.message}),r.dirty()):i.kind==="base64"?Lz.test(e.data)||(s=this._getOrReturnCtx(e,s),Ae(s,{validation:"base64",code:be.invalid_string,message:i.message}),r.dirty()):i.kind==="base64url"?Nz.test(e.data)||(s=this._getOrReturnCtx(e,s),Ae(s,{validation:"base64url",code:be.invalid_string,message:i.message}),r.dirty()):Ot.assertNever(i);return{status:r.value,value:e.data}}_regex(e,n,r){return this.refinement(s=>e.test(s),{validation:n,code:be.invalid_string,...Ze.errToObj(r)})}_addCheck(e){return new Fo({...this._def,checks:[...this._def.checks,e]})}email(e){return this._addCheck({kind:"email",...Ze.errToObj(e)})}url(e){return this._addCheck({kind:"url",...Ze.errToObj(e)})}emoji(e){return this._addCheck({kind:"emoji",...Ze.errToObj(e)})}uuid(e){return this._addCheck({kind:"uuid",...Ze.errToObj(e)})}nanoid(e){return this._addCheck({kind:"nanoid",...Ze.errToObj(e)})}cuid(e){return this._addCheck({kind:"cuid",...Ze.errToObj(e)})}cuid2(e){return this._addCheck({kind:"cuid2",...Ze.errToObj(e)})}ulid(e){return this._addCheck({kind:"ulid",...Ze.errToObj(e)})}base64(e){return this._addCheck({kind:"base64",...Ze.errToObj(e)})}base64url(e){return this._addCheck({kind:"base64url",...Ze.errToObj(e)})}jwt(e){return this._addCheck({kind:"jwt",...Ze.errToObj(e)})}ip(e){return this._addCheck({kind:"ip",...Ze.errToObj(e)})}cidr(e){return this._addCheck({kind:"cidr",...Ze.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,...Ze.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,...Ze.errToObj(e==null?void 0:e.message)})}duration(e){return this._addCheck({kind:"duration",...Ze.errToObj(e)})}regex(e,n){return this._addCheck({kind:"regex",regex:e,...Ze.errToObj(n)})}includes(e,n){return this._addCheck({kind:"includes",value:e,position:n==null?void 0:n.position,...Ze.errToObj(n==null?void 0:n.message)})}startsWith(e,n){return this._addCheck({kind:"startsWith",value:e,...Ze.errToObj(n)})}endsWith(e,n){return this._addCheck({kind:"endsWith",value:e,...Ze.errToObj(n)})}min(e,n){return this._addCheck({kind:"min",value:e,...Ze.errToObj(n)})}max(e,n){return this._addCheck({kind:"max",value:e,...Ze.errToObj(n)})}length(e,n){return this._addCheck({kind:"length",value:e,...Ze.errToObj(n)})}nonempty(e){return this.min(1,Ze.errToObj(e))}trim(){return new Fo({...this._def,checks:[...this._def.checks,{kind:"trim"}]})}toLowerCase(){return new Fo({...this._def,checks:[...this._def.checks,{kind:"toLowerCase"}]})}toUpperCase(){return new Fo({...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}}Fo.create=t=>new Fo({checks:[],typeName:at.ZodString,coerce:(t==null?void 0:t.coerce)??!1,...ht(t)});function zz(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 md extends wt{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)!==je.number){const i=this._getOrReturnCtx(e);return Ae(i,{code:be.invalid_type,expected:je.number,received:i.parsedType}),it}let r;const s=new Zr;for(const i of this._def.checks)i.kind==="int"?Ot.isInteger(e.data)||(r=this._getOrReturnCtx(e,r),Ae(r,{code:be.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),Ae(r,{code:be.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),Ae(r,{code:be.too_big,maximum:i.value,type:"number",inclusive:i.inclusive,exact:!1,message:i.message}),s.dirty()):i.kind==="multipleOf"?zz(e.data,i.value)!==0&&(r=this._getOrReturnCtx(e,r),Ae(r,{code:be.not_multiple_of,multipleOf:i.value,message:i.message}),s.dirty()):i.kind==="finite"?Number.isFinite(e.data)||(r=this._getOrReturnCtx(e,r),Ae(r,{code:be.not_finite,message:i.message}),s.dirty()):Ot.assertNever(i);return{status:s.value,value:e.data}}gte(e,n){return this.setLimit("min",e,!0,Ze.toString(n))}gt(e,n){return this.setLimit("min",e,!1,Ze.toString(n))}lte(e,n){return this.setLimit("max",e,!0,Ze.toString(n))}lt(e,n){return this.setLimit("max",e,!1,Ze.toString(n))}setLimit(e,n,r,s){return new md({...this._def,checks:[...this._def.checks,{kind:e,value:n,inclusive:r,message:Ze.toString(s)}]})}_addCheck(e){return new md({...this._def,checks:[...this._def.checks,e]})}int(e){return this._addCheck({kind:"int",message:Ze.toString(e)})}positive(e){return this._addCheck({kind:"min",value:0,inclusive:!1,message:Ze.toString(e)})}negative(e){return this._addCheck({kind:"max",value:0,inclusive:!1,message:Ze.toString(e)})}nonpositive(e){return this._addCheck({kind:"max",value:0,inclusive:!0,message:Ze.toString(e)})}nonnegative(e){return this._addCheck({kind:"min",value:0,inclusive:!0,message:Ze.toString(e)})}multipleOf(e,n){return this._addCheck({kind:"multipleOf",value:e,message:Ze.toString(n)})}finite(e){return this._addCheck({kind:"finite",message:Ze.toString(e)})}safe(e){return this._addCheck({kind:"min",inclusive:!0,value:Number.MIN_SAFE_INTEGER,message:Ze.toString(e)})._addCheck({kind:"max",inclusive:!0,value:Number.MAX_SAFE_INTEGER,message:Ze.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"&&Ot.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)}}md.create=t=>new md({checks:[],typeName:at.ZodNumber,coerce:(t==null?void 0:t.coerce)||!1,...ht(t)});class wh extends wt{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)!==je.bigint)return this._getInvalidInput(e);let r;const s=new Zr;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),Ae(r,{code:be.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),Ae(r,{code:be.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),Ae(r,{code:be.not_multiple_of,multipleOf:i.value,message:i.message}),s.dirty()):Ot.assertNever(i);return{status:s.value,value:e.data}}_getInvalidInput(e){const n=this._getOrReturnCtx(e);return Ae(n,{code:be.invalid_type,expected:je.bigint,received:n.parsedType}),it}gte(e,n){return this.setLimit("min",e,!0,Ze.toString(n))}gt(e,n){return this.setLimit("min",e,!1,Ze.toString(n))}lte(e,n){return this.setLimit("max",e,!0,Ze.toString(n))}lt(e,n){return this.setLimit("max",e,!1,Ze.toString(n))}setLimit(e,n,r,s){return new wh({...this._def,checks:[...this._def.checks,{kind:e,value:n,inclusive:r,message:Ze.toString(s)}]})}_addCheck(e){return new wh({...this._def,checks:[...this._def.checks,e]})}positive(e){return this._addCheck({kind:"min",value:BigInt(0),inclusive:!1,message:Ze.toString(e)})}negative(e){return this._addCheck({kind:"max",value:BigInt(0),inclusive:!1,message:Ze.toString(e)})}nonpositive(e){return this._addCheck({kind:"max",value:BigInt(0),inclusive:!0,message:Ze.toString(e)})}nonnegative(e){return this._addCheck({kind:"min",value:BigInt(0),inclusive:!0,message:Ze.toString(e)})}multipleOf(e,n){return this._addCheck({kind:"multipleOf",value:e,message:Ze.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}}wh.create=t=>new wh({checks:[],typeName:at.ZodBigInt,coerce:(t==null?void 0:t.coerce)??!1,...ht(t)});class Q2 extends wt{_parse(e){if(this._def.coerce&&(e.data=!!e.data),this._getType(e)!==je.boolean){const r=this._getOrReturnCtx(e);return Ae(r,{code:be.invalid_type,expected:je.boolean,received:r.parsedType}),it}return Js(e.data)}}Q2.create=t=>new Q2({typeName:at.ZodBoolean,coerce:(t==null?void 0:t.coerce)||!1,...ht(t)});class Km extends wt{_parse(e){if(this._def.coerce&&(e.data=new Date(e.data)),this._getType(e)!==je.date){const i=this._getOrReturnCtx(e);return Ae(i,{code:be.invalid_type,expected:je.date,received:i.parsedType}),it}if(Number.isNaN(e.data.getTime())){const i=this._getOrReturnCtx(e);return Ae(i,{code:be.invalid_date}),it}const r=new Zr;let s;for(const i of this._def.checks)i.kind==="min"?e.data.getTime()<i.value&&(s=this._getOrReturnCtx(e,s),Ae(s,{code:be.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),Ae(s,{code:be.too_big,message:i.message,inclusive:!0,exact:!1,maximum:i.value,type:"date"}),r.dirty()):Ot.assertNever(i);return{status:r.value,value:new Date(e.data.getTime())}}_addCheck(e){return new Km({...this._def,checks:[...this._def.checks,e]})}min(e,n){return this._addCheck({kind:"min",value:e.getTime(),message:Ze.toString(n)})}max(e,n){return this._addCheck({kind:"max",value:e.getTime(),message:Ze.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}}Km.create=t=>new Km({checks:[],coerce:(t==null?void 0:t.coerce)||!1,typeName:at.ZodDate,...ht(t)});class vC extends wt{_parse(e){if(this._getType(e)!==je.symbol){const r=this._getOrReturnCtx(e);return Ae(r,{code:be.invalid_type,expected:je.symbol,received:r.parsedType}),it}return Js(e.data)}}vC.create=t=>new vC({typeName:at.ZodSymbol,...ht(t)});class X2 extends wt{_parse(e){if(this._getType(e)!==je.undefined){const r=this._getOrReturnCtx(e);return Ae(r,{code:be.invalid_type,expected:je.undefined,received:r.parsedType}),it}return Js(e.data)}}X2.create=t=>new X2({typeName:at.ZodUndefined,...ht(t)});class J2 extends wt{_parse(e){if(this._getType(e)!==je.null){const r=this._getOrReturnCtx(e);return Ae(r,{code:be.invalid_type,expected:je.null,received:r.parsedType}),it}return Js(e.data)}}J2.create=t=>new J2({typeName:at.ZodNull,...ht(t)});class yC extends wt{constructor(){super(...arguments),this._any=!0}_parse(e){return Js(e.data)}}yC.create=t=>new yC({typeName:at.ZodAny,...ht(t)});class ew extends wt{constructor(){super(...arguments),this._unknown=!0}_parse(e){return Js(e.data)}}ew.create=t=>new ew({typeName:at.ZodUnknown,...ht(t)});class Ga extends wt{_parse(e){const n=this._getOrReturnCtx(e);return Ae(n,{code:be.invalid_type,expected:je.never,received:n.parsedType}),it}}Ga.create=t=>new Ga({typeName:at.ZodNever,...ht(t)});class _C extends wt{_parse(e){if(this._getType(e)!==je.undefined){const r=this._getOrReturnCtx(e);return Ae(r,{code:be.invalid_type,expected:je.void,received:r.parsedType}),it}return Js(e.data)}}_C.create=t=>new _C({typeName:at.ZodVoid,...ht(t)});class Yi extends wt{_parse(e){const{ctx:n,status:r}=this._processInputParams(e),s=this._def;if(n.parsedType!==je.array)return Ae(n,{code:be.invalid_type,expected:je.array,received:n.parsedType}),it;if(s.exactLength!==null){const o=n.data.length>s.exactLength.value,l=n.data.length<s.exactLength.value;(o||l)&&(Ae(n,{code:o?be.too_big:be.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&&(Ae(n,{code:be.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&&(Ae(n,{code:be.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 eo(n,o,n.path,l)))).then(o=>Zr.mergeArray(r,o));const i=[...n.data].map((o,l)=>s.type._parseSync(new eo(n,o,n.path,l)));return Zr.mergeArray(r,i)}get element(){return this._def.type}min(e,n){return new Yi({...this._def,minLength:{value:e,message:Ze.toString(n)}})}max(e,n){return new Yi({...this._def,maxLength:{value:e,message:Ze.toString(n)}})}length(e,n){return new Yi({...this._def,exactLength:{value:e,message:Ze.toString(n)}})}nonempty(e){return this.min(1,e)}}Yi.create=(t,e)=>new Yi({type:t,minLength:null,maxLength:null,exactLength:null,typeName:at.ZodArray,...ht(e)});function Cu(t){if(t instanceof Un){const e={};for(const n in t.shape){const r=t.shape[n];e[n]=Vo.create(Cu(r))}return new Un({...t._def,shape:()=>e})}else return t instanceof Yi?new Yi({...t._def,type:Cu(t.element)}):t instanceof Vo?Vo.create(Cu(t.unwrap())):t instanceof Sc?Sc.create(Cu(t.unwrap())):t instanceof wc?wc.create(t.items.map(e=>Cu(e))):t}class Un extends wt{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=Ot.objectKeys(e);return this._cached={shape:e,keys:n},this._cached}_parse(e){if(this._getType(e)!==je.object){const d=this._getOrReturnCtx(e);return Ae(d,{code:be.invalid_type,expected:je.object,received:d.parsedType}),it}const{status:r,ctx:s}=this._processInputParams(e),{shape:i,keys:o}=this._getCached(),l=[];if(!(this._def.catchall instanceof Ga&&this._def.unknownKeys==="strip"))for(const d in s.data)o.includes(d)||l.push(d);const u=[];for(const d of o){const f=i[d],h=s.data[d];u.push({key:{status:"valid",value:d},value:f._parse(new eo(s,h,s.path,d)),alwaysSet:d in s.data})}if(this._def.catchall instanceof Ga){const d=this._def.unknownKeys;if(d==="passthrough")for(const f of l)u.push({key:{status:"valid",value:f},value:{status:"valid",value:s.data[f]}});else if(d==="strict")l.length>0&&(Ae(s,{code:be.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];u.push({key:{status:"valid",value:f},value:d._parse(new eo(s,h,s.path,f)),alwaysSet:f in s.data})}}return s.common.async?Promise.resolve().then(async()=>{const d=[];for(const f of u){const h=await f.key,g=await f.value;d.push({key:h,value:g,alwaysSet:f.alwaysSet})}return d}).then(d=>Zr.mergeObjectSync(r,d)):Zr.mergeObjectSync(r,u)}get shape(){return this._def.shape()}strict(e){return Ze.errToObj,new Un({...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:Ze.errToObj(e).message??s}:{message:s}}}:{}})}strip(){return new Un({...this._def,unknownKeys:"strip"})}passthrough(){return new Un({...this._def,unknownKeys:"passthrough"})}extend(e){return new Un({...this._def,shape:()=>({...this._def.shape(),...e})})}merge(e){return new Un({unknownKeys:e._def.unknownKeys,catchall:e._def.catchall,shape:()=>({...this._def.shape(),...e._def.shape()}),typeName:at.ZodObject})}setKey(e,n){return this.augment({[e]:n})}catchall(e){return new Un({...this._def,catchall:e})}pick(e){const n={};for(const r of Ot.objectKeys(e))e[r]&&this.shape[r]&&(n[r]=this.shape[r]);return new Un({...this._def,shape:()=>n})}omit(e){const n={};for(const r of Ot.objectKeys(this.shape))e[r]||(n[r]=this.shape[r]);return new Un({...this._def,shape:()=>n})}deepPartial(){return Cu(this)}partial(e){const n={};for(const r of Ot.objectKeys(this.shape)){const s=this.shape[r];e&&!e[r]?n[r]=s:n[r]=s.optional()}return new Un({...this._def,shape:()=>n})}required(e){const n={};for(const r of Ot.objectKeys(this.shape))if(e&&!e[r])n[r]=this.shape[r];else{let i=this.shape[r];for(;i instanceof Vo;)i=i._def.innerType;n[r]=i}return new Un({...this._def,shape:()=>n})}keyof(){return JR(Ot.objectKeys(this.shape))}}Un.create=(t,e)=>new Un({shape:()=>t,unknownKeys:"strip",catchall:Ga.create(),typeName:at.ZodObject,...ht(e)});Un.strictCreate=(t,e)=>new Un({shape:()=>t,unknownKeys:"strict",catchall:Ga.create(),typeName:at.ZodObject,...ht(e)});Un.lazycreate=(t,e)=>new Un({shape:t,unknownKeys:"strip",catchall:Ga.create(),typeName:at.ZodObject,...ht(e)});class Ym extends wt{_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 Zo(l.ctx.common.issues));return Ae(n,{code:be.invalid_union,unionErrors:o}),it}if(n.common.async)return Promise.all(r.map(async i=>{const o={...n,common:{...n.common,issues:[]},parent:null};return{result:await i._parseAsync({data:n.data,path:n.path,parent:o}),ctx:o}})).then(s);{let i;const o=[];for(const u of r){const d={...n,common:{...n.common,issues:[]},parent:null},f=u._parseSync({data:n.data,path:n.path,parent:d});if(f.status==="valid")return f;f.status==="dirty"&&!i&&(i={result:f,ctx:d}),d.common.issues.length&&o.push(d.common.issues)}if(i)return n.common.issues.push(...i.ctx.common.issues),i.result;const l=o.map(u=>new Zo(u));return Ae(n,{code:be.invalid_union,unionErrors:l}),it}}get options(){return this._def.options}}Ym.create=(t,e)=>new Ym({options:t,typeName:at.ZodUnion,...ht(e)});const Ao=t=>t instanceof nw?Ao(t.schema):t instanceof bc?Ao(t.innerType()):t instanceof Jm?[t.value]:t instanceof xc?t.options:t instanceof rw?Ot.objectValues(t.enum):t instanceof tg?Ao(t._def.innerType):t instanceof X2?[void 0]:t instanceof J2?[null]:t instanceof Vo?[void 0,...Ao(t.unwrap())]:t instanceof Sc?[null,...Ao(t.unwrap())]:t instanceof eM||t instanceof rg?Ao(t.unwrap()):t instanceof ng?Ao(t._def.innerType):[];class ob extends wt{_parse(e){const{ctx:n}=this._processInputParams(e);if(n.parsedType!==je.object)return Ae(n,{code:be.invalid_type,expected:je.object,received:n.parsedType}),it;const r=this.discriminator,s=n.data[r],i=this.optionsMap.get(s);return i?n.common.async?i._parseAsync({data:n.data,path:n.path,parent:n}):i._parseSync({data:n.data,path:n.path,parent:n}):(Ae(n,{code:be.invalid_union_discriminator,options:Array.from(this.optionsMap.keys()),path:[r]}),it)}get discriminator(){return this._def.discriminator}get options(){return this._def.options}get optionsMap(){return this._def.optionsMap}static create(e,n,r){const s=new Map;for(const i of n){const o=Ao(i.shape[e]);if(!o.length)throw new Error(`A discriminator value for key \`${e}\` could not be extracted from all schema options`);for(const l of o){if(s.has(l))throw new Error(`Discriminator property ${String(e)} has duplicate value ${String(l)}`);s.set(l,i)}}return new ob({typeName:at.ZodDiscriminatedUnion,discriminator:e,options:n,optionsMap:s,...ht(r)})}}function tw(t,e){const n=Pa(t),r=Pa(e);if(t===e)return{valid:!0,data:t};if(n===je.object&&r===je.object){const s=Ot.objectKeys(e),i=Ot.objectKeys(t).filter(l=>s.indexOf(l)!==-1),o={...t,...e};for(const l of i){const u=tw(t[l],e[l]);if(!u.valid)return{valid:!1};o[l]=u.data}return{valid:!0,data:o}}else if(n===je.array&&r===je.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],u=tw(o,l);if(!u.valid)return{valid:!1};s.push(u.data)}return{valid:!0,data:s}}else return n===je.date&&r===je.date&&+t==+e?{valid:!0,data:t}:{valid:!1}}class Qm extends wt{_parse(e){const{status:n,ctx:r}=this._processInputParams(e),s=(i,o)=>{if(pC(i)||pC(o))return it;const l=tw(i.value,o.value);return l.valid?((mC(i)||mC(o))&&n.dirty(),{status:n.value,value:l.data}):(Ae(r,{code:be.invalid_intersection_types}),it)};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}))}}Qm.create=(t,e,n)=>new Qm({left:t,right:e,typeName:at.ZodIntersection,...ht(n)});class wc extends wt{_parse(e){const{status:n,ctx:r}=this._processInputParams(e);if(r.parsedType!==je.array)return Ae(r,{code:be.invalid_type,expected:je.array,received:r.parsedType}),it;if(r.data.length<this._def.items.length)return Ae(r,{code:be.too_small,minimum:this._def.items.length,inclusive:!0,exact:!1,type:"array"}),it;!this._def.rest&&r.data.length>this._def.items.length&&(Ae(r,{code:be.too_big,maximum:this._def.items.length,inclusive:!0,exact:!1,type:"array"}),n.dirty());const i=[...r.data].map((o,l)=>{const u=this._def.items[l]||this._def.rest;return u?u._parse(new eo(r,o,r.path,l)):null}).filter(o=>!!o);return r.common.async?Promise.all(i).then(o=>Zr.mergeArray(n,o)):Zr.mergeArray(n,i)}get items(){return this._def.items}rest(e){return new wc({...this._def,rest:e})}}wc.create=(t,e)=>{if(!Array.isArray(t))throw new Error("You must pass an array of schemas to z.tuple([ ... ])");return new wc({items:t,typeName:at.ZodTuple,rest:null,...ht(e)})};class Xm extends wt{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!==je.object)return Ae(r,{code:be.invalid_type,expected:je.object,received:r.parsedType}),it;const s=[],i=this._def.keyType,o=this._def.valueType;for(const l in r.data)s.push({key:i._parse(new eo(r,l,r.path,l)),value:o._parse(new eo(r,r.data[l],r.path,l)),alwaysSet:l in r.data});return r.common.async?Zr.mergeObjectAsync(n,s):Zr.mergeObjectSync(n,s)}get element(){return this._def.valueType}static create(e,n,r){return n instanceof wt?new Xm({keyType:e,valueType:n,typeName:at.ZodRecord,...ht(r)}):new Xm({keyType:Fo.create(),valueType:e,typeName:at.ZodRecord,...ht(n)})}}class wC extends wt{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!==je.map)return Ae(r,{code:be.invalid_type,expected:je.map,received:r.parsedType}),it;const s=this._def.keyType,i=this._def.valueType,o=[...r.data.entries()].map(([l,u],d)=>({key:s._parse(new eo(r,l,r.path,[d,"key"])),value:i._parse(new eo(r,u,r.path,[d,"value"]))}));if(r.common.async){const l=new Map;return Promise.resolve().then(async()=>{for(const u of o){const d=await u.key,f=await u.value;if(d.status==="aborted"||f.status==="aborted")return it;(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 u of o){const d=u.key,f=u.value;if(d.status==="aborted"||f.status==="aborted")return it;(d.status==="dirty"||f.status==="dirty")&&n.dirty(),l.set(d.value,f.value)}return{status:n.value,value:l}}}}wC.create=(t,e,n)=>new wC({valueType:e,keyType:t,typeName:at.ZodMap,...ht(n)});class xh extends wt{_parse(e){const{status:n,ctx:r}=this._processInputParams(e);if(r.parsedType!==je.set)return Ae(r,{code:be.invalid_type,expected:je.set,received:r.parsedType}),it;const s=this._def;s.minSize!==null&&r.data.size<s.minSize.value&&(Ae(r,{code:be.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&&(Ae(r,{code:be.too_big,maximum:s.maxSize.value,type:"set",inclusive:!0,exact:!1,message:s.maxSize.message}),n.dirty());const i=this._def.valueType;function o(u){const d=new Set;for(const f of u){if(f.status==="aborted")return it;f.status==="dirty"&&n.dirty(),d.add(f.value)}return{status:n.value,value:d}}const l=[...r.data.values()].map((u,d)=>i._parse(new eo(r,u,r.path,d)));return r.common.async?Promise.all(l).then(u=>o(u)):o(l)}min(e,n){return new xh({...this._def,minSize:{value:e,message:Ze.toString(n)}})}max(e,n){return new xh({...this._def,maxSize:{value:e,message:Ze.toString(n)}})}size(e,n){return this.min(e,n).max(e,n)}nonempty(e){return this.min(1,e)}}xh.create=(t,e)=>new xh({valueType:t,minSize:null,maxSize:null,typeName:at.ZodSet,...ht(e)});class nw extends wt{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})}}nw.create=(t,e)=>new nw({getter:t,typeName:at.ZodLazy,...ht(e)});class Jm extends wt{_parse(e){if(e.data!==this._def.value){const n=this._getOrReturnCtx(e);return Ae(n,{received:n.data,code:be.invalid_literal,expected:this._def.value}),it}return{status:"valid",value:e.data}}get value(){return this._def.value}}Jm.create=(t,e)=>new Jm({value:t,typeName:at.ZodLiteral,...ht(e)});function JR(t,e){return new xc({values:t,typeName:at.ZodEnum,...ht(e)})}class xc extends wt{_parse(e){if(typeof e.data!="string"){const n=this._getOrReturnCtx(e),r=this._def.values;return Ae(n,{expected:Ot.joinValues(r),received:n.parsedType,code:be.invalid_type}),it}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 Ae(n,{received:n.data,code:be.invalid_enum_value,options:r}),it}return Js(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 xc.create(e,{...this._def,...n})}exclude(e,n=this._def){return xc.create(this.options.filter(r=>!e.includes(r)),{...this._def,...n})}}xc.create=JR;class rw extends wt{_parse(e){const n=Ot.getValidEnumValues(this._def.values),r=this._getOrReturnCtx(e);if(r.parsedType!==je.string&&r.parsedType!==je.number){const s=Ot.objectValues(n);return Ae(r,{expected:Ot.joinValues(s),received:r.parsedType,code:be.invalid_type}),it}if(this._cache||(this._cache=new Set(Ot.getValidEnumValues(this._def.values))),!this._cache.has(e.data)){const s=Ot.objectValues(n);return Ae(r,{received:r.data,code:be.invalid_enum_value,options:s}),it}return Js(e.data)}get enum(){return this._def.values}}rw.create=(t,e)=>new rw({values:t,typeName:at.ZodNativeEnum,...ht(e)});class eg extends wt{unwrap(){return this._def.type}_parse(e){const{ctx:n}=this._processInputParams(e);if(n.parsedType!==je.promise&&n.common.async===!1)return Ae(n,{code:be.invalid_type,expected:je.promise,received:n.parsedType}),it;const r=n.parsedType===je.promise?n.data:Promise.resolve(n.data);return Js(r.then(s=>this._def.type.parseAsync(s,{path:n.path,errorMap:n.common.contextualErrorMap})))}}eg.create=(t,e)=>new eg({type:t,typeName:at.ZodPromise,...ht(e)});class bc extends wt{innerType(){return this._def.schema}sourceType(){return this._def.schema._def.typeName===at.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=>{Ae(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 it;const u=await this._def.schema._parseAsync({data:l,path:r.path,parent:r});return u.status==="aborted"?it:u.status==="dirty"||n.value==="dirty"?jf(u.value):u});{if(n.value==="aborted")return it;const l=this._def.schema._parseSync({data:o,path:r.path,parent:r});return l.status==="aborted"?it:l.status==="dirty"||n.value==="dirty"?jf(l.value):l}}if(s.type==="refinement"){const o=l=>{const u=s.refinement(l,i);if(r.common.async)return Promise.resolve(u);if(u instanceof Promise)throw new Error("Async refinement encountered during synchronous parse operation. Use .parseAsync instead.");return l};if(r.common.async===!1){const l=this._def.schema._parseSync({data:r.data,path:r.path,parent:r});return l.status==="aborted"?it:(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"?it:(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(!pd(o))return it;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=>pd(o)?Promise.resolve(s.transform(o.value,i)).then(l=>({status:n.value,value:l})):it);Ot.assertNever(s)}}bc.create=(t,e,n)=>new bc({schema:t,typeName:at.ZodEffects,effect:e,...ht(n)});bc.createWithPreprocess=(t,e,n)=>new bc({schema:e,effect:{type:"preprocess",transform:t},typeName:at.ZodEffects,...ht(n)});class Vo extends wt{_parse(e){return this._getType(e)===je.undefined?Js(void 0):this._def.innerType._parse(e)}unwrap(){return this._def.innerType}}Vo.create=(t,e)=>new Vo({innerType:t,typeName:at.ZodOptional,...ht(e)});class Sc extends wt{_parse(e){return this._getType(e)===je.null?Js(null):this._def.innerType._parse(e)}unwrap(){return this._def.innerType}}Sc.create=(t,e)=>new Sc({innerType:t,typeName:at.ZodNullable,...ht(e)});class tg extends wt{_parse(e){const{ctx:n}=this._processInputParams(e);let r=n.data;return n.parsedType===je.undefined&&(r=this._def.defaultValue()),this._def.innerType._parse({data:r,path:n.path,parent:n})}removeDefault(){return this._def.innerType}}tg.create=(t,e)=>new tg({innerType:t,typeName:at.ZodDefault,defaultValue:typeof e.default=="function"?e.default:()=>e.default,...ht(e)});class ng extends wt{_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 Gm(s)?s.then(i=>({status:"valid",value:i.status==="valid"?i.value:this._def.catchValue({get error(){return new Zo(r.common.issues)},input:r.data})})):{status:"valid",value:s.status==="valid"?s.value:this._def.catchValue({get error(){return new Zo(r.common.issues)},input:r.data})}}removeCatch(){return this._def.innerType}}ng.create=(t,e)=>new ng({innerType:t,typeName:at.ZodCatch,catchValue:typeof e.catch=="function"?e.catch:()=>e.catch,...ht(e)});class xC extends wt{_parse(e){if(this._getType(e)!==je.nan){const r=this._getOrReturnCtx(e);return Ae(r,{code:be.invalid_type,expected:je.nan,received:r.parsedType}),it}return{status:"valid",value:e.data}}}xC.create=t=>new xC({typeName:at.ZodNaN,...ht(t)});class eM extends wt{_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 ab extends wt{_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"?it:i.status==="dirty"?(n.dirty(),jf(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"?it: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 ab({in:e,out:n,typeName:at.ZodPipeline})}}class rg extends wt{_parse(e){const n=this._def.innerType._parse(e),r=s=>(pd(s)&&(s.value=Object.freeze(s.value)),s);return Gm(n)?n.then(s=>r(s)):r(n)}unwrap(){return this._def.innerType}}rg.create=(t,e)=>new rg({innerType:t,typeName:at.ZodReadonly,...ht(e)});var at;(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"})(at||(at={}));const Qe=Fo.create,tM=md.create,bh=Q2.create,Uae=ew.create;Ga.create;const gd=Yi.create,Rn=Un.create,Uz=Ym.create,Bz=ob.create;Qm.create;wc.create;const nM=Xm.create,bC=Jm.create,Ug=xc.create;eg.create;Vo.create;Sc.create;const Zz=it,Wz=Rn({token:Qe().min(1)}),qz=t=>Wz.parse(t).token,Bg="rivet_library_token";let Wo="",vd=0,xi=null,SC=!1;const sw=new Set,Sh=()=>sw.forEach(t=>t()),Bae=()=>xi,Zae=()=>vd,kh=()=>{try{const t=window.localStorage.getItem(Bg)??"";Wo!==t&&(vd+=1),Wo=t,xi=null}catch{xi="Rivet cannot access browser storage. Allow site storage and try again."}},rM=()=>{SC||(window.addEventListener("storage",t=>{t.key!==Bg&&t.key!==null||(kh(),Sh())}),SC=!0)},Wae=()=>!!Wo,qae=t=>(rM(),sw.add(t),()=>sw.delete(t)),Gz=(t,e)=>{if(e!==void 0&&kh(),e!==void 0&&e!==vd)throw new Error("Sign-in was cancelled because the browser login changed.");try{window.localStorage.setItem(Bg,t)}catch{throw xi="Rivet cannot save browser access. Allow site storage and try again.",Sh(),new Error(xi)}Wo=t,vd+=1,xi=null,Sh()},sM=()=>{Wo="",vd+=1,xi=null;try{window.localStorage.removeItem(Bg)}catch{xi="Rivet cannot clear browser storage. Allow site storage and try again."}Sh()},Kz=async()=>{if(!window.location.pathname.startsWith("/rivet/library"))return;rM(),kh();const t=vd,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){Gz(qz(await n.json()),t);return}n.status>=500&&!Wo&&(xi="Rivet is temporarily unavailable. Please retry this link.")}catch{!Wo&&!xi&&(xi="Rivet could not open this link. Please retry when the server is available.")}}Sh()},iM=async(t,e={})=>{kh();const n=Wo,r=new Headers(e.headers);r.set("Authorization",`Bearer ${n}`);const s=await fetch(t,{...e,headers:r});return s.status===401&&(kh(),Wo===n&&sM()),s},Yz=async(t,e={})=>{const n=await iM(`/api/library${t}`,{method:e.method??"GET",signal:e.signal,headers:{"Content-Type":"application/json"},...e.body!==void 0?{body:JSON.stringify(e.body)}:{}});return Qz(n)},Qz=async t=>{const e=await t.text();let n;try{n=JSON.parse(e)}catch{if(t.ok)throw new Error("The library returned an invalid response.")}if(!t.ok){if(t.status===401)throw new Error("Sign in to access this library.");const r=n&&typeof n=="object"&&"error"in n&&typeof n.error=="string"&&n.error.trim()?n.error:`Library request failed (${t.status}).`;throw new Error(r)}return n};var C0={},t_={exports:{}},Xr={},n_={exports:{}},r_={};/**
|
|
20
|
+
* @license React
|
|
21
|
+
* scheduler.production.min.js
|
|
22
|
+
*
|
|
23
|
+
* Copyright (c) Facebook, Inc. and its affiliates.
|
|
24
|
+
*
|
|
25
|
+
* This source code is licensed under the MIT license found in the
|
|
26
|
+
* LICENSE file in the root directory of this source tree.
|
|
27
|
+
*/var kC;function Xz(){return kC||(kC=1,(function(t){function e(Z,J){var H=Z.length;Z.push(J);e:for(;0<H;){var N=H-1>>>1,Y=Z[N];if(0<s(Y,J))Z[N]=J,Z[H]=Y,H=N;else break e}}function n(Z){return Z.length===0?null:Z[0]}function r(Z){if(Z.length===0)return null;var J=Z[0],H=Z.pop();if(H!==J){Z[0]=H;e:for(var N=0,Y=Z.length,ae=Y>>>1;N<ae;){var se=2*(N+1)-1,ie=Z[se],de=se+1,ge=Z[de];if(0>s(ie,H))de<Y&&0>s(ge,ie)?(Z[N]=ge,Z[de]=H,N=de):(Z[N]=ie,Z[se]=H,N=se);else if(de<Y&&0>s(ge,H))Z[N]=ge,Z[de]=H,N=de;else break e}}return J}function s(Z,J){var H=Z.sortIndex-J.sortIndex;return H!==0?H:Z.id-J.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 u=[],d=[],f=1,h=null,g=3,v=!1,x=!1,_=!1,w=typeof setTimeout=="function"?setTimeout:null,S=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 E(Z){for(var J=n(d);J!==null;){if(J.callback===null)r(d);else if(J.startTime<=Z)r(d),J.sortIndex=J.expirationTime,e(u,J);else break;J=n(d)}}function P(Z){if(_=!1,E(Z),!x)if(n(u)!==null)x=!0,z(T);else{var J=n(d);J!==null&&X(P,J.startTime-Z)}}function T(Z,J){x=!1,_&&(_=!1,S(R),R=-1),v=!0;var H=g;try{for(E(J),h=n(u);h!==null&&(!(h.expirationTime>J)||Z&&!$());){var N=h.callback;if(typeof N=="function"){h.callback=null,g=h.priorityLevel;var Y=N(h.expirationTime<=J);J=t.unstable_now(),typeof Y=="function"?h.callback=Y:h===n(u)&&r(u),E(J)}else r(u);h=n(u)}if(h!==null)var ae=!0;else{var se=n(d);se!==null&&X(P,se.startTime-J),ae=!1}return ae}finally{h=null,g=H,v=!1}}var I=!1,M=null,R=-1,O=5,D=-1;function $(){return!(t.unstable_now()-D<O)}function V(){if(M!==null){var Z=t.unstable_now();D=Z;var J=!0;try{J=M(!0,Z)}finally{J?q():(I=!1,M=null)}}else I=!1}var q;if(typeof k=="function")q=function(){k(V)};else if(typeof MessageChannel<"u"){var B=new MessageChannel,K=B.port2;B.port1.onmessage=V,q=function(){K.postMessage(null)}}else q=function(){w(V,0)};function z(Z){M=Z,I||(I=!0,q())}function X(Z,J){R=w(function(){Z(t.unstable_now())},J)}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(Z){Z.callback=null},t.unstable_continueExecution=function(){x||v||(x=!0,z(T))},t.unstable_forceFrameRate=function(Z){0>Z||125<Z?console.error("forceFrameRate takes a positive int between 0 and 125, forcing frame rates higher than 125 fps is not supported"):O=0<Z?Math.floor(1e3/Z):5},t.unstable_getCurrentPriorityLevel=function(){return g},t.unstable_getFirstCallbackNode=function(){return n(u)},t.unstable_next=function(Z){switch(g){case 1:case 2:case 3:var J=3;break;default:J=g}var H=g;g=J;try{return Z()}finally{g=H}},t.unstable_pauseExecution=function(){},t.unstable_requestPaint=function(){},t.unstable_runWithPriority=function(Z,J){switch(Z){case 1:case 2:case 3:case 4:case 5:break;default:Z=3}var H=g;g=Z;try{return J()}finally{g=H}},t.unstable_scheduleCallback=function(Z,J,H){var N=t.unstable_now();switch(typeof H=="object"&&H!==null?(H=H.delay,H=typeof H=="number"&&0<H?N+H:N):H=N,Z){case 1:var Y=-1;break;case 2:Y=250;break;case 5:Y=1073741823;break;case 4:Y=1e4;break;default:Y=5e3}return Y=H+Y,Z={id:f++,callback:J,priorityLevel:Z,startTime:H,expirationTime:Y,sortIndex:-1},H>N?(Z.sortIndex=H,e(d,Z),n(u)===null&&Z===n(d)&&(_?(S(R),R=-1):_=!0,X(P,H-N))):(Z.sortIndex=Y,e(u,Z),x||v||(x=!0,z(T))),Z},t.unstable_shouldYield=$,t.unstable_wrapCallback=function(Z){var J=g;return function(){var H=g;g=J;try{return Z.apply(this,arguments)}finally{g=H}}}})(r_)),r_}var CC;function Jz(){return CC||(CC=1,n_.exports=Xz()),n_.exports}/**
|
|
28
|
+
* @license React
|
|
29
|
+
* react-dom.production.min.js
|
|
30
|
+
*
|
|
31
|
+
* Copyright (c) Facebook, Inc. and its affiliates.
|
|
32
|
+
*
|
|
33
|
+
* This source code is licensed under the MIT license found in the
|
|
34
|
+
* LICENSE file in the root directory of this source tree.
|
|
35
|
+
*/var EC;function eU(){if(EC)return Xr;EC=1;var t=Ax(),e=Jz();function n(a){for(var c="https://reactjs.org/docs/error-decoder.html?invariant="+a,p=1;p<arguments.length;p++)c+="&args[]="+encodeURIComponent(arguments[p]);return"Minified React error #"+a+"; visit "+c+" 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,c){o(a,c),o(a+"Capture",c)}function o(a,c){for(s[a]=c,a=0;a<c.length;a++)r.add(c[a])}var l=!(typeof window>"u"||typeof window.document>"u"||typeof window.document.createElement>"u"),u=Object.prototype.hasOwnProperty,d=/^[:A-Z_a-z\u00C0-\u00D6\u00D8-\u00F6\u00F8-\u02FF\u0370-\u037D\u037F-\u1FFF\u200C-\u200D\u2070-\u218F\u2C00-\u2FEF\u3001-\uD7FF\uF900-\uFDCF\uFDF0-\uFFFD][:A-Z_a-z\u00C0-\u00D6\u00D8-\u00F6\u00F8-\u02FF\u0370-\u037D\u037F-\u1FFF\u200C-\u200D\u2070-\u218F\u2C00-\u2FEF\u3001-\uD7FF\uF900-\uFDCF\uFDF0-\uFFFD\-.0-9\u00B7\u0300-\u036F\u203F-\u2040]*$/,f={},h={};function g(a){return u.call(h,a)?!0:u.call(f,a)?!1:d.test(a)?h[a]=!0:(f[a]=!0,!1)}function v(a,c,p,y){if(p!==null&&p.type===0)return!1;switch(typeof c){case"function":case"symbol":return!0;case"boolean":return y?!1:p!==null?!p.acceptsBooleans:(a=a.toLowerCase().slice(0,5),a!=="data-"&&a!=="aria-");default:return!1}}function x(a,c,p,y){if(c===null||typeof c>"u"||v(a,c,p,y))return!0;if(y)return!1;if(p!==null)switch(p.type){case 3:return!c;case 4:return c===!1;case 5:return isNaN(c);case 6:return isNaN(c)||1>c}return!1}function _(a,c,p,y,C,A,L){this.acceptsBooleans=c===2||c===3||c===4,this.attributeName=y,this.attributeNamespace=C,this.mustUseProperty=p,this.propertyName=a,this.type=c,this.sanitizeURL=A,this.removeEmptyString=L}var w={};"children dangerouslySetInnerHTML defaultValue defaultChecked innerHTML suppressContentEditableWarning suppressHydrationWarning style".split(" ").forEach(function(a){w[a]=new _(a,0,!1,a,null,!1,!1)}),[["acceptCharset","accept-charset"],["className","class"],["htmlFor","for"],["httpEquiv","http-equiv"]].forEach(function(a){var c=a[0];w[c]=new _(c,1,!1,a[1],null,!1,!1)}),["contentEditable","draggable","spellCheck","value"].forEach(function(a){w[a]=new _(a,2,!1,a.toLowerCase(),null,!1,!1)}),["autoReverse","externalResourcesRequired","focusable","preserveAlpha"].forEach(function(a){w[a]=new _(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 _(a,3,!1,a.toLowerCase(),null,!1,!1)}),["checked","multiple","muted","selected"].forEach(function(a){w[a]=new _(a,3,!0,a,null,!1,!1)}),["capture","download"].forEach(function(a){w[a]=new _(a,4,!1,a,null,!1,!1)}),["cols","rows","size","span"].forEach(function(a){w[a]=new _(a,6,!1,a,null,!1,!1)}),["rowSpan","start"].forEach(function(a){w[a]=new _(a,5,!1,a.toLowerCase(),null,!1,!1)});var S=/[\-:]([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 c=a.replace(S,k);w[c]=new _(c,1,!1,a,null,!1,!1)}),"xlink:actuate xlink:arcrole xlink:role xlink:show xlink:title xlink:type".split(" ").forEach(function(a){var c=a.replace(S,k);w[c]=new _(c,1,!1,a,"http://www.w3.org/1999/xlink",!1,!1)}),["xml:base","xml:lang","xml:space"].forEach(function(a){var c=a.replace(S,k);w[c]=new _(c,1,!1,a,"http://www.w3.org/XML/1998/namespace",!1,!1)}),["tabIndex","crossOrigin"].forEach(function(a){w[a]=new _(a,1,!1,a.toLowerCase(),null,!1,!1)}),w.xlinkHref=new _("xlinkHref",1,!1,"xlink:href","http://www.w3.org/1999/xlink",!0,!1),["src","href","action","formAction"].forEach(function(a){w[a]=new _(a,1,!1,a.toLowerCase(),null,!0,!0)});function E(a,c,p,y){var C=w.hasOwnProperty(c)?w[c]:null;(C!==null?C.type!==0:y||!(2<c.length)||c[0]!=="o"&&c[0]!=="O"||c[1]!=="n"&&c[1]!=="N")&&(x(c,p,C,y)&&(p=null),y||C===null?g(c)&&(p===null?a.removeAttribute(c):a.setAttribute(c,""+p)):C.mustUseProperty?a[C.propertyName]=p===null?C.type===3?!1:"":p:(c=C.attributeName,y=C.attributeNamespace,p===null?a.removeAttribute(c):(C=C.type,p=C===3||C===4&&p===!0?"":""+p,y?a.setAttributeNS(y,c,p):a.setAttribute(c,p))))}var P=t.__SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED,T=Symbol.for("react.element"),I=Symbol.for("react.portal"),M=Symbol.for("react.fragment"),R=Symbol.for("react.strict_mode"),O=Symbol.for("react.profiler"),D=Symbol.for("react.provider"),$=Symbol.for("react.context"),V=Symbol.for("react.forward_ref"),q=Symbol.for("react.suspense"),B=Symbol.for("react.suspense_list"),K=Symbol.for("react.memo"),z=Symbol.for("react.lazy"),X=Symbol.for("react.offscreen"),Z=Symbol.iterator;function J(a){return a===null||typeof a!="object"?null:(a=Z&&a[Z]||a["@@iterator"],typeof a=="function"?a:null)}var H=Object.assign,N;function Y(a){if(N===void 0)try{throw Error()}catch(p){var c=p.stack.trim().match(/\n( *(at )?)/);N=c&&c[1]||""}return`
|
|
36
|
+
`+N+a}var ae=!1;function se(a,c){if(!a||ae)return"";ae=!0;var p=Error.prepareStackTrace;Error.prepareStackTrace=void 0;try{if(c)if(c=function(){throw Error()},Object.defineProperty(c.prototype,"props",{set:function(){throw Error()}}),typeof Reflect=="object"&&Reflect.construct){try{Reflect.construct(c,[])}catch(oe){var y=oe}Reflect.construct(a,[],c)}else{try{c.call()}catch(oe){y=oe}a.call(c.prototype)}else{try{throw Error()}catch(oe){y=oe}a()}}catch(oe){if(oe&&y&&typeof oe.stack=="string"){for(var C=oe.stack.split(`
|
|
37
|
+
`),A=y.stack.split(`
|
|
38
|
+
`),L=C.length-1,U=A.length-1;1<=L&&0<=U&&C[L]!==A[U];)U--;for(;1<=L&&0<=U;L--,U--)if(C[L]!==A[U]){if(L!==1||U!==1)do if(L--,U--,0>U||C[L]!==A[U]){var G=`
|
|
39
|
+
`+C[L].replace(" at new "," at ");return a.displayName&&G.includes("<anonymous>")&&(G=G.replace("<anonymous>",a.displayName)),G}while(1<=L&&0<=U);break}}}finally{ae=!1,Error.prepareStackTrace=p}return(a=a?a.displayName||a.name:"")?Y(a):""}function ie(a){switch(a.tag){case 5:return Y(a.type);case 16:return Y("Lazy");case 13:return Y("Suspense");case 19:return Y("SuspenseList");case 0:case 2:case 15:return a=se(a.type,!1),a;case 11:return a=se(a.type.render,!1),a;case 1:return a=se(a.type,!0),a;default:return""}}function de(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 M:return"Fragment";case I:return"Portal";case O:return"Profiler";case R:return"StrictMode";case q:return"Suspense";case B:return"SuspenseList"}if(typeof a=="object")switch(a.$$typeof){case $:return(a.displayName||"Context")+".Consumer";case D:return(a._context.displayName||"Context")+".Provider";case V:var c=a.render;return a=a.displayName,a||(a=c.displayName||c.name||"",a=a!==""?"ForwardRef("+a+")":"ForwardRef"),a;case K:return c=a.displayName||null,c!==null?c:de(a.type)||"Memo";case z:c=a._payload,a=a._init;try{return de(a(c))}catch{}}return null}function ge(a){var c=a.type;switch(a.tag){case 24:return"Cache";case 9:return(c.displayName||"Context")+".Consumer";case 10:return(c._context.displayName||"Context")+".Provider";case 18:return"DehydratedFragment";case 11:return a=c.render,a=a.displayName||a.name||"",c.displayName||(a!==""?"ForwardRef("+a+")":"ForwardRef");case 7:return"Fragment";case 5:return c;case 4:return"Portal";case 3:return"Root";case 6:return"Text";case 16:return de(c);case 8:return c===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 c=="function")return c.displayName||c.name||null;if(typeof c=="string")return c}return null}function ue(a){switch(typeof a){case"boolean":case"number":case"string":case"undefined":return a;case"object":return a;default:return""}}function re(a){var c=a.type;return(a=a.nodeName)&&a.toLowerCase()==="input"&&(c==="checkbox"||c==="radio")}function Pe(a){var c=re(a)?"checked":"value",p=Object.getOwnPropertyDescriptor(a.constructor.prototype,c),y=""+a[c];if(!a.hasOwnProperty(c)&&typeof p<"u"&&typeof p.get=="function"&&typeof p.set=="function"){var C=p.get,A=p.set;return Object.defineProperty(a,c,{configurable:!0,get:function(){return C.call(this)},set:function(L){y=""+L,A.call(this,L)}}),Object.defineProperty(a,c,{enumerable:p.enumerable}),{getValue:function(){return y},setValue:function(L){y=""+L},stopTracking:function(){a._valueTracker=null,delete a[c]}}}}function $e(a){a._valueTracker||(a._valueTracker=Pe(a))}function Ee(a){if(!a)return!1;var c=a._valueTracker;if(!c)return!0;var p=c.getValue(),y="";return a&&(y=re(a)?a.checked?"true":"false":a.value),a=y,a!==p?(c.setValue(a),!0):!1}function dt(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 Tt(a,c){var p=c.checked;return H({},c,{defaultChecked:void 0,defaultValue:void 0,value:void 0,checked:p??a._wrapperState.initialChecked})}function rn(a,c){var p=c.defaultValue==null?"":c.defaultValue,y=c.checked!=null?c.checked:c.defaultChecked;p=ue(c.value!=null?c.value:p),a._wrapperState={initialChecked:y,initialValue:p,controlled:c.type==="checkbox"||c.type==="radio"?c.checked!=null:c.value!=null}}function jt(a,c){c=c.checked,c!=null&&E(a,"checked",c,!1)}function xt(a,c){jt(a,c);var p=ue(c.value),y=c.type;if(p!=null)y==="number"?(p===0&&a.value===""||a.value!=p)&&(a.value=""+p):a.value!==""+p&&(a.value=""+p);else if(y==="submit"||y==="reset"){a.removeAttribute("value");return}c.hasOwnProperty("value")?Ct(a,c.type,p):c.hasOwnProperty("defaultValue")&&Ct(a,c.type,ue(c.defaultValue)),c.checked==null&&c.defaultChecked!=null&&(a.defaultChecked=!!c.defaultChecked)}function Xt(a,c,p){if(c.hasOwnProperty("value")||c.hasOwnProperty("defaultValue")){var y=c.type;if(!(y!=="submit"&&y!=="reset"||c.value!==void 0&&c.value!==null))return;c=""+a._wrapperState.initialValue,p||c===a.value||(a.value=c),a.defaultValue=c}p=a.name,p!==""&&(a.name=""),a.defaultChecked=!!a._wrapperState.initialChecked,p!==""&&(a.name=p)}function Ct(a,c,p){(c!=="number"||dt(a.ownerDocument)!==a)&&(p==null?a.defaultValue=""+a._wrapperState.initialValue:a.defaultValue!==""+p&&(a.defaultValue=""+p))}var qe=Array.isArray;function ke(a,c,p,y){if(a=a.options,c){c={};for(var C=0;C<p.length;C++)c["$"+p[C]]=!0;for(p=0;p<a.length;p++)C=c.hasOwnProperty("$"+a[p].value),a[p].selected!==C&&(a[p].selected=C),C&&y&&(a[p].defaultSelected=!0)}else{for(p=""+ue(p),c=null,C=0;C<a.length;C++){if(a[C].value===p){a[C].selected=!0,y&&(a[C].defaultSelected=!0);return}c!==null||a[C].disabled||(c=a[C])}c!==null&&(c.selected=!0)}}function rt(a,c){if(c.dangerouslySetInnerHTML!=null)throw Error(n(91));return H({},c,{value:void 0,defaultValue:void 0,children:""+a._wrapperState.initialValue})}function Et(a,c){var p=c.value;if(p==null){if(p=c.children,c=c.defaultValue,p!=null){if(c!=null)throw Error(n(92));if(qe(p)){if(1<p.length)throw Error(n(93));p=p[0]}c=p}c==null&&(c=""),p=c}a._wrapperState={initialValue:ue(p)}}function Ge(a,c){var p=ue(c.value),y=ue(c.defaultValue);p!=null&&(p=""+p,p!==a.value&&(a.value=p),c.defaultValue==null&&a.defaultValue!==p&&(a.defaultValue=p)),y!=null&&(a.defaultValue=""+y)}function yt(a){var c=a.textContent;c===a._wrapperState.initialValue&&c!==""&&c!==null&&(a.value=c)}function Dn(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 Cn(a,c){return a==null||a==="http://www.w3.org/1999/xhtml"?Dn(c):a==="http://www.w3.org/2000/svg"&&c==="foreignObject"?"http://www.w3.org/1999/xhtml":a}var Me,ea=(function(a){return typeof MSApp<"u"&&MSApp.execUnsafeLocalFunction?function(c,p,y,C){MSApp.execUnsafeLocalFunction(function(){return a(c,p,y,C)})}:a})(function(a,c){if(a.namespaceURI!=="http://www.w3.org/2000/svg"||"innerHTML"in a)a.innerHTML=c;else{for(Me=Me||document.createElement("div"),Me.innerHTML="<svg>"+c.valueOf().toString()+"</svg>",c=Me.firstChild;a.firstChild;)a.removeChild(a.firstChild);for(;c.firstChild;)a.appendChild(c.firstChild)}});function jn(a,c){if(c){var p=a.firstChild;if(p&&p===a.lastChild&&p.nodeType===3){p.nodeValue=c;return}}a.textContent=c}var tr={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},ul=["Webkit","ms","Moz","O"];Object.keys(tr).forEach(function(a){ul.forEach(function(c){c=c+a.charAt(0).toUpperCase()+a.substring(1),tr[c]=tr[a]})});function pn(a,c,p){return c==null||typeof c=="boolean"||c===""?"":p||typeof c!="number"||c===0||tr.hasOwnProperty(a)&&tr[a]?(""+c).trim():c+"px"}function mn(a,c){a=a.style;for(var p in c)if(c.hasOwnProperty(p)){var y=p.indexOf("--")===0,C=pn(p,c[p],y);p==="float"&&(p="cssFloat"),y?a.setProperty(p,C):a[p]=C}}var $d=H({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 Os(a,c){if(c){if($d[a]&&(c.children!=null||c.dangerouslySetInnerHTML!=null))throw Error(n(137,a));if(c.dangerouslySetInnerHTML!=null){if(c.children!=null)throw Error(n(60));if(typeof c.dangerouslySetInnerHTML!="object"||!("__html"in c.dangerouslySetInnerHTML))throw Error(n(61))}if(c.style!=null&&typeof c.style!="object")throw Error(n(62))}}function wr(a,c){if(a.indexOf("-")===-1)return typeof c.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 nr=null;function ao(a){return a=a.target||a.srcElement||window,a.correspondingUseElement&&(a=a.correspondingUseElement),a.nodeType===3?a.parentNode:a}var ei=null,$n=null,Ls=null;function dl(a){if(a=ef(a)){if(typeof ei!="function")throw Error(n(280));var c=a.stateNode;c&&(c=Rp(c),ei(a.stateNode,a.type,c))}}function lo(a){$n?Ls?Ls.push(a):Ls=[a]:$n=a}function fs(){if($n){var a=$n,c=Ls;if(Ls=$n=null,dl(a),c)for(a=0;a<c.length;a++)dl(c[a])}}function Ke(a,c){return a(c)}function Lt(){}var Ft=!1;function qn(a,c,p){if(Ft)return a(c,p);Ft=!0;try{return Ke(a,c,p)}finally{Ft=!1,($n!==null||Ls!==null)&&(Lt(),fs())}}function hs(a,c){var p=a.stateNode;if(p===null)return null;var y=Rp(p);if(y===null)return null;p=y[c];e:switch(c){case"onClick":case"onClickCapture":case"onDoubleClick":case"onDoubleClickCapture":case"onMouseDown":case"onMouseDownCapture":case"onMouseMove":case"onMouseMoveCapture":case"onMouseUp":case"onMouseUpCapture":case"onMouseEnter":(y=!y.disabled)||(a=a.type,y=!(a==="button"||a==="input"||a==="select"||a==="textarea")),a=!y;break e;default:a=!1}if(a)return null;if(p&&typeof p!="function")throw Error(n(231,c,typeof p));return p}var Ut=!1;if(l)try{var Fn={};Object.defineProperty(Fn,"passive",{get:function(){Ut=!0}}),window.addEventListener("test",Fn,Fn),window.removeEventListener("test",Fn,Fn)}catch{Ut=!1}function Wr(a,c,p,y,C,A,L,U,G){var oe=Array.prototype.slice.call(arguments,3);try{c.apply(p,oe)}catch(ve){this.onError(ve)}}var ti=!1,ur=null,Mn=!1,fl=null,Mc={onError:function(a){ti=!0,ur=a}};function hl(a,c,p,y,C,A,L,U,G){ti=!1,ur=null,Wr.apply(Mc,arguments)}function ta(a,c,p,y,C,A,L,U,G){if(hl.apply(this,arguments),ti){if(ti){var oe=ur;ti=!1,ur=null}else throw Error(n(198));Mn||(Mn=!0,fl=oe)}}function Ei(a){var c=a,p=a;if(a.alternate)for(;c.return;)c=c.return;else{a=c;do c=a,(c.flags&4098)!==0&&(p=c.return),a=c.return;while(a)}return c.tag===3?p:null}function pl(a){if(a.tag===13){var c=a.memoizedState;if(c===null&&(a=a.alternate,a!==null&&(c=a.memoizedState)),c!==null)return c.dehydrated}return null}function Fd(a){if(Ei(a)!==a)throw Error(n(188))}function Vd(a){var c=a.alternate;if(!c){if(c=Ei(a),c===null)throw Error(n(188));return c!==a?null:a}for(var p=a,y=c;;){var C=p.return;if(C===null)break;var A=C.alternate;if(A===null){if(y=C.return,y!==null){p=y;continue}break}if(C.child===A.child){for(A=C.child;A;){if(A===p)return Fd(C),a;if(A===y)return Fd(C),c;A=A.sibling}throw Error(n(188))}if(p.return!==y.return)p=C,y=A;else{for(var L=!1,U=C.child;U;){if(U===p){L=!0,p=C,y=A;break}if(U===y){L=!0,y=C,p=A;break}U=U.sibling}if(!L){for(U=A.child;U;){if(U===p){L=!0,p=A,y=C;break}if(U===y){L=!0,y=A,p=C;break}U=U.sibling}if(!L)throw Error(n(189))}}if(p.alternate!==y)throw Error(n(190))}if(p.tag!==3)throw Error(n(188));return p.stateNode.current===p?a:c}function Ic(a){return a=Vd(a),a!==null?na(a):null}function na(a){if(a.tag===5||a.tag===6)return a;for(a=a.child;a!==null;){var c=na(a);if(c!==null)return c;a=a.sibling}return null}var Oc=e.unstable_scheduleCallback,hp=e.unstable_cancelCallback,Lc=e.unstable_shouldYield,Ev=e.unstable_requestPaint,gn=e.unstable_now,Pv=e.unstable_getCurrentPriorityLevel,ml=e.unstable_ImmediatePriority,Nc=e.unstable_UserBlockingPriority,gl=e.unstable_NormalPriority,Av=e.unstable_LowPriority,pp=e.unstable_IdlePriority,vl=null,Ns=null;function Tv(a){if(Ns&&typeof Ns.onCommitFiberRoot=="function")try{Ns.onCommitFiberRoot(vl,a,void 0,(a.current.flags&128)===128)}catch{}}var Or=Math.clz32?Math.clz32:Iv,Rv=Math.log,Mv=Math.LN2;function Iv(a){return a>>>=0,a===0?32:31-(Rv(a)/Mv|0)|0}var Dc=64,jc=4194304;function co(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 $c(a,c){var p=a.pendingLanes;if(p===0)return 0;var y=0,C=a.suspendedLanes,A=a.pingedLanes,L=p&268435455;if(L!==0){var U=L&~C;U!==0?y=co(U):(A&=L,A!==0&&(y=co(A)))}else L=p&~C,L!==0?y=co(L):A!==0&&(y=co(A));if(y===0)return 0;if(c!==0&&c!==y&&(c&C)===0&&(C=y&-y,A=c&-c,C>=A||C===16&&(A&4194240)!==0))return c;if((y&4)!==0&&(y|=p&16),c=a.entangledLanes,c!==0)for(a=a.entanglements,c&=y;0<c;)p=31-Or(c),C=1<<p,y|=a[p],c&=~C;return y}function Ov(a,c){switch(a){case 1:case 2:case 4:return c+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 c+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 Lv(a,c){for(var p=a.suspendedLanes,y=a.pingedLanes,C=a.expirationTimes,A=a.pendingLanes;0<A;){var L=31-Or(A),U=1<<L,G=C[L];G===-1?((U&p)===0||(U&y)!==0)&&(C[L]=Ov(U,c)):G<=c&&(a.expiredLanes|=U),A&=~U}}function yl(a){return a=a.pendingLanes&-1073741825,a!==0?a:a&1073741824?1073741824:0}function Fc(){var a=Dc;return Dc<<=1,(Dc&4194240)===0&&(Dc=64),a}function Vc(a){for(var c=[],p=0;31>p;p++)c.push(a);return c}function _l(a,c,p){a.pendingLanes|=c,c!==536870912&&(a.suspendedLanes=0,a.pingedLanes=0),a=a.eventTimes,c=31-Or(c),a[c]=p}function X6(a,c){var p=a.pendingLanes&~c;a.pendingLanes=c,a.suspendedLanes=0,a.pingedLanes=0,a.expiredLanes&=c,a.mutableReadLanes&=c,a.entangledLanes&=c,c=a.entanglements;var y=a.eventTimes;for(a=a.expirationTimes;0<p;){var C=31-Or(p),A=1<<C;c[C]=0,y[C]=-1,a[C]=-1,p&=~A}}function Pi(a,c){var p=a.entangledLanes|=c;for(a=a.entanglements;p;){var y=31-Or(p),C=1<<y;C&c|a[y]&c&&(a[y]|=c),p&=~C}}var Nt=0;function Hc(a){return a&=-a,1<a?4<a?(a&268435455)!==0?16:536870912:4:1}var mp,Hd,gp,zd,vp,zc=!1,uo=[],Ds=null,ni=null,ri=null,ra=new Map,sa=new Map,F=[],ce="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 Ce(a,c){switch(a){case"focusin":case"focusout":Ds=null;break;case"dragenter":case"dragleave":ni=null;break;case"mouseover":case"mouseout":ri=null;break;case"pointerover":case"pointerout":ra.delete(c.pointerId);break;case"gotpointercapture":case"lostpointercapture":sa.delete(c.pointerId)}}function fe(a,c,p,y,C,A){return a===null||a.nativeEvent!==A?(a={blockedOn:c,domEventName:p,eventSystemFlags:y,nativeEvent:A,targetContainers:[C]},c!==null&&(c=ef(c),c!==null&&Hd(c)),a):(a.eventSystemFlags|=y,c=a.targetContainers,C!==null&&c.indexOf(C)===-1&&c.push(C),a)}function ye(a,c,p,y,C){switch(c){case"focusin":return Ds=fe(Ds,a,c,p,y,C),!0;case"dragenter":return ni=fe(ni,a,c,p,y,C),!0;case"mouseover":return ri=fe(ri,a,c,p,y,C),!0;case"pointerover":var A=C.pointerId;return ra.set(A,fe(ra.get(A)||null,a,c,p,y,C)),!0;case"gotpointercapture":return A=C.pointerId,sa.set(A,fe(sa.get(A)||null,a,c,p,y,C)),!0}return!1}function we(a){var c=wl(a.target);if(c!==null){var p=Ei(c);if(p!==null){if(c=p.tag,c===13){if(c=pl(p),c!==null){a.blockedOn=c,vp(a.priority,function(){gp(p)});return}}else if(c===3&&p.stateNode.current.memoizedState.isDehydrated){a.blockedOn=p.tag===3?p.stateNode.containerInfo:null;return}}}a.blockedOn=null}function Ye(a){if(a.blockedOn!==null)return!1;for(var c=a.targetContainers;0<c.length;){var p=Nv(a.domEventName,a.eventSystemFlags,c[0],a.nativeEvent);if(p===null){p=a.nativeEvent;var y=new p.constructor(p.type,p);nr=y,p.target.dispatchEvent(y),nr=null}else return c=ef(p),c!==null&&Hd(c),a.blockedOn=p,!1;c.shift()}return!0}function Le(a,c,p){Ye(a)&&p.delete(c)}function In(){zc=!1,Ds!==null&&Ye(Ds)&&(Ds=null),ni!==null&&Ye(ni)&&(ni=null),ri!==null&&Ye(ri)&&(ri=null),ra.forEach(Le),sa.forEach(Le)}function En(a,c){a.blockedOn===c&&(a.blockedOn=null,zc||(zc=!0,e.unstable_scheduleCallback(e.unstable_NormalPriority,In)))}function xr(a){function c(C){return En(C,a)}if(0<uo.length){En(uo[0],a);for(var p=1;p<uo.length;p++){var y=uo[p];y.blockedOn===a&&(y.blockedOn=null)}}for(Ds!==null&&En(Ds,a),ni!==null&&En(ni,a),ri!==null&&En(ri,a),ra.forEach(c),sa.forEach(c),p=0;p<F.length;p++)y=F[p],y.blockedOn===a&&(y.blockedOn=null);for(;0<F.length&&(p=F[0],p.blockedOn===null);)we(p),p.blockedOn===null&&F.shift()}var rr=P.ReactCurrentBatchConfig,br=!0;function ft(a,c,p,y){var C=Nt,A=rr.transition;rr.transition=null;try{Nt=1,si(a,c,p,y)}finally{Nt=C,rr.transition=A}}function Jt(a,c,p,y){var C=Nt,A=rr.transition;rr.transition=null;try{Nt=4,si(a,c,p,y)}finally{Nt=C,rr.transition=A}}function si(a,c,p,y){if(br){var C=Nv(a,c,p,y);if(C===null)Xv(a,c,y,yp,p),Ce(a,y);else if(ye(C,a,c,p,y))y.stopPropagation();else if(Ce(a,y),c&4&&-1<ce.indexOf(a)){for(;C!==null;){var A=ef(C);if(A!==null&&mp(A),A=Nv(a,c,p,y),A===null&&Xv(a,c,y,yp,p),A===C)break;C=A}C!==null&&y.stopPropagation()}else Xv(a,c,y,null,p)}}var yp=null;function Nv(a,c,p,y){if(yp=null,a=ao(y),a=wl(a),a!==null)if(c=Ei(a),c===null)a=null;else if(p=c.tag,p===13){if(a=pl(c),a!==null)return a;a=null}else if(p===3){if(c.stateNode.current.memoizedState.isDehydrated)return c.tag===3?c.stateNode.containerInfo:null;a=null}else c!==a&&(a=null);return yp=a,null}function J6(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(Pv()){case ml:return 1;case Nc:return 4;case gl:case Av:return 16;case pp:return 536870912;default:return 16}default:return 16}}var ia=null,Dv=null,_p=null;function eS(){if(_p)return _p;var a,c=Dv,p=c.length,y,C="value"in ia?ia.value:ia.textContent,A=C.length;for(a=0;a<p&&c[a]===C[a];a++);var L=p-a;for(y=1;y<=L&&c[p-y]===C[A-y];y++);return _p=C.slice(a,1<y?1-y:void 0)}function wp(a){var c=a.keyCode;return"charCode"in a?(a=a.charCode,a===0&&c===13&&(a=13)):a=c,a===10&&(a=13),32<=a||a===13?a:0}function xp(){return!0}function tS(){return!1}function ps(a){function c(p,y,C,A,L){this._reactName=p,this._targetInst=C,this.type=y,this.nativeEvent=A,this.target=L,this.currentTarget=null;for(var U in a)a.hasOwnProperty(U)&&(p=a[U],this[U]=p?p(A):A[U]);return this.isDefaultPrevented=(A.defaultPrevented!=null?A.defaultPrevented:A.returnValue===!1)?xp:tS,this.isPropagationStopped=tS,this}return H(c.prototype,{preventDefault:function(){this.defaultPrevented=!0;var p=this.nativeEvent;p&&(p.preventDefault?p.preventDefault():typeof p.returnValue!="unknown"&&(p.returnValue=!1),this.isDefaultPrevented=xp)},stopPropagation:function(){var p=this.nativeEvent;p&&(p.stopPropagation?p.stopPropagation():typeof p.cancelBubble!="unknown"&&(p.cancelBubble=!0),this.isPropagationStopped=xp)},persist:function(){},isPersistent:xp}),c}var Uc={eventPhase:0,bubbles:0,cancelable:0,timeStamp:function(a){return a.timeStamp||Date.now()},defaultPrevented:0,isTrusted:0},jv=ps(Uc),Ud=H({},Uc,{view:0,detail:0}),LD=ps(Ud),$v,Fv,Bd,bp=H({},Ud,{screenX:0,screenY:0,clientX:0,clientY:0,pageX:0,pageY:0,ctrlKey:0,shiftKey:0,altKey:0,metaKey:0,getModifierState:Hv,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!==Bd&&(Bd&&a.type==="mousemove"?($v=a.screenX-Bd.screenX,Fv=a.screenY-Bd.screenY):Fv=$v=0,Bd=a),$v)},movementY:function(a){return"movementY"in a?a.movementY:Fv}}),nS=ps(bp),ND=H({},bp,{dataTransfer:0}),DD=ps(ND),jD=H({},Ud,{relatedTarget:0}),Vv=ps(jD),$D=H({},Uc,{animationName:0,elapsedTime:0,pseudoElement:0}),FD=ps($D),VD=H({},Uc,{clipboardData:function(a){return"clipboardData"in a?a.clipboardData:window.clipboardData}}),HD=ps(VD),zD=H({},Uc,{data:0}),rS=ps(zD),UD={Esc:"Escape",Spacebar:" ",Left:"ArrowLeft",Up:"ArrowUp",Right:"ArrowRight",Down:"ArrowDown",Del:"Delete",Win:"OS",Menu:"ContextMenu",Apps:"ContextMenu",Scroll:"ScrollLock",MozPrintableKey:"Unidentified"},BD={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"},ZD={Alt:"altKey",Control:"ctrlKey",Meta:"metaKey",Shift:"shiftKey"};function WD(a){var c=this.nativeEvent;return c.getModifierState?c.getModifierState(a):(a=ZD[a])?!!c[a]:!1}function Hv(){return WD}var qD=H({},Ud,{key:function(a){if(a.key){var c=UD[a.key]||a.key;if(c!=="Unidentified")return c}return a.type==="keypress"?(a=wp(a),a===13?"Enter":String.fromCharCode(a)):a.type==="keydown"||a.type==="keyup"?BD[a.keyCode]||"Unidentified":""},code:0,location:0,ctrlKey:0,shiftKey:0,altKey:0,metaKey:0,repeat:0,locale:0,getModifierState:Hv,charCode:function(a){return a.type==="keypress"?wp(a):0},keyCode:function(a){return a.type==="keydown"||a.type==="keyup"?a.keyCode:0},which:function(a){return a.type==="keypress"?wp(a):a.type==="keydown"||a.type==="keyup"?a.keyCode:0}}),GD=ps(qD),KD=H({},bp,{pointerId:0,width:0,height:0,pressure:0,tangentialPressure:0,tiltX:0,tiltY:0,twist:0,pointerType:0,isPrimary:0}),sS=ps(KD),YD=H({},Ud,{touches:0,targetTouches:0,changedTouches:0,altKey:0,metaKey:0,ctrlKey:0,shiftKey:0,getModifierState:Hv}),QD=ps(YD),XD=H({},Uc,{propertyName:0,elapsedTime:0,pseudoElement:0}),JD=ps(XD),e7=H({},bp,{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}),t7=ps(e7),n7=[9,13,27,32],zv=l&&"CompositionEvent"in window,Zd=null;l&&"documentMode"in document&&(Zd=document.documentMode);var r7=l&&"TextEvent"in window&&!Zd,iS=l&&(!zv||Zd&&8<Zd&&11>=Zd),oS=" ",aS=!1;function lS(a,c){switch(a){case"keyup":return n7.indexOf(c.keyCode)!==-1;case"keydown":return c.keyCode!==229;case"keypress":case"mousedown":case"focusout":return!0;default:return!1}}function cS(a){return a=a.detail,typeof a=="object"&&"data"in a?a.data:null}var Bc=!1;function s7(a,c){switch(a){case"compositionend":return cS(c);case"keypress":return c.which!==32?null:(aS=!0,oS);case"textInput":return a=c.data,a===oS&&aS?null:a;default:return null}}function i7(a,c){if(Bc)return a==="compositionend"||!zv&&lS(a,c)?(a=eS(),_p=Dv=ia=null,Bc=!1,a):null;switch(a){case"paste":return null;case"keypress":if(!(c.ctrlKey||c.altKey||c.metaKey)||c.ctrlKey&&c.altKey){if(c.char&&1<c.char.length)return c.char;if(c.which)return String.fromCharCode(c.which)}return null;case"compositionend":return iS&&c.locale!=="ko"?null:c.data;default:return null}}var o7={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 uS(a){var c=a&&a.nodeName&&a.nodeName.toLowerCase();return c==="input"?!!o7[a.type]:c==="textarea"}function dS(a,c,p,y){lo(y),c=Pp(c,"onChange"),0<c.length&&(p=new jv("onChange","change",null,p,y),a.push({event:p,listeners:c}))}var Wd=null,qd=null;function a7(a){TS(a,0)}function Sp(a){var c=Kc(a);if(Ee(c))return a}function l7(a,c){if(a==="change")return c}var fS=!1;if(l){var Uv;if(l){var Bv="oninput"in document;if(!Bv){var hS=document.createElement("div");hS.setAttribute("oninput","return;"),Bv=typeof hS.oninput=="function"}Uv=Bv}else Uv=!1;fS=Uv&&(!document.documentMode||9<document.documentMode)}function pS(){Wd&&(Wd.detachEvent("onpropertychange",mS),qd=Wd=null)}function mS(a){if(a.propertyName==="value"&&Sp(qd)){var c=[];dS(c,qd,a,ao(a)),qn(a7,c)}}function c7(a,c,p){a==="focusin"?(pS(),Wd=c,qd=p,Wd.attachEvent("onpropertychange",mS)):a==="focusout"&&pS()}function u7(a){if(a==="selectionchange"||a==="keyup"||a==="keydown")return Sp(qd)}function d7(a,c){if(a==="click")return Sp(c)}function f7(a,c){if(a==="input"||a==="change")return Sp(c)}function h7(a,c){return a===c&&(a!==0||1/a===1/c)||a!==a&&c!==c}var ii=typeof Object.is=="function"?Object.is:h7;function Gd(a,c){if(ii(a,c))return!0;if(typeof a!="object"||a===null||typeof c!="object"||c===null)return!1;var p=Object.keys(a),y=Object.keys(c);if(p.length!==y.length)return!1;for(y=0;y<p.length;y++){var C=p[y];if(!u.call(c,C)||!ii(a[C],c[C]))return!1}return!0}function gS(a){for(;a&&a.firstChild;)a=a.firstChild;return a}function vS(a,c){var p=gS(a);a=0;for(var y;p;){if(p.nodeType===3){if(y=a+p.textContent.length,a<=c&&y>=c)return{node:p,offset:c-a};a=y}e:{for(;p;){if(p.nextSibling){p=p.nextSibling;break e}p=p.parentNode}p=void 0}p=gS(p)}}function yS(a,c){return a&&c?a===c?!0:a&&a.nodeType===3?!1:c&&c.nodeType===3?yS(a,c.parentNode):"contains"in a?a.contains(c):a.compareDocumentPosition?!!(a.compareDocumentPosition(c)&16):!1:!1}function _S(){for(var a=window,c=dt();c instanceof a.HTMLIFrameElement;){try{var p=typeof c.contentWindow.location.href=="string"}catch{p=!1}if(p)a=c.contentWindow;else break;c=dt(a.document)}return c}function Zv(a){var c=a&&a.nodeName&&a.nodeName.toLowerCase();return c&&(c==="input"&&(a.type==="text"||a.type==="search"||a.type==="tel"||a.type==="url"||a.type==="password")||c==="textarea"||a.contentEditable==="true")}function p7(a){var c=_S(),p=a.focusedElem,y=a.selectionRange;if(c!==p&&p&&p.ownerDocument&&yS(p.ownerDocument.documentElement,p)){if(y!==null&&Zv(p)){if(c=y.start,a=y.end,a===void 0&&(a=c),"selectionStart"in p)p.selectionStart=c,p.selectionEnd=Math.min(a,p.value.length);else if(a=(c=p.ownerDocument||document)&&c.defaultView||window,a.getSelection){a=a.getSelection();var C=p.textContent.length,A=Math.min(y.start,C);y=y.end===void 0?A:Math.min(y.end,C),!a.extend&&A>y&&(C=y,y=A,A=C),C=vS(p,A);var L=vS(p,y);C&&L&&(a.rangeCount!==1||a.anchorNode!==C.node||a.anchorOffset!==C.offset||a.focusNode!==L.node||a.focusOffset!==L.offset)&&(c=c.createRange(),c.setStart(C.node,C.offset),a.removeAllRanges(),A>y?(a.addRange(c),a.extend(L.node,L.offset)):(c.setEnd(L.node,L.offset),a.addRange(c)))}}for(c=[],a=p;a=a.parentNode;)a.nodeType===1&&c.push({element:a,left:a.scrollLeft,top:a.scrollTop});for(typeof p.focus=="function"&&p.focus(),p=0;p<c.length;p++)a=c[p],a.element.scrollLeft=a.left,a.element.scrollTop=a.top}}var m7=l&&"documentMode"in document&&11>=document.documentMode,Zc=null,Wv=null,Kd=null,qv=!1;function wS(a,c,p){var y=p.window===p?p.document:p.nodeType===9?p:p.ownerDocument;qv||Zc==null||Zc!==dt(y)||(y=Zc,"selectionStart"in y&&Zv(y)?y={start:y.selectionStart,end:y.selectionEnd}:(y=(y.ownerDocument&&y.ownerDocument.defaultView||window).getSelection(),y={anchorNode:y.anchorNode,anchorOffset:y.anchorOffset,focusNode:y.focusNode,focusOffset:y.focusOffset}),Kd&&Gd(Kd,y)||(Kd=y,y=Pp(Wv,"onSelect"),0<y.length&&(c=new jv("onSelect","select",null,c,p),a.push({event:c,listeners:y}),c.target=Zc)))}function kp(a,c){var p={};return p[a.toLowerCase()]=c.toLowerCase(),p["Webkit"+a]="webkit"+c,p["Moz"+a]="moz"+c,p}var Wc={animationend:kp("Animation","AnimationEnd"),animationiteration:kp("Animation","AnimationIteration"),animationstart:kp("Animation","AnimationStart"),transitionend:kp("Transition","TransitionEnd")},Gv={},xS={};l&&(xS=document.createElement("div").style,"AnimationEvent"in window||(delete Wc.animationend.animation,delete Wc.animationiteration.animation,delete Wc.animationstart.animation),"TransitionEvent"in window||delete Wc.transitionend.transition);function Cp(a){if(Gv[a])return Gv[a];if(!Wc[a])return a;var c=Wc[a],p;for(p in c)if(c.hasOwnProperty(p)&&p in xS)return Gv[a]=c[p];return a}var bS=Cp("animationend"),SS=Cp("animationiteration"),kS=Cp("animationstart"),CS=Cp("transitionend"),ES=new Map,PS="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 oa(a,c){ES.set(a,c),i(c,[a])}for(var Kv=0;Kv<PS.length;Kv++){var Yv=PS[Kv],g7=Yv.toLowerCase(),v7=Yv[0].toUpperCase()+Yv.slice(1);oa(g7,"on"+v7)}oa(bS,"onAnimationEnd"),oa(SS,"onAnimationIteration"),oa(kS,"onAnimationStart"),oa("dblclick","onDoubleClick"),oa("focusin","onFocus"),oa("focusout","onBlur"),oa(CS,"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 Yd="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(" "),y7=new Set("cancel close invalid load scroll toggle".split(" ").concat(Yd));function AS(a,c,p){var y=a.type||"unknown-event";a.currentTarget=p,ta(y,c,void 0,a),a.currentTarget=null}function TS(a,c){c=(c&4)!==0;for(var p=0;p<a.length;p++){var y=a[p],C=y.event;y=y.listeners;e:{var A=void 0;if(c)for(var L=y.length-1;0<=L;L--){var U=y[L],G=U.instance,oe=U.currentTarget;if(U=U.listener,G!==A&&C.isPropagationStopped())break e;AS(C,U,oe),A=G}else for(L=0;L<y.length;L++){if(U=y[L],G=U.instance,oe=U.currentTarget,U=U.listener,G!==A&&C.isPropagationStopped())break e;AS(C,U,oe),A=G}}}if(Mn)throw a=fl,Mn=!1,fl=null,a}function sn(a,c){var p=c[s1];p===void 0&&(p=c[s1]=new Set);var y=a+"__bubble";p.has(y)||(RS(c,a,2,!1),p.add(y))}function Qv(a,c,p){var y=0;c&&(y|=4),RS(p,a,y,c)}var Ep="_reactListening"+Math.random().toString(36).slice(2);function Qd(a){if(!a[Ep]){a[Ep]=!0,r.forEach(function(p){p!=="selectionchange"&&(y7.has(p)||Qv(p,!1,a),Qv(p,!0,a))});var c=a.nodeType===9?a:a.ownerDocument;c===null||c[Ep]||(c[Ep]=!0,Qv("selectionchange",!1,c))}}function RS(a,c,p,y){switch(J6(c)){case 1:var C=ft;break;case 4:C=Jt;break;default:C=si}p=C.bind(null,c,p,a),C=void 0,!Ut||c!=="touchstart"&&c!=="touchmove"&&c!=="wheel"||(C=!0),y?C!==void 0?a.addEventListener(c,p,{capture:!0,passive:C}):a.addEventListener(c,p,!0):C!==void 0?a.addEventListener(c,p,{passive:C}):a.addEventListener(c,p,!1)}function Xv(a,c,p,y,C){var A=y;if((c&1)===0&&(c&2)===0&&y!==null)e:for(;;){if(y===null)return;var L=y.tag;if(L===3||L===4){var U=y.stateNode.containerInfo;if(U===C||U.nodeType===8&&U.parentNode===C)break;if(L===4)for(L=y.return;L!==null;){var G=L.tag;if((G===3||G===4)&&(G=L.stateNode.containerInfo,G===C||G.nodeType===8&&G.parentNode===C))return;L=L.return}for(;U!==null;){if(L=wl(U),L===null)return;if(G=L.tag,G===5||G===6){y=A=L;continue e}U=U.parentNode}}y=y.return}qn(function(){var oe=A,ve=ao(p),_e=[];e:{var pe=ES.get(a);if(pe!==void 0){var Re=jv,Fe=a;switch(a){case"keypress":if(wp(p)===0)break e;case"keydown":case"keyup":Re=GD;break;case"focusin":Fe="focus",Re=Vv;break;case"focusout":Fe="blur",Re=Vv;break;case"beforeblur":case"afterblur":Re=Vv;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":Re=nS;break;case"drag":case"dragend":case"dragenter":case"dragexit":case"dragleave":case"dragover":case"dragstart":case"drop":Re=DD;break;case"touchcancel":case"touchend":case"touchmove":case"touchstart":Re=QD;break;case bS:case SS:case kS:Re=FD;break;case CS:Re=JD;break;case"scroll":Re=LD;break;case"wheel":Re=t7;break;case"copy":case"cut":case"paste":Re=HD;break;case"gotpointercapture":case"lostpointercapture":case"pointercancel":case"pointerdown":case"pointermove":case"pointerout":case"pointerover":case"pointerup":Re=sS}var ze=(c&4)!==0,On=!ze&&a==="scroll",ee=ze?pe!==null?pe+"Capture":null:pe;ze=[];for(var Q=oe,ne;Q!==null;){ne=Q;var Se=ne.stateNode;if(ne.tag===5&&Se!==null&&(ne=Se,ee!==null&&(Se=hs(Q,ee),Se!=null&&ze.push(Xd(Q,Se,ne)))),On)break;Q=Q.return}0<ze.length&&(pe=new Re(pe,Fe,null,p,ve),_e.push({event:pe,listeners:ze}))}}if((c&7)===0){e:{if(pe=a==="mouseover"||a==="pointerover",Re=a==="mouseout"||a==="pointerout",pe&&p!==nr&&(Fe=p.relatedTarget||p.fromElement)&&(wl(Fe)||Fe[fo]))break e;if((Re||pe)&&(pe=ve.window===ve?ve:(pe=ve.ownerDocument)?pe.defaultView||pe.parentWindow:window,Re?(Fe=p.relatedTarget||p.toElement,Re=oe,Fe=Fe?wl(Fe):null,Fe!==null&&(On=Ei(Fe),Fe!==On||Fe.tag!==5&&Fe.tag!==6)&&(Fe=null)):(Re=null,Fe=oe),Re!==Fe)){if(ze=nS,Se="onMouseLeave",ee="onMouseEnter",Q="mouse",(a==="pointerout"||a==="pointerover")&&(ze=sS,Se="onPointerLeave",ee="onPointerEnter",Q="pointer"),On=Re==null?pe:Kc(Re),ne=Fe==null?pe:Kc(Fe),pe=new ze(Se,Q+"leave",Re,p,ve),pe.target=On,pe.relatedTarget=ne,Se=null,wl(ve)===oe&&(ze=new ze(ee,Q+"enter",Fe,p,ve),ze.target=ne,ze.relatedTarget=On,Se=ze),On=Se,Re&&Fe)t:{for(ze=Re,ee=Fe,Q=0,ne=ze;ne;ne=qc(ne))Q++;for(ne=0,Se=ee;Se;Se=qc(Se))ne++;for(;0<Q-ne;)ze=qc(ze),Q--;for(;0<ne-Q;)ee=qc(ee),ne--;for(;Q--;){if(ze===ee||ee!==null&&ze===ee.alternate)break t;ze=qc(ze),ee=qc(ee)}ze=null}else ze=null;Re!==null&&MS(_e,pe,Re,ze,!1),Fe!==null&&On!==null&&MS(_e,On,Fe,ze,!0)}}e:{if(pe=oe?Kc(oe):window,Re=pe.nodeName&&pe.nodeName.toLowerCase(),Re==="select"||Re==="input"&&pe.type==="file")var Be=l7;else if(uS(pe))if(fS)Be=f7;else{Be=u7;var Je=c7}else(Re=pe.nodeName)&&Re.toLowerCase()==="input"&&(pe.type==="checkbox"||pe.type==="radio")&&(Be=d7);if(Be&&(Be=Be(a,oe))){dS(_e,Be,p,ve);break e}Je&&Je(a,pe,oe),a==="focusout"&&(Je=pe._wrapperState)&&Je.controlled&&pe.type==="number"&&Ct(pe,"number",pe.value)}switch(Je=oe?Kc(oe):window,a){case"focusin":(uS(Je)||Je.contentEditable==="true")&&(Zc=Je,Wv=oe,Kd=null);break;case"focusout":Kd=Wv=Zc=null;break;case"mousedown":qv=!0;break;case"contextmenu":case"mouseup":case"dragend":qv=!1,wS(_e,p,ve);break;case"selectionchange":if(m7)break;case"keydown":case"keyup":wS(_e,p,ve)}var et;if(zv)e:{switch(a){case"compositionstart":var ot="onCompositionStart";break e;case"compositionend":ot="onCompositionEnd";break e;case"compositionupdate":ot="onCompositionUpdate";break e}ot=void 0}else Bc?lS(a,p)&&(ot="onCompositionEnd"):a==="keydown"&&p.keyCode===229&&(ot="onCompositionStart");ot&&(iS&&p.locale!=="ko"&&(Bc||ot!=="onCompositionStart"?ot==="onCompositionEnd"&&Bc&&(et=eS()):(ia=ve,Dv="value"in ia?ia.value:ia.textContent,Bc=!0)),Je=Pp(oe,ot),0<Je.length&&(ot=new rS(ot,a,null,p,ve),_e.push({event:ot,listeners:Je}),et?ot.data=et:(et=cS(p),et!==null&&(ot.data=et)))),(et=r7?s7(a,p):i7(a,p))&&(oe=Pp(oe,"onBeforeInput"),0<oe.length&&(ve=new rS("onBeforeInput","beforeinput",null,p,ve),_e.push({event:ve,listeners:oe}),ve.data=et))}TS(_e,c)})}function Xd(a,c,p){return{instance:a,listener:c,currentTarget:p}}function Pp(a,c){for(var p=c+"Capture",y=[];a!==null;){var C=a,A=C.stateNode;C.tag===5&&A!==null&&(C=A,A=hs(a,p),A!=null&&y.unshift(Xd(a,A,C)),A=hs(a,c),A!=null&&y.push(Xd(a,A,C))),a=a.return}return y}function qc(a){if(a===null)return null;do a=a.return;while(a&&a.tag!==5);return a||null}function MS(a,c,p,y,C){for(var A=c._reactName,L=[];p!==null&&p!==y;){var U=p,G=U.alternate,oe=U.stateNode;if(G!==null&&G===y)break;U.tag===5&&oe!==null&&(U=oe,C?(G=hs(p,A),G!=null&&L.unshift(Xd(p,G,U))):C||(G=hs(p,A),G!=null&&L.push(Xd(p,G,U)))),p=p.return}L.length!==0&&a.push({event:c,listeners:L})}var _7=/\r\n?/g,w7=/\u0000|\uFFFD/g;function IS(a){return(typeof a=="string"?a:""+a).replace(_7,`
|
|
40
|
+
`).replace(w7,"")}function Ap(a,c,p){if(c=IS(c),IS(a)!==c&&p)throw Error(n(425))}function Tp(){}var Jv=null,e1=null;function t1(a,c){return a==="textarea"||a==="noscript"||typeof c.children=="string"||typeof c.children=="number"||typeof c.dangerouslySetInnerHTML=="object"&&c.dangerouslySetInnerHTML!==null&&c.dangerouslySetInnerHTML.__html!=null}var n1=typeof setTimeout=="function"?setTimeout:void 0,x7=typeof clearTimeout=="function"?clearTimeout:void 0,OS=typeof Promise=="function"?Promise:void 0,b7=typeof queueMicrotask=="function"?queueMicrotask:typeof OS<"u"?function(a){return OS.resolve(null).then(a).catch(S7)}:n1;function S7(a){setTimeout(function(){throw a})}function r1(a,c){var p=c,y=0;do{var C=p.nextSibling;if(a.removeChild(p),C&&C.nodeType===8)if(p=C.data,p==="/$"){if(y===0){a.removeChild(C),xr(c);return}y--}else p!=="$"&&p!=="$?"&&p!=="$!"||y++;p=C}while(p);xr(c)}function aa(a){for(;a!=null;a=a.nextSibling){var c=a.nodeType;if(c===1||c===3)break;if(c===8){if(c=a.data,c==="$"||c==="$!"||c==="$?")break;if(c==="/$")return null}}return a}function LS(a){a=a.previousSibling;for(var c=0;a;){if(a.nodeType===8){var p=a.data;if(p==="$"||p==="$!"||p==="$?"){if(c===0)return a;c--}else p==="/$"&&c++}a=a.previousSibling}return null}var Gc=Math.random().toString(36).slice(2),Ai="__reactFiber$"+Gc,Jd="__reactProps$"+Gc,fo="__reactContainer$"+Gc,s1="__reactEvents$"+Gc,k7="__reactListeners$"+Gc,C7="__reactHandles$"+Gc;function wl(a){var c=a[Ai];if(c)return c;for(var p=a.parentNode;p;){if(c=p[fo]||p[Ai]){if(p=c.alternate,c.child!==null||p!==null&&p.child!==null)for(a=LS(a);a!==null;){if(p=a[Ai])return p;a=LS(a)}return c}a=p,p=a.parentNode}return null}function ef(a){return a=a[Ai]||a[fo],!a||a.tag!==5&&a.tag!==6&&a.tag!==13&&a.tag!==3?null:a}function Kc(a){if(a.tag===5||a.tag===6)return a.stateNode;throw Error(n(33))}function Rp(a){return a[Jd]||null}var i1=[],Yc=-1;function la(a){return{current:a}}function on(a){0>Yc||(a.current=i1[Yc],i1[Yc]=null,Yc--)}function en(a,c){Yc++,i1[Yc]=a.current,a.current=c}var ca={},Sr=la(ca),qr=la(!1),xl=ca;function Qc(a,c){var p=a.type.contextTypes;if(!p)return ca;var y=a.stateNode;if(y&&y.__reactInternalMemoizedUnmaskedChildContext===c)return y.__reactInternalMemoizedMaskedChildContext;var C={},A;for(A in p)C[A]=c[A];return y&&(a=a.stateNode,a.__reactInternalMemoizedUnmaskedChildContext=c,a.__reactInternalMemoizedMaskedChildContext=C),C}function Gr(a){return a=a.childContextTypes,a!=null}function Mp(){on(qr),on(Sr)}function NS(a,c,p){if(Sr.current!==ca)throw Error(n(168));en(Sr,c),en(qr,p)}function DS(a,c,p){var y=a.stateNode;if(c=c.childContextTypes,typeof y.getChildContext!="function")return p;y=y.getChildContext();for(var C in y)if(!(C in c))throw Error(n(108,ge(a)||"Unknown",C));return H({},p,y)}function Ip(a){return a=(a=a.stateNode)&&a.__reactInternalMemoizedMergedChildContext||ca,xl=Sr.current,en(Sr,a),en(qr,qr.current),!0}function jS(a,c,p){var y=a.stateNode;if(!y)throw Error(n(169));p?(a=DS(a,c,xl),y.__reactInternalMemoizedMergedChildContext=a,on(qr),on(Sr),en(Sr,a)):on(qr),en(qr,p)}var ho=null,Op=!1,o1=!1;function $S(a){ho===null?ho=[a]:ho.push(a)}function E7(a){Op=!0,$S(a)}function ua(){if(!o1&&ho!==null){o1=!0;var a=0,c=Nt;try{var p=ho;for(Nt=1;a<p.length;a++){var y=p[a];do y=y(!0);while(y!==null)}ho=null,Op=!1}catch(C){throw ho!==null&&(ho=ho.slice(a+1)),Oc(ml,ua),C}finally{Nt=c,o1=!1}}return null}var Xc=[],Jc=0,Lp=null,Np=0,js=[],$s=0,bl=null,po=1,mo="";function Sl(a,c){Xc[Jc++]=Np,Xc[Jc++]=Lp,Lp=a,Np=c}function FS(a,c,p){js[$s++]=po,js[$s++]=mo,js[$s++]=bl,bl=a;var y=po;a=mo;var C=32-Or(y)-1;y&=~(1<<C),p+=1;var A=32-Or(c)+C;if(30<A){var L=C-C%5;A=(y&(1<<L)-1).toString(32),y>>=L,C-=L,po=1<<32-Or(c)+C|p<<C|y,mo=A+a}else po=1<<A|p<<C|y,mo=a}function a1(a){a.return!==null&&(Sl(a,1),FS(a,1,0))}function l1(a){for(;a===Lp;)Lp=Xc[--Jc],Xc[Jc]=null,Np=Xc[--Jc],Xc[Jc]=null;for(;a===bl;)bl=js[--$s],js[$s]=null,mo=js[--$s],js[$s]=null,po=js[--$s],js[$s]=null}var ms=null,gs=null,un=!1,oi=null;function VS(a,c){var p=zs(5,null,null,0);p.elementType="DELETED",p.stateNode=c,p.return=a,c=a.deletions,c===null?(a.deletions=[p],a.flags|=16):c.push(p)}function HS(a,c){switch(a.tag){case 5:var p=a.type;return c=c.nodeType!==1||p.toLowerCase()!==c.nodeName.toLowerCase()?null:c,c!==null?(a.stateNode=c,ms=a,gs=aa(c.firstChild),!0):!1;case 6:return c=a.pendingProps===""||c.nodeType!==3?null:c,c!==null?(a.stateNode=c,ms=a,gs=null,!0):!1;case 13:return c=c.nodeType!==8?null:c,c!==null?(p=bl!==null?{id:po,overflow:mo}:null,a.memoizedState={dehydrated:c,treeContext:p,retryLane:1073741824},p=zs(18,null,null,0),p.stateNode=c,p.return=a,a.child=p,ms=a,gs=null,!0):!1;default:return!1}}function c1(a){return(a.mode&1)!==0&&(a.flags&128)===0}function u1(a){if(un){var c=gs;if(c){var p=c;if(!HS(a,c)){if(c1(a))throw Error(n(418));c=aa(p.nextSibling);var y=ms;c&&HS(a,c)?VS(y,p):(a.flags=a.flags&-4097|2,un=!1,ms=a)}}else{if(c1(a))throw Error(n(418));a.flags=a.flags&-4097|2,un=!1,ms=a}}}function zS(a){for(a=a.return;a!==null&&a.tag!==5&&a.tag!==3&&a.tag!==13;)a=a.return;ms=a}function Dp(a){if(a!==ms)return!1;if(!un)return zS(a),un=!0,!1;var c;if((c=a.tag!==3)&&!(c=a.tag!==5)&&(c=a.type,c=c!=="head"&&c!=="body"&&!t1(a.type,a.memoizedProps)),c&&(c=gs)){if(c1(a))throw US(),Error(n(418));for(;c;)VS(a,c),c=aa(c.nextSibling)}if(zS(a),a.tag===13){if(a=a.memoizedState,a=a!==null?a.dehydrated:null,!a)throw Error(n(317));e:{for(a=a.nextSibling,c=0;a;){if(a.nodeType===8){var p=a.data;if(p==="/$"){if(c===0){gs=aa(a.nextSibling);break e}c--}else p!=="$"&&p!=="$!"&&p!=="$?"||c++}a=a.nextSibling}gs=null}}else gs=ms?aa(a.stateNode.nextSibling):null;return!0}function US(){for(var a=gs;a;)a=aa(a.nextSibling)}function eu(){gs=ms=null,un=!1}function d1(a){oi===null?oi=[a]:oi.push(a)}var P7=P.ReactCurrentBatchConfig;function tf(a,c,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 y=p.stateNode}if(!y)throw Error(n(147,a));var C=y,A=""+a;return c!==null&&c.ref!==null&&typeof c.ref=="function"&&c.ref._stringRef===A?c.ref:(c=function(L){var U=C.refs;L===null?delete U[A]:U[A]=L},c._stringRef=A,c)}if(typeof a!="string")throw Error(n(284));if(!p._owner)throw Error(n(290,a))}return a}function jp(a,c){throw a=Object.prototype.toString.call(c),Error(n(31,a==="[object Object]"?"object with keys {"+Object.keys(c).join(", ")+"}":a))}function BS(a){var c=a._init;return c(a._payload)}function ZS(a){function c(ee,Q){if(a){var ne=ee.deletions;ne===null?(ee.deletions=[Q],ee.flags|=16):ne.push(Q)}}function p(ee,Q){if(!a)return null;for(;Q!==null;)c(ee,Q),Q=Q.sibling;return null}function y(ee,Q){for(ee=new Map;Q!==null;)Q.key!==null?ee.set(Q.key,Q):ee.set(Q.index,Q),Q=Q.sibling;return ee}function C(ee,Q){return ee=ya(ee,Q),ee.index=0,ee.sibling=null,ee}function A(ee,Q,ne){return ee.index=ne,a?(ne=ee.alternate,ne!==null?(ne=ne.index,ne<Q?(ee.flags|=2,Q):ne):(ee.flags|=2,Q)):(ee.flags|=1048576,Q)}function L(ee){return a&&ee.alternate===null&&(ee.flags|=2),ee}function U(ee,Q,ne,Se){return Q===null||Q.tag!==6?(Q=ny(ne,ee.mode,Se),Q.return=ee,Q):(Q=C(Q,ne),Q.return=ee,Q)}function G(ee,Q,ne,Se){var Be=ne.type;return Be===M?ve(ee,Q,ne.props.children,Se,ne.key):Q!==null&&(Q.elementType===Be||typeof Be=="object"&&Be!==null&&Be.$$typeof===z&&BS(Be)===Q.type)?(Se=C(Q,ne.props),Se.ref=tf(ee,Q,ne),Se.return=ee,Se):(Se=a0(ne.type,ne.key,ne.props,null,ee.mode,Se),Se.ref=tf(ee,Q,ne),Se.return=ee,Se)}function oe(ee,Q,ne,Se){return Q===null||Q.tag!==4||Q.stateNode.containerInfo!==ne.containerInfo||Q.stateNode.implementation!==ne.implementation?(Q=ry(ne,ee.mode,Se),Q.return=ee,Q):(Q=C(Q,ne.children||[]),Q.return=ee,Q)}function ve(ee,Q,ne,Se,Be){return Q===null||Q.tag!==7?(Q=Ml(ne,ee.mode,Se,Be),Q.return=ee,Q):(Q=C(Q,ne),Q.return=ee,Q)}function _e(ee,Q,ne){if(typeof Q=="string"&&Q!==""||typeof Q=="number")return Q=ny(""+Q,ee.mode,ne),Q.return=ee,Q;if(typeof Q=="object"&&Q!==null){switch(Q.$$typeof){case T:return ne=a0(Q.type,Q.key,Q.props,null,ee.mode,ne),ne.ref=tf(ee,null,Q),ne.return=ee,ne;case I:return Q=ry(Q,ee.mode,ne),Q.return=ee,Q;case z:var Se=Q._init;return _e(ee,Se(Q._payload),ne)}if(qe(Q)||J(Q))return Q=Ml(Q,ee.mode,ne,null),Q.return=ee,Q;jp(ee,Q)}return null}function pe(ee,Q,ne,Se){var Be=Q!==null?Q.key:null;if(typeof ne=="string"&&ne!==""||typeof ne=="number")return Be!==null?null:U(ee,Q,""+ne,Se);if(typeof ne=="object"&&ne!==null){switch(ne.$$typeof){case T:return ne.key===Be?G(ee,Q,ne,Se):null;case I:return ne.key===Be?oe(ee,Q,ne,Se):null;case z:return Be=ne._init,pe(ee,Q,Be(ne._payload),Se)}if(qe(ne)||J(ne))return Be!==null?null:ve(ee,Q,ne,Se,null);jp(ee,ne)}return null}function Re(ee,Q,ne,Se,Be){if(typeof Se=="string"&&Se!==""||typeof Se=="number")return ee=ee.get(ne)||null,U(Q,ee,""+Se,Be);if(typeof Se=="object"&&Se!==null){switch(Se.$$typeof){case T:return ee=ee.get(Se.key===null?ne:Se.key)||null,G(Q,ee,Se,Be);case I:return ee=ee.get(Se.key===null?ne:Se.key)||null,oe(Q,ee,Se,Be);case z:var Je=Se._init;return Re(ee,Q,ne,Je(Se._payload),Be)}if(qe(Se)||J(Se))return ee=ee.get(ne)||null,ve(Q,ee,Se,Be,null);jp(Q,Se)}return null}function Fe(ee,Q,ne,Se){for(var Be=null,Je=null,et=Q,ot=Q=0,or=null;et!==null&&ot<ne.length;ot++){et.index>ot?(or=et,et=null):or=et.sibling;var Dt=pe(ee,et,ne[ot],Se);if(Dt===null){et===null&&(et=or);break}a&&et&&Dt.alternate===null&&c(ee,et),Q=A(Dt,Q,ot),Je===null?Be=Dt:Je.sibling=Dt,Je=Dt,et=or}if(ot===ne.length)return p(ee,et),un&&Sl(ee,ot),Be;if(et===null){for(;ot<ne.length;ot++)et=_e(ee,ne[ot],Se),et!==null&&(Q=A(et,Q,ot),Je===null?Be=et:Je.sibling=et,Je=et);return un&&Sl(ee,ot),Be}for(et=y(ee,et);ot<ne.length;ot++)or=Re(et,ee,ot,ne[ot],Se),or!==null&&(a&&or.alternate!==null&&et.delete(or.key===null?ot:or.key),Q=A(or,Q,ot),Je===null?Be=or:Je.sibling=or,Je=or);return a&&et.forEach(function(_a){return c(ee,_a)}),un&&Sl(ee,ot),Be}function ze(ee,Q,ne,Se){var Be=J(ne);if(typeof Be!="function")throw Error(n(150));if(ne=Be.call(ne),ne==null)throw Error(n(151));for(var Je=Be=null,et=Q,ot=Q=0,or=null,Dt=ne.next();et!==null&&!Dt.done;ot++,Dt=ne.next()){et.index>ot?(or=et,et=null):or=et.sibling;var _a=pe(ee,et,Dt.value,Se);if(_a===null){et===null&&(et=or);break}a&&et&&_a.alternate===null&&c(ee,et),Q=A(_a,Q,ot),Je===null?Be=_a:Je.sibling=_a,Je=_a,et=or}if(Dt.done)return p(ee,et),un&&Sl(ee,ot),Be;if(et===null){for(;!Dt.done;ot++,Dt=ne.next())Dt=_e(ee,Dt.value,Se),Dt!==null&&(Q=A(Dt,Q,ot),Je===null?Be=Dt:Je.sibling=Dt,Je=Dt);return un&&Sl(ee,ot),Be}for(et=y(ee,et);!Dt.done;ot++,Dt=ne.next())Dt=Re(et,ee,ot,Dt.value,Se),Dt!==null&&(a&&Dt.alternate!==null&&et.delete(Dt.key===null?ot:Dt.key),Q=A(Dt,Q,ot),Je===null?Be=Dt:Je.sibling=Dt,Je=Dt);return a&&et.forEach(function(oj){return c(ee,oj)}),un&&Sl(ee,ot),Be}function On(ee,Q,ne,Se){if(typeof ne=="object"&&ne!==null&&ne.type===M&&ne.key===null&&(ne=ne.props.children),typeof ne=="object"&&ne!==null){switch(ne.$$typeof){case T:e:{for(var Be=ne.key,Je=Q;Je!==null;){if(Je.key===Be){if(Be=ne.type,Be===M){if(Je.tag===7){p(ee,Je.sibling),Q=C(Je,ne.props.children),Q.return=ee,ee=Q;break e}}else if(Je.elementType===Be||typeof Be=="object"&&Be!==null&&Be.$$typeof===z&&BS(Be)===Je.type){p(ee,Je.sibling),Q=C(Je,ne.props),Q.ref=tf(ee,Je,ne),Q.return=ee,ee=Q;break e}p(ee,Je);break}else c(ee,Je);Je=Je.sibling}ne.type===M?(Q=Ml(ne.props.children,ee.mode,Se,ne.key),Q.return=ee,ee=Q):(Se=a0(ne.type,ne.key,ne.props,null,ee.mode,Se),Se.ref=tf(ee,Q,ne),Se.return=ee,ee=Se)}return L(ee);case I:e:{for(Je=ne.key;Q!==null;){if(Q.key===Je)if(Q.tag===4&&Q.stateNode.containerInfo===ne.containerInfo&&Q.stateNode.implementation===ne.implementation){p(ee,Q.sibling),Q=C(Q,ne.children||[]),Q.return=ee,ee=Q;break e}else{p(ee,Q);break}else c(ee,Q);Q=Q.sibling}Q=ry(ne,ee.mode,Se),Q.return=ee,ee=Q}return L(ee);case z:return Je=ne._init,On(ee,Q,Je(ne._payload),Se)}if(qe(ne))return Fe(ee,Q,ne,Se);if(J(ne))return ze(ee,Q,ne,Se);jp(ee,ne)}return typeof ne=="string"&&ne!==""||typeof ne=="number"?(ne=""+ne,Q!==null&&Q.tag===6?(p(ee,Q.sibling),Q=C(Q,ne),Q.return=ee,ee=Q):(p(ee,Q),Q=ny(ne,ee.mode,Se),Q.return=ee,ee=Q),L(ee)):p(ee,Q)}return On}var tu=ZS(!0),WS=ZS(!1),$p=la(null),Fp=null,nu=null,f1=null;function h1(){f1=nu=Fp=null}function p1(a){var c=$p.current;on($p),a._currentValue=c}function m1(a,c,p){for(;a!==null;){var y=a.alternate;if((a.childLanes&c)!==c?(a.childLanes|=c,y!==null&&(y.childLanes|=c)):y!==null&&(y.childLanes&c)!==c&&(y.childLanes|=c),a===p)break;a=a.return}}function ru(a,c){Fp=a,f1=nu=null,a=a.dependencies,a!==null&&a.firstContext!==null&&((a.lanes&c)!==0&&(Kr=!0),a.firstContext=null)}function Fs(a){var c=a._currentValue;if(f1!==a)if(a={context:a,memoizedValue:c,next:null},nu===null){if(Fp===null)throw Error(n(308));nu=a,Fp.dependencies={lanes:0,firstContext:a}}else nu=nu.next=a;return c}var kl=null;function g1(a){kl===null?kl=[a]:kl.push(a)}function qS(a,c,p,y){var C=c.interleaved;return C===null?(p.next=p,g1(c)):(p.next=C.next,C.next=p),c.interleaved=p,go(a,y)}function go(a,c){a.lanes|=c;var p=a.alternate;for(p!==null&&(p.lanes|=c),p=a,a=a.return;a!==null;)a.childLanes|=c,p=a.alternate,p!==null&&(p.childLanes|=c),p=a,a=a.return;return p.tag===3?p.stateNode:null}var da=!1;function v1(a){a.updateQueue={baseState:a.memoizedState,firstBaseUpdate:null,lastBaseUpdate:null,shared:{pending:null,interleaved:null,lanes:0},effects:null}}function GS(a,c){a=a.updateQueue,c.updateQueue===a&&(c.updateQueue={baseState:a.baseState,firstBaseUpdate:a.firstBaseUpdate,lastBaseUpdate:a.lastBaseUpdate,shared:a.shared,effects:a.effects})}function vo(a,c){return{eventTime:a,lane:c,tag:0,payload:null,callback:null,next:null}}function fa(a,c,p){var y=a.updateQueue;if(y===null)return null;if(y=y.shared,(Rt&2)!==0){var C=y.pending;return C===null?c.next=c:(c.next=C.next,C.next=c),y.pending=c,go(a,p)}return C=y.interleaved,C===null?(c.next=c,g1(y)):(c.next=C.next,C.next=c),y.interleaved=c,go(a,p)}function Vp(a,c,p){if(c=c.updateQueue,c!==null&&(c=c.shared,(p&4194240)!==0)){var y=c.lanes;y&=a.pendingLanes,p|=y,c.lanes=p,Pi(a,p)}}function KS(a,c){var p=a.updateQueue,y=a.alternate;if(y!==null&&(y=y.updateQueue,p===y)){var C=null,A=null;if(p=p.firstBaseUpdate,p!==null){do{var L={eventTime:p.eventTime,lane:p.lane,tag:p.tag,payload:p.payload,callback:p.callback,next:null};A===null?C=A=L:A=A.next=L,p=p.next}while(p!==null);A===null?C=A=c:A=A.next=c}else C=A=c;p={baseState:y.baseState,firstBaseUpdate:C,lastBaseUpdate:A,shared:y.shared,effects:y.effects},a.updateQueue=p;return}a=p.lastBaseUpdate,a===null?p.firstBaseUpdate=c:a.next=c,p.lastBaseUpdate=c}function Hp(a,c,p,y){var C=a.updateQueue;da=!1;var A=C.firstBaseUpdate,L=C.lastBaseUpdate,U=C.shared.pending;if(U!==null){C.shared.pending=null;var G=U,oe=G.next;G.next=null,L===null?A=oe:L.next=oe,L=G;var ve=a.alternate;ve!==null&&(ve=ve.updateQueue,U=ve.lastBaseUpdate,U!==L&&(U===null?ve.firstBaseUpdate=oe:U.next=oe,ve.lastBaseUpdate=G))}if(A!==null){var _e=C.baseState;L=0,ve=oe=G=null,U=A;do{var pe=U.lane,Re=U.eventTime;if((y&pe)===pe){ve!==null&&(ve=ve.next={eventTime:Re,lane:0,tag:U.tag,payload:U.payload,callback:U.callback,next:null});e:{var Fe=a,ze=U;switch(pe=c,Re=p,ze.tag){case 1:if(Fe=ze.payload,typeof Fe=="function"){_e=Fe.call(Re,_e,pe);break e}_e=Fe;break e;case 3:Fe.flags=Fe.flags&-65537|128;case 0:if(Fe=ze.payload,pe=typeof Fe=="function"?Fe.call(Re,_e,pe):Fe,pe==null)break e;_e=H({},_e,pe);break e;case 2:da=!0}}U.callback!==null&&U.lane!==0&&(a.flags|=64,pe=C.effects,pe===null?C.effects=[U]:pe.push(U))}else Re={eventTime:Re,lane:pe,tag:U.tag,payload:U.payload,callback:U.callback,next:null},ve===null?(oe=ve=Re,G=_e):ve=ve.next=Re,L|=pe;if(U=U.next,U===null){if(U=C.shared.pending,U===null)break;pe=U,U=pe.next,pe.next=null,C.lastBaseUpdate=pe,C.shared.pending=null}}while(!0);if(ve===null&&(G=_e),C.baseState=G,C.firstBaseUpdate=oe,C.lastBaseUpdate=ve,c=C.shared.interleaved,c!==null){C=c;do L|=C.lane,C=C.next;while(C!==c)}else A===null&&(C.shared.lanes=0);Pl|=L,a.lanes=L,a.memoizedState=_e}}function YS(a,c,p){if(a=c.effects,c.effects=null,a!==null)for(c=0;c<a.length;c++){var y=a[c],C=y.callback;if(C!==null){if(y.callback=null,y=p,typeof C!="function")throw Error(n(191,C));C.call(y)}}}var nf={},Ti=la(nf),rf=la(nf),sf=la(nf);function Cl(a){if(a===nf)throw Error(n(174));return a}function y1(a,c){switch(en(sf,c),en(rf,a),en(Ti,nf),a=c.nodeType,a){case 9:case 11:c=(c=c.documentElement)?c.namespaceURI:Cn(null,"");break;default:a=a===8?c.parentNode:c,c=a.namespaceURI||null,a=a.tagName,c=Cn(c,a)}on(Ti),en(Ti,c)}function su(){on(Ti),on(rf),on(sf)}function QS(a){Cl(sf.current);var c=Cl(Ti.current),p=Cn(c,a.type);c!==p&&(en(rf,a),en(Ti,p))}function _1(a){rf.current===a&&(on(Ti),on(rf))}var vn=la(0);function zp(a){for(var c=a;c!==null;){if(c.tag===13){var p=c.memoizedState;if(p!==null&&(p=p.dehydrated,p===null||p.data==="$?"||p.data==="$!"))return c}else if(c.tag===19&&c.memoizedProps.revealOrder!==void 0){if((c.flags&128)!==0)return c}else if(c.child!==null){c.child.return=c,c=c.child;continue}if(c===a)break;for(;c.sibling===null;){if(c.return===null||c.return===a)return null;c=c.return}c.sibling.return=c.return,c=c.sibling}return null}var w1=[];function x1(){for(var a=0;a<w1.length;a++)w1[a]._workInProgressVersionPrimary=null;w1.length=0}var Up=P.ReactCurrentDispatcher,b1=P.ReactCurrentBatchConfig,El=0,yn=null,Gn=null,sr=null,Bp=!1,of=!1,af=0,A7=0;function kr(){throw Error(n(321))}function S1(a,c){if(c===null)return!1;for(var p=0;p<c.length&&p<a.length;p++)if(!ii(a[p],c[p]))return!1;return!0}function k1(a,c,p,y,C,A){if(El=A,yn=c,c.memoizedState=null,c.updateQueue=null,c.lanes=0,Up.current=a===null||a.memoizedState===null?I7:O7,a=p(y,C),of){A=0;do{if(of=!1,af=0,25<=A)throw Error(n(301));A+=1,sr=Gn=null,c.updateQueue=null,Up.current=L7,a=p(y,C)}while(of)}if(Up.current=qp,c=Gn!==null&&Gn.next!==null,El=0,sr=Gn=yn=null,Bp=!1,c)throw Error(n(300));return a}function C1(){var a=af!==0;return af=0,a}function Ri(){var a={memoizedState:null,baseState:null,baseQueue:null,queue:null,next:null};return sr===null?yn.memoizedState=sr=a:sr=sr.next=a,sr}function Vs(){if(Gn===null){var a=yn.alternate;a=a!==null?a.memoizedState:null}else a=Gn.next;var c=sr===null?yn.memoizedState:sr.next;if(c!==null)sr=c,Gn=a;else{if(a===null)throw Error(n(310));Gn=a,a={memoizedState:Gn.memoizedState,baseState:Gn.baseState,baseQueue:Gn.baseQueue,queue:Gn.queue,next:null},sr===null?yn.memoizedState=sr=a:sr=sr.next=a}return sr}function lf(a,c){return typeof c=="function"?c(a):c}function E1(a){var c=Vs(),p=c.queue;if(p===null)throw Error(n(311));p.lastRenderedReducer=a;var y=Gn,C=y.baseQueue,A=p.pending;if(A!==null){if(C!==null){var L=C.next;C.next=A.next,A.next=L}y.baseQueue=C=A,p.pending=null}if(C!==null){A=C.next,y=y.baseState;var U=L=null,G=null,oe=A;do{var ve=oe.lane;if((El&ve)===ve)G!==null&&(G=G.next={lane:0,action:oe.action,hasEagerState:oe.hasEagerState,eagerState:oe.eagerState,next:null}),y=oe.hasEagerState?oe.eagerState:a(y,oe.action);else{var _e={lane:ve,action:oe.action,hasEagerState:oe.hasEagerState,eagerState:oe.eagerState,next:null};G===null?(U=G=_e,L=y):G=G.next=_e,yn.lanes|=ve,Pl|=ve}oe=oe.next}while(oe!==null&&oe!==A);G===null?L=y:G.next=U,ii(y,c.memoizedState)||(Kr=!0),c.memoizedState=y,c.baseState=L,c.baseQueue=G,p.lastRenderedState=y}if(a=p.interleaved,a!==null){C=a;do A=C.lane,yn.lanes|=A,Pl|=A,C=C.next;while(C!==a)}else C===null&&(p.lanes=0);return[c.memoizedState,p.dispatch]}function P1(a){var c=Vs(),p=c.queue;if(p===null)throw Error(n(311));p.lastRenderedReducer=a;var y=p.dispatch,C=p.pending,A=c.memoizedState;if(C!==null){p.pending=null;var L=C=C.next;do A=a(A,L.action),L=L.next;while(L!==C);ii(A,c.memoizedState)||(Kr=!0),c.memoizedState=A,c.baseQueue===null&&(c.baseState=A),p.lastRenderedState=A}return[A,y]}function XS(){}function JS(a,c){var p=yn,y=Vs(),C=c(),A=!ii(y.memoizedState,C);if(A&&(y.memoizedState=C,Kr=!0),y=y.queue,A1(n4.bind(null,p,y,a),[a]),y.getSnapshot!==c||A||sr!==null&&sr.memoizedState.tag&1){if(p.flags|=2048,cf(9,t4.bind(null,p,y,C,c),void 0,null),ir===null)throw Error(n(349));(El&30)!==0||e4(p,c,C)}return C}function e4(a,c,p){a.flags|=16384,a={getSnapshot:c,value:p},c=yn.updateQueue,c===null?(c={lastEffect:null,stores:null},yn.updateQueue=c,c.stores=[a]):(p=c.stores,p===null?c.stores=[a]:p.push(a))}function t4(a,c,p,y){c.value=p,c.getSnapshot=y,r4(c)&&s4(a)}function n4(a,c,p){return p(function(){r4(c)&&s4(a)})}function r4(a){var c=a.getSnapshot;a=a.value;try{var p=c();return!ii(a,p)}catch{return!0}}function s4(a){var c=go(a,1);c!==null&&ui(c,a,1,-1)}function i4(a){var c=Ri();return typeof a=="function"&&(a=a()),c.memoizedState=c.baseState=a,a={pending:null,interleaved:null,lanes:0,dispatch:null,lastRenderedReducer:lf,lastRenderedState:a},c.queue=a,a=a.dispatch=M7.bind(null,yn,a),[c.memoizedState,a]}function cf(a,c,p,y){return a={tag:a,create:c,destroy:p,deps:y,next:null},c=yn.updateQueue,c===null?(c={lastEffect:null,stores:null},yn.updateQueue=c,c.lastEffect=a.next=a):(p=c.lastEffect,p===null?c.lastEffect=a.next=a:(y=p.next,p.next=a,a.next=y,c.lastEffect=a)),a}function o4(){return Vs().memoizedState}function Zp(a,c,p,y){var C=Ri();yn.flags|=a,C.memoizedState=cf(1|c,p,void 0,y===void 0?null:y)}function Wp(a,c,p,y){var C=Vs();y=y===void 0?null:y;var A=void 0;if(Gn!==null){var L=Gn.memoizedState;if(A=L.destroy,y!==null&&S1(y,L.deps)){C.memoizedState=cf(c,p,A,y);return}}yn.flags|=a,C.memoizedState=cf(1|c,p,A,y)}function a4(a,c){return Zp(8390656,8,a,c)}function A1(a,c){return Wp(2048,8,a,c)}function l4(a,c){return Wp(4,2,a,c)}function c4(a,c){return Wp(4,4,a,c)}function u4(a,c){if(typeof c=="function")return a=a(),c(a),function(){c(null)};if(c!=null)return a=a(),c.current=a,function(){c.current=null}}function d4(a,c,p){return p=p!=null?p.concat([a]):null,Wp(4,4,u4.bind(null,c,a),p)}function T1(){}function f4(a,c){var p=Vs();c=c===void 0?null:c;var y=p.memoizedState;return y!==null&&c!==null&&S1(c,y[1])?y[0]:(p.memoizedState=[a,c],a)}function h4(a,c){var p=Vs();c=c===void 0?null:c;var y=p.memoizedState;return y!==null&&c!==null&&S1(c,y[1])?y[0]:(a=a(),p.memoizedState=[a,c],a)}function p4(a,c,p){return(El&21)===0?(a.baseState&&(a.baseState=!1,Kr=!0),a.memoizedState=p):(ii(p,c)||(p=Fc(),yn.lanes|=p,Pl|=p,a.baseState=!0),c)}function T7(a,c){var p=Nt;Nt=p!==0&&4>p?p:4,a(!0);var y=b1.transition;b1.transition={};try{a(!1),c()}finally{Nt=p,b1.transition=y}}function m4(){return Vs().memoizedState}function R7(a,c,p){var y=ga(a);if(p={lane:y,action:p,hasEagerState:!1,eagerState:null,next:null},g4(a))v4(c,p);else if(p=qS(a,c,p,y),p!==null){var C=Nr();ui(p,a,y,C),y4(p,c,y)}}function M7(a,c,p){var y=ga(a),C={lane:y,action:p,hasEagerState:!1,eagerState:null,next:null};if(g4(a))v4(c,C);else{var A=a.alternate;if(a.lanes===0&&(A===null||A.lanes===0)&&(A=c.lastRenderedReducer,A!==null))try{var L=c.lastRenderedState,U=A(L,p);if(C.hasEagerState=!0,C.eagerState=U,ii(U,L)){var G=c.interleaved;G===null?(C.next=C,g1(c)):(C.next=G.next,G.next=C),c.interleaved=C;return}}catch{}finally{}p=qS(a,c,C,y),p!==null&&(C=Nr(),ui(p,a,y,C),y4(p,c,y))}}function g4(a){var c=a.alternate;return a===yn||c!==null&&c===yn}function v4(a,c){of=Bp=!0;var p=a.pending;p===null?c.next=c:(c.next=p.next,p.next=c),a.pending=c}function y4(a,c,p){if((p&4194240)!==0){var y=c.lanes;y&=a.pendingLanes,p|=y,c.lanes=p,Pi(a,p)}}var qp={readContext:Fs,useCallback:kr,useContext:kr,useEffect:kr,useImperativeHandle:kr,useInsertionEffect:kr,useLayoutEffect:kr,useMemo:kr,useReducer:kr,useRef:kr,useState:kr,useDebugValue:kr,useDeferredValue:kr,useTransition:kr,useMutableSource:kr,useSyncExternalStore:kr,useId:kr,unstable_isNewReconciler:!1},I7={readContext:Fs,useCallback:function(a,c){return Ri().memoizedState=[a,c===void 0?null:c],a},useContext:Fs,useEffect:a4,useImperativeHandle:function(a,c,p){return p=p!=null?p.concat([a]):null,Zp(4194308,4,u4.bind(null,c,a),p)},useLayoutEffect:function(a,c){return Zp(4194308,4,a,c)},useInsertionEffect:function(a,c){return Zp(4,2,a,c)},useMemo:function(a,c){var p=Ri();return c=c===void 0?null:c,a=a(),p.memoizedState=[a,c],a},useReducer:function(a,c,p){var y=Ri();return c=p!==void 0?p(c):c,y.memoizedState=y.baseState=c,a={pending:null,interleaved:null,lanes:0,dispatch:null,lastRenderedReducer:a,lastRenderedState:c},y.queue=a,a=a.dispatch=R7.bind(null,yn,a),[y.memoizedState,a]},useRef:function(a){var c=Ri();return a={current:a},c.memoizedState=a},useState:i4,useDebugValue:T1,useDeferredValue:function(a){return Ri().memoizedState=a},useTransition:function(){var a=i4(!1),c=a[0];return a=T7.bind(null,a[1]),Ri().memoizedState=a,[c,a]},useMutableSource:function(){},useSyncExternalStore:function(a,c,p){var y=yn,C=Ri();if(un){if(p===void 0)throw Error(n(407));p=p()}else{if(p=c(),ir===null)throw Error(n(349));(El&30)!==0||e4(y,c,p)}C.memoizedState=p;var A={value:p,getSnapshot:c};return C.queue=A,a4(n4.bind(null,y,A,a),[a]),y.flags|=2048,cf(9,t4.bind(null,y,A,p,c),void 0,null),p},useId:function(){var a=Ri(),c=ir.identifierPrefix;if(un){var p=mo,y=po;p=(y&~(1<<32-Or(y)-1)).toString(32)+p,c=":"+c+"R"+p,p=af++,0<p&&(c+="H"+p.toString(32)),c+=":"}else p=A7++,c=":"+c+"r"+p.toString(32)+":";return a.memoizedState=c},unstable_isNewReconciler:!1},O7={readContext:Fs,useCallback:f4,useContext:Fs,useEffect:A1,useImperativeHandle:d4,useInsertionEffect:l4,useLayoutEffect:c4,useMemo:h4,useReducer:E1,useRef:o4,useState:function(){return E1(lf)},useDebugValue:T1,useDeferredValue:function(a){var c=Vs();return p4(c,Gn.memoizedState,a)},useTransition:function(){var a=E1(lf)[0],c=Vs().memoizedState;return[a,c]},useMutableSource:XS,useSyncExternalStore:JS,useId:m4,unstable_isNewReconciler:!1},L7={readContext:Fs,useCallback:f4,useContext:Fs,useEffect:A1,useImperativeHandle:d4,useInsertionEffect:l4,useLayoutEffect:c4,useMemo:h4,useReducer:P1,useRef:o4,useState:function(){return P1(lf)},useDebugValue:T1,useDeferredValue:function(a){var c=Vs();return Gn===null?c.memoizedState=a:p4(c,Gn.memoizedState,a)},useTransition:function(){var a=P1(lf)[0],c=Vs().memoizedState;return[a,c]},useMutableSource:XS,useSyncExternalStore:JS,useId:m4,unstable_isNewReconciler:!1};function ai(a,c){if(a&&a.defaultProps){c=H({},c),a=a.defaultProps;for(var p in a)c[p]===void 0&&(c[p]=a[p]);return c}return c}function R1(a,c,p,y){c=a.memoizedState,p=p(y,c),p=p==null?c:H({},c,p),a.memoizedState=p,a.lanes===0&&(a.updateQueue.baseState=p)}var Gp={isMounted:function(a){return(a=a._reactInternals)?Ei(a)===a:!1},enqueueSetState:function(a,c,p){a=a._reactInternals;var y=Nr(),C=ga(a),A=vo(y,C);A.payload=c,p!=null&&(A.callback=p),c=fa(a,A,C),c!==null&&(ui(c,a,C,y),Vp(c,a,C))},enqueueReplaceState:function(a,c,p){a=a._reactInternals;var y=Nr(),C=ga(a),A=vo(y,C);A.tag=1,A.payload=c,p!=null&&(A.callback=p),c=fa(a,A,C),c!==null&&(ui(c,a,C,y),Vp(c,a,C))},enqueueForceUpdate:function(a,c){a=a._reactInternals;var p=Nr(),y=ga(a),C=vo(p,y);C.tag=2,c!=null&&(C.callback=c),c=fa(a,C,y),c!==null&&(ui(c,a,y,p),Vp(c,a,y))}};function _4(a,c,p,y,C,A,L){return a=a.stateNode,typeof a.shouldComponentUpdate=="function"?a.shouldComponentUpdate(y,A,L):c.prototype&&c.prototype.isPureReactComponent?!Gd(p,y)||!Gd(C,A):!0}function w4(a,c,p){var y=!1,C=ca,A=c.contextType;return typeof A=="object"&&A!==null?A=Fs(A):(C=Gr(c)?xl:Sr.current,y=c.contextTypes,A=(y=y!=null)?Qc(a,C):ca),c=new c(p,A),a.memoizedState=c.state!==null&&c.state!==void 0?c.state:null,c.updater=Gp,a.stateNode=c,c._reactInternals=a,y&&(a=a.stateNode,a.__reactInternalMemoizedUnmaskedChildContext=C,a.__reactInternalMemoizedMaskedChildContext=A),c}function x4(a,c,p,y){a=c.state,typeof c.componentWillReceiveProps=="function"&&c.componentWillReceiveProps(p,y),typeof c.UNSAFE_componentWillReceiveProps=="function"&&c.UNSAFE_componentWillReceiveProps(p,y),c.state!==a&&Gp.enqueueReplaceState(c,c.state,null)}function M1(a,c,p,y){var C=a.stateNode;C.props=p,C.state=a.memoizedState,C.refs={},v1(a);var A=c.contextType;typeof A=="object"&&A!==null?C.context=Fs(A):(A=Gr(c)?xl:Sr.current,C.context=Qc(a,A)),C.state=a.memoizedState,A=c.getDerivedStateFromProps,typeof A=="function"&&(R1(a,c,A,p),C.state=a.memoizedState),typeof c.getDerivedStateFromProps=="function"||typeof C.getSnapshotBeforeUpdate=="function"||typeof C.UNSAFE_componentWillMount!="function"&&typeof C.componentWillMount!="function"||(c=C.state,typeof C.componentWillMount=="function"&&C.componentWillMount(),typeof C.UNSAFE_componentWillMount=="function"&&C.UNSAFE_componentWillMount(),c!==C.state&&Gp.enqueueReplaceState(C,C.state,null),Hp(a,p,C,y),C.state=a.memoizedState),typeof C.componentDidMount=="function"&&(a.flags|=4194308)}function iu(a,c){try{var p="",y=c;do p+=ie(y),y=y.return;while(y);var C=p}catch(A){C=`
|
|
41
|
+
Error generating stack: `+A.message+`
|
|
42
|
+
`+A.stack}return{value:a,source:c,stack:C,digest:null}}function I1(a,c,p){return{value:a,source:null,stack:p??null,digest:c??null}}function O1(a,c){try{console.error(c.value)}catch(p){setTimeout(function(){throw p})}}var N7=typeof WeakMap=="function"?WeakMap:Map;function b4(a,c,p){p=vo(-1,p),p.tag=3,p.payload={element:null};var y=c.value;return p.callback=function(){t0||(t0=!0,G1=y),O1(a,c)},p}function S4(a,c,p){p=vo(-1,p),p.tag=3;var y=a.type.getDerivedStateFromError;if(typeof y=="function"){var C=c.value;p.payload=function(){return y(C)},p.callback=function(){O1(a,c)}}var A=a.stateNode;return A!==null&&typeof A.componentDidCatch=="function"&&(p.callback=function(){O1(a,c),typeof y!="function"&&(pa===null?pa=new Set([this]):pa.add(this));var L=c.stack;this.componentDidCatch(c.value,{componentStack:L!==null?L:""})}),p}function k4(a,c,p){var y=a.pingCache;if(y===null){y=a.pingCache=new N7;var C=new Set;y.set(c,C)}else C=y.get(c),C===void 0&&(C=new Set,y.set(c,C));C.has(p)||(C.add(p),a=K7.bind(null,a,c,p),c.then(a,a))}function C4(a){do{var c;if((c=a.tag===13)&&(c=a.memoizedState,c=c!==null?c.dehydrated!==null:!0),c)return a;a=a.return}while(a!==null);return null}function E4(a,c,p,y,C){return(a.mode&1)===0?(a===c?a.flags|=65536:(a.flags|=128,p.flags|=131072,p.flags&=-52805,p.tag===1&&(p.alternate===null?p.tag=17:(c=vo(-1,1),c.tag=2,fa(p,c,1))),p.lanes|=1),a):(a.flags|=65536,a.lanes=C,a)}var D7=P.ReactCurrentOwner,Kr=!1;function Lr(a,c,p,y){c.child=a===null?WS(c,null,p,y):tu(c,a.child,p,y)}function P4(a,c,p,y,C){p=p.render;var A=c.ref;return ru(c,C),y=k1(a,c,p,y,A,C),p=C1(),a!==null&&!Kr?(c.updateQueue=a.updateQueue,c.flags&=-2053,a.lanes&=~C,yo(a,c,C)):(un&&p&&a1(c),c.flags|=1,Lr(a,c,y,C),c.child)}function A4(a,c,p,y,C){if(a===null){var A=p.type;return typeof A=="function"&&!ty(A)&&A.defaultProps===void 0&&p.compare===null&&p.defaultProps===void 0?(c.tag=15,c.type=A,T4(a,c,A,y,C)):(a=a0(p.type,null,y,c,c.mode,C),a.ref=c.ref,a.return=c,c.child=a)}if(A=a.child,(a.lanes&C)===0){var L=A.memoizedProps;if(p=p.compare,p=p!==null?p:Gd,p(L,y)&&a.ref===c.ref)return yo(a,c,C)}return c.flags|=1,a=ya(A,y),a.ref=c.ref,a.return=c,c.child=a}function T4(a,c,p,y,C){if(a!==null){var A=a.memoizedProps;if(Gd(A,y)&&a.ref===c.ref)if(Kr=!1,c.pendingProps=y=A,(a.lanes&C)!==0)(a.flags&131072)!==0&&(Kr=!0);else return c.lanes=a.lanes,yo(a,c,C)}return L1(a,c,p,y,C)}function R4(a,c,p){var y=c.pendingProps,C=y.children,A=a!==null?a.memoizedState:null;if(y.mode==="hidden")if((c.mode&1)===0)c.memoizedState={baseLanes:0,cachePool:null,transitions:null},en(au,vs),vs|=p;else{if((p&1073741824)===0)return a=A!==null?A.baseLanes|p:p,c.lanes=c.childLanes=1073741824,c.memoizedState={baseLanes:a,cachePool:null,transitions:null},c.updateQueue=null,en(au,vs),vs|=a,null;c.memoizedState={baseLanes:0,cachePool:null,transitions:null},y=A!==null?A.baseLanes:p,en(au,vs),vs|=y}else A!==null?(y=A.baseLanes|p,c.memoizedState=null):y=p,en(au,vs),vs|=y;return Lr(a,c,C,p),c.child}function M4(a,c){var p=c.ref;(a===null&&p!==null||a!==null&&a.ref!==p)&&(c.flags|=512,c.flags|=2097152)}function L1(a,c,p,y,C){var A=Gr(p)?xl:Sr.current;return A=Qc(c,A),ru(c,C),p=k1(a,c,p,y,A,C),y=C1(),a!==null&&!Kr?(c.updateQueue=a.updateQueue,c.flags&=-2053,a.lanes&=~C,yo(a,c,C)):(un&&y&&a1(c),c.flags|=1,Lr(a,c,p,C),c.child)}function I4(a,c,p,y,C){if(Gr(p)){var A=!0;Ip(c)}else A=!1;if(ru(c,C),c.stateNode===null)Yp(a,c),w4(c,p,y),M1(c,p,y,C),y=!0;else if(a===null){var L=c.stateNode,U=c.memoizedProps;L.props=U;var G=L.context,oe=p.contextType;typeof oe=="object"&&oe!==null?oe=Fs(oe):(oe=Gr(p)?xl:Sr.current,oe=Qc(c,oe));var ve=p.getDerivedStateFromProps,_e=typeof ve=="function"||typeof L.getSnapshotBeforeUpdate=="function";_e||typeof L.UNSAFE_componentWillReceiveProps!="function"&&typeof L.componentWillReceiveProps!="function"||(U!==y||G!==oe)&&x4(c,L,y,oe),da=!1;var pe=c.memoizedState;L.state=pe,Hp(c,y,L,C),G=c.memoizedState,U!==y||pe!==G||qr.current||da?(typeof ve=="function"&&(R1(c,p,ve,y),G=c.memoizedState),(U=da||_4(c,p,U,y,pe,G,oe))?(_e||typeof L.UNSAFE_componentWillMount!="function"&&typeof L.componentWillMount!="function"||(typeof L.componentWillMount=="function"&&L.componentWillMount(),typeof L.UNSAFE_componentWillMount=="function"&&L.UNSAFE_componentWillMount()),typeof L.componentDidMount=="function"&&(c.flags|=4194308)):(typeof L.componentDidMount=="function"&&(c.flags|=4194308),c.memoizedProps=y,c.memoizedState=G),L.props=y,L.state=G,L.context=oe,y=U):(typeof L.componentDidMount=="function"&&(c.flags|=4194308),y=!1)}else{L=c.stateNode,GS(a,c),U=c.memoizedProps,oe=c.type===c.elementType?U:ai(c.type,U),L.props=oe,_e=c.pendingProps,pe=L.context,G=p.contextType,typeof G=="object"&&G!==null?G=Fs(G):(G=Gr(p)?xl:Sr.current,G=Qc(c,G));var Re=p.getDerivedStateFromProps;(ve=typeof Re=="function"||typeof L.getSnapshotBeforeUpdate=="function")||typeof L.UNSAFE_componentWillReceiveProps!="function"&&typeof L.componentWillReceiveProps!="function"||(U!==_e||pe!==G)&&x4(c,L,y,G),da=!1,pe=c.memoizedState,L.state=pe,Hp(c,y,L,C);var Fe=c.memoizedState;U!==_e||pe!==Fe||qr.current||da?(typeof Re=="function"&&(R1(c,p,Re,y),Fe=c.memoizedState),(oe=da||_4(c,p,oe,y,pe,Fe,G)||!1)?(ve||typeof L.UNSAFE_componentWillUpdate!="function"&&typeof L.componentWillUpdate!="function"||(typeof L.componentWillUpdate=="function"&&L.componentWillUpdate(y,Fe,G),typeof L.UNSAFE_componentWillUpdate=="function"&&L.UNSAFE_componentWillUpdate(y,Fe,G)),typeof L.componentDidUpdate=="function"&&(c.flags|=4),typeof L.getSnapshotBeforeUpdate=="function"&&(c.flags|=1024)):(typeof L.componentDidUpdate!="function"||U===a.memoizedProps&&pe===a.memoizedState||(c.flags|=4),typeof L.getSnapshotBeforeUpdate!="function"||U===a.memoizedProps&&pe===a.memoizedState||(c.flags|=1024),c.memoizedProps=y,c.memoizedState=Fe),L.props=y,L.state=Fe,L.context=G,y=oe):(typeof L.componentDidUpdate!="function"||U===a.memoizedProps&&pe===a.memoizedState||(c.flags|=4),typeof L.getSnapshotBeforeUpdate!="function"||U===a.memoizedProps&&pe===a.memoizedState||(c.flags|=1024),y=!1)}return N1(a,c,p,y,A,C)}function N1(a,c,p,y,C,A){M4(a,c);var L=(c.flags&128)!==0;if(!y&&!L)return C&&jS(c,p,!1),yo(a,c,A);y=c.stateNode,D7.current=c;var U=L&&typeof p.getDerivedStateFromError!="function"?null:y.render();return c.flags|=1,a!==null&&L?(c.child=tu(c,a.child,null,A),c.child=tu(c,null,U,A)):Lr(a,c,U,A),c.memoizedState=y.state,C&&jS(c,p,!0),c.child}function O4(a){var c=a.stateNode;c.pendingContext?NS(a,c.pendingContext,c.pendingContext!==c.context):c.context&&NS(a,c.context,!1),y1(a,c.containerInfo)}function L4(a,c,p,y,C){return eu(),d1(C),c.flags|=256,Lr(a,c,p,y),c.child}var D1={dehydrated:null,treeContext:null,retryLane:0};function j1(a){return{baseLanes:a,cachePool:null,transitions:null}}function N4(a,c,p){var y=c.pendingProps,C=vn.current,A=!1,L=(c.flags&128)!==0,U;if((U=L)||(U=a!==null&&a.memoizedState===null?!1:(C&2)!==0),U?(A=!0,c.flags&=-129):(a===null||a.memoizedState!==null)&&(C|=1),en(vn,C&1),a===null)return u1(c),a=c.memoizedState,a!==null&&(a=a.dehydrated,a!==null)?((c.mode&1)===0?c.lanes=1:a.data==="$!"?c.lanes=8:c.lanes=1073741824,null):(L=y.children,a=y.fallback,A?(y=c.mode,A=c.child,L={mode:"hidden",children:L},(y&1)===0&&A!==null?(A.childLanes=0,A.pendingProps=L):A=l0(L,y,0,null),a=Ml(a,y,p,null),A.return=c,a.return=c,A.sibling=a,c.child=A,c.child.memoizedState=j1(p),c.memoizedState=D1,a):$1(c,L));if(C=a.memoizedState,C!==null&&(U=C.dehydrated,U!==null))return j7(a,c,L,y,U,C,p);if(A){A=y.fallback,L=c.mode,C=a.child,U=C.sibling;var G={mode:"hidden",children:y.children};return(L&1)===0&&c.child!==C?(y=c.child,y.childLanes=0,y.pendingProps=G,c.deletions=null):(y=ya(C,G),y.subtreeFlags=C.subtreeFlags&14680064),U!==null?A=ya(U,A):(A=Ml(A,L,p,null),A.flags|=2),A.return=c,y.return=c,y.sibling=A,c.child=y,y=A,A=c.child,L=a.child.memoizedState,L=L===null?j1(p):{baseLanes:L.baseLanes|p,cachePool:null,transitions:L.transitions},A.memoizedState=L,A.childLanes=a.childLanes&~p,c.memoizedState=D1,y}return A=a.child,a=A.sibling,y=ya(A,{mode:"visible",children:y.children}),(c.mode&1)===0&&(y.lanes=p),y.return=c,y.sibling=null,a!==null&&(p=c.deletions,p===null?(c.deletions=[a],c.flags|=16):p.push(a)),c.child=y,c.memoizedState=null,y}function $1(a,c){return c=l0({mode:"visible",children:c},a.mode,0,null),c.return=a,a.child=c}function Kp(a,c,p,y){return y!==null&&d1(y),tu(c,a.child,null,p),a=$1(c,c.pendingProps.children),a.flags|=2,c.memoizedState=null,a}function j7(a,c,p,y,C,A,L){if(p)return c.flags&256?(c.flags&=-257,y=I1(Error(n(422))),Kp(a,c,L,y)):c.memoizedState!==null?(c.child=a.child,c.flags|=128,null):(A=y.fallback,C=c.mode,y=l0({mode:"visible",children:y.children},C,0,null),A=Ml(A,C,L,null),A.flags|=2,y.return=c,A.return=c,y.sibling=A,c.child=y,(c.mode&1)!==0&&tu(c,a.child,null,L),c.child.memoizedState=j1(L),c.memoizedState=D1,A);if((c.mode&1)===0)return Kp(a,c,L,null);if(C.data==="$!"){if(y=C.nextSibling&&C.nextSibling.dataset,y)var U=y.dgst;return y=U,A=Error(n(419)),y=I1(A,y,void 0),Kp(a,c,L,y)}if(U=(L&a.childLanes)!==0,Kr||U){if(y=ir,y!==null){switch(L&-L){case 4:C=2;break;case 16:C=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:C=32;break;case 536870912:C=268435456;break;default:C=0}C=(C&(y.suspendedLanes|L))!==0?0:C,C!==0&&C!==A.retryLane&&(A.retryLane=C,go(a,C),ui(y,a,C,-1))}return ey(),y=I1(Error(n(421))),Kp(a,c,L,y)}return C.data==="$?"?(c.flags|=128,c.child=a.child,c=Y7.bind(null,a),C._reactRetry=c,null):(a=A.treeContext,gs=aa(C.nextSibling),ms=c,un=!0,oi=null,a!==null&&(js[$s++]=po,js[$s++]=mo,js[$s++]=bl,po=a.id,mo=a.overflow,bl=c),c=$1(c,y.children),c.flags|=4096,c)}function D4(a,c,p){a.lanes|=c;var y=a.alternate;y!==null&&(y.lanes|=c),m1(a.return,c,p)}function F1(a,c,p,y,C){var A=a.memoizedState;A===null?a.memoizedState={isBackwards:c,rendering:null,renderingStartTime:0,last:y,tail:p,tailMode:C}:(A.isBackwards=c,A.rendering=null,A.renderingStartTime=0,A.last=y,A.tail=p,A.tailMode=C)}function j4(a,c,p){var y=c.pendingProps,C=y.revealOrder,A=y.tail;if(Lr(a,c,y.children,p),y=vn.current,(y&2)!==0)y=y&1|2,c.flags|=128;else{if(a!==null&&(a.flags&128)!==0)e:for(a=c.child;a!==null;){if(a.tag===13)a.memoizedState!==null&&D4(a,p,c);else if(a.tag===19)D4(a,p,c);else if(a.child!==null){a.child.return=a,a=a.child;continue}if(a===c)break e;for(;a.sibling===null;){if(a.return===null||a.return===c)break e;a=a.return}a.sibling.return=a.return,a=a.sibling}y&=1}if(en(vn,y),(c.mode&1)===0)c.memoizedState=null;else switch(C){case"forwards":for(p=c.child,C=null;p!==null;)a=p.alternate,a!==null&&zp(a)===null&&(C=p),p=p.sibling;p=C,p===null?(C=c.child,c.child=null):(C=p.sibling,p.sibling=null),F1(c,!1,C,p,A);break;case"backwards":for(p=null,C=c.child,c.child=null;C!==null;){if(a=C.alternate,a!==null&&zp(a)===null){c.child=C;break}a=C.sibling,C.sibling=p,p=C,C=a}F1(c,!0,p,null,A);break;case"together":F1(c,!1,null,null,void 0);break;default:c.memoizedState=null}return c.child}function Yp(a,c){(c.mode&1)===0&&a!==null&&(a.alternate=null,c.alternate=null,c.flags|=2)}function yo(a,c,p){if(a!==null&&(c.dependencies=a.dependencies),Pl|=c.lanes,(p&c.childLanes)===0)return null;if(a!==null&&c.child!==a.child)throw Error(n(153));if(c.child!==null){for(a=c.child,p=ya(a,a.pendingProps),c.child=p,p.return=c;a.sibling!==null;)a=a.sibling,p=p.sibling=ya(a,a.pendingProps),p.return=c;p.sibling=null}return c.child}function $7(a,c,p){switch(c.tag){case 3:O4(c),eu();break;case 5:QS(c);break;case 1:Gr(c.type)&&Ip(c);break;case 4:y1(c,c.stateNode.containerInfo);break;case 10:var y=c.type._context,C=c.memoizedProps.value;en($p,y._currentValue),y._currentValue=C;break;case 13:if(y=c.memoizedState,y!==null)return y.dehydrated!==null?(en(vn,vn.current&1),c.flags|=128,null):(p&c.child.childLanes)!==0?N4(a,c,p):(en(vn,vn.current&1),a=yo(a,c,p),a!==null?a.sibling:null);en(vn,vn.current&1);break;case 19:if(y=(p&c.childLanes)!==0,(a.flags&128)!==0){if(y)return j4(a,c,p);c.flags|=128}if(C=c.memoizedState,C!==null&&(C.rendering=null,C.tail=null,C.lastEffect=null),en(vn,vn.current),y)break;return null;case 22:case 23:return c.lanes=0,R4(a,c,p)}return yo(a,c,p)}var $4,V1,F4,V4;$4=function(a,c){for(var p=c.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===c)break;for(;p.sibling===null;){if(p.return===null||p.return===c)return;p=p.return}p.sibling.return=p.return,p=p.sibling}},V1=function(){},F4=function(a,c,p,y){var C=a.memoizedProps;if(C!==y){a=c.stateNode,Cl(Ti.current);var A=null;switch(p){case"input":C=Tt(a,C),y=Tt(a,y),A=[];break;case"select":C=H({},C,{value:void 0}),y=H({},y,{value:void 0}),A=[];break;case"textarea":C=rt(a,C),y=rt(a,y),A=[];break;default:typeof C.onClick!="function"&&typeof y.onClick=="function"&&(a.onclick=Tp)}Os(p,y);var L;p=null;for(oe in C)if(!y.hasOwnProperty(oe)&&C.hasOwnProperty(oe)&&C[oe]!=null)if(oe==="style"){var U=C[oe];for(L in U)U.hasOwnProperty(L)&&(p||(p={}),p[L]="")}else oe!=="dangerouslySetInnerHTML"&&oe!=="children"&&oe!=="suppressContentEditableWarning"&&oe!=="suppressHydrationWarning"&&oe!=="autoFocus"&&(s.hasOwnProperty(oe)?A||(A=[]):(A=A||[]).push(oe,null));for(oe in y){var G=y[oe];if(U=C!=null?C[oe]:void 0,y.hasOwnProperty(oe)&&G!==U&&(G!=null||U!=null))if(oe==="style")if(U){for(L in U)!U.hasOwnProperty(L)||G&&G.hasOwnProperty(L)||(p||(p={}),p[L]="");for(L in G)G.hasOwnProperty(L)&&U[L]!==G[L]&&(p||(p={}),p[L]=G[L])}else p||(A||(A=[]),A.push(oe,p)),p=G;else oe==="dangerouslySetInnerHTML"?(G=G?G.__html:void 0,U=U?U.__html:void 0,G!=null&&U!==G&&(A=A||[]).push(oe,G)):oe==="children"?typeof G!="string"&&typeof G!="number"||(A=A||[]).push(oe,""+G):oe!=="suppressContentEditableWarning"&&oe!=="suppressHydrationWarning"&&(s.hasOwnProperty(oe)?(G!=null&&oe==="onScroll"&&sn("scroll",a),A||U===G||(A=[])):(A=A||[]).push(oe,G))}p&&(A=A||[]).push("style",p);var oe=A;(c.updateQueue=oe)&&(c.flags|=4)}},V4=function(a,c,p,y){p!==y&&(c.flags|=4)};function uf(a,c){if(!un)switch(a.tailMode){case"hidden":c=a.tail;for(var p=null;c!==null;)c.alternate!==null&&(p=c),c=c.sibling;p===null?a.tail=null:p.sibling=null;break;case"collapsed":p=a.tail;for(var y=null;p!==null;)p.alternate!==null&&(y=p),p=p.sibling;y===null?c||a.tail===null?a.tail=null:a.tail.sibling=null:y.sibling=null}}function Cr(a){var c=a.alternate!==null&&a.alternate.child===a.child,p=0,y=0;if(c)for(var C=a.child;C!==null;)p|=C.lanes|C.childLanes,y|=C.subtreeFlags&14680064,y|=C.flags&14680064,C.return=a,C=C.sibling;else for(C=a.child;C!==null;)p|=C.lanes|C.childLanes,y|=C.subtreeFlags,y|=C.flags,C.return=a,C=C.sibling;return a.subtreeFlags|=y,a.childLanes=p,c}function F7(a,c,p){var y=c.pendingProps;switch(l1(c),c.tag){case 2:case 16:case 15:case 0:case 11:case 7:case 8:case 12:case 9:case 14:return Cr(c),null;case 1:return Gr(c.type)&&Mp(),Cr(c),null;case 3:return y=c.stateNode,su(),on(qr),on(Sr),x1(),y.pendingContext&&(y.context=y.pendingContext,y.pendingContext=null),(a===null||a.child===null)&&(Dp(c)?c.flags|=4:a===null||a.memoizedState.isDehydrated&&(c.flags&256)===0||(c.flags|=1024,oi!==null&&(Q1(oi),oi=null))),V1(a,c),Cr(c),null;case 5:_1(c);var C=Cl(sf.current);if(p=c.type,a!==null&&c.stateNode!=null)F4(a,c,p,y,C),a.ref!==c.ref&&(c.flags|=512,c.flags|=2097152);else{if(!y){if(c.stateNode===null)throw Error(n(166));return Cr(c),null}if(a=Cl(Ti.current),Dp(c)){y=c.stateNode,p=c.type;var A=c.memoizedProps;switch(y[Ai]=c,y[Jd]=A,a=(c.mode&1)!==0,p){case"dialog":sn("cancel",y),sn("close",y);break;case"iframe":case"object":case"embed":sn("load",y);break;case"video":case"audio":for(C=0;C<Yd.length;C++)sn(Yd[C],y);break;case"source":sn("error",y);break;case"img":case"image":case"link":sn("error",y),sn("load",y);break;case"details":sn("toggle",y);break;case"input":rn(y,A),sn("invalid",y);break;case"select":y._wrapperState={wasMultiple:!!A.multiple},sn("invalid",y);break;case"textarea":Et(y,A),sn("invalid",y)}Os(p,A),C=null;for(var L in A)if(A.hasOwnProperty(L)){var U=A[L];L==="children"?typeof U=="string"?y.textContent!==U&&(A.suppressHydrationWarning!==!0&&Ap(y.textContent,U,a),C=["children",U]):typeof U=="number"&&y.textContent!==""+U&&(A.suppressHydrationWarning!==!0&&Ap(y.textContent,U,a),C=["children",""+U]):s.hasOwnProperty(L)&&U!=null&&L==="onScroll"&&sn("scroll",y)}switch(p){case"input":$e(y),Xt(y,A,!0);break;case"textarea":$e(y),yt(y);break;case"select":case"option":break;default:typeof A.onClick=="function"&&(y.onclick=Tp)}y=C,c.updateQueue=y,y!==null&&(c.flags|=4)}else{L=C.nodeType===9?C:C.ownerDocument,a==="http://www.w3.org/1999/xhtml"&&(a=Dn(p)),a==="http://www.w3.org/1999/xhtml"?p==="script"?(a=L.createElement("div"),a.innerHTML="<script><\/script>",a=a.removeChild(a.firstChild)):typeof y.is=="string"?a=L.createElement(p,{is:y.is}):(a=L.createElement(p),p==="select"&&(L=a,y.multiple?L.multiple=!0:y.size&&(L.size=y.size))):a=L.createElementNS(a,p),a[Ai]=c,a[Jd]=y,$4(a,c,!1,!1),c.stateNode=a;e:{switch(L=wr(p,y),p){case"dialog":sn("cancel",a),sn("close",a),C=y;break;case"iframe":case"object":case"embed":sn("load",a),C=y;break;case"video":case"audio":for(C=0;C<Yd.length;C++)sn(Yd[C],a);C=y;break;case"source":sn("error",a),C=y;break;case"img":case"image":case"link":sn("error",a),sn("load",a),C=y;break;case"details":sn("toggle",a),C=y;break;case"input":rn(a,y),C=Tt(a,y),sn("invalid",a);break;case"option":C=y;break;case"select":a._wrapperState={wasMultiple:!!y.multiple},C=H({},y,{value:void 0}),sn("invalid",a);break;case"textarea":Et(a,y),C=rt(a,y),sn("invalid",a);break;default:C=y}Os(p,C),U=C;for(A in U)if(U.hasOwnProperty(A)){var G=U[A];A==="style"?mn(a,G):A==="dangerouslySetInnerHTML"?(G=G?G.__html:void 0,G!=null&&ea(a,G)):A==="children"?typeof G=="string"?(p!=="textarea"||G!=="")&&jn(a,G):typeof G=="number"&&jn(a,""+G):A!=="suppressContentEditableWarning"&&A!=="suppressHydrationWarning"&&A!=="autoFocus"&&(s.hasOwnProperty(A)?G!=null&&A==="onScroll"&&sn("scroll",a):G!=null&&E(a,A,G,L))}switch(p){case"input":$e(a),Xt(a,y,!1);break;case"textarea":$e(a),yt(a);break;case"option":y.value!=null&&a.setAttribute("value",""+ue(y.value));break;case"select":a.multiple=!!y.multiple,A=y.value,A!=null?ke(a,!!y.multiple,A,!1):y.defaultValue!=null&&ke(a,!!y.multiple,y.defaultValue,!0);break;default:typeof C.onClick=="function"&&(a.onclick=Tp)}switch(p){case"button":case"input":case"select":case"textarea":y=!!y.autoFocus;break e;case"img":y=!0;break e;default:y=!1}}y&&(c.flags|=4)}c.ref!==null&&(c.flags|=512,c.flags|=2097152)}return Cr(c),null;case 6:if(a&&c.stateNode!=null)V4(a,c,a.memoizedProps,y);else{if(typeof y!="string"&&c.stateNode===null)throw Error(n(166));if(p=Cl(sf.current),Cl(Ti.current),Dp(c)){if(y=c.stateNode,p=c.memoizedProps,y[Ai]=c,(A=y.nodeValue!==p)&&(a=ms,a!==null))switch(a.tag){case 3:Ap(y.nodeValue,p,(a.mode&1)!==0);break;case 5:a.memoizedProps.suppressHydrationWarning!==!0&&Ap(y.nodeValue,p,(a.mode&1)!==0)}A&&(c.flags|=4)}else y=(p.nodeType===9?p:p.ownerDocument).createTextNode(y),y[Ai]=c,c.stateNode=y}return Cr(c),null;case 13:if(on(vn),y=c.memoizedState,a===null||a.memoizedState!==null&&a.memoizedState.dehydrated!==null){if(un&&gs!==null&&(c.mode&1)!==0&&(c.flags&128)===0)US(),eu(),c.flags|=98560,A=!1;else if(A=Dp(c),y!==null&&y.dehydrated!==null){if(a===null){if(!A)throw Error(n(318));if(A=c.memoizedState,A=A!==null?A.dehydrated:null,!A)throw Error(n(317));A[Ai]=c}else eu(),(c.flags&128)===0&&(c.memoizedState=null),c.flags|=4;Cr(c),A=!1}else oi!==null&&(Q1(oi),oi=null),A=!0;if(!A)return c.flags&65536?c:null}return(c.flags&128)!==0?(c.lanes=p,c):(y=y!==null,y!==(a!==null&&a.memoizedState!==null)&&y&&(c.child.flags|=8192,(c.mode&1)!==0&&(a===null||(vn.current&1)!==0?Kn===0&&(Kn=3):ey())),c.updateQueue!==null&&(c.flags|=4),Cr(c),null);case 4:return su(),V1(a,c),a===null&&Qd(c.stateNode.containerInfo),Cr(c),null;case 10:return p1(c.type._context),Cr(c),null;case 17:return Gr(c.type)&&Mp(),Cr(c),null;case 19:if(on(vn),A=c.memoizedState,A===null)return Cr(c),null;if(y=(c.flags&128)!==0,L=A.rendering,L===null)if(y)uf(A,!1);else{if(Kn!==0||a!==null&&(a.flags&128)!==0)for(a=c.child;a!==null;){if(L=zp(a),L!==null){for(c.flags|=128,uf(A,!1),y=L.updateQueue,y!==null&&(c.updateQueue=y,c.flags|=4),c.subtreeFlags=0,y=p,p=c.child;p!==null;)A=p,a=y,A.flags&=14680066,L=A.alternate,L===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=L.childLanes,A.lanes=L.lanes,A.child=L.child,A.subtreeFlags=0,A.deletions=null,A.memoizedProps=L.memoizedProps,A.memoizedState=L.memoizedState,A.updateQueue=L.updateQueue,A.type=L.type,a=L.dependencies,A.dependencies=a===null?null:{lanes:a.lanes,firstContext:a.firstContext}),p=p.sibling;return en(vn,vn.current&1|2),c.child}a=a.sibling}A.tail!==null&&gn()>lu&&(c.flags|=128,y=!0,uf(A,!1),c.lanes=4194304)}else{if(!y)if(a=zp(L),a!==null){if(c.flags|=128,y=!0,p=a.updateQueue,p!==null&&(c.updateQueue=p,c.flags|=4),uf(A,!0),A.tail===null&&A.tailMode==="hidden"&&!L.alternate&&!un)return Cr(c),null}else 2*gn()-A.renderingStartTime>lu&&p!==1073741824&&(c.flags|=128,y=!0,uf(A,!1),c.lanes=4194304);A.isBackwards?(L.sibling=c.child,c.child=L):(p=A.last,p!==null?p.sibling=L:c.child=L,A.last=L)}return A.tail!==null?(c=A.tail,A.rendering=c,A.tail=c.sibling,A.renderingStartTime=gn(),c.sibling=null,p=vn.current,en(vn,y?p&1|2:p&1),c):(Cr(c),null);case 22:case 23:return J1(),y=c.memoizedState!==null,a!==null&&a.memoizedState!==null!==y&&(c.flags|=8192),y&&(c.mode&1)!==0?(vs&1073741824)!==0&&(Cr(c),c.subtreeFlags&6&&(c.flags|=8192)):Cr(c),null;case 24:return null;case 25:return null}throw Error(n(156,c.tag))}function V7(a,c){switch(l1(c),c.tag){case 1:return Gr(c.type)&&Mp(),a=c.flags,a&65536?(c.flags=a&-65537|128,c):null;case 3:return su(),on(qr),on(Sr),x1(),a=c.flags,(a&65536)!==0&&(a&128)===0?(c.flags=a&-65537|128,c):null;case 5:return _1(c),null;case 13:if(on(vn),a=c.memoizedState,a!==null&&a.dehydrated!==null){if(c.alternate===null)throw Error(n(340));eu()}return a=c.flags,a&65536?(c.flags=a&-65537|128,c):null;case 19:return on(vn),null;case 4:return su(),null;case 10:return p1(c.type._context),null;case 22:case 23:return J1(),null;case 24:return null;default:return null}}var Qp=!1,Er=!1,H7=typeof WeakSet=="function"?WeakSet:Set,Ne=null;function ou(a,c){var p=a.ref;if(p!==null)if(typeof p=="function")try{p(null)}catch(y){Pn(a,c,y)}else p.current=null}function H1(a,c,p){try{p()}catch(y){Pn(a,c,y)}}var H4=!1;function z7(a,c){if(Jv=br,a=_S(),Zv(a)){if("selectionStart"in a)var p={start:a.selectionStart,end:a.selectionEnd};else e:{p=(p=a.ownerDocument)&&p.defaultView||window;var y=p.getSelection&&p.getSelection();if(y&&y.rangeCount!==0){p=y.anchorNode;var C=y.anchorOffset,A=y.focusNode;y=y.focusOffset;try{p.nodeType,A.nodeType}catch{p=null;break e}var L=0,U=-1,G=-1,oe=0,ve=0,_e=a,pe=null;t:for(;;){for(var Re;_e!==p||C!==0&&_e.nodeType!==3||(U=L+C),_e!==A||y!==0&&_e.nodeType!==3||(G=L+y),_e.nodeType===3&&(L+=_e.nodeValue.length),(Re=_e.firstChild)!==null;)pe=_e,_e=Re;for(;;){if(_e===a)break t;if(pe===p&&++oe===C&&(U=L),pe===A&&++ve===y&&(G=L),(Re=_e.nextSibling)!==null)break;_e=pe,pe=_e.parentNode}_e=Re}p=U===-1||G===-1?null:{start:U,end:G}}else p=null}p=p||{start:0,end:0}}else p=null;for(e1={focusedElem:a,selectionRange:p},br=!1,Ne=c;Ne!==null;)if(c=Ne,a=c.child,(c.subtreeFlags&1028)!==0&&a!==null)a.return=c,Ne=a;else for(;Ne!==null;){c=Ne;try{var Fe=c.alternate;if((c.flags&1024)!==0)switch(c.tag){case 0:case 11:case 15:break;case 1:if(Fe!==null){var ze=Fe.memoizedProps,On=Fe.memoizedState,ee=c.stateNode,Q=ee.getSnapshotBeforeUpdate(c.elementType===c.type?ze:ai(c.type,ze),On);ee.__reactInternalSnapshotBeforeUpdate=Q}break;case 3:var ne=c.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(Se){Pn(c,c.return,Se)}if(a=c.sibling,a!==null){a.return=c.return,Ne=a;break}Ne=c.return}return Fe=H4,H4=!1,Fe}function df(a,c,p){var y=c.updateQueue;if(y=y!==null?y.lastEffect:null,y!==null){var C=y=y.next;do{if((C.tag&a)===a){var A=C.destroy;C.destroy=void 0,A!==void 0&&H1(c,p,A)}C=C.next}while(C!==y)}}function Xp(a,c){if(c=c.updateQueue,c=c!==null?c.lastEffect:null,c!==null){var p=c=c.next;do{if((p.tag&a)===a){var y=p.create;p.destroy=y()}p=p.next}while(p!==c)}}function z1(a){var c=a.ref;if(c!==null){var p=a.stateNode;switch(a.tag){case 5:a=p;break;default:a=p}typeof c=="function"?c(a):c.current=a}}function z4(a){var c=a.alternate;c!==null&&(a.alternate=null,z4(c)),a.child=null,a.deletions=null,a.sibling=null,a.tag===5&&(c=a.stateNode,c!==null&&(delete c[Ai],delete c[Jd],delete c[s1],delete c[k7],delete c[C7])),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 U4(a){return a.tag===5||a.tag===3||a.tag===4}function B4(a){e:for(;;){for(;a.sibling===null;){if(a.return===null||U4(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 U1(a,c,p){var y=a.tag;if(y===5||y===6)a=a.stateNode,c?p.nodeType===8?p.parentNode.insertBefore(a,c):p.insertBefore(a,c):(p.nodeType===8?(c=p.parentNode,c.insertBefore(a,p)):(c=p,c.appendChild(a)),p=p._reactRootContainer,p!=null||c.onclick!==null||(c.onclick=Tp));else if(y!==4&&(a=a.child,a!==null))for(U1(a,c,p),a=a.sibling;a!==null;)U1(a,c,p),a=a.sibling}function B1(a,c,p){var y=a.tag;if(y===5||y===6)a=a.stateNode,c?p.insertBefore(a,c):p.appendChild(a);else if(y!==4&&(a=a.child,a!==null))for(B1(a,c,p),a=a.sibling;a!==null;)B1(a,c,p),a=a.sibling}var dr=null,li=!1;function ha(a,c,p){for(p=p.child;p!==null;)Z4(a,c,p),p=p.sibling}function Z4(a,c,p){if(Ns&&typeof Ns.onCommitFiberUnmount=="function")try{Ns.onCommitFiberUnmount(vl,p)}catch{}switch(p.tag){case 5:Er||ou(p,c);case 6:var y=dr,C=li;dr=null,ha(a,c,p),dr=y,li=C,dr!==null&&(li?(a=dr,p=p.stateNode,a.nodeType===8?a.parentNode.removeChild(p):a.removeChild(p)):dr.removeChild(p.stateNode));break;case 18:dr!==null&&(li?(a=dr,p=p.stateNode,a.nodeType===8?r1(a.parentNode,p):a.nodeType===1&&r1(a,p),xr(a)):r1(dr,p.stateNode));break;case 4:y=dr,C=li,dr=p.stateNode.containerInfo,li=!0,ha(a,c,p),dr=y,li=C;break;case 0:case 11:case 14:case 15:if(!Er&&(y=p.updateQueue,y!==null&&(y=y.lastEffect,y!==null))){C=y=y.next;do{var A=C,L=A.destroy;A=A.tag,L!==void 0&&((A&2)!==0||(A&4)!==0)&&H1(p,c,L),C=C.next}while(C!==y)}ha(a,c,p);break;case 1:if(!Er&&(ou(p,c),y=p.stateNode,typeof y.componentWillUnmount=="function"))try{y.props=p.memoizedProps,y.state=p.memoizedState,y.componentWillUnmount()}catch(U){Pn(p,c,U)}ha(a,c,p);break;case 21:ha(a,c,p);break;case 22:p.mode&1?(Er=(y=Er)||p.memoizedState!==null,ha(a,c,p),Er=y):ha(a,c,p);break;default:ha(a,c,p)}}function W4(a){var c=a.updateQueue;if(c!==null){a.updateQueue=null;var p=a.stateNode;p===null&&(p=a.stateNode=new H7),c.forEach(function(y){var C=Q7.bind(null,a,y);p.has(y)||(p.add(y),y.then(C,C))})}}function ci(a,c){var p=c.deletions;if(p!==null)for(var y=0;y<p.length;y++){var C=p[y];try{var A=a,L=c,U=L;e:for(;U!==null;){switch(U.tag){case 5:dr=U.stateNode,li=!1;break e;case 3:dr=U.stateNode.containerInfo,li=!0;break e;case 4:dr=U.stateNode.containerInfo,li=!0;break e}U=U.return}if(dr===null)throw Error(n(160));Z4(A,L,C),dr=null,li=!1;var G=C.alternate;G!==null&&(G.return=null),C.return=null}catch(oe){Pn(C,c,oe)}}if(c.subtreeFlags&12854)for(c=c.child;c!==null;)q4(c,a),c=c.sibling}function q4(a,c){var p=a.alternate,y=a.flags;switch(a.tag){case 0:case 11:case 14:case 15:if(ci(c,a),Mi(a),y&4){try{df(3,a,a.return),Xp(3,a)}catch(ze){Pn(a,a.return,ze)}try{df(5,a,a.return)}catch(ze){Pn(a,a.return,ze)}}break;case 1:ci(c,a),Mi(a),y&512&&p!==null&&ou(p,p.return);break;case 5:if(ci(c,a),Mi(a),y&512&&p!==null&&ou(p,p.return),a.flags&32){var C=a.stateNode;try{jn(C,"")}catch(ze){Pn(a,a.return,ze)}}if(y&4&&(C=a.stateNode,C!=null)){var A=a.memoizedProps,L=p!==null?p.memoizedProps:A,U=a.type,G=a.updateQueue;if(a.updateQueue=null,G!==null)try{U==="input"&&A.type==="radio"&&A.name!=null&&jt(C,A),wr(U,L);var oe=wr(U,A);for(L=0;L<G.length;L+=2){var ve=G[L],_e=G[L+1];ve==="style"?mn(C,_e):ve==="dangerouslySetInnerHTML"?ea(C,_e):ve==="children"?jn(C,_e):E(C,ve,_e,oe)}switch(U){case"input":xt(C,A);break;case"textarea":Ge(C,A);break;case"select":var pe=C._wrapperState.wasMultiple;C._wrapperState.wasMultiple=!!A.multiple;var Re=A.value;Re!=null?ke(C,!!A.multiple,Re,!1):pe!==!!A.multiple&&(A.defaultValue!=null?ke(C,!!A.multiple,A.defaultValue,!0):ke(C,!!A.multiple,A.multiple?[]:"",!1))}C[Jd]=A}catch(ze){Pn(a,a.return,ze)}}break;case 6:if(ci(c,a),Mi(a),y&4){if(a.stateNode===null)throw Error(n(162));C=a.stateNode,A=a.memoizedProps;try{C.nodeValue=A}catch(ze){Pn(a,a.return,ze)}}break;case 3:if(ci(c,a),Mi(a),y&4&&p!==null&&p.memoizedState.isDehydrated)try{xr(c.containerInfo)}catch(ze){Pn(a,a.return,ze)}break;case 4:ci(c,a),Mi(a);break;case 13:ci(c,a),Mi(a),C=a.child,C.flags&8192&&(A=C.memoizedState!==null,C.stateNode.isHidden=A,!A||C.alternate!==null&&C.alternate.memoizedState!==null||(q1=gn())),y&4&&W4(a);break;case 22:if(ve=p!==null&&p.memoizedState!==null,a.mode&1?(Er=(oe=Er)||ve,ci(c,a),Er=oe):ci(c,a),Mi(a),y&8192){if(oe=a.memoizedState!==null,(a.stateNode.isHidden=oe)&&!ve&&(a.mode&1)!==0)for(Ne=a,ve=a.child;ve!==null;){for(_e=Ne=ve;Ne!==null;){switch(pe=Ne,Re=pe.child,pe.tag){case 0:case 11:case 14:case 15:df(4,pe,pe.return);break;case 1:ou(pe,pe.return);var Fe=pe.stateNode;if(typeof Fe.componentWillUnmount=="function"){y=pe,p=pe.return;try{c=y,Fe.props=c.memoizedProps,Fe.state=c.memoizedState,Fe.componentWillUnmount()}catch(ze){Pn(y,p,ze)}}break;case 5:ou(pe,pe.return);break;case 22:if(pe.memoizedState!==null){Y4(_e);continue}}Re!==null?(Re.return=pe,Ne=Re):Y4(_e)}ve=ve.sibling}e:for(ve=null,_e=a;;){if(_e.tag===5){if(ve===null){ve=_e;try{C=_e.stateNode,oe?(A=C.style,typeof A.setProperty=="function"?A.setProperty("display","none","important"):A.display="none"):(U=_e.stateNode,G=_e.memoizedProps.style,L=G!=null&&G.hasOwnProperty("display")?G.display:null,U.style.display=pn("display",L))}catch(ze){Pn(a,a.return,ze)}}}else if(_e.tag===6){if(ve===null)try{_e.stateNode.nodeValue=oe?"":_e.memoizedProps}catch(ze){Pn(a,a.return,ze)}}else if((_e.tag!==22&&_e.tag!==23||_e.memoizedState===null||_e===a)&&_e.child!==null){_e.child.return=_e,_e=_e.child;continue}if(_e===a)break e;for(;_e.sibling===null;){if(_e.return===null||_e.return===a)break e;ve===_e&&(ve=null),_e=_e.return}ve===_e&&(ve=null),_e.sibling.return=_e.return,_e=_e.sibling}}break;case 19:ci(c,a),Mi(a),y&4&&W4(a);break;case 21:break;default:ci(c,a),Mi(a)}}function Mi(a){var c=a.flags;if(c&2){try{e:{for(var p=a.return;p!==null;){if(U4(p)){var y=p;break e}p=p.return}throw Error(n(160))}switch(y.tag){case 5:var C=y.stateNode;y.flags&32&&(jn(C,""),y.flags&=-33);var A=B4(a);B1(a,A,C);break;case 3:case 4:var L=y.stateNode.containerInfo,U=B4(a);U1(a,U,L);break;default:throw Error(n(161))}}catch(G){Pn(a,a.return,G)}a.flags&=-3}c&4096&&(a.flags&=-4097)}function U7(a,c,p){Ne=a,G4(a)}function G4(a,c,p){for(var y=(a.mode&1)!==0;Ne!==null;){var C=Ne,A=C.child;if(C.tag===22&&y){var L=C.memoizedState!==null||Qp;if(!L){var U=C.alternate,G=U!==null&&U.memoizedState!==null||Er;U=Qp;var oe=Er;if(Qp=L,(Er=G)&&!oe)for(Ne=C;Ne!==null;)L=Ne,G=L.child,L.tag===22&&L.memoizedState!==null?Q4(C):G!==null?(G.return=L,Ne=G):Q4(C);for(;A!==null;)Ne=A,G4(A),A=A.sibling;Ne=C,Qp=U,Er=oe}K4(a)}else(C.subtreeFlags&8772)!==0&&A!==null?(A.return=C,Ne=A):K4(a)}}function K4(a){for(;Ne!==null;){var c=Ne;if((c.flags&8772)!==0){var p=c.alternate;try{if((c.flags&8772)!==0)switch(c.tag){case 0:case 11:case 15:Er||Xp(5,c);break;case 1:var y=c.stateNode;if(c.flags&4&&!Er)if(p===null)y.componentDidMount();else{var C=c.elementType===c.type?p.memoizedProps:ai(c.type,p.memoizedProps);y.componentDidUpdate(C,p.memoizedState,y.__reactInternalSnapshotBeforeUpdate)}var A=c.updateQueue;A!==null&&YS(c,A,y);break;case 3:var L=c.updateQueue;if(L!==null){if(p=null,c.child!==null)switch(c.child.tag){case 5:p=c.child.stateNode;break;case 1:p=c.child.stateNode}YS(c,L,p)}break;case 5:var U=c.stateNode;if(p===null&&c.flags&4){p=U;var G=c.memoizedProps;switch(c.type){case"button":case"input":case"select":case"textarea":G.autoFocus&&p.focus();break;case"img":G.src&&(p.src=G.src)}}break;case 6:break;case 4:break;case 12:break;case 13:if(c.memoizedState===null){var oe=c.alternate;if(oe!==null){var ve=oe.memoizedState;if(ve!==null){var _e=ve.dehydrated;_e!==null&&xr(_e)}}}break;case 19:case 17:case 21:case 22:case 23:case 25:break;default:throw Error(n(163))}Er||c.flags&512&&z1(c)}catch(pe){Pn(c,c.return,pe)}}if(c===a){Ne=null;break}if(p=c.sibling,p!==null){p.return=c.return,Ne=p;break}Ne=c.return}}function Y4(a){for(;Ne!==null;){var c=Ne;if(c===a){Ne=null;break}var p=c.sibling;if(p!==null){p.return=c.return,Ne=p;break}Ne=c.return}}function Q4(a){for(;Ne!==null;){var c=Ne;try{switch(c.tag){case 0:case 11:case 15:var p=c.return;try{Xp(4,c)}catch(G){Pn(c,p,G)}break;case 1:var y=c.stateNode;if(typeof y.componentDidMount=="function"){var C=c.return;try{y.componentDidMount()}catch(G){Pn(c,C,G)}}var A=c.return;try{z1(c)}catch(G){Pn(c,A,G)}break;case 5:var L=c.return;try{z1(c)}catch(G){Pn(c,L,G)}}}catch(G){Pn(c,c.return,G)}if(c===a){Ne=null;break}var U=c.sibling;if(U!==null){U.return=c.return,Ne=U;break}Ne=c.return}}var B7=Math.ceil,Jp=P.ReactCurrentDispatcher,Z1=P.ReactCurrentOwner,Hs=P.ReactCurrentBatchConfig,Rt=0,ir=null,Vn=null,fr=0,vs=0,au=la(0),Kn=0,ff=null,Pl=0,e0=0,W1=0,hf=null,Yr=null,q1=0,lu=1/0,_o=null,t0=!1,G1=null,pa=null,n0=!1,ma=null,r0=0,pf=0,K1=null,s0=-1,i0=0;function Nr(){return(Rt&6)!==0?gn():s0!==-1?s0:s0=gn()}function ga(a){return(a.mode&1)===0?1:(Rt&2)!==0&&fr!==0?fr&-fr:P7.transition!==null?(i0===0&&(i0=Fc()),i0):(a=Nt,a!==0||(a=window.event,a=a===void 0?16:J6(a.type)),a)}function ui(a,c,p,y){if(50<pf)throw pf=0,K1=null,Error(n(185));_l(a,p,y),((Rt&2)===0||a!==ir)&&(a===ir&&((Rt&2)===0&&(e0|=p),Kn===4&&va(a,fr)),Qr(a,y),p===1&&Rt===0&&(c.mode&1)===0&&(lu=gn()+500,Op&&ua()))}function Qr(a,c){var p=a.callbackNode;Lv(a,c);var y=$c(a,a===ir?fr:0);if(y===0)p!==null&&hp(p),a.callbackNode=null,a.callbackPriority=0;else if(c=y&-y,a.callbackPriority!==c){if(p!=null&&hp(p),c===1)a.tag===0?E7(J4.bind(null,a)):$S(J4.bind(null,a)),b7(function(){(Rt&6)===0&&ua()}),p=null;else{switch(Hc(y)){case 1:p=ml;break;case 4:p=Nc;break;case 16:p=gl;break;case 536870912:p=pp;break;default:p=gl}p=a8(p,X4.bind(null,a))}a.callbackPriority=c,a.callbackNode=p}}function X4(a,c){if(s0=-1,i0=0,(Rt&6)!==0)throw Error(n(327));var p=a.callbackNode;if(cu()&&a.callbackNode!==p)return null;var y=$c(a,a===ir?fr:0);if(y===0)return null;if((y&30)!==0||(y&a.expiredLanes)!==0||c)c=o0(a,y);else{c=y;var C=Rt;Rt|=2;var A=t8();(ir!==a||fr!==c)&&(_o=null,lu=gn()+500,Tl(a,c));do try{q7();break}catch(U){e8(a,U)}while(!0);h1(),Jp.current=A,Rt=C,Vn!==null?c=0:(ir=null,fr=0,c=Kn)}if(c!==0){if(c===2&&(C=yl(a),C!==0&&(y=C,c=Y1(a,C))),c===1)throw p=ff,Tl(a,0),va(a,y),Qr(a,gn()),p;if(c===6)va(a,y);else{if(C=a.current.alternate,(y&30)===0&&!Z7(C)&&(c=o0(a,y),c===2&&(A=yl(a),A!==0&&(y=A,c=Y1(a,A))),c===1))throw p=ff,Tl(a,0),va(a,y),Qr(a,gn()),p;switch(a.finishedWork=C,a.finishedLanes=y,c){case 0:case 1:throw Error(n(345));case 2:Rl(a,Yr,_o);break;case 3:if(va(a,y),(y&130023424)===y&&(c=q1+500-gn(),10<c)){if($c(a,0)!==0)break;if(C=a.suspendedLanes,(C&y)!==y){Nr(),a.pingedLanes|=a.suspendedLanes&C;break}a.timeoutHandle=n1(Rl.bind(null,a,Yr,_o),c);break}Rl(a,Yr,_o);break;case 4:if(va(a,y),(y&4194240)===y)break;for(c=a.eventTimes,C=-1;0<y;){var L=31-Or(y);A=1<<L,L=c[L],L>C&&(C=L),y&=~A}if(y=C,y=gn()-y,y=(120>y?120:480>y?480:1080>y?1080:1920>y?1920:3e3>y?3e3:4320>y?4320:1960*B7(y/1960))-y,10<y){a.timeoutHandle=n1(Rl.bind(null,a,Yr,_o),y);break}Rl(a,Yr,_o);break;case 5:Rl(a,Yr,_o);break;default:throw Error(n(329))}}}return Qr(a,gn()),a.callbackNode===p?X4.bind(null,a):null}function Y1(a,c){var p=hf;return a.current.memoizedState.isDehydrated&&(Tl(a,c).flags|=256),a=o0(a,c),a!==2&&(c=Yr,Yr=p,c!==null&&Q1(c)),a}function Q1(a){Yr===null?Yr=a:Yr.push.apply(Yr,a)}function Z7(a){for(var c=a;;){if(c.flags&16384){var p=c.updateQueue;if(p!==null&&(p=p.stores,p!==null))for(var y=0;y<p.length;y++){var C=p[y],A=C.getSnapshot;C=C.value;try{if(!ii(A(),C))return!1}catch{return!1}}}if(p=c.child,c.subtreeFlags&16384&&p!==null)p.return=c,c=p;else{if(c===a)break;for(;c.sibling===null;){if(c.return===null||c.return===a)return!0;c=c.return}c.sibling.return=c.return,c=c.sibling}}return!0}function va(a,c){for(c&=~W1,c&=~e0,a.suspendedLanes|=c,a.pingedLanes&=~c,a=a.expirationTimes;0<c;){var p=31-Or(c),y=1<<p;a[p]=-1,c&=~y}}function J4(a){if((Rt&6)!==0)throw Error(n(327));cu();var c=$c(a,0);if((c&1)===0)return Qr(a,gn()),null;var p=o0(a,c);if(a.tag!==0&&p===2){var y=yl(a);y!==0&&(c=y,p=Y1(a,y))}if(p===1)throw p=ff,Tl(a,0),va(a,c),Qr(a,gn()),p;if(p===6)throw Error(n(345));return a.finishedWork=a.current.alternate,a.finishedLanes=c,Rl(a,Yr,_o),Qr(a,gn()),null}function X1(a,c){var p=Rt;Rt|=1;try{return a(c)}finally{Rt=p,Rt===0&&(lu=gn()+500,Op&&ua())}}function Al(a){ma!==null&&ma.tag===0&&(Rt&6)===0&&cu();var c=Rt;Rt|=1;var p=Hs.transition,y=Nt;try{if(Hs.transition=null,Nt=1,a)return a()}finally{Nt=y,Hs.transition=p,Rt=c,(Rt&6)===0&&ua()}}function J1(){vs=au.current,on(au)}function Tl(a,c){a.finishedWork=null,a.finishedLanes=0;var p=a.timeoutHandle;if(p!==-1&&(a.timeoutHandle=-1,x7(p)),Vn!==null)for(p=Vn.return;p!==null;){var y=p;switch(l1(y),y.tag){case 1:y=y.type.childContextTypes,y!=null&&Mp();break;case 3:su(),on(qr),on(Sr),x1();break;case 5:_1(y);break;case 4:su();break;case 13:on(vn);break;case 19:on(vn);break;case 10:p1(y.type._context);break;case 22:case 23:J1()}p=p.return}if(ir=a,Vn=a=ya(a.current,null),fr=vs=c,Kn=0,ff=null,W1=e0=Pl=0,Yr=hf=null,kl!==null){for(c=0;c<kl.length;c++)if(p=kl[c],y=p.interleaved,y!==null){p.interleaved=null;var C=y.next,A=p.pending;if(A!==null){var L=A.next;A.next=C,y.next=L}p.pending=y}kl=null}return a}function e8(a,c){do{var p=Vn;try{if(h1(),Up.current=qp,Bp){for(var y=yn.memoizedState;y!==null;){var C=y.queue;C!==null&&(C.pending=null),y=y.next}Bp=!1}if(El=0,sr=Gn=yn=null,of=!1,af=0,Z1.current=null,p===null||p.return===null){Kn=1,ff=c,Vn=null;break}e:{var A=a,L=p.return,U=p,G=c;if(c=fr,U.flags|=32768,G!==null&&typeof G=="object"&&typeof G.then=="function"){var oe=G,ve=U,_e=ve.tag;if((ve.mode&1)===0&&(_e===0||_e===11||_e===15)){var pe=ve.alternate;pe?(ve.updateQueue=pe.updateQueue,ve.memoizedState=pe.memoizedState,ve.lanes=pe.lanes):(ve.updateQueue=null,ve.memoizedState=null)}var Re=C4(L);if(Re!==null){Re.flags&=-257,E4(Re,L,U,A,c),Re.mode&1&&k4(A,oe,c),c=Re,G=oe;var Fe=c.updateQueue;if(Fe===null){var ze=new Set;ze.add(G),c.updateQueue=ze}else Fe.add(G);break e}else{if((c&1)===0){k4(A,oe,c),ey();break e}G=Error(n(426))}}else if(un&&U.mode&1){var On=C4(L);if(On!==null){(On.flags&65536)===0&&(On.flags|=256),E4(On,L,U,A,c),d1(iu(G,U));break e}}A=G=iu(G,U),Kn!==4&&(Kn=2),hf===null?hf=[A]:hf.push(A),A=L;do{switch(A.tag){case 3:A.flags|=65536,c&=-c,A.lanes|=c;var ee=b4(A,G,c);KS(A,ee);break e;case 1:U=G;var Q=A.type,ne=A.stateNode;if((A.flags&128)===0&&(typeof Q.getDerivedStateFromError=="function"||ne!==null&&typeof ne.componentDidCatch=="function"&&(pa===null||!pa.has(ne)))){A.flags|=65536,c&=-c,A.lanes|=c;var Se=S4(A,U,c);KS(A,Se);break e}}A=A.return}while(A!==null)}r8(p)}catch(Be){c=Be,Vn===p&&p!==null&&(Vn=p=p.return);continue}break}while(!0)}function t8(){var a=Jp.current;return Jp.current=qp,a===null?qp:a}function ey(){(Kn===0||Kn===3||Kn===2)&&(Kn=4),ir===null||(Pl&268435455)===0&&(e0&268435455)===0||va(ir,fr)}function o0(a,c){var p=Rt;Rt|=2;var y=t8();(ir!==a||fr!==c)&&(_o=null,Tl(a,c));do try{W7();break}catch(C){e8(a,C)}while(!0);if(h1(),Rt=p,Jp.current=y,Vn!==null)throw Error(n(261));return ir=null,fr=0,Kn}function W7(){for(;Vn!==null;)n8(Vn)}function q7(){for(;Vn!==null&&!Lc();)n8(Vn)}function n8(a){var c=o8(a.alternate,a,vs);a.memoizedProps=a.pendingProps,c===null?r8(a):Vn=c,Z1.current=null}function r8(a){var c=a;do{var p=c.alternate;if(a=c.return,(c.flags&32768)===0){if(p=F7(p,c,vs),p!==null){Vn=p;return}}else{if(p=V7(p,c),p!==null){p.flags&=32767,Vn=p;return}if(a!==null)a.flags|=32768,a.subtreeFlags=0,a.deletions=null;else{Kn=6,Vn=null;return}}if(c=c.sibling,c!==null){Vn=c;return}Vn=c=a}while(c!==null);Kn===0&&(Kn=5)}function Rl(a,c,p){var y=Nt,C=Hs.transition;try{Hs.transition=null,Nt=1,G7(a,c,p,y)}finally{Hs.transition=C,Nt=y}return null}function G7(a,c,p,y){do cu();while(ma!==null);if((Rt&6)!==0)throw Error(n(327));p=a.finishedWork;var C=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(X6(a,A),a===ir&&(Vn=ir=null,fr=0),(p.subtreeFlags&2064)===0&&(p.flags&2064)===0||n0||(n0=!0,a8(gl,function(){return cu(),null})),A=(p.flags&15990)!==0,(p.subtreeFlags&15990)!==0||A){A=Hs.transition,Hs.transition=null;var L=Nt;Nt=1;var U=Rt;Rt|=4,Z1.current=null,z7(a,p),q4(p,a),p7(e1),br=!!Jv,e1=Jv=null,a.current=p,U7(p),Ev(),Rt=U,Nt=L,Hs.transition=A}else a.current=p;if(n0&&(n0=!1,ma=a,r0=C),A=a.pendingLanes,A===0&&(pa=null),Tv(p.stateNode),Qr(a,gn()),c!==null)for(y=a.onRecoverableError,p=0;p<c.length;p++)C=c[p],y(C.value,{componentStack:C.stack,digest:C.digest});if(t0)throw t0=!1,a=G1,G1=null,a;return(r0&1)!==0&&a.tag!==0&&cu(),A=a.pendingLanes,(A&1)!==0?a===K1?pf++:(pf=0,K1=a):pf=0,ua(),null}function cu(){if(ma!==null){var a=Hc(r0),c=Hs.transition,p=Nt;try{if(Hs.transition=null,Nt=16>a?16:a,ma===null)var y=!1;else{if(a=ma,ma=null,r0=0,(Rt&6)!==0)throw Error(n(331));var C=Rt;for(Rt|=4,Ne=a.current;Ne!==null;){var A=Ne,L=A.child;if((Ne.flags&16)!==0){var U=A.deletions;if(U!==null){for(var G=0;G<U.length;G++){var oe=U[G];for(Ne=oe;Ne!==null;){var ve=Ne;switch(ve.tag){case 0:case 11:case 15:df(8,ve,A)}var _e=ve.child;if(_e!==null)_e.return=ve,Ne=_e;else for(;Ne!==null;){ve=Ne;var pe=ve.sibling,Re=ve.return;if(z4(ve),ve===oe){Ne=null;break}if(pe!==null){pe.return=Re,Ne=pe;break}Ne=Re}}}var Fe=A.alternate;if(Fe!==null){var ze=Fe.child;if(ze!==null){Fe.child=null;do{var On=ze.sibling;ze.sibling=null,ze=On}while(ze!==null)}}Ne=A}}if((A.subtreeFlags&2064)!==0&&L!==null)L.return=A,Ne=L;else e:for(;Ne!==null;){if(A=Ne,(A.flags&2048)!==0)switch(A.tag){case 0:case 11:case 15:df(9,A,A.return)}var ee=A.sibling;if(ee!==null){ee.return=A.return,Ne=ee;break e}Ne=A.return}}var Q=a.current;for(Ne=Q;Ne!==null;){L=Ne;var ne=L.child;if((L.subtreeFlags&2064)!==0&&ne!==null)ne.return=L,Ne=ne;else e:for(L=Q;Ne!==null;){if(U=Ne,(U.flags&2048)!==0)try{switch(U.tag){case 0:case 11:case 15:Xp(9,U)}}catch(Be){Pn(U,U.return,Be)}if(U===L){Ne=null;break e}var Se=U.sibling;if(Se!==null){Se.return=U.return,Ne=Se;break e}Ne=U.return}}if(Rt=C,ua(),Ns&&typeof Ns.onPostCommitFiberRoot=="function")try{Ns.onPostCommitFiberRoot(vl,a)}catch{}y=!0}return y}finally{Nt=p,Hs.transition=c}}return!1}function s8(a,c,p){c=iu(p,c),c=b4(a,c,1),a=fa(a,c,1),c=Nr(),a!==null&&(_l(a,1,c),Qr(a,c))}function Pn(a,c,p){if(a.tag===3)s8(a,a,p);else for(;c!==null;){if(c.tag===3){s8(c,a,p);break}else if(c.tag===1){var y=c.stateNode;if(typeof c.type.getDerivedStateFromError=="function"||typeof y.componentDidCatch=="function"&&(pa===null||!pa.has(y))){a=iu(p,a),a=S4(c,a,1),c=fa(c,a,1),a=Nr(),c!==null&&(_l(c,1,a),Qr(c,a));break}}c=c.return}}function K7(a,c,p){var y=a.pingCache;y!==null&&y.delete(c),c=Nr(),a.pingedLanes|=a.suspendedLanes&p,ir===a&&(fr&p)===p&&(Kn===4||Kn===3&&(fr&130023424)===fr&&500>gn()-q1?Tl(a,0):W1|=p),Qr(a,c)}function i8(a,c){c===0&&((a.mode&1)===0?c=1:(c=jc,jc<<=1,(jc&130023424)===0&&(jc=4194304)));var p=Nr();a=go(a,c),a!==null&&(_l(a,c,p),Qr(a,p))}function Y7(a){var c=a.memoizedState,p=0;c!==null&&(p=c.retryLane),i8(a,p)}function Q7(a,c){var p=0;switch(a.tag){case 13:var y=a.stateNode,C=a.memoizedState;C!==null&&(p=C.retryLane);break;case 19:y=a.stateNode;break;default:throw Error(n(314))}y!==null&&y.delete(c),i8(a,p)}var o8;o8=function(a,c,p){if(a!==null)if(a.memoizedProps!==c.pendingProps||qr.current)Kr=!0;else{if((a.lanes&p)===0&&(c.flags&128)===0)return Kr=!1,$7(a,c,p);Kr=(a.flags&131072)!==0}else Kr=!1,un&&(c.flags&1048576)!==0&&FS(c,Np,c.index);switch(c.lanes=0,c.tag){case 2:var y=c.type;Yp(a,c),a=c.pendingProps;var C=Qc(c,Sr.current);ru(c,p),C=k1(null,c,y,a,C,p);var A=C1();return c.flags|=1,typeof C=="object"&&C!==null&&typeof C.render=="function"&&C.$$typeof===void 0?(c.tag=1,c.memoizedState=null,c.updateQueue=null,Gr(y)?(A=!0,Ip(c)):A=!1,c.memoizedState=C.state!==null&&C.state!==void 0?C.state:null,v1(c),C.updater=Gp,c.stateNode=C,C._reactInternals=c,M1(c,y,a,p),c=N1(null,c,y,!0,A,p)):(c.tag=0,un&&A&&a1(c),Lr(null,c,C,p),c=c.child),c;case 16:y=c.elementType;e:{switch(Yp(a,c),a=c.pendingProps,C=y._init,y=C(y._payload),c.type=y,C=c.tag=J7(y),a=ai(y,a),C){case 0:c=L1(null,c,y,a,p);break e;case 1:c=I4(null,c,y,a,p);break e;case 11:c=P4(null,c,y,a,p);break e;case 14:c=A4(null,c,y,ai(y.type,a),p);break e}throw Error(n(306,y,""))}return c;case 0:return y=c.type,C=c.pendingProps,C=c.elementType===y?C:ai(y,C),L1(a,c,y,C,p);case 1:return y=c.type,C=c.pendingProps,C=c.elementType===y?C:ai(y,C),I4(a,c,y,C,p);case 3:e:{if(O4(c),a===null)throw Error(n(387));y=c.pendingProps,A=c.memoizedState,C=A.element,GS(a,c),Hp(c,y,null,p);var L=c.memoizedState;if(y=L.element,A.isDehydrated)if(A={element:y,isDehydrated:!1,cache:L.cache,pendingSuspenseBoundaries:L.pendingSuspenseBoundaries,transitions:L.transitions},c.updateQueue.baseState=A,c.memoizedState=A,c.flags&256){C=iu(Error(n(423)),c),c=L4(a,c,y,p,C);break e}else if(y!==C){C=iu(Error(n(424)),c),c=L4(a,c,y,p,C);break e}else for(gs=aa(c.stateNode.containerInfo.firstChild),ms=c,un=!0,oi=null,p=WS(c,null,y,p),c.child=p;p;)p.flags=p.flags&-3|4096,p=p.sibling;else{if(eu(),y===C){c=yo(a,c,p);break e}Lr(a,c,y,p)}c=c.child}return c;case 5:return QS(c),a===null&&u1(c),y=c.type,C=c.pendingProps,A=a!==null?a.memoizedProps:null,L=C.children,t1(y,C)?L=null:A!==null&&t1(y,A)&&(c.flags|=32),M4(a,c),Lr(a,c,L,p),c.child;case 6:return a===null&&u1(c),null;case 13:return N4(a,c,p);case 4:return y1(c,c.stateNode.containerInfo),y=c.pendingProps,a===null?c.child=tu(c,null,y,p):Lr(a,c,y,p),c.child;case 11:return y=c.type,C=c.pendingProps,C=c.elementType===y?C:ai(y,C),P4(a,c,y,C,p);case 7:return Lr(a,c,c.pendingProps,p),c.child;case 8:return Lr(a,c,c.pendingProps.children,p),c.child;case 12:return Lr(a,c,c.pendingProps.children,p),c.child;case 10:e:{if(y=c.type._context,C=c.pendingProps,A=c.memoizedProps,L=C.value,en($p,y._currentValue),y._currentValue=L,A!==null)if(ii(A.value,L)){if(A.children===C.children&&!qr.current){c=yo(a,c,p);break e}}else for(A=c.child,A!==null&&(A.return=c);A!==null;){var U=A.dependencies;if(U!==null){L=A.child;for(var G=U.firstContext;G!==null;){if(G.context===y){if(A.tag===1){G=vo(-1,p&-p),G.tag=2;var oe=A.updateQueue;if(oe!==null){oe=oe.shared;var ve=oe.pending;ve===null?G.next=G:(G.next=ve.next,ve.next=G),oe.pending=G}}A.lanes|=p,G=A.alternate,G!==null&&(G.lanes|=p),m1(A.return,p,c),U.lanes|=p;break}G=G.next}}else if(A.tag===10)L=A.type===c.type?null:A.child;else if(A.tag===18){if(L=A.return,L===null)throw Error(n(341));L.lanes|=p,U=L.alternate,U!==null&&(U.lanes|=p),m1(L,p,c),L=A.sibling}else L=A.child;if(L!==null)L.return=A;else for(L=A;L!==null;){if(L===c){L=null;break}if(A=L.sibling,A!==null){A.return=L.return,L=A;break}L=L.return}A=L}Lr(a,c,C.children,p),c=c.child}return c;case 9:return C=c.type,y=c.pendingProps.children,ru(c,p),C=Fs(C),y=y(C),c.flags|=1,Lr(a,c,y,p),c.child;case 14:return y=c.type,C=ai(y,c.pendingProps),C=ai(y.type,C),A4(a,c,y,C,p);case 15:return T4(a,c,c.type,c.pendingProps,p);case 17:return y=c.type,C=c.pendingProps,C=c.elementType===y?C:ai(y,C),Yp(a,c),c.tag=1,Gr(y)?(a=!0,Ip(c)):a=!1,ru(c,p),w4(c,y,C),M1(c,y,C,p),N1(null,c,y,!0,a,p);case 19:return j4(a,c,p);case 22:return R4(a,c,p)}throw Error(n(156,c.tag))};function a8(a,c){return Oc(a,c)}function X7(a,c,p,y){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=c,this.dependencies=this.memoizedState=this.updateQueue=this.memoizedProps=null,this.mode=y,this.subtreeFlags=this.flags=0,this.deletions=null,this.childLanes=this.lanes=0,this.alternate=null}function zs(a,c,p,y){return new X7(a,c,p,y)}function ty(a){return a=a.prototype,!(!a||!a.isReactComponent)}function J7(a){if(typeof a=="function")return ty(a)?1:0;if(a!=null){if(a=a.$$typeof,a===V)return 11;if(a===K)return 14}return 2}function ya(a,c){var p=a.alternate;return p===null?(p=zs(a.tag,c,a.key,a.mode),p.elementType=a.elementType,p.type=a.type,p.stateNode=a.stateNode,p.alternate=a,a.alternate=p):(p.pendingProps=c,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,c=a.dependencies,p.dependencies=c===null?null:{lanes:c.lanes,firstContext:c.firstContext},p.sibling=a.sibling,p.index=a.index,p.ref=a.ref,p}function a0(a,c,p,y,C,A){var L=2;if(y=a,typeof a=="function")ty(a)&&(L=1);else if(typeof a=="string")L=5;else e:switch(a){case M:return Ml(p.children,C,A,c);case R:L=8,C|=8;break;case O:return a=zs(12,p,c,C|2),a.elementType=O,a.lanes=A,a;case q:return a=zs(13,p,c,C),a.elementType=q,a.lanes=A,a;case B:return a=zs(19,p,c,C),a.elementType=B,a.lanes=A,a;case X:return l0(p,C,A,c);default:if(typeof a=="object"&&a!==null)switch(a.$$typeof){case D:L=10;break e;case $:L=9;break e;case V:L=11;break e;case K:L=14;break e;case z:L=16,y=null;break e}throw Error(n(130,a==null?a:typeof a,""))}return c=zs(L,p,c,C),c.elementType=a,c.type=y,c.lanes=A,c}function Ml(a,c,p,y){return a=zs(7,a,y,c),a.lanes=p,a}function l0(a,c,p,y){return a=zs(22,a,y,c),a.elementType=X,a.lanes=p,a.stateNode={isHidden:!1},a}function ny(a,c,p){return a=zs(6,a,null,c),a.lanes=p,a}function ry(a,c,p){return c=zs(4,a.children!==null?a.children:[],a.key,c),c.lanes=p,c.stateNode={containerInfo:a.containerInfo,pendingChildren:null,implementation:a.implementation},c}function ej(a,c,p,y,C){this.tag=c,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=Vc(0),this.expirationTimes=Vc(-1),this.entangledLanes=this.finishedLanes=this.mutableReadLanes=this.expiredLanes=this.pingedLanes=this.suspendedLanes=this.pendingLanes=0,this.entanglements=Vc(0),this.identifierPrefix=y,this.onRecoverableError=C,this.mutableSourceEagerHydrationData=null}function sy(a,c,p,y,C,A,L,U,G){return a=new ej(a,c,p,U,G),c===1?(c=1,A===!0&&(c|=8)):c=0,A=zs(3,null,null,c),a.current=A,A.stateNode=a,A.memoizedState={element:y,isDehydrated:p,cache:null,transitions:null,pendingSuspenseBoundaries:null},v1(A),a}function tj(a,c,p){var y=3<arguments.length&&arguments[3]!==void 0?arguments[3]:null;return{$$typeof:I,key:y==null?null:""+y,children:a,containerInfo:c,implementation:p}}function l8(a){if(!a)return ca;a=a._reactInternals;e:{if(Ei(a)!==a||a.tag!==1)throw Error(n(170));var c=a;do{switch(c.tag){case 3:c=c.stateNode.context;break e;case 1:if(Gr(c.type)){c=c.stateNode.__reactInternalMemoizedMergedChildContext;break e}}c=c.return}while(c!==null);throw Error(n(171))}if(a.tag===1){var p=a.type;if(Gr(p))return DS(a,p,c)}return c}function c8(a,c,p,y,C,A,L,U,G){return a=sy(p,y,!0,a,C,A,L,U,G),a.context=l8(null),p=a.current,y=Nr(),C=ga(p),A=vo(y,C),A.callback=c??null,fa(p,A,C),a.current.lanes=C,_l(a,C,y),Qr(a,y),a}function c0(a,c,p,y){var C=c.current,A=Nr(),L=ga(C);return p=l8(p),c.context===null?c.context=p:c.pendingContext=p,c=vo(A,L),c.payload={element:a},y=y===void 0?null:y,y!==null&&(c.callback=y),a=fa(C,c,L),a!==null&&(ui(a,C,L,A),Vp(a,C,L)),L}function u0(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 u8(a,c){if(a=a.memoizedState,a!==null&&a.dehydrated!==null){var p=a.retryLane;a.retryLane=p!==0&&p<c?p:c}}function iy(a,c){u8(a,c),(a=a.alternate)&&u8(a,c)}function nj(){return null}var d8=typeof reportError=="function"?reportError:function(a){console.error(a)};function oy(a){this._internalRoot=a}d0.prototype.render=oy.prototype.render=function(a){var c=this._internalRoot;if(c===null)throw Error(n(409));c0(a,c,null,null)},d0.prototype.unmount=oy.prototype.unmount=function(){var a=this._internalRoot;if(a!==null){this._internalRoot=null;var c=a.containerInfo;Al(function(){c0(null,a,null,null)}),c[fo]=null}};function d0(a){this._internalRoot=a}d0.prototype.unstable_scheduleHydration=function(a){if(a){var c=zd();a={blockedOn:null,target:a,priority:c};for(var p=0;p<F.length&&c!==0&&c<F[p].priority;p++);F.splice(p,0,a),p===0&&we(a)}};function ay(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 f8(){}function rj(a,c,p,y,C){if(C){if(typeof y=="function"){var A=y;y=function(){var oe=u0(L);A.call(oe)}}var L=c8(c,y,a,0,null,!1,!1,"",f8);return a._reactRootContainer=L,a[fo]=L.current,Qd(a.nodeType===8?a.parentNode:a),Al(),L}for(;C=a.lastChild;)a.removeChild(C);if(typeof y=="function"){var U=y;y=function(){var oe=u0(G);U.call(oe)}}var G=sy(a,0,!1,null,null,!1,!1,"",f8);return a._reactRootContainer=G,a[fo]=G.current,Qd(a.nodeType===8?a.parentNode:a),Al(function(){c0(c,G,p,y)}),G}function h0(a,c,p,y,C){var A=p._reactRootContainer;if(A){var L=A;if(typeof C=="function"){var U=C;C=function(){var G=u0(L);U.call(G)}}c0(c,L,a,C)}else L=rj(p,c,a,C,y);return u0(L)}mp=function(a){switch(a.tag){case 3:var c=a.stateNode;if(c.current.memoizedState.isDehydrated){var p=co(c.pendingLanes);p!==0&&(Pi(c,p|1),Qr(c,gn()),(Rt&6)===0&&(lu=gn()+500,ua()))}break;case 13:Al(function(){var y=go(a,1);if(y!==null){var C=Nr();ui(y,a,1,C)}}),iy(a,1)}},Hd=function(a){if(a.tag===13){var c=go(a,134217728);if(c!==null){var p=Nr();ui(c,a,134217728,p)}iy(a,134217728)}},gp=function(a){if(a.tag===13){var c=ga(a),p=go(a,c);if(p!==null){var y=Nr();ui(p,a,c,y)}iy(a,c)}},zd=function(){return Nt},vp=function(a,c){var p=Nt;try{return Nt=a,c()}finally{Nt=p}},ei=function(a,c,p){switch(c){case"input":if(xt(a,p),c=p.name,p.type==="radio"&&c!=null){for(p=a;p.parentNode;)p=p.parentNode;for(p=p.querySelectorAll("input[name="+JSON.stringify(""+c)+'][type="radio"]'),c=0;c<p.length;c++){var y=p[c];if(y!==a&&y.form===a.form){var C=Rp(y);if(!C)throw Error(n(90));Ee(y),xt(y,C)}}}break;case"textarea":Ge(a,p);break;case"select":c=p.value,c!=null&&ke(a,!!p.multiple,c,!1)}},Ke=X1,Lt=Al;var sj={usingClientEntryPoint:!1,Events:[ef,Kc,Rp,lo,fs,X1]},mf={findFiberByHostInstance:wl,bundleType:0,version:"18.3.1",rendererPackageName:"react-dom"},ij={bundleType:mf.bundleType,version:mf.version,rendererPackageName:mf.rendererPackageName,rendererConfig:mf.rendererConfig,overrideHookState:null,overrideHookStateDeletePath:null,overrideHookStateRenamePath:null,overrideProps:null,overridePropsDeletePath:null,overridePropsRenamePath:null,setErrorHandler:null,setSuspenseHandler:null,scheduleUpdate:null,currentDispatcherRef:P.ReactCurrentDispatcher,findHostInstanceByFiber:function(a){return a=Ic(a),a===null?null:a.stateNode},findFiberByHostInstance:mf.findFiberByHostInstance||nj,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 p0=__REACT_DEVTOOLS_GLOBAL_HOOK__;if(!p0.isDisabled&&p0.supportsFiber)try{vl=p0.inject(ij),Ns=p0}catch{}}return Xr.__SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED=sj,Xr.createPortal=function(a,c){var p=2<arguments.length&&arguments[2]!==void 0?arguments[2]:null;if(!ay(c))throw Error(n(200));return tj(a,c,null,p)},Xr.createRoot=function(a,c){if(!ay(a))throw Error(n(299));var p=!1,y="",C=d8;return c!=null&&(c.unstable_strictMode===!0&&(p=!0),c.identifierPrefix!==void 0&&(y=c.identifierPrefix),c.onRecoverableError!==void 0&&(C=c.onRecoverableError)),c=sy(a,1,!1,null,null,p,!1,y,C),a[fo]=c.current,Qd(a.nodeType===8?a.parentNode:a),new oy(c)},Xr.findDOMNode=function(a){if(a==null)return null;if(a.nodeType===1)return a;var c=a._reactInternals;if(c===void 0)throw typeof a.render=="function"?Error(n(188)):(a=Object.keys(a).join(","),Error(n(268,a)));return a=Ic(c),a=a===null?null:a.stateNode,a},Xr.flushSync=function(a){return Al(a)},Xr.hydrate=function(a,c,p){if(!f0(c))throw Error(n(200));return h0(null,a,c,!0,p)},Xr.hydrateRoot=function(a,c,p){if(!ay(a))throw Error(n(405));var y=p!=null&&p.hydratedSources||null,C=!1,A="",L=d8;if(p!=null&&(p.unstable_strictMode===!0&&(C=!0),p.identifierPrefix!==void 0&&(A=p.identifierPrefix),p.onRecoverableError!==void 0&&(L=p.onRecoverableError)),c=c8(c,null,a,1,p??null,C,!1,A,L),a[fo]=c.current,Qd(a),y)for(a=0;a<y.length;a++)p=y[a],C=p._getVersion,C=C(p._source),c.mutableSourceEagerHydrationData==null?c.mutableSourceEagerHydrationData=[p,C]:c.mutableSourceEagerHydrationData.push(p,C);return new d0(c)},Xr.render=function(a,c,p){if(!f0(c))throw Error(n(200));return h0(null,a,c,!1,p)},Xr.unmountComponentAtNode=function(a){if(!f0(a))throw Error(n(40));return a._reactRootContainer?(Al(function(){h0(null,null,a,!1,function(){a._reactRootContainer=null,a[fo]=null})}),!0):!1},Xr.unstable_batchedUpdates=X1,Xr.unstable_renderSubtreeIntoContainer=function(a,c,p,y){if(!f0(p))throw Error(n(200));if(a==null||a._reactInternals===void 0)throw Error(n(38));return h0(a,c,p,!1,y)},Xr.version="18.3.1-next-f1338f8080-20240426",Xr}var PC;function oM(){if(PC)return t_.exports;PC=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(),t_.exports=eU(),t_.exports}var AC;function tU(){if(AC)return C0;AC=1;var t=oM();return C0.createRoot=t.createRoot,C0.hydrateRoot=t.hydrateRoot,C0}var nU=tU();const rU=$g(nU),jo={BASE_URL:"/",DEV:!1,MODE:"production",PROD:!0,SSR:!1};function aM(t){return"init"in t}function iw(t){return typeof t.write=="function"}function sU(t){return!!t.onMount}function TC(t){return"v"in t||"e"in t}function sg(t){if("e"in t)throw t.e;if((jo?"production":void 0)!=="production"&&!("v"in t))throw new Error("[Bug] atom state is not initialized");return t.v}function ig(t){return typeof(t==null?void 0:t.then)=="function"}function iU(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 lM(t,e,n){if(!n.p.has(t)){n.p.add(t);const r=()=>n.p.delete(t);e.then(r,r)}}function cM(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 oU(t){return!!t.INTERNAL_onInit}const aU=(t,e,n,...r)=>n.read(...r),lU=(t,e,n,...r)=>n.write(...r),cU=(t,e,n)=>n.INTERNAL_onInit(e),uU=(t,e,n,r)=>{var s;return(s=n.onMount)==null?void 0:s.call(n,r)},dU=(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),oU(n)&&l(t,e,n)}return i},fU=(t,e)=>{var n;const r=t[1],s=t[3],i=t[4],o=t[5],l=t[6],u=t[13];if(!l.f&&!s.size&&!i.size&&!o.size)return;const d=[],f=h=>{try{h()}catch(g){d.push(g)}};do{l.f&&f(l.f);const h=new Set;for(const g of s){const v=(n=r.get(g))==null?void 0:n.l;if(v)for(const x of v)h.add(x)}s.clear();for(const g of o)h.add(g);o.clear();for(const g of i)h.add(g);i.clear();for(const g of h)f(g);s.size&&u(t,e)}while(s.size||o.size||i.size);if(d.length)throw new AggregateError(d)},hU=(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 u=[],d=[],f=new WeakSet,h=new WeakSet,g=[],v=[];for(const x of s)g.push(x),v.push(i(t,e,x));for(;g.length;){const x=g.length-1,_=g[x],w=v[x];if(h.has(_)){g.pop(),v.pop();continue}if(f.has(_)){if(r.get(_)===w.n)u.push(_),d.push(w);else if((jo?"production":void 0)!=="production"&&r.has(_))throw new Error("[Bug] invalidated atom exists");h.add(_),g.pop(),v.pop();continue}f.add(_);for(const S of cM(_,w,n))f.has(S)||(g.push(S),v.push(i(t,e,S)))}for(let x=u.length-1;x>=0;--x){const _=u[x],w=d[x];let S=!1;for(const k of w.d.keys())if(k!==_&&s.has(k)){S=!0;break}S&&(r.set(_,w.n),o(t,e,_),l(t,e,_)),r.delete(_)}},ow=new WeakSet,pU=(t,e,n)=>{var r,s;const i=t[1],o=t[2],l=t[3],u=t[6],d=t[7],f=t[11],h=t[12],g=t[13],v=t[14],x=t[16],_=t[17],w=t[20],S=t[26],k=t[28],E=f(t,e,n),P=k[0];if(TC(E)){if(i.has(n)&&o.get(n)!==E.n||E.m===P)return E.m=P,E;let K=!1;for(const[z,X]of E.d)if(v(t,e,z).n!==X){K=!0;break}if(!K)return E.m=P,E}let T=!0;const I=new Set(E.d.keys()),M=()=>{for(const K of I)E.d.delete(K)},R=()=>{if(i.has(n)){const K=!l.size;_(t,e,n),K&&(g(t,e),h(t,e))}},O=K=>{var z;if(K===n){const Z=f(t,e,K);if(!TC(Z))if(aM(K))w(t,e,K,K.init);else throw new Error("no atom init");return sg(Z)}const X=v(t,e,K);try{return sg(X)}finally{I.delete(K),E.d.set(K,X.n),ig(E.v)&&lM(n,E.v,X),i.has(n)&&((z=i.get(K))==null||z.t.add(n)),T||R()}};let D,$;const V={get signal(){return D||(D=new AbortController),D.signal},get setSelf(){return(jo?"production":void 0)!=="production"&&console.warn("[DEPRECATED] setSelf is deprecated and will be removed in v3."),(jo?"production":void 0)!=="production"&&!iw(n)&&console.warn("setSelf function cannot be used with read-only atom"),!$&&iw(n)&&($=(...K)=>{if((jo?"production":void 0)!=="production"&&T&&console.warn("setSelf function cannot be called in sync"),!T)try{return x(t,e,n,K)}finally{g(t,e),h(t,e)}}),$}},q=E.n,B=o.get(n)===q;try{(jo?"production":void 0)!=="production"&&ow.delete(e);const K=d(t,e,n,O,V);if((jo?"production":void 0)!=="production"&&ow.has(e)&&console.warn("Detected store mutation during atom read. This is not supported."),w(t,e,n,K),ig(K)){S(t,e,K,()=>D==null?void 0:D.abort());const z=()=>{M(),R()};K.then(z,z)}else M();return(r=u.r)==null||r.call(u,n),E.m=P,E}catch(K){if(iU(K))throw K;return delete E.v,E.e=K,++E.n,E.m=P,E}finally{T=!1,E.n!==q&&B&&(o.set(n,E.n),l.add(n),(s=u.c)==null||s.call(u,n))}},mU=(t,e,n)=>{const r=t[1],s=t[2],i=t[11],o=[n];for(;o.length;){const l=o.pop(),u=i(t,e,l);for(const d of cM(l,u,r)){const f=i(t,e,d);s.get(d)!==f.n&&(s.set(d,f.n),o.push(d))}}},gU=(t,e,n,r)=>{const s=t[3],i=t[6],o=t[8],l=t[11],u=t[12],d=t[13],f=t[14],h=t[15],g=t[16],v=t[17],x=t[20],_=t[28];let w=!0;const S=E=>sg(f(t,e,E)),k=(E,...P)=>{var T;const I=l(t,e,E);try{if(E===n){if(!aM(E))throw new Error("atom not writable");(jo?"production":void 0)!=="production"&&ow.add(e);const M=I.n,R=P[0];x(t,e,E,R),v(t,e,E),M!==I.n&&(++_[0],s.add(E),h(t,e,E),(T=i.c)==null||T.call(i,E));return}else return g(t,e,E,P)}finally{w||(d(t,e),u(t,e))}};try{return o(t,e,n,S,k,...r)}finally{w=!1}},vU=(t,e,n)=>{var r;const s=t[1],i=t[3],o=t[6],l=t[11],u=t[15],d=t[18],f=t[19],h=l(t,e,n),g=s.get(n);if(g&&h.d.size>0){for(const[v,x]of h.d)if(!g.d.has(v)){const _=l(t,e,v);d(t,e,v).t.add(n),g.d.add(v),x!==_.n&&(i.add(v),u(t,e,v),(r=o.c)==null||r.call(o,v))}for(const v of g.d)if(!h.d.has(v)){g.d.delete(v);const x=f(t,e,v);x==null||x.t.delete(n)}}},yU=(t,e,n)=>{var r;const s=t[1],i=t[4],o=t[6],l=t[10],u=t[11],d=t[12],f=t[13],h=t[14],g=t[16],v=t[18],x=u(t,e,n);let _=s.get(n);if(!_){h(t,e,n);for(const w of x.d.keys())v(t,e,w).t.add(n);if(_={l:new Set,d:new Set(x.d.keys()),t:new Set},s.set(n,_),iw(n)&&sU(n)){const w=()=>{let S=!0;const k=(...E)=>{try{return g(t,e,n,E)}finally{S||(f(t,e),d(t,e))}};try{const E=l(t,e,n,k);E&&(_.u=()=>{S=!0;try{E()}finally{S=!1}})}finally{S=!1}};i.add(w)}(r=o.m)==null||r.call(o,n)}return _},_U=(t,e,n)=>{var r,s;const i=t[1],o=t[5],l=t[6],u=t[11],d=t[19],f=u(t,e,n);let h=i.get(n);if(!h||h.l.size)return h;let g=!1;for(const v of h.t)if((r=i.get(v))!=null&&r.d.has(n)){g=!0;break}if(!g){h.u&&o.add(h.u),h=void 0,i.delete(n);for(const v of f.d.keys()){const x=d(t,e,v);x==null||x.t.delete(n)}(s=l.u)==null||s.call(l,n);return}return h},wU=(t,e,n,r)=>{const s=t[11],i=t[27],o=s(t,e,n),l="v"in o,u=o.v;if(ig(r))for(const d of o.d.keys())lM(n,r,s(t,e,d));o.v=r,delete o.e,(!l||!Object.is(u,o.v))&&(++o.n,ig(u)&&i(t,e,u))},xU=(t,e,n)=>{const r=t[14];return sg(r(t,e,n))},bU=(t,e,n,...r)=>{const s=t[3],i=t[12],o=t[13],l=t[16],u=s.size;try{return l(t,e,n,r)}finally{s.size!==u&&(o(t,e),i(t,e))}},SU=(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)}},kU=(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)},CU=(t,e,n)=>{const s=t[25].get(n);s==null||s.forEach(i=>i())},uM=new WeakMap;function EU(t){const e=uM.get(t);if((jo?"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 PU(...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,{},aU,lU,cU,uU,dU,fU,hU,pU,mU,gU,vU,yU,_U,wU,xU,bU,SU,void 0,new WeakMap,kU,CU,[0]].map((o,l)=>t[l]||o);uM.set(e,Object.freeze(n));const r=n[21],s=n[22],i=n[23];return e}const dM={};let AU=0;function ut(t,e){const n=`atom${++AU}`,r={toString(){return(dM?"production":void 0)!=="production"&&this.debugLabel?n+":"+this.debugLabel:n}};return typeof t=="function"?r.read=t:(r.init=t,r.read=TU,r.write=RU),e&&(r.write=e),r}function TU(t){return t(this)}function RU(t,e,n){return e(this,typeof n=="function"?n(t(this)):n)}function MU(){return PU()}let Pf;function IU(){return Pf||(Pf=MU(),(dM?"production":void 0)!=="production"&&(globalThis.__JOTAI_DEFAULT_STORE__||(globalThis.__JOTAI_DEFAULT_STORE__=Pf),globalThis.__JOTAI_DEFAULT_STORE__!==Pf&&console.warn("Detected multiple Jotai instances. It may cause unexpected behavior with the default store. https://github.com/pmndrs/jotai/discussions/2044"))),Pf}const OU={},LU=m.createContext(void 0);function Zg(t){return m.useContext(LU)||IU()}const aw=t=>typeof(t==null?void 0:t.then)=="function",lw=t=>{t.status||(t.status="pending",t.then(e=>{t.status="fulfilled",t.value=e},e=>{t.status="rejected",t.reason=e}))},NU=xe.use||(t=>{if(t.status==="pending")throw t;if(t.status==="fulfilled")return t.value;throw t.status==="rejected"?t.reason:(lw(t),t)}),s_=new WeakMap,RC=(t,e,n)=>{const r=EU(t),s=r[26];let i=s_.get(e);return i||(i=new Promise((o,l)=>{let u=e;const d=g=>v=>{u===g&&o(v)},f=g=>v=>{u===g&&l(v)},h=()=>{try{const g=n();aw(g)?(s_.set(g,i),u=g,g.then(d(g),f(g)),s(r,t,g,h)):o(g)}catch(g){l(g)}};e.then(d(e),f(e)),s(r,t,e,h)}),s_.set(e,i)),i};function ct(t,e){const{delay:n,unstable_promiseStatus:r=!xe.use}={},s=Zg(),[[i,o,l],u]=m.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)&&(u(),d=s.get(t)),m.useEffect(()=>{const f=s.sub(t,()=>{if(r)try{const h=s.get(t);aw(h)&&lw(RC(s,h,()=>s.get(t)))}catch{}if(typeof n=="number"){console.warn(`[DEPRECATED] delay option is deprecated and will be removed in v3.
|
|
43
|
+
|
|
44
|
+
Migration guide:
|
|
45
|
+
|
|
46
|
+
Create a custom hook like the following.
|
|
47
|
+
|
|
48
|
+
function useAtomValueWithDelay<Value>(
|
|
49
|
+
atom: Atom<Value>,
|
|
50
|
+
options: { delay: number },
|
|
51
|
+
): Value {
|
|
52
|
+
const { delay } = options
|
|
53
|
+
const store = useStore(options)
|
|
54
|
+
const [value, setValue] = useState(() => store.get(atom))
|
|
55
|
+
useEffect(() => {
|
|
56
|
+
const unsub = store.sub(atom, () => {
|
|
57
|
+
setTimeout(() => setValue(store.get(atom)), delay)
|
|
58
|
+
})
|
|
59
|
+
return unsub
|
|
60
|
+
}, [store, atom, delay])
|
|
61
|
+
return value
|
|
62
|
+
}
|
|
63
|
+
`),setTimeout(u,n);return}u()});return u(),f},[s,t,n,r]),m.useDebugValue(d),aw(d)){const f=RC(s,d,()=>s.get(t));return r&&lw(f),NU(f)}return d}function mt(t,e){const n=Zg();return m.useCallback((...s)=>{if((OU?"production":void 0)!=="production"&&!("write"in t))throw new Error("not writable atom");return n.set(t,...s)},[n,t])}function fM(t,e){return[ct(t),mt(t)]}const lb=m.createContext({});function cb(t){const e=m.useRef(null);return e.current===null&&(e.current=t()),e.current}const DU=typeof window<"u",ub=DU?m.useLayoutEffect:m.useEffect,Wg=m.createContext(null);function db(t,e){t.indexOf(e)===-1&&t.push(e)}function og(t,e){const n=t.indexOf(e);n>-1&&t.splice(n,1)}const to=(t,e,n)=>n>e?e:n<t?t:n;let qg=()=>{};const Ka={},hM=t=>/^-?(?:\d+(?:\.\d+)?|\.\d+)$/u.test(t),pM=t=>typeof t=="object"&&t!==null,mM=t=>/^0[^.\s]+$/u.test(t);function gM(t){let e;return()=>(e===void 0&&(e=t()),e)}const Qs=t=>t,ep=(...t)=>t.reduce((e,n)=>r=>n(e(r))),Ch=(t,e,n)=>{const r=e-t;return r?(n-t)/r:1};class fb{constructor(){this.subscriptions=[]}add(e){return db(this.subscriptions,e),()=>og(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 Cs=t=>t*1e3,qs=t=>t/1e3,vM=(t,e)=>e?t*(1e3/e):0,yM=(t,e,n)=>(((1-3*n+3*e)*t+(3*n-6*e))*t+3*e)*t,jU=1e-7,$U=12;function FU(t,e,n,r,s){let i,o,l=0;do o=e+(n-e)/2,i=yM(o,r,s)-t,i>0?n=o:e=o;while(Math.abs(i)>jU&&++l<$U);return o}function tp(t,e,n,r){if(t===e&&n===r)return Qs;const s=i=>FU(i,0,1,t,n);return i=>i===0||i===1?i:yM(s(i),e,r)}const _M=t=>e=>e<=.5?t(2*e)/2:(2-t(2*(1-e)))/2,wM=t=>e=>1-t(1-e),xM=tp(.33,1.53,.69,.99),hb=wM(xM),bM=_M(hb),SM=t=>t>=1?1:(t*=2)<1?.5*hb(t):.5*(2-Math.pow(2,-10*(t-1))),pb=t=>1-Math.sin(Math.acos(t)),kM=wM(pb),CM=_M(pb),VU=tp(.42,0,1,1),HU=tp(0,0,.58,1),EM=tp(.42,0,.58,1),zU=t=>Array.isArray(t)&&typeof t[0]!="number",PM=t=>Array.isArray(t)&&typeof t[0]=="number",UU={linear:Qs,easeIn:VU,easeInOut:EM,easeOut:HU,circIn:pb,circInOut:CM,circOut:kM,backIn:hb,backInOut:bM,backOut:xM,anticipate:SM},BU=t=>typeof t=="string",MC=t=>{if(PM(t)){qg(t.length===4);const[e,n,r,s]=t;return tp(e,n,r,s)}else if(BU(t))return UU[t];return t},E0=["setup","read","resolveKeyframes","preUpdate","update","preRender","render","postRender"];function ZU(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)&&(u.schedule(d),t()),d(o)}const u={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,u.process(d))}};return u}const WU=40;function AM(t,e){let n=!1,r=!0;const s={delta:0,timestamp:0,isProcessing:!1},i=()=>n=!0,o=E0.reduce((E,P)=>(E[P]=ZU(i),E),{}),{setup:l,read:u,resolveKeyframes:d,preUpdate:f,update:h,preRender:g,render:v,postRender:x}=o,_=()=>{const E=Ka.useManualTiming,P=E?s.timestamp:performance.now();n=!1,E||(s.delta=r?1e3/60:Math.max(Math.min(P-s.timestamp,WU),1)),s.timestamp=P,s.isProcessing=!0,l.process(s),u.process(s),d.process(s),f.process(s),h.process(s),g.process(s),v.process(s),x.process(s),s.isProcessing=!1,n&&e&&(r=!1,t(_))},w=()=>{n=!0,r=!0,s.isProcessing||t(_)};return{schedule:E0.reduce((E,P)=>{const T=o[P];return E[P]=(I,M=!1,R=!1)=>(n||w(),T.schedule(I,M,R)),E},{}),cancel:E=>{for(let P=0;P<E0.length;P++)o[E0[P]].cancel(E)},state:s,steps:o}}const{schedule:Qt,cancel:Ya,state:pr,steps:i_}=AM(typeof requestAnimationFrame<"u"?requestAnimationFrame:Qs,!0);let sm;function qU(){sm=void 0}const zr={now:()=>(sm===void 0&&zr.set(pr.isProcessing||Ka.useManualTiming?pr.timestamp:performance.now()),sm),set:t=>{sm=t,queueMicrotask(qU)}},TM=t=>e=>typeof e=="string"&&e.startsWith(t),RM=TM("--"),GU=TM("var(--"),mb=t=>GU(t)?KU.test(t.split("/*")[0].trim()):!1,KU=/var\(--(?:[\w-]+\s*|[\w-]+\s*,(?:\s*[^)(\s]|\s*\((?:[^)(]|\([^)(]*\))*\))+\s*)\)$/iu;function IC(t){return typeof t!="string"?!1:t.split("/*")[0].includes("var(--")}const Rd={test:t=>typeof t=="number",parse:parseFloat,transform:t=>t},Eh={...Rd,transform:t=>to(0,1,t)},P0={...Rd,default:1},Jf=t=>Math.round(t*1e5)/1e5,gb=/-?(?:\d+(?:\.\d+)?|\.\d+)/gu;function YU(t){return t==null}const QU=/^(?:#[\da-f]{3,8}|(?:rgb|hsl)a?\((?:-?[\d.]+%?[,\s]+){2}-?[\d.]+%?\s*(?:[,/]\s*)?(?:\b\d+(?:\.\d+)?|\.\d+)?%?\))$/iu,vb=(t,e)=>n=>!!(typeof n=="string"&&QU.test(n)&&n.startsWith(t)||e&&!YU(n)&&Object.prototype.hasOwnProperty.call(n,e)),MM=(t,e,n)=>r=>{if(typeof r!="string")return r;const[s,i,o,l]=r.match(gb);return{[t]:parseFloat(s),[e]:parseFloat(i),[n]:parseFloat(o),alpha:l!==void 0?parseFloat(l):1}},XU=t=>to(0,255,t),o_={...Rd,transform:t=>Math.round(XU(t))},Ql={test:vb("rgb","red"),parse:MM("red","green","blue"),transform:({red:t,green:e,blue:n,alpha:r=1})=>"rgba("+o_.transform(t)+", "+o_.transform(e)+", "+o_.transform(n)+", "+Jf(Eh.transform(r))+")"};function JU(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 cw={test:vb("#"),parse:JU,transform:Ql.transform},np=t=>({test:e=>typeof e=="string"&&e.endsWith(t)&&e.split(" ").length===1,parse:parseFloat,transform:e=>`${e}${t}`}),To=np("deg"),Qi=np("%"),Ve=np("px"),eB=np("vh"),tB=np("vw"),OC={...Qi,parse:t=>Qi.parse(t)/100,transform:t=>Qi.transform(t*100)},Iu={test:vb("hsl","hue"),parse:MM("hue","saturation","lightness"),transform:({hue:t,saturation:e,lightness:n,alpha:r=1})=>"hsla("+Math.round(t)+", "+Qi.transform(Jf(e))+", "+Qi.transform(Jf(n))+", "+Jf(Eh.transform(r))+")"},Bn={test:t=>Ql.test(t)||cw.test(t)||Iu.test(t),parse:t=>Ql.test(t)?Ql.parse(t):Iu.test(t)?Iu.parse(t):cw.parse(t),transform:t=>typeof t=="string"?t:t.hasOwnProperty("red")?Ql.transform(t):Iu.transform(t),getAnimatableNone:t=>{const e=Bn.parse(t);return e.alpha=0,Bn.transform(e)}},nB=/(?:#[\da-f]{3,8}|(?:rgb|hsl)a?\((?:-?[\d.]+%?[,\s]+){2}-?[\d.]+%?\s*(?:[,/]\s*)?(?:\b\d+(?:\.\d+)?|\.\d+)?%?\))/giu;function rB(t){var e,n;return isNaN(t)&&typeof t=="string"&&(((e=t.match(gb))==null?void 0:e.length)||0)+(((n=t.match(nB))==null?void 0:n.length)||0)>0}const IM="number",OM="color",sB="var",iB="var(",LC="${}",oB=/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 yd(t){const e=t.toString(),n=[],r={color:[],number:[],var:[]},s=[];let i=0;const l=e.replace(oB,u=>(Bn.test(u)?(r.color.push(i),s.push(OM),n.push(Bn.parse(u))):u.startsWith(iB)?(r.var.push(i),s.push(sB),n.push(u)):(r.number.push(i),s.push(IM),n.push(parseFloat(u))),++i,LC)).split(LC);return{values:n,split:l,indexes:r,types:s}}function aB(t){return yd(t).values}function LM({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===IM?s+=Jf(r[i]):o===OM?s+=Bn.transform(r[i]):s+=r[i]}return s}}function lB(t){return LM(yd(t))}const cB=t=>typeof t=="number"?0:Bn.test(t)?Bn.getAnimatableNone(t):t,uB=(t,e)=>typeof t=="number"?e!=null&&e.trim().endsWith("/")?t:0:cB(t);function dB(t){const e=yd(t);return LM(e)(e.values.map((r,s)=>uB(r,e.split[s])))}const bi={test:rB,parse:aB,createTransformer:lB,getAnimatableNone:dB};function a_(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 fB({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,u=2*n-l;s=a_(u,l,t+1/3),i=a_(u,l,t),o=a_(u,l,t-1/3)}return{red:Math.round(s*255),green:Math.round(i*255),blue:Math.round(o*255),alpha:r}}function ag(t,e){return n=>n>0?e:t}const Yt=(t,e,n)=>t+(e-t)*n,l_=(t,e,n)=>{const r=t*t,s=n*(e*e-r)+r;return s<0?0:Math.sqrt(s)},hB=[cw,Ql,Iu],pB=t=>hB.find(e=>e.test(t));function NC(t){const e=pB(t);if(!e)return!1;let n=e.parse(t);return e===Iu&&(n=fB(n)),n}const DC=(t,e)=>{const n=NC(t),r=NC(e);if(!n||!r)return ag(t,e);const s={...n};return i=>(s.red=l_(n.red,r.red,i),s.green=l_(n.green,r.green,i),s.blue=l_(n.blue,r.blue,i),s.alpha=Yt(n.alpha,r.alpha,i),Ql.transform(s))},uw=new Set(["none","hidden"]);function mB(t,e){return uw.has(t)?n=>n<=0?t:e:n=>n>=1?e:t}function gB(t,e){return n=>Yt(t,e,n)}function yb(t){return typeof t=="number"?gB:typeof t=="string"?mb(t)?ag:Bn.test(t)?DC:_B:Array.isArray(t)?NM:typeof t=="object"?Bn.test(t)?DC:vB:ag}function NM(t,e){const n=[...t],r=n.length,s=t.map((i,o)=>yb(i)(i,e[o]));return i=>{for(let o=0;o<r;o++)n[o]=s[o](i);return n}}function vB(t,e){const n={...t,...e},r={};for(const s in n)t[s]!==void 0&&e[s]!==void 0&&(r[s]=yb(t[s])(t[s],e[s]));return s=>{for(const i in r)n[i]=r[i](s);return n}}function yB(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 _B=(t,e)=>{const n=bi.createTransformer(e),r=yd(t),s=yd(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?uw.has(t)&&!s.values.length||uw.has(e)&&!r.values.length?mB(t,e):ep(NM(yB(r,s),s.values),n):ag(t,e)};function DM(t,e,n){return typeof t=="number"&&typeof e=="number"&&typeof n=="number"?Yt(t,e,n):yb(t)(t,e)}const wB=t=>{const e=({timestamp:n})=>t(n);return{start:(n=!0)=>Qt.update(e,n),stop:()=>Ya(e),now:()=>pr.isProcessing?pr.timestamp:zr.now()}},jM=(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)})`},lg=2e4;function _b(t){let e=0;const n=50;let r=t.next(e);for(;!r.done&&e<lg;)e+=n,r=t.next(e);return e>=lg?1/0:e}function xB(t,e=100,n){const r=n({...t,keyframes:[0,e]}),s=Math.min(_b(r),lg);return{type:"keyframes",ease:i=>r.next(s*i).value/e,duration:qs(s)}}const An={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 dw(t,e){return t*Math.sqrt(1-e*e)}const bB=12;function SB(t,e,n){let r=n;for(let s=1;s<bB;s++)r=r-t(r)/e(r);return r}const c_=.001;function kB({duration:t=An.duration,bounce:e=An.bounce,velocity:n=An.velocity,mass:r=An.mass}){let s,i,o=1-e;o=to(An.minDamping,An.maxDamping,o),t=to(An.minDuration,An.maxDuration,qs(t)),o<1?(s=d=>{const f=d*o,h=f*t,g=f-n,v=dw(d,o),x=Math.exp(-h);return c_-g/v*x},i=d=>{const h=d*o*t,g=h*n+n,v=Math.pow(o,2)*Math.pow(d,2)*t,x=Math.exp(-h),_=dw(Math.pow(d,2),o);return(-s(d)+c_>0?-1:1)*((g-v)*x)/_}):(s=d=>{const f=Math.exp(-d*t),h=(d-n)*t+1;return-c_+f*h},i=d=>{const f=Math.exp(-d*t),h=(n-d)*(t*t);return f*h});const l=5/t,u=SB(s,i,l);if(t=Cs(t),isNaN(u))return{stiffness:An.stiffness,damping:An.damping,duration:t};{const d=Math.pow(u,2)*r;return{stiffness:d,damping:o*2*Math.sqrt(r*d),duration:t}}}const CB=["duration","bounce"],EB=["stiffness","damping","mass"];function jC(t,e){return e.some(n=>t[n]!==void 0)}function PB(t){let e={velocity:An.velocity,stiffness:An.stiffness,damping:An.damping,mass:An.mass,isResolvedFromDuration:!1,...t};if(!jC(t,EB)&&jC(t,CB))if(e.velocity=0,t.visualDuration){const n=t.visualDuration,r=2*Math.PI/(n*1.2),s=r*r,i=2*to(.05,1,1-(t.bounce||0))*Math.sqrt(s);e={...e,mass:An.mass,stiffness:s,damping:i}}else{const n=kB({...t,velocity:0});e={...e,...n,mass:An.mass},e.isResolvedFromDuration=!0}return e}function cg(t=An.visualDuration,e=An.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:u,damping:d,mass:f,duration:h,velocity:g,isResolvedFromDuration:v}=PB({...n,velocity:-qs(n.velocity||0)}),x=g||0,_=d/(2*Math.sqrt(u*f)),w=o-i,S=qs(Math.sqrt(u/f)),k=Math.abs(w)<5;r||(r=k?An.restSpeed.granular:An.restSpeed.default),s||(s=k?An.restDelta.granular:An.restDelta.default);let E,P,T,I,M,R;if(_<1)T=dw(S,_),I=(x+_*S*w)/T,E=D=>{const $=Math.exp(-_*S*D);return o-$*(I*Math.sin(T*D)+w*Math.cos(T*D))},M=_*S*I+w*T,R=_*S*w-I*T,P=D=>Math.exp(-_*S*D)*(M*Math.sin(T*D)+R*Math.cos(T*D));else if(_===1){E=$=>o-Math.exp(-S*$)*(w+(x+S*w)*$);const D=x+S*w;P=$=>Math.exp(-S*$)*(S*D*$-x)}else{const D=S*Math.sqrt(_*_-1);E=B=>{const K=Math.exp(-_*S*B),z=Math.min(D*B,300);return o-K*((x+_*S*w)*Math.sinh(z)+D*w*Math.cosh(z))/D};const $=(x+_*S*w)/D,V=_*S*$-w*D,q=_*S*w-$*D;P=B=>{const K=Math.exp(-_*S*B),z=Math.min(D*B,300);return K*(V*Math.sinh(z)+q*Math.cosh(z))}}const O={calculatedDuration:v&&h||null,velocity:D=>Cs(P(D)),next:D=>{if(!v&&_<1){const V=Math.exp(-_*S*D),q=Math.sin(T*D),B=Math.cos(T*D),K=o-V*(I*q+w*B),z=Cs(V*(M*q+R*B));return l.done=Math.abs(z)<=r&&Math.abs(o-K)<=s,l.value=l.done?o:K,l}const $=E(D);if(v)l.done=D>=h;else{const V=Cs(P(D));l.done=Math.abs(V)<=r&&Math.abs(o-$)<=s}return l.value=l.done?o:$,l},toString:()=>{const D=Math.min(_b(O),lg),$=jM(V=>O.next(D*V).value,D,30);return D+"ms "+$},toTransition:()=>{}};return O}cg.applyToOptions=t=>{const e=xB(t,100,cg);return t.ease=e.ease,t.duration=Cs(e.duration),t.type="keyframes",t};const AB=5;function $M(t,e,n){const r=Math.max(e-AB,0);return vM(n-t(r),e-r)}function fw({keyframes:t,velocity:e=0,power:n=.8,timeConstant:r=325,bounceDamping:s=10,bounceStiffness:i=500,modifyTarget:o,min:l,max:u,restDelta:d=.5,restSpeed:f}){const h=t[0],g={done:!1,value:h},v=R=>l!==void 0&&R<l||u!==void 0&&R>u,x=R=>l===void 0?u:u===void 0||Math.abs(l-R)<Math.abs(u-R)?l:u;let _=n*e;const w=h+_,S=o===void 0?w:o(w);S!==w&&(_=S-h);const k=R=>-_*Math.exp(-R/r),E=R=>S+k(R),P=R=>{const O=k(R),D=E(R);g.done=Math.abs(O)<=d,g.value=g.done?S:D};let T,I;const M=R=>{v(g.value)&&(T=R,I=cg({keyframes:[g.value,x(g.value)],velocity:$M(E,R,g.value),damping:s,stiffness:i,restDelta:d,restSpeed:f}))};return M(0),{calculatedDuration:null,next:R=>{let O=!1;return!I&&T===void 0&&(O=!0,P(R),M(R)),T!==void 0&&R>=T?I.next(R-T):(!O&&P(R),g)}}}function TB(t,e,n){const r=[],s=n||Ka.mix||DM,i=t.length-1;for(let o=0;o<i;o++){let l=s(t[o],t[o+1]);if(e){const u=Array.isArray(e)?e[o]||Qs:e;l=ep(u,l)}r.push(l)}return r}function RB(t,e,{clamp:n=!0,ease:r,mixer:s}={}){const i=t.length;if(qg(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=TB(e,r,s),u=l.length,d=f=>{if(o&&f<t[0])return e[0];let h=0;if(u>1)for(;h<t.length-2&&!(f<t[h+1]);h++);const g=Ch(t[h],t[h+1],f);return l[h](g)};return n?f=>d(to(t[0],t[i-1],f)):d}function MB(t,e){const n=t[t.length-1];for(let r=1;r<=e;r++){const s=Ch(0,e,r);t.push(Yt(n,1,s))}}function IB(t){const e=[0];return MB(e,t.length-1),e}function OB(t,e){return t.map(n=>n*e)}function LB(t,e){return t.map(()=>e||EM).splice(0,t.length-1)}function eh({duration:t=300,keyframes:e,times:n,ease:r="easeInOut"}){const s=zU(r)?r.map(MC):MC(r),i={done:!1,value:e[0]},o=OB(n&&n.length===e.length?n:IB(e),t),l=RB(o,e,{ease:Array.isArray(s)?s:LB(e,s)});return{calculatedDuration:t,next:u=>(i.value=l(u),i.done=u>=t,i)}}const NB=t=>t!==null;function Gg(t,{repeat:e,repeatType:n="loop"},r,s=1){const i=t.filter(NB),l=s<0||e&&n!=="loop"&&e%2===1?0:i.length-1;return!l||r===void 0?i[l]:r}const DB={decay:fw,inertia:fw,tween:eh,keyframes:eh,spring:cg};function FM(t){typeof t.type=="string"&&(t.type=DB[t.type])}class wb{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 jB=t=>t/100;class ug extends wb{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!==zr.now()&&this.tick(zr.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;FM(e);const{type:n=eh,repeat:r=0,repeatDelay:s=0,repeatType:i,velocity:o=0}=e;let{keyframes:l}=e;const u=n||eh;u!==eh&&typeof l[0]!="number"&&(this.mixKeyframes=ep(jB,DM(l[0],l[1])),l=[0,100]);const d=u({...e,keyframes:l});i==="mirror"&&(this.mirroredGenerator=u({...e,keyframes:[...l].reverse(),velocity:-o})),d.calculatedDuration===null&&(d.calculatedDuration=_b(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:u}=this;if(this.startTime===null)return r.next(0);const{delay:d=0,keyframes:f,repeat:h,repeatType:g,repeatDelay:v,type:x,onUpdate:_,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 S=this.currentTime-d*(this.playbackSpeed>=0?1:-1),k=this.playbackSpeed>=0?S<0:S>s;this.currentTime=Math.max(S,0),this.state==="finished"&&this.holdTime===null&&(this.currentTime=s);let E=this.currentTime,P=r;if(h){const R=Math.min(this.currentTime,s)/l;let O=Math.floor(R),D=R%1;!D&&R>=1&&(D=1),D===1&&O--,O=Math.min(O,h+1),!!(O%2)&&(g==="reverse"?(D=1-D,v&&(D-=v/l)):g==="mirror"&&(P=o)),E=to(0,1,D)*l}let T;k?(this.delayState.value=f[0],T=this.delayState):T=P.next(E),i&&!k&&(T.value=i(T.value));let{done:I}=T;!k&&u!==null&&(I=this.playbackSpeed>=0?this.currentTime>=s:this.currentTime<=0);const M=this.holdTime===null&&(this.state==="finished"||this.state==="running"&&I);return M&&x!==fw&&(T.value=Gg(f,this.options,w,this.speed)),_&&_(T.value),M&&this.finish(),T}then(e,n){return this.finished.then(e,n)}get duration(){return qs(this.calculatedDuration)}get iterationDuration(){const{delay:e=0}=this.options||{};return this.duration+qs(e)}get time(){return qs(this.currentTime)}set time(e){e=Cs(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 $M(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(zr.now()),this.playbackSpeed=e,n&&this.driver&&(this.time=qs(this.currentTime))}play(){var s,i;if(this.isStopped)return;const{driver:e=wB,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(zr.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 $B(t){for(let e=1;e<t.length;e++)t[e]??(t[e]=t[e-1])}const Xl=t=>t*180/Math.PI,hw=t=>{const e=Xl(Math.atan2(t[1],t[0]));return pw(e)},FB={x:4,y:5,translateX:4,translateY:5,scaleX:0,scaleY:3,scale:t=>(Math.abs(t[0])+Math.abs(t[3]))/2,rotate:hw,rotateZ:hw,skewX:t=>Xl(Math.atan(t[1])),skewY:t=>Xl(Math.atan(t[2])),skew:t=>(Math.abs(t[1])+Math.abs(t[2]))/2},pw=t=>(t=t%360,t<0&&(t+=360),t),$C=hw,FC=t=>Math.sqrt(t[0]*t[0]+t[1]*t[1]),VC=t=>Math.sqrt(t[4]*t[4]+t[5]*t[5]),VB={x:12,y:13,z:14,translateX:12,translateY:13,translateZ:14,scaleX:FC,scaleY:VC,scale:t=>(FC(t)+VC(t))/2,rotateX:t=>pw(Xl(Math.atan2(t[6],t[5]))),rotateY:t=>pw(Xl(Math.atan2(-t[2],t[0]))),rotateZ:$C,rotate:$C,skewX:t=>Xl(Math.atan(t[4])),skewY:t=>Xl(Math.atan(t[1])),skew:t=>(Math.abs(t[1])+Math.abs(t[4]))/2};function mw(t){return t.includes("scale")?1:0}function gw(t,e){if(!t||t==="none")return mw(e);const n=t.match(/^matrix3d\(([-\d.e\s,]+)\)$/u);let r,s;if(n)r=VB,s=n;else{const l=t.match(/^matrix\(([-\d.e\s,]+)\)$/u);r=FB,s=l}if(!s)return mw(e);const i=r[e],o=s[1].split(",").map(zB);return typeof i=="function"?i(o):o[i]}const HB=(t,e)=>{const{transform:n="none"}=getComputedStyle(t);return gw(n,e)};function zB(t){return parseFloat(t.trim())}const Md=["transformPerspective","x","y","z","translateX","translateY","translateZ","scale","scaleX","scaleY","rotate","rotateX","rotateY","rotateZ","skew","skewX","skewY"],Id=new Set([...Md,"pathRotation"]),HC=t=>t===Rd||t===Ve,UB=new Set(["x","y","z"]),BB=Md.filter(t=>!UB.has(t));function ZB(t){const e=[];return BB.forEach(n=>{const r=t.getValue(n);r!==void 0&&(e.push([n,r.get()]),r.set(n.startsWith("scale")?1:0))}),e}const Fa={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})=>gw(e,"x"),y:(t,{transform:e})=>gw(e,"y")};Fa.translateX=Fa.x;Fa.translateY=Fa.y;const hc=new Set;let vw=!1,yw=!1,_w=!1;function VM(){if(yw){const t=Array.from(hc).filter(r=>r.needsMeasurement),e=new Set(t.map(r=>r.element)),n=new Map;e.forEach(r=>{const s=ZB(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)})}yw=!1,vw=!1,hc.forEach(t=>t.complete(_w)),hc.clear()}function HM(){hc.forEach(t=>{t.readKeyframes(),t.needsMeasurement&&(yw=!0)})}function WB(){_w=!0,HM(),VM(),_w=!1}class xb{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?(hc.add(this),vw||(vw=!0,Qt.read(HM),Qt.resolveKeyframes(VM))):(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])}$B(e)}setFinalKeyframe(){}measureInitialState(){}renderEndStyles(){}measureEndState(){}complete(e=!1){this.state="complete",this.onComplete(this.unresolvedKeyframes,this.finalKeyframe,e),hc.delete(this)}cancel(){this.state==="scheduled"&&(hc.delete(this),this.state="pending")}resume(){this.state==="pending"&&this.scheduleResolve()}}const qB=t=>t.startsWith("--");function zM(t,e,n){qB(e)?t.style.setProperty(e,n):t.style[e]=n}const GB={};function UM(t,e){const n=gM(t);return()=>GB[e]??n()}const KB=UM(()=>window.ScrollTimeline!==void 0,"scrollTimeline"),BM=UM(()=>{try{document.createElement("div").animate({opacity:0},{easing:"linear(0, 1)"})}catch{return!1}return!0},"linearEasing"),$f=([t,e,n,r])=>`cubic-bezier(${t}, ${e}, ${n}, ${r})`,zC={linear:"linear",ease:"ease",easeIn:"ease-in",easeOut:"ease-out",easeInOut:"ease-in-out",circIn:$f([0,.65,.55,1]),circOut:$f([.55,0,1,.45]),backIn:$f([.31,.01,.66,-.59]),backOut:$f([.33,1.53,.69,.99])};function ZM(t,e){if(t)return typeof t=="function"?BM()?jM(t,e):"ease-out":PM(t)?$f(t):Array.isArray(t)?t.map(n=>ZM(n,e)||zC.easeOut):zC[t]}function YB(t,e,n,{delay:r=0,duration:s=300,repeat:i=0,repeatType:o="loop",ease:l="easeOut",times:u}={},d=void 0){const f={[e]:n};u&&(f.offset=u);const h=ZM(l,s);Array.isArray(h)&&(f.easing=h);const g={delay:r,duration:s,easing:Array.isArray(h)?"linear":h,fill:"both",iterations:i+1,direction:o==="reverse"?"alternate":"normal"};return d&&(g.pseudoElement=d),t.animate(f,g)}function WM(t){return typeof t=="function"&&"applyToOptions"in t}function QB({type:t,...e}){return WM(t)&&BM()?t.applyToOptions(e):(e.duration??(e.duration=300),e.ease??(e.ease="easeOut"),e)}class qM extends wb{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:u}=e;this.isPseudoElement=!!i,this.allowFlatten=o,this.options=e,qg(typeof e.type!="string");const d=QB(e);this.animation=YB(n,r,s,d,i),d.autoplay===!1&&this.animation.pause(),this.animation.onfinish=()=>{if(this.finishedTime=this.time,!i){const f=Gg(s,this.options,l,this.speed);this.updateMotionValue&&this.updateMotionValue(f),zM(n,r,f),this.animation.cancel()}u==null||u(),this.notifyFinished()}}play(){this.isStopped||(this.manualStartTime=null,this.animation.play(),this.state==="finished"&&this.updateFinished())}pause(){this.animation.pause()}complete(){var 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 qs(Number(e))}get iterationDuration(){const{delay:e=0}=this.options||{};return this.duration+qs(e)}get time(){return qs(Number(this.animation.currentTime)||0)}set time(e){const n=this.finishedTime!==null;this.manualStartTime=null,this.finishedTime=null,this.animation.currentTime=Cs(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&&KB()?(this.animation.timeline=e,n&&(this.animation.rangeStart=n),r&&(this.animation.rangeEnd=r),Qs):s(this)}}const GM={anticipate:SM,backInOut:bM,circInOut:CM};function XB(t){return t in GM}function JB(t){typeof t.ease=="string"&&XB(t.ease)&&(t.ease=GM[t.ease])}const u_=10;class eZ extends qM{constructor(e){JB(e),FM(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 ug({...o,autoplay:!1}),u=Math.max(u_,zr.now()-this.startTime),d=to(0,u_,u-u_),f=l.sample(u).value,{name:h}=this.options;i&&h&&zM(i,h,f),n.setWithVelocity(l.sample(Math.max(0,u-d)).value,f,d),l.stop()}}const UC=(t,e)=>e==="zIndex"?!1:!!(typeof t=="number"||Array.isArray(t)||typeof t=="string"&&(bi.test(t)||t==="0")&&!t.startsWith("url("));function tZ(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 nZ(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=UC(s,e),l=UC(i,e);return!o||!l?!1:tZ(t)||(n==="spring"||WM(n))&&r}function ww(t){t.duration=0,t.type="keyframes"}const KM=new Set(["opacity","clipPath","filter","transform","backgroundColor"]),rZ=/^(?:oklch|oklab|lab|lch|color|color-mix|light-dark)\(/;function sZ(t){for(let e=0;e<t.length;e++)if(typeof t[e]=="string"&&rZ.test(t[e]))return!0;return!1}const iZ=new Set(["color","backgroundColor","outlineColor","fill","stroke","borderColor","borderTopColor","borderRightColor","borderBottomColor","borderLeftColor"]),oZ=gM(()=>Object.hasOwnProperty.call(Element.prototype,"animate"));function aZ(t){var h;const{motionValue:e,name:n,repeatDelay:r,repeatType:s,damping:i,type:o,keyframes:l}=t,u=(h=e==null?void 0:e.owner)==null?void 0:h.current;if(!(u instanceof HTMLElement)&&!(u instanceof SVGElement))return!1;const{onUpdate:d,transformTemplate:f}=e.owner.getProps();return oZ()&&n&&(KM.has(n)||iZ.has(n)&&sZ(l))&&(n!=="transform"||!f)&&!d&&!r&&s!=="mirror"&&i!==0&&o!=="inertia"}const lZ=40;class cZ extends wb{constructor({autoplay:e=!0,delay:n=0,type:r="keyframes",repeat:s=0,repeatDelay:i=0,repeatType:o="loop",keyframes:l,name:u,motionValue:d,element:f,...h}){var x;super(),this.stop=()=>{var _,w;this._animation&&(this._animation.stop(),(_=this.stopTimeline)==null||_.call(this)),(w=this.keyframeResolver)==null||w.cancel()},this.createdAt=zr.now();const g={autoplay:e,delay:n,type:r,repeat:s,repeatDelay:i,repeatType:o,name:u,motionValue:d,element:f,...h},v=(f==null?void 0:f.KeyframeResolver)||xb;this.keyframeResolver=new v(l,(_,w,S)=>this.onKeyframesResolved(_,w,g,!S),u,d,f),(x=this.keyframeResolver)==null||x.scheduleResolve()}onKeyframesResolved(e,n,r,s){var S,k;this.keyframeResolver=void 0;const{name:i,type:o,velocity:l,delay:u,isHandoff:d,onUpdate:f}=r;this.resolvedAt=zr.now();let h=!0;nZ(e,i,o,l)||(h=!1,(Ka.instantAnimations||!u)&&(f==null||f(Gg(e,r,n))),e[0]=e[e.length-1],ww(r),r.repeat=0);const v={startTime:s?this.resolvedAt?this.resolvedAt-this.createdAt>lZ?this.resolvedAt:this.createdAt:this.createdAt:void 0,finalKeyframe:n,...r,keyframes:e},x=h&&!d&&aZ(v),_=(k=(S=v.motionValue)==null?void 0:S.owner)==null?void 0:k.current;let w;if(x)try{w=new eZ({...v,element:_})}catch{w=new ug(v)}else w=new ug(v);w.finished.then(()=>{this.notifyFinished()}).catch(Qs),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(),WB()),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 YM(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 BC=30,uZ=t=>!isNaN(parseFloat(t));class dZ{constructor(e,n={}){this.canTrackVelocity=null,this.events={},this.updateAndNotify=r=>{var i;const s=zr.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=zr.now(),this.canTrackVelocity===null&&e!==void 0&&(this.canTrackVelocity=uZ(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 fb);const r=this.events[e].add(n);return e==="change"?()=>{r(),Qt.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=zr.now();if(!this.canTrackVelocity||this.prevFrameValue===void 0||e-this.updatedAt>BC)return 0;const n=Math.min(this.updatedAt-this.prevUpdatedAt,BC);return vM(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 _d(t,e){return new dZ(t,e)}function QM(t,e){if(t!=null&&t.inherit&&e){const{inherit:n,...r}=t;return{...e,...r}}return t}function bb(t,e){const n=(t==null?void 0:t[e])??(t==null?void 0:t.default)??t;return n!==t?QM(n,t):n}const fZ={type:"spring",stiffness:500,damping:25,restSpeed:10},hZ=t=>({type:"spring",stiffness:550,damping:t===0?2*Math.sqrt(550):30,restSpeed:10}),pZ={type:"keyframes",duration:.8},mZ={type:"keyframes",ease:[.25,.1,.35,1],duration:.3},gZ=(t,{keyframes:e})=>e.length>2?pZ:Id.has(t)?t.startsWith("scale")?hZ(e[1]):fZ:mZ,vZ=new Set(["when","delay","delayChildren","staggerChildren","staggerDirection","repeat","repeatType","repeatDelay","from","elapsed"]);function yZ(t){for(const e in t)if(!vZ.has(e))return!0;return!1}const Sb=(t,e,n,r={},s,i)=>o=>{const l=bb(r,t)||{},u=l.delay||r.delay||0;let{elapsed:d=0}=r;d=d-Cs(u);const f={keyframes:Array.isArray(n)?n:[null,n],ease:"easeOut",velocity:e.getVelocity(),...l,delay:-d,onUpdate:g=>{e.set(g),l.onUpdate&&l.onUpdate(g)},onComplete:()=>{o(),l.onComplete&&l.onComplete()},name:t,motionValue:e,element:i?void 0:s};yZ(l)||Object.assign(f,gZ(t,f)),f.duration&&(f.duration=Cs(f.duration)),f.repeatDelay&&(f.repeatDelay=Cs(f.repeatDelay)),f.from!==void 0&&(f.keyframes[0]=f.from);let h=!1;if((f.type===!1||f.duration===0&&!f.repeatDelay)&&(ww(f),f.delay===0&&(h=!0)),(Ka.instantAnimations||Ka.skipAnimations||s!=null&&s.shouldSkipAnimations||l.skipAnimations)&&(h=!0,ww(f),f.delay=0),f.allowFlatten=!l.type&&!l.ease,h&&!i&&e.get()!==void 0){const g=Gg(f.keyframes,l);if(g!==void 0){Qt.update(()=>{f.onUpdate(g),f.onComplete()});return}}return l.isSync?new ug(f):new cZ(f)},_Z=/^var\(--(?:([\w-]+)|([\w-]+), ?([a-zA-Z\d ()%#.,-]+))\)/u;function wZ(t){const e=_Z.exec(t);if(!e)return[,];const[,n,r,s]=e;return[`--${n??r}`,s]}function XM(t,e,n=1){const[r,s]=wZ(t);if(!r)return;const i=window.getComputedStyle(e).getPropertyValue(r);if(i){const o=i.trim();return hM(o)?parseFloat(o):o}return mb(s)?XM(s,e,n+1):s}function ZC(t){const e=[{},{}];return t==null||t.values.forEach((n,r)=>{e[0][r]=n.get(),e[1][r]=n.getVelocity()}),e}function kb(t,e,n,r){if(typeof e=="function"){const[s,i]=ZC(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]=ZC(r);e=e(n!==void 0?n:t.custom,s,i)}return e}function pc(t,e,n){const r=t.getProps();return kb(r,e,n!==void 0?n:r.custom,t)}const JM=new Set(["width","height","top","left","right","bottom",...Md]),xw=t=>Array.isArray(t);function xZ(t,e,n){t.hasValue(e)?t.getValue(e).set(n):t.addValue(e,_d(n))}function bZ(t){return xw(t)?t[t.length-1]||0:t}function SZ(t,e){const n=pc(t,e);let{transitionEnd:r={},transition:s={},...i}=n||{};i={...i,...r};for(const o in i){const l=bZ(i[o]);xZ(t,o,l)}}const yr=t=>!!(t&&t.getVelocity);function kZ(t){return!!(yr(t)&&t.add)}function bw(t,e){const n=t.getValue("willChange");if(kZ(n))return n.add(e);if(!n&&Ka.WillChange){const r=new Ka.WillChange("auto");t.addValue("willChange",r),r.add(e)}}function Cb(t){return t.replace(/([A-Z])/g,e=>`-${e.toLowerCase()}`)}const CZ="framerAppearId",eI="data-"+Cb(CZ);function tI(t){return t.props[eI]}function EZ({protectedKeys:t,needsAnimating:e},n){const r=t.hasOwnProperty(n)&&e[n]!==!0;return e[n]=!1,r}function nI(t,e,{delay:n=0,transitionOverride:r,type:s}={}){let{transition:i,transitionEnd:o,...l}=e;const u=t.getDefaultTransition();i=i?QM(i,u):u;const d=i==null?void 0:i.reduceMotion,f=i==null?void 0:i.skipAnimations;r&&(i=r);const h=[],g=s&&t.animationState&&t.animationState.getState()[s],v=i==null?void 0:i.path;v&&v.animateVisualElement(t,l,i,n,h);for(const x in l){const _=t.getValue(x,t.latestValues[x]??null),w=l[x];if(w===void 0||g&&EZ(g,x))continue;const S={delay:n,...bb(i||{},x)};f&&(S.skipAnimations=!0);const k=_.get();if(k!==void 0&&!_.isAnimating()&&!Array.isArray(w)&&w===k&&!S.velocity){Qt.update(()=>_.set(w));continue}let E=!1;if(window.MotionHandoffAnimation){const I=tI(t);if(I){const M=window.MotionHandoffAnimation(I,x,Qt);M!==null&&(S.startTime=M,E=!0)}}bw(t,x);const P=d??t.shouldReduceMotion;_.start(Sb(x,_,w,P&&JM.has(x)?{type:!1}:S,t,E));const T=_.animation;T&&h.push(T)}if(o){const x=()=>Qt.update(()=>{o&&SZ(t,o)});h.length?Promise.all(h).then(x):x()}return h}function Sw(t,e,n={}){var u;const r=pc(t,e,n.type==="exit"?(u=t.presenceContext)==null?void 0:u.custom:void 0);let{transition:s=t.getDefaultTransition()||{}}=r||{};n.transitionOverride&&(s=n.transitionOverride);const i=r?()=>Promise.all(nI(t,r,n)):()=>Promise.resolve(),o=t.variantChildren&&t.variantChildren.size?(d=0)=>{const{delayChildren:f=0,staggerChildren:h,staggerDirection:g}=s;return PZ(t,e,d,f,h,g,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 PZ(t,e,n=0,r=0,s=0,i=1,o){const l=[];for(const u of t.variantChildren)u.notify("AnimationStart",e),l.push(Sw(u,e,{...o,delay:n+(typeof r=="function"?0:r)+YM(t.variantChildren,u,r,s,i)}).then(()=>u.notify("AnimationComplete",e)));return Promise.all(l)}function AZ(t,e,n={}){t.notify("AnimationStart",e);let r;if(Array.isArray(e)){const s=e.map(i=>Sw(t,i,n));r=Promise.all(s)}else if(typeof e=="string")r=Sw(t,e,n);else{const s=typeof e=="function"?pc(t,e,n.custom):e;r=Promise.all(nI(t,s,n))}return r.then(()=>{t.notify("AnimationComplete",e)})}const TZ={test:t=>t==="auto",parse:t=>t},rI=t=>e=>e.test(t),sI=[Rd,Ve,Qi,To,tB,eB,TZ],WC=t=>sI.find(rI(t));function RZ(t){return typeof t=="number"?t===0:t!==null?t==="none"||t==="0"||mM(t):!0}const MZ=new Set(["brightness","contrast","saturate","opacity"]);function IZ(t){const[e,n]=t.slice(0,-1).split("(");if(e==="drop-shadow")return t;const[r]=n.match(gb)||[];if(!r)return t;const s=n.replace(r,"");let i=MZ.has(e)?1:0;return r!==n&&(i*=100),e+"("+i+s+")"}const OZ=/\b([a-z-]*)\(.*?\)/gu,kw={...bi,getAnimatableNone:t=>{const e=t.match(OZ);return e?e.map(IZ).join(" "):t}},Cw={...bi,getAnimatableNone:t=>{const e=bi.parse(t);return bi.createTransformer(t)(e.map(r=>typeof r=="number"?0:typeof r=="object"?{...r,alpha:1}:r))}},qC={...Rd,transform:Math.round},LZ={rotate:To,pathRotation:To,rotateX:To,rotateY:To,rotateZ:To,scale:P0,scaleX:P0,scaleY:P0,scaleZ:P0,skew:To,skewX:To,skewY:To,distance:Ve,translateX:Ve,translateY:Ve,translateZ:Ve,x:Ve,y:Ve,z:Ve,perspective:Ve,transformPerspective:Ve,opacity:Eh,originX:OC,originY:OC,originZ:Ve},dg={borderWidth:Ve,borderTopWidth:Ve,borderRightWidth:Ve,borderBottomWidth:Ve,borderLeftWidth:Ve,borderRadius:Ve,borderTopLeftRadius:Ve,borderTopRightRadius:Ve,borderBottomRightRadius:Ve,borderBottomLeftRadius:Ve,width:Ve,maxWidth:Ve,height:Ve,maxHeight:Ve,top:Ve,right:Ve,bottom:Ve,left:Ve,inset:Ve,insetBlock:Ve,insetBlockStart:Ve,insetBlockEnd:Ve,insetInline:Ve,insetInlineStart:Ve,insetInlineEnd:Ve,padding:Ve,paddingTop:Ve,paddingRight:Ve,paddingBottom:Ve,paddingLeft:Ve,paddingBlock:Ve,paddingBlockStart:Ve,paddingBlockEnd:Ve,paddingInline:Ve,paddingInlineStart:Ve,paddingInlineEnd:Ve,margin:Ve,marginTop:Ve,marginRight:Ve,marginBottom:Ve,marginLeft:Ve,marginBlock:Ve,marginBlockStart:Ve,marginBlockEnd:Ve,marginInline:Ve,marginInlineStart:Ve,marginInlineEnd:Ve,fontSize:Ve,backgroundPositionX:Ve,backgroundPositionY:Ve,...LZ,zIndex:qC,fillOpacity:Eh,strokeOpacity:Eh,numOctaves:qC},NZ={...dg,color:Bn,backgroundColor:Bn,outlineColor:Bn,fill:Bn,stroke:Bn,borderColor:Bn,borderTopColor:Bn,borderRightColor:Bn,borderBottomColor:Bn,borderLeftColor:Bn,filter:kw,WebkitFilter:kw,mask:Cw,WebkitMask:Cw},iI=t=>NZ[t],DZ=new Set([kw,Cw]);function oI(t,e){let n=iI(t);return DZ.has(n)||(n=bi),n.getAnimatableNone?n.getAnimatableNone(e):void 0}const jZ=new Set(["auto","none","0"]);function $Z(t,e,n){let r=0,s;for(;r<t.length&&!s;){const i=t[r];typeof i=="string"&&!jZ.has(i)&&yd(i).values.length&&(s=t[r]),r++}if(s&&n)for(const i of e)t[i]=oI(n,s)}class FZ extends xb{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(),mb(h))){const g=XM(h,n.current);g!==void 0&&(e[f]=g),f===e.length-1&&(this.finalKeyframe=h)}}if(this.resolveNoneKeyframes(),!JM.has(r)||e.length!==2)return;const[s,i]=e,o=WC(s),l=WC(i),u=IC(s),d=IC(i);if(u!==d&&Fa[r]){this.needsMeasurement=!0;return}if(o!==l)if(HC(o)&&HC(l))for(let f=0;f<e.length;f++){const h=e[f];typeof h=="string"&&(e[f]=parseFloat(h))}else Fa[r]&&(this.needsMeasurement=!0)}resolveNoneKeyframes(){const{unresolvedKeyframes:e,name:n}=this,r=[];for(let s=0;s<e.length;s++)(e[s]===null||RZ(e[s]))&&r.push(s);r.length&&$Z(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=Fa[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]=Fa[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(([u,d])=>{e.getValue(u).set(d)}),this.resolveNoneKeyframes()}}const Eb=["borderTopLeftRadius","borderTopRightRadius","borderBottomRightRadius","borderBottomLeftRadius"];function aI(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 Ew=(t,e)=>e&&typeof t=="number"?e.transform(t):t;function im(t){return pM(t)&&"offsetHeight"in t&&!("ownerSVGElement"in t)}const{schedule:Pb}=AM(queueMicrotask,!1),mi={x:!1,y:!1};function lI(){return mi.x||mi.y}function VZ(t){return t==="x"||t==="y"?mi[t]?null:(mi[t]=!0,()=>{mi[t]=!1}):mi.x||mi.y?null:(mi.x=mi.y=!0,()=>{mi.x=mi.y=!1})}function cI(t,e){const n=aI(t),r=new AbortController,s={passive:!0,...e,signal:r.signal};return[n,s,()=>r.abort()]}function HZ(t){return!(t.pointerType==="touch"||lI())}function zZ(t,e,n={}){const[r,s,i]=cI(t,n);return r.forEach(o=>{let l=!1,u=!1,d;const f=()=>{o.removeEventListener("pointerleave",x)},h=w=>{d&&(d(w),d=void 0),f()},g=w=>{l=!1,window.removeEventListener("pointerup",g),window.removeEventListener("pointercancel",g),u&&(u=!1,h(w))},v=()=>{l=!0,window.addEventListener("pointerup",g,s),window.addEventListener("pointercancel",g,s)},x=w=>{if(w.pointerType!=="touch"){if(l){u=!0;return}h(w)}},_=w=>{if(!HZ(w))return;u=!1;const S=e(o,w);typeof S=="function"&&(d=S,o.addEventListener("pointerleave",x,s))};o.addEventListener("pointerenter",_,s),o.addEventListener("pointerdown",v,s)}),i}const uI=(t,e)=>e?t===e?!0:uI(t,e.parentElement):!1,Ab=t=>t.pointerType==="mouse"?typeof t.button!="number"||t.button<=0:t.isPrimary!==!1,UZ=new Set(["BUTTON","INPUT","SELECT","TEXTAREA","A"]);function BZ(t){return UZ.has(t.tagName)||t.isContentEditable===!0}const ZZ=new Set(["INPUT","SELECT","TEXTAREA"]);function WZ(t){return ZZ.has(t.tagName)||t.isContentEditable===!0}const om=new WeakSet;function GC(t){return e=>{e.key==="Enter"&&t(e)}}function d_(t,e){t.dispatchEvent(new PointerEvent("pointer"+e,{isPrimary:!0,bubbles:!0}))}const qZ=(t,e)=>{const n=t.currentTarget;if(!n)return;const r=GC(()=>{if(om.has(n))return;d_(n,"down");const s=GC(()=>{d_(n,"up")}),i=()=>d_(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 KC(t){return Ab(t)&&!lI()}const YC=new WeakSet;function GZ(t,e,n={}){const[r,s,i]=cI(t,n),o=l=>{const u=l.currentTarget;if(!KC(l)||YC.has(l))return;om.add(u),n.stopPropagation&&YC.add(l);const d=e(u,l),f={...s,capture:!0},h=(x,_)=>{window.removeEventListener("pointerup",g,f),window.removeEventListener("pointercancel",v,f),om.has(u)&&om.delete(u),KC(x)&&typeof d=="function"&&d(x,{success:_})},g=x=>{h(x,u===window||u===document||n.useGlobalTarget||uI(u,x.target))},v=x=>{h(x,!1)};window.addEventListener("pointerup",g,f),window.addEventListener("pointercancel",v,f)};return r.forEach(l=>{(n.useGlobalTarget?window:l).addEventListener("pointerdown",o,s),im(l)&&(l.addEventListener("focus",d=>qZ(d,s)),!BZ(l)&&!l.hasAttribute("tabindex")&&(l.tabIndex=0))}),i}function Tb(t){return pM(t)&&"ownerSVGElement"in t}const am=new WeakMap;let Ea;const dI=(t,e,n)=>(r,s)=>s&&s[0]?s[0][t+"Size"]:Tb(r)&&"getBBox"in r?r.getBBox()[e]:r[n],KZ=dI("inline","width","offsetWidth"),YZ=dI("block","height","offsetHeight");function QZ({target:t,borderBoxSize:e}){var n;(n=am.get(t))==null||n.forEach(r=>{r(t,{get width(){return KZ(t,e)},get height(){return YZ(t,e)}})})}function XZ(t){t.forEach(QZ)}function JZ(){typeof ResizeObserver>"u"||(Ea=new ResizeObserver(XZ))}function eW(t,e){Ea||JZ();const n=aI(t);return n.forEach(r=>{let s=am.get(r);s||(s=new Set,am.set(r,s)),s.add(e),Ea==null||Ea.observe(r)}),()=>{n.forEach(r=>{const s=am.get(r);s==null||s.delete(e),s!=null&&s.size||Ea==null||Ea.unobserve(r)})}}const lm=new Set;let Ou;function tW(){Ou=()=>{const t={get width(){return window.innerWidth},get height(){return window.innerHeight}};lm.forEach(e=>e(t))},window.addEventListener("resize",Ou)}function nW(t){return lm.add(t),Ou||tW(),()=>{lm.delete(t),!lm.size&&typeof Ou=="function"&&(window.removeEventListener("resize",Ou),Ou=void 0)}}function QC(t,e){return typeof t=="function"?nW(t):eW(t,e)}function rW(t){return Tb(t)&&t.tagName==="svg"}const sW=[...sI,Bn,bi],iW=t=>sW.find(rI(t)),XC=()=>({translate:0,scale:1,origin:0,originPoint:0}),Lu=()=>({x:XC(),y:XC()}),JC=()=>({min:0,max:0}),Xn=()=>({x:JC(),y:JC()}),oW=new WeakMap;function Kg(t){return t!==null&&typeof t=="object"&&typeof t.start=="function"}function Ph(t){return typeof t=="string"||Array.isArray(t)}const Rb=["animate","whileInView","whileFocus","whileHover","whileTap","whileDrag","exit"],Mb=["initial",...Rb];function Yg(t){return Kg(t.animate)||Mb.some(e=>Ph(t[e]))}function fI(t){return!!(Yg(t)||t.variants)}function aW(t,e,n){for(const r in e){const s=e[r],i=n[r];if(yr(s))t.addValue(r,s);else if(yr(i))t.addValue(r,_d(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,_d(o!==void 0?o:s,{owner:t}))}}for(const r in n)e[r]===void 0&&t.removeValue(r);return e}const fg={current:null},Ib={current:!1},lW=typeof window<"u";function hI(){if(Ib.current=!0,!!lW)if(window.matchMedia){const t=window.matchMedia("(prefers-reduced-motion)"),e=()=>fg.current=t.matches;t.addEventListener("change",e),e()}else fg.current=!1}const eE=["AnimationStart","AnimationComplete","Update","BeforeLayoutMeasure","LayoutMeasure","LayoutAnimationStart","LayoutAnimationComplete"];let hg={};function pI(t){hg=t}function cW(){return hg}class uW{scrapeMotionValuesFromProps(e,n,r){return{}}constructor({parent:e,props:n,presenceContext:r,reducedMotionConfig:s,skipAnimations:i,blockInitialAnimation:o,visualState:l},u={}){this.current=null,this.children=new Set,this.isVariantNode=!1,this.isControllingVariants=!1,this.shouldReduceMotion=null,this.shouldSkipAnimations=!1,this.values=new Map,this.KeyframeResolver=xb,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=zr.now();this.renderScheduledAt<v&&(this.renderScheduledAt=v,Qt.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=u,this.blockInitialAnimation=!!o,this.isControllingVariants=Yg(n),this.isVariantNode=fI(n),this.isVariantNode&&(this.variantChildren=new Set),this.manuallyAnimateOnMount=!!(e&&e.current);const{willChange:h,...g}=this.scrapeMotionValuesFromProps(n,{},this);for(const v in g){const x=g[v];d[v]!==void 0&&yr(x)&&x.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,oW.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:(Ib.current||hI(),this.shouldReduceMotion=fg.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(),Ya(this.notifyUpdate),Ya(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&&KM.has(e)&&this.current instanceof HTMLElement){const{factory:o,keyframes:l,times:u,ease:d,duration:f}=n.accelerate,h=new qM({element:this.current,name:e,keyframes:l,times:u,ease:d,duration:Cs(f)}),g=o(h);this.valueSubscriptions.set(e,()=>{g(),h.cancel()});return}const r=Id.has(e);r&&this.onBindTransform&&this.onBindTransform();const s=n.on("change",o=>{this.latestValues[e]=o,this.props.onUpdate&&Qt.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 hg){const n=hg[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):Xn()}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<eE.length;r++){const s=eE[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=aW(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=_d(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"&&(hM(r)||mM(r))?r=parseFloat(r):!iW(r)&&bi.test(n)&&(r=oI(e,n)),this.setBaseTarget(e,yr(r)?r.get():r)),yr(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=kb(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&&!yr(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 fb),this.events[e].add(n)}notify(e,...n){this.events[e]&&this.events[e].notify(...n)}scheduleRenderMicrotask(){Pb.render(this.render)}}class mI extends uW{constructor(){super(...arguments),this.KeyframeResolver=FZ}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;yr(e)&&(this.childSubscription=e.on("change",n=>{this.current&&(this.current.textContent=`${n}`)}))}}class sl{constructor(e){this.isMounted=!1,this.node=e}update(){}}function gI({top:t,left:e,right:n,bottom:r}){return{x:{min:e,max:n},y:{min:t,max:r}}}function dW({x:t,y:e}){return{top:e.min,right:t.max,bottom:e.max,left:t.min}}function fW(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 f_(t){return t===void 0||t===1}function Pw({scale:t,scaleX:e,scaleY:n}){return!f_(t)||!f_(e)||!f_(n)}function Gl(t){return Pw(t)||vI(t)||t.z||t.rotate||t.rotateX||t.rotateY||t.skewX||t.skewY}function vI(t){return tE(t.x)||tE(t.y)}function tE(t){return t&&t!=="0%"}function pg(t,e,n){const r=t-n,s=e*r;return n+s}function nE(t,e,n,r,s){return s!==void 0&&(t=pg(t,s,r)),pg(t,n,r)+e}function Aw(t,e=0,n=1,r,s){t.min=nE(t.min,e,n,r,s),t.max=nE(t.max,e,n,r,s)}function yI(t,{x:e,y:n}){Aw(t.x,e.translate,e.scale,e.originPoint),Aw(t.y,n.translate,n.scale,n.originPoint)}const rE=.999999999999,sE=1.0000000000001;function hW(t,e,n,r=!1){var l;const s=n.length;if(!s)return;e.x=e.y=1;let i,o;for(let u=0;u<s;u++){i=n[u],o=i.projectionDelta;const{visualElement:d}=i.options;d&&d.props.style&&d.props.style.display==="contents"||(r&&i.options.layoutScroll&&i.scroll&&i!==i.root&&(Bi(t.x,-i.scroll.offset.x),Bi(t.y,-i.scroll.offset.y)),o&&(e.x*=o.x.scale,e.y*=o.y.scale,yI(t,o)),r&&Gl(i.latestValues)&&cm(t,i.latestValues,(l=i.layout)==null?void 0:l.layoutBox))}e.x<sE&&e.x>rE&&(e.x=1),e.y<sE&&e.y>rE&&(e.y=1)}function Bi(t,e){t.min+=e,t.max+=e}function iE(t,e,n,r,s=.5){const i=Yt(t.min,t.max,s);Aw(t,e,n,i,r)}function oE(t,e){return typeof t=="string"?parseFloat(t)/100*(e.max-e.min):t}function cm(t,e,n){const r=n??t;iE(t.x,oE(e.x,r.x),e.scaleX,e.scale,e.originX),iE(t.y,oE(e.y,r.y),e.scaleY,e.scale,e.originY)}function _I(t,e){return gI(fW(t.getBoundingClientRect(),e))}function pW(t,e,n){const r=_I(t,n),{scroll:s}=e;return s&&(Bi(r.x,s.offset.x),Bi(r.y,s.offset.y)),r}const mW={x:"translateX",y:"translateY",z:"translateZ",transformPerspective:"perspective"},gW=Md.length;function vW(t,e,n){let r="",s=!0;for(let o=0;o<gW;o++){const l=Md[o],u=t[l];if(u===void 0)continue;let d=!0;if(typeof u=="number")d=u===(l.startsWith("scale")?1:0);else{const f=parseFloat(u);d=l.startsWith("scale")?f===1:f===0}if(!d||n){const f=Ew(u,dg[l]);if(!d){s=!1;const h=mW[l]||l;r+=`${h}(${f}) `}n&&(e[l]=f)}}const i=t.pathRotation;return i&&(s=!1,r+=`rotate(${Ew(i,dg.pathRotation)}) `),r=r.trim(),n?r=n(e,s?"":r):s&&(r="none"),r}function Ob(t,e,n){const{style:r,vars:s,transformOrigin:i}=t;let o=!1,l=!1;for(const u in e){const d=e[u];if(Id.has(u)){o=!0;continue}else if(RM(u)){s[u]=d;continue}else{const f=Ew(d,dg[u]);u.startsWith("origin")?(l=!0,i[u]=f):r[u]=f}}if(e.transform||(o||n?r.transform=vW(e,t.transform,n):r.transform&&(r.transform="none")),l){const{originX:u="50%",originY:d="50%",originZ:f=0}=i;r.transformOrigin=`${u} ${d} ${f}`}}function wI(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 aE(t,e){return e.max===e.min?0:t/(e.max-e.min)*100}const Af={correct:(t,e)=>{if(!e.target)return t;if(typeof t=="string")if(Ve.test(t))t=parseFloat(t);else return t;const n=aE(t,e.target.x),r=aE(t,e.target.y);return`${n}% ${r}%`}},yW={correct:(t,{treeScale:e,projectionDelta:n})=>{const r=t,s=bi.parse(t);if(s.length>5)return r;const i=bi.createTransformer(t),o=typeof s[0]!="number"?1:0,l=n.x.scale*e.x,u=n.y.scale*e.y;s[0+o]/=l,s[1+o]/=u;const d=Yt(l,u,.5);return typeof s[2+o]=="number"&&(s[2+o]/=d),typeof s[3+o]=="number"&&(s[3+o]/=d),i(s)}},Tw={borderRadius:{...Af,applyTo:[...Eb]},borderTopLeftRadius:Af,borderTopRightRadius:Af,borderBottomLeftRadius:Af,borderBottomRightRadius:Af,boxShadow:yW};function xI(t,{layout:e,layoutId:n}){return Id.has(t)||t.startsWith("origin")||(e||n!==void 0)&&(!!Tw[t]||t==="opacity")}function Lb(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)(yr(r[l])||s&&yr(s[l])||xI(l,t)||((o=n==null?void 0:n.getValue(l))==null?void 0:o.liveStyle)!==void 0)&&(i[l]=r[l]);return i}function _W(t){return window.getComputedStyle(t)}class wW extends mI{constructor(){super(...arguments),this.type="html",this.renderInstance=wI}mount(e){qg(!!e.style),super.mount(e)}readValueFromInstance(e,n){var r;if(Id.has(n))return(r=this.projection)!=null&&r.isProjecting?mw(n):HB(e,n);{const s=_W(e),i=(RM(n)?s.getPropertyValue(n):s[n])||0;return typeof i=="string"?i.trim():i}}measureInstanceViewportBox(e,{transformPagePoint:n}){return _I(e,n)}build(e,n,r){Ob(e,n,r.transformTemplate)}scrapeMotionValuesFromProps(e,n,r){return Lb(e,n,r)}}const xW={offset:"stroke-dashoffset",array:"stroke-dasharray"},bW={offset:"strokeDashoffset",array:"strokeDasharray"};function SW(t,e,n=1,r=0,s=!0){t.pathLength=1;const i=s?xW:bW;t[i.offset]=`${-r}`,t[i.array]=`${e} ${n}`}const kW=["offsetDistance","offsetPath","offsetRotate","offsetAnchor"];function bI(t,{attrX:e,attrY:n,attrScale:r,pathLength:s,pathSpacing:i=1,pathOffset:o=0,...l},u,d,f){if(Ob(t,l,d),u){t.style.viewBox&&(t.attrs.viewBox=t.style.viewBox);return}t.attrs=t.style,t.style={};const{attrs:h,style:g}=t;h.transform&&(g.transform=h.transform,delete h.transform),(g.transform||h.transformOrigin)&&(g.transformOrigin=h.transformOrigin??"50% 50%",delete h.transformOrigin),g.transform&&(g.transformBox=(f==null?void 0:f.transformBox)??"fill-box",delete h.transformBox);for(const v of kW)h[v]!==void 0&&(g[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&&SW(h,s,i,o,!1)}const SI=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"]),kI=t=>typeof t=="string"&&t.toLowerCase()==="svg";function CW(t,e,n,r){wI(t,e,void 0,r);for(const s in e.attrs)t.setAttribute(SI.has(s)?s:Cb(s),e.attrs[s])}function CI(t,e,n){const r=Lb(t,e,n);for(const s in t)if(yr(t[s])||yr(e[s])){const i=Md.indexOf(s)!==-1?"attr"+s.charAt(0).toUpperCase()+s.substring(1):s;r[i]=t[s]}return r}class EW extends mI{constructor(){super(...arguments),this.type="svg",this.isSVGTag=!1,this.measureInstanceViewportBox=Xn}getBaseTargetFromProps(e,n){return e[n]}readValueFromInstance(e,n){if(Id.has(n)){const r=iI(n);return r&&r.default||0}return n=SI.has(n)?n:Cb(n),e.getAttribute(n)}scrapeMotionValuesFromProps(e,n,r){return CI(e,n,r)}build(e,n,r){bI(e,n,this.isSVGTag,r.transformTemplate,r.style)}renderInstance(e,n,r,s){CW(e,n,r,s)}mount(e){this.isSVGTag=kI(e.tagName),super.mount(e)}}const PW=Mb.length;function EI(t){if(!t)return;if(!t.isControllingVariants){const n=t.parent?EI(t.parent)||{}:{};return t.props.initial!==void 0&&(n.initial=t.props.initial),n}const e={};for(let n=0;n<PW;n++){const r=Mb[n],s=t.props[r];(Ph(s)||s===!1)&&(e[r]=s)}return e}function PI(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 AW=[...Rb].reverse(),TW=Rb.length;function RW(t){return e=>Promise.all(e.map(({animation:n,options:r})=>AZ(t,n,r)))}function MW(t){let e=RW(t),n=lE(),r=!0,s=!1;const i=d=>(f,h)=>{var v;const g=pc(t,h,d==="exit"?(v=t.presenceContext)==null?void 0:v.custom:void 0);if(g){const{transition:x,transitionEnd:_,...w}=g;f={...f,...w,..._}}return f};function o(d){e=d(t)}function l(d){const{props:f}=t,h=EI(t.parent)||{},g=[],v=new Set;let x={},_=1/0;for(let S=0;S<TW;S++){const k=AW[S],E=n[k],P=f[k]!==void 0?f[k]:h[k],T=Ph(P),I=k===d?E.isActive:null;I===!1&&(_=S);let M=P===h[k]&&P!==f[k]&&T;if(M&&(r||s)&&t.manuallyAnimateOnMount&&(M=!1),E.protectedKeys={...x},!E.isActive&&I===null||!P&&!E.prevProp||Kg(P)||typeof P=="boolean")continue;if(k==="exit"&&E.isActive&&I!==!0){E.prevResolvedValues&&(x={...x,...E.prevResolvedValues});continue}const R=IW(E.prevProp,P);let O=R||k===d&&E.isActive&&!M&&T||S>_&&T,D=!1;const $=Array.isArray(P)?P:[P];let V=$.reduce(i(k),{});I===!1&&(V={});const{prevResolvedValues:q={}}=E,B={...q,...V},K=Z=>{O=!0,v.has(Z)&&(D=!0,v.delete(Z)),E.needsAnimating[Z]=!0;const J=t.getValue(Z);J&&(J.liveStyle=!1)};for(const Z in B){const J=V[Z],H=q[Z];if(x.hasOwnProperty(Z))continue;let N=!1;xw(J)&&xw(H)?N=!PI(J,H)||R:N=J!==H,N?J!=null?K(Z):v.add(Z):J!==void 0&&v.has(Z)?K(Z):E.protectedKeys[Z]=!0}E.prevProp=P,E.prevResolvedValues=V,E.isActive&&(x={...x,...V}),(r||s)&&t.blockInitialAnimation&&(O=!1);const z=M&&R;O&&(!z||D)&&g.push(...$.map(Z=>{const J={type:k};if(typeof Z=="string"&&(r||s)&&!z&&t.manuallyAnimateOnMount&&t.parent){const{parent:H}=t,N=pc(H,Z);if(H.enteringChildren&&N){const{delayChildren:Y}=N.transition||{};J.delay=YM(H.enteringChildren,t,Y)}}return{animation:Z,options:J}}))}if(v.size){const S={};if(typeof f.initial!="boolean"){const k=pc(t,Array.isArray(f.initial)?f.initial[0]:f.initial);k&&k.transition&&(S.transition=k.transition)}v.forEach(k=>{const E=t.getBaseTarget(k),P=t.getValue(k);P&&(P.liveStyle=!0),S[k]=E??null}),g.push({animation:S})}let w=!!g.length;return r&&(f.initial===!1||f.initial===f.animate)&&!t.manuallyAnimateOnMount&&(w=!1),r=!1,s=!1,w?e(g):Promise.resolve()}function u(d,f){var g;if(n[d].isActive===f)return Promise.resolve();(g=t.variantChildren)==null||g.forEach(v=>{var x;return(x=v.animationState)==null?void 0:x.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:u,setAnimateFunction:o,getState:()=>n,reset:()=>{n=lE(),s=!0}}}function IW(t,e){return typeof e=="string"?e!==t:Array.isArray(e)?!PI(e,t):!1}function Dl(t=!1){return{isActive:t,protectedKeys:{},needsAnimating:{},prevResolvedValues:{}}}function lE(){return{animate:Dl(!0),whileInView:Dl(),whileHover:Dl(),whileTap:Dl(),whileDrag:Dl(),whileFocus:Dl(),exit:Dl()}}function Rw(t,e){t.min=e.min,t.max=e.max}function fi(t,e){Rw(t.x,e.x),Rw(t.y,e.y)}function cE(t,e){t.translate=e.translate,t.scale=e.scale,t.originPoint=e.originPoint,t.origin=e.origin}const AI=1e-4,OW=1-AI,LW=1+AI,TI=.01,NW=0-TI,DW=0+TI;function Ur(t){return t.max-t.min}function jW(t,e,n){return Math.abs(t-e)<=n}function uE(t,e,n,r=.5){t.origin=r,t.originPoint=Yt(e.min,e.max,t.origin),t.scale=Ur(n)/Ur(e),t.translate=Yt(n.min,n.max,t.origin)-t.originPoint,(t.scale>=OW&&t.scale<=LW||isNaN(t.scale))&&(t.scale=1),(t.translate>=NW&&t.translate<=DW||isNaN(t.translate))&&(t.translate=0)}function th(t,e,n,r){uE(t.x,e.x,n.x,r?r.originX:void 0),uE(t.y,e.y,n.y,r?r.originY:void 0)}function dE(t,e,n,r=0){const s=r?Yt(n.min,n.max,r):n.min;t.min=s+e.min,t.max=t.min+Ur(e)}function $W(t,e,n,r){dE(t.x,e.x,n.x,r==null?void 0:r.x),dE(t.y,e.y,n.y,r==null?void 0:r.y)}function fE(t,e,n,r=0){const s=r?Yt(n.min,n.max,r):n.min;t.min=e.min-s,t.max=t.min+Ur(e)}function mg(t,e,n,r){fE(t.x,e.x,n.x,r==null?void 0:r.x),fE(t.y,e.y,n.y,r==null?void 0:r.y)}function hE(t,e,n,r,s){return t-=e,t=pg(t,1/n,r),s!==void 0&&(t=pg(t,1/s,r)),t}function FW(t,e=0,n=1,r=.5,s,i=t,o=t){if(Qi.test(e)&&(e=parseFloat(e),e=Yt(o.min,o.max,e/100)-o.min),typeof e!="number")return;let l=Yt(i.min,i.max,r);t===i&&(l-=e),t.min=hE(t.min,e,n,l,s),t.max=hE(t.max,e,n,l,s)}function pE(t,e,[n,r,s],i,o){FW(t,e[n],e[r],e[s],e.scale,i,o)}const VW=["x","scaleX","originX"],HW=["y","scaleY","originY"];function mE(t,e,n,r){pE(t.x,e,VW,n?n.x:void 0,r?r.x:void 0),pE(t.y,e,HW,n?n.y:void 0,r?r.y:void 0)}function gE(t){return t.translate===0&&t.scale===1}function RI(t){return gE(t.x)&&gE(t.y)}function vE(t,e){return t.min===e.min&&t.max===e.max}function zW(t,e){return vE(t.x,e.x)&&vE(t.y,e.y)}function yE(t,e){return Math.round(t.min)===Math.round(e.min)&&Math.round(t.max)===Math.round(e.max)}function MI(t,e){return yE(t.x,e.x)&&yE(t.y,e.y)}function _E(t){return Ur(t.x)/Ur(t.y)}function wE(t,e){return t.translate===e.translate&&t.scale===e.scale&&t.originPoint===e.originPoint}function Fi(t){return[t("x"),t("y")]}function UW(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:g,rotateY:v,skewX:x,skewY:_}=n;d&&(r=`perspective(${d}px) ${r}`),f&&(r+=`rotate(${f}deg) `),h&&(r+=`rotate(${h}deg) `),g&&(r+=`rotateX(${g}deg) `),v&&(r+=`rotateY(${v}deg) `),x&&(r+=`skewX(${x}deg) `),_&&(r+=`skewY(${_}deg) `)}const l=t.x.scale*e.x,u=t.y.scale*e.y;return(l!==1||u!==1)&&(r+=`scale(${l}, ${u})`),r||"none"}const BW=Eb.length,xE=t=>typeof t=="string"?parseFloat(t):t,bE=t=>typeof t=="number"||Ve.test(t);function ZW(t,e,n,r,s,i){s?(t.opacity=Yt(0,n.opacity??1,WW(r)),t.opacityExit=Yt(e.opacity??1,0,qW(r))):i&&(t.opacity=Yt(e.opacity??1,n.opacity??1,r));for(let o=0;o<BW;o++){const l=Eb[o];let u=SE(e,l),d=SE(n,l);if(u===void 0&&d===void 0)continue;u||(u=0),d||(d=0),u===0||d===0||bE(u)===bE(d)?(t[l]=Math.max(Yt(xE(u),xE(d),r),0),(Qi.test(d)||Qi.test(u))&&(t[l]+="%")):t[l]=d}(e.rotate||n.rotate)&&(t.rotate=Yt(e.rotate||0,n.rotate||0,r))}function SE(t,e){return t[e]!==void 0?t[e]:t.borderRadius}const WW=II(0,.5,kM),qW=II(.5,.95,Qs);function II(t,e,n){return r=>r<t?0:r>e?1:n(Ch(t,e,r))}function GW(t,e,n){const r=yr(t)?t:_d(t);return r.start(Sb("",r,e,n)),r.animation}function Ah(t,e,n,r={passive:!0}){return t.addEventListener(e,n,r),()=>t.removeEventListener(e,n,r)}const KW=(t,e)=>t.depth-e.depth;class YW{constructor(){this.children=[],this.isDirty=!1}add(e){db(this.children,e),this.isDirty=!0}remove(e){og(this.children,e),this.isDirty=!0}forEach(e){this.isDirty&&this.children.sort(KW),this.isDirty=!1,this.children.forEach(e)}}function QW(t,e){const n=zr.now(),r=({timestamp:s})=>{const i=s-n;i>=e&&(Ya(r),t(i-e))};return Qt.setup(r,!0),()=>Ya(r)}function um(t){return yr(t)?t.get():t}class XW{constructor(){this.members=[]}add(e){db(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&&(og(this.members,r),r.unmount())}e.scheduleRender()}remove(e){if(og(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 dm={hasAnimatedSinceResize:!0,hasEverUpdated:!1},h_=["","X","Y","Z"],JW=1e3;let eq=0;function p_(t,e,n,r){const{latestValues:s}=e;s[t]&&(n[t]=s[t],e.setStaticValue(t,0),r&&(r[t]=0))}function OI(t){if(t.hasCheckedOptimisedAppear=!0,t.root===t)return;const{visualElement:e}=t.options;if(!e)return;const n=tI(e);if(window.MotionHasOptimisedAnimation(n,"transform")){const{layout:s,layoutId:i}=t.options;window.MotionCancelOptimisedAnimation(n,"transform",Qt,!(s||i))}const{parent:r}=t;r&&!r.hasCheckedOptimisedAppear&&OI(r)}function LI({attachResizeListener:t,defaultParent:e,measureScroll:n,checkIsScrollRoot:r,resetTransform:s}){return class{constructor(o={},l=e==null?void 0:e()){this.id=eq++,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(rq),this.nodes.forEach(cq),this.nodes.forEach(uq),this.nodes.forEach(sq)},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 u=0;u<this.path.length;u++)this.path[u].shouldResetTransform=!0;this.root===this&&(this.nodes=new YW)}addEventListener(o,l){return this.eventHandlers.has(o)||this.eventHandlers.set(o,new fb),this.eventHandlers.get(o).add(l)}notifyListeners(o,...l){const u=this.eventHandlers.get(o);u&&u.notify(...l)}hasListeners(o){return this.eventHandlers.has(o)}mount(o){if(this.instance)return;this.isSVG=Tb(o)&&!rW(o),this.instance=o;const{layoutId:l,layout:u,visualElement:d}=this.options;if(d&&!d.current&&d.mount(o),this.root.nodes.add(this),this.parent&&this.parent.children.add(this),this.root.hasTreeAnimated&&(u||l)&&(this.isLayoutDirty=!0),t){let f,h=0;const g=()=>this.root.updateBlockedByResize=!1;Qt.read(()=>{h=window.innerWidth}),t(o,()=>{const v=window.innerWidth;v!==h&&(h=v,this.root.updateBlockedByResize=!0,f&&f(),f=QW(g,250),dm.hasAnimatedSinceResize&&(dm.hasAnimatedSinceResize=!1,this.nodes.forEach(EE)))})}l&&this.root.registerSharedNode(l,this),this.options.animate!==!1&&d&&(l||u)&&this.addEventListener("didUpdate",({delta:f,hasLayoutChanged:h,hasRelativeLayoutChanged:g,layout:v})=>{if(this.isTreeAnimationBlocked()){this.target=void 0,this.relativeTarget=void 0;return}const x=this.options.transition||d.getDefaultTransition()||mq,{onLayoutAnimationStart:_,onLayoutAnimationComplete:w}=d.getProps(),S=!this.targetLayout||!MI(this.targetLayout,v),k=!h&&g;if(this.options.layoutRoot||this.resumeFrom||k||h&&(S||!this.currentAnimation)){this.resumeFrom&&(this.resumingFrom=this.resumeFrom,this.resumingFrom.resumingFrom=void 0);const E={...bb(x,"layout"),onPlay:_,onComplete:w};(d.shouldReduceMotion||this.options.layoutRoot)&&(E.delay=0,E.type=!1),this.startAnimation(E),this.setAnimationOrigin(f,k,E.path)}else h||EE(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(),Ya(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(dq),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&&OI(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:u}=this.options;if(l===void 0&&!u)return;const d=this.getTransformTemplate();this.prevTransformTemplateValue=d?d(this.latestValues,""):void 0,this.updateSnapshot(),o&&this.notifyListeners("willUpdate")}update(){if(this.updateScheduled=!1,this.isUpdateBlocked()){const u=this.updateBlockedByResize;this.unblockUpdate(),this.updateBlockedByResize=!1,this.clearAllSnapshots(),u&&this.nodes.forEach(oq),this.nodes.forEach(kE);return}if(this.animationId<=this.animationCommitId){this.nodes.forEach(CE);return}this.animationCommitId=this.animationId,this.isUpdating?(this.isUpdating=!1,this.nodes.forEach(aq),this.nodes.forEach(lq),this.nodes.forEach(tq),this.nodes.forEach(nq)):this.nodes.forEach(CE),this.clearAllSnapshots();const l=zr.now();pr.delta=to(0,1e3/60,l-pr.timestamp),pr.timestamp=l,pr.isProcessing=!0,i_.update.process(pr),i_.preRender.process(pr),i_.render.process(pr),pr.isProcessing=!1}didUpdate(){this.updateScheduled||(this.updateScheduled=!0,Pb.read(this.scheduleUpdate))}clearAllSnapshots(){this.nodes.forEach(iq),this.sharedNodes.forEach(fq)}scheduleUpdateProjection(){this.projectionUpdateScheduled||(this.projectionUpdateScheduled=!0,Qt.preRender(this.updateProjection,!1,!0))}scheduleCheckAfterUnmount(){Qt.postRender(()=>{this.isLayoutDirty?this.root.didUpdate():this.root.checkUpdateFailed()})}updateSnapshot(){this.snapshot||!this.instance||(this.snapshot=this.measure(),this.snapshot&&!Ur(this.snapshot.measuredBox.x)&&!Ur(this.snapshot.measuredBox.y)&&(this.snapshot=void 0))}updateLayout(){if(!this.instance||(this.updateScroll(),!(this.options.alwaysMeasureLayout&&this.isLead())&&!this.isLayoutDirty))return;if(this.resumeFrom&&!this.resumeFrom.instance)for(let u=0;u<this.path.length;u++)this.path[u].updateScroll();const o=this.layout;this.layout=this.measure(!1),this.layoutVersion++,this.layoutCorrected||(this.layoutCorrected=Xn()),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 u=r(this.instance);this.scroll={animationId:this.root.animationId,phase:o,isRoot:u,offset:n(this.instance),wasRoot:this.scroll?this.scroll.isRoot:u}}}resetTransform(){if(!s)return;const o=this.isLayoutDirty||this.shouldResetTransform||this.options.alwaysMeasureLayout,l=this.projectionDelta&&!RI(this.projectionDelta),u=this.getTransformTemplate(),d=u?u(this.latestValues,""):void 0,f=d!==this.prevTransformTemplateValue;o&&this.instance&&(l||Gl(this.latestValues)||f)&&(s(this.instance,d),this.shouldResetTransform=!1,this.scheduleRender())}measure(o=!0){const l=this.measurePageBox();let u=this.removeElementScroll(l);return o&&(u=this.removeTransform(u)),gq(u),{animationId:this.root.animationId,measuredBox:l,layoutBox:u,latestValues:{},source:this.id}}measurePageBox(){var d;const{visualElement:o}=this.options;if(!o)return Xn();const l=o.measureViewportBox();if(!(((d=this.scroll)==null?void 0:d.wasRoot)||this.path.some(vq))){const{scroll:f}=this.root;f&&(Bi(l.x,f.offset.x),Bi(l.y,f.offset.y))}return l}removeElementScroll(o){var u;const l=Xn();if(fi(l,o),(u=this.scroll)!=null&&u.wasRoot)return l;for(let d=0;d<this.path.length;d++){const f=this.path[d],{scroll:h,options:g}=f;f!==this.root&&h&&g.layoutScroll&&(h.wasRoot&&fi(l,o),Bi(l.x,h.offset.x),Bi(l.y,h.offset.y))}return l}applyTransform(o,l=!1,u){var f,h;const d=u||Xn();fi(d,o);for(let g=0;g<this.path.length;g++){const v=this.path[g];!l&&v.options.layoutScroll&&v.scroll&&v!==v.root&&(Bi(d.x,-v.scroll.offset.x),Bi(d.y,-v.scroll.offset.y)),Gl(v.latestValues)&&cm(d,v.latestValues,(f=v.layout)==null?void 0:f.layoutBox)}return Gl(this.latestValues)&&cm(d,this.latestValues,(h=this.layout)==null?void 0:h.layoutBox),d}removeTransform(o){var u;const l=Xn();fi(l,o);for(let d=0;d<this.path.length;d++){const f=this.path[d];if(!Gl(f.latestValues))continue;let h;f.instance&&(Pw(f.latestValues)&&f.updateSnapshot(),h=Xn(),fi(h,f.measurePageBox())),mE(l,f.latestValues,(u=f.snapshot)==null?void 0:u.layoutBox,h)}return Gl(this.latestValues)&&mE(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!==pr.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 u=!!this.resumingFrom||this!==l;if(!(o||u&&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=pr.timestamp;const g=this.getClosestProjectingParent();g&&this.linkedParentVersion!==g.layoutVersion&&!g.options.layoutRoot&&this.removeRelativeTarget(),!this.targetDelta&&!this.relativeTarget&&(this.options.layoutAnchor!==!1&&g&&g.layout?this.createRelativeTarget(g,this.layout.layoutBox,g.layout.layoutBox):this.removeRelativeTarget()),!(!this.relativeTarget&&!this.targetDelta)&&(this.target||(this.target=Xn(),this.targetWithTransforms=Xn()),this.relativeTarget&&this.relativeTargetOrigin&&this.relativeParent&&this.relativeParent.target?(this.forceRelativeParentToResolveTarget(),$W(this.target,this.relativeTarget,this.relativeParent.target,this.options.layoutAnchor||void 0)):this.targetDelta?(this.resumingFrom?this.applyTransform(this.layout.layoutBox,!1,this.target):fi(this.target,this.layout.layoutBox),yI(this.target,this.targetDelta)):fi(this.target,this.layout.layoutBox),this.attemptToResolveRelativeTarget&&(this.attemptToResolveRelativeTarget=!1,this.options.layoutAnchor!==!1&&g&&!!g.resumingFrom==!!this.resumingFrom&&!g.options.layoutScroll&&g.target&&this.animationProgress!==1?this.createRelativeTarget(g,this.target,g.target):this.relativeParent=this.relativeTarget=void 0))}getClosestProjectingParent(){if(!(!this.parent||Pw(this.parent.latestValues)||vI(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,u){this.relativeParent=o,this.linkedParentVersion=o.layoutVersion,this.forceRelativeParentToResolveTarget(),this.relativeTarget=Xn(),this.relativeTargetOrigin=Xn(),mg(this.relativeTargetOrigin,l,u,this.options.layoutAnchor||void 0),fi(this.relativeTarget,this.relativeTargetOrigin)}removeRelativeTarget(){this.relativeParent=this.relativeTarget=void 0}calcProjection(){var x;const o=this.getLead(),l=!!this.resumingFrom||this!==o;let u=!0;if((this.isProjectionDirty||(x=this.parent)!=null&&x.isProjectionDirty)&&(u=!1),l&&(this.isSharedProjectionDirty||this.isTransformDirty)&&(u=!1),this.resolvedRelativeTargetAt===pr.timestamp&&(u=!1),u)return;const{layout:d,layoutId:f}=this.options;if(this.isTreeAnimating=!!(this.parent&&this.parent.isTreeAnimating||this.currentAnimation||this.pendingAnimation),this.isTreeAnimating||(this.targetDelta=this.relativeTarget=void 0),!this.layout||!(d||f))return;fi(this.layoutCorrected,this.layout.layoutBox);const h=this.treeScale.x,g=this.treeScale.y;hW(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=Xn());const{target:v}=o;if(!v){this.prevProjectionDelta&&(this.createProjectionDeltas(),this.scheduleRender());return}!this.projectionDelta||!this.prevProjectionDelta?this.createProjectionDeltas():(cE(this.prevProjectionDelta.x,this.projectionDelta.x),cE(this.prevProjectionDelta.y,this.projectionDelta.y)),th(this.projectionDelta,this.layoutCorrected,v,this.latestValues),(this.treeScale.x!==h||this.treeScale.y!==g||!wE(this.projectionDelta.x,this.prevProjectionDelta.x)||!wE(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 u=this.getStack();u&&u.scheduleRender()}this.resumingFrom&&!this.resumingFrom.instance&&(this.resumingFrom=void 0)}createProjectionDeltas(){this.prevProjectionDelta=Lu(),this.projectionDelta=Lu(),this.projectionDeltaWithTransform=Lu()}setAnimationOrigin(o,l=!1,u){const d=this.snapshot,f=d?d.latestValues:{},h={...this.latestValues},g=Lu();(!this.relativeParent||!this.relativeParent.options.layoutRoot)&&(this.relativeTarget=this.relativeTargetOrigin=void 0),this.attemptToResolveRelativeTarget=!l;const v=Xn(),x=d?d.source:void 0,_=this.layout?this.layout.source:void 0,w=x!==_,S=this.getStack(),k=!S||S.members.length<=1,E=!!(w&&!k&&this.options.crossfade===!0&&!this.path.some(pq));this.animationProgress=0;let P;const T=u==null?void 0:u.interpolateProjection(o);this.mixTargetDelta=I=>{const M=I/1e3,R=T==null?void 0:T(M);R?(g.x.translate=R.x,g.x.scale=Yt(o.x.scale,1,M),g.x.origin=o.x.origin,g.x.originPoint=o.x.originPoint,g.y.translate=R.y,g.y.scale=Yt(o.y.scale,1,M),g.y.origin=o.y.origin,g.y.originPoint=o.y.originPoint):(PE(g.x,o.x,M),PE(g.y,o.y,M)),this.setTargetDelta(g),this.relativeTarget&&this.relativeTargetOrigin&&this.layout&&this.relativeParent&&this.relativeParent.layout&&(mg(v,this.layout.layoutBox,this.relativeParent.layout.layoutBox,this.options.layoutAnchor||void 0),hq(this.relativeTarget,this.relativeTargetOrigin,v,M),P&&zW(this.relativeTarget,P)&&(this.isProjectionDirty=!1),P||(P=Xn()),fi(P,this.relativeTarget)),w&&(this.animationValues=h,ZW(h,f,this.latestValues,M,E,k)),R&&R.rotate!==void 0&&(this.animationValues||(this.animationValues=h),this.animationValues.pathRotation=R.rotate),this.root.scheduleUpdateProjection(),this.scheduleRender(),this.animationProgress=M},this.mixTargetDelta(this.options.layoutRoot?1e3:0)}startAnimation(o){var l,u,d;this.notifyListeners("animationStart"),(l=this.currentAnimation)==null||l.stop(),(d=(u=this.resumingFrom)==null?void 0:u.currentAnimation)==null||d.stop(),this.pendingAnimation&&(Ya(this.pendingAnimation),this.pendingAnimation=void 0),this.pendingAnimation=Qt.update(()=>{dm.hasAnimatedSinceResize=!0,this.motionValue||(this.motionValue=_d(0)),this.motionValue.jump(0,!1),this.currentAnimation=GW(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(JW),this.currentAnimation.stop()),this.completeAnimation()}applyTransformsToTarget(){const o=this.getLead();let{targetWithTransforms:l,target:u,layout:d,latestValues:f}=o;if(!(!l||!u||!d)){if(this!==o&&this.layout&&d&&NI(this.options.animationType,this.layout.layoutBox,d.layoutBox)){u=this.target||Xn();const h=Ur(this.layout.layoutBox.x);u.x.min=o.target.x.min,u.x.max=u.x.min+h;const g=Ur(this.layout.layoutBox.y);u.y.min=o.target.y.min,u.y.max=u.y.min+g}fi(l,u),cm(l,f),th(this.projectionDeltaWithTransform,this.layoutCorrected,l,f)}}registerSharedNode(o,l){this.sharedNodes.has(o)||this.sharedNodes.set(o,new XW),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:u}={}){const d=this.getStack();d&&d.promote(this,u),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:u}=o;if((u.z||u.rotate||u.rotateX||u.rotateY||u.rotateZ||u.skewX||u.skewY)&&(l=!0),!l)return;const d={};u.z&&p_("z",o,d,this.animationValues);for(let f=0;f<h_.length;f++)p_(`rotate${h_[f]}`,o,d,this.animationValues),p_(`skew${h_[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 u=this.getTransformTemplate();if(this.needsReset){this.needsReset=!1,o.visibility="",o.opacity="",o.pointerEvents=um(l==null?void 0:l.pointerEvents)||"",o.transform=u?u(this.latestValues,""):"none";return}const d=this.getLead();if(!this.projectionDelta||!this.layout||!d.target){this.options.layoutId&&(o.opacity=this.latestValues.opacity!==void 0?this.latestValues.opacity:1,o.pointerEvents=um(l==null?void 0:l.pointerEvents)||""),this.hasProjected&&!Gl(this.latestValues)&&(o.transform=u?u({},""):"none",this.hasProjected=!1);return}o.visibility="";const f=d.animationValues||d.latestValues;this.applyTransformsToTarget();let h=UW(this.projectionDeltaWithTransform,this.treeScale,f);u&&(h=u(f,h)),o.transform=h;const{x:g,y:v}=this.projectionDelta;o.transformOrigin=`${g.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 x in Tw){if(f[x]===void 0)continue;const{correct:_,applyTo:w,isCSSVariable:S}=Tw[x],k=h==="none"?f[x]:_(f[x],d);if(w){const E=w.length;for(let P=0;P<E;P++)o[w[P]]=k}else S?this.options.visualElement.renderState.vars[x]=k:o[x]=k}this.options.layoutId&&(o.pointerEvents=d===this?um(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(kE),this.root.sharedNodes.clear()}}}function tq(t){t.updateLayout()}function nq(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")Fi(h=>{const g=o?e.measuredBox[h]:e.layoutBox[h],v=Ur(g);g.min=r[h].min,g.max=g.min+v});else if(i==="x"||i==="y"){const h=i==="x"?"y":"x";Rw(o?e.measuredBox[h]:e.layoutBox[h],r[h])}else NI(i,e.layoutBox,r)&&Fi(h=>{const g=o?e.measuredBox[h]:e.layoutBox[h],v=Ur(r[h]);g.max=g.min+v,t.relativeTarget&&!t.currentAnimation&&(t.isProjectionDirty=!0,t.relativeTarget[h].max=t.relativeTarget[h].min+v)});const l=Lu();th(l,r,e.layoutBox);const u=Lu();o?th(u,t.applyTransform(s,!0),e.measuredBox):th(u,r,e.layoutBox);const d=!RI(l);let f=!1;if(!t.resumeFrom){const h=t.getClosestProjectingParent();if(h&&!h.resumeFrom){const{snapshot:g,layout:v}=h;if(g&&v){const x=t.options.layoutAnchor||void 0,_=Xn();mg(_,e.layoutBox,g.layoutBox,x);const w=Xn();mg(w,r,v.layoutBox,x),MI(_,w)||(f=!0),h.options.layoutRoot&&(t.relativeTarget=w,t.relativeTargetOrigin=_,t.relativeParent=h)}}}t.notifyListeners("didUpdate",{layout:r,snapshot:e,delta:u,layoutDelta:l,hasLayoutChanged:d,hasRelativeLayoutChanged:f})}else if(t.isLead()){const{onExitComplete:r}=t.options;r&&r()}t.options.transition=void 0}function rq(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 sq(t){t.isProjectionDirty=t.isSharedProjectionDirty=t.isTransformDirty=!1}function iq(t){t.clearSnapshot()}function kE(t){t.clearMeasurements()}function oq(t){t.isLayoutDirty=!0,t.updateLayout()}function CE(t){t.isLayoutDirty=!1}function aq(t){t.isAnimationBlocked&&t.layout&&!t.isLayoutDirty&&(t.snapshot=t.layout,t.isLayoutDirty=!0)}function lq(t){const{visualElement:e}=t.options;e&&e.getProps().onBeforeLayoutMeasure&&e.notify("BeforeLayoutMeasure"),t.resetTransform()}function EE(t){t.finishAnimation(),t.targetDelta=t.relativeTarget=t.target=void 0,t.isProjectionDirty=!0}function cq(t){t.resolveTargetDelta()}function uq(t){t.calcProjection()}function dq(t){t.resetSkewAndRotation()}function fq(t){t.removeLeadSnapshot()}function PE(t,e,n){t.translate=Yt(e.translate,0,n),t.scale=Yt(e.scale,1,n),t.origin=e.origin,t.originPoint=e.originPoint}function AE(t,e,n,r){t.min=Yt(e.min,n.min,r),t.max=Yt(e.max,n.max,r)}function hq(t,e,n,r){AE(t.x,e.x,n.x,r),AE(t.y,e.y,n.y,r)}function pq(t){return t.animationValues&&t.animationValues.opacityExit!==void 0}const mq={duration:.45,ease:[.4,0,.1,1]},TE=t=>typeof navigator<"u"&&navigator.userAgent&&navigator.userAgent.toLowerCase().includes(t),RE=TE("applewebkit/")&&!TE("chrome/")?Math.round:Qs;function ME(t){t.min=RE(t.min),t.max=RE(t.max)}function gq(t){ME(t.x),ME(t.y)}function NI(t,e,n){return t==="position"||t==="preserve-aspect"&&!jW(_E(e),_E(n),.2)}function vq(t){var e;return t!==t.root&&((e=t.scroll)==null?void 0:e.wasRoot)}const yq=LI({attachResizeListener:(t,e)=>Ah(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}),m_={current:void 0},DI=LI({measureScroll:t=>({x:t.scrollLeft,y:t.scrollTop}),defaultParent:()=>{if(!m_.current){const t=new yq({});t.mount(window),t.setOptions({layoutScroll:!0}),m_.current=t}return m_.current},resetTransform:(t,e)=>{t.style.transform=e!==void 0?e:"none"},checkIsScrollRoot:t=>window.getComputedStyle(t).position==="fixed"}),Nb=m.createContext({transformPagePoint:t=>t,isStatic:!1,reducedMotion:"never"});function IE(t,e){if(typeof t=="function")return t(e);t!=null&&(t.current=e)}function _q(...t){return e=>{let n=!1;const r=t.map(s=>{const i=IE(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():IE(t[s],null)}}}}function wq(...t){return m.useCallback(_q(...t),t)}class xq extends m.Component{getSnapshotBeforeUpdate(e){const n=this.props.childRef.current;if(im(n)&&e.isPresent&&!this.props.isPresent&&this.props.pop!==!1){const r=n.offsetParent,s=im(r)&&r.offsetWidth||0,i=im(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 bq({children:t,isPresent:e,anchorX:n,anchorY:r,root:s,pop:i}){var g;const o=m.useId(),l=m.useRef(null),u=m.useRef({width:0,height:0,top:0,left:0,right:0,bottom:0,direction:"ltr"}),{nonce:d}=m.useContext(Nb),f=i!==!1?((g=t.props)==null?void 0:g.ref)??(t==null?void 0:t.ref):void 0,h=wq(l,f);return m.useInsertionEffect(()=>{const{width:v,height:x,top:_,left:w,right:S,bottom:k,direction:E}=u.current;if(e||i===!1||!l.current||!v||!x)return;const P=E==="rtl",T=n==="left"?P?`right: ${S}`:`left: ${w}`:P?`left: ${w}`:`right: ${S}`,I=r==="bottom"?`bottom: ${k}`:`top: ${_}`;l.current.dataset.motionPopId=o;const M=document.createElement("style");d&&(M.nonce=d);const R=s??document.head;return R.appendChild(M),M.sheet&&M.sheet.insertRule(`
|
|
64
|
+
[data-motion-pop-id="${o}"] {
|
|
65
|
+
position: absolute !important;
|
|
66
|
+
width: ${v}px !important;
|
|
67
|
+
height: ${x}px !important;
|
|
68
|
+
${T}px !important;
|
|
69
|
+
${I}px !important;
|
|
70
|
+
}
|
|
71
|
+
`),()=>{var O;(O=l.current)==null||O.removeAttribute("data-motion-pop-id"),R.contains(M)&&R.removeChild(M)}},[e]),b.jsx(xq,{isPresent:e,childRef:l,sizeRef:u,pop:i,children:i===!1?t:m.cloneElement(t,{ref:h})})}const Sq=({children:t,initial:e,isPresent:n,onExitComplete:r,custom:s,presenceAffectsLayout:i,mode:o,anchorX:l,anchorY:u,root:d})=>{const f=cb(kq),h=m.useId(),g=m.useRef(n),v=m.useRef(r);ub(()=>{g.current=n,v.current=r});let x=!0,_=m.useMemo(()=>(x=!1,{id:h,initial:e,isPresent:n,custom:s,onExitComplete:w=>{f.set(w,!0);for(const S of f.values())if(!S)return;r&&r()},register:w=>(f.set(w,!1),()=>{var S;f.delete(w),!g.current&&!f.size&&((S=v.current)==null||S.call(v))})}),[n,f,r]);return i&&x&&(_={..._}),m.useMemo(()=>{f.forEach((w,S)=>f.set(S,!1))},[n]),m.useEffect(()=>{!n&&!f.size&&r&&r()},[n]),t=b.jsx(bq,{pop:o==="popLayout",isPresent:n,anchorX:l,anchorY:u,root:d,children:t}),b.jsx(Wg.Provider,{value:_,children:t})};function kq(){return new Map}function jI(t=!0){const e=m.useContext(Wg);if(e===null)return[!0,null];const{isPresent:n,onExitComplete:r,register:s}=e,i=m.useId();m.useEffect(()=>{if(t)return s(i)},[t]);const o=m.useCallback(()=>t&&r&&r(i),[i,r,t]);return!n&&r?[!1,o]:[!0]}const A0=t=>t.key||"";function OE(t){const e=[];return m.Children.forEach(t,n=>{m.isValidElement(n)&&e.push(n)}),e}const Es=({children:t,custom:e,initial:n=!0,onExitComplete:r,presenceAffectsLayout:s=!0,mode:i="sync",propagate:o=!1,anchorX:l="left",anchorY:u="top",root:d})=>{const[f,h]=jI(o),g=m.useMemo(()=>OE(t),[t]),v=o&&!f?[]:g.map(A0),x=m.useRef(!0),_=m.useRef(g),w=cb(()=>new Map),S=m.useRef(new Set),[k,E]=m.useState(g),[P,T]=m.useState(g);ub(()=>{x.current=!1,_.current=g;for(let R=0;R<P.length;R++){const O=A0(P[R]);v.includes(O)?(w.delete(O),S.current.delete(O)):w.get(O)!==!0&&w.set(O,!1)}},[P,v.length,v.join("-")]);const I=[];if(g!==k){let R=[...g];for(let O=0;O<P.length;O++){const D=P[O],$=A0(D);v.includes($)||(R.splice(O,0,D),I.push(D))}return i==="wait"&&I.length&&(R=I),T(OE(R)),E(g),null}const{forceRender:M}=m.useContext(lb);return b.jsx(b.Fragment,{children:P.map(R=>{const O=A0(R),D=o&&!f?!1:g===P||v.includes(O),$=()=>{if(S.current.has(O))return;if(w.has(O))S.current.add(O),w.set(O,!0);else return;let V=!0;w.forEach(q=>{q||(V=!1)}),V&&(M==null||M(),T(_.current),o&&(h==null||h()),r&&r())};return b.jsx(Sq,{isPresent:D,initial:!x.current||n?void 0:!1,custom:e,presenceAffectsLayout:s,mode:i,root:d,onExitComplete:D?void 0:$,anchorX:l,anchorY:u,children:R},O)})})},$I=m.createContext({strict:!1}),LE={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 NE=!1;function Cq(){if(NE)return;const t={};for(const e in LE)t[e]={isEnabled:n=>LE[e].some(r=>!!n[r])};pI(t),NE=!0}function FI(){return Cq(),cW()}function Eq(t){const e=FI();for(const n in t)e[n]={...e[n],...t[n]};pI(e)}const Pq=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 gg(t){return t.startsWith("while")||t.startsWith("drag")&&t!=="draggable"||t.startsWith("layout")||t.startsWith("onTap")||t.startsWith("onPan")||t.startsWith("onLayout")||Pq.has(t)}let VI=t=>!gg(t);function Aq(t){typeof t=="function"&&(VI=e=>e.startsWith("on")?!gg(e):t(e))}try{Aq(require("@emotion/is-prop-valid").default)}catch{}function Tq(t,e,n){const r={};for(const s in t)s==="values"&&typeof t.values=="object"||yr(t[s])||(VI(s)||n===!0&&gg(s)||!e&&!gg(s)||t.draggable&&s.startsWith("onDrag"))&&(r[s]=t[s]);return r}const Qg=m.createContext({});function Rq(t,e){if(Yg(t)){const{initial:n,animate:r}=t;return{initial:n===!1||Ph(n)?n:void 0,animate:Ph(r)?r:void 0}}return t.inherit!==!1?e:{}}function Mq(t){const{initial:e,animate:n}=Rq(t,m.useContext(Qg));return m.useMemo(()=>({initial:e,animate:n}),[DE(e),DE(n)])}function DE(t){return Array.isArray(t)?t.join(" "):t}const Db=()=>({style:{},transform:{},transformOrigin:{},vars:{}});function HI(t,e,n){for(const r in e)!yr(e[r])&&!xI(r,n)&&(t[r]=e[r])}function Iq({transformTemplate:t},e){return m.useMemo(()=>{const n=Db();return Ob(n,e,t),Object.assign({},n.vars,n.style)},[e])}function Oq(t,e){const n=t.style||{},r={};return HI(r,n,t),Object.assign(r,Iq(t,e)),r}function Lq(t,e){const n={},r=Oq(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 zI=()=>({...Db(),attrs:{}});function Nq(t,e,n,r){const s=m.useMemo(()=>{const i=zI();return bI(i,e,kI(r),t.transformTemplate,t.style),{...i.attrs,style:{...i.style}}},[e]);if(t.style){const i={};HI(i,t.style,t),s.style={...i,...s.style}}return s}const Dq=["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 jb(t){return typeof t!="string"||t.includes("-")?!1:!!(Dq.indexOf(t)>-1||/[A-Z]/u.test(t))}function jq(t,e,n,{latestValues:r},s,i=!1,o){const u=(o??jb(t)?Nq:Lq)(e,r,s,t),d=Tq(e,typeof t=="string",i),f=t!==m.Fragment?{...d,...u,ref:n}:{},{children:h}=e,g=m.useMemo(()=>yr(h)?h.get():h,[h]);return m.createElement(t,{...f,children:g})}function $q({scrapeMotionValuesFromProps:t,createRenderState:e},n,r,s){return{latestValues:Fq(n,r,s,t),renderState:e()}}function Fq(t,e,n,r){const s={},i=r(t,{});for(const g in i)s[g]=um(i[g]);let{initial:o,animate:l}=t;const u=Yg(t),d=fI(t);e&&d&&!u&&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"&&!Kg(h)){const g=Array.isArray(h)?h:[h];for(let v=0;v<g.length;v++){const x=kb(t,g[v]);if(x){const{transitionEnd:_,transition:w,...S}=x;for(const k in S){let E=S[k];if(Array.isArray(E)){const P=f?E.length-1:0;E=E[P]}E!==null&&(s[k]=E)}for(const k in _)s[k]=_[k]}}}return s}const UI=t=>(e,n)=>{const r=m.useContext(Qg),s=m.useContext(Wg),i=()=>$q(t,e,r,s);return n?i():cb(i)},Vq=UI({scrapeMotionValuesFromProps:Lb,createRenderState:Db}),Hq=UI({scrapeMotionValuesFromProps:CI,createRenderState:zI}),zq=Symbol.for("motionComponentSymbol");function Uq(t,e,n){const r=m.useRef(n);m.useInsertionEffect(()=>{r.current=n});const s=m.useRef(null);return m.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 u=o(i);typeof u=="function"&&(s.current=u)}else s.current?(s.current(),s.current=null):o(i);else o&&(o.current=i)},[e])}const BI=m.createContext({});function Eu(t){return t&&typeof t=="object"&&Object.prototype.hasOwnProperty.call(t,"current")}function Bq(t,e,n,r,s,i){var E,P;const{visualElement:o}=m.useContext(Qg),l=m.useContext($I),u=m.useContext(Wg),d=m.useContext(Nb),f=d.reducedMotion,h=d.skipAnimations,g=m.useRef(null),v=m.useRef(!1);r=r||l.renderer,!g.current&&r&&(g.current=r(t,{visualState:e,parent:o,props:n,presenceContext:u,blockInitialAnimation:u?u.initial===!1:!1,reducedMotionConfig:f,skipAnimations:h,isSVG:i}),v.current&&g.current&&(g.current.manuallyAnimateOnMount=!0));const x=g.current,_=m.useContext(BI);x&&!x.projection&&s&&(x.type==="html"||x.type==="svg")&&Zq(g.current,n,s,_);const w=m.useRef(!1);m.useInsertionEffect(()=>{x&&w.current&&x.update(n,u)});const S=n[eI],k=m.useRef(!!S&&typeof window<"u"&&!((E=window.MotionHandoffIsComplete)!=null&&E.call(window,S))&&((P=window.MotionHasOptimisedAnimation)==null?void 0:P.call(window,S)));return ub(()=>{v.current=!0,x&&(w.current=!0,window.MotionIsMounted=!0,x.updateFeatures(),x.scheduleRenderMicrotask(),k.current&&x.animationState&&x.animationState.animateChanges())}),m.useEffect(()=>{x&&(!k.current&&x.animationState&&x.animationState.animateChanges(),k.current&&(queueMicrotask(()=>{var T;(T=window.MotionHandoffMarkAsComplete)==null||T.call(window,S)}),k.current=!1),x.enteringChildren=void 0)}),x}function Zq(t,e,n,r){const{layoutId:s,layout:i,drag:o,dragConstraints:l,layoutScroll:u,layoutRoot:d,layoutAnchor:f,layoutCrossfade:h}=e;t.projection=new n(t.latestValues,e["data-framer-portal-id"]?void 0:ZI(t.parent)),t.projection.setOptions({layoutId:s,layout:i,alwaysMeasureLayout:!!o||l&&Eu(l),visualElement:t,animationType:typeof i=="string"?i:"both",initialPromotionConfig:r,crossfade:h,layoutScroll:u,layoutRoot:d,layoutAnchor:f})}function ZI(t){if(t)return t.options.allowProjection!==!1?t.projection:ZI(t.parent)}function g_(t,{forwardMotionProps:e=!1,type:n}={},r,s){r&&Eq(r);const i=n?n==="svg":jb(t),o=i?Hq:Vq;function l(d,f){let h;const g={...m.useContext(Nb),...d,layoutId:Wq(d)},{isStatic:v}=g,x=Mq(d),_=o(d,v);if(!v&&typeof window<"u"){qq();const w=Gq(g);h=w.MeasureLayout,x.visualElement=Bq(t,_,g,s,w.ProjectionNode,i)}return b.jsxs(Qg.Provider,{value:x,children:[h&&x.visualElement?b.jsx(h,{visualElement:x.visualElement,...g}):null,jq(t,d,Uq(_,x.visualElement,f),_,v,e,i)]})}l.displayName=`motion.${typeof t=="string"?t:`create(${t.displayName??t.name??""})`}`;const u=m.forwardRef(l);return u[zq]=t,u}function Wq({layoutId:t}){const e=m.useContext(lb).id;return e&&t!==void 0?e+"-"+t:t}function qq(t,e){m.useContext($I).strict}function Gq(t){const e=FI(),{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 Kq(t,e){if(typeof Proxy>"u")return g_;const n=new Map,r=(i,o)=>g_(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,g_(o,void 0,t,e)),n.get(o))})}const Yq=(t,e)=>e.isSVG??jb(t)?new EW(e):new wW(e,{allowProjection:t!==m.Fragment});class Qq extends sl{constructor(e){super(e),e.animationState||(e.animationState=MW(e))}updateAnimationControlsSubscription(){const{animate:e}=this.node.getProps();Kg(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 Xq=0;class Jq extends sl{constructor(){super(...arguments),this.id=Xq++,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 u=pc(this.node,o,l);if(u){const{transition:d,transitionEnd:f,...h}=u;for(const g in h)(i=this.node.getValue(g))==null||i.jump(h[g])}}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 eG={animation:{Feature:Qq},exit:{Feature:Jq}};function rp(t){return{point:{x:t.pageX,y:t.pageY}}}const tG=t=>e=>Ab(e)&&t(e,rp(e));function nh(t,e,n,r){return Ah(t,e,tG(n),r)}const WI=({current:t})=>t?t.ownerDocument.defaultView:null,jE=(t,e)=>Math.abs(t-e);function nG(t,e){const n=jE(t.x,e.x),r=jE(t.y,e.y);return Math.sqrt(n**2+r**2)}const $E=new Set(["auto","scroll"]);class qI{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=x=>{this.handleScroll(x.target)},this.onWindowScroll=()=>{this.handleScroll(window)},this.updatePoint=()=>{if(!(this.lastMoveEvent&&this.lastMoveEventInfo))return;this.lastRawMoveEventInfo&&(this.lastMoveEventInfo=T0(this.lastRawMoveEventInfo,this.transformPagePoint));const x=v_(this.lastMoveEventInfo,this.history),_=this.startEvent!==null,w=nG(x.offset,{x:0,y:0})>=this.distanceThreshold;if(!_&&!w)return;const{point:S}=x,{timestamp:k}=pr;this.history.push({...S,timestamp:k});const{onStart:E,onMove:P}=this.handlers;_||(E&&E(this.lastMoveEvent,x),this.startEvent=this.lastMoveEvent),P&&P(this.lastMoveEvent,x)},this.handlePointerMove=(x,_)=>{this.lastMoveEvent=x,this.lastRawMoveEventInfo=_,this.lastMoveEventInfo=T0(_,this.transformPagePoint),Qt.update(this.updatePoint,!0)},this.handlePointerUp=(x,_)=>{this.end();const{onEnd:w,onSessionEnd:S,resumeAnimation:k}=this.handlers;if((this.dragSnapToOrigin||!this.startEvent)&&k&&k(),!(this.lastMoveEvent&&this.lastMoveEventInfo))return;const E=v_(x.type==="pointercancel"?this.lastMoveEventInfo:T0(_,this.transformPagePoint),this.history);this.startEvent&&w&&w(x,E),S&&S(x,E)},!Ab(e))return;this.dragSnapToOrigin=i,this.handlers=n,this.transformPagePoint=r,this.distanceThreshold=o,this.contextWindow=s||window;const u=rp(e),d=T0(u,this.transformPagePoint),{point:f}=d,{timestamp:h}=pr;this.history=[{...f,timestamp:h}];const{onSessionStart:g}=n;g&&g(e,v_(d,this.history));const v={passive:!0,capture:!0};this.removeListeners=ep(nh(this.contextWindow,"pointermove",this.handlePointerMove,v),nh(this.contextWindow,"pointerup",this.handlePointerUp,v),nh(this.contextWindow,"pointercancel",this.handlePointerUp,v)),l&&this.startScrollTracking(l)}startScrollTracking(e){let n=e.parentElement;for(;n;){const r=getComputedStyle(n);($E.has(r.overflowX)||$E.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),Qt.update(this.updatePoint,!0))}updateHandlers(e){this.handlers=e}end(){this.removeListeners&&this.removeListeners(),this.removeScrollListeners&&this.removeScrollListeners(),this.scrollPositions.clear(),Ya(this.updatePoint)}}function T0(t,e){return e?{point:e(t.point)}:t}function FE(t,e){return{x:t.x-e.x,y:t.y-e.y}}function v_({point:t},e){return{point:t,delta:FE(t,GI(e)),offset:FE(t,rG(e)),velocity:sG(e,.1)}}function rG(t){return t[0]}function GI(t){return t[t.length-1]}function sG(t,e){if(t.length<2)return{x:0,y:0};let n=t.length-1,r=null;const s=GI(t);for(;n>=0&&(r=t[n],!(s.timestamp-r.timestamp>Cs(e)));)n--;if(!r)return{x:0,y:0};r===t[0]&&t.length>2&&s.timestamp-r.timestamp>Cs(e)*2&&(r=t[1]);const i=qs(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 iG(t,{min:e,max:n},r){return e!==void 0&&t<e?t=r?Yt(e,t,r.min):Math.max(t,e):n!==void 0&&t>n&&(t=r?Yt(n,t,r.max):Math.min(t,n)),t}function VE(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 oG(t,{top:e,left:n,bottom:r,right:s}){return{x:VE(t.x,n,s),y:VE(t.y,e,r)}}function HE(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 aG(t,e){return{x:HE(t.x,e.x),y:HE(t.y,e.y)}}function lG(t,e){let n=.5;const r=Ur(t),s=Ur(e);return s>r?n=Ch(e.min,e.max-r,t.min):r>s&&(n=Ch(t.min,t.max-s,e.min)),to(0,1,n)}function cG(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 Mw=.35;function uG(t=Mw){return t===!1?t=0:t===!0&&(t=Mw),{x:zE(t,"left","right"),y:zE(t,"top","bottom")}}function zE(t,e,n){return{min:UE(t,e),max:UE(t,n)}}function UE(t,e){return typeof t=="number"?t:t[e]||0}const dG=new WeakMap;class fG{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=Xn(),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(rp(h).point),this.stopAnimation()},o=(h,g)=>{const{drag:v,dragPropagation:x,onDragStart:_}=this.getProps();if(v&&!x&&(this.openDragLock&&this.openDragLock(),this.openDragLock=VZ(v),!this.openDragLock))return;this.latestPointerEvent=h,this.latestPanInfo=g,this.isDragging=!0,this.currentDirection=null,this.resolveConstraints(),this.visualElement.projection&&(this.visualElement.projection.isAnimationBlocked=!0,this.visualElement.projection.target=void 0),Fi(S=>{let k=this.getAxisMotionValue(S).get()||0;if(Qi.test(k)){const{projection:E}=this.visualElement;if(E&&E.layout){const P=E.layout.layoutBox[S];P&&(k=Ur(P)*(parseFloat(k)/100))}}this.originPoint[S]=k}),_&&Qt.update(()=>_(h,g),!1,!0),bw(this.visualElement,"transform");const{animationState:w}=this.visualElement;w&&w.setActive("whileDrag",!0)},l=(h,g)=>{this.latestPointerEvent=h,this.latestPanInfo=g;const{dragPropagation:v,dragDirectionLock:x,onDirectionLock:_,onDrag:w}=this.getProps();if(!v&&!this.openDragLock)return;const{offset:S}=g;if(x&&this.currentDirection===null){this.currentDirection=pG(S),this.currentDirection!==null&&_&&_(this.currentDirection);return}this.updateAxis("x",g.point,S),this.updateAxis("y",g.point,S),this.visualElement.render(),w&&Qt.update(()=>w(h,g),!1,!0)},u=(h,g)=>{this.latestPointerEvent=h,this.latestPanInfo=g,this.stop(h,g),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 qI(e,{onSessionStart:i,onStart:o,onMove:l,onSessionEnd:u,resumeAnimation:d},{transformPagePoint:this.visualElement.getTransformPagePoint(),dragSnapToOrigin:f,distanceThreshold:r,contextWindow:WI(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&&Qt.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||!R0(e,s,this.currentDirection))return;const i=this.getAxisMotionValue(e);let o=this.originPoint[e]+r[e];this.constraints&&this.constraints[e]&&(o=iG(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&&Eu(e)?this.constraints||(this.constraints=this.resolveRefConstraints()):e&&r?this.constraints=oG(r.layoutBox,e):this.constraints=!1,this.elastic=uG(n),s!==this.constraints&&!Eu(e)&&r&&this.constraints&&!this.hasMutatedConstraints&&Fi(o=>{this.constraints!==!1&&this.getAxisMotionValue(o)&&(this.constraints[o]=cG(r.layoutBox[o],this.constraints[o]))})}resolveRefConstraints(){const{dragConstraints:e,onMeasureDragConstraints:n}=this.getProps();if(!e||!Eu(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=pW(r,s.root,this.visualElement.getTransformPagePoint());let o=aG(s.layout.layoutBox,i);if(n){const l=n(dW(o));this.hasMutatedConstraints=!!l,l&&(o=gI(l))}return o}startAnimation(e){const{drag:n,dragMomentum:r,dragElastic:s,dragTransition:i,dragSnapToOrigin:o,onDragTransitionEnd:l}=this.getProps(),u=this.constraints||{},d=Fi(f=>{if(!R0(f,n,this.currentDirection))return;let h=u&&u[f]||{};(o===!0||o===f)&&(h={min:0,max:0});const g=s?200:1e6,v=s?40:1e7,x={type:"inertia",velocity:r?e[f]:0,bounceStiffness:g,bounceDamping:v,timeConstant:750,restDelta:1,restSpeed:10,...i,...h};return this.startAxisValueAnimation(f,x)});return Promise.all(d).then(l)}startAxisValueAnimation(e,n){const r=this.getAxisMotionValue(e);return bw(this.visualElement,e),r.start(Sb(e,r,0,n,this.visualElement,!1))}stopAnimation(){Fi(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){Fi(n=>{const{drag:r}=this.getProps();if(!R0(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],u=i.get()||0;i.set(e[n]-Yt(o,l,.5)+u)}})}scalePositionWithinConstraints(){if(!this.visualElement.current)return;const{drag:e,dragConstraints:n}=this.getProps(),{projection:r}=this.visualElement;if(!Eu(n)||!r||!this.constraints)return;this.stopAnimation();const s={x:0,y:0};Fi(o=>{const l=this.getAxisMotionValue(o);if(l&&this.constraints!==!1){const u=l.get();s[o]=lG({min:u,max:u},this.constraints[o])}});const{transformTemplate:i}=this.visualElement.getProps();this.visualElement.current.style.transform=i?i({},""):"none",r.root&&r.root.updateScroll(),r.updateLayout(),this.constraints=!1,this.resolveConstraints(),Fi(o=>{if(!R0(o,e,null))return;const l=this.getAxisMotionValue(o),{min:u,max:d}=this.constraints[o];l.set(Yt(u,d,s[o]))}),this.visualElement.render()}addListeners(){if(!this.visualElement.current)return;dG.set(this.visualElement,this);const e=this.visualElement.current,n=nh(e,"pointerdown",d=>{const{drag:f,dragListener:h=!0}=this.getProps(),g=d.target,v=g!==e&&WZ(g);f&&h&&!v&&this.start(d)});let r;const s=()=>{const{dragConstraints:d}=this.getProps();Eu(d)&&d.current&&(this.constraints=this.resolveRefConstraints(),r||(r=hG(e,d.current,()=>this.scalePositionWithinConstraints())))},{projection:i}=this.visualElement,o=i.addEventListener("measure",s);i&&!i.layout&&(i.root&&i.root.updateScroll(),i.updateLayout()),Qt.read(s);const l=Ah(window,"resize",()=>this.scalePositionWithinConstraints()),u=i.addEventListener("didUpdate",(({delta:d,hasLayoutChanged:f})=>{this.isDragging&&f&&(Fi(h=>{const g=this.getAxisMotionValue(h);g&&(this.originPoint[h]+=d[h].translate,g.set(g.get()+d[h].translate))}),this.visualElement.render())}));return()=>{l(),n(),o(),u&&u(),r&&r()}}getProps(){const e=this.visualElement.getProps(),{drag:n=!1,dragDirectionLock:r=!1,dragPropagation:s=!1,dragConstraints:i=!1,dragElastic:o=Mw,dragMomentum:l=!0}=e;return{...e,drag:n,dragDirectionLock:r,dragPropagation:s,dragConstraints:i,dragElastic:o,dragMomentum:l}}}function BE(t){let e=!0;return()=>{if(e){e=!1;return}t()}}function hG(t,e,n){const r=QC(t,BE(n)),s=QC(e,BE(n));return()=>{r(),s()}}function R0(t,e,n){return(e===!0||e===t)&&(n===null||n===t)}function pG(t,e=10){let n=null;return Math.abs(t.y)>e?n="y":Math.abs(t.x)>e&&(n="x"),n}class mG extends sl{constructor(e){super(e),this.removeGroupControls=Qs,this.removeListeners=Qs,this.controls=new fG(e)}mount(){const{dragControls:e}=this.node.getProps();e&&(this.removeGroupControls=e.subscribe(this.controls)),this.removeListeners=this.controls.addListeners()||Qs}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 y_=t=>(e,n)=>{t&&Qt.update(()=>t(e,n),!1,!0)};class gG extends sl{constructor(){super(...arguments),this.removePointerDownListener=Qs}onPointerDown(e){this.session=new qI(e,this.createPanHandlers(),{transformPagePoint:this.node.getTransformPagePoint(),contextWindow:WI(this.node)})}createPanHandlers(){const{onPanSessionStart:e,onPanStart:n,onPan:r,onPanEnd:s}=this.node.getProps();return{onSessionStart:y_(e),onStart:y_(n),onMove:y_(r),onEnd:(i,o)=>{delete this.session,s&&Qt.postRender(()=>s(i,o))}}}mount(){this.removePointerDownListener=nh(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 __=!1;class vG extends m.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),__&&i.root.didUpdate(),i.addEventListener("animationComplete",()=>{this.safeToRemove()}),i.setOptions({...i.options,layoutDependency:this.props.layoutDependency,onExitComplete:()=>this.safeToRemove()})),dm.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}),__=!0,s||e.layoutDependency!==n||n===void 0||e.isPresent!==i?o.willUpdate():this.safeToRemove(),e.isPresent!==i&&(i?o.promote():o.relegate()||Qt.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(),Pb.postRender(()=>{!r.currentAnimation&&r.isLead()&&this.safeToRemove()}))}componentWillUnmount(){const{visualElement:e,layoutGroup:n,switchLayoutGroup:r}=this.props,{projection:s}=e;__=!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 KI(t){const[e,n]=jI(),r=m.useContext(lb);return b.jsx(vG,{...t,layoutGroup:r,switchLayoutGroup:m.useContext(BI),isPresent:e,safeToRemove:n})}const yG={pan:{Feature:gG},drag:{Feature:mG,ProjectionNode:DI,MeasureLayout:KI}};function ZE(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&&Qt.postRender(()=>i(e,rp(e)))}class _G extends sl{mount(){const{current:e}=this.node;e&&(this.unmount=zZ(e,(n,r)=>(ZE(this.node,r,"Start"),s=>ZE(this.node,s,"End"))))}unmount(){}}class wG extends sl{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=ep(Ah(this.node.current,"focus",()=>this.onFocus()),Ah(this.node.current,"blur",()=>this.onBlur()))}unmount(){}}function WE(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&&Qt.postRender(()=>i(e,rp(e)))}class xG extends sl{mount(){const{current:e}=this.node;if(!e)return;const{globalTapTarget:n,propagate:r}=this.node.props;this.unmount=GZ(e,(s,i)=>(WE(this.node,i,"Start"),(o,{success:l})=>WE(this.node,o,l?"End":"Cancel")),{useGlobalTarget:n,stopPropagation:(r==null?void 0:r.tap)===!1})}unmount(){}}const Iw=new WeakMap,w_=new WeakMap,bG=t=>{const e=Iw.get(t.target);e&&e(t)},SG=t=>{t.forEach(bG)};function kG({root:t,...e}){const n=t||document;w_.has(n)||w_.set(n,{});const r=w_.get(n),s=JSON.stringify(e);return r[s]||(r[s]=new IntersectionObserver(SG,{root:t,...e})),r[s]}function CG(t,e,n){const r=kG(e);return Iw.set(t,n),r.observe(t),()=>{Iw.delete(t),r.unobserve(t)}}const EG={some:0,all:1};class PG extends sl{constructor(){super(...arguments),this.hasEnteredView=!1,this.isInView=!1}startObserver(){var u;(u=this.stopObserver)==null||u.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:EG[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:g}=this.node.getProps(),v=f?h:g;v&&v(d)};this.stopObserver=CG(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(AG(e,n))&&this.startObserver()}unmount(){var e;(e=this.stopObserver)==null||e.call(this),this.hasEnteredView=!1,this.isInView=!1}}function AG({viewport:t={}},{viewport:e={}}={}){return n=>t[n]!==e[n]}const TG={inView:{Feature:PG},tap:{Feature:xG},focus:{Feature:wG},hover:{Feature:_G}},RG={layout:{ProjectionNode:DI,MeasureLayout:KI}},MG={...eG,...TG,...yG,...RG},Ho=Kq(MG,Yq);function IG(){!Ib.current&&hI();const[t]=m.useState(fg.current);return t}const Si=Ho;var sp=oM();const OG=$g(sp);function LG(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 NG=t=>{switch(t){case"success":return $G;case"info":return VG;case"warning":return FG;case"error":return HG;default:return null}},DG=Array(12).fill(0),jG=({visible:t,className:e})=>xe.createElement("div",{className:["sonner-loading-wrapper",e].filter(Boolean).join(" "),"data-visible":t},xe.createElement("div",{className:"sonner-spinner"},DG.map((n,r)=>xe.createElement("div",{className:"sonner-loading-bar",key:`spinner-bar-${r}`})))),$G=xe.createElement("svg",{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 20 20",fill:"currentColor",height:"20",width:"20","aria-hidden":"true"},xe.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"})),FG=xe.createElement("svg",{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24",fill:"currentColor",height:"20",width:"20","aria-hidden":"true"},xe.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"})),VG=xe.createElement("svg",{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 20 20",fill:"currentColor",height:"20",width:"20","aria-hidden":"true"},xe.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"})),HG=xe.createElement("svg",{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 20 20",fill:"currentColor",height:"20",width:"20","aria-hidden":"true"},xe.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"})),zG=xe.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"},xe.createElement("line",{x1:"18",y1:"6",x2:"6",y2:"18"}),xe.createElement("line",{x1:"6",y1:"6",x2:"18",y2:"18"})),UG=()=>{const[t,e]=xe.useState(document.hidden);return xe.useEffect(()=>{const n=()=>{e(document.hidden)};return document.addEventListener("visibilitychange",n),()=>document.removeEventListener("visibilitychange",n)},[]),t};let BG=1;const ZG=100,qE=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:BG++};class WG{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-ZG;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=qE(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],xe.isValidElement(d))i=!1,this.create({id:r,type:"default",message:d});else if(GG(d)&&!d.ok){i=!1;const h=typeof n.error=="function"?await n.error(`HTTP error! status: ${d.status}`):n.error,g=typeof n.description=="function"?await n.description(`HTTP error! status: ${d.status}`):n.description,x=typeof h=="object"&&!xe.isValidElement(h)?h:{message:h};this.create({id:r,type:"error",description:g,...x})}else if(d instanceof Error){i=!1;const h=typeof n.error=="function"?await n.error(d):n.error,g=typeof n.description=="function"?await n.description(d):n.description,x=typeof h=="object"&&!xe.isValidElement(h)?h:{message:h};this.create({id:r,type:"error",description:g,...x})}else if(n.success!==void 0){i=!1;const h=typeof n.success=="function"?await n.success(d):n.success,g=typeof n.description=="function"?await n.description(d):n.description,x=typeof h=="object"&&!xe.isValidElement(h)?h:{message:h};this.create({id:r,type:"success",description:g,...x})}}).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"&&!xe.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)}),u=()=>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:u}:Object.assign(r,{unwrap:u})},this.custom=(e,n)=>{const r=qE(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 Jr=new WG,qG=(t,e)=>Jr.message(t,e),GG=t=>t&&typeof t=="object"&&"ok"in t&&typeof t.ok=="boolean"&&"status"in t&&typeof t.status=="number",KG=qG,YG=()=>Jr.toasts,QG=()=>Jr.getActiveToasts(),Mt=Object.assign(KG,{success:Jr.success,info:Jr.info,warning:Jr.warning,error:Jr.error,custom:Jr.custom,message:Jr.message,promise:Jr.promise,dismiss:Jr.dismiss,loading:Jr.loading},{getHistory:YG,getToasts:QG});LG("[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 M0(t){return t.label!==void 0}const XG=3,JG="24px",eK="16px",GE=4e3,tK=356,nK=14,rK=45,sK=200;function Oi(...t){return t.filter(Boolean).join(" ")}function iK(t){const[e,n]=t.split("-"),r=[];return e&&r.push(e),n&&r.push(n),r}const oK=t=>{var e,n,r,s,i,o,l,u,d;const{invert:f,toast:h,unstyled:g,interacting:v,setHeights:x,visibleToasts:_,heights:w,index:S,toasts:k,expanded:E,removeToast:P,defaultRichColors:T,closeButton:I,style:M,cancelButtonStyle:R,actionButtonStyle:O,className:D="",descriptionClassName:$="",duration:V,position:q,gap:B,expandByDefault:K,classNames:z,icons:X,closeButtonAriaLabel:Z="Close toast"}=t,[J,H]=xe.useState(null),[N,Y]=xe.useState(null),[ae,se]=xe.useState(!1),[ie,de]=xe.useState(!1),[ge,ue]=xe.useState(!1),[re,Pe]=xe.useState(!1),[$e,Ee]=xe.useState(!1),[dt,Tt]=xe.useState(0),[rn,jt]=xe.useState(0),xt=xe.useRef(h.duration||V||GE),Xt=xe.useRef(null),Ct=xe.useRef(null),qe=S===0,ke=S+1<=_,rt=h.type,Et=rt??"default",Ge=h.dismissible!==!1,yt=h.className||"",Dn=h.descriptionClassName||"",Cn=xe.useMemo(()=>w.findIndex(Ke=>Ke.toastId===h.id)||0,[w,h.id]),Me=xe.useMemo(()=>{var Ke;return(Ke=h.closeButton)!=null?Ke:I},[h.closeButton,I]),ea=xe.useMemo(()=>h.duration||V||GE,[h.duration,V]),jn=xe.useRef(0),tr=xe.useRef(0),ul=xe.useRef(0),pn=xe.useRef(null),[mn,$d]=q.split("-"),Os=xe.useMemo(()=>w.reduce((Ke,Lt,Ft)=>Ft>=Cn?Ke:Ke+Lt.height,0),[w,Cn]),wr=UG(),nr=xe.useMemo(()=>{var Ke;return(Ke=t.swipeDirections)!=null?Ke:iK(q)},[t.swipeDirections,q]),ao=h.invert||f,ei=rt==="loading";tr.current=xe.useMemo(()=>Cn*B+Os,[Cn,Os]),xe.useEffect(()=>{xt.current=ea},[ea]),xe.useEffect(()=>{se(!0)},[]),xe.useEffect(()=>{const Ke=Ct.current;if(Ke){const Lt=Ke.getBoundingClientRect().height;return jt(Lt),x(Ft=>[{toastId:h.id,height:Lt,position:h.position},...Ft]),()=>x(Ft=>Ft.filter(qn=>qn.toastId!==h.id))}},[x,h.id]),xe.useLayoutEffect(()=>{if(!ae)return;const Ke=Ct.current,Lt=Ke.style.height;Ke.style.height="auto";const Ft=Ke.getBoundingClientRect().height;Ke.style.height=Lt,jt(Ft),x(qn=>qn.find(Ut=>Ut.toastId===h.id)?qn.map(Ut=>Ut.toastId===h.id?{...Ut,height:Ft}:Ut):[{toastId:h.id,height:Ft,position:h.position},...qn])},[ae,h.title,h.description,x,h.id,h.jsx,h.action,h.cancel]);const $n=xe.useCallback(()=>{de(!0),Tt(tr.current),x(Ke=>Ke.filter(Lt=>Lt.toastId!==h.id)),setTimeout(()=>{P(h)},sK)},[h,P,x,tr]);xe.useEffect(()=>{if(h.promise&&rt==="loading"||h.duration===1/0||h.type==="loading")return;let Ke;return E||v||wr?(()=>{if(ul.current<jn.current){const qn=new Date().getTime()-jn.current;xt.current=xt.current-qn}ul.current=new Date().getTime()})():(()=>{xt.current!==1/0&&(jn.current=new Date().getTime(),Ke=setTimeout(()=>{h.onAutoClose==null||h.onAutoClose.call(h,h),$n()},xt.current))})(),()=>clearTimeout(Ke)},[E,v,h,rt,wr,$n]),xe.useEffect(()=>{h.delete&&($n(),h.onDismiss==null||h.onDismiss.call(h,h))},[$n,h.delete]);function Ls(){var Ke;if(X!=null&&X.loading){var Lt;return xe.createElement("div",{className:Oi(z==null?void 0:z.loader,h==null||(Lt=h.classNames)==null?void 0:Lt.loader,"sonner-loader"),"data-visible":rt==="loading"},X.loading)}return xe.createElement(jG,{className:Oi(z==null?void 0:z.loader,h==null||(Ke=h.classNames)==null?void 0:Ke.loader),visible:rt==="loading"})}const dl=h.icon||(X==null?void 0:X[rt])||NG(rt);var lo,fs;return xe.createElement("li",{tabIndex:0,ref:Ct,className:Oi(D,yt,z==null?void 0:z.toast,h==null||(e=h.classNames)==null?void 0:e.toast,z==null?void 0:z[Et],h==null||(n=h.classNames)==null?void 0:n[Et]),"data-sonner-toast":"","data-rich-colors":(lo=h.richColors)!=null?lo:T,"data-styled":!(h.jsx||h.unstyled||g),"data-mounted":ae,"data-promise":!!h.promise,"data-swiped":$e,"data-removed":ie,"data-visible":ke,"data-y-position":mn,"data-x-position":$d,"data-index":S,"data-front":qe,"data-swiping":ge,"data-dismissible":Ge,"data-type":rt,"data-invert":ao,"data-swipe-out":re,"data-swipe-direction":N,"data-expanded":!!(E||K&&ae),"data-testid":h.testId,style:{"--index":S,"--toasts-before":S,"--z-index":k.length-S,"--offset":`${ie?dt:tr.current}px`,"--initial-height":K?"auto":`${rn}px`,...M,...h.style},onDragEnd:()=>{ue(!1),H(null),pn.current=null},onPointerDown:Ke=>{Ke.button!==2&&(ei||!Ge||(Xt.current=new Date,Tt(tr.current),Ke.target.setPointerCapture(Ke.pointerId),Ke.target.tagName!=="BUTTON"&&(ue(!0),pn.current={x:Ke.clientX,y:Ke.clientY})))},onPointerUp:()=>{var Ke,Lt,Ft;if(re||!Ge)return;pn.current=null;const qn=Number(((Ke=Ct.current)==null?void 0:Ke.style.getPropertyValue("--swipe-amount-x").replace("px",""))||0),hs=Number(((Lt=Ct.current)==null?void 0:Lt.style.getPropertyValue("--swipe-amount-y").replace("px",""))||0),Ut=new Date().getTime()-((Ft=Xt.current)==null?void 0:Ft.getTime()),Fn=J==="x"?qn:hs,Wr=Math.abs(Fn)/Ut;if((J==="x"?nr.includes(qn>0?"right":"left"):nr.includes(hs>0?"bottom":"top"))&&(Math.abs(Fn)>=rK||Wr>.11)){Tt(tr.current),h.onDismiss==null||h.onDismiss.call(h,h),Y(J==="x"?qn>0?"right":"left":hs>0?"down":"up"),$n(),Pe(!0);return}else{var ur,Mn;(ur=Ct.current)==null||ur.style.setProperty("--swipe-amount-x","0px"),(Mn=Ct.current)==null||Mn.style.setProperty("--swipe-amount-y","0px")}Ee(!1),ue(!1),H(null)},onPointerMove:Ke=>{var Lt,Ft,qn;if(!pn.current||!Ge||((Lt=window.getSelection())==null?void 0:Lt.toString().length)>0)return;const Ut=Ke.clientY-pn.current.y,Fn=Ke.clientX-pn.current.x;!J&&(Math.abs(Fn)>1||Math.abs(Ut)>1)&&H(Math.abs(Fn)>Math.abs(Ut)?"x":"y");let Wr={x:0,y:0};const ti=ur=>1/(1.5+Math.abs(ur)/20);if(J==="y"){if(nr.includes("top")||nr.includes("bottom"))if(nr.includes("top")&&Ut<0||nr.includes("bottom")&&Ut>0)Wr.y=Ut;else{const ur=Ut*ti(Ut);Wr.y=Math.abs(ur)<Math.abs(Ut)?ur:Ut}}else if(J==="x"&&(nr.includes("left")||nr.includes("right")))if(nr.includes("left")&&Fn<0||nr.includes("right")&&Fn>0)Wr.x=Fn;else{const ur=Fn*ti(Fn);Wr.x=Math.abs(ur)<Math.abs(Fn)?ur:Fn}(Math.abs(Wr.x)>0||Math.abs(Wr.y)>0)&&Ee(!0),(Ft=Ct.current)==null||Ft.style.setProperty("--swipe-amount-x",`${Wr.x}px`),(qn=Ct.current)==null||qn.style.setProperty("--swipe-amount-y",`${Wr.y}px`)}},Me&&!h.jsx&&rt!=="loading"?xe.createElement("button",{"aria-label":Z,"data-disabled":ei,"data-close-button":!0,onClick:ei||!Ge?()=>{}:()=>{$n(),h.onDismiss==null||h.onDismiss.call(h,h)},className:Oi(z==null?void 0:z.closeButton,h==null||(r=h.classNames)==null?void 0:r.closeButton)},(fs=X==null?void 0:X.close)!=null?fs:zG):null,(rt||h.icon||h.promise)&&h.icon!==null&&((X==null?void 0:X[rt])!==null||h.icon)?xe.createElement("div",{"data-icon":"",className:Oi(z==null?void 0:z.icon,h==null||(s=h.classNames)==null?void 0:s.icon)},rt==="loading"?h.icon||Ls():h.promise?Ls():null,rt!=="loading"?dl:null):null,xe.createElement("div",{"data-content":"",className:Oi(z==null?void 0:z.content,h==null||(i=h.classNames)==null?void 0:i.content)},xe.createElement("div",{"data-title":"",className:Oi(z==null?void 0:z.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?xe.createElement("div",{"data-description":"",className:Oi($,Dn,z==null?void 0:z.description,h==null||(l=h.classNames)==null?void 0:l.description)},typeof h.description=="function"?h.description():h.description):null),xe.isValidElement(h.cancel)?h.cancel:h.cancel&&M0(h.cancel)?xe.createElement("button",{"data-button":!0,"data-cancel":!0,style:h.cancelButtonStyle||R,onClick:Ke=>{M0(h.cancel)&&Ge&&(h.cancel.onClick==null||h.cancel.onClick.call(h.cancel,Ke),$n())},className:Oi(z==null?void 0:z.cancelButton,h==null||(u=h.classNames)==null?void 0:u.cancelButton)},h.cancel.label):null,xe.isValidElement(h.action)?h.action:h.action&&M0(h.action)?xe.createElement("button",{"data-button":!0,"data-action":!0,style:h.actionButtonStyle||O,onClick:Ke=>{M0(h.action)&&(h.action.onClick==null||h.action.onClick.call(h.action,Ke),!Ke.defaultPrevented&&$n())},className:Oi(z==null?void 0:z.actionButton,h==null||(d=h.classNames)==null?void 0:d.actionButton)},h.action.label):null)};function KE(){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 aK(t,e){const n={};return[t,e].forEach((r,s)=>{const i=s===1,o=i?"--mobile-offset":"--offset",l=i?eK:JG;function u(d){["top","right","bottom","left"].forEach(f=>{n[`${o}-${f}`]=typeof d=="number"?`${d}px`:d})}typeof r=="number"||typeof r=="string"?u(r):typeof r=="object"?["top","right","bottom","left"].forEach(d=>{r[d]===void 0?n[`${o}-${d}`]=l:n[`${o}-${d}`]=typeof r[d]=="number"?`${r[d]}px`:r[d]}):u(l)}),n}const lK=xe.forwardRef(function(e,n){const{id:r,invert:s,position:i="bottom-right",hotkey:o=["altKey","KeyT"],expand:l,closeButton:u,className:d,offset:f,mobileOffset:h,theme:g="light",richColors:v,duration:x,style:_,visibleToasts:w=XG,toastOptions:S,dir:k=KE(),gap:E=nK,icons:P,customAriaLabel:T,containerAriaLabel:I="Notifications"}=e,[M,R]=xe.useState([]),O=xe.useMemo(()=>r?M.filter(se=>se.toasterId===r):M.filter(se=>!se.toasterId),[M,r]),D=xe.useMemo(()=>Array.from(new Set([i].concat(O.filter(se=>se.position).map(se=>se.position)))),[O,i]),[$,V]=xe.useState([]),[q,B]=xe.useState(!1),[K,z]=xe.useState(!1),[X,Z]=xe.useState(g!=="system"?g:typeof window<"u"&&window.matchMedia&&window.matchMedia("(prefers-color-scheme: dark)").matches?"dark":"light"),J=xe.useRef(null),H=o.join("+").replace(/Key/g,"").replace(/Digit/g,""),N=xe.useRef(null),Y=xe.useRef(!1),ae=xe.useCallback(se=>{R(ie=>{var de;return(de=ie.find(ge=>ge.id===se.id))!=null&&de.delete||Jr.dismiss(se.id),ie.filter(({id:ge})=>ge!==se.id)})},[]);return xe.useEffect(()=>Jr.subscribe(se=>{if(se.dismiss){requestAnimationFrame(()=>{R(ie=>ie.map(de=>de.id===se.id?{...de,delete:!0}:de))});return}setTimeout(()=>{OG.flushSync(()=>{R(ie=>{const de=ie.findIndex(ge=>ge.id===se.id);return de!==-1?[...ie.slice(0,de),{...ie[de],...se},...ie.slice(de+1)]:[se,...ie]})})})}),[]),xe.useEffect(()=>{if(g!=="system"){Z(g);return}if(g==="system"&&(window.matchMedia&&window.matchMedia("(prefers-color-scheme: dark)").matches?Z("dark"):Z("light")),typeof window>"u")return;const se=window.matchMedia("(prefers-color-scheme: dark)");try{se.addEventListener("change",({matches:ie})=>{Z(ie?"dark":"light")})}catch{se.addListener(({matches:de})=>{try{Z(de?"dark":"light")}catch(ge){console.error(ge)}})}},[g]),xe.useEffect(()=>{M.length<=1&&B(!1)},[M]),xe.useEffect(()=>{const se=ie=>{var de;if(o.length>0&&o.every(re=>ie[re]||ie.code===re)){var ue;B(!0),(ue=J.current)==null||ue.focus()}ie.code==="Escape"&&(document.activeElement===J.current||(de=J.current)!=null&&de.contains(document.activeElement))&&B(!1)};return document.addEventListener("keydown",se),()=>document.removeEventListener("keydown",se)},[o]),xe.useEffect(()=>{if(J.current)return()=>{N.current&&(N.current.focus({preventScroll:!0}),N.current=null,Y.current=!1)}},[J.current]),xe.createElement("section",{ref:n,"aria-label":T??`${I} ${H}`,tabIndex:-1,"aria-live":"polite","aria-relevant":"additions text","aria-atomic":"false",suppressHydrationWarning:!0,"data-react-aria-top-layer":!0},D.map((se,ie)=>{var de;const[ge,ue]=se.split("-");return O.length?xe.createElement("ol",{key:se,dir:k==="auto"?KE():k,tabIndex:-1,ref:J,className:d,"data-sonner-toaster":!0,"data-sonner-theme":X,"data-y-position":ge,"data-x-position":ue,style:{"--front-toast-height":`${((de=$[0])==null?void 0:de.height)||0}px`,"--width":`${tK}px`,"--gap":`${E}px`,..._,...aK(f,h)},onBlur:re=>{Y.current&&!re.currentTarget.contains(re.relatedTarget)&&(Y.current=!1,N.current&&(N.current.focus({preventScroll:!0}),N.current=null))},onFocus:re=>{re.target instanceof HTMLElement&&re.target.dataset.dismissible==="false"||Y.current||(Y.current=!0,N.current=re.relatedTarget)},onMouseEnter:()=>B(!0),onMouseMove:()=>B(!0),onMouseLeave:()=>{K||B(!1)},onDragEnd:()=>B(!1),onPointerDown:re=>{re.target instanceof HTMLElement&&re.target.dataset.dismissible==="false"||z(!0)},onPointerUp:()=>z(!1)},O.filter(re=>!re.position&&ie===0||re.position===se).map((re,Pe)=>{var $e,Ee;return xe.createElement(oK,{key:re.id,icons:P,index:Pe,toast:re,defaultRichColors:v,duration:($e=S==null?void 0:S.duration)!=null?$e:x,className:S==null?void 0:S.className,descriptionClassName:S==null?void 0:S.descriptionClassName,invert:s,visibleToasts:w,closeButton:(Ee=S==null?void 0:S.closeButton)!=null?Ee:u,interacting:K,position:se,style:S==null?void 0:S.style,unstyled:S==null?void 0:S.unstyled,classNames:S==null?void 0:S.classNames,cancelButtonStyle:S==null?void 0:S.cancelButtonStyle,actionButtonStyle:S==null?void 0:S.actionButtonStyle,closeButtonAriaLabel:S==null?void 0:S.closeButtonAriaLabel,removeToast:ae,toasts:O.filter(dt=>dt.position==re.position),heights:$.filter(dt=>dt.position==re.position),setHeights:V,expandByDefault:l,gap:E,expanded:q,swipeDirections:e.swipeDirections})})):null}))}),cK=new Map([["bold",m.createElement(m.Fragment,null,m.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",m.createElement(m.Fragment,null,m.createElement("path",{d:"M112,56V200L40,128Z",opacity:"0.2"}),m.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",m.createElement(m.Fragment,null,m.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",m.createElement(m.Fragment,null,m.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",m.createElement(m.Fragment,null,m.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",m.createElement(m.Fragment,null,m.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"}))]]),uK=new Map([["bold",m.createElement(m.Fragment,null,m.createElement("path",{d:"M228,104a12,12,0,0,1-24,0V69l-59.51,59.51a12,12,0,0,1-17-17L187,52H152a12,12,0,0,1,0-24h64a12,12,0,0,1,12,12Zm-44,24a12,12,0,0,0-12,12v64H52V84h64a12,12,0,0,0,0-24H48A20,20,0,0,0,28,80V208a20,20,0,0,0,20,20H176a20,20,0,0,0,20-20V140A12,12,0,0,0,184,128Z"}))],["duotone",m.createElement(m.Fragment,null,m.createElement("path",{d:"M184,80V208a8,8,0,0,1-8,8H48a8,8,0,0,1-8-8V80a8,8,0,0,1,8-8H176A8,8,0,0,1,184,80Z",opacity:"0.2"}),m.createElement("path",{d:"M224,104a8,8,0,0,1-16,0V59.32l-66.33,66.34a8,8,0,0,1-11.32-11.32L196.68,48H152a8,8,0,0,1,0-16h64a8,8,0,0,1,8,8Zm-40,24a8,8,0,0,0-8,8v72H48V80h72a8,8,0,0,0,0-16H48A16,16,0,0,0,32,80V208a16,16,0,0,0,16,16H176a16,16,0,0,0,16-16V136A8,8,0,0,0,184,128Z"}))],["fill",m.createElement(m.Fragment,null,m.createElement("path",{d:"M192,136v72a16,16,0,0,1-16,16H48a16,16,0,0,1-16-16V80A16,16,0,0,1,48,64h72a8,8,0,0,1,0,16H48V208H176V136a8,8,0,0,1,16,0Zm32-96a8,8,0,0,0-8-8H152a8,8,0,0,0-5.66,13.66L172.69,72l-42.35,42.34a8,8,0,0,0,11.32,11.32L184,83.31l26.34,26.35A8,8,0,0,0,224,104Z"}))],["light",m.createElement(m.Fragment,null,m.createElement("path",{d:"M222,104a6,6,0,0,1-12,0V54.49l-69.75,69.75a6,6,0,0,1-8.48-8.48L201.51,46H152a6,6,0,0,1,0-12h64a6,6,0,0,1,6,6Zm-38,26a6,6,0,0,0-6,6v72a2,2,0,0,1-2,2H48a2,2,0,0,1-2-2V80a2,2,0,0,1,2-2h72a6,6,0,0,0,0-12H48A14,14,0,0,0,34,80V208a14,14,0,0,0,14,14H176a14,14,0,0,0,14-14V136A6,6,0,0,0,184,130Z"}))],["regular",m.createElement(m.Fragment,null,m.createElement("path",{d:"M224,104a8,8,0,0,1-16,0V59.32l-66.33,66.34a8,8,0,0,1-11.32-11.32L196.68,48H152a8,8,0,0,1,0-16h64a8,8,0,0,1,8,8Zm-40,24a8,8,0,0,0-8,8v72H48V80h72a8,8,0,0,0,0-16H48A16,16,0,0,0,32,80V208a16,16,0,0,0,16,16H176a16,16,0,0,0,16-16V136A8,8,0,0,0,184,128Z"}))],["thin",m.createElement(m.Fragment,null,m.createElement("path",{d:"M220,104a4,4,0,0,1-8,0V49.66l-73.16,73.17a4,4,0,0,1-5.66-5.66L206.34,44H152a4,4,0,0,1,0-8h64a4,4,0,0,1,4,4Zm-36,28a4,4,0,0,0-4,4v72a4,4,0,0,1-4,4H48a4,4,0,0,1-4-4V80a4,4,0,0,1,4-4h72a4,4,0,0,0,0-8H48A12,12,0,0,0,36,80V208a12,12,0,0,0,12,12H176a12,12,0,0,0,12-12V136A4,4,0,0,0,184,132Z"}))]]),dK=new Map([["bold",m.createElement(m.Fragment,null,m.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",m.createElement(m.Fragment,null,m.createElement("path",{d:"M200,112H56l72-72Z",opacity:"0.2"}),m.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",m.createElement(m.Fragment,null,m.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",m.createElement(m.Fragment,null,m.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",m.createElement(m.Fragment,null,m.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",m.createElement(m.Fragment,null,m.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"}))]]),fK=new Map([["bold",m.createElement(m.Fragment,null,m.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",m.createElement(m.Fragment,null,m.createElement("path",{d:"M208,96l-80,80L48,96Z",opacity:"0.2"}),m.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",m.createElement(m.Fragment,null,m.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",m.createElement(m.Fragment,null,m.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",m.createElement(m.Fragment,null,m.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",m.createElement(m.Fragment,null,m.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"}))]]),hK=new Map([["bold",m.createElement(m.Fragment,null,m.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",m.createElement(m.Fragment,null,m.createElement("path",{d:"M176,128,96,208V48Z",opacity:"0.2"}),m.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",m.createElement(m.Fragment,null,m.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",m.createElement(m.Fragment,null,m.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",m.createElement(m.Fragment,null,m.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",m.createElement(m.Fragment,null,m.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"}))]]),pK=new Map([["bold",m.createElement(m.Fragment,null,m.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",m.createElement(m.Fragment,null,m.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"}),m.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",m.createElement(m.Fragment,null,m.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",m.createElement(m.Fragment,null,m.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",m.createElement(m.Fragment,null,m.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",m.createElement(m.Fragment,null,m.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"}))]]),mK=new Map([["bold",m.createElement(m.Fragment,null,m.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",m.createElement(m.Fragment,null,m.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"}),m.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",m.createElement(m.Fragment,null,m.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",m.createElement(m.Fragment,null,m.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",m.createElement(m.Fragment,null,m.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",m.createElement(m.Fragment,null,m.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"}))]]),gK=new Map([["bold",m.createElement(m.Fragment,null,m.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",m.createElement(m.Fragment,null,m.createElement("path",{d:"M224,128a96,96,0,1,1-96-96A96,96,0,0,1,224,128Z",opacity:"0.2"}),m.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",m.createElement(m.Fragment,null,m.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",m.createElement(m.Fragment,null,m.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",m.createElement(m.Fragment,null,m.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",m.createElement(m.Fragment,null,m.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"}))]]),vK=new Map([["bold",m.createElement(m.Fragment,null,m.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",m.createElement(m.Fragment,null,m.createElement("path",{d:"M216,40V168H168V88H88V40Z",opacity:"0.2"}),m.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",m.createElement(m.Fragment,null,m.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",m.createElement(m.Fragment,null,m.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",m.createElement(m.Fragment,null,m.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",m.createElement(m.Fragment,null,m.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"}))]]),yK=new Map([["bold",m.createElement(m.Fragment,null,m.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",m.createElement(m.Fragment,null,m.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"}),m.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",m.createElement(m.Fragment,null,m.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",m.createElement(m.Fragment,null,m.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",m.createElement(m.Fragment,null,m.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",m.createElement(m.Fragment,null,m.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"}))]]),_K=new Map([["bold",m.createElement(m.Fragment,null,m.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",m.createElement(m.Fragment,null,m.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"}),m.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",m.createElement(m.Fragment,null,m.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",m.createElement(m.Fragment,null,m.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",m.createElement(m.Fragment,null,m.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",m.createElement(m.Fragment,null,m.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"}))]]),wK=new Map([["bold",m.createElement(m.Fragment,null,m.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",m.createElement(m.Fragment,null,m.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"}),m.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",m.createElement(m.Fragment,null,m.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",m.createElement(m.Fragment,null,m.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",m.createElement(m.Fragment,null,m.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",m.createElement(m.Fragment,null,m.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"}))]]),xK=new Map([["bold",m.createElement(m.Fragment,null,m.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",m.createElement(m.Fragment,null,m.createElement("path",{d:"M192,112a80,80,0,1,1-80-80A80,80,0,0,1,192,112Z",opacity:"0.2"}),m.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",m.createElement(m.Fragment,null,m.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",m.createElement(m.Fragment,null,m.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",m.createElement(m.Fragment,null,m.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",m.createElement(m.Fragment,null,m.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"}))]]),bK=new Map([["bold",m.createElement(m.Fragment,null,m.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",m.createElement(m.Fragment,null,m.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"}),m.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",m.createElement(m.Fragment,null,m.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",m.createElement(m.Fragment,null,m.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",m.createElement(m.Fragment,null,m.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",m.createElement(m.Fragment,null,m.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"}))]]),SK=new Map([["bold",m.createElement(m.Fragment,null,m.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",m.createElement(m.Fragment,null,m.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"}),m.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",m.createElement(m.Fragment,null,m.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",m.createElement(m.Fragment,null,m.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",m.createElement(m.Fragment,null,m.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",m.createElement(m.Fragment,null,m.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"}))]]),kK=new Map([["bold",m.createElement(m.Fragment,null,m.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",m.createElement(m.Fragment,null,m.createElement("path",{d:"M88,48V208H40a8,8,0,0,1-8-8V56a8,8,0,0,1,8-8Z",opacity:"0.2"}),m.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",m.createElement(m.Fragment,null,m.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",m.createElement(m.Fragment,null,m.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",m.createElement(m.Fragment,null,m.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",m.createElement(m.Fragment,null,m.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"}))]]),CK=new Map([["bold",m.createElement(m.Fragment,null,m.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",m.createElement(m.Fragment,null,m.createElement("path",{d:"M200,40V216H40a16,16,0,0,1-16-16V56A16,16,0,0,1,40,40Z",opacity:"0.2"}),m.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",m.createElement(m.Fragment,null,m.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",m.createElement(m.Fragment,null,m.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",m.createElement(m.Fragment,null,m.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",m.createElement(m.Fragment,null,m.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"}))]]),EK=new Map([["bold",m.createElement(m.Fragment,null,m.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",m.createElement(m.Fragment,null,m.createElement("path",{d:"M224,56V200a16,16,0,0,1-16,16H48V40H208A16,16,0,0,1,224,56Z",opacity:"0.2"}),m.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",m.createElement(m.Fragment,null,m.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",m.createElement(m.Fragment,null,m.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",m.createElement(m.Fragment,null,m.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",m.createElement(m.Fragment,null,m.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"}))]]),PK=new Map([["bold",m.createElement(m.Fragment,null,m.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",m.createElement(m.Fragment,null,m.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"}),m.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",m.createElement(m.Fragment,null,m.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",m.createElement(m.Fragment,null,m.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",m.createElement(m.Fragment,null,m.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",m.createElement(m.Fragment,null,m.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"}))]]),AK=new Map([["bold",m.createElement(m.Fragment,null,m.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",m.createElement(m.Fragment,null,m.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"}),m.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",m.createElement(m.Fragment,null,m.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",m.createElement(m.Fragment,null,m.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",m.createElement(m.Fragment,null,m.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",m.createElement(m.Fragment,null,m.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"}))]]),TK=new Map([["bold",m.createElement(m.Fragment,null,m.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",m.createElement(m.Fragment,null,m.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"}),m.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",m.createElement(m.Fragment,null,m.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",m.createElement(m.Fragment,null,m.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",m.createElement(m.Fragment,null,m.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",m.createElement(m.Fragment,null,m.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"}))]]),RK=new Map([["bold",m.createElement(m.Fragment,null,m.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",m.createElement(m.Fragment,null,m.createElement("path",{d:"M200,56V208a8,8,0,0,1-8,8H64a8,8,0,0,1-8-8V56Z",opacity:"0.2"}),m.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",m.createElement(m.Fragment,null,m.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",m.createElement(m.Fragment,null,m.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",m.createElement(m.Fragment,null,m.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",m.createElement(m.Fragment,null,m.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"}))]]),MK=new Map([["bold",m.createElement(m.Fragment,null,m.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",m.createElement(m.Fragment,null,m.createElement("path",{d:"M192,96a64,64,0,1,1-64-64A64,64,0,0,1,192,96Z",opacity:"0.2"}),m.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",m.createElement(m.Fragment,null,m.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",m.createElement(m.Fragment,null,m.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",m.createElement(m.Fragment,null,m.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",m.createElement(m.Fragment,null,m.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"}))]]),IK=new Map([["bold",m.createElement(m.Fragment,null,m.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",m.createElement(m.Fragment,null,m.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"}),m.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",m.createElement(m.Fragment,null,m.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",m.createElement(m.Fragment,null,m.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",m.createElement(m.Fragment,null,m.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",m.createElement(m.Fragment,null,m.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"}))]]),OK=new Map([["bold",m.createElement(m.Fragment,null,m.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",m.createElement(m.Fragment,null,m.createElement("path",{d:"M208,216H160L48,40H96Z",opacity:"0.2"}),m.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",m.createElement(m.Fragment,null,m.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",m.createElement(m.Fragment,null,m.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",m.createElement(m.Fragment,null,m.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",m.createElement(m.Fragment,null,m.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"}))]]),LK=m.createContext({color:"currentColor",size:"1em",weight:"regular",mirrored:!1}),nn=m.forwardRef((t,e)=>{const{alt:n,color:r,size:s,weight:i,mirrored:o,children:l,weights:u,...d}=t,{color:f="currentColor",size:h,weight:g="regular",mirrored:v=!1,...x}=m.useContext(LK);return m.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,...x,...d},!!n&&m.createElement("title",null,n),l,u.get(i??g))});nn.displayName="IconBase";const YI=m.forwardRef((t,e)=>m.createElement(nn,{ref:e,...t,weights:cK}));YI.displayName="ArrowLeftIcon";const NK=YI,QI=m.forwardRef((t,e)=>m.createElement(nn,{ref:e,...t,weights:uK}));QI.displayName="ArrowSquareOutIcon";const DK=QI,XI=m.forwardRef((t,e)=>m.createElement(nn,{ref:e,...t,weights:dK}));XI.displayName="ArrowUpIcon";const jK=XI,JI=m.forwardRef((t,e)=>m.createElement(nn,{ref:e,...t,weights:fK}));JI.displayName="CaretDownIcon";const $K=JI,e3=m.forwardRef((t,e)=>m.createElement(nn,{ref:e,...t,weights:hK}));e3.displayName="CaretRightIcon";const FK=e3,t3=m.forwardRef((t,e)=>m.createElement(nn,{ref:e,...t,weights:pK}));t3.displayName="ChatCircleIcon";const VK=t3,n3=m.forwardRef((t,e)=>m.createElement(nn,{ref:e,...t,weights:mK}));n3.displayName="CheckIcon";const HK=n3,r3=m.forwardRef((t,e)=>m.createElement(nn,{ref:e,...t,weights:gK}));r3.displayName="CircleNotchIcon";const Xg=r3,s3=m.forwardRef((t,e)=>m.createElement(nn,{ref:e,...t,weights:vK}));s3.displayName="CopyIcon";const Th=s3,i3=m.forwardRef((t,e)=>m.createElement(nn,{ref:e,...t,weights:yK}));i3.displayName="DotsThreeIcon";const zK=i3,o3=m.forwardRef((t,e)=>m.createElement(nn,{ref:e,...t,weights:_K}));o3.displayName="FolderOpenIcon";const UK=o3,a3=m.forwardRef((t,e)=>m.createElement(nn,{ref:e,...t,weights:wK}));a3.displayName="FolderSimpleIcon";const BK=a3,l3=m.forwardRef((t,e)=>m.createElement(nn,{ref:e,...t,weights:xK}));l3.displayName="MagnifyingGlassIcon";const ZK=l3,c3=m.forwardRef((t,e)=>m.createElement(nn,{ref:e,...t,weights:bK}));c3.displayName="PencilSimpleIcon";const u3=c3,d3=m.forwardRef((t,e)=>m.createElement(nn,{ref:e,...t,weights:SK}));d3.displayName="PushPinIcon";const Ow=d3,f3=m.forwardRef((t,e)=>m.createElement(nn,{ref:e,...t,weights:kK}));f3.displayName="SidebarSimpleIcon";const WK=f3,h3=m.forwardRef((t,e)=>m.createElement(nn,{ref:e,...t,weights:CK}));h3.displayName="SignInIcon";const qK=h3,p3=m.forwardRef((t,e)=>m.createElement(nn,{ref:e,...t,weights:EK}));p3.displayName="SignOutIcon";const GK=p3,m3=m.forwardRef((t,e)=>m.createElement(nn,{ref:e,...t,weights:PK}));m3.displayName="SparkleIcon";const x_=m3,g3=m.forwardRef((t,e)=>m.createElement(nn,{ref:e,...t,weights:AK}));g3.displayName="SquaresFourIcon";const KK=g3,v3=m.forwardRef((t,e)=>m.createElement(nn,{ref:e,...t,weights:TK}));v3.displayName="SwatchesIcon";const y3=v3,_3=m.forwardRef((t,e)=>m.createElement(nn,{ref:e,...t,weights:RK}));_3.displayName="TrashIcon";const w3=_3,x3=m.forwardRef((t,e)=>m.createElement(nn,{ref:e,...t,weights:MK}));x3.displayName="UserIcon";const YK=x3,b3=m.forwardRef((t,e)=>m.createElement(nn,{ref:e,...t,weights:IK}));b3.displayName="XIcon";const $b=b3,S3=m.forwardRef((t,e)=>m.createElement(nn,{ref:e,...t,weights:OK}));S3.displayName="XLogoIcon";const QK=S3,XK="/assets/arena-Db0j1set.png",JK="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 k3(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=k3(t[e]))&&(r&&(r+=" "),r+=n)}else for(n in t)t[n]&&(r&&(r+=" "),r+=n);return r}function C3(){for(var t,e,n=0,r="",s=arguments.length;n<s;n++)(t=arguments[n])&&(e=k3(t))&&(r&&(r+=" "),r+=e);return r}const eY=(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},tY=(t,e)=>({classGroupId:t,validator:e}),E3=(t=new Map,e=null,n)=>({nextPart:t,validators:e,classGroupId:n}),vg="-",YE=[],nY="arbitrary..",rY=t=>{const e=iY(t),{conflictingClassGroups:n,conflictingClassGroupModifiers:r}=t;return{getClassGroupId:o=>{if(o.startsWith("[")&&o.endsWith("]"))return sY(o);const l=o.split(vg),u=l[0]===""&&l.length>1?1:0;return P3(l,u,e)},getConflictingClassGroupIds:(o,l)=>{if(l){const u=r[o],d=n[o];return u?d?eY(d,u):u:d||YE}return n[o]||YE}}},P3=(t,e,n)=>{if(t.length-e===0)return n.classGroupId;const s=t[e],i=n.nextPart.get(s);if(i){const d=P3(t,e+1,i);if(d)return d}const o=n.validators;if(o===null)return;const l=e===0?t.join(vg):t.slice(e).join(vg),u=o.length;for(let d=0;d<u;d++){const f=o[d];if(f.validator(l))return f.classGroupId}},sY=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?nY+r:void 0})(),iY=t=>{const{theme:e,classGroups:n}=t;return oY(n,e)},oY=(t,e)=>{const n=E3();for(const r in t){const s=t[r];Fb(s,n,r,e)}return n},Fb=(t,e,n,r)=>{const s=t.length;for(let i=0;i<s;i++){const o=t[i];aY(o,e,n,r)}},aY=(t,e,n,r)=>{if(typeof t=="string"){lY(t,e,n);return}if(typeof t=="function"){cY(t,e,n,r);return}uY(t,e,n,r)},lY=(t,e,n)=>{const r=t===""?e:A3(e,t);r.classGroupId=n},cY=(t,e,n,r)=>{if(dY(t)){Fb(t(r),e,n,r);return}e.validators===null&&(e.validators=[]),e.validators.push(tY(n,t))},uY=(t,e,n,r)=>{const s=Object.entries(t),i=s.length;for(let o=0;o<i;o++){const[l,u]=s[o];Fb(u,A3(e,l),n,r)}},A3=(t,e)=>{let n=t;const r=e.split(vg),s=r.length;for(let i=0;i<s;i++){const o=r[i];let l=n.nextPart.get(o);l||(l=E3(),n.nextPart.set(o,l)),n=l}return n},dY=t=>"isThemeGetter"in t&&t.isThemeGetter===!0,fY=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)}}},Lw="!",QE=":",hY=[],XE=(t,e,n,r,s)=>({modifiers:t,hasImportantModifier:e,baseClassName:n,maybePostfixModifierPosition:r,isExternal:s}),pY=t=>{const{prefix:e,experimentalParseClassName:n}=t;let r=s=>{const i=[];let o=0,l=0,u=0,d;const f=s.length;for(let _=0;_<f;_++){const w=s[_];if(o===0&&l===0){if(w===QE){i.push(s.slice(u,_)),u=_+1;continue}if(w==="/"){d=_;continue}}w==="["?o++:w==="]"?o--:w==="("?l++:w===")"&&l--}const h=i.length===0?s:s.slice(u);let g=h,v=!1;h.endsWith(Lw)?(g=h.slice(0,-1),v=!0):h.startsWith(Lw)&&(g=h.slice(1),v=!0);const x=d&&d>u?d-u:void 0;return XE(i,v,g,x)};if(e){const s=e+QE,i=r;r=o=>o.startsWith(s)?i(o.slice(s.length)):XE(hY,!1,o,void 0,!0)}if(n){const s=r;r=i=>n({className:i,parseClassName:s})}return r},mY=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]==="[",u=e.has(o);l||u?(s.length>0&&(s.sort(),r.push(...s),s=[]),r.push(o)):s.push(o)}return s.length>0&&(s.sort(),r.push(...s)),r}},gY=t=>({cache:fY(t.cacheSize),parseClassName:pY(t),sortModifiers:mY(t),postfixLookupClassGroupIds:vY(t),...rY(t)}),vY=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},yY=/\s+/,_Y=(t,e)=>{const{parseClassName:n,getClassGroupId:r,getConflictingClassGroupIds:s,sortModifiers:i,postfixLookupClassGroupIds:o}=e,l=[],u=t.trim().split(yY);let d="";for(let f=u.length-1;f>=0;f-=1){const h=u[f],{isExternal:g,modifiers:v,hasImportantModifier:x,baseClassName:_,maybePostfixModifierPosition:w}=n(h);if(g){d=h+(d.length>0?" "+d:d);continue}let S=!!w,k;if(S){const M=_.substring(0,w);k=r(M);const R=k&&o[k]?r(_):void 0;R&&R!==k&&(k=R,S=!1)}else k=r(_);if(!k){if(!S){d=h+(d.length>0?" "+d:d);continue}if(k=r(_),!k){d=h+(d.length>0?" "+d:d);continue}S=!1}const E=v.length===0?"":v.length===1?v[0]:i(v).join(":"),P=x?E+Lw:E,T=P+k;if(l.indexOf(T)>-1)continue;l.push(T);const I=s(k,S);for(let M=0;M<I.length;++M){const R=I[M];l.push(P+R)}d=h+(d.length>0?" "+d:d)}return d},wY=(...t)=>{let e=0,n,r,s="";for(;e<t.length;)(n=t[e++])&&(r=T3(n))&&(s&&(s+=" "),s+=r);return s},T3=t=>{if(typeof t=="string")return t;let e,n="";for(let r=0;r<t.length;r++)t[r]&&(e=T3(t[r]))&&(n&&(n+=" "),n+=e);return n},xY=(t,...e)=>{let n,r,s,i;const o=u=>{const d=e.reduce((f,h)=>h(f),t());return n=gY(d),r=n.cache.get,s=n.cache.set,i=l,l(u)},l=u=>{const d=r(u);if(d)return d;const f=_Y(u,n);return s(u,f),f};return i=o,(...u)=>i(wY(...u))},bY=[],Yn=t=>{const e=n=>n[t]||bY;return e.isThemeGetter=!0,e.themeKey=t,e},R3=/^\[(?:(\w[\w-]*):)?(.+)\]$/i,M3=/^\((?:(\w[\w-]*):)?(.+)\)$/i,SY=/^\d+(?:\.\d+)?\/\d+(?:\.\d+)?$/,kY=/^(\d+(\.\d+)?)?(xs|sm|md|lg|xl)$/,CY=/\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$/,EY=/^(rgba?|hsla?|hwb|(ok)?(lab|lch)|color-mix|color|light-dark)\(.+\)$/,PY=/^(inset_)?-?((\d+)?\.?(\d+)[a-z]+|0)_-?((\d+)?\.?(\d+)[a-z]+|0)/,AY=/^(url|image|image-set|cross-fade|element|(repeating-)?(linear|radial|conic)-gradient)\(.+\)$/,Sa=t=>SY.test(t),pt=t=>!!t&&!Number.isNaN(Number(t)),Li=t=>!!t&&Number.isInteger(Number(t)),b_=t=>t.endsWith("%")&&pt(t.slice(0,-1)),bo=t=>kY.test(t),I3=()=>!0,TY=t=>CY.test(t)&&!EY.test(t),Vb=()=>!1,RY=t=>PY.test(t),MY=t=>AY.test(t),IY=t=>!Oe(t)&&!De(t),OY=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)),LY=t=>il(t,N3,Vb),Oe=t=>R3.test(t),jl=t=>il(t,D3,TY),JE=t=>il(t,zY,pt),NY=t=>il(t,$3,I3),DY=t=>il(t,j3,Vb),eP=t=>il(t,O3,Vb),jY=t=>il(t,L3,MY),I0=t=>il(t,F3,RY),De=t=>M3.test(t),Tf=t=>Tc(t,D3),$Y=t=>Tc(t,j3),tP=t=>Tc(t,O3),FY=t=>Tc(t,N3),VY=t=>Tc(t,L3),O0=t=>Tc(t,F3,!0),HY=t=>Tc(t,$3,!0),il=(t,e,n)=>{const r=R3.exec(t);return r?r[1]?e(r[1]):n(r[2]):!1},Tc=(t,e,n=!1)=>{const r=M3.exec(t);return r?r[1]?e(r[1]):n:!1},O3=t=>t==="position"||t==="percentage",L3=t=>t==="image"||t==="url",N3=t=>t==="length"||t==="size"||t==="bg-size",D3=t=>t==="length",zY=t=>t==="number",j3=t=>t==="family-name",$3=t=>t==="number"||t==="weight",F3=t=>t==="shadow",UY=()=>{const t=Yn("color"),e=Yn("font"),n=Yn("text"),r=Yn("font-weight"),s=Yn("tracking"),i=Yn("leading"),o=Yn("breakpoint"),l=Yn("container"),u=Yn("spacing"),d=Yn("radius"),f=Yn("shadow"),h=Yn("inset-shadow"),g=Yn("text-shadow"),v=Yn("drop-shadow"),x=Yn("blur"),_=Yn("perspective"),w=Yn("aspect"),S=Yn("ease"),k=Yn("animate"),E=()=>["auto","avoid","all","avoid-page","page","left","right","column"],P=()=>["center","top","bottom","left","right","top-left","left-top","top-right","right-top","bottom-right","right-bottom","bottom-left","left-bottom"],T=()=>[...P(),De,Oe],I=()=>["auto","hidden","clip","visible","scroll"],M=()=>["auto","contain","none"],R=()=>[De,Oe,u],O=()=>[Sa,"full","auto",...R()],D=()=>[Li,"none","subgrid",De,Oe],$=()=>["auto",{span:["full",Li,De,Oe]},Li,De,Oe],V=()=>[Li,"auto",De,Oe],q=()=>["auto","min","max","fr",De,Oe],B=()=>["start","end","center","between","around","evenly","stretch","baseline","center-safe","end-safe"],K=()=>["start","end","center","stretch","center-safe","end-safe"],z=()=>["auto",...R()],X=()=>[Sa,"auto","full","dvw","dvh","lvw","lvh","svw","svh","min","max","fit",...R()],Z=()=>[l,Sa,"screen","full","dvw","lvw","svw","min","max","fit",...R()],J=()=>[Sa,"screen","full","lh","dvh","lvh","svh","min","max","fit",...R()],H=()=>[t,De,Oe],N=()=>[...P(),tP,eP,{position:[De,Oe]}],Y=()=>["no-repeat",{repeat:["","x","y","space","round"]}],ae=()=>["auto","cover","contain",FY,LY,{size:[De,Oe]}],se=()=>[b_,Tf,jl],ie=()=>["","none","full",d,De,Oe],de=()=>["",pt,Tf,jl],ge=()=>["solid","dashed","dotted","double"],ue=()=>["normal","multiply","screen","overlay","darken","lighten","color-dodge","color-burn","hard-light","soft-light","difference","exclusion","hue","saturation","color","luminosity"],re=()=>[pt,b_,tP,eP],Pe=()=>["","none",x,De,Oe],$e=()=>["none",pt,De,Oe],Ee=()=>["none",pt,De,Oe],dt=()=>[pt,De,Oe],Tt=()=>[Sa,"full",...R()];return{cacheSize:500,theme:{animate:["spin","ping","pulse","bounce"],aspect:["video"],blur:[bo],breakpoint:[bo],color:[I3],container:[bo],"drop-shadow":[bo],ease:["in","out","in-out"],font:[IY],"font-weight":["thin","extralight","light","normal","medium","semibold","bold","extrabold","black"],"inset-shadow":[bo],leading:["none","tight","snug","normal","relaxed","loose"],perspective:["dramatic","near","normal","midrange","distant","none"],radius:[bo],shadow:[bo],spacing:["px",pt],text:[bo],"text-shadow":[bo],tracking:["tighter","tight","normal","wide","wider","widest"]},classGroups:{aspect:[{aspect:["auto","square",Sa,Oe,De,w]}],container:["container"],"container-type":[{"@container":["","normal","size",De,Oe]}],"container-named":[OY],columns:[{columns:[pt,"auto",Oe,De,l]}],"break-after":[{"break-after":E()}],"break-before":[{"break-before":E()}],"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:I()}],"overflow-x":[{"overflow-x":I()}],"overflow-y":[{"overflow-y":I()}],overscroll:[{overscroll:M()}],"overscroll-x":[{"overscroll-x":M()}],"overscroll-y":[{"overscroll-y":M()}],position:["static","fixed","absolute","relative","sticky"],inset:[{inset:O()}],"inset-x":[{"inset-x":O()}],"inset-y":[{"inset-y":O()}],start:[{"inset-s":O(),start:O()}],end:[{"inset-e":O(),end:O()}],"inset-bs":[{"inset-bs":O()}],"inset-be":[{"inset-be":O()}],top:[{top:O()}],right:[{right:O()}],bottom:[{bottom:O()}],left:[{left:O()}],visibility:["visible","invisible","collapse"],z:[{z:[Li,"auto",De,Oe]}],basis:[{basis:[Sa,"full","auto",l,...R()]}],"flex-direction":[{flex:["row","row-reverse","col","col-reverse"]}],"flex-wrap":[{flex:["nowrap","wrap","wrap-reverse"]}],flex:[{flex:[pt,Sa,"auto","initial","none",Oe]}],grow:[{grow:["",pt,De,Oe]}],shrink:[{shrink:["",pt,De,Oe]}],order:[{order:[Li,"first","last","none",De,Oe]}],"grid-cols":[{"grid-cols":D()}],"col-start-end":[{col:$()}],"col-start":[{"col-start":V()}],"col-end":[{"col-end":V()}],"grid-rows":[{"grid-rows":D()}],"row-start-end":[{row:$()}],"row-start":[{"row-start":V()}],"row-end":[{"row-end":V()}],"grid-flow":[{"grid-flow":["row","col","dense","row-dense","col-dense"]}],"auto-cols":[{"auto-cols":q()}],"auto-rows":[{"auto-rows":q()}],gap:[{gap:R()}],"gap-x":[{"gap-x":R()}],"gap-y":[{"gap-y":R()}],"justify-content":[{justify:[...B(),"normal"]}],"justify-items":[{"justify-items":[...K(),"normal"]}],"justify-self":[{"justify-self":["auto",...K()]}],"align-content":[{content:["normal",...B()]}],"align-items":[{items:[...K(),{baseline:["","last"]}]}],"align-self":[{self:["auto",...K(),{baseline:["","last"]}]}],"place-content":[{"place-content":B()}],"place-items":[{"place-items":[...K(),"baseline"]}],"place-self":[{"place-self":["auto",...K()]}],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:z()}],mx:[{mx:z()}],my:[{my:z()}],ms:[{ms:z()}],me:[{me:z()}],mbs:[{mbs:z()}],mbe:[{mbe:z()}],mt:[{mt:z()}],mr:[{mr:z()}],mb:[{mb:z()}],ml:[{ml:z()}],"space-x":[{"space-x":R()}],"space-x-reverse":["space-x-reverse"],"space-y":[{"space-y":R()}],"space-y-reverse":["space-y-reverse"],size:[{size:X()}],"inline-size":[{inline:["auto",...Z()]}],"min-inline-size":[{"min-inline":["auto",...Z()]}],"max-inline-size":[{"max-inline":["none",...Z()]}],"block-size":[{block:["auto",...J()]}],"min-block-size":[{"min-block":["auto",...J()]}],"max-block-size":[{"max-block":["none",...J()]}],w:[{w:[l,"screen",...X()]}],"min-w":[{"min-w":[l,"screen","none",...X()]}],"max-w":[{"max-w":[l,"screen","none","prose",{screen:[o]},...X()]}],h:[{h:["screen","lh",...X()]}],"min-h":[{"min-h":["screen","lh","none",...X()]}],"max-h":[{"max-h":["screen","lh","none",...X()]}],"font-size":[{text:["base",n,Tf,jl]}],"font-smoothing":["antialiased","subpixel-antialiased"],"font-style":["italic","not-italic"],"font-weight":[{font:[r,HY,NY]}],"font-stretch":[{"font-stretch":["ultra-condensed","extra-condensed","condensed","semi-condensed","normal","semi-expanded","expanded","extra-expanded","ultra-expanded",b_,Oe]}],"font-family":[{font:[$Y,DY,e]}],"font-features":[{"font-features":[Oe]}],"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,De,Oe]}],"line-clamp":[{"line-clamp":[pt,"none",De,JE]}],leading:[{leading:["none",i,...R()]}],"list-image":[{"list-image":["none",De,Oe]}],"list-style-position":[{list:["inside","outside"]}],"list-style-type":[{list:["disc","decimal","none",De,Oe]}],"text-alignment":[{text:["left","center","right","justify","start","end"]}],"placeholder-color":[{placeholder:H()}],"text-color":[{text:H()}],"text-decoration":["underline","overline","line-through","no-underline"],"text-decoration-style":[{decoration:[...ge(),"wavy"]}],"text-decoration-thickness":[{decoration:[pt,"from-font","auto",De,jl]}],"text-decoration-color":[{decoration:H()}],"underline-offset":[{"underline-offset":[pt,"auto",De,Oe]}],"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:[Li,De,Oe]}],"vertical-align":[{align:["baseline","top","middle","bottom","text-top","text-bottom","sub","super",De,Oe]}],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",De,Oe]}],"bg-attachment":[{bg:["fixed","local","scroll"]}],"bg-clip":[{"bg-clip":["border","padding","content","text"]}],"bg-origin":[{"bg-origin":["border","padding","content"]}],"bg-position":[{bg:N()}],"bg-repeat":[{bg:Y()}],"bg-size":[{bg:ae()}],"bg-image":[{bg:["none",{linear:[{to:["t","tr","r","br","b","bl","l","tl"]},Li,De,Oe],radial:["",De,Oe],conic:["",Li,De,Oe]},VY,jY]}],"bg-color":[{bg:H()}],"gradient-from-pos":[{from:se()}],"gradient-via-pos":[{via:se()}],"gradient-to-pos":[{to:se()}],"gradient-from":[{from:H()}],"gradient-via":[{via:H()}],"gradient-to":[{to:H()}],rounded:[{rounded:ie()}],"rounded-s":[{"rounded-s":ie()}],"rounded-e":[{"rounded-e":ie()}],"rounded-t":[{"rounded-t":ie()}],"rounded-r":[{"rounded-r":ie()}],"rounded-b":[{"rounded-b":ie()}],"rounded-l":[{"rounded-l":ie()}],"rounded-ss":[{"rounded-ss":ie()}],"rounded-se":[{"rounded-se":ie()}],"rounded-ee":[{"rounded-ee":ie()}],"rounded-es":[{"rounded-es":ie()}],"rounded-tl":[{"rounded-tl":ie()}],"rounded-tr":[{"rounded-tr":ie()}],"rounded-br":[{"rounded-br":ie()}],"rounded-bl":[{"rounded-bl":ie()}],"border-w":[{border:de()}],"border-w-x":[{"border-x":de()}],"border-w-y":[{"border-y":de()}],"border-w-s":[{"border-s":de()}],"border-w-e":[{"border-e":de()}],"border-w-bs":[{"border-bs":de()}],"border-w-be":[{"border-be":de()}],"border-w-t":[{"border-t":de()}],"border-w-r":[{"border-r":de()}],"border-w-b":[{"border-b":de()}],"border-w-l":[{"border-l":de()}],"divide-x":[{"divide-x":de()}],"divide-x-reverse":["divide-x-reverse"],"divide-y":[{"divide-y":de()}],"divide-y-reverse":["divide-y-reverse"],"border-style":[{border:[...ge(),"hidden","none"]}],"divide-style":[{divide:[...ge(),"hidden","none"]}],"border-color":[{border:H()}],"border-color-x":[{"border-x":H()}],"border-color-y":[{"border-y":H()}],"border-color-s":[{"border-s":H()}],"border-color-e":[{"border-e":H()}],"border-color-bs":[{"border-bs":H()}],"border-color-be":[{"border-be":H()}],"border-color-t":[{"border-t":H()}],"border-color-r":[{"border-r":H()}],"border-color-b":[{"border-b":H()}],"border-color-l":[{"border-l":H()}],"divide-color":[{divide:H()}],"outline-style":[{outline:[...ge(),"none","hidden"]}],"outline-offset":[{"outline-offset":[pt,De,Oe]}],"outline-w":[{outline:["",pt,Tf,jl]}],"outline-color":[{outline:H()}],shadow:[{shadow:["","inner","none",f,O0,I0]}],"shadow-color":[{shadow:H()}],"inset-shadow":[{"inset-shadow":["none",h,O0,I0]}],"inset-shadow-color":[{"inset-shadow":H()}],"ring-w":[{ring:de()}],"ring-w-inset":["ring-inset"],"ring-color":[{ring:H()}],"ring-offset-w":[{"ring-offset":[pt,jl]}],"ring-offset-color":[{"ring-offset":H()}],"inset-ring-w":[{"inset-ring":de()}],"inset-ring-color":[{"inset-ring":H()}],"text-shadow":[{"text-shadow":["none",g,O0,I0]}],"text-shadow-color":[{"text-shadow":H()}],opacity:[{opacity:[pt,De,Oe]}],"mix-blend":[{"mix-blend":[...ue(),"plus-darker","plus-lighter"]}],"bg-blend":[{"bg-blend":ue()}],"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":[pt]}],"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":H()}],"mask-image-linear-to-color":[{"mask-linear-to":H()}],"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":H()}],"mask-image-t-to-color":[{"mask-t-to":H()}],"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":H()}],"mask-image-r-to-color":[{"mask-r-to":H()}],"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":H()}],"mask-image-b-to-color":[{"mask-b-to":H()}],"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":H()}],"mask-image-l-to-color":[{"mask-l-to":H()}],"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":H()}],"mask-image-x-to-color":[{"mask-x-to":H()}],"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":H()}],"mask-image-y-to-color":[{"mask-y-to":H()}],"mask-image-radial":[{"mask-radial":[De,Oe]}],"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":H()}],"mask-image-radial-to-color":[{"mask-radial-to":H()}],"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":P()}],"mask-image-conic-pos":[{"mask-conic":[pt]}],"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":H()}],"mask-image-conic-to-color":[{"mask-conic-to":H()}],"mask-mode":[{mask:["alpha","luminance","match"]}],"mask-origin":[{"mask-origin":["border","padding","content","fill","stroke","view"]}],"mask-position":[{mask:N()}],"mask-repeat":[{mask:Y()}],"mask-size":[{mask:ae()}],"mask-type":[{"mask-type":["alpha","luminance"]}],"mask-image":[{mask:["none",De,Oe]}],filter:[{filter:["","none",De,Oe]}],blur:[{blur:Pe()}],brightness:[{brightness:[pt,De,Oe]}],contrast:[{contrast:[pt,De,Oe]}],"drop-shadow":[{"drop-shadow":["","none",v,O0,I0]}],"drop-shadow-color":[{"drop-shadow":H()}],grayscale:[{grayscale:["",pt,De,Oe]}],"hue-rotate":[{"hue-rotate":[pt,De,Oe]}],invert:[{invert:["",pt,De,Oe]}],saturate:[{saturate:[pt,De,Oe]}],sepia:[{sepia:["",pt,De,Oe]}],"backdrop-filter":[{"backdrop-filter":["","none",De,Oe]}],"backdrop-blur":[{"backdrop-blur":Pe()}],"backdrop-brightness":[{"backdrop-brightness":[pt,De,Oe]}],"backdrop-contrast":[{"backdrop-contrast":[pt,De,Oe]}],"backdrop-grayscale":[{"backdrop-grayscale":["",pt,De,Oe]}],"backdrop-hue-rotate":[{"backdrop-hue-rotate":[pt,De,Oe]}],"backdrop-invert":[{"backdrop-invert":["",pt,De,Oe]}],"backdrop-opacity":[{"backdrop-opacity":[pt,De,Oe]}],"backdrop-saturate":[{"backdrop-saturate":[pt,De,Oe]}],"backdrop-sepia":[{"backdrop-sepia":["",pt,De,Oe]}],"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",De,Oe]}],"transition-behavior":[{transition:["normal","discrete"]}],duration:[{duration:[pt,"initial",De,Oe]}],ease:[{ease:["linear","initial",S,De,Oe]}],delay:[{delay:[pt,De,Oe]}],animate:[{animate:["none",k,De,Oe]}],backface:[{backface:["hidden","visible"]}],perspective:[{perspective:[_,De,Oe]}],"perspective-origin":[{"perspective-origin":T()}],rotate:[{rotate:$e()}],"rotate-x":[{"rotate-x":$e()}],"rotate-y":[{"rotate-y":$e()}],"rotate-z":[{"rotate-z":$e()}],scale:[{scale:Ee()}],"scale-x":[{"scale-x":Ee()}],"scale-y":[{"scale-y":Ee()}],"scale-z":[{"scale-z":Ee()}],"scale-3d":["scale-3d"],skew:[{skew:dt()}],"skew-x":[{"skew-x":dt()}],"skew-y":[{"skew-y":dt()}],transform:[{transform:[De,Oe,"","none","gpu","cpu"]}],"transform-origin":[{origin:T()}],"transform-style":[{transform:["3d","flat"]}],translate:[{translate:Tt()}],"translate-x":[{"translate-x":Tt()}],"translate-y":[{"translate-y":Tt()}],"translate-z":[{"translate-z":Tt()}],"translate-none":["translate-none"],zoom:[{zoom:[Li,De,Oe]}],accent:[{accent:H()}],appearance:[{appearance:["none","auto"]}],"caret-color":[{caret:H()}],"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",De,Oe]}],"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":H()}],"scrollbar-track-color":[{"scrollbar-track":H()}],"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",De,Oe]}],fill:[{fill:["none",...H()]}],"stroke-w":[{stroke:[pt,Tf,jl,JE]}],stroke:[{stroke:["none",...H()]}],"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"]}},BY=xY(UY);function zt(...t){return BY(C3(t))}const rh=({provider:t,className:e})=>{if(t==="x")return b.jsx(QK,{className:zt("h-6 w-6",e),"aria-hidden":"true"});if(t==="pinterest")return b.jsx("svg",{viewBox:"0 0 24 24",className:zt("h-6 w-6",e),"aria-hidden":"true",children:b.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"?JK:XK;return b.jsx("span",{"aria-hidden":"true",className:zt("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"}})},ZY=Rn({hash:Qe().regex(/^[a-f0-9]{64}$/),mimeType:Ug(["image/png","image/jpeg","image/webp","image/gif","image/avif"])}),WY=Rn({id:Qe().min(1),title:Qe().trim().min(1),url:Qe().url().refine(t=>{try{const e=new URL(t);return["http:","https:"].includes(e.protocol)&&!e.username&&!e.password}catch{return!1}}).optional(),reason:Qe().optional(),image:ZY.optional().catch(void 0)}).refine(t=>!!(t.url||t.image),{message:"A reference requires a public URL or an image"}),qY=(...t)=>{const e=[],n=new Set,r=new Set;for(const s of t.flatMap(i=>i??[])){const i=WY.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 u=e.find(d=>d.url===l&&(l!==void 0||d.id===o.id));u&&!u.image&&o.image&&(u.id===o.id||!n.has(o.id))&&(u.id=o.id,u.image=o.image,n.add(o.id));continue}e.push({...o,...l?{url:l}:{}}),n.add(o.id),l&&r.add(l)}return e.length?e:void 0},GY=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},KY=({reference:t,imageUrl:e,onOpen:n})=>{const[r,s]=m.useState(!1),i=!!e&&!r,o=t.url?GY(t.url):null,l=t.url??(i?e:void 0),u=l?"a":"span",d=i&&t.url?new URL(t.url).hostname:t.title;return b.jsxs(u,{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:zt("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?b.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")?b.jsx(rh,{provider:o,className:zt("h-3.5 w-3.5 shrink-0",o==="pinterest"&&"text-[#e60023]")}):null,!i||!o?b.jsx("span",{className:"max-w-40 truncate",children:d}):null]})},YY=({references:t,source:e,sessionId:n,variantId:r,projectPath:s,className:i})=>{const o=Xs(),l=qY(t);return l?b.jsx("div",{className:zt("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(u=>{var h;const d=s?`?${new URLSearchParams({projectPath:s})}`:"",f=u.image&&n&&r?`/api/variants/${encodeURIComponent(n)}/${encodeURIComponent(r)}/references/${encodeURIComponent(u.id)}/image${d}`:void 0;return b.jsx(KY,{reference:u,imageUrl:f,onOpen:()=>o==null?void 0:o.capture("preview_reference_opened",{variant_source:e,reference_count:l.length})},`${u.id}:${((h=u.image)==null?void 0:h.hash)??""}:${f??""}`)})}):null},Kae=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}},Yae=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},QY=t=>{const e=new URLSearchParams(t),n=e.get("historySession"),r=e.get("historyVariant");return n&&r?{sessionId:n,variantId:r}:null},nP=t=>typeof t=="boolean"?`${t}`:t===0?"0":t,rP=C3,XY=(t,e)=>n=>{var r;if((e==null?void 0:e.variants)==null)return rP(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 g=nP(f)||nP(h);return s[d][g]}),l=n&&Object.entries(n).reduce((d,f)=>{let[h,g]=f;return g===void 0||(d[h]=g),d},{}),u=e==null||(r=e.compoundVariants)===null||r===void 0?void 0:r.reduce((d,f)=>{let{class:h,className:g,...v}=f;return Object.entries(v).every(x=>{let[_,w]=x;return Array.isArray(w)?w.includes({...i,...l}[_]):{...i,...l}[_]===w})?[...d,h,g]:d},[]);return rP(t,o,u,n==null?void 0:n.class,n==null?void 0:n.className)},V3={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"}},H3=m.createContext(null);function ip(){const t=m.useContext(H3);return t?t.classes:V3.pill}function JY(t){const e=document.documentElement;e.classList.add("transitioning"),e.offsetHeight,t(),setTimeout(()=>e.classList.remove("transitioning"),200)}function eQ({children:t,defaultShape:e="pill"}){const[n,r]=m.useState(e),s=m.useCallback(i=>{JY(()=>r(i))},[]);return b.jsx(H3.Provider,{value:{shape:n,setShape:s,classes:V3[n]},children:t})}const tQ=XY(["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"}}),sP={default:16,compact:14},nQ={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)]"},z3=m.forwardRef(({className:t,variant:e,size:n,isLoading:r=!1,leadingIcon:s,trailingIcon:i,disabled:o,children:l,type:u="button",...d},f)=>{const h=e??"secondary",g=n??"default",v=g==="icon"||g==="icon-compact",x=g==="compact"||g==="icon-compact",_=x?sP.compact:sP.default,w=ip();return b.jsxs("button",{...d,ref:f,type:u,disabled:o||r,"aria-busy":r||d["aria-busy"],className:zt(tQ({variant:h,size:g,iconLeft:!v&&!!s,iconRight:!v&&!!i}),w.button,t),children:[b.jsx("span",{"aria-hidden":!0,className:zt("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",nQ[h])}),b.jsxs("span",{className:"relative inline-flex items-center justify-center gap-[inherit]",children:[b.jsxs("span",{className:zt("inline-flex items-center justify-center gap-[inherit]",r&&"opacity-0"),children:[s&&!v?b.jsx(s,{size:_,strokeWidth:1.5,"aria-hidden":!0}):null,b.jsx("span",{className:"[text-box:trim-both_cap_alphabetic]",children:l}),i&&!v?b.jsx(i,{size:_,strokeWidth:1.5,"aria-hidden":!0}):null]}),r?b.jsx("span",{"aria-hidden":!0,className:"absolute inset-0 flex items-center justify-center",children:b.jsx("svg",{className:x?"h-7 w-7":"h-9 w-9",viewBox:"0 0 24 24",fill:"none",children:b.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]})]})});z3.displayName="Button";var rQ=Object.defineProperty,Od=(t,e)=>rQ(t,"name",{value:e,configurable:!0}),U3=!!(typeof window<"u"&&window.document&&window.document.createElement);function Bt(t,e,{checkForDefaultPrevented:n=!0}={}){return Od(function(s){if(t==null||t(s),n===!1||!s||!s.defaultPrevented)return e==null?void 0:e(s)},"handleEvent")}Od(Bt,"composeEventHandlers");function sQ(t){var e;if(!U3)throw new Error("Cannot access window outside of the DOM");return((e=t==null?void 0:t.ownerDocument)==null?void 0:e.defaultView)??window}Od(sQ,"getOwnerWindow");function Nw(t){if(!U3)throw new Error("Cannot access document outside of the DOM");return(t==null?void 0:t.ownerDocument)??document}Od(Nw,"getOwnerDocument");function B3(t,e=!1){const{activeElement:n}=Nw(t);if(!(n!=null&&n.nodeName))return null;if(Z3(n)&&n.contentDocument)return B3(n.contentDocument.body,e);if(e){const r=n.getAttribute("aria-activedescendant");if(r){const s=Nw(n).getElementById(r);if(s)return s}}return n}Od(B3,"getActiveElement");function Z3(t){return t.tagName==="IFRAME"}Od(Z3,"isFrame");var iQ=Object.defineProperty,Hb=(t,e)=>iQ(t,"name",{value:e,configurable:!0});function Dw(t,e){if(typeof t=="function")return t(e);t!=null&&(t.current=e)}Hb(Dw,"setRef");function W3(...t){return e=>{let n=!1;const r=t.map(s=>{const i=Dw(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():Dw(t[s],null)}}}}Hb(W3,"composeRefs");function Zt(...t){return m.useCallback(W3(...t),t)}Hb(Zt,"useComposedRefs");var oQ=Object.defineProperty,Ws=(t,e)=>oQ(t,"name",{value:e,configurable:!0});function aQ(t,e){const n=m.createContext(e);n.displayName=t+"Context";const r=Ws(i=>{const{children:o,...l}=i,u=m.useMemo(()=>l,Object.values(l));return b.jsx(n.Provider,{value:u,children:o})},"Provider");r.displayName=t+"Provider";function s(i,o={}){const{optional:l=!1}=o,u=m.useContext(n);if(u)return u;if(e!==void 0)return e;if(!l)throw new Error(`\`${i}\` must be used within \`${t}\``)}return Ws(s,"useContext"),[r,s]}Ws(aQ,"createContext");function io(t,e=[]){let n=[];function r(i,o){const l=m.createContext(o);l.displayName=i+"Context";const u=n.length;n=[...n,o];const d=Ws(h=>{var S;const{scope:g,children:v,...x}=h,_=((S=g==null?void 0:g[t])==null?void 0:S[u])||l,w=m.useMemo(()=>x,Object.values(x));return b.jsx(_.Provider,{value:w,children:v})},"Provider");d.displayName=i+"Provider";function f(h,g,v={}){var S;const{optional:x=!1}=v,_=((S=g==null?void 0:g[t])==null?void 0:S[u])||l,w=m.useContext(_);if(w)return w;if(o!==void 0)return o;if(!x)throw new Error(`\`${h}\` must be used within \`${i}\``)}return Ws(f,"useContext"),[d,f]}Ws(r,"createContext");const s=Ws(()=>{const i=n.map(o=>m.createContext(o));return Ws(function(l){const u=(l==null?void 0:l[t])||i;return m.useMemo(()=>({[`__scope${t}`]:{...l,[t]:u}}),[l,u])},"useScope")},"createScope");return s.scopeName=t,[r,q3(s,...e)]}Ws(io,"createContextScope");function q3(...t){const e=t[0];if(t.length===1)return e;const n=Ws(()=>{const r=t.map(s=>({useScope:s(),scopeName:s.scopeName}));return Ws(function(i){const o=r.reduce((l,{useScope:u,scopeName:d})=>{const h=u(i)[`__scope${d}`];return{...l,...h}},{});return m.useMemo(()=>({[`__scope${e.scopeName}`]:o}),[o])},"useComposedScopes")},"createScope");return n.scopeName=e.scopeName,n}Ws(q3,"composeContextScopes");var lQ=Object.defineProperty,Ms=(t,e)=>lQ(t,"name",{value:e,configurable:!0});function Qa(t){const e=m.forwardRef((n,r)=>{let{children:s,...i}=n,o=null,l=!1;const u=[];s=eO(s),m.Children.forEach(s,g=>{var v;if(X3(g)){l=!0;const x=g;let _="child"in x.props?x.props.child:x.props.children;for(;zb(_)&&typeof yg=="function";)_=yg(_._payload);o=cQ(x,_),u.push((v=o==null?void 0:o.props)==null?void 0:v.children)}else u.push(g)}),o?o=m.cloneElement(o,void 0,u):!l&&m.Children.count(s)===1&&m.isValidElement(s)&&(o=s);const d=o?Q3(o):void 0,f=Zt(r,d);if(!o){if(s||s===0)throw new Error(l?fQ(t):dQ(t));return s}const h=Y3(i,o.props??{});return o.type!==m.Fragment&&(h.ref=r?f:d),m.cloneElement(o,h)});return e.displayName=`${t}.Slot`,e}Ms(Qa,"createSlot");var G3=Symbol.for("radix.slottable");function K3(t){const e=Ms(n=>"child"in n?n.children(n.child):n.children,"Slottable");return e.displayName=`${t}.Slottable`,e.__radixId=G3,e}Ms(K3,"createSlottable");var cQ=Ms((t,e)=>"child"in t.props?m.isValidElement(e)?m.cloneElement(e,void 0,t.props.children(e.props.children)):null:m.isValidElement(e)?e:null,"getSlottableElementFromSlottable");function Y3(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 u=i(...l);return s(...l),u}:s&&(n[r]=s):r==="style"?n[r]={...s,...i}:r==="className"?n[r]=[s,i].filter(Boolean).join(" "):r==="aria-describedby"&&(n[r]=tO(i,s))}return{...t,...n}}Ms(Y3,"mergeProps");function Q3(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)}Ms(Q3,"getElementRef");function X3(t){return m.isValidElement(t)&&typeof t.type=="function"&&"__radixId"in t.type&&t.type.__radixId===G3}Ms(X3,"isSlottable");var uQ=Symbol.for("react.lazy");function zb(t){return t!=null&&typeof t=="object"&&"$$typeof"in t&&t.$$typeof===uQ&&"_payload"in t&&J3(t._payload)}Ms(zb,"isLazyComponent");function J3(t){return typeof t=="object"&&t!==null&&"then"in t}Ms(J3,"isPromiseLike");function eO(t){let e=t;for(;zb(e)&&typeof yg=="function";)e=yg(e._payload);return e}Ms(eO,"useUnwrappedLazy");function tO(...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}Ms(tO,"concatAriaDescribedby");var dQ=Ms(t=>`${t} failed to slot onto its children. Expected a single React element child or \`Slottable\`.`,"createSlotError"),fQ=Ms(t=>`${t} failed to slot onto its \`Slottable\`. Expected \`Slottable\` to receive a single React element child.`,"createSlottableError"),yg=Ad[" use ".trim().toString()],hQ=Object.defineProperty,pQ=(t,e)=>hQ(t,"name",{value:e,configurable:!0}),mQ=["a","button","div","form","h2","h3","img","input","label","li","nav","ol","p","select","span","svg","ul"],kn=mQ.reduce((t,e)=>{const n=Qa(`Primitive.${e}`),r=m.forwardRef((s,i)=>{const{asChild:o,...l}=s,u=o?n:e;return typeof window<"u"&&(window[Symbol.for("radix-ui")]=!0),b.jsx(u,{...l,ref:i})});return r.displayName=`Primitive.${e}`,{...t,[e]:r}},{});function nO(t,e){t&&sp.flushSync(()=>t.dispatchEvent(e))}pQ(nO,"dispatchDiscreteCustomEvent");var Mr=globalThis!=null&&globalThis.document?m.useLayoutEffect:()=>{},gQ=Object.defineProperty,vQ=(t,e)=>gQ(t,"name",{value:e,configurable:!0}),iP=Ad[" useInsertionEffect ".trim().toString()];function kc(t){const e=m.useRef(t);return typeof iP=="function"?iP(()=>{e.current=t}):Mr(()=>{e.current=t}),m.useMemo(()=>((...n)=>{var r;return(r=e.current)==null?void 0:r.call(e,...n)}),[])}vQ(kc,"useCallbackRef");var yQ=Object.defineProperty,lr=(t,e)=>yQ(t,"name",{value:e,configurable:!0}),jw="dismissableLayer.update",_Q="dismissableLayer.pointerDownOutside",wQ="dismissableLayer.focusOutside",oP,rO=m.createContext({layers:new Set,layersWithOutsidePointerEventsDisabled:new Set,branches:new Set,dismissableSurfaces:new Set}),Ub=m.forwardRef(lr(function(e,n){const{disableOutsidePointerEvents:r=!1,deferPointerDownOutside:s=!1,onEscapeKeyDown:i,onPointerDownOutside:o,onFocusOutside:l,onInteractOutside:u,onDismiss:d,...f}=e,h=m.useContext(rO),[g,v]=m.useState(null),x=(g==null?void 0:g.ownerDocument)??(globalThis==null?void 0:globalThis.document),[,_]=m.useState({}),w=Zt(n,v),S=Array.from(h.layers),[k]=[...h.layersWithOutsidePointerEventsDisabled].slice(-1),E=k?S.indexOf(k):-1,P=g?S.indexOf(g):-1,T=h.layersWithOutsidePointerEventsDisabled.size>0,I=P>=E,M=m.useRef(!1),R=iO(V=>{o==null||o(V),u==null||u(V),V.defaultPrevented||d==null||d()},{ownerDocument:x,deferPointerDownOutside:s,isDeferredPointerDownOutsideRef:M,dismissableSurfaces:h.dismissableSurfaces,shouldHandlePointerDownOutside:m.useCallback(V=>{if(!(V instanceof Node))return!1;const q=[...h.branches].some(B=>B.contains(V));return I&&!q},[h.branches,I])}),O=oO(V=>{if(s&&M.current)return;const q=V.target;[...h.branches].some(K=>K.contains(q))||(l==null||l(V),u==null||u(V),V.defaultPrevented||d==null||d())},x),D=g?P===S.length-1:!1,$=kc(V=>{V.key==="Escape"&&(i==null||i(V),!V.defaultPrevented&&d&&(V.preventDefault(),d()))});return m.useEffect(()=>{if(D)return x.addEventListener("keydown",$,{capture:!0}),()=>x.removeEventListener("keydown",$,{capture:!0})},[x,D,$]),m.useEffect(()=>{if(g)return r&&(h.layersWithOutsidePointerEventsDisabled.size===0&&(oP=x.body.style.pointerEvents,x.body.style.pointerEvents="none"),h.layersWithOutsidePointerEventsDisabled.add(g)),h.layers.add(g),$w(),()=>{r&&(h.layersWithOutsidePointerEventsDisabled.delete(g),h.layersWithOutsidePointerEventsDisabled.size===0&&(x.body.style.pointerEvents=oP))}},[g,x,r,h]),m.useEffect(()=>()=>{g&&(h.layers.delete(g),h.layersWithOutsidePointerEventsDisabled.delete(g),$w())},[g,h]),m.useEffect(()=>{const V=lr(()=>_({}),"handleUpdate");return document.addEventListener(jw,V),()=>document.removeEventListener(jw,V)},[]),b.jsx(kn.div,{...f,ref:w,style:{pointerEvents:T?I?"auto":"none":void 0,...e.style},onFocusCapture:Bt(e.onFocusCapture,O.onFocusCapture),onBlurCapture:Bt(e.onBlurCapture,O.onBlurCapture),onPointerDownCapture:Bt(e.onPointerDownCapture,R.onPointerDownCapture)})},"DismissableLayer"));function sO(){const t=m.useContext(rO),[e,n]=m.useState(null);return m.useEffect(()=>{if(e)return t.dismissableSurfaces.add(e),()=>{t.dismissableSurfaces.delete(e)}},[e,t.dismissableSurfaces]),n}lr(sO,"useDismissableLayerSurface");var xQ=lr(()=>!0,"IS_TRUE");function iO(t,e){const{ownerDocument:n=globalThis==null?void 0:globalThis.document,deferPointerDownOutside:r=!1,isDeferredPointerDownOutsideRef:s,dismissableSurfaces:i,shouldHandlePointerDownOutside:o=xQ}=e,l=kc(t),u=m.useRef(!1),d=m.useRef(!1),f=m.useRef(new Map),h=m.useRef(()=>{});return m.useEffect(()=>{function g(){d.current=!1,s.current=!1,f.current.clear()}lr(g,"resetOutsideInteraction");function v(){return Array.from(f.current.values()).some(Boolean)}lr(v,"isOutsideInteractionIntercepted");function x(E){if(!d.current)return;const P=E.target;P instanceof Node&&[...i].some(I=>I.contains(P))||f.current.set(E.type,!0),E.type==="click"&&window.setTimeout(()=>{d.current&&h.current()},0)}lr(x,"handleInteractionCapture");function _(E){d.current&&f.current.set(E.type,!1)}lr(_,"handleInteractionBubble");const w=lr(E=>{if(E.target&&!u.current){let P=function(){n.removeEventListener("click",h.current);const I=v();g(),I||Bb(_Q,l,T,{discrete:!0})};if(lr(P,"handleAndDispatchPointerDownOutsideEvent"),!o(E.target)){n.removeEventListener("click",h.current),g(),u.current=!1;return}const T={originalEvent:E};d.current=!0,s.current=r&&E.button===0,f.current.clear(),!r||E.button!==0?P():(n.removeEventListener("click",h.current),h.current=P,n.addEventListener("click",h.current,{once:!0}))}else n.removeEventListener("click",h.current),g();u.current=!1},"handlePointerDown"),S=["pointerup","mousedown","mouseup","touchstart","touchend","click"];for(const E of S)n.addEventListener(E,x,!0),n.addEventListener(E,_);const k=window.setTimeout(()=>{n.addEventListener("pointerdown",w)},0);return()=>{window.clearTimeout(k),n.removeEventListener("pointerdown",w),n.removeEventListener("click",h.current);for(const E of S)n.removeEventListener(E,x,!0),n.removeEventListener(E,_)}},[n,l,r,s,i,o]),{onPointerDownCapture:lr(()=>u.current=!0,"onPointerDownCapture")}}lr(iO,"usePointerDownOutside");function oO(t,e=globalThis==null?void 0:globalThis.document){const n=kc(t),r=m.useRef(!1);return m.useEffect(()=>{const s=lr(i=>{i.target&&!r.current&&Bb(wQ,n,{originalEvent:i},{discrete:!1})},"handleFocus");return e.addEventListener("focusin",s),()=>e.removeEventListener("focusin",s)},[e,n]),{onFocusCapture:lr(()=>r.current=!0,"onFocusCapture"),onBlurCapture:lr(()=>r.current=!1,"onBlurCapture")}}lr(oO,"useFocusOutside");function $w(){const t=new CustomEvent(jw);document.dispatchEvent(t)}lr($w,"dispatchUpdate");function Bb(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?nO(s,i):s.dispatchEvent(i)}lr(Bb,"handleAndDispatchCustomEvent");var bQ=Object.defineProperty,Wn=(t,e)=>bQ(t,"name",{value:e,configurable:!0}),S_="focusScope.autoFocusOnMount",k_="focusScope.autoFocusOnUnmount",aP={bubbles:!1,cancelable:!0},aO=m.forwardRef(Wn(function(e,n){const{loop:r=!1,trapped:s=!1,branches:i,onMountAutoFocus:o,onUnmountAutoFocus:l,...u}=e,[d,f]=m.useState(null),h=kc(o),g=kc(l),v=m.useRef(null),x=Zt(n,f),_=m.useRef(i);m.useEffect(()=>{_.current=i});const w=m.useCallback(E=>{var P;return E?d!=null&&d.contains(E)?!0:!!((P=_.current)!=null&&P.some(T=>T.contains(E))):!1},[d]),S=m.useRef({paused:!1,pause(){this.paused=!0},resume(){this.paused=!1}}).current;m.useEffect(()=>{if(s){let E=function(M){if(S.paused||!d)return;const R=M.target;w(R)?v.current=R:Ro(v.current,{select:!0})},P=function(M){if(S.paused||!d)return;const R=M.relatedTarget;R!==null&&(w(R)||Ro(v.current,{select:!0}))},T=function(M){if(document.activeElement===document.body)for(const O of M)O.removedNodes.length>0&&Ro(d)};Wn(E,"handleFocusIn"),Wn(P,"handleFocusOut"),Wn(T,"handleMutations"),document.addEventListener("focusin",E),document.addEventListener("focusout",P);const I=new MutationObserver(T);return d&&I.observe(d,{childList:!0,subtree:!0}),()=>{document.removeEventListener("focusin",E),document.removeEventListener("focusout",P),I.disconnect()}}},[s,d,S.paused,w]),m.useEffect(()=>{if(d){lP.add(S);const E=document.activeElement;if(!d.contains(E)){const T=new CustomEvent(S_,aP);d.addEventListener(S_,h),d.dispatchEvent(T),T.defaultPrevented||(cO(pO(Gb(d)),{select:!0}),document.activeElement===E&&Ro(d))}return()=>{d.removeEventListener(S_,h);const T=d.ownerDocument,I=CustomEvent;setTimeout(()=>{const M=new I(k_,aP);d.addEventListener(k_,g),d.dispatchEvent(M),M.defaultPrevented||Ro(E??T.body,{select:!0}),d.removeEventListener(k_,g),lP.remove(S)},0)}}},[d,h,g,S]);const k=m.useCallback(E=>{if(!r&&!s||S.paused)return;const P=E.key==="Tab"&&!E.altKey&&!E.ctrlKey&&!E.metaKey,T=document.activeElement;if(P&&T){const I=E.currentTarget,[M,R]=uO(I);M&&R?!E.shiftKey&&T===R?(E.preventDefault(),r&&Ro(M,{select:!0})):E.shiftKey&&T===M&&(E.preventDefault(),r&&Ro(R,{select:!0})):T===I&&E.preventDefault()}},[r,s,S.paused]);return b.jsx(kn.div,{tabIndex:-1,...u,ref:x,onKeyDown:k})},"FocusScope")),lO=m.createContext(null);function Zb({registry:t,children:e}){return t?b.jsx(lO.Provider,{value:t,children:e}):e}Wn(Zb,"FocusScopeBranchProvider");function Wb(){const[t,e]=m.useState([]),n=m.useMemo(()=>({add:Wn(r=>e(s=>s.includes(r)?s:[...s,r]),"add"),remove:Wn(r=>e(s=>s.filter(i=>i!==r)),"remove")}),[]);return{nodes:t,registry:n}}Wn(Wb,"useFocusScopeBranchRegistry");function qb(t){const e=m.useContext(lO);m.useEffect(()=>{if(!(!t||!e))return e.add(t),()=>e.remove(t)},[t,e])}Wn(qb,"useFocusScopeBranch");function cO(t,{select:e=!1}={}){const n=document.activeElement;for(const r of t)if(Ro(r,{select:e}),document.activeElement!==n)return}Wn(cO,"focusFirst");function uO(t){const e=Gb(t),n=Fw(e,t),r=Fw(e.reverse(),t);return[n,r]}Wn(uO,"getTabbableEdges");function Gb(t){const e=[],r=t.ownerDocument.createTreeWalker(t,NodeFilter.SHOW_ELEMENT,{acceptNode:Wn(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}Wn(Gb,"getTabbableCandidates");function Fw(t,e){const n=typeof e.checkVisibility=="function"&&e.checkVisibility({checkVisibilityCSS:!0});for(const r of t)if(!(n?!r.checkVisibility({checkVisibilityCSS:!0}):dO(r,{upTo:e})))return r}Wn(Fw,"findVisible");function dO(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}Wn(dO,"isHidden");function fO(t){return t.tagName==="INPUT"&&typeof t.select=="function"}Wn(fO,"isSelectableInput");function Ro(t,{select:e=!1}={}){if(t&&t.focus){const r=(t.ownerDocument??document).activeElement;t.focus({preventScroll:!0}),t!==r&&fO(t)&&e&&t.select()}}Wn(Ro,"focus");var lP=hO();function hO(){let t=[];return{add(e){const n=t[0];e!==n&&(n==null||n.pause()),t=Vw(t,e),t.unshift(e)},remove(e){var n;t=Vw(t,e),(n=t[0])==null||n.resume()}}}Wn(hO,"createFocusScopesStack");function Vw(t,e){const n=[...t],r=n.indexOf(e);return r!==-1&&n.splice(r,1),n}Wn(Vw,"arrayRemove");function pO(t){return t.filter(e=>e.tagName!=="A")}Wn(pO,"removeLinks");var SQ=Object.defineProperty,kQ=(t,e)=>SQ(t,"name",{value:e,configurable:!0}),CQ=Ad[" useId ".trim().toString()]||(()=>{}),EQ=0;function Xi(t){const[e,n]=m.useState(CQ());return Mr(()=>{t||n(r=>r??String(EQ++))},[t]),t||(e?`radix-${e}`:"")}kQ(Xi,"useId");const PQ=["top","right","bottom","left"],Xa=Math.min,zo=Math.max,_g=Math.round,L0=Math.floor,Uo=t=>({x:t,y:t}),AQ={left:"right",right:"left",bottom:"top",top:"bottom"};function mO(t,e,n){return zo(t,Xa(e,n))}function qo(t,e){return typeof t=="function"?t(e):t}function Ja(t){return t.split("-")[0]}function Ld(t){return t.split("-")[1]}function Kb(t){return t==="x"?"y":"x"}function Yb(t){return t==="y"?"height":"width"}function Gi(t){const e=t[0];return e==="t"||e==="b"?"y":"x"}function Qb(t){return Kb(Gi(t))}function TQ(t,e,n){n===void 0&&(n=!1);const r=Ld(t),s=Qb(t),i=Yb(s);let o=s==="x"?r===(n?"end":"start")?"right":"left":r==="start"?"bottom":"top";return e.reference[i]>e.floating[i]&&(o=wg(o)),[o,wg(o)]}function RQ(t){const e=wg(t);return[Hw(t),e,Hw(e)]}function Hw(t){return t.includes("start")?t.replace("start","end"):t.replace("end","start")}const cP=["left","right"],uP=["right","left"],MQ=["top","bottom"],IQ=["bottom","top"];function OQ(t,e,n){switch(t){case"top":case"bottom":return n?e?uP:cP:e?cP:uP;case"left":case"right":return e?MQ:IQ;default:return[]}}function LQ(t,e,n,r){const s=Ld(t);let i=OQ(Ja(t),n==="start",r);return s&&(i=i.map(o=>o+"-"+s),e&&(i=i.concat(i.map(Hw)))),i}function wg(t){const e=Ja(t);return AQ[e]+t.slice(e.length)}function NQ(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 gO(t){return typeof t!="number"?NQ(t):{top:t,right:t,bottom:t,left:t}}function xg(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 dP(t,e,n){let{reference:r,floating:s}=t;const i=Gi(e),o=Qb(e),l=Yb(o),u=Ja(e),d=i==="y",f=r.x+r.width/2-s.width/2,h=r.y+r.height/2-s.height/2,g=r[l]/2-s[l]/2;let v;switch(u){case"top":v={x:f,y:r.y-s.height};break;case"bottom":v={x:f,y:r.y+r.height};break;case"right":v={x:r.x+r.width,y:h};break;case"left":v={x:r.x-s.width,y:h};break;default:v={x:r.x,y:r.y}}const x=Ld(e);return x&&(v[o]+=g*(x==="end"?1:-1)*(n&&d?-1:1)),v}async function DQ(t,e){var n;e===void 0&&(e={});const{x:r,y:s,platform:i,rects:o,elements:l,strategy:u}=t,{boundary:d="clippingAncestors",rootBoundary:f="viewport",elementContext:h="floating",altBoundary:g=!1,padding:v=0}=qo(e,t),x=gO(v),w=l[g?h==="floating"?"reference":"floating":h],S=xg(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:u})),k=h==="floating"?{x:r,y:s,width:o.floating.width,height:o.floating.height}:o.reference,E=await(i.getOffsetParent==null?void 0:i.getOffsetParent(l.floating)),P=await(i.isElement==null?void 0:i.isElement(E))&&await(i.getScale==null?void 0:i.getScale(E))||{x:1,y:1},T=xg(i.convertOffsetParentRelativeRectToViewportRelativeRect?await i.convertOffsetParentRelativeRectToViewportRelativeRect({elements:l,rect:k,offsetParent:E,strategy:u}):k);return{top:(S.top-T.top+x.top)/P.y,bottom:(T.bottom-S.bottom+x.bottom)/P.y,left:(S.left-T.left+x.left)/P.x,right:(T.right-S.right+x.right)/P.x}}const jQ=50,$Q=async(t,e,n)=>{const{placement:r="bottom",strategy:s="absolute",middleware:i=[],platform:o}=n,l=o.detectOverflow?o:{...o,detectOverflow:DQ},u=await(o.isRTL==null?void 0:o.isRTL(e));let d=await o.getElementRects({reference:t,floating:e,strategy:s}),{x:f,y:h}=dP(d,r,u),g=r,v=0;const x={};for(let _=0;_<i.length;_++){const w=i[_];if(!w)continue;const{name:S,fn:k}=w,{x:E,y:P,data:T,reset:I}=await k({x:f,y:h,initialPlacement:r,placement:g,strategy:s,middlewareData:x,rects:d,platform:l,elements:{reference:t,floating:e}});f=E??f,h=P??h,x[S]={...x[S],...T},I&&v<jQ&&(v++,typeof I=="object"&&(I.placement&&(g=I.placement),I.rects&&(d=I.rects===!0?await o.getElementRects({reference:t,floating:e,strategy:s}):I.rects),{x:f,y:h}=dP(d,g,u)),_=-1)}return{x:f,y:h,placement:g,strategy:s,middlewareData:x}},FQ=t=>({name:"arrow",options:t,async fn(e){const{x:n,y:r,placement:s,rects:i,platform:o,elements:l,middlewareData:u}=e,{element:d,padding:f=0}=qo(t,e)||{};if(d==null)return{};const h=gO(f),g={x:n,y:r},v=Qb(s),x=Yb(v),_=await o.getDimensions(d),w=v==="y",S=w?"top":"left",k=w?"bottom":"right",E=w?"clientHeight":"clientWidth",P=i.reference[x]+i.reference[v]-g[v]-i.floating[x],T=g[v]-i.reference[v],I=await(o.getOffsetParent==null?void 0:o.getOffsetParent(d));let M=I?I[E]:0;(!M||!await(o.isElement==null?void 0:o.isElement(I)))&&(M=l.floating[E]||i.floating[x]);const R=P/2-T/2,O=M/2-_[x]/2-1,D=Xa(h[S],O),$=Xa(h[k],O),V=M-_[x]-$,q=M/2-_[x]/2+R,B=mO(D,q,V),K=!u.arrow&&Ld(s)!=null&&q!==B&&i.reference[x]/2-(q<D?D:$)-_[x]/2<0,z=K?q<D?q-D:q-V:0;return{[v]:g[v]+z,data:{[v]:B,centerOffset:q-B-z,...K&&{alignmentOffset:z}},reset:K}}}),VQ=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:u,elements:d}=e,{mainAxis:f=!0,crossAxis:h=!0,fallbackPlacements:g,fallbackStrategy:v="bestFit",fallbackAxisSideDirection:x="none",flipAlignment:_=!0,...w}=qo(t,e);if((n=i.arrow)!=null&&n.alignmentOffset)return{};const S=Ja(s),k=Gi(l),E=Ja(l)===l,P=await(u.isRTL==null?void 0:u.isRTL(d.floating)),T=g||(E||!_?[wg(l)]:RQ(l)),I=x!=="none";!g&&I&&T.push(...LQ(l,_,x,P));const M=[l,...T],R=await u.detectOverflow(e,w),O=[];let D=((r=i.flip)==null?void 0:r.overflows)||[];if(f&&O.push(R[S]),h){const B=TQ(s,o,P);O.push(R[B[0]],R[B[1]])}if(D=[...D,{placement:s,overflows:O}],!O.every(B=>B<=0)){var $,V;const B=((($=i.flip)==null?void 0:$.index)||0)+1,K=M[B];if(K&&(!(h==="alignment"?k!==Gi(K):!1)||D.every(Z=>Gi(Z.placement)===k?Z.overflows[0]>0:!0)))return{data:{index:B,overflows:D},reset:{placement:K}};let z=(V=D.filter(X=>X.overflows[0]<=0).sort((X,Z)=>X.overflows[1]-Z.overflows[1])[0])==null?void 0:V.placement;if(!z)switch(v){case"bestFit":{var q;const X=(q=D.filter(Z=>{if(I){const J=Gi(Z.placement);return J===k||J==="y"}return!0}).map(Z=>[Z.placement,Z.overflows.filter(J=>J>0).reduce((J,H)=>J+H,0)]).sort((Z,J)=>Z[1]-J[1])[0])==null?void 0:q[0];X&&(z=X);break}case"initialPlacement":z=l;break}if(s!==z)return{reset:{placement:z}}}return{}}}};function fP(t,e){return{top:t.top-e.height,right:t.right-e.width,bottom:t.bottom-e.height,left:t.left-e.width}}function hP(t){return PQ.some(e=>t[e]>=0)}const HQ=function(t){return t===void 0&&(t={}),{name:"hide",options:t,async fn(e){const{rects:n,platform:r}=e,{strategy:s="referenceHidden",...i}=qo(t,e);switch(s){case"referenceHidden":{const o=await r.detectOverflow(e,{...i,elementContext:"reference"}),l=fP(o,n.reference);return{data:{referenceHiddenOffsets:l,referenceHidden:hP(l)}}}case"escaped":{const o=await r.detectOverflow(e,{...i,altBoundary:!0}),l=fP(o,n.floating);return{data:{escapedOffsets:l,escaped:hP(l)}}}default:return{}}}}},vO=new Set(["left","top"]);async function zQ(t,e){const{placement:n,platform:r,elements:s}=t,i=await(r.isRTL==null?void 0:r.isRTL(s.floating)),o=Ja(n),l=Ld(n),u=Gi(n)==="y",d=vO.has(o)?-1:1,f=i&&u?-1:1,h=qo(e,t);let{mainAxis:g,crossAxis:v,alignmentAxis:x}=typeof h=="number"?{mainAxis:h,crossAxis:0,alignmentAxis:null}:{mainAxis:h.mainAxis||0,crossAxis:h.crossAxis||0,alignmentAxis:h.alignmentAxis};return l&&typeof x=="number"&&(v=l==="end"?x*-1:x),u?{x:v*f,y:g*d}:{x:g*d,y:v*f}}const UQ=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,u=await zQ(e,t);return o===((n=l.offset)==null?void 0:n.placement)&&(r=l.arrow)!=null&&r.alignmentOffset?{}:{x:s+u.x,y:i+u.y,data:{...u,placement:o}}}}},BQ=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:u={fn:k=>{let{x:E,y:P}=k;return{x:E,y:P}}},...d}=qo(t,e),f={x:n,y:r},h=await i.detectOverflow(e,d),g=Gi(s),v=Kb(g);let x=f[v],_=f[g];const w=(k,E)=>mO(E+h[k==="y"?"top":"left"],E,E-h[k==="y"?"bottom":"right"]);o&&(x=w(v,x)),l&&(_=w(g,_));const S=u.fn({...e,[v]:x,[g]:_});return{...S,data:{x:S.x-n,y:S.y-r,enabled:{[v]:o,[g]:l}}}}}},ZQ=function(t){return t===void 0&&(t={}),{options:t,fn(e){var n,r;const{x:s,y:i,placement:o,rects:l,middlewareData:u}=e,{offset:d=0,mainAxis:f=!0,crossAxis:h=!0}=qo(t,e),g={x:s,y:i},v=Gi(o),x=Kb(v);let _=g[x],w=g[v];const S=qo(d,e),k=typeof S=="number"?{mainAxis:S,crossAxis:0}:{mainAxis:(n=S.mainAxis)!=null?n:0,crossAxis:(r=S.crossAxis)!=null?r:0};if(f){const T=x==="y"?"height":"width",I=l.reference[x]-l.floating[T]+k.mainAxis,M=l.reference[x]+l.reference[T]-k.mainAxis;_<I?_=I:_>M&&(_=M)}if(h){var E,P;const T=x==="y"?"width":"height",I=vO.has(Ja(o)),M=l.reference[v]-l.floating[T]+(I&&((E=u.offset)==null?void 0:E[v])||0)+(I?0:k.crossAxis),R=l.reference[v]+l.reference[T]+(I?0:((P=u.offset)==null?void 0:P[v])||0)-(I?k.crossAxis:0);w<M?w=M:w>R&&(w=R)}return{[x]:_,[v]:w}}}},WQ=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}=qo(t,e),u=await s.detectOverflow(e,l),d=Ja(n),f=Ld(n),h=Gi(n)==="y",{width:g,height:v}=r.floating;let x,_;d==="top"||d==="bottom"?(x=d,_=f===(await(s.isRTL==null?void 0:s.isRTL(i.floating))?"start":"end")?"left":"right"):(_=d,x=f==="end"?"top":"bottom");const w=v-u.top-u.bottom,S=g-u.left-u.right,k=Xa(v-u[x],w),E=Xa(g-u[_],S),P=e.middlewareData.shift,T=!P;let I=k,M=E;P!=null&&P.enabled.x&&(M=S),P!=null&&P.enabled.y&&(I=w),T&&!f&&(h?M=g-2*zo(u.left,u.right):I=v-2*zo(u.top,u.bottom)),await o({...e,availableWidth:M,availableHeight:I});const R=await s.getDimensions(i.floating);return g!==R.width||v!==R.height?{reset:{rects:!0}}:{}}}};function Jg(){return typeof window<"u"}function Nd(t){return yO(t)?(t.nodeName||"").toLowerCase():"#document"}function is(t){var e;return(t==null||(e=t.ownerDocument)==null?void 0:e.defaultView)||window}function Xo(t){var e;return(e=(yO(t)?t.ownerDocument:t.document)||window.document)==null?void 0:e.documentElement}function yO(t){return Jg()?t instanceof Node||t instanceof is(t).Node:!1}function no(t){return Jg()?t instanceof Element||t instanceof is(t).Element:!1}function ol(t){return Jg()?t instanceof HTMLElement||t instanceof is(t).HTMLElement:!1}function pP(t){return!Jg()||typeof ShadowRoot>"u"?!1:t instanceof ShadowRoot||t instanceof is(t).ShadowRoot}function ev(t){const{overflow:e,overflowX:n,overflowY:r,display:s}=ro(t);return/auto|scroll|overlay|hidden|clip/.test(e+r+n)&&s!=="inline"&&s!=="contents"}function qQ(t){return/^(table|td|th)$/.test(Nd(t))}function tv(t){try{if(t.matches(":popover-open"))return!0}catch{}try{return t.matches(":modal")}catch{return!1}}const GQ=/transform|translate|scale|rotate|perspective|filter/,KQ=/paint|layout|strict|content/,$l=t=>!!t&&t!=="none";let C_;function Xb(t){const e=no(t)?ro(t):t;return $l(e.transform)||$l(e.translate)||$l(e.scale)||$l(e.rotate)||$l(e.perspective)||!Jb()&&($l(e.backdropFilter)||$l(e.filter))||GQ.test(e.willChange||"")||KQ.test(e.contain||"")}function YQ(t){let e=Cc(t);for(;ol(e)&&!Rh(e);){if(Xb(e))return e;if(tv(e))return null;e=Cc(e)}return null}function Jb(){return C_==null&&(C_=typeof CSS<"u"&&CSS.supports&&CSS.supports("-webkit-backdrop-filter","none")),C_}function Rh(t){return/^(html|body|#document)$/.test(Nd(t))}function ro(t){return is(t).getComputedStyle(t)}function nv(t){return no(t)?{scrollLeft:t.scrollLeft,scrollTop:t.scrollTop}:{scrollLeft:t.scrollX,scrollTop:t.scrollY}}function Cc(t){if(Nd(t)==="html")return t;const e=t.assignedSlot||t.parentNode||pP(t)&&t.host||Xo(t);return pP(e)?e.host:e}function _O(t){const e=Cc(t);return Rh(e)?(t.ownerDocument||t).body:ol(e)&&ev(e)?e:_O(e)}function Mh(t,e,n){var r;e===void 0&&(e=[]),n===void 0&&(n=!0);const s=_O(t),i=s===((r=t.ownerDocument)==null?void 0:r.body),o=is(s);if(i){const l=zw(o);return e.concat(o,o.visualViewport||[],ev(s)?s:[],l&&n?Mh(l):[])}else return e.concat(s,Mh(s,[],n))}function zw(t){return t.parent&&Object.getPrototypeOf(t.parent)?t.frameElement:null}function wO(t){const e=ro(t);let n=parseFloat(e.width)||0,r=parseFloat(e.height)||0;const s=ol(t),i=s?t.offsetWidth:n,o=s?t.offsetHeight:r,l=_g(n)!==i||_g(r)!==o;return l&&(n=i,r=o),{width:n,height:r,$:l}}function e6(t){return no(t)?t:t.contextElement}function Vu(t){const e=e6(t);if(!ol(e))return Uo(1);const n=e.getBoundingClientRect(),{width:r,height:s,$:i}=wO(e);let o=(i?_g(n.width):n.width)/r,l=(i?_g(n.height):n.height)/s;return(!o||!Number.isFinite(o))&&(o=1),(!l||!Number.isFinite(l))&&(l=1),{x:o,y:l}}const QQ=Uo(0);function xO(t){const e=is(t);return!Jb()||!e.visualViewport?QQ:{x:e.visualViewport.offsetLeft,y:e.visualViewport.offsetTop}}function XQ(t,e,n){return e===void 0&&(e=!1),!!n&&e&&n===is(t)}function Ec(t,e,n,r){e===void 0&&(e=!1),n===void 0&&(n=!1);const s=t.getBoundingClientRect(),i=e6(t);let o=Uo(1);e&&(r?no(r)&&(o=Vu(r)):o=Vu(t));const l=XQ(i,n,r)?xO(i):Uo(0);let u=(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 g=is(i),v=no(r)?is(r):r;let x=g,_=zw(x);for(;_&&v!==x;){const w=Vu(_),S=_.getBoundingClientRect(),k=ro(_),E=S.left+(_.clientLeft+parseFloat(k.paddingLeft))*w.x,P=S.top+(_.clientTop+parseFloat(k.paddingTop))*w.y;u*=w.x,d*=w.y,f*=w.x,h*=w.y,u+=E,d+=P,x=is(_),_=zw(x)}}return xg({width:f,height:h,x:u,y:d})}function rv(t,e){const n=nv(t).scrollLeft;return e?e.left+n:Ec(Xo(t)).left+n}function bO(t,e){const n=t.getBoundingClientRect(),r=n.left+e.scrollLeft-rv(t,n),s=n.top+e.scrollTop;return{x:r,y:s}}function JQ(t){let{elements:e,rect:n,offsetParent:r,strategy:s}=t;const i=s==="fixed",o=Xo(r),l=e?tv(e.floating):!1;if(r===o||l&&i)return n;let u={scrollLeft:0,scrollTop:0},d=Uo(1);const f=Uo(0),h=ol(r);if((h||!i)&&((Nd(r)!=="body"||ev(o))&&(u=nv(r)),h)){const v=Ec(r);d=Vu(r),f.x=v.x+r.clientLeft,f.y=v.y+r.clientTop}const g=o&&!h&&!i?bO(o,u):Uo(0);return{width:n.width*d.x,height:n.height*d.y,x:n.x*d.x-u.scrollLeft*d.x+f.x+g.x,y:n.y*d.y-u.scrollTop*d.y+f.y+g.y}}function eX(t){return t.getClientRects?Array.from(t.getClientRects()):[]}function tX(t){const e=nv(t),n=t.ownerDocument.body,r=zo(t.scrollWidth,t.clientWidth,n.scrollWidth,n.clientWidth),s=zo(t.scrollHeight,t.clientHeight,n.scrollHeight,n.clientHeight);let i=-e.scrollLeft+rv(t);const o=-e.scrollTop;return ro(n).direction==="rtl"&&(i+=zo(t.clientWidth,n.clientWidth)-r),{width:r,height:s,x:i,y:o}}const nX=25;function rX(t,e,n){n===void 0&&(n="viewport");const r=n==="layoutViewport",s=is(t),i=Xo(t),o=s.visualViewport;let l=i.clientWidth,u=i.clientHeight,d=0,f=0;if(o){const g=!Jb()||e==="fixed";r?g||(d=-o.offsetLeft,f=-o.offsetTop):(l=o.width,u=o.height,g&&(d=o.offsetLeft,f=o.offsetTop))}if(rv(i)<=0){const g=i.ownerDocument,v=g.body,x=getComputedStyle(v),_=g.compatMode==="CSS1Compat"&&parseFloat(x.marginLeft)+parseFloat(x.marginRight)||0,w=Math.abs(i.clientWidth-v.clientWidth-_),S=getComputedStyle(i).scrollbarGutter==="stable both-edges"?w/2:w;S<=nX&&(l-=S)}return{width:l,height:u,x:d,y:f}}function sX(t,e){const n=Ec(t,!0,e==="fixed"),r=n.top+t.clientTop,s=n.left+t.clientLeft,i=Vu(t),o=t.clientWidth*i.x,l=t.clientHeight*i.y,u=s*i.x,d=r*i.y;return{width:o,height:l,x:u,y:d}}function mP(t,e,n){let r;if(e==="viewport"||e==="layoutViewport")r=rX(t,n,e);else if(e==="document")r=tX(Xo(t));else if(no(e))r=sX(e,n);else{const s=xO(t);r={x:e.x-s.x,y:e.y-s.y,width:e.width,height:e.height}}return xg(r)}function iX(t,e){const n=e.get(t);if(n)return n;let r=Mh(t,[],!1).filter(l=>no(l)&&Nd(l)!=="body"),s=null;const i=ro(t).position==="fixed";let o=i?Cc(t):t;for(;no(o)&&!Rh(o);){const l=ro(o),u=Xb(o),d=s?s.position:i?"fixed":"";!u&&(d==="fixed"||d==="absolute"&&l.position==="static")?r=r.filter(h=>h!==o):s=l,o=Cc(o)}return e.set(t,r),r}function oX(t){let{element:e,boundary:n,rootBoundary:r,strategy:s}=t;const o=[...n==="clippingAncestors"?tv(e)?[]:iX(e,this._c):[].concat(n),r],l=mP(e,o[0],s);let u=l.top,d=l.right,f=l.bottom,h=l.left;for(let g=1;g<o.length;g++){const v=mP(e,o[g],s);u=zo(v.top,u),d=Xa(v.right,d),f=Xa(v.bottom,f),h=zo(v.left,h)}return{width:d-h,height:f-u,x:h,y:u}}function aX(t){const{width:e,height:n}=wO(t);return{width:e,height:n}}function lX(t,e,n){const r=ol(e),s=Xo(e),i=n==="fixed",o=Ec(t,!0,i,e);let l={scrollLeft:0,scrollTop:0};const u=Uo(0);if((r||!i)&&((Nd(e)!=="body"||ev(s))&&(l=nv(e)),r)){const g=Ec(e,!0,i,e);u.x=g.x+e.clientLeft,u.y=g.y+e.clientTop}!r&&s&&(u.x=rv(s));const d=s&&!r&&!i?bO(s,l):Uo(0),f=o.left+l.scrollLeft-u.x-d.x,h=o.top+l.scrollTop-u.y-d.y;return{x:f,y:h,width:o.width,height:o.height}}function E_(t){return ro(t).position==="static"}function gP(t,e){if(!ol(t)||ro(t).position==="fixed")return null;if(e)return e(t);let n=t.offsetParent;return Xo(t)===n&&(n=n.ownerDocument.body),n}function SO(t,e){const n=is(t);if(tv(t))return n;if(!ol(t)){let s=Cc(t);for(;s&&!Rh(s);){if(no(s)&&!E_(s))return s;s=Cc(s)}return n}let r=gP(t,e);for(;r&&qQ(r)&&E_(r);)r=gP(r,e);return r&&Rh(r)&&E_(r)&&!Xb(r)?n:r||YQ(t)||n}const cX=async function(t){const e=this.getOffsetParent||SO,n=this.getDimensions,r=await n(t.floating);return{reference:lX(t.reference,await e(t.floating),t.strategy),floating:{x:0,y:0,width:r.width,height:r.height}}};function uX(t){return ro(t).direction==="rtl"}const dX={convertOffsetParentRelativeRectToViewportRelativeRect:JQ,getDocumentElement:Xo,getClippingRect:oX,getOffsetParent:SO,getElementRects:cX,getClientRects:eX,getDimensions:aX,getScale:Vu,isElement:no,isRTL:uX};function kO(t,e){return t.x===e.x&&t.y===e.y&&t.width===e.width&&t.height===e.height}function fX(t,e,n){let r=null,s;const i=Xo(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 g=t.getBoundingClientRect(),{left:v,top:x,width:_,height:w}=g;if(f||e(),!_||!w)return;const S=L0(x),k=L0(i.clientWidth-(v+_)),E=L0(i.clientHeight-(x+w)),P=L0(v),I={rootMargin:-S+"px "+-k+"px "+-E+"px "+-P+"px",threshold:zo(0,Xa(1,h))||1};let M=!0;function R(O){const D=O[0].intersectionRatio;if(!kO(g,t.getBoundingClientRect()))return l();if(D!==h){if(!M)return l();D?l(!1,D):s=setTimeout(()=>{l(!1,1e-7)},1e3)}M=!1}try{r=new IntersectionObserver(R,{...I,root:i.ownerDocument})}catch{r=new IntersectionObserver(R,I)}r.observe(t)}const u=is(t),d=()=>l(n);return u.addEventListener("resize",d),l(!0),()=>{u.removeEventListener("resize",d),o()}}function hX(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:u=!1}=r,d=e6(t),f=s||i?[...d?Mh(d):[],...e?Mh(e):[]]:[];f.forEach(S=>{s&&S.addEventListener("scroll",n),i&&S.addEventListener("resize",n)});const h=d&&l?fX(d,n,i):null;let g=-1,v=null;o&&(v=new ResizeObserver(S=>{let[k]=S;k&&k.target===d&&v&&e&&(v.unobserve(e),cancelAnimationFrame(g),g=requestAnimationFrame(()=>{var E;(E=v)==null||E.observe(e)})),n()}),d&&!u&&v.observe(d),e&&v.observe(e));let x,_=u?Ec(t):null;u&&w();function w(){const S=Ec(t);_&&!kO(_,S)&&n(),_=S,x=requestAnimationFrame(w)}return n(),()=>{var S;f.forEach(k=>{s&&k.removeEventListener("scroll",n),i&&k.removeEventListener("resize",n)}),h==null||h(),(S=v)==null||S.disconnect(),v=null,u&&cancelAnimationFrame(x)}}const pX=UQ,mX=BQ,gX=VQ,vX=WQ,yX=HQ,vP=FQ,_X=ZQ,wX=(t,e,n)=>{const r=new Map,s=n??{},i={...dX,...s.platform,_c:r};return $Q(t,e,{...s,platform:i})};var xX=typeof document<"u",bX=function(){},fm=xX?m.useLayoutEffect:bX;function bg(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(!bg(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)&&!bg(t[i],e[i]))return!1}return!0}return t!==t&&e!==e}function CO(t){return typeof window>"u"?1:(t.ownerDocument.defaultView||window).devicePixelRatio||1}function yP(t,e){const n=CO(t);return Math.round(e*n)/n}function P_(t){const e=m.useRef(t);return fm(()=>{e.current=t}),e}function SX(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:u,open:d}=t,[f,h]=m.useState({x:0,y:0,strategy:n,placement:e,middlewareData:{},isPositioned:!1}),[g,v]=m.useState(r);bg(g,r)||v(r);const[x,_]=m.useState(null),[w,S]=m.useState(null),k=m.useCallback(Z=>{Z!==I.current&&(I.current=Z,_(Z))},[]),E=m.useCallback(Z=>{Z!==M.current&&(M.current=Z,S(Z))},[]),P=i||x,T=o||w,I=m.useRef(null),M=m.useRef(null),R=m.useRef(f),O=u!=null,D=P_(u),$=P_(s),V=P_(d),q=m.useCallback(()=>{if(!I.current||!M.current)return;const Z={placement:e,strategy:n,middleware:g};$.current&&(Z.platform=$.current),wX(I.current,M.current,Z).then(J=>{const H={...J,isPositioned:V.current!==!1};B.current&&!bg(R.current,H)&&(R.current=H,sp.flushSync(()=>{h(H)}))})},[g,e,n,$,V]);fm(()=>{d===!1&&R.current.isPositioned&&(R.current.isPositioned=!1,h(Z=>({...Z,isPositioned:!1})))},[d]);const B=m.useRef(!1);fm(()=>(B.current=!0,()=>{B.current=!1}),[]),fm(()=>{if(P&&(I.current=P),T&&(M.current=T),P&&T){if(D.current)return D.current(P,T,q);q()}},[P,T,q,D,O]);const K=m.useMemo(()=>({reference:I,floating:M,setReference:k,setFloating:E}),[k,E]),z=m.useMemo(()=>({reference:P,floating:T}),[P,T]),X=m.useMemo(()=>{const Z={position:n,left:0,top:0};if(!z.floating)return Z;const J=yP(z.floating,f.x),H=yP(z.floating,f.y);return l?{...Z,transform:"translate("+J+"px, "+H+"px)",...CO(z.floating)>=1.5&&{willChange:"transform"}}:{position:n,left:J,top:H}},[n,l,z.floating,f.x,f.y]);return m.useMemo(()=>({...f,update:q,refs:K,elements:z,floatingStyles:X}),[f,q,K,z,X])}const kX=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?vP({element:r.current,padding:s}).fn(n):{}:r?vP({element:r,padding:s}).fn(n):{}}}},CX=(t,e)=>{const n=pX(t);return{name:n.name,fn:n.fn,options:[t,e]}},EX=(t,e)=>{const n=mX(t);return{name:n.name,fn:n.fn,options:[t,e]}},PX=(t,e)=>({fn:_X(t).fn,options:[t,e]}),AX=(t,e)=>{const n=gX(t);return{name:n.name,fn:n.fn,options:[t,e]}},TX=(t,e)=>{const n=vX(t);return{name:n.name,fn:n.fn,options:[t,e]}},RX=(t,e)=>{const n=yX(t);return{name:n.name,fn:n.fn,options:[t,e]}},MX=(t,e)=>{const n=kX(t);return{name:n.name,fn:n.fn,options:[t,e]}};var IX=Object.defineProperty,OX=(t,e)=>IX(t,"name",{value:e,configurable:!0});function t6(t){const[e,n]=m.useState(void 0);return Mr(()=>{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,u;if("borderBoxSize"in o){const d=o.borderBoxSize,f=Array.isArray(d)?d[0]:d;l=f.inlineSize,u=f.blockSize}else l=t.offsetWidth,u=t.offsetHeight;n({width:l,height:u})})});return s.observe(t,{box:"border-box"}),()=>{window.cancelAnimationFrame(r),s.unobserve(t)}}else n(void 0)},[t]),e}OX(t6,"useSize");var LX=Object.defineProperty,Ba=(t,e)=>LX(t,"name",{value:e,configurable:!0}),_P={Partial:"partial"},wP={Optimized:"optimized",Always:"always"},EO="Popper",[PO,sv]=io(EO),[NX,AO]=PO(EO),TO=Ba(t=>{const{__scopePopper:e,children:n}=t,[r,s]=m.useState(null),[i,o]=m.useState(void 0);return b.jsx(NX,{scope:e,anchor:r,onAnchorChange:s,placementState:i,setPlacementState:o,children:n})},"Popper"),DX="PopperAnchor",RO=m.forwardRef(Ba(function(e,n){const{__scopePopper:r,virtualRef:s,...i}=e,o=AO(DX,r),l=m.useRef(null),u=o.onAnchorChange,d=m.useCallback(_=>{l.current=_,_&&u(_)},[u]),f=Zt(n,d),h=m.useRef(null);m.useEffect(()=>{if(!s)return;const _=h.current;h.current=s.current,_!==h.current&&u(h.current)});const g=o.placementState&&iv(o.placementState),v=g==null?void 0:g[0],x=g==null?void 0:g[1];return s?null:b.jsx(kn.div,{"data-radix-popper-side":v,"data-radix-popper-align":x,...i,ref:f})},"PopperAnchor")),MO="PopperContent",[jX,Qae]=PO(MO),IO=m.forwardRef(Ba(function(e,n){var re,Pe,$e,Ee,dt,Tt,rn;const{__scopePopper:r,side:s="bottom",sideOffset:i=0,align:o="center",alignOffset:l=0,arrowPadding:u=0,avoidCollisions:d=!0,collisionBoundary:f=[],collisionPadding:h=0,sticky:g=_P.Partial,hideWhenDetached:v=!1,updatePositionStrategy:x=wP.Optimized,onPlaced:_,...w}=e,S=AO(MO,r),[k,E]=m.useState(null),P=Zt(n,E),[T,I]=m.useState(null),M=t6(T),R=(M==null?void 0:M.width)??0,O=(M==null?void 0:M.height)??0,D=s+(o!=="center"?"-"+o:""),$=typeof h=="number"?h:{top:0,right:0,bottom:0,left:0,...h},V=Array.isArray(f)?f:[f],q=V.length>0,B={padding:$,boundary:V.filter(OO),altBoundary:q},{refs:K,floatingStyles:z,placement:X,isPositioned:Z,middlewareData:J}=SX({strategy:"fixed",placement:D,whileElementsMounted:Ba((...jt)=>hX(...jt,{animationFrame:x===wP.Always}),"whileElementsMounted"),elements:{reference:S.anchor},middleware:[CX({mainAxis:i+O,alignmentAxis:l}),d&&EX({mainAxis:!0,crossAxis:!1,...g===_P.Partial?{limiter:PX()}:{},...B}),d&&AX({...B}),TX({...B,apply:Ba(({elements:jt,rects:xt,availableWidth:Xt,availableHeight:Ct})=>{const{width:qe,height:ke}=xt.reference,rt=jt.floating.style;rt.setProperty("--radix-popper-available-width",`${Xt}px`),rt.setProperty("--radix-popper-available-height",`${Ct}px`),rt.setProperty("--radix-popper-anchor-width",`${qe}px`),rt.setProperty("--radix-popper-anchor-height",`${ke}px`)},"apply")}),T&&MX({element:T,padding:u}),$X({arrowWidth:R,arrowHeight:O}),v&&RX(q?{strategy:"referenceHidden",...B}:{strategy:"referenceHidden",padding:B.padding,altBoundary:B.altBoundary})]}),H=S.setPlacementState;Mr(()=>(H(X),()=>{H(void 0)}),[X,H]);const[N,Y]=iv(X),ae=kc(_);Mr(()=>{Z&&(ae==null||ae())},[Z,ae]);const se=(re=J.arrow)==null?void 0:re.x,ie=(Pe=J.arrow)==null?void 0:Pe.y,de=(($e=J.arrow)==null?void 0:$e.centerOffset)!==0,[ge,ue]=m.useState();return Mr(()=>{k&&ue(window.getComputedStyle(k).zIndex)},[k]),b.jsx("div",{ref:K.setFloating,"data-radix-popper-content-wrapper":"",style:{...z,transform:Z?z.transform:"translate(0, -200%)",minWidth:"max-content",zIndex:ge,"--radix-popper-transform-origin":[(Ee=J.transformOrigin)==null?void 0:Ee.x,(dt=J.transformOrigin)==null?void 0:dt.y].join(" "),...((Tt=J.hide)==null?void 0:Tt.referenceHidden)&&{visibility:"hidden",pointerEvents:"none"}},dir:e.dir,children:b.jsx(jX,{scope:r,placedSide:N,placedAlign:Y,onArrowChange:I,arrowX:se,arrowY:ie,shouldHideArrow:de,children:b.jsx(kn.div,{"data-side":N,"data-align":Y,...w,ref:P,style:{...w.style,animation:Z?(rn=w.style)==null?void 0:rn.animation:"none"}})})})},"PopperContent"));function OO(t){return t!==null}Ba(OO,"isNotNull");var $X=Ba(t=>({name:"transformOrigin",options:t,fn(e){var w,S,k;const{placement:n,rects:r,middlewareData:s}=e,o=((w=s.arrow)==null?void 0:w.centerOffset)!==0,l=o?0:t.arrowWidth,u=o?0:t.arrowHeight,[d,f]=iv(n),h={start:"0%",center:"50%",end:"100%"}[f],g=(((S=s.arrow)==null?void 0:S.x)??0)+l/2,v=(((k=s.arrow)==null?void 0:k.y)??0)+u/2;let x="",_="";return d==="bottom"?(x=o?h:`${g}px`,_=`${-u}px`):d==="top"?(x=o?h:`${g}px`,_=`${r.floating.height+u}px`):d==="right"?(x=`${-u}px`,_=o?h:`${v}px`):d==="left"&&(x=`${r.floating.width+u}px`,_=o?h:`${v}px`),{data:{x,y:_}}}}),"transformOrigin");function iv(t){const[e,n="center"]=t.split("-");return[e,n]}Ba(iv,"getSideAndAlignFromPlacement");var FX=Object.defineProperty,VX=(t,e)=>FX(t,"name",{value:e,configurable:!0}),n6=m.forwardRef(VX(function(e,n){var u;const{container:r,...s}=e,[i,o]=m.useState(!1);Mr(()=>o(!0),[]);const l=r||i&&((u=globalThis==null?void 0:globalThis.document)==null?void 0:u.body);return l?sp.createPortal(b.jsx(kn.div,{...s,ref:n}),l):null},"Portal")),HX=Object.defineProperty,Go=(t,e)=>HX(t,"name",{value:e,configurable:!0});function LO(t,e){return m.useReducer((n,r)=>e[n][r]??n,t)}Go(LO,"useStateMachine");var al=Go(t=>{const{present:e,children:n}=t,r=NO(e),s=typeof n=="function"?n({present:r.isPresent}):m.Children.only(n),i=DO(r.ref,jO(s));return typeof n=="function"||r.isPresent?m.cloneElement(s,{ref:i}):null},"Presence");function NO(t){const[e,n]=m.useState(),r=m.useRef(null),s=m.useRef(t),i=m.useRef("none"),o=m.useRef(void 0),l=t?"mounted":"unmounted",[u,d]=LO(l,{mounted:{UNMOUNT:"unmounted",ANIMATION_OUT:"unmountSuspended"},unmountSuspended:{MOUNT:"mounted",ANIMATION_END:"unmounted"},unmounted:{MOUNT:"mounted"}});return m.useEffect(()=>{u==="mounted"?(i.current=o.current??Pu(r.current),o.current=void 0):i.current="none"},[u]),Mr(()=>{const f=r.current,h=s.current;if(h!==t){const v=i.current,x=Pu(f);t?(o.current=x,d("MOUNT")):x==="none"||(f==null?void 0:f.display)==="none"?d("UNMOUNT"):d(h&&v!==x?"ANIMATION_OUT":"UNMOUNT"),s.current=t}},[t,d]),Mr(()=>{if(e){let f;const h=e.ownerDocument.defaultView??window,g=Go(x=>{const w=Pu(r.current).includes(CSS.escape(x.animationName));if(x.target===e&&w&&(d("ANIMATION_END"),!s.current)){const S=e.style.animationFillMode;e.style.animationFillMode="forwards",f=h.setTimeout(()=>{e.style.animationFillMode==="forwards"&&(e.style.animationFillMode=S)})}},"handleAnimationEnd"),v=Go(x=>{x.target===e&&(i.current=Pu(r.current))},"handleAnimationStart");return e.addEventListener("animationstart",v),e.addEventListener("animationcancel",g),e.addEventListener("animationend",g),()=>{h.clearTimeout(f),e.removeEventListener("animationstart",v),e.removeEventListener("animationcancel",g),e.removeEventListener("animationend",g)}}else d("ANIMATION_END")},[e,d]),{isPresent:["mounted","unmountSuspended"].includes(u),ref:m.useCallback(f=>{if(f){const h=getComputedStyle(f);r.current=h,o.current=Pu(h)}else r.current=null;n(f)},[])}}Go(NO,"usePresence");function Uw(t,e){if(typeof t=="function")return t(e);t!=null&&(t.current=e)}Go(Uw,"setRef");function DO(...t){const e=m.useRef(t);return e.current=t,m.useCallback(n=>{const r=e.current;let s=!1;const i=r.map(o=>{const l=Uw(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():Uw(r[o],null)}}},[])}Go(DO,"useStableComposedRefs");function Pu(t){return(t==null?void 0:t.animationName)||"none"}Go(Pu,"getAnimationName");function jO(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)}Go(jO,"getElementRef");var zX=Object.defineProperty,UX=(t,e)=>zX(t,"name",{value:e,configurable:!0}),xP=Ad[" useEffectEvent ".trim().toString()],bP=Ad[" useInsertionEffect ".trim().toString()];function $O(t){if(typeof xP=="function")return xP(t);const e=m.useRef(()=>{throw new Error("Cannot call an event handler while rendering.")});return typeof bP=="function"?bP(()=>{e.current=t}):Mr(()=>{e.current=t}),m.useMemo(()=>((...n)=>{var r;return(r=e.current)==null?void 0:r.call(e,...n)}),[])}UX($O,"useEffectEvent");var BX=Object.defineProperty,op=(t,e)=>BX(t,"name",{value:e,configurable:!0}),ZX=Ad[" useInsertionEffect ".trim().toString()]||Mr;function ll({prop:t,defaultProp:e,onChange:n=op(()=>{},"onChange"),caller:r}){const[s,i,o]=FO({defaultProp:e,onChange:n}),l=t!==void 0,u=l?t:s,d=m.useCallback(f=>{var h;if(l){const g=VO(f)?f(t):f;g!==t&&((h=o.current)==null||h.call(o,g))}else i(f)},[l,t,i,o]);return[u,d]}op(ll,"useControllableState");function FO({defaultProp:t,onChange:e}){const[n,r]=m.useState(t),s=m.useRef(n),i=m.useRef(e);return ZX(()=>{i.current=e},[e]),m.useEffect(()=>{var o;s.current!==n&&((o=i.current)==null||o.call(i,n),s.current=n)},[n,s]),[n,r,i]}op(FO,"useUncontrolledState");function VO(t){return typeof t=="function"}op(VO,"isFunction");var SP=Symbol("RADIX:SYNC_STATE");function WX(t,e,n,r){const{prop:s,defaultProp:i,onChange:o,caller:l}=e,u=s!==void 0,d=$O(o),f=[{...n,state:i}];r&&f.push(r);const[h,g]=m.useReducer((w,S)=>{if(S.type===SP)return{...w,state:S.state};const k=t(w,S);return u&&!Object.is(k.state,w.state)&&d(k.state),k},...f),v=h.state,x=m.useRef(v);m.useEffect(()=>{x.current!==v&&(x.current=v,u||d(v))},[v,x,u]);const _=m.useMemo(()=>s!==void 0?{...h,state:s}:h,[h,s]);return m.useEffect(()=>{u&&!Object.is(s,h.state)&&g({type:SP,state:s})},[s,h.state,u]),[_,g]}op(WX,"useControllableStateReducer");var qX=Object.defineProperty,GX=(t,e)=>qX(t,"name",{value:e,configurable:!0}),KX=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"}),YX=m.forwardRef(GX(function(e,n){return b.jsx(kn.span,{...e,ref:n,style:{...KX,...e.style}})},"VisuallyHidden")),QX=Object.defineProperty,er=(t,e)=>QX(t,"name",{value:e,configurable:!0}),[r6,Xae]=io("Tooltip",[sv]),s6=sv(),XX="TooltipProvider",JX=700,Bw="tooltip.open",[eJ,i6]=r6(XX),tJ=er(t=>{const{__scopeTooltip:e,delayDuration:n=JX,skipDelayDuration:r=300,disableHoverableContent:s=!1,children:i}=t,o=m.useRef(!0),l=m.useRef(!1),u=m.useRef(0);return m.useEffect(()=>{const d=u.current;return()=>window.clearTimeout(d)},[]),b.jsx(eJ,{scope:e,isOpenDelayedRef:o,delayDuration:n,onOpen:m.useCallback(()=>{r<=0||(window.clearTimeout(u.current),o.current=!1)},[r]),onClose:m.useCallback(()=>{r<=0||(window.clearTimeout(u.current),u.current=window.setTimeout(()=>o.current=!0,r))},[r]),isPointerInTransitRef:l,onPointerInTransitChange:m.useCallback(d=>{l.current=d},[]),disableHoverableContent:s,children:i})},"TooltipProvider"),Zw="Tooltip",[nJ,ap]=r6(Zw),rJ=er(t=>{const{__scopeTooltip:e,children:n,open:r,defaultOpen:s,onOpenChange:i,disableHoverableContent:o,delayDuration:l}=t,u=i6(Zw,t.__scopeTooltip),d=s6(e),[f,h]=m.useState(null),[g,v]=m.useState(void 0),x=Xi(),_=m.useRef(0),w=o??u.disableHoverableContent,S=l??u.delayDuration,k=m.useRef(!1),[E,P]=ll({prop:r,defaultProp:s??!1,onChange:er(D=>{D?(u.onOpen(),document.dispatchEvent(new CustomEvent(Bw))):u.onClose(),i==null||i(D)},"onChange"),caller:Zw}),T=m.useMemo(()=>E?k.current?"delayed-open":"instant-open":"closed",[E]),I=m.useCallback(()=>{window.clearTimeout(_.current),_.current=0,k.current=!1,P(!0)},[P]),M=m.useCallback(()=>{window.clearTimeout(_.current),_.current=0,P(!1)},[P]),R=m.useCallback(()=>{window.clearTimeout(_.current),_.current=window.setTimeout(()=>{k.current=!0,P(!0),_.current=0},S)},[S,P]);m.useEffect(()=>()=>{_.current&&(window.clearTimeout(_.current),_.current=0)},[]);const O=g??x;return b.jsx(TO,{...d,children:b.jsx(nJ,{scope:e,contentId:O,setContentId:v,open:E,stateAttribute:T,trigger:f,onTriggerChange:h,onTriggerEnter:m.useCallback(()=>{u.isOpenDelayedRef.current?R():I()},[u.isOpenDelayedRef,R,I]),onTriggerLeave:m.useCallback(()=>{w?M():(window.clearTimeout(_.current),_.current=0)},[M,w]),onOpen:I,onClose:M,disableHoverableContent:w,children:n})})},"Tooltip"),kP="TooltipTrigger",sJ=m.forwardRef(er(function(e,n){const{__scopeTooltip:r,"aria-describedby":s,...i}=e,o=ap(kP,r),l=i6(kP,r),u=s6(r),d=m.useRef(null),f=Zt(n,d,o.onTriggerChange),h=m.useRef(!1),g=m.useRef(!1),v=m.useCallback(()=>h.current=!1,[]);return m.useEffect(()=>()=>document.removeEventListener("pointerup",v),[v]),b.jsx(RO,{asChild:!0,...u,children:b.jsx(kn.button,{"aria-describedby":o.open?KO(s,o.contentId):s,"data-state":o.stateAttribute,...i,ref:f,onPointerMove:Bt(e.onPointerMove,x=>{x.pointerType!=="touch"&&!g.current&&!l.isPointerInTransitRef.current&&(o.onTriggerEnter(),g.current=!0)}),onPointerLeave:Bt(e.onPointerLeave,()=>{o.onTriggerLeave(),g.current=!1}),onPointerDown:Bt(e.onPointerDown,()=>{o.open&&o.onClose(),h.current=!0,document.addEventListener("pointerup",v,{once:!0})}),onFocus:Bt(e.onFocus,()=>{h.current||o.onOpen()}),onBlur:Bt(e.onBlur,o.onClose),onClick:Bt(e.onClick,o.onClose)})})},"TooltipTrigger")),HO="TooltipPortal",[iJ,oJ]=r6(HO,{forceMount:void 0}),aJ=er(t=>{const{__scopeTooltip:e,forceMount:n,children:r,container:s}=t,i=ap(HO,e);return b.jsx(iJ,{scope:e,forceMount:n,children:b.jsx(al,{present:n||i.open,children:b.jsx(n6,{asChild:!0,container:s,children:r})})})},"TooltipPortal"),Ih="TooltipContent",lJ=m.forwardRef(er(function(e,n){const r=oJ(Ih,e.__scopeTooltip),{forceMount:s=r.forceMount,side:i="top",...o}=e,l=ap(Ih,e.__scopeTooltip);return b.jsx(al,{present:s||l.open,children:l.disableHoverableContent?b.jsx(zO,{side:i,...o,ref:n}):b.jsx(cJ,{side:i,...o,ref:n})})},"TooltipContent")),cJ=m.forwardRef(er(function(e,n){const r=ap(Ih,e.__scopeTooltip),s=i6(Ih,e.__scopeTooltip),i=m.useRef(null),o=Zt(n,i),[l,u]=m.useState(null),{trigger:d,onClose:f}=r,h=i.current,{onPointerInTransitChange:g}=s,v=m.useCallback(()=>{u(null),g(!1)},[g]),x=m.useCallback((_,w)=>{const S=_.currentTarget,k={x:_.clientX,y:_.clientY},E=UO(k,S.getBoundingClientRect()),P=BO(k,E),T=ZO(w.getBoundingClientRect()),I=qO([...P,...T]);u(I),g(!0)},[g]);return m.useEffect(()=>()=>v(),[v]),m.useEffect(()=>{if(d&&h){const _=er(S=>x(S,h),"handleTriggerLeave"),w=er(S=>x(S,d),"handleContentLeave");return d.addEventListener("pointerleave",_),h.addEventListener("pointerleave",w),()=>{d.removeEventListener("pointerleave",_),h.removeEventListener("pointerleave",w)}}},[d,h,x,v]),m.useEffect(()=>{if(l){const _=er(w=>{const S=w.target,k={x:w.clientX,y:w.clientY},E=(d==null?void 0:d.contains(S))||(h==null?void 0:h.contains(S)),P=!WO(k,l);E?v():P&&(v(),f())},"handleTrackPointerGrace");return document.addEventListener("pointermove",_),()=>document.removeEventListener("pointermove",_)}},[d,h,l,f,v]),b.jsx(zO,{...e,ref:o})},"TooltipContentHoverable")),uJ=K3("TooltipContent"),zO=m.forwardRef(er(function(e,n){const{__scopeTooltip:r,children:s,"aria-label":i,id:o,onEscapeKeyDown:l,onPointerDownOutside:u,...d}=e,f=ap(Ih,r),h=s6(r),{onClose:g}=f,[v,x]=m.useState(null),_=Zt(n,x);qb(v),m.useEffect(()=>(document.addEventListener(Bw,g),()=>document.removeEventListener(Bw,g)),[g]),m.useEffect(()=>{if(f.trigger){const S=er(k=>{k.target instanceof Node&&k.target.contains(f.trigger)&&g()},"handleScroll");return window.addEventListener("scroll",S,{capture:!0}),()=>window.removeEventListener("scroll",S,{capture:!0})}},[f.trigger,g]);const{setContentId:w}=f;return Mr(()=>(w(o),()=>{w(void 0)}),[o,w]),b.jsx(Ub,{asChild:!0,disableOutsidePointerEvents:!1,onEscapeKeyDown:l,onPointerDownOutside:u,onFocusOutside:S=>S.preventDefault(),onDismiss:g,children:b.jsxs(IO,{"data-state":f.stateAttribute,role:i?void 0:"tooltip",id:i?void 0:f.contentId,...h,...d,ref:_,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:[b.jsx(uJ,{children:s}),i?b.jsx(YX,{id:f.contentId,role:"tooltip",children:i}):null]})})},"TooltipContentImpl"));function UO(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")}}er(UO,"getExitSideFromRect");function BO(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}er(BO,"getPaddedExitPoints");function ZO(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}]}er(ZO,"getPointsFromRect");function WO(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],u=e[o],d=l.x,f=l.y,h=u.x,g=u.y;f>r!=g>r&&n<(h-d)*(r-f)/(g-f)+d&&(s=!s)}return s}er(WO,"isPointInPolygon");function qO(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),GO(e)}er(qO,"getHull");function GO(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)}er(GO,"getHullPresorted");function KO(...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}er(KO,"concatAriaDescribedby");const sh={normal:"'wght' 400",medium:"'wght' 450",semibold:"'wght' 550"},YO=m.createContext(null);function QO({value:t,children:e}){return b.jsx(YO.Provider,{value:t,children:e})}function dJ(t){switch(t){case"top":return{y:4};case"bottom":return{y:-4};case"left":return{x:4};case"right":return{x:-4}}}function o6({content:t,children:e,side:n="top",sideOffset:r=8,delayDuration:s=200,className:i,forceOpen:o,onOpenChange:l}){const[u,d]=m.useState(!1),f=o!==void 0?o:u,[h,g]=m.useState(!1),v=ip(),x=m.useContext(YO);m.useEffect(()=>{f&&g(!0)},[f]);const _=()=>{f||g(!1)},w=dJ(n);return b.jsx(tJ,{delayDuration:s,children:b.jsxs(rJ,{open:f,onOpenChange:S=>{d(S),l==null||l(S)},children:[b.jsx(sJ,{asChild:!0,children:e}),h&&b.jsx(aJ,{forceMount:!0,container:x??void 0,children:b.jsx(lJ,{side:n,sideOffset:r,forceMount:!0,className:"z-tooltip",children:b.jsx(Ho.div,{className:zt("bg-neutral-900 text-white text-[12px] px-2 py-1 border border-white/10 shadow-lg",v.bg,i),style:{fontVariationSettings:sh.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:_,children:t})})})]})})}const Ji=m.forwardRef(({title:t,shortcut:e,...n},r)=>{const s=b.jsx(z3,{ref:r,...n});return t?b.jsx(o6,{content:b.jsxs("div",{className:"flex flex-row items-center gap-2",children:[b.jsx("span",{children:t}),e?b.jsx("span",{className:"rounded bg-white/15 px-1.5 py-0.5 text-[11px]",children:e}):null]}),children:s}):s});Ji.displayName="Button";var fJ=Object.defineProperty,a6=(t,e)=>fJ(t,"name",{value:e,configurable:!0}),N0=0,Ni=null;function hJ(t){return ov(),t.children}a6(hJ,"FocusGuards");function ov(){m.useEffect(()=>{Ni||(Ni={start:Ww(),end:Ww()});const{start:t,end:e}=Ni;return document.body.firstElementChild!==t&&document.body.insertAdjacentElement("afterbegin",t),document.body.lastElementChild!==e&&document.body.insertAdjacentElement("beforeend",e),N0++,()=>{N0===1&&(Ni==null||Ni.start.remove(),Ni==null||Ni.end.remove(),Ni=null),N0=Math.max(0,N0-1)}},[])}a6(ov,"useFocusGuards");function Ww(){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}a6(Ww,"createFocusGuard");var Zi=function(){return Zi=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},Zi.apply(this,arguments)};function XO(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 pJ(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 hm="right-scroll-bar-position",pm="width-before-scroll-bar",mJ="with-scroll-bars-hidden",gJ="--removed-body-scroll-bar-size";function A_(t,e){return typeof t=="function"?t(e):t&&(t.current=e),t}function vJ(t,e){var n=m.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 yJ=typeof window<"u"?m.useLayoutEffect:m.useEffect,CP=new WeakMap;function _J(t,e){var n=vJ(null,function(r){return t.forEach(function(s){return A_(s,r)})});return yJ(function(){var r=CP.get(n);if(r){var s=new Set(r),i=new Set(t),o=n.current;s.forEach(function(l){i.has(l)||A_(l,null)}),i.forEach(function(l){s.has(l)||A_(l,o)})}CP.set(n,t)},[t]),n}function wJ(t){return t}function xJ(t,e){e===void 0&&(e=wJ);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 u=function(){var f=o;o=[],f.forEach(i)},d=function(){return Promise.resolve().then(u)};d(),n={push:function(f){o.push(f),d()},filter:function(f){return o=o.filter(f),n}}}};return s}function bJ(t){t===void 0&&(t={});var e=xJ(null);return e.options=Zi({async:!0,ssr:!1},t),e}var JO=function(t){var e=t.sideCar,n=XO(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 m.createElement(r,Zi({},n))};JO.isSideCarExport=!0;function SJ(t,e){return t.useMedium(e),JO}var e9=bJ(),T_=function(){},av=m.forwardRef(function(t,e){var n=m.useRef(null),r=m.useState({onScrollCapture:T_,onWheelCapture:T_,onTouchMoveCapture:T_}),s=r[0],i=r[1],o=t.forwardProps,l=t.children,u=t.className,d=t.removeScrollBar,f=t.enabled,h=t.shards,g=t.sideCar,v=t.noRelative,x=t.noIsolation,_=t.inert,w=t.allowPinchZoom,S=t.as,k=S===void 0?"div":S,E=t.gapMode,P=XO(t,["forwardProps","children","className","removeScrollBar","enabled","shards","sideCar","noRelative","noIsolation","inert","allowPinchZoom","as","gapMode"]),T=g,I=_J([n,e]),M=Zi(Zi({},P),s);return m.createElement(m.Fragment,null,f&&m.createElement(T,{sideCar:e9,removeScrollBar:d,shards:h,noRelative:v,noIsolation:x,inert:_,setCallbacks:i,allowPinchZoom:!!w,lockRef:n,gapMode:E}),o?m.cloneElement(m.Children.only(l),Zi(Zi({},M),{ref:I})):m.createElement(k,Zi({},M,{className:u,ref:I}),l))});av.defaultProps={enabled:!0,removeScrollBar:!0,inert:!1};av.classNames={fullWidth:pm,zeroRight:hm};var kJ=function(){if(typeof __webpack_nonce__<"u")return __webpack_nonce__};function CJ(){if(!document)return null;var t=document.createElement("style");t.type="text/css";var e=kJ();return e&&t.setAttribute("nonce",e),t}function EJ(t,e){t.styleSheet?t.styleSheet.cssText=e:t.appendChild(document.createTextNode(e))}function PJ(t){var e=document.head||document.getElementsByTagName("head")[0];e.appendChild(t)}var AJ=function(){var t=0,e=null;return{add:function(n){t==0&&(e=CJ())&&(EJ(e,n),PJ(e)),t++},remove:function(){t--,!t&&e&&(e.parentNode&&e.parentNode.removeChild(e),e=null)}}},TJ=function(){var t=AJ();return function(e,n){m.useEffect(function(){return t.add(e),function(){t.remove()}},[e&&n])}},t9=function(){var t=TJ(),e=function(n){var r=n.styles,s=n.dynamic;return t(r,s),null};return e},RJ={left:0,top:0,right:0,gap:0},R_=function(t){return parseInt(t||"",10)||0},MJ=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[R_(n),R_(r),R_(s)]},IJ=function(t){if(t===void 0&&(t="margin"),typeof window>"u")return RJ;var e=MJ(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])}},OJ=t9(),Hu="data-scroll-locked",LJ=function(t,e,n,r){var s=t.left,i=t.top,o=t.right,l=t.gap;return n===void 0&&(n="margin"),`
|
|
72
|
+
.`.concat(mJ,` {
|
|
73
|
+
overflow: hidden `).concat(r,`;
|
|
74
|
+
padding-right: `).concat(l,"px ").concat(r,`;
|
|
75
|
+
}
|
|
76
|
+
body[`).concat(Hu,`] {
|
|
77
|
+
overflow: hidden `).concat(r,`;
|
|
78
|
+
overscroll-behavior: contain;
|
|
79
|
+
`).concat([e&&"position: relative ".concat(r,";"),n==="margin"&&`
|
|
80
|
+
padding-left: `.concat(s,`px;
|
|
81
|
+
padding-top: `).concat(i,`px;
|
|
82
|
+
padding-right: `).concat(o,`px;
|
|
83
|
+
margin-left:0;
|
|
84
|
+
margin-top:0;
|
|
85
|
+
margin-right: `).concat(l,"px ").concat(r,`;
|
|
86
|
+
`),n==="padding"&&"padding-right: ".concat(l,"px ").concat(r,";")].filter(Boolean).join(""),`
|
|
87
|
+
}
|
|
88
|
+
|
|
89
|
+
.`).concat(hm,` {
|
|
90
|
+
right: `).concat(l,"px ").concat(r,`;
|
|
91
|
+
}
|
|
92
|
+
|
|
93
|
+
.`).concat(pm,` {
|
|
94
|
+
margin-right: `).concat(l,"px ").concat(r,`;
|
|
95
|
+
}
|
|
96
|
+
|
|
97
|
+
.`).concat(hm," .").concat(hm,` {
|
|
98
|
+
right: 0 `).concat(r,`;
|
|
99
|
+
}
|
|
100
|
+
|
|
101
|
+
.`).concat(pm," .").concat(pm,` {
|
|
102
|
+
margin-right: 0 `).concat(r,`;
|
|
103
|
+
}
|
|
104
|
+
|
|
105
|
+
body[`).concat(Hu,`] {
|
|
106
|
+
`).concat(gJ,": ").concat(l,`px;
|
|
107
|
+
}
|
|
108
|
+
`)},EP=function(){var t=parseInt(document.body.getAttribute(Hu)||"0",10);return isFinite(t)?t:0},NJ=function(){m.useEffect(function(){return document.body.setAttribute(Hu,(EP()+1).toString()),function(){var t=EP()-1;t<=0?document.body.removeAttribute(Hu):document.body.setAttribute(Hu,t.toString())}},[])},DJ=function(t){var e=t.noRelative,n=t.noImportant,r=t.gapMode,s=r===void 0?"margin":r;NJ();var i=m.useMemo(function(){return IJ(s)},[s]);return m.createElement(OJ,{styles:LJ(i,!e,s,n?"":"!important")})},qw=!1;if(typeof window<"u")try{var D0=Object.defineProperty({},"passive",{get:function(){return qw=!0,!0}});window.addEventListener("test",D0,D0),window.removeEventListener("test",D0,D0)}catch{qw=!1}var _u=qw?{passive:!1}:!1,jJ=function(t){return t.tagName==="TEXTAREA"},n9=function(t,e){if(!(t instanceof Element))return!1;var n=window.getComputedStyle(t);return n[e]!=="hidden"&&!(n.overflowY===n.overflowX&&!jJ(t)&&n[e]==="visible")},$J=function(t){return n9(t,"overflowY")},FJ=function(t){return n9(t,"overflowX")},PP=function(t,e){var n=e.ownerDocument,r=e;do{typeof ShadowRoot<"u"&&r instanceof ShadowRoot&&(r=r.host);var s=r9(t,r);if(s){var i=s9(t,r),o=i[1],l=i[2];if(o>l)return!0}r=r.parentNode}while(r&&r!==n.body);return!1},VJ=function(t){var e=t.scrollTop,n=t.scrollHeight,r=t.clientHeight;return[e,n,r]},HJ=function(t){var e=t.scrollLeft,n=t.scrollWidth,r=t.clientWidth;return[e,n,r]},r9=function(t,e){return t==="v"?$J(e):FJ(e)},s9=function(t,e){return t==="v"?VJ(e):HJ(e)},zJ=function(t,e){return t==="h"&&e==="rtl"?-1:1},UJ=function(t,e,n,r,s){var i=zJ(t,window.getComputedStyle(e).direction),o=i*r,l=n.target,u=e.contains(l),d=!1,f=o>0,h=0,g=0;do{if(!l)break;var v=s9(t,l),x=v[0],_=v[1],w=v[2],S=_-w-i*x;(x||S)&&r9(t,l)&&(h+=S,g+=x);var k=l.parentNode;l=k&&k.nodeType===Node.DOCUMENT_FRAGMENT_NODE?k.host:k}while(!u&&l!==document.body||u&&(e.contains(l)||e===l));return(f&&Math.abs(h)<1||!f&&Math.abs(g)<1)&&(d=!0),d},j0=function(t){return"changedTouches"in t?[t.changedTouches[0].clientX,t.changedTouches[0].clientY]:[0,0]},AP=function(t){return[t.deltaX,t.deltaY]},TP=function(t){return t&&"current"in t?t.current:t},BJ=function(t,e){return t[0]===e[0]&&t[1]===e[1]},ZJ=function(t){return`
|
|
109
|
+
.block-interactivity-`.concat(t,` {pointer-events: none;}
|
|
110
|
+
.allow-interactivity-`).concat(t,` {pointer-events: all;}
|
|
111
|
+
`)},WJ=0,wu=[];function qJ(t){var e=m.useRef([]),n=m.useRef([0,0]),r=m.useRef(),s=m.useState(WJ++)[0],i=m.useState(t9)[0],o=m.useRef(t);m.useEffect(function(){o.current=t},[t]),m.useEffect(function(){if(t.inert){document.body.classList.add("block-interactivity-".concat(s));var _=pJ([t.lockRef.current],(t.shards||[]).map(TP),!0).filter(Boolean);return _.forEach(function(w){return w.classList.add("allow-interactivity-".concat(s))}),function(){document.body.classList.remove("block-interactivity-".concat(s)),_.forEach(function(w){return w.classList.remove("allow-interactivity-".concat(s))})}}},[t.inert,t.lockRef.current,t.shards]);var l=m.useCallback(function(_,w){if("touches"in _&&_.touches.length===2||_.type==="wheel"&&_.ctrlKey)return!o.current.allowPinchZoom;var S=j0(_),k=n.current,E="deltaX"in _?_.deltaX:k[0]-S[0],P="deltaY"in _?_.deltaY:k[1]-S[1],T,I=_.target,M=Math.abs(E)>Math.abs(P)?"h":"v";if("touches"in _&&M==="h"&&I.type==="range")return!1;var R=window.getSelection(),O=R&&R.anchorNode,D=O?O===I||O.contains(I):!1;if(D)return!1;var $=PP(M,I);if(!$)return!0;if($?T=M:(T=M==="v"?"h":"v",$=PP(M,I)),!$)return!1;if(!r.current&&"changedTouches"in _&&(E||P)&&(r.current=T),!T)return!0;var V=r.current||T;return UJ(V,w,_,V==="h"?E:P)},[]),u=m.useCallback(function(_){var w=_;if(!(!wu.length||wu[wu.length-1]!==i)){var S="deltaY"in w?AP(w):j0(w),k=e.current.filter(function(T){return T.name===w.type&&(T.target===w.target||w.target===T.shadowParent)&&BJ(T.delta,S)})[0];if(k&&k.should){w.cancelable&&w.preventDefault();return}if(!k){var E=(o.current.shards||[]).map(TP).filter(Boolean).filter(function(T){return T.contains(w.target)}),P=E.length>0?l(w,E[0]):!o.current.noIsolation;P&&w.cancelable&&w.preventDefault()}}},[]),d=m.useCallback(function(_,w,S,k){var E={name:_,delta:w,target:S,should:k,shadowParent:GJ(S)};e.current.push(E),setTimeout(function(){e.current=e.current.filter(function(P){return P!==E})},1)},[]),f=m.useCallback(function(_){n.current=j0(_),r.current=void 0},[]),h=m.useCallback(function(_){d(_.type,AP(_),_.target,l(_,t.lockRef.current))},[]),g=m.useCallback(function(_){d(_.type,j0(_),_.target,l(_,t.lockRef.current))},[]);m.useEffect(function(){return wu.push(i),t.setCallbacks({onScrollCapture:h,onWheelCapture:h,onTouchMoveCapture:g}),document.addEventListener("wheel",u,_u),document.addEventListener("touchmove",u,_u),document.addEventListener("touchstart",f,_u),function(){wu=wu.filter(function(_){return _!==i}),document.removeEventListener("wheel",u,_u),document.removeEventListener("touchmove",u,_u),document.removeEventListener("touchstart",f,_u)}},[]);var v=t.removeScrollBar,x=t.inert;return m.createElement(m.Fragment,null,x?m.createElement(i,{styles:ZJ(s)}):null,v?m.createElement(DJ,{noRelative:t.noRelative,gapMode:t.gapMode}):null)}function GJ(t){for(var e=null;t!==null;)t instanceof ShadowRoot&&(e=t.host,t=t.host),t=t.parentNode;return e}const KJ=SJ(e9,qJ);var l6=m.forwardRef(function(t,e){return m.createElement(av,Zi({},t,{ref:e,sideCar:KJ}))});l6.classNames=av.classNames;var YJ=function(t){if(typeof document>"u")return null;var e=Array.isArray(t)?t[0]:t;return e.ownerDocument.body},xu=new WeakMap,$0=new WeakMap,F0={},M_=0,i9=function(t){return t&&(t.host||i9(t.parentNode))},QJ=function(t,e){return e.map(function(n){if(t.contains(n))return n;var r=i9(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})},XJ=function(t,e,n,r){var s=QJ(e,Array.isArray(t)?t:[t]);F0[n]||(F0[n]=new WeakMap);var i=F0[n],o=[],l=new Set,u=new Set(s),d=function(h){!h||l.has(h)||(l.add(h),d(h.parentNode))};s.forEach(d);var f=function(h){!h||u.has(h)||Array.prototype.forEach.call(h.children,function(g){if(l.has(g))f(g);else try{var v=g.getAttribute(r),x=v!==null&&v!=="false",_=(xu.get(g)||0)+1,w=(i.get(g)||0)+1;xu.set(g,_),i.set(g,w),o.push(g),_===1&&x&&$0.set(g,!0),w===1&&g.setAttribute(n,"true"),x||g.setAttribute(r,"true")}catch(S){console.error("aria-hidden: cannot operate on ",g,S)}})};return f(e),l.clear(),M_++,function(){o.forEach(function(h){var g=xu.get(h)-1,v=i.get(h)-1;xu.set(h,g),i.set(h,v),g||($0.has(h)||h.removeAttribute(r),$0.delete(h)),v||h.removeAttribute(n)}),M_--,M_||(xu=new WeakMap,xu=new WeakMap,$0=new WeakMap,F0={})}},o9=function(t,e,n){n===void 0&&(n="data-aria-hidden");var r=Array.from(Array.isArray(t)?t:[t]),s=YJ(t);return s?(r.push.apply(r,Array.from(s.querySelectorAll("[aria-live], script"))),XJ(r,s,n,"aria-hidden")):function(){return null}},JJ=Object.defineProperty,ds=(t,e)=>JJ(t,"name",{value:e,configurable:!0}),c6="Dialog",[a9,Jae]=io(c6),[eee,Ci]=a9(c6),lv=ds(t=>{const{__scopeDialog:e,children:n,open:r,defaultOpen:s,onOpenChange:i,modal:o=!0}=t,l=m.useRef(null),u=m.useRef(null),{nodes:d,registry:f}=Wb(),[h,g]=ll({prop:r,defaultProp:s??!1,onChange:i,caller:c6}),[v,x]=m.useState(0),[_,w]=m.useState(0);return b.jsx(eee,{scope:e,triggerRef:l,contentRef:u,contentId:Xi(),titleId:Xi(),descriptionId:Xi(),titlePresent:v>0,descriptionPresent:_>0,setTitleCount:x,setDescriptionCount:w,open:h,onOpenChange:g,onOpenToggle:m.useCallback(()=>g(S=>!S),[g]),modal:o,branchNodes:d,branchRegistry:f,children:n})},"Dialog"),tee="DialogTrigger",ele=m.forwardRef(ds(function(e,n){const{__scopeDialog:r,...s}=e,i=Ci(tee,r),o=Zt(n,i.triggerRef);return b.jsx(kn.button,{type:"button","aria-haspopup":"dialog","aria-expanded":i.open,"aria-controls":i.open?i.contentId:void 0,"data-state":pv(i.open),...s,ref:o,onClick:Bt(e.onClick,i.onOpenToggle)})},"DialogTrigger")),l9="DialogPortal",[nee,c9]=a9(l9,{forceMount:void 0}),cv=ds(t=>{const{__scopeDialog:e,forceMount:n,children:r,container:s}=t,i=Ci(l9,e);return b.jsx(nee,{scope:e,forceMount:n,children:m.Children.map(r,o=>b.jsx(al,{present:n||i.open,children:b.jsx(n6,{asChild:!0,container:s,children:o})}))})},"DialogPortal"),Gw="DialogOverlay",uv=m.forwardRef(ds(function(e,n){const r=c9(Gw,e.__scopeDialog),{forceMount:s=r.forceMount,...i}=e,o=Ci(Gw,e.__scopeDialog);return o.modal?b.jsx(al,{present:s||o.open,children:b.jsx(see,{...i,ref:n})}):null},"DialogOverlay")),ree=Qa("DialogOverlay.RemoveScroll"),see=m.forwardRef(ds(function(e,n){const{__scopeDialog:r,...s}=e,i=Ci(Gw,r),o=sO(),l=Zt(n,o);return b.jsx(l6,{as:ree,allowPinchZoom:!0,shards:m.useMemo(()=>[i.contentRef,...i.branchNodes.map(u=>({current:u}))],[i.contentRef,i.branchNodes]),children:b.jsx(kn.div,{"data-state":pv(i.open),...s,ref:l,style:{pointerEvents:"auto",...s.style}})})},"DialogOverlayImpl")),Oh="DialogContent",dv=m.forwardRef(ds(function(e,n){const r=c9(Oh,e.__scopeDialog),{forceMount:s=r.forceMount,...i}=e,o=Ci(Oh,e.__scopeDialog);return b.jsx(al,{present:s||o.open,children:o.modal?b.jsx(iee,{...i,ref:n}):b.jsx(oee,{...i,ref:n})})},"DialogContent")),iee=m.forwardRef(ds(function(e,n){const r=Ci(Oh,e.__scopeDialog),s=m.useRef(null),i=Zt(n,r.contentRef,s);return m.useEffect(()=>{const o=s.current;if(o)return o9(o)},[]),b.jsx(u9,{...e,ref:i,trapFocus:r.open,disableOutsidePointerEvents:r.open,onCloseAutoFocus:Bt(e.onCloseAutoFocus,o=>{var l;o.preventDefault(),(l=r.triggerRef.current)==null||l.focus()}),onPointerDownOutside:Bt(e.onPointerDownOutside,o=>{const l=o.detail.originalEvent,u=l.button===0&&l.ctrlKey===!0;(l.button===2||u)&&o.preventDefault()}),onFocusOutside:Bt(e.onFocusOutside,o=>o.preventDefault())})},"DialogContentModal")),oee=m.forwardRef(ds(function(e,n){const r=Ci(Oh,e.__scopeDialog),s=m.useRef(!1),i=m.useRef(!1);return b.jsx(u9,{...e,ref:n,trapFocus:!1,disableOutsidePointerEvents:!1,onCloseAutoFocus:o=>{var l,u;(l=e.onCloseAutoFocus)==null||l.call(e,o),o.defaultPrevented||(s.current||(u=r.triggerRef.current)==null||u.focus(),o.preventDefault()),s.current=!1,i.current=!1},onInteractOutside:o=>{var d,f;(d=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")),u9=m.forwardRef(ds(function(e,n){const{__scopeDialog:r,trapFocus:s,onOpenAutoFocus:i,onCloseAutoFocus:o,"aria-describedby":l,children:u,...d}=e,f=Ci(Oh,r);return ov(),b.jsx(Zb,{registry:f.branchRegistry,children:b.jsx(aO,{asChild:!0,loop:!0,trapped:s,branches:f.branchNodes,onMountAutoFocus:i,onUnmountAutoFocus:o,children:b.jsx(Ub,{role:"dialog",id:f.contentId,"aria-labelledby":f.titlePresent?f.titleId:void 0,"aria-describedby":f.descriptionPresent?d9(l,f.descriptionId):l,"data-state":pv(f.open),...d,ref:n,deferPointerDownOutside:!0,onDismiss:()=>f.onOpenChange(!1),children:u})})})},"DialogContentImpl")),fv=m.forwardRef(ds(function(e,n){const{__scopeDialog:r,...s}=e,i=Ci("DialogTitle",r),{setTitleCount:o}=i;return Mr(()=>(o(l=>l+1),()=>o(l=>l-1)),[o]),b.jsx(kn.h2,{id:i.titleId,...s,ref:n})},"DialogTitle")),hv=m.forwardRef(ds(function(e,n){const{__scopeDialog:r,...s}=e,i=Ci("DialogDescription",r),{setDescriptionCount:o}=i;return Mr(()=>(o(l=>l+1),()=>o(l=>l-1)),[o]),b.jsx(kn.p,{id:i.descriptionId,...s,ref:n})},"DialogDescription")),aee="DialogClose",tle=m.forwardRef(ds(function(e,n){const{__scopeDialog:r,...s}=e,i=Ci(aee,r);return b.jsx(kn.button,{type:"button",...s,ref:n,onClick:Bt(e.onClick,()=>i.onOpenChange(!1))})},"DialogClose"));function d9(...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}ds(d9,"concatAriaDescribedby");function pv(t){return t?"open":"closed"}ds(pv,"getState");var lee=Object.defineProperty,Jo=(t,e)=>lee(t,"name",{value:e,configurable:!0}),u6="Popover",[f9,nle]=io(u6,[sv]),d6=sv(),[cee,Dd]=f9(u6),f6=Jo(t=>{const{__scopePopover:e,children:n,open:r,defaultOpen:s,onOpenChange:i,modal:o=!1}=t,l=d6(e),u=m.useRef(null),[d,f]=m.useState(!1),[h,g]=m.useState(0),[v,x]=m.useState(0),[_,w]=ll({prop:r,defaultProp:s??!1,onChange:i,caller:u6});return b.jsx(TO,{...l,children:b.jsx(cee,{scope:e,contentId:Xi(),titleId:Xi(),descriptionId:Xi(),titlePresent:h>0,descriptionPresent:v>0,setTitleCount:g,setDescriptionCount:x,triggerRef:u,open:_,onOpenChange:w,onOpenToggle:m.useCallback(()=>w(S=>!S),[w]),hasCustomAnchor:d,onCustomAnchorAdd:m.useCallback(()=>f(!0),[]),onCustomAnchorRemove:m.useCallback(()=>f(!1),[]),modal:o,children:n})})},"Popover"),uee="PopoverTrigger",h6=m.forwardRef(Jo(function(e,n){const{__scopePopover:r,...s}=e,i=Dd(uee,r),o=d6(r),l=Zt(n,i.triggerRef),u=b.jsx(kn.button,{type:"button","aria-haspopup":"dialog","aria-expanded":i.open,"aria-controls":i.open?i.contentId:void 0,"data-state":g6(i.open),...s,ref:l,onClick:Bt(e.onClick,i.onOpenToggle)});return i.hasCustomAnchor?u:b.jsx(RO,{asChild:!0,...o,children:u})},"PopoverTrigger")),h9="PopoverPortal",[dee,fee]=f9(h9,{forceMount:void 0}),p6=Jo(t=>{const{__scopePopover:e,forceMount:n,children:r,container:s}=t,i=Dd(h9,e);return b.jsx(dee,{scope:e,forceMount:n,children:b.jsx(al,{present:n||i.open,children:b.jsx(n6,{asChild:!0,container:s,children:r})})})},"PopoverPortal"),Lh="PopoverContent",m6=m.forwardRef(Jo(function(e,n){const r=fee(Lh,e.__scopePopover),{forceMount:s=r.forceMount,...i}=e,o=Dd(Lh,e.__scopePopover);return b.jsx(al,{present:s||o.open,children:o.modal?b.jsx(pee,{...i,ref:n}):b.jsx(mee,{...i,ref:n})})},"PopoverContent")),hee=Qa("PopoverContent.RemoveScroll"),pee=m.forwardRef(Jo(function(e,n){const r=Dd(Lh,e.__scopePopover),s=m.useRef(null),i=Zt(n,s),o=m.useRef(!1),{nodes:l,registry:u}=Wb();return m.useEffect(()=>{const d=s.current;if(d)return o9(d)},[]),b.jsx(l6,{as:hee,allowPinchZoom:!0,shards:m.useMemo(()=>[s,...l.map(d=>({current:d}))],[s,l]),children:b.jsx(p9,{...e,ref:i,branchNodes:l,branchRegistry:u,trapFocus:r.open,disableOutsidePointerEvents:!0,onCloseAutoFocus:Bt(e.onCloseAutoFocus,d=>{var f;d.preventDefault(),o.current||(f=r.triggerRef.current)==null||f.focus()}),onPointerDownOutside:Bt(e.onPointerDownOutside,d=>{const f=d.detail.originalEvent,h=f.button===0&&f.ctrlKey===!0,g=f.button===2||h;o.current=g},{checkForDefaultPrevented:!1}),onFocusOutside:Bt(e.onFocusOutside,d=>d.preventDefault(),{checkForDefaultPrevented:!1})})})},"PopoverContentModal")),mee=m.forwardRef(Jo(function(e,n){const r=Dd(Lh,e.__scopePopover),s=m.useRef(!1),i=m.useRef(!1);return b.jsx(p9,{...e,ref:n,trapFocus:!1,disableOutsidePointerEvents:!1,onCloseAutoFocus:o=>{var l,u;(l=e.onCloseAutoFocus)==null||l.call(e,o),o.defaultPrevented||(s.current||(u=r.triggerRef.current)==null||u.focus(),o.preventDefault()),s.current=!1,i.current=!1},onInteractOutside:o=>{var d,f;(d=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")),p9=m.forwardRef(Jo(function(e,n){const{__scopePopover:r,trapFocus:s,onOpenAutoFocus:i,onCloseAutoFocus:o,disableOutsidePointerEvents:l,onEscapeKeyDown:u,onPointerDownOutside:d,onFocusOutside:f,onInteractOutside:h,"aria-describedby":g,branchNodes:v,branchRegistry:x,..._}=e,w=Dd(Lh,r),S=d6(r),[k,E]=m.useState(null),P=Zt(n,E);return qb(k),ov(),b.jsx(Zb,{registry:x,children:b.jsx(aO,{asChild:!0,loop:!0,trapped:s,branches:v,onMountAutoFocus:i,onUnmountAutoFocus:o,children:b.jsx(Ub,{asChild:!0,disableOutsidePointerEvents:l,onInteractOutside:h,onEscapeKeyDown:u,onPointerDownOutside:d,onFocusOutside:f,onDismiss:()=>w.onOpenChange(!1),deferPointerDownOutside:!0,children:b.jsx(IO,{"data-state":g6(w.open),role:"dialog",id:w.contentId,"aria-labelledby":w.titlePresent?w.titleId:void 0,"aria-describedby":w.descriptionPresent?m9(g,w.descriptionId):g,...S,..._,ref:P,style:{..._.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 g6(t){return t?"open":"closed"}Jo(g6,"getState");function m9(...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}Jo(m9,"concatAriaDescribedby");const Nh={fast:{type:"spring",duration:.08,bounce:0},moderate:{type:"spring",duration:.16,bounce:.15}},gee="data-hover-dead-zone";function g9(t,e={}){const{axis:n="y",snapTolerancePx:r=1/0}=e,s=m.useRef(new Map),[i,o]=m.useState(null),[l,u]=m.useState([]),d=m.useRef([]),f=m.useRef(0),h=m.useRef(null),g=m.useRef(null),v=m.useCallback(()=>{const E=[];return s.current.forEach((P,T)=>{E[T]={top:P.offsetTop,height:P.offsetHeight,left:P.offsetLeft,width:P.offsetWidth}}),E},[]),x=m.useCallback(()=>{if(!t.current)return;const P=v();d.current=P,u(P)},[t,v]),_=m.useCallback((E,P)=>{P?s.current.set(E,P):s.current.delete(E),g.current!==null&&cancelAnimationFrame(g.current),g.current=requestAnimationFrame(()=>{g.current=null,x()})},[x]),w=m.useCallback(E=>{const P=E.clientX,T=E.clientY,I=E.target instanceof Element&&E.target.closest(`[${gee}]`)!==null;h.current!==null&&cancelAnimationFrame(h.current),h.current=requestAnimationFrame(()=>{h.current=null;const M=t.current;if(!M)return;if(I){o(null);return}const R=v(),O=d.current;(R.length!==O.length||R.some((ae,se)=>{const ie=O[se];return!ie||!ae||ae.top!==ie.top||ae.height!==ie.height||ae.left!==ie.left||ae.width!==ie.width}))&&(d.current=R,u(R));const $=M.getBoundingClientRect(),V=n==="x"?P:T;let q=null,B=1/0,K=null;const z=d.current,X=n==="x"?M.scrollLeft:M.scrollTop,Z=n==="x"?M.clientLeft:M.clientTop,J=n==="x"?$.left:$.top,H=n==="x"?M.offsetWidth:M.offsetHeight,N=n==="x"?$.width:$.height,Y=H>0?N/H:1;for(let ae=0;ae<z.length;ae++){const se=z[ae];if(!se)continue;const ie=n==="x"?se.left:se.top,de=J+(Z+ie-X)*Y,ge=(n==="x"?se.width:se.height)*Y,ue=de+ge;V>=de&&V<=ue&&(K=ae);let re=0;V<de?re=de-V:V>ue&&(re=V-ue),re<B&&(B=re,q=ae)}o(K??(B<=r?q:null))})},[n,t,r,v]),S=m.useCallback(()=>{f.current+=1,x()},[x]),k=m.useCallback(()=>{h.current!==null&&(cancelAnimationFrame(h.current),h.current=null),o(null)},[]);return m.useEffect(()=>()=>{h.current!==null&&cancelAnimationFrame(h.current),g.current!==null&&cancelAnimationFrame(g.current)},[]),{activeIndex:i,setActiveIndex:o,itemRects:l,sessionRef:f,handlers:{onMouseMove:w,onMouseEnter:S,onMouseLeave:k},registerItem:_,measureItems:x}}function vee(t,e,n){m.useEffect(()=>(t(e,n.current),()=>t(e,null)),[e,t,n])}let mm=0;const yee=()=>{mm+=1;let t=!1;return()=>{t||(t=!0,mm=Math.max(0,mm-1))}},_ee=()=>mm>0,wee='[data-menu-item]:not([disabled]):not([aria-disabled="true"])',v9=({itemSelector:t=wee,loop:e=!1,onDismiss:n}={})=>{const r=m.useRef(null),s=m.useRef(null),i=m.useRef(n),o=m.useRef(!1);i.current=n;const l=m.useCallback(f=>{var h;if(r.current=f,f){o.current=!1;const g=yee(),v=f.ownerDocument.defaultView;let x;const _=()=>{v==null||v.clearTimeout(x),x=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",_),s.current=()=>{v==null||v.removeEventListener("blur",_),v==null||v.clearTimeout(x),g()}}else(h=s.current)==null||h.call(s),s.current=null},[]),u=f=>{o.current&&f.preventDefault()},d=m.useCallback(f=>{var k;const{key:h}=f;if(h!=="ArrowDown"&&h!=="ArrowUp"&&h!=="Home"&&h!=="End")return;const g=r.current;if(!g)return;const v=Array.from(g.querySelectorAll(t));if(v.length===0)return;f.preventDefault(),f.stopPropagation();const x=v.indexOf(document.activeElement),_=v.length-1,w=E=>{if(x===-1)return E===1?0:_;const P=x+E;return e?(P+v.length)%v.length:Math.min(Math.max(P,0),_)};let S;h==="Home"?S=0:h==="End"?S=_:h==="ArrowDown"?S=w(1):S=w(-1),(k=v[S])==null||k.focus()},[t,e]);return{containerRef:l,onKeyDown:d,onCloseAutoFocus:u}};var gm={exports:{}},xee=gm.exports,RP;function bee(){return RP||(RP=1,(function(t){(function(e,n){t.exports?t.exports=n():e.log=n()})(xee,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(_,w){var S=_[w];if(typeof S.bind=="function")return S.bind(_);try{return Function.prototype.bind.call(S,_)}catch{return function(){return Function.prototype.apply.apply(S,[_,arguments])}}}function u(){console.log&&(console.log.apply?console.log.apply(console,arguments):Function.prototype.apply.apply(console.log,[console,arguments])),console.trace&&console.trace()}function d(_){return _==="debug"&&(_="log"),typeof console===n?!1:_==="trace"&&r?u:console[_]!==void 0?l(console,_):console.log!==void 0?l(console,"log"):e}function f(){for(var _=this.getLevel(),w=0;w<s.length;w++){var S=s[w];this[S]=w<_?e:this.methodFactory(S,_,this.name)}if(this.log=this.debug,typeof console===n&&_<this.levels.SILENT)return"No console available for logging"}function h(_){return function(){typeof console!==n&&(f.call(this),this[_].apply(this,arguments))}}function g(_,w,S){return d(_)||h.apply(this,arguments)}function v(_,w){var S=this,k,E,P,T="loglevel";typeof _=="string"?T+=":"+_:typeof _=="symbol"&&(T=void 0);function I($){var V=(s[$]||"silent").toUpperCase();if(!(typeof window===n||!T)){try{window.localStorage[T]=V;return}catch{}try{window.document.cookie=encodeURIComponent(T)+"="+V+";"}catch{}}}function M(){var $;if(!(typeof window===n||!T)){try{$=window.localStorage[T]}catch{}if(typeof $===n)try{var V=window.document.cookie,q=encodeURIComponent(T),B=V.indexOf(q+"=");B!==-1&&($=/^([^;]+)/.exec(V.slice(B+q.length+1))[1])}catch{}return S.levels[$]===void 0&&($=void 0),$}}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 O($){var V=$;if(typeof V=="string"&&S.levels[V.toUpperCase()]!==void 0&&(V=S.levels[V.toUpperCase()]),typeof V=="number"&&V>=0&&V<=S.levels.SILENT)return V;throw new TypeError("log.setLevel() called with invalid level: "+$)}S.name=_,S.levels={TRACE:0,DEBUG:1,INFO:2,WARN:3,ERROR:4,SILENT:5},S.methodFactory=w||g,S.getLevel=function(){return P??E??k},S.setLevel=function($,V){return P=O($),V!==!1&&I(P),f.call(S)},S.setDefaultLevel=function($){E=O($),M()||S.setLevel($,!1)},S.resetLevel=function(){P=null,R(),f.call(S)},S.enableAll=function($){S.setLevel(S.levels.TRACE,$)},S.disableAll=function($){S.setLevel(S.levels.SILENT,$)},S.rebuild=function(){if(o!==S&&(k=O(o.getLevel())),f.call(S),o===S)for(var $ in i)i[$].rebuild()},k=O(o?o.getLevel():"WARN");var D=M();D!=null&&(P=O(D)),f.call(S)}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 S=i[w];return S||(S=i[w]=new v(w,o.methodFactory)),S};var x=typeof window!==n?window.log:void 0;return o.noConflict=function(){return typeof window!==n&&window.log===o&&(window.log=x),o},o.getLoggers=function(){return i},o.default=o,o})})(gm)),gm.exports}var See=bee();const gi=$g(See),Br=(t,e=String(t))=>t instanceof Error?t.message:e,kee="INFO",Cee=kee.toUpperCase();gi.setLevel(gi.levels[Cee]||gi.levels.INFO);const Is=t=>{const e=t?`[${t}] `:"";return{trace:(n,...r)=>gi.trace(`${e}${n}`,...r),debug:(n,...r)=>gi.debug(`${e}${n}`,...r),info:(n,...r)=>gi.info(`${e}${n}`,...r),warn:(n,...r)=>gi.warn(`${e}${n}`,...r),error:(n,...r)=>{gi.error(`${e}${n}`,...r);try{const i=r.map(l=>Br(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}:{}};Ie.capture("logger_error",o)}catch(s){console.error("[logger] Failed to send logger_error to PostHog:",s)}},api:(n,...r)=>gi.info(`${e}API: ${n}`,...r),hook:(n,...r)=>gi.debug(`${e}Hook: ${n}`,...r),mount:(n,...r)=>gi.debug(`${e}Mount: ${n}`,...r)}},MP=Is("useVariantsUiState"),Eee={groups:[],rows:{}},V0={pinned:[],order:Eee},Ff="pinned",Pee="top",I_=t=>`rows:${t}`,IP=t=>e=>e.pinned.includes(t)?e:{...e,pinned:[...e.pinned,t]},Aee=t=>e=>({...e,pinned:e.pinned.filter(n=>n!==t)}),Tee=(t,e)=>n=>{if(t===Ff){const r=new Set(e);return{...n,pinned:[...e,...n.pinned.filter(s=>!r.has(s))]}}return t===Pee?{...n,order:{...n.order,groups:e}}:{...n,order:{...n.order,rows:{...n.order.rows,[t.slice(5)]:e}}}},Ree=t=>{const e=t?`?projectPath=${encodeURIComponent(t)}`:"",[n,r]=m.useState(V0),s=m.useRef(n);s.current=n;const i=m.useRef(!1),o=m.useRef([]),l=m.useCallback(v=>{t&&fetch(`/api/variants/ui-state${e}`,{method:"PUT",headers:{"Content-Type":"application/json"},body:JSON.stringify({uiState:v})}).catch(x=>{MP.warn("persist failed — arrangement kept for this session only",x)})},[t,e]);m.useEffect(()=>{if(r(V0),s.current=V0,i.current=!1,o.current=[],!t)return;let v=!1;return(async()=>{try{const x=await fetch(`/api/variants/ui-state${e}`);if(!x.ok||v)return;const _=await x.json();if(v)return;let w=_.uiState??V0;const S=o.current;o.current=[];for(const k of S)w=k(w);i.current=!0,s.current=w,r(w),S.length>0&&l(w)}catch(x){MP.warn("load failed — arrangement is session-local until reload",x)}})(),()=>{v=!0}},[t,e,l]);const u=m.useCallback(v=>{const x=v(s.current);s.current=x,r(x),i.current?l(x):o.current.push(v)},[l]),d=m.useCallback(v=>{const x=!s.current.pinned.includes(v);u(x?IP(v):Aee(v))},[u]),f=m.useCallback(v=>{s.current.pinned.includes(v)||u(IP(v))},[u]),h=m.useCallback((v,x)=>{u(Tee(v,x))},[u]),g=m.useMemo(()=>new Set(n.pinned),[n.pinned]);return{pinnedKeys:n.pinned,pinnedKeySet:g,listOrder:n.order,togglePin:d,pinItem:f,reorder:h}},Mee=t=>{const{containerRef:e,dragged:n,yieldToSelector:r,restrictToSelector:s,onReorder:i}=t,[o,l]=m.useState(null),u=m.useCallback(h=>{const g=e.current;return g?Array.from(g.querySelectorAll(`[data-reorder-container="${CSS.escape(h)}"]`)):[]},[e]),d=m.useCallback(h=>{if(!n){o&&l(null);return}const g=e.current;if(!g)return;if(r){const S=g.querySelector(r);if(S){const k=S.getBoundingClientRect();if(h.clientY>=k.top&&h.clientY<=k.bottom){o&&l(null);return}}}if(s){const S=g.querySelector(s),k=S==null?void 0:S.getBoundingClientRect();if(!k||h.clientY<k.top||h.clientY>k.bottom){o&&l(null);return}}const v=u(n.container);if(v.length===0){o&&l(null);return}const x=g.getBoundingClientRect().top;let _=v.length;for(let S=0;S<v.length;S++){const k=v[S].getBoundingClientRect();if(h.clientY<k.top+k.height/2){_=S;break}}let w;_===0?w=v[0].getBoundingClientRect().top-x-1:_===v.length?w=v[v.length-1].getBoundingClientRect().bottom-x:w=(v[_-1].getBoundingClientRect().bottom+v[_].getBoundingClientRect().top)/2-x,(!o||o.index!==_||o.container!==n.container)&&l({container:n.container,index:_,top:w})},[e,n,o,u,r,s]),f=m.useCallback(()=>{if(!n||!o)return;l(null);const h=u(o.container).map(x=>x.dataset.reorderKey).filter(x=>!!x),g=h.indexOf(n.key);if(g===-1)return;h.splice(g,1);const v=o.index>g?o.index-1:o.index;h.splice(v,0,n.key),i(o.container,h)},[n,o,u,i]);return{dropTarget:o,onPointerMove:d,onPointerUp:f}},y9=(t,e)=>`style:${t}:${e}`,_9=t=>`text:${t}`,w9=t=>{const e=[t.rivetId,t.xpath,t.cssSelector].filter(n=>!!n).map(n=>n.trim()).filter(Boolean);return e.length>0?[...new Set(e)]:["unknown"]},x9=t=>w9(t)[0],H0=(t,e)=>w9(t).includes(e),Iee=t=>{const e=x9(t.elementId),n=t.batchId?`:${t.batchId}`:"";return t.type==="style"?`${y9(e,t.property)}${n}`:`${_9(e)}${n}`},hr=[];for(let t=0;t<256;++t)hr.push((t+256).toString(16).slice(1));function Oee(t,e=0){return(hr[t[e+0]]+hr[t[e+1]]+hr[t[e+2]]+hr[t[e+3]]+"-"+hr[t[e+4]]+hr[t[e+5]]+"-"+hr[t[e+6]]+hr[t[e+7]]+"-"+hr[t[e+8]]+hr[t[e+9]]+"-"+hr[t[e+10]]+hr[t[e+11]]+hr[t[e+12]]+hr[t[e+13]]+hr[t[e+14]]+hr[t[e+15]]).toLowerCase()}const Lee=new Uint8Array(16);function Nee(){return crypto.getRandomValues(Lee)}function OP(t,e,n){return crypto.randomUUID?crypto.randomUUID():Dee(t)}function Dee(t,e,n){var s;t=t||{};const r=t.random??((s=t.rng)==null?void 0:s.call(t))??Nee();if(r.length<16)throw new Error("Random bytes length must be >= 16");return r[6]=r[6]&15|64,r[8]=r[8]&63|128,Oee(r)}const jee=300;class $ee{constructor(){wa(this,"history",{current:new Map,past:[],future:[]});wa(this,"pendingChanges",new Map);wa(this,"currentBatchId",null);wa(this,"debounceTimer",null);wa(this,"onChangeCallbacks",[]);wa(this,"stateBeforePending",null);wa(this,"transactionDepth",0)}recordChange(e){this.pendingChanges.size===0&&(this.currentBatchId=OP(),this.stateBeforePending=new Map(this.history.current)),this.currentBatchId&&(e.batchId=this.currentBatchId);const n=x9(e.elementId),r=e.type==="style"?y9(n,e.property):_9(n),s=Array.from(this.history.current.entries()).find(([o])=>o===r||o.startsWith(`${r}:`));if(s){const o=s[1];e.type==="style"&&o.type==="style"?e.oldValue=o.oldValue:e.type==="text"&&o.type==="text"&&(e.oldText=o.oldText)}const i=Iee(e);this.history.current.set(i,e),this.pendingChanges.set(i,e),this.debounceTimer&&clearTimeout(this.debounceTimer),this.debounceTimer=setTimeout(()=>{this.commitPending()},jee),this.notifyChange()}flushPending(){this.debounceTimer&&(clearTimeout(this.debounceTimer),this.debounceTimer=null),this.commitPending()}removeChange(e){const n=this.history.current.get(e)??this.pendingChanges.get(e)??null,r=this.history.current.has(e),s=this.pendingChanges.has(e);return!r&&!s?null:(r&&this.history.current.delete(e),s&&this.pendingChanges.delete(e),n&&this.stateBeforePending&&(this.stateBeforePending=this.removeChangeFromSnapshotById(this.stateBeforePending,n.id)),s&&this.pendingChanges.size===0&&(this.debounceTimer&&(clearTimeout(this.debounceTimer),this.debounceTimer=null),this.stateBeforePending=null,this.currentBatchId=null),r&&(this.history.future=[]),n&&(this.history.past=this.history.past.map(i=>this.removeChangeFromSnapshotById(i,n.id)).filter(i=>i.size>0)),this.notifyChange(),n)}removeChangeById(e){const n=Array.from(this.history.current.entries()).find(([,s])=>s.id===e);if(n)return this.removeChange(n[0]);const r=Array.from(this.pendingChanges.entries()).find(([,s])=>s.id===e);return r?this.removeChange(r[0]):null}removeChangeFromSnapshotById(e,n){return new Map(Array.from(e.entries()).filter(([,r])=>r.id!==n))}commitPending(){this.pendingChanges.size===0||!this.stateBeforePending||this.transactionDepth>0||(this.history.past.push(this.stateBeforePending),this.history.future=[],this.pendingChanges.clear(),this.stateBeforePending=null,this.currentBatchId=null,this.notifyChange())}undo(){this.pendingChanges.size>0&&this.commitPending();const e=this.history.past.pop();if(!e)return null;const n=new Map(this.history.current);this.history.future.push(n),this.history.current=e,this.notifyChange();const r=[];for(const[s,i]of n)this.history.current.has(s)||r.push(i);return r}redo(){const e=this.history.future.pop();if(!e)return null;const n=new Map(this.history.current);this.history.past.push(n),this.history.current=e,this.notifyChange();const r=[];for(const[s,i]of this.history.current)n.has(s)||r.push(i);return r}getChanges(){return Array.from(this.history.current.values())}getStyleChanges(){return Array.from(this.history.current.values()).filter(e=>e.type==="style")}getTextChanges(){return Array.from(this.history.current.values()).filter(e=>e.type==="text")}getChangeCount(){return this.getUniqueBatchCount(this.history.current.values())}getStyleBatchCount(){return this.getUniqueBatchCount(Array.from(this.history.current.values()).filter(e=>e.type==="style"))}getTextBatchCount(){return this.getUniqueBatchCount(Array.from(this.history.current.values()).filter(e=>e.type==="text"))}getUniqueBatchCount(e){const n=new Set;for(const r of e)r.batchId?n.add(r.batchId):n.add(r.id);return n.size}canUndo(){return this.history.past.length>0||this.pendingChanges.size>0}canRedo(){return this.history.future.length>0}clear(){this.debounceTimer&&(clearTimeout(this.debounceTimer),this.debounceTimer=null),this.history={current:new Map,past:[],future:[]},this.pendingChanges.clear(),this.stateBeforePending=null,this.currentBatchId=null,this.notifyChange()}getStyleChange(e,n){return Array.from(this.history.current.values()).filter(s=>s.type==="style"&&H0(s.elementId,e)&&s.property===n).sort((s,i)=>i.timestamp-s.timestamp)[0]}getTextChange(e){return Array.from(this.history.current.values()).filter(r=>r.type==="text"&&H0(r.elementId,e)).sort((r,s)=>s.timestamp-r.timestamp)[0]}hasChanges(e){return Array.from(this.history.current.values()).some(n=>H0(n.elementId,e))}getChangesForElement(e){return Array.from(this.history.current.values()).filter(n=>H0(n.elementId,e))}onChange(e){return this.onChangeCallbacks.push(e),()=>{const n=this.onChangeCallbacks.indexOf(e);n!==-1&&this.onChangeCallbacks.splice(n,1)}}notifyChange(){this.onChangeCallbacks.forEach(e=>e())}export(){return{current:Array.from(this.history.current.entries()),past:this.history.past.map(e=>Array.from(e.entries())),future:this.history.future.map(e=>Array.from(e.entries()))}}import(e){this.history={current:new Map(e.current),past:e.past.map(n=>new Map(n)),future:e.future.map(n=>new Map(n))},this.notifyChange()}async transaction(e){const n=this.pendingChanges.size===0;n&&(this.currentBatchId=OP(),this.stateBeforePending=new Map(this.history.current)),this.transactionDepth++;try{await e()}catch(r){throw n&&this.stateBeforePending&&(this.history.current=new Map(this.stateBeforePending),this.pendingChanges.clear(),this.currentBatchId=null,this.stateBeforePending=null),r}finally{this.transactionDepth--,n&&this.transactionDepth===0&&this.flushPending()}}}const Sg={kind:"base"};function Pc(t){return t.kind==="base"?"base":`variant:${t.sessionId}:${t.variantId}`}function Fee(t,e){return t.kind==="base"&&e.kind,t.kind==="variant"&&e.kind==="variant"?t.sessionId===e.sessionId&&t.variantId===e.variantId:!1}const Vee={resize:{default:!1},variants:{default:!1},designSystemEditor:{default:!1},branchDiff:{default:!1},gitUi:{default:!0},createProject:{default:!1},deployPrototype:{default:!1},canvasShare:{default:!1},variantSend:{default:!1},generativeControls:{default:!1},refineMode:{default:!1},designContextViewer:{default:!1},variantReferences:{default:!1},inspectorUndoRedo:{default:!1}},b9=Object.fromEntries(Object.entries(Vee).map(([t,e])=>[t,{isEnabled:e.default}]));ut("view");const S9=ut(!0),k9=ut(null),Hee=ut("chat"),C9=ut(0),zee=ut({name:null,email:null}),LP=ut(Sg);ut(null);const Dh=new Map,Uee=t=>{const e=Pc(t);let n=Dh.get(e);return n||(n=new $ee,Dh.set(e,n)),n};ut(t=>Uee(t(LP)),(t,e,n)=>{Dh.set(Pc(t(LP)),n)});const Bee=t=>{for(const e of[...Dh.keys()])e==="base"||t.has(e)||Dh.delete(e)},jh=ut(new Map),NP=ut(null);ut(null);const Kw=ut(0),kg=ut(null),Yw=ut(!1),Qw=ut(null),E9=ut(!1),P9=ut(!1),Xw=ut(null),vm=ut(null),wd=ut(null),v6=ut(null),Ko=ut(null),A9=ut(!1),lp=ut({active:!1}),T9=ut([]),DP=ut(null),Zee=(t,e,n)=>{let r=!1;const s=new Map(t);for(const[i,o]of t)o.target&&Fee(o.target,e)&&(s.set(i,{...o,target:n}),r=!0);return r?s:t},Wee=ut(null,(t,e,n)=>{const r=u=>{const d=u??Sg;return d.kind==="variant"&&!n.has(Pc(d))},s=t(jh);let i=null;for(const[u,d]of s)r(d.target)&&(i??(i=new Set)).add(u);if(i){const u=new Map(s);for(const d of i)u.delete(d);e(jh,u)}const o=t(NP);o&&r(o.target)&&(e(NP,null),e(Qee,!1));const l=t(DP);l&&(i!=null&&i.has(l.commentId))&&e(DP,null),Bee(n)}),Jw=ut(b9),qee=ut(!1),mv=ut(null),R9=ut(null),gv=ut(!0),Gee=ut(!1),M9=ut(!1),I9=ut(null),Kee=()=>{var t;return typeof window>"u"?null:((t=window.__RIVET_BOOTSTRAP__)==null?void 0:t.agentApplyMode)??null},vv=ut(Kee()),Yee=ut(null),Qee=ut(!1);ut(0);ut(0);function Xee(t){return t==="cursor"?"Cursor":t==="codex"?"Codex":t==="claude-desktop"?"Claude":"Claude Code"}const Jee=["⡡⠊⢔⠡","⠊⡰⡡⡘","⢔⢅⠈⢢","⡁⢂⠆⡍","⢔⠨⢑⢐","⠨⡑⡠⠊"],y6=({className:t,"data-testid":e}={})=>b.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:b.jsx("div",{className:"rivet-sparkle-strip",children:Jee.map((n,r)=>b.jsx("span",{className:"block",style:{height:"1em",lineHeight:"1em"},children:n},r))})}),O9=({primaryLabel:t,primaryIcon:e,primaryAction:n,isDisabled:r=!1,isDropdownDisabled:s=!1,isLoading:i=!1,loadingLabel:o,dropdownAriaLabel:l="More actions",dropdownItems:u})=>{const[d,f]=m.useState(!1),h=i?o??t:t,g=u.length>0;return b.jsxs("div",{className:"flex items-stretch",children:[b.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 ${g?"rounded-l-md":"rounded-md"}`,children:[e?b.jsx(e,{className:"h-3.5 w-3.5",weight:"bold"}):null,h]}),g?b.jsxs(f6,{open:d,onOpenChange:f,children:[b.jsx(h6,{asChild:!0,children:b.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:b.jsx($K,{className:"h-3.5 w-3.5",weight:"bold"})})}),b.jsx(p6,{children:b.jsx(m6,{className:"border-divider bg-main z-[60] min-w-[140px] rounded-lg border p-1 shadow-lg",sideOffset:5,align:"end",children:u.map(v=>{const x=v.icon;return b.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:[x?b.jsx(x,{className:"h-3.5 w-3.5",weight:"bold"}):null,v.label]},v.label)})})})]}):null]})},Ac=({label:t,children:e,side:n="top",sideOffset:r=8,delayDuration:s=300,disabled:i=!1,forceOpen:o})=>i?b.jsx(b.Fragment,{children:e}):b.jsx(o6,{content:t,side:n,sideOffset:r,delayDuration:s,forceOpen:o,children:e}),yv="/__rivet/preview",jP=`${yv}/variant/`,$P=`${yv}/history/`,L9=t=>t?t.startsWith("/")?t:`/${t}`:"/",ete=t=>`${yv}/variant/${encodeURIComponent(t.sessionId)}/${encodeURIComponent(t.variantId)}${L9(t.routePath)}`,FP=t=>`${yv}/history/${encodeURIComponent(t.sessionId)}/${encodeURIComponent(t.variantId)}${L9(t.routePath)}`,VP=t=>{try{const e=new URL(t,"http://localhost");return e.pathname.startsWith(jP)||e.pathname.startsWith($P)}catch{return t.startsWith(jP)||t.startsWith($P)}},HP=t=>{var s,i,o,l;const{sessionId:e,variant:n,projectContext:r}=t;return n.status!=="succeeded"?null:((s=n.preview)==null?void 0:s.kind)==="static_artifact"?n.preview.url:e&&(((i=n.preview)==null?void 0:i.kind)==="dev_server"||typeof n.port=="number")?ete({sessionId:e,variantId:n.workItemId,routePath:t.routePath}):e&&(r==null?void 0:r.kind)==="fresh"&&((o=r.executionPlan)==null?void 0:o.mode)!=="vite_app"&&((l=n.preview)==null?void 0:l.kind)!=="dev_server"?`/api/variants/${e}/static/${n.workItemId}`:null},zP="/rivet/",N9=t=>{if(!t.startsWith(zP))return null;const e=t.slice(zP.length);return!e||e==="/"?null:`/${e}`},xd=(t,e=fetch)=>{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(()=>{})},tte=(t,e=fetch)=>{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),xd(r,e))}},Cg=(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}}},UP=6,D9="original",_6="Original",j9="The original state of your app before any variants were generated.",BP=200,$9="h-6 w-6 rounded",ex=[.33,1,.68,1],tx=.22,zn=Is("AgentVariantsPanel"),O_=()=>{var t;(t=window.getSelection())==null||t.removeAllRanges()},bu=t=>{var e;return!!t.hasTree&&((e=t.serve)==null?void 0:e.kind)==="dev-server"},nte=t=>{var e;return t?t.kind==="existing"?!0:((e=t.executionPlan)==null?void 0:e.mode)==="vite_app":!1};function L_(t,...e){return t?e.some(n=>(n??"").toLowerCase().includes(t)):!0}const rte=(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},F9=t=>{const e="requestId"in t?["request",t.requestId]:["label",t.runLabel];return`run:${JSON.stringify([t.sessionId,...e])}`},ste="original",nx="pinned-section";function V9(t){return`rivet:collapsedRuns:${t}`}function z0(t){try{const e=window.localStorage.getItem(V9(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 N_(t,e){try{window.localStorage.setItem(V9(t),JSON.stringify([...e]))}catch{}}const ZP=(t,e)=>{const n=[],r=new Map;for(const s of t){const i=rte(s,e);let o="";s.kind==="original"?o=ste:i&&(o=F9(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 Di(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 ite=t=>{var n,r;const e=((r=(n=t.actions)==null?void 0:n.commit)==null?void 0:r.enabled)??t.status==="succeeded";return t.status==="succeeded"&&e},ih=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")},H9=t=>{var e;return((e=t.previewUnavailable)==null?void 0:e.reason)==="idle_timeout"},ote=t=>t.status==="succeeded"&&!ih(t)&&(!t.previewUnavailable||H9(t)),D_=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"},j_=(t,e,n)=>{const r=t.includes("?")?"&":"?";return`${t}${r}${encodeURIComponent(e)}=${encodeURIComponent(n)}`},ate=t=>{var e;return ite(t)&&((e=t.preview)==null?void 0:e.kind)==="static_artifact"},WP=(t,e)=>t.map(n=>`${n.workItemId}:${e[n.workItemId]??""}`).join("|"),lte=(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}),cte=()=>{var ni,ri,ra,sa;const t=Zg(),e=ct(lp),n=ct(A9),r=m.useRef(!1),s=ct(T9),i=ct(mv),o=ct(gv),l=ct(Jw),u=((ni=l.deployPrototype)==null?void 0:ni.isEnabled)??!1,d=((ri=l.canvasShare)==null?void 0:ri.isEnabled)??!1,f=((ra=l.variantSend)==null?void 0:ra.isEnabled)??!1,h=((sa=l.designContextViewer)==null?void 0:sa.isEnabled)??!1,g=ct(M9),v=ct(I9),x=mt(Kw),_=mt(kg),w=mt(Yw),S=mt(Qw),k=mt(E9),E=mt(P9),P=mt(wd),T=ct(wd),I=mt(v6),M=mt(k9);m.useEffect(()=>(M("Directions"),()=>M(null)),[M]);const R=ct(Ko),O=mt(Ko),D=m.useCallback((F=!1)=>{if(tte(R),O(null),F&&R){const ce=Cg("ended",R);Ie.capture(ce.event,ce.properties)}},[O,R]),$=ct(Xw),V=mt(Xw),q=ct(vm),B=mt(vm),K=q?`${q.sessionId}:${q.variantId}`:null,[z,X]=m.useState(""),[Z,J]=m.useReducer(F=>F+1,0),H=m.useMemo(()=>i!==null?z0(i):new Set,[i,Z]),N=m.useCallback(F=>{if(i===null)return;const ce=new Set(z0(i));ce.delete(F)||ce.add(F),N_(i,ce),J()},[i]),[Y,ae]=m.useState(null),[se,ie]=m.useState(null),[de,ge]=m.useState(!1),[ue,re]=m.useState({}),[Pe,$e]=m.useState(null),[Ee,dt]=m.useState({}),[Tt,rn]=m.useState(null),[jt,xt]=m.useState([]),Xt=m.useRef([]);Xt.current=jt;const[Ct,qe]=m.useState(!1),[ke]=m.useState(()=>QY(window.location.search)),rt=m.useRef(!1),Et=m.useRef(!1);Et.current=ke!==null||q!==null||$!==null||Ct;const Ge=m.useMemo(()=>e.active?e.variants:[],[e]),yt=m.useMemo(()=>Ge.filter(ate),[Ge]),Dn=m.useMemo(()=>WP(yt,ue),[yt,ue]),Cn=(Pe==null?void 0:Pe.key)===Dn?Pe.shareUrl:null,Me=e.active?e.sessionId:null,ea=m.useMemo(()=>{const F=new Set;for(const ce of Ge)ce.adoptedSource&&F.add(`${ce.adoptedSource.sessionId}:${ce.adoptedSource.variantId}`);return F},[Ge]),jn=m.useMemo(()=>[...jt.filter(ce=>ce.sessionId!==Me&&!ea.has(`${ce.sessionId}:${ce.variantId}`))].sort((ce,Ce)=>{const fe=new Date(ce.createdAt).getTime(),ye=new Date(Ce.createdAt).getTime();return(Number.isNaN(ye)?0:ye)-(Number.isNaN(fe)?0:fe)}),[ea,jt,Me]),tr=m.useMemo(()=>q?Ge.find(F=>{var ce,Ce;return((ce=F.adoptedSource)==null?void 0:ce.sessionId)===q.sessionId&&((Ce=F.adoptedSource)==null?void 0:Ce.variantId)===q.variantId})??null:null,[q,Ge]),ul=m.useMemo(()=>q?jn.find(F=>F.sessionId===q.sessionId&&F.variantId===q.variantId)??null:null,[q,jn]),pn=e.active?e.projectContext:null,mn=(pn==null?void 0:pn.kind)==="fresh"?pn.workspacePath:i,$d=!e.active&&jn.length>0&&jn.every(F=>F.projectKind==="fresh"),Os=e.active?nte(pn):!!i&&!$d,wr=m.useMemo(()=>mn?`?projectPath=${encodeURIComponent(mn)}`:"",[mn]),{pinnedKeys:nr,pinnedKeySet:ao,listOrder:ei,togglePin:$n,pinItem:Ls,reorder:dl}=Ree(mn),lo=m.useRef(null),fs=m.useRef(null),Ke=typeof window>"u"?"/":N9(window.location.pathname)??"/",Lt=m.useRef(null),Ft=m.useRef(!1),qn=m.useCallback((F,ce)=>{ce.button!==0&&ce.pointerType==="mouse"||(ce.preventDefault(),O_(),Lt.current={kind:"live",variantId:F,startX:ce.clientX,startY:ce.clientY,committed:!1})},[]),hs=m.useCallback((F,ce)=>{ce.button!==0&&ce.pointerType==="mouse"||(ce.preventDefault(),O_(),Lt.current={kind:"past",entry:F,startX:ce.clientX,startY:ce.clientY,committed:!1})},[]);m.useEffect(()=>{const F=fe=>{const ye=Lt.current;if(!ye)return;const we=fe.clientX-ye.startX,Ye=fe.clientY-ye.startY;if(!ye.committed){if(we*we+Ye*Ye<UP*UP)return;if(O_(),ye.kind==="live"){const Le=Ge.find(En=>En.workItemId===ye.variantId);if(!Le||Le.status!=="succeeded"){Lt.current=null;return}const In=HP({sessionId:Me,variant:Le,projectContext:pn,routePath:Ke});P({sessionId:Me??"",variantId:Le.workItemId,label:Le.label||"Direction",url:In,source:"live",runLabel:Le.runLabel,description:Le.description})}else{const{entry:Le}=ye,In=bu(Le),En=In?FP({sessionId:Le.sessionId,variantId:Le.variantId,routePath:Ke}):`/api/variants/history/${encodeURIComponent(Le.sessionId)}/${encodeURIComponent(Le.variantId)}/preview${wr}`;if(P({sessionId:Le.sessionId,variantId:Le.variantId,label:Le.label||"Direction",url:En,source:In?"history-dev-server":"history-static",runLabel:Le.runLabel,description:Le.brief}),In){const xr=j_(`/api/variants/history/${encodeURIComponent(Le.sessionId)}/${encodeURIComponent(Le.variantId)}/run${wr}`,"targetAddressed","1");(async()=>{try{if(!(await fetch(xr,{method:"POST"})).ok)return;const br=j_(En,"replay",String(Date.now()));P(ft=>!ft||ft.sessionId!==Le.sessionId||ft.variantId!==Le.variantId||ft.source!=="history-dev-server"?ft:{...ft,url:br}),O(ft=>{if(!ft)return ft;const Jt=si=>!si||si.sessionId!==Le.sessionId||si.variantId!==Le.variantId?si:{...si,url:br};return{...ft,left:Jt(ft.left),right:Jt(ft.right)}})}catch(rr){zn.warn("history replay drag boot failed",rr)}})()}}ye.committed=!0}I({x:fe.clientX,y:fe.clientY})},ce=()=>{const fe=Lt.current;fe!=null&&fe.committed&&(Ft.current=!0,window.setTimeout(()=>{Ft.current=!1},0)),Lt.current=null,I(null)},Ce=fe=>{if(fe.key!=="Escape")return;const ye=Lt.current;ye!=null&&ye.committed&&(ye.kind==="past"&&bu(ye.entry)&&xd({sessionId:ye.entry.sessionId,variantId:ye.entry.variantId,source:"history-dev-server"}),Lt.current=null,P(null),I(null))};return window.addEventListener("pointermove",F),window.addEventListener("pointerup",ce),window.addEventListener("pointercancel",ce),window.addEventListener("keydown",Ce),()=>{window.removeEventListener("pointermove",F),window.removeEventListener("pointerup",ce),window.removeEventListener("pointercancel",ce),window.removeEventListener("keydown",Ce)}},[Ge,Me,pn,Ke,wr,P,I,O]);const Ut=m.useCallback(()=>{var F;(F=Lt.current)!=null&&F.committed&&(Ft.current=!0,window.setTimeout(()=>{Ft.current=!1},0)),Lt.current=null,I(null),T&&(T.source==="history-dev-server"&&xd({sessionId:T.sessionId,variantId:T.variantId,source:"history-dev-server"}),P(null))},[T,P,I]),Fn=m.useCallback((F,ce)=>{const Ce=!ao.has(F);Ie.capture(Ce?"variants_panel.direction_pinned":"variants_panel.direction_unpinned",{method:ce}),$n(F)},[ao,$n]),Wr=m.useCallback(()=>{T&&(Ie.capture("variants_panel.direction_pinned",{method:"drag"}),Ls(`row:past:${T.sessionId}:${T.variantId}`),Ut())},[T,Ut,Ls]),ti=m.useCallback(F=>{Ie.capture("variants_panel.direction_unpinned",{method:"drag"}),$n(F),Ut()},[$n,Ut]),ur=m.useCallback((F,ce)=>{dl(F,ce),Ut()},[dl,Ut]),Mn=m.useMemo(()=>{var ce;if(Ct||K)return null;const F=$?Ge.find(Ce=>Ce.workItemId===$):null;return $&&!F?null:F?ih(F)?F.workItemId:null:e.active?((ce=Ge.find(Ce=>{var fe,ye;return ih(Ce)&&(((fe=Ce.preview)==null?void 0:fe.kind)==="static_artifact"||((ye=Ce.preview)==null?void 0:ye.kind)==="dev_server")}))==null?void 0:ce.workItemId)??null:null},[$,K,Ct,e,Ge]),fl=Ct||Os&&$===null&&K===null&&Mn===null,Mc=m.useCallback(async F=>{var Ce,fe,ye,we;if(!Me)return;const ce=(F==null?void 0:F.workItemId)??null;ae({kind:"switch",variantId:ce??void 0});try{if(((Ce=F==null?void 0:F.preview)==null?void 0:Ce.kind)==="static_artifact"){if(w(!1),S(null),((fe=F.refinement)==null?void 0:fe.status)==="succeeded"){const Le=F.preview.url.includes("?")?"&":"?";_(`${F.preview.url}${Le}refinement=${encodeURIComponent(F.refinement.workItemId)}`)}else _(F.preview.url);return}if(ce&&Me&&e.active&&e.projectContext.kind==="fresh"&&((ye=e.projectContext.executionPlan)==null?void 0:ye.mode)!=="vite_app"&&((we=F==null?void 0:F.preview)==null?void 0:we.kind)!=="dev_server"){w(!1),S(null),_(`/api/variants/${Me}/static/${ce}`);return}const Ye=F&&ce?HP({sessionId:Me,variant:F,projectContext:e.active?e.projectContext:null,routePath:Ke}):null;if(Ye){w(!1),S(null),_(Ye);return}Ie.capture("variants_panel.preview_display_failed",{sessionId:Me,variantId:ce,previewKind:F?D_(F):"none",hasPreview:!!(F!=null&&F.preview),hasPort:typeof(F==null?void 0:F.port)=="number",errorMessage:"No addressable dev-server preview URL"}),w(!1),S(null)}catch(Ye){zn.warn("preview display failed",Ye),Ie.capture("variants_panel.preview_display_failed",{sessionId:Me,variantId:ce,previewKind:F?D_(F):"none",hasPreview:!!(F!=null&&F.preview),hasPort:typeof(F==null?void 0:F.port)=="number",errorMessage:Ye instanceof Error?Ye.message:String(Ye)}),w(!1),S(null)}finally{ae(null)}},[Me,e,Ke,_,w,S]),hl=m.useRef(0),ta=m.useCallback(()=>{hl.current++,k(!1),E(!1)},[k,E]),Ei=m.useCallback(async F=>{if(Me){ae({kind:"switch",variantId:F.workItemId});try{const ce=await fetch(`/api/variants/${Me}/preview-port`,{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({variantId:F.workItemId})});if(!ce.ok){const Ce=await Di(ce);throw new Error(Ce.message??`Preview restoration failed (${ce.status})`)}}catch(ce){zn.warn("preview restoration failed",ce),Ie.capture("variants_panel.preview_display_failed",{sessionId:Me,variantId:F.workItemId,previewKind:"dev_server",hasPreview:!1,hasPort:!1,errorMessage:ce instanceof Error?ce.message:String(ce)})}finally{ae(null)}}},[Me]),pl=m.useCallback(F=>{var we,Ye,Le,In,En;if(Ft.current){Ft.current=!1;return}const ce=ih(F),Ce=F.status==="pending"||F.status==="running"||ote(F);ta();const fe=D_(F),ye=Ge.find(xr=>xr.workItemId===$);Ie.capture("variants_panel.preview_requested",{sessionId:Me,fromVariantId:ye==null?void 0:ye.workItemId,toVariantId:F.workItemId,variantStatus:F.status,isPreviewReady:ce,isArmed:Ce,previewKind:fe,hasPreview:!!F.preview,hasPort:typeof F.port=="number",viewEnabled:((Ye=(we=F.actions)==null?void 0:we.view)==null?void 0:Ye.enabled)??null,previewUnavailableReason:((Le=F.previewUnavailable)==null?void 0:Le.reason)??null}),V(F.workItemId),B(null),ce?(fs.current=F.workItemId,qe(!1),D(!0),Mc(F)):(fs.current=null,qe(!1),_(null),w(!1),Ce&&Ie.capture("variants_panel.preview_armed",{sessionId:Me,fromVariantId:ye==null?void 0:ye.workItemId,toVariantId:F.workItemId,variantStatus:F.status,previewKind:fe,hasPreview:!!F.preview,hasPort:typeof F.port=="number",viewEnabled:((En=(In=F.actions)==null?void 0:In.view)==null?void 0:En.enabled)??null}),H9(F)&&Ei(F)),Ie.capture("variants_panel.preview_switched",{sessionId:Me,fromVariantId:ye==null?void 0:ye.workItemId,toVariantId:F.workItemId,armed:Ce})},[$,Me,D,V,B,ta,Ei,Mc,Ge,_,w]),Fd=e.active?`${e.sessionId}:${e.stage}`:"inactive",Vd=m.useRef(!1);m.useEffect(()=>{if(o)return;let F=!1;return(async()=>{try{const ce=await fetch(`/api/variants/history${wr}`,{credentials:"same-origin"});if(!ce.ok)return;const Ce=await ce.json();if(F)return;const fe=(Ce.variants??[]).filter(ye=>{var we,Ye;return((we=ye.preview)==null?void 0:we.kind)==="static"||((Ye=ye.serve)==null?void 0:Ye.kind)==="static"||bu(ye)});if(!Vd.current&&!Et.current&&Fd==="inactive"&&fe.length>0&&fe.every(ye=>ye.projectKind==="fresh")){const ye=[...fe].sort((we,Ye)=>new Date(Ye.createdAt).getTime()-new Date(we.createdAt).getTime()).find(we=>!bu(we));ye&&(Vd.current=!0,B({sessionId:ye.sessionId,variantId:ye.variantId,previewKind:"static",references:ye.references,projectPath:mn??void 0}),qe(!1),_(`/api/variants/history/${encodeURIComponent(ye.sessionId)}/${encodeURIComponent(ye.variantId)}/preview${wr}`))}if(B(ye=>{if(!ye)return ye;const we=fe.find(Ye=>Ye.sessionId===ye.sessionId&&Ye.variantId===ye.variantId);return!we||JSON.stringify(ye.references)===JSON.stringify(we.references)?ye:{...ye,references:we.references}}),lte(Xt.current,fe))return;Xt.current=fe,xt(fe)}catch(ce){zn.warn("Failed to load past variants",ce)}})(),()=>{F=!0}},[o,mn,Fd,wr,_,B]);const Ic=m.useCallback(()=>{k(!1),E(!1),B(null),V(null),qe(!0),w(!1),S(null),_(null),x(F=>F+1)},[V,k,E,x,_,S,B,w]),na=m.useCallback(F=>{if(Ft.current){Ft.current=!1;return}if(D(!0),B({sessionId:F.sessionId,variantId:F.variantId,previewKind:bu(F)?"dev_server":"static",references:F.references,projectPath:mn??void 0}),V(null),qe(!1),bu(F)){const ce=++hl.current;k(!0),E(!0),(async()=>{ae({kind:"switch"}),Ie.capture("variants_panel.history_replay_started",{sessionId:F.sessionId,variantId:F.variantId});const Ce=fe=>Ie.capture("variants_panel.history_replay_failed",{sessionId:F.sessionId,variantId:F.variantId,...fe});try{const fe=await fetch(j_(`/api/variants/history/${encodeURIComponent(F.sessionId)}/${encodeURIComponent(F.variantId)}/run${wr}`,"targetAddressed","1"),{method:"POST"});if(ce!==hl.current)return;if(!fe.ok){const{errorCode:we}=await Di(fe);zn.warn(`history replay failed: HTTP ${fe.status} ${we??""}`),Ce({httpStatus:fe.status,errorCode:we}),Ic();return}const ye=await fe.json();if(ce!==hl.current)return;E(!1),w(!1),S(null),_(FP({sessionId:F.sessionId,variantId:F.variantId,routePath:Ke})),ye.alreadyRunning||x(we=>we+1),Ie.capture("variants_panel.history_replay_ready",{sessionId:F.sessionId,variantId:F.variantId})}catch(fe){if(ce!==hl.current)return;zn.warn("history replay failed",fe),Ce({errorMessage:fe instanceof Error?fe.message:String(fe)}),Ic()}finally{ae(null)}})();return}ta(),w(!1),S(null),_(`/api/variants/history/${encodeURIComponent(F.sessionId)}/${encodeURIComponent(F.variantId)}/preview${wr}`)},[mn,Ke,Ic,ae,k,E,x,B,V,_,S,D,w,ta,wr]);m.useEffect(()=>{if(!ke||rt.current)return;const F=jt.find(ce=>ce.sessionId===ke.sessionId&&ce.variantId===ke.variantId);F&&(rt.current=!0,na(F))},[ke,jt,na]);const Oc=m.useCallback(async()=>{ta();const F=()=>{D(!0),V(null),B(null),qe(!0),fs.current=null,w(!1),S(null),_(null)};if(!Me){F();return}ae({kind:"switch"});try{const ce=await fetch(`/api/variants/${Me}/preview-port`,{method:"POST",headers:{"content-type":"application/json"},body:JSON.stringify({variantId:null})});if(!ce.ok){zn.warn(`switch to original failed: HTTP ${ce.status}`);return}F(),w(!0),Ie.capture("variants_panel.preview_switched",{sessionId:Me,fromVariantId:$,toVariantId:null,target:"original",armed:!1})}catch(ce){zn.warn("preview-port original switch failed",ce)}finally{ae(null)}},[$,Me,V,B,_,S,D,w,ta]),hp=m.useCallback(async F=>{var Ce,fe;const ce=((fe=(Ce=F.actions)==null?void 0:Ce.commit)==null?void 0:fe.enabled)??F.status==="succeeded";if(!(!Me||!ce)){Ie.capture("variants_panel.commit_clicked",{sessionId:Me,variantId:F.workItemId,variantLabel:F.label}),ae({kind:"commit",variantId:F.workItemId});try{const ye=await fetch(`/api/variants/${Me}/commit`,{method:"POST",headers:{"content-type":"application/json"},body:JSON.stringify({variantId:F.workItemId})});if(!ye.ok){const{message:Ye,errorCode:Le}=await Di(ye);zn.warn(`commit failed: HTTP ${ye.status} ${Le??""} ${Ye??""}`),Ie.capture("variants_panel.commit_failed",{sessionId:Me,variantId:F.workItemId,httpStatus:ye.status,errorCode:Le??null,errorMessage:Ye??null}),Mt.error("Couldn't send direction",{description:Ye??`The server rejected the request (HTTP ${ye.status}). Try again, or pick a different direction.`});return}const we=await ye.json().catch(()=>null);Ie.capture("variants_panel.commit_succeeded",{sessionId:Me,variantId:F.workItemId,payloadKind:(we==null?void 0:we.payloadKind)??null,duplicate:(we==null?void 0:we.duplicate)??!1}),Mt.success(`Sent "${F.label}" to your project`,{description:(we==null?void 0:we.payloadKind)==="project-created"?`Project created at ${(we==null?void 0:we.destinationPath)??"destination"}.`:"Direction diff applied to your working tree (uncommitted)."}),(we==null?void 0:we.payloadKind)!=="project-created"&&(_(null),w(!1),x(Ye=>Ye+1))}catch(ye){zn.warn("commit failed",ye),Ie.capture("variants_panel.commit_failed",{sessionId:Me,variantId:F.workItemId,httpStatus:null,errorCode:"NETWORK_ERROR",errorMessage:ye instanceof Error?ye.message:String(ye)}),Mt.error("Couldn't send direction",{description:"Network or server error. Check that the Rivet backend is reachable and try again."})}finally{ae(null)}}},[Me,x,_,w]),Lc=m.useCallback(async(F,ce,Ce)=>{Ie.capture("variants_panel.deploy_clicked",{sessionId:F,variantId:ce,variantLabel:Ce});try{const fe=await fetch(`/api/variants/${F}/deploy`,{method:"POST",headers:{"content-type":"application/json"},body:JSON.stringify({variantId:ce,...i?{projectPath:i}:{}})});if(!fe.ok){const{message:Ye,errorCode:Le}=await Di(fe);return zn.warn(`deploy failed: HTTP ${fe.status} ${Le??""} ${Ye??""}`),Ie.capture("variants_panel.deploy_failed",{sessionId:F,variantId:ce,httpStatus:fe.status,errorCode:Le??null,errorMessage:Ye??null}),Mt.error("Couldn't deploy this direction",{description:Ye??`The server rejected the request (HTTP ${fe.status}). Try again.`}),null}const ye=await fe.json().catch(()=>null),we=ye==null?void 0:ye.shareUrl;return we?(await navigator.clipboard.writeText(we).catch(()=>{}),Ie.capture("variants_panel.deploy_succeeded",{sessionId:F,variantId:ce}),Mt.success(`"${Ce}" is live — link copied`,{action:{label:"Open",onClick:()=>window.open(we,"_blank","noopener")}}),we):(Mt.error("Couldn't deploy this direction",{description:"The deploy host returned an unexpected response."}),null)}catch(fe){return zn.warn("deploy failed",fe),Ie.capture("variants_panel.deploy_failed",{sessionId:F,variantId:ce,httpStatus:null,errorCode:"NETWORK_ERROR",errorMessage:fe instanceof Error?fe.message:String(fe)}),Mt.error("Couldn't deploy this direction",{description:"Network or server error. Check that the Rivet backend is reachable and try again."}),null}},[i]),Ev=m.useCallback(async F=>{if(!Me)return;const ce=ue[F.workItemId];if(ce){await navigator.clipboard.writeText(ce).catch(()=>{}),Mt.success("Share link copied",{action:{label:"Open",onClick:()=>window.open(ce,"_blank","noopener")}});return}ae({kind:"deploy",variantId:F.workItemId});try{const Ce=await Lc(Me,F.workItemId,F.label);Ce&&re(fe=>({...fe,[F.workItemId]:Ce}))}finally{ae(null)}},[Me,ue,Lc]),gn=m.useCallback(async()=>{if(!(!Me||yt.length===0)){if(Cn){await navigator.clipboard.writeText(Cn).catch(()=>{}),Mt.success("Canvas link copied",{action:{label:"Open",onClick:()=>window.open(Cn,"_blank","noopener")}});return}Ie.capture("variants_panel.deploy_clicked",{sessionId:Me,variantId:"canvas",variantLabel:"Canvas",variantCount:yt.length}),ae({kind:"deploy-canvas"});try{const F=await fetch(`/api/variants/${Me}/canvas/deploy`,{method:"POST",headers:{"content-type":"application/json"},body:JSON.stringify({variantIds:yt.map(we=>we.workItemId),...i?{projectPath:i}:{}})});if(!F.ok){const{message:we,errorCode:Ye}=await Di(F);zn.warn(`canvas deploy failed: HTTP ${F.status} ${Ye??""} ${we??""}`),Ie.capture("variants_panel.deploy_failed",{sessionId:Me,variantId:"canvas",httpStatus:F.status,errorCode:Ye??null,errorMessage:we??null,variantCount:yt.length}),Mt.error("Couldn't share this canvas",{description:we??`The server rejected the request (HTTP ${F.status}). Try again.`});return}const ce=await F.json().catch(()=>null),Ce=ce==null?void 0:ce.shareUrl;if(!Ce){Mt.error("Couldn't share this canvas",{description:"The deploy host returned an unexpected response."});return}const fe=Object.fromEntries(((ce==null?void 0:ce.variants)??[]).filter(we=>typeof we.variantId=="string"&&typeof we.shareUrl=="string").map(we=>[we.variantId,we.shareUrl])),ye=Object.keys(fe).length>0?{...ue,...fe}:ue;ye!==ue&&re(ye),await navigator.clipboard.writeText(Ce).catch(()=>{}),$e({key:WP(yt,ye),shareUrl:Ce}),Ie.capture("variants_panel.deploy_succeeded",{sessionId:Me,variantId:"canvas",variantCount:yt.length}),Mt.success("Canvas is live — link copied",{action:{label:"Open",onClick:()=>window.open(Ce,"_blank","noopener")}})}catch(F){zn.warn("canvas deploy failed",F),Ie.capture("variants_panel.deploy_failed",{sessionId:Me,variantId:"canvas",httpStatus:null,errorCode:"NETWORK_ERROR",errorMessage:F instanceof Error?F.message:String(F),variantCount:yt.length}),Mt.error("Couldn't share this canvas",{description:"Network or server error. Check that the Rivet backend is reachable and try again."})}finally{ae(null)}}},[Cn,yt,ue,i,Me]),Pv=m.useCallback(async F=>{const ce=`${F.sessionId}:${F.variantId}`,Ce=Ee[ce];if(Ce){await navigator.clipboard.writeText(Ce).catch(()=>{}),Mt.success("Share link copied",{action:{label:"Open",onClick:()=>window.open(Ce,"_blank","noopener")}});return}rn(ce);try{const fe=await Lc(F.sessionId,F.variantId,F.label);fe&&dt(ye=>({...ye,[ce]:fe}))}finally{rn(null)}},[Ee,Lc]),ml=m.useCallback(async F=>{if(Me){Ie.capture("variants_panel.remove_clicked",{sessionId:Me,variantId:F.workItemId,variantLabelLength:F.label.length}),ae({kind:"remove",variantId:F.workItemId});try{const ce=await fetch(`/api/variants/${Me}/${F.workItemId}/remove`,{method:"POST",headers:{"content-type":"application/json"},body:"{}"});if(!ce.ok){const{message:Ce}=await Di(ce);zn.warn(`remove failed: HTTP ${ce.status} ${Ce??""}`),Mt.error("Couldn't remove direction",{description:Ce??`The server rejected the request (HTTP ${ce.status}). Try again.`});return}(F.workItemId===Mn||F.workItemId===$)&&(V(null),_(null),w(!1),x(Ce=>Ce+1))}catch(ce){zn.warn("remove failed",ce),Mt.error("Couldn't remove direction",{description:"Network or server error. Try again."})}finally{ae(null)}}},[Me,$,Mn,V,_,w,x]),Nc=m.useCallback(async F=>{if(!mn){Mt.error("Couldn't remove direction",{description:"No project path available."});return}Ie.capture("variants_panel.remove_past_clicked",{sessionId:F.sessionId,variantId:F.variantId});const ce=`${F.sessionId}:${F.variantId}`,Ce=fe=>fe.sessionId===F.sessionId&&fe.variantId===F.variantId;ae({kind:"remove",variantId:ce}),xt(fe=>fe.filter(ye=>!Ce(ye))),K===ce&&(B(null),_(null),w(!1),x(fe=>fe+1));try{const fe=await fetch(`/api/variants/history/${encodeURIComponent(F.sessionId)}/${encodeURIComponent(F.variantId)}/remove`,{method:"POST",headers:{"content-type":"application/json"},body:JSON.stringify({projectPath:mn})});if(!fe.ok){const{message:ye}=await Di(fe);xt(we=>we.some(Ce)?we:[...we,F]),Mt.error("Couldn't remove direction",{description:ye??`The server rejected the request (HTTP ${fe.status}). Try again.`})}}catch(fe){zn.warn("remove past failed",fe),xt(ye=>ye.some(Ce)?ye:[...ye,F]),Mt.error("Couldn't remove direction",{description:"Network or server error. Try again."})}finally{ae(null)}},[mn,K,B,_,w,x]),gl=m.useCallback(F=>{ie(F)},[]),Av=m.useCallback(F=>{if(!F.label||!F.run)return;const ce=F.rows.flatMap(fe=>fe.kind==="active"?[fe.variant]:[]),Ce=F.rows.flatMap(fe=>fe.kind==="past"?[fe.entry]:[]);ce.length===0&&Ce.length===0||ie({kind:"run",label:F.label,variants:ce,entries:Ce})},[]),pp=m.useCallback(async()=>{if(!(!se||de)){ge(!0);try{if(se.kind==="active")await ml(se.variant);else if(se.kind==="past")await Nc(se.entry);else{for(const F of se.variants)await ml(F);for(const F of se.entries)await Nc(F)}}finally{ge(!1),ie(null)}}},[se,de,ml,Nc]),[vl,Ns]=m.useState(null),[Tv,Or]=m.useState(null),Rv=m.useCallback(F=>{Or(F)},[]),Mv=m.useCallback(()=>{Or(null)},[]),Iv=m.useCallback(async F=>{const ce=F.trim();if(ce)try{await navigator.clipboard.writeText(ce),Mt.success("Copied")}catch{Mt.error("Couldn't copy")}},[]),Dc=m.useCallback(async(F,ce)=>{Or(null);const Ce=ce.trim();if(!Ce||F.kind==="original")return;if(F.kind==="active"){if(!Me||Ce===F.variant.label)return;Ie.capture("variants_panel.rename",{sessionId:Me,variantId:F.variant.workItemId,labelLength:Ce.length,past:!1});try{const we=await fetch(`/api/variants/${Me}/${F.variant.workItemId}/rename`,{method:"POST",headers:{"content-type":"application/json"},body:JSON.stringify({label:Ce})});if(!we.ok){const{message:Ye}=await Di(we);Mt.error("Couldn't rename direction",{description:Ye??`The server rejected the request (HTTP ${we.status}). Try again.`})}}catch(we){zn.warn("rename failed",we),Mt.error("Couldn't rename direction",{description:"Network or server error. Try again."})}return}const{entry:fe}=F;if(Ce===fe.label.trim())return;if(!mn){Mt.error("Couldn't rename direction",{description:"No project path available."});return}Ie.capture("variants_panel.rename",{sessionId:fe.sessionId,variantId:fe.variantId,labelLength:Ce.length,past:!0});const ye=we=>we.sessionId===fe.sessionId&&we.variantId===fe.variantId;xt(we=>we.map(Ye=>ye(Ye)?{...Ye,label:Ce}:Ye));try{const we=await fetch(`/api/variants/history/${encodeURIComponent(fe.sessionId)}/${encodeURIComponent(fe.variantId)}/rename`,{method:"POST",headers:{"content-type":"application/json"},body:JSON.stringify({label:Ce,projectPath:mn})});if(!we.ok){const{message:Ye}=await Di(we);xt(Le=>Le.map(In=>ye(In)?{...In,label:fe.label}:In)),Mt.error("Couldn't rename direction",{description:Ye??`The server rejected the request (HTTP ${we.status}). Try again.`})}}catch(we){zn.warn("rename failed",we),xt(Ye=>Ye.map(Le=>ye(Le)?{...Le,label:fe.label}:Le)),Mt.error("Couldn't rename direction",{description:"Network or server error. Try again."})}},[Me,mn]),[jc,co]=m.useState(null),$c=m.useCallback(F=>{co(F)},[]),Ov=m.useCallback(()=>{co(null)},[]),Lv=m.useCallback(async(F,ce)=>{if(co(null),!F.label||!F.run)return;const Ce=F.label,fe=ce.trim();if(!fe||fe===Ce)return;Ie.capture("variants_panel.rename_run",{runLabelLength:fe.length});const ye="requestId"in F.run?F.run.requestId:void 0,we=ye?F.key:F9({sessionId:F.run.sessionId,runLabel:fe}),Ye=we!==F.key;let Le=!1,In=!1;if(i!==null&&Ye){const ft=z0(i);Le=ft.has(F.key),In=ft.has(we),Le&&(ft.add(we),N_(i,ft),J())}const En=ft=>{if(i===null||!Ye)return;const Jt=z0(i);ft?Jt.delete(F.key):(Le?Jt.add(F.key):Jt.delete(F.key),In?Jt.add(we):Jt.delete(we)),N_(i,Jt),J()},xr=new Set(F.rows.flatMap(ft=>ft.kind==="past"?[`${ft.entry.sessionId}:${ft.entry.variantId}`]:[])),rr=ft=>xr.has(`${ft.sessionId}:${ft.variantId}`);xt(ft=>ft.map(Jt=>rr(Jt)?{...Jt,runLabel:fe}:Jt));const br=()=>xt(ft=>ft.map(Jt=>rr(Jt)?{...Jt,runLabel:Ce}:Jt));try{const ft=await fetch("/api/variants/runs/rename",{method:"POST",headers:{"content-type":"application/json"},body:JSON.stringify({sessionId:F.run.sessionId,...ye?{requestId:ye}:{},runLabel:Ce,label:fe,...mn?{projectPath:mn}:{}})});if(ft.ok)En(!0);else{const{message:Jt}=await Di(ft);br(),En(!1),Mt.error("Couldn't rename run",{description:Jt??`The server rejected the request (HTTP ${ft.status}). Try again.`})}}catch(ft){zn.warn("run rename failed",ft),br(),En(!1),Mt.error("Couldn't rename run",{description:"Network or server error. Try again."})}},[mn,i,xt]);m.useEffect(()=>{const F=n&&!r.current;if(r.current=n,lo.current!==Me){const Ce=lo.current===null;lo.current=Me;const fe=t.get(vm);if(F&&ke&&(fe==null?void 0:fe.sessionId)===ke.sessionId&&(fe==null?void 0:fe.variantId)===ke.variantId||(fs.current=null,$e(null),_(null),w(!1),S(null),D(),V(null),B(null),qe(!1),Vd.current=!1,!Ce))return}if(K||Ct||!Mn||e.active!==!0||fs.current===Mn)return;const ce=Ge.find(Ce=>Ce.workItemId===Mn);ce&&(fs.current=Mn,D(),Mc(ce))},[Me,n,ke,t,K,Ct,Mn,e,Ge,Mc,D,V,B,_,S,w]),m.useEffect(()=>{!q||!tr||(fs.current=null,B(null),V(tr.workItemId),qe(!1))},[tr,q,Me,V,B]),m.useEffect(()=>{!q||tr||ul||B(null)},[tr,q,ul,Me,B,jn]),m.useEffect(()=>{const F=z.trim().toLowerCase(),ce=[...Ge.map(Le=>({kind:"active",variant:Le})),...jn.map(Le=>({kind:"past",entry:Le})),...Os?[{kind:"original"}]:[]],Ce=F?ce.filter(Le=>qP(Le,F)):ce,{pinned:fe,unpinned:ye}=GP(YP(ZP(Ce,Me),ei),nr,Me),we=[...H.has(nx)?[]:fe,...ye.flatMap(Le=>Le.key!==""&&H.has(Le.key)?[]:Le.rows)];if(we.length===0)return;const Ye=Le=>{if(_ee())return;if(Le.key==="Enter"){const Jt=Ge.find(si=>si.workItemId===vl);Jt&&(Le.preventDefault(),pl(Jt));return}if(Le.key!=="ArrowUp"&&Le.key!=="ArrowDown")return;Le.preventDefault();const In=$??Mn;let En=In?`live:${In}`:null;K?En=`past:${K}`:fl&&(En=D9);const xr=En?we.findIndex(Jt=>bd(Jt)===En):-1;let rr;if(xr===-1?rr=Le.key==="ArrowDown"?0:we.length-1:Le.key==="ArrowDown"?rr=Math.min(xr+1,we.length-1):rr=Math.max(xr-1,0),rr===xr)return;const br=we[rr];br.kind==="active"?pl(br.variant):br.kind==="past"?na(br.entry):Oc();const ft=document.querySelector(`[data-variant-key="${bd(br)}"]`);ft instanceof HTMLElement&&ft.focus({preventScroll:!0})};return window.addEventListener("keydown",Ye),()=>window.removeEventListener("keydown",Ye)},[Ge,jn,z,Os,H,nr,ei,Me,$,K,fl,Mn,vl,pl,na,Oc]);const yl=Ge.find(F=>F.workItemId===Mn)??null,Fc=K?jn.find(F=>`${F.sessionId}:${F.variantId}`===K)??null:null,Vc=!!Fc,_l=e.active?e.artifacts??[]:[],Pi=[...(e.active?Ge:[]).map(F=>({kind:"active",variant:F})),...jn.map(F=>({kind:"past",entry:F})),...Os?[{kind:"original"}]:[]],Nt=z.trim().toLowerCase(),Hc=Nt?Pi.filter(F=>qP(F,Nt)):Pi,mp=YP(ZP(Hc,Me),ei),{pinned:Hd,unpinned:gp}=GP(mp,nr,Me);let zd=null;T&&(zd=T.source==="live"?`live:${T.variantId}`:`past:${T.sessionId}:${T.variantId}`);const vp=new Set(Ge.map(F=>F.requestId).filter(Boolean)),zc=s.filter(F=>!vp.has(F.requestId)),uo=zc.length>0,Ds=o&&!uo&&Pi.length===0;return b.jsxs("div",{className:"flex h-full min-h-0 flex-col",children:[Pi.length>0?b.jsx("div",{className:"pt-2 pr-5 pb-1 pl-3",children:b.jsxs("div",{className:"relative",children:[b.jsx(ZK,{size:13,className:"text-content-muted pointer-events-none absolute top-1/2 left-2 -translate-y-1/2"}),b.jsx("input",{type:"text",value:z,onChange:F=>X(F.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,b.jsxs("div",{className:"flex-1 [scrollbar-gutter:stable] overflow-y-auto px-3 py-2",children:[uo?b.jsx(Cte,{groups:zc}):null,Ds?b.jsx(Ete,{}):null,e.active&&Pi.length===0&&!uo&&!Ds?b.jsx(Pte,{}):null,!e.active&&!uo&&!Ds&&jn.length===0&&!Os?b.jsx(Ate,{isMCPSession:g,mcpEditor:v}):null,Pi.length>0&&Hc.length===0?b.jsxs("p",{className:"text-content-muted px-1 py-6 text-center text-xs",children:["No directions match “",z.trim(),"”."]}):null,Hc.length>0?b.jsx(mte,{groups:gp,pinned:Hd,pinnedKeys:ao,draggedRowKey:zd,onDropPin:Wr,onDropUnpin:ti,onTogglePin:Fn,onReorder:ur,collapsedRuns:H,onToggleRun:N,activeVariantId:$??Mn,activePastKey:K,isOriginalSelected:fl,busy:Y,editingKey:Tv,onSelectActive:pl,onSelectPast:na,onSelectOriginal:Oc,onActivePointerDown:qn,onPastPointerDown:hs,onHover:Ns,onRemove:F=>gl({kind:"active",variant:F}),onRemovePast:F=>gl({kind:"past",entry:F}),onStartRename:Rv,onCommitRename:Dc,onCancelRename:Mv,editingRunKey:jc,onStartRunRename:$c,onCommitRunRename:Lv,onCancelRunRename:Ov,onRemoveRun:Av,onCopyVariantContext:Iv,activeSessionId:e.active?e.sessionId:null,projectPath:mn}):null,e.active&&h?b.jsx(xte,{artifacts:_l}):null]}),Vc&&Fc?b.jsx(yte,{entry:Fc,deploying:Tt===K,deployedUrl:K?Ee[K]??null:null,onDeploy:Pv,isDeployDisabled:!u}):null,!Vc&&e.active?b.jsx(kte,{selectedVariant:yl,busy:Y,onSend:hp,onDeploy:Ev,onDeployCanvas:gn,canDeploy:u&&(pn==null?void 0:pn.kind)==="fresh",canDeployCanvas:u&&d&&(pn==null?void 0:pn.kind)==="fresh",canSendToAgent:f,canvasVariantCount:yt.length,canvasDeployedUrl:Cn,deployedUrl:yl?ue[yl.workItemId]??null:null}):null,b.jsx(dte,{target:se,isConfirming:de,onCancel:()=>ie(null),onConfirm:pp})]})},ute=t=>t.kind==="active"?t.variant.label.trim()||"this direction":t.kind==="run"?t.label.trim()||"this run":t.entry.label.trim()||"this direction",dte=({target:t,isConfirming:e,onCancel:n,onConfirm:r})=>{if(!t)return null;const s=ute(t),i=t.kind==="run",o=i?t.variants.length+t.entries.length:0,l=i?"Remove run":"Remove direction";return b.jsx(lv,{open:!0,onOpenChange:u=>{!u&&!e&&n()},children:b.jsxs(cv,{children:[b.jsx(uv,{className:"z-max fixed inset-0 bg-black/40"}),b.jsx(dv,{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:b.jsxs("div",{className:"flex flex-col gap-3 p-4",children:[b.jsx(fv,{className:"text-content text-base font-medium",children:i?"Remove run?":"Remove direction?"}),b.jsx(hv,{className:"text-content-subtle text-sm leading-5",children:i?`This removes all ${o} directions in “${s}”.`:`This removes “${s}” from the directions list.`}),b.jsxs("div",{className:"flex justify-end gap-2 pt-1",children:[b.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"}),b.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})]})]})})]})})},bd=t=>t.kind==="active"?`live:${t.variant.workItemId}`:t.kind==="past"?`past:${t.entry.sessionId}:${t.entry.variantId}`:D9,qP=(t,e)=>t.kind==="active"?L_(e,t.variant.label,t.variant.runLabel):t.kind==="past"?L_(e,t.entry.label,t.entry.runLabel,t.entry.brief):L_(e,_6,j9),z9=(t,e)=>t.startsWith("live:")?`row:past:${e??""}:${t.slice(5)}`:`row:${t}`,U9=(t,e)=>z9(bd(t),e),GP=(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 u=[];for(const d of l.rows){const f=U9(d,n);r.has(f)?s.set(f,d):u.push(d)}u.length>0&&i.push(u.length===l.rows.length?l:{...l,rows:u})}return{pinned:e.flatMap(l=>{const u=s.get(l);return u?[u]:[]}),unpinned:i}},KP=(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]},YP=(t,e)=>{const n=t.map(r=>{const s=e.rows[r.key];return!s||s.length===0?r:{...r,rows:KP(r.rows,s,bd)}});return KP(n,e.groups,r=>r.key)},fte=t=>t.length<=BP?t:`${t.slice(0,BP-1)}…`,hte=(t,e)=>t.kind==="active"?e?`${e}:${t.variant.workItemId}`:null:t.kind==="past"?`${t.entry.sessionId}:${t.entry.variantId}`:null,pte=t=>{var s,i;const e=[t.label.trim(),(s=t.description)==null?void 0:s.trim()].filter(o=>!!o).join(`
|
|
112
|
+
`);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}`},mte=({groups:t,pinned:e,pinnedKeys:n,draggedRowKey:r,onDropPin:s,onDropUnpin:i,onTogglePin:o,onReorder:l,collapsedRuns:u,onToggleRun:d,activeVariantId:f,activePastKey:h,isOriginalSelected:g,busy:v,editingKey:x,onSelectActive:_,onSelectPast:w,onSelectOriginal:S,onActivePointerDown:k,onPastPointerDown:E,onHover:P,onRemove:T,onRemovePast:I,onStartRename:M,onCommitRename:R,onCancelRename:O,editingRunKey:D,onStartRunRename:$,onCommitRunRename:V,onCancelRunRename:q,onRemoveRun:B,onCopyVariantContext:K,activeSessionId:z,projectPath:X})=>{const Z=m.useRef(null),{activeIndex:J,itemRects:H,sessionRef:N,handlers:Y,registerItem:ae}=g9(Z,{snapTolerancePx:5}),[se,ie]=m.useState(!1),[de,ge]=m.useState(!1),ue=u.has(nx),re=r!==null,Pe=m.useMemo(()=>{if(!r)return null;const ke=z9(r,z);if(n.has(ke))return{container:Ff,key:ke};const rt=t.find(Et=>Et.rows.some(Ge=>bd(Ge)===r));return rt?{container:I_(rt.key),key:r}:null},[r,n,t,z]),$e=(Pe==null?void 0:Pe.container)===Ff,{dropTarget:Ee,onPointerMove:dt,onPointerUp:Tt}=Mee({containerRef:Z,dragged:Pe,yieldToSelector:$e?void 0:"[data-pinned-drop-zone]",restrictToSelector:$e?"[data-pinned-drop-zone]":void 0,onReorder:l}),rn=J!==null?H[J]:null,jt=ke=>ke.kind==="active"?ke.variant.workItemId===f:ke.kind==="past"?`${ke.entry.sessionId}:${ke.entry.variantId}`===h:g,xt=(ke,rt,Et,Ge)=>{const yt=bd(ke),Dn=U9(ke,z);return b.jsx(vte,{rowKey:yt,row:ke,index:rt,isSelected:jt(ke),isEditing:x===yt,isPinned:n.has(Dn),onTogglePin:Cn=>o(Dn,Cn),reorderContainer:Et,reorderKey:Et===Ff?Dn:yt,isNested:Ge,busy:v,registerItem:ae,onSelectActive:_,onSelectPast:w,onSelectOriginal:S,onActivePointerDown:k,onPastPointerDown:E,onHover:P,onRemove:T,onRemovePast:I,onStartRename:M,onCommitRename:R,onCancelRename:O,onCopyVariantContext:K,activeSessionId:z,projectPath:X},yt)};let Xt=0;const Ct=ke=>{if(ke.key==="")return ke.rows.map(yt=>xt(yt,Xt++,I_(ke.key),!1));const rt=u.has(ke.key),Et=rt?null:ke.rows.map(yt=>xt(yt,Xt++,I_(ke.key),!0)),Ge=ke.label;return b.jsx(gte,{label:Ge??_6,collapsed:rt,onToggle:()=>d(ke.key),directionCount:ke.rows.length,isEditing:Ge!==null&&D===ke.key,onStartRename:Ge!==null?()=>$(ke.key):void 0,onCommitRename:Ge!==null?yt=>V(ke,yt):void 0,onCancelRename:q,onRemove:Ge!==null?()=>B(ke):void 0,children:Et},ke.key)},qe=e.length>0||re;return b.jsxs("div",{ref:Z,className:"relative",onMouseEnter:Y.onMouseEnter,onMouseMove:Y.onMouseMove,onMouseLeave:Y.onMouseLeave,onPointerMove:dt,onPointerUp:ke=>{var rt;if($e&&Pe){const Et=(rt=Z.current)==null?void 0:rt.querySelector("[data-pinned-drop-zone]"),Ge=Et==null?void 0:Et.getBoundingClientRect();if(!(Ge!==void 0&&ke.clientY>=Ge.top&&ke.clientY<=Ge.bottom)){i(Pe.key);return}}Tt()},children:[Pe&&Ee?b.jsx("div",{className:"bg-content-muted pointer-events-none absolute right-1 left-1 z-20 h-0.5 rounded-full",style:{top:Ee.top}}):null,b.jsx(Es,{children:rn&&b.jsx(Si.div,{className:"bg-hover pointer-events-none absolute z-0 rounded-md",initial:{opacity:0,top:rn.top,left:rn.left,width:rn.width,height:rn.height},animate:{opacity:1,top:rn.top,left:rn.left,width:rn.width,height:rn.height},exit:{opacity:0,transition:{duration:.06}},transition:{...Nh.fast,opacity:{duration:.08}}},N.current)}),b.jsxs("ul",{className:"relative flex flex-col gap-2",children:[b.jsx(Es,{initial:!1,children:qe?b.jsxs(Si.li,{initial:{height:0,opacity:0},animate:{height:"auto",opacity:1},exit:{height:0,opacity:0},transition:{duration:tx,ease:ex},"data-pinned-drop-zone":"",className:zt("overflow-hidden rounded-lg bg-white/[0.012] transition-shadow",re&&"ring-content-muted/30 ring-1",re&&se&&"ring-content-muted/70 bg-white/[0.03]"),onPointerEnter:re?()=>ie(!0):void 0,onPointerLeave:re?()=>ie(!1):void 0,onPointerUp:re?()=>{ie(!1),s()}:void 0,children:[b.jsx("div",{"data-hover-dead-zone":"",children:b.jsxs("button",{type:"button",onClick:()=>d(nx),"aria-expanded":!ue,"aria-label":`${ue?"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:[b.jsx(Ow,{size:13,weight:"fill",className:"text-content-muted shrink-0"}),b.jsx("span",{className:"text-content min-w-0 flex-1 truncate text-sm font-medium",children:"Pinned"})]})}),b.jsx(Es,{initial:!1,children:!ue&&b.jsx(Si.div,{initial:{height:0,opacity:0},animate:{height:"auto",opacity:1},exit:{height:0,opacity:0},transition:{duration:tx,ease:ex},className:"overflow-hidden",children:e.length>0?b.jsx("ul",{className:"flex flex-col gap-2",children:e.map(ke=>xt(ke,Xt++,Ff,!1))}):null},"body")})]},"pinned-section"):null}),qe&&t.length>0?b.jsxs("li",{className:zt("mt-2 overflow-hidden rounded-lg bg-white/[0.012] transition-shadow",$e&&"ring-content-muted/30 ring-1",$e&&de&&"ring-content-muted/70 bg-white/[0.03]"),onPointerEnter:$e?()=>ge(!0):void 0,onPointerLeave:$e?()=>ge(!1):void 0,onPointerUp:$e?()=>ge(!1):void 0,children:[b.jsxs("div",{"data-hover-dead-zone":"",className:"flex w-full items-center gap-2 px-3 py-2",children:[b.jsx(KK,{size:13,weight:"fill",className:"text-content-muted shrink-0"}),b.jsx("span",{className:"text-content min-w-0 flex-1 truncate text-sm font-medium",children:"Directions"})]}),b.jsx("ul",{className:"flex flex-col gap-2",children:t.map(ke=>Ct(ke))})]}):t.map(ke=>Ct(ke))]})]})},B9=({open:t,onOpenChange:e,triggerLabel:n,actions:r})=>{const{containerRef:s,onKeyDown:i}=v9({onDismiss:()=>e(!1)});return b.jsxs(f6,{open:t,onOpenChange:e,children:[b.jsx(Ac,{label:n,children:b.jsx(h6,{asChild:!0,children:b.jsx(Ji,{type:"button",variant:"ghost",size:"icon-compact","aria-label":n,onClick:o=>o.stopPropagation(),onPointerDown:o=>o.stopPropagation(),className:$9,children:b.jsx(zK,{size:15,weight:"bold"})})})}),b.jsx(p6,{children:b.jsx(m6,{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=>b.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))})})]})},gte=({label:t,collapsed:e,directionCount:n,onToggle:r,isEditing:s=!1,onStartRename:i,onCommitRename:o,onCancelRename:l,onRemove:u,children:d})=>{const f=Xs(),[h,g]=m.useState(!1),v=[...i?[{key:"rename",label:"Rename",icon:b.jsx(u3,{size:13,weight:"bold"}),onSelect:i}]:[],...u?[{key:"remove",label:"Remove",icon:b.jsx(w3,{size:13,weight:"bold"}),onSelect:u}]:[]],x=e?b.jsx(BK,{size:13,weight:"fill",className:"shrink-0 text-sky-400"}):b.jsx(UK,{size:13,weight:"fill",className:"shrink-0 text-sky-400"});return s&&o&&l?b.jsxs("li",{className:"overflow-hidden rounded-lg bg-white/[0.012]",children:[b.jsxs("div",{"data-hover-dead-zone":"",className:"bg-main-input flex w-full items-center gap-2 px-3 py-2",children:[x,b.jsx("span",{className:"min-w-0 flex-1",children:b.jsx(Z9,{initial:t,onCommit:o,onCancel:l})})]}),b.jsx(Es,{initial:!1,children:!e&&b.jsx(Si.ul,{className:"overflow-hidden",children:d},"body")})]}):b.jsxs("li",{className:"overflow-hidden rounded-lg bg-white/[0.012]",children:[b.jsxs("div",{"data-hover-dead-zone":"",className:"group relative",children:[b.jsxs("button",{type:"button",onClick:_=>{if((_.metaKey||_.ctrlKey)&&v.length>0){g(!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:[x,b.jsx("span",{className:"text-content min-w-0 flex-1 truncate text-sm font-medium",children:t})]}),v.length>0&&b.jsx("div",{className:zt("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:b.jsx(B9,{open:h,onOpenChange:g,triggerLabel:`${t} run actions`,actions:v})})]}),b.jsx(Es,{initial:!1,children:!e&&b.jsx(Si.ul,{initial:{height:0,opacity:0},animate:{height:"auto",opacity:1},exit:{height:0,opacity:0},transition:{duration:tx,ease:ex},className:"overflow-hidden",children:d},"body")})]})},vte=({rowKey:t,row:e,index:n,isSelected:r,isEditing:s,isPinned:i,onTogglePin:o,reorderContainer:l,reorderKey:u,isNested:d,busy:f,registerItem:h,onSelectActive:g,onSelectPast:v,onSelectOriginal:x,onActivePointerDown:_,onPastPointerDown:w,onHover:S,onRemove:k,onRemovePast:E,onStartRename:P,onCommitRename:T,onCancelRename:I,onCopyVariantContext:M,activeSessionId:R,projectPath:O})=>{var Pe,$e;const D=ct(R9),$=m.useRef(null);vee(h,n,$);const[V,q]=m.useState(!1),B=e.kind==="active",K=e.kind==="original",z=e.kind==="active"?e.variant:null,X=e.kind==="past"?e.entry:null,Z=z?z.status==="succeeded":!0,J=z?ih(z):!0,H=z!==null&&(z.status==="pending"||z.status==="running"),N=(z==null?void 0:z.status)==="failed",Y=(z==null?void 0:z.status)==="cancelled",ae=z!==null&&(f==null?void 0:f.kind)==="remove"&&f.variantId===z.workItemId,se=z!==null&&(((Pe=z.refinement)==null?void 0:Pe.status)==="pending"||(($e=z.refinement)==null?void 0:$e.status)==="running");let ie=_6;z?ie=z.label||`Direction ${n+1}`:X&&(ie=X.label.trim()||"Untitled direction");let de=j9;z?de=z.description:X&&(de=X.brief);const ge=de?fte(de):null,ue=hte(e,R),re=ue?"Copy variant reference":"Copy description";return s?b.jsx("li",{ref:$,"data-proximity-index":n,"data-reorder-container":l,"data-reorder-key":u,className:"group relative z-10",children:b.jsx("div",{className:zt("bg-main-input flex w-full items-start gap-2 rounded-md py-2 pr-3",d?"pl-[33px]":"pl-3"),children:b.jsxs("span",{className:"min-w-0 flex-1",children:[b.jsx(Z9,{initial:ie,onCommit:Ee=>T(e,Ee),onCancel:I}),ge&&b.jsx("span",{className:"text-content-muted mt-1 line-clamp-2 block text-xs leading-snug",children:ge})]})})}):b.jsxs("li",{ref:$,"data-proximity-index":n,"data-reorder-container":l,"data-reorder-key":u,className:zt("group relative z-10 rounded-md",r&&"bg-main-input"),onMouseEnter:z?()=>S(z.workItemId):void 0,onMouseLeave:B?()=>S(null):void 0,children:[b.jsx("div",{role:"button",tabIndex:0,"data-variant-id":z==null?void 0:z.workItemId,"data-variant-key":t,onClick:Ee=>{if(Ee.metaKey||Ee.ctrlKey){q(!0);return}const dt=window.getSelection();dt&&!dt.isCollapsed||(e.kind==="active"?g(e.variant):e.kind==="past"?v(e.entry):x())},onKeyDown:Ee=>{(Ee.key==="Enter"||Ee.key===" ")&&(Ee.preventDefault(),Ee.stopPropagation(),e.kind==="active"?g(e.variant):e.kind==="past"?v(e.entry):x())},onPointerDown:Ee=>{Ee.metaKey||Ee.ctrlKey||(e.kind==="active"?J&&_(e.variant.workItemId,Ee):e.kind==="past"&&w(e.entry,Ee))},"aria-pressed":r,"aria-disabled":B?!1:void 0,"aria-busy":H||se,className:zt("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",J&&"cursor-grab active:cursor-grabbing",!J&&"cursor-pointer"),style:J?{touchAction:"none"}:void 0,children:b.jsxs("span",{className:"min-w-0 flex-1",children:[b.jsxs("span",{className:"flex items-center gap-2 pr-12",children:[(H||se)&&b.jsx(y6,{className:"text-content-muted shrink-0 text-sm","data-testid":se&&!H?"variant-refining":void 0}),b.jsx(Ac,{label:"Double-click to rename",disabled:K,children:b.jsx("span",{onDoubleClick:Ee=>{Ee.stopPropagation(),K||P(t)},className:zt("min-w-0 flex-1 truncate text-sm font-medium select-text",K?"cursor-default":"cursor-text",Z||r?"text-content":"text-content-muted"),children:ie})}),N&&b.jsx(Ac,{label:(z==null?void 0:z.errorMessage)??(z==null?void 0:z.errorCode)??"Failed",disabled:!(z!=null&&z.errorMessage)&&!(z!=null&&z.errorCode),children:b.jsx("span",{className:"shrink-0",children:b.jsx(QP,{label:"Failed"})})}),Y&&b.jsx(QP,{label:"Cancelled"})]}),ge&&b.jsx("span",{className:"text-content-muted mt-0.5 line-clamp-2 block cursor-text text-xs leading-snug select-text",children:ge})]})}),K?null:b.jsx(YY,{references:(z==null?void 0:z.references)??(X==null?void 0:X.references),source:B?"active":"history",sessionId:(X==null?void 0:X.sessionId)??R,variantId:(X==null?void 0:X.variantId)??(z==null?void 0:z.workItemId),projectPath:O,className:d?"pl-[33px]":"pl-3"}),b.jsxs("div",{className:zt("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",V&&"pointer-events-auto opacity-100"),children:[b.jsx(Ji,{variant:"ghost",size:"icon-compact",title:i?"Unpin direction":"Pin direction","aria-label":i?"Unpin direction":"Pin direction","aria-pressed":i,onPointerDown:Ee=>Ee.stopPropagation(),onKeyDown:Ee=>{(Ee.key!=="ArrowUp"&&Ee.key!=="ArrowDown"||Ee.altKey||Ee.ctrlKey||Ee.metaKey||Ee.shiftKey)&&Ee.stopPropagation()},onClick:Ee=>{Ee.stopPropagation(),o("button")},className:$9,children:b.jsx(Ow,{weight:i?"fill":"bold"})}),b.jsx(B9,{open:V,onOpenChange:q,triggerLabel:"Direction actions",actions:[...de||ue?[{key:"copy",label:re,icon:b.jsx(Th,{size:13,weight:"bold"}),onSelect:()=>M(pte({label:ie,description:de,reference:ue,projectId:D,projectPath:O}))}]:[],{key:"pin",label:i?"Unpin":"Pin",icon:b.jsx(Ow,{size:13,weight:"bold"}),onSelect:()=>o("menu")},...K?[]:[{key:"rename",label:"Rename",icon:b.jsx(u3,{size:13,weight:"bold"}),onSelect:()=>P(t)},{key:"remove",label:"Remove",icon:b.jsx(w3,{size:13,weight:"bold"}),disabled:ae,onSelect:()=>{e.kind==="active"?k(e.variant):e.kind==="past"&&E(e.entry)}}]]})]})]})},Z9=({initial:t,onCommit:e,onCancel:n})=>{const[r,s]=m.useState(t),i=m.useRef(!1),o=m.useCallback(u=>{u&&(u.focus(),u.select())},[]),l=u=>{i.current||(i.current=!0,u?e(r):n())};return b.jsx("input",{ref:o,type:"text",value:r,maxLength:120,"aria-label":"Rename direction",onChange:u=>s(u.target.value),onKeyDown:u=>{u.stopPropagation(),u.key==="Enter"?(u.preventDefault(),l(!0)):u.key==="Escape"&&(u.preventDefault(),l(!1))},onBlur:()=>l(!0),onClick:u=>u.stopPropagation(),onPointerDown:u=>u.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"})},QP=({label:t})=>b.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}),yte=({entry:t,deploying:e,deployedUrl:n,onDeploy:r,isDeployDisabled:s=!1})=>{const o=e?"Deploying…":n?"Copy link":"Share";return b.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:[b.jsxs("div",{className:"min-w-0",children:[b.jsx("div",{className:"text-content truncate text-sm font-medium",children:t.label.trim()||"Untitled direction"}),n?b.jsx("div",{className:"text-content-muted text-[11px]",children:"Deployed — share link ready"}):null]}),b.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?b.jsx(Th,{size:12,weight:"bold"}):null,o]})]})},_te={agent_browser:"Browser extracted",cache:"Cached",static:"Bundled catalog",manual:"Manual"},wte={design_context:"DESIGN.md",source_context:"Source",qa_report:"QA",asset:"Asset"},xte=({artifacts:t})=>{const[e,n]=m.useState(null),r=m.useMemo(()=>e&&t.some(i=>i.id===e)?e:null,[t,e]);if(t.length===0)return null;const s=i=>{n(o=>o===i?null:i)};return b.jsxs("section",{"aria-label":"Directions session artifacts",className:"mt-4",children:[b.jsx("div",{className:"flex shrink-0 items-center px-3 py-2",children:b.jsx("span",{className:"text-content truncate text-sm font-medium",children:"Artifacts"})}),b.jsx("ul",{className:"mt-2 space-y-1 px-1",children:t.map(i=>b.jsx(bte,{artifact:i,isExpanded:i.id===r,onToggle:()=>s(i.id)},i.id))})]})},bte=({artifact:t,isExpanded:e,onToggle:n})=>{const r=wte[t.kind],s=t.source?_te[t.source]:null,i=[t.kind==="design_context"?null:s,t.summary].filter(Boolean).join(" · "),o=t.kind==="design_context"&&!!t.viewUrl,l=`${e?"Hide":"View"} ${r} artifact${t.label?`: ${t.label}`:""}`;return o?b.jsx("li",{className:"border-main-border rounded-md border",children:b.jsxs("div",{className:"flex w-full items-center justify-between gap-2 px-3 py-2 text-left text-xs",children:[b.jsxs("span",{className:"flex min-w-0 flex-1 flex-col",children:[b.jsxs("span",{className:"flex items-center gap-2",children:[b.jsx("span",{className:"border-content-muted/30 bg-main-input text-content-muted shrink-0 rounded-full border px-2 py-0.5 text-[9px] font-semibold tracking-wide uppercase",children:r}),b.jsx("span",{className:"text-content truncate text-xs font-medium",children:t.label})]}),i?b.jsx("span",{className:"text-content-muted mt-0.5 truncate text-[11px]",children:i}):null]}),b.jsx("a",{href:t.viewUrl,target:"_blank",rel:"noreferrer",onClick:()=>{Ie.capture("visual_editor_design_context_opened",{context_kind:"design_system",artifact_source:t.source})},"aria-label":`Open ${r} artifact${t.label?`: ${t.label}`:""}`,className:"text-content-muted hover:bg-main-input hover:text-content focus-visible:ring-content-muted/40 shrink-0 rounded p-1 transition-colors focus:outline-none focus-visible:ring-1",children:b.jsx(DK,{className:"h-3.5 w-3.5",weight:"bold"})})]})}):b.jsxs("li",{className:"border-main-border rounded-md border",children:[b.jsxs("button",{type:"button",onClick:n,"aria-expanded":e,"aria-label":l,className:"hover:bg-main-input flex w-full items-center justify-between gap-2 px-3 py-2 text-left text-xs transition-colors",children:[b.jsxs("span",{className:"flex min-w-0 flex-1 flex-col",children:[b.jsxs("span",{className:"flex items-center gap-2",children:[b.jsx("span",{className:"text-content-muted text-[10px] font-semibold tracking-wide uppercase",children:r}),b.jsx("span",{className:"text-content truncate text-xs font-medium",children:t.label})]}),i?b.jsx("span",{className:"text-content-muted mt-0.5 truncate text-[11px]",children:i}):null]}),b.jsx("span",{className:"text-content-muted shrink-0 text-[11px]",children:e?"Hide":"View"})]}),e?b.jsx("div",{className:"border-main-border bg-main-light border-t px-3 py-2",children:b.jsx(Ste,{artifact:t})}):null]})},Ste=({artifact:t})=>b.jsxs("div",{className:"text-content-muted space-y-1 text-[11px]",children:[t.summary?b.jsx("p",{children:t.summary}):null,t.path?b.jsxs("p",{children:["Stored at ",t.path]}):null,!t.summary&&!t.path?b.jsx("p",{children:"No inline content available for this artifact."}):null]}),kte=({selectedVariant:t,busy:e,onSend:n,onDeploy:r,onDeployCanvas:s,canDeploy:i,canDeployCanvas:o,canSendToAgent:l,canvasVariantCount:u,canvasDeployedUrl:d,deployedUrl:f})=>{var M,R,O,D;const h=t?((R=(M=t.actions)==null?void 0:M.commit)==null?void 0:R.enabled)??t.status==="succeeded":!1,g=h&&e===null,v=(e==null?void 0:e.kind)==="commit"&&e.variantId===(t==null?void 0:t.workItemId),x=(e==null?void 0:e.kind)==="deploy"&&e.variantId===(t==null?void 0:t.workItemId),_=(e==null?void 0:e.kind)==="deploy-canvas",w=!i||!h||e!==null,S=o&&u>0,E=x?"Deploying…":f?"Copy link":"Share",T=_?"Sharing…":d?"Copy canvas link":"Share canvas",I=v?"Applying…":"Apply to project";return b.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:[b.jsx("div",{className:"min-w-0",children:t?b.jsxs(b.Fragment,{children:[b.jsx("div",{className:"text-content truncate text-sm font-medium",children:t.label.trim()||"Untitled direction"}),f?b.jsx("div",{className:"text-content-muted text-[11px]",children:"Deployed — share link ready"}):null]}):null}),b.jsxs("div",{className:"flex shrink-0 items-center gap-2",children:[b.jsx(O9,{primaryLabel:E,primaryIcon:f&&!x?Th:void 0,primaryAction:()=>{t&&r(t)},isDisabled:w,isDropdownDisabled:e!==null,isLoading:x,loadingLabel:"Deploying…",dropdownAriaLabel:"More share actions",dropdownItems:S?[{label:T,icon:d&&!_?Th:void 0,onClick:s,isDisabled:e!==null}]:[]}),l?b.jsx("button",{type:"button",onClick:()=>{t&&n(t)},disabled:!g,title:(D=(O=t==null?void 0:t.actions)==null?void 0:O.commit)==null?void 0:D.reason,className:"bg-secondary text-secondary-foreground hover:bg-accent rounded-md px-2 py-1.5 text-xs font-medium transition-colors disabled:cursor-not-allowed disabled:opacity-50",children:I}):null]})]})},W9=()=>b.jsx("div",{"data-testid":"direction-skeleton-row","aria-hidden":"true",className:"flex w-full items-start rounded-md px-3 py-2",children:b.jsxs("span",{className:"min-w-0 flex-1",children:[b.jsxs("span",{className:"flex items-center gap-2",children:[b.jsx(y6,{className:"text-content-muted shrink-0 text-sm"}),b.jsx("span",{className:"bg-muted-foreground/15 h-3.5 w-28 animate-pulse rounded"})]}),b.jsx("span",{className:"mt-1.5 flex",children:b.jsx("span",{className:"bg-muted-foreground/10 h-2.5 w-full max-w-[14rem] animate-pulse rounded"})})]})}),Cte=({groups:t})=>b.jsx("div",{className:"space-y-0.5",children:t.flatMap(e=>Array.from({length:Math.max(1,e.count)}).map((n,r)=>b.jsx(W9,{},`${e.requestId}-${r}`)))}),Ete=()=>b.jsx("div",{"data-testid":"direction-boot-skeletons",className:"space-y-0.5",children:Array.from({length:3}).map((t,e)=>b.jsx(W9,{},e))}),Pte=()=>b.jsxs("div",{className:"flex flex-col items-center gap-2 px-4 py-8 text-center",children:[b.jsx("div",{className:"text-content text-sm",children:"No directions yet"}),b.jsx("div",{className:"text-content-muted text-xs",children:"They’ll appear here as they generate."})]}),XP="Try different ways to create a dropdown that feels fluid and dynamic",Ate=({isMCPSession:t=!1,mcpEditor:e=null})=>{const[n,r]=m.useState(!1),s=Xee(e),i=t?s:"your coding agent",o=()=>{navigator.clipboard.writeText(XP).then(()=>{r(!0),setTimeout(()=>r(!1),2e3)})};return b.jsxs("div",{className:"flex flex-col items-start gap-3 px-2 py-2",children:[b.jsx("p",{className:"text-content text-sm font-medium",children:"Create your first direction"}),b.jsxs("p",{className:"text-content-muted text-xs",children:["Use ",i," to generate directions."]}),b.jsxs("div",{className:"w-full",children:[b.jsx("p",{className:"text-content-muted mb-2 text-xs",children:"Here's a sample prompt to use:"}),b.jsxs("div",{className:"border-main-border bg-main-input relative rounded-md border px-3 py-2.5 pr-8",children:[b.jsxs("p",{className:"text-content-muted text-xs leading-snug",children:["“",XP,"”"]}),b.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?b.jsx(HK,{className:"h-3.5 w-3.5 text-emerald-500",weight:"bold"}):b.jsx(Th,{className:"h-3.5 w-3.5",weight:"bold"})})]})]})]})},Tte="rivet:show-projects",Rte=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}},Mte=({onClose:t,libraryOrigin:e})=>{const n=Xs(),r=ct(k9),s=ct(mv),i=Rte(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 u=r?b.jsx("span",{className:"text-content min-w-0 truncate text-sm font-medium",title:r,children:r}):b.jsx("span",{});if(o||e){const d=b.jsxs("ol",{className:"flex min-w-0 items-center gap-1 text-xs",children:[b.jsx("li",{className:"shrink-0",children:b.jsx("button",{type:o?"button":"submit",name:o?void 0:"view",value:o?void 0:"projects",onClick:()=>{o&&i?window.parent.postMessage(Tte,i):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"})}),b.jsx("li",{"aria-hidden":!0,className:"text-content-subtle shrink-0",children:b.jsx(FK,{className:"h-3 w-3"})}),b.jsx("li",{className:"min-w-0",children:b.jsx("span",{"aria-current":"page",title:l,className:"text-content block truncate font-medium",children:l})})]});u=b.jsx("nav",{"aria-label":"Project breadcrumb",className:"ph-no-capture min-w-0 flex-1","data-rivet-private":!0,children:o?d:b.jsx("form",{action:"/api/library/browser-launches",method:"post",children:d})})}return b.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:[u,b.jsx(Ac,{label:"Close panel",side:"bottom",children:b.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:b.jsx(WK,{className:"h-4 w-4",weight:"bold"})})})]})},el=(t,e={})=>window.location.pathname.startsWith("/rivet/library")?iM(t,e):fetch(t,e),Ite=5e3,Ote=()=>{const t=window.location.pathname.startsWith("/rivet/library");return dh({queryKey:["rivet-account"],queryFn:async({signal:e})=>{const n=await el(t?"/api/account":"/api/config",{signal:e});if(!n.ok)throw new Error("Could not load your account.");if(t)return n.json();const r=await n.json();return{isAuthenticated:r.agentModeAvailable,name:r.name,email:r.email,userId:r.userId}},refetchInterval:Ite,retry:!1})},Eg="rivet_just_signed_in",Lte=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"},$_=({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}:{}}}),JP=Is("useLogin"),Nte=2e3,Dte=60,e5="Connecting to Google...",t5="https://rivet-proxy.onrender.com",jte=`<!doctype html>
|
|
113
|
+
<html lang="en">
|
|
114
|
+
<head>
|
|
115
|
+
<meta charset="utf-8" />
|
|
116
|
+
<meta name="viewport" content="width=device-width, initial-scale=1" />
|
|
117
|
+
<title>${e5}</title>
|
|
118
|
+
<style>
|
|
119
|
+
:root { color-scheme: light dark; }
|
|
120
|
+
body {
|
|
121
|
+
margin: 0;
|
|
122
|
+
min-height: 100vh;
|
|
123
|
+
display: grid;
|
|
124
|
+
place-items: center;
|
|
125
|
+
font-family: Inter, system-ui, -apple-system, Segoe UI, sans-serif;
|
|
126
|
+
background: #111215;
|
|
127
|
+
color: #f3f4f6;
|
|
128
|
+
}
|
|
129
|
+
.panel {
|
|
130
|
+
border: 1px solid rgba(255, 255, 255, 0.16);
|
|
131
|
+
border-radius: 12px;
|
|
132
|
+
padding: 18px 22px;
|
|
133
|
+
background: rgba(255, 255, 255, 0.06);
|
|
134
|
+
font-size: 14px;
|
|
135
|
+
}
|
|
136
|
+
</style>
|
|
137
|
+
</head>
|
|
138
|
+
<body>
|
|
139
|
+
<div class="panel">${e5}</div>
|
|
140
|
+
</body>
|
|
141
|
+
</html>`,$te=Rn({success:bh(),authUrl:Qe().optional(),sessionId:Qe().optional(),pollSecret:Qe().optional(),error:Qe().optional(),message:Qe().optional()}),Fte=Rn({success:bh(),token:Qe().optional(),refreshToken:Qe().optional(),user:Rn({id:Qe().optional(),email:Qe().optional()}).optional(),error:Qe().optional(),message:Qe().optional()}),Vte="/api/auth/install-ref",Hte=Rn({installRef:Qe().nullable()}),zte=async()=>{try{const t=await fetch(Vte);if(!t.ok)return;const e=Hte.safeParse(await t.json());return e.success?e.data.installRef??void 0:void 0}catch{return}},q9=(t="editor_gate",e)=>{const n=Xs(),[r,s]=m.useState(!1),[i,o]=m.useState(null);return{startLogin:m.useCallback(async()=>{var g;const u=globalThis.crypto.randomUUID(),d=Date.now();s(!0),o(null);const f=$_({outcome:"started",authAttemptId:u,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(jte),h.document.close()}catch(S){JP.warn("Failed to render loading state in auth popup:",S)}const v=await zte(),x=await fetch(`${t5}/api/auth/google/start`,{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({source:"core",...v?{ref:v}:{}})}),_=$te.safeParse(await x.json());if(!_.success)throw new Error("Invalid Google login response");const w=_.data;if(!x.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 S=0;S<Dte;S+=1){if(h.closed)throw new Error("Sign-in window was closed before authentication completed.");const k=await fetch(`${t5}/api/auth/google/token`,{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({session:w.sessionId,pollSecret:w.pollSecret})}),E=Fte.safeParse(await k.json());if(!E.success)throw new Error("Invalid Google token response");const P=E.data;if(P.success&&P.token&&((g=P.user)!=null&&g.email)){const T={email:P.user.email,token:P.token,refreshToken:P.refreshToken,userId:P.user.id,...v?{installRef:v}:{}};if(e)await e(T);else if(!(await el("/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(Eg,"1");const I=$_({outcome:"completed",authAttemptId:u,entryPoint:t,startedAt:d,now:Date.now()});n==null||n.capture(I.event,I.properties),window.location.reload();return}if(P.error&&P.error!=="Pending")throw new Error(P.error||"Google login failed");await new Promise(T=>setTimeout(T,Nte))}throw new Error("Authentication timed out. Please try again.")}catch(v){h&&!h.closed&&h.close();const x=Br(v,"Failed to start login flow");JP.warn("Login failed:",x);const _=$_({outcome:"failed",authAttemptId:u,entryPoint:t,startedAt:d,now:Date.now(),failureReason:Lte(x)});n==null||n.capture(_.event,_.properties),o(x),s(!1)}},[n,t,e]),isStartingLogin:r,loginError:i}},Ute=Is("useIntegrations"),Bte=Rn({provider:Qe(),status:Qe(),externalUsername:Qe().nullable(),connectedAt:Qe()}),Zte=Rn({integrations:gd(Bte).optional()}),Wte=Rn({authUrl:Qe().min(1).optional(),error:Qe().optional()}),qte=Rn({error:Qe().optional()}),F_=["integrations"],Gte="rivet:connect-result",Kte=t=>typeof t=="object"&&t!==null&&t.type===Gte,Yte=ut(null),n5=async()=>{const t=await el("/api/integrations");if(!t.ok)throw new Error(`Failed to load integrations (${t.status})`);return Zte.parse(await t.json()).integrations??[]},Qte=()=>{const t=cA(),[e,n]=fM(Yte),r=dh({queryKey:F_,queryFn:n5,staleTime:1e4}),s=m.useCallback(async()=>(await t.invalidateQueries({queryKey:F_,refetchType:"none"}),t.fetchQuery({queryKey:F_,queryFn:n5})),[t]),i=m.useCallback(async l=>{const u=window.open("","_blank","width=560,height=720");if(!u)throw new Error("Popup blocked. Allow popups to connect.");n(l);try{const d=await el(`/api/integrations/${l}/connect`,{method:"POST"}),f=Wte.safeParse(await d.json().catch(()=>({}))),h=f.success?f.data:{};if(!d.ok||!h.authUrl)throw u.close(),new Error(h.error||`Could not connect ${l}`);return u.location.href=h.authUrl,await new Promise(g=>{let v=!1,x=null;const _=async(S,k=!1)=>{if(!v){v=!0,window.removeEventListener("message",w),x&&clearInterval(x);try{const P=(await s()).some(T=>T.provider===l&&T.status==="connected");g(k&&P?"connected":S)}catch{g(S)}}},w=S=>{if(Kte(S.data)&&S.data.provider===l){if(S.data.status==="error"){Ute.warn(`Connect failed for ${l}:`,S.data.message),_("failed");return}_("connected")}};window.addEventListener("message",w),x=setInterval(()=>{u.closed&&_("closed",!0)},500)})}finally{n(null)}},[s,n]),o=m.useCallback(async l=>{n(l);try{const u=await el(`/api/integrations/${l}`,{method:"DELETE"});if(!u.ok){const d=qte.safeParse(await u.json().catch(()=>({}))),f=d.success?d.data:{};throw new Error(f.error||`Could not disconnect ${l}`)}await s()}finally{n(null)}},[s,n]);return{integrations:r.data??[],isLoading:r.isPending,error:r.error instanceof Error?r.error.message:null,pendingProvider:e,connect:i,disconnect:o,refetch:s}},Fl=({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}:{}}}),cp=async(t,e="GET",n)=>{if(window.location.pathname.startsWith("/rivet/library"))return Yz(t,{method:e,body:n});const r=await el(t.replace(/^\/profile/,"/api/reference-profiles"),{method:e,headers:{"Content-Type":"application/json"},...n!==void 0?{body:JSON.stringify(n)}:{}}),s=await r.text();let i;try{i=JSON.parse(s)}catch{throw new Error(`Reference profile request failed (${r.status})`)}if(!r.ok)throw new Error(i.error??`Request failed (${r.status})`);return i},G9=()=>cp("/profile"),Xte=t=>dh({queryKey:["cosmos-profile"],queryFn:G9,enabled:t}),Jte=t=>cp("/profile/discoveries","POST",{url:t}),ene=({discoveryId:t,collectionIds:e,runtime:n})=>cp("/profile/import-plans","POST",{discoveryId:t,collectionIds:e,runtime:n}),tne=t=>cp("/profile","PATCH",{isEnabled:!0,runtime:t}),nne=t=>cp(`/profile/import-plans/${t.id}/imports`,"POST",{revision:t.revision,isApproved:!0}),rx=Qe().regex(/^[1-9]\d{0,15}$/).refine(t=>Number.isSafeInteger(Number(t))),rne=Qe().min(1).max(4096),K9=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)}`}};Qe().max(2048).transform((t,e)=>{try{return K9(t).url}catch(n){return e.addIssue({code:be.custom,message:Br(n,"Invalid Cosmos profile URL")}),Zz}});const sne=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("/")}`}},ine=Qe().url().refine(t=>{const e=new URL(t);return e.protocol==="https:"&&e.hostname==="cdn.cosmos.so"&&!e.username&&!e.password&&!e.port}),one=Rn({id:rx,title:Qe().min(1).max(500),url:Qe().url().transform(t=>sne(t).url),children:gd(rx)}),ane=Rn({id:rx,url:Qe().url(),title:Qe().max(1e3),text:Qe().max(1e5),author:Qe().nullable(),owner:Qe().nullable(),sourceUrl:Qe().url().nullable(),images:gd(Rn({url:ine,representation:Ug(["image","video-cover"])})).max(100),unsupportedReason:Qe().optional()}),lne=Rn({collection:one,elements:gd(ane),total:tM().int().nonnegative(),nextCursor:rne.nullable()});Bz("status",[lne.extend({status:bC("ok")}),Rn({status:bC("error"),message:Qe(),reason:Ug(["rate_limited","provider_unavailable","collection_unavailable"]).optional(),retryAfterMs:tM().nonnegative().optional()})]);const cne=({isOpen:t,onClose:e,onImported:n})=>{const[r,s]=m.useState(""),[i,o]=m.useState(null),[l,u]=m.useState([]),[d,f]=m.useState(""),[h,g]=m.useState(null),[v,x]=m.useState(null),[_,w]=m.useState(!1),S=m.useRef(0),k=Xs(),E=()=>{S.current+=1,s(""),o(null),u([]),f(""),g(null),x(null),w(!1)},P=()=>{k==null||k.capture("visual_editor_cosmos_modal_closed"),E(),e()},T=async O=>{O.preventDefault(),x(null);let D;try{D=K9(r.trim()).url}catch(V){x(Br(V,"Invalid Cosmos profile URL"));return}k==null||k.capture("visual_editor_cosmos_discovery_started");const $=++S.current;w(!0);try{const V=await Jte(D);if($!==S.current)return;o(V),u([]),k==null||k.capture("visual_editor_cosmos_discovery_completed",{collection_count:V.collections.length})}catch(V){if($!==S.current)return;x(Br(V,"Could not find Cosmos profile")),k==null||k.capture("visual_editor_cosmos_discovery_failed")}finally{$===S.current&&w(!1)}},I=async()=>{if(!i||l.length===0||!d)return;x(null),k==null||k.capture("visual_editor_cosmos_plan_started",{collection_count:l.length,runtime:d});const O=++S.current;w(!0);try{const D=await ene({discoveryId:i.id,collectionIds:l,runtime:d});if(O!==S.current)return;g(D),k==null||k.capture("visual_editor_cosmos_plan_completed",{collection_count:D.collectionCount,reference_count:D.referenceCount})}catch(D){if(O!==S.current)return;x(Br(D,"Could not prepare import plan")),k==null||k.capture("visual_editor_cosmos_plan_failed")}finally{O===S.current&&w(!1)}},M=async()=>{if(!h||!d)return;x(null),k==null||k.capture("visual_editor_cosmos_import_started",{collection_count:h.collectionCount,reference_count:h.referenceCount});const O=++S.current;w(!0);try{if((await G9()).profile.isEnabled||await tne(d),await nne(h),k==null||k.capture("visual_editor_cosmos_import_completed",{reference_count:h.referenceCount}),n(),O!==S.current)return;E(),e()}catch(D){if(k==null||k.capture("visual_editor_cosmos_import_failed"),O!==S.current)return;x(Br(D,"Could not start Cosmos import"))}finally{O===S.current&&w(!1)}},R=O=>{u(D=>D.includes(O)?D.filter($=>$!==O):[...D,O]),k==null||k.capture("visual_editor_cosmos_collection_toggled")};return b.jsx(lv,{open:t,onOpenChange:O=>!O&&P(),children:b.jsxs(cv,{children:[b.jsx(uv,{className:"z-max fixed inset-0 bg-black/60"}),b.jsxs(dv,{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:[b.jsxs("div",{className:"border-main-border bg-main-light flex items-center justify-between rounded-t-lg border-b px-4 py-2",children:[b.jsx(fv,{className:"text-content text-base font-medium",children:"Connect Cosmos"}),b.jsx(Ji,{onClick:P,title:"Close","aria-label":"Close",variant:"ghost",size:"icon-compact",children:b.jsx($b,{className:"h-4 w-4",weight:"bold"})})]}),b.jsxs("div",{className:"space-y-4 p-4",children:[b.jsx(hv,{className:"text-content-subtle text-sm",children:"Add public collections from a Cosmos profile to your design references."}),i?null:b.jsxs("form",{onSubmit:O=>void T(O),className:"space-y-4",children:[b.jsx("label",{className:"text-content block text-sm font-medium",htmlFor:"cosmos-profile-url",children:"Cosmos profile URL"}),b.jsx("input",{id:"cosmos-profile-url",type:"url",required:!0,autoFocus:!0,value:r,onChange:O=>s(O.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"}),b.jsx("button",{type:"submit",disabled:_,className:"bg-secondary text-secondary-foreground hover:bg-accent rounded-md px-4 py-2 text-sm font-medium disabled:opacity-50",children:_?"Finding collections…":"Continue"})]}),i&&!h?b.jsxs("div",{className:"space-y-4",children:[b.jsxs("p",{className:"text-content text-sm font-medium",children:["Choose collections from"," ",i.profile.title||i.profile.username]}),b.jsx("div",{className:"border-main-border max-h-60 divide-y overflow-y-auto rounded-md border",children:i.collections.map(O=>b.jsxs("label",{className:"text-content hover:bg-main-light flex cursor-pointer items-center gap-3 px-3 py-2 text-sm",children:[b.jsx("input",{type:"checkbox",checked:l.includes(O.id),disabled:_,onChange:()=>R(O.id)}),b.jsx("span",{className:"min-w-0 flex-1 truncate",children:O.title}),b.jsx("span",{className:"text-content-muted text-xs",children:O.total??"—"})]},O.id))}),i.collections.length===0?b.jsx("p",{className:"text-content-muted text-sm",children:"No public collections found for this profile."}):null,b.jsxs("label",{className:"text-content flex items-center justify-between gap-3 text-sm",children:["Analysis runtime",b.jsxs("select",{value:d,disabled:_,onChange:O=>{const D=O.target.value;f(D),k==null||k.capture("visual_editor_cosmos_runtime_selected",{runtime:D})},className:"border-main-border bg-main-input rounded-md border px-2 py-1.5",children:[b.jsx("option",{value:"",disabled:!0,children:"Select a runtime"}),b.jsx("option",{value:"codex",children:"Codex"}),b.jsx("option",{value:"claude",children:"Claude"}),b.jsx("option",{value:"cursor",children:"Cursor"})]})]}),b.jsx("button",{type:"button",onClick:()=>void I(),disabled:_||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:_?"Preparing plan…":"Review import plan"}),b.jsx("button",{type:"button",onClick:()=>{k==null||k.capture("visual_editor_cosmos_profile_changed"),E()},disabled:_,className:"text-content-muted hover:text-content ml-3 text-sm",children:"Use another profile"})]}):null,h?b.jsxs("div",{className:"space-y-4 text-sm",children:[b.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"]}),b.jsx("p",{className:"text-content-subtle",children:h.scopeDisclosure}),b.jsx("p",{className:"text-content-subtle",children:h.usageDisclosure}),b.jsxs("p",{className:"text-content-muted text-xs",children:[h.reusableCount," reusable · ",h.unsupportedCount," ","unsupported · runtime: ",d]}),b.jsx("button",{type:"button",onClick:()=>void M(),disabled:_,className:"bg-secondary text-secondary-foreground hover:bg-accent rounded-md px-4 py-2 text-sm font-medium disabled:opacity-50",children:_?"Starting import…":"Approve and import"}),b.jsx("button",{type:"button",onClick:()=>{k==null||k.capture("visual_editor_cosmos_plan_revised"),g(null)},disabled:_,className:"text-content-muted hover:text-content ml-3 text-sm",children:"Change selection"})]}):null,v?b.jsx("p",{role:"alert",className:"text-sm text-red-300",children:v}):null]})]})]})})},r5=Is("ConnectorsModal"),une=[{provider:"x",name:"X",iconClassName:"text-content",icon:b.jsx(rh,{provider:"x"})},{provider:"pinterest",name:"Pinterest",iconClassName:"text-[#e60023]",icon:b.jsx(rh,{provider:"pinterest"})},{provider:"arena",name:"Are.na",iconClassName:"text-content",icon:b.jsx(rh,{provider:"arena"})}],dne={name:"Cosmos",iconClassName:"text-content",icon:b.jsx(rh,{provider:"cosmos"})},s5=({meta:t,status:e,actionLabel:n,buttonLabel:r,isDisabled:s,isHighlighted:i,onAction:o})=>b.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:[b.jsx("span",{className:`grid h-7 w-7 flex-none place-items-center ${t.iconClassName}`,"aria-hidden":"true",children:t.icon}),b.jsxs("div",{className:"min-w-0 flex-1",children:[b.jsx("span",{className:"text-content block text-sm font-medium",children:t.name}),b.jsx("span",{className:"text-content-muted block truncate text-xs",children:e})]}),b.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})]}),sx=({isOpen:t,onClose:e,context:n="menu",highlightProvider:r=null})=>{var I;const{integrations:s,isLoading:i,error:o,pendingProvider:l,connect:u,disconnect:d}=Qte(),f=Xs(),[h,g]=m.useState(null),[v,x]=m.useState(!1),_=Xte(t),w=M=>s.find(R=>R.provider===M),S=m.useCallback(M=>{const R=Date.now(),O=Fl({action:"connect",outcome:"started",provider:M,entryPoint:n});f==null||f.capture(O.event,O.properties),u(M).then(D=>{const $=Date.now()-R;if(D==="connected"){const q=Fl({action:"connect",outcome:"completed",provider:M,entryPoint:n,durationMs:$});f==null||f.capture(q.event,q.properties);return}const V=Fl({action:"connect",outcome:"failed",provider:M,entryPoint:n,durationMs:$,failureReason:D==="closed"?"popup_closed":"provider_failed"});f==null||f.capture(V.event,V.properties)}).catch(D=>{const $=Br(D,"Could not connect."),V=Fl({action:"connect",outcome:"failed",provider:M,entryPoint:n,durationMs:Date.now()-R,failureReason:$.includes("Popup blocked")?"popup_blocked":"request_failed"});f==null||f.capture(V.event,V.properties),r5.warn(`Connect error for ${M}:`,$),Mt.error($)})},[u,n,f]),k=m.useCallback(M=>{const R=Date.now(),O=Fl({action:"disconnect",outcome:"started",provider:M,entryPoint:n});f==null||f.capture(O.event,O.properties),d(M).then(()=>{const D=Fl({action:"disconnect",outcome:"completed",provider:M,entryPoint:n,durationMs:Date.now()-R});f==null||f.capture(D.event,D.properties)}).catch(D=>{const $=Br(D,"Could not disconnect."),V=Fl({action:"disconnect",outcome:"failed",provider:M,entryPoint:n,durationMs:Date.now()-R,failureReason:"request_failed"});f==null||f.capture(V.event,V.properties),r5.warn(`Disconnect error for ${M}:`,$),Mt.error($)})},[n,d,f]),E=n==="onboarding",P=(I=_.data)==null?void 0:I.sources.some(M=>M.provider==="cosmos");let T=P?"Connected":"Not connected";return _.isError&&(T="Status unavailable"),_.isPending&&(T="Checking status…"),b.jsxs(b.Fragment,{children:[b.jsx(lv,{open:t,onOpenChange:M=>!M&&e(),children:b.jsxs(cv,{children:[b.jsx(uv,{className:"z-max fixed inset-0 bg-black/40"}),b.jsx(dv,{ref:g,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:b.jsxs(QO,{value:h,children:[b.jsxs("div",{className:"border-main-border bg-main-light flex items-center justify-between rounded-t-lg border-b px-4 py-2",children:[b.jsx(fv,{className:"text-content text-base font-medium",children:"Connect design references"}),b.jsx(Ji,{onClick:e,title:"Close","aria-label":"Close",variant:"ghost",size:"icon-compact",children:b.jsx($b,{className:"h-4 w-4",weight:"bold"})})]}),b.jsxs("div",{className:"flex flex-col gap-4 p-4",children:[b.jsx(hv,{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?b.jsx("p",{className:"rounded-lg bg-red-500/10 px-4 py-3 text-[13px] font-medium text-red-300",children:o}):null,b.jsxs("ul",{className:"divide-main-border divide-y","aria-label":"Design reference services",children:[une.map(M=>{const R=w(M.provider),O=(R==null?void 0:R.status)==="connected",D=R==null?void 0:R.externalUsername;let $=O?`Connected${D?` as @${D}`:""}`:"Not connected";i&&($="Checking status…");const V=l===M.provider,q=O?"Disconnect":"Connect";return b.jsx(s5,{meta:M,status:$,actionLabel:`${q} ${M.name}`,buttonLabel:V?`${q}ing…`:q,isDisabled:i||V,isHighlighted:r===M.provider,onAction:()=>O?k(M.provider):S(M.provider)},M.provider)}),b.jsx(s5,{meta:dne,status:T,actionLabel:P?"Add Cosmos profile":"Connect Cosmos",buttonLabel:P?"Add profile":"Connect",isDisabled:!1,isHighlighted:!1,onAction:()=>{f==null||f.capture("visual_editor_cosmos_modal_opened"),x(!0)}})]}),E?b.jsxs("div",{className:"flex items-center justify-between gap-4",children:[b.jsx("p",{className:"text-content-subtle text-xs",children:"You can always do this later from the account menu."}),b.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]})]})})]})}),b.jsx(cne,{isOpen:v,onClose:()=>x(!1),onImported:()=>{_.refetch()}})]})},i5=({className:t=""})=>b.jsx("span",{"aria-hidden":"true",className:`rivet-skeleton block rounded ${t}`.trim()}),fne=Is("SupportTicketModal"),o5=5e3,V_="feedback",hne=Rn({error:Qe().optional(),details:Uz([Qe(),Rn({formErrors:gd(Qe()).optional(),fieldErrors:nM(Qe(),gd(Qe()).optional()).optional()})]).optional()}),pne=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},mne=async t=>{let e;try{const n=hne.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=pne(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}`},gne=({isOpen:t,onClose:e,contactEmail:n})=>{const r=Xs(),[s,i]=m.useState(""),[o,l]=m.useState(!1),[u,d]=m.useState(null),f=m.useCallback(()=>{i("")},[]),h=m.useCallback(()=>{o||(f(),e())},[o,e,f]),g=m.useCallback(async()=>{const w=s.trim();if(!(!w||o)){l(!0);try{const S=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,E=n==null?void 0:n.trim(),P=await el("/api/support/tickets",{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({type:V_,message:w,contactEmail:E||void 0,metadata:{posthogSessionId:S??void 0,posthogDistinctId:k??void 0,appVersion:"0.21.7",appEnvironment:"production",pageUrl:window.location.href,userAgent:navigator.userAgent,submittedAt:new Date().toISOString()}})});if(!P.ok){const T=await mne(P);throw new Error(T)}r==null||r.capture("support_ticket_submitted",{ticket_type:V_,has_posthog_session_id:!!S}),Mt.success("Feedback sent",{description:"Thanks for sharing this."}),f(),e()}catch(S){const k=Br(S,"Failed to send message");r==null||r.capture("support_ticket_submit_failed",{ticket_type:V_,error:k}),fne.error("Failed to submit support ticket:",k),Mt.error("Could not send feedback",{description:k})}finally{l(!1)}}},[n,o,s,e,r,f]),v=m.useCallback(w=>{w.key==="Enter"&&(w.metaKey||w.ctrlKey)&&(w.preventDefault(),g())},[g]),x=o5-s.length,_=o||s.trim().length===0;return b.jsx(lv,{open:t,onOpenChange:w=>!w&&h(),children:b.jsxs(cv,{children:[b.jsx(uv,{className:"z-max fixed inset-0 bg-black/40"}),b.jsx(dv,{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:b.jsxs(QO,{value:u,children:[b.jsxs("div",{className:"border-main-border bg-main-light flex items-center justify-between rounded-t-lg border-b px-4 py-2",children:[b.jsx(fv,{className:"text-content text-base font-medium",children:"Send feedback"}),b.jsx(Ji,{onClick:h,disabled:o,title:"Close","aria-label":"Close",variant:"ghost",size:"icon-compact",children:b.jsx($b,{className:"h-4 w-4",weight:"bold"})})]}),b.jsxs("div",{className:"flex flex-col gap-3 p-4",children:[b.jsx(hv,{className:"text-content-subtle text-sm",children:"Tell us what happened or what we can improve."}),b.jsxs("div",{className:"bg-main-input rounded-lg outline outline-1 outline-transparent transition-[outline-color] focus-within:outline-white/20",children:[b.jsx("textarea",{id:"support-ticket-message","aria-label":"Your feedback",value:s,onChange:w=>i(w.target.value),onKeyDown:v,maxLength:o5,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"}),b.jsxs("div",{className:"flex items-center justify-between px-3 pt-1 pb-3",children:[b.jsx("span",{className:"text-content-subtle text-xs",children:"Context details are included automatically."}),b.jsxs("div",{className:"flex items-center gap-2",children:[x<=500&&b.jsx("span",{className:"text-content-subtle text-xs",children:x}),b.jsx(Ji,{onClick:g,disabled:_,title:"Send feedback",shortcut:"⌘↵","aria-label":"Send feedback",size:"icon-compact",children:o?b.jsx(Xg,{className:"h-5 w-5 animate-spin",weight:"bold"}):b.jsx(jK,{className:"h-5 w-5",weight:"bold"})})]})]})]})]})]})})]})})},vne=Is("ProfileAvatar"),Y9=(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):""},yne=(t,e)=>Y9(t,e).charAt(0).toUpperCase(),_ne=({className:t="",side:e="bottom",align:n="end"})=>{var q,B,K;const r=Ote(),s=((q=r.data)==null?void 0:q.name)??null,i=((B=r.data)==null?void 0:B.email)??null,o=((K=r.data)==null?void 0:K.isAuthenticated)===!0,l=Xs(),{startLogin:u,isStartingLogin:d,loginError:f}=q9("account_menu"),[h,g]=m.useState(!1),[v,x]=m.useState(!1),[_,w]=m.useState(!1),[S,k]=m.useState(!1),{containerRef:E,onKeyDown:P,onCloseAutoFocus:T}=v9({onDismiss:()=>V(!1)}),I=yne(s,i);if(r.isPending)return b.jsxs("span",{"data-testid":"profile-avatar-skeleton","aria-hidden":"true",className:`flex shrink-0 items-center gap-2 ${t}`.trim(),children:[b.jsx(i5,{className:"h-8 w-8 rounded-full"}),b.jsx(i5,{className:"h-3.5 w-16"})]});const M=Y9(s,i),R=(s==null?void 0:s.trim())||null,O=(i==null?void 0:i.trim())||null,D=async()=>{k(!0);try{const z=await el("/api/auth/logout",{method:"POST",credentials:"same-origin"});if(!z.ok)throw new Error(`Logout failed: ${z.status}`);window.location.pathname.startsWith("/rivet/library")&&sM()}catch(z){vne.warn("Logout request failed",z),Mt.error("Could not log out. Please try again."),k(!1);return}window.location.reload()};let $="Log in";o&&($=M||"Account"),r.error&&!r.data&&($="Account unavailable");const V=z=>{g(z),l==null||l.capture(`visual_editor_account_menu_${z?"opened":"closed"}`,{is_authenticated:o})};return b.jsxs(b.Fragment,{children:[b.jsxs(f6,{open:h,onOpenChange:V,children:[b.jsx(h6,{asChild:!0,children:b.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:[b.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:I||b.jsx(YK,{className:"h-4 w-4",weight:"bold"})}),b.jsx("span",{className:"max-w-[8rem] truncate text-sm font-medium",children:$})]})}),b.jsx(p6,{children:b.jsxs(m6,{"data-rivet-private":!0,ref:E,onKeyDown:P,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||O?b.jsxs("div",{className:"border-main-border border-b px-3 py-2",children:[R?b.jsx("div",{className:"text-content truncate text-sm font-medium",children:R}):null,O?b.jsx("div",{className:"text-content-muted truncate text-xs",children:O}):null]}):null,b.jsxs("button",{type:"button",role:"menuitem","data-menu-item":!0,onClick:()=>{V(!1),x(!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:[b.jsx(y3,{className:"h-4 w-4",weight:"bold"}),"Connect design references"]}),b.jsxs("button",{type:"button",role:"menuitem","data-menu-item":!0,onClick:()=>{V(!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:[b.jsx(VK,{className:"h-4 w-4",weight:"bold"}),"Share feedback"]}),o?b.jsxs("button",{type:"button",role:"menuitem","data-menu-item":!0,onClick:D,disabled:S,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:[b.jsx(GK,{className:"h-4 w-4",weight:"bold"}),S?"Logging out…":"Log out"]}):null,!o&&!r.error?b.jsxs("button",{type:"button",role:"menuitem","data-menu-item":!0,onClick:()=>{u()},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:[b.jsx(qK,{className:"h-4 w-4",weight:"bold"}),d?"Logging in…":"Log in"]}):null,r.error?b.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?b.jsx("p",{role:"alert",className:"max-w-64 px-3 py-2 text-sm text-red-300",children:f}):null]})})]}),v?b.jsx(sx,{isOpen:!0,onClose:()=>x(!1)}):null,b.jsx(gne,{isOpen:_,onClose:()=>w(!1),contactEmail:i??void 0})]})},wne=({onClose:t,libraryOrigin:e})=>b.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:[b.jsx(Mte,{onClose:t,libraryOrigin:e}),b.jsx("div",{className:"flex min-h-0 flex-1 flex-col",children:b.jsx(cte,{})}),b.jsx("div",{className:"border-main-border bg-main-light flex flex-shrink-0 items-center border-t px-2.5 py-2.5",children:b.jsx(_ne,{side:"top",align:"start"})})]});async function xne(t,e){const{delaysMs:n,shouldRetry:r,onRetry:s}=e;for(let i=1;;i++)try{return await t(i)}catch(o){const l=n[i-1];if(l===void 0||r&&!r(o))throw o;s==null||s(o,i,l),await new Promise(u=>setTimeout(u,l))}}const a5=Is("useServerConfig"),Q9=[250,500,1e3,2e3,4e3],l5=Q9.length+1,bne=async()=>{var n;const t=await fetch("/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}},Sne=()=>{const[t,e]=m.useState(null),[n,r]=m.useState(!0),[s,i]=m.useState(null),o=m.useCallback(async()=>{try{r(!0),i(null);const l=await xne(bne,{delaysMs:Q9,onRetry:(u,d,f)=>{a5.warn(`Server config fetch failed (attempt ${d}); retrying in ${f}ms`,u)}});return e(l),l}catch(l){throw i(Br(l,"Failed to fetch server config")),a5.warn("Error fetching server config:",l),l}finally{r(!1)}},[]);return{config:t,fetchConfig:o,isLoading:n,error:s}},kne="#1C1C20",So=[118,118,124],c5=.85,Cne=3,Ene=.15,U0=36,Pne=4.4,Ane=.7,Tne=3.5,Rne=.8,u5=9,Mne=11,Ine=[1.35,1.12,.95,.85],One=[0,1.1,2.3,3.1],Lne=[0,.35,.16,.13],Nne=[.9,.5,.4,.35],Vl=3,H_=[[{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}]],B0=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},ym=t=>{const e=Math.min(1,Math.max(0,t));return e*e*(3-2*e)},Hl=(t,e)=>(Math.round(t/e-.5)+.5)*e,Dne=Math.sin(Math.PI/3),d5=(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*Dne;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()},jne=(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)-u5}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)-u5}return ym(.5-r/(2*Mne))},X9=({className:t="",trackGlobalLoaderCount:e=!0})=>{const n=mt(C9),r=m.useRef(null),s=m.useCallback(i=>{var D;if((D=r.current)==null||D.call(r),r.current=null,!i)return;const o=i.getContext("2d");if(!o)return;e&&n($=>$+1);const l=window.matchMedia("(prefers-reduced-motion: reduce)").matches;let u=[],d=0,f=0,h=U0,g=U0,v=null,x=null,_=0,w=-1;const S=new Array(33),k=$=>{const V=Math.round($*32);let q=S[V];if(!q){const B=V/32,K=Math.round(So[0]+(255-So[0])*B),z=Math.round(So[1]+(255-So[1])*B),X=Math.round(So[2]+(255-So[2])*B);q=`rgba(${K}, ${z}, ${X}, ${c5})`,S[V]=q}return q},E=$=>{const V=1-.35*$,q=Math.round(So[0]*V),B=Math.round(So[1]*V),K=Math.round(So[2]*V);return`rgba(${q}, ${B}, ${K}, ${c5})`},P=$=>{let V=Math.floor(Math.random()*H_.length);V===w&&(V=(V+1)%H_.length),w=V;const q=[0,0,0,0],B=H_[V].map((N,Y)=>{const ae=N.level,se=q[ae]++,ie=One[ae]+se*Lne[ae],de=Nne[ae]+B0(V*131+Y*17+5)*.2;if(N.hline){const re=Hl((N.y??0)*f,g);return{hline:!0,x1:Hl(N.x1*d,h),x2:Hl(N.x2*d,h),y1:re,y2:re,level:ae,start:ie,dur:de}}const ge=Hl(N.x1*d,h),ue=Hl((N.y1??0)*f,g);return{hline:!1,x1:ge,y1:ue,x2:Math.max(Hl(N.x2*d,h),ge+h),y2:Math.max(Hl((N.y2??0)*f,g),ue+g),level:ae,start:ie,dur:de}}),K=B.reduce((N,Y)=>Math.max(N,Y.start+Y.dur),0),z=u.length,X=new Float32Array(z*Vl),Z=new Int16Array(z*Vl).fill(-1),J=new Uint8Array(z),H=B[0];for(let N=0;N<z;N++){const Y=u[N];Y.x>H.x1&&Y.x<H.x2&&Y.y>H.y1&&Y.y<H.y2&&(J[N]=1);const ae=N*Vl;for(let se=0;se<B.length;se++){const ie=jne(Y.x,Y.y,B[se]);if(ie<=.02)continue;let de=ae;for(let ge=ae;ge<ae+Vl;ge++){if(Z[ge]===-1){de=ge;break}X[ge]<X[de]&&(de=ge)}(Z[de]===-1||ie>X[de])&&(X[de]=ie,Z[de]=se)}}return{startT:$,buildEnd:K,els:B,frame:H,cellQ:X,cellEl:Z,inFrame:J}},T=()=>{const $=i.getBoundingClientRect();d=Math.max(1,$.width),f=Math.max(1,$.height);const V=Math.min(2,window.devicePixelRatio||1);i.width=Math.round(d*V),i.height=Math.round(f*V),o.setTransform(V,0,0,V,0,0);const q=Math.max(8,Math.round(d/U0)),B=Math.max(6,Math.round(f/U0));h=d/q,g=f/B,u=[];for(let K=0;K<B;K++){const z=B>1?K/(B-1):.5,X=Pne*(1+Ane*.4*(z*2-1));for(let Z=0;Z<q;Z++){const J=K*8191+Z*131+1,H={x:(Z+.5)*h,y:(K+.5)*g,size:X,seed:J,phase:B0(J),kind:0};H.kind=Math.floor(B0(J*97)*3),u.push(H)}}x=null,v=null},I=new Float32Array(32),M=$=>{o.fillStyle=kne,o.fillRect(0,0,d,f),v||(v=P($+.2)),$>=v.startT+v.buildEnd+Tne&&(x=v,_=$,v=P($+.2));let V=0;x&&(V=1-ym(($-_)/Rne),V<=0&&(x=null));const q=v;for(let H=0;H<q.els.length;H++){const N=q.els[H];I[H]=ym(Math.min(1,Math.max(0,($-q.startT-N.start)/N.dur)))}const B=I[0],K=E(0),z=E(B),X=V>0?E(V):K,Z=V>0?E(Math.max(B,V)):z,J=u.length;for(let H=0;H<J;H++){const N=u[H];let Y=0,ae=0;const se=H*Vl;for(let $e=se;$e<se+Vl;$e++){const Ee=q.cellEl[$e];if(Ee<0)break;const dt=q.cellQ[$e]*I[Ee];dt>Y&&(Y=dt,ae=q.els[Ee].level)}if(x)for(let $e=se;$e<se+Vl;$e++){const Ee=x.cellEl[$e];if(Ee<0)break;const dt=x.cellQ[$e]*V;dt>Y&&(Y=dt,ae=x.els[Ee].level)}const ie=$/Cne+N.phase,de=Math.floor(ie),ge=ie-de,ue=ym(Math.min(ge,1-ge)/Ene),re=Math.floor(B0(N.seed*97+de*7919)*3);re!==N.kind&&Y<.02&&ue<.05&&(N.kind=re);const Pe=Math.max(ue*(1-Y),Y);if(!(Pe<.01))if(Y<.02){const $e=q.inFrame[H]===1,Ee=x?x.inFrame[H]===1:!1;$e?o.fillStyle=Ee?Z:z:o.fillStyle=Ee?X:K;const dt=Math.max($e?B:0,Ee?V:0);d5(o,N.kind,N.x,N.y,N.size*Pe*(1-.2*dt))}else{o.fillStyle=k(Y);const $e=1+(Ine[ae]-1)*Y;d5(o,N.kind,N.x,N.y,N.size*Pe*$e)}}};T();let R=0;if(l)v=P(-100),M(0);else{const $=performance.now(),V=q=>{M((q-$)/1e3),R=requestAnimationFrame(V)};R=requestAnimationFrame(V)}const O=new ResizeObserver(()=>{T(),l&&(v=P(-100),M(0))});O.observe(i),r.current=()=>{cancelAnimationFrame(R),O.disconnect(),e&&n($=>$-1)}},[e,n]);return b.jsx("canvas",{ref:s,"aria-hidden":"true",className:`h-full w-full ${t}`.trim()})},$ne=async(t=null)=>{if(t)return Fne(t);let e;try{e=await fetch("/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 Z0();if(!e.ok)return{isOk:!1,unavailableReason:"rivet_unreachable",upstreamStatus:null};let r;try{r=await e.json()}catch{return Z0()}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}:Z0()},J9=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}}},Fne=t=>J9(t),Z0=()=>J9("/"),z_=Is("usePreviewUpstreamHealth"),Vne=500,Hne=4e3,zne=15e3,Une=3,Bne=(t,e={})=>{const n=m.useRef(null),r=m.useRef(null),s=e.probeMsWhileDown??Vne,i=e.probeMsWhileUp??Hne,o=e.firstUnreachableCaptureAfterMs??zne,l=e.rerunProbeImmediatelyOnVersion,u=e.probePath??null,d=e.skip??!1,f=m.useRef(e.onPersistentUpstreamServerErrors);f.current=e.onPersistentUpstreamServerErrors;const[h,g]=m.useState(t==="static"),[v,x]=m.useState(0),[_,w]=m.useState(null),[S,k]=m.useState(0),[E,P]=m.useState(!1),[T,I]=m.useState(!1),[M,R]=m.useState(t==="static"?null:"upstream_unreachable");return m.useEffect(()=>{if(t==="static"){g(!0),w(null),k(0),P(!1),I(!0),R(null);return}if(d){g(!1),w(null),k(0),P(!1),I(!0),R("upstream_unreachable"),n.current=null;return}let O=!0;const D=Date.now();w(D),k(0),P(!1),g(!1),I(!1),R("upstream_unreachable");const $={current:!1},V={current:!1},q={current:!1},B={current:null},K={current:!1},z={current:!1},X={current:0},Z={current:!1},J={current:null};let H=null;const N=()=>{q.current||(q.current=!0,O&&I(!0))},Y=()=>{H!==null&&(clearTimeout(H),H=null)},ae=(ie,de)=>{Y(),H=setTimeout(de,ie)},se=async()=>{var dt;if(!O)return;k(Tt=>Tt+1);const{isOk:ie,unavailableReason:de,upstreamStatus:ge}=await $ne(u);if(!O)return;N(),J.current=ge;const ue=ie&&ge!==null&&ge>=500;ue&&z.current?X.current+=1:ie&&!ue&&(X.current=0);const re=X.current>=Une;if(re&&!Z.current&&ge!==null&&(Z.current=!0,Ie==null||Ie.capture("preview_upstream_error_responses",{framework:t,upstream_status:ge,consecutive_count:X.current}),z_.warn(`Preview upstream is listening but has served ${X.current} consecutive ${ge} responses`),(dt=f.current)==null||dt.call(f,{upstreamStatus:ge,consecutiveCount:X.current})),ie&&!re){ue||(z.current=!0,Z.current=!1);const Tt=!K.current;K.current=!0,g(!0),R(null),B.current=null,V.current=!1,P(!1),$.current?Tt&&(Ie==null||Ie.capture("preview_upstream_restored",{framework:t})):($.current=!0,Ie==null||Ie.capture("preview_dev_server_ready",{framework:t,ready_after_ms:Date.now()-D})),ae(i,se);return}const $e=K.current;K.current=!1,g(!1),R(de),B.current===null&&(B.current=Date.now(),V.current=!1,P(!1)),$e&&(Ie==null||Ie.capture("preview_upstream_lost",{framework:t,upstream_status:ge}),x(Tt=>Tt+1),z_.warn("Preview upstream became unavailable after it was ready"));const Ee=Date.now()-B.current;Ee>=o&&!V.current&&(V.current=!0,P(!0),Ie==null||Ie.capture("preview_dev_server_unreachable",{framework:t,elapsed_ms:Ee,upstream_status:J.current}),z_.warn("Dev server did not become ready within timeout window")),ae(s,se)};return n.current=()=>ae(0,se),ae(0,se),()=>{O=!1,n.current=null,Y()}},[t,s,i,o,u,d]),m.useEffect(()=>{var D;if(t==="static"||l===void 0)return;const O=r.current;r.current=l,O!==null&&O!==l&&((D=n.current)==null||D.call(n))},[t,l]),{isUpstreamReady:h,iframeRemountKey:v,probeStartedAt:_,probeAttemptCount:S,isFirstUnreachableWindowExceeded:E,initialProbeComplete:T,unavailableReason:M}};function Zne(t){return t.enteringSplit&&t.isExistingSession&&t.hasActiveVariantProxy}const eL=t=>{var e;return t!=="embedded"||typeof window>"u"?"":((e=window.__RIVET_BOOTSTRAP__)==null?void 0:e.previewOrigin)??`${window.location.protocol}//localhost:${window.location.port}`},tL=({agentApplyMode:t,url:e})=>e.startsWith("/")?`${eL(t)}${e}`:e,Wne="allow-scripts allow-same-origin allow-forms allow-popups allow-modals",qne=t=>Wne,Gne=Is("PreviewSurface"),f5=(t,e)=>t==="about:blank"?"blank":t.includes("/api/variants/")?"static_artifact":e.kind==="variant"?"dev_server":"original",Pg=({target:t,src:e,framework:n,remountKey:r,isActive:s=!0})=>{ct(vv);const i=Xs(),o=m.useRef(!1),l=m.useRef(s),u=m.useCallback(f=>{t.kind==="variant"&&(i==null||i.capture("variants_panel.preview_displayed",{sessionId:t.sessionId,variantId:t.variantId,renderedTarget:"variant",iframeSrcKind:f5(e,t),framework:n,isReused:f}))},[n,i,e,t]),d=m.useCallback(f=>{f&&(s&&!l.current&&o.current&&u(!0),l.current=s)},[u,s]);return b.jsx("div",{ref:d,className:"relative h-full w-full",children:b.jsx("iframe",{src:e,className:"h-full w-full border-none",title:s?"Project Preview":"Retained Project Preview",tabIndex:s?void 0:-1,sandbox:qne(),onLoad:()=>{o.current=!0,i==null||i.capture("preview_iframe_loaded",{framework:n,src:e}),s&&u(!1)},onError:()=>{i==null||i.capture("preview_iframe_load_failed",{framework:n,src:e}),s&&t.kind==="variant"&&(i==null||i.capture("variants_panel.preview_display_failed",{sessionId:t.sessionId,variantId:t.variantId,renderedTarget:"variant",iframeSrcKind:f5(e,t),framework:n})),Gne.warn("Preview iframe failed to load",{framework:n,src:e})}},r)})},Kne=7,Yne=t=>{const e=Pc(t.target),n=`${e}:${t.src}`,r=t.src==="about:blank",[s,i]=m.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 u=s.frames.filter(d=>!l||Pc(d.props.target)!==e);if(!r){const d=u.find(f=>f.key===n);if(d?u=u.map(f=>f===d?{...f,lastSelected:o}:f):u=[...u,{key:n,props:t,lastSelected:o}],u.length>Kne){const f=u.reduce((h,g)=>g.lastSelected<h.lastSelected?g:h);u=u.filter(h=>h!==f)}}i({selectedKey:n,remountKey:t.remountKey,selection:o,frames:u})}return b.jsxs("div",{className:"relative h-full w-full",children:[s.frames.map(o=>{const l=!r&&o.key===n;return b.jsx("div",{className:"absolute inset-0",style:{visibility:l?"visible":"hidden",pointerEvents:l?"auto":"none"},"aria-hidden":!l,children:b.jsx(Pg,{...o.props,isActive:l})},`${o.key}:${o.props.remountKey??""}`)}),r?b.jsx(Pg,{...t}):null]})},Qne=m.lazy(()=>aA(()=>Promise.resolve().then(()=>Ise),void 0)),Xne={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"},Jne={sm:"text-lg font-semibold text-content",md:"text-2xl font-semibold text-content",lg:"text-3xl font-semibold text-content"},ere={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"},zu=({backdrop:t,media:e,title:n,description:r,actions:s,tone:i="neutral",fill:o="surface",size:l="md",children:u,state:d,role:f="status",busy:h=!1,className:g=""})=>{const v=m.useCallback(_=>{_&&d&&(Ie==null||Ie.capture("status_surface_shown",{state:d,tone:i,fill:o}))},[d,i,o]),x=!!(e||n||r||u||s!=null&&s.length);return b.jsxs("div",{ref:v,className:`${Xne[o]} ${g}`.trim(),role:f,"aria-live":"polite","aria-busy":h||void 0,"data-state":d,children:[t?b.jsx("div",{className:"absolute inset-0",children:t}):null,x?b.jsxs("div",{className:"relative z-10 flex max-w-sm flex-col items-center gap-5 text-center",children:[e,n?b.jsx("h2",{className:Jne[l],children:n}):null,r?b.jsx("p",{className:"text-content-muted text-base leading-relaxed",children:r}):null,u,s!=null&&s.length?b.jsx("div",{className:"flex flex-row items-center gap-3",children:s.map(_=>b.jsx("button",{type:"button",onClick:_.onClick,className:ere[_.variant??"neutral"],children:_.label},_.label))}):null]}):null]})},ix=({loader:t="coalesce",trackGlobalLoaderCount:e,size:n="lg",...r})=>t==="coalesce"?b.jsx(zu,{...r,size:n,busy:!0,backdrop:b.jsx(X9,{trackGlobalLoaderCount:e})}):t==="logo"?b.jsx(zu,{...r,size:n,busy:!0,backdrop:b.jsx(m.Suspense,{fallback:null,children:b.jsx(Qne,{className:"absolute inset-0"})})}):b.jsx(zu,{...r,size:n,busy:!0,media:b.jsx(Xg,{"aria-hidden":!0,className:"text-content h-8 w-8 shrink-0 animate-spin",weight:"bold"})}),nL=({icon:t,...e})=>b.jsx(zu,{...e,tone:"neutral",media:t?b.jsx("div",{className:"text-content-muted",children:t}):void 0}),w6=t=>b.jsx(zu,{...t,tone:"error",role:"alert"}),h5="/static/",tre=t=>{try{return new URL(t,"http://localhost").pathname.endsWith(h5)}catch{return t.endsWith(h5)}},nre=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.",rre=t=>t.status==="failed"&&t.errorCode==="VARIANT_VERIFICATION_UNAVAILABLE"?{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}:t.status==="failed"&&t.errorCode==="VARIANT_QA_FAILED"?{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}:t.status==="failed"?{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}:t.status==="cancelled"?{state:"variant_cancelled",title:"Direction was cancelled",description:"Rivet stopped before a preview was ready. Your other directions are unchanged.",isError:!1}:t.status==="succeeded"&&t.previewUnavailable&&t.previewUnavailable.reason!=="idle_timeout"?{state:"preview_unavailable",title:"Rivet couldn’t preview this direction",description:nre(t.previewUnavailable.reason),detail:t.previewUnavailable.portInUse?"The preview port was already in use.":void 0,isError:!0}:null,sre=({issue:t,retryTarget:e})=>{const n=Xs(),r=m.useRef(!1),[s,i]=m.useState(!1),[o,l]=m.useState(null),u=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 fetch(`/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=Rn({message:Qe().optional()}).safeParse(await d.json().catch(()=>({}))),h=f.success?f.data:{};throw new Error(h.message??"The preview could not restart. Try again.")}}catch(d){l(Br(d,"The preview could not restart. Try again."))}finally{r.current=!1,i(!1)}}};return b.jsxs(zu,{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 u()}]:void 0,children:[s?b.jsx("p",{className:"text-content-subtle text-xs",children:"Starting preview…"}):null,o?b.jsx("p",{className:"text-content-subtle text-xs",children:o}):null,t.detail?b.jsx("p",{className:"text-content-subtle text-xs leading-relaxed break-words",children:t.detail}):null]})},ire=({isInteractionDisabled:t=!1,framework:e,userPort:n})=>{var Ct;const r=ct(mv),s=e==="static"?Pg:Yne,i=ct(Kw),o=mt(Kw),l=ct(kg),u=mt(kg),d=ct(lp),f=ct(vv),h=ct(Yw),g=ct(Qw),v=ct(E9),x=ct(P9),_=mt(Qw),w=ct(Ko),S=ct(vm),k=mt(Yw),E=d.active&&d.projectContext.kind==="fresh",P=ct(Xw),T=d.active?d.variants.find(qe=>qe.workItemId===P&&(qe.status==="pending"||qe.status==="running"||qe.status==="succeeded"&&!qe.preview&&typeof qe.port!="number"&&(!qe.previewUnavailable||qe.previewUnavailable.reason==="idle_timeout")))??null:null,I=d.active&&d.variants.some(qe=>qe.status==="pending"||qe.status==="running"),M=E||I,R=d.active?d.variants.find(qe=>qe.workItemId===P)??null:null,O=R?rre(R):null,D=e==="static"&&l!==null&&tre(l);m.useEffect(()=>{d.active||k(!1)},[d.active,k]);const $=m.useRef(!1);m.useEffect(()=>{const qe=!!(w!=null&&w.left||w!=null&&w.right),ke=qe&&!$.current;$.current=qe;const rt=d.active?d.sessionId:null;!rt||!Zne({enteringSplit:ke,isExistingSession:d.active&&d.projectContext.kind==="existing",hasActiveVariantProxy:h&&g!==null})||(k(!1),_(null),o(Et=>Et+1),fetch(`/api/variants/${encodeURIComponent(rt)}/preview-port`,{method:"POST",headers:{"content-type":"application/json"},body:JSON.stringify({variantId:null})}).catch(()=>{}))},[w,d,h,g,k,_,o]);const q=m.useMemo(()=>{var yt;if(h||l&&!D||!d.active)return null;const{stage:qe,variants:ke}=d,rt=qe==="ready"||qe==="degraded",Et=ke.some(Dn=>{var Cn,Me;return((Cn=Dn.refinement)==null?void 0:Cn.status)==="pending"||((Me=Dn.refinement)==null?void 0:Me.status)==="running"});if(!rt&&!Et)return null;const Ge=ke.find(Dn=>{var Cn;return Dn.status==="succeeded"&&((Cn=Dn.preview)==null?void 0:Cn.kind)==="static_artifact"});return((yt=Ge==null?void 0:Ge.preview)==null?void 0:yt.kind)==="static_artifact"?Ge.preview.url:null},[D,l,h,d])??l,B=m.useMemo(()=>!d.active||!q?null:d.variants.find(qe=>{var ke;return((ke=qe.preview)==null?void 0:ke.kind)==="static_artifact"&&q.startsWith(qe.preview.url)})??null,[q,d]),K=m.useMemo(()=>{if((S==null?void 0:S.previewKind)==="static"||(S==null?void 0:S.previewKind)==="dev_server"&&q&&VP(q))return{kind:"variant",sessionId:S.sessionId,variantId:S.variantId};if(!d.active)return Sg;if(B)return{kind:"variant",sessionId:d.sessionId,variantId:B.workItemId};if(q){const ke=q.match(/\/__rivet\/preview\/variant\/([^/]+)\/([^/?#]+)/),rt=ke!=null&&ke[1]?decodeURIComponent(ke[1]):null,Et=ke!=null&&ke[2]?decodeURIComponent(ke[2]):null;if(rt===d.sessionId&&Et&&d.variants.some(Dn=>Dn.workItemId===Et))return{kind:"variant",sessionId:d.sessionId,variantId:Et};const Ge=q.match(/\/api\/variants\/[^/]+\/static\/([^/?#]+)/),yt=Ge!=null&&Ge[1]?decodeURIComponent(Ge[1]):null;if(yt&&d.variants.some(Dn=>Dn.workItemId===yt))return{kind:"variant",sessionId:d.sessionId,variantId:yt}}const qe=!!(w!=null&&w.left||w!=null&&w.right);return(!qe||E)&&!q&&h&&g&&d.variants.some(ke=>ke.workItemId===g)?{kind:"variant",sessionId:d.sessionId,variantId:g}:(!qe||E)&&!q&&P&&d.variants.some(ke=>ke.workItemId===P)?{kind:"variant",sessionId:d.sessionId,variantId:P}:Sg},[S,B,d,h,g,q,w,E,P]),z=m.useRef(null);m.useEffect(()=>{var Et,Ge;if(!B||((Et=B.preview)==null?void 0:Et.kind)!=="static_artifact"||((Ge=B.refinement)==null?void 0:Ge.status)!=="succeeded")return;const qe=`${B.workItemId}:${B.refinement.workItemId}`;if(z.current===qe)return;z.current=qe;const ke=B.preview.url.includes("?")?"&":"?",rt=`${B.preview.url}${ke}refinement=${encodeURIComponent(B.refinement.workItemId)}`;q!==rt&&(u(rt),o(yt=>yt+1))},[q,B,o,u,d]);const X=q!==null&&VP(q),Z=q!==null&&!X||E&&!h&&!X,{isUpstreamReady:J,iframeRemountKey:H,probeAttemptCount:N,initialProbeComplete:Y}=Bne(e,{rerunProbeImmediatelyOnVersion:i,probePath:X?q:null,skip:Z}),[ae,se]=m.useState(()=>v&&J?i:null),ie=m.useRef(null);m.useEffect(()=>{if(!v){ie.current=null,se(null);return}if(ae===i){ie.current=null;return}const qe=ie.current;if(!qe||qe.remountKey!==i){ie.current={remountKey:i,probeAttemptCount:N};return}J&&N>qe.probeAttemptCount&&(ie.current=null,se(i))},[ae,i,v,N,J]);const ge=q!==null&&!X||J,re=x||v&&!X&&ae!==i||v&&!ge,Pe=`${H}:${i}`,$e=N9(window.location.pathname),Ee=e==="static"?`/static${$e??"/"}`:$e??"/",dt=eL(f);let Tt=null;q&&(Tt=tL({agentApplyMode:f,url:q}));const jt=T||O||re?"about:blank":(X&&!ge?"about:blank":Tt)??(ge?`${dt}${Ee}`:"about:blank"),xt=!!T||!!O||!ge&&Y;let Xt=null;if(re)Xt=b.jsx(ix,{fill:"overlay",loader:"coalesce",trackGlobalLoaderCount:!1,state:"preview_replay_boot"});else if(T)Xt=b.jsx(ix,{fill:"overlay",loader:"coalesce",trackGlobalLoaderCount:!1,state:"variant_building",children:b.jsx("span",{className:"sr-only",children:"Building your direction"})});else if(O){const qe=d.active&&R&&O.state==="preview_unavailable"&&((Ct=R.previewUnavailable)==null?void 0:Ct.reason)!=="missing_static_entry"?{sessionId:d.sessionId,variantId:R.workItemId}:void 0;Xt=b.jsx(sre,{issue:O,retryTarget:qe},R==null?void 0:R.workItemId)}else xt&&(Xt=M?b.jsx(nL,{fill:"overlay",state:"preview_no_selection",title:"Nothing to preview yet",description:"Pick a direction from the panel."}):b.jsx(w6,{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 b.jsx("div",{className:"relative flex h-full min-h-0 w-full flex-col",children:b.jsxs("div",{className:"relative min-h-0 flex-1",children:[Xt,b.jsx(s,{target:K,src:jt,framework:e,remountKey:Pe},r)]})})};function p5({side:t,sessionId:e,variantId:n,url:r,label:s,source:i,isFallback:o=!1}){var E;const l=ct(Ko),u=mt(Ko),d=Xs(),f=ct(lp),h=ct(vv),g=m.useRef(!1),v=m.useCallback(()=>{g.current||(g.current=!0,xd({source:i,sessionId:e,variantId:n}))},[i,e,n]),x=m.useCallback(()=>{if(o){u(null);const M=Cg("ended",l);d==null||d.capture(M.event,M.properties);return}v();const P={...l};delete P[t];const T=P.left||P.right?P:null;u(T);const I=Cg(T?"updated":"ended",T??l);d==null||d.capture(I.event,I.properties)},[o,d,u,t,l,v]),_=m.useMemo(()=>({kind:"variant",sessionId:e,variantId:n}),[e,n]),w=m.useMemo(()=>!f.active||f.sessionId!==e?null:f.variants.find(P=>P.workItemId===n)??null,[e,n,f]),S=m.useMemo(()=>{var T,I;let P=r;if(((T=w==null?void 0:w.preview)==null?void 0:T.kind)==="static_artifact"&&((I=w.refinement)==null?void 0:I.status)==="succeeded"){const M=w.preview.url.includes("?")?"&":"?";P=`${w.preview.url}${M}refinement=${encodeURIComponent(w.refinement.workItemId)}`}return tL({agentApplyMode:h,url:P})},[h,w,r]),k=((E=w==null?void 0:w.refinement)==null?void 0:E.status)==="succeeded"?`${n}:${w.refinement.workItemId}`:n;return b.jsxs("div",{className:"variant-split-secondary","data-cy":"variant-split-pane","data-variant-id":n,children:[b.jsxs("div",{className:"variant-split-secondary-toolbar",children:[b.jsx("span",{className:"variant-split-secondary-label",title:s,children:s}),b.jsx(Ac,{label:"Collapse",children:b.jsx("button",{type:"button",className:"variant-split-secondary-close",onClick:x,"aria-label":"Collapse split view",children:b.jsx("svg",{width:"12",height:"12",viewBox:"0 0 12 12","aria-hidden":"true",focusable:"false",children:b.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"})})})})]}),b.jsx("div",{className:"variant-split-secondary-body relative min-h-0 flex-1",children:b.jsx(Pg,{target:_,src:S,framework:"static",remountKey:k})})]})}function ore(){const t=ct(wd),e=ct(v6);return!t||!e?null:sp.createPortal(b.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:b.jsx("span",{className:"text-content truncate text-sm font-medium",children:t.label})}),document.body)}function are(){const t=ct(wd),e=ct(v6),n=ct(Ko),r=mt(wd),s=mt(Ko),i=Xs(),o=m.useRef(null),[l,u]=m.useState(null),[d,f]=m.useState("hidden");m.useEffect(()=>{t||(f("hidden"),u(null))},[t]);const h=m.useCallback((v,x)=>{const _=o.current;if(!_)return null;const w=_.getBoundingClientRect();return v<w.left||v>w.right||x<w.top||x>w.bottom?null:v<(w.left+w.right)/2?"left":"right"},[]);if(m.useEffect(()=>{if(!t||!e)return;const v=h(e.x,e.y);u(x=>x===v?x:v),f(x=>{if(x==="exiting")return x;const _=v!==null?"visible":"hidden";return x===_?x:_})},[t,e,h]),m.useEffect(()=>{if(!t)return;const v=x=>{const _=h(x.clientX,x.clientY);if(_&&t.url){const w={sessionId:t.sessionId,variantId:t.variantId,label:t.label,url:t.url,source:t.source},S=n==null?void 0:n[_];S&&(S.sessionId!==w.sessionId||S.variantId!==w.variantId)&&xd(S);const k={...n??{},[_]:w};s(k);const E=Cg(n?"updated":"started",k);i==null||i.capture(E.event,E.properties),f("exiting"),window.setTimeout(()=>r(null),220)}else xd(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 g=["variant-drop-zones",d==="visible"&&"is-visible",d==="exiting"&&"is-exiting"].filter(Boolean).join(" ");return b.jsxs("div",{ref:o,className:g,"aria-hidden":"true",children:[b.jsx(m5,{side:"left",hovered:l==="left",canDrop:!!t.url,label:t.label}),b.jsx(m5,{side:"right",hovered:l==="right",canDrop:!!t.url,label:t.label})]})}function m5({side:t,hovered:e,canDrop:n,label:r}){return b.jsxs("div",{className:["variant-drop-zone",`is-${t}`,e&&"is-hover",!n&&"is-disabled"].filter(Boolean).join(" "),children:[b.jsxs("div",{className:"variant-drop-zone-inner",children:[b.jsx("div",{className:`variant-drop-zone-icon is-${t}`}),b.jsx("div",{className:"variant-drop-zone-caption",children:n?`Add ${t} split`:"Split unavailable for this direction"})]}),b.jsx("div",{className:"variant-drop-zone-preview","aria-hidden":"true",children:b.jsx("div",{className:"variant-drop-zone-preview-label",children:r})}),b.jsx("div",{className:"variant-drop-zone-border"})]})}const rL=(t,e,n)=>{var i,o;if(!t.active||t.sessionId!==e)return null;const r=t.variants.find(l=>l.workItemId===n);if(((i=r==null?void 0:r.preview)==null?void 0:i.kind)!=="static_artifact")return null;if(((o=r.refinement)==null?void 0:o.status)!=="succeeded")return r.preview.url;const s=r.preview.url.includes("?")?"&":"?";return`${r.preview.url}${s}refinement=${encodeURIComponent(r.refinement.workItemId)}`},g5=(t,e)=>{if(!t)return;const n=rL(e,t.sessionId,t.variantId);return!n||n===t.url?t:{...t,url:n}},lre=()=>b.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:b.jsx("div",{className:"border-main-border relative min-h-0 flex-1 overflow-hidden rounded-lg border",children:b.jsx(X9,{trackGlobalLoaderCount:!1})})}),cre=({isLoading:t=!1,isInteractionDisabled:e=!1})=>{const{config:n,fetchConfig:r,isLoading:s,error:i}=Sne();return m.useEffect(()=>{r().catch(o=>{Ie==null||Ie.capture("preview_config_load_failed",{message:Br(o,"unknown_error"),attempts:l5})})},[r]),s?b.jsx(lre,{}):i||!n?b.jsx(w6,{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:()=>{Ie==null||Ie.capture("preview_config_retry_clicked"),r().catch(o=>{Ie==null||Ie.capture("preview_config_load_failed",{message:Br(o,"unknown_error"),attempts:l5})})}}]}):b.jsx(ure,{isLoading:t,isInteractionDisabled:e,framework:n.framework,userPort:n.userPort})};function ure(t){const e=ct(Ko),n=ct(wd),r=ct(lp),s=ct(kg),i=e==null?void 0:e.left,o=e==null?void 0:e.right,l=m.useMemo(()=>{var T,I;if(!r.active||r.projectContext.kind!=="fresh"||!(!!i!=!!o))return;const _=(T=i??o)==null?void 0:T.variantId,w=r.variants.filter(M=>{var R;return M.status==="succeeded"&&((R=M.preview)==null?void 0:R.kind)==="static_artifact"&&M.workItemId!==_}),S=s==null?void 0:s.replace(/[?&]refinement=[^&]*$/,""),E=w.find(M=>{var R;return((R=M.preview)==null?void 0:R.kind)==="static_artifact"&&M.preview.url===S})??w[0];if(((I=E==null?void 0:E.preview)==null?void 0:I.kind)!=="static_artifact")return;const P=rL(r,r.sessionId,E.workItemId);if(P)return{sessionId:r.sessionId,variantId:E.workItemId,label:E.label,url:P,source:"live"}},[r,i,o,s]),u=g5(i,r)??(o?l:void 0),d=g5(o,r)??(i?l:void 0),f=!i&&!!u,h=!o&&!!d,g=!!(u||d),v=b.jsx(ire,{isInteractionDisabled:t.isInteractionDisabled,framework:t.framework,userPort:t.userPort});return b.jsx("div",{className:"relative flex h-full min-h-0 w-full flex-1 flex-col",children:b.jsxs("div",{className:`variant-preview-region relative flex h-full min-h-0 w-full flex-1 flex-col ${n?"is-dragging":""} ${g?"is-split":""}`,children:[b.jsxs("div",{className:"variant-preview-row flex h-full min-h-0 w-full flex-1",children:[u&&b.jsx(p5,{side:"left",sessionId:u.sessionId,variantId:u.variantId,url:u.url,label:u.label,source:u.source,isFallback:f},`left-${u.sessionId}:${u.variantId}:${u.url}`),b.jsx("div",{className:"variant-preview-primary flex h-full min-h-0 flex-1 flex-col",style:{display:u&&d?"none":void 0},"aria-hidden":!!(u&&d),children:v}),d&&b.jsx(p5,{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}`)]}),b.jsx("div",{className:"variant-preview-atmosphere","aria-hidden":"true"}),b.jsx(are,{}),b.jsx(ore,{})]})})}function Mo(t){if(t===void 0)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return t}function sL(t,e){t.prototype=Object.create(e.prototype),t.prototype.constructor=t,t.__proto__=e}/*!
|
|
142
|
+
* GSAP 3.15.0
|
|
143
|
+
* https://gsap.com
|
|
144
|
+
*
|
|
145
|
+
* @license Copyright 2008-2026, GreenSock. All rights reserved.
|
|
146
|
+
* Subject to the terms at https://gsap.com/standard-license
|
|
147
|
+
* @author: Jack Doyle, jack@greensock.com
|
|
148
|
+
*/var Ps={autoSleep:120,force3D:"auto",nullTargetWarn:1,units:{lineHeight:""}},$h={duration:.5,overwrite:!1,delay:0},x6,_r,fn,Gs=1e8,Kt=1/Gs,ox=Math.PI*2,dre=ox/4,fre=0,iL=Math.sqrt,hre=Math.cos,pre=Math.sin,cr=function(e){return typeof e=="string"},Tn=function(e){return typeof e=="function"},Yo=function(e){return typeof e=="number"},b6=function(e){return typeof e>"u"},so=function(e){return typeof e=="object"},os=function(e){return e!==!1},S6=function(){return typeof window<"u"},W0=function(e){return Tn(e)||cr(e)},oL=typeof ArrayBuffer=="function"&&ArrayBuffer.isView||function(){},Ir=Array.isArray,mre=/random\([^)]+\)/g,gre=/,\s*/g,v5=/(?:-?\.?\d|\.)+/gi,aL=/[-+=.]*\d+[.e\-+]*\d*[e\-+]*\d*/g,Nu=/[-+=.]*\d+[.e-]*\d*[a-z%]*/g,U_=/[-+=.]*\d+\.?\d*(?:e-|e\+)?\d*/gi,lL=/[+-]=-?[.\d]+/,vre=/[^,'"\[\]\s]+/gi,yre=/^[+\-=e\s\d]*\d+[.\d]*([a-z]*|%)\s*$/i,bn,Vi,ax,k6,Ts={},Ag={},cL,uL=function(e){return(Ag=Sd(e,Ts))&&us},C6=function(e,n){return console.warn("Invalid property",e,"set to",n,"Missing plugin? gsap.registerPlugin()")},Fh=function(e,n){return!n&&console.warn(e)},dL=function(e,n){return e&&(Ts[e]=n)&&Ag&&(Ag[e]=n)||Ts},Vh=function(){return 0},_re={suppressEvents:!0,isStart:!0,kill:!1},_m={suppressEvents:!0,kill:!1},wre={suppressEvents:!0},E6={},Za=[],lx={},fL,_s={},B_={},y5=30,wm=[],P6="",A6=function(e){var n=e[0],r,s;if(so(n)||Tn(n)||(e=[e]),!(r=(n._gsap||{}).harness)){for(s=wm.length;s--&&!wm[s].targetTest(n););r=wm[s]}for(s=e.length;s--;)e[s]&&(e[s]._gsap||(e[s]._gsap=new LL(e[s],r)))||e.splice(s,1);return e},mc=function(e){return e._gsap||A6(Ks(e))[0]._gsap},hL=function(e,n,r){return(r=e[n])&&Tn(r)?e[n]():b6(r)&&e.getAttribute&&e.getAttribute(n)||r},as=function(e,n){return(e=e.split(",")).forEach(n)||e},Nn=function(e){return Math.round(e*1e5)/1e5||0},wn=function(e){return Math.round(e*1e7)/1e7||0},Uu=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},xre=function(e,n){for(var r=n.length,s=0;e.indexOf(n[s])<0&&++s<r;);return s<r},Tg=function(){var e=Za.length,n=Za.slice(0),r,s;for(lx={},Za.length=0,r=0;r<e;r++)s=n[r],s&&s._lazy&&(s.render(s._lazy[0],s._lazy[1],!0)._lazy=0)},T6=function(e){return!!(e._initted||e._startAt||e.add)},pL=function(e,n,r,s){Za.length&&!_r&&Tg(),e.render(n,r,!!(_r&&n<0&&T6(e))),Za.length&&!_r&&Tg()},mL=function(e){var n=parseFloat(e);return(n||n===0)&&(e+"").match(vre).length<2?n:cr(e)?e.trim():e},gL=function(e){return e},Rs=function(e,n){for(var r in n)r in e||(e[r]=n[r]);return e},bre=function(e){return function(n,r){for(var s in r)s in n||s==="duration"&&e||s==="ease"||(n[s]=r[s])}},Sd=function(e,n){for(var r in n)e[r]=n[r];return e},_5=function t(e,n){for(var r in n)r!=="__proto__"&&r!=="constructor"&&r!=="prototype"&&(e[r]=so(n[r])?t(e[r]||(e[r]={}),n[r]):n[r]);return e},Rg=function(e,n){var r={},s;for(s in e)s in n||(r[s]=e[s]);return r},oh=function(e){var n=e.parent||bn,r=e.keyframes?bre(Ir(e.keyframes)):Rs;if(os(e.inherit))for(;n;)r(e,n.vars.defaults),n=n.parent||n._dp;return e},Sre=function(e,n){for(var r=e.length,s=r===n.length;s&&r--&&e[r]===n[r];);return r<0},vL=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},_v=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},tl=function(e,n){e.parent&&(!n||e.parent.autoRemoveChildren)&&e.parent.remove&&e.parent.remove(e),e._act=0},gc=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},kre=function(e){for(var n=e.parent;n&&n.parent;)n._dirty=1,n.totalDuration(),n=n.parent;return e},cx=function(e,n,r,s){return e._startAt&&(_r?e._startAt.revert(_m):e.vars.immediateRender&&!e.vars.autoRevert||e._startAt.render(n,!0,s))},Cre=function t(e){return!e||e._ts&&t(e.parent)},w5=function(e){return e._repeat?kd(e._tTime,e=e.duration()+e._rDelay)*e:0},kd=function(e,n){var r=Math.floor(e=wn(e/n));return e&&r===e?r-1:r},Mg=function(e,n){return(e-n._start)*n._ts+(n._ts>=0?0:n._dirty?n.totalDuration():n._tDur)},wv=function(e){return e._end=wn(e._start+(e._tDur/Math.abs(e._ts||e._rts||Kt)||0))},xv=function(e,n){var r=e._dp;return r&&r.smoothChildTiming&&e._ts&&(e._start=wn(r._time-(e._ts>0?n/e._ts:((e._dirty?e.totalDuration():e._tDur)-n)/-e._ts)),wv(e),r._dirty||gc(r,e)),e},yL=function(e,n){var r;if((n._time||!n._dur&&n._initted||n._start<e._time&&(n._dur||!n.add))&&(r=Mg(e.rawTime(),n),(!n._dur||up(0,n.totalDuration(),r)-n._tTime>Kt)&&n.render(r,!0)),gc(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=-Kt}},Wi=function(e,n,r,s){return n.parent&&tl(n),n._start=wn((Yo(r)?r:r||e!==bn?Bs(e,r,n):e._time)+n._delay),n._end=wn(n._start+(n.totalDuration()/Math.abs(n.timeScale())||0)),vL(e,n,"_first","_last",e._sort?"_start":0),ux(n)||(e._recent=n),s||yL(e,n),e._ts<0&&xv(e,e._tTime),e},_L=function(e,n){return(Ts.ScrollTrigger||C6("scrollTrigger",n))&&Ts.ScrollTrigger.create(n,e)},wL=function(e,n,r,s,i){if(M6(e,n,i),!e._initted)return 1;if(!r&&e._pt&&!_r&&(e._dur&&e.vars.lazy!==!1||!e._dur&&e.vars.lazy)&&fL!==bs.frame)return Za.push(e),e._lazy=[i,s],1},Ere=function t(e){var n=e.parent;return n&&n._ts&&n._initted&&!n._lock&&(n.rawTime()<0||t(n))},ux=function(e){var n=e.data;return n==="isFromStart"||n==="isStart"},Pre=function(e,n,r,s){var i=e.ratio,o=n<0||!n&&(!e._start&&Ere(e)&&!(!e._initted&&ux(e))||(e._ts<0||e._dp._ts<0)&&!ux(e))?0:1,l=e._rDelay,u=0,d,f,h;if(l&&e._repeat&&(u=up(0,e._tDur,n),f=kd(u,l),e._yoyo&&f&1&&(o=1-o),f!==kd(e._tTime,l)&&(i=1-o,e.vars.repeatRefresh&&e._initted&&e.invalidate())),o!==i||_r||s||e._zTime===Kt||!n&&e._zTime){if(!e._initted&&wL(e,n,s,r,u))return;for(h=e._zTime,e._zTime=n||(r?Kt:0),r||(r=n&&!h),e.ratio=o,e._from&&(o=1-o),e._time=0,e._tTime=u,d=e._pt;d;)d.r(o,d.d),d=d._next;n<0&&cx(e,n,r,!0),e._onUpdate&&!r&&Ss(e,"onUpdate"),u&&e._repeat&&!r&&e.parent&&Ss(e,"onRepeat"),(n>=e._tDur||n<0)&&e.ratio===o&&(o&&tl(e,1),!r&&!_r&&(Ss(e,o?"onComplete":"onReverseComplete",!0),e._prom&&e._prom()))}else e._zTime||(e._zTime=n)},Are=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}},Cd=function(e,n,r,s){var i=e._repeat,o=wn(n)||0,l=e._tTime/e._tDur;return l&&!s&&(e._time*=o/e._dur),e._dur=o,e._tDur=i?i<0?1e10:wn(o*(i+1)+e._rDelay*i):o,l>0&&!s&&xv(e,e._tTime=e._tDur*l),e.parent&&wv(e),r||gc(e.parent,e),e},x5=function(e){return e instanceof rs?gc(e):Cd(e,e._dur)},Tre={_start:0,endTime:Vh,totalDuration:Vh},Bs=function t(e,n,r){var s=e.labels,i=e._recent||Tre,o=e.duration()>=Gs?i.endTime(!1):e._dur,l,u,d;return cr(n)&&(isNaN(n)||n in s)?(u=n.charAt(0),d=n.substr(-1)==="%",l=n.indexOf("="),u==="<"||u===">"?(l>=0&&(n=n.replace(/=/,"")),(u==="<"?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]):(u=parseFloat(n.charAt(l-1)+n.substr(l+1)),d&&r&&(u=u/100*(Ir(r)?r[0]:r).totalDuration()),l>1?t(e,n.substr(0,l-1),r)+u:o+u)):n==null?o:+n},ah=function(e,n,r){var s=Yo(n[1]),i=(s?2:1)+(e<2?0:1),o=n[i],l,u;if(s&&(o.duration=n[1]),o.parent=r,e){for(l=o,u=r;u&&!("immediateRender"in l);)l=u.vars.defaults||{},u=os(u.vars.inherit)&&u.parent;o.immediateRender=os(l.immediateRender),e<2?o.runBackwards=1:o.startAt=n[i-1]}return new Zn(n[0],o,n[i+1])},cl=function(e,n){return e||e===0?n(e):n},up=function(e,n,r){return r<e?e:r>n?n:r},Tr=function(e,n){return!cr(e)||!(n=yre.exec(e))?"":n[1]},Rre=function(e,n,r){return cl(r,function(s){return up(e,n,s)})},dx=[].slice,xL=function(e,n){return e&&so(e)&&"length"in e&&(!n&&!e.length||e.length-1 in e&&so(e[0]))&&!e.nodeType&&e!==Vi},Mre=function(e,n,r){return r===void 0&&(r=[]),e.forEach(function(s){var i;return cr(s)&&!n||xL(s,1)?(i=r).push.apply(i,Ks(s)):r.push(s)})||r},Ks=function(e,n,r){return fn&&!n&&fn.selector?fn.selector(e):cr(e)&&!r&&(ax||!Ed())?dx.call((n||k6).querySelectorAll(e),0):Ir(e)?Mre(e,r):xL(e)?dx.call(e,0):e?[e]:[]},fx=function(e){return e=Ks(e)[0]||Fh("Invalid scope")||{},function(n){var r=e.current||e.nativeElement||e;return Ks(n,r.querySelectorAll?r:r===e?Fh("Invalid scope")||k6.createElement("div"):e)}},bL=function(e){return e.sort(function(){return .5-Math.random()})},SL=function(e){if(Tn(e))return e;var n=so(e)?e:{each:e},r=vc(n.ease),s=n.from||0,i=parseFloat(n.base)||0,o={},l=s>0&&s<1,u=isNaN(s)||l,d=n.axis,f=s,h=s;return cr(s)?f=h={center:.5,edges:.5,end:1}[s]||0:!l&&u&&(f=s[0],h=s[1]),function(g,v,x){var _=(x||n).length,w=o[_],S,k,E,P,T,I,M,R,O;if(!w){if(O=n.grid==="auto"?0:(n.grid||[1,Gs])[1],!O){for(M=-Gs;M<(M=x[O++].getBoundingClientRect().left)&&O<_;);O<_&&O--}for(w=o[_]=[],S=u?Math.min(O,_)*f-.5:s%O,k=O===Gs?0:u?_*h/O-.5:s/O|0,M=0,R=Gs,I=0;I<_;I++)E=I%O-S,P=k-(I/O|0),w[I]=T=d?Math.abs(d==="y"?P:E):iL(E*E+P*P),T>M&&(M=T),T<R&&(R=T);s==="random"&&bL(w),w.max=M-R,w.min=R,w.v=_=(parseFloat(n.amount)||parseFloat(n.each)*(O>_?_-1:d?d==="y"?_/O:O:Math.max(O,_/O))||0)*(s==="edges"?-1:1),w.b=_<0?i-_:i,w.u=Tr(n.amount||n.each)||0,r=r&&_<0?Bre(r):r}return _=(w[g]-w.min)/w.max||0,wn(w.b+(r?r(_):_)*w.v)+w.u}},hx=function(e){var n=Math.pow(10,((e+"").split(".")[1]||"").length);return function(r){var s=wn(Math.round(parseFloat(r)/e)*e*n);return(s-s%1)/n+(Yo(r)?0:Tr(r))}},kL=function(e,n){var r=Ir(e),s,i;return!r&&so(e)&&(s=r=e.radius||Gs,e.values?(e=Ks(e.values),(i=!Yo(e[0]))&&(s*=s)):e=hx(e.increment)),cl(n,r?Tn(e)?function(o){return i=e(o),Math.abs(i-o)<=s?i:o}:function(o){for(var l=parseFloat(i?o.x:o),u=parseFloat(i?o.y:0),d=Gs,f=0,h=e.length,g,v;h--;)i?(g=e[h].x-l,v=e[h].y-u,g=g*g+v*v):g=Math.abs(e[h]-l),g<d&&(d=g,f=h);return f=!s||d<=s?e[f]:o,i||f===o||Yo(o)?f:f+Tr(o)}:hx(e))},CL=function(e,n,r,s){return cl(Ir(e)?!n:r===!0?!!(r=0):!s,function(){return Ir(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})},Ire=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)}},Ore=function(e,n){return function(r){return e(parseFloat(r))+(n||Tr(r))}},Lre=function(e,n,r){return PL(e,n,0,1,r)},EL=function(e,n,r){return cl(r,function(s){return e[~~n(s)]})},Nre=function t(e,n,r){var s=n-e;return Ir(e)?EL(e,t(0,e.length),n):cl(r,function(i){return(s+(i-e)%s)%s+e})},Dre=function t(e,n,r){var s=n-e,i=s*2;return Ir(e)?EL(e,t(0,e.length-1),n):cl(r,function(o){return o=(i+(o-e)%i)%i||0,e+(o>s?i-o:o)})},Hh=function(e){return e.replace(mre,function(n){var r=n.indexOf("[")+1,s=n.substring(r||7,r?n.indexOf("]"):n.length-1).split(gre);return CL(r?s:+s[0],r?0:+s[1],+s[2]||1e-5)})},PL=function(e,n,r,s,i){var o=n-e,l=s-r;return cl(i,function(u){return r+((u-e)/o*l||0)})},jre=function t(e,n,r,s){var i=isNaN(e+n)?0:function(v){return(1-v)*e+v*n};if(!i){var o=cr(e),l={},u,d,f,h,g;if(r===!0&&(s=1)&&(r=null),o)e={p:e},n={p:n};else if(Ir(e)&&!Ir(n)){for(f=[],h=e.length,g=h-2,d=1;d<h;d++)f.push(t(e[d-1],e[d]));h--,i=function(x){x*=h;var _=Math.min(g,~~x);return f[_](x-_)},r=n}else s||(e=Sd(Ir(e)?[]:{},e));if(!f){for(u in n)R6.call(l,e,u,"get",n[u]);i=function(x){return L6(x,l)||(o?e.p:e)}}}return cl(r,i)},b5=function(e,n,r){var s=e.labels,i=Gs,o,l,u;for(o in s)l=s[o]-n,l<0==!!r&&l&&i>(l=Math.abs(l))&&(u=o,i=l);return u},Ss=function(e,n,r){var s=e.vars,i=s[n],o=fn,l=e._ctx,u,d,f;if(i)return u=s[n+"Params"],d=s.callbackScope||e,r&&Za.length&&Tg(),l&&(fn=l),f=u?i.apply(d,u):i.call(d),fn=o,f},Vf=function(e){return tl(e),e.scrollTrigger&&e.scrollTrigger.kill(!!_r),e.progress()<1&&Ss(e,"onInterrupt"),e},Du,AL=[],TL=function(e){if(e)if(e=!e.name&&e.default||e,S6()||e.headless){var n=e.name,r=Tn(e),s=n&&!r&&e.init?function(){this._props=[]}:e,i={init:Vh,render:L6,add:R6,kill:ese,modifier:Jre,rawVars:0},o={targetTest:0,get:0,getSetter:O6,aliases:{},register:0};if(Ed(),e!==s){if(_s[n])return;Rs(s,Rs(Rg(e,i),o)),Sd(s.prototype,Sd(i,Rg(e,o))),_s[s.prop=n]=s,e.targetTest&&(wm.push(s),E6[n]=1),n=(n==="css"?"CSS":n.charAt(0).toUpperCase()+n.substr(1))+"Plugin"}dL(n,s),e.register&&e.register(us,s,ls)}else AL.push(e)},Wt=255,Hf={aqua:[0,Wt,Wt],lime:[0,Wt,0],silver:[192,192,192],black:[0,0,0],maroon:[128,0,0],teal:[0,128,128],blue:[0,0,Wt],navy:[0,0,128],white:[Wt,Wt,Wt],olive:[128,128,0],yellow:[Wt,Wt,0],orange:[Wt,165,0],gray:[128,128,128],purple:[128,0,128],green:[0,128,0],red:[Wt,0,0],pink:[Wt,192,203],cyan:[0,Wt,Wt],transparent:[Wt,Wt,Wt,0]},Z_=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)*Wt+.5|0},RL=function(e,n,r){var s=e?Yo(e)?[e>>16,e>>8&Wt,e&Wt]:0:Hf.black,i,o,l,u,d,f,h,g,v,x;if(!s){if(e.substr(-1)===","&&(e=e.substr(0,e.length-1)),Hf[e])s=Hf[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&Wt,s&Wt,parseInt(e.substr(7),16)/255];e=parseInt(e.substr(1),16),s=[e>>16,e>>8&Wt,e&Wt]}else if(e.substr(0,3)==="hsl"){if(s=x=e.match(v5),!n)u=+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]=Z_(u+1/3,i,o),s[1]=Z_(u,i,o),s[2]=Z_(u-1/3,i,o);else if(~e.indexOf("="))return s=e.match(aL),r&&s.length<4&&(s[3]=1),s}else s=e.match(v5)||Hf.transparent;s=s.map(Number)}return n&&!x&&(i=s[0]/Wt,o=s[1]/Wt,l=s[2]/Wt,h=Math.max(i,o,l),g=Math.min(i,o,l),f=(h+g)/2,h===g?u=d=0:(v=h-g,d=f>.5?v/(2-h-g):v/(h+g),u=h===i?(o-l)/v+(o<l?6:0):h===o?(l-i)/v+2:(i-o)/v+4,u*=60),s[0]=~~(u+.5),s[1]=~~(d*100+.5),s[2]=~~(f*100+.5)),r&&s.length<4&&(s[3]=1),s},ML=function(e){var n=[],r=[],s=-1;return e.split(Wa).forEach(function(i){var o=i.match(Nu)||[];n.push.apply(n,o),r.push(s+=o.length+1)}),n.c=r,n},S5=function(e,n,r){var s="",i=(e+s).match(Wa),o=n?"hsla(":"rgba(",l=0,u,d,f,h;if(!i)return e;if(i=i.map(function(g){return(g=RL(g,n,1))&&o+(n?g[0]+","+g[1]+"%,"+g[2]+"%,"+g[3]:g.join(","))+")"}),r&&(f=ML(e),u=r.c,u.join(s)!==f.c.join(s)))for(d=e.replace(Wa,"1").split(Nu),h=d.length-1;l<h;l++)s+=d[l]+(~u.indexOf(l)?i.shift()||o+"0,0,0,0)":(f.length?f:i.length?i:r).shift());if(!d)for(d=e.split(Wa),h=d.length-1;l<h;l++)s+=d[l]+i[l];return s+d[h]},Wa=(function(){var t="(?:\\b(?:(?:rgb|rgba|hsl|hsla)\\(.+?\\))|\\B#(?:[0-9a-f]{3,4}){1,2}\\b",e;for(e in Hf)t+="|"+e+"\\b";return new RegExp(t+")","gi")})(),$re=/hsl[a]?\(/,IL=function(e){var n=e.join(" "),r;if(Wa.lastIndex=0,Wa.test(n))return r=$re.test(n),e[1]=S5(e[1],r),e[0]=S5(e[0],r,ML(e[1])),!0},zh,bs=(function(){var t=Date.now,e=500,n=33,r=t(),s=r,i=1e3/240,o=i,l=[],u,d,f,h,g,v,x=function _(w){var S=t()-s,k=w===!0,E,P,T,I;if((S>e||S<0)&&(r+=S-n),s+=S,T=s-r,E=T-o,(E>0||k)&&(I=++h.frame,g=T-h.time*1e3,h.time=T=T/1e3,o+=E+(E>=i?4:i-E),P=1),k||(u=d(_)),P)for(v=0;v<l.length;v++)l[v](T,g,I,w)};return h={time:0,frame:0,tick:function(){x(!0)},deltaRatio:function(w){return g/(1e3/(w||60))},wake:function(){cL&&(!ax&&S6()&&(Vi=ax=window,k6=Vi.document||{},Ts.gsap=us,(Vi.gsapVersions||(Vi.gsapVersions=[])).push(us.version),uL(Ag||Vi.GreenSockGlobals||!Vi.gsap&&Vi||{}),AL.forEach(TL)),f=typeof requestAnimationFrame<"u"&&requestAnimationFrame,u&&h.sleep(),d=f||function(w){return setTimeout(w,o-h.time*1e3+1|0)},zh=1,x(2))},sleep:function(){(f?cancelAnimationFrame:clearTimeout)(u),zh=0,d=Vh},lagSmoothing:function(w,S){e=w||1/0,n=Math.min(S||33,e)},fps:function(w){i=1e3/(w||240),o=h.time*1e3+i},add:function(w,S,k){var E=S?function(P,T,I,M){w(P,T,I,M),h.remove(E)}:w;return h.remove(w),l[k?"unshift":"push"](E),Ed(),E},remove:function(w,S){~(S=l.indexOf(w))&&l.splice(S,1)&&v>=S&&v--},_listeners:l},h})(),Ed=function(){return!zh&&bs.wake()},kt={},Fre=/^[\d.\-M][\d.\-,\s]/,Vre=/["']/g,Hre=function(e){for(var n={},r=e.substr(1,e.length-3).split(":"),s=r[0],i=1,o=r.length,l,u,d;i<o;i++)u=r[i],l=i!==o-1?u.lastIndexOf(","):u.length,d=u.substr(0,l),n[s]=isNaN(d)?d.replace(Vre,"").trim():+d,s=u.substr(l+1).trim();return n},zre=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)},Ure=function(e){var n=(e+"").split("("),r=kt[n[0]];return r&&n.length>1&&r.config?r.config.apply(null,~e.indexOf("{")?[Hre(n[1])]:zre(e).split(",").map(mL)):kt._CE&&Fre.test(e)?kt._CE("",e):r},Bre=function(e){return function(n){return 1-e(1-n)}},vc=function(e,n){return e&&(Tn(e)?e:kt[e]||Ure(e))||n},Rc=function(e,n,r,s){r===void 0&&(r=function(u){return 1-n(1-u)}),s===void 0&&(s=function(u){return u<.5?n(u*2)/2:1-n((1-u)*2)/2});var i={easeIn:n,easeOut:r,easeInOut:s},o;return as(e,function(l){kt[l]=Ts[l]=i,kt[o=l.toLowerCase()]=r;for(var u in i)kt[o+(u==="easeIn"?".in":u==="easeOut"?".out":".inOut")]=kt[l+"."+u]=i[u]}),i},OL=function(e){return function(n){return n<.5?(1-e(1-n*2))/2:.5+e((n-.5)*2)/2}},W_=function t(e,n,r){var s=n>=1?n:1,i=(r||(e?.3:.45))/(n<1?n:1),o=i/ox*(Math.asin(1/s)||0),l=function(f){return f===1?1:s*Math.pow(2,-10*f)*pre((f-o)*i)+1},u=e==="out"?l:e==="in"?function(d){return 1-l(1-d)}:OL(l);return i=ox/i,u.config=function(d,f){return t(e,d,f)},u},q_=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)}:OL(r);return s.config=function(i){return t(e,i)},s};as("Linear,Quad,Cubic,Quart,Quint,Strong",function(t,e){var n=e<5?e+1:e;Rc(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})});kt.Linear.easeNone=kt.none=kt.Linear.easeIn;Rc("Elastic",W_("in"),W_("out"),W_());(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};Rc("Bounce",function(o){return 1-i(1-o)},i)})(7.5625,2.75);Rc("Expo",function(t){return Math.pow(2,10*(t-1))*t+t*t*t*t*t*t*(1-t)});Rc("Circ",function(t){return-(iL(1-t*t)-1)});Rc("Sine",function(t){return t===1?1:-hre(t*dre)+1});Rc("Back",q_("in"),q_("out"),q_());kt.SteppedEase=kt.steps=Ts.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-Kt;return function(l){return((s*up(0,o,l)|0)+i)*r}}};$h.ease=kt["quad.out"];as("onComplete,onUpdate,onStart,onRepeat,onReverseComplete,onInterrupt",function(t){return P6+=t+","+t+"Params,"});var LL=function(e,n){this.id=fre++,e._gsap=this,this.target=e,this.harness=n,this.get=n?n.get:hL,this.set=n?n.getSetter:O6},Uh=(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,Cd(this,+n.duration,1,1),this.data=n.data,fn&&(this._ctx=fn,fn.data.push(this)),zh||bs.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,Cd(this,this._repeat<0?r:(r-this._repeat*this._rDelay)/(this._repeat+1))):this._tDur},e.totalTime=function(r,s){if(Ed(),!arguments.length)return this._tTime;var i=this._dp;if(i&&i.smoothChildTiming&&this._ts){for(xv(this,r),!i._dp||i.parent||yL(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)&&Wi(this._dp,this,this._start-this._delay)}return(this._tTime!==r||!this._dur&&!s||this._initted&&Math.abs(this._zTime)===Kt||!this._initted&&this._dur&&r||!r&&!this._initted&&(this.add||this._ptLookup))&&(this._ts||(this._pTime=r),pL(this,r,s)),this},e.time=function(r,s){return arguments.length?this.totalTime(Math.min(this.totalDuration(),r+w5(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)+w5(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?kd(this._tTime,i)+1:1},e.timeScale=function(r,s){if(!arguments.length)return this._rts===-Kt?0:this._rts;if(this._rts===r)return this;var i=this.parent&&this._ts?Mg(this.parent._time,this):this._tTime;return this._rts=+r||0,this._ts=this._ps||r===-Kt?0:this._rts,this.totalTime(up(-Math.abs(this._delay),this.totalDuration(),i),s!==!1),wv(this),kre(this)},e.paused=function(r){return arguments.length?(this._ps!==r&&(this._ps=r,r?(this._pTime=this._tTime||Math.max(-this._delay,this.rawTime()),this._ts=this._act=0):(Ed(),this._ts=this._rts,this.totalTime(this.parent&&!this.parent.smoothChildTiming?this.rawTime():this._tTime||this._pTime,this.progress()===1&&Math.abs(this._zTime)!==Kt&&(this._tTime-=Kt)))),this):this._ps},e.startTime=function(r){if(arguments.length){this._start=wn(r);var s=this.parent||this._dp;return s&&(s._sort||!this.parent)&&Wi(s,this,this._start-this._delay),this}return this._start},e.endTime=function(r){return this._start+(os(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?Mg(s.rawTime(r),this):this._tTime:this._tTime},e.revert=function(r){r===void 0&&(r=wre);var s=_r;return _r=r,T6(this)&&(this.timeline&&this.timeline.revert(r),this.totalTime(-.01,r.suppressEvents)),this.data!=="nested"&&r.kill!==!1&&this.kill(),_r=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,x5(this)):this._repeat===-2?1/0:this._repeat},e.repeatDelay=function(r){if(arguments.length){var s=this._time;return this._rDelay=r,x5(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(Bs(this,r),os(s))},e.restart=function(r,s){return this.play().totalTime(r?-this._delay:0,os(s)),this._dur||(this._zTime=-Kt),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?-Kt:0)),this):this._rts<0},e.invalidate=function(){return this._initted=this._act=0,this._zTime=-Kt,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)-Kt)},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=Tn(r)?r:gL,u=function(){var f=s.then;s.then=null,i&&i(),Tn(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?u():s._prom=u})},e.kill=function(){Vf(this)},t})();Rs(Uh.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:-Kt,_prom:0,_ps:!1,_rts:1});var rs=(function(t){sL(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=os(r.sortChildren),bn&&Wi(r.parent||bn,Mo(i),s),r.reversed&&i.reverse(),r.paused&&i.paused(!0),r.scrollTrigger&&_L(Mo(i),r.scrollTrigger),i}var n=e.prototype;return n.to=function(s,i,o){return ah(0,arguments,this),this},n.from=function(s,i,o){return ah(1,arguments,this),this},n.fromTo=function(s,i,o,l){return ah(2,arguments,this),this},n.set=function(s,i,o){return i.duration=0,i.parent=this,oh(i).repeatDelay||(i.repeat=0),i.immediateRender=!!i.immediateRender,new Zn(s,i,Bs(this,o),1),this},n.call=function(s,i,o){return Wi(this,Zn.delayedCall(0,s,i),o)},n.staggerTo=function(s,i,o,l,u,d,f){return o.duration=i,o.stagger=o.stagger||l,o.onComplete=d,o.onCompleteParams=f,o.parent=this,new Zn(s,o,Bs(this,u)),this},n.staggerFrom=function(s,i,o,l,u,d,f){return o.runBackwards=1,oh(o).immediateRender=os(o.immediateRender),this.staggerTo(s,i,o,l,u,d,f)},n.staggerFromTo=function(s,i,o,l,u,d,f,h){return l.startAt=o,oh(l).immediateRender=os(l.immediateRender),this.staggerTo(s,i,l,u,d,f,h)},n.render=function(s,i,o){var l=this._time,u=this._dirty?this.totalDuration():this._tDur,d=this._dur,f=s<=0?0:wn(s),h=this._zTime<0!=s<0&&(this._initted||!d),g,v,x,_,w,S,k,E,P,T,I,M;if(this!==bn&&f>u&&s>=0&&(f=u),f!==this._tTime||o||h){if(l!==this._time&&d&&(f+=this._time-l,s+=this._time-l),g=f,P=this._start,E=this._ts,S=!E,h&&(d||(l=this._zTime),(s||!i)&&(this._zTime=s)),this._repeat){if(I=this._yoyo,w=d+this._rDelay,this._repeat<-1&&s<0)return this.totalTime(w*100+s,i,o);if(g=wn(f%w),f===u?(_=this._repeat,g=d):(T=wn(f/w),_=~~T,_&&_===T&&(g=d,_--),g>d&&(g=d)),T=kd(this._tTime,w),!l&&this._tTime&&T!==_&&this._tTime-T*w-this._dur<=0&&(T=_),I&&_&1&&(g=d-g,M=1),_!==T&&!this._lock){var R=I&&T&1,O=R===(I&&_&1);if(_<T&&(R=!R),l=R?0:f%d?d:f,this._lock=1,this.render(l||(M?0:wn(_*w)),i,!d)._lock=0,this._tTime=f,!i&&this.parent&&Ss(this,"onRepeat"),this.vars.repeatRefresh&&!M&&(this.invalidate()._lock=1,T=_),l&&l!==this._time||S!==!this._ts||this.vars.onRepeat&&!this.parent&&!this._act)return this;if(d=this._dur,u=this._tDur,O&&(this._lock=2,l=R?d:-1e-4,this.render(l,!0),this.vars.repeatRefresh&&!M&&this.invalidate()),this._lock=0,!this._ts&&!S)return this}}if(this._hasPause&&!this._forcing&&this._lock<2&&(k=Are(this,wn(l),wn(g)),k&&(f-=g-(g=k._start))),this._tTime=f,this._time=g,this._act=!!E,this._initted||(this._onUpdate=this.vars.onUpdate,this._initted=1,this._zTime=s,l=0),!l&&f&&d&&!i&&!T&&(Ss(this,"onStart"),this._tTime!==f))return this;if(g>=l&&s>=0)for(v=this._first;v;){if(x=v._next,(v._act||g>=v._start)&&v._ts&&k!==v){if(v.parent!==this)return this.render(s,i,o);if(v.render(v._ts>0?(g-v._start)*v._ts:(v._dirty?v.totalDuration():v._tDur)+(g-v._start)*v._ts,i,o),g!==this._time||!this._ts&&!S){k=0,x&&(f+=this._zTime=-Kt);break}}v=x}else{v=this._last;for(var D=s<0?s:g;v;){if(x=v._prev,(v._act||D<=v._end)&&v._ts&&k!==v){if(v.parent!==this)return this.render(s,i,o);if(v.render(v._ts>0?(D-v._start)*v._ts:(v._dirty?v.totalDuration():v._tDur)+(D-v._start)*v._ts,i,o||_r&&T6(v)),g!==this._time||!this._ts&&!S){k=0,x&&(f+=this._zTime=D?-Kt:Kt);break}}v=x}}if(k&&!i&&(this.pause(),k.render(g>=l?0:-Kt)._zTime=g>=l?1:-1,this._ts))return this._start=P,wv(this),this.render(s,i,o);this._onUpdate&&!i&&Ss(this,"onUpdate",!0),(f===u&&this._tTime>=this.totalDuration()||!f&&l)&&(P===this._start||Math.abs(E)!==Math.abs(this._ts))&&(this._lock||((s||!d)&&(f===u&&this._ts>0||!f&&this._ts<0)&&tl(this,1),!i&&!(s<0&&!l)&&(f||l||!u)&&(Ss(this,f===u&&s>=0?"onComplete":"onReverseComplete",!0),this._prom&&!(f<u&&this.timeScale()>0)&&this._prom())))}return this},n.add=function(s,i){var o=this;if(Yo(i)||(i=Bs(this,i,s)),!(s instanceof Uh)){if(Ir(s))return s.forEach(function(l){return o.add(l,i)}),this;if(cr(s))return this.addLabel(s,i);if(Tn(s))s=Zn.delayedCall(0,s);else return this}return this!==s?Wi(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=-Gs);for(var u=[],d=this._first;d;)d._start>=l&&(d instanceof Zn?i&&u.push(d):(o&&u.push(d),s&&u.push.apply(u,d.getChildren(!0,i,o)))),d=d._next;return u},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 cr(s)?this.removeLabel(s):Tn(s)?this.killTweensOf(s):(s.parent===this&&_v(this,s),s===this._recent&&(this._recent=this._last),gc(this))},n.totalTime=function(s,i){return arguments.length?(this._forcing=1,!this._dp&&this._ts&&(this._start=wn(bs.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]=Bs(this,i),this},n.removeLabel=function(s){return delete this.labels[s],this},n.addPause=function(s,i,o){var l=Zn.delayedCall(0,i||Vh,o);return l.data="isPause",this._hasPause=1,Wi(this,l,Bs(this,s))},n.removePause=function(s){var i=this._first;for(s=Bs(this,s);i;)i._start===s&&i.data==="isPause"&&tl(i),i=i._next},n.killTweensOf=function(s,i,o){for(var l=this.getTweensOf(s,o),u=l.length;u--;)Va!==l[u]&&l[u].kill(s,i);return this},n.getTweensOf=function(s,i){for(var o=[],l=Ks(s),u=this._first,d=Yo(i),f;u;)u instanceof Zn?xre(u._targets,l)&&(d?(!Va||u._initted&&u._ts)&&u.globalTime(0)<=i&&u.globalTime(u.totalDuration())>i:!i||u.isActive())&&o.push(u):(f=u.getTweensOf(l,i)).length&&o.push.apply(o,f),u=u._next;return o},n.tweenTo=function(s,i){i=i||{};var o=this,l=Bs(o,s),u=i,d=u.startAt,f=u.onStart,h=u.onStartParams,g=u.immediateRender,v,x=Zn.to(o,Rs({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())||Kt,onStart:function(){if(o.pause(),!v){var w=i.duration||Math.abs((l-(d&&"time"in d?d.time:o._time))/o.timeScale());x._dur!==w&&Cd(x,w,0,1).render(x._time,!0,!0),v=1}f&&f.apply(x,h||[])}},i));return g?x.render(0):x},n.tweenFromTo=function(s,i,o){return this.tweenTo(i,Rs({startAt:{time:Bs(this,s)}},o))},n.recent=function(){return this._recent},n.nextLabel=function(s){return s===void 0&&(s=this._time),b5(this,Bs(this,s))},n.previousLabel=function(s){return s===void 0&&(s=this._time),b5(this,Bs(this,s),1)},n.currentLabel=function(s){return arguments.length?this.seek(s,!0):this.previousLabel(this._time+Kt)},n.shiftChildren=function(s,i,o){o===void 0&&(o=0);var l=this._first,u=this.labels,d;for(s=wn(s);l;)l._start>=o&&(l._start+=s,l._end+=s),l=l._next;if(i)for(d in u)u[d]>=o&&(u[d]+=s);return gc(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={}),gc(this)},n.totalDuration=function(s){var i=0,o=this,l=o._last,u=Gs,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>u&&o._sort&&l._ts&&!o._lock?(o._lock=1,Wi(o,l,f-l._delay,1)._lock=0):u=f,f<0&&l._ts&&(i-=f,(!h&&!o._dp||h&&h.smoothChildTiming)&&(o._start+=wn(f/o._ts),o._time-=f,o._tTime-=f),o.shiftChildren(-f,!1,-1/0),u=0),l._end>i&&l._ts&&(i=l._end),l=d;Cd(o,o===bn&&o._time>i?o._time:i,1,1),o._dirty=0}return o._tDur},e.updateRoot=function(s){if(bn._ts&&(pL(bn,Mg(s,bn)),fL=bs.frame),bs.frame>=y5){y5+=Ps.autoSleep||120;var i=bn._first;if((!i||!i._ts)&&Ps.autoSleep&&bs._listeners.length<2){for(;i&&!i._ts;)i=i._next;i||bs.sleep()}}},e})(Uh);Rs(rs.prototype,{_lock:0,_hasPause:0,_forcing:0});var Zre=function(e,n,r,s,i,o,l){var u=new ls(this._pt,e,n,0,1,VL,null,i),d=0,f=0,h,g,v,x,_,w,S,k;for(u.b=r,u.e=s,r+="",s+="",(S=~s.indexOf("random("))&&(s=Hh(s)),o&&(k=[r,s],o(k,e,n),r=k[0],s=k[1]),g=r.match(U_)||[];h=U_.exec(s);)x=h[0],_=s.substring(d,h.index),v?v=(v+1)%5:_.substr(-5)==="rgba("&&(v=1),x!==g[f++]&&(w=parseFloat(g[f-1])||0,u._pt={_next:u._pt,p:_||f===1?_:",",s:w,c:x.charAt(1)==="="?Uu(w,x)-w:parseFloat(x)-w,m:v&&v<4?Math.round:0},d=U_.lastIndex);return u.c=d<s.length?s.substring(d,s.length):"",u.fp=l,(lL.test(s)||S)&&(u.e=0),this._pt=u,u},R6=function(e,n,r,s,i,o,l,u,d,f){Tn(s)&&(s=s(i||0,e,o));var h=e[n],g=r!=="get"?r:Tn(h)?d?e[n.indexOf("set")||!Tn(e["get"+n.substr(3)])?n:"get"+n.substr(3)](d):e[n]():h,v=Tn(h)?d?Yre:$L:I6,x;if(cr(s)&&(~s.indexOf("random(")&&(s=Hh(s)),s.charAt(1)==="="&&(x=Uu(g,s)+(Tr(g)||0),(x||x===0)&&(s=x))),!f||g!==s||px)return!isNaN(g*s)&&s!==""?(x=new ls(this._pt,e,n,+g||0,s-(g||0),typeof h=="boolean"?Xre:FL,0,v),d&&(x.fp=d),l&&x.modifier(l,this,e),this._pt=x):(!h&&!(n in e)&&C6(n,s),Zre.call(this,e,n,g,s,v,u||Ps.stringFilter,d))},Wre=function(e,n,r,s,i){if(Tn(e)&&(e=lh(e,i,n,r,s)),!so(e)||e.style&&e.nodeType||Ir(e)||oL(e))return cr(e)?lh(e,i,n,r,s):e;var o={},l;for(l in e)o[l]=lh(e[l],i,n,r,s);return o},NL=function(e,n,r,s,i,o){var l,u,d,f;if(_s[e]&&(l=new _s[e]).init(i,l.rawVars?n[e]:Wre(n[e],s,i,o,r),r,s,o)!==!1&&(r._pt=u=new ls(r._pt,i,e,0,1,l.render,l,0,l.priority),r!==Du))for(d=r._ptLookup[r._targets.indexOf(i)],f=l._props.length;f--;)d[l._props[f]]=u;return l},Va,px,M6=function t(e,n,r){var s=e.vars,i=s.ease,o=s.startAt,l=s.immediateRender,u=s.lazy,d=s.onUpdate,f=s.runBackwards,h=s.yoyoEase,g=s.keyframes,v=s.autoRevert,x=e._dur,_=e._startAt,w=e._targets,S=e.parent,k=S&&S.data==="nested"?S.vars.targets:w,E=e._overwrite==="auto"&&!x6,P=e.timeline,T=s.easeReverse||h,I,M,R,O,D,$,V,q,B,K,z,X,Z;if(P&&(!g||!i)&&(i="none"),e._ease=vc(i,$h.ease),e._rEase=T&&(vc(T)||e._ease),e._from=!P&&!!s.runBackwards,e._from&&(e.ratio=1),!P||g&&!s.stagger){if(q=w[0]?mc(w[0]).harness:0,X=q&&s[q.prop],I=Rg(s,E6),_&&(_._zTime<0&&_.progress(1),n<0&&f&&l&&!v?_.render(-1,!0):_.revert(f&&x?_m:_re),_._lazy=0),o){if(tl(e._startAt=Zn.set(w,Rs({data:"isStart",overwrite:!1,parent:S,immediateRender:!0,lazy:!_&&os(u),startAt:null,delay:0,onUpdate:d&&function(){return Ss(e,"onUpdate")},stagger:0},o))),e._startAt._dp=0,e._startAt._sat=e,n<0&&(_r||!l&&!v)&&e._startAt.revert(_m),l&&x&&n<=0&&r<=0){n&&(e._zTime=n);return}}else if(f&&x&&!_){if(n&&(l=!1),R=Rs({overwrite:!1,data:"isFromStart",lazy:l&&!_&&os(u),immediateRender:l,stagger:0,parent:S},I),X&&(R[q.prop]=X),tl(e._startAt=Zn.set(w,R)),e._startAt._dp=0,e._startAt._sat=e,n<0&&(_r?e._startAt.revert(_m):e._startAt.render(-1,!0)),e._zTime=n,!l)t(e._startAt,Kt,Kt);else if(!n)return}for(e._pt=e._ptCache=0,u=x&&os(u)||u&&!x,M=0;M<w.length;M++){if(D=w[M],V=D._gsap||A6(w)[M]._gsap,e._ptLookup[M]=K={},lx[V.id]&&Za.length&&Tg(),z=k===w?M:k.indexOf(D),q&&(B=new q).init(D,X||I,e,z,k)!==!1&&(e._pt=O=new ls(e._pt,D,B.name,0,1,B.render,B,0,B.priority),B._props.forEach(function(J){K[J]=O}),B.priority&&($=1)),!q||X)for(R in I)_s[R]&&(B=NL(R,I,e,z,D,k))?B.priority&&($=1):K[R]=O=R6.call(e,D,R,"get",I[R],z,k,0,s.stringFilter);e._op&&e._op[M]&&e.kill(D,e._op[M]),E&&e._pt&&(Va=e,bn.killTweensOf(D,K,e.globalTime(n)),Z=!e.parent,Va=0),e._pt&&u&&(lx[V.id]=1)}$&&HL(e),e._onInit&&e._onInit(e)}e._onUpdate=d,e._initted=(!e._op||e._pt)&&!Z,g&&n<=0&&P.render(Gs,!0,!0)},qre=function(e,n,r,s,i,o,l,u){var d=(e._pt&&e._ptCache||(e._ptCache={}))[n],f,h,g,v;if(!d)for(d=e._ptCache[n]=[],g=e._ptLookup,v=e._targets.length;v--;){if(f=g[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 px=1,e.vars[n]="+=0",M6(e,l),px=0,u?Fh(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=Nn(r)+Tr(h.e)),h.b&&(h.b=f.s+Tr(h.b))},Gre=function(e,n){var r=e[0]?mc(e[0]).harness:0,s=r&&r.aliases,i,o,l,u;if(!s)return n;i=Sd({},n);for(o in s)if(o in i)for(u=s[o].split(","),l=u.length;l--;)i[u[l]]=i[o];return i},Kre=function(e,n,r,s){var i=n.ease||s||"power1.inOut",o,l;if(Ir(n))l=r[e]||(r[e]=[]),n.forEach(function(u,d){return l.push({t:d/(n.length-1)*100,v:u,e:i})});else for(o in n)l=r[o]||(r[o]=[]),o==="ease"||l.push({t:parseFloat(e),v:n[o],e:i})},lh=function(e,n,r,s,i){return Tn(e)?e.call(n,r,s,i):cr(e)&&~e.indexOf("random(")?Hh(e):e},DL=P6+"repeat,repeatDelay,yoyo,repeatRefresh,yoyoEase,easeReverse,autoRevert",jL={};as(DL+",id,stagger,delay,duration,paused,scrollTrigger",function(t){return jL[t]=1});var Zn=(function(t){sL(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:oh(s))||this;var u=l.vars,d=u.duration,f=u.delay,h=u.immediateRender,g=u.stagger,v=u.overwrite,x=u.keyframes,_=u.defaults,w=u.scrollTrigger,S=s.parent||bn,k=(Ir(r)||oL(r)?Yo(r[0]):"length"in s)?[r]:Ks(r),E,P,T,I,M,R,O,D;if(l._targets=k.length?A6(k):Fh("GSAP target "+r+" not found. https://gsap.com",!Ps.nullTargetWarn)||[],l._ptLookup=[],l._overwrite=v,x||g||W0(d)||W0(f)){s=l.vars;var $=s.easeReverse||s.yoyoEase;if(E=l.timeline=new rs({data:"nested",defaults:_||{},targets:S&&S.data==="nested"?S.vars.targets:k}),E.kill(),E.parent=E._dp=Mo(l),E._start=0,g||W0(d)||W0(f)){if(I=k.length,O=g&&SL(g),so(g))for(M in g)~DL.indexOf(M)&&(D||(D={}),D[M]=g[M]);for(P=0;P<I;P++)T=Rg(s,jL),T.stagger=0,$&&(T.easeReverse=$),D&&Sd(T,D),R=k[P],T.duration=+lh(d,Mo(l),P,R,k),T.delay=(+lh(f,Mo(l),P,R,k)||0)-l._delay,!g&&I===1&&T.delay&&(l._delay=f=T.delay,l._start+=f,T.delay=0),E.to(R,T,O?O(P,R,k):0),E._ease=kt.none;E.duration()?d=f=0:l.timeline=0}else if(x){oh(Rs(E.vars.defaults,{ease:"none"})),E._ease=vc(x.ease||s.ease||"none");var V=0,q,B,K;if(Ir(x))x.forEach(function(z){return E.to(k,z,">")}),E.duration();else{T={};for(M in x)M==="ease"||M==="easeEach"||Kre(M,x[M],T,x.easeEach);for(M in T)for(q=T[M].sort(function(z,X){return z.t-X.t}),V=0,P=0;P<q.length;P++)B=q[P],K={ease:B.e,duration:(B.t-(P?q[P-1].t:0))/100*d},K[M]=B.v,E.to(k,K,V),V+=K.duration;E.duration()<d&&E.to({},{duration:d-E.duration()})}}d||l.duration(d=E.duration())}else l.timeline=0;return v===!0&&!x6&&(Va=Mo(l),bn.killTweensOf(k),Va=0),Wi(S,Mo(l),i),s.reversed&&l.reverse(),s.paused&&l.paused(!0),(h||!d&&!x&&l._start===wn(S._time)&&os(h)&&Cre(Mo(l))&&S.data!=="nested")&&(l._tTime=-Kt,l.render(Math.max(0,-f)||0)),w&&_L(Mo(l),w),l}var n=e.prototype;return n.render=function(s,i,o){var l=this._time,u=this._tDur,d=this._dur,f=s<0,h=s>u-Kt&&!f?u:s<Kt?0:s,g,v,x,_,w,S,k,E;if(!d)Pre(this,s,i,o);else if(h!==this._tTime||!s||o||!this._initted&&this._tTime||this._startAt&&this._zTime<0!==f||this._lazy){if(g=h,E=this.timeline,this._repeat){if(_=d+this._rDelay,this._repeat<-1&&f)return this.totalTime(_*100+s,i,o);if(g=wn(h%_),h===u?(x=this._repeat,g=d):(w=wn(h/_),x=~~w,x&&x===w?(g=d,x--):g>d&&(g=d)),S=this._yoyo&&x&1,S&&(g=d-g),w=kd(this._tTime,_),g===l&&!o&&this._initted&&x===w)return this._tTime=h,this;x!==w&&this.vars.repeatRefresh&&!S&&!this._lock&&g!==_&&this._initted&&(this._lock=o=1,this.render(wn(_*x),!0).invalidate()._lock=0)}if(!this._initted){if(wL(this,f?s:g,o,i,h))return this._tTime=0,this;if(l!==this._time&&!(o&&this.vars.repeatRefresh&&x!==w))return this;if(d!==this._dur)return this.render(s,i,o)}if(this._rEase){var P=g<l;if(P!==this._inv){var T=P?l:d-l;this._inv=P,this._from&&(this.ratio=1-this.ratio),this._invRatio=this.ratio,this._invTime=l,this._invRecip=T?(P?-1:1)/T:0,this._invScale=P?-this.ratio:1-this.ratio,this._invEase=P?this._rEase:this._ease}this.ratio=k=this._invRatio+this._invScale*this._invEase((g-this._invTime)*this._invRecip)}else this.ratio=k=this._ease(g/d);if(this._from&&(this.ratio=k=1-k),this._tTime=h,this._time=g,!this._act&&this._ts&&(this._act=1,this._lazy=0),!l&&h&&!i&&!w&&(Ss(this,"onStart"),this._tTime!==h))return this;for(v=this._pt;v;)v.r(k,v.d),v=v._next;E&&E.render(s<0?s:E._dur*E._ease(g/this._dur),i,o)||this._startAt&&(this._zTime=s),this._onUpdate&&!i&&(f&&cx(this,s,i,o),Ss(this,"onUpdate")),this._repeat&&x!==w&&this.vars.onRepeat&&!i&&this.parent&&Ss(this,"onRepeat"),(h===this._tDur||!h)&&this._tTime===h&&(f&&!this._onUpdate&&cx(this,s,!0,!0),(s||!d)&&(h===this._tDur&&this._ts>0||!h&&this._ts<0)&&tl(this,1),!i&&!(f&&!l)&&(h||l||S)&&(Ss(this,h===u?"onComplete":"onReverseComplete",!0),this._prom&&!(h<u&&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,u){zh||bs.wake(),this._ts||this.play();var d=Math.min(this._dur,(this._dp._time-this._start)*this._ts),f;return this._initted||M6(this,d),f=this._ease(d/this._dur),qre(this,s,i,o,l,f,d,u)?this.resetTo(s,i,o,l,1):(xv(this,0),this.parent||vL(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?Vf(this):this.scrollTrigger&&this.scrollTrigger.kill(!!_r),this;if(this.timeline){var o=this.timeline.totalDuration();return this.timeline.killTweensOf(s,i,Va&&Va.vars.overwrite!==!0)._first||Vf(this),this.parent&&o!==this.timeline.totalDuration()&&Cd(this,this._dur*this.timeline._tDur/o,0,1),this}var l=this._targets,u=s?Ks(s):l,d=this._ptLookup,f=this._pt,h,g,v,x,_,w,S;if((!i||i==="all")&&Sre(l,u))return i==="all"&&(this._pt=0),Vf(this);for(h=this._op=this._op||[],i!=="all"&&(cr(i)&&(_={},as(i,function(k){return _[k]=1}),i=_),i=Gre(l,i)),S=l.length;S--;)if(~u.indexOf(l[S])){g=d[S],i==="all"?(h[S]=i,x=g,v={}):(v=h[S]=h[S]||{},x=i);for(_ in x)w=g&&g[_],w&&((!("kill"in w.d)||w.d.kill(_)===!0)&&_v(this,w,"_pt"),delete g[_]),v!=="all"&&(v[_]=1)}return this._initted&&!this._pt&&f&&Vf(this),this},e.to=function(s,i){return new e(s,i,arguments[2])},e.from=function(s,i){return ah(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 ah(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 bn.killTweensOf(s,i,o)},e})(Uh);Rs(Zn.prototype,{_targets:[],_lazy:0,_startAt:0,_op:0,_onInit:0});as("staggerTo,staggerFrom,staggerFromTo",function(t){Zn[t]=function(){var e=new rs,n=dx.call(arguments,0);return n.splice(t==="staggerFromTo"?5:4,0,0),e[t].apply(e,n)}});var I6=function(e,n,r){return e[n]=r},$L=function(e,n,r){return e[n](r)},Yre=function(e,n,r,s){return e[n](s.fp,r)},Qre=function(e,n,r){return e.setAttribute(n,r)},O6=function(e,n){return Tn(e[n])?$L:b6(e[n])&&e.setAttribute?Qre:I6},FL=function(e,n){return n.set(n.t,n.p,Math.round((n.s+n.c*e)*1e6)/1e6,n)},Xre=function(e,n){return n.set(n.t,n.p,!!(n.s+n.c*e),n)},VL=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)},L6=function(e,n){for(var r=n._pt;r;)r.r(e,r.d),r=r._next},Jre=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},ese=function(e){for(var n=this._pt,r,s;n;)s=n._next,n.p===e&&!n.op||n.op===e?_v(this,n,"_pt"):n.dep||(r=1),n=s;return!r},tse=function(e,n,r,s){s.mSet(e,n,s.m.call(s.tween,r,s.mt),s)},HL=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},ls=(function(){function t(n,r,s,i,o,l,u,d,f){this.t=r,this.s=i,this.c=o,this.p=s,this.r=l||FL,this.d=u||this,this.set=d||I6,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=tse,this.m=r,this.mt=i,this.tween=s},t})();as(P6+"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 E6[t]=1});Ts.TweenMax=Ts.TweenLite=Zn;Ts.TimelineLite=Ts.TimelineMax=rs;bn=new rs({sortChildren:!1,defaults:$h,autoRemoveChildren:!0,id:"root",smoothChildTiming:!0});Ps.stringFilter=IL;var yc=[],xm={},nse=[],k5=0,rse=0,G_=function(e){return(xm[e]||nse).map(function(n){return n()})},mx=function(){var e=Date.now(),n=[];e-k5>2&&(G_("matchMediaInit"),yc.forEach(function(r){var s=r.queries,i=r.conditions,o,l,u,d;for(l in s)o=Vi.matchMedia(s[l]).matches,o&&(u=1),o!==i[l]&&(i[l]=o,d=1);d&&(r.revert(),u&&n.push(r))}),G_("matchMediaRevert"),n.forEach(function(r){return r.onMatch(r,function(s){return r.add(null,s)})}),k5=e,G_("matchMedia"))},zL=(function(){function t(n,r){this.selector=r&&fx(r),this.data=[],this._r=[],this.isReverted=!1,this.id=rse++,n&&this.add(n)}var e=t.prototype;return e.add=function(r,s,i){Tn(r)&&(i=s,s=r,r=Tn);var o=this,l=function(){var d=fn,f=o.selector,h;return d&&d!==o&&d.data.push(o),i&&(o.selector=fx(i)),fn=o,h=s.apply(o,arguments),Tn(h)&&o._r.push(h),fn=d,o.selector=f,o.isReverted=!1,h};return o.last=l,r===Tn?l(o,function(u){return o.add(null,u)}):r?o[r]=l:l},e.ignore=function(r){var s=fn;fn=null,r(this),fn=s},e.getTweens=function(){var r=[];return this.data.forEach(function(s){return s instanceof t?r.push.apply(r,s.getTweens()):s instanceof Zn&&!(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(),u=i.data.length,d;u--;)d=i.data[u],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)}),u=i.data.length;u--;)d=i.data[u],d instanceof rs?d.data!=="nested"&&(d.scrollTrigger&&d.scrollTrigger.revert(),d.kill()):!(d instanceof Zn)&&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=yc.length;o--;)yc[o].id===this.id&&yc.splice(o,1)},e.revert=function(r){this.kill(r||{})},t})(),sse=(function(){function t(n){this.contexts=[],this.scope=n,fn&&fn.data.push(this)}var e=t.prototype;return e.add=function(r,s,i){so(r)||(r={matches:r});var o=new zL(0,i||this.scope),l=o.conditions={},u,d,f;fn&&!o.selector&&(o.selector=fn.selector),this.contexts.push(o),s=o.add("onMatch",s),o.queries=r;for(d in r)d==="all"?f=1:(u=Vi.matchMedia(r[d]),u&&(yc.indexOf(o)<0&&yc.push(o),(l[d]=u.matches)&&(f=1),u.addListener?u.addListener(mx):u.addEventListener("change",mx)));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})(),Ig={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 TL(s)})},timeline:function(e){return new rs(e)},getTweensOf:function(e,n){return bn.getTweensOf(e,n)},getProperty:function(e,n,r,s){cr(e)&&(e=Ks(e)[0]);var i=mc(e||{}).get,o=r?gL:mL;return r==="native"&&(r=""),e&&(n?o((_s[n]&&_s[n].get||i)(e,n,r,s)):function(l,u,d){return o((_s[l]&&_s[l].get||i)(e,l,u,d))})},quickSetter:function(e,n,r){if(e=Ks(e),e.length>1){var s=e.map(function(f){return us.quickSetter(f,n,r)}),i=s.length;return function(f){for(var h=i;h--;)s[h](f)}}e=e[0]||{};var o=_s[n],l=mc(e),u=l.harness&&(l.harness.aliases||{})[n]||n,d=o?function(f){var h=new o;Du._pt=0,h.init(e,r?f+r:f,Du,0,[e]),h.render(1,h),Du._pt&&L6(1,Du)}:l.set(e,u);return o?d:function(f){return d(e,u,r?f+r:f,l,1)}},quickTo:function(e,n,r){var s,i=us.to(e,Rs((s={},s[n]="+=0.1",s.paused=!0,s.stagger=0,s),r||{})),o=function(u,d,f){return i.resetTo(n,u,d,f)};return o.tween=i,o},isTweening:function(e){return bn.getTweensOf(e,!0).length>0},defaults:function(e){return e&&e.ease&&(e.ease=vc(e.ease,$h.ease)),_5($h,e||{})},config:function(e){return _5(Ps,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&&!_s[l]&&!Ts[l]&&Fh(n+" effect requires "+l+" plugin.")}),B_[n]=function(l,u,d){return r(Ks(l),Rs(u||{},i),d)},o&&(rs.prototype[n]=function(l,u,d){return this.add(B_[n](l,so(u)?u:(d=u)&&{},this),d)})},registerEase:function(e,n){kt[e]=vc(n)},parseEase:function(e,n){return arguments.length?vc(e,n):kt},getById:function(e){return bn.getById(e)},exportRoot:function(e,n){e===void 0&&(e={});var r=new rs(e),s,i;for(r.smoothChildTiming=os(e.smoothChildTiming),bn.remove(r),r._dp=0,r._time=r._tTime=bn._time,s=bn._first;s;)i=s._next,(n||!(!s._dur&&s instanceof Zn&&s.vars.onComplete===s._targets[0]))&&Wi(r,s,s._start-s._delay),s=i;return Wi(bn,r,0),r},context:function(e,n){return e?new zL(e,n):fn},matchMedia:function(e){return new sse(e)},matchMediaRefresh:function(){return yc.forEach(function(e){var n=e.conditions,r,s;for(s in n)n[s]&&(n[s]=!1,r=1);r&&e.revert()})||mx()},addEventListener:function(e,n){var r=xm[e]||(xm[e]=[]);~r.indexOf(n)||r.push(n)},removeEventListener:function(e,n){var r=xm[e],s=r&&r.indexOf(n);s>=0&&r.splice(s,1)},utils:{wrap:Nre,wrapYoyo:Dre,distribute:SL,random:CL,snap:kL,normalize:Lre,getUnit:Tr,clamp:Rre,splitColor:RL,toArray:Ks,selector:fx,mapRange:PL,pipe:Ire,unitize:Ore,interpolate:jre,shuffle:bL},install:uL,effects:B_,ticker:bs,updateRoot:rs.updateRoot,plugins:_s,globalTimeline:bn,core:{PropTween:ls,globals:dL,Tween:Zn,Timeline:rs,Animation:Uh,getCache:mc,_removeLinkedListItem:_v,reverting:function(){return _r},context:function(e){return e&&fn&&(fn.data.push(e),e._ctx=fn),fn},suppressOverwrites:function(e){return x6=e}}};as("to,from,fromTo,delayedCall,set,killTweensOf",function(t){return Ig[t]=Zn[t]});bs.add(rs.updateRoot);Du=Ig.to({},{duration:0});var ise=function(e,n){for(var r=e._pt;r&&r.p!==n&&r.op!==n&&r.fp!==n;)r=r._next;return r},ose=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=ise(o,s)),o&&o.modifier&&o.modifier(n[s],e,r[i],s))},K_=function(e,n){return{name:e,headless:1,rawVars:1,init:function(s,i,o){o._onInit=function(l){var u,d;if(cr(i)&&(u={},as(i,function(f){return u[f]=1}),i=u),n){u={};for(d in i)u[d]=n(i[d]);i=u}ose(l,i)}}}},us=Ig.registerPlugin({name:"attr",init:function(e,n,r,s,i){var o,l,u;this.tween=r;for(o in n)u=e.getAttribute(o)||"",l=this.add(e,"setAttribute",(u||0)+"",n[o],s,i,0,0,o),l.op=o,l.b=u,this._props.push(o)},render:function(e,n){for(var r=n._pt;r;)_r?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)}},K_("roundProps",hx),K_("modifiers"),K_("snap",kL))||Ig;Zn.version=rs.version=us.version="3.15.0";cL=1;S6()&&Ed();kt.Power0;kt.Power1;kt.Power2;kt.Power3;kt.Power4;kt.Linear;kt.Quad;kt.Cubic;kt.Quart;kt.Quint;kt.Strong;kt.Elastic;kt.Back;kt.SteppedEase;kt.Bounce;kt.Sine;kt.Expo;kt.Circ;/*!
|
|
149
|
+
* CSSPlugin 3.15.0
|
|
150
|
+
* https://gsap.com
|
|
151
|
+
*
|
|
152
|
+
* Copyright 2008-2026, GreenSock. All rights reserved.
|
|
153
|
+
* Subject to the terms at https://gsap.com/standard-license
|
|
154
|
+
* @author: Jack Doyle, jack@greensock.com
|
|
155
|
+
*/var C5,Ha,Bu,N6,Jl,E5,D6,ase=function(){return typeof window<"u"},Qo={},Kl=180/Math.PI,Zu=Math.PI/180,Su=Math.atan2,P5=1e8,j6=/([A-Z])/g,lse=/(left|right|width|margin|padding|x)/i,cse=/[\s,\(]\S/,Ki={autoAlpha:"opacity,visibility",scale:"scaleX,scaleY",alpha:"opacity"},gx=function(e,n){return n.set(n.t,n.p,Math.round((n.s+n.c*e)*1e4)/1e4+n.u,n)},use=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)},dse=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)},fse=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)},hse=function(e,n){var r=n.s+n.c*e;n.set(n.t,n.p,~~(r+(r<0?-.5:.5))+n.u,n)},UL=function(e,n){return n.set(n.t,n.p,e?n.e:n.b,n)},BL=function(e,n){return n.set(n.t,n.p,e!==1?n.b:n.e,n)},pse=function(e,n,r){return e.style[n]=r},mse=function(e,n,r){return e.style.setProperty(n,r)},gse=function(e,n,r){return e._gsap[n]=r},vse=function(e,n,r){return e._gsap.scaleX=e._gsap.scaleY=r},yse=function(e,n,r,s,i){var o=e._gsap;o.scaleX=o.scaleY=r,o.renderTransform(i,o)},_se=function(e,n,r,s,i){var o=e._gsap;o[n]=r,o.renderTransform(i,o)},Sn="transform",cs=Sn+"Origin",wse=function t(e,n){var r=this,s=this.target,i=s.style,o=s._gsap;if(e in Qo&&i){if(this.tfm=this.tfm||{},e!=="transform")e=Ki[e]||e,~e.indexOf(",")?e.split(",").forEach(function(l){return r.tfm[l]=Io(s,l)}):this.tfm[e]=o.x?o[e]:Io(s,e),e===cs&&(this.tfm.zOrigin=o.zOrigin);else return Ki.transform.split(",").forEach(function(l){return t.call(r,l,n)});if(this.props.indexOf(Sn)>=0)return;o.svg&&(this.svgo=s.getAttribute("data-svg-origin"),this.props.push(cs,n,"")),e=Sn}(i||n)&&this.props.push(e,n,i[e])},ZL=function(e){e.translate&&(e.removeProperty("translate"),e.removeProperty("scale"),e.removeProperty("rotate"))},xse=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(j6,"-$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[Sn]&&(ZL(r),s.zOrigin&&r[cs]&&(r[cs]+=" "+s.zOrigin+"px",s.zOrigin=0,s.renderTransform()),s.uncache=1)}},WL=function(e,n){var r={target:e,props:[],revert:xse,save:wse};return e._gsap||us.core.getCache(e),n&&e.style&&e.nodeType&&n.split(",").forEach(function(s){return r.save(s)}),r},qL,vx=function(e,n){var r=Ha.createElementNS?Ha.createElementNS((n||"http://www.w3.org/1999/xhtml").replace(/^https/,"http"),e):Ha.createElement(e);return r&&r.style?r:Ha.createElement(e)},ks=function t(e,n,r){var s=getComputedStyle(e);return s[n]||s.getPropertyValue(n.replace(j6,"-$1").toLowerCase())||s.getPropertyValue(n)||!r&&t(e,Pd(n)||n,1)||""},A5="O,Moz,ms,Ms,Webkit".split(","),Pd=function(e,n,r){var s=n||Jl,i=s.style,o=5;if(e in i&&!r)return e;for(e=e.charAt(0).toUpperCase()+e.substr(1);o--&&!(A5[o]+e in i););return o<0?null:(o===3?"ms":o>=0?A5[o]:"")+e},yx=function(){ase()&&window.document&&(C5=window,Ha=C5.document,Bu=Ha.documentElement,Jl=vx("div")||{style:{}},vx("div"),Sn=Pd(Sn),cs=Sn+"Origin",Jl.style.cssText="border-width:0;line-height:0;position:absolute;padding:0",qL=!!Pd("perspective"),D6=us.core.reverting,N6=1)},T5=function(e){var n=e.ownerSVGElement,r=vx("svg",n&&n.getAttribute("xmlns")||"http://www.w3.org/2000/svg"),s=e.cloneNode(!0),i;s.style.display="block",r.appendChild(s),Bu.appendChild(r);try{i=s.getBBox()}catch{}return r.removeChild(s),Bu.removeChild(r),i},R5=function(e,n){for(var r=n.length;r--;)if(e.hasAttribute(n[r]))return e.getAttribute(n[r])},GL=function(e){var n,r;try{n=e.getBBox()}catch{n=T5(e),r=1}return n&&(n.width||n.height)||r||(n=T5(e)),n&&!n.width&&!n.x&&!n.y?{x:+R5(e,["x","cx","x1"])||0,y:+R5(e,["y","cy","y1"])||0,width:0,height:0}:n},KL=function(e){return!!(e.getCTM&&(!e.parentNode||e.ownerSVGElement)&&GL(e))},nl=function(e,n){if(n){var r=e.style,s;n in Qo&&n!==cs&&(n=Sn),r.removeProperty?(s=n.substr(0,2),(s==="ms"||n.substr(0,6)==="webkit")&&(n="-"+n),r.removeProperty(s==="--"?n:n.replace(j6,"-$1").toLowerCase())):r.removeAttribute(n)}},za=function(e,n,r,s,i,o){var l=new ls(e._pt,n,r,0,1,o?BL:UL);return e._pt=l,l.b=s,l.e=i,e._props.push(r),l},M5={deg:1,rad:1,turn:1},bse={grid:1,flex:1},rl=function t(e,n,r,s){var i=parseFloat(r)||0,o=(r+"").trim().substr((i+"").length)||"px",l=Jl.style,u=lse.test(n),d=e.tagName.toLowerCase()==="svg",f=(d?"client":"offset")+(u?"Width":"Height"),h=100,g=s==="px",v=s==="%",x,_,w,S;if(s===o||!i||M5[s]||M5[o])return i;if(o!=="px"&&!g&&(i=t(e,n,r,"px")),S=e.getCTM&&KL(e),(v||o==="%")&&(Qo[n]||~n.indexOf("adius")))return x=S?e.getBBox()[u?"width":"height"]:e[f],Nn(v?i/x*h:i/100*x);if(l[u?"width":"height"]=h+(g?o:s),_=s!=="rem"&&~n.indexOf("adius")||s==="em"&&e.appendChild&&!d?e:e.parentNode,S&&(_=(e.ownerSVGElement||{}).parentNode),(!_||_===Ha||!_.appendChild)&&(_=Ha.body),w=_._gsap,w&&v&&w.width&&u&&w.time===bs.time&&!w.uncache)return Nn(i/w.width*h);if(v&&(n==="height"||n==="width")){var k=e.style[n];e.style[n]=h+s,x=e[f],k?e.style[n]=k:nl(e,n)}else(v||o==="%")&&!bse[ks(_,"display")]&&(l.position=ks(e,"position")),_===e&&(l.position="static"),_.appendChild(Jl),x=Jl[f],_.removeChild(Jl),l.position="absolute";return u&&v&&(w=mc(_),w.time=bs.time,w.width=_[f]),Nn(g?x*i/h:x&&i?h/x*i:0)},Io=function(e,n,r,s){var i;return N6||yx(),n in Ki&&n!=="transform"&&(n=Ki[n],~n.indexOf(",")&&(n=n.split(",")[0])),Qo[n]&&n!=="transform"?(i=Zh(e,s),i=n!=="transformOrigin"?i[n]:i.svg?i.origin:Lg(ks(e,cs))+" "+i.zOrigin+"px"):(i=e.style[n],(!i||i==="auto"||s||~(i+"").indexOf("calc("))&&(i=Og[n]&&Og[n](e,n,r)||ks(e,n)||hL(e,n)||(n==="opacity"?1:0))),r&&!~(i+"").trim().indexOf(" ")?rl(e,n,i,r)+r:i},Sse=function(e,n,r,s){if(!r||r==="none"){var i=Pd(n,e,1),o=i&&ks(e,i,1);o&&o!==r?(n=i,r=o):n==="borderColor"&&(r=ks(e,"borderTopColor"))}var l=new ls(this._pt,e.style,n,0,1,VL),u=0,d=0,f,h,g,v,x,_,w,S,k,E,P,T;if(l.b=r,l.e=s,r+="",s+="",s.substring(0,6)==="var(--"&&(s=ks(e,s.substring(4,s.indexOf(")")))),s==="auto"&&(_=e.style[n],e.style[n]=s,s=ks(e,n)||s,_?e.style[n]=_:nl(e,n)),f=[r,s],IL(f),r=f[0],s=f[1],g=r.match(Nu)||[],T=s.match(Nu)||[],T.length){for(;h=Nu.exec(s);)w=h[0],k=s.substring(u,h.index),x?x=(x+1)%5:(k.substr(-5)==="rgba("||k.substr(-5)==="hsla(")&&(x=1),w!==(_=g[d++]||"")&&(v=parseFloat(_)||0,P=_.substr((v+"").length),w.charAt(1)==="="&&(w=Uu(v,w)+P),S=parseFloat(w),E=w.substr((S+"").length),u=Nu.lastIndex-E.length,E||(E=E||Ps.units[n]||P,u===s.length&&(s+=E,l.e+=E)),P!==E&&(v=rl(e,n,_,E)||0),l._pt={_next:l._pt,p:k||d===1?k:",",s:v,c:S-v,m:x&&x<4||n==="zIndex"?Math.round:0});l.c=u<s.length?s.substring(u,s.length):""}else l.r=n==="display"&&s==="none"?BL:UL;return lL.test(s)&&(l.e=0),this._pt=l,l},I5={top:"0%",bottom:"100%",left:"0%",right:"100%",center:"50%"},kse=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]=I5[r]||r,n[1]=I5[s]||s,n.join(" ")},Cse=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,u,d;if(i==="all"||i===!0)s.cssText="",u=1;else for(i=i.split(","),d=i.length;--d>-1;)l=i[d],Qo[l]&&(u=1,l=l==="transformOrigin"?cs:Sn),nl(r,l);u&&(nl(r,Sn),o&&(o.svg&&r.removeAttribute("transform"),s.scale=s.rotate=s.translate="none",Zh(r,1),o.uncache=1,ZL(s)))}},Og={clearProps:function(e,n,r,s,i){if(i.data!=="isFromStart"){var o=e._pt=new ls(e._pt,n,r,0,0,Cse);return o.u=s,o.pr=-10,o.tween=i,e._props.push(r),1}}},Bh=[1,0,0,1,0,0],YL={},QL=function(e){return e==="matrix(1, 0, 0, 1, 0, 0)"||e==="none"||!e},O5=function(e){var n=ks(e,Sn);return QL(n)?Bh:n.substr(7).match(aL).map(Nn)},$6=function(e,n){var r=e._gsap||mc(e),s=e.style,i=O5(e),o,l,u,d;return r.svg&&e.getAttribute("transform")?(u=e.transform.baseVal.consolidate().matrix,i=[u.a,u.b,u.c,u.d,u.e,u.f],i.join(",")==="1,0,0,1,0,0"?Bh:i):(i===Bh&&!e.offsetParent&&e!==Bu&&!r.svg&&(u=s.display,s.display="block",o=e.parentNode,(!o||!e.offsetParent&&!e.getBoundingClientRect().width)&&(d=1,l=e.nextElementSibling,Bu.appendChild(e)),i=O5(e),u?s.display=u:nl(e,"display"),d&&(l?o.insertBefore(e,l):o?o.appendChild(e):Bu.removeChild(e))),n&&i.length>6?[i[0],i[1],i[4],i[5],i[12],i[13]]:i)},_x=function(e,n,r,s,i,o){var l=e._gsap,u=i||$6(e,!0),d=l.xOrigin||0,f=l.yOrigin||0,h=l.xOffset||0,g=l.yOffset||0,v=u[0],x=u[1],_=u[2],w=u[3],S=u[4],k=u[5],E=n.split(" "),P=parseFloat(E[0])||0,T=parseFloat(E[1])||0,I,M,R,O;r?u!==Bh&&(M=v*w-x*_)&&(R=P*(w/M)+T*(-_/M)+(_*k-w*S)/M,O=P*(-x/M)+T*(v/M)-(v*k-x*S)/M,P=R,T=O):(I=GL(e),P=I.x+(~E[0].indexOf("%")?P/100*I.width:P),T=I.y+(~(E[1]||E[0]).indexOf("%")?T/100*I.height:T)),s||s!==!1&&l.smooth?(S=P-d,k=T-f,l.xOffset=h+(S*v+k*_)-S,l.yOffset=g+(S*x+k*w)-k):l.xOffset=l.yOffset=0,l.xOrigin=P,l.yOrigin=T,l.smooth=!!s,l.origin=n,l.originIsAbsolute=!!r,e.style[cs]="0px 0px",o&&(za(o,l,"xOrigin",d,P),za(o,l,"yOrigin",f,T),za(o,l,"xOffset",h,l.xOffset),za(o,l,"yOffset",g,l.yOffset)),e.setAttribute("data-svg-origin",P+" "+T)},Zh=function(e,n){var r=e._gsap||new LL(e);if("x"in r&&!n&&!r.uncache)return r;var s=e.style,i=r.scaleX<0,o="px",l="deg",u=getComputedStyle(e),d=ks(e,cs)||"0",f,h,g,v,x,_,w,S,k,E,P,T,I,M,R,O,D,$,V,q,B,K,z,X,Z,J,H,N,Y,ae,se,ie;return f=h=g=_=w=S=k=E=P=0,v=x=1,r.svg=!!(e.getCTM&&KL(e)),u.translate&&((u.translate!=="none"||u.scale!=="none"||u.rotate!=="none")&&(s[Sn]=(u.translate!=="none"?"translate3d("+(u.translate+" 0 0").split(" ").slice(0,3).join(", ")+") ":"")+(u.rotate!=="none"?"rotate("+u.rotate+") ":"")+(u.scale!=="none"?"scale("+u.scale.split(" ").join(",")+") ":"")+(u[Sn]!=="none"?u[Sn]:"")),s.scale=s.rotate=s.translate="none"),M=$6(e,r.svg),r.svg&&(r.uncache?(Z=e.getBBox(),d=r.xOrigin-Z.x+"px "+(r.yOrigin-Z.y)+"px",X=""):X=!n&&e.getAttribute("data-svg-origin"),_x(e,X||d,!!X||r.originIsAbsolute,r.smooth!==!1,M)),T=r.xOrigin||0,I=r.yOrigin||0,M!==Bh&&($=M[0],V=M[1],q=M[2],B=M[3],f=K=M[4],h=z=M[5],M.length===6?(v=Math.sqrt($*$+V*V),x=Math.sqrt(B*B+q*q),_=$||V?Su(V,$)*Kl:0,k=q||B?Su(q,B)*Kl+_:0,k&&(x*=Math.abs(Math.cos(k*Zu))),r.svg&&(f-=T-(T*$+I*q),h-=I-(T*V+I*B))):(ie=M[6],ae=M[7],H=M[8],N=M[9],Y=M[10],se=M[11],f=M[12],h=M[13],g=M[14],R=Su(ie,Y),w=R*Kl,R&&(O=Math.cos(-R),D=Math.sin(-R),X=K*O+H*D,Z=z*O+N*D,J=ie*O+Y*D,H=K*-D+H*O,N=z*-D+N*O,Y=ie*-D+Y*O,se=ae*-D+se*O,K=X,z=Z,ie=J),R=Su(-q,Y),S=R*Kl,R&&(O=Math.cos(-R),D=Math.sin(-R),X=$*O-H*D,Z=V*O-N*D,J=q*O-Y*D,se=B*D+se*O,$=X,V=Z,q=J),R=Su(V,$),_=R*Kl,R&&(O=Math.cos(R),D=Math.sin(R),X=$*O+V*D,Z=K*O+z*D,V=V*O-$*D,z=z*O-K*D,$=X,K=Z),w&&Math.abs(w)+Math.abs(_)>359.9&&(w=_=0,S=180-S),v=Nn(Math.sqrt($*$+V*V+q*q)),x=Nn(Math.sqrt(z*z+ie*ie)),R=Su(K,z),k=Math.abs(R)>2e-4?R*Kl:0,P=se?1/(se<0?-se:se):0),r.svg&&(X=e.getAttribute("transform"),r.forceCSS=e.setAttribute("transform","")||!QL(ks(e,Sn)),X&&e.setAttribute("transform",X))),Math.abs(k)>90&&Math.abs(k)<270&&(i?(v*=-1,k+=_<=0?180:-180,_+=_<=0?180:-180):(x*=-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=g+o,r.scaleX=Nn(v),r.scaleY=Nn(x),r.rotation=Nn(_)+l,r.rotationX=Nn(w)+l,r.rotationY=Nn(S)+l,r.skewX=k+l,r.skewY=E+l,r.transformPerspective=P+o,(r.zOrigin=parseFloat(d.split(" ")[2])||!n&&r.zOrigin||0)&&(s[cs]=Lg(d)),r.xOffset=r.yOffset=0,r.force3D=Ps.force3D,r.renderTransform=r.svg?Pse:qL?XL:Ese,r.uncache=0,r},Lg=function(e){return(e=e.split(" "))[0]+" "+e[1]},Y_=function(e,n,r){var s=Tr(n);return Nn(parseFloat(n)+parseFloat(rl(e,"x",r+"px",s)))+s},Ese=function(e,n){n.z="0px",n.rotationY=n.rotationX="0deg",n.force3D=0,XL(e,n)},zl="0deg",Rf="0px",Ul=") ",XL=function(e,n){var r=n||this,s=r.xPercent,i=r.yPercent,o=r.x,l=r.y,u=r.z,d=r.rotation,f=r.rotationY,h=r.rotationX,g=r.skewX,v=r.skewY,x=r.scaleX,_=r.scaleY,w=r.transformPerspective,S=r.force3D,k=r.target,E=r.zOrigin,P="",T=S==="auto"&&e&&e!==1||S===!0;if(E&&(h!==zl||f!==zl)){var I=parseFloat(f)*Zu,M=Math.sin(I),R=Math.cos(I),O;I=parseFloat(h)*Zu,O=Math.cos(I),o=Y_(k,o,M*O*-E),l=Y_(k,l,-Math.sin(I)*-E),u=Y_(k,u,R*O*-E+E)}w!==Rf&&(P+="perspective("+w+Ul),(s||i)&&(P+="translate("+s+"%, "+i+"%) "),(T||o!==Rf||l!==Rf||u!==Rf)&&(P+=u!==Rf||T?"translate3d("+o+", "+l+", "+u+") ":"translate("+o+", "+l+Ul),d!==zl&&(P+="rotate("+d+Ul),f!==zl&&(P+="rotateY("+f+Ul),h!==zl&&(P+="rotateX("+h+Ul),(g!==zl||v!==zl)&&(P+="skew("+g+", "+v+Ul),(x!==1||_!==1)&&(P+="scale("+x+", "+_+Ul),k.style[Sn]=P||"translate(0, 0)"},Pse=function(e,n){var r=n||this,s=r.xPercent,i=r.yPercent,o=r.x,l=r.y,u=r.rotation,d=r.skewX,f=r.skewY,h=r.scaleX,g=r.scaleY,v=r.target,x=r.xOrigin,_=r.yOrigin,w=r.xOffset,S=r.yOffset,k=r.forceCSS,E=parseFloat(o),P=parseFloat(l),T,I,M,R,O;u=parseFloat(u),d=parseFloat(d),f=parseFloat(f),f&&(f=parseFloat(f),d+=f,u+=f),u||d?(u*=Zu,d*=Zu,T=Math.cos(u)*h,I=Math.sin(u)*h,M=Math.sin(u-d)*-g,R=Math.cos(u-d)*g,d&&(f*=Zu,O=Math.tan(d-f),O=Math.sqrt(1+O*O),M*=O,R*=O,f&&(O=Math.tan(f),O=Math.sqrt(1+O*O),T*=O,I*=O)),T=Nn(T),I=Nn(I),M=Nn(M),R=Nn(R)):(T=h,R=g,I=M=0),(E&&!~(o+"").indexOf("px")||P&&!~(l+"").indexOf("px"))&&(E=rl(v,"x",o,"px"),P=rl(v,"y",l,"px")),(x||_||w||S)&&(E=Nn(E+x-(x*T+_*M)+w),P=Nn(P+_-(x*I+_*R)+S)),(s||i)&&(O=v.getBBox(),E=Nn(E+s/100*O.width),P=Nn(P+i/100*O.height)),O="matrix("+T+","+I+","+M+","+R+","+E+","+P+")",v.setAttribute("transform",O),k&&(v.style[Sn]=O)},Ase=function(e,n,r,s,i){var o=360,l=cr(i),u=parseFloat(i)*(l&&~i.indexOf("rad")?Kl:1),d=u-s,f=s+d+"deg",h,g;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*P5)%o-~~(d/o)*o:h==="ccw"&&d>0&&(d=(d-o*P5)%o-~~(d/o)*o)),e._pt=g=new ls(e._pt,n,r,s,d,use),g.e=f,g.u="deg",e._props.push(r),g},L5=function(e,n){for(var r in n)e[r]=n[r];return e},Tse=function(e,n,r){var s=L5({},r._gsap),i="perspective,force3D,transformOrigin,svgOrigin",o=r.style,l,u,d,f,h,g,v,x;s.svg?(d=r.getAttribute("transform"),r.setAttribute("transform",""),o[Sn]=n,l=Zh(r,1),nl(r,Sn),r.setAttribute("transform",d)):(d=getComputedStyle(r)[Sn],o[Sn]=n,l=Zh(r,1),o[Sn]=d);for(u in Qo)d=s[u],f=l[u],d!==f&&i.indexOf(u)<0&&(v=Tr(d),x=Tr(f),h=v!==x?rl(r,u,d,x):parseFloat(d),g=parseFloat(f),e._pt=new ls(e._pt,l,u,h,g-h,gx),e._pt.u=x||0,e._props.push(u));L5(l,s)};as("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});Og[e>1?"border"+t:t]=function(l,u,d,f,h){var g,v;if(arguments.length<4)return g=o.map(function(x){return Io(l,x,d)}),v=g.join(" "),v.split(g[0]).length===5?g[0]:v;g=(f+"").split(" "),v={},o.forEach(function(x,_){return v[x]=g[_]=g[_]||g[(_-1)/2|0]}),l.init(u,v,h)}});var JL={name:"css",register:yx,targetTest:function(e){return e.style&&e.nodeType},init:function(e,n,r,s,i){var o=this._props,l=e.style,u=r.vars.startAt,d,f,h,g,v,x,_,w,S,k,E,P,T,I,M,R,O;N6||yx(),this.styles=this.styles||WL(e),R=this.styles.props,this.tween=r;for(_ in n)if(_!=="autoRound"&&(f=n[_],!(_s[_]&&NL(_,n,r,s,e,i)))){if(v=typeof f,x=Og[_],v==="function"&&(f=f.call(r,s,e,i),v=typeof f),v==="string"&&~f.indexOf("random(")&&(f=Hh(f)),x)x(this,e,_,f,r)&&(M=1);else if(_.substr(0,2)==="--")d=(getComputedStyle(e).getPropertyValue(_)+"").trim(),f+="",Wa.lastIndex=0,Wa.test(d)||(w=Tr(d),S=Tr(f),S?w!==S&&(d=rl(e,_,d,S)+S):w&&(f+=w)),this.add(l,"setProperty",d,f,s,i,0,0,_),o.push(_),R.push(_,0,l[_]);else if(v!=="undefined"){if(u&&_ in u?(d=typeof u[_]=="function"?u[_].call(r,s,e,i):u[_],cr(d)&&~d.indexOf("random(")&&(d=Hh(d)),Tr(d+"")||d==="auto"||(d+=Ps.units[_]||Tr(Io(e,_))||""),(d+"").charAt(1)==="="&&(d=Io(e,_))):d=Io(e,_),g=parseFloat(d),k=v==="string"&&f.charAt(1)==="="&&f.substr(0,2),k&&(f=f.substr(2)),h=parseFloat(f),_ in Ki&&(_==="autoAlpha"&&(g===1&&Io(e,"visibility")==="hidden"&&h&&(g=0),R.push("visibility",0,l.visibility),za(this,l,"visibility",g?"inherit":"hidden",h?"inherit":"hidden",!h)),_!=="scale"&&_!=="transform"&&(_=Ki[_],~_.indexOf(",")&&(_=_.split(",")[0]))),E=_ in Qo,E){if(this.styles.save(_),O=f,v==="string"&&f.substring(0,6)==="var(--"){if(f=ks(e,f.substring(4,f.indexOf(")"))),f.substring(0,5)==="calc("){var D=e.style.perspective;e.style.perspective=f,f=ks(e,"perspective"),D?e.style.perspective=D:nl(e,"perspective")}h=parseFloat(f)}if(P||(T=e._gsap,T.renderTransform&&!n.parseTransform||Zh(e,n.parseTransform),I=n.smoothOrigin!==!1&&T.smooth,P=this._pt=new ls(this._pt,l,Sn,0,1,T.renderTransform,T,0,-1),P.dep=1),_==="scale")this._pt=new ls(this._pt,T,"scaleY",T.scaleY,(k?Uu(T.scaleY,k+h):h)-T.scaleY||0,gx),this._pt.u=0,o.push("scaleY",_),_+="X";else if(_==="transformOrigin"){R.push(cs,0,l[cs]),f=kse(f),T.svg?_x(e,f,0,I,0,this):(S=parseFloat(f.split(" ")[2])||0,S!==T.zOrigin&&za(this,T,"zOrigin",T.zOrigin,S),za(this,l,_,Lg(d),Lg(f)));continue}else if(_==="svgOrigin"){_x(e,f,1,I,0,this);continue}else if(_ in YL){Ase(this,T,_,g,k?Uu(g,k+f):f);continue}else if(_==="smoothOrigin"){za(this,T,"smooth",T.smooth,f);continue}else if(_==="force3D"){T[_]=f;continue}else if(_==="transform"){Tse(this,f,e);continue}}else _ in l||(_=Pd(_)||_);if(E||(h||h===0)&&(g||g===0)&&!cse.test(f)&&_ in l)w=(d+"").substr((g+"").length),h||(h=0),S=Tr(f)||(_ in Ps.units?Ps.units[_]:w),w!==S&&(g=rl(e,_,d,S)),this._pt=new ls(this._pt,E?T:l,_,g,(k?Uu(g,k+h):h)-g,!E&&(S==="px"||_==="zIndex")&&n.autoRound!==!1?hse:gx),this._pt.u=S||0,E&&O!==f?(this._pt.b=d,this._pt.e=O,this._pt.r=fse):w!==S&&S!=="%"&&(this._pt.b=d,this._pt.r=dse);else if(_ in l)Sse.call(this,e,_,d,k?k+f:f);else if(_ in e)this.add(e,_,d||e[_],k?k+f:f,s,i);else if(_!=="parseTransform"){C6(_,f);continue}E||(_ in l?R.push(_,0,l[_]):typeof e[_]=="function"?R.push(_,2,e[_]()):R.push(_,1,d||e[_])),o.push(_)}}M&&HL(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:Io,aliases:Ki,getSetter:function(e,n,r){var s=Ki[n];return s&&s.indexOf(",")<0&&(n=s),n in Qo&&n!==cs&&(e._gsap.x||Io(e,"x"))?r&&E5===r?n==="scale"?vse:gse:(E5=r||{})&&(n==="scale"?yse:_se):e.style&&!b6(e.style[n])?pse:~n.indexOf("-")?mse:O6(e,n)},core:{_removeProperty:nl,_getMatrix:$6}};us.utils.checkPrefix=Pd;us.core.getStyleSaver=WL;(function(t,e,n,r){var s=as(t+","+e+","+n,function(i){Qo[i]=1});as(e,function(i){Ps.units[i]="deg",YL[i]=1}),Ki[s[13]]=t+","+e,as(r,function(i){var o=i.split(":");Ki[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");as("x,y,z,top,right,bottom,left,width,height,fontSize,padding,margin,perspective",function(t){Ps.units[t]="px"});us.registerPlugin(JL);var pi=us.registerPlugin(JL)||us;pi.core.Tween;const bm="/assets/logo-animation",Q_=1280,Rse=[{id:"eraser",src:`${bm}/eraser.png`,cssW:189,cssH:74,rot:-90,fit:337,localX:60,localY:168,seaX:.2,seaY:.27,seaRot:-8},{id:"clasp",src:`${bm}/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:`${bm}/playdough.png`,cssW:236,cssH:206,rot:5,fit:150,localX:182,localY:277,seaX:.52,seaY:.79,seaRot:6}],Mse=[{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}],wx=({className:t})=>{const e=m.useRef(null),n=m.useRef(null),r=m.useRef(null);return m.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,u=(S,k)=>S+Math.random()*(k-S);let d=null,f,h=1;const g=Rse.map(S=>({...S})),v=()=>{s.querySelectorAll(".la-obj").forEach(R=>R.remove());const S=s.getBoundingClientRect(),k=S.width||Q_,E=S.height||Q_*.64;h=k/Q_,i.style.width=`${242*h}px`,i.style.height=`${250*h}px`;const T=250*h/337,I=[],M=(R,O,D)=>{const $=document.createElement("div");return $.className="la-obj",$.style.width=`${O}px`,$.innerHTML=`<img src="${R}" alt="" style="${D?"transform:scaleX(-1)":""}">`,s.appendChild($),$};return Mse.forEach((R,O)=>{const D=R.w*h,$=M(`${bm}/sea/${R.k}.png`,D,O%2===0);pi.set($,{x:R.x*k-D/2,y:R.y*E-D/2,rotation:R.r,opacity:1,scale:0,transformOrigin:"50% 50%"}),I.push({el:$,hero:!1,rest:1})}),g.forEach(R=>{const O=R.cssW*h;R.el=M(R.src,O,!!R.flip),R.finalScale=R.fit*T/(R.cssW*h),pi.set(R.el,{x:R.seaX*k-O/2,y:R.seaY*E-R.cssH*h/2,rotation:R.seaRot,opacity:1,scale:0,transformOrigin:"50% 50%",zIndex:30}),I.push({el:R.el,hero:!0,rest:150/R.cssW})}),I},x=(S,k)=>{const E=s.getBoundingClientRect(),P=o.getBoundingClientRect();return{x:P.left-E.left+S/326*P.width,y:P.top-E.top+k/337*P.height}},_=()=>{d&&d.revert();const S=v();if(l){d=pi.context(()=>{S.filter(P=>!P.hero).forEach(P=>pi.set(P.el,{scale:0})),g.forEach(P=>{if(!P.el)return;const T=x(P.localX,P.localY);pi.set(P.el,{x:T.x-P.cssW*h/2,y:T.y-P.cssH*h/2,rotation:P.rot,scale:P.finalScale})})},s);return}const k=[],E=[];d=pi.context(()=>{const P=pi.timeline();P.to(S.map(T=>T.el),{scale:T=>S[T].rest,duration:.5,ease:"steps(4)",stagger:{each:.045,from:"random"}}),P.add(()=>{S.forEach(({el:T,hero:I},M)=>{const R=I?k:E,O=M%2?1:-1;R.push(pi.to(T,{rotation:"+="+u(2.5,6)*O,duration:u(.5,.9),repeat:-1,yoyo:!0,ease:"steps(2)",delay:u(0,.4)}),pi.to(T,{y:"+="+u(5,11)*O,x:"+="+u(4,9)*-O,duration:u(.7,1.2),repeat:-1,yoyo:!0,ease:"steps(3)",delay:u(0,.4)}))})},"<0.1"),P.to({},{duration:1.1}),P.add("pick"),g.forEach((T,I)=>{T.el&&P.to(T.el,{scale:150/T.cssW*1.2,duration:.28,ease:"steps(3)",yoyo:!0,repeat:1},"pick+="+I*.08)}),P.add("clear","pick+=0.7"),P.add(()=>E.forEach(T=>T.kill()),"clear"),P.to(S.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"),P.add("assemble","clear+=0.25"),P.add(()=>k.forEach(T=>T.kill()),"assemble"),g.forEach((T,I)=>{if(!T.el||T.finalScale===void 0)return;const M=x(T.localX,T.localY);P.to(T.el,{x:M.x-T.cssW*h/2,y:M.y-T.cssH*h/2,rotation:T.rot,scale:T.finalScale,duration:1.05,ease:"steps(9)",overwrite:"auto"},"assemble+="+I*.12)}),g.forEach(T=>{!T.el||T.finalScale===void 0||P.to(T.el,{scale:T.finalScale*1.03,duration:.16,ease:"steps(2)",yoyo:!0,repeat:1},"assemble+=1.45")})},s)};pi.ticker.fps(12),_();const w=()=>{clearTimeout(f),f=setTimeout(_,250)};return window.addEventListener("resize",w),()=>{window.removeEventListener("resize",w),clearTimeout(f),d==null||d.revert(),s.querySelectorAll(".la-obj").forEach(S=>S.remove())}},[]),b.jsx("div",{ref:e,className:`la-scene ${t??""}`,children:b.jsx("div",{ref:n,className:"la-logo-stage",children:b.jsx("svg",{ref:r,className:"la-mark",viewBox:"0 0 326 337","aria-hidden":"true"})})})},Ise=Object.freeze(Object.defineProperty({__proto__:null,default:wx},Symbol.toStringTag,{value:"Module"})),N5=({isSigningIn:t})=>t?b.jsxs(b.Fragment,{children:[b.jsx("div",{className:"h-5 w-5 animate-spin rounded-full border-2 border-current border-t-transparent"}),b.jsx("span",{children:"Signing in..."})]}):b.jsxs(b.Fragment,{children:[b.jsx("img",{src:"https://www.gstatic.com/firebasejs/ui/2.0.0/images/auth/google.svg",alt:"Google",className:"h-5 w-5"}),b.jsx("span",{children:"Sign in with Google"})]}),Ose=({isSigningIn:t,onStartSignIn:e,errorMessage:n=null,displayMode:r="full"})=>r==="modal"?b.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:[b.jsx(wx,{className:"relative z-0 h-44 w-full"}),b.jsxs("div",{className:"relative z-10 flex flex-col items-center gap-6 px-8 pb-12 pt-8",children:[b.jsxs("div",{className:"flex flex-col items-center gap-2 text-center",children:[b.jsx("h1",{className:"text-xl font-medium text-content",children:"Welcome to Rivet"}),b.jsx("p",{className:"text-sm leading-relaxed text-content-muted",children:"Rivet understands your references, and then explores dozens of design directions with you."})]}),b.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:b.jsx(N5,{isSigningIn:t})}),n?b.jsx("p",{className:"text-center text-xs text-red-200",children:n}):null]})]}):b.jsxs("div",{className:"relative flex min-h-screen flex-col items-center justify-center overflow-hidden bg-white font-main text-[#18181b]",children:[b.jsx(wx,{className:"absolute inset-0 z-0"}),b.jsxs("div",{className:"pointer-events-none absolute inset-x-0 bottom-0 z-10 flex flex-col items-center gap-5 pb-[14vh]",children:[b.jsxs("div",{className:"flex flex-col items-center gap-2 px-6 text-center",children:[b.jsx("h1",{className:"text-xl font-medium tracking-tight text-[#18181b]",children:"Welcome to Rivet"}),b.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."})]}),b.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:b.jsx(N5,{isSigningIn:t})}),n?b.jsx("p",{className:"text-center text-xs text-red-500",children:n}):null]})]}),Lse="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",Nse=({message:t})=>b.jsx("div",{className:"relative flex min-h-screen flex-col items-center justify-center overflow-hidden bg-[#1c1c20] font-main text-white",children:b.jsxs("div",{className:"flex flex-col items-center gap-10",children:[b.jsx("img",{src:Lse,alt:"Rivet",className:"h-8 w-auto object-contain"}),b.jsxs("div",{className:"glass-panel flex items-center gap-3 rounded-xl px-8 py-3.5 text-sm font-medium",children:[b.jsx(Xg,{className:"h-5 w-5 shrink-0 animate-spin text-primary",weight:"bold"}),b.jsx("span",{children:t})]})]})}),Dse="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",Ng=44,Mf=8,q0=16,jse=4,D5=-18,$se=.18,Fse=[.22,1,.36,1],j5=.92,Vse=1,Hse=.95,zse=.4,Use=[.19,1,.22,1],X_=0,Bse=1,Zse=0,Wse=0,qse=0,eN=({position:t,viewport:e,boundsLeft:n=0})=>{const r=n+Mf,s=Math.max(r,e.width-Ng-Mf),i=Math.max(Mf,e.height-Ng-Mf);return{x:Math.min(s,Math.max(r,t.x)),y:Math.min(i,Math.max(Mf,t.y))}},F6=()=>({width:window.innerWidth,height:window.innerHeight}),Gse=({position:t,boundsLeftPx:e=0})=>eN({position:t,viewport:F6(),boundsLeft:e}),Kse=()=>{if(typeof window>"u")return{x:q0,y:q0};const t=F6();return{x:t.width-Ng-q0,y:t.height-Ng-q0}},Yse=({deltaX:t,deltaY:e})=>Math.hypot(t,e)>=jse,Qse=t=>t.button===void 0||t.button<=qse,$5=t=>{const e=t.nativeEvent;return{x:Number.isFinite(t.clientX)?t.clientX:e.clientX,y:Number.isFinite(t.clientY)?t.clientY:e.clientY}},Xse=({isVisible:t,isPanelOpen:e,isReducedMotion:n,position:r,dragBoundsLeftPx:s=0,onToggle:i,onPositionChange:o})=>{const l=m.useRef(null),u=m.useRef(!1),[d,f]=m.useState(!1),[h,g]=m.useState(!1),v=n?!1:{opacity:X_,scale:j5,x:D5},x=n?{opacity:X_}:{opacity:X_,scale:j5,x:D5},_=n?{duration:Wse}:{duration:$se,ease:Fse,scale:{duration:zse,ease:Use}},w=m.useCallback(()=>{const T=l.current;T&&(u.current=T.hasMoved),l.current=null,f(!1)},[]),S=m.useCallback(T=>{const I=l.current;if(!I)return;const M=$5(T),R=M.x-I.startPointer.x,O=M.y-I.startPointer.y,D=I.hasMoved||Yse({deltaX:R,deltaY:O});l.current={...I,hasMoved:D},D&&o(eN({position:{x:I.startPosition.x+R,y:I.startPosition.y+O},viewport:F6(),boundsLeft:s}))},[o,s]),k=m.useCallback(T=>{if(l.current||!Qse(T))return;const I=$5(T);l.current={startPointer:I,startPosition:r,hasMoved:!1},f(!0)},[r]),E=m.useCallback(()=>{if(u.current){u.current=!1;return}i()},[i]),P=e?"Close panel":"Open panel";return b.jsxs(b.Fragment,{children:[d?b.jsx("div",{className:"fixed inset-0 z-40 cursor-grabbing","data-cy":"rivet-panel-launcher-drag-surface",onPointerMove:S,onPointerUp:w,onPointerCancel:w,onMouseMove:S,onMouseUp:w}):null,b.jsx(Es,{children:t?b.jsx(Ac,{label:P,side:"top",forceOpen:h&&!d?void 0:!1,children:b.jsx(Si.button,{type:"button","aria-label":P,"data-cy":"reopen-panel",onMouseEnter:()=>g(!0),onMouseLeave:()=>g(!1),initial:v,animate:{opacity:Bse,scale:Vse,x:Zse},whileTap:{scale:Hse},exit:x,transition:_,onPointerDown:k,onMouseDown:k,onPointerMove:S,onPointerUp:w,onPointerCancel:w,onMouseMove:S,onMouseUp:w,onClick:E,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:b.jsx("img",{src:Dse,alt:"","aria-hidden":"true",draggable:!1,className:"h-4 w-4 brightness-0 invert"})})}):null})]})},J_=Is("useConfig"),Jse=300*1e3,eie=1800*1e3,tie=60*1e3,nie=300*1e3,rie=()=>{var t;return typeof window>"u"?null:((t=window.__RIVET_BOOTSTRAP__)==null?void 0:t.queueAccessToken)??null},sie=()=>{var t;return typeof window>"u"?null:((t=window.__RIVET_BOOTSTRAP__)==null?void 0:t.agentApplyMode)??null},iie=Rn({agentModeAvailable:bh(),email:Qe().optional(),userId:Qe().optional(),name:Qe().optional(),isMCPSession:bh(),mcpEditor:Qe().nullable(),agentApplyMode:Ug(["embedded","external"]).nullable().optional(),queueAccessToken:Qe().nullable().optional(),projectPath:Qe(),projectId:Qe().uuid().nullable().optional(),libraryOrigin:Qe().url().nullable()}),oie=Rn({featureFlags:nM(Qe(),Rn({isEnabled:bh()})).optional()}),aie=t=>({...b9,...t??{}}),lie=()=>{const t=ct(Jw),e=mt(Jw),n=mt(M9),r=mt(I9),s=mt(vv),i=mt(Yee),o=mt(Gee),l=mt(qee),u=mt(gv),d=mt(zee),f=mt(R9),h=m.useCallback(k=>{o(k.agentModeAvailable),f(k.projectId??null),d({name:k.name??null,email:k.email??null}),k.isMCPSession&&n(!0),k.mcpEditor&&r(k.mcpEditor),s(k.agentApplyMode??sie()??null),i(k.queueAccessToken??rie())},[s,o,n,r,i,f,d]),g=dh({queryKey:["rivet-config"],queryFn:async()=>{const k=await fetch("/api/config");if(!k.ok)throw new Error(`Failed to fetch config: ${k.statusText}`);return iie.parse(await k.json())},staleTime:Jse,gcTime:eie}),v=dh({queryKey:["rivet-feature-flags"],queryFn:async()=>{const k=await fetch("/api/feature-flags");if(!k.ok)throw new Error(`Failed to fetch feature flags: ${k.statusText}`);return oie.parse(await k.json())},staleTime:tie,gcTime:nie}),{refetch:x}=g,{refetch:_}=v;m.useLayoutEffect(()=>{g.data&&(h(g.data),u(!1),J_.info("Config loaded:",g.data)),v.data&&(e(aie(v.data.featureFlags)),l(!0))},[g.data,v.data,h,u,e,l]),m.useLayoutEffect(()=>{g.error&&(l(!0),u(!1),J_.warn("Failed to load config:",g.error instanceof Error?g.error.message:"Failed to load config")),v.error&&(l(!0),J_.warn("Failed to load feature flags:",v.error instanceof Error?v.error.message:"Failed to load feature flags"))},[g.error,v.error,u,l]);const w=m.useCallback(async()=>{const[k]=await Promise.all([x(),_()]);return k.data?k.data:null},[x,_]);let S=null;return g.error instanceof Error?S=g.error.message:g.error&&(S="Failed to load config"),{config:g.data??null,featureFlags:t,loading:g.isPending||!g.error&&v.isPending,error:S,refetchConfig:w}},ku=Is("useOAuthCallback"),cie="https://rivet-proxy.onrender.com",uie=()=>{const[t,e]=m.useState({isProcessing:!1,isComplete:!1,error:null});return m.useEffect(()=>{const n=new AbortController;let r=!1;return(async()=>{var l,u,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{ku.info("Processing OAuth callback...");const f=new URLSearchParams(i.substring(1)),h=f.get("access_token"),g=f.get("refresh_token"),x=new URLSearchParams(o).get("session");if(!h)throw new Error("No access token found in URL");if(!x)throw new Error("No session ID found in URL");ku.info(`Completing OAuth with session: ${x}`);const _=await fetch(`${cie}/api/auth/google/complete`,{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({sessionId:x,accessToken:h,refreshToken:g}),signal:n.signal}),w=await _.json();if(!_.ok||!w.success)throw new Error(w.error||w.message||"Failed to complete authentication");if(ku.info("OAuth authentication completed successfully"),r)return;if((l=w.user)!=null&&l.id?(Ie.identify(w.user.id,{...w.user.email?{email:w.user.email}:{}}),w.user.email&&Ie.alias(w.user.email,w.user.id)):(u=w.user)!=null&&u.email&&Ie.identify(w.user.email,{email:w.user.email}),(d=w.user)!=null&&d.email&&h)try{const k=await fetch("/api/auth/store",{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({email:w.user.email,token:h,refreshToken:g,userId:w.user.id}),signal:n.signal});k.ok||ku.warn(`Local auth store returned ${k.status}`)}catch(k){if(r)return;ku.warn("Failed to store auth locally:",k)}if(r)return;window.sessionStorage.setItem(Eg,"1");const S=window.location.pathname;window.history.replaceState({},document.title,S),e({isProcessing:!1,isComplete:!0,error:null})}catch(f){if(r)return;ku.warn("OAuth callback error:",f),e({isProcessing:!1,isComplete:!1,error:Br(f,"Unknown error occurred")})}}})(),()=>{r=!0,n.abort()}},[]),t},e2=Is("useAgentVariantsSession"),die=t=>typeof t.pendingCount=="number"&&t.pendingCount===0&&(t.pendingVariantRequests??0)===0&&(t.leasedVariantRequests??0)===0&&(t.activeLeases??[]).length===0,F5=(t,e,n)=>{e.size===0&&!n||t.set(jh,r=>{if(r.size===0)return r;const s=new Map(r);let i=!1;for(const[o,l]of r)l.status==="sending"&&l.variantRequestId&&(e.has(l.variantRequestId)||n&&l.variantRequest!==void 0)&&(s.delete(o),i=!0);return i?s:r})},fie=(t,e)=>{var s;if(t.size===0)return t;let n=!1;const r=new Map(t);for(const[i,o]of t){if(o.status!=="sending"||!o.awaitingSnapshotOutcome||o.variantRequest!==void 0)continue;const l=o.target;if(!l||l.kind!=="variant"||l.sessionId!==e.sessionId)continue;const u=(s=e.variants.find(d=>d.workItemId===l.variantId))==null?void 0:s.refinement;u&&(u.status==="succeeded"?(r.set(i,{...o,status:"complete",awaitingSnapshotOutcome:void 0}),n=!0):(u.status==="failed"||u.status==="cancelled")&&(r.set(i,{...o,status:"error",awaitingSnapshotOutcome:void 0}),n=!0))}return n?r:t},hie=({enabled:t=!0}={})=>{const e=mt(lp),n=mt(A9),r=mt(S9),s=mt(Hee),i=mt(T9),o=mt(Wee),l=Zg(),u=m.useRef(null);m.useEffect(()=>{if(n(!1),!t)return;const d=new EventSource("/api/variants/events");return d.onmessage=f=>{try{const h=JSON.parse(f.data),g=u.current;if(h.active){const _=new Set(h.variants.map(w=>w.requestId).filter(w=>!!w));i(w=>w.filter(k=>!_.has(k.requestId))),F5(l,_,!1),l.set(jh,w=>{let S=w;for(const k of h.variants){const E=k.adoptedSource;E&&(S=Zee(S,{kind:"variant",sessionId:E.sessionId,variantId:E.variantId},{kind:"variant",sessionId:h.sessionId,variantId:k.workItemId}))}return S}),l.set(jh,w=>fie(w,h)),h.sessionId!==u.current&&(u.current=h.sessionId,r(!0),s("directions"))}else u.current=null,F5(l,new Set,die(h));e(h),n(!0);const v=!h.active&&g!==null,x=h.active&&h.sessionId!==g;if(x&&fetch(`/api/variants/${h.sessionId}/preview-port`,{method:"POST",headers:{"content-type":"application/json"},body:JSON.stringify({variantId:null})}).catch(_=>e2.warn("failed to reset preview-port on session switch",_)),v||x){const _=new Set;if(h.active)for(const S of h.variants)_.add(Pc({kind:"variant",sessionId:h.sessionId,variantId:S.workItemId}));const w=l.get(Ko);for(const S of[w==null?void 0:w.left,w==null?void 0:w.right])S&&_.add(Pc({kind:"variant",sessionId:S.sessionId,variantId:S.variantId}));o(_)}}catch(h){e2.warn("failed to parse SSE event payload",h)}},d.onerror=f=>{e2.warn("SSE error (auto-reconnects)",f)},()=>{d.close()}},[t,e,n,r,s,i,o,l])};var pie=Object.defineProperty,Jn=(t,e)=>pie(t,"name",{value:e,configurable:!0});function tN(t){const e=t+"CollectionProvider",[n,r]=io(e),[s,i]=n(e,{collectionRef:{current:null},itemMap:new Map}),o=Jn(_=>{const{scope:w,children:S}=_,k=m.useRef(null),E=m.useRef(new Map).current;return b.jsx(s,{scope:w,itemMap:E,collectionRef:k,children:S})},"CollectionProvider");o.displayName=e;const l=t+"CollectionSlot",u=Qa(l),d=m.forwardRef((_,w)=>{const{scope:S,children:k}=_,E=i(l,S),P=Zt(w,E.collectionRef);return b.jsx(u,{ref:P,children:k})});d.displayName=l;const f=t+"CollectionItemSlot",h="data-radix-collection-item",g=Qa(f),v=m.forwardRef((_,w)=>{const{scope:S,children:k,...E}=_,P=m.useRef(null),T=Zt(w,P),I=i(f,S);return m.useEffect(()=>(I.itemMap.set(P,{ref:P,...E}),()=>void I.itemMap.delete(P))),b.jsx(g,{[h]:"",ref:T,children:k})});v.displayName=f;function x(_){const w=i(t+"CollectionConsumer",_);return m.useCallback(()=>{const k=w.collectionRef.current;if(!k)return[];const E=Array.from(k.querySelectorAll(`[${h}]`));return Array.from(w.itemMap.values()).sort((I,M)=>E.indexOf(I.ref.current)-E.indexOf(M.ref.current))},[w.collectionRef,w.itemMap])}return Jn(x,"useCollection"),[{Provider:o,Slot:d,ItemSlot:v},x,r]}Jn(tN,"createCollection");var V5=new WeakMap,Ln,ys,G0=(ys=class extends Map{constructor(n){super(n);tt(this,Ln);Te(this,Ln,[...super.keys()]),V5.set(this,!0)}set(n,r){return V5.get(this)&&!this.has(n)&&W(this,Ln).push(n),super.set(n,r),this}insert(n,r,s){const i=this.has(r),o=i?this.size:this.size+1,l=V6(n),u=l>=0?Math.min(l,o-1):Math.max(o+l,0);if(i?W(this,Ln).indexOf(r)===u:u===this.size)return this.set(r,s),this;const d=W(this,Ln).filter(h=>h!==r);d.splice(u,0,r);const f=d.map(h=>[h,h===r?s:this.get(h)]);this.clear();for(const[h,g]of f)this.set(h,g);return this}with(n,r,s){const i=new ys(this);return i.insert(n,r,s),i}before(n){const r=W(this,Ln).indexOf(n)-1;if(!(r<0))return this.entryAt(r)}setBefore(n,r,s){const i=W(this,Ln).indexOf(n);if(i===-1)return this;const o=W(this,Ln).indexOf(r),l=o!==-1&&o<i?i-1:i;return this.insert(l,r,s)}after(n){let r=W(this,Ln).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,Ln).indexOf(n);if(i===-1)return this;const o=W(this,Ln).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 Te(this,Ln,[]),super.clear()}delete(n){const r=super.delete(n);return r&&W(this,Ln).splice(W(this,Ln).indexOf(n),1),r}deleteAt(n){const r=this.keyAt(n);return r!==void 0?this.delete(r):!1}at(n){const r=Sm(W(this,Ln),n);if(r!==void 0)return this.get(r)}entryAt(n){const r=Sm(W(this,Ln),n);if(r!==void 0)return[r,this.get(r)]}indexOf(n){return W(this,Ln).indexOf(n)}keyAt(n){return Sm(W(this,Ln),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 ys(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 ys(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 u of this)o===0&&!i?l=u:l=Reflect.apply(r,this,[l,u,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 u=this.entryAt(l);l===this.size-1&&!i?o=u:o=Reflect.apply(r,this,[o,u,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 ys(r)}toReversed(){const n=new ys;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 ys(r)}slice(n,r){const s=new ys;for(const i of W(this,Ln).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}},Ln=new WeakMap,Jn(ys,"OrderedDict"),ys);function Sm(t,e){if("at"in Array.prototype)return Array.prototype.at.call(t,e);const n=nN(t,e);return n===-1?void 0:t[n]}Jn(Sm,"at");function nN(t,e){const n=t.length,r=V6(e),s=r>=0?r:n+r;return s<0||s>=n?-1:s}Jn(nN,"toSafeIndex");function V6(t){return t!==t||t===0?0:Math.trunc(t)}Jn(V6,"toSafeInteger");function rN(t){const e=t+"CollectionProvider",[n,r]=io(e),[s,i]=n(e);s.displayName=t+"CollectionStableContextProvider";const[o,l]=n(e);o.displayName=t+"CollectionStatefulContextProvider";const u=Jn(({state:I,...M})=>I?b.jsx(f,{...M,state:I}):b.jsx(d,{...M}),"CollectionProvider");u.displayName=e;const d=Jn(I=>{const M=k();return b.jsx(f,{...I,state:M})},"CollectionInit");d.displayName=t+"CollectionInit";const f=Jn(I=>{const{scope:M,children:R,state:O}=I,D=m.useRef(null),[$,V]=m.useState(null),q=Zt(D,V),[B,K]=O,z=m.useRef(new G0),X=m.useCallback(()=>{const Z=z.current;return oN(Z)||Z.sort(km),Z},[]);return m.useEffect(()=>{if(!$)return;const Z=aN(()=>{K(J=>{const H=J.toSorted(km);return H.some(([Y],ae)=>J.keyAt(ae)!==Y)?H:J})});return Z.observe($,{childList:!0,subtree:!0}),()=>{Z.disconnect()}},[$,K]),b.jsx(s,{scope:M,collectionElementRef:q,collectionElementRefObject:D,getCollection:X,setCollection:K,registryRef:z,children:b.jsx(o,{scope:M,collectionElement:$,collection:B,children:R})})},"CollectionProviderImpl");f.displayName=t+"CollectionProviderImpl";const h=t+"CollectionSlot",g=Qa(h),v=m.forwardRef((I,M)=>{const{scope:R,children:O}=I,D=i(h,R),$=Zt(M,D.collectionElementRef);return b.jsx(g,{ref:$,children:O})});v.displayName=h;const x=t+"CollectionItemSlot",_="data-radix-collection-item",w=Qa(x),S=m.forwardRef((I,M)=>{const{scope:R,children:O,...D}=I,$=m.useRef(null),V=i(x,R),{setCollection:q,registryRef:B}=V,K=m.useRef(D);sN(K.current,D)||(K.current=D);const z=K.current,X=m.useCallback(H=>{const N=B.current;H?N.set(H,{...K.current,element:H}):$.current&&N.delete($.current)},[B]),Z=Zt(M,X,$);Mr(()=>{const H=$.current,N=B.current;H&&N.has(H)&&N.set(H,{...z,element:H})},[z,B]);const J=m.useRef(null);return m.useEffect(()=>{const H=$.current,N=J.current;((N==null?void 0:N.element)??null)===H&&(!H||(N==null?void 0:N.itemData)===z)||(J.current=H?{element:H,itemData:z}:null,q(Y=>{const ae=new G0(Y);return N&&N.element!==H&&ae.delete(N.element),H&&ae.set(H,{...z,element:H}),ae.sort(km)}))}),m.useEffect(()=>()=>{const H=J.current;J.current=null,H&&q(N=>{if(!N.has(H.element))return N;const Y=new G0(N);return Y.delete(H.element),Y})},[q]),b.jsx(w,{[_]:"",ref:Z,children:O})});S.displayName=x;function k(){return m.useState(new G0)}Jn(k,"useInitCollection");function E(I){const{collection:M}=l(t+"CollectionConsumer",I);return M}Jn(E,"useCollection");function P(I){const{getCollection:M}=i(t+"CollectionConsumer",I);return M}return Jn(P,"useGetCollection"),[{Provider:u,Slot:v,ItemSlot:S},{createCollectionScope:r,useCollection:E,useGetCollection:P,useInitCollection:k}]}Jn(rN,"createCollection");function sN(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}Jn(sN,"shallowEqual");function iN(t,e){return!!(e.compareDocumentPosition(t)&Node.DOCUMENT_POSITION_PRECEDING)}Jn(iN,"isElementPreceding");function oN(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}Jn(oN,"isInDocumentOrder");function km(t,e){return!t[1].element||!e[1].element?0:iN(t[1].element,e[1].element)?-1:1}Jn(km,"sortByDocumentPosition");function aN(t){return new MutationObserver(n=>{for(const r of n)if(r.type==="childList"){t();return}})}Jn(aN,"getChildListObserver");var mie=Object.defineProperty,dp=(t,e)=>mie(t,"name",{value:e,configurable:!0}),H6="Collapsible",[gie,lN]=io(H6),[vie,z6]=gie(H6),yie=m.forwardRef(dp(function(e,n){const{__scopeCollapsible:r,open:s,defaultOpen:i,disabled:o,onOpenChange:l,...u}=e,[d,f]=ll({prop:s,defaultProp:i??!1,onChange:l,caller:H6});return b.jsx(vie,{scope:r,disabled:o,contentId:Xi(),open:d,onOpenToggle:m.useCallback(()=>f(h=>!h),[f]),children:b.jsx(kn.div,{"data-state":bv(d),"data-disabled":o?"":void 0,...u,ref:n})})},"Collapsible")),_ie="CollapsibleTrigger",wie=m.forwardRef(dp(function(e,n){const{__scopeCollapsible:r,...s}=e,i=z6(_ie,r);return b.jsx(kn.button,{type:"button","aria-controls":i.open?i.contentId:void 0,"aria-expanded":i.open||!1,"data-state":bv(i.open),"data-disabled":i.disabled?"":void 0,disabled:i.disabled,...s,ref:n,onClick:Bt(e.onClick,i.onOpenToggle)})},"CollapsibleTrigger")),cN="CollapsibleContent",xie=m.forwardRef(dp(function(e,n){const{forceMount:r,...s}=e,i=z6(cN,e.__scopeCollapsible);return b.jsx(al,{present:r||i.open,children:({present:o})=>b.jsx(bie,{...s,ref:n,present:o})})},"CollapsibleContent")),bie=m.forwardRef(dp(function(e,n){const{__scopeCollapsible:r,present:s,children:i,...o}=e,l=z6(cN,r),[u,d]=m.useState(s),f=m.useRef(null),h=Zt(n,f),g=m.useRef(0),v=g.current,x=m.useRef(0),_=x.current,w=l.open||u,S=m.useRef(w),k=m.useRef(void 0);return m.useEffect(()=>{const E=requestAnimationFrame(()=>S.current=!1);return()=>cancelAnimationFrame(E)},[]),Mr(()=>{const E=f.current;if(E){k.current=k.current||{transitionDuration:E.style.transitionDuration,animationName:E.style.animationName},E.style.transitionDuration="0s",E.style.animationName="none";const P=E.getBoundingClientRect();g.current=P.height,x.current=P.width,S.current||(E.style.transitionDuration=k.current.transitionDuration,E.style.animationName=k.current.animationName),d(s)}},[l.open,s]),b.jsx(kn.div,{"data-state":bv(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":_?`${_}px`:void 0,...e.style},children:w&&i})},"CollapsibleContentImpl"));function bv(t){return t?"open":"closed"}dp(bv,"getState");var Sie=Object.defineProperty,kie=(t,e)=>Sie(t,"name",{value:e,configurable:!0}),Cie={LTR:"ltr"},Eie=m.createContext(void 0);function U6(t){const e=m.useContext(Eie);return t||e||Cie.LTR}kie(U6,"useDirection");var Pie=Object.defineProperty,As=(t,e)=>Pie(t,"name",{value:e,configurable:!0}),Aie={Multiple:"multiple"},If={Vertical:"vertical",Horizontal:"horizontal"},Tie={LTR:"ltr"},oo="Accordion",Rie=["Home","End","ArrowDown","ArrowUp","ArrowLeft","ArrowRight"],[B6,{useGetCollection:Mie,createCollectionScope:Iie}]=rN(oo),[Sv,rle]=io(oo,[Iie,lN]),Z6=lN(),uN=m.forwardRef(As(function(e,n){const{type:r,...s}=e,i=s,o=s;return b.jsx(B6.Provider,{scope:e.__scopeAccordion,children:r===Aie.Multiple?b.jsx(Die,{...o,ref:n}):b.jsx(Nie,{...i,ref:n})})},"Accordion")),[dN,Oie]=Sv(oo),[fN,Lie]=Sv(oo,{collapsible:!1}),Nie=m.forwardRef(As(function(e,n){const{value:r,defaultValue:s,onValueChange:i=As(()=>{},"onValueChange"),collapsible:o=!1,...l}=e,[u,d]=ll({prop:r,defaultProp:s??"",onChange:i,caller:oo});return b.jsx(dN,{scope:e.__scopeAccordion,value:m.useMemo(()=>u?[u]:[],[u]),onItemOpen:d,onItemClose:m.useCallback(()=>o&&d(""),[o,d]),children:b.jsx(fN,{scope:e.__scopeAccordion,collapsible:o,children:b.jsx(hN,{...l,ref:n})})})},"AccordionImplSingle")),Die=m.forwardRef(As(function(e,n){const{value:r,defaultValue:s,onValueChange:i=As(()=>{},"onValueChange"),...o}=e,[l,u]=ll({prop:r,defaultProp:s??[],onChange:i,caller:oo}),d=m.useCallback(h=>u((g=[])=>[...g,h]),[u]),f=m.useCallback(h=>u((g=[])=>g.filter(v=>v!==h)),[u]);return b.jsx(dN,{scope:e.__scopeAccordion,value:l,onItemOpen:d,onItemClose:f,children:b.jsx(fN,{scope:e.__scopeAccordion,collapsible:!0,children:b.jsx(hN,{...o,ref:n})})})},"AccordionImplMultiple")),[jie,kv]=Sv(oo),hN=m.forwardRef(As(function(e,n){const{__scopeAccordion:r,disabled:s,dir:i,orientation:o=If.Vertical,...l}=e,u=m.useRef(null),d=Zt(u,n),f=Mie(r),g=U6(i)===Tie.LTR,v=Bt(e.onKeyDown,x=>{var D;if(!Rie.includes(x.key))return;const _=f(),w=x.target,S=_.filter(([,$])=>!$.element.disabled),k=S.findIndex(([,$])=>$.element===w),E=S.size;if(k===-1)return;x.preventDefault();let P=k;const T=0,I=E-1,M=As(()=>{P=k+1,P>I&&(P=T)},"moveNext"),R=As(()=>{P=k-1,P<T&&(P=I)},"movePrev");switch(x.key){case"Home":P=T;break;case"End":P=I;break;case"ArrowRight":o===If.Horizontal&&(g?M():R());break;case"ArrowDown":o===If.Vertical&&M();break;case"ArrowLeft":o===If.Horizontal&&(g?R():M());break;case"ArrowUp":o===If.Vertical&&R();break}const O=P%E;(D=S.at(O))==null||D.element.focus()});return b.jsx(jie,{scope:r,disabled:s,direction:i,orientation:o,children:b.jsx(B6.Slot,{scope:r,children:b.jsx(kn.div,{...l,"data-orientation":o,ref:d,onKeyDown:s?void 0:v})})})},"AccordionImpl")),xx="AccordionItem",[$ie,W6]=Sv(xx),Fie=m.forwardRef(As(function(e,n){const{__scopeAccordion:r,value:s,...i}=e,o=kv(xx,r),l=Oie(xx,r),u=Z6(r),d=Xi(),f=s&&l.value.includes(s)||!1,h=o.disabled||e.disabled;return b.jsx($ie,{scope:r,open:f,disabled:h,triggerId:d,children:b.jsx(yie,{"data-orientation":o.orientation,"data-state":q6(f),...u,...i,ref:n,disabled:h,open:f,onOpenChange:g=>{g?l.onItemOpen(s):l.onItemClose(s)}})})},"AccordionItem")),Vie="AccordionHeader",Hie=m.forwardRef(As(function(e,n){const{__scopeAccordion:r,...s}=e,i=kv(oo,r),o=W6(Vie,r);return b.jsx(kn.h3,{"data-orientation":i.orientation,"data-state":q6(o.open),"data-disabled":o.disabled?"":void 0,...s,ref:n})},"AccordionHeader")),H5="AccordionTrigger",zie=m.forwardRef(As(function(e,n){const{__scopeAccordion:r,...s}=e,i=kv(oo,r),o=W6(H5,r),l=Lie(H5,r),u=Z6(r);return b.jsx(B6.ItemSlot,{scope:r,children:b.jsx(wie,{"aria-disabled":o.open&&!l.collapsible||void 0,"data-orientation":i.orientation,id:o.triggerId,...u,...s,ref:n})})},"AccordionTrigger")),Uie="AccordionContent",Bie=m.forwardRef(As(function(e,n){const{__scopeAccordion:r,...s}=e,i=kv(oo,r),o=W6(Uie,r),l=Z6(r);return b.jsx(xie,{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 q6(t){return t?"open":"closed"}As(q6,"getState");/**
|
|
156
|
+
* @license lucide-react v1.57.0 - ISC
|
|
157
|
+
*
|
|
158
|
+
* This source code is licensed under the ISC license.
|
|
159
|
+
* See the LICENSE file in the root directory of this source tree.
|
|
160
|
+
*/const Zie=t=>t==null?void 0:t.replace(/([a-z0-9])([A-Z])/g,"$1-$2").toLowerCase();/**
|
|
161
|
+
* @license lucide-react v1.57.0 - ISC
|
|
162
|
+
*
|
|
163
|
+
* This source code is licensed under the ISC license.
|
|
164
|
+
* See the LICENSE file in the root directory of this source tree.
|
|
165
|
+
*/function Wie(t,e,n=[]){if(e==null)throw new Error("[lucide]: iconNode is required when icon name is used");return{name:Zie(t),size:24,node:e,...n.length>0?{aliases:n}:{}}}/**
|
|
166
|
+
* @license lucide-react v1.57.0 - ISC
|
|
167
|
+
*
|
|
168
|
+
* This source code is licensed under the ISC license.
|
|
169
|
+
* See the LICENSE file in the root directory of this source tree.
|
|
170
|
+
*/const qie=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};/**
|
|
171
|
+
* @license lucide-react v1.57.0 - ISC
|
|
172
|
+
*
|
|
173
|
+
* This source code is licensed under the ISC license.
|
|
174
|
+
* See the LICENSE file in the root directory of this source tree.
|
|
175
|
+
*/const Gie=t=>{const e=qie(t);return e.charAt(0).toUpperCase()+e.slice(1)};/**
|
|
176
|
+
* @license lucide-react v1.57.0 - ISC
|
|
177
|
+
*
|
|
178
|
+
* This source code is licensed under the ISC license.
|
|
179
|
+
* See the LICENSE file in the root directory of this source tree.
|
|
180
|
+
*/const bx=(...t)=>t.filter((e,n,r)=>!!e&&e.trim()!==""&&r.indexOf(e)===n).join(" ").trim();/**
|
|
181
|
+
* @license lucide-react v1.57.0 - ISC
|
|
182
|
+
*
|
|
183
|
+
* This source code is licensed under the ISC license.
|
|
184
|
+
* See the LICENSE file in the root directory of this source tree.
|
|
185
|
+
*/const Bl={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"};/**
|
|
186
|
+
* @license lucide-react v1.57.0 - ISC
|
|
187
|
+
*
|
|
188
|
+
* This source code is licensed under the ISC license.
|
|
189
|
+
* See the LICENSE file in the root directory of this source tree.
|
|
190
|
+
*/function t2(t){return t!=null}function Kie(t,e={}){var g,v;const n=e.attributeNames??{},r=x=>n[x]??x,s=t.size??t.width??Bl.width,i=t.size??t.height??Bl.height,o=((g=t.aliases)==null?void 0:g.filter(x=>typeof x=="string"&&x.trim()!=="").map(x=>`lucide-${x}`))??[],l=[...t.name?[`lucide-${t.name}`]:[],...o],u=((v=e.className)==null?void 0:v.split(" ").filter(Boolean))??[],d=e.includeDefaultClasses===!1?bx(...u):bx("lucide",...l,...u),f=e.absoluteStrokeWidth?Number(e.strokeWidth??Bl["stroke-width"])*Number(t.size??t.width??Bl.width)/Number(e.size??e.width??Bl.width):e.strokeWidth??Bl["stroke-width"];return["svg",{...Object.entries(Bl).reduce((x,[_,w])=>(x[r(_)]=w,x),{}),..."color"in e&&e.color&&{[r("stroke")]:e.color},..."size"in e&&t2(e.size)&&{[r("width")]:e.size,[r("height")]:e.size},..."width"in e&&t2(e.width)&&{[r("width")]:e.width},..."height"in e&&t2(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(x=>{const[_,w,S]=x,k=e.nonScalingStroke?{[r("vector-effect")]:"non-scaling-stroke",...w}:w;return S?[_,k,S]:[_,k]})]}/**
|
|
191
|
+
* @license lucide-react v1.57.0 - ISC
|
|
192
|
+
*
|
|
193
|
+
* This source code is licensed under the ISC license.
|
|
194
|
+
* See the LICENSE file in the root directory of this source tree.
|
|
195
|
+
*/function Yie(t,e={}){return Kie(t,{...e,attributeNames:{...e.attributeNames,class:"className","stroke-width":"strokeWidth","stroke-linecap":"strokeLinecap","stroke-linejoin":"strokeLinejoin","vector-effect":"vectorEffect"}})}/**
|
|
196
|
+
* @license lucide-react v1.57.0 - ISC
|
|
197
|
+
*
|
|
198
|
+
* This source code is licensed under the ISC license.
|
|
199
|
+
* See the LICENSE file in the root directory of this source tree.
|
|
200
|
+
*/const Qie=t=>{for(const e in t)if(e.startsWith("aria-")||e==="role"||e==="title")return!0;return!1},Xie=m.createContext({}),Jie=()=>m.useContext(Xie),eoe=m.forwardRef(({color:t,size:e,width:n,height:r,strokeWidth:s,absoluteStrokeWidth:i,nonScalingStroke:o,className:l="",children:u,iconNode:d=[],icon:f={node:d,aliases:[],size:24},...h},g)=>{const{size:v=24,strokeWidth:x=2,absoluteStrokeWidth:_=!1,nonScalingStroke:w=!1,color:S="currentColor",className:k=""}=Jie()??{},E=!!u||Qie(h),[P,T,I=[]]=Yie(f,{color:t??S,width:n??e??v,height:r??e??v,strokeWidth:s??x,absoluteStrokeWidth:i??_,nonScalingStroke:o??w,className:bx(k,l),hasA11yProp:E,attributes:h});return m.createElement(P,{ref:g,...T},[...I.map(([M,R])=>m.createElement(M,R)),...Array.isArray(u)?u:[u]])});/**
|
|
201
|
+
* @license lucide-react v1.57.0 - ISC
|
|
202
|
+
*
|
|
203
|
+
* This source code is licensed under the ISC license.
|
|
204
|
+
* See the LICENSE file in the root directory of this source tree.
|
|
205
|
+
*/function lt(t,e=[],n=[]){const r=typeof t=="string"?Wie(t,e,n):t,s=m.forwardRef(({className:i,...o},l)=>m.createElement(eoe,{ref:l,icon:r,className:i,...o}));return r.name&&(s.displayName=Gie(r.name)),s}/**
|
|
206
|
+
* @license lucide-react v1.57.0 - ISC
|
|
207
|
+
*
|
|
208
|
+
* This source code is licensed under the ISC license.
|
|
209
|
+
* See the LICENSE file in the root directory of this source tree.
|
|
210
|
+
*/const pN={name:"arrow-left",size:24,node:[["path",{d:"m12 19-7-7 7-7",key:"1l729n"}],["path",{d:"M19 12H5",key:"x3x0zl"}]]};pN.node;const toe=lt(pN);/**
|
|
211
|
+
* @license lucide-react v1.57.0 - ISC
|
|
212
|
+
*
|
|
213
|
+
* This source code is licensed under the ISC license.
|
|
214
|
+
* See the LICENSE file in the root directory of this source tree.
|
|
215
|
+
*/const mN={name:"arrow-right",size:24,node:[["path",{d:"M5 12h14",key:"1ays0h"}],["path",{d:"m12 5 7 7-7 7",key:"xquz4c"}]]};mN.node;const noe=lt(mN);/**
|
|
216
|
+
* @license lucide-react v1.57.0 - ISC
|
|
217
|
+
*
|
|
218
|
+
* This source code is licensed under the ISC license.
|
|
219
|
+
* See the LICENSE file in the root directory of this source tree.
|
|
220
|
+
*/const gN={name:"arrow-up",size:24,node:[["path",{d:"m5 12 7-7 7 7",key:"hav0vg"}],["path",{d:"M12 19V5",key:"x0mq9r"}]]};gN.node;const roe=lt(gN);/**
|
|
221
|
+
* @license lucide-react v1.57.0 - ISC
|
|
222
|
+
*
|
|
223
|
+
* This source code is licensed under the ISC license.
|
|
224
|
+
* See the LICENSE file in the root directory of this source tree.
|
|
225
|
+
*/const vN={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"}]]};vN.node;const soe=lt(vN);/**
|
|
226
|
+
* @license lucide-react v1.57.0 - ISC
|
|
227
|
+
*
|
|
228
|
+
* This source code is licensed under the ISC license.
|
|
229
|
+
* See the LICENSE file in the root directory of this source tree.
|
|
230
|
+
*/const yN={name:"brain",size:24,node:[["path",{d:"M12 18V5",key:"adv99a"}],["path",{d:"M15 13a4.17 4.17 0 0 1-3-4 4.17 4.17 0 0 1-3 4",key:"1e3is1"}],["path",{d:"M17.598 6.5A3 3 0 1 0 12 5a3 3 0 1 0-5.598 1.5",key:"1gqd8o"}],["path",{d:"M17.997 5.125a4 4 0 0 1 2.526 5.77",key:"iwvgf7"}],["path",{d:"M18 18a4 4 0 0 0 2-7.464",key:"efp6ie"}],["path",{d:"M19.967 17.483A4 4 0 1 1 12 18a4 4 0 1 1-7.967-.517",key:"1gq6am"}],["path",{d:"M6 18a4 4 0 0 1-2-7.464",key:"k1g0md"}],["path",{d:"M6.003 5.125a4 4 0 0 0-2.526 5.77",key:"q97ue3"}]]};yN.node;const ioe=lt(yN);/**
|
|
231
|
+
* @license lucide-react v1.57.0 - ISC
|
|
232
|
+
*
|
|
233
|
+
* This source code is licensed under the ISC license.
|
|
234
|
+
* See the LICENSE file in the root directory of this source tree.
|
|
235
|
+
*/const _N={name:"check",size:24,node:[["path",{d:"M20 6 9 17l-5-5",key:"1gmf2c"}]]};_N.node;const ooe=lt(_N);/**
|
|
236
|
+
* @license lucide-react v1.57.0 - ISC
|
|
237
|
+
*
|
|
238
|
+
* This source code is licensed under the ISC license.
|
|
239
|
+
* See the LICENSE file in the root directory of this source tree.
|
|
240
|
+
*/const wN={name:"chevron-down",size:24,node:[["path",{d:"m6 9 6 6 6-6",key:"qrunsl"}]]};wN.node;const aoe=lt(wN);/**
|
|
241
|
+
* @license lucide-react v1.57.0 - ISC
|
|
242
|
+
*
|
|
243
|
+
* This source code is licensed under the ISC license.
|
|
244
|
+
* See the LICENSE file in the root directory of this source tree.
|
|
245
|
+
*/const xN={name:"chevron-right",size:24,node:[["path",{d:"m9 18 6-6-6-6",key:"mthhwq"}]]};xN.node;const loe=lt(xN);/**
|
|
246
|
+
* @license lucide-react v1.57.0 - ISC
|
|
247
|
+
*
|
|
248
|
+
* This source code is licensed under the ISC license.
|
|
249
|
+
* See the LICENSE file in the root directory of this source tree.
|
|
250
|
+
*/const bN={name:"circle",size:24,node:[["circle",{cx:"12",cy:"12",r:"10",key:"1mglay"}]]};bN.node;const coe=lt(bN);/**
|
|
251
|
+
* @license lucide-react v1.57.0 - ISC
|
|
252
|
+
*
|
|
253
|
+
* This source code is licensed under the ISC license.
|
|
254
|
+
* See the LICENSE file in the root directory of this source tree.
|
|
255
|
+
*/const SN={name:"clock",size:24,node:[["circle",{cx:"12",cy:"12",r:"10",key:"1mglay"}],["path",{d:"M12 6v6l4 2",key:"mmk7yg"}]]};SN.node;const uoe=lt(SN);/**
|
|
256
|
+
* @license lucide-react v1.57.0 - ISC
|
|
257
|
+
*
|
|
258
|
+
* This source code is licensed under the ISC license.
|
|
259
|
+
* See the LICENSE file in the root directory of this source tree.
|
|
260
|
+
*/const kN={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"}]]};kN.node;const doe=lt(kN);/**
|
|
261
|
+
* @license lucide-react v1.57.0 - ISC
|
|
262
|
+
*
|
|
263
|
+
* This source code is licensed under the ISC license.
|
|
264
|
+
* See the LICENSE file in the root directory of this source tree.
|
|
265
|
+
*/const CN={name:"dot",size:24,node:[["circle",{cx:"12",cy:"12",r:"1",key:"41hilf"}]]};CN.node;const foe=lt(CN);/**
|
|
266
|
+
* @license lucide-react v1.57.0 - ISC
|
|
267
|
+
*
|
|
268
|
+
* This source code is licensed under the ISC license.
|
|
269
|
+
* See the LICENSE file in the root directory of this source tree.
|
|
270
|
+
*/const EN={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"}]]};EN.node;const hoe=lt(EN);/**
|
|
271
|
+
* @license lucide-react v1.57.0 - ISC
|
|
272
|
+
*
|
|
273
|
+
* This source code is licensed under the ISC license.
|
|
274
|
+
* See the LICENSE file in the root directory of this source tree.
|
|
275
|
+
*/const PN={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"}]]};PN.node;const poe=lt(PN);/**
|
|
276
|
+
* @license lucide-react v1.57.0 - ISC
|
|
277
|
+
*
|
|
278
|
+
* This source code is licensed under the ISC license.
|
|
279
|
+
* See the LICENSE file in the root directory of this source tree.
|
|
280
|
+
*/const AN={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"]};AN.node;const moe=lt(AN);/**
|
|
281
|
+
* @license lucide-react v1.57.0 - ISC
|
|
282
|
+
*
|
|
283
|
+
* This source code is licensed under the ISC license.
|
|
284
|
+
* See the LICENSE file in the root directory of this source tree.
|
|
285
|
+
*/const TN={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"}]]};TN.node;const goe=lt(TN);/**
|
|
286
|
+
* @license lucide-react v1.57.0 - ISC
|
|
287
|
+
*
|
|
288
|
+
* This source code is licensed under the ISC license.
|
|
289
|
+
* See the LICENSE file in the root directory of this source tree.
|
|
290
|
+
*/const RN={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"}]]};RN.node;const voe=lt(RN);/**
|
|
291
|
+
* @license lucide-react v1.57.0 - ISC
|
|
292
|
+
*
|
|
293
|
+
* This source code is licensed under the ISC license.
|
|
294
|
+
* See the LICENSE file in the root directory of this source tree.
|
|
295
|
+
*/const MN={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"}]]};MN.node;const yoe=lt(MN);/**
|
|
296
|
+
* @license lucide-react v1.57.0 - ISC
|
|
297
|
+
*
|
|
298
|
+
* This source code is licensed under the ISC license.
|
|
299
|
+
* See the LICENSE file in the root directory of this source tree.
|
|
300
|
+
*/const IN={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"}]]};IN.node;const _oe=lt(IN);/**
|
|
301
|
+
* @license lucide-react v1.57.0 - ISC
|
|
302
|
+
*
|
|
303
|
+
* This source code is licensed under the ISC license.
|
|
304
|
+
* See the LICENSE file in the root directory of this source tree.
|
|
305
|
+
*/const ON={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"}]]};ON.node;const woe=lt(ON);/**
|
|
306
|
+
* @license lucide-react v1.57.0 - ISC
|
|
307
|
+
*
|
|
308
|
+
* This source code is licensed under the ISC license.
|
|
309
|
+
* See the LICENSE file in the root directory of this source tree.
|
|
310
|
+
*/const LN={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"}]]};LN.node;const xoe=lt(LN);/**
|
|
311
|
+
* @license lucide-react v1.57.0 - ISC
|
|
312
|
+
*
|
|
313
|
+
* This source code is licensed under the ISC license.
|
|
314
|
+
* See the LICENSE file in the root directory of this source tree.
|
|
315
|
+
*/const NN={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"}]]};NN.node;const boe=lt(NN);/**
|
|
316
|
+
* @license lucide-react v1.57.0 - ISC
|
|
317
|
+
*
|
|
318
|
+
* This source code is licensed under the ISC license.
|
|
319
|
+
* See the LICENSE file in the root directory of this source tree.
|
|
320
|
+
*/const DN={name:"menu",size:24,node:[["path",{d:"M4 5h16",key:"1tepv9"}],["path",{d:"M4 12h16",key:"1lakjw"}],["path",{d:"M4 19h16",key:"1djgab"}]]};DN.node;const Soe=lt(DN);/**
|
|
321
|
+
* @license lucide-react v1.57.0 - ISC
|
|
322
|
+
*
|
|
323
|
+
* This source code is licensed under the ISC license.
|
|
324
|
+
* See the LICENSE file in the root directory of this source tree.
|
|
325
|
+
*/const jN={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"}]]};jN.node;const koe=lt(jN);/**
|
|
326
|
+
* @license lucide-react v1.57.0 - ISC
|
|
327
|
+
*
|
|
328
|
+
* This source code is licensed under the ISC license.
|
|
329
|
+
* See the LICENSE file in the root directory of this source tree.
|
|
330
|
+
*/const $N={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"}]]};$N.node;const Coe=lt($N);/**
|
|
331
|
+
* @license lucide-react v1.57.0 - ISC
|
|
332
|
+
*
|
|
333
|
+
* This source code is licensed under the ISC license.
|
|
334
|
+
* See the LICENSE file in the root directory of this source tree.
|
|
335
|
+
*/const FN={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"}]]};FN.node;const Eoe=lt(FN);/**
|
|
336
|
+
* @license lucide-react v1.57.0 - ISC
|
|
337
|
+
*
|
|
338
|
+
* This source code is licensed under the ISC license.
|
|
339
|
+
* See the LICENSE file in the root directory of this source tree.
|
|
340
|
+
*/const VN={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"}]]};VN.node;const Poe=lt(VN);/**
|
|
341
|
+
* @license lucide-react v1.57.0 - ISC
|
|
342
|
+
*
|
|
343
|
+
* This source code is licensed under the ISC license.
|
|
344
|
+
* See the LICENSE file in the root directory of this source tree.
|
|
345
|
+
*/const HN={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"}]]};HN.node;const Aoe=lt(HN);/**
|
|
346
|
+
* @license lucide-react v1.57.0 - ISC
|
|
347
|
+
*
|
|
348
|
+
* This source code is licensed under the ISC license.
|
|
349
|
+
* See the LICENSE file in the root directory of this source tree.
|
|
350
|
+
*/const zN={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"}]]};zN.node;const Toe=lt(zN);/**
|
|
351
|
+
* @license lucide-react v1.57.0 - ISC
|
|
352
|
+
*
|
|
353
|
+
* This source code is licensed under the ISC license.
|
|
354
|
+
* See the LICENSE file in the root directory of this source tree.
|
|
355
|
+
*/const UN={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"}]]};UN.node;const Roe=lt(UN);/**
|
|
356
|
+
* @license lucide-react v1.57.0 - ISC
|
|
357
|
+
*
|
|
358
|
+
* This source code is licensed under the ISC license.
|
|
359
|
+
* See the LICENSE file in the root directory of this source tree.
|
|
360
|
+
*/const BN={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"}]]};BN.node;const Moe=lt(BN);/**
|
|
361
|
+
* @license lucide-react v1.57.0 - ISC
|
|
362
|
+
*
|
|
363
|
+
* This source code is licensed under the ISC license.
|
|
364
|
+
* See the LICENSE file in the root directory of this source tree.
|
|
365
|
+
*/const ZN={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"}]]};ZN.node;const Ioe=lt(ZN);/**
|
|
366
|
+
* @license lucide-react v1.57.0 - ISC
|
|
367
|
+
*
|
|
368
|
+
* This source code is licensed under the ISC license.
|
|
369
|
+
* See the LICENSE file in the root directory of this source tree.
|
|
370
|
+
*/const WN={name:"plus",size:24,node:[["path",{d:"M5 12h14",key:"1ays0h"}],["path",{d:"M12 5v14",key:"s699le"}]]};WN.node;const Ooe=lt(WN);/**
|
|
371
|
+
* @license lucide-react v1.57.0 - ISC
|
|
372
|
+
*
|
|
373
|
+
* This source code is licensed under the ISC license.
|
|
374
|
+
* See the LICENSE file in the root directory of this source tree.
|
|
375
|
+
*/const qN={name:"rectangle-horizontal",size:24,node:[["rect",{width:"20",height:"12",x:"2",y:"6",rx:"2",key:"9lu3g6"}]]};qN.node;const Loe=lt(qN);/**
|
|
376
|
+
* @license lucide-react v1.57.0 - ISC
|
|
377
|
+
*
|
|
378
|
+
* This source code is licensed under the ISC license.
|
|
379
|
+
* See the LICENSE file in the root directory of this source tree.
|
|
380
|
+
*/const GN={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"}]]};GN.node;const Noe=lt(GN);/**
|
|
381
|
+
* @license lucide-react v1.57.0 - ISC
|
|
382
|
+
*
|
|
383
|
+
* This source code is licensed under the ISC license.
|
|
384
|
+
* See the LICENSE file in the root directory of this source tree.
|
|
385
|
+
*/const KN={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"}]]};KN.node;const Doe=lt(KN);/**
|
|
386
|
+
* @license lucide-react v1.57.0 - ISC
|
|
387
|
+
*
|
|
388
|
+
* This source code is licensed under the ISC license.
|
|
389
|
+
* See the LICENSE file in the root directory of this source tree.
|
|
390
|
+
*/const YN={name:"search",size:24,node:[["path",{d:"m21 21-4.34-4.34",key:"14j7rj"}],["circle",{cx:"11",cy:"11",r:"8",key:"4ej97u"}]]};YN.node;const joe=lt(YN);/**
|
|
391
|
+
* @license lucide-react v1.57.0 - ISC
|
|
392
|
+
*
|
|
393
|
+
* This source code is licensed under the ISC license.
|
|
394
|
+
* See the LICENSE file in the root directory of this source tree.
|
|
395
|
+
*/const QN={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"}]]};QN.node;const $oe=lt(QN);/**
|
|
396
|
+
* @license lucide-react v1.57.0 - ISC
|
|
397
|
+
*
|
|
398
|
+
* This source code is licensed under the ISC license.
|
|
399
|
+
* See the LICENSE file in the root directory of this source tree.
|
|
400
|
+
*/const XN={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"}]]};XN.node;const Foe=lt(XN);/**
|
|
401
|
+
* @license lucide-react v1.57.0 - ISC
|
|
402
|
+
*
|
|
403
|
+
* This source code is licensed under the ISC license.
|
|
404
|
+
* See the LICENSE file in the root directory of this source tree.
|
|
405
|
+
*/const JN={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"}]]};JN.node;const Voe=lt(JN);/**
|
|
406
|
+
* @license lucide-react v1.57.0 - ISC
|
|
407
|
+
*
|
|
408
|
+
* This source code is licensed under the ISC license.
|
|
409
|
+
* See the LICENSE file in the root directory of this source tree.
|
|
410
|
+
*/const eD={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"]};eD.node;const Hoe=lt(eD);/**
|
|
411
|
+
* @license lucide-react v1.57.0 - ISC
|
|
412
|
+
*
|
|
413
|
+
* This source code is licensed under the ISC license.
|
|
414
|
+
* See the LICENSE file in the root directory of this source tree.
|
|
415
|
+
*/const tD={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"}]]};tD.node;const zoe=lt(tD);/**
|
|
416
|
+
* @license lucide-react v1.57.0 - ISC
|
|
417
|
+
*
|
|
418
|
+
* This source code is licensed under the ISC license.
|
|
419
|
+
* See the LICENSE file in the root directory of this source tree.
|
|
420
|
+
*/const nD={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"}]]};nD.node;const Uoe=lt(nD);/**
|
|
421
|
+
* @license lucide-react v1.57.0 - ISC
|
|
422
|
+
*
|
|
423
|
+
* This source code is licensed under the ISC license.
|
|
424
|
+
* See the LICENSE file in the root directory of this source tree.
|
|
425
|
+
*/const rD={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"}]]};rD.node;const Boe=lt(rD);/**
|
|
426
|
+
* @license lucide-react v1.57.0 - ISC
|
|
427
|
+
*
|
|
428
|
+
* This source code is licensed under the ISC license.
|
|
429
|
+
* See the LICENSE file in the root directory of this source tree.
|
|
430
|
+
*/const sD={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"}]]};sD.node;const Zoe=lt(sD);/**
|
|
431
|
+
* @license lucide-react v1.57.0 - ISC
|
|
432
|
+
*
|
|
433
|
+
* This source code is licensed under the ISC license.
|
|
434
|
+
* See the LICENSE file in the root directory of this source tree.
|
|
435
|
+
*/const iD={name:"x",size:24,node:[["path",{d:"M18 6 6 18",key:"1bl5f8"}],["path",{d:"m6 6 12 12",key:"d8bk6v"}]]};iD.node;const Woe=lt(iD),qoe={"chevron-right":loe,"chevron-down":aoe,pipette:Moe,x:Woe,copy:doe,menu:Soe,dot:foe,monitor:Coe,sun:Uoe,moon:Eoe,"rectangle-horizontal":Loe,circle:coe,"square-library":Hoe,clock:uoe,star:zoe,settings:$oe,plus:Ooe,"arrow-left":toe,"arrow-right":noe,"arrow-up":roe,search:joe,loader:woe,users:Zoe,lock:xoe,mail:boe,bell:soe,shield:Foe,palette:Aoe,lightbulb:yoe,rocket:Noe,heart:poe,paintbrush:Poe,brain:ioe,globe:hoe,user:Boe,image:goe,link:_oe,check:ooe,"rotate-ccw":Doe,play:Ioe,pause:Toe,home:moe,"message-circle":koe,inbox:voe,pencil:Roe,"skip-forward":Voe},z5={lucide:qoe},oD=m.createContext(null);function Goe(t){const e=m.useContext(oD);return e?z5[e.iconLibrary][t]:z5.lucide[t]}function Koe({children:t,defaultLibrary:e="lucide"}){const[n,r]=m.useState(e),s=m.useCallback(i=>{r(i)},[]);return b.jsx(oD.Provider,{value:{iconLibrary:n,setIconLibrary:s},children:t})}const aD=m.createContext(null);function G6(){return m.useContext(aD)}const lD=m.createContext(null);function cD(){const t=m.useContext(lD);if(!t)throw new Error("AccordionTrigger/AccordionContent must be used within an AccordionItem");return t}const Yoe=m.forwardRef((t,e)=>{const{children:n,type:r="single",className:s,...i}=t,o=m.useRef(null),l=m.useRef(new Map),[u,d]=m.useState(new Map),{activeIndex:f,setActiveIndex:h,itemRects:g,sessionRef:v,handlers:x,registerItem:_,measureItems:w}=g9(o),S=m.useCallback((ue,re)=>{re?l.current.set(ue,re):l.current.delete(ue)},[]),k=m.useCallback(()=>{if(!o.current)return;const ue=new Map;l.current.forEach((re,Pe)=>{ue.set(Pe,{top:re.offsetTop,left:re.offsetLeft,width:re.offsetWidth,height:re.offsetHeight})}),d(ue)},[]),[E,P]=m.useState(()=>r==="single"?t.defaultValue??"":""),[T,I]=m.useState(()=>r==="multiple"?t.defaultValue??[]:[]),M=t.onValueChange,R=t.onValueChange,O=t.value,D=new Set(r==="multiple"?t.value??T:(()=>{const ue=t.value??E;return ue?[ue]:[]})()),$=m.useCallback(ue=>{const re=t;re.onValueChange?re.onValueChange(ue):P(ue)},[M]),V=m.useCallback(ue=>{const re=t;re.onValueChange?re.onValueChange(ue):I(ue)},[R]),q=m.useCallback(ue=>{if(r==="multiple"){const re=t.value??T;V(re.filter(Pe=>Pe!==ue))}else $("")},[r,$,V,T,O]);m.useEffect(()=>{w(),k()},[w,k,n]);const B=[...D].join(",");m.useEffect(()=>{w(),k()},[w,k,B]);const[K,z]=m.useState(null),X=f!==null?g[f]:null,Z=K!==null?g[K]:null,J=f!==null&&!u.has(f),H=ip(),{value:N,defaultValue:Y,onValueChange:ae,collapsible:se,type:ie,...de}=i,ge=r==="multiple"?{type:"multiple",value:t.value??T,onValueChange:V}:{type:"single",collapsible:t.collapsible??!0,value:t.value??E,onValueChange:$};return b.jsx(aD.Provider,{value:{registerItem:_,registerFullItem:S,activeIndex:f,grouped:!0,remeasure:()=>{w(),k()},openValues:D,openItemRects:u,toggleValue:q},children:b.jsx(uN,{...ge,asChild:!0,children:b.jsxs("div",{ref:ue=>{o.current=ue,typeof e=="function"?e(ue):e&&(e.current=ue)},onMouseEnter:x.onMouseEnter,onMouseMove:ue=>{const re=o.current;if(re){const Pe=re.getBoundingClientRect(),$e=re.offsetHeight,Ee=Pe.height,dt=$e>0?Ee/$e:1,Tt=(ue.clientY-Pe.top)/dt+re.scrollTop;for(const[rn,jt]of u){const xt=g[rn];if(!xt)continue;const Xt=xt.top+xt.height,Ct=jt.top+jt.height;if(Tt>=Xt&&Tt<=Ct){h(null);return}}}x.onMouseMove(ue)},onMouseLeave:x.onMouseLeave,onFocus:ue=>{var Pe;const re=(Pe=ue.target.closest("[data-proximity-index]"))==null?void 0:Pe.getAttribute("data-proximity-index");if(re!=null){const $e=Number(re);h($e),z(ue.target.matches(":focus-visible")?$e:null)}},onBlur:ue=>{var re;(re=o.current)!=null&&re.contains(ue.relatedTarget)||(z(null),h(null))},className:zt("relative flex flex-col gap-0.5 w-72 max-w-full",s),...de,children:[b.jsx(Es,{children:[...u.entries()].map(([ue,re])=>b.jsx(Ho.div,{className:`absolute ${H.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:J?.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-${ue}`))}),b.jsx(Es,{children:X&&b.jsx(Ho.div,{className:`absolute ${H.bg} bg-hover pointer-events-none`,initial:{opacity:0,top:X.top,left:X.left,width:X.width,height:X.height},animate:{opacity:1,top:X.top,left:X.left,width:X.width,height:X.height},exit:{opacity:0,transition:{duration:.06}},transition:{...Nh.fast,opacity:{duration:.08}}},v.current)}),b.jsx(Es,{children:Z&&b.jsx(Ho.div,{className:`absolute ${H.focusRing} pointer-events-none z-20 border border-[#6B97FF]`,initial:!1,animate:{left:Z.left-2,top:Z.top-2,width:Z.width+4,height:Z.height+4},exit:{opacity:0,transition:{duration:.06}},transition:{...Nh.fast,opacity:{duration:.08}}})}),n]})})})});Yoe.displayName="AccordionGroup";const uD=m.forwardRef(({children:t,type:e="single",collapsible:n=!0,defaultValue:r,value:s,onValueChange:i,className:o,...l},u)=>{const[d,f]=m.useState(()=>e==="single"?r??"":""),[h,g]=m.useState(()=>e==="multiple"?r??[]:[]),v=new Set(e==="multiple"?s??h:(()=>{const k=s??d;return k?[k]:[]})()),x=m.useCallback(k=>{i?i(k):f(k)},[i]),_=m.useCallback(k=>{i?i(k):g(k)},[i]),w=m.useCallback(k=>{e==="multiple"?_((s??h).filter(P=>P!==k)):x("")},[e,s,h,x,_]),S=e==="multiple"?{type:"multiple",value:s??h,defaultValue:r,onValueChange:_}:{type:"single",collapsible:n,value:s??d,defaultValue:r,onValueChange:x};return b.jsx(uN,{...S,asChild:!0,children:b.jsx("div",{ref:u,className:zt("w-72 max-w-full flex flex-col gap-0.5",o),...l,children:b.jsx(dD.Provider,{value:v,children:b.jsx(fD.Provider,{value:w,children:t})})})})});uD.displayName="Accordion";const dD=m.createContext(new Set),fD=m.createContext(()=>{}),hD=m.forwardRef(({value:t,index:e,disabled:n,children:r,className:s,...i},o)=>{const l=m.useRef(null),u=G6(),d=m.useContext(dD),f=m.useContext(fD),h=ip(),g=u!=null&&u.grouped?u.openValues.has(t):d.has(t),v=m.useRef(null),x=m.useCallback(()=>{u!=null&&u.grouped?u.toggleValue(t):f(t)},[u,f,t]);return m.useEffect(()=>{if(u!=null&&u.grouped&&e!==void 0)return u.registerItem(e,v.current),()=>u.registerItem(e,null)},[e,u]),m.useEffect(()=>{if(u!=null&&u.grouped&&e!==void 0)return g?u.registerFullItem(e,l.current):u.registerFullItem(e,null),()=>u.registerFullItem(e,null)},[e,u,g]),b.jsx(lD.Provider,{value:{index:e,value:t,isOpen:g,onToggle:x,triggerRef:v},children:b.jsxs(Fie,{ref:_=>{l.current=_,typeof o=="function"?o(_):o&&(o.current=_)},value:t,disabled:n,"data-proximity-index":e,className:zt(!(u!=null&&u.grouped)&&"relative",s),...i,children:[!(u!=null&&u.grouped)&&b.jsx(Es,{children:g&&b.jsx(Ho.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]})})});hD.displayName="AccordionItem";const pD=m.forwardRef(({children:t,className:e,...n},r)=>{const s=Goe("chevron-right"),i=G6(),{index:o,isOpen:l,triggerRef:u}=cD(),d=ip(),[f,h]=m.useState(!1),g=i!=null&&i.grouped?i.activeIndex===o:f,v=b.jsx(Hie,{asChild:!0,children:b.jsx("div",{children:b.jsxs(zie,{ref:r,className:zt(`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:[b.jsxs("span",{className:"inline-grid text-[13px] flex-1 text-left",children:[b.jsx("span",{className:"col-start-1 row-start-1 invisible",style:{fontVariationSettings:sh.semibold},"aria-hidden":"true",children:t}),b.jsx("span",{className:zt("col-start-1 row-start-1 transition-[color,font-variation-settings] duration-80",l||g?"text-foreground":"text-muted-foreground"),style:{fontVariationSettings:l?sh.semibold:sh.normal},children:t})]}),b.jsx(Ho.span,{className:"shrink-0 inline-flex items-center justify-center",animate:{rotate:l?90:0},transition:Nh.fast,children:b.jsx(s,{size:16,strokeWidth:l||g?2:1.5,className:zt("transition-[color,stroke-width] duration-80",l||g?"text-foreground":"text-muted-foreground")})})]})})});return i!=null&&i.grouped?b.jsx("div",{ref:u,children:v}):b.jsxs("div",{className:"relative",onMouseEnter:()=>h(!0),onMouseLeave:()=>h(!1),children:[b.jsx(Es,{children:f&&b.jsx(Ho.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]})});pD.displayName="AccordionTrigger";const mD=m.forwardRef(({children:t,className:e,...n},r)=>{const s=G6(),{isOpen:i}=cD();return b.jsx(Es,{initial:!1,children:i&&b.jsx(Bie,{forceMount:!0,asChild:!0,...n,children:b.jsx(Ho.div,{ref:r,className:zt("overflow-hidden",e),initial:{height:0},animate:{height:"auto"},exit:{height:0},transition:{...Nh.moderate,bounce:0},onUpdate:()=>{s==null||s.remeasure()},onAnimationComplete:()=>{s==null||s.remeasure()},children:b.jsx("div",{className:"px-3 pb-3 pt-1 text-[13px] text-muted-foreground",children:t})})})})});mD.displayName="AccordionContent";const Cm=({children:t,defaultValue:e=[],className:n=""})=>b.jsx(uD,{type:"multiple",defaultValue:e,className:zt("w-full",n),children:t}),Qoe=({value:t,title:e,description:n,dataCy:r,icon:s,children:i,className:o=""})=>{const l=o.includes("first-item");return b.jsxs(hD,{value:t,className:zt("w-full",!l&&"border-t border-main-border"),children:[b.jsxs(pD,{"data-cy":r,children:[s?b.jsx("span",{className:"mr-1 inline-flex items-center",children:s}):null,e]}),b.jsxs(mD,{children:[n?b.jsx("p",{className:"pb-2 text-sm text-content-subtle",children:n}):null,i]})]})};Cm.Item=Qoe;const Xoe=({message:t,isLoading:e=!0})=>b.jsxs("div",{className:"flex items-center gap-2 text-sm text-content",children:[e?b.jsx(Xg,{className:"h-4 w-4 shrink-0 animate-spin text-primary",weight:"bold"}):null,b.jsx("span",{className:"whitespace-pre-wrap font-sans",children:t})]}),Joe=()=>{const t=m.useRef(Date.now()),[e,n]=m.useState(0);return m.useEffect(()=>{const r=()=>n(Math.max(0,Math.floor((Date.now()-t.current)/1e3)));r();const s=setInterval(r,1e3);return()=>clearInterval(s)},[]),e},eae=t=>{const e=Math.floor(t/60),n=t%60;return`${e}:${n.toString().padStart(2,"0")}`},U5="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",B5="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",tae="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",Em=["Applying","Thinking","Planning","Crafting"],nae=Em.reduce((t,e)=>t.length>=e.length?t:e),rae=20,sae="Still working — runs can take a few minutes.",iae=({hint:t,showElapsed:e=!0})=>{const[n,r]=m.useState(0),s=Joe();m.useEffect(()=>{const o=setInterval(()=>{r(l=>(l+1)%Em.length)},4e3);return()=>clearInterval(o)},[]);const i=t??(e&&s>=rae?sae:null);return b.jsxs("div",{role:"status",className:"flex items-center gap-2 px-3 py-1","data-cy":"thinking-indicator",children:[b.jsx(Si.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:b.jsx(Si.path,{animate:{d:[U5,B5,tae,B5,U5]},transition:{d:{duration:6,ease:"easeInOut",repeat:1/0,times:[0,.25,.5,.75,1]}}})}),b.jsxs("span",{className:"inline-grid overflow-hidden text-sm font-medium",style:{fontVariationSettings:sh.medium},children:[b.jsx("span",{className:"shimmer-text invisible col-start-1 row-start-1","aria-hidden":"true",children:nae}),b.jsx(Es,{mode:"popLayout",initial:!1,children:b.jsx(Si.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:Em[n]},Em[n])})]}),e?b.jsx("span",{className:"text-xs tabular-nums text-content-subtle","data-cy":"thinking-elapsed",children:eae(s)}):null,i?b.jsx("span",{className:"text-xs text-content-subtle",children:i}):null]})};var oae=Object.defineProperty,aae=(t,e)=>oae(t,"name",{value:e,configurable:!0});function Dg(t,[e,n]){return Math.min(n,Math.max(e,t))}aae(Dg,"clamp");var lae=Object.defineProperty,It=(t,e)=>lae(t,"name",{value:e,configurable:!0}),Z5={Horizontal:"horizontal"},cae={LTR:"ltr"},gD=["PageUp","PageDown"],vD=["ArrowUp","ArrowDown","ArrowLeft","ArrowRight"],yD={"from-left":["Home","PageDown","ArrowDown","ArrowLeft"],"from-right":["Home","PageDown","ArrowDown","ArrowRight"],"from-bottom":["Home","PageDown","ArrowDown","ArrowLeft"],"from-top":["Home","PageDown","ArrowUp","ArrowLeft"]},fp="Slider",[Sx,uae,dae]=tN(fp),[K6,sle]=io(fp,[dae]),[fae,jd]=K6(fp),hae=m.forwardRef(It(function(e,n){const{name:r,min:s=0,max:i=100,step:o=1,orientation:l=Z5.Horizontal,disabled:u=!1,minStepsBetweenThumbs:d=0,preserveThumbOrder:f=!1,defaultValue:h=[s],value:g,onValueChange:v=It(()=>{},"onValueChange"),onValueCommit:x=It(()=>{},"onValueCommit"),inverted:_=!1,form:w,...S}=e,k=m.useRef(new Set),E=m.useRef(0),P=m.useRef(!1),[T,I]=m.useState(null),R=l===Z5.Horizontal?pae:mae,[O,D]=m.useState(null),$=Zt(n,D),[V=[],q]=ll({prop:g,defaultProp:h,onChange:It(H=>{var Y;(Y=[...k.current][E.current])==null||Y.focus({preventScroll:!0,focusVisible:P.current}),P.current=!1,v(H)},"onChange")}),B=m.useRef(V),K=m.useRef(V);m.useEffect(()=>{const H=w?O==null?void 0:O.ownerDocument.getElementById(w):O==null?void 0:O.closest("form");if(H instanceof HTMLFormElement){const N=It(()=>q(K.current),"reset");return H.addEventListener("reset",N),()=>H.removeEventListener("reset",N)}},[O,w,q]);function z(H){const N=ED(V,H);J(H,N)}It(z,"handleSlideStart");function X(H){J(H,E.current)}It(X,"handleSlideMove");function Z(){String(V)!==String(B.current)&&x(V)}It(Z,"handleSlideEnd");function J(H,N,{commit:Y}={commit:!1}){const ae=Q6(o),se=ch(Math.round((H-s)/o)*o+s,ae),ie=Dg(se,[s,i]),de=d*o;function ge(re){const Pe=f?Dg(ie,[re[N-1]===void 0?s:re[N-1]+de,re[N+1]===void 0?i:re[N+1]-de]):ie,$e=kD(re,Pe,N);return TD($e,de)?{nextValues:$e,changedIndex:f?N:$e.indexOf(Pe),hasChanged:String($e)!==String(re)}:null}It(ge,"getNextValues");const ue=ge(V);ue!=null&&ue.hasChanged&&I(ue.nextValues),q((re=[])=>{const Pe=ge(re);return Pe?(E.current=Pe.changedIndex,Pe.hasChanged&&Y&&x(Pe.nextValues),Pe.hasChanged?Pe.nextValues:re):re})}return It(J,"updateValues"),b.jsx(fae,{scope:e.__scopeSlider,name:r,disabled:u,min:s,max:i,valueIndexToChangeRef:E,thumbs:k.current,values:V,orientation:l,form:w,userRequestedValues:T,children:b.jsx(Sx.Provider,{scope:e.__scopeSlider,children:b.jsx(Sx.Slot,{scope:e.__scopeSlider,children:b.jsx(R,{"aria-disabled":u,"data-disabled":u?"":void 0,...S,ref:$,onPointerDown:Bt(S.onPointerDown,()=>{u||(B.current=V,P.current=!1)}),min:s,max:i,inverted:_,onSlideStart:u?void 0:z,onSlideMove:u?void 0:X,onSlideEnd:u?void 0:Z,onHomeKeyDown:()=>{u||(P.current=!0,J(s,0,{commit:!0}))},onEndKeyDown:()=>{u||(P.current=!0,J(i,V.length-1,{commit:!0}))},onStepKeyDown:({event:H,direction:N})=>{if(!u){P.current=!0;const se=gD.includes(H.key)||H.shiftKey&&vD.includes(H.key)?10:1,ie=E.current,de=V[ie],ge=RD(de,{min:s,step:o,direction:N,multiplier:se});J(ge,ie,{commit:!0})}}})})})})},"Slider")),[_D,wD]=K6(fp,{startEdge:"left",endEdge:"right",size:"width",direction:1}),pae=m.forwardRef(It(function(e,n){const{min:r,max:s,dir:i,inverted:o,onSlideStart:l,onSlideMove:u,onSlideEnd:d,onStepKeyDown:f,...h}=e,[g,v]=m.useState(null),x=Zt(n,v),_=m.useRef(void 0),w=U6(i),S=w===cae.LTR,k=S&&!o||!S&&o;function E(P){const T=_.current||g.getBoundingClientRect(),I=[0,T.width],R=Cv(I,k?[r,s]:[s,r]);return _.current=T,R(P-T.left)}return It(E,"getValueFromPointer"),b.jsx(_D,{scope:e.__scopeSlider,startEdge:k?"left":"right",endEdge:k?"right":"left",direction:k?1:-1,size:"width",children:b.jsx(xD,{dir:w,"data-orientation":"horizontal",...h,ref:x,style:{...h.style,"--radix-slider-thumb-transform":"translateX(-50%)"},onSlideStart:P=>{const T=E(P.clientX);l==null||l(T)},onSlideMove:P=>{const T=E(P.clientX);u==null||u(T)},onSlideEnd:()=>{_.current=void 0,d==null||d()},onStepKeyDown:P=>{const I=yD[k?"from-left":"from-right"].includes(P.key);f==null||f({event:P,direction:I?-1:1})}})})},"SliderHorizontal")),mae=m.forwardRef(It(function(e,n){const{min:r,max:s,inverted:i,onSlideStart:o,onSlideMove:l,onSlideEnd:u,onStepKeyDown:d,...f}=e,h=m.useRef(null),g=Zt(n,h),v=m.useRef(void 0),x=!i;function _(w){const S=v.current||h.current.getBoundingClientRect(),k=[0,S.height],P=Cv(k,x?[s,r]:[r,s]);return v.current=S,P(w-S.top)}return It(_,"getValueFromPointer"),b.jsx(_D,{scope:e.__scopeSlider,startEdge:x?"bottom":"top",endEdge:x?"top":"bottom",size:"height",direction:x?1:-1,children:b.jsx(xD,{"data-orientation":"vertical",...f,ref:g,style:{...f.style,"--radix-slider-thumb-transform":"translateY(50%)"},onSlideStart:w=>{const S=_(w.clientY);o==null||o(S)},onSlideMove:w=>{const S=_(w.clientY);l==null||l(S)},onSlideEnd:()=>{v.current=void 0,u==null||u()},onStepKeyDown:w=>{const k=yD[x?"from-bottom":"from-top"].includes(w.key);d==null||d({event:w,direction:k?-1:1})}})})},"SliderVertical")),xD=m.forwardRef(It(function(e,n){const{__scopeSlider:r,onSlideStart:s,onSlideMove:i,onSlideEnd:o,onHomeKeyDown:l,onEndKeyDown:u,onStepKeyDown:d,...f}=e,h=jd(fp,r);return b.jsx(kn.span,{...f,ref:n,onKeyDown:Bt(e.onKeyDown,g=>{g.key==="Home"?(l(g),g.preventDefault()):g.key==="End"?(u(g),g.preventDefault()):gD.concat(vD).includes(g.key)&&(d(g),g.preventDefault())}),onPointerDown:Bt(e.onPointerDown,g=>{const v=g.target;v.setPointerCapture(g.pointerId),g.preventDefault(),h.thumbs.has(v)?v.focus({preventScroll:!0,focusVisible:!1}):s(g)}),onPointerMove:Bt(e.onPointerMove,g=>{g.target.hasPointerCapture(g.pointerId)&&i(g)}),onPointerUp:Bt(e.onPointerUp,g=>{const v=g.target;v.hasPointerCapture(g.pointerId)&&(v.releasePointerCapture(g.pointerId),o(g))})})},"SliderImpl")),gae="SliderTrack",vae=m.forwardRef(It(function(e,n){const{__scopeSlider:r,...s}=e,i=jd(gae,r);return b.jsx(kn.span,{"data-disabled":i.disabled?"":void 0,"data-orientation":i.orientation,...s,ref:n})},"SliderTrack")),W5="SliderRange",yae=m.forwardRef(It(function(e,n){const{__scopeSlider:r,...s}=e,i=jd(W5,r),o=wD(W5,r),l=m.useRef(null),u=Zt(n,l),d=i.values.length,f=i.values.map(v=>Y6(v,i.min,i.max)),h=d>1?Math.min(...f):0,g=100-Math.max(...f);return b.jsx(kn.span,{"data-orientation":i.orientation,"data-disabled":i.disabled?"":void 0,...s,ref:u,style:{...e.style,[o.startEdge]:h+"%",[o.endEdge]:g+"%"}})},"SliderRange")),_ae="SliderThumb",[wae,bD]=K6(_ae),xae="SliderThumbProvider";function SD(t){const{__scopeSlider:e,name:n,children:r,internal_do_not_use_render:s}=t,i=jd(xae,e),o=uae(e),[l,u]=m.useState(null),d=m.useMemo(()=>l?o().findIndex(w=>w.ref.current===l):-1,[o,l]),f=t6(l),h=l?!!i.form||!!l.closest("form"):!0,g=i.values[d],v=n??(i.name?i.name+(i.values.length>1?"[]":""):void 0),x=g===void 0?0:Y6(g,i.min,i.max);m.useEffect(()=>{if(l)return i.thumbs.add(l),()=>{i.thumbs.delete(l)}},[l,i.thumbs]);const _={value:g,name:v,form:i.form,isFormControl:h,index:d,thumb:l,onThumbChange:u,percent:x,size:f};return b.jsx(wae,{scope:e,..._,children:MD(s)?s(_):r})}It(SD,"SliderThumbProvider");var n2="SliderThumbTrigger",bae=m.forwardRef(It(function(e,n){const{__scopeSlider:r,...s}=e,i=jd(n2,r),o=wD(n2,r),{index:l,value:u,percent:d,size:f,onThumbChange:h}=bD(n2,r),g=Zt(n,h),v=CD(l,i.values.length),x=f==null?void 0:f[o.size],_=x?PD(x,d,o.direction):0;return b.jsx("span",{style:{transform:"var(--radix-slider-thumb-transform)",position:"absolute",[o.startEdge]:`calc(${d}% + ${_}px)`},children:b.jsx(Sx.ItemSlot,{scope:r,children:b.jsx(kn.span,{role:"slider","aria-label":e["aria-label"]||v,"aria-valuemin":i.min,"aria-valuenow":u,"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:g,style:u===void 0?{display:"none"}:e.style,onFocus:Bt(e.onFocus,()=>{i.valueIndexToChangeRef.current=l})})})})},"SliderThumbTrigger")),Sae=m.forwardRef(It(function(e,n){const{__scopeSlider:r,name:s,...i}=e;return b.jsx(SD,{__scopeSlider:r,name:s,internal_do_not_use_render:({index:o,isFormControl:l})=>b.jsxs(b.Fragment,{children:[b.jsx(bae,{...i,ref:n,__scopeSlider:r}),l?b.jsx(kae,{__scopeSlider:r},o):null]})})},"SliderThumb")),q5="SliderBubbleInput",kae=m.forwardRef(It(function({__scopeSlider:e,onInput:n,...r},s){const{index:i,value:o,name:l,form:u}=bD(q5,e),{userRequestedValues:d}=jd(q5,e),f=m.useRef(null),h=Zt(f,s),g=m.useRef(!1),v=m.useRef(o),x=m.useRef(d),_=m.useRef(d);return m.useEffect(()=>{const w=f.current;if(!w)return;const S=window.HTMLInputElement.prototype,E=Object.getOwnPropertyDescriptor(S,"value").set,P=v.current,T=P!==o;v.current=o;const I=d!==_.current;if(_.current=d,T&&E){const M=d!==x.current;x.current=d;const R=d==null?void 0:d[i],O=M&&(I&&R!==P||R===o);g.current=!O;const D=new Event("input",{bubbles:!0});E.call(w,o),w.dispatchEvent(D),g.current=!1}},[i,o,d]),b.jsx(kn.input,{style:{display:"none"},name:l,form:u,...r,ref:h,defaultValue:o,onInput:Bt(n,w=>{g.current&&w.stopPropagation()})})},"SliderBubbleInput"));function kD(t=[],e,n){const r=[...t];return r[n]=e,r.sort((s,i)=>s-i)}It(kD,"getNextSortedValues");function Y6(t,e,n){const i=100/(n-e)*(t-e);return Dg(i,[0,100])}It(Y6,"convertValueToPercentage");function CD(t,e){return e>2?`Value ${t+1} of ${e}`:e===2?["Minimum","Maximum"][t]:void 0}It(CD,"getLabel");function ED(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)}It(ED,"getClosestValueIndex");function PD(t,e,n){const r=t/2,i=Cv([0,50],[0,r]);return(r-i(e)*n)*n}It(PD,"getThumbInBoundsOffset");function AD(t){return t.slice(0,-1).map((e,n)=>t[n+1]-e)}It(AD,"getStepsBetweenValues");function TD(t,e){if(e>0){const n=AD(t);return Math.min(...n)>=e}return!0}It(TD,"hasMinStepsBetweenValues");function Cv(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])}}It(Cv,"linearScale");function Q6(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}It(Q6,"getDecimalCount");function ch(t,e){const n=Math.pow(10,e);return Math.round(t*n)/n}It(ch,"roundValue");function RD(t,{min:e,step:n,direction:r,multiplier:s}){const i=Q6(n),o=(t-e)/n,l=Math.round(o),u=ch(l*n+e,i)===ch(t,i);let d;return u?d=l+s*r:r>0?d=Math.ceil(o):d=Math.floor(o),ch(d*n+e,i)}It(RD,"getNextStepValue");function MD(t){return typeof t=="function"}It(MD,"isFunction");const kx=m.forwardRef(({className:t,...e},n)=>b.jsxs(hae,{ref:n,className:zt("relative flex w-full touch-none select-none items-center","data-[disabled]:opacity-50",t),...e,children:[b.jsx(vae,{className:"relative h-1 w-full grow overflow-hidden rounded-full bg-input",children:b.jsx(yae,{className:"absolute h-full bg-primary"})}),b.jsx(Sae,{className:zt("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")})]}));kx.displayName="Slider";const Cae=[{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"}],Eae=[{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"}],Pae=[{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"}],K0=[{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:"CommentMarker",path:"components/CommentMarker.tsx",status:"feature-only",note:"Preview overlay marker tied to comment positions."},{name:"CommentPopover",path:"components/CommentPopover.tsx",status:"feature-only",note:"Comment workflow popover tied to editor state."},{name:"CommentReferenceChip",path:"components/CommentReferenceChip.tsx",status:"feature-only",note:"Comment workflow chip tied to selected references."},{name:"CommentReferencePicker",path:"components/CommentReferencePicker.tsx",status:"feature-only",note:"Comment workflow picker tied to preview elements."},{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."}],Aae=()=>{window.location.hash=""},ko=({title:t,eyebrow:e,description:n,children:r})=>b.jsxs("section",{className:"border-border bg-card shadow-surface-3 rounded-2xl border p-5",children:[b.jsxs("div",{className:"mb-5 max-w-2xl",children:[b.jsx("p",{className:"text-primary text-xs font-semibold tracking-[0.18em] uppercase",children:e}),b.jsx("h2",{className:"text-foreground mt-2 text-xl font-semibold",children:t}),b.jsx("p",{className:"text-muted-foreground mt-2 text-sm leading-6",children:n})]}),r]}),G5=({swatches:t})=>b.jsx("div",{className:"grid gap-3 sm:grid-cols-2 lg:grid-cols-3",children:t.map(e=>b.jsxs("div",{className:"border-border bg-surface-2 rounded-xl border p-3",children:[b.jsx("div",{className:`h-16 rounded-lg ${e.className}`}),b.jsxs("div",{className:"mt-3 flex items-center justify-between gap-3",children:[b.jsx("span",{className:"text-foreground text-sm font-medium",children:e.name}),b.jsx("code",{className:"bg-muted text-muted-foreground rounded px-2 py-1 text-xs",children:e.utility})]})]},e.name))}),Tae=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",Rae=()=>{const t=K0.filter(n=>n.status==="showcased").length,e=K0.filter(n=>n.status==="cataloged").length;return b.jsx("main",{className:"bg-main font-main text-content h-screen overflow-y-auto",children:b.jsxs("div",{className:"mx-auto flex w-full max-w-6xl flex-col gap-6 px-6 py-6 lg:px-8",children:[b.jsxs("header",{className:"border-border bg-surface-2 shadow-surface-4 rounded-3xl border p-6",children:[b.jsxs("button",{type:"button",onClick:Aae,className:"text-content-subtle hover:text-content mb-6 inline-flex items-center gap-2 text-sm transition-colors",children:[b.jsx(NK,{className:"h-4 w-4",weight:"bold"}),"Back to editor"]}),b.jsxs("div",{className:"flex flex-col gap-5 lg:flex-row lg:items-end lg:justify-between",children:[b.jsxs("div",{className:"max-w-3xl",children:[b.jsx("p",{className:"text-primary text-xs font-semibold tracking-[0.22em] uppercase",children:"Local component gallery"}),b.jsx("h1",{className:"text-foreground mt-3 text-4xl font-semibold tracking-tight",children:"Rivet design system"}),b.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."})]}),b.jsx("div",{className:"border-border bg-surface-3 rounded-2xl border p-4",children:b.jsxs("div",{className:"text-content-muted flex items-center gap-3 text-sm",children:[b.jsx(y3,{className:"text-primary h-5 w-5",weight:"bold"}),"Open with ",b.jsx("code",{className:"text-content",children:"#/design-system"})]})})]})]}),b.jsx(ko,{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:b.jsxs("div",{className:"grid gap-4 lg:grid-cols-[1fr_1fr]",children:[b.jsxs("div",{className:"border-border bg-surface-2 rounded-xl border p-4",children:[b.jsx("p",{className:"text-foreground mb-3 text-sm font-medium",children:"Rivet Button"}),b.jsxs("div",{className:"flex flex-wrap items-center gap-3",children:[b.jsx(Ji,{title:"Primary action",shortcut:"D",variant:"primary",children:"Design action"}),b.jsx(Ji,{title:"Secondary action",variant:"secondary",children:"Secondary"}),b.jsx(Ji,{title:"Disabled action",disabled:!0,variant:"tertiary",children:"Disabled"}),b.jsx(O9,{primaryLabel:"Ship",primaryIcon:x_,primaryAction:()=>{},dropdownItems:[{label:"Create PR",onClick:()=>{}},{label:"Copy branch",onClick:()=>{}}]})]})]}),b.jsxs("div",{className:"border-border bg-surface-2 rounded-xl border p-4",children:[b.jsx("p",{className:"text-foreground mb-3 text-sm font-medium",children:"Tooltip states"}),b.jsxs("div",{className:"flex flex-wrap items-center gap-4",children:[b.jsx(Ac,{label:"Rivet tooltip API",side:"bottom",children:b.jsx("button",{className:"border-border bg-surface-4 text-content rounded-lg border px-4 py-2 text-sm",children:"Hover target"})}),b.jsx(o6,{content:"Forced open preview",forceOpen:!0,side:"right",children:b.jsx("button",{className:"bg-selected text-content rounded-lg px-4 py-2 text-sm",children:"UI tooltip"})})]})]})]})}),b.jsx(ko,{eyebrow:"Tokens",title:"Surface ladder",description:"Surface tokens move from the base app background toward raised panels without leaving the dark Rivet palette.",children:b.jsx(G5,{swatches:Cae})}),b.jsx(ko,{eyebrow:"Tokens",title:"Color roles",description:"Named roles should communicate purpose: brand, selection, neutral accent, and outcome colors.",children:b.jsx(G5,{swatches:Eae})}),b.jsx(ko,{eyebrow:"Type",title:"Typography",description:"Satoshi remains the default UI voice with clear hierarchy and muted support text.",children:b.jsxs("div",{className:"grid gap-4 lg:grid-cols-3",children:[b.jsxs("div",{className:"border-border bg-surface-2 rounded-xl border p-4",children:[b.jsx("p",{className:"text-primary text-xs tracking-[0.18em] uppercase",children:"Display"}),b.jsx("p",{className:"text-foreground mt-2 text-3xl font-semibold tracking-tight",children:"Visual edits, quickly"})]}),b.jsxs("div",{className:"border-border bg-surface-2 rounded-xl border p-4",children:[b.jsx("p",{className:"text-foreground text-sm font-semibold",children:"Panel heading"}),b.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."})]}),b.jsxs("div",{className:"border-border bg-surface-2 rounded-xl border p-4",children:[b.jsx("p",{className:"text-content-subtle text-xs font-medium tracking-[0.16em] uppercase",children:"Micro label"}),b.jsx("code",{className:"bg-muted text-muted-foreground mt-3 block rounded-lg px-3 py-2 text-xs",children:"font-main text-content"})]})]})}),b.jsx(ko,{eyebrow:"Layout",title:"Spacing rhythm",description:"A compact spacing scale keeps editor chrome dense while preserving scannable groupings.",children:b.jsx("div",{className:"border-border bg-surface-2 rounded-xl border p-4",children:b.jsx("div",{className:"flex flex-col gap-3",children:Pae.map(n=>b.jsxs("div",{className:"flex items-center gap-4",children:[b.jsx("code",{className:"text-muted-foreground w-16 text-xs",children:n.name}),b.jsx("div",{className:`${n.className} bg-primary h-4 rounded`}),b.jsx("div",{className:"bg-border h-px flex-1"})]},n.name))})})}),b.jsx(ko,{eyebrow:"Primitives",title:"Accordion and slider",description:"Representative Radix primitives styled through the local component layer.",children:b.jsxs("div",{className:"grid gap-4 lg:grid-cols-2",children:[b.jsxs(Cm,{defaultValue:["foundations"],className:"border-border bg-surface-2 rounded-xl border p-2",children:[b.jsx(Cm.Item,{value:"foundations",title:"Foundations",description:"Tokens, surfaces, type, and spacing.",className:"first-item",icon:b.jsx(x_,{className:"text-primary h-4 w-4"}),children:b.jsx("p",{children:"Use these pieces before adding one-off visual rules."})}),b.jsx(Cm.Item,{value:"components",title:"Components",description:"Buttons, tooltips, accordions, sliders.",children:b.jsx("p",{children:"Keep states visible in this route as the system evolves."})})]}),b.jsxs("div",{className:"border-border bg-surface-2 rounded-xl border p-5",children:[b.jsx("p",{className:"text-foreground mb-5 text-sm font-medium",children:"Slider states"}),b.jsxs("div",{className:"space-y-6",children:[b.jsx(kx,{defaultValue:[64],max:100,step:1}),b.jsx(kx,{defaultValue:[36],max:100,step:1,disabled:!0})]})]})]})}),b.jsx(ko,{eyebrow:"Feedback",title:"Motion and loading",description:"Loading states use existing CSS animation utilities and avoid per-frame React work where possible.",children:b.jsxs("div",{className:"grid gap-4 sm:grid-cols-3",children:[b.jsxs("div",{className:"border-border bg-surface-2 rounded-xl border p-4",children:[b.jsx("p",{className:"text-foreground mb-4 text-sm font-medium",children:"Progress"}),b.jsx(Xoe,{message:"Applying visual change..."})]}),b.jsxs("div",{className:"border-border bg-surface-2 rounded-xl border p-4",children:[b.jsx("p",{className:"text-foreground mb-4 text-sm font-medium",children:"Sparkle strip"}),b.jsx(y6,{className:"text-primary text-xl"})]}),b.jsxs("div",{className:"border-border bg-surface-2 rounded-xl border p-4",children:[b.jsx("p",{className:"text-foreground mb-4 text-sm font-medium",children:"Shimmer text"}),b.jsx("span",{className:"shimmer-text text-sm font-medium",children:"Generating variants"})]}),b.jsx("div",{className:"border-border bg-surface-2 rounded-xl border p-4 sm:col-span-3",children:b.jsx(iae,{hint:"Reading selected elements"})})]})}),b.jsx(ko,{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:b.jsxs("div",{className:"grid gap-4 sm:grid-cols-2",children:[b.jsx("div",{className:"border-border relative h-56 overflow-hidden rounded-xl border",children:b.jsx(ix,{fill:"surface",loader:"coalesce",trackGlobalLoaderCount:!1})}),b.jsx("div",{className:"border-border relative h-56 overflow-hidden rounded-xl border",children:b.jsx(nL,{icon:b.jsx(x_,{size:32}),title:"Nothing to preview yet",description:"Pick a direction from the panel."})}),b.jsx("div",{className:"border-border relative h-56 overflow-hidden rounded-xl border",children:b.jsx(w6,{fill:"surface",size:"sm",title:"Preview isn't connected",description:"Rivet lost connection to your project.",actions:[{label:"Reload",onClick:()=>{}}]})})]})}),b.jsxs(ko,{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:[b.jsxs("div",{className:"mb-4 grid gap-3 sm:grid-cols-3",children:[b.jsxs("div",{className:"border-border bg-surface-2 rounded-xl border p-4",children:[b.jsx("p",{className:"text-content-subtle text-xs tracking-[0.16em] uppercase",children:"Total components"}),b.jsx("p",{className:"text-foreground mt-2 text-2xl font-semibold",children:K0.length})]}),b.jsxs("div",{className:"border-border bg-surface-2 rounded-xl border p-4",children:[b.jsx("p",{className:"text-content-subtle text-xs tracking-[0.16em] uppercase",children:"Showcased"}),b.jsx("p",{className:"text-accent-success mt-2 text-2xl font-semibold",children:t})]}),b.jsxs("div",{className:"border-border bg-surface-2 rounded-xl border p-4",children:[b.jsx("p",{className:"text-content-subtle text-xs tracking-[0.16em] uppercase",children:"Cataloged"}),b.jsx("p",{className:"text-primary mt-2 text-2xl font-semibold",children:e})]})]}),b.jsxs("div",{className:"border-border overflow-hidden rounded-xl border",children:[b.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:[b.jsx("span",{children:"Component"}),b.jsx("span",{children:"Status"}),b.jsx("span",{children:"Coverage note"})]}),b.jsx("div",{className:"divide-border bg-surface-2 divide-y",children:K0.map(n=>b.jsxs("div",{className:"grid grid-cols-[minmax(140px,1fr)_minmax(110px,auto)_minmax(220px,2fr)] gap-3 px-4 py-3 text-sm",children:[b.jsxs("div",{children:[b.jsx("p",{className:"text-foreground font-medium",children:n.name}),b.jsx("code",{className:"text-muted-foreground text-xs",children:n.path})]}),b.jsx("div",{children:b.jsx("span",{className:`inline-flex rounded-full border px-2 py-1 text-xs font-medium ${Tae(n.status)}`,children:n.status})}),b.jsx("p",{className:"text-muted-foreground",children:n.note})]},n.path))})]})]})]})})},Mae=t=>(t.startsWith("#/")?t.slice(2):t.slice(1)).split("?")[0]==="design-system"?"design-system":"editor",Cx=274,jg=395,r2=Math.min(jg,Math.round((Cx+jg)/2*1.1)),K5="rivet:panelWidth:v2",Iae=t=>{if(!(t instanceof HTMLElement))return!1;const e=t.tagName.toLowerCase();return t.isContentEditable||e==="input"||e==="textarea"||e==="select"},Oae=({projectPath:t,libraryOrigin:e})=>{const n=ct(C9)>0,[r,s]=fM(S9),i=IG(),[o,l]=m.useState(()=>{if(typeof window>"u")return r2;const T=Number(window.localStorage.getItem(K5));return Number.isFinite(T)&&T>=Cx&&T<=jg?T:r2}),[u,d]=m.useState(!1),[f,h]=m.useState(Kse),g=r?o:0,[v,x]=m.useState(r);m.useEffect(()=>{if(!r){x(!1);return}h(T=>Gse({position:T,boundsLeftPx:o}))},[r,o]),m.useEffect(()=>{window.localStorage.setItem(K5,String(o))},[o]),m.useEffect(()=>{if(!r)return;const T=I=>{I.key==="Escape"&&(Iae(I.target)||(I.preventDefault(),s(!1)))};return window.addEventListener("keydown",T),()=>window.removeEventListener("keydown",T)},[r,s]);const _=m.useCallback(T=>{T.preventDefault(),T.stopPropagation();const I=T.clientX,M=o;d(!0);const R=D=>{const $=Math.min(jg,Math.max(Cx,M+(D.clientX-I)));l($)},O=()=>{window.removeEventListener("pointermove",R),window.removeEventListener("pointerup",O),window.removeEventListener("pointercancel",O),d(!1)};window.addEventListener("pointermove",R),window.addEventListener("pointerup",O),window.addEventListener("pointercancel",O)},[o]),w=m.useCallback(()=>l(r2),[]),S=uie(),k=ct(gv);hie({enabled:!k});const E=S.isProcessing?"Completing authentication...":null,P=mt(mv);return m.useEffect(()=>{P(t??null)},[t,P]),b.jsxs(Si.div,{className:"relative flex h-screen overflow-hidden",initial:!1,animate:{opacity:1},transition:{duration:.5,ease:"easeOut"},"data-cy":"rivet-app",children:[E!==null?b.jsx("div",{className:"absolute inset-0 z-50",children:b.jsx(Nse,{message:E})}):null,b.jsx(cre,{}),b.jsx(b.Fragment,{children:n?null:b.jsxs(b.Fragment,{children:[b.jsx("div",{className:"relative order-first h-full flex-shrink-0",style:{width:v?o:0},children:b.jsxs(Si.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&&x(!0)},style:{width:o,willChange:"transform"},children:[b.jsx(wne,{onClose:()=>s(!1),libraryOrigin:e}),b.jsx("div",{role:"separator","aria-orientation":"vertical","aria-label":"Resize panel",onPointerDown:_,onDoubleClick:w,className:"group/resize absolute inset-y-0 right-0 z-20 flex w-3 cursor-col-resize touch-none justify-end",children:b.jsx("span",{className:`h-full transition-all duration-150 ${u?"bg-content-muted w-0.5":"bg-divider group-hover/resize:bg-content-muted w-px group-hover/resize:w-0.5"}`})})]})}),u&&b.jsx("div",{className:"fixed inset-0 z-[100] cursor-col-resize"}),b.jsx(Xse,{isVisible:!0,isPanelOpen:r,isReducedMotion:!!i,position:f,dragBoundsLeftPx:g,onPositionChange:h,onToggle:()=>s(T=>!T)})]})}),b.jsx(lK,{duration:5e3,richColors:!0,toastOptions:{style:{maxHeight:"150px",overflow:"hidden"}}})]})},Ex="rivet_connect_deep_link",Lae=()=>{if(typeof window>"u")return null;const t=new URLSearchParams(window.location.search),e=t.get("connect"),n=e??window.sessionStorage.getItem(Ex);if(n!=="pinterest"&&n!=="arena"&&n!=="x")return null;if(window.sessionStorage.setItem(Ex,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},Nae=Lae(),Dae=()=>{const[t,e]=m.useState(window.location.hash),[n]=m.useState(()=>typeof window<"u"&&window.sessionStorage.getItem(Eg)==="1"),[r,s]=m.useState(!1),[i,o]=m.useState(Nae);m.useEffect(()=>{n&&window.sessionStorage.removeItem(Eg)},[n]);const{config:l,refetchConfig:u,loading:d,error:f}=lie(),h=mt(gv),{startLogin:g,isStartingLogin:v,loginError:x}=q9(),[_,w]=m.useState(!1);m.useEffect(()=>{l!=null&&l.userId?(Ie.identify(l.userId,{...l.email?{email:l.email}:{}}),l.email&&Ie.alias(l.email,l.userId)):l!=null&&l.email&&Ie.identify(l.email,{email:l.email})},[l==null?void 0:l.userId,l==null?void 0:l.email]),m.useEffect(()=>{l&&Ie.register({source:"visual_editor",surface:"visual_editor"})},[l]);const S=l!=null&&l.agentModeAvailable!==!0,k=Mae(t),E=m.useCallback(async()=>{w(!0),h(!0);try{await u()}finally{h(!1),w(!1)}},[u,h]);if(m.useEffect(()=>{const M=()=>{const R=window.location.hash;e(R)};return window.addEventListener("hashchange",M),()=>window.removeEventListener("hashchange",M)},[]),k==="design-system")return b.jsx(Rae,{});if(!d&&l===null&&!_){const M=f||"Could not load Rivet configuration.";return b.jsx("div",{className:"bg-main flex h-screen items-center justify-center px-6",children:b.jsxs("div",{className:"border-divider bg-main w-full max-w-md rounded-lg border p-6 text-center shadow-lg",children:[b.jsx("p",{className:"text-content text-sm font-medium",children:"We could not start Rivet yet."}),b.jsx("p",{className:"text-content-dim mt-2 text-xs",children:M}),b.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:()=>{E()},children:"Retry"})]})})}if(S)return b.jsx(Ose,{isSigningIn:v,onStartSignIn:()=>{g()},errorMessage:x,displayMode:"full"});const T=(l==null?void 0:l.agentModeAvailable)===!0&&i!==null,I=(l==null?void 0:l.agentModeAvailable)===!0&&n&&!r&&!T;return b.jsxs(b.Fragment,{children:[b.jsx(Oae,{projectPath:l==null?void 0:l.projectPath,libraryOrigin:(l==null?void 0:l.libraryOrigin)??null}),b.jsx(sx,{context:"onboarding",isOpen:I,onClose:()=>s(!0)}),b.jsx(sx,{context:"menu",isOpen:T,highlightProvider:i,onClose:()=>{window.sessionStorage.removeItem(Ex),o(null)}})]})},jae=m.lazy(()=>aA(()=>import("./LibraryEntry-CcZDyWE6.js"),[])),ID=window.location.pathname.startsWith("/rivet/library"),$ae="phc_Ntj9tXHbS64XgYxlTfhglRmFivFsfm0AERph4ZlnNH",Fae=new Hj,Vae={session_recording:{maskAllInputs:!0,maskTextSelector:"[data-rivet-private]"}},Hae=()=>b.jsx("div",{style:{display:"flex",height:"100vh",alignItems:"center",justifyContent:"center"},children:b.jsx("p",{style:{fontSize:"14px",color:"#6b7280"},children:"Something went wrong. Please reload the page."})}),OD=document.getElementById("root");if(!OD)throw new Error("Rivet root element is missing");const Y5=()=>rU.createRoot(OD).render(b.jsx(xe.StrictMode,{children:b.jsx(dz,{apiKey:$ae,options:{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",...Vae,mask_all_text:!1,mask_all_element_attributes:!1,loaded:t=>{t.register({source:"visual_editor",surface:"visual_editor",telemetry_version:2,rivet_version:"0.21.7",env:"production"})}},children:b.jsx(vz,{fallback:b.jsx(Hae,{}),children:b.jsx(mj,{client:Fae,children:b.jsx(eQ,{defaultShape:"rounded",children:b.jsx(Koe,{defaultLibrary:"lucide",children:ID?b.jsx(m.Suspense,{fallback:b.jsx("div",{className:"bg-background h-screen"}),children:b.jsx(jae,{})}):b.jsx(Dae,{})})})})})})}));ID?Kz().then(Y5):Y5();export{Uz as $,cv as A,Ji as B,uv as C,lv as D,dv as E,fv as F,hv as G,Mt as H,Br as I,Dse as J,sp as K,joe as L,iM as M,dh as N,C3 as O,f6 as P,Nj as Q,rh as R,Qh as S,ooe as T,Ug as U,Rn as V,Qe as W,Woe as X,tM as Y,gd as Z,bC as _,zj as a,Uae as a0,WY as a1,be as a2,Zz as a3,bh as a4,ele as a5,tle as a6,Yz as a7,Ote as a8,zt as a9,Kae as aa,Yae as ab,toe as ac,_ne as ad,lK as ae,Tte as af,qae as ag,Wae as ah,Bae as ai,q9 as aj,Gz as ak,qz as al,Zae as am,Zj as b,m as c,Wj as d,Kj as e,qj as f,$j as g,uh as h,es as i,Yj as j,Qj as k,Gj as l,pA as m,mr as n,lt as o,Xs as p,v9 as q,fA as r,dy as s,b as t,cA as u,Ow as v,h6 as w,p6 as x,m6 as y,Roe as z};
|