rivet-design 0.14.21 → 0.16.0

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.
Files changed (62) hide show
  1. package/dist/agent-variants/SessionStore.d.ts +15 -0
  2. package/dist/agent-variants/SessionStore.d.ts.map +1 -1
  3. package/dist/agent-variants/SessionStore.js +28 -1
  4. package/dist/agent-variants/SessionStore.js.map +1 -1
  5. package/dist/agent-variants/WorktreeOrchestrator.d.ts +21 -0
  6. package/dist/agent-variants/WorktreeOrchestrator.d.ts.map +1 -1
  7. package/dist/agent-variants/WorktreeOrchestrator.js +59 -5
  8. package/dist/agent-variants/WorktreeOrchestrator.js.map +1 -1
  9. package/dist/agent-variants/contextAssets.d.ts +2 -0
  10. package/dist/agent-variants/contextAssets.d.ts.map +1 -1
  11. package/dist/agent-variants/contextAssets.js +7 -1
  12. package/dist/agent-variants/contextAssets.js.map +1 -1
  13. package/dist/cli/commands/mcpServe.d.ts.map +1 -1
  14. package/dist/cli/commands/mcpServe.js +9 -0
  15. package/dist/cli/commands/mcpServe.js.map +1 -1
  16. package/dist/cli/commands/variants.d.ts.map +1 -1
  17. package/dist/cli/commands/variants.js +0 -4
  18. package/dist/cli/commands/variants.js.map +1 -1
  19. package/dist/cli/handoff.d.ts +15 -0
  20. package/dist/cli/handoff.d.ts.map +1 -1
  21. package/dist/cli/handoff.js +51 -1
  22. package/dist/cli/handoff.js.map +1 -1
  23. package/dist/cli/router.d.ts.map +1 -1
  24. package/dist/cli/router.js +1 -21
  25. package/dist/cli/router.js.map +1 -1
  26. package/dist/install/harnesses.d.ts +11 -0
  27. package/dist/install/harnesses.d.ts.map +1 -1
  28. package/dist/install/harnesses.js +57 -58
  29. package/dist/install/harnesses.js.map +1 -1
  30. package/dist/install/legacyMcp.d.ts +15 -6
  31. package/dist/install/legacyMcp.d.ts.map +1 -1
  32. package/dist/install/legacyMcp.js +20 -46
  33. package/dist/install/legacyMcp.js.map +1 -1
  34. package/dist/install/mcpRegistration.d.ts +24 -7
  35. package/dist/install/mcpRegistration.d.ts.map +1 -1
  36. package/dist/install/mcpRegistration.js +88 -15
  37. package/dist/install/mcpRegistration.js.map +1 -1
  38. package/dist/routes/agentVariants.d.ts.map +1 -1
  39. package/dist/routes/agentVariants.js +65 -11
  40. package/dist/routes/agentVariants.js.map +1 -1
  41. package/dist/services/OperatingSystemServices.d.ts +12 -1
  42. package/dist/services/OperatingSystemServices.d.ts.map +1 -1
  43. package/dist/services/OperatingSystemServices.js +27 -0
  44. package/dist/services/OperatingSystemServices.js.map +1 -1
  45. package/dist/services/TelemetryService.d.ts +8 -0
  46. package/dist/services/TelemetryService.d.ts.map +1 -1
  47. package/dist/services/TelemetryService.js +7 -0
  48. package/dist/services/TelemetryService.js.map +1 -1
  49. package/dist/services/VariantGenerationService.d.ts +4 -6
  50. package/dist/services/VariantGenerationService.d.ts.map +1 -1
  51. package/dist/services/VariantGenerationService.js +32 -20
  52. package/dist/services/VariantGenerationService.js.map +1 -1
  53. package/dist/services/VariantHistoryService.d.ts +18 -1
  54. package/dist/services/VariantHistoryService.d.ts.map +1 -1
  55. package/dist/services/VariantHistoryService.js +33 -3
  56. package/dist/services/VariantHistoryService.js.map +1 -1
  57. package/package.json +1 -1
  58. package/src/ui/dist/assets/main-B2nKlm8o.css +1 -0
  59. package/src/ui/dist/assets/main-BsX3wuvL.js +423 -0
  60. package/src/ui/dist/index.html +2 -2
  61. package/src/ui/dist/assets/main-BvCYfVyA.js +0 -423
  62. package/src/ui/dist/assets/main-Dad5qwqj.css +0 -1
@@ -1,423 +0,0 @@
1
- var HO=Object.defineProperty;var tE=t=>{throw TypeError(t)};var zO=(t,e,n)=>e in t?HO(t,e,{enumerable:!0,configurable:!0,writable:!0,value:n}):t[e]=n;var jo=(t,e,n)=>zO(t,typeof e!="symbol"?e+"":e,n),yv=(t,e,n)=>e.has(t)||tE("Cannot "+n);var z=(t,e,n)=>(yv(t,e,"read from private field"),n?n.call(t):e.get(t)),He=(t,e,n)=>e.has(t)?tE("Cannot add the same private member more than once"):e instanceof WeakSet?e.add(t):e.set(t,n),ke=(t,e,n,r)=>(yv(t,e,"write to private field"),r?r.call(t,n):e.set(t,n),n),lt=(t,e,n)=>(yv(t,e,"access private method"),n);var qh=(t,e,n,r)=>({set _(s){ke(t,e,s,n)},get _(){return z(t,e,r)}});function UO(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 a of i.addedNodes)a.tagName==="LINK"&&a.rel==="modulepreload"&&r(a)}).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)}})();function i0(t){return t&&t.__esModule&&Object.prototype.hasOwnProperty.call(t,"default")?t.default:t}var _v={exports:{}},Qc={},wv={exports:{}},ot={};/**
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 nE;function BO(){if(nE)return ot;nE=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"),a=Symbol.for("react.context"),u=Symbol.for("react.forward_ref"),c=Symbol.for("react.suspense"),d=Symbol.for("react.memo"),h=Symbol.for("react.lazy"),p=Symbol.iterator;function m(F){return F===null||typeof F!="object"?null:(F=p&&F[p]||F["@@iterator"],typeof F=="function"?F:null)}var _={isMounted:function(){return!1},enqueueForceUpdate:function(){},enqueueReplaceState:function(){},enqueueSetState:function(){}},w=Object.assign,y={};function x(F,X,oe){this.props=F,this.context=X,this.refs=y,this.updater=oe||_}x.prototype.isReactComponent={},x.prototype.setState=function(F,X){if(typeof F!="object"&&typeof F!="function"&&F!=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,F,X,"setState")},x.prototype.forceUpdate=function(F){this.updater.enqueueForceUpdate(this,F,"forceUpdate")};function S(){}S.prototype=x.prototype;function P(F,X,oe){this.props=F,this.context=X,this.refs=y,this.updater=oe||_}var T=P.prototype=new S;T.constructor=P,w(T,x.prototype),T.isPureReactComponent=!0;var k=Array.isArray,R=Object.prototype.hasOwnProperty,M={current:null},L={key:!0,ref:!0,__self:!0,__source:!0};function A(F,X,oe){var se,ee={},ce=null,we=null;if(X!=null)for(se in X.ref!==void 0&&(we=X.ref),X.key!==void 0&&(ce=""+X.key),X)R.call(X,se)&&!L.hasOwnProperty(se)&&(ee[se]=X[se]);var le=arguments.length-2;if(le===1)ee.children=oe;else if(1<le){for(var ie=Array(le),Ne=0;Ne<le;Ne++)ie[Ne]=arguments[Ne+2];ee.children=ie}if(F&&F.defaultProps)for(se in le=F.defaultProps,le)ee[se]===void 0&&(ee[se]=le[se]);return{$$typeof:t,type:F,key:ce,ref:we,props:ee,_owner:M.current}}function O(F,X){return{$$typeof:t,type:F.type,key:X,ref:F.ref,props:F.props,_owner:F._owner}}function D(F){return typeof F=="object"&&F!==null&&F.$$typeof===t}function N(F){var X={"=":"=0",":":"=2"};return"$"+F.replace(/[=:]/g,function(oe){return X[oe]})}var j=/\/+/g;function G(F,X){return typeof F=="object"&&F!==null&&F.key!=null?N(""+F.key):X.toString(36)}function Y(F,X,oe,se,ee){var ce=typeof F;(ce==="undefined"||ce==="boolean")&&(F=null);var we=!1;if(F===null)we=!0;else switch(ce){case"string":case"number":we=!0;break;case"object":switch(F.$$typeof){case t:case e:we=!0}}if(we)return we=F,ee=ee(we),F=se===""?"."+G(we,0):se,k(ee)?(oe="",F!=null&&(oe=F.replace(j,"$&/")+"/"),Y(ee,X,oe,"",function(Ne){return Ne})):ee!=null&&(D(ee)&&(ee=O(ee,oe+(!ee.key||we&&we.key===ee.key?"":(""+ee.key).replace(j,"$&/")+"/")+F)),X.push(ee)),1;if(we=0,se=se===""?".":se+":",k(F))for(var le=0;le<F.length;le++){ce=F[le];var ie=se+G(ce,le);we+=Y(ce,X,oe,ie,ee)}else if(ie=m(F),typeof ie=="function")for(F=ie.call(F),le=0;!(ce=F.next()).done;)ce=ce.value,ie=se+G(ce,le++),we+=Y(ce,X,oe,ie,ee);else if(ce==="object")throw X=String(F),Error("Objects are not valid as a React child (found: "+(X==="[object Object]"?"object with keys {"+Object.keys(F).join(", ")+"}":X)+"). If you meant to render a collection of children, use an array instead.");return we}function W(F,X,oe){if(F==null)return F;var se=[],ee=0;return Y(F,se,"","",function(ce){return X.call(oe,ce,ee++)}),se}function q(F){if(F._status===-1){var X=F._result;X=X(),X.then(function(oe){(F._status===0||F._status===-1)&&(F._status=1,F._result=oe)},function(oe){(F._status===0||F._status===-1)&&(F._status=2,F._result=oe)}),F._status===-1&&(F._status=0,F._result=X)}if(F._status===1)return F._result.default;throw F._result}var Z={current:null},V={transition:null},J={ReactCurrentDispatcher:Z,ReactCurrentBatchConfig:V,ReactCurrentOwner:M};function H(){throw Error("act(...) is not supported in production builds of React.")}return ot.Children={map:W,forEach:function(F,X,oe){W(F,function(){X.apply(this,arguments)},oe)},count:function(F){var X=0;return W(F,function(){X++}),X},toArray:function(F){return W(F,function(X){return X})||[]},only:function(F){if(!D(F))throw Error("React.Children.only expected to receive a single React element child.");return F}},ot.Component=x,ot.Fragment=n,ot.Profiler=s,ot.PureComponent=P,ot.StrictMode=r,ot.Suspense=c,ot.__SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED=J,ot.act=H,ot.cloneElement=function(F,X,oe){if(F==null)throw Error("React.cloneElement(...): The argument must be a React element, but you passed "+F+".");var se=w({},F.props),ee=F.key,ce=F.ref,we=F._owner;if(X!=null){if(X.ref!==void 0&&(ce=X.ref,we=M.current),X.key!==void 0&&(ee=""+X.key),F.type&&F.type.defaultProps)var le=F.type.defaultProps;for(ie in X)R.call(X,ie)&&!L.hasOwnProperty(ie)&&(se[ie]=X[ie]===void 0&&le!==void 0?le[ie]:X[ie])}var ie=arguments.length-2;if(ie===1)se.children=oe;else if(1<ie){le=Array(ie);for(var Ne=0;Ne<ie;Ne++)le[Ne]=arguments[Ne+2];se.children=le}return{$$typeof:t,type:F.type,key:ee,ref:ce,props:se,_owner:we}},ot.createContext=function(F){return F={$$typeof:a,_currentValue:F,_currentValue2:F,_threadCount:0,Provider:null,Consumer:null,_defaultValue:null,_globalName:null},F.Provider={$$typeof:i,_context:F},F.Consumer=F},ot.createElement=A,ot.createFactory=function(F){var X=A.bind(null,F);return X.type=F,X},ot.createRef=function(){return{current:null}},ot.forwardRef=function(F){return{$$typeof:u,render:F}},ot.isValidElement=D,ot.lazy=function(F){return{$$typeof:h,_payload:{_status:-1,_result:F},_init:q}},ot.memo=function(F,X){return{$$typeof:d,type:F,compare:X===void 0?null:X}},ot.startTransition=function(F){var X=V.transition;V.transition={};try{F()}finally{V.transition=X}},ot.unstable_act=H,ot.useCallback=function(F,X){return Z.current.useCallback(F,X)},ot.useContext=function(F){return Z.current.useContext(F)},ot.useDebugValue=function(){},ot.useDeferredValue=function(F){return Z.current.useDeferredValue(F)},ot.useEffect=function(F,X){return Z.current.useEffect(F,X)},ot.useId=function(){return Z.current.useId()},ot.useImperativeHandle=function(F,X,oe){return Z.current.useImperativeHandle(F,X,oe)},ot.useInsertionEffect=function(F,X){return Z.current.useInsertionEffect(F,X)},ot.useLayoutEffect=function(F,X){return Z.current.useLayoutEffect(F,X)},ot.useMemo=function(F,X){return Z.current.useMemo(F,X)},ot.useReducer=function(F,X,oe){return Z.current.useReducer(F,X,oe)},ot.useRef=function(F){return Z.current.useRef(F)},ot.useState=function(F){return Z.current.useState(F)},ot.useSyncExternalStore=function(F,X,oe){return Z.current.useSyncExternalStore(F,X,oe)},ot.useTransition=function(){return Z.current.useTransition()},ot.version="18.3.1",ot}var rE;function v2(){return rE||(rE=1,wv.exports=BO()),wv.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 sE;function WO(){if(sE)return Qc;sE=1;var t=v2(),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 a(u,c,d){var h,p={},m=null,_=null;d!==void 0&&(m=""+d),c.key!==void 0&&(m=""+c.key),c.ref!==void 0&&(_=c.ref);for(h in c)r.call(c,h)&&!i.hasOwnProperty(h)&&(p[h]=c[h]);if(u&&u.defaultProps)for(h in c=u.defaultProps,c)p[h]===void 0&&(p[h]=c[h]);return{$$typeof:e,type:u,key:m,ref:_,props:p,_owner:s.current}}return Qc.Fragment=n,Qc.jsx=a,Qc.jsxs=a,Qc}var iE;function qO(){return iE||(iE=1,_v.exports=WO()),_v.exports}var E=qO(),v=v2();const ye=i0(v),Ef=UO({__proto__:null,default:ye},[v]);var Cf=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(){}},dl,Uo,Fu,B8,GO=(B8=class extends Cf{constructor(){super();He(this,dl);He(this,Uo);He(this,Fu);ke(this,Fu,e=>{if(typeof window<"u"&&window.addEventListener){const n=()=>e();return window.addEventListener("visibilitychange",n,!1),()=>{window.removeEventListener("visibilitychange",n)}}})}onSubscribe(){z(this,Uo)||this.setEventListener(z(this,Fu))}onUnsubscribe(){var e;this.hasListeners()||((e=z(this,Uo))==null||e.call(this),ke(this,Uo,void 0))}setEventListener(e){var n;ke(this,Fu,e),(n=z(this,Uo))==null||n.call(this),ke(this,Uo,e(r=>{typeof r=="boolean"?this.setFocused(r):this.onFocus()}))}setFocused(e){z(this,dl)!==e&&(ke(this,dl,e),this.onFocus())}onFocus(){const e=this.isFocused();this.listeners.forEach(n=>{n(e)})}isFocused(){var e;return typeof z(this,dl)=="boolean"?z(this,dl):((e=globalThis.document)==null?void 0:e.visibilityState)!=="hidden"}},dl=new WeakMap,Uo=new WeakMap,Fu=new WeakMap,B8),y2=new GO,KO={setTimeout:(t,e)=>setTimeout(t,e),clearTimeout:t=>clearTimeout(t),setInterval:(t,e)=>setInterval(t,e),clearInterval:t=>clearInterval(t)},Bo,g2,W8,ZO=(W8=class{constructor(){He(this,Bo,KO);He(this,g2,!1)}setTimeoutProvider(t){ke(this,Bo,t)}setTimeout(t,e){return z(this,Bo).setTimeout(t,e)}clearTimeout(t){z(this,Bo).clearTimeout(t)}setInterval(t,e){return z(this,Bo).setInterval(t,e)}clearInterval(t){z(this,Bo).clearInterval(t)}},Bo=new WeakMap,g2=new WeakMap,W8),ol=new ZO;function YO(t){setTimeout(t,0)}var XO=typeof window>"u"||"Deno"in globalThis;function Cr(){}function QO(t,e){return typeof t=="function"?t(e):t}function X1(t){return typeof t=="number"&&t>=0&&t!==1/0}function e6(t,e){return Math.max(t+(e||0)-Date.now(),0)}function ta(t,e){return typeof t=="function"?t(e):t}function Wr(t,e){return typeof t=="function"?t(e):t}function oE(t,e){const{type:n="all",exact:r,fetchStatus:s,predicate:i,queryKey:a,stale:u}=t;if(a){if(r){if(e.queryHash!==_2(a,e.options))return!1}else if(!Xu(e.queryKey,a))return!1}if(n!=="all"){const c=e.isActive();if(n==="active"&&!c||n==="inactive"&&c)return!1}return!(typeof u=="boolean"&&e.isStale()!==u||s&&s!==e.state.fetchStatus||i&&!i(e))}function aE(t,e){const{exact:n,status:r,predicate:s,mutationKey:i}=t;if(i){if(!e.options.mutationKey)return!1;if(n){if(Vd(e.options.mutationKey)!==Vd(i))return!1}else if(!Xu(e.options.mutationKey,i))return!1}return!(r&&e.state.status!==r||s&&!s(e))}function _2(t,e){return((e==null?void 0:e.queryKeyHashFn)||Vd)(t)}function Vd(t){return JSON.stringify(t,(e,n)=>J1(n)?Object.keys(n).sort().reduce((r,s)=>(r[s]=n[s],r),{}):n)}function Xu(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)){for(let r=0;r<e.length;r++)if(!Xu(t[r],e[r]))return!1;return!0}const n=Object.keys(e);for(const r of n)if(!Xu(t[r],e[r]))return!1;return!0}return!1}var JO=Object.prototype.hasOwnProperty;function t6(t,e,n=0){if(t===e)return t;if(n>500)return e;const r=lE(t)&&lE(e);if(!r&&!(J1(t)&&J1(e)))return e;const i=(r?t:Object.keys(t)).length,a=r?e:Object.keys(e),u=a.length,c=r?new Array(u):{};let d=0;for(let h=0;h<u;h++){const p=r?h:a[h],m=t[p],_=e[p];if(m===_){c[p]=m,(r?h<i:JO.call(t,p))&&d++;continue}if(m===null||_===null||typeof m!="object"||typeof _!="object"){c[p]=_;continue}const w=t6(m,_,n+1);c[p]=w,w===m&&d++}return i===u&&d===i?t:c}function Q1(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 lE(t){return Array.isArray(t)&&t.length===Object.keys(t).length}function J1(t){if(!uE(t))return!1;const e=t.constructor;if(e===void 0)return!0;const n=e.prototype;return!(!uE(n)||!n.hasOwnProperty("isPrototypeOf")||Object.getPrototypeOf(t)!==Object.prototype)}function uE(t){return Object.prototype.toString.call(t)==="[object Object]"}function eL(t){return new Promise(e=>{ol.setTimeout(e,t)})}function ey(t,e,n){return typeof n.structuralSharing=="function"?n.structuralSharing(t,e):n.structuralSharing!==!1?t6(t,e):e}function tL(t,e,n=0){const r=[...t,e];return n&&r.length>n?r.slice(1):r}function nL(t,e,n=0){const r=[e,...t];return n&&r.length>n?r.slice(0,-1):r}var w2=Symbol();function n6(t,e){return!t.queryFn&&(e!=null&&e.initialPromise)?()=>e.initialPromise:!t.queryFn||t.queryFn===w2?()=>Promise.reject(new Error(`Missing queryFn: '${t.queryHash}'`)):t.queryFn}function r6(t,e){return typeof t=="function"?t(...e):!!t}function rL(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}var Hd=(()=>{let t=()=>XO;return{isServer(){return t()},setIsServer(e){t=e}}})();function ty(){let t,e;const n=new Promise((s,i)=>{t=s,e=i});n.status="pending",n.catch(()=>{});function r(s){Object.assign(n,s),delete n.resolve,delete n.reject}return n.resolve=s=>{r({status:"fulfilled",value:s}),t(s)},n.reject=s=>{r({status:"rejected",reason:s}),e(s)},n}var sL=YO;function iL(){let t=[],e=0,n=u=>{u()},r=u=>{u()},s=sL;const i=u=>{e?t.push(u):s(()=>{n(u)})},a=()=>{const u=t;t=[],u.length&&s(()=>{r(()=>{u.forEach(c=>{n(c)})})})};return{batch:u=>{let c;e++;try{c=u()}finally{e--,e||a()}return c},batchCalls:u=>(...c)=>{i(()=>{u(...c)})},schedule:i,setNotifyFunction:u=>{n=u},setBatchNotifyFunction:u=>{r=u},setScheduler:u=>{s=u}}}var Vn=iL(),$u,Wo,Vu,q8,oL=(q8=class extends Cf{constructor(){super();He(this,$u,!0);He(this,Wo);He(this,Vu);ke(this,Vu,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(){z(this,Wo)||this.setEventListener(z(this,Vu))}onUnsubscribe(){var e;this.hasListeners()||((e=z(this,Wo))==null||e.call(this),ke(this,Wo,void 0))}setEventListener(e){var n;ke(this,Vu,e),(n=z(this,Wo))==null||n.call(this),ke(this,Wo,e(this.setOnline.bind(this)))}setOnline(e){z(this,$u)!==e&&(ke(this,$u,e),this.listeners.forEach(r=>{r(e)}))}isOnline(){return z(this,$u)}},$u=new WeakMap,Wo=new WeakMap,Vu=new WeakMap,q8),im=new oL;function aL(t){return Math.min(1e3*2**t,3e4)}function s6(t){return(t??"online")==="online"?im.isOnline():!0}var ny=class extends Error{constructor(t){super("CancelledError"),this.revert=t==null?void 0:t.revert,this.silent=t==null?void 0:t.silent}};function i6(t){let e=!1,n=0,r;const s=ty(),i=()=>s.status!=="pending",a=y=>{var x;if(!i()){const S=new ny(y);m(S),(x=t.onCancel)==null||x.call(t,S)}},u=()=>{e=!0},c=()=>{e=!1},d=()=>y2.isFocused()&&(t.networkMode==="always"||im.isOnline())&&t.canRun(),h=()=>s6(t.networkMode)&&t.canRun(),p=y=>{i()||(r==null||r(),s.resolve(y))},m=y=>{i()||(r==null||r(),s.reject(y))},_=()=>new Promise(y=>{var x;r=S=>{(i()||d())&&y(S)},(x=t.onPause)==null||x.call(t)}).then(()=>{var y;r=void 0,i()||(y=t.onContinue)==null||y.call(t)}),w=()=>{if(i())return;let y;const x=n===0?t.initialPromise:void 0;try{y=x??t.fn()}catch(S){y=Promise.reject(S)}Promise.resolve(y).then(p).catch(S=>{var M;if(i())return;const P=t.retry??(Hd.isServer()?0:3),T=t.retryDelay??aL,k=typeof T=="function"?T(n,S):T,R=P===!0||typeof P=="number"&&n<P||typeof P=="function"&&P(n,S);if(e||!R){m(S);return}n++,(M=t.onFail)==null||M.call(t,n,S),eL(k).then(()=>d()?void 0:_()).then(()=>{e?m(S):w()})})};return{promise:s,status:()=>s.status,cancel:a,continue:()=>(r==null||r(),s),cancelRetry:u,continueRetry:c,canStart:h,start:()=>(h()?w():_().then(w),s)}}var fl,G8,o6=(G8=class{constructor(){He(this,fl)}destroy(){this.clearGcTimeout()}scheduleGc(){this.clearGcTimeout(),X1(this.gcTime)&&ke(this,fl,ol.setTimeout(()=>{this.optionalRemove()},this.gcTime))}updateGcTime(t){this.gcTime=Math.max(this.gcTime||0,t??(Hd.isServer()?1/0:300*1e3))}clearGcTimeout(){z(this,fl)!==void 0&&(ol.clearTimeout(z(this,fl)),ke(this,fl,void 0))}},fl=new WeakMap,G8);function lL(t){return{onFetch:(e,n)=>{var h,p,m,_,w;const r=e.options,s=(m=(p=(h=e.fetchOptions)==null?void 0:h.meta)==null?void 0:p.fetchMore)==null?void 0:m.direction,i=((_=e.state.data)==null?void 0:_.pages)||[],a=((w=e.state.data)==null?void 0:w.pageParams)||[];let u={pages:[],pageParams:[]},c=0;const d=async()=>{let y=!1;const x=T=>{rL(T,()=>e.signal,()=>y=!0)},S=n6(e.options,e.fetchOptions),P=async(T,k,R)=>{if(y)return Promise.reject(e.signal.reason);if(k==null&&T.pages.length)return Promise.resolve(T);const L=(()=>{const N={client:e.client,queryKey:e.queryKey,pageParam:k,direction:R?"backward":"forward",meta:e.options.meta};return x(N),N})(),A=await S(L),{maxPages:O}=e.options,D=R?nL:tL;return{pages:D(T.pages,A,O),pageParams:D(T.pageParams,k,O)}};if(s&&i.length){const T=s==="backward",k=T?uL:cE,R={pages:i,pageParams:a},M=k(r,R);u=await P(R,M,T)}else{const T=t??i.length;do{const k=c===0?a[0]??r.initialPageParam:cE(r,u);if(c>0&&k==null)break;u=await P(u,k),c++}while(c<T)}return u};e.options.persister?e.fetchFn=()=>{var y,x;return(x=(y=e.options).persister)==null?void 0:x.call(y,d,{client:e.client,queryKey:e.queryKey,meta:e.options.meta,signal:e.signal},n)}:e.fetchFn=d}}}function cE(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 uL(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 Hu,hl,zu,ys,pl,Tn,_f,ml,Ur,a6,Fi,K8,cL=(K8=class extends o6{constructor(e){super();He(this,Ur);He(this,Hu);He(this,hl);He(this,zu);He(this,ys);He(this,pl);He(this,Tn);He(this,_f);He(this,ml);ke(this,ml,!1),ke(this,_f,e.defaultOptions),this.setOptions(e.options),this.observers=[],ke(this,pl,e.client),ke(this,ys,z(this,pl).getQueryCache()),this.queryKey=e.queryKey,this.queryHash=e.queryHash,ke(this,hl,fE(this.options)),this.state=e.state??z(this,hl),this.scheduleGc()}get meta(){return this.options.meta}get queryType(){return z(this,Hu)}get promise(){var e;return(e=z(this,Tn))==null?void 0:e.promise}setOptions(e){if(this.options={...z(this,_f),...e},e!=null&&e._type&&ke(this,Hu,e._type),this.updateGcTime(this.options.gcTime),this.state&&this.state.data===void 0){const n=fE(this.options);n.data!==void 0&&(this.setState(dE(n.data,n.dataUpdatedAt)),ke(this,hl,n))}}optionalRemove(){!this.observers.length&&this.state.fetchStatus==="idle"&&z(this,ys).remove(this)}setData(e,n){const r=ey(this.state.data,e,this.options);return lt(this,Ur,Fi).call(this,{data:r,type:"success",dataUpdatedAt:n==null?void 0:n.updatedAt,manual:n==null?void 0:n.manual}),r}setState(e){lt(this,Ur,Fi).call(this,{type:"setState",state:e})}cancel(e){var r,s;const n=(r=z(this,Tn))==null?void 0:r.promise;return(s=z(this,Tn))==null||s.cancel(e),n?n.then(Cr).catch(Cr):Promise.resolve()}destroy(){super.destroy(),this.cancel({silent:!0})}get resetState(){return z(this,hl)}reset(){this.destroy(),this.setState(this.resetState)}isActive(){return this.observers.some(e=>Wr(e.options.enabled,this)!==!1)}isDisabled(){return this.getObserversCount()>0?!this.isActive():this.options.queryFn===w2||!this.isFetched()}isFetched(){return this.state.dataUpdateCount+this.state.errorUpdateCount>0}isStatic(){return this.getObserversCount()>0?this.observers.some(e=>ta(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:!e6(this.state.dataUpdatedAt,e)}onFocus(){var n;const e=this.observers.find(r=>r.shouldFetchOnWindowFocus());e==null||e.refetch({cancelRefetch:!1}),(n=z(this,Tn))==null||n.continue()}onOnline(){var n;const e=this.observers.find(r=>r.shouldFetchOnReconnect());e==null||e.refetch({cancelRefetch:!1}),(n=z(this,Tn))==null||n.continue()}addObserver(e){this.observers.includes(e)||(this.observers.push(e),this.clearGcTimeout(),z(this,ys).notify({type:"observerAdded",query:this,observer:e}))}removeObserver(e){this.observers.includes(e)&&(this.observers=this.observers.filter(n=>n!==e),this.observers.length||(z(this,Tn)&&(z(this,ml)||lt(this,Ur,a6).call(this)?z(this,Tn).cancel({revert:!0}):z(this,Tn).cancelRetry()),this.scheduleGc()),z(this,ys).notify({type:"observerRemoved",query:this,observer:e}))}getObserversCount(){return this.observers.length}invalidate(){this.state.isInvalidated||lt(this,Ur,Fi).call(this,{type:"invalidate"})}async fetch(e,n){var d,h,p,m,_,w,y,x,S,P,T;if(this.state.fetchStatus!=="idle"&&((d=z(this,Tn))==null?void 0:d.status())!=="rejected"){if(this.state.data!==void 0&&(n!=null&&n.cancelRefetch))this.cancel({silent:!0});else if(z(this,Tn))return z(this,Tn).continueRetry(),z(this,Tn).promise}if(e&&this.setOptions(e),!this.options.queryFn){const k=this.observers.find(R=>R.options.queryFn);k&&this.setOptions(k.options)}const r=new AbortController,s=k=>{Object.defineProperty(k,"signal",{enumerable:!0,get:()=>(ke(this,ml,!0),r.signal)})},i=()=>{const k=n6(this.options,n),M=(()=>{const L={client:z(this,pl),queryKey:this.queryKey,meta:this.meta};return s(L),L})();return ke(this,ml,!1),this.options.persister?this.options.persister(k,M,this):k(M)},u=(()=>{const k={fetchOptions:n,options:this.options,queryKey:this.queryKey,client:z(this,pl),state:this.state,fetchFn:i};return s(k),k})(),c=z(this,Hu)==="infinite"?lL(this.options.pages):this.options.behavior;c==null||c.onFetch(u,this),ke(this,zu,this.state),(this.state.fetchStatus==="idle"||this.state.fetchMeta!==((h=u.fetchOptions)==null?void 0:h.meta))&&lt(this,Ur,Fi).call(this,{type:"fetch",meta:(p=u.fetchOptions)==null?void 0:p.meta}),ke(this,Tn,i6({initialPromise:n==null?void 0:n.initialPromise,fn:u.fetchFn,onCancel:k=>{k instanceof ny&&k.revert&&this.setState({...z(this,zu),fetchStatus:"idle"}),r.abort()},onFail:(k,R)=>{lt(this,Ur,Fi).call(this,{type:"failed",failureCount:k,error:R})},onPause:()=>{lt(this,Ur,Fi).call(this,{type:"pause"})},onContinue:()=>{lt(this,Ur,Fi).call(this,{type:"continue"})},retry:u.options.retry,retryDelay:u.options.retryDelay,networkMode:u.options.networkMode,canRun:()=>!0}));try{const k=await z(this,Tn).start();if(k===void 0)throw new Error(`${this.queryHash} data is undefined`);return this.setData(k),(_=(m=z(this,ys).config).onSuccess)==null||_.call(m,k,this),(y=(w=z(this,ys).config).onSettled)==null||y.call(w,k,this.state.error,this),k}catch(k){if(k instanceof ny){if(k.silent)return z(this,Tn).promise;if(k.revert){if(this.state.data===void 0)throw k;return this.state.data}}throw lt(this,Ur,Fi).call(this,{type:"error",error:k}),(S=(x=z(this,ys).config).onError)==null||S.call(x,k,this),(T=(P=z(this,ys).config).onSettled)==null||T.call(P,this.state.data,k,this),k}finally{this.scheduleGc()}}},Hu=new WeakMap,hl=new WeakMap,zu=new WeakMap,ys=new WeakMap,pl=new WeakMap,Tn=new WeakMap,_f=new WeakMap,ml=new WeakMap,Ur=new WeakSet,a6=function(){return this.state.fetchStatus==="paused"&&this.state.status==="pending"},Fi=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,...l6(r.data,this.options),fetchMeta:e.meta??null};case"success":const s={...r,...dE(e.data,e.dataUpdatedAt),dataUpdateCount:r.dataUpdateCount+1,...!e.manual&&{fetchStatus:"idle",fetchFailureCount:0,fetchFailureReason:null}};return ke(this,zu,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),Vn.batch(()=>{this.observers.forEach(r=>{r.onQueryUpdate()}),z(this,ys).notify({query:this,type:"updated",action:e})})},K8);function l6(t,e){return{fetchFailureCount:0,fetchFailureReason:null,fetchStatus:s6(e.networkMode)?"fetching":"paused",...t===void 0&&{error:null,status:"pending"}}}function dE(t,e){return{data:t,dataUpdatedAt:e??Date.now(),error:null,isInvalidated:!1,status:"success"}}function fE(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 br,ut,wf,sr,gl,Uu,Gi,qo,xf,Bu,Wu,vl,yl,Go,qu,yt,hd,ry,sy,iy,oy,ay,ly,uy,u6,Z8,dL=(Z8=class extends Cf{constructor(e,n){super();He(this,yt);He(this,br);He(this,ut);He(this,wf);He(this,sr);He(this,gl);He(this,Uu);He(this,Gi);He(this,qo);He(this,xf);He(this,Bu);He(this,Wu);He(this,vl);He(this,yl);He(this,Go);He(this,qu,new Set);this.options=n,ke(this,br,e),ke(this,qo,null),ke(this,Gi,ty()),this.bindMethods(),this.setOptions(n)}bindMethods(){this.refetch=this.refetch.bind(this)}onSubscribe(){this.listeners.size===1&&(z(this,ut).addObserver(this),hE(z(this,ut),this.options)?lt(this,yt,hd).call(this):this.updateResult(),lt(this,yt,oy).call(this))}onUnsubscribe(){this.hasListeners()||this.destroy()}shouldFetchOnReconnect(){return cy(z(this,ut),this.options,this.options.refetchOnReconnect)}shouldFetchOnWindowFocus(){return cy(z(this,ut),this.options,this.options.refetchOnWindowFocus)}destroy(){this.listeners=new Set,lt(this,yt,ay).call(this),lt(this,yt,ly).call(this),z(this,ut).removeObserver(this)}setOptions(e){const n=this.options,r=z(this,ut);if(this.options=z(this,br).defaultQueryOptions(e),this.options.enabled!==void 0&&typeof this.options.enabled!="boolean"&&typeof this.options.enabled!="function"&&typeof Wr(this.options.enabled,z(this,ut))!="boolean")throw new Error("Expected enabled to be a boolean or a callback that returns a boolean");lt(this,yt,uy).call(this),z(this,ut).setOptions(this.options),n._defaulted&&!Q1(this.options,n)&&z(this,br).getQueryCache().notify({type:"observerOptionsUpdated",query:z(this,ut),observer:this});const s=this.hasListeners();s&&pE(z(this,ut),r,this.options,n)&&lt(this,yt,hd).call(this),this.updateResult(),s&&(z(this,ut)!==r||Wr(this.options.enabled,z(this,ut))!==Wr(n.enabled,z(this,ut))||ta(this.options.staleTime,z(this,ut))!==ta(n.staleTime,z(this,ut)))&&lt(this,yt,ry).call(this);const i=lt(this,yt,sy).call(this);s&&(z(this,ut)!==r||Wr(this.options.enabled,z(this,ut))!==Wr(n.enabled,z(this,ut))||i!==z(this,Go))&&lt(this,yt,iy).call(this,i)}getOptimisticResult(e){const n=z(this,br).getQueryCache().build(z(this,br),e),r=this.createResult(n,e);return hL(this,r)&&(ke(this,sr,r),ke(this,Uu,this.options),ke(this,gl,z(this,ut).state)),r}getCurrentResult(){return z(this,sr)}trackResult(e,n){return new Proxy(e,{get:(r,s)=>(this.trackProp(s),n==null||n(s),s==="promise"&&(this.trackProp("data"),!this.options.experimental_prefetchInRender&&z(this,Gi).status==="pending"&&z(this,Gi).reject(new Error("experimental_prefetchInRender feature flag is not enabled"))),Reflect.get(r,s))})}trackProp(e){z(this,qu).add(e)}getCurrentQuery(){return z(this,ut)}refetch({...e}={}){return this.fetch({...e})}fetchOptimistic(e){const n=z(this,br).defaultQueryOptions(e),r=z(this,br).getQueryCache().build(z(this,br),n);return r.fetch().then(()=>this.createResult(r,n))}fetch(e){return lt(this,yt,hd).call(this,{...e,cancelRefetch:e.cancelRefetch??!0}).then(()=>(this.updateResult(),z(this,sr)))}createResult(e,n){var O;const r=z(this,ut),s=this.options,i=z(this,sr),a=z(this,gl),u=z(this,Uu),d=e!==r?e.state:z(this,wf),{state:h}=e;let p={...h},m=!1,_;if(n._optimisticResults){const D=this.hasListeners(),N=!D&&hE(e,n),j=D&&pE(e,r,n,s);(N||j)&&(p={...p,...l6(h.data,e.options)}),n._optimisticResults==="isRestoring"&&(p.fetchStatus="idle")}let{error:w,errorUpdatedAt:y,status:x}=p;_=p.data;let S=!1;if(n.placeholderData!==void 0&&_===void 0&&x==="pending"){let D;i!=null&&i.isPlaceholderData&&n.placeholderData===(u==null?void 0:u.placeholderData)?(D=i.data,S=!0):D=typeof n.placeholderData=="function"?n.placeholderData((O=z(this,Wu))==null?void 0:O.state.data,z(this,Wu)):n.placeholderData,D!==void 0&&(x="success",_=ey(i==null?void 0:i.data,D,n),m=!0)}if(n.select&&_!==void 0&&!S)if(i&&_===(a==null?void 0:a.data)&&n.select===z(this,xf))_=z(this,Bu);else try{ke(this,xf,n.select),_=n.select(_),_=ey(i==null?void 0:i.data,_,n),ke(this,Bu,_),ke(this,qo,null)}catch(D){ke(this,qo,D)}z(this,qo)&&(w=z(this,qo),_=z(this,Bu),y=Date.now(),x="error");const P=p.fetchStatus==="fetching",T=x==="pending",k=x==="error",R=T&&P,M=_!==void 0,A={status:x,fetchStatus:p.fetchStatus,isPending:T,isSuccess:x==="success",isError:k,isInitialLoading:R,isLoading:R,data:_,dataUpdatedAt:p.dataUpdatedAt,error:w,errorUpdatedAt:y,failureCount:p.fetchFailureCount,failureReason:p.fetchFailureReason,errorUpdateCount:p.errorUpdateCount,isFetched:e.isFetched(),isFetchedAfterMount:p.dataUpdateCount>d.dataUpdateCount||p.errorUpdateCount>d.errorUpdateCount,isFetching:P,isRefetching:P&&!T,isLoadingError:k&&!M,isPaused:p.fetchStatus==="paused",isPlaceholderData:m,isRefetchError:k&&M,isStale:x2(e,n),refetch:this.refetch,promise:z(this,Gi),isEnabled:Wr(n.enabled,e)!==!1};if(this.options.experimental_prefetchInRender){const D=A.data!==void 0,N=A.status==="error"&&!D,j=W=>{N?W.reject(A.error):D&&W.resolve(A.data)},G=()=>{const W=ke(this,Gi,A.promise=ty());j(W)},Y=z(this,Gi);switch(Y.status){case"pending":e.queryHash===r.queryHash&&j(Y);break;case"fulfilled":(N||A.data!==Y.value)&&G();break;case"rejected":(!N||A.error!==Y.reason)&&G();break}}return A}updateResult(){const e=z(this,sr),n=this.createResult(z(this,ut),this.options);if(ke(this,gl,z(this,ut).state),ke(this,Uu,this.options),z(this,gl).data!==void 0&&ke(this,Wu,z(this,ut)),Q1(n,e))return;ke(this,sr,n);const r=()=>{if(!e)return!0;const{notifyOnChangeProps:s}=this.options,i=typeof s=="function"?s():s;if(i==="all"||!i&&!z(this,qu).size)return!0;const a=new Set(i??z(this,qu));return this.options.throwOnError&&a.add("error"),Object.keys(z(this,sr)).some(u=>{const c=u;return z(this,sr)[c]!==e[c]&&a.has(c)})};lt(this,yt,u6).call(this,{listeners:r()})}onQueryUpdate(){this.updateResult(),this.hasListeners()&&lt(this,yt,oy).call(this)}},br=new WeakMap,ut=new WeakMap,wf=new WeakMap,sr=new WeakMap,gl=new WeakMap,Uu=new WeakMap,Gi=new WeakMap,qo=new WeakMap,xf=new WeakMap,Bu=new WeakMap,Wu=new WeakMap,vl=new WeakMap,yl=new WeakMap,Go=new WeakMap,qu=new WeakMap,yt=new WeakSet,hd=function(e){lt(this,yt,uy).call(this);let n=z(this,ut).fetch(this.options,e);return e!=null&&e.throwOnError||(n=n.catch(Cr)),n},ry=function(){lt(this,yt,ay).call(this);const e=ta(this.options.staleTime,z(this,ut));if(Hd.isServer()||z(this,sr).isStale||!X1(e))return;const r=e6(z(this,sr).dataUpdatedAt,e)+1;ke(this,vl,ol.setTimeout(()=>{z(this,sr).isStale||this.updateResult()},r))},sy=function(){return(typeof this.options.refetchInterval=="function"?this.options.refetchInterval(z(this,ut)):this.options.refetchInterval)??!1},iy=function(e){lt(this,yt,ly).call(this),ke(this,Go,e),!(Hd.isServer()||Wr(this.options.enabled,z(this,ut))===!1||!X1(z(this,Go))||z(this,Go)===0)&&ke(this,yl,ol.setInterval(()=>{(this.options.refetchIntervalInBackground||y2.isFocused())&&lt(this,yt,hd).call(this)},z(this,Go)))},oy=function(){lt(this,yt,ry).call(this),lt(this,yt,iy).call(this,lt(this,yt,sy).call(this))},ay=function(){z(this,vl)!==void 0&&(ol.clearTimeout(z(this,vl)),ke(this,vl,void 0))},ly=function(){z(this,yl)!==void 0&&(ol.clearInterval(z(this,yl)),ke(this,yl,void 0))},uy=function(){const e=z(this,br).getQueryCache().build(z(this,br),this.options);if(e===z(this,ut))return;const n=z(this,ut);ke(this,ut,e),ke(this,wf,e.state),this.hasListeners()&&(n==null||n.removeObserver(this),e.addObserver(this))},u6=function(e){Vn.batch(()=>{e.listeners&&this.listeners.forEach(n=>{n(z(this,sr))}),z(this,br).getQueryCache().notify({query:z(this,ut),type:"observerResultsUpdated"})})},Z8);function fL(t,e){return Wr(e.enabled,t)!==!1&&t.state.data===void 0&&!(t.state.status==="error"&&Wr(e.retryOnMount,t)===!1)}function hE(t,e){return fL(t,e)||t.state.data!==void 0&&cy(t,e,e.refetchOnMount)}function cy(t,e,n){if(Wr(e.enabled,t)!==!1&&ta(e.staleTime,t)!=="static"){const r=typeof n=="function"?n(t):n;return r==="always"||r!==!1&&x2(t,e)}return!1}function pE(t,e,n,r){return(t!==e||Wr(r.enabled,t)===!1)&&(!n.suspense||t.state.status!=="error")&&x2(t,n)}function x2(t,e){return Wr(e.enabled,t)!==!1&&t.isStaleByTime(ta(e.staleTime,t))}function hL(t,e){return!Q1(t.getCurrentResult(),e)}var bf,ii,Yn,_l,oi,Ho,Y8,pL=(Y8=class extends o6{constructor(e){super();He(this,oi);He(this,bf);He(this,ii);He(this,Yn);He(this,_l);ke(this,bf,e.client),this.mutationId=e.mutationId,ke(this,Yn,e.mutationCache),ke(this,ii,[]),this.state=e.state||mL(),this.setOptions(e.options),this.scheduleGc()}setOptions(e){this.options=e,this.updateGcTime(this.options.gcTime)}get meta(){return this.options.meta}addObserver(e){z(this,ii).includes(e)||(z(this,ii).push(e),this.clearGcTimeout(),z(this,Yn).notify({type:"observerAdded",mutation:this,observer:e}))}removeObserver(e){ke(this,ii,z(this,ii).filter(n=>n!==e)),this.scheduleGc(),z(this,Yn).notify({type:"observerRemoved",mutation:this,observer:e})}optionalRemove(){z(this,ii).length||(this.state.status==="pending"?this.scheduleGc():z(this,Yn).remove(this))}continue(){var e;return((e=z(this,_l))==null?void 0:e.continue())??this.execute(this.state.variables)}async execute(e){var a,u,c,d,h,p,m,_,w,y,x,S,P,T,k,R,M,L;const n=()=>{lt(this,oi,Ho).call(this,{type:"continue"})},r={client:z(this,bf),meta:this.options.meta,mutationKey:this.options.mutationKey};ke(this,_l,i6({fn:()=>this.options.mutationFn?this.options.mutationFn(e,r):Promise.reject(new Error("No mutationFn found")),onFail:(A,O)=>{lt(this,oi,Ho).call(this,{type:"failed",failureCount:A,error:O})},onPause:()=>{lt(this,oi,Ho).call(this,{type:"pause"})},onContinue:n,retry:this.options.retry??0,retryDelay:this.options.retryDelay,networkMode:this.options.networkMode,canRun:()=>z(this,Yn).canRun(this)}));const s=this.state.status==="pending",i=!z(this,_l).canStart();try{if(s)n();else{lt(this,oi,Ho).call(this,{type:"pending",variables:e,isPaused:i}),z(this,Yn).config.onMutate&&await z(this,Yn).config.onMutate(e,this,r);const O=await((u=(a=this.options).onMutate)==null?void 0:u.call(a,e,r));O!==this.state.context&&lt(this,oi,Ho).call(this,{type:"pending",context:O,variables:e,isPaused:i})}const A=await z(this,_l).start();return await((d=(c=z(this,Yn).config).onSuccess)==null?void 0:d.call(c,A,e,this.state.context,this,r)),await((p=(h=this.options).onSuccess)==null?void 0:p.call(h,A,e,this.state.context,r)),await((_=(m=z(this,Yn).config).onSettled)==null?void 0:_.call(m,A,null,this.state.variables,this.state.context,this,r)),await((y=(w=this.options).onSettled)==null?void 0:y.call(w,A,null,e,this.state.context,r)),lt(this,oi,Ho).call(this,{type:"success",data:A}),A}catch(A){try{await((S=(x=z(this,Yn).config).onError)==null?void 0:S.call(x,A,e,this.state.context,this,r))}catch(O){Promise.reject(O)}try{await((T=(P=this.options).onError)==null?void 0:T.call(P,A,e,this.state.context,r))}catch(O){Promise.reject(O)}try{await((R=(k=z(this,Yn).config).onSettled)==null?void 0:R.call(k,void 0,A,this.state.variables,this.state.context,this,r))}catch(O){Promise.reject(O)}try{await((L=(M=this.options).onSettled)==null?void 0:L.call(M,void 0,A,e,this.state.context,r))}catch(O){Promise.reject(O)}throw lt(this,oi,Ho).call(this,{type:"error",error:A}),A}finally{z(this,Yn).runNext(this)}}},bf=new WeakMap,ii=new WeakMap,Yn=new WeakMap,_l=new WeakMap,oi=new WeakSet,Ho=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),Vn.batch(()=>{z(this,ii).forEach(r=>{r.onMutationUpdate(e)}),z(this,Yn).notify({mutation:this,type:"updated",action:e})})},Y8);function mL(){return{context:void 0,data:void 0,error:null,failureCount:0,failureReason:null,isPaused:!1,status:"idle",variables:void 0,submittedAt:0}}var Ki,Hs,Sf,X8,gL=(X8=class extends Cf{constructor(e={}){super();He(this,Ki);He(this,Hs);He(this,Sf);this.config=e,ke(this,Ki,new Set),ke(this,Hs,new Map),ke(this,Sf,0)}build(e,n,r){const s=new pL({client:e,mutationCache:this,mutationId:++qh(this,Sf)._,options:e.defaultMutationOptions(n),state:r});return this.add(s),s}add(e){z(this,Ki).add(e);const n=Gh(e);if(typeof n=="string"){const r=z(this,Hs).get(n);r?r.push(e):z(this,Hs).set(n,[e])}this.notify({type:"added",mutation:e})}remove(e){if(z(this,Ki).delete(e)){const n=Gh(e);if(typeof n=="string"){const r=z(this,Hs).get(n);if(r)if(r.length>1){const s=r.indexOf(e);s!==-1&&r.splice(s,1)}else r[0]===e&&z(this,Hs).delete(n)}}this.notify({type:"removed",mutation:e})}canRun(e){const n=Gh(e);if(typeof n=="string"){const r=z(this,Hs).get(n),s=r==null?void 0:r.find(i=>i.state.status==="pending");return!s||s===e}else return!0}runNext(e){var r;const n=Gh(e);if(typeof n=="string"){const s=(r=z(this,Hs).get(n))==null?void 0:r.find(i=>i!==e&&i.state.isPaused);return(s==null?void 0:s.continue())??Promise.resolve()}else return Promise.resolve()}clear(){Vn.batch(()=>{z(this,Ki).forEach(e=>{this.notify({type:"removed",mutation:e})}),z(this,Ki).clear(),z(this,Hs).clear()})}getAll(){return Array.from(z(this,Ki))}find(e){const n={exact:!0,...e};return this.getAll().find(r=>aE(n,r))}findAll(e={}){return this.getAll().filter(n=>aE(e,n))}notify(e){Vn.batch(()=>{this.listeners.forEach(n=>{n(e)})})}resumePausedMutations(){const e=this.getAll().filter(n=>n.state.isPaused);return Vn.batch(()=>Promise.all(e.map(n=>n.continue().catch(Cr))))}},Ki=new WeakMap,Hs=new WeakMap,Sf=new WeakMap,X8);function Gh(t){var e;return(e=t.options.scope)==null?void 0:e.id}var ai,Q8,vL=(Q8=class extends Cf{constructor(e={}){super();He(this,ai);this.config=e,ke(this,ai,new Map)}build(e,n,r){const s=n.queryKey,i=n.queryHash??_2(s,n);let a=this.get(i);return a||(a=new cL({client:e,queryKey:s,queryHash:i,options:e.defaultQueryOptions(n),state:r,defaultOptions:e.getQueryDefaults(s)}),this.add(a)),a}add(e){z(this,ai).has(e.queryHash)||(z(this,ai).set(e.queryHash,e),this.notify({type:"added",query:e}))}remove(e){const n=z(this,ai).get(e.queryHash);n&&(e.destroy(),n===e&&z(this,ai).delete(e.queryHash),this.notify({type:"removed",query:e}))}clear(){Vn.batch(()=>{this.getAll().forEach(e=>{this.remove(e)})})}get(e){return z(this,ai).get(e)}getAll(){return[...z(this,ai).values()]}find(e){const n={exact:!0,...e};return this.getAll().find(r=>oE(n,r))}findAll(e={}){const n=this.getAll();return Object.keys(e).length>0?n.filter(r=>oE(e,r)):n}notify(e){Vn.batch(()=>{this.listeners.forEach(n=>{n(e)})})}onFocus(){Vn.batch(()=>{this.getAll().forEach(e=>{e.onFocus()})})}onOnline(){Vn.batch(()=>{this.getAll().forEach(e=>{e.onOnline()})})}},ai=new WeakMap,Q8),tn,Ko,Zo,Gu,Ku,Yo,Zu,Yu,J8,yL=(J8=class{constructor(t={}){He(this,tn);He(this,Ko);He(this,Zo);He(this,Gu);He(this,Ku);He(this,Yo);He(this,Zu);He(this,Yu);ke(this,tn,t.queryCache||new vL),ke(this,Ko,t.mutationCache||new gL),ke(this,Zo,t.defaultOptions||{}),ke(this,Gu,new Map),ke(this,Ku,new Map),ke(this,Yo,0)}mount(){qh(this,Yo)._++,z(this,Yo)===1&&(ke(this,Zu,y2.subscribe(async t=>{t&&(await this.resumePausedMutations(),z(this,tn).onFocus())})),ke(this,Yu,im.subscribe(async t=>{t&&(await this.resumePausedMutations(),z(this,tn).onOnline())})))}unmount(){var t,e;qh(this,Yo)._--,z(this,Yo)===0&&((t=z(this,Zu))==null||t.call(this),ke(this,Zu,void 0),(e=z(this,Yu))==null||e.call(this),ke(this,Yu,void 0))}isFetching(t){return z(this,tn).findAll({...t,fetchStatus:"fetching"}).length}isMutating(t){return z(this,Ko).findAll({...t,status:"pending"}).length}getQueryData(t){var n;const e=this.defaultQueryOptions({queryKey:t});return(n=z(this,tn).get(e.queryHash))==null?void 0:n.state.data}ensureQueryData(t){const e=this.defaultQueryOptions(t),n=z(this,tn).build(this,e),r=n.state.data;return r===void 0?this.fetchQuery(t):(t.revalidateIfStale&&n.isStaleByTime(ta(e.staleTime,n))&&this.prefetchQuery(e),Promise.resolve(r))}getQueriesData(t){return z(this,tn).findAll(t).map(({queryKey:e,state:n})=>{const r=n.data;return[e,r]})}setQueryData(t,e,n){const r=this.defaultQueryOptions({queryKey:t}),s=z(this,tn).get(r.queryHash),i=s==null?void 0:s.state.data,a=QO(e,i);if(a!==void 0)return z(this,tn).build(this,r).setData(a,{...n,manual:!0})}setQueriesData(t,e,n){return Vn.batch(()=>z(this,tn).findAll(t).map(({queryKey:r})=>[r,this.setQueryData(r,e,n)]))}getQueryState(t){var n;const e=this.defaultQueryOptions({queryKey:t});return(n=z(this,tn).get(e.queryHash))==null?void 0:n.state}removeQueries(t){const e=z(this,tn);Vn.batch(()=>{e.findAll(t).forEach(n=>{e.remove(n)})})}resetQueries(t,e){const n=z(this,tn);return Vn.batch(()=>(n.findAll(t).forEach(r=>{r.reset()}),this.refetchQueries({type:"active",...t},e)))}cancelQueries(t,e={}){const n={revert:!0,...e},r=Vn.batch(()=>z(this,tn).findAll(t).map(s=>s.cancel(n)));return Promise.all(r).then(Cr).catch(Cr)}invalidateQueries(t,e={}){return Vn.batch(()=>(z(this,tn).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=Vn.batch(()=>z(this,tn).findAll(t).filter(s=>!s.isDisabled()&&!s.isStatic()).map(s=>{let i=s.fetch(void 0,n);return n.throwOnError||(i=i.catch(Cr)),s.state.fetchStatus==="paused"?Promise.resolve():i}));return Promise.all(r).then(Cr)}fetchQuery(t){const e=this.defaultQueryOptions(t);e.retry===void 0&&(e.retry=!1);const n=z(this,tn).build(this,e);return n.isStaleByTime(ta(e.staleTime,n))?n.fetch(e):Promise.resolve(n.state.data)}prefetchQuery(t){return this.fetchQuery(t).then(Cr).catch(Cr)}fetchInfiniteQuery(t){return t._type="infinite",this.fetchQuery(t)}prefetchInfiniteQuery(t){return this.fetchInfiniteQuery(t).then(Cr).catch(Cr)}ensureInfiniteQueryData(t){return t._type="infinite",this.ensureQueryData(t)}resumePausedMutations(){return im.isOnline()?z(this,Ko).resumePausedMutations():Promise.resolve()}getQueryCache(){return z(this,tn)}getMutationCache(){return z(this,Ko)}getDefaultOptions(){return z(this,Zo)}setDefaultOptions(t){ke(this,Zo,t)}setQueryDefaults(t,e){z(this,Gu).set(Vd(t),{queryKey:t,defaultOptions:e})}getQueryDefaults(t){const e=[...z(this,Gu).values()],n={};return e.forEach(r=>{Xu(t,r.queryKey)&&Object.assign(n,r.defaultOptions)}),n}setMutationDefaults(t,e){z(this,Ku).set(Vd(t),{mutationKey:t,defaultOptions:e})}getMutationDefaults(t){const e=[...z(this,Ku).values()],n={};return e.forEach(r=>{Xu(t,r.mutationKey)&&Object.assign(n,r.defaultOptions)}),n}defaultQueryOptions(t){if(t._defaulted)return t;const e={...z(this,Zo).queries,...this.getQueryDefaults(t.queryKey),...t,_defaulted:!0};return e.queryHash||(e.queryHash=_2(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===w2&&(e.enabled=!1),e}defaultMutationOptions(t){return t!=null&&t._defaulted?t:{...z(this,Zo).mutations,...(t==null?void 0:t.mutationKey)&&this.getMutationDefaults(t.mutationKey),...t,_defaulted:!0}}clear(){z(this,tn).clear(),z(this,Ko).clear()}},tn=new WeakMap,Ko=new WeakMap,Zo=new WeakMap,Gu=new WeakMap,Ku=new WeakMap,Yo=new WeakMap,Zu=new WeakMap,Yu=new WeakMap,J8),c6=v.createContext(void 0),d6=t=>{const e=v.useContext(c6);if(!e)throw new Error("No QueryClient set, use QueryClientProvider to set one");return e},_L=({client:t,children:e})=>(v.useEffect(()=>(t.mount(),()=>{t.unmount()}),[t]),E.jsx(c6.Provider,{value:t,children:e})),f6=v.createContext(!1),wL=()=>v.useContext(f6);f6.Provider;function xL(){let t=!1;return{clearReset:()=>{t=!1},reset:()=>{t=!0},isReset:()=>t}}var bL=v.createContext(xL()),SL=()=>v.useContext(bL),EL=(t,e,n)=>{const r=n!=null&&n.state.error&&typeof t.throwOnError=="function"?r6(t.throwOnError,[n.state.error,n]):t.throwOnError;(t.suspense||t.experimental_prefetchInRender||r)&&(e.isReset()||(t.retryOnMount=!1))},CL=t=>{v.useEffect(()=>{t.clearReset()},[t])},kL=({result:t,errorResetBoundary:e,throwOnError:n,query:r,suspense:s})=>t.isError&&!e.isReset()&&!t.isFetching&&r&&(s&&t.data===void 0||r6(n,[t.error,r])),PL=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))}},TL=(t,e)=>t.isLoading&&t.isFetching&&!e,RL=(t,e)=>(t==null?void 0:t.suspense)&&e.isPending,mE=(t,e,n)=>e.fetchOptimistic(t).catch(()=>{n.clearReset()});function AL(t,e,n){var _,w,y,x;const r=wL(),s=SL(),i=d6(),a=i.defaultQueryOptions(t);(w=(_=i.getDefaultOptions().queries)==null?void 0:_._experimental_beforeQuery)==null||w.call(_,a);const u=i.getQueryCache().get(a.queryHash),c=t.subscribed!==!1;a._optimisticResults=r?"isRestoring":c?"optimistic":void 0,PL(a),EL(a,s,u),CL(s);const d=!i.getQueryCache().get(a.queryHash),[h]=v.useState(()=>new e(i,a)),p=h.getOptimisticResult(a),m=!r&&c;if(v.useSyncExternalStore(v.useCallback(S=>{const P=m?h.subscribe(Vn.batchCalls(S)):Cr;return h.updateResult(),P},[h,m]),()=>h.getCurrentResult(),()=>h.getCurrentResult()),v.useEffect(()=>{h.setOptions(a)},[a,h]),RL(a,p))throw mE(a,h,s);if(kL({result:p,errorResetBoundary:s,throwOnError:a.throwOnError,query:u,suspense:a.suspense}))throw p.error;if((x=(y=i.getDefaultOptions().queries)==null?void 0:y._experimental_afterQuery)==null||x.call(y,a,p),a.experimental_prefetchInRender&&!Hd.isServer()&&TL(p,r)){const S=d?mE(a,h,s):u==null?void 0:u.promise;S==null||S.catch(Cr).finally(()=>{h.updateResult()})}return a.notifyOnChangeProps?p:h.trackResult(p)}function dy(t,e){return AL(t,dL)}var ne=typeof window<"u"?window:void 0,Qn=typeof globalThis<"u"?globalThis:ne,ar=Qn==null?void 0:Qn.navigator,_e=Qn==null?void 0:Qn.document,Nt=Qn==null?void 0:Qn.location,b2=Qn==null?void 0:Qn.fetch,fy=Qn!=null&&Qn.XMLHttpRequest&&"withCredentials"in new Qn.XMLHttpRequest?Qn.XMLHttpRequest:void 0,gE=Qn==null?void 0:Qn.AbortController,IL=Qn==null?void 0:Qn.CompressionStream,Sr=ar==null?void 0:ar.userAgent;function h6(){return!(!ne||ne.navigator.onLine===!1)}var Jc=typeof globalThis<"u"?globalThis:ne;Jc&&typeof self>"u"&&(Jc.self=Jc),Jc&&typeof File>"u"&&(Jc.File=function(){});var Fe=ne??{},xt={DEBUG:!1,LIB_VERSION:"0.5.0",LIB_NAME:"browser-common"};function vE(t,e,n,r,s,i,a){try{var u=t[i](a),c=u.value}catch(d){return void n(d)}u.done?e(c):Promise.resolve(c).then(r,s)}function St(t){return function(){var e=this,n=arguments;return new Promise((function(r,s){var i=t.apply(e,n);function a(c){vE(i,r,s,a,u,"next",c)}function u(c){vE(i,r,s,a,u,"throw",c)}a(void 0)}))}}function ue(){return ue=Object.assign?Object.assign.bind():function(t){for(var e=1;arguments.length>e;e++){var n=arguments[e];for(var r in n)({}).hasOwnProperty.call(n,r)&&(t[r]=n[r])}return t},ue.apply(null,arguments)}function p6(t,e){if(t==null)return{};var n={};for(var r in t)if({}.hasOwnProperty.call(t,r)){if(e.indexOf(r)!==-1)continue;n[r]=t[r]}return n}var yE=t=>{if(typeof t!="string")return t;try{return JSON.parse(t)}catch{return t}};function _E(t){return typeof t=="string"||t}function wE(t){return typeof t=="string"?t:void 0}var ed,ML=["$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","irclid","_kx","$session_id","$window_id","$lib","$lib_version","$device_id","$is_server"],zi=(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.SurveysSeen="surveys_seen",t.Surveys="surveys",t.RemoteConfig="remote_config",t.FlagsEndpointWasHit="flags_endpoint_was_hit",t.DeviceId="device_id",t})({}),xE=(function(t){return t.GZipJS="gzip-js",t.Base64="base64",t})({}),OL=["$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"],LL=["token"],m6="NativeGzipValidationError",hy=t=>t.length>=2&&t[0]===31&&t[1]===139,bE=(t,e)=>t===xE.GZipJS||e===xE.GZipJS||e==="gzip",SE=t=>!(!t||typeof t!="object")&&("name"in t?String(t.name):"")==="NotReadableError",Kh=t=>{var e=new Error("Native gzip produced invalid output: "+t);throw e.name=m6,e},DL=(function(){var t=St((function*(e,n){18>e.size&&Kh("too-short");var r=new Uint8Array(yield e.slice(0,10).arrayBuffer());hy(r)&&r[2]===8||Kh("invalid-header");var s=new DataView(yield e.slice(e.size-8).arrayBuffer());s.getUint32(0,!0)!==(a=>{for(var u=(()=>{if(ed)return ed;ed=[];for(var h=0;256>h;h++){for(var p=h,m=0;8>m;m++)p=1&p?3988292384^p>>>1:p>>>1;ed[h]=p>>>0}return ed})(),c=4294967295,d=0;a.length>d;d++)c=u[255&(c^a[d])]^c>>>8;return(4294967295^c)>>>0})(n)&&Kh("invalid-crc");var i=n.length>>>0;s.getUint32(4,!0)!==i&&Kh("invalid-size")}));return function(e,n){return t.apply(this,arguments)}})();function py(){return py=St((function*(t,e,n){e===void 0&&(e=!0);try{var r=new TextEncoder().encode(t),s=new globalThis.CompressionStream("gzip"),i=s.writable.getWriter(),a=i.write(r).then((()=>i.close())).catch((function(){var d=St((function*(h){try{yield i.abort(h)}catch{}throw h}));return function(h){return d.apply(this,arguments)}})()),u=new Response(s.readable).blob(),c=(yield Promise.all([u,a]))[0];return yield DL(c,r),c}catch(d){if(n!=null&&n.rethrow)throw d;return e&&console.error("Failed to gzip compress data",d),null}})),py.apply(this,arguments)}var NL=["amazonbot","amazonproductbot","app.hypefactors.com","applebot","archive.org_bot","awariobot","backlinksextendedbot","baiduspider","bingbot","bingpreview","chrome-lighthouse","dataforseobot","deepscan","duckduckbot","facebookexternal","facebookcatalog","http://yandex.com/bots","hubspot","ia_archiver","leikibot","linkedinbot","meta-externalagent","mj12bot","msnbot","nessus","petalbot","pinterest","prerender","rogerbot","screaming frog","sebot-wa","sitebulb","slackbot","slurp","trendictionbot","turnitin","twitterbot","vercel-screenshot","vercelbot","yahoo! slurp","yandexbot","zoombot","bot.htm","bot.php","(bot;","bot/","crawler","ahrefsbot","ahrefssiteaudit","semrushbot","siteauditbot","splitsignalbot","gptbot","oai-searchbot","chatgpt-user","perplexitybot","better uptime bot","sentryuptimebot","uptimerobot","headlesschrome","cypress","google-hoteladsverifier","adsbot-google","apis-google","duplexweb-google","feedfetcher-google","google favicon","google web preview","google-read-aloud","googlebot","googleother","google-cloudvertexbot","googleweblight","mediapartners-google","storebot-google","google-inspectiontool","bytespider"],EE=function(t,e){if(e===void 0&&(e=[]),!t)return!1;var n=t.toLowerCase();return NL.concat(e).some((r=>{var s=r.toLowerCase();return n.indexOf(s)!==-1}))};function Ke(t,e){return t.indexOf(e)!==-1}var o0=function(t){return t.trim()},my=function(t){return t.replace(/^\$/,"")};function g6(t){var e,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"}var v6=Object.prototype,y6=v6.hasOwnProperty,a0=v6.toString,Ze=Array.isArray||function(t){return a0.call(t)==="[object Array]"},ir=t=>typeof t=="function",It=t=>t===Object(t)&&!Ze(t),eo=t=>{if(It(t)){for(var e in t)if(y6.call(t,e))return!1;return!0}return!1},he=t=>t===void 0,ht=t=>a0.call(t)=="[object String]",gy=t=>ht(t)&&t.trim().length===0,Tr=t=>t===null,Qe=t=>he(t)||Tr(t),sn=t=>a0.call(t)=="[object Number]"&&t==t,$i=t=>sn(t)&&t>0,Kr=t=>a0.call(t)==="[object Boolean]",jL=t=>t instanceof FormData,FL=t=>Ke(OL,t),$L=t=>Ke(LL,t);function _6(t){return t===null||typeof t!="object"}function om(t,e){return{}.toString.call(t)==="[object "+e+"]"}function S2(t){return typeof Event<"u"&&w6(t,Event)}function w6(t,e){try{return t instanceof e}catch{return!1}}var VL=[!0,"true",1,"1","yes"],xv=t=>Ke(VL,t),HL=[!1,"false",0,"0","no"];function di(t,e,n,r,s){return e>n&&(r.warn("min cannot be greater than max."),e=n),sn(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),di(s||n,e,n,r))}class zL{constructor(e){this.it={},this.rt=e.rt,this.nt=di(e.bucketSize,0,100,e.st),this.ot=di(e.refillRate,0,this.nt,e.st),this.ut=di(e.refillInterval,0,864e5,e.st)}ht(e,n){var r=Math.floor((n-e.lastAccess)/this.ut);r>0&&(e.tokens=Math.min(e.tokens+r*this.ot,this.nt),e.lastAccess=e.lastAccess+r*this.ut)}consumeRateLimit(e){var n,r=Date.now(),s=String(e),i=this.it[s];return i?this.ht(i,r):this.it[s]=i={tokens:this.nt,lastAccess:r},i.tokens===0||(i.tokens--,i.tokens===0&&((n=this.rt)==null||n.call(this,e)),i.tokens===0)}stop(){this.it={}}}var Jr="Mobile",am="iOS",to="Android",Qu="Tablet",x6=to+" "+Qu,b6="iPad",S6="Apple",E6=S6+" Watch",Ed="Safari",Ju="BlackBerry",C6="Samsung",k6=C6+"Browser",P6=C6+" Internet",wl="Chrome",UL=wl+" OS",T6=wl+" "+am,E2="Internet Explorer",R6=E2+" "+Jr,C2="Opera",BL=C2+" Mini",k2="Edge",A6="Microsoft "+k2,Tu="Firefox",I6=Tu+" "+am,zd="Nintendo",Ud="PlayStation",Ru="Xbox",M6=to+" "+Jr,O6=Jr+" "+Ed,pd="Windows",vy=pd+" Phone",CE="Nokia",yy="Ouya",L6="Generic",WL=L6+" "+Jr.toLowerCase(),D6=L6+" "+Qu.toLowerCase(),_y="Konqueror",N6="Oculus Browser",lm="Vivaldi",j6="Yandex",um="Whale",wy="DuckDuckGo",F6="Pale Moon",cm="Waterfox",Cd="Brave",$6="Google Search App",zt="(\\d+(\\.\\d+)?)",bv=new RegExp("Version/"+zt),qL=new RegExp(Ru,"i"),GL=new RegExp(Ud+" \\w+","i"),KL=new RegExp(zd+" \\w+","i"),P2=new RegExp(Ju+"|PlayBook|BB10","i"),ZL={"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"},V6=function(t,e,n,r){e=e||"";var s=(function(i){return i!=null&&i.brave?Cd:null})(n);return s||(r!=null&&r.detectGoogleSearchApp&&Ke(t,"GSA/")?$6:Ke(t," OPR/")&&Ke(t,"Mini")?BL:Ke(t," OPR/")?C2:P2.test(t)?Ju:Ke(t,"IE"+Jr)||Ke(t,"WPDesktop")?R6:Ke(t,"OculusBrowser")?N6:Ke(t,k6)?P6:Ke(t,k2)||Ke(t,"Edg/")?A6:Ke(t,lm+"/")?lm:Ke(t,"YaBrowser/")?j6:Ke(t,um+"/")?um:Ke(t,wy+"/")||Ke(t,"Ddg/")?wy:Ke(t,"FBIOS")?"Facebook "+Jr:Ke(t,"UCWEB")||Ke(t,"UCBrowser")?"UC Browser":Ke(t,"CriOS")?T6:Ke(t,"CrMo")||Ke(t,wl)?wl:Ke(t,to)&&Ke(t,Ed)?M6:Ke(t,"FxiOS")?I6:Ke(t.toLowerCase(),_y.toLowerCase())?_y:Ke(t,Cd+"/")?Cd:((i,a)=>a&&Ke(a,S6)||(function(u){return Ke(u,Ed)&&!Ke(u,wl)&&!Ke(u,to)})(i))(t,e)?Ke(t,Jr)?O6:Ed:Ke(t,"PaleMoon/")?F6:Ke(t,cm+"/")?cm:Ke(t,Tu)?Tu:Ke(t,"MSIE")||Ke(t,"Trident/")?E2:Ke(t,"Gecko")?Tu:"")},YL={[R6]:[new RegExp("rv:"+zt)],[A6]:[new RegExp(k2+"?\\/"+zt)],[wl]:[new RegExp("("+wl+"|CrMo)\\/"+zt)],[T6]:[new RegExp("CriOS\\/"+zt)],"UC Browser":[new RegExp("(UCBrowser|UCWEB)\\/"+zt)],[Ed]:[bv],[O6]:[bv],[C2]:[new RegExp("(Opera|OPR)\\/"+zt)],[Tu]:[new RegExp(Tu+"\\/"+zt)],[I6]:[new RegExp("FxiOS\\/"+zt)],[_y]:[new RegExp("Konqueror[:/]?"+zt,"i")],[Ju]:[new RegExp(Ju+" "+zt),bv],[M6]:[new RegExp("android\\s"+zt,"i")],[P6]:[new RegExp(k6+"\\/"+zt)],[N6]:[new RegExp("OculusBrowser\\/"+zt)],[lm]:[new RegExp(lm+"\\/"+zt)],[j6]:[new RegExp("YaBrowser\\/"+zt)],[um]:[new RegExp(um+"\\/"+zt)],[Cd]:[new RegExp(Cd+"\\/"+zt)],[wy]:[new RegExp("(DuckDuckGo|Ddg)\\/"+zt)],[F6]:[new RegExp("PaleMoon\\/"+zt)],[cm]:[new RegExp(cm+"\\/"+zt)],[$6]:[new RegExp("GSA\\/"+zt)],[E2]:[new RegExp("(rv:|MSIE )"+zt)],Mozilla:[new RegExp("rv:"+zt)]},XL=function(t,e,n,r){var s=V6(t,e,n,r),i=YL[s];if(he(i))return null;for(var a=0;i.length>a;a++){var u=t.match(i[a]);if(u)return parseFloat(u[u.length-2])}return null},kE=[[new RegExp(Ru+"; "+Ru+" (.*?)[);]","i"),t=>[Ru,t&&t[1]||""]],[new RegExp(zd,"i"),[zd,""]],[new RegExp(Ud,"i"),[Ud,""]],[P2,[Ju,""]],[new RegExp(pd,"i"),(t,e)=>{if(/Phone/.test(e)||/WPDesktop/.test(e))return[vy,""];if(new RegExp(Jr).test(e)&&!/IEMobile\b/.test(e))return[pd+" "+Jr,""];var n=/Windows NT ([0-9.]+)/i.exec(e);if(n&&n[1]){var r=ZL[n[1]]||"";return/arm/i.test(e)&&(r="RT"),[pd,r]}return[pd,""]}],[/((iPhone|iPad|iPod).*?OS (\d+)_(\d+)_?(\d+)?|iPhone)/,t=>t&&t[3]?[am,[t[3],t[4],t[5]||"0"].join(".")]:[am,""]],[/(watch.*\/(\d+\.\d+\.\d+)|watch os,(\d+\.\d+),)/i,t=>{var e="";return t&&t.length>=3&&(e=he(t[2])?t[3]:t[2]),["watchOS",e]}],[new RegExp("("+to+" (\\d+)\\.(\\d+)\\.?(\\d+)?|"+to+")","i"),t=>t&&t[2]?[to,[t[2],t[3],t[4]||"0"].join(".")]:[to,""]],[/Mac OS X (\d+)[_.](\d+)[_.]?(\d+)?/i,t=>{var e=["Mac OS X",""];return t&&t[1]&&(e[1]=[t[1],t[2],t[3]||"0"].join(".")),e}],[/Mac/i,["Mac OS X",""]],[/CrOS/,[UL,""]],[/Linux|debian/i,["Linux",""]]],PE=function(t){return KL.test(t)?zd:GL.test(t)?Ud:qL.test(t)?Ru:new RegExp(yy,"i").test(t)?yy:new RegExp("("+vy+"|WPDesktop)","i").test(t)?vy:/iPad/.test(t)?b6:/iPod/.test(t)?"iPod Touch":/iPhone/.test(t)?"iPhone":/(watch)(?: ?os[,/]|\d,\d\/)[\d.]+/i.test(t)?E6:P2.test(t)?Ju:/(kobo)\s(ereader|touch)/i.test(t)?"Kobo":new RegExp(CE,"i").test(t)?CE:/(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(Jr).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)?to:x6:new RegExp("(pda|"+Jr+")","i").test(t)?WL:new RegExp(Qu,"i").test(t)&&!new RegExp(Qu+" pc","i").test(t)?D6:""},QL=/^[0-9a-f]{8}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{12}$/i;function TE(t,e){return typeof(n=t)=="string"&&QL.test(n)?t:e();var n}function oa(t){return t&&t.split("#")[0]}function T2(t,e){var n=setTimeout(t,e);return n!=null&&n.unref&&(n==null||n.unref()),n}function RE(t,e,n){return H6.apply(this,arguments)}function H6(){return(H6=St((function*(t,e,n){var r;try{return yield Promise.race([t,new Promise(((s,i)=>{r=T2((()=>{try{n==null||n(),s()}catch(a){i(a)}}),e)}))])}finally{clearTimeout(r)}}))).apply(this,arguments)}var JL=t=>t instanceof Error,z6={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}},eD=z6.info;function U6(t){if(Kr(t))return{boolValue:t};if(typeof t=="number")return Number.isFinite(t)?Number.isInteger(t)?{intValue:t}:{doubleValue:t}:{stringValue:String(t)};if(typeof t=="string")return{stringValue:t};if(Ze(t))return{arrayValue:{values:t.map((e=>U6(e)))}};try{return{stringValue:JSON.stringify(t)}}catch{return{stringValue:String(t)}}}function dm(t){var e=[];for(var n in t){var r=t[n];Tr(r)||he(r)||e.push({key:n,value:U6(r)})}return e}function tD(t,e){var n=z6[t.level||"info"]||eD,r=n.text,s=n.number,i=String(Date.now())+"000000",a={};e.distinctId&&(a.posthogDistinctId=e.distinctId),e.sessionId&&(a.sessionId=e.sessionId),e.windowId&&(a["window.id"]=e.windowId),Qe(e.sessionStartTimestamp)||(a.sessionStartTimestamp=String(e.sessionStartTimestamp)),Qe(e.lastActivityTimestamp)||(a.lastActivityTimestamp=String(e.lastActivityTimestamp)),e.currentUrl&&(a["url.full"]=e.currentUrl),e.screenName&&(a["screen.name"]=e.screenName),e.appState&&(a["app.state"]=e.appState),e.activeFeatureFlags&&e.activeFeatureFlags.length>0&&(a.feature_flags=e.activeFeatureFlags);var u=ue({},a,t.attributes||{}),c={timeUnixNano:i,observedTimeUnixNano:i,severityNumber:s,severityText:r,body:{stringValue:t.body},attributes:dm(u)};return t.trace_id&&(c.traceId=t.trace_id),t.span_id&&(c.spanId=t.span_id),he(t.trace_flags)||(c.flags=t.trace_flags),c}function B6(t,e,n){return ue({},t.resourceAttributes,{"service.name":t.serviceName||"unknown_service"},t.environment&&{"deployment.environment":t.environment},t.serviceVersion&&{"service.version":t.serviceVersion},{"telemetry.sdk.name":e,"telemetry.sdk.version":n})}function W6(t,e,n,r){return{resourceLogs:[{resource:{attributes:dm(e)},scopeLogs:[{scope:{name:n,version:r},logRecords:t}]}]}}let nD=class{constructor(t,e,n,r,s,i,a){var u;i===void 0&&(i=()=>Promise.resolve()),this._instance=t,this.qe=e,this.st=n,this.dt=r,this.vt=s,this.ct=i,this.ft=a,this.yt=null,this.bt=0,this._t=0,this.wt=0,this.kt=0,this.xt=!1,this.St=e.maxBufferSize,this.Ct=Math.max((u=e.maxQueueSize)!==null&&u!==void 0?u:e.maxBufferSize,e.maxBufferSize),this.Mt=e.flushIntervalMs,this.Tt=e.maxBatchRecordsPerPost,this.Et=e.rateCapWindowMs,this.It=e.maxLogsPerInterval}reset(){this.Pt(),this.yt=null,this.wt=0,this.kt=0,this.xt=!1,this.bt=0,this._t=0,this.Tt=this.qe.maxBatchRecordsPerPost}onReconnect(){this._t=0,this.Rt()}captureLog(t){if(!this._instance.isDisabled&&!this._instance.optedOut&&t!=null&&t.body){var e=this.At(t);if(e!==null)if(e.body){if(this.Ft()){var n={record:tD(e,this.dt())};this.vt((()=>this.Lt(n)))}}else this.st.info("Log was rejected in beforeSend function")}}At(t){var e=this.qe.beforeSend;if(!e)return t;var n=Ze(e)?e:[e],r=t;for(var s of n)try{var i=s(r);if(!i)return this.st.info("Log was rejected in beforeSend function"),null;r=i}catch(a){return this.st.error("Error in beforeSend function for log:",a),null}return r}Ft(){if(this.It===void 0)return!0;var t=Date.now(),e=t-this.wt;return this.Et>e&&e>=0||(this.wt=t,this.kt=0,this.xt=!1),this.It>this.kt?(this.kt++,!0):(this.xt||(this.st.warn("captureLog dropping logs: exceeded "+this.It+" logs per "+this.Et+"ms"),this.xt=!0),!1)}flush(){var t=this;return St((function*(){if(!t._instance.isDisabled)return t.yt||(t.yt=t.Ot().finally((()=>{t.yt=null}))),t.yt}))()}Ot(){var t=this;return St((function*(){var e;t.Pt();var n=(e=t._instance.getPersistedProperty(zi.LogsQueue))!==null&&e!==void 0?e:[];if(n.length!==0)for(var r=n.length,s=0;n.length>0&&r>s;){var i,a;t.bt=0;var u=Math.min(n.length,t.Tt),c=n.slice(0,u),d=W6(c.map((p=>p.record)),t.Dt(),(i=t.ft)!==null&&i!==void 0?i:t._instance.getLibraryId(),t._instance.getLibraryVersion()),h=yield t._instance.$t(d);if(h.kind==="too-large"&&c.length>1)t.Tt=Math.max(1,Math.floor(c.length/2)),t.st.warn("Received 413 when sending logs batch of size "+c.length+", reducing batch size to "+t.Tt);else if(h.kind==="retry-later"||(h.kind==="too-large"?t.st.warn("Dropping a single log record after 413 with batch size 1 — the record is larger than the server cap and cannot be split further."):h.kind==="ok"&&t.qe.maxBatchRecordsPerPost>t.Tt&&(t.Tt=Math.min(t.qe.maxBatchRecordsPerPost,t.Tt+1)),yield t.Nt(c.length),n=(a=t._instance.getPersistedProperty(zi.LogsQueue))!==null&&a!==void 0?a:[],s+=c.length,h.kind==="fatal"))throw h.error}}))()}Nt(t){var e=this;return St((function*(){var n,r=Math.max(0,t-e.bt),s=(n=e._instance.getPersistedProperty(zi.LogsQueue))!==null&&n!==void 0?n:[];e._instance.setPersistedProperty(zi.LogsQueue,s.slice(r)),yield e.ct()}))()}Dt(){return B6(this.qe,this._instance.getLibraryId(),this._instance.getLibraryVersion())}Lt(t){var e;if(!this._instance.optedOut){var n=(e=this._instance.getPersistedProperty(zi.LogsQueue))!==null&&e!==void 0?e:[];this.Ct>n.length||(n.shift(),this.bt++,this.st.info("Logs queue is full, dropping oldest record.")),n.push(t),this._instance.setPersistedProperty(zi.LogsQueue,n),this.St>n.length?this.qt():this.Rt()}}qt(t){t===void 0&&(t=this.Mt),this.jt||(this.jt=T2((()=>{this.jt=void 0,this.Rt()}),t))}Bt(){var t=Math.min(Math.max(0,this._t-1),6);return this.Mt*Math.pow(2,t)}Ht(){var t=this._instance.getPersistedProperty(zi.LogsQueue);return!!t&&t.length>0}shutdown(t){var e=this;return St((function*(){e.Pt();var n=e.flush().catch((()=>{}));t!==void 0?yield RE(n,t):yield n}))()}flushWithTimeout(t){var e=this;return St((function*(){var n=e.flush();yield RE(n,t,(()=>{n.catch((()=>{}))}))}))()}Rt(){this.flush().then((()=>{this._t=0}),(t=>{this._t++,this.st.error("PostHog logs flush failed:",t)})).finally((()=>{!this._instance.isDisabled&&this.Ht()&&this.qt(this.Bt())}))}Pt(){this.jt&&(clearTimeout(this.jt),this.jt=void 0)}};var Sv=[0,5,10,25,50,75,100,250,500,750,1e3,2500,5e3,7500,1e4];function AE(t){return String(t)+"000000"}function IE(t,e,n,r){var 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}let rD=class{constructor(t,e,n){this._instance=t,this.qe=e,this.st=n,this.Ut=new Map,this.yt=null,this.zt=!1,this.Wt=new Map,this.Vt=new Set,this.Zt=0}count(t,e,n){e===void 0&&(e=1),this.Gt({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.Gt({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.Gt({name:t,type:"histogram",value:e,unit:n==null?void 0:n.unit,attributes:n==null?void 0:n.attributes})}flush(){var t=this,e=this.yt,n=(function(){var s=St((function*(){e&&(yield e.catch((()=>{}))),yield t.Qt()}));return function(){return s.apply(this,arguments)}})(),r=n().finally((()=>{this.yt===r&&(this.yt=null)}));return this.yt=r,r}drainWindow(){if(this.Ut.size===0)return null;var t=this.Ut;return this.Ut=new Map,this.zt=!1,this.Wt=new Map,this.Vt=new Set,this.Kt(t)}reset(){this.Zt++,this.Pt(),this.Ut=new Map,this.yt=null,this.zt=!1,this.Wt=new Map,this.Vt=new Set}Gt(t){if(!this._instance.isDisabled&&!this._instance.optedOut){var e=this.At(t);if(e!==null)if(e.name&&typeof e.name=="string")if(typeof e.value=="number"&&Number.isFinite(e.value))if(e.type==="count"&&0>e.value)this.st.warn("Dropping count '"+e.name+"': counters are monotonic, value must be >= 0");else{var n,r;try{n=e.attributes?ue({},e.attributes):void 0,r=IE(e.type,e.name,e.unit,n)}catch(a){return void this.st.warn("Dropping metric '"+e.name+"': attributes could not be serialized",a)}var s=this.Ut.get(r);if(!s){if(!this.Jt())return;s={name:e.name,type:e.type,unit:e.unit,attributes:n,windowStartMs:Date.now()},this.Ut.set(r,s)}var i=this.Wt.get(e.name);i===void 0?this.Wt.set(e.name,e.type):i===e.type||this.Vt.has(e.name)||(this.Vt.add(e.name),this.st.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.Yt(s,e.value),this.qt()}else this.st.warn("Dropping metric '"+e.name+"': value must be a finite number");else this.st.warn("Dropping metric with empty name")}}Jt(){return this.qe.maxSeriesPerFlush>this.Ut.size||(this.zt||(this.zt=!0,this.st.warn("Metric series cap reached ("+this.qe.maxSeriesPerFlush+" per flush window); dropping new series until the next flush. Reduce attribute cardinality.")),!1)}Yt(t,e){var n;switch(t.type){case"count":t.total=((n=t.total)!==null&&n!==void 0?n:0)+e;break;case"gauge":t.last=e;break;case"histogram":t.hist||(t.hist={count:0,sum:0,min:e,max:e,bucketCounts:new Array(Sv.length+1).fill(0)});var 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(var a=0;i.length>a;a++)if(i[a]>=s)return a;return i.length})(e,Sv)]+=1}}At(t){var e=this.qe.beforeSend;if(!e)return t;var n=Ze(e)?e:[e],r=t;for(var s of n)try{var i=s(r);if(!i)return this.st.info("Metric was rejected in beforeSend function"),null;r=i}catch(a){return this.st.error("Error in beforeSend function for metric:",a),null}return r}qt(){this.jt||(this.jt=T2((()=>{this.jt=void 0,this.flush().catch((t=>{this.st.error("Metrics flush failed:",t)}))}),this.qe.flushIntervalMs))}Pt(){this.jt&&(clearTimeout(this.jt),this.jt=void 0)}Qt(){var t=this;return St((function*(){if(t.Ut.size!==0){var e=t.Ut;t.Ut=new Map,t.zt=!1,t.Wt=new Map,t.Vt=new Set;var n=t.Zt,r=yield t._instance.Xt(t.Kt(e));if(n===t.Zt)switch(r.kind){case"ok":return;case"retry-later":return t.ti(e),void t.qt();case"too-large":return void t.st.warn("Metrics batch exceeded the server size limit and was dropped");case"fatal":return void t.st.error("Failed to send metrics batch:",r.error)}}}))()}Kt(t){return e=this.ei(t),n=(function(i,a,u){return ue({},i.resourceAttributes,{"service.name":i.serviceName||"unknown_service"},i.environment&&{"deployment.environment":i.environment},i.serviceVersion&&{"service.version":i.serviceVersion},{"telemetry.sdk.name":a,"telemetry.sdk.version":u})})(this.qe,this._instance.getLibraryId(),this._instance.getLibraryVersion()),r=this._instance.getLibraryId(),s=this._instance.getLibraryVersion(),{resourceMetrics:[{resource:{attributes:dm(n)},scopeMetrics:[{scope:{name:r,version:s},metrics:e}]}]};var e,n,r,s}ei(t){var e=AE(Date.now()),n=new Map;for(var r of t.values()){var s,i=IE(r.type,r.name,r.unit,void 0),a=n.get(i);a||(a=ue({name:r.name},r.unit&&{unit:r.unit}),r.type==="count"?a.sum={aggregationTemporality:1,isMonotonic:!0,dataPoints:[]}:r.type==="gauge"?a.gauge={dataPoints:[]}:a.histogram={aggregationTemporality:1,dataPoints:[]},n.set(i,a));var u=dm((s=r.attributes)!==null&&s!==void 0?s:{}),c=AE(r.windowStartMs);if(r.type==="count"){var d,h={attributes:u,startTimeUnixNano:c,timeUnixNano:e,asDouble:(d=r.total)!==null&&d!==void 0?d:0};a.sum.dataPoints.push(h)}else if(r.type==="gauge"){var p,m={attributes:u,timeUnixNano:e,asDouble:(p=r.last)!==null&&p!==void 0?p:0};a.gauge.dataPoints.push(m)}else r.hist&&a.histogram.dataPoints.push({attributes:u,startTimeUnixNano:c,timeUnixNano:e,count:r.hist.count,sum:r.hist.sum,min:r.hist.min,max:r.hist.max,bucketCounts:r.hist.bucketCounts,explicitBounds:Sv})}return Array.from(n.values())}ti(t){var e,n;for(var r of t){var s=r[0],i=r[1],a=this.Ut.get(s);if(a)switch(a.windowStartMs=Math.min(a.windowStartMs,i.windowStartMs),a.type){case"count":a.total=((e=a.total)!==null&&e!==void 0?e:0)+((n=i.total)!==null&&n!==void 0?n:0);break;case"gauge":break;case"histogram":if(i.hist)if(a.hist){a.hist.count+=i.hist.count,a.hist.sum+=i.hist.sum,a.hist.min=Math.min(a.hist.min,i.hist.min),a.hist.max=Math.max(a.hist.max,i.hist.max);for(var u=0;a.hist.bucketCounts.length>u;u++)a.hist.bucketCounts[u]+=i.hist.bucketCounts[u]}else a.hist=i.hist}else this.Jt()&&this.Ut.set(s,i)}}};var Zh,ME,Ev;function sD(t){var e=globalThis._posthogChunkIds;if(e){var n=Object.keys(e);return Ev&&n.length===ME||(ME=n.length,Ev=n.reduce(((r,s)=>{Zh||(Zh={});var i=Zh[s];if(i)r[i[0]]=i[1];else for(var a=t(s),u=a.length-1;u>=0;u--){var c=a[u],d=c==null?void 0:c.filename,h=e[s];if(d&&h){r[d]=h,Zh[s]=[d,h];break}}return r}),{})),Ev}}class iD{constructor(e,n,r){r===void 0&&(r=[]),this.coercers=e,this.stackParser=n,this.modifiers=r}buildFromUnknown(e,n){n===void 0&&(n={});var r=n&&n.mechanism||{handled:!0,type:"generic"},s=this.buildCoercingContext(r,n,0).apply(e),i=this.buildParsingContext(n),a=this.parseStacktrace(s,i);return{$exception_list:this.convertToExceptionList(a,r),$exception_level:"error"}}modifyFrames(e){var n=this;return St((function*(){for(var r of e)r.stacktrace&&r.stacktrace.frames&&Ze(r.stacktrace.frames)&&(r.stacktrace.frames=yield n.applyModifiers(r.stacktrace.frames));return e}))()}coerceFallback(e){var n;return{type:"Error",value:"Unknown error",stack:(n=e.syntheticException)==null?void 0:n.stack,synthetic:!0}}parseStacktrace(e,n){var r,s;return e.cause!=null&&(r=this.parseStacktrace(e.cause,n)),e.stack!=""&&e.stack!=null&&(s=this.applyChunkIds(this.stackParser(e.stack,e.synthetic?n.skipFirstLines:0),n.chunkIdMap)),ue({},e,{cause:r,stack:s})}applyChunkIds(e,n){return e.map((r=>(r.filename&&n&&(r.chunk_id=n[r.filename]),r)))}applyCoercers(e,n){for(var r of this.coercers)if(r.match(e))return r.coerce(e,n);return this.coerceFallback(n)}applyModifiers(e){var n=this;return St((function*(){var r=e;for(var s of n.modifiers)r=yield s(r);return r}))()}convertToExceptionList(e,n){var r,s,i,a={type:e.type,value:e.value,mechanism:{type:(r=n.type)!==null&&r!==void 0?r:"generic",handled:(s=n.handled)===null||s===void 0||s,synthetic:(i=e.synthetic)!==null&&i!==void 0&&i}};e.stack&&(a.stacktrace={type:"raw",frames:e.stack});var u=[a];return e.cause!=null&&u.push(...this.convertToExceptionList(e.cause,ue({},n,{handled:!0}))),u}buildParsingContext(e){var n;return{chunkIdMap:sD(this.stackParser),skipFirstLines:(n=e.skipFirstLines)!==null&&n!==void 0?n:1}}buildCoercingContext(e,n,r){r===void 0&&(r=0);var s=(i,a)=>{if(4>=a){var u=this.buildCoercingContext(e,n,a);return this.applyCoercers(i,u)}};return ue({},n,{syntheticException:r==0?n.syntheticException:void 0,mechanism:e,apply:i=>s(i,r),next:i=>s(i,r+1)})}}var ec="?";function xy(t,e,n,r,s){var i={platform:t,filename:e,function:n==="<anonymous>"?ec:n,in_app:!0};return he(r)||(i.lineno=r),he(s)||(i.colno=s),i}var q6=(t,e)=>{var n=t.indexOf("safari-extension")!==-1,r=t.indexOf("safari-web-extension")!==-1;return n||r?[t.indexOf("@")!==-1?t.split("@")[0]:ec,n?"safari-extension:"+e:"safari-web-extension:"+e]:[t,e]},oD=/^\s*at (\S+?)(?::(\d+))(?::(\d+))\s*$/i,aD=/^\s*at (?:(.+?\)(?: \[.+\])?|.*?) ?\((?:address at )?)?(?:async )?((?:<anonymous>|[-a-z]+:|.*bundle|\/)?.*?)(?::(\d+))?(?::(\d+))?\)?\s*$/i,lD=/\((\S*)(?::(\d+))(?::(\d+))\)/,uD=(t,e)=>{var n=oD.exec(t);if(n)return xy(e,n[1],ec,+n[2],+n[3]);var r=aD.exec(t);if(r){if(r[2]&&r[2].indexOf("eval")===0){var s=lD.exec(r[2]);s&&(r[2]=s[1],r[3]=s[2],r[4]=s[3])}var i=q6(r[1]||ec,r[2]);return xy(e,i[1],i[0],r[3]?+r[3]:void 0,r[4]?+r[4]:void 0)}},cD=/^\s*(.*?)(?:\((.*?)\))?(?:^|@)?((?:[-a-z]+)?:\/.*?|\[native code\]|[^@]*(?:bundle|\d+\.js)|\/[\w\-. /=]+)(?::(\d+))?(?::(\d+))?\s*$/i,dD=/(\S+) line (\d+)(?: > eval line \d+)* > eval/i,fD=(t,e)=>{var n=cD.exec(t);if(n){if(n[3]&&n[3].indexOf(" > eval")>-1){var r=dD.exec(n[3]);r&&(n[1]=n[1]||"eval",n[3]=r[1],n[4]=r[2],n[5]="")}var s=n[3],i=n[1]||ec,a=q6(i,s);return xy(e,s=a[1],i=a[0],n[4]?+n[4]:void 0,n[5]?+n[5]:void 0)}},OE=/\(error: (.*)\)/;class hD{match(e){return this.isDOMException(e)||this.isDOMError(e)}coerce(e,n){var r=ht(e.stack);return{type:this.getType(e),value:this.getValue(e),stack:r?e.stack:void 0,cause:e.cause?n.next(e.cause):void 0,synthetic:!1}}getType(e){return this.isDOMError(e)?"DOMError":"DOMException"}getValue(e){var n=e.name||(this.isDOMError(e)?"DOMError":"DOMException");return e.message?n+": "+e.message:n}isDOMException(e){return om(e,"DOMException")}isDOMError(e){return om(e,"DOMError")}}class pD{match(e){return(function(n){switch({}.toString.call(n)){case"[object Error]":case"[object Exception]":case"[object DOMException]":case"[object DOMError]":case"[object WebAssembly.Exception]":return!0;default:return w6(n,Error)}})(e)}coerce(e,n){return{type:this.getType(e),value:this.getMessage(e,n),stack:this.getStack(e),cause:e.cause?n.next(e.cause):void 0,synthetic:!1}}getType(e){return e.name||e.constructor.name}getMessage(e,n){var r=e.message;return String(r.error&&typeof r.error.message=="string"?r.error.message:r)}getStack(e){return e.stacktrace||e.stack||void 0}}class mD{constructor(){}match(e){return!!om(e,"ErrorEvent")&&(e.error!=null||this.fe(e))}coerce(e,n){var r;if(e.error!=null)return n.apply(e.error);var s=n.apply(e.message);return ue({},s,{stack:(r=this.pe(e))!==null&&r!==void 0?r:s.stack,synthetic:!0})}fe(e){return ht(e.message)&&e.message.length>0}pe(e){var n=e;if(ht(n.filename)&&n.filename.length>0){var r,s,i=(r=n.lineno)!==null&&r!==void 0?r:0,a=(s=n.colno)!==null&&s!==void 0?s:0;return`Error
18
- at `+n.filename+":"+i+":"+a}}}var gD=/^(?:[Uu]ncaught (?:exception: )?)?(?:((?:Eval|Internal|Range|Reference|Syntax|Type|URI|)Error): )?(.*)$/i;class vD{match(e){return typeof e=="string"}coerce(e,n){var r,s=this.getInfos(e),i=s[0],a=s[1];return{type:i??"Error",value:a??e,stack:(r=n.syntheticException)==null?void 0:r.stack,synthetic:!0}}getInfos(e){var n="Error",r=e,s=e.match(gD);return s&&(n=s[1],r=s[2]),[n,r]}}var yD=["fatal","error","warning","log","info","debug"];function G6(t,e){e===void 0&&(e=40);var n=Object.keys(t);if(n.sort(),!n.length)return"[object has no keys]";for(var r=n.length;r>0;r--){var s=n.slice(0,r).join(", ");if(e>=s.length)return r===n.length?s:s.length>e?s.slice(0,e)+"...":s}return""}class _D{match(e){return typeof e=="object"&&e!==null}coerce(e,n){var r,s,i=this.getErrorPropertyFromObject(e);return i?n.apply(i):{type:this.getType(e),value:this.getValue(e),stack:(r=this.getStack(e))!==null&&r!==void 0?r:(s=n.syntheticException)==null?void 0:s.stack,level:this.isSeverityLevel(e.level)?e.level:"error",synthetic:!0}}getType(e){return S2(e)?e.constructor.name:"Error"}getValue(e){if("name"in e&&typeof e.name=="string"){var n="'"+e.name+"' captured as exception";return"message"in e&&typeof e.message=="string"&&(n+=" with message: '"+e.message+"'"),n}if("message"in e&&typeof e.message=="string")return e.message;var r=this.getObjectClassName(e);return(r&&r!=="Object"?"'"+r+"'":"Object")+" captured as exception with keys: "+G6(e)}isSeverityLevel(e){return ht(e)&&!gy(e)&&yD.indexOf(e)>=0}getStack(e){try{return ht(e.stacktrace)&&e.stacktrace.length>0?e.stacktrace:ht(e.stack)&&e.stack.length>0?e.stack:void 0}catch{return}}getErrorPropertyFromObject(e){for(var n in e)if({}.hasOwnProperty.call(e,n)){var r=e[n];if(JL(r))return r}}getObjectClassName(e){try{var n=Object.getPrototypeOf(e);return n?n.constructor.name:void 0}catch{return}}}class wD{match(e){return S2(e)}coerce(e,n){var r,s=e.constructor.name;return{type:s,value:s+" captured as exception with keys: "+G6(e),stack:(r=n.syntheticException)==null?void 0:r.stack,synthetic:!0}}}class xD{match(e){return _6(e)}coerce(e,n){var r;return{type:"Error",value:"Primitive value captured as exception: "+String(e),stack:(r=n.syntheticException)==null?void 0:r.stack,synthetic:!0}}}class bD{match(e){return om(e,"PromiseRejectionEvent")||this.isCustomEventWrappingRejection(e)}isCustomEventWrappingRejection(e){if(!S2(e))return!1;try{var n=e.detail;return n!=null&&typeof n=="object"&&"reason"in n}catch{return!1}}coerce(e,n){var r,s=this.getUnhandledRejectionReason(e);return _6(s)?{type:"UnhandledRejection",value:"Non-Error promise rejection captured with value: "+String(s),stack:(r=n.syntheticException)==null?void 0:r.stack,synthetic:!0}:n.apply(s)}getUnhandledRejectionReason(e){try{if("reason"in e)return e.reason;if("detail"in e&&e.detail!=null&&typeof e.detail=="object"&&"reason"in e.detail)return e.detail.reason}catch{}return e}}var fm="$message",hm="$timestamp",SD=new Set([fm,hm]),Cv={enabled:!0,max_bytes:32768};function pm(t){var e;return t?{enabled:(e=t.enabled)!==null&&e!==void 0?e:Cv.enabled,max_bytes:CD(t.max_bytes,Cv.max_bytes)}:ue({},Cv)}class ED{constructor(e){this.ii=[],this.ri=0,this.qe=pm(e)}setConfig(e){this.qe=pm(e),this.ni()}add(e){var n=(function(s){var i;try{i=g6(s)}catch{return}try{var a=JSON.parse(i);if(!It(a))return;var u=a,c=u[fm],d=u[hm];return!ht(c)||c.trim().length===0||!ht(d)&&!sn(d)?void 0:{step:u,json:i}}catch{return}})(e);if(n){var r=(function(s){if(typeof TextEncoder<"u")return new TextEncoder().encode(s).length;for(var i=encodeURIComponent(s),a=0,u=0;i.length>u;u++)i[u]==="%"?(a+=1,u+=2):a+=1;return a})(n.json);r>this.qe.max_bytes||(this.ii.push({step:n.step,bytes:r}),this.ri+=r,this.ni())}}getAttachable(){return this.ii.map((e=>e.step))}clear(){this.ii=[],this.ri=0}size(){return this.ii.length}ni(){for(;this.ri>this.qe.max_bytes&&this.ii.length>0;){var e=this.ii.shift();e&&(this.ri-=e.bytes)}}}function CD(t,e){if(!sn(t)||t===1/0||t===-1/0)return e;var n=Math.floor(t);return 0>n?e:n}var K6=function(t,e){var n=(e===void 0?{}:e).debugEnabled,r={k(s){if(ne&&(xt.DEBUG||ne.POSTHOG_DEBUG||n)&&!he(ne.console)&&ne.console){for(var i=("__rrweb_original__"in ne.console[s])?ne.console[s].__rrweb_original__:ne.console[s],a=arguments.length,u=new Array(a>1?a-1:0),c=1;a>c;c++)u[c-1]=arguments[c];i(t,...u)}},debug(){for(var s=arguments.length,i=new Array(s),a=0;s>a;a++)i[a]=arguments[a];r.k("debug",...i)},info(){for(var s=arguments.length,i=new Array(s),a=0;s>a;a++)i[a]=arguments[a];r.k("log",...i)},warn(){for(var s=arguments.length,i=new Array(s),a=0;s>a;a++)i[a]=arguments[a];r.k("warn",...i)},error(){for(var s=arguments.length,i=new Array(s),a=0;s>a;a++)i[a]=arguments[a];r.k("error",...i)},critical(){for(var s=arguments.length,i=new Array(s),a=0;s>a;a++)i[a]=arguments[a];console.error(t,...i)},uninitializedWarning(s){r.error("You must initialize PostHog before calling "+s)},createLogger:(s,i)=>K6(t+" "+s,i)};return r},ve=K6("[PostHog.js]"),Mt=ve.createLogger,kD=Mt("[ExternalScriptsLoader]"),mm=t=>{var e=_e==null?void 0:_e.querySelectorAll("script");if(e){for(var n=0;e.length>n;n++)if(e[n].src===t)return e[n]}},Qa=(t,e,n)=>{if(t.config.disable_external_dependency_loading)return kD.warn(e+" was requested but loading of external scripts is disabled."),n("Loading of external scripts is disabled");var r=mm(e);if(r){if(r.__posthog_loading_callback_fired)return n();var s=r.__posthog_loading_error;return s?n(s):(r.addEventListener("load",(a=>{r.__posthog_loading_callback_fired=!0,n(void 0,a)})),void r.addEventListener("error",(a=>{r.__posthog_loading_error=a,n(a)})))}var i=()=>{if(!_e)return n("document not found");if(mm(e))return Qa(t,e,n);var a=_e.createElement("script");if(a.type="text/javascript",a.crossOrigin="anonymous",a.src=e,a.onload=d=>{a.__posthog_loading_callback_fired=!0,n(void 0,d)},a.onerror=d=>{a.__posthog_loading_error=d,n(d)},t.config.prepare_external_dependency_script&&(a=t.config.prepare_external_dependency_script(a)),!a)return n("prepare_external_dependency_script returned null");if(t.config.external_scripts_inject_target==="head")_e.head.appendChild(a);else{var u,c=_e.querySelectorAll("body > script");c.length>0?(u=c[0].parentNode)==null||u.insertBefore(a,c[0]):_e.body.appendChild(a)}};_e!=null&&_e.body?i():_e==null||_e.addEventListener("DOMContentLoaded",i)},kv={},LE=(t,e)=>{var n="/static/"+e+".js?v="+t.version;if(e==="toolbar"){var r=3e5;n=n+"&t="+Math.floor(Date.now()/r)*r}return t.requestRouter.endpointFor("assets",n)};Fe.__PosthogExtensions__=Fe.__PosthogExtensions__||{},Fe.__PosthogExtensions__.loadExternalDependency=(t,e,n)=>{if(e!=="remote-config"){var r=t.config.strict_script_versioning;if(r){var s=t.requestRouter.endpointFor("assets","/static/"+t.version+"/"+e+".js"),i=kv[s];if(r==="fallback"&&i){if(mm(i))return void Qa(t,i,n);delete kv[s]}Qa(t,s,r==="fallback"?(u,c)=>{if(u)if(typeof u=="string")n(u);else{var d,h=LE(t,e);kv[s]=h;var p=mm(s);p==null||(d=p.parentNode)==null||d.removeChild(p),Qa(t,h,n)}else n(void 0,c)}:n)}else Qa(t,LE(t,e),n)}else{var a=t.requestRouter.endpointFor("assets","/array/"+t.config.token+"/config.js");Qa(t,a,n)}},Fe.__PosthogExtensions__.loadSiteApp=(t,e,n)=>{var r=t.requestRouter.endpointFor("api",e);Qa(t,r,n)};xt.DEBUG=!1,xt.LIB_VERSION="1.417.1",xt.LIB_NAME="web";var Z6="$people_distinct_id",Bd="$device_id",Pv="$device_model",md="__alias",gd="__timers",by="$autocapture_disabled_server_side",Sy="$heatmaps_enabled_server_side",Ey="$exception_capture_enabled_server_side",Cy="$error_tracking_suppression_rules",ky="$error_tracking_capture_extension_exceptions",Py="$web_vitals_enabled_server_side",R2="$dead_clicks_enabled_server_side",A2="$product_tours_enabled_server_side",Ty="$web_vitals_allowed_metrics",al="$session_recording_remote_config",Y6="$replay_sample_rate",X6="$replay_override_sampling",Q6="$replay_override_linked_flag",J6="$replay_override_url_trigger",eP="$replay_override_event_trigger",xu="$sesid",I2="$session_is_sampled",Ja="$enabled_feature_flags",vd="$active_feature_flags",Rp="$early_access_features",Ry="$feature_flag_details",yd="$feature_flag_payloads",Ap="$feature_flag_request_id",gm="$minimal_flag_called_events",ni="$override_feature_flags",el="$override_feature_flag_payloads",Vi="$stored_person_properties",tl="$stored_group_properties",Ay="$surveys",vm="$surveys_loaded_at",Iy="$surveys_activated",Ip="$surveys_activated_session",Mp="$surveys_activated_timestamps",_d="ph_product_tours",il="$flag_call_reported",wd="$flag_call_reported_session_id",Op="$feature_flag_errors",kd="$feature_flag_evaluated_at",zr="$user_state",My="$client_session_props",Oy="$capture_rate_limit",Ly="$initial_campaign_params",Dy="$initial_referrer_info",ym="$initial_person_info",_m="$epp",Yh="$posthog_cookieless",tP="$cookieless_mode",nP="$sdk_debug_extensions_init_method",rP="$sdk_debug_extensions_init_time_ms",sP="$sdk_debug_recording_script_not_loaded",M2="PostHog loadExternalDependency extension not found.",nl="on_reject",Zi="always",Fa="anonymous",Fo="identified",Ny="identified_only",wm="visibilitychange",xm="beforeunload",vu="$pageview",Tv="$pageleave",Rv="$identify",DE="$groupidentify";function Xh(t,e){Ze(t)&&t.forEach(e)}function bt(t,e){if(!Qe(t))if(Ze(t))t.forEach(e);else if(jL(t))t.forEach(((r,s)=>e(r,s)));else for(var n in t)y6.call(t,n)&&e(t[n],n)}var At=function(t){for(var e=arguments.length,n=new Array(e>1?e-1:0),r=1;e>r;r++)n[r-1]=arguments[r];for(var s of n)for(var i in s)s[i]!==void 0&&(t[i]=s[i]);return t};function Lp(t){for(var e=Object.keys(t),n=e.length,r=new Array(n);n--;)r[n]=[e[n],t[e[n]]];return r}var NE=function(t){try{return t()}catch{return}},PD=function(t){return function(){try{for(var e=arguments.length,n=new Array(e),r=0;e>r;r++)n[r]=arguments[r];return t.apply(this,n)}catch(s){ve.critical("Implementation error. Please turn on debug mode and open a ticket on https://app.posthog.com/home#panel=support%3Asupport%3A."),ve.critical(s)}}},O2=function(t){var e={};return bt(t,(function(n,r){(ht(n)&&n.length>0||sn(n))&&(e[r]=n)})),e},TD=["herokuapp.com","vercel.app","netlify.app"];function RD(t){var e=t==null?void 0:t.hostname;if(!ht(e))return!1;var n=e.split(".").slice(-2).join(".");for(var r of TD)if(n===r)return!1;return!0}function jt(t,e,n,r){var s=r??{},i=s.capture,a=s.passive;t==null||t.addEventListener(e,n,{capture:i!==void 0&&i,passive:a===void 0||a})}function jy(t){return t.name==="ph_toolbar_internal"}var iP=t=>{if(_e){try{for(var e=t+"=",n=_e.cookie.split(";").filter((i=>i.length)),r=0;n.length>r;r++){for(var s=n[r];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 sn(t)&&isFinite(t)&&Math.floor(t)===t});class bm{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");var 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 bm(i)}toString(){for(var e="",n=0;this.bytes.length>n;n++)e=e+(this.bytes[n]>>>4).toString(16)+(15&this.bytes[n]).toString(16),n!==3&&n!==5&&n!==7&&n!==9||(e+="-");if(e.length!==36)throw new Error("Invalid UUIDv7 was generated");return e}clone(){return new bm(this.bytes.slice(0))}equals(e){return this.compareTo(e)===0}compareTo(e){for(var n=0;16>n;n++){var r=this.bytes[n]-e.bytes[n];if(r!==0)return Math.sign(r)}return 0}}class AD{generate(){var e=this.generateOrAbort();if(!he(e))return e;this.S=0;var n=this.generateOrAbort();if(he(n))throw new Error("Could not generate UUID after timestamp reset");return n}generateOrAbort(){var e=Date.now();if(e>this.S)this.S=e,this.C();else{if(this.S>=e+1e4)return;this.I++,this.I>4398046511103&&(this.S++,this.C())}return bm.fromFieldsV7(this.S,Math.trunc(this.I/Math.pow(2,30)),this.I&Math.pow(2,30)-1,this.A.nextUint32())}C(){this.I=1024*this.A.nextUint32()+(1023&this.A.nextUint32())}constructor(){this.S=0,this.I=0,this.A=new ID}}var jE,oP=t=>{if(typeof UUIDV7_DENY_WEAK_RNG<"u"&&UUIDV7_DENY_WEAK_RNG)throw new Error("no cryptographically strong RNG available");for(var e=0;t.length>e;e++)t[e]=65536*Math.trunc(65536*Math.random())+Math.trunc(65536*Math.random());return t};ne&&!he(ne.crypto)&&crypto.getRandomValues&&(oP=t=>crypto.getRandomValues(t));class ID{nextUint32(){return this.R.length>this.O||(oP(this.R),this.O=0),this.R[this.O++]}constructor(){this.R=new Uint32Array(8),this.O=1/0}}var Wi=()=>MD().toString(),MD=()=>(jE||(jE=new AD)).generate(),td="",OD=/[a-z0-9][a-z0-9-]+\.[a-z]{2,}$/i,Yi={N:()=>!!_e,j(t){ve.error("cookieStore error: "+t)},P:iP,H(t){var e;try{e=JSON.parse(Yi.P(t))||{}}catch{}return e},F(t,e,n,r,s){if(!_e)return!1;try{var i="",a="",u=(function(h,p){if(p){var m=(function(w,y){if(y===void 0&&(y=_e),td)return td;if(!y||["localhost","127.0.0.1"].includes(w))return"";for(var x=w.split("."),S=Math.min(x.length,8),P="dmn_chk_"+Wi();!td&&S--;){var T=x.slice(S).join("."),k=P+"=1;domain=."+T+";path=/";y.cookie=k+";max-age=3",y.cookie.includes(P)&&(y.cookie=k+";max-age=0",td=T)}return td})(h);if(!m){var _=(w=>{var y=w.match(OD);return y?y[0]:""})(h);_!==m&&ve.info("Warning: cookie subdomain discovery mismatch",_,m),m=_}return m?"; domain=."+m:""}return""})(_e.location.hostname,r);if(n){var c=new Date;c.setTime(c.getTime()+864e5*n),i="; expires="+c.toUTCString()}s&&(a="; secure");var d=t+"="+encodeURIComponent(JSON.stringify(e))+i+"; SameSite=Lax; path=/"+u+a;return d.length>3686.4&&ve.warn("cookieStore warning: large cookie, len="+d.length),_e.cookie=d,!0}catch{return!1}},q(t,e){if(_e!=null&&_e.cookie)try{Yi.F(t,"",-1,e)}catch{return}}},Av=null,Ct={N(){if(!Tr(Av))return Av;var t=!0;if(he(ne))t=!1;else try{var e="__mplssupport__";Ct.F(e,"xyz"),Ct.P(e)!=='"xyz"'&&(t=!1),Ct.q(e)}catch{t=!1}return t||ve.error("localStorage unsupported; falling back to cookie store"),Av=t,t},j(t){ve.error("localStorage error: "+t)},P(t){try{return ne==null?void 0:ne.localStorage.getItem(t)}catch(e){Ct.j(e)}return null},H(t){try{return JSON.parse(Ct.P(t))||{}}catch{}return null},F(t,e){try{return ne==null||ne.localStorage.setItem(t,JSON.stringify(e)),!0}catch(n){Ct.j(n)}return!1},q(t){try{ne==null||ne.localStorage.removeItem(t)}catch(e){Ct.j(e)}}},LD=[Bd,"distinct_id",xu,I2,_m,ym,zr],Qh={},DD={N:()=>!0,j(t){ve.error("memoryStorage error: "+t)},P:t=>Qh[t]||null,H:t=>Qh[t]||null,F:(t,e)=>(Qh[t]=e,!0),q(t){delete Qh[t]}},$a=null,Ut={N(){if(!Tr($a))return $a;if($a=!0,he(ne))$a=!1;else try{var t="__support__";Ut.F(t,"xyz"),Ut.P(t)!=='"xyz"'&&($a=!1),Ut.q(t)}catch{$a=!1}return $a},j(t){ve.error("sessionStorage error: ",t)},P(t){try{return ne==null?void 0:ne.sessionStorage.getItem(t)}catch(e){Ut.j(e)}return null},H(t){try{return JSON.parse(Ut.P(t))||null}catch{}return null},F(t,e){try{return ne==null||ne.sessionStorage.setItem(t,JSON.stringify(e)),!0}catch(n){Ut.j(n)}return!1},q(t){try{ne==null||ne.sessionStorage.removeItem(t)}catch(e){Ut.j(e)}}};class ND{constructor(e){this._instance=e}get qe(){return this._instance.config}get consent(){return this.si()?0:this.ai}isOptedOut(){return this.qe.cookieless_mode===Zi||this.isRejected()||this.consent===-1&&this.qe.cookieless_mode===nl}isOptedIn(){return!this.isOptedOut()}isExplicitlyOptedOut(){return this.consent===0}isRejected(){return this.consent===0||this.consent===-1&&this.qe.opt_out_capturing_by_default}optInOut(e){this.oi.F(this.li,e?1:0,this.qe.cookie_expiration,this.qe.cross_subdomain_cookie,this.qe.secure_cookie)}reset(){this.oi.q(this.li,this.qe.cross_subdomain_cookie)}get li(){var e=this._instance.config,n=e.token,r=e.opt_out_capturing_cookie_prefix;return e.consent_persistence_name||(r?r+n:"__ph_opt_in_out_"+n)}get ai(){var e=this.oi.P(this.li);return xv(e)?1:Ke(HL,e)?0:-1}get oi(){var e=this.qe.opt_out_capturing_persistence_type,n=e==="localStorage"?Ct:Yi;if(!this.ui||this.ui!==n){this.ui=n;var r=e==="localStorage"?Yi:Ct;r.P(this.li)&&(this.ui.P(this.li)||this.optInOut(xv(r.P(this.li))),r.q(this.li,this.qe.cross_subdomain_cookie))}return this.ui}si(){return!!this.qe.respect_dnt&&[ar==null?void 0:ar.doNotTrack,ar==null?void 0:ar.msDoNotTrack,Fe.doNotTrack].some((e=>xv(e)))}}function aP(t,e){var n,r=t==null||(n=t.config)==null?void 0:n.get_current_url;if(!ir(r))return e;try{var s=r(e);return ht(s)&&s?s:e}catch(i){return ve.error("Error in get_current_url, falling back to window.location.href",i),e}}var lP="__POSTHOG_TOOLBAR__",jD=1,FD=3,$D=11;function FE(t){return t instanceof Element&&(t.id===lP||!(t.closest==null||!t.closest(".toolbar-global-fade-container")))}function aa(t){return!!t&&t.nodeType===jD}function Yr(t,e){return!!t&&!!t.tagName&&t.tagName.toLowerCase()===e.toLowerCase()}function uP(t){return!!t&&t.nodeType===FD}function cP(t){return!!t&&t.nodeType===$D&&aa(t.host)}var dP=1e3;function L2(t){return t?o0(t).split(/\s+/):[]}function $E(t,e){var n=(function(r){var s,i=ne==null||(s=ne.location)==null?void 0:s.href;return he(i)?void 0:aP(r,i)})(e);return!!(n&&t&&t.some((r=>n.match(r))))}function Sm(t){var e="";switch(typeof t.className){case"string":e=t.className;break;case"object":e=(t.className&&"baseVal"in t.className?t.className.baseVal:null)||t.getAttribute("class")||"";break;default:e=""}return L2(e)}function fP(t){return Qe(t)?null:o0(t).split(/(\s+)/).filter((e=>Pd(e))).join("").replace(/[\r\n]/g," ").replace(/[ ]+/g," ").substring(0,255)}function Wd(t){var e="";return $y(t)&&!gP(t)&&t.childNodes&&t.childNodes.length&&bt(t.childNodes,(function(n){var r;uP(n)&&n.textContent&&(e+=(r=fP(n.textContent))!==null&&r!==void 0?r:"")})),o0(e)}function Iv(t){var e;return he(t.target)?t.srcElement||null:(e=t.target)!=null&&e.shadowRoot?t.composedPath()[0]||null:t.target||null}var D2=["a","button","form","input","select","textarea","label"];function Fy(t,e){if(he(e))return!0;var n,r=function(i){if(e.some((a=>(function(u,c){var d=u.matches||u.matchesSelector||u.msMatchesSelector||u.mozMatchesSelector||u.webkitMatchesSelector||u.oMatchesSelector;try{return!!d&&d.call(u,c)}catch{return!1}})(i,a))))return{v:!0}};for(var s of t)if(n=r(s))return n.v;return!1}function hP(t){var e=t.parentNode;return!(!e||!aa(e))&&e}var VD=[".ph-no-autocapture","[data-ph-no-autocapture]"],pP=["next","previous","prev",">","<"],HD=[...pP,"+","-","−","–"],VE=(t,e)=>/[a-z0-9]/i.test(e)?t.includes(e):t===e,HE=[".ph-no-rageclick",".ph-no-capture"],zD=["","text","search","email","password","url","tel","number"];function zE(t,e){if(!ne||N2(t))return!1;var n,r,s,i,a;if(Kr(e)?(n=!!e&&HE,r=void 0,s=!1):(n=(i=e==null?void 0:e.css_selector_ignorelist)!==null&&i!==void 0?i:HE,r=e==null?void 0:e.content_ignorelist,s=(a=e==null?void 0:e.ignore_text_selection)!==null&&a!==void 0&&a),n===!1||s&&(function(c){return!(!c||!aa(c))&&(!!Yr(c,"textarea")||(Yr(c,"input")?Ke(zD,(c.getAttribute("type")||"").toLowerCase()):(function(d){if(d.isContentEditable)return!0;var h=d.getAttribute==null?void 0:d.getAttribute("contenteditable");return h==="true"||h===""})(c)))})(t))return!1;var u=mP(t,!1).targetElementList;return!(function(c,d){if(c===!1||he(c))return!1;var h;if(c===!0)h=pP;else{if(!Ze(c))return!1;if(c.length>10)return ve.error("[PostHog] content_ignorelist array cannot exceed 10 items. Use css_selector_ignorelist for more complex matching."),!1;h=c.map((p=>p.toLowerCase()))}return d.some((p=>{var m=p.safeText,_=p.ariaLabel;return h.some((w=>VE(m,w)||VE(_,w)))}))})(r,u.map((c=>{var d;return{safeText:Wd(c).toLowerCase(),ariaLabel:((d=c.getAttribute("aria-label"))==null?void 0:d.toLowerCase().trim())||""}})))&&!Fy(u,n)}var N2=t=>!t||Yr(t,"html")||!aa(t),mP=(t,e)=>{if(!ne||N2(t))return{parentIsUsefulElement:!1,targetElementList:[]};for(var n=!1,r=[t],s=t;s.parentNode&&!Yr(s,"body");)if(cP(s.parentNode))r.push(s.parentNode.host),s=s.parentNode.host;else{var i=hP(s);if(!i)break;if(e||D2.indexOf(i.tagName.toLowerCase())>-1)n=!0;else try{var a=ne.getComputedStyle(i);a&&a.getPropertyValue("cursor")==="pointer"&&(n=!0)}catch{}r.push(i),s=i}return{parentIsUsefulElement:n,targetElementList:r}};function $y(t){for(var e=new Set,n=0,r=t;r.parentNode&&!Yr(r,"body");r=r.parentNode){if(n++>=dP||e.has(r))return!1;e.add(r);var s=Sm(r);if(Ke(s,"ph-sensitive")||Ke(s,"ph-no-capture"))return!1}if(Ke(Sm(t),"ph-include"))return!0;var i=t.type||"";if(ht(i))switch(i.toLowerCase()){case"hidden":case"password":return!1}var a=t.name||t.id||"";return!ht(a)||!/^cc|cardnum|ccnum|creditcard|csc|cvc|cvv|exp|pass|pwd|routing|seccode|securitycode|securitynum|socialsec|socsec|ssn/i.test(a.replace(/[^a-zA-Z0-9]/g,""))}function gP(t){return!!(Yr(t,"input")&&!["button","checkbox","submit","reset"].includes(t.type)||Yr(t,"select")||Yr(t,"textarea")||t.getAttribute("contenteditable")==="true")}var UE=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}))$"),BE=/(^|[^0-9A-Za-z_])([0-9][0-9 -]*[0-9])(?=$|[^0-9A-Za-z_])/g,UD=[16,15,14,13],BD=new RegExp("^(\\d{3}-?\\d{2}-?\\d{4})$"),WE=new RegExp("(^|[^0-9])((?!000|666)[0-9]{3}-?(?!00)[0-9]{2}-?(?!0000)[0-9]{4})(?=$|([^0-9]))","g"),qE=/[0-9A-Za-z_]/;function WD(t){for(var e=0,n=!1,r=t.length-1;r>=0;r--){var s=t.charCodeAt(r)-48;n&&(s*=2)>9&&(s-=9),e+=s,n=!n}return e%10==0}function Pd(t,e){if(e===void 0&&(e=!0),Qe(t))return!1;if(ht(t)){t=o0(t);var n=e?UE.test((t||"").replace(/[- ]/g,"")):(function(s){var i;for(BE.lastIndex=0;i=BE.exec(s);){var a=i[2];if(a)for(var u=a.replace(/[- ]/g,""),c=0;u.length>c;c++)for(var d of UD){var h=c+d;if(u.length>=h){var p=u.slice(c,h);if(UE.test(p)&&WD(p))return!0}}}return!1})(t);if(n)return!1;var r=e?BD.test(t):(function(s){var i;for(WE.lastIndex=0;i=WE.exec(s);){var a=i[1],u=i[3];if(!(a&&u&&qE.test(a)&&qE.test(u)))return!0}return!1})(t);if(r)return!1}return!0}function GE(t){var e=Wd(t);return Pd(e=(e+" "+vP(t)).trim())?e:""}function vP(t){var e="";return t&&t.childNodes&&t.childNodes.length&&bt(t.childNodes,(function(n){var r;if(n&&((r=n.tagName)==null?void 0:r.toLowerCase())==="span")try{var s=Wd(n);e=(e+" "+s).trim(),n.childNodes&&n.childNodes.length&&(e=(e+" "+vP(n)).trim())}catch(i){ve.error("[AutoCapture]",i)}})),e}function KE(t){return t.replace(/"|\\"/g,'\\"')}function qD(t){var e=t.attr__class;if(e)return Ze(e)?e:L2(e)}var Jh=Mt("[Dead Clicks]"),GD=()=>!0,KD=t=>{var e,n=!((e=t.instance.persistence)==null||!e.get_property(R2)),r=t.instance.config.capture_dead_clicks;return Kr(r)?r:!!It(r)||n};class ZE{get lazyLoadedDeadClicksAutocapture(){return this.hi}constructor(e,n,r){this.instance=e,this.isEnabled=n,this.onCapture=r,this.startIfEnabledOrStop()}onRemoteConfig(e){if(e.ok){var n=e.config;"captureDeadClicks"in n&&(this.instance.persistence&&this.instance.persistence.register({[R2]:n.captureDeadClicks}),this.startIfEnabledOrStop())}}startIfEnabledOrStop(){this.isEnabled(this)?this.di((()=>{this.vi()})):this.stop()}di(e){var n,r;(n=Fe.__PosthogExtensions__)!=null&&n.initDeadClicksAutocapture?e():(r=Fe.__PosthogExtensions__)==null||r.loadExternalDependency==null||r.loadExternalDependency(this.instance,"dead-clicks-autocapture",(s=>{s?Jh.error("failed to load script",s):e()}))}vi(){var e;if(_e){if(!this.hi&&(e=Fe.__PosthogExtensions__)!=null&&e.initDeadClicksAutocapture){var n=It(this.instance.config.capture_dead_clicks)?ue({},this.instance.config.capture_dead_clicks):{};n.__onCapture=this.onCapture,this.onCapture&&(n.capture_dead_swipes=!1),this.hi=Fe.__PosthogExtensions__.initDeadClicksAutocapture(this.instance,n),this.hi.start(_e),Jh.info("starting...")}}else Jh.error("`document` not found. Cannot start.")}stop(){this.hi&&(this.hi.stop(),this.hi=void 0,Jh.info("stopping..."))}}var Mv=Mt("[SegmentIntegration]"),yP="posthog-js";function _P(t,e){var n=e===void 0?{}:e,r=n.organization,s=n.projectId,i=n.prefix,a=n.severityAllowList,u=a===void 0?["error"]:a,c=n.sendExceptionsToPostHog,d=c===void 0||c;return h=>{var p,m,_,w,y;if(u!=="*"&&!u.includes(h.level)||!t.__loaded)return h;h.tags||(h.tags={});var x=t.requestRouter.endpointFor("ui","/project/"+t.config.token+"/person/"+t.get_distinct_id());h.tags["PostHog Person URL"]=x,t.sessionRecordingStarted()&&(h.tags["PostHog Recording URL"]=t.get_session_replay_url({withTimestamp:!0}));var S,P=((p=h.exception)==null?void 0:p.values)||[],T=P.map((R=>ue({},R,{stacktrace:R.stacktrace?ue({},R.stacktrace,{type:"raw",frames:(R.stacktrace.frames||[]).map((M=>ue({},M,{platform:"web:javascript"})))}):void 0}))),k={$exception_message:((m=P[0])==null?void 0:m.value)||h.message,$exception_type:(_=P[0])==null?void 0:_.type,$exception_level:h.level,$exception_list:T,$sentry_event_id:h.event_id,$sentry_exception:h.exception,$sentry_exception_message:((w=P[0])==null?void 0:w.value)||h.message,$sentry_exception_type:(y=P[0])==null?void 0:y.type,$sentry_tags:h.tags};return r&&s&&(k.$sentry_url=(i||"https://sentry.io/organizations/")+r+"/issues/?project="+s+"&query="+h.event_id),d&&((S=t.exceptions)==null||S.sendExceptionEvent(k)),h}}class ZD{constructor(e,n,r,s,i,a){this.name=yP,this.setupOnce=function(u){u(_P(e,{organization:n,projectId:r,prefix:s,severityAllowList:i,sendExceptionsToPostHog:a==null||a}))}}}class YE{constructor(e){this.ci=(n,r,s)=>{s&&(s.noSessionId||s.activityTimeout||s.sessionPastMaximumLength||s.crossTabAdoption)&&(ve.info("[PageViewManager] Session rotated, clearing pageview state",{sessionId:n,changeReason:s}),this.fi=void 0,this._instance.scrollManager.resetContext())},this._instance=e,this.pi()}pi(){var e;this.gi=(e=this._instance.sessionManager)==null?void 0:e.onSessionId(this.ci)}destroy(){var e;(e=this.gi)==null||e.call(this),this.gi=void 0}doPageView(e,n){var r,s=this.mi(e,n);return this.fi={pathname:(r=ne==null?void 0:ne.location.pathname)!==null&&r!==void 0?r:"",pageViewId:n,timestamp:e},this._instance.scrollManager.resetContext(),s}doPageLeave(e){var n;return this.mi(e,(n=this.fi)==null?void 0:n.pageViewId)}doEvent(){var e;return{$pageview_id:(e=this.fi)==null?void 0:e.pageViewId}}mi(e,n){var r=this.fi;if(!r)return{$pageview_id:n};var s={$pageview_id:n,$prev_pageview_id:r.pageViewId},i=this._instance.scrollManager.getContext();if(i&&!this._instance.config.disable_scroll_properties){var a=i.maxScrollHeight,u=i.lastScrollY,c=i.maxScrollY,d=i.maxContentHeight,h=i.lastContentY,p=i.maxContentY;if(!(he(a)||he(u)||he(c)||he(d)||he(h)||he(p))){a=Math.ceil(a),u=Math.ceil(u),c=Math.ceil(c),d=Math.ceil(d),h=Math.ceil(h),p=Math.ceil(p);var m=a>1?di(u/a,0,1,ve):1,_=a>1?di(c/a,0,1,ve):1,w=d>1?di(h/d,0,1,ve):1,y=d>1?di(p/d,0,1,ve):1;s=At(s,{$prev_pageview_last_scroll:u,$prev_pageview_last_scroll_percentage:m,$prev_pageview_max_scroll:c,$prev_pageview_max_scroll_percentage:_,$prev_pageview_last_content:h,$prev_pageview_last_content_percentage:w,$prev_pageview_max_content:p,$prev_pageview_max_content_percentage:y})}}return r.pathname&&(s.$prev_pageview_pathname=r.pathname),r.timestamp&&(s.$prev_pageview_duration=(e.getTime()-r.timestamp.getTime())/1e3),s}}var Ov=["flags","surveys"],YD={[Z6]:{exposure:"hidden"},[md]:{exposure:"hidden"},__cmpns:{exposure:"hidden"},[gd]:{exposure:"hidden"},[by]:{exposure:"event"},[Sy]:{exposure:"hidden"},[Ey]:{exposure:"event"},[Cy]:{exposure:"hidden"},[ky]:{exposure:"event"},[Py]:{exposure:"event"},[R2]:{exposure:"event"},[A2]:{exposure:"hidden"},[Ty]:{exposure:"event"},[al]:{exposure:"hidden"},$session_recording_enabled_server_side:{exposure:"hidden"},[xu]:{exposure:"hidden"},[I2]:{exposure:"event"},[Y6]:{exposure:"event",shouldSkipFromEventProperties:t=>Tr(t)},$session_past_minimum_duration:{exposure:"event"},$session_recording_url_trigger_activated_session:{exposure:"event"},$session_recording_event_trigger_activated_session:{exposure:"event"},$debug_first_full_snapshot_timestamp:{exposure:"event"},$sess_rec_flush_size:{exposure:"hidden"},[Ja]:{exposure:"hidden",storageGroup:"flags"},[vd]:{exposure:"hidden",storageGroup:"flags"},[Rp]:{exposure:"hidden"},[Ry]:{exposure:"hidden",storageGroup:"flags"},[yd]:{exposure:"hidden",storageGroup:"flags"},[Ap]:{exposure:"hidden",storageGroup:"flags",volatile:!0},[gm]:{exposure:"hidden",storageGroup:"flags"},[ni]:{exposure:"hidden"},[el]:{exposure:"hidden"},[Vi]:{exposure:"hidden"},[tl]:{exposure:"hidden"},[Ay]:{exposure:"hidden",storageGroup:"surveys"},[vm]:{exposure:"hidden",storageGroup:"surveys",volatile:!0},[Iy]:{exposure:"event"},[Ip]:{exposure:"hidden"},[Mp]:{exposure:"hidden"},[_d]:{exposure:"hidden"},$product_tours_activated:{exposure:"hidden"},$product_tours_activated_session:{exposure:"hidden"},$conversations_widget_session_id:{exposure:"event"},$conversations_ticket_id:{exposure:"event"},$conversations_widget_state:{exposure:"event"},$conversations_user_traits:{exposure:"event"},[il]:{exposure:"hidden"},[wd]:{exposure:"hidden"},[Op]:{exposure:"hidden"},[kd]:{exposure:"hidden",storageGroup:"flags",volatile:!0},[zr]:{exposure:"hidden"},[My]:{exposure:"hidden"},[Oy]:{exposure:"hidden"},[Ly]:{exposure:"hidden"},[Dy]:{exposure:"hidden"},[ym]:{exposure:"hidden"},[_m]:{exposure:"hidden"},[X6]:{exposure:"event"},[Q6]:{exposure:"event"},[J6]:{exposure:"event"},[eP]:{exposure:"event"},[nP]:{exposure:"event"},[rP]:{exposure:"event"},[sP]:{exposure:"event"},$sdk_debug_replay_event_trigger_status:{exposure:"event"},$sdk_debug_replay_linked_flag_trigger_status:{exposure:"event"},$sdk_debug_replay_matched_recording_trigger_groups:{exposure:"event"},$sdk_debug_replay_remote_trigger_matching_config:{exposure:"event"},$sdk_debug_replay_trigger_groups_count:{exposure:"event"},$sdk_debug_replay_url_trigger_status:{exposure:"event"},$session_recording_start_reason:{exposure:"event"}},XD=[["$posthog_sr_group_event_trigger_",{exposure:"hidden"}],["$posthog_sr_group_url_trigger_",{exposure:"hidden"}],["$posthog_sr_group_sampling_",{exposure:"hidden"}]],Va=t=>{var e=YD[t];if(e)return e;for(var n of XD){var r=n[1];if(t.indexOf(n[0])===0)return r}},bu=(t,e)=>{try{return JSON.stringify(t,((n,r)=>typeof r=="bigint"?r.toString():r),e)}catch{return g6(t)}},tc=t=>{var e=_e==null?void 0:_e.createElement("a");return he(e)?null:(e.href=t,e)},nc=function(t,e){for(var n,r=((t.split("#")[0]||"").split(/\?(.*)/)[1]||"").replace(/^\?+/g,"").split("&"),s=0;r.length>s;s++){var i=r[s].split("=");if(i[0]===e){n=i;break}}if(!Ze(n)||2>n.length)return"";var a=n[1];try{a=decodeURIComponent(a)}catch{ve.error("Skipping decoding for malformed query param: "+a)}return a.replace(/\+/g," ")},qd=function(t,e,n){if(!t||!e||!e.length)return t;for(var r=t.split("#"),s=r[1],i=(r[0]||"").split("?"),a=i[1],u=i[0],c=(a||"").split("&"),d=[],h=0;c.length>h;h++){var p=c[h].split("=");Ze(p)&&(e.includes(p[0])?d.push(p[0]+"="+n):d.push(c[h]))}var m=u;return a!=null&&(m+="?"+d.join("&")),s!=null&&(m+="#"+s),m},Em=function(t,e){var n=t.match(new RegExp(e+"=([^&]*)"));return n?n[1]:null},wP=(t,e)=>t>=e&&h6(),xP=(t,e,n,r)=>{if(t===0){if(h6()){var s=e+1;return s===n&&r(),s}return e}return 0},ep="https?://(.*)",rc=["gclid","gclsrc","dclid","gbraid","wbraid","fbclid","msclkid","twclid","li_fat_id","igshid","ttclid","rdt_cid","epik","qclid","sccid","irclid","_kx"],QD=["utm_source","utm_medium","utm_campaign","utm_content","utm_term","gad_source","mc_cid",...rc],Gd="<masked>",JD=["li_fat_id"];function bP(t,e,n){if(!_e)return{};var r,s=e?[...rc,...n||[]]:[],i=SP(qd(_e.URL,s,Gd),t),a=(r={},bt(JD,(function(u){var c=iP(u);r[u]=c||null})),r);return At(a,i)}function SP(t,e){var n=QD.concat(e||[]),r={};return bt(n,(function(s){var i=nc(t,s);r[s]=i||null})),r}function EP(t){var e=(function(i){return i?i.search(ep+"google.([^/?]*)")===0?"google":i.search(ep+"bing.com")===0?"bing":i.search(ep+"yahoo.com")===0?"yahoo":i.search(ep+"duckduckgo.com")===0?"duckduckgo":null:null})(t),n=e!="yahoo"?"q":"p",r={};if(!Tr(e)){r.$search_engine=e;var s=_e?nc(_e.referrer,n):"";s.length&&(r.ph_keyword=s)}return r}function XE(){return navigator.language||navigator.userLanguage}var Cm="$direct";function CP(){return(_e==null?void 0:_e.referrer)||Cm}function kP(t,e,n){n===void 0&&(n=!1);var r=t?[...rc,...e||[]]:[],s=n?oa(Nt==null?void 0:Nt.href):Nt==null?void 0:Nt.href,i=s==null?void 0:s.substring(0,1e3);return{r:CP().substring(0,1e3),u:i?qd(i,r,Gd):void 0}}function PP(t,e){var n;e===void 0&&(e=!1);var r=t.r,s=t.u,i=e?oa(s):s,a={$referrer:r,$referring_domain:r==null?void 0:r==Cm?Cm:(n=tc(r))==null?void 0:n.host};if(i){a.$current_url=i;var u=tc(i);a.$host=u==null?void 0:u.host,a.$pathname=u==null?void 0:u.pathname;var c=SP(i);At(a,c)}if(r){var d=EP(r);At(a,d)}return a}function TP(){try{return Intl.DateTimeFormat().resolvedOptions().timeZone}catch{return}}function eN(){try{return new Date().getTimezoneOffset()}catch{return}}var tN={flags:kd,surveys:vm},nN=["cookie","localstorage","localstorage+cookie","sessionstorage","memory"],au="main";class Lv{constructor(e,n,r){if(r===void 0&&(r=!0),this.yi={},this.bi=!1,this.wi=!1,this.qe=e,this.ki=r,this.props={},this.xi=void 0,this.Si=(i=>{var a="";return i.token&&(a=i.token.replace(/\+/g,"PL").replace(/\//g,"SL").replace(/=/g,"EQ")),i.persistence_name?"ph_"+i.persistence_name:"ph_"+a+"_posthog"})(e),this.oi=this.Ci(e),this.wi=this.Mi(e),this.load(),e.debug&&ve.info("Persistence loaded",e.persistence,ue({},this.props)),this.update_config(e,e,n),this.save(),ne){var s=()=>this.flush();jt(ne,"beforeunload",s,{capture:!1}),jt(ne,"pagehide",s,{capture:!1})}}Ti(){var e,n=(e=this.qe)==null?void 0:e.persistence_save_debounce_ms;return sn(n)&&n>0?n:0}isDisabled(){return!!this.Ei}Ci(e){nN.indexOf(e.persistence.toLowerCase())===-1&&(ve.critical("Unknown persistence type "+e.persistence+"; falling back to localStorage+cookie"),e.persistence="localStorage+cookie");var n,r=(function(a,u){a===void 0&&(a=[]),u===void 0&&(u=!1);var c=[...LD,...a];return ue({},Ct,{H(d){try{var h={};try{h=Yi.H(d)||{}}catch{}var p,m=JSON.parse(Ct.P(d)||"{}");if(u){var _={};for(var w in h){var y=h[w];Tr(y)||y===""||(_[w]=y)}p=At(m,_)}else p=At(h,m);return Ct.F(d,p),p}catch{}return null},F(d,h,p,m,_,w){var y=Ct.F(d,h,void 0,void 0,w);try{var x={};c.forEach((S=>{h[S]&&(x[S]=h[S])})),Object.keys(x).length&&Yi.F(d,x,p,m,_,w)}catch(S){Ct.j(S)}return y},q(d,h){try{ne==null||ne.localStorage.removeItem(d),Yi.q(d,h)}catch(p){Ct.j(p)}}})})(e.cookie_persisted_properties||[],e.__preview_cookie_wins_on_conflict||!1),s=!1,i=e.persistence.toLowerCase();return i==="localstorage"&&Ct.N()?(n=Ct,s=!0):i==="localstorage+cookie"&&r.N()?(n=r,s=!0):i==="sessionstorage"&&Ut.N()?n=Ut:i==="memory"?n=DD:i==="cookie"?n=Yi:r.N()?(n=r,s=!0):n=Yi,this.bi=s,n}Ii(e){return this.Si+"__"+e}Mi(e){return this.bi&&!!e.split_storage}properties(){var e={};return bt(this.props,((n,r)=>{var s=Va(r);if(!s||s.exposure==="event"){if(s!=null&&s.shouldSkipFromEventProperties!=null&&s.shouldSkipFromEventProperties(n))return;e[r]=n}})),e}load(){if(!this.Ei){var e=this.oi.H(this.Si);e&&(this.props=At({},e)),this.wi&&this.Pi()}}Pi(){for(var e of Ov){var n=Ct.H(this.Ii(e));if(n&&!eo(n)){var r=this.Ri(e);r.persisted=!0,this.Ai(e)||(r.fingerprint=this.Fi(n,e)),this.Li(e,n)||At(this.props,n)}}}Ai(e){return Object.keys(this.props).some((n=>{var r;return((r=Va(n))==null?void 0:r.storageGroup)===e}))}Li(e,n){var r=tN[e];if(!r)return!1;var s=n[r],i=this.props[r];return sn(s)&&sn(i)&&i>s}refreshKey(e){var n;if(!this.Ei){var r=this.wi?(n=Va(e))==null?void 0:n.storageGroup:void 0,s=r?Ct.H(this.Ii(r)):this.oi.H(this.Si);if(s&&e in s)this.Oi(e,s[e]);else{if(r){var i=this.oi.H(this.Si);if(i&&e in i)return void this.Oi(e,i[e])}this.Di(e)}}}save(){if(!this.Ei){var e=this.Ti();e>0?he(this.$i)&&(this.$i=setTimeout((()=>{this.$i=void 0,this.Ni()}),e)):this.Ni()}}flush(){he(this.$i)||(clearTimeout(this.$i),this.$i=void 0,this.Ni())}Ni(){this.Ei||(this.wi?this.qi():this.ji(this.oi,this.Si,this.props,au))}qi(){var e=this.Bi(),n=e.main,r=e.groups;for(var s of(this.ji(this.oi,this.Si,n,au),Ov)){var i,a=r[s];(!eo(a)||(i=this.yi[s])!=null&&i.persisted)&&this.ji(Ct,this.Ii(s),a,s)}}Bi(){var e={},n={flags:{},surveys:{}};return bt(this.props,((r,s)=>{var i,a=(i=Va(s))==null?void 0:i.storageGroup;a?n[a][s]=r:e[s]=r})),{main:e,groups:n}}Fi(e,n){if(n===au)return JSON.stringify(e)+"|"+this.Hi+"|"+this.Ui+"|"+this.zi;var r={};return bt(e,((s,i)=>{var a;r[i]=(a=Va(i))!=null&&a.volatile?"__volatile__":s})),JSON.stringify(r)}ji(e,n,r,s){var i=this.Ri(s);if(s===au||i.dirty||he(i.fingerprint)){var a;try{if((a=this.Fi(r,s))===i.fingerprint)return void(i.dirty=!1)}catch{a=void 0}e.F(n,r,this.Hi,this.Ui,this.zi,this.qe.debug)?(i.dirty=!1,s!==au&&(i.persisted=!0),he(a)||(i.fingerprint=a)):this.qe.debug&&ve.warn('failed to persist storage entry "'+n+'"; will retry on next save')}}remove(e){var n=(e===void 0?{}:e).keepGroupEntries,r=n!==void 0&&n;if(he(this.$i)||(clearTimeout(this.$i),this.$i=void 0),this.oi.q(this.Si,!1),this.oi.q(this.Si,!0),!r&&this.ki)for(var s of Ov)Ct.q(this.Ii(s));r?delete this.yi[au]:this.yi={}}clear(){this.remove(),this.props={}}register_once(e,n,r){if(It(e)){he(n)&&(n="None"),this.Hi=he(r)?this.Wi:r;var s=!1;if(bt(e,((i,a)=>{this.props.hasOwnProperty(a)&&this.props[a]!==n||(this.Oi(a,i),s=!0)})),s)return this.save(),!0}return!1}register(e,n){if(It(e)){this.Hi=he(n)?this.Wi:n;var r=!1;if(bt(e,((s,i)=>{e.hasOwnProperty(i)&&(this.props[i]!==s||It(s)||Ze(s))&&(this.Oi(i,s),r=!0)})),r)return this.save(),!0}return!1}unregister(e){var n=typeof e=="string"?[e]:e,r=!1;for(var s of n)s in this.props&&(this.Di(s),r=!0);r&&this.save()}update_campaign_params(){var e=_e==null?void 0:_e.URL;if(e!==this.xi){var n=bP(this.qe.custom_campaign_params,this.qe.mask_personal_data_properties,this.qe.custom_personal_data_properties);eo(O2(n))||this.register(n),this.xi=e}}update_search_keyword(){var e;this.register((e=_e==null?void 0:_e.referrer)?EP(e):{})}update_referrer_info(){var e;this.register_once({$referrer:CP(),$referring_domain:_e!=null&&_e.referrer&&((e=tc(_e.referrer))==null?void 0:e.host)||Cm},void 0)}set_initial_person_info(){this.props[Ly]||this.props[Dy]||this.register_once({[ym]:kP(this.qe.mask_personal_data_properties,this.qe.custom_personal_data_properties,this.qe.disable_capture_url_hashes)},void 0)}get_initial_props(){var e={};bt([Dy,Ly],(s=>{var i=this.props[s];i&&bt(i,(function(a,u){e["$initial_"+my(u)]=a}))}));var n=this.props[ym];if(n){var r=(function(s,i){i===void 0&&(i=!1);var a=PP(s,i),u={};return bt(a,(function(c,d){u["$initial_"+my(d)]=c})),u})(n,this.qe.disable_capture_url_hashes);At(e,r)}return e}safe_merge(e){return bt(this.props,(function(n,r){r in e||(e[r]=n)})),e}update_config(e,n,r){this.Wi=this.Hi=e.cookie_expiration,this.set_disabled(e.disable_persistence||!!r),this.set_cross_subdomain(e.cross_subdomain_cookie),this.set_secure(e.secure_cookie);var s=e.persistence!==n.persistence||!((c,d)=>{if(c.length!==d.length)return!1;var h=[...c].sort(),p=[...d].sort();return h.every(((m,_)=>m===p[_]))})(e.cookie_persisted_properties||[],n.cookie_persisted_properties||[]),i=s?this.Ci(e):this.oi,a=this.Mi(e);if(s||a!==this.wi){var u=this.props;this.clear(),this.oi=i,this.wi=a,this.props=u,this.save()}}set_disabled(e){this.Ei=e,this.Ei?this.remove():this.save()}set_cross_subdomain(e){e!==this.Ui&&(this.Ui=e,this.remove({keepGroupEntries:!0}),this.save())}set_secure(e){e!==this.zi&&(this.zi=e,this.remove({keepGroupEntries:!0}),this.save())}set_event_timer(e,n){var r=this.props[gd]||{};r[e]=n,this.Oi(gd,r),this.save()}remove_event_timer(e){var n=this.props[gd]||{},r=n[e];return he(r)||(delete n[e],this.Oi(gd,n),this.save()),r}get_property(e){return this.props[e]}set_property(e,n){this.Oi(e,n),this.save()}Oi(e,n){var r;this.props[e]=n,(r=Va(e))!=null&&r.volatile||this.Vi(e)}Di(e){delete this.props[e],this.Vi(e)}Vi(e){var n,r=(n=Va(e))==null?void 0:n.storageGroup;r&&(this.Ri(r).dirty=!0)}Ri(e){return this.yi[e]||(this.yi[e]={})}}function tp(t){var e=!0;return{dispose(){if(e){e=!1;var n=t();n&&ir(n.then)&&n.then(void 0,(()=>{}))}}}}var or={GZipJS:"gzip-js",Base64:"base64"},nd={Activation:"events",Cancellation:"cancelEvents"},Dv={Popover:"popover",API:"api",Widget:"widget"},Xi={SHOWN:"survey shown",DISMISSED:"survey dismissed",SENT:"survey sent"},Nv={SURVEY_ID:"$survey_id",SURVEY_ITERATION:"$survey_iteration",SURVEY_LAST_SEEN_DATE:"$survey_last_seen_date"},Vy={Popover:"popover",Inline:"inline"},rN={SHOWN:"product tour shown"},QE={TOUR_LAST_SEEN_DATE:"$product_tour_last_seen_date",TOUR_TYPE:"$product_tour_type"},JE=Mt("[RateLimiter]");class sN{constructor(e){this.serverLimits={},this.lastEventRateLimited=!1,this.checkForLimiting=n=>{var r=n.text;if(r&&r.length)try{(JSON.parse(r).quota_limited||[]).forEach((s=>{JE.info((s||"events")+" is quota limited."),this.serverLimits[s]=new Date().getTime()+6e4}))}catch(s){return void JE.warn('could not rate limit - continuing. Error: "'+(s==null?void 0:s.message)+'"',{text:r})}},this.instance=e,this.lastEventRateLimited=this.clientRateLimitContext(!0).isRateLimited}get captureEventsPerSecond(){var e;return((e=this.instance.config.rate_limiting)==null?void 0:e.events_per_second)||10}get captureEventsBurstLimit(){var e;return Math.max(((e=this.instance.config.rate_limiting)==null?void 0:e.events_burst_limit)||10*this.captureEventsPerSecond,this.captureEventsPerSecond)}clientRateLimitContext(e){var n,r,s;e===void 0&&(e=!1);var i=this.captureEventsBurstLimit,a=this.captureEventsPerSecond,u=new Date().getTime(),c=(n=(r=this.instance.persistence)==null?void 0:r.get_property(Oy))!==null&&n!==void 0?n:{tokens:i,last:u};c.tokens+=(u-c.last)/1e3*a,c.last=u,c.tokens>i&&(c.tokens=i);var d=1>c.tokens;if(d||e||(c.tokens=Math.max(0,c.tokens-1)),d&&!e){var h=(sn(c.dropped)?c.dropped:0)+1;c.dropped=h,!this.lastEventRateLimited&&this.Zi(h)&&(c.dropped=0)}return this.lastEventRateLimited=d,(s=this.instance.persistence)==null||s.set_property(Oy,c),{isRateLimited:d,remainingTokens:c.tokens}}Gi(e){var n=this.instance.config.property_denylist;return!Ze(n)||!n.includes(e)}Qi(){var e;if(this.Gi("$current_url")&&this.Gi("$pathname")&&Nt!=null&&Nt.pathname)return""+((e=Nt.origin)!==null&&e!==void 0?e:"")+Nt.pathname}Zi(e){var n,r,s=this.captureEventsBurstLimit,i=this.captureEventsPerSecond,a=this.Qi(),u=this.Gi("$session_id")?(n=(r=this.instance).get_session_id)==null?void 0:n.call(r):void 0,c=[e+" event(s) dropped since the last warning",a?"triggered on "+a:void 0,u?"session "+u:void 0].filter(Boolean).join(", ");return!!this.instance.capture("$$client_ingestion_warning",{$$client_ingestion_warning_message:"posthog-js client rate limited: "+c+". Config is set to "+i+" events per second and "+s+" events burst limit."},{skip_client_rate_limiting:!0})}isServerRateLimited(e){var n=this.serverLimits[e||"events"]||!1;return n!==!1&&new Date().getTime()<n}}var $o=Mt("[RemoteConfig]");class RP{constructor(e){this._instance=e}get remoteConfig(){var e;return(e=Fe._POSTHOG_REMOTE_CONFIG)==null||(e=e[this._instance.config.token])==null?void 0:e.config}Ki(e){var n,r;(n=Fe.__PosthogExtensions__)!=null&&n.loadExternalDependency?(r=Fe.__PosthogExtensions__)==null||r.loadExternalDependency==null||r.loadExternalDependency(this._instance,"remote-config",(()=>e(this.remoteConfig))):e()}Ji(e){this._instance._send_request({method:"GET",url:this._instance.requestRouter.endpointFor("assets","/array/"+this._instance.config.token+"/config"),callback:e})}load(){try{if(this.remoteConfig)return $o.info("Using preloaded remote config",this.remoteConfig),this.Yi(this.remoteConfig),void this.Xi();if(this._instance.tr())return void $o.warn("Remote config is disabled. Falling back to local config.");this.Ki((e=>{if(!e)return $o.info("No config found after loading remote JS config. Falling back to JSON."),void this.Ji((n=>{this.Yi(n.json,n),this.Xi()}));this.Yi(e),this.Xi()}))}catch(e){$o.error("Error loading remote config",e),this.Yi()}}stop(){this.er&&(clearInterval(this.er),this.er=void 0)}refresh(){!this._instance.tr()&&_e&&_e.visibilityState!=="hidden"&&this._instance.reloadFeatureFlags()}Xi(){var e;if(!this.er){var n=(e=this._instance.config.remote_config_refresh_interval_ms)!==null&&e!==void 0?e:3e5;n!==0&&(this.er=setInterval((()=>{this.refresh()}),n))}}Yi(e,n){!e&&n&&(n.statusCode===0?n.error||$o.warn("Failed to fetch remote config from PostHog."):$o.error("Failed to fetch remote config from PostHog."));try{this._instance.Yi(e?{ok:!0,config:e}:{ok:!1})}catch(s){$o.error("Error applying remote config",s)}if((e==null?void 0:e.hasFeatureFlags)!==!1&&!this._instance.config.advanced_disable_feature_flags_on_first_load)try{var r;(r=this._instance.featureFlags)==null||r.ensureFlagsLoaded()}catch(s){$o.error("Error loading feature flags",s)}}}var Ss=Uint8Array,Pr=Uint16Array,sc=Uint32Array,j2=new Ss([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]),F2=new Ss([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]),eC=new Ss([16,17,18,0,8,7,9,6,10,5,11,4,12,3,13,2,14,1,15]),AP=function(t,e){for(var n=new Pr(31),r=0;31>r;++r)n[r]=e+=1<<t[r-1];var s=new sc(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]},IP=AP(j2,2),Hy=IP[1];IP[0][28]=258,Hy[258]=28;for(var tC=AP(F2,0)[1],MP=new Pr(32768),$t=0;32768>$t;++$t){var lu=(43690&$t)>>>1|(21845&$t)<<1;MP[$t]=((65280&(lu=(61680&(lu=(52428&lu)>>>2|(13107&lu)<<2))>>>4|(3855&lu)<<4))>>>8|(255&lu)<<8)>>>1}var Td=function(t,e,n){for(var r=t.length,s=0,i=new Pr(e);r>s;++s)++i[t[s]-1];var a,u=new Pr(e);for(s=0;e>s;++s)u[s]=u[s-1]+i[s-1]<<1;for(a=new Pr(r),s=0;r>s;++s)a[s]=MP[u[t[s]-1]++]>>>15-t[s];return a},Tl=new Ss(288);for($t=0;144>$t;++$t)Tl[$t]=8;for($t=144;256>$t;++$t)Tl[$t]=9;for($t=256;280>$t;++$t)Tl[$t]=7;for($t=280;288>$t;++$t)Tl[$t]=8;var km=new Ss(32);for($t=0;32>$t;++$t)km[$t]=5;var iN=Td(Tl,9),oN=Td(km,5),OP=function(t){return(t/8>>0)+(7&t&&1)},LP=function(t,e,n){(n==null||n>t.length)&&(n=t.length);var r=new(t instanceof Pr?Pr:t instanceof sc?sc:Ss)(n-e);return r.set(t.subarray(e,n)),r},Mi=function(t,e,n){var r=e/8>>0;t[r]|=n<<=7&e,t[r+1]|=n>>>8},rd=function(t,e,n){var r=e/8>>0;t[r]|=n<<=7&e,t[r+1]|=n>>>8,t[r+2]|=n>>>16},jv=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 Ss(0),0];if(s==1){var a=new Ss(n[0].s+1);return a[n[0].s]=1,[a,1]}n.sort((function(R,M){return R.f-M.f})),n.push({s:-1,f:25001});var u=n[0],c=n[1],d=0,h=1,p=2;for(n[0]={s:-1,f:u.f+c.f,l:u,r:c};h!=s-1;)u=n[n[p].f>n[d].f?d++:p++],c=n[d!=h&&n[p].f>n[d].f?d++:p++],n[h++]={s:-1,f:u.f+c.f,l:u,r:c};var m=i[0].s;for(r=1;s>r;++r)i[r].s>m&&(m=i[r].s);var _=new Pr(m+1),w=zy(n[h-1],_,0);if(w>e){r=0;var y=0,x=w-e,S=1<<x;for(i.sort((function(R,M){return _[M.s]-_[R.s]||R.f-M.f}));s>r;++r){var P=i[r].s;if(e>=_[P])break;y+=S-(1<<w-_[P]),_[P]=e}for(y>>>=x;y>0;){var T=i[r].s;e>_[T]?y-=1<<e-_[T]++-1:++r}for(;r>=0&&y;--r){var k=i[r].s;_[k]==e&&(--_[k],++y)}w=e}return[new Ss(_),w]},zy=function(t,e,n){return t.s==-1?Math.max(zy(t.l,e,n+1),zy(t.r,e,n+1)):e[t.s]=n},nC=function(t){for(var e=t.length;e&&!t[--e];);for(var n=new Pr(++e),r=0,s=t[0],i=1,a=function(c){n[r++]=c},u=1;e>=u;++u)if(t[u]==s&&u!=e)++i;else{if(!s&&i>2){for(;i>138;i-=138)a(32754);i>2&&(a(i>10?i-11<<5|28690:i-3<<5|12305),i=0)}else if(i>3){for(a(s),--i;i>6;i-=6)a(8304);i>2&&(a(i-3<<5|8208),i=0)}for(;i--;)a(s);i=1,s=t[u]}return[n.subarray(0,r),e]},sd=function(t,e){for(var n=0,r=0;e.length>r;++r)n+=t[r]*e[r];return n},Uy=function(t,e,n){var r=n.length,s=OP(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)},rC=function(t,e,n,r,s,i,a,u,c,d,h){Mi(e,h++,n),++s[256];for(var p=jv(s,15),m=p[0],_=p[1],w=jv(i,15),y=w[0],x=w[1],S=nC(m),P=S[0],T=S[1],k=nC(y),R=k[0],M=k[1],L=new Pr(19),A=0;P.length>A;++A)L[31&P[A]]++;for(A=0;R.length>A;++A)L[31&R[A]]++;for(var O=jv(L,7),D=O[0],N=O[1],j=19;j>4&&!D[eC[j-1]];--j);var G,Y,W,q,Z=d+5<<3,V=sd(s,Tl)+sd(i,km)+a,J=sd(s,m)+sd(i,y)+a+14+3*j+sd(L,D)+(2*L[16]+3*L[17]+7*L[18]);if(V>=Z&&J>=Z)return Uy(e,h,t.subarray(c,c+d));if(Mi(e,h,1+(V>J)),h+=2,V>J){G=Td(m,_),Y=m,W=Td(y,x),q=y;var H=Td(D,N);for(Mi(e,h,T-257),Mi(e,h+5,M-1),Mi(e,h+10,j-4),h+=14,A=0;j>A;++A)Mi(e,h+3*A,D[eC[A]]);h+=3*j;for(var F=[P,R],X=0;2>X;++X){var oe=F[X];for(A=0;oe.length>A;++A)Mi(e,h,H[se=31&oe[A]]),h+=D[se],se>15&&(Mi(e,h,oe[A]>>>5&127),h+=oe[A]>>>12)}}else G=iN,Y=Tl,W=oN,q=km;for(A=0;u>A;++A)if(r[A]>255){var se;rd(e,h,G[257+(se=r[A]>>>18&31)]),h+=Y[se+257],se>7&&(Mi(e,h,r[A]>>>23&31),h+=j2[se]);var ee=31&r[A];rd(e,h,W[ee]),h+=q[ee],ee>3&&(rd(e,h,r[A]>>>5&8191),h+=F2[ee])}else rd(e,h,G[r[A]]),h+=Y[r[A]];return rd(e,h,G[256]),h+Y[256]},aN=new sc([65540,131080,131088,131104,262176,1048704,1048832,2114560,2117632]),lN=(function(){for(var t=new sc(256),e=0;256>e;++e){for(var n=e,r=9;--r;)n=(1&n&&3988292384)^n>>>1;t[e]=n}return t})(),Fv=function(t,e,n){for(;n;++e)t[e]=n,n>>>=8};function uN(t,e){e===void 0&&(e={});var n=(function(){var p=4294967295;return{p(m){for(var _=p,w=0;m.length>w;++w)_=lN[255&_^m[w]]^_>>>8;p=_},d(){return 4294967295^p}}})(),r=t.length;n.p(t);var s,i,a,u,c,d=(u=10+((s=e).filename&&s.filename.length+1||0),c=8,(function(p,m,_,w,y,x){var S=p.length,P=new Ss(w+S+5*(1+Math.floor(S/7e3))+y),T=P.subarray(w,P.length-y),k=0;if(!m||8>S)for(var R=0;S>=R;R+=65535){var M=R+65535;S>M?k=Uy(T,k,p.subarray(R,M)):(T[R]=!0,k=Uy(T,k,p.subarray(R,S)))}else{for(var L=aN[m-1],A=L>>>13,O=8191&L,D=(1<<_)-1,N=new Pr(32768),j=new Pr(D+1),G=Math.ceil(_/3),Y=2*G,W=function(on){return(p[on]^p[on+1]<<G^p[on+2]<<Y)&D},q=new sc(25e3),Z=new Pr(288),V=new Pr(32),J=0,H=0,F=(R=0,0),X=0,oe=0;S>R;++R){var se=W(R),ee=32767&R,ce=j[se];if(N[ee]=ce,j[se]=ee,R>=X){var we=S-R;if((J>7e3||F>24576)&&we>423){k=rC(p,T,0,q,Z,V,H,F,oe,R-oe,k),F=J=H=0,oe=R;for(var le=0;286>le;++le)Z[le]=0;for(le=0;30>le;++le)V[le]=0}var ie=2,Ne=0,Be=O,Pe=ee-ce&32767;if(we>2&&se==W(R-Pe))for(var $e=Math.min(A,we)-1,dt=Math.min(32767,R),Qt=Math.min(258,we);dt>=Pe&&--Be&&ee!=ce;){if(p[R+ie]==p[R+ie-Pe]){for(var be=0;Qt>be&&p[R+be]==p[R+be-Pe];++be);if(be>ie){if(ie=be,Ne=Pe,be>$e)break;var Ve=Math.min(Pe,be-2),qe=0;for(le=0;Ve>le;++le){var tt=R-Pe+le+32768&32767,_t=tt-N[tt]+32768&32767;_t>qe&&(qe=_t,ce=tt)}}}Pe+=(ee=ce)-(ce=N[ee])+32768&32767}if(Ne){q[F++]=268435456|Hy[ie]<<18|tC[Ne];var nt=31&Hy[ie],Ye=31&tC[Ne];H+=j2[nt]+F2[Ye],++Z[257+nt],++V[Ye],X=R+ie,++J}else q[F++]=p[R],++Z[p[R]]}}k=rC(p,T,!0,q,Z,V,H,F,oe,R-oe,k)}return LP(P,0,w+OP(k)+y)})(i=t,(a=e).level==null?6:a.level,a.mem==null?Math.ceil(1.5*Math.max(8,Math.min(13,Math.log(i.length)))):12+a.mem,u,c)),h=d.length;return(function(p,m){var _=m.filename;if(p[0]=31,p[1]=139,p[2]=8,p[8]=2>m.level?4:m.level==9?2:0,p[9]=3,m.mtime!=0&&Fv(p,4,Math.floor(new Date(m.mtime||Date.now())/1e3)),_){p[3]=8;for(var w=0;_.length>=w;++w)p[w+10]=_.charCodeAt(w)}})(d,e),Fv(d,h-8,n.d()),Fv(d,h-4,r),d}var cN=!!fy||!!b2,DP="text/plain",Dp=!1,NP=(t,e)=>{var n=t.split("#"),r=n[1],s=n[0].split("?"),i=s[0],a=s[1];if(!a)return t;var u=a.split("&").filter((c=>c.split("=")[0]!==e)).join("&");return i+(u?"?"+u:"")+(r?"#"+r:"")},l0=function(t,e,n){var r;n===void 0&&(n=!0);var s=t.split("?"),i=s[0],a=s[1],u=ue({},e),c=(r=a==null?void 0:a.split("&").map((h=>{var p,m=h.split("="),_=m[0],w=n&&(p=u[_])!==null&&p!==void 0?p:m[1];return delete u[_],_+"="+w})))!==null&&r!==void 0?r:[],d=(function(h,p){var m,_;p===void 0&&(p="&");var w=[];return bt(h,(function(y,x){he(y)||he(x)||x==="undefined"||(m=encodeURIComponent((S=>S instanceof File)(y)?y.name:y.toString()),_=encodeURIComponent(x),w[w.length]=_+"="+m)})),w.join(p)})(u);return d&&c.push(d),c.length>0?i+"?"+c.join("&"):i},$v=t=>{if(t.ir)return t.ir;var e=t.data,n=t.compression;if(e){if(n===or.GZipJS){var r=uN((function(u,c){var d=u.length;if(typeof TextEncoder<"u")return new TextEncoder().encode(u);for(var h=new Ss(u.length+(u.length>>>1)),p=0,m=function(x){h[p++]=x},_=0;d>_;++_){if(p+5>h.length){var w=new Ss(p+8+(d-_<<1));w.set(h),h=w}var y=u.charCodeAt(_);128>y?m(y):2048>y?(m(192|y>>>6),m(128|63&y)):y>55295&&57344>y?(m(240|(y=65536+(1047552&y)|1023&u.charCodeAt(++_))>>>18),m(128|y>>>12&63),m(128|y>>>6&63),m(128|63&y)):(m(224|y>>>12),m(128|y>>>6&63),m(128|63&y))}return LP(h,0,p)})(bu(e)),{mtime:0});return{contentType:DP,body:r.buffer.slice(r.byteOffset,r.byteOffset+r.byteLength),estimatedSize:r.byteLength}}if(n===or.Base64){var s=(function(u){return u&&btoa(encodeURIComponent(u).replace(/%([0-9A-F]{2})/g,((c,d)=>String.fromCharCode(parseInt(d,16)))))})(bu(e)),i=(u=>"data="+encodeURIComponent(typeof u=="string"?u:bu(u)))(s);return{contentType:"application/x-www-form-urlencoded",body:i,estimatedSize:new Blob([i]).size}}var a=bu(e);return{contentType:"application/json",body:a,estimatedSize:new Blob([a]).size}}},jP=t=>{var e,n,r=()=>t.transport==="sendBeacon"?{url:l0(t.url,{compression:or.Base64}),encodedBody:$v(ue({},t,{compression:or.Base64,ir:void 0}))}:{url:NP(t.url,"compression"),encodedBody:$v(ue({},t,{compression:void 0,ir:void 0}))};try{e=$v(t)}catch(s){if(bE(t.compression,nc(t.url,"compression")))return ve.error("Failed to gzip request body, sending uncompressed payload",s),r();throw s}return e&&bE(t.compression,nc(t.url,"compression"))&&!((n=e.body)instanceof ArrayBuffer?hy(new Uint8Array(n)):ArrayBuffer.isView(n)&&hy(new Uint8Array(n.buffer,n.byteOffset,n.byteLength)))?(Dp=!0,r()):{url:t.url,encodedBody:e}},FP=t=>{try{return jP(t)}catch(e){return ve.error(e),void(t.callback==null||t.callback({statusCode:0,error:e}))}},dN=(function(){var t=St((function*(e){var n=bu(e.data),r=yield(function(i,a,u){return py.apply(this,arguments)})(n,xt.DEBUG,{rethrow:!0});if(!r)return e;var s=yield r.arrayBuffer();return ue({},e,{ir:{contentType:DP,body:s,estimatedSize:s.byteLength}})}));return function(e){return t.apply(this,arguments)}})(),fN=/Failed to fetch|NetworkError|Load failed/i,$P=t=>(t==null?void 0:t.name)==="TypeError"&&fN.test((t==null?void 0:t.message)||""),VP=t=>{var e=FP(t);if(e){var n=e.url,r=e.encodedBody,s=r??{},i=s.contentType,a=s.body,u=s.estimatedSize,c=new Headers;bt(t.headers,(function(w,y){c.append(y,w)})),i&&c.append("Content-Type",i);var d=null,h=!1;if(gE){var p=new gE;d={signal:p.signal,timeout:setTimeout((()=>{var w,y;h=!0,p.abort((w=t.timeout,(y=new Error("PostHog request timed out"+(w?" after "+w+"ms":""))).name="AbortError",y))}),t.timeout)}}var m=w=>{h&&(w==null?void 0:w.name)==="AbortError"||$P(w)?ve.warn(w):ve.error(w),t.callback==null||t.callback({statusCode:0,error:w})};try{var _;b2(n,ue({method:(t==null?void 0:t.method)||"GET",headers:c,keepalive:t.method==="POST"&&!t.rr&&52428.8>(u||0),body:a,signal:(_=d)==null?void 0:_.signal},t.fetchOptions)).then((w=>w.text().then((y=>{var x={statusCode:w.status,text:y};if(w.status===200)try{x.json=JSON.parse(y)}catch(S){ve.error(S)}t.callback==null||t.callback(x)})))).catch(m).finally((()=>d?clearTimeout(d.timeout):null))}catch(w){d&&clearTimeout(d.timeout),m(w)}}},By=t=>{try{var e,n=jP(t),r=n.url,s=n.encodedBody,i=s??{},a=i.body,u=i.estimatedSize;if(!a)return;var c=a instanceof Blob?a:new Blob([a],{type:i.contentType});if(ar.sendBeacon(r,c))return;var d=Ze(t.data)?t.data:(e=t.data)==null?void 0:e.batch;if(Ze(d)&&d.length>1&&(u??0)>16384){var h=Math.ceil(d.length/2),p=m=>Ze(t.data)?m:ue({},t.data,{batch:m});return By(ue({},t,{data:p(d.slice(0,h))})),void By(ue({},t,{data:p(d.slice(h))}))}ve.warn("Beacon of ~"+(u??0)+" bytes was rejected by the browser, falling back to fetch"),VP(ue({},t,{rr:!0}))}catch(m){ve.warn("Beacon send failed",m)}},sC=(t,e,n,r)=>{var s=r==="query"?e==="POST"?"sent_at":"_":void 0;return l0(n===or.GZipJS?NP(t,"compression"):t,ue({},s?{[s]:Date.now().toString()}:{},n===or.GZipJS?{}:{compression:n}))},Np=[];b2&&Np.push({transport:"fetch",method:VP}),fy&&Np.push({transport:"XHR",method(t){var e=FP(t);if(e){var n=new fy,r=e.encodedBody;n.open(t.method||"GET",e.url,!0);var s=r??{},i=s.contentType,a=s.body;bt(t.headers,(function(u,c){n.setRequestHeader(c,u)})),i&&n.setRequestHeader("Content-Type",i),t.timeout&&(n.timeout=t.timeout),n.onreadystatechange=()=>{if(n.readyState===4){var u={statusCode:n.status,text:n.responseText};if(n.status===200)try{u.json=JSON.parse(n.responseText)}catch{}t.callback==null||t.callback(u)}},n.send(a)}}}),ar!=null&&ar.sendBeacon&&Np.push({transport:"sendBeacon",method:By});var Wy=3e3;class hN{constructor(e,n){this.nr=!0,this.sr=[],this.ar=di((n==null?void 0:n.flush_interval_ms)||Wy,250,5e3,ve.createLogger("flush interval"),Wy),this.lr=e}enqueue(e){this.sr.push(e),this.ur||this.hr()}unload(){this.dr();var e=this.sr.length>0?this.vr():{},n=Object.values(e);[...n.filter((r=>r.url.indexOf("/e")===0)),...n.filter((r=>r.url.indexOf("/e")!==0))].map((r=>{this.cr(ue({},r,{transport:"sendBeacon"}))}))}enable(){this.nr=!1,this.hr()}hr(){var e=this;this.nr||(this.ur=setTimeout((()=>{if(this.dr(),this.sr.length>0){var n=this.vr(),r=function(){var i=n[s],a=new Date().getTime();i.data&&Ze(i.data)&&bt(i.data,(u=>{u.offset=Math.abs(u.timestamp-a),delete u.timestamp})),e.cr(i)};for(var s in n)r()}}),this.ar))}cr(e){try{this.lr(e)}catch(n){ve.error(n)}}dr(){clearTimeout(this.ur),this.ur=void 0}vr(){var e={};return bt(this.sr,(n=>{var r,s=n,i=(s?s.batchKey:null)||s.url;he(e[i])&&(e[i]=ue({},s,{data:[]})),(r=e[i].data)==null||r.push(s.data)})),this.sr=[],e}}var pN=["retriesPerformedSoFar"];class mN{constructor(e){this.pr=!1,this.gr=3e3,this.sr=[],this._instance=e,this.sr=[],this.mr=!0,!he(ne)&&"onLine"in ne.navigator&&(this.mr=ne.navigator.onLine,this.yr=()=>{this.mr=!0,this.br()},this._r=()=>{this.mr=!1},jt(ne,"online",this.yr),jt(ne,"offline",this._r))}get length(){return this.sr.length}retriableRequest(e){var n=e.retriesPerformedSoFar,r=p6(e,pN);$i(n)&&(r.url=l0(r.url,{retry_count:n})),this._instance._send_request(ue({},r,{callback:s=>{if(s.statusCode!==200&&(400>s.statusCode||s.statusCode>=500)){if((s.statusCode===0?3:10)>(n??0))return void this.Lt(ue({retriesPerformedSoFar:n},r));s.statusCode===0&&ve.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.")}r.callback==null||r.callback(s)}}))}Lt(e){var n=e.retriesPerformedSoFar||0;e.retriesPerformedSoFar=n+1;var r=(function(a){var u=3e3*Math.pow(2,a),c=u/2,d=Math.min(18e5,u),h=Math.random()-.5;return Math.ceil(d+h*(d-c))})(n),s=Date.now()+r;this.sr.push({retryAt:s,requestOptions:e});var i="Enqueued failed request for retry in "+r;navigator.onLine||(i+=" (Browser is offline)"),ve.warn(i),this.pr||(this.pr=!0,this.wr())}wr(){if(this.kr&&clearTimeout(this.kr),this.sr.length===0)return this.pr=!1,void(this.kr=void 0);this.kr=setTimeout((()=>{this.mr&&this.sr.length>0&&this.br(),this.wr()}),this.gr)}br(){var e=Date.now(),n=[],r=this.sr.filter((i=>e>i.retryAt||(n.push(i),!1)));if(this.sr=n,r.length>0)for(var s of r)this.retriableRequest(s.requestOptions)}unload(){for(var e of(this.kr&&(clearTimeout(this.kr),this.kr=void 0),this.pr=!1,he(ne)||(this.yr&&(ne.removeEventListener("online",this.yr),this.yr=void 0),this._r&&(ne.removeEventListener("offline",this._r),this._r=void 0)),this.sr)){var n=e.requestOptions;try{this._instance._send_request(ue({},n,{transport:"sendBeacon"}))}catch(r){ve.error(r)}}this.sr=[]}}class gN{constructor(e){this.Sr=()=>{var n,r,s,i;this.Cr||(this.Cr={});var a=this.scrollElement(),u=this.scrollY(),c=a?Math.max(0,a.scrollHeight-a.clientHeight):0,d=u+((a==null?void 0:a.clientHeight)||0),h=(a==null?void 0:a.scrollHeight)||0;this.Cr.lastScrollY=Math.ceil(u),this.Cr.maxScrollY=Math.max(u,(n=this.Cr.maxScrollY)!==null&&n!==void 0?n:0),this.Cr.maxScrollHeight=Math.max(c,(r=this.Cr.maxScrollHeight)!==null&&r!==void 0?r:0),this.Cr.lastContentY=d,this.Cr.maxContentY=Math.max(d,(s=this.Cr.maxContentY)!==null&&s!==void 0?s:0),this.Cr.maxContentHeight=Math.max(h,(i=this.Cr.maxContentHeight)!==null&&i!==void 0?i:0)},this._instance=e}get Mr(){return this._instance.config.scroll_root_selector}getContext(){return this.Cr}resetContext(){var e=this.Cr;return setTimeout(this.Sr,0),e}startMeasuringScrollPosition(){jt(ne,"scroll",this.Sr,{capture:!0}),jt(ne,"scrollend",this.Sr,{capture:!0}),jt(ne,"resize",this.Sr)}scrollElement(){if(!this.Mr)return ne==null?void 0:ne.document.documentElement;var e=Ze(this.Mr)?this.Mr:[this.Mr];for(var n of e){var r=ne==null?void 0:ne.document.querySelector(n);if(r)return r}}Tr(e){var n=e==="y"?"scrollTop":"scrollLeft";if(this.Mr){var r=this.scrollElement();return r&&r[n]||0}return ne?e==="y"?ne.scrollY||ne.pageYOffset||ne.document.documentElement.scrollTop||0:ne.scrollX||ne.pageXOffset||ne.document.documentElement.scrollLeft||0:0}scrollY(){return this.Tr("y")}scrollX(){return this.Tr("x")}}var vN=t=>kP(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);class iC{constructor(e,n,r,s){this.Er=i=>{var a=this.Ir();if(!a||a.sessionId!==i){var u={sessionId:i,props:this.Pr(this._instance)};this.Rr.register({[My]:u})}},this._instance=e,this.Ar=n,this.Rr=r,this.Pr=s||vN,this.Ar.onSessionId(this.Er)}Ir(){return this.Rr.props[My]}getSetOnceProps(){var e,n=(e=this.Ir())==null?void 0:e.props;return n?"r"in n?PP(n,this._instance.config.disable_capture_url_hashes):{$referring_domain:n.referringDomain,$pathname:n.initialPathName,utm_source:n.utm_source,utm_campaign:n.utm_campaign,utm_medium:n.utm_medium,utm_content:n.utm_content,utm_term:n.utm_term}:{}}getSessionProps(){var e={};return bt(O2(this.getSetOnceProps()),((n,r)=>{r==="$current_url"&&(r="url"),e["$session_entry_"+my(r)]=n})),e}}class $2{on(e,n){return this.Fr[e]||(this.Fr[e]=[]),this.Fr[e].push(n),()=>{this.Fr[e]=this.Fr[e].filter((r=>r!==n))}}emit(e,n){for(var r of this.Fr[e]||[])r(n);for(var s of this.Fr["*"]||[])s(e,n)}constructor(){this.Fr={}}}var uu=Mt("[SessionId]"),oC=864e5;class aC{on(e,n){return this.Lr.on(e,n)}constructor(e,n,r){var s;if(this.Or=null,this.Dr=[],this.$r=void 0,this.Nr=!1,this.Lr=new $2,this.qr=(c,d)=>!(!$i(c)||!$i(d))&&Math.abs(c-d)>this.sessionTimeoutMs,!e.persistence)throw new Error("SessionIdManager requires a PostHogPersistence instance");if(e.config.cookieless_mode===Zi)throw new Error('SessionIdManager cannot be used with cookieless_mode="always"');this.qe=e.config,this.Rr=e.persistence,this.jr=void 0,this.Br=void 0,this._sessionStartTimestamp=null,this.Hr=void 0,this._sessionActivityTimestamp=null,this.Ur=n||Wi,this.zr=r||Wi;var i=this.qe.persistence_name||this.qe.token;if(this._sessionTimeoutMs=1e3*di(this.qe.session_idle_timeout_seconds||1800,60,36e3,uu.createLogger("session_idle_timeout_seconds"),1800),e.register({$configured_session_timeout_ms:this._sessionTimeoutMs}),this.Wr(),this.Vr="ph_"+i+"_window_id",this.Zr="ph_"+i+"_primary_window_exists",this.Gr()){var a=Ut.H(this.Vr),u=Ut.H(this.Zr);a&&!u?this.jr=a:Ut.q(this.Vr),Ut.F(this.Zr,!0)}(s=this.qe.bootstrap)!=null&&s.sessionID&&this.setBootstrapSessionId(this.qe.bootstrap.sessionID),this.Qr()}get sessionTimeoutMs(){return this._sessionTimeoutMs}onSessionId(e){return he(this.Dr)&&(this.Dr=[]),this.Dr.push(e),this.Br&&e(this.Br,this.jr),()=>{this.Dr=this.Dr.filter((n=>n!==e))}}Gr(){return this.qe.persistence!=="memory"&&!this.Rr.Ei&&Ut.N()}Kr(e){e!==this.jr&&(this.jr=e,this.Gr()&&Ut.F(this.Vr,e))}Jr(){return this.jr?this.jr:this.Gr()?Ut.H(this.Vr):null}Yr(e){var n=this.Or;return!Tr(n)&&!Tr(e)&&5e3>Math.abs(e-n)}Xr(e,n,r){var s=n!==this._sessionActivityTimestamp,i=!(e!==this.Br||r!==this._sessionStartTimestamp);this._sessionStartTimestamp=r,this._sessionActivityTimestamp=n,this.Br=e,i&&!s||i&&this.Yr(n)||(this.Or=n,this.Rr.register({[xu]:[n,e,r]}))}tn(){var e,n=(e=this.qe)==null?void 0:e.persistence_save_debounce_ms;return $i(n)&&n>0}en(){this.tn()?this.Rr.refreshKey(xu):(this.Rr.flush(),this.Rr.load())}rn(){var e;if(!Tr(this._sessionActivityTimestamp)&&this._sessionActivityTimestamp!==this.Or){this.en();var n=this.nn();n[1]===this.Br&&n[2]===this._sessionStartTimestamp&&(this.Or=this._sessionActivityTimestamp,this.Rr.register({[xu]:[this._sessionActivityTimestamp,(e=this.Br)!==null&&e!==void 0?e:null,this._sessionStartTimestamp]}),this.Rr.flush())}}sn(){var e=this.nn()[0],n=$i(e)?e:0,r=$i(this._sessionActivityTimestamp)?this._sessionActivityTimestamp:0;return Math.max(n,r)}an(e){return this.en(),this.qr(e,this.sn())}nn(){var e=this.Rr.props[xu];return Ze(e)&&e.length===2&&e.push(e[0]),e||[0,null,0]}resetSessionId(){this.Or=null,this.Hr=void 0,clearTimeout(this.ln),this.ln=void 0,this.Xr(null,null,null)}setBootstrapSessionId(e,n){n===void 0&&(n=!1);var r=(function(s,i){i===void 0&&(i=new Date().getTime());try{var a=(u=>{var c=u.replace(/-/g,"");if(c.length!==32)throw new Error("Not a valid UUID");if(c[12]!=="7")throw new Error("Not a UUIDv7");return parseInt(c.substring(0,12),16)})(s);return a>i+6e4?void uu.error("Bootstrap sessionID cannot be in the future"):a}catch(u){return void uu.error("Invalid sessionID in bootstrap",u)}})(e);return!he(r)&&(n?this.Hr={sessionId:e,sessionStartTimestamp:r}:this.Xr(e,new Date().getTime(),r),!0)}destroy(){this.Nr=!0,this.rn(),clearTimeout(this.ln),this.ln=void 0,this.$r&&ne&&(ne.removeEventListener(xm,this.$r,{capture:!1}),this.$r=void 0),this.Dr=[]}Qr(){this.$r=()=>{this.rn(),this.Gr()&&Ut.q(this.Zr)},jt(ne,xm,this.$r,{capture:!1})}checkAndGetSessionAndWindowId(e,n){if(e===void 0&&(e=!1),n===void 0&&(n=null),this.qe.cookieless_mode===Zi)throw new Error('checkAndGetSessionAndWindowId should not be called with cookieless_mode="always"');var r=n||new Date().getTime(),s=this.nn(),i=s[1],a=s[2],u=this.sn(),c=this.Jr(),d=this.Hr,h=!!d&&(d.sessionStartTimestamp>r+6e4||r-d.sessionStartTimestamp>oC),p=d?h:$i(a)&&Math.abs(r-a)>oC,m=!1,_=!1,w=!i||!!d,y=i,x=!w&&!e&&this.qr(r,u);if(x){(x=this.an(r))||uu.info("cross-tab refresh kept the session alive",{sessionId:i});var S=this.nn();i=S[1],a=S[2]}if(w||x||p){var P=d&&!h;i=P?d.sessionId:this.Ur(),c=this.zr(),uu.info("new session ID assigned",{sessionId:i,windowId:c,bootstrapped:!!P,changeReason:{noSessionId:w,activityTimeout:x,sessionPastMaximumLength:p}}),a=P?d.sessionStartTimestamp:r,this.Hr=void 0,m=!0}else c||(c=this.zr(),m=!0),(_=i!==y)&&(uu.info("adopted cross-tab session id",{sessionId:i,windowId:c}),m=!0);var T=$i(u)&&e&&!p?u:r,k=$i(a)?a:new Date().getTime();this.Kr(c),this.Xr(i,T,k),e||this.Wr();var R={noSessionId:w,activityTimeout:x,sessionPastMaximumLength:p,crossTabAdoption:_};return m&&this.Dr.forEach((M=>M(i,c,R))),{sessionId:i,windowId:c,sessionStartTimestamp:k,changeReason:m?R:void 0,lastActivityTimestamp:u}}Wr(){this.Nr||(clearTimeout(this.ln),this.ln=setTimeout((()=>{if(!this.Nr)if(this.an(new Date().getTime())){var e=this.Br;this.resetSessionId(),this.Lr.emit("forcedIdleReset",{idleSessionId:e})}else this.Wr()}),1.1*this.sessionTimeoutMs))}}var HP=function(t,e){if(!t)return!1;var n=t.userAgent;if(n&&EE(n,e))return!0;try{var r=t==null?void 0:t.userAgentData;if(r!=null&&r.brands&&r.brands.some((s=>EE(s==null?void 0:s.brand,e))))return!0}catch{}return!!t.webdriver};function zP(){return(zP=St((function*(){var t=ar==null?void 0:ar.userAgentData;if(t!=null&&t.getHighEntropyValues)try{var e=yield t.getHighEntropyValues(["model"]),n=e==null?void 0:e.model;return ht(n)&&n.length>0?n:void 0}catch(r){return void ve.info("Unable to resolve $device_model from userAgentData.getHighEntropyValues",r)}}))).apply(this,arguments)}var Pm=function(t,e){if(!(function(n){try{new RegExp(n)}catch{return!1}return!0})(e))return!1;try{return new RegExp(e).test(t)}catch{return!1}};function Vv(t,e,n){return bu({distinct_id:t,userPropertiesToSet:e,userPropertiesToSetOnce:n})}var UP={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=>Pm(n,r))))),not_regex:(t,e)=>e.every((n=>t.every((r=>!Pm(n,r))))),icontains:(t,e)=>e.map(np).some((n=>t.map(np).some((r=>n.includes(r))))),not_icontains:(t,e)=>e.map(np).every((n=>t.map(np).every((r=>!n.includes(r))))),gt:(t,e)=>e.some((n=>{var r=parseFloat(n);return!isNaN(r)&&t.some((s=>r>parseFloat(s)))})),lt:(t,e)=>e.some((n=>{var r=parseFloat(n);return!isNaN(r)&&t.some((s=>r<parseFloat(s)))}))},np=t=>t.toLowerCase();function BP(t,e){return!t||Object.entries(t).every((n=>{var r=n[1],s=e==null?void 0:e[n[0]];if(he(s)||Tr(s))return!1;var i=[String(s)],a=UP[r.operator];return!!a&&a(r.values,i)}))}var qy="custom",lC="i.posthog.com",yN=/^\/static\//,_N=["/s/","/e/","/i/"];class wN{constructor(e){this.un={},this.instance=e}get apiHost(){var e=this.instance.config.api_host.trim().replace(/\/$/,"");return e==="https://app.posthog.com"?"https://us.i.posthog.com":e}get flagsApiHost(){var e=this.instance.config.flags_api_host;return e?e.trim().replace(/\/$/,""):this.apiHost}get uiHost(){var e,n=(e=this.instance.config.ui_host)==null?void 0:e.replace(/\/$/,"");return n||(n=this.apiHost.replace("."+lC,".posthog.com")),n==="https://app.posthog.com"?"https://us.posthog.com":n}get region(){return this.un[this.apiHost]||(this.un[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":qy),this.un[this.apiHost]}hn(e){if(yN.test(e)){var n=this.instance.config.asset_host;if(typeof n=="string")return n.trim().replace(/\/$/,"")||void 0}}dn(e){var n=tc(e);return n?n.protocol+"//"+n.host+n.pathname:void 0}vn(e,n,r){if(e==="ui")return r;var s=r,i=this.instance.config.rewriteRequestPath;if(i){var a,u=((a=tc(r))==null?void 0:a.href)||r;s=i(new URL(u)).toString()}if(i&&e==="api"&&_N.some((m=>n.indexOf(m)===0))){var c=this.dn(s);if(c){var d,h=this.apiHost,p=this.cn;((d=p)==null?void 0:d.apiHost)===h&&p.rewriteRequestPath===i||(p={apiHost:h,rewriteRequestPath:i,urls:new Set},this.cn=p),p.urls.add(c)}}return s}isIngestionEndpoint(e){var n=this.cn,r=this.dn(e);return(n==null?void 0:n.apiHost)===this.apiHost&&n.rewriteRequestPath===this.instance.config.rewriteRequestPath&&!!r&&n.urls.has(r)}endpointFor(e,n){if(n===void 0&&(n=""),n&&(n=n[0]==="/"?n:"/"+n),e==="ui")return this.vn(e,n,this.uiHost+n);if(e==="flags")return this.vn(e,n,this.flagsApiHost+n);if(e==="assets"){var r=this.hn(n);if(r)return this.vn(e,n,""+r+n)}if(this.region===qy)return this.vn(e,n,this.apiHost+n);var s=lC+n;switch(e){case"assets":return this.vn(e,n,"https://"+this.region+"-assets."+s);case"api":return this.vn(e,n,"https://"+this.region+"."+s)}}}function WP(t){var e;return!((e=t.conditions)==null||(e=e.events)==null||(e=e.values)==null||!e.length)}var vt=Mt("[Surveys]"),qP="seenSurvey_",GP=t=>{try{var e=(n=>((r,s)=>""+qP+(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(n){vt.error("Failed to persist survey seen state",n)}},xN=[Dv.Popover,Dv.Widget,Dv.API],bN={ignoreConditions:!1,ignoreDelay:!1,displayType:Vy.Popover},SN=Mt("[PostHog ExternalIntegrations]"),EN={intercom:"intercom-integration",crispChat:"crisp-chat-integration"};class CN{constructor(e){this._instance=e}di(e,n){var r;(r=Fe.__PosthogExtensions__)==null||r.loadExternalDependency==null||r.loadExternalDependency(this._instance,e,(s=>{if(s)return SN.error("failed to load script",s);n()}))}startIfEnabledOrStop(){var e=this,n=function(){var i,a,u,c=r[0],d=r[1];!d||(i=Fe.__PosthogExtensions__)!=null&&(i=i.integrations)!=null&&i[c]||e.di(EN[c],(()=>{var h;(h=Fe.__PosthogExtensions__)==null||(h=h.integrations)==null||(h=h[c])==null||h.start(e._instance)})),!d&&(a=Fe.__PosthogExtensions__)!=null&&(a=a.integrations)!=null&&a[c]&&((u=Fe.__PosthogExtensions__)==null||(u=u.integrations)==null||(u=u[c])==null||u.stop())};for(var r of Object.entries((s=this._instance.config.integrations)!==null&&s!==void 0?s:{})){var s;n()}}}class kN{constructor(e,n){this.st=e,this.fn=n,this.pn=new Map,this.gn=!1}add(e){var n=this;return St((function*(){if(n.gn)throw new Error("Cannot add an extension to a disposed ExtensionRuntime");if(n.pn.has(e.name))throw new Error('Browser extension "'+e.name+'" is already registered');n.pn.set(e.name,e);try{var r=e.setup(n.fn);r&&(yield r)}catch(i){var s=n.pn.get(e.name)===e;s&&n.pn.delete(e.name),n.st.error('Failed to set up browser extension "'+e.name+'"',i),s&&n.mn(e)}}))()}dispose(){if(!this.gn){this.gn=!0;var e=Array.from(this.pn.values()).reverse();for(var n of(this.pn.clear(),e))this.mn(n)}}mn(e){try{var n=e.dispose==null?void 0:e.dispose();n&&ir(n.then)&&n.then(void 0,(r=>{this.st.error('Failed to dispose browser extension "'+e.name+'"',r)}))}catch(r){this.st.error('Failed to dispose browser extension "'+e.name+'"',r)}}}class PN{constructor(e){this._instance=e}initialize(){}get(e){var n=this._instance.persistence;if(typeof e=="string")return n==null?void 0:n.get_property(e);var r={};for(var s of e){var i=n==null?void 0:n.get_property(s);he(i)||(r[s]=i)}return r}set(e,n){var r;(r=this._instance.persistence)==null||r.register(typeof e=="string"?{[e]:n}:e)}remove(e){var n;(n=this._instance.persistence)==null||n.unregister(e)}}var uC="extensionsRemoteConfig";class TN{constructor(e){this.gn=!1,this.instance=e,this.st=ve,this.yn=e.bn,this.kv=new PN(e),this.onEvent=n=>tp(this.instance.on("eventCaptured",(r=>{try{n({event:r.event,properties:r.properties})}catch(s){this.st.error("Browser extension event listener failed",s)}}))),this.onRemoteConfig=n=>{if(this.gn)return tp((()=>{}));var r=i=>{try{n(i)}catch(a){this.st.error("Browser extension remote config listener failed",a)}},s=this.instance._n.on(uC,r);return this.yn&&r(this.yn),tp(s)},this.wn=new kN(ve.createLogger("[BrowserExtensions]"),this)}get logger(){return this.st}get distinctId(){return this.instance.get_distinct_id()}get anonymousId(){var e;return(e=this.instance.get_property(Bd))!==null&&e!==void 0?e:this.distinctId}get deviceId(){var e=this.instance.get_property(Bd);return typeof e=="string"?e:void 0}get library(){return{name:xt.LIB_NAME,version:xt.LIB_VERSION}}get initialPersonProperties(){var e,n;return(e=(n=this.instance.persistence)==null?void 0:n.get_initial_props())!==null&&e!==void 0?e:{}}get groups(){return this.instance.getGroups()}get session(){try{var e,n,r,s,i=(e=this.instance.sessionManager)==null?void 0:e.checkAndGetSessionAndWindowId(!0);return{sessionId:(n=i==null?void 0:i.sessionId)!==null&&n!==void 0?n:"",windowId:(r=i==null?void 0:i.windowId)!==null&&r!==void 0?r:"",sessionStartTimestamp:(s=i==null?void 0:i.sessionStartTimestamp)!==null&&s!==void 0?s:0}}catch{return{sessionId:"",windowId:"",sessionStartTimestamp:0}}}get projectToken(){return this.instance.config.token}add(e){return this.wn.add(e)}capture(e,n,r){var s=this;return St((function*(){r?s.instance.capture(e,n,{timestamp:r.timestamp,uuid:r.uuid,$set:r.set,$set_once:r.setOnce}):s.instance.capture(e,n)}))()}registerDynamicEventProperties(e){return tp(this.instance.kn(e))}handleRemoteConfig(e){this.gn||(this.yn=e,this.instance._n.emit(uC,e))}sendRequest(e,n){var r=this;return St((function*(){var s;n===void 0&&(n={});var i=r.instance.requestRouter.endpointFor((s=n.target)!==null&&s!==void 0?s:"api",e),a={method:n.method,url:n.query?l0(i,n.query):i,data:n.body,headers:n.headers,timeout:n.timeoutMs,fireCallbackOnDrop:!0,transport:n.transport,compression:n.compression,timestampMode:n.sentAt};return n.transport==="sendBeacon"?(r.instance._send_request(a),{statusCode:202}):new Promise((u=>{a.callback=u,r.instance._send_request(a)}))}))()}dispose(){this.gn||(this.gn=!0,this.wn.dispose())}}var Rd={},Hv=0,Tm=()=>{},cC='Consent opt in/out is not valid with cookieless_mode="always" and will be ignored',id="Surveys module not available",dC="sanitize_properties is deprecated. Use before_send instead",KP="Invalid value for property_denylist config: ",RN=["token","distinct_id",tP],yu="posthog",ZP=!cN&&(Sr==null?void 0:Sr.indexOf("MSIE"))===-1&&(Sr==null?void 0:Sr.indexOf("Mozilla"))===-1,zv=t=>{var e;return ue({api_host:"https://us.i.posthog.com",flags_api_host:null,ui_host:null,asset_host:null,token:"",autocapture:!0,cross_subdomain_cookie:RD(_e==null?void 0:_e.location),persistence:"localStorage+cookie",persistence_name:"",cookie_persisted_properties:[],loaded:Tm,save_campaign_params:!0,custom_campaign_params:[],custom_blocked_useragents:[],save_referrer:!0,capture_pageleave:"if_capture_pageview",defaults:t??"unset",__preview_deferred_init_extensions:!1,__preview_external_dependency_versioned_paths:!1,__preview_cookie_wins_on_conflict:!1,debug:Nt&&ht(Nt==null?void 0:Nt.search)&&Nt.search.indexOf("__posthog_debug=true")!==-1||!1,cookie_expiration:365,upgrade:!1,disable_session_recording:!1,disable_persistence:!1,disable_web_experiments:!0,disable_surveys:!1,disable_surveys_automatic_display:!1,disable_conversations:!1,disable_product_tours:!1,disableDeviceModel:!1,disable_external_dependency_loading:!1,strict_script_versioning:"fallback",enable_recording_console_log:void 0,secure_cookie:(ne==null||(e=ne.location)==null?void 0:e.protocol)==="https:",ip:!1,opt_out_capturing_by_default:!1,opt_out_persistence_by_default:!1,opt_out_useragent_filter:!1,opt_out_capturing_persistence_type:"localStorage",consent_persistence_name:null,opt_out_capturing_cookie_prefix:null,opt_in_site_apps:!1,property_denylist:[],respect_dnt:!1,sanitize_properties:null,request_headers:{},request_batching:!0,properties_string_max_length:65535,mask_all_element_attributes:!1,mask_all_text:!1,mask_personal_data_properties:!1,custom_personal_data_properties:[],advanced_disable_flags:!1,advanced_disable_decide:!1,advanced_disable_feature_flags:!1,advanced_disable_feature_flags_on_first_load:!1,advanced_only_evaluate_survey_feature_flags:!1,advanced_feature_flags_dedup_per_session:!1,advanced_enable_surveys:!1,advanced_disable_toolbar_metrics:!1,feature_flag_request_timeout_ms:3e3,surveys_request_timeout_ms:1e4,on_request_error(n){ve.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:Ny,before_send:void 0,get_current_url:void 0,request_queue_config:{flush_interval_ms:Wy},error_tracking:{},_onCapture:Tm},(n=>({rageclick:n&&n>="2026-05-30"?{content_ignorelist:HD,ignore_text_selection:!0}:!n||"2025-11-30">n||{content_ignorelist:!0},capture_pageview:!n||"2025-05-24">n||"history_change",session_recording:n&&n>="2026-06-25"?{strictMinimumDuration:!0,canvasCapture:{resolutionScale:.6},streamNetworkBody:!0}:n&&n>="2026-05-30"?{strictMinimumDuration:!0,canvasCapture:{resolutionScale:.6}}:n&&n>="2025-11-30"?{strictMinimumDuration:!0}:{},external_scripts_inject_target:n&&n>="2026-01-30"?"head":"body",internal_or_test_user_hostname:n&&n>="2026-01-30"?/^(localhost|127\.0\.0\.1)$/:void 0,persistence_save_debounce_ms:n&&n>="2026-05-30"?250:0,split_storage:!(!n||"2026-05-30">n),detect_google_search_app:!(!n||"2026-05-30">n),disable_capture_url_hashes:!(!n||"2026-06-25">n)}))(t))},AN=[["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"]],fC=t=>{var e={};for(var n of AN){var r=n[0],s=n[1];he(t[r])||(e[s]=t[r])}var i=At({},e,t),a=t.__preview_external_dependency_versioned_paths;return he(a)||(he(t.strict_script_versioning)&&(i.strict_script_versioning=!!a),ht(a)&&he(t.asset_host)&&(i.asset_host=a)),Ze(t.property_blacklist)&&(he(t.property_denylist)?i.property_denylist=t.property_blacklist:Ze(t.property_denylist)?i.property_denylist=[...t.property_blacklist,...t.property_denylist]:ve.error(KP+t.property_denylist)),i};class IN{constructor(){this.__forceAllowLocalhost=!1}get xn(){return this.__forceAllowLocalhost}set xn(e){ve.error("WebPerformanceObserver is deprecated and has no impact on network capture. Use `_forceAllowLocalhostNetworkCapture` on `posthog.sessionRecording`"),this.__forceAllowLocalhost=e}}class qr{Sn(e,n){if(e){var r=this.pn.indexOf(e);r!==-1&&this.pn.splice(r,1)}return this.pn.push(n),n.initialize==null||n.initialize(),n}Cn(){return this.config.cookieless_mode===Zi||this.config.cookieless_mode===nl&&this.consent.isRejected()}get decideEndpointWasHit(){var e,n;return(e=(n=this.featureFlags)==null?void 0:n.hasLoadedFlags)!==null&&e!==void 0&&e}get flagsEndpointWasHit(){var e,n;return(e=(n=this.featureFlags)==null?void 0:n.hasLoadedFlags)!==null&&e!==void 0&&e}constructor(){var e;this.webPerformance=new IN,this.Mn=!1,this.version=xt.LIB_VERSION,this.Tn=new Set,this.En="",this._n=new $2,this.pn=[],this.In=[],this._calculate_event_properties=this.calculateEventProperties.bind(this),this.config=zv(),this.SentryIntegration=ZD,this.sentryIntegration=r=>(function(s,i){var a=_P(s,i);return{name:yP,processEvent:u=>a(u)}})(this,r),this.__request_queue=[],this.__loaded=!1,this.analyticsDefaultEndpoint="/e/",this.Pn=!1,this.Rn=null,this.An=null,this.Fn=null,this.scrollManager=new gN(this),this.pageViewManager=new YE(this),this.rateLimiter=new sN(this),this.requestRouter=new wN(this),this.consent=new ND(this),this.externalIntegrations=new CN(this);var n=(e=qr.__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)=>{var a=ht(r)?{[r]:s}:r;this.setPersonProperties(a),i==null||i({})},set_once:(r,s,i)=>{var a=ht(r)?{[r]:s}:r;this.setPersonProperties(void 0,a),i==null||i({})}},this.on("eventCaptured",(r=>ve.info('send "'+(r==null?void 0:r.event)+'"',r)))}init(e,n,r){if(r&&r!==yu){var s,i=(s=Rd[r])!==null&&s!==void 0?s:new qr;return i._init(e,n,r),Rd[r]=i,Rd[yu][r]=i,i}return this._init(e,n,r)}_init(e,n,r){var s,i;n===void 0&&(n={});var a,u=ht(e)?e.trim():"";if(!u)return ve.critical("PostHog was initialized without a token. This likely indicates a misconfiguration. Please check the first argument passed to posthog.init()"),this;if(this.__loaded)return u!==((a=this.config)==null?void 0:a.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('"+u+"', { ... }, 'project2')"):console.warn("[PostHog.js]","You have already initialized PostHog! Re-initializing is a no-op"),this;this.__loaded=!0,this.config=zv(n.defaults),n.debug=this.Ln(n.debug),this.On=n,this.Dn=[],n.person_profiles?this.An=n.person_profiles:n.process_person&&(this.An=n.process_person);var c=zv(n.defaults),d=fC(n),h=At({},c,d,{name:r,token:u});It(c.rageclick)&&It(d.rageclick)&&(h.rageclick=At({},c.rageclick,d.rageclick)),It(c.session_recording)&&It(d.session_recording)&&(h.session_recording=At({},c.session_recording,d.session_recording)),this.set_config(h),this.config.on_xhr_error&&ve.error("on_xhr_error is deprecated. Use on_request_error instead"),this.compression=n.disable_compression?void 0:or.GZipJS;var p=this.$n();if(this.persistence=new Lv(this.config,p),this.sessionPersistence=this.config.persistence==="sessionStorage"||this.config.persistence==="memory"?this.persistence:new Lv(ue({},this.config,{persistence:"sessionStorage"}),p,!1),this.En="ph_"+(this.config.persistence_name||this.config.token)+"_session_registered_properties",this.config.persistence!=="memory"&&!p&&Ut.N()){var m=Ut.H(this.En);Ze(m)&&m.forEach((M=>{ht(M)&&this.Tn.add(M)}))}else Ut.q(this.En);var _=ue({},this.persistence.props),w=ue({},this.sessionPersistence.props);this.register({$initialization_time:new Date().toISOString()}),this.Nn=new hN((M=>this.qn(M)),this.config.request_queue_config),this.jn=new mN(this),this.__request_queue=[];var y=this.Cn();if(y||(this.sessionManager=new aC(this),this.sessionPropsManager=new iC(this,this.sessionManager,this.persistence),this.sessionManager.onSessionId(((M,L,A)=>{(A!=null&&A.activityTimeout||A!=null&&A.sessionPastMaximumLength||A!=null&&A.crossTabAdoption)&&this.Bn()}))),this.Hn(),this.config.__preview_deferred_init_extensions?(ve.info("Deferring extension initialization to improve startup performance"),setTimeout((()=>{this.Un(y)}),0)):(ve.info("Initializing extensions synchronously"),this.Un(y)),xt.DEBUG=xt.DEBUG||this.config.debug,xt.DEBUG&&ve.info("Starting in debug mode",{this:this,config:n,thisC:ue({},this.config),p:_,s:w}),!this.config.identity_distinct_id||(s=n.bootstrap)!=null&&s.distinctID||(n.bootstrap=ue({},n.bootstrap,{distinctID:this.config.identity_distinct_id,isIdentifiedID:!0})),((i=n.bootstrap)==null?void 0:i.distinctID)!==void 0){var x=n.bootstrap.distinctID,S=this.get_distinct_id(),P=this.persistence.get_property(zr);if(n.bootstrap.isIdentifiedID&&S!=null&&S!==x&&P===Fa)this.identify(x);else if(n.bootstrap.isIdentifiedID&&S!=null&&S!==x&&P===Fo)ve.warn("Bootstrap distinctID differs from an already-identified user. The existing identity is preserved. Call reset() before reinitializing if you intend to switch users.");else{var T=this.config.get_device_id(Wi()),k=n.bootstrap.isIdentifiedID?T:x;this.persistence.set_property(zr,n.bootstrap.isIdentifiedID?Fo:Fa),this.register({distinct_id:x,$device_id:k})}}if(y)this.register_once({distinct_id:Yh,$device_id:null},"");else if(!this.get_distinct_id()){var R=this.config.get_device_id(Wi());this.register_once({distinct_id:R,$device_id:R},""),this.persistence.set_property(zr,Fa)}return jt(ne,"onpagehide"in self?"pagehide":"unload",this._handle_unload.bind(this),{passive:!1}),n.segment?(function(M,L){var A=M.config.segment;if(!A)return L();(function(O,D){var N=O.config.segment;if(!N)return D();var j=Y=>{var W=()=>Y.anonymousId()||Wi();O.config.get_device_id=W,Y.id()&&(O.register({distinct_id:Y.id(),$device_id:W()}),O.persistence.set_property(zr,Fo)),D()},G=N.user();"then"in G&&ir(G.then)?G.then(j):j(G)})(M,(()=>{A.register((O=>{typeof Promise<"u"&&Promise.resolve||Mv.warn("This browser does not have Promise support, and can not use the segment integration");var D=(N,j)=>{if(!j)return N;N.event.userId||N.event.anonymousId===O.get_distinct_id()||(Mv.info("No userId set, resetting PostHog"),O.reset()),N.event.userId&&N.event.userId!==O.get_distinct_id()&&(Mv.info("UserId set, identifying with PostHog"),O.identify(N.event.userId));var G=O.calculateEventProperties(j,N.event.properties);return N.event.properties=Object.assign({},G,N.event.properties),N};return{name:"PostHog JS",type:"enrichment",version:"1.0.0",isLoaded:()=>!0,load:()=>Promise.resolve(),track:N=>D(N,N.event.event),page:N=>D(N,vu),identify:N=>D(N,Rv),screen:N=>D(N,"$screen")}})(M)).then((()=>{L()}))}))})(this,(()=>this.zn())):this.zn(),ir(this.config._onCapture)&&this.config._onCapture!==Tm&&(ve.warn("onCapture is deprecated. Please use `before_send` instead"),this.on("eventCaptured",(M=>this.config._onCapture(M.event,M)))),this.config.ip&&ve.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 zP.apply(this,arguments)})().then((M=>{M&&this.register({[Pv]:M})})).catch(Tm),this}Hn(){var e,n,r,s,i,a,u=(e=(n=this.config.__extensionClasses)==null?void 0:n.featureFlags)!==null&&e!==void 0?e:(r=qr.__defaultExtensionClasses)==null?void 0:r.featureFlags;u&&(this.featureFlags&&this.featureFlags instanceof u||((s=this.Wn)==null||s.call(this),this.Wn=void 0,this.featureFlags=new u(this)),ir(this.featureFlags.onReloading)&&ir(this.featureFlags.setup)?this.Wn||(this.Wn=this.featureFlags.onReloading((()=>{this._n.emit("featureFlagsReloading",!0)})),this.Vn().add(this.featureFlags)):(i=(a=this.featureFlags).initialize)==null||i.call(a))}Un(e){var n,r,s,i,a,u,c,d=performance.now(),h=ue({},qr.__defaultExtensionClasses,this.config.__extensionClasses),p=[];h.exceptions&&this.pn.push(this.exceptions=(n=this.exceptions)!==null&&n!==void 0?n:new h.exceptions(this)),h.historyAutocapture&&this.pn.push(this.historyAutocapture=new h.historyAutocapture(this)),h.tracingHeaders&&this.pn.push(this.tracingHeaders=new h.tracingHeaders(this)),h.siteApps&&this.pn.push(this.siteApps=new h.siteApps(this)),h.sessionRecording&&!e&&this.pn.push(this.sessionRecording=new h.sessionRecording(this)),this.config.disable_scroll_properties||p.push((()=>{this.scrollManager.startMeasuringScrollPosition()})),h.autocapture&&this.pn.push(this.autocapture=new h.autocapture(this)),h.surveys&&this.pn.push(this.surveys=(r=this.surveys)!==null&&r!==void 0?r:new h.surveys(this)),h.logs&&this.pn.push(this.logs=(s=this.logs)!==null&&s!==void 0?s:new h.logs(this)),h.metrics&&this.pn.push(this.metrics=(i=this.metrics)!==null&&i!==void 0?i:new h.metrics(this)),h.conversations&&this.pn.push(this.conversations=(a=this.conversations)!==null&&a!==void 0?a:new h.conversations(this)),h.productTours&&this.pn.push(this.productTours=new h.productTours(this)),h.heatmaps&&this.pn.push(this.heatmaps=new h.heatmaps(this)),h.webVitalsAutocapture&&this.pn.push(this.webVitalsAutocapture=new h.webVitalsAutocapture(this)),h.exceptionObserver&&this.pn.push(this.exceptionObserver=new h.exceptionObserver(this)),h.deadClicksAutocapture&&this.pn.push(this.deadClicksAutocapture=new h.deadClicksAutocapture(this,KD)),h.toolbar&&this.pn.push(this.toolbar=(u=this.toolbar)!==null&&u!==void 0?u:new h.toolbar(this)),h.experiments&&this.pn.push(this.experiments=(c=this.experiments)!==null&&c!==void 0?c:new h.experiments(this)),this.pn.forEach((m=>{m.initialize&&p.push((()=>{m.initialize==null||m.initialize()}))})),p.push((()=>{if(this.Zn){var m=this.Zn;this.Zn=void 0,this.pn.forEach((_=>_.onRemoteConfig==null?void 0:_.onRemoteConfig(m)))}})),this.Gn(p,d)}Gn(e,n){for(;e.length>0;){if(this.config.__preview_deferred_init_extensions&&performance.now()-n>=30&&e.length>0)return void setTimeout((()=>{this.Gn(e,n)}),0);var r=e.shift();if(r)try{r()}catch(i){ve.error("Error initializing extension:",i)}}var s=Math.round(performance.now()-n);this.register_for_session({[nP]:this.config.__preview_deferred_init_extensions?"deferred":"synchronous",[rP]:s}),this.config.__preview_deferred_init_extensions&&ve.info("PostHog extensions initialized ("+s+"ms)")}Yi(e){var n;if(!_e||!_e.body)return ve.info("document not ready yet, trying again in 500 milliseconds..."),void setTimeout((()=>{this.Yi(e)}),500);if(this.config.__preview_deferred_init_extensions&&(this.Zn=e),this.bn=e,this.compression=void 0,e.ok){var r,s=e.config;s.supportedCompression&&!this.config.disable_compression&&(this.compression=Ke(s.supportedCompression,or.GZipJS)?or.GZipJS:Ke(s.supportedCompression,or.Base64)?or.Base64:void 0),(r=s.analytics)!=null&&r.endpoint&&(this.analyticsDefaultEndpoint=s.analytics.endpoint)}this.set_config({person_profiles:this.An?this.An:Ny}),(n=this.Qn)==null||n.handleRemoteConfig(e),this.pn.forEach((i=>i.onRemoteConfig==null?void 0:i.onRemoteConfig(e)))}zn(){try{this.config.loaded(this)}catch(r){ve.critical("`loaded` function failed",r)}if(this.Kn(),this.config.internal_or_test_user_hostname&&Nt!=null&&Nt.hostname){var e=Nt.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.Cn())&&this.Jn()}),1),this.Yn=new RP(this),this.Yn.load()}Kn(){var e;this.is_capturing()&&this.config.request_batching&&((e=this.Nn)==null||e.enable())}_dom_loaded(){this.is_capturing()&&Xh(this.__request_queue,(e=>this.qn(e))),this.__request_queue=[],this.Kn()}_handle_unload(){var e,n,r,s,i;(e=this.surveys)==null||e.handlePageUnload==null||e.handlePageUnload(),(n=this.metrics)==null||n.flush("sendBeacon"),this.config.request_batching?(this.Xn()&&this.capture(Tv),(r=this.logs)==null||r.flushLogs("sendBeacon"),(s=this.Nn)==null||s.unload(),(i=this.jn)==null||i.unload()):this.Xn()&&this.capture(Tv,null,{transport:"sendBeacon"})}_send_request(e){this.__loaded?ZP?this.__request_queue.push(e):this.rateLimiter.isServerRateLimited(e.batchKey)?e.fireCallbackOnDrop&&(e.callback==null||e.callback({statusCode:429})):(e.transport=e.transport||this.config.api_transport,e.headers=ue({},this.config.request_headers,e.headers),e.compression=e.compression==="best-available"?this.compression:e.compression,(he(this.config.disable_beacon)?this.config.__preview_disable_beacon:this.config.disable_beacon)&&(e.disableTransport=["sendBeacon"]),e.fetchOptions=e.fetchOptions||this.config.fetch_options,(n=>{var r,s,i,a=ue({},n);a.timeout=a.timeout||6e4;var u,c,d,h,p,m=(r=a.transport)!==null&&r!==void 0?r:"fetch";m==="sendBeacon"&&he(a.compression)&&a.data&&(a.compression=or.Base64),a.method==="POST"&&a.data&&(a.timestampMode==="capture-body"?a.data={api_key:(c=(p=(h=(Ze(u=a.data)?u:[u]).map((x=>ue({},x,x.timestamp instanceof Date&&!isNaN(x.timestamp.getTime())?{timestamp:x.timestamp.toISOString()}:{}))))[0])==null||(d=p.properties)==null?void 0:d.token)!==null&&c!==void 0?c:p==null?void 0:p.token,batch:h,sent_at:new Date().toISOString()}:a.timestampMode==="body"&&(a.data=(function(x,S){return S===void 0&&(S=new Date().toISOString()),Ze(x)?x.map((P=>ue({},P,{sent_at:S}))):ue({},x,{sent_at:S})})(a.data))),a.url=sC(a.url,a.method,a.compression,a.timestampMode);var _=Np.filter((x=>!a.disableTransport||!x.transport||!a.disableTransport.includes(x.transport))),w=(s=(i=(function(x,S){for(var P=0;x.length>P;P++)if(x[P].transport===m)return x[P]})(_))==null?void 0:i.method)!==null&&s!==void 0?s:_[0].method;if(!w)throw new Error("No available transport method");var y=x=>{try{w(x)}catch(S){$P(S)?ve.warn(S):ve.error(S),a.callback==null||a.callback({statusCode:0,error:S})}};m!=="sendBeacon"&&a.data&&a.compression===or.GZipJS&&IL&&typeof Promise<"u"&&!Dp?dN(a).then((x=>{y(x)})).catch((x=>{if(SE(x))return Dp=!0,void y(ue({},a,{compression:void 0,url:sC(n.url,n.method,void 0,n.timestampMode)}));(S=>{if(!S||typeof S!="object")return!1;var P="name"in S?String(S.name):"";return SE(S)||P===m6})(x)&&(Dp=!0),y(a)})):w(a)})(ue({},e,{callback:n=>{var r,s;this.rateLimiter.checkForLimiting(n),400>n.statusCode||(r=(s=this.config).on_request_error)==null||r.call(s,n),e.callback==null||e.callback(n)}}))):e.fireCallbackOnDrop&&(e.callback==null||e.callback({statusCode:0}))}qn(e){this.jn?this.jn.retriableRequest(e):this._send_request(e)}_execute_array(e){Hv++;try{var n,r=[],s=[],i=[];Xh(e,(u=>{if(u)if(Ze(n=u[0]))i.push(u);else if(ir(u))try{u.call(this)}catch(c){ve.error("Error executing queued PostHog call",u,c)}else Ze(u)&&n==="alias"?r.push(u):Ze(u)&&n.indexOf("capture")!==-1&&ir(this[n])?i.push(u):s.push(u)}));var a=function(u,c){Xh(u,(function(d){try{if(Ze(d[0])){var h=c;bt(d,(function(p){h=h[p[0]].apply(h,p.slice(1))}))}else c[d[0]].apply(c,d.slice(1))}catch(p){ve.error("Error executing queued PostHog call",d,p)}}))};a(r,this),a(s,this),a(i,this)}finally{Hv--}}push(e){if(Hv>0&&Ze(e)&&ht(e[0])){var n=qr.prototype[e[0]];ir(n)&&n.apply(this,e.slice(1))}else this._execute_array([e])}capture(e,n,r){var s,i,a,u,c;if(this.__loaded&&this.persistence&&this.sessionPersistence&&this.Nn){if(this.is_capturing())if(!he(e)&&ht(e)){var d=!this.config.opt_out_useragent_filter&&this._is_bot();if(!d||this.config.__preview_capture_bot_pageviews){var h=r!=null&&r.skip_client_rate_limiting?void 0:this.rateLimiter.clientRateLimitContext();if(h==null||!h.isRateLimited){n!=null&&n.$current_url&&!ht(n==null?void 0:n.$current_url)&&(ve.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.ts||ve.warn("Using `posthog.capture('$exception')` is unreliable because it does not attach required metadata. Use `posthog.captureException(error)` instead, which attaches required metadata automatically."),this.sessionPersistence.update_search_keyword(),this.config.save_campaign_params&&this.sessionPersistence.update_campaign_params(),this.config.save_referrer&&this.sessionPersistence.update_referrer_info(),(this.config.save_campaign_params||this.config.save_referrer)&&this.persistence.set_initial_person_info();var p=new Date,m=(r==null?void 0:r.timestamp)||p,_=TE(r==null?void 0:r.uuid,Wi),w={uuid:_,event:e,properties:this.calculateEventProperties(e,n||{},m,_)};e===vu&&this.config.__preview_capture_bot_pageviews&&d&&(w.event="$bot_pageview",w.properties.$browser_type="bot"),h&&(w.properties.$lib_rate_limit_remaining_tokens=h.remainingTokens);var y=e==="$feature_flag_called"&&w.properties.$feature_flag_has_experiment===!1&&this.get_property(gm)===!0;r!=null&&r.$set&&!y&&(w.$set=r==null?void 0:r.$set);var x=r==null?void 0:r.$unset;x&&(w.$unset=x);var S,P,T,k=y?void 0:this.es(r==null?void 0:r.$set_once,e!==DE,e===Rv);if(k&&(w.$set_once=k),r!=null&&r._noTruncate||(i=this.config.properties_string_max_length,a=w,u=j=>ht(j)?j.slice(0,i):j,c=new Set,w=(function j(G,Y){if(G!==Object(G))return u?u(G):G;if(!c.has(G)){var W;if(c.add(G),Ze(G))W=[],Xh(G,(Z=>{W.push(j(Z))}));else{var q={};bt(G,((Z,V)=>{c.has(Z)||(q[V]=j(Z))})),W=q}return W}})(a)),w.timestamp=m,he(r==null?void 0:r.timestamp)||(w.properties.$event_time_override_provided=!0,w.properties.$event_time_override_system_time=p),y&&(w.properties=(function(j,G){G===void 0&&(G=[]);var Y={},W=q=>{j[q]!==void 0&&(Y[q]=j[q])};return ML.forEach(W),G.forEach(W),Y})(w.properties,RN)),e===Xi.DISMISSED||e===Xi.SENT){var R=n==null?void 0:n[Nv.SURVEY_ID],M=n==null?void 0:n[Nv.SURVEY_ITERATION];GP({id:R,current_iteration:M}),w.$set=ue({},w.$set,{[(S={id:R,current_iteration:M},P=e===Xi.SENT?"responded":"dismissed",T="$survey_"+P+"/"+S.id,S.current_iteration&&S.current_iteration>0&&(T="$survey_"+P+"/"+S.id+"/"+S.current_iteration),T)]:!0})}else e===Xi.SHOWN&&(w.$set=ue({},w.$set,{[Nv.SURVEY_LAST_SEEN_DATE]:new Date().toISOString()}));if(e===rN.SHOWN){var L=n==null?void 0:n[QE.TOUR_TYPE];L&&(w.$set=ue({},w.$set,{[QE.TOUR_LAST_SEEN_DATE+"/"+L]:new Date().toISOString()}))}var A=ue({},w.properties.$set,w.$set);if(eo(A)||this.setPersonPropertiesForFlags(A),!Qe(this.config.before_send)){var O=this.At(w);if(!O)return;(w=O).uuid=TE(w.uuid,Wi)}this._n.emit("eventCaptured",w);var D=(s=r==null?void 0:r._url)!==null&&s!==void 0?s:this.requestRouter.endpointFor("api",this.analyticsDefaultEndpoint),N={method:"POST",url:D,data:w,compression:"best-available",timestampMode:(r==null?void 0:r._batchKey)==="recordings"||/\/s\/(?:\?|$)/.test(D)?"body":"capture-body",batchKey:r==null?void 0:r._batchKey,transport:r==null?void 0:r.transport};return!this.config.request_batching||r&&(r==null||!r._batchKey)||r!=null&&r.send_instantly?this.qn(N):this.Nn.enqueue(N),w}ve.critical("This capture call is ignored due to client rate limiting.")}}else ve.error("No event name provided to posthog.capture")}else ve.uninitializedWarning("posthog.capture")}_addCaptureHook(e){return this.on("eventCaptured",(n=>e(n.event,n)))}Vn(){var e;return(e=this.Qn)!==null&&e!==void 0?e:this.Qn=new TN(this)}kn(e){this.In.push(e);var n=!0;return()=>{if(n){n=!1;var r=this.In.indexOf(e);r!==-1&&this.In.splice(r,1)}}}calculateEventProperties(e,n,r,s,i){if(r=r||new Date,!this.persistence||!this.sessionPersistence)return n;var a=i?void 0:this.persistence.remove_event_timer(e),u=ue({},n);if(u.token=this.config.token,u.$config_defaults=this.config.defaults,this.Cn()&&(u[tP]=!0),e==="$snapshot"){var c=ue({},this.persistence.properties(),this.sessionPersistence.properties());return u.distinct_id=c.distinct_id,(!ht(u.distinct_id)&&!sn(u.distinct_id)||gy(u.distinct_id))&&ve.error("Invalid distinct_id for replay event. This indicates a bug in your implementation"),u}var d,h=(function(R,M,L,A){var O,D,N,j;if(A===void 0&&(A=!1),!Sr)return{};var G,Y=R?[...rc,...M||[]]:[],W=(function(Qt){for(var be=0;kE.length>be;be++){var Ve=kE[be],qe=Ve[1],tt=Ve[0].exec(Qt),_t=tt&&(ir(qe)?qe(tt,Qt):qe);if(_t)return _t}return["",""]})(Sr),q=W[0],Z=W[1],V=(G=typeof navigator<"u"?navigator:void 0)!=null&&G.brave?{brave:!0}:{},J={};he(L)||(J.detectGoogleSearchApp=L);var H={},F=(O=navigator)==null||(O=O.userAgentData)==null?void 0:O.platform,X=(D=navigator)==null?void 0:D.maxTouchPoints,oe=ne==null||(N=ne.screen)==null?void 0:N.width,se=ne==null||(j=ne.screen)==null?void 0:j.height,ee=ne==null?void 0:ne.devicePixelRatio;he(F)||(H.userAgentDataPlatform=F),he(X)||(H.maxTouchPoints=X),he(oe)||(H.screenWidth=oe),he(se)||(H.screenHeight=se),he(ee)||(H.devicePixelRatio=ee);var ce,we,le,ie,Ne,Be,Pe,$e,dt=At(O2({$os:q,$os_version:Z,$browser:V6(Sr,navigator.vendor,V,J),$device:PE(Sr),$device_type:(we=Sr,le=H,$e=PE(we),$e===b6||$e===x6||$e==="Kobo"||$e==="Kindle Fire"||$e===D6?Qu:$e===zd||$e===Ru||$e===Ud||$e===yy?"Console":$e===E6?"Wearable":$e?Jr:(le==null?void 0:le.userAgentDataPlatform)==="Android"&&((ie=le==null?void 0:le.maxTouchPoints)!==null&&ie!==void 0?ie:0)>0?600>Math.min((Ne=le==null?void 0:le.screenWidth)!==null&&Ne!==void 0?Ne:0,(Be=le==null?void 0:le.screenHeight)!==null&&Be!==void 0?Be:0)/((Pe=le==null?void 0:le.devicePixelRatio)!==null&&Pe!==void 0?Pe:1)?Jr:Qu:"Desktop"),$timezone:TP(),$timezone_offset:eN()}),{$current_url:qd(A?oa(Nt==null?void 0:Nt.href):Nt==null?void 0:Nt.href,Y,Gd),$host:Nt==null?void 0:Nt.host,$pathname:Nt==null?void 0:Nt.pathname,$raw_user_agent:Sr.length>1e3?Sr.substring(0,997)+"...":Sr,$browser_version:XL(Sr,navigator.vendor,V,J),$browser_language:XE(),$browser_language_prefix:(ce=XE(),typeof ce=="string"?ce.split("-")[0]:void 0),$screen_height:ne==null?void 0:ne.screen.height,$screen_width:ne==null?void 0:ne.screen.width,$viewport_height:ne==null?void 0:ne.innerHeight,$viewport_width:ne==null?void 0:ne.innerWidth,$lib:xt.LIB_NAME,$lib_version:xt.LIB_VERSION,$insert_id:Math.random().toString(36).substring(2,10)+Math.random().toString(36).substring(2,10),$time:Date.now()/1e3});return xt.SDK_DIST_CHANNEL&&(dt.$sdk_dist_channel=xt.SDK_DIST_CHANNEL),dt})(this.config.mask_personal_data_properties,this.config.custom_personal_data_properties,this.config.detect_google_search_app,this.config.disable_capture_url_hashes);if(this.sessionManager){var p=this.sessionManager.checkAndGetSessionAndWindowId(i,r.getTime()),m=p.windowId;u.$session_id=p.sessionId,u.$window_id=m}this.sessionPropsManager&&At(u,this.sessionPropsManager.getSessionProps());try{var _;this.sessionRecording&&At(u,this.sessionRecording.sdkDebugProperties),u.$sdk_debug_retry_queue_size=(_=this.jn)==null?void 0:_.length}catch(R){u.$sdk_debug_error_capturing_properties=String(R)}if(this.requestRouter.region===qy&&(u.$lib_custom_api_host=this.config.api_host),d=e!==vu||i?e!==Tv||i?this.pageViewManager.doEvent():this.pageViewManager.doPageLeave(r):this.pageViewManager.doPageView(r,s),u=At(u,d),e===vu&&_e&&(u.title=_e.title),!he(a)){var w=r.getTime()-a;u.$duration=parseFloat((w/1e3).toFixed(3))}Sr&&this.config.opt_out_useragent_filter&&(u.$browser_type=this._is_bot()?"bot":"browser");var y=this.persistence.properties(),x=this.sessionPersistence.properties();bt(["$referrer","$referring_domain"],(R=>{R in y&&delete x[R]}));var S={};if(this.In.length>0)for(var P of this.In.slice())try{At(S,P())}catch(R){ve.error("Failed to produce browser extension event properties",R)}(u=At({},h,y,x,ue({},S,u))).$is_identified=this._isIdentified(),Ze(this.config.property_denylist)?bt(this.config.property_denylist,(function(R){delete u[R]})):ve.error(KP+this.config.property_denylist+" or property_blacklist config: "+this.config.property_blacklist);var T=this.config.sanitize_properties;T&&(ve.error(dC),u=T(u,e));var k=this.rs();return u.$process_person_profile=k,k&&!i&&this.ns("_calculate_event_properties"),u}es(e,n,r){var s;if(n===void 0&&(n=!0),r===void 0&&(r=!1),!this.persistence||!this.rs()||this.Mn&&!r)return e;var i=this.persistence.get_initial_props(),a=(s=this.sessionPropsManager)==null?void 0:s.getSetOnceProps(),u=At({},i,a||{},e||{}),c=this.config.sanitize_properties;return c&&(ve.error(dC),u=c(u,"$set_once")),n&&(this.Mn=!0),eo(u)?void 0:u}register(e,n){var r;(r=this.persistence)==null||r.register(e,n)}register_once(e,n,r){var s;(s=this.persistence)==null||s.register_once(e,n,r)}register_for_session(e){var n;(n=this.sessionPersistence)==null||n.register(e),Object.keys(e).forEach((r=>this.Tn.add(r))),this.ss()}unregister(e){var n;(n=this.persistence)==null||n.unregister(e)}unregister_for_session(e){var n;(n=this.sessionPersistence)==null||n.unregister(e),this.Tn.delete(e),this.ss()}os(e,n){this.register({[e]:n})}Bn(){this.Tn.forEach((e=>{var n;(n=this.sessionPersistence)==null||n.unregister(e)})),this.Tn.clear(),this.ss()}ss(){var e;if(this.En)if(this.config.persistence==="memory"||(e=this.sessionPersistence)!=null&&e.Ei||!Ut.N())Ut.q(this.En);else{var n=[];this.Tn.forEach((r=>n.push(r))),n.length>0?Ut.F(this.En,n):Ut.q(this.En)}}getFeatureFlag(e,n){var r;return(r=this.featureFlags)==null?void 0:r.getFeatureFlag(e,n)}getFeatureFlagPayload(e){var n;return(n=this.featureFlags)==null?void 0:n.getFeatureFlagPayload(e)}getFeatureFlagResult(e,n){var r;return(r=this.featureFlags)==null?void 0:r.getFeatureFlagResult(e,n)}getAllFeatureFlags(){var e,n;return(e=(n=this.featureFlags)==null?void 0:n.getAllFeatureFlags())!==null&&e!==void 0?e:[]}isFeatureEnabled(e,n){var r,s;return(r=(s=this.featureFlags)==null?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.reloadFeatureFlags()}updateFlags(e,n,r){var s;(s=this.featureFlags)==null||s.updateFlags(e,n,r)}updateEarlyAccessFeatureEnrollment(e,n,r){var s;(s=this.featureFlags)==null||s.updateEarlyAccessFeatureEnrollment(e,n,r)}getEarlyAccessFeatures(e,n,r){var s;return n===void 0&&(n=!1),(s=this.featureFlags)==null?void 0:s.getEarlyAccessFeatures(e,n,r)}on(e,n){return this._n.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:id}),()=>{})}onSessionId(e){var n,r;return(n=(r=this.sessionManager)==null?void 0:r.onSessionId(e))!==null&&n!==void 0?n:()=>{}}getSurveys(e,n){n===void 0&&(n=!1),this.surveys?this.surveys.getSurveys(e,n):e([],{isLoaded:!1,error:id})}getActiveMatchingSurveys(e,n){n===void 0&&(n=!1),this.surveys?this.surveys.getActiveMatchingSurveys(e,n):e([],{isLoaded:!1,error:id})}renderSurvey(e,n){var r;(r=this.surveys)==null||r.renderSurvey(e,n)}displaySurvey(e,n){var r;n===void 0&&(n=bN),(r=this.surveys)==null||r.displaySurvey(e,n)}cancelPendingSurvey(e){var n;(n=this.surveys)==null||n.cancelPendingSurvey(e)}canRenderSurvey(e){var n,r;return(n=(r=this.surveys)==null?void 0:r.canRenderSurvey(e))!==null&&n!==void 0?n:{visible:!1,disabledReason:id}}canRenderSurveyAsync(e,n){var r,s;return n===void 0&&(n=!1),(r=(s=this.surveys)==null?void 0:s.canRenderSurveyAsync(e,n))!==null&&r!==void 0?r:Promise.resolve({visible:!1,disabledReason:id})}ls(e){return!e||gy(e)?(ve.critical("Unique user id has not been set in posthog.identify"),!1):e===Yh?(ve.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())||(ve.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 ve.uninitializedWarning("posthog.identify");if(sn(e)&&(e=e.toString(),ve.warn("The first argument to posthog.identify was a number, but it should be a string. It has been converted to a string.")),this.ls(e)&&this.ns("posthog.identify")){var s=this.get_distinct_id();this.register({$user_id:e}),this.get_property(Bd)||this.register_once({$had_persisted_distinct_id:!0,$device_id:s},""),e!==s&&e!==this.get_property(md)&&(this.unregister(md),this.register({distinct_id:e}));var i,a=(this.persistence.get_property(zr)||Fa)===Fa,u=e!==s,c=!u&&a;if(u&&a)this.persistence.set_property(zr,Fo),this.setPersonPropertiesForFlags({$set:n||{},$set_once:r||{}},!1),this.capture(Rv,{distinct_id:e,$anon_distinct_id:s},{$set:n||{},$set_once:r||{}}),this.Fn=Vv(e,n,r),(i=this.featureFlags)==null||i.setAnonymousDistinctId(s);else if(c){this.persistence.set_property(zr,Fo);var d=n||{},h=r||{};this.setPersonPropertiesForFlags({$set:d,$set_once:h},!1),this.capture("$set",{$set:d,$set_once:h}),this.Fn=Vv(e,n,r)}else(n||r)&&this.setPersonProperties(n,r);u?(this.reloadFeatureFlags(),this.featureFlags?this.featureFlags.resetFlagCallReported():this.unregister(il)):c&&(n||r)&&this.reloadFeatureFlags()}}setPersonProperties(e,n){if((e||n)&&this.ns("posthog.setPersonProperties")){var r=Vv(this.get_distinct_id(),e,n);this.Fn!==r?(this.setPersonPropertiesForFlags({$set:e||{},$set_once:n||{}},!0),this.capture("$set",{$set:e||{},$set_once:n||{}}),this.Fn=r):ve.info("A duplicate setPersonProperties call was made with the same properties. It has been ignored.")}}unsetPersonProperties(e){var n,r=(Ze(e)?e:[e]).filter((s=>ht(s)&&s.length>0));r.length!==0&&this.ns("posthog.unsetPersonProperties")&&((n=this.featureFlags)==null||n.unsetPersonPropertiesForFlags(r,!0),this.capture("$set",{$unset:r}),this.Fn=null)}group(e,n,r){if(e&&n){var s=this.getGroups(),i=s[e]!==n;if(i&&this.resetGroupPropertiesForFlags(e),this.register({$groups:ue({},s,{[e]:n})}),i||r){var a={$group_type:e,$group_key:n};r&&(a.$group_set=r),this.capture(DE,a)}r&&this.setGroupPropertiesForFlags({[e]:r}),i&&!r&&this.reloadFeatureFlags()}else ve.error("posthog.group requires a group type and group key")}resetGroups(){this.register({$groups:{}}),this.resetGroupPropertiesForFlags(),this.reloadFeatureFlags()}setPersonPropertiesForFlags(e,n){var r;n===void 0&&(n=!0),(r=this.featureFlags)==null||r.setPersonPropertiesForFlags(e,n)}resetPersonPropertiesForFlags(e){var n;e===void 0&&(e=!0),(n=this.featureFlags)==null||n.resetPersonPropertiesForFlags(e)}setGroupPropertiesForFlags(e,n){var r;n===void 0&&(n=!0),this.ns("posthog.setGroupPropertiesForFlags")&&((r=this.featureFlags)==null||r.setGroupPropertiesForFlags(e,n))}resetGroupPropertiesForFlags(e){var n;(n=this.featureFlags)==null||n.resetGroupPropertiesForFlags(e)}reset(e){var n=Kr(e)?e:e==null?void 0:e.resetDeviceID,r=Kr(e)||e==null?void 0:e.bootstrap;this.us(n,!1,r)}us(e,n,r){var s,i,a,u,c,d,h,p,m,_,w,y;if(n===void 0&&(n=!1),ve.info("reset"),!this.__loaded)return ve.uninitializedWarning("posthog.reset");var x=r==null?void 0:r.sessionID;this.config.bootstrap=r||((s=this.On)==null?void 0:s.bootstrap)||{},(i=this.featureFlags)==null||i.updateConfig==null||i.updateConfig(this.config,this.tr());var S,P,T,k,R=this.get_property(Bd),M=this.get_property(Pv),L=this.get_property(al),A=this.is_capturing();if(this.consent.reset(),n||!A||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."),(a=this.persistence)==null||a.clear(),(u=this.sessionPersistence)==null||u.clear(),this.Tn.clear(),this.ss(),he(L)||(S=this.persistence)==null||S.register({[al]:L}),(c=this.surveys)==null||c.reset(),(d=this.Yn)==null||d.stop(),(h=this.featureFlags)==null||h.reset(),(p=this.conversations)==null||p.reset(),(m=this.logs)==null||m.reset(),(_=this.metrics)==null||_.reset(),(w=this.persistence)==null||w.set_property(zr,Fa),(y=this.sessionManager)==null||y.resetSessionId(),this.Fn=null,this.config.cookieless_mode===Zi)this.register_once({distinct_id:Yh,$device_id:null},"");else{var O=this.config.get_device_id(Wi());this.register_once({distinct_id:O,$device_id:e?O:R},""),e||he(M)||this.register({[Pv]:M})}if(this.register({$last_posthog_reset:new Date().toISOString()},1),r&&(r.distinctID===void 0||this.Cn()||((k=this.persistence)==null||k.set_property(zr,r.isIdentifiedID?Fo:Fa),this.register({distinct_id:r.distinctID})),(P=this.featureFlags)==null||P.initialize(),!(he(x)||(T=this.sessionManager)!=null&&T.setBootstrapSessionId(x,!0)))){var D=ue({},r);delete D.sessionID,this.config.bootstrap=D}delete this.config.identity_distinct_id,delete this.config.identity_hash,this.reloadFeatureFlags()}shutdown(e){var n=this;return St((function*(){var r,s,i,a,u,c,d;if(n.__loaded){(r=n.Yn)==null||r.stop(),(s=n.Qn)==null||s.dispose(),(i=n.sessionRecording)==null||i.dispose(),(a=n.logs)==null||a.flushLogs("sendBeacon"),(u=n.metrics)==null||u.flush("sendBeacon"),(c=n.Nn)==null||c.unload(),(d=n.jn)==null||d.unload();try{var h;(h=n.featureFlags)==null||h.destroy()}catch(p){ve.error("Error while destroying feature flags",p)}}else ve.uninitializedWarning("posthog.shutdown")}))()}setIdentity(e,n){var r;this.config.identity_distinct_id=e,this.config.identity_hash=n,this.alias(e),(r=this.conversations)==null||r.hs()}clearIdentity(){var e;delete this.config.identity_distinct_id,delete this.config.identity_hash,(e=this.conversations)==null||e.ds()}get_distinct_id(){return this.get_property("distinct_id")}getGroups(){return this.get_property("$groups")||{}}get_session_id(){var e,n;return(e=(n=this.sessionManager)==null?void 0:n.checkAndGetSessionAndWindowId(!0).sessionId)!==null&&e!==void 0?e:""}get_session_replay_url(e){if(!this.sessionManager)return"";var n=this.sessionManager.checkAndGetSessionAndWindowId(!0),r=n.sessionStartTimestamp,s=this.requestRouter.endpointFor("ui","/project/"+this.config.token+"/replay/"+n.sessionId);if(e!=null&&e.withTimestamp&&r){var i,a=(i=e.timestampLookBack)!==null&&i!==void 0?i:10;if(!r)return s;s+="?t="+Math.max(Math.floor((new Date().getTime()-r)/1e3)-a,0)}return s}alias(e,n){return e===this.get_property(Z6)?(ve.critical("Attempting to create alias for existing People user - aborting."),-2):this.ns("posthog.alias")?(he(n)&&(n=this.get_distinct_id()),e!==n?(this.os(md,e),this.capture("$create_alias",{alias:e,distinct_id:n})):(ve.warn("alias matches current distinct_id - skipping api call."),this.identify(e),-1)):void 0}set_config(e){var n=ue({},this.config);if(It(e)){var r,s,i,a,u,c,d,h,p,m,_,w;At(this.config,fC(e));var y=this.$n();(r=this.persistence)==null||r.update_config(this.config,n,y),this.sessionPersistence=this.config.persistence==="sessionStorage"||this.config.persistence==="memory"?this.persistence:new Lv(ue({},this.config,{persistence:"sessionStorage"}),y,!1);var x=this.Ln(this.config.debug);Kr(x)&&(this.config.debug=x),Kr(this.config.debug)&&(this.config.debug?(xt.DEBUG=!0,Ct.N()&&Ct.F("ph_debug",!0),ve.info("set_config",{config:e,oldConfig:n,newConfig:ue({},this.config)})):(xt.DEBUG=!1,Ct.N()&&Ct.q("ph_debug"))),(s=this.featureFlags)==null||s.updateConfig==null||s.updateConfig(this.config,this.tr()),(i=this.exceptionObserver)==null||i.onConfigChange(),(a=this.exceptions)==null||a.onConfigChange(),(u=this.sessionRecording)==null||u.startIfEnabledOrStop(),(c=this.tracingHeaders)==null||c.startIfEnabledOrStop(),(d=this.autocapture)==null||d.startIfEnabled(),(h=this.heatmaps)==null||h.startIfEnabled(),(p=this.exceptionObserver)==null||p.startIfEnabledOrStop(),(m=this.deadClicksAutocapture)==null||m.startIfEnabledOrStop(),(_=this.surveys)==null||_.loadIfEnabled(),this.vs(),(w=this.externalIntegrations)==null||w.startIfEnabledOrStop()}}_overrideSDKInfo(e,n){xt.LIB_NAME=e,xt.LIB_VERSION=n}startSessionRecording(e){var n,r,s,i,a,u=e===!0,c={sampling:u||!(e==null||!e.sampling),linked_flag:u||!(e==null||!e.linked_flag),url_trigger:u||!(e==null||!e.url_trigger),event_trigger:u||!(e==null||!e.event_trigger)};Object.values(c).some(Boolean)&&((n=this.sessionManager)==null||n.checkAndGetSessionAndWindowId(),c.sampling&&((r=this.sessionRecording)==null||r.overrideSampling()),c.linked_flag&&((s=this.sessionRecording)==null||s.overrideLinkedFlag()),c.url_trigger&&((i=this.sessionRecording)==null||i.overrideTrigger("url")),c.event_trigger&&((a=this.sessionRecording)==null||a.overrideTrigger("event"))),this.set_config({disable_session_recording:!1})}stopSessionRecording(){this.set_config({disable_session_recording:!0})}sessionRecordingStarted(){var e;return!((e=this.sessionRecording)==null||!e.started)}captureException(e,n){if(this.exceptions){var r=new Error("PostHog syntheticException"),s=this.exceptions.buildProperties(e,{handled:!0,syntheticException:r});return this.exceptions.sendExceptionEvent(ue({},s,n))}}addExceptionStep(e,n){var r;(r=this.exceptions)==null||r.addExceptionStep(e,n)}captureLog(e){var n;(n=this.logs)==null||n.captureLog(e)}get logger(){var e,n;return(e=(n=this.logs)==null?void 0:n.logger)!==null&&e!==void 0?e:qr.cs}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?void 0:r.loadToolbar(e))!==null&&n!==void 0&&n}get_property(e){var n;return(n=this.persistence)==null?void 0:n.props[e]}getSessionProperty(e){var n;return(n=this.sessionPersistence)==null?void 0:n.props[e]}toString(){var e,n=(e=this.config.name)!==null&&e!==void 0?e:yu;return n!==yu&&(n=yu+"."+n),n}_isIdentified(){var e,n;return((e=this.persistence)==null?void 0:e.get_property(zr))===Fo||((n=this.sessionPersistence)==null?void 0:n.get_property(zr))===Fo}rs(){var e,n;return!(this.config.person_profiles==="never"||this.config.person_profiles===Ny&&!this._isIdentified()&&eo(this.getGroups())&&((e=this.persistence)==null||(e=e.props)==null||!e[md])&&((n=this.persistence)==null||(n=n.props)==null||!n[_m]))}Xn(){return this.config.capture_pageleave===!0||this.config.capture_pageleave==="if_capture_pageview"&&(this.config.capture_pageview===!0||this.config.capture_pageview==="history_change")}createPersonProfile(){this.rs()||this.ns("posthog.createPersonProfile")&&this.setPersonProperties({},{})}setInternalOrTestUser(){this.ns("posthog.setInternalOrTestUser")&&this.setPersonProperties({$internal_or_test_user:!0})}ns(e){return this.config.person_profiles==="never"?(ve.error(e+' was called, but process_person is set to "never". This call will be ignored.'),!1):(this.os(_m,!0),!0)}$n(){if(this.config.cookieless_mode==="always")return!0;var e=this.consent.isOptedOut();return this.config.disable_persistence||e&&!(!this.config.opt_out_persistence_by_default&&this.config.cookieless_mode!==nl)}vs(){var e,n,r,s,i=this.$n();return((e=this.persistence)==null?void 0:e.Ei)!==i&&((r=this.persistence)==null||r.set_disabled(i)),((n=this.sessionPersistence)==null?void 0:n.Ei)!==i&&((s=this.sessionPersistence)==null||s.set_disabled(i)),i&&(this.Tn.clear(),this.ss()),i}opt_in_capturing(e){var n;if(this.config.cookieless_mode!==Zi){if(this.Cn()){var r,s,i,a,u;this.us(!0,!0),(r=this.sessionManager)==null||r.destroy(),(s=this.pageViewManager)==null||s.destroy(),this.sessionManager=new aC(this),this.pageViewManager=new YE(this),this.persistence&&(this.sessionPropsManager=new iC(this,this.sessionManager,this.persistence));var c,d=(i=(a=this.config.__extensionClasses)==null?void 0:a.sessionRecording)!==null&&i!==void 0?i:(u=qr.__defaultExtensionClasses)==null?void 0:u.sessionRecording;d&&(this.sessionRecording=this.Sn(this.sessionRecording,new d(this)),this.bn&&((c=this.sessionRecording)==null||c.onRemoteConfig==null||c.onRemoteConfig(this.bn)))}var h,p;this.consent.optInOut(!0),this.vs(),this.Kn(),(n=this.sessionRecording)==null||n.startIfEnabledOrStop(),this.config.cookieless_mode==nl&&((h=this.surveys)==null||h.loadIfEnabled()),(he(e==null?void 0:e.captureEventName)||e!=null&&e.captureEventName)&&this.capture((p=e==null?void 0:e.captureEventName)!==null&&p!==void 0?p:"$opt_in",e==null?void 0:e.captureProperties,{send_instantly:!0}),this.config.capture_pageview&&this.Jn()}else ve.warn(cC)}opt_out_capturing(){var e,n,r;this.config.cookieless_mode!==Zi?(this.config.cookieless_mode===nl&&this.consent.isOptedIn()&&this.us(!0,!0),this.consent.optInOut(!1),this.vs(),this.config.cookieless_mode===nl&&(this.register({distinct_id:Yh,$device_id:null}),(e=this.sessionRecording)==null||e.stopRecording(),this.sessionRecording=void 0,(n=this.sessionManager)==null||n.destroy(),(r=this.pageViewManager)==null||r.destroy(),this.sessionManager=void 0,this.sessionPropsManager=void 0,this.config.capture_pageview&&this.Jn(),this.Kn())):ve.warn(cC)}has_opted_in_capturing(){return this.consent.isOptedIn()}has_opted_out_capturing(){return this.consent.isOptedOut()}get_explicit_consent_status(){var e=this.consent.consent;return e===1?"granted":e===0?"denied":"pending"}is_capturing(){return this.config.cookieless_mode===Zi||(this.config.cookieless_mode===nl?this.consent.isRejected()||this.consent.isOptedIn():!this.has_opted_out_capturing())}clear_opt_in_out_capturing(){this.consent.reset(),this.vs()}_is_bot(){return ar?HP(ar,this.config.custom_blocked_useragents):void 0}Jn(){_e&&(_e.visibilityState==="visible"?this.Pn||(this.Pn=!0,this.capture(vu,{title:_e.title},{send_instantly:!0}),this.Rn&&(_e.removeEventListener(wm,this.Rn),this.Rn=null)):this.Rn||(this.Rn=this.Jn.bind(this),jt(_e,wm,this.Rn)))}debug(e){e===!1?(ne==null||ne.console.log("You've disabled debug mode."),this.set_config({debug:!1})):(ne==null||ne.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}))}tr(){var e=this.On||{};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?(ve.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,a){var u=r in n&&!Qe(n[r]),c=s in n&&!Qe(n[s]);return u?n[r]:!!c&&(a&&a.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,ve)}At(e){var n;if(Qe(this.config.before_send))return e;var r=Object.keys((n=e.properties)!==null&&n!==void 0?n:{}).filter($L),s=Ze(this.config.before_send)?this.config.before_send:[this.config.before_send],i=e;for(var a of s){if(i=a(i),Qe(i)){var u="Event '"+e.event+"' was rejected in beforeSend function";return FL(e.event)?ve.warn(u+". This can cause unexpected behavior."):ve.info(u),null}i.properties&&!eo(i.properties)||ve.warn("Event '"+e.event+"' has no properties after beforeSend function, this is likely an error.")}for(var c of r)if(i.properties&&Qe(i.properties[c]))return ve.warn("Event '"+e.event+"' had its '"+c+"' 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.fi)==null?void 0:e.pageViewId}captureTraceFeedback(e,n){this.capture("$ai_feedback",{$ai_trace_id:String(e),$ai_feedback_text:n})}captureTraceMetric(e,n,r){this.capture("$ai_metric",{$ai_trace_id:String(e),$ai_metric_name:n,$ai_metric_value:String(r)})}Ln(e){var n=Kr(e)&&!e,r=Ct.N()&&Ct.P("ph_debug")==="true";return!n&&(!!r||e)}}qr.__defaultExtensionClasses={},qr.cs=(()=>{var t=()=>{};return{trace:t,debug:t,info:t,warn:t,error:t,fatal:t}})(),(function(t,e){for(var n=0;e.length>n;n++)t.prototype[e[n]]=PD(t.prototype[e[n]])})(qr,["identify"]);class hC{constructor(e){this.disabled=e===!1;var n=It(e)?e:{};this.thresholdPx=n.threshold_px||30,this.timeoutMs=n.timeout_ms||1e3,this.clickCount=n.click_count||3,this.clicks=[]}isRageClick(e,n,r){if(this.disabled)return!1;var s=this.clicks[this.clicks.length-1];if(s&&Math.abs(e-s.x)+Math.abs(n-s.y)<this.thresholdPx&&this.timeoutMs>r-s.timestamp){if(this.clicks.push({x:e,y:n,timestamp:r}),this.clicks.length===this.clickCount)return!0}else this.clicks=[{x:e,y:n,timestamp:r}];return!1}}var Uv="$copy_autocapture",Bv=Mt("[AutoCapture]");function Wv(t,e){return e.length>t?e.slice(0,t)+"...":e}function MN(t){if(t.previousElementSibling)return t.previousElementSibling;var e=t;do e=e.previousSibling;while(e&&!aa(e));return e}function ON(t,e){var n,r,s=e.e,i=e.maskAllElementAttributes,a=e.maskAllText,u=e.elementAttributeIgnoreList,c=e.elementsChainAsString,d=e.disableCaptureUrlHashes;if(!aa(t))return{props:{}};for(var h=[t],p=new Set([t]),m=t;m.parentNode&&!Yr(m,"body")&&dP>h.length;)if(cP(m.parentNode)){var _=m.parentNode.host;if(p.has(_))break;p.add(_),h.push(_),m=_}else{if(!aa(m.parentNode)||p.has(m.parentNode))break;p.add(m.parentNode),h.push(m.parentNode),m=m.parentNode}var w,y,x=[],S={},P=!1,T=!1;if(bt(h,(A=>{var O=$y(A);if(Yr(A,"a")){var D=A.getAttribute("href");P=!!(O&&D&&Pd(D))&&(d?oa(D):D)}Ke(Sm(A),"ph-no-capture")&&(T=!0),x.push((function(j,G,Y,W,q){q===void 0&&(q=!1);var Z=j.tagName.toLowerCase(),V={tag_name:Z};D2.indexOf(Z)>-1&&!Y&&(V.$el_text=Z.toLowerCase()==="a"||Z.toLowerCase()==="button"?Wv(1024,GE(j)):Wv(1024,Wd(j)));var J=Sm(j);J.length>0&&(V.classes=J.filter((function(oe){return oe!==""}))),bt(j.attributes,(function(oe){var se;if((!gP(j)||["name","id","class","aria-label"].indexOf(oe.name)!==-1)&&(W==null||!W.includes(oe.name))&&!G&&Pd(oe.value)&&(!ht(se=oe.name)||se.substring(0,10)!=="_ngcontent"&&se.substring(0,7)!=="_nghost")){var ee=oe.value;oe.name==="class"&&(ee=L2(ee).join(" ")),V["attr__"+oe.name]=Wv(1024,oe.name==="href"&&q?oa(ee):ee)}}));for(var H=1,F=1,X=j;X=MN(X);)H++,X.tagName===j.tagName&&F++;return V.nth_child=H,V.nth_of_type=F,V})(A,i,a,u,d));var N=(function(j){if(!$y(j))return{};var G={};return bt(j.attributes,(function(Y){if(Y.name&&Y.name.indexOf("data-ph-capture-attribute")===0){var W=Y.name.replace("data-ph-capture-attribute-",""),q=Y.value;W&&q&&Pd(q)&&(G[W]=q)}})),G})(A);At(S,N)})),T)return{props:{},explicitNoCapture:T};if(a||(x[0].$el_text=Yr(t,"a")||Yr(t,"button")?GE(t):Wd(t)),P){var k,R;x[0].attr__href=P;var M=(k=tc(P))==null?void 0:k.host,L=ne==null||(R=ne.location)==null?void 0:R.host;M&&L&&M!==L&&(w=P)}return{props:At({$event_type:s.type,$ce_version:1},c?{}:{$elements:x},{$elements_chain:(y=x,(function(A){return A.map((O=>{var D,N,j="";if(O.tag_name&&(j+=O.tag_name),O.attr_class)for(var G of(O.attr_class.sort(),O.attr_class))j+="."+G.replace(/"/g,"");var Y=ue({},O.text?{text:O.text}:{},{"nth-child":(D=O.nth_child)!==null&&D!==void 0?D:0,"nth-of-type":(N=O.nth_of_type)!==null&&N!==void 0?N:0},O.href?{href:O.href}:{},O.attr_id?{attr_id:O.attr_id}:{},O.attributes),W={};return Lp(Y).sort(((q,Z)=>q[0].localeCompare(Z[0]))).forEach((q=>{var Z=q[1];return W[KE(q[0].toString())]=KE(Z.toString())})),(j+=":")+Lp(W).map((q=>q[0]+'="'+q[1]+'"')).join("")})).join(";")})((function(A){return A.map((O=>{var D,N,j={text:(D=O.$el_text)==null?void 0:D.slice(0,400),tag_name:O.tag_name,href:(N=O.attr__href)==null?void 0:N.slice(0,2048),attr_class:qD(O),attr_id:O.attr__id,nth_child:O.nth_child,nth_of_type:O.nth_of_type,attributes:{}};return Lp(O).filter((G=>G[0].indexOf("attr__")===0)).forEach((G=>j.attributes[G[0]]=G[1])),j}))})(y)))},(n=x[0])!=null&&n.$el_text?{$el_text:(r=x[0])==null?void 0:r.$el_text}:{},w&&s.type==="click"?{$external_click_url:w}:{},S)}}var od=Mt("[ExceptionAutocapture]"),pC=()=>{},LN=Mt("[TracingHeaders]"),Ha=Mt("[Web Vitals]"),mC=9e5,gC="disabled",vC="lazy_loading",ad="awaiting_config",rp="missing_config";Mt("[SessionRecording]"),Mt("[SessionRecording]");var Gy="[SessionRecording]",Oi=Mt(Gy),DN=Mt("[Heatmaps]");function qv(t){return It(t)&&"clientX"in t&&"clientY"in t&&sn(t.clientX)&&sn(t.clientY)}var sp=Mt("[Product Tours]"),Gv=t=>{var e;return!t.config.disable_product_tours&&!((e=t.persistence)==null||!e.get_property(A2))},NN=["$set_once","$set"],Xs=Mt("[SiteApps]"),yC="Error while initializing PostHog app with config id ";function cu(t,e,n){if(Qe(t))return!1;switch(n){case"exact":return t===e;case"contains":var 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}}class jN{constructor(e){this.fs=new $2,this.ps=(n,r)=>this.gs(n,r)&&this.ys(n,r)&&this.bs(n,r)&&this._s(n,r),this.gs=(n,r)=>r==null||!r.event||(n==null?void 0:n.event)===(r==null?void 0:r.event),this._instance=e,this.ws=new Set,this.ks=new Set}init(){var e,n;he((e=this._instance)==null?void 0:e._addCaptureHook)||(n=this._instance)==null||n._addCaptureHook(((r,s)=>{this.on(r,s)}))}register(e){var n,r;if(!he((n=this._instance)==null?void 0:n._addCaptureHook)&&(e.forEach((a=>{var u,c;(u=this.ks)==null||u.add(a),(c=a.steps)==null||c.forEach((d=>{var h;(h=this.ws)==null||h.add((d==null?void 0:d.event)||"")}))})),(r=this._instance)!=null&&r.autocapture)){var s,i=new Set;e.forEach((a=>{var u;(u=a.steps)==null||u.forEach((c=>{c!=null&&c.selector&&i.add(c==null?void 0:c.selector)}))})),(s=this._instance)==null||s.autocapture.setElementSelectors(i)}}on(e,n){var r;n!=null&&e.length!=0&&(this.ws.has(e)||this.ws.has(n.event))&&this.ks&&((r=this.ks)==null?void 0:r.size)>0&&this.ks.forEach((s=>{this.xs(n,s)&&this.fs.emit("actionCaptured",s.name)}))}Ss(e){this.onAction("actionCaptured",(n=>e(n)))}xs(e,n){if((n==null?void 0:n.steps)==null)return!1;for(var r of n.steps)if(this.ps(e,r))return!0;return!1}onAction(e,n){return this.fs.on(e,n)}ys(e,n){if(n!=null&&n.url){var r,s=e==null||(r=e.properties)==null?void 0:r.$current_url;if(!s||typeof s!="string"||!cu(s,n.url,n.url_matching||"contains"))return!1}return!0}bs(e,n){return!!this.Cs(e,n)&&!!this.Ms(e,n)&&!!this.Ts(e,n)}Cs(e,n){var r;if(n==null||!n.href)return!0;var s=this.Es(e);if(s.length>0)return s.some((u=>cu(u.href,n.href,n.href_matching||"exact")));var i,a=(e==null||(r=e.properties)==null?void 0:r.$elements_chain)||"";return!!a&&cu((i=a.match(/(?::|")href="(.*?)"/))?i[1]:"",n.href,n.href_matching||"exact")}Ms(e,n){var r;if(n==null||!n.text)return!0;var s=this.Es(e);if(s.length>0)return s.some((d=>cu(d.text,n.text,n.text_matching||"exact")||cu(d.$el_text,n.text,n.text_matching||"exact")));var i,a,u,c=(e==null||(r=e.properties)==null?void 0:r.$elements_chain)||"";return!!c&&(i=(function(d){for(var h,p=[],m=/(?::|")text="(.*?)"/g;!Qe(h=m.exec(d));)p.includes(h[1])||p.push(h[1]);return p})(c),a=n.text,u=n.text_matching||"exact",i.some((d=>cu(d,a,u))))}Ts(e,n){var r,s;if(n==null||!n.selector)return!0;var i=e==null||(r=e.properties)==null?void 0:r.$element_selectors;if(i!=null&&i.includes(n.selector))return!0;var a=(e==null||(s=e.properties)==null?void 0:s.$elements_chain)||"";if(n.selector_regex&&a)try{return new RegExp(n.selector_regex).test(a)}catch{return!1}return!1}Es(e){var n;return(e==null||(n=e.properties)==null?void 0:n.$elements)==null?[]:e==null?void 0:e.properties.$elements}_s(e,n){return n==null||!n.properties||n.properties.length===0||BP(n.properties.reduce(((r,s)=>{var i=Ze(s.value)?s.value.map(String):s.value!=null?[String(s.value)]:[];return r[s.key]={values:i,operator:s.operator||"exact"},r}),{}),e==null?void 0:e.properties)}}class FN{constructor(e){var n;this.Is=[],this._instance=e,this.Ps=new Map,this.Rs=new Map,this.As=new Map,(n=this._instance)==null||n.onSessionId==null||n.onSessionId((r=>this.Fs(r)))}Ls(e){return!1}Os(){return null}Ds(e){}$s(){}Ns(e,n){return!!e&&BP(e.propertyFilters,n==null?void 0:n.properties)}qs(e,n){var r=new Map;return e.forEach((s=>{var i;(i=s.conditions)==null||(i=i[n])==null||(i=i.values)==null||i.forEach((a=>{if(a!=null&&a.name){var u=r.get(a.name)||[];u.push(s.id),r.set(a.name,u)}}))})),r}js(e,n,r){var s=(r===nd.Activation?this.Ps:this.Rs).get(e),i=[];return this.Bs((a=>{i=a.filter((u=>s==null?void 0:s.includes(u.id)))})),i.filter((a=>{var u,c=(u=a.conditions)==null||(u=u[r])==null||(u=u.values)==null?void 0:u.find((d=>d.name===e));return this.Ns(c,n)}))}register(e){var n;he((n=this._instance)==null?void 0:n._addCaptureHook)||(this.Hs(e),this.Us(e))}Us(e){var n=e.filter((r=>{var s,i;return((s=r.conditions)==null?void 0:s.actions)&&((i=r.conditions)==null||(i=i.actions)==null||(i=i.values)==null?void 0:i.length)>0}));n.length!==0&&(this.zs==null&&(this.zs=new jN(this._instance),this.zs.init(),this.zs.Ss((r=>{this.onAction(r)}))),n.forEach((r=>{var s,i,a,u,c;r.conditions&&(s=r.conditions)!=null&&s.actions&&(i=r.conditions)!=null&&(i=i.actions)!=null&&i.values&&((a=r.conditions)==null||(a=a.actions)==null||(a=a.values)==null?void 0:a.length)>0&&((u=this.zs)==null||u.register(r.conditions.actions.values),(c=r.conditions)==null||(c=c.actions)==null||(c=c.values)==null||c.forEach((d=>{if(d&&d.name){var h=this.As.get(d.name);h&&h.push(r.id),this.As.set(d.name,h||[r.id])}})))})))}Hs(e){var n,r=e.filter((i=>{var a,u;return((a=i.conditions)==null?void 0:a.events)&&((u=i.conditions)==null||(u=u.events)==null||(u=u.values)==null?void 0:u.length)>0})),s=e.filter((i=>{var a,u;return((a=i.conditions)==null?void 0:a.cancelEvents)&&((u=i.conditions)==null||(u=u.cancelEvents)==null||(u=u.values)==null?void 0:u.length)>0}));r.length===0&&s.length===0||((n=this._instance)==null||n._addCaptureHook(((i,a)=>{this.onEvent(i,a)})),this.Ps=this.qs(e,nd.Activation),this.Rs=this.qs(e,nd.Cancellation))}onEvent(e,n){var r,s,i=this.Ws(),a=(n==null||(r=n.properties)==null?void 0:r.$survey_id)||(n==null||(s=n.properties)==null?void 0:s.$product_tour_id);if(a&&this.getActivatedIds().includes(a)){var u=this.Vs(e,a);if(u==="consume")return i.info("event consumed activated item, removing it",{event:e,itemId:a}),void this.Zs([a]);if(u==="persist")return i.info("shown item promoted to persisted activation",{event:e,itemId:a}),this.Gs(a),void this.Qs([a])}if(this.Rs.has(e)){var c=this.js(e,n,nd.Cancellation);c.length>0&&(i.info("cancel event matched, cancelling items",{event:e,itemsToCancel:c.map((h=>h.id))}),this.Zs(c.map((h=>h.id))),c.forEach((h=>this.Ks(h.id))))}if(this.Ps.has(e)){i.info("event name matched",{event:e,eventPayload:n,items:this.Ps.get(e)});var d=this.js(e,n,nd.Activation);this.Js(d.map((h=>h.id)))}}onAction(e){this.As.has(e)&&this.Js(this.As.get(e)||[])}Js(e){var n;if(e.length!==0){var r=!((n=this._instance)==null||n.get_session_id==null||!n.get_session_id()),s=[];for(var i of e)r&&this.Ls(i)?this.Gs(i)&&this.Ys(i):s.push(i);s.length>0&&(this.Is=[...new Set([...this.Is,...s])]),this.Ws().info("updating activated items",{activatedItems:this.getActivatedIds()})}}Gs(e){this.Is=this.Is.filter((r=>r!==e));var n=this.Xs();return!n.includes(e)&&(this.ta([...n,e]),this.ea(),!0)}Zs(e){var n=new Set(e);this.Is=this.Is.filter((i=>!n.has(i)));var r=this.ia(),s=r.filter((i=>!n.has(i)));s.length!==r.length&&(this.ta(s),s.length===0&&this.ra()),this.Qs(e)}na(){var e,n=this.Os();if(!n)return{};var r=(e=this._instance)==null||(e=e.persistence)==null?void 0:e.props[n];return r&&typeof r=="object"?r:{}}Ys(e){if(this.Os()){var n=this.na();this.Ds(ue({},n,{[e]:Date.now()}))}}Qs(e){if(this.Os()){var n=this.na(),r={},s=!1;for(var i of Object.entries(n)){var a=i[0],u=i[1];e.includes(a)?s=!0:r[a]=u}s&&(eo(r)?this.$s():this.Ds(r))}}sa(){this.Os()&&this.$s()}getActivationTimestamp(e){if(this.Xs().includes(e)){var n=this.na()[e];return sn(n)?n:void 0}}ia(){var e,n=this.aa();return((e=this._instance)==null||(e=e.persistence)==null?void 0:e.props[n])||[]}Xs(){var e,n,r=this.ia();if(r.length===0)return[];var s=(e=this._instance)==null||(e=e.persistence)==null?void 0:e.props[this.oa()],i=(n=this._instance)==null||n.get_session_id==null?void 0:n.get_session_id();return i&&s===i?r:[]}ea(){var e,n=(e=this._instance)==null||e.get_session_id==null?void 0:e.get_session_id();n&&this.la(n)}ra(){this.ua()}Fs(e){var n,r=(n=this._instance)==null||(n=n.persistence)==null?void 0:n.props[this.oa()];if(r&&r!==e){var s=this.ia(),i=this.na();s.length>0&&(this.ta([]),s.filter((a=>sn(i[a]))).forEach((a=>this.Ks(a)))),this.ra(),this.sa()}}getActivatedIds(){return[...new Set([...this.Xs(),...this.Is])].filter((e=>!this.ha(e)))}reset(){this.Is=[],this.ia().length>0&&this.ta([]),this.ra(),this.sa()}getEventToItemsMap(){return this.Ps}da(){return this.zs}}class $N extends FN{constructor(e){super(e)}aa(){return Iy}oa(){return Ip}Os(){return Mp}Ds(e){var n;(n=this._instance)==null||(n=n.persistence)==null||n.register({[Mp]:e})}$s(){var e;(e=this._instance)==null||(e=e.persistence)==null||e.unregister(Mp)}Ls(e){var n,r;this.Bs((i=>{r=i.find((a=>a.id===e))}));var s=(n=r)==null||(n=n.appearance)==null?void 0:n.surveyPopupDelaySeconds;return sn(s)&&s>0}va(){return Xi.SHOWN}Bs(e){var n;(n=this._instance)==null||n.getSurveys(e)}Ks(e){var n;(n=this._instance)==null||n.cancelPendingSurvey(e)}Ws(){return vt}ta(e){var n;(n=this._instance)==null||(n=n.persistence)==null||n.register({[Iy]:e})}la(e){var n;(n=this._instance)==null||(n=n.persistence)==null||n.register({[Ip]:e})}ua(){var e;(e=this._instance)==null||(e=e.persistence)==null||e.unregister(Ip)}ha(){return!1}Vs(e,n){var r;this.Bs((i=>{r=i.find((a=>a.id===n))}));var s=!r||(function(i){var a;return WP(i)&&!((a=i.conditions)==null||(a=a.events)==null||!a.repeatedActivation)||i.schedule==="always"})(r);return s?e===Xi.SHOWN?"consume":"ignore":e===Xi.SHOWN?"persist":e===Xi.DISMISSED||e===Xi.SENT?"consume":"ignore"}getSurveys(){return this.getActivatedIds()}getEventToSurveys(){return this.getEventToItemsMap()}}var ip="SDK is not enabled or survey functionality is not yet loaded",_C="Disabled. Not loading surveys.",VN=ne!=null&&ne.location?Em(ne.location.hash,"__posthog")||Em(location.hash,"state"):null,wC="_postHogToolbarParams",xC=Mt("[Toolbar]"),bC=Mt("[FeatureFlags]");class HN{constructor(e,n){n===void 0&&(n=!1),this.ca=!1,this.update(e,n)}update(e,n){this.fa=((r,s)=>{var i,a,u,c;return{bootstrap:{featureFlags:(i=r.bootstrap)==null?void 0:i.featureFlags,featureFlagPayloads:(a=r.bootstrap)==null?void 0:a.featureFlagPayloads},remoteRequestsDisabled:s,featureFlagsDisabled:!!r.advanced_disable_feature_flags,onlyEvaluateSurveyFeatureFlags:!!r.advanced_only_evaluate_survey_feature_flags,deduplicateCallsPerSession:!!r.advanced_feature_flags_dedup_per_session,cacheTtlMs:r.feature_flag_cache_ttl_ms,requestTimeoutMs:r.feature_flag_request_timeout_ms,compression:r.disable_compression?"none":"base64",evaluationContexts:(u=(c=r.evaluation_contexts)!==null&&c!==void 0?c:r.evaluation_environments)!==null&&u!==void 0?u:[],flagKeys:Ze(r.flag_keys)?r.flag_keys:void 0}})(e,n),!e.evaluation_environments||e.evaluation_contexts||this.ca||(bC.warn("evaluation_environments is deprecated. Use evaluation_contexts instead. evaluation_environments will be removed in a future version."),this.ca=!0),he(e.flag_keys)||Ze(e.flag_keys)||bC.error("Invalid flag_keys found:",e.flag_keys,"Expected array of non-empty strings")}get(){return this.fa}}var SC=Mt("[FeatureFlags]"),za=Mt("[FeatureFlags]",{debugEnabled:!0}),Kv=`" failed. Feature flags didn't load in time.`,EC="connection_error",CC=t=>{for(var e={},n=0;t.length>n;n++)e[t[n]]=!0;return e},kC=t=>{var e={};for(var n of Lp(t||{})){var r=n[1];r&&(e[n[0]]=r)}return e},Qs=Mt("[Error tracking]"),PC="Refusing to render web experiment since the viewer is a likely bot",zN={icontains:(t,e)=>e.toLowerCase().indexOf(t.toLowerCase())>-1,not_icontains:(t,e)=>e.toLowerCase().indexOf(t.toLowerCase())===-1,regex:(t,e)=>Pm(e,t),not_regex:(t,e)=>!Pm(e,t),exact:(t,e)=>e===t,is_not:(t,e)=>e!==t};class Zn{get qe(){return this._instance.config}constructor(e){var n=this;this.getWebExperimentsAndEvaluateDisplayLogic=function(r){r===void 0&&(r=!1),n.getWebExperiments((s=>{Zn.pa("retrieved web experiments from the server"),n.ga=new Map,s.forEach((i=>{if(i.feature_flag_key){var a;n.ga&&(Zn.pa("setting flag key ",i.feature_flag_key," to web experiment ",i),(a=n.ga)==null||a.set(i.feature_flag_key,i));var u=n._instance.getFeatureFlag(i.feature_flag_key);ht(u)&&i.variants[u]&&n.ma(i.name,u,i.variants[u].transforms)}else if(i.variants)for(var c in i.variants){var d=i.variants[c];Zn.ya(d,n._instance)&&n.ma(i.name,c,d.transforms)}}))}),r)},this._instance=e,this._instance.onFeatureFlags((r=>{this.onFeatureFlags(r)}))}initialize(){}onFeatureFlags(e){if(this._is_bot())Zn.pa(PC);else if(!this.qe.disable_web_experiments){if(Qe(this.ga))return this.ga=new Map,this.loadIfEnabled(),void this.previewWebExperiment();Zn.pa("applying feature flags",e),e.forEach((n=>{var r;if(this.ga&&(r=this.ga)!=null&&r.has(n)){var s,i=this._instance.getFeatureFlag(n),a=(s=this.ga)==null?void 0:s.get(n);i&&a!=null&&a.variants[i]&&this.ma(a.name,i,a.variants[i].transforms)}}))}}previewWebExperiment(){var e=Zn.getWindowLocation();if(e!=null&&e.search){var n=nc(e==null?void 0:e.search,"__experiment_id"),r=nc(e==null?void 0:e.search,"__experiment_variant");n&&r&&(Zn.pa("previewing web experiments "+n+" && "+r),this.getWebExperiments((s=>{this.ba(parseInt(n),r,s)}),!1,!0))}}loadIfEnabled(){this.qe.disable_web_experiments||this.getWebExperimentsAndEvaluateDisplayLogic()}getWebExperiments(e,n,r){if(this.qe.disable_web_experiments&&!r)return e([]);var 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.qe.token),method:"GET",timestampMode:"query",callback:i=>e(i.statusCode===200&&i.json&&i.json.experiments||[])})}ba(e,n,r){var s=r.filter((i=>i.id===e));s&&s.length>0&&(Zn.pa("Previewing web experiment ["+s[0].name+"] with variant ["+n+"]"),this.ma(s[0].name,n,s[0].variants[n].transforms))}static ya(e,n){return!Qe(e.conditions)&&Zn._a(e,n)&&Zn.wa(e)}static _a(e,n){var r;if(Qe(e.conditions)||Qe((r=e.conditions)==null?void 0:r.url))return!0;var s=Zn.getWindowLocation();if(s){var i,a,u,c=aP(n,s.href);return(i=e.conditions)==null||!i.url||zN[(a=(u=e.conditions)==null?void 0:u.urlMatchType)!==null&&a!==void 0?a:"icontains"](e.conditions.url,c)}return!1}static getWindowLocation(){return ne==null?void 0:ne.location}static wa(e){var n;if(Qe(e.conditions)||Qe((n=e.conditions)==null?void 0:n.utm))return!0;var r=bP();if(r.utm_source){var s,i,a,u,c,d,h,p,m=(s=e.conditions)==null||(s=s.utm)==null||!s.utm_campaign||((i=e.conditions)==null||(i=i.utm)==null?void 0:i.utm_campaign)==r.utm_campaign,_=(a=e.conditions)==null||(a=a.utm)==null||!a.utm_source||((u=e.conditions)==null||(u=u.utm)==null?void 0:u.utm_source)==r.utm_source,w=(c=e.conditions)==null||(c=c.utm)==null||!c.utm_medium||((d=e.conditions)==null||(d=d.utm)==null?void 0:d.utm_medium)==r.utm_medium,y=(h=e.conditions)==null||(h=h.utm)==null||!h.utm_term||((p=e.conditions)==null||(p=p.utm)==null?void 0:p.utm_term)==r.utm_term;return m&&w&&y&&_}return!1}static pa(e){for(var n=arguments.length,r=new Array(n>1?n-1:0),s=1;n>s;s++)r[s-1]=arguments[s];ve.info("[WebExperiments] "+e,r)}ma(e,n,r){this._is_bot()?Zn.pa(PC):n!=="control"?r.forEach((s=>{if(s.selector){var i;Zn.pa("applying transform of variant "+n+" for experiment "+e+" ",s);var a=(i=document)==null?void 0:i.querySelectorAll(s.selector);a==null||a.forEach((u=>{var c=u;s.html&&(c.innerHTML=s.html),s.css&&c.setAttribute("style",s.css)}))}})):Zn.pa("Control variants leave the page unmodified.")}_is_bot(){return ar&&this._instance?HP(ar,this.qe.custom_blocked_useragents):void 0}}var gs=Mt("[Conversations]"),Ua="Conversations not available yet.",TC="console",YP="__posthogHandledLogsRequestError",Zv=(t,e)=>{var n=t instanceof Error?t:new Error(e);return n[YP]=!0,n},RC=t=>!!t&&typeof t=="object"&&t[YP]===!0,u0={featureFlags:class{constructor(t){this.name="featureFlags",this.ka=!1,this.featureFlagEventHandlers=[],this.st=SC,this.xa={},this.Sa={},this.Ca=[],this.Ma=!1,this.Ta=!1,this.Ea=0,this.Ia=!1,this.Pa=!1,this.Ra=!1,this.Aa=!1,this.Fa=0,this.La=()=>{var e=this.Oa();this.Fa=0,e&&this.reloadFeatureFlags()},"get"in t?this.Da=t:(this.$a=new HN(t.config,t.tr()),this.Da=this.$a)}updateConfig(t,e){var n;(n=this.$a)==null||n.update(t,e)}setup(t){return this.Na=t,this.st=t.logger.createLogger("[FeatureFlags]"),n=()=>{this.Na===t&&(this.Na=void 0,this.fn=t,this.qa(t))},(e=t.kv.initialize())!=null&&e.then?e.then(n):n();var e,n}qa(t){if(this.fn===t)return ne&&jt(ne,"online",this.La),this.ja=t.registerDynamicEventProperties((()=>this.Ba()?this.xa:this.Sa)),this.Ha(),this.initialize()}destroy(){ne==null||ne.removeEventListener("online",this.La)}dispose(){var t;this.Ea++,this.Pa=!1,this.Na=void 0,this.fn&&(this.Ua(),(t=this.ja)==null||t.dispose(),this.ja=void 0,this.Ca=[],ne==null||ne.removeEventListener("online",this.La),this.fn=void 0)}get qe(){return this.Da.get()}za(t){var e;return(e=this.fn)==null?void 0:e.kv.get(t)}F(t){this.Wa((()=>{var e;return(e=this.fn)==null?void 0:e.kv.set(t)}))}q(t){this.Wa((()=>{var e;return(e=this.fn)==null?void 0:e.kv.remove(t)}))}Wa(t){try{t()}catch(e){this.st.error("Failed to update feature flag persistence",e)}}Ha(){var t={};for(var e of[vd,yd,Ap,ni]){var n=this.za(e);he(n)||(t[e]=n)}this.xa=t;var r=ue({},t),s=this.za(Ja);if(s)for(var i of Object.entries(s))r["$feature/"+i[0]]=i[1];this.Sa=r}Ba(){var t=this.qe.cacheTtlMs;if(!t||0>=t)return!1;var e=this.za(kd);return typeof e!="number"||Date.now()-e>t}Va(){return!!this.Ba()&&(this.Aa||this.Ta||(this.Aa=!0,this.st.warn("Feature flag cache is stale, triggering refresh..."),this.reloadFeatureFlags()),!0)}Za(){var t=this.qe.evaluationContexts;return t!=null&&t.length?t.filter((e=>{var n=e&&typeof e=="string"&&e.trim().length>0;return n||this.st.error("Invalid evaluation context found:",e,"Expected non-empty string"),n})):[]}Ga(){var t=this.qe.flagKeys;if(!he(t))return t.filter((e=>{var n=e&&typeof e=="string"&&e.trim().length>0;return n||this.st.error("Invalid flag key found:",e,"Expected non-empty string"),n}))}initialize(){var t,e,n=this.qe,r=(t=(e=n.bootstrap)==null?void 0:e.featureFlags)!==null&&t!==void 0?t:{};if(Object.keys(r).length){var s,i,a=(s=(i=n.bootstrap)==null?void 0:i.featureFlagPayloads)!==null&&s!==void 0?s:{},u=Object.keys(r).filter((d=>!!r[d])).reduce(((d,h)=>(d[h]=r[h]||!1,d)),{}),c=Object.keys(a).filter((d=>u[d])).reduce(((d,h)=>(d[h]=a[h],d)),{});return this.Qa({featureFlags:u,featureFlagPayloads:c})}}updateFlags(t,e,n){var r,s,i=n!=null&&n.merge&&(r=this.za(Ja))!==null&&r!==void 0?r:{},a=n!=null&&n.merge&&(s=this.za(yd))!==null&&s!==void 0?s:{},u=ue({},i,t),c=ue({},a,e),d={};for(var h of Object.entries(u)){var p=h[0],m=h[1];d[p]={key:p,enabled:_E(m),variant:wE(m),reason:void 0,metadata:he(c==null?void 0:c[p])?void 0:{id:0,version:void 0,description:void 0,payload:c[p]}}}this.Qa({flags:d})}get hasLoadedFlags(){return this.Ma}getFlags(){return Object.keys(this.getFlagVariants())}getFlagsWithDetails(){var t=this.za(Ry),e=this.za(ni),n=this.za(el);if(!n&&!e)return t||{};var r=At({},t||{}),s=[...new Set([...Object.keys(n||{}),...Object.keys(e||{})])];for(var i of s){var a,u,c=r[i],d=e==null?void 0:e[i],h=he(d)?(a=c==null?void 0:c.enabled)!==null&&a!==void 0&&a:!!d,p=he(d)?c==null?void 0:c.variant:typeof d=="string"?d:void 0,m=n==null?void 0:n[i],_=ue({},c,{enabled:h,variant:h?p??(c==null?void 0:c.variant):void 0});h!==(c==null?void 0:c.enabled)&&(_.original_enabled=c==null?void 0:c.enabled),p!==(c==null?void 0:c.variant)&&(_.original_variant=c==null?void 0:c.variant),m&&(_.metadata=ue({},c==null?void 0:c.metadata,{payload:m,original_payload:c==null||(u=c.metadata)==null?void 0:u.payload})),r[i]=_}return this.ka||(this.st.warn(" Overriding feature flag details!",{flagDetails:t,overriddenPayloads:n,finalDetails:r}),this.ka=!0),r}getAllFeatureFlags(){var t=this.getFlagVariants(),e=this.getFlagPayloads();return Object.keys(t).map((n=>{var r=t[n];return{key:n,enabled:_E(r),variant:wE(r),payload:yE(e[n])}}))}getFlagVariants(){var t=this.za(Ja),e=this.za(ni);if(!e)return t||{};for(var n=At({},t||{}),r=Object.keys(e),s=0;r.length>s;s++)n[r[s]]=e[r[s]];return this.ka||(this.st.warn(" Overriding feature flags!",{enabledFlags:t,overriddenFlags:e,finalFlags:n}),this.ka=!0),n}getFlagPayloads(){var t=this.za(yd),e=this.za(el);if(!e)return t||{};for(var n=At({},t||{}),r=Object.keys(e),s=0;r.length>s;s++)n[r[s]]=e[r[s]];return this.ka||(this.st.warn(" Overriding feature flag payloads!",{flagPayloads:t,overriddenPayloads:e,finalPayloads:n}),this.ka=!0),n}reloadFeatureFlags(){this.Ia||this.qe.featureFlagsDisabled||this.Oa()||this.Ka||(this.Ca.slice().forEach((t=>{try{t()}catch(e){this.st.error("Error while running feature flags reloading callback",e)}})),this.Ka=setTimeout((()=>{this.Ja()}),5))}Ua(){clearTimeout(this.Ka),this.Ka=void 0}onReloading(t){return this.Ca.push(t),()=>{this.Ca=this.Ca.filter((e=>e!==t))}}ensureFlagsLoaded(){this.Ma||this.Ta||this.Ka||this.reloadFeatureFlags()}setAnonymousDistinctId(t){this.$anon_distinct_id=t}setReloadingPaused(t){this.Ia=t}resetFlagCallReported(){this.q(il)}Ja(t){this.Ua();var e=this.fn;if(e&&!this.qe.remoteRequestsDisabled&&!this.Oa())if(this.Ta)this.Pa=!0;else{var n={token:e.projectToken,distinct_id:e.distinctId,groups:e.groups,$anon_distinct_id:this.$anon_distinct_id,person_properties:ue({},e.initialPersonProperties,this.za(Vi)||{},{$lib:e.library.name,$lib_version:e.library.version}),group_properties:this.za(tl),timezone:TP()};he(e.deviceId)||(n.$device_id=e.deviceId),(t!=null&&t.disableFlags||this.qe.featureFlagsDisabled)&&(n.disable_flags=!0);var r=this.Za();r.length&&(n.evaluation_contexts=r);var s=this.Ga();he(s)||(n.flag_keys=s);var i=this.qe.onlyEvaluateSurveyFeatureFlags,a="/flags/?v=2"+(i?"&only_evaluate_survey_feature_flags=true":""),u=this.Ea;this.Ta=!0;var c=()=>{this.Pa&&(this.Pa=!1,this.Ja())},d=h=>{this.Ta=!1,u===this.Ea&&(this.F({[Op]:[EC]}),this.st.error("Feature flag request failed",h)),c()};try{e.sendRequest(a,{target:"flags",method:"POST",body:n,compression:this.qe.compression==="base64"?or.Base64:void 0,sentAt:"body",timeoutMs:this.qe.requestTimeoutMs}).then((h=>{var p,m,_=(p=h.json)!==null&&p!==void 0?p:{},w=h.statusCode!==200;if(this.Ta=!1,u===this.Ea){if(this.Ya(h.statusCode),w||this.Pa||(this.$anon_distinct_id=void 0),!n.disable_flags||this.Pa){this.Ra=!w;var y=[];h.error?y.push(h.error instanceof Error&&h.error.name==="AbortError"?"timeout":h.error instanceof Error?EC:"unknown_error"):h.statusCode!==200&&y.push("api_error_"+h.statusCode),_.errorsWhileComputingFlags&&y.push("errors_while_computing_flags");var x=!((m=_.quotaLimited)==null||!m.includes("feature_flags"));x&&y.push("quota_limited"),this.F({[Op]:y}),x?this.st.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."):n.disable_flags||this.Qa(_,w,{partialResponse:i}),c()}}else c()})).catch(d)}catch(h){d(h)}}}Oa(){return wP(this.Fa,3)}Ya(t){this.Fa=xP(t,this.Fa,3,(()=>this.st.warn("Feature flag requests are failing before receiving an HTTP response; this can happen due to network issues, CORS, browser blocking, or ad blockers. Stopped refreshing feature flags; will try again when connectivity changes.")))}getFeatureFlag(t,e){var n;if(e===void 0&&(e={}),!e.fresh||this.Ra)if(this.Ma||this.getFlags()&&this.getFlags().length>0){if(!this.Va()){var r=this.getFeatureFlagResult(t,e);return(n=r==null?void 0:r.variant)!==null&&n!==void 0?n:r==null?void 0:r.enabled}}else this.st.warn('getFeatureFlag for key "'+t+Kv)}getFeatureFlagDetails(t){return this.getFlagsWithDetails()[t]}getFeatureFlagPayload(t){var e=this.getFeatureFlagResult(t,{send_event:!1});return e==null?void 0:e.payload}getFeatureFlagResult(t,e){if(e===void 0&&(e={}),!e.fresh||this.Ra)if(this.Ma||this.getFlags()&&this.getFlags().length>0){if(!this.Va()){var n,r=this.getFlagVariants(),s=t in r,i=r[t],a=this.getFlagPayloads()[t],u=String(i),c=this.za(Ap)||void 0,d=this.za(kd)||void 0,h=this.za(il)||{};if(this.qe.deduplicateCallsPerSession){var p,m=(p=this.fn)==null?void 0:p.session.sessionId,_=this.za(wd);m&&m!==_&&(h={},n=m)}if(e.send_event||!("send_event"in e))if(t in h&&h[t].includes(u))n&&this.F({[il]:h,[wd]:n});else{var w,y,x,S,P,T,k,R,M,L,A,O;Ze(h[t])?h[t].push(u):h[t]=[u],this.F(ue({[il]:h},n?{[wd]:n}:{}));var D=this.getFeatureFlagDetails(t),N=[...(w=this.za(Op))!==null&&w!==void 0?w:[]];he(i)&&N.push("flag_missing");var j={$feature_flag:t,$feature_flag_response:i,$feature_flag_payload:a??null,$feature_flag_request_id:c,$feature_flag_evaluated_at:d,$feature_flag_bootstrapped_response:(y=(x=this.qe.bootstrap)==null||(x=x.featureFlags)==null?void 0:x[t])!==null&&y!==void 0?y:null,$feature_flag_bootstrapped_payload:(S=(P=this.qe.bootstrap)==null||(P=P.featureFlagPayloads)==null?void 0:P[t])!==null&&S!==void 0?S:null,$used_bootstrap_value:!this.Ra};he(D==null||(T=D.metadata)==null?void 0:T.has_experiment)||(j.$feature_flag_has_experiment=D.metadata.has_experiment),he(D==null||(k=D.metadata)==null?void 0:k.version)||(j.$feature_flag_version=D.metadata.version);var G,Y=(R=D==null||(M=D.reason)==null?void 0:M.description)!==null&&R!==void 0?R:D==null||(L=D.reason)==null?void 0:L.code;Y&&(j.$feature_flag_reason=Y),D!=null&&(A=D.metadata)!=null&&A.id&&(j.$feature_flag_id=D.metadata.id),he(D==null?void 0:D.original_variant)&&he(D==null?void 0:D.original_enabled)||(j.$feature_flag_original_response=he(D.original_variant)?D.original_enabled:D.original_variant),D!=null&&(O=D.metadata)!=null&&O.original_payload&&(j.$feature_flag_original_payload=D==null||(G=D.metadata)==null?void 0:G.original_payload),N.length&&(j.$feature_flag_error=N.join(",")),this.Xa(j)}else n&&this.F({[il]:h,[wd]:n});if(s)return{key:t,enabled:!!i,variant:typeof i=="string"?i:void 0,payload:yE(a)}}}else this.st.warn('getFeatureFlagResult for key "'+t+Kv)}Xa(t){try{var e;(e=this.fn)==null||e.capture("$feature_flag_called",t).catch((n=>{this.st.error("Failed to capture feature flag call",n)}))}catch(n){this.st.error("Failed to capture feature flag call",n)}}getRemoteConfigPayload(t,e){this.eo(t,e)}eo(t,e){var n=this;return St((function*(){var r=n.fn;if(r){var s={distinct_id:r.distinctId,token:r.projectToken,person_properties:{$lib:r.library.name,$lib_version:r.library.version}},i=n.Za();i.length&&(s.evaluation_contexts=i);var a,u=n.Ga();he(u)||(s.flag_keys=u);try{var c,d=(c=(yield r.sendRequest("/flags/?v=2",{target:"flags",method:"POST",body:s,compression:n.qe.compression==="base64"?or.Base64:void 0,sentAt:"body",timeoutMs:n.qe.requestTimeoutMs})).json)==null?void 0:c.featureFlagPayloads;a=(d==null?void 0:d[t])||void 0}catch(h){return void n.st.error("Remote config feature flag request failed",h)}try{e(a)}catch(h){n.st.error("Remote config feature flag callback failed",h)}}}))()}isFeatureEnabled(t,e){if(e===void 0&&(e={}),e.fresh&&!this.Ra)return e.defaultValue;if(!(this.Ma||this.getFlags()&&this.getFlags().length>0))return this.st.warn('isFeatureEnabled for key "'+t+Kv),e.defaultValue;var n=this.getFeatureFlag(t,e);return he(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.Qa(t,e,n)}Qa(t,e,n){if(this.fn){this.Ma=!0;var r=(function(s,i,a,u,c,d){i===void 0&&(i={}),a===void 0&&(a={}),u===void 0&&(u={}),d===void 0&&(d=SC);var h=((M,L)=>{var A=M.flags;return A?ue({},M,{featureFlags:Object.fromEntries(Object.keys(A).map((O=>{var D;return[O,(D=A[O].variant)!==null&&D!==void 0?D:A[O].enabled]}))),featureFlagPayloads:Object.fromEntries(Object.keys(A).filter((O=>A[O].enabled)).filter((O=>{var D;return(D=A[O].metadata)==null?void 0:D.payload})).map((O=>{var D;return[O,(D=A[O].metadata)==null?void 0:D.payload]})))}):(M.featureFlags&&L.warn("Using an older version of the feature flags endpoint. Please upgrade your PostHog server to the latest version"),M)})(s,d),p=h.flags,m=h.featureFlags,_=h.featureFlagPayloads;if(m){var w=s.requestId,y=s.evaluatedAt;if(Ze(m)){d.warn("v1 of the feature flags endpoint is deprecated. Please use the latest version.");var x={};if(m)for(var S=0;m.length>S;S++)x[m[S]]=!0;return{[vd]:m,[Ja]:x,[gm]:!1}}var P=m,T=_,k=p;if(c!=null&&c.partialResponse)P=ue({},i,P),T=ue({},a,T),k=ue({},u,k);else if(s.errorsWhileComputingFlags)if(p){var R=new Set(Object.keys(p).filter((M=>{var L;return!((L=p[M])!=null&&L.failed)})));P=ue({},i,Object.fromEntries(Object.entries(P).filter((M=>R.has(M[0]))))),T=ue({},a,Object.fromEntries(Object.entries(T||{}).filter((M=>R.has(M[0]))))),k=ue({},u,Object.fromEntries(Object.entries(k||{}).filter((M=>R.has(M[0])))))}else P=ue({},i,P),T=ue({},a,T),k=ue({},u,k);return ue({[vd]:Object.keys(kC(P)),[Ja]:P||{},[yd]:T||{},[Ry]:k||{},[gm]:s.minimalFlagCalledEvents===!0},w?{[Ap]:w}:{},y?{[kd]:y}:{})}})(t,this.getFlagVariants(),this.getFlagPayloads(),this.getFlagsWithDetails(),n,this.st);r&&this.F(r),e||(this.Aa=!1),this.io(e)}}override(t,e){e===void 0&&(e=!1),this.st.warn("override is deprecated. Please use overrideFeatureFlags instead."),this.overrideFeatureFlags({flags:t,suppressWarning:e})}overrideFeatureFlags(t){this.ro(t)}ro(t){if(this.fn){if(t===!1)return this.q([ni,el]),this.io(),void za.info("All overrides cleared");if(Ze(t))return this.F({[ni]:CC(t)}),this.io(),void za.info("Flag overrides set",{flags:t});if(t&&typeof t=="object"&&("flags"in t||"payloads"in t)){var e,n=t;this.ka=!!((e=n.suppressWarning)!==null&&e!==void 0&&e);var r={},s=n.flags,i=n.payloads;return s&&(r[ni]=Ze(s)?CC(s):s),i&&(r[el]=i),Object.keys(r).length&&this.F(r),s===!1&&i===!1?this.q([ni,el]):s===!1?this.q(ni):i===!1&&this.q(el),this.io(),s===!1?za.info("Flag overrides cleared"):s&&za.info("Flag overrides set",{flags:s}),void(i===!1?za.info("Payload overrides cleared"):i&&za.info("Payload overrides set",{payloads:i}))}if(t&&typeof t=="object")return this.F({[ni]:t}),this.io(),void za.info("Flag overrides set",{flags:t});this.st.warn("Invalid overrideOptions provided to overrideFeatureFlags",{overrideOptions:t})}else this.st.warn("posthog.featureFlags.overrideFeatureFlags called before feature flags were ready")}onFeatureFlags(t){if(this.addFeatureFlagsHandler(t),this.Ma){var e=this.no(),n=e.flags,r=e.flagVariants;try{t(n,r)}catch(s){this.st.error("Error while running feature flags callback",s)}}return()=>this.removeFeatureFlagsHandler(t)}updateEarlyAccessFeatureEnrollment(t,e,n){var r=(this.za(Rp)||[]).find((c=>c.flagKey===t)),s={["$feature_enrollment/"+t]:e},i={$feature_flag:t,$feature_enrollment:e,$set:s};r&&(i.$early_access_feature_name=r.name),n&&(i.$feature_enrollment_stage=n);var a=ue({},this.getFlagVariants(),{[t]:e});this.F({[vd]:Object.keys(kC(a)),[Ja]:a,[Vi]:ue({},this.za(Vi)||{},s)}),this.io();try{var u;(u=this.fn)==null||u.capture("$feature_enrollment_update",i).catch((c=>{this.st.error("Failed to capture early access feature enrollment",c)}))}catch(c){this.st.error("Failed to capture early access feature enrollment",c)}}getEarlyAccessFeatures(t,e,n){e===void 0&&(e=!1);var r=this.za(Rp);!r||e?this.so(t,n):t(r)}so(t,e){var n=this;return St((function*(){var r=n.fn;if(r){var s,i=e?"&"+e.map((u=>"stage="+u)).join("&"):"";try{var a=yield r.sendRequest("/api/early_access_features/?token="+r.projectToken+i,{target:"api",method:"GET",sentAt:"query"});if(!a.json)return;n.F({[Rp]:s=a.json.earlyAccessFeatures})}catch(u){return void n.st.error("Early access feature request failed",u)}try{t(s)}catch(u){n.st.error("Early access feature callback failed",u)}}}))()}no(){var 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)),{})}}io(t){this.Ha();var e=this.no(),n=e.flags,r=e.flagVariants;this.featureFlagEventHandlers.forEach((s=>{try{s(n,r,{errorsLoading:t})}catch(i){this.st.error("Error while running feature flags callback",i)}}))}setPersonPropertiesForFlags(t,e){e===void 0&&(e=!0),this.ao(t,e)}ao(t,e){e===void 0&&(e=!0);var n=this.za(Vi)||{},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(var a in s)({}).hasOwnProperty.call(s,a)&&(a in n||(i[a]=s[a]));this.F({[Vi]:ue({},n,i,r)}),e&&this.reloadFeatureFlags()}unsetPersonPropertiesForFlags(t,e){e===void 0&&(e=!0);var n=ue({},this.za(Vi)||{});t.forEach((r=>{delete n[r]})),this.F({[Vi]:n}),e&&this.reloadFeatureFlags()}resetPersonPropertiesForFlags(t){t===void 0&&(t=!0),this.q(Vi),t&&this.reloadFeatureFlags()}setGroupPropertiesForFlags(t,e){e===void 0&&(e=!0);var n=this.za(tl)||{},r=ue({},n);for(var s of Object.keys(t))r[s]=ue({},n[s],t[s]);this.F({[tl]:r}),e&&this.reloadFeatureFlags()}resetGroupPropertiesForFlags(t){if(t){var e=this.za(tl)||{};this.F({[tl]:ue({},e,{[t]:{}})})}else this.q(tl)}reset(){this.Ea++,this.Pa=!1,this.Ha(),this.Ma=!1,this.Ia=!1,this.Ra=!1,this.$anon_distinct_id=void 0,this.Ua(),this.ka=!1,this.Fa=0}}},UN={sessionRecording:class{get qe(){return this._instance.config}get Rr(){return this._instance.persistence}get started(){var t;return!((t=this.oo)==null||!t.isStarted)}get status(){var t,e;return this.lo===ad||this.lo===rp?this.lo:(t=(e=this.oo)==null?void 0:e.status)!==null&&t!==void 0?t:this.lo}constructor(t){if(this._forceAllowLocalhostNetworkCapture=!1,this.lo=gC,this.uo=void 0,this.ho=!1,this.do=(()=>{var e;if(_e==null||!_e.visibilityState||_e.visibilityState==="visible")return!0;var n=ne==null||(e=ne.performance)==null||e.getEntriesByType==null?void 0:e.getEntriesByType("visibility-state");return!(n!=null&&n.length)||n.some((r=>r.name==="visible"))})(),this.Ee=()=>{var e;(_e==null?void 0:_e.visibilityState)==="visible"&&(this.do=!0,(e=this.oo)==null||e.setDocumentWasEverVisible==null||e.setDocumentWasEverVisible(!0))},this._instance=t,!this._instance.sessionManager)throw Oi.error("started without valid sessionManager"),new Error(Gy+" started without valid sessionManager. This is a bug.");if(this.qe.cookieless_mode===Zi)throw new Error(Gy+' cannot be used with cookieless_mode="always"');_e!=null&&_e.addEventListener&&jt(_e,"visibilitychange",this.Ee)}initialize(){this.startIfEnabledOrStop()}dispose(){this.ho=!0,_e==null||_e.removeEventListener==null||_e.removeEventListener("visibilitychange",this.Ee),this.stopRecording()}get vo(){var t,e=!((t=this._instance.get_property(al))==null||!t.enabled),n=!this.qe.disable_session_recording,r=this.qe.disable_session_recording||this._instance.consent.isOptedOut();return ne&&e&&n&&!r}startIfEnabledOrStop(t){var e;if(!(this.ho||this.vo&&(e=this.oo)!=null&&e.isStarted)){var n=!he(Object.assign)&&!he(Array.from);this.vo&&n?(this.co(t),Oi.info("starting")):(this.lo=gC,this.stopRecording())}}co(t){var e,n,r;this.vo&&(this.lo!==ad&&this.lo!==rp&&(this.lo=vC),Fe!=null&&(e=Fe.__PosthogExtensions__)!=null&&(e=e.rrweb)!=null&&e.record&&(n=Fe.__PosthogExtensions__)!=null&&n.initSessionRecording?this.fo(t):(r=Fe.__PosthogExtensions__)==null||r.loadExternalDependency==null||r.loadExternalDependency(this._instance,this.po,(s=>{if(s)return Oi.error("could not load recorder",s);this.fo(t)})))}stopRecording(){var t,e;(t=this.uo)==null||t.call(this),this.uo=void 0,(e=this.oo)==null||e.stop()}mo(){var t,e;(t=this.uo)==null||t.call(this),this.uo=void 0,(e=this.oo)==null||e.discard()}yo(){var t,e;(t=this.Rr)==null||t.unregister(I2),(e=this.Rr)==null||e.unregister(Y6)}bo(t,e){if(Qe(t))return null;var n,r=sn(t)?t:parseFloat(t);return typeof(n=r)!="number"||!Number.isFinite(n)||0>n||n>1?(Oi.warn(e+" must be between 0 and 1. Ignoring invalid value:",t),null):r}_o(t){if(this.Rr){var e,n,r=this.Rr,s=()=>{var i,a=t.sessionRecording===!1?void 0:t.sessionRecording,u=this.bo((i=this.qe.session_recording)==null?void 0:i.sampleRate,"session_recording.sampleRate"),c=this.bo(a==null?void 0:a.sampleRate,"remote config sampleRate"),d=u??c;Qe(d)&&this.yo();var h=a==null?void 0:a.minimumDurationMilliseconds;r.register({[al]:ue({cache_timestamp:Date.now(),enabled:!!a},a,{networkPayloadCapture:ue({capturePerformance:t.capturePerformance},a==null?void 0:a.networkPayloadCapture),canvasRecording:{enabled:a==null?void 0:a.recordCanvas,fps:a==null?void 0:a.canvasFps,quality:a==null?void 0:a.canvasQuality},sampleRate:d,minimumDurationMilliseconds:he(h)?null:h,endpoint:a==null?void 0:a.endpoint,triggerMatchType:a==null?void 0:a.triggerMatchType,masking:a==null?void 0:a.masking,urlTriggers:a==null?void 0:a.urlTriggers,version:a==null?void 0:a.version,triggerGroups:a==null?void 0:a.triggerGroups})})};s(),(e=this.uo)==null||e.call(this),this.uo=(n=this._instance.sessionManager)==null?void 0:n.onSessionId(s)}}onRemoteConfig(t){var e=t.ok?t.config:void 0;return e&&"sessionRecording"in e?e.sessionRecording===!1?(this._o(e),void this.mo()):(this._o(e),void this.startIfEnabledOrStop()):(this.lo===ad&&(this.lo=rp,Oi.warn("config refresh failed, recording will not start until page reload")),void this.startIfEnabledOrStop())}log(t,e){var n;e===void 0&&(e="log"),(n=this.oo)!=null&&n.log?this.oo.log(t,e):Oi.warn("log called before recorder was ready")}get po(){var t,e,n=(t=this._instance)==null||(t=t.persistence)==null?void 0:t.get_property(al);return(n==null||(e=n.scriptConfig)==null?void 0:e.script)||"lazy-recorder"}wo(){var t,e=this._instance.get_property(al);if(!e)return!1;try{t=typeof e=="object"?e:JSON.parse(e)}catch(n){return Oi.warn("persisted remote config for session recording is invalid and will be ignored",n),!1}return!Qe(t.cache_timestamp)&&36e5>=Date.now()-t.cache_timestamp}fo(t){var e,n,r;if(!this.ho){if((e=Fe.__PosthogExtensions__)==null||!e.initSessionRecording)return Oi.warn("Called on script loaded before session recording is available. This can be caused by adblockers."),void this._instance.register_for_session({[sP]:!0});var s;if(this.oo||(this.oo=(s=Fe.__PosthogExtensions__)==null?void 0:s.initSessionRecording(this._instance,this.do),this.oo._forceAllowLocalhostNetworkCapture=this._forceAllowLocalhostNetworkCapture),!this.wo())return this.lo===rp||this.lo===ad?void 0:(this.lo=ad,Oi.info("persisted remote config is stale, requesting fresh config before starting"),void new RP(this._instance).load());this.lo=vC,(n=(r=this.oo).setDocumentWasEverVisible)==null||n.call(r,this.do),this.oo.start(t)}}onRRwebEmit(t){var e;(e=this.oo)==null||e.onRRwebEmit==null||e.onRRwebEmit(t)}overrideLinkedFlag(){var t,e;this.oo||(e=this.Rr)==null||e.register({[Q6]:!0}),(t=this.oo)==null||t.overrideLinkedFlag()}overrideSampling(){var t,e;this.oo||(e=this.Rr)==null||e.register({[X6]:!0}),(t=this.oo)==null||t.overrideSampling()}overrideTrigger(t){var e,n;this.oo||(n=this.Rr)==null||n.register({[t==="url"?J6:eP]:!0}),(e=this.oo)==null||e.overrideTrigger(t)}get sdkDebugProperties(){var t;return((t=this.oo)==null?void 0:t.sdkDebugProperties)||{$recording_status:this.status}}tryAddCustomEvent(t,e){var n;return!((n=this.oo)==null||!n.tryAddCustomEvent(t,e))}}},BN={autocapture:class{constructor(t){this.ko=!1,this.xo=null,this.So=!1,this.Co=!1,this.instance=t,this.rageclicks=new hC(t.config.rageclick),this.Mo=null}initialize(){this.startIfEnabled()}get qe(){var t,e,n=It(this.instance.config.autocapture)?this.instance.config.autocapture:{};return n.url_allowlist=(t=n.url_allowlist)==null?void 0:t.map((r=>new RegExp(r))),n.url_ignorelist=(e=n.url_ignorelist)==null?void 0:e.map((r=>new RegExp(r))),n}To(){if(this.isBrowserSupported()){if(ne&&_e){var t=n=>{n=n||(ne==null?void 0:ne.event);try{this.Eo(n)}catch(r){Bv.error("Failed to capture event",r)}};if(jt(_e,"submit",t,{capture:!0}),jt(_e,"change",t,{capture:!0}),jt(_e,"click",t,{capture:!0}),this.qe.capture_copied_text){var e=n=>{n=n||(ne==null?void 0:ne.event);try{this.Eo(n,Uv)}catch(r){Bv.error("Failed to capture copy/cut event",r)}};jt(_e,"copy",e,{capture:!0}),jt(_e,"cut",e,{capture:!0})}}}else Bv.info("Disabling Automatic Event Collection because this browser is not supported")}startIfEnabled(){this.isEnabled&&!this.ko&&(this.To(),this.ko=!0)}onRemoteConfig(t){if(this.So=!0,t.ok){var e=t.config;e.elementsChainAsString&&(this.Co=e.elementsChainAsString);var n=e.autocapture_opt_out;Kr(n)&&(this.instance.persistence&&this.instance.persistence.register({[by]:n}),this.xo=n),this.startIfEnabled()}else this.startIfEnabled()}setElementSelectors(t){this.Mo=t}getElementSelectors(t){var e,n=[];return(e=this.Mo)==null||e.forEach((r=>{var s=_e==null?void 0:_e.querySelectorAll(r);s==null||s.forEach((i=>{t===i&&n.push(r)}))})),n}get isEnabled(){var t,e,n=(t=this.instance.persistence)==null?void 0:t.props[by],r=this.xo,s=this.instance.tr()&&!this.So;if(Tr(r)&&!Kr(n)&&!s)return!1;var i=(e=this.xo)!==null&&e!==void 0?e:!!n;return!!this.instance.config.autocapture&&!i}Eo(t,e){if(e===void 0&&(e="$autocapture"),this.isEnabled){var n,r=Iv(t);uP(r)&&(r=r.parentNode||null),e==="$autocapture"&&t.type==="click"&&t instanceof MouseEvent&&this.instance.config.rageclick&&(n=this.rageclicks)!=null&&n.isRageClick(t.clientX,t.clientY,t.timeStamp||new Date().getTime())&&zE(r,this.instance.config.rageclick)&&this.Eo(t,"$rageclick");var s=e===Uv;if(r&&(function(p,m,_,w,y,x){var S;if(!ne||N2(p)||_!=null&&_.url_allowlist&&!$E(_.url_allowlist,x)||_!=null&&_.url_ignorelist&&$E(_.url_ignorelist,x))return!1;if(_!=null&&_.dom_event_allowlist){var P=_.dom_event_allowlist;if(P&&!P.some((A=>m.type===A)))return!1}var T=mP(p,w),k=T.parentIsUsefulElement,R=T.targetElementList;if(!(function(A,O){var D=O==null?void 0:O.element_allowlist;if(he(D))return!0;var N,j=function(Y){if(D.some((W=>Y.tagName.toLowerCase()===W)))return{v:!0}};for(var G of A)if(N=j(G))return N.v;return!1})(R,_)||!Fy(R,_==null?void 0:_.css_selector_allowlist)||Fy(R,(S=_==null?void 0:_.css_selector_ignorelist)!==null&&S!==void 0?S:VD))return!1;try{var M=ne.getComputedStyle(p);if(M&&M.getPropertyValue("cursor")==="pointer"&&m.type==="click")return!0}catch{}var L=p.tagName.toLowerCase();switch(L){case"html":return!1;case"form":return(y||["submit"]).indexOf(m.type)>=0;case"input":case"select":case"textarea":return(y||["change","click"]).indexOf(m.type)>=0;default:return k?(y||["click"]).indexOf(m.type)>=0:(y||["click"]).indexOf(m.type)>=0&&(D2.indexOf(L)>-1||p.getAttribute("contenteditable")==="true")}})(r,t,this.qe,s,s?["copy","cut"]:void 0,this.instance)){var i=ON(r,{e:t,maskAllElementAttributes:this.instance.config.mask_all_element_attributes,maskAllText:this.instance.config.mask_all_text,elementAttributeIgnoreList:this.qe.element_attribute_ignorelist,elementsChainAsString:this.Co,disableCaptureUrlHashes:this.instance.config.disable_capture_url_hashes}),a=i.props;if(i.explicitNoCapture)return!1;var u=this.getElementSelectors(r);if(u&&u.length>0&&(a.$element_selectors=u),e===Uv){var c,d=fP(ne==null||(c=ne.getSelection())==null?void 0:c.toString()),h=t.type||"clipboard";if(!d)return!1;a.$selected_content=d,a.$copy_type=h}return this.instance.capture(e,a),!0}}}isBrowserSupported(){return ir(_e==null?void 0:_e.querySelectorAll)}},historyAutocapture:class{constructor(t){var e;this._instance=t,this.Io=(ne==null||(e=ne.location)==null?void 0:e.pathname)||""}initialize(){this.startIfEnabled()}get isEnabled(){return this._instance.config.capture_pageview==="history_change"}startIfEnabled(){this.isEnabled&&(ve.info("History API monitoring enabled, starting..."),this.monitorHistoryChanges())}stop(){this.Po&&this.Po(),this.Po=void 0,ve.info("History API monitoring stopped")}monitorHistoryChanges(){ne&&ne.history&&(this.Ro("pushState"),this.Ro("replaceState"),this.Ao())}Ro(t){var e;if(ne&&((e=ne.history[t])==null||!e.__posthog_wrapped__)){var n=this;(function(r,s,i){try{if(!(s in r))return pC;var a={next:r[s]},u=i((function(){for(var c=arguments.length,d=new Array(c),h=0;c>h;h++)d[h]=arguments[h];return a.next.apply(this,d)}));return ir(u)&&(u.prototype=u.prototype||{},Object.defineProperties(u,{__posthog_wrapped__:{enumerable:!1,value:!0},__posthog_layer__:{enumerable:!1,value:a}})),r[s]=u,()=>{if(r[s]!==u)for(var c=r[s];ir(c)&&c.__posthog_layer__;){var d=c.__posthog_layer__;if(d.next===u)return void(d.next=a.next);c=d.next}else r[s]=a.next}}catch{return pC}})(ne.history,t,(r=>function(s,i,a){r.call(this,s,i,a),n.Fo(t)}))}}Fo(t){try{var e,n=ne==null||(e=ne.location)==null?void 0:e.pathname;if(!n)return;n!==this.Io&&this.isEnabled&&this._instance.capture(vu,{navigation_type:t}),this.Io=n}catch(r){ve.error("Error capturing "+t+" pageview",r)}}Ao(){if(!this.Po){var t=()=>{this.Fo("popstate")};jt(ne,"popstate",t),this.Po=()=>{ne&&ne.removeEventListener("popstate",t)}}}},heatmaps:class{get qe(){return this.instance.config}constructor(t){var e;this.Lo=!1,this.ko=!1,this.Oo=null,this.instance=t,this.Lo=!((e=this.instance.persistence)==null||!e.props[Sy]),this.rageclicks=new hC(t.config.rageclick)}initialize(){this.startIfEnabled()}get flushIntervalMilliseconds(){var t=5e3;return It(this.qe.capture_heatmaps)&&this.qe.capture_heatmaps.flush_interval_milliseconds&&(t=this.qe.capture_heatmaps.flush_interval_milliseconds),t}get isEnabled(){return Qe(this.qe.capture_heatmaps)?Qe(this.qe.enable_heatmaps)?this.Lo:this.qe.enable_heatmaps:this.qe.capture_heatmaps!==!1}startIfEnabled(){if(this.isEnabled){if(this.ko)return;DN.info("starting..."),this.Do(),this.Ee()}else{var t;clearInterval((t=this.Oo)!==null&&t!==void 0?t:void 0),this.$o(),this.getAndClearBuffer()}}onRemoteConfig(t){if(t.ok){var e=t.config;if("heatmaps"in e){var n=!!e.heatmaps;this.instance.persistence&&this.instance.persistence.register({[Sy]:n}),this.Lo=n,this.startIfEnabled()}}}getAndClearBuffer(){var t=this.R;return this.R=void 0,t}No(t){qv(t.originalEvent)&&this.ke(t.originalEvent,"deadclick")}Ee(){this.Oo&&clearInterval(this.Oo),this.Oo=(_e==null?void 0:_e.visibilityState)==="visible"?setInterval(this.br.bind(this),this.flushIntervalMilliseconds):null}Do(){ne&&_e&&(this.qo=this.br.bind(this),jt(ne,xm,this.qo),this.jo=t=>this.ke(t||(ne==null?void 0:ne.event)),jt(_e,"click",this.jo,{capture:!0}),this.Bo=t=>this.Ho(t||(ne==null?void 0:ne.event)),jt(_e,"mousemove",this.Bo,{capture:!0}),this.Uo=new ZE(this.instance,GD,this.No.bind(this)),this.Uo.startIfEnabledOrStop(),this.zo=this.Ee.bind(this),jt(_e,wm,this.zo),this.ko=!0)}$o(){var t;ne&&_e&&(this.qo&&ne.removeEventListener(xm,this.qo),this.jo&&_e.removeEventListener("click",this.jo,{capture:!0}),this.Bo&&_e.removeEventListener("mousemove",this.Bo,{capture:!0}),this.zo&&_e.removeEventListener(wm,this.zo),clearTimeout(this.Wo),(t=this.Uo)==null||t.stop(),this.ko=!1)}Vo(t,e){var n=this.instance.scrollManager.scrollY(),r=this.instance.scrollManager.scrollX(),s=this.instance.scrollManager.scrollElement(),i=(function(a,u,c){for(var d=a;d&&aa(d)&&!Yr(d,"body");){if(d===c)return!1;var h=void 0;try{var p,m,_;h=(p=(m=(_=d.ownerDocument)==null?void 0:_.defaultView)!==null&&m!==void 0?m:ne)==null?void 0:p.getComputedStyle(d).position}catch{return!1}if(Ke(u,h))return!0;d=hP(d)}return!1})(Iv(t),["fixed","sticky"],s);return{x:t.clientX+(i?0:r),y:t.clientY+(i?0:n),target_fixed:i,type:e}}ke(t,e){var n;if(e===void 0&&(e="click"),!FE(t.target)&&qv(t)){var r=this.Vo(t,e);(n=this.rageclicks)!=null&&n.isRageClick(t.clientX,t.clientY,new Date().getTime())&&zE(Iv(t),this.instance.config.rageclick)&&this.Gt(ue({},r,{type:"rageclick"})),this.Gt(r)}}Ho(t){!FE(t.target)&&qv(t)&&(clearTimeout(this.Wo),this.Wo=setTimeout((()=>{this.Gt(this.Vo(t,"mousemove"))}),500))}Gt(t){if(ne){var e=this.qe.disable_capture_url_hashes?oa(ne.location.href):ne.location.href,n=this.qe.custom_personal_data_properties,r=this.qe.mask_personal_data_properties?[...rc,...n||[]]:[],s=qd(e,r,Gd);this.R=this.R||{},this.R[s]||(this.R[s]=[]),this.R[s].push(t)}}br(){this.R&&!eo(this.R)&&this.instance.capture("$$heatmap",{$heatmap_data:this.getAndClearBuffer()})}},deadClicksAutocapture:ZE,webVitalsAutocapture:class{constructor(t){var e;this.Lo=!1,this.ko=!1,this.R={navigationKey:void 0,url:void 0,metrics:[],firstMetricTimestamp:void 0},this.Zo=()=>{clearTimeout(this.Go),this.Go=void 0,this.R.metrics.length!==0&&(this._instance.capture("$web_vitals",ue({$current_url:this.R.url},this.R.metrics.reduce(((n,r)=>ue({},n,{["$web_vitals_"+r.name+"_event"]:ue({},r),["$web_vitals_"+r.name+"_value"]:r.value})),{}))),this.R={navigationKey:void 0,url:void 0,metrics:[],firstMetricTimestamp:void 0})},this.Qo=n=>{var r;if(this.R=this.R||{navigationKey:void 0,url:void 0,metrics:[],firstMetricTimestamp:void 0},Qe(n==null?void 0:n.name)||Qe(n==null?void 0:n.value))Ha.error("Invalid metric received",n);else{var s=typeof n.navigationURL=="string"?n.navigationURL:void 0,i=this.Ko(s);if(!he(i)){var a=sn(n.navigationId)||typeof n.navigationId=="string"?"navigation:"+n.navigationId:"url:"+i;if(!this.Jo||this.Jo>n.value){this.R.navigationKey!==a&&(this.Zo(),this.Go=setTimeout(this.Zo,this.flushToCaptureTimeoutMs)),he(this.R.navigationKey)&&(this.R.navigationKey=a,this.R.url=i),this.R.firstMetricTimestamp=he(this.R.firstMetricTimestamp)?Date.now():this.R.firstMetricTimestamp,n.attribution&&n.attribution.interactionTargetElement&&(n.attribution.interactionTargetElement=void 0);var u=(r=this._instance.sessionManager)==null?void 0:r.checkAndGetSessionAndWindowId(!0),c=ue({},n,s?{navigationURL:i}:{},{$current_url:i,timestamp:Date.now()});he(u)||(c.$session_id=u.sessionId,c.$window_id=u.windowId),this.R.metrics.push(c),this.R.metrics.length===this.allowedMetrics.length&&this.Zo()}else Ha.error("Ignoring metric with value >= "+this.Jo,n)}}},this.Yo=()=>{if(!this.ko){var n,r,s,i,a=Fe.__PosthogExtensions__,u=a==null?void 0:a.postHogWebVitalsCallbacksByFlavor,c=(u==null?void 0:u[this.Xo])||(this.Xo==="web-vitals"&&he(u)?a==null?void 0:a.postHogWebVitalsCallbacks:void 0);if(he(c)||(n=c.onLCP,r=c.onCLS,s=c.onFCP,i=c.onINP),n&&r&&s&&i){var d={reportSoftNavs:this.useSoftNavs};this.allowedMetrics.indexOf("LCP")>-1&&n(this.Qo.bind(this),d),this.allowedMetrics.indexOf("CLS")>-1&&r(this.Qo.bind(this),d),this.allowedMetrics.indexOf("FCP")>-1&&s(this.Qo.bind(this),d),this.allowedMetrics.indexOf("INP")>-1&&i(this.Qo.bind(this),d),this.ko=!0}else Ha.error("web vitals callbacks not loaded - not starting")}},this._instance=t,this.Lo=!((e=this._instance.persistence)==null||!e.props[Py]),this.startIfEnabled()}get tl(){return this._instance.config.capture_performance}get allowedMetrics(){var t,e,n=It(this.tl)?(t=this.tl)==null?void 0:t.web_vitals_allowed_metrics:void 0;return Qe(n)?((e=this._instance.persistence)==null?void 0:e.props[Ty])||["CLS","FCP","INP","LCP"]:n}get flushToCaptureTimeoutMs(){return(It(this.tl)?this.tl.web_vitals_delayed_flush_ms:void 0)||5e3}get useAttribution(){var t=It(this.tl)?this.tl.web_vitals_attribution:void 0;return t!=null&&t}get useSoftNavs(){var t=It(this.tl)?this.tl.__preview_web_vitals_soft_navs:void 0;return t!=null&&t}get Jo(){var t=It(this.tl)&&sn(this.tl.__web_vitals_max_value)?this.tl.__web_vitals_max_value:mC;return t>0&&6e4>=t?mC:t}get isEnabled(){var t=Nt==null?void 0:Nt.protocol;if(t!=="http:"&&t!=="https:")return Ha.info("Web Vitals are disabled on non-http/https protocols"),!1;var e=It(this.tl)?this.tl.web_vitals:Kr(this.tl)?this.tl:void 0;return Kr(e)?e:this.Lo}startIfEnabled(){this.isEnabled&&!this.ko&&(Ha.info("enabled, starting..."),this.di(this.Yo))}onRemoteConfig(t){if(t.ok){var e=t.config;if("capturePerformance"in e){var n=It(e.capturePerformance)&&!!e.capturePerformance.web_vitals,r=It(e.capturePerformance)?e.capturePerformance.web_vitals_allowed_metrics:void 0;this._instance.persistence&&(this._instance.persistence.register({[Py]:n}),this._instance.persistence.register({[Ty]:r})),this.Lo=n,this.startIfEnabled()}}}get Xo(){return this.useSoftNavs?this.useAttribution?"web-vitals-with-attribution-soft-navs":"web-vitals-soft-navs":this.useAttribution?"web-vitals-with-attribution":"web-vitals"}di(t){var e=Fe.__PosthogExtensions__,n=this.Xo,r=e==null?void 0:e.postHogWebVitalsCallbacksByFlavor;r!=null&&r[n]||n==="web-vitals"&&he(r)&&e!=null&&e.postHogWebVitalsCallbacks?t():e==null||e.loadExternalDependency==null||e.loadExternalDependency(this._instance,n,(s=>{s?Ha.error("failed to load script",s):t()}))}Ko(t){var e=t||(ne==null?void 0:ne.location.href);if(e){var n=this._instance.config.disable_capture_url_hashes?oa(e):e,r=this._instance.config.custom_personal_data_properties,s=this._instance.config.mask_personal_data_properties?[...rc,...r||[]]:[];return qd(n,s,Gd)}Ha.error("Could not determine current URL")}}},WN={exceptionObserver:class{constructor(t){var e;this.Yo=()=>{var n;if(ne&&this.isEnabled&&(n=Fe.__PosthogExtensions__)!=null&&n.errorWrappingFunctions){var r=Fe.__PosthogExtensions__.errorWrappingFunctions.wrapOnError,s=Fe.__PosthogExtensions__.errorWrappingFunctions.wrapUnhandledRejection,i=Fe.__PosthogExtensions__.errorWrappingFunctions.wrapConsoleError;try{!this.el&&this.qe.capture_unhandled_errors&&(this.el=r(this.captureException.bind(this))),!this.il&&this.qe.capture_unhandled_rejections&&(this.il=s(this.captureException.bind(this))),!this.rl&&this.qe.capture_console_errors&&(this.rl=i(this.captureException.bind(this)))}catch(a){od.error("failed to start",a),this.nl()}}},this._instance=t,this.sl=!((e=this._instance.persistence)==null||!e.props[Ey]),this.al=new zL(ue({},(function(n){var r,s,i,a;return n===void 0&&(n={}),{refillRate:(r=(s=n.exceptionRateLimiterRefillRate)!==null&&s!==void 0?s:n.__exceptionRateLimiterRefillRate)!==null&&r!==void 0?r:1,bucketSize:(i=(a=n.exceptionRateLimiterBucketSize)!==null&&a!==void 0?a:n.__exceptionRateLimiterBucketSize)!==null&&i!==void 0?i:10}})(this._instance.config.error_tracking),{refillInterval:1e4,st:od})),this.qe=this.ol(),this.startIfEnabledOrStop()}ol(){var t=this._instance.config.capture_exceptions,e={capture_unhandled_errors:!1,capture_unhandled_rejections:!1,capture_console_errors:!1};return It(t)?e=ue({},e,t):(he(t)?this.sl:t)&&(e=ue({},e,{capture_unhandled_errors:!0,capture_unhandled_rejections:!0})),e}get isEnabled(){return this.qe.capture_console_errors||this.qe.capture_unhandled_errors||this.qe.capture_unhandled_rejections}startIfEnabledOrStop(){this.isEnabled?(od.info("enabled"),this.nl(),this.di(this.Yo)):this.nl()}di(t){var e,n;(e=Fe.__PosthogExtensions__)!=null&&e.errorWrappingFunctions?t():(n=Fe.__PosthogExtensions__)==null||n.loadExternalDependency==null||n.loadExternalDependency(this._instance,"exception-autocapture",(r=>{if(r)return od.error("failed to load script",r);t()}))}nl(){var t,e,n;(t=this.el)==null||t.call(this),this.el=void 0,(e=this.il)==null||e.call(this),this.il=void 0,(n=this.rl)==null||n.call(this),this.rl=void 0}onRemoteConfig(t){if(t.ok){var e=t.config;"autocaptureExceptions"in e&&(this.sl=!!e.autocaptureExceptions||!1,this._instance.persistence&&this._instance.persistence.register({[Ey]:this.sl}),this.qe=this.ol(),this.startIfEnabledOrStop())}}onConfigChange(){this.qe=this.ol()}captureException(t){var e,n,r,s=(e=t==null||(n=t.$exception_list)==null||(n=n[0])==null?void 0:n.type)!==null&&e!==void 0?e:"Exception";this.al.consumeRateLimit(s)?od.info("Skipping exception capture because of client rate limiting.",{exception:s}):(r=this._instance.exceptions)==null||r.sendExceptionEvent(t)}},exceptions:class{constructor(t){var e,n;this.ll=[],this.ul=new iD([new hD,new bD,new mD,new pD,new wD,new _D,new vD,new xD],(function(r){for(var s=arguments.length,i=new Array(s>1?s-1:0),a=1;s>a;a++)i[a-1]=arguments[a];return function(u,c){c===void 0&&(c=0);for(var d=[],h=u.split(`
19
- `),p=c;h.length>p;p++){var m=h[p];if(1024>=m.length){var _=OE.test(m)?m.replace(OE,"$1"):m;if(!_.match(/\S*Error: /)){for(var w of i){var y=w(_,r);if(y){d.push(y);break}}if(d.length>=50)break}}}return(function(x){if(!x.length)return[];var S=Array.from(x);return S.reverse(),S.slice(0,50).map((P=>{return ue({},P,{filename:P.filename||(T=S,T[T.length-1]||{}).filename,function:P.function||ec});var T}))})(d)}})("web:javascript",uD,fD)),this._instance=t,this.ll=(e=(n=this._instance.persistence)==null?void 0:n.get_property(Cy))!==null&&e!==void 0?e:[],this.hl=pm(this.dl()),this.vl=new ED(this.hl)}onConfigChange(){this.hl=pm(this.dl()),this.vl.setConfig(this.hl)}onRemoteConfig(t){var e,n,r;if(t.ok){var s=t.config;if("errorTracking"in s){var i=(e=(n=s.errorTracking)==null?void 0:n.suppressionRules)!==null&&e!==void 0?e:[],a=(r=s.errorTracking)==null?void 0:r.captureExtensionExceptions;this.ll=i,this._instance.persistence&&this._instance.persistence.register({[Cy]:this.ll,[ky]:a})}}}get cl(){var t,e=!!this._instance.get_property(ky),n=this._instance.config.error_tracking.captureExtensionExceptions;return(t=n??e)!==null&&t!==void 0&&t}buildProperties(t,e){return this.ul.buildFromUnknown(t,{syntheticException:e==null?void 0:e.syntheticException,mechanism:{handled:e==null?void 0:e.handled}})}addExceptionStep(t,e){if(this.hl.enabled)try{if(!ht(t)||t.trim().length===0)return void Qs.warn("Ignoring exception step because message must be a non-empty string");var n=(function(i){if(!i)return{sanitizedProperties:{},droppedKeys:[]};var a=[];return{sanitizedProperties:Object.keys(i).reduce(((u,c)=>SD.has(c)?(a.push(c),u):(u[c]=i[c],u)),{}),droppedKeys:a}})(this.fl(e)),r=n.sanitizedProperties,s=n.droppedKeys;s.length>0&&Qs.warn("Ignoring reserved exception step fields",{droppedKeys:s}),this.vl.add(ue({[fm]:t,[hm]:new Date().toISOString()},r))}catch(i){Qs.error("Failed to add exception step. Ignoring breadcrumb.",i)}}sendExceptionEvent(t){try{var e=t.$exception_list;if(this.pl(e)){if(this.gl(e))return this.ml("Exception dropped: matched a suppression rule"),void Qs.info("Skipping exception capture because a suppression rule matched");if(!this.cl&&this.yl(e))return this.ml("Exception dropped: thrown by a browser extension"),void Qs.info("Skipping exception capture because it was thrown by an extension");if(!this._instance.config.error_tracking.__capturePostHogExceptions&&this.bl(e))return this.ml("Exception dropped: thrown by the PostHog SDK"),void Qs.info("Skipping exception capture because it was thrown by the PostHog SDK")}var n=this.hl.enabled&&Qe(t.$exception_steps)?this._l(t):t,r=typeof(i=globalThis._posthogReleaseId)=="string"&&i.length>0?i:void 0;r&&(n.$release_id=r);try{var s=this._instance.capture("$exception",n,{_noTruncate:!0,_batchKey:"exceptionEvent",ts:!0});return s&&this.vl.clear(),s}catch(a){return Qs.error("Failed to capture exception event. Dropping this exception.",a),void this.vl.clear()}}catch(a){return void Qs.error("Failed to process exception event. Ignoring this exception.",a)}var i}_l(t){try{var e=this.vl.getAttachable();return e.length===0?t:ue({},t,{$exception_steps:e})}catch(n){return Qs.error("Failed to read buffered exception steps. Capturing exception without steps.",n),t}}ml(t){this.hl.enabled&&this.vl.add({[fm]:t,[hm]:new Date().toISOString()})}fl(t){return It(t)?ue({},t):{}}dl(){var t,e;return(t=(e=this._instance.config.error_tracking)==null?void 0:e.exception_steps)!==null&&t!==void 0?t:{}}gl(t){if(t.length===0)return!1;try{var e=t.reduce(((n,r)=>{var s=r.type,i=r.value;return ht(s)&&s.length>0&&n.$exception_types.push(s),ht(i)&&i.length>0&&n.$exception_values.push(i),n}),{$exception_types:[],$exception_values:[]});return this.ll.some((n=>{var r=n.values.map((s=>{var i=UP[s.operator],a=e[s.key];if(!i||!a)return!1;var u=Ze(s.value)?s.value:[s.value];return u.length>0&&i(u,a)}));return n.type==="OR"?r.some(Boolean):r.every(Boolean)}))}catch(n){return Qs.warn("Failed to evaluate suppression rules. Capturing the exception.",n),!1}}yl(t){return t.flatMap((e=>{var n,r;return(n=(r=e.stacktrace)==null?void 0:r.frames)!==null&&n!==void 0?n:[]})).some((e=>e.filename&&e.filename.startsWith("chrome-extension://")))}bl(t){if(t.length>0){var e,n,r,s,i=(e=(n=t[0].stacktrace)==null?void 0:n.frames)!==null&&e!==void 0?e:[],a=i[i.length-1];return(r=a==null||(s=a.filename)==null?void 0:s.includes("posthog.com/static"))!==null&&r!==void 0&&r}return!1}pl(t){return!Qe(t)&&Ze(t)}}},qN=ue({productTours:class{get Rr(){return this._instance.persistence}constructor(t){this.wl=null,this.kl=null,this._instance=t}initialize(){this.loadIfEnabled()}onRemoteConfig(t){if(t.ok){var e=t.config;if("productTours"in e){var n,r;if(this.Rr&&this.Rr.register({[A2]:!!e.productTours}),!Gv(this._instance))return!this.wl&&Qe((n=this.Rr)==null?void 0:n.props[_d])||sp.info("product tours disabled; stopping and clearing cached tours"),(r=this.wl)==null||r.stop(),this.wl=null,void this.clearCache();this.loadIfEnabled()}}}loadIfEnabled(){!this.wl&&Gv(this._instance)&&this.di((()=>this.xl()))}di(t){var e,n;(e=Fe.__PosthogExtensions__)!=null&&e.generateProductTours?t():(n=Fe.__PosthogExtensions__)==null||n.loadExternalDependency==null||n.loadExternalDependency(this._instance,"product-tours",(r=>{r?sp.error("Could not load product tours script",r):t()}))}xl(){var t;!this.wl&&(t=Fe.__PosthogExtensions__)!=null&&t.generateProductTours&&(this.wl=Fe.__PosthogExtensions__.generateProductTours(this._instance,!0))}getProductTours(t,e){if(e===void 0&&(e=!1),!Ze(this.kl)||e){var n=this.Rr;if(n){var r=n.props[_d];if(Ze(r)&&!e)return this.kl=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:s=>{if(Gv(this._instance)){var i=s.statusCode;if(i!==200||!s.json){var a="Product Tours API could not be loaded, status: "+i;return i===0?s.error||sp.warn(a):sp.error(a),void t([],{isLoaded:!1,error:a})}var u=Ze(s.json.product_tours)?s.json.product_tours:[];this.kl=u,n&&n.register({[_d]:u}),t(u,{isLoaded:!0})}else t([],{isLoaded:!0})}})}else t(this.kl,{isLoaded:!0})}getActiveProductTours(t){Qe(this.wl)?t([],{isLoaded:!1,error:"Product tours not loaded"}):this.wl.getActiveProductTours(t)}showProductTour(t){var e;(e=this.wl)==null||e.showTourById(t)}previewTour(t){this.wl?this.wl.previewTour(t):this.di((()=>{var e;this.xl(),(e=this.wl)==null||e.previewTour(t)}))}dismissProductTour(){var t;(t=this.wl)==null||t.dismissTour("user_clicked_skip")}nextStep(){var t;(t=this.wl)==null||t.nextStep()}previousStep(){var t;(t=this.wl)==null||t.previousStep()}clearCache(){var t;this.kl=null,(t=this.Rr)==null||t.unregister(_d)}resetTour(t){var e;(e=this.wl)==null||e.resetTour(t)}resetAllTours(){var t;(t=this.wl)==null||t.resetAllTours()}cancelPendingTour(t){var e;(e=this.wl)==null||e.cancelPendingTour(t)}}},u0),GN={siteApps:class{constructor(t){this.Sl=0,this._instance=t,this.Cl=[],this.apps={}}get isEnabled(){return!!this._instance.config.opt_in_site_apps}Ml(t,e){if(e){var n=this.globalsForEvent(e);this.Cl.push(n),this.Cl.length>1e3&&(this.Cl=this.Cl.slice(10))}}get siteAppLoaders(){var t;return(t=Fe._POSTHOG_REMOTE_CONFIG)==null||(t=t[this._instance.config.token])==null?void 0:t.siteApps}initialize(){if(this.isEnabled){var t=this._instance._addCaptureHook(this.Ml.bind(this));this.Tl=()=>{t(),this.Cl=[],this.Tl=void 0}}}globalsForEvent(t){var e,n,r,s,i,a,u;if(!t)throw new Error("Event payload is required");var c={},d=this._instance.get_property("$groups")||[],h=this._instance.get_property("$stored_group_properties")||{};for(var p of Object.entries(h)){var m=p[0];c[m]={id:d[m],type:m,properties:p[1]}}var _=t.$set_once,w=t.$set;return{event:ue({},p6(t,NN),{properties:ue({},t.properties,w?{$set:ue({},(e=(n=t.properties)==null?void 0:n.$set)!==null&&e!==void 0?e:{},w)}:{},_?{$set_once:ue({},(r=(s=t.properties)==null?void 0:s.$set_once)!==null&&r!==void 0?r:{},_)}:{}),elements_chain:(i=(a=t.properties)==null?void 0:a.$elements_chain)!==null&&i!==void 0?i:"",distinct_id:(u=t.properties)==null?void 0:u.distinct_id}),person:{properties:this._instance.get_property("$stored_person_properties")},groups:c}}El(t){var e,n=(e=t.tagName)==null?void 0:e.toLowerCase();return n==="style"&&this._instance.config.prepare_external_dependency_stylesheet?this._instance.config.prepare_external_dependency_stylesheet(t)||(Xs.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)||(Xs.error("prepare_external_dependency_script returned null"),null):t}Il(){var t,e,n,r,s,i,a,u;if(!this._instance.config.prepare_external_dependency_stylesheet&&!this._instance.config.prepare_external_dependency_script)return()=>{};var c=_e==null?void 0:_e.defaultView,d=c==null||(t=c.Node)==null?void 0:t.prototype;if(!c||!d)return()=>{};if(this.Sl++,this.Pl)return this.Rl();var h=[],p=this,m=new WeakSet,_=(x,S,P)=>{if(x!=null&&x[S]){var T=x[S];x[S]=P(T),h.push((()=>{x[S]=T}))}},w=x=>{if(m.has(x))return x;var S=p.El(x);return S&&m.add(S),S},y=x=>x.map((S=>typeof S=="string"?S:w(S))).filter((S=>!Tr(S)));return _(d,"appendChild",(x=>function(S){var P=w(S);return P?x.call(this,P):S})),_(d,"insertBefore",(x=>function(S,P){var T=w(S);return T?x.call(this,T,P):S})),_(d,"replaceChild",(x=>function(S,P){var T=w(S);return T?x.call(this,T,P):P})),[(e=c.Element)==null?void 0:e.prototype,(n=c.Document)==null?void 0:n.prototype,(r=c.DocumentFragment)==null?void 0:r.prototype].forEach((x=>{_(x,"append",(S=>function(){for(var P=arguments.length,T=new Array(P),k=0;P>k;k++)T[k]=arguments[k];return S.apply(this,y(T))})),_(x,"prepend",(S=>function(){for(var P=arguments.length,T=new Array(P),k=0;P>k;k++)T[k]=arguments[k];return S.apply(this,y(T))}))})),[(s=c.Element)==null?void 0:s.prototype,(i=c.CharacterData)==null?void 0:i.prototype,(a=c.DocumentType)==null?void 0:a.prototype].forEach((x=>{_(x,"before",(S=>function(){for(var P=arguments.length,T=new Array(P),k=0;P>k;k++)T[k]=arguments[k];return S.apply(this,y(T))})),_(x,"after",(S=>function(){for(var P=arguments.length,T=new Array(P),k=0;P>k;k++)T[k]=arguments[k];return S.apply(this,y(T))})),_(x,"replaceWith",(S=>function(){for(var P=arguments.length,T=new Array(P),k=0;P>k;k++)T[k]=arguments[k];var R=y(T);return T.length&&!R.length?void 0:S.apply(this,R)}))})),_((u=c.Element)==null?void 0:u.prototype,"insertAdjacentElement",(x=>function(S,P){var T=w(P);return T?x.call(this,S,T):null})),this.Pl=()=>{h.forEach((x=>x())),this.Pl=void 0},this.Rl()}Rl(){var t=!1;return()=>{var e;t||(t=!0,this.Sl--,this.Sl===0&&((e=this.Pl)==null||e.call(this)))}}Al(t,e){e===void 0&&(e=!0);var n=this.Il();try{var r=t(n);return e&&n(),r}catch(s){throw n(),s}}setupSiteApp(t){var e=this.apps[t.id],n=()=>{var a;!e.errored&&this.Cl.length&&(Xs.info("Processing "+this.Cl.length+" events for site app with id "+t.id),this.Cl.forEach((u=>this.Al((()=>e.processEvent==null?void 0:e.processEvent(u))))),e.processedBuffer=!0),Object.values(this.apps).every((u=>u.processedBuffer||u.errored))&&((a=this.Tl)==null||a.call(this))},r=!1,s=a=>{e.errored=!a,e.loaded=!0,Xs.info("Site app with id "+t.id+" "+(a?"loaded":"errored")),r&&n()};try{var i=this.Al((a=>t.init({posthog:this._instance,callback(u){a(),s(u)}})),!1).processEvent;i&&(e.processEvent=i),r=!0}catch(a){Xs.error(yC+t.id,a),s(!1)}if(r&&e.loaded)try{n()}catch(a){Xs.error("Error while processing buffered events PostHog app with config id "+t.id,a),e.errored=!0}}Fl(){var t=this.siteAppLoaders||[];for(var e of t)this.apps[e.id]={id:e.id,loaded:!1,errored:!1,processedBuffer:!1};for(var n of t)this.setupSiteApp(n)}Ll(t){var e=this;if(Object.keys(this.apps).length!==0){var n=this.globalsForEvent(t),r=function(i){try{e.Al((()=>i.processEvent==null?void 0:i.processEvent(n)))}catch(a){Xs.error("Error while processing event "+t.event+" for site app "+i.id,a)}};for(var s of Object.values(this.apps))r(s)}}onRemoteConfig(t){var e,n,r,s=this;if((e=this.siteAppLoaders)!=null&&e.length)return this.isEnabled?(this.Fl(),void this._instance.on("eventCaptured",(c=>this.Ll(c)))):void Xs.error('PostHog site apps are disabled. Enable the "opt_in_site_apps" config to proceed.');if((n=this.Tl)==null||n.call(this),t.ok){var i=t.config;if((r=i.siteApps)!=null&&r.length)if(this.isEnabled){var a=function(){var c,d=u.id,h=u.url;Fe["__$$ph_site_app_"+d]=s._instance,(c=Fe.__PosthogExtensions__)==null||c.loadSiteApp==null||c.loadSiteApp(s._instance,h,(p=>{if(p)return Xs.error(yC+d,p)}))};for(var u of i.siteApps)a()}else Xs.error('PostHog site apps are disabled. Enable the "opt_in_site_apps" config to proceed.')}}}},KN={tracingHeaders:class{constructor(t){this.Ol=void 0,this.Dl=void 0,this.$l=void 0,this.Yo=()=>{var e,n,r=this.Nl();r?(he(this.Ol)&&(this.Ol=(e=Fe.__PosthogExtensions__)==null||(e=e.tracingHeadersPatchFns)==null?void 0:e._patchXHR(r,(()=>this._instance.get_distinct_id()),this._instance.sessionManager)),he(this.Dl)&&(this.Dl=(n=Fe.__PosthogExtensions__)==null||(n=n.tracingHeadersPatchFns)==null?void 0:n._patchFetch(r,(()=>this._instance.get_distinct_id()),this._instance.sessionManager))):this.nl()},this._instance=t}initialize(){this.startIfEnabledOrStop()}di(t){var e,n;(e=Fe.__PosthogExtensions__)!=null&&e.tracingHeadersPatchFns?t():(n=Fe.__PosthogExtensions__)==null||n.loadExternalDependency==null||n.loadExternalDependency(this._instance,"tracing-headers",(r=>{if(r)return LN.error("failed to load script",r);t()}))}ql(){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}Nl(){var t=this.ql();return Ze(t)?(Ze(this.$l)?this.$l.splice(0,this.$l.length,...t):this.$l=[...t],t.length>0?this.$l:void 0):(Ze(this.$l)&&this.$l.splice(0),this.$l=t||void 0,this.$l)}nl(){var t,e;(t=this.Ol)==null||t.call(this),(e=this.Dl)==null||e.call(this),this.Ol=void 0,this.Dl=void 0}startIfEnabledOrStop(){this.Nl()?this.di(this.Yo):this.nl()}}},ZN=ue({surveys:class{get qe(){return this._instance.config}constructor(t){this.jl=void 0,this._surveyManager=null,this.Bl=!1,this.Hl=[],this.Ul=null,this.zl=null,this._instance=t,this._surveyEventReceiver=null}initialize(){this.loadIfEnabled()}onRemoteConfig(t){if(!this.qe.disable_surveys){if(!t.ok)return vt.warn("Remote config unavailable. Not loading surveys.");var e=t.config.surveys;if(Qe(e))return vt.warn("Flags not loaded yet. Not loading surveys.");var n=Ze(e);this.jl=n?e.length>0:e,vt.info("flags response received, isSurveysEnabled: "+this.jl),this.loadIfEnabled()}}reset(){try{var t;(t=this._surveyEventReceiver)==null||t.reset(),localStorage.removeItem("lastSeenSurveyDate");for(var e=[],n=0;n<localStorage.length;n++){var r=localStorage.key(n);(r!=null&&r.startsWith(qP)||r!=null&&r.startsWith("inProgressSurvey_"))&&e.push(r)}e.forEach((s=>localStorage.removeItem(s)))}catch{}}loadIfEnabled(){if(!this._surveyManager)if(this.Bl)vt.info("Already initializing surveys, skipping...");else if(this.qe.disable_surveys)vt.info(_C);else if(this.qe.cookieless_mode&&this._instance.consent.isOptedOut())vt.info("Not loading surveys in cookieless mode without consent.");else{var t=Fe==null?void 0:Fe.__PosthogExtensions__;if(t){if(!he(this.jl)||this.qe.advanced_enable_surveys){var e=this.jl||this.qe.advanced_enable_surveys;this.Bl=!0;try{var n=t.generateSurveys;if(n)return void this.Wl(n,e);var r=t.loadExternalDependency;if(!r)return void this.Vl(M2);r(this._instance,"surveys",(s=>{s||!t.generateSurveys?this.Vl("Could not load surveys script",s):this.Wl(t.generateSurveys,e)}))}catch(s){throw this.Vl("Error initializing surveys",s),s}finally{this.Bl=!1}}}else vt.error("PostHog Extensions not found.")}}Wl(t,e){this._surveyManager=t(this._instance,e),this._surveyEventReceiver=new $N(this._instance),vt.info("Surveys loaded successfully"),this.Zl({isLoaded:!0})}Vl(t,e){vt.error(t,e),this.Zl({isLoaded:!1,error:t})}onSurveysLoaded(t){return this.Hl.push(t),this._surveyManager&&this.Zl({isLoaded:!0}),()=>{this.Hl=this.Hl.filter((e=>e!==t))}}getSurveys(t,e){if(e===void 0&&(e=!1),this.qe.disable_surveys)return vt.info(_C),t([]);var n,r=this._instance.get_property(Ay);if(r&&!e)return t(r,{isLoaded:!0}),void(this.Gl()&&this.getSurveys((()=>{}),!0));typeof Promise<"u"&&this.Ul?this.Ul.then((s=>t(s.surveys,s.context))):(typeof Promise<"u"&&(this.Ul=new Promise((s=>{n=s}))),this._instance._send_request({url:this._instance.requestRouter.endpointFor("api","/api/surveys/?token="+this.qe.token),method:"GET",timestampMode:"query",timeout:this.qe.surveys_request_timeout_ms,callback:s=>{var i;this.Ul=null;var a=s.statusCode;if(a!==200||!s.json){var u="Surveys API could not be loaded, status: "+a;a!==0?vt.error(u):s.error||vt.warn(u),this.zl=Date.now();var c={isLoaded:!1,error:u};return t([],c),void(n==null||n({surveys:[],context:c}))}this.zl=null;var d,h=s.json.surveys||[],p=h.filter((_=>(function(w){return!(!w.start_date||w.end_date)})(_)&&(WP(_)||(function(w){var y;return!((y=w.conditions)==null||(y=y.actions)==null||(y=y.values)==null||!y.length)})(_))));p.length>0&&((d=this._surveyEventReceiver)==null||d.register(p)),(i=this._instance.persistence)==null||i.register({[Ay]:h,[vm]:Date.now()});var m={isLoaded:!0};t(h,m),n==null||n({surveys:h,context:m})}}))}Gl(){return this.Ql()&&!this.Ul&&!this.Kl()}Ql(){var t=this._instance.get_property(vm);return sn(t)&&Date.now()-t>3e5}Kl(){return sn(this.zl)&&3e5>Date.now()-this.zl}markSurveyAsSeen(t,e){var n,r={id:t,current_iteration:(n=e==null?void 0:e.iteration)!==null&&n!==void 0?n:null};GP(r);try{localStorage.setItem("lastSeenSurveyDate",new Date().toISOString())}catch{}}Zl(t){for(var e of this.Hl)try{if(!t.isLoaded)return e([],t);this.getSurveys(e)}catch(n){vt.error("Error in survey callback",n)}}getActiveMatchingSurveys(t,e){if(e===void 0&&(e=!1),!Qe(this._surveyManager))return this._surveyManager.getActiveMatchingSurveys(t,e);vt.warn("init was not called")}Jl(t){var e=null;return this.getSurveys((n=>{var r;e=(r=n.find((s=>s.id===t)))!==null&&r!==void 0?r:null})),e}Yl(t){if(Qe(this._surveyManager))return{eligible:!1,reason:ip};var e=typeof t=="string"?this.Jl(t):t;return e?this._surveyManager.checkSurveyEligibility(e):{eligible:!1,reason:"Survey not found"}}Xl(t){if(Qe(this._surveyManager))return{eligible:!1,reason:ip};var e=typeof t=="string"?this.Jl(t):t;return e?this._surveyManager.checkSurveyRenderability(e):{eligible:!1,reason:"Survey not found"}}canRenderSurvey(t){if(Qe(this._surveyManager))return vt.warn("init was not called"),{visible:!1,disabledReason:ip};var e=this.Xl(t);return{visible:e.eligible,disabledReason:e.reason}}canRenderSurveyAsync(t,e){return Qe(this._surveyManager)?(vt.warn("init was not called"),Promise.resolve({visible:!1,disabledReason:ip})):new Promise((n=>{this.getSurveys((r=>{var s,i=(s=r.find((u=>u.id===t)))!==null&&s!==void 0?s:null;if(i){var a=this.Xl(i);n({visible:a.eligible,disabledReason:a.reason})}else n({visible:!1,disabledReason:"Survey not found"})}),e)}))}renderSurvey(t,e,n){var r;if(Qe(this._surveyManager))vt.warn("init was not called");else{var s=typeof t=="string"?this.Jl(t):t;if(s!=null&&s.id)if(xN.includes(s.type)){var i=_e==null?void 0:_e.querySelector(e);if(i)return(r=s.appearance)!=null&&r.surveyPopupDelaySeconds?(vt.info("Rendering survey "+s.id+" with delay of "+s.appearance.surveyPopupDelaySeconds+" seconds"),void setTimeout((()=>{var a,u;vt.info("Rendering survey "+s.id+" with delay of "+((a=s.appearance)==null?void 0:a.surveyPopupDelaySeconds)+" seconds"),(u=this._surveyManager)==null||u.renderSurvey(s,i,n),vt.info("Survey "+s.id+" rendered")}),1e3*s.appearance.surveyPopupDelaySeconds)):void this._surveyManager.renderSurvey(s,i,n);vt.warn("Survey element not found")}else vt.warn("Surveys of type "+s.type+" cannot be rendered in the app");else vt.warn("Survey not found")}}displaySurvey(t,e){var n;if(Qe(this._surveyManager))vt.warn("init was not called");else{var r=this.Jl(t);if(r){var s=r;if((n=r.appearance)!=null&&n.surveyPopupDelaySeconds&&e.ignoreDelay&&(s=ue({},r,{appearance:ue({},r.appearance,{surveyPopupDelaySeconds:0})})),e.displayType!==Vy.Popover&&e.initialResponses&&vt.warn("initialResponses is only supported for popover surveys. prefill will not be applied."),e.ignoreConditions===!1){var i=this.Yl(r);if(!i.eligible)return void vt.warn("Survey is not eligible to be displayed: ",i.reason)}e.displayType!==Vy.Inline?this._surveyManager.handlePopoverSurvey(s,e):this.renderSurvey(s,e.selector,e.properties)}else vt.warn("Survey not found")}}cancelPendingSurvey(t){Qe(this._surveyManager)?vt.warn("init was not called"):this._surveyManager.cancelSurvey(t)}handlePageUnload(){var t;(t=this._surveyManager)==null||t.handlePageUnload==null||t.handlePageUnload()}}},u0),YN={toolbar:class{constructor(t){this.instance=t}tu(t){Fe.ph_toolbar_state=t}eu(){var t;return(t=Fe.ph_toolbar_state)!==null&&t!==void 0?t:0}initialize(){return this.maybeLoadToolbar()}maybeLoadToolbar(t,e,n){if(t===void 0&&(t=void 0),e===void 0&&(e=void 0),n===void 0&&(n=void 0),jy(this.instance.config)||!ne||!_e)return!1;t=t??ne.location,n=n??ne.history;try{if(!e){try{ne.localStorage.setItem("test","test"),ne.localStorage.removeItem("test")}catch{return!1}e=ne==null?void 0:ne.localStorage}var r,s=VN||Em(t.hash,"__posthog")||Em(t.hash,"state"),i=s?NE((()=>JSON.parse(atob(decodeURIComponent(s)))))||NE((()=>JSON.parse(decodeURIComponent(s)))):null;return i&&i.action==="ph_authorize"?((r=i).source="url",r&&Object.keys(r).length>0&&(i.desiredHash?t.hash=i.desiredHash:n?n.replaceState(n.state,"",t.pathname+t.search):t.hash="")):((r=JSON.parse(e.getItem(wC)||"{}")).source="localstorage",delete r.userIntent),!(!r.token||this.instance.config.token!==r.token||(this.loadToolbar(r),0))}catch{return!1}}iu(t){var e=Fe.ph_load_toolbar||Fe.ph_load_editor;!Qe(e)&&ir(e)?e(t,this.instance):xC.warn("No toolbar load function found")}loadToolbar(t){var e=!(_e==null||!_e.getElementById(lP));if(!ne||e)return!1;var n=this.instance.requestRouter.region==="custom"&&this.instance.config.advanced_disable_toolbar_metrics,r=ue({token:this.instance.config.token},t,{apiURL:this.instance.requestRouter.endpointFor("ui")},n?{instrument:!1}:{});if(ne.localStorage.setItem(wC,JSON.stringify(ue({},r,{source:void 0}))),this.eu()===2)this.iu(r);else if(this.eu()===0){var s;this.tu(1),(s=Fe.__PosthogExtensions__)==null||s.loadExternalDependency==null||s.loadExternalDependency(this.instance,"toolbar",(i=>{if(i)return xC.error("[Toolbar] Failed to load",i),void this.tu(0);this.tu(2),this.iu(r)})),jt(ne,"turbolinks:load",(()=>{this.tu(0),this.loadToolbar(r)}))}return!0}ru(t){return this.loadToolbar(t)}maybeLoadEditor(t,e,n){return t===void 0&&(t=void 0),e===void 0&&(e=void 0),n===void 0&&(n=void 0),this.maybeLoadToolbar(t,e,n)}}},XN=ue({experiments:Zn},u0),QN={conversations:class{constructor(t){this.nu=void 0,this._conversationsManager=null,this.su=!1,this.au=null,this.ou=!1,this._instance=t}initialize(){this.loadIfEnabled()}onRemoteConfig(t){if(!this._instance.config.disable_conversations&&(this.lu=t.ok,t.ok)){var e=t.config.conversations;Qe(e)||(Kr(e)?this.nu=e:(this.nu=e.enabled,this.au=e),this.loadIfEnabled())}}reset(){var t;(t=this._conversationsManager)==null||t.reset(),this._conversationsManager=null,this.nu=void 0,this.au=null,this.lu=void 0,this.ou=!1}loadIfEnabled(){if(!(this._conversationsManager||this.su||this._instance.config.disable_conversations||jy(this._instance.config)||this._instance.config.cookieless_mode&&this._instance.consent.isOptedOut())){var t=Fe==null?void 0:Fe.__PosthogExtensions__;if(t&&!he(this.nu)&&this.nu)if(this.au&&this.au.token){this.su=!0;try{var e=t.initConversations;if(e)return this.uu(e),void(this.su=!1);var n=t.loadExternalDependency;if(!n)return void this.hu(M2);n(this._instance,"conversations",(r=>{r||!t.initConversations?this.hu("Could not load conversations script",r):this.uu(t.initConversations),this.su=!1}))}catch(r){this.hu("Error initializing conversations",r),this.su=!1}}else gs.error("Conversations enabled but missing token in remote config.")}}uu(t){if(this.au)try{this._conversationsManager=t(this.au,this._instance),this.ou=!1,gs.info("Conversations loaded successfully")}catch(e){this.hu("Error completing conversations initialization",e)}else gs.error("Cannot complete initialization: remote config is null")}hu(t,e){gs.error(t,e),this._conversationsManager=null,this.su=!1,this.ou=!0}show(){this._conversationsManager?this._conversationsManager.show():gs.warn("Conversations not loaded yet.")}hide(){this._conversationsManager&&this._conversationsManager.hide()}isAvailable(){return this.nu===!0&&!Tr(this._conversationsManager)}getUnavailableReason(){return this.isAvailable()?null:this._instance.config.disable_conversations?"disabled_by_config":jy(this._instance.config)?"disabled_for_toolbar":this._instance.config.cookieless_mode&&this._instance.consent.isOptedOut()?"consent_opted_out":this.lu===!1?"remote_config_failed":he(this.nu)?this.lu?"disabled_in_project":"remote_config_pending":this.nu?Qe(this.au)||!this.au.token?"missing_token":Fe!=null&&Fe.__PosthogExtensions__?this.su?"initializing":this.ou?"load_failed":"not_loaded":"extensions_unavailable":"disabled_in_project"}isVisible(){var t,e;return(t=(e=this._conversationsManager)==null?void 0:e.isVisible())!==null&&t!==void 0&&t}sendMessage(t,e,n){var r=this;return St((function*(){return r._conversationsManager?r._conversationsManager.sendMessage(t,e,n):(gs.warn(Ua),null)}))()}getMessages(t,e){var n=this;return St((function*(){return n._conversationsManager?n._conversationsManager.getMessages(t,e):(gs.warn(Ua),null)}))()}markAsRead(t){var e=this;return St((function*(){return e._conversationsManager?e._conversationsManager.markAsRead(t):(gs.warn(Ua),null)}))()}getTickets(t){var e=this;return St((function*(){return e._conversationsManager?e._conversationsManager.getTickets(t):(gs.warn(Ua),null)}))()}requestRestoreLink(t){var e=this;return St((function*(){return e._conversationsManager?e._conversationsManager.requestRestoreLink(t):(gs.warn(Ua),null)}))()}restoreFromToken(t){var e=this;return St((function*(){return e._conversationsManager?e._conversationsManager.restoreFromToken(t):(gs.warn(Ua),null)}))()}restoreFromUrlToken(){var t=this;return St((function*(){return t._conversationsManager?t._conversationsManager.restoreFromUrlToken():(gs.warn(Ua),null)}))()}getCurrentTicketId(){var t,e;return(t=(e=this._conversationsManager)==null?void 0:e.getCurrentTicketId())!==null&&t!==void 0?t:null}getWidgetSessionId(){var t,e;return(t=(e=this._conversationsManager)==null?void 0:e.getWidgetSessionId())!==null&&t!==void 0?t:null}hs(){var t;(t=this._conversationsManager)==null||t.setIdentity()}ds(){var t;(t=this._conversationsManager)==null||t.clearIdentity()}}},JN={logs:class{constructor(t){var e,n=this;this.du=!1,this.vu=!1,this.st=Mt("[logs]"),this.cu=ue({},this.st,{error(){for(var r=arguments.length,s=new Array(r),i=0;r>i;i++)s[i]=arguments[i];s.some(RC)||n.st.error(...s)}}),this.sr=[],this.fu=[],this.Fa=0,this.pu=()=>{var r,s;this.Fa=0,(r=this.gu)==null||r.onReconnect(),(s=this.mu)==null||s.onReconnect()},this._instance=t,this._instance&&(e=this._instance.config.logs)!=null&&e.captureConsoleLogs&&(this.du=!0),ne&&jt(ne,"online",this.pu)}yu(t,e,n,r){var s,i=(function(a,u){var c,d,h,p,m,_,w,y=(c=a==null?void 0:a.flushIntervalMs)!==null&&c!==void 0?c:3e3,x=(d=a==null?void 0:a.maxBufferSize)!==null&&d!==void 0?d:100,S=u!=null&&u.consoleCapture?void 0:(h=a==null?void 0:a.maxLogsPerInterval)!==null&&h!==void 0?h:1e3,P=he(S)?Math.max(x,2048):Math.max(x,S),T=a==null?void 0:a.resourceAttributes;return{serviceName:(p=(m=T==null?void 0:T["service.name"])!==null&&m!==void 0?m:a==null?void 0:a.serviceName)!==null&&p!==void 0?p:u==null?void 0:u.serviceNameDefault,serviceVersion:(_=T==null?void 0:T["service.version"])!==null&&_!==void 0?_:a==null?void 0:a.serviceVersion,environment:(w=T==null?void 0:T["deployment.environment"])!==null&&w!==void 0?w:a==null?void 0:a.environment,resourceAttributes:T,beforeSend:a==null?void 0:a.beforeSend,flushIntervalMs:y,maxBufferSize:x,maxQueueSize:P,maxBatchRecordsPerPost:100,rateCapWindowMs:y,maxLogsPerInterval:S,backgroundFlushBudgetMs:0,terminationFlushBudgetMs:0}})((s=this._instance)==null||(s=s.config)==null?void 0:s.logs,n);return[new nD(this.bu(t,e),i,this.cu,(()=>this._u()),(a=>a()),void 0,r),i]}wu(){var t,e=(t=this._instance)==null||(t=t.config)==null?void 0:t.logs;if(!this.gu||this.ku!==e){var n;(n=this.gu)==null||n.reset(),this.ku=e;var r=this.yu((()=>this.sr),(s=>{this.sr=s}));this.gu=r[0],this.xu=r[1]}return this.gu}Su(){var t,e=(t=this._instance)==null||(t=t.config)==null?void 0:t.logs;if(!this.mu||this.Cu!==e){var n;(n=this.mu)==null||n.reset(),this.Cu=e;var r=this.yu((()=>this.fu),(s=>{this.fu=s}),{serviceNameDefault:"posthog-browser-logs",consoleCapture:!0},TC);this.mu=r[0],this.Mu=r[1]}return this.mu}initialize(){this.loadIfEnabled()}onRemoteConfig(t){var e;if(t.ok){var n=(e=t.config.logs)==null?void 0:e.captureConsoleLogs;!Qe(n)&&n&&(this.du=!0,this.loadIfEnabled())}}reset(){var t,e;this.sr=[],(t=this.gu)==null||t.reset(),this.fu=[],(e=this.mu)==null||e.reset(),this.Fa=0}captureLog(t){this.wu().captureLog(t)}he(t){this.Su().captureLog(t)}get logger(){return this.Tu||(this.Tu={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.Tu}flushLogs(t){t?this.Eu(t):(this.gu&&this.gu.flush().catch((e=>this.Iu(e))),this.mu&&this.mu.flush().catch((e=>this.Iu(e))))}Iu(t){RC(t)||this.st.error("PostHog logs flush failed:",t)}loadIfEnabled(){if(this.du&&!this.vu){var t=Fe==null?void 0:Fe.__PosthogExtensions__;if(t){var e=t.loadExternalDependency;e?e(this._instance,"logs",(n=>{var r;n||(r=t.logs)==null||!r.initializeLogs?this.st.error("Could not load logs script",n):(t.logs.initializeLogs(this._instance),this.vu=!0)})):this.st.error(M2)}else this.st.error("PostHog Extensions not found.")}}bu(t,e){var n=this._instance;return{get isDisabled(){return!1},get optedOut(){return!n.is_capturing()},getPersistedProperty:r=>r===zi.LogsQueue?t():void 0,setPersistedProperty(r,s){var i;r===zi.LogsQueue&&e((i=s)!==null&&i!==void 0?i:[])},$t:r=>this.$t(r),getLibraryId:()=>xt.LIB_NAME,getLibraryVersion:()=>xt.LIB_VERSION}}$t(t){return new Promise((e=>{if(wP(this.Fa,3))e({kind:"fatal",error:Zv(void 0,"logs endpoint is unreachable, dropping batch")});else{var n=!1,r=i=>{n||(n=!0,clearTimeout(s),e(i))},s=setTimeout((()=>{this.st.warn("Logs request timed out before receiving a response"),r({kind:"retry-later",error:Zv(void 0,"logs request timed out")})}),9e4);this._instance._send_request({method:"POST",url:this.Pu(),data:t,compression:"best-available",batchKey:"logs",fireCallbackOnDrop:!0,callback:i=>{var a=i.statusCode;if(this.Ru(a),a>=200&&300>a)r({kind:"ok"});else if(a===413)r({kind:"too-large"});else if(a!==0&&a!==429&&500>a)r({kind:"fatal",error:new Error("logs request failed with status "+a)});else{var u;a===0?(i.error||this.st.warn("Logs request failed before receiving an HTTP response"),r({kind:"retry-later",error:Zv(i.error,"logs request failed before receiving an HTTP response")})):r({kind:"retry-later",error:(u=i.error)!==null&&u!==void 0?u:new Error("logs request failed with status "+a)})}}})}}))}Ru(t){(t!==0||this._instance.__loaded)&&(this.Fa=xP(t,this.Fa,3,(()=>this.st.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."))))}Eu(t){this.sr.length>0&&this.Au(t,this.sr,this.xu,xt.LIB_NAME,(e=>{this.sr=e})),this.fu.length>0&&this.Au(t,this.fu,this.Mu,TC,(e=>{this.fu=e}))}Au(t,e,n,r,s){if(e.length!==0){var i=e.map((u=>u.record));s([]);var a=W6(i,B6(n,xt.LIB_NAME,xt.LIB_VERSION),r,xt.LIB_VERSION);this._instance._send_request({method:"POST",url:this.Pu(),data:a,compression:"best-available",batchKey:"logs",transport:t})}}Pu(){return this._instance.requestRouter.endpointFor("api","/i/v1/logs")+"?token="+encodeURIComponent(this._instance.config.token)}_u(){var t,e={};if(e.distinctId=this._instance.get_distinct_id(),this._instance.sessionManager){var n=this._instance.sessionManager.checkAndGetSessionAndWindowId(!0),r=n.windowId,s=n.sessionStartTimestamp,i=n.lastActivityTimestamp;e.sessionId=n.sessionId,e.windowId=r,Qe(s)||(e.sessionStartTimestamp=s),Qe(i)||(e.lastActivityTimestamp=i)}if(Fe!=null&&(t=Fe.location)!=null&&t.href&&(e.currentUrl=this._instance.config.disable_capture_url_hashes?oa(Fe.location.href):Fe.location.href),this._instance.featureFlags){var a=this._instance.featureFlags.getFlags();a&&a.length>0&&(e.activeFeatureFlags=a)}return e}}},e9={metrics:class{constructor(t){this.st=Mt("[metrics]"),this._instance=t}initialize(){}wu(){var t,e,n=(t=this._instance)==null||(t=t.config)==null?void 0:t.metrics;return this.gu&&this.ku===n||((e=this.gu)==null||e.reset(),this.ku=n,this.gu=new rD(this.bu(),(function(r){var s,i,a,u,c,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:(a=d==null?void 0:d["deployment.environment"])!==null&&a!==void 0?a:r==null?void 0:r.environment,resourceAttributes:d,beforeSend:r==null?void 0:r.beforeSend,flushIntervalMs:(u=r==null?void 0:r.flushIntervalMs)!==null&&u!==void 0?u:1e4,maxSeriesPerFlush:(c=r==null?void 0:r.maxSeriesPerFlush)!==null&&c!==void 0?c:1e3}})(n),this.st)),this.gu}count(t,e,n){e===void 0&&(e=1),this.wu().count(t,e,n)}gauge(t,e,n){this.wu().gauge(t,e,n)}histogram(t,e,n){this.wu().histogram(t,e,n)}flush(t){if(!this.gu)return Promise.resolve();if(t){var e=this.gu.drainWindow();return e&&this.Xt(e,t),Promise.resolve()}return this.gu.flush().catch((n=>this.st.error("PostHog metrics flush failed:",n)))}reset(){var t;(t=this.gu)==null||t.reset()}bu(){var t=this._instance,e=this;return{get isDisabled(){return!1},get optedOut(){return!t.is_capturing()},Xt:n=>e.Xt(n),getLibraryId:()=>xt.LIB_NAME,getLibraryVersion:()=>xt.LIB_VERSION}}Xt(t,e){return new Promise((n=>{var r=!1,s=a=>{r||(r=!0,clearTimeout(i),n(a))},i=setTimeout((()=>s({kind:"retry-later",error:new Error("metrics request timed out")})),9e4);this._instance._send_request(ue({method:"POST",url:this.Fu(),data:t,compression:"best-available",batchKey:"metrics"},e&&{transport:e},{fireCallbackOnDrop:!0,callback(a){var u=a.statusCode;if(u>=200&&300>u)s({kind:"ok"});else if(u===413)s({kind:"too-large"});else if(u!==0&&u!==429&&500>u)s({kind:"fatal",error:new Error("metrics request failed with status "+u)});else{var c;s({kind:"retry-later",error:(c=a.error)!==null&&c!==void 0?c:new Error("metrics request failed with status "+u)})}}}))}))}Fu(){return this._instance.requestRouter.endpointFor("api","/i/v1/metrics")+"?token="+encodeURIComponent(this._instance.config.token)}}},t9=ue({},u0,UN,BN,WN,qN,GN,ZN,KN,YN,XN,QN,JN,e9);qr.__defaultExtensionClasses=ue({},t9);var Se=(function(){xt.SDK_DIST_CHANNEL="npm";var t=Rd[yu]=new qr;return(function(){function e(){e.done||(e.done=!0,ZP=!1,bt(Rd,(function(n){n._dom_loaded()})))}_e!=null&&_e.addEventListener?_e.readyState==="complete"?e():jt(_e,"DOMContentLoaded",e,{capture:!1}):ne&&ve.error("Browser doesn't support `document.addEventListener` so PostHog couldn't be initialized")})(),t})(),XP;function n9(t){XP=t}function Ky(){return XP}var V2=v.createContext({get client(){return Ky()},bootstrap:void 0});function QP(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,a=r;i<a.length;i++){var u=a[i];if(!s.includes(u)||!QP(t[u],e[u],n))return!1}return!0}function r9(t){var e,n,r=t.children,s=t.client,i=t.apiKey,a=t.options,u=v.useRef(null),c=v.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`."),a&&console.warn("[PostHog.js] You have provided both `client` and `options` to `PostHogProvider`. `options` will be ignored in favour of `client`."),s;var d=Ky();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(a)]);return v.useEffect(function(){if(!(s||!i)){var d=Ky(),h=u.current;h?(i!==h.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."),a&&!QP(a,h.options)&&d.set_config(a),u.current={apiKey:i,options:a??{}}):(d.__loaded&&console.warn("[PostHog.js] `posthog` was already loaded elsewhere. This may cause issues."),d.init(i,a),u.current={apiKey:i,options:a??{}})}},[s,i,JSON.stringify(a)]),ye.createElement(V2.Provider,{value:{client:c,bootstrap:(e=a==null?void 0:a.bootstrap)!==null&&e!==void 0?e:(n=s==null?void 0:s.config)===null||n===void 0?void 0:n.bootstrap}},r)}var Yv=function(t){return typeof t=="function"},c0=function(){var t=v.useContext(V2).client;return t},Zy=function(t,e){return Zy=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(n,r){n.__proto__=r}||function(n,r){for(var s in r)Object.prototype.hasOwnProperty.call(r,s)&&(n[s]=r[s])},Zy(t,e)};function s9(t,e){if(typeof e!="function"&&e!==null)throw new TypeError("Class extends value "+String(e)+" is not a constructor or null");Zy(t,e);function n(){this.constructor=t}t.prototype=e===null?Object.create(e):(n.prototype=e.prototype,new n)}var i9={componentStack:null,exceptionEvent:null,error:null},o9={INVALID_FALLBACK:"[PostHog.js][PostHogErrorBoundary] Invalid fallback prop, provide a valid React element or a function that returns a valid React element."},a9=(function(t){s9(e,t);function e(n){var r=t.call(this,n)||this;return r.state=i9,r}return e.prototype.componentDidCatch=function(n,r){var s=this.props.additionalProperties,i;Yv(s)?i=s(n):typeof s=="object"&&(i=s);var a=this.context.client,u=a.captureException(n,i),c=r.componentStack;this.setState({error:n,componentStack:c??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 Yv(r)?r():r;var a=Yv(s)?ye.createElement(s,{error:i.error,componentStack:i.componentStack,exceptionEvent:i.exceptionEvent}):s;return ye.isValidElement(a)?a:(console.warn(o9.INVALID_FALLBACK),ye.createElement(ye.Fragment,null))},e.contextType=V2,e})(ye.Component);n9(Se);var op={},Xv={exports:{}},xr={},Qv={exports:{}},Jv={};/**
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 AC;function l9(){return AC||(AC=1,(function(t){function e(V,J){var H=V.length;V.push(J);e:for(;0<H;){var F=H-1>>>1,X=V[F];if(0<s(X,J))V[F]=J,V[H]=X,H=F;else break e}}function n(V){return V.length===0?null:V[0]}function r(V){if(V.length===0)return null;var J=V[0],H=V.pop();if(H!==J){V[0]=H;e:for(var F=0,X=V.length,oe=X>>>1;F<oe;){var se=2*(F+1)-1,ee=V[se],ce=se+1,we=V[ce];if(0>s(ee,H))ce<X&&0>s(we,ee)?(V[F]=we,V[ce]=H,F=ce):(V[F]=ee,V[se]=H,F=se);else if(ce<X&&0>s(we,H))V[F]=we,V[ce]=H,F=ce;else break e}}return J}function s(V,J){var H=V.sortIndex-J.sortIndex;return H!==0?H:V.id-J.id}if(typeof performance=="object"&&typeof performance.now=="function"){var i=performance;t.unstable_now=function(){return i.now()}}else{var a=Date,u=a.now();t.unstable_now=function(){return a.now()-u}}var c=[],d=[],h=1,p=null,m=3,_=!1,w=!1,y=!1,x=typeof setTimeout=="function"?setTimeout:null,S=typeof clearTimeout=="function"?clearTimeout:null,P=typeof setImmediate<"u"?setImmediate:null;typeof navigator<"u"&&navigator.scheduling!==void 0&&navigator.scheduling.isInputPending!==void 0&&navigator.scheduling.isInputPending.bind(navigator.scheduling);function T(V){for(var J=n(d);J!==null;){if(J.callback===null)r(d);else if(J.startTime<=V)r(d),J.sortIndex=J.expirationTime,e(c,J);else break;J=n(d)}}function k(V){if(y=!1,T(V),!w)if(n(c)!==null)w=!0,q(R);else{var J=n(d);J!==null&&Z(k,J.startTime-V)}}function R(V,J){w=!1,y&&(y=!1,S(A),A=-1),_=!0;var H=m;try{for(T(J),p=n(c);p!==null&&(!(p.expirationTime>J)||V&&!N());){var F=p.callback;if(typeof F=="function"){p.callback=null,m=p.priorityLevel;var X=F(p.expirationTime<=J);J=t.unstable_now(),typeof X=="function"?p.callback=X:p===n(c)&&r(c),T(J)}else r(c);p=n(c)}if(p!==null)var oe=!0;else{var se=n(d);se!==null&&Z(k,se.startTime-J),oe=!1}return oe}finally{p=null,m=H,_=!1}}var M=!1,L=null,A=-1,O=5,D=-1;function N(){return!(t.unstable_now()-D<O)}function j(){if(L!==null){var V=t.unstable_now();D=V;var J=!0;try{J=L(!0,V)}finally{J?G():(M=!1,L=null)}}else M=!1}var G;if(typeof P=="function")G=function(){P(j)};else if(typeof MessageChannel<"u"){var Y=new MessageChannel,W=Y.port2;Y.port1.onmessage=j,G=function(){W.postMessage(null)}}else G=function(){x(j,0)};function q(V){L=V,M||(M=!0,G())}function Z(V,J){A=x(function(){V(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(V){V.callback=null},t.unstable_continueExecution=function(){w||_||(w=!0,q(R))},t.unstable_forceFrameRate=function(V){0>V||125<V?console.error("forceFrameRate takes a positive int between 0 and 125, forcing frame rates higher than 125 fps is not supported"):O=0<V?Math.floor(1e3/V):5},t.unstable_getCurrentPriorityLevel=function(){return m},t.unstable_getFirstCallbackNode=function(){return n(c)},t.unstable_next=function(V){switch(m){case 1:case 2:case 3:var J=3;break;default:J=m}var H=m;m=J;try{return V()}finally{m=H}},t.unstable_pauseExecution=function(){},t.unstable_requestPaint=function(){},t.unstable_runWithPriority=function(V,J){switch(V){case 1:case 2:case 3:case 4:case 5:break;default:V=3}var H=m;m=V;try{return J()}finally{m=H}},t.unstable_scheduleCallback=function(V,J,H){var F=t.unstable_now();switch(typeof H=="object"&&H!==null?(H=H.delay,H=typeof H=="number"&&0<H?F+H:F):H=F,V){case 1:var X=-1;break;case 2:X=250;break;case 5:X=1073741823;break;case 4:X=1e4;break;default:X=5e3}return X=H+X,V={id:h++,callback:J,priorityLevel:V,startTime:H,expirationTime:X,sortIndex:-1},H>F?(V.sortIndex=H,e(d,V),n(c)===null&&V===n(d)&&(y?(S(A),A=-1):y=!0,Z(k,H-F))):(V.sortIndex=X,e(c,V),w||_||(w=!0,q(R))),V},t.unstable_shouldYield=N,t.unstable_wrapCallback=function(V){var J=m;return function(){var H=m;m=J;try{return V.apply(this,arguments)}finally{m=H}}}})(Jv)),Jv}var IC;function u9(){return IC||(IC=1,Qv.exports=l9()),Qv.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 MC;function c9(){if(MC)return xr;MC=1;var t=v2(),e=u9();function n(o){for(var l="https://reactjs.org/docs/error-decoder.html?invariant="+o,f=1;f<arguments.length;f++)l+="&args[]="+encodeURIComponent(arguments[f]);return"Minified React error #"+o+"; visit "+l+" for the full message or use the non-minified dev environment for full errors and additional helpful warnings."}var r=new Set,s={};function i(o,l){a(o,l),a(o+"Capture",l)}function a(o,l){for(s[o]=l,o=0;o<l.length;o++)r.add(l[o])}var u=!(typeof window>"u"||typeof window.document>"u"||typeof window.document.createElement>"u"),c=Object.prototype.hasOwnProperty,d=/^[:A-Z_a-z\u00C0-\u00D6\u00D8-\u00F6\u00F8-\u02FF\u0370-\u037D\u037F-\u1FFF\u200C-\u200D\u2070-\u218F\u2C00-\u2FEF\u3001-\uD7FF\uF900-\uFDCF\uFDF0-\uFFFD][:A-Z_a-z\u00C0-\u00D6\u00D8-\u00F6\u00F8-\u02FF\u0370-\u037D\u037F-\u1FFF\u200C-\u200D\u2070-\u218F\u2C00-\u2FEF\u3001-\uD7FF\uF900-\uFDCF\uFDF0-\uFFFD\-.0-9\u00B7\u0300-\u036F\u203F-\u2040]*$/,h={},p={};function m(o){return c.call(p,o)?!0:c.call(h,o)?!1:d.test(o)?p[o]=!0:(h[o]=!0,!1)}function _(o,l,f,g){if(f!==null&&f.type===0)return!1;switch(typeof l){case"function":case"symbol":return!0;case"boolean":return g?!1:f!==null?!f.acceptsBooleans:(o=o.toLowerCase().slice(0,5),o!=="data-"&&o!=="aria-");default:return!1}}function w(o,l,f,g){if(l===null||typeof l>"u"||_(o,l,f,g))return!0;if(g)return!1;if(f!==null)switch(f.type){case 3:return!l;case 4:return l===!1;case 5:return isNaN(l);case 6:return isNaN(l)||1>l}return!1}function y(o,l,f,g,b,C,I){this.acceptsBooleans=l===2||l===3||l===4,this.attributeName=g,this.attributeNamespace=b,this.mustUseProperty=f,this.propertyName=o,this.type=l,this.sanitizeURL=C,this.removeEmptyString=I}var x={};"children dangerouslySetInnerHTML defaultValue defaultChecked innerHTML suppressContentEditableWarning suppressHydrationWarning style".split(" ").forEach(function(o){x[o]=new y(o,0,!1,o,null,!1,!1)}),[["acceptCharset","accept-charset"],["className","class"],["htmlFor","for"],["httpEquiv","http-equiv"]].forEach(function(o){var l=o[0];x[l]=new y(l,1,!1,o[1],null,!1,!1)}),["contentEditable","draggable","spellCheck","value"].forEach(function(o){x[o]=new y(o,2,!1,o.toLowerCase(),null,!1,!1)}),["autoReverse","externalResourcesRequired","focusable","preserveAlpha"].forEach(function(o){x[o]=new y(o,2,!1,o,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(o){x[o]=new y(o,3,!1,o.toLowerCase(),null,!1,!1)}),["checked","multiple","muted","selected"].forEach(function(o){x[o]=new y(o,3,!0,o,null,!1,!1)}),["capture","download"].forEach(function(o){x[o]=new y(o,4,!1,o,null,!1,!1)}),["cols","rows","size","span"].forEach(function(o){x[o]=new y(o,6,!1,o,null,!1,!1)}),["rowSpan","start"].forEach(function(o){x[o]=new y(o,5,!1,o.toLowerCase(),null,!1,!1)});var S=/[\-:]([a-z])/g;function P(o){return o[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(o){var l=o.replace(S,P);x[l]=new y(l,1,!1,o,null,!1,!1)}),"xlink:actuate xlink:arcrole xlink:role xlink:show xlink:title xlink:type".split(" ").forEach(function(o){var l=o.replace(S,P);x[l]=new y(l,1,!1,o,"http://www.w3.org/1999/xlink",!1,!1)}),["xml:base","xml:lang","xml:space"].forEach(function(o){var l=o.replace(S,P);x[l]=new y(l,1,!1,o,"http://www.w3.org/XML/1998/namespace",!1,!1)}),["tabIndex","crossOrigin"].forEach(function(o){x[o]=new y(o,1,!1,o.toLowerCase(),null,!1,!1)}),x.xlinkHref=new y("xlinkHref",1,!1,"xlink:href","http://www.w3.org/1999/xlink",!0,!1),["src","href","action","formAction"].forEach(function(o){x[o]=new y(o,1,!1,o.toLowerCase(),null,!0,!0)});function T(o,l,f,g){var b=x.hasOwnProperty(l)?x[l]:null;(b!==null?b.type!==0:g||!(2<l.length)||l[0]!=="o"&&l[0]!=="O"||l[1]!=="n"&&l[1]!=="N")&&(w(l,f,b,g)&&(f=null),g||b===null?m(l)&&(f===null?o.removeAttribute(l):o.setAttribute(l,""+f)):b.mustUseProperty?o[b.propertyName]=f===null?b.type===3?!1:"":f:(l=b.attributeName,g=b.attributeNamespace,f===null?o.removeAttribute(l):(b=b.type,f=b===3||b===4&&f===!0?"":""+f,g?o.setAttributeNS(g,l,f):o.setAttribute(l,f))))}var k=t.__SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED,R=Symbol.for("react.element"),M=Symbol.for("react.portal"),L=Symbol.for("react.fragment"),A=Symbol.for("react.strict_mode"),O=Symbol.for("react.profiler"),D=Symbol.for("react.provider"),N=Symbol.for("react.context"),j=Symbol.for("react.forward_ref"),G=Symbol.for("react.suspense"),Y=Symbol.for("react.suspense_list"),W=Symbol.for("react.memo"),q=Symbol.for("react.lazy"),Z=Symbol.for("react.offscreen"),V=Symbol.iterator;function J(o){return o===null||typeof o!="object"?null:(o=V&&o[V]||o["@@iterator"],typeof o=="function"?o:null)}var H=Object.assign,F;function X(o){if(F===void 0)try{throw Error()}catch(f){var l=f.stack.trim().match(/\n( *(at )?)/);F=l&&l[1]||""}return`
36
- `+F+o}var oe=!1;function se(o,l){if(!o||oe)return"";oe=!0;var f=Error.prepareStackTrace;Error.prepareStackTrace=void 0;try{if(l)if(l=function(){throw Error()},Object.defineProperty(l.prototype,"props",{set:function(){throw Error()}}),typeof Reflect=="object"&&Reflect.construct){try{Reflect.construct(l,[])}catch(re){var g=re}Reflect.construct(o,[],l)}else{try{l.call()}catch(re){g=re}o.call(l.prototype)}else{try{throw Error()}catch(re){g=re}o()}}catch(re){if(re&&g&&typeof re.stack=="string"){for(var b=re.stack.split(`
37
- `),C=g.stack.split(`
38
- `),I=b.length-1,$=C.length-1;1<=I&&0<=$&&b[I]!==C[$];)$--;for(;1<=I&&0<=$;I--,$--)if(b[I]!==C[$]){if(I!==1||$!==1)do if(I--,$--,0>$||b[I]!==C[$]){var B=`
39
- `+b[I].replace(" at new "," at ");return o.displayName&&B.includes("<anonymous>")&&(B=B.replace("<anonymous>",o.displayName)),B}while(1<=I&&0<=$);break}}}finally{oe=!1,Error.prepareStackTrace=f}return(o=o?o.displayName||o.name:"")?X(o):""}function ee(o){switch(o.tag){case 5:return X(o.type);case 16:return X("Lazy");case 13:return X("Suspense");case 19:return X("SuspenseList");case 0:case 2:case 15:return o=se(o.type,!1),o;case 11:return o=se(o.type.render,!1),o;case 1:return o=se(o.type,!0),o;default:return""}}function ce(o){if(o==null)return null;if(typeof o=="function")return o.displayName||o.name||null;if(typeof o=="string")return o;switch(o){case L:return"Fragment";case M:return"Portal";case O:return"Profiler";case A:return"StrictMode";case G:return"Suspense";case Y:return"SuspenseList"}if(typeof o=="object")switch(o.$$typeof){case N:return(o.displayName||"Context")+".Consumer";case D:return(o._context.displayName||"Context")+".Provider";case j:var l=o.render;return o=o.displayName,o||(o=l.displayName||l.name||"",o=o!==""?"ForwardRef("+o+")":"ForwardRef"),o;case W:return l=o.displayName||null,l!==null?l:ce(o.type)||"Memo";case q:l=o._payload,o=o._init;try{return ce(o(l))}catch{}}return null}function we(o){var l=o.type;switch(o.tag){case 24:return"Cache";case 9:return(l.displayName||"Context")+".Consumer";case 10:return(l._context.displayName||"Context")+".Provider";case 18:return"DehydratedFragment";case 11:return o=l.render,o=o.displayName||o.name||"",l.displayName||(o!==""?"ForwardRef("+o+")":"ForwardRef");case 7:return"Fragment";case 5:return l;case 4:return"Portal";case 3:return"Root";case 6:return"Text";case 16:return ce(l);case 8:return l===A?"StrictMode":"Mode";case 22:return"Offscreen";case 12:return"Profiler";case 21:return"Scope";case 13:return"Suspense";case 19:return"SuspenseList";case 25:return"TracingMarker";case 1:case 0:case 17:case 2:case 14:case 15:if(typeof l=="function")return l.displayName||l.name||null;if(typeof l=="string")return l}return null}function le(o){switch(typeof o){case"boolean":case"number":case"string":case"undefined":return o;case"object":return o;default:return""}}function ie(o){var l=o.type;return(o=o.nodeName)&&o.toLowerCase()==="input"&&(l==="checkbox"||l==="radio")}function Ne(o){var l=ie(o)?"checked":"value",f=Object.getOwnPropertyDescriptor(o.constructor.prototype,l),g=""+o[l];if(!o.hasOwnProperty(l)&&typeof f<"u"&&typeof f.get=="function"&&typeof f.set=="function"){var b=f.get,C=f.set;return Object.defineProperty(o,l,{configurable:!0,get:function(){return b.call(this)},set:function(I){g=""+I,C.call(this,I)}}),Object.defineProperty(o,l,{enumerable:f.enumerable}),{getValue:function(){return g},setValue:function(I){g=""+I},stopTracking:function(){o._valueTracker=null,delete o[l]}}}}function Be(o){o._valueTracker||(o._valueTracker=Ne(o))}function Pe(o){if(!o)return!1;var l=o._valueTracker;if(!l)return!0;var f=l.getValue(),g="";return o&&(g=ie(o)?o.checked?"true":"false":o.value),o=g,o!==f?(l.setValue(o),!0):!1}function $e(o){if(o=o||(typeof document<"u"?document:void 0),typeof o>"u")return null;try{return o.activeElement||o.body}catch{return o.body}}function dt(o,l){var f=l.checked;return H({},l,{defaultChecked:void 0,defaultValue:void 0,value:void 0,checked:f??o._wrapperState.initialChecked})}function Qt(o,l){var f=l.defaultValue==null?"":l.defaultValue,g=l.checked!=null?l.checked:l.defaultChecked;f=le(l.value!=null?l.value:f),o._wrapperState={initialChecked:g,initialValue:f,controlled:l.type==="checkbox"||l.type==="radio"?l.checked!=null:l.value!=null}}function be(o,l){l=l.checked,l!=null&&T(o,"checked",l,!1)}function Ve(o,l){be(o,l);var f=le(l.value),g=l.type;if(f!=null)g==="number"?(f===0&&o.value===""||o.value!=f)&&(o.value=""+f):o.value!==""+f&&(o.value=""+f);else if(g==="submit"||g==="reset"){o.removeAttribute("value");return}l.hasOwnProperty("value")?tt(o,l.type,f):l.hasOwnProperty("defaultValue")&&tt(o,l.type,le(l.defaultValue)),l.checked==null&&l.defaultChecked!=null&&(o.defaultChecked=!!l.defaultChecked)}function qe(o,l,f){if(l.hasOwnProperty("value")||l.hasOwnProperty("defaultValue")){var g=l.type;if(!(g!=="submit"&&g!=="reset"||l.value!==void 0&&l.value!==null))return;l=""+o._wrapperState.initialValue,f||l===o.value||(o.value=l),o.defaultValue=l}f=o.name,f!==""&&(o.name=""),o.defaultChecked=!!o._wrapperState.initialChecked,f!==""&&(o.name=f)}function tt(o,l,f){(l!=="number"||$e(o.ownerDocument)!==o)&&(f==null?o.defaultValue=""+o._wrapperState.initialValue:o.defaultValue!==""+f&&(o.defaultValue=""+f))}var _t=Array.isArray;function nt(o,l,f,g){if(o=o.options,l){l={};for(var b=0;b<f.length;b++)l["$"+f[b]]=!0;for(f=0;f<o.length;f++)b=l.hasOwnProperty("$"+o[f].value),o[f].selected!==b&&(o[f].selected=b),b&&g&&(o[f].defaultSelected=!0)}else{for(f=""+le(f),l=null,b=0;b<o.length;b++){if(o[b].value===f){o[b].selected=!0,g&&(o[b].defaultSelected=!0);return}l!==null||o[b].disabled||(l=o[b])}l!==null&&(l.selected=!0)}}function Ye(o,l){if(l.dangerouslySetInnerHTML!=null)throw Error(n(91));return H({},l,{value:void 0,defaultValue:void 0,children:""+o._wrapperState.initialValue})}function on(o,l){var f=l.value;if(f==null){if(f=l.children,l=l.defaultValue,f!=null){if(l!=null)throw Error(n(92));if(_t(f)){if(1<f.length)throw Error(n(93));f=f[0]}l=f}l==null&&(l=""),f=l}o._wrapperState={initialValue:le(f)}}function an(o,l){var f=le(l.value),g=le(l.defaultValue);f!=null&&(f=""+f,f!==o.value&&(o.value=f),l.defaultValue==null&&o.defaultValue!==f&&(o.defaultValue=f)),g!=null&&(o.defaultValue=""+g)}function On(o){var l=o.textContent;l===o._wrapperState.initialValue&&l!==""&&l!==null&&(o.value=l)}function po(o){switch(o){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 Bn(o,l){return o==null||o==="http://www.w3.org/1999/xhtml"?po(l):o==="http://www.w3.org/2000/svg"&&l==="foreignObject"?"http://www.w3.org/1999/xhtml":o}var is,fr=(function(o){return typeof MSApp<"u"&&MSApp.execUnsafeLocalFunction?function(l,f,g,b){MSApp.execUnsafeLocalFunction(function(){return o(l,f,g,b)})}:o})(function(o,l){if(o.namespaceURI!=="http://www.w3.org/2000/svg"||"innerHTML"in o)o.innerHTML=l;else{for(is=is||document.createElement("div"),is.innerHTML="<svg>"+l.valueOf().toString()+"</svg>",l=is.firstChild;o.firstChild;)o.removeChild(o.firstChild);for(;l.firstChild;)o.appendChild(l.firstChild)}});function er(o,l){if(l){var f=o.firstChild;if(f&&f===o.lastChild&&f.nodeType===3){f.nodeValue=l;return}}o.textContent=l}var hr={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},Ll=["Webkit","ms","Moz","O"];Object.keys(hr).forEach(function(o){Ll.forEach(function(l){l=l+o.charAt(0).toUpperCase()+o.substring(1),hr[l]=hr[o]})});function Jt(o,l,f){return l==null||typeof l=="boolean"||l===""?"":f||typeof l!="number"||l===0||hr.hasOwnProperty(o)&&hr[o]?(""+l).trim():l+"px"}function mo(o,l){o=o.style;for(var f in l)if(l.hasOwnProperty(f)){var g=f.indexOf("--")===0,b=Jt(f,l[f],g);f==="float"&&(f="cssFloat"),g?o.setProperty(f,b):o[f]=b}}var go=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 ks(o,l){if(l){if(go[o]&&(l.children!=null||l.dangerouslySetInnerHTML!=null))throw Error(n(137,o));if(l.dangerouslySetInnerHTML!=null){if(l.children!=null)throw Error(n(60));if(typeof l.dangerouslySetInnerHTML!="object"||!("__html"in l.dangerouslySetInnerHTML))throw Error(n(61))}if(l.style!=null&&typeof l.style!="object")throw Error(n(62))}}function Ps(o,l){if(o.indexOf("-")===-1)return typeof l.is=="string";switch(o){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 _n=null;function os(o){return o=o.target||o.srcElement||window,o.correspondingUseElement&&(o=o.correspondingUseElement),o.nodeType===3?o.parentNode:o}var Ws=null,fn=null,as=null;function vo(o){if(o=jc(o)){if(typeof Ws!="function")throw Error(n(280));var l=o.stateNode;l&&(l=ah(l),Ws(o.stateNode,o.type,l))}}function xi(o){fn?as?as.push(o):as=[o]:fn=o}function bi(){if(fn){var o=fn,l=as;if(as=fn=null,vo(o),l)for(o=0;o<l.length;o++)vo(l[o])}}function We(o,l){return o(l)}function Wt(){}var Ot=!1;function wn(o,l,f){if(Ot)return o(l,f);Ot=!0;try{return We(o,l,f)}finally{Ot=!1,(fn!==null||as!==null)&&(Wt(),bi())}}function Nr(o,l){var f=o.stateNode;if(f===null)return null;var g=ah(f);if(g===null)return null;f=g[l];e:switch(l){case"onClick":case"onClickCapture":case"onDoubleClick":case"onDoubleClickCapture":case"onMouseDown":case"onMouseDownCapture":case"onMouseMove":case"onMouseMoveCapture":case"onMouseUp":case"onMouseUpCapture":case"onMouseEnter":(g=!g.disabled)||(o=o.type,g=!(o==="button"||o==="input"||o==="select"||o==="textarea")),o=!g;break e;default:o=!1}if(o)return null;if(f&&typeof f!="function")throw Error(n(231,l,typeof f));return f}var qt=!1;if(u)try{var ln={};Object.defineProperty(ln,"passive",{get:function(){qt=!0}}),window.addEventListener("test",ln,ln),window.removeEventListener("test",ln,ln)}catch{qt=!1}function tr(o,l,f,g,b,C,I,$,B){var re=Array.prototype.slice.call(arguments,3);try{l.apply(f,re)}catch(fe){this.onError(fe)}}var ls=!1,Ln=null,qs=!1,_c=null,Ff={onError:function(o){ls=!0,Ln=o}};function F0(o,l,f,g,b,C,I,$,B){ls=!1,Ln=null,tr.apply(Ff,arguments)}function $0(o,l,f,g,b,C,I,$,B){if(F0.apply(this,arguments),ls){if(ls){var re=Ln;ls=!1,Ln=null}else throw Error(n(198));qs||(qs=!0,_c=re)}}function Ts(o){var l=o,f=o;if(o.alternate)for(;l.return;)l=l.return;else{o=l;do l=o,(l.flags&4098)!==0&&(f=l.return),o=l.return;while(o)}return l.tag===3?f:null}function $f(o){if(o.tag===13){var l=o.memoizedState;if(l===null&&(o=o.alternate,o!==null&&(l=o.memoizedState)),l!==null)return l.dehydrated}return null}function Vf(o){if(Ts(o)!==o)throw Error(n(188))}function V0(o){var l=o.alternate;if(!l){if(l=Ts(o),l===null)throw Error(n(188));return l!==o?null:o}for(var f=o,g=l;;){var b=f.return;if(b===null)break;var C=b.alternate;if(C===null){if(g=b.return,g!==null){f=g;continue}break}if(b.child===C.child){for(C=b.child;C;){if(C===f)return Vf(b),o;if(C===g)return Vf(b),l;C=C.sibling}throw Error(n(188))}if(f.return!==g.return)f=b,g=C;else{for(var I=!1,$=b.child;$;){if($===f){I=!0,f=b,g=C;break}if($===g){I=!0,g=b,f=C;break}$=$.sibling}if(!I){for($=C.child;$;){if($===f){I=!0,f=C,g=b;break}if($===g){I=!0,g=C,f=b;break}$=$.sibling}if(!I)throw Error(n(189))}}if(f.alternate!==g)throw Error(n(190))}if(f.tag!==3)throw Error(n(188));return f.stateNode.current===f?o:l}function Hf(o){return o=V0(o),o!==null?Dl(o):null}function Dl(o){if(o.tag===5||o.tag===6)return o;for(o=o.child;o!==null;){var l=Dl(o);if(l!==null)return l;o=o.sibling}return null}var Nl=e.unstable_scheduleCallback,wc=e.unstable_cancelCallback,H0=e.unstable_shouldYield,Ox=e.unstable_requestPaint,wt=e.unstable_now,zf=e.unstable_getCurrentPriorityLevel,Sa=e.unstable_ImmediatePriority,Uf=e.unstable_UserBlockingPriority,Ea=e.unstable_NormalPriority,jl=e.unstable_LowPriority,Fl=e.unstable_IdlePriority,Ca=null,jr=null;function Bf(o){if(jr&&typeof jr.onCommitFiberRoot=="function")try{jr.onCommitFiberRoot(Ca,o,void 0,(o.current.flags&128)===128)}catch{}}var pr=Math.clz32?Math.clz32:Te,U=Math.log,ae=Math.LN2;function Te(o){return o>>>=0,o===0?32:31-(U(o)/ae|0)|0}var pe=64,me=4194304;function Ee(o){switch(o&-o){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 o&4194240;case 4194304:case 8388608:case 16777216:case 33554432:case 67108864:return o&130023424;case 134217728:return 134217728;case 268435456:return 268435456;case 536870912:return 536870912;case 1073741824:return 1073741824;default:return o}}function Ge(o,l){var f=o.pendingLanes;if(f===0)return 0;var g=0,b=o.suspendedLanes,C=o.pingedLanes,I=f&268435455;if(I!==0){var $=I&~b;$!==0?g=Ee($):(C&=I,C!==0&&(g=Ee(C)))}else I=f&~b,I!==0?g=Ee(I):C!==0&&(g=Ee(C));if(g===0)return 0;if(l!==0&&l!==g&&(l&b)===0&&(b=g&-g,C=l&-l,b>=C||b===16&&(C&4194240)!==0))return l;if((g&4)!==0&&(g|=f&16),l=o.entangledLanes,l!==0)for(o=o.entanglements,l&=g;0<l;)f=31-pr(l),b=1<<f,g|=o[f],l&=~b;return g}function Ce(o,l){switch(o){case 1:case 2:case 4:return l+250;case 8:case 16:case 32:case 64:case 128:case 256:case 512:case 1024:case 2048:case 4096:case 8192:case 16384:case 32768:case 65536:case 131072:case 262144:case 524288:case 1048576:case 2097152:return l+5e3;case 4194304:case 8388608:case 16777216:case 33554432:case 67108864:return-1;case 134217728:case 268435456:case 536870912:case 1073741824:return-1;default:return-1}}function Dn(o,l){for(var f=o.suspendedLanes,g=o.pingedLanes,b=o.expirationTimes,C=o.pendingLanes;0<C;){var I=31-pr(C),$=1<<I,B=b[I];B===-1?(($&f)===0||($&g)!==0)&&(b[I]=Ce($,l)):B<=l&&(o.expiredLanes|=$),C&=~$}}function us(o){return o=o.pendingLanes&-1073741825,o!==0?o:o&1073741824?1073741824:0}function Rs(){var o=pe;return pe<<=1,(pe&4194240)===0&&(pe=64),o}function As(o){for(var l=[],f=0;31>f;f++)l.push(o);return l}function mr(o,l,f){o.pendingLanes|=l,l!==536870912&&(o.suspendedLanes=0,o.pingedLanes=0),o=o.eventTimes,l=31-pr(l),o[l]=f}function hn(o,l){var f=o.pendingLanes&~l;o.pendingLanes=l,o.suspendedLanes=0,o.pingedLanes=0,o.expiredLanes&=l,o.mutableReadLanes&=l,o.entangledLanes&=l,l=o.entanglements;var g=o.eventTimes;for(o=o.expirationTimes;0<f;){var b=31-pr(f),C=1<<b;l[b]=0,g[b]=-1,o[b]=-1,f&=~C}}function Si(o,l){var f=o.entangledLanes|=l;for(o=o.entanglements;f;){var g=31-pr(f),b=1<<g;b&l|o[g]&l&&(o[g]|=l),f&=~b}}var rt=0;function Wf(o){return o&=-o,1<o?4<o?(o&268435455)!==0?16:536870912:4:1}var Lx,z0,Dx,Nx,jx,U0=!1,qf=[],yo=null,_o=null,wo=null,xc=new Map,bc=new Map,xo=[],uM="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 Fx(o,l){switch(o){case"focusin":case"focusout":yo=null;break;case"dragenter":case"dragleave":_o=null;break;case"mouseover":case"mouseout":wo=null;break;case"pointerover":case"pointerout":xc.delete(l.pointerId);break;case"gotpointercapture":case"lostpointercapture":bc.delete(l.pointerId)}}function Sc(o,l,f,g,b,C){return o===null||o.nativeEvent!==C?(o={blockedOn:l,domEventName:f,eventSystemFlags:g,nativeEvent:C,targetContainers:[b]},l!==null&&(l=jc(l),l!==null&&z0(l)),o):(o.eventSystemFlags|=g,l=o.targetContainers,b!==null&&l.indexOf(b)===-1&&l.push(b),o)}function cM(o,l,f,g,b){switch(l){case"focusin":return yo=Sc(yo,o,l,f,g,b),!0;case"dragenter":return _o=Sc(_o,o,l,f,g,b),!0;case"mouseover":return wo=Sc(wo,o,l,f,g,b),!0;case"pointerover":var C=b.pointerId;return xc.set(C,Sc(xc.get(C)||null,o,l,f,g,b)),!0;case"gotpointercapture":return C=b.pointerId,bc.set(C,Sc(bc.get(C)||null,o,l,f,g,b)),!0}return!1}function $x(o){var l=ka(o.target);if(l!==null){var f=Ts(l);if(f!==null){if(l=f.tag,l===13){if(l=$f(f),l!==null){o.blockedOn=l,jx(o.priority,function(){Dx(f)});return}}else if(l===3&&f.stateNode.current.memoizedState.isDehydrated){o.blockedOn=f.tag===3?f.stateNode.containerInfo:null;return}}}o.blockedOn=null}function Gf(o){if(o.blockedOn!==null)return!1;for(var l=o.targetContainers;0<l.length;){var f=W0(o.domEventName,o.eventSystemFlags,l[0],o.nativeEvent);if(f===null){f=o.nativeEvent;var g=new f.constructor(f.type,f);_n=g,f.target.dispatchEvent(g),_n=null}else return l=jc(f),l!==null&&z0(l),o.blockedOn=f,!1;l.shift()}return!0}function Vx(o,l,f){Gf(o)&&f.delete(l)}function dM(){U0=!1,yo!==null&&Gf(yo)&&(yo=null),_o!==null&&Gf(_o)&&(_o=null),wo!==null&&Gf(wo)&&(wo=null),xc.forEach(Vx),bc.forEach(Vx)}function Ec(o,l){o.blockedOn===l&&(o.blockedOn=null,U0||(U0=!0,e.unstable_scheduleCallback(e.unstable_NormalPriority,dM)))}function Cc(o){function l(b){return Ec(b,o)}if(0<qf.length){Ec(qf[0],o);for(var f=1;f<qf.length;f++){var g=qf[f];g.blockedOn===o&&(g.blockedOn=null)}}for(yo!==null&&Ec(yo,o),_o!==null&&Ec(_o,o),wo!==null&&Ec(wo,o),xc.forEach(l),bc.forEach(l),f=0;f<xo.length;f++)g=xo[f],g.blockedOn===o&&(g.blockedOn=null);for(;0<xo.length&&(f=xo[0],f.blockedOn===null);)$x(f),f.blockedOn===null&&xo.shift()}var $l=k.ReactCurrentBatchConfig,Kf=!0;function fM(o,l,f,g){var b=rt,C=$l.transition;$l.transition=null;try{rt=1,B0(o,l,f,g)}finally{rt=b,$l.transition=C}}function hM(o,l,f,g){var b=rt,C=$l.transition;$l.transition=null;try{rt=4,B0(o,l,f,g)}finally{rt=b,$l.transition=C}}function B0(o,l,f,g){if(Kf){var b=W0(o,l,f,g);if(b===null)lg(o,l,g,Zf,f),Fx(o,g);else if(cM(b,o,l,f,g))g.stopPropagation();else if(Fx(o,g),l&4&&-1<uM.indexOf(o)){for(;b!==null;){var C=jc(b);if(C!==null&&Lx(C),C=W0(o,l,f,g),C===null&&lg(o,l,g,Zf,f),C===b)break;b=C}b!==null&&g.stopPropagation()}else lg(o,l,g,null,f)}}var Zf=null;function W0(o,l,f,g){if(Zf=null,o=os(g),o=ka(o),o!==null)if(l=Ts(o),l===null)o=null;else if(f=l.tag,f===13){if(o=$f(l),o!==null)return o;o=null}else if(f===3){if(l.stateNode.current.memoizedState.isDehydrated)return l.tag===3?l.stateNode.containerInfo:null;o=null}else l!==o&&(o=null);return Zf=o,null}function Hx(o){switch(o){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(zf()){case Sa:return 1;case Uf:return 4;case Ea:case jl:return 16;case Fl:return 536870912;default:return 16}default:return 16}}var bo=null,q0=null,Yf=null;function zx(){if(Yf)return Yf;var o,l=q0,f=l.length,g,b="value"in bo?bo.value:bo.textContent,C=b.length;for(o=0;o<f&&l[o]===b[o];o++);var I=f-o;for(g=1;g<=I&&l[f-g]===b[C-g];g++);return Yf=b.slice(o,1<g?1-g:void 0)}function Xf(o){var l=o.keyCode;return"charCode"in o?(o=o.charCode,o===0&&l===13&&(o=13)):o=l,o===10&&(o=13),32<=o||o===13?o:0}function Qf(){return!0}function Ux(){return!1}function Fr(o){function l(f,g,b,C,I){this._reactName=f,this._targetInst=b,this.type=g,this.nativeEvent=C,this.target=I,this.currentTarget=null;for(var $ in o)o.hasOwnProperty($)&&(f=o[$],this[$]=f?f(C):C[$]);return this.isDefaultPrevented=(C.defaultPrevented!=null?C.defaultPrevented:C.returnValue===!1)?Qf:Ux,this.isPropagationStopped=Ux,this}return H(l.prototype,{preventDefault:function(){this.defaultPrevented=!0;var f=this.nativeEvent;f&&(f.preventDefault?f.preventDefault():typeof f.returnValue!="unknown"&&(f.returnValue=!1),this.isDefaultPrevented=Qf)},stopPropagation:function(){var f=this.nativeEvent;f&&(f.stopPropagation?f.stopPropagation():typeof f.cancelBubble!="unknown"&&(f.cancelBubble=!0),this.isPropagationStopped=Qf)},persist:function(){},isPersistent:Qf}),l}var Vl={eventPhase:0,bubbles:0,cancelable:0,timeStamp:function(o){return o.timeStamp||Date.now()},defaultPrevented:0,isTrusted:0},G0=Fr(Vl),kc=H({},Vl,{view:0,detail:0}),pM=Fr(kc),K0,Z0,Pc,Jf=H({},kc,{screenX:0,screenY:0,clientX:0,clientY:0,pageX:0,pageY:0,ctrlKey:0,shiftKey:0,altKey:0,metaKey:0,getModifierState:X0,button:0,buttons:0,relatedTarget:function(o){return o.relatedTarget===void 0?o.fromElement===o.srcElement?o.toElement:o.fromElement:o.relatedTarget},movementX:function(o){return"movementX"in o?o.movementX:(o!==Pc&&(Pc&&o.type==="mousemove"?(K0=o.screenX-Pc.screenX,Z0=o.screenY-Pc.screenY):Z0=K0=0,Pc=o),K0)},movementY:function(o){return"movementY"in o?o.movementY:Z0}}),Bx=Fr(Jf),mM=H({},Jf,{dataTransfer:0}),gM=Fr(mM),vM=H({},kc,{relatedTarget:0}),Y0=Fr(vM),yM=H({},Vl,{animationName:0,elapsedTime:0,pseudoElement:0}),_M=Fr(yM),wM=H({},Vl,{clipboardData:function(o){return"clipboardData"in o?o.clipboardData:window.clipboardData}}),xM=Fr(wM),bM=H({},Vl,{data:0}),Wx=Fr(bM),SM={Esc:"Escape",Spacebar:" ",Left:"ArrowLeft",Up:"ArrowUp",Right:"ArrowRight",Down:"ArrowDown",Del:"Delete",Win:"OS",Menu:"ContextMenu",Apps:"ContextMenu",Scroll:"ScrollLock",MozPrintableKey:"Unidentified"},EM={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"},CM={Alt:"altKey",Control:"ctrlKey",Meta:"metaKey",Shift:"shiftKey"};function kM(o){var l=this.nativeEvent;return l.getModifierState?l.getModifierState(o):(o=CM[o])?!!l[o]:!1}function X0(){return kM}var PM=H({},kc,{key:function(o){if(o.key){var l=SM[o.key]||o.key;if(l!=="Unidentified")return l}return o.type==="keypress"?(o=Xf(o),o===13?"Enter":String.fromCharCode(o)):o.type==="keydown"||o.type==="keyup"?EM[o.keyCode]||"Unidentified":""},code:0,location:0,ctrlKey:0,shiftKey:0,altKey:0,metaKey:0,repeat:0,locale:0,getModifierState:X0,charCode:function(o){return o.type==="keypress"?Xf(o):0},keyCode:function(o){return o.type==="keydown"||o.type==="keyup"?o.keyCode:0},which:function(o){return o.type==="keypress"?Xf(o):o.type==="keydown"||o.type==="keyup"?o.keyCode:0}}),TM=Fr(PM),RM=H({},Jf,{pointerId:0,width:0,height:0,pressure:0,tangentialPressure:0,tiltX:0,tiltY:0,twist:0,pointerType:0,isPrimary:0}),qx=Fr(RM),AM=H({},kc,{touches:0,targetTouches:0,changedTouches:0,altKey:0,metaKey:0,ctrlKey:0,shiftKey:0,getModifierState:X0}),IM=Fr(AM),MM=H({},Vl,{propertyName:0,elapsedTime:0,pseudoElement:0}),OM=Fr(MM),LM=H({},Jf,{deltaX:function(o){return"deltaX"in o?o.deltaX:"wheelDeltaX"in o?-o.wheelDeltaX:0},deltaY:function(o){return"deltaY"in o?o.deltaY:"wheelDeltaY"in o?-o.wheelDeltaY:"wheelDelta"in o?-o.wheelDelta:0},deltaZ:0,deltaMode:0}),DM=Fr(LM),NM=[9,13,27,32],Q0=u&&"CompositionEvent"in window,Tc=null;u&&"documentMode"in document&&(Tc=document.documentMode);var jM=u&&"TextEvent"in window&&!Tc,Gx=u&&(!Q0||Tc&&8<Tc&&11>=Tc),Kx=" ",Zx=!1;function Yx(o,l){switch(o){case"keyup":return NM.indexOf(l.keyCode)!==-1;case"keydown":return l.keyCode!==229;case"keypress":case"mousedown":case"focusout":return!0;default:return!1}}function Xx(o){return o=o.detail,typeof o=="object"&&"data"in o?o.data:null}var Hl=!1;function FM(o,l){switch(o){case"compositionend":return Xx(l);case"keypress":return l.which!==32?null:(Zx=!0,Kx);case"textInput":return o=l.data,o===Kx&&Zx?null:o;default:return null}}function $M(o,l){if(Hl)return o==="compositionend"||!Q0&&Yx(o,l)?(o=zx(),Yf=q0=bo=null,Hl=!1,o):null;switch(o){case"paste":return null;case"keypress":if(!(l.ctrlKey||l.altKey||l.metaKey)||l.ctrlKey&&l.altKey){if(l.char&&1<l.char.length)return l.char;if(l.which)return String.fromCharCode(l.which)}return null;case"compositionend":return Gx&&l.locale!=="ko"?null:l.data;default:return null}}var VM={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 Qx(o){var l=o&&o.nodeName&&o.nodeName.toLowerCase();return l==="input"?!!VM[o.type]:l==="textarea"}function Jx(o,l,f,g){xi(g),l=sh(l,"onChange"),0<l.length&&(f=new G0("onChange","change",null,f,g),o.push({event:f,listeners:l}))}var Rc=null,Ac=null;function HM(o){vb(o,0)}function eh(o){var l=ql(o);if(Pe(l))return o}function zM(o,l){if(o==="change")return l}var eb=!1;if(u){var J0;if(u){var eg="oninput"in document;if(!eg){var tb=document.createElement("div");tb.setAttribute("oninput","return;"),eg=typeof tb.oninput=="function"}J0=eg}else J0=!1;eb=J0&&(!document.documentMode||9<document.documentMode)}function nb(){Rc&&(Rc.detachEvent("onpropertychange",rb),Ac=Rc=null)}function rb(o){if(o.propertyName==="value"&&eh(Ac)){var l=[];Jx(l,Ac,o,os(o)),wn(HM,l)}}function UM(o,l,f){o==="focusin"?(nb(),Rc=l,Ac=f,Rc.attachEvent("onpropertychange",rb)):o==="focusout"&&nb()}function BM(o){if(o==="selectionchange"||o==="keyup"||o==="keydown")return eh(Ac)}function WM(o,l){if(o==="click")return eh(l)}function qM(o,l){if(o==="input"||o==="change")return eh(l)}function GM(o,l){return o===l&&(o!==0||1/o===1/l)||o!==o&&l!==l}var Is=typeof Object.is=="function"?Object.is:GM;function Ic(o,l){if(Is(o,l))return!0;if(typeof o!="object"||o===null||typeof l!="object"||l===null)return!1;var f=Object.keys(o),g=Object.keys(l);if(f.length!==g.length)return!1;for(g=0;g<f.length;g++){var b=f[g];if(!c.call(l,b)||!Is(o[b],l[b]))return!1}return!0}function sb(o){for(;o&&o.firstChild;)o=o.firstChild;return o}function ib(o,l){var f=sb(o);o=0;for(var g;f;){if(f.nodeType===3){if(g=o+f.textContent.length,o<=l&&g>=l)return{node:f,offset:l-o};o=g}e:{for(;f;){if(f.nextSibling){f=f.nextSibling;break e}f=f.parentNode}f=void 0}f=sb(f)}}function ob(o,l){return o&&l?o===l?!0:o&&o.nodeType===3?!1:l&&l.nodeType===3?ob(o,l.parentNode):"contains"in o?o.contains(l):o.compareDocumentPosition?!!(o.compareDocumentPosition(l)&16):!1:!1}function ab(){for(var o=window,l=$e();l instanceof o.HTMLIFrameElement;){try{var f=typeof l.contentWindow.location.href=="string"}catch{f=!1}if(f)o=l.contentWindow;else break;l=$e(o.document)}return l}function tg(o){var l=o&&o.nodeName&&o.nodeName.toLowerCase();return l&&(l==="input"&&(o.type==="text"||o.type==="search"||o.type==="tel"||o.type==="url"||o.type==="password")||l==="textarea"||o.contentEditable==="true")}function KM(o){var l=ab(),f=o.focusedElem,g=o.selectionRange;if(l!==f&&f&&f.ownerDocument&&ob(f.ownerDocument.documentElement,f)){if(g!==null&&tg(f)){if(l=g.start,o=g.end,o===void 0&&(o=l),"selectionStart"in f)f.selectionStart=l,f.selectionEnd=Math.min(o,f.value.length);else if(o=(l=f.ownerDocument||document)&&l.defaultView||window,o.getSelection){o=o.getSelection();var b=f.textContent.length,C=Math.min(g.start,b);g=g.end===void 0?C:Math.min(g.end,b),!o.extend&&C>g&&(b=g,g=C,C=b),b=ib(f,C);var I=ib(f,g);b&&I&&(o.rangeCount!==1||o.anchorNode!==b.node||o.anchorOffset!==b.offset||o.focusNode!==I.node||o.focusOffset!==I.offset)&&(l=l.createRange(),l.setStart(b.node,b.offset),o.removeAllRanges(),C>g?(o.addRange(l),o.extend(I.node,I.offset)):(l.setEnd(I.node,I.offset),o.addRange(l)))}}for(l=[],o=f;o=o.parentNode;)o.nodeType===1&&l.push({element:o,left:o.scrollLeft,top:o.scrollTop});for(typeof f.focus=="function"&&f.focus(),f=0;f<l.length;f++)o=l[f],o.element.scrollLeft=o.left,o.element.scrollTop=o.top}}var ZM=u&&"documentMode"in document&&11>=document.documentMode,zl=null,ng=null,Mc=null,rg=!1;function lb(o,l,f){var g=f.window===f?f.document:f.nodeType===9?f:f.ownerDocument;rg||zl==null||zl!==$e(g)||(g=zl,"selectionStart"in g&&tg(g)?g={start:g.selectionStart,end:g.selectionEnd}:(g=(g.ownerDocument&&g.ownerDocument.defaultView||window).getSelection(),g={anchorNode:g.anchorNode,anchorOffset:g.anchorOffset,focusNode:g.focusNode,focusOffset:g.focusOffset}),Mc&&Ic(Mc,g)||(Mc=g,g=sh(ng,"onSelect"),0<g.length&&(l=new G0("onSelect","select",null,l,f),o.push({event:l,listeners:g}),l.target=zl)))}function th(o,l){var f={};return f[o.toLowerCase()]=l.toLowerCase(),f["Webkit"+o]="webkit"+l,f["Moz"+o]="moz"+l,f}var Ul={animationend:th("Animation","AnimationEnd"),animationiteration:th("Animation","AnimationIteration"),animationstart:th("Animation","AnimationStart"),transitionend:th("Transition","TransitionEnd")},sg={},ub={};u&&(ub=document.createElement("div").style,"AnimationEvent"in window||(delete Ul.animationend.animation,delete Ul.animationiteration.animation,delete Ul.animationstart.animation),"TransitionEvent"in window||delete Ul.transitionend.transition);function nh(o){if(sg[o])return sg[o];if(!Ul[o])return o;var l=Ul[o],f;for(f in l)if(l.hasOwnProperty(f)&&f in ub)return sg[o]=l[f];return o}var cb=nh("animationend"),db=nh("animationiteration"),fb=nh("animationstart"),hb=nh("transitionend"),pb=new Map,mb="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 So(o,l){pb.set(o,l),i(l,[o])}for(var ig=0;ig<mb.length;ig++){var og=mb[ig],YM=og.toLowerCase(),XM=og[0].toUpperCase()+og.slice(1);So(YM,"on"+XM)}So(cb,"onAnimationEnd"),So(db,"onAnimationIteration"),So(fb,"onAnimationStart"),So("dblclick","onDoubleClick"),So("focusin","onFocus"),So("focusout","onBlur"),So(hb,"onTransitionEnd"),a("onMouseEnter",["mouseout","mouseover"]),a("onMouseLeave",["mouseout","mouseover"]),a("onPointerEnter",["pointerout","pointerover"]),a("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 Oc="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(" "),QM=new Set("cancel close invalid load scroll toggle".split(" ").concat(Oc));function gb(o,l,f){var g=o.type||"unknown-event";o.currentTarget=f,$0(g,l,void 0,o),o.currentTarget=null}function vb(o,l){l=(l&4)!==0;for(var f=0;f<o.length;f++){var g=o[f],b=g.event;g=g.listeners;e:{var C=void 0;if(l)for(var I=g.length-1;0<=I;I--){var $=g[I],B=$.instance,re=$.currentTarget;if($=$.listener,B!==C&&b.isPropagationStopped())break e;gb(b,$,re),C=B}else for(I=0;I<g.length;I++){if($=g[I],B=$.instance,re=$.currentTarget,$=$.listener,B!==C&&b.isPropagationStopped())break e;gb(b,$,re),C=B}}}if(qs)throw o=_c,qs=!1,_c=null,o}function Lt(o,l){var f=l[pg];f===void 0&&(f=l[pg]=new Set);var g=o+"__bubble";f.has(g)||(yb(l,o,2,!1),f.add(g))}function ag(o,l,f){var g=0;l&&(g|=4),yb(f,o,g,l)}var rh="_reactListening"+Math.random().toString(36).slice(2);function Lc(o){if(!o[rh]){o[rh]=!0,r.forEach(function(f){f!=="selectionchange"&&(QM.has(f)||ag(f,!1,o),ag(f,!0,o))});var l=o.nodeType===9?o:o.ownerDocument;l===null||l[rh]||(l[rh]=!0,ag("selectionchange",!1,l))}}function yb(o,l,f,g){switch(Hx(l)){case 1:var b=fM;break;case 4:b=hM;break;default:b=B0}f=b.bind(null,l,f,o),b=void 0,!qt||l!=="touchstart"&&l!=="touchmove"&&l!=="wheel"||(b=!0),g?b!==void 0?o.addEventListener(l,f,{capture:!0,passive:b}):o.addEventListener(l,f,!0):b!==void 0?o.addEventListener(l,f,{passive:b}):o.addEventListener(l,f,!1)}function lg(o,l,f,g,b){var C=g;if((l&1)===0&&(l&2)===0&&g!==null)e:for(;;){if(g===null)return;var I=g.tag;if(I===3||I===4){var $=g.stateNode.containerInfo;if($===b||$.nodeType===8&&$.parentNode===b)break;if(I===4)for(I=g.return;I!==null;){var B=I.tag;if((B===3||B===4)&&(B=I.stateNode.containerInfo,B===b||B.nodeType===8&&B.parentNode===b))return;I=I.return}for(;$!==null;){if(I=ka($),I===null)return;if(B=I.tag,B===5||B===6){g=C=I;continue e}$=$.parentNode}}g=g.return}wn(function(){var re=C,fe=os(f),ge=[];e:{var de=pb.get(o);if(de!==void 0){var Re=G0,Oe=o;switch(o){case"keypress":if(Xf(f)===0)break e;case"keydown":case"keyup":Re=TM;break;case"focusin":Oe="focus",Re=Y0;break;case"focusout":Oe="blur",Re=Y0;break;case"beforeblur":case"afterblur":Re=Y0;break;case"click":if(f.button===2)break e;case"auxclick":case"dblclick":case"mousedown":case"mousemove":case"mouseup":case"mouseout":case"mouseover":case"contextmenu":Re=Bx;break;case"drag":case"dragend":case"dragenter":case"dragexit":case"dragleave":case"dragover":case"dragstart":case"drop":Re=gM;break;case"touchcancel":case"touchend":case"touchmove":case"touchstart":Re=IM;break;case cb:case db:case fb:Re=_M;break;case hb:Re=OM;break;case"scroll":Re=pM;break;case"wheel":Re=DM;break;case"copy":case"cut":case"paste":Re=xM;break;case"gotpointercapture":case"lostpointercapture":case"pointercancel":case"pointerdown":case"pointermove":case"pointerout":case"pointerover":case"pointerup":Re=qx}var De=(l&4)!==0,un=!De&&o==="scroll",Q=De?de!==null?de+"Capture":null:de;De=[];for(var K=re,te;K!==null;){te=K;var xe=te.stateNode;if(te.tag===5&&xe!==null&&(te=xe,Q!==null&&(xe=Nr(K,Q),xe!=null&&De.push(Dc(K,xe,te)))),un)break;K=K.return}0<De.length&&(de=new Re(de,Oe,null,f,fe),ge.push({event:de,listeners:De}))}}if((l&7)===0){e:{if(de=o==="mouseover"||o==="pointerover",Re=o==="mouseout"||o==="pointerout",de&&f!==_n&&(Oe=f.relatedTarget||f.fromElement)&&(ka(Oe)||Oe[Ei]))break e;if((Re||de)&&(de=fe.window===fe?fe:(de=fe.ownerDocument)?de.defaultView||de.parentWindow:window,Re?(Oe=f.relatedTarget||f.toElement,Re=re,Oe=Oe?ka(Oe):null,Oe!==null&&(un=Ts(Oe),Oe!==un||Oe.tag!==5&&Oe.tag!==6)&&(Oe=null)):(Re=null,Oe=re),Re!==Oe)){if(De=Bx,xe="onMouseLeave",Q="onMouseEnter",K="mouse",(o==="pointerout"||o==="pointerover")&&(De=qx,xe="onPointerLeave",Q="onPointerEnter",K="pointer"),un=Re==null?de:ql(Re),te=Oe==null?de:ql(Oe),de=new De(xe,K+"leave",Re,f,fe),de.target=un,de.relatedTarget=te,xe=null,ka(fe)===re&&(De=new De(Q,K+"enter",Oe,f,fe),De.target=te,De.relatedTarget=un,xe=De),un=xe,Re&&Oe)t:{for(De=Re,Q=Oe,K=0,te=De;te;te=Bl(te))K++;for(te=0,xe=Q;xe;xe=Bl(xe))te++;for(;0<K-te;)De=Bl(De),K--;for(;0<te-K;)Q=Bl(Q),te--;for(;K--;){if(De===Q||Q!==null&&De===Q.alternate)break t;De=Bl(De),Q=Bl(Q)}De=null}else De=null;Re!==null&&_b(ge,de,Re,De,!1),Oe!==null&&un!==null&&_b(ge,un,Oe,De,!0)}}e:{if(de=re?ql(re):window,Re=de.nodeName&&de.nodeName.toLowerCase(),Re==="select"||Re==="input"&&de.type==="file")var je=zM;else if(Qx(de))if(eb)je=qM;else{je=BM;var ze=UM}else(Re=de.nodeName)&&Re.toLowerCase()==="input"&&(de.type==="checkbox"||de.type==="radio")&&(je=WM);if(je&&(je=je(o,re))){Jx(ge,je,f,fe);break e}ze&&ze(o,de,re),o==="focusout"&&(ze=de._wrapperState)&&ze.controlled&&de.type==="number"&&tt(de,"number",de.value)}switch(ze=re?ql(re):window,o){case"focusin":(Qx(ze)||ze.contentEditable==="true")&&(zl=ze,ng=re,Mc=null);break;case"focusout":Mc=ng=zl=null;break;case"mousedown":rg=!0;break;case"contextmenu":case"mouseup":case"dragend":rg=!1,lb(ge,f,fe);break;case"selectionchange":if(ZM)break;case"keydown":case"keyup":lb(ge,f,fe)}var Ue;if(Q0)e:{switch(o){case"compositionstart":var Xe="onCompositionStart";break e;case"compositionend":Xe="onCompositionEnd";break e;case"compositionupdate":Xe="onCompositionUpdate";break e}Xe=void 0}else Hl?Yx(o,f)&&(Xe="onCompositionEnd"):o==="keydown"&&f.keyCode===229&&(Xe="onCompositionStart");Xe&&(Gx&&f.locale!=="ko"&&(Hl||Xe!=="onCompositionStart"?Xe==="onCompositionEnd"&&Hl&&(Ue=zx()):(bo=fe,q0="value"in bo?bo.value:bo.textContent,Hl=!0)),ze=sh(re,Xe),0<ze.length&&(Xe=new Wx(Xe,o,null,f,fe),ge.push({event:Xe,listeners:ze}),Ue?Xe.data=Ue:(Ue=Xx(f),Ue!==null&&(Xe.data=Ue)))),(Ue=jM?FM(o,f):$M(o,f))&&(re=sh(re,"onBeforeInput"),0<re.length&&(fe=new Wx("onBeforeInput","beforeinput",null,f,fe),ge.push({event:fe,listeners:re}),fe.data=Ue))}vb(ge,l)})}function Dc(o,l,f){return{instance:o,listener:l,currentTarget:f}}function sh(o,l){for(var f=l+"Capture",g=[];o!==null;){var b=o,C=b.stateNode;b.tag===5&&C!==null&&(b=C,C=Nr(o,f),C!=null&&g.unshift(Dc(o,C,b)),C=Nr(o,l),C!=null&&g.push(Dc(o,C,b))),o=o.return}return g}function Bl(o){if(o===null)return null;do o=o.return;while(o&&o.tag!==5);return o||null}function _b(o,l,f,g,b){for(var C=l._reactName,I=[];f!==null&&f!==g;){var $=f,B=$.alternate,re=$.stateNode;if(B!==null&&B===g)break;$.tag===5&&re!==null&&($=re,b?(B=Nr(f,C),B!=null&&I.unshift(Dc(f,B,$))):b||(B=Nr(f,C),B!=null&&I.push(Dc(f,B,$)))),f=f.return}I.length!==0&&o.push({event:l,listeners:I})}var JM=/\r\n?/g,eO=/\u0000|\uFFFD/g;function wb(o){return(typeof o=="string"?o:""+o).replace(JM,`
40
- `).replace(eO,"")}function ih(o,l,f){if(l=wb(l),wb(o)!==l&&f)throw Error(n(425))}function oh(){}var ug=null,cg=null;function dg(o,l){return o==="textarea"||o==="noscript"||typeof l.children=="string"||typeof l.children=="number"||typeof l.dangerouslySetInnerHTML=="object"&&l.dangerouslySetInnerHTML!==null&&l.dangerouslySetInnerHTML.__html!=null}var fg=typeof setTimeout=="function"?setTimeout:void 0,tO=typeof clearTimeout=="function"?clearTimeout:void 0,xb=typeof Promise=="function"?Promise:void 0,nO=typeof queueMicrotask=="function"?queueMicrotask:typeof xb<"u"?function(o){return xb.resolve(null).then(o).catch(rO)}:fg;function rO(o){setTimeout(function(){throw o})}function hg(o,l){var f=l,g=0;do{var b=f.nextSibling;if(o.removeChild(f),b&&b.nodeType===8)if(f=b.data,f==="/$"){if(g===0){o.removeChild(b),Cc(l);return}g--}else f!=="$"&&f!=="$?"&&f!=="$!"||g++;f=b}while(f);Cc(l)}function Eo(o){for(;o!=null;o=o.nextSibling){var l=o.nodeType;if(l===1||l===3)break;if(l===8){if(l=o.data,l==="$"||l==="$!"||l==="$?")break;if(l==="/$")return null}}return o}function bb(o){o=o.previousSibling;for(var l=0;o;){if(o.nodeType===8){var f=o.data;if(f==="$"||f==="$!"||f==="$?"){if(l===0)return o;l--}else f==="/$"&&l++}o=o.previousSibling}return null}var Wl=Math.random().toString(36).slice(2),Gs="__reactFiber$"+Wl,Nc="__reactProps$"+Wl,Ei="__reactContainer$"+Wl,pg="__reactEvents$"+Wl,sO="__reactListeners$"+Wl,iO="__reactHandles$"+Wl;function ka(o){var l=o[Gs];if(l)return l;for(var f=o.parentNode;f;){if(l=f[Ei]||f[Gs]){if(f=l.alternate,l.child!==null||f!==null&&f.child!==null)for(o=bb(o);o!==null;){if(f=o[Gs])return f;o=bb(o)}return l}o=f,f=o.parentNode}return null}function jc(o){return o=o[Gs]||o[Ei],!o||o.tag!==5&&o.tag!==6&&o.tag!==13&&o.tag!==3?null:o}function ql(o){if(o.tag===5||o.tag===6)return o.stateNode;throw Error(n(33))}function ah(o){return o[Nc]||null}var mg=[],Gl=-1;function Co(o){return{current:o}}function Dt(o){0>Gl||(o.current=mg[Gl],mg[Gl]=null,Gl--)}function Rt(o,l){Gl++,mg[Gl]=o.current,o.current=l}var ko={},Wn=Co(ko),gr=Co(!1),Pa=ko;function Kl(o,l){var f=o.type.contextTypes;if(!f)return ko;var g=o.stateNode;if(g&&g.__reactInternalMemoizedUnmaskedChildContext===l)return g.__reactInternalMemoizedMaskedChildContext;var b={},C;for(C in f)b[C]=l[C];return g&&(o=o.stateNode,o.__reactInternalMemoizedUnmaskedChildContext=l,o.__reactInternalMemoizedMaskedChildContext=b),b}function vr(o){return o=o.childContextTypes,o!=null}function lh(){Dt(gr),Dt(Wn)}function Sb(o,l,f){if(Wn.current!==ko)throw Error(n(168));Rt(Wn,l),Rt(gr,f)}function Eb(o,l,f){var g=o.stateNode;if(l=l.childContextTypes,typeof g.getChildContext!="function")return f;g=g.getChildContext();for(var b in g)if(!(b in l))throw Error(n(108,we(o)||"Unknown",b));return H({},f,g)}function uh(o){return o=(o=o.stateNode)&&o.__reactInternalMemoizedMergedChildContext||ko,Pa=Wn.current,Rt(Wn,o),Rt(gr,gr.current),!0}function Cb(o,l,f){var g=o.stateNode;if(!g)throw Error(n(169));f?(o=Eb(o,l,Pa),g.__reactInternalMemoizedMergedChildContext=o,Dt(gr),Dt(Wn),Rt(Wn,o)):Dt(gr),Rt(gr,f)}var Ci=null,ch=!1,gg=!1;function kb(o){Ci===null?Ci=[o]:Ci.push(o)}function oO(o){ch=!0,kb(o)}function Po(){if(!gg&&Ci!==null){gg=!0;var o=0,l=rt;try{var f=Ci;for(rt=1;o<f.length;o++){var g=f[o];do g=g(!0);while(g!==null)}Ci=null,ch=!1}catch(b){throw Ci!==null&&(Ci=Ci.slice(o+1)),Nl(Sa,Po),b}finally{rt=l,gg=!1}}return null}var Zl=[],Yl=0,dh=null,fh=0,cs=[],ds=0,Ta=null,ki=1,Pi="";function Ra(o,l){Zl[Yl++]=fh,Zl[Yl++]=dh,dh=o,fh=l}function Pb(o,l,f){cs[ds++]=ki,cs[ds++]=Pi,cs[ds++]=Ta,Ta=o;var g=ki;o=Pi;var b=32-pr(g)-1;g&=~(1<<b),f+=1;var C=32-pr(l)+b;if(30<C){var I=b-b%5;C=(g&(1<<I)-1).toString(32),g>>=I,b-=I,ki=1<<32-pr(l)+b|f<<b|g,Pi=C+o}else ki=1<<C|f<<b|g,Pi=o}function vg(o){o.return!==null&&(Ra(o,1),Pb(o,1,0))}function yg(o){for(;o===dh;)dh=Zl[--Yl],Zl[Yl]=null,fh=Zl[--Yl],Zl[Yl]=null;for(;o===Ta;)Ta=cs[--ds],cs[ds]=null,Pi=cs[--ds],cs[ds]=null,ki=cs[--ds],cs[ds]=null}var $r=null,Vr=null,Ht=!1,Ms=null;function Tb(o,l){var f=ms(5,null,null,0);f.elementType="DELETED",f.stateNode=l,f.return=o,l=o.deletions,l===null?(o.deletions=[f],o.flags|=16):l.push(f)}function Rb(o,l){switch(o.tag){case 5:var f=o.type;return l=l.nodeType!==1||f.toLowerCase()!==l.nodeName.toLowerCase()?null:l,l!==null?(o.stateNode=l,$r=o,Vr=Eo(l.firstChild),!0):!1;case 6:return l=o.pendingProps===""||l.nodeType!==3?null:l,l!==null?(o.stateNode=l,$r=o,Vr=null,!0):!1;case 13:return l=l.nodeType!==8?null:l,l!==null?(f=Ta!==null?{id:ki,overflow:Pi}:null,o.memoizedState={dehydrated:l,treeContext:f,retryLane:1073741824},f=ms(18,null,null,0),f.stateNode=l,f.return=o,o.child=f,$r=o,Vr=null,!0):!1;default:return!1}}function _g(o){return(o.mode&1)!==0&&(o.flags&128)===0}function wg(o){if(Ht){var l=Vr;if(l){var f=l;if(!Rb(o,l)){if(_g(o))throw Error(n(418));l=Eo(f.nextSibling);var g=$r;l&&Rb(o,l)?Tb(g,f):(o.flags=o.flags&-4097|2,Ht=!1,$r=o)}}else{if(_g(o))throw Error(n(418));o.flags=o.flags&-4097|2,Ht=!1,$r=o}}}function Ab(o){for(o=o.return;o!==null&&o.tag!==5&&o.tag!==3&&o.tag!==13;)o=o.return;$r=o}function hh(o){if(o!==$r)return!1;if(!Ht)return Ab(o),Ht=!0,!1;var l;if((l=o.tag!==3)&&!(l=o.tag!==5)&&(l=o.type,l=l!=="head"&&l!=="body"&&!dg(o.type,o.memoizedProps)),l&&(l=Vr)){if(_g(o))throw Ib(),Error(n(418));for(;l;)Tb(o,l),l=Eo(l.nextSibling)}if(Ab(o),o.tag===13){if(o=o.memoizedState,o=o!==null?o.dehydrated:null,!o)throw Error(n(317));e:{for(o=o.nextSibling,l=0;o;){if(o.nodeType===8){var f=o.data;if(f==="/$"){if(l===0){Vr=Eo(o.nextSibling);break e}l--}else f!=="$"&&f!=="$!"&&f!=="$?"||l++}o=o.nextSibling}Vr=null}}else Vr=$r?Eo(o.stateNode.nextSibling):null;return!0}function Ib(){for(var o=Vr;o;)o=Eo(o.nextSibling)}function Xl(){Vr=$r=null,Ht=!1}function xg(o){Ms===null?Ms=[o]:Ms.push(o)}var aO=k.ReactCurrentBatchConfig;function Fc(o,l,f){if(o=f.ref,o!==null&&typeof o!="function"&&typeof o!="object"){if(f._owner){if(f=f._owner,f){if(f.tag!==1)throw Error(n(309));var g=f.stateNode}if(!g)throw Error(n(147,o));var b=g,C=""+o;return l!==null&&l.ref!==null&&typeof l.ref=="function"&&l.ref._stringRef===C?l.ref:(l=function(I){var $=b.refs;I===null?delete $[C]:$[C]=I},l._stringRef=C,l)}if(typeof o!="string")throw Error(n(284));if(!f._owner)throw Error(n(290,o))}return o}function ph(o,l){throw o=Object.prototype.toString.call(l),Error(n(31,o==="[object Object]"?"object with keys {"+Object.keys(l).join(", ")+"}":o))}function Mb(o){var l=o._init;return l(o._payload)}function Ob(o){function l(Q,K){if(o){var te=Q.deletions;te===null?(Q.deletions=[K],Q.flags|=16):te.push(K)}}function f(Q,K){if(!o)return null;for(;K!==null;)l(Q,K),K=K.sibling;return null}function g(Q,K){for(Q=new Map;K!==null;)K.key!==null?Q.set(K.key,K):Q.set(K.index,K),K=K.sibling;return Q}function b(Q,K){return Q=Do(Q,K),Q.index=0,Q.sibling=null,Q}function C(Q,K,te){return Q.index=te,o?(te=Q.alternate,te!==null?(te=te.index,te<K?(Q.flags|=2,K):te):(Q.flags|=2,K)):(Q.flags|=1048576,K)}function I(Q){return o&&Q.alternate===null&&(Q.flags|=2),Q}function $(Q,K,te,xe){return K===null||K.tag!==6?(K=fv(te,Q.mode,xe),K.return=Q,K):(K=b(K,te),K.return=Q,K)}function B(Q,K,te,xe){var je=te.type;return je===L?fe(Q,K,te.props.children,xe,te.key):K!==null&&(K.elementType===je||typeof je=="object"&&je!==null&&je.$$typeof===q&&Mb(je)===K.type)?(xe=b(K,te.props),xe.ref=Fc(Q,K,te),xe.return=Q,xe):(xe=Fh(te.type,te.key,te.props,null,Q.mode,xe),xe.ref=Fc(Q,K,te),xe.return=Q,xe)}function re(Q,K,te,xe){return K===null||K.tag!==4||K.stateNode.containerInfo!==te.containerInfo||K.stateNode.implementation!==te.implementation?(K=hv(te,Q.mode,xe),K.return=Q,K):(K=b(K,te.children||[]),K.return=Q,K)}function fe(Q,K,te,xe,je){return K===null||K.tag!==7?(K=ja(te,Q.mode,xe,je),K.return=Q,K):(K=b(K,te),K.return=Q,K)}function ge(Q,K,te){if(typeof K=="string"&&K!==""||typeof K=="number")return K=fv(""+K,Q.mode,te),K.return=Q,K;if(typeof K=="object"&&K!==null){switch(K.$$typeof){case R:return te=Fh(K.type,K.key,K.props,null,Q.mode,te),te.ref=Fc(Q,null,K),te.return=Q,te;case M:return K=hv(K,Q.mode,te),K.return=Q,K;case q:var xe=K._init;return ge(Q,xe(K._payload),te)}if(_t(K)||J(K))return K=ja(K,Q.mode,te,null),K.return=Q,K;ph(Q,K)}return null}function de(Q,K,te,xe){var je=K!==null?K.key:null;if(typeof te=="string"&&te!==""||typeof te=="number")return je!==null?null:$(Q,K,""+te,xe);if(typeof te=="object"&&te!==null){switch(te.$$typeof){case R:return te.key===je?B(Q,K,te,xe):null;case M:return te.key===je?re(Q,K,te,xe):null;case q:return je=te._init,de(Q,K,je(te._payload),xe)}if(_t(te)||J(te))return je!==null?null:fe(Q,K,te,xe,null);ph(Q,te)}return null}function Re(Q,K,te,xe,je){if(typeof xe=="string"&&xe!==""||typeof xe=="number")return Q=Q.get(te)||null,$(K,Q,""+xe,je);if(typeof xe=="object"&&xe!==null){switch(xe.$$typeof){case R:return Q=Q.get(xe.key===null?te:xe.key)||null,B(K,Q,xe,je);case M:return Q=Q.get(xe.key===null?te:xe.key)||null,re(K,Q,xe,je);case q:var ze=xe._init;return Re(Q,K,te,ze(xe._payload),je)}if(_t(xe)||J(xe))return Q=Q.get(te)||null,fe(K,Q,xe,je,null);ph(K,xe)}return null}function Oe(Q,K,te,xe){for(var je=null,ze=null,Ue=K,Xe=K=0,Pn=null;Ue!==null&&Xe<te.length;Xe++){Ue.index>Xe?(Pn=Ue,Ue=null):Pn=Ue.sibling;var pt=de(Q,Ue,te[Xe],xe);if(pt===null){Ue===null&&(Ue=Pn);break}o&&Ue&&pt.alternate===null&&l(Q,Ue),K=C(pt,K,Xe),ze===null?je=pt:ze.sibling=pt,ze=pt,Ue=Pn}if(Xe===te.length)return f(Q,Ue),Ht&&Ra(Q,Xe),je;if(Ue===null){for(;Xe<te.length;Xe++)Ue=ge(Q,te[Xe],xe),Ue!==null&&(K=C(Ue,K,Xe),ze===null?je=Ue:ze.sibling=Ue,ze=Ue);return Ht&&Ra(Q,Xe),je}for(Ue=g(Q,Ue);Xe<te.length;Xe++)Pn=Re(Ue,Q,Xe,te[Xe],xe),Pn!==null&&(o&&Pn.alternate!==null&&Ue.delete(Pn.key===null?Xe:Pn.key),K=C(Pn,K,Xe),ze===null?je=Pn:ze.sibling=Pn,ze=Pn);return o&&Ue.forEach(function(No){return l(Q,No)}),Ht&&Ra(Q,Xe),je}function De(Q,K,te,xe){var je=J(te);if(typeof je!="function")throw Error(n(150));if(te=je.call(te),te==null)throw Error(n(151));for(var ze=je=null,Ue=K,Xe=K=0,Pn=null,pt=te.next();Ue!==null&&!pt.done;Xe++,pt=te.next()){Ue.index>Xe?(Pn=Ue,Ue=null):Pn=Ue.sibling;var No=de(Q,Ue,pt.value,xe);if(No===null){Ue===null&&(Ue=Pn);break}o&&Ue&&No.alternate===null&&l(Q,Ue),K=C(No,K,Xe),ze===null?je=No:ze.sibling=No,ze=No,Ue=Pn}if(pt.done)return f(Q,Ue),Ht&&Ra(Q,Xe),je;if(Ue===null){for(;!pt.done;Xe++,pt=te.next())pt=ge(Q,pt.value,xe),pt!==null&&(K=C(pt,K,Xe),ze===null?je=pt:ze.sibling=pt,ze=pt);return Ht&&Ra(Q,Xe),je}for(Ue=g(Q,Ue);!pt.done;Xe++,pt=te.next())pt=Re(Ue,Q,Xe,pt.value,xe),pt!==null&&(o&&pt.alternate!==null&&Ue.delete(pt.key===null?Xe:pt.key),K=C(pt,K,Xe),ze===null?je=pt:ze.sibling=pt,ze=pt);return o&&Ue.forEach(function(VO){return l(Q,VO)}),Ht&&Ra(Q,Xe),je}function un(Q,K,te,xe){if(typeof te=="object"&&te!==null&&te.type===L&&te.key===null&&(te=te.props.children),typeof te=="object"&&te!==null){switch(te.$$typeof){case R:e:{for(var je=te.key,ze=K;ze!==null;){if(ze.key===je){if(je=te.type,je===L){if(ze.tag===7){f(Q,ze.sibling),K=b(ze,te.props.children),K.return=Q,Q=K;break e}}else if(ze.elementType===je||typeof je=="object"&&je!==null&&je.$$typeof===q&&Mb(je)===ze.type){f(Q,ze.sibling),K=b(ze,te.props),K.ref=Fc(Q,ze,te),K.return=Q,Q=K;break e}f(Q,ze);break}else l(Q,ze);ze=ze.sibling}te.type===L?(K=ja(te.props.children,Q.mode,xe,te.key),K.return=Q,Q=K):(xe=Fh(te.type,te.key,te.props,null,Q.mode,xe),xe.ref=Fc(Q,K,te),xe.return=Q,Q=xe)}return I(Q);case M:e:{for(ze=te.key;K!==null;){if(K.key===ze)if(K.tag===4&&K.stateNode.containerInfo===te.containerInfo&&K.stateNode.implementation===te.implementation){f(Q,K.sibling),K=b(K,te.children||[]),K.return=Q,Q=K;break e}else{f(Q,K);break}else l(Q,K);K=K.sibling}K=hv(te,Q.mode,xe),K.return=Q,Q=K}return I(Q);case q:return ze=te._init,un(Q,K,ze(te._payload),xe)}if(_t(te))return Oe(Q,K,te,xe);if(J(te))return De(Q,K,te,xe);ph(Q,te)}return typeof te=="string"&&te!==""||typeof te=="number"?(te=""+te,K!==null&&K.tag===6?(f(Q,K.sibling),K=b(K,te),K.return=Q,Q=K):(f(Q,K),K=fv(te,Q.mode,xe),K.return=Q,Q=K),I(Q)):f(Q,K)}return un}var Ql=Ob(!0),Lb=Ob(!1),mh=Co(null),gh=null,Jl=null,bg=null;function Sg(){bg=Jl=gh=null}function Eg(o){var l=mh.current;Dt(mh),o._currentValue=l}function Cg(o,l,f){for(;o!==null;){var g=o.alternate;if((o.childLanes&l)!==l?(o.childLanes|=l,g!==null&&(g.childLanes|=l)):g!==null&&(g.childLanes&l)!==l&&(g.childLanes|=l),o===f)break;o=o.return}}function eu(o,l){gh=o,bg=Jl=null,o=o.dependencies,o!==null&&o.firstContext!==null&&((o.lanes&l)!==0&&(yr=!0),o.firstContext=null)}function fs(o){var l=o._currentValue;if(bg!==o)if(o={context:o,memoizedValue:l,next:null},Jl===null){if(gh===null)throw Error(n(308));Jl=o,gh.dependencies={lanes:0,firstContext:o}}else Jl=Jl.next=o;return l}var Aa=null;function kg(o){Aa===null?Aa=[o]:Aa.push(o)}function Db(o,l,f,g){var b=l.interleaved;return b===null?(f.next=f,kg(l)):(f.next=b.next,b.next=f),l.interleaved=f,Ti(o,g)}function Ti(o,l){o.lanes|=l;var f=o.alternate;for(f!==null&&(f.lanes|=l),f=o,o=o.return;o!==null;)o.childLanes|=l,f=o.alternate,f!==null&&(f.childLanes|=l),f=o,o=o.return;return f.tag===3?f.stateNode:null}var To=!1;function Pg(o){o.updateQueue={baseState:o.memoizedState,firstBaseUpdate:null,lastBaseUpdate:null,shared:{pending:null,interleaved:null,lanes:0},effects:null}}function Nb(o,l){o=o.updateQueue,l.updateQueue===o&&(l.updateQueue={baseState:o.baseState,firstBaseUpdate:o.firstBaseUpdate,lastBaseUpdate:o.lastBaseUpdate,shared:o.shared,effects:o.effects})}function Ri(o,l){return{eventTime:o,lane:l,tag:0,payload:null,callback:null,next:null}}function Ro(o,l,f){var g=o.updateQueue;if(g===null)return null;if(g=g.shared,(ft&2)!==0){var b=g.pending;return b===null?l.next=l:(l.next=b.next,b.next=l),g.pending=l,Ti(o,f)}return b=g.interleaved,b===null?(l.next=l,kg(g)):(l.next=b.next,b.next=l),g.interleaved=l,Ti(o,f)}function vh(o,l,f){if(l=l.updateQueue,l!==null&&(l=l.shared,(f&4194240)!==0)){var g=l.lanes;g&=o.pendingLanes,f|=g,l.lanes=f,Si(o,f)}}function jb(o,l){var f=o.updateQueue,g=o.alternate;if(g!==null&&(g=g.updateQueue,f===g)){var b=null,C=null;if(f=f.firstBaseUpdate,f!==null){do{var I={eventTime:f.eventTime,lane:f.lane,tag:f.tag,payload:f.payload,callback:f.callback,next:null};C===null?b=C=I:C=C.next=I,f=f.next}while(f!==null);C===null?b=C=l:C=C.next=l}else b=C=l;f={baseState:g.baseState,firstBaseUpdate:b,lastBaseUpdate:C,shared:g.shared,effects:g.effects},o.updateQueue=f;return}o=f.lastBaseUpdate,o===null?f.firstBaseUpdate=l:o.next=l,f.lastBaseUpdate=l}function yh(o,l,f,g){var b=o.updateQueue;To=!1;var C=b.firstBaseUpdate,I=b.lastBaseUpdate,$=b.shared.pending;if($!==null){b.shared.pending=null;var B=$,re=B.next;B.next=null,I===null?C=re:I.next=re,I=B;var fe=o.alternate;fe!==null&&(fe=fe.updateQueue,$=fe.lastBaseUpdate,$!==I&&($===null?fe.firstBaseUpdate=re:$.next=re,fe.lastBaseUpdate=B))}if(C!==null){var ge=b.baseState;I=0,fe=re=B=null,$=C;do{var de=$.lane,Re=$.eventTime;if((g&de)===de){fe!==null&&(fe=fe.next={eventTime:Re,lane:0,tag:$.tag,payload:$.payload,callback:$.callback,next:null});e:{var Oe=o,De=$;switch(de=l,Re=f,De.tag){case 1:if(Oe=De.payload,typeof Oe=="function"){ge=Oe.call(Re,ge,de);break e}ge=Oe;break e;case 3:Oe.flags=Oe.flags&-65537|128;case 0:if(Oe=De.payload,de=typeof Oe=="function"?Oe.call(Re,ge,de):Oe,de==null)break e;ge=H({},ge,de);break e;case 2:To=!0}}$.callback!==null&&$.lane!==0&&(o.flags|=64,de=b.effects,de===null?b.effects=[$]:de.push($))}else Re={eventTime:Re,lane:de,tag:$.tag,payload:$.payload,callback:$.callback,next:null},fe===null?(re=fe=Re,B=ge):fe=fe.next=Re,I|=de;if($=$.next,$===null){if($=b.shared.pending,$===null)break;de=$,$=de.next,de.next=null,b.lastBaseUpdate=de,b.shared.pending=null}}while(!0);if(fe===null&&(B=ge),b.baseState=B,b.firstBaseUpdate=re,b.lastBaseUpdate=fe,l=b.shared.interleaved,l!==null){b=l;do I|=b.lane,b=b.next;while(b!==l)}else C===null&&(b.shared.lanes=0);Oa|=I,o.lanes=I,o.memoizedState=ge}}function Fb(o,l,f){if(o=l.effects,l.effects=null,o!==null)for(l=0;l<o.length;l++){var g=o[l],b=g.callback;if(b!==null){if(g.callback=null,g=f,typeof b!="function")throw Error(n(191,b));b.call(g)}}}var $c={},Ks=Co($c),Vc=Co($c),Hc=Co($c);function Ia(o){if(o===$c)throw Error(n(174));return o}function Tg(o,l){switch(Rt(Hc,l),Rt(Vc,o),Rt(Ks,$c),o=l.nodeType,o){case 9:case 11:l=(l=l.documentElement)?l.namespaceURI:Bn(null,"");break;default:o=o===8?l.parentNode:l,l=o.namespaceURI||null,o=o.tagName,l=Bn(l,o)}Dt(Ks),Rt(Ks,l)}function tu(){Dt(Ks),Dt(Vc),Dt(Hc)}function $b(o){Ia(Hc.current);var l=Ia(Ks.current),f=Bn(l,o.type);l!==f&&(Rt(Vc,o),Rt(Ks,f))}function Rg(o){Vc.current===o&&(Dt(Ks),Dt(Vc))}var Gt=Co(0);function _h(o){for(var l=o;l!==null;){if(l.tag===13){var f=l.memoizedState;if(f!==null&&(f=f.dehydrated,f===null||f.data==="$?"||f.data==="$!"))return l}else if(l.tag===19&&l.memoizedProps.revealOrder!==void 0){if((l.flags&128)!==0)return l}else if(l.child!==null){l.child.return=l,l=l.child;continue}if(l===o)break;for(;l.sibling===null;){if(l.return===null||l.return===o)return null;l=l.return}l.sibling.return=l.return,l=l.sibling}return null}var Ag=[];function Ig(){for(var o=0;o<Ag.length;o++)Ag[o]._workInProgressVersionPrimary=null;Ag.length=0}var wh=k.ReactCurrentDispatcher,Mg=k.ReactCurrentBatchConfig,Ma=0,Kt=null,xn=null,Cn=null,xh=!1,zc=!1,Uc=0,lO=0;function qn(){throw Error(n(321))}function Og(o,l){if(l===null)return!1;for(var f=0;f<l.length&&f<o.length;f++)if(!Is(o[f],l[f]))return!1;return!0}function Lg(o,l,f,g,b,C){if(Ma=C,Kt=l,l.memoizedState=null,l.updateQueue=null,l.lanes=0,wh.current=o===null||o.memoizedState===null?fO:hO,o=f(g,b),zc){C=0;do{if(zc=!1,Uc=0,25<=C)throw Error(n(301));C+=1,Cn=xn=null,l.updateQueue=null,wh.current=pO,o=f(g,b)}while(zc)}if(wh.current=Eh,l=xn!==null&&xn.next!==null,Ma=0,Cn=xn=Kt=null,xh=!1,l)throw Error(n(300));return o}function Dg(){var o=Uc!==0;return Uc=0,o}function Zs(){var o={memoizedState:null,baseState:null,baseQueue:null,queue:null,next:null};return Cn===null?Kt.memoizedState=Cn=o:Cn=Cn.next=o,Cn}function hs(){if(xn===null){var o=Kt.alternate;o=o!==null?o.memoizedState:null}else o=xn.next;var l=Cn===null?Kt.memoizedState:Cn.next;if(l!==null)Cn=l,xn=o;else{if(o===null)throw Error(n(310));xn=o,o={memoizedState:xn.memoizedState,baseState:xn.baseState,baseQueue:xn.baseQueue,queue:xn.queue,next:null},Cn===null?Kt.memoizedState=Cn=o:Cn=Cn.next=o}return Cn}function Bc(o,l){return typeof l=="function"?l(o):l}function Ng(o){var l=hs(),f=l.queue;if(f===null)throw Error(n(311));f.lastRenderedReducer=o;var g=xn,b=g.baseQueue,C=f.pending;if(C!==null){if(b!==null){var I=b.next;b.next=C.next,C.next=I}g.baseQueue=b=C,f.pending=null}if(b!==null){C=b.next,g=g.baseState;var $=I=null,B=null,re=C;do{var fe=re.lane;if((Ma&fe)===fe)B!==null&&(B=B.next={lane:0,action:re.action,hasEagerState:re.hasEagerState,eagerState:re.eagerState,next:null}),g=re.hasEagerState?re.eagerState:o(g,re.action);else{var ge={lane:fe,action:re.action,hasEagerState:re.hasEagerState,eagerState:re.eagerState,next:null};B===null?($=B=ge,I=g):B=B.next=ge,Kt.lanes|=fe,Oa|=fe}re=re.next}while(re!==null&&re!==C);B===null?I=g:B.next=$,Is(g,l.memoizedState)||(yr=!0),l.memoizedState=g,l.baseState=I,l.baseQueue=B,f.lastRenderedState=g}if(o=f.interleaved,o!==null){b=o;do C=b.lane,Kt.lanes|=C,Oa|=C,b=b.next;while(b!==o)}else b===null&&(f.lanes=0);return[l.memoizedState,f.dispatch]}function jg(o){var l=hs(),f=l.queue;if(f===null)throw Error(n(311));f.lastRenderedReducer=o;var g=f.dispatch,b=f.pending,C=l.memoizedState;if(b!==null){f.pending=null;var I=b=b.next;do C=o(C,I.action),I=I.next;while(I!==b);Is(C,l.memoizedState)||(yr=!0),l.memoizedState=C,l.baseQueue===null&&(l.baseState=C),f.lastRenderedState=C}return[C,g]}function Vb(){}function Hb(o,l){var f=Kt,g=hs(),b=l(),C=!Is(g.memoizedState,b);if(C&&(g.memoizedState=b,yr=!0),g=g.queue,Fg(Bb.bind(null,f,g,o),[o]),g.getSnapshot!==l||C||Cn!==null&&Cn.memoizedState.tag&1){if(f.flags|=2048,Wc(9,Ub.bind(null,f,g,b,l),void 0,null),kn===null)throw Error(n(349));(Ma&30)!==0||zb(f,l,b)}return b}function zb(o,l,f){o.flags|=16384,o={getSnapshot:l,value:f},l=Kt.updateQueue,l===null?(l={lastEffect:null,stores:null},Kt.updateQueue=l,l.stores=[o]):(f=l.stores,f===null?l.stores=[o]:f.push(o))}function Ub(o,l,f,g){l.value=f,l.getSnapshot=g,Wb(l)&&qb(o)}function Bb(o,l,f){return f(function(){Wb(l)&&qb(o)})}function Wb(o){var l=o.getSnapshot;o=o.value;try{var f=l();return!Is(o,f)}catch{return!0}}function qb(o){var l=Ti(o,1);l!==null&&Ns(l,o,1,-1)}function Gb(o){var l=Zs();return typeof o=="function"&&(o=o()),l.memoizedState=l.baseState=o,o={pending:null,interleaved:null,lanes:0,dispatch:null,lastRenderedReducer:Bc,lastRenderedState:o},l.queue=o,o=o.dispatch=dO.bind(null,Kt,o),[l.memoizedState,o]}function Wc(o,l,f,g){return o={tag:o,create:l,destroy:f,deps:g,next:null},l=Kt.updateQueue,l===null?(l={lastEffect:null,stores:null},Kt.updateQueue=l,l.lastEffect=o.next=o):(f=l.lastEffect,f===null?l.lastEffect=o.next=o:(g=f.next,f.next=o,o.next=g,l.lastEffect=o)),o}function Kb(){return hs().memoizedState}function bh(o,l,f,g){var b=Zs();Kt.flags|=o,b.memoizedState=Wc(1|l,f,void 0,g===void 0?null:g)}function Sh(o,l,f,g){var b=hs();g=g===void 0?null:g;var C=void 0;if(xn!==null){var I=xn.memoizedState;if(C=I.destroy,g!==null&&Og(g,I.deps)){b.memoizedState=Wc(l,f,C,g);return}}Kt.flags|=o,b.memoizedState=Wc(1|l,f,C,g)}function Zb(o,l){return bh(8390656,8,o,l)}function Fg(o,l){return Sh(2048,8,o,l)}function Yb(o,l){return Sh(4,2,o,l)}function Xb(o,l){return Sh(4,4,o,l)}function Qb(o,l){if(typeof l=="function")return o=o(),l(o),function(){l(null)};if(l!=null)return o=o(),l.current=o,function(){l.current=null}}function Jb(o,l,f){return f=f!=null?f.concat([o]):null,Sh(4,4,Qb.bind(null,l,o),f)}function $g(){}function eS(o,l){var f=hs();l=l===void 0?null:l;var g=f.memoizedState;return g!==null&&l!==null&&Og(l,g[1])?g[0]:(f.memoizedState=[o,l],o)}function tS(o,l){var f=hs();l=l===void 0?null:l;var g=f.memoizedState;return g!==null&&l!==null&&Og(l,g[1])?g[0]:(o=o(),f.memoizedState=[o,l],o)}function nS(o,l,f){return(Ma&21)===0?(o.baseState&&(o.baseState=!1,yr=!0),o.memoizedState=f):(Is(f,l)||(f=Rs(),Kt.lanes|=f,Oa|=f,o.baseState=!0),l)}function uO(o,l){var f=rt;rt=f!==0&&4>f?f:4,o(!0);var g=Mg.transition;Mg.transition={};try{o(!1),l()}finally{rt=f,Mg.transition=g}}function rS(){return hs().memoizedState}function cO(o,l,f){var g=Oo(o);if(f={lane:g,action:f,hasEagerState:!1,eagerState:null,next:null},sS(o))iS(l,f);else if(f=Db(o,l,f,g),f!==null){var b=rr();Ns(f,o,g,b),oS(f,l,g)}}function dO(o,l,f){var g=Oo(o),b={lane:g,action:f,hasEagerState:!1,eagerState:null,next:null};if(sS(o))iS(l,b);else{var C=o.alternate;if(o.lanes===0&&(C===null||C.lanes===0)&&(C=l.lastRenderedReducer,C!==null))try{var I=l.lastRenderedState,$=C(I,f);if(b.hasEagerState=!0,b.eagerState=$,Is($,I)){var B=l.interleaved;B===null?(b.next=b,kg(l)):(b.next=B.next,B.next=b),l.interleaved=b;return}}catch{}finally{}f=Db(o,l,b,g),f!==null&&(b=rr(),Ns(f,o,g,b),oS(f,l,g))}}function sS(o){var l=o.alternate;return o===Kt||l!==null&&l===Kt}function iS(o,l){zc=xh=!0;var f=o.pending;f===null?l.next=l:(l.next=f.next,f.next=l),o.pending=l}function oS(o,l,f){if((f&4194240)!==0){var g=l.lanes;g&=o.pendingLanes,f|=g,l.lanes=f,Si(o,f)}}var Eh={readContext:fs,useCallback:qn,useContext:qn,useEffect:qn,useImperativeHandle:qn,useInsertionEffect:qn,useLayoutEffect:qn,useMemo:qn,useReducer:qn,useRef:qn,useState:qn,useDebugValue:qn,useDeferredValue:qn,useTransition:qn,useMutableSource:qn,useSyncExternalStore:qn,useId:qn,unstable_isNewReconciler:!1},fO={readContext:fs,useCallback:function(o,l){return Zs().memoizedState=[o,l===void 0?null:l],o},useContext:fs,useEffect:Zb,useImperativeHandle:function(o,l,f){return f=f!=null?f.concat([o]):null,bh(4194308,4,Qb.bind(null,l,o),f)},useLayoutEffect:function(o,l){return bh(4194308,4,o,l)},useInsertionEffect:function(o,l){return bh(4,2,o,l)},useMemo:function(o,l){var f=Zs();return l=l===void 0?null:l,o=o(),f.memoizedState=[o,l],o},useReducer:function(o,l,f){var g=Zs();return l=f!==void 0?f(l):l,g.memoizedState=g.baseState=l,o={pending:null,interleaved:null,lanes:0,dispatch:null,lastRenderedReducer:o,lastRenderedState:l},g.queue=o,o=o.dispatch=cO.bind(null,Kt,o),[g.memoizedState,o]},useRef:function(o){var l=Zs();return o={current:o},l.memoizedState=o},useState:Gb,useDebugValue:$g,useDeferredValue:function(o){return Zs().memoizedState=o},useTransition:function(){var o=Gb(!1),l=o[0];return o=uO.bind(null,o[1]),Zs().memoizedState=o,[l,o]},useMutableSource:function(){},useSyncExternalStore:function(o,l,f){var g=Kt,b=Zs();if(Ht){if(f===void 0)throw Error(n(407));f=f()}else{if(f=l(),kn===null)throw Error(n(349));(Ma&30)!==0||zb(g,l,f)}b.memoizedState=f;var C={value:f,getSnapshot:l};return b.queue=C,Zb(Bb.bind(null,g,C,o),[o]),g.flags|=2048,Wc(9,Ub.bind(null,g,C,f,l),void 0,null),f},useId:function(){var o=Zs(),l=kn.identifierPrefix;if(Ht){var f=Pi,g=ki;f=(g&~(1<<32-pr(g)-1)).toString(32)+f,l=":"+l+"R"+f,f=Uc++,0<f&&(l+="H"+f.toString(32)),l+=":"}else f=lO++,l=":"+l+"r"+f.toString(32)+":";return o.memoizedState=l},unstable_isNewReconciler:!1},hO={readContext:fs,useCallback:eS,useContext:fs,useEffect:Fg,useImperativeHandle:Jb,useInsertionEffect:Yb,useLayoutEffect:Xb,useMemo:tS,useReducer:Ng,useRef:Kb,useState:function(){return Ng(Bc)},useDebugValue:$g,useDeferredValue:function(o){var l=hs();return nS(l,xn.memoizedState,o)},useTransition:function(){var o=Ng(Bc)[0],l=hs().memoizedState;return[o,l]},useMutableSource:Vb,useSyncExternalStore:Hb,useId:rS,unstable_isNewReconciler:!1},pO={readContext:fs,useCallback:eS,useContext:fs,useEffect:Fg,useImperativeHandle:Jb,useInsertionEffect:Yb,useLayoutEffect:Xb,useMemo:tS,useReducer:jg,useRef:Kb,useState:function(){return jg(Bc)},useDebugValue:$g,useDeferredValue:function(o){var l=hs();return xn===null?l.memoizedState=o:nS(l,xn.memoizedState,o)},useTransition:function(){var o=jg(Bc)[0],l=hs().memoizedState;return[o,l]},useMutableSource:Vb,useSyncExternalStore:Hb,useId:rS,unstable_isNewReconciler:!1};function Os(o,l){if(o&&o.defaultProps){l=H({},l),o=o.defaultProps;for(var f in o)l[f]===void 0&&(l[f]=o[f]);return l}return l}function Vg(o,l,f,g){l=o.memoizedState,f=f(g,l),f=f==null?l:H({},l,f),o.memoizedState=f,o.lanes===0&&(o.updateQueue.baseState=f)}var Ch={isMounted:function(o){return(o=o._reactInternals)?Ts(o)===o:!1},enqueueSetState:function(o,l,f){o=o._reactInternals;var g=rr(),b=Oo(o),C=Ri(g,b);C.payload=l,f!=null&&(C.callback=f),l=Ro(o,C,b),l!==null&&(Ns(l,o,b,g),vh(l,o,b))},enqueueReplaceState:function(o,l,f){o=o._reactInternals;var g=rr(),b=Oo(o),C=Ri(g,b);C.tag=1,C.payload=l,f!=null&&(C.callback=f),l=Ro(o,C,b),l!==null&&(Ns(l,o,b,g),vh(l,o,b))},enqueueForceUpdate:function(o,l){o=o._reactInternals;var f=rr(),g=Oo(o),b=Ri(f,g);b.tag=2,l!=null&&(b.callback=l),l=Ro(o,b,g),l!==null&&(Ns(l,o,g,f),vh(l,o,g))}};function aS(o,l,f,g,b,C,I){return o=o.stateNode,typeof o.shouldComponentUpdate=="function"?o.shouldComponentUpdate(g,C,I):l.prototype&&l.prototype.isPureReactComponent?!Ic(f,g)||!Ic(b,C):!0}function lS(o,l,f){var g=!1,b=ko,C=l.contextType;return typeof C=="object"&&C!==null?C=fs(C):(b=vr(l)?Pa:Wn.current,g=l.contextTypes,C=(g=g!=null)?Kl(o,b):ko),l=new l(f,C),o.memoizedState=l.state!==null&&l.state!==void 0?l.state:null,l.updater=Ch,o.stateNode=l,l._reactInternals=o,g&&(o=o.stateNode,o.__reactInternalMemoizedUnmaskedChildContext=b,o.__reactInternalMemoizedMaskedChildContext=C),l}function uS(o,l,f,g){o=l.state,typeof l.componentWillReceiveProps=="function"&&l.componentWillReceiveProps(f,g),typeof l.UNSAFE_componentWillReceiveProps=="function"&&l.UNSAFE_componentWillReceiveProps(f,g),l.state!==o&&Ch.enqueueReplaceState(l,l.state,null)}function Hg(o,l,f,g){var b=o.stateNode;b.props=f,b.state=o.memoizedState,b.refs={},Pg(o);var C=l.contextType;typeof C=="object"&&C!==null?b.context=fs(C):(C=vr(l)?Pa:Wn.current,b.context=Kl(o,C)),b.state=o.memoizedState,C=l.getDerivedStateFromProps,typeof C=="function"&&(Vg(o,l,C,f),b.state=o.memoizedState),typeof l.getDerivedStateFromProps=="function"||typeof b.getSnapshotBeforeUpdate=="function"||typeof b.UNSAFE_componentWillMount!="function"&&typeof b.componentWillMount!="function"||(l=b.state,typeof b.componentWillMount=="function"&&b.componentWillMount(),typeof b.UNSAFE_componentWillMount=="function"&&b.UNSAFE_componentWillMount(),l!==b.state&&Ch.enqueueReplaceState(b,b.state,null),yh(o,f,b,g),b.state=o.memoizedState),typeof b.componentDidMount=="function"&&(o.flags|=4194308)}function nu(o,l){try{var f="",g=l;do f+=ee(g),g=g.return;while(g);var b=f}catch(C){b=`
41
- Error generating stack: `+C.message+`
42
- `+C.stack}return{value:o,source:l,stack:b,digest:null}}function zg(o,l,f){return{value:o,source:null,stack:f??null,digest:l??null}}function Ug(o,l){try{console.error(l.value)}catch(f){setTimeout(function(){throw f})}}var mO=typeof WeakMap=="function"?WeakMap:Map;function cS(o,l,f){f=Ri(-1,f),f.tag=3,f.payload={element:null};var g=l.value;return f.callback=function(){Mh||(Mh=!0,sv=g),Ug(o,l)},f}function dS(o,l,f){f=Ri(-1,f),f.tag=3;var g=o.type.getDerivedStateFromError;if(typeof g=="function"){var b=l.value;f.payload=function(){return g(b)},f.callback=function(){Ug(o,l)}}var C=o.stateNode;return C!==null&&typeof C.componentDidCatch=="function"&&(f.callback=function(){Ug(o,l),typeof g!="function"&&(Io===null?Io=new Set([this]):Io.add(this));var I=l.stack;this.componentDidCatch(l.value,{componentStack:I!==null?I:""})}),f}function fS(o,l,f){var g=o.pingCache;if(g===null){g=o.pingCache=new mO;var b=new Set;g.set(l,b)}else b=g.get(l),b===void 0&&(b=new Set,g.set(l,b));b.has(f)||(b.add(f),o=RO.bind(null,o,l,f),l.then(o,o))}function hS(o){do{var l;if((l=o.tag===13)&&(l=o.memoizedState,l=l!==null?l.dehydrated!==null:!0),l)return o;o=o.return}while(o!==null);return null}function pS(o,l,f,g,b){return(o.mode&1)===0?(o===l?o.flags|=65536:(o.flags|=128,f.flags|=131072,f.flags&=-52805,f.tag===1&&(f.alternate===null?f.tag=17:(l=Ri(-1,1),l.tag=2,Ro(f,l,1))),f.lanes|=1),o):(o.flags|=65536,o.lanes=b,o)}var gO=k.ReactCurrentOwner,yr=!1;function nr(o,l,f,g){l.child=o===null?Lb(l,null,f,g):Ql(l,o.child,f,g)}function mS(o,l,f,g,b){f=f.render;var C=l.ref;return eu(l,b),g=Lg(o,l,f,g,C,b),f=Dg(),o!==null&&!yr?(l.updateQueue=o.updateQueue,l.flags&=-2053,o.lanes&=~b,Ai(o,l,b)):(Ht&&f&&vg(l),l.flags|=1,nr(o,l,g,b),l.child)}function gS(o,l,f,g,b){if(o===null){var C=f.type;return typeof C=="function"&&!dv(C)&&C.defaultProps===void 0&&f.compare===null&&f.defaultProps===void 0?(l.tag=15,l.type=C,vS(o,l,C,g,b)):(o=Fh(f.type,null,g,l,l.mode,b),o.ref=l.ref,o.return=l,l.child=o)}if(C=o.child,(o.lanes&b)===0){var I=C.memoizedProps;if(f=f.compare,f=f!==null?f:Ic,f(I,g)&&o.ref===l.ref)return Ai(o,l,b)}return l.flags|=1,o=Do(C,g),o.ref=l.ref,o.return=l,l.child=o}function vS(o,l,f,g,b){if(o!==null){var C=o.memoizedProps;if(Ic(C,g)&&o.ref===l.ref)if(yr=!1,l.pendingProps=g=C,(o.lanes&b)!==0)(o.flags&131072)!==0&&(yr=!0);else return l.lanes=o.lanes,Ai(o,l,b)}return Bg(o,l,f,g,b)}function yS(o,l,f){var g=l.pendingProps,b=g.children,C=o!==null?o.memoizedState:null;if(g.mode==="hidden")if((l.mode&1)===0)l.memoizedState={baseLanes:0,cachePool:null,transitions:null},Rt(su,Hr),Hr|=f;else{if((f&1073741824)===0)return o=C!==null?C.baseLanes|f:f,l.lanes=l.childLanes=1073741824,l.memoizedState={baseLanes:o,cachePool:null,transitions:null},l.updateQueue=null,Rt(su,Hr),Hr|=o,null;l.memoizedState={baseLanes:0,cachePool:null,transitions:null},g=C!==null?C.baseLanes:f,Rt(su,Hr),Hr|=g}else C!==null?(g=C.baseLanes|f,l.memoizedState=null):g=f,Rt(su,Hr),Hr|=g;return nr(o,l,b,f),l.child}function _S(o,l){var f=l.ref;(o===null&&f!==null||o!==null&&o.ref!==f)&&(l.flags|=512,l.flags|=2097152)}function Bg(o,l,f,g,b){var C=vr(f)?Pa:Wn.current;return C=Kl(l,C),eu(l,b),f=Lg(o,l,f,g,C,b),g=Dg(),o!==null&&!yr?(l.updateQueue=o.updateQueue,l.flags&=-2053,o.lanes&=~b,Ai(o,l,b)):(Ht&&g&&vg(l),l.flags|=1,nr(o,l,f,b),l.child)}function wS(o,l,f,g,b){if(vr(f)){var C=!0;uh(l)}else C=!1;if(eu(l,b),l.stateNode===null)Ph(o,l),lS(l,f,g),Hg(l,f,g,b),g=!0;else if(o===null){var I=l.stateNode,$=l.memoizedProps;I.props=$;var B=I.context,re=f.contextType;typeof re=="object"&&re!==null?re=fs(re):(re=vr(f)?Pa:Wn.current,re=Kl(l,re));var fe=f.getDerivedStateFromProps,ge=typeof fe=="function"||typeof I.getSnapshotBeforeUpdate=="function";ge||typeof I.UNSAFE_componentWillReceiveProps!="function"&&typeof I.componentWillReceiveProps!="function"||($!==g||B!==re)&&uS(l,I,g,re),To=!1;var de=l.memoizedState;I.state=de,yh(l,g,I,b),B=l.memoizedState,$!==g||de!==B||gr.current||To?(typeof fe=="function"&&(Vg(l,f,fe,g),B=l.memoizedState),($=To||aS(l,f,$,g,de,B,re))?(ge||typeof I.UNSAFE_componentWillMount!="function"&&typeof I.componentWillMount!="function"||(typeof I.componentWillMount=="function"&&I.componentWillMount(),typeof I.UNSAFE_componentWillMount=="function"&&I.UNSAFE_componentWillMount()),typeof I.componentDidMount=="function"&&(l.flags|=4194308)):(typeof I.componentDidMount=="function"&&(l.flags|=4194308),l.memoizedProps=g,l.memoizedState=B),I.props=g,I.state=B,I.context=re,g=$):(typeof I.componentDidMount=="function"&&(l.flags|=4194308),g=!1)}else{I=l.stateNode,Nb(o,l),$=l.memoizedProps,re=l.type===l.elementType?$:Os(l.type,$),I.props=re,ge=l.pendingProps,de=I.context,B=f.contextType,typeof B=="object"&&B!==null?B=fs(B):(B=vr(f)?Pa:Wn.current,B=Kl(l,B));var Re=f.getDerivedStateFromProps;(fe=typeof Re=="function"||typeof I.getSnapshotBeforeUpdate=="function")||typeof I.UNSAFE_componentWillReceiveProps!="function"&&typeof I.componentWillReceiveProps!="function"||($!==ge||de!==B)&&uS(l,I,g,B),To=!1,de=l.memoizedState,I.state=de,yh(l,g,I,b);var Oe=l.memoizedState;$!==ge||de!==Oe||gr.current||To?(typeof Re=="function"&&(Vg(l,f,Re,g),Oe=l.memoizedState),(re=To||aS(l,f,re,g,de,Oe,B)||!1)?(fe||typeof I.UNSAFE_componentWillUpdate!="function"&&typeof I.componentWillUpdate!="function"||(typeof I.componentWillUpdate=="function"&&I.componentWillUpdate(g,Oe,B),typeof I.UNSAFE_componentWillUpdate=="function"&&I.UNSAFE_componentWillUpdate(g,Oe,B)),typeof I.componentDidUpdate=="function"&&(l.flags|=4),typeof I.getSnapshotBeforeUpdate=="function"&&(l.flags|=1024)):(typeof I.componentDidUpdate!="function"||$===o.memoizedProps&&de===o.memoizedState||(l.flags|=4),typeof I.getSnapshotBeforeUpdate!="function"||$===o.memoizedProps&&de===o.memoizedState||(l.flags|=1024),l.memoizedProps=g,l.memoizedState=Oe),I.props=g,I.state=Oe,I.context=B,g=re):(typeof I.componentDidUpdate!="function"||$===o.memoizedProps&&de===o.memoizedState||(l.flags|=4),typeof I.getSnapshotBeforeUpdate!="function"||$===o.memoizedProps&&de===o.memoizedState||(l.flags|=1024),g=!1)}return Wg(o,l,f,g,C,b)}function Wg(o,l,f,g,b,C){_S(o,l);var I=(l.flags&128)!==0;if(!g&&!I)return b&&Cb(l,f,!1),Ai(o,l,C);g=l.stateNode,gO.current=l;var $=I&&typeof f.getDerivedStateFromError!="function"?null:g.render();return l.flags|=1,o!==null&&I?(l.child=Ql(l,o.child,null,C),l.child=Ql(l,null,$,C)):nr(o,l,$,C),l.memoizedState=g.state,b&&Cb(l,f,!0),l.child}function xS(o){var l=o.stateNode;l.pendingContext?Sb(o,l.pendingContext,l.pendingContext!==l.context):l.context&&Sb(o,l.context,!1),Tg(o,l.containerInfo)}function bS(o,l,f,g,b){return Xl(),xg(b),l.flags|=256,nr(o,l,f,g),l.child}var qg={dehydrated:null,treeContext:null,retryLane:0};function Gg(o){return{baseLanes:o,cachePool:null,transitions:null}}function SS(o,l,f){var g=l.pendingProps,b=Gt.current,C=!1,I=(l.flags&128)!==0,$;if(($=I)||($=o!==null&&o.memoizedState===null?!1:(b&2)!==0),$?(C=!0,l.flags&=-129):(o===null||o.memoizedState!==null)&&(b|=1),Rt(Gt,b&1),o===null)return wg(l),o=l.memoizedState,o!==null&&(o=o.dehydrated,o!==null)?((l.mode&1)===0?l.lanes=1:o.data==="$!"?l.lanes=8:l.lanes=1073741824,null):(I=g.children,o=g.fallback,C?(g=l.mode,C=l.child,I={mode:"hidden",children:I},(g&1)===0&&C!==null?(C.childLanes=0,C.pendingProps=I):C=$h(I,g,0,null),o=ja(o,g,f,null),C.return=l,o.return=l,C.sibling=o,l.child=C,l.child.memoizedState=Gg(f),l.memoizedState=qg,o):Kg(l,I));if(b=o.memoizedState,b!==null&&($=b.dehydrated,$!==null))return vO(o,l,I,g,$,b,f);if(C){C=g.fallback,I=l.mode,b=o.child,$=b.sibling;var B={mode:"hidden",children:g.children};return(I&1)===0&&l.child!==b?(g=l.child,g.childLanes=0,g.pendingProps=B,l.deletions=null):(g=Do(b,B),g.subtreeFlags=b.subtreeFlags&14680064),$!==null?C=Do($,C):(C=ja(C,I,f,null),C.flags|=2),C.return=l,g.return=l,g.sibling=C,l.child=g,g=C,C=l.child,I=o.child.memoizedState,I=I===null?Gg(f):{baseLanes:I.baseLanes|f,cachePool:null,transitions:I.transitions},C.memoizedState=I,C.childLanes=o.childLanes&~f,l.memoizedState=qg,g}return C=o.child,o=C.sibling,g=Do(C,{mode:"visible",children:g.children}),(l.mode&1)===0&&(g.lanes=f),g.return=l,g.sibling=null,o!==null&&(f=l.deletions,f===null?(l.deletions=[o],l.flags|=16):f.push(o)),l.child=g,l.memoizedState=null,g}function Kg(o,l){return l=$h({mode:"visible",children:l},o.mode,0,null),l.return=o,o.child=l}function kh(o,l,f,g){return g!==null&&xg(g),Ql(l,o.child,null,f),o=Kg(l,l.pendingProps.children),o.flags|=2,l.memoizedState=null,o}function vO(o,l,f,g,b,C,I){if(f)return l.flags&256?(l.flags&=-257,g=zg(Error(n(422))),kh(o,l,I,g)):l.memoizedState!==null?(l.child=o.child,l.flags|=128,null):(C=g.fallback,b=l.mode,g=$h({mode:"visible",children:g.children},b,0,null),C=ja(C,b,I,null),C.flags|=2,g.return=l,C.return=l,g.sibling=C,l.child=g,(l.mode&1)!==0&&Ql(l,o.child,null,I),l.child.memoizedState=Gg(I),l.memoizedState=qg,C);if((l.mode&1)===0)return kh(o,l,I,null);if(b.data==="$!"){if(g=b.nextSibling&&b.nextSibling.dataset,g)var $=g.dgst;return g=$,C=Error(n(419)),g=zg(C,g,void 0),kh(o,l,I,g)}if($=(I&o.childLanes)!==0,yr||$){if(g=kn,g!==null){switch(I&-I){case 4:b=2;break;case 16:b=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:b=32;break;case 536870912:b=268435456;break;default:b=0}b=(b&(g.suspendedLanes|I))!==0?0:b,b!==0&&b!==C.retryLane&&(C.retryLane=b,Ti(o,b),Ns(g,o,b,-1))}return cv(),g=zg(Error(n(421))),kh(o,l,I,g)}return b.data==="$?"?(l.flags|=128,l.child=o.child,l=AO.bind(null,o),b._reactRetry=l,null):(o=C.treeContext,Vr=Eo(b.nextSibling),$r=l,Ht=!0,Ms=null,o!==null&&(cs[ds++]=ki,cs[ds++]=Pi,cs[ds++]=Ta,ki=o.id,Pi=o.overflow,Ta=l),l=Kg(l,g.children),l.flags|=4096,l)}function ES(o,l,f){o.lanes|=l;var g=o.alternate;g!==null&&(g.lanes|=l),Cg(o.return,l,f)}function Zg(o,l,f,g,b){var C=o.memoizedState;C===null?o.memoizedState={isBackwards:l,rendering:null,renderingStartTime:0,last:g,tail:f,tailMode:b}:(C.isBackwards=l,C.rendering=null,C.renderingStartTime=0,C.last=g,C.tail=f,C.tailMode=b)}function CS(o,l,f){var g=l.pendingProps,b=g.revealOrder,C=g.tail;if(nr(o,l,g.children,f),g=Gt.current,(g&2)!==0)g=g&1|2,l.flags|=128;else{if(o!==null&&(o.flags&128)!==0)e:for(o=l.child;o!==null;){if(o.tag===13)o.memoizedState!==null&&ES(o,f,l);else if(o.tag===19)ES(o,f,l);else if(o.child!==null){o.child.return=o,o=o.child;continue}if(o===l)break e;for(;o.sibling===null;){if(o.return===null||o.return===l)break e;o=o.return}o.sibling.return=o.return,o=o.sibling}g&=1}if(Rt(Gt,g),(l.mode&1)===0)l.memoizedState=null;else switch(b){case"forwards":for(f=l.child,b=null;f!==null;)o=f.alternate,o!==null&&_h(o)===null&&(b=f),f=f.sibling;f=b,f===null?(b=l.child,l.child=null):(b=f.sibling,f.sibling=null),Zg(l,!1,b,f,C);break;case"backwards":for(f=null,b=l.child,l.child=null;b!==null;){if(o=b.alternate,o!==null&&_h(o)===null){l.child=b;break}o=b.sibling,b.sibling=f,f=b,b=o}Zg(l,!0,f,null,C);break;case"together":Zg(l,!1,null,null,void 0);break;default:l.memoizedState=null}return l.child}function Ph(o,l){(l.mode&1)===0&&o!==null&&(o.alternate=null,l.alternate=null,l.flags|=2)}function Ai(o,l,f){if(o!==null&&(l.dependencies=o.dependencies),Oa|=l.lanes,(f&l.childLanes)===0)return null;if(o!==null&&l.child!==o.child)throw Error(n(153));if(l.child!==null){for(o=l.child,f=Do(o,o.pendingProps),l.child=f,f.return=l;o.sibling!==null;)o=o.sibling,f=f.sibling=Do(o,o.pendingProps),f.return=l;f.sibling=null}return l.child}function yO(o,l,f){switch(l.tag){case 3:xS(l),Xl();break;case 5:$b(l);break;case 1:vr(l.type)&&uh(l);break;case 4:Tg(l,l.stateNode.containerInfo);break;case 10:var g=l.type._context,b=l.memoizedProps.value;Rt(mh,g._currentValue),g._currentValue=b;break;case 13:if(g=l.memoizedState,g!==null)return g.dehydrated!==null?(Rt(Gt,Gt.current&1),l.flags|=128,null):(f&l.child.childLanes)!==0?SS(o,l,f):(Rt(Gt,Gt.current&1),o=Ai(o,l,f),o!==null?o.sibling:null);Rt(Gt,Gt.current&1);break;case 19:if(g=(f&l.childLanes)!==0,(o.flags&128)!==0){if(g)return CS(o,l,f);l.flags|=128}if(b=l.memoizedState,b!==null&&(b.rendering=null,b.tail=null,b.lastEffect=null),Rt(Gt,Gt.current),g)break;return null;case 22:case 23:return l.lanes=0,yS(o,l,f)}return Ai(o,l,f)}var kS,Yg,PS,TS;kS=function(o,l){for(var f=l.child;f!==null;){if(f.tag===5||f.tag===6)o.appendChild(f.stateNode);else if(f.tag!==4&&f.child!==null){f.child.return=f,f=f.child;continue}if(f===l)break;for(;f.sibling===null;){if(f.return===null||f.return===l)return;f=f.return}f.sibling.return=f.return,f=f.sibling}},Yg=function(){},PS=function(o,l,f,g){var b=o.memoizedProps;if(b!==g){o=l.stateNode,Ia(Ks.current);var C=null;switch(f){case"input":b=dt(o,b),g=dt(o,g),C=[];break;case"select":b=H({},b,{value:void 0}),g=H({},g,{value:void 0}),C=[];break;case"textarea":b=Ye(o,b),g=Ye(o,g),C=[];break;default:typeof b.onClick!="function"&&typeof g.onClick=="function"&&(o.onclick=oh)}ks(f,g);var I;f=null;for(re in b)if(!g.hasOwnProperty(re)&&b.hasOwnProperty(re)&&b[re]!=null)if(re==="style"){var $=b[re];for(I in $)$.hasOwnProperty(I)&&(f||(f={}),f[I]="")}else re!=="dangerouslySetInnerHTML"&&re!=="children"&&re!=="suppressContentEditableWarning"&&re!=="suppressHydrationWarning"&&re!=="autoFocus"&&(s.hasOwnProperty(re)?C||(C=[]):(C=C||[]).push(re,null));for(re in g){var B=g[re];if($=b!=null?b[re]:void 0,g.hasOwnProperty(re)&&B!==$&&(B!=null||$!=null))if(re==="style")if($){for(I in $)!$.hasOwnProperty(I)||B&&B.hasOwnProperty(I)||(f||(f={}),f[I]="");for(I in B)B.hasOwnProperty(I)&&$[I]!==B[I]&&(f||(f={}),f[I]=B[I])}else f||(C||(C=[]),C.push(re,f)),f=B;else re==="dangerouslySetInnerHTML"?(B=B?B.__html:void 0,$=$?$.__html:void 0,B!=null&&$!==B&&(C=C||[]).push(re,B)):re==="children"?typeof B!="string"&&typeof B!="number"||(C=C||[]).push(re,""+B):re!=="suppressContentEditableWarning"&&re!=="suppressHydrationWarning"&&(s.hasOwnProperty(re)?(B!=null&&re==="onScroll"&&Lt("scroll",o),C||$===B||(C=[])):(C=C||[]).push(re,B))}f&&(C=C||[]).push("style",f);var re=C;(l.updateQueue=re)&&(l.flags|=4)}},TS=function(o,l,f,g){f!==g&&(l.flags|=4)};function qc(o,l){if(!Ht)switch(o.tailMode){case"hidden":l=o.tail;for(var f=null;l!==null;)l.alternate!==null&&(f=l),l=l.sibling;f===null?o.tail=null:f.sibling=null;break;case"collapsed":f=o.tail;for(var g=null;f!==null;)f.alternate!==null&&(g=f),f=f.sibling;g===null?l||o.tail===null?o.tail=null:o.tail.sibling=null:g.sibling=null}}function Gn(o){var l=o.alternate!==null&&o.alternate.child===o.child,f=0,g=0;if(l)for(var b=o.child;b!==null;)f|=b.lanes|b.childLanes,g|=b.subtreeFlags&14680064,g|=b.flags&14680064,b.return=o,b=b.sibling;else for(b=o.child;b!==null;)f|=b.lanes|b.childLanes,g|=b.subtreeFlags,g|=b.flags,b.return=o,b=b.sibling;return o.subtreeFlags|=g,o.childLanes=f,l}function _O(o,l,f){var g=l.pendingProps;switch(yg(l),l.tag){case 2:case 16:case 15:case 0:case 11:case 7:case 8:case 12:case 9:case 14:return Gn(l),null;case 1:return vr(l.type)&&lh(),Gn(l),null;case 3:return g=l.stateNode,tu(),Dt(gr),Dt(Wn),Ig(),g.pendingContext&&(g.context=g.pendingContext,g.pendingContext=null),(o===null||o.child===null)&&(hh(l)?l.flags|=4:o===null||o.memoizedState.isDehydrated&&(l.flags&256)===0||(l.flags|=1024,Ms!==null&&(av(Ms),Ms=null))),Yg(o,l),Gn(l),null;case 5:Rg(l);var b=Ia(Hc.current);if(f=l.type,o!==null&&l.stateNode!=null)PS(o,l,f,g,b),o.ref!==l.ref&&(l.flags|=512,l.flags|=2097152);else{if(!g){if(l.stateNode===null)throw Error(n(166));return Gn(l),null}if(o=Ia(Ks.current),hh(l)){g=l.stateNode,f=l.type;var C=l.memoizedProps;switch(g[Gs]=l,g[Nc]=C,o=(l.mode&1)!==0,f){case"dialog":Lt("cancel",g),Lt("close",g);break;case"iframe":case"object":case"embed":Lt("load",g);break;case"video":case"audio":for(b=0;b<Oc.length;b++)Lt(Oc[b],g);break;case"source":Lt("error",g);break;case"img":case"image":case"link":Lt("error",g),Lt("load",g);break;case"details":Lt("toggle",g);break;case"input":Qt(g,C),Lt("invalid",g);break;case"select":g._wrapperState={wasMultiple:!!C.multiple},Lt("invalid",g);break;case"textarea":on(g,C),Lt("invalid",g)}ks(f,C),b=null;for(var I in C)if(C.hasOwnProperty(I)){var $=C[I];I==="children"?typeof $=="string"?g.textContent!==$&&(C.suppressHydrationWarning!==!0&&ih(g.textContent,$,o),b=["children",$]):typeof $=="number"&&g.textContent!==""+$&&(C.suppressHydrationWarning!==!0&&ih(g.textContent,$,o),b=["children",""+$]):s.hasOwnProperty(I)&&$!=null&&I==="onScroll"&&Lt("scroll",g)}switch(f){case"input":Be(g),qe(g,C,!0);break;case"textarea":Be(g),On(g);break;case"select":case"option":break;default:typeof C.onClick=="function"&&(g.onclick=oh)}g=b,l.updateQueue=g,g!==null&&(l.flags|=4)}else{I=b.nodeType===9?b:b.ownerDocument,o==="http://www.w3.org/1999/xhtml"&&(o=po(f)),o==="http://www.w3.org/1999/xhtml"?f==="script"?(o=I.createElement("div"),o.innerHTML="<script><\/script>",o=o.removeChild(o.firstChild)):typeof g.is=="string"?o=I.createElement(f,{is:g.is}):(o=I.createElement(f),f==="select"&&(I=o,g.multiple?I.multiple=!0:g.size&&(I.size=g.size))):o=I.createElementNS(o,f),o[Gs]=l,o[Nc]=g,kS(o,l,!1,!1),l.stateNode=o;e:{switch(I=Ps(f,g),f){case"dialog":Lt("cancel",o),Lt("close",o),b=g;break;case"iframe":case"object":case"embed":Lt("load",o),b=g;break;case"video":case"audio":for(b=0;b<Oc.length;b++)Lt(Oc[b],o);b=g;break;case"source":Lt("error",o),b=g;break;case"img":case"image":case"link":Lt("error",o),Lt("load",o),b=g;break;case"details":Lt("toggle",o),b=g;break;case"input":Qt(o,g),b=dt(o,g),Lt("invalid",o);break;case"option":b=g;break;case"select":o._wrapperState={wasMultiple:!!g.multiple},b=H({},g,{value:void 0}),Lt("invalid",o);break;case"textarea":on(o,g),b=Ye(o,g),Lt("invalid",o);break;default:b=g}ks(f,b),$=b;for(C in $)if($.hasOwnProperty(C)){var B=$[C];C==="style"?mo(o,B):C==="dangerouslySetInnerHTML"?(B=B?B.__html:void 0,B!=null&&fr(o,B)):C==="children"?typeof B=="string"?(f!=="textarea"||B!=="")&&er(o,B):typeof B=="number"&&er(o,""+B):C!=="suppressContentEditableWarning"&&C!=="suppressHydrationWarning"&&C!=="autoFocus"&&(s.hasOwnProperty(C)?B!=null&&C==="onScroll"&&Lt("scroll",o):B!=null&&T(o,C,B,I))}switch(f){case"input":Be(o),qe(o,g,!1);break;case"textarea":Be(o),On(o);break;case"option":g.value!=null&&o.setAttribute("value",""+le(g.value));break;case"select":o.multiple=!!g.multiple,C=g.value,C!=null?nt(o,!!g.multiple,C,!1):g.defaultValue!=null&&nt(o,!!g.multiple,g.defaultValue,!0);break;default:typeof b.onClick=="function"&&(o.onclick=oh)}switch(f){case"button":case"input":case"select":case"textarea":g=!!g.autoFocus;break e;case"img":g=!0;break e;default:g=!1}}g&&(l.flags|=4)}l.ref!==null&&(l.flags|=512,l.flags|=2097152)}return Gn(l),null;case 6:if(o&&l.stateNode!=null)TS(o,l,o.memoizedProps,g);else{if(typeof g!="string"&&l.stateNode===null)throw Error(n(166));if(f=Ia(Hc.current),Ia(Ks.current),hh(l)){if(g=l.stateNode,f=l.memoizedProps,g[Gs]=l,(C=g.nodeValue!==f)&&(o=$r,o!==null))switch(o.tag){case 3:ih(g.nodeValue,f,(o.mode&1)!==0);break;case 5:o.memoizedProps.suppressHydrationWarning!==!0&&ih(g.nodeValue,f,(o.mode&1)!==0)}C&&(l.flags|=4)}else g=(f.nodeType===9?f:f.ownerDocument).createTextNode(g),g[Gs]=l,l.stateNode=g}return Gn(l),null;case 13:if(Dt(Gt),g=l.memoizedState,o===null||o.memoizedState!==null&&o.memoizedState.dehydrated!==null){if(Ht&&Vr!==null&&(l.mode&1)!==0&&(l.flags&128)===0)Ib(),Xl(),l.flags|=98560,C=!1;else if(C=hh(l),g!==null&&g.dehydrated!==null){if(o===null){if(!C)throw Error(n(318));if(C=l.memoizedState,C=C!==null?C.dehydrated:null,!C)throw Error(n(317));C[Gs]=l}else Xl(),(l.flags&128)===0&&(l.memoizedState=null),l.flags|=4;Gn(l),C=!1}else Ms!==null&&(av(Ms),Ms=null),C=!0;if(!C)return l.flags&65536?l:null}return(l.flags&128)!==0?(l.lanes=f,l):(g=g!==null,g!==(o!==null&&o.memoizedState!==null)&&g&&(l.child.flags|=8192,(l.mode&1)!==0&&(o===null||(Gt.current&1)!==0?bn===0&&(bn=3):cv())),l.updateQueue!==null&&(l.flags|=4),Gn(l),null);case 4:return tu(),Yg(o,l),o===null&&Lc(l.stateNode.containerInfo),Gn(l),null;case 10:return Eg(l.type._context),Gn(l),null;case 17:return vr(l.type)&&lh(),Gn(l),null;case 19:if(Dt(Gt),C=l.memoizedState,C===null)return Gn(l),null;if(g=(l.flags&128)!==0,I=C.rendering,I===null)if(g)qc(C,!1);else{if(bn!==0||o!==null&&(o.flags&128)!==0)for(o=l.child;o!==null;){if(I=_h(o),I!==null){for(l.flags|=128,qc(C,!1),g=I.updateQueue,g!==null&&(l.updateQueue=g,l.flags|=4),l.subtreeFlags=0,g=f,f=l.child;f!==null;)C=f,o=g,C.flags&=14680066,I=C.alternate,I===null?(C.childLanes=0,C.lanes=o,C.child=null,C.subtreeFlags=0,C.memoizedProps=null,C.memoizedState=null,C.updateQueue=null,C.dependencies=null,C.stateNode=null):(C.childLanes=I.childLanes,C.lanes=I.lanes,C.child=I.child,C.subtreeFlags=0,C.deletions=null,C.memoizedProps=I.memoizedProps,C.memoizedState=I.memoizedState,C.updateQueue=I.updateQueue,C.type=I.type,o=I.dependencies,C.dependencies=o===null?null:{lanes:o.lanes,firstContext:o.firstContext}),f=f.sibling;return Rt(Gt,Gt.current&1|2),l.child}o=o.sibling}C.tail!==null&&wt()>iu&&(l.flags|=128,g=!0,qc(C,!1),l.lanes=4194304)}else{if(!g)if(o=_h(I),o!==null){if(l.flags|=128,g=!0,f=o.updateQueue,f!==null&&(l.updateQueue=f,l.flags|=4),qc(C,!0),C.tail===null&&C.tailMode==="hidden"&&!I.alternate&&!Ht)return Gn(l),null}else 2*wt()-C.renderingStartTime>iu&&f!==1073741824&&(l.flags|=128,g=!0,qc(C,!1),l.lanes=4194304);C.isBackwards?(I.sibling=l.child,l.child=I):(f=C.last,f!==null?f.sibling=I:l.child=I,C.last=I)}return C.tail!==null?(l=C.tail,C.rendering=l,C.tail=l.sibling,C.renderingStartTime=wt(),l.sibling=null,f=Gt.current,Rt(Gt,g?f&1|2:f&1),l):(Gn(l),null);case 22:case 23:return uv(),g=l.memoizedState!==null,o!==null&&o.memoizedState!==null!==g&&(l.flags|=8192),g&&(l.mode&1)!==0?(Hr&1073741824)!==0&&(Gn(l),l.subtreeFlags&6&&(l.flags|=8192)):Gn(l),null;case 24:return null;case 25:return null}throw Error(n(156,l.tag))}function wO(o,l){switch(yg(l),l.tag){case 1:return vr(l.type)&&lh(),o=l.flags,o&65536?(l.flags=o&-65537|128,l):null;case 3:return tu(),Dt(gr),Dt(Wn),Ig(),o=l.flags,(o&65536)!==0&&(o&128)===0?(l.flags=o&-65537|128,l):null;case 5:return Rg(l),null;case 13:if(Dt(Gt),o=l.memoizedState,o!==null&&o.dehydrated!==null){if(l.alternate===null)throw Error(n(340));Xl()}return o=l.flags,o&65536?(l.flags=o&-65537|128,l):null;case 19:return Dt(Gt),null;case 4:return tu(),null;case 10:return Eg(l.type._context),null;case 22:case 23:return uv(),null;case 24:return null;default:return null}}var Th=!1,Kn=!1,xO=typeof WeakSet=="function"?WeakSet:Set,Ie=null;function ru(o,l){var f=o.ref;if(f!==null)if(typeof f=="function")try{f(null)}catch(g){en(o,l,g)}else f.current=null}function Xg(o,l,f){try{f()}catch(g){en(o,l,g)}}var RS=!1;function bO(o,l){if(ug=Kf,o=ab(),tg(o)){if("selectionStart"in o)var f={start:o.selectionStart,end:o.selectionEnd};else e:{f=(f=o.ownerDocument)&&f.defaultView||window;var g=f.getSelection&&f.getSelection();if(g&&g.rangeCount!==0){f=g.anchorNode;var b=g.anchorOffset,C=g.focusNode;g=g.focusOffset;try{f.nodeType,C.nodeType}catch{f=null;break e}var I=0,$=-1,B=-1,re=0,fe=0,ge=o,de=null;t:for(;;){for(var Re;ge!==f||b!==0&&ge.nodeType!==3||($=I+b),ge!==C||g!==0&&ge.nodeType!==3||(B=I+g),ge.nodeType===3&&(I+=ge.nodeValue.length),(Re=ge.firstChild)!==null;)de=ge,ge=Re;for(;;){if(ge===o)break t;if(de===f&&++re===b&&($=I),de===C&&++fe===g&&(B=I),(Re=ge.nextSibling)!==null)break;ge=de,de=ge.parentNode}ge=Re}f=$===-1||B===-1?null:{start:$,end:B}}else f=null}f=f||{start:0,end:0}}else f=null;for(cg={focusedElem:o,selectionRange:f},Kf=!1,Ie=l;Ie!==null;)if(l=Ie,o=l.child,(l.subtreeFlags&1028)!==0&&o!==null)o.return=l,Ie=o;else for(;Ie!==null;){l=Ie;try{var Oe=l.alternate;if((l.flags&1024)!==0)switch(l.tag){case 0:case 11:case 15:break;case 1:if(Oe!==null){var De=Oe.memoizedProps,un=Oe.memoizedState,Q=l.stateNode,K=Q.getSnapshotBeforeUpdate(l.elementType===l.type?De:Os(l.type,De),un);Q.__reactInternalSnapshotBeforeUpdate=K}break;case 3:var te=l.stateNode.containerInfo;te.nodeType===1?te.textContent="":te.nodeType===9&&te.documentElement&&te.removeChild(te.documentElement);break;case 5:case 6:case 4:case 17:break;default:throw Error(n(163))}}catch(xe){en(l,l.return,xe)}if(o=l.sibling,o!==null){o.return=l.return,Ie=o;break}Ie=l.return}return Oe=RS,RS=!1,Oe}function Gc(o,l,f){var g=l.updateQueue;if(g=g!==null?g.lastEffect:null,g!==null){var b=g=g.next;do{if((b.tag&o)===o){var C=b.destroy;b.destroy=void 0,C!==void 0&&Xg(l,f,C)}b=b.next}while(b!==g)}}function Rh(o,l){if(l=l.updateQueue,l=l!==null?l.lastEffect:null,l!==null){var f=l=l.next;do{if((f.tag&o)===o){var g=f.create;f.destroy=g()}f=f.next}while(f!==l)}}function Qg(o){var l=o.ref;if(l!==null){var f=o.stateNode;switch(o.tag){case 5:o=f;break;default:o=f}typeof l=="function"?l(o):l.current=o}}function AS(o){var l=o.alternate;l!==null&&(o.alternate=null,AS(l)),o.child=null,o.deletions=null,o.sibling=null,o.tag===5&&(l=o.stateNode,l!==null&&(delete l[Gs],delete l[Nc],delete l[pg],delete l[sO],delete l[iO])),o.stateNode=null,o.return=null,o.dependencies=null,o.memoizedProps=null,o.memoizedState=null,o.pendingProps=null,o.stateNode=null,o.updateQueue=null}function IS(o){return o.tag===5||o.tag===3||o.tag===4}function MS(o){e:for(;;){for(;o.sibling===null;){if(o.return===null||IS(o.return))return null;o=o.return}for(o.sibling.return=o.return,o=o.sibling;o.tag!==5&&o.tag!==6&&o.tag!==18;){if(o.flags&2||o.child===null||o.tag===4)continue e;o.child.return=o,o=o.child}if(!(o.flags&2))return o.stateNode}}function Jg(o,l,f){var g=o.tag;if(g===5||g===6)o=o.stateNode,l?f.nodeType===8?f.parentNode.insertBefore(o,l):f.insertBefore(o,l):(f.nodeType===8?(l=f.parentNode,l.insertBefore(o,f)):(l=f,l.appendChild(o)),f=f._reactRootContainer,f!=null||l.onclick!==null||(l.onclick=oh));else if(g!==4&&(o=o.child,o!==null))for(Jg(o,l,f),o=o.sibling;o!==null;)Jg(o,l,f),o=o.sibling}function ev(o,l,f){var g=o.tag;if(g===5||g===6)o=o.stateNode,l?f.insertBefore(o,l):f.appendChild(o);else if(g!==4&&(o=o.child,o!==null))for(ev(o,l,f),o=o.sibling;o!==null;)ev(o,l,f),o=o.sibling}var Nn=null,Ls=!1;function Ao(o,l,f){for(f=f.child;f!==null;)OS(o,l,f),f=f.sibling}function OS(o,l,f){if(jr&&typeof jr.onCommitFiberUnmount=="function")try{jr.onCommitFiberUnmount(Ca,f)}catch{}switch(f.tag){case 5:Kn||ru(f,l);case 6:var g=Nn,b=Ls;Nn=null,Ao(o,l,f),Nn=g,Ls=b,Nn!==null&&(Ls?(o=Nn,f=f.stateNode,o.nodeType===8?o.parentNode.removeChild(f):o.removeChild(f)):Nn.removeChild(f.stateNode));break;case 18:Nn!==null&&(Ls?(o=Nn,f=f.stateNode,o.nodeType===8?hg(o.parentNode,f):o.nodeType===1&&hg(o,f),Cc(o)):hg(Nn,f.stateNode));break;case 4:g=Nn,b=Ls,Nn=f.stateNode.containerInfo,Ls=!0,Ao(o,l,f),Nn=g,Ls=b;break;case 0:case 11:case 14:case 15:if(!Kn&&(g=f.updateQueue,g!==null&&(g=g.lastEffect,g!==null))){b=g=g.next;do{var C=b,I=C.destroy;C=C.tag,I!==void 0&&((C&2)!==0||(C&4)!==0)&&Xg(f,l,I),b=b.next}while(b!==g)}Ao(o,l,f);break;case 1:if(!Kn&&(ru(f,l),g=f.stateNode,typeof g.componentWillUnmount=="function"))try{g.props=f.memoizedProps,g.state=f.memoizedState,g.componentWillUnmount()}catch($){en(f,l,$)}Ao(o,l,f);break;case 21:Ao(o,l,f);break;case 22:f.mode&1?(Kn=(g=Kn)||f.memoizedState!==null,Ao(o,l,f),Kn=g):Ao(o,l,f);break;default:Ao(o,l,f)}}function LS(o){var l=o.updateQueue;if(l!==null){o.updateQueue=null;var f=o.stateNode;f===null&&(f=o.stateNode=new xO),l.forEach(function(g){var b=IO.bind(null,o,g);f.has(g)||(f.add(g),g.then(b,b))})}}function Ds(o,l){var f=l.deletions;if(f!==null)for(var g=0;g<f.length;g++){var b=f[g];try{var C=o,I=l,$=I;e:for(;$!==null;){switch($.tag){case 5:Nn=$.stateNode,Ls=!1;break e;case 3:Nn=$.stateNode.containerInfo,Ls=!0;break e;case 4:Nn=$.stateNode.containerInfo,Ls=!0;break e}$=$.return}if(Nn===null)throw Error(n(160));OS(C,I,b),Nn=null,Ls=!1;var B=b.alternate;B!==null&&(B.return=null),b.return=null}catch(re){en(b,l,re)}}if(l.subtreeFlags&12854)for(l=l.child;l!==null;)DS(l,o),l=l.sibling}function DS(o,l){var f=o.alternate,g=o.flags;switch(o.tag){case 0:case 11:case 14:case 15:if(Ds(l,o),Ys(o),g&4){try{Gc(3,o,o.return),Rh(3,o)}catch(De){en(o,o.return,De)}try{Gc(5,o,o.return)}catch(De){en(o,o.return,De)}}break;case 1:Ds(l,o),Ys(o),g&512&&f!==null&&ru(f,f.return);break;case 5:if(Ds(l,o),Ys(o),g&512&&f!==null&&ru(f,f.return),o.flags&32){var b=o.stateNode;try{er(b,"")}catch(De){en(o,o.return,De)}}if(g&4&&(b=o.stateNode,b!=null)){var C=o.memoizedProps,I=f!==null?f.memoizedProps:C,$=o.type,B=o.updateQueue;if(o.updateQueue=null,B!==null)try{$==="input"&&C.type==="radio"&&C.name!=null&&be(b,C),Ps($,I);var re=Ps($,C);for(I=0;I<B.length;I+=2){var fe=B[I],ge=B[I+1];fe==="style"?mo(b,ge):fe==="dangerouslySetInnerHTML"?fr(b,ge):fe==="children"?er(b,ge):T(b,fe,ge,re)}switch($){case"input":Ve(b,C);break;case"textarea":an(b,C);break;case"select":var de=b._wrapperState.wasMultiple;b._wrapperState.wasMultiple=!!C.multiple;var Re=C.value;Re!=null?nt(b,!!C.multiple,Re,!1):de!==!!C.multiple&&(C.defaultValue!=null?nt(b,!!C.multiple,C.defaultValue,!0):nt(b,!!C.multiple,C.multiple?[]:"",!1))}b[Nc]=C}catch(De){en(o,o.return,De)}}break;case 6:if(Ds(l,o),Ys(o),g&4){if(o.stateNode===null)throw Error(n(162));b=o.stateNode,C=o.memoizedProps;try{b.nodeValue=C}catch(De){en(o,o.return,De)}}break;case 3:if(Ds(l,o),Ys(o),g&4&&f!==null&&f.memoizedState.isDehydrated)try{Cc(l.containerInfo)}catch(De){en(o,o.return,De)}break;case 4:Ds(l,o),Ys(o);break;case 13:Ds(l,o),Ys(o),b=o.child,b.flags&8192&&(C=b.memoizedState!==null,b.stateNode.isHidden=C,!C||b.alternate!==null&&b.alternate.memoizedState!==null||(rv=wt())),g&4&&LS(o);break;case 22:if(fe=f!==null&&f.memoizedState!==null,o.mode&1?(Kn=(re=Kn)||fe,Ds(l,o),Kn=re):Ds(l,o),Ys(o),g&8192){if(re=o.memoizedState!==null,(o.stateNode.isHidden=re)&&!fe&&(o.mode&1)!==0)for(Ie=o,fe=o.child;fe!==null;){for(ge=Ie=fe;Ie!==null;){switch(de=Ie,Re=de.child,de.tag){case 0:case 11:case 14:case 15:Gc(4,de,de.return);break;case 1:ru(de,de.return);var Oe=de.stateNode;if(typeof Oe.componentWillUnmount=="function"){g=de,f=de.return;try{l=g,Oe.props=l.memoizedProps,Oe.state=l.memoizedState,Oe.componentWillUnmount()}catch(De){en(g,f,De)}}break;case 5:ru(de,de.return);break;case 22:if(de.memoizedState!==null){FS(ge);continue}}Re!==null?(Re.return=de,Ie=Re):FS(ge)}fe=fe.sibling}e:for(fe=null,ge=o;;){if(ge.tag===5){if(fe===null){fe=ge;try{b=ge.stateNode,re?(C=b.style,typeof C.setProperty=="function"?C.setProperty("display","none","important"):C.display="none"):($=ge.stateNode,B=ge.memoizedProps.style,I=B!=null&&B.hasOwnProperty("display")?B.display:null,$.style.display=Jt("display",I))}catch(De){en(o,o.return,De)}}}else if(ge.tag===6){if(fe===null)try{ge.stateNode.nodeValue=re?"":ge.memoizedProps}catch(De){en(o,o.return,De)}}else if((ge.tag!==22&&ge.tag!==23||ge.memoizedState===null||ge===o)&&ge.child!==null){ge.child.return=ge,ge=ge.child;continue}if(ge===o)break e;for(;ge.sibling===null;){if(ge.return===null||ge.return===o)break e;fe===ge&&(fe=null),ge=ge.return}fe===ge&&(fe=null),ge.sibling.return=ge.return,ge=ge.sibling}}break;case 19:Ds(l,o),Ys(o),g&4&&LS(o);break;case 21:break;default:Ds(l,o),Ys(o)}}function Ys(o){var l=o.flags;if(l&2){try{e:{for(var f=o.return;f!==null;){if(IS(f)){var g=f;break e}f=f.return}throw Error(n(160))}switch(g.tag){case 5:var b=g.stateNode;g.flags&32&&(er(b,""),g.flags&=-33);var C=MS(o);ev(o,C,b);break;case 3:case 4:var I=g.stateNode.containerInfo,$=MS(o);Jg(o,$,I);break;default:throw Error(n(161))}}catch(B){en(o,o.return,B)}o.flags&=-3}l&4096&&(o.flags&=-4097)}function SO(o,l,f){Ie=o,NS(o)}function NS(o,l,f){for(var g=(o.mode&1)!==0;Ie!==null;){var b=Ie,C=b.child;if(b.tag===22&&g){var I=b.memoizedState!==null||Th;if(!I){var $=b.alternate,B=$!==null&&$.memoizedState!==null||Kn;$=Th;var re=Kn;if(Th=I,(Kn=B)&&!re)for(Ie=b;Ie!==null;)I=Ie,B=I.child,I.tag===22&&I.memoizedState!==null?$S(b):B!==null?(B.return=I,Ie=B):$S(b);for(;C!==null;)Ie=C,NS(C),C=C.sibling;Ie=b,Th=$,Kn=re}jS(o)}else(b.subtreeFlags&8772)!==0&&C!==null?(C.return=b,Ie=C):jS(o)}}function jS(o){for(;Ie!==null;){var l=Ie;if((l.flags&8772)!==0){var f=l.alternate;try{if((l.flags&8772)!==0)switch(l.tag){case 0:case 11:case 15:Kn||Rh(5,l);break;case 1:var g=l.stateNode;if(l.flags&4&&!Kn)if(f===null)g.componentDidMount();else{var b=l.elementType===l.type?f.memoizedProps:Os(l.type,f.memoizedProps);g.componentDidUpdate(b,f.memoizedState,g.__reactInternalSnapshotBeforeUpdate)}var C=l.updateQueue;C!==null&&Fb(l,C,g);break;case 3:var I=l.updateQueue;if(I!==null){if(f=null,l.child!==null)switch(l.child.tag){case 5:f=l.child.stateNode;break;case 1:f=l.child.stateNode}Fb(l,I,f)}break;case 5:var $=l.stateNode;if(f===null&&l.flags&4){f=$;var B=l.memoizedProps;switch(l.type){case"button":case"input":case"select":case"textarea":B.autoFocus&&f.focus();break;case"img":B.src&&(f.src=B.src)}}break;case 6:break;case 4:break;case 12:break;case 13:if(l.memoizedState===null){var re=l.alternate;if(re!==null){var fe=re.memoizedState;if(fe!==null){var ge=fe.dehydrated;ge!==null&&Cc(ge)}}}break;case 19:case 17:case 21:case 22:case 23:case 25:break;default:throw Error(n(163))}Kn||l.flags&512&&Qg(l)}catch(de){en(l,l.return,de)}}if(l===o){Ie=null;break}if(f=l.sibling,f!==null){f.return=l.return,Ie=f;break}Ie=l.return}}function FS(o){for(;Ie!==null;){var l=Ie;if(l===o){Ie=null;break}var f=l.sibling;if(f!==null){f.return=l.return,Ie=f;break}Ie=l.return}}function $S(o){for(;Ie!==null;){var l=Ie;try{switch(l.tag){case 0:case 11:case 15:var f=l.return;try{Rh(4,l)}catch(B){en(l,f,B)}break;case 1:var g=l.stateNode;if(typeof g.componentDidMount=="function"){var b=l.return;try{g.componentDidMount()}catch(B){en(l,b,B)}}var C=l.return;try{Qg(l)}catch(B){en(l,C,B)}break;case 5:var I=l.return;try{Qg(l)}catch(B){en(l,I,B)}}}catch(B){en(l,l.return,B)}if(l===o){Ie=null;break}var $=l.sibling;if($!==null){$.return=l.return,Ie=$;break}Ie=l.return}}var EO=Math.ceil,Ah=k.ReactCurrentDispatcher,tv=k.ReactCurrentOwner,ps=k.ReactCurrentBatchConfig,ft=0,kn=null,pn=null,jn=0,Hr=0,su=Co(0),bn=0,Kc=null,Oa=0,Ih=0,nv=0,Zc=null,_r=null,rv=0,iu=1/0,Ii=null,Mh=!1,sv=null,Io=null,Oh=!1,Mo=null,Lh=0,Yc=0,iv=null,Dh=-1,Nh=0;function rr(){return(ft&6)!==0?wt():Dh!==-1?Dh:Dh=wt()}function Oo(o){return(o.mode&1)===0?1:(ft&2)!==0&&jn!==0?jn&-jn:aO.transition!==null?(Nh===0&&(Nh=Rs()),Nh):(o=rt,o!==0||(o=window.event,o=o===void 0?16:Hx(o.type)),o)}function Ns(o,l,f,g){if(50<Yc)throw Yc=0,iv=null,Error(n(185));mr(o,f,g),((ft&2)===0||o!==kn)&&(o===kn&&((ft&2)===0&&(Ih|=f),bn===4&&Lo(o,jn)),wr(o,g),f===1&&ft===0&&(l.mode&1)===0&&(iu=wt()+500,ch&&Po()))}function wr(o,l){var f=o.callbackNode;Dn(o,l);var g=Ge(o,o===kn?jn:0);if(g===0)f!==null&&wc(f),o.callbackNode=null,o.callbackPriority=0;else if(l=g&-g,o.callbackPriority!==l){if(f!=null&&wc(f),l===1)o.tag===0?oO(HS.bind(null,o)):kb(HS.bind(null,o)),nO(function(){(ft&6)===0&&Po()}),f=null;else{switch(Wf(g)){case 1:f=Sa;break;case 4:f=Uf;break;case 16:f=Ea;break;case 536870912:f=Fl;break;default:f=Ea}f=ZS(f,VS.bind(null,o))}o.callbackPriority=l,o.callbackNode=f}}function VS(o,l){if(Dh=-1,Nh=0,(ft&6)!==0)throw Error(n(327));var f=o.callbackNode;if(ou()&&o.callbackNode!==f)return null;var g=Ge(o,o===kn?jn:0);if(g===0)return null;if((g&30)!==0||(g&o.expiredLanes)!==0||l)l=jh(o,g);else{l=g;var b=ft;ft|=2;var C=US();(kn!==o||jn!==l)&&(Ii=null,iu=wt()+500,Da(o,l));do try{PO();break}catch($){zS(o,$)}while(!0);Sg(),Ah.current=C,ft=b,pn!==null?l=0:(kn=null,jn=0,l=bn)}if(l!==0){if(l===2&&(b=us(o),b!==0&&(g=b,l=ov(o,b))),l===1)throw f=Kc,Da(o,0),Lo(o,g),wr(o,wt()),f;if(l===6)Lo(o,g);else{if(b=o.current.alternate,(g&30)===0&&!CO(b)&&(l=jh(o,g),l===2&&(C=us(o),C!==0&&(g=C,l=ov(o,C))),l===1))throw f=Kc,Da(o,0),Lo(o,g),wr(o,wt()),f;switch(o.finishedWork=b,o.finishedLanes=g,l){case 0:case 1:throw Error(n(345));case 2:Na(o,_r,Ii);break;case 3:if(Lo(o,g),(g&130023424)===g&&(l=rv+500-wt(),10<l)){if(Ge(o,0)!==0)break;if(b=o.suspendedLanes,(b&g)!==g){rr(),o.pingedLanes|=o.suspendedLanes&b;break}o.timeoutHandle=fg(Na.bind(null,o,_r,Ii),l);break}Na(o,_r,Ii);break;case 4:if(Lo(o,g),(g&4194240)===g)break;for(l=o.eventTimes,b=-1;0<g;){var I=31-pr(g);C=1<<I,I=l[I],I>b&&(b=I),g&=~C}if(g=b,g=wt()-g,g=(120>g?120:480>g?480:1080>g?1080:1920>g?1920:3e3>g?3e3:4320>g?4320:1960*EO(g/1960))-g,10<g){o.timeoutHandle=fg(Na.bind(null,o,_r,Ii),g);break}Na(o,_r,Ii);break;case 5:Na(o,_r,Ii);break;default:throw Error(n(329))}}}return wr(o,wt()),o.callbackNode===f?VS.bind(null,o):null}function ov(o,l){var f=Zc;return o.current.memoizedState.isDehydrated&&(Da(o,l).flags|=256),o=jh(o,l),o!==2&&(l=_r,_r=f,l!==null&&av(l)),o}function av(o){_r===null?_r=o:_r.push.apply(_r,o)}function CO(o){for(var l=o;;){if(l.flags&16384){var f=l.updateQueue;if(f!==null&&(f=f.stores,f!==null))for(var g=0;g<f.length;g++){var b=f[g],C=b.getSnapshot;b=b.value;try{if(!Is(C(),b))return!1}catch{return!1}}}if(f=l.child,l.subtreeFlags&16384&&f!==null)f.return=l,l=f;else{if(l===o)break;for(;l.sibling===null;){if(l.return===null||l.return===o)return!0;l=l.return}l.sibling.return=l.return,l=l.sibling}}return!0}function Lo(o,l){for(l&=~nv,l&=~Ih,o.suspendedLanes|=l,o.pingedLanes&=~l,o=o.expirationTimes;0<l;){var f=31-pr(l),g=1<<f;o[f]=-1,l&=~g}}function HS(o){if((ft&6)!==0)throw Error(n(327));ou();var l=Ge(o,0);if((l&1)===0)return wr(o,wt()),null;var f=jh(o,l);if(o.tag!==0&&f===2){var g=us(o);g!==0&&(l=g,f=ov(o,g))}if(f===1)throw f=Kc,Da(o,0),Lo(o,l),wr(o,wt()),f;if(f===6)throw Error(n(345));return o.finishedWork=o.current.alternate,o.finishedLanes=l,Na(o,_r,Ii),wr(o,wt()),null}function lv(o,l){var f=ft;ft|=1;try{return o(l)}finally{ft=f,ft===0&&(iu=wt()+500,ch&&Po())}}function La(o){Mo!==null&&Mo.tag===0&&(ft&6)===0&&ou();var l=ft;ft|=1;var f=ps.transition,g=rt;try{if(ps.transition=null,rt=1,o)return o()}finally{rt=g,ps.transition=f,ft=l,(ft&6)===0&&Po()}}function uv(){Hr=su.current,Dt(su)}function Da(o,l){o.finishedWork=null,o.finishedLanes=0;var f=o.timeoutHandle;if(f!==-1&&(o.timeoutHandle=-1,tO(f)),pn!==null)for(f=pn.return;f!==null;){var g=f;switch(yg(g),g.tag){case 1:g=g.type.childContextTypes,g!=null&&lh();break;case 3:tu(),Dt(gr),Dt(Wn),Ig();break;case 5:Rg(g);break;case 4:tu();break;case 13:Dt(Gt);break;case 19:Dt(Gt);break;case 10:Eg(g.type._context);break;case 22:case 23:uv()}f=f.return}if(kn=o,pn=o=Do(o.current,null),jn=Hr=l,bn=0,Kc=null,nv=Ih=Oa=0,_r=Zc=null,Aa!==null){for(l=0;l<Aa.length;l++)if(f=Aa[l],g=f.interleaved,g!==null){f.interleaved=null;var b=g.next,C=f.pending;if(C!==null){var I=C.next;C.next=b,g.next=I}f.pending=g}Aa=null}return o}function zS(o,l){do{var f=pn;try{if(Sg(),wh.current=Eh,xh){for(var g=Kt.memoizedState;g!==null;){var b=g.queue;b!==null&&(b.pending=null),g=g.next}xh=!1}if(Ma=0,Cn=xn=Kt=null,zc=!1,Uc=0,tv.current=null,f===null||f.return===null){bn=1,Kc=l,pn=null;break}e:{var C=o,I=f.return,$=f,B=l;if(l=jn,$.flags|=32768,B!==null&&typeof B=="object"&&typeof B.then=="function"){var re=B,fe=$,ge=fe.tag;if((fe.mode&1)===0&&(ge===0||ge===11||ge===15)){var de=fe.alternate;de?(fe.updateQueue=de.updateQueue,fe.memoizedState=de.memoizedState,fe.lanes=de.lanes):(fe.updateQueue=null,fe.memoizedState=null)}var Re=hS(I);if(Re!==null){Re.flags&=-257,pS(Re,I,$,C,l),Re.mode&1&&fS(C,re,l),l=Re,B=re;var Oe=l.updateQueue;if(Oe===null){var De=new Set;De.add(B),l.updateQueue=De}else Oe.add(B);break e}else{if((l&1)===0){fS(C,re,l),cv();break e}B=Error(n(426))}}else if(Ht&&$.mode&1){var un=hS(I);if(un!==null){(un.flags&65536)===0&&(un.flags|=256),pS(un,I,$,C,l),xg(nu(B,$));break e}}C=B=nu(B,$),bn!==4&&(bn=2),Zc===null?Zc=[C]:Zc.push(C),C=I;do{switch(C.tag){case 3:C.flags|=65536,l&=-l,C.lanes|=l;var Q=cS(C,B,l);jb(C,Q);break e;case 1:$=B;var K=C.type,te=C.stateNode;if((C.flags&128)===0&&(typeof K.getDerivedStateFromError=="function"||te!==null&&typeof te.componentDidCatch=="function"&&(Io===null||!Io.has(te)))){C.flags|=65536,l&=-l,C.lanes|=l;var xe=dS(C,$,l);jb(C,xe);break e}}C=C.return}while(C!==null)}WS(f)}catch(je){l=je,pn===f&&f!==null&&(pn=f=f.return);continue}break}while(!0)}function US(){var o=Ah.current;return Ah.current=Eh,o===null?Eh:o}function cv(){(bn===0||bn===3||bn===2)&&(bn=4),kn===null||(Oa&268435455)===0&&(Ih&268435455)===0||Lo(kn,jn)}function jh(o,l){var f=ft;ft|=2;var g=US();(kn!==o||jn!==l)&&(Ii=null,Da(o,l));do try{kO();break}catch(b){zS(o,b)}while(!0);if(Sg(),ft=f,Ah.current=g,pn!==null)throw Error(n(261));return kn=null,jn=0,bn}function kO(){for(;pn!==null;)BS(pn)}function PO(){for(;pn!==null&&!H0();)BS(pn)}function BS(o){var l=KS(o.alternate,o,Hr);o.memoizedProps=o.pendingProps,l===null?WS(o):pn=l,tv.current=null}function WS(o){var l=o;do{var f=l.alternate;if(o=l.return,(l.flags&32768)===0){if(f=_O(f,l,Hr),f!==null){pn=f;return}}else{if(f=wO(f,l),f!==null){f.flags&=32767,pn=f;return}if(o!==null)o.flags|=32768,o.subtreeFlags=0,o.deletions=null;else{bn=6,pn=null;return}}if(l=l.sibling,l!==null){pn=l;return}pn=l=o}while(l!==null);bn===0&&(bn=5)}function Na(o,l,f){var g=rt,b=ps.transition;try{ps.transition=null,rt=1,TO(o,l,f,g)}finally{ps.transition=b,rt=g}return null}function TO(o,l,f,g){do ou();while(Mo!==null);if((ft&6)!==0)throw Error(n(327));f=o.finishedWork;var b=o.finishedLanes;if(f===null)return null;if(o.finishedWork=null,o.finishedLanes=0,f===o.current)throw Error(n(177));o.callbackNode=null,o.callbackPriority=0;var C=f.lanes|f.childLanes;if(hn(o,C),o===kn&&(pn=kn=null,jn=0),(f.subtreeFlags&2064)===0&&(f.flags&2064)===0||Oh||(Oh=!0,ZS(Ea,function(){return ou(),null})),C=(f.flags&15990)!==0,(f.subtreeFlags&15990)!==0||C){C=ps.transition,ps.transition=null;var I=rt;rt=1;var $=ft;ft|=4,tv.current=null,bO(o,f),DS(f,o),KM(cg),Kf=!!ug,cg=ug=null,o.current=f,SO(f),Ox(),ft=$,rt=I,ps.transition=C}else o.current=f;if(Oh&&(Oh=!1,Mo=o,Lh=b),C=o.pendingLanes,C===0&&(Io=null),Bf(f.stateNode),wr(o,wt()),l!==null)for(g=o.onRecoverableError,f=0;f<l.length;f++)b=l[f],g(b.value,{componentStack:b.stack,digest:b.digest});if(Mh)throw Mh=!1,o=sv,sv=null,o;return(Lh&1)!==0&&o.tag!==0&&ou(),C=o.pendingLanes,(C&1)!==0?o===iv?Yc++:(Yc=0,iv=o):Yc=0,Po(),null}function ou(){if(Mo!==null){var o=Wf(Lh),l=ps.transition,f=rt;try{if(ps.transition=null,rt=16>o?16:o,Mo===null)var g=!1;else{if(o=Mo,Mo=null,Lh=0,(ft&6)!==0)throw Error(n(331));var b=ft;for(ft|=4,Ie=o.current;Ie!==null;){var C=Ie,I=C.child;if((Ie.flags&16)!==0){var $=C.deletions;if($!==null){for(var B=0;B<$.length;B++){var re=$[B];for(Ie=re;Ie!==null;){var fe=Ie;switch(fe.tag){case 0:case 11:case 15:Gc(8,fe,C)}var ge=fe.child;if(ge!==null)ge.return=fe,Ie=ge;else for(;Ie!==null;){fe=Ie;var de=fe.sibling,Re=fe.return;if(AS(fe),fe===re){Ie=null;break}if(de!==null){de.return=Re,Ie=de;break}Ie=Re}}}var Oe=C.alternate;if(Oe!==null){var De=Oe.child;if(De!==null){Oe.child=null;do{var un=De.sibling;De.sibling=null,De=un}while(De!==null)}}Ie=C}}if((C.subtreeFlags&2064)!==0&&I!==null)I.return=C,Ie=I;else e:for(;Ie!==null;){if(C=Ie,(C.flags&2048)!==0)switch(C.tag){case 0:case 11:case 15:Gc(9,C,C.return)}var Q=C.sibling;if(Q!==null){Q.return=C.return,Ie=Q;break e}Ie=C.return}}var K=o.current;for(Ie=K;Ie!==null;){I=Ie;var te=I.child;if((I.subtreeFlags&2064)!==0&&te!==null)te.return=I,Ie=te;else e:for(I=K;Ie!==null;){if($=Ie,($.flags&2048)!==0)try{switch($.tag){case 0:case 11:case 15:Rh(9,$)}}catch(je){en($,$.return,je)}if($===I){Ie=null;break e}var xe=$.sibling;if(xe!==null){xe.return=$.return,Ie=xe;break e}Ie=$.return}}if(ft=b,Po(),jr&&typeof jr.onPostCommitFiberRoot=="function")try{jr.onPostCommitFiberRoot(Ca,o)}catch{}g=!0}return g}finally{rt=f,ps.transition=l}}return!1}function qS(o,l,f){l=nu(f,l),l=cS(o,l,1),o=Ro(o,l,1),l=rr(),o!==null&&(mr(o,1,l),wr(o,l))}function en(o,l,f){if(o.tag===3)qS(o,o,f);else for(;l!==null;){if(l.tag===3){qS(l,o,f);break}else if(l.tag===1){var g=l.stateNode;if(typeof l.type.getDerivedStateFromError=="function"||typeof g.componentDidCatch=="function"&&(Io===null||!Io.has(g))){o=nu(f,o),o=dS(l,o,1),l=Ro(l,o,1),o=rr(),l!==null&&(mr(l,1,o),wr(l,o));break}}l=l.return}}function RO(o,l,f){var g=o.pingCache;g!==null&&g.delete(l),l=rr(),o.pingedLanes|=o.suspendedLanes&f,kn===o&&(jn&f)===f&&(bn===4||bn===3&&(jn&130023424)===jn&&500>wt()-rv?Da(o,0):nv|=f),wr(o,l)}function GS(o,l){l===0&&((o.mode&1)===0?l=1:(l=me,me<<=1,(me&130023424)===0&&(me=4194304)));var f=rr();o=Ti(o,l),o!==null&&(mr(o,l,f),wr(o,f))}function AO(o){var l=o.memoizedState,f=0;l!==null&&(f=l.retryLane),GS(o,f)}function IO(o,l){var f=0;switch(o.tag){case 13:var g=o.stateNode,b=o.memoizedState;b!==null&&(f=b.retryLane);break;case 19:g=o.stateNode;break;default:throw Error(n(314))}g!==null&&g.delete(l),GS(o,f)}var KS;KS=function(o,l,f){if(o!==null)if(o.memoizedProps!==l.pendingProps||gr.current)yr=!0;else{if((o.lanes&f)===0&&(l.flags&128)===0)return yr=!1,yO(o,l,f);yr=(o.flags&131072)!==0}else yr=!1,Ht&&(l.flags&1048576)!==0&&Pb(l,fh,l.index);switch(l.lanes=0,l.tag){case 2:var g=l.type;Ph(o,l),o=l.pendingProps;var b=Kl(l,Wn.current);eu(l,f),b=Lg(null,l,g,o,b,f);var C=Dg();return l.flags|=1,typeof b=="object"&&b!==null&&typeof b.render=="function"&&b.$$typeof===void 0?(l.tag=1,l.memoizedState=null,l.updateQueue=null,vr(g)?(C=!0,uh(l)):C=!1,l.memoizedState=b.state!==null&&b.state!==void 0?b.state:null,Pg(l),b.updater=Ch,l.stateNode=b,b._reactInternals=l,Hg(l,g,o,f),l=Wg(null,l,g,!0,C,f)):(l.tag=0,Ht&&C&&vg(l),nr(null,l,b,f),l=l.child),l;case 16:g=l.elementType;e:{switch(Ph(o,l),o=l.pendingProps,b=g._init,g=b(g._payload),l.type=g,b=l.tag=OO(g),o=Os(g,o),b){case 0:l=Bg(null,l,g,o,f);break e;case 1:l=wS(null,l,g,o,f);break e;case 11:l=mS(null,l,g,o,f);break e;case 14:l=gS(null,l,g,Os(g.type,o),f);break e}throw Error(n(306,g,""))}return l;case 0:return g=l.type,b=l.pendingProps,b=l.elementType===g?b:Os(g,b),Bg(o,l,g,b,f);case 1:return g=l.type,b=l.pendingProps,b=l.elementType===g?b:Os(g,b),wS(o,l,g,b,f);case 3:e:{if(xS(l),o===null)throw Error(n(387));g=l.pendingProps,C=l.memoizedState,b=C.element,Nb(o,l),yh(l,g,null,f);var I=l.memoizedState;if(g=I.element,C.isDehydrated)if(C={element:g,isDehydrated:!1,cache:I.cache,pendingSuspenseBoundaries:I.pendingSuspenseBoundaries,transitions:I.transitions},l.updateQueue.baseState=C,l.memoizedState=C,l.flags&256){b=nu(Error(n(423)),l),l=bS(o,l,g,f,b);break e}else if(g!==b){b=nu(Error(n(424)),l),l=bS(o,l,g,f,b);break e}else for(Vr=Eo(l.stateNode.containerInfo.firstChild),$r=l,Ht=!0,Ms=null,f=Lb(l,null,g,f),l.child=f;f;)f.flags=f.flags&-3|4096,f=f.sibling;else{if(Xl(),g===b){l=Ai(o,l,f);break e}nr(o,l,g,f)}l=l.child}return l;case 5:return $b(l),o===null&&wg(l),g=l.type,b=l.pendingProps,C=o!==null?o.memoizedProps:null,I=b.children,dg(g,b)?I=null:C!==null&&dg(g,C)&&(l.flags|=32),_S(o,l),nr(o,l,I,f),l.child;case 6:return o===null&&wg(l),null;case 13:return SS(o,l,f);case 4:return Tg(l,l.stateNode.containerInfo),g=l.pendingProps,o===null?l.child=Ql(l,null,g,f):nr(o,l,g,f),l.child;case 11:return g=l.type,b=l.pendingProps,b=l.elementType===g?b:Os(g,b),mS(o,l,g,b,f);case 7:return nr(o,l,l.pendingProps,f),l.child;case 8:return nr(o,l,l.pendingProps.children,f),l.child;case 12:return nr(o,l,l.pendingProps.children,f),l.child;case 10:e:{if(g=l.type._context,b=l.pendingProps,C=l.memoizedProps,I=b.value,Rt(mh,g._currentValue),g._currentValue=I,C!==null)if(Is(C.value,I)){if(C.children===b.children&&!gr.current){l=Ai(o,l,f);break e}}else for(C=l.child,C!==null&&(C.return=l);C!==null;){var $=C.dependencies;if($!==null){I=C.child;for(var B=$.firstContext;B!==null;){if(B.context===g){if(C.tag===1){B=Ri(-1,f&-f),B.tag=2;var re=C.updateQueue;if(re!==null){re=re.shared;var fe=re.pending;fe===null?B.next=B:(B.next=fe.next,fe.next=B),re.pending=B}}C.lanes|=f,B=C.alternate,B!==null&&(B.lanes|=f),Cg(C.return,f,l),$.lanes|=f;break}B=B.next}}else if(C.tag===10)I=C.type===l.type?null:C.child;else if(C.tag===18){if(I=C.return,I===null)throw Error(n(341));I.lanes|=f,$=I.alternate,$!==null&&($.lanes|=f),Cg(I,f,l),I=C.sibling}else I=C.child;if(I!==null)I.return=C;else for(I=C;I!==null;){if(I===l){I=null;break}if(C=I.sibling,C!==null){C.return=I.return,I=C;break}I=I.return}C=I}nr(o,l,b.children,f),l=l.child}return l;case 9:return b=l.type,g=l.pendingProps.children,eu(l,f),b=fs(b),g=g(b),l.flags|=1,nr(o,l,g,f),l.child;case 14:return g=l.type,b=Os(g,l.pendingProps),b=Os(g.type,b),gS(o,l,g,b,f);case 15:return vS(o,l,l.type,l.pendingProps,f);case 17:return g=l.type,b=l.pendingProps,b=l.elementType===g?b:Os(g,b),Ph(o,l),l.tag=1,vr(g)?(o=!0,uh(l)):o=!1,eu(l,f),lS(l,g,b),Hg(l,g,b,f),Wg(null,l,g,!0,o,f);case 19:return CS(o,l,f);case 22:return yS(o,l,f)}throw Error(n(156,l.tag))};function ZS(o,l){return Nl(o,l)}function MO(o,l,f,g){this.tag=o,this.key=f,this.sibling=this.child=this.return=this.stateNode=this.type=this.elementType=null,this.index=0,this.ref=null,this.pendingProps=l,this.dependencies=this.memoizedState=this.updateQueue=this.memoizedProps=null,this.mode=g,this.subtreeFlags=this.flags=0,this.deletions=null,this.childLanes=this.lanes=0,this.alternate=null}function ms(o,l,f,g){return new MO(o,l,f,g)}function dv(o){return o=o.prototype,!(!o||!o.isReactComponent)}function OO(o){if(typeof o=="function")return dv(o)?1:0;if(o!=null){if(o=o.$$typeof,o===j)return 11;if(o===W)return 14}return 2}function Do(o,l){var f=o.alternate;return f===null?(f=ms(o.tag,l,o.key,o.mode),f.elementType=o.elementType,f.type=o.type,f.stateNode=o.stateNode,f.alternate=o,o.alternate=f):(f.pendingProps=l,f.type=o.type,f.flags=0,f.subtreeFlags=0,f.deletions=null),f.flags=o.flags&14680064,f.childLanes=o.childLanes,f.lanes=o.lanes,f.child=o.child,f.memoizedProps=o.memoizedProps,f.memoizedState=o.memoizedState,f.updateQueue=o.updateQueue,l=o.dependencies,f.dependencies=l===null?null:{lanes:l.lanes,firstContext:l.firstContext},f.sibling=o.sibling,f.index=o.index,f.ref=o.ref,f}function Fh(o,l,f,g,b,C){var I=2;if(g=o,typeof o=="function")dv(o)&&(I=1);else if(typeof o=="string")I=5;else e:switch(o){case L:return ja(f.children,b,C,l);case A:I=8,b|=8;break;case O:return o=ms(12,f,l,b|2),o.elementType=O,o.lanes=C,o;case G:return o=ms(13,f,l,b),o.elementType=G,o.lanes=C,o;case Y:return o=ms(19,f,l,b),o.elementType=Y,o.lanes=C,o;case Z:return $h(f,b,C,l);default:if(typeof o=="object"&&o!==null)switch(o.$$typeof){case D:I=10;break e;case N:I=9;break e;case j:I=11;break e;case W:I=14;break e;case q:I=16,g=null;break e}throw Error(n(130,o==null?o:typeof o,""))}return l=ms(I,f,l,b),l.elementType=o,l.type=g,l.lanes=C,l}function ja(o,l,f,g){return o=ms(7,o,g,l),o.lanes=f,o}function $h(o,l,f,g){return o=ms(22,o,g,l),o.elementType=Z,o.lanes=f,o.stateNode={isHidden:!1},o}function fv(o,l,f){return o=ms(6,o,null,l),o.lanes=f,o}function hv(o,l,f){return l=ms(4,o.children!==null?o.children:[],o.key,l),l.lanes=f,l.stateNode={containerInfo:o.containerInfo,pendingChildren:null,implementation:o.implementation},l}function LO(o,l,f,g,b){this.tag=l,this.containerInfo=o,this.finishedWork=this.pingCache=this.current=this.pendingChildren=null,this.timeoutHandle=-1,this.callbackNode=this.pendingContext=this.context=null,this.callbackPriority=0,this.eventTimes=As(0),this.expirationTimes=As(-1),this.entangledLanes=this.finishedLanes=this.mutableReadLanes=this.expiredLanes=this.pingedLanes=this.suspendedLanes=this.pendingLanes=0,this.entanglements=As(0),this.identifierPrefix=g,this.onRecoverableError=b,this.mutableSourceEagerHydrationData=null}function pv(o,l,f,g,b,C,I,$,B){return o=new LO(o,l,f,$,B),l===1?(l=1,C===!0&&(l|=8)):l=0,C=ms(3,null,null,l),o.current=C,C.stateNode=o,C.memoizedState={element:g,isDehydrated:f,cache:null,transitions:null,pendingSuspenseBoundaries:null},Pg(C),o}function DO(o,l,f){var g=3<arguments.length&&arguments[3]!==void 0?arguments[3]:null;return{$$typeof:M,key:g==null?null:""+g,children:o,containerInfo:l,implementation:f}}function YS(o){if(!o)return ko;o=o._reactInternals;e:{if(Ts(o)!==o||o.tag!==1)throw Error(n(170));var l=o;do{switch(l.tag){case 3:l=l.stateNode.context;break e;case 1:if(vr(l.type)){l=l.stateNode.__reactInternalMemoizedMergedChildContext;break e}}l=l.return}while(l!==null);throw Error(n(171))}if(o.tag===1){var f=o.type;if(vr(f))return Eb(o,f,l)}return l}function XS(o,l,f,g,b,C,I,$,B){return o=pv(f,g,!0,o,b,C,I,$,B),o.context=YS(null),f=o.current,g=rr(),b=Oo(f),C=Ri(g,b),C.callback=l??null,Ro(f,C,b),o.current.lanes=b,mr(o,b,g),wr(o,g),o}function Vh(o,l,f,g){var b=l.current,C=rr(),I=Oo(b);return f=YS(f),l.context===null?l.context=f:l.pendingContext=f,l=Ri(C,I),l.payload={element:o},g=g===void 0?null:g,g!==null&&(l.callback=g),o=Ro(b,l,I),o!==null&&(Ns(o,b,I,C),vh(o,b,I)),I}function Hh(o){if(o=o.current,!o.child)return null;switch(o.child.tag){case 5:return o.child.stateNode;default:return o.child.stateNode}}function QS(o,l){if(o=o.memoizedState,o!==null&&o.dehydrated!==null){var f=o.retryLane;o.retryLane=f!==0&&f<l?f:l}}function mv(o,l){QS(o,l),(o=o.alternate)&&QS(o,l)}function NO(){return null}var JS=typeof reportError=="function"?reportError:function(o){console.error(o)};function gv(o){this._internalRoot=o}zh.prototype.render=gv.prototype.render=function(o){var l=this._internalRoot;if(l===null)throw Error(n(409));Vh(o,l,null,null)},zh.prototype.unmount=gv.prototype.unmount=function(){var o=this._internalRoot;if(o!==null){this._internalRoot=null;var l=o.containerInfo;La(function(){Vh(null,o,null,null)}),l[Ei]=null}};function zh(o){this._internalRoot=o}zh.prototype.unstable_scheduleHydration=function(o){if(o){var l=Nx();o={blockedOn:null,target:o,priority:l};for(var f=0;f<xo.length&&l!==0&&l<xo[f].priority;f++);xo.splice(f,0,o),f===0&&$x(o)}};function vv(o){return!(!o||o.nodeType!==1&&o.nodeType!==9&&o.nodeType!==11)}function Uh(o){return!(!o||o.nodeType!==1&&o.nodeType!==9&&o.nodeType!==11&&(o.nodeType!==8||o.nodeValue!==" react-mount-point-unstable "))}function eE(){}function jO(o,l,f,g,b){if(b){if(typeof g=="function"){var C=g;g=function(){var re=Hh(I);C.call(re)}}var I=XS(l,g,o,0,null,!1,!1,"",eE);return o._reactRootContainer=I,o[Ei]=I.current,Lc(o.nodeType===8?o.parentNode:o),La(),I}for(;b=o.lastChild;)o.removeChild(b);if(typeof g=="function"){var $=g;g=function(){var re=Hh(B);$.call(re)}}var B=pv(o,0,!1,null,null,!1,!1,"",eE);return o._reactRootContainer=B,o[Ei]=B.current,Lc(o.nodeType===8?o.parentNode:o),La(function(){Vh(l,B,f,g)}),B}function Bh(o,l,f,g,b){var C=f._reactRootContainer;if(C){var I=C;if(typeof b=="function"){var $=b;b=function(){var B=Hh(I);$.call(B)}}Vh(l,I,o,b)}else I=jO(f,l,o,b,g);return Hh(I)}Lx=function(o){switch(o.tag){case 3:var l=o.stateNode;if(l.current.memoizedState.isDehydrated){var f=Ee(l.pendingLanes);f!==0&&(Si(l,f|1),wr(l,wt()),(ft&6)===0&&(iu=wt()+500,Po()))}break;case 13:La(function(){var g=Ti(o,1);if(g!==null){var b=rr();Ns(g,o,1,b)}}),mv(o,1)}},z0=function(o){if(o.tag===13){var l=Ti(o,134217728);if(l!==null){var f=rr();Ns(l,o,134217728,f)}mv(o,134217728)}},Dx=function(o){if(o.tag===13){var l=Oo(o),f=Ti(o,l);if(f!==null){var g=rr();Ns(f,o,l,g)}mv(o,l)}},Nx=function(){return rt},jx=function(o,l){var f=rt;try{return rt=o,l()}finally{rt=f}},Ws=function(o,l,f){switch(l){case"input":if(Ve(o,f),l=f.name,f.type==="radio"&&l!=null){for(f=o;f.parentNode;)f=f.parentNode;for(f=f.querySelectorAll("input[name="+JSON.stringify(""+l)+'][type="radio"]'),l=0;l<f.length;l++){var g=f[l];if(g!==o&&g.form===o.form){var b=ah(g);if(!b)throw Error(n(90));Pe(g),Ve(g,b)}}}break;case"textarea":an(o,f);break;case"select":l=f.value,l!=null&&nt(o,!!f.multiple,l,!1)}},We=lv,Wt=La;var FO={usingClientEntryPoint:!1,Events:[jc,ql,ah,xi,bi,lv]},Xc={findFiberByHostInstance:ka,bundleType:0,version:"18.3.1",rendererPackageName:"react-dom"},$O={bundleType:Xc.bundleType,version:Xc.version,rendererPackageName:Xc.rendererPackageName,rendererConfig:Xc.rendererConfig,overrideHookState:null,overrideHookStateDeletePath:null,overrideHookStateRenamePath:null,overrideProps:null,overridePropsDeletePath:null,overridePropsRenamePath:null,setErrorHandler:null,setSuspenseHandler:null,scheduleUpdate:null,currentDispatcherRef:k.ReactCurrentDispatcher,findHostInstanceByFiber:function(o){return o=Hf(o),o===null?null:o.stateNode},findFiberByHostInstance:Xc.findFiberByHostInstance||NO,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 Wh=__REACT_DEVTOOLS_GLOBAL_HOOK__;if(!Wh.isDisabled&&Wh.supportsFiber)try{Ca=Wh.inject($O),jr=Wh}catch{}}return xr.__SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED=FO,xr.createPortal=function(o,l){var f=2<arguments.length&&arguments[2]!==void 0?arguments[2]:null;if(!vv(l))throw Error(n(200));return DO(o,l,null,f)},xr.createRoot=function(o,l){if(!vv(o))throw Error(n(299));var f=!1,g="",b=JS;return l!=null&&(l.unstable_strictMode===!0&&(f=!0),l.identifierPrefix!==void 0&&(g=l.identifierPrefix),l.onRecoverableError!==void 0&&(b=l.onRecoverableError)),l=pv(o,1,!1,null,null,f,!1,g,b),o[Ei]=l.current,Lc(o.nodeType===8?o.parentNode:o),new gv(l)},xr.findDOMNode=function(o){if(o==null)return null;if(o.nodeType===1)return o;var l=o._reactInternals;if(l===void 0)throw typeof o.render=="function"?Error(n(188)):(o=Object.keys(o).join(","),Error(n(268,o)));return o=Hf(l),o=o===null?null:o.stateNode,o},xr.flushSync=function(o){return La(o)},xr.hydrate=function(o,l,f){if(!Uh(l))throw Error(n(200));return Bh(null,o,l,!0,f)},xr.hydrateRoot=function(o,l,f){if(!vv(o))throw Error(n(405));var g=f!=null&&f.hydratedSources||null,b=!1,C="",I=JS;if(f!=null&&(f.unstable_strictMode===!0&&(b=!0),f.identifierPrefix!==void 0&&(C=f.identifierPrefix),f.onRecoverableError!==void 0&&(I=f.onRecoverableError)),l=XS(l,null,o,1,f??null,b,!1,C,I),o[Ei]=l.current,Lc(o),g)for(o=0;o<g.length;o++)f=g[o],b=f._getVersion,b=b(f._source),l.mutableSourceEagerHydrationData==null?l.mutableSourceEagerHydrationData=[f,b]:l.mutableSourceEagerHydrationData.push(f,b);return new zh(l)},xr.render=function(o,l,f){if(!Uh(l))throw Error(n(200));return Bh(null,o,l,!1,f)},xr.unmountComponentAtNode=function(o){if(!Uh(o))throw Error(n(40));return o._reactRootContainer?(La(function(){Bh(null,null,o,!1,function(){o._reactRootContainer=null,o[Ei]=null})}),!0):!1},xr.unstable_batchedUpdates=lv,xr.unstable_renderSubtreeIntoContainer=function(o,l,f,g){if(!Uh(f))throw Error(n(200));if(o==null||o._reactInternals===void 0)throw Error(n(38));return Bh(o,l,f,!1,g)},xr.version="18.3.1-next-f1338f8080-20240426",xr}var OC;function JP(){if(OC)return Xv.exports;OC=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(),Xv.exports=c9(),Xv.exports}var LC;function d9(){if(LC)return op;LC=1;var t=JP();return op.createRoot=t.createRoot,op.hydrateRoot=t.hydrateRoot,op}var f9=d9();const h9=i0(f9),Qi={BASE_URL:"/",DEV:!1,MODE:"production",PROD:!0,SSR:!1};function e3(t){return"init"in t}function Yy(t){return typeof t.write=="function"}function p9(t){return!!t.onMount}function DC(t){return"v"in t||"e"in t}function Rm(t){if("e"in t)throw t.e;if((Qi?"production":void 0)!=="production"&&!("v"in t))throw new Error("[Bug] atom state is not initialized");return t.v}function Am(t){return typeof(t==null?void 0:t.then)=="function"}function m9(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 t3(t,e,n){if(!n.p.has(t)){n.p.add(t);const r=()=>n.p.delete(t);e.then(r,r)}}function n3(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 a=new Set(s);for(const u of i)a.add(u);return a}function g9(t){return!!t.INTERNAL_onInit}const v9=(t,e,n,...r)=>n.read(...r),y9=(t,e,n,...r)=>n.write(...r),_9=(t,e,n)=>n.INTERNAL_onInit(e),w9=(t,e,n,r)=>{var s;return(s=n.onMount)==null?void 0:s.call(n,r)},x9=(t,e,n)=>{var r;const s=t[0];let i=s.get(n);if(!i){const a=t[6],u=t[9];i={d:new Map,p:new Set,n:0},s.set(n,i),(r=a.i)==null||r.call(a,n),g9(n)&&u(t,e,n)}return i},b9=(t,e)=>{var n;const r=t[1],s=t[3],i=t[4],a=t[5],u=t[6],c=t[13];if(!u.f&&!s.size&&!i.size&&!a.size)return;const d=[],h=p=>{try{p()}catch(m){d.push(m)}};do{u.f&&h(u.f);const p=new Set;for(const m of s){const _=(n=r.get(m))==null?void 0:n.l;if(_)for(const w of _)p.add(w)}s.clear();for(const m of a)p.add(m);a.clear();for(const m of i)p.add(m);i.clear();for(const m of p)h(m);s.size&&c(t,e)}while(s.size||a.size||i.size);if(d.length)throw new AggregateError(d)},S9=(t,e)=>{const n=t[1],r=t[2],s=t[3],i=t[11],a=t[14],u=t[17];if(!s.size)return;const c=[],d=[],h=new WeakSet,p=new WeakSet,m=[],_=[];for(const w of s)m.push(w),_.push(i(t,e,w));for(;m.length;){const w=m.length-1,y=m[w],x=_[w];if(p.has(y)){m.pop(),_.pop();continue}if(h.has(y)){if(r.get(y)===x.n)c.push(y),d.push(x);else if((Qi?"production":void 0)!=="production"&&r.has(y))throw new Error("[Bug] invalidated atom exists");p.add(y),m.pop(),_.pop();continue}h.add(y);for(const S of n3(y,x,n))h.has(S)||(m.push(S),_.push(i(t,e,S)))}for(let w=c.length-1;w>=0;--w){const y=c[w],x=d[w];let S=!1;for(const P of x.d.keys())if(P!==y&&s.has(P)){S=!0;break}S&&(r.set(y,x.n),a(t,e,y),u(t,e,y)),r.delete(y)}},Xy=new WeakSet,E9=(t,e,n)=>{var r,s;const i=t[1],a=t[2],u=t[3],c=t[6],d=t[7],h=t[11],p=t[12],m=t[13],_=t[14],w=t[16],y=t[17],x=t[20],S=t[26],P=t[28],T=h(t,e,n),k=P[0];if(DC(T)){if(i.has(n)&&a.get(n)!==T.n||T.m===k)return T.m=k,T;let W=!1;for(const[q,Z]of T.d)if(_(t,e,q).n!==Z){W=!0;break}if(!W)return T.m=k,T}let R=!0;const M=new Set(T.d.keys()),L=()=>{for(const W of M)T.d.delete(W)},A=()=>{if(i.has(n)){const W=!u.size;y(t,e,n),W&&(m(t,e),p(t,e))}},O=W=>{var q;if(W===n){const V=h(t,e,W);if(!DC(V))if(e3(W))x(t,e,W,W.init);else throw new Error("no atom init");return Rm(V)}const Z=_(t,e,W);try{return Rm(Z)}finally{M.delete(W),T.d.set(W,Z.n),Am(T.v)&&t3(n,T.v,Z),i.has(n)&&((q=i.get(W))==null||q.t.add(n)),R||A()}};let D,N;const j={get signal(){return D||(D=new AbortController),D.signal},get setSelf(){return(Qi?"production":void 0)!=="production"&&console.warn("[DEPRECATED] setSelf is deprecated and will be removed in v3."),(Qi?"production":void 0)!=="production"&&!Yy(n)&&console.warn("setSelf function cannot be used with read-only atom"),!N&&Yy(n)&&(N=(...W)=>{if((Qi?"production":void 0)!=="production"&&R&&console.warn("setSelf function cannot be called in sync"),!R)try{return w(t,e,n,W)}finally{m(t,e),p(t,e)}}),N}},G=T.n,Y=a.get(n)===G;try{(Qi?"production":void 0)!=="production"&&Xy.delete(e);const W=d(t,e,n,O,j);if((Qi?"production":void 0)!=="production"&&Xy.has(e)&&console.warn("Detected store mutation during atom read. This is not supported."),x(t,e,n,W),Am(W)){S(t,e,W,()=>D==null?void 0:D.abort());const q=()=>{L(),A()};W.then(q,q)}else L();return(r=c.r)==null||r.call(c,n),T.m=k,T}catch(W){if(m9(W))throw W;return delete T.v,T.e=W,++T.n,T.m=k,T}finally{R=!1,T.n!==G&&Y&&(a.set(n,T.n),u.add(n),(s=c.c)==null||s.call(c,n))}},C9=(t,e,n)=>{const r=t[1],s=t[2],i=t[11],a=[n];for(;a.length;){const u=a.pop(),c=i(t,e,u);for(const d of n3(u,c,r)){const h=i(t,e,d);s.get(d)!==h.n&&(s.set(d,h.n),a.push(d))}}},k9=(t,e,n,r)=>{const s=t[3],i=t[6],a=t[8],u=t[11],c=t[12],d=t[13],h=t[14],p=t[15],m=t[16],_=t[17],w=t[20],y=t[28];let x=!0;const S=T=>Rm(h(t,e,T)),P=(T,...k)=>{var R;const M=u(t,e,T);try{if(T===n){if(!e3(T))throw new Error("atom not writable");(Qi?"production":void 0)!=="production"&&Xy.add(e);const L=M.n,A=k[0];w(t,e,T,A),_(t,e,T),L!==M.n&&(++y[0],s.add(T),p(t,e,T),(R=i.c)==null||R.call(i,T));return}else return m(t,e,T,k)}finally{x||(d(t,e),c(t,e))}};try{return a(t,e,n,S,P,...r)}finally{x=!1}},P9=(t,e,n)=>{var r;const s=t[1],i=t[3],a=t[6],u=t[11],c=t[15],d=t[18],h=t[19],p=u(t,e,n),m=s.get(n);if(m&&p.d.size>0){for(const[_,w]of p.d)if(!m.d.has(_)){const y=u(t,e,_);d(t,e,_).t.add(n),m.d.add(_),w!==y.n&&(i.add(_),c(t,e,_),(r=a.c)==null||r.call(a,_))}for(const _ of m.d)if(!p.d.has(_)){m.d.delete(_);const w=h(t,e,_);w==null||w.t.delete(n)}}},T9=(t,e,n)=>{var r;const s=t[1],i=t[4],a=t[6],u=t[10],c=t[11],d=t[12],h=t[13],p=t[14],m=t[16],_=t[18],w=c(t,e,n);let y=s.get(n);if(!y){p(t,e,n);for(const x of w.d.keys())_(t,e,x).t.add(n);if(y={l:new Set,d:new Set(w.d.keys()),t:new Set},s.set(n,y),Yy(n)&&p9(n)){const x=()=>{let S=!0;const P=(...T)=>{try{return m(t,e,n,T)}finally{S||(h(t,e),d(t,e))}};try{const T=u(t,e,n,P);T&&(y.u=()=>{S=!0;try{T()}finally{S=!1}})}finally{S=!1}};i.add(x)}(r=a.m)==null||r.call(a,n)}return y},R9=(t,e,n)=>{var r,s;const i=t[1],a=t[5],u=t[6],c=t[11],d=t[19],h=c(t,e,n);let p=i.get(n);if(!p||p.l.size)return p;let m=!1;for(const _ of p.t)if((r=i.get(_))!=null&&r.d.has(n)){m=!0;break}if(!m){p.u&&a.add(p.u),p=void 0,i.delete(n);for(const _ of h.d.keys()){const w=d(t,e,_);w==null||w.t.delete(n)}(s=u.u)==null||s.call(u,n);return}return p},A9=(t,e,n,r)=>{const s=t[11],i=t[27],a=s(t,e,n),u="v"in a,c=a.v;if(Am(r))for(const d of a.d.keys())t3(n,r,s(t,e,d));a.v=r,delete a.e,(!u||!Object.is(c,a.v))&&(++a.n,Am(c)&&i(t,e,c))},I9=(t,e,n)=>{const r=t[14];return Rm(r(t,e,n))},M9=(t,e,n,...r)=>{const s=t[3],i=t[12],a=t[13],u=t[16],c=s.size;try{return u(t,e,n,r)}finally{s.size!==c&&(a(t,e),i(t,e))}},O9=(t,e,n,r)=>{const s=t[12],i=t[13],a=t[18],u=t[19],d=a(t,e,n).l;return d.add(r),i(t,e),s(t,e),()=>{d.delete(r),u(t,e,n),i(t,e),s(t,e)}},L9=(t,e,n,r)=>{const s=t[25];let i=s.get(n);if(!i){i=new Set,s.set(n,i);const a=()=>s.delete(n);n.then(a,a)}i.add(r)},D9=(t,e,n)=>{const s=t[25].get(n);s==null||s.forEach(i=>i())},r3=new WeakMap;function N9(t){const e=r3.get(t);if((Qi?"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 j9(...t){const e={get(a){return r(n,e,a)},set(a,...u){return s(n,e,a,...u)},sub(a,u){return i(n,e,a,u)}},n=[new WeakMap,new WeakMap,new WeakMap,new Set,new Set,new Set,{},v9,y9,_9,w9,x9,b9,S9,E9,C9,k9,P9,T9,R9,A9,I9,M9,O9,void 0,new WeakMap,L9,D9,[0]].map((a,u)=>t[u]||a);r3.set(e,Object.freeze(n));const r=n[21],s=n[22],i=n[23];return e}const s3={};let F9=0;function st(t,e){const n=`atom${++F9}`,r={toString(){return(s3?"production":void 0)!=="production"&&this.debugLabel?n+":"+this.debugLabel:n}};return typeof t=="function"?r.read=t:(r.init=t,r.read=$9,r.write=V9),e&&(r.write=e),r}function $9(t){return t(this)}function V9(t,e,n){return e(this,typeof n=="function"?n(t(this)):n)}function H9(){return j9()}let ld;function z9(){return ld||(ld=H9(),(s3?"production":void 0)!=="production"&&(globalThis.__JOTAI_DEFAULT_STORE__||(globalThis.__JOTAI_DEFAULT_STORE__=ld),globalThis.__JOTAI_DEFAULT_STORE__!==ld&&console.warn("Detected multiple Jotai instances. It may cause unexpected behavior with the default store. https://github.com/pmndrs/jotai/discussions/2044"))),ld}const U9={},B9=v.createContext(void 0);function H2(t){return v.useContext(B9)||z9()}const Qy=t=>typeof(t==null?void 0:t.then)=="function",Jy=t=>{t.status||(t.status="pending",t.then(e=>{t.status="fulfilled",t.value=e},e=>{t.status="rejected",t.reason=e}))},W9=ye.use||(t=>{if(t.status==="pending")throw t;if(t.status==="fulfilled")return t.value;throw t.status==="rejected"?t.reason:(Jy(t),t)}),e1=new WeakMap,NC=(t,e,n)=>{const r=N9(t),s=r[26];let i=e1.get(e);return i||(i=new Promise((a,u)=>{let c=e;const d=m=>_=>{c===m&&a(_)},h=m=>_=>{c===m&&u(_)},p=()=>{try{const m=n();Qy(m)?(e1.set(m,i),c=m,m.then(d(m),h(m)),s(r,t,m,p)):a(m)}catch(m){u(m)}};e.then(d(e),h(e)),s(r,t,e,p)}),e1.set(e,i)),i};function et(t,e){const{delay:n,unstable_promiseStatus:r=!ye.use}={},s=H2(),[[i,a,u],c]=v.useReducer(h=>{const p=s.get(t);return Object.is(h[0],p)&&h[1]===s&&h[2]===t?h:[p,s,t]},void 0,()=>[s.get(t),s,t]);let d=i;if((a!==s||u!==t)&&(c(),d=s.get(t)),v.useEffect(()=>{const h=s.sub(t,()=>{if(r)try{const p=s.get(t);Qy(p)&&Jy(NC(s,p,()=>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(c,n);return}c()});return c(),h},[s,t,n,r]),v.useDebugValue(d),Qy(d)){const h=NC(s,d,()=>s.get(t));return r&&Jy(h),W9(h)}return d}function at(t,e){const n=H2();return v.useCallback((...s)=>{if((U9?"production":void 0)!=="production"&&!("write"in t))throw new Error("not writable atom");return n.set(t,...s)},[n,t])}function i3(t,e){return[et(t),at(t)]}const z2=v.createContext({});function U2(t){const e=v.useRef(null);return e.current===null&&(e.current=t()),e.current}const q9=typeof window<"u",B2=q9?v.useLayoutEffect:v.useEffect,d0=v.createContext(null);function W2(t,e){t.indexOf(e)===-1&&t.push(e)}function Im(t,e){const n=t.indexOf(e);n>-1&&t.splice(n,1)}const mi=(t,e,n)=>n>e?e:n<t?t:n;let f0=()=>{};const la={},o3=t=>/^-?(?:\d+(?:\.\d+)?|\.\d+)$/u.test(t),a3=t=>typeof t=="object"&&t!==null,l3=t=>/^0[^.\s]+$/u.test(t);function u3(t){let e;return()=>(e===void 0&&(e=t()),e)}const Es=t=>t,kf=(...t)=>t.reduce((e,n)=>r=>n(e(r))),Kd=(t,e,n)=>{const r=e-t;return r?(n-t)/r:1};class q2{constructor(){this.subscriptions=[]}add(e){return W2(this.subscriptions,e),()=>Im(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 a=this.subscriptions[i];a&&a(e,n,r)}}getSize(){return this.subscriptions.length}clear(){this.subscriptions.length=0}}const es=t=>t*1e3,ws=t=>t/1e3,c3=(t,e)=>e?t*(1e3/e):0,d3=(t,e,n)=>(((1-3*n+3*e)*t+(3*n-6*e))*t+3*e)*t,G9=1e-7,K9=12;function Z9(t,e,n,r,s){let i,a,u=0;do a=e+(n-e)/2,i=d3(a,r,s)-t,i>0?n=a:e=a;while(Math.abs(i)>G9&&++u<K9);return a}function Pf(t,e,n,r){if(t===e&&n===r)return Es;const s=i=>Z9(i,0,1,t,n);return i=>i===0||i===1?i:d3(s(i),e,r)}const f3=t=>e=>e<=.5?t(2*e)/2:(2-t(2*(1-e)))/2,h3=t=>e=>1-t(1-e),p3=Pf(.33,1.53,.69,.99),G2=h3(p3),m3=f3(G2),g3=t=>t>=1?1:(t*=2)<1?.5*G2(t):.5*(2-Math.pow(2,-10*(t-1))),K2=t=>1-Math.sin(Math.acos(t)),v3=h3(K2),y3=f3(K2),Y9=Pf(.42,0,1,1),X9=Pf(0,0,.58,1),_3=Pf(.42,0,.58,1),Q9=t=>Array.isArray(t)&&typeof t[0]!="number",w3=t=>Array.isArray(t)&&typeof t[0]=="number",J9={linear:Es,easeIn:Y9,easeInOut:_3,easeOut:X9,circIn:K2,circInOut:y3,circOut:v3,backIn:G2,backInOut:m3,backOut:p3,anticipate:g3},ej=t=>typeof t=="string",jC=t=>{if(w3(t)){f0(t.length===4);const[e,n,r,s]=t;return Pf(e,n,r,s)}else if(ej(t))return J9[t];return t},ap=["setup","read","resolveKeyframes","preUpdate","update","preRender","render","postRender"];function tj(t){let e=new Set,n=new Set,r=!1,s=!1;const i=new WeakSet;let a={delta:0,timestamp:0,isProcessing:!1};function u(d){i.has(d)&&(c.schedule(d),t()),d(a)}const c={schedule:(d,h=!1,p=!1)=>{const _=p&&r?e:n;return h&&i.add(d),_.add(d),d},cancel:d=>{n.delete(d),i.delete(d)},process:d=>{if(a=d,r){s=!0;return}r=!0;const h=e;e=n,n=h,e.forEach(u),e.clear(),r=!1,s&&(s=!1,c.process(d))}};return c}const nj=40;function x3(t,e){let n=!1,r=!0;const s={delta:0,timestamp:0,isProcessing:!1},i=()=>n=!0,a=ap.reduce((T,k)=>(T[k]=tj(i),T),{}),{setup:u,read:c,resolveKeyframes:d,preUpdate:h,update:p,preRender:m,render:_,postRender:w}=a,y=()=>{const T=la.useManualTiming,k=T?s.timestamp:performance.now();n=!1,T||(s.delta=r?1e3/60:Math.max(Math.min(k-s.timestamp,nj),1)),s.timestamp=k,s.isProcessing=!0,u.process(s),c.process(s),d.process(s),h.process(s),p.process(s),m.process(s),_.process(s),w.process(s),s.isProcessing=!1,n&&e&&(r=!1,t(y))},x=()=>{n=!0,r=!0,s.isProcessing||t(y)};return{schedule:ap.reduce((T,k)=>{const R=a[k];return T[k]=(M,L=!1,A=!1)=>(n||x(),R.schedule(M,L,A)),T},{}),cancel:T=>{for(let k=0;k<ap.length;k++)a[ap[k]].cancel(T)},state:s,steps:a}}const{schedule:Tt,cancel:ua,state:$n,steps:t1}=x3(typeof requestAnimationFrame<"u"?requestAnimationFrame:Es,!0);let jp;function rj(){jp=void 0}const lr={now:()=>(jp===void 0&&lr.set($n.isProcessing||la.useManualTiming?$n.timestamp:performance.now()),jp),set:t=>{jp=t,queueMicrotask(rj)}},b3=t=>e=>typeof e=="string"&&e.startsWith(t),S3=b3("--"),sj=b3("var(--"),Z2=t=>sj(t)?ij.test(t.split("/*")[0].trim()):!1,ij=/var\(--(?:[\w-]+\s*|[\w-]+\s*,(?:\s*[^)(\s]|\s*\((?:[^)(]|\([^)(]*\))*\))+\s*)\)$/iu;function FC(t){return typeof t!="string"?!1:t.split("/*")[0].includes("var(--")}const fc={test:t=>typeof t=="number",parse:parseFloat,transform:t=>t},Zd={...fc,transform:t=>mi(0,1,t)},lp={...fc,default:1},Ad=t=>Math.round(t*1e5)/1e5,Y2=/-?(?:\d+(?:\.\d+)?|\.\d+)/gu;function oj(t){return t==null}const aj=/^(?:#[\da-f]{3,8}|(?:rgb|hsl)a?\((?:-?[\d.]+%?[,\s]+){2}-?[\d.]+%?\s*(?:[,/]\s*)?(?:\b\d+(?:\.\d+)?|\.\d+)?%?\))$/iu,X2=(t,e)=>n=>!!(typeof n=="string"&&aj.test(n)&&n.startsWith(t)||e&&!oj(n)&&Object.prototype.hasOwnProperty.call(n,e)),E3=(t,e,n)=>r=>{if(typeof r!="string")return r;const[s,i,a,u]=r.match(Y2);return{[t]:parseFloat(s),[e]:parseFloat(i),[n]:parseFloat(a),alpha:u!==void 0?parseFloat(u):1}},lj=t=>mi(0,255,t),n1={...fc,transform:t=>Math.round(lj(t))},ll={test:X2("rgb","red"),parse:E3("red","green","blue"),transform:({red:t,green:e,blue:n,alpha:r=1})=>"rgba("+n1.transform(t)+", "+n1.transform(e)+", "+n1.transform(n)+", "+Ad(Zd.transform(r))+")"};function uj(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 e_={test:X2("#"),parse:uj,transform:ll.transform},Tf=t=>({test:e=>typeof e=="string"&&e.endsWith(t)&&e.split(" ").length===1,parse:parseFloat,transform:e=>`${e}${t}`}),Hi=Tf("deg"),pi=Tf("%"),Le=Tf("px"),cj=Tf("vh"),dj=Tf("vw"),$C={...pi,parse:t=>pi.parse(t)/100,transform:t=>pi.transform(t*100)},Su={test:X2("hsl","hue"),parse:E3("hue","saturation","lightness"),transform:({hue:t,saturation:e,lightness:n,alpha:r=1})=>"hsla("+Math.round(t)+", "+pi.transform(Ad(e))+", "+pi.transform(Ad(n))+", "+Ad(Zd.transform(r))+")"},vn={test:t=>ll.test(t)||e_.test(t)||Su.test(t),parse:t=>ll.test(t)?ll.parse(t):Su.test(t)?Su.parse(t):e_.parse(t),transform:t=>typeof t=="string"?t:t.hasOwnProperty("red")?ll.transform(t):Su.transform(t),getAnimatableNone:t=>{const e=vn.parse(t);return e.alpha=0,vn.transform(e)}},fj=/(?:#[\da-f]{3,8}|(?:rgb|hsl)a?\((?:-?[\d.]+%?[,\s]+){2}-?[\d.]+%?\s*(?:[,/]\s*)?(?:\b\d+(?:\.\d+)?|\.\d+)?%?\))/giu;function hj(t){var e,n;return isNaN(t)&&typeof t=="string"&&(((e=t.match(Y2))==null?void 0:e.length)||0)+(((n=t.match(fj))==null?void 0:n.length)||0)>0}const C3="number",k3="color",pj="var",mj="var(",VC="${}",gj=/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 ic(t){const e=t.toString(),n=[],r={color:[],number:[],var:[]},s=[];let i=0;const u=e.replace(gj,c=>(vn.test(c)?(r.color.push(i),s.push(k3),n.push(vn.parse(c))):c.startsWith(mj)?(r.var.push(i),s.push(pj),n.push(c)):(r.number.push(i),s.push(C3),n.push(parseFloat(c))),++i,VC)).split(VC);return{values:n,split:u,indexes:r,types:s}}function vj(t){return ic(t).values}function P3({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 a=e[i];a===C3?s+=Ad(r[i]):a===k3?s+=vn.transform(r[i]):s+=r[i]}return s}}function yj(t){return P3(ic(t))}const _j=t=>typeof t=="number"?0:vn.test(t)?vn.getAnimatableNone(t):t,wj=(t,e)=>typeof t=="number"?e!=null&&e.trim().endsWith("/")?t:0:_j(t);function xj(t){const e=ic(t);return P3(e)(e.values.map((r,s)=>wj(r,e.split[s])))}const zs={test:hj,parse:vj,createTransformer:yj,getAnimatableNone:xj};function r1(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 bj({hue:t,saturation:e,lightness:n,alpha:r}){t/=360,e/=100,n/=100;let s=0,i=0,a=0;if(!e)s=i=a=n;else{const u=n<.5?n*(1+e):n+e-n*e,c=2*n-u;s=r1(c,u,t+1/3),i=r1(c,u,t),a=r1(c,u,t-1/3)}return{red:Math.round(s*255),green:Math.round(i*255),blue:Math.round(a*255),alpha:r}}function Mm(t,e){return n=>n>0?e:t}const Pt=(t,e,n)=>t+(e-t)*n,s1=(t,e,n)=>{const r=t*t,s=n*(e*e-r)+r;return s<0?0:Math.sqrt(s)},Sj=[e_,ll,Su],Ej=t=>Sj.find(e=>e.test(t));function HC(t){const e=Ej(t);if(!e)return!1;let n=e.parse(t);return e===Su&&(n=bj(n)),n}const zC=(t,e)=>{const n=HC(t),r=HC(e);if(!n||!r)return Mm(t,e);const s={...n};return i=>(s.red=s1(n.red,r.red,i),s.green=s1(n.green,r.green,i),s.blue=s1(n.blue,r.blue,i),s.alpha=Pt(n.alpha,r.alpha,i),ll.transform(s))},t_=new Set(["none","hidden"]);function Cj(t,e){return t_.has(t)?n=>n<=0?t:e:n=>n>=1?e:t}function kj(t,e){return n=>Pt(t,e,n)}function Q2(t){return typeof t=="number"?kj:typeof t=="string"?Z2(t)?Mm:vn.test(t)?zC:Rj:Array.isArray(t)?T3:typeof t=="object"?vn.test(t)?zC:Pj:Mm}function T3(t,e){const n=[...t],r=n.length,s=t.map((i,a)=>Q2(i)(i,e[a]));return i=>{for(let a=0;a<r;a++)n[a]=s[a](i);return n}}function Pj(t,e){const n={...t,...e},r={};for(const s in n)t[s]!==void 0&&e[s]!==void 0&&(r[s]=Q2(t[s])(t[s],e[s]));return s=>{for(const i in r)n[i]=r[i](s);return n}}function Tj(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],a=t.indexes[i][r[i]],u=t.values[a]??0;n[s]=u,r[i]++}return n}const Rj=(t,e)=>{const n=zs.createTransformer(e),r=ic(t),s=ic(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?t_.has(t)&&!s.values.length||t_.has(e)&&!r.values.length?Cj(t,e):kf(T3(Tj(r,s),s.values),n):Mm(t,e)};function R3(t,e,n){return typeof t=="number"&&typeof e=="number"&&typeof n=="number"?Pt(t,e,n):Q2(t)(t,e)}const Aj=t=>{const e=({timestamp:n})=>t(n);return{start:(n=!0)=>Tt.update(e,n),stop:()=>ua(e),now:()=>$n.isProcessing?$n.timestamp:lr.now()}},A3=(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)})`},Om=2e4;function J2(t){let e=0;const n=50;let r=t.next(e);for(;!r.done&&e<Om;)e+=n,r=t.next(e);return e>=Om?1/0:e}function Ij(t,e=100,n){const r=n({...t,keyframes:[0,e]}),s=Math.min(J2(r),Om);return{type:"keyframes",ease:i=>r.next(s*i).value/e,duration:ws(s)}}const nn={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 n_(t,e){return t*Math.sqrt(1-e*e)}const Mj=12;function Oj(t,e,n){let r=n;for(let s=1;s<Mj;s++)r=r-t(r)/e(r);return r}const i1=.001;function Lj({duration:t=nn.duration,bounce:e=nn.bounce,velocity:n=nn.velocity,mass:r=nn.mass}){let s,i,a=1-e;a=mi(nn.minDamping,nn.maxDamping,a),t=mi(nn.minDuration,nn.maxDuration,ws(t)),a<1?(s=d=>{const h=d*a,p=h*t,m=h-n,_=n_(d,a),w=Math.exp(-p);return i1-m/_*w},i=d=>{const p=d*a*t,m=p*n+n,_=Math.pow(a,2)*Math.pow(d,2)*t,w=Math.exp(-p),y=n_(Math.pow(d,2),a);return(-s(d)+i1>0?-1:1)*((m-_)*w)/y}):(s=d=>{const h=Math.exp(-d*t),p=(d-n)*t+1;return-i1+h*p},i=d=>{const h=Math.exp(-d*t),p=(n-d)*(t*t);return h*p});const u=5/t,c=Oj(s,i,u);if(t=es(t),isNaN(c))return{stiffness:nn.stiffness,damping:nn.damping,duration:t};{const d=Math.pow(c,2)*r;return{stiffness:d,damping:a*2*Math.sqrt(r*d),duration:t}}}const Dj=["duration","bounce"],Nj=["stiffness","damping","mass"];function UC(t,e){return e.some(n=>t[n]!==void 0)}function jj(t){let e={velocity:nn.velocity,stiffness:nn.stiffness,damping:nn.damping,mass:nn.mass,isResolvedFromDuration:!1,...t};if(!UC(t,Nj)&&UC(t,Dj))if(e.velocity=0,t.visualDuration){const n=t.visualDuration,r=2*Math.PI/(n*1.2),s=r*r,i=2*mi(.05,1,1-(t.bounce||0))*Math.sqrt(s);e={...e,mass:nn.mass,stiffness:s,damping:i}}else{const n=Lj({...t,velocity:0});e={...e,...n,mass:nn.mass},e.isResolvedFromDuration=!0}return e}function Lm(t=nn.visualDuration,e=nn.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],a=n.keyframes[n.keyframes.length-1],u={done:!1,value:i},{stiffness:c,damping:d,mass:h,duration:p,velocity:m,isResolvedFromDuration:_}=jj({...n,velocity:-ws(n.velocity||0)}),w=m||0,y=d/(2*Math.sqrt(c*h)),x=a-i,S=ws(Math.sqrt(c/h)),P=Math.abs(x)<5;r||(r=P?nn.restSpeed.granular:nn.restSpeed.default),s||(s=P?nn.restDelta.granular:nn.restDelta.default);let T,k,R,M,L,A;if(y<1)R=n_(S,y),M=(w+y*S*x)/R,T=D=>{const N=Math.exp(-y*S*D);return a-N*(M*Math.sin(R*D)+x*Math.cos(R*D))},L=y*S*M+x*R,A=y*S*x-M*R,k=D=>Math.exp(-y*S*D)*(L*Math.sin(R*D)+A*Math.cos(R*D));else if(y===1){T=N=>a-Math.exp(-S*N)*(x+(w+S*x)*N);const D=w+S*x;k=N=>Math.exp(-S*N)*(S*D*N-w)}else{const D=S*Math.sqrt(y*y-1);T=Y=>{const W=Math.exp(-y*S*Y),q=Math.min(D*Y,300);return a-W*((w+y*S*x)*Math.sinh(q)+D*x*Math.cosh(q))/D};const N=(w+y*S*x)/D,j=y*S*N-x*D,G=y*S*x-N*D;k=Y=>{const W=Math.exp(-y*S*Y),q=Math.min(D*Y,300);return W*(j*Math.sinh(q)+G*Math.cosh(q))}}const O={calculatedDuration:_&&p||null,velocity:D=>es(k(D)),next:D=>{if(!_&&y<1){const j=Math.exp(-y*S*D),G=Math.sin(R*D),Y=Math.cos(R*D),W=a-j*(M*G+x*Y),q=es(j*(L*G+A*Y));return u.done=Math.abs(q)<=r&&Math.abs(a-W)<=s,u.value=u.done?a:W,u}const N=T(D);if(_)u.done=D>=p;else{const j=es(k(D));u.done=Math.abs(j)<=r&&Math.abs(a-N)<=s}return u.value=u.done?a:N,u},toString:()=>{const D=Math.min(J2(O),Om),N=A3(j=>O.next(D*j).value,D,30);return D+"ms "+N},toTransition:()=>{}};return O}Lm.applyToOptions=t=>{const e=Ij(t,100,Lm);return t.ease=e.ease,t.duration=es(e.duration),t.type="keyframes",t};const Fj=5;function I3(t,e,n){const r=Math.max(e-Fj,0);return c3(n-t(r),e-r)}function r_({keyframes:t,velocity:e=0,power:n=.8,timeConstant:r=325,bounceDamping:s=10,bounceStiffness:i=500,modifyTarget:a,min:u,max:c,restDelta:d=.5,restSpeed:h}){const p=t[0],m={done:!1,value:p},_=A=>u!==void 0&&A<u||c!==void 0&&A>c,w=A=>u===void 0?c:c===void 0||Math.abs(u-A)<Math.abs(c-A)?u:c;let y=n*e;const x=p+y,S=a===void 0?x:a(x);S!==x&&(y=S-p);const P=A=>-y*Math.exp(-A/r),T=A=>S+P(A),k=A=>{const O=P(A),D=T(A);m.done=Math.abs(O)<=d,m.value=m.done?S:D};let R,M;const L=A=>{_(m.value)&&(R=A,M=Lm({keyframes:[m.value,w(m.value)],velocity:I3(T,A,m.value),damping:s,stiffness:i,restDelta:d,restSpeed:h}))};return L(0),{calculatedDuration:null,next:A=>{let O=!1;return!M&&R===void 0&&(O=!0,k(A),L(A)),R!==void 0&&A>=R?M.next(A-R):(!O&&k(A),m)}}}function $j(t,e,n){const r=[],s=n||la.mix||R3,i=t.length-1;for(let a=0;a<i;a++){let u=s(t[a],t[a+1]);if(e){const c=Array.isArray(e)?e[a]||Es:e;u=kf(c,u)}r.push(u)}return r}function Vj(t,e,{clamp:n=!0,ease:r,mixer:s}={}){const i=t.length;if(f0(i===e.length),i===1)return()=>e[0];if(i===2&&e[0]===e[1])return()=>e[1];const a=t[0]===t[1];t[0]>t[i-1]&&(t=[...t].reverse(),e=[...e].reverse());const u=$j(e,r,s),c=u.length,d=h=>{if(a&&h<t[0])return e[0];let p=0;if(c>1)for(;p<t.length-2&&!(h<t[p+1]);p++);const m=Kd(t[p],t[p+1],h);return u[p](m)};return n?h=>d(mi(t[0],t[i-1],h)):d}function Hj(t,e){const n=t[t.length-1];for(let r=1;r<=e;r++){const s=Kd(0,e,r);t.push(Pt(n,1,s))}}function zj(t){const e=[0];return Hj(e,t.length-1),e}function Uj(t,e){return t.map(n=>n*e)}function Bj(t,e){return t.map(()=>e||_3).splice(0,t.length-1)}function Id({duration:t=300,keyframes:e,times:n,ease:r="easeInOut"}){const s=Q9(r)?r.map(jC):jC(r),i={done:!1,value:e[0]},a=Uj(n&&n.length===e.length?n:zj(e),t),u=Vj(a,e,{ease:Array.isArray(s)?s:Bj(e,s)});return{calculatedDuration:t,next:c=>(i.value=u(c),i.done=c>=t,i)}}const Wj=t=>t!==null;function h0(t,{repeat:e,repeatType:n="loop"},r,s=1){const i=t.filter(Wj),u=s<0||e&&n!=="loop"&&e%2===1?0:i.length-1;return!u||r===void 0?i[u]:r}const qj={decay:r_,inertia:r_,tween:Id,keyframes:Id,spring:Lm};function M3(t){typeof t.type=="string"&&(t.type=qj[t.type])}class ew{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 Gj=t=>t/100;class Dm extends ew{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!==lr.now()&&this.tick(lr.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;M3(e);const{type:n=Id,repeat:r=0,repeatDelay:s=0,repeatType:i,velocity:a=0}=e;let{keyframes:u}=e;const c=n||Id;c!==Id&&typeof u[0]!="number"&&(this.mixKeyframes=kf(Gj,R3(u[0],u[1])),u=[0,100]);const d=c({...e,keyframes:u});i==="mirror"&&(this.mirroredGenerator=c({...e,keyframes:[...u].reverse(),velocity:-a})),d.calculatedDuration===null&&(d.calculatedDuration=J2(d));const{calculatedDuration:h}=d;this.calculatedDuration=h,this.resolvedDuration=h+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:a,resolvedDuration:u,calculatedDuration:c}=this;if(this.startTime===null)return r.next(0);const{delay:d=0,keyframes:h,repeat:p,repeatType:m,repeatDelay:_,type:w,onUpdate:y,finalKeyframe:x}=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),P=this.playbackSpeed>=0?S<0:S>s;this.currentTime=Math.max(S,0),this.state==="finished"&&this.holdTime===null&&(this.currentTime=s);let T=this.currentTime,k=r;if(p){const A=Math.min(this.currentTime,s)/u;let O=Math.floor(A),D=A%1;!D&&A>=1&&(D=1),D===1&&O--,O=Math.min(O,p+1),!!(O%2)&&(m==="reverse"?(D=1-D,_&&(D-=_/u)):m==="mirror"&&(k=a)),T=mi(0,1,D)*u}let R;P?(this.delayState.value=h[0],R=this.delayState):R=k.next(T),i&&!P&&(R.value=i(R.value));let{done:M}=R;!P&&c!==null&&(M=this.playbackSpeed>=0?this.currentTime>=s:this.currentTime<=0);const L=this.holdTime===null&&(this.state==="finished"||this.state==="running"&&M);return L&&w!==r_&&(R.value=h0(h,this.options,x,this.speed)),y&&y(R.value),L&&this.finish(),R}then(e,n){return this.finished.then(e,n)}get duration(){return ws(this.calculatedDuration)}get iterationDuration(){const{delay:e=0}=this.options||{};return this.duration+ws(e)}get time(){return ws(this.currentTime)}set time(e){e=es(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 I3(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(lr.now()),this.playbackSpeed=e,n&&this.driver&&(this.time=ws(this.currentTime))}play(){var s,i;if(this.isStopped)return;const{driver:e=Aj,startTime:n}=this.options;this.driver||(this.driver=e(a=>this.tick(a))),(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(lr.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 Kj(t){for(let e=1;e<t.length;e++)t[e]??(t[e]=t[e-1])}const ul=t=>t*180/Math.PI,s_=t=>{const e=ul(Math.atan2(t[1],t[0]));return i_(e)},Zj={x:4,y:5,translateX:4,translateY:5,scaleX:0,scaleY:3,scale:t=>(Math.abs(t[0])+Math.abs(t[3]))/2,rotate:s_,rotateZ:s_,skewX:t=>ul(Math.atan(t[1])),skewY:t=>ul(Math.atan(t[2])),skew:t=>(Math.abs(t[1])+Math.abs(t[2]))/2},i_=t=>(t=t%360,t<0&&(t+=360),t),BC=s_,WC=t=>Math.sqrt(t[0]*t[0]+t[1]*t[1]),qC=t=>Math.sqrt(t[4]*t[4]+t[5]*t[5]),Yj={x:12,y:13,z:14,translateX:12,translateY:13,translateZ:14,scaleX:WC,scaleY:qC,scale:t=>(WC(t)+qC(t))/2,rotateX:t=>i_(ul(Math.atan2(t[6],t[5]))),rotateY:t=>i_(ul(Math.atan2(-t[2],t[0]))),rotateZ:BC,rotate:BC,skewX:t=>ul(Math.atan(t[4])),skewY:t=>ul(Math.atan(t[1])),skew:t=>(Math.abs(t[1])+Math.abs(t[4]))/2};function o_(t){return t.includes("scale")?1:0}function a_(t,e){if(!t||t==="none")return o_(e);const n=t.match(/^matrix3d\(([-\d.e\s,]+)\)$/u);let r,s;if(n)r=Yj,s=n;else{const u=t.match(/^matrix\(([-\d.e\s,]+)\)$/u);r=Zj,s=u}if(!s)return o_(e);const i=r[e],a=s[1].split(",").map(Qj);return typeof i=="function"?i(a):a[i]}const Xj=(t,e)=>{const{transform:n="none"}=getComputedStyle(t);return a_(n,e)};function Qj(t){return parseFloat(t.trim())}const hc=["transformPerspective","x","y","z","translateX","translateY","translateZ","scale","scaleX","scaleY","rotate","rotateX","rotateY","rotateZ","skew","skewX","skewY"],pc=new Set([...hc,"pathRotation"]),GC=t=>t===fc||t===Le,Jj=new Set(["x","y","z"]),eF=hc.filter(t=>!Jj.has(t));function tF(t){const e=[];return eF.forEach(n=>{const r=t.getValue(n);r!==void 0&&(e.push([n,r.get()]),r.set(n.startsWith("scale")?1:0))}),e}const Xo={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})=>a_(e,"x"),y:(t,{transform:e})=>a_(e,"y")};Xo.translateX=Xo.x;Xo.translateY=Xo.y;const xl=new Set;let l_=!1,u_=!1,c_=!1;function O3(){if(u_){const t=Array.from(xl).filter(r=>r.needsMeasurement),e=new Set(t.map(r=>r.element)),n=new Map;e.forEach(r=>{const s=tF(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,a])=>{var u;(u=r.getValue(i))==null||u.set(a)})}),t.forEach(r=>r.measureEndState()),t.forEach(r=>{r.suspendedScrollY!==void 0&&window.scrollTo(0,r.suspendedScrollY)})}u_=!1,l_=!1,xl.forEach(t=>t.complete(c_)),xl.clear()}function L3(){xl.forEach(t=>{t.readKeyframes(),t.needsMeasurement&&(u_=!0)})}function nF(){c_=!0,L3(),O3(),c_=!1}class tw{constructor(e,n,r,s,i,a=!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=a}scheduleResolve(){this.state="scheduled",this.isAsync?(xl.add(this),l_||(l_=!0,Tt.read(L3),Tt.resolveKeyframes(O3))):(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(),a=e[e.length-1];if(i!==void 0)e[0]=i;else if(r&&n){const u=r.readValue(n,a);u!=null&&(e[0]=u)}e[0]===void 0&&(e[0]=a),s&&i===void 0&&s.set(e[0])}Kj(e)}setFinalKeyframe(){}measureInitialState(){}renderEndStyles(){}measureEndState(){}complete(e=!1){this.state="complete",this.onComplete(this.unresolvedKeyframes,this.finalKeyframe,e),xl.delete(this)}cancel(){this.state==="scheduled"&&(xl.delete(this),this.state="pending")}resume(){this.state==="pending"&&this.scheduleResolve()}}const rF=t=>t.startsWith("--");function D3(t,e,n){rF(e)?t.style.setProperty(e,n):t.style[e]=n}const sF={};function N3(t,e){const n=u3(t);return()=>sF[e]??n()}const iF=N3(()=>window.ScrollTimeline!==void 0,"scrollTimeline"),j3=N3(()=>{try{document.createElement("div").animate({opacity:0},{easing:"linear(0, 1)"})}catch{return!1}return!0},"linearEasing"),xd=([t,e,n,r])=>`cubic-bezier(${t}, ${e}, ${n}, ${r})`,KC={linear:"linear",ease:"ease",easeIn:"ease-in",easeOut:"ease-out",easeInOut:"ease-in-out",circIn:xd([0,.65,.55,1]),circOut:xd([.55,0,1,.45]),backIn:xd([.31,.01,.66,-.59]),backOut:xd([.33,1.53,.69,.99])};function F3(t,e){if(t)return typeof t=="function"?j3()?A3(t,e):"ease-out":w3(t)?xd(t):Array.isArray(t)?t.map(n=>F3(n,e)||KC.easeOut):KC[t]}function oF(t,e,n,{delay:r=0,duration:s=300,repeat:i=0,repeatType:a="loop",ease:u="easeOut",times:c}={},d=void 0){const h={[e]:n};c&&(h.offset=c);const p=F3(u,s);Array.isArray(p)&&(h.easing=p);const m={delay:r,duration:s,easing:Array.isArray(p)?"linear":p,fill:"both",iterations:i+1,direction:a==="reverse"?"alternate":"normal"};return d&&(m.pseudoElement=d),t.animate(h,m)}function $3(t){return typeof t=="function"&&"applyToOptions"in t}function aF({type:t,...e}){return $3(t)&&j3()?t.applyToOptions(e):(e.duration??(e.duration=300),e.ease??(e.ease="easeOut"),e)}class V3 extends ew{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:a=!1,finalKeyframe:u,onComplete:c}=e;this.isPseudoElement=!!i,this.allowFlatten=a,this.options=e,f0(typeof e.type!="string");const d=aF(e);this.animation=oF(n,r,s,d,i),d.autoplay===!1&&this.animation.pause(),this.animation.onfinish=()=>{if(this.finishedTime=this.time,!i){const h=h0(s,this.options,u,this.speed);this.updateMotionValue&&this.updateMotionValue(h),D3(n,r,h),this.animation.cancel()}c==null||c(),this.notifyFinished()}}play(){this.isStopped||(this.manualStartTime=null,this.animation.play(),this.state==="finished"&&this.updateFinished())}pause(){this.animation.pause()}complete(){var e,n;(n=(e=this.animation).finish)==null||n.call(e)}cancel(){try{this.animation.cancel()}catch{}}stop(){if(this.isStopped)return;this.isStopped=!0;const{state:e}=this;e==="idle"||e==="finished"||(this.updateMotionValue?this.updateMotionValue():this.commitStyles(),this.isPseudoElement||this.cancel())}commitStyles(){var n,r,s;const e=(n=this.options)==null?void 0:n.element;!this.isPseudoElement&&(e!=null&&e.isConnected)&&((s=(r=this.animation).commitStyles)==null||s.call(r))}get duration(){var n,r;const e=((r=(n=this.animation.effect)==null?void 0:n.getComputedTiming)==null?void 0:r.call(n).duration)||0;return ws(Number(e))}get iterationDuration(){const{delay:e=0}=this.options||{};return this.duration+ws(e)}get time(){return ws(Number(this.animation.currentTime)||0)}set time(e){const n=this.finishedTime!==null;this.manualStartTime=null,this.finishedTime=null,this.animation.currentTime=es(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&&iF()?(this.animation.timeline=e,n&&(this.animation.rangeStart=n),r&&(this.animation.rangeEnd=r),Es):s(this)}}const H3={anticipate:g3,backInOut:m3,circInOut:y3};function lF(t){return t in H3}function uF(t){typeof t.ease=="string"&&lF(t.ease)&&(t.ease=H3[t.ease])}const o1=10;class cF extends V3{constructor(e){uF(e),M3(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,...a}=this.options;if(!n)return;if(e!==void 0){n.set(e);return}const u=new Dm({...a,autoplay:!1}),c=Math.max(o1,lr.now()-this.startTime),d=mi(0,o1,c-o1),h=u.sample(c).value,{name:p}=this.options;i&&p&&D3(i,p,h),n.setWithVelocity(u.sample(Math.max(0,c-d)).value,h,d),u.stop()}}const ZC=(t,e)=>e==="zIndex"?!1:!!(typeof t=="number"||Array.isArray(t)||typeof t=="string"&&(zs.test(t)||t==="0")&&!t.startsWith("url("));function dF(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 fF(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],a=ZC(s,e),u=ZC(i,e);return!a||!u?!1:dF(t)||(n==="spring"||$3(n))&&r}function d_(t){t.duration=0,t.type="keyframes"}const z3=new Set(["opacity","clipPath","filter","transform","backgroundColor"]),hF=/^(?:oklch|oklab|lab|lch|color|color-mix|light-dark)\(/;function pF(t){for(let e=0;e<t.length;e++)if(typeof t[e]=="string"&&hF.test(t[e]))return!0;return!1}const mF=new Set(["color","backgroundColor","outlineColor","fill","stroke","borderColor","borderTopColor","borderRightColor","borderBottomColor","borderLeftColor"]),gF=u3(()=>Object.hasOwnProperty.call(Element.prototype,"animate"));function vF(t){var p;const{motionValue:e,name:n,repeatDelay:r,repeatType:s,damping:i,type:a,keyframes:u}=t,c=(p=e==null?void 0:e.owner)==null?void 0:p.current;if(!(c instanceof HTMLElement)&&!(c instanceof SVGElement))return!1;const{onUpdate:d,transformTemplate:h}=e.owner.getProps();return gF()&&n&&(z3.has(n)||mF.has(n)&&pF(u))&&(n!=="transform"||!h)&&!d&&!r&&s!=="mirror"&&i!==0&&a!=="inertia"}const yF=40;class _F extends ew{constructor({autoplay:e=!0,delay:n=0,type:r="keyframes",repeat:s=0,repeatDelay:i=0,repeatType:a="loop",keyframes:u,name:c,motionValue:d,element:h,...p}){var w;super(),this.stop=()=>{var y,x;this._animation&&(this._animation.stop(),(y=this.stopTimeline)==null||y.call(this)),(x=this.keyframeResolver)==null||x.cancel()},this.createdAt=lr.now();const m={autoplay:e,delay:n,type:r,repeat:s,repeatDelay:i,repeatType:a,name:c,motionValue:d,element:h,...p},_=(h==null?void 0:h.KeyframeResolver)||tw;this.keyframeResolver=new _(u,(y,x,S)=>this.onKeyframesResolved(y,x,m,!S),c,d,h),(w=this.keyframeResolver)==null||w.scheduleResolve()}onKeyframesResolved(e,n,r,s){var S,P;this.keyframeResolver=void 0;const{name:i,type:a,velocity:u,delay:c,isHandoff:d,onUpdate:h}=r;this.resolvedAt=lr.now();let p=!0;fF(e,i,a,u)||(p=!1,(la.instantAnimations||!c)&&(h==null||h(h0(e,r,n))),e[0]=e[e.length-1],d_(r),r.repeat=0);const _={startTime:s?this.resolvedAt?this.resolvedAt-this.createdAt>yF?this.resolvedAt:this.createdAt:this.createdAt:void 0,finalKeyframe:n,...r,keyframes:e},w=p&&!d&&vF(_),y=(P=(S=_.motionValue)==null?void 0:S.owner)==null?void 0:P.current;let x;if(w)try{x=new cF({..._,element:y})}catch{x=new Dm(_)}else x=new Dm(_);x.finished.then(()=>{this.notifyFinished()}).catch(Es),this.pendingTimeline&&(this.stopTimeline=x.attachTimeline(this.pendingTimeline),this.pendingTimeline=void 0),this._animation=x}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(),nF()),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 U3(t,e,n,r=0,s=1){const i=Array.from(t).sort((d,h)=>d.sortNodePosition(h)).indexOf(e),a=t.size,u=(a-1)*r;return typeof n=="function"?n(i,a):s===1?i*r:u-i*r}const YC=30,wF=t=>!isNaN(parseFloat(t));class xF{constructor(e,n={}){this.canTrackVelocity=null,this.events={},this.updateAndNotify=r=>{var i;const s=lr.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 a of this.dependents)a.dirty()},this.hasAnimated=!1,this.setCurrent(e),this.owner=n.owner}setCurrent(e){this.current=e,this.updatedAt=lr.now(),this.canTrackVelocity===null&&e!==void 0&&(this.canTrackVelocity=wF(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 q2);const r=this.events[e].add(n);return e==="change"?()=>{r(),Tt.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=lr.now();if(!this.canTrackVelocity||this.prevFrameValue===void 0||e-this.updatedAt>YC)return 0;const n=Math.min(this.updatedAt-this.prevUpdatedAt,YC);return c3(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 oc(t,e){return new xF(t,e)}function B3(t,e){if(t!=null&&t.inherit&&e){const{inherit:n,...r}=t;return{...e,...r}}return t}function nw(t,e){const n=(t==null?void 0:t[e])??(t==null?void 0:t.default)??t;return n!==t?B3(n,t):n}const bF={type:"spring",stiffness:500,damping:25,restSpeed:10},SF=t=>({type:"spring",stiffness:550,damping:t===0?2*Math.sqrt(550):30,restSpeed:10}),EF={type:"keyframes",duration:.8},CF={type:"keyframes",ease:[.25,.1,.35,1],duration:.3},kF=(t,{keyframes:e})=>e.length>2?EF:pc.has(t)?t.startsWith("scale")?SF(e[1]):bF:CF,PF=new Set(["when","delay","delayChildren","staggerChildren","staggerDirection","repeat","repeatType","repeatDelay","from","elapsed"]);function TF(t){for(const e in t)if(!PF.has(e))return!0;return!1}const rw=(t,e,n,r={},s,i)=>a=>{const u=nw(r,t)||{},c=u.delay||r.delay||0;let{elapsed:d=0}=r;d=d-es(c);const h={keyframes:Array.isArray(n)?n:[null,n],ease:"easeOut",velocity:e.getVelocity(),...u,delay:-d,onUpdate:m=>{e.set(m),u.onUpdate&&u.onUpdate(m)},onComplete:()=>{a(),u.onComplete&&u.onComplete()},name:t,motionValue:e,element:i?void 0:s};TF(u)||Object.assign(h,kF(t,h)),h.duration&&(h.duration=es(h.duration)),h.repeatDelay&&(h.repeatDelay=es(h.repeatDelay)),h.from!==void 0&&(h.keyframes[0]=h.from);let p=!1;if((h.type===!1||h.duration===0&&!h.repeatDelay)&&(d_(h),h.delay===0&&(p=!0)),(la.instantAnimations||la.skipAnimations||s!=null&&s.shouldSkipAnimations||u.skipAnimations)&&(p=!0,d_(h),h.delay=0),h.allowFlatten=!u.type&&!u.ease,p&&!i&&e.get()!==void 0){const m=h0(h.keyframes,u);if(m!==void 0){Tt.update(()=>{h.onUpdate(m),h.onComplete()});return}}return u.isSync?new Dm(h):new _F(h)},RF=/^var\(--(?:([\w-]+)|([\w-]+), ?([a-zA-Z\d ()%#.,-]+))\)/u;function AF(t){const e=RF.exec(t);if(!e)return[,];const[,n,r,s]=e;return[`--${n??r}`,s]}function W3(t,e,n=1){const[r,s]=AF(t);if(!r)return;const i=window.getComputedStyle(e).getPropertyValue(r);if(i){const a=i.trim();return o3(a)?parseFloat(a):a}return Z2(s)?W3(s,e,n+1):s}function XC(t){const e=[{},{}];return t==null||t.values.forEach((n,r)=>{e[0][r]=n.get(),e[1][r]=n.getVelocity()}),e}function sw(t,e,n,r){if(typeof e=="function"){const[s,i]=XC(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]=XC(r);e=e(n!==void 0?n:t.custom,s,i)}return e}function bl(t,e,n){const r=t.getProps();return sw(r,e,n!==void 0?n:r.custom,t)}const q3=new Set(["width","height","top","left","right","bottom",...hc]),f_=t=>Array.isArray(t);function IF(t,e,n){t.hasValue(e)?t.getValue(e).set(n):t.addValue(e,oc(n))}function MF(t){return f_(t)?t[t.length-1]||0:t}function OF(t,e){const n=bl(t,e);let{transitionEnd:r={},transition:s={},...i}=n||{};i={...i,...r};for(const a in i){const u=MF(i[a]);IF(t,a,u)}}const Hn=t=>!!(t&&t.getVelocity);function LF(t){return!!(Hn(t)&&t.add)}function h_(t,e){const n=t.getValue("willChange");if(LF(n))return n.add(e);if(!n&&la.WillChange){const r=new la.WillChange("auto");t.addValue("willChange",r),r.add(e)}}function iw(t){return t.replace(/([A-Z])/g,e=>`-${e.toLowerCase()}`)}const DF="framerAppearId",G3="data-"+iw(DF);function K3(t){return t.props[G3]}function NF({protectedKeys:t,needsAnimating:e},n){const r=t.hasOwnProperty(n)&&e[n]!==!0;return e[n]=!1,r}function Z3(t,e,{delay:n=0,transitionOverride:r,type:s}={}){let{transition:i,transitionEnd:a,...u}=e;const c=t.getDefaultTransition();i=i?B3(i,c):c;const d=i==null?void 0:i.reduceMotion,h=i==null?void 0:i.skipAnimations;r&&(i=r);const p=[],m=s&&t.animationState&&t.animationState.getState()[s],_=i==null?void 0:i.path;_&&_.animateVisualElement(t,u,i,n,p);for(const w in u){const y=t.getValue(w,t.latestValues[w]??null),x=u[w];if(x===void 0||m&&NF(m,w))continue;const S={delay:n,...nw(i||{},w)};h&&(S.skipAnimations=!0);const P=y.get();if(P!==void 0&&!y.isAnimating()&&!Array.isArray(x)&&x===P&&!S.velocity){Tt.update(()=>y.set(x));continue}let T=!1;if(window.MotionHandoffAnimation){const M=K3(t);if(M){const L=window.MotionHandoffAnimation(M,w,Tt);L!==null&&(S.startTime=L,T=!0)}}h_(t,w);const k=d??t.shouldReduceMotion;y.start(rw(w,y,x,k&&q3.has(w)?{type:!1}:S,t,T));const R=y.animation;R&&p.push(R)}if(a){const w=()=>Tt.update(()=>{a&&OF(t,a)});p.length?Promise.all(p).then(w):w()}return p}function p_(t,e,n={}){var c;const r=bl(t,e,n.type==="exit"?(c=t.presenceContext)==null?void 0:c.custom:void 0);let{transition:s=t.getDefaultTransition()||{}}=r||{};n.transitionOverride&&(s=n.transitionOverride);const i=r?()=>Promise.all(Z3(t,r,n)):()=>Promise.resolve(),a=t.variantChildren&&t.variantChildren.size?(d=0)=>{const{delayChildren:h=0,staggerChildren:p,staggerDirection:m}=s;return jF(t,e,d,h,p,m,n)}:()=>Promise.resolve(),{when:u}=s;if(u){const[d,h]=u==="beforeChildren"?[i,a]:[a,i];return d().then(()=>h())}else return Promise.all([i(),a(n.delay)])}function jF(t,e,n=0,r=0,s=0,i=1,a){const u=[];for(const c of t.variantChildren)c.notify("AnimationStart",e),u.push(p_(c,e,{...a,delay:n+(typeof r=="function"?0:r)+U3(t.variantChildren,c,r,s,i)}).then(()=>c.notify("AnimationComplete",e)));return Promise.all(u)}function FF(t,e,n={}){t.notify("AnimationStart",e);let r;if(Array.isArray(e)){const s=e.map(i=>p_(t,i,n));r=Promise.all(s)}else if(typeof e=="string")r=p_(t,e,n);else{const s=typeof e=="function"?bl(t,e,n.custom):e;r=Promise.all(Z3(t,s,n))}return r.then(()=>{t.notify("AnimationComplete",e)})}const $F={test:t=>t==="auto",parse:t=>t},Y3=t=>e=>e.test(t),X3=[fc,Le,pi,Hi,dj,cj,$F],QC=t=>X3.find(Y3(t));function VF(t){return typeof t=="number"?t===0:t!==null?t==="none"||t==="0"||l3(t):!0}const HF=new Set(["brightness","contrast","saturate","opacity"]);function zF(t){const[e,n]=t.slice(0,-1).split("(");if(e==="drop-shadow")return t;const[r]=n.match(Y2)||[];if(!r)return t;const s=n.replace(r,"");let i=HF.has(e)?1:0;return r!==n&&(i*=100),e+"("+i+s+")"}const UF=/\b([a-z-]*)\(.*?\)/gu,m_={...zs,getAnimatableNone:t=>{const e=t.match(UF);return e?e.map(zF).join(" "):t}},g_={...zs,getAnimatableNone:t=>{const e=zs.parse(t);return zs.createTransformer(t)(e.map(r=>typeof r=="number"?0:typeof r=="object"?{...r,alpha:1}:r))}},JC={...fc,transform:Math.round},BF={rotate:Hi,pathRotation:Hi,rotateX:Hi,rotateY:Hi,rotateZ:Hi,scale:lp,scaleX:lp,scaleY:lp,scaleZ:lp,skew:Hi,skewX:Hi,skewY:Hi,distance:Le,translateX:Le,translateY:Le,translateZ:Le,x:Le,y:Le,z:Le,perspective:Le,transformPerspective:Le,opacity:Zd,originX:$C,originY:$C,originZ:Le},Nm={borderWidth:Le,borderTopWidth:Le,borderRightWidth:Le,borderBottomWidth:Le,borderLeftWidth:Le,borderRadius:Le,borderTopLeftRadius:Le,borderTopRightRadius:Le,borderBottomRightRadius:Le,borderBottomLeftRadius:Le,width:Le,maxWidth:Le,height:Le,maxHeight:Le,top:Le,right:Le,bottom:Le,left:Le,inset:Le,insetBlock:Le,insetBlockStart:Le,insetBlockEnd:Le,insetInline:Le,insetInlineStart:Le,insetInlineEnd:Le,padding:Le,paddingTop:Le,paddingRight:Le,paddingBottom:Le,paddingLeft:Le,paddingBlock:Le,paddingBlockStart:Le,paddingBlockEnd:Le,paddingInline:Le,paddingInlineStart:Le,paddingInlineEnd:Le,margin:Le,marginTop:Le,marginRight:Le,marginBottom:Le,marginLeft:Le,marginBlock:Le,marginBlockStart:Le,marginBlockEnd:Le,marginInline:Le,marginInlineStart:Le,marginInlineEnd:Le,fontSize:Le,backgroundPositionX:Le,backgroundPositionY:Le,...BF,zIndex:JC,fillOpacity:Zd,strokeOpacity:Zd,numOctaves:JC},WF={...Nm,color:vn,backgroundColor:vn,outlineColor:vn,fill:vn,stroke:vn,borderColor:vn,borderTopColor:vn,borderRightColor:vn,borderBottomColor:vn,borderLeftColor:vn,filter:m_,WebkitFilter:m_,mask:g_,WebkitMask:g_},Q3=t=>WF[t],qF=new Set([m_,g_]);function J3(t,e){let n=Q3(t);return qF.has(n)||(n=zs),n.getAnimatableNone?n.getAnimatableNone(e):void 0}const GF=new Set(["auto","none","0"]);function KF(t,e,n){let r=0,s;for(;r<t.length&&!s;){const i=t[r];typeof i=="string"&&!GF.has(i)&&ic(i).values.length&&(s=t[r]),r++}if(s&&n)for(const i of e)t[i]=J3(n,s)}class ZF extends tw{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 h=0;h<e.length;h++){let p=e[h];if(typeof p=="string"&&(p=p.trim(),Z2(p))){const m=W3(p,n.current);m!==void 0&&(e[h]=m),h===e.length-1&&(this.finalKeyframe=p)}}if(this.resolveNoneKeyframes(),!q3.has(r)||e.length!==2)return;const[s,i]=e,a=QC(s),u=QC(i),c=FC(s),d=FC(i);if(c!==d&&Xo[r]){this.needsMeasurement=!0;return}if(a!==u)if(GC(a)&&GC(u))for(let h=0;h<e.length;h++){const p=e[h];typeof p=="string"&&(e[h]=parseFloat(p))}else Xo[r]&&(this.needsMeasurement=!0)}resolveNoneKeyframes(){const{unresolvedKeyframes:e,name:n}=this,r=[];for(let s=0;s<e.length;s++)(e[s]===null||VF(e[s]))&&r.push(s);r.length&&KF(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=Xo[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 u;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,a=r[i];r[i]=Xo[n](e.measureViewportBox(),window.getComputedStyle(e.current)),a!==null&&this.finalKeyframe===void 0&&(this.finalKeyframe=a),(u=this.removedTransforms)!=null&&u.length&&this.removedTransforms.forEach(([c,d])=>{e.getValue(c).set(d)}),this.resolveNoneKeyframes()}}const ow=["borderTopLeftRadius","borderTopRightRadius","borderBottomRightRadius","borderBottomLeftRadius"];function eT(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 v_=(t,e)=>e&&typeof t=="number"?e.transform(t):t;function Fp(t){return a3(t)&&"offsetHeight"in t&&!("ownerSVGElement"in t)}const{schedule:aw}=x3(queueMicrotask,!1),$s={x:!1,y:!1};function tT(){return $s.x||$s.y}function YF(t){return t==="x"||t==="y"?$s[t]?null:($s[t]=!0,()=>{$s[t]=!1}):$s.x||$s.y?null:($s.x=$s.y=!0,()=>{$s.x=$s.y=!1})}function nT(t,e){const n=eT(t),r=new AbortController,s={passive:!0,...e,signal:r.signal};return[n,s,()=>r.abort()]}function XF(t){return!(t.pointerType==="touch"||tT())}function QF(t,e,n={}){const[r,s,i]=nT(t,n);return r.forEach(a=>{let u=!1,c=!1,d;const h=()=>{a.removeEventListener("pointerleave",w)},p=x=>{d&&(d(x),d=void 0),h()},m=x=>{u=!1,window.removeEventListener("pointerup",m),window.removeEventListener("pointercancel",m),c&&(c=!1,p(x))},_=()=>{u=!0,window.addEventListener("pointerup",m,s),window.addEventListener("pointercancel",m,s)},w=x=>{if(x.pointerType!=="touch"){if(u){c=!0;return}p(x)}},y=x=>{if(!XF(x))return;c=!1;const S=e(a,x);typeof S=="function"&&(d=S,a.addEventListener("pointerleave",w,s))};a.addEventListener("pointerenter",y,s),a.addEventListener("pointerdown",_,s)}),i}const rT=(t,e)=>e?t===e?!0:rT(t,e.parentElement):!1,lw=t=>t.pointerType==="mouse"?typeof t.button!="number"||t.button<=0:t.isPrimary!==!1,JF=new Set(["BUTTON","INPUT","SELECT","TEXTAREA","A"]);function e7(t){return JF.has(t.tagName)||t.isContentEditable===!0}const t7=new Set(["INPUT","SELECT","TEXTAREA"]);function n7(t){return t7.has(t.tagName)||t.isContentEditable===!0}const $p=new WeakSet;function ek(t){return e=>{e.key==="Enter"&&t(e)}}function a1(t,e){t.dispatchEvent(new PointerEvent("pointer"+e,{isPrimary:!0,bubbles:!0}))}const r7=(t,e)=>{const n=t.currentTarget;if(!n)return;const r=ek(()=>{if($p.has(n))return;a1(n,"down");const s=ek(()=>{a1(n,"up")}),i=()=>a1(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 tk(t){return lw(t)&&!tT()}const nk=new WeakSet;function s7(t,e,n={}){const[r,s,i]=nT(t,n),a=u=>{const c=u.currentTarget;if(!tk(u)||nk.has(u))return;$p.add(c),n.stopPropagation&&nk.add(u);const d=e(c,u),h={...s,capture:!0},p=(w,y)=>{window.removeEventListener("pointerup",m,h),window.removeEventListener("pointercancel",_,h),$p.has(c)&&$p.delete(c),tk(w)&&typeof d=="function"&&d(w,{success:y})},m=w=>{p(w,c===window||c===document||n.useGlobalTarget||rT(c,w.target))},_=w=>{p(w,!1)};window.addEventListener("pointerup",m,h),window.addEventListener("pointercancel",_,h)};return r.forEach(u=>{(n.useGlobalTarget?window:u).addEventListener("pointerdown",a,s),Fp(u)&&(u.addEventListener("focus",d=>r7(d,s)),!e7(u)&&!u.hasAttribute("tabindex")&&(u.tabIndex=0))}),i}function uw(t){return a3(t)&&"ownerSVGElement"in t}const Vp=new WeakMap;let zo;const sT=(t,e,n)=>(r,s)=>s&&s[0]?s[0][t+"Size"]:uw(r)&&"getBBox"in r?r.getBBox()[e]:r[n],i7=sT("inline","width","offsetWidth"),o7=sT("block","height","offsetHeight");function a7({target:t,borderBoxSize:e}){var n;(n=Vp.get(t))==null||n.forEach(r=>{r(t,{get width(){return i7(t,e)},get height(){return o7(t,e)}})})}function l7(t){t.forEach(a7)}function u7(){typeof ResizeObserver>"u"||(zo=new ResizeObserver(l7))}function c7(t,e){zo||u7();const n=eT(t);return n.forEach(r=>{let s=Vp.get(r);s||(s=new Set,Vp.set(r,s)),s.add(e),zo==null||zo.observe(r)}),()=>{n.forEach(r=>{const s=Vp.get(r);s==null||s.delete(e),s!=null&&s.size||zo==null||zo.unobserve(r)})}}const Hp=new Set;let Eu;function d7(){Eu=()=>{const t={get width(){return window.innerWidth},get height(){return window.innerHeight}};Hp.forEach(e=>e(t))},window.addEventListener("resize",Eu)}function f7(t){return Hp.add(t),Eu||d7(),()=>{Hp.delete(t),!Hp.size&&typeof Eu=="function"&&(window.removeEventListener("resize",Eu),Eu=void 0)}}function rk(t,e){return typeof t=="function"?f7(t):c7(t,e)}function h7(t){return uw(t)&&t.tagName==="svg"}const p7=[...X3,vn,zs],m7=t=>p7.find(Y3(t)),sk=()=>({translate:0,scale:1,origin:0,originPoint:0}),Cu=()=>({x:sk(),y:sk()}),ik=()=>({min:0,max:0}),En=()=>({x:ik(),y:ik()}),g7=new WeakMap;function p0(t){return t!==null&&typeof t=="object"&&typeof t.start=="function"}function Yd(t){return typeof t=="string"||Array.isArray(t)}const cw=["animate","whileInView","whileFocus","whileHover","whileTap","whileDrag","exit"],dw=["initial",...cw];function m0(t){return p0(t.animate)||dw.some(e=>Yd(t[e]))}function iT(t){return!!(m0(t)||t.variants)}function v7(t,e,n){for(const r in e){const s=e[r],i=n[r];if(Hn(s))t.addValue(r,s);else if(Hn(i))t.addValue(r,oc(s,{owner:t}));else if(i!==s)if(t.hasValue(r)){const a=t.getValue(r);a.liveStyle===!0?a.jump(s):a.hasAnimated||a.set(s)}else{const a=t.getStaticValue(r);t.addValue(r,oc(a!==void 0?a:s,{owner:t}))}}for(const r in n)e[r]===void 0&&t.removeValue(r);return e}const jm={current:null},fw={current:!1},y7=typeof window<"u";function oT(){if(fw.current=!0,!!y7)if(window.matchMedia){const t=window.matchMedia("(prefers-reduced-motion)"),e=()=>jm.current=t.matches;t.addEventListener("change",e),e()}else jm.current=!1}const ok=["AnimationStart","AnimationComplete","Update","BeforeLayoutMeasure","LayoutMeasure","LayoutAnimationStart","LayoutAnimationComplete"];let Fm={};function aT(t){Fm=t}function _7(){return Fm}class w7{scrapeMotionValuesFromProps(e,n,r){return{}}constructor({parent:e,props:n,presenceContext:r,reducedMotionConfig:s,skipAnimations:i,blockInitialAnimation:a,visualState:u},c={}){this.current=null,this.children=new Set,this.isVariantNode=!1,this.isControllingVariants=!1,this.shouldReduceMotion=null,this.shouldSkipAnimations=!1,this.values=new Map,this.KeyframeResolver=tw,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 _=lr.now();this.renderScheduledAt<_&&(this.renderScheduledAt=_,Tt.render(this.render,!1,!0))};const{latestValues:d,renderState:h}=u;this.latestValues=d,this.baseTarget={...d},this.initialValues=n.initial?{...d}:{},this.renderState=h,this.parent=e,this.props=n,this.presenceContext=r,this.depth=e?e.depth+1:0,this.reducedMotionConfig=s,this.skipAnimationsConfig=i,this.options=c,this.blockInitialAnimation=!!a,this.isControllingVariants=m0(n),this.isVariantNode=iT(n),this.isVariantNode&&(this.variantChildren=new Set),this.manuallyAnimateOnMount=!!(e&&e.current);const{willChange:p,...m}=this.scrapeMotionValuesFromProps(n,{},this);for(const _ in m){const w=m[_];d[_]!==void 0&&Hn(w)&&w.set(d[_])}}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,g7.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:(fw.current||oT(),this.shouldReduceMotion=jm.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(),ua(this.notifyUpdate),ua(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&&z3.has(e)&&this.current instanceof HTMLElement){const{factory:a,keyframes:u,times:c,ease:d,duration:h}=n.accelerate,p=new V3({element:this.current,name:e,keyframes:u,times:c,ease:d,duration:es(h)}),m=a(p);this.valueSubscriptions.set(e,()=>{m(),p.cancel()});return}const r=pc.has(e);r&&this.onBindTransform&&this.onBindTransform();const s=n.on("change",a=>{this.latestValues[e]=a,this.props.onUpdate&&Tt.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 Fm){const n=Fm[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):En()}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<ok.length;r++){const s=ok[r];this.propEventSubscriptions[s]&&(this.propEventSubscriptions[s](),delete this.propEventSubscriptions[s]);const i="on"+s,a=e[i];a&&(this.propEventSubscriptions[s]=this.on(s,a))}this.prevMotionValues=v7(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=oc(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"&&(o3(r)||l3(r))?r=parseFloat(r):!m7(r)&&zs.test(n)&&(r=J3(e,n)),this.setBaseTarget(e,Hn(r)?r.get():r)),Hn(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 a=sw(this.props,n,(i=this.presenceContext)==null?void 0:i.custom);a&&(r=a[e])}if(n&&r!==void 0)return r;const s=this.getBaseTargetFromProps(this.props,e);return s!==void 0&&!Hn(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 q2),this.events[e].add(n)}notify(e,...n){this.events[e]&&this.events[e].notify(...n)}scheduleRenderMicrotask(){aw.render(this.render)}}class lT extends w7{constructor(){super(...arguments),this.KeyframeResolver=ZF}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;Hn(e)&&(this.childSubscription=e.on("change",n=>{this.current&&(this.current.textContent=`${n}`)}))}}class ga{constructor(e){this.isMounted=!1,this.node=e}update(){}}function uT({top:t,left:e,right:n,bottom:r}){return{x:{min:e,max:n},y:{min:t,max:r}}}function x7({x:t,y:e}){return{top:e.min,right:t.max,bottom:e.max,left:t.min}}function b7(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 l1(t){return t===void 0||t===1}function y_({scale:t,scaleX:e,scaleY:n}){return!l1(t)||!l1(e)||!l1(n)}function rl(t){return y_(t)||cT(t)||t.z||t.rotate||t.rotateX||t.rotateY||t.skewX||t.skewY}function cT(t){return ak(t.x)||ak(t.y)}function ak(t){return t&&t!=="0%"}function $m(t,e,n){const r=t-n,s=e*r;return n+s}function lk(t,e,n,r,s){return s!==void 0&&(t=$m(t,s,r)),$m(t,n,r)+e}function __(t,e=0,n=1,r,s){t.min=lk(t.min,e,n,r,s),t.max=lk(t.max,e,n,r,s)}function dT(t,{x:e,y:n}){__(t.x,e.translate,e.scale,e.originPoint),__(t.y,n.translate,n.scale,n.originPoint)}const uk=.999999999999,ck=1.0000000000001;function S7(t,e,n,r=!1){var u;const s=n.length;if(!s)return;e.x=e.y=1;let i,a;for(let c=0;c<s;c++){i=n[c],a=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&&(li(t.x,-i.scroll.offset.x),li(t.y,-i.scroll.offset.y)),a&&(e.x*=a.x.scale,e.y*=a.y.scale,dT(t,a)),r&&rl(i.latestValues)&&zp(t,i.latestValues,(u=i.layout)==null?void 0:u.layoutBox))}e.x<ck&&e.x>uk&&(e.x=1),e.y<ck&&e.y>uk&&(e.y=1)}function li(t,e){t.min+=e,t.max+=e}function dk(t,e,n,r,s=.5){const i=Pt(t.min,t.max,s);__(t,e,n,i,r)}function fk(t,e){return typeof t=="string"?parseFloat(t)/100*(e.max-e.min):t}function zp(t,e,n){const r=n??t;dk(t.x,fk(e.x,r.x),e.scaleX,e.scale,e.originX),dk(t.y,fk(e.y,r.y),e.scaleY,e.scale,e.originY)}function fT(t,e){return uT(b7(t.getBoundingClientRect(),e))}function E7(t,e,n){const r=fT(t,n),{scroll:s}=e;return s&&(li(r.x,s.offset.x),li(r.y,s.offset.y)),r}const C7={x:"translateX",y:"translateY",z:"translateZ",transformPerspective:"perspective"},k7=hc.length;function P7(t,e,n){let r="",s=!0;for(let a=0;a<k7;a++){const u=hc[a],c=t[u];if(c===void 0)continue;let d=!0;if(typeof c=="number")d=c===(u.startsWith("scale")?1:0);else{const h=parseFloat(c);d=u.startsWith("scale")?h===1:h===0}if(!d||n){const h=v_(c,Nm[u]);if(!d){s=!1;const p=C7[u]||u;r+=`${p}(${h}) `}n&&(e[u]=h)}}const i=t.pathRotation;return i&&(s=!1,r+=`rotate(${v_(i,Nm.pathRotation)}) `),r=r.trim(),n?r=n(e,s?"":r):s&&(r="none"),r}function hw(t,e,n){const{style:r,vars:s,transformOrigin:i}=t;let a=!1,u=!1;for(const c in e){const d=e[c];if(pc.has(c)){a=!0;continue}else if(S3(c)){s[c]=d;continue}else{const h=v_(d,Nm[c]);c.startsWith("origin")?(u=!0,i[c]=h):r[c]=h}}if(e.transform||(a||n?r.transform=P7(e,t.transform,n):r.transform&&(r.transform="none")),u){const{originX:c="50%",originY:d="50%",originZ:h=0}=i;r.transformOrigin=`${c} ${d} ${h}`}}function hT(t,{style:e,vars:n},r,s){const i=t.style;let a;for(a in e)i[a]=e[a];s==null||s.applyProjectionStyles(i,r);for(a in n)i.setProperty(a,n[a])}function hk(t,e){return e.max===e.min?0:t/(e.max-e.min)*100}const ud={correct:(t,e)=>{if(!e.target)return t;if(typeof t=="string")if(Le.test(t))t=parseFloat(t);else return t;const n=hk(t,e.target.x),r=hk(t,e.target.y);return`${n}% ${r}%`}},T7={correct:(t,{treeScale:e,projectionDelta:n})=>{const r=t,s=zs.parse(t);if(s.length>5)return r;const i=zs.createTransformer(t),a=typeof s[0]!="number"?1:0,u=n.x.scale*e.x,c=n.y.scale*e.y;s[0+a]/=u,s[1+a]/=c;const d=Pt(u,c,.5);return typeof s[2+a]=="number"&&(s[2+a]/=d),typeof s[3+a]=="number"&&(s[3+a]/=d),i(s)}},w_={borderRadius:{...ud,applyTo:[...ow]},borderTopLeftRadius:ud,borderTopRightRadius:ud,borderBottomLeftRadius:ud,borderBottomRightRadius:ud,boxShadow:T7};function pT(t,{layout:e,layoutId:n}){return pc.has(t)||t.startsWith("origin")||(e||n!==void 0)&&(!!w_[t]||t==="opacity")}function pw(t,e,n){var a;const r=t.style,s=e==null?void 0:e.style,i={};if(!r)return i;for(const u in r)(Hn(r[u])||s&&Hn(s[u])||pT(u,t)||((a=n==null?void 0:n.getValue(u))==null?void 0:a.liveStyle)!==void 0)&&(i[u]=r[u]);return i}function R7(t){return window.getComputedStyle(t)}class A7 extends lT{constructor(){super(...arguments),this.type="html",this.renderInstance=hT}mount(e){f0(!!e.style),super.mount(e)}readValueFromInstance(e,n){var r;if(pc.has(n))return(r=this.projection)!=null&&r.isProjecting?o_(n):Xj(e,n);{const s=R7(e),i=(S3(n)?s.getPropertyValue(n):s[n])||0;return typeof i=="string"?i.trim():i}}measureInstanceViewportBox(e,{transformPagePoint:n}){return fT(e,n)}build(e,n,r){hw(e,n,r.transformTemplate)}scrapeMotionValuesFromProps(e,n,r){return pw(e,n,r)}}const I7={offset:"stroke-dashoffset",array:"stroke-dasharray"},M7={offset:"strokeDashoffset",array:"strokeDasharray"};function O7(t,e,n=1,r=0,s=!0){t.pathLength=1;const i=s?I7:M7;t[i.offset]=`${-r}`,t[i.array]=`${e} ${n}`}const L7=["offsetDistance","offsetPath","offsetRotate","offsetAnchor"];function mT(t,{attrX:e,attrY:n,attrScale:r,pathLength:s,pathSpacing:i=1,pathOffset:a=0,...u},c,d,h){if(hw(t,u,d),c){t.style.viewBox&&(t.attrs.viewBox=t.style.viewBox);return}t.attrs=t.style,t.style={};const{attrs:p,style:m}=t;p.transform&&(m.transform=p.transform,delete p.transform),(m.transform||p.transformOrigin)&&(m.transformOrigin=p.transformOrigin??"50% 50%",delete p.transformOrigin),m.transform&&(m.transformBox=(h==null?void 0:h.transformBox)??"fill-box",delete p.transformBox);for(const _ of L7)p[_]!==void 0&&(m[_]=p[_],delete p[_]);e!==void 0&&(p.x=e),n!==void 0&&(p.y=n),r!==void 0&&(p.scale=r),s!==void 0&&O7(p,s,i,a,!1)}const gT=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"]),vT=t=>typeof t=="string"&&t.toLowerCase()==="svg";function D7(t,e,n,r){hT(t,e,void 0,r);for(const s in e.attrs)t.setAttribute(gT.has(s)?s:iw(s),e.attrs[s])}function yT(t,e,n){const r=pw(t,e,n);for(const s in t)if(Hn(t[s])||Hn(e[s])){const i=hc.indexOf(s)!==-1?"attr"+s.charAt(0).toUpperCase()+s.substring(1):s;r[i]=t[s]}return r}class N7 extends lT{constructor(){super(...arguments),this.type="svg",this.isSVGTag=!1,this.measureInstanceViewportBox=En}getBaseTargetFromProps(e,n){return e[n]}readValueFromInstance(e,n){if(pc.has(n)){const r=Q3(n);return r&&r.default||0}return n=gT.has(n)?n:iw(n),e.getAttribute(n)}scrapeMotionValuesFromProps(e,n,r){return yT(e,n,r)}build(e,n,r){mT(e,n,this.isSVGTag,r.transformTemplate,r.style)}renderInstance(e,n,r,s){D7(e,n,r,s)}mount(e){this.isSVGTag=vT(e.tagName),super.mount(e)}}const j7=dw.length;function _T(t){if(!t)return;if(!t.isControllingVariants){const n=t.parent?_T(t.parent)||{}:{};return t.props.initial!==void 0&&(n.initial=t.props.initial),n}const e={};for(let n=0;n<j7;n++){const r=dw[n],s=t.props[r];(Yd(s)||s===!1)&&(e[r]=s)}return e}function wT(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 F7=[...cw].reverse(),$7=cw.length;function V7(t){return e=>Promise.all(e.map(({animation:n,options:r})=>FF(t,n,r)))}function H7(t){let e=V7(t),n=pk(),r=!0,s=!1;const i=d=>(h,p)=>{var _;const m=bl(t,p,d==="exit"?(_=t.presenceContext)==null?void 0:_.custom:void 0);if(m){const{transition:w,transitionEnd:y,...x}=m;h={...h,...x,...y}}return h};function a(d){e=d(t)}function u(d){const{props:h}=t,p=_T(t.parent)||{},m=[],_=new Set;let w={},y=1/0;for(let S=0;S<$7;S++){const P=F7[S],T=n[P],k=h[P]!==void 0?h[P]:p[P],R=Yd(k),M=P===d?T.isActive:null;M===!1&&(y=S);let L=k===p[P]&&k!==h[P]&&R;if(L&&(r||s)&&t.manuallyAnimateOnMount&&(L=!1),T.protectedKeys={...w},!T.isActive&&M===null||!k&&!T.prevProp||p0(k)||typeof k=="boolean")continue;if(P==="exit"&&T.isActive&&M!==!0){T.prevResolvedValues&&(w={...w,...T.prevResolvedValues});continue}const A=z7(T.prevProp,k);let O=A||P===d&&T.isActive&&!L&&R||S>y&&R,D=!1;const N=Array.isArray(k)?k:[k];let j=N.reduce(i(P),{});M===!1&&(j={});const{prevResolvedValues:G={}}=T,Y={...G,...j},W=V=>{O=!0,_.has(V)&&(D=!0,_.delete(V)),T.needsAnimating[V]=!0;const J=t.getValue(V);J&&(J.liveStyle=!1)};for(const V in Y){const J=j[V],H=G[V];if(w.hasOwnProperty(V))continue;let F=!1;f_(J)&&f_(H)?F=!wT(J,H)||A:F=J!==H,F?J!=null?W(V):_.add(V):J!==void 0&&_.has(V)?W(V):T.protectedKeys[V]=!0}T.prevProp=k,T.prevResolvedValues=j,T.isActive&&(w={...w,...j}),(r||s)&&t.blockInitialAnimation&&(O=!1);const q=L&&A;O&&(!q||D)&&m.push(...N.map(V=>{const J={type:P};if(typeof V=="string"&&(r||s)&&!q&&t.manuallyAnimateOnMount&&t.parent){const{parent:H}=t,F=bl(H,V);if(H.enteringChildren&&F){const{delayChildren:X}=F.transition||{};J.delay=U3(H.enteringChildren,t,X)}}return{animation:V,options:J}}))}if(_.size){const S={};if(typeof h.initial!="boolean"){const P=bl(t,Array.isArray(h.initial)?h.initial[0]:h.initial);P&&P.transition&&(S.transition=P.transition)}_.forEach(P=>{const T=t.getBaseTarget(P),k=t.getValue(P);k&&(k.liveStyle=!0),S[P]=T??null}),m.push({animation:S})}let x=!!m.length;return r&&(h.initial===!1||h.initial===h.animate)&&!t.manuallyAnimateOnMount&&(x=!1),r=!1,s=!1,x?e(m):Promise.resolve()}function c(d,h){var m;if(n[d].isActive===h)return Promise.resolve();(m=t.variantChildren)==null||m.forEach(_=>{var w;return(w=_.animationState)==null?void 0:w.setActive(d,h)}),n[d].isActive=h;const p=u(d);for(const _ in n)n[_].protectedKeys={};return p}return{animateChanges:u,setActive:c,setAnimateFunction:a,getState:()=>n,reset:()=>{n=pk(),s=!0}}}function z7(t,e){return typeof e=="string"?e!==t:Array.isArray(e)?!wT(e,t):!1}function Ba(t=!1){return{isActive:t,protectedKeys:{},needsAnimating:{},prevResolvedValues:{}}}function pk(){return{animate:Ba(!0),whileInView:Ba(),whileHover:Ba(),whileTap:Ba(),whileDrag:Ba(),whileFocus:Ba(),exit:Ba()}}function x_(t,e){t.min=e.min,t.max=e.max}function js(t,e){x_(t.x,e.x),x_(t.y,e.y)}function mk(t,e){t.translate=e.translate,t.scale=e.scale,t.originPoint=e.originPoint,t.origin=e.origin}const xT=1e-4,U7=1-xT,B7=1+xT,bT=.01,W7=0-bT,q7=0+bT;function ur(t){return t.max-t.min}function G7(t,e,n){return Math.abs(t-e)<=n}function gk(t,e,n,r=.5){t.origin=r,t.originPoint=Pt(e.min,e.max,t.origin),t.scale=ur(n)/ur(e),t.translate=Pt(n.min,n.max,t.origin)-t.originPoint,(t.scale>=U7&&t.scale<=B7||isNaN(t.scale))&&(t.scale=1),(t.translate>=W7&&t.translate<=q7||isNaN(t.translate))&&(t.translate=0)}function Md(t,e,n,r){gk(t.x,e.x,n.x,r?r.originX:void 0),gk(t.y,e.y,n.y,r?r.originY:void 0)}function vk(t,e,n,r=0){const s=r?Pt(n.min,n.max,r):n.min;t.min=s+e.min,t.max=t.min+ur(e)}function K7(t,e,n,r){vk(t.x,e.x,n.x,r==null?void 0:r.x),vk(t.y,e.y,n.y,r==null?void 0:r.y)}function yk(t,e,n,r=0){const s=r?Pt(n.min,n.max,r):n.min;t.min=e.min-s,t.max=t.min+ur(e)}function Vm(t,e,n,r){yk(t.x,e.x,n.x,r==null?void 0:r.x),yk(t.y,e.y,n.y,r==null?void 0:r.y)}function _k(t,e,n,r,s){return t-=e,t=$m(t,1/n,r),s!==void 0&&(t=$m(t,1/s,r)),t}function Z7(t,e=0,n=1,r=.5,s,i=t,a=t){if(pi.test(e)&&(e=parseFloat(e),e=Pt(a.min,a.max,e/100)-a.min),typeof e!="number")return;let u=Pt(i.min,i.max,r);t===i&&(u-=e),t.min=_k(t.min,e,n,u,s),t.max=_k(t.max,e,n,u,s)}function wk(t,e,[n,r,s],i,a){Z7(t,e[n],e[r],e[s],e.scale,i,a)}const Y7=["x","scaleX","originX"],X7=["y","scaleY","originY"];function xk(t,e,n,r){wk(t.x,e,Y7,n?n.x:void 0,r?r.x:void 0),wk(t.y,e,X7,n?n.y:void 0,r?r.y:void 0)}function bk(t){return t.translate===0&&t.scale===1}function ST(t){return bk(t.x)&&bk(t.y)}function Sk(t,e){return t.min===e.min&&t.max===e.max}function Q7(t,e){return Sk(t.x,e.x)&&Sk(t.y,e.y)}function Ek(t,e){return Math.round(t.min)===Math.round(e.min)&&Math.round(t.max)===Math.round(e.max)}function ET(t,e){return Ek(t.x,e.x)&&Ek(t.y,e.y)}function Ck(t){return ur(t.x)/ur(t.y)}function kk(t,e){return t.translate===e.translate&&t.scale===e.scale&&t.originPoint===e.originPoint}function ri(t){return[t("x"),t("y")]}function J7(t,e,n){let r="";const s=t.x.translate/e.x,i=t.y.translate/e.y,a=(n==null?void 0:n.z)||0;if((s||i||a)&&(r=`translate3d(${s}px, ${i}px, ${a}px) `),(e.x!==1||e.y!==1)&&(r+=`scale(${1/e.x}, ${1/e.y}) `),n){const{transformPerspective:d,rotate:h,pathRotation:p,rotateX:m,rotateY:_,skewX:w,skewY:y}=n;d&&(r=`perspective(${d}px) ${r}`),h&&(r+=`rotate(${h}deg) `),p&&(r+=`rotate(${p}deg) `),m&&(r+=`rotateX(${m}deg) `),_&&(r+=`rotateY(${_}deg) `),w&&(r+=`skewX(${w}deg) `),y&&(r+=`skewY(${y}deg) `)}const u=t.x.scale*e.x,c=t.y.scale*e.y;return(u!==1||c!==1)&&(r+=`scale(${u}, ${c})`),r||"none"}const e$=ow.length,Pk=t=>typeof t=="string"?parseFloat(t):t,Tk=t=>typeof t=="number"||Le.test(t);function t$(t,e,n,r,s,i){s?(t.opacity=Pt(0,n.opacity??1,n$(r)),t.opacityExit=Pt(e.opacity??1,0,r$(r))):i&&(t.opacity=Pt(e.opacity??1,n.opacity??1,r));for(let a=0;a<e$;a++){const u=ow[a];let c=Rk(e,u),d=Rk(n,u);if(c===void 0&&d===void 0)continue;c||(c=0),d||(d=0),c===0||d===0||Tk(c)===Tk(d)?(t[u]=Math.max(Pt(Pk(c),Pk(d),r),0),(pi.test(d)||pi.test(c))&&(t[u]+="%")):t[u]=d}(e.rotate||n.rotate)&&(t.rotate=Pt(e.rotate||0,n.rotate||0,r))}function Rk(t,e){return t[e]!==void 0?t[e]:t.borderRadius}const n$=CT(0,.5,v3),r$=CT(.5,.95,Es);function CT(t,e,n){return r=>r<t?0:r>e?1:n(Kd(t,e,r))}function s$(t,e,n){const r=Hn(t)?t:oc(t);return r.start(rw("",r,e,n)),r.animation}function Xd(t,e,n,r={passive:!0}){return t.addEventListener(e,n,r),()=>t.removeEventListener(e,n,r)}const i$=(t,e)=>t.depth-e.depth;class o${constructor(){this.children=[],this.isDirty=!1}add(e){W2(this.children,e),this.isDirty=!0}remove(e){Im(this.children,e),this.isDirty=!0}forEach(e){this.isDirty&&this.children.sort(i$),this.isDirty=!1,this.children.forEach(e)}}function a$(t,e){const n=lr.now(),r=({timestamp:s})=>{const i=s-n;i>=e&&(ua(r),t(i-e))};return Tt.setup(r,!0),()=>ua(r)}function Up(t){return Hn(t)?t.get():t}class l${constructor(){this.members=[]}add(e){W2(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&&(Im(this.members,r),r.unmount())}e.scheduleRender()}remove(e){if(Im(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:a}=e.options;(i===void 0||i!==a)&&(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,a;(r=(n=e.options).onExitComplete)==null||r.call(n),(a=(s=e.resumingFrom)==null?void 0:(i=s.options).onExitComplete)==null||a.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 Bp={hasAnimatedSinceResize:!0,hasEverUpdated:!1},u1=["","X","Y","Z"],u$=1e3;let c$=0;function c1(t,e,n,r){const{latestValues:s}=e;s[t]&&(n[t]=s[t],e.setStaticValue(t,0),r&&(r[t]=0))}function kT(t){if(t.hasCheckedOptimisedAppear=!0,t.root===t)return;const{visualElement:e}=t.options;if(!e)return;const n=K3(e);if(window.MotionHasOptimisedAnimation(n,"transform")){const{layout:s,layoutId:i}=t.options;window.MotionCancelOptimisedAnimation(n,"transform",Tt,!(s||i))}const{parent:r}=t;r&&!r.hasCheckedOptimisedAppear&&kT(r)}function PT({attachResizeListener:t,defaultParent:e,measureScroll:n,checkIsScrollRoot:r,resetTransform:s}){return class{constructor(a={},u=e==null?void 0:e()){this.id=c$++,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(h$),this.nodes.forEach(_$),this.nodes.forEach(w$),this.nodes.forEach(p$)},this.resolvedRelativeTargetAt=0,this.linkedParentVersion=0,this.hasProjected=!1,this.isVisible=!0,this.animationProgress=0,this.sharedNodes=new Map,this.latestValues=a,this.root=u?u.root||u:this,this.path=u?[...u.path,u]:[],this.parent=u,this.depth=u?u.depth+1:0;for(let c=0;c<this.path.length;c++)this.path[c].shouldResetTransform=!0;this.root===this&&(this.nodes=new o$)}addEventListener(a,u){return this.eventHandlers.has(a)||this.eventHandlers.set(a,new q2),this.eventHandlers.get(a).add(u)}notifyListeners(a,...u){const c=this.eventHandlers.get(a);c&&c.notify(...u)}hasListeners(a){return this.eventHandlers.has(a)}mount(a){if(this.instance)return;this.isSVG=uw(a)&&!h7(a),this.instance=a;const{layoutId:u,layout:c,visualElement:d}=this.options;if(d&&!d.current&&d.mount(a),this.root.nodes.add(this),this.parent&&this.parent.children.add(this),this.root.hasTreeAnimated&&(c||u)&&(this.isLayoutDirty=!0),t){let h,p=0;const m=()=>this.root.updateBlockedByResize=!1;Tt.read(()=>{p=window.innerWidth}),t(a,()=>{const _=window.innerWidth;_!==p&&(p=_,this.root.updateBlockedByResize=!0,h&&h(),h=a$(m,250),Bp.hasAnimatedSinceResize&&(Bp.hasAnimatedSinceResize=!1,this.nodes.forEach(Mk)))})}u&&this.root.registerSharedNode(u,this),this.options.animate!==!1&&d&&(u||c)&&this.addEventListener("didUpdate",({delta:h,hasLayoutChanged:p,hasRelativeLayoutChanged:m,layout:_})=>{if(this.isTreeAnimationBlocked()){this.target=void 0,this.relativeTarget=void 0;return}const w=this.options.transition||d.getDefaultTransition()||C$,{onLayoutAnimationStart:y,onLayoutAnimationComplete:x}=d.getProps(),S=!this.targetLayout||!ET(this.targetLayout,_),P=!p&&m;if(this.options.layoutRoot||this.resumeFrom||P||p&&(S||!this.currentAnimation)){this.resumeFrom&&(this.resumingFrom=this.resumeFrom,this.resumingFrom.resumingFrom=void 0);const T={...nw(w,"layout"),onPlay:y,onComplete:x};(d.shouldReduceMotion||this.options.layoutRoot)&&(T.delay=0,T.type=!1),this.startAnimation(T),this.setAnimationOrigin(h,P,T.path)}else p||Mk(this),this.isLead()&&this.options.onExitComplete&&this.options.onExitComplete();this.targetLayout=_})}unmount(){this.options.layoutId&&this.willUpdate(),this.root.nodes.remove(this);const a=this.getStack();a&&a.remove(this),this.parent&&this.parent.children.delete(this),this.instance=void 0,this.eventHandlers.clear(),ua(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(x$),this.animationId++)}getTransformTemplate(){const{visualElement:a}=this.options;return a&&a.getProps().transformTemplate}willUpdate(a=!0){if(this.root.hasTreeAnimated=!0,this.root.isUpdateBlocked()){this.options.onExitComplete&&this.options.onExitComplete();return}if(window.MotionCancelOptimisedAnimation&&!this.hasCheckedOptimisedAppear&&kT(this),!this.root.isUpdating&&this.root.startUpdate(),this.isLayoutDirty)return;this.isLayoutDirty=!0;for(let h=0;h<this.path.length;h++){const p=this.path[h];p.shouldResetTransform=!0,(typeof p.latestValues.x=="string"||typeof p.latestValues.y=="string")&&(p.isLayoutDirty=!0),p.updateScroll("snapshot"),p.options.layoutRoot&&p.willUpdate(!1)}const{layoutId:u,layout:c}=this.options;if(u===void 0&&!c)return;const d=this.getTransformTemplate();this.prevTransformTemplateValue=d?d(this.latestValues,""):void 0,this.updateSnapshot(),a&&this.notifyListeners("willUpdate")}update(){if(this.updateScheduled=!1,this.isUpdateBlocked()){const c=this.updateBlockedByResize;this.unblockUpdate(),this.updateBlockedByResize=!1,this.clearAllSnapshots(),c&&this.nodes.forEach(g$),this.nodes.forEach(Ak);return}if(this.animationId<=this.animationCommitId){this.nodes.forEach(Ik);return}this.animationCommitId=this.animationId,this.isUpdating?(this.isUpdating=!1,this.nodes.forEach(v$),this.nodes.forEach(y$),this.nodes.forEach(d$),this.nodes.forEach(f$)):this.nodes.forEach(Ik),this.clearAllSnapshots();const u=lr.now();$n.delta=mi(0,1e3/60,u-$n.timestamp),$n.timestamp=u,$n.isProcessing=!0,t1.update.process($n),t1.preRender.process($n),t1.render.process($n),$n.isProcessing=!1}didUpdate(){this.updateScheduled||(this.updateScheduled=!0,aw.read(this.scheduleUpdate))}clearAllSnapshots(){this.nodes.forEach(m$),this.sharedNodes.forEach(b$)}scheduleUpdateProjection(){this.projectionUpdateScheduled||(this.projectionUpdateScheduled=!0,Tt.preRender(this.updateProjection,!1,!0))}scheduleCheckAfterUnmount(){Tt.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 c=0;c<this.path.length;c++)this.path[c].updateScroll();const a=this.layout;this.layout=this.measure(!1),this.layoutVersion++,this.layoutCorrected||(this.layoutCorrected=En()),this.isLayoutDirty=!1,this.projectionDelta=void 0,this.notifyListeners("measure",this.layout.layoutBox);const{visualElement:u}=this.options;u&&u.notify("LayoutMeasure",this.layout.layoutBox,a?a.layoutBox:void 0)}updateScroll(a="measure"){let u=!!(this.options.layoutScroll&&this.instance);if(this.scroll&&this.scroll.animationId===this.root.animationId&&this.scroll.phase===a&&(u=!1),u&&this.instance){const c=r(this.instance);this.scroll={animationId:this.root.animationId,phase:a,isRoot:c,offset:n(this.instance),wasRoot:this.scroll?this.scroll.isRoot:c}}}resetTransform(){if(!s)return;const a=this.isLayoutDirty||this.shouldResetTransform||this.options.alwaysMeasureLayout,u=this.projectionDelta&&!ST(this.projectionDelta),c=this.getTransformTemplate(),d=c?c(this.latestValues,""):void 0,h=d!==this.prevTransformTemplateValue;a&&this.instance&&(u||rl(this.latestValues)||h)&&(s(this.instance,d),this.shouldResetTransform=!1,this.scheduleRender())}measure(a=!0){const u=this.measurePageBox();let c=this.removeElementScroll(u);return a&&(c=this.removeTransform(c)),k$(c),{animationId:this.root.animationId,measuredBox:u,layoutBox:c,latestValues:{},source:this.id}}measurePageBox(){var d;const{visualElement:a}=this.options;if(!a)return En();const u=a.measureViewportBox();if(!(((d=this.scroll)==null?void 0:d.wasRoot)||this.path.some(P$))){const{scroll:h}=this.root;h&&(li(u.x,h.offset.x),li(u.y,h.offset.y))}return u}removeElementScroll(a){var c;const u=En();if(js(u,a),(c=this.scroll)!=null&&c.wasRoot)return u;for(let d=0;d<this.path.length;d++){const h=this.path[d],{scroll:p,options:m}=h;h!==this.root&&p&&m.layoutScroll&&(p.wasRoot&&js(u,a),li(u.x,p.offset.x),li(u.y,p.offset.y))}return u}applyTransform(a,u=!1,c){var h,p;const d=c||En();js(d,a);for(let m=0;m<this.path.length;m++){const _=this.path[m];!u&&_.options.layoutScroll&&_.scroll&&_!==_.root&&(li(d.x,-_.scroll.offset.x),li(d.y,-_.scroll.offset.y)),rl(_.latestValues)&&zp(d,_.latestValues,(h=_.layout)==null?void 0:h.layoutBox)}return rl(this.latestValues)&&zp(d,this.latestValues,(p=this.layout)==null?void 0:p.layoutBox),d}removeTransform(a){var c;const u=En();js(u,a);for(let d=0;d<this.path.length;d++){const h=this.path[d];if(!rl(h.latestValues))continue;let p;h.instance&&(y_(h.latestValues)&&h.updateSnapshot(),p=En(),js(p,h.measurePageBox())),xk(u,h.latestValues,(c=h.snapshot)==null?void 0:c.layoutBox,p)}return rl(this.latestValues)&&xk(u,this.latestValues),u}setTargetDelta(a){this.targetDelta=a,this.root.scheduleUpdateProjection(),this.isProjectionDirty=!0}setOptions(a){this.options={...this.options,...a,crossfade:a.crossfade!==void 0?a.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!==$n.timestamp&&this.relativeParent.resolveTargetDelta(!0)}resolveTargetDelta(a=!1){var _;const u=this.getLead();this.isProjectionDirty||(this.isProjectionDirty=u.isProjectionDirty),this.isTransformDirty||(this.isTransformDirty=u.isTransformDirty),this.isSharedProjectionDirty||(this.isSharedProjectionDirty=u.isSharedProjectionDirty);const c=!!this.resumingFrom||this!==u;if(!(a||c&&this.isSharedProjectionDirty||this.isProjectionDirty||(_=this.parent)!=null&&_.isProjectionDirty||this.attemptToResolveRelativeTarget||this.root.updateBlockedByResize))return;const{layout:h,layoutId:p}=this.options;if(!this.layout||!(h||p))return;this.resolvedRelativeTargetAt=$n.timestamp;const m=this.getClosestProjectingParent();m&&this.linkedParentVersion!==m.layoutVersion&&!m.options.layoutRoot&&this.removeRelativeTarget(),!this.targetDelta&&!this.relativeTarget&&(this.options.layoutAnchor!==!1&&m&&m.layout?this.createRelativeTarget(m,this.layout.layoutBox,m.layout.layoutBox):this.removeRelativeTarget()),!(!this.relativeTarget&&!this.targetDelta)&&(this.target||(this.target=En(),this.targetWithTransforms=En()),this.relativeTarget&&this.relativeTargetOrigin&&this.relativeParent&&this.relativeParent.target?(this.forceRelativeParentToResolveTarget(),K7(this.target,this.relativeTarget,this.relativeParent.target,this.options.layoutAnchor||void 0)):this.targetDelta?(this.resumingFrom?this.applyTransform(this.layout.layoutBox,!1,this.target):js(this.target,this.layout.layoutBox),dT(this.target,this.targetDelta)):js(this.target,this.layout.layoutBox),this.attemptToResolveRelativeTarget&&(this.attemptToResolveRelativeTarget=!1,this.options.layoutAnchor!==!1&&m&&!!m.resumingFrom==!!this.resumingFrom&&!m.options.layoutScroll&&m.target&&this.animationProgress!==1?this.createRelativeTarget(m,this.target,m.target):this.relativeParent=this.relativeTarget=void 0))}getClosestProjectingParent(){if(!(!this.parent||y_(this.parent.latestValues)||cT(this.parent.latestValues)))return this.parent.isProjecting()?this.parent:this.parent.getClosestProjectingParent()}isProjecting(){return!!((this.relativeTarget||this.targetDelta||this.options.layoutRoot)&&this.layout)}createRelativeTarget(a,u,c){this.relativeParent=a,this.linkedParentVersion=a.layoutVersion,this.forceRelativeParentToResolveTarget(),this.relativeTarget=En(),this.relativeTargetOrigin=En(),Vm(this.relativeTargetOrigin,u,c,this.options.layoutAnchor||void 0),js(this.relativeTarget,this.relativeTargetOrigin)}removeRelativeTarget(){this.relativeParent=this.relativeTarget=void 0}calcProjection(){var w;const a=this.getLead(),u=!!this.resumingFrom||this!==a;let c=!0;if((this.isProjectionDirty||(w=this.parent)!=null&&w.isProjectionDirty)&&(c=!1),u&&(this.isSharedProjectionDirty||this.isTransformDirty)&&(c=!1),this.resolvedRelativeTargetAt===$n.timestamp&&(c=!1),c)return;const{layout:d,layoutId:h}=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||h))return;js(this.layoutCorrected,this.layout.layoutBox);const p=this.treeScale.x,m=this.treeScale.y;S7(this.layoutCorrected,this.treeScale,this.path,u),a.layout&&!a.target&&(this.treeScale.x!==1||this.treeScale.y!==1)&&(a.target=a.layout.layoutBox,a.targetWithTransforms=En());const{target:_}=a;if(!_){this.prevProjectionDelta&&(this.createProjectionDeltas(),this.scheduleRender());return}!this.projectionDelta||!this.prevProjectionDelta?this.createProjectionDeltas():(mk(this.prevProjectionDelta.x,this.projectionDelta.x),mk(this.prevProjectionDelta.y,this.projectionDelta.y)),Md(this.projectionDelta,this.layoutCorrected,_,this.latestValues),(this.treeScale.x!==p||this.treeScale.y!==m||!kk(this.projectionDelta.x,this.prevProjectionDelta.x)||!kk(this.projectionDelta.y,this.prevProjectionDelta.y))&&(this.hasProjected=!0,this.scheduleRender(),this.notifyListeners("projectionUpdate",_))}hide(){this.isVisible=!1}show(){this.isVisible=!0}scheduleRender(a=!0){var u;if((u=this.options.visualElement)==null||u.scheduleRender(),a){const c=this.getStack();c&&c.scheduleRender()}this.resumingFrom&&!this.resumingFrom.instance&&(this.resumingFrom=void 0)}createProjectionDeltas(){this.prevProjectionDelta=Cu(),this.projectionDelta=Cu(),this.projectionDeltaWithTransform=Cu()}setAnimationOrigin(a,u=!1,c){const d=this.snapshot,h=d?d.latestValues:{},p={...this.latestValues},m=Cu();(!this.relativeParent||!this.relativeParent.options.layoutRoot)&&(this.relativeTarget=this.relativeTargetOrigin=void 0),this.attemptToResolveRelativeTarget=!u;const _=En(),w=d?d.source:void 0,y=this.layout?this.layout.source:void 0,x=w!==y,S=this.getStack(),P=!S||S.members.length<=1,T=!!(x&&!P&&this.options.crossfade===!0&&!this.path.some(E$));this.animationProgress=0;let k;const R=c==null?void 0:c.interpolateProjection(a);this.mixTargetDelta=M=>{const L=M/1e3,A=R==null?void 0:R(L);A?(m.x.translate=A.x,m.x.scale=Pt(a.x.scale,1,L),m.x.origin=a.x.origin,m.x.originPoint=a.x.originPoint,m.y.translate=A.y,m.y.scale=Pt(a.y.scale,1,L),m.y.origin=a.y.origin,m.y.originPoint=a.y.originPoint):(Ok(m.x,a.x,L),Ok(m.y,a.y,L)),this.setTargetDelta(m),this.relativeTarget&&this.relativeTargetOrigin&&this.layout&&this.relativeParent&&this.relativeParent.layout&&(Vm(_,this.layout.layoutBox,this.relativeParent.layout.layoutBox,this.options.layoutAnchor||void 0),S$(this.relativeTarget,this.relativeTargetOrigin,_,L),k&&Q7(this.relativeTarget,k)&&(this.isProjectionDirty=!1),k||(k=En()),js(k,this.relativeTarget)),x&&(this.animationValues=p,t$(p,h,this.latestValues,L,T,P)),A&&A.rotate!==void 0&&(this.animationValues||(this.animationValues=p),this.animationValues.pathRotation=A.rotate),this.root.scheduleUpdateProjection(),this.scheduleRender(),this.animationProgress=L},this.mixTargetDelta(this.options.layoutRoot?1e3:0)}startAnimation(a){var u,c,d;this.notifyListeners("animationStart"),(u=this.currentAnimation)==null||u.stop(),(d=(c=this.resumingFrom)==null?void 0:c.currentAnimation)==null||d.stop(),this.pendingAnimation&&(ua(this.pendingAnimation),this.pendingAnimation=void 0),this.pendingAnimation=Tt.update(()=>{Bp.hasAnimatedSinceResize=!0,this.motionValue||(this.motionValue=oc(0)),this.motionValue.jump(0,!1),this.currentAnimation=s$(this.motionValue,[0,1e3],{...a,velocity:0,isSync:!0,onUpdate:h=>{this.mixTargetDelta(h),a.onUpdate&&a.onUpdate(h)},onComplete:()=>{a.onComplete&&a.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 a=this.getStack();a&&a.exitAnimationComplete(),this.resumingFrom=this.currentAnimation=this.animationValues=void 0,this.notifyListeners("animationComplete")}finishAnimation(){this.currentAnimation&&(this.mixTargetDelta&&this.mixTargetDelta(u$),this.currentAnimation.stop()),this.completeAnimation()}applyTransformsToTarget(){const a=this.getLead();let{targetWithTransforms:u,target:c,layout:d,latestValues:h}=a;if(!(!u||!c||!d)){if(this!==a&&this.layout&&d&&TT(this.options.animationType,this.layout.layoutBox,d.layoutBox)){c=this.target||En();const p=ur(this.layout.layoutBox.x);c.x.min=a.target.x.min,c.x.max=c.x.min+p;const m=ur(this.layout.layoutBox.y);c.y.min=a.target.y.min,c.y.max=c.y.min+m}js(u,c),zp(u,h),Md(this.projectionDeltaWithTransform,this.layoutCorrected,u,h)}}registerSharedNode(a,u){this.sharedNodes.has(a)||this.sharedNodes.set(a,new l$),this.sharedNodes.get(a).add(u);const d=u.options.initialPromotionConfig;u.promote({transition:d?d.transition:void 0,preserveFollowOpacity:d&&d.shouldPreserveFollowOpacity?d.shouldPreserveFollowOpacity(u):void 0})}isLead(){const a=this.getStack();return a?a.lead===this:!0}getLead(){var u;const{layoutId:a}=this.options;return a?((u=this.getStack())==null?void 0:u.lead)||this:this}getPrevLead(){var u;const{layoutId:a}=this.options;return a?(u=this.getStack())==null?void 0:u.prevLead:void 0}getStack(){const{layoutId:a}=this.options;if(a)return this.root.sharedNodes.get(a)}promote({needsReset:a,transition:u,preserveFollowOpacity:c}={}){const d=this.getStack();d&&d.promote(this,c),a&&(this.projectionDelta=void 0,this.needsReset=!0),u&&this.setOptions({transition:u})}relegate(){const a=this.getStack();return a?a.relegate(this):!1}resetSkewAndRotation(){const{visualElement:a}=this.options;if(!a)return;let u=!1;const{latestValues:c}=a;if((c.z||c.rotate||c.rotateX||c.rotateY||c.rotateZ||c.skewX||c.skewY)&&(u=!0),!u)return;const d={};c.z&&c1("z",a,d,this.animationValues);for(let h=0;h<u1.length;h++)c1(`rotate${u1[h]}`,a,d,this.animationValues),c1(`skew${u1[h]}`,a,d,this.animationValues);a.render();for(const h in d)a.setStaticValue(h,d[h]),this.animationValues&&(this.animationValues[h]=d[h]);a.scheduleRender()}applyProjectionStyles(a,u){if(!this.instance||this.isSVG)return;if(!this.isVisible){a.visibility="hidden";return}const c=this.getTransformTemplate();if(this.needsReset){this.needsReset=!1,a.visibility="",a.opacity="",a.pointerEvents=Up(u==null?void 0:u.pointerEvents)||"",a.transform=c?c(this.latestValues,""):"none";return}const d=this.getLead();if(!this.projectionDelta||!this.layout||!d.target){this.options.layoutId&&(a.opacity=this.latestValues.opacity!==void 0?this.latestValues.opacity:1,a.pointerEvents=Up(u==null?void 0:u.pointerEvents)||""),this.hasProjected&&!rl(this.latestValues)&&(a.transform=c?c({},""):"none",this.hasProjected=!1);return}a.visibility="";const h=d.animationValues||d.latestValues;this.applyTransformsToTarget();let p=J7(this.projectionDeltaWithTransform,this.treeScale,h);c&&(p=c(h,p)),a.transform=p;const{x:m,y:_}=this.projectionDelta;a.transformOrigin=`${m.origin*100}% ${_.origin*100}% 0`,d.animationValues?a.opacity=d===this?h.opacity??this.latestValues.opacity??1:this.preserveOpacity?this.latestValues.opacity:h.opacityExit:a.opacity=d===this?h.opacity!==void 0?h.opacity:"":h.opacityExit!==void 0?h.opacityExit:0;for(const w in w_){if(h[w]===void 0)continue;const{correct:y,applyTo:x,isCSSVariable:S}=w_[w],P=p==="none"?h[w]:y(h[w],d);if(x){const T=x.length;for(let k=0;k<T;k++)a[x[k]]=P}else S?this.options.visualElement.renderState.vars[w]=P:a[w]=P}this.options.layoutId&&(a.pointerEvents=d===this?Up(u==null?void 0:u.pointerEvents)||"":"none")}clearSnapshot(){this.resumeFrom=this.snapshot=void 0}resetTree(){this.root.nodes.forEach(a=>{var u;return(u=a.currentAnimation)==null?void 0:u.stop()}),this.root.nodes.forEach(Ak),this.root.sharedNodes.clear()}}}function d$(t){t.updateLayout()}function f$(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,a=e.source!==t.layout.source;if(i==="size")ri(p=>{const m=a?e.measuredBox[p]:e.layoutBox[p],_=ur(m);m.min=r[p].min,m.max=m.min+_});else if(i==="x"||i==="y"){const p=i==="x"?"y":"x";x_(a?e.measuredBox[p]:e.layoutBox[p],r[p])}else TT(i,e.layoutBox,r)&&ri(p=>{const m=a?e.measuredBox[p]:e.layoutBox[p],_=ur(r[p]);m.max=m.min+_,t.relativeTarget&&!t.currentAnimation&&(t.isProjectionDirty=!0,t.relativeTarget[p].max=t.relativeTarget[p].min+_)});const u=Cu();Md(u,r,e.layoutBox);const c=Cu();a?Md(c,t.applyTransform(s,!0),e.measuredBox):Md(c,r,e.layoutBox);const d=!ST(u);let h=!1;if(!t.resumeFrom){const p=t.getClosestProjectingParent();if(p&&!p.resumeFrom){const{snapshot:m,layout:_}=p;if(m&&_){const w=t.options.layoutAnchor||void 0,y=En();Vm(y,e.layoutBox,m.layoutBox,w);const x=En();Vm(x,r,_.layoutBox,w),ET(y,x)||(h=!0),p.options.layoutRoot&&(t.relativeTarget=x,t.relativeTargetOrigin=y,t.relativeParent=p)}}}t.notifyListeners("didUpdate",{layout:r,snapshot:e,delta:c,layoutDelta:u,hasLayoutChanged:d,hasRelativeLayoutChanged:h})}else if(t.isLead()){const{onExitComplete:r}=t.options;r&&r()}t.options.transition=void 0}function h$(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 p$(t){t.isProjectionDirty=t.isSharedProjectionDirty=t.isTransformDirty=!1}function m$(t){t.clearSnapshot()}function Ak(t){t.clearMeasurements()}function g$(t){t.isLayoutDirty=!0,t.updateLayout()}function Ik(t){t.isLayoutDirty=!1}function v$(t){t.isAnimationBlocked&&t.layout&&!t.isLayoutDirty&&(t.snapshot=t.layout,t.isLayoutDirty=!0)}function y$(t){const{visualElement:e}=t.options;e&&e.getProps().onBeforeLayoutMeasure&&e.notify("BeforeLayoutMeasure"),t.resetTransform()}function Mk(t){t.finishAnimation(),t.targetDelta=t.relativeTarget=t.target=void 0,t.isProjectionDirty=!0}function _$(t){t.resolveTargetDelta()}function w$(t){t.calcProjection()}function x$(t){t.resetSkewAndRotation()}function b$(t){t.removeLeadSnapshot()}function Ok(t,e,n){t.translate=Pt(e.translate,0,n),t.scale=Pt(e.scale,1,n),t.origin=e.origin,t.originPoint=e.originPoint}function Lk(t,e,n,r){t.min=Pt(e.min,n.min,r),t.max=Pt(e.max,n.max,r)}function S$(t,e,n,r){Lk(t.x,e.x,n.x,r),Lk(t.y,e.y,n.y,r)}function E$(t){return t.animationValues&&t.animationValues.opacityExit!==void 0}const C$={duration:.45,ease:[.4,0,.1,1]},Dk=t=>typeof navigator<"u"&&navigator.userAgent&&navigator.userAgent.toLowerCase().includes(t),Nk=Dk("applewebkit/")&&!Dk("chrome/")?Math.round:Es;function jk(t){t.min=Nk(t.min),t.max=Nk(t.max)}function k$(t){jk(t.x),jk(t.y)}function TT(t,e,n){return t==="position"||t==="preserve-aspect"&&!G7(Ck(e),Ck(n),.2)}function P$(t){var e;return t!==t.root&&((e=t.scroll)==null?void 0:e.wasRoot)}const T$=PT({attachResizeListener:(t,e)=>Xd(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}),d1={current:void 0},RT=PT({measureScroll:t=>({x:t.scrollLeft,y:t.scrollTop}),defaultParent:()=>{if(!d1.current){const t=new T$({});t.mount(window),t.setOptions({layoutScroll:!0}),d1.current=t}return d1.current},resetTransform:(t,e)=>{t.style.transform=e!==void 0?e:"none"},checkIsScrollRoot:t=>window.getComputedStyle(t).position==="fixed"}),mw=v.createContext({transformPagePoint:t=>t,isStatic:!1,reducedMotion:"never"});function Fk(t,e){if(typeof t=="function")return t(e);t!=null&&(t.current=e)}function R$(...t){return e=>{let n=!1;const r=t.map(s=>{const i=Fk(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():Fk(t[s],null)}}}}function A$(...t){return v.useCallback(R$(...t),t)}class I$ extends v.Component{getSnapshotBeforeUpdate(e){const n=this.props.childRef.current;if(Fp(n)&&e.isPresent&&!this.props.isPresent&&this.props.pop!==!1){const r=n.offsetParent,s=Fp(r)&&r.offsetWidth||0,i=Fp(r)&&r.offsetHeight||0,a=getComputedStyle(n),u=this.props.sizeRef.current;u.height=parseFloat(a.height),u.width=parseFloat(a.width),u.top=n.offsetTop,u.left=n.offsetLeft,u.right=s-u.width-u.left,u.bottom=i-u.height-u.top,u.direction=a.direction}return null}componentDidUpdate(){}render(){return this.props.children}}function M$({children:t,isPresent:e,anchorX:n,anchorY:r,root:s,pop:i}){var m;const a=v.useId(),u=v.useRef(null),c=v.useRef({width:0,height:0,top:0,left:0,right:0,bottom:0,direction:"ltr"}),{nonce:d}=v.useContext(mw),h=i!==!1?((m=t.props)==null?void 0:m.ref)??(t==null?void 0:t.ref):void 0,p=A$(u,h);return v.useInsertionEffect(()=>{const{width:_,height:w,top:y,left:x,right:S,bottom:P,direction:T}=c.current;if(e||i===!1||!u.current||!_||!w)return;const k=T==="rtl",R=n==="left"?k?`right: ${S}`:`left: ${x}`:k?`left: ${x}`:`right: ${S}`,M=r==="bottom"?`bottom: ${P}`:`top: ${y}`;u.current.dataset.motionPopId=a;const L=document.createElement("style");d&&(L.nonce=d);const A=s??document.head;return A.appendChild(L),L.sheet&&L.sheet.insertRule(`
64
- [data-motion-pop-id="${a}"] {
65
- position: absolute !important;
66
- width: ${_}px !important;
67
- height: ${w}px !important;
68
- ${R}px !important;
69
- ${M}px !important;
70
- }
71
- `),()=>{var O;(O=u.current)==null||O.removeAttribute("data-motion-pop-id"),A.contains(L)&&A.removeChild(L)}},[e]),E.jsx(I$,{isPresent:e,childRef:u,sizeRef:c,pop:i,children:i===!1?t:v.cloneElement(t,{ref:p})})}const O$=({children:t,initial:e,isPresent:n,onExitComplete:r,custom:s,presenceAffectsLayout:i,mode:a,anchorX:u,anchorY:c,root:d})=>{const h=U2(L$),p=v.useId(),m=v.useRef(n),_=v.useRef(r);B2(()=>{m.current=n,_.current=r});let w=!0,y=v.useMemo(()=>(w=!1,{id:p,initial:e,isPresent:n,custom:s,onExitComplete:x=>{h.set(x,!0);for(const S of h.values())if(!S)return;r&&r()},register:x=>(h.set(x,!1),()=>{var S;h.delete(x),!m.current&&!h.size&&((S=_.current)==null||S.call(_))})}),[n,h,r]);return i&&w&&(y={...y}),v.useMemo(()=>{h.forEach((x,S)=>h.set(S,!1))},[n]),v.useEffect(()=>{!n&&!h.size&&r&&r()},[n]),t=E.jsx(M$,{pop:a==="popLayout",isPresent:n,anchorX:u,anchorY:c,root:d,children:t}),E.jsx(d0.Provider,{value:y,children:t})};function L$(){return new Map}function AT(t=!0){const e=v.useContext(d0);if(e===null)return[!0,null];const{isPresent:n,onExitComplete:r,register:s}=e,i=v.useId();v.useEffect(()=>{if(t)return s(i)},[t]);const a=v.useCallback(()=>t&&r&&r(i),[i,r,t]);return!n&&r?[!1,a]:[!0]}const up=t=>t.key||"";function $k(t){const e=[];return v.Children.forEach(t,n=>{v.isValidElement(n)&&e.push(n)}),e}const no=({children:t,custom:e,initial:n=!0,onExitComplete:r,presenceAffectsLayout:s=!0,mode:i="sync",propagate:a=!1,anchorX:u="left",anchorY:c="top",root:d})=>{const[h,p]=AT(a),m=v.useMemo(()=>$k(t),[t]),_=a&&!h?[]:m.map(up),w=v.useRef(!0),y=v.useRef(m),x=U2(()=>new Map),S=v.useRef(new Set),[P,T]=v.useState(m),[k,R]=v.useState(m);B2(()=>{w.current=!1,y.current=m;for(let A=0;A<k.length;A++){const O=up(k[A]);_.includes(O)?(x.delete(O),S.current.delete(O)):x.get(O)!==!0&&x.set(O,!1)}},[k,_.length,_.join("-")]);const M=[];if(m!==P){let A=[...m];for(let O=0;O<k.length;O++){const D=k[O],N=up(D);_.includes(N)||(A.splice(O,0,D),M.push(D))}return i==="wait"&&M.length&&(A=M),R($k(A)),T(m),null}const{forceRender:L}=v.useContext(z2);return E.jsx(E.Fragment,{children:k.map(A=>{const O=up(A),D=a&&!h?!1:m===k||_.includes(O),N=()=>{if(S.current.has(O))return;if(x.has(O))S.current.add(O),x.set(O,!0);else return;let j=!0;x.forEach(G=>{G||(j=!1)}),j&&(L==null||L(),R(y.current),a&&(p==null||p()),r&&r())};return E.jsx(O$,{isPresent:D,initial:!w.current||n?void 0:!1,custom:e,presenceAffectsLayout:s,mode:i,root:d,onExitComplete:D?void 0:N,anchorX:u,anchorY:c,children:A},O)})})},IT=v.createContext({strict:!1}),Vk={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 Hk=!1;function D$(){if(Hk)return;const t={};for(const e in Vk)t[e]={isEnabled:n=>Vk[e].some(r=>!!n[r])};aT(t),Hk=!0}function MT(){return D$(),_7()}function N$(t){const e=MT();for(const n in t)e[n]={...e[n],...t[n]};aT(e)}const j$=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 Hm(t){return t.startsWith("while")||t.startsWith("drag")&&t!=="draggable"||t.startsWith("layout")||t.startsWith("onTap")||t.startsWith("onPan")||t.startsWith("onLayout")||j$.has(t)}let OT=t=>!Hm(t);function F$(t){typeof t=="function"&&(OT=e=>e.startsWith("on")?!Hm(e):t(e))}try{F$(require("@emotion/is-prop-valid").default)}catch{}function $$(t,e,n){const r={};for(const s in t)s==="values"&&typeof t.values=="object"||Hn(t[s])||(OT(s)||n===!0&&Hm(s)||!e&&!Hm(s)||t.draggable&&s.startsWith("onDrag"))&&(r[s]=t[s]);return r}const g0=v.createContext({});function V$(t,e){if(m0(t)){const{initial:n,animate:r}=t;return{initial:n===!1||Yd(n)?n:void 0,animate:Yd(r)?r:void 0}}return t.inherit!==!1?e:{}}function H$(t){const{initial:e,animate:n}=V$(t,v.useContext(g0));return v.useMemo(()=>({initial:e,animate:n}),[zk(e),zk(n)])}function zk(t){return Array.isArray(t)?t.join(" "):t}const gw=()=>({style:{},transform:{},transformOrigin:{},vars:{}});function LT(t,e,n){for(const r in e)!Hn(e[r])&&!pT(r,n)&&(t[r]=e[r])}function z$({transformTemplate:t},e){return v.useMemo(()=>{const n=gw();return hw(n,e,t),Object.assign({},n.vars,n.style)},[e])}function U$(t,e){const n=t.style||{},r={};return LT(r,n,t),Object.assign(r,z$(t,e)),r}function B$(t,e){const n={},r=U$(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 DT=()=>({...gw(),attrs:{}});function W$(t,e,n,r){const s=v.useMemo(()=>{const i=DT();return mT(i,e,vT(r),t.transformTemplate,t.style),{...i.attrs,style:{...i.style}}},[e]);if(t.style){const i={};LT(i,t.style,t),s.style={...i,...s.style}}return s}const q$=["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 vw(t){return typeof t!="string"||t.includes("-")?!1:!!(q$.indexOf(t)>-1||/[A-Z]/u.test(t))}function G$(t,e,n,{latestValues:r},s,i=!1,a){const c=(a??vw(t)?W$:B$)(e,r,s,t),d=$$(e,typeof t=="string",i),h=t!==v.Fragment?{...d,...c,ref:n}:{},{children:p}=e,m=v.useMemo(()=>Hn(p)?p.get():p,[p]);return v.createElement(t,{...h,children:m})}function K$({scrapeMotionValuesFromProps:t,createRenderState:e},n,r,s){return{latestValues:Z$(n,r,s,t),renderState:e()}}function Z$(t,e,n,r){const s={},i=r(t,{});for(const m in i)s[m]=Up(i[m]);let{initial:a,animate:u}=t;const c=m0(t),d=iT(t);e&&d&&!c&&t.inherit!==!1&&(a===void 0&&(a=e.initial),u===void 0&&(u=e.animate));let h=n?n.initial===!1:!1;h=h||a===!1;const p=h?u:a;if(p&&typeof p!="boolean"&&!p0(p)){const m=Array.isArray(p)?p:[p];for(let _=0;_<m.length;_++){const w=sw(t,m[_]);if(w){const{transitionEnd:y,transition:x,...S}=w;for(const P in S){let T=S[P];if(Array.isArray(T)){const k=h?T.length-1:0;T=T[k]}T!==null&&(s[P]=T)}for(const P in y)s[P]=y[P]}}}return s}const NT=t=>(e,n)=>{const r=v.useContext(g0),s=v.useContext(d0),i=()=>K$(t,e,r,s);return n?i():U2(i)},Y$=NT({scrapeMotionValuesFromProps:pw,createRenderState:gw}),X$=NT({scrapeMotionValuesFromProps:yT,createRenderState:DT}),Q$=Symbol.for("motionComponentSymbol");function J$(t,e,n){const r=v.useRef(n);v.useInsertionEffect(()=>{r.current=n});const s=v.useRef(null);return v.useCallback(i=>{var u;i&&((u=t.onMount)==null||u.call(t,i)),e&&(i?e.mount(i):e.unmount());const a=r.current;if(typeof a=="function")if(i){const c=a(i);typeof c=="function"&&(s.current=c)}else s.current?(s.current(),s.current=null):a(i);else a&&(a.current=i)},[e])}const jT=v.createContext({});function _u(t){return t&&typeof t=="object"&&Object.prototype.hasOwnProperty.call(t,"current")}function eV(t,e,n,r,s,i){var T,k;const{visualElement:a}=v.useContext(g0),u=v.useContext(IT),c=v.useContext(d0),d=v.useContext(mw),h=d.reducedMotion,p=d.skipAnimations,m=v.useRef(null),_=v.useRef(!1);r=r||u.renderer,!m.current&&r&&(m.current=r(t,{visualState:e,parent:a,props:n,presenceContext:c,blockInitialAnimation:c?c.initial===!1:!1,reducedMotionConfig:h,skipAnimations:p,isSVG:i}),_.current&&m.current&&(m.current.manuallyAnimateOnMount=!0));const w=m.current,y=v.useContext(jT);w&&!w.projection&&s&&(w.type==="html"||w.type==="svg")&&tV(m.current,n,s,y);const x=v.useRef(!1);v.useInsertionEffect(()=>{w&&x.current&&w.update(n,c)});const S=n[G3],P=v.useRef(!!S&&typeof window<"u"&&!((T=window.MotionHandoffIsComplete)!=null&&T.call(window,S))&&((k=window.MotionHasOptimisedAnimation)==null?void 0:k.call(window,S)));return B2(()=>{_.current=!0,w&&(x.current=!0,window.MotionIsMounted=!0,w.updateFeatures(),w.scheduleRenderMicrotask(),P.current&&w.animationState&&w.animationState.animateChanges())}),v.useEffect(()=>{w&&(!P.current&&w.animationState&&w.animationState.animateChanges(),P.current&&(queueMicrotask(()=>{var R;(R=window.MotionHandoffMarkAsComplete)==null||R.call(window,S)}),P.current=!1),w.enteringChildren=void 0)}),w}function tV(t,e,n,r){const{layoutId:s,layout:i,drag:a,dragConstraints:u,layoutScroll:c,layoutRoot:d,layoutAnchor:h,layoutCrossfade:p}=e;t.projection=new n(t.latestValues,e["data-framer-portal-id"]?void 0:FT(t.parent)),t.projection.setOptions({layoutId:s,layout:i,alwaysMeasureLayout:!!a||u&&_u(u),visualElement:t,animationType:typeof i=="string"?i:"both",initialPromotionConfig:r,crossfade:p,layoutScroll:c,layoutRoot:d,layoutAnchor:h})}function FT(t){if(t)return t.options.allowProjection!==!1?t.projection:FT(t.parent)}function f1(t,{forwardMotionProps:e=!1,type:n}={},r,s){r&&N$(r);const i=n?n==="svg":vw(t),a=i?X$:Y$;function u(d,h){let p;const m={...v.useContext(mw),...d,layoutId:nV(d)},{isStatic:_}=m,w=H$(d),y=a(d,_);if(!_&&typeof window<"u"){rV();const x=sV(m);p=x.MeasureLayout,w.visualElement=eV(t,y,m,s,x.ProjectionNode,i)}return E.jsxs(g0.Provider,{value:w,children:[p&&w.visualElement?E.jsx(p,{visualElement:w.visualElement,...m}):null,G$(t,d,J$(y,w.visualElement,h),y,_,e,i)]})}u.displayName=`motion.${typeof t=="string"?t:`create(${t.displayName??t.name??""})`}`;const c=v.forwardRef(u);return c[Q$]=t,c}function nV({layoutId:t}){const e=v.useContext(z2).id;return e&&t!==void 0?e+"-"+t:t}function rV(t,e){v.useContext(IT).strict}function sV(t){const e=MT(),{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 iV(t,e){if(typeof Proxy>"u")return f1;const n=new Map,r=(i,a)=>f1(i,a,t,e),s=(i,a)=>r(i,a);return new Proxy(s,{get:(i,a)=>a==="create"?r:(n.has(a)||n.set(a,f1(a,void 0,t,e)),n.get(a))})}const oV=(t,e)=>e.isSVG??vw(t)?new N7(e):new A7(e,{allowProjection:t!==v.Fragment});class aV extends ga{constructor(e){super(e),e.animationState||(e.animationState=H7(e))}updateAnimationControlsSubscription(){const{animate:e}=this.node.getProps();p0(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 lV=0;class uV extends ga{constructor(){super(...arguments),this.id=lV++,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:a,custom:u}=this.node.getProps();if(typeof a=="string"||typeof a=="object"&&a!==null&&!Array.isArray(a)){const c=bl(this.node,a,u);if(c){const{transition:d,transitionEnd:h,...p}=c;for(const m in p)(i=this.node.getValue(m))==null||i.jump(p[m])}}this.node.animationState.reset(),this.node.animationState.animateChanges()}else this.node.animationState.setActive("exit",!1);this.isExitComplete=!1;return}const s=this.node.animationState.setActive("exit",!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 cV={animation:{Feature:aV},exit:{Feature:uV}};function Rf(t){return{point:{x:t.pageX,y:t.pageY}}}const dV=t=>e=>lw(e)&&t(e,Rf(e));function Od(t,e,n,r){return Xd(t,e,dV(n),r)}const $T=({current:t})=>t?t.ownerDocument.defaultView:null,Uk=(t,e)=>Math.abs(t-e);function fV(t,e){const n=Uk(t.x,e.x),r=Uk(t.y,e.y);return Math.sqrt(n**2+r**2)}const Bk=new Set(["auto","scroll"]);class VT{constructor(e,n,{transformPagePoint:r,contextWindow:s=window,dragSnapToOrigin:i=!1,distanceThreshold:a=3,element:u}={}){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=w=>{this.handleScroll(w.target)},this.onWindowScroll=()=>{this.handleScroll(window)},this.updatePoint=()=>{if(!(this.lastMoveEvent&&this.lastMoveEventInfo))return;this.lastRawMoveEventInfo&&(this.lastMoveEventInfo=cp(this.lastRawMoveEventInfo,this.transformPagePoint));const w=h1(this.lastMoveEventInfo,this.history),y=this.startEvent!==null,x=fV(w.offset,{x:0,y:0})>=this.distanceThreshold;if(!y&&!x)return;const{point:S}=w,{timestamp:P}=$n;this.history.push({...S,timestamp:P});const{onStart:T,onMove:k}=this.handlers;y||(T&&T(this.lastMoveEvent,w),this.startEvent=this.lastMoveEvent),k&&k(this.lastMoveEvent,w)},this.handlePointerMove=(w,y)=>{this.lastMoveEvent=w,this.lastRawMoveEventInfo=y,this.lastMoveEventInfo=cp(y,this.transformPagePoint),Tt.update(this.updatePoint,!0)},this.handlePointerUp=(w,y)=>{this.end();const{onEnd:x,onSessionEnd:S,resumeAnimation:P}=this.handlers;if((this.dragSnapToOrigin||!this.startEvent)&&P&&P(),!(this.lastMoveEvent&&this.lastMoveEventInfo))return;const T=h1(w.type==="pointercancel"?this.lastMoveEventInfo:cp(y,this.transformPagePoint),this.history);this.startEvent&&x&&x(w,T),S&&S(w,T)},!lw(e))return;this.dragSnapToOrigin=i,this.handlers=n,this.transformPagePoint=r,this.distanceThreshold=a,this.contextWindow=s||window;const c=Rf(e),d=cp(c,this.transformPagePoint),{point:h}=d,{timestamp:p}=$n;this.history=[{...h,timestamp:p}];const{onSessionStart:m}=n;m&&m(e,h1(d,this.history));const _={passive:!0,capture:!0};this.removeListeners=kf(Od(this.contextWindow,"pointermove",this.handlePointerMove,_),Od(this.contextWindow,"pointerup",this.handlePointerUp,_),Od(this.contextWindow,"pointercancel",this.handlePointerUp,_)),u&&this.startScrollTracking(u)}startScrollTracking(e){let n=e.parentElement;for(;n;){const r=getComputedStyle(n);(Bk.has(r.overflowX)||Bk.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),Tt.update(this.updatePoint,!0))}updateHandlers(e){this.handlers=e}end(){this.removeListeners&&this.removeListeners(),this.removeScrollListeners&&this.removeScrollListeners(),this.scrollPositions.clear(),ua(this.updatePoint)}}function cp(t,e){return e?{point:e(t.point)}:t}function Wk(t,e){return{x:t.x-e.x,y:t.y-e.y}}function h1({point:t},e){return{point:t,delta:Wk(t,HT(e)),offset:Wk(t,hV(e)),velocity:pV(e,.1)}}function hV(t){return t[0]}function HT(t){return t[t.length-1]}function pV(t,e){if(t.length<2)return{x:0,y:0};let n=t.length-1,r=null;const s=HT(t);for(;n>=0&&(r=t[n],!(s.timestamp-r.timestamp>es(e)));)n--;if(!r)return{x:0,y:0};r===t[0]&&t.length>2&&s.timestamp-r.timestamp>es(e)*2&&(r=t[1]);const i=ws(s.timestamp-r.timestamp);if(i===0)return{x:0,y:0};const a={x:(s.x-r.x)/i,y:(s.y-r.y)/i};return a.x===1/0&&(a.x=0),a.y===1/0&&(a.y=0),a}function mV(t,{min:e,max:n},r){return e!==void 0&&t<e?t=r?Pt(e,t,r.min):Math.max(t,e):n!==void 0&&t>n&&(t=r?Pt(n,t,r.max):Math.min(t,n)),t}function qk(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 gV(t,{top:e,left:n,bottom:r,right:s}){return{x:qk(t.x,n,s),y:qk(t.y,e,r)}}function Gk(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 vV(t,e){return{x:Gk(t.x,e.x),y:Gk(t.y,e.y)}}function yV(t,e){let n=.5;const r=ur(t),s=ur(e);return s>r?n=Kd(e.min,e.max-r,t.min):r>s&&(n=Kd(t.min,t.max-s,e.min)),mi(0,1,n)}function _V(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 b_=.35;function wV(t=b_){return t===!1?t=0:t===!0&&(t=b_),{x:Kk(t,"left","right"),y:Kk(t,"top","bottom")}}function Kk(t,e,n){return{min:Zk(t,e),max:Zk(t,n)}}function Zk(t,e){return typeof t=="number"?t:t[e]||0}const xV=new WeakMap;class bV{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=En(),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=p=>{n&&this.snapToCursor(Rf(p).point),this.stopAnimation()},a=(p,m)=>{const{drag:_,dragPropagation:w,onDragStart:y}=this.getProps();if(_&&!w&&(this.openDragLock&&this.openDragLock(),this.openDragLock=YF(_),!this.openDragLock))return;this.latestPointerEvent=p,this.latestPanInfo=m,this.isDragging=!0,this.currentDirection=null,this.resolveConstraints(),this.visualElement.projection&&(this.visualElement.projection.isAnimationBlocked=!0,this.visualElement.projection.target=void 0),ri(S=>{let P=this.getAxisMotionValue(S).get()||0;if(pi.test(P)){const{projection:T}=this.visualElement;if(T&&T.layout){const k=T.layout.layoutBox[S];k&&(P=ur(k)*(parseFloat(P)/100))}}this.originPoint[S]=P}),y&&Tt.update(()=>y(p,m),!1,!0),h_(this.visualElement,"transform");const{animationState:x}=this.visualElement;x&&x.setActive("whileDrag",!0)},u=(p,m)=>{this.latestPointerEvent=p,this.latestPanInfo=m;const{dragPropagation:_,dragDirectionLock:w,onDirectionLock:y,onDrag:x}=this.getProps();if(!_&&!this.openDragLock)return;const{offset:S}=m;if(w&&this.currentDirection===null){this.currentDirection=EV(S),this.currentDirection!==null&&y&&y(this.currentDirection);return}this.updateAxis("x",m.point,S),this.updateAxis("y",m.point,S),this.visualElement.render(),x&&Tt.update(()=>x(p,m),!1,!0)},c=(p,m)=>{this.latestPointerEvent=p,this.latestPanInfo=m,this.stop(p,m),this.latestPointerEvent=null,this.latestPanInfo=null},d=()=>{const{dragSnapToOrigin:p}=this.getProps();(p||this.constraints)&&this.startAnimation({x:0,y:0})},{dragSnapToOrigin:h}=this.getProps();this.panSession=new VT(e,{onSessionStart:i,onStart:a,onMove:u,onSessionEnd:c,resumeAnimation:d},{transformPagePoint:this.visualElement.getTransformPagePoint(),dragSnapToOrigin:h,distanceThreshold:r,contextWindow:$T(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:a}=s;this.startAnimation(a);const{onDragEnd:u}=this.getProps();u&&Tt.postRender(()=>u(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||!dp(e,s,this.currentDirection))return;const i=this.getAxisMotionValue(e);let a=this.originPoint[e]+r[e];this.constraints&&this.constraints[e]&&(a=mV(a,this.constraints[e],this.elastic[e])),i.set(a)}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&&_u(e)?this.constraints||(this.constraints=this.resolveRefConstraints()):e&&r?this.constraints=gV(r.layoutBox,e):this.constraints=!1,this.elastic=wV(n),s!==this.constraints&&!_u(e)&&r&&this.constraints&&!this.hasMutatedConstraints&&ri(a=>{this.constraints!==!1&&this.getAxisMotionValue(a)&&(this.constraints[a]=_V(r.layoutBox[a],this.constraints[a]))})}resolveRefConstraints(){const{dragConstraints:e,onMeasureDragConstraints:n}=this.getProps();if(!e||!_u(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=E7(r,s.root,this.visualElement.getTransformPagePoint());let a=vV(s.layout.layoutBox,i);if(n){const u=n(x7(a));this.hasMutatedConstraints=!!u,u&&(a=uT(u))}return a}startAnimation(e){const{drag:n,dragMomentum:r,dragElastic:s,dragTransition:i,dragSnapToOrigin:a,onDragTransitionEnd:u}=this.getProps(),c=this.constraints||{},d=ri(h=>{if(!dp(h,n,this.currentDirection))return;let p=c&&c[h]||{};(a===!0||a===h)&&(p={min:0,max:0});const m=s?200:1e6,_=s?40:1e7,w={type:"inertia",velocity:r?e[h]:0,bounceStiffness:m,bounceDamping:_,timeConstant:750,restDelta:1,restSpeed:10,...i,...p};return this.startAxisValueAnimation(h,w)});return Promise.all(d).then(u)}startAxisValueAnimation(e,n){const r=this.getAxisMotionValue(e);return h_(this.visualElement,e),r.start(rw(e,r,0,n,this.visualElement,!1))}stopAnimation(){ri(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){ri(n=>{const{drag:r}=this.getProps();if(!dp(n,r,this.currentDirection))return;const{projection:s}=this.visualElement,i=this.getAxisMotionValue(n);if(s&&s.layout){const{min:a,max:u}=s.layout.layoutBox[n],c=i.get()||0;i.set(e[n]-Pt(a,u,.5)+c)}})}scalePositionWithinConstraints(){if(!this.visualElement.current)return;const{drag:e,dragConstraints:n}=this.getProps(),{projection:r}=this.visualElement;if(!_u(n)||!r||!this.constraints)return;this.stopAnimation();const s={x:0,y:0};ri(a=>{const u=this.getAxisMotionValue(a);if(u&&this.constraints!==!1){const c=u.get();s[a]=yV({min:c,max:c},this.constraints[a])}});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(),ri(a=>{if(!dp(a,e,null))return;const u=this.getAxisMotionValue(a),{min:c,max:d}=this.constraints[a];u.set(Pt(c,d,s[a]))}),this.visualElement.render()}addListeners(){if(!this.visualElement.current)return;xV.set(this.visualElement,this);const e=this.visualElement.current,n=Od(e,"pointerdown",d=>{const{drag:h,dragListener:p=!0}=this.getProps(),m=d.target,_=m!==e&&n7(m);h&&p&&!_&&this.start(d)});let r;const s=()=>{const{dragConstraints:d}=this.getProps();_u(d)&&d.current&&(this.constraints=this.resolveRefConstraints(),r||(r=SV(e,d.current,()=>this.scalePositionWithinConstraints())))},{projection:i}=this.visualElement,a=i.addEventListener("measure",s);i&&!i.layout&&(i.root&&i.root.updateScroll(),i.updateLayout()),Tt.read(s);const u=Xd(window,"resize",()=>this.scalePositionWithinConstraints()),c=i.addEventListener("didUpdate",(({delta:d,hasLayoutChanged:h})=>{this.isDragging&&h&&(ri(p=>{const m=this.getAxisMotionValue(p);m&&(this.originPoint[p]+=d[p].translate,m.set(m.get()+d[p].translate))}),this.visualElement.render())}));return()=>{u(),n(),a(),c&&c(),r&&r()}}getProps(){const e=this.visualElement.getProps(),{drag:n=!1,dragDirectionLock:r=!1,dragPropagation:s=!1,dragConstraints:i=!1,dragElastic:a=b_,dragMomentum:u=!0}=e;return{...e,drag:n,dragDirectionLock:r,dragPropagation:s,dragConstraints:i,dragElastic:a,dragMomentum:u}}}function Yk(t){let e=!0;return()=>{if(e){e=!1;return}t()}}function SV(t,e,n){const r=rk(t,Yk(n)),s=rk(e,Yk(n));return()=>{r(),s()}}function dp(t,e,n){return(e===!0||e===t)&&(n===null||n===t)}function EV(t,e=10){let n=null;return Math.abs(t.y)>e?n="y":Math.abs(t.x)>e&&(n="x"),n}class CV extends ga{constructor(e){super(e),this.removeGroupControls=Es,this.removeListeners=Es,this.controls=new bV(e)}mount(){const{dragControls:e}=this.node.getProps();e&&(this.removeGroupControls=e.subscribe(this.controls)),this.removeListeners=this.controls.addListeners()||Es}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 p1=t=>(e,n)=>{t&&Tt.update(()=>t(e,n),!1,!0)};class kV extends ga{constructor(){super(...arguments),this.removePointerDownListener=Es}onPointerDown(e){this.session=new VT(e,this.createPanHandlers(),{transformPagePoint:this.node.getTransformPagePoint(),contextWindow:$T(this.node)})}createPanHandlers(){const{onPanSessionStart:e,onPanStart:n,onPan:r,onPanEnd:s}=this.node.getProps();return{onSessionStart:p1(e),onStart:p1(n),onMove:p1(r),onEnd:(i,a)=>{delete this.session,s&&Tt.postRender(()=>s(i,a))}}}mount(){this.removePointerDownListener=Od(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 m1=!1;class PV extends v.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),m1&&i.root.didUpdate(),i.addEventListener("animationComplete",()=>{this.safeToRemove()}),i.setOptions({...i.options,layoutDependency:this.props.layoutDependency,onExitComplete:()=>this.safeToRemove()})),Bp.hasEverUpdated=!0}getSnapshotBeforeUpdate(e){const{layoutDependency:n,visualElement:r,drag:s,isPresent:i}=this.props,{projection:a}=r;return a&&(a.isPresent=i,e.layoutDependency!==n&&a.setOptions({...a.options,layoutDependency:n}),m1=!0,s||e.layoutDependency!==n||n===void 0||e.isPresent!==i?a.willUpdate():this.safeToRemove(),e.isPresent!==i&&(i?a.promote():a.relegate()||Tt.postRender(()=>{const u=a.getStack();(!u||!u.members.length)&&this.safeToRemove()}))),null}componentDidUpdate(){const{visualElement:e,layoutAnchor:n}=this.props,{projection:r}=e;r&&(r.options.layoutAnchor=n,r.root.didUpdate(),aw.postRender(()=>{!r.currentAnimation&&r.isLead()&&this.safeToRemove()}))}componentWillUnmount(){const{visualElement:e,layoutGroup:n,switchLayoutGroup:r}=this.props,{projection:s}=e;m1=!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 zT(t){const[e,n]=AT(),r=v.useContext(z2);return E.jsx(PV,{...t,layoutGroup:r,switchLayoutGroup:v.useContext(jT),isPresent:e,safeToRemove:n})}const TV={pan:{Feature:kV},drag:{Feature:CV,ProjectionNode:RT,MeasureLayout:zT}};function Xk(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&&Tt.postRender(()=>i(e,Rf(e)))}class RV extends ga{mount(){const{current:e}=this.node;e&&(this.unmount=QF(e,(n,r)=>(Xk(this.node,r,"Start"),s=>Xk(this.node,s,"End"))))}unmount(){}}class AV extends ga{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=kf(Xd(this.node.current,"focus",()=>this.onFocus()),Xd(this.node.current,"blur",()=>this.onBlur()))}unmount(){}}function Qk(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&&Tt.postRender(()=>i(e,Rf(e)))}class IV extends ga{mount(){const{current:e}=this.node;if(!e)return;const{globalTapTarget:n,propagate:r}=this.node.props;this.unmount=s7(e,(s,i)=>(Qk(this.node,i,"Start"),(a,{success:u})=>Qk(this.node,a,u?"End":"Cancel")),{useGlobalTarget:n,stopPropagation:(r==null?void 0:r.tap)===!1})}unmount(){}}const S_=new WeakMap,g1=new WeakMap,MV=t=>{const e=S_.get(t.target);e&&e(t)},OV=t=>{t.forEach(MV)};function LV({root:t,...e}){const n=t||document;g1.has(n)||g1.set(n,{});const r=g1.get(n),s=JSON.stringify(e);return r[s]||(r[s]=new IntersectionObserver(OV,{root:t,...e})),r[s]}function DV(t,e,n){const r=LV(e);return S_.set(t,n),r.observe(t),()=>{S_.delete(t),r.unobserve(t)}}const NV={some:0,all:1};class jV extends ga{constructor(){super(...arguments),this.hasEnteredView=!1,this.isInView=!1}startObserver(){var c;(c=this.stopObserver)==null||c.call(this);const{viewport:e={}}=this.node.getProps(),{root:n,margin:r,amount:s="some",once:i}=e,a={root:n?n.current:void 0,rootMargin:r,threshold:typeof s=="number"?s:NV[s]},u=d=>{const{isIntersecting:h}=d;if(this.isInView===h||(this.isInView=h,i&&!h&&this.hasEnteredView))return;h&&(this.hasEnteredView=!0),this.node.animationState&&this.node.animationState.setActive("whileInView",h);const{onViewportEnter:p,onViewportLeave:m}=this.node.getProps(),_=h?p:m;_&&_(d)};this.stopObserver=DV(this.node.current,a,u)}mount(){this.startObserver()}update(){if(typeof IntersectionObserver>"u")return;const{props:e,prevProps:n}=this.node;["amount","margin","root"].some(FV(e,n))&&this.startObserver()}unmount(){var e;(e=this.stopObserver)==null||e.call(this),this.hasEnteredView=!1,this.isInView=!1}}function FV({viewport:t={}},{viewport:e={}}={}){return n=>t[n]!==e[n]}const $V={inView:{Feature:jV},tap:{Feature:IV},focus:{Feature:AV},hover:{Feature:RV}},VV={layout:{ProjectionNode:RT,MeasureLayout:zT}},HV={...cV,...$V,...TV,...VV},ro=iV(HV,oV);function zV(){!fw.current&&oT();const[t]=v.useState(jm.current);return t}const Sl=ro;var v0=JP();const UV=i0(v0);function BV(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 WV=t=>{switch(t){case"success":return KV;case"info":return YV;case"warning":return ZV;case"error":return XV;default:return null}},qV=Array(12).fill(0),GV=({visible:t,className:e})=>ye.createElement("div",{className:["sonner-loading-wrapper",e].filter(Boolean).join(" "),"data-visible":t},ye.createElement("div",{className:"sonner-spinner"},qV.map((n,r)=>ye.createElement("div",{className:"sonner-loading-bar",key:`spinner-bar-${r}`})))),KV=ye.createElement("svg",{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 20 20",fill:"currentColor",height:"20",width:"20","aria-hidden":"true"},ye.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"})),ZV=ye.createElement("svg",{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24",fill:"currentColor",height:"20",width:"20","aria-hidden":"true"},ye.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"})),YV=ye.createElement("svg",{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 20 20",fill:"currentColor",height:"20",width:"20","aria-hidden":"true"},ye.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"})),XV=ye.createElement("svg",{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 20 20",fill:"currentColor",height:"20",width:"20","aria-hidden":"true"},ye.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"})),QV=ye.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"},ye.createElement("line",{x1:"18",y1:"6",x2:"6",y2:"18"}),ye.createElement("line",{x1:"6",y1:"6",x2:"18",y2:"18"})),JV=()=>{const[t,e]=ye.useState(document.hidden);return ye.useEffect(()=>{const n=()=>{e(document.hidden)};return document.addEventListener("visibilitychange",n),()=>document.removeEventListener("visibilitychange",n)},[]),t};let eH=1;const tH=100,Jk=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:eH++};class nH{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-tH;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=Jk(e),i=this.pendingDismissals.get(s);i!==void 0&&(cancelAnimationFrame(i),this.pendingDismissals.delete(s),this.dismissedToasts.delete(s));const a=this.dismissedToasts.has(s),u=e.dismissible===void 0?!0:e.dismissible;return a&&(this.dismissedToasts.delete(s),this.toasts=this.toasts.filter(d=>d.id!==s)),(a?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:u,title:n}):d):this.addToast({title:n,...r,dismissible:u,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,a;const u=s.then(async d=>{if(a=["resolve",d],ye.isValidElement(d))i=!1,this.create({id:r,type:"default",message:d});else if(sH(d)&&!d.ok){i=!1;const p=typeof n.error=="function"?await n.error(`HTTP error! status: ${d.status}`):n.error,m=typeof n.description=="function"?await n.description(`HTTP error! status: ${d.status}`):n.description,w=typeof p=="object"&&!ye.isValidElement(p)?p:{message:p};this.create({id:r,type:"error",description:m,...w})}else if(d instanceof Error){i=!1;const p=typeof n.error=="function"?await n.error(d):n.error,m=typeof n.description=="function"?await n.description(d):n.description,w=typeof p=="object"&&!ye.isValidElement(p)?p:{message:p};this.create({id:r,type:"error",description:m,...w})}else if(n.success!==void 0){i=!1;const p=typeof n.success=="function"?await n.success(d):n.success,m=typeof n.description=="function"?await n.description(d):n.description,w=typeof p=="object"&&!ye.isValidElement(p)?p:{message:p};this.create({id:r,type:"success",description:m,...w})}}).catch(async d=>{if(a=["reject",d],n.error!==void 0){i=!1;const h=typeof n.error=="function"?await n.error(d):n.error,p=typeof n.description=="function"?await n.description(d):n.description,_=typeof h=="object"&&!ye.isValidElement(h)?h:{message:h};this.create({id:r,type:"error",description:p,..._})}}).finally(()=>{i&&(this.dismiss(r),r=void 0),n.finally==null||n.finally.call(n)}),c=()=>new Promise((d,h)=>u.then(()=>a[0]==="reject"?h(a[1]):d(a[1])).catch(h));return typeof r!="string"&&typeof r!="number"?{unwrap:c}:Object.assign(r,{unwrap:c})},this.custom=(e,n)=>{const r=Jk(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 Er=new nH,rH=(t,e)=>Er.message(t,e),sH=t=>t&&typeof t=="object"&&"ok"in t&&typeof t.ok=="boolean"&&"status"in t&&typeof t.status=="number",iH=rH,oH=()=>Er.toasts,aH=()=>Er.getActiveToasts(),gt=Object.assign(iH,{success:Er.success,info:Er.info,warning:Er.warning,error:Er.error,custom:Er.custom,message:Er.message,promise:Er.promise,dismiss:Er.dismiss,loading:Er.loading},{getHistory:oH,getToasts:aH});BV("[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 fp(t){return t.label!==void 0}const lH=3,uH="24px",cH="16px",e4=4e3,dH=356,fH=14,hH=45,pH=200;function Js(...t){return t.filter(Boolean).join(" ")}function mH(t){const[e,n]=t.split("-"),r=[];return e&&r.push(e),n&&r.push(n),r}const gH=t=>{var e,n,r,s,i,a,u,c,d;const{invert:h,toast:p,unstyled:m,interacting:_,setHeights:w,visibleToasts:y,heights:x,index:S,toasts:P,expanded:T,removeToast:k,defaultRichColors:R,closeButton:M,style:L,cancelButtonStyle:A,actionButtonStyle:O,className:D="",descriptionClassName:N="",duration:j,position:G,gap:Y,expandByDefault:W,classNames:q,icons:Z,closeButtonAriaLabel:V="Close toast"}=t,[J,H]=ye.useState(null),[F,X]=ye.useState(null),[oe,se]=ye.useState(!1),[ee,ce]=ye.useState(!1),[we,le]=ye.useState(!1),[ie,Ne]=ye.useState(!1),[Be,Pe]=ye.useState(!1),[$e,dt]=ye.useState(0),[Qt,be]=ye.useState(0),Ve=ye.useRef(p.duration||j||e4),qe=ye.useRef(null),tt=ye.useRef(null),_t=S===0,nt=S+1<=y,Ye=p.type,on=Ye??"default",an=p.dismissible!==!1,On=p.className||"",po=p.descriptionClassName||"",Bn=ye.useMemo(()=>x.findIndex(We=>We.toastId===p.id)||0,[x,p.id]),is=ye.useMemo(()=>{var We;return(We=p.closeButton)!=null?We:M},[p.closeButton,M]),fr=ye.useMemo(()=>p.duration||j||e4,[p.duration,j]),er=ye.useRef(0),hr=ye.useRef(0),Ll=ye.useRef(0),Jt=ye.useRef(null),[mo,go]=G.split("-"),ks=ye.useMemo(()=>x.reduce((We,Wt,Ot)=>Ot>=Bn?We:We+Wt.height,0),[x,Bn]),Ps=JV(),_n=ye.useMemo(()=>{var We;return(We=t.swipeDirections)!=null?We:mH(G)},[t.swipeDirections,G]),os=p.invert||h,Ws=Ye==="loading";hr.current=ye.useMemo(()=>Bn*Y+ks,[Bn,ks]),ye.useEffect(()=>{Ve.current=fr},[fr]),ye.useEffect(()=>{se(!0)},[]),ye.useEffect(()=>{const We=tt.current;if(We){const Wt=We.getBoundingClientRect().height;return be(Wt),w(Ot=>[{toastId:p.id,height:Wt,position:p.position},...Ot]),()=>w(Ot=>Ot.filter(wn=>wn.toastId!==p.id))}},[w,p.id]),ye.useLayoutEffect(()=>{if(!oe)return;const We=tt.current,Wt=We.style.height;We.style.height="auto";const Ot=We.getBoundingClientRect().height;We.style.height=Wt,be(Ot),w(wn=>wn.find(qt=>qt.toastId===p.id)?wn.map(qt=>qt.toastId===p.id?{...qt,height:Ot}:qt):[{toastId:p.id,height:Ot,position:p.position},...wn])},[oe,p.title,p.description,w,p.id,p.jsx,p.action,p.cancel]);const fn=ye.useCallback(()=>{ce(!0),dt(hr.current),w(We=>We.filter(Wt=>Wt.toastId!==p.id)),setTimeout(()=>{k(p)},pH)},[p,k,w,hr]);ye.useEffect(()=>{if(p.promise&&Ye==="loading"||p.duration===1/0||p.type==="loading")return;let We;return T||_||Ps?(()=>{if(Ll.current<er.current){const wn=new Date().getTime()-er.current;Ve.current=Ve.current-wn}Ll.current=new Date().getTime()})():(()=>{Ve.current!==1/0&&(er.current=new Date().getTime(),We=setTimeout(()=>{p.onAutoClose==null||p.onAutoClose.call(p,p),fn()},Ve.current))})(),()=>clearTimeout(We)},[T,_,p,Ye,Ps,fn]),ye.useEffect(()=>{p.delete&&(fn(),p.onDismiss==null||p.onDismiss.call(p,p))},[fn,p.delete]);function as(){var We;if(Z!=null&&Z.loading){var Wt;return ye.createElement("div",{className:Js(q==null?void 0:q.loader,p==null||(Wt=p.classNames)==null?void 0:Wt.loader,"sonner-loader"),"data-visible":Ye==="loading"},Z.loading)}return ye.createElement(GV,{className:Js(q==null?void 0:q.loader,p==null||(We=p.classNames)==null?void 0:We.loader),visible:Ye==="loading"})}const vo=p.icon||(Z==null?void 0:Z[Ye])||WV(Ye);var xi,bi;return ye.createElement("li",{tabIndex:0,ref:tt,className:Js(D,On,q==null?void 0:q.toast,p==null||(e=p.classNames)==null?void 0:e.toast,q==null?void 0:q[on],p==null||(n=p.classNames)==null?void 0:n[on]),"data-sonner-toast":"","data-rich-colors":(xi=p.richColors)!=null?xi:R,"data-styled":!(p.jsx||p.unstyled||m),"data-mounted":oe,"data-promise":!!p.promise,"data-swiped":Be,"data-removed":ee,"data-visible":nt,"data-y-position":mo,"data-x-position":go,"data-index":S,"data-front":_t,"data-swiping":we,"data-dismissible":an,"data-type":Ye,"data-invert":os,"data-swipe-out":ie,"data-swipe-direction":F,"data-expanded":!!(T||W&&oe),"data-testid":p.testId,style:{"--index":S,"--toasts-before":S,"--z-index":P.length-S,"--offset":`${ee?$e:hr.current}px`,"--initial-height":W?"auto":`${Qt}px`,...L,...p.style},onDragEnd:()=>{le(!1),H(null),Jt.current=null},onPointerDown:We=>{We.button!==2&&(Ws||!an||(qe.current=new Date,dt(hr.current),We.target.setPointerCapture(We.pointerId),We.target.tagName!=="BUTTON"&&(le(!0),Jt.current={x:We.clientX,y:We.clientY})))},onPointerUp:()=>{var We,Wt,Ot;if(ie||!an)return;Jt.current=null;const wn=Number(((We=tt.current)==null?void 0:We.style.getPropertyValue("--swipe-amount-x").replace("px",""))||0),Nr=Number(((Wt=tt.current)==null?void 0:Wt.style.getPropertyValue("--swipe-amount-y").replace("px",""))||0),qt=new Date().getTime()-((Ot=qe.current)==null?void 0:Ot.getTime()),ln=J==="x"?wn:Nr,tr=Math.abs(ln)/qt;if((J==="x"?_n.includes(wn>0?"right":"left"):_n.includes(Nr>0?"bottom":"top"))&&(Math.abs(ln)>=hH||tr>.11)){dt(hr.current),p.onDismiss==null||p.onDismiss.call(p,p),X(J==="x"?wn>0?"right":"left":Nr>0?"down":"up"),fn(),Ne(!0);return}else{var Ln,qs;(Ln=tt.current)==null||Ln.style.setProperty("--swipe-amount-x","0px"),(qs=tt.current)==null||qs.style.setProperty("--swipe-amount-y","0px")}Pe(!1),le(!1),H(null)},onPointerMove:We=>{var Wt,Ot,wn;if(!Jt.current||!an||((Wt=window.getSelection())==null?void 0:Wt.toString().length)>0)return;const qt=We.clientY-Jt.current.y,ln=We.clientX-Jt.current.x;!J&&(Math.abs(ln)>1||Math.abs(qt)>1)&&H(Math.abs(ln)>Math.abs(qt)?"x":"y");let tr={x:0,y:0};const ls=Ln=>1/(1.5+Math.abs(Ln)/20);if(J==="y"){if(_n.includes("top")||_n.includes("bottom"))if(_n.includes("top")&&qt<0||_n.includes("bottom")&&qt>0)tr.y=qt;else{const Ln=qt*ls(qt);tr.y=Math.abs(Ln)<Math.abs(qt)?Ln:qt}}else if(J==="x"&&(_n.includes("left")||_n.includes("right")))if(_n.includes("left")&&ln<0||_n.includes("right")&&ln>0)tr.x=ln;else{const Ln=ln*ls(ln);tr.x=Math.abs(Ln)<Math.abs(ln)?Ln:ln}(Math.abs(tr.x)>0||Math.abs(tr.y)>0)&&Pe(!0),(Ot=tt.current)==null||Ot.style.setProperty("--swipe-amount-x",`${tr.x}px`),(wn=tt.current)==null||wn.style.setProperty("--swipe-amount-y",`${tr.y}px`)}},is&&!p.jsx&&Ye!=="loading"?ye.createElement("button",{"aria-label":V,"data-disabled":Ws,"data-close-button":!0,onClick:Ws||!an?()=>{}:()=>{fn(),p.onDismiss==null||p.onDismiss.call(p,p)},className:Js(q==null?void 0:q.closeButton,p==null||(r=p.classNames)==null?void 0:r.closeButton)},(bi=Z==null?void 0:Z.close)!=null?bi:QV):null,(Ye||p.icon||p.promise)&&p.icon!==null&&((Z==null?void 0:Z[Ye])!==null||p.icon)?ye.createElement("div",{"data-icon":"",className:Js(q==null?void 0:q.icon,p==null||(s=p.classNames)==null?void 0:s.icon)},Ye==="loading"?p.icon||as():p.promise?as():null,Ye!=="loading"?vo:null):null,ye.createElement("div",{"data-content":"",className:Js(q==null?void 0:q.content,p==null||(i=p.classNames)==null?void 0:i.content)},ye.createElement("div",{"data-title":"",className:Js(q==null?void 0:q.title,p==null||(a=p.classNames)==null?void 0:a.title)},p.jsx?p.jsx:typeof p.title=="function"?p.title():p.title),p.description?ye.createElement("div",{"data-description":"",className:Js(N,po,q==null?void 0:q.description,p==null||(u=p.classNames)==null?void 0:u.description)},typeof p.description=="function"?p.description():p.description):null),ye.isValidElement(p.cancel)?p.cancel:p.cancel&&fp(p.cancel)?ye.createElement("button",{"data-button":!0,"data-cancel":!0,style:p.cancelButtonStyle||A,onClick:We=>{fp(p.cancel)&&an&&(p.cancel.onClick==null||p.cancel.onClick.call(p.cancel,We),fn())},className:Js(q==null?void 0:q.cancelButton,p==null||(c=p.classNames)==null?void 0:c.cancelButton)},p.cancel.label):null,ye.isValidElement(p.action)?p.action:p.action&&fp(p.action)?ye.createElement("button",{"data-button":!0,"data-action":!0,style:p.actionButtonStyle||O,onClick:We=>{fp(p.action)&&(p.action.onClick==null||p.action.onClick.call(p.action,We),!We.defaultPrevented&&fn())},className:Js(q==null?void 0:q.actionButton,p==null||(d=p.classNames)==null?void 0:d.actionButton)},p.action.label):null)};function t4(){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 vH(t,e){const n={};return[t,e].forEach((r,s)=>{const i=s===1,a=i?"--mobile-offset":"--offset",u=i?cH:uH;function c(d){["top","right","bottom","left"].forEach(h=>{n[`${a}-${h}`]=typeof d=="number"?`${d}px`:d})}typeof r=="number"||typeof r=="string"?c(r):typeof r=="object"?["top","right","bottom","left"].forEach(d=>{r[d]===void 0?n[`${a}-${d}`]=u:n[`${a}-${d}`]=typeof r[d]=="number"?`${r[d]}px`:r[d]}):c(u)}),n}const yH=ye.forwardRef(function(e,n){const{id:r,invert:s,position:i="bottom-right",hotkey:a=["altKey","KeyT"],expand:u,closeButton:c,className:d,offset:h,mobileOffset:p,theme:m="light",richColors:_,duration:w,style:y,visibleToasts:x=lH,toastOptions:S,dir:P=t4(),gap:T=fH,icons:k,customAriaLabel:R,containerAriaLabel:M="Notifications"}=e,[L,A]=ye.useState([]),O=ye.useMemo(()=>r?L.filter(se=>se.toasterId===r):L.filter(se=>!se.toasterId),[L,r]),D=ye.useMemo(()=>Array.from(new Set([i].concat(O.filter(se=>se.position).map(se=>se.position)))),[O,i]),[N,j]=ye.useState([]),[G,Y]=ye.useState(!1),[W,q]=ye.useState(!1),[Z,V]=ye.useState(m!=="system"?m:typeof window<"u"&&window.matchMedia&&window.matchMedia("(prefers-color-scheme: dark)").matches?"dark":"light"),J=ye.useRef(null),H=a.join("+").replace(/Key/g,"").replace(/Digit/g,""),F=ye.useRef(null),X=ye.useRef(!1),oe=ye.useCallback(se=>{A(ee=>{var ce;return(ce=ee.find(we=>we.id===se.id))!=null&&ce.delete||Er.dismiss(se.id),ee.filter(({id:we})=>we!==se.id)})},[]);return ye.useEffect(()=>Er.subscribe(se=>{if(se.dismiss){requestAnimationFrame(()=>{A(ee=>ee.map(ce=>ce.id===se.id?{...ce,delete:!0}:ce))});return}setTimeout(()=>{UV.flushSync(()=>{A(ee=>{const ce=ee.findIndex(we=>we.id===se.id);return ce!==-1?[...ee.slice(0,ce),{...ee[ce],...se},...ee.slice(ce+1)]:[se,...ee]})})})}),[]),ye.useEffect(()=>{if(m!=="system"){V(m);return}if(m==="system"&&(window.matchMedia&&window.matchMedia("(prefers-color-scheme: dark)").matches?V("dark"):V("light")),typeof window>"u")return;const se=window.matchMedia("(prefers-color-scheme: dark)");try{se.addEventListener("change",({matches:ee})=>{V(ee?"dark":"light")})}catch{se.addListener(({matches:ce})=>{try{V(ce?"dark":"light")}catch(we){console.error(we)}})}},[m]),ye.useEffect(()=>{L.length<=1&&Y(!1)},[L]),ye.useEffect(()=>{const se=ee=>{var ce;if(a.length>0&&a.every(ie=>ee[ie]||ee.code===ie)){var le;Y(!0),(le=J.current)==null||le.focus()}ee.code==="Escape"&&(document.activeElement===J.current||(ce=J.current)!=null&&ce.contains(document.activeElement))&&Y(!1)};return document.addEventListener("keydown",se),()=>document.removeEventListener("keydown",se)},[a]),ye.useEffect(()=>{if(J.current)return()=>{F.current&&(F.current.focus({preventScroll:!0}),F.current=null,X.current=!1)}},[J.current]),ye.createElement("section",{ref:n,"aria-label":R??`${M} ${H}`,tabIndex:-1,"aria-live":"polite","aria-relevant":"additions text","aria-atomic":"false",suppressHydrationWarning:!0,"data-react-aria-top-layer":!0},D.map((se,ee)=>{var ce;const[we,le]=se.split("-");return O.length?ye.createElement("ol",{key:se,dir:P==="auto"?t4():P,tabIndex:-1,ref:J,className:d,"data-sonner-toaster":!0,"data-sonner-theme":Z,"data-y-position":we,"data-x-position":le,style:{"--front-toast-height":`${((ce=N[0])==null?void 0:ce.height)||0}px`,"--width":`${dH}px`,"--gap":`${T}px`,...y,...vH(h,p)},onBlur:ie=>{X.current&&!ie.currentTarget.contains(ie.relatedTarget)&&(X.current=!1,F.current&&(F.current.focus({preventScroll:!0}),F.current=null))},onFocus:ie=>{ie.target instanceof HTMLElement&&ie.target.dataset.dismissible==="false"||X.current||(X.current=!0,F.current=ie.relatedTarget)},onMouseEnter:()=>Y(!0),onMouseMove:()=>Y(!0),onMouseLeave:()=>{W||Y(!1)},onDragEnd:()=>Y(!1),onPointerDown:ie=>{ie.target instanceof HTMLElement&&ie.target.dataset.dismissible==="false"||q(!0)},onPointerUp:()=>q(!1)},O.filter(ie=>!ie.position&&ee===0||ie.position===se).map((ie,Ne)=>{var Be,Pe;return ye.createElement(gH,{key:ie.id,icons:k,index:Ne,toast:ie,defaultRichColors:_,duration:(Be=S==null?void 0:S.duration)!=null?Be:w,className:S==null?void 0:S.className,descriptionClassName:S==null?void 0:S.descriptionClassName,invert:s,visibleToasts:x,closeButton:(Pe=S==null?void 0:S.closeButton)!=null?Pe:c,interacting:W,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:oe,toasts:O.filter($e=>$e.position==ie.position),heights:N.filter($e=>$e.position==ie.position),setHeights:j,expandByDefault:u,gap:T,expanded:G,swipeDirections:e.swipeDirections})})):null}))});var _H=Object.defineProperty,mc=(t,e)=>_H(t,"name",{value:e,configurable:!0}),UT=!!(typeof window<"u"&&window.document&&window.document.createElement);function Ft(t,e,{checkForDefaultPrevented:n=!0}={}){return mc(function(s){if(t==null||t(s),n===!1||!s||!s.defaultPrevented)return e==null?void 0:e(s)},"handleEvent")}mc(Ft,"composeEventHandlers");function wH(t){var e;if(!UT)throw new Error("Cannot access window outside of the DOM");return((e=t==null?void 0:t.ownerDocument)==null?void 0:e.defaultView)??window}mc(wH,"getOwnerWindow");function E_(t){if(!UT)throw new Error("Cannot access document outside of the DOM");return(t==null?void 0:t.ownerDocument)??document}mc(E_,"getOwnerDocument");function BT(t,e=!1){const{activeElement:n}=E_(t);if(!(n!=null&&n.nodeName))return null;if(WT(n)&&n.contentDocument)return BT(n.contentDocument.body,e);if(e){const r=n.getAttribute("aria-activedescendant");if(r){const s=E_(n).getElementById(r);if(s)return s}}return n}mc(BT,"getActiveElement");function WT(t){return t.tagName==="IFRAME"}mc(WT,"isFrame");var xH=Object.defineProperty,yw=(t,e)=>xH(t,"name",{value:e,configurable:!0});function C_(t,e){if(typeof t=="function")return t(e);t!=null&&(t.current=e)}yw(C_,"setRef");function qT(...t){return e=>{let n=!1;const r=t.map(s=>{const i=C_(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():C_(t[s],null)}}}}yw(qT,"composeRefs");function Vt(...t){return v.useCallback(qT(...t),t)}yw(Vt,"useComposedRefs");var bH=Object.defineProperty,_s=(t,e)=>bH(t,"name",{value:e,configurable:!0});function SH(t,e){const n=v.createContext(e);n.displayName=t+"Context";const r=_s(i=>{const{children:a,...u}=i,c=v.useMemo(()=>u,Object.values(u));return E.jsx(n.Provider,{value:c,children:a})},"Provider");r.displayName=t+"Provider";function s(i,a={}){const{optional:u=!1}=a,c=v.useContext(n);if(c)return c;if(e!==void 0)return e;if(!u)throw new Error(`\`${i}\` must be used within \`${t}\``)}return _s(s,"useContext"),[r,s]}_s(SH,"createContext");function _i(t,e=[]){let n=[];function r(i,a){const u=v.createContext(a);u.displayName=i+"Context";const c=n.length;n=[...n,a];const d=_s(p=>{var S;const{scope:m,children:_,...w}=p,y=((S=m==null?void 0:m[t])==null?void 0:S[c])||u,x=v.useMemo(()=>w,Object.values(w));return E.jsx(y.Provider,{value:x,children:_})},"Provider");d.displayName=i+"Provider";function h(p,m,_={}){var S;const{optional:w=!1}=_,y=((S=m==null?void 0:m[t])==null?void 0:S[c])||u,x=v.useContext(y);if(x)return x;if(a!==void 0)return a;if(!w)throw new Error(`\`${p}\` must be used within \`${i}\``)}return _s(h,"useContext"),[d,h]}_s(r,"createContext");const s=_s(()=>{const i=n.map(a=>v.createContext(a));return _s(function(u){const c=(u==null?void 0:u[t])||i;return v.useMemo(()=>({[`__scope${t}`]:{...u,[t]:c}}),[u,c])},"useScope")},"createScope");return s.scopeName=t,[r,GT(s,...e)]}_s(_i,"createContextScope");function GT(...t){const e=t[0];if(t.length===1)return e;const n=_s(()=>{const r=t.map(s=>({useScope:s(),scopeName:s.scopeName}));return _s(function(i){const a=r.reduce((u,{useScope:c,scopeName:d})=>{const p=c(i)[`__scope${d}`];return{...u,...p}},{});return v.useMemo(()=>({[`__scope${e.scopeName}`]:a}),[a])},"useComposedScopes")},"createScope");return n.scopeName=e.scopeName,n}_s(GT,"composeContextScopes");var Rr=globalThis!=null&&globalThis.document?v.useLayoutEffect:()=>{},EH=Object.defineProperty,CH=(t,e)=>EH(t,"name",{value:e,configurable:!0}),kH=Ef[" useId ".trim().toString()]||(()=>{}),PH=0;function na(t){const[e,n]=v.useState(kH());return Rr(()=>{t||n(r=>r??String(PH++))},[t]),t||(e?`radix-${e}`:"")}CH(na,"useId");var TH=Object.defineProperty,RH=(t,e)=>TH(t,"name",{value:e,configurable:!0}),n4=Ef[" useEffectEvent ".trim().toString()],r4=Ef[" useInsertionEffect ".trim().toString()];function KT(t){if(typeof n4=="function")return n4(t);const e=v.useRef(()=>{throw new Error("Cannot call an event handler while rendering.")});return typeof r4=="function"?r4(()=>{e.current=t}):Rr(()=>{e.current=t}),v.useMemo(()=>((...n)=>{var r;return(r=e.current)==null?void 0:r.call(e,...n)}),[])}RH(KT,"useEffectEvent");var AH=Object.defineProperty,Af=(t,e)=>AH(t,"name",{value:e,configurable:!0}),IH=Ef[" useInsertionEffect ".trim().toString()]||Rr;function va({prop:t,defaultProp:e,onChange:n=Af(()=>{},"onChange"),caller:r}){const[s,i,a]=ZT({defaultProp:e,onChange:n}),u=t!==void 0,c=u?t:s,d=v.useCallback(h=>{var p;if(u){const m=YT(h)?h(t):h;m!==t&&((p=a.current)==null||p.call(a,m))}else i(h)},[u,t,i,a]);return[c,d]}Af(va,"useControllableState");function ZT({defaultProp:t,onChange:e}){const[n,r]=v.useState(t),s=v.useRef(n),i=v.useRef(e);return IH(()=>{i.current=e},[e]),v.useEffect(()=>{var a;s.current!==n&&((a=i.current)==null||a.call(i,n),s.current=n)},[n,s]),[n,r,i]}Af(ZT,"useUncontrolledState");function YT(t){return typeof t=="function"}Af(YT,"isFunction");var s4=Symbol("RADIX:SYNC_STATE");function MH(t,e,n,r){const{prop:s,defaultProp:i,onChange:a,caller:u}=e,c=s!==void 0,d=KT(a),h=[{...n,state:i}];r&&h.push(r);const[p,m]=v.useReducer((x,S)=>{if(S.type===s4)return{...x,state:S.state};const P=t(x,S);return c&&!Object.is(P.state,x.state)&&d(P.state),P},...h),_=p.state,w=v.useRef(_);v.useEffect(()=>{w.current!==_&&(w.current=_,c||d(_))},[_,w,c]);const y=v.useMemo(()=>s!==void 0?{...p,state:s}:p,[p,s]);return v.useEffect(()=>{c&&!Object.is(s,p.state)&&m({type:s4,state:s})},[s,p.state,c]),[y,m]}Af(MH,"useControllableStateReducer");var OH=Object.defineProperty,Us=(t,e)=>OH(t,"name",{value:e,configurable:!0});function ca(t){const e=v.forwardRef((n,r)=>{let{children:s,...i}=n,a=null,u=!1;const c=[];k_(s)&&typeof hp=="function"&&(s=hp(s._payload)),v.Children.forEach(s,m=>{var _;if(tR(m)){u=!0;const w=m;let y="child"in w.props?w.props.child:w.props.children;k_(y)&&typeof hp=="function"&&(y=hp(y._payload)),a=LH(w,y),c.push((_=a==null?void 0:a.props)==null?void 0:_.children)}else c.push(m)}),a?a=v.cloneElement(a,void 0,c):!u&&v.Children.count(s)===1&&v.isValidElement(s)&&(a=s);const d=a?eR(a):void 0,h=Vt(r,d);if(!a){if(s||s===0)throw new Error(u?jH(t):NH(t));return s}const p=JT(i,a.props??{});return a.type!==v.Fragment&&(p.ref=r?h:d),v.cloneElement(a,p)});return e.displayName=`${t}.Slot`,e}Us(ca,"createSlot");var XT=Symbol.for("radix.slottable");function QT(t){const e=Us(n=>"child"in n?n.children(n.child):n.children,"Slottable");return e.displayName=`${t}.Slottable`,e.__radixId=XT,e}Us(QT,"createSlottable");var LH=Us((t,e)=>{if("child"in t.props){const n=t.props.child;return v.isValidElement(n)?v.cloneElement(n,void 0,t.props.children(n.props.children)):null}return v.isValidElement(e)?e:null},"getSlottableElementFromSlottable");function JT(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]=(...u)=>{const c=i(...u);return s(...u),c}:s&&(n[r]=s):r==="style"?n[r]={...s,...i}:r==="className"&&(n[r]=[s,i].filter(Boolean).join(" "))}return{...t,...n}}Us(JT,"mergeProps");function eR(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)}Us(eR,"getElementRef");function tR(t){return v.isValidElement(t)&&typeof t.type=="function"&&"__radixId"in t.type&&t.type.__radixId===XT}Us(tR,"isSlottable");var DH=Symbol.for("react.lazy");function k_(t){return t!=null&&typeof t=="object"&&"$$typeof"in t&&t.$$typeof===DH&&"_payload"in t&&nR(t._payload)}Us(k_,"isLazyComponent");function nR(t){return typeof t=="object"&&t!==null&&"then"in t}Us(nR,"isPromiseLike");var NH=Us(t=>`${t} failed to slot onto its children. Expected a single React element child or \`Slottable\`.`,"createSlotError"),jH=Us(t=>`${t} failed to slot onto its \`Slottable\`. Expected \`Slottable\` to receive a single React element child.`,"createSlottableError"),hp=Ef[" use ".trim().toString()],FH=Object.defineProperty,$H=(t,e)=>FH(t,"name",{value:e,configurable:!0}),VH=["a","button","div","form","h2","h3","img","input","label","li","nav","ol","p","select","span","svg","ul"],dn=VH.reduce((t,e)=>{const n=ca(`Primitive.${e}`),r=v.forwardRef((s,i)=>{const{asChild:a,...u}=s,c=a?n:e;return typeof window<"u"&&(window[Symbol.for("radix-ui")]=!0),E.jsx(c,{...u,ref:i})});return r.displayName=`Primitive.${e}`,{...t,[e]:r}},{});function rR(t,e){t&&v0.flushSync(()=>t.dispatchEvent(e))}$H(rR,"dispatchDiscreteCustomEvent");var HH=Object.defineProperty,zH=(t,e)=>HH(t,"name",{value:e,configurable:!0});function Rl(t){const e=v.useRef(t);return v.useEffect(()=>{e.current=t}),v.useMemo(()=>((...n)=>{var r;return(r=e.current)==null?void 0:r.call(e,...n)}),[])}zH(Rl,"useCallbackRef");var UH=Object.defineProperty,Rn=(t,e)=>UH(t,"name",{value:e,configurable:!0}),P_="dismissableLayer.update",BH="dismissableLayer.pointerDownOutside",WH="dismissableLayer.focusOutside",i4,sR=v.createContext({layers:new Set,layersWithOutsidePointerEventsDisabled:new Set,branches:new Set,dismissableSurfaces:new Set}),_w=v.forwardRef(Rn(function(e,n){const{disableOutsidePointerEvents:r=!1,deferPointerDownOutside:s=!1,onEscapeKeyDown:i,onPointerDownOutside:a,onFocusOutside:u,onInteractOutside:c,onDismiss:d,...h}=e,p=v.useContext(sR),[m,_]=v.useState(null),w=(m==null?void 0:m.ownerDocument)??(globalThis==null?void 0:globalThis.document),[,y]=v.useState({}),x=Vt(n,_),S=Array.from(p.layers),[P]=[...p.layersWithOutsidePointerEventsDisabled].slice(-1),T=P?S.indexOf(P):-1,k=m?S.indexOf(m):-1,R=p.layersWithOutsidePointerEventsDisabled.size>0,M=k>=T,L=v.useRef(!1),A=oR(j=>{a==null||a(j),c==null||c(j),j.defaultPrevented||d==null||d()},{ownerDocument:w,deferPointerDownOutside:s,isDeferredPointerDownOutsideRef:L,dismissableSurfaces:p.dismissableSurfaces,shouldHandlePointerDownOutside:v.useCallback(j=>{if(!(j instanceof Node))return!1;const G=[...p.branches].some(Y=>Y.contains(j));return M&&!G},[p.branches,M])}),O=aR(j=>{if(s&&L.current)return;const G=j.target;[...p.branches].some(W=>W.contains(G))||(u==null||u(j),c==null||c(j),j.defaultPrevented||d==null||d())},w),D=m?k===S.length-1:!1,N=Rl(j=>{j.key==="Escape"&&(i==null||i(j),!j.defaultPrevented&&d&&(j.preventDefault(),d()))});return v.useEffect(()=>{if(D)return w.addEventListener("keydown",N,{capture:!0}),()=>w.removeEventListener("keydown",N,{capture:!0})},[w,D,N]),v.useEffect(()=>{if(m)return r&&(p.layersWithOutsidePointerEventsDisabled.size===0&&(i4=w.body.style.pointerEvents,w.body.style.pointerEvents="none"),p.layersWithOutsidePointerEventsDisabled.add(m)),p.layers.add(m),T_(),()=>{r&&(p.layersWithOutsidePointerEventsDisabled.delete(m),p.layersWithOutsidePointerEventsDisabled.size===0&&(w.body.style.pointerEvents=i4))}},[m,w,r,p]),v.useEffect(()=>()=>{m&&(p.layers.delete(m),p.layersWithOutsidePointerEventsDisabled.delete(m),T_())},[m,p]),v.useEffect(()=>{const j=Rn(()=>y({}),"handleUpdate");return document.addEventListener(P_,j),()=>document.removeEventListener(P_,j)},[]),E.jsx(dn.div,{...h,ref:x,style:{pointerEvents:R?M?"auto":"none":void 0,...e.style},onFocusCapture:Ft(e.onFocusCapture,O.onFocusCapture),onBlurCapture:Ft(e.onBlurCapture,O.onBlurCapture),onPointerDownCapture:Ft(e.onPointerDownCapture,A.onPointerDownCapture)})},"DismissableLayer"));function iR(){const t=v.useContext(sR),[e,n]=v.useState(null);return v.useEffect(()=>{if(e)return t.dismissableSurfaces.add(e),()=>{t.dismissableSurfaces.delete(e)}},[e,t.dismissableSurfaces]),n}Rn(iR,"useDismissableLayerSurface");var qH=Rn(()=>!0,"IS_TRUE");function oR(t,e){const{ownerDocument:n=globalThis==null?void 0:globalThis.document,deferPointerDownOutside:r=!1,isDeferredPointerDownOutsideRef:s,dismissableSurfaces:i,shouldHandlePointerDownOutside:a=qH}=e,u=Rl(t),c=v.useRef(!1),d=v.useRef(!1),h=v.useRef(new Map),p=v.useRef(()=>{});return v.useEffect(()=>{function m(){d.current=!1,s.current=!1,h.current.clear()}Rn(m,"resetOutsideInteraction");function _(){return Array.from(h.current.values()).some(Boolean)}Rn(_,"isOutsideInteractionIntercepted");function w(T){if(!d.current)return;const k=T.target;k instanceof Node&&[...i].some(M=>M.contains(k))||h.current.set(T.type,!0),T.type==="click"&&window.setTimeout(()=>{d.current&&p.current()},0)}Rn(w,"handleInteractionCapture");function y(T){d.current&&h.current.set(T.type,!1)}Rn(y,"handleInteractionBubble");const x=Rn(T=>{if(T.target&&!c.current){let k=function(){n.removeEventListener("click",p.current);const M=_();m(),M||ww(BH,u,R,{discrete:!0})};if(Rn(k,"handleAndDispatchPointerDownOutsideEvent"),!a(T.target)){n.removeEventListener("click",p.current),m(),c.current=!1;return}const R={originalEvent:T};d.current=!0,s.current=r&&T.button===0,h.current.clear(),!r||T.button!==0?k():(n.removeEventListener("click",p.current),p.current=k,n.addEventListener("click",p.current,{once:!0}))}else n.removeEventListener("click",p.current),m();c.current=!1},"handlePointerDown"),S=["pointerup","mousedown","mouseup","touchstart","touchend","click"];for(const T of S)n.addEventListener(T,w,!0),n.addEventListener(T,y);const P=window.setTimeout(()=>{n.addEventListener("pointerdown",x)},0);return()=>{window.clearTimeout(P),n.removeEventListener("pointerdown",x),n.removeEventListener("click",p.current);for(const T of S)n.removeEventListener(T,w,!0),n.removeEventListener(T,y)}},[n,u,r,s,i,a]),{onPointerDownCapture:Rn(()=>c.current=!0,"onPointerDownCapture")}}Rn(oR,"usePointerDownOutside");function aR(t,e=globalThis==null?void 0:globalThis.document){const n=Rl(t),r=v.useRef(!1);return v.useEffect(()=>{const s=Rn(i=>{i.target&&!r.current&&ww(WH,n,{originalEvent:i},{discrete:!1})},"handleFocus");return e.addEventListener("focusin",s),()=>e.removeEventListener("focusin",s)},[e,n]),{onFocusCapture:Rn(()=>r.current=!0,"onFocusCapture"),onBlurCapture:Rn(()=>r.current=!1,"onBlurCapture")}}Rn(aR,"useFocusOutside");function T_(){const t=new CustomEvent(P_);document.dispatchEvent(t)}Rn(T_,"dispatchUpdate");function ww(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?rR(s,i):s.dispatchEvent(i)}Rn(ww,"handleAndDispatchCustomEvent");var GH=Object.defineProperty,cr=(t,e)=>GH(t,"name",{value:e,configurable:!0}),v1="focusScope.autoFocusOnMount",y1="focusScope.autoFocusOnUnmount",o4={bubbles:!1,cancelable:!0},lR=v.forwardRef(cr(function(e,n){const{loop:r=!1,trapped:s=!1,onMountAutoFocus:i,onUnmountAutoFocus:a,...u}=e,[c,d]=v.useState(null),h=Rl(i),p=Rl(a),m=v.useRef(null),_=Vt(n,d),w=v.useRef({paused:!1,pause(){this.paused=!0},resume(){this.paused=!1}}).current;v.useEffect(()=>{if(s){let x=function(k){if(w.paused||!c)return;const R=k.target;c.contains(R)?m.current=R:Ui(m.current,{select:!0})},S=function(k){if(w.paused||!c)return;const R=k.relatedTarget;R!==null&&(c.contains(R)||Ui(m.current,{select:!0}))},P=function(k){if(document.activeElement===document.body)for(const M of k)M.removedNodes.length>0&&Ui(c)};cr(x,"handleFocusIn"),cr(S,"handleFocusOut"),cr(P,"handleMutations"),document.addEventListener("focusin",x),document.addEventListener("focusout",S);const T=new MutationObserver(P);return c&&T.observe(c,{childList:!0,subtree:!0}),()=>{document.removeEventListener("focusin",x),document.removeEventListener("focusout",S),T.disconnect()}}},[s,c,w.paused]),v.useEffect(()=>{if(c){a4.add(w);const x=document.activeElement;if(!c.contains(x)){const P=new CustomEvent(v1,o4);c.addEventListener(v1,h),c.dispatchEvent(P),P.defaultPrevented||(uR(pR(xw(c)),{select:!0}),document.activeElement===x&&Ui(c))}return()=>{c.removeEventListener(v1,h),setTimeout(()=>{const P=new CustomEvent(y1,o4);c.addEventListener(y1,p),c.dispatchEvent(P),P.defaultPrevented||Ui(x??document.body,{select:!0}),c.removeEventListener(y1,p),a4.remove(w)},0)}}},[c,h,p,w]);const y=v.useCallback(x=>{if(!r&&!s||w.paused)return;const S=x.key==="Tab"&&!x.altKey&&!x.ctrlKey&&!x.metaKey,P=document.activeElement;if(S&&P){const T=x.currentTarget,[k,R]=cR(T);k&&R?!x.shiftKey&&P===R?(x.preventDefault(),r&&Ui(k,{select:!0})):x.shiftKey&&P===k&&(x.preventDefault(),r&&Ui(R,{select:!0})):P===T&&x.preventDefault()}},[r,s,w.paused]);return E.jsx(dn.div,{tabIndex:-1,...u,ref:_,onKeyDown:y})},"FocusScope"));function uR(t,{select:e=!1}={}){const n=document.activeElement;for(const r of t)if(Ui(r,{select:e}),document.activeElement!==n)return}cr(uR,"focusFirst");function cR(t){const e=xw(t),n=R_(e,t),r=R_(e.reverse(),t);return[n,r]}cr(cR,"getTabbableEdges");function xw(t){const e=[],n=document.createTreeWalker(t,NodeFilter.SHOW_ELEMENT,{acceptNode:cr(r=>{const s=r.tagName==="INPUT"&&r.type==="hidden";return r.disabled||r.hidden||s?NodeFilter.FILTER_SKIP:r.tabIndex>=0?NodeFilter.FILTER_ACCEPT:NodeFilter.FILTER_SKIP},"acceptNode")});for(;n.nextNode();)e.push(n.currentNode);return e}cr(xw,"getTabbableCandidates");function R_(t,e){const n=typeof e.checkVisibility=="function"&&e.checkVisibility({checkVisibilityCSS:!0});for(const r of t)if(!(n?!r.checkVisibility({checkVisibilityCSS:!0}):dR(r,{upTo:e})))return r}cr(R_,"findVisible");function dR(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}cr(dR,"isHidden");function fR(t){return t instanceof HTMLInputElement&&"select"in t}cr(fR,"isSelectableInput");function Ui(t,{select:e=!1}={}){if(t&&t.focus){const n=document.activeElement;t.focus({preventScroll:!0}),t!==n&&fR(t)&&e&&t.select()}}cr(Ui,"focus");var a4=hR();function hR(){let t=[];return{add(e){const n=t[0];e!==n&&(n==null||n.pause()),t=A_(t,e),t.unshift(e)},remove(e){var n;t=A_(t,e),(n=t[0])==null||n.resume()}}}cr(hR,"createFocusScopesStack");function A_(t,e){const n=[...t],r=n.indexOf(e);return r!==-1&&n.splice(r,1),n}cr(A_,"arrayRemove");function pR(t){return t.filter(e=>e.tagName!=="A")}cr(pR,"removeLinks");var KH=Object.defineProperty,ZH=(t,e)=>KH(t,"name",{value:e,configurable:!0}),bw=v.forwardRef(ZH(function(e,n){var c;const{container:r,...s}=e,[i,a]=v.useState(!1);Rr(()=>a(!0),[]);const u=r||i&&((c=globalThis==null?void 0:globalThis.document)==null?void 0:c.body);return u?v0.createPortal(E.jsx(dn.div,{...s,ref:n}),u):null},"Portal")),YH=Object.defineProperty,oo=(t,e)=>YH(t,"name",{value:e,configurable:!0});function mR(t,e){return v.useReducer((n,r)=>e[n][r]??n,t)}oo(mR,"useStateMachine");var ya=oo(t=>{const{present:e,children:n}=t,r=gR(e),s=typeof n=="function"?n({present:r.isPresent}):v.Children.only(n),i=vR(r.ref,yR(s));return typeof n=="function"||r.isPresent?v.cloneElement(s,{ref:i}):null},"Presence");function gR(t){const[e,n]=v.useState(),r=v.useRef(null),s=v.useRef(t),i=v.useRef("none"),a=v.useRef(void 0),u=t?"mounted":"unmounted",[c,d]=mR(u,{mounted:{UNMOUNT:"unmounted",ANIMATION_OUT:"unmountSuspended"},unmountSuspended:{MOUNT:"mounted",ANIMATION_END:"unmounted"},unmounted:{MOUNT:"mounted"}});return v.useEffect(()=>{c==="mounted"?(i.current=a.current??wu(r.current),a.current=void 0):i.current="none"},[c]),Rr(()=>{const h=r.current,p=s.current;if(p!==t){const _=i.current,w=wu(h);t?(a.current=w,d("MOUNT")):w==="none"||(h==null?void 0:h.display)==="none"?d("UNMOUNT"):d(p&&_!==w?"ANIMATION_OUT":"UNMOUNT"),s.current=t}},[t,d]),Rr(()=>{if(e){let h;const p=e.ownerDocument.defaultView??window,m=oo(w=>{const x=wu(r.current).includes(CSS.escape(w.animationName));if(w.target===e&&x&&(d("ANIMATION_END"),!s.current)){const S=e.style.animationFillMode;e.style.animationFillMode="forwards",h=p.setTimeout(()=>{e.style.animationFillMode==="forwards"&&(e.style.animationFillMode=S)})}},"handleAnimationEnd"),_=oo(w=>{w.target===e&&(i.current=wu(r.current))},"handleAnimationStart");return e.addEventListener("animationstart",_),e.addEventListener("animationcancel",m),e.addEventListener("animationend",m),()=>{p.clearTimeout(h),e.removeEventListener("animationstart",_),e.removeEventListener("animationcancel",m),e.removeEventListener("animationend",m)}}else d("ANIMATION_END")},[e,d]),{isPresent:["mounted","unmountSuspended"].includes(c),ref:v.useCallback(h=>{if(h){const p=getComputedStyle(h);r.current=p,a.current=wu(p)}else r.current=null;n(h)},[])}}oo(gR,"usePresence");function I_(t,e){if(typeof t=="function")return t(e);t!=null&&(t.current=e)}oo(I_,"setRef");function vR(...t){const e=v.useRef(t);return e.current=t,v.useCallback(n=>{const r=e.current;let s=!1;const i=r.map(a=>{const u=I_(a,n);return!s&&typeof u=="function"&&(s=!0),u});if(s)return()=>{for(let a=0;a<i.length;a++){const u=i[a];typeof u=="function"?u():I_(r[a],null)}}},[])}oo(vR,"useStableComposedRefs");function wu(t){return(t==null?void 0:t.animationName)||"none"}oo(wu,"getAnimationName");function yR(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)}oo(yR,"getElementRef");var XH=Object.defineProperty,Sw=(t,e)=>XH(t,"name",{value:e,configurable:!0}),pp=0,ei=null;function QH(t){return y0(),t.children}Sw(QH,"FocusGuards");function y0(){v.useEffect(()=>{ei||(ei={start:M_(),end:M_()});const{start:t,end:e}=ei;return document.body.firstElementChild!==t&&document.body.insertAdjacentElement("afterbegin",t),document.body.lastElementChild!==e&&document.body.insertAdjacentElement("beforeend",e),pp++,()=>{pp===1&&(ei==null||ei.start.remove(),ei==null||ei.end.remove(),ei=null),pp=Math.max(0,pp-1)}},[])}Sw(y0,"useFocusGuards");function M_(){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}Sw(M_,"createFocusGuard");var ui=function(){return ui=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},ui.apply(this,arguments)};function _R(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 JH(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 Wp="right-scroll-bar-position",qp="width-before-scroll-bar",ez="with-scroll-bars-hidden",tz="--removed-body-scroll-bar-size";function _1(t,e){return typeof t=="function"?t(e):t&&(t.current=e),t}function nz(t,e){var n=v.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 rz=typeof window<"u"?v.useLayoutEffect:v.useEffect,l4=new WeakMap;function sz(t,e){var n=nz(null,function(r){return t.forEach(function(s){return _1(s,r)})});return rz(function(){var r=l4.get(n);if(r){var s=new Set(r),i=new Set(t),a=n.current;s.forEach(function(u){i.has(u)||_1(u,null)}),i.forEach(function(u){s.has(u)||_1(u,a)})}l4.set(n,t)},[t]),n}function iz(t){return t}function oz(t,e){e===void 0&&(e=iz);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 a=e(i,r);return n.push(a),function(){n=n.filter(function(u){return u!==a})}},assignSyncMedium:function(i){for(r=!0;n.length;){var a=n;n=[],a.forEach(i)}n={push:function(u){return i(u)},filter:function(){return n}}},assignMedium:function(i){r=!0;var a=[];if(n.length){var u=n;n=[],u.forEach(i),a=n}var c=function(){var h=a;a=[],h.forEach(i)},d=function(){return Promise.resolve().then(c)};d(),n={push:function(h){a.push(h),d()},filter:function(h){return a=a.filter(h),n}}}};return s}function az(t){t===void 0&&(t={});var e=oz(null);return e.options=ui({async:!0,ssr:!1},t),e}var wR=function(t){var e=t.sideCar,n=_R(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 v.createElement(r,ui({},n))};wR.isSideCarExport=!0;function lz(t,e){return t.useMedium(e),wR}var xR=az(),w1=function(){},_0=v.forwardRef(function(t,e){var n=v.useRef(null),r=v.useState({onScrollCapture:w1,onWheelCapture:w1,onTouchMoveCapture:w1}),s=r[0],i=r[1],a=t.forwardProps,u=t.children,c=t.className,d=t.removeScrollBar,h=t.enabled,p=t.shards,m=t.sideCar,_=t.noRelative,w=t.noIsolation,y=t.inert,x=t.allowPinchZoom,S=t.as,P=S===void 0?"div":S,T=t.gapMode,k=_R(t,["forwardProps","children","className","removeScrollBar","enabled","shards","sideCar","noRelative","noIsolation","inert","allowPinchZoom","as","gapMode"]),R=m,M=sz([n,e]),L=ui(ui({},k),s);return v.createElement(v.Fragment,null,h&&v.createElement(R,{sideCar:xR,removeScrollBar:d,shards:p,noRelative:_,noIsolation:w,inert:y,setCallbacks:i,allowPinchZoom:!!x,lockRef:n,gapMode:T}),a?v.cloneElement(v.Children.only(u),ui(ui({},L),{ref:M})):v.createElement(P,ui({},L,{className:c,ref:M}),u))});_0.defaultProps={enabled:!0,removeScrollBar:!0,inert:!1};_0.classNames={fullWidth:qp,zeroRight:Wp};var uz=function(){if(typeof __webpack_nonce__<"u")return __webpack_nonce__};function cz(){if(!document)return null;var t=document.createElement("style");t.type="text/css";var e=uz();return e&&t.setAttribute("nonce",e),t}function dz(t,e){t.styleSheet?t.styleSheet.cssText=e:t.appendChild(document.createTextNode(e))}function fz(t){var e=document.head||document.getElementsByTagName("head")[0];e.appendChild(t)}var hz=function(){var t=0,e=null;return{add:function(n){t==0&&(e=cz())&&(dz(e,n),fz(e)),t++},remove:function(){t--,!t&&e&&(e.parentNode&&e.parentNode.removeChild(e),e=null)}}},pz=function(){var t=hz();return function(e,n){v.useEffect(function(){return t.add(e),function(){t.remove()}},[e&&n])}},bR=function(){var t=pz(),e=function(n){var r=n.styles,s=n.dynamic;return t(r,s),null};return e},mz={left:0,top:0,right:0,gap:0},x1=function(t){return parseInt(t||"",10)||0},gz=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[x1(n),x1(r),x1(s)]},vz=function(t){if(t===void 0&&(t="margin"),typeof window>"u")return mz;var e=gz(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])}},yz=bR(),Au="data-scroll-locked",_z=function(t,e,n,r){var s=t.left,i=t.top,a=t.right,u=t.gap;return n===void 0&&(n="margin"),`
72
- .`.concat(ez,` {
73
- overflow: hidden `).concat(r,`;
74
- padding-right: `).concat(u,"px ").concat(r,`;
75
- }
76
- body[`).concat(Au,`] {
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(a,`px;
83
- margin-left:0;
84
- margin-top:0;
85
- margin-right: `).concat(u,"px ").concat(r,`;
86
- `),n==="padding"&&"padding-right: ".concat(u,"px ").concat(r,";")].filter(Boolean).join(""),`
87
- }
88
-
89
- .`).concat(Wp,` {
90
- right: `).concat(u,"px ").concat(r,`;
91
- }
92
-
93
- .`).concat(qp,` {
94
- margin-right: `).concat(u,"px ").concat(r,`;
95
- }
96
-
97
- .`).concat(Wp," .").concat(Wp,` {
98
- right: 0 `).concat(r,`;
99
- }
100
-
101
- .`).concat(qp," .").concat(qp,` {
102
- margin-right: 0 `).concat(r,`;
103
- }
104
-
105
- body[`).concat(Au,`] {
106
- `).concat(tz,": ").concat(u,`px;
107
- }
108
- `)},u4=function(){var t=parseInt(document.body.getAttribute(Au)||"0",10);return isFinite(t)?t:0},wz=function(){v.useEffect(function(){return document.body.setAttribute(Au,(u4()+1).toString()),function(){var t=u4()-1;t<=0?document.body.removeAttribute(Au):document.body.setAttribute(Au,t.toString())}},[])},xz=function(t){var e=t.noRelative,n=t.noImportant,r=t.gapMode,s=r===void 0?"margin":r;wz();var i=v.useMemo(function(){return vz(s)},[s]);return v.createElement(yz,{styles:_z(i,!e,s,n?"":"!important")})},O_=!1;if(typeof window<"u")try{var mp=Object.defineProperty({},"passive",{get:function(){return O_=!0,!0}});window.addEventListener("test",mp,mp),window.removeEventListener("test",mp,mp)}catch{O_=!1}var du=O_?{passive:!1}:!1,bz=function(t){return t.tagName==="TEXTAREA"},SR=function(t,e){if(!(t instanceof Element))return!1;var n=window.getComputedStyle(t);return n[e]!=="hidden"&&!(n.overflowY===n.overflowX&&!bz(t)&&n[e]==="visible")},Sz=function(t){return SR(t,"overflowY")},Ez=function(t){return SR(t,"overflowX")},c4=function(t,e){var n=e.ownerDocument,r=e;do{typeof ShadowRoot<"u"&&r instanceof ShadowRoot&&(r=r.host);var s=ER(t,r);if(s){var i=CR(t,r),a=i[1],u=i[2];if(a>u)return!0}r=r.parentNode}while(r&&r!==n.body);return!1},Cz=function(t){var e=t.scrollTop,n=t.scrollHeight,r=t.clientHeight;return[e,n,r]},kz=function(t){var e=t.scrollLeft,n=t.scrollWidth,r=t.clientWidth;return[e,n,r]},ER=function(t,e){return t==="v"?Sz(e):Ez(e)},CR=function(t,e){return t==="v"?Cz(e):kz(e)},Pz=function(t,e){return t==="h"&&e==="rtl"?-1:1},Tz=function(t,e,n,r,s){var i=Pz(t,window.getComputedStyle(e).direction),a=i*r,u=n.target,c=e.contains(u),d=!1,h=a>0,p=0,m=0;do{if(!u)break;var _=CR(t,u),w=_[0],y=_[1],x=_[2],S=y-x-i*w;(w||S)&&ER(t,u)&&(p+=S,m+=w);var P=u.parentNode;u=P&&P.nodeType===Node.DOCUMENT_FRAGMENT_NODE?P.host:P}while(!c&&u!==document.body||c&&(e.contains(u)||e===u));return(h&&Math.abs(p)<1||!h&&Math.abs(m)<1)&&(d=!0),d},gp=function(t){return"changedTouches"in t?[t.changedTouches[0].clientX,t.changedTouches[0].clientY]:[0,0]},d4=function(t){return[t.deltaX,t.deltaY]},f4=function(t){return t&&"current"in t?t.current:t},Rz=function(t,e){return t[0]===e[0]&&t[1]===e[1]},Az=function(t){return`
109
- .block-interactivity-`.concat(t,` {pointer-events: none;}
110
- .allow-interactivity-`).concat(t,` {pointer-events: all;}
111
- `)},Iz=0,fu=[];function Mz(t){var e=v.useRef([]),n=v.useRef([0,0]),r=v.useRef(),s=v.useState(Iz++)[0],i=v.useState(bR)[0],a=v.useRef(t);v.useEffect(function(){a.current=t},[t]),v.useEffect(function(){if(t.inert){document.body.classList.add("block-interactivity-".concat(s));var y=JH([t.lockRef.current],(t.shards||[]).map(f4),!0).filter(Boolean);return y.forEach(function(x){return x.classList.add("allow-interactivity-".concat(s))}),function(){document.body.classList.remove("block-interactivity-".concat(s)),y.forEach(function(x){return x.classList.remove("allow-interactivity-".concat(s))})}}},[t.inert,t.lockRef.current,t.shards]);var u=v.useCallback(function(y,x){if("touches"in y&&y.touches.length===2||y.type==="wheel"&&y.ctrlKey)return!a.current.allowPinchZoom;var S=gp(y),P=n.current,T="deltaX"in y?y.deltaX:P[0]-S[0],k="deltaY"in y?y.deltaY:P[1]-S[1],R,M=y.target,L=Math.abs(T)>Math.abs(k)?"h":"v";if("touches"in y&&L==="h"&&M.type==="range")return!1;var A=window.getSelection(),O=A&&A.anchorNode,D=O?O===M||O.contains(M):!1;if(D)return!1;var N=c4(L,M);if(!N)return!0;if(N?R=L:(R=L==="v"?"h":"v",N=c4(L,M)),!N)return!1;if(!r.current&&"changedTouches"in y&&(T||k)&&(r.current=R),!R)return!0;var j=r.current||R;return Tz(j,x,y,j==="h"?T:k)},[]),c=v.useCallback(function(y){var x=y;if(!(!fu.length||fu[fu.length-1]!==i)){var S="deltaY"in x?d4(x):gp(x),P=e.current.filter(function(R){return R.name===x.type&&(R.target===x.target||x.target===R.shadowParent)&&Rz(R.delta,S)})[0];if(P&&P.should){x.cancelable&&x.preventDefault();return}if(!P){var T=(a.current.shards||[]).map(f4).filter(Boolean).filter(function(R){return R.contains(x.target)}),k=T.length>0?u(x,T[0]):!a.current.noIsolation;k&&x.cancelable&&x.preventDefault()}}},[]),d=v.useCallback(function(y,x,S,P){var T={name:y,delta:x,target:S,should:P,shadowParent:Oz(S)};e.current.push(T),setTimeout(function(){e.current=e.current.filter(function(k){return k!==T})},1)},[]),h=v.useCallback(function(y){n.current=gp(y),r.current=void 0},[]),p=v.useCallback(function(y){d(y.type,d4(y),y.target,u(y,t.lockRef.current))},[]),m=v.useCallback(function(y){d(y.type,gp(y),y.target,u(y,t.lockRef.current))},[]);v.useEffect(function(){return fu.push(i),t.setCallbacks({onScrollCapture:p,onWheelCapture:p,onTouchMoveCapture:m}),document.addEventListener("wheel",c,du),document.addEventListener("touchmove",c,du),document.addEventListener("touchstart",h,du),function(){fu=fu.filter(function(y){return y!==i}),document.removeEventListener("wheel",c,du),document.removeEventListener("touchmove",c,du),document.removeEventListener("touchstart",h,du)}},[]);var _=t.removeScrollBar,w=t.inert;return v.createElement(v.Fragment,null,w?v.createElement(i,{styles:Az(s)}):null,_?v.createElement(xz,{noRelative:t.noRelative,gapMode:t.gapMode}):null)}function Oz(t){for(var e=null;t!==null;)t instanceof ShadowRoot&&(e=t.host,t=t.host),t=t.parentNode;return e}const Lz=lz(xR,Mz);var Ew=v.forwardRef(function(t,e){return v.createElement(_0,ui({},t,{ref:e,sideCar:Lz}))});Ew.classNames=_0.classNames;var Dz=function(t){if(typeof document>"u")return null;var e=Array.isArray(t)?t[0]:t;return e.ownerDocument.body},hu=new WeakMap,vp=new WeakMap,yp={},b1=0,kR=function(t){return t&&(t.host||kR(t.parentNode))},Nz=function(t,e){return e.map(function(n){if(t.contains(n))return n;var r=kR(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})},jz=function(t,e,n,r){var s=Nz(e,Array.isArray(t)?t:[t]);yp[n]||(yp[n]=new WeakMap);var i=yp[n],a=[],u=new Set,c=new Set(s),d=function(p){!p||u.has(p)||(u.add(p),d(p.parentNode))};s.forEach(d);var h=function(p){!p||c.has(p)||Array.prototype.forEach.call(p.children,function(m){if(u.has(m))h(m);else try{var _=m.getAttribute(r),w=_!==null&&_!=="false",y=(hu.get(m)||0)+1,x=(i.get(m)||0)+1;hu.set(m,y),i.set(m,x),a.push(m),y===1&&w&&vp.set(m,!0),x===1&&m.setAttribute(n,"true"),w||m.setAttribute(r,"true")}catch(S){console.error("aria-hidden: cannot operate on ",m,S)}})};return h(e),u.clear(),b1++,function(){a.forEach(function(p){var m=hu.get(p)-1,_=i.get(p)-1;hu.set(p,m),i.set(p,_),m||(vp.has(p)||p.removeAttribute(r),vp.delete(p)),_||p.removeAttribute(n)}),b1--,b1||(hu=new WeakMap,hu=new WeakMap,vp=new WeakMap,yp={})}},PR=function(t,e,n){n===void 0&&(n="data-aria-hidden");var r=Array.from(Array.isArray(t)?t:[t]),s=Dz(t);return s?(r.push.apply(r,Array.from(s.querySelectorAll("[aria-live], script"))),jz(r,s,n,"aria-hidden")):function(){return null}},Fz=Object.defineProperty,Bs=(t,e)=>Fz(t,"name",{value:e,configurable:!0}),Cw="Dialog",[TR,iee]=_i(Cw),[$z,fo]=TR(Cw),kw=Bs(t=>{const{__scopeDialog:e,children:n,open:r,defaultOpen:s,onOpenChange:i,modal:a=!0}=t,u=v.useRef(null),c=v.useRef(null),[d,h]=va({prop:r,defaultProp:s??!1,onChange:i,caller:Cw}),[p,m]=v.useState(0),[_,w]=v.useState(0);return E.jsx($z,{scope:e,triggerRef:u,contentRef:c,contentId:na(),titleId:na(),descriptionId:na(),titlePresent:p>0,descriptionPresent:_>0,setTitleCount:m,setDescriptionCount:w,open:d,onOpenChange:h,onOpenToggle:v.useCallback(()=>h(y=>!y),[h]),modal:a,children:n})},"Dialog"),RR="DialogPortal",[Vz,AR]=TR(RR,{forceMount:void 0}),Pw=Bs(t=>{const{__scopeDialog:e,forceMount:n,children:r,container:s}=t,i=fo(RR,e);return E.jsx(Vz,{scope:e,forceMount:n,children:v.Children.map(r,a=>E.jsx(ya,{present:n||i.open,children:E.jsx(bw,{asChild:!0,container:s,children:a})}))})},"DialogPortal"),L_="DialogOverlay",Tw=v.forwardRef(Bs(function(e,n){const r=AR(L_,e.__scopeDialog),{forceMount:s=r.forceMount,...i}=e,a=fo(L_,e.__scopeDialog);return a.modal?E.jsx(ya,{present:s||a.open,children:E.jsx(zz,{...i,ref:n})}):null},"DialogOverlay")),Hz=ca("DialogOverlay.RemoveScroll"),zz=v.forwardRef(Bs(function(e,n){const{__scopeDialog:r,...s}=e,i=fo(L_,r),a=iR(),u=Vt(n,a);return E.jsx(Ew,{as:Hz,allowPinchZoom:!0,shards:[i.contentRef],children:E.jsx(dn.div,{"data-state":Mw(i.open),...s,ref:u,style:{pointerEvents:"auto",...s.style}})})},"DialogOverlayImpl")),Qd="DialogContent",Rw=v.forwardRef(Bs(function(e,n){const r=AR(Qd,e.__scopeDialog),{forceMount:s=r.forceMount,...i}=e,a=fo(Qd,e.__scopeDialog);return E.jsx(ya,{present:s||a.open,children:a.modal?E.jsx(Uz,{...i,ref:n}):E.jsx(Bz,{...i,ref:n})})},"DialogContent")),Uz=v.forwardRef(Bs(function(e,n){const r=fo(Qd,e.__scopeDialog),s=v.useRef(null),i=Vt(n,r.contentRef,s);return v.useEffect(()=>{const a=s.current;if(a)return PR(a)},[]),E.jsx(IR,{...e,ref:i,trapFocus:r.open,disableOutsidePointerEvents:r.open,onCloseAutoFocus:Ft(e.onCloseAutoFocus,a=>{var u;a.preventDefault(),(u=r.triggerRef.current)==null||u.focus()}),onPointerDownOutside:Ft(e.onPointerDownOutside,a=>{const u=a.detail.originalEvent,c=u.button===0&&u.ctrlKey===!0;(u.button===2||c)&&a.preventDefault()}),onFocusOutside:Ft(e.onFocusOutside,a=>a.preventDefault())})},"DialogContentModal")),Bz=v.forwardRef(Bs(function(e,n){const r=fo(Qd,e.__scopeDialog),s=v.useRef(!1),i=v.useRef(!1);return E.jsx(IR,{...e,ref:n,trapFocus:!1,disableOutsidePointerEvents:!1,onCloseAutoFocus:a=>{var u,c;(u=e.onCloseAutoFocus)==null||u.call(e,a),a.defaultPrevented||(s.current||(c=r.triggerRef.current)==null||c.focus(),a.preventDefault()),s.current=!1,i.current=!1},onInteractOutside:a=>{var d,h;(d=e.onInteractOutside)==null||d.call(e,a),a.defaultPrevented||(s.current=!0,a.detail.originalEvent.type==="pointerdown"&&(i.current=!0));const u=a.target;((h=r.triggerRef.current)==null?void 0:h.contains(u))&&a.preventDefault(),a.detail.originalEvent.type==="focusin"&&i.current&&a.preventDefault()}})},"DialogContentNonModal")),IR=v.forwardRef(Bs(function(e,n){const{__scopeDialog:r,trapFocus:s,onOpenAutoFocus:i,onCloseAutoFocus:a,...u}=e,c=fo(Qd,r);return y0(),E.jsx(E.Fragment,{children:E.jsx(lR,{asChild:!0,loop:!0,trapped:s,onMountAutoFocus:i,onUnmountAutoFocus:a,children:E.jsx(_w,{role:"dialog",id:c.contentId,"aria-describedby":c.descriptionPresent?c.descriptionId:void 0,"aria-labelledby":c.titlePresent?c.titleId:void 0,"data-state":Mw(c.open),...u,ref:n,deferPointerDownOutside:!0,onDismiss:()=>c.onOpenChange(!1)})})})},"DialogContentImpl")),Wz="DialogTitle",Aw=v.forwardRef(Bs(function(e,n){const{__scopeDialog:r,...s}=e,i=fo(Wz,r),{setTitleCount:a}=i;return Rr(()=>(a(u=>u+1),()=>a(u=>u-1)),[a]),E.jsx(dn.h2,{id:i.titleId,...s,ref:n})},"DialogTitle")),qz="DialogDescription",Iw=v.forwardRef(Bs(function(e,n){const{__scopeDialog:r,...s}=e,i=fo(qz,r),{setDescriptionCount:a}=i;return Rr(()=>(a(u=>u+1),()=>a(u=>u-1)),[a]),E.jsx(dn.p,{id:i.descriptionId,...s,ref:n})},"DialogDescription"));function Mw(t){return t?"open":"closed"}Bs(Mw,"getState");const Gz=new Map([["bold",v.createElement(v.Fragment,null,v.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",v.createElement(v.Fragment,null,v.createElement("path",{d:"M112,56V200L40,128Z",opacity:"0.2"}),v.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",v.createElement(v.Fragment,null,v.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",v.createElement(v.Fragment,null,v.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",v.createElement(v.Fragment,null,v.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",v.createElement(v.Fragment,null,v.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"}))]]),Kz=new Map([["bold",v.createElement(v.Fragment,null,v.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",v.createElement(v.Fragment,null,v.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"}),v.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",v.createElement(v.Fragment,null,v.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",v.createElement(v.Fragment,null,v.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",v.createElement(v.Fragment,null,v.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",v.createElement(v.Fragment,null,v.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"}))]]),Zz=new Map([["bold",v.createElement(v.Fragment,null,v.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",v.createElement(v.Fragment,null,v.createElement("path",{d:"M200,112H56l72-72Z",opacity:"0.2"}),v.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",v.createElement(v.Fragment,null,v.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",v.createElement(v.Fragment,null,v.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",v.createElement(v.Fragment,null,v.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",v.createElement(v.Fragment,null,v.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"}))]]),Yz=new Map([["bold",v.createElement(v.Fragment,null,v.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",v.createElement(v.Fragment,null,v.createElement("path",{d:"M208,96l-80,80L48,96Z",opacity:"0.2"}),v.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",v.createElement(v.Fragment,null,v.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",v.createElement(v.Fragment,null,v.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",v.createElement(v.Fragment,null,v.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",v.createElement(v.Fragment,null,v.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"}))]]),Xz=new Map([["bold",v.createElement(v.Fragment,null,v.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",v.createElement(v.Fragment,null,v.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"}),v.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",v.createElement(v.Fragment,null,v.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",v.createElement(v.Fragment,null,v.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",v.createElement(v.Fragment,null,v.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",v.createElement(v.Fragment,null,v.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"}))]]),Qz=new Map([["bold",v.createElement(v.Fragment,null,v.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",v.createElement(v.Fragment,null,v.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"}),v.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",v.createElement(v.Fragment,null,v.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",v.createElement(v.Fragment,null,v.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",v.createElement(v.Fragment,null,v.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",v.createElement(v.Fragment,null,v.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"}))]]),Jz=new Map([["bold",v.createElement(v.Fragment,null,v.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",v.createElement(v.Fragment,null,v.createElement("path",{d:"M224,128a96,96,0,1,1-96-96A96,96,0,0,1,224,128Z",opacity:"0.2"}),v.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",v.createElement(v.Fragment,null,v.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",v.createElement(v.Fragment,null,v.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",v.createElement(v.Fragment,null,v.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",v.createElement(v.Fragment,null,v.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"}))]]),eU=new Map([["bold",v.createElement(v.Fragment,null,v.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",v.createElement(v.Fragment,null,v.createElement("path",{d:"M216,40V168H168V88H88V40Z",opacity:"0.2"}),v.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",v.createElement(v.Fragment,null,v.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",v.createElement(v.Fragment,null,v.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",v.createElement(v.Fragment,null,v.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",v.createElement(v.Fragment,null,v.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"}))]]),tU=new Map([["bold",v.createElement(v.Fragment,null,v.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",v.createElement(v.Fragment,null,v.createElement("path",{d:"M192,112a80,80,0,1,1-80-80A80,80,0,0,1,192,112Z",opacity:"0.2"}),v.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",v.createElement(v.Fragment,null,v.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",v.createElement(v.Fragment,null,v.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",v.createElement(v.Fragment,null,v.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",v.createElement(v.Fragment,null,v.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"}))]]),nU=new Map([["bold",v.createElement(v.Fragment,null,v.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",v.createElement(v.Fragment,null,v.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"}),v.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",v.createElement(v.Fragment,null,v.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",v.createElement(v.Fragment,null,v.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",v.createElement(v.Fragment,null,v.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",v.createElement(v.Fragment,null,v.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"}))]]),rU=new Map([["bold",v.createElement(v.Fragment,null,v.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",v.createElement(v.Fragment,null,v.createElement("path",{d:"M88,48V208H40a8,8,0,0,1-8-8V56a8,8,0,0,1,8-8Z",opacity:"0.2"}),v.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",v.createElement(v.Fragment,null,v.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",v.createElement(v.Fragment,null,v.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",v.createElement(v.Fragment,null,v.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",v.createElement(v.Fragment,null,v.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"}))]]),sU=new Map([["bold",v.createElement(v.Fragment,null,v.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",v.createElement(v.Fragment,null,v.createElement("path",{d:"M224,56V200a16,16,0,0,1-16,16H48V40H208A16,16,0,0,1,224,56Z",opacity:"0.2"}),v.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",v.createElement(v.Fragment,null,v.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",v.createElement(v.Fragment,null,v.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",v.createElement(v.Fragment,null,v.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",v.createElement(v.Fragment,null,v.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"}))]]),iU=new Map([["bold",v.createElement(v.Fragment,null,v.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",v.createElement(v.Fragment,null,v.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"}),v.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",v.createElement(v.Fragment,null,v.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",v.createElement(v.Fragment,null,v.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",v.createElement(v.Fragment,null,v.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",v.createElement(v.Fragment,null,v.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"}))]]),oU=new Map([["bold",v.createElement(v.Fragment,null,v.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",v.createElement(v.Fragment,null,v.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"}),v.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",v.createElement(v.Fragment,null,v.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",v.createElement(v.Fragment,null,v.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",v.createElement(v.Fragment,null,v.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",v.createElement(v.Fragment,null,v.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"}))]]),aU=new Map([["bold",v.createElement(v.Fragment,null,v.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",v.createElement(v.Fragment,null,v.createElement("path",{d:"M200,56V208a8,8,0,0,1-8,8H64a8,8,0,0,1-8-8V56Z",opacity:"0.2"}),v.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",v.createElement(v.Fragment,null,v.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",v.createElement(v.Fragment,null,v.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",v.createElement(v.Fragment,null,v.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",v.createElement(v.Fragment,null,v.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"}))]]),lU=new Map([["bold",v.createElement(v.Fragment,null,v.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",v.createElement(v.Fragment,null,v.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"}),v.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",v.createElement(v.Fragment,null,v.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",v.createElement(v.Fragment,null,v.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",v.createElement(v.Fragment,null,v.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",v.createElement(v.Fragment,null,v.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"}))]]),uU=v.createContext({color:"currentColor",size:"1em",weight:"regular",mirrored:!1}),Un=v.forwardRef((t,e)=>{const{alt:n,color:r,size:s,weight:i,mirrored:a,children:u,weights:c,...d}=t,{color:h="currentColor",size:p,weight:m="regular",mirrored:_=!1,...w}=v.useContext(uU);return v.createElement("svg",{ref:e,xmlns:"http://www.w3.org/2000/svg",width:s??p,height:s??p,fill:r??h,viewBox:"0 0 256 256",transform:a||_?"scale(-1, 1)":void 0,...w,...d},!!n&&v.createElement("title",null,n),u,c.get(i??m))});Un.displayName="IconBase";const MR=v.forwardRef((t,e)=>v.createElement(Un,{ref:e,...t,weights:Gz}));MR.displayName="ArrowLeftIcon";const cU=MR,OR=v.forwardRef((t,e)=>v.createElement(Un,{ref:e,...t,weights:Kz}));OR.displayName="ArrowSquareOutIcon";const dU=OR,LR=v.forwardRef((t,e)=>v.createElement(Un,{ref:e,...t,weights:Zz}));LR.displayName="ArrowUpIcon";const fU=LR,DR=v.forwardRef((t,e)=>v.createElement(Un,{ref:e,...t,weights:Yz}));DR.displayName="CaretDownIcon";const hU=DR,NR=v.forwardRef((t,e)=>v.createElement(Un,{ref:e,...t,weights:Xz}));NR.displayName="ChatCircleIcon";const pU=NR,jR=v.forwardRef((t,e)=>v.createElement(Un,{ref:e,...t,weights:Qz}));jR.displayName="CheckIcon";const FR=jR,$R=v.forwardRef((t,e)=>v.createElement(Un,{ref:e,...t,weights:Jz}));$R.displayName="CircleNotchIcon";const w0=$R,VR=v.forwardRef((t,e)=>v.createElement(Un,{ref:e,...t,weights:eU}));VR.displayName="CopyIcon";const Jd=VR,HR=v.forwardRef((t,e)=>v.createElement(Un,{ref:e,...t,weights:tU}));HR.displayName="MagnifyingGlassIcon";const mU=HR,zR=v.forwardRef((t,e)=>v.createElement(Un,{ref:e,...t,weights:nU}));zR.displayName="PencilSimpleIcon";const gU=zR,UR=v.forwardRef((t,e)=>v.createElement(Un,{ref:e,...t,weights:rU}));UR.displayName="SidebarSimpleIcon";const vU=UR,BR=v.forwardRef((t,e)=>v.createElement(Un,{ref:e,...t,weights:sU}));BR.displayName="SignOutIcon";const yU=BR,WR=v.forwardRef((t,e)=>v.createElement(Un,{ref:e,...t,weights:iU}));WR.displayName="SparkleIcon";const S1=WR,qR=v.forwardRef((t,e)=>v.createElement(Un,{ref:e,...t,weights:oU}));qR.displayName="SwatchesIcon";const GR=qR,KR=v.forwardRef((t,e)=>v.createElement(Un,{ref:e,...t,weights:aU}));KR.displayName="TrashIcon";const _U=KR,ZR=v.forwardRef((t,e)=>v.createElement(Un,{ref:e,...t,weights:lU}));ZR.displayName="XIcon";const YR=ZR;function XR(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=XR(t[e]))&&(r&&(r+=" "),r+=n)}else for(n in t)t[n]&&(r&&(r+=" "),r+=n);return r}function wU(){for(var t,e,n=0,r="",s=arguments.length;n<s;n++)(t=arguments[n])&&(e=XR(t))&&(r&&(r+=" "),r+=e);return r}const xU=(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},bU=(t,e)=>({classGroupId:t,validator:e}),QR=(t=new Map,e=null,n)=>({nextPart:t,validators:e,classGroupId:n}),zm="-",h4=[],SU="arbitrary..",EU=t=>{const e=kU(t),{conflictingClassGroups:n,conflictingClassGroupModifiers:r}=t;return{getClassGroupId:a=>{if(a.startsWith("[")&&a.endsWith("]"))return CU(a);const u=a.split(zm),c=u[0]===""&&u.length>1?1:0;return JR(u,c,e)},getConflictingClassGroupIds:(a,u)=>{if(u){const c=r[a],d=n[a];return c?d?xU(d,c):c:d||h4}return n[a]||h4}}},JR=(t,e,n)=>{if(t.length-e===0)return n.classGroupId;const s=t[e],i=n.nextPart.get(s);if(i){const d=JR(t,e+1,i);if(d)return d}const a=n.validators;if(a===null)return;const u=e===0?t.join(zm):t.slice(e).join(zm),c=a.length;for(let d=0;d<c;d++){const h=a[d];if(h.validator(u))return h.classGroupId}},CU=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?SU+r:void 0})(),kU=t=>{const{theme:e,classGroups:n}=t;return PU(n,e)},PU=(t,e)=>{const n=QR();for(const r in t){const s=t[r];Ow(s,n,r,e)}return n},Ow=(t,e,n,r)=>{const s=t.length;for(let i=0;i<s;i++){const a=t[i];TU(a,e,n,r)}},TU=(t,e,n,r)=>{if(typeof t=="string"){RU(t,e,n);return}if(typeof t=="function"){AU(t,e,n,r);return}IU(t,e,n,r)},RU=(t,e,n)=>{const r=t===""?e:e5(e,t);r.classGroupId=n},AU=(t,e,n,r)=>{if(MU(t)){Ow(t(r),e,n,r);return}e.validators===null&&(e.validators=[]),e.validators.push(bU(n,t))},IU=(t,e,n,r)=>{const s=Object.entries(t),i=s.length;for(let a=0;a<i;a++){const[u,c]=s[a];Ow(c,e5(e,u),n,r)}},e5=(t,e)=>{let n=t;const r=e.split(zm),s=r.length;for(let i=0;i<s;i++){const a=r[i];let u=n.nextPart.get(a);u||(u=QR(),n.nextPart.set(a,u)),n=u}return n},MU=t=>"isThemeGetter"in t&&t.isThemeGetter===!0,OU=t=>{if(t<1)return{get:()=>{},set:()=>{}};let e=0,n=Object.create(null),r=Object.create(null);const s=(i,a)=>{n[i]=a,e++,e>t&&(e=0,r=n,n=Object.create(null))};return{get(i){let a=n[i];if(a!==void 0)return a;if((a=r[i])!==void 0)return s(i,a),a},set(i,a){i in n?n[i]=a:s(i,a)}}},D_="!",p4=":",LU=[],m4=(t,e,n,r,s)=>({modifiers:t,hasImportantModifier:e,baseClassName:n,maybePostfixModifierPosition:r,isExternal:s}),DU=t=>{const{prefix:e,experimentalParseClassName:n}=t;let r=s=>{const i=[];let a=0,u=0,c=0,d;const h=s.length;for(let y=0;y<h;y++){const x=s[y];if(a===0&&u===0){if(x===p4){i.push(s.slice(c,y)),c=y+1;continue}if(x==="/"){d=y;continue}}x==="["?a++:x==="]"?a--:x==="("?u++:x===")"&&u--}const p=i.length===0?s:s.slice(c);let m=p,_=!1;p.endsWith(D_)?(m=p.slice(0,-1),_=!0):p.startsWith(D_)&&(m=p.slice(1),_=!0);const w=d&&d>c?d-c:void 0;return m4(i,_,m,w)};if(e){const s=e+p4,i=r;r=a=>a.startsWith(s)?i(a.slice(s.length)):m4(LU,!1,a,void 0,!0)}if(n){const s=r;r=i=>n({className:i,parseClassName:s})}return r},NU=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 a=n[i],u=a[0]==="[",c=e.has(a);u||c?(s.length>0&&(s.sort(),r.push(...s),s=[]),r.push(a)):s.push(a)}return s.length>0&&(s.sort(),r.push(...s)),r}},jU=t=>({cache:OU(t.cacheSize),parseClassName:DU(t),sortModifiers:NU(t),postfixLookupClassGroupIds:FU(t),...EU(t)}),FU=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},$U=/\s+/,VU=(t,e)=>{const{parseClassName:n,getClassGroupId:r,getConflictingClassGroupIds:s,sortModifiers:i,postfixLookupClassGroupIds:a}=e,u=[],c=t.trim().split($U);let d="";for(let h=c.length-1;h>=0;h-=1){const p=c[h],{isExternal:m,modifiers:_,hasImportantModifier:w,baseClassName:y,maybePostfixModifierPosition:x}=n(p);if(m){d=p+(d.length>0?" "+d:d);continue}let S=!!x,P;if(S){const L=y.substring(0,x);P=r(L);const A=P&&a[P]?r(y):void 0;A&&A!==P&&(P=A,S=!1)}else P=r(y);if(!P){if(!S){d=p+(d.length>0?" "+d:d);continue}if(P=r(y),!P){d=p+(d.length>0?" "+d:d);continue}S=!1}const T=_.length===0?"":_.length===1?_[0]:i(_).join(":"),k=w?T+D_:T,R=k+P;if(u.indexOf(R)>-1)continue;u.push(R);const M=s(P,S);for(let L=0;L<M.length;++L){const A=M[L];u.push(k+A)}d=p+(d.length>0?" "+d:d)}return d},HU=(...t)=>{let e=0,n,r,s="";for(;e<t.length;)(n=t[e++])&&(r=t5(n))&&(s&&(s+=" "),s+=r);return s},t5=t=>{if(typeof t=="string")return t;let e,n="";for(let r=0;r<t.length;r++)t[r]&&(e=t5(t[r]))&&(n&&(n+=" "),n+=e);return n},zU=(t,...e)=>{let n,r,s,i;const a=c=>{const d=e.reduce((h,p)=>p(h),t());return n=jU(d),r=n.cache.get,s=n.cache.set,i=u,u(c)},u=c=>{const d=r(c);if(d)return d;const h=VU(c,n);return s(c,h),h};return i=a,(...c)=>i(HU(...c))},UU=[],Sn=t=>{const e=n=>n[t]||UU;return e.isThemeGetter=!0,e},n5=/^\[(?:(\w[\w-]*):)?(.+)\]$/i,r5=/^\((?:(\w[\w-]*):)?(.+)\)$/i,BU=/^\d+(?:\.\d+)?\/\d+(?:\.\d+)?$/,WU=/^(\d+(\.\d+)?)?(xs|sm|md|lg|xl)$/,qU=/\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$/,GU=/^(rgba?|hsla?|hwb|(ok)?(lab|lch)|color-mix)\(.+\)$/,KU=/^(inset_)?-?((\d+)?\.?(\d+)[a-z]+|0)_-?((\d+)?\.?(\d+)[a-z]+|0)/,ZU=/^(url|image|image-set|cross-fade|element|(repeating-)?(linear|radial|conic)-gradient)\(.+\)$/,Vo=t=>BU.test(t),it=t=>!!t&&!Number.isNaN(Number(t)),ti=t=>!!t&&Number.isInteger(Number(t)),E1=t=>t.endsWith("%")&&it(t.slice(0,-1)),Li=t=>WU.test(t),s5=()=>!0,YU=t=>qU.test(t)&&!GU.test(t),Lw=()=>!1,XU=t=>KU.test(t),QU=t=>ZU.test(t),JU=t=>!Ae(t)&&!Me(t),eB=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)),tB=t=>_a(t,a5,Lw),Ae=t=>n5.test(t),Wa=t=>_a(t,l5,YU),g4=t=>_a(t,uB,it),nB=t=>_a(t,c5,s5),rB=t=>_a(t,u5,Lw),v4=t=>_a(t,i5,Lw),sB=t=>_a(t,o5,QU),_p=t=>_a(t,d5,XU),Me=t=>r5.test(t),cd=t=>Ml(t,l5),iB=t=>Ml(t,u5),y4=t=>Ml(t,i5),oB=t=>Ml(t,a5),aB=t=>Ml(t,o5),wp=t=>Ml(t,d5,!0),lB=t=>Ml(t,c5,!0),_a=(t,e,n)=>{const r=n5.exec(t);return r?r[1]?e(r[1]):n(r[2]):!1},Ml=(t,e,n=!1)=>{const r=r5.exec(t);return r?r[1]?e(r[1]):n:!1},i5=t=>t==="position"||t==="percentage",o5=t=>t==="image"||t==="url",a5=t=>t==="length"||t==="size"||t==="bg-size",l5=t=>t==="length",uB=t=>t==="number",u5=t=>t==="family-name",c5=t=>t==="number"||t==="weight",d5=t=>t==="shadow",cB=()=>{const t=Sn("color"),e=Sn("font"),n=Sn("text"),r=Sn("font-weight"),s=Sn("tracking"),i=Sn("leading"),a=Sn("breakpoint"),u=Sn("container"),c=Sn("spacing"),d=Sn("radius"),h=Sn("shadow"),p=Sn("inset-shadow"),m=Sn("text-shadow"),_=Sn("drop-shadow"),w=Sn("blur"),y=Sn("perspective"),x=Sn("aspect"),S=Sn("ease"),P=Sn("animate"),T=()=>["auto","avoid","all","avoid-page","page","left","right","column"],k=()=>["center","top","bottom","left","right","top-left","left-top","top-right","right-top","bottom-right","right-bottom","bottom-left","left-bottom"],R=()=>[...k(),Me,Ae],M=()=>["auto","hidden","clip","visible","scroll"],L=()=>["auto","contain","none"],A=()=>[Me,Ae,c],O=()=>[Vo,"full","auto",...A()],D=()=>[ti,"none","subgrid",Me,Ae],N=()=>["auto",{span:["full",ti,Me,Ae]},ti,Me,Ae],j=()=>[ti,"auto",Me,Ae],G=()=>["auto","min","max","fr",Me,Ae],Y=()=>["start","end","center","between","around","evenly","stretch","baseline","center-safe","end-safe"],W=()=>["start","end","center","stretch","center-safe","end-safe"],q=()=>["auto",...A()],Z=()=>[Vo,"auto","full","dvw","dvh","lvw","lvh","svw","svh","min","max","fit",...A()],V=()=>[Vo,"screen","full","dvw","lvw","svw","min","max","fit",...A()],J=()=>[Vo,"screen","full","lh","dvh","lvh","svh","min","max","fit",...A()],H=()=>[t,Me,Ae],F=()=>[...k(),y4,v4,{position:[Me,Ae]}],X=()=>["no-repeat",{repeat:["","x","y","space","round"]}],oe=()=>["auto","cover","contain",oB,tB,{size:[Me,Ae]}],se=()=>[E1,cd,Wa],ee=()=>["","none","full",d,Me,Ae],ce=()=>["",it,cd,Wa],we=()=>["solid","dashed","dotted","double"],le=()=>["normal","multiply","screen","overlay","darken","lighten","color-dodge","color-burn","hard-light","soft-light","difference","exclusion","hue","saturation","color","luminosity"],ie=()=>[it,E1,y4,v4],Ne=()=>["","none",w,Me,Ae],Be=()=>["none",it,Me,Ae],Pe=()=>["none",it,Me,Ae],$e=()=>[it,Me,Ae],dt=()=>[Vo,"full",...A()];return{cacheSize:500,theme:{animate:["spin","ping","pulse","bounce"],aspect:["video"],blur:[Li],breakpoint:[Li],color:[s5],container:[Li],"drop-shadow":[Li],ease:["in","out","in-out"],font:[JU],"font-weight":["thin","extralight","light","normal","medium","semibold","bold","extrabold","black"],"inset-shadow":[Li],leading:["none","tight","snug","normal","relaxed","loose"],perspective:["dramatic","near","normal","midrange","distant","none"],radius:[Li],shadow:[Li],spacing:["px",it],text:[Li],"text-shadow":[Li],tracking:["tighter","tight","normal","wide","wider","widest"]},classGroups:{aspect:[{aspect:["auto","square",Vo,Ae,Me,x]}],container:["container"],"container-type":[{"@container":["","normal","size",Me,Ae]}],"container-named":[eB],columns:[{columns:[it,Ae,Me,u]}],"break-after":[{"break-after":T()}],"break-before":[{"break-before":T()}],"break-inside":[{"break-inside":["auto","avoid","avoid-page","avoid-column"]}],"box-decoration":[{"box-decoration":["slice","clone"]}],box:[{box:["border","content"]}],display:["block","inline-block","inline","flex","inline-flex","table","inline-table","table-caption","table-cell","table-column","table-column-group","table-footer-group","table-header-group","table-row-group","table-row","flow-root","grid","inline-grid","contents","list-item","hidden"],sr:["sr-only","not-sr-only"],float:[{float:["right","left","none","start","end"]}],clear:[{clear:["left","right","both","none","start","end"]}],isolation:["isolate","isolation-auto"],"object-fit":[{object:["contain","cover","fill","none","scale-down"]}],"object-position":[{object:R()}],overflow:[{overflow:M()}],"overflow-x":[{"overflow-x":M()}],"overflow-y":[{"overflow-y":M()}],overscroll:[{overscroll:L()}],"overscroll-x":[{"overscroll-x":L()}],"overscroll-y":[{"overscroll-y":L()}],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:[ti,"auto",Me,Ae]}],basis:[{basis:[Vo,"full","auto",u,...A()]}],"flex-direction":[{flex:["row","row-reverse","col","col-reverse"]}],"flex-wrap":[{flex:["nowrap","wrap","wrap-reverse"]}],flex:[{flex:[it,Vo,"auto","initial","none",Ae]}],grow:[{grow:["",it,Me,Ae]}],shrink:[{shrink:["",it,Me,Ae]}],order:[{order:[ti,"first","last","none",Me,Ae]}],"grid-cols":[{"grid-cols":D()}],"col-start-end":[{col:N()}],"col-start":[{"col-start":j()}],"col-end":[{"col-end":j()}],"grid-rows":[{"grid-rows":D()}],"row-start-end":[{row:N()}],"row-start":[{"row-start":j()}],"row-end":[{"row-end":j()}],"grid-flow":[{"grid-flow":["row","col","dense","row-dense","col-dense"]}],"auto-cols":[{"auto-cols":G()}],"auto-rows":[{"auto-rows":G()}],gap:[{gap:A()}],"gap-x":[{"gap-x":A()}],"gap-y":[{"gap-y":A()}],"justify-content":[{justify:[...Y(),"normal"]}],"justify-items":[{"justify-items":[...W(),"normal"]}],"justify-self":[{"justify-self":["auto",...W()]}],"align-content":[{content:["normal",...Y()]}],"align-items":[{items:[...W(),{baseline:["","last"]}]}],"align-self":[{self:["auto",...W(),{baseline:["","last"]}]}],"place-content":[{"place-content":Y()}],"place-items":[{"place-items":[...W(),"baseline"]}],"place-self":[{"place-self":["auto",...W()]}],p:[{p:A()}],px:[{px:A()}],py:[{py:A()}],ps:[{ps:A()}],pe:[{pe:A()}],pbs:[{pbs:A()}],pbe:[{pbe:A()}],pt:[{pt:A()}],pr:[{pr:A()}],pb:[{pb:A()}],pl:[{pl:A()}],m:[{m:q()}],mx:[{mx:q()}],my:[{my:q()}],ms:[{ms:q()}],me:[{me:q()}],mbs:[{mbs:q()}],mbe:[{mbe:q()}],mt:[{mt:q()}],mr:[{mr:q()}],mb:[{mb:q()}],ml:[{ml:q()}],"space-x":[{"space-x":A()}],"space-x-reverse":["space-x-reverse"],"space-y":[{"space-y":A()}],"space-y-reverse":["space-y-reverse"],size:[{size:Z()}],"inline-size":[{inline:["auto",...V()]}],"min-inline-size":[{"min-inline":["auto",...V()]}],"max-inline-size":[{"max-inline":["none",...V()]}],"block-size":[{block:["auto",...J()]}],"min-block-size":[{"min-block":["auto",...J()]}],"max-block-size":[{"max-block":["none",...J()]}],w:[{w:[u,"screen",...Z()]}],"min-w":[{"min-w":[u,"screen","none",...Z()]}],"max-w":[{"max-w":[u,"screen","none","prose",{screen:[a]},...Z()]}],h:[{h:["screen","lh",...Z()]}],"min-h":[{"min-h":["screen","lh","none",...Z()]}],"max-h":[{"max-h":["screen","lh",...Z()]}],"font-size":[{text:["base",n,cd,Wa]}],"font-smoothing":["antialiased","subpixel-antialiased"],"font-style":["italic","not-italic"],"font-weight":[{font:[r,lB,nB]}],"font-stretch":[{"font-stretch":["ultra-condensed","extra-condensed","condensed","semi-condensed","normal","semi-expanded","expanded","extra-expanded","ultra-expanded",E1,Ae]}],"font-family":[{font:[iB,rB,e]}],"font-features":[{"font-features":[Ae]}],"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,Me,Ae]}],"line-clamp":[{"line-clamp":[it,"none",Me,g4]}],leading:[{leading:[i,...A()]}],"list-image":[{"list-image":["none",Me,Ae]}],"list-style-position":[{list:["inside","outside"]}],"list-style-type":[{list:["disc","decimal","none",Me,Ae]}],"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:[...we(),"wavy"]}],"text-decoration-thickness":[{decoration:[it,"from-font","auto",Me,Wa]}],"text-decoration-color":[{decoration:H()}],"underline-offset":[{"underline-offset":[it,"auto",Me,Ae]}],"text-transform":["uppercase","lowercase","capitalize","normal-case"],"text-overflow":["truncate","text-ellipsis","text-clip"],"text-wrap":[{text:["wrap","nowrap","balance","pretty"]}],indent:[{indent:A()}],"tab-size":[{tab:[ti,Me,Ae]}],"vertical-align":[{align:["baseline","top","middle","bottom","text-top","text-bottom","sub","super",Me,Ae]}],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",Me,Ae]}],"bg-attachment":[{bg:["fixed","local","scroll"]}],"bg-clip":[{"bg-clip":["border","padding","content","text"]}],"bg-origin":[{"bg-origin":["border","padding","content"]}],"bg-position":[{bg:F()}],"bg-repeat":[{bg:X()}],"bg-size":[{bg:oe()}],"bg-image":[{bg:["none",{linear:[{to:["t","tr","r","br","b","bl","l","tl"]},ti,Me,Ae],radial:["",Me,Ae],conic:[ti,Me,Ae]},aB,sB]}],"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:ee()}],"rounded-s":[{"rounded-s":ee()}],"rounded-e":[{"rounded-e":ee()}],"rounded-t":[{"rounded-t":ee()}],"rounded-r":[{"rounded-r":ee()}],"rounded-b":[{"rounded-b":ee()}],"rounded-l":[{"rounded-l":ee()}],"rounded-ss":[{"rounded-ss":ee()}],"rounded-se":[{"rounded-se":ee()}],"rounded-ee":[{"rounded-ee":ee()}],"rounded-es":[{"rounded-es":ee()}],"rounded-tl":[{"rounded-tl":ee()}],"rounded-tr":[{"rounded-tr":ee()}],"rounded-br":[{"rounded-br":ee()}],"rounded-bl":[{"rounded-bl":ee()}],"border-w":[{border:ce()}],"border-w-x":[{"border-x":ce()}],"border-w-y":[{"border-y":ce()}],"border-w-s":[{"border-s":ce()}],"border-w-e":[{"border-e":ce()}],"border-w-bs":[{"border-bs":ce()}],"border-w-be":[{"border-be":ce()}],"border-w-t":[{"border-t":ce()}],"border-w-r":[{"border-r":ce()}],"border-w-b":[{"border-b":ce()}],"border-w-l":[{"border-l":ce()}],"divide-x":[{"divide-x":ce()}],"divide-x-reverse":["divide-x-reverse"],"divide-y":[{"divide-y":ce()}],"divide-y-reverse":["divide-y-reverse"],"border-style":[{border:[...we(),"hidden","none"]}],"divide-style":[{divide:[...we(),"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:[...we(),"none","hidden"]}],"outline-offset":[{"outline-offset":[it,Me,Ae]}],"outline-w":[{outline:["",it,cd,Wa]}],"outline-color":[{outline:H()}],shadow:[{shadow:["","none",h,wp,_p]}],"shadow-color":[{shadow:H()}],"inset-shadow":[{"inset-shadow":["none",p,wp,_p]}],"inset-shadow-color":[{"inset-shadow":H()}],"ring-w":[{ring:ce()}],"ring-w-inset":["ring-inset"],"ring-color":[{ring:H()}],"ring-offset-w":[{"ring-offset":[it,Wa]}],"ring-offset-color":[{"ring-offset":H()}],"inset-ring-w":[{"inset-ring":ce()}],"inset-ring-color":[{"inset-ring":H()}],"text-shadow":[{"text-shadow":["none",m,wp,_p]}],"text-shadow-color":[{"text-shadow":H()}],opacity:[{opacity:[it,Me,Ae]}],"mix-blend":[{"mix-blend":[...le(),"plus-darker","plus-lighter"]}],"bg-blend":[{"bg-blend":le()}],"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":[it]}],"mask-image-linear-from-pos":[{"mask-linear-from":ie()}],"mask-image-linear-to-pos":[{"mask-linear-to":ie()}],"mask-image-linear-from-color":[{"mask-linear-from":H()}],"mask-image-linear-to-color":[{"mask-linear-to":H()}],"mask-image-t-from-pos":[{"mask-t-from":ie()}],"mask-image-t-to-pos":[{"mask-t-to":ie()}],"mask-image-t-from-color":[{"mask-t-from":H()}],"mask-image-t-to-color":[{"mask-t-to":H()}],"mask-image-r-from-pos":[{"mask-r-from":ie()}],"mask-image-r-to-pos":[{"mask-r-to":ie()}],"mask-image-r-from-color":[{"mask-r-from":H()}],"mask-image-r-to-color":[{"mask-r-to":H()}],"mask-image-b-from-pos":[{"mask-b-from":ie()}],"mask-image-b-to-pos":[{"mask-b-to":ie()}],"mask-image-b-from-color":[{"mask-b-from":H()}],"mask-image-b-to-color":[{"mask-b-to":H()}],"mask-image-l-from-pos":[{"mask-l-from":ie()}],"mask-image-l-to-pos":[{"mask-l-to":ie()}],"mask-image-l-from-color":[{"mask-l-from":H()}],"mask-image-l-to-color":[{"mask-l-to":H()}],"mask-image-x-from-pos":[{"mask-x-from":ie()}],"mask-image-x-to-pos":[{"mask-x-to":ie()}],"mask-image-x-from-color":[{"mask-x-from":H()}],"mask-image-x-to-color":[{"mask-x-to":H()}],"mask-image-y-from-pos":[{"mask-y-from":ie()}],"mask-image-y-to-pos":[{"mask-y-to":ie()}],"mask-image-y-from-color":[{"mask-y-from":H()}],"mask-image-y-to-color":[{"mask-y-to":H()}],"mask-image-radial":[{"mask-radial":[Me,Ae]}],"mask-image-radial-from-pos":[{"mask-radial-from":ie()}],"mask-image-radial-to-pos":[{"mask-radial-to":ie()}],"mask-image-radial-from-color":[{"mask-radial-from":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":k()}],"mask-image-conic-pos":[{"mask-conic":[it]}],"mask-image-conic-from-pos":[{"mask-conic-from":ie()}],"mask-image-conic-to-pos":[{"mask-conic-to":ie()}],"mask-image-conic-from-color":[{"mask-conic-from":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:F()}],"mask-repeat":[{mask:X()}],"mask-size":[{mask:oe()}],"mask-type":[{"mask-type":["alpha","luminance"]}],"mask-image":[{mask:["none",Me,Ae]}],filter:[{filter:["","none",Me,Ae]}],blur:[{blur:Ne()}],brightness:[{brightness:[it,Me,Ae]}],contrast:[{contrast:[it,Me,Ae]}],"drop-shadow":[{"drop-shadow":["","none",_,wp,_p]}],"drop-shadow-color":[{"drop-shadow":H()}],grayscale:[{grayscale:["",it,Me,Ae]}],"hue-rotate":[{"hue-rotate":[it,Me,Ae]}],invert:[{invert:["",it,Me,Ae]}],saturate:[{saturate:[it,Me,Ae]}],sepia:[{sepia:["",it,Me,Ae]}],"backdrop-filter":[{"backdrop-filter":["","none",Me,Ae]}],"backdrop-blur":[{"backdrop-blur":Ne()}],"backdrop-brightness":[{"backdrop-brightness":[it,Me,Ae]}],"backdrop-contrast":[{"backdrop-contrast":[it,Me,Ae]}],"backdrop-grayscale":[{"backdrop-grayscale":["",it,Me,Ae]}],"backdrop-hue-rotate":[{"backdrop-hue-rotate":[it,Me,Ae]}],"backdrop-invert":[{"backdrop-invert":["",it,Me,Ae]}],"backdrop-opacity":[{"backdrop-opacity":[it,Me,Ae]}],"backdrop-saturate":[{"backdrop-saturate":[it,Me,Ae]}],"backdrop-sepia":[{"backdrop-sepia":["",it,Me,Ae]}],"border-collapse":[{border:["collapse","separate"]}],"border-spacing":[{"border-spacing":A()}],"border-spacing-x":[{"border-spacing-x":A()}],"border-spacing-y":[{"border-spacing-y":A()}],"table-layout":[{table:["auto","fixed"]}],caption:[{caption:["top","bottom"]}],transition:[{transition:["","all","colors","opacity","shadow","transform","none",Me,Ae]}],"transition-behavior":[{transition:["normal","discrete"]}],duration:[{duration:[it,"initial",Me,Ae]}],ease:[{ease:["linear","initial",S,Me,Ae]}],delay:[{delay:[it,Me,Ae]}],animate:[{animate:["none",P,Me,Ae]}],backface:[{backface:["hidden","visible"]}],perspective:[{perspective:[y,Me,Ae]}],"perspective-origin":[{"perspective-origin":R()}],rotate:[{rotate:Be()}],"rotate-x":[{"rotate-x":Be()}],"rotate-y":[{"rotate-y":Be()}],"rotate-z":[{"rotate-z":Be()}],scale:[{scale:Pe()}],"scale-x":[{"scale-x":Pe()}],"scale-y":[{"scale-y":Pe()}],"scale-z":[{"scale-z":Pe()}],"scale-3d":["scale-3d"],skew:[{skew:$e()}],"skew-x":[{"skew-x":$e()}],"skew-y":[{"skew-y":$e()}],transform:[{transform:[Me,Ae,"","none","gpu","cpu"]}],"transform-origin":[{origin:R()}],"transform-style":[{transform:["3d","flat"]}],translate:[{translate:dt()}],"translate-x":[{"translate-x":dt()}],"translate-y":[{"translate-y":dt()}],"translate-z":[{"translate-z":dt()}],"translate-none":["translate-none"],zoom:[{zoom:[ti,Me,Ae]}],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",Me,Ae]}],"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":A()}],"scroll-mx":[{"scroll-mx":A()}],"scroll-my":[{"scroll-my":A()}],"scroll-ms":[{"scroll-ms":A()}],"scroll-me":[{"scroll-me":A()}],"scroll-mbs":[{"scroll-mbs":A()}],"scroll-mbe":[{"scroll-mbe":A()}],"scroll-mt":[{"scroll-mt":A()}],"scroll-mr":[{"scroll-mr":A()}],"scroll-mb":[{"scroll-mb":A()}],"scroll-ml":[{"scroll-ml":A()}],"scroll-p":[{"scroll-p":A()}],"scroll-px":[{"scroll-px":A()}],"scroll-py":[{"scroll-py":A()}],"scroll-ps":[{"scroll-ps":A()}],"scroll-pe":[{"scroll-pe":A()}],"scroll-pbs":[{"scroll-pbs":A()}],"scroll-pbe":[{"scroll-pbe":A()}],"scroll-pt":[{"scroll-pt":A()}],"scroll-pr":[{"scroll-pr":A()}],"scroll-pb":[{"scroll-pb":A()}],"scroll-pl":[{"scroll-pl":A()}],"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",Me,Ae]}],fill:[{fill:["none",...H()]}],"stroke-w":[{stroke:[it,cd,Wa,g4]}],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":["right","left"],"inset-y":["top","bottom"],flex:["basis","grow","shrink"],gap:["gap-x","gap-y"],p:["px","py","ps","pe","pbs","pbe","pt","pr","pb","pl"],px:["pr","pl"],py:["pt","pb"],m:["mx","my","ms","me","mbs","mbe","mt","mr","mb","ml"],mx:["mr","ml"],my:["mt","mb"],size:["w","h"],"font-size":["leading"],"fvn-normal":["fvn-ordinal","fvn-slashed-zero","fvn-figure","fvn-spacing","fvn-fraction"],"fvn-ordinal":["fvn-normal"],"fvn-slashed-zero":["fvn-normal"],"fvn-figure":["fvn-normal"],"fvn-spacing":["fvn-normal"],"fvn-fraction":["fvn-normal"],"line-clamp":["display","overflow"],rounded:["rounded-s","rounded-e","rounded-t","rounded-r","rounded-b","rounded-l","rounded-ss","rounded-se","rounded-ee","rounded-es","rounded-tl","rounded-tr","rounded-br","rounded-bl"],"rounded-s":["rounded-ss","rounded-es"],"rounded-e":["rounded-se","rounded-ee"],"rounded-t":["rounded-tl","rounded-tr"],"rounded-r":["rounded-tr","rounded-br"],"rounded-b":["rounded-br","rounded-bl"],"rounded-l":["rounded-tl","rounded-bl"],"border-spacing":["border-spacing-x","border-spacing-y"],"border-w":["border-w-x","border-w-y","border-w-s","border-w-e","border-w-bs","border-w-be","border-w-t","border-w-r","border-w-b","border-w-l"],"border-w-x":["border-w-r","border-w-l"],"border-w-y":["border-w-t","border-w-b"],"border-color":["border-color-x","border-color-y","border-color-s","border-color-e","border-color-bs","border-color-be","border-color-t","border-color-r","border-color-b","border-color-l"],"border-color-x":["border-color-r","border-color-l"],"border-color-y":["border-color-t","border-color-b"],translate:["translate-x","translate-y","translate-none"],"translate-none":["translate","translate-x","translate-y","translate-z"],"scroll-m":["scroll-mx","scroll-my","scroll-ms","scroll-me","scroll-mbs","scroll-mbe","scroll-mt","scroll-mr","scroll-mb","scroll-ml"],"scroll-mx":["scroll-mr","scroll-ml"],"scroll-my":["scroll-mt","scroll-mb"],"scroll-p":["scroll-px","scroll-py","scroll-ps","scroll-pe","scroll-pbs","scroll-pbe","scroll-pt","scroll-pr","scroll-pb","scroll-pl"],"scroll-px":["scroll-pr","scroll-pl"],"scroll-py":["scroll-pt","scroll-pb"],touch:["touch-x","touch-y","touch-pz"],"touch-x":["touch"],"touch-y":["touch"],"touch-pz":["touch"]},conflictingClassGroupModifiers:{"font-size":["leading"]},postfixLookupClassGroups:["container-type"],orderSensitiveModifiers:["*","**","after","backdrop","before","details-content","file","first-letter","first-line","marker","placeholder","selection"]}},dB=zU(cB);function dr(...t){return dB(wU(t))}const ef={fast:{type:"spring",duration:.08,bounce:0},moderate:{type:"spring",duration:.16,bounce:.15}},_4=["#f59e0b","#38bdf8","#34d399","#a78bfa","#fb7185","#22d3ee","#fb923c","#a3e635","#e879f9","#2dd4bf"];function f5(t){let e=0;for(let r=0;r<t.length;r++)e=e*31+t.charCodeAt(r)|0;const n=_4[Math.abs(e)%_4.length];return{color:n,backgroundColor:`${n}22`}}function h5(t,e={}){const{axis:n="y"}=e,r=v.useRef(new Map),[s,i]=v.useState(null),[a,u]=v.useState([]),c=v.useRef([]),d=v.useRef(0),h=v.useRef(null),p=v.useRef(null),m=v.useCallback(()=>{if(!t.current)return;const P=[];r.current.forEach((T,k)=>{P[k]={top:T.offsetTop,height:T.offsetHeight,left:T.offsetLeft,width:T.offsetWidth}}),c.current=P,u(P)},[t]),_=v.useCallback((S,P)=>{P?r.current.set(S,P):r.current.delete(S),p.current!==null&&cancelAnimationFrame(p.current),p.current=requestAnimationFrame(()=>{p.current=null,m()})},[m]),w=v.useCallback(S=>{const P=S.clientX,T=S.clientY;h.current!==null&&cancelAnimationFrame(h.current),h.current=requestAnimationFrame(()=>{h.current=null;const k=t.current;if(!k)return;const R=k.getBoundingClientRect(),M=n==="x"?P:T;let L=null,A=1/0,O=null;const D=c.current,N=n==="x"?k.scrollLeft:k.scrollTop,j=n==="x"?k.clientLeft:k.clientTop,G=n==="x"?R.left:R.top,Y=n==="x"?k.offsetWidth:k.offsetHeight,W=n==="x"?R.width:R.height,q=Y>0?W/Y:1;for(let Z=0;Z<D.length;Z++){const V=D[Z];if(!V)continue;const J=n==="x"?V.left:V.top,H=G+(j+J-N)*q,F=(n==="x"?V.width:V.height)*q,X=H+F;M>=H&&M<=X&&(O=Z);const oe=H+F/2,se=Math.abs(M-oe);se<A&&(A=se,L=Z)}i(O??L)})},[n,t]),y=v.useCallback(()=>{d.current+=1,m()},[m]),x=v.useCallback(()=>{h.current!==null&&(cancelAnimationFrame(h.current),h.current=null),i(null)},[]);return v.useEffect(()=>()=>{h.current!==null&&cancelAnimationFrame(h.current),p.current!==null&&cancelAnimationFrame(p.current)},[]),{activeIndex:s,setActiveIndex:i,itemRects:a,sessionRef:d,handlers:{onMouseMove:w,onMouseEnter:y,onMouseLeave:x},registerItem:_,measureItems:m}}function fB(t,e,n){v.useEffect(()=>(t(e,n.current),()=>t(e,null)),[e,t,n])}const p5=(t,e)=>`style:${t}:${e}`,m5=t=>`text:${t}`,g5=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"]},v5=t=>g5(t)[0],xp=(t,e)=>g5(t).includes(e),hB=t=>{const e=v5(t.elementId),n=t.batchId?`:${t.batchId}`:"";return t.type==="style"?`${p5(e,t.property)}${n}`:`${m5(e)}${n}`},Fn=[];for(let t=0;t<256;++t)Fn.push((t+256).toString(16).slice(1));function pB(t,e=0){return(Fn[t[e+0]]+Fn[t[e+1]]+Fn[t[e+2]]+Fn[t[e+3]]+"-"+Fn[t[e+4]]+Fn[t[e+5]]+"-"+Fn[t[e+6]]+Fn[t[e+7]]+"-"+Fn[t[e+8]]+Fn[t[e+9]]+"-"+Fn[t[e+10]]+Fn[t[e+11]]+Fn[t[e+12]]+Fn[t[e+13]]+Fn[t[e+14]]+Fn[t[e+15]]).toLowerCase()}const mB=new Uint8Array(16);function gB(){return crypto.getRandomValues(mB)}function w4(t,e,n){return crypto.randomUUID?crypto.randomUUID():vB(t)}function vB(t,e,n){var s;t=t||{};const r=t.random??((s=t.rng)==null?void 0:s.call(t))??gB();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,pB(r)}const yB=300;class _B{constructor(){jo(this,"history",{current:new Map,past:[],future:[]});jo(this,"pendingChanges",new Map);jo(this,"currentBatchId",null);jo(this,"debounceTimer",null);jo(this,"onChangeCallbacks",[]);jo(this,"stateBeforePending",null);jo(this,"transactionDepth",0)}recordChange(e){this.pendingChanges.size===0&&(this.currentBatchId=w4(),this.stateBeforePending=new Map(this.history.current)),this.currentBatchId&&(e.batchId=this.currentBatchId);const n=v5(e.elementId),r=e.type==="style"?p5(n,e.property):m5(n),s=Array.from(this.history.current.entries()).find(([a])=>a===r||a.startsWith(`${r}:`));if(s){const a=s[1];e.type==="style"&&a.type==="style"?e.oldValue=a.oldValue:e.type==="text"&&a.type==="text"&&(e.oldText=a.oldText)}const i=hB(e);this.history.current.set(i,e),this.pendingChanges.set(i,e),this.debounceTimer&&clearTimeout(this.debounceTimer),this.debounceTimer=setTimeout(()=>{this.commitPending()},yB),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(){if(this.pendingChanges.size>0&&this.commitPending(),this.history.past.length===0)return null;const e=new Map(this.history.current);this.history.future.push(e),this.history.current=this.history.past.pop(),this.notifyChange();const n=[];for(const[r,s]of e)this.history.current.has(r)||n.push(s);return n}redo(){if(this.history.future.length===0)return null;const e=new Map(this.history.current);this.history.past.push(e),this.history.current=this.history.future.pop(),this.notifyChange();const n=[];for(const[r,s]of this.history.current)e.has(r)||n.push(s);return n}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"&&xp(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"&&xp(r.elementId,e)).sort((r,s)=>s.timestamp-r.timestamp)[0]}hasChanges(e){return Array.from(this.history.current.values()).some(n=>xp(n.elementId,e))}getChangesForElement(e){return Array.from(this.history.current.values()).filter(n=>xp(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=w4(),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 Um={kind:"base"};function tf(t){return t.kind==="base"?"base":`variant:${t.sessionId}:${t.variantId}`}function wB(t,e){return t.kind==="base"&&e.kind,t.kind==="variant"&&e.kind==="variant"?t.sessionId===e.sessionId&&t.variantId===e.variantId:!1}const xB={resize:{default:!1},variants:{default:!1},designSystemEditor:{default:!1},branchDiff:{default:!1},gitUi:{default:!0},createProject:{default:!1},desktopForceUpgrade:{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}},y5=Object.fromEntries(Object.entries(xB).map(([t,e])=>[t,{isEnabled:e.default}]));st("view");const _5=st(!0),w5=st(null),bB=st("chat"),x5=st(0),b5=st({name:null,email:null}),x4=st(Um);st(null);const nf=new Map,SB=t=>{const e=tf(t);let n=nf.get(e);return n||(n=new _B,nf.set(e,n)),n};st(t=>SB(t(x4)),(t,e,n)=>{nf.set(tf(t(x4)),n)});const EB=t=>{for(const e of[...nf.keys()])e==="base"||t.has(e)||nf.delete(e)},rf=st(new Map),b4=st(null);st(null);const N_=st(0),Bm=st(null),j_=st(!1),F_=st(null),S5=st(!1),E5=st(!1),$_=st(null),V_=st(null),sf=st(null),Dw=st(null),ao=st(null),If=st({active:!1}),C5=st([]),S4=st(null),CB=(t,e,n)=>{let r=!1;const s=new Map(t);for(const[i,a]of t)a.target&&wB(a.target,e)&&(s.set(i,{...a,target:n}),r=!0);return r?s:t},kB=st(null,(t,e,n)=>{const r=c=>{const d=c??Um;return d.kind==="variant"&&!n.has(tf(d))},s=t(rf);let i=null;for(const[c,d]of s)r(d.target)&&(i??(i=new Set)).add(c);if(i){const c=new Map(s);for(const d of i)c.delete(d);e(rf,c)}const a=t(b4);a&&r(a.target)&&(e(b4,null),e(AB,!1));const u=t(S4);u&&(i!=null&&i.has(u.commentId))&&e(S4,null),EB(n)}),H_=st(y5),PB=st(!1),k5=st(null),Mf=st(!0),P5=st(!1),T5=st(!1),R5=st(null),TB=()=>{var t;return typeof window>"u"?null:((t=window.__RIVET_BOOTSTRAP__)==null?void 0:t.agentApplyMode)??null},x0=st(TB()),RB=st(null),AB=st(!1);st(0);st(0);var Gp={exports:{}},IB=Gp.exports,E4;function MB(){return E4||(E4=1,(function(t){(function(e,n){t.exports?t.exports=n():e.log=n()})(IB,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={},a=null;function u(y,x){var S=y[x];if(typeof S.bind=="function")return S.bind(y);try{return Function.prototype.bind.call(S,y)}catch{return function(){return Function.prototype.apply.apply(S,[y,arguments])}}}function c(){console.log&&(console.log.apply?console.log.apply(console,arguments):Function.prototype.apply.apply(console.log,[console,arguments])),console.trace&&console.trace()}function d(y){return y==="debug"&&(y="log"),typeof console===n?!1:y==="trace"&&r?c:console[y]!==void 0?u(console,y):console.log!==void 0?u(console,"log"):e}function h(){for(var y=this.getLevel(),x=0;x<s.length;x++){var S=s[x];this[S]=x<y?e:this.methodFactory(S,y,this.name)}if(this.log=this.debug,typeof console===n&&y<this.levels.SILENT)return"No console available for logging"}function p(y){return function(){typeof console!==n&&(h.call(this),this[y].apply(this,arguments))}}function m(y,x,S){return d(y)||p.apply(this,arguments)}function _(y,x){var S=this,P,T,k,R="loglevel";typeof y=="string"?R+=":"+y:typeof y=="symbol"&&(R=void 0);function M(N){var j=(s[N]||"silent").toUpperCase();if(!(typeof window===n||!R)){try{window.localStorage[R]=j;return}catch{}try{window.document.cookie=encodeURIComponent(R)+"="+j+";"}catch{}}}function L(){var N;if(!(typeof window===n||!R)){try{N=window.localStorage[R]}catch{}if(typeof N===n)try{var j=window.document.cookie,G=encodeURIComponent(R),Y=j.indexOf(G+"=");Y!==-1&&(N=/^([^;]+)/.exec(j.slice(Y+G.length+1))[1])}catch{}return S.levels[N]===void 0&&(N=void 0),N}}function A(){if(!(typeof window===n||!R)){try{window.localStorage.removeItem(R)}catch{}try{window.document.cookie=encodeURIComponent(R)+"=; expires=Thu, 01 Jan 1970 00:00:00 UTC"}catch{}}}function O(N){var j=N;if(typeof j=="string"&&S.levels[j.toUpperCase()]!==void 0&&(j=S.levels[j.toUpperCase()]),typeof j=="number"&&j>=0&&j<=S.levels.SILENT)return j;throw new TypeError("log.setLevel() called with invalid level: "+N)}S.name=y,S.levels={TRACE:0,DEBUG:1,INFO:2,WARN:3,ERROR:4,SILENT:5},S.methodFactory=x||m,S.getLevel=function(){return k??T??P},S.setLevel=function(N,j){return k=O(N),j!==!1&&M(k),h.call(S)},S.setDefaultLevel=function(N){T=O(N),L()||S.setLevel(N,!1)},S.resetLevel=function(){k=null,A(),h.call(S)},S.enableAll=function(N){S.setLevel(S.levels.TRACE,N)},S.disableAll=function(N){S.setLevel(S.levels.SILENT,N)},S.rebuild=function(){if(a!==S&&(P=O(a.getLevel())),h.call(S),a===S)for(var N in i)i[N].rebuild()},P=O(a?a.getLevel():"WARN");var D=L();D!=null&&(k=O(D)),h.call(S)}a=new _,a.getLogger=function(x){if(typeof x!="symbol"&&typeof x!="string"||x==="")throw new TypeError("You must supply a name when creating a logger.");var S=i[x];return S||(S=i[x]=new _(x,a.methodFactory)),S};var w=typeof window!==n?window.log:void 0;return a.noConflict=function(){return typeof window!==n&&window.log===a&&(window.log=w),a},a.getLoggers=function(){return i},a.default=a,a})})(Gp)),Gp.exports}var OB=MB();const Vs=i0(OB),LB="INFO",DB=LB.toUpperCase();Vs.setLevel(Vs.levels[DB]||Vs.levels.INFO);const Cs=t=>{const e=t?`[${t}] `:"";return{trace:(n,...r)=>Vs.trace(`${e}${n}`,...r),debug:(n,...r)=>Vs.debug(`${e}${n}`,...r),info:(n,...r)=>Vs.info(`${e}${n}`,...r),warn:(n,...r)=>Vs.warn(`${e}${n}`,...r),error:(n,...r)=>{Vs.error(`${e}${n}`,...r);try{const i=r.map(u=>u instanceof Error?u.message:String(u)).join(" ").slice(0,512),a={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}:{}};Se.capture("logger_error",a)}catch(s){console.error("[logger] Failed to send logger_error to PostHog:",s)}},api:(n,...r)=>Vs.info(`${e}API: ${n}`,...r),hook:(n,...r)=>Vs.debug(`${e}Hook: ${n}`,...r),mount:(n,...r)=>Vs.debug(`${e}Mount: ${n}`,...r)}};let Kp=0;const NB=()=>{Kp+=1;let t=!1;return()=>{t||(t=!0,Kp=Math.max(0,Kp-1))}},jB=()=>Kp>0;function FB(t){return t==="cursor"?"Cursor":t==="codex"?"Codex":t==="claude-desktop"?"Claude":"Claude Code"}const $B=["⡡⠊⢔⠡","⠊⡰⡡⡘","⢔⢅⠈⢢","⡁⢂⠆⡍","⢔⠨⢑⢐","⠨⡑⡠⠊"],Nw=({className:t,"data-testid":e}={})=>E.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:E.jsx("div",{className:"rivet-sparkle-strip",children:$B.map((n,r)=>E.jsx("span",{className:"block",style:{height:"1em",lineHeight:"1em"},children:n},r))})}),VB=["top","right","bottom","left"],da=Math.min,so=Math.max,Wm=Math.round,bp=Math.floor,io=t=>({x:t,y:t}),HB={left:"right",right:"left",bottom:"top",top:"bottom"};function A5(t,e,n){return so(t,da(e,n))}function lo(t,e){return typeof t=="function"?t(e):t}function fa(t){return t.split("-")[0]}function gc(t){return t.split("-")[1]}function jw(t){return t==="x"?"y":"x"}function Fw(t){return t==="y"?"height":"width"}function fi(t){const e=t[0];return e==="t"||e==="b"?"y":"x"}function $w(t){return jw(fi(t))}function zB(t,e,n){n===void 0&&(n=!1);const r=gc(t),s=$w(t),i=Fw(s);let a=s==="x"?r===(n?"end":"start")?"right":"left":r==="start"?"bottom":"top";return e.reference[i]>e.floating[i]&&(a=qm(a)),[a,qm(a)]}function UB(t){const e=qm(t);return[z_(t),e,z_(e)]}function z_(t){return t.includes("start")?t.replace("start","end"):t.replace("end","start")}const C4=["left","right"],k4=["right","left"],BB=["top","bottom"],WB=["bottom","top"];function qB(t,e,n){switch(t){case"top":case"bottom":return n?e?k4:C4:e?C4:k4;case"left":case"right":return e?BB:WB;default:return[]}}function GB(t,e,n,r){const s=gc(t);let i=qB(fa(t),n==="start",r);return s&&(i=i.map(a=>a+"-"+s),e&&(i=i.concat(i.map(z_)))),i}function qm(t){const e=fa(t);return HB[e]+t.slice(e.length)}function KB(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 I5(t){return typeof t!="number"?KB(t):{top:t,right:t,bottom:t,left:t}}function Gm(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 P4(t,e,n){let{reference:r,floating:s}=t;const i=fi(e),a=$w(e),u=Fw(a),c=fa(e),d=i==="y",h=r.x+r.width/2-s.width/2,p=r.y+r.height/2-s.height/2,m=r[u]/2-s[u]/2;let _;switch(c){case"top":_={x:h,y:r.y-s.height};break;case"bottom":_={x:h,y:r.y+r.height};break;case"right":_={x:r.x+r.width,y:p};break;case"left":_={x:r.x-s.width,y:p};break;default:_={x:r.x,y:r.y}}const w=gc(e);return w&&(_[a]+=m*(w==="end"?1:-1)*(n&&d?-1:1)),_}async function ZB(t,e){var n;e===void 0&&(e={});const{x:r,y:s,platform:i,rects:a,elements:u,strategy:c}=t,{boundary:d="clippingAncestors",rootBoundary:h="viewport",elementContext:p="floating",altBoundary:m=!1,padding:_=0}=lo(e,t),w=I5(_),x=u[m?p==="floating"?"reference":"floating":p],S=Gm(await i.getClippingRect({element:(n=await(i.isElement==null?void 0:i.isElement(x)))==null||n?x:x.contextElement||await(i.getDocumentElement==null?void 0:i.getDocumentElement(u.floating)),boundary:d,rootBoundary:h,strategy:c})),P=p==="floating"?{x:r,y:s,width:a.floating.width,height:a.floating.height}:a.reference,T=await(i.getOffsetParent==null?void 0:i.getOffsetParent(u.floating)),k=await(i.isElement==null?void 0:i.isElement(T))&&await(i.getScale==null?void 0:i.getScale(T))||{x:1,y:1},R=Gm(i.convertOffsetParentRelativeRectToViewportRelativeRect?await i.convertOffsetParentRelativeRectToViewportRelativeRect({elements:u,rect:P,offsetParent:T,strategy:c}):P);return{top:(S.top-R.top+w.top)/k.y,bottom:(R.bottom-S.bottom+w.bottom)/k.y,left:(S.left-R.left+w.left)/k.x,right:(R.right-S.right+w.right)/k.x}}const YB=50,XB=async(t,e,n)=>{const{placement:r="bottom",strategy:s="absolute",middleware:i=[],platform:a}=n,u=a.detectOverflow?a:{...a,detectOverflow:ZB},c=await(a.isRTL==null?void 0:a.isRTL(e));let d=await a.getElementRects({reference:t,floating:e,strategy:s}),{x:h,y:p}=P4(d,r,c),m=r,_=0;const w={};for(let y=0;y<i.length;y++){const x=i[y];if(!x)continue;const{name:S,fn:P}=x,{x:T,y:k,data:R,reset:M}=await P({x:h,y:p,initialPlacement:r,placement:m,strategy:s,middlewareData:w,rects:d,platform:u,elements:{reference:t,floating:e}});h=T??h,p=k??p,w[S]={...w[S],...R},M&&_<YB&&(_++,typeof M=="object"&&(M.placement&&(m=M.placement),M.rects&&(d=M.rects===!0?await a.getElementRects({reference:t,floating:e,strategy:s}):M.rects),{x:h,y:p}=P4(d,m,c)),y=-1)}return{x:h,y:p,placement:m,strategy:s,middlewareData:w}},QB=t=>({name:"arrow",options:t,async fn(e){const{x:n,y:r,placement:s,rects:i,platform:a,elements:u,middlewareData:c}=e,{element:d,padding:h=0}=lo(t,e)||{};if(d==null)return{};const p=I5(h),m={x:n,y:r},_=$w(s),w=Fw(_),y=await a.getDimensions(d),x=_==="y",S=x?"top":"left",P=x?"bottom":"right",T=x?"clientHeight":"clientWidth",k=i.reference[w]+i.reference[_]-m[_]-i.floating[w],R=m[_]-i.reference[_],M=await(a.getOffsetParent==null?void 0:a.getOffsetParent(d));let L=M?M[T]:0;(!L||!await(a.isElement==null?void 0:a.isElement(M)))&&(L=u.floating[T]||i.floating[w]);const A=k/2-R/2,O=L/2-y[w]/2-1,D=da(p[S],O),N=da(p[P],O),j=L-y[w]-N,G=L/2-y[w]/2+A,Y=A5(D,G,j),W=!c.arrow&&gc(s)!=null&&G!==Y&&i.reference[w]/2-(G<D?D:N)-y[w]/2<0,q=W?G<D?G-D:G-j:0;return{[_]:m[_]+q,data:{[_]:Y,centerOffset:G-Y-q,...W&&{alignmentOffset:q}},reset:W}}}),JB=function(t){return t===void 0&&(t={}),{name:"flip",options:t,async fn(e){var n,r;const{placement:s,middlewareData:i,rects:a,initialPlacement:u,platform:c,elements:d}=e,{mainAxis:h=!0,crossAxis:p=!0,fallbackPlacements:m,fallbackStrategy:_="bestFit",fallbackAxisSideDirection:w="none",flipAlignment:y=!0,...x}=lo(t,e);if((n=i.arrow)!=null&&n.alignmentOffset)return{};const S=fa(s),P=fi(u),T=fa(u)===u,k=await(c.isRTL==null?void 0:c.isRTL(d.floating)),R=m||(T||!y?[qm(u)]:UB(u)),M=w!=="none";!m&&M&&R.push(...GB(u,y,w,k));const L=[u,...R],A=await c.detectOverflow(e,x),O=[];let D=((r=i.flip)==null?void 0:r.overflows)||[];if(h&&O.push(A[S]),p){const Y=zB(s,a,k);O.push(A[Y[0]],A[Y[1]])}if(D=[...D,{placement:s,overflows:O}],!O.every(Y=>Y<=0)){var N,j;const Y=(((N=i.flip)==null?void 0:N.index)||0)+1,W=L[Y];if(W&&(!(p==="alignment"?P!==fi(W):!1)||D.every(V=>fi(V.placement)===P?V.overflows[0]>0:!0)))return{data:{index:Y,overflows:D},reset:{placement:W}};let q=(j=D.filter(Z=>Z.overflows[0]<=0).sort((Z,V)=>Z.overflows[1]-V.overflows[1])[0])==null?void 0:j.placement;if(!q)switch(_){case"bestFit":{var G;const Z=(G=D.filter(V=>{if(M){const J=fi(V.placement);return J===P||J==="y"}return!0}).map(V=>[V.placement,V.overflows.filter(J=>J>0).reduce((J,H)=>J+H,0)]).sort((V,J)=>V[1]-J[1])[0])==null?void 0:G[0];Z&&(q=Z);break}case"initialPlacement":q=u;break}if(s!==q)return{reset:{placement:q}}}return{}}}};function T4(t,e){return{top:t.top-e.height,right:t.right-e.width,bottom:t.bottom-e.height,left:t.left-e.width}}function R4(t){return VB.some(e=>t[e]>=0)}const eW=function(t){return t===void 0&&(t={}),{name:"hide",options:t,async fn(e){const{rects:n,platform:r}=e,{strategy:s="referenceHidden",...i}=lo(t,e);switch(s){case"referenceHidden":{const a=await r.detectOverflow(e,{...i,elementContext:"reference"}),u=T4(a,n.reference);return{data:{referenceHiddenOffsets:u,referenceHidden:R4(u)}}}case"escaped":{const a=await r.detectOverflow(e,{...i,altBoundary:!0}),u=T4(a,n.floating);return{data:{escapedOffsets:u,escaped:R4(u)}}}default:return{}}}}},M5=new Set(["left","top"]);async function tW(t,e){const{placement:n,platform:r,elements:s}=t,i=await(r.isRTL==null?void 0:r.isRTL(s.floating)),a=fa(n),u=gc(n),c=fi(n)==="y",d=M5.has(a)?-1:1,h=i&&c?-1:1,p=lo(e,t);let{mainAxis:m,crossAxis:_,alignmentAxis:w}=typeof p=="number"?{mainAxis:p,crossAxis:0,alignmentAxis:null}:{mainAxis:p.mainAxis||0,crossAxis:p.crossAxis||0,alignmentAxis:p.alignmentAxis};return u&&typeof w=="number"&&(_=u==="end"?w*-1:w),c?{x:_*h,y:m*d}:{x:m*d,y:_*h}}const nW=function(t){return t===void 0&&(t=0),{name:"offset",options:t,async fn(e){var n,r;const{x:s,y:i,placement:a,middlewareData:u}=e,c=await tW(e,t);return a===((n=u.offset)==null?void 0:n.placement)&&(r=u.arrow)!=null&&r.alignmentOffset?{}:{x:s+c.x,y:i+c.y,data:{...c,placement:a}}}}},rW=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:a=!0,crossAxis:u=!1,limiter:c={fn:P=>{let{x:T,y:k}=P;return{x:T,y:k}}},...d}=lo(t,e),h={x:n,y:r},p=await i.detectOverflow(e,d),m=fi(s),_=jw(m);let w=h[_],y=h[m];const x=(P,T)=>A5(T+p[P==="y"?"top":"left"],T,T-p[P==="y"?"bottom":"right"]);a&&(w=x(_,w)),u&&(y=x(m,y));const S=c.fn({...e,[_]:w,[m]:y});return{...S,data:{x:S.x-n,y:S.y-r,enabled:{[_]:a,[m]:u}}}}}},sW=function(t){return t===void 0&&(t={}),{options:t,fn(e){var n,r;const{x:s,y:i,placement:a,rects:u,middlewareData:c}=e,{offset:d=0,mainAxis:h=!0,crossAxis:p=!0}=lo(t,e),m={x:s,y:i},_=fi(a),w=jw(_);let y=m[w],x=m[_];const S=lo(d,e),P=typeof S=="number"?{mainAxis:S,crossAxis:0}:{mainAxis:(n=S.mainAxis)!=null?n:0,crossAxis:(r=S.crossAxis)!=null?r:0};if(h){const R=w==="y"?"height":"width",M=u.reference[w]-u.floating[R]+P.mainAxis,L=u.reference[w]+u.reference[R]-P.mainAxis;y<M?y=M:y>L&&(y=L)}if(p){var T,k;const R=w==="y"?"width":"height",M=M5.has(fa(a)),L=u.reference[_]-u.floating[R]+(M&&((T=c.offset)==null?void 0:T[_])||0)+(M?0:P.crossAxis),A=u.reference[_]+u.reference[R]+(M?0:((k=c.offset)==null?void 0:k[_])||0)-(M?P.crossAxis:0);x<L?x=L:x>A&&(x=A)}return{[w]:y,[_]:x}}}},iW=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:a=()=>{},...u}=lo(t,e),c=await s.detectOverflow(e,u),d=fa(n),h=gc(n),p=fi(n)==="y",{width:m,height:_}=r.floating;let w,y;d==="top"||d==="bottom"?(w=d,y=h===(await(s.isRTL==null?void 0:s.isRTL(i.floating))?"start":"end")?"left":"right"):(y=d,w=h==="end"?"top":"bottom");const x=_-c.top-c.bottom,S=m-c.left-c.right,P=da(_-c[w],x),T=da(m-c[y],S),k=e.middlewareData.shift,R=!k;let M=P,L=T;k!=null&&k.enabled.x&&(L=S),k!=null&&k.enabled.y&&(M=x),R&&!h&&(p?L=m-2*so(c.left,c.right):M=_-2*so(c.top,c.bottom)),await a({...e,availableWidth:L,availableHeight:M});const A=await s.getDimensions(i.floating);return m!==A.width||_!==A.height?{reset:{rects:!0}}:{}}}};function b0(){return typeof window<"u"}function vc(t){return O5(t)?(t.nodeName||"").toLowerCase():"#document"}function Ar(t){var e;return(t==null||(e=t.ownerDocument)==null?void 0:e.defaultView)||window}function ho(t){var e;return(e=(O5(t)?t.ownerDocument:t.document)||window.document)==null?void 0:e.documentElement}function O5(t){return b0()?t instanceof Node||t instanceof Ar(t).Node:!1}function gi(t){return b0()?t instanceof Element||t instanceof Ar(t).Element:!1}function wa(t){return b0()?t instanceof HTMLElement||t instanceof Ar(t).HTMLElement:!1}function A4(t){return!b0()||typeof ShadowRoot>"u"?!1:t instanceof ShadowRoot||t instanceof Ar(t).ShadowRoot}function S0(t){const{overflow:e,overflowX:n,overflowY:r,display:s}=vi(t);return/auto|scroll|overlay|hidden|clip/.test(e+r+n)&&s!=="inline"&&s!=="contents"}function oW(t){return/^(table|td|th)$/.test(vc(t))}function E0(t){try{if(t.matches(":popover-open"))return!0}catch{}try{return t.matches(":modal")}catch{return!1}}const aW=/transform|translate|scale|rotate|perspective|filter/,lW=/paint|layout|strict|content/,qa=t=>!!t&&t!=="none";let C1;function Vw(t){const e=gi(t)?vi(t):t;return qa(e.transform)||qa(e.translate)||qa(e.scale)||qa(e.rotate)||qa(e.perspective)||!Hw()&&(qa(e.backdropFilter)||qa(e.filter))||aW.test(e.willChange||"")||lW.test(e.contain||"")}function uW(t){let e=Al(t);for(;wa(e)&&!of(e);){if(Vw(e))return e;if(E0(e))return null;e=Al(e)}return null}function Hw(){return C1==null&&(C1=typeof CSS<"u"&&CSS.supports&&CSS.supports("-webkit-backdrop-filter","none")),C1}function of(t){return/^(html|body|#document)$/.test(vc(t))}function vi(t){return Ar(t).getComputedStyle(t)}function C0(t){return gi(t)?{scrollLeft:t.scrollLeft,scrollTop:t.scrollTop}:{scrollLeft:t.scrollX,scrollTop:t.scrollY}}function Al(t){if(vc(t)==="html")return t;const e=t.assignedSlot||t.parentNode||A4(t)&&t.host||ho(t);return A4(e)?e.host:e}function L5(t){const e=Al(t);return of(e)?(t.ownerDocument||t).body:wa(e)&&S0(e)?e:L5(e)}function af(t,e,n){var r;e===void 0&&(e=[]),n===void 0&&(n=!0);const s=L5(t),i=s===((r=t.ownerDocument)==null?void 0:r.body),a=Ar(s);if(i){const u=U_(a);return e.concat(a,a.visualViewport||[],S0(s)?s:[],u&&n?af(u):[])}else return e.concat(s,af(s,[],n))}function U_(t){return t.parent&&Object.getPrototypeOf(t.parent)?t.frameElement:null}function D5(t){const e=vi(t);let n=parseFloat(e.width)||0,r=parseFloat(e.height)||0;const s=wa(t),i=s?t.offsetWidth:n,a=s?t.offsetHeight:r,u=Wm(n)!==i||Wm(r)!==a;return u&&(n=i,r=a),{width:n,height:r,$:u}}function zw(t){return gi(t)?t:t.contextElement}function Iu(t){const e=zw(t);if(!wa(e))return io(1);const n=e.getBoundingClientRect(),{width:r,height:s,$:i}=D5(e);let a=(i?Wm(n.width):n.width)/r,u=(i?Wm(n.height):n.height)/s;return(!a||!Number.isFinite(a))&&(a=1),(!u||!Number.isFinite(u))&&(u=1),{x:a,y:u}}const cW=io(0);function N5(t){const e=Ar(t);return!Hw()||!e.visualViewport?cW:{x:e.visualViewport.offsetLeft,y:e.visualViewport.offsetTop}}function dW(t,e,n){return e===void 0&&(e=!1),!!n&&e&&n===Ar(t)}function Il(t,e,n,r){e===void 0&&(e=!1),n===void 0&&(n=!1);const s=t.getBoundingClientRect(),i=zw(t);let a=io(1);e&&(r?gi(r)&&(a=Iu(r)):a=Iu(t));const u=dW(i,n,r)?N5(i):io(0);let c=(s.left+u.x)/a.x,d=(s.top+u.y)/a.y,h=s.width/a.x,p=s.height/a.y;if(i&&r){const m=Ar(i),_=gi(r)?Ar(r):r;let w=m,y=U_(w);for(;y&&_!==w;){const x=Iu(y),S=y.getBoundingClientRect(),P=vi(y),T=S.left+(y.clientLeft+parseFloat(P.paddingLeft))*x.x,k=S.top+(y.clientTop+parseFloat(P.paddingTop))*x.y;c*=x.x,d*=x.y,h*=x.x,p*=x.y,c+=T,d+=k,w=Ar(y),y=U_(w)}}return Gm({width:h,height:p,x:c,y:d})}function k0(t,e){const n=C0(t).scrollLeft;return e?e.left+n:Il(ho(t)).left+n}function j5(t,e){const n=t.getBoundingClientRect(),r=n.left+e.scrollLeft-k0(t,n),s=n.top+e.scrollTop;return{x:r,y:s}}function fW(t){let{elements:e,rect:n,offsetParent:r,strategy:s}=t;const i=s==="fixed",a=ho(r),u=e?E0(e.floating):!1;if(r===a||u&&i)return n;let c={scrollLeft:0,scrollTop:0},d=io(1);const h=io(0),p=wa(r);if((p||!i)&&((vc(r)!=="body"||S0(a))&&(c=C0(r)),p)){const _=Il(r);d=Iu(r),h.x=_.x+r.clientLeft,h.y=_.y+r.clientTop}const m=a&&!p&&!i?j5(a,c):io(0);return{width:n.width*d.x,height:n.height*d.y,x:n.x*d.x-c.scrollLeft*d.x+h.x+m.x,y:n.y*d.y-c.scrollTop*d.y+h.y+m.y}}function hW(t){return t.getClientRects?Array.from(t.getClientRects()):[]}function pW(t){const e=C0(t),n=t.ownerDocument.body,r=so(t.scrollWidth,t.clientWidth,n.scrollWidth,n.clientWidth),s=so(t.scrollHeight,t.clientHeight,n.scrollHeight,n.clientHeight);let i=-e.scrollLeft+k0(t);const a=-e.scrollTop;return vi(n).direction==="rtl"&&(i+=so(t.clientWidth,n.clientWidth)-r),{width:r,height:s,x:i,y:a}}const mW=25;function gW(t,e,n){n===void 0&&(n="viewport");const r=n==="layoutViewport",s=Ar(t),i=ho(t),a=s.visualViewport;let u=i.clientWidth,c=i.clientHeight,d=0,h=0;if(a){const m=!Hw()||e==="fixed";r?m||(d=-a.offsetLeft,h=-a.offsetTop):(u=a.width,c=a.height,m&&(d=a.offsetLeft,h=a.offsetTop))}if(k0(i)<=0){const m=i.ownerDocument,_=m.body,w=getComputedStyle(_),y=m.compatMode==="CSS1Compat"&&parseFloat(w.marginLeft)+parseFloat(w.marginRight)||0,x=Math.abs(i.clientWidth-_.clientWidth-y),S=getComputedStyle(i).scrollbarGutter==="stable both-edges"?x/2:x;S<=mW&&(u-=S)}return{width:u,height:c,x:d,y:h}}function vW(t,e){const n=Il(t,!0,e==="fixed"),r=n.top+t.clientTop,s=n.left+t.clientLeft,i=Iu(t),a=t.clientWidth*i.x,u=t.clientHeight*i.y,c=s*i.x,d=r*i.y;return{width:a,height:u,x:c,y:d}}function I4(t,e,n){let r;if(e==="viewport"||e==="layoutViewport")r=gW(t,n,e);else if(e==="document")r=pW(ho(t));else if(gi(e))r=vW(e,n);else{const s=N5(t);r={x:e.x-s.x,y:e.y-s.y,width:e.width,height:e.height}}return Gm(r)}function yW(t,e){const n=e.get(t);if(n)return n;let r=af(t,[],!1).filter(u=>gi(u)&&vc(u)!=="body"),s=null;const i=vi(t).position==="fixed";let a=i?Al(t):t;for(;gi(a)&&!of(a);){const u=vi(a),c=Vw(a),d=s?s.position:i?"fixed":"";!c&&(d==="fixed"||d==="absolute"&&u.position==="static")?r=r.filter(p=>p!==a):s=u,a=Al(a)}return e.set(t,r),r}function _W(t){let{element:e,boundary:n,rootBoundary:r,strategy:s}=t;const a=[...n==="clippingAncestors"?E0(e)?[]:yW(e,this._c):[].concat(n),r],u=I4(e,a[0],s);let c=u.top,d=u.right,h=u.bottom,p=u.left;for(let m=1;m<a.length;m++){const _=I4(e,a[m],s);c=so(_.top,c),d=da(_.right,d),h=da(_.bottom,h),p=so(_.left,p)}return{width:d-p,height:h-c,x:p,y:c}}function wW(t){const{width:e,height:n}=D5(t);return{width:e,height:n}}function xW(t,e,n){const r=wa(e),s=ho(e),i=n==="fixed",a=Il(t,!0,i,e);let u={scrollLeft:0,scrollTop:0};const c=io(0);if((r||!i)&&((vc(e)!=="body"||S0(s))&&(u=C0(e)),r)){const m=Il(e,!0,i,e);c.x=m.x+e.clientLeft,c.y=m.y+e.clientTop}!r&&s&&(c.x=k0(s));const d=s&&!r&&!i?j5(s,u):io(0),h=a.left+u.scrollLeft-c.x-d.x,p=a.top+u.scrollTop-c.y-d.y;return{x:h,y:p,width:a.width,height:a.height}}function k1(t){return vi(t).position==="static"}function M4(t,e){if(!wa(t)||vi(t).position==="fixed")return null;if(e)return e(t);let n=t.offsetParent;return ho(t)===n&&(n=n.ownerDocument.body),n}function F5(t,e){const n=Ar(t);if(E0(t))return n;if(!wa(t)){let s=Al(t);for(;s&&!of(s);){if(gi(s)&&!k1(s))return s;s=Al(s)}return n}let r=M4(t,e);for(;r&&oW(r)&&k1(r);)r=M4(r,e);return r&&of(r)&&k1(r)&&!Vw(r)?n:r||uW(t)||n}const bW=async function(t){const e=this.getOffsetParent||F5,n=this.getDimensions,r=await n(t.floating);return{reference:xW(t.reference,await e(t.floating),t.strategy),floating:{x:0,y:0,width:r.width,height:r.height}}};function SW(t){return vi(t).direction==="rtl"}const EW={convertOffsetParentRelativeRectToViewportRelativeRect:fW,getDocumentElement:ho,getClippingRect:_W,getOffsetParent:F5,getElementRects:bW,getClientRects:hW,getDimensions:wW,getScale:Iu,isElement:gi,isRTL:SW};function $5(t,e){return t.x===e.x&&t.y===e.y&&t.width===e.width&&t.height===e.height}function CW(t,e,n){let r=null,s;const i=ho(t);function a(){var h;clearTimeout(s),(h=r)==null||h.disconnect(),r=null}function u(h,p){h===void 0&&(h=!1),p===void 0&&(p=1),a();const m=t.getBoundingClientRect(),{left:_,top:w,width:y,height:x}=m;if(h||e(),!y||!x)return;const S=bp(w),P=bp(i.clientWidth-(_+y)),T=bp(i.clientHeight-(w+x)),k=bp(_),M={rootMargin:-S+"px "+-P+"px "+-T+"px "+-k+"px",threshold:so(0,da(1,p))||1};let L=!0;function A(O){const D=O[0].intersectionRatio;if(!$5(m,t.getBoundingClientRect()))return u();if(D!==p){if(!L)return u();D?u(!1,D):s=setTimeout(()=>{u(!1,1e-7)},1e3)}L=!1}try{r=new IntersectionObserver(A,{...M,root:i.ownerDocument})}catch{r=new IntersectionObserver(A,M)}r.observe(t)}const c=Ar(t),d=()=>u(n);return c.addEventListener("resize",d),u(!0),()=>{c.removeEventListener("resize",d),a()}}function kW(t,e,n,r){r===void 0&&(r={});const{ancestorScroll:s=!0,ancestorResize:i=!0,elementResize:a=typeof ResizeObserver=="function",layoutShift:u=typeof IntersectionObserver=="function",animationFrame:c=!1}=r,d=zw(t),h=s||i?[...d?af(d):[],...e?af(e):[]]:[];h.forEach(S=>{s&&S.addEventListener("scroll",n),i&&S.addEventListener("resize",n)});const p=d&&u?CW(d,n,i):null;let m=-1,_=null;a&&(_=new ResizeObserver(S=>{let[P]=S;P&&P.target===d&&_&&e&&(_.unobserve(e),cancelAnimationFrame(m),m=requestAnimationFrame(()=>{var T;(T=_)==null||T.observe(e)})),n()}),d&&!c&&_.observe(d),e&&_.observe(e));let w,y=c?Il(t):null;c&&x();function x(){const S=Il(t);y&&!$5(y,S)&&n(),y=S,w=requestAnimationFrame(x)}return n(),()=>{var S;h.forEach(P=>{s&&P.removeEventListener("scroll",n),i&&P.removeEventListener("resize",n)}),p==null||p(),(S=_)==null||S.disconnect(),_=null,c&&cancelAnimationFrame(w)}}const PW=nW,TW=rW,RW=JB,AW=iW,IW=eW,O4=QB,MW=sW,OW=(t,e,n)=>{const r=new Map,s=n??{},i={...EW,...s.platform,_c:r};return XB(t,e,{...s,platform:i})};var LW=typeof document<"u",DW=function(){},Zp=LW?v.useLayoutEffect:DW;function Km(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(!Km(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)&&!Km(t[i],e[i]))return!1}return!0}return t!==t&&e!==e}function V5(t){return typeof window>"u"?1:(t.ownerDocument.defaultView||window).devicePixelRatio||1}function L4(t,e){const n=V5(t);return Math.round(e*n)/n}function P1(t){const e=v.useRef(t);return Zp(()=>{e.current=t}),e}function NW(t){t===void 0&&(t={});const{placement:e="bottom",strategy:n="absolute",middleware:r=[],platform:s,elements:{reference:i,floating:a}={},transform:u=!0,whileElementsMounted:c,open:d}=t,[h,p]=v.useState({x:0,y:0,strategy:n,placement:e,middlewareData:{},isPositioned:!1}),[m,_]=v.useState(r);Km(m,r)||_(r);const[w,y]=v.useState(null),[x,S]=v.useState(null),P=v.useCallback(V=>{V!==M.current&&(M.current=V,y(V))},[]),T=v.useCallback(V=>{V!==L.current&&(L.current=V,S(V))},[]),k=i||w,R=a||x,M=v.useRef(null),L=v.useRef(null),A=v.useRef(h),O=c!=null,D=P1(c),N=P1(s),j=P1(d),G=v.useCallback(()=>{if(!M.current||!L.current)return;const V={placement:e,strategy:n,middleware:m};N.current&&(V.platform=N.current),OW(M.current,L.current,V).then(J=>{const H={...J,isPositioned:j.current!==!1};Y.current&&!Km(A.current,H)&&(A.current=H,v0.flushSync(()=>{p(H)}))})},[m,e,n,N,j]);Zp(()=>{d===!1&&A.current.isPositioned&&(A.current.isPositioned=!1,p(V=>({...V,isPositioned:!1})))},[d]);const Y=v.useRef(!1);Zp(()=>(Y.current=!0,()=>{Y.current=!1}),[]),Zp(()=>{if(k&&(M.current=k),R&&(L.current=R),k&&R){if(D.current)return D.current(k,R,G);G()}},[k,R,G,D,O]);const W=v.useMemo(()=>({reference:M,floating:L,setReference:P,setFloating:T}),[P,T]),q=v.useMemo(()=>({reference:k,floating:R}),[k,R]),Z=v.useMemo(()=>{const V={position:n,left:0,top:0};if(!q.floating)return V;const J=L4(q.floating,h.x),H=L4(q.floating,h.y);return u?{...V,transform:"translate("+J+"px, "+H+"px)",...V5(q.floating)>=1.5&&{willChange:"transform"}}:{position:n,left:J,top:H}},[n,u,q.floating,h.x,h.y]);return v.useMemo(()=>({...h,update:G,refs:W,elements:q,floatingStyles:Z}),[h,G,W,q,Z])}const jW=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?O4({element:r.current,padding:s}).fn(n):{}:r?O4({element:r,padding:s}).fn(n):{}}}},FW=(t,e)=>{const n=PW(t);return{name:n.name,fn:n.fn,options:[t,e]}},$W=(t,e)=>{const n=TW(t);return{name:n.name,fn:n.fn,options:[t,e]}},VW=(t,e)=>({fn:MW(t).fn,options:[t,e]}),HW=(t,e)=>{const n=RW(t);return{name:n.name,fn:n.fn,options:[t,e]}},zW=(t,e)=>{const n=AW(t);return{name:n.name,fn:n.fn,options:[t,e]}},UW=(t,e)=>{const n=IW(t);return{name:n.name,fn:n.fn,options:[t,e]}},BW=(t,e)=>{const n=jW(t);return{name:n.name,fn:n.fn,options:[t,e]}};var WW=Object.defineProperty,qW=(t,e)=>WW(t,"name",{value:e,configurable:!0});function Uw(t){const[e,n]=v.useState(void 0);return Rr(()=>{if(t){n({width:t.offsetWidth,height:t.offsetHeight});const r=new ResizeObserver(s=>{if(!Array.isArray(s)||!s.length)return;const i=s[0];let a,u;if("borderBoxSize"in i){const c=i.borderBoxSize,d=Array.isArray(c)?c[0]:c;a=d.inlineSize,u=d.blockSize}else a=t.offsetWidth,u=t.offsetHeight;n({width:a,height:u})});return r.observe(t,{box:"border-box"}),()=>r.unobserve(t)}else n(void 0)},[t]),e}qW(Uw,"useSize");var GW=Object.defineProperty,ra=(t,e)=>GW(t,"name",{value:e,configurable:!0}),H5="Popper",[z5,P0]=_i(H5),[KW,U5]=z5(H5),ZW=ra(t=>{const{__scopePopper:e,children:n}=t,[r,s]=v.useState(null),[i,a]=v.useState(void 0);return E.jsx(KW,{scope:e,anchor:r,onAnchorChange:s,placementState:i,setPlacementState:a,children:n})},"Popper"),YW="PopperAnchor",XW=v.forwardRef(ra(function(e,n){const{__scopePopper:r,virtualRef:s,...i}=e,a=U5(YW,r),u=v.useRef(null),c=a.onAnchorChange,d=v.useCallback(y=>{u.current=y,y&&c(y)},[c]),h=Vt(n,d),p=v.useRef(null);v.useEffect(()=>{if(!s)return;const y=p.current;p.current=s.current,y!==p.current&&c(p.current)});const m=a.placementState&&T0(a.placementState),_=m==null?void 0:m[0],w=m==null?void 0:m[1];return s?null:E.jsx(dn.div,{"data-radix-popper-side":_,"data-radix-popper-align":w,...i,ref:h})},"PopperAnchor")),B5="PopperContent",[QW,oee]=z5(B5),JW=v.forwardRef(ra(function(e,n){var ie,Ne,Be,Pe,$e,dt,Qt;const{__scopePopper:r,side:s="bottom",sideOffset:i=0,align:a="center",alignOffset:u=0,arrowPadding:c=0,avoidCollisions:d=!0,collisionBoundary:h=[],collisionPadding:p=0,sticky:m="partial",hideWhenDetached:_=!1,updatePositionStrategy:w="optimized",onPlaced:y,...x}=e,S=U5(B5,r),[P,T]=v.useState(null),k=Vt(n,T),[R,M]=v.useState(null),L=Uw(R),A=(L==null?void 0:L.width)??0,O=(L==null?void 0:L.height)??0,D=s+(a!=="center"?"-"+a:""),N=typeof p=="number"?p:{top:0,right:0,bottom:0,left:0,...p},j=Array.isArray(h)?h:[h],G=j.length>0,Y={padding:N,boundary:j.filter(W5),altBoundary:G},{refs:W,floatingStyles:q,placement:Z,isPositioned:V,middlewareData:J}=NW({strategy:"fixed",placement:D,whileElementsMounted:ra((...be)=>kW(...be,{animationFrame:w==="always"}),"whileElementsMounted"),elements:{reference:S.anchor},middleware:[FW({mainAxis:i+O,alignmentAxis:u}),d&&$W({mainAxis:!0,crossAxis:!1,limiter:m==="partial"?VW():void 0,...Y}),d&&HW({...Y}),zW({...Y,apply:ra(({elements:be,rects:Ve,availableWidth:qe,availableHeight:tt})=>{const{width:_t,height:nt}=Ve.reference,Ye=be.floating.style;Ye.setProperty("--radix-popper-available-width",`${qe}px`),Ye.setProperty("--radix-popper-available-height",`${tt}px`),Ye.setProperty("--radix-popper-anchor-width",`${_t}px`),Ye.setProperty("--radix-popper-anchor-height",`${nt}px`)},"apply")}),R&&BW({element:R,padding:c}),eq({arrowWidth:A,arrowHeight:O}),_&&UW({strategy:"referenceHidden",...Y,boundary:G?Y.boundary:void 0})]}),H=S.setPlacementState;Rr(()=>(H(Z),()=>{H(void 0)}),[Z,H]);const[F,X]=T0(Z),oe=Rl(y);Rr(()=>{V&&(oe==null||oe())},[V,oe]);const se=(ie=J.arrow)==null?void 0:ie.x,ee=(Ne=J.arrow)==null?void 0:Ne.y,ce=((Be=J.arrow)==null?void 0:Be.centerOffset)!==0,[we,le]=v.useState();return Rr(()=>{P&&le(window.getComputedStyle(P).zIndex)},[P]),E.jsx("div",{ref:W.setFloating,"data-radix-popper-content-wrapper":"",style:{...q,transform:V?q.transform:"translate(0, -200%)",minWidth:"max-content",zIndex:we,"--radix-popper-transform-origin":[(Pe=J.transformOrigin)==null?void 0:Pe.x,($e=J.transformOrigin)==null?void 0:$e.y].join(" "),...((dt=J.hide)==null?void 0:dt.referenceHidden)&&{visibility:"hidden",pointerEvents:"none"}},dir:e.dir,children:E.jsx(QW,{scope:r,placedSide:F,placedAlign:X,onArrowChange:M,arrowX:se,arrowY:ee,shouldHideArrow:ce,children:E.jsx(dn.div,{"data-side":F,"data-align":X,...x,ref:k,style:{...x.style,animation:V?(Qt=x.style)==null?void 0:Qt.animation:"none"}})})})},"PopperContent"));function W5(t){return t!==null}ra(W5,"isNotNull");var eq=ra(t=>({name:"transformOrigin",options:t,fn(e){var x,S,P;const{placement:n,rects:r,middlewareData:s}=e,a=((x=s.arrow)==null?void 0:x.centerOffset)!==0,u=a?0:t.arrowWidth,c=a?0:t.arrowHeight,[d,h]=T0(n),p={start:"0%",center:"50%",end:"100%"}[h],m=(((S=s.arrow)==null?void 0:S.x)??0)+u/2,_=(((P=s.arrow)==null?void 0:P.y)??0)+c/2;let w="",y="";return d==="bottom"?(w=a?p:`${m}px`,y=`${-c}px`):d==="top"?(w=a?p:`${m}px`,y=`${r.floating.height+c}px`):d==="right"?(w=`${-c}px`,y=a?p:`${_}px`):d==="left"&&(w=`${r.floating.width+c}px`,y=a?p:`${_}px`),{data:{x:w,y}}}}),"transformOrigin");function T0(t){const[e,n="center"]=t.split("-");return[e,n]}ra(T0,"getSideAndAlignFromPlacement");var q5=ZW,G5=XW,K5=JW,tq=Object.defineProperty,xa=(t,e)=>tq(t,"name",{value:e,configurable:!0}),Bw="Popover",[Z5,aee]=_i(Bw,[P0]),Ww=P0(),[nq,yc]=Z5(Bw),rq=xa(t=>{const{__scopePopover:e,children:n,open:r,defaultOpen:s,onOpenChange:i,modal:a=!1}=t,u=Ww(e),c=v.useRef(null),[d,h]=v.useState(!1),[p,m]=va({prop:r,defaultProp:s??!1,onChange:i,caller:Bw});return E.jsx(q5,{...u,children:E.jsx(nq,{scope:e,contentId:na(),triggerRef:c,open:p,onOpenChange:m,onOpenToggle:v.useCallback(()=>m(_=>!_),[m]),hasCustomAnchor:d,onCustomAnchorAdd:v.useCallback(()=>h(!0),[]),onCustomAnchorRemove:v.useCallback(()=>h(!1),[]),modal:a,children:n})})},"Popover"),sq="PopoverTrigger",iq=v.forwardRef(xa(function(e,n){const{__scopePopover:r,...s}=e,i=yc(sq,r),a=Ww(r),u=Vt(n,i.triggerRef),c=E.jsx(dn.button,{type:"button","aria-haspopup":"dialog","aria-expanded":i.open,"aria-controls":i.open?i.contentId:void 0,"data-state":qw(i.open),...s,ref:u,onClick:Ft(e.onClick,i.onOpenToggle)});return i.hasCustomAnchor?c:E.jsx(G5,{asChild:!0,...a,children:c})},"PopoverTrigger")),Y5="PopoverPortal",[oq,aq]=Z5(Y5,{forceMount:void 0}),lq=xa(t=>{const{__scopePopover:e,forceMount:n,children:r,container:s}=t,i=yc(Y5,e);return E.jsx(oq,{scope:e,forceMount:n,children:E.jsx(ya,{present:n||i.open,children:E.jsx(bw,{asChild:!0,container:s,children:r})})})},"PopoverPortal"),lf="PopoverContent",uq=v.forwardRef(xa(function(e,n){const r=aq(lf,e.__scopePopover),{forceMount:s=r.forceMount,...i}=e,a=yc(lf,e.__scopePopover);return E.jsx(ya,{present:s||a.open,children:a.modal?E.jsx(dq,{...i,ref:n}):E.jsx(fq,{...i,ref:n})})},"PopoverContent")),cq=ca("PopoverContent.RemoveScroll"),dq=v.forwardRef(xa(function(e,n){const r=yc(lf,e.__scopePopover),s=v.useRef(null),i=Vt(n,s),a=v.useRef(!1);return v.useEffect(()=>{const u=s.current;if(u)return PR(u)},[]),E.jsx(Ew,{as:cq,allowPinchZoom:!0,children:E.jsx(X5,{...e,ref:i,trapFocus:r.open,disableOutsidePointerEvents:!0,onCloseAutoFocus:Ft(e.onCloseAutoFocus,u=>{var c;u.preventDefault(),a.current||(c=r.triggerRef.current)==null||c.focus()}),onPointerDownOutside:Ft(e.onPointerDownOutside,u=>{const c=u.detail.originalEvent,d=c.button===0&&c.ctrlKey===!0,h=c.button===2||d;a.current=h},{checkForDefaultPrevented:!1}),onFocusOutside:Ft(e.onFocusOutside,u=>u.preventDefault(),{checkForDefaultPrevented:!1})})})},"PopoverContentModal")),fq=v.forwardRef(xa(function(e,n){const r=yc(lf,e.__scopePopover),s=v.useRef(!1),i=v.useRef(!1);return E.jsx(X5,{...e,ref:n,trapFocus:!1,disableOutsidePointerEvents:!1,onCloseAutoFocus:a=>{var u,c;(u=e.onCloseAutoFocus)==null||u.call(e,a),a.defaultPrevented||(s.current||(c=r.triggerRef.current)==null||c.focus(),a.preventDefault()),s.current=!1,i.current=!1},onInteractOutside:a=>{var d,h;(d=e.onInteractOutside)==null||d.call(e,a),a.defaultPrevented||(s.current=!0,a.detail.originalEvent.type==="pointerdown"&&(i.current=!0));const u=a.target;((h=r.triggerRef.current)==null?void 0:h.contains(u))&&a.preventDefault(),a.detail.originalEvent.type==="focusin"&&i.current&&a.preventDefault()}})},"PopoverContentNonModal")),X5=v.forwardRef(xa(function(e,n){const{__scopePopover:r,trapFocus:s,onOpenAutoFocus:i,onCloseAutoFocus:a,disableOutsidePointerEvents:u,onEscapeKeyDown:c,onPointerDownOutside:d,onFocusOutside:h,onInteractOutside:p,...m}=e,_=yc(lf,r),w=Ww(r);return y0(),E.jsx(lR,{asChild:!0,loop:!0,trapped:s,onMountAutoFocus:i,onUnmountAutoFocus:a,children:E.jsx(_w,{asChild:!0,disableOutsidePointerEvents:u,onInteractOutside:p,onEscapeKeyDown:c,onPointerDownOutside:d,onFocusOutside:h,onDismiss:()=>_.onOpenChange(!1),deferPointerDownOutside:!0,children:E.jsx(K5,{"data-state":qw(_.open),role:"dialog",id:_.contentId,...w,...m,ref:n,style:{...m.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 qw(t){return t?"open":"closed"}xa(qw,"getState");var Q5=rq,J5=iq,eA=lq,tA=uq;const nA=({primaryLabel:t,primaryIcon:e,primaryAction:n,isDisabled:r=!1,isDropdownDisabled:s=!1,isLoading:i=!1,loadingLabel:a,dropdownAriaLabel:u="More actions",dropdownItems:c})=>{const[d,h]=v.useState(!1),p=i?a??t:t,m=c.length>0;return E.jsxs("div",{className:"flex items-stretch",children:[E.jsxs("button",{onClick:n,disabled:r||i,className:`bg-main-hover hover:bg-main-input flex h-7 shrink-0 items-center gap-1.5 px-3 text-xs font-medium text-white transition-colors disabled:cursor-not-allowed disabled:opacity-50 ${m?"rounded-l-md":"rounded-md"}`,children:[e?E.jsx(e,{className:"h-3.5 w-3.5",weight:"bold"}):null,p]}),m?E.jsxs(Q5,{open:d,onOpenChange:h,children:[E.jsx(J5,{asChild:!0,children:E.jsx("button",{"aria-label":u,disabled:s||i,title:u,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:E.jsx(hU,{className:"h-3.5 w-3.5",weight:"bold"})})}),E.jsx(eA,{children:E.jsx(tA,{className:"border-divider bg-main z-[60] min-w-[140px] rounded-lg border p-1 shadow-lg",sideOffset:5,align:"end",children:c.map(_=>{const w=_.icon;return E.jsxs("button",{onClick:()=>{_.isDisabled||(_.onClick(),h(!1))},disabled:_.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:[w?E.jsx(w,{className:"h-3.5 w-3.5",weight:"bold"}):null,_.label]},_.label)})})})]}):null]})};var hq=Object.defineProperty,pq=(t,e)=>hq(t,"name",{value:e,configurable:!0}),mq=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"}),gq=v.forwardRef(pq(function(e,n){return E.jsx(dn.span,{...e,ref:n,style:{...mq,...e.style}})},"VisuallyHidden")),vq=gq,yq=Object.defineProperty,In=(t,e)=>yq(t,"name",{value:e,configurable:!0}),[Gw,lee]=_i("Tooltip",[P0]),Kw=P0(),_q="TooltipProvider",wq=700,B_="tooltip.open",[xq,Zw]=Gw(_q),bq=In(t=>{const{__scopeTooltip:e,delayDuration:n=wq,skipDelayDuration:r=300,disableHoverableContent:s=!1,children:i}=t,a=v.useRef(!0),u=v.useRef(!1),c=v.useRef(0);return v.useEffect(()=>{const d=c.current;return()=>window.clearTimeout(d)},[]),E.jsx(xq,{scope:e,isOpenDelayedRef:a,delayDuration:n,onOpen:v.useCallback(()=>{r<=0||(window.clearTimeout(c.current),a.current=!1)},[r]),onClose:v.useCallback(()=>{r<=0||(window.clearTimeout(c.current),c.current=window.setTimeout(()=>a.current=!0,r))},[r]),isPointerInTransitRef:u,onPointerInTransitChange:v.useCallback(d=>{u.current=d},[]),disableHoverableContent:s,children:i})},"TooltipProvider"),W_="Tooltip",[Sq,Of]=Gw(W_),Eq=In(t=>{const{__scopeTooltip:e,children:n,open:r,defaultOpen:s,onOpenChange:i,disableHoverableContent:a,delayDuration:u}=t,c=Zw(W_,t.__scopeTooltip),d=Kw(e),[h,p]=v.useState(null),[m,_]=v.useState(void 0),w=na(),y=v.useRef(0),x=a??c.disableHoverableContent,S=u??c.delayDuration,P=v.useRef(!1),[T,k]=va({prop:r,defaultProp:s??!1,onChange:In(D=>{D?(c.onOpen(),document.dispatchEvent(new CustomEvent(B_))):c.onClose(),i==null||i(D)},"onChange"),caller:W_}),R=v.useMemo(()=>T?P.current?"delayed-open":"instant-open":"closed",[T]),M=v.useCallback(()=>{window.clearTimeout(y.current),y.current=0,P.current=!1,k(!0)},[k]),L=v.useCallback(()=>{window.clearTimeout(y.current),y.current=0,k(!1)},[k]),A=v.useCallback(()=>{window.clearTimeout(y.current),y.current=window.setTimeout(()=>{P.current=!0,k(!0),y.current=0},S)},[S,k]);v.useEffect(()=>()=>{y.current&&(window.clearTimeout(y.current),y.current=0)},[]);const O=m??w;return E.jsx(q5,{...d,children:E.jsx(Sq,{scope:e,contentId:O,setContentId:_,open:T,stateAttribute:R,trigger:h,onTriggerChange:p,onTriggerEnter:v.useCallback(()=>{c.isOpenDelayedRef.current?A():M()},[c.isOpenDelayedRef,A,M]),onTriggerLeave:v.useCallback(()=>{x?L():(window.clearTimeout(y.current),y.current=0)},[L,x]),onOpen:M,onClose:L,disableHoverableContent:x,children:n})})},"Tooltip"),D4="TooltipTrigger",Cq=v.forwardRef(In(function(e,n){const{__scopeTooltip:r,...s}=e,i=Of(D4,r),a=Zw(D4,r),u=Kw(r),c=v.useRef(null),d=Vt(n,c,i.onTriggerChange),h=v.useRef(!1),p=v.useRef(!1),m=v.useCallback(()=>h.current=!1,[]);return v.useEffect(()=>()=>document.removeEventListener("pointerup",m),[m]),E.jsx(G5,{asChild:!0,...u,children:E.jsx(dn.button,{"aria-describedby":i.open?i.contentId:void 0,"data-state":i.stateAttribute,...s,ref:d,onPointerMove:Ft(e.onPointerMove,_=>{_.pointerType!=="touch"&&!p.current&&!a.isPointerInTransitRef.current&&(i.onTriggerEnter(),p.current=!0)}),onPointerLeave:Ft(e.onPointerLeave,()=>{i.onTriggerLeave(),p.current=!1}),onPointerDown:Ft(e.onPointerDown,()=>{i.open&&i.onClose(),h.current=!0,document.addEventListener("pointerup",m,{once:!0})}),onFocus:Ft(e.onFocus,()=>{h.current||i.onOpen()}),onBlur:Ft(e.onBlur,i.onClose),onClick:Ft(e.onClick,i.onClose)})})},"TooltipTrigger")),rA="TooltipPortal",[kq,Pq]=Gw(rA,{forceMount:void 0}),Tq=In(t=>{const{__scopeTooltip:e,forceMount:n,children:r,container:s}=t,i=Of(rA,e);return E.jsx(kq,{scope:e,forceMount:n,children:E.jsx(ya,{present:n||i.open,children:E.jsx(bw,{asChild:!0,container:s,children:r})})})},"TooltipPortal"),uf="TooltipContent",Rq=v.forwardRef(In(function(e,n){const r=Pq(uf,e.__scopeTooltip),{forceMount:s=r.forceMount,side:i="top",...a}=e,u=Of(uf,e.__scopeTooltip);return E.jsx(ya,{present:s||u.open,children:u.disableHoverableContent?E.jsx(sA,{side:i,...a,ref:n}):E.jsx(Aq,{side:i,...a,ref:n})})},"TooltipContent")),Aq=v.forwardRef(In(function(e,n){const r=Of(uf,e.__scopeTooltip),s=Zw(uf,e.__scopeTooltip),i=v.useRef(null),a=Vt(n,i),[u,c]=v.useState(null),{trigger:d,onClose:h}=r,p=i.current,{onPointerInTransitChange:m}=s,_=v.useCallback(()=>{c(null),m(!1)},[m]),w=v.useCallback((y,x)=>{const S=y.currentTarget,P={x:y.clientX,y:y.clientY},T=iA(P,S.getBoundingClientRect()),k=oA(P,T),R=aA(x.getBoundingClientRect()),M=uA([...k,...R]);c(M),m(!0)},[m]);return v.useEffect(()=>()=>_(),[_]),v.useEffect(()=>{if(d&&p){const y=In(S=>w(S,p),"handleTriggerLeave"),x=In(S=>w(S,d),"handleContentLeave");return d.addEventListener("pointerleave",y),p.addEventListener("pointerleave",x),()=>{d.removeEventListener("pointerleave",y),p.removeEventListener("pointerleave",x)}}},[d,p,w,_]),v.useEffect(()=>{if(u){const y=In(x=>{const S=x.target,P={x:x.clientX,y:x.clientY},T=(d==null?void 0:d.contains(S))||(p==null?void 0:p.contains(S)),k=!lA(P,u);T?_():k&&(_(),h())},"handleTrackPointerGrace");return document.addEventListener("pointermove",y),()=>document.removeEventListener("pointermove",y)}},[d,p,u,h,_]),E.jsx(sA,{...e,ref:a})},"TooltipContentHoverable")),Iq=QT("TooltipContent"),sA=v.forwardRef(In(function(e,n){const{__scopeTooltip:r,children:s,"aria-label":i,id:a,onEscapeKeyDown:u,onPointerDownOutside:c,...d}=e,h=Of(uf,r),p=Kw(r),{onClose:m}=h;v.useEffect(()=>(document.addEventListener(B_,m),()=>document.removeEventListener(B_,m)),[m]),v.useEffect(()=>{if(h.trigger){const w=In(y=>{y.target instanceof Node&&y.target.contains(h.trigger)&&m()},"handleScroll");return window.addEventListener("scroll",w,{capture:!0}),()=>window.removeEventListener("scroll",w,{capture:!0})}},[h.trigger,m]);const{setContentId:_}=h;return Rr(()=>(_(a),()=>{_(void 0)}),[a,_]),E.jsx(_w,{asChild:!0,disableOutsidePointerEvents:!1,onEscapeKeyDown:u,onPointerDownOutside:c,onFocusOutside:w=>w.preventDefault(),onDismiss:m,children:E.jsxs(K5,{"data-state":h.stateAttribute,role:i?void 0:"tooltip",id:i?void 0:h.contentId,...p,...d,ref:n,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:[E.jsx(Iq,{children:s}),i?E.jsx(vq,{id:h.contentId,role:"tooltip",children:i}):null]})})},"TooltipContentImpl"));function iA(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")}}In(iA,"getExitSideFromRect");function oA(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}In(oA,"getPaddedExitPoints");function aA(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}]}In(aA,"getPointsFromRect");function lA(t,e){const{x:n,y:r}=t;let s=!1;for(let i=0,a=e.length-1;i<e.length;a=i++){const u=e[i],c=e[a],d=u.x,h=u.y,p=c.x,m=c.y;h>r!=m>r&&n<(p-d)*(r-h)/(m-h)+d&&(s=!s)}return s}In(lA,"isPointInPolygon");function uA(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),cA(e)}In(uA,"getHull");function cA(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],a=e[e.length-2];if((i.x-a.x)*(s.y-a.y)>=(i.y-a.y)*(s.x-a.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],a=n[n.length-2];if((i.x-a.x)*(s.y-a.y)>=(i.y-a.y)*(s.x-a.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)}In(cA,"getHullPresorted");var Mq=bq,Oq=Eq,Lq=Cq,Dq=Tq,Nq=Rq;const Ld={normal:"'wght' 400",medium:"'wght' 450",semibold:"'wght' 550"},dA={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"}},fA=v.createContext(null);function R0(){const t=v.useContext(fA);return t?t.classes:dA.pill}function jq(t){const e=document.documentElement;e.classList.add("transitioning"),e.offsetHeight,t(),setTimeout(()=>e.classList.remove("transitioning"),200)}function Fq({children:t,defaultShape:e="pill"}){const[n,r]=v.useState(e),s=v.useCallback(i=>{jq(()=>r(i))},[]);return E.jsx(fA.Provider,{value:{shape:n,setShape:s,classes:dA[n]},children:t})}const hA=v.createContext(null);function pA({value:t,children:e}){return E.jsx(hA.Provider,{value:t,children:e})}function $q(t){switch(t){case"top":return{y:4};case"bottom":return{y:-4};case"left":return{x:4};case"right":return{x:-4}}}function Yw({content:t,children:e,side:n="top",sideOffset:r=8,delayDuration:s=200,className:i,forceOpen:a,onOpenChange:u}){const[c,d]=v.useState(!1),h=a!==void 0?a:c,[p,m]=v.useState(!1),_=R0(),w=v.useContext(hA);v.useEffect(()=>{h&&m(!0)},[h]);const y=()=>{h||m(!1)},x=$q(n);return E.jsx(Mq,{delayDuration:s,children:E.jsxs(Oq,{open:h,onOpenChange:S=>{d(S),u==null||u(S)},children:[E.jsx(Lq,{asChild:!0,children:e}),p&&E.jsx(Dq,{forceMount:!0,container:w??void 0,children:E.jsx(Nq,{side:n,sideOffset:r,forceMount:!0,className:"z-tooltip",children:E.jsx(ro.div,{className:dr("bg-neutral-900 text-white text-[12px] px-2 py-1 border border-white/10 shadow-lg",_.bg,i),style:{fontVariationSettings:Ld.medium},initial:{opacity:0,scale:.8,...x},animate:{opacity:h?1:0,scale:h?1:.9,x:0,y:0},transition:h?{type:"spring",duration:.34,bounce:.55}:{duration:.1},onAnimationComplete:y,children:t})})})]})})}const Ji=({label:t,children:e,side:n="top",sideOffset:r=8,delayDuration:s=300,disabled:i=!1,forceOpen:a})=>i?E.jsx(E.Fragment,{children:e}):E.jsx(Yw,{content:t,side:n,sideOffset:r,delayDuration:s,forceOpen:a,children:e}),A0="/__rivet/preview",N4=`${A0}/variant/`,j4=`${A0}/history/`,mA=t=>t?t.startsWith("/")?t:`/${t}`:"/",Vq=t=>`${A0}/variant/${encodeURIComponent(t.sessionId)}/${encodeURIComponent(t.variantId)}${mA(t.routePath)}`,Hq=t=>`${A0}/history/${encodeURIComponent(t.sessionId)}/${encodeURIComponent(t.variantId)}${mA(t.routePath)}`,zq=t=>{try{const e=new URL(t,"http://localhost");return e.pathname.startsWith(N4)||e.pathname.startsWith(j4)}catch{return t.startsWith(N4)||t.startsWith(j4)}},F4=t=>{var s,i,a,u;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")?Vq({sessionId:e,variantId:n.workItemId,routePath:t.routePath}):e&&(r==null?void 0:r.kind)==="fresh"&&((a=r.executionPlan)==null?void 0:a.mode)!=="vite_app"&&((u=n.preview)==null?void 0:u.kind)!=="dev_server"?`/api/variants/${e}/static/${n.workItemId}`:null},$4="/rivet/",gA=t=>{if(!t.startsWith($4))return null;const e=t.slice($4.length);return!e||e==="/"?null:`/${e}`},cf=(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(()=>{})},Uq=(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),cf(r,e))}},Zm=(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}}},V4=6,q_="original",Xw="Original",Qw="The original state of your app before any variants were generated.",H4=200,mn=Cs("AgentVariantsPanel"),T1=()=>{var t;(t=window.getSelection())==null||t.removeAllRanges()},Bq=t=>t?t.kind==="active"?t.variant.workItemId:`${t.entry.sessionId}:${t.entry.variantId}`:null,pu=t=>{var e;return!!t.hasTree&&((e=t.serve)==null?void 0:e.kind)==="dev-server"},Wq=t=>{var e;return t?t.kind==="existing"?!0:((e=t.executionPlan)==null?void 0:e.mode)==="vite_app":!1};function Mu(t,...e){return t?e.some(n=>(n??"").toLowerCase().includes(t)):!0}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 qq=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},Dd=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")},vA=t=>{var e;return((e=t.previewUnavailable)==null?void 0:e.reason)==="idle_timeout"},Gq=t=>t.status==="succeeded"&&!Dd(t)&&(!t.previewUnavailable||vA(t)),R1=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"},z4=(t,e,n)=>{const r=t.includes("?")?"&":"?";return`${t}${r}${encodeURIComponent(e)}=${encodeURIComponent(n)}`},Kq=t=>{var e;return qq(t)&&((e=t.preview)==null?void 0:e.kind)==="static_artifact"},U4=(t,e)=>t.map(n=>`${n.workItemId}:${e[n.workItemId]??""}`).join("|"),Zq=(t,e)=>t.length===e.length&&t.every((n,r)=>{var i,a;const s=e[r];return n.sessionId===s.sessionId&&n.variantId===s.variantId&&n.label===s.label&&n.brief===s.brief&&n.createdAt===s.createdAt&&((i=n.serve)==null?void 0:i.kind)===((a=s.serve)==null?void 0:a.kind)&&n.hasTree===s.hasTree}),Yq=()=>{var Ca,jr,Bf,pr;const t=et(If),e=et(C5),n=et(k5),r=et(Mf),s=et(H_),i=((Ca=s.deployPrototype)==null?void 0:Ca.isEnabled)??!1,a=((jr=s.canvasShare)==null?void 0:jr.isEnabled)??!1,u=((Bf=s.variantSend)==null?void 0:Bf.isEnabled)??!1,c=((pr=s.designContextViewer)==null?void 0:pr.isEnabled)??!1,d=et(T5),h=et(R5),p=at(N_),m=at(Bm),_=at(j_),w=at(F_),y=at(S5),x=at(E5),S=at(sf),P=at(Dw),T=at(w5);v.useEffect(()=>(T("Directions"),()=>T(null)),[T]);const k=et(ao),R=at(ao),M=v.useCallback((U=!1)=>{if(Uq(k),R(null),U&&k){const ae=Zm("ended",k);Se.capture(ae.event,ae.properties)}},[R,k]),L=et($_),A=at($_),O=et(V_),D=at(V_),N=O?`${O.sessionId}:${O.variantId}`:null,[j,G]=v.useState(""),[Y,W]=v.useState(null),[q,Z]=v.useState(null),[V,J]=v.useState({}),[H,F]=v.useState(null),[X,oe]=v.useState({}),[se,ee]=v.useState(null),[ce,we]=v.useState([]),le=v.useRef([]);le.current=ce;const[ie,Ne]=v.useState(!1),Be=v.useRef(!1);Be.current=O!==null||L!==null||ie;const Pe=v.useMemo(()=>t.active?t.variants:[],[t]),$e=v.useMemo(()=>Pe.filter(Kq),[Pe]),dt=v.useMemo(()=>U4($e,V),[$e,V]),Qt=(H==null?void 0:H.key)===dt?H.shareUrl:null,be=t.active?t.sessionId:null,Ve=v.useMemo(()=>{const U=new Set;for(const ae of Pe)ae.adoptedSource&&U.add(`${ae.adoptedSource.sessionId}:${ae.adoptedSource.variantId}`);return U},[Pe]),qe=v.useMemo(()=>[...ce.filter(ae=>ae.sessionId!==be&&!Ve.has(`${ae.sessionId}:${ae.variantId}`))].sort((ae,Te)=>{const pe=new Date(ae.createdAt).getTime(),me=new Date(Te.createdAt).getTime();return(Number.isNaN(me)?0:me)-(Number.isNaN(pe)?0:pe)}),[Ve,ce,be]),tt=v.useMemo(()=>O?Pe.find(U=>{var ae,Te;return((ae=U.adoptedSource)==null?void 0:ae.sessionId)===O.sessionId&&((Te=U.adoptedSource)==null?void 0:Te.variantId)===O.variantId})??null:null,[O,Pe]),_t=v.useMemo(()=>O?qe.find(U=>U.sessionId===O.sessionId&&U.variantId===O.variantId)??null:null,[O,qe]),nt=t.active?t.projectContext:null,Ye=(nt==null?void 0:nt.kind)==="fresh"?nt.workspacePath:n,on=!t.active&&qe.length>0&&qe.every(U=>U.projectKind==="fresh"),an=t.active?Wq(nt):!!n&&!on,On=v.useMemo(()=>Ye?`?projectPath=${encodeURIComponent(Ye)}`:"",[Ye]),po=v.useRef(null),Bn=v.useRef(null),is=typeof window>"u"?"/":gA(window.location.pathname)??"/",fr=v.useRef(null),er=v.useRef(!1),hr=v.useCallback((U,ae)=>{ae.button!==0&&ae.pointerType==="mouse"||(ae.preventDefault(),T1(),fr.current={kind:"live",variantId:U,startX:ae.clientX,startY:ae.clientY,committed:!1})},[]),Ll=v.useCallback((U,ae)=>{ae.button!==0&&ae.pointerType==="mouse"||(ae.preventDefault(),T1(),fr.current={kind:"past",entry:U,startX:ae.clientX,startY:ae.clientY,committed:!1})},[]);v.useEffect(()=>{const U=pe=>{const me=fr.current;if(!me)return;const Ee=pe.clientX-me.startX,Ge=pe.clientY-me.startY;if(!me.committed){if(Ee*Ee+Ge*Ge<V4*V4)return;if(T1(),me.kind==="live"){const Ce=Pe.find(us=>us.workItemId===me.variantId);if(!Ce||Ce.status!=="succeeded"){fr.current=null;return}const Dn=F4({sessionId:be,variant:Ce,projectContext:nt,routePath:is});S({sessionId:be??"",variantId:Ce.workItemId,label:Ce.label||"Direction",url:Dn,source:"live",runLabel:Ce.runLabel,description:Ce.description})}else{const{entry:Ce}=me,Dn=pu(Ce),us=Dn?Hq({sessionId:Ce.sessionId,variantId:Ce.variantId,routePath:is}):`/api/variants/history/${encodeURIComponent(Ce.sessionId)}/${encodeURIComponent(Ce.variantId)}/preview${On}`;if(S({sessionId:Ce.sessionId,variantId:Ce.variantId,label:Ce.label||"Direction",url:us,source:Dn?"history-dev-server":"history-static",runLabel:Ce.runLabel,description:Ce.brief}),Dn){const Rs=z4(`/api/variants/history/${encodeURIComponent(Ce.sessionId)}/${encodeURIComponent(Ce.variantId)}/run${On}`,"targetAddressed","1");(async()=>{try{if(!(await fetch(Rs,{method:"POST"})).ok)return;const mr=z4(us,"replay",String(Date.now()));S(hn=>!hn||hn.sessionId!==Ce.sessionId||hn.variantId!==Ce.variantId||hn.source!=="history-dev-server"?hn:{...hn,url:mr}),R(hn=>{if(!hn)return hn;const Si=rt=>!rt||rt.sessionId!==Ce.sessionId||rt.variantId!==Ce.variantId?rt:{...rt,url:mr};return{...hn,left:Si(hn.left),right:Si(hn.right)}})}catch(As){mn.warn("history replay drag boot failed",As)}})()}}me.committed=!0}P({x:pe.clientX,y:pe.clientY})},ae=()=>{const pe=fr.current;pe!=null&&pe.committed&&(er.current=!0),fr.current=null,P(null)},Te=pe=>{if(pe.key!=="Escape")return;const me=fr.current;me!=null&&me.committed&&(me.kind==="past"&&pu(me.entry)&&cf({sessionId:me.entry.sessionId,variantId:me.entry.variantId,source:"history-dev-server"}),fr.current=null,S(null),P(null))};return window.addEventListener("pointermove",U),window.addEventListener("pointerup",ae),window.addEventListener("pointercancel",ae),window.addEventListener("keydown",Te),()=>{window.removeEventListener("pointermove",U),window.removeEventListener("pointerup",ae),window.removeEventListener("pointercancel",ae),window.removeEventListener("keydown",Te)}},[Pe,be,nt,is,On,S,P,R]);const Jt=v.useMemo(()=>{var ae;if(ie||N)return null;const U=L?Pe.find(Te=>Te.workItemId===L):null;return L&&!U?null:U?Dd(U)?U.workItemId:null:t.active?((ae=Pe.find(Te=>{var pe,me;return Dd(Te)&&(((pe=Te.preview)==null?void 0:pe.kind)==="static_artifact"||((me=Te.preview)==null?void 0:me.kind)==="dev_server")}))==null?void 0:ae.workItemId)??null:null},[L,N,ie,t,Pe]),mo=ie||an&&L===null&&N===null&&Jt===null,go=v.useCallback(async U=>{var Te,pe,me,Ee;if(!be)return;const ae=(U==null?void 0:U.workItemId)??null;W({kind:"switch",variantId:ae??void 0});try{if(((Te=U==null?void 0:U.preview)==null?void 0:Te.kind)==="static_artifact"){if(_(!1),w(null),((pe=U.refinement)==null?void 0:pe.status)==="succeeded"){const Ce=U.preview.url.includes("?")?"&":"?";m(`${U.preview.url}${Ce}refinement=${encodeURIComponent(U.refinement.workItemId)}`)}else m(U.preview.url);p(Ce=>Ce+1);return}if(ae&&be&&t.active&&t.projectContext.kind==="fresh"&&((me=t.projectContext.executionPlan)==null?void 0:me.mode)!=="vite_app"&&((Ee=U==null?void 0:U.preview)==null?void 0:Ee.kind)!=="dev_server"){_(!1),w(null),m(`/api/variants/${be}/static/${ae}`),p(Ce=>Ce+1);return}const Ge=U&&ae?F4({sessionId:be,variant:U,projectContext:t.active?t.projectContext:null,routePath:is}):null;if(Ge){_(!1),w(null),m(Ge),p(Ce=>Ce+1);return}Se.capture("variants_panel.preview_display_failed",{sessionId:be,variantId:ae,previewKind:U?R1(U):"none",hasPreview:!!(U!=null&&U.preview),hasPort:typeof(U==null?void 0:U.port)=="number",errorMessage:"No addressable dev-server preview URL"}),_(!1),w(null)}catch(Ge){mn.warn("preview display failed",Ge),Se.capture("variants_panel.preview_display_failed",{sessionId:be,variantId:ae,previewKind:U?R1(U):"none",hasPreview:!!(U!=null&&U.preview),hasPort:typeof(U==null?void 0:U.port)=="number",errorMessage:Ge instanceof Error?Ge.message:String(Ge)}),_(!1),w(null)}finally{W(null)}},[be,t,is,p,m,_,w]),ks=v.useRef(!1),Ps=v.useRef(null),_n=v.useRef(0),os=v.useCallback(()=>{if(_n.current++,y(!1),x(!1),!ks.current)return;const U=Ps.current;ks.current=!1,Ps.current=null;const ae=U?new URLSearchParams({sessionId:U.sessionId,variantId:U.variantId}):null,Te=ae?`/api/variants/history/replay/stop?${ae.toString()}`:"/api/variants/history/replay/stop";fetch(Te,{method:"POST"}).catch(pe=>mn.warn("history replay stop failed",pe))},[y,x]),Ws=v.useCallback(async U=>{if(be){W({kind:"switch",variantId:U.workItemId});try{const ae=await fetch(`/api/variants/${be}/preview-port`,{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({variantId:U.workItemId})});if(!ae.ok){const Te=await Di(ae);throw new Error(Te.message??`Preview restoration failed (${ae.status})`)}}catch(ae){mn.warn("preview restoration failed",ae),Se.capture("variants_panel.preview_display_failed",{sessionId:be,variantId:U.workItemId,previewKind:"dev_server",hasPreview:!1,hasPort:!1,errorMessage:ae instanceof Error?ae.message:String(ae)})}finally{W(null)}}},[be]),fn=v.useCallback(U=>{var Ee,Ge,Ce,Dn,us;if(er.current){er.current=!1;return}const ae=Dd(U),Te=U.status==="pending"||U.status==="running"||Gq(U);os();const pe=R1(U),me=Pe.find(Rs=>Rs.workItemId===L);Se.capture("variants_panel.preview_requested",{sessionId:be,fromVariantId:me==null?void 0:me.workItemId,toVariantId:U.workItemId,variantStatus:U.status,isPreviewReady:ae,isArmed:Te,previewKind:pe,hasPreview:!!U.preview,hasPort:typeof U.port=="number",viewEnabled:((Ge=(Ee=U.actions)==null?void 0:Ee.view)==null?void 0:Ge.enabled)??null,previewUnavailableReason:((Ce=U.previewUnavailable)==null?void 0:Ce.reason)??null}),A(U.workItemId),D(null),ae?(Bn.current=U.workItemId,Ne(!1),M(!0),go(U)):(Bn.current=null,Ne(!1),m(null),_(!1),Te&&Se.capture("variants_panel.preview_armed",{sessionId:be,fromVariantId:me==null?void 0:me.workItemId,toVariantId:U.workItemId,variantStatus:U.status,previewKind:pe,hasPreview:!!U.preview,hasPort:typeof U.port=="number",viewEnabled:((us=(Dn=U.actions)==null?void 0:Dn.view)==null?void 0:us.enabled)??null}),vA(U)&&Ws(U)),Se.capture("variants_panel.preview_switched",{sessionId:be,fromVariantId:me==null?void 0:me.workItemId,toVariantId:U.workItemId,armed:Te})},[L,be,M,A,D,os,Ws,go,Pe,m,_]),as=t.active?`${t.sessionId}:${t.stage}`:"inactive",vo=v.useRef(!1);v.useEffect(()=>{if(r)return;let U=!1;return(async()=>{try{const ae=await fetch(`/api/variants/history${On}`,{credentials:"same-origin"});if(!ae.ok)return;const Te=await ae.json();if(U)return;const pe=(Te.variants??[]).filter(me=>{var Ee,Ge;return((Ee=me.preview)==null?void 0:Ee.kind)==="static"||((Ge=me.serve)==null?void 0:Ge.kind)==="static"||pu(me)});if(!vo.current&&!Be.current&&as==="inactive"&&pe.length>0&&pe.every(me=>me.projectKind==="fresh")){const me=[...pe].sort((Ee,Ge)=>new Date(Ge.createdAt).getTime()-new Date(Ee.createdAt).getTime()).find(Ee=>!pu(Ee));me&&(vo.current=!0,D({sessionId:me.sessionId,variantId:me.variantId,previewKind:"static"}),Ne(!1),m(`/api/variants/history/${encodeURIComponent(me.sessionId)}/${encodeURIComponent(me.variantId)}/preview${On}`))}if(Zq(le.current,pe))return;le.current=pe,we(pe)}catch(ae){mn.warn("Failed to load past variants",ae)}})(),()=>{U=!0}},[r,as,On]);const xi=v.useCallback(()=>{ks.current=!1,Ps.current=null,y(!1),x(!1),D(null),A(null),Ne(!0),_(!1),w(null),m(null),p(U=>U+1)},[A,y,x,p,m,w,D,_]),bi=v.useCallback(U=>{if(er.current){er.current=!1;return}if(M(!0),D({sessionId:U.sessionId,variantId:U.variantId,previewKind:pu(U)?"dev_server":"static"}),A(null),Ne(!1),pu(U)){const ae=++_n.current;ks.current=!0,Ps.current={sessionId:U.sessionId,variantId:U.variantId},y(!0),x(!0),(async()=>{W({kind:"switch"}),Se.capture("variants_panel.history_replay_started",{sessionId:U.sessionId,variantId:U.variantId});const Te=pe=>Se.capture("variants_panel.history_replay_failed",{sessionId:U.sessionId,variantId:U.variantId,...pe});try{const pe=await fetch(`/api/variants/history/${encodeURIComponent(U.sessionId)}/${encodeURIComponent(U.variantId)}/run${On}`,{method:"POST"});if(ae!==_n.current)return;if(!pe.ok){const{errorCode:me}=await Di(pe);mn.warn(`history replay failed: HTTP ${pe.status} ${me??""}`),Te({httpStatus:pe.status,errorCode:me}),xi();return}x(!1),_(!0),w(null),m(null),p(me=>me+1),Se.capture("variants_panel.history_replay_ready",{sessionId:U.sessionId,variantId:U.variantId})}catch(pe){if(ae!==_n.current)return;mn.warn("history replay failed",pe),Te({errorMessage:pe instanceof Error?pe.message:String(pe)}),xi()}finally{W(null)}})();return}os(),_(!1),w(null),m(`/api/variants/history/${encodeURIComponent(U.sessionId)}/${encodeURIComponent(U.variantId)}/preview${On}`)},[xi,W,y,x,p,D,A,m,w,M,_,os,On]),We=v.useCallback(async()=>{os();const U=()=>{M(!0),A(null),D(null),Ne(!0),Bn.current=null,_(!1),w(null),m(null),p(ae=>ae+1)};if(!be){U();return}W({kind:"switch"});try{const ae=await fetch(`/api/variants/${be}/preview-port`,{method:"POST",headers:{"content-type":"application/json"},body:JSON.stringify({variantId:null})});if(!ae.ok){mn.warn(`switch to original failed: HTTP ${ae.status}`);return}U(),_(!0),Se.capture("variants_panel.preview_switched",{sessionId:be,fromVariantId:L,toVariantId:null,target:"original",armed:!1})}catch(ae){mn.warn("preview-port original switch failed",ae)}finally{W(null)}},[L,be,A,D,p,m,w,M,_,os]),Wt=v.useCallback(async U=>{var Te,pe;const ae=((pe=(Te=U.actions)==null?void 0:Te.commit)==null?void 0:pe.enabled)??U.status==="succeeded";if(!(!be||!ae)){Se.capture("variants_panel.commit_clicked",{sessionId:be,variantId:U.workItemId,variantLabel:U.label}),W({kind:"commit",variantId:U.workItemId});try{const me=await fetch(`/api/variants/${be}/commit`,{method:"POST",headers:{"content-type":"application/json"},body:JSON.stringify({variantId:U.workItemId})});if(!me.ok){const{message:Ge,errorCode:Ce}=await Di(me);mn.warn(`commit failed: HTTP ${me.status} ${Ce??""} ${Ge??""}`),Se.capture("variants_panel.commit_failed",{sessionId:be,variantId:U.workItemId,httpStatus:me.status,errorCode:Ce??null,errorMessage:Ge??null}),gt.error("Couldn't send direction",{description:Ge??`The server rejected the request (HTTP ${me.status}). Try again, or pick a different direction.`});return}const Ee=await me.json().catch(()=>null);Se.capture("variants_panel.commit_succeeded",{sessionId:be,variantId:U.workItemId,payloadKind:(Ee==null?void 0:Ee.payloadKind)??null,duplicate:(Ee==null?void 0:Ee.duplicate)??!1}),gt.success(`Sent "${U.label}" to your project`,{description:(Ee==null?void 0:Ee.payloadKind)==="project-created"?`Project created at ${(Ee==null?void 0:Ee.destinationPath)??"destination"}.`:"Direction diff applied to your working tree (uncommitted)."}),(Ee==null?void 0:Ee.payloadKind)!=="project-created"&&(m(null),_(!1),p(Ge=>Ge+1))}catch(me){mn.warn("commit failed",me),Se.capture("variants_panel.commit_failed",{sessionId:be,variantId:U.workItemId,httpStatus:null,errorCode:"NETWORK_ERROR",errorMessage:me instanceof Error?me.message:String(me)}),gt.error("Couldn't send direction",{description:"Network or server error. Check that the Rivet backend is reachable and try again."})}finally{W(null)}}},[be,p,m,_]),Ot=v.useCallback(async(U,ae,Te)=>{Se.capture("variants_panel.deploy_clicked",{sessionId:U,variantId:ae,variantLabel:Te});try{const pe=await fetch(`/api/variants/${U}/deploy`,{method:"POST",headers:{"content-type":"application/json"},body:JSON.stringify({variantId:ae,...n?{projectPath:n}:{}})});if(!pe.ok){const{message:Ge,errorCode:Ce}=await Di(pe);return mn.warn(`deploy failed: HTTP ${pe.status} ${Ce??""} ${Ge??""}`),Se.capture("variants_panel.deploy_failed",{sessionId:U,variantId:ae,httpStatus:pe.status,errorCode:Ce??null,errorMessage:Ge??null}),gt.error("Couldn't deploy this direction",{description:Ge??`The server rejected the request (HTTP ${pe.status}). Try again.`}),null}const me=await pe.json().catch(()=>null),Ee=me==null?void 0:me.shareUrl;return Ee?(await navigator.clipboard.writeText(Ee).catch(()=>{}),Se.capture("variants_panel.deploy_succeeded",{sessionId:U,variantId:ae}),gt.success(`"${Te}" is live — link copied`,{action:{label:"Open",onClick:()=>window.open(Ee,"_blank","noopener")}}),Ee):(gt.error("Couldn't deploy this direction",{description:"The deploy host returned an unexpected response."}),null)}catch(pe){return mn.warn("deploy failed",pe),Se.capture("variants_panel.deploy_failed",{sessionId:U,variantId:ae,httpStatus:null,errorCode:"NETWORK_ERROR",errorMessage:pe instanceof Error?pe.message:String(pe)}),gt.error("Couldn't deploy this direction",{description:"Network or server error. Check that the Rivet backend is reachable and try again."}),null}},[n]),wn=v.useCallback(async U=>{if(!be)return;const ae=V[U.workItemId];if(ae){await navigator.clipboard.writeText(ae).catch(()=>{}),gt.success("Share link copied",{action:{label:"Open",onClick:()=>window.open(ae,"_blank","noopener")}});return}W({kind:"deploy",variantId:U.workItemId});try{const Te=await Ot(be,U.workItemId,U.label);Te&&J(pe=>({...pe,[U.workItemId]:Te}))}finally{W(null)}},[be,V,Ot]),Nr=v.useCallback(async()=>{if(!(!be||$e.length===0)){if(Qt){await navigator.clipboard.writeText(Qt).catch(()=>{}),gt.success("Canvas link copied",{action:{label:"Open",onClick:()=>window.open(Qt,"_blank","noopener")}});return}Se.capture("variants_panel.deploy_clicked",{sessionId:be,variantId:"canvas",variantLabel:"Canvas",variantCount:$e.length}),W({kind:"deploy-canvas"});try{const U=await fetch(`/api/variants/${be}/canvas/deploy`,{method:"POST",headers:{"content-type":"application/json"},body:JSON.stringify({variantIds:$e.map(Ee=>Ee.workItemId),...n?{projectPath:n}:{}})});if(!U.ok){const{message:Ee,errorCode:Ge}=await Di(U);mn.warn(`canvas deploy failed: HTTP ${U.status} ${Ge??""} ${Ee??""}`),Se.capture("variants_panel.deploy_failed",{sessionId:be,variantId:"canvas",httpStatus:U.status,errorCode:Ge??null,errorMessage:Ee??null,variantCount:$e.length}),gt.error("Couldn't share this canvas",{description:Ee??`The server rejected the request (HTTP ${U.status}). Try again.`});return}const ae=await U.json().catch(()=>null),Te=ae==null?void 0:ae.shareUrl;if(!Te){gt.error("Couldn't share this canvas",{description:"The deploy host returned an unexpected response."});return}const pe=Object.fromEntries(((ae==null?void 0:ae.variants)??[]).filter(Ee=>typeof Ee.variantId=="string"&&typeof Ee.shareUrl=="string").map(Ee=>[Ee.variantId,Ee.shareUrl])),me=Object.keys(pe).length>0?{...V,...pe}:V;me!==V&&J(me),await navigator.clipboard.writeText(Te).catch(()=>{}),F({key:U4($e,me),shareUrl:Te}),Se.capture("variants_panel.deploy_succeeded",{sessionId:be,variantId:"canvas",variantCount:$e.length}),gt.success("Canvas is live — link copied",{action:{label:"Open",onClick:()=>window.open(Te,"_blank","noopener")}})}catch(U){mn.warn("canvas deploy failed",U),Se.capture("variants_panel.deploy_failed",{sessionId:be,variantId:"canvas",httpStatus:null,errorCode:"NETWORK_ERROR",errorMessage:U instanceof Error?U.message:String(U),variantCount:$e.length}),gt.error("Couldn't share this canvas",{description:"Network or server error. Check that the Rivet backend is reachable and try again."})}finally{W(null)}}},[Qt,$e,V,n,be]),qt=v.useCallback(async U=>{const ae=`${U.sessionId}:${U.variantId}`,Te=X[ae];if(Te){await navigator.clipboard.writeText(Te).catch(()=>{}),gt.success("Share link copied",{action:{label:"Open",onClick:()=>window.open(Te,"_blank","noopener")}});return}ee(ae);try{const pe=await Ot(U.sessionId,U.variantId,U.label);pe&&oe(me=>({...me,[ae]:pe}))}finally{ee(null)}},[X,Ot]),ln=v.useCallback(async U=>{if(be){Se.capture("variants_panel.remove_clicked",{sessionId:be,variantId:U.workItemId,variantLabelLength:U.label.length}),W({kind:"remove",variantId:U.workItemId});try{const ae=await fetch(`/api/variants/${be}/${U.workItemId}/remove`,{method:"POST",headers:{"content-type":"application/json"},body:"{}"});if(!ae.ok){const{message:Te}=await Di(ae);mn.warn(`remove failed: HTTP ${ae.status} ${Te??""}`),gt.error("Couldn't remove direction",{description:Te??`The server rejected the request (HTTP ${ae.status}). Try again.`});return}(U.workItemId===Jt||U.workItemId===L)&&(A(null),m(null),_(!1),p(Te=>Te+1))}catch(ae){mn.warn("remove failed",ae),gt.error("Couldn't remove direction",{description:"Network or server error. Try again."})}finally{W(null)}}},[be,L,Jt,A,m,_,p]),tr=v.useCallback(async U=>{if(!Ye){gt.error("Couldn't remove direction",{description:"No project path available."});return}Se.capture("variants_panel.remove_past_clicked",{sessionId:U.sessionId,variantId:U.variantId});const ae=`${U.sessionId}:${U.variantId}`,Te=pe=>pe.sessionId===U.sessionId&&pe.variantId===U.variantId;W({kind:"remove",variantId:ae}),we(pe=>pe.filter(me=>!Te(me))),N===ae&&(D(null),m(null),_(!1),p(pe=>pe+1));try{const pe=await fetch(`/api/variants/history/${encodeURIComponent(U.sessionId)}/${encodeURIComponent(U.variantId)}/remove`,{method:"POST",headers:{"content-type":"application/json"},body:JSON.stringify({projectPath:Ye})});if(!pe.ok){const{message:me}=await Di(pe);we(Ee=>Ee.some(Te)?Ee:[...Ee,U]),gt.error("Couldn't remove direction",{description:me??`The server rejected the request (HTTP ${pe.status}). Try again.`})}}catch(pe){mn.warn("remove past failed",pe),we(me=>me.some(Te)?me:[...me,U]),gt.error("Couldn't remove direction",{description:"Network or server error. Try again."})}finally{W(null)}},[Ye,N,D,m,_,p]),ls=v.useCallback(U=>{Z(U)},[]),Ln=v.useCallback(async()=>{if(q)try{q.kind==="active"?await ln(q.variant):await tr(q.entry)}finally{Z(null)}},[q,ln,tr]),qs=Bq(q),_c=(Y==null?void 0:Y.kind)==="remove"&&Y.variantId===qs,[Ff,F0]=v.useState(null),[$0,Ts]=v.useState(null),$f=v.useCallback(U=>{Ts(U)},[]),Vf=v.useCallback(()=>{Ts(null)},[]),V0=v.useCallback(async U=>{const ae=U.trim();if(ae)try{await navigator.clipboard.writeText(ae),gt.success("Copied")}catch{gt.error("Couldn't copy")}},[]),Hf=v.useCallback(async(U,ae)=>{Ts(null);const Te=ae.trim();if(!Te||U.kind==="original")return;if(U.kind==="active"){if(!be||Te===U.variant.label)return;Se.capture("variants_panel.rename",{sessionId:be,variantId:U.variant.workItemId,labelLength:Te.length,past:!1});try{const Ee=await fetch(`/api/variants/${be}/${U.variant.workItemId}/rename`,{method:"POST",headers:{"content-type":"application/json"},body:JSON.stringify({label:Te})});if(!Ee.ok){const{message:Ge}=await Di(Ee);gt.error("Couldn't rename direction",{description:Ge??`The server rejected the request (HTTP ${Ee.status}). Try again.`})}}catch(Ee){mn.warn("rename failed",Ee),gt.error("Couldn't rename direction",{description:"Network or server error. Try again."})}return}const{entry:pe}=U;if(Te===pe.label.trim())return;if(!Ye){gt.error("Couldn't rename direction",{description:"No project path available."});return}Se.capture("variants_panel.rename",{sessionId:pe.sessionId,variantId:pe.variantId,labelLength:Te.length,past:!0});const me=Ee=>Ee.sessionId===pe.sessionId&&Ee.variantId===pe.variantId;we(Ee=>Ee.map(Ge=>me(Ge)?{...Ge,label:Te}:Ge));try{const Ee=await fetch(`/api/variants/history/${encodeURIComponent(pe.sessionId)}/${encodeURIComponent(pe.variantId)}/rename`,{method:"POST",headers:{"content-type":"application/json"},body:JSON.stringify({label:Te,projectPath:Ye})});if(!Ee.ok){const{message:Ge}=await Di(Ee);we(Ce=>Ce.map(Dn=>me(Dn)?{...Dn,label:pe.label}:Dn)),gt.error("Couldn't rename direction",{description:Ge??`The server rejected the request (HTTP ${Ee.status}). Try again.`})}}catch(Ee){mn.warn("rename failed",Ee),we(Ge=>Ge.map(Ce=>me(Ce)?{...Ce,label:pe.label}:Ce)),gt.error("Couldn't rename direction",{description:"Network or server error. Try again."})}},[be,Ye]);v.useEffect(()=>{if(po.current!==be){const ae=po.current===null;if(po.current=be,Bn.current=null,F(null),m(null),_(!1),w(null),M(),A(null),D(null),Ne(!1),vo.current=!1,!ae)return}if(N||ie||!Jt||t.active!==!0||Bn.current===Jt)return;const U=Pe.find(ae=>ae.workItemId===Jt);U&&(Bn.current=Jt,M(),go(U))},[be,N,ie,Jt,t,Pe,go,M,A,D,m,w,_]),v.useEffect(()=>{!O||!tt||(Bn.current=null,D(null),A(tt.workItemId),Ne(!1))},[tt,O,be,A,D]),v.useEffect(()=>{!O||tt||_t||D(null)},[tt,O,_t,be,D,qe]),v.useEffect(()=>{const U=j.trim().toLowerCase(),ae=Pe.filter(Ce=>Mu(U,Ce.label,Ce.runLabel)),Te=qe.filter(Ce=>Mu(U,Ce.label,Ce.runLabel,Ce.brief)),pe=an&&Mu(U,Xw,Qw);if(ae.length===0&&Te.length===0&&!pe)return;const me=[...ae.map(Ce=>({source:"live",variant:Ce})),...Te.map(Ce=>({source:"past",entry:Ce})),...pe?[{source:"original"}]:[]],Ee=Ce=>Ce.source==="live"?`live:${Ce.variant.workItemId}`:Ce.source==="past"?`past:${Ce.entry.sessionId}:${Ce.entry.variantId}`:q_,Ge=Ce=>{if(jB())return;if(Ce.key==="Enter"){const rt=Pe.find(Wf=>Wf.workItemId===Ff);rt&&(Ce.preventDefault(),fn(rt));return}if(Ce.key!=="ArrowUp"&&Ce.key!=="ArrowDown")return;Ce.preventDefault();const Dn=L??Jt;let Rs=Dn?`live:${Dn}`:null;N?Rs=`past:${N}`:mo&&(Rs=q_);const As=Rs?me.findIndex(rt=>Ee(rt)===Rs):-1;let mr;if(As===-1?mr=Ce.key==="ArrowDown"?0:me.length-1:Ce.key==="ArrowDown"?mr=Math.min(As+1,me.length-1):mr=Math.max(As-1,0),mr===As)return;const hn=me[mr];hn.source==="live"?fn(hn.variant):hn.source==="past"?bi(hn.entry):We();const Si=document.querySelector(`[data-variant-key="${Ee(hn)}"]`);Si instanceof HTMLElement&&Si.focus({preventScroll:!0})};return window.addEventListener("keydown",Ge),()=>window.removeEventListener("keydown",Ge)},[Pe,qe,j,an,L,N,mo,Jt,Ff,fn,bi,We]);const Dl=Pe.find(U=>U.workItemId===Jt)??null,Nl=N?qe.find(U=>`${U.sessionId}:${U.variantId}`===N)??null:null,wc=!!Nl,H0=t.active?t.artifacts??[]:[],wt=[...(t.active?Pe:[]).map(U=>({kind:"active",variant:U})),...qe.map(U=>({kind:"past",entry:U})),...an?[{kind:"original"}]:[]],zf=j.trim().toLowerCase(),Sa=zf?wt.filter(U=>eG(U,zf)):wt,Uf=new Set(Pe.map(U=>U.requestId).filter(Boolean)),Ea=e.filter(U=>!Uf.has(U.requestId)),jl=Ea.length>0,Fl=r&&!jl&&wt.length===0;return E.jsxs("div",{className:"flex h-full min-h-0 flex-col",children:[wt.length>0?E.jsx("div",{className:"px-3 pt-2 pb-1",children:E.jsxs("div",{className:"relative",children:[E.jsx(mU,{size:13,className:"text-content-muted pointer-events-none absolute top-1/2 left-2 -translate-y-1/2"}),E.jsx("input",{type:"text",value:j,onChange:U=>G(U.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,E.jsxs("div",{className:"flex-1 overflow-y-auto px-3 py-2",children:[jl?E.jsx(pG,{groups:Ea}):null,Fl?E.jsx(mG,{}):null,t.active&&wt.length===0&&!jl&&!Fl?E.jsx(gG,{}):null,!t.active&&!jl&&!Fl&&qe.length===0&&!an?E.jsx(vG,{isMCPSession:d,mcpEditor:h}):null,wt.length>0&&Sa.length===0?E.jsxs("p",{className:"text-content-muted px-1 py-6 text-center text-xs",children:["No directions match “",j.trim(),"”."]}):null,Sa.length>0?E.jsx(sG,{rows:Sa,activeVariantId:L??Jt,activePastKey:N,isOriginalSelected:mo,busy:Y,editingKey:$0,onSelectActive:fn,onSelectPast:bi,onSelectOriginal:We,onActivePointerDown:hr,onPastPointerDown:Ll,onHover:F0,onRemove:U=>ls({kind:"active",variant:U}),onRemovePast:U=>ls({kind:"past",entry:U}),onStartRename:$f,onCommitRename:Hf,onCancelRename:Vf,onCopyVariantContext:V0,activeSessionId:t.active?t.sessionId:null,projectPath:Ye}):null,t.active&&c?E.jsx(cG,{artifacts:H0}):null]}),wc&&Nl?E.jsx(aG,{entry:Nl,deploying:se===N,deployedUrl:N?X[N]??null:null,onDeploy:qt,isDeployDisabled:!i}):null,!wc&&t.active?E.jsx(hG,{selectedVariant:Dl,busy:Y,onSend:Wt,onDeploy:wn,onDeployCanvas:Nr,canDeploy:i&&(nt==null?void 0:nt.kind)==="fresh",canDeployCanvas:i&&a&&(nt==null?void 0:nt.kind)==="fresh",canSendToAgent:u,canvasVariantCount:$e.length,canvasDeployedUrl:Qt,deployedUrl:Dl?V[Dl.workItemId]??null:null}):null,E.jsx(Qq,{target:q,isConfirming:_c,onCancel:()=>Z(null),onConfirm:Ln})]})},Xq=t=>t.kind==="active"?t.variant.label.trim()||"this direction":t.entry.label.trim()||"this direction",Qq=({target:t,isConfirming:e,onCancel:n,onConfirm:r})=>{if(!t)return null;const s=Xq(t);return E.jsx(kw,{open:!0,onOpenChange:i=>{!i&&!e&&n()},children:E.jsxs(Pw,{children:[E.jsx(Tw,{className:"z-max fixed inset-0 bg-black/40"}),E.jsx(Rw,{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:E.jsxs("div",{className:"flex flex-col gap-3 p-4",children:[E.jsx(Aw,{className:"text-content text-base font-medium",children:"Remove direction?"}),E.jsxs(Iw,{className:"text-content-subtle text-sm leading-5",children:['This removes "',s,'" from the directions list.']}),E.jsxs("div",{className:"flex justify-end gap-2 pt-1",children:[E.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"}),E.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...":"Remove direction"})]})]})})]})})},Jq=t=>t.kind==="active"?`live:${t.variant.workItemId}`:t.kind==="past"?`past:${t.entry.sessionId}:${t.entry.variantId}`:q_,eG=(t,e)=>t.kind==="active"?Mu(e,t.variant.label,t.variant.runLabel):t.kind==="past"?Mu(e,t.entry.label,t.entry.runLabel,t.entry.brief):Mu(e,Xw,Qw),tG=t=>t.length<=H4?t:`${t.slice(0,H4-1)}…`,nG=(t,e)=>t.kind==="active"?e?`${e}:${t.variant.workItemId}`:null:t.kind==="past"?`${t.entry.sessionId}:${t.entry.variantId}`:null,rG=t=>{var i,a;const e=[t.label.trim(),(i=t.description)==null?void 0:i.trim()].filter(u=>!!u).join(`
112
- `);if(!t.reference)return e;const n=((a=t.projectPath)==null?void 0:a.trim())??"",r=n?` --project '${n.replace(/'/g,"'\\''")}'`:"",s=[`Rivet variant: ${t.reference}`,"To inspect the full variant context, run:",`rivet variants get ${t.reference}${r}`].join(`
113
- `);return e?`${e}
114
-
115
- ${s}`:s},sG=({rows:t,activeVariantId:e,activePastKey:n,isOriginalSelected:r,busy:s,editingKey:i,onSelectActive:a,onSelectPast:u,onSelectOriginal:c,onActivePointerDown:d,onPastPointerDown:h,onHover:p,onRemove:m,onRemovePast:_,onStartRename:w,onCommitRename:y,onCancelRename:x,onCopyVariantContext:S,activeSessionId:P,projectPath:T})=>{const k=v.useRef(null),{activeIndex:R,itemRects:M,sessionRef:L,handlers:A,registerItem:O}=h5(k),D=R!==null?M[R]:null;return E.jsxs("div",{ref:k,className:"relative",onMouseEnter:A.onMouseEnter,onMouseMove:A.onMouseMove,onMouseLeave:A.onMouseLeave,children:[E.jsx(no,{children:D&&E.jsx(Sl.div,{className:"bg-hover pointer-events-none absolute z-0 rounded-md",initial:{opacity:0,top:D.top,left:D.left,width:D.width,height:D.height},animate:{opacity:1,top:D.top,left:D.left,width:D.width,height:D.height},exit:{opacity:0,transition:{duration:.06}},transition:{...ef.fast,opacity:{duration:.08}}},L.current)}),E.jsx("ul",{className:"relative",children:t.map((N,j)=>{const G=Jq(N);let Y=!1;return N.kind==="active"?Y=N.variant.workItemId===e:N.kind==="past"?Y=`${N.entry.sessionId}:${N.entry.variantId}`===n:Y=r,E.jsx(iG,{rowKey:G,row:N,index:j,isSelected:Y,isEditing:i===G,busy:s,registerItem:O,onSelectActive:a,onSelectPast:u,onSelectOriginal:c,onActivePointerDown:d,onPastPointerDown:h,onHover:p,onRemove:m,onRemovePast:_,onStartRename:w,onCommitRename:y,onCancelRename:x,onCopyVariantContext:S,activeSessionId:P,projectPath:T},G)})})]})},iG=({rowKey:t,row:e,index:n,isSelected:r,isEditing:s,busy:i,registerItem:a,onSelectActive:u,onSelectPast:c,onSelectOriginal:d,onActivePointerDown:h,onPastPointerDown:p,onHover:m,onRemove:_,onRemovePast:w,onStartRename:y,onCommitRename:x,onCancelRename:S,onCopyVariantContext:P,activeSessionId:T,projectPath:k})=>{var oe,se;const R=v.useRef(null);fB(a,n,R);const M=e.kind==="active",L=e.kind==="original",A=e.kind==="active"?e.variant:null,O=e.kind==="past"?e.entry:null,D=M?A.status==="succeeded":!0,N=M?Dd(A):!0,j=M&&(A.status==="pending"||A.status==="running"),G=M&&A.status==="failed",Y=M&&A.status==="cancelled",W=M&&(i==null?void 0:i.kind)==="remove"&&i.variantId===A.workItemId,q=M&&(((oe=A.refinement)==null?void 0:oe.status)==="pending"||((se=A.refinement)==null?void 0:se.status)==="running");let Z=Xw;M?Z=A.label||`Direction ${n+1}`:O&&(Z=O.label.trim()||"Untitled direction");let V;M?V=A.runLabel:O&&(V=O.runLabel);let J=Qw;M?J=A.description:O&&(J=O.brief);const H=J?tG(J):null,F=nG(e,T),X=F?"Copy variant reference":"Copy description";return s?E.jsx("li",{ref:R,"data-proximity-index":n,className:"group relative z-10",children:E.jsx("div",{className:"bg-main-input flex w-full items-start gap-2 rounded-md px-3 py-2",children:E.jsxs("span",{className:"min-w-0 flex-1",children:[E.jsx(oG,{initial:Z,onCommit:ee=>x(e,ee),onCancel:S}),H&&E.jsx("span",{className:"text-content-muted mt-1 line-clamp-2 block text-xs leading-snug",children:H})]})})}):E.jsxs("li",{ref:R,"data-proximity-index":n,className:"group relative z-10",children:[E.jsx("div",{role:"button",tabIndex:0,"data-variant-id":M?A.workItemId:void 0,"data-variant-key":t,onClick:()=>{const ee=window.getSelection();ee&&!ee.isCollapsed||(e.kind==="active"?u(e.variant):e.kind==="past"?c(e.entry):d())},onKeyDown:ee=>{(ee.key==="Enter"||ee.key===" ")&&(ee.preventDefault(),ee.stopPropagation(),e.kind==="active"?u(e.variant):e.kind==="past"?c(e.entry):d())},onPointerDown:ee=>{e.kind==="active"?N&&h(e.variant.workItemId,ee):e.kind==="past"&&p(e.entry,ee)},"aria-pressed":r,"aria-disabled":M?!1:void 0,"aria-busy":j||q,onMouseEnter:M?()=>m(A.workItemId):void 0,onMouseLeave:M?()=>m(null):void 0,className:dr("focus-visible:ring-content-muted/40 flex w-full items-start gap-2 rounded-md px-3 py-2 text-left transition-colors focus:outline-none focus-visible:ring-1",r&&"bg-main-input ring-content-muted/40 ring-1 ring-inset",N&&"cursor-grab active:cursor-grabbing",!N&&"cursor-pointer"),style:N?{touchAction:"none"}:void 0,children:E.jsxs("span",{className:"min-w-0 flex-1",children:[E.jsxs("span",{className:"flex items-center gap-2",children:[(j||q)&&E.jsx(Nw,{className:"text-content-muted shrink-0 text-sm","data-testid":q&&!j?"variant-refining":void 0}),E.jsx(Ji,{label:"Double-click to rename",disabled:L,children:E.jsx("span",{onDoubleClick:ee=>{ee.stopPropagation(),L||y(t)},className:dr("min-w-0 flex-1 truncate text-sm font-medium select-text",L?"cursor-default":"cursor-text",D||r?"text-content":"text-content-muted"),children:Z})}),G&&E.jsx(Ji,{label:A.errorMessage??A.errorCode??"Failed",disabled:!A.errorMessage&&!A.errorCode,children:E.jsx("span",{className:"shrink-0",children:E.jsx(B4,{label:"Failed"})})}),Y&&E.jsx(B4,{label:"Cancelled"}),V&&E.jsx("span",{className:"ml-auto max-w-[8rem] shrink-0 truncate rounded px-1.5 py-0.5 text-[10px] font-medium opacity-100 transition-opacity duration-150 group-hover:opacity-0 group-has-[:focus-visible]:opacity-0",style:f5(V),children:V})]}),H&&E.jsx("span",{className:"text-content-muted mt-0.5 line-clamp-2 block cursor-text text-xs leading-snug select-text",children:H})]})}),E.jsxs("div",{className:dr("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"),children:[J||F?E.jsx(Ji,{label:X,children:E.jsx("button",{type:"button","aria-label":X,onClick:ee=>{ee.stopPropagation(),P(rG({label:Z,description:J,reference:F,projectPath:k}))},onPointerDown:ee=>ee.stopPropagation(),className:"text-content-muted hover:bg-main-hover hover:text-content focus-visible:ring-content-muted/40 flex h-6 w-6 items-center justify-center rounded focus:outline-none focus-visible:ring-1",children:E.jsx(Jd,{size:13,weight:"bold"})})}):null,!L&&E.jsx(Ji,{label:"Rename",children:E.jsx("button",{type:"button","aria-label":"Rename direction",onClick:ee=>{ee.stopPropagation(),y(t)},onPointerDown:ee=>ee.stopPropagation(),className:"text-content-muted hover:bg-main-hover hover:text-content focus-visible:ring-content-muted/40 flex h-6 w-6 items-center justify-center rounded focus:outline-none focus-visible:ring-1",children:E.jsx(gU,{size:13,weight:"bold"})})}),!L&&E.jsx(Ji,{label:"Remove",children:E.jsx("button",{type:"button","data-variant-remove-id":e.kind==="active"?e.variant.workItemId:void 0,"aria-label":"Remove direction",disabled:W,onClick:ee=>{ee.stopPropagation(),e.kind==="active"?_(e.variant):w(e.entry)},onPointerDown:ee=>ee.stopPropagation(),className:"text-content-muted hover:bg-main-hover hover:text-content focus-visible:ring-content-muted/40 ml-1 flex h-6 w-6 items-center justify-center rounded focus:outline-none focus-visible:ring-1 disabled:cursor-not-allowed disabled:opacity-50",children:E.jsx(_U,{size:13,weight:"bold"})})})]})]})},oG=({initial:t,onCommit:e,onCancel:n})=>{const[r,s]=v.useState(t),i=v.useRef(!1),a=v.useCallback(c=>{c&&(c.focus(),c.select())},[]),u=c=>{i.current||(i.current=!0,c?e(r):n())};return E.jsx("input",{ref:a,type:"text",value:r,maxLength:120,"aria-label":"Rename direction",onChange:c=>s(c.target.value),onKeyDown:c=>{c.stopPropagation(),c.key==="Enter"?(c.preventDefault(),u(!0)):c.key==="Escape"&&(c.preventDefault(),u(!1))},onBlur:()=>u(!0),onClick:c=>c.stopPropagation(),onPointerDown:c=>c.stopPropagation(),className:"border-content-muted/40 bg-main text-content focus:ring-content-muted/50 w-full rounded border px-1.5 py-0.5 text-sm font-medium focus:ring-1 focus:outline-none"})},B4=({label:t})=>E.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}),aG=({entry:t,deploying:e,deployedUrl:n,onDeploy:r,isDeployDisabled:s=!1})=>{const a=e?"Deploying…":n?"Copy link":"Share";return E.jsxs("div",{className:"border-main-border bg-main-light flex shrink-0 items-center justify-between gap-3 border-t px-3 pt-2 pb-4",children:[E.jsxs("div",{className:"min-w-0",children:[E.jsx("div",{className:"text-content truncate text-sm font-medium",children:t.label.trim()||"Untitled direction"}),n?E.jsx("div",{className:"text-content-muted text-[11px]",children:"Deployed — share link ready"}):null]}),E.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?E.jsx(Jd,{size:12,weight:"bold"}):null,a]})]})},lG={agent_browser:"Browser extracted",cache:"Cached",static:"Bundled catalog",manual:"Manual"},uG={design_context:"DESIGN.md",source_context:"Source",qa_report:"QA",asset:"Asset"},cG=({artifacts:t})=>{const[e,n]=v.useState(null),r=v.useMemo(()=>e&&t.some(i=>i.id===e)?e:null,[t,e]);if(t.length===0)return null;const s=i=>{n(a=>a===i?null:i)};return E.jsxs("section",{"aria-label":"Directions session artifacts",className:"mt-4",children:[E.jsx("div",{className:"flex shrink-0 items-center px-3 py-2",children:E.jsx("span",{className:"text-content truncate text-sm font-medium",children:"Artifacts"})}),E.jsx("ul",{className:"mt-2 space-y-1 px-1",children:t.map(i=>E.jsx(dG,{artifact:i,isExpanded:i.id===r,onToggle:()=>s(i.id)},i.id))})]})},dG=({artifact:t,isExpanded:e,onToggle:n})=>{const r=uG[t.kind],s=t.source?lG[t.source]:null,i=[t.kind==="design_context"?null:s,t.summary].filter(Boolean).join(" · "),a=t.kind==="design_context"&&!!t.viewUrl,u=`${e?"Hide":"View"} ${r} artifact${t.label?`: ${t.label}`:""}`;return a?E.jsx("li",{className:"border-main-border rounded-md border",children:E.jsxs("div",{className:"flex w-full items-center justify-between gap-2 px-3 py-2 text-left text-xs",children:[E.jsxs("span",{className:"flex min-w-0 flex-1 flex-col",children:[E.jsxs("span",{className:"flex items-center gap-2",children:[E.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}),E.jsx("span",{className:"text-content truncate text-xs font-medium",children:t.label})]}),i?E.jsx("span",{className:"text-content-muted mt-0.5 truncate text-[11px]",children:i}):null]}),E.jsx("a",{href:t.viewUrl,target:"_blank",rel:"noreferrer",onClick:()=>{Se.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:E.jsx(dU,{className:"h-3.5 w-3.5",weight:"bold"})})]})}):E.jsxs("li",{className:"border-main-border rounded-md border",children:[E.jsxs("button",{type:"button",onClick:n,"aria-expanded":e,"aria-label":u,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:[E.jsxs("span",{className:"flex min-w-0 flex-1 flex-col",children:[E.jsxs("span",{className:"flex items-center gap-2",children:[E.jsx("span",{className:"text-content-muted text-[10px] font-semibold tracking-wide uppercase",children:r}),E.jsx("span",{className:"text-content truncate text-xs font-medium",children:t.label})]}),i?E.jsx("span",{className:"text-content-muted mt-0.5 truncate text-[11px]",children:i}):null]}),E.jsx("span",{className:"text-content-muted shrink-0 text-[11px]",children:e?"Hide":"View"})]}),e?E.jsx("div",{className:"border-main-border bg-main-light border-t px-3 py-2",children:E.jsx(fG,{artifact:t})}):null]})},fG=({artifact:t})=>E.jsxs("div",{className:"text-content-muted space-y-1 text-[11px]",children:[t.summary?E.jsx("p",{children:t.summary}):null,t.path?E.jsxs("p",{children:["Stored at ",t.path]}):null,!t.summary&&!t.path?E.jsx("p",{children:"No inline content available for this artifact."}):null]}),hG=({selectedVariant:t,busy:e,onSend:n,onDeploy:r,onDeployCanvas:s,canDeploy:i,canDeployCanvas:a,canSendToAgent:u,canvasVariantCount:c,canvasDeployedUrl:d,deployedUrl:h})=>{var L,A,O,D;const p=t?((A=(L=t.actions)==null?void 0:L.commit)==null?void 0:A.enabled)??t.status==="succeeded":!1,m=p&&e===null,_=(e==null?void 0:e.kind)==="commit"&&e.variantId===(t==null?void 0:t.workItemId),w=(e==null?void 0:e.kind)==="deploy"&&e.variantId===(t==null?void 0:t.workItemId),y=(e==null?void 0:e.kind)==="deploy-canvas",x=!i||!p||e!==null,S=a&&c>0,T=w?"Deploying…":h?"Copy link":"Share",R=y?"Sharing…":d?"Copy canvas link":"Share canvas",M=_?"Applying…":"Apply to project";return E.jsxs("div",{className:"border-main-border bg-main-light flex shrink-0 items-center justify-between gap-3 border-t px-3 pt-2 pb-4",children:[E.jsx("div",{className:"min-w-0",children:t?E.jsxs(E.Fragment,{children:[E.jsx("div",{className:"text-content truncate text-sm font-medium",children:t.label.trim()||"Untitled direction"}),h?E.jsx("div",{className:"text-content-muted text-[11px]",children:"Deployed — share link ready"}):null]}):null}),E.jsxs("div",{className:"flex shrink-0 items-center gap-2",children:[E.jsx(nA,{primaryLabel:T,primaryIcon:h&&!w?Jd:void 0,primaryAction:()=>{t&&r(t)},isDisabled:x,isDropdownDisabled:e!==null,isLoading:w,loadingLabel:"Deploying…",dropdownAriaLabel:"More share actions",dropdownItems:S?[{label:R,icon:d&&!y?Jd:void 0,onClick:s,isDisabled:e!==null}]:[]}),u?E.jsx("button",{type:"button",onClick:()=>{t&&n(t)},disabled:!m,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:M}):null]})]})},yA=()=>E.jsx("div",{"data-testid":"direction-skeleton-row","aria-hidden":"true",className:"flex w-full items-start rounded-md px-3 py-2",children:E.jsxs("span",{className:"min-w-0 flex-1",children:[E.jsxs("span",{className:"flex items-center gap-2",children:[E.jsx(Nw,{className:"text-content-muted shrink-0 text-sm"}),E.jsx("span",{className:"bg-muted-foreground/15 h-3.5 w-28 animate-pulse rounded"})]}),E.jsx("span",{className:"mt-1.5 flex",children:E.jsx("span",{className:"bg-muted-foreground/10 h-2.5 w-full max-w-[14rem] animate-pulse rounded"})})]})}),pG=({groups:t})=>E.jsx("div",{className:"space-y-0.5",children:t.flatMap(e=>Array.from({length:Math.max(1,e.count)}).map((n,r)=>E.jsx(yA,{},`${e.requestId}-${r}`)))}),mG=()=>E.jsx("div",{"data-testid":"direction-boot-skeletons",className:"space-y-0.5",children:Array.from({length:3}).map((t,e)=>E.jsx(yA,{},e))}),gG=()=>E.jsxs("div",{className:"flex flex-col items-center gap-2 px-4 py-8 text-center",children:[E.jsx("div",{className:"text-content text-sm",children:"No directions yet"}),E.jsx("div",{className:"text-content-muted text-xs",children:"They’ll appear here as they generate."})]}),W4="Try different ways to create a dropdown that feels fluid and dynamic",vG=({isMCPSession:t=!1,mcpEditor:e=null})=>{const[n,r]=v.useState(!1),s=FB(e),i=t?s:"your coding agent",a=()=>{navigator.clipboard.writeText(W4).then(()=>{r(!0),setTimeout(()=>r(!1),2e3)})};return E.jsxs("div",{className:"flex flex-col items-start gap-3 px-2 py-2",children:[E.jsx("p",{className:"text-content text-sm font-medium",children:"Create your first direction"}),E.jsxs("p",{className:"text-content-muted text-xs",children:["Use ",i," to generate directions."]}),E.jsxs("div",{className:"w-full",children:[E.jsx("p",{className:"text-content-muted mb-2 text-xs",children:"Here's a sample prompt to use:"}),E.jsxs("div",{className:"border-main-border bg-main-input relative rounded-md border px-3 py-2.5 pr-8",children:[E.jsxs("p",{className:"text-content-muted text-xs leading-snug",children:["“",W4,"”"]}),E.jsx("button",{type:"button",onClick:a,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?E.jsx(FR,{className:"h-3.5 w-3.5 text-emerald-500",weight:"bold"}):E.jsx(Jd,{className:"h-3.5 w-3.5",weight:"bold"})})]})]})]})},yG=({onClose:t})=>{const e=et(w5);return t?E.jsxs("div",{className:"z-10 flex flex-shrink-0 items-center justify-between gap-2 border-b border-main-border bg-main-light px-2.5 py-2.5",children:[e?E.jsx("span",{className:"text-content min-w-0 truncate text-sm font-medium",title:e,children:e}):E.jsx("span",{}),E.jsx(Ji,{label:"Close panel",side:"bottom",children:E.jsx("button",{onClick:t,className:"flex h-6 w-6 flex-shrink-0 items-center justify-center rounded p-1 text-content-subtle transition-colors hover:bg-main-input hover:text-content",children:E.jsx(vU,{className:"h-4 w-4",weight:"bold"})})})]}):null},_G='[data-menu-item]:not([disabled]):not([aria-disabled="true"])',wG=({itemSelector:t=_G,loop:e=!1}={})=>{const n=v.useRef(null),r=v.useRef(null),s=v.useCallback(a=>{var u;n.current=a,a?r.current=NB():((u=r.current)==null||u.call(r),r.current=null)},[]),i=v.useCallback(a=>{var w;const{key:u}=a;if(u!=="ArrowDown"&&u!=="ArrowUp"&&u!=="Home"&&u!=="End")return;const c=n.current;if(!c)return;const d=Array.from(c.querySelectorAll(t));if(d.length===0)return;a.preventDefault(),a.stopPropagation();const h=d.indexOf(document.activeElement),p=d.length-1,m=y=>{if(h===-1)return y===1?0:p;const x=h+y;return e?(x+d.length)%d.length:Math.min(Math.max(x,0),p)};let _;u==="Home"?_=0:u==="End"?_=p:u==="ArrowDown"?_=m(1):_=m(-1),(w=d[_])==null||w.focus()},[t,e]);return{containerRef:s,onKeyDown:i}},q4="/assets/arena-Db0j1set.png",xG=Cs("useIntegrations"),A1=["integrations"],bG="rivet:connect-result",SG=t=>typeof t=="object"&&t!==null&&t.type===bG,EG=st(null),G4=async()=>{const t=await fetch("/api/integrations");if(!t.ok)throw new Error(`Failed to load integrations (${t.status})`);return(await t.json()).integrations??[]},CG=()=>{const t=d6(),[e,n]=i3(EG),r=dy({queryKey:A1,queryFn:G4,staleTime:1e4}),s=v.useCallback(async()=>(await t.invalidateQueries({queryKey:A1,refetchType:"none"}),t.fetchQuery({queryKey:A1,queryFn:G4})),[t]),i=v.useCallback(async u=>{const c=window.open("","_blank","width=560,height=720");if(!c)throw new Error("Popup blocked. Allow popups to connect.");n(u);try{const d=await fetch(`/api/integrations/${u}/connect`,{method:"POST"}),h=await d.json().catch(()=>({}));if(!d.ok||!h.authUrl)throw c.close(),new Error(h.error||`Could not connect ${u}`);return c.location.href=h.authUrl,await new Promise(p=>{let m=!1,_=null;const w=async(x,S=!1)=>{if(!m){m=!0,window.removeEventListener("message",y),_&&clearInterval(_);try{const T=(await s()).some(k=>k.provider===u&&k.status==="connected");p(S&&T?"connected":x)}catch{p(x)}}},y=x=>{if(SG(x.data)&&x.data.provider===u){if(x.data.status==="error"){xG.warn(`Connect failed for ${u}:`,x.data.message),w("failed");return}w("connected")}};window.addEventListener("message",y),_=setInterval(()=>{c.closed&&w("closed",!0)},500)})}finally{n(null)}},[s,n]),a=v.useCallback(async u=>{n(u);try{const c=await fetch(`/api/integrations/${u}`,{method:"DELETE"});if(!c.ok){const d=await c.json().catch(()=>({}));throw new Error(d.error||`Could not disconnect ${u}`)}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:a,refetch:s}},Ou=({onClick:t,title:e,shortcut:n,children:r,disabled:s=!1,className:i="",type:a="button","data-cy":u})=>{const c=E.jsx("button",{onClick:t,disabled:s,className:i,type:a,"data-cy":u,children:r});return e?E.jsx(Yw,{content:E.jsxs("div",{className:"flex flex-row items-center gap-2",children:[E.jsx("span",{children:e}),n?E.jsx("span",{className:"rounded bg-white/15 px-1.5 py-0.5 text-[11px]",children:n}):null]}),children:c}):c},Ga=({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}:{}}}),K4=Cs("ConnectorsModal"),kG=()=>E.jsx("svg",{viewBox:"0 0 24 24",className:"h-6 w-6","aria-hidden":"true",children:E.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"})}),PG=()=>E.jsx("span",{"aria-hidden":"true",className:"h-6 w-6 bg-[#b1b1b1]",style:{WebkitMaskImage:`url(${q4})`,maskImage:`url(${q4})`,WebkitMaskSize:"contain",maskSize:"contain",WebkitMaskRepeat:"no-repeat",maskRepeat:"no-repeat",WebkitMaskPosition:"center",maskPosition:"center"}}),TG=[{provider:"pinterest",name:"Pinterest",description:"Pull boards and pins in as visual references.",tileClassName:"bg-[#e60023] text-white",icon:E.jsx(kG,{})},{provider:"arena",name:"Are.na",description:"Connect channels of collected blocks and links.",tileClassName:"bg-[#18181b] text-content",icon:E.jsx(PG,{})}],RG=({meta:t,integration:e,isPending:n,isHighlighted:r,onConnect:s,onDisconnect:i})=>{const a=(e==null?void 0:e.status)==="connected",u=e!=null&&e.externalUsername?`@${e.externalUsername}`:null;return E.jsxs("article",{className:`bg-main-light flex flex-col rounded-xl p-[18px] ${r?"ring-secondary ring-2":""}`,children:[E.jsx("span",{className:`grid h-[52px] w-[52px] flex-none place-items-center rounded-xl ${t.tileClassName}`,"aria-hidden":"true",children:t.icon}),E.jsxs("div",{className:"mt-4 flex-1",children:[E.jsxs("h2",{className:"text-content flex items-center gap-1.5 text-[15px] font-semibold",children:[t.name,a?E.jsx(FR,{className:"h-3.5 w-3.5",weight:"bold","aria-hidden":"true"}):null]}),E.jsx("p",{className:"text-content-subtle mt-1 text-[13px] leading-relaxed",children:t.description}),a&&u?E.jsx("p",{className:"text-content-muted mt-2.5 text-xs font-medium",children:u}):null]}),a?E.jsx("button",{type:"button",onClick:i,disabled:n,className:"active-push bg-main-input text-content-muted mt-[18px] inline-flex min-h-[38px] w-full items-center justify-center rounded-lg px-3.5 text-[13px] font-semibold transition-colors hover:bg-red-500/10 hover:text-red-300 disabled:cursor-not-allowed disabled:opacity-50",children:n?"Disconnecting…":"Disconnect"}):E.jsx("button",{type:"button",onClick:s,disabled:n,className:"active-push bg-secondary text-secondary-foreground hover:bg-accent mt-[18px] inline-flex min-h-[38px] w-full items-center justify-center rounded-lg px-3.5 text-[13px] font-semibold transition-colors disabled:cursor-not-allowed disabled:opacity-50",children:n?"Connecting…":"Connect"})]})},G_=({isOpen:t,onClose:e,context:n="menu",highlightProvider:r=null})=>{const{integrations:s,isLoading:i,error:a,pendingProvider:u,connect:c,disconnect:d}=CG(),h=c0(),[p,m]=v.useState(null),_=S=>s.find(P=>P.provider===S),w=v.useCallback(S=>{const P=Date.now(),T=Ga({action:"connect",outcome:"started",provider:S,entryPoint:n});h==null||h.capture(T.event,T.properties),c(S).then(k=>{const R=Date.now()-P;if(k==="connected"){const L=Ga({action:"connect",outcome:"completed",provider:S,entryPoint:n,durationMs:R});h==null||h.capture(L.event,L.properties);return}const M=Ga({action:"connect",outcome:"failed",provider:S,entryPoint:n,durationMs:R,failureReason:k==="closed"?"popup_closed":"provider_failed"});h==null||h.capture(M.event,M.properties)}).catch(k=>{const R=k instanceof Error?k.message:"Could not connect.",M=Ga({action:"connect",outcome:"failed",provider:S,entryPoint:n,durationMs:Date.now()-P,failureReason:R.includes("Popup blocked")?"popup_blocked":"request_failed"});h==null||h.capture(M.event,M.properties),K4.warn(`Connect error for ${S}:`,R),gt.error(R)})},[c,n,h]),y=v.useCallback(S=>{const P=Date.now(),T=Ga({action:"disconnect",outcome:"started",provider:S,entryPoint:n});h==null||h.capture(T.event,T.properties),d(S).then(()=>{const k=Ga({action:"disconnect",outcome:"completed",provider:S,entryPoint:n,durationMs:Date.now()-P});h==null||h.capture(k.event,k.properties)}).catch(k=>{const R=k instanceof Error?k.message:"Could not disconnect.",M=Ga({action:"disconnect",outcome:"failed",provider:S,entryPoint:n,durationMs:Date.now()-P,failureReason:"request_failed"});h==null||h.capture(M.event,M.properties),K4.warn(`Disconnect error for ${S}:`,R),gt.error(R)})},[n,d,h]),x=n==="onboarding";return E.jsx(kw,{open:t,onOpenChange:S=>!S&&e(),children:E.jsxs(Pw,{children:[E.jsx(Tw,{className:"z-max fixed inset-0 bg-black/40"}),E.jsx(Rw,{ref:m,className:"z-max border-main-border bg-main font-main fixed top-1/2 left-1/2 w-[560px] -translate-x-1/2 -translate-y-1/2 rounded-lg border shadow-2xl outline-none",children:E.jsxs(pA,{value:p,children:[E.jsxs("div",{className:"border-main-border bg-main-light flex items-center justify-between rounded-t-lg border-b px-4 py-2",children:[E.jsx(Aw,{className:"text-content text-base font-medium",children:"Connect design references"}),E.jsx(Ou,{onClick:e,title:"Close",className:"text-content-subtle hover:bg-main-hover hover:text-content rounded p-1 transition-colors",children:E.jsx(YR,{className:"h-4 w-4",weight:"bold"})})]}),E.jsxs("div",{className:"flex flex-col gap-4 p-4",children:[E.jsx(Iw,{className:"text-content-subtle text-sm",children:"Connect your design references to use them with Rivet’s MCP."}),a?E.jsx("p",{className:"rounded-lg bg-red-500/10 px-4 py-3 text-[13px] font-medium text-red-300",children:a}):null,E.jsx("div",{className:"grid grid-cols-2 gap-4",children:TG.map(S=>E.jsx(RG,{meta:S,integration:_(S.provider),isPending:i||u===S.provider,isHighlighted:r===S.provider,onConnect:()=>w(S.provider),onDisconnect:()=>y(S.provider)},S.provider))}),x?E.jsxs("div",{className:"flex items-center justify-between gap-4",children:[E.jsx("p",{className:"text-content-subtle text-xs",children:"You can always do this later from the account menu."}),E.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]})]})})]})})},Z4=({className:t=""})=>E.jsx("span",{"aria-hidden":"true",className:`rivet-skeleton block rounded ${t}`.trim()}),AG=Cs("SupportTicketModal"),Y4=5e3,I1="feedback",IG=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},MG=async t=>{let e;try{e=await t.json()}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=IG(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}`},OG=({isOpen:t,onClose:e,contactEmail:n})=>{const r=c0(),[s,i]=v.useState(""),[a,u]=v.useState(!1),[c,d]=v.useState(null),h=v.useCallback(()=>{i("")},[]),p=v.useCallback(()=>{a||(h(),e())},[a,e,h]),m=v.useCallback(async()=>{const x=s.trim();if(!(!x||a)){u(!0);try{const S=typeof(r==null?void 0:r.get_session_id)=="function"?r.get_session_id():void 0,P=typeof(r==null?void 0:r.get_distinct_id)=="function"?r.get_distinct_id():void 0,T=n==null?void 0:n.trim(),k=await fetch("/api/support/tickets",{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({type:I1,message:x,contactEmail:T||void 0,metadata:{posthogSessionId:S??void 0,posthogDistinctId:P??void 0,appVersion:"0.14.21",appEnvironment:"production",pageUrl:window.location.href,userAgent:navigator.userAgent,submittedAt:new Date().toISOString()}})});if(!k.ok){const R=await MG(k);throw new Error(R)}r==null||r.capture("support_ticket_submitted",{ticket_type:I1,has_posthog_session_id:!!S}),gt.success("Feedback sent",{description:"Thanks for sharing this."}),h(),e()}catch(S){const P=S instanceof Error?S.message:"Failed to send message";r==null||r.capture("support_ticket_submit_failed",{ticket_type:I1,error:P}),AG.error("Failed to submit support ticket:",P),gt.error("Could not send feedback",{description:P})}finally{u(!1)}}},[n,a,s,e,r,h]),_=v.useCallback(x=>{x.key==="Enter"&&(x.metaKey||x.ctrlKey)&&(x.preventDefault(),m())},[m]),w=Y4-s.length,y=a||s.trim().length===0;return E.jsx(kw,{open:t,onOpenChange:x=>!x&&p(),children:E.jsxs(Pw,{children:[E.jsx(Tw,{className:"fixed inset-0 z-max bg-black/40"}),E.jsx(Rw,{ref:d,className:"fixed left-1/2 top-1/2 z-max w-[440px] -translate-x-1/2 -translate-y-1/2 rounded-lg border border-main-border bg-main font-main shadow-2xl outline-none",children:E.jsxs(pA,{value:c,children:[E.jsxs("div",{className:"flex items-center justify-between rounded-t-lg border-b border-main-border bg-main-light px-4 py-2",children:[E.jsx(Aw,{className:"text-base font-medium text-content",children:"Send feedback"}),E.jsx(Ou,{onClick:p,disabled:a,title:"Close",className:"rounded p-1 text-content-subtle transition-colors hover:bg-main-hover hover:text-content disabled:cursor-not-allowed disabled:opacity-50",children:E.jsx(YR,{className:"h-4 w-4",weight:"bold"})})]}),E.jsxs("div",{className:"flex flex-col gap-3 p-4",children:[E.jsx(Iw,{className:"text-sm text-content-subtle",children:"Tell us what happened or what we can improve."}),E.jsxs("div",{className:"rounded-lg bg-main-input outline outline-1 outline-transparent transition-[outline-color] focus-within:outline-white/20",children:[E.jsx("textarea",{id:"support-ticket-message","aria-label":"Your feedback",value:s,onChange:x=>i(x.target.value),onKeyDown:_,maxLength:Y4,rows:6,disabled:a,placeholder:"What happened?",className:"max-h-64 w-full resize-none overflow-y-auto bg-transparent pb-1 pl-3 pr-3 pt-3 text-sm text-content placeholder-content-subtle focus:outline-none disabled:opacity-50"}),E.jsxs("div",{className:"flex items-center justify-between px-3 pb-3 pt-1",children:[E.jsx("span",{className:"text-xs text-content-subtle",children:"Context details are included automatically."}),E.jsxs("div",{className:"flex items-center gap-2",children:[w<=500&&E.jsx("span",{className:"text-xs text-content-subtle",children:w}),E.jsx(Ou,{onClick:m,disabled:y,title:"Send feedback",shortcut:"⌘↵",className:"flex items-center justify-center rounded bg-primary p-1 text-content transition-colors hover:bg-primary-hover disabled:cursor-not-allowed disabled:opacity-80",children:a?E.jsx(w0,{className:"h-5 w-5 animate-spin",weight:"bold"}):E.jsx(fU,{className:"h-5 w-5",weight:"bold"})})]})]})]})]})]})})]})})},LG=Cs("ProfileAvatar"),_A=(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):""},DG=(t,e)=>_A(t,e).charAt(0).toUpperCase(),NG=({className:t="",side:e="bottom",align:n="end"})=>{const{name:r,email:s}=et(b5),i=et(P5),[a,u]=v.useState(!1),[c,d]=v.useState(!1),[h,p]=v.useState(!1),[m,_]=v.useState(!1),{containerRef:w,onKeyDown:y}=wG(),x=et(Mf),S=DG(r,s);if(!S)return x?E.jsxs("span",{"data-testid":"profile-avatar-skeleton","aria-hidden":"true",className:`flex shrink-0 items-center gap-2 ${t}`.trim(),children:[E.jsx(Z4,{className:"h-7 w-7 rounded-full"}),E.jsx(Z4,{className:"h-3 w-16"})]}):null;const P=_A(r,s),T=(r==null?void 0:r.trim())||null,k=(s==null?void 0:s.trim())||null,R=async()=>{_(!0);try{const M=await fetch("/api/auth/logout",{method:"POST",credentials:"same-origin"});if(!M.ok)throw new Error(`Logout failed: ${M.status}`)}catch(M){LG.warn("Logout request failed",M),gt.error("Could not log out. Please try again."),_(!1);return}window.location.reload()};return E.jsxs(E.Fragment,{children:[E.jsxs(Q5,{open:a,onOpenChange:u,children:[E.jsx(J5,{asChild:!0,children:E.jsxs("button",{type:"button","aria-label":"Account",className:`text-content-muted hover:text-content flex shrink-0 items-center gap-2 transition-colors select-none ${t}`,children:[E.jsx("span",{className:"border-main-border bg-main-input flex h-7 w-7 items-center justify-center rounded-full border text-[11px] leading-none font-semibold",children:S}),P?E.jsx("span",{className:"max-w-[8rem] truncate text-xs font-medium",children:P}):null]})}),E.jsx(eA,{children:E.jsxs(tA,{ref:w,onKeyDown:y,role:"menu",className:"bg-surface-2 z-[60] min-w-[180px] rounded-lg p-1 shadow-lg",side:e,sideOffset:6,align:n,children:[T||k?E.jsxs("div",{className:"border-main-border border-b px-3 py-2",children:[T?E.jsx("div",{className:"text-content truncate text-xs font-medium",children:T}):null,k?E.jsx("div",{className:"text-content-muted truncate text-[11px]",children:k}):null]}):null,E.jsxs("button",{type:"button",role:"menuitem","data-menu-item":!0,onClick:()=>{u(!1),d(!0)},disabled:!i,className:"text-content hover:bg-hover focus:bg-hover mt-1 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:[E.jsx(GR,{className:"h-3.5 w-3.5",weight:"bold"}),"Connect design references"]}),E.jsxs("button",{type:"button",role:"menuitem","data-menu-item":!0,onClick:()=>{u(!1),p(!0)},className:"text-content hover:bg-hover focus:bg-hover mt-1 flex w-full items-center gap-2 rounded-md px-3 py-1.5 text-xs transition-colors focus:outline-none",children:[E.jsx(pU,{className:"h-3.5 w-3.5",weight:"bold"}),"Share feedback"]}),E.jsxs("button",{type:"button",role:"menuitem","data-menu-item":!0,onClick:R,disabled:m,className:"text-content hover:bg-hover focus:bg-hover mt-1 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:[E.jsx(yU,{className:"h-3.5 w-3.5",weight:"bold"}),m?"Logging out…":"Log out"]})]})})]}),E.jsx(G_,{isOpen:c,onClose:()=>d(!1)}),E.jsx(OG,{isOpen:h,onClose:()=>p(!1),contactEmail:s??void 0})]})},jG=({onClose:t})=>E.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:[E.jsx(yG,{onClose:t}),E.jsx("div",{className:"flex min-h-0 flex-1 flex-col",children:E.jsx(Yq,{})}),E.jsx("div",{className:"border-main-border bg-main-light flex flex-shrink-0 items-center border-t px-2.5 py-1.5",children:E.jsx(NG,{side:"top",align:"start"})})]});async function FG(t,e){const{delaysMs:n,shouldRetry:r,onRetry:s}=e;for(let i=1;;i++)try{return await t(i)}catch(a){const u=n[i-1];if(u===void 0||r&&!r(a))throw a;s==null||s(a,i,u),await new Promise(c=>setTimeout(c,u))}}const X4=Cs("useServerConfig"),wA=[250,500,1e3,2e3,4e3],Q4=wA.length+1,$G=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}},VG=()=>{const[t,e]=v.useState(null),[n,r]=v.useState(!0),[s,i]=v.useState(null),a=v.useCallback(async()=>{try{r(!0),i(null);const u=await FG($G,{delaysMs:wA,onRetry:(c,d,h)=>{X4.warn(`Server config fetch failed (attempt ${d}); retrying in ${h}ms`,c)}});return e(u),u}catch(u){const c=u instanceof Error?u.message:"Failed to fetch server config";throw i(c),X4.warn("Error fetching server config:",u),u}finally{r(!1)}},[]);return{config:t,fetchConfig:a,isLoading:n,error:s}},HG="#1C1C20",Ni=[118,118,124],J4=.85,zG=3,UG=.15,Sp=36,BG=4.4,WG=.7,qG=3.5,GG=.8,e8=9,KG=11,ZG=[1.35,1.12,.95,.85],YG=[0,1.1,2.3,3.1],XG=[0,.35,.16,.13],QG=[.9,.5,.4,.35],Ka=3,M1=[[{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}]],Ep=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},Yp=t=>{const e=Math.min(1,Math.max(0,t));return e*e*(3-2*e)},Za=(t,e)=>(Math.round(t/e-.5)+.5)*e,JG=Math.sin(Math.PI/3),t8=(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*JG;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()},eK=(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)-e8}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)-e8}return Yp(.5-r/(2*KG))},xA=({className:t="",trackGlobalLoaderCount:e=!0})=>{const n=at(x5),r=v.useRef(null),s=v.useCallback(i=>{var D;if((D=r.current)==null||D.call(r),r.current=null,!i)return;const a=i.getContext("2d");if(!a)return;e&&n(N=>N+1);const u=window.matchMedia("(prefers-reduced-motion: reduce)").matches;let c=[],d=0,h=0,p=Sp,m=Sp,_=null,w=null,y=0,x=-1;const S=new Array(33),P=N=>{const j=Math.round(N*32);let G=S[j];if(!G){const Y=j/32,W=Math.round(Ni[0]+(255-Ni[0])*Y),q=Math.round(Ni[1]+(255-Ni[1])*Y),Z=Math.round(Ni[2]+(255-Ni[2])*Y);G=`rgba(${W}, ${q}, ${Z}, ${J4})`,S[j]=G}return G},T=N=>{const j=1-.35*N,G=Math.round(Ni[0]*j),Y=Math.round(Ni[1]*j),W=Math.round(Ni[2]*j);return`rgba(${G}, ${Y}, ${W}, ${J4})`},k=N=>{let j=Math.floor(Math.random()*M1.length);j===x&&(j=(j+1)%M1.length),x=j;const G=[0,0,0,0],Y=M1[j].map((F,X)=>{const oe=F.level,se=G[oe]++,ee=YG[oe]+se*XG[oe],ce=QG[oe]+Ep(j*131+X*17+5)*.2;if(F.hline){const ie=Za((F.y??0)*h,m);return{hline:!0,x1:Za(F.x1*d,p),x2:Za(F.x2*d,p),y1:ie,y2:ie,level:oe,start:ee,dur:ce}}const we=Za(F.x1*d,p),le=Za((F.y1??0)*h,m);return{hline:!1,x1:we,y1:le,x2:Math.max(Za(F.x2*d,p),we+p),y2:Math.max(Za((F.y2??0)*h,m),le+m),level:oe,start:ee,dur:ce}}),W=Y.reduce((F,X)=>Math.max(F,X.start+X.dur),0),q=c.length,Z=new Float32Array(q*Ka),V=new Int16Array(q*Ka).fill(-1),J=new Uint8Array(q),H=Y[0];for(let F=0;F<q;F++){const X=c[F];X.x>H.x1&&X.x<H.x2&&X.y>H.y1&&X.y<H.y2&&(J[F]=1);const oe=F*Ka;for(let se=0;se<Y.length;se++){const ee=eK(X.x,X.y,Y[se]);if(ee<=.02)continue;let ce=oe;for(let we=oe;we<oe+Ka;we++){if(V[we]===-1){ce=we;break}Z[we]<Z[ce]&&(ce=we)}(V[ce]===-1||ee>Z[ce])&&(Z[ce]=ee,V[ce]=se)}}return{startT:N,buildEnd:W,els:Y,frame:H,cellQ:Z,cellEl:V,inFrame:J}},R=()=>{const N=i.getBoundingClientRect();d=Math.max(1,N.width),h=Math.max(1,N.height);const j=Math.min(2,window.devicePixelRatio||1);i.width=Math.round(d*j),i.height=Math.round(h*j),a.setTransform(j,0,0,j,0,0);const G=Math.max(8,Math.round(d/Sp)),Y=Math.max(6,Math.round(h/Sp));p=d/G,m=h/Y,c=[];for(let W=0;W<Y;W++){const q=Y>1?W/(Y-1):.5,Z=BG*(1+WG*.4*(q*2-1));for(let V=0;V<G;V++){const J=W*8191+V*131+1,H={x:(V+.5)*p,y:(W+.5)*m,size:Z,seed:J,phase:Ep(J),kind:0};H.kind=Math.floor(Ep(J*97)*3),c.push(H)}}w=null,_=null},M=new Float32Array(32),L=N=>{a.fillStyle=HG,a.fillRect(0,0,d,h),_||(_=k(N+.2)),N>=_.startT+_.buildEnd+qG&&(w=_,y=N,_=k(N+.2));let j=0;w&&(j=1-Yp((N-y)/GG),j<=0&&(w=null));const G=_;for(let H=0;H<G.els.length;H++){const F=G.els[H];M[H]=Yp(Math.min(1,Math.max(0,(N-G.startT-F.start)/F.dur)))}const Y=M[0],W=T(0),q=T(Y),Z=j>0?T(j):W,V=j>0?T(Math.max(Y,j)):q,J=c.length;for(let H=0;H<J;H++){const F=c[H];let X=0,oe=0;const se=H*Ka;for(let Be=se;Be<se+Ka;Be++){const Pe=G.cellEl[Be];if(Pe<0)break;const $e=G.cellQ[Be]*M[Pe];$e>X&&(X=$e,oe=G.els[Pe].level)}if(w)for(let Be=se;Be<se+Ka;Be++){const Pe=w.cellEl[Be];if(Pe<0)break;const $e=w.cellQ[Be]*j;$e>X&&(X=$e,oe=w.els[Pe].level)}const ee=N/zG+F.phase,ce=Math.floor(ee),we=ee-ce,le=Yp(Math.min(we,1-we)/UG),ie=Math.floor(Ep(F.seed*97+ce*7919)*3);ie!==F.kind&&X<.02&&le<.05&&(F.kind=ie);const Ne=Math.max(le*(1-X),X);if(!(Ne<.01))if(X<.02){const Be=G.inFrame[H]===1,Pe=w?w.inFrame[H]===1:!1;Be?a.fillStyle=Pe?V:q:a.fillStyle=Pe?Z:W;const $e=Math.max(Be?Y:0,Pe?j:0);t8(a,F.kind,F.x,F.y,F.size*Ne*(1-.2*$e))}else{a.fillStyle=P(X);const Be=1+(ZG[oe]-1)*X;t8(a,F.kind,F.x,F.y,F.size*Ne*Be)}}};R();let A=0;if(u)_=k(-100),L(0);else{const N=performance.now(),j=G=>{L((G-N)/1e3),A=requestAnimationFrame(j)};A=requestAnimationFrame(j)}const O=new ResizeObserver(()=>{R(),u&&(_=k(-100),L(0))});O.observe(i),r.current=()=>{cancelAnimationFrame(A),O.disconnect(),e&&n(N=>N-1)}},[e,n]);return E.jsx("canvas",{ref:s,"aria-hidden":"true",className:`h-full w-full ${t}`.trim()})},tK=async(t=null)=>{if(t)return nK(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 Cp();if(!e.ok)return{isOk:!1,unavailableReason:"rivet_unreachable",upstreamStatus:null};let r;try{r=await e.json()}catch{return Cp()}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}:Cp()},bA=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}}},nK=t=>bA(t),Cp=()=>bA("/"),O1=Cs("usePreviewUpstreamHealth"),rK=500,sK=4e3,iK=15e3,oK=3,aK=(t,e={})=>{const n=v.useRef(null),r=v.useRef(null),s=e.probeMsWhileDown??rK,i=e.probeMsWhileUp??sK,a=e.firstUnreachableCaptureAfterMs??iK,u=e.rerunProbeImmediatelyOnVersion,c=e.probePath??null,d=e.skip??!1,h=v.useRef(e.onPersistentUpstreamServerErrors);h.current=e.onPersistentUpstreamServerErrors;const[p,m]=v.useState(t==="static"),[_,w]=v.useState(0),[y,x]=v.useState(null),[S,P]=v.useState(0),[T,k]=v.useState(!1),[R,M]=v.useState(!1),[L,A]=v.useState(t==="static"?null:"upstream_unreachable");return v.useEffect(()=>{if(t==="static"){m(!0),x(null),P(0),k(!1),M(!0),A(null);return}if(d){m(!1),x(null),P(0),k(!1),M(!0),A("upstream_unreachable"),n.current=null;return}let O=!0;const D=Date.now();x(D),P(0),k(!1),m(!1),M(!1),A("upstream_unreachable");const N={current:!1},j={current:!1},G={current:!1},Y={current:null},W={current:!1},q={current:!1},Z={current:0},V={current:!1},J={current:null};let H=null;const F=()=>{G.current||(G.current=!0,O&&M(!0))},X=()=>{H!==null&&(clearTimeout(H),H=null)},oe=(ee,ce)=>{X(),H=setTimeout(ce,ee)},se=async()=>{var $e;if(!O)return;P(dt=>dt+1);const{isOk:ee,unavailableReason:ce,upstreamStatus:we}=await tK(c);if(!O)return;F(),J.current=we;const le=ee&&we!==null&&we>=500;le&&q.current?Z.current+=1:ee&&!le&&(Z.current=0);const ie=Z.current>=oK;if(ie&&!V.current&&we!==null&&(V.current=!0,Se==null||Se.capture("preview_upstream_error_responses",{framework:t,upstream_status:we,consecutive_count:Z.current}),O1.warn(`Preview upstream is listening but has served ${Z.current} consecutive ${we} responses`),($e=h.current)==null||$e.call(h,{upstreamStatus:we,consecutiveCount:Z.current})),ee&&!ie){le||(q.current=!0,V.current=!1);const dt=!W.current;W.current=!0,m(!0),A(null),Y.current=null,j.current=!1,k(!1),N.current?dt&&(Se==null||Se.capture("preview_upstream_restored",{framework:t})):(N.current=!0,Se==null||Se.capture("preview_dev_server_ready",{framework:t,ready_after_ms:Date.now()-D})),oe(i,se);return}const Be=W.current;W.current=!1,m(!1),A(ce),Y.current===null&&(Y.current=Date.now(),j.current=!1,k(!1)),Be&&(Se==null||Se.capture("preview_upstream_lost",{framework:t,upstream_status:we}),w(dt=>dt+1),O1.warn("Preview upstream became unavailable after it was ready"));const Pe=Date.now()-Y.current;Pe>=a&&!j.current&&(j.current=!0,k(!0),Se==null||Se.capture("preview_dev_server_unreachable",{framework:t,elapsed_ms:Pe,upstream_status:J.current}),O1.warn("Dev server did not become ready within timeout window")),oe(s,se)};return n.current=()=>oe(0,se),oe(0,se),()=>{O=!1,n.current=null,X()}},[t,s,i,a,c,d]),v.useEffect(()=>{var D;if(t==="static"||u===void 0)return;const O=r.current;r.current=u,O!==null&&O!==u&&((D=n.current)==null||D.call(n))},[t,u]),{isUpstreamReady:p,iframeRemountKey:_,probeStartedAt:y,probeAttemptCount:S,isFirstUnreachableWindowExceeded:T,initialProbeComplete:R,unavailableReason:L}};function lK(t){return t.enteringSplit&&t.isExistingSession&&t.hasActiveVariantProxy}const SA=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}`},EA=({agentApplyMode:t,url:e})=>e.startsWith("/")?`${SA(t)}${e}`:e,uK="allow-scripts allow-same-origin allow-forms allow-popups allow-modals",cK=t=>uK,dK=Cs("PreviewSurface"),n8=(t,e)=>t==="about:blank"?"blank":t.includes("/api/variants/")?"static_artifact":e.kind==="variant"?"dev_server":"original",CA=({target:t,src:e,framework:n,remountKey:r})=>(et(x0),E.jsx("div",{className:"relative h-full w-full",children:E.jsx("iframe",{src:e,className:"h-full w-full border-none",title:"Project Preview",sandbox:cK(),onLoad:()=>{Se==null||Se.capture("preview_iframe_loaded",{framework:n,src:e}),t.kind==="variant"&&(Se==null||Se.capture("variants_panel.preview_displayed",{sessionId:t.sessionId,variantId:t.variantId,renderedTarget:"variant",iframeSrcKind:n8(e,t),framework:n}))},onError:()=>{Se==null||Se.capture("preview_iframe_load_failed",{framework:n,src:e}),t.kind==="variant"&&(Se==null||Se.capture("variants_panel.preview_display_failed",{sessionId:t.sessionId,variantId:t.variantId,renderedTarget:"variant",iframeSrcKind:n8(e,t),framework:n})),dK.warn("Preview iframe failed to load",{framework:n,src:e})}},r)})),fK="modulepreload",hK=function(t){return"/"+t},r8={},pK=function(e,n,r){let s=Promise.resolve();if(n&&n.length>0){let a=function(d){return Promise.all(d.map(h=>Promise.resolve(h).then(p=>({status:"fulfilled",value:p}),p=>({status:"rejected",reason:p}))))};document.getElementsByTagName("link");const u=document.querySelector("meta[property=csp-nonce]"),c=(u==null?void 0:u.nonce)||(u==null?void 0:u.getAttribute("nonce"));s=a(n.map(d=>{if(d=hK(d),d in r8)return;r8[d]=!0;const h=d.endsWith(".css"),p=h?'[rel="stylesheet"]':"";if(document.querySelector(`link[href="${d}"]${p}`))return;const m=document.createElement("link");if(m.rel=h?"stylesheet":fK,h||(m.as="script"),m.crossOrigin="",m.href=d,c&&m.setAttribute("nonce",c),document.head.appendChild(m),h)return new Promise((_,w)=>{m.addEventListener("load",_),m.addEventListener("error",()=>w(new Error(`Unable to preload CSS for ${d}`)))})}))}function i(a){const u=new Event("vite:preloadError",{cancelable:!0});if(u.payload=a,window.dispatchEvent(u),!u.defaultPrevented)throw a}return s.then(a=>{for(const u of a||[])u.status==="rejected"&&i(u.reason);return e().catch(i)})},mK=v.lazy(()=>pK(()=>Promise.resolve().then(()=>YZ),void 0)),gK={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"},vK={sm:"text-lg font-semibold text-content",md:"text-2xl font-semibold text-content",lg:"text-3xl font-semibold text-content"},yK={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"},Lu=({backdrop:t,media:e,title:n,description:r,actions:s,tone:i="neutral",fill:a="surface",size:u="md",children:c,state:d,role:h="status",busy:p=!1,className:m=""})=>{const _=v.useCallback(y=>{y&&d&&(Se==null||Se.capture("status_surface_shown",{state:d,tone:i,fill:a}))},[d,i,a]),w=!!(e||n||r||c||s!=null&&s.length);return E.jsxs("div",{ref:_,className:`${gK[a]} ${m}`.trim(),role:h,"aria-live":"polite","aria-busy":p||void 0,"data-state":d,children:[t?E.jsx("div",{className:"absolute inset-0",children:t}):null,w?E.jsxs("div",{className:"relative z-10 flex max-w-sm flex-col items-center gap-5 text-center",children:[e,n?E.jsx("h2",{className:vK[u],children:n}):null,r?E.jsx("p",{className:"text-content-muted text-base leading-relaxed",children:r}):null,c,s!=null&&s.length?E.jsx("div",{className:"flex flex-row items-center gap-3",children:s.map(y=>E.jsx("button",{type:"button",onClick:y.onClick,className:yK[y.variant??"neutral"],children:y.label},y.label))}):null]}):null]})},K_=({loader:t="coalesce",trackGlobalLoaderCount:e,size:n="lg",...r})=>t==="coalesce"?E.jsx(Lu,{...r,size:n,busy:!0,backdrop:E.jsx(xA,{trackGlobalLoaderCount:e})}):t==="logo"?E.jsx(Lu,{...r,size:n,busy:!0,backdrop:E.jsx(v.Suspense,{fallback:null,children:E.jsx(mK,{className:"absolute inset-0"})})}):E.jsx(Lu,{...r,size:n,busy:!0,media:E.jsx(w0,{"aria-hidden":!0,className:"text-content h-8 w-8 shrink-0 animate-spin",weight:"bold"})}),kA=({icon:t,...e})=>E.jsx(Lu,{...e,tone:"neutral",media:t?E.jsx("div",{className:"text-content-muted",children:t}):void 0}),Jw=t=>E.jsx(Lu,{...t,tone:"error",role:"alert"}),s8="/static/",_K=t=>{try{return new URL(t,"http://localhost").pathname.endsWith(s8)}catch{return t.endsWith(s8)}},wK=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==="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.",xK=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:wK(t.previewUnavailable.reason),detail:t.previewUnavailable.portInUse?"The preview port was already in use.":void 0,isError:!0}:null,bK=({issue:t})=>E.jsx(Lu,{fill:"overlay",size:"sm",state:t.state,role:t.isError?"alert":"status",tone:t.isError?"error":"neutral",title:t.title,description:t.description,children:t.detail?E.jsx("p",{className:"text-content-subtle text-xs leading-relaxed break-words",children:t.detail}):null}),SK=({isInteractionDisabled:t=!1,framework:e,userPort:n})=>{const r=et(N_),s=at(N_),i=et(Bm),a=at(Bm),u=et(If),c=et(x0),d=et(j_),h=et(F_),p=et(S5),m=et(E5),_=at(F_),w=et(ao),y=et(V_),x=at(j_),S=u.active&&u.projectContext.kind==="fresh",P=et($_),T=u.active?u.variants.find(Ve=>Ve.workItemId===P&&(Ve.status==="pending"||Ve.status==="running"||Ve.status==="succeeded"&&!Ve.preview&&typeof Ve.port!="number"&&(!Ve.previewUnavailable||Ve.previewUnavailable.reason==="idle_timeout")))??null:null,k=u.active&&u.variants.some(Ve=>Ve.status==="pending"||Ve.status==="running"),R=S||k,M=u.active?u.variants.find(Ve=>Ve.workItemId===P)??null:null,L=M?xK(M):null,A=e==="static"&&i!==null&&_K(i);v.useEffect(()=>{u.active||x(!1)},[u.active,x]);const O=v.useRef(!1);v.useEffect(()=>{const Ve=!!(w!=null&&w.left||w!=null&&w.right),qe=Ve&&!O.current;O.current=Ve;const tt=u.active?u.sessionId:null;!tt||!lK({enteringSplit:qe,isExistingSession:u.active&&u.projectContext.kind==="existing",hasActiveVariantProxy:d&&h!==null})||(x(!1),_(null),s(_t=>_t+1),fetch(`/api/variants/${encodeURIComponent(tt)}/preview-port`,{method:"POST",headers:{"content-type":"application/json"},body:JSON.stringify({variantId:null})}).catch(()=>{}))},[w,u,d,h,x,_,s]);const N=v.useMemo(()=>{var Ye;if(d||i&&!A||!u.active)return null;const{stage:Ve,variants:qe}=u,tt=Ve==="ready"||Ve==="degraded",_t=qe.some(on=>{var an,On;return((an=on.refinement)==null?void 0:an.status)==="pending"||((On=on.refinement)==null?void 0:On.status)==="running"});if(!tt&&!_t)return null;const nt=qe.find(on=>{var an;return on.status==="succeeded"&&((an=on.preview)==null?void 0:an.kind)==="static_artifact"});return((Ye=nt==null?void 0:nt.preview)==null?void 0:Ye.kind)==="static_artifact"?nt.preview.url:null},[A,i,d,u])??i,j=v.useMemo(()=>!u.active||!N?null:u.variants.find(Ve=>{var qe;return((qe=Ve.preview)==null?void 0:qe.kind)==="static_artifact"&&N.startsWith(Ve.preview.url)})??null,[N,u]),G=v.useMemo(()=>{if((y==null?void 0:y.previewKind)==="static")return{kind:"variant",sessionId:y.sessionId,variantId:y.variantId};if(!u.active)return Um;if(j)return{kind:"variant",sessionId:u.sessionId,variantId:j.workItemId};if(N){const qe=N.match(/\/__rivet\/preview\/variant\/([^/]+)\/([^/?#]+)/),tt=qe!=null&&qe[1]?decodeURIComponent(qe[1]):null,_t=qe!=null&&qe[2]?decodeURIComponent(qe[2]):null;if(tt===u.sessionId&&_t&&u.variants.some(on=>on.workItemId===_t))return{kind:"variant",sessionId:u.sessionId,variantId:_t};const nt=N.match(/\/api\/variants\/[^/]+\/static\/([^/?#]+)/),Ye=nt!=null&&nt[1]?decodeURIComponent(nt[1]):null;if(Ye&&u.variants.some(on=>on.workItemId===Ye))return{kind:"variant",sessionId:u.sessionId,variantId:Ye}}const Ve=!!(w!=null&&w.left||w!=null&&w.right);return(!Ve||S)&&!N&&d&&h&&u.variants.some(qe=>qe.workItemId===h)?{kind:"variant",sessionId:u.sessionId,variantId:h}:(!Ve||S)&&!N&&P&&u.variants.some(qe=>qe.workItemId===P)?{kind:"variant",sessionId:u.sessionId,variantId:P}:Um},[y,j,u,d,h,N,w,S,P]),Y=v.useRef(null);v.useEffect(()=>{var _t,nt;if(!j||((_t=j.preview)==null?void 0:_t.kind)!=="static_artifact"||((nt=j.refinement)==null?void 0:nt.status)!=="succeeded")return;const Ve=`${j.workItemId}:${j.refinement.workItemId}`;if(Y.current===Ve)return;Y.current=Ve;const qe=j.preview.url.includes("?")?"&":"?",tt=`${j.preview.url}${qe}refinement=${encodeURIComponent(j.refinement.workItemId)}`;N!==tt&&(a(tt),s(Ye=>Ye+1))},[N,j,s,a,u]);const W=N!==null&&zq(N),q=N!==null&&!W||S&&!d&&!W,{isUpstreamReady:Z,iframeRemountKey:V,probeAttemptCount:J,initialProbeComplete:H}=aK(e,{rerunProbeImmediatelyOnVersion:r,probePath:W?N:null,skip:q}),[F,X]=v.useState(()=>p&&Z?r:null),oe=v.useRef(null);v.useEffect(()=>{if(!p){oe.current=null,X(null);return}if(F===r){oe.current=null;return}const Ve=oe.current;if(!Ve||Ve.remountKey!==r){oe.current={remountKey:r,probeAttemptCount:J};return}Z&&J>Ve.probeAttemptCount&&(oe.current=null,X(r))},[F,r,p,J,Z]);const ee=N!==null&&!W||Z,we=m||p&&F!==r||p&&!ee,le=`${V}:${r}`,ie=gA(window.location.pathname),Ne=e==="static"?`/static${ie??"/"}`:ie??"/",Be=SA(c);let Pe=null;N&&(Pe=EA({agentApplyMode:c,url:N}));const dt=T||L||we?"about:blank":(W&&!ee?"about:blank":Pe)??(ee?`${Be}${Ne}`:"about:blank"),Qt=!!T||!!L||!ee&&H;let be=null;return we?be=E.jsx(K_,{fill:"overlay",loader:"coalesce",trackGlobalLoaderCount:!1,state:"preview_replay_boot"}):T?be=E.jsx(K_,{fill:"overlay",loader:"coalesce",trackGlobalLoaderCount:!1,state:"variant_building",children:E.jsx("span",{className:"sr-only",children:"Building your direction"})}):L?be=E.jsx(bK,{issue:L}):Qt&&(be=R?E.jsx(kA,{fill:"overlay",state:"preview_no_selection",title:"Nothing to preview yet",description:"Pick a direction from the panel."}):E.jsx(Jw,{fill:"overlay",state:"preview_offline",title:"Preview isn't connected",description:"Rivet lost connection to your project.",actions:[{label:"Reload",onClick:()=>window.location.reload()}]})),E.jsxs("div",{className:"relative h-full w-full",children:[be,E.jsx(CA,{target:G,src:dt,framework:e,remountKey:le})]})};function i8({side:t,sessionId:e,variantId:n,url:r,label:s,source:i,isFallback:a=!1}){var T;const u=et(ao),c=at(ao),d=c0(),h=et(If),p=et(x0),m=v.useRef(!1),_=v.useCallback(()=>{m.current||(m.current=!0,cf({source:i,sessionId:e,variantId:n}))},[i,e,n]),w=v.useCallback(()=>{if(a){c(null);const L=Zm("ended",u);d==null||d.capture(L.event,L.properties);return}_();const k={...u};delete k[t];const R=k.left||k.right?k:null;c(R);const M=Zm(R?"updated":"ended",R??u);d==null||d.capture(M.event,M.properties)},[a,d,c,t,u,_]),y=v.useMemo(()=>({kind:"variant",sessionId:e,variantId:n}),[e,n]),x=v.useMemo(()=>!h.active||h.sessionId!==e?null:h.variants.find(k=>k.workItemId===n)??null,[e,n,h]),S=v.useMemo(()=>{var R,M;let k=r;if(((R=x==null?void 0:x.preview)==null?void 0:R.kind)==="static_artifact"&&((M=x.refinement)==null?void 0:M.status)==="succeeded"){const L=x.preview.url.includes("?")?"&":"?";k=`${x.preview.url}${L}refinement=${encodeURIComponent(x.refinement.workItemId)}`}return EA({agentApplyMode:p,url:k})},[p,x,r]),P=((T=x==null?void 0:x.refinement)==null?void 0:T.status)==="succeeded"?`${n}:${x.refinement.workItemId}`:n;return E.jsxs("div",{className:"variant-split-secondary","data-cy":"variant-split-pane","data-variant-id":n,children:[E.jsxs("div",{className:"variant-split-secondary-toolbar",children:[E.jsx("span",{className:"variant-split-secondary-label",title:s,children:s}),E.jsx(Ji,{label:"Collapse",children:E.jsx("button",{type:"button",className:"variant-split-secondary-close",onClick:w,"aria-label":"Collapse split view",children:E.jsx("svg",{width:"12",height:"12",viewBox:"0 0 12 12","aria-hidden":"true",focusable:"false",children:E.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"})})})})]}),E.jsx("div",{className:"variant-split-secondary-body relative min-h-0 flex-1",children:E.jsx(CA,{target:y,src:S,framework:"static",remountKey:P})})]})}const o8=240;function EK(){const t=et(sf),e=et(Dw),n=v.useRef(null);return v.useEffect(()=>{if(!t||!e||!n.current)return;const r=e.x-o8/2,s=e.y-22;n.current.style.transform=`translate3d(${r}px, ${s}px, 0)`},[t,e]),!t||!e?null:E.jsx("div",{ref:n,"aria-hidden":"true",className:"variant-drag-ghost",style:{width:o8},children:E.jsxs("div",{className:"variant-drag-ghost-body",children:[E.jsxs("div",{className:"variant-drag-ghost-row",children:[E.jsx("div",{className:"variant-drag-ghost-title",children:t.label}),t.runLabel?E.jsx("div",{className:"variant-drag-ghost-tag",style:f5(t.runLabel),children:t.runLabel}):null]}),t.description?E.jsx("div",{className:"variant-drag-ghost-desc",children:t.description}):null]})})}function CK(){const t=et(sf),e=et(Dw),n=et(ao),r=at(sf),s=at(ao),i=c0(),a=v.useRef(null),[u,c]=v.useState(null),[d,h]=v.useState("hidden");v.useEffect(()=>{if(!t){h("hidden"),c(null);return}const _=requestAnimationFrame(()=>h("visible"));return()=>cancelAnimationFrame(_)},[t]);const p=v.useCallback((_,w)=>{const y=a.current;if(!y)return null;const x=y.getBoundingClientRect();return _<x.left||_>x.right||w<x.top||w>x.bottom?null:_<(x.left+x.right)/2?"left":"right"},[]);if(v.useEffect(()=>{if(!t||!e)return;const _=p(e.x,e.y);c(w=>w===_?w:_)},[t,e,p]),v.useEffect(()=>{if(!t)return;const _=w=>{const y=p(w.clientX,w.clientY);if(y&&t.url){const x={sessionId:t.sessionId,variantId:t.variantId,label:t.label,url:t.url,source:t.source},S=n==null?void 0:n[y];S&&(S.sessionId!==x.sessionId||S.variantId!==x.variantId)&&cf(S);const P={...n??{},[y]:x};s(P);const T=Zm(n?"updated":"started",P);i==null||i.capture(T.event,T.properties),h("exiting"),window.setTimeout(()=>r(null),220)}else cf(t),h("exiting"),window.setTimeout(()=>r(null),220)};return window.addEventListener("pointerup",_),window.addEventListener("pointercancel",_),()=>{window.removeEventListener("pointerup",_),window.removeEventListener("pointercancel",_)}},[t,p,i,r,s,n]),!t)return null;const m=["variant-drop-zones",d==="visible"&&"is-visible",d==="exiting"&&"is-exiting"].filter(Boolean).join(" ");return E.jsxs("div",{ref:a,className:m,"aria-hidden":"true",children:[E.jsx(a8,{side:"left",hovered:u==="left",canDrop:!!t.url,label:t.label}),E.jsx(a8,{side:"right",hovered:u==="right",canDrop:!!t.url,label:t.label})]})}function a8({side:t,hovered:e,canDrop:n,label:r}){return E.jsxs("div",{className:["variant-drop-zone",`is-${t}`,e&&"is-hover",!n&&"is-disabled"].filter(Boolean).join(" "),children:[E.jsxs("div",{className:"variant-drop-zone-inner",children:[E.jsx("div",{className:`variant-drop-zone-icon is-${t}`}),E.jsx("div",{className:"variant-drop-zone-caption",children:n?`Add ${t} split`:"Split unavailable for this direction"})]}),E.jsx("div",{className:"variant-drop-zone-preview","aria-hidden":"true",children:E.jsx("div",{className:"variant-drop-zone-preview-label",children:r})}),E.jsx("div",{className:"variant-drop-zone-border"})]})}const PA=(t,e,n)=>{var i,a;if(!t.active||t.sessionId!==e)return null;const r=t.variants.find(u=>u.workItemId===n);if(((i=r==null?void 0:r.preview)==null?void 0:i.kind)!=="static_artifact")return null;if(((a=r.refinement)==null?void 0:a.status)!=="succeeded")return r.preview.url;const s=r.preview.url.includes("?")?"&":"?";return`${r.preview.url}${s}refinement=${encodeURIComponent(r.refinement.workItemId)}`},l8=(t,e)=>{if(!t)return;const n=PA(e,t.sessionId,t.variantId);return!n||n===t.url?t:{...t,url:n}},kK=()=>E.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:E.jsx("div",{className:"border-main-border relative min-h-0 flex-1 overflow-hidden rounded-lg border",children:E.jsx(xA,{trackGlobalLoaderCount:!1})})}),PK=({isLoading:t=!1,isInteractionDisabled:e=!1})=>{const{config:n,fetchConfig:r,isLoading:s,error:i}=VG();return v.useEffect(()=>{r().catch(a=>{Se==null||Se.capture("preview_config_load_failed",{message:a instanceof Error?a.message:"unknown_error",attempts:Q4})})},[r]),s?E.jsx(kK,{}):i||!n?E.jsx(Jw,{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:()=>{Se==null||Se.capture("preview_config_retry_clicked"),r().catch(a=>{Se==null||Se.capture("preview_config_load_failed",{message:a instanceof Error?a.message:"unknown_error",attempts:Q4})})}}]}):E.jsx(TK,{isLoading:t,isInteractionDisabled:e,framework:n.framework,userPort:n.userPort})};function TK(t){const e=et(ao),n=et(sf),r=et(If),s=et(Bm),i=e==null?void 0:e.left,a=e==null?void 0:e.right,u=v.useMemo(()=>{var R,M;if(!r.active||r.projectContext.kind!=="fresh"||!(!!i!=!!a))return;const y=(R=i??a)==null?void 0:R.variantId,x=r.variants.filter(L=>{var A;return L.status==="succeeded"&&((A=L.preview)==null?void 0:A.kind)==="static_artifact"&&L.workItemId!==y}),S=s==null?void 0:s.replace(/[?&]refinement=[^&]*$/,""),T=x.find(L=>{var A;return((A=L.preview)==null?void 0:A.kind)==="static_artifact"&&L.preview.url===S})??x[0];if(((M=T==null?void 0:T.preview)==null?void 0:M.kind)!=="static_artifact")return;const k=PA(r,r.sessionId,T.workItemId);if(k)return{sessionId:r.sessionId,variantId:T.workItemId,label:T.label,url:k,source:"live"}},[r,i,a,s]),c=l8(i,r)??(a?u:void 0),d=l8(a,r)??(i?u:void 0),h=!i&&!!c,p=!a&&!!d,m=!!(c||d),_=E.jsx(SK,{isInteractionDisabled:t.isInteractionDisabled,framework:t.framework,userPort:t.userPort});return E.jsx("div",{className:"relative flex h-full min-h-0 w-full flex-1 flex-col",children:E.jsxs("div",{className:`variant-preview-region relative flex h-full min-h-0 w-full flex-1 flex-col ${n?"is-dragging":""} ${m?"is-split":""}`,children:[E.jsxs("div",{className:"variant-preview-row flex h-full min-h-0 w-full flex-1",children:[c&&E.jsx(i8,{side:"left",sessionId:c.sessionId,variantId:c.variantId,url:c.url,label:c.label,source:c.source,isFallback:h},`left-${c.sessionId}:${c.variantId}:${c.url}`),!(c&&d)&&E.jsx("div",{className:"variant-preview-primary flex h-full min-h-0 flex-1 flex-col",children:_}),d&&E.jsx(i8,{side:"right",sessionId:d.sessionId,variantId:d.variantId,url:d.url,label:d.label,source:d.source,isFallback:p},`right-${d.sessionId}:${d.variantId}:${d.url}`)]}),E.jsx("div",{className:"variant-preview-atmosphere","aria-hidden":"true"}),E.jsx(CK,{}),E.jsx(EK,{})]})})}function Bi(t){if(t===void 0)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return t}function TA(t,e){t.prototype=Object.create(e.prototype),t.prototype.constructor=t,t.__proto__=e}/*!
116
- * GSAP 3.15.0
117
- * https://gsap.com
118
- *
119
- * @license Copyright 2008-2026, GreenSock. All rights reserved.
120
- * Subject to the terms at https://gsap.com/standard-license
121
- * @author: Jack Doyle, jack@greensock.com
122
- */var ts={autoSleep:120,force3D:"auto",nullTargetWarn:1,units:{lineHeight:""}},df={duration:.5,overwrite:!1,delay:0},ex,zn,Bt,xs=1e8,kt=1/xs,Z_=Math.PI*2,RK=Z_/4,AK=0,RA=Math.sqrt,IK=Math.cos,MK=Math.sin,Mn=function(e){return typeof e=="string"},rn=function(e){return typeof e=="function"},uo=function(e){return typeof e=="number"},tx=function(e){return typeof e>"u"},yi=function(e){return typeof e=="object"},Ir=function(e){return e!==!1},nx=function(){return typeof window<"u"},kp=function(e){return rn(e)||Mn(e)},AA=typeof ArrayBuffer=="function"&&ArrayBuffer.isView||function(){},Jn=Array.isArray,OK=/random\([^)]+\)/g,LK=/,\s*/g,u8=/(?:-?\.?\d|\.)+/gi,IA=/[-+=.]*\d+[.e\-+]*\d*[e\-+]*\d*/g,ku=/[-+=.]*\d+[.e-]*\d*[a-z%]*/g,L1=/[-+=.]*\d+\.?\d*(?:e-|e\+)?\d*/gi,MA=/[+-]=-?[.\d]+/,DK=/[^,'"\[\]\s]+/gi,NK=/^[+\-=e\s\d]*\d+[.\d]*([a-z]*|%)\s*$/i,Yt,si,Y_,rx,rs={},Ym={},OA,LA=function(e){return(Ym=ac(e,rs))&&Dr},sx=function(e,n){return console.warn("Invalid property",e,"set to",n,"Missing plugin? gsap.registerPlugin()")},ff=function(e,n){return!n&&console.warn(e)},DA=function(e,n){return e&&(rs[e]=n)&&Ym&&(Ym[e]=n)||rs},hf=function(){return 0},jK={suppressEvents:!0,isStart:!0,kill:!1},Xp={suppressEvents:!0,kill:!1},FK={suppressEvents:!0},ix={},sa=[],X_={},NA,Gr={},D1={},c8=30,Qp=[],ox="",ax=function(e){var n=e[0],r,s;if(yi(n)||rn(n)||(e=[e]),!(r=(n._gsap||{}).harness)){for(s=Qp.length;s--&&!Qp[s].targetTest(n););r=Qp[s]}for(s=e.length;s--;)e[s]&&(e[s]._gsap||(e[s]._gsap=new sI(e[s],r)))||e.splice(s,1);return e},El=function(e){return e._gsap||ax(bs(e))[0]._gsap},jA=function(e,n,r){return(r=e[n])&&rn(r)?e[n]():tx(r)&&e.getAttribute&&e.getAttribute(n)||r},Mr=function(e,n){return(e=e.split(",")).forEach(n)||e},cn=function(e){return Math.round(e*1e5)/1e5||0},Zt=function(e){return Math.round(e*1e7)/1e7||0},Du=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},$K=function(e,n){for(var r=n.length,s=0;e.indexOf(n[s])<0&&++s<r;);return s<r},Xm=function(){var e=sa.length,n=sa.slice(0),r,s;for(X_={},sa.length=0,r=0;r<e;r++)s=n[r],s&&s._lazy&&(s.render(s._lazy[0],s._lazy[1],!0)._lazy=0)},lx=function(e){return!!(e._initted||e._startAt||e.add)},FA=function(e,n,r,s){sa.length&&!zn&&Xm(),e.render(n,r,!!(zn&&n<0&&lx(e))),sa.length&&!zn&&Xm()},$A=function(e){var n=parseFloat(e);return(n||n===0)&&(e+"").match(DK).length<2?n:Mn(e)?e.trim():e},VA=function(e){return e},ss=function(e,n){for(var r in n)r in e||(e[r]=n[r]);return e},VK=function(e){return function(n,r){for(var s in r)s in n||s==="duration"&&e||s==="ease"||(n[s]=r[s])}},ac=function(e,n){for(var r in n)e[r]=n[r];return e},d8=function t(e,n){for(var r in n)r!=="__proto__"&&r!=="constructor"&&r!=="prototype"&&(e[r]=yi(n[r])?t(e[r]||(e[r]={}),n[r]):n[r]);return e},Qm=function(e,n){var r={},s;for(s in e)s in n||(r[s]=e[s]);return r},Nd=function(e){var n=e.parent||Yt,r=e.keyframes?VK(Jn(e.keyframes)):ss;if(Ir(e.inherit))for(;n;)r(e,n.vars.defaults),n=n.parent||n._dp;return e},HK=function(e,n){for(var r=e.length,s=r===n.length;s&&r--&&e[r]===n[r];);return r<0},HA=function(e,n,r,s,i){var a=e[s],u;if(i)for(u=n[i];a&&a[i]>u;)a=a._prev;return a?(n._next=a._next,a._next=n):(n._next=e[r],e[r]=n),n._next?n._next._prev=n:e[s]=n,n._prev=a,n.parent=n._dp=e,n},I0=function(e,n,r,s){r===void 0&&(r="_first"),s===void 0&&(s="_last");var i=n._prev,a=n._next;i?i._next=a:e[r]===n&&(e[r]=a),a?a._prev=i:e[s]===n&&(e[s]=i),n._next=n._prev=n.parent=null},ha=function(e,n){e.parent&&(!n||e.parent.autoRemoveChildren)&&e.parent.remove&&e.parent.remove(e),e._act=0},Cl=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},zK=function(e){for(var n=e.parent;n&&n.parent;)n._dirty=1,n.totalDuration(),n=n.parent;return e},Q_=function(e,n,r,s){return e._startAt&&(zn?e._startAt.revert(Xp):e.vars.immediateRender&&!e.vars.autoRevert||e._startAt.render(n,!0,s))},UK=function t(e){return!e||e._ts&&t(e.parent)},f8=function(e){return e._repeat?lc(e._tTime,e=e.duration()+e._rDelay)*e:0},lc=function(e,n){var r=Math.floor(e=Zt(e/n));return e&&r===e?r-1:r},Jm=function(e,n){return(e-n._start)*n._ts+(n._ts>=0?0:n._dirty?n.totalDuration():n._tDur)},M0=function(e){return e._end=Zt(e._start+(e._tDur/Math.abs(e._ts||e._rts||kt)||0))},O0=function(e,n){var r=e._dp;return r&&r.smoothChildTiming&&e._ts&&(e._start=Zt(r._time-(e._ts>0?n/e._ts:((e._dirty?e.totalDuration():e._tDur)-n)/-e._ts)),M0(e),r._dirty||Cl(r,e)),e},zA=function(e,n){var r;if((n._time||!n._dur&&n._initted||n._start<e._time&&(n._dur||!n.add))&&(r=Jm(e.rawTime(),n),(!n._dur||Lf(0,n.totalDuration(),r)-n._tTime>kt)&&n.render(r,!0)),Cl(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}},ci=function(e,n,r,s){return n.parent&&ha(n),n._start=Zt((uo(r)?r:r||e!==Yt?vs(e,r,n):e._time)+n._delay),n._end=Zt(n._start+(n.totalDuration()/Math.abs(n.timeScale())||0)),HA(e,n,"_first","_last",e._sort?"_start":0),J_(n)||(e._recent=n),s||zA(e,n),e._ts<0&&O0(e,e._tTime),e},UA=function(e,n){return(rs.ScrollTrigger||sx("scrollTrigger",n))&&rs.ScrollTrigger.create(n,e)},BA=function(e,n,r,s,i){if(cx(e,n,i),!e._initted)return 1;if(!r&&e._pt&&!zn&&(e._dur&&e.vars.lazy!==!1||!e._dur&&e.vars.lazy)&&NA!==Zr.frame)return sa.push(e),e._lazy=[i,s],1},BK=function t(e){var n=e.parent;return n&&n._ts&&n._initted&&!n._lock&&(n.rawTime()<0||t(n))},J_=function(e){var n=e.data;return n==="isFromStart"||n==="isStart"},WK=function(e,n,r,s){var i=e.ratio,a=n<0||!n&&(!e._start&&BK(e)&&!(!e._initted&&J_(e))||(e._ts<0||e._dp._ts<0)&&!J_(e))?0:1,u=e._rDelay,c=0,d,h,p;if(u&&e._repeat&&(c=Lf(0,e._tDur,n),h=lc(c,u),e._yoyo&&h&1&&(a=1-a),h!==lc(e._tTime,u)&&(i=1-a,e.vars.repeatRefresh&&e._initted&&e.invalidate())),a!==i||zn||s||e._zTime===kt||!n&&e._zTime){if(!e._initted&&BA(e,n,s,r,c))return;for(p=e._zTime,e._zTime=n||(r?kt:0),r||(r=n&&!p),e.ratio=a,e._from&&(a=1-a),e._time=0,e._tTime=c,d=e._pt;d;)d.r(a,d.d),d=d._next;n<0&&Q_(e,n,r,!0),e._onUpdate&&!r&&Xr(e,"onUpdate"),c&&e._repeat&&!r&&e.parent&&Xr(e,"onRepeat"),(n>=e._tDur||n<0)&&e.ratio===a&&(a&&ha(e,1),!r&&!zn&&(Xr(e,a?"onComplete":"onReverseComplete",!0),e._prom&&e._prom()))}else e._zTime||(e._zTime=n)},qK=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}},uc=function(e,n,r,s){var i=e._repeat,a=Zt(n)||0,u=e._tTime/e._tDur;return u&&!s&&(e._time*=a/e._dur),e._dur=a,e._tDur=i?i<0?1e10:Zt(a*(i+1)+e._rDelay*i):a,u>0&&!s&&O0(e,e._tTime=e._tDur*u),e.parent&&M0(e),r||Cl(e.parent,e),e},h8=function(e){return e instanceof kr?Cl(e):uc(e,e._dur)},GK={_start:0,endTime:hf,totalDuration:hf},vs=function t(e,n,r){var s=e.labels,i=e._recent||GK,a=e.duration()>=xs?i.endTime(!1):e._dur,u,c,d;return Mn(n)&&(isNaN(n)||n in s)?(c=n.charAt(0),d=n.substr(-1)==="%",u=n.indexOf("="),c==="<"||c===">"?(u>=0&&(n=n.replace(/=/,"")),(c==="<"?i._start:i.endTime(i._repeat>=0))+(parseFloat(n.substr(1))||0)*(d?(u<0?i:r).totalDuration()/100:1)):u<0?(n in s||(s[n]=a),s[n]):(c=parseFloat(n.charAt(u-1)+n.substr(u+1)),d&&r&&(c=c/100*(Jn(r)?r[0]:r).totalDuration()),u>1?t(e,n.substr(0,u-1),r)+c:a+c)):n==null?a:+n},jd=function(e,n,r){var s=uo(n[1]),i=(s?2:1)+(e<2?0:1),a=n[i],u,c;if(s&&(a.duration=n[1]),a.parent=r,e){for(u=a,c=r;c&&!("immediateRender"in u);)u=c.vars.defaults||{},c=Ir(c.vars.inherit)&&c.parent;a.immediateRender=Ir(u.immediateRender),e<2?a.runBackwards=1:a.startAt=n[i-1]}return new yn(n[0],a,n[i+1])},ba=function(e,n){return e||e===0?n(e):n},Lf=function(e,n,r){return r<e?e:r>n?n:r},Xn=function(e,n){return!Mn(e)||!(n=NK.exec(e))?"":n[1]},KK=function(e,n,r){return ba(r,function(s){return Lf(e,n,s)})},e2=[].slice,WA=function(e,n){return e&&yi(e)&&"length"in e&&(!n&&!e.length||e.length-1 in e&&yi(e[0]))&&!e.nodeType&&e!==si},ZK=function(e,n,r){return r===void 0&&(r=[]),e.forEach(function(s){var i;return Mn(s)&&!n||WA(s,1)?(i=r).push.apply(i,bs(s)):r.push(s)})||r},bs=function(e,n,r){return Bt&&!n&&Bt.selector?Bt.selector(e):Mn(e)&&!r&&(Y_||!cc())?e2.call((n||rx).querySelectorAll(e),0):Jn(e)?ZK(e,r):WA(e)?e2.call(e,0):e?[e]:[]},t2=function(e){return e=bs(e)[0]||ff("Invalid scope")||{},function(n){var r=e.current||e.nativeElement||e;return bs(n,r.querySelectorAll?r:r===e?ff("Invalid scope")||rx.createElement("div"):e)}},qA=function(e){return e.sort(function(){return .5-Math.random()})},GA=function(e){if(rn(e))return e;var n=yi(e)?e:{each:e},r=kl(n.ease),s=n.from||0,i=parseFloat(n.base)||0,a={},u=s>0&&s<1,c=isNaN(s)||u,d=n.axis,h=s,p=s;return Mn(s)?h=p={center:.5,edges:.5,end:1}[s]||0:!u&&c&&(h=s[0],p=s[1]),function(m,_,w){var y=(w||n).length,x=a[y],S,P,T,k,R,M,L,A,O;if(!x){if(O=n.grid==="auto"?0:(n.grid||[1,xs])[1],!O){for(L=-xs;L<(L=w[O++].getBoundingClientRect().left)&&O<y;);O<y&&O--}for(x=a[y]=[],S=c?Math.min(O,y)*h-.5:s%O,P=O===xs?0:c?y*p/O-.5:s/O|0,L=0,A=xs,M=0;M<y;M++)T=M%O-S,k=P-(M/O|0),x[M]=R=d?Math.abs(d==="y"?k:T):RA(T*T+k*k),R>L&&(L=R),R<A&&(A=R);s==="random"&&qA(x),x.max=L-A,x.min=A,x.v=y=(parseFloat(n.amount)||parseFloat(n.each)*(O>y?y-1:d?d==="y"?y/O:O:Math.max(O,y/O))||0)*(s==="edges"?-1:1),x.b=y<0?i-y:i,x.u=Xn(n.amount||n.each)||0,r=r&&y<0?lZ(r):r}return y=(x[m]-x.min)/x.max||0,Zt(x.b+(r?r(y):y)*x.v)+x.u}},n2=function(e){var n=Math.pow(10,((e+"").split(".")[1]||"").length);return function(r){var s=Zt(Math.round(parseFloat(r)/e)*e*n);return(s-s%1)/n+(uo(r)?0:Xn(r))}},KA=function(e,n){var r=Jn(e),s,i;return!r&&yi(e)&&(s=r=e.radius||xs,e.values?(e=bs(e.values),(i=!uo(e[0]))&&(s*=s)):e=n2(e.increment)),ba(n,r?rn(e)?function(a){return i=e(a),Math.abs(i-a)<=s?i:a}:function(a){for(var u=parseFloat(i?a.x:a),c=parseFloat(i?a.y:0),d=xs,h=0,p=e.length,m,_;p--;)i?(m=e[p].x-u,_=e[p].y-c,m=m*m+_*_):m=Math.abs(e[p]-u),m<d&&(d=m,h=p);return h=!s||d<=s?e[h]:a,i||h===a||uo(a)?h:h+Xn(a)}:n2(e))},ZA=function(e,n,r,s){return ba(Jn(e)?!n:r===!0?!!(r=0):!s,function(){return Jn(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})},YK=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,a){return a(i)},s)}},XK=function(e,n){return function(r){return e(parseFloat(r))+(n||Xn(r))}},QK=function(e,n,r){return XA(e,n,0,1,r)},YA=function(e,n,r){return ba(r,function(s){return e[~~n(s)]})},JK=function t(e,n,r){var s=n-e;return Jn(e)?YA(e,t(0,e.length),n):ba(r,function(i){return(s+(i-e)%s)%s+e})},eZ=function t(e,n,r){var s=n-e,i=s*2;return Jn(e)?YA(e,t(0,e.length-1),n):ba(r,function(a){return a=(i+(a-e)%i)%i||0,e+(a>s?i-a:a)})},pf=function(e){return e.replace(OK,function(n){var r=n.indexOf("[")+1,s=n.substring(r||7,r?n.indexOf("]"):n.length-1).split(LK);return ZA(r?s:+s[0],r?0:+s[1],+s[2]||1e-5)})},XA=function(e,n,r,s,i){var a=n-e,u=s-r;return ba(i,function(c){return r+((c-e)/a*u||0)})},tZ=function t(e,n,r,s){var i=isNaN(e+n)?0:function(_){return(1-_)*e+_*n};if(!i){var a=Mn(e),u={},c,d,h,p,m;if(r===!0&&(s=1)&&(r=null),a)e={p:e},n={p:n};else if(Jn(e)&&!Jn(n)){for(h=[],p=e.length,m=p-2,d=1;d<p;d++)h.push(t(e[d-1],e[d]));p--,i=function(w){w*=p;var y=Math.min(m,~~w);return h[y](w-y)},r=n}else s||(e=ac(Jn(e)?[]:{},e));if(!h){for(c in n)ux.call(u,e,c,"get",n[c]);i=function(w){return hx(w,u)||(a?e.p:e)}}}return ba(r,i)},p8=function(e,n,r){var s=e.labels,i=xs,a,u,c;for(a in s)u=s[a]-n,u<0==!!r&&u&&i>(u=Math.abs(u))&&(c=a,i=u);return c},Xr=function(e,n,r){var s=e.vars,i=s[n],a=Bt,u=e._ctx,c,d,h;if(i)return c=s[n+"Params"],d=s.callbackScope||e,r&&sa.length&&Xm(),u&&(Bt=u),h=c?i.apply(d,c):i.call(d),Bt=a,h},bd=function(e){return ha(e),e.scrollTrigger&&e.scrollTrigger.kill(!!zn),e.progress()<1&&Xr(e,"onInterrupt"),e},Pu,QA=[],JA=function(e){if(e)if(e=!e.name&&e.default||e,nx()||e.headless){var n=e.name,r=rn(e),s=n&&!r&&e.init?function(){this._props=[]}:e,i={init:hf,render:hx,add:ux,kill:yZ,modifier:vZ,rawVars:0},a={targetTest:0,get:0,getSetter:fx,aliases:{},register:0};if(cc(),e!==s){if(Gr[n])return;ss(s,ss(Qm(e,i),a)),ac(s.prototype,ac(i,Qm(e,a))),Gr[s.prop=n]=s,e.targetTest&&(Qp.push(s),ix[n]=1),n=(n==="css"?"CSS":n.charAt(0).toUpperCase()+n.substr(1))+"Plugin"}DA(n,s),e.register&&e.register(Dr,s,Or)}else QA.push(e)},Et=255,Sd={aqua:[0,Et,Et],lime:[0,Et,0],silver:[192,192,192],black:[0,0,0],maroon:[128,0,0],teal:[0,128,128],blue:[0,0,Et],navy:[0,0,128],white:[Et,Et,Et],olive:[128,128,0],yellow:[Et,Et,0],orange:[Et,165,0],gray:[128,128,128],purple:[128,0,128],green:[0,128,0],red:[Et,0,0],pink:[Et,192,203],cyan:[0,Et,Et],transparent:[Et,Et,Et,0]},N1=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)*Et+.5|0},eI=function(e,n,r){var s=e?uo(e)?[e>>16,e>>8&Et,e&Et]:0:Sd.black,i,a,u,c,d,h,p,m,_,w;if(!s){if(e.substr(-1)===","&&(e=e.substr(0,e.length-1)),Sd[e])s=Sd[e];else if(e.charAt(0)==="#"){if(e.length<6&&(i=e.charAt(1),a=e.charAt(2),u=e.charAt(3),e="#"+i+i+a+a+u+u+(e.length===5?e.charAt(4)+e.charAt(4):"")),e.length===9)return s=parseInt(e.substr(1,6),16),[s>>16,s>>8&Et,s&Et,parseInt(e.substr(7),16)/255];e=parseInt(e.substr(1),16),s=[e>>16,e>>8&Et,e&Et]}else if(e.substr(0,3)==="hsl"){if(s=w=e.match(u8),!n)c=+s[0]%360/360,d=+s[1]/100,h=+s[2]/100,a=h<=.5?h*(d+1):h+d-h*d,i=h*2-a,s.length>3&&(s[3]*=1),s[0]=N1(c+1/3,i,a),s[1]=N1(c,i,a),s[2]=N1(c-1/3,i,a);else if(~e.indexOf("="))return s=e.match(IA),r&&s.length<4&&(s[3]=1),s}else s=e.match(u8)||Sd.transparent;s=s.map(Number)}return n&&!w&&(i=s[0]/Et,a=s[1]/Et,u=s[2]/Et,p=Math.max(i,a,u),m=Math.min(i,a,u),h=(p+m)/2,p===m?c=d=0:(_=p-m,d=h>.5?_/(2-p-m):_/(p+m),c=p===i?(a-u)/_+(a<u?6:0):p===a?(u-i)/_+2:(i-a)/_+4,c*=60),s[0]=~~(c+.5),s[1]=~~(d*100+.5),s[2]=~~(h*100+.5)),r&&s.length<4&&(s[3]=1),s},tI=function(e){var n=[],r=[],s=-1;return e.split(ia).forEach(function(i){var a=i.match(ku)||[];n.push.apply(n,a),r.push(s+=a.length+1)}),n.c=r,n},m8=function(e,n,r){var s="",i=(e+s).match(ia),a=n?"hsla(":"rgba(",u=0,c,d,h,p;if(!i)return e;if(i=i.map(function(m){return(m=eI(m,n,1))&&a+(n?m[0]+","+m[1]+"%,"+m[2]+"%,"+m[3]:m.join(","))+")"}),r&&(h=tI(e),c=r.c,c.join(s)!==h.c.join(s)))for(d=e.replace(ia,"1").split(ku),p=d.length-1;u<p;u++)s+=d[u]+(~c.indexOf(u)?i.shift()||a+"0,0,0,0)":(h.length?h:i.length?i:r).shift());if(!d)for(d=e.split(ia),p=d.length-1;u<p;u++)s+=d[u]+i[u];return s+d[p]},ia=(function(){var t="(?:\\b(?:(?:rgb|rgba|hsl|hsla)\\(.+?\\))|\\B#(?:[0-9a-f]{3,4}){1,2}\\b",e;for(e in Sd)t+="|"+e+"\\b";return new RegExp(t+")","gi")})(),nZ=/hsl[a]?\(/,nI=function(e){var n=e.join(" "),r;if(ia.lastIndex=0,ia.test(n))return r=nZ.test(n),e[1]=m8(e[1],r),e[0]=m8(e[0],r,tI(e[1])),!0},mf,Zr=(function(){var t=Date.now,e=500,n=33,r=t(),s=r,i=1e3/240,a=i,u=[],c,d,h,p,m,_,w=function y(x){var S=t()-s,P=x===!0,T,k,R,M;if((S>e||S<0)&&(r+=S-n),s+=S,R=s-r,T=R-a,(T>0||P)&&(M=++p.frame,m=R-p.time*1e3,p.time=R=R/1e3,a+=T+(T>=i?4:i-T),k=1),P||(c=d(y)),k)for(_=0;_<u.length;_++)u[_](R,m,M,x)};return p={time:0,frame:0,tick:function(){w(!0)},deltaRatio:function(x){return m/(1e3/(x||60))},wake:function(){OA&&(!Y_&&nx()&&(si=Y_=window,rx=si.document||{},rs.gsap=Dr,(si.gsapVersions||(si.gsapVersions=[])).push(Dr.version),LA(Ym||si.GreenSockGlobals||!si.gsap&&si||{}),QA.forEach(JA)),h=typeof requestAnimationFrame<"u"&&requestAnimationFrame,c&&p.sleep(),d=h||function(x){return setTimeout(x,a-p.time*1e3+1|0)},mf=1,w(2))},sleep:function(){(h?cancelAnimationFrame:clearTimeout)(c),mf=0,d=hf},lagSmoothing:function(x,S){e=x||1/0,n=Math.min(S||33,e)},fps:function(x){i=1e3/(x||240),a=p.time*1e3+i},add:function(x,S,P){var T=S?function(k,R,M,L){x(k,R,M,L),p.remove(T)}:x;return p.remove(x),u[P?"unshift":"push"](T),cc(),T},remove:function(x,S){~(S=u.indexOf(x))&&u.splice(S,1)&&_>=S&&_--},_listeners:u},p})(),cc=function(){return!mf&&Zr.wake()},ct={},rZ=/^[\d.\-M][\d.\-,\s]/,sZ=/["']/g,iZ=function(e){for(var n={},r=e.substr(1,e.length-3).split(":"),s=r[0],i=1,a=r.length,u,c,d;i<a;i++)c=r[i],u=i!==a-1?c.lastIndexOf(","):c.length,d=c.substr(0,u),n[s]=isNaN(d)?d.replace(sZ,"").trim():+d,s=c.substr(u+1).trim();return n},oZ=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)},aZ=function(e){var n=(e+"").split("("),r=ct[n[0]];return r&&n.length>1&&r.config?r.config.apply(null,~e.indexOf("{")?[iZ(n[1])]:oZ(e).split(",").map($A)):ct._CE&&rZ.test(e)?ct._CE("",e):r},lZ=function(e){return function(n){return 1-e(1-n)}},kl=function(e,n){return e&&(rn(e)?e:ct[e]||aZ(e))||n},Ol=function(e,n,r,s){r===void 0&&(r=function(c){return 1-n(1-c)}),s===void 0&&(s=function(c){return c<.5?n(c*2)/2:1-n((1-c)*2)/2});var i={easeIn:n,easeOut:r,easeInOut:s},a;return Mr(e,function(u){ct[u]=rs[u]=i,ct[a=u.toLowerCase()]=r;for(var c in i)ct[a+(c==="easeIn"?".in":c==="easeOut"?".out":".inOut")]=ct[u+"."+c]=i[c]}),i},rI=function(e){return function(n){return n<.5?(1-e(1-n*2))/2:.5+e((n-.5)*2)/2}},j1=function t(e,n,r){var s=n>=1?n:1,i=(r||(e?.3:.45))/(n<1?n:1),a=i/Z_*(Math.asin(1/s)||0),u=function(h){return h===1?1:s*Math.pow(2,-10*h)*MK((h-a)*i)+1},c=e==="out"?u:e==="in"?function(d){return 1-u(1-d)}:rI(u);return i=Z_/i,c.config=function(d,h){return t(e,d,h)},c},F1=function t(e,n){n===void 0&&(n=1.70158);var r=function(a){return a?--a*a*((n+1)*a+n)+1:0},s=e==="out"?r:e==="in"?function(i){return 1-r(1-i)}:rI(r);return s.config=function(i){return t(e,i)},s};Mr("Linear,Quad,Cubic,Quart,Quint,Strong",function(t,e){var n=e<5?e+1:e;Ol(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})});ct.Linear.easeNone=ct.none=ct.Linear.easeIn;Ol("Elastic",j1("in"),j1("out"),j1());(function(t,e){var n=1/e,r=2*n,s=2.5*n,i=function(u){return u<n?t*u*u:u<r?t*Math.pow(u-1.5/e,2)+.75:u<s?t*(u-=2.25/e)*u+.9375:t*Math.pow(u-2.625/e,2)+.984375};Ol("Bounce",function(a){return 1-i(1-a)},i)})(7.5625,2.75);Ol("Expo",function(t){return Math.pow(2,10*(t-1))*t+t*t*t*t*t*t*(1-t)});Ol("Circ",function(t){return-(RA(1-t*t)-1)});Ol("Sine",function(t){return t===1?1:-IK(t*RK)+1});Ol("Back",F1("in"),F1("out"),F1());ct.SteppedEase=ct.steps=rs.SteppedEase={config:function(e,n){e===void 0&&(e=1);var r=1/e,s=e+(n?0:1),i=n?1:0,a=1-kt;return function(u){return((s*Lf(0,a,u)|0)+i)*r}}};df.ease=ct["quad.out"];Mr("onComplete,onUpdate,onStart,onRepeat,onReverseComplete,onInterrupt",function(t){return ox+=t+","+t+"Params,"});var sI=function(e,n){this.id=AK++,e._gsap=this,this.target=e,this.harness=n,this.get=n?n.get:jA,this.set=n?n.getSetter:fx},gf=(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,uc(this,+n.duration,1,1),this.data=n.data,Bt&&(this._ctx=Bt,Bt.data.push(this)),mf||Zr.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,uc(this,this._repeat<0?r:(r-this._repeat*this._rDelay)/(this._repeat+1))):this._tDur},e.totalTime=function(r,s){if(cc(),!arguments.length)return this._tTime;var i=this._dp;if(i&&i.smoothChildTiming&&this._ts){for(O0(this,r),!i._dp||i.parent||zA(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)&&ci(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),FA(this,r,s)),this},e.time=function(r,s){return arguments.length?this.totalTime(Math.min(this.totalDuration(),r+f8(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)+f8(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?lc(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?Jm(this.parent._time,this):this._tTime;return this._rts=+r||0,this._ts=this._ps||r===-kt?0:this._rts,this.totalTime(Lf(-Math.abs(this._delay),this.totalDuration(),i),s!==!1),M0(this),zK(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):(cc(),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=Zt(r);var s=this.parent||this._dp;return s&&(s._sort||!this.parent)&&ci(s,this,this._start-this._delay),this}return this._start},e.endTime=function(r){return this._start+(Ir(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?Jm(s.rawTime(r),this):this._tTime:this._tTime},e.revert=function(r){r===void 0&&(r=FK);var s=zn;return zn=r,lx(this)&&(this.timeline&&this.timeline.revert(r),this.totalTime(-.01,r.suppressEvents)),this.data!=="nested"&&r.kill!==!1&&this.kill(),zn=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,h8(this)):this._repeat===-2?1/0:this._repeat},e.repeatDelay=function(r){if(arguments.length){var s=this._time;return this._rDelay=r,h8(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(vs(this,r),Ir(s))},e.restart=function(r,s){return this.play().totalTime(r?-this._delay:0,Ir(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 a=this.vars;return arguments.length>1?(s?(a[r]=s,i&&(a[r+"Params"]=i),r==="onUpdate"&&(this._onUpdate=s)):delete a[r],this):a[r]},e.then=function(r){var s=this,i=s._prom;return new Promise(function(a){var u=rn(r)?r:VA,c=function(){var h=s.then;s.then=null,i&&i(),rn(u)&&(u=u(s))&&(u.then||u===s)&&(s.then=h),a(u),s.then=h};s._initted&&s.totalProgress()===1&&s._ts>=0||!s._tTime&&s._ts<0?c():s._prom=c})},e.kill=function(){bd(this)},t})();ss(gf.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 kr=(function(t){TA(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=Ir(r.sortChildren),Yt&&ci(r.parent||Yt,Bi(i),s),r.reversed&&i.reverse(),r.paused&&i.paused(!0),r.scrollTrigger&&UA(Bi(i),r.scrollTrigger),i}var n=e.prototype;return n.to=function(s,i,a){return jd(0,arguments,this),this},n.from=function(s,i,a){return jd(1,arguments,this),this},n.fromTo=function(s,i,a,u){return jd(2,arguments,this),this},n.set=function(s,i,a){return i.duration=0,i.parent=this,Nd(i).repeatDelay||(i.repeat=0),i.immediateRender=!!i.immediateRender,new yn(s,i,vs(this,a),1),this},n.call=function(s,i,a){return ci(this,yn.delayedCall(0,s,i),a)},n.staggerTo=function(s,i,a,u,c,d,h){return a.duration=i,a.stagger=a.stagger||u,a.onComplete=d,a.onCompleteParams=h,a.parent=this,new yn(s,a,vs(this,c)),this},n.staggerFrom=function(s,i,a,u,c,d,h){return a.runBackwards=1,Nd(a).immediateRender=Ir(a.immediateRender),this.staggerTo(s,i,a,u,c,d,h)},n.staggerFromTo=function(s,i,a,u,c,d,h,p){return u.startAt=a,Nd(u).immediateRender=Ir(u.immediateRender),this.staggerTo(s,i,u,c,d,h,p)},n.render=function(s,i,a){var u=this._time,c=this._dirty?this.totalDuration():this._tDur,d=this._dur,h=s<=0?0:Zt(s),p=this._zTime<0!=s<0&&(this._initted||!d),m,_,w,y,x,S,P,T,k,R,M,L;if(this!==Yt&&h>c&&s>=0&&(h=c),h!==this._tTime||a||p){if(u!==this._time&&d&&(h+=this._time-u,s+=this._time-u),m=h,k=this._start,T=this._ts,S=!T,p&&(d||(u=this._zTime),(s||!i)&&(this._zTime=s)),this._repeat){if(M=this._yoyo,x=d+this._rDelay,this._repeat<-1&&s<0)return this.totalTime(x*100+s,i,a);if(m=Zt(h%x),h===c?(y=this._repeat,m=d):(R=Zt(h/x),y=~~R,y&&y===R&&(m=d,y--),m>d&&(m=d)),R=lc(this._tTime,x),!u&&this._tTime&&R!==y&&this._tTime-R*x-this._dur<=0&&(R=y),M&&y&1&&(m=d-m,L=1),y!==R&&!this._lock){var A=M&&R&1,O=A===(M&&y&1);if(y<R&&(A=!A),u=A?0:h%d?d:h,this._lock=1,this.render(u||(L?0:Zt(y*x)),i,!d)._lock=0,this._tTime=h,!i&&this.parent&&Xr(this,"onRepeat"),this.vars.repeatRefresh&&!L&&(this.invalidate()._lock=1,R=y),u&&u!==this._time||S!==!this._ts||this.vars.onRepeat&&!this.parent&&!this._act)return this;if(d=this._dur,c=this._tDur,O&&(this._lock=2,u=A?d:-1e-4,this.render(u,!0),this.vars.repeatRefresh&&!L&&this.invalidate()),this._lock=0,!this._ts&&!S)return this}}if(this._hasPause&&!this._forcing&&this._lock<2&&(P=qK(this,Zt(u),Zt(m)),P&&(h-=m-(m=P._start))),this._tTime=h,this._time=m,this._act=!!T,this._initted||(this._onUpdate=this.vars.onUpdate,this._initted=1,this._zTime=s,u=0),!u&&h&&d&&!i&&!R&&(Xr(this,"onStart"),this._tTime!==h))return this;if(m>=u&&s>=0)for(_=this._first;_;){if(w=_._next,(_._act||m>=_._start)&&_._ts&&P!==_){if(_.parent!==this)return this.render(s,i,a);if(_.render(_._ts>0?(m-_._start)*_._ts:(_._dirty?_.totalDuration():_._tDur)+(m-_._start)*_._ts,i,a),m!==this._time||!this._ts&&!S){P=0,w&&(h+=this._zTime=-kt);break}}_=w}else{_=this._last;for(var D=s<0?s:m;_;){if(w=_._prev,(_._act||D<=_._end)&&_._ts&&P!==_){if(_.parent!==this)return this.render(s,i,a);if(_.render(_._ts>0?(D-_._start)*_._ts:(_._dirty?_.totalDuration():_._tDur)+(D-_._start)*_._ts,i,a||zn&&lx(_)),m!==this._time||!this._ts&&!S){P=0,w&&(h+=this._zTime=D?-kt:kt);break}}_=w}}if(P&&!i&&(this.pause(),P.render(m>=u?0:-kt)._zTime=m>=u?1:-1,this._ts))return this._start=k,M0(this),this.render(s,i,a);this._onUpdate&&!i&&Xr(this,"onUpdate",!0),(h===c&&this._tTime>=this.totalDuration()||!h&&u)&&(k===this._start||Math.abs(T)!==Math.abs(this._ts))&&(this._lock||((s||!d)&&(h===c&&this._ts>0||!h&&this._ts<0)&&ha(this,1),!i&&!(s<0&&!u)&&(h||u||!c)&&(Xr(this,h===c&&s>=0?"onComplete":"onReverseComplete",!0),this._prom&&!(h<c&&this.timeScale()>0)&&this._prom())))}return this},n.add=function(s,i){var a=this;if(uo(i)||(i=vs(this,i,s)),!(s instanceof gf)){if(Jn(s))return s.forEach(function(u){return a.add(u,i)}),this;if(Mn(s))return this.addLabel(s,i);if(rn(s))s=yn.delayedCall(0,s);else return this}return this!==s?ci(this,s,i):this},n.getChildren=function(s,i,a,u){s===void 0&&(s=!0),i===void 0&&(i=!0),a===void 0&&(a=!0),u===void 0&&(u=-xs);for(var c=[],d=this._first;d;)d._start>=u&&(d instanceof yn?i&&c.push(d):(a&&c.push(d),s&&c.push.apply(c,d.getChildren(!0,i,a)))),d=d._next;return c},n.getById=function(s){for(var i=this.getChildren(1,1,1),a=i.length;a--;)if(i[a].vars.id===s)return i[a]},n.remove=function(s){return Mn(s)?this.removeLabel(s):rn(s)?this.killTweensOf(s):(s.parent===this&&I0(this,s),s===this._recent&&(this._recent=this._last),Cl(this))},n.totalTime=function(s,i){return arguments.length?(this._forcing=1,!this._dp&&this._ts&&(this._start=Zt(Zr.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]=vs(this,i),this},n.removeLabel=function(s){return delete this.labels[s],this},n.addPause=function(s,i,a){var u=yn.delayedCall(0,i||hf,a);return u.data="isPause",this._hasPause=1,ci(this,u,vs(this,s))},n.removePause=function(s){var i=this._first;for(s=vs(this,s);i;)i._start===s&&i.data==="isPause"&&ha(i),i=i._next},n.killTweensOf=function(s,i,a){for(var u=this.getTweensOf(s,a),c=u.length;c--;)Qo!==u[c]&&u[c].kill(s,i);return this},n.getTweensOf=function(s,i){for(var a=[],u=bs(s),c=this._first,d=uo(i),h;c;)c instanceof yn?$K(c._targets,u)&&(d?(!Qo||c._initted&&c._ts)&&c.globalTime(0)<=i&&c.globalTime(c.totalDuration())>i:!i||c.isActive())&&a.push(c):(h=c.getTweensOf(u,i)).length&&a.push.apply(a,h),c=c._next;return a},n.tweenTo=function(s,i){i=i||{};var a=this,u=vs(a,s),c=i,d=c.startAt,h=c.onStart,p=c.onStartParams,m=c.immediateRender,_,w=yn.to(a,ss({ease:i.ease||"none",lazy:!1,immediateRender:!1,time:u,overwrite:"auto",duration:i.duration||Math.abs((u-(d&&"time"in d?d.time:a._time))/a.timeScale())||kt,onStart:function(){if(a.pause(),!_){var x=i.duration||Math.abs((u-(d&&"time"in d?d.time:a._time))/a.timeScale());w._dur!==x&&uc(w,x,0,1).render(w._time,!0,!0),_=1}h&&h.apply(w,p||[])}},i));return m?w.render(0):w},n.tweenFromTo=function(s,i,a){return this.tweenTo(i,ss({startAt:{time:vs(this,s)}},a))},n.recent=function(){return this._recent},n.nextLabel=function(s){return s===void 0&&(s=this._time),p8(this,vs(this,s))},n.previousLabel=function(s){return s===void 0&&(s=this._time),p8(this,vs(this,s),1)},n.currentLabel=function(s){return arguments.length?this.seek(s,!0):this.previousLabel(this._time+kt)},n.shiftChildren=function(s,i,a){a===void 0&&(a=0);var u=this._first,c=this.labels,d;for(s=Zt(s);u;)u._start>=a&&(u._start+=s,u._end+=s),u=u._next;if(i)for(d in c)c[d]>=a&&(c[d]+=s);return Cl(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,a;i;)a=i._next,this.remove(i),i=a;return this._dp&&(this._time=this._tTime=this._pTime=0),s&&(this.labels={}),Cl(this)},n.totalDuration=function(s){var i=0,a=this,u=a._last,c=xs,d,h,p;if(arguments.length)return a.timeScale((a._repeat<0?a.duration():a.totalDuration())/(a.reversed()?-s:s));if(a._dirty){for(p=a.parent;u;)d=u._prev,u._dirty&&u.totalDuration(),h=u._start,h>c&&a._sort&&u._ts&&!a._lock?(a._lock=1,ci(a,u,h-u._delay,1)._lock=0):c=h,h<0&&u._ts&&(i-=h,(!p&&!a._dp||p&&p.smoothChildTiming)&&(a._start+=Zt(h/a._ts),a._time-=h,a._tTime-=h),a.shiftChildren(-h,!1,-1/0),c=0),u._end>i&&u._ts&&(i=u._end),u=d;uc(a,a===Yt&&a._time>i?a._time:i,1,1),a._dirty=0}return a._tDur},e.updateRoot=function(s){if(Yt._ts&&(FA(Yt,Jm(s,Yt)),NA=Zr.frame),Zr.frame>=c8){c8+=ts.autoSleep||120;var i=Yt._first;if((!i||!i._ts)&&ts.autoSleep&&Zr._listeners.length<2){for(;i&&!i._ts;)i=i._next;i||Zr.sleep()}}},e})(gf);ss(kr.prototype,{_lock:0,_hasPause:0,_forcing:0});var uZ=function(e,n,r,s,i,a,u){var c=new Or(this._pt,e,n,0,1,cI,null,i),d=0,h=0,p,m,_,w,y,x,S,P;for(c.b=r,c.e=s,r+="",s+="",(S=~s.indexOf("random("))&&(s=pf(s)),a&&(P=[r,s],a(P,e,n),r=P[0],s=P[1]),m=r.match(L1)||[];p=L1.exec(s);)w=p[0],y=s.substring(d,p.index),_?_=(_+1)%5:y.substr(-5)==="rgba("&&(_=1),w!==m[h++]&&(x=parseFloat(m[h-1])||0,c._pt={_next:c._pt,p:y||h===1?y:",",s:x,c:w.charAt(1)==="="?Du(x,w)-x:parseFloat(w)-x,m:_&&_<4?Math.round:0},d=L1.lastIndex);return c.c=d<s.length?s.substring(d,s.length):"",c.fp=u,(MA.test(s)||S)&&(c.e=0),this._pt=c,c},ux=function(e,n,r,s,i,a,u,c,d,h){rn(s)&&(s=s(i||0,e,a));var p=e[n],m=r!=="get"?r:rn(p)?d?e[n.indexOf("set")||!rn(e["get"+n.substr(3)])?n:"get"+n.substr(3)](d):e[n]():p,_=rn(p)?d?pZ:lI:dx,w;if(Mn(s)&&(~s.indexOf("random(")&&(s=pf(s)),s.charAt(1)==="="&&(w=Du(m,s)+(Xn(m)||0),(w||w===0)&&(s=w))),!h||m!==s||r2)return!isNaN(m*s)&&s!==""?(w=new Or(this._pt,e,n,+m||0,s-(m||0),typeof p=="boolean"?gZ:uI,0,_),d&&(w.fp=d),u&&w.modifier(u,this,e),this._pt=w):(!p&&!(n in e)&&sx(n,s),uZ.call(this,e,n,m,s,_,c||ts.stringFilter,d))},cZ=function(e,n,r,s,i){if(rn(e)&&(e=Fd(e,i,n,r,s)),!yi(e)||e.style&&e.nodeType||Jn(e)||AA(e))return Mn(e)?Fd(e,i,n,r,s):e;var a={},u;for(u in e)a[u]=Fd(e[u],i,n,r,s);return a},iI=function(e,n,r,s,i,a){var u,c,d,h;if(Gr[e]&&(u=new Gr[e]).init(i,u.rawVars?n[e]:cZ(n[e],s,i,a,r),r,s,a)!==!1&&(r._pt=c=new Or(r._pt,i,e,0,1,u.render,u,0,u.priority),r!==Pu))for(d=r._ptLookup[r._targets.indexOf(i)],h=u._props.length;h--;)d[u._props[h]]=c;return u},Qo,r2,cx=function t(e,n,r){var s=e.vars,i=s.ease,a=s.startAt,u=s.immediateRender,c=s.lazy,d=s.onUpdate,h=s.runBackwards,p=s.yoyoEase,m=s.keyframes,_=s.autoRevert,w=e._dur,y=e._startAt,x=e._targets,S=e.parent,P=S&&S.data==="nested"?S.vars.targets:x,T=e._overwrite==="auto"&&!ex,k=e.timeline,R=s.easeReverse||p,M,L,A,O,D,N,j,G,Y,W,q,Z,V;if(k&&(!m||!i)&&(i="none"),e._ease=kl(i,df.ease),e._rEase=R&&(kl(R)||e._ease),e._from=!k&&!!s.runBackwards,e._from&&(e.ratio=1),!k||m&&!s.stagger){if(G=x[0]?El(x[0]).harness:0,Z=G&&s[G.prop],M=Qm(s,ix),y&&(y._zTime<0&&y.progress(1),n<0&&h&&u&&!_?y.render(-1,!0):y.revert(h&&w?Xp:jK),y._lazy=0),a){if(ha(e._startAt=yn.set(x,ss({data:"isStart",overwrite:!1,parent:S,immediateRender:!0,lazy:!y&&Ir(c),startAt:null,delay:0,onUpdate:d&&function(){return Xr(e,"onUpdate")},stagger:0},a))),e._startAt._dp=0,e._startAt._sat=e,n<0&&(zn||!u&&!_)&&e._startAt.revert(Xp),u&&w&&n<=0&&r<=0){n&&(e._zTime=n);return}}else if(h&&w&&!y){if(n&&(u=!1),A=ss({overwrite:!1,data:"isFromStart",lazy:u&&!y&&Ir(c),immediateRender:u,stagger:0,parent:S},M),Z&&(A[G.prop]=Z),ha(e._startAt=yn.set(x,A)),e._startAt._dp=0,e._startAt._sat=e,n<0&&(zn?e._startAt.revert(Xp):e._startAt.render(-1,!0)),e._zTime=n,!u)t(e._startAt,kt,kt);else if(!n)return}for(e._pt=e._ptCache=0,c=w&&Ir(c)||c&&!w,L=0;L<x.length;L++){if(D=x[L],j=D._gsap||ax(x)[L]._gsap,e._ptLookup[L]=W={},X_[j.id]&&sa.length&&Xm(),q=P===x?L:P.indexOf(D),G&&(Y=new G).init(D,Z||M,e,q,P)!==!1&&(e._pt=O=new Or(e._pt,D,Y.name,0,1,Y.render,Y,0,Y.priority),Y._props.forEach(function(J){W[J]=O}),Y.priority&&(N=1)),!G||Z)for(A in M)Gr[A]&&(Y=iI(A,M,e,q,D,P))?Y.priority&&(N=1):W[A]=O=ux.call(e,D,A,"get",M[A],q,P,0,s.stringFilter);e._op&&e._op[L]&&e.kill(D,e._op[L]),T&&e._pt&&(Qo=e,Yt.killTweensOf(D,W,e.globalTime(n)),V=!e.parent,Qo=0),e._pt&&c&&(X_[j.id]=1)}N&&dI(e),e._onInit&&e._onInit(e)}e._onUpdate=d,e._initted=(!e._op||e._pt)&&!V,m&&n<=0&&k.render(xs,!0,!0)},dZ=function(e,n,r,s,i,a,u,c){var d=(e._pt&&e._ptCache||(e._ptCache={}))[n],h,p,m,_;if(!d)for(d=e._ptCache[n]=[],m=e._ptLookup,_=e._targets.length;_--;){if(h=m[_][n],h&&h.d&&h.d._pt)for(h=h.d._pt;h&&h.p!==n&&h.fp!==n;)h=h._next;if(!h)return r2=1,e.vars[n]="+=0",cx(e,u),r2=0,c?ff(n+" not eligible for reset. Try splitting into individual properties"):1;d.push(h)}for(_=d.length;_--;)p=d[_],h=p._pt||p,h.s=(s||s===0)&&!i?s:h.s+(s||0)+a*h.c,h.c=r-h.s,p.e&&(p.e=cn(r)+Xn(p.e)),p.b&&(p.b=h.s+Xn(p.b))},fZ=function(e,n){var r=e[0]?El(e[0]).harness:0,s=r&&r.aliases,i,a,u,c;if(!s)return n;i=ac({},n);for(a in s)if(a in i)for(c=s[a].split(","),u=c.length;u--;)i[c[u]]=i[a];return i},hZ=function(e,n,r,s){var i=n.ease||s||"power1.inOut",a,u;if(Jn(n))u=r[e]||(r[e]=[]),n.forEach(function(c,d){return u.push({t:d/(n.length-1)*100,v:c,e:i})});else for(a in n)u=r[a]||(r[a]=[]),a==="ease"||u.push({t:parseFloat(e),v:n[a],e:i})},Fd=function(e,n,r,s,i){return rn(e)?e.call(n,r,s,i):Mn(e)&&~e.indexOf("random(")?pf(e):e},oI=ox+"repeat,repeatDelay,yoyo,repeatRefresh,yoyoEase,easeReverse,autoRevert",aI={};Mr(oI+",id,stagger,delay,duration,paused,scrollTrigger",function(t){return aI[t]=1});var yn=(function(t){TA(e,t);function e(r,s,i,a){var u;typeof s=="number"&&(i.duration=s,s=i,i=null),u=t.call(this,a?s:Nd(s))||this;var c=u.vars,d=c.duration,h=c.delay,p=c.immediateRender,m=c.stagger,_=c.overwrite,w=c.keyframes,y=c.defaults,x=c.scrollTrigger,S=s.parent||Yt,P=(Jn(r)||AA(r)?uo(r[0]):"length"in s)?[r]:bs(r),T,k,R,M,L,A,O,D;if(u._targets=P.length?ax(P):ff("GSAP target "+r+" not found. https://gsap.com",!ts.nullTargetWarn)||[],u._ptLookup=[],u._overwrite=_,w||m||kp(d)||kp(h)){s=u.vars;var N=s.easeReverse||s.yoyoEase;if(T=u.timeline=new kr({data:"nested",defaults:y||{},targets:S&&S.data==="nested"?S.vars.targets:P}),T.kill(),T.parent=T._dp=Bi(u),T._start=0,m||kp(d)||kp(h)){if(M=P.length,O=m&&GA(m),yi(m))for(L in m)~oI.indexOf(L)&&(D||(D={}),D[L]=m[L]);for(k=0;k<M;k++)R=Qm(s,aI),R.stagger=0,N&&(R.easeReverse=N),D&&ac(R,D),A=P[k],R.duration=+Fd(d,Bi(u),k,A,P),R.delay=(+Fd(h,Bi(u),k,A,P)||0)-u._delay,!m&&M===1&&R.delay&&(u._delay=h=R.delay,u._start+=h,R.delay=0),T.to(A,R,O?O(k,A,P):0),T._ease=ct.none;T.duration()?d=h=0:u.timeline=0}else if(w){Nd(ss(T.vars.defaults,{ease:"none"})),T._ease=kl(w.ease||s.ease||"none");var j=0,G,Y,W;if(Jn(w))w.forEach(function(q){return T.to(P,q,">")}),T.duration();else{R={};for(L in w)L==="ease"||L==="easeEach"||hZ(L,w[L],R,w.easeEach);for(L in R)for(G=R[L].sort(function(q,Z){return q.t-Z.t}),j=0,k=0;k<G.length;k++)Y=G[k],W={ease:Y.e,duration:(Y.t-(k?G[k-1].t:0))/100*d},W[L]=Y.v,T.to(P,W,j),j+=W.duration;T.duration()<d&&T.to({},{duration:d-T.duration()})}}d||u.duration(d=T.duration())}else u.timeline=0;return _===!0&&!ex&&(Qo=Bi(u),Yt.killTweensOf(P),Qo=0),ci(S,Bi(u),i),s.reversed&&u.reverse(),s.paused&&u.paused(!0),(p||!d&&!w&&u._start===Zt(S._time)&&Ir(p)&&UK(Bi(u))&&S.data!=="nested")&&(u._tTime=-kt,u.render(Math.max(0,-h)||0)),x&&UA(Bi(u),x),u}var n=e.prototype;return n.render=function(s,i,a){var u=this._time,c=this._tDur,d=this._dur,h=s<0,p=s>c-kt&&!h?c:s<kt?0:s,m,_,w,y,x,S,P,T;if(!d)WK(this,s,i,a);else if(p!==this._tTime||!s||a||!this._initted&&this._tTime||this._startAt&&this._zTime<0!==h||this._lazy){if(m=p,T=this.timeline,this._repeat){if(y=d+this._rDelay,this._repeat<-1&&h)return this.totalTime(y*100+s,i,a);if(m=Zt(p%y),p===c?(w=this._repeat,m=d):(x=Zt(p/y),w=~~x,w&&w===x?(m=d,w--):m>d&&(m=d)),S=this._yoyo&&w&1,S&&(m=d-m),x=lc(this._tTime,y),m===u&&!a&&this._initted&&w===x)return this._tTime=p,this;w!==x&&this.vars.repeatRefresh&&!S&&!this._lock&&m!==y&&this._initted&&(this._lock=a=1,this.render(Zt(y*w),!0).invalidate()._lock=0)}if(!this._initted){if(BA(this,h?s:m,a,i,p))return this._tTime=0,this;if(u!==this._time&&!(a&&this.vars.repeatRefresh&&w!==x))return this;if(d!==this._dur)return this.render(s,i,a)}if(this._rEase){var k=m<u;if(k!==this._inv){var R=k?u:d-u;this._inv=k,this._from&&(this.ratio=1-this.ratio),this._invRatio=this.ratio,this._invTime=u,this._invRecip=R?(k?-1:1)/R:0,this._invScale=k?-this.ratio:1-this.ratio,this._invEase=k?this._rEase:this._ease}this.ratio=P=this._invRatio+this._invScale*this._invEase((m-this._invTime)*this._invRecip)}else this.ratio=P=this._ease(m/d);if(this._from&&(this.ratio=P=1-P),this._tTime=p,this._time=m,!this._act&&this._ts&&(this._act=1,this._lazy=0),!u&&p&&!i&&!x&&(Xr(this,"onStart"),this._tTime!==p))return this;for(_=this._pt;_;)_.r(P,_.d),_=_._next;T&&T.render(s<0?s:T._dur*T._ease(m/this._dur),i,a)||this._startAt&&(this._zTime=s),this._onUpdate&&!i&&(h&&Q_(this,s,i,a),Xr(this,"onUpdate")),this._repeat&&w!==x&&this.vars.onRepeat&&!i&&this.parent&&Xr(this,"onRepeat"),(p===this._tDur||!p)&&this._tTime===p&&(h&&!this._onUpdate&&Q_(this,s,!0,!0),(s||!d)&&(p===this._tDur&&this._ts>0||!p&&this._ts<0)&&ha(this,1),!i&&!(h&&!u)&&(p||u||S)&&(Xr(this,p===c?"onComplete":"onReverseComplete",!0),this._prom&&!(p<c&&this.timeScale()>0)&&this._prom()))}return this},n.targets=function(){return this._targets},n.invalidate=function(s){return(!s||!this.vars.runBackwards)&&(this._startAt=0),this._pt=this._op=this._onUpdate=this._lazy=this.ratio=0,this._ptLookup=[],this.timeline&&this.timeline.invalidate(s),t.prototype.invalidate.call(this,s)},n.resetTo=function(s,i,a,u,c){mf||Zr.wake(),this._ts||this.play();var d=Math.min(this._dur,(this._dp._time-this._start)*this._ts),h;return this._initted||cx(this,d),h=this._ease(d/this._dur),dZ(this,s,i,a,u,h,d,c)?this.resetTo(s,i,a,u,1):(O0(this,0),this.parent||HA(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?bd(this):this.scrollTrigger&&this.scrollTrigger.kill(!!zn),this;if(this.timeline){var a=this.timeline.totalDuration();return this.timeline.killTweensOf(s,i,Qo&&Qo.vars.overwrite!==!0)._first||bd(this),this.parent&&a!==this.timeline.totalDuration()&&uc(this,this._dur*this.timeline._tDur/a,0,1),this}var u=this._targets,c=s?bs(s):u,d=this._ptLookup,h=this._pt,p,m,_,w,y,x,S;if((!i||i==="all")&&HK(u,c))return i==="all"&&(this._pt=0),bd(this);for(p=this._op=this._op||[],i!=="all"&&(Mn(i)&&(y={},Mr(i,function(P){return y[P]=1}),i=y),i=fZ(u,i)),S=u.length;S--;)if(~c.indexOf(u[S])){m=d[S],i==="all"?(p[S]=i,w=m,_={}):(_=p[S]=p[S]||{},w=i);for(y in w)x=m&&m[y],x&&((!("kill"in x.d)||x.d.kill(y)===!0)&&I0(this,x,"_pt"),delete m[y]),_!=="all"&&(_[y]=1)}return this._initted&&!this._pt&&h&&bd(this),this},e.to=function(s,i){return new e(s,i,arguments[2])},e.from=function(s,i){return jd(1,arguments)},e.delayedCall=function(s,i,a,u){return new e(i,0,{immediateRender:!1,lazy:!1,overwrite:!1,delay:s,onComplete:i,onReverseComplete:i,onCompleteParams:a,onReverseCompleteParams:a,callbackScope:u})},e.fromTo=function(s,i,a){return jd(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,a){return Yt.killTweensOf(s,i,a)},e})(gf);ss(yn.prototype,{_targets:[],_lazy:0,_startAt:0,_op:0,_onInit:0});Mr("staggerTo,staggerFrom,staggerFromTo",function(t){yn[t]=function(){var e=new kr,n=e2.call(arguments,0);return n.splice(t==="staggerFromTo"?5:4,0,0),e[t].apply(e,n)}});var dx=function(e,n,r){return e[n]=r},lI=function(e,n,r){return e[n](r)},pZ=function(e,n,r,s){return e[n](s.fp,r)},mZ=function(e,n,r){return e.setAttribute(n,r)},fx=function(e,n){return rn(e[n])?lI:tx(e[n])&&e.setAttribute?mZ:dx},uI=function(e,n){return n.set(n.t,n.p,Math.round((n.s+n.c*e)*1e6)/1e6,n)},gZ=function(e,n){return n.set(n.t,n.p,!!(n.s+n.c*e),n)},cI=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)},hx=function(e,n){for(var r=n._pt;r;)r.r(e,r.d),r=r._next},vZ=function(e,n,r,s){for(var i=this._pt,a;i;)a=i._next,i.p===s&&i.modifier(e,n,r),i=a},yZ=function(e){for(var n=this._pt,r,s;n;)s=n._next,n.p===e&&!n.op||n.op===e?I0(this,n,"_pt"):n.dep||(r=1),n=s;return!r},_Z=function(e,n,r,s){s.mSet(e,n,s.m.call(s.tween,r,s.mt),s)},dI=function(e){for(var n=e._pt,r,s,i,a;n;){for(r=n._next,s=i;s&&s.pr>n.pr;)s=s._next;(n._prev=s?s._prev:a)?n._prev._next=n:i=n,(n._next=s)?s._prev=n:a=n,n=r}e._pt=i},Or=(function(){function t(n,r,s,i,a,u,c,d,h){this.t=r,this.s=i,this.c=a,this.p=s,this.r=u||uI,this.d=c||this,this.set=d||dx,this.pr=h||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=_Z,this.m=r,this.mt=i,this.tween=s},t})();Mr(ox+"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 ix[t]=1});rs.TweenMax=rs.TweenLite=yn;rs.TimelineLite=rs.TimelineMax=kr;Yt=new kr({sortChildren:!1,defaults:df,autoRemoveChildren:!0,id:"root",smoothChildTiming:!0});ts.stringFilter=nI;var Pl=[],Jp={},wZ=[],g8=0,xZ=0,$1=function(e){return(Jp[e]||wZ).map(function(n){return n()})},s2=function(){var e=Date.now(),n=[];e-g8>2&&($1("matchMediaInit"),Pl.forEach(function(r){var s=r.queries,i=r.conditions,a,u,c,d;for(u in s)a=si.matchMedia(s[u]).matches,a&&(c=1),a!==i[u]&&(i[u]=a,d=1);d&&(r.revert(),c&&n.push(r))}),$1("matchMediaRevert"),n.forEach(function(r){return r.onMatch(r,function(s){return r.add(null,s)})}),g8=e,$1("matchMedia"))},fI=(function(){function t(n,r){this.selector=r&&t2(r),this.data=[],this._r=[],this.isReverted=!1,this.id=xZ++,n&&this.add(n)}var e=t.prototype;return e.add=function(r,s,i){rn(r)&&(i=s,s=r,r=rn);var a=this,u=function(){var d=Bt,h=a.selector,p;return d&&d!==a&&d.data.push(a),i&&(a.selector=t2(i)),Bt=a,p=s.apply(a,arguments),rn(p)&&a._r.push(p),Bt=d,a.selector=h,a.isReverted=!1,p};return a.last=u,r===rn?u(a,function(c){return a.add(null,c)}):r?a[r]=u:u},e.ignore=function(r){var s=Bt;Bt=null,r(this),Bt=s},e.getTweens=function(){var r=[];return this.data.forEach(function(s){return s instanceof t?r.push.apply(r,s.getTweens()):s instanceof yn&&!(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 u=i.getTweens(),c=i.data.length,d;c--;)d=i.data[c],d.data==="isFlip"&&(d.revert(),d.getChildren(!0,!0,!1).forEach(function(h){return u.splice(u.indexOf(h),1)}));for(u.map(function(h){return{g:h._dur||h._delay||h._sat&&!h._sat.vars.immediateRender?h.globalTime(0):-1/0,t:h}}).sort(function(h,p){return p.g-h.g||-1/0}).forEach(function(h){return h.t.revert(r)}),c=i.data.length;c--;)d=i.data[c],d instanceof kr?d.data!=="nested"&&(d.scrollTrigger&&d.scrollTrigger.revert(),d.kill()):!(d instanceof yn)&&d.revert&&d.revert(r);i._r.forEach(function(h){return h(r,i)}),i.isReverted=!0})():this.data.forEach(function(u){return u.kill&&u.kill()}),this.clear(),s)for(var a=Pl.length;a--;)Pl[a].id===this.id&&Pl.splice(a,1)},e.revert=function(r){this.kill(r||{})},t})(),bZ=(function(){function t(n){this.contexts=[],this.scope=n,Bt&&Bt.data.push(this)}var e=t.prototype;return e.add=function(r,s,i){yi(r)||(r={matches:r});var a=new fI(0,i||this.scope),u=a.conditions={},c,d,h;Bt&&!a.selector&&(a.selector=Bt.selector),this.contexts.push(a),s=a.add("onMatch",s),a.queries=r;for(d in r)d==="all"?h=1:(c=si.matchMedia(r[d]),c&&(Pl.indexOf(a)<0&&Pl.push(a),(u[d]=c.matches)&&(h=1),c.addListener?c.addListener(s2):c.addEventListener("change",s2)));return h&&s(a,function(p){return a.add(null,p)}),this},e.revert=function(r){this.kill(r||{})},e.kill=function(r){this.contexts.forEach(function(s){return s.kill(r,!0)})},t})(),e0={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 JA(s)})},timeline:function(e){return new kr(e)},getTweensOf:function(e,n){return Yt.getTweensOf(e,n)},getProperty:function(e,n,r,s){Mn(e)&&(e=bs(e)[0]);var i=El(e||{}).get,a=r?VA:$A;return r==="native"&&(r=""),e&&(n?a((Gr[n]&&Gr[n].get||i)(e,n,r,s)):function(u,c,d){return a((Gr[u]&&Gr[u].get||i)(e,u,c,d))})},quickSetter:function(e,n,r){if(e=bs(e),e.length>1){var s=e.map(function(h){return Dr.quickSetter(h,n,r)}),i=s.length;return function(h){for(var p=i;p--;)s[p](h)}}e=e[0]||{};var a=Gr[n],u=El(e),c=u.harness&&(u.harness.aliases||{})[n]||n,d=a?function(h){var p=new a;Pu._pt=0,p.init(e,r?h+r:h,Pu,0,[e]),p.render(1,p),Pu._pt&&hx(1,Pu)}:u.set(e,c);return a?d:function(h){return d(e,c,r?h+r:h,u,1)}},quickTo:function(e,n,r){var s,i=Dr.to(e,ss((s={},s[n]="+=0.1",s.paused=!0,s.stagger=0,s),r||{})),a=function(c,d,h){return i.resetTo(n,c,d,h)};return a.tween=i,a},isTweening:function(e){return Yt.getTweensOf(e,!0).length>0},defaults:function(e){return e&&e.ease&&(e.ease=kl(e.ease,df.ease)),d8(df,e||{})},config:function(e){return d8(ts,e||{})},registerEffect:function(e){var n=e.name,r=e.effect,s=e.plugins,i=e.defaults,a=e.extendTimeline;(s||"").split(",").forEach(function(u){return u&&!Gr[u]&&!rs[u]&&ff(n+" effect requires "+u+" plugin.")}),D1[n]=function(u,c,d){return r(bs(u),ss(c||{},i),d)},a&&(kr.prototype[n]=function(u,c,d){return this.add(D1[n](u,yi(c)?c:(d=c)&&{},this),d)})},registerEase:function(e,n){ct[e]=kl(n)},parseEase:function(e,n){return arguments.length?kl(e,n):ct},getById:function(e){return Yt.getById(e)},exportRoot:function(e,n){e===void 0&&(e={});var r=new kr(e),s,i;for(r.smoothChildTiming=Ir(e.smoothChildTiming),Yt.remove(r),r._dp=0,r._time=r._tTime=Yt._time,s=Yt._first;s;)i=s._next,(n||!(!s._dur&&s instanceof yn&&s.vars.onComplete===s._targets[0]))&&ci(r,s,s._start-s._delay),s=i;return ci(Yt,r,0),r},context:function(e,n){return e?new fI(e,n):Bt},matchMedia:function(e){return new bZ(e)},matchMediaRefresh:function(){return Pl.forEach(function(e){var n=e.conditions,r,s;for(s in n)n[s]&&(n[s]=!1,r=1);r&&e.revert()})||s2()},addEventListener:function(e,n){var r=Jp[e]||(Jp[e]=[]);~r.indexOf(n)||r.push(n)},removeEventListener:function(e,n){var r=Jp[e],s=r&&r.indexOf(n);s>=0&&r.splice(s,1)},utils:{wrap:JK,wrapYoyo:eZ,distribute:GA,random:ZA,snap:KA,normalize:QK,getUnit:Xn,clamp:KK,splitColor:eI,toArray:bs,selector:t2,mapRange:XA,pipe:YK,unitize:XK,interpolate:tZ,shuffle:qA},install:LA,effects:D1,ticker:Zr,updateRoot:kr.updateRoot,plugins:Gr,globalTimeline:Yt,core:{PropTween:Or,globals:DA,Tween:yn,Timeline:kr,Animation:gf,getCache:El,_removeLinkedListItem:I0,reverting:function(){return zn},context:function(e){return e&&Bt&&(Bt.data.push(e),e._ctx=Bt),Bt},suppressOverwrites:function(e){return ex=e}}};Mr("to,from,fromTo,delayedCall,set,killTweensOf",function(t){return e0[t]=yn[t]});Zr.add(kr.updateRoot);Pu=e0.to({},{duration:0});var SZ=function(e,n){for(var r=e._pt;r&&r.p!==n&&r.op!==n&&r.fp!==n;)r=r._next;return r},EZ=function(e,n){var r=e._targets,s,i,a;for(s in n)for(i=r.length;i--;)a=e._ptLookup[i][s],a&&(a=a.d)&&(a._pt&&(a=SZ(a,s)),a&&a.modifier&&a.modifier(n[s],e,r[i],s))},V1=function(e,n){return{name:e,headless:1,rawVars:1,init:function(s,i,a){a._onInit=function(u){var c,d;if(Mn(i)&&(c={},Mr(i,function(h){return c[h]=1}),i=c),n){c={};for(d in i)c[d]=n(i[d]);i=c}EZ(u,i)}}}},Dr=e0.registerPlugin({name:"attr",init:function(e,n,r,s,i){var a,u,c;this.tween=r;for(a in n)c=e.getAttribute(a)||"",u=this.add(e,"setAttribute",(c||0)+"",n[a],s,i,0,0,a),u.op=a,u.b=c,this._props.push(a)},render:function(e,n){for(var r=n._pt;r;)zn?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)}},V1("roundProps",n2),V1("modifiers"),V1("snap",KA))||e0;yn.version=kr.version=Dr.version="3.15.0";OA=1;nx()&&cc();ct.Power0;ct.Power1;ct.Power2;ct.Power3;ct.Power4;ct.Linear;ct.Quad;ct.Cubic;ct.Quart;ct.Quint;ct.Strong;ct.Elastic;ct.Back;ct.SteppedEase;ct.Bounce;ct.Sine;ct.Expo;ct.Circ;/*!
123
- * CSSPlugin 3.15.0
124
- * https://gsap.com
125
- *
126
- * Copyright 2008-2026, GreenSock. All rights reserved.
127
- * Subject to the terms at https://gsap.com/standard-license
128
- * @author: Jack Doyle, jack@greensock.com
129
- */var v8,Jo,Nu,px,cl,y8,mx,CZ=function(){return typeof window<"u"},co={},sl=180/Math.PI,ju=Math.PI/180,mu=Math.atan2,_8=1e8,gx=/([A-Z])/g,kZ=/(left|right|width|margin|padding|x)/i,PZ=/[\s,\(]\S/,hi={autoAlpha:"opacity,visibility",scale:"scaleX,scaleY",alpha:"opacity"},i2=function(e,n){return n.set(n.t,n.p,Math.round((n.s+n.c*e)*1e4)/1e4+n.u,n)},TZ=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)},RZ=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)},AZ=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)},IZ=function(e,n){var r=n.s+n.c*e;n.set(n.t,n.p,~~(r+(r<0?-.5:.5))+n.u,n)},hI=function(e,n){return n.set(n.t,n.p,e?n.e:n.b,n)},pI=function(e,n){return n.set(n.t,n.p,e!==1?n.b:n.e,n)},MZ=function(e,n,r){return e.style[n]=r},OZ=function(e,n,r){return e.style.setProperty(n,r)},LZ=function(e,n,r){return e._gsap[n]=r},DZ=function(e,n,r){return e._gsap.scaleX=e._gsap.scaleY=r},NZ=function(e,n,r,s,i){var a=e._gsap;a.scaleX=a.scaleY=r,a.renderTransform(i,a)},jZ=function(e,n,r,s,i){var a=e._gsap;a[n]=r,a.renderTransform(i,a)},Xt="transform",Lr=Xt+"Origin",FZ=function t(e,n){var r=this,s=this.target,i=s.style,a=s._gsap;if(e in co&&i){if(this.tfm=this.tfm||{},e!=="transform")e=hi[e]||e,~e.indexOf(",")?e.split(",").forEach(function(u){return r.tfm[u]=qi(s,u)}):this.tfm[e]=a.x?a[e]:qi(s,e),e===Lr&&(this.tfm.zOrigin=a.zOrigin);else return hi.transform.split(",").forEach(function(u){return t.call(r,u,n)});if(this.props.indexOf(Xt)>=0)return;a.svg&&(this.svgo=s.getAttribute("data-svg-origin"),this.props.push(Lr,n,"")),e=Xt}(i||n)&&this.props.push(e,n,i[e])},mI=function(e){e.translate&&(e.removeProperty("translate"),e.removeProperty("scale"),e.removeProperty("rotate"))},$Z=function(){var e=this.props,n=this.target,r=n.style,s=n._gsap,i,a;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(gx,"-$1").toLowerCase());if(this.tfm){for(a in this.tfm)s[a]=this.tfm[a];s.svg&&(s.renderTransform(),n.setAttribute("data-svg-origin",this.svgo||"")),i=mx(),(!i||!i.isStart)&&!r[Xt]&&(mI(r),s.zOrigin&&r[Lr]&&(r[Lr]+=" "+s.zOrigin+"px",s.zOrigin=0,s.renderTransform()),s.uncache=1)}},gI=function(e,n){var r={target:e,props:[],revert:$Z,save:FZ};return e._gsap||Dr.core.getCache(e),n&&e.style&&e.nodeType&&n.split(",").forEach(function(s){return r.save(s)}),r},vI,o2=function(e,n){var r=Jo.createElementNS?Jo.createElementNS((n||"http://www.w3.org/1999/xhtml").replace(/^https/,"http"),e):Jo.createElement(e);return r&&r.style?r:Jo.createElement(e)},Qr=function t(e,n,r){var s=getComputedStyle(e);return s[n]||s.getPropertyValue(n.replace(gx,"-$1").toLowerCase())||s.getPropertyValue(n)||!r&&t(e,dc(n)||n,1)||""},w8="O,Moz,ms,Ms,Webkit".split(","),dc=function(e,n,r){var s=n||cl,i=s.style,a=5;if(e in i&&!r)return e;for(e=e.charAt(0).toUpperCase()+e.substr(1);a--&&!(w8[a]+e in i););return a<0?null:(a===3?"ms":a>=0?w8[a]:"")+e},a2=function(){CZ()&&window.document&&(v8=window,Jo=v8.document,Nu=Jo.documentElement,cl=o2("div")||{style:{}},o2("div"),Xt=dc(Xt),Lr=Xt+"Origin",cl.style.cssText="border-width:0;line-height:0;position:absolute;padding:0",vI=!!dc("perspective"),mx=Dr.core.reverting,px=1)},x8=function(e){var n=e.ownerSVGElement,r=o2("svg",n&&n.getAttribute("xmlns")||"http://www.w3.org/2000/svg"),s=e.cloneNode(!0),i;s.style.display="block",r.appendChild(s),Nu.appendChild(r);try{i=s.getBBox()}catch{}return r.removeChild(s),Nu.removeChild(r),i},b8=function(e,n){for(var r=n.length;r--;)if(e.hasAttribute(n[r]))return e.getAttribute(n[r])},yI=function(e){var n,r;try{n=e.getBBox()}catch{n=x8(e),r=1}return n&&(n.width||n.height)||r||(n=x8(e)),n&&!n.width&&!n.x&&!n.y?{x:+b8(e,["x","cx","x1"])||0,y:+b8(e,["y","cy","y1"])||0,width:0,height:0}:n},_I=function(e){return!!(e.getCTM&&(!e.parentNode||e.ownerSVGElement)&&yI(e))},pa=function(e,n){if(n){var r=e.style,s;n in co&&n!==Lr&&(n=Xt),r.removeProperty?(s=n.substr(0,2),(s==="ms"||n.substr(0,6)==="webkit")&&(n="-"+n),r.removeProperty(s==="--"?n:n.replace(gx,"-$1").toLowerCase())):r.removeAttribute(n)}},ea=function(e,n,r,s,i,a){var u=new Or(e._pt,n,r,0,1,a?pI:hI);return e._pt=u,u.b=s,u.e=i,e._props.push(r),u},S8={deg:1,rad:1,turn:1},VZ={grid:1,flex:1},ma=function t(e,n,r,s){var i=parseFloat(r)||0,a=(r+"").trim().substr((i+"").length)||"px",u=cl.style,c=kZ.test(n),d=e.tagName.toLowerCase()==="svg",h=(d?"client":"offset")+(c?"Width":"Height"),p=100,m=s==="px",_=s==="%",w,y,x,S;if(s===a||!i||S8[s]||S8[a])return i;if(a!=="px"&&!m&&(i=t(e,n,r,"px")),S=e.getCTM&&_I(e),(_||a==="%")&&(co[n]||~n.indexOf("adius")))return w=S?e.getBBox()[c?"width":"height"]:e[h],cn(_?i/w*p:i/100*w);if(u[c?"width":"height"]=p+(m?a:s),y=s!=="rem"&&~n.indexOf("adius")||s==="em"&&e.appendChild&&!d?e:e.parentNode,S&&(y=(e.ownerSVGElement||{}).parentNode),(!y||y===Jo||!y.appendChild)&&(y=Jo.body),x=y._gsap,x&&_&&x.width&&c&&x.time===Zr.time&&!x.uncache)return cn(i/x.width*p);if(_&&(n==="height"||n==="width")){var P=e.style[n];e.style[n]=p+s,w=e[h],P?e.style[n]=P:pa(e,n)}else(_||a==="%")&&!VZ[Qr(y,"display")]&&(u.position=Qr(e,"position")),y===e&&(u.position="static"),y.appendChild(cl),w=cl[h],y.removeChild(cl),u.position="absolute";return c&&_&&(x=El(y),x.time=Zr.time,x.width=y[h]),cn(m?w*i/p:w&&i?p/w*i:0)},qi=function(e,n,r,s){var i;return px||a2(),n in hi&&n!=="transform"&&(n=hi[n],~n.indexOf(",")&&(n=n.split(",")[0])),co[n]&&n!=="transform"?(i=yf(e,s),i=n!=="transformOrigin"?i[n]:i.svg?i.origin:n0(Qr(e,Lr))+" "+i.zOrigin+"px"):(i=e.style[n],(!i||i==="auto"||s||~(i+"").indexOf("calc("))&&(i=t0[n]&&t0[n](e,n,r)||Qr(e,n)||jA(e,n)||(n==="opacity"?1:0))),r&&!~(i+"").trim().indexOf(" ")?ma(e,n,i,r)+r:i},HZ=function(e,n,r,s){if(!r||r==="none"){var i=dc(n,e,1),a=i&&Qr(e,i,1);a&&a!==r?(n=i,r=a):n==="borderColor"&&(r=Qr(e,"borderTopColor"))}var u=new Or(this._pt,e.style,n,0,1,cI),c=0,d=0,h,p,m,_,w,y,x,S,P,T,k,R;if(u.b=r,u.e=s,r+="",s+="",s.substring(0,6)==="var(--"&&(s=Qr(e,s.substring(4,s.indexOf(")")))),s==="auto"&&(y=e.style[n],e.style[n]=s,s=Qr(e,n)||s,y?e.style[n]=y:pa(e,n)),h=[r,s],nI(h),r=h[0],s=h[1],m=r.match(ku)||[],R=s.match(ku)||[],R.length){for(;p=ku.exec(s);)x=p[0],P=s.substring(c,p.index),w?w=(w+1)%5:(P.substr(-5)==="rgba("||P.substr(-5)==="hsla(")&&(w=1),x!==(y=m[d++]||"")&&(_=parseFloat(y)||0,k=y.substr((_+"").length),x.charAt(1)==="="&&(x=Du(_,x)+k),S=parseFloat(x),T=x.substr((S+"").length),c=ku.lastIndex-T.length,T||(T=T||ts.units[n]||k,c===s.length&&(s+=T,u.e+=T)),k!==T&&(_=ma(e,n,y,T)||0),u._pt={_next:u._pt,p:P||d===1?P:",",s:_,c:S-_,m:w&&w<4||n==="zIndex"?Math.round:0});u.c=c<s.length?s.substring(c,s.length):""}else u.r=n==="display"&&s==="none"?pI:hI;return MA.test(s)&&(u.e=0),this._pt=u,u},E8={top:"0%",bottom:"100%",left:"0%",right:"100%",center:"50%"},zZ=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]=E8[r]||r,n[1]=E8[s]||s,n.join(" ")},UZ=function(e,n){if(n.tween&&n.tween._time===n.tween._dur){var r=n.t,s=r.style,i=n.u,a=r._gsap,u,c,d;if(i==="all"||i===!0)s.cssText="",c=1;else for(i=i.split(","),d=i.length;--d>-1;)u=i[d],co[u]&&(c=1,u=u==="transformOrigin"?Lr:Xt),pa(r,u);c&&(pa(r,Xt),a&&(a.svg&&r.removeAttribute("transform"),s.scale=s.rotate=s.translate="none",yf(r,1),a.uncache=1,mI(s)))}},t0={clearProps:function(e,n,r,s,i){if(i.data!=="isFromStart"){var a=e._pt=new Or(e._pt,n,r,0,0,UZ);return a.u=s,a.pr=-10,a.tween=i,e._props.push(r),1}}},vf=[1,0,0,1,0,0],wI={},xI=function(e){return e==="matrix(1, 0, 0, 1, 0, 0)"||e==="none"||!e},C8=function(e){var n=Qr(e,Xt);return xI(n)?vf:n.substr(7).match(IA).map(cn)},vx=function(e,n){var r=e._gsap||El(e),s=e.style,i=C8(e),a,u,c,d;return r.svg&&e.getAttribute("transform")?(c=e.transform.baseVal.consolidate().matrix,i=[c.a,c.b,c.c,c.d,c.e,c.f],i.join(",")==="1,0,0,1,0,0"?vf:i):(i===vf&&!e.offsetParent&&e!==Nu&&!r.svg&&(c=s.display,s.display="block",a=e.parentNode,(!a||!e.offsetParent&&!e.getBoundingClientRect().width)&&(d=1,u=e.nextElementSibling,Nu.appendChild(e)),i=C8(e),c?s.display=c:pa(e,"display"),d&&(u?a.insertBefore(e,u):a?a.appendChild(e):Nu.removeChild(e))),n&&i.length>6?[i[0],i[1],i[4],i[5],i[12],i[13]]:i)},l2=function(e,n,r,s,i,a){var u=e._gsap,c=i||vx(e,!0),d=u.xOrigin||0,h=u.yOrigin||0,p=u.xOffset||0,m=u.yOffset||0,_=c[0],w=c[1],y=c[2],x=c[3],S=c[4],P=c[5],T=n.split(" "),k=parseFloat(T[0])||0,R=parseFloat(T[1])||0,M,L,A,O;r?c!==vf&&(L=_*x-w*y)&&(A=k*(x/L)+R*(-y/L)+(y*P-x*S)/L,O=k*(-w/L)+R*(_/L)-(_*P-w*S)/L,k=A,R=O):(M=yI(e),k=M.x+(~T[0].indexOf("%")?k/100*M.width:k),R=M.y+(~(T[1]||T[0]).indexOf("%")?R/100*M.height:R)),s||s!==!1&&u.smooth?(S=k-d,P=R-h,u.xOffset=p+(S*_+P*y)-S,u.yOffset=m+(S*w+P*x)-P):u.xOffset=u.yOffset=0,u.xOrigin=k,u.yOrigin=R,u.smooth=!!s,u.origin=n,u.originIsAbsolute=!!r,e.style[Lr]="0px 0px",a&&(ea(a,u,"xOrigin",d,k),ea(a,u,"yOrigin",h,R),ea(a,u,"xOffset",p,u.xOffset),ea(a,u,"yOffset",m,u.yOffset)),e.setAttribute("data-svg-origin",k+" "+R)},yf=function(e,n){var r=e._gsap||new sI(e);if("x"in r&&!n&&!r.uncache)return r;var s=e.style,i=r.scaleX<0,a="px",u="deg",c=getComputedStyle(e),d=Qr(e,Lr)||"0",h,p,m,_,w,y,x,S,P,T,k,R,M,L,A,O,D,N,j,G,Y,W,q,Z,V,J,H,F,X,oe,se,ee;return h=p=m=y=x=S=P=T=k=0,_=w=1,r.svg=!!(e.getCTM&&_I(e)),c.translate&&((c.translate!=="none"||c.scale!=="none"||c.rotate!=="none")&&(s[Xt]=(c.translate!=="none"?"translate3d("+(c.translate+" 0 0").split(" ").slice(0,3).join(", ")+") ":"")+(c.rotate!=="none"?"rotate("+c.rotate+") ":"")+(c.scale!=="none"?"scale("+c.scale.split(" ").join(",")+") ":"")+(c[Xt]!=="none"?c[Xt]:"")),s.scale=s.rotate=s.translate="none"),L=vx(e,r.svg),r.svg&&(r.uncache?(V=e.getBBox(),d=r.xOrigin-V.x+"px "+(r.yOrigin-V.y)+"px",Z=""):Z=!n&&e.getAttribute("data-svg-origin"),l2(e,Z||d,!!Z||r.originIsAbsolute,r.smooth!==!1,L)),R=r.xOrigin||0,M=r.yOrigin||0,L!==vf&&(N=L[0],j=L[1],G=L[2],Y=L[3],h=W=L[4],p=q=L[5],L.length===6?(_=Math.sqrt(N*N+j*j),w=Math.sqrt(Y*Y+G*G),y=N||j?mu(j,N)*sl:0,P=G||Y?mu(G,Y)*sl+y:0,P&&(w*=Math.abs(Math.cos(P*ju))),r.svg&&(h-=R-(R*N+M*G),p-=M-(R*j+M*Y))):(ee=L[6],oe=L[7],H=L[8],F=L[9],X=L[10],se=L[11],h=L[12],p=L[13],m=L[14],A=mu(ee,X),x=A*sl,A&&(O=Math.cos(-A),D=Math.sin(-A),Z=W*O+H*D,V=q*O+F*D,J=ee*O+X*D,H=W*-D+H*O,F=q*-D+F*O,X=ee*-D+X*O,se=oe*-D+se*O,W=Z,q=V,ee=J),A=mu(-G,X),S=A*sl,A&&(O=Math.cos(-A),D=Math.sin(-A),Z=N*O-H*D,V=j*O-F*D,J=G*O-X*D,se=Y*D+se*O,N=Z,j=V,G=J),A=mu(j,N),y=A*sl,A&&(O=Math.cos(A),D=Math.sin(A),Z=N*O+j*D,V=W*O+q*D,j=j*O-N*D,q=q*O-W*D,N=Z,W=V),x&&Math.abs(x)+Math.abs(y)>359.9&&(x=y=0,S=180-S),_=cn(Math.sqrt(N*N+j*j+G*G)),w=cn(Math.sqrt(q*q+ee*ee)),A=mu(W,q),P=Math.abs(A)>2e-4?A*sl:0,k=se?1/(se<0?-se:se):0),r.svg&&(Z=e.getAttribute("transform"),r.forceCSS=e.setAttribute("transform","")||!xI(Qr(e,Xt)),Z&&e.setAttribute("transform",Z))),Math.abs(P)>90&&Math.abs(P)<270&&(i?(_*=-1,P+=y<=0?180:-180,y+=y<=0?180:-180):(w*=-1,P+=P<=0?180:-180)),n=n||r.uncache,r.x=h-((r.xPercent=h&&(!n&&r.xPercent||(Math.round(e.offsetWidth/2)===Math.round(-h)?-50:0)))?e.offsetWidth*r.xPercent/100:0)+a,r.y=p-((r.yPercent=p&&(!n&&r.yPercent||(Math.round(e.offsetHeight/2)===Math.round(-p)?-50:0)))?e.offsetHeight*r.yPercent/100:0)+a,r.z=m+a,r.scaleX=cn(_),r.scaleY=cn(w),r.rotation=cn(y)+u,r.rotationX=cn(x)+u,r.rotationY=cn(S)+u,r.skewX=P+u,r.skewY=T+u,r.transformPerspective=k+a,(r.zOrigin=parseFloat(d.split(" ")[2])||!n&&r.zOrigin||0)&&(s[Lr]=n0(d)),r.xOffset=r.yOffset=0,r.force3D=ts.force3D,r.renderTransform=r.svg?WZ:vI?bI:BZ,r.uncache=0,r},n0=function(e){return(e=e.split(" "))[0]+" "+e[1]},H1=function(e,n,r){var s=Xn(n);return cn(parseFloat(n)+parseFloat(ma(e,"x",r+"px",s)))+s},BZ=function(e,n){n.z="0px",n.rotationY=n.rotationX="0deg",n.force3D=0,bI(e,n)},Ya="0deg",dd="0px",Xa=") ",bI=function(e,n){var r=n||this,s=r.xPercent,i=r.yPercent,a=r.x,u=r.y,c=r.z,d=r.rotation,h=r.rotationY,p=r.rotationX,m=r.skewX,_=r.skewY,w=r.scaleX,y=r.scaleY,x=r.transformPerspective,S=r.force3D,P=r.target,T=r.zOrigin,k="",R=S==="auto"&&e&&e!==1||S===!0;if(T&&(p!==Ya||h!==Ya)){var M=parseFloat(h)*ju,L=Math.sin(M),A=Math.cos(M),O;M=parseFloat(p)*ju,O=Math.cos(M),a=H1(P,a,L*O*-T),u=H1(P,u,-Math.sin(M)*-T),c=H1(P,c,A*O*-T+T)}x!==dd&&(k+="perspective("+x+Xa),(s||i)&&(k+="translate("+s+"%, "+i+"%) "),(R||a!==dd||u!==dd||c!==dd)&&(k+=c!==dd||R?"translate3d("+a+", "+u+", "+c+") ":"translate("+a+", "+u+Xa),d!==Ya&&(k+="rotate("+d+Xa),h!==Ya&&(k+="rotateY("+h+Xa),p!==Ya&&(k+="rotateX("+p+Xa),(m!==Ya||_!==Ya)&&(k+="skew("+m+", "+_+Xa),(w!==1||y!==1)&&(k+="scale("+w+", "+y+Xa),P.style[Xt]=k||"translate(0, 0)"},WZ=function(e,n){var r=n||this,s=r.xPercent,i=r.yPercent,a=r.x,u=r.y,c=r.rotation,d=r.skewX,h=r.skewY,p=r.scaleX,m=r.scaleY,_=r.target,w=r.xOrigin,y=r.yOrigin,x=r.xOffset,S=r.yOffset,P=r.forceCSS,T=parseFloat(a),k=parseFloat(u),R,M,L,A,O;c=parseFloat(c),d=parseFloat(d),h=parseFloat(h),h&&(h=parseFloat(h),d+=h,c+=h),c||d?(c*=ju,d*=ju,R=Math.cos(c)*p,M=Math.sin(c)*p,L=Math.sin(c-d)*-m,A=Math.cos(c-d)*m,d&&(h*=ju,O=Math.tan(d-h),O=Math.sqrt(1+O*O),L*=O,A*=O,h&&(O=Math.tan(h),O=Math.sqrt(1+O*O),R*=O,M*=O)),R=cn(R),M=cn(M),L=cn(L),A=cn(A)):(R=p,A=m,M=L=0),(T&&!~(a+"").indexOf("px")||k&&!~(u+"").indexOf("px"))&&(T=ma(_,"x",a,"px"),k=ma(_,"y",u,"px")),(w||y||x||S)&&(T=cn(T+w-(w*R+y*L)+x),k=cn(k+y-(w*M+y*A)+S)),(s||i)&&(O=_.getBBox(),T=cn(T+s/100*O.width),k=cn(k+i/100*O.height)),O="matrix("+R+","+M+","+L+","+A+","+T+","+k+")",_.setAttribute("transform",O),P&&(_.style[Xt]=O)},qZ=function(e,n,r,s,i){var a=360,u=Mn(i),c=parseFloat(i)*(u&&~i.indexOf("rad")?sl:1),d=c-s,h=s+d+"deg",p,m;return u&&(p=i.split("_")[1],p==="short"&&(d%=a,d!==d%(a/2)&&(d+=d<0?a:-a)),p==="cw"&&d<0?d=(d+a*_8)%a-~~(d/a)*a:p==="ccw"&&d>0&&(d=(d-a*_8)%a-~~(d/a)*a)),e._pt=m=new Or(e._pt,n,r,s,d,TZ),m.e=h,m.u="deg",e._props.push(r),m},k8=function(e,n){for(var r in n)e[r]=n[r];return e},GZ=function(e,n,r){var s=k8({},r._gsap),i="perspective,force3D,transformOrigin,svgOrigin",a=r.style,u,c,d,h,p,m,_,w;s.svg?(d=r.getAttribute("transform"),r.setAttribute("transform",""),a[Xt]=n,u=yf(r,1),pa(r,Xt),r.setAttribute("transform",d)):(d=getComputedStyle(r)[Xt],a[Xt]=n,u=yf(r,1),a[Xt]=d);for(c in co)d=s[c],h=u[c],d!==h&&i.indexOf(c)<0&&(_=Xn(d),w=Xn(h),p=_!==w?ma(r,c,d,w):parseFloat(d),m=parseFloat(h),e._pt=new Or(e._pt,u,c,p,m-p,i2),e._pt.u=w||0,e._props.push(c));k8(u,s)};Mr("padding,margin,Width,Radius",function(t,e){var n="Top",r="Right",s="Bottom",i="Left",a=(e<3?[n,r,s,i]:[n+i,n+r,s+r,s+i]).map(function(u){return e<2?t+u:"border"+u+t});t0[e>1?"border"+t:t]=function(u,c,d,h,p){var m,_;if(arguments.length<4)return m=a.map(function(w){return qi(u,w,d)}),_=m.join(" "),_.split(m[0]).length===5?m[0]:_;m=(h+"").split(" "),_={},a.forEach(function(w,y){return _[w]=m[y]=m[y]||m[(y-1)/2|0]}),u.init(c,_,p)}});var SI={name:"css",register:a2,targetTest:function(e){return e.style&&e.nodeType},init:function(e,n,r,s,i){var a=this._props,u=e.style,c=r.vars.startAt,d,h,p,m,_,w,y,x,S,P,T,k,R,M,L,A,O;px||a2(),this.styles=this.styles||gI(e),A=this.styles.props,this.tween=r;for(y in n)if(y!=="autoRound"&&(h=n[y],!(Gr[y]&&iI(y,n,r,s,e,i)))){if(_=typeof h,w=t0[y],_==="function"&&(h=h.call(r,s,e,i),_=typeof h),_==="string"&&~h.indexOf("random(")&&(h=pf(h)),w)w(this,e,y,h,r)&&(L=1);else if(y.substr(0,2)==="--")d=(getComputedStyle(e).getPropertyValue(y)+"").trim(),h+="",ia.lastIndex=0,ia.test(d)||(x=Xn(d),S=Xn(h),S?x!==S&&(d=ma(e,y,d,S)+S):x&&(h+=x)),this.add(u,"setProperty",d,h,s,i,0,0,y),a.push(y),A.push(y,0,u[y]);else if(_!=="undefined"){if(c&&y in c?(d=typeof c[y]=="function"?c[y].call(r,s,e,i):c[y],Mn(d)&&~d.indexOf("random(")&&(d=pf(d)),Xn(d+"")||d==="auto"||(d+=ts.units[y]||Xn(qi(e,y))||""),(d+"").charAt(1)==="="&&(d=qi(e,y))):d=qi(e,y),m=parseFloat(d),P=_==="string"&&h.charAt(1)==="="&&h.substr(0,2),P&&(h=h.substr(2)),p=parseFloat(h),y in hi&&(y==="autoAlpha"&&(m===1&&qi(e,"visibility")==="hidden"&&p&&(m=0),A.push("visibility",0,u.visibility),ea(this,u,"visibility",m?"inherit":"hidden",p?"inherit":"hidden",!p)),y!=="scale"&&y!=="transform"&&(y=hi[y],~y.indexOf(",")&&(y=y.split(",")[0]))),T=y in co,T){if(this.styles.save(y),O=h,_==="string"&&h.substring(0,6)==="var(--"){if(h=Qr(e,h.substring(4,h.indexOf(")"))),h.substring(0,5)==="calc("){var D=e.style.perspective;e.style.perspective=h,h=Qr(e,"perspective"),D?e.style.perspective=D:pa(e,"perspective")}p=parseFloat(h)}if(k||(R=e._gsap,R.renderTransform&&!n.parseTransform||yf(e,n.parseTransform),M=n.smoothOrigin!==!1&&R.smooth,k=this._pt=new Or(this._pt,u,Xt,0,1,R.renderTransform,R,0,-1),k.dep=1),y==="scale")this._pt=new Or(this._pt,R,"scaleY",R.scaleY,(P?Du(R.scaleY,P+p):p)-R.scaleY||0,i2),this._pt.u=0,a.push("scaleY",y),y+="X";else if(y==="transformOrigin"){A.push(Lr,0,u[Lr]),h=zZ(h),R.svg?l2(e,h,0,M,0,this):(S=parseFloat(h.split(" ")[2])||0,S!==R.zOrigin&&ea(this,R,"zOrigin",R.zOrigin,S),ea(this,u,y,n0(d),n0(h)));continue}else if(y==="svgOrigin"){l2(e,h,1,M,0,this);continue}else if(y in wI){qZ(this,R,y,m,P?Du(m,P+h):h);continue}else if(y==="smoothOrigin"){ea(this,R,"smooth",R.smooth,h);continue}else if(y==="force3D"){R[y]=h;continue}else if(y==="transform"){GZ(this,h,e);continue}}else y in u||(y=dc(y)||y);if(T||(p||p===0)&&(m||m===0)&&!PZ.test(h)&&y in u)x=(d+"").substr((m+"").length),p||(p=0),S=Xn(h)||(y in ts.units?ts.units[y]:x),x!==S&&(m=ma(e,y,d,S)),this._pt=new Or(this._pt,T?R:u,y,m,(P?Du(m,P+p):p)-m,!T&&(S==="px"||y==="zIndex")&&n.autoRound!==!1?IZ:i2),this._pt.u=S||0,T&&O!==h?(this._pt.b=d,this._pt.e=O,this._pt.r=AZ):x!==S&&S!=="%"&&(this._pt.b=d,this._pt.r=RZ);else if(y in u)HZ.call(this,e,y,d,P?P+h:h);else if(y in e)this.add(e,y,d||e[y],P?P+h:h,s,i);else if(y!=="parseTransform"){sx(y,h);continue}T||(y in u?A.push(y,0,u[y]):typeof e[y]=="function"?A.push(y,2,e[y]()):A.push(y,1,d||e[y])),a.push(y)}}L&&dI(this)},render:function(e,n){if(n.tween._time||!mx())for(var r=n._pt;r;)r.r(e,r.d),r=r._next;else n.styles.revert()},get:qi,aliases:hi,getSetter:function(e,n,r){var s=hi[n];return s&&s.indexOf(",")<0&&(n=s),n in co&&n!==Lr&&(e._gsap.x||qi(e,"x"))?r&&y8===r?n==="scale"?DZ:LZ:(y8=r||{})&&(n==="scale"?NZ:jZ):e.style&&!tx(e.style[n])?MZ:~n.indexOf("-")?OZ:fx(e,n)},core:{_removeProperty:pa,_getMatrix:vx}};Dr.utils.checkPrefix=dc;Dr.core.getStyleSaver=gI;(function(t,e,n,r){var s=Mr(t+","+e+","+n,function(i){co[i]=1});Mr(e,function(i){ts.units[i]="deg",wI[i]=1}),hi[s[13]]=t+","+e,Mr(r,function(i){var a=i.split(":");hi[a[1]]=s[a[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");Mr("x,y,z,top,right,bottom,left,width,height,fontSize,padding,margin,perspective",function(t){ts.units[t]="px"});Dr.registerPlugin(SI);var Fs=Dr.registerPlugin(SI)||Dr;Fs.core.Tween;const em="/assets/logo-animation",z1=1280,KZ=[{id:"eraser",src:`${em}/eraser.png`,cssW:189,cssH:74,rot:-90,fit:337,localX:60,localY:168,seaX:.2,seaY:.27,seaRot:-8},{id:"clasp",src:`${em}/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:`${em}/playdough.png`,cssW:236,cssH:206,rot:5,fit:150,localX:182,localY:277,seaX:.52,seaY:.79,seaRot:6}],ZZ=[{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}],u2=({className:t})=>{const e=v.useRef(null),n=v.useRef(null),r=v.useRef(null);return v.useEffect(()=>{const s=e.current,i=n.current,a=r.current;if(!s||!i||!a)return;const u=window.matchMedia("(prefers-reduced-motion: reduce)").matches,c=(S,P)=>S+Math.random()*(P-S);let d=null,h,p=1;const m=KZ.map(S=>({...S})),_=()=>{s.querySelectorAll(".la-obj").forEach(A=>A.remove());const S=s.getBoundingClientRect(),P=S.width||z1,T=S.height||z1*.64;p=P/z1,i.style.width=`${242*p}px`,i.style.height=`${250*p}px`;const R=250*p/337,M=[],L=(A,O,D)=>{const N=document.createElement("div");return N.className="la-obj",N.style.width=`${O}px`,N.innerHTML=`<img src="${A}" alt="" style="${D?"transform:scaleX(-1)":""}">`,s.appendChild(N),N};return ZZ.forEach((A,O)=>{const D=A.w*p,N=L(`${em}/sea/${A.k}.png`,D,O%2===0);Fs.set(N,{x:A.x*P-D/2,y:A.y*T-D/2,rotation:A.r,opacity:1,scale:0,transformOrigin:"50% 50%"}),M.push({el:N,hero:!1,rest:1})}),m.forEach(A=>{const O=A.cssW*p;A.el=L(A.src,O,!!A.flip),A.finalScale=A.fit*R/(A.cssW*p),Fs.set(A.el,{x:A.seaX*P-O/2,y:A.seaY*T-A.cssH*p/2,rotation:A.seaRot,opacity:1,scale:0,transformOrigin:"50% 50%",zIndex:30}),M.push({el:A.el,hero:!0,rest:150/A.cssW})}),M},w=(S,P)=>{const T=s.getBoundingClientRect(),k=a.getBoundingClientRect();return{x:k.left-T.left+S/326*k.width,y:k.top-T.top+P/337*k.height}},y=()=>{d&&d.revert();const S=_();if(u){d=Fs.context(()=>{S.filter(k=>!k.hero).forEach(k=>Fs.set(k.el,{scale:0})),m.forEach(k=>{if(!k.el)return;const R=w(k.localX,k.localY);Fs.set(k.el,{x:R.x-k.cssW*p/2,y:R.y-k.cssH*p/2,rotation:k.rot,scale:k.finalScale})})},s);return}const P=[],T=[];d=Fs.context(()=>{const k=Fs.timeline();k.to(S.map(R=>R.el),{scale:R=>S[R].rest,duration:.5,ease:"steps(4)",stagger:{each:.045,from:"random"}}),k.add(()=>{S.forEach(({el:R,hero:M},L)=>{const A=M?P:T,O=L%2?1:-1;A.push(Fs.to(R,{rotation:"+="+c(2.5,6)*O,duration:c(.5,.9),repeat:-1,yoyo:!0,ease:"steps(2)",delay:c(0,.4)}),Fs.to(R,{y:"+="+c(5,11)*O,x:"+="+c(4,9)*-O,duration:c(.7,1.2),repeat:-1,yoyo:!0,ease:"steps(3)",delay:c(0,.4)}))})},"<0.1"),k.to({},{duration:1.1}),k.add("pick"),m.forEach((R,M)=>{R.el&&k.to(R.el,{scale:150/R.cssW*1.2,duration:.28,ease:"steps(3)",yoyo:!0,repeat:1},"pick+="+M*.08)}),k.add("clear","pick+=0.7"),k.add(()=>T.forEach(R=>R.kill()),"clear"),k.to(S.filter(R=>!R.hero).map(R=>R.el),{scale:0,rotation:"+=40",duration:.5,ease:"steps(5)",overwrite:"auto",stagger:{each:.025,from:"random"}},"clear"),k.add("assemble","clear+=0.25"),k.add(()=>P.forEach(R=>R.kill()),"assemble"),m.forEach((R,M)=>{if(!R.el||R.finalScale===void 0)return;const L=w(R.localX,R.localY);k.to(R.el,{x:L.x-R.cssW*p/2,y:L.y-R.cssH*p/2,rotation:R.rot,scale:R.finalScale,duration:1.05,ease:"steps(9)",overwrite:"auto"},"assemble+="+M*.12)}),m.forEach(R=>{!R.el||R.finalScale===void 0||k.to(R.el,{scale:R.finalScale*1.03,duration:.16,ease:"steps(2)",yoyo:!0,repeat:1},"assemble+=1.45")})},s)};Fs.ticker.fps(12),y();const x=()=>{clearTimeout(h),h=setTimeout(y,250)};return window.addEventListener("resize",x),()=>{window.removeEventListener("resize",x),clearTimeout(h),d==null||d.revert(),s.querySelectorAll(".la-obj").forEach(S=>S.remove())}},[]),E.jsx("div",{ref:e,className:`la-scene ${t??""}`,children:E.jsx("div",{ref:n,className:"la-logo-stage",children:E.jsx("svg",{ref:r,className:"la-mark",viewBox:"0 0 326 337","aria-hidden":"true"})})})},YZ=Object.freeze(Object.defineProperty({__proto__:null,default:u2},Symbol.toStringTag,{value:"Module"})),P8=({isSigningIn:t})=>t?E.jsxs(E.Fragment,{children:[E.jsx("div",{className:"h-5 w-5 animate-spin rounded-full border-2 border-current border-t-transparent"}),E.jsx("span",{children:"Signing in..."})]}):E.jsxs(E.Fragment,{children:[E.jsx("img",{src:"https://www.gstatic.com/firebasejs/ui/2.0.0/images/auth/google.svg",alt:"Google",className:"h-5 w-5"}),E.jsx("span",{children:"Sign in with Google"})]}),XZ=({isSigningIn:t,onStartSignIn:e,errorMessage:n=null,isDesktopShell:r=!1,displayMode:s="full"})=>s==="modal"?E.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:[E.jsx(u2,{className:"relative z-0 h-44 w-full"}),E.jsxs("div",{className:"relative z-10 flex flex-col items-center gap-6 px-8 pb-12 pt-8",children:[E.jsxs("div",{className:"flex flex-col items-center gap-2 text-center",children:[E.jsx("h1",{className:"text-xl font-medium text-content",children:"Welcome to Rivet"}),E.jsx("p",{className:"text-sm leading-relaxed text-content-muted",children:"Rivet understands your references, and then explores dozens of design directions with you."})]}),E.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:E.jsx(P8,{isSigningIn:t})}),n?E.jsx("p",{className:"text-center text-xs text-red-200",children:n}):null]})]}):E.jsxs("div",{className:"relative flex min-h-screen flex-col items-center justify-center overflow-hidden bg-white font-main text-[#18181b]",children:[r?E.jsx("div",{className:"fixed left-0 right-0 top-0 z-10 h-8",style:{WebkitAppRegion:"drag"}}):null,E.jsx(u2,{className:"absolute inset-0 z-0"}),E.jsxs("div",{className:"pointer-events-none absolute inset-x-0 bottom-0 z-10 flex flex-col items-center gap-5 pb-[14vh]",children:[E.jsxs("div",{className:"flex flex-col items-center gap-2 px-6 text-center",children:[E.jsx("h1",{className:"text-xl font-medium tracking-tight text-[#18181b]",children:"Welcome to Rivet"}),E.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."})]}),E.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:E.jsx(P8,{isSigningIn:t})}),n?E.jsx("p",{className:"text-center text-xs text-red-500",children:n}):null]})]}),QZ="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",JZ=({message:t})=>E.jsx("div",{className:"relative flex min-h-screen flex-col items-center justify-center overflow-hidden bg-[#1c1c20] font-main text-white",children:E.jsxs("div",{className:"flex flex-col items-center gap-10",children:[E.jsx("img",{src:QZ,alt:"Rivet",className:"h-8 w-auto object-contain"}),E.jsxs("div",{className:"glass-panel flex items-center gap-3 rounded-xl px-8 py-3.5 text-sm font-medium",children:[E.jsx(w0,{className:"h-5 w-5 shrink-0 animate-spin text-primary",weight:"bold"}),E.jsx("span",{children:t})]})]})}),eY="data:image/svg+xml,%3csvg%20width='548'%20height='565'%20viewBox='0%200%20548%20565'%20fill='none'%20xmlns='http://www.w3.org/2000/svg'%3e%3cpath%20d='M136.53%20-0.00177124C170.301%20-0.00177124%20197.687%2027.3551%20197.724%2061.1255L198.089%20394.976C198.189%20486.214%20124.253%20560.23%2033.0153%20560.23C14.7818%20560.23%200.000557184%20545.449%200.000557184%20527.216V61.1923C0.000557184%2027.3957%2027.3981%20-0.00177124%2061.1947%20-0.00177124H136.53Z'%20fill='white'/%3e%3cpath%20d='M271.092%20463.876C271.092%20530.762%20310.368%20564.205%20388.919%20564.205C468.248%20564.205%20507.913%20530.762%20507.913%20463.876C507.913%20426.545%20498.191%20400.88%20478.748%20386.88C460.082%20372.103%20430.139%20364.715%20388.919%20364.715C350.032%20364.715%20320.478%20372.103%20300.257%20386.88C280.814%20400.88%20271.092%20426.545%20271.092%20463.876Z'%20fill='white'/%3e%3cpath%20d='M405.25%200.917969C408.273%200.917973%20411.331%201.11183%20414.358%201.66895C437.891%205.99962%20471.151%2018.8698%20498.612%2044.5137C526.065%2070.1496%20547.676%20108.515%20547.992%20163.691C547.992%20163.693%20547.994%20163.695%20547.997%20163.695C547.999%20163.695%20548.001%20163.697%20548.001%20163.7L547.996%20164.612L548.001%20165.526C548.001%20165.528%20547.999%20165.53%20547.997%20165.53C547.994%20165.53%20547.992%20165.532%20547.992%20165.535C547.665%20222.498%20524.643%20261.54%20495.935%20287.156C467.223%20312.776%20432.863%20324.939%20409.917%20328.291C409.844%20328.302%20409.769%20328.308%20409.695%20328.308H283.146C254.52%20328.308%20231.314%20305.102%20231.314%20276.477C231.315%20244.265%20255.799%20218.161%20287.447%20213.026C309.663%20209.422%20329.612%20204.399%20344.084%20196.322C354.361%20190.586%20359.717%20184.074%20362.521%20178.421C365.332%20172.756%20365.636%20167.843%20365.636%20165.225V163.994C365.635%20161.374%20365.33%20156.465%20362.521%20150.805C359.717%20145.152%20354.361%20138.639%20344.084%20132.903C329.612%20124.826%20309.663%20119.803%20287.447%20116.199C255.799%20111.065%20231.315%2084.9602%20231.314%2052.749C231.314%2024.1235%20254.52%200.917969%20283.146%200.917969H405.25Z'%20fill='white'/%3e%3c/svg%3e",r0=44,fd=8,Pp=16,tY=4,T8=-18,nY=.18,rY=[.22,1,.36,1],R8=.92,sY=1,iY=.95,oY=.4,aY=[.19,1,.22,1],U1=0,lY=1,uY=0,cY=0,dY=0,EI=({position:t,viewport:e,boundsLeft:n=0})=>{const r=n+fd,s=Math.max(r,e.width-r0-fd),i=Math.max(fd,e.height-r0-fd);return{x:Math.min(s,Math.max(r,t.x)),y:Math.min(i,Math.max(fd,t.y))}},yx=()=>({width:window.innerWidth,height:window.innerHeight}),fY=({position:t,boundsLeftPx:e=0})=>EI({position:t,viewport:yx(),boundsLeft:e}),hY=()=>{if(typeof window>"u")return{x:Pp,y:Pp};const t=yx();return{x:t.width-r0-Pp,y:t.height-r0-Pp}},pY=({deltaX:t,deltaY:e})=>Math.hypot(t,e)>=tY,mY=t=>t.button===void 0||t.button<=dY,A8=t=>{const e=t.nativeEvent;return{x:Number.isFinite(t.clientX)?t.clientX:e.clientX,y:Number.isFinite(t.clientY)?t.clientY:e.clientY}},gY=({isVisible:t,isPanelOpen:e,isReducedMotion:n,position:r,dragBoundsLeftPx:s=0,onToggle:i,onPositionChange:a})=>{const u=v.useRef(null),c=v.useRef(!1),[d,h]=v.useState(!1),[p,m]=v.useState(!1),_=n?!1:{opacity:U1,scale:R8,x:T8},w=n?{opacity:U1}:{opacity:U1,scale:R8,x:T8},y=n?{duration:cY}:{duration:nY,ease:rY,scale:{duration:oY,ease:aY}},x=v.useCallback(()=>{const R=u.current;R&&(c.current=R.hasMoved),u.current=null,h(!1)},[]),S=v.useCallback(R=>{const M=u.current;if(!M)return;const L=A8(R),A=L.x-M.startPointer.x,O=L.y-M.startPointer.y,D=M.hasMoved||pY({deltaX:A,deltaY:O});u.current={...M,hasMoved:D},D&&a(EI({position:{x:M.startPosition.x+A,y:M.startPosition.y+O},viewport:yx(),boundsLeft:s}))},[a,s]),P=v.useCallback(R=>{if(u.current||!mY(R))return;const M=A8(R);u.current={startPointer:M,startPosition:r,hasMoved:!1},h(!0)},[r]),T=v.useCallback(()=>{if(c.current){c.current=!1;return}i()},[i]),k=e?"Close panel":"Open panel";return E.jsxs(E.Fragment,{children:[d?E.jsx("div",{className:"fixed inset-0 z-40 cursor-grabbing","data-cy":"rivet-panel-launcher-drag-surface",onPointerMove:S,onPointerUp:x,onPointerCancel:x,onMouseMove:S,onMouseUp:x}):null,E.jsx(no,{children:t?E.jsx(Ji,{label:k,side:"top",forceOpen:p&&!d?void 0:!1,children:E.jsx(Sl.button,{type:"button","aria-label":k,"data-cy":"reopen-panel",onMouseEnter:()=>m(!0),onMouseLeave:()=>m(!1),initial:_,animate:{opacity:lY,scale:sY,x:uY},whileTap:{scale:iY},exit:w,transition:y,onPointerDown:P,onMouseDown:P,onPointerMove:S,onPointerUp:x,onPointerCancel:x,onMouseMove:S,onMouseUp:x,onClick:T,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:E.jsx("img",{src:eY,alt:"","aria-hidden":"true",draggable:!1,className:"h-4 w-4"})})}):null})]})},B1=Cs("useConfig"),vY=300*1e3,yY=1800*1e3,_Y=60*1e3,wY=300*1e3,xY=()=>{var t;return typeof window>"u"?null:((t=window.__RIVET_BOOTSTRAP__)==null?void 0:t.queueAccessToken)??null},bY=()=>{var t;return typeof window>"u"?null:((t=window.__RIVET_BOOTSTRAP__)==null?void 0:t.agentApplyMode)??null},SY=t=>({...y5,...t??{}}),EY=()=>{const t=et(H_),e=at(H_),n=at(T5),r=at(R5),s=at(x0),i=at(RB),a=at(P5),u=at(PB),c=at(Mf),d=at(b5),h=v.useCallback(S=>{a(S.agentModeAvailable),d({name:S.name??null,email:S.email??null}),S.isMCPSession&&n(!0),S.mcpEditor&&r(S.mcpEditor),s(S.agentApplyMode??bY()??null),i(S.queueAccessToken??xY())},[s,a,n,r,i,d]),p=dy({queryKey:["rivet-config"],queryFn:async()=>{const S=await fetch("/api/config");if(!S.ok)throw new Error(`Failed to fetch config: ${S.statusText}`);return await S.json()},staleTime:vY,gcTime:yY}),m=dy({queryKey:["rivet-feature-flags"],queryFn:async()=>{const S=await fetch("/api/feature-flags");if(!S.ok)throw new Error(`Failed to fetch feature flags: ${S.statusText}`);return await S.json()},staleTime:_Y,gcTime:wY}),{refetch:_}=p,{refetch:w}=m;v.useLayoutEffect(()=>{p.data&&(h(p.data),c(!1),B1.info("Config loaded:",p.data)),m.data&&(e(SY(m.data.featureFlags)),u(!0))},[p.data,m.data,h,c,e,u]),v.useLayoutEffect(()=>{p.error&&(u(!0),c(!1),B1.warn("Failed to load config:",p.error instanceof Error?p.error.message:"Failed to load config")),m.error&&(u(!0),B1.warn("Failed to load feature flags:",m.error instanceof Error?m.error.message:"Failed to load feature flags"))},[p.error,m.error,c,u]);const y=v.useCallback(async()=>{const[S]=await Promise.all([_(),w()]);return S.data?S.data:null},[_,w]);let x=null;return p.error instanceof Error?x=p.error.message:p.error&&(x="Failed to load config"),{config:p.data??null,featureFlags:t,loading:p.isPending||!p.error&&m.isPending,error:x,refetchConfig:y}},tm="rivet_just_signed_in",gu=Cs("useOAuthCallback"),CY="https://rivet-proxy.onrender.com",kY=()=>{const[t,e]=v.useState({isProcessing:!1,isComplete:!1,error:null});return v.useEffect(()=>{const n=new AbortController;let r=!1;return(async()=>{var u,c,d;const i=window.location.hash,a=window.location.search;if(!(!i||!i.includes("access_token"))&&!r){e({isProcessing:!0,isComplete:!1,error:null});try{gu.info("Processing OAuth callback...");const h=new URLSearchParams(i.substring(1)),p=h.get("access_token"),m=h.get("refresh_token"),w=new URLSearchParams(a).get("session");if(!p)throw new Error("No access token found in URL");if(!w)throw new Error("No session ID found in URL");gu.info(`Completing OAuth with session: ${w}`);const y=await fetch(`${CY}/api/auth/google/complete`,{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({sessionId:w,accessToken:p,refreshToken:m}),signal:n.signal}),x=await y.json();if(!y.ok||!x.success)throw new Error(x.error||x.message||"Failed to complete authentication");if(gu.info("OAuth authentication completed successfully"),r)return;if((u=x.user)!=null&&u.id?(Se.identify(x.user.id,{...x.user.email?{email:x.user.email}:{}}),x.user.email&&Se.alias(x.user.email,x.user.id)):(c=x.user)!=null&&c.email&&Se.identify(x.user.email,{email:x.user.email}),(d=x.user)!=null&&d.email&&p)try{const P=await fetch("/api/auth/store",{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({email:x.user.email,token:p,refreshToken:m,userId:x.user.id}),signal:n.signal});P.ok||gu.warn(`Local auth store returned ${P.status}`)}catch(P){if(r)return;gu.warn("Failed to store auth locally:",P)}if(r)return;window.sessionStorage.setItem(tm,"1");const S=window.location.pathname;window.history.replaceState({},document.title,S),e({isProcessing:!1,isComplete:!0,error:null})}catch(h){if(r)return;const p=h instanceof Error?h.message:"Unknown error occurred";gu.warn("OAuth callback error:",h),e({isProcessing:!1,isComplete:!1,error:p})}}})(),()=>{r=!0,n.abort()}},[]),t},W1=Cs("useAgentVariantsSession"),PY=t=>typeof t.pendingCount=="number"&&t.pendingCount===0&&(t.pendingVariantRequests??0)===0&&(t.leasedVariantRequests??0)===0&&(t.activeLeases??[]).length===0,I8=(t,e,n)=>{e.size===0&&!n||t.set(rf,r=>{if(r.size===0)return r;const s=new Map(r);let i=!1;for(const[a,u]of r)u.status==="sending"&&u.variantRequestId&&(e.has(u.variantRequestId)||n&&u.variantRequest!==void 0)&&(s.delete(a),i=!0);return i?s:r})},TY=(t,e)=>{var s;if(t.size===0)return t;let n=!1;const r=new Map(t);for(const[i,a]of t){if(a.status!=="sending"||!a.awaitingSnapshotOutcome||a.variantRequest!==void 0)continue;const u=a.target;if(!u||u.kind!=="variant"||u.sessionId!==e.sessionId)continue;const c=(s=e.variants.find(d=>d.workItemId===u.variantId))==null?void 0:s.refinement;c&&(c.status==="succeeded"?(r.set(i,{...a,status:"complete",awaitingSnapshotOutcome:void 0}),n=!0):(c.status==="failed"||c.status==="cancelled")&&(r.set(i,{...a,status:"error",awaitingSnapshotOutcome:void 0}),n=!0))}return n?r:t},RY=({enabled:t=!0}={})=>{const e=at(If),n=at(_5),r=at(bB),s=at(C5),i=at(kB),a=H2(),u=v.useRef(null);v.useEffect(()=>{if(!t)return;const c=new EventSource("/api/variants/events");return c.onmessage=d=>{try{const h=JSON.parse(d.data),p=u.current;if(h.active){const w=new Set(h.variants.map(y=>y.requestId).filter(y=>!!y));s(y=>y.filter(S=>!w.has(S.requestId))),I8(a,w,!1),a.set(rf,y=>{let x=y;for(const S of h.variants){const P=S.adoptedSource;P&&(x=CB(x,{kind:"variant",sessionId:P.sessionId,variantId:P.variantId},{kind:"variant",sessionId:h.sessionId,variantId:S.workItemId}))}return x}),a.set(rf,y=>TY(y,h)),h.sessionId!==u.current&&(u.current=h.sessionId,n(!0),r("directions"))}else u.current=null,I8(a,new Set,PY(h));e(h);const m=!h.active&&p!==null,_=h.active&&h.sessionId!==p;if(_&&fetch(`/api/variants/${h.sessionId}/preview-port`,{method:"POST",headers:{"content-type":"application/json"},body:JSON.stringify({variantId:null})}).catch(w=>W1.warn("failed to reset preview-port on session switch",w)),m||_){const w=new Set;if(h.active)for(const x of h.variants)w.add(tf({kind:"variant",sessionId:h.sessionId,variantId:x.workItemId}));const y=a.get(ao);for(const x of[y==null?void 0:y.left,y==null?void 0:y.right])x&&w.add(tf({kind:"variant",sessionId:x.sessionId,variantId:x.variantId}));i(w)}}catch(h){W1.warn("failed to parse SSE event payload",h)}},c.onerror=d=>{W1.warn("SSE error (auto-reconnects)",d)},()=>{c.close()}},[t,e,n,r,s,i,a])};var AY=Object.defineProperty,An=(t,e)=>AY(t,"name",{value:e,configurable:!0});function _x(t){const e=t+"CollectionProvider",[n,r]=_i(e),[s,i]=n(e,{collectionRef:{current:null},itemMap:new Map}),a=An(y=>{const{scope:x,children:S}=y,P=v.useRef(null),T=v.useRef(new Map).current;return E.jsx(s,{scope:x,itemMap:T,collectionRef:P,children:S})},"CollectionProvider");a.displayName=e;const u=t+"CollectionSlot",c=ca(u),d=v.forwardRef((y,x)=>{const{scope:S,children:P}=y,T=i(u,S),k=Vt(x,T.collectionRef);return E.jsx(c,{ref:k,children:P})});d.displayName=u;const h=t+"CollectionItemSlot",p="data-radix-collection-item",m=ca(h),_=v.forwardRef((y,x)=>{const{scope:S,children:P,...T}=y,k=v.useRef(null),R=Vt(x,k),M=i(h,S);return v.useEffect(()=>(M.itemMap.set(k,{ref:k,...T}),()=>void M.itemMap.delete(k))),E.jsx(m,{[p]:"",ref:R,children:P})});_.displayName=h;function w(y){const x=i(t+"CollectionConsumer",y);return v.useCallback(()=>{const P=x.collectionRef.current;if(!P)return[];const T=Array.from(P.querySelectorAll(`[${p}]`));return Array.from(x.itemMap.values()).sort((M,L)=>T.indexOf(M.ref.current)-T.indexOf(L.ref.current))},[x.collectionRef,x.itemMap])}return An(w,"useCollection"),[{Provider:a,Slot:d,ItemSlot:_},w,r]}An(_x,"createCollection");var M8=new WeakMap,gn,Br,q1=(Br=class extends Map{constructor(n){super(n);He(this,gn);ke(this,gn,[...super.keys()]),M8.set(this,!0)}set(n,r){return M8.get(this)&&(this.has(n)?z(this,gn)[z(this,gn).indexOf(n)]=n:z(this,gn).push(n)),super.set(n,r),this}insert(n,r,s){const i=this.has(r),a=z(this,gn).length,u=wx(n);let c=u>=0?u:a+u;const d=c<0||c>=a?-1:c;if(d===this.size||i&&d===this.size-1||d===-1)return this.set(r,s),this;const h=this.size+(i?0:1);u<0&&c++;const p=[...z(this,gn)];let m,_=!1;for(let w=c;w<h;w++)if(c===w){let y=p[w];p[w]===r&&(y=p[w+1]),i&&this.delete(r),m=this.get(y),this.set(r,s)}else{!_&&p[w-1]===r&&(_=!0);const y=p[_?w:w-1],x=m;m=this.get(y),this.delete(y),this.set(y,x)}return this}with(n,r,s){const i=new Br(this);return i.insert(n,r,s),i}before(n){const r=z(this,gn).indexOf(n)-1;if(!(r<0))return this.entryAt(r)}setBefore(n,r,s){const i=z(this,gn).indexOf(n);return i===-1?this:this.insert(i,r,s)}after(n){let r=z(this,gn).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=z(this,gn).indexOf(n);return i===-1?this:this.insert(i+1,r,s)}first(){return this.entryAt(0)}last(){return this.entryAt(-1)}clear(){return ke(this,gn,[]),super.clear()}delete(n){const r=super.delete(n);return r&&z(this,gn).splice(z(this,gn).indexOf(n),1),r}deleteAt(n){const r=this.keyAt(n);return r!==void 0?this.delete(r):!1}at(n){const r=nm(z(this,gn),n);if(r!==void 0)return this.get(r)}entryAt(n){const r=nm(z(this,gn),n);if(r!==void 0)return[r,this.get(r)]}indexOf(n){return z(this,gn).indexOf(n)}keyAt(n){return nm(z(this,gn),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 a of this)Reflect.apply(n,r,[a,i,this])&&s.push(a),i++;return new Br(s)}map(n,r){const s=[];let i=0;for(const a of this)s.push([a[0],Reflect.apply(n,r,[a,i,this])]),i++;return new Br(s)}reduce(...n){const[r,s]=n;let i=0,a=s??this.at(0);for(const u of this)i===0&&n.length===1?a=u:a=Reflect.apply(r,this,[a,u,i,this]),i++;return a}reduceRight(...n){const[r,s]=n;let i=s??this.at(-1);for(let a=this.size-1;a>=0;a--){const u=this.at(a);a===this.size-1&&n.length===1?i=u:i=Reflect.apply(r,this,[i,u,a,this])}return i}toSorted(n){const r=[...this.entries()].sort(n);return new Br(r)}toReversed(){const n=new Br;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 Br(r)}slice(n,r){const s=new Br;let i=this.size-1;if(n===void 0)return s;n<0&&(n=n+this.size),r!==void 0&&r>0&&(i=r-1);for(let a=n;a<=i;a++){const u=this.keyAt(a),c=this.get(u);s.set(u,c)}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}},gn=new WeakMap,An(Br,"OrderedDict"),Br);function nm(t,e){if("at"in Array.prototype)return Array.prototype.at.call(t,e);const n=CI(t,e);return n===-1?void 0:t[n]}An(nm,"at");function CI(t,e){const n=t.length,r=wx(e),s=r>=0?r:n+r;return s<0||s>=n?-1:s}An(CI,"toSafeIndex");function wx(t){return t!==t||t===0?0:Math.trunc(t)}An(wx,"toSafeInteger");function IY(t){const e=t+"CollectionProvider",[n,r]=_i(e),[s,i]=n(e,{collectionElement:null,collectionRef:{current:null},collectionRefObject:{current:null},itemMap:new q1,setItemMap:An(()=>{},"setItemMap")}),a=An(({state:T,...k})=>T?E.jsx(c,{...k,state:T}):E.jsx(u,{...k}),"CollectionProvider");a.displayName=e;const u=An(T=>{const k=x();return E.jsx(c,{...T,state:k})},"CollectionInit");u.displayName=e+"Init";const c=An(T=>{const{scope:k,children:R,state:M}=T,L=v.useRef(null),[A,O]=v.useState(null),D=Vt(L,O),[N,j]=M;return v.useEffect(()=>{if(!A)return;const G=TI(()=>{});return G.observe(A,{childList:!0,subtree:!0}),()=>{G.disconnect()}},[A]),E.jsx(s,{scope:k,itemMap:N,setItemMap:j,collectionRef:D,collectionRefObject:L,collectionElement:A,children:R})},"CollectionProviderImpl");c.displayName=e+"Impl";const d=t+"CollectionSlot",h=ca(d),p=v.forwardRef((T,k)=>{const{scope:R,children:M}=T,L=i(d,R),A=Vt(k,L.collectionRef);return E.jsx(h,{ref:A,children:M})});p.displayName=d;const m=t+"CollectionItemSlot",_="data-radix-collection-item",w=ca(m),y=v.forwardRef((T,k)=>{const{scope:R,children:M,...L}=T,A=v.useRef(null),[O,D]=v.useState(null),N=Vt(k,A,D),j=i(m,R),{setItemMap:G}=j,Y=v.useRef(L);kI(Y.current,L)||(Y.current=L);const W=Y.current;return v.useEffect(()=>{const q=W;return G(Z=>O?Z.has(O)?Z.set(O,{...q,element:O}).toSorted(c2):(Z.set(O,{...q,element:O}),Z.toSorted(c2)):Z),()=>{G(Z=>!O||!Z.has(O)?Z:(Z.delete(O),new q1(Z)))}},[O,W,G]),E.jsx(w,{[_]:"",ref:N,children:M})});y.displayName=m;function x(){return v.useState(new q1)}An(x,"useInitCollection");function S(T){const{itemMap:k}=i(t+"CollectionConsumer",T);return k}return An(S,"useCollection"),[{Provider:a,Slot:p,ItemSlot:y},{createCollectionScope:r,useCollection:S,useInitCollection:x}]}An(IY,"createCollection");function kI(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}An(kI,"shallowEqual");function PI(t,e){return!!(e.compareDocumentPosition(t)&Node.DOCUMENT_POSITION_PRECEDING)}An(PI,"isElementPreceding");function c2(t,e){return!t[1].element||!e[1].element?0:PI(t[1].element,e[1].element)?-1:1}An(c2,"sortByDocumentPosition");function TI(t){return new MutationObserver(n=>{for(const r of n)if(r.type==="childList"){t();return}})}An(TI,"getChildListObserver");var MY=Object.defineProperty,Df=(t,e)=>MY(t,"name",{value:e,configurable:!0}),xx="Collapsible",[OY,RI]=_i(xx),[LY,bx]=OY(xx),DY=v.forwardRef(Df(function(e,n){const{__scopeCollapsible:r,open:s,defaultOpen:i,disabled:a,onOpenChange:u,...c}=e,[d,h]=va({prop:s,defaultProp:i??!1,onChange:u,caller:xx});return E.jsx(LY,{scope:r,disabled:a,contentId:na(),open:d,onOpenToggle:v.useCallback(()=>h(p=>!p),[h]),children:E.jsx(dn.div,{"data-state":L0(d),"data-disabled":a?"":void 0,...c,ref:n})})},"Collapsible")),NY="CollapsibleTrigger",jY=v.forwardRef(Df(function(e,n){const{__scopeCollapsible:r,...s}=e,i=bx(NY,r);return E.jsx(dn.button,{type:"button","aria-controls":i.open?i.contentId:void 0,"aria-expanded":i.open||!1,"data-state":L0(i.open),"data-disabled":i.disabled?"":void 0,disabled:i.disabled,...s,ref:n,onClick:Ft(e.onClick,i.onOpenToggle)})},"CollapsibleTrigger")),AI="CollapsibleContent",FY=v.forwardRef(Df(function(e,n){const{forceMount:r,...s}=e,i=bx(AI,e.__scopeCollapsible);return E.jsx(ya,{present:r||i.open,children:({present:a})=>E.jsx($Y,{...s,ref:n,present:a})})},"CollapsibleContent")),$Y=v.forwardRef(Df(function(e,n){const{__scopeCollapsible:r,present:s,children:i,...a}=e,u=bx(AI,r),[c,d]=v.useState(s),h=v.useRef(null),p=Vt(n,h),m=v.useRef(0),_=m.current,w=v.useRef(0),y=w.current,x=u.open||c,S=v.useRef(x),P=v.useRef(void 0);return v.useEffect(()=>{const T=requestAnimationFrame(()=>S.current=!1);return()=>cancelAnimationFrame(T)},[]),Rr(()=>{const T=h.current;if(T){P.current=P.current||{transitionDuration:T.style.transitionDuration,animationName:T.style.animationName},T.style.transitionDuration="0s",T.style.animationName="none";const k=T.getBoundingClientRect();m.current=k.height,w.current=k.width,S.current||(T.style.transitionDuration=P.current.transitionDuration,T.style.animationName=P.current.animationName),d(s)}},[u.open,s]),E.jsx(dn.div,{"data-state":L0(u.open),"data-disabled":u.disabled?"":void 0,id:u.contentId,hidden:!x,...a,ref:p,style:{"--radix-collapsible-content-height":_?`${_}px`:void 0,"--radix-collapsible-content-width":y?`${y}px`:void 0,...e.style},children:x&&i})},"CollapsibleContentImpl"));function L0(t){return t?"open":"closed"}Df(L0,"getState");var VY=DY,HY=jY,zY=FY,UY=Object.defineProperty,BY=(t,e)=>UY(t,"name",{value:e,configurable:!0}),WY=v.createContext(void 0);function Sx(t){const e=v.useContext(WY);return t||e||"ltr"}BY(Sx,"useDirection");var qY=Object.defineProperty,ns=(t,e)=>qY(t,"name",{value:e,configurable:!0}),wi="Accordion",GY=["Home","End","ArrowDown","ArrowUp","ArrowLeft","ArrowRight"],[Ex,KY,ZY]=_x(wi),[D0,uee]=_i(wi,[ZY,RI]),Cx=RI(),YY=v.forwardRef(ns(function(e,n){const{type:r,...s}=e,i=s,a=s;return E.jsx(Ex.Provider,{scope:e.__scopeAccordion,children:r==="multiple"?E.jsx(eX,{...a,ref:n}):E.jsx(JY,{...i,ref:n})})},"Accordion")),[II,XY]=D0(wi),[MI,QY]=D0(wi,{collapsible:!1}),JY=v.forwardRef(ns(function(e,n){const{value:r,defaultValue:s,onValueChange:i=ns(()=>{},"onValueChange"),collapsible:a=!1,...u}=e,[c,d]=va({prop:r,defaultProp:s??"",onChange:i,caller:wi});return E.jsx(II,{scope:e.__scopeAccordion,value:v.useMemo(()=>c?[c]:[],[c]),onItemOpen:d,onItemClose:v.useCallback(()=>a&&d(""),[a,d]),children:E.jsx(MI,{scope:e.__scopeAccordion,collapsible:a,children:E.jsx(OI,{...u,ref:n})})})},"AccordionImplSingle")),eX=v.forwardRef(ns(function(e,n){const{value:r,defaultValue:s,onValueChange:i=ns(()=>{},"onValueChange"),...a}=e,[u,c]=va({prop:r,defaultProp:s??[],onChange:i,caller:wi}),d=v.useCallback(p=>c((m=[])=>[...m,p]),[c]),h=v.useCallback(p=>c((m=[])=>m.filter(_=>_!==p)),[c]);return E.jsx(II,{scope:e.__scopeAccordion,value:u,onItemOpen:d,onItemClose:h,children:E.jsx(MI,{scope:e.__scopeAccordion,collapsible:!0,children:E.jsx(OI,{...a,ref:n})})})},"AccordionImplMultiple")),[tX,N0]=D0(wi),OI=v.forwardRef(ns(function(e,n){const{__scopeAccordion:r,disabled:s,dir:i,orientation:a="vertical",...u}=e,c=v.useRef(null),d=Vt(c,n),h=KY(r),m=Sx(i)==="ltr",_=Ft(e.onKeyDown,w=>{var O;if(!GY.includes(w.key))return;const y=w.target,x=h().filter(D=>{var N;return!((N=D.ref.current)!=null&&N.disabled)}),S=x.findIndex(D=>D.ref.current===y),P=x.length;if(S===-1)return;w.preventDefault();let T=S;const k=0,R=P-1,M=ns(()=>{T=S+1,T>R&&(T=k)},"moveNext"),L=ns(()=>{T=S-1,T<k&&(T=R)},"movePrev");switch(w.key){case"Home":T=k;break;case"End":T=R;break;case"ArrowRight":a==="horizontal"&&(m?M():L());break;case"ArrowDown":a==="vertical"&&M();break;case"ArrowLeft":a==="horizontal"&&(m?L():M());break;case"ArrowUp":a==="vertical"&&L();break}const A=T%P;(O=x[A].ref.current)==null||O.focus()});return E.jsx(tX,{scope:r,disabled:s,direction:i,orientation:a,children:E.jsx(Ex.Slot,{scope:r,children:E.jsx(dn.div,{...u,"data-orientation":a,ref:d,onKeyDown:s?void 0:_})})})},"AccordionImpl")),d2="AccordionItem",[nX,kx]=D0(d2),rX=v.forwardRef(ns(function(e,n){const{__scopeAccordion:r,value:s,...i}=e,a=N0(d2,r),u=XY(d2,r),c=Cx(r),d=na(),h=s&&u.value.includes(s)||!1,p=a.disabled||e.disabled;return E.jsx(nX,{scope:r,open:h,disabled:p,triggerId:d,children:E.jsx(VY,{"data-orientation":a.orientation,"data-state":Px(h),...c,...i,ref:n,disabled:p,open:h,onOpenChange:m=>{m?u.onItemOpen(s):u.onItemClose(s)}})})},"AccordionItem")),sX="AccordionHeader",iX=v.forwardRef(ns(function(e,n){const{__scopeAccordion:r,...s}=e,i=N0(wi,r),a=kx(sX,r);return E.jsx(dn.h3,{"data-orientation":i.orientation,"data-state":Px(a.open),"data-disabled":a.disabled?"":void 0,...s,ref:n})},"AccordionHeader")),O8="AccordionTrigger",oX=v.forwardRef(ns(function(e,n){const{__scopeAccordion:r,...s}=e,i=N0(wi,r),a=kx(O8,r),u=QY(O8,r),c=Cx(r);return E.jsx(Ex.ItemSlot,{scope:r,children:E.jsx(HY,{"aria-disabled":a.open&&!u.collapsible||void 0,"data-orientation":i.orientation,id:a.triggerId,...c,...s,ref:n})})},"AccordionTrigger")),aX="AccordionContent",lX=v.forwardRef(ns(function(e,n){const{__scopeAccordion:r,...s}=e,i=N0(wi,r),a=kx(aX,r),u=Cx(r);return E.jsx(zY,{role:"region","aria-labelledby":a.triggerId,"data-orientation":i.orientation,...u,...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 Px(t){return t?"open":"closed"}ns(Px,"getState");var LI=YY,uX=rX,cX=iX,dX=oX,fX=lX;/**
130
- * @license lucide-react v1.31.0 - ISC
131
- *
132
- * This source code is licensed under the ISC license.
133
- * See the LICENSE file in the root directory of this source tree.
134
- */const DI=(...t)=>t.filter((e,n,r)=>!!e&&e.trim()!==""&&r.indexOf(e)===n).join(" ").trim();/**
135
- * @license lucide-react v1.31.0 - ISC
136
- *
137
- * This source code is licensed under the ISC license.
138
- * See the LICENSE file in the root directory of this source tree.
139
- */const hX=t=>t.replace(/([a-z0-9])([A-Z])/g,"$1-$2").toLowerCase();/**
140
- * @license lucide-react v1.31.0 - ISC
141
- *
142
- * This source code is licensed under the ISC license.
143
- * See the LICENSE file in the root directory of this source tree.
144
- */const pX=t=>t.replace(/^([A-Z])|[\s-_]+(\w)/g,(e,n,r)=>r?r.toUpperCase():n.toLowerCase());/**
145
- * @license lucide-react v1.31.0 - ISC
146
- *
147
- * This source code is licensed under the ISC license.
148
- * See the LICENSE file in the root directory of this source tree.
149
- */const L8=t=>{const e=pX(t);return e.charAt(0).toUpperCase()+e.slice(1)};/**
150
- * @license lucide-react v1.31.0 - ISC
151
- *
152
- * This source code is licensed under the ISC license.
153
- * See the LICENSE file in the root directory of this source tree.
154
- */var G1={xmlns:"http://www.w3.org/2000/svg",width:24,height:24,viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:2,strokeLinecap:"round",strokeLinejoin:"round"};/**
155
- * @license lucide-react v1.31.0 - ISC
156
- *
157
- * This source code is licensed under the ISC license.
158
- * See the LICENSE file in the root directory of this source tree.
159
- */const mX=t=>{for(const e in t)if(e.startsWith("aria-")||e==="role"||e==="title")return!0;return!1},gX=v.createContext({}),vX=()=>v.useContext(gX),yX=v.forwardRef(({color:t,size:e,strokeWidth:n,absoluteStrokeWidth:r,className:s="",children:i,iconNode:a,...u},c)=>{const{size:d=24,strokeWidth:h=2,absoluteStrokeWidth:p=!1,color:m="currentColor",className:_=""}=vX()??{},w=r??p?Number(n??h)*24/Number(e??d):n??h;return v.createElement("svg",{ref:c,...G1,width:e??d??G1.width,height:e??d??G1.height,stroke:t??m,strokeWidth:w,className:DI("lucide",_,s),...!i&&!mX(u)&&{"aria-hidden":"true"},...u},[...a.map(([y,x])=>v.createElement(y,x)),...Array.isArray(i)?i:[i]])});/**
160
- * @license lucide-react v1.31.0 - ISC
161
- *
162
- * This source code is licensed under the ISC license.
163
- * See the LICENSE file in the root directory of this source tree.
164
- */const Je=(t,e)=>{const n=v.forwardRef(({className:r,...s},i)=>v.createElement(yX,{ref:i,iconNode:e,className:DI(`lucide-${hX(L8(t))}`,`lucide-${t}`,r),...s}));return n.displayName=L8(t),n};/**
165
- * @license lucide-react v1.31.0 - ISC
166
- *
167
- * This source code is licensed under the ISC license.
168
- * See the LICENSE file in the root directory of this source tree.
169
- */const _X=[["path",{d:"m12 19-7-7 7-7",key:"1l729n"}],["path",{d:"M19 12H5",key:"x3x0zl"}]],wX=Je("arrow-left",_X);/**
170
- * @license lucide-react v1.31.0 - ISC
171
- *
172
- * This source code is licensed under the ISC license.
173
- * See the LICENSE file in the root directory of this source tree.
174
- */const xX=[["path",{d:"M5 12h14",key:"1ays0h"}],["path",{d:"m12 5 7 7-7 7",key:"xquz4c"}]],bX=Je("arrow-right",xX);/**
175
- * @license lucide-react v1.31.0 - ISC
176
- *
177
- * This source code is licensed under the ISC license.
178
- * See the LICENSE file in the root directory of this source tree.
179
- */const SX=[["path",{d:"m5 12 7-7 7 7",key:"hav0vg"}],["path",{d:"M12 19V5",key:"x0mq9r"}]],EX=Je("arrow-up",SX);/**
180
- * @license lucide-react v1.31.0 - ISC
181
- *
182
- * This source code is licensed under the ISC license.
183
- * See the LICENSE file in the root directory of this source tree.
184
- */const CX=[["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"}]],kX=Je("bell",CX);/**
185
- * @license lucide-react v1.31.0 - ISC
186
- *
187
- * This source code is licensed under the ISC license.
188
- * See the LICENSE file in the root directory of this source tree.
189
- */const PX=[["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"}]],TX=Je("brain",PX);/**
190
- * @license lucide-react v1.31.0 - ISC
191
- *
192
- * This source code is licensed under the ISC license.
193
- * See the LICENSE file in the root directory of this source tree.
194
- */const RX=[["path",{d:"M20 6 9 17l-5-5",key:"1gmf2c"}]],AX=Je("check",RX);/**
195
- * @license lucide-react v1.31.0 - ISC
196
- *
197
- * This source code is licensed under the ISC license.
198
- * See the LICENSE file in the root directory of this source tree.
199
- */const IX=[["path",{d:"m6 9 6 6 6-6",key:"qrunsl"}]],MX=Je("chevron-down",IX);/**
200
- * @license lucide-react v1.31.0 - ISC
201
- *
202
- * This source code is licensed under the ISC license.
203
- * See the LICENSE file in the root directory of this source tree.
204
- */const OX=[["path",{d:"m9 18 6-6-6-6",key:"mthhwq"}]],LX=Je("chevron-right",OX);/**
205
- * @license lucide-react v1.31.0 - ISC
206
- *
207
- * This source code is licensed under the ISC license.
208
- * See the LICENSE file in the root directory of this source tree.
209
- */const DX=[["circle",{cx:"12",cy:"12",r:"10",key:"1mglay"}]],NX=Je("circle",DX);/**
210
- * @license lucide-react v1.31.0 - ISC
211
- *
212
- * This source code is licensed under the ISC license.
213
- * See the LICENSE file in the root directory of this source tree.
214
- */const jX=[["circle",{cx:"12",cy:"12",r:"10",key:"1mglay"}],["path",{d:"M12 6v6l4 2",key:"mmk7yg"}]],FX=Je("clock",jX);/**
215
- * @license lucide-react v1.31.0 - ISC
216
- *
217
- * This source code is licensed under the ISC license.
218
- * See the LICENSE file in the root directory of this source tree.
219
- */const $X=[["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"}]],VX=Je("copy",$X);/**
220
- * @license lucide-react v1.31.0 - ISC
221
- *
222
- * This source code is licensed under the ISC license.
223
- * See the LICENSE file in the root directory of this source tree.
224
- */const HX=[["circle",{cx:"12",cy:"12",r:"1",key:"41hilf"}]],zX=Je("dot",HX);/**
225
- * @license lucide-react v1.31.0 - ISC
226
- *
227
- * This source code is licensed under the ISC license.
228
- * See the LICENSE file in the root directory of this source tree.
229
- */const UX=[["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"}]],BX=Je("globe",UX);/**
230
- * @license lucide-react v1.31.0 - ISC
231
- *
232
- * This source code is licensed under the ISC license.
233
- * See the LICENSE file in the root directory of this source tree.
234
- */const WX=[["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"}]],qX=Je("heart",WX);/**
235
- * @license lucide-react v1.31.0 - ISC
236
- *
237
- * This source code is licensed under the ISC license.
238
- * See the LICENSE file in the root directory of this source tree.
239
- */const GX=[["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"}]],KX=Je("house",GX);/**
240
- * @license lucide-react v1.31.0 - ISC
241
- *
242
- * This source code is licensed under the ISC license.
243
- * See the LICENSE file in the root directory of this source tree.
244
- */const ZX=[["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"}]],YX=Je("image",ZX);/**
245
- * @license lucide-react v1.31.0 - ISC
246
- *
247
- * This source code is licensed under the ISC license.
248
- * See the LICENSE file in the root directory of this source tree.
249
- */const XX=[["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"}]],QX=Je("inbox",XX);/**
250
- * @license lucide-react v1.31.0 - ISC
251
- *
252
- * This source code is licensed under the ISC license.
253
- * See the LICENSE file in the root directory of this source tree.
254
- */const JX=[["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"}]],eQ=Je("lightbulb",JX);/**
255
- * @license lucide-react v1.31.0 - ISC
256
- *
257
- * This source code is licensed under the ISC license.
258
- * See the LICENSE file in the root directory of this source tree.
259
- */const tQ=[["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"}]],nQ=Je("link",tQ);/**
260
- * @license lucide-react v1.31.0 - ISC
261
- *
262
- * This source code is licensed under the ISC license.
263
- * See the LICENSE file in the root directory of this source tree.
264
- */const rQ=[["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"}]],sQ=Je("loader",rQ);/**
265
- * @license lucide-react v1.31.0 - ISC
266
- *
267
- * This source code is licensed under the ISC license.
268
- * See the LICENSE file in the root directory of this source tree.
269
- */const iQ=[["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"}]],oQ=Je("lock",iQ);/**
270
- * @license lucide-react v1.31.0 - ISC
271
- *
272
- * This source code is licensed under the ISC license.
273
- * See the LICENSE file in the root directory of this source tree.
274
- */const aQ=[["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"}]],lQ=Je("mail",aQ);/**
275
- * @license lucide-react v1.31.0 - ISC
276
- *
277
- * This source code is licensed under the ISC license.
278
- * See the LICENSE file in the root directory of this source tree.
279
- */const uQ=[["path",{d:"M4 5h16",key:"1tepv9"}],["path",{d:"M4 12h16",key:"1lakjw"}],["path",{d:"M4 19h16",key:"1djgab"}]],cQ=Je("menu",uQ);/**
280
- * @license lucide-react v1.31.0 - ISC
281
- *
282
- * This source code is licensed under the ISC license.
283
- * See the LICENSE file in the root directory of this source tree.
284
- */const dQ=[["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"}]],fQ=Je("message-circle",dQ);/**
285
- * @license lucide-react v1.31.0 - ISC
286
- *
287
- * This source code is licensed under the ISC license.
288
- * See the LICENSE file in the root directory of this source tree.
289
- */const hQ=[["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"}]],pQ=Je("monitor",hQ);/**
290
- * @license lucide-react v1.31.0 - ISC
291
- *
292
- * This source code is licensed under the ISC license.
293
- * See the LICENSE file in the root directory of this source tree.
294
- */const mQ=[["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"}]],gQ=Je("moon",mQ);/**
295
- * @license lucide-react v1.31.0 - ISC
296
- *
297
- * This source code is licensed under the ISC license.
298
- * See the LICENSE file in the root directory of this source tree.
299
- */const vQ=[["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"}]],yQ=Je("paintbrush",vQ);/**
300
- * @license lucide-react v1.31.0 - ISC
301
- *
302
- * This source code is licensed under the ISC license.
303
- * See the LICENSE file in the root directory of this source tree.
304
- */const _Q=[["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"}]],wQ=Je("palette",_Q);/**
305
- * @license lucide-react v1.31.0 - ISC
306
- *
307
- * This source code is licensed under the ISC license.
308
- * See the LICENSE file in the root directory of this source tree.
309
- */const xQ=[["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"}]],bQ=Je("pause",xQ);/**
310
- * @license lucide-react v1.31.0 - ISC
311
- *
312
- * This source code is licensed under the ISC license.
313
- * See the LICENSE file in the root directory of this source tree.
314
- */const SQ=[["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"}]],EQ=Je("pencil",SQ);/**
315
- * @license lucide-react v1.31.0 - ISC
316
- *
317
- * This source code is licensed under the ISC license.
318
- * See the LICENSE file in the root directory of this source tree.
319
- */const CQ=[["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"}]],kQ=Je("pipette",CQ);/**
320
- * @license lucide-react v1.31.0 - ISC
321
- *
322
- * This source code is licensed under the ISC license.
323
- * See the LICENSE file in the root directory of this source tree.
324
- */const PQ=[["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"}]],TQ=Je("play",PQ);/**
325
- * @license lucide-react v1.31.0 - ISC
326
- *
327
- * This source code is licensed under the ISC license.
328
- * See the LICENSE file in the root directory of this source tree.
329
- */const RQ=[["path",{d:"M5 12h14",key:"1ays0h"}],["path",{d:"M12 5v14",key:"s699le"}]],AQ=Je("plus",RQ);/**
330
- * @license lucide-react v1.31.0 - ISC
331
- *
332
- * This source code is licensed under the ISC license.
333
- * See the LICENSE file in the root directory of this source tree.
334
- */const IQ=[["rect",{width:"20",height:"12",x:"2",y:"6",rx:"2",key:"9lu3g6"}]],MQ=Je("rectangle-horizontal",IQ);/**
335
- * @license lucide-react v1.31.0 - ISC
336
- *
337
- * This source code is licensed under the ISC license.
338
- * See the LICENSE file in the root directory of this source tree.
339
- */const OQ=[["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"}]],LQ=Je("rocket",OQ);/**
340
- * @license lucide-react v1.31.0 - ISC
341
- *
342
- * This source code is licensed under the ISC license.
343
- * See the LICENSE file in the root directory of this source tree.
344
- */const DQ=[["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"}]],NQ=Je("rotate-ccw",DQ);/**
345
- * @license lucide-react v1.31.0 - ISC
346
- *
347
- * This source code is licensed under the ISC license.
348
- * See the LICENSE file in the root directory of this source tree.
349
- */const jQ=[["path",{d:"m21 21-4.34-4.34",key:"14j7rj"}],["circle",{cx:"11",cy:"11",r:"8",key:"4ej97u"}]],FQ=Je("search",jQ);/**
350
- * @license lucide-react v1.31.0 - ISC
351
- *
352
- * This source code is licensed under the ISC license.
353
- * See the LICENSE file in the root directory of this source tree.
354
- */const $Q=[["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"}]],VQ=Je("settings",$Q);/**
355
- * @license lucide-react v1.31.0 - ISC
356
- *
357
- * This source code is licensed under the ISC license.
358
- * See the LICENSE file in the root directory of this source tree.
359
- */const HQ=[["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"}]],zQ=Je("shield",HQ);/**
360
- * @license lucide-react v1.31.0 - ISC
361
- *
362
- * This source code is licensed under the ISC license.
363
- * See the LICENSE file in the root directory of this source tree.
364
- */const UQ=[["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"}]],BQ=Je("skip-forward",UQ);/**
365
- * @license lucide-react v1.31.0 - ISC
366
- *
367
- * This source code is licensed under the ISC license.
368
- * See the LICENSE file in the root directory of this source tree.
369
- */const WQ=[["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"}]],qQ=Je("square-library",WQ);/**
370
- * @license lucide-react v1.31.0 - ISC
371
- *
372
- * This source code is licensed under the ISC license.
373
- * See the LICENSE file in the root directory of this source tree.
374
- */const GQ=[["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"}]],KQ=Je("star",GQ);/**
375
- * @license lucide-react v1.31.0 - ISC
376
- *
377
- * This source code is licensed under the ISC license.
378
- * See the LICENSE file in the root directory of this source tree.
379
- */const ZQ=[["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"}]],YQ=Je("sun",ZQ);/**
380
- * @license lucide-react v1.31.0 - ISC
381
- *
382
- * This source code is licensed under the ISC license.
383
- * See the LICENSE file in the root directory of this source tree.
384
- */const XQ=[["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"}]],QQ=Je("user",XQ);/**
385
- * @license lucide-react v1.31.0 - ISC
386
- *
387
- * This source code is licensed under the ISC license.
388
- * See the LICENSE file in the root directory of this source tree.
389
- */const JQ=[["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"}]],eJ=Je("users",JQ);/**
390
- * @license lucide-react v1.31.0 - ISC
391
- *
392
- * This source code is licensed under the ISC license.
393
- * See the LICENSE file in the root directory of this source tree.
394
- */const tJ=[["path",{d:"M18 6 6 18",key:"1bl5f8"}],["path",{d:"m6 6 12 12",key:"d8bk6v"}]],nJ=Je("x",tJ),rJ={"chevron-right":LX,"chevron-down":MX,pipette:kQ,x:nJ,copy:VX,menu:cQ,dot:zX,monitor:pQ,sun:YQ,moon:gQ,"rectangle-horizontal":MQ,circle:NX,"square-library":qQ,clock:FX,star:KQ,settings:VQ,plus:AQ,"arrow-left":wX,"arrow-right":bX,"arrow-up":EX,search:FQ,loader:sQ,users:eJ,lock:oQ,mail:lQ,bell:kX,shield:zQ,palette:wQ,lightbulb:eQ,rocket:LQ,heart:qX,paintbrush:yQ,brain:TX,globe:BX,user:QQ,image:YX,link:nQ,check:AX,"rotate-ccw":NQ,play:TQ,pause:bQ,home:KX,"message-circle":fQ,inbox:QX,pencil:EQ,"skip-forward":BQ},D8={lucide:rJ},NI=v.createContext(null);function sJ(t){const e=v.useContext(NI);return e?D8[e.iconLibrary][t]:D8.lucide[t]}function iJ({children:t,defaultLibrary:e="lucide"}){const[n,r]=v.useState(e),s=v.useCallback(i=>{r(i)},[]);return E.jsx(NI.Provider,{value:{iconLibrary:n,setIconLibrary:s},children:t})}const jI=v.createContext(null);function Tx(){return v.useContext(jI)}const FI=v.createContext(null);function $I(){const t=v.useContext(FI);if(!t)throw new Error("AccordionTrigger/AccordionContent must be used within an AccordionItem");return t}const oJ=v.forwardRef((t,e)=>{const{children:n,type:r="single",className:s,...i}=t,a=v.useRef(null),u=v.useRef(new Map),[c,d]=v.useState(new Map),{activeIndex:h,setActiveIndex:p,itemRects:m,sessionRef:_,handlers:w,registerItem:y,measureItems:x}=h5(a),S=v.useCallback((le,ie)=>{ie?u.current.set(le,ie):u.current.delete(le)},[]),P=v.useCallback(()=>{if(!a.current)return;const le=new Map;u.current.forEach((ie,Ne)=>{le.set(Ne,{top:ie.offsetTop,left:ie.offsetLeft,width:ie.offsetWidth,height:ie.offsetHeight})}),d(le)},[]),[T,k]=v.useState(()=>r==="single"?t.defaultValue??"":""),[R,M]=v.useState(()=>r==="multiple"?t.defaultValue??[]:[]),L=t.onValueChange,A=t.onValueChange,O=t.value,D=new Set(r==="multiple"?t.value??R:(()=>{const le=t.value??T;return le?[le]:[]})()),N=v.useCallback(le=>{const ie=t;ie.onValueChange?ie.onValueChange(le):k(le)},[L]),j=v.useCallback(le=>{const ie=t;ie.onValueChange?ie.onValueChange(le):M(le)},[A]),G=v.useCallback(le=>{if(r==="multiple"){const ie=t.value??R;j(ie.filter(Ne=>Ne!==le))}else N("")},[r,N,j,R,O]);v.useEffect(()=>{x(),P()},[x,P,n]);const Y=[...D].join(",");v.useEffect(()=>{x(),P()},[x,P,Y]);const[W,q]=v.useState(null),Z=h!==null?m[h]:null,V=W!==null?m[W]:null,J=h!==null&&!c.has(h),H=R0(),{value:F,defaultValue:X,onValueChange:oe,collapsible:se,type:ee,...ce}=i,we=r==="multiple"?{type:"multiple",value:t.value??R,onValueChange:j}:{type:"single",collapsible:t.collapsible??!0,value:t.value??T,onValueChange:N};return E.jsx(jI.Provider,{value:{registerItem:y,registerFullItem:S,activeIndex:h,grouped:!0,remeasure:()=>{x(),P()},openValues:D,openItemRects:c,toggleValue:G},children:E.jsx(LI,{...we,asChild:!0,children:E.jsxs("div",{ref:le=>{a.current=le,typeof e=="function"?e(le):e&&(e.current=le)},onMouseEnter:w.onMouseEnter,onMouseMove:le=>{const ie=a.current;if(ie){const Ne=ie.getBoundingClientRect(),Be=ie.offsetHeight,Pe=Ne.height,$e=Be>0?Pe/Be:1,dt=(le.clientY-Ne.top)/$e+ie.scrollTop;for(const[Qt,be]of c){const Ve=m[Qt];if(!Ve)continue;const qe=Ve.top+Ve.height,tt=be.top+be.height;if(dt>=qe&&dt<=tt){p(null);return}}}w.onMouseMove(le)},onMouseLeave:w.onMouseLeave,onFocus:le=>{var Ne;const ie=(Ne=le.target.closest("[data-proximity-index]"))==null?void 0:Ne.getAttribute("data-proximity-index");if(ie!=null){const Be=Number(ie);p(Be),q(le.target.matches(":focus-visible")?Be:null)}},onBlur:le=>{var ie;(ie=a.current)!=null&&ie.contains(le.relatedTarget)||(q(null),p(null))},className:dr("relative flex flex-col gap-0.5 w-72 max-w-full",s),...ce,children:[E.jsx(no,{children:[...c.entries()].map(([le,ie])=>E.jsx(ro.div,{className:`absolute ${H.bg} bg-accent/20 dark:bg-accent/12 pointer-events-none`,initial:!1,animate:{top:ie.top,left:ie.left,width:ie.width,height:ie.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-${le}`))}),E.jsx(no,{children:Z&&E.jsx(ro.div,{className:`absolute ${H.bg} bg-hover pointer-events-none`,initial:{opacity:0,top:Z.top,left:Z.left,width:Z.width,height:Z.height},animate:{opacity:1,top:Z.top,left:Z.left,width:Z.width,height:Z.height},exit:{opacity:0,transition:{duration:.06}},transition:{...ef.fast,opacity:{duration:.08}}},_.current)}),E.jsx(no,{children:V&&E.jsx(ro.div,{className:`absolute ${H.focusRing} pointer-events-none z-20 border border-[#6B97FF]`,initial:!1,animate:{left:V.left-2,top:V.top-2,width:V.width+4,height:V.height+4},exit:{opacity:0,transition:{duration:.06}},transition:{...ef.fast,opacity:{duration:.08}}})}),n]})})})});oJ.displayName="AccordionGroup";const VI=v.forwardRef(({children:t,type:e="single",collapsible:n=!0,defaultValue:r,value:s,onValueChange:i,className:a,...u},c)=>{const[d,h]=v.useState(()=>e==="single"?r??"":""),[p,m]=v.useState(()=>e==="multiple"?r??[]:[]),_=new Set(e==="multiple"?s??p:(()=>{const P=s??d;return P?[P]:[]})()),w=v.useCallback(P=>{i?i(P):h(P)},[i]),y=v.useCallback(P=>{i?i(P):m(P)},[i]),x=v.useCallback(P=>{e==="multiple"?y((s??p).filter(k=>k!==P)):w("")},[e,s,p,w,y]),S=e==="multiple"?{type:"multiple",value:s??p,defaultValue:r,onValueChange:y}:{type:"single",collapsible:n,value:s??d,defaultValue:r,onValueChange:w};return E.jsx(LI,{...S,asChild:!0,children:E.jsx("div",{ref:c,className:dr("w-72 max-w-full flex flex-col gap-0.5",a),...u,children:E.jsx(HI.Provider,{value:_,children:E.jsx(zI.Provider,{value:x,children:t})})})})});VI.displayName="Accordion";const HI=v.createContext(new Set),zI=v.createContext(()=>{}),UI=v.forwardRef(({value:t,index:e,disabled:n,children:r,className:s,...i},a)=>{const u=v.useRef(null),c=Tx(),d=v.useContext(HI),h=v.useContext(zI),p=R0(),m=c!=null&&c.grouped?c.openValues.has(t):d.has(t),_=v.useRef(null),w=v.useCallback(()=>{c!=null&&c.grouped?c.toggleValue(t):h(t)},[c,h,t]);return v.useEffect(()=>{if(c!=null&&c.grouped&&e!==void 0)return c.registerItem(e,_.current),()=>c.registerItem(e,null)},[e,c]),v.useEffect(()=>{if(c!=null&&c.grouped&&e!==void 0)return m?c.registerFullItem(e,u.current):c.registerFullItem(e,null),()=>c.registerFullItem(e,null)},[e,c,m]),E.jsx(FI.Provider,{value:{index:e,value:t,isOpen:m,onToggle:w,triggerRef:_},children:E.jsxs(uX,{ref:y=>{u.current=y,typeof a=="function"?a(y):a&&(a.current=y)},value:t,disabled:n,"data-proximity-index":e,className:dr(!(c!=null&&c.grouped)&&"relative",s),...i,children:[!(c!=null&&c.grouped)&&E.jsx(no,{children:m&&E.jsx(ro.div,{className:`absolute inset-0 ${p.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]})})});UI.displayName="AccordionItem";const BI=v.forwardRef(({children:t,className:e,...n},r)=>{const s=sJ("chevron-right"),i=Tx(),{index:a,isOpen:u,triggerRef:c}=$I(),d=R0(),[h,p]=v.useState(!1),m=i!=null&&i.grouped?i.activeIndex===a:h,_=E.jsx(cX,{asChild:!0,children:E.jsx("div",{children:E.jsxs(dX,{ref:r,className:dr(`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:[E.jsxs("span",{className:"inline-grid text-[13px] flex-1 text-left",children:[E.jsx("span",{className:"col-start-1 row-start-1 invisible",style:{fontVariationSettings:Ld.semibold},"aria-hidden":"true",children:t}),E.jsx("span",{className:dr("col-start-1 row-start-1 transition-[color,font-variation-settings] duration-80",u||m?"text-foreground":"text-muted-foreground"),style:{fontVariationSettings:u?Ld.semibold:Ld.normal},children:t})]}),E.jsx(ro.span,{className:"shrink-0 inline-flex items-center justify-center",animate:{rotate:u?90:0},transition:ef.fast,children:E.jsx(s,{size:16,strokeWidth:u||m?2:1.5,className:dr("transition-[color,stroke-width] duration-80",u||m?"text-foreground":"text-muted-foreground")})})]})})});return i!=null&&i.grouped?E.jsx("div",{ref:c,children:_}):E.jsxs("div",{className:"relative",onMouseEnter:()=>p(!0),onMouseLeave:()=>p(!1),children:[E.jsx(no,{children:h&&E.jsx(ro.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}})}),_]})});BI.displayName="AccordionTrigger";const WI=v.forwardRef(({children:t,className:e,...n},r)=>{const s=Tx(),{isOpen:i}=$I();return E.jsx(no,{initial:!1,children:i&&E.jsx(fX,{forceMount:!0,asChild:!0,...n,children:E.jsx(ro.div,{ref:r,className:dr("overflow-hidden",e),initial:{height:0},animate:{height:"auto"},exit:{height:0},transition:{...ef.moderate,bounce:0},onUpdate:()=>{s==null||s.remeasure()},onAnimationComplete:()=>{s==null||s.remeasure()},children:E.jsx("div",{className:"px-3 pb-3 pt-1 text-[13px] text-muted-foreground",children:t})})})})});WI.displayName="AccordionContent";const rm=({children:t,defaultValue:e=[],className:n=""})=>E.jsx(VI,{type:"multiple",defaultValue:e,className:dr("w-full",n),children:t}),aJ=({value:t,title:e,description:n,dataCy:r,icon:s,children:i,className:a=""})=>{const u=a.includes("first-item");return E.jsxs(UI,{value:t,className:dr("w-full",!u&&"border-t border-main-border"),children:[E.jsxs(BI,{"data-cy":r,children:[s?E.jsx("span",{className:"mr-1 inline-flex items-center",children:s}):null,e]}),E.jsxs(WI,{children:[n?E.jsx("p",{className:"pb-2 text-sm text-content-subtle",children:n}):null,i]})]})};rm.Item=aJ;const lJ=({message:t,isLoading:e=!0})=>E.jsxs("div",{className:"flex items-center gap-2 text-sm text-content",children:[e?E.jsx(w0,{className:"h-4 w-4 shrink-0 animate-spin text-primary",weight:"bold"}):null,E.jsx("span",{className:"whitespace-pre-wrap font-sans",children:t})]}),uJ=()=>{const t=v.useRef(Date.now()),[e,n]=v.useState(0);return v.useEffect(()=>{const r=()=>n(Math.max(0,Math.floor((Date.now()-t.current)/1e3)));r();const s=setInterval(r,1e3);return()=>clearInterval(s)},[]),e},cJ=t=>{const e=Math.floor(t/60),n=t%60;return`${e}:${n.toString().padStart(2,"0")}`},N8="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",j8="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",dJ="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",sm=["Applying","Thinking","Planning","Crafting"],fJ=sm.reduce((t,e)=>t.length>=e.length?t:e),hJ=20,pJ="Still working — runs can take a few minutes.",mJ=({hint:t,showElapsed:e=!0})=>{const[n,r]=v.useState(0),s=uJ();v.useEffect(()=>{const a=setInterval(()=>{r(u=>(u+1)%sm.length)},4e3);return()=>clearInterval(a)},[]);const i=t??(e&&s>=hJ?pJ:null);return E.jsxs("div",{role:"status",className:"flex items-center gap-2 px-3 py-1","data-cy":"thinking-indicator",children:[E.jsx(Sl.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:E.jsx(Sl.path,{animate:{d:[N8,j8,dJ,j8,N8]},transition:{d:{duration:6,ease:"easeInOut",repeat:1/0,times:[0,.25,.5,.75,1]}}})}),E.jsxs("span",{className:"inline-grid overflow-hidden text-sm font-medium",style:{fontVariationSettings:Ld.medium},children:[E.jsx("span",{className:"shimmer-text invisible col-start-1 row-start-1","aria-hidden":"true",children:fJ}),E.jsx(no,{mode:"popLayout",initial:!1,children:E.jsx(Sl.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:sm[n]},sm[n])})]}),e?E.jsx("span",{className:"text-xs tabular-nums text-content-subtle","data-cy":"thinking-elapsed",children:cJ(s)}):null,i?E.jsx("span",{className:"text-xs text-content-subtle",children:i}):null]})};var gJ=Object.defineProperty,vJ=(t,e)=>gJ(t,"name",{value:e,configurable:!0});function Rx(t,[e,n]){return Math.min(n,Math.max(e,t))}vJ(Rx,"clamp");var yJ=Object.defineProperty,_J=(t,e)=>yJ(t,"name",{value:e,configurable:!0});function qI(t){const e=v.useRef({value:t,previous:t});return v.useMemo(()=>(e.current.value!==t&&(e.current.previous=e.current.value,e.current.value=t),e.current.previous),[t])}_J(qI,"usePrevious");var wJ=Object.defineProperty,mt=(t,e)=>wJ(t,"name",{value:e,configurable:!0}),GI=["PageUp","PageDown"],KI=["ArrowUp","ArrowDown","ArrowLeft","ArrowRight"],ZI={"from-left":["Home","PageDown","ArrowDown","ArrowLeft"],"from-right":["Home","PageDown","ArrowDown","ArrowRight"],"from-bottom":["Home","PageDown","ArrowDown","ArrowLeft"],"from-top":["Home","PageDown","ArrowUp","ArrowLeft"]},Nf="Slider",[f2,xJ,bJ]=_x(Nf),[Ax,cee]=_i(Nf,[bJ]),[SJ,jf]=Ax(Nf),EJ=v.forwardRef(mt(function(e,n){const{name:r,min:s=0,max:i=100,step:a=1,orientation:u="horizontal",disabled:c=!1,minStepsBetweenThumbs:d=0,defaultValue:h=[s],value:p,onValueChange:m=mt(()=>{},"onValueChange"),onValueCommit:_=mt(()=>{},"onValueCommit"),inverted:w=!1,form:y,...x}=e,S=v.useRef(new Set),P=v.useRef(0),T=v.useRef(!1),R=u==="horizontal"?CJ:kJ,[M,L]=v.useState(null),A=Vt(n,L),[O=[],D]=va({prop:p,defaultProp:h,onChange:mt(Z=>{var J;(J=[...S.current][P.current])==null||J.focus({preventScroll:!0,focusVisible:T.current}),T.current=!1,m(Z)},"onChange")}),N=v.useRef(O),j=v.useRef(O);v.useEffect(()=>{const Z=y?M==null?void 0:M.ownerDocument.getElementById(y):M==null?void 0:M.closest("form");if(Z instanceof HTMLFormElement){const V=mt(()=>D(j.current),"reset");return Z.addEventListener("reset",V),()=>Z.removeEventListener("reset",V)}},[M,y,D]);function G(Z){const V=rM(O,Z);q(Z,V)}mt(G,"handleSlideStart");function Y(Z){q(Z,P.current)}mt(Y,"handleSlideMove");function W(){String(O)!==String(N.current)&&_(O)}mt(W,"handleSlideEnd");function q(Z,V,{commit:J}={commit:!1}){const H=Mx(a),F=$d(Math.round((Z-s)/a)*a+s,H),X=Rx(F,[s,i]);D((oe=[])=>{const se=tM(oe,X,V);if(oM(se,d*a)){P.current=se.indexOf(X);const ee=String(se)!==String(oe);return ee&&J&&_(se),ee?se:oe}else return oe})}return mt(q,"updateValues"),E.jsx(SJ,{scope:e.__scopeSlider,name:r,disabled:c,min:s,max:i,valueIndexToChangeRef:P,thumbs:S.current,values:O,orientation:u,form:y,children:E.jsx(f2.Provider,{scope:e.__scopeSlider,children:E.jsx(f2.Slot,{scope:e.__scopeSlider,children:E.jsx(R,{"aria-disabled":c,"data-disabled":c?"":void 0,...x,ref:A,onPointerDown:Ft(x.onPointerDown,()=>{c||(N.current=O,T.current=!1)}),min:s,max:i,inverted:w,onSlideStart:c?void 0:G,onSlideMove:c?void 0:Y,onSlideEnd:c?void 0:W,onHomeKeyDown:()=>{c||(T.current=!0,q(s,0,{commit:!0}))},onEndKeyDown:()=>{c||(T.current=!0,q(i,O.length-1,{commit:!0}))},onStepKeyDown:({event:Z,direction:V})=>{if(!c){T.current=!0;const F=GI.includes(Z.key)||Z.shiftKey&&KI.includes(Z.key)?10:1,X=P.current,oe=O[X],se=aM(oe,{min:s,step:a,direction:V,multiplier:F});q(se,X,{commit:!0})}}})})})})},"Slider")),[YI,XI]=Ax(Nf,{startEdge:"left",endEdge:"right",size:"width",direction:1}),CJ=v.forwardRef(mt(function(e,n){const{min:r,max:s,dir:i,inverted:a,onSlideStart:u,onSlideMove:c,onSlideEnd:d,onStepKeyDown:h,...p}=e,[m,_]=v.useState(null),w=Vt(n,_),y=v.useRef(void 0),x=Sx(i),S=x==="ltr",P=S&&!a||!S&&a;function T(k){const R=y.current||m.getBoundingClientRect(),M=[0,R.width],A=j0(M,P?[r,s]:[s,r]);return y.current=R,A(k-R.left)}return mt(T,"getValueFromPointer"),E.jsx(YI,{scope:e.__scopeSlider,startEdge:P?"left":"right",endEdge:P?"right":"left",direction:P?1:-1,size:"width",children:E.jsx(QI,{dir:x,"data-orientation":"horizontal",...p,ref:w,style:{...p.style,"--radix-slider-thumb-transform":"translateX(-50%)"},onSlideStart:k=>{const R=T(k.clientX);u==null||u(R)},onSlideMove:k=>{const R=T(k.clientX);c==null||c(R)},onSlideEnd:()=>{y.current=void 0,d==null||d()},onStepKeyDown:k=>{const M=ZI[P?"from-left":"from-right"].includes(k.key);h==null||h({event:k,direction:M?-1:1})}})})},"SliderHorizontal")),kJ=v.forwardRef(mt(function(e,n){const{min:r,max:s,inverted:i,onSlideStart:a,onSlideMove:u,onSlideEnd:c,onStepKeyDown:d,...h}=e,p=v.useRef(null),m=Vt(n,p),_=v.useRef(void 0),w=!i;function y(x){const S=_.current||p.current.getBoundingClientRect(),P=[0,S.height],k=j0(P,w?[s,r]:[r,s]);return _.current=S,k(x-S.top)}return mt(y,"getValueFromPointer"),E.jsx(YI,{scope:e.__scopeSlider,startEdge:w?"bottom":"top",endEdge:w?"top":"bottom",size:"height",direction:w?1:-1,children:E.jsx(QI,{"data-orientation":"vertical",...h,ref:m,style:{...h.style,"--radix-slider-thumb-transform":"translateY(50%)"},onSlideStart:x=>{const S=y(x.clientY);a==null||a(S)},onSlideMove:x=>{const S=y(x.clientY);u==null||u(S)},onSlideEnd:()=>{_.current=void 0,c==null||c()},onStepKeyDown:x=>{const P=ZI[w?"from-bottom":"from-top"].includes(x.key);d==null||d({event:x,direction:P?-1:1})}})})},"SliderVertical")),QI=v.forwardRef(mt(function(e,n){const{__scopeSlider:r,onSlideStart:s,onSlideMove:i,onSlideEnd:a,onHomeKeyDown:u,onEndKeyDown:c,onStepKeyDown:d,...h}=e,p=jf(Nf,r);return E.jsx(dn.span,{...h,ref:n,onKeyDown:Ft(e.onKeyDown,m=>{m.key==="Home"?(u(m),m.preventDefault()):m.key==="End"?(c(m),m.preventDefault()):GI.concat(KI).includes(m.key)&&(d(m),m.preventDefault())}),onPointerDown:Ft(e.onPointerDown,m=>{const _=m.target;_.setPointerCapture(m.pointerId),m.preventDefault(),p.thumbs.has(_)?_.focus({preventScroll:!0,focusVisible:!1}):s(m)}),onPointerMove:Ft(e.onPointerMove,m=>{m.target.hasPointerCapture(m.pointerId)&&i(m)}),onPointerUp:Ft(e.onPointerUp,m=>{const _=m.target;_.hasPointerCapture(m.pointerId)&&(_.releasePointerCapture(m.pointerId),a(m))})})},"SliderImpl")),PJ="SliderTrack",TJ=v.forwardRef(mt(function(e,n){const{__scopeSlider:r,...s}=e,i=jf(PJ,r);return E.jsx(dn.span,{"data-disabled":i.disabled?"":void 0,"data-orientation":i.orientation,...s,ref:n})},"SliderTrack")),F8="SliderRange",RJ=v.forwardRef(mt(function(e,n){const{__scopeSlider:r,...s}=e,i=jf(F8,r),a=XI(F8,r),u=v.useRef(null),c=Vt(n,u),d=i.values.length,h=i.values.map(_=>Ix(_,i.min,i.max)),p=d>1?Math.min(...h):0,m=100-Math.max(...h);return E.jsx(dn.span,{"data-orientation":i.orientation,"data-disabled":i.disabled?"":void 0,...s,ref:c,style:{...e.style,[a.startEdge]:p+"%",[a.endEdge]:m+"%"}})},"SliderRange")),AJ="SliderThumb",[IJ,JI]=Ax(AJ),MJ="SliderThumbProvider";function eM(t){const{__scopeSlider:e,name:n,children:r,internal_do_not_use_render:s}=t,i=jf(MJ,e),a=xJ(e),[u,c]=v.useState(null),d=v.useMemo(()=>u?a().findIndex(x=>x.ref.current===u):-1,[a,u]),h=Uw(u),p=u?!!i.form||!!u.closest("form"):!0,m=i.values[d],_=n??(i.name?i.name+(i.values.length>1?"[]":""):void 0),w=m===void 0?0:Ix(m,i.min,i.max);v.useEffect(()=>{if(u)return i.thumbs.add(u),()=>{i.thumbs.delete(u)}},[u,i.thumbs]);const y={value:m,name:_,form:i.form,isFormControl:p,index:d,thumb:u,onThumbChange:c,percent:w,size:h};return E.jsx(IJ,{scope:e,...y,children:lM(s)?s(y):r})}mt(eM,"SliderThumbProvider");var K1="SliderThumbTrigger",OJ=v.forwardRef(mt(function(e,n){const{__scopeSlider:r,...s}=e,i=jf(K1,r),a=XI(K1,r),{index:u,value:c,percent:d,size:h,onThumbChange:p}=JI(K1,r),m=Vt(n,p),_=nM(u,i.values.length),w=h==null?void 0:h[a.size],y=w?sM(w,d,a.direction):0;return E.jsx("span",{style:{transform:"var(--radix-slider-thumb-transform)",position:"absolute",[a.startEdge]:`calc(${d}% + ${y}px)`},children:E.jsx(f2.ItemSlot,{scope:r,children:E.jsx(dn.span,{role:"slider","aria-label":e["aria-label"]||_,"aria-valuemin":i.min,"aria-valuenow":c,"aria-valuemax":i.max,"aria-orientation":i.orientation,"data-orientation":i.orientation,"data-disabled":i.disabled?"":void 0,tabIndex:i.disabled?void 0:0,...s,ref:m,style:c===void 0?{display:"none"}:e.style,onFocus:Ft(e.onFocus,()=>{i.valueIndexToChangeRef.current=u})})})})},"SliderThumbTrigger")),LJ=v.forwardRef(mt(function(e,n){const{__scopeSlider:r,name:s,...i}=e;return E.jsx(eM,{__scopeSlider:r,name:s,internal_do_not_use_render:({index:a,isFormControl:u})=>E.jsxs(E.Fragment,{children:[E.jsx(OJ,{...i,ref:n,__scopeSlider:r}),u?E.jsx(NJ,{__scopeSlider:r},a):null]})})},"SliderThumb")),DJ="SliderBubbleInput",NJ=v.forwardRef(mt(function({__scopeSlider:e,...n},r){const{value:s,name:i,form:a}=JI(DJ,e),u=v.useRef(null),c=Vt(u,r),d=qI(s);return v.useEffect(()=>{const h=u.current;if(!h)return;const p=window.HTMLInputElement.prototype,_=Object.getOwnPropertyDescriptor(p,"value").set;if(d!==s&&_){const w=new Event("input",{bubbles:!0});_.call(h,s),h.dispatchEvent(w)}},[d,s]),E.jsx(dn.input,{style:{display:"none"},name:i,form:a,...n,ref:c,defaultValue:s})},"SliderBubbleInput"));function tM(t=[],e,n){const r=[...t];return r[n]=e,r.sort((s,i)=>s-i)}mt(tM,"getNextSortedValues");function Ix(t,e,n){const i=100/(n-e)*(t-e);return Rx(i,[0,100])}mt(Ix,"convertValueToPercentage");function nM(t,e){return e>2?`Value ${t+1} of ${e}`:e===2?["Minimum","Maximum"][t]:void 0}mt(nM,"getLabel");function rM(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)}mt(rM,"getClosestValueIndex");function sM(t,e,n){const r=t/2,i=j0([0,50],[0,r]);return(r-i(e)*n)*n}mt(sM,"getThumbInBoundsOffset");function iM(t){return t.slice(0,-1).map((e,n)=>t[n+1]-e)}mt(iM,"getStepsBetweenValues");function oM(t,e){if(e>0){const n=iM(t);return Math.min(...n)>=e}return!0}mt(oM,"hasMinStepsBetweenValues");function j0(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])}}mt(j0,"linearScale");function Mx(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]||"",a=Number(s);return Math.max(0,i.length-a)}const n=e.split(".")[1];return n?n.length:0}mt(Mx,"getDecimalCount");function $d(t,e){const n=Math.pow(10,e);return Math.round(t*n)/n}mt($d,"roundValue");function aM(t,{min:e,step:n,direction:r,multiplier:s}){const i=Mx(n),a=(t-e)/n,u=Math.round(a),c=$d(u*n+e,i)===$d(t,i);let d;return c?d=u+s*r:r>0?d=Math.ceil(a):d=Math.floor(a),$d(d*n+e,i)}mt(aM,"getNextStepValue");function lM(t){return typeof t=="function"}mt(lM,"isFunction");const h2=v.forwardRef(({className:t,...e},n)=>E.jsxs(EJ,{ref:n,className:dr("relative flex w-full touch-none select-none items-center","data-[disabled]:opacity-50",t),...e,children:[E.jsx(TJ,{className:"relative h-1 w-full grow overflow-hidden rounded-full bg-input",children:E.jsx(RJ,{className:"absolute h-full bg-primary"})}),E.jsx(LJ,{className:dr("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")})]}));h2.displayName="Slider";const jJ=[{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"}],FJ=[{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"}],$J=[{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"}],Tp=[{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:"CommentMarkerLayer",path:"components/CommentMarkerLayer.tsx",status:"feature-only",note:"Preview overlay layer tied to comment collections."},{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."}],VJ=()=>{window.location.hash=""},ji=({title:t,eyebrow:e,description:n,children:r})=>E.jsxs("section",{className:"border-border bg-card shadow-surface-3 rounded-2xl border p-5",children:[E.jsxs("div",{className:"mb-5 max-w-2xl",children:[E.jsx("p",{className:"text-primary text-xs font-semibold tracking-[0.18em] uppercase",children:e}),E.jsx("h2",{className:"text-foreground mt-2 text-xl font-semibold",children:t}),E.jsx("p",{className:"text-muted-foreground mt-2 text-sm leading-6",children:n})]}),r]}),$8=({swatches:t})=>E.jsx("div",{className:"grid gap-3 sm:grid-cols-2 lg:grid-cols-3",children:t.map(e=>E.jsxs("div",{className:"border-border bg-surface-2 rounded-xl border p-3",children:[E.jsx("div",{className:`h-16 rounded-lg ${e.className}`}),E.jsxs("div",{className:"mt-3 flex items-center justify-between gap-3",children:[E.jsx("span",{className:"text-foreground text-sm font-medium",children:e.name}),E.jsx("code",{className:"bg-muted text-muted-foreground rounded px-2 py-1 text-xs",children:e.utility})]})]},e.name))}),HJ=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",zJ=()=>{const t=Tp.filter(n=>n.status==="showcased").length,e=Tp.filter(n=>n.status==="cataloged").length;return E.jsx("main",{className:"bg-main font-main text-content h-screen overflow-y-auto",children:E.jsxs("div",{className:"mx-auto flex w-full max-w-6xl flex-col gap-6 px-6 py-6 lg:px-8",children:[E.jsxs("header",{className:"border-border bg-surface-2 shadow-surface-4 rounded-3xl border p-6",children:[E.jsxs("button",{type:"button",onClick:VJ,className:"text-content-subtle hover:text-content mb-6 inline-flex items-center gap-2 text-sm transition-colors",children:[E.jsx(cU,{className:"h-4 w-4",weight:"bold"}),"Back to editor"]}),E.jsxs("div",{className:"flex flex-col gap-5 lg:flex-row lg:items-end lg:justify-between",children:[E.jsxs("div",{className:"max-w-3xl",children:[E.jsx("p",{className:"text-primary text-xs font-semibold tracking-[0.22em] uppercase",children:"Local component gallery"}),E.jsx("h1",{className:"text-foreground mt-3 text-4xl font-semibold tracking-tight",children:"Rivet design system"}),E.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."})]}),E.jsx("div",{className:"border-border bg-surface-3 rounded-2xl border p-4",children:E.jsxs("div",{className:"text-content-muted flex items-center gap-3 text-sm",children:[E.jsx(GR,{className:"text-primary h-5 w-5",weight:"bold"}),"Open with ",E.jsx("code",{className:"text-content",children:"#/design-system"})]})})]})]}),E.jsx(ji,{eyebrow:"Controls",title:"Button, split button, and tooltip",description:"The gallery uses Rivet's tooltip-wrapped button, compound split button, and the lower-level Radix tooltip wrapper so the reusable control APIs are visible.",children:E.jsxs("div",{className:"grid gap-4 lg:grid-cols-[1fr_1fr]",children:[E.jsxs("div",{className:"border-border bg-surface-2 rounded-xl border p-4",children:[E.jsx("p",{className:"text-foreground mb-3 text-sm font-medium",children:"Rivet Button wrapper"}),E.jsxs("div",{className:"flex flex-wrap items-center gap-3",children:[E.jsx(Ou,{title:"Primary action",shortcut:"D",className:"bg-primary text-primary-foreground hover:bg-primary-hover rounded-lg px-4 py-2 text-sm font-medium transition-colors",children:"Design action"}),E.jsx(Ou,{title:"Secondary action",className:"border-border bg-surface-4 text-content hover:bg-surface-5 rounded-lg border px-4 py-2 text-sm font-medium transition-colors",children:"Secondary"}),E.jsx(Ou,{title:"Disabled action",disabled:!0,className:"border-border bg-muted text-muted-foreground rounded-lg border px-4 py-2 text-sm font-medium opacity-60",children:"Disabled"}),E.jsx(nA,{primaryLabel:"Ship",primaryIcon:S1,primaryAction:()=>{},dropdownItems:[{label:"Create PR",onClick:()=>{}},{label:"Copy branch",onClick:()=>{}}]})]})]}),E.jsxs("div",{className:"border-border bg-surface-2 rounded-xl border p-4",children:[E.jsx("p",{className:"text-foreground mb-3 text-sm font-medium",children:"Tooltip states"}),E.jsxs("div",{className:"flex flex-wrap items-center gap-4",children:[E.jsx(Ji,{label:"Rivet tooltip API",side:"bottom",children:E.jsx("button",{className:"border-border bg-surface-4 text-content rounded-lg border px-4 py-2 text-sm",children:"Hover target"})}),E.jsx(Yw,{content:"Forced open preview",forceOpen:!0,side:"right",children:E.jsx("button",{className:"bg-selected text-content rounded-lg px-4 py-2 text-sm",children:"UI tooltip"})})]})]})]})}),E.jsx(ji,{eyebrow:"Tokens",title:"Surface ladder",description:"Surface tokens move from the base app background toward raised panels without leaving the dark Rivet palette.",children:E.jsx($8,{swatches:jJ})}),E.jsx(ji,{eyebrow:"Tokens",title:"Color roles",description:"Named roles should communicate purpose: brand, selection, neutral accent, and outcome colors.",children:E.jsx($8,{swatches:FJ})}),E.jsx(ji,{eyebrow:"Type",title:"Typography",description:"Satoshi remains the default UI voice with clear hierarchy and muted support text.",children:E.jsxs("div",{className:"grid gap-4 lg:grid-cols-3",children:[E.jsxs("div",{className:"border-border bg-surface-2 rounded-xl border p-4",children:[E.jsx("p",{className:"text-primary text-xs tracking-[0.18em] uppercase",children:"Display"}),E.jsx("p",{className:"text-foreground mt-2 text-3xl font-semibold tracking-tight",children:"Visual edits, quickly"})]}),E.jsxs("div",{className:"border-border bg-surface-2 rounded-xl border p-4",children:[E.jsx("p",{className:"text-foreground text-sm font-semibold",children:"Panel heading"}),E.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."})]}),E.jsxs("div",{className:"border-border bg-surface-2 rounded-xl border p-4",children:[E.jsx("p",{className:"text-content-subtle text-xs font-medium tracking-[0.16em] uppercase",children:"Micro label"}),E.jsx("code",{className:"bg-muted text-muted-foreground mt-3 block rounded-lg px-3 py-2 text-xs",children:"font-main text-content"})]})]})}),E.jsx(ji,{eyebrow:"Layout",title:"Spacing rhythm",description:"A compact spacing scale keeps editor chrome dense while preserving scannable groupings.",children:E.jsx("div",{className:"border-border bg-surface-2 rounded-xl border p-4",children:E.jsx("div",{className:"flex flex-col gap-3",children:$J.map(n=>E.jsxs("div",{className:"flex items-center gap-4",children:[E.jsx("code",{className:"text-muted-foreground w-16 text-xs",children:n.name}),E.jsx("div",{className:`${n.className} bg-primary h-4 rounded`}),E.jsx("div",{className:"bg-border h-px flex-1"})]},n.name))})})}),E.jsx(ji,{eyebrow:"Primitives",title:"Accordion and slider",description:"Representative Radix primitives styled through the local component layer.",children:E.jsxs("div",{className:"grid gap-4 lg:grid-cols-2",children:[E.jsxs(rm,{defaultValue:["foundations"],className:"border-border bg-surface-2 rounded-xl border p-2",children:[E.jsx(rm.Item,{value:"foundations",title:"Foundations",description:"Tokens, surfaces, type, and spacing.",className:"first-item",icon:E.jsx(S1,{className:"text-primary h-4 w-4"}),children:E.jsx("p",{children:"Use these pieces before adding one-off visual rules."})}),E.jsx(rm.Item,{value:"components",title:"Components",description:"Buttons, tooltips, accordions, sliders.",children:E.jsx("p",{children:"Keep states visible in this route as the system evolves."})})]}),E.jsxs("div",{className:"border-border bg-surface-2 rounded-xl border p-5",children:[E.jsx("p",{className:"text-foreground mb-5 text-sm font-medium",children:"Slider states"}),E.jsxs("div",{className:"space-y-6",children:[E.jsx(h2,{defaultValue:[64],max:100,step:1}),E.jsx(h2,{defaultValue:[36],max:100,step:1,disabled:!0})]})]})]})}),E.jsx(ji,{eyebrow:"Feedback",title:"Motion and loading",description:"Loading states use existing CSS animation utilities and avoid per-frame React work where possible.",children:E.jsxs("div",{className:"grid gap-4 sm:grid-cols-3",children:[E.jsxs("div",{className:"border-border bg-surface-2 rounded-xl border p-4",children:[E.jsx("p",{className:"text-foreground mb-4 text-sm font-medium",children:"Progress"}),E.jsx(lJ,{message:"Applying visual change..."})]}),E.jsxs("div",{className:"border-border bg-surface-2 rounded-xl border p-4",children:[E.jsx("p",{className:"text-foreground mb-4 text-sm font-medium",children:"Sparkle strip"}),E.jsx(Nw,{className:"text-primary text-xl"})]}),E.jsxs("div",{className:"border-border bg-surface-2 rounded-xl border p-4",children:[E.jsx("p",{className:"text-foreground mb-4 text-sm font-medium",children:"Shimmer text"}),E.jsx("span",{className:"shimmer-text text-sm font-medium",children:"Generating variants"})]}),E.jsx("div",{className:"border-border bg-surface-2 rounded-xl border p-4 sm:col-span-3",children:E.jsx(mJ,{hint:"Reading selected elements"})})]})}),E.jsx(ji,{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:E.jsxs("div",{className:"grid gap-4 sm:grid-cols-2",children:[E.jsx("div",{className:"border-border relative h-56 overflow-hidden rounded-xl border",children:E.jsx(K_,{fill:"surface",loader:"coalesce",trackGlobalLoaderCount:!1})}),E.jsx("div",{className:"border-border relative h-56 overflow-hidden rounded-xl border",children:E.jsx(kA,{icon:E.jsx(S1,{size:32}),title:"Nothing to preview yet",description:"Pick a direction from the panel."})}),E.jsx("div",{className:"border-border relative h-56 overflow-hidden rounded-xl border",children:E.jsx(Jw,{fill:"surface",size:"sm",title:"Preview isn't connected",description:"Rivet lost connection to your project.",actions:[{label:"Reload",onClick:()=>{}}]})})]})}),E.jsxs(ji,{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:[E.jsxs("div",{className:"mb-4 grid gap-3 sm:grid-cols-3",children:[E.jsxs("div",{className:"border-border bg-surface-2 rounded-xl border p-4",children:[E.jsx("p",{className:"text-content-subtle text-xs tracking-[0.16em] uppercase",children:"Total components"}),E.jsx("p",{className:"text-foreground mt-2 text-2xl font-semibold",children:Tp.length})]}),E.jsxs("div",{className:"border-border bg-surface-2 rounded-xl border p-4",children:[E.jsx("p",{className:"text-content-subtle text-xs tracking-[0.16em] uppercase",children:"Showcased"}),E.jsx("p",{className:"text-accent-success mt-2 text-2xl font-semibold",children:t})]}),E.jsxs("div",{className:"border-border bg-surface-2 rounded-xl border p-4",children:[E.jsx("p",{className:"text-content-subtle text-xs tracking-[0.16em] uppercase",children:"Cataloged"}),E.jsx("p",{className:"text-primary mt-2 text-2xl font-semibold",children:e})]})]}),E.jsxs("div",{className:"border-border overflow-hidden rounded-xl border",children:[E.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:[E.jsx("span",{children:"Component"}),E.jsx("span",{children:"Status"}),E.jsx("span",{children:"Coverage note"})]}),E.jsx("div",{className:"divide-border bg-surface-2 divide-y",children:Tp.map(n=>E.jsxs("div",{className:"grid grid-cols-[minmax(140px,1fr)_minmax(110px,auto)_minmax(220px,2fr)] gap-3 px-4 py-3 text-sm",children:[E.jsxs("div",{children:[E.jsx("p",{className:"text-foreground font-medium",children:n.name}),E.jsx("code",{className:"text-muted-foreground text-xs",children:n.path})]}),E.jsx("div",{children:E.jsx("span",{className:`inline-flex rounded-full border px-2 py-1 text-xs font-medium ${HJ(n.status)}`,children:n.status})}),E.jsx("p",{className:"text-muted-foreground",children:n.note})]},n.path))})]})]})]})})},UJ=t=>(t.startsWith("#/")?t.slice(2):t.slice(1)).split("?")[0]==="design-system"?"design-system":"editor",BJ=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"},Z1=({outcome:t,authAttemptId:e,startedAt:n,now:r,failureReason:s})=>({event:`visual_editor_auth_${t}`,properties:{auth_attempt_id:e,duration_ms:r-n,entry_point:"editor_gate",method:"google_oauth",...s?{failure_reason:s}:{}}}),V8=Cs("App"),WJ=2e3,qJ=60,H8="Connecting to Google...",z8="https://rivet-proxy.onrender.com",GJ=`<!doctype html>
395
- <html lang="en">
396
- <head>
397
- <meta charset="utf-8" />
398
- <meta name="viewport" content="width=device-width, initial-scale=1" />
399
- <title>${H8}</title>
400
- <style>
401
- :root { color-scheme: light dark; }
402
- body {
403
- margin: 0;
404
- min-height: 100vh;
405
- display: grid;
406
- place-items: center;
407
- font-family: Inter, system-ui, -apple-system, Segoe UI, sans-serif;
408
- background: #111215;
409
- color: #f3f4f6;
410
- }
411
- .panel {
412
- border: 1px solid rgba(255, 255, 255, 0.16);
413
- border-radius: 12px;
414
- padding: 18px 22px;
415
- background: rgba(255, 255, 255, 0.06);
416
- font-size: 14px;
417
- }
418
- </style>
419
- </head>
420
- <body>
421
- <div class="panel">${H8}</div>
422
- </body>
423
- </html>`,p2=274,s0=395,Y1=Math.min(s0,Math.round((p2+s0)/2*1.1)),U8="rivet:panelWidth:v2",KJ=t=>{if(!(t instanceof HTMLElement))return!1;const e=t.tagName.toLowerCase();return t.isContentEditable||e==="input"||e==="textarea"||e==="select"},ZJ=({projectPath:t})=>{const e=et(x5)>0,[n,r]=i3(_5),s=zV(),[i,a]=v.useState(()=>{if(typeof window>"u")return Y1;const k=Number(window.localStorage.getItem(U8));return Number.isFinite(k)&&k>=p2&&k<=s0?k:Y1}),[u,c]=v.useState(!1),[d,h]=v.useState(hY),p=n?i:0,[m,_]=v.useState(n);v.useEffect(()=>{if(!n){_(!1);return}h(k=>fY({position:k,boundsLeftPx:i}))},[n,i]),v.useEffect(()=>{window.localStorage.setItem(U8,String(i))},[i]),v.useEffect(()=>{if(!n)return;const k=R=>{R.key==="Escape"&&(KJ(R.target)||(R.preventDefault(),r(!1)))};return window.addEventListener("keydown",k),()=>window.removeEventListener("keydown",k)},[n,r]);const w=v.useCallback(k=>{k.preventDefault(),k.stopPropagation();const R=k.clientX,M=i;c(!0);const L=O=>{const D=Math.min(s0,Math.max(p2,M+(O.clientX-R)));a(D)},A=()=>{window.removeEventListener("pointermove",L),window.removeEventListener("pointerup",A),window.removeEventListener("pointercancel",A),c(!1)};window.addEventListener("pointermove",L),window.addEventListener("pointerup",A),window.addEventListener("pointercancel",A)},[i]),y=v.useCallback(()=>a(Y1),[]),x=kY(),S=et(Mf);RY({enabled:!S});const P=x.isProcessing?"Completing authentication...":null,T=at(k5);return v.useEffect(()=>{T(t??null)},[t,T]),E.jsxs(Sl.div,{className:"relative flex h-screen overflow-hidden",initial:!1,animate:{opacity:1},transition:{duration:.5,ease:"easeOut"},"data-cy":"rivet-app",children:[P!==null?E.jsx("div",{className:"absolute inset-0 z-50",children:E.jsx(JZ,{message:P})}):null,E.jsx("div",{className:"relative flex min-w-0 flex-1 flex-col",children:E.jsx(PK,{})}),E.jsx(E.Fragment,{children:e?null:E.jsxs(E.Fragment,{children:[E.jsx("div",{className:"relative order-first h-full flex-shrink-0",style:{width:m?i:0},children:E.jsxs(Sl.div,{className:"absolute inset-y-0 left-0 z-30",initial:!1,animate:{x:n?0:-i},transition:s?{duration:0}:{duration:.2,ease:[.22,1,.36,1]},onAnimationComplete:()=>{n&&_(!0)},style:{width:i,willChange:"transform"},children:[E.jsx(jG,{onClose:()=>r(!1)}),E.jsx("div",{role:"separator","aria-orientation":"vertical","aria-label":"Resize panel",onPointerDown:w,onDoubleClick:y,className:"group/resize absolute inset-y-0 right-0 z-20 flex w-3 cursor-col-resize touch-none justify-end",children:E.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&&E.jsx("div",{className:"fixed inset-0 z-[100] cursor-col-resize"}),E.jsx(gY,{isVisible:!0,isPanelOpen:n,isReducedMotion:!!s,position:d,dragBoundsLeftPx:p,onPositionChange:h,onToggle:()=>r(k=>!k)})]})}),E.jsx(yH,{duration:5e3,richColors:!0,toastOptions:{style:{maxHeight:"150px",overflow:"hidden"}}})]})},m2="rivet_connect_deep_link",YJ=()=>{if(typeof window>"u")return null;const t=new URLSearchParams(window.location.search),e=t.get("connect"),n=e??window.sessionStorage.getItem(m2);if(n!=="pinterest"&&n!=="arena")return null;if(window.sessionStorage.setItem(m2,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},XJ=YJ(),QJ=()=>{const[t,e]=v.useState(window.location.hash),[n]=v.useState(()=>typeof window<"u"&&window.sessionStorage.getItem(tm)==="1"),[r,s]=v.useState(!1),[i,a]=v.useState(XJ);v.useEffect(()=>{n&&window.sessionStorage.removeItem(tm)},[n]);const{config:u,refetchConfig:c,loading:d,error:h}=EY(),p=at(Mf),[m,_]=v.useState(!1),[w,y]=v.useState(null),[x,S]=v.useState(!1);v.useEffect(()=>{u!=null&&u.userId?(Se.identify(u.userId,{...u.email?{email:u.email}:{}}),u.email&&Se.alias(u.email,u.userId)):u!=null&&u.email&&Se.identify(u.email,{email:u.email})},[u==null?void 0:u.userId,u==null?void 0:u.email]),v.useEffect(()=>{u&&Se.register({source:"visual_editor",surface:"visual_editor"})},[u]);const P=v.useCallback(async()=>{var G;const O=globalThis.crypto.randomUUID(),D=Date.now();_(!0),y(null);const N=Z1({outcome:"started",authAttemptId:O,startedAt:D,now:D});Se.capture(N.event,N.properties);let j=null;try{if(j=window.open("","_blank"),!j)throw new Error("Pop-up blocked. Please allow pop-ups and try again.");try{j.document.open(),j.document.write(GJ),j.document.close()}catch(q){V8.warn("Failed to render loading state in auth popup:",q)}const Y=await fetch(`${z8}/api/auth/google/start`,{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({source:"desktop"})}),W=await Y.json();if(!Y.ok||!W.success||!W.authUrl||!W.sessionId||!W.pollSecret)throw new Error(W.error||W.message||"Failed to start Google login");if(j.closed)throw new Error("Sign-in window was closed before Google login started.");j.location.href=W.authUrl;for(let q=0;q<qJ;q+=1){if(j.closed)throw new Error("Sign-in window was closed before authentication completed.");const V=await(await fetch(`${z8}/api/auth/google/token`,{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({session:W.sessionId,pollSecret:W.pollSecret})})).json();if(V.success&&V.token&&((G=V.user)!=null&&G.email)){if(!(await fetch("/api/auth/store",{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({email:V.user.email,token:V.token,refreshToken:V.refreshToken,userId:V.user.id})})).ok)throw new Error("Signed in, but failed to store session locally.");j.close(),window.sessionStorage.setItem(tm,"1");const H=Z1({outcome:"completed",authAttemptId:O,startedAt:D,now:Date.now()});Se.capture(H.event,H.properties),window.location.reload();return}if(V.error&&V.error!=="Pending")throw new Error(V.error||"Google login failed");await new Promise(J=>setTimeout(J,WJ))}throw new Error("Authentication timed out. Please try again.")}catch(Y){j&&!j.closed&&j.close();const W=Y instanceof Error?Y.message:"Failed to start login flow";V8.warn("Login failed:",W);const q=Z1({outcome:"failed",authAttemptId:O,startedAt:D,now:Date.now(),failureReason:BJ(W)});Se.capture(q.event,q.properties),y(W),_(!1)}},[]),T=u!=null&&u.agentModeAvailable!==!0,k=UJ(t),R=v.useCallback(async()=>{S(!0),p(!0);try{await c()}finally{p(!1),S(!1)}},[c,p]);if(v.useEffect(()=>{const O=()=>{const D=window.location.hash;e(D)};return window.addEventListener("hashchange",O),()=>window.removeEventListener("hashchange",O)},[]),k==="design-system")return E.jsx(zJ,{});if(!d&&u===null&&!x){const O=h||"Could not load Rivet configuration.";return E.jsx("div",{className:"bg-main flex h-screen items-center justify-center px-6",children:E.jsxs("div",{className:"border-divider bg-main w-full max-w-md rounded-lg border p-6 text-center shadow-lg",children:[E.jsx("p",{className:"text-content text-sm font-medium",children:"We could not start Rivet yet."}),E.jsx("p",{className:"text-content-dim mt-2 text-xs",children:O}),E.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:()=>{R()},children:"Retry"})]})})}if(T)return E.jsx(XZ,{isSigningIn:m,onStartSignIn:()=>{P()},errorMessage:w,displayMode:"full"});const L=(u==null?void 0:u.agentModeAvailable)===!0&&i!==null,A=(u==null?void 0:u.agentModeAvailable)===!0&&n&&!r&&!L;return E.jsxs(E.Fragment,{children:[E.jsx(ZJ,{projectPath:u==null?void 0:u.projectPath}),E.jsx(G_,{context:"onboarding",isOpen:A,onClose:()=>s(!0)}),E.jsx(G_,{context:"menu",isOpen:L,highlightProvider:i,onClose:()=>{window.sessionStorage.removeItem(m2),a(null)}})]})},JJ="phc_Ntj9tXHbS64XgYxlTfhglRmFivFsfm0AERph4ZlnNH",eee=new yL,tee={session_recording:{maskAllInputs:!0,maskTextSelector:"[data-rivet-private]"}},nee=()=>E.jsx("div",{style:{display:"flex",height:"100vh",alignItems:"center",justifyContent:"center"},children:E.jsx("p",{style:{fontSize:"14px",color:"#6b7280"},children:"Something went wrong. Please reload the page."})});h9.createRoot(document.getElementById("root")).render(E.jsx(ye.StrictMode,{children:E.jsx(r9,{apiKey:JJ,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",...tee,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.14.21",env:"production"})}},children:E.jsx(a9,{fallback:E.jsx(nee,{}),children:E.jsx(_L,{client:eee,children:E.jsx(Fq,{defaultShape:"rounded",children:E.jsx(iJ,{defaultLibrary:"lucide",children:E.jsx(QJ,{})})})})})})}));