rivet-design 0.19.1 → 0.20.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 (151) hide show
  1. package/README.md +12 -0
  2. package/README.npm.md +12 -0
  3. package/dist/cli/commandNames.d.ts.map +1 -1
  4. package/dist/cli/commandNames.js +1 -0
  5. package/dist/cli/commandNames.js.map +1 -1
  6. package/dist/cli/commands/libraryOpen.d.ts.map +1 -1
  7. package/dist/cli/commands/libraryOpen.js +7 -4
  8. package/dist/cli/commands/libraryOpen.js.map +1 -1
  9. package/dist/cli/commands/profile.d.ts.map +1 -1
  10. package/dist/cli/commands/profile.js +19 -2
  11. package/dist/cli/commands/profile.js.map +1 -1
  12. package/dist/cli/commands/serve.d.ts.map +1 -1
  13. package/dist/cli/commands/serve.js +14 -0
  14. package/dist/cli/commands/serve.js.map +1 -1
  15. package/dist/cli/commands/variants.d.ts.map +1 -1
  16. package/dist/cli/commands/variants.js +86 -9
  17. package/dist/cli/commands/variants.js.map +1 -1
  18. package/dist/cli/commands/version.d.ts +3 -0
  19. package/dist/cli/commands/version.d.ts.map +1 -0
  20. package/dist/cli/commands/version.js +29 -0
  21. package/dist/cli/commands/version.js.map +1 -0
  22. package/dist/cli/router.d.ts.map +1 -1
  23. package/dist/cli/router.js +15 -3
  24. package/dist/cli/router.js.map +1 -1
  25. package/dist/index.d.ts.map +1 -1
  26. package/dist/index.js +3 -0
  27. package/dist/index.js.map +1 -1
  28. package/dist/install/automaticCliUpdate.d.ts +8 -0
  29. package/dist/install/automaticCliUpdate.d.ts.map +1 -1
  30. package/dist/install/automaticCliUpdate.js +7 -3
  31. package/dist/install/automaticCliUpdate.js.map +1 -1
  32. package/dist/library/BrowserSessions.d.ts +13 -0
  33. package/dist/library/BrowserSessions.d.ts.map +1 -0
  34. package/dist/library/BrowserSessions.js +62 -0
  35. package/dist/library/BrowserSessions.js.map +1 -0
  36. package/dist/library/HubClient.d.ts.map +1 -1
  37. package/dist/library/HubClient.js +30 -5
  38. package/dist/library/HubClient.js.map +1 -1
  39. package/dist/library/HubServer.d.ts +2 -1
  40. package/dist/library/HubServer.d.ts.map +1 -1
  41. package/dist/library/HubServer.js +6 -2
  42. package/dist/library/HubServer.js.map +1 -1
  43. package/dist/library/browserLaunch.d.ts +6 -0
  44. package/dist/library/browserLaunch.d.ts.map +1 -0
  45. package/dist/library/browserLaunch.js +17 -0
  46. package/dist/library/browserLaunch.js.map +1 -0
  47. package/dist/library/http.d.ts +1 -1
  48. package/dist/library/http.d.ts.map +1 -1
  49. package/dist/library/http.js +2 -2
  50. package/dist/library/http.js.map +1 -1
  51. package/dist/library/hubPort.d.ts +2 -0
  52. package/dist/library/hubPort.d.ts.map +1 -0
  53. package/dist/library/hubPort.js +23 -0
  54. package/dist/library/hubPort.js.map +1 -0
  55. package/dist/routes/library/app.d.ts.map +1 -1
  56. package/dist/routes/library/app.js +13 -1
  57. package/dist/routes/library/app.js.map +1 -1
  58. package/dist/routes/library/browserAccess.d.ts +8 -0
  59. package/dist/routes/library/browserAccess.d.ts.map +1 -0
  60. package/dist/routes/library/browserAccess.js +71 -0
  61. package/dist/routes/library/browserAccess.js.map +1 -0
  62. package/dist/routes/library/index.d.ts.map +1 -1
  63. package/dist/routes/library/index.js +10 -4
  64. package/dist/routes/library/index.js.map +1 -1
  65. package/dist/routes/library/middleware.d.ts +4 -2
  66. package/dist/routes/library/middleware.d.ts.map +1 -1
  67. package/dist/routes/library/middleware.js +26 -3
  68. package/dist/routes/library/middleware.js.map +1 -1
  69. package/dist/routes/library/profiles.d.ts.map +1 -1
  70. package/dist/routes/library/profiles.js +6 -0
  71. package/dist/routes/library/profiles.js.map +1 -1
  72. package/dist/routes/library/types.d.ts +2 -0
  73. package/dist/routes/library/types.d.ts.map +1 -1
  74. package/dist/server.d.ts +2 -0
  75. package/dist/server.d.ts.map +1 -1
  76. package/dist/server.js +31 -5
  77. package/dist/server.js.map +1 -1
  78. package/dist/services/AuthService.d.ts +72 -13
  79. package/dist/services/AuthService.d.ts.map +1 -1
  80. package/dist/services/AuthService.js +57 -13
  81. package/dist/services/AuthService.js.map +1 -1
  82. package/dist/services/BrowserAgentClient.d.ts.map +1 -1
  83. package/dist/services/BrowserAgentClient.js +18 -3
  84. package/dist/services/BrowserAgentClient.js.map +1 -1
  85. package/dist/services/DependencyPreparationService.d.ts +1 -0
  86. package/dist/services/DependencyPreparationService.d.ts.map +1 -1
  87. package/dist/services/DependencyPreparationService.js.map +1 -1
  88. package/dist/services/HistoryReplayService.d.ts.map +1 -1
  89. package/dist/services/HistoryReplayService.js +1 -0
  90. package/dist/services/HistoryReplayService.js.map +1 -1
  91. package/dist/services/IntegrationsClient.d.ts.map +1 -1
  92. package/dist/services/IntegrationsClient.js +121 -5
  93. package/dist/services/IntegrationsClient.js.map +1 -1
  94. package/dist/services/ProjectLibrary.d.ts +6 -1
  95. package/dist/services/ProjectLibrary.d.ts.map +1 -1
  96. package/dist/services/ProjectLibrary.js +20 -4
  97. package/dist/services/ProjectLibrary.js.map +1 -1
  98. package/dist/services/ProjectPackageManager.d.ts +1 -0
  99. package/dist/services/ProjectPackageManager.d.ts.map +1 -1
  100. package/dist/services/ProjectPackageManager.js +24 -8
  101. package/dist/services/ProjectPackageManager.js.map +1 -1
  102. package/dist/services/PrototypeDeployService.d.ts.map +1 -1
  103. package/dist/services/PrototypeDeployService.js +8 -3
  104. package/dist/services/PrototypeDeployService.js.map +1 -1
  105. package/dist/services/TelemetryService.d.ts +2 -2
  106. package/dist/services/TelemetryService.d.ts.map +1 -1
  107. package/dist/services/TelemetryService.js +2 -2
  108. package/dist/services/TelemetryService.js.map +1 -1
  109. package/dist/services/VariantHistoryService.d.ts +9 -0
  110. package/dist/services/VariantHistoryService.d.ts.map +1 -1
  111. package/dist/services/VariantHistoryService.js +11 -2
  112. package/dist/services/VariantHistoryService.js.map +1 -1
  113. package/dist/services/accessTokenRefresh.d.ts.map +1 -1
  114. package/dist/services/accessTokenRefresh.js +12 -4
  115. package/dist/services/accessTokenRefresh.js.map +1 -1
  116. package/dist/services/profiles/DesignProfiles.d.ts +2 -1
  117. package/dist/services/profiles/DesignProfiles.d.ts.map +1 -1
  118. package/dist/services/profiles/DesignProfiles.js +45 -6
  119. package/dist/services/profiles/DesignProfiles.js.map +1 -1
  120. package/dist/services/profiles/ProfileIndex.d.ts +8 -0
  121. package/dist/services/profiles/ProfileIndex.d.ts.map +1 -1
  122. package/dist/services/profiles/ProfileIndex.js +46 -8
  123. package/dist/services/profiles/ProfileIndex.js.map +1 -1
  124. package/dist/services/profiles/profileSearch.d.ts +15 -0
  125. package/dist/services/profiles/profileSearch.d.ts.map +1 -0
  126. package/dist/services/profiles/profileSearch.js +41 -0
  127. package/dist/services/profiles/profileSearch.js.map +1 -0
  128. package/dist/types/design-library.d.ts +38 -0
  129. package/dist/types/design-library.d.ts.map +1 -1
  130. package/dist/types/design-library.js +8 -1
  131. package/dist/types/design-library.js.map +1 -1
  132. package/dist/utils/skills/claude-skill.d.ts +1 -1
  133. package/dist/utils/skills/claude-skill.js +1 -1
  134. package/dist/utils/skills/cli-guidance.d.ts +2 -2
  135. package/dist/utils/skills/cli-guidance.d.ts.map +1 -1
  136. package/dist/utils/skills/cli-guidance.js +12 -7
  137. package/dist/utils/skills/cli-guidance.js.map +1 -1
  138. package/dist/utils/skills/codex-skill.d.ts +1 -1
  139. package/dist/utils/skills/codex-skill.d.ts.map +1 -1
  140. package/dist/utils/skills/codex-skill.js +5 -3
  141. package/dist/utils/skills/codex-skill.js.map +1 -1
  142. package/dist/utils/skills/cursor-rules.d.ts +1 -1
  143. package/dist/utils/skills/cursor-rules.js +1 -1
  144. package/package.json +1 -1
  145. package/src/ui/dist/assets/LibraryEntry-Db0yQPRU.js +36 -0
  146. package/src/ui/dist/assets/main-BAQFukSb.js +435 -0
  147. package/src/ui/dist/assets/main-Dcp0uKa5.css +1 -0
  148. package/src/ui/dist/index.html +2 -2
  149. package/src/ui/dist/assets/LibraryApp-Sm0rsDtm.js +0 -36
  150. package/src/ui/dist/assets/main-5v9Ic8BN.js +0 -438
  151. package/src/ui/dist/assets/main-Ky91HHF_.css +0 -1
@@ -0,0 +1,435 @@
1
+ var o7=Object.defineProperty;var BS=t=>{throw TypeError(t)};var a7=(t,e,n)=>e in t?o7(t,e,{enumerable:!0,configurable:!0,writable:!0,value:n}):t[e]=n;var ma=(t,e,n)=>a7(t,typeof e!="symbol"?e+"":e,n),K1=(t,e,n)=>e.has(t)||BS("Cannot "+n);var W=(t,e,n)=>(K1(t,e,"read from private field"),n?n.call(t):e.get(t)),rt=(t,e,n)=>e.has(t)?BS("Cannot add the same private member more than once"):e instanceof WeakSet?e.add(t):e.set(t,n),Re=(t,e,n,r)=>(K1(t,e,"write to private field"),r?r.call(t,n):e.set(t,n),n),wt=(t,e,n)=>(K1(t,e,"access private method"),n);var d0=(t,e,n,r)=>({set _(s){Re(t,e,s,n)},get _(){return W(t,e,r)}});function l7(t,e){for(var n=0;n<e.length;n++){const r=e[n];if(typeof r!="string"&&!Array.isArray(r)){for(const s in r)if(s!=="default"&&!(s in t)){const i=Object.getOwnPropertyDescriptor(r,s);i&&Object.defineProperty(t,s,i.get?i:{enumerable:!0,get:()=>r[s]})}}}return Object.freeze(Object.defineProperty(t,Symbol.toStringTag,{value:"Module"}))}(function(){const e=document.createElement("link").relList;if(e&&e.supports&&e.supports("modulepreload"))return;for(const s of document.querySelectorAll('link[rel="modulepreload"]'))r(s);new MutationObserver(s=>{for(const i of s)if(i.type==="childList")for(const o of i.addedNodes)o.tagName==="LINK"&&o.rel==="modulepreload"&&r(o)}).observe(document,{childList:!0,subtree:!0});function n(s){const i={};return s.integrity&&(i.integrity=s.integrity),s.referrerPolicy&&(i.referrerPolicy=s.referrerPolicy),s.crossOrigin==="use-credentials"?i.credentials="include":s.crossOrigin==="anonymous"?i.credentials="omit":i.credentials="same-origin",i}function r(s){if(s.ep)return;s.ep=!0;const i=n(s);fetch(s.href,i)}})();const c7="modulepreload",u7=function(t){return"/"+t},ZS={},SP=function(e,n,r){let s=Promise.resolve();if(n&&n.length>0){let o=function(d){return Promise.all(d.map(f=>Promise.resolve(f).then(p=>({status:"fulfilled",value:p}),p=>({status:"rejected",reason:p}))))};document.getElementsByTagName("link");const l=document.querySelector("meta[property=csp-nonce]"),u=(l==null?void 0:l.nonce)||(l==null?void 0:l.getAttribute("nonce"));s=o(n.map(d=>{if(d=u7(d),d in ZS)return;ZS[d]=!0;const f=d.endsWith(".css"),p=f?'[rel="stylesheet"]':"";if(document.querySelector(`link[href="${d}"]${p}`))return;const g=document.createElement("link");if(g.rel=f?"stylesheet":c7,f||(g.as="script"),g.crossOrigin="",g.href=d,u&&g.setAttribute("nonce",u),document.head.appendChild(g),f)return new Promise((v,w)=>{g.addEventListener("load",v),g.addEventListener("error",()=>w(new Error(`Unable to preload CSS for ${d}`)))})}))}function i(o){const l=new Event("vite:preloadError",{cancelable:!0});if(l.payload=o,window.dispatchEvent(l),!l.defaultPrevented)throw o}return s.then(o=>{for(const l of o||[])l.status==="rejected"&&i(l.reason);return e().catch(i)})};function Mg(t){return t&&t.__esModule&&Object.prototype.hasOwnProperty.call(t,"default")?t.default:t}var Y1={exports:{}},lf={},X1={exports:{}},vt={};/**
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 WS;function d7(){if(WS)return vt;WS=1;var t=Symbol.for("react.element"),e=Symbol.for("react.portal"),n=Symbol.for("react.fragment"),r=Symbol.for("react.strict_mode"),s=Symbol.for("react.profiler"),i=Symbol.for("react.provider"),o=Symbol.for("react.context"),l=Symbol.for("react.forward_ref"),u=Symbol.for("react.suspense"),d=Symbol.for("react.memo"),f=Symbol.for("react.lazy"),p=Symbol.iterator;function g(j){return j===null||typeof j!="object"?null:(j=p&&j[p]||j["@@iterator"],typeof j=="function"?j:null)}var v={isMounted:function(){return!1},enqueueForceUpdate:function(){},enqueueReplaceState:function(){},enqueueSetState:function(){}},w=Object.assign,_={};function x(j,Q,oe){this.props=j,this.context=Q,this.refs=_,this.updater=oe||v}x.prototype.isReactComponent={},x.prototype.setState=function(j,Q){if(typeof j!="object"&&typeof j!="function"&&j!=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,j,Q,"setState")},x.prototype.forceUpdate=function(j){this.updater.enqueueForceUpdate(this,j,"forceUpdate")};function S(){}S.prototype=x.prototype;function k(j,Q,oe){this.props=j,this.context=Q,this.refs=_,this.updater=oe||v}var C=k.prototype=new S;C.constructor=k,w(C,x.prototype),C.isPureReactComponent=!0;var T=Array.isArray,A=Object.prototype.hasOwnProperty,I={current:null},M={key:!0,ref:!0,__self:!0,__source:!0};function R(j,Q,oe){var re,ie={},fe=null,_e=null;if(Q!=null)for(re in Q.ref!==void 0&&(_e=Q.ref),Q.key!==void 0&&(fe=""+Q.key),Q)A.call(Q,re)&&!M.hasOwnProperty(re)&&(ie[re]=Q[re]);var ue=arguments.length-2;if(ue===1)ie.children=oe;else if(1<ue){for(var ae=Array(ue),Oe=0;Oe<ue;Oe++)ae[Oe]=arguments[Oe+2];ie.children=ae}if(j&&j.defaultProps)for(re in ue=j.defaultProps,ue)ie[re]===void 0&&(ie[re]=ue[re]);return{$$typeof:t,type:j,key:fe,ref:_e,props:ie,_owner:I.current}}function O(j,Q){return{$$typeof:t,type:j.type,key:Q,ref:j.ref,props:j.props,_owner:j._owner}}function N(j){return typeof j=="object"&&j!==null&&j.$$typeof===t}function D(j){var Q={"=":"=0",":":"=2"};return"$"+j.replace(/[=:]/g,function(oe){return Q[oe]})}var $=/\/+/g;function Y(j,Q){return typeof j=="object"&&j!==null&&j.key!=null?D(""+j.key):Q.toString(36)}function B(j,Q,oe,re,ie){var fe=typeof j;(fe==="undefined"||fe==="boolean")&&(j=null);var _e=!1;if(j===null)_e=!0;else switch(fe){case"string":case"number":_e=!0;break;case"object":switch(j.$$typeof){case t:case e:_e=!0}}if(_e)return _e=j,ie=ie(_e),j=re===""?"."+Y(_e,0):re,T(ie)?(oe="",j!=null&&(oe=j.replace($,"$&/")+"/"),B(ie,Q,oe,"",function(Oe){return Oe})):ie!=null&&(N(ie)&&(ie=O(ie,oe+(!ie.key||_e&&_e.key===ie.key?"":(""+ie.key).replace($,"$&/")+"/")+j)),Q.push(ie)),1;if(_e=0,re=re===""?".":re+":",T(j))for(var ue=0;ue<j.length;ue++){fe=j[ue];var ae=re+Y(fe,ue);_e+=B(fe,Q,oe,ae,ie)}else if(ae=g(j),typeof ae=="function")for(j=ae.call(j),ue=0;!(fe=j.next()).done;)fe=fe.value,ae=re+Y(fe,ue++),_e+=B(fe,Q,oe,ae,ie);else if(fe==="object")throw Q=String(j),Error("Objects are not valid as a React child (found: "+(Q==="[object Object]"?"object with keys {"+Object.keys(j).join(", ")+"}":Q)+"). If you meant to render a collection of children, use an array instead.");return _e}function G(j,Q,oe){if(j==null)return j;var re=[],ie=0;return B(j,re,"","",function(fe){return Q.call(oe,fe,ie++)}),re}function V(j){if(j._status===-1){var Q=j._result;Q=Q(),Q.then(function(oe){(j._status===0||j._status===-1)&&(j._status=1,j._result=oe)},function(oe){(j._status===0||j._status===-1)&&(j._status=2,j._result=oe)}),j._status===-1&&(j._status=0,j._result=Q)}if(j._status===1)return j._result.default;throw j._result}var K={current:null},U={transition:null},ee={ReactCurrentDispatcher:K,ReactCurrentBatchConfig:U,ReactCurrentOwner:I};function Z(){throw Error("act(...) is not supported in production builds of React.")}return vt.Children={map:G,forEach:function(j,Q,oe){G(j,function(){Q.apply(this,arguments)},oe)},count:function(j){var Q=0;return G(j,function(){Q++}),Q},toArray:function(j){return G(j,function(Q){return Q})||[]},only:function(j){if(!N(j))throw Error("React.Children.only expected to receive a single React element child.");return j}},vt.Component=x,vt.Fragment=n,vt.Profiler=s,vt.PureComponent=k,vt.StrictMode=r,vt.Suspense=u,vt.__SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED=ee,vt.act=Z,vt.cloneElement=function(j,Q,oe){if(j==null)throw Error("React.cloneElement(...): The argument must be a React element, but you passed "+j+".");var re=w({},j.props),ie=j.key,fe=j.ref,_e=j._owner;if(Q!=null){if(Q.ref!==void 0&&(fe=Q.ref,_e=I.current),Q.key!==void 0&&(ie=""+Q.key),j.type&&j.type.defaultProps)var ue=j.type.defaultProps;for(ae in Q)A.call(Q,ae)&&!M.hasOwnProperty(ae)&&(re[ae]=Q[ae]===void 0&&ue!==void 0?ue[ae]:Q[ae])}var ae=arguments.length-2;if(ae===1)re.children=oe;else if(1<ae){ue=Array(ae);for(var Oe=0;Oe<ae;Oe++)ue[Oe]=arguments[Oe+2];re.children=ue}return{$$typeof:t,type:j.type,key:ie,ref:fe,props:re,_owner:_e}},vt.createContext=function(j){return j={$$typeof:o,_currentValue:j,_currentValue2:j,_threadCount:0,Provider:null,Consumer:null,_defaultValue:null,_globalName:null},j.Provider={$$typeof:i,_context:j},j.Consumer=j},vt.createElement=R,vt.createFactory=function(j){var Q=R.bind(null,j);return Q.type=j,Q},vt.createRef=function(){return{current:null}},vt.forwardRef=function(j){return{$$typeof:l,render:j}},vt.isValidElement=N,vt.lazy=function(j){return{$$typeof:f,_payload:{_status:-1,_result:j},_init:V}},vt.memo=function(j,Q){return{$$typeof:d,type:j,compare:Q===void 0?null:Q}},vt.startTransition=function(j){var Q=U.transition;U.transition={};try{j()}finally{U.transition=Q}},vt.unstable_act=Z,vt.useCallback=function(j,Q){return K.current.useCallback(j,Q)},vt.useContext=function(j){return K.current.useContext(j)},vt.useDebugValue=function(){},vt.useDeferredValue=function(j){return K.current.useDeferredValue(j)},vt.useEffect=function(j,Q){return K.current.useEffect(j,Q)},vt.useId=function(){return K.current.useId()},vt.useImperativeHandle=function(j,Q,oe){return K.current.useImperativeHandle(j,Q,oe)},vt.useInsertionEffect=function(j,Q){return K.current.useInsertionEffect(j,Q)},vt.useLayoutEffect=function(j,Q){return K.current.useLayoutEffect(j,Q)},vt.useMemo=function(j,Q){return K.current.useMemo(j,Q)},vt.useReducer=function(j,Q,oe){return K.current.useReducer(j,Q,oe)},vt.useRef=function(j){return K.current.useRef(j)},vt.useState=function(j){return K.current.useState(j)},vt.useSyncExternalStore=function(j,Q,oe){return K.current.useSyncExternalStore(j,Q,oe)},vt.useTransition=function(){return K.current.useTransition()},vt.version="18.3.1",vt}var qS;function cx(){return qS||(qS=1,X1.exports=d7()),X1.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 GS;function f7(){if(GS)return lf;GS=1;var t=cx(),e=Symbol.for("react.element"),n=Symbol.for("react.fragment"),r=Object.prototype.hasOwnProperty,s=t.__SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED.ReactCurrentOwner,i={key:!0,ref:!0,__self:!0,__source:!0};function o(l,u,d){var f,p={},g=null,v=null;d!==void 0&&(g=""+d),u.key!==void 0&&(g=""+u.key),u.ref!==void 0&&(v=u.ref);for(f in u)r.call(u,f)&&!i.hasOwnProperty(f)&&(p[f]=u[f]);if(l&&l.defaultProps)for(f in u=l.defaultProps,u)p[f]===void 0&&(p[f]=u[f]);return{$$typeof:e,type:l,key:g,ref:v,props:p,_owner:s.current}}return lf.Fragment=n,lf.jsx=o,lf.jsxs=o,lf}var KS;function h7(){return KS||(KS=1,Y1.exports=f7()),Y1.exports}var b=h7(),m=cx();const we=Mg(m),Uh=l7({__proto__:null,default:we},[m]),kP=m.createContext(void 0),EP=t=>{const e=m.useContext(kP);if(!e)throw new Error("No QueryClient set, use QueryClientProvider to set one");return e},p7=({client:t,children:e})=>(m.useEffect(()=>(t.mount(),()=>{t.unmount()}),[t]),b.jsx(kP.Provider,{value:t,children:e})),m7={setTimeout:(t,e)=>setTimeout(t,e),clearTimeout:t=>clearTimeout(t),setInterval:(t,e)=>setInterval(t,e),clearInterval:t=>clearInterval(t)};var Sa,lx,hP,g7=(hP=class{constructor(){rt(this,Sa,m7);rt(this,lx,!1)}setTimeoutProvider(t){Re(this,Sa,t)}setTimeout(t,e){return W(this,Sa).setTimeout(t,e)}clearTimeout(t){W(this,Sa).clearTimeout(t)}setInterval(t,e){return W(this,Sa).setInterval(t,e)}clearInterval(t){W(this,Sa).clearInterval(t)}},Sa=new WeakMap,lx=new WeakMap,hP);const Ul=new g7;function v7(t){setTimeout(t,0)}const y7=typeof window>"u"||"Deno"in globalThis;function Gr(){}function _7(t,e){return typeof t=="function"?t(e):t}function CP(t){return typeof t=="number"&&t>=0&&t!==1/0}function PP(t,e){return Math.max(t+(e||0)-Date.now(),0)}function hn(t,e){return typeof t=="function"?t(e):t}function YS(t,e){const{type:n="all",exact:r,fetchStatus:s,predicate:i,queryKey:o,stale:l}=t;if(o){if(r){if(e.queryHash!==ux(o,e.options))return!1}else if(!Yu(e.queryKey,o))return!1}if(n!=="all"){const u=e.isActive();if(n==="active"&&!u||n==="inactive"&&u)return!1}return!(typeof l=="boolean"&&e.isStale()!==l||s&&s!==e.state.fetchStatus||i&&!i(e))}function XS(t,e){const{exact:n,status:r,predicate:s,mutationKey:i}=t;if(i){if(!e.options.mutationKey)return!1;if(n){if(th(e.options.mutationKey)!==th(i))return!1}else if(!Yu(e.options.mutationKey,i))return!1}return!(r&&e.state.status!==r||s&&!s(e))}function ux(t,e){return((e==null?void 0:e.queryKeyHashFn)||th)(t)}function th(t){return JSON.stringify(t,(e,n)=>V_(n)?Object.keys(n).sort().reduce((r,s)=>(r[s]=n[s],r),{}):n)}function Yu(t,e){if(t===e)return!0;if(typeof t!=typeof e)return!1;if(t&&e&&typeof t=="object"&&typeof e=="object"){if(Array.isArray(t)&&Array.isArray(e)){if(e.length>t.length)return!1;for(let r=0;r<e.length;r++)if(!Yu(t[r],e[r]))return!1;return!0}const n=Object.keys(e);for(const r of n)if(!Yu(t[r],e[r]))return!1;return!0}return!1}const w7=Object.prototype.hasOwnProperty;function TP(t,e,n=0){if(t===e)return t;if(n>500)return e;const r=QS(t)&&QS(e);if(!r&&!(V_(t)&&V_(e)))return e;const s=(r?t:Object.keys(t)).length,i=r?e:Object.keys(e),o=i.length,l=r?new Array(o):{};let u=0;for(let d=0;d<o;d++){const f=r?d:i[d],p=t[f],g=e[f];if(p===g){l[f]=p,(r?d<s:w7.call(t,f))&&u++;continue}if(p===null||g===null||typeof p!="object"||typeof g!="object"){l[f]=g;continue}const v=TP(p,g,n+1);l[f]=v,v===p&&u++}return s===o&&u===s?t:l}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 QS(t){return Array.isArray(t)&&t.length===Object.keys(t).length}function V_(t){if(!JS(t))return!1;const e=Object.getPrototypeOf(t),n=e==null?void 0:e.constructor;if(n===void 0)return!0;if(typeof n!="function")return!1;const r=n.prototype;return!(!JS(r)||!r.hasOwnProperty("isPrototypeOf")||e!==Object.prototype)}function JS(t){return Object.prototype.toString.call(t)==="[object Object]"}function x7(t){return new Promise(e=>{Ul.setTimeout(e,t)})}function H_(t,e,n){return typeof n.structuralSharing=="function"?n.structuralSharing(t,e):n.structuralSharing!==!1?TP(t,e):e}function b7(t,e,n=0){const r=[...t,e];return n&&r.length>n?r.slice(1):r}function S7(t,e,n=0){const r=[e,...t];return n&&r.length>n?r.slice(0,-1):r}const dx=Symbol();function AP(t,e){return!t.queryFn&&(e!=null&&e.initialPromise)?()=>e.initialPromise:!t.queryFn||t.queryFn===dx?()=>Promise.reject(new Error(`Missing queryFn: '${t.queryHash}'`)):t.queryFn}function RP(t,e){return typeof t=="function"?t(...e):!!t}function k7(t,e,n){let r=!1,s;return Object.defineProperty(t,"signal",{enumerable:!0,get:()=>(s??(s=e()),r||(r=!0,s.aborted?n():s.addEventListener("abort",n,{once:!0})),s)}),t}let E7=()=>y7;const fx=()=>E7();var Bh=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(){}},ql,ka,ju,pP,C7=(pP=class extends Bh{constructor(){super();rt(this,ql);rt(this,ka);rt(this,ju);Re(this,ju,e=>{if(typeof window<"u"&&window.addEventListener){const n=()=>e();return window.addEventListener("visibilitychange",n,!1),()=>{window.removeEventListener("visibilitychange",n)}}})}onSubscribe(){W(this,ka)||this.setEventListener(W(this,ju))}onUnsubscribe(){var e;this.hasListeners()||((e=W(this,ka))==null||e.call(this),Re(this,ka,void 0))}setEventListener(e){var n;Re(this,ju,e),(n=W(this,ka))==null||n.call(this),Re(this,ka,e(r=>{typeof r=="boolean"?this.setFocused(r):this.onFocus()}))}setFocused(e){W(this,ql)!==e&&(Re(this,ql,e),this.onFocus())}onFocus(){const e=this.isFocused();this.listeners.forEach(n=>{n(e)})}isFocused(){var e;return typeof W(this,ql)=="boolean"?W(this,ql):((e=globalThis.document)==null?void 0:e.visibilityState)!=="hidden"}},ql=new WeakMap,ka=new WeakMap,ju=new WeakMap,pP);const hx=new C7,P7=v7;function T7(){let t=[],e=0,n=l=>{l()},r=l=>{l()},s=P7;const i=l=>{e?t.push(l):s(()=>{n(l)})},o=()=>{const l=t;t=[],l.length&&s(()=>{r(()=>{l.forEach(u=>{n(u)})})})};return{batch:l=>{let u;e++;try{u=l()}finally{e--,e||o()}return u},batchCalls:l=>(...u)=>{i(()=>{l(...u)})},schedule:i,setNotifyFunction:l=>{n=l},setBatchNotifyFunction:l=>{r=l},setScheduler:l=>{s=l}}}const hr=T7();var $u,Ea,Fu,mP,A7=(mP=class extends Bh{constructor(){super();rt(this,$u,!0);rt(this,Ea);rt(this,Fu);Re(this,Fu,e=>{if(typeof window<"u"&&window.addEventListener){const n=()=>e(!0),r=()=>e(!1);return window.addEventListener("online",n,!1),window.addEventListener("offline",r,!1),()=>{window.removeEventListener("online",n),window.removeEventListener("offline",r)}}})}onSubscribe(){W(this,Ea)||this.setEventListener(W(this,Fu))}onUnsubscribe(){var e;this.hasListeners()||((e=W(this,Ea))==null||e.call(this),Re(this,Ea,void 0))}setEventListener(e){var n;Re(this,Fu,e),(n=W(this,Ea))==null||n.call(this),Re(this,Ea,e(this.setOnline.bind(this)))}setOnline(e){W(this,$u)!==e&&(Re(this,$u,e),this.listeners.forEach(n=>{n(e)}))}isOnline(){return W(this,$u)}},$u=new WeakMap,Ea=new WeakMap,Fu=new WeakMap,mP);const Sm=new A7;function R7(t){return Math.min(1e3*2**t,3e4)}function MP(t){return(t??"online")==="online"?Sm.isOnline():!0}var z_=class extends Error{constructor(t){super("CancelledError"),this.revert=t==null?void 0:t.revert,this.silent=t==null?void 0:t.silent}};function IP(t){let e=!1,n=0,r,s="pending",i,o;const l=new Promise((k,C)=>{i=k,o=C});l.catch(Gr);const u=()=>s!=="pending",d=k=>{var C;if(!u()){const T=new z_(k);_(T),(C=t.onCancel)==null||C.call(t,T)}},f=()=>{e=!0},p=()=>{e=!1},g=()=>hx.isFocused()&&(t.networkMode==="always"||Sm.isOnline())&&t.canRun(),v=()=>MP(t.networkMode)&&t.canRun(),w=k=>{u()||(r==null||r(),s="resolved",i(k))},_=k=>{u()||(r==null||r(),s="rejected",o(k))},x=()=>new Promise(k=>{var C;r=T=>{(u()||g())&&k(T)},(C=t.onPause)==null||C.call(t)}).then(()=>{var k;r=void 0,u()||(k=t.onContinue)==null||k.call(t)}),S=()=>{if(u())return;let k;const C=n===0?t.initialPromise:void 0;try{k=C??t.fn()}catch(T){k=Promise.reject(T)}Promise.resolve(k).then(w).catch(T=>{var O;if(u())return;const A=t.retry??(fx()?0:3),I=t.retryDelay??R7,M=typeof I=="function"?I(n,T):I,R=A===!0||typeof A=="number"&&n<A||typeof A=="function"&&A(n,T);if(e||!R){_(T);return}n++,(O=t.onFail)==null||O.call(t,n,T),x7(M).then(()=>g()?void 0:x()).then(()=>{e?_(T):S()})})};return{promise:l,status:()=>s,cancel:d,continue:()=>(r==null||r(),l),cancelRetry:f,continueRetry:p,canStart:v,start:()=>(v()?S():x().then(S),l)}}var Gl,gP,OP=(gP=class{constructor(){rt(this,Gl)}destroy(){this.clearGcTimeout()}scheduleGc(){this.clearGcTimeout(),CP(this.gcTime)&&Re(this,Gl,Ul.setTimeout(()=>{this.optionalRemove()},this.gcTime))}updateGcTime(t){this.gcTime=Math.max(this.gcTime||0,t??(fx()?1/0:3e5))}clearGcTimeout(){W(this,Gl)!==void 0&&(Ul.clearTimeout(W(this,Gl)),Re(this,Gl,void 0))}},Gl=new WeakMap,gP);function M7(t){return{onFetch:(e,n)=>{var f,p,g,v,w;const r=e.options,s=(g=(p=(f=e.fetchOptions)==null?void 0:f.meta)==null?void 0:p.fetchMore)==null?void 0:g.direction,i=((v=e.state.data)==null?void 0:v.pages)||[],o=((w=e.state.data)==null?void 0:w.pageParams)||[];let l={pages:[],pageParams:[]},u=0;const d=async()=>{let _=!1;const x=C=>{k7(C,()=>e.signal,()=>_=!0)},S=AP(e.options,e.fetchOptions),k=async(C,T,A)=>{if(_)return Promise.reject(e.signal.reason);if(T==null&&C.pages.length)return Promise.resolve(C);const M=(()=>{const D={client:e.client,queryKey:e.queryKey,pageParam:T,direction:A?"backward":"forward",meta:e.options.meta};return x(D),D})(),R=await S(M),{maxPages:O}=e.options,N=A?S7:b7;return{pages:N(C.pages,R,O),pageParams:N(C.pageParams,T,O)}};if(s&&i.length){const C=s==="backward",T=C?I7:e8,A={pages:i,pageParams:o};l=await k(A,T(r,A),C)}else{const C=t??i.length;do{const T=u===0?o[0]??r.initialPageParam:e8(r,l);if(u>0&&T==null)break;l=await k(l,T),u++}while(u<C)}return l};e.options.persister?e.fetchFn=()=>{var _,x;return(x=(_=e.options).persister)==null?void 0:x.call(_,d,{client:e.client,queryKey:e.queryKey,meta:e.options.meta,signal:e.signal},n)}:e.fetchFn=d}}}function e8(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 I7(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 Vu,Kl,Hu,Bs,Yl,Gn,$h,Xl,mi,bo,vP,O7=(vP=class extends OP{constructor(e){super();rt(this,mi);rt(this,Vu);rt(this,Kl);rt(this,Hu);rt(this,Bs);rt(this,Yl);rt(this,Gn);rt(this,$h);rt(this,Xl);Re(this,Xl,!1),Re(this,$h,e.defaultOptions),this.setOptions(e.options),this.observers=[],Re(this,Yl,e.client),Re(this,Bs,W(this,Yl).getQueryCache()),this.queryKey=e.queryKey,this.queryHash=e.queryHash,Re(this,Kl,n8(this.options)),this.state=e.state??W(this,Kl),this.scheduleGc()}get meta(){return this.options.meta}get queryType(){return W(this,Vu)}get promise(){var e;return(e=W(this,Gn))==null?void 0:e.promise}setOptions(e){if(this.options={...W(this,$h),...e},e!=null&&e._type&&Re(this,Vu,e._type),this.updateGcTime(this.options.gcTime),this.state&&this.state.data===void 0){const n=n8(this.options);n.data!==void 0&&(this.setState(t8(n.data,n.dataUpdatedAt)),Re(this,Kl,n))}}optionalRemove(){!this.observers.length&&this.state.fetchStatus==="idle"&&W(this,Bs).remove(this)}setData(e,n){const r=H_(this.state.data,e,this.options);return wt(this,mi,bo).call(this,{data:r,type:"success",dataUpdatedAt:n==null?void 0:n.updatedAt,manual:n==null?void 0:n.manual}),r}setState(e){wt(this,mi,bo).call(this,{type:"setState",state:e})}cancel(e){var r,s;const n=(r=W(this,Gn))==null?void 0:r.promise;return(s=W(this,Gn))==null||s.cancel(e),n?n.then(Gr).catch(Gr):Promise.resolve()}destroy(){super.destroy(),this.cancel({silent:!0})}get resetState(){return W(this,Kl)}reset(){this.destroy(),this.setState(this.resetState)}isActive(){return this.observers.some(e=>hn(e.options.enabled,this)!==!1)}isDisabled(){return this.getObserversCount()>0?!this.isActive():this.options.queryFn===dx||!this.isFetched()}isFetched(){return this.state.dataUpdateCount+this.state.errorUpdateCount>0}isStatic(){return this.getObserversCount()>0?this.observers.some(e=>hn(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:!PP(this.state.dataUpdatedAt,e)}onFocus(){var e,n;(e=this.observers.find(r=>r.shouldFetchOnWindowFocus()))==null||e.refetch({cancelRefetch:!1}),(n=W(this,Gn))==null||n.continue()}onOnline(){var e,n;(e=this.observers.find(r=>r.shouldFetchOnReconnect()))==null||e.refetch({cancelRefetch:!1}),(n=W(this,Gn))==null||n.continue()}addObserver(e){this.observers.includes(e)||(this.observers.push(e),this.clearGcTimeout(),W(this,Bs).notify({type:"observerAdded",query:this,observer:e}))}removeObserver(e){const n=this.observers.indexOf(e);n!==-1&&(this.observers.splice(n,1),this.observers.length||(W(this,Gn)&&(W(this,Xl)||this.state.fetchStatus==="paused"&&this.state.status==="pending"?W(this,Gn).cancel({revert:!0}):W(this,Gn).cancelRetry()),this.scheduleGc()),W(this,Bs).notify({type:"observerRemoved",query:this,observer:e}))}getObserversCount(){return this.observers.length}invalidate(){this.state.isInvalidated||wt(this,mi,bo).call(this,{type:"invalidate"})}async fetch(e,n){var d,f,p,g,v,w,_,x,S,k,C,T;if(this.state.fetchStatus!=="idle"&&((d=W(this,Gn))==null?void 0:d.status())!=="rejected"){if(this.state.data!==void 0&&(n!=null&&n.cancelRefetch))this.cancel({silent:!0});else if(W(this,Gn))return W(this,Gn).continueRetry(),W(this,Gn).promise}if(e&&this.setOptions(e),!this.options.queryFn){const A=this.observers.find(I=>I.options.queryFn);A&&this.setOptions(A.options)}const r=new AbortController,s=A=>{Object.defineProperty(A,"signal",{enumerable:!0,get:()=>(Re(this,Xl,!0),r.signal)})},i=()=>{const A=AP(this.options,n),M=(()=>{const R={client:W(this,Yl),queryKey:this.queryKey,meta:this.meta};return s(R),R})();return Re(this,Xl,!1),this.options.persister?this.options.persister(A,M,this):A(M)},l=(()=>{const A={fetchOptions:n,options:this.options,queryKey:this.queryKey,client:W(this,Yl),state:this.state,fetchFn:i};return s(A),A})();(f=W(this,Vu)==="infinite"?M7(this.options.pages):this.options.behavior)==null||f.onFetch(l,this),Re(this,Hu,this.state),(this.state.fetchStatus==="idle"||this.state.fetchMeta!==((p=l.fetchOptions)==null?void 0:p.meta))&&wt(this,mi,bo).call(this,{type:"fetch",meta:(g=l.fetchOptions)==null?void 0:g.meta});const u=Re(this,Gn,IP({initialPromise:n==null?void 0:n.initialPromise,fn:l.fetchFn,onCancel:A=>{A instanceof z_&&A.revert&&this.setState({...W(this,Hu),fetchStatus:"idle"}),r.abort()},onFail:(A,I)=>{wt(this,mi,bo).call(this,{type:"failed",failureCount:A,error:I})},onPause:()=>{wt(this,mi,bo).call(this,{type:"pause"})},onContinue:()=>{wt(this,mi,bo).call(this,{type:"continue"})},retry:l.options.retry,retryDelay:l.options.retryDelay,networkMode:l.options.networkMode,canRun:()=>!0}));try{const A=await u.start();if(A===void 0)throw new Error(`${this.queryHash} data is undefined`);return this.setData(A),(w=(v=W(this,Bs).config).onSuccess)==null||w.call(v,A,this),(x=(_=W(this,Bs).config).onSettled)==null||x.call(_,A,this.state.error,this),A}catch(A){if(A instanceof z_){if(A.silent)return W(this,Gn).promise;if(A.revert){if(this.state.data===void 0)throw A;return this.state.data}}throw wt(this,mi,bo).call(this,{type:"error",error:A}),(k=(S=W(this,Bs).config).onError)==null||k.call(S,A,this),(T=(C=W(this,Bs).config).onSettled)==null||T.call(C,this.state.data,A,this),A}finally{W(this,Gn)===u&&Re(this,Gn,void 0),this.scheduleGc()}}},Vu=new WeakMap,Kl=new WeakMap,Hu=new WeakMap,Bs=new WeakMap,Yl=new WeakMap,Gn=new WeakMap,$h=new WeakMap,Xl=new WeakMap,mi=new WeakSet,bo=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,...LP(r.data,this.options),fetchMeta:e.meta??null};case"success":const s={...r,...t8(e.data,e.dataUpdatedAt),dataUpdateCount:r.dataUpdateCount+1,...!e.manual&&{fetchStatus:"idle",fetchFailureCount:0,fetchFailureReason:null}};return Re(this,Hu,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),hr.batch(()=>{this.observers.slice().forEach(r=>{r.onQueryUpdate()}),W(this,Bs).notify({query:this,type:"updated",action:e})})},vP);function LP(t,e){return{fetchFailureCount:0,fetchFailureReason:null,fetchStatus:MP(e.networkMode)?"fetching":"paused",...t===void 0&&{error:null,status:"pending"}}}function t8(t,e){return{data:t,dataUpdatedAt:e??Date.now(),error:null,isInvalidated:!1,status:"success"}}function n8(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 Mr,St,Fh,Ir,Ql,zu,Ro,Vh,Uu,Bu,Jl,ec,Ca,Zu,$t,Sf,U_,B_,Z_,W_,q_,G_,K_,Y_,yP,L7=(yP=class extends Bh{constructor(e,n){super();rt(this,$t);rt(this,Mr);rt(this,St);rt(this,Fh);rt(this,Ir);rt(this,Ql);rt(this,zu);rt(this,Ro);rt(this,Vh);rt(this,Uu);rt(this,Bu);rt(this,Jl);rt(this,ec);rt(this,Ca);rt(this,Zu,new Set);this.options=n,Re(this,Mr,e),Re(this,Ro,null),this.bindMethods(),this.setOptions(n)}bindMethods(){this.refetch=this.refetch.bind(this)}onSubscribe(){this.listeners.size===1&&(W(this,St).addObserver(this),r8(W(this,St),this.options)?wt(this,$t,Sf).call(this):this.updateResult(),wt(this,$t,q_).call(this))}onUnsubscribe(){this.hasListeners()||this.destroy()}shouldFetchOnReconnect(){return X_(W(this,St),this.options,this.options.refetchOnReconnect)}shouldFetchOnWindowFocus(){return X_(W(this,St),this.options,this.options.refetchOnWindowFocus)}destroy(){this.listeners=new Set,wt(this,$t,G_).call(this),wt(this,$t,K_).call(this),W(this,St).removeObserver(this)}setOptions(e){const n=this.options,r=W(this,St);if(this.options=W(this,Mr).defaultQueryOptions(e),this.options.enabled!==void 0&&typeof this.options.enabled!="boolean"&&typeof this.options.enabled!="function"&&typeof hn(this.options.enabled,W(this,St))!="boolean")throw new Error("Expected enabled to be a boolean or a callback that returns a boolean");wt(this,$t,Y_).call(this),W(this,St).setOptions(this.options),n._defaulted&&!Q1(this.options,n)&&W(this,Mr).getQueryCache().notify({type:"observerOptionsUpdated",query:W(this,St),observer:this});const s=this.hasListeners();s&&s8(W(this,St),r,this.options,n)&&wt(this,$t,Sf).call(this),this.updateResult(),s&&(W(this,St)!==r||hn(this.options.enabled,W(this,St))!==hn(n.enabled,W(this,St))||hn(this.options.staleTime,W(this,St))!==hn(n.staleTime,W(this,St)))&&wt(this,$t,B_).call(this);const i=wt(this,$t,Z_).call(this);s&&(W(this,St)!==r||hn(this.options.enabled,W(this,St))!==hn(n.enabled,W(this,St))||i!==W(this,Ca))&&wt(this,$t,W_).call(this,i)}getOptimisticResult(e){const n=W(this,Mr).getQueryCache().build(W(this,Mr),e),r=this.createResult(n,e);return Q1(this.getCurrentResult(),r)||(Re(this,Ir,r),Re(this,zu,this.options),Re(this,Ql,W(this,St).state)),r}getCurrentResult(){return W(this,Ir)}trackResult(e,n){return new Proxy(e,{get:(r,s)=>(this.trackProp(s),n==null||n(s),Reflect.get(r,s))})}trackProp(e){W(this,Zu).add(e)}getCurrentQuery(){return W(this,St)}refetch({...e}={}){return this.fetch({...e})}fetchOptimistic(e){const n=W(this,Mr).defaultQueryOptions(e),r=W(this,Mr).getQueryCache().build(W(this,Mr),n);let s=()=>{},i;const o=new Promise(l=>{i=l,s=W(this,Mr).getQueryCache().subscribe(u=>{u.type==="updated"&&u.query.queryHash===r.queryHash&&r.state.data!==void 0&&(s(),l(this.createResult(r,n)))})});return Promise.race([r.fetch().then(()=>{const l=this.createResult(r,n);return i==null||i(l),l}).finally(()=>{s()}),o])}fetch(e){return wt(this,$t,Sf).call(this,{...e,cancelRefetch:e.cancelRefetch??!0}).then(()=>(this.updateResult(),W(this,Ir)))}createResult(e,n){var I;const r=W(this,St),s=this.options,i=W(this,Ir),o=W(this,Ql),l=W(this,zu),u=e!==r?e.state:W(this,Fh),{state:d}=e;let f={...d},p=!1,g;if(n._optimisticResults){const M=this.hasListeners(),R=!M&&r8(e,n),O=M&&s8(e,r,n,s);(R||O)&&(f={...f,...LP(d.data,e.options)}),n._optimisticResults==="isRestoring"&&(f.fetchStatus="idle")}let{error:v,errorUpdatedAt:w,status:_}=f;g=f.data;let x=!1;if(n.placeholderData!==void 0&&g===void 0&&_==="pending"){let M;i!=null&&i.isPlaceholderData&&n.placeholderData===(l==null?void 0:l.placeholderData)?(M=i.data,x=!0):M=typeof n.placeholderData=="function"?n.placeholderData((I=W(this,Bu))==null?void 0:I.state.data,W(this,Bu)):n.placeholderData,M!==void 0&&(_="success",g=H_(i==null?void 0:i.data,M,n),p=!0)}if(n.select&&g!==void 0&&!x)if(i&&g===(o==null?void 0:o.data)&&n.select===W(this,Vh))g=W(this,Uu);else try{Re(this,Vh,n.select),g=n.select(g),g=H_(i==null?void 0:i.data,g,n),Re(this,Uu,g),Re(this,Ro,null)}catch(M){Re(this,Ro,M)}else g===void 0&&Re(this,Ro,null);W(this,Ro)&&(v=W(this,Ro),g=W(this,Uu),w=Date.now(),_="error",p=!1);const S=f.fetchStatus==="fetching",k=_==="pending",C=_==="error",T=k&&S,A=g!==void 0;return{status:_,fetchStatus:f.fetchStatus,isPending:k,isSuccess:_==="success",isError:C,isInitialLoading:T,isLoading:T,data:g,dataUpdatedAt:f.dataUpdatedAt,error:v,errorUpdatedAt:w,failureCount:f.fetchFailureCount,failureReason:f.fetchFailureReason,errorUpdateCount:f.errorUpdateCount,isFetched:e.isFetched(),isFetchedAfterMount:f.dataUpdateCount>u.dataUpdateCount||f.errorUpdateCount>u.errorUpdateCount,isFetching:S,isRefetching:S&&!k,isLoadingError:C&&!A,isPaused:f.fetchStatus==="paused",isPlaceholderData:p,isRefetchError:C&&A,isStale:px(e,n),refetch:this.refetch,isEnabled:hn(n.enabled,e)!==!1}}updateResult(){const e=W(this,Ir),n=this.createResult(W(this,St),this.options);if(Re(this,Ql,W(this,St).state),Re(this,zu,this.options),W(this,Ql).data!==void 0&&Re(this,Bu,W(this,St)),Q1(n,e))return;Re(this,Ir,n);const s=(()=>{if(!e)return!0;const{notifyOnChangeProps:i}=this.options,o=typeof i=="function"?i():i;if(o==="all"||!o&&!W(this,Zu).size)return!0;const l=new Set(o??W(this,Zu));return this.options.throwOnError&&l.add("error"),Object.keys(W(this,Ir)).some(u=>{const d=u;return W(this,Ir)[d]!==e[d]&&l.has(d)})})();hr.batch(()=>{s&&this.listeners.forEach(i=>{i(W(this,Ir))}),W(this,Mr).getQueryCache().notify({query:W(this,St),type:"observerResultsUpdated"})})}onQueryUpdate(){this.updateResult(),this.hasListeners()&&wt(this,$t,q_).call(this)}},Mr=new WeakMap,St=new WeakMap,Fh=new WeakMap,Ir=new WeakMap,Ql=new WeakMap,zu=new WeakMap,Ro=new WeakMap,Vh=new WeakMap,Uu=new WeakMap,Bu=new WeakMap,Jl=new WeakMap,ec=new WeakMap,Ca=new WeakMap,Zu=new WeakMap,$t=new WeakSet,Sf=function(e){wt(this,$t,Y_).call(this);let n=W(this,St).fetch(this.options,e);return e!=null&&e.throwOnError||(n=n.catch(Gr)),n},U_=function(e){return!fx()&&hn(this.options.enabled,W(this,St))!==!1&&CP(e)},B_=function(){wt(this,$t,G_).call(this);const e=hn(this.options.staleTime,W(this,St));if(W(this,Ir).isStale||!wt(this,$t,U_).call(this,e))return;const n=PP(W(this,Ir).dataUpdatedAt,e)+1;Re(this,Jl,Ul.setTimeout(()=>{W(this,Ir).isStale||this.updateResult()},n))},Z_=function(){return hn(this.options.refetchInterval,W(this,St))??!1},W_=function(e){wt(this,$t,K_).call(this),Re(this,Ca,e),!(W(this,Ca)===0||!wt(this,$t,U_).call(this,W(this,Ca)))&&Re(this,ec,Ul.setInterval(()=>{(this.options.refetchIntervalInBackground||hx.isFocused())&&wt(this,$t,Sf).call(this)},W(this,Ca)))},q_=function(){wt(this,$t,B_).call(this),wt(this,$t,W_).call(this,wt(this,$t,Z_).call(this))},G_=function(){W(this,Jl)!==void 0&&(Ul.clearTimeout(W(this,Jl)),Re(this,Jl,void 0))},K_=function(){W(this,ec)!==void 0&&(Ul.clearInterval(W(this,ec)),Re(this,ec,void 0))},Y_=function(){const e=W(this,Mr).getQueryCache().build(W(this,Mr),this.options);if(e===W(this,St))return;const n=W(this,St);Re(this,St,e),Re(this,Fh,e.state),this.hasListeners()&&(n==null||n.removeObserver(this),e.addObserver(this))},yP);function N7(t,e){return hn(e.enabled,t)!==!1&&t.state.data===void 0&&!(t.state.status==="error"&&hn(e.retryOnMount,t)===!1)}function r8(t,e){return N7(t,e)||t.state.data!==void 0&&X_(t,e,e.refetchOnMount)}function X_(t,e,n){if(hn(e.enabled,t)!==!1&&hn(e.staleTime,t)!=="static"){const r=hn(n,t);return r==="always"||r!==!1&&px(t,e)}return!1}function s8(t,e,n,r){return(t!==e||hn(r.enabled,t)===!1)&&(!n.suspense||t.state.status!=="error")&&px(t,n)}function px(t,e){return hn(e.enabled,t)!==!1&&t.isStaleByTime(hn(e.staleTime,t))}var Hh,ji,Sr,tc,$i,_a,_P,D7=(_P=class extends OP{constructor(e){super();rt(this,$i);rt(this,Hh);rt(this,ji);rt(this,Sr);rt(this,tc);Re(this,Hh,e.client),this.mutationId=e.mutationId,Re(this,Sr,e.mutationCache),Re(this,ji,[]),this.state=e.state||j7(),this.setOptions(e.options),this.scheduleGc()}setOptions(e){this.options=e,this.updateGcTime(this.options.gcTime)}get meta(){return this.options.meta}addObserver(e){W(this,ji).includes(e)||(W(this,ji).push(e),this.clearGcTimeout(),W(this,Sr).notify({type:"observerAdded",mutation:this,observer:e}))}removeObserver(e){Re(this,ji,W(this,ji).filter(n=>n!==e)),this.scheduleGc(),W(this,Sr).notify({type:"observerRemoved",mutation:this,observer:e})}optionalRemove(){W(this,ji).length||(this.state.status==="pending"?this.scheduleGc():W(this,Sr).remove(this))}continue(){var e;return((e=W(this,tc))==null?void 0:e.continue())??(this.state.status==="pending"?this.execute(this.state.variables):Promise.resolve())}async execute(e){var l,u,d,f,p,g,v,w,_,x,S,k,C,T,A,I,M,R;const n=()=>{wt(this,$i,_a).call(this,{type:"continue"})},r={client:W(this,Hh),meta:this.options.meta,mutationKey:this.options.mutationKey},s=Re(this,tc,IP({fn:()=>this.options.mutationFn?this.options.mutationFn(e,r):Promise.reject(new Error("No mutationFn found")),onFail:(O,N)=>{wt(this,$i,_a).call(this,{type:"failed",failureCount:O,error:N})},onPause:()=>{wt(this,$i,_a).call(this,{type:"pause"})},onContinue:n,retry:this.options.retry??0,retryDelay:this.options.retryDelay,networkMode:this.options.networkMode,canRun:()=>W(this,Sr).canRun(this)})),i=this.state.status==="pending",o=!s.canStart();try{if(i)n();else{wt(this,$i,_a).call(this,{type:"pending",variables:e,isPaused:o}),W(this,Sr).config.onMutate&&await W(this,Sr).config.onMutate(e,this,r);const N=await((u=(l=this.options).onMutate)==null?void 0:u.call(l,e,r));N!==this.state.context&&wt(this,$i,_a).call(this,{type:"pending",context:N,variables:e,isPaused:o})}const O=await s.start();return await((f=(d=W(this,Sr).config).onSuccess)==null?void 0:f.call(d,O,e,this.state.context,this,r)),await((g=(p=this.options).onSuccess)==null?void 0:g.call(p,O,e,this.state.context,r)),await((w=(v=W(this,Sr).config).onSettled)==null?void 0:w.call(v,O,null,this.state.variables,this.state.context,this,r)),await((x=(_=this.options).onSettled)==null?void 0:x.call(_,O,null,e,this.state.context,r)),wt(this,$i,_a).call(this,{type:"success",data:O}),O}catch(O){try{await((k=(S=W(this,Sr).config).onError)==null?void 0:k.call(S,O,e,this.state.context,this,r))}catch(N){Promise.reject(N)}try{await((T=(C=this.options).onError)==null?void 0:T.call(C,O,e,this.state.context,r))}catch(N){Promise.reject(N)}try{await((I=(A=W(this,Sr).config).onSettled)==null?void 0:I.call(A,void 0,O,this.state.variables,this.state.context,this,r))}catch(N){Promise.reject(N)}try{await((R=(M=this.options).onSettled)==null?void 0:R.call(M,void 0,O,e,this.state.context,r))}catch(N){Promise.reject(N)}throw wt(this,$i,_a).call(this,{type:"error",error:O}),O}finally{W(this,tc)===s&&Re(this,tc,void 0),W(this,Sr).runNext(this)}}},Hh=new WeakMap,ji=new WeakMap,Sr=new WeakMap,tc=new WeakMap,$i=new WeakSet,_a=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),hr.batch(()=>{W(this,ji).forEach(r=>{r.onMutationUpdate(e)}),W(this,Sr).notify({mutation:this,type:"updated",action:e})})},_P);function j7(){return{context:void 0,data:void 0,error:null,failureCount:0,failureReason:null,isPaused:!1,status:"idle",variables:void 0,submittedAt:0}}var Mo,gi,zh,wP,$7=(wP=class extends Bh{constructor(e={}){super();rt(this,Mo);rt(this,gi);rt(this,zh);this.config=e,Re(this,Mo,new Set),Re(this,gi,new Map),Re(this,zh,0)}build(e,n,r){const s=new D7({client:e,mutationCache:this,mutationId:++d0(this,zh)._,options:e.defaultMutationOptions(n),state:r});return this.add(s),s}add(e){W(this,Mo).add(e);const n=f0(e);if(typeof n=="string"){const r=W(this,gi).get(n);r?r.push(e):W(this,gi).set(n,[e])}this.notify({type:"added",mutation:e})}remove(e){if(W(this,Mo).delete(e)){const n=f0(e);if(typeof n=="string"){const r=W(this,gi).get(n);if(r)if(r.length>1){const s=r.indexOf(e);s!==-1&&r.splice(s,1)}else r[0]===e&&W(this,gi).delete(n)}}this.notify({type:"removed",mutation:e})}canRun(e){var r;const n=f0(e);if(typeof n=="string"){const s=(r=W(this,gi).get(n))==null?void 0:r.find(i=>i.state.status==="pending");return!s||s===e}else return!0}runNext(e){var r,s;const n=f0(e);return typeof n=="string"?((s=(r=W(this,gi).get(n))==null?void 0:r.find(i=>i!==e&&i.state.isPaused))==null?void 0:s.continue())??Promise.resolve():Promise.resolve()}clear(){hr.batch(()=>{W(this,Mo).forEach(e=>{this.notify({type:"removed",mutation:e})}),W(this,Mo).clear(),W(this,gi).clear()})}getAll(){return Array.from(W(this,Mo))}find(e){const n={exact:!0,...e};return this.getAll().find(r=>XS(n,r))}findAll(e={}){return this.getAll().filter(n=>XS(e,n))}notify(e){hr.batch(()=>{this.listeners.forEach(n=>{n(e)})})}resumePausedMutations(){const e=this.getAll().filter(n=>n.state.isPaused);return hr.batch(()=>Promise.all(e.map(n=>n.continue().catch(Gr))))}},Mo=new WeakMap,gi=new WeakMap,zh=new WeakMap,wP);function f0(t){var e;return(e=t.options.scope)==null?void 0:e.id}var Fi,xP,F7=(xP=class extends Bh{constructor(e={}){super();rt(this,Fi);this.config=e,Re(this,Fi,new Map)}build(e,n,r){const s=n.queryKey,i=n.queryHash??ux(s,n);let o=this.get(i);return o||(o=new O7({client:e,queryKey:s,queryHash:i,options:e.defaultQueryOptions(n),state:r,defaultOptions:e.getQueryDefaults(s)}),this.add(o)),o}add(e){W(this,Fi).has(e.queryHash)||(W(this,Fi).set(e.queryHash,e),this.notify({type:"added",query:e}))}remove(e){W(this,Fi).get(e.queryHash)===e&&(e.destroy(),W(this,Fi).delete(e.queryHash),this.notify({type:"removed",query:e}))}clear(){hr.batch(()=>{this.getAll().forEach(e=>{this.remove(e)})})}get(e){return W(this,Fi).get(e)}getAll(){return[...W(this,Fi).values()]}find(e){const n={exact:!0,...e};return this.getAll().find(r=>YS(n,r))}findAll(e={}){const n=this.getAll();return Object.keys(e).length>0?n.filter(r=>YS(e,r)):n}notify(e){hr.batch(()=>{this.listeners.forEach(n=>{n(e)})})}onFocus(){hr.batch(()=>{this.getAll().forEach(e=>{e.onFocus()})})}onOnline(){hr.batch(()=>{this.getAll().forEach(e=>{e.onOnline()})})}},Fi=new WeakMap,xP),xn,Pa,Ta,Wu,qu,Aa,Gu,Ku,bP,V7=(bP=class{constructor(t={}){rt(this,xn);rt(this,Pa);rt(this,Ta);rt(this,Wu);rt(this,qu);rt(this,Aa);rt(this,Gu);rt(this,Ku);Re(this,xn,t.queryCache||new F7),Re(this,Pa,t.mutationCache||new $7),Re(this,Ta,t.defaultOptions||{}),Re(this,Wu,new Map),Re(this,qu,new Map),Re(this,Aa,0)}mount(){d0(this,Aa)._++,W(this,Aa)===1&&(Re(this,Gu,hx.subscribe(async t=>{t&&(await this.resumePausedMutations(),W(this,xn).onFocus())})),Re(this,Ku,Sm.subscribe(async t=>{t&&(await this.resumePausedMutations(),W(this,xn).onOnline())})))}unmount(){var t,e;d0(this,Aa)._--,W(this,Aa)===0&&((t=W(this,Gu))==null||t.call(this),Re(this,Gu,void 0),(e=W(this,Ku))==null||e.call(this),Re(this,Ku,void 0))}isFetching(t){return W(this,xn).findAll({...t,fetchStatus:"fetching"}).length}isMutating(t){return W(this,Pa).findAll({...t,status:"pending"}).length}getQueryData(t){var n;const e=this.defaultQueryOptions({queryKey:t});return(n=W(this,xn).get(e.queryHash))==null?void 0:n.state.data}ensureQueryData(t){const e=this.defaultQueryOptions(t),n=W(this,xn).build(this,e),r=n.state.data;return r===void 0?this.fetchQuery(t):(t.revalidateIfStale&&n.isStaleByTime(hn(e.staleTime,n))&&this.prefetchQuery(e),Promise.resolve(r))}getQueriesData(t){return W(this,xn).findAll(t).map(({queryKey:e,state:n})=>[e,n.data])}setQueryData(t,e,n){var o;const r=this.defaultQueryOptions({queryKey:t}),s=(o=W(this,xn).get(r.queryHash))==null?void 0:o.state.data,i=_7(e,s);if(i!==void 0)return W(this,xn).build(this,r).setData(i,{...n,manual:!0})}setQueriesData(t,e,n){return hr.batch(()=>W(this,xn).findAll(t).map(({queryKey:r})=>[r,this.setQueryData(r,e,n)]))}getQueryState(t){var n;const e=this.defaultQueryOptions({queryKey:t});return(n=W(this,xn).get(e.queryHash))==null?void 0:n.state}removeQueries(t){const e=W(this,xn);hr.batch(()=>{e.findAll(t).forEach(n=>{e.remove(n)})})}resetQueries(t,e){const n=W(this,xn);return hr.batch(()=>{const r=n.findAll(t),s=new Set(r);return r.forEach(i=>{i.reset()}),this.refetchQueries({type:"active",predicate:i=>s.has(i)},e)})}cancelQueries(t,e={}){const n={revert:!0,...e},r=hr.batch(()=>W(this,xn).findAll(t).map(s=>s.cancel(n)));return Promise.all(r).then(Gr).catch(Gr)}invalidateQueries(t,e={}){return hr.batch(()=>(W(this,xn).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=hr.batch(()=>W(this,xn).findAll(t).filter(s=>!s.isDisabled()&&!s.isStatic()).map(s=>{let i=s.fetch(void 0,n);return n.throwOnError||(i=i.catch(Gr)),s.state.fetchStatus==="paused"?Promise.resolve():i}));return Promise.all(r).then(Gr)}async query(t){const e=this.defaultQueryOptions(t);e.retry===void 0&&(e.retry=!1);const n=W(this,xn).build(this,e),r=n.isStaleByTime(hn(e.staleTime,n))?await n.fetch(e):n.state.data,s=e.select;return s?s(r):r}fetchQuery(t){const e=this.defaultQueryOptions(t);e.retry===void 0&&(e.retry=!1);const n=W(this,xn).build(this,e);return n.isStaleByTime(hn(e.staleTime,n))?n.fetch(e):Promise.resolve(n.state.data)}prefetchQuery(t){return this.fetchQuery(t).then(Gr).catch(Gr)}infiniteQuery(t){return t._type="infinite",this.query(t)}fetchInfiniteQuery(t){return t._type="infinite",this.fetchQuery(t)}prefetchInfiniteQuery(t){return this.fetchInfiniteQuery(t).then(Gr).catch(Gr)}ensureInfiniteQueryData(t){return t._type="infinite",this.ensureQueryData(t)}resumePausedMutations(){return Sm.isOnline()?W(this,Pa).resumePausedMutations():Promise.resolve()}getQueryCache(){return W(this,xn)}getMutationCache(){return W(this,Pa)}getDefaultOptions(){return W(this,Ta)}setDefaultOptions(t){Re(this,Ta,t)}setQueryDefaults(t,e){W(this,Wu).set(th(t),{queryKey:t,defaultOptions:e})}getQueryDefaults(t){const e=[...W(this,Wu).values()],n={};return e.forEach(r=>{Yu(t,r.queryKey)&&Object.assign(n,r.defaultOptions)}),n}setMutationDefaults(t,e){W(this,qu).set(th(t),{mutationKey:t,defaultOptions:e})}getMutationDefaults(t){const e=[...W(this,qu).values()],n={};return e.forEach(r=>{Yu(t,r.mutationKey)&&Object.assign(n,r.defaultOptions)}),n}defaultQueryOptions(t){if(t._defaulted)return t;const e={...W(this,Ta).queries,...this.getQueryDefaults(t.queryKey),...t,_defaulted:!0};return e.queryHash||(e.queryHash=ux(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===dx&&(e.enabled=!1),e}defaultMutationOptions(t){return t!=null&&t._defaulted?t:{...W(this,Ta).mutations,...(t==null?void 0:t.mutationKey)&&this.getMutationDefaults(t.mutationKey),...t,_defaulted:!0}}clear(){W(this,xn).clear(),W(this,Pa).clear()}},xn=new WeakMap,Pa=new WeakMap,Ta=new WeakMap,Wu=new WeakMap,qu=new WeakMap,Aa=new WeakMap,Gu=new WeakMap,Ku=new WeakMap,bP);const NP=m.createContext(!1),H7=()=>m.useContext(NP);NP.Provider;function z7(){let t=!1;return{clearReset:()=>{t=!1},reset:()=>{t=!0},isReset:()=>t}}const U7=m.createContext(z7()),B7=()=>m.useContext(U7),Z7=(t,e,n)=>{const r=n!=null&&n.state.error&&typeof t.throwOnError=="function"?RP(t.throwOnError,[n.state.error,n]):t.throwOnError;(t.suspense||r)&&(e.isReset()||(t.retryOnMount=!1))},W7=t=>{m.useEffect(()=>{t.clearReset()},[t])},q7=({result:t,errorResetBoundary:e,throwOnError:n,query:r,suspense:s})=>t.isError&&!e.isReset()&&!t.isFetching&&r&&(s&&t.data===void 0||RP(n,[t.error,r])),G7=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))}},K7=(t,e)=>(t==null?void 0:t.suspense)&&e.isPending,Y7=(t,e,n)=>e.fetchOptimistic(t).catch(()=>{n.clearReset()});function X7(t,e,n){const r=H7(),s=B7(),i=EP(),o=i.defaultQueryOptions(t),l=i.getQueryCache().get(o.queryHash),u=t.subscribed!==!1;o._optimisticResults=r?"isRestoring":u?"optimistic":void 0,G7(o),Z7(o,s,l),W7(s);const[d]=m.useState(()=>new e(i,o)),f=d.getOptimisticResult(o),p=!r&&u;if(m.useSyncExternalStore(m.useCallback(g=>{const v=p?d.subscribe(hr.batchCalls(g)):Gr;return d.updateResult(),v},[d,p]),()=>d.getCurrentResult(),()=>d.getCurrentResult()),m.useEffect(()=>{d.setOptions(o)},[o,d]),K7(o,f))throw Y7(o,d,s);if(q7({result:f,errorResetBoundary:s,throwOnError:o.throwOnError,query:l,suspense:o.suspense}))throw f.error;return o.notifyOnChangeProps?f:d.trackResult(f)}function nh(t,e){return X7(t,L7)}const J="u">typeof window?window:void 0,Er="u">typeof globalThis?globalThis:J,Xn=Er==null?void 0:Er.navigator,de=Er==null?void 0:Er.document,ln=Er==null?void 0:Er.location,rh=Er==null?void 0:Er.fetch,mx=Er!=null&&Er.XMLHttpRequest&&"withCredentials"in new Er.XMLHttpRequest?Er.XMLHttpRequest:void 0,i8=Er==null?void 0:Er.AbortController,Q7=Er==null?void 0:Er.CompressionStream,Or=Xn==null?void 0:Xn.userAgent;function DP(){return!(!J||J.navigator.onLine===!1)}const cf=typeof globalThis<"u"?globalThis:J;cf&&typeof self>"u"&&(cf.self=cf),cf&&typeof File>"u"&&(cf.File=function(){});const $e=J??{},J7="0.9.1",No={DEBUG:!1,LIB_VERSION:J7,LIB_NAME:"browser-common"};var Li=(function(t){return t.AnonymousId="anonymous_id",t.DistinctId="distinct_id",t.Props="props",t.EnablePersonProcessing="enable_person_processing",t.PersonMode="person_mode",t.FeatureFlagDetails="feature_flag_details",t.FeatureFlags="feature_flags",t.FeatureFlagPayloads="feature_flag_payloads",t.BootstrapFeatureFlagDetails="bootstrap_feature_flag_details",t.BootstrapFeatureFlags="bootstrap_feature_flags",t.BootstrapFeatureFlagPayloads="bootstrap_feature_flag_payloads",t.OverrideFeatureFlags="override_feature_flags",t.Queue="queue",t.AiQueue="ai_queue",t.AiCaptureQueue="ai_capture_queue",t.LogsQueue="logs_queue",t.OptedOut="opted_out",t.SessionId="session_id",t.SessionStartTimestamp="session_start_timestamp",t.SessionLastTimestamp="session_timestamp",t.PersonProperties="person_properties",t.GroupProperties="group_properties",t.InstalledAppBuild="installed_app_build",t.InstalledAppVersion="installed_app_version",t.SessionReplay="session_replay",t.PushRegistered="push_registered",t.SessionReplayEventTriggerActivatedSession="session_replay_event_trigger_activated_session",t.SurveyLastSeenDate="survey_last_seen_date",t.SurveysInProgress="surveys_in_progress",t.SurveysSeen="surveys_seen",t.Surveys="surveys",t.RemoteConfig="remote_config",t.FlagsEndpointWasHit="flags_endpoint_was_hit",t.DeviceId="device_id",t})({}),Q_=(function(t){return t.GZipJS="gzip-js",t.Base64="base64",t})({});const ej=["$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"],tj=["token"];function Ze(t,e){return t.indexOf(e)!==-1}const Ig=function(t){return t.trim()},J_=function(t){return t.replace(/^\$/,"")};function jP(t){var e;const n=[];return(e=JSON.stringify(t,function(r,s){if(typeof s=="bigint")return s.toString();if(typeof s!="function"&&typeof s!="symbol"){if(s instanceof Error)return{name:s.name,message:s.message,stack:s.stack};if(s&&typeof s=="object"){for(;n.length>0&&n[n.length-1]!==this;)n.pop();if(n.includes(s))return"[Circular]";n.push(s)}return s}}))!==null&&e!==void 0?e:"null"}const $P=Object.prototype,gx=$P.hasOwnProperty,Og=$P.toString,We=Array.isArray||function(t){return Og.call(t)==="[object Array]"},Yn=t=>typeof t=="function",dt=t=>t===Object(t)&&!We(t),Kr=t=>{if(dt(t)){for(const e in t)if(gx.call(t,e))return!1;return!0}return!1},ce=t=>t===void 0,lt=t=>Og.call(t)=="[object String]",If=t=>lt(t)&&t.trim().length===0,cn=t=>t===null,Qe=t=>ce(t)||cn(t),mn=t=>Og.call(t)=="[object Number]"&&t==t,So=t=>mn(t)&&t>0,Nr=t=>Og.call(t)==="[object Boolean]",nj=t=>Ze(ej,t),rj=t=>Ze(tj,t);function FP(t){return t===null||typeof t!="object"}function km(t,e){return{}.toString.call(t)===`[object ${e}]`}function md(t){switch({}.toString.call(t)){case"[object Error]":case"[object Exception]":case"[object DOMException]":case"[object DOMError]":case"[object WebAssembly.Exception]":return!0;default:return VP(t,Error)}}function vx(t){return"u">typeof Event&&VP(t,Event)}function VP(t,e){try{return t instanceof e}catch{return!1}}const sj=[!0,"true",1,"1","yes"],J1=t=>Ze(sj,t),ij=[!1,"false",0,"0","no"];function o8(t,e,n,r,s,i,o){try{var l=t[i](o),u=l.value}catch(d){return void n(d)}l.done?e(u):Promise.resolve(u).then(r,s)}function Gt(t){return function(){var e=this,n=arguments;return new Promise(function(r,s){var i=t.apply(e,n);function o(u){o8(i,r,s,o,l,"next",u)}function l(u){o8(i,r,s,o,l,"throw",u)}o(void 0)})}}const oj=["amazonbot","amazonproductbot","app.hypefactors.com","applebot","archive.org_bot","awariobot","backlinksextendedbot","baiduspider","bingbot","bingpreview","chrome-lighthouse","dataforseobot","deepscan","duckduckbot","facebookexternal","facebookcatalog","http://yandex.com/bots","hubspot","ia_archiver","leikibot","linkedinbot","meta-externalagent","mj12bot","msnbot","nessus","petalbot","pinterestbot","prerender","rogerbot","screaming frog","sebot-wa","sitebulb","slackbot","slurp","trendictionbot","turnitin","twitterbot","vercel-screenshot","vercelbot","yahoo! slurp","yandexbot","zoombot","bot.htm","bot.php","(bot;","bot/","crawler","ahrefsbot","ahrefssiteaudit","semrushbot","siteauditbot","splitsignalbot","gptbot","oai-searchbot","chatgpt-user","perplexitybot","better uptime bot","sentryuptimebot","uptimerobot","headlesschrome","cypress","google-hoteladsverifier","adsbot-google","apis-google","duplexweb-google","feedfetcher-google","google favicon","google web preview","google-read-aloud","googlebot","googleother","google-cloudvertexbot","googleweblight","mediapartners-google","storebot-google","google-inspectiontool","bytespider"],a8=function(t,e=[]){if(!t)return!1;const n=t.toLowerCase();return oj.concat(e).some(r=>{const s=r.toLowerCase();return n.indexOf(s)!==-1})};function Ui(t,e,n,r,s){return e>n&&(r.warn("min cannot be greater than max."),e=n),mn(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),Ui(s??n,e,n,r))}var aj=class{constructor(t){this.C={},this.I=t.I,this.R=Ui(t.bucketSize,0,100,t.A),this.$=Ui(t.refillRate,0,this.R,t.A),this.O=Ui(t.refillInterval,0,864e5,t.A)}F(t,e){const n=Math.floor((e-t.lastAccess)/this.O);n>0&&(t.tokens=Math.min(t.tokens+n*this.$,this.R),t.lastAccess=t.lastAccess+n*this.O)}consumeRateLimit(t){var e;const n=Date.now(),r=String(t);let s=this.C[r];return s?this.F(s,n):(s={tokens:this.R,lastAccess:n},this.C[r]=s),s.tokens===0||(s.tokens--,s.tokens===0&&((e=this.I)===null||e===void 0||e.call(this,t)),s.tokens===0)}stop(){this.C={}}};const Xu="Mobile",sh="Android",Em="Tablet",HP="Android Tablet",zP="iPad",UP="Apple Watch",q0="Safari",Lg="BlackBerry",BP="Samsung Internet",G0="Chrome",ZP="Chrome iOS",WP="Internet Explorer",qP="Internet Explorer Mobile",GP="Opera",KP="Microsoft Edge",K0="Firefox",YP="Firefox iOS",Cm="Nintendo",Pm="PlayStation",Ng="Xbox",XP="Android Mobile",QP="Mobile Safari",ey="Windows",JP="Windows Phone",l8="Nokia",e2="Ouya",lj="Generic "+Xu.toLowerCase(),e5="Generic "+Em.toLowerCase(),t2="Konqueror",t5="Oculus Browser",n5="Vivaldi",r5="Yandex",s5="Whale",i5="DuckDuckGo",o5="Pale Moon",a5="Waterfox",n2="Brave",l5="Claude",c5="Codex",u5="ChatGPT",d5="Google Search App",ty=new RegExp("Version/(\\d+(\\.\\d+)?)"),ny=new RegExp("(Claude|Codex|ChatGPT)\\/(\\d+(\\.\\d+)?)"),cj=new RegExp(Ng,"i"),uj=new RegExp("PlayStation \\w+","i"),dj=new RegExp("Nintendo \\w+","i"),yx=new RegExp("BlackBerry|PlayBook|BB10","i"),fj={"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"},f5=function(t,e,n,r){return e=e||"",(function(i){return i!=null&&i.brave?n2:null})(n)||(r!=null&&r.detectGoogleSearchApp&&Ze(t,"GSA/")?d5:Ze(t," OPR/")&&Ze(t,"Mini")?"Opera Mini":Ze(t," OPR/")?GP:yx.test(t)?Lg:Ze(t,"IEMobile")||Ze(t,"WPDesktop")?qP:Ze(t,"OculusBrowser")?t5:Ze(t,"SamsungBrowser")?BP:Ze(t,"Edge")||Ze(t,"Edg/")?KP:Ze(t,"Vivaldi/")?n5:Ze(t,"YaBrowser/")?r5:Ze(t,"Whale/")?s5:Ze(t,"DuckDuckGo/")||Ze(t,"Ddg/")?i5:Ze(t,"Claude/")?l5:Ze(t,"Codex/")?c5:Ze(t,"ChatGPT/")?u5:Ze(t,"FBIOS")?"Facebook Mobile":Ze(t,"UCWEB")||Ze(t,"UCBrowser")?"UC Browser":Ze(t,"CriOS")?ZP:Ze(t,"CrMo")||Ze(t,G0)?G0:Ze(t,sh)&&Ze(t,q0)?XP:Ze(t,"FxiOS")?YP:Ze(t.toLowerCase(),t2.toLowerCase())?t2:Ze(t,"Brave/")?n2:((i,o)=>o&&Ze(o,"Apple")||(function(l){return Ze(l,q0)&&!Ze(l,G0)&&!Ze(l,sh)})(i))(t,e)?Ze(t,Xu)?QP:q0:Ze(t,"PaleMoon/")?o5:Ze(t,"Waterfox/")?a5:Ze(t,K0)?K0:Ze(t,"MSIE")||Ze(t,"Trident/")?WP:Ze(t,"Gecko")?K0:"")},hj={[qP]:[new RegExp("rv:(\\d+(\\.\\d+)?)")],[KP]:[new RegExp("Edge?\\/(\\d+(\\.\\d+)?)")],[G0]:[new RegExp("(Chrome|CrMo)\\/(\\d+(\\.\\d+)?)")],[ZP]:[new RegExp("CriOS\\/(\\d+(\\.\\d+)?)")],"UC Browser":[new RegExp("(UCBrowser|UCWEB)\\/(\\d+(\\.\\d+)?)")],[q0]:[ty],[QP]:[ty],[GP]:[new RegExp("(Opera|OPR)\\/(\\d+(\\.\\d+)?)")],[K0]:[new RegExp("Firefox\\/(\\d+(\\.\\d+)?)")],[YP]:[new RegExp("FxiOS\\/(\\d+(\\.\\d+)?)")],[t2]:[new RegExp("Konqueror[:/]?(\\d+(\\.\\d+)?)","i")],[Lg]:[new RegExp("BlackBerry (\\d+(\\.\\d+)?)"),ty],[XP]:[new RegExp("android\\s(\\d+(\\.\\d+)?)","i")],[BP]:[new RegExp("SamsungBrowser\\/(\\d+(\\.\\d+)?)")],[t5]:[new RegExp("OculusBrowser\\/(\\d+(\\.\\d+)?)")],[n5]:[new RegExp("Vivaldi\\/(\\d+(\\.\\d+)?)")],[r5]:[new RegExp("YaBrowser\\/(\\d+(\\.\\d+)?)")],[s5]:[new RegExp("Whale\\/(\\d+(\\.\\d+)?)")],[n2]:[new RegExp("Brave\\/(\\d+(\\.\\d+)?)")],[l5]:[ny],[c5]:[ny],[u5]:[ny],[i5]:[new RegExp("(DuckDuckGo|Ddg)\\/(\\d+(\\.\\d+)?)")],[o5]:[new RegExp("PaleMoon\\/(\\d+(\\.\\d+)?)")],[a5]:[new RegExp("Waterfox\\/(\\d+(\\.\\d+)?)")],[d5]:[new RegExp("GSA\\/(\\d+(\\.\\d+)?)")],[WP]:[new RegExp("(rv:|MSIE )(\\d+(\\.\\d+)?)")],Mozilla:[new RegExp("rv:(\\d+(\\.\\d+)?)")]},pj=function(t,e,n,r){const s=f5(t,e,n,r),i=hj[s];if(ce(i))return null;for(let o=0;i.length>o;o++){const l=t.match(i[o]);if(l)return parseFloat(l[l.length-2])}return null},c8=[[new RegExp("Xbox; Xbox (.*?)[);]","i"),t=>[Ng,t&&t[1]||""]],[new RegExp(Cm,"i"),[Cm,""]],[new RegExp(Pm,"i"),[Pm,""]],[yx,[Lg,""]],[new RegExp(ey,"i"),(t,e)=>{if(/Phone/.test(e)||/WPDesktop/.test(e))return[JP,""];if(new RegExp(Xu).test(e)&&!/IEMobile\b/.test(e))return["Windows Mobile",""];const n=/Windows NT ([0-9.]+)/i.exec(e);if(n&&n[1]){let r=fj[n[1]]||"";return/arm/i.test(e)&&(r="RT"),[ey,r]}return[ey,""]}],[/((iPhone|iPad|iPod).*?OS (\d+)_(\d+)_?(\d+)?|iPhone)/,t=>t&&t[3]?["iOS",[t[3],t[4],t[5]||"0"].join(".")]:["iOS",""]],[/(watch.*\/(\d+\.\d+\.\d+)|watch os,(\d+\.\d+),)/i,t=>{let e="";return t&&t.length>=3&&(e=ce(t[2])?t[3]:t[2]),["watchOS",e]}],[new RegExp("(Android (\\d+)\\.(\\d+)\\.?(\\d+)?|Android)","i"),t=>t&&t[2]?[sh,[t[2],t[3],t[4]||"0"].join(".")]:[sh,""]],[/Mac OS X (\d+)[_.](\d+)[_.]?(\d+)?/i,t=>{const e=["Mac OS X",""];return t&&t[1]&&(e[1]=[t[1],t[2],t[3]||"0"].join(".")),e}],[/Mac/i,["Mac OS X",""]],[/CrOS/,["Chrome OS",""]],[/Linux|debian/i,["Linux",""]]],h5=function(t){for(let e=0;c8.length>e;e++){const[n,r]=c8[e],s=n.exec(t),i=s&&(Yn(r)?r(s,t):r);if(i)return i}return["",""]},p5=function(t){return dj.test(t)?Cm:uj.test(t)?Pm:cj.test(t)?Ng:new RegExp(e2,"i").test(t)?e2:new RegExp("(Windows Phone|WPDesktop)","i").test(t)?JP:/iPad/.test(t)?zP:/iPod/.test(t)?"iPod Touch":/iPhone/.test(t)?"iPhone":/(watch)(?: ?os[,/]|\d,\d\/)[\d.]+/i.test(t)?UP:yx.test(t)?Lg:/(kobo)\s(ereader|touch)/i.test(t)?"Kobo":new RegExp(l8,"i").test(t)?l8:/(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(Xu).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)?sh:HP:new RegExp("(pda|Mobile)","i").test(t)?lj:new RegExp(Em,"i").test(t)&&!new RegExp("Tablet pc","i").test(t)?e5:""},mj=function(t,e){var n;const r=p5(t);return r===zP||r===HP||r==="Kobo"||r==="Kindle Fire"||r===e5?Em:r===Cm||r===Ng||r===Pm||r===e2?"Console":r===UP?"Wearable":r?Xu:(e==null?void 0:e.userAgentDataPlatform)==="Android"&&((n=e==null?void 0:e.maxTouchPoints)!==null&&n!==void 0?n:0)>0?600>Math.min((s=e==null?void 0:e.screenWidth)!==null&&s!==void 0?s:0,(i=e==null?void 0:e.screenHeight)!==null&&i!==void 0?i:0)/((o=e==null?void 0:e.devicePixelRatio)!==null&&o!==void 0?o:1)?Xu:Em:"Desktop";var s,i,o},ry=/\bFBAV\/(\d+(?:\.\d+)*)/i,u8=[[/\bInstagram(?:[ /](\d+(?:\.\d+)*))?\b/i,"Instagram"],[/\bBarcelona[ /](\d+(?:\.\d+)*)?/i,"Threads"],[/\b(?:MessengerForiOS|(?:FBAN|FB_IAB)\/Orca-Android)\b/i,"Messenger",ry],[/\bFBAN\/EMA\b/i,"Facebook Lite",ry],[/\b(?:FBIOS|(?:FBAN|FB_IAB)\/(?:FB4A|FBIOS))\b/i,"Facebook",ry],[/\bLinkedInApp(?:\]?\/(\d+(?:\.\d+)*))?\b/i,"LinkedIn"],[/\bTwitter(?:Android| for (?:iPhone|iPad|Android))(?:\/(\d+(?:\.\d+)*))?\b/i,"Twitter"],[/\b(?:musical_ly|trill)(?:[_/](\d+\.\d+(?:\.\d+)*))?(?=\b|_)/i,"TikTok",/\bapp_version\/(\d+(?:\.\d+)*)/i],[/\b(?:MicroMessenger|WeChat)\/(\d+(?:\.\d+)*)?/i,"WeChat"],[/\bLine\/(\d+(?:\.\d+)*)?/i,"Line"],[/\bGSA\/(\d+(?:\.\d+)*)?/i,"Google"],[/\[Pinterest\/(?:iOS|Android)\b|\bPinterest(?: for (?:Android(?: Tablet)?|iOS))?\/(\d+(?:\.\d+)*)/i,"Pinterest"],[/\b(?:WA4A|WAiOS)\/(\d+(?:\.\d+)*)?/i,"WhatsApp"],[/\bSnapchat[ /](\d+(?:\.\d+)*)?/i,"Snapchat"],[/\bBing(?:Web|Sapphire)\/(\d+(?:\.\d+)*)?/i,"Bing"],[/\bNAVER\(inapp; search;/i,"Naver",/\bNAVER\(inapp; search;[^;)]*; (\d+(?:\.\d+)*)/i],[/\bKAKAOTALK[ /](\d+\.\d+(?:\.\d+)*)?/i,"KakaoTalk"]],r2="[Truncated]",Zh="[Unserializable]";function Tu(t){let e="";for(let n=0;t.length>n;n++){const r=t.charCodeAt(n);if(55296>r||r>56319)e+=56320>r||r>57343?t[n]:"�";else{const s=t.charCodeAt(n+1);56320>s||s>57343?e+="�":(e+=t[n]+t[n+1],n++)}}return e}function m5(t,e){if(!e)return t;let n=[];try{n=Object.keys(e)}catch{n=[]}for(const r of n){let s;try{s=e[r]}catch{s=Zh}Object.defineProperty(t,r,{value:s,enumerable:!0,writable:!0,configurable:!0})}return t}const Y0=3e5;var g5=class{record(t){if(t.kind==="too-large")return;if(t.kind!=="retry-later")return void this.reset();if(!t.retryAfterMs)return;const e=this.isOpen(),n=Date.now(),r=Math.min(t.retryAfterMs,Y0);if(!e)return this.ts=n,void(this.es=n+r);this.es=Math.max(this.es,Math.min(n+r,this.ts+Y0))}remainingMs(){const t=Date.now();if(this.ts-5e3>t)return this.reset(),0;const e=Math.min(Y0,Math.max(0,this.es-t));return e===0&&this.reset(),e}isOpen(){return this.remainingMs()>0}reset(){this.es=0,this.ts=0}constructor(){this.es=0,this.ts=0}};const gj=/^[0-9a-f]{8}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{12}$/i;function d8(t,e){return typeof(n=t)=="string"&&gj.test(n)?t:e();var n}function v5(t,e){const n=new Error(e);try{Object.defineProperty(n,"name",{value:t,writable:!0,enumerable:!0,configurable:!0})}catch{}return n}function Ua(t){return t&&t.split("#")[0]}function f8(t){try{return t()}catch{return}}function y5(t,e){const n=setTimeout(t,e);return n!=null&&n.unref&&(n==null||n.unref()),n}function h8(t,e,n){return _5.apply(this,arguments)}function _5(){return(_5=Gt(function*(t,e,n){let r;try{return yield Promise.race([t,new Promise((s,i)=>{r=y5(()=>{try{n==null||n(),s()}catch(o){i(o)}},e)})])}finally{clearTimeout(r)}})).apply(this,arguments)}let h0,p8,sy;function vj(t){const e=globalThis._posthogChunkIds;if(!e)return;const n=Object.keys(e);return sy&&n.length===p8||(p8=n.length,sy=n.reduce((r,s)=>{h0||(h0={});const i=h0[s];if(i)r[i[0]]=i[1];else{const o=t(s);for(let l=o.length-1;l>=0;l--){const u=o[l],d=u==null?void 0:u.filename,f=e[s];if(d&&f){r[d]=f,h0[s]=[d,f];break}}}return r},{})),sy}function Of(t){return Of=typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?function(e){return typeof e}:function(e){return e&&typeof Symbol=="function"&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e},Of(t)}function yj(t,e,n){return(e=(function(r){var s=(function(i){if(Of(i)!="object"||!i)return i;var o=i[Symbol.toPrimitive];if(o!==void 0){var l=o.call(i,"string");if(Of(l)!="object")return l;throw new TypeError("@@toPrimitive must return a primitive value.")}return String(i)})(r);return Of(s)=="symbol"?s:s+""})(e))in t?Object.defineProperty(t,e,{value:n,enumerable:!0,configurable:!0,writable:!0}):t[e]=n,t}function m8(t,e){var n=Object.keys(t);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(t);e&&(r=r.filter(function(s){return Object.getOwnPropertyDescriptor(t,s).enumerable})),n.push.apply(n,r)}return n}function H(t){for(var e=1;arguments.length>e;e++){var n=arguments[e]!=null?arguments[e]:{};e%2?m8(Object(n),!0).forEach(function(r){yj(t,r,n[r])}):Object.getOwnPropertyDescriptors?Object.defineProperties(t,Object.getOwnPropertyDescriptors(n)):m8(Object(n)).forEach(function(r){Object.defineProperty(t,r,Object.getOwnPropertyDescriptor(n,r))})}return t}var _j=class{constructor(t,e,n=[]){this.coercers=t,this.stackParser=e,this.modifiers=n}buildFromUnknown(t,e={}){const n=e&&e.mechanism||{handled:!0,type:"generic"},r=this.buildCoercingContext(n,e,0).apply(t),s=this.buildParsingContext(e),i=this.parseStacktrace(r,s);return{$exception_list:this.convertToExceptionList(i,n),$exception_level:"error"}}modifyFrames(t){var e=this;return Gt(function*(){for(const n of t)n.stacktrace&&n.stacktrace.frames&&We(n.stacktrace.frames)&&(n.stacktrace.frames=yield e.applyModifiers(n.stacktrace.frames));return t})()}coerceFallback(t){var e;return{type:"Error",value:"Unknown error",stack:(e=t.syntheticException)===null||e===void 0?void 0:e.stack,synthetic:!0}}parseStacktrace(t,e){var n;let r,s;if(t.cause!=null&&(r=this.parseStacktrace(t.cause,e)),t.stack!=""&&t.stack!=null)try{s=this.applyChunkIds(this.stackParser(t.stack,t.synthetic?e.skipFirstLines:0),e.chunkIdMap)}catch{}return H(H({},t),{},{cause:r,stack:s,errors:(n=t.errors)===null||n===void 0?void 0:n.map(i=>this.parseStacktrace(i,e))})}applyChunkIds(t,e){return t.map(n=>(n.filename&&e&&(n.chunk_id=e[n.filename]),n))}applyCoercers(t,e){for(const n of this.coercers)if(n.match(t))return n.coerce(t,e);return this.coerceFallback(e)}applyModifiers(t){var e=this;return Gt(function*(){let n=t;for(const r of e.modifiers)n=yield r(n);return n})()}convertToExceptionList(t,e){const n=[],r=(s,i,o)=>{var l;const u=n.length,d=i===void 0?H(H({type:typeof e.type=="string"&&e.type.length>0?e.type:"generic"},typeof e.handled=="boolean"?{handled:e.handled}:e.handled===void 0?{handled:!0}:{}),{},{synthetic:typeof e.synthetic=="boolean"?e.synthetic:s.synthetic,exception_id:u}):{type:"chained",source:o,synthetic:s.synthetic,exception_id:u,parent_id:i},f={type:s.type,value:s.value,mechanism:d};s.stack&&(f.stacktrace={type:"raw",frames:s.stack}),n.push(f),s.cause&&r(s.cause,u,"cause");for(const p of(l=s.errors)!==null&&l!==void 0?l:[])r(p,u,"member")};return r(t),n}buildParsingContext(t){var e;return{chunkIdMap:vj(this.stackParser),skipFirstLines:(e=t.skipFirstLines)!==null&&e!==void 0?e:1}}getAggregateErrors(t){try{if(md(t)){let n=Object.getPrototypeOf(t);for(let r=0;n&&100>r;r++){var e;const s=(e=Object.getOwnPropertyDescriptor(n,"constructor"))===null||e===void 0?void 0:e.value;if(typeof s=="function"&&s.name==="AggregateError"){const i=t.errors;return We(i)?i:void 0}n=Object.getPrototypeOf(n)}}}catch{}}buildCoercingContext(t,e,n=0){let r=0,s=0,i=!1;const o=new Set,l=[],u={},d=(g,v,w=0)=>{const _=f(v,w),x=_.apply;if(_.apply=I=>{l.push(g);try{return x(I)}finally{l.pop()}},w>4||w>0&&l.indexOf(g)!==-1)return this.coerceFallback(_);const S=typeof g=="object"&&g!==null||typeof g=="function";if(w===0&&r>=50||S&&o.has(g))return;S&&o.add(g),w===0&&r++;const k=this.getAggregateErrors(g);let C,T;i||(i=!!k);try{if(C=this.applyCoercers(g,_),!C)throw u}catch(I){if(I===u)return void(w===0&&r--);if(!i)throw I;C=this.coerceFallback(_)}if(!k||r>=50)return C;try{T=k.length}catch{return C}if(!Number.isInteger(T)||0>T||T>4294967295)return C;const A=[];for(let I=0;50>r&&1e3>s&&T>I;I++){let M;s++;try{M=_.next(k[I])}catch{r++,M=this.coerceFallback(f(v+1))}M&&A.push(M)}return H(H({},C),{},{errors:A})},f=(g,v=0)=>H(H({},e),{},{syntheticException:g==0?e.syntheticException:void 0,mechanism:g==0?t:{},apply(w){const _=d(w,g,v+1);if(!_)throw u;return _},next:w=>d(w,g+1)}),p=f(n);return H(H({},p),{},{apply:g=>{var v;return(v=d(g,n))!==null&&v!==void 0?v:this.coerceFallback(p)}})}};const wj=/^([a-z][a-z0-9.+-]+):/i,xj=["http","https","file","blob","app","capacitor","ionic","webpack","webpack-internal","ng"];function bj(t){if(!t||t==="<anonymous>")return!1;const e=wj.exec(t);return!e||xj.includes(e[1].toLowerCase())}function s2(t,e,n,r,s){const i={platform:t,filename:e,function:n==="<anonymous>"?"?":n,in_app:bj(e)};return ce(r)||(i.lineno=r),ce(s)||(i.colno=s),i}const w5=(t,e)=>{const n=t.indexOf("safari-extension")!==-1,r=t.indexOf("safari-web-extension")!==-1;return n||r?[t.indexOf("@")!==-1?t.split("@")[0]:"?",n?`safari-extension:${e}`:`safari-web-extension:${e}`]:[t,e]},Sj=/^\s*at (\S+?)(?::(\d+))(?::(\d+))\s*$/i,kj=/^\s*at (?:(.+?\)(?: \[.+\])?|.*?) ?\((?:address at )?)?(?:async )?((?:<anonymous>|[-a-z]+:|.*bundle|\/)?.*?)(?::(\d+))?(?::(\d+))?\)?\s*$/i,Ej=/\((\S*)(?::(\d+))(?::(\d+))\)/,Cj=(t,e)=>{const n=Sj.exec(t);if(n){const[,s,i,o]=n;return s2(e,s,"?",+i,+o)}const r=kj.exec(t);if(r){if(r[2]&&r[2].indexOf("eval")===0){const o=Ej.exec(r[2]);o&&(r[2]=o[1],r[3]=o[2],r[4]=o[3])}const[s,i]=w5(r[1]||"?",r[2]);return s2(e,i,s,r[3]?+r[3]:void 0,r[4]?+r[4]:void 0)}},Pj=/^\s*(.*?)(?:\((.*?)\))?(?:^|@)?((?:[-a-z]+)?:\/.*?|\[native code\]|[^@]*(?:bundle|\d+\.js)|\/[\w\-. /=]+)(?::(\d+))?(?::(\d+))?\s*$/i,Tj=/(\S+) line (\d+)(?: > eval line \d+)* > eval/i,Aj=(t,e)=>{const n=Pj.exec(t);if(n){if(n[3]&&n[3].indexOf(" > eval")>-1){const i=Tj.exec(n[3]);i&&(n[1]=n[1]||"eval",n[3]=i[1],n[4]=i[2],n[5]="")}let r=n[3],s=n[1]||"?";return[s,r]=w5(s,r),s2(e,r,s,n[4]?+n[4]:void 0,n[5]?+n[5]:void 0)}},g8=/\(error: (.*)\)/;function _x(t,e){return t.filename===e.filename&&t.function===e.function&&t.module===e.module&&t.lineno===e.lineno&&t.colno===e.colno}function Rj(t){for(let e=1;10>=e;e++){const n=t.length-2*e;if(0>n)break;let r=!0;for(let s=0;e>s;s++)if(!_x(t[n+s],t[n+e+s])){r=!1;break}if(r){for(let s=0;e>s;s++)t[n+s]=t[n+e+s];return t.length=n+e,{start:n,length:e}}}}function Mj(t,e){const n=e.start+e.length,r=b5(t,e);r&&t.splice(n+r===t.length?n:e.start,r)}function x5(t,e){let n=e.start;for(;n>0&&_x(t[n-1],t[n-1+e.length]);)n--;return e.start-n}function b5(t,e){const n=e.start+e.length;let r=n;for(;t.length>r&&_x(t[r],t[r-e.length]);)r++;return r-n}function Ij(t,e){const n=e[0];let r=t.length-(n?x5(t,n):0);for(const s of e)r-=b5(t,s);return r}function Oj(t,e,n){for(let r=0;t.length>r;r++){const s=t[(e+r)%t.length],i=t[(n+r)%t.length];if(s!==i)return i>s}return!1}var Lj=class{match(t){return this.isDOMException(t)||this.isDOMError(t)}coerce(t,e){const n=lt(t.stack);return{type:this.getType(t),value:this.getValue(t),stack:n?t.stack:void 0,cause:t.cause?e.next(t.cause):void 0,synthetic:!1}}getType(t){return this.isDOMError(t)?"DOMError":"DOMException"}getValue(t){const e=t.name||(this.isDOMError(t)?"DOMError":"DOMException");return t.message?`${e}: ${t.message}`:e}isDOMException(t){return km(t,"DOMException")}isDOMError(t){return km(t,"DOMError")}},Nj=class{match(t){return md(t)}coerce(t,e){var n;const r=this.getStack(t),s=r===void 0?(n=e.syntheticException)===null||n===void 0?void 0:n.stack:void 0,i=!!s;return{type:this.getType(t),value:this.getMessage(t,e),stack:r??s,cause:t.cause?e.next(t.cause):void 0,synthetic:i}}getType(t){return t.name||t.constructor.name}getMessage(t,e){const n=t.message;return String(n.error&&typeof n.error.message=="string"?n.error.message:n)}getStack(t){try{const e=t.stacktrace;if(typeof e=="string"&&e.length>0)return e;const n=t.stack;return typeof n=="string"&&n.length>0?n:void 0}catch{return}}},Dj=class{match(t){return!!km(t,"ErrorEvent")&&(t.error!=null||this.ar(t))}coerce(t,e){var n;if(t.error!=null)return e.apply(t.error);const r=e.apply(t.message);return H(H({},r),{},{stack:(n=this.lr(t))!==null&&n!==void 0?n:r.stack,synthetic:!0})}ar(t){return lt(t.message)&&t.message.length>0}lr(t){var e,n;const r=t,s=(e=r.lineno)!==null&&e!==void 0?e:0,i=(n=r.colno)!==null&&n!==void 0?n:0;if(lt(r.filename)&&r.filename.length!==0&&s!==0)return`Error
18
+ at ${r.filename}:${s}:${i}`}};const jj=/^(?:[Uu]ncaught (?:exception: )?)?(?:((?:Eval|Internal|Range|Reference|Syntax|Type|URI|)Error): )?(.*)$/i;var $j=class{match(t){return typeof t=="string"}coerce(t,e){var n;const[r,s]=this.getInfos(t);return{type:r??"Error",value:s??t,stack:(n=e.syntheticException)===null||n===void 0?void 0:n.stack,synthetic:!0}}getInfos(t){let e="Error",n=t;const r=t.match(jj);return r&&(e=r[1],n=r[2]),[e,n]}};const Fj=["fatal","error","warning","log","info","debug"];function S5(t,e=40){const n=Object.keys(t);if(n.sort(),!n.length)return"[object has no keys]";for(let r=n.length;r>0;r--){const s=n.slice(0,r).join(", ");if(e>=s.length)return r===n.length?s:s.length>e?`${s.slice(0,e)}...`:s}return""}var Vj=class{match(t){return typeof t=="object"&&t!==null}coerce(t,e){var n,r;const s=this.getErrorPropertyFromObject(t);return s?e.apply(s):{type:this.getType(t),value:this.getValue(t),stack:(n=this.getStack(t))!==null&&n!==void 0?n:(r=e.syntheticException)===null||r===void 0?void 0:r.stack,level:this.isSeverityLevel(t.level)?t.level:"error",synthetic:!0}}getType(t){if(vx(t))return t.constructor.name;const e="name"in t?t.name:void 0;return lt(e)&&!If(e)?e:"Error"}getValue(t){if("name"in t&&typeof t.name=="string"){let n=`'${t.name}' captured as exception`;return"message"in t&&typeof t.message=="string"&&(n+=` with message: '${t.message}'`),n}if("message"in t&&typeof t.message=="string")return t.message;const e=this.getObjectClassName(t);return`${e&&e!=="Object"?`'${e}'`:"Object"} captured as exception with keys: ${S5(t)}`}isSeverityLevel(t){return lt(t)&&!If(t)&&Fj.indexOf(t)>=0}getStack(t){try{return lt(t.stacktrace)&&t.stacktrace.length>0?t.stacktrace:lt(t.stack)&&t.stack.length>0?t.stack:void 0}catch{return}}getErrorPropertyFromObject(t){for(const e in t)if({}.hasOwnProperty.call(t,e)){const n=t[e];if(md(n))return n}}getObjectClassName(t){try{const e=Object.getPrototypeOf(t);return e?e.constructor.name:void 0}catch{return}}},Hj=class{match(t){return vx(t)}coerce(t,e){var n;const r=t.constructor.name;return{type:r,value:`${r} captured as exception with keys: ${S5(t)}`,stack:(n=e.syntheticException)===null||n===void 0?void 0:n.stack,synthetic:!0}}},zj=class{match(t){return FP(t)}coerce(t,e){var n;return{type:"Error",value:`Primitive value captured as exception: ${String(t)}`,stack:(n=e.syntheticException)===null||n===void 0?void 0:n.stack,synthetic:!0}}},Uj=class{match(t){return km(t,"PromiseRejectionEvent")||this.isCustomEventWrappingRejection(t)}isCustomEventWrappingRejection(t){if(!vx(t))return!1;try{const e=t.detail;return e!=null&&typeof e=="object"&&"reason"in e}catch{return!1}}coerce(t,e){var n;const r=this.getUnhandledRejectionReason(t);return FP(r)?{type:"UnhandledRejection",value:`Non-Error promise rejection captured with value: ${String(r)}`,stack:(n=e.syntheticException)===null||n===void 0?void 0:n.stack,synthetic:!0}:e.apply(r)}getUnhandledRejectionReason(t){try{if("reason"in t)return t.reason;if("detail"in t&&t.detail!=null&&typeof t.detail=="object"&&"reason"in t.detail)return t.detail.reason}catch{}return t}};const Tm="$message",Am="$timestamp",Bj=new Set([Tm,Am]),iy={enabled:!0,max_bytes:32768};function Rm(t){var e;return t?{enabled:(e=t.enabled)!==null&&e!==void 0?e:iy.enabled,max_bytes:Wj(t.max_bytes,iy.max_bytes)}:H({},iy)}var Zj=class{constructor(t){this.ns=[],this.ss=0,this.Mr=Rm(t)}setConfig(t){this.Mr=Rm(t),this.rs()}add(t){const e=(function(r){let s;try{s=jP(r)}catch{return}try{const i=JSON.parse(s);if(!dt(i))return;const o=i,l=o[Tm],u=o[Am];return!lt(l)||l.trim().length===0||!lt(u)&&!mn(u)?void 0:{step:o,json:s}}catch{return}})(t);if(!e)return;const n=(function(r){if("u">typeof TextEncoder)return new TextEncoder().encode(r).length;const s=encodeURIComponent(r);let i=0;for(let o=0;s.length>o;o++)s[o]==="%"?(i+=1,o+=2):i+=1;return i})(e.json);n>this.Mr.max_bytes||(this.ns.push({step:e.step,bytes:n}),this.ss+=n,this.rs())}getAttachable(){return this.ns.map(t=>t.step)}clear(){this.ns=[],this.ss=0}size(){return this.ns.length}rs(){for(;this.ss>this.Mr.max_bytes&&this.ns.length>0;){const t=this.ns.shift();t&&(this.ss-=t.bytes)}}};function Wj(t,e){if(!mn(t)||t===1/0||t===-1/0)return e;const n=Math.floor(t);return 0>n?e:n}const v8=t=>{if(typeof t!="string")return t;try{return JSON.parse(t)}catch{return t}};function y8(t){return typeof t=="string"||t}function _8(t){return typeof t=="string"?t:void 0}const qj=["$feature_flag","$feature_flag_response","$feature_flag_has_experiment","$feature_flag_id","$feature_flag_version","$feature_flag_reason","$feature_flag_request_id","$feature_flag_evaluated_at","$feature_flag_error","locally_evaluated","$groups","$process_person_profile","$geoip_disable","$current_url","$pathname","$referring_domain","utm_source","utm_medium","utm_campaign","utm_content","utm_term","gad_source","mc_cid","gclid","gclsrc","dclid","gbraid","wbraid","fbclid","msclkid","twclid","li_fat_id","igshid","ttclid","rdt_cid","epik","qclid","sccid","oppref","irclid","_kx","$session_id","$window_id","$lib","$lib_version","$device_id","$is_server"],k5="NativeGzipValidationError",i2=t=>t.length>=2&&t[0]===31&&t[1]===139,w8=(t,e)=>t===Q_.GZipJS||e===Q_.GZipJS||e==="gzip",x8=t=>!(!t||typeof t!="object")&&("name"in t?String(t.name):"")==="NotReadableError";let uf;const p0=t=>{throw v5(k5,`Native gzip produced invalid output: ${t}`)},Gj=(b8=Gt(function*(t,e){18>t.size&&p0("too-short");const n=new Uint8Array(yield t.slice(0,10).arrayBuffer());i2(n)&&n[2]===8||p0("invalid-header");const r=new DataView(yield t.slice(t.size-8).arrayBuffer());r.getUint32(0,!0)!==(i=>{const o=(()=>{if(uf)return uf;uf=[];for(let u=0;256>u;u++){let d=u;for(let f=0;8>f;f++)d=1&d?3988292384^d>>>1:d>>>1;uf[u]=d>>>0}return uf})();let l=4294967295;for(let u=0;i.length>u;u++)l=o[255&(l^i[u])]^l>>>8;return(4294967295^l)>>>0})(e)&&p0("invalid-crc");const s=e.length>>>0;r.getUint32(4,!0)!==s&&p0("invalid-size")}),function(t,e){return b8.apply(this,arguments)});var b8;function o2(){return o2=Gt(function*(t,e=!0,n){try{const s=new TextEncoder().encode(t),i=new globalThis.CompressionStream("gzip"),o=i.writable.getWriter(),l=o.write(s).then(()=>o.close()).catch((r=Gt(function*(f){try{yield o.abort(f)}catch{}throw f}),function(f){return r.apply(this,arguments)})),u=new Response(i.readable).blob(),[d]=yield Promise.all([u,l]);return yield Gj(d,s),d}catch(s){if(n!=null&&n.rethrow)throw s;return e&&console.error("Failed to gzip compress data",s),null}var r}),o2.apply(this,arguments)}function E5(t,e){if(t==null)return{};var n,r,s=(function(o,l){if(o==null)return{};var u={};for(var d in o)if({}.hasOwnProperty.call(o,d)){if(l.includes(d))continue;u[d]=o[d]}return u})(t,e);if(Object.getOwnPropertySymbols){var i=Object.getOwnPropertySymbols(t);for(r=0;i.length>r;r++)e.includes(n=i[r])||{}.propertyIsEnumerable.call(t,n)&&(s[n]=t[n])}return s}const Kj={}.propertyIsEnumerable;function Mm(t,e){try{return C5(t,e,{ancestors:new WeakSet,remainingNodes:1e4},0)}catch{return[]}}function wx(t,e,n,r){if(0>=n.remainingNodes)return{stringValue:r2};if(n.remainingNodes--,Nr(t))return{boolValue:t};if(typeof t=="bigint")return(function(s,i){const o=s.toString(),l=BigInt("9223372036854775808");return s>=l||-l>s?(i==null||i.debug(`Attribute ${o} is outside the int64 range; encoding it as a string`),{stringValue:o}):{intValue:o}})(t,e);if(typeof t=="number"){if(!Number.isFinite(t))return{stringValue:String(t)};if(Number.isInteger(t)){if(Number.isSafeInteger(t))return{intValue:String(t)};if(typeof BigInt>"u")return{stringValue:String(t)};const s=BigInt(t).toString();return t>=9223372036854776e3||-9223372036854776e3>t?(e==null||e.debug(`Attribute ${s} is outside the int64 range; encoding it as a string`),{stringValue:s}):{intValue:s}}return{doubleValue:t}}if(typeof t=="string")return{stringValue:Tu(t)};if(typeof t=="function")return{stringValue:"[Function]"};if(typeof t=="symbol")return{stringValue:String(t)};if(typeof t=="object"&&t!==null){if(n.ancestors.has(t))return{stringValue:"[Circular]"};if(r>=20)return{stringValue:r2};if(t instanceof Date){const s=t.getTime(),i=Number.isFinite(s)?t.toISOString():String(t);return{stringValue:typeof i=="string"?Tu(i):String(i)}}n.ancestors.add(t);try{try{const s=t.toJSON;if(typeof s=="function")return wx(s.call(t),e,n,r+1)}catch{}return We(t)?{arrayValue:{values:Yj(t,e,n,r+1)}}:{kvlistValue:{values:C5(t,e,n,r+1)}}}finally{n.ancestors.delete(t)}}return{stringValue:Tu(String(t))}}function Yj(t,e,n,r){const s=[],i=Math.min(t.length,1e3);let o=0;for(;i>o&&n.remainingNodes>0;o++)try{const l=o in t?t[o]:void 0;if(Qe(l))continue;s.push(wx(l,e,n,r))}catch{s.push({stringValue:Zh})}return t.length>o&&s.push({stringValue:r2}),s}function C5(t,e,n,r){const s=[];for(const i in t)if(Kj.call(t,i)){if(!i){e==null||e.debug("Dropping an attribute with an empty key");continue}if(s.length>=1e3||0>=n.remainingNodes){e==null||e.debug("Attributes truncated: the value exceeds the OTLP encoder budget");break}try{const o=t[i];if(cn(o)||ce(o))continue;s.push({key:Tu(i),value:wx(o,e,n,r)})}catch{s.push({key:Tu(i),value:{stringValue:Zh}})}}return s}function P5(t,e,n){return H(H(H(H({},m5({},t.resourceAttributes)),{},{"service.name":t.serviceName||"unknown_service"},t.environment&&{"deployment.environment":t.environment}),t.serviceVersion&&{"service.version":t.serviceVersion}),{},{"telemetry.sdk.name":e,"telemetry.sdk.version":n})}const Xj=["service.name","deployment.environment","service.version","telemetry.sdk.name","telemetry.sdk.version"];function T5(t,e){const n=m5({},t),r={};for(const s of Xj)({}).hasOwnProperty.call(n,s)&&(r[s]=n[s],delete n[s]);return[...Mm(n,e),...Mm(r,e)]}const S8={darwin:"macOS",win32:"Windows",cygwin:"Windows",linux:"Linux",android:"Android",freebsd:"FreeBSD",openbsd:"OpenBSD",netbsd:"NetBSD",sunos:"SunOS",aix:"AIX",haiku:"Haiku","Mac OS X":"macOS"},A5={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}},Qj=A5.info;function Jj(t){try{return Tu(String(t))}catch{return Zh}}function e$(t,e,n,r){const s=t.level||"info",{text:i,number:o}=A5[s]||Qj,l=(function(g=Date.now()){return String(g)+"000000"})(mn(r)?r:void 0),u={};e.distinctId&&(u.posthogDistinctId=e.distinctId),e.sessionId&&(u.sessionId=e.sessionId),e.windowId&&(u["window.id"]=e.windowId),Qe(e.sessionStartTimestamp)||(u.sessionStartTimestamp=String(e.sessionStartTimestamp)),Qe(e.lastActivityTimestamp)||(u.lastActivityTimestamp=String(e.lastActivityTimestamp)),e.currentUrl&&(u["url.full"]=e.currentUrl),e.screenName&&(u["screen.name"]=e.screenName),e.appState&&(u["app.state"]=e.appState),e.activeFeatureFlags&&e.activeFeatureFlags.length>0&&(u.feature_flags=e.activeFeatureFlags);const d=H({},u),f=t.attributes;if(f){let g=[];try{g=Object.keys(f)}catch{g=[]}for(const v of g){let w;try{w=f[v]}catch{w=Zh}Object.defineProperty(d,v,{value:w,enumerable:!0,writable:!0,configurable:!0})}}const p={timeUnixNano:l,observedTimeUnixNano:l,severityNumber:o,severityText:i,body:{stringValue:Jj(t.body)},attributes:Mm(d,n)};return t.trace_id&&(p.traceId=t.trace_id),t.span_id&&(p.spanId=t.span_id),ce(t.trace_flags)||(p.flags=t.trace_flags),p}function R5(t,e,n){return P5(t,e,n)}function M5(t,e,n,r){return{resourceLogs:[{resource:{attributes:T5(e)},scopeLogs:[{scope:{name:n,version:r},logRecords:t}]}]}}var I5=class{constructor(t){this.ls=t,this.us=0}get pending(){return!!this.hs}arm(t){this.clear(),this.us=Date.now()+t,this.hs=y5(()=>{this.hs=void 0,this.ls()},t)}armNoEarlierThan(t){this.hs&&Date.now()+t<=this.us||this.arm(t)}clear(){this.hs&&(clearTimeout(this.hs),this.hs=void 0)}};function O5(){return .75+.5*Math.random()}function L5(t,e,n,r){const s=Math.min(Math.max(0,e-1),6),i=t*Math.pow(2,s);return Math.round(Math.min(i,Math.max(r,t))*n)}var t$=class{constructor(t,e,n,r,s,i=()=>Promise.resolve(),o){var l;this._instance=t,this.Mr=e,this.A=n,this.cs=r,this.ds=s,this.vs=i,this.fs=o,this.ps=new I5(()=>this.gs()),this.ys=null,this.bs=0,this._s=0,this.ws=new g5,this.ks=0,this.Ss=1,this.xs=0,this.$s=0,this.Cs=!1,this.Ts=e.maxBufferSize,this.Is=Math.max((l=e.maxQueueSize)!==null&&l!==void 0?l:e.maxBufferSize,e.maxBufferSize),this.Ms=e.flushIntervalMs,this.Es=e.maxBatchRecordsPerPost,this.Ps=e.rateCapWindowMs,this.Rs=e.maxLogsPerInterval}clearQueue(){this._s++,this._instance.setPersistedProperty(Li.LogsQueue,[])}reset(){this.ps.clear(),this.xs=0,this.$s=0,this.Cs=!1,this.ks=0,this.Ss=1,this.ws.reset(),this.Es=this.Mr.maxBatchRecordsPerPost}onReconnect(){this.ks=0,this.Ss=1,this.ws.isOpen()?this.As()&&this.Os():this.gs()}captureLog(t,e){var n;if(this._instance.isDisabled||this._instance.optedOut||!(t!=null&&t.body))return;const r=this.Fs(t);if(r===null)return;if(!r.body)return void this.A.info("Log was rejected in beforeSend function");if(!this.Ds())return;const s={record:e$(r,(n=e==null?void 0:e.context)!==null&&n!==void 0?n:this.cs(),this.A,e==null?void 0:e.occurredAtMs)};this.ds(()=>this.Ls(s))}Fs(t){const e=this.Mr.beforeSend;if(!e)return t;const n=We(e)?e:[e];let r=t;for(const s of n)try{const i=s(r);if(!i)return this.A.info("Log was rejected in beforeSend function"),null;r=i}catch(i){return this.A.error("Error in beforeSend function for log:",i),null}return r}Ds(){if(this.Rs===void 0)return!0;const t=Date.now(),e=t-this.xs;return this.Ps>e&&e>=0||(this.xs=t,this.$s=0,this.Cs=!1),this.Rs>this.$s?(this.$s++,!0):(this.Cs||(this.A.warn(`captureLog dropping logs: exceeded ${this.Rs} logs per ${this.Ps}ms`),this.Cs=!0),!1)}flush(){var t=this;return Gt(function*(){if(!t._instance.isDisabled)return t.ys||(t.ys=t.Ns().finally(()=>{t.ys=null})),t.ys})()}Ns(){var t=this;return Gt(function*(){var e;t.ps.clear();let n=(e=t._instance.getPersistedProperty(Li.LogsQueue))!==null&&e!==void 0?e:[];if(n.length===0)return;const r=n.length;let s=0;for(;n.length>0&&r>s;){var i,o;const l=t._s;t.bs=0;const u=Math.min(n.length,t.Es),d=n.slice(0,u),f=M5(d.map(g=>g.record),t.qs(),(i=t.fs)!==null&&i!==void 0?i:t._instance.getLibraryId(),t._instance.getLibraryVersion()),p=yield t._instance.js(f);if(t._s!==l)return;if(p.kind==="too-large"&&d.length>1)t.Es=Math.max(1,Math.floor(d.length/2)),t.A.warn(`Logs batch of size ${d.length} was too large for the ingestion endpoint, reducing batch size to ${t.Es}`);else if(t.ws.record(p),t.ps.pending&&t.ps.arm(Math.max(t.Ms,t.ws.remainingMs())),p.kind==="retry-later"||(p.kind==="too-large"?t.A.warn("Dropping a single log record with batch size 1 — the record is larger than the server cap and cannot be split further."):p.kind==="ok"&&t.Mr.maxBatchRecordsPerPost>t.Es&&(t.Es=Math.min(t.Mr.maxBatchRecordsPerPost,t.Es+1)),yield t.Bs(d.length),n=(o=t._instance.getPersistedProperty(Li.LogsQueue))!==null&&o!==void 0?o:[],s+=d.length,p.kind==="fatal"))throw p.error}})()}Bs(t){var e=this;return Gt(function*(){var n;const r=Math.max(0,t-e.bs),s=(n=e._instance.getPersistedProperty(Li.LogsQueue))!==null&&n!==void 0?n:[];e._instance.setPersistedProperty(Li.LogsQueue,s.slice(r)),yield e.vs()})()}qs(){return R5(this.Mr,this._instance.getLibraryId(),this._instance.getLibraryVersion())}Ls(t){var e;if(this._instance.optedOut)return;const n=(e=this._instance.getPersistedProperty(Li.LogsQueue))!==null&&e!==void 0?e:[];this.Is>n.length||(n.shift(),this.bs++,this.A.info("Logs queue is full, dropping oldest record.")),n.push(t),this._instance.setPersistedProperty(Li.LogsQueue,n),this.Ts>n.length||this.ws.isOpen()?this.Os():this.gs()}Os(){this.ps.pending||this.ps.arm(Math.max(this.Ms,this.ws.remainingMs()))}Hs(){return Math.max(L5(this.Ms,this.ks,this.Ss,3e4),this.ws.remainingMs())}As(){const t=this._instance.getPersistedProperty(Li.LogsQueue);return!!t&&t.length>0}shutdown(t){var e=this;return Gt(function*(){e.ps.clear();const n=e.flush().catch(()=>{});t!==void 0?yield h8(n,t):yield n})()}flushWithTimeout(t){var e=this;return Gt(function*(){const n=e.flush();yield h8(n,t,()=>{n.catch(()=>{})})})()}gs(){this.flush().then(()=>{this.ks=0,this.Ss=1},t=>{this.ks++,this.Ss=O5(),this.A.error("PostHog logs flush failed:",t)}).finally(()=>{!this._instance.isDisabled&&this.As()&&this.ps.armNoEarlierThan(this.Hs())})}};const oy=[0,5,10,25,50,75,100,250,500,750,1e3,2500,5e3,7500,1e4];function k8(t){return String(t)+"000000"}function E8(t,e,n,r){let s="";return r&&(s=Object.keys(r).sort().map(i=>`${JSON.stringify(i)}:${JSON.stringify(r[i])}`).join(",")),`${t}\0${e}\0${n??""}\0${s}`}var n$=class{constructor(t,e,n){this._instance=t,this.Mr=e,this.A=n,this.zs=new Map,this.ps=new I5(()=>this.flush().catch(r=>{this.A.error("Metrics flush failed:",r)})),this.ys=null,this.Us=!1,this.Ws=new Map,this.Vs=new Set,this.ws=new g5,this.ks=0,this.Ss=1,this.Gs=0}count(t,e=1,n){this.Qs({name:t,type:"count",value:e,unit:n==null?void 0:n.unit,attributes:n==null?void 0:n.attributes})}gauge(t,e,n){this.Qs({name:t,type:"gauge",value:e,unit:n==null?void 0:n.unit,attributes:n==null?void 0:n.attributes})}histogram(t,e,n){this.Qs({name:t,type:"histogram",value:e,unit:n==null?void 0:n.unit,attributes:n==null?void 0:n.attributes})}flush(){var t=this;const e=this.ys,n=(function(){var r=Gt(function*(){e&&(yield e.catch(()=>{})),yield t.Js()});return function(){return r.apply(this,arguments)}})()().finally(()=>{this.ys===n&&(this.ys=null)});return this.ys=n,n}drainWindow(){if(this.zs.size===0)return null;const t=this.zs;return this.zs=new Map,this.Us=!1,this.Ws=new Map,this.Vs=new Set,this.Zs(t)}reset(){this.Gs++,this.ws.reset(),this.ks=0,this.Ss=1,this.ps.clear(),this.zs=new Map,this.ys=null,this.Us=!1,this.Ws=new Map,this.Vs=new Set}Qs(t){if(this._instance.isDisabled||this._instance.optedOut)return;const e=this.Fs(t);if(e===null)return;if(!e.name||typeof e.name!="string")return void this.A.warn("Dropping metric with empty name");if(typeof e.value!="number"||!Number.isFinite(e.value))return void this.A.warn(`Dropping metric '${e.name}': value must be a finite number`);if(e.type==="count"&&0>e.value)return void this.A.warn(`Dropping count '${e.name}': counters are monotonic, value must be >= 0`);let n,r;try{n=e.attributes?H({},e.attributes):void 0,r=E8(e.type,e.name,e.unit,n)}catch(o){return void this.A.warn(`Dropping metric '${e.name}': attributes could not be serialized`,o)}let s=this.zs.get(r);if(!s){if(!this.Ks())return;s={name:e.name,type:e.type,unit:e.unit,attributes:n,windowStartMs:Date.now()},this.zs.set(r,s)}const i=this.Ws.get(e.name);i===void 0?this.Ws.set(e.name,e.type):i===e.type||this.Vs.has(e.name)||(this.Vs.add(e.name),this.A.warn(`Metric name '${e.name}' is already used as a ${i}; recording it as a ${e.type} too will blend both series in charts. Use a distinct name.`)),this.Xs(s,e.value),this.Os()}Ks(){return this.Mr.maxSeriesPerFlush>this.zs.size||(this.Us||(this.Us=!0,this.A.warn(`Metric series cap reached (${this.Mr.maxSeriesPerFlush} per flush window); dropping new series until the next flush. Reduce attribute cardinality.`)),!1)}Xs(t,e){switch(t.type){case"count":var n;t.total=((n=t.total)!==null&&n!==void 0?n:0)+e;break;case"gauge":t.last=e;break;case"histogram":{t.hist||(t.hist={count:0,sum:0,min:e,max:e,bucketCounts:new Array(oy.length+1).fill(0)});const r=t.hist;r.count+=1,r.sum+=e,r.min=Math.min(r.min,e),r.max=Math.max(r.max,e),r.bucketCounts[(function(s,i){for(let o=0;i.length>o;o++)if(i[o]>=s)return o;return i.length})(e,oy)]+=1;break}}}Fs(t){const e=this.Mr.beforeSend;if(!e)return t;const n=We(e)?e:[e];let r=t;for(const s of n)try{const i=s(r);if(!i)return this.A.info("Metric was rejected in beforeSend function"),null;r=i}catch(i){return this.A.error("Error in beforeSend function for metric:",i),null}return r}Os(){this.ps.pending||this.ps.arm(this.Hs())}Hs(){return Math.max(L5(this.Mr.flushIntervalMs,this.ks,this.Ss,3e4),this.ws.remainingMs())}Js(){var t=this;return Gt(function*(){if(t.ps.clear(),t.zs.size===0)return;const e=t.zs;t.zs=new Map,t.Us=!1,t.Ws=new Map,t.Vs=new Set;const n=t.Gs,r=yield t._instance.Ys(t.Zs(e));if(n===t.Gs)switch(t.ws.record(r),r.kind==="retry-later"?(t.ks++,t.Ss=O5()):(t.ks=0,t.Ss=1),t.ps.pending&&t.ps.arm(t.Hs()),r.kind){case"ok":return;case"retry-later":return t.ho(e),void t.ps.armNoEarlierThan(t.Hs());case"too-large":return void t.A.warn("Metrics batch exceeded the server size limit and was dropped");case"fatal":return void t.A.error("Failed to send metrics batch:",r.error)}})()}Zs(t){return e=this.co(t),n=(function(i,o,l){return P5(i,o,l)})(this.Mr,this._instance.getLibraryId(),this._instance.getLibraryVersion()),r=this._instance.getLibraryId(),s=this._instance.getLibraryVersion(),{resourceMetrics:[{resource:{attributes:T5(n)},scopeMetrics:[{scope:{name:r,version:s},metrics:e}]}]};var e,n,r,s}co(t){const e=k8(Date.now()),n=new Map;for(const o of t.values()){var r;const l=E8(o.type,o.name,o.unit,void 0);let u=n.get(l);u||(u=H({name:o.name},o.unit&&{unit:o.unit}),o.type==="count"?u.sum={aggregationTemporality:1,isMonotonic:!0,dataPoints:[]}:o.type==="gauge"?u.gauge={dataPoints:[]}:u.histogram={aggregationTemporality:1,dataPoints:[]},n.set(l,u));const d=Mm((r=o.attributes)!==null&&r!==void 0?r:{},this.A),f=k8(o.windowStartMs);if(o.type==="count"){var s;const p={attributes:d,startTimeUnixNano:f,timeUnixNano:e,asDouble:(s=o.total)!==null&&s!==void 0?s:0};u.sum.dataPoints.push(p)}else if(o.type==="gauge"){var i;const p={attributes:d,timeUnixNano:e,asDouble:(i=o.last)!==null&&i!==void 0?i:0};u.gauge.dataPoints.push(p)}else o.hist&&u.histogram.dataPoints.push({attributes:d,startTimeUnixNano:f,timeUnixNano:e,count:o.hist.count,sum:o.hist.sum,min:o.hist.min,max:o.hist.max,bucketCounts:o.hist.bucketCounts,explicitBounds:oy})}return Array.from(n.values())}ho(t){for(const[r,s]of t){const i=this.zs.get(r);if(i)switch(i.windowStartMs=Math.min(i.windowStartMs,s.windowStartMs),i.type){case"count":var e,n;i.total=((e=i.total)!==null&&e!==void 0?e:0)+((n=s.total)!==null&&n!==void 0?n:0);break;case"gauge":break;case"histogram":if(s.hist)if(i.hist){i.hist.count+=s.hist.count,i.hist.sum+=s.hist.sum,i.hist.min=Math.min(i.hist.min,s.hist.min),i.hist.max=Math.max(i.hist.max,s.hist.max);for(let o=0;i.hist.bucketCounts.length>o;o++)i.hist.bucketCounts[o]+=s.hist.bucketCounts[o]}else i.hist=s.hist}else this.Ks()&&this.zs.set(r,s)}}};const N5=(t,{debugEnabled:e}={})=>{const n={N(r,...s){J&&(No.DEBUG||J.POSTHOG_DEBUG||e)&&!ce(J.console)&&J.console&&("__rrweb_original__"in J.console[r]?J.console[r].__rrweb_original__:J.console[r])(t,...s)},debug(...r){n.N("debug",...r)},info(...r){n.N("log",...r)},warn(...r){n.N("warn",...r)},error(...r){n.N("error",...r)},critical(...r){console.error(t,...r)},uninitializedWarning(r){n.error(`You must initialize PostHog before calling ${r}`)},createLogger:(r,s)=>N5(`${t} ${r}`,s)};return n},ve=N5("[PostHog.js]"),dn=ve.createLogger,r$=dn("[ExternalScriptsLoader]"),Im=t=>{const e=de==null?void 0:de.querySelectorAll("script");if(e){for(let n=0;e.length>n;n++)if(e[n].src===t||e[n].getAttribute("src")===t)return e[n]}},$l=(t,e,n)=>{if(t.config.disable_external_dependency_loading)return r$.warn(`${e} was requested but loading of external scripts is disabled.`),n("Loading of external scripts is disabled");const r=Im(e);if(r){if(r.__posthog_loading_callback_fired)return n();const i=r.__posthog_loading_error;return i?n(i):(r.addEventListener("load",o=>{r.__posthog_loading_callback_fired=!0,n(void 0,o)}),void r.addEventListener("error",o=>{r.__posthog_loading_error=o,n(o)}))}const s=()=>{if(!de)return n("document not found");if(Im(e))return $l(t,e,n);let i=de.createElement("script");if(i.type="text/javascript",i.crossOrigin="anonymous",i.src=e,i.onload=l=>{i.__posthog_loading_callback_fired=!0,n(void 0,l)},i.onerror=l=>{i.__posthog_loading_error=l,n(l)},t.config.prepare_external_dependency_script&&(i=t.config.prepare_external_dependency_script(i)),!i)return n("prepare_external_dependency_script returned null");if(t.config.external_scripts_inject_target==="head")de.head.appendChild(i);else{const l=de.querySelectorAll("body > script");var o;l.length>0?(o=l[0].parentNode)===null||o===void 0||o.insertBefore(i,l[0]):de.body.appendChild(i)}};de!=null&&de.body?s():de==null||de.addEventListener("DOMContentLoaded",s)},ay={},C8=(t,e)=>{let n=`/static/${e}.js?v=${t.version}`;return e==="toolbar"&&(n=`${n}&t=${Math.floor(Date.now()/3e5)*3e5}`),t.requestRouter.endpointFor("assets",n)};$e.__PosthogExtensions__=$e.__PosthogExtensions__||{},$e.__PosthogExtensions__.loadExternalDependency=(t,e,n)=>{if(e==="remote-config"){const s=t.requestRouter.endpointFor("assets",`/array/${t.config.token}/config.js`);return void $l(t,s,n)}const r=t.config.strict_script_versioning;if(r){const s=t.requestRouter.endpointFor("assets",`/static/${t.version}/${e}.js`),i=ay[s];if(r==="fallback"&&i){if(Im(i))return void $l(t,i,n);delete ay[s]}return void $l(t,s,r==="fallback"?(o,l)=>{if(o)if(typeof o=="string")n(o);else{var u;const d=C8(t,e);ay[s]=d;const f=Im(s);f==null||(u=f.parentNode)===null||u===void 0||u.removeChild(f),$l(t,d,n)}else n(void 0,l)}:n)}$l(t,C8(t,e),n)},$e.__PosthogExtensions__.loadSiteApp=(t,e,n)=>{const r=t.requestRouter.endpointFor("api",e);$l(t,r,n)},No.DEBUG=!1,No.LIB_VERSION="1.435.9",No.LIB_NAME="web";var zn=No;const s$="$people_distinct_id",di="distinct_id",xx="$device_id",ly="$device_model",Om="__alias",i$="__cmpns",P8="$fbc",Au="$fbc_persistence",T8="$fbp",Lf="$fbp_persistence",a2="__timers",D5="$autocapture_disabled_server_side",l2="$heatmaps_enabled_server_side",c2="$exception_capture_enabled_server_side",j5="$error_tracking_suppression_rules",u2="$error_tracking_capture_extension_exceptions",d2="$web_vitals_enabled_server_side",bx="$dead_clicks_enabled_server_side",Sx="$product_tours_enabled_server_side",$5="$logs_capture_enabled_server_side",F5="$web_vitals_allowed_metrics",Nf="$session_recording_remote_config",o$="$session_recording_enabled_server_side",a$="$replay_sample_rate",l$="$replay_override_sampling",c$="$replay_override_linked_flag",u$="$replay_override_url_trigger",d$="$replay_override_event_trigger",_u="$sesid",V5="$session_is_sampled",f$="$session_past_minimum_duration",h$="$session_recording_url_trigger_activated_session",p$="$session_recording_event_trigger_activated_session",m$="$debug_first_full_snapshot_timestamp",g$="$sess_rec_flush_size",vi="$enabled_feature_flags",Io="$active_feature_flags",f2="$early_access_features",nc="$feature_flag_details",Ra="$feature_flag_payloads",rc="$feature_flag_request_id",Df="$minimal_flag_called_events",Oi="$override_feature_flags",Fl="$override_feature_flag_payloads",Ma="$stored_person_properties",Ia="$stored_group_properties",H5="$groups",kf="$surveys",Lm="$surveys_loaded_at",z5="$surveys_activated",U5="$surveys_activated_session",B5="$surveys_activated_timestamps",h2="ph_product_tours",v$="$product_tours_activated",y$="$product_tours_activated_session",_$="$conversations_widget_session_id",w$="$conversations_ticket_id",x$="$conversations_widget_state",b$="$conversations_user_traits",Oa="$flag_call_reported",Ef="$flag_call_reported_session_id",ih="$feature_flag_errors",$a="$feature_flag_evaluated_at",Lr="$user_state",p2="$client_session_props",S$="$capture_rate_limit",Z5="$initial_campaign_params",W5="$initial_referrer_info",wu="$initial_person_info",kx="$epp",cy="$posthog_cookieless",q5="$cookieless_mode",G5="$sdk_debug_extensions_init_method",K5="$sdk_debug_extensions_init_time_ms",Ex="$sdk_debug_recording_script_not_loaded",Cx="$sdk_debug_replay_stale_config",Y5="$sdk_debug_replay_event_trigger_status",X5="$sdk_debug_replay_linked_flag_trigger_status",Q5="$sdk_debug_replay_matched_recording_trigger_groups",J5="$sdk_debug_replay_pending_trigger_conditions",eT="$sdk_debug_replay_remote_trigger_matching_config",tT="$sdk_debug_replay_trigger_groups_count",nT="$sdk_debug_replay_url_trigger_status",k$="$session_recording_start_reason",Px="PostHog loadExternalDependency extension not found.",Oo="anonymous",X0="identified",rT="identified_only",oh="visibilitychange",Nm="beforeunload",Tx="$pageview",A8="$pageleave",sT="$identify",R8="$groupidentify";function xu(t,e){We(t)&&t.forEach(e)}function Mt(t,e){if(!Qe(t))if(We(t))t.forEach(e);else if((n=>n instanceof FormData)(t))t.forEach((n,r)=>e(n,r));else for(const n in t)gx.call(t,n)&&e(t[n],n)}const Wt=function(t,...e){for(const n of e)for(const r in n)n[r]!==void 0&&(t[r]=n[r]);return t};function Q0(t){const e=Object.keys(t);let n=e.length;const r=new Array(n);for(;n--;)r[n]=[e[n],t[e[n]]];return r}const E$=function(t){return function(...e){try{return t.apply(this,e)}catch(n){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(n)}}},Ax=function(t){const e={};return Mt(t,function(n,r){(lt(n)&&n.length>0||mn(n))&&(e[r]=n)}),e};function iT(t){const e=H({},t);for(const n of["name","message","stack","cause","errors"])try{n in t&&(e[n]=t[n])}catch{}return e}const C$=["herokuapp.com","vercel.app","netlify.app"];function P$(t){const e=t==null?void 0:t.hostname;if(!lt(e))return!1;const n=e.split(".").slice(-2).join(".");for(const r of C$)if(n===r)return!1;return!0}function kt(t,e,n,r){const{capture:s=!1,passive:i=!0}=r??{};t==null||t.addEventListener(e,n,{capture:s,passive:i})}function m2(t){return t.name==="ph_toolbar_internal"}const jf=t=>{if(de){try{const e=t+"=",n=de.cookie.split(";").filter(r=>r.length);for(let r=0;n.length>r;r++){let s=n[r];for(;s.charAt(0)==" ";)s=s.substring(1,s.length);if(s.indexOf(e)===0)return decodeURIComponent(s.substring(e.length,s.length))}}catch{}return null}};Math.trunc||(Math.trunc=function(t){return 0>t?Math.ceil(t):Math.floor(t)}),Number.isInteger||(Number.isInteger=function(t){return mn(t)&&isFinite(t)&&Math.floor(t)===t});var T$=class g2{constructor(e){if(this.bytes=e,e.length!==16)throw new TypeError("not 128-bit length")}static fromFieldsV7(e,n,r,s){if(!Number.isInteger(e)||!Number.isInteger(n)||!Number.isInteger(r)||!Number.isInteger(s)||0>e||0>n||0>r||0>s||e>0xffffffffffff||n>4095||r>1073741823||s>4294967295)throw new RangeError("invalid field value");const i=new Uint8Array(16);return i[0]=e/Math.pow(2,40),i[1]=e/Math.pow(2,32),i[2]=e/Math.pow(2,24),i[3]=e/Math.pow(2,16),i[4]=e/256,i[5]=e,i[6]=112|n>>>8,i[7]=n,i[8]=128|r>>>24,i[9]=r>>>16,i[10]=r>>>8,i[11]=r,i[12]=s>>>24,i[13]=s>>>16,i[14]=s>>>8,i[15]=s,new g2(i)}toString(){let e="";for(let n=0;this.bytes.length>n;n++)e=e+(this.bytes[n]>>>4).toString(16)+(15&this.bytes[n]).toString(16),n!==3&&n!==5&&n!==7&&n!==9||(e+="-");if(e.length!==36)throw new Error("Invalid UUIDv7 was generated");return e}clone(){return new g2(this.bytes.slice(0))}equals(e){return this.compareTo(e)===0}compareTo(e){for(let n=0;16>n;n++){const r=this.bytes[n]-e.bytes[n];if(r!==0)return Math.sign(r)}return 0}},A$=class{generate(){const t=this.generateOrAbort();if(!ce(t))return t;{this.Ct=0;const e=this.generateOrAbort();if(ce(e))throw new Error("Could not generate UUID after timestamp reset");return e}}generateOrAbort(){const t=(()=>{const e=Date.now();return mn(e)&&isFinite(e)?Math.min(Math.max(Math.floor(e),0),0xffffffffffff):0})();if(t>this.Ct)this.Ct=t,this.It();else{if(this.Ct>=t+1e4)return;this.Mt++,this.Mt>4398046511103&&(this.Ct++,this.It())}return T$.fromFieldsV7(this.Ct,Math.trunc(this.Mt/Math.pow(2,30)),this.Mt&Math.pow(2,30)-1,this.Tt.nextUint32())}It(){this.Mt=1024*this.Tt.nextUint32()+(1023&this.Tt.nextUint32())}constructor(){this.Ct=0,this.Mt=0,this.Tt=new R$}};let oT=t=>{if("u">typeof UUIDV7_DENY_WEAK_RNG&&UUIDV7_DENY_WEAK_RNG)throw new Error("no cryptographically strong RNG available");for(let e=0;t.length>e;e++)t[e]=65536*Math.trunc(65536*Math.random())+Math.trunc(65536*Math.random());return t};J&&!ce(J.crypto)&&crypto.getRandomValues&&(oT=t=>crypto.getRandomValues(t));var R$=class{nextUint32(){return this.Rt.length>this.At||(oT(this.Rt),this.At=0),this.Rt[this.At++]}constructor(){this.Rt=new Uint32Array(8),this.At=1/0}};let M8;const yi=()=>M$().toString(),M$=()=>(M8||(M8=new A$)).generate();let df="";const I$=/[a-z0-9][a-z0-9-]+\.[a-z]{2,}$/i;let nu=null;const an={Et(){if(!cn(nu))return nu;if(nu=!1,de)try{const t=`__ph_cookie_support_${yi()}`;an.$t(t,"xyz"),nu=jf(t)==='"xyz"',an.Pt(t)}catch{nu=!1}return nu},Dt(t){ve.error("cookieStore error: "+t)},Ot:jf,Lt(t){let e;try{e=JSON.parse(an.Ot(t))||{}}catch{}return e},$t(t,e,n,r,s){if(!de)return!1;try{let i="",o="";const l=(function(d,f){if(f){let p=(function(g,v=de){if(df)return df;if(!v||["localhost","127.0.0.1"].includes(g))return"";const w=g.split(".");let _=Math.min(w.length,8);const x="dmn_chk_"+yi();for(;!df&&_--;){const S=w.slice(_).join("."),k=x+"=1;domain=."+S+";path=/";v.cookie=k+";max-age=3",v.cookie.includes(x)&&(v.cookie=k+";max-age=0",df=S)}return df})(d);if(!p){const g=(v=>{const w=v.match(I$);return w?w[0]:""})(d);g!==p&&ve.info("Warning: cookie subdomain discovery mismatch",g,p),p=g}return p?"; domain=."+p:""}return""})(de.location.hostname,r);if(n){const d=new Date;d.setTime(d.getTime()+864e5*n),i="; expires="+d.toUTCString()}s&&(o="; secure");const u=t+"="+encodeURIComponent(JSON.stringify(e))+i+"; SameSite=Lax; path=/"+l+o;return u.length>3686.4&&ve.warn("cookieStore warning: large cookie, len="+u.length),de.cookie=u,!0}catch{return!1}},Pt(t,e){if(de!=null&&de.cookie&&(!e||!cn(jf(t))))try{an.$t(t,"",-1,e)}catch{return}}};let uy=null;const yt={Et(){if(!cn(uy))return uy;let t=!0;if(ce(J))t=!1;else try{const e="__mplssupport__";yt.$t(e,"xyz"),yt.Ot(e)!=='"xyz"'&&(t=!1),yt.Pt(e)}catch{t=!1}return t||ve.error("localStorage unsupported; falling back to cookie store"),uy=t,t},Dt(t){ve.error("localStorage error: "+t)},Ot(t){try{return J==null?void 0:J.localStorage.getItem(t)}catch(e){yt.Dt(e)}return null},Lt(t){try{return JSON.parse(yt.Ot(t))||{}}catch{}return null},$t(t,e){try{return J==null||J.localStorage.setItem(t,JSON.stringify(e)),!0}catch(n){yt.Dt(n)}return!1},Pt(t){try{J==null||J.localStorage.removeItem(t)}catch(e){yt.Dt(e)}}},dy=[Ma,Io,vi,nc,Ra,rc,$a,ih,Oa],Vl=[xx,di,_u,V5,kx,wu,Au,Lr],Dm=t=>t+"_cpm",O$=["__proto__","constructor","prototype"],fy=t=>{if(!dt(t))return{};const e={};return Object.keys(t).forEach(n=>{O$.indexOf(n)===-1&&(e[n]=t[n])}),e},hy=(t,e=[])=>{const n={};return[...Vl,...e].forEach(r=>{const s=t[r];ce(s)||cn(s)||s===""||(n[r]=s)}),n},aT=t=>{let e=5381,n=2166136261;for(let r=0;t.length>r;r++){const s=t.charCodeAt(r);e=33*e^s,n=Math.imul(n^s,16777619)}return t.length.toString(36)+"."+(e>>>0).toString(36)+"."+(n>>>0).toString(36)},I8=(t,e)=>({p:e,f:aT(JSON.stringify(t))}),O8=(t,e)=>{if(!e)return{properties:[],isValid:!1};try{const n=an.Lt(Dm(t)),r=(n==null?void 0:n.f)===aT(e)&&We(n.p);return{properties:r?n.p:[],isValid:r}}catch{return{properties:[],isValid:!1}}},py=(t,e)=>e+"|"+(an.Ot(Dm(t))||""),ru={},v2={Et:()=>!0,Dt(t){ve.error("memoryStorage error: "+t)},Ot:t=>t in ru?ru[t]:null,Lt:t=>t in ru?ru[t]:null,$t:(t,e)=>(ru[t]=e,!0),Pt(t){delete ru[t]}};let El=null;const zt={Et(){if(!cn(El))return El;if(El=!0,ce(J))El=!1;else try{const t="__support__";zt.$t(t,"xyz"),zt.Ot(t)!=='"xyz"'&&(El=!1),zt.Pt(t)}catch{El=!1}return El},Dt(t){ve.error("sessionStorage error: ",t)},Ot(t){try{return J==null?void 0:J.sessionStorage.getItem(t)}catch(e){zt.Dt(e)}return null},Lt(t){try{return JSON.parse(zt.Ot(t))||null}catch{}return null},$t(t,e){try{return J==null||J.sessionStorage.setItem(t,JSON.stringify(e)),!0}catch(n){zt.Dt(n)}return!1},Pt(t){try{J==null||J.sessionStorage.removeItem(t)}catch(e){zt.Dt(e)}}};var L$=class{constructor(t){this._instance=t}get Mr(){return this._instance.config}get consent(){return this.Do()?0:this.Lo}isOptedOut(){return this.Mr.cookieless_mode==="always"||this.isRejected()||this.consent===-1&&this.Mr.cookieless_mode==="on_reject"}isOptedIn(){return!this.isOptedOut()}isExplicitlyOptedOut(){return this.consent===0}isRejected(){return this.consent===0||this.consent===-1&&this.Mr.opt_out_capturing_by_default}optInOut(t){this.No.$t(this.qo,t?1:0,this.Mr.cookie_expiration,this.Mr.cross_subdomain_cookie,this.Mr.secure_cookie)}reset(){this.No.Pt(this.qo,this.Mr.cross_subdomain_cookie)}get qo(){const{token:t,opt_out_capturing_cookie_prefix:e,consent_persistence_name:n}=this._instance.config;return n||(e?e+t:"__ph_opt_in_out_"+t)}get Lo(){const t=this.No.Ot(this.qo);return J1(t)?1:Ze(ij,t)?0:-1}get No(){const t=this.Mr.opt_out_capturing_persistence_type,e=t==="localStorage"?yt:an,n=e.Et()?e:v2;if(!this.jo||this.jo!==n){this.jo=n;const r=t==="localStorage"?an:yt;r.Ot(this.qo)&&(this.jo.Ot(this.qo)||this.optInOut(J1(r.Ot(this.qo))),r.Pt(this.qo,this.Mr.cross_subdomain_cookie))}return this.jo}Do(){return!!this.Mr.respect_dnt&&[Xn==null?void 0:Xn.doNotTrack,Xn==null?void 0:Xn.msDoNotTrack,$e.doNotTrack,Xn==null?void 0:Xn.globalPrivacyControl].some(t=>J1(t))}};function lT(t,e){var n;const r=t==null||(n=t.config)===null||n===void 0?void 0:n.get_current_url;if(!Yn(r))return e;try{const s=r(e);return lt(s)&&s?s:e}catch(s){return ve.error("Error in get_current_url, falling back to window.location.href",s),e}}function L8(t){var e;return t instanceof Element&&(t.id==="__POSTHOG_TOOLBAR__"||!!(!((e=t.closest)===null||e===void 0)&&e.call(t,".toolbar-global-fade-container")))}function Ki(t){return!!t&&t.nodeType===1}function pr(t,e){return!!t&&!!t.tagName&&t.tagName.toLowerCase()===e.toLowerCase()}function cT(t){return!!t&&t.nodeType===3}function Rx(t){return!!t&&t.nodeType===11&&Ki(t.host)}function Mx(t){return t?Ig(t).split(/\s+/):[]}function N8(t,e){const n=(function(r){var s;const i=J==null||(s=J.location)===null||s===void 0?void 0:s.href;return ce(i)?void 0:lT(r,i)})(e);return!!(n&&t&&t.some(r=>n.match(r)))}function Qu(t){let e="";switch(typeof t.className){case"string":e=t.className;break;case"object":e=(t.className&&"baseVal"in t.className?t.className.baseVal:null)||t.getAttribute("class")||"";break;default:e=""}return Mx(e)}function uT(t){return Qe(t)?null:Ig(t).split(/(\s+)/).filter(e=>Ff(e)).join("").replace(/[\r\n]/g," ").replace(/[ ]+/g," ").substring(0,255)}function ah(t){let e="";return Ru(t)&&!lh(t)&&t.childNodes&&t.childNodes.length&&Mt(t.childNodes,function(n){var r;cT(n)&&n.textContent&&(e+=(r=uT(n.textContent))!==null&&r!==void 0?r:"")}),Ig(e)}function $f(t){var e;return ce(t.target)?t.srcElement||null:!((e=t.target)===null||e===void 0)&&e.shadowRoot?t.composedPath()[0]||null:t.target||null}const Ix=["a","button","form","input","select","textarea","label"];function y2(t,e){const n=t.matches||t.matchesSelector||t.msMatchesSelector||t.mozMatchesSelector||t.webkitMatchesSelector||t.oMatchesSelector;try{return!!n&&n.call(t,e)}catch{return!1}}function _2(t,e){if(ce(e))return!0;for(const n of t)if(e.some(r=>y2(n,r)))return!0;return!1}function dT(t){const e=t.parentNode;return!(!e||!Ki(e))&&e}const my=[".ph-no-autocapture","[data-ph-no-autocapture]"],fT=["next","previous","prev",">","<"],N$=[...fT,"+","-","−","–"],D8=(t,e)=>/[a-z0-9]/i.test(e)?t.includes(e):t===e,j8=[".ph-no-rageclick",".ph-no-capture"],D$=["","text","search","email","password","url","tel","number"];function hT(t,e){if(!J||Ox(t))return!1;let n,r,s;var i,o;if(Nr(e)?(n=!!e&&j8,r=void 0,s=!1):(n=(i=e==null?void 0:e.css_selector_ignorelist)!==null&&i!==void 0?i:j8,r=e==null?void 0:e.content_ignorelist,s=(o=e==null?void 0:e.ignore_text_selection)!==null&&o!==void 0&&o),n===!1||s&&(function(u){return!(!u||!Ki(u))&&(!!pr(u,"textarea")||(pr(u,"input")?Ze(D$,(u.getAttribute("type")||"").toLowerCase()):(function(d){var f;if(d.isContentEditable)return!0;const p=(f=d.getAttribute)===null||f===void 0?void 0:f.call(d,"contenteditable");return p==="true"||p===""})(u)))})(t))return!1;const{targetElementList:l}=pT(t,!1);return!(function(u,d){if(u===!1||ce(u))return!1;let f;if(u===!0)f=fT;else{if(!We(u))return!1;if(u.length>10)return ve.error("[PostHog] content_ignorelist array cannot exceed 10 items. Use css_selector_ignorelist for more complex matching."),!1;f=u.map(p=>p.toLowerCase())}return d.some(({safeText:p,ariaLabel:g})=>f.some(v=>D8(p,v)||D8(g,v)))})(r,l.map(u=>{var d;return{safeText:ah(u).toLowerCase(),ariaLabel:((d=u.getAttribute("aria-label"))===null||d===void 0?void 0:d.toLowerCase().trim())||""}}))&&!_2(l,n)}const Ox=t=>!t||pr(t,"html")||!Ki(t),pT=(t,e)=>{if(!J||Ox(t))return{parentIsUsefulElement:!1,targetElementList:[]};let n=!1;const r=[t];let s=t;for(;s.parentNode&&!pr(s,"body");){if(Rx(s.parentNode)){r.push(s.parentNode.host),s=s.parentNode.host;continue}const i=dT(s);if(!i)break;if(e||Ix.indexOf(i.tagName.toLowerCase())>-1)n=!0;else try{const o=J.getComputedStyle(i);o&&o.getPropertyValue("cursor")==="pointer"&&(n=!0)}catch{}r.push(i),s=i}return{parentIsUsefulElement:n,targetElementList:r}};function Ru(t){const e=new Set;let n=0;for(let i=t;i.parentNode&&!pr(i,"body");i=i.parentNode){if(n++>=1e3||e.has(i))return!1;e.add(i);const o=Qu(i);if(Ze(o,"ph-sensitive")||Ze(o,"ph-no-capture"))return!1}if(Ze(Qu(t),"ph-include"))return!0;const r=t.type||"";if(lt(r))switch(r.toLowerCase()){case"hidden":case"password":return!1}const s=t.name||t.id||"";return!lt(s)||!/^cc|cardnum|ccnum|creditcard|csc|cvc|cvv|exp|pass|pwd|routing|seccode|securitycode|securitynum|socialsec|socsec|ssn/i.test(s.replace(/[^a-zA-Z0-9]/g,""))}function lh(t){return!!(pr(t,"input")&&!["button","checkbox","submit","reset"].includes(t.type)||pr(t,"select")||pr(t,"textarea")||t.getAttribute("contenteditable")==="true")}const $8=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}))$"),F8=/(^|[^0-9A-Za-z_])([0-9][0-9 -]*[0-9])(?=$|[^0-9A-Za-z_])/g,j$=[16,15,14,13],$$=new RegExp("^(\\d{3}-?\\d{2}-?\\d{4})$"),V8=new RegExp("(^|[^0-9])((?!000|666)[0-9]{3}-?(?!00)[0-9]{2}-?(?!0000)[0-9]{4})(?=$|([^0-9]))","g"),H8=/[0-9A-Za-z_]/;function F$(t){let e=0,n=!1;for(let r=t.length-1;r>=0;r--){let s=t.charCodeAt(r)-48;n&&(s*=2,s>9&&(s-=9)),e+=s,n=!n}return e%10==0}function Ff(t,e=!0){return!(Qe(t)||lt(t)&&(t=Ig(t),(e?$8.test((t||"").replace(/[- ]/g,"")):(function(n){let r;for(F8.lastIndex=0;r=F8.exec(n);){const s=r[2];if(!s)continue;const i=s.replace(/[- ]/g,"");for(let o=0;i.length>o;o++)for(const l of j$){const u=o+l;if(i.length>=u){const d=i.slice(o,u);if($8.test(d)&&F$(d))return!0}}}return!1})(t))||(e?$$.test(t):(function(n){let r;for(V8.lastIndex=0;r=V8.exec(n);){const s=r[1],i=r[3];if(!(s&&i&&H8.test(s)&&H8.test(i)))return!0}return!1})(t))))}function z8(t){let e=ah(t);return e=`${e} ${mT(t)}`.trim(),Ff(e)?e:""}function mT(t){let e="";return t&&t.childNodes&&t.childNodes.length&&Mt(t.childNodes,function(n){var r;if(n&&((r=n.tagName)===null||r===void 0?void 0:r.toLowerCase())==="span")try{const s=ah(n);e=`${e} ${s}`.trim(),n.childNodes&&n.childNodes.length&&(e=`${e} ${mT(n)}`.trim())}catch(s){ve.error("[AutoCapture]",s)}}),e}function U8(t){return t.replace(/"|\\"/g,'\\"')}function V$(t){const e=t.attr__class;if(e)return We(e)?e:Mx(e)}const m0=dn("[Dead Clicks]"),H$=()=>!0,z$=t=>{var e;const n=!!(!((e=t.instance.persistence)===null||e===void 0)&&e.get_property(bx)),r=t.instance.config.capture_dead_clicks;return Nr(r)?r:!!dt(r)||n};var B8=class{get lazyLoadedDeadClicksAutocapture(){return this.Bo}constructor(t,e,n){this.instance=t,this.isEnabled=e,this.onCapture=n,this.startIfEnabledOrStop()}onRemoteConfig(t){if(!t.ok)return;const e=t.config;"captureDeadClicks"in e&&(this.instance.persistence&&this.instance.persistence.register({[bx]:e.captureDeadClicks}),this.startIfEnabledOrStop())}startIfEnabledOrStop(){this.isEnabled(this)?this.Ho(()=>{this.zo()}):this.stop()}Ho(t){var e,n,r;!((e=$e.__PosthogExtensions__)===null||e===void 0)&&e.initDeadClicksAutocapture?t():(n=$e.__PosthogExtensions__)===null||n===void 0||(r=n.loadExternalDependency)===null||r===void 0||r.call(n,this.instance,"dead-clicks-autocapture",s=>{s?m0.error("failed to load script",s):t()})}zo(){var t;if(de){if(!this.Bo&&(!((t=$e.__PosthogExtensions__)===null||t===void 0)&&t.initDeadClicksAutocapture)){const e=dt(this.instance.config.capture_dead_clicks)?H({},this.instance.config.capture_dead_clicks):{};e.__onCapture=this.onCapture,this.onCapture&&(e.capture_dead_swipes=!1),this.Bo=$e.__PosthogExtensions__.initDeadClicksAutocapture(this.instance,e),this.Bo.start(de),m0.info("starting...")}}else m0.error("`document` not found. Cannot start.")}stop(){this.Bo&&(this.Bo.stop(),this.Bo=void 0,m0.info("stopping..."))}};const ff=dn("[SegmentIntegration]");function Z8(t,e,n=!0){const r=t.config.segment;if(!r)return e();const{analytics:s,filterProperties:i}=(l=>Yn(l.register))(o=r)?{analytics:o}:o;var o;(function(l,u,d,f){const p=v=>{const w=()=>v.anonymousId()||yi();l.config.get_device_id=w,f&&v.id()&&(l.register({distinct_id:v.id(),$device_id:w()}),l.persistence.set_property(Lr,X0)),d(f?void 0:v.anonymousId()||void 0)},g=u.user();"then"in g&&Yn(g.then)?g.then(p):p(g)})(t,s,l=>{s.register(((u,d,{filterProperties:f}={})=>{typeof Promise<"u"&&Promise.resolve||ff.warn("This browser does not have Promise support, and can not use the segment integration");const p=(g,v)=>{if(!v)return g;const w=!!d&&g.event.anonymousId===d&&!g.event.userId;w||g.event.userId||g.event.anonymousId===u.get_distinct_id()||(ff.info("No userId set, resetting PostHog"),u.reset()),w||(d=void 0),g.event.userId&&g.event.userId!==u.get_distinct_id()&&(ff.info("UserId set, identifying with PostHog"),u.identify(g.event.userId));let _=u.calculateEventProperties(v,g.event.properties);if(!Qe(f)){const x=g.event.properties||{},S={};for(const C of Object.keys(_))gx.call(x,C)||(S[C]=_[C]);const k=((C,T)=>{const A=We(C)?C:[C];let I=H({},T);for(const M of A)try{if(I=M(I),Qe(I))return null}catch(R){return ff.error("Error in Segment filterProperties:",R),null}return I})(f,S);if(Qe(k))return g;_=k}return g.event.properties=Object.assign({},_,g.event.properties),g};return{name:"PostHog JS",type:"enrichment",version:"1.0.0",isLoaded(){return!0},load(){return Promise.resolve()},track(g){return p(g,g.event.event)},page(g){return p(g,Tx)},identify(g){return p(g,sT)},screen(g){return p(g,"$screen")}}})(t,l,{filterProperties:i})).then(()=>{e()},u=>{ff.error("Failed to register the Segment integration",u),e()})},n)}const gT="posthog-js";function vT(t,{organization:e,projectId:n,prefix:r,severityAllowList:s=["error"],sendExceptionsToPostHog:i=!0}={}){return o=>{var l,u,d,f,p;if(s!=="*"&&!s.includes(o.level)||!t.__loaded)return o;o.tags||(o.tags={});const g=t.requestRouter.endpointFor("ui",`/project/${t.config.token}/person/${t.get_distinct_id()}`);o.tags["PostHog Person URL"]=g,t.sessionRecordingStarted()&&(o.tags["PostHog Recording URL"]=t.get_session_replay_url({withTimestamp:!0}));const v=((l=o.exception)===null||l===void 0?void 0:l.values)||[],w=v.map(S=>H(H({},S),{},{stacktrace:S.stacktrace?H(H({},S.stacktrace),{},{type:"raw",frames:(S.stacktrace.frames||[]).map(k=>H(H({},k),{},{platform:"web:javascript"}))}):void 0})),_={$exception_message:((u=v[0])===null||u===void 0?void 0:u.value)||o.message,$exception_type:(d=v[0])===null||d===void 0?void 0:d.type,$exception_level:o.level,$exception_list:w,$sentry_event_id:o.event_id,$sentry_exception:o.exception,$sentry_exception_message:((f=v[0])===null||f===void 0?void 0:f.value)||o.message,$sentry_exception_type:(p=v[0])===null||p===void 0?void 0:p.type,$sentry_tags:o.tags};var x;return e&&n&&(_.$sentry_url=(r||"https://sentry.io/organizations/")+e+"/issues/?project="+n+"&query="+o.event_id),i&&((x=t.exceptions)===null||x===void 0||x.sendExceptionEvent(_)),o}}var U$=class{constructor(t,e,n,r,s,i){this.name=gT,this.setupOnce=function(o){o(vT(t,{organization:e,projectId:n,prefix:r,severityAllowList:s,sendExceptionsToPostHog:i==null||i}))}}},W8=class{constructor(t){this.Uo=(e,n,r)=>{r&&(r.noSessionId||r.activityTimeout||r.sessionPastMaximumLength||r.crossTabAdoption)&&(ve.info("[PageViewManager] Session rotated, clearing pageview state",{sessionId:e,changeReason:r}),this.Wo=void 0,this._instance.scrollManager.resetContext())},this._instance=t,this.Vo()}Vo(){var t;this.Go=(t=this._instance.sessionManager)===null||t===void 0?void 0:t.onSessionId(this.Uo)}destroy(){var t;(t=this.Go)===null||t===void 0||t.call(this),this.Go=void 0}doPageView(t,e){var n;const r=this.Qo(t,e);return this.Wo={pathname:(n=J==null?void 0:J.location.pathname)!==null&&n!==void 0?n:"",pageViewId:e,timestamp:t},this._instance.scrollManager.resetContext(),r}doPageLeave(t){var e;return this.Qo(t,(e=this.Wo)===null||e===void 0?void 0:e.pageViewId)}doEvent(){var t;return{$pageview_id:(t=this.Wo)===null||t===void 0?void 0:t.pageViewId}}Qo(t,e){const n=this.Wo;if(!n)return{$pageview_id:e};let r={$pageview_id:e,$prev_pageview_id:n.pageViewId};const s=this._instance.scrollManager.getContext();if(s&&!this._instance.config.disable_scroll_properties){let{maxScrollHeight:i,lastScrollY:o,maxScrollY:l,maxContentHeight:u,lastContentY:d,maxContentY:f}=s;if(!(ce(i)||ce(o)||ce(l)||ce(u)||ce(d)||ce(f))){i=Math.ceil(i),o=Math.ceil(o),l=Math.ceil(l),u=Math.ceil(u),d=Math.ceil(d),f=Math.ceil(f);const p=i>1?Ui(o/i,0,1,ve):1,g=i>1?Ui(l/i,0,1,ve):1,v=u>1?Ui(d/u,0,1,ve):1,w=u>1?Ui(f/u,0,1,ve):1;r=Wt(r,{$prev_pageview_last_scroll:o,$prev_pageview_last_scroll_percentage:p,$prev_pageview_max_scroll:l,$prev_pageview_max_scroll_percentage:g,$prev_pageview_last_content:d,$prev_pageview_last_content_percentage:v,$prev_pageview_max_content:f,$prev_pageview_max_content_percentage:w})}}return n.pathname&&(r.$prev_pageview_pathname=n.pathname),n.timestamp&&(r.$prev_pageview_duration=(t.getTime()-n.timestamp.getTime())/1e3),r}};const hf=["flags","surveys"],B$={[s$]:{exposure:"hidden"},[Om]:{exposure:"hidden"},[i$]:{exposure:"hidden"},[a2]:{exposure:"hidden"},[Au]:{exposure:"hidden"},[Lf]:{exposure:"hidden"},[D5]:{exposure:"event"},[l2]:{exposure:"hidden"},[$5]:{exposure:"hidden"},[c2]:{exposure:"event"},[j5]:{exposure:"hidden"},[u2]:{exposure:"event"},[d2]:{exposure:"event"},[bx]:{exposure:"event"},[Sx]:{exposure:"hidden"},[F5]:{exposure:"event"},[Nf]:{exposure:"hidden"},[o$]:{exposure:"hidden"},[_u]:{exposure:"hidden"},[V5]:{exposure:"event"},[a$]:{exposure:"event",shouldSkipFromEventProperties:t=>cn(t)},[f$]:{exposure:"event"},[h$]:{exposure:"event"},[p$]:{exposure:"event"},[m$]:{exposure:"event"},[g$]:{exposure:"hidden"},[vi]:{exposure:"hidden",storageGroup:"flags"},[Io]:{exposure:"hidden",storageGroup:"flags"},[f2]:{exposure:"hidden"},[nc]:{exposure:"hidden",storageGroup:"flags"},[Ra]:{exposure:"hidden",storageGroup:"flags"},[rc]:{exposure:"hidden",storageGroup:"flags",volatile:!0},[Df]:{exposure:"hidden",storageGroup:"flags"},[Oi]:{exposure:"hidden"},[Fl]:{exposure:"hidden"},[Ma]:{exposure:"hidden"},[Ia]:{exposure:"hidden"},[kf]:{exposure:"hidden",storageGroup:"surveys"},[Lm]:{exposure:"hidden",storageGroup:"surveys",volatile:!0},[z5]:{exposure:"event"},[U5]:{exposure:"hidden"},[B5]:{exposure:"hidden"},[h2]:{exposure:"hidden"},[v$]:{exposure:"hidden"},[y$]:{exposure:"hidden"},[_$]:{exposure:"event"},[w$]:{exposure:"event"},[x$]:{exposure:"event"},[b$]:{exposure:"event"},[Oa]:{exposure:"hidden"},[Ef]:{exposure:"hidden"},[H5]:{exposure:"event"},[ih]:{exposure:"hidden"},[$a]:{exposure:"hidden",storageGroup:"flags",volatile:!0},[Lr]:{exposure:"hidden"},[p2]:{exposure:"hidden"},[S$]:{exposure:"hidden"},[Z5]:{exposure:"hidden"},[W5]:{exposure:"hidden"},[wu]:{exposure:"hidden"},[kx]:{exposure:"hidden"},[l$]:{exposure:"event"},[c$]:{exposure:"event"},[u$]:{exposure:"event"},[d$]:{exposure:"event"},[G5]:{exposure:"event"},[K5]:{exposure:"event"},[Ex]:{exposure:"hidden"},[Cx]:{exposure:"hidden"},[Y5]:{exposure:"hidden"},[X5]:{exposure:"hidden"},[Q5]:{exposure:"hidden"},[J5]:{exposure:"hidden"},[eT]:{exposure:"hidden"},[tT]:{exposure:"hidden"},[nT]:{exposure:"hidden"},[k$]:{exposure:"event"}},Z$=[["$posthog_sr_group_event_trigger_",{exposure:"hidden"}],["$posthog_sr_group_url_trigger_",{exposure:"hidden"}],["$posthog_sr_group_sampling_",{exposure:"hidden"}]],rr=t=>{const e=B$[t];if(e)return e;for(const[n,r]of Z$)if(t.indexOf(n)===0)return r},bu=(t,e)=>{try{let n;return JSON.stringify(t,(r,s)=>{var i;return md(s)?((i=n)!==null&&i!==void 0||(n=new WeakMap),n.has(s)||n.set(s,iT(s)),n.get(s)):typeof s=="bigint"?s.toString():s},e)}catch{return jP(t)}},Ho=t=>{const e=de==null?void 0:de.createElement("a");return ce(e)?null:(e.href=t,e)},Ju=function(t,e){const n=((t.split("#")[0]||"").split(/\?(.*)/)[1]||"").replace(/^\?+/g,"").split("&");let r;for(let s=0;n.length>s;s++){const i=n[s].split("=");if(i[0]===e){r=i;break}}if(!We(r)||2>r.length)return"";{let s=r[1];try{s=decodeURIComponent(s)}catch{ve.error("Skipping decoding for malformed query param: "+s)}return s.replace(/\+/g," ")}},ch=function(t,e,n){if(!t||!e||!e.length)return t;const r=t.split("#"),s=r[1],i=(r[0]||"").split("?"),o=i[1],l=i[0],u=(o||"").split("&"),d=[];for(let p=0;u.length>p;p++){const g=u[p].split("=");We(g)&&(e.includes(g[0])?d.push(g[0]+"="+n):d.push(u[p]))}let f=l;return o!=null&&(f+="?"+d.join("&")),s!=null&&(f+="#"+s),f},jm=function(t,e){const n=t.match(new RegExp(e+"=([^&]*)"));return n?n[1]:null},yT=(t,e)=>t>=e&&DP(),_T=(t,e,n,r)=>{if(t===0){if(DP()){const s=e+1;return s===n&&r(),s}return e}return 0},ed=["gclid","gclsrc","dclid","gbraid","wbraid","fbclid","msclkid","twclid","li_fat_id","igshid","ttclid","rdt_cid","epik","qclid","sccid","oppref","irclid","_kx"],W$=["utm_source","utm_medium","utm_campaign","utm_content","utm_term","gad_source","mc_cid",...ed],uh="<masked>",q$=["li_fat_id"];function wT(t,e,n){if(!de)return{};const r=e?[...ed,...n||[]]:[],s=xT(ch(de.URL,r,uh),t),i=(function(){const o={};return Mt(q$,function(l){const u=jf(l);o[l]=u||null}),o})();return Wt(i,s)}function xT(t,e){const n=W$.concat(e||[]),r={};return Mt(n,function(s){const i=Ju(t,s);r[s]=i||null}),r}function bT(t){const e=(function(s){return s?s.search("https?://(.*)google.([^/?]*)")===0?"google":s.search("https?://(.*)bing.com")===0?"bing":s.search("https?://(.*)yahoo.com")===0?"yahoo":s.search("https?://(.*)duckduckgo.com")===0?"duckduckgo":null:null})(t),n=e!="yahoo"?"q":"p",r={};if(!cn(e)){r.$search_engine=e;const s=de?Ju(de.referrer,n):"";s.length&&(r.ph_keyword=s)}return r}function ST(){return navigator.language||navigator.userLanguage}function G$(){const t=ST();return typeof t=="string"?t.split("-")[0]:void 0}const $m="$direct";function kT(){return(de==null?void 0:de.referrer)||$m}function ET(t,e,n=!1){const r=t?[...ed,...e||[]]:[],s=n?Ua(ln==null?void 0:ln.href):ln==null?void 0:ln.href,i=s==null?void 0:s.substring(0,1e3);return{r:kT().substring(0,1e3),u:i?ch(i,r,uh):void 0}}function CT(t,e=!1){var n;const{r,u:s}=t,i=e?Ua(s):s,o={$referrer:r,$referring_domain:r==null?void 0:r==$m?$m:(n=Ho(r))===null||n===void 0?void 0:n.host};if(i){o.$current_url=i;const l=Ho(i);o.$host=l==null?void 0:l.host,o.$pathname=l==null?void 0:l.pathname;const u=xT(i);Wt(o,u)}if(r){const l=bT(r);Wt(o,l)}return o}function PT(){try{return Intl.DateTimeFormat().resolvedOptions().timeZone}catch{return}}function K$(){try{return new Date().getTimezoneOffset()}catch{return}}const Y$={flags:$a,surveys:Lm},X$=["cookie","localstorage","localstorage+cookie","sessionstorage","memory"],g0=t=>`${t}_cookie_identity_change_pending`,v0=t=>{let e="",n=0;for(const r of t){const s=encodeURIComponent(JSON.stringify(r).slice(1,-1)).length;if(n+s>1e3)break;e+=r,n+=s}return e},$n="main",ko=[vi,Io,nc,Ra,rc,$a,Df,Ma],gy=t=>ko.indexOf(t)!==-1,TT=[Au,Lf],q8=t=>TT.indexOf(t)!==-1,ga=(t,e)=>{try{return JSON.stringify(t)===JSON.stringify(e)}catch{return t===e}},su=t=>{if(!t)return{};const e=JSON.parse(t);return dt(e)?e:{}},G8=(t,e)=>{Mt(t,(n,r)=>{const s=rr(r);s&&s.exposure!=="event"||{}.hasOwnProperty.call(e,r)||delete t[r]})};var vy=class{constructor(t,e,n=!0,r=!t.cookieless_mode){if(this.Jo={},this.Zo=!1,this.Ko=!1,this.Xo=!1,this.Yo=!1,this.ta=!1,this.ea=new Map,this.ia=!1,this.na=!1,this.sa=!1,this.ra=new Set,this.oa=new Set,this.Mr=t,this.aa=n,this.props={},this.la=void 0,this.ua=(s=>{let i="";return s.token&&(i=s.token.replace(/\+/g,"PL").replace(/\//g,"SL").replace(/=/g,"EQ")),s.persistence_name?"ph_"+s.persistence_name:"ph_"+i+"_posthog"})(t),this.hi=t.disable_persistence||!!e,this.No=this.ha(t),this.Xo=this.ca(t),this.load(r),this.da(),t.debug&&ve.info("Persistence loaded",t.persistence,H({},this.props)),this.update_config(t,t,e),this.save(),J){const s=()=>this.flush();kt(J,"beforeunload",s,{capture:!1}),kt(J,"pagehide",s,{capture:!1}),this.va=i=>{if(this.Zo&&(!i.storageArea||i.storageArea===(J==null?void 0:J.localStorage))&&i.key)if(i.key!==this.ua){if(this.Xo){const o=hf.find(l=>i.key===this.fa(l));o&&this.pa(i.key,o)}}else this.pa(i.key,$n)},kt(J,"storage",this.va)}}markCrossTabFeatureFlagChanges(t){Object.entries(t).forEach(([e,n])=>{const r=this.ea.get(e);if(!gy(e)||r===!0)return;if(n===!0)return void this.ga(e,!0);const s=new Set(r||[]);n.forEach(i=>s.add(i)),s.size&&this.ga(e,s)})}onCrossTabFeatureFlagChange(t){return this.oa.add(t),()=>this.oa.delete(t)}destroy(){this.va&&J&&(J.removeEventListener("storage",this.va),this.va=void 0),this.oa.clear()}pa(t,e,n=!0){if(this.hi)return!1;let r,s;try{if(s=yt.Ot(t),cn(s)){const l=this.ma(e);return l.storageValue=null,e!==$n&&(l.persisted=!1),!1}r=su(s)}catch{return!1}const i=e===$n?r:yt.Lt(this.ua);if(i&&this.ya(i))return!1;const o=this.ba(r,e,n);return e===$n&&this.Xo&&!ga(this._a().main,r)||this.wa(r,e,!0,s),o}ya(t){const e=this.props[di],n=t[di];return!ce(e)&&!ce(n)&&e!==n}wa(t,e,n,r){const s=this.ma(e);s.storageValue=r,e!==$n&&(s.persisted=n);try{s.fingerprint=this.ka(t,e)}catch{s.fingerprint=void 0}}ba(t,e,n){let r=!1;return ko.forEach(s=>{var i;const o=(i=rr(s))===null||i===void 0?void 0:i.storageGroup;if(e===$n&&this.Xo&&o||e!==$n&&o!==e)return;const l=s in t,u=this.Sa(s,l?t[s]:void 0),d=this.ea.has(s)?s in this.props:l;d===s in this.props&&ga(u,this.props[s])||(d?this.xa(s,u,!1):this.$a(s,!1),r=!0)}),r&&n&&this.oa.forEach(s=>s()),r}Ca(){if(!this.Zo)return!1;try{this.sa=!1;const t=yt.Ot(this.ua),e=this.ma($n);let n,r=!1,s=!1;if(t!==e.storageValue)if(cn(t))e.storageValue=null;else{if(n=su(t),this.sa=!this.na&&this.ya(n),this.sa)return!1;s=this.ba(n,$n,!1),!this.Xo||ga(this._a().main,n)?this.wa(n,$n,!0,t):e.storageValue=t,r=!0}return this.Xo&&hf.forEach(i=>{const o=yt.Ot(this.fa(i)),l=this.ma(i),u=n||{},d=r&&ko.some(p=>{var g;return((g=rr(p))===null||g===void 0?void 0:g.storageGroup)===i&&p in u});if(o===l.storageValue&&!d)return;if(cn(o))return l.storageValue=null,l.persisted=!1,void(d&&(s=this.ba(u,i,!1)||s));const f=su(o);s=this.ba(f,i,!1)||s,this.wa(f,i,!0,o)}),s}catch{return!1}}ga(t,e){this.ea.set(t,e);const n=rr(t);n!=null&&n.volatile||(this.ma((this.Xo?n==null?void 0:n.storageGroup:void 0)||$n).fingerprint=void 0,this.Ta(t))}Ia(){ko.forEach(t=>this.ea.set(t,!0))}da(){if(this.Zo)try{const t=yt.Ot(this.ua),e=su(t);this.ma($n).storageValue=t,ko.forEach(n=>{var r;const s=this.Xo?(r=rr(n))===null||r===void 0?void 0:r.storageGroup:void 0,i=s?yt.Ot(this.fa(s)):null;if(s){const l=this.ma(s);l.storageValue=i,l.persisted=!cn(i)}const o=s&&!cn(i)?su(i):e;n in this.props?this.Ma(n,o[n],this.props[n]):n in o&&this.ga(n,!0)})}catch{}}Sa(t,e){const n=this.ea.get(t);if(!n)return e;if(n===!0)return this.props[t];if(t==="$active_feature_flags"){const i=new Set(We(e)?e:[]),o=new Set(We(this.props[t])?this.props[t]:[]);return n.forEach(l=>o.has(l)?i.add(l):i.delete(l)),Array.from(i)}const r=dt(e)?H({},e):{},s=dt(this.props[t])?this.props[t]:{};return n.forEach(i=>{i in s?r[i]=s[i]:delete r[i]}),r}Ma(t,e,n){if(!gy(t))return;const r=this.ea.get(t);if(r===!0)return;let s=e;if(this.Zo)try{var i;const l=this.Xo?(i=rr(t))===null||i===void 0?void 0:i.storageGroup:void 0,u=l?this.fa(l):this.ua;s=su(yt.Ot(u))[t]}catch{}const o=new Set(r||[]);if(t==="$active_feature_flags"){if(!ce(e)&&!We(e)||!ce(s)&&!We(s)||!We(n))return void this.ga(t,!0);const l=new Set(e||[]),u=new Set(s||[]),d=new Set(n);new Set([...l,...d]).forEach(f=>{l.has(f)!==d.has(f)&&o.add(f)}),o.forEach(f=>{u.has(f)===d.has(f)&&o.delete(f)})}else{if(!dt(n))return void(ga(s,n)?this.ea.delete(t):this.ga(t,!0));{if(!ce(e)&&!dt(e)||ce(e)&&Kr(n)&&ce(s))return void this.ga(t,!0);const l=dt(e)?e:{},u=dt(s)?s:{};new Set([...Object.keys(l),...Object.keys(n)]).forEach(d=>{d in l==d in n&&ga(l[d],n[d])||o.add(d)}),o.forEach(d=>{d in u==d in n&&ga(u[d],n[d])&&o.delete(d)})}}o.size?this.ga(t,o):this.ea.delete(t)}Ea(){var t;const e=(t=this.Mr)===null||t===void 0?void 0:t.persistence_save_debounce_ms;return mn(e)&&e>0?e:0}Pa(t){if(this.Mr.cookieWinsOnConflict&&this.Mr.persistence.toLowerCase()==="localstorage+cookie")if(t)try{const e=hy(t,this.Mr.cookie_persisted_properties||[]),n=I8(e,this.Mr.cookie_persisted_properties||[]),r=JSON.stringify(e)+"|"+JSON.stringify(n),s=an.Ot(this.ua)||void 0;s&&py(this.ua,s)===r&&(this.Ra=r,this.Aa=s)}catch{}else try{const e=an.Ot(this.ua)||void 0;this.Ra=e?py(this.ua,e):void 0,this.Aa=e}catch{}}syncCookieProperties(){return this.Oa(this.Mr)}Oa(t,e=!1){if(this.hi&&!e||this.ta||!t.cookieWinsOnConflict||t.persistence.toLowerCase()!=="localstorage+cookie")return!1;let n;try{n=an.Ot(this.ua)||void 0}catch{}if(!n||n===this.Aa)return!1;const r=py(this.ua,n);let s;try{s=fy(JSON.parse(n))}catch{return!1}if((an.Ot(this.ua)||void 0)!==n)return!1;this.Ra=r,this.Aa=n;const i=O8(this.ua,n),o=[...Vl,...i.properties],l={};if(Object.keys(s).forEach(_=>{const x=s[_];(ce(x)||cn(x)||x===""||_==="$user_state"&&x!=="anonymous"&&x!=="identified")&&(l[_]=!0,delete s[_])}),Kr(s))return!1;const u="distinct_id"in s||s.$user_state==="anonymous"||s.$user_state==="identified",d=this.props,f=d[di],p=d[Lr],g=Wt({},d);[...Vl,...t.cookie_persisted_properties||[]].forEach(_=>{if(o.indexOf(_)!==-1&&!(_ in s)&&!l[_]&&(u||_!=="distinct_id"&&_!=="$user_state")){const x=g[_];(i.isValid||Vl.indexOf(_)===-1||x!==!1&&x!==0)&&delete g[_]}}),this.props=Wt(g,s),ko.forEach(_=>{const x=_ in this.props;_ in d===x&&ga(d[_],this.props[_])||(x?this.Ma(_,d[_],this.props[_]):this.ga(_,!0))}),!u||"$user_state"in s||"$user_state"in this.props||this.xa(Lr,Oo);const v=this.props[di],w=this.props[Lr];return!u||v===f&&w===p||(this.na=!0,this.Yo=!0,zt.$t(g0(this.ua),!0),this.$a(Ma),this.$a(Io),this.$a(vi),this.$a(nc),this.$a(Ra),this.$a(rc),this.$a($a),this.$a(ih),this.$a(Oa),w!=="anonymous"||p!=="identified"&&s.$user_state!=="anonymous"&&(ce(f)||v===f)||(G8(this.props,s),this.$a(Ia)),w==="identified"?this.props.$user_id=v:delete this.props.$user_id,this.$a(Om)),!0}consumeCookieIdentityChange(){const t=g0(this.ua),e=this.Yo||!!zt.Ot(t);return this.Yo=!1,e&&zt.Pt(t),e}Fa(t=!1){return!(this.ta||this.hi&&!t||!this.Mr.cookieWinsOnConflict||this.Mr.persistence.toLowerCase()!=="localstorage+cookie"||(this.ta=!0,0))}Da(){this.ta&&(ce(this.La)||(clearTimeout(this.La),this.La=void 0),delete this.Jo[$n],this.Na(!0))}qa(t=!0){if(this.ta)try{t?this.Da():ce(this.La)||(clearTimeout(this.La),this.La=void 0)}finally{this.ta=!1}}isDisabled(){return!!this.hi}ha(t){X$.indexOf(t.persistence.toLowerCase())===-1&&(ve.critical("Unknown persistence type "+t.persistence+"; falling back to localStorage+cookie"),t.persistence="localStorage+cookie");const e=((o=[],l=!1,u=()=>!1)=>{const d=[...Vl,...o];return H(H({},yt),{},{Lt(f){try{let g,v={};try{g=an.Ot(f)||void 0,v=g?fy(JSON.parse(g)):{}}catch{}const w=JSON.parse(yt.Ot(f)||"{}");let _;if(l){const x=O8(f,g),S=[...Vl,...x.properties],k={};Object.keys(v).forEach(T=>{const A=v[T];cn(A)||A===""||T==="$user_state"&&A!=="anonymous"&&A!=="identified"||(k[T]=A)});const C="distinct_id"in k||k.$user_state==="anonymous"||k.$user_state==="identified";if(Object.keys(k).length>0){var p;const T=w[di],A=(p=w.$user_state)!==null&&p!==void 0?p:Oo;d.forEach(I=>{if(S.indexOf(I)!==-1&&!(I in v)&&(C||I!=="distinct_id"&&I!=="$user_state")){const M=w[I];(x.isValid||Vl.indexOf(I)===-1||M!==!1&&M!==0)&&delete w[I]}}),!C||"$user_state"in v||"$user_state"in w||(w[Lr]=Oo),!C||("distinct_id"in k?k[di]:w[di])===T&&("$user_state"in k?k[Lr]:w[Lr])===A||(dy.forEach(I=>delete w[I]),k.$user_state==="identified"&&"distinct_id"in k?w.$user_id=k[di]:delete w.$user_id,k.$user_state!=="identified"&&(delete w[H5],delete w[Ia]),delete w.__alias)}_=Wt(w,k)}else _=Wt(v,w);return u()||yt.$t(f,_),_}catch{}return null},$t(f,p,g,v,w,_){const x=yt.$t(f,p,void 0,void 0,_);try{const S=hy(p,o);if(Object.keys(S).length){if(l){const k=Dm(f),C=I8(S,o);if(an.$t(k,C,g,v,w,_),an.Ot(k)!==JSON.stringify(C)){an.Pt(k,v);const T=hy(p);return an.$t(f,T,g,v,w,_),x}}an.$t(f,S,g,v,w,_)}}catch(S){yt.Dt(S)}return x},Pt(f,p){try{J==null||J.localStorage.removeItem(f),an.Pt(f,p),an.Pt(Dm(f),p)}catch(g){yt.Dt(g)}}})})(t.cookie_persisted_properties||[],t.cookieWinsOnConflict,()=>!!this.hi);let n,r=!1,s=!1;const i=t.persistence.toLowerCase();return i==="localstorage"&&yt.Et()?(n=yt,s=!0):i==="localstorage+cookie"&&e.Et()?(n=e,s=!0,r=!0):i==="sessionstorage"&&zt.Et()?n=zt:i==="memory"?n=v2:i==="cookie"&&an.Et()?(n=an,r=!0):e.Et()?(n=e,s=!0,r=!0):an.Et()?(n=an,r=!0):n=v2,this.Zo=s,this.Ko=r,n}fa(t){return`${this.ua}__${t}`}ca(t){return this.Zo&&!!t.split_storage}properties(){const t={};return Mt(this.props,(e,n)=>{const r=rr(n);if(!r||r.exposure==="event"){var s;if(!(r==null||(s=r.shouldSkipFromEventProperties)===null||s===void 0)&&s.call(r,e))return;t[n]=e}}),t}load(t=!1){if(this.hi&&!t)return;const e=this.Mr.cookieWinsOnConflict&&this.Mr.persistence.toLowerCase()==="localstorage+cookie",n=e?yt.Lt(this.ua):null;let r={};if(e)try{r=fy(an.Lt(this.ua)),Mt(r,(l,u)=>{(ce(l)||cn(l)||l==="")&&delete r[u]})}catch{}const s=this.No.Lt(this.ua);if(s&&(this.props=Wt({},s)),this.Xo&&this.ja(),e&&s){var i,o;const l=n==null?void 0:n[di],u=(i=n==null?void 0:n.$user_state)!==null&&i!==void 0?i:Oo,d=s[di],f=(o=s.$user_state)!==null&&o!==void 0?o:Oo;if(d!==l||f!==u){this.Yo=!0,this.hi||zt.$t(g0(this.ua),!0);const p=Wt({},this.props);dy.forEach(v=>delete p[v]),f!=="anonymous"||u!=="identified"&&r.$user_state!=="anonymous"&&(ce(l)||d===l)||(G8(p,r),delete p[Ia]),this.props=p;const g=new Set;dy.forEach(v=>{var w;const _=(w=rr(v))===null||w===void 0?void 0:w.storageGroup;_&&g.add(_)}),g.forEach(v=>{if(this.hi)return;const w={};Mt(this.props,(_,x)=>{var S;((S=rr(x))===null||S===void 0?void 0:S.storageGroup)===v&&(w[x]=_)}),Kr(w)?(yt.Pt(this.fa(v)),this.Jo[v]={}):yt.$t(this.fa(v),w)&&(this.Jo[v]={persisted:!0,fingerprint:this.ka(w,v)})})}}zt.Ot(g0(this.ua))&&(this.Yo=!0)}ja(){for(const t of hf){const e=yt.Lt(this.fa(t));if(e&&!Kr(e)){const n=this.ma(t);n.persisted=!0,this.Ba(t)||(n.fingerprint=this.ka(e,t)),this.Ha(t,e)||Wt(this.props,e)}}}Ba(t){return Object.keys(this.props).some(e=>{var n;return((n=rr(e))===null||n===void 0?void 0:n.storageGroup)===t})}Ha(t,e){const n=Y$[t];if(!n)return!1;const r=e[n],s=this.props[n];return mn(r)&&mn(s)&&s>r}refreshKey(t){var e;if(this.hi||this.ra.has(t))return;const n=this.Xo?(e=rr(t))===null||e===void 0?void 0:e.storageGroup:void 0,r=n?yt.Lt(this.fa(n)):this.No.Lt(this.ua);if(r&&t in r)this.xa(t,r[t],!1);else{if(n){const s=this.No.Lt(this.ua);if(s&&t in s)return void this.xa(t,s[t],!1)}this.$a(t,!1)}}save(){if(this.hi)return;const t=this.Ea();t>0?ce(this.La)&&(this.La=setTimeout(()=>{this.La=void 0,this.Na()},t)):this.Na()}flush(){ce(this.La)||(clearTimeout(this.La),this.La=void 0,this.Na())}Na(t=!1){if(this.hi||this.ta&&!t)return;t||(this.syncCookieProperties(),this.Mr.cookieWinsOnConflict&&this.Mr.persistence.toLowerCase()==="localstorage+cookie"||TT.forEach(s=>this.refreshKey(s)));const e=!t&&!this.ia;e||(this.sa=!1);const n=!!e&&this.Ca();if(this.sa)return void(this.Mr.debug&&ve.warn("skipping persistence write because storage belongs to a different distinct ID"));if(this.Xo)return this.za(),void(n&&this.oa.forEach(s=>s()));const r=this.Ua(this.No,this.ua,this.props,$n);r==="written"&&this.Pa(this.props),r!=="failed"&&(this.ea.clear(),this.na=!1,this.ra.clear()),n&&this.oa.forEach(s=>s())}za(){const{main:t,groups:e}=this._a(),n=this.Ua(this.No,this.ua,t,$n);n==="written"&&this.Pa(t),n!=="failed"&&(this.na=!1,this.ra.clear(),ko.forEach(s=>{var i;!((i=rr(s))===null||i===void 0)&&i.storageGroup||this.ea.delete(s)}));for(const s of hf){var r;const i=e[s];if(Kr(i)&&!(!((r=this.Jo[s])===null||r===void 0)&&r.persisted)){ko.forEach(l=>{var u;((u=rr(l))===null||u===void 0?void 0:u.storageGroup)===s&&this.ea.delete(l)});continue}const o=this.Ua(yt,this.fa(s),i,s);o!=="failed"&&ko.forEach(l=>{const u=rr(l);(u==null?void 0:u.storageGroup)!==s||o!=="written"&&u.volatile||this.ea.delete(l)})}}_a(){const t={},e={flags:{},surveys:{}};return Mt(this.props,(n,r)=>{var s;const i=(s=rr(r))===null||s===void 0?void 0:s.storageGroup;i?e[i][r]=n:t[r]=n}),{main:t,groups:e}}ka(t,e){if(e===$n)return JSON.stringify(t)+"|"+this.Wa+"|"+this.Va+"|"+this.Ga;const n={};return Mt(t,(r,s)=>{var i;n[s]=!((i=rr(s))===null||i===void 0)&&i.volatile?"__volatile__":r}),JSON.stringify(n)}Ua(t,e,n,r){const s=this.ma(r);if(r!==$n&&!s.dirty&&!ce(s.fingerprint))return"skipped";let i;try{if(i=this.ka(n,r),i===s.fingerprint)return s.dirty=!1,"skipped"}catch{i=void 0}return t.$t(e,n,this.Wa,this.Va,this.Ga,this.Mr.debug)?(s.dirty=!1,r!==$n&&(s.persisted=!0),ce(i)||(s.fingerprint=i),this.Zo&&(s.storageValue=yt.Ot(e)),"written"):(this.Mr.debug&&ve.warn(`failed to persist storage entry "${e}"; will retry on next save`),"failed")}remove({keepGroupEntries:t=!1}={}){if(this.Ia(),ce(this.La)||(clearTimeout(this.La),this.La=void 0),this.No.Pt(this.ua,!1),this.No.Pt(this.ua,!0),!t&&this.aa)for(const e of hf)yt.Pt(this.fa(e));t?delete this.Jo[$n]:this.Jo={},this.Ra=void 0,this.Aa=void 0}clear(){this.remove(),this.props={}}register_once(t,e,n){if(dt(t)){this.syncCookieProperties(),ce(e)&&(e="None"),this.Wa=ce(n)?this.Qa:n;let r=!1;if(Mt(t,(s,i)=>{this.props.hasOwnProperty(i)&&this.props[i]!==e||(this.xa(i,s),r=!0)}),r)return this.save(),!0}return!1}register(t,e){if(dt(t)){this.syncCookieProperties(),this.Wa=ce(e)?this.Qa:e;let n=!1;if(Mt(t,(r,s)=>{t.hasOwnProperty(s)&&(this.props[s]!==r||dt(r)||We(r))&&(this.xa(s,r),n=!0)}),n)return this.save(),!0}return!1}unregister(t){this.syncCookieProperties();const e=typeof t=="string"?[t]:t;let n=!1;for(const r of e)r in this.props&&(this.$a(r),n=!0);n&&this.save()}update_campaign_params(){const t=de==null?void 0:de.URL;if(t===this.la)return;const e=wT(this.Mr.custom_campaign_params,this.Mr.mask_personal_data_properties,this.Mr.custom_personal_data_properties),n=!Kr(Ax(e));return n&&this.register(e),this.la=t,n?e:void 0}update_search_keyword(){this.register((function(){const t=de==null?void 0:de.referrer;return t?bT(t):{}})())}update_referrer_info(){var t;this.register_once({$referrer:kT(),$referring_domain:(de==null?void 0:de.referrer)&&((t=Ho(de.referrer))===null||t===void 0?void 0:t.host)||$m},void 0)}set_initial_person_info(){if(this.props.$initial_campaign_params||this.props.$initial_referrer_info)return;const t=ET(this.Mr.mask_personal_data_properties,this.Mr.custom_personal_data_properties,this.Mr.disable_capture_url_hashes);this.register_once({[wu]:this.Ko?{r:v0(t.r),u:t.u?v0(t.u):void 0}:t},void 0)}get_initial_props(){const t={};Mt([W5,Z5],n=>{const r=this.props[n];r&&Mt(r,function(s,i){t["$initial_"+J_(i)]=s})});const e=this.props[wu];if(e){const n=(function(r,s=!1){const i=CT(r,s),o={};return Mt(i,function(l,u){o[`$initial_${J_(u)}`]=l}),o})(e,this.Mr.disable_capture_url_hashes);Wt(t,n)}return t}safe_merge(t){return Mt(this.props,function(e,n){n in t||(t[n]=e)}),t}update_config(t,e,n){const r=t.persistence!==e.persistence,s=!((v,w)=>{if(v.length!==w.length)return!1;const _=[...v].sort(),x=[...w].sort();return _.every((S,k)=>S===x[k])})(t.cookie_persisted_properties||[],e.cookie_persisted_properties||[]),i=r||s,o=t.cookieWinsOnConflict!==e.cookieWinsOnConflict,l=t.disable_persistence||!!n,u=!!this.hi&&!l;l||this.Oa(e,u),this.Mr=t,!l&&(r||s||o)&&(this.Ra=void 0,this.Aa=void 0,this.Oa(H(H({},t),{},{cookie_persisted_properties:e.cookie_persisted_properties}),u));const d=i||o?this.ha(t):this.No;this.Ja();const f=this.ca(t),p=i||f!==this.Xo,g=!l&&(p||t.cross_subdomain_cookie!==this.Va||t.secure_cookie!==this.Ga)&&this.Fa(u);this.ia=p;try{if(this.Qa=this.Wa=t.cookie_expiration,this.set_disabled(l),this.set_cross_subdomain(t.cross_subdomain_cookie),this.set_secure(t.secure_cookie),p){const v=this.props;this.clear(),this.No=d,this.Xo=f,this.props=v,this.save()}else o&&(this.No=d,l||(delete this.Jo[$n],this.Na()))}finally{this.ia=!1,g&&this.qa()}}Ja(){const t=this.props[wu];if(!this.Ko||!dt(t)||typeof t.r!="string")return;const e=v0(t.r),n=typeof t.u=="string"?v0(t.u):t.u;e===t.r&&n===t.u||this.xa(wu,H(H({},t),{},{r:e,u:n}))}set_disabled(t){this.hi=t,this.hi?this.remove():this.save()}set_cross_subdomain(t){t!==this.Va&&(this.Va=t,this.remove({keepGroupEntries:!0}),this.save())}set_secure(t){t!==this.Ga&&(this.Ga=t,this.remove({keepGroupEntries:!0}),this.save())}set_event_timer(t,e){const n=this.props.__timers||{};n[t]=e,this.xa(a2,n),this.save()}remove_event_timer(t){const e=this.props.__timers||{},n=e[t];return ce(n)||(delete e[t],this.xa(a2,e),this.save()),n}get_property(t){return this.props[t]}set_property(t,e){this.xa(t,e),this.save()}xa(t,e,n=!0){var r;const s=this.props[t];this.props[t]=e,n&&(t!=="distinct_id"&&t!=="$user_state"||s===e||(this.na=!0),q8(t)&&!ga(s,e)&&this.ra.add(t),this.Ma(t,s,e),!((r=rr(t))===null||r===void 0)&&r.volatile||this.Ta(t))}$a(t,e=!0){delete this.props[t],e&&(gy(t)&&this.ga(t,!0),q8(t)&&this.ra.add(t),this.Ta(t))}Ta(t){var e;const n=(e=rr(t))===null||e===void 0?void 0:e.storageGroup;n&&(this.ma(n).dirty=!0)}ma(t){return this.Jo[t]||(this.Jo[t]={})}};const _s={GZipJS:"gzip-js",Base64:"base64"},pf={Activation:"events",Cancellation:"cancelEvents"},yy={Popover:"popover",API:"api",Widget:"widget"},ys={SHOWN:"survey shown",DISMISSED:"survey dismissed",SENT:"survey sent"},_y={SURVEY_ID:"$survey_id",SURVEY_ITERATION:"$survey_iteration",SURVEY_LAST_SEEN_DATE:"$survey_last_seen_date"},w2={Popover:"popover",Inline:"inline"};function y0(t){let e=!0;return{dispose(){if(e){e=!1;const n=t();n&&Yn(n.then)&&n.then(void 0,()=>{})}}}}const Q$={SHOWN:"product tour shown"},K8={TOUR_LAST_SEEN_DATE:"$product_tour_last_seen_date",TOUR_TYPE:"$product_tour_type"},Y8=dn("[RateLimiter]");var J$=class{constructor(t){this.serverLimits={},this.lastEventRateLimited=!1,this.checkForLimiting=e=>{const n=e.text;if(n&&n.length)try{(JSON.parse(n).quota_limited||[]).forEach(r=>{Y8.info(`${r||"events"} is quota limited.`),this.serverLimits[r]=new Date().getTime()+6e4})}catch(r){return void Y8.warn(`could not rate limit - continuing. Error: "${r==null?void 0:r.message}"`,{text:n})}},this.instance=t,this.lastEventRateLimited=this.clientRateLimitContext(!0).isRateLimited}get captureEventsPerSecond(){var t;return((t=this.instance.config.rate_limiting)===null||t===void 0?void 0:t.events_per_second)||10}get captureEventsBurstLimit(){var t;return Math.max(((t=this.instance.config.rate_limiting)===null||t===void 0?void 0:t.events_burst_limit)||10*this.captureEventsPerSecond,this.captureEventsPerSecond)}clientRateLimitContext(t=!1){var e,n,r;const{captureEventsBurstLimit:s,captureEventsPerSecond:i}=this,o=new Date().getTime(),l=(e=(n=this.instance.persistence)===null||n===void 0?void 0:n.get_property("$capture_rate_limit"))!==null&&e!==void 0?e:{tokens:s,last:o};l.tokens+=(o-l.last)/1e3*i,l.last=o,l.tokens>s&&(l.tokens=s);const u=1>l.tokens;if(u||t||(l.tokens=Math.max(0,l.tokens-1)),u&&!t){const d=(mn(l.dropped)?l.dropped:0)+1;l.dropped=d,!this.lastEventRateLimited&&this.Za(d)&&(l.dropped=0)}return this.lastEventRateLimited=u,(r=this.instance.persistence)===null||r===void 0||r.set_property("$capture_rate_limit",l),{isRateLimited:u,remainingTokens:l.tokens}}Ka(t){const e=this.instance.config.property_denylist;return!We(e)||!e.includes(t)}Xa(){var t;if(this.Ka("$current_url")&&this.Ka("$pathname")&&(ln!=null&&ln.pathname))return`${(t=ln.origin)!==null&&t!==void 0?t:""}${ln.pathname}`}Za(t){var e,n;const{captureEventsBurstLimit:r,captureEventsPerSecond:s}=this,i=this.Xa(),o=this.Ka("$session_id")?(e=(n=this.instance).get_session_id)===null||e===void 0?void 0:e.call(n):void 0,l=[`${t} event(s) dropped since the last warning`,i?`triggered on ${i}`:void 0,o?`session ${o}`:void 0].filter(Boolean).join(", ");return!!this.instance.capture("$$client_ingestion_warning",{$$client_ingestion_warning_message:`posthog-js client rate limited: ${l}. Config is set to ${s} events per second and ${r} events burst limit.`},{skip_client_rate_limiting:!0})}isServerRateLimited(t){const e=this.serverLimits[t||"events"]||!1;return e!==!1&&new Date().getTime()<e}};const va=dn("[RemoteConfig]");var AT=class{constructor(t){this._instance=t}get remoteConfig(){var t;return(t=$e._POSTHOG_REMOTE_CONFIG)===null||t===void 0||(t=t[this._instance.config.token])===null||t===void 0?void 0:t.config}Ya(t){var e,n,r;!((e=$e.__PosthogExtensions__)===null||e===void 0)&&e.loadExternalDependency?(n=$e.__PosthogExtensions__)===null||n===void 0||(r=n.loadExternalDependency)===null||r===void 0||r.call(n,this._instance,"remote-config",()=>t(this.remoteConfig)):t()}tl(t){this._instance._send_request({method:"GET",url:this._instance.requestRouter.endpointFor("assets",`/array/${this._instance.config.token}/config`),callback:t})}load(){try{if(this.remoteConfig)return va.info("Using preloaded remote config",this.remoteConfig),void this.el(this.remoteConfig);if(this._instance.il())return void va.warn("Remote config is disabled. Falling back to local config.");this.Ya(t=>{if(!t)return va.info("No config found after loading remote JS config. Falling back to JSON."),void this.tl(e=>{this.el(e.json,e)});this.el(t)})}catch(t){va.error("Error loading remote config",t),this.el()}}el(t,e){!t&&e&&(e.statusCode===0?e.error||va.warn("Failed to fetch remote config from PostHog."):va.error("Failed to fetch remote config from PostHog."));try{this._instance.el(t?{ok:!0,config:t}:{ok:!1})}catch(r){va.error("Error applying remote config",r)}if((t==null?void 0:t.hasFeatureFlags)!==!1&&!this._instance.config.advanced_disable_feature_flags_on_first_load)try{var n;(n=this._instance.featureFlags)===null||n===void 0||n.ensureFlagsLoaded()}catch(r){va.error("Error loading feature flags",r)}}},Ks=Uint8Array,Xr=Uint16Array,td=Uint32Array,Lx=new Ks([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]),Nx=new Ks([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]),X8=new Ks([16,17,18,0,8,7,9,6,10,5,11,4,12,3,13,2,14,1,15]),RT=function(t,e){for(var n=new Xr(31),r=0;31>r;++r)n[r]=e+=1<<t[r-1];var s=new td(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]},MT=RT(Lx,2),x2=MT[1];MT[0][28]=258,x2[258]=28;for(var Q8=RT(Nx,0)[1],IT=new Xr(32768),un=0;32768>un;++un){var iu=(43690&un)>>>1|(21845&un)<<1;IT[un]=((65280&(iu=(61680&(iu=(52428&iu)>>>2|(13107&iu)<<2))>>>4|(3855&iu)<<4))>>>8|(255&iu)<<8)>>>1}var Vf=function(t,e,n){for(var r=t.length,s=0,i=new Xr(e);r>s;++s)++i[t[s]-1];var o,l=new Xr(e);for(s=0;e>s;++s)l[s]=l[s-1]+i[s-1]<<1;for(o=new Xr(r),s=0;r>s;++s)o[s]=IT[l[t[s]-1]++]>>>15-t[s];return o},dc=new Ks(288);for(un=0;144>un;++un)dc[un]=8;for(un=144;256>un;++un)dc[un]=9;for(un=256;280>un;++un)dc[un]=7;for(un=280;288>un;++un)dc[un]=8;var Fm=new Ks(32);for(un=0;32>un;++un)Fm[un]=5;var eF=Vf(dc,9),tF=Vf(Fm,5),OT=function(t){return(t/8|0)+(7&t&&1)},LT=function(t,e,n){(n==null||n>t.length)&&(n=t.length);var r=new(t instanceof Xr?Xr:t instanceof td?td:Ks)(n-e);return r.set(t.subarray(e,n)),r},vo=function(t,e,n){var r=e/8|0;t[r]|=n<<=7&e,t[r+1]|=n>>>8},mf=function(t,e,n){var r=e/8|0;t[r]|=n<<=7&e,t[r+1]|=n>>>8,t[r+2]|=n>>>16},wy=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 Ks(0),0];if(s==1){var o=new Ks(n[0].s+1);return o[n[0].s]=1,[o,1]}n.sort(function(A,I){return A.f-I.f}),n.push({s:-1,f:25001});var l=n[0],u=n[1],d=0,f=1,p=2;for(n[0]={s:-1,f:l.f+u.f,l,r:u};f!=s-1;)l=n[n[p].f>n[d].f?d++:p++],u=n[d!=f&&n[p].f>n[d].f?d++:p++],n[f++]={s:-1,f:l.f+u.f,l,r:u};var g=i[0].s;for(r=1;s>r;++r)i[r].s>g&&(g=i[r].s);var v=new Xr(g+1),w=b2(n[f-1],v,0);if(w>e){r=0;var _=0,x=w-e,S=1<<x;for(i.sort(function(A,I){return v[I.s]-v[A.s]||A.f-I.f});s>r;++r){var k=i[r].s;if(e>=v[k])break;_+=S-(1<<w-v[k]),v[k]=e}for(_>>>=x;_>0;){var C=i[r].s;e>v[C]?_-=1<<e-v[C]++-1:++r}for(;r>=0&&_;--r){var T=i[r].s;v[T]==e&&(--v[T],++_)}w=e}return[new Ks(v),w]},b2=function(t,e,n){return t.s==-1?Math.max(b2(t.l,e,n+1),b2(t.r,e,n+1)):e[t.s]=n},J8=function(t){for(var e=t.length;e&&!t[--e];);for(var n=new Xr(++e),r=0,s=t[0],i=1,o=function(u){n[r++]=u},l=1;e>=l;++l)if(t[l]==s&&l!=e)++i;else{if(!s&&i>2){for(;i>138;i-=138)o(32754);i>2&&(o(i>10?i-11<<5|28690:i-3<<5|12305),i=0)}else if(i>3){for(o(s),--i;i>6;i-=6)o(8304);i>2&&(o(i-3<<5|8208),i=0)}for(;i--;)o(s);i=1,s=t[l]}return[n.subarray(0,r),e]},gf=function(t,e){for(var n=0,r=0;e.length>r;++r)n+=t[r]*e[r];return n},S2=function(t,e,n){var r=n.length,s=OT(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)},ek=function(t,e,n,r,s,i,o,l,u,d,f){vo(e,f++,n),++s[256];for(var p=wy(s,15),g=p[0],v=p[1],w=wy(i,15),_=w[0],x=w[1],S=J8(g),k=S[0],C=S[1],T=J8(_),A=T[0],I=T[1],M=new Xr(19),R=0;k.length>R;++R)M[31&k[R]]++;for(R=0;A.length>R;++R)M[31&A[R]]++;for(var O=wy(M,7),N=O[0],D=O[1],$=19;$>4&&!N[X8[$-1]];--$);var Y,B,G,V,K=d+5<<3,U=gf(s,dc)+gf(i,Fm)+o,ee=gf(s,g)+gf(i,_)+o+14+3*$+gf(M,N)+(2*M[16]+3*M[17]+7*M[18]);if(U>=K&&ee>=K)return S2(e,f,t.subarray(u,u+d));if(vo(e,f,1+(U>ee)),f+=2,U>ee){Y=Vf(g,v),B=g,G=Vf(_,x),V=_;var Z=Vf(N,D);for(vo(e,f,C-257),vo(e,f+5,I-1),vo(e,f+10,$-4),f+=14,R=0;$>R;++R)vo(e,f+3*R,N[X8[R]]);f+=3*$;for(var j=[k,A],Q=0;2>Q;++Q){var oe=j[Q];for(R=0;oe.length>R;++R)vo(e,f,Z[re=31&oe[R]]),f+=N[re],re>15&&(vo(e,f,oe[R]>>>5&127),f+=oe[R]>>>12)}}else Y=eF,B=dc,G=tF,V=Fm;for(R=0;l>R;++R)if(r[R]>255){var re;mf(e,f,Y[257+(re=r[R]>>>18&31)]),f+=B[re+257],re>7&&(vo(e,f,r[R]>>>23&31),f+=Lx[re]);var ie=31&r[R];mf(e,f,G[ie]),f+=V[ie],ie>3&&(mf(e,f,r[R]>>>5&8191),f+=Nx[ie])}else mf(e,f,Y[r[R]]),f+=B[r[R]];return mf(e,f,Y[256]),f+B[256]},nF=new td([65540,131080,131088,131104,262176,1048704,1048832,2114560,2117632]),rF=(function(){for(var t=new td(256),e=0;256>e;++e){for(var n=e,r=9;--r;)n=(1&n&&3988292384)^n>>>1;t[e]=n}return t})(),xy=function(t,e,n){for(;n;++e)t[e]=n,n>>>=8};function sF(t,e){e===void 0&&(e={});var n=(function(){var p=4294967295;return{p(g){for(var v=p,w=0;g.length>w;++w)v=rF[255&v^g[w]]^v>>>8;p=v},d(){return 4294967295^p}}})(),r=t.length;n.p(t);var s,i,o,l,u,d=(l=10+((s=e).filename&&s.filename.length+1||0),u=8,(function(p,g,v,w,_,x){var S=p.length,k=new Ks(w+S+5*(1+Math.floor(S/7e3))+_),C=k.subarray(w,k.length-_),T=0;if(!g||8>S)for(var A=0;S>=A;A+=65535){var I=A+65535;S>I?T=S2(C,T,p.subarray(A,I)):(C[A]=x,T=S2(C,T,p.subarray(A,S)))}else{for(var M=nF[g-1],R=M>>>13,O=8191&M,N=(1<<v)-1,D=new Xr(32768),$=new Xr(N+1),Y=Math.ceil(v/3),B=2*Y,G=function(Lt){return(p[Lt]^p[Lt+1]<<Y^p[Lt+2]<<B)&N},V=new td(25e3),K=new Xr(288),U=new Xr(32),ee=0,Z=0,j=(A=0,0),Q=0,oe=0;S>A;++A){var re=G(A),ie=32767&A,fe=$[re];if(D[ie]=fe,$[re]=ie,A>=Q){var _e=S-A;if((ee>7e3||j>24576)&&_e>423){T=ek(p,C,0,V,K,U,Z,j,oe,A-oe,T),j=ee=Z=0,oe=A;for(var ue=0;286>ue;++ue)K[ue]=0;for(ue=0;30>ue;++ue)U[ue]=0}var ae=2,Oe=0,Be=O,Ee=ie-fe&32767;if(_e>2&&re==G(A-Ee))for(var pt=Math.min(R,_e)-1,Ot=Math.min(32767,A),Qt=Math.min(258,_e);Ot>=Ee&&--Be&&ie!=fe;){if(p[A+ae]==p[A+ae-Ee]){for(var bt=0;Qt>bt&&p[A+bt]==p[A+bt-Ee];++bt);if(bt>ae){if(ae=bt,Oe=Ee,bt>pt)break;var _t=Math.min(Ee,bt-2),qe=0;for(ue=0;_t>ue;++ue){var Ke=A-Ee+ue+32768&32767,Ct=Ke-D[Ke]+32768&32767;Ct>qe&&(qe=Ct,fe=Ke)}}}Ee+=(ie=fe)-(fe=D[ie])+32768&32767}if(Oe){V[j++]=268435456|x2[ae]<<18|Q8[Oe];var Ae=31&x2[ae],Ye=31&Q8[Oe];Z+=Lx[Ae]+Nx[Ye],++K[257+Ae],++U[Ye],Q=A+ae,++ee}else V[j++]=p[A],++K[p[A]]}}T=ek(p,C,x,V,K,U,Z,j,oe,A-oe,T)}return LT(k,0,w+OT(T)+_)})(i=t,(o=e).level==null?6:o.level,o.mem==null?Math.ceil(1.5*Math.max(8,Math.min(13,Math.log(i.length)))):12+o.mem,l,u,!0)),f=d.length;return(function(p,g){var v=g.filename;if(p[0]=31,p[1]=139,p[2]=8,p[8]=2>g.level?4:g.level==9?2:0,p[9]=3,g.mtime!=0&&xy(p,4,Math.floor(new Date(g.mtime||Date.now())/1e3)),v){p[3]=8;for(var w=0;v.length>=w;++w)p[w+10]=v.charCodeAt(w)}})(d,e),xy(d,f-8,n.d()),xy(d,f-4,r),d}const iF=!!mx||!!rh,NT=new WeakMap,DT="text/plain";let by=0,J0=!1;const jT=(t,e)=>{const[n,r]=t.split("#"),[s,i]=n.split("?");if(!i)return t;const o=i.split("&").filter(l=>l.split("=")[0]!==e).join("&");return`${s}${o?`?${o}`:""}${r?`#${r}`:""}`},Wh=(t,e,n=!0)=>{var r;const[s,i]=t.split("?"),o=H({},e),l=(r=i==null?void 0:i.split("&").map(d=>{var f;const[p,g]=d.split("="),v=n&&(f=o[p])!==null&&f!==void 0?f:g;return delete o[p],`${p}=${v}`}))!==null&&r!==void 0?r:[],u=(function(d,f="&"){let p,g;const v=[];return Mt(d,function(w,_){ce(w)||ce(_)||_==="undefined"||(p=encodeURIComponent((x=>x instanceof File)(w)?w.name:w.toString()),g=encodeURIComponent(_),v[v.length]=g+"="+p)}),v.join(f)})(o);return u&&l.push(u),l.length>0?`${s}?${l.join("&")}`:s},Sy=t=>{if(t.nl)return t.nl;const{data:e,compression:n}=t;if(!e)return;if(n===_s.GZipJS){const s=sF((function(i){var o=i.length;if(typeof TextEncoder<"u")return new TextEncoder().encode(i);for(var l=new Ks(i.length+(i.length>>>1)),u=0,d=function(v){l[u++]=v},f=0;o>f;++f){if(u+5>l.length){var p=new Ks(u+8+(o-f<<1));p.set(l),l=p}var g=i.charCodeAt(f);128>g?d(g):2048>g?(d(192|g>>>6),d(128|63&g)):g>55295&&57344>g?(d(240|(g=65536+(1047552&g)|1023&i.charCodeAt(++f))>>>18),d(128|g>>>12&63),d(128|g>>>6&63),d(128|63&g)):(d(224|g>>>12),d(128|g>>>6&63),d(128|63&g))}return LT(l,0,u)})(bu(e)),{mtime:0});return{contentType:DT,body:s.buffer.slice(s.byteOffset,s.byteOffset+s.byteLength),estimatedSize:s.byteLength}}if(n===_s.Base64){const s=(function(o){return o&&btoa(encodeURIComponent(o).replace(/%([0-9A-F]{2})/g,(l,u)=>String.fromCharCode(parseInt(u,16))))})(bu(e)),i=(o=>"data="+encodeURIComponent(typeof o=="string"?o:bu(o)))(s);return{contentType:"application/x-www-form-urlencoded",body:i,estimatedSize:new Blob([i]).size}}const r=bu(e);return{contentType:"application/json",body:r,estimatedSize:new Blob([r]).size}},$T=t=>{const e=()=>t.transport==="sendBeacon"?{url:Wh(t.url,{compression:_s.Base64}),encodedBody:Sy(H(H({},t),{},{compression:_s.Base64,nl:void 0}))}:{url:jT(t.url,"compression"),encodedBody:Sy(H(H({},t),{},{compression:void 0,nl:void 0}))};let n;try{n=Sy(t)}catch(s){if(w8(t.compression,Ju(t.url,"compression")))return ve.error("Failed to gzip request body, sending uncompressed payload",s),e();throw s}return n&&w8(t.compression,Ju(t.url,"compression"))&&!((r=n.body)instanceof ArrayBuffer?i2(new Uint8Array(r)):ArrayBuffer.isView(r)&&i2(new Uint8Array(r.buffer,r.byteOffset,r.byteLength)))?(J0=!0,e()):{url:t.url,encodedBody:n};var r},FT=t=>{try{return $T(t)}catch(n){var e;return ve.error(n),void((e=t.callback)===null||e===void 0||e.call(t,{statusCode:0,error:n}))}},oF=(function(){var t=Gt(function*(e){const n=yield(function(s){return o2.apply(this,arguments)})(bu(e.data),zn.DEBUG,{rethrow:!0});if(!n)return e;const r=yield n.arrayBuffer();return H(H({},e),{},{nl:{contentType:DT,body:r,estimatedSize:r.byteLength}})});return function(e){return t.apply(this,arguments)}})(),aF=/Failed to fetch|NetworkError|Load failed/i,VT=t=>(t==null?void 0:t.name)==="TypeError"&&aF.test((t==null?void 0:t.message)||""),HT=t=>{try{const e=(function(n,r=Date.now()){if(typeof n!="string"||!n)return;const s=n.trim(),i=/^\d+\s*,/.test(s)?s.slice(0,s.indexOf(",")).trim():s;if(/^\d+$/.test(i)){const u=1e3*Math.min(Number(i),300);return u>0?u:void 0}if(!/^(Mon|Tue|Wed|Thu|Fri|Sat|Sun)[a-z]*[ ,]/.test(i))return;const o=/^\w{3} \w{3} /.test(i)?i+" GMT":i,l=Date.parse(o)-r;return Number.isFinite(l)&&l>0?Math.min(l,Y0):void 0})(t());return ce(e)?void 0:Math.min(e,3e4)}catch{return}},zT=t=>{const e=FT(t);if(!e)return;const n=new mx;NT.set(n,!0);const{url:r,encodedBody:s}=e;n.open(t.method||"GET",r,!0);const{contentType:i,body:o}=s??{};Mt(t.headers,function(l,u){n.setRequestHeader(u,l)}),i&&n.setRequestHeader("Content-Type",i),t.timeout&&(n.timeout=t.timeout),n.onreadystatechange=()=>{if(n.readyState===4){var l;const u={statusCode:n.status,text:n.responseText};if(n.status===200)try{u.json=JSON.parse(n.responseText)}catch{}(l=t.callback)===null||l===void 0||l.call(t,u,HT(()=>n.getResponseHeader("Retry-After")))}},n.send(o)},UT=t=>{const e=FT(t);if(!e)return;const{url:n,encodedBody:r}=e,{contentType:s,body:i,estimatedSize:o}=r??{},l=new Headers;Mt(t.headers,function(w,_){l.append(_,w)}),s&&l.append("Content-Type",s);let u=null,d=!1;if(i8){const w=new i8;u={signal:w.signal,timeout:setTimeout(()=>{d=!0;try{w.abort(v5("AbortError","PostHog request timed out"+((_=t.timeout)?` after ${_}ms`:"")))}catch(x){p(x)}var _},t.timeout)}}let f=!1;const p=w=>{var _;f||(f=!0,d&&(w==null?void 0:w.name)==="AbortError"||VT(w)?ve.warn(w):ve.error(w),(_=t.callback)===null||_===void 0||_.call(t,{statusCode:0,error:w}))};let g=0;const v=()=>{by-=g,g=0,u&&clearTimeout(u.timeout)};try{const w=H({method:(t==null?void 0:t.method)||"GET",headers:l,referrerPolicy:"strict-origin",body:i,signal:u==null?void 0:u.signal},t.fetchOptions),_=o??(ce(i)?0:void 0);w.keepalive=w.method==="POST"&&!t.sl&&w.keepalive!==!1&&w.body===i&&!ce(_)&&_>=0&&52428.8>by+_,w.keepalive&&(g=_,by+=g),rh(n,w).then(x=>x.text().then(S=>{var k;if(f)return;const C={statusCode:x.status,text:S};if(x.status===200)try{C.json=JSON.parse(S)}catch(T){ve.error(T)}f=!0,v(),(k=t.callback)===null||k===void 0||k.call(t,C,HT(()=>x.headers.get("Retry-After")))})).catch(x=>{v(),p(x)}).finally(v)}catch(w){v(),p(w)}},k2=t=>{try{var e;const{url:n,encodedBody:r}=$T(t),{contentType:s,body:i,estimatedSize:o}=r??{};if(!i)return;const l=i instanceof Blob?i:new Blob([i],{type:s});if(Xn.sendBeacon(n,l))return;const u=We(t.data)?t.data:(e=t.data)===null||e===void 0?void 0:e.batch;if(We(u)&&u.length>1&&(o??0)>16384){const d=Math.ceil(u.length/2),f=p=>We(t.data)?p:H(H({},t.data),{},{batch:p});return k2(H(H({},t),{},{data:f(u.slice(0,d))})),void k2(H(H({},t),{},{data:f(u.slice(d))}))}ve.warn(`Beacon of ~${o??0} bytes was rejected by the browser, falling back to ${rh?"fetch":"XHR"}`),rh?UT(H(H({},t),{},{sl:!0})):zT(t)}catch(n){ve.warn("Beacon send failed",n)}},tk=(t,e,n,r)=>{const s=r==="query"?e==="POST"?"sent_at":"_":void 0;return Wh(n===_s.GZipJS?jT(t,"compression"):t,H(H({},s?{[s]:Date.now().toString()}:{}),n===_s.GZipJS?{}:{compression:n}))},lF=(()=>{const t=[];return rh&&t.push({transport:"fetch",method:UT}),mx&&t.push({transport:"XHR",method:zT}),Xn!=null&&Xn.sendBeacon&&t.push({transport:"sendBeacon",method:k2}),t})();let BT=!iF&&(Or==null?void 0:Or.indexOf("MSIE"))===-1&&(Or==null?void 0:Or.indexOf("Mozilla"))===-1;function ZT(t,e,n){var r,s,i;n&&(e=H(H({},e),{},{callback:o=>n(o)})),t.__loaded?BT?t.__request_queue.push(e):t.rateLimiter.isServerRateLimited(e.batchKey)?e.fireCallbackOnDrop&&((s=e.callback)===null||s===void 0||s.call(e,{statusCode:429})):(e.transport=e.transport||t.config.api_transport,e.headers=H(H({},t.config.request_headers),e.headers),e.compression=e.compression==="best-available"?(r=t.compression)!==null&&r!==void 0?r:e.compressionFallback:e.compression,(ce(t.config.disable_beacon)?t.config.__preview_disable_beacon:t.config.disable_beacon)&&(e.disableTransport=["sendBeacon"]),e.fetchOptions=e.fetchOptions||t.config.fetch_options,((o,l)=>{var u,d,f;const p=H(H({},o),{},{callback:l??(x=>{var S;return(S=o.callback)===null||S===void 0?void 0:S.call(o,x)})});p.timeout=p.timeout||6e4;const g=(u=p.transport)!==null&&u!==void 0?u:"fetch";g==="sendBeacon"&&ce(p.compression)&&p.data&&(p.compression=_s.Base64),p.method==="POST"&&p.data&&(p.timestampMode==="capture-body"?p.data=(x=>{var S,k;const C=(We(x)?x:[x]).map(A=>H(H({},A),A.timestamp instanceof Date&&!isNaN(A.timestamp.getTime())?{timestamp:A.timestamp.toISOString()}:{})),T=C[0];return{api_key:(S=T==null||(k=T.properties)===null||k===void 0?void 0:k.token)!==null&&S!==void 0?S:T==null?void 0:T.token,batch:C,sent_at:new Date().toISOString()}})(p.data):p.timestampMode==="body"&&(p.data=((x,S=new Date().toISOString())=>We(x)?x.map(k=>H(H({},k),{},{sent_at:S})):H(H({},x),{},{sent_at:S}))(p.data))),p.url=tk(p.url,p.method,p.compression,p.timestampMode);const v=lF.filter(x=>!p.disableTransport||!x.transport||!p.disableTransport.includes(x.transport)),w=(d=(f=(function(x,S){for(let k=0;x.length>k;k++)if(S(x[k]))return x[k]})(v,x=>x.transport===g))===null||f===void 0?void 0:f.method)!==null&&d!==void 0?d:v[0].method;if(!w)throw new Error("No available transport method");const _=x=>{try{w(x)}catch(k){var S;VT(k)?ve.warn(k):ve.error(k),(S=p.callback)===null||S===void 0||S.call(p,{statusCode:0,error:k})}};g!=="sendBeacon"&&!p.preferSyncCompression&&p.data&&p.compression===_s.GZipJS&&Q7&&typeof Promise<"u"&&!J0?oF(p).then(x=>{_(x)}).catch(x=>{if(x8(x))return J0=!0,void _(H(H({},p),{},{compression:void 0,url:tk(o.url,o.method,void 0,o.timestampMode)}));(S=>{if(!S||typeof S!="object")return!1;const k="name"in S?String(S.name):"";return x8(S)||k===k5})(x)&&(J0=!0),_(p)}):_(p)})(e,(o,l)=>{var u,d,f;t.rateLimiter.checkForLimiting(o),400>o.statusCode||(u=(d=t.config).on_request_error)===null||u===void 0||u.call(d,o),n?n(o,l):(f=e.callback)===null||f===void 0||f.call(e,o)})):e.fireCallbackOnDrop&&((i=e.callback)===null||i===void 0||i.call(e,{statusCode:0}))}var cF=class{constructor(t,e){this.rl=!0,this.ol=[],this.al=Ui((e==null?void 0:e.flush_interval_ms)||3e3,250,5e3,ve.createLogger("flush interval"),3e3),this.ll=t}enqueue(t){this.ol.push(t),this.ul||this.hl()}unload(){this.cl();const t=this.ol.length>0?this.dl():{},e=Object.values(t);[...e.filter(n=>n.url.indexOf("/e")===0),...e.filter(n=>n.url.indexOf("/e")!==0)].map(n=>{this.vl(n,"sendBeacon")})}enable(){this.rl=!1,this.hl()}hl(){this.rl||(this.ul=setTimeout(()=>{if(this.cl(),this.ol.length>0){const t=this.dl();for(const e in t)this.vl(t[e])}},this.al))}vl(t,e){try{this.ll(t,e)}catch(n){ve.error(n)}}cl(){clearTimeout(this.ul),this.ul=void 0}dl(){const t={};return Mt(this.ol,e=>{var n;const r=e,s=((r?r.batchKey:null)||r.url)+(r.batchGroup?`:${r.batchGroup}`:"");ce(t[s])&&(t[s]=H(H({},r),{},{data:[]})),(n=t[s].data)===null||n===void 0||n.push(r.data)}),this.ol=[],t}};const uF=["retriesPerformedSoFar"];var dF=class{constructor(t){this._instance=t,this.fl=!1,this.pl=3e3,this.ol=[],this.ol=[],this.gl=!0,this.resume()}resume(){if(!ce(J)&&"onLine"in J.navigator){if(this.gl=J.navigator.onLine,this.ml)return;this.ml=()=>{this.gl=!0,this.yl()},this.bl=()=>{this.gl=!1},kt(J,"online",this.ml),kt(J,"offline",this.bl)}}get length(){return this.ol.length}retriableRequest(t,e){let{retriesPerformedSoFar:n}=t,r=E5(t,uF);So(n)&&(r.url=Wh(r.url,{retry_count:n})),ZT(this._instance,e?H(H({},r),{},{transport:e}):r,(s,i)=>{var o;if(s.statusCode!==200&&(400>s.statusCode||s.statusCode>=500)){if((s.statusCode===0?3:10)>(n??0))return void this.Ls(H({retriesPerformedSoFar:n},r),i);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.`)}(o=r.callback)===null||o===void 0||o.call(r,s)})}Ls(t,e){const n=t.retriesPerformedSoFar||0;t.retriesPerformedSoFar=n+1;const r=Math.max((function(o){const l=3e3*Math.pow(2,o),u=l/2,d=Math.min(18e5,l),f=(Math.random()-.5)*(d-u);return Math.ceil(d+f)})(n),e??0),s=Date.now()+r;this.ol.push({retryAt:s,requestOptions:t});let i=`Enqueued failed request for retry in ${r}`;navigator.onLine||(i+=" (Browser is offline)"),ve.warn(i),this.fl||(this.fl=!0,this._l())}_l(){if(this.wl&&clearTimeout(this.wl),this.ol.length===0)return this.fl=!1,void(this.wl=void 0);this.wl=setTimeout(()=>{this.gl&&this.ol.length>0&&this.yl(),this._l()},this.pl)}yl(){const t=Date.now(),e=[],n=this.ol.filter(r=>t>r.retryAt||(e.push(r),!1));if(this.ol=e,n.length>0)for(const{requestOptions:r}of n)this.retriableRequest(r)}unload(){this.wl&&(clearTimeout(this.wl),this.wl=void 0),this.fl=!1,ce(J)||(this.ml&&(J.removeEventListener("online",this.ml),this.ml=void 0),this.bl&&(J.removeEventListener("offline",this.bl),this.bl=void 0));for(const{requestOptions:t}of this.ol)try{this._instance._send_request(H(H({},t),{},{transport:"sendBeacon"}))}catch(e){ve.error(e)}this.ol=[]}},fF=class{constructor(t){this._instance=t,this.kl=()=>{var e,n,r,s;this.Sl||(this.Sl={});const i=this.scrollElement(),o=this.scrollY(),l=i?Math.max(0,i.scrollHeight-i.clientHeight):0,u=o+((i==null?void 0:i.clientHeight)||0),d=(i==null?void 0:i.scrollHeight)||0;this.Sl.lastScrollY=Math.ceil(o),this.Sl.maxScrollY=Math.max(o,(e=this.Sl.maxScrollY)!==null&&e!==void 0?e:0),this.Sl.maxScrollHeight=Math.max(l,(n=this.Sl.maxScrollHeight)!==null&&n!==void 0?n:0),this.Sl.lastContentY=u,this.Sl.maxContentY=Math.max(u,(r=this.Sl.maxContentY)!==null&&r!==void 0?r:0),this.Sl.maxContentHeight=Math.max(d,(s=this.Sl.maxContentHeight)!==null&&s!==void 0?s:0)}}get xl(){return this._instance.config.scroll_root_selector}getContext(){return this.Sl}resetContext(){const t=this.Sl;return this.Sl=void 0,setTimeout(this.kl,0),t}startMeasuringScrollPosition(){kt(J,"scroll",this.kl,{capture:!0}),kt(J,"scrollend",this.kl,{capture:!0}),kt(J,"resize",this.kl)}scrollElement(){if(this.xl){const n=We(this.xl)?this.xl:[this.xl];for(const r of n){var t;const s=J==null||(t=J.document)===null||t===void 0?void 0:t.querySelector(r);if(s)return s}return}var e;return J==null||(e=J.document)===null||e===void 0?void 0:e.documentElement}$l(t){var e,n;const r=t==="y"?"scrollTop":"scrollLeft";if(this.xl){const s=this.scrollElement();return s&&s[r]||0}return J?t==="y"?J.scrollY||J.pageYOffset||((e=J.document)===null||e===void 0||(e=e.documentElement)===null||e===void 0?void 0:e.scrollTop)||0:J.scrollX||J.pageXOffset||((n=J.document)===null||n===void 0||(n=n.documentElement)===null||n===void 0?void 0:n.scrollLeft)||0:0}scrollY(){return this.$l("y")}scrollX(){return this.$l("x")}};const hF=t=>ET(t==null?void 0:t.config.mask_personal_data_properties,t==null?void 0:t.config.custom_personal_data_properties,t==null?void 0:t.config.disable_capture_url_hashes);var nk=class{constructor(t,e,n,r){this.qe=s=>{const i=this.Cl();if(i&&i.sessionId===s)return;const o={sessionId:s,props:this.Tl(this._instance)};this.Il.register({[p2]:o})},this._instance=t,this.Ml=e,this.Il=n,this.Tl=r||hF,this.Ml.onSessionId(this.qe)}Cl(){return this.Il.props[p2]}getSetOnceProps(){var t;const e=(t=this.Cl())===null||t===void 0?void 0:t.props;return e?"r"in e?CT(e,this._instance.config.disable_capture_url_hashes):{$referring_domain:e.referringDomain,$pathname:e.initialPathName,utm_source:e.utm_source,utm_campaign:e.utm_campaign,utm_medium:e.utm_medium,utm_content:e.utm_content,utm_term:e.utm_term}:{}}getSessionProps(){const t={};return Mt(Ax(this.getSetOnceProps()),(e,n)=>{n==="$current_url"&&(n="url"),t[`$session_entry_${J_(n)}`]=e}),t}},Vm=class{on(t,e){return this.El[t]||(this.El[t]=[]),this.El[t].push(e),()=>{this.El[t]=this.El[t].filter(n=>n!==e)}}emit(t,e){for(const n of this.El[t]||[])n(e);for(const n of this.El["*"]||[])n(t,e)}constructor(){this.El={}}};const ou=dn("[SessionId]"),rk=864e5;var sk=class{on(t,e){return this.Pl.on(t,e)}constructor(t,e,n){var r;if(this.Rl=null,this.Al=null,this.Ol=[],this.Fl=void 0,this.Dl=!1,this.Pl=new Vm,this.Ll=(i,o)=>!(!So(i)||!So(o))&&Math.abs(i-o)>this.sessionTimeoutMs,!t.persistence)throw new Error("SessionIdManager requires a PostHogPersistence instance");if(t.config.cookieless_mode==="always")throw new Error('SessionIdManager cannot be used with cookieless_mode="always"');this.Mr=t.config,this.Il=t.persistence,this.je=void 0,this.Xt=void 0,this._sessionStartTimestamp=null,this.Nl=void 0,this._sessionActivityTimestamp=null,this.ql=e||yi,this.jl=n||yi;const s=this.Mr.persistence_name||this.Mr.token;if(this._sessionTimeoutMs=1e3*Ui(this.Mr.session_idle_timeout_seconds||1800,60,36e3,ou.createLogger("session_idle_timeout_seconds"),1800),t.register({$configured_session_timeout_ms:this._sessionTimeoutMs}),this.Bl(),this.Hl="ph_"+s+"_window_id",this.zl="ph_"+s+"_primary_window_exists",this.Ul()){const i=zt.Lt(this.Hl),o=zt.Lt(this.zl);i&&!o?this.je=i:zt.Pt(this.Hl),zt.$t(this.zl,!0)}!((r=this.Mr.bootstrap)===null||r===void 0)&&r.sessionID&&this.setBootstrapSessionId(this.Mr.bootstrap.sessionID),this.Wl()}get sessionTimeoutMs(){return this._sessionTimeoutMs}onSessionId(t){return ce(this.Ol)&&(this.Ol=[]),this.Ol.push(t),this.Xt&&t(this.Xt,this.je),()=>{this.Ol=this.Ol.filter(e=>e!==t)}}Ul(){return this.Mr.persistence!=="memory"&&!this.Il.hi&&zt.Et()}Vl(t){t!==this.je&&(this.je=t,this.Ul()&&zt.$t(this.Hl,t))}Gl(){return this.je?this.je:this.Ul()?zt.Lt(this.Hl):null}Ql(t){const e=this.Rl;return!cn(e)&&!cn(t)&&5e3>Math.abs(t-e)}Jl(t,e,n){const r=e!==this._sessionActivityTimestamp,s=!(t!==this.Xt||n!==this._sessionStartTimestamp);this._sessionStartTimestamp=n,this._sessionActivityTimestamp=e,this.Xt=t,s&&!r||s&&this.Ql(e)||(this.Rl=e,this.Il.register({[_u]:[e,t,n]}))}Zl(){var t;const e=(t=this.Mr)===null||t===void 0?void 0:t.persistence_save_debounce_ms;return So(e)&&e>0}Kl(){this.Zl()?this.Il.refreshKey(_u):(this.Il.flush(),this.Il.load())}Xl(){var t;if(cn(this._sessionActivityTimestamp)||this._sessionActivityTimestamp===this.Rl)return;this.Kl();const[,e,n]=this.Yl();e===this.Xt&&n===this._sessionStartTimestamp&&(this.Rl=this._sessionActivityTimestamp,this.Il.register({[_u]:[this._sessionActivityTimestamp,(t=this.Xt)!==null&&t!==void 0?t:null,this._sessionStartTimestamp]}),this.Il.flush())}tu(){const[t]=this.Yl(),e=So(t)?t:0,n=So(this._sessionActivityTimestamp)?this._sessionActivityTimestamp:0;return Math.max(e,n)}eu(t){return this.Kl(),this.Ll(t,this.tu())}Yl(){const t=this.Il.props[_u];return We(t)&&t.length===2&&t.push(t[0]),t||[0,null,0]}resetSessionId(){this.Rl=null,this.Nl=void 0,clearTimeout(this.iu),this.iu=void 0,this.Jl(null,null,null)}setBootstrapSessionId(t,e=!1){const n=((r,s=new Date().getTime())=>{try{const i=(o=>{const l=o.replace(/-/g,"");if(l.length!==32)throw new Error("Not a valid UUID");if(l[12]!=="7")throw new Error("Not a UUIDv7");return parseInt(l.substring(0,12),16)})(r);return i>s+6e4?void ou.error("Bootstrap sessionID cannot be in the future"):i}catch(i){return void ou.error("Invalid sessionID in bootstrap",i)}})(t);return!ce(n)&&(e?this.Nl={sessionId:t,sessionStartTimestamp:n}:this.Jl(t,new Date().getTime(),n),!0)}destroy(){this.Dl=!0,this.Xl(),clearTimeout(this.iu),this.iu=void 0,this.Fl&&J&&(J.removeEventListener(Nm,this.Fl,{capture:!1}),this.Fl=void 0),this.Ol=[]}Wl(){this.Fl=()=>{this.Xl(),this.Ul()&&zt.Pt(this.zl)},kt(J,Nm,this.Fl,{capture:!1})}checkAndGetSessionAndWindowId(t=!1,e=null,n=!1){if(this.Mr.cookieless_mode==="always")throw new Error('checkAndGetSessionAndWindowId should not be called with cookieless_mode="always"');const r=e||new Date().getTime(),s=this.Xt;if(n)this.Al=r;else if(cn(this.Al)||this.Al>r||r-this.Al>=1e3){var i,o;(i=(o=this.Il).syncCookieProperties)===null||i===void 0||i.call(o),this.Al=r}let[,l,u]=this.Yl();const d=!ce(s)&&l!==s,f=this.tu();let p=this.Gl();const g=this.Nl,v=!!g&&(g.sessionStartTimestamp>r+6e4||r-g.sessionStartTimestamp>rk),w=g?v:So(u)&&Math.abs(r-u)>rk;let _=!1,x=d,S=!l||!!g;const k=l;let C=!S&&!t&&this.Ll(r,f);if(C&&(C=this.eu(r),C||ou.info("cross-tab refresh kept the session alive",{sessionId:l}),[,l,u]=this.Yl(),C||(S=!l||!!g)),S||C||w){x=!1;const M=g&&!v;l=M?g.sessionId:this.ql(),p=this.jl(),ou.info("new session ID assigned",{sessionId:l,windowId:p,bootstrapped:!!M,changeReason:{noSessionId:S,activityTimeout:C,sessionPastMaximumLength:w}}),u=M?g.sessionStartTimestamp:r,this.Nl=void 0,_=!0}else p||(p=this.jl(),_=!0),x=x||l!==k,x&&(ou.info("adopted cross-tab session id",{sessionId:l,windowId:p}),_=!0);const T=So(f)&&t&&!w?f:r,A=So(u)?u:new Date().getTime();this.Vl(p),this.Jl(l,T,A),t||this.Bl();const I={noSessionId:S,activityTimeout:C,sessionPastMaximumLength:w,crossTabAdoption:x};return _&&this.Ol.forEach(M=>M(l,p,I)),{sessionId:l,windowId:p,sessionStartTimestamp:A,changeReason:_?I:void 0,lastActivityTimestamp:f}}Bl(){this.Dl||(clearTimeout(this.iu),this.iu=setTimeout(()=>{if(!this.Dl)if(this.eu(new Date().getTime())){const t=this.Xt;this.resetSessionId(),this.Pl.emit("forcedIdleReset",{idleSessionId:t})}else this.Bl()},1.1*this.sessionTimeoutMs))}};const WT=function(t,e){if(!t)return!1;const n=t.userAgent;if(n&&a8(n,e))return!0;try{const r=t==null?void 0:t.userAgentData;if(r!=null&&r.brands&&r.brands.some(s=>a8(s==null?void 0:s.brand,e)))return!0}catch{}return!!t.webdriver};function qT(){return(qT=Gt(function*(){const t=Xn==null?void 0:Xn.userAgentData;if(t!=null&&t.getHighEntropyValues)try{const e=yield t.getHighEntropyValues(["model"]),n=e==null?void 0:e.model;return lt(n)&&n.length>0?n:void 0}catch(e){return void ve.info("Unable to resolve $device_model from userAgentData.getHighEntropyValues",e)}})).apply(this,arguments)}function pF(t,e){let n=`$survey_${e}/${t.id}`;return t.current_iteration&&t.current_iteration>0&&(n=`$survey_${e}/${t.id}/${t.current_iteration}`),n}function GT(t){var e;return!!(!((e=t.conditions)===null||e===void 0||(e=e.events)===null||e===void 0||(e=e.values)===null||e===void 0)&&e.length)}const Hm=(t,e)=>{if(!(n=>{try{new RegExp(n)}catch{return!1}return!0})(e))return!1;try{return new RegExp(e).test(t)}catch{return!1}},_0=t=>t.toLowerCase(),KT={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=>Hm(n,r))),not_regex:(t,e)=>e.every(n=>t.every(r=>!Hm(n,r))),icontains:(t,e)=>e.map(_0).some(n=>t.map(_0).some(r=>n.includes(r))),not_icontains:(t,e)=>e.map(_0).every(n=>t.map(_0).every(r=>!n.includes(r))),gt:(t,e)=>e.some(n=>{const r=parseFloat(n);return!isNaN(r)&&t.some(s=>r>parseFloat(s))}),lt:(t,e)=>e.some(n=>{const r=parseFloat(n);return!isNaN(r)&&t.some(s=>r<parseFloat(s))})};function YT(t,e){return!t||Object.entries(t).every(([n,r])=>{const s=e==null?void 0:e[n];if(s==null)return!1;const i=KT[r.operator];return!!i&&i(r.values.map(String),[String(s)])})}function ky(t,e,n){return bu({distinct_id:t,userPropertiesToSet:e,userPropertiesToSetOnce:n})}const E2="custom",ik="i.posthog.com",mF=/^\/static\//,gF=["/s/","/e/","/i/"];var vF=class{constructor(t){this.nu={},this.instance=t}get apiHost(){const t=this.instance.config.api_host.trim().replace(/\/$/,"");return t==="https://app.posthog.com"?"https://us.i.posthog.com":t}get flagsApiHost(){const t=this.instance.config.flags_api_host;return t?t.trim().replace(/\/$/,""):this.apiHost}get uiHost(){var t;let e=(t=this.instance.config.ui_host)===null||t===void 0?void 0:t.replace(/\/$/,"");return e||(e=this.apiHost.replace(`.${ik}`,".posthog.com")),e==="https://app.posthog.com"?"https://us.posthog.com":e}get region(){return this.nu[this.apiHost]||(this.nu[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":E2),this.nu[this.apiHost]}su(t){if(!mF.test(t))return;const e=this.instance.config.asset_host;return typeof e=="string"&&e.trim().replace(/\/$/,"")||void 0}ru(t){const e=Ho(t);return e?e.protocol+"//"+e.host+e.pathname:void 0}ou(t,e,n){if(t==="ui")return n;let r=n;const s=this.instance.config.rewriteRequestPath;if(s){var i;const o=((i=Ho(n))===null||i===void 0?void 0:i.href)||n;r=s(new URL(o)).toString()}if(s&&t==="api"&&gF.some(o=>e.indexOf(o)===0)){const o=this.ru(r);if(o){const l=this.apiHost;let u=this.au;(u==null?void 0:u.apiHost)===l&&u.rewriteRequestPath===s||(u={apiHost:l,rewriteRequestPath:s,urls:new Set},this.au=u),u.urls.add(o)}}return r}isIngestionEndpoint(t){const e=this.au,n=this.ru(t);return(e==null?void 0:e.apiHost)===this.apiHost&&e.rewriteRequestPath===this.instance.config.rewriteRequestPath&&!!n&&e.urls.has(n)}endpointFor(t,e=""){if(e&&(e=e[0]==="/"?e:`/${e}`),t==="ui")return this.ou(t,e,this.uiHost+e);if(t==="flags")return this.ou(t,e,this.flagsApiHost+e);if(t==="assets"){const r=this.su(e);if(r)return this.ou(t,e,`${r}${e}`)}if(this.region===E2)return this.ou(t,e,this.apiHost+e);const n=ik+e;switch(t){case"assets":return this.ou(t,e,`https://${this.region}-assets.${n}`);case"api":return this.ou(t,e,`https://${this.region}.${n}`)}}};const Tt=dn("[Surveys]"),XT=t=>{try{const e=(n=>((r,s)=>`seenSurvey_${(function(i){return i.current_iteration&&i.current_iteration>0?`${i.id}_${i.current_iteration}`:i.id})(s)}`)(0,n))(t);if(localStorage.getItem(e))return;localStorage.setItem(e,"true")}catch(e){Tt.error("Failed to persist survey seen state",e)}},yF=[yy.Popover,yy.Widget,yy.API],_F={ignoreConditions:!1,ignoreDelay:!1,displayType:w2.Popover},wF=dn("[PostHog ExternalIntegrations]"),xF={intercom:"intercom-integration",crispChat:"crisp-chat-integration"};var bF=class{constructor(t){this._instance=t}Ho(t,e){var n,r;(n=$e.__PosthogExtensions__)===null||n===void 0||(r=n.loadExternalDependency)===null||r===void 0||r.call(n,this._instance,t,s=>{if(s)return wF.error("failed to load script",s);e()})}startIfEnabledOrStop(){var t;for(const[s,i]of Object.entries((t=this._instance.config.integrations)!==null&&t!==void 0?t:{})){var e,n,r;i&&!(!((e=$e.__PosthogExtensions__)===null||e===void 0||(e=e.integrations)===null||e===void 0)&&e[s])&&this.Ho(xF[s],()=>{var o;(o=$e.__PosthogExtensions__)===null||o===void 0||(o=o.integrations)===null||o===void 0||(o=o[s])===null||o===void 0||o.start(this._instance)}),!i&&(!((n=$e.__PosthogExtensions__)===null||n===void 0||(n=n.integrations)===null||n===void 0)&&n[s])&&((r=$e.__PosthogExtensions__)===null||r===void 0||(r=r.integrations)===null||r===void 0||(r=r[s])===null||r===void 0||r.stop())}}},SF=class{constructor(t,e){this.A=t,this.bo=e,this.lu=new Map,this.To=!1}add(t){var e=this;return Gt(function*(){if(e.To)throw new Error("Cannot add an extension to a disposed ExtensionRuntime");if(e.lu.has(t.name))throw new Error(`Browser extension "${t.name}" is already registered`);e.lu.set(t.name,t);try{const n=t.setup(e.bo);n&&(yield n)}catch(n){const r=e.lu.get(t.name)===t;r&&e.lu.delete(t.name),e.A.error(`Failed to set up browser extension "${t.name}"`,n),r&&e.uu(t)}})()}getExtension(t){return this.lu.get(t)}dispose(){if(this.To)return;this.To=!0;const t=Array.from(this.lu.values()).reverse();this.lu.clear();for(const e of t)this.uu(e)}uu(t){try{var e;const n=(e=t.dispose)===null||e===void 0?void 0:e.call(t);n&&Yn(n.then)&&n.then(void 0,r=>{this.A.error(`Failed to dispose browser extension "${t.name}"`,r)})}catch(n){this.A.error(`Failed to dispose browser extension "${t.name}"`,n)}}},kF=class{constructor(t){this._instance=t}initialize(){}get(t){const e=this._instance.persistence;if(typeof t=="string")return e==null?void 0:e.get_property(t);const n={};for(const r of t){const s=e==null?void 0:e.get_property(r);ce(s)||(n[r]=s)}return n}set(t,e){var n;(n=this._instance.persistence)===null||n===void 0||n.register(typeof t=="string"?{[t]:e}:t)}remove(t){var e;(e=this._instance.persistence)===null||e===void 0||e.unregister(t)}};const ok="extensionsRemoteConfig";var EF=class{constructor(t){this.instance=t,this.To=!1,this.A=ve,this.hu=t.cu,this.kv=new kF(t),this.onEvent=e=>y0(this.instance.on("eventCaptured",n=>{try{e({event:n.event,properties:n.properties})}catch(r){this.A.error("Browser extension event listener failed",r)}})),this.onRemoteConfig=e=>{if(this.To)return y0(()=>{});const n=s=>{try{e(s)}catch(i){this.A.error("Browser extension remote config listener failed",i)}},r=this.instance.du.on(ok,n);return this.hu&&n(this.hu),y0(r)},this.vu=new SF(ve.createLogger("[BrowserExtensions]"),this)}get logger(){return this.A}get distinctId(){return this.instance.get_distinct_id()}get anonymousId(){var t;return(t=this.instance.get_property("$device_id"))!==null&&t!==void 0?t:this.distinctId}get deviceId(){const t=this.instance.get_property(xx);return typeof t=="string"?t:void 0}get library(){return{name:zn.LIB_NAME,version:zn.LIB_VERSION}}get initialPersonProperties(){var t,e;return(t=(e=this.instance.persistence)===null||e===void 0?void 0:e.get_initial_props())!==null&&t!==void 0?t:{}}get groups(){return this.instance.getGroups()}get session(){try{var t,e,n,r;const s=(t=this.instance.sessionManager)===null||t===void 0?void 0:t.checkAndGetSessionAndWindowId(!0);return{sessionId:(e=s==null?void 0:s.sessionId)!==null&&e!==void 0?e:"",windowId:(n=s==null?void 0:s.windowId)!==null&&n!==void 0?n:"",sessionStartTimestamp:(r=s==null?void 0:s.sessionStartTimestamp)!==null&&r!==void 0?r:0}}catch{return{sessionId:"",windowId:"",sessionStartTimestamp:0}}}get canCapture(){return this.instance.is_capturing()}get projectToken(){return this.instance.config.token}add(t){return this.vu.add(t)}getExtension(t){return this.vu.getExtension(t)}capture(t,e,n){n?this.instance.capture(t,e,{timestamp:n.timestamp,uuid:n.uuid,$set:n.set,$set_once:n.setOnce}):this.instance.capture(t,e)}registerDynamicEventProperties(t){return y0(this.instance.fu(t))}handleRemoteConfig(t){this.To||(this.hu=t,this.instance.du.emit(ok,t))}sendRequest(t){var e=this;return Gt(function*(n,r={}){var s;const i=e.instance.requestRouter.endpointFor((s=r.target)!==null&&s!==void 0?s:"api",n),o={method:r.method,url:r.query?Wh(i,r.query):i,data:r.body,headers:r.headers,timeout:r.timeoutMs,fireCallbackOnDrop:!0,transport:r.transport,compression:r.compression,compressionFallback:r.target==="flags"&&r.compression==="best-available"?Q_.Base64:void 0,timestampMode:r.sentAt};return r.transport==="sendBeacon"?(e.instance._send_request(o),{statusCode:202}):new Promise(l=>{o.callback=l,e.instance._send_request(o)})}).apply(this,arguments)}dispose(){this.To||(this.To=!0,this.vu.dispose())}};const Hf={};let Ey=0;const zf=()=>{},ak='Consent opt in/out is not valid with cookieless_mode="always" and will be ignored',au="Surveys module not available",lk="sanitize_properties is deprecated. Use before_send instead",QT="Invalid value for property_denylist config: ",CF=["$recording_status","$sdk_debug_recording_script_not_loaded","$sdk_debug_replay_url_trigger_status","$sdk_debug_replay_event_trigger_status","$sdk_debug_replay_linked_flag_trigger_status","$sdk_debug_replay_rrweb_error","$sdk_debug_replay_internal_buffer_length","$sdk_debug_replay_flushed_size"],PF=["$feature_flag_called","$$heatmap","$snapshot"],ck=t=>t.charAt(0)==="$"&&!Ze(PF,t),TF=/^[A-Za-z0-9_-]{1,400}$/,uk=/^fb\.[0-9]+\.[0-9]+\.[A-Za-z0-9_-]+(?:\.[A-Za-z0-9_-]+)?$/,dk=/^fb\.[0-9]+\.[0-9]+\.[0-9]+$/,AF=["token","distinct_id",q5],Cf="posthog",RF=t=>{const e={};return t&&t!=="unset"&&("2025-11-30">t||(e.strictMinimumDuration=!0),"2026-05-30">t||(e.canvasCapture={resolutionScale:.6}),"2026-06-25">t||(e.streamNetworkBody=!0),"2026-08-30">t||(e.captureJsonLd=!0)),e},Cy=t=>{var e;return H({api_host:"https://us.i.posthog.com",flags_api_host:null,ui_host:null,asset_host:null,token:"",autocapture:!0,cross_subdomain_cookie:P$(de==null?void 0:de.location),persistence:"localStorage+cookie",persistence_name:"",cookie_persisted_properties:[],loaded:zf,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:ln&&lt(ln==null?void 0:ln.search)&&ln.search.indexOf("__posthog_debug=true")!==-1||!1,cookie_expiration:365,upgrade:!1,disable_session_recording:!1,disable_persistence:!1,disable_web_experiments:!0,disable_surveys:!1,disable_surveys_automatic_display:!1,disable_conversations:!1,disable_product_tours:!1,disableDeviceModel:!1,reuseAnonymousId:!1,disable_external_dependency_loading:!1,strict_script_versioning:"fallback",enable_recording_console_log:void 0,secure_cookie:(J==null||(e=J.location)===null||e===void 0?void 0:e.protocol)==="https:",ip:!1,opt_out_capturing_by_default:!1,opt_out_persistence_by_default:!1,opt_out_useragent_filter:!1,opt_out_capturing_persistence_type:"localStorage",consent_persistence_name:null,opt_out_capturing_cookie_prefix:null,opt_in_site_apps:!1,property_denylist:[],respect_dnt:!1,sanitize_properties:null,request_headers:{},request_batching:!0,properties_string_max_length:65535,mask_all_element_attributes:!1,mask_all_text:!1,mask_personal_data_properties:!1,custom_personal_data_properties:[],advanced_disable_flags:!1,advanced_disable_decide:!1,advanced_disable_feature_flags:!1,advanced_disable_feature_flags_on_first_load:!1,advanced_only_evaluate_survey_feature_flags:!1,advanced_feature_flags_dedup_per_session:!1,advanced_enable_surveys:!1,advanced_disable_toolbar_metrics:!1,feature_flag_request_timeout_ms:3e3,feature_flag_request_max_retries:1,surveys_request_timeout_ms:1e4,on_request_error(n){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:rT,before_send:void 0,get_current_url:void 0,request_queue_config:{flush_interval_ms:3e3},error_tracking:{},_onCapture:zf},(n=>({rageclick:n&&n>="2026-05-30"?{content_ignorelist:N$,ignore_text_selection:!0}:!n||"2025-11-30">n||{content_ignorelist:!0},capture_pageview:!n||"2025-05-24">n||"history_change",session_recording:RF(n),external_scripts_inject_target:n&&n>="2026-01-30"?"head":"body",internal_or_test_user_hostname:n&&n>="2026-01-30"?/^(localhost|127\.0\.0\.1)$/:void 0,persistence_save_debounce_ms:n&&n>="2026-05-30"?250:0,split_storage:!(!n||"2026-05-30">n),detect_google_search_app:!(!n||"2026-05-30">n),disable_capture_url_hashes:!(!n||"2026-06-25">n),cookieWinsOnConflict:!(!n||n==="unset"||"2026-08-29">n)}))(t))},MF=[["process_person","person_profiles"],["xhr_headers","request_headers"],["cookie_name","persistence_name"],["disable_cookie","disable_persistence"],["__preview_disable_beacon","disable_beacon"],["store_google","save_campaign_params"],["verbose","debug"],["__preview_cookie_wins_on_conflict","cookieWinsOnConflict"]],fk=t=>{const e={};for(const[s,i]of MF)ce(t[s])||(e[i]=t[s]);const n=Wt({},e,t),r=t.__preview_external_dependency_versioned_paths;return ce(r)||(ce(t.strict_script_versioning)&&(n.strict_script_versioning=!!r),lt(r)&&ce(t.asset_host)&&(n.asset_host=r)),We(t.property_blacklist)&&(ce(t.property_denylist)?n.property_denylist=t.property_blacklist:We(t.property_denylist)?n.property_denylist=[...t.property_blacklist,...t.property_denylist]:ve.error(QT+t.property_denylist)),n};var IF=class{constructor(){this.__forceAllowLocalhost=!1}get pu(){return this.__forceAllowLocalhost}set pu(t){ve.error("WebPerformanceObserver is deprecated and has no impact on network capture. Use `_forceAllowLocalhostNetworkCapture` on `posthog.sessionRecording`"),this.__forceAllowLocalhost=t}},Uf=class wa{gu(e){if(!e)return;const n=this.lu.indexOf(e);n!==-1&&this.lu.splice(n,1)}mu(e,n){var r;return this.gu(e),this.lu.push(n),(r=n.initialize)===null||r===void 0||r.call(n),n}yu(){return this.config.cookieless_mode==="always"||this.config.cookieless_mode==="on_reject"&&this.consent.isRejected()}bu(){if(this._u||this.config.reuseAnonymousId||this.config.segment||this.yu())return;const e=this.config.persistence==="memory"||this.config.persistence==="sessionStorage";if(!e&&!this.config.disable_persistence||this.wu)return;let n,r,s;e?(n=`persistence is set to '${this.config.persistence}'`,r=this.config.persistence==="memory"?"on every page load":"for every new browser tab or window",s="Either set persistence to 'localStorage+cookie', keep this persistence and pass a stable ID through bootstrap.distinctID, or enable reuseAnonymousId."):(n="persistence is disabled (disable_persistence is true)",r="on every page load",s="Either set disable_persistence to false, keep persistence disabled and pass a stable ID through bootstrap.distinctID, or enable reuseAnonymousId."),this._u=!0,console.warn("[PostHog.js]",`${n} but no bootstrap.distinctID was provided. PostHog will mint a new distinct ID ${r}, so calling identify() merges a new ID onto the person each time. A person can then pass the distinct-ID limit and its events stop appearing on person pages and the session tab. ${s}`)}ku(){const e=this.persistence;if(!e||this.Su)return;if(this.yu())return void(this.config.cookieless_mode==="on_reject"&&this.get_distinct_id()!=="$posthog_cookieless"&&(this.xu(),this.$u()));if(this.get_distinct_id()!=="$posthog_cookieless")return;this.Cu()||e.load(!0);const n=this.get_distinct_id();if(!n||n==="$posthog_cookieless"){const r=this.config.get_device_id(yi());this.register({distinct_id:r,$device_id:r}),e.set_property(Lr,Oo)}this.xu()}get decideEndpointWasHit(){var e,n;return(e=(n=this.featureFlags)===null||n===void 0?void 0:n.hasLoadedFlags)!==null&&e!==void 0&&e}get flagsEndpointWasHit(){var e,n;return(e=(n=this.featureFlags)===null||n===void 0?void 0:n.hasLoadedFlags)!==null&&e!==void 0&&e}constructor(){var e;this.Tu=!1,this.Iu=!1,this.webPerformance=new IF,this.Mu=!1,this.version=zn.LIB_VERSION,this.Eu=new Set,this.Pu="",this.du=new Vm,this.lu=[],this.Ru=[],this.Au=!1,this.wu=!1,this._u=!1,this.Su=!1,this._calculate_event_properties=this.calculateEventProperties.bind(this),this.config=Cy(),this.SentryIntegration=U$,this.sentryIntegration=r=>(function(s,i){const o=vT(s,i);return{name:gT,processEvent:l=>o(l)}})(this,r),this.__request_queue=[],this.__loaded=!1,this.analyticsDefaultEndpoint="/e/",this.Ou=!1,this.Fu=null,this.Du=null,this.Lu=null,this.scrollManager=new fF(this),this.pageViewManager=new W8(this),this.rateLimiter=new J$(this),this.requestRouter=new vF(this),this.consent=new L$(this),this.externalIntegrations=new bF(this);const n=(e=wa.__defaultExtensionClasses)!==null&&e!==void 0?e:{};this.featureFlags=n.featureFlags&&new n.featureFlags(this),this.toolbar=n.toolbar&&new n.toolbar(this),this.surveys=n.surveys&&new n.surveys(this),this.conversations=n.conversations&&new n.conversations(this),this.logs=n.logs&&new n.logs(this),this.metrics=n.metrics&&new n.metrics(this),this.experiments=n.experiments&&new n.experiments(this),this.exceptions=n.exceptions&&new n.exceptions(this),this.people={set:(r,s,i)=>{const o=lt(r)?{[r]:s}:r;this.setPersonProperties(o),i==null||i({})},set_once:(r,s,i)=>{const o=lt(r)?{[r]:s}:r;this.setPersonProperties(void 0,o),i==null||i({})}},this.on("eventCaptured",r=>ve.info(`send "${r==null?void 0:r.event}"`,r))}init(e,n,r){if(r&&r!==Cf){var s;const i=(s=Hf[r])!==null&&s!==void 0?s:new wa;return i._init(e,n,r),Hf[r]=i,Hf[Cf][r]=i,i}return this._init(e,n,r)}_init(e,n={},r){var s,i,o;const l=lt(e)?e.trim():"";if(!l)return ve.critical("PostHog was initialized without a token. This likely indicates a misconfiguration. Please check the first argument passed to posthog.init()"),this;var u;if(this.__loaded)return l!==((u=this.config)===null||u===void 0?void 0:u.token)?console.warn("[PostHog.js]",`You have already initialized PostHog with a different project token! Re-initializing is a no-op, so events will keep going to the project this instance was initialized with. To capture into a second project, load PostHog once, then initialize a named instance after the SDK has loaded, e.g. posthog.init('${l}', { ... }, 'project2')`):console.warn("[PostHog.js]","You have already initialized PostHog! Re-initializing is a no-op"),this;this.__loaded=!0,this.config=Cy(n.defaults),n.debug=this.Nu(n.debug),this.qu=n,this.ju=[],n.person_profiles?this.Du=n.person_profiles:n.process_person&&(this.Du=n.process_person);const d=Cy(n.defaults),f=fk(n),p=Wt({},d,f,{name:r,token:l});dt(d.rageclick)&&dt(f.rageclick)&&(p.rageclick=Wt({},d.rageclick,f.rageclick)),dt(d.session_recording)&&dt(f.session_recording)&&(p.session_recording=Wt({},d.session_recording,f.session_recording)),this.set_config(p),this.config.on_xhr_error&&ve.error("on_xhr_error is deprecated. Use on_request_error instead"),this.compression=n.disable_compression?void 0:_s.GZipJS;const g=this.Cu(),v=!this.yu();if(this.persistence=new vy(this.config,g,!0,v),this.sessionPersistence=this.config.persistence==="sessionStorage"||this.config.persistence==="memory"?this.persistence:new vy(H(H({},this.config),{},{persistence:"sessionStorage"}),g,!1,v),this.Pu="ph_"+(this.config.persistence_name||this.config.token)+"_session_registered_properties",this.config.persistence!=="memory"&&!g&&zt.Et()){const k=zt.Lt(this.Pu);We(k)&&k.forEach(C=>{lt(C)&&this.Eu.add(C)})}else zt.Pt(this.Pu);const w=H({},this.persistence.props),_=H({},this.sessionPersistence.props);this.register({$initialization_time:new Date().toISOString()}),this.Bu=new cF((k,C)=>this.Hu(k,C),this.config.request_queue_config),this.zu=new dF(this),this.__request_queue=[];const x=this.yu();x||(this.sessionManager=new sk(this),this.sessionPropsManager=new nk(this,this.sessionManager,this.persistence),this.sessionManager.onSessionId((k,C,T)=>{(T!=null&&T.activityTimeout||T!=null&&T.sessionPastMaximumLength||T!=null&&T.crossTabAdoption)&&this.Uu()})),this.Wu(),this.config.__preview_deferred_init_extensions?(ve.info("Deferring extension initialization to improve startup performance"),setTimeout(()=>{this.Vu(x)},0)):(ve.info("Initializing extensions synchronously"),this.Vu(x)),zn.DEBUG=zn.DEBUG||this.config.debug,zn.DEBUG&&ve.info("Starting in debug mode",{this:this,config:n,thisC:H({},this.config),p:w,s:_}),this.config.identity_distinct_id&&!(!((s=n.bootstrap)===null||s===void 0)&&s.distinctID)&&(n.bootstrap=H(H({},n.bootstrap),{},{distinctID:this.config.identity_distinct_id,isIdentifiedID:!0}));const S=(i=n.bootstrap)===null||i===void 0?void 0:i.distinctID;if(this.wu=!!S&&!If(S),(o=n.bootstrap)===null||o===void 0?void 0:o.distinctID){const k=n.bootstrap.distinctID,C=this.get_distinct_id(),T=this.persistence.get_property(Lr);if(n.bootstrap.isIdentifiedID&&C!=null&&C!==k&&T==="anonymous")this.identify(k);else if(n.bootstrap.isIdentifiedID&&C!=null&&C!==k&&T==="identified")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{const A=this.config.get_device_id(yi()),I=n.bootstrap.isIdentifiedID?A:k;this.persistence.set_property(Lr,n.bootstrap.isIdentifiedID?X0:Oo),this.register({distinct_id:k,$device_id:I})}}if(x)this.register_once({distinct_id:cy,$device_id:null},"");else if(!this.get_distinct_id()){const k=this.config.get_device_id(yi());this.register_once({distinct_id:k,$device_id:k},""),this.persistence.set_property(Lr,Oo)}return kt(J,"onpagehide"in self?"pagehide":"unload",this._handle_unload.bind(this),{passive:!1}),kt(J,"pageshow",()=>{var k;this.Tu=!1,this.Iu||(k=this.zu)===null||k===void 0||k.resume()}),n.segment?Z8(this,()=>this.Gu()):this.Gu(),Yn(this.config._onCapture)&&this.config._onCapture!==zf&&(ve.warn("onCapture is deprecated. Please use `before_send` instead"),this.on("eventCaptured",k=>this.config._onCapture(k.event,k))),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 qT.apply(this,arguments)})().then(k=>{k&&this.register({[ly]:k})}).catch(zf),this}Qu(e){const n=e;return lt(n.name)&&Yn(n.setup)}Ju(e,n){this.Qu(e)?n.push(()=>{this.Zu().add(e).catch(()=>{var r;return(r=e.dispose)===null||r===void 0?void 0:r.call(e)}).catch(r=>{ve.error(`Failed to dispose browser extension "${e.name}"`,r)})}):this.lu.push(e)}Wu(){var e,n,r;const s=(e=(n=this.config.__extensionClasses)===null||n===void 0?void 0:n.featureFlags)!==null&&e!==void 0?e:(r=wa.__defaultExtensionClasses)===null||r===void 0?void 0:r.featureFlags;var i,o,l;s&&(this.featureFlags&&this.featureFlags instanceof s||((i=this.Ku)===null||i===void 0||i.call(this),this.Ku=void 0,this.featureFlags=new s(this)),Yn(this.featureFlags.onReloading)&&Yn(this.featureFlags.setup)?this.Ku||(this.Ku=this.featureFlags.onReloading(()=>{this.du.emit("featureFlagsReloading",!0)}),this.Zu().add(this.featureFlags)):(o=(l=this.featureFlags).initialize)===null||o===void 0||o.call(l))}Vu(e){const n=performance.now(),r=H(H({},wa.__defaultExtensionClasses),this.config.__extensionClasses),s=[];var i,o,l,u,d,f,p;r.exceptions&&this.lu.push(this.exceptions=(i=this.exceptions)!==null&&i!==void 0?i:new r.exceptions(this)),r.historyAutocapture&&this.lu.push(this.historyAutocapture=new r.historyAutocapture(this)),r.tracingHeaders&&this.lu.push(this.tracingHeaders=new r.tracingHeaders(this)),r.siteApps&&this.lu.push(this.siteApps=new r.siteApps(this)),r.sessionRecording&&!e&&this.lu.push(this.sessionRecording=new r.sessionRecording(this)),this.config.disable_scroll_properties||s.push(()=>{this.scrollManager.startMeasuringScrollPosition()}),r.autocapture&&this.Ju(this.autocapture=new r.autocapture(this),s),r.surveys&&this.Ju(this.surveys=(o=this.surveys)!==null&&o!==void 0?o:new r.surveys(this),s),r.logs&&this.Ju(this.logs=(l=this.logs)!==null&&l!==void 0?l:new r.logs(this),s),r.metrics&&this.lu.push(this.metrics=(u=this.metrics)!==null&&u!==void 0?u:new r.metrics(this)),r.conversations&&this.lu.push(this.conversations=(d=this.conversations)!==null&&d!==void 0?d:new r.conversations(this)),r.productTours&&this.lu.push(this.productTours=new r.productTours(this)),r.heatmaps&&this.lu.push(this.heatmaps=new r.heatmaps(this)),r.webVitalsAutocapture&&this.lu.push(this.webVitalsAutocapture=new r.webVitalsAutocapture(this)),r.exceptionObserver&&this.lu.push(this.exceptionObserver=new r.exceptionObserver(this)),r.deadClicksAutocapture&&this.lu.push(this.deadClicksAutocapture=new r.deadClicksAutocapture(this,z$)),r.toolbar&&this.lu.push(this.toolbar=(f=this.toolbar)!==null&&f!==void 0?f:new r.toolbar(this)),r.experiments&&this.lu.push(this.experiments=(p=this.experiments)!==null&&p!==void 0?p:new r.experiments(this)),this.lu.forEach(g=>{g.initialize&&s.push(()=>{var v;(v=g.initialize)===null||v===void 0||v.call(g)})}),s.push(()=>{if(this.Xu){const g=this.Xu;this.Xu=void 0,this.lu.forEach(v=>{var w;return(w=v.onRemoteConfig)===null||w===void 0?void 0:w.call(v,g)})}}),this.Yu(s,n)}Yu(e,n){for(;e.length>0;){if(this.config.__preview_deferred_init_extensions&&performance.now()-n>=30&&e.length>0)return void setTimeout(()=>{this.Yu(e,n)},0);const s=e.shift();if(s)try{s()}catch(i){ve.error("Error initializing extension:",i)}}const r=Math.round(performance.now()-n);this.register_for_session({[G5]:this.config.__preview_deferred_init_extensions?"deferred":"synchronous",[K5]:r}),this.config.__preview_deferred_init_extensions&&ve.info(`PostHog extensions initialized (${r}ms)`)}el(e){var n;if(!de||!de.body)return ve.info("document not ready yet, trying again in 500 milliseconds..."),void setTimeout(()=>{this.el(e)},500);if(this.config.__preview_deferred_init_extensions&&(this.Xu=e),this.cu=e,this.compression=void 0,e.ok){var r;const s=e.config;s.supportedCompression&&!this.config.disable_compression&&(this.compression=Ze(s.supportedCompression,_s.GZipJS)?_s.GZipJS:Ze(s.supportedCompression,_s.Base64)?_s.Base64:void 0),!((r=s.analytics)===null||r===void 0)&&r.endpoint&&(this.analyticsDefaultEndpoint=s.analytics.endpoint)}this.set_config({person_profiles:this.Du?this.Du:rT}),(n=this.th)===null||n===void 0||n.handleRemoteConfig(e),this.lu.forEach(s=>{var i;return(i=s.onRemoteConfig)===null||i===void 0?void 0:i.call(s,e)})}Gu(){try{this.config.loaded(this)}catch(e){ve.critical("`loaded` function failed",e)}if(this.eh(),this.config.internal_or_test_user_hostname&&(ln==null?void 0:ln.hostname)){const e=ln.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.yu())&&this.ih()},1),this.nh=new AT(this),this.nh.load()}eh(){var e;this.is_capturing()&&this.config.request_batching&&((e=this.Bu)===null||e===void 0||e.enable())}_dom_loaded(){this.is_capturing()&&xu(this.__request_queue,e=>this.Hu(e)),this.__request_queue=[],this.eh()}_handle_unload(){var e,n,r,s,i,o;this.Tu=!0,(e=this.surveys)===null||e===void 0||(n=e.handlePageUnload)===null||n===void 0||n.call(e),(r=this.metrics)===null||r===void 0||r.flush("sendBeacon"),this.config.request_batching?(this.sh()&&this.capture(A8),(s=this.logs)===null||s===void 0||s.flushLogs("sendBeacon"),(i=this.Bu)===null||i===void 0||i.unload(),(o=this.zu)===null||o===void 0||o.unload()):this.sh()&&this.capture(A8,null,{transport:"sendBeacon"})}_send_request(e){ZT(this,e)}Hu(e,n){this.zu?this.zu.retriableRequest(e,n):this._send_request(n?H(H({},e),{},{transport:n}):e)}_execute_array(e){Ey++;try{let n;const r=[],s=[],i=[];xu(e,l=>{if(l)if(n=l[0],We(n))i.push(l);else if(Yn(l))try{l.call(this)}catch(u){ve.error("Error executing queued PostHog call",l,u)}else We(l)&&n==="alias"?r.push(l):We(l)&&n.indexOf("capture")!==-1&&Yn(this[n])?i.push(l):s.push(l)});const o=function(l,u){xu(l,function(d){try{if(We(d[0])){let f=u;Mt(d,function(p){f=f[p[0]].apply(f,p.slice(1))})}else u[d[0]].apply(u,d.slice(1))}catch(f){ve.error("Error executing queued PostHog call",d,f)}})};o(r,this),o(s,this),o(i,this)}finally{Ey--}}push(e){if(Ey>0&&We(e)&&lt(e[0])){const n=wa.prototype[e[0]];return void(Yn(n)&&n.apply(this,e.slice(1)))}this._execute_array([e])}get rh(){return{property:P8,persistenceKey:Au,cookieName:"_fbc",pattern:uk,register:(e,n)=>{var r;return(r=this.persistence)===null||r===void 0?void 0:r.register({[Au]:{value:e,delivered:n}})},unregister:()=>{var e;return(e=this.persistence)===null||e===void 0?void 0:e.unregister(Au)}}}get oh(){return{property:T8,persistenceKey:Lf,cookieName:"_fbp",pattern:dk,register:(e,n)=>{var r;return(r=this.persistence)===null||r===void 0?void 0:r.register({[Lf]:{value:e,delivered:n}})},unregister:()=>{var e;return(e=this.persistence)===null||e===void 0?void 0:e.unregister(Lf)}}}ah(e){var n;const r=(n=this.persistence)===null||n===void 0?void 0:n.get_property(e.persistenceKey);return lt(r)&&e.pattern.test(r)?{value:r,delivered:!1}:dt(r)&&lt(r.value)&&e.pattern.test(r.value)?{value:r.value,delivered:r.delivered===!0}:void 0}uh(e,n,r){return n===(r==null?void 0:r.value)?{value:n,pending:!r.delivered}:(e.register(n,!1),{value:n,pending:!0})}hh(e){if(!this.config.save_campaign_params||this.yu())return;const n=jf(e.cookieName);return lt(n)&&e.pattern.test(n)?n:void 0}dh(e,n,r,s){if(!this.persistence)return;const i=this.rh;this.persistence.refreshKey(i.persistenceKey);const o=this.ah(i);if(s)return void i.unregister();if(r)return lt(n)&&uk.test(n)?this.uh(i,n,o):void i.unregister();const l=lt(e)&&TF.test(e)?e:void 0,u=this.hh(i);return u&&((d,f,p)=>{const g=d.split(".");if(f)return g[3]===f;if(!p)return!0;const v=p.value.split(".");return g[3]===v[3]||Number(g[2])>Number(v[2])})(u,l,o)?this.uh(i,u,o):l?(o==null?void 0:o.value.split(".")[3])===l?{value:o.value,pending:!o.delivered}:this.uh(i,`fb.1.${Date.now()}.${l}`,o):o?{value:o.value,pending:!o.delivered}:void 0}fh(e,n,r){if(!this.persistence)return;const s=this.oh;this.persistence.refreshKey(s.persistenceKey);const i=this.ah(s);if(r)return void s.unregister();if(n)return lt(e)&&dk.test(e)?this.uh(s,e,i):void s.unregister();const o=this.hh(s);return o?this.uh(s,o,i):i?{value:i.value,pending:!i.delivered}:void 0}ph(e,n){if(!this.persistence)return;this.persistence.refreshKey(e.persistenceKey);const r=this.ah(e);(r==null?void 0:r.value)!==n||r.delivered||e.register(n,!0)}capture(e,n,r){var s,i;if(!(this.__loaded&&this.persistence&&this.sessionPersistence&&this.Bu))return void ve.uninitializedWarning("posthog.capture");if(!this.is_capturing())return;if(ce(e)||!lt(e))return void ve.error("No event name provided to posthog.capture");if(this.ku(),e==="$snapshot"&&this.yu())return;const o=!this.config.opt_out_useragent_filter&&this._is_bot();if(o&&!this.config.__preview_capture_bot_pageviews)return;const l=r!=null&&r.skip_client_rate_limiting?void 0:this.rateLimiter.clientRateLimitContext();if(l!=null&&l.isRateLimited)return void ve.critical("This capture call is ignored due to client rate limiting.");let u;n!=null&&n.$current_url&&!lt(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.gh||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&&(u=this.sessionPersistence.update_campaign_params()),this.config.save_referrer&&this.sessionPersistence.update_referrer_info(),(this.config.save_campaign_params||this.config.save_referrer)&&this.persistence.set_initial_person_info();const d=new Date,f=(r==null?void 0:r.timestamp)||d,p=d8(r==null?void 0:r.uuid,yi);let g={uuid:p,event:e,properties:this.calculateEventProperties(e,n||{},f,p)};e==="$pageview"&&this.config.__preview_capture_bot_pageviews&&o&&(g.event="$bot_pageview",g.properties.$browser_type="bot"),l&&(g.properties.$lib_rate_limit_remaining_tokens=l.remainingTokens);const v=e==="$feature_flag_called"&&g.properties.$feature_flag_has_experiment===!1&&this.get_property("$minimal_flag_called_events")===!0;r!=null&&r.$set&&!v&&(g.$set=r==null?void 0:r.$set);const w=dt(n==null?void 0:n.$set)?n.$set:void 0,_=We(n==null?void 0:n.$unset)?n.$unset:[],x=(r==null?void 0:r.$unset)||[],S=B=>{var G;const V=!!(r!=null&&r.$set)&&B in r.$set;return{hasProvided:V||!!w&&B in w,provided:V?r==null||(G=r.$set)===null||G===void 0?void 0:G[B]:w==null?void 0:w[B],unset:_.indexOf(B)!==-1||x.indexOf(B)!==-1}},k=S(P8),C=S(T8),T=[{channel:this.rh,hasProvided:k.hasProvided,update:this.dh(u==null?void 0:u.fbclid,k.provided,k.hasProvided,k.unset)},{channel:this.oh,hasProvided:C.hasProvided,update:this.fh(C.provided,C.hasProvided,C.unset)}];for(const{channel:B,hasProvided:G,update:V}of T)V&&g.properties.$process_person_profile===!0&&V.pending&&!G&&!v&&(g.$set=H({[B.property]:V.value},g.$set));const A=r==null?void 0:r.$unset;A&&(g.$unset=A);const I=v?void 0:this.mh(r==null?void 0:r.$set_once,e!==R8,e===sT);if(I&&(g.$set_once=I),r!=null&&r._noTruncate||(M=this.config.properties_string_max_length,g=(function(B,G){const V=new Set;return(function K(U,ee){if(U!==Object(U))return G?G(U):U;if(V.has(U))return;let Z;if(V.add(U),We(U))Z=[],xu(U,j=>{Z.push(K(j))});else{const j={};Mt(md(U)?iT(U):U,(Q,oe)=>{V.has(Q)||(j[oe]=K(Q))}),Z=j}return Z})(B)})(g,B=>lt(B)?B.slice(0,M):B)),g.timestamp=f,ce(r==null?void 0:r.timestamp)||(g.properties.$event_time_override_provided=!0,g.properties.$event_time_override_system_time=d),v&&(g.properties=((B,G=[])=>{const V={},K=U=>{B[U]!==void 0&&(V[U]=B[U])};return qj.forEach(K),G.forEach(K),V})(g.properties,AF)),e===ys.DISMISSED||e===ys.SENT){const B=n==null?void 0:n[_y.SURVEY_ID],G=n==null?void 0:n[_y.SURVEY_ITERATION];XT({id:B,current_iteration:G}),g.$set=H(H({},g.$set),{},{[pF({id:B,current_iteration:G},e===ys.SENT?"responded":"dismissed")]:!0})}else e===ys.SHOWN&&(g.$set=H(H({},g.$set),{},{[_y.SURVEY_LAST_SEEN_DATE]:new Date().toISOString()}));var M;if(e===Q$.SHOWN){const B=n==null?void 0:n[K8.TOUR_TYPE];B&&(g.$set=H(H({},g.$set),{},{[`${K8.TOUR_LAST_SEEN_DATE}/${B}`]:new Date().toISOString()}))}const R=H(H({},g.properties.$set),g.$set);if(Kr(R)||this.setPersonPropertiesForFlags(R),!Qe(this.config.before_send)){const B=this.Fs(g);if(!B)return;g=B,g.uuid=d8(g.uuid,yi)}this.sessionRecording&&!this.Au&&ck(e)&&(this.Au=!0,setTimeout(()=>this.Au=!1,3e4));const O=T.filter(({channel:B,update:G})=>{var V,K,U;const ee=(V=(K=g.$set)===null||K===void 0?void 0:K[B.property])!==null&&V!==void 0?V:dt((U=g.properties)===null||U===void 0?void 0:U.$set)?g.properties.$set[B.property]:void 0;return(G==null?void 0:G.pending)&&ee===G.value});this.du.emit("eventCaptured",g);const N=(s=r==null?void 0:r._url)!==null&&s!==void 0?s:this.requestRouter.endpointFor("api",this.analyticsDefaultEndpoint),D=(r==null?void 0:r._batchKey)==="recordings"||/\/s\/(?:\?|$)/.test(N),$=H(H(H({method:"POST",url:N,data:g,compression:"best-available",preferSyncCompression:r==null?void 0:r.send_instantly,timestampMode:D?"body":"capture-body",batchKey:r==null?void 0:r._batchKey},D&&(!((i=g.properties)===null||i===void 0)&&i.$session_id)?{batchGroup:g.properties.$session_id+(g.properties.$window_id?`-${g.properties.$window_id}`:"")}:{}),r!=null&&r.transport?{transport:r.transport}:{}),O.length?{fireCallbackOnDrop:!0,callback:B=>{if(B.statusCode>=200&&300>B.statusCode)for(const{channel:G,update:V}of O)this.ph(G,V.value)}}:{});if(!this.config.request_batching||r&&!(r!=null&&r._batchKey)||r!=null&&r.send_instantly||O.length){var Y;let B;!$.transport&&!$.callback&&Kr((Y=this.config.request_headers)!==null&&Y!==void 0?Y:{})&&this.Tu&&(B="sendBeacon"),this.Hu($,B)}else this.Bu.enqueue($);return g}_addCaptureHook(e){return this.on("eventCaptured",n=>e(n.event,n))}getExtension(e){var n;return(n=this.th)===null||n===void 0?void 0:n.getExtension(e)}Zu(){var e;return(e=this.th)!==null&&e!==void 0?e:this.th=new EF(this)}fu(e){this.Ru.push(e);let n=!0;return()=>{if(!n)return;n=!1;const r=this.Ru.indexOf(e);r!==-1&&this.Ru.splice(r,1)}}yh(e=!0){var n,r,s;return!!(!((n=this.persistence)===null||n===void 0)&&n.consumeCookieIdentityChange())&&(this.Lu=null,this.persistence.get_property("$user_state")==="anonymous"&&((s=this.sessionPersistence)===null||s===void 0||s.clear(),this.Eu.clear(),this.bh()),(r=this.featureFlags)===null||r===void 0||r.reset(),e&&this.reloadFeatureFlags(),!0)}calculateEventProperties(e,n,r,s,i){if(r=r||new Date,!this.persistence||!this.sessionPersistence)return n;this.ku(),this.persistence.syncCookieProperties(),this.yh();const o=i?void 0:this.persistence.remove_event_timer(e);let l=H({},n);if(l.token=this.config.token,l.$config_defaults=this.config.defaults,this.yu()&&(l[q5]=!0),e==="$snapshot"){const k=H(H({},this.persistence.properties()),this.sessionPersistence.properties());return l.distinct_id=k.distinct_id,(!lt(l.distinct_id)&&!mn(l.distinct_id)||If(l.distinct_id))&&ve.error("Invalid distinct_id for replay event. This indicates a bug in your implementation"),l}const u=(function(k,C,T,A=!1){var I,M,R,O;if(!Or)return{};const N=k?[...ed,...C||[]]:[],[D,$]=h5(Or),[Y,B]=(function(re){for(let ie=0;u8.length>ie;ie++){const[fe,_e,ue]=u8[ie],ae=re.match(fe);if(ae){const Oe=ue&&re.match(ue)||ae;return[_e,(Oe==null?void 0:Oe[1])||""]}}return["",""]})(Or),G=(function(){const re="u">typeof navigator?navigator:void 0;return re!=null&&re.brave?{brave:!0}:{}})(),V={};ce(T)||(V.detectGoogleSearchApp=T);const K={},U=(I=navigator)===null||I===void 0||(I=I.userAgentData)===null||I===void 0?void 0:I.platform,ee=(M=navigator)===null||M===void 0?void 0:M.maxTouchPoints,Z=J==null||(R=J.screen)===null||R===void 0?void 0:R.width,j=J==null||(O=J.screen)===null||O===void 0?void 0:O.height,Q=J==null?void 0:J.devicePixelRatio;ce(U)||(K.userAgentDataPlatform=U),ce(ee)||(K.maxTouchPoints=ee),ce(Z)||(K.screenWidth=Z),ce(j)||(K.screenHeight=j),ce(Q)||(K.devicePixelRatio=Q);const oe=Wt(Ax({$os:D,$os_version:$,$browser:f5(Or,navigator.vendor,G,V),$webview_app:Y,$webview_app_version:B,$device:p5(Or),$device_type:mj(Or,K),$timezone:PT(),$timezone_offset:K$()}),{$current_url:ch(A?Ua(ln==null?void 0:ln.href):ln==null?void 0:ln.href,N,uh),$host:ln==null?void 0:ln.host,$pathname:ln==null?void 0:ln.pathname,$raw_user_agent:Or.length>1e3?Or.substring(0,997)+"...":Or,$browser_version:pj(Or,navigator.vendor,G,V),$browser_language:ST(),$browser_language_prefix:G$(),$screen_height:J==null?void 0:J.screen.height,$screen_width:J==null?void 0:J.screen.width,$viewport_height:J==null?void 0:J.innerHeight,$viewport_width:J==null?void 0:J.innerWidth,$lib:No.LIB_NAME,$lib_version:No.LIB_VERSION,$insert_id:Math.random().toString(36).substring(2,10)+Math.random().toString(36).substring(2,10),$time:Date.now()/1e3});return No.SDK_DIST_CHANNEL&&(oe.$sdk_dist_channel=No.SDK_DIST_CHANNEL),oe})(this.config.mask_personal_data_properties,this.config.custom_personal_data_properties,this.config.detect_google_search_app,this.config.disable_capture_url_hashes);if(this.sessionManager){const{sessionId:k,windowId:C}=this.sessionManager.checkAndGetSessionAndWindowId(i,r.getTime(),!0);l.$session_id=k,l.$window_id=C}this.sessionPropsManager&&Wt(l,this.sessionPropsManager.getSessionProps());try{var d;if(this.sessionRecording){const k=this.sessionRecording.sdkDebugProperties,C=!this.Au&&ck(e);for(const T in k)(C||Ze(CF,T))&&(l[T]=k[T])}l.$sdk_debug_retry_queue_size=(d=this.zu)===null||d===void 0?void 0:d.length}catch(k){l.$sdk_debug_error_capturing_properties=String(k)}let f;if(this.requestRouter.region===E2&&(l.$lib_custom_api_host=this.config.api_host),f=e!=="$pageview"||i?e!=="$pageleave"||i?this.pageViewManager.doEvent():this.pageViewManager.doPageLeave(r):this.pageViewManager.doPageView(r,s),l=Wt(l,f),e==="$pageview"&&de&&(l.title=de.title),!ce(o)){const k=r.getTime()-o;l.$duration=parseFloat((k/1e3).toFixed(3))}Or&&this.config.opt_out_useragent_filter&&(l.$browser_type=this._is_bot()?"bot":"browser");const p=this.persistence.properties(),g=this.sessionPersistence.properties(),v=l.$groups,w=p.$groups;dt(v)&&!Kr(v)&&(l.$groups=H(H({},dt(w)?w:{}),v)),Mt(["$referrer","$referring_domain"],k=>{k in p&&delete g[k]});const _={};if(this.Ru.length>0)for(const k of this.Ru.slice())try{Wt(_,k())}catch(C){ve.error("Failed to produce browser extension event properties",C)}l=Wt({},u,p,g,H(H({},_),l)),l.$is_identified=this._isIdentified(),We(this.config.property_denylist)?Mt(this.config.property_denylist,function(k){delete l[k]}):ve.error(QT+this.config.property_denylist+" or property_blacklist config: "+this.config.property_blacklist);const x=this.config.sanitize_properties;x&&(ve.error(lk),l=x(l,e));const S=this._h();return l.$process_person_profile=S,S&&!i&&this.wh("_calculate_event_properties"),l}mh(e,n=!0,r=!1){var s;if(!this.persistence||!this._h()||this.Mu&&!r)return e;const i=this.persistence.get_initial_props(),o=(s=this.sessionPropsManager)===null||s===void 0?void 0:s.getSetOnceProps();let l=Wt({},i,o||{},e||{});const u=this.config.sanitize_properties;return u&&(ve.error(lk),l=u(l,"$set_once")),n&&(this.Mu=!0),Kr(l)?void 0:l}register(e,n){var r;(r=this.persistence)===null||r===void 0||r.register(e,n)}register_once(e,n,r){var s;(s=this.persistence)===null||s===void 0||s.register_once(e,n,r)}register_for_session(e){var n,r;(n=this.persistence)===null||n===void 0||n.syncCookieProperties(),this.yh(),(r=this.sessionPersistence)===null||r===void 0||r.register(e),Object.keys(e).forEach(s=>this.Eu.add(s)),this.bh()}unregister(e){var n;(n=this.persistence)===null||n===void 0||n.unregister(e)}unregister_for_session(e){var n;(n=this.sessionPersistence)===null||n===void 0||n.unregister(e),this.Eu.delete(e),this.bh()}kh(e,n){this.register({[e]:n})}Uu(){this.Eu.forEach(e=>{var n;(n=this.sessionPersistence)===null||n===void 0||n.unregister(e)}),this.Eu.clear(),this.bh()}bh(){var e;if(!this.Pu)return;if(this.config.persistence==="memory"||!((e=this.sessionPersistence)===null||e===void 0)&&e.hi||!zt.Et())return void zt.Pt(this.Pu);const n=[];this.Eu.forEach(r=>n.push(r)),n.length>0?zt.$t(this.Pu,n):zt.Pt(this.Pu)}getFeatureFlag(e,n){var r;return(r=this.featureFlags)===null||r===void 0?void 0:r.getFeatureFlag(e,n)}getFeatureFlagPayload(e){var n;return(n=this.featureFlags)===null||n===void 0?void 0:n.getFeatureFlagPayload(e)}getFeatureFlagResult(e,n){var r;return(r=this.featureFlags)===null||r===void 0?void 0:r.getFeatureFlagResult(e,n)}getAllFeatureFlags(){var e,n;return(e=(n=this.featureFlags)===null||n===void 0?void 0:n.getAllFeatureFlags())!==null&&e!==void 0?e:[]}isFeatureEnabled(e,n){var r,s;return(r=(s=this.featureFlags)===null||s===void 0?void 0:s.isFeatureEnabled(e,n))!==null&&r!==void 0?r:n==null?void 0:n.defaultValue}reloadFeatureFlags(){var e;(e=this.featureFlags)===null||e===void 0||e.reloadFeatureFlags()}updateFlags(e,n,r){var s;(s=this.featureFlags)===null||s===void 0||s.updateFlags(e,n,r)}updateEarlyAccessFeatureEnrollment(e,n,r){var s;(s=this.featureFlags)===null||s===void 0||s.updateEarlyAccessFeatureEnrollment(e,n,r)}getEarlyAccessFeatures(e,n=!1,r){var s;return(s=this.featureFlags)===null||s===void 0?void 0:s.getEarlyAccessFeatures(e,n,r)}on(e,n){return this.du.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:au}),()=>{})}onSessionId(e){var n,r;return(n=(r=this.sessionManager)===null||r===void 0?void 0:r.onSessionId(e))!==null&&n!==void 0?n:()=>{}}getSurveys(e,n=!1){this.surveys?this.surveys.getSurveys(e,n):e([],{isLoaded:!1,error:au})}getActiveMatchingSurveys(e,n=!1){this.surveys?this.surveys.getActiveMatchingSurveys(e,n):e([],{isLoaded:!1,error:au})}onActiveMatchingSurveysChanged(e){return this.surveys?this.surveys.onActiveMatchingSurveysChanged(e):(e([],{isLoaded:!1,error:au}),()=>{})}renderSurvey(e,n){var r;(r=this.surveys)===null||r===void 0||r.renderSurvey(e,n)}displaySurvey(e,n=_F){var r;(r=this.surveys)===null||r===void 0||r.displaySurvey(e,n)}cancelPendingSurvey(e){var n;(n=this.surveys)===null||n===void 0||n.cancelPendingSurvey(e)}canRenderSurvey(e){var n,r;return(n=(r=this.surveys)===null||r===void 0?void 0:r.canRenderSurvey(e))!==null&&n!==void 0?n:{visible:!1,disabledReason:au}}canRenderSurveyAsync(e,n=!1){var r,s;return(r=(s=this.surveys)===null||s===void 0?void 0:s.canRenderSurveyAsync(e,n))!==null&&r!==void 0?r:Promise.resolve({visible:!1,disabledReason:au})}Sh(e){return!e||If(e)?(ve.critical("Unique user id has not been set in posthog.identify"),!1):e==="$posthog_cookieless"?(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(mn(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.Sh(e)||!this.wh("posthog.identify"))return;this.ku();const s=this.get_distinct_id(),i=this.persistence.syncCookieProperties()&&this.get_distinct_id()!==s,o=this.yh(!1),l=this.persistence.Fa();let u=!1;try{const f=this.get_distinct_id();this.register({$user_id:e}),this.get_property("$device_id")||this.register_once({$had_persisted_distinct_id:!0,$device_id:f},""),e!==f&&e!==this.get_property("__alias")&&(this.unregister(Om),this.register({distinct_id:e}));const p=(this.persistence.get_property("$user_state")||"anonymous")===Oo,g=e!==f,v=!g&&p;if(g&&p){var d;const w=this.config.reuseAnonymousId?{distinct_id:e}:{distinct_id:e,$anon_distinct_id:f};this.persistence.set_property(Lr,X0),this.setPersonPropertiesForFlags({$set:n||{},$set_once:r||{}},!1),this.config.cookieWinsOnConflict&&this.persistence.Da(),this.capture("$identify",w,{$set:n||{},$set_once:r||{}})&&(this.Lu=ky(e,n,r)),(d=this.featureFlags)===null||d===void 0||d.setAnonymousDistinctId(this.config.reuseAnonymousId?void 0:f)}else if(v){this.persistence.set_property(Lr,X0);const w=n||{},_=r||{};this.setPersonPropertiesForFlags({$set:w,$set_once:_},!1),this.config.cookieWinsOnConflict&&this.persistence.Da(),this.capture("$set",{$set:w,$set_once:_})&&(this.Lu=ky(e,n,r))}else(n||r)&&this.setPersonProperties(n,r);g||i||o?(this.reloadFeatureFlags(),this.featureFlags?this.featureFlags.resetFlagCallReported():this.unregister(Oa)):v&&(n||r)&&this.reloadFeatureFlags(),u=!0}finally{l&&this.persistence.qa(u)}}setPersonProperties(e,n){if(!e&&!n||!this.wh("posthog.setPersonProperties"))return;const r=ky(this.get_distinct_id(),e,n);this.Lu!==r?(this.setPersonPropertiesForFlags({$set:e||{},$set_once:n||{}},!0),this.capture("$set",{$set:e||{},$set_once:n||{}})&&(this.Lu=r)):ve.info("A duplicate setPersonProperties call was made with the same properties. It has been ignored.")}unsetPersonProperties(e){var n;const r=(We(e)?e:[e]).filter(s=>lt(s)&&s.length>0);r.length!==0&&this.wh("posthog.unsetPersonProperties")&&((n=this.featureFlags)===null||n===void 0||n.unsetPersonPropertiesForFlags(r,!0),this.capture("$set",{$unset:r}),this.Lu=null)}group(e,n,r){var s;if(!e||!n)return void ve.error("posthog.group requires a group type and group key");(s=this.persistence)===null||s===void 0||s.syncCookieProperties(),this.yh();const i=this.getGroups(),o=i[e]!==n;if(o&&this.resetGroupPropertiesForFlags(e),this.register({$groups:H(H({},i),{},{[e]:n})}),(o||r)&&this._h()){const l={$group_type:e,$group_key:n};r&&(l.$group_set=r),this.capture(R8,l)}r&&this.setGroupPropertiesForFlags({[e]:r}),o&&!r&&this.reloadFeatureFlags()}resetGroups(){this.register({$groups:{}}),this.resetGroupPropertiesForFlags(),this.reloadFeatureFlags()}setPersonPropertiesForFlags(e,n=!0){var r;(r=this.featureFlags)===null||r===void 0||r.setPersonPropertiesForFlags(e,n)}resetPersonPropertiesForFlags(e=!0){var n;(n=this.featureFlags)===null||n===void 0||n.resetPersonPropertiesForFlags(e)}setGroupPropertiesForFlags(e,n=!0){var r;this.wh("posthog.setGroupPropertiesForFlags")&&((r=this.featureFlags)===null||r===void 0||r.setGroupPropertiesForFlags(e,n))}resetGroupPropertiesForFlags(e){var n;(n=this.featureFlags)===null||n===void 0||n.resetGroupPropertiesForFlags(e)}reset(e){const n=Nr(e)?e:e==null?void 0:e.resetDeviceID,r=Nr(e)||e==null?void 0:e.bootstrap;this.xh(n,!1,r)}xh(e,n=!1,r){var s,i,o,l,u,d;if(ve.info("reset"),!this.__loaded)return ve.uninitializedWarning("posthog.reset");const f=r==null?void 0:r.sessionID;this.config.bootstrap=r||((s=this.qu)===null||s===void 0?void 0:s.bootstrap)||{},(i=this.featureFlags)===null||i===void 0||(o=i.updateConfig)===null||o===void 0||o.call(i,this.config,this.il());const p=this.get_property(xx),g=this.get_property(ly),v=this.get_property(Nf);(l=this.sessionRecording)===null||l===void 0||l.flushBeforeIdentityReset();const w=this.is_capturing();n||this.consent.reset(),n||!w||this.is_capturing()||console.warn("[PostHog.js]","reset() cleared the stored consent, and capturing is now off because of `opt_out_capturing_by_default`. Call opt_in_capturing() again, and prefer calling reset() before opting in rather than after.");const _=(u=this.persistence)===null||u===void 0||(d=u.Fa)===null||d===void 0?void 0:d.call(u),x=this.Su;this.Su=x||n;let S=!1;try{var k,C,T,A,I,M,R,O,N,D,$,Y,B;if((k=this.persistence)===null||k===void 0||k.clear(),(C=this.sessionPersistence)===null||C===void 0||C.clear(),this.Eu.clear(),this.bh(),ce(v)||(D=this.persistence)===null||D===void 0||D.register({$session_recording_remote_config:v}),(T=this.surveys)===null||T===void 0||T.reset(),(A=this.featureFlags)===null||A===void 0||A.reset(),(I=this.conversations)===null||I===void 0||I.reset(),(M=this.logs)===null||M===void 0||M.reset(),(R=this.metrics)===null||R===void 0||R.reset(),(O=this.persistence)===null||O===void 0||O.set_property("$user_state","anonymous"),(N=this.sessionManager)===null||N===void 0||N.resetSessionId(),this.Lu=null,this.config.cookieless_mode==="always")this.register_once({distinct_id:cy,$device_id:null},"");else{const K=this.config.get_device_id(yi());this.register_once({distinct_id:K,$device_id:e?K:p},""),e||ce(g)||this.register({[ly]:g})}if(this.register({$last_posthog_reset:new Date().toISOString()},1),r&&(r.distinctID&&!this.yu()&&((B=this.persistence)===null||B===void 0||B.set_property("$user_state",r.isIdentifiedID?"identified":"anonymous"),this.register({distinct_id:r.distinctID})),($=this.featureFlags)===null||$===void 0||$.initialize(),!Qe(f)&&!(!((Y=this.sessionManager)===null||Y===void 0)&&Y.setBootstrapSessionId(f,!0)))){const K=H({},r);delete K.sessionID,this.config.bootstrap=K}delete this.config.identity_distinct_id,delete this.config.identity_hash,delete this.config.identity_claims,S=!0}finally{var G,V;this.Su=x,_&&((G=this.persistence)===null||G===void 0||(V=G.qa)===null||V===void 0||V.call(G,S))}this.reloadFeatureFlags()}shutdown(e){var n=this;return Gt(function*(){var r,s,i,o,l,u,d,f;if(n.__loaded){n.Iu=!0,n.Zu().dispose(),(r=n.sessionRecording)===null||r===void 0||r.dispose(),(s=n.logs)===null||s===void 0||s.flushLogs("sendBeacon"),(i=n.metrics)===null||i===void 0||i.flush("sendBeacon"),(o=n.metrics)===null||o===void 0||o.dispose(),(l=n.Bu)===null||l===void 0||l.unload(),(u=n.zu)===null||u===void 0||u.unload();try{var p;(p=n.featureFlags)===null||p===void 0||p.destroy()}catch(g){ve.error("Error while destroying feature flags",g)}(d=n.persistence)===null||d===void 0||d.destroy(),(f=n.sessionPersistence)===null||f===void 0||f.destroy()}else ve.uninitializedWarning("posthog.shutdown")})()}setIdentity(e,n){var r;delete this.config.identity_claims,this.config.identity_distinct_id=e,this.config.identity_hash=n,this.alias(e),(r=this.conversations)===null||r===void 0||r.$h()}clearIdentity(){var e;delete this.config.identity_distinct_id,delete this.config.identity_hash,delete this.config.identity_claims,(e=this.conversations)===null||e===void 0||e.Ch()}get_distinct_id(){return this.get_property("distinct_id")}getGroups(){return this.get_property("$groups")||{}}get_session_id(){var e,n;return(e=(n=this.sessionManager)===null||n===void 0?void 0:n.checkAndGetSessionAndWindowId(!0).sessionId)!==null&&e!==void 0?e:""}get_session_replay_url(e){if(!this.sessionManager)return"";const{sessionId:n,sessionStartTimestamp:r}=this.sessionManager.checkAndGetSessionAndWindowId(!0);let s=this.requestRouter.endpointFor("ui",`/project/${this.config.token}/replay/${n}`);if(e!=null&&e.withTimestamp&&r){var i;const o=(i=e.timestampLookBack)!==null&&i!==void 0?i:10;if(!r)return s;s+=`?t=${Math.max(Math.floor((new Date().getTime()-r)/1e3)-o,0)}`}return s}alias(e,n){return e===this.get_property("$people_distinct_id")?(ve.critical("Attempting to create alias for existing People user - aborting."),-2):this.wh("posthog.alias")?(ce(n)&&(n=this.get_distinct_id()),e!==n?(this.kh(Om,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){const n=H({},this.config);if(dt(e)){var r,s,i,o,l,u,d,f,p,g,v,w,_;Wt(this.config,fk(e));const T=this.Cu();if(this.persistence){const I=this.config.persistence==="sessionStorage"||this.config.persistence==="memory";var x,S;if(I&&this.sessionPersistence!==this.persistence&&((x=this.sessionPersistence)===null||x===void 0||x.remove(),(S=this.sessionPersistence)===null||S===void 0||S.destroy()),this.persistence.update_config(this.config,n,T),I)this.sessionPersistence=this.persistence;else if(this.sessionPersistence===this.persistence)this.sessionPersistence=new vy(H(H({},this.config),{},{persistence:"sessionStorage"}),T,!1);else{var k;(k=this.sessionPersistence)===null||k===void 0||k.update_config(H(H({},this.config),{},{persistence:"sessionStorage"}),H(H({},n),{},{persistence:"sessionStorage"}),T)}}const A=this.Nu(this.config.debug);var C;Nr(A)&&(this.config.debug=A),Nr(this.config.debug)&&(this.config.debug?(zn.DEBUG=!0,yt.Et()&&yt.$t("ph_debug",!0),ve.info("set_config",{config:e,oldConfig:n,newConfig:H({},this.config)})):(zn.DEBUG=!1,yt.Et()&&yt.Pt("ph_debug"))),(r=this.featureFlags)===null||r===void 0||(s=r.updateConfig)===null||s===void 0||s.call(r,this.config,this.il()),(i=this.exceptionObserver)===null||i===void 0||i.onConfigChange(),(o=this.exceptions)===null||o===void 0||o.onConfigChange(),(l=this.metrics)===null||l===void 0||l.onConfigChange(),(u=this.sessionRecording)===null||u===void 0||u.startIfEnabledOrStop(),(d=this.tracingHeaders)===null||d===void 0||d.startIfEnabledOrStop(),(f=this.autocapture)===null||f===void 0||f.startIfEnabled(),(p=this.heatmaps)===null||p===void 0||p.startIfEnabled(),("capture_pageview"in e||"disable_capture_url_hashes"in e)&&((C=this.historyAutocapture)===null||C===void 0||C.startIfEnabledOrStop()),(g=this.exceptionObserver)===null||g===void 0||g.startIfEnabledOrStop(),(v=this.deadClicksAutocapture)===null||v===void 0||v.startIfEnabledOrStop(),(w=this.surveys)===null||w===void 0||w.loadIfEnabled(),this.xu(),(_=this.externalIntegrations)===null||_===void 0||_.startIfEnabledOrStop(),!n.segment&&this.config.segment&&this.persistence&&Z8(this,zf,!1)}}_overrideSDKInfo(e,n){zn.LIB_NAME=e,zn.LIB_VERSION=n}startSessionRecording(e){const n=e===!0,r={sampling:n||!!(e!=null&&e.sampling),linked_flag:n||!!(e!=null&&e.linked_flag),url_trigger:n||!!(e!=null&&e.url_trigger),event_trigger:n||!!(e!=null&&e.event_trigger)};var s,i,o,l,u;Object.values(r).some(Boolean)&&((s=this.sessionManager)===null||s===void 0||s.checkAndGetSessionAndWindowId(),r.sampling&&((i=this.sessionRecording)===null||i===void 0||i.overrideSampling()),r.linked_flag&&((o=this.sessionRecording)===null||o===void 0||o.overrideLinkedFlag()),r.url_trigger&&((l=this.sessionRecording)===null||l===void 0||l.overrideTrigger("url")),r.event_trigger&&((u=this.sessionRecording)===null||u===void 0||u.overrideTrigger("event"))),this.set_config({disable_session_recording:!1})}stopSessionRecording(){this.set_config({disable_session_recording:!0})}sessionRecordingStarted(){var e;return!!(!((e=this.sessionRecording)===null||e===void 0)&&e.started)}captureException(e,n){try{if(!this.exceptions)return;const r=this.exceptions.buildProperties(e,{handled:!0,syntheticException:new Error("PostHog syntheticException")});return this.exceptions.sendExceptionEvent(H(H({},r),n))}catch{return}}addExceptionStep(e,n){var r;(r=this.exceptions)===null||r===void 0||r.addExceptionStep(e,n)}captureLog(e){var n;(n=this.logs)===null||n===void 0||n.captureLog(e)}get logger(){var e,n;return(e=(n=this.logs)===null||n===void 0?void 0:n.logger)!==null&&e!==void 0?e:wa.Th}startExceptionAutocapture(e){this.set_config({capture_exceptions:e==null||e})}stopExceptionAutocapture(){this.set_config({capture_exceptions:!1})}loadToolbar(e){var n,r;return(n=(r=this.toolbar)===null||r===void 0?void 0:r.loadToolbar(e))!==null&&n!==void 0&&n}get_property(e){var n;return(n=this.persistence)===null||n===void 0?void 0:n.props[e]}getSessionProperty(e){var n;return(n=this.sessionPersistence)===null||n===void 0?void 0:n.props[e]}toString(){var e;let n=(e=this.config.name)!==null&&e!==void 0?e:Cf;return n!==Cf&&(n="posthog."+n),n}_isIdentified(){var e,n;return((e=this.persistence)===null||e===void 0?void 0:e.get_property("$user_state"))==="identified"||((n=this.sessionPersistence)===null||n===void 0?void 0:n.get_property("$user_state"))==="identified"}_h(){var e,n;return!(this.config.person_profiles==="never"||this.config.person_profiles==="identified_only"&&!this._isIdentified()&&Kr(this.getGroups())&&!(!((e=this.persistence)===null||e===void 0||(e=e.props)===null||e===void 0)&&e.__alias)&&!(!((n=this.persistence)===null||n===void 0||(n=n.props)===null||n===void 0)&&n.$epp))}sh(){return this.config.capture_pageleave===!0||this.config.capture_pageleave==="if_capture_pageview"&&!!this.config.capture_pageview}createPersonProfile(){this._h()||this.wh("posthog.createPersonProfile")&&this.setPersonProperties({},{})}setInternalOrTestUser(){this.wh("posthog.setInternalOrTestUser")&&this.setPersonProperties({$internal_or_test_user:!0})}wh(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.bu(),this.kh(kx,!0),!0)}Cu(){if(this.config.cookieless_mode==="always")return!0;const e=this.consent.isOptedOut();return this.config.disable_persistence||e&&!(!this.config.opt_out_persistence_by_default&&this.config.cookieless_mode!=="on_reject")}xu(){var e,n;const r=this.Cu();var s,i,o;return this.is_capturing()||(s=this.logs)===null||s===void 0||s.Ih(),((e=this.persistence)===null||e===void 0?void 0:e.hi)!==r&&((i=this.persistence)===null||i===void 0||i.set_disabled(r)),((n=this.sessionPersistence)===null||n===void 0?void 0:n.hi)!==r&&((o=this.sessionPersistence)===null||o===void 0||o.set_disabled(r)),this.bh(),r}opt_in_capturing(e){var n;if(this.config.cookieless_mode!=="always"){if(this.yu()){var r,s,i,o,l,u;(r=this.sessionRecording)===null||r===void 0||r.dispose({discardBufferedEvents:!0}),this.xh(!0,!0),(s=this.sessionManager)===null||s===void 0||s.destroy(),(i=this.pageViewManager)===null||i===void 0||i.destroy(),this.sessionManager=new sk(this),this.pageViewManager=new W8(this),this.persistence&&(this.sessionPropsManager=new nk(this,this.sessionManager,this.persistence));const v=(o=(l=this.config.__extensionClasses)===null||l===void 0?void 0:l.sessionRecording)!==null&&o!==void 0?o:(u=wa.__defaultExtensionClasses)===null||u===void 0?void 0:u.sessionRecording;var d,f;v&&(this.sessionRecording=this.mu(this.sessionRecording,new v(this)),this.cu&&((d=this.sessionRecording)===null||d===void 0||(f=d.onRemoteConfig)===null||f===void 0||f.call(d,this.cu)))}var p,g;this.consent.optInOut(!0),this.xu(),this.eh(),(n=this.sessionRecording)===null||n===void 0||n.startIfEnabledOrStop(),this.config.cookieless_mode=="on_reject"&&((p=this.surveys)===null||p===void 0||p.loadIfEnabled()),(ce(e==null?void 0:e.captureEventName)||e!=null&&e.captureEventName)&&this.capture((g=e==null?void 0:e.captureEventName)!==null&&g!==void 0?g:"$opt_in",e==null?void 0:e.captureProperties,{send_instantly:!0}),this.config.capture_pageview&&this.ih()}else ve.warn(ak)}opt_out_capturing(){this.config.cookieless_mode!=="always"?(this.consent.optInOut(!1),this.xu(),this.config.cookieless_mode==="on_reject"&&this.$u()):ve.warn(ak)}$u(){var e,n;const r=this.sessionRecording;r==null||r.dispose({discardBufferedEvents:!0}),this.get_distinct_id()!=="$posthog_cookieless"&&this.xh(!0,!0),this.register({distinct_id:cy,$device_id:null}),this.gu(r),this.sessionRecording=void 0,(e=this.sessionManager)===null||e===void 0||e.destroy(),(n=this.pageViewManager)===null||n===void 0||n.destroy(),this.sessionManager=void 0,this.sessionPropsManager=void 0,this.config.capture_pageview&&this.ih(),this.eh()}has_opted_in_capturing(){return this.consent.isOptedIn()}has_opted_out_capturing(){return this.consent.isOptedOut()}get_explicit_consent_status(){const e=this.consent.consent;return e===1?"granted":e===0?"denied":"pending"}is_capturing(){return!this.Su&&(this.config.cookieless_mode==="always"||(this.config.cookieless_mode==="on_reject"?this.consent.isRejected()||this.consent.isOptedIn():!this.has_opted_out_capturing()))}clear_opt_in_out_capturing(){this.consent.reset(),this.xu()}_is_bot(){return Xn?WT(Xn,this.config.custom_blocked_useragents):void 0}ih(){de&&(de.visibilityState==="visible"?this.Ou||(this.Ou=!0,this.capture(Tx,{title:de.title},{send_instantly:!0}),this.Fu&&(de.removeEventListener(oh,this.Fu),this.Fu=null)):this.Fu||(this.Fu=this.ih.bind(this),kt(de,oh,this.Fu)))}debug(e){e===!1?(J==null||J.console.log("You've disabled debug mode."),this.set_config({debug:!1})):(J==null||J.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}))}il(){const e=this.qu||{};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,o){const l=r in n&&!Qe(n[r]),u=s in n&&!Qe(n[s]);return l?n[r]:!!u&&(o&&o.warn(`Config field '${s}' is deprecated. Please use '${r}' instead. The old field will be removed in a future major version.`),n[s])})(e,"advanced_disable_flags","advanced_disable_decide",0,ve)}Fs(e){var n;if(Qe(this.config.before_send))return e;const r=Object.keys((n=e.properties)!==null&&n!==void 0?n:{}).filter(rj),s=We(this.config.before_send)?this.config.before_send:[this.config.before_send];let i=e;for(const o of s)try{if(i=o(i),Qe(i)){const l=`Event '${e.event}' was rejected in beforeSend function`;return nj(e.event)?ve.warn(`${l}. This can cause unexpected behavior.`):ve.info(l),null}i.properties&&!Kr(i.properties)||ve.warn(`Event '${e.event}' has no properties after beforeSend function, this is likely an error.`)}catch(l){return ve.error(`Error in beforeSend function for event '${e.event}':`,l),null}for(const o of r)if(i.properties&&Qe(i.properties[o]))return ve.warn(`Event '${e.event}' had its '${o}' property removed in a beforeSend function. This property is required for ingestion, so the event will be dropped.`),null;return i}getPageViewId(){var e;return(e=this.pageViewManager.Wo)===null||e===void 0?void 0:e.pageViewId}captureTraceFeedback(e,n){this.capture("$ai_feedback",{$ai_trace_id:String(e),$ai_feedback_text:n})}captureTraceMetric(e,n,r){this.capture("$ai_metric",{$ai_trace_id:String(e),$ai_metric_name:n,$ai_metric_value:String(r)})}Nu(e){const n=Nr(e)&&!e,r=yt.Et()&&yt.Ot("ph_debug")==="true";return!n&&(!!r||e)}};Uf.__defaultExtensionClasses={},Uf.Th=(()=>{const t=()=>{};return{trace:t,debug:t,info:t,warn:t,error:t,fatal:t}})(),(function(t,e){for(let n=0;e.length>n;n++)t.prototype[e[n]]=E$(t.prototype[e[n]])})(Uf,["identify"]);var JT=class{constructor(t){this.disabled=t===!1;const e=dt(t)?t:{};this.thresholdPx=e.threshold_px||30,this.timeoutMs=e.timeout_ms||1e3,this.clickCount=e.click_count||3,this.clicks=[]}isRageClick(t,e,n){if(this.disabled)return!1;const r=this.clicks[this.clicks.length-1];if(r&&Math.abs(t-r.x)+Math.abs(e-r.y)<this.thresholdPx&&this.timeoutMs>n-r.timestamp){if(this.clicks.push({x:t,y:e,timestamp:n}),this.clicks.length===this.clickCount)return!0}else this.clicks=[{x:t,y:e,timestamp:n}];return!1}};const Py="$copy_autocapture",Ty=dn("[AutoCapture]");function Ay(t,e){return e.length>t?e.slice(0,t)+"...":e}function OF(t){if(t.previousElementSibling)return t.previousElementSibling;let e=t;do e=e.previousSibling;while(e&&!Ki(e));return e}function LF(t,{e,maskAllElementAttributes:n,maskAllText:r,elementAttributeIgnoreList:s,elementsChainAsString:i,disableCaptureUrlHashes:o}){var l,u;if(!Ki(t))return{props:{}};const d=[t],f=new Set([t]);let p=t;for(;p.parentNode&&!pr(p,"body")&&1e3>d.length;){if(Rx(p.parentNode)){const I=p.parentNode.host;if(f.has(I))break;f.add(I),d.push(I),p=I;continue}if(!Ki(p.parentNode)||f.has(p.parentNode))break;f.add(p.parentNode),d.push(p.parentNode),p=p.parentNode}const g=e.type==="click"&&t.namespaceURI==="http://www.w3.org/2000/svg"?d.findIndex(I=>pr(I,"button")||pr(I,"a")):-1;g>0&&(r=r||d.slice(0,g+1).some(I=>!Ru(I)||lh(I)));const v=[],w={};let _,x=!1,S=!1;if(Mt(d,I=>{const M=Ru(I);if(pr(I,"a")&&!n&&!(s!=null&&s.includes("href"))){const R=I.getAttribute("href");x=!!(M&&R&&Ff(R))&&(o?Ua(R):R)}Ze(Qu(I),"ph-no-capture")&&(S=!0),v.push((function(R,O,N,D,$=!1){const Y=R.tagName.toLowerCase(),B={tag_name:Y};Ix.indexOf(Y)>-1&&!N&&(B.$el_text=Y.toLowerCase()==="a"||Y.toLowerCase()==="button"?Ay(1024,z8(R)):Ay(1024,ah(R)));const G=Qu(R);O||D!=null&&D.includes("class")||0>=G.length||(B.classes=G.filter(function(ee){return ee!==""})),Mt(R.attributes,function(ee){var Z;if((!lh(R)||["name","id","class","aria-label"].indexOf(ee.name)!==-1)&&!(D!=null&&D.includes(ee.name))&&!O&&Ff(ee.value)&&(!lt(Z=ee.name)||Z.substring(0,10)!=="_ngcontent"&&Z.substring(0,7)!=="_nghost")){let j=ee.value;ee.name==="class"&&(j=Mx(j).join(" ")),B["attr__"+ee.name]=Ay(1024,ee.name==="href"&&$?Ua(j):j)}});let V=1,K=1,U=R;for(;U=OF(U);)V++,U.tagName===R.tagName&&K++;return B.nth_child=V,B.nth_of_type=K,B})(I,n,r,s,o)),Mt((function(R){if(!Ru(R))return{};const O={};return Mt(R.attributes,function(N){if(N.name&&N.name.indexOf("data-ph-capture-attribute")===0){const D=N.name.replace("data-ph-capture-attribute-",""),$=N.value;D&&$&&Ff($)&&(O[D]=$)}}),O})(I),(R,O)=>{({}).hasOwnProperty.call(w,O)||(w[O]=R)})}),S)return{props:{},explicitNoCapture:S};if(g>0&&(t=d[g],v.splice(0,g)),r||(v[0].$el_text=pr(t,"a")||pr(t,"button")?z8(t):ah(t)),x){var k,C;v[0].attr__href=x;const I=(k=Ho(x))===null||k===void 0?void 0:k.host,M=J==null||(C=J.location)===null||C===void 0?void 0:C.host;I&&M&&I!==M&&(_=x)}return{props:Wt((A=e.type,{$event_type:A,$ce_version:1}),i?{}:{$elements:v},{$elements_chain:(T=v,We(T)?(function(I){return I.map(M=>{var R,O;let N="";if(M.tag_name&&(N+=M.tag_name),M.attr_class){M.attr_class.sort();for(const Y of M.attr_class)N+=`.${Y.replace(/"/g,"")}`}const D=H(H(H(H({},M.text?{text:M.text}:{}),{},{"nth-child":(R=M.nth_child)!==null&&R!==void 0?R:0,"nth-of-type":(O=M.nth_of_type)!==null&&O!==void 0?O:0},M.href?{href:M.href}:{}),M.attr_id?{attr_id:M.attr_id}:{}),M.attributes),$={};return Q0(D).sort(([Y],[B])=>(function(G,V){return V>G?-1:G>V?1:0})(Y,B)).forEach(([Y,B])=>$[U8(Y.toString())]=U8(B.toString())),N+=":",N+=Q0($).map(([Y,B])=>`${Y}="${B}"`).join(""),N}).join(";")})((function(I){return I.map(M=>{var R,O;const N={text:(R=M.$el_text)===null||R===void 0?void 0:R.slice(0,400),tag_name:M.tag_name,href:(O=M.attr__href)===null||O===void 0?void 0:O.slice(0,2048),attr_class:V$(M),attr_id:M.attr__id,nth_child:M.nth_child,nth_of_type:M.nth_of_type,attributes:{}};return Q0(M).filter(([D])=>D.indexOf("attr__")===0).forEach(([D,$])=>N.attributes[D]=$),N})})(T)):"")},!((l=v[0])===null||l===void 0)&&l.$el_text?{$el_text:(u=v[0])===null||u===void 0?void 0:u.$el_text}:{},_&&e.type==="click"?{$external_click_url:_}:{},w),target:t};var T,A}var NF=class{do(){this.vo=void 0,clearTimeout(this.fo),this.fo=void 0}po(t){var e;if(!Ru(t))return!0;const n=(e=this.mo().css_selector_ignorelist)!==null&&e!==void 0?e:my,r=new Set;let s=t;for(;s;){if(r.size>=1e3||r.has(s))return!0;r.add(s);const i=s,o=Qu(i);if(Ze(o,"ph-no-capture")||Ze(o,"ph-sensitive")||lh(i)||n.some(u=>y2(i,u)))return!0;const l=s.parentNode;s=Rx(l)?l.host:l&&Ki(l)?l:null}return!1}yo(t){if(!this.isEnabled||t.type==="pointercancel")return void this.do();if(t.type==="pointerdown"){this.do();const r=$f(t);var e;return void(t.isPrimary&&t.button===0&&!t.ctrlKey&&r&&Ki(r)&&(this.vo={target:r,excluded:this.po(r),id:t.pointerId,x:t.clientX,y:t.clientY,released:!1,distinctId:(e=this.bo)===null||e===void 0?void 0:e.distinctId}))}const n=this.vo;n&&(t.pointerId!==n.id||Math.abs(t.clientX-n.x)>5||Math.abs(t.clientY-n.y)>5?this.do():t.type==="pointerup"&&(n.released=!0,this.fo=setTimeout(()=>this.do(),0)))}_o(t){var e;const n=this.vo;this.do();const r=$f(t);if(n!=null&&n.released&&n.target.isConnected&&n.distinctId===((e=this.bo)===null||e===void 0?void 0:e.distinctId)&&t.pointerId===n.id&&(t.detail>0||t.pointerType==="touch"||t.pointerType==="pen")&&t.button===0&&5>=Math.abs(t.clientX-n.x)&&5>=Math.abs(t.clientY-n.y)&&r&&(pr(r,"html")||pr(r,"body"))){var s;if(n.excluded)return null;const i=(s=this.mo().css_selector_ignorelist)!==null&&s!==void 0?s:my;return[r,de==null?void 0:de.documentElement,de==null?void 0:de.body].some(o=>{if(!o)return!1;const l=Qu(o);return Ze(l,"ph-no-capture")||Ze(l,"ph-sensitive")||!Ru(o)||lh(o)||i.some(u=>y2(o,u))})?null:n.target}}constructor(t){this.wo=t,this.name="autocapture",this.ko=!1,this.So=null,this.xo=!1,this.$o=new Map,this.Co=!1,this.Mr={enabled:!1,rageclick:!1,maskAllElementAttributes:!1,maskAllText:!1,disableCaptureUrlHashes:!1,remoteRequestsDisabled:!1},this.To=!1,this.wo.refresh(this.Mr),this.rageclicks=new JT(this.Mr.rageclick),this.Io=null}setup(t){this.Mo(),this.bo=t;const e=t.onRemoteConfig(this.onRemoteConfig.bind(this));this.To?e.dispose():(this.Eo=e,this.startIfEnabled())}dispose(){var t;this.To||(this.To=!0,this.bo=void 0,(t=this.Eo)===null||t===void 0||t.dispose(),this.Eo=void 0,this.$o.clear(),this.Io=null,this.Po())}mo(){return this.wo.refresh(this.Mr),this.Mr}Mo(){var t,e;return this.mo(),this.Mr.url_allowlist=(t=this.Mr.url_allowlist)===null||t===void 0?void 0:t.map(n=>new RegExp(n)),this.Mr.url_ignorelist=(e=this.Mr.url_ignorelist)===null||e===void 0?void 0:e.map(n=>new RegExp(n)),this.Mr}Ro(){if(!this.isBrowserSupported())return void Ty.info("Disabling Automatic Event Collection because this browser is not supported");if(!J||!de)return;const t=this.Ao=e=>{e=e||(J==null?void 0:J.event);try{if(e.type==="blur")return void this.do();if(e.type.indexOf("pointer")===0)return void this.yo(e);const n=e.type==="click"?this._o(e):void 0;if(cn(n))return;this.Oo(e,"$autocapture",n)}catch(n){Ty.error("Failed to capture event",n)}};if(kt(J,"blur",t),kt(de,"submit",t,{capture:!0}),kt(de,"change",t,{capture:!0}),kt(de,"click",t,{capture:!0}),Mt(["pointerdown","pointermove","pointerup","pointercancel"],e=>{kt(de,e,t,{capture:!0})}),this.mo().capture_copied_text){const e=this.Fo=n=>{n=n||(J==null?void 0:J.event);try{this.Oo(n,Py)}catch(r){Ty.error("Failed to capture clipboard event",r)}};kt(de,"copy",e,{capture:!0}),kt(de,"cut",e,{capture:!0}),kt(de,"paste",e,{capture:!0})}}Po(){this.do(),this.Ao&&(J==null||J.removeEventListener("blur",this.Ao),Mt(["pointerdown","pointermove","pointerup","pointercancel"],t=>{de==null||de.removeEventListener(t,this.Ao,!0)}),de==null||de.removeEventListener("submit",this.Ao,!0),de==null||de.removeEventListener("change",this.Ao,!0),de==null||de.removeEventListener("click",this.Ao,!0),this.Ao=void 0),this.Fo&&(de==null||de.removeEventListener("copy",this.Fo,!0),de==null||de.removeEventListener("cut",this.Fo,!0),de==null||de.removeEventListener("paste",this.Fo,!0),this.Fo=void 0),this.ko=!1}startIfEnabled(){this.isEnabled||this.do(),!this.To&&this.bo&&this.isEnabled&&!this.ko&&(this.Ro(),this.ko=!0)}onRemoteConfig(t){if(this.To)return;if(this.xo=!0,!t.ok)return void this.startIfEnabled();const e=t.config;e.elementsChainAsString&&(this.Co=e.elementsChainAsString);const n=e.autocapture_opt_out;var r;Nr(n)&&((r=this.bo)===null||r===void 0||r.kv.set("$autocapture_disabled_server_side",n),this.So=n),this.startIfEnabled()}setElementSelectors(t,e=this){if(this.To)return;t.size?this.$o.set(e,new Set(t)):this.$o.delete(e);const n=new Set;this.$o.forEach(r=>{r.forEach(s=>n.add(s))}),this.Io=n}getElementSelectors(t,e){var n;const r=[];return(n=this.Io)===null||n===void 0||n.forEach(s=>{const i=de==null?void 0:de.querySelectorAll(s);i==null||i.forEach(o=>{t!==o&&e!==o||Ze(r,s)||r.push(s)})}),r}get isEnabled(){var t,e;if(this.To)return!1;const n=(t=this.bo)===null||t===void 0?void 0:t.kv.get(D5),r=this.So,s=this.mo();if(!s.remoteRequestsDisabled&&!this.xo)return!1;const i=s.remoteRequestsDisabled&&!this.xo;if(cn(r)&&!Nr(n)&&!i)return!1;const o=(e=this.So)!==null&&e!==void 0?e:!!n;return!!s.enabled&&!o}Oo(t,e="$autocapture",n){if(!this.isEnabled)return void this.do();let r=n||$f(t);cT(r)&&(r=r.parentNode||null);const s=this.Mo();var i;e==="$autocapture"&&t.type==="click"&&t instanceof MouseEvent&&s.rageclick&&(!((i=this.rageclicks)===null||i===void 0)&&i.isRageClick(t.clientX,t.clientY,t.timeStamp||new Date().getTime()))&&hT(r,s.rageclick)&&this.Oo(t,"$rageclick",n);const o=e===Py,l=o?H(H({},s),{},{dom_event_allowlist:void 0}):s;if(r&&(function(p,g,v,w,_,x){var S;if(!J||Ox(p)||v!=null&&v.url_allowlist&&!N8(v.url_allowlist,x)||v!=null&&v.url_ignorelist&&N8(v.url_ignorelist,x))return!1;if(v!=null&&v.dom_event_allowlist){const A=v.dom_event_allowlist;if(A&&!A.some(I=>g.type===I))return!1}const{parentIsUsefulElement:k,targetElementList:C}=pT(p,w);if(!(function(A,I){const M=I==null?void 0:I.element_allowlist;if(ce(M))return!0;for(const R of A)if(M.some(O=>R.tagName.toLowerCase()===O))return!0;return!1})(C,v)||!_2(C,v==null?void 0:v.css_selector_allowlist)||_2(C,(S=v==null?void 0:v.css_selector_ignorelist)!==null&&S!==void 0?S:my))return!1;try{const A=J.getComputedStyle(p);if(A&&A.getPropertyValue("cursor")==="pointer"&&g.type==="click")return!0}catch{}const T=p.tagName.toLowerCase();switch(T){case"html":return!1;case"form":return(_||["submit"]).indexOf(g.type)>=0;case"input":case"select":case"textarea":return(_||["change","click"]).indexOf(g.type)>=0;default:return k?(_||["click"]).indexOf(g.type)>=0:(_||["click"]).indexOf(g.type)>=0&&(Ix.indexOf(T)>-1||p.getAttribute("contenteditable")==="true")}})(r,t,l,o,o?["copy","cut","paste"]:void 0,{config:{get_current_url:s.getCurrentUrl}})){var u;const{props:p,explicitNoCapture:g,target:v}=LF(r,{e:t,maskAllElementAttributes:s.maskAllElementAttributes,maskAllText:s.maskAllText,elementAttributeIgnoreList:s.element_attribute_ignorelist,elementsChainAsString:this.Co,disableCaptureUrlHashes:s.disableCaptureUrlHashes});if(g)return!1;const w=this.getElementSelectors(r,v);if(w&&w.length>0&&(p.$element_selectors=w),e===Py){const _=t.type||"clipboard";if(_!=="paste"){var d,f;const x=J==null||(d=J.getSelection())===null||d===void 0?void 0:d.toString(),S=uT(x);if(!S)return!1;p.$selected_content=S,p.$clipboard_text_length=(f=x==null?void 0:x.length)!==null&&f!==void 0?f:0}p.$copy_type=_}return(u=this.bo)===null||u===void 0||u.capture(e,p),!0}}isBrowserSupported(){return Yn(de==null?void 0:de.querySelectorAll)}},DF=class{constructor(t){this._instance=t}refresh(t){const e=this._instance.config,n=dt(e.autocapture)?e.autocapture:void 0;t.enabled=!!e.autocapture,t.rageclick=e.rageclick,t.maskAllElementAttributes=e.mask_all_element_attributes,t.maskAllText=e.mask_all_text,t.disableCaptureUrlHashes=e.disable_capture_url_hashes,t.getCurrentUrl=e.get_current_url,t.remoteRequestsDisabled=this._instance.il(),t.url_allowlist=n==null?void 0:n.url_allowlist,t.url_ignorelist=n==null?void 0:n.url_ignorelist,t.dom_event_allowlist=n==null?void 0:n.dom_event_allowlist,t.element_allowlist=n==null?void 0:n.element_allowlist,t.css_selector_allowlist=n==null?void 0:n.css_selector_allowlist,t.css_selector_ignorelist=n==null?void 0:n.css_selector_ignorelist,t.element_attribute_ignorelist=n==null?void 0:n.element_attribute_ignorelist,t.capture_copied_text=n==null?void 0:n.capture_copied_text}};const vf=dn("[ExceptionAutocapture]"),hk=()=>{},pk=t=>{var e;if(Yn(t))return(e=t.__posthog_layer__)!==null&&e!==void 0?e:t.__rrweb_layer__};function dh(t,e,n){try{if(!(e in t))return hk;const r={next:t[e]},s=n(function(...i){return r.next.apply(this,i)});return Yn(s)&&(s.prototype=s.prototype||{},Object.defineProperties(s,{__posthog_wrapped__:{enumerable:!1,value:!0},__posthog_layer__:{enumerable:!1,value:r}})),t[e]=s,()=>{if(t[e]===s)return void(t[e]=r.next);let i=t[e],o=pk(i);for(;o;){if(o.next===s)return void(o.next=r.next);i=o.next,o=pk(i)}}}catch{return hk}}const jF=dn("[TracingHeaders]"),Cl=dn("[Web Vitals]"),mk=9e5,gk=["CLS","FCP","INP","LCP"],$F=["INP","LCP"],FF=["interactionTarget","interactionType","inputDelay","processingDuration","presentationDelay","loadState","target","url","timeToFirstByte","resourceLoadDelay","resourceLoadDuration","elementRenderDelay","largestShiftTarget","largestShiftTime","largestShiftValue","firstByteToFCP"],Ry="disabled",vk="lazy_loading",yo=dn("[SessionRecording]"),VF=[Ex,Cx,Y5,X5,Q5,J5,eT,tT,nT],HF=dn("[Heatmaps]");function My(t){return dt(t)&&"clientX"in t&&"clientY"in t&&mn(t.clientX)&&mn(t.clientY)}const w0=dn("[Product Tours]"),Iy=t=>{var e;return!t.config.disable_product_tours&&!!(!((e=t.persistence)===null||e===void 0)&&e.get_property(Sx))},zF=["$set_once","$set"],Ti=dn("[SiteApps]"),yk="Error while initializing PostHog app with config id ",eA=(t,e)=>t!=null&&t.then?t.then(e):e(t),lu="SDK is not enabled or survey functionality is not yet loaded",_k="Disabled. Not loading surveys.";var UF=class{constructor(t,e){this.wo=t,this.Mh=e,this.name="surveys",this._surveyEventReceiver=null,this._surveyManager=null,this.Eh=!1,this.Ph=!1,this.Rh=[],this.Ah=[],this.Oh=null,this.Fh=null,this.To=!1,this.Dh=new Set,this.onRemoteConfig=n=>{if(this.To||this.Mr.disableSurveys)return;if(!n.ok)return this.Ph=!0,this.Lh({isLoaded:!1,error:"Remote config unavailable. Not loading surveys."}),Tt.warn("Remote config unavailable. Not loading surveys.");const r=n.config.surveys;if(Qe(r))return Tt.warn("Flags not loaded yet. Not loading surveys.");this.Nh=Nr(r)?r:r.length>0,Tt.info(`flags response received, isSurveysEnabled: ${this.Nh}`),this.loadIfEnabled()},this.Lh=n=>{this.Ah.slice().forEach(r=>this.qh(r,n))}}setup(t){if(!this.To)return this.jh=t,eA(t.kv.initialize(),()=>{if(this.jh!==t||this.To)return;this.jh=void 0,this.bo=t;const e=t.onRemoteConfig(this.onRemoteConfig);this.To?e.dispose():(this.Eo=e,this.loadIfEnabled())})}dispose(){var t,e,n,r,s;this.To||(this.To=!0,this.jh=void 0,this.bo=void 0,(t=this.Eo)===null||t===void 0||t.dispose(),this.Eo=void 0,(e=this._surveyEventReceiver)===null||e===void 0||e.dispose(),this._surveyEventReceiver=null,(n=this._surveyManager)===null||n===void 0||(r=n.dispose)===null||r===void 0||r.call(n),this._surveyManager=null,this.Rh=[],this.Ah.forEach(i=>{i.active=!1}),this.Ah=[],(s=this.Bh)===null||s===void 0||s.call(this),this.Bh=void 0,this.Oh=null,this.Dh.forEach(i=>clearTimeout(i)),this.Dh.clear())}get Mr(){return this.wo.get()}initialize(){this.loadIfEnabled()}reset(){var t,e;(t=this._surveyManager)===null||t===void 0||(e=t.clearInMemoryInProgressSurveyState)===null||e===void 0||e.call(t);try{var n;(n=this._surveyEventReceiver)===null||n===void 0||n.reset(),localStorage.removeItem("lastSeenSurveyDate");const r=[];for(let s=0;s<localStorage.length;s++){const i=localStorage.key(s);(i!=null&&i.startsWith("seenSurvey_")||i!=null&&i.startsWith("inProgressSurvey_"))&&r.push(i)}r.forEach(s=>localStorage.removeItem(s))}catch{}this.Lh()}loadIfEnabled(){if(this.To||!this.bo)return;const t=this.Mr;if(this._surveyManager)return;if(this.Eh)return void Tt.info("Already initializing surveys, skipping...");if(t.disableSurveys)return void Tt.info(_k);if(t.cookielessMode&&this.wo.isOptedOut())return void Tt.info("Not loading surveys in cookieless mode without consent.");const e=this.wo.getExtensions();if(!e)return void this.Hh("PostHog Extensions not found.");if(ce(this.Nh)&&!t.advancedEnableSurveys)return;const n=this.Nh||t.advancedEnableSurveys;this.Eh=!0,this.Ph=!1;try{const r=e.generateSurveys;if(r)return this.zh(r,n),void(this.Eh=!1);const s=e.loadExternalDependency;if(!s)return this.Hh(Px),void(this.Eh=!1);s(i=>{try{if(this.To)return;const o=this.wo.getExtensions();i||!(o!=null&&o.generateSurveys)?this.Hh("Could not load surveys script",i):this.zh(o.generateSurveys,n)}finally{this.Eh=!1}})}catch(r){throw this.Eh=!1,this.Hh("Error initializing surveys",r),r}}zh(t,e){var n,r;if(this.To)return;this._surveyManager=t(e),this._surveyEventReceiver=this.wo.createEventReceiver(this.Lh);const s=(n=(r=this.bo)!==null&&r!==void 0?r:this.Mh)===null||n===void 0?void 0:n.kv.get(kf);s&&this.Uh(s),Tt.info("Surveys loaded successfully"),this.Wh(),this.Lh(),this.Vh({isLoaded:!0})}Hh(t,e){this.Ph=!0,Tt.error(t,e),this.Lh({isLoaded:!1,error:t}),this.Vh({isLoaded:!1,error:t})}onSurveysLoaded(t){return this.Rh.push(t),this._surveyManager&&this.Vh({isLoaded:!0}),()=>{this.Rh=this.Rh.filter(e=>e!==t)}}getSurveys(t,e=!1){var n;const r=(n=this.bo)!==null&&n!==void 0?n:this.Mh;if(!r||this.To)return;if(this.Mr.disableSurveys)return Tt.info(_k),t([]);const s=r.kv.get(kf);if(s&&!e)return t(s,{isLoaded:!0}),void(this.Gh()&&this.getSurveys(()=>{},!0));if(this.Oh)return void this.Oh.then(({surveys:l,context:u})=>{this.To||t(l,u)}).catch(l=>Tt.error("Error in survey callback",l));const i=this.Qh("/api/surveys/",{method:"GET",query:{token:r.projectToken},sentAt:"query",timeoutMs:this.Mr.requestTimeoutMs}).then(l=>{try{return this.Jh(r,l)}catch(u){return Tt.error("Error processing surveys response",u),this.Jh(r,{statusCode:0,error:u})}},l=>this.Jh(r,{statusCode:0,error:l}));this.Oh=i;const o=()=>{this.Oh===i&&(this.Oh=null)};i.then(l=>{o(),this.To||(this.Lh(l.context),t(l.surveys,l.context))},o).catch(l=>Tt.error("Error in survey callback",l))}Qh(t,e){const n=this.bo;return n?n.sendRequest(t,e):new Promise(r=>r({statusCode:0,error:new Error(lu)}))}Jh(t,e){if(this.To)return{surveys:[],context:{isLoaded:!1,error:lu}};const n=e.statusCode;if(n!==200||!e.json){const s=`Surveys API could not be loaded, status: ${n}`;return n!==0?Tt.error(s):e.error||Tt.warn(s),this.Fh=Date.now(),{surveys:[],context:{isLoaded:!1,error:s}}}this.Fh=null;const r=e.json.surveys||[];return t.kv.set({[kf]:r,[Lm]:Date.now()}),this.Uh(r),{surveys:r,context:{isLoaded:!0}}}Uh(t){var e;const n=t.filter(r=>(function(s){return!(!s.start_date||s.end_date)})(r)&&(GT(r)||(function(s){var i;return!!(!((i=s.conditions)===null||i===void 0||(i=i.actions)===null||i===void 0||(i=i.values)===null||i===void 0)&&i.length)})(r)));(e=this._surveyEventReceiver)===null||e===void 0||e.replace(n)}Gh(){return this.Zh()&&!this.Oh&&!this.Kh()}Zh(){var t,e;const n=(t=(e=this.bo)!==null&&e!==void 0?e:this.Mh)===null||t===void 0?void 0:t.kv.get(Lm);return mn(n)&&Date.now()-n>3e5}Kh(){return mn(this.Fh)&&3e5>Date.now()-this.Fh}markSurveyAsSeen(t,e){var n;const r={id:t,current_iteration:(n=e==null?void 0:e.iteration)!==null&&n!==void 0?n:null};XT(r);try{localStorage.setItem("lastSeenSurveyDate",new Date().toISOString())}catch{}this.Lh()}Vh(t){for(const e of this.Rh)try{if(!t.isLoaded)return e([],t);this.getSurveys(e)}catch(n){Tt.error("Error in survey callback",n)}}getActiveMatchingSurveys(t,e=!1){if(!Qe(this._surveyManager))return this._surveyManager.getActiveMatchingSurveys(t,e);Tt.warn("init was not called")}onActiveMatchingSurveysChanged(t){var e,n;if(this.To)return()=>{};const r={callback:t,active:!0,revision:0};this.Ah.push(r),this.Wh();const s=(e=(n=this.bo)!==null&&n!==void 0?n:this.Mh)===null||e===void 0?void 0:e.kv.get(kf);return this.Mr.disableSurveys||!this._surveyManager&&this.Ph&&!this.Eh||!s&&!Qe(this.Fh)&&!this.Oh?this.qh(r,{isLoaded:!1}):this._surveyManager&&this.qh(r),()=>{var i;r.active=!1,this.Ah=this.Ah.filter(o=>o!==r),this.Ah.length===0&&((i=this.Bh)===null||i===void 0||i.call(this),this.Bh=void 0)}}Wh(){var t,e,n;this._surveyManager&&this.Ah.length>0&&((t=this.Bh)!==null&&t!==void 0||(this.Bh=(e=(n=this.wo).onMatchingConditionsChanged)===null||e===void 0?void 0:e.call(n,this.Lh)))}qh(t,e){if(this.To||!t.active)return;const n=++t.revision,r=s=>{if(!this.To&&t.active&&n===t.revision)try{const i=e??{isLoaded:!0},o=JSON.stringify([s,i]);if(o===t.lastResult)return;t.lastResult=o,t.callback(s,i)}catch(i){Tt.error("Error in active matching surveys callback",i)}};try{e&&!e.isLoaded?r([]):this.getActiveMatchingSurveys(r)}catch(s){Tt.error("Error in active matching surveys callback",s)}}Xh(t){let e=null;return this.getSurveys(n=>{var r;e=(r=n.find(s=>s.id===t))!==null&&r!==void 0?r:null}),e}Yh(t){if(Qe(this._surveyManager))return{eligible:!1,reason:lu};const e=typeof t=="string"?this.Xh(t):t;return e?this._surveyManager.checkSurveyEligibility(e):{eligible:!1,reason:"Survey not found"}}tc(t){if(!this.wo.isCapturing())return{eligible:!1,reason:"PostHog is not capturing, so a survey response cannot be recorded"};if(Qe(this._surveyManager))return{eligible:!1,reason:lu};const e=typeof t=="string"?this.Xh(t):t;return e?this._surveyManager.checkSurveyRenderability(e):{eligible:!1,reason:"Survey not found"}}canRenderSurvey(t){if(Qe(this._surveyManager))return Tt.warn("init was not called"),{visible:!1,disabledReason:lu};const e=this.tc(t);return{visible:e.eligible,disabledReason:e.reason}}canRenderSurveyAsync(t,e){return Qe(this._surveyManager)?(Tt.warn("init was not called"),Promise.resolve({visible:!1,disabledReason:lu})):new Promise(n=>{this.getSurveys(r=>{var s;const i=(s=r.find(o=>o.id===t))!==null&&s!==void 0?s:null;if(i){const o=this.tc(i);n({visible:o.eligible,disabledReason:o.reason})}else n({visible:!1,disabledReason:"Survey not found"})},e)})}renderSurvey(t,e,n){var r;if(!this.wo.isCapturing())return;if(Qe(this._surveyManager))return void Tt.warn("init was not called");const s=typeof t=="string"?this.Xh(t):t;if(!(s!=null&&s.id))return void Tt.warn("Survey not found");if(!yF.includes(s.type))return void Tt.warn(`Surveys of type ${s.type} cannot be rendered in the app`);const i=de==null?void 0:de.querySelector(e);if(i){if(!((r=s.appearance)===null||r===void 0)&&r.surveyPopupDelaySeconds){Tt.info(`Rendering survey ${s.id} with delay of ${s.appearance.surveyPopupDelaySeconds} seconds`);const o=setTimeout(()=>{var l,u;this.Dh.delete(o),!this.To&&this.wo.isCapturing()&&(Tt.info(`Rendering survey ${s.id} with delay of ${(l=s.appearance)===null||l===void 0?void 0:l.surveyPopupDelaySeconds} seconds`),(u=this._surveyManager)===null||u===void 0||u.renderSurvey(s,i,n),Tt.info(`Survey ${s.id} rendered`))},1e3*s.appearance.surveyPopupDelaySeconds);return void this.Dh.add(o)}this._surveyManager.renderSurvey(s,i,n)}else Tt.warn("Survey element not found")}displaySurvey(t,e){var n;if(!this.wo.isCapturing())return;if(Qe(this._surveyManager))return void Tt.warn("init was not called");const r=this.Xh(t);if(!r)return void Tt.warn("Survey not found");let s=r;if(!((n=r.appearance)===null||n===void 0)&&n.surveyPopupDelaySeconds&&e.ignoreDelay&&(s=H(H({},r),{},{appearance:H(H({},r.appearance),{},{surveyPopupDelaySeconds:0})})),e.displayType!==w2.Popover&&e.initialResponses&&Tt.warn("initialResponses is only supported for popover surveys. prefill will not be applied."),e.ignoreConditions===!1){const i=this.Yh(r);if(!i.eligible)return void Tt.warn("Survey is not eligible to be displayed: ",i.reason)}e.displayType!==w2.Inline?this._surveyManager.handlePopoverSurvey(s,e):this.renderSurvey(s,e.selector,e.properties)}cancelPendingSurvey(t){Qe(this._surveyManager)?Tt.warn("init was not called"):this._surveyManager.cancelSurvey(t)}handlePageUnload(){var t,e;(t=this._surveyManager)===null||t===void 0||(e=t.handlePageUnload)===null||e===void 0||e.call(t)}};function cu(t,e,n){if(Qe(t))return!1;switch(n){case"exact":return t===e;case"contains":{const r=e.replace(/[.*+?^${}()|[\]\\]/g,"\\$&").replace(/_/g,".").replace(/%/g,".*");return new RegExp(r,"i").test(t)}case"regex":try{return new RegExp(e).test(t)}catch{return!1}default:return!1}}var BF=class{constructor(t){this._instance=t,this.ec=new Set,this.nc=new Set,this.sc=new Vm,this.rc=(e,n)=>this.oc(e,n)&&this.ac(e,n)&&this.lc(e,n)&&this.uc(e,n),this.oc=(e,n)=>!(n!=null&&n.event)||(e==null?void 0:e.event)===(n==null?void 0:n.event)}init(){var t,e;ce((t=this._instance)===null||t===void 0?void 0:t._addCaptureHook)||(this.hc=(e=this._instance)===null||e===void 0?void 0:e._addCaptureHook((n,r)=>{this.on(n,r)}))}dispose(){var t,e;(t=this.hc)===null||t===void 0||t.call(this),this.hc=void 0,(e=this._instance)===null||e===void 0||(e=e.autocapture)===null||e===void 0||e.setElementSelectors(new Set,this),this.sc=new Vm}register(t){var e,n;if(!ce((e=this._instance)===null||e===void 0?void 0:e._addCaptureHook)&&(t.forEach(r=>{var s;this.ec.add(r),(s=r.steps)===null||s===void 0||s.forEach(i=>{this.nc.add((i==null?void 0:i.event)||"")})}),(n=this._instance)===null||n===void 0?void 0:n.autocapture)){const r=new Set;this.ec.forEach(s=>{var i;(i=s.steps)===null||i===void 0||i.forEach(o=>{o!=null&&o.selector&&r.add(o.selector)})}),this._instance.autocapture.setElementSelectors(r,this)}}replace(t){this.ec.clear(),this.nc.clear(),this.register(t)}on(t,e){e!=null&&t.length!=0&&(this.nc.has(t)||this.nc.has(e.event))&&this.ec.forEach(n=>{this.cc(e,n)&&this.sc.emit("actionCaptured",n.name)})}dc(t){this.onAction("actionCaptured",e=>t(e))}cc(t,e){if((e==null?void 0:e.steps)==null)return!1;for(const n of e.steps)if(this.rc(t,n))return!0;return!1}onAction(t,e){return this.sc.on(t,e)}ac(t,e){if(e!=null&&e.url){var n;const r=t==null||(n=t.properties)===null||n===void 0?void 0:n.$current_url;if(!r||typeof r!="string"||!cu(r,e.url,e.url_matching||"contains"))return!1}return!0}lc(t,e){return!!this.vc(t,e)&&!!this.fc(t,e)&&!!this.gc(t,e)}vc(t,e){var n;if(!(e!=null&&e.href))return!0;const r=this.mc(t);if(r.length>0)return r.some(i=>cu(i.href,e.href,e.href_matching||"exact"));const s=(t==null||(n=t.properties)===null||n===void 0?void 0:n.$elements_chain)||"";return!!s&&cu((function(i){const o=i.match(/(?::|")href="(.*?)"/);return o?o[1]:""})(s),e.href,e.href_matching||"exact")}fc(t,e){var n;if(!(e!=null&&e.text))return!0;const r=this.mc(t);if(r.length>0)return r.some(u=>cu(u.text,e.text,e.text_matching||"exact")||cu(u.$el_text,e.text,e.text_matching||"exact"));const s=(t==null||(n=t.properties)===null||n===void 0?void 0:n.$elements_chain)||"";return!!s&&(i=(function(u){const d=[],f=/(?::|")text="(.*?)"/g;let p;for(;!Qe(p=f.exec(u));)d.includes(p[1])||d.push(p[1]);return d})(s),o=e.text,l=e.text_matching||"exact",i.some(u=>cu(u,o,l)));var i,o,l}gc(t,e){var n,r;if(!(e!=null&&e.selector))return!0;const s=t==null||(n=t.properties)===null||n===void 0?void 0:n.$element_selectors;if(s!=null&&s.includes(e.selector))return!0;const i=(t==null||(r=t.properties)===null||r===void 0?void 0:r.$elements_chain)||"";if(e.selector_regex&&i)try{return new RegExp(e.selector_regex).test(i)}catch{return!1}return!1}mc(t){var e;return(t==null||(e=t.properties)===null||e===void 0?void 0:e.$elements)==null?[]:t==null?void 0:t.properties.$elements}uc(t,e){return!(e!=null&&e.properties)||e.properties.length===0||YT(e.properties.reduce((n,r)=>{const s=We(r.value)?r.value.map(String):r.value!=null?[String(r.value)]:[];return n[r.key]={values:s,operator:r.operator||"exact"},n},{}),t==null?void 0:t.properties)}},ZF=class{constructor(t,e){var n,r;this.yc=[],this._instance=t,this.bc=e,this._c=new Map,this.wc=new Map,this.kc=new Map,this.Sc=(n=this._instance)===null||n===void 0||(r=n.onSessionId)===null||r===void 0?void 0:r.call(n,s=>this.xc(s))}$c(t){return!1}Cc(){return null}Tc(t){}Ic(){}Mc(t,e){return!!t&&YT(t.propertyFilters,e==null?void 0:e.properties)}Ec(t,e){const n=new Map;return t.forEach(r=>{var s;(s=r.conditions)===null||s===void 0||(s=s[e])===null||s===void 0||(s=s.values)===null||s===void 0||s.forEach(i=>{if(i!=null&&i.name){const o=n.get(i.name)||[];o.push(r.id),n.set(i.name,o)}})}),n}Pc(t,e,n){const r=(n===pf.Activation?this._c:this.wc).get(t);let s=[];return this.Rc(i=>{s=i.filter(o=>r==null?void 0:r.includes(o.id))}),s.filter(i=>{var o;const l=(o=i.conditions)===null||o===void 0||(o=o[n])===null||o===void 0||(o=o.values)===null||o===void 0?void 0:o.find(u=>u.name===t);return this.Mc(l,e)})}register(t){this.Ac(t,!1)}replace(t){this.Ac(t,!0)}Ac(t,e){var n;ce((n=this._instance)===null||n===void 0?void 0:n._addCaptureHook)||(this.Oc(t,e),this.Fc(t,e))}Fc(t,e){const n=t.filter(i=>{var o;return(o=i.conditions)===null||o===void 0||(o=o.actions)===null||o===void 0||(o=o.values)===null||o===void 0?void 0:o.length});var r;if(e&&this.kc.clear(),n.length===0)return void(e&&((r=this.Dc)===null||r===void 0||r.replace([])));this.Dc||(this.Dc=new BF(this._instance),this.Dc.init(),this.Dc.dc(i=>this.onAction(i)));const s=[];n.forEach(i=>{var o;(o=i.conditions)===null||o===void 0||(o=o.actions)===null||o===void 0||o.values.forEach(l=>{if(s.push(l),l.name){var u;const d=(u=this.kc.get(l.name))!==null&&u!==void 0?u:[];d.includes(i.id)||d.push(i.id),this.kc.set(l.name,d)}})}),e?this.Dc.replace(s):this.Dc.register(s)}Lc(t,e){e.forEach((n,r)=>{var s;const i=(s=t.get(r))!==null&&s!==void 0?s:[];n.forEach(o=>{i.includes(o)||i.push(o)}),t.set(r,i)})}Oc(t,e){var n,r;const s=t.filter(u=>{var d,f;return((d=u.conditions)===null||d===void 0?void 0:d.events)&&((f=u.conditions)===null||f===void 0||(f=f.events)===null||f===void 0||(f=f.values)===null||f===void 0?void 0:f.length)>0}),i=t.filter(u=>{var d,f;return((d=u.conditions)===null||d===void 0?void 0:d.cancelEvents)&&((f=u.conditions)===null||f===void 0||(f=f.cancelEvents)===null||f===void 0||(f=f.values)===null||f===void 0?void 0:f.length)>0}),o=this.Ec(t,pf.Activation),l=this.Ec(t,pf.Cancellation);e?(this._c=o,this.wc=l):(this.Lc(this._c,o),this.Lc(this.wc,l)),(s.length!==0||i.length!==0||t.some(u=>{var d;return(d=u.conditions)===null||d===void 0||(d=d.actions)===null||d===void 0||(d=d.values)===null||d===void 0?void 0:d.length}))&&((n=this.hc)!==null&&n!==void 0||(this.hc=(r=this._instance)===null||r===void 0?void 0:r._addCaptureHook((u,d)=>{this.onEvent(u,d)})))}onEvent(t,e){var n,r;const s=this.Nc(),i=(e==null||(n=e.properties)===null||n===void 0?void 0:n.$survey_id)||(e==null||(r=e.properties)===null||r===void 0?void 0:r.$product_tour_id);if(i&&this.getActivatedIds().includes(i)){const l=this.qc(t,i,e);if(l==="consume")return s.info("event consumed activated item, removing it",{event:t,itemId:i}),void this.jc([i]);if(l==="persist")return s.info("shown item promoted to persisted activation",{event:t,itemId:i}),this.Bc(i),void this.Hc([i])}if(this.wc.has(t)){const l=this.Pc(t,e,pf.Cancellation);l.length>0&&(s.info("cancel event matched, cancelling items",{event:t,itemsToCancel:l.map(u=>u.id)}),this.jc(l.map(u=>u.id)),l.forEach(u=>this.zc(u.id)))}if(!this._c.has(t))return;s.info("event name matched",{event:t,eventPayload:e,items:this._c.get(t)});const o=this.Pc(t,e,pf.Activation);this.Uc(o.map(l=>l.id))}onAction(t){this.kc.has(t)&&this.Uc(this.kc.get(t)||[])}Uc(t){var e,n;if(t.length===0)return;const r=!!(!((e=this._instance)===null||e===void 0||(n=e.get_session_id)===null||n===void 0)&&n.call(e)),s=[];for(const i of t)r&&this.$c(i)?this.Bc(i)&&this.Wc(i):s.push(i);s.length>0&&(this.yc=[...new Set([...this.yc,...s])]),this.Nc().info("updating activated items",{activatedItems:this.getActivatedIds()}),this.Vc()}Bc(t){this.yc=this.yc.filter(n=>n!==t);const e=this.Gc();return!e.includes(t)&&(this.Qc([...e,t]),this.Jc(),!0)}jc(t){const e=new Set(t);this.yc=this.yc.filter(s=>!e.has(s));const n=this.Zc(),r=n.filter(s=>!e.has(s));r.length!==n.length&&(this.Qc(r),r.length===0&&this.Kc()),this.Hc(t),this.Vc()}Vc(){try{var t;(t=this.bc)===null||t===void 0||t.call(this)}catch(e){this.Nc().error("Error while handling activated items change",e)}}Xc(){var t;const e=this.Cc();if(!e)return{};const n=(t=this._instance)===null||t===void 0||(t=t.persistence)===null||t===void 0?void 0:t.props[e];return n&&typeof n=="object"?n:{}}Wc(t){if(!this.Cc())return;const e=this.Xc();this.Tc(H(H({},e),{},{[t]:Date.now()}))}Hc(t){if(!this.Cc())return;const e=this.Xc(),n={};let r=!1;for(const[s,i]of Object.entries(e))t.includes(s)?r=!0:n[s]=i;r&&(Kr(n)?this.Ic():this.Tc(n))}Yc(){this.Cc()&&this.Ic()}getActivationTimestamp(t){if(!this.Gc().includes(t))return;const e=this.Xc()[t];return mn(e)?e:void 0}Zc(){var t;const e=this.td();return((t=this._instance)===null||t===void 0||(t=t.persistence)===null||t===void 0?void 0:t.props[e])||[]}Gc(){var t,e,n;const r=this.Zc();if(r.length===0)return[];const s=(t=this._instance)===null||t===void 0||(t=t.persistence)===null||t===void 0?void 0:t.props[this.ed()],i=(e=this._instance)===null||e===void 0||(n=e.get_session_id)===null||n===void 0?void 0:n.call(e);return i&&s===i?r:[]}Jc(){var t,e;const n=(t=this._instance)===null||t===void 0||(e=t.get_session_id)===null||e===void 0?void 0:e.call(t);n&&this.nd(n)}Kc(){this.sd()}xc(t){var e;const n=(e=this._instance)===null||e===void 0||(e=e.persistence)===null||e===void 0?void 0:e.props[this.ed()];if(n&&n!==t){const r=this.Zc(),s=this.Xc();r.length>0&&(this.Qc([]),r.filter(i=>mn(s[i])).forEach(i=>this.zc(i))),this.Kc(),this.Yc(),r.length>0&&this.Vc()}}getActivatedIds(){return[...new Set([...this.Gc(),...this.yc])].filter(t=>!this.rd(t))}dispose(){var t,e,n;(t=this.Sc)===null||t===void 0||t.call(this),this.Sc=void 0,(e=this.hc)===null||e===void 0||e.call(this),this.hc=void 0,(n=this.Dc)===null||n===void 0||n.dispose(),this.Dc=void 0}reset(){this.yc=[],this.Zc().length>0&&this.Qc([]),this.Kc(),this.Yc(),this.Vc()}getEventToItemsMap(){return this._c}od(){return this.Dc}},WF=class extends ZF{constructor(t,e){super(t,e)}td(){return z5}ed(){return U5}Cc(){return B5}Tc(t){var e;(e=this._instance)===null||e===void 0||(e=e.persistence)===null||e===void 0||e.register({$surveys_activated_timestamps:t})}Ic(){var t;(t=this._instance)===null||t===void 0||(t=t.persistence)===null||t===void 0||t.unregister("$surveys_activated_timestamps")}$c(t){var e;let n;this.Rc(s=>{n=s.find(i=>i.id===t)});const r=n==null||(e=n.appearance)===null||e===void 0?void 0:e.surveyPopupDelaySeconds;return mn(r)&&r>0}ad(){return ys.SHOWN}Rc(t){var e;(e=this._instance)===null||e===void 0||e.getSurveys(t)}zc(t){var e;(e=this._instance)===null||e===void 0||e.cancelPendingSurvey(t)}Nc(){return Tt}Qc(t){var e;(e=this._instance)===null||e===void 0||(e=e.persistence)===null||e===void 0||e.register({$surveys_activated:t})}nd(t){var e;(e=this._instance)===null||e===void 0||(e=e.persistence)===null||e===void 0||e.register({$surveys_activated_session:t})}sd(){var t;(t=this._instance)===null||t===void 0||(t=t.persistence)===null||t===void 0||t.unregister("$surveys_activated_session")}rd(){return!1}qc(t,e,n){var r;if(t===ys.SENT&&(n==null||(r=n.properties)===null||r===void 0?void 0:r.$survey_completed)===!1)return"ignore";let s;return this.Rc(i=>{s=i.find(o=>o.id===e)}),!s||(function(i){var o;return GT(i)&&!!(!((o=i.conditions)===null||o===void 0||(o=o.events)===null||o===void 0)&&o.repeatedActivation)||i.schedule==="always"})(s)?t===ys.SHOWN?"consume":"ignore":t===ys.SHOWN?"persist":t===ys.DISMISSED||t===ys.SENT?"consume":"ignore"}getSurveys(){return this.getActivatedIds()}getEventToSurveys(){return this.getEventToItemsMap()}},qF=class{constructor(t){this._instance=t}initialize(){}get(t){if(typeof t=="string")return this._instance.get_property(t);const e={};for(const n of t){const r=this._instance.get_property(n);ce(r)||(e[n]=r)}return e}set(t,e){this._instance.register(typeof t=="string"?{[t]:e}:t)}remove(t){typeof t!="string"?t.forEach(e=>this._instance.unregister(e)):this._instance.unregister(t)}},GF=class{constructor(t){this._instance=t}get(){const t=this._instance.config;return{disableSurveys:t.disable_surveys,cookielessMode:!!t.cookieless_mode,advancedEnableSurveys:t.advanced_enable_surveys,requestTimeoutMs:t.surveys_request_timeout_ms}}isOptedOut(){return this._instance.consent.isOptedOut()}isCapturing(){return this._instance.is_capturing()}getExtensions(){const t=$e==null?void 0:$e.__PosthogExtensions__;if(!t)return;const{generateSurveys:e,loadExternalDependency:n}=t;return{generateSurveys:e?r=>e(this._instance,r):void 0,loadExternalDependency:n?r=>n(this._instance,"surveys",r):void 0}}createEventReceiver(t){return new WF(this._instance,t)}onMatchingConditionsChanged(t){const e=this._instance._addCaptureHook(i=>{i!=="$pageview"&&i!==ys.SHOWN&&i!==ys.DISMISSED&&i!==ys.SENT||t()}),n=()=>t();kt(J,"PHSurveyShown",n);let r=!1;const s=this._instance.onFeatureFlags(()=>{r&&t()});return r=!0,()=>{r=!1,e(),s(),J==null||J.removeEventListener("PHSurveyShown",n)}}};const KF=J!=null&&J.location?jm(J.location.hash,"__posthog")||jm(location.hash,"state"):null,wk="_postHogToolbarParams",xk=dn("[Toolbar]"),bk=dn("[FeatureFlags]");var YF=class{constructor(t,e=!1){this.ld=!1,this.update(t,e)}update(t,e){this.ud=((n,r)=>{var s,i,o,l,u,d,f,p;return{bootstrap:{featureFlags:(s=(i=n.bootstrap)===null||i===void 0?void 0:i.featureFlags)!==null&&s!==void 0?s:void 0,featureFlagPayloads:(o=(l=n.bootstrap)===null||l===void 0?void 0:l.featureFlagPayloads)!==null&&o!==void 0?o:void 0},remoteRequestsDisabled:r,featureFlagsDisabled:!!n.advanced_disable_feature_flags,onlyEvaluateSurveyFeatureFlags:!!n.advanced_only_evaluate_survey_feature_flags,deduplicateCallsPerSession:!!n.advanced_feature_flags_dedup_per_session,cacheTtlMs:n.feature_flag_cache_ttl_ms,refreshIntervalMs:(u=n.remote_config_refresh_interval_ms)!==null&&u!==void 0?u:3e5,idleRefreshBackoff:ce(n.remote_config_refresh_interval_ms),requestTimeoutMs:n.feature_flag_request_timeout_ms,requestMaxRetries:Math.max(0,(d=n.feature_flag_request_max_retries)!==null&&d!==void 0?d:1),compression:n.disable_compression?void 0:"best-available",evaluationContexts:(f=(p=n.evaluation_contexts)!==null&&p!==void 0?p:n.evaluation_environments)!==null&&f!==void 0?f:[],flagKeys:We(n.flag_keys)?n.flag_keys:void 0}})(t,e),!t.evaluation_environments||t.evaluation_contexts||this.ld||(bk.warn("evaluation_environments is deprecated. Use evaluation_contexts instead. evaluation_environments will be removed in a future version."),this.ld=!0),ce(t.flag_keys)||We(t.flag_keys)||bk.error("Invalid flag_keys found:",t.flag_keys,"Expected array of non-empty strings")}get(){return this.ud}};const Sk=dn("[FeatureFlags]"),Pl=dn("[FeatureFlags]",{debugEnabled:!0}),Oy=`" failed. Feature flags didn't load in time.`,XF=[502,504],kk=["click","keydown","wheel","touchstart","pointerdown"],Ek="connection_error",Ck=t=>{const e={};for(let n=0;t.length>n;n++)e[t[n]]=!0;return e},Pk=t=>{const e={};for(const[n,r]of Q0(t||{}))r&&(e[n]=r);return e},Tk=t=>md(t)&&(t.name==="RangeError"&&t.message.indexOf("Maximum call stack size exceeded")===0||t.name==="InternalError"&&t.message==="too much recursion"),ci=dn("[Error tracking]"),C2="webkit-masked-url:",QF=[{value:"isolatedAPI.contexts.topHostname",exact:!1},{value:"No response from target",exact:!0}],JF=["chrome-extension://","moz-extension://","safari-extension:","safari-web-extension:",C2],eV=["__firefox__","__gCrWeb"],Ak="Refusing to render web experiment since the viewer is a likely bot",tV={icontains:(t,e)=>e.toLowerCase().indexOf(t.toLowerCase())>-1,not_icontains:(t,e)=>e.toLowerCase().indexOf(t.toLowerCase())===-1,regex:(t,e)=>Hm(e,t),not_regex:(t,e)=>!Hm(e,t),exact:(t,e)=>e===t,is_not:(t,e)=>e!==t},zs=dn("[Conversations]"),Tl="Conversations not available yet.";function Rk(t,e){var n,r,s,i,o,l,u;const d=(n=t==null?void 0:t.flushIntervalMs)!==null&&n!==void 0?n:3e3,f=(r=t==null?void 0:t.maxBufferSize)!==null&&r!==void 0?r:100,p=e!=null&&e.consoleCapture?void 0:(s=t==null?void 0:t.maxLogsPerInterval)!==null&&s!==void 0?s:1e3,g=ce(p)?Math.max(f,2048):Math.max(f,p),v=H(H({},(function(){let w="",_="";try{const x=Xn==null?void 0:Xn.userAgent;x&&([w,_]=h5(x))}catch{}return(function(x,S){const k=(function(C){if(C)return{}.hasOwnProperty.call(S8,C)?S8[C]:C})(x);return H(H({},k?{"os.name":k}:{}),S?{"os.version":S}:{})})(w,_)})()),t==null?void 0:t.resourceAttributes);return{serviceName:(i=(o=v==null?void 0:v["service.name"])!==null&&o!==void 0?o:t==null?void 0:t.serviceName)!==null&&i!==void 0?i:e==null?void 0:e.serviceNameDefault,serviceVersion:(l=v==null?void 0:v["service.version"])!==null&&l!==void 0?l:t==null?void 0:t.serviceVersion,environment:(u=v==null?void 0:v["deployment.environment"])!==null&&u!==void 0?u:t==null?void 0:t.environment,resourceAttributes:v,beforeSend:t==null?void 0:t.beforeSend,flushIntervalMs:d,maxBufferSize:f,maxQueueSize:g,maxBatchRecordsPerPost:100,rateCapWindowMs:d,maxLogsPerInterval:p,backgroundFlushBudgetMs:0,terminationFlushBudgetMs:0}}const nV=["debug","log","warn","error","info"],rV=t=>{for(;t!=null&&t.__rrweb_original__;)t=t.__rrweb_original__;return t},Mk="console",tA="__posthogHandledLogsRequestError",Ly=(t,e)=>{const n=t instanceof Error?t:new Error(e);return n[tA]=!0,n},Ik=t=>!!t&&typeof t=="object"&&t[tA]===!0,zm=dn("[NetworkMetrics]"),Dx=()=>{var t;return!(J==null||(t=J.performance)===null||t===void 0)&&t.now?J.performance.now():Date.now()},sV={"http:":80,"https:":443},iV=new Set(["CONNECT","DELETE","GET","HEAD","OPTIONS","PATCH","POST","PUT","TRACE"]),nA=(t,e)=>{var n;const r=String(e);return{method:String(t).toUpperCase(),url:((n=Ho(r))===null||n===void 0?void 0:n.href)||r}},P2=(t,e,n,r,s,i,o=!1)=>{try{var l,u;const d=s();if(!d)return;const f=n||void 0,p=Dx()-r,g=Ho(e.url);if(g&&g.protocol!=="http:"&&g.protocol!=="https:")return;const v={url:(g==null?void 0:g.href)||e.url,method:e.method},w=Yn(d.name)?d.name(v):lt(d.name)?d.name:"http.client.request.duration";if(!w)return;const _=o&&!f?void 0:((S,k)=>S?400>S?void 0:String(S):(k==null?void 0:k.name)||"_OTHER")(f,i),x=H(H(H(H(H({},(S=>{const k=iV.has(S)?S:"_OTHER";return H({"http.request.method":k},k==="_OTHER"&&S!==k?{"http.request.method_original":S}:{})})(v.method)),g?(S=>{return{"server.address":S.hostname.startsWith("[")&&S.hostname.endsWith("]")?S.hostname.slice(1,-1):S.hostname,"server.port":Number(S.port)||sV[S.protocol],"url.scheme":S.protocol.slice(0,-1),"url.template":(k=S.pathname,k.split("/").map(C=>(T=>/^\d+$/.test(T)||T.length>=8&&/^[0-9a-f-]*\d[0-9a-f-]*$/i.test(T))(C)?":id":C).join("/"))};var k})(g):{}),f?{"http.response.status_code":f}:{}),_?{"error.type":_}:{}),(l=d.attributes)===null||l===void 0?void 0:l.call(d,v,{status:f,durationMs:p}));(u=t.metrics)===null||u===void 0||u.histogram(w,p,{unit:"ms",attributes:x})}catch(d){zm.error("Failed to record network metric",d)}},rA=()=>{},oV=(t,e)=>Yn(J==null?void 0:J.fetch)?dh(J,"fetch",n=>function(...r){const s=Dx(),i=n.apply(this,r);if(!e())return i;try{var o,l,u;const[d,f]=r,p=nA((o=(l=f==null?void 0:f.method)!==null&&l!==void 0?l:d==null?void 0:d.method)!==null&&o!==void 0?o:"GET",(u=d==null?void 0:d.url)!==null&&u!==void 0?u:d);return i.then(g=>(P2(t,p,g==null?void 0:g.status,s,e,void 0,!0),g),g=>{throw P2(t,p,void 0,s,e,g),g})}catch(d){return zm.error("Failed to observe fetch",d),i}}):rA,aV=(t,e)=>{var n;const r=J==null||(n=J.XMLHttpRequest)===null||n===void 0?void 0:n.prototype;if(!r)return rA;const s=new WeakMap,i=dh(r,"open",l=>function(...u){try{NT.has(this)||s.set(this,nA(u[0],u[1]))}catch(d){zm.error("Failed to observe XHR open",d)}return l.apply(this,u)}),o=dh(r,"send",l=>function(...u){let d;try{const f=s.get(this);if(f&&e()){const p=Dx();d=()=>{this.removeEventListener("loadend",d),P2(t,f,this.status,p,e)},kt(this,"loadend",d)}}catch(f){zm.error("Failed to observe XHR send",f)}try{return l.apply(this,u)}catch(f){throw d&&this.removeEventListener("loadend",d),f}});return()=>{i(),o()}},Dg={featureFlags:class{constructor(t){this.name="featureFlags",this.hd=!1,this.featureFlagEventHandlers=[],this.A=Sk,this.dd={},this.vd={},this.fd=[],this.pd=!1,this.gd=!1,this.md=0,this.yd=!1,this.bd=!1,this._d=!1,this.wd=!1,this.kd=0,this.Sd=!1,this.rn=()=>{const e=this.xd();this.kd=0,e&&this.reloadFeatureFlags()},this.$d=()=>{var e,n;const r=this.Cd,s=(e=this.Td)!==null&&e!==void 0?e:r;ce(r)||ce(s)||this.Mr.remoteRequestsDisabled||!de||de.visibilityState==="hidden"||Date.now()-((n=this.Id)!==null&&n!==void 0?n:0)<s||(this.Td=this.Sd||!this.Mr.idleRefreshBackoff?r:Math.min(2*s,36e5),this.Sd=!1,this.reloadFeatureFlags(),this.Md())},this.Ed=()=>{this.Sd&&this.Td===this.Cd||this.Pd()},this.sn=()=>{(de==null?void 0:de.visibilityState)==="visible"&&this.Pd()},"get"in t?this.wo=t:(this._instance=t,this.Rd=new YF(t.config,t.il()),this.wo=this.Rd)}updateConfig(t,e){var n;(n=this.Rd)===null||n===void 0||n.update(t,e),this.bo&&this.Ad()}setup(t){return this.jh=t,this.A=t.logger.createLogger("[FeatureFlags]"),eA(t.kv.initialize(),()=>{this.jh===t&&(this.jh=void 0,this.bo=t,this.Od(t))})}Od(t){var e;if(this.bo===t)return J&&kt(J,"online",this.rn),this.Ad(),this.Fd=t.registerDynamicEventProperties(()=>this.Dd()?this.dd:this.vd),this.Ld=(e=this._instance)===null||e===void 0||(e=e.persistence)===null||e===void 0?void 0:e.onCrossTabFeatureFlagChange(()=>{this.Nd(),this.qd(),this.jd()}),this.qd(),this.initialize()}Pd(){this.Sd=!0,this.Td=this.Cd,this.$d()}Ad(){const t=this.Mr.refreshIntervalMs,e=!this.Mr.remoteRequestsDisabled&&de&&!ce(t)&&t>0?t:void 0;this.Mr.idleRefreshBackoff||(this.Td=e),e!==this.Cd&&(this.Bd(),ce(e)||(this.Cd=e,this.Td=e,this.Md(),de!=null&&de.addEventListener&&(kt(de,oh,this.sn),xu(kk,n=>{kt(de,n,this.Ed,{capture:!0})}))))}Md(){ce(this.Cd)||(ce(this.Hd)||clearInterval(this.Hd),this.Id=Date.now(),this.Hd=setInterval(this.$d,this.Cd))}Bd(){var t;ce(this.Hd)||(clearInterval(this.Hd),this.Hd=void 0,de==null||(t=de.removeEventListener)===null||t===void 0||t.call(de,"visibilitychange",this.sn),xu(kk,e=>{var n;de==null||(n=de.removeEventListener)===null||n===void 0||n.call(de,e,this.Ed,{capture:!0})})),this.Cd=void 0,this.Td=void 0,this.Sd=!1,this.Id=void 0}destroy(){this.zd()}dispose(){this.zd()}zd(){var t,e;this.Bd(),this.md++,this.bd=!1,this.jh=void 0,this.bo&&(this.Ud(),(t=this.Fd)===null||t===void 0||t.dispose(),this.Fd=void 0,(e=this.Ld)===null||e===void 0||e.call(this),this.Ld=void 0,this.fd=[],J==null||J.removeEventListener("online",this.rn),this.bo=void 0)}get Mr(){return this.wo.get()}Wd(t){var e;return this.Vd&&t in this.Vd?this.Vd[t]:(e=this.bo)===null||e===void 0?void 0:e.kv.get(t)}Nd(){return!!this.Vd&&(this.Vd=void 0,!0)}Gd(){var t;return!ce((t=this.bo)===null||t===void 0?void 0:t.kv.get("$enabled_feature_flags"))&&this.Nd()}$t(t){this.Qd(()=>{var e;return(e=this.bo)===null||e===void 0?void 0:e.kv.set(t)})}Jd(t,e,n){var r;if(!(!((r=this._instance)===null||r===void 0)&&r.persistence)||!t.$enabled_feature_flags)return;const s=this.Wd("$enabled_feature_flags")||{},i=t.$enabled_feature_flags||{},o=e.flags||e.featureFlags,l=e.flags?Object.entries(e.flags).filter(([,S])=>!(S!=null&&S.failed)).map(([S])=>S):[],u=!!e.errorsWhileComputingFlags&&!!e.flags,d=u?l:n&&!We(o)?Object.keys(o||{}):Array.from(new Set([...Object.keys(s),...Object.keys(i)])),f=this.Wd("$feature_flag_payloads")||{},p=t.$feature_flag_payloads||{},g=u||n?d:Array.from(new Set([...Object.keys(f),...Object.keys(p)])),v=!u&&!n,w=!!v||d,_=!!v||g,x={[Io]:w,[vi]:w,[Ra]:_};t.$feature_flag_details&&(x[nc]=w);for(const S of[rc,$a,Df])ce(t[S])||(x[S]=!0);this._instance.persistence.markCrossTabFeatureFlagChanges(x)}Pt(t){this.Qd(()=>{var e;return(e=this.bo)===null||e===void 0?void 0:e.kv.remove(t)})}Qd(t){try{t()}catch(e){this.A.error("Failed to update feature flag persistence",e)}}qd(){const t={};for(const r of[Io,Ra,rc,Oi]){const s=this.Wd(r);ce(s)||(t[r]=s)}this.dd=t;const e=H({},t),n=this.Wd(vi);if(n)for(const[r,s]of Object.entries(n))e[`$feature/${r}`]=s;this.vd=e}Dd(){const t=this.Mr.cacheTtlMs;if(!t||0>=t)return!1;const e=this.Wd($a);return typeof e!="number"||Date.now()-e>t}Zd(){return!!this.Dd()&&(this.wd||this.gd||(this.wd=!0,this.A.warn("Feature flag cache is stale, triggering refresh..."),this.reloadFeatureFlags()),!0)}Kd(){const t=this.Mr.evaluationContexts;return t!=null&&t.length?t.filter(e=>{const n=e&&typeof e=="string"&&e.trim().length>0;return n||this.A.error("Invalid evaluation context found:",e,"Expected non-empty string"),n}):[]}Xd(){const t=this.Mr.flagKeys;if(!ce(t))return t.filter(e=>{const n=e&&typeof e=="string"&&e.trim().length>0;return n||this.A.error("Invalid flag key found:",e,"Expected non-empty string"),n})}initialize(){var t,e;const n=this.Mr,r=(t=(e=n.bootstrap)===null||e===void 0?void 0:e.featureFlags)!==null&&t!==void 0?t:{};if(Object.keys(r).length){var s,i;const o=(s=(i=n.bootstrap)===null||i===void 0?void 0:i.featureFlagPayloads)!==null&&s!==void 0?s:{},l=Object.keys(r).filter(d=>!ce(r[d])).reduce((d,f)=>(d[f]=r[f],d),{}),u=Object.keys(o).filter(d=>l[d]).reduce((d,f)=>(d[f]=o[f],d),{});return this.Yd({featureFlags:l,featureFlagPayloads:u},void 0,{persist:!1})}}updateFlags(t,e,n){var r,s;const i=n!=null&&n.merge&&(r=this.Wd("$enabled_feature_flags"))!==null&&r!==void 0?r:{},o=n!=null&&n.merge&&(s=this.Wd("$feature_flag_payloads"))!==null&&s!==void 0?s:{},l=H(H({},i),t),u=H(H({},o),e),d={};for(const[f,p]of Object.entries(l))d[f]={key:f,enabled:y8(p),variant:_8(p),reason:void 0,metadata:ce(u==null?void 0:u[f])?void 0:{id:0,version:void 0,description:void 0,payload:u[f]}};this.Yd({flags:d})}get hasLoadedFlags(){return this.pd}getFlags(){return Object.keys(this.getFlagVariants())}getFlagsWithDetails(){const t=this.Wd(nc),e=this.Wd(Oi),n=this.Wd(Fl);if(!n&&!e)return t||{};const r=Wt({},t||{}),s=[...new Set([...Object.keys(n||{}),...Object.keys(e||{})])];for(const l of s){var i;const u=r[l],d=e==null?void 0:e[l],f=ce(d)?(i=u==null?void 0:u.enabled)!==null&&i!==void 0&&i:!!d,p=ce(d)?u==null?void 0:u.variant:typeof d=="string"?d:void 0,g=n==null?void 0:n[l],v=H(H({},u),{},{enabled:f,variant:f?p??(u==null?void 0:u.variant):void 0});var o;f!==(u==null?void 0:u.enabled)&&(v.original_enabled=u==null?void 0:u.enabled),p!==(u==null?void 0:u.variant)&&(v.original_variant=u==null?void 0:u.variant),g&&(v.metadata=H(H({},u==null?void 0:u.metadata),{},{payload:g,original_payload:u==null||(o=u.metadata)===null||o===void 0?void 0:o.payload})),r[l]=v}return this.hd||(this.A.warn(" Overriding feature flag details!",{flagDetails:t,overriddenPayloads:n,finalDetails:r}),this.hd=!0),r}getAllFeatureFlags(){const t=this.getFlagVariants(),e=this.getFlagPayloads();return Object.keys(t).map(n=>{const r=t[n];return{key:n,enabled:y8(r),variant:_8(r),payload:v8(e[n])}})}getFlagVariants(){const t=this.Wd(vi),e=this.Wd(Oi);if(!e)return t||{};const n=Wt({},t||{}),r=Object.keys(e);for(let s=0;r.length>s;s++)n[r[s]]=e[r[s]];return this.hd||(this.A.warn(" Overriding feature flags!",{enabledFlags:t,overriddenFlags:e,finalFlags:n}),this.hd=!0),n}getFlagPayloads(){const t=this.Wd(Ra),e=this.Wd(Fl);if(!e)return t||{};const n=Wt({},t||{}),r=Object.keys(e);for(let s=0;r.length>s;s++)n[r[s]]=e[r[s]];return this.hd||(this.A.warn(" Overriding feature flag payloads!",{flagPayloads:t,overriddenPayloads:e,finalPayloads:n}),this.hd=!0),n}reloadFeatureFlags(){this.yd||this.Mr.featureFlagsDisabled||this.xd()||(this.gd&&(this.bd=!0),this.tv||(this.fd.slice().forEach(t=>{try{t()}catch(e){this.A.error("Error while running feature flags reloading callback",e)}}),this.tv=setTimeout(()=>{this.ev()},5)))}Ud(){clearTimeout(this.tv),this.tv=void 0}onReloading(t){return this.fd.push(t),()=>{this.fd=this.fd.filter(e=>e!==t)}}ensureFlagsLoaded(){this.pd||this.gd||this.tv||this.reloadFeatureFlags()}setAnonymousDistinctId(t){this.$anon_distinct_id=t}setReloadingPaused(t){this.yd=t}resetFlagCallReported(){this.Pt(Oa)}ev(t){this.Ud();const e=this.bo;if(!e||this.Mr.remoteRequestsDisabled||this.xd())return;if(this.gd)return void(this.bd=!0);const n={token:e.projectToken,distinct_id:e.distinctId,groups:e.groups,$anon_distinct_id:this.$anon_distinct_id,person_properties:H(H(H({},e.initialPersonProperties),this.Wd("$stored_person_properties")||{}),{},{$lib:e.library.name,$lib_version:e.library.version}),group_properties:this.Wd(Ia),timezone:PT()};ce(e.deviceId)||(n.$device_id=e.deviceId),(t!=null&&t.disableFlags||this.Mr.featureFlagsDisabled)&&(n.disable_flags=!0);const r=this.Kd();r.length&&(n.evaluation_contexts=r);const s=this.Xd();ce(s)||(n.flag_keys=s);const i=this.Mr.onlyEvaluateSurveyFeatureFlags,o="/flags/?v=2"+(i?"&only_evaluate_survey_feature_flags=true":""),l=this.md;this.gd=!0;const u=()=>{this.bd&&(this.bd=!1,this.ev())},d=w=>{var _,x;const S=(_=w.json)!==null&&_!==void 0?_:{},k=w.statusCode!==200;if(this.gd=!1,l!==this.md)return void u();if(this.iv(w.statusCode),k||this.bd||(this.$anon_distinct_id=void 0),n.disable_flags&&!this.bd)return;this._d=!k;const C=[];w.error?C.push(w.error instanceof Error&&w.error.name==="AbortError"?"timeout":w.error instanceof Error?Ek:"unknown_error"):w.statusCode!==200&&C.push(`api_error_${w.statusCode}`),S.errorsWhileComputingFlags&&C.push("errors_while_computing_flags");const T=!!(!((x=S.quotaLimited)===null||x===void 0)&&x.includes("feature_flags"));T&&C.push("quota_limited"),this.$t({[ih]:C}),T?this.A.warn("You have hit your feature flags quota limit, and will not be able to load feature flags until the quota is reset. Please visit https://posthog.com/docs/billing/limits-alerts to learn more."):n.disable_flags||this.Yd(S,k,{partialResponse:i}),u()},f=w=>{this.gd=!1,l===this.md&&(this.$t({[ih]:[Ek]}),this.A.error("Feature flag request failed",w),this.Gd()&&this.jd(!0)),u()};let p=this.Mr.requestMaxRetries;const g=()=>p>0&&l===this.md,v=()=>{if(l!==this.md||!this.bo||this.Mr.remoteRequestsDisabled)return this.gd=!1,void u();try{e.sendRequest(o,{target:"flags",method:"POST",body:n,compression:this.Mr.compression,sentAt:"body",timeoutMs:this.Mr.requestTimeoutMs}).then(w=>{if((_=>XF.includes(_.statusCode)||(x=>x.statusCode===0&&x.error instanceof Error&&x.error.name==="AbortError")(_))(w)&&g())return p--,void setTimeout(v,500);d(w)}).catch(f)}catch(w){f(w)}};v()}xd(){return yT(this.kd,3)}iv(t){this.kd=_T(t,this.kd,3,()=>this.A.warn("Feature flag requests are failing before receiving an HTTP response; this can happen due to network issues, CORS, browser blocking, or ad blockers. Stopped refreshing feature flags; will try again when connectivity changes."))}getFeatureFlag(t,e={}){var n;if(e.fresh&&!this._d)return;if(!(this.pd||this.getFlags()&&this.getFlags().length>0))return void this.A.warn('getFeatureFlag for key "'+t+Oy);if(this.Zd())return;const r=this.getFeatureFlagResult(t,e);return(n=r==null?void 0:r.variant)!==null&&n!==void 0?n:r==null?void 0:r.enabled}getFeatureFlagDetails(t){return this.getFlagsWithDetails()[t]}getFeatureFlagPayload(t){const e=this.getFeatureFlagResult(t,{send_event:!1});return e==null?void 0:e.payload}getFeatureFlagResult(t,e={}){if(e.fresh&&!this._d)return;if(!(this.pd||this.getFlags()&&this.getFlags().length>0))return void this.A.warn('getFeatureFlagResult for key "'+t+Oy);if(this.Zd())return;const n=this.getFlagVariants(),r=t in n,s=n[t],i=this.getFlagPayloads()[t],o=String(s),l=this.Wd("$feature_flag_request_id")||void 0,u=this.Wd("$feature_flag_evaluated_at")||void 0;let d,f=this.Wd("$flag_call_reported")||{};if(this.Mr.deduplicateCallsPerSession){var p;const O=(p=this.bo)===null||p===void 0?void 0:p.session.sessionId,N=this.Wd(Ef);O&&O!==N&&(f={},d=O)}if(e.send_event||!("send_event"in e))if(t in f&&f[t].includes(o))d&&this.$t({[Oa]:f,[Ef]:d});else{var g,v,w,_,x,S,k,C,T,A,I,M;We(f[t])?f[t].push(o):f[t]=[o],this.$t(H({[Oa]:f},d?{[Ef]:d}:{}));const O=this.getFeatureFlagDetails(t),N=[...(g=this.Wd("$feature_flag_errors"))!==null&&g!==void 0?g:[]];ce(s)&&N.push("flag_missing");const D={$feature_flag:t,$feature_flag_response:s,$feature_flag_payload:i??null,$feature_flag_request_id:l,$feature_flag_evaluated_at:u,$feature_flag_bootstrapped_response:(v=(w=this.Mr.bootstrap)===null||w===void 0||(w=w.featureFlags)===null||w===void 0?void 0:w[t])!==null&&v!==void 0?v:null,$feature_flag_bootstrapped_payload:(_=(x=this.Mr.bootstrap)===null||x===void 0||(x=x.featureFlagPayloads)===null||x===void 0?void 0:x[t])!==null&&_!==void 0?_:null,$used_bootstrap_value:!this._d};ce(O==null||(S=O.metadata)===null||S===void 0?void 0:S.has_experiment)||(D.$feature_flag_has_experiment=O.metadata.has_experiment),ce(O==null||(k=O.metadata)===null||k===void 0?void 0:k.version)||(D.$feature_flag_version=O.metadata.version);const $=(C=O==null||(T=O.reason)===null||T===void 0?void 0:T.description)!==null&&C!==void 0?C:O==null||(A=O.reason)===null||A===void 0?void 0:A.code;var R;$&&(D.$feature_flag_reason=$),!(O==null||(I=O.metadata)===null||I===void 0)&&I.id&&(D.$feature_flag_id=O.metadata.id),ce(O==null?void 0:O.original_variant)&&ce(O==null?void 0:O.original_enabled)||(D.$feature_flag_original_response=ce(O.original_variant)?O.original_enabled:O.original_variant),!(O==null||(M=O.metadata)===null||M===void 0)&&M.original_payload&&(D.$feature_flag_original_payload=O==null||(R=O.metadata)===null||R===void 0?void 0:R.original_payload),N.length&&(D.$feature_flag_error=N.join(",")),this.nv(D)}else d&&this.$t({[Oa]:f,[Ef]:d});return r?{key:t,enabled:!!s,variant:typeof s=="string"?s:void 0,payload:v8(i)}:void 0}nv(t){try{var e;(e=this.bo)===null||e===void 0||e.capture("$feature_flag_called",t)}catch(n){this.A.error("Failed to capture feature flag call",n)}}getRemoteConfigPayload(t,e){this.sv(t,e)}sv(t,e){var n=this;return Gt(function*(){const r=n.bo;if(!r)return;const s={distinct_id:r.distinctId,token:r.projectToken,person_properties:{$lib:r.library.name,$lib_version:r.library.version}},i=n.Kd();i.length&&(s.evaluation_contexts=i);const o=n.Xd();let l;ce(o)||(s.flag_keys=o);try{var u;const d=(u=(yield r.sendRequest("/flags/?v=2",{target:"flags",method:"POST",body:s,compression:n.Mr.compression,sentAt:"body",timeoutMs:n.Mr.requestTimeoutMs})).json)===null||u===void 0?void 0:u.featureFlagPayloads;l=(d==null?void 0:d[t])||void 0}catch(d){return void n.A.error("Remote config feature flag request failed",d)}try{e(l)}catch(d){n.A.error("Remote config feature flag callback failed",d)}})()}isFeatureEnabled(t,e={}){if(e.fresh&&!this._d)return e.defaultValue;if(!(this.pd||this.getFlags()&&this.getFlags().length>0))return this.A.warn('isFeatureEnabled for key "'+t+Oy),e.defaultValue;const n=this.getFeatureFlag(t,e);return ce(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.Yd(t,e,n)}Yd(t,e,n){if(!this.bo)return;this.pd=!0;const r=((s,i={},o={},l={},u,d=Sk)=>{const f=((C,T)=>{const A=C.flags;if(A){const I=Object.fromEntries(Object.keys(A).map(R=>{var O;return[R,(O=A[R].variant)!==null&&O!==void 0?O:A[R].enabled]})),M=Object.fromEntries(Object.keys(A).filter(R=>A[R].enabled).filter(R=>{var O;return!ce((O=A[R].metadata)===null||O===void 0?void 0:O.payload)}).map(R=>{var O;return[R,(O=A[R].metadata)===null||O===void 0?void 0:O.payload]}));return H(H({},C),{},{featureFlags:I,featureFlagPayloads:M})}return C.featureFlags&&T.warn("Using an older version of the feature flags endpoint. Please upgrade your PostHog server to the latest version"),C})(s,d),p=f.flags,g=f.featureFlags,v=f.featureFlagPayloads;if(!g)return;const w=s.requestId,_=s.evaluatedAt;if(We(g)){d.warn("v1 of the feature flags endpoint is deprecated. Please use the latest version.");const C={};if(g)for(let T=0;g.length>T;T++)C[g[T]]=!0;return{[Io]:g,[vi]:C,[Df]:!1}}let x=g,S=v,k=p;if(u!=null&&u.partialResponse){const C=Object.keys(x),T=S||{};x=H(H({},i),x),S=H(H({},o),T),C.forEach(A=>{A in T||S==null||delete S[A]}),k=H(H({},l),k)}else if(s.errorsWhileComputingFlags)if(p){const C=new Set(Object.keys(p).filter(A=>{var I;return!(!((I=p[A])===null||I===void 0)&&I.failed)}));x=H(H({},i),Object.fromEntries(Object.entries(x).filter(([A])=>C.has(A))));const T=Object.fromEntries(Object.entries(S||{}).filter(([A])=>C.has(A)));S=H(H({},o),T),C.forEach(A=>{A in T||S==null||delete S[A]}),k=H(H({},l),Object.fromEntries(Object.entries(k||{}).filter(([A])=>C.has(A))))}else x=H(H({},i),x),S=H(H({},o),S),k=H(H({},l),k);return H(H({[Io]:Object.keys(Pk(x)),[vi]:x||{},[Ra]:S||{},[nc]:k||{},[Df]:s.minimalFlagCalledEvents===!0},w?{[rc]:w}:{}),_?{[$a]:_}:{})})(t,this.getFlagVariants(),this.getFlagPayloads(),this.getFlagsWithDetails(),n,this.A);if(r)if((n==null?void 0:n.persist)===!1){const s=!ce(this.bo.kv.get(vi));this.Vd=r,s||this.$t(r)}else this.Nd(),this.Jd(r,t,!!(n!=null&&n.partialResponse)),this.$t(r);else e&&this.Gd();e||(this.wd=!1),this.jd(e)}override(t,e=!1){this.A.warn("override is deprecated. Please use overrideFeatureFlags instead."),this.overrideFeatureFlags({flags:t,suppressWarning:e})}overrideFeatureFlags(t){this.rv(t)}rv(t){if(this.bo){if(t===!1)return this.Pt([Oi,Fl]),this.jd(),void Pl.info("All overrides cleared");if(We(t))return this.$t({[Oi]:Ck(t)}),this.jd(),void Pl.info("Flag overrides set",{flags:t});if(t&&typeof t=="object"&&("flags"in t||"payloads"in t)){var e;const n=t;this.hd=!!((e=n.suppressWarning)!==null&&e!==void 0&&e);const r={},s=n.flags,i=n.payloads;return s&&(r[Oi]=We(s)?Ck(s):s),i&&(r[Fl]=i),Object.keys(r).length&&this.$t(r),s===!1&&i===!1?this.Pt([Oi,Fl]):s===!1?this.Pt(Oi):i===!1&&this.Pt(Fl),this.jd(),s===!1?Pl.info("Flag overrides cleared"):s&&Pl.info("Flag overrides set",{flags:s}),void(i===!1?Pl.info("Payload overrides cleared"):i&&Pl.info("Payload overrides set",{payloads:i}))}if(t&&typeof t=="object")return this.$t({[Oi]:t}),this.jd(),void Pl.info("Flag overrides set",{flags:t});this.A.warn("Invalid overrideOptions provided to overrideFeatureFlags",{overrideOptions:t})}else this.A.warn("posthog.featureFlags.overrideFeatureFlags called before feature flags were ready")}onFeatureFlags(t){if(this.addFeatureFlagsHandler(t),this.pd){const{flags:e,flagVariants:n}=this.ov();try{t(e,n)}catch(r){this.A.error("Error while running feature flags callback",r)}}return()=>this.removeFeatureFlagsHandler(t)}updateEarlyAccessFeatureEnrollment(t,e,n){var r;const s=(this.Wd("$early_access_features")||[]).find(d=>d.flagKey===t),i={[`$feature_enrollment/${t}`]:e},o={$feature_flag:t,$feature_enrollment:e,$set:i};s&&(o.$early_access_feature_name=s.name),n&&(o.$feature_enrollment_stage=n);const l=H(H({},this.getFlagVariants()),{},{[t]:e});(r=this._instance)===null||r===void 0||(r=r.persistence)===null||r===void 0||r.markCrossTabFeatureFlagChanges({$active_feature_flags:[t],$enabled_feature_flags:[t],$stored_person_properties:Object.keys(i)}),this.$t({[Io]:Object.keys(Pk(l)),[vi]:l,[Ma]:H(H({},this.Wd("$stored_person_properties")||{}),i)}),this.jd();try{var u;(u=this.bo)===null||u===void 0||u.capture("$feature_enrollment_update",o)}catch(d){this.A.error("Failed to capture early access feature enrollment",d)}}getEarlyAccessFeatures(t,e=!1,n){const r=this.Wd(f2);!r||e?this.av(t,n):t(r)}av(t,e){var n=this;return Gt(function*(){const r=n.bo;if(!r)return;const s=e?`&${e.map(o=>`stage=${o}`).join("&")}`:"";let i;try{const o=yield r.sendRequest(`/api/early_access_features/?token=${r.projectToken}${s}`,{target:"api",method:"GET",sentAt:"query"});if(!o.json)return;i=o.json.earlyAccessFeatures,n.$t({[f2]:i})}catch(o){return void n.A.error("Early access feature request failed",o)}try{t(i)}catch(o){n.A.error("Early access feature callback failed",o)}})()}ov(){const t=this.getFlags(),e=this.getFlagVariants();return{flags:t.filter(n=>e[n]),flagVariants:Object.keys(e).filter(n=>e[n]).reduce((n,r)=>(n[r]=e[r],n),{})}}jd(t){this.qd();const{flags:e,flagVariants:n}=this.ov();this.featureFlagEventHandlers.forEach(r=>{try{r(e,n,{errorsLoading:t})}catch(s){this.A.error("Error while running feature flags callback",s)}})}setPersonPropertiesForFlags(t,e=!0){this.lv(t,e)}lv(t,e=!0){const n=this.Wd("$stored_person_properties")||{},r=(t==null?void 0:t.$set)||(t!=null&&t.$set_once?{}:t),s=t==null?void 0:t.$set_once,i={};if(s)for(const o in s)({}).hasOwnProperty.call(s,o)&&(o in n||(i[o]=s[o]));this.$t({[Ma]:H(H(H({},n),i),r)}),e&&this.reloadFeatureFlags()}unsetPersonPropertiesForFlags(t,e=!0){const n=H({},this.Wd("$stored_person_properties")||{});t.forEach(r=>{delete n[r]}),this.$t({[Ma]:n}),e&&this.reloadFeatureFlags()}resetPersonPropertiesForFlags(t=!0){this.Pt(Ma),t&&this.reloadFeatureFlags()}setGroupPropertiesForFlags(t,e=!0){const n=this.Wd("$stored_group_properties")||{},r=H({},n);for(const s of Object.keys(t))r[s]=H(H({},n[s]),t[s]);this.$t({[Ia]:r}),e&&this.reloadFeatureFlags()}resetGroupPropertiesForFlags(t){if(t){const e=this.Wd("$stored_group_properties")||{};this.$t({[Ia]:H(H({},e),{},{[t]:{}})})}else this.Pt(Ia)}reset(){this.md++,this.bd=!1,this.dd={},this.vd={},this.Vd=void 0,this.pd=!1,this.yd=!1,this._d=!1,this.$anon_distinct_id=void 0,this.Ud(),this.hd=!1,this.kd=0}}},lV={sessionRecording:class{get Mr(){return this._instance.config}get Il(){return this._instance.persistence}get started(){var t;return!!(!((t=this.uv)===null||t===void 0)&&t.isStarted)}get status(){var t,e;return this.hv==="awaiting_config"||this.hv==="missing_config"?this.hv:(t=(e=this.uv)===null||e===void 0?void 0:e.status)!==null&&t!==void 0?t:this.hv}constructor(t){if(this._instance=t,this._forceAllowLocalhostNetworkCapture=!1,this.hv=Ry,this.dv=void 0,this.vv=!1,this.Je=(()=>{var e,n;if(!(de!=null&&de.visibilityState)||de.visibilityState==="visible")return!0;const r=J==null||(e=J.performance)===null||e===void 0||(n=e.getEntriesByType)===null||n===void 0?void 0:n.call(e,"visibility-state");return!(r!=null&&r.length)||r.some(s=>s.name==="visible")})(),this.sn=()=>{var e,n;(de==null?void 0:de.visibilityState)==="visible"&&(this.Je=!0,(e=this.uv)===null||e===void 0||(n=e.setDocumentWasEverVisible)===null||n===void 0||n.call(e,!0))},!this._instance.sessionManager)throw yo.error("started without valid sessionManager"),new Error("[SessionRecording] started without valid sessionManager. This is a bug.");if(this.Mr.cookieless_mode==="always")throw new Error('[SessionRecording] cannot be used with cookieless_mode="always"');de!=null&&de.addEventListener&&kt(de,"visibilitychange",this.sn)}initialize(){this.startIfEnabledOrStop()}dispose({discardBufferedEvents:t=!1}={}){var e;this.vv=!0,de==null||(e=de.removeEventListener)===null||e===void 0||e.call(de,"visibilitychange",this.sn),t?this.fv(!0):this.stopRecording()}get pv(){var t;const e=!!(!((t=this._instance.get_property("$session_recording_remote_config"))===null||t===void 0)&&t.enabled),n=!this.Mr.disable_session_recording,r=this.Mr.disable_session_recording||this._instance.consent.isOptedOut();return J&&e&&n&&!r}startIfEnabledOrStop(t){var e;if(this.vv||this.pv&&(!((e=this.uv)===null||e===void 0)&&e.isStarted))return;const n=!ce(Object.assign)&&!ce(Array.from);this.pv&&n?(this.gv(t),yo.info("starting")):(this.hv=Ry,this.stopRecording())}gv(t){var e,n;if(this.pv)if(this.hv!=="awaiting_config"&&this.hv!=="missing_config"&&(this.hv=vk),($e==null||(e=$e.__PosthogExtensions__)===null||e===void 0||(e=e.rrweb)===null||e===void 0?void 0:e.record)&&((n=$e.__PosthogExtensions__)===null||n===void 0?void 0:n.initSessionRecording))this.mv(t);else{var r,s;const i=this._instance.sessionManager;(r=$e.__PosthogExtensions__)===null||r===void 0||(s=r.loadExternalDependency)===null||s===void 0||s.call(r,this._instance,this.yv,o=>{if(!this.vv&&this.pv&&this._instance.sessionManager===i)return o?(this._instance.register_for_session({$sdk_debug_recording_script_not_loaded:!0}),yo.error("could not load recorder",o)):void this.mv(t);this.hv="disabled"})}}stopRecording(){var t,e;(t=this.dv)===null||t===void 0||t.call(this),this.dv=void 0,(e=this.uv)===null||e===void 0||e.stop()}fv(t=!1){var e,n;(e=this.dv)===null||e===void 0||e.call(this),this.dv=void 0,(n=this.uv)===null||n===void 0||n.discard({discardProducerEvents:t})}bv(){var t,e;(t=this.Il)===null||t===void 0||t.unregister("$session_is_sampled"),(e=this.Il)===null||e===void 0||e.unregister("$replay_sample_rate")}_v(t,e){if(Qe(t))return null;const n=mn(t)?t:parseFloat(t);return typeof(r=n)!="number"||!Number.isFinite(r)||0>r||r>1?(yo.warn(`${e} must be between 0 and 1. Ignoring invalid value:`,t),null):n;var r}wv(t){if(this.Il){var e,n;const r=this.Il,s=()=>{var i;const o=t.sessionRecording===!1?void 0:t.sessionRecording,l=this._v((i=this.Mr.session_recording)===null||i===void 0?void 0:i.sampleRate,"session_recording.sampleRate"),u=this._v(o==null?void 0:o.sampleRate,"remote config sampleRate"),d=l??u;Qe(d)&&this.bv();const f=o==null?void 0:o.minimumDurationMilliseconds;r.register({[Nf]:H(H({cache_timestamp:Date.now(),enabled:!!o},o),{},{networkPayloadCapture:H({capturePerformance:t.capturePerformance},o==null?void 0:o.networkPayloadCapture),canvasRecording:{enabled:o==null?void 0:o.recordCanvas,fps:o==null?void 0:o.canvasFps,quality:o==null?void 0:o.canvasQuality},sampleRate:d,minimumDurationMilliseconds:ce(f)?null:f,endpoint:o==null?void 0:o.endpoint,triggerMatchType:o==null?void 0:o.triggerMatchType,masking:o==null?void 0:o.masking,urlTriggers:o==null?void 0:o.urlTriggers,version:o==null?void 0:o.version,triggerGroups:o==null?void 0:o.triggerGroups})})};s(),(e=this.dv)===null||e===void 0||e.call(this),this.dv=(n=this._instance.sessionManager)===null||n===void 0?void 0:n.onSessionId(s)}}onRemoteConfig(t){const e=t.ok?t.config:void 0;return e&&"sessionRecording"in e?e.sessionRecording===!1?(this.wv(e),void this.fv()):(this.wv(e),void this.startIfEnabledOrStop()):(this.hv==="awaiting_config"&&(this.hv="missing_config",this._instance.register_for_session({[Cx]:!0}),yo.warn("config refresh failed, recording will not start until page reload")),void this.startIfEnabledOrStop())}log(t,e="log"){var n;!((n=this.uv)===null||n===void 0)&&n.log?this.uv.log(t,e):yo.warn("log called before recorder was ready")}get yv(){var t,e;const n=(t=this._instance)===null||t===void 0||(t=t.persistence)===null||t===void 0?void 0:t.get_property(Nf);return(n==null||(e=n.scriptConfig)===null||e===void 0?void 0:e.script)||"lazy-recorder"}Sv(){const t=this._instance.get_property(Nf);if(!t)return!1;let e;try{e=typeof t=="object"?t:JSON.parse(t)}catch(n){return yo.warn("persisted remote config for session recording is invalid and will be ignored",n),!1}return!Qe(e.cache_timestamp)&&36e5>=Date.now()-e.cache_timestamp}mv(t){var e,n,r;if(!this.vv&&this.pv&&this._instance.sessionManager){if(!(!((e=$e.__PosthogExtensions__)===null||e===void 0)&&e.initSessionRecording))return yo.warn("Called on script loaded before session recording is available. This can be caused by adblockers."),void this._instance.register_for_session({[Ex]:!0});var s;if(this.uv||(this.uv=(s=$e.__PosthogExtensions__)===null||s===void 0?void 0:s.initSessionRecording(this._instance,this.Je),this.uv._forceAllowLocalhostNetworkCapture=this._forceAllowLocalhostNetworkCapture),!this.Sv())return this.hv==="missing_config"||this.hv==="awaiting_config"?void 0:(this.hv="awaiting_config",yo.info("persisted remote config is stale, requesting fresh config before starting"),void new AT(this._instance).load());this.hv=vk,(n=(r=this.uv).setDocumentWasEverVisible)===null||n===void 0||n.call(r,this.Je),this.uv.start(t)}else this.hv=Ry}onRRwebEmit(t){var e,n;(e=this.uv)===null||e===void 0||(n=e.onRRwebEmit)===null||n===void 0||n.call(e,t)}overrideLinkedFlag(){var t,e;this.uv||(e=this.Il)===null||e===void 0||e.register({$replay_override_linked_flag:!0}),(t=this.uv)===null||t===void 0||t.overrideLinkedFlag()}overrideSampling(){var t,e;this.uv||(e=this.Il)===null||e===void 0||e.register({$replay_override_sampling:!0}),(t=this.uv)===null||t===void 0||t.overrideSampling()}overrideTrigger(t){var e,n;this.uv||(n=this.Il)===null||n===void 0||n.register({[t==="url"?"$replay_override_url_trigger":"$replay_override_event_trigger"]:!0}),(e=this.uv)===null||e===void 0||e.overrideTrigger(t)}get sdkDebugProperties(){var t;const e={};for(const r of VF){var n;const s=(n=this._instance.sessionPersistence)===null||n===void 0?void 0:n.get_property(r);ce(s)||(e[r]=s)}return H(H({},e),((t=this.uv)===null||t===void 0?void 0:t.sdkDebugProperties)||{$recording_status:this.status})}tryAddCustomEvent(t,e){var n;return!!(!((n=this.uv)===null||n===void 0)&&n.tryAddCustomEvent(t,e))}flushBeforeIdentityReset(){var t,e;(t=this.uv)===null||t===void 0||(e=t.flushBeforeIdentityReset)===null||e===void 0||e.call(t)}}},cV={autocapture:class extends NF{constructor(t){super(new DF(t)),this.instance=t}},historyAutocapture:class{constructor(t){this.xv=!1,this._instance=t,this.$v=this.Cv()}initialize(){this.startIfEnabled()}get isEnabled(){const t=this.Tv();return!!(t.path||t.search||this.Iv(t))}startIfEnabled(){this.isEnabled&&(ve.info("History API monitoring enabled, starting..."),this.monitorHistoryChanges())}startIfEnabledOrStop(){this.stop(),this.$v=this.Cv(),this.startIfEnabled()}stop(){this.Mv&&this.Mv(),this.Mv=void 0,this.Ev&&this.Ev(),this.Ev=void 0,ve.info("History API monitoring stopped")}monitorHistoryChanges(){J&&J.history&&(this.Pv("pushState"),this.Pv("replaceState"),this.Rv(),this.Iv()&&this.Av())}Pv(t){var e;if(!J||!((e=J.history[t])===null||e===void 0)&&e.__posthog_wrapped__)return;const n=this;dh(J.history,t,r=>function(s,i,o){var l;n.Ov(o)&&n.Fv(),r.call(this,s,i,o),n.Dv(t,!n.xv&&(J==null||(l=J.event)===null||l===void 0?void 0:l.type)!=="popstate")})}Cv(){const t=J==null?void 0:J.location;if(t!=null&&t.pathname)return{pathname:t.pathname,search:t.search,hash:t.hash}}Tv(){const t=this._instance.config.capture_pageview;return t==="history_change"?{path:!0}:dt(t)?t:{}}Iv(t=this.Tv()){return!!t.hash&&!this._instance.config.disable_capture_url_hashes}Lv(t){const e=this.Tv(),n=this.$v;return!(!n||!(e.path&&t.pathname!==n.pathname||e.search&&t.search!==n.search||this.Iv(e)&&t.hash!==n.hash))}Dv(t,e=!1){try{e||this.Fv();const n=this.Cv();if(!n)return;if(this.Lv(n)){const r=()=>this._instance.capture(Tx,{navigation_type:t});e?(this.Nv=r,Promise.resolve().then(()=>this.Fv())):r()}this.$v=n}catch(n){ve.error(`Error capturing ${t} pageview`,n)}}Ov(t){var e,n;return!(Qe(t)||!J)&&((e=Ho(String(t)))===null||e===void 0?void 0:e.href)!==((n=J.location)===null||n===void 0?void 0:n.href)}Fv(){const t=this.Nv;if(t){this.Nv=void 0,this.xv=!0;try{t()}catch(e){ve.error("Error capturing deferred pageview",e)}finally{this.xv=!1}this.$v=this.Cv()}}Rv(){if(this.Mv)return;const t=()=>{this.Dv("popstate")};kt(J,"popstate",t),this.Mv=()=>{J&&J.removeEventListener("popstate",t)}}Av(){if(this.Ev)return;const t=()=>{this.Dv("hashchange")};kt(J,"hashchange",t),this.Ev=()=>{J&&J.removeEventListener("hashchange",t)}}},heatmaps:class{get Mr(){return this.instance.config}constructor(t){var e;this.qv=!1,this.ko=!1,this.jv=null,this.instance=t,this.qv=!!(!((e=this.instance.persistence)===null||e===void 0)&&e.props[l2]),this.rageclicks=new JT(t.config.rageclick)}initialize(){this.startIfEnabled()}get flushIntervalMilliseconds(){let t=5e3;return dt(this.Mr.capture_heatmaps)&&this.Mr.capture_heatmaps.flush_interval_milliseconds&&(t=this.Mr.capture_heatmaps.flush_interval_milliseconds),t}get isEnabled(){return Qe(this.Mr.capture_heatmaps)?Qe(this.Mr.enable_heatmaps)?this.qv:this.Mr.enable_heatmaps:this.Mr.capture_heatmaps!==!1}startIfEnabled(){if(this.isEnabled){if(this.ko)return;HF.info("starting..."),this.Bv(),this.sn()}else{var t;clearInterval((t=this.jv)!==null&&t!==void 0?t:void 0),this.Hv(),this.getAndClearBuffer()}}onRemoteConfig(t){if(!t.ok)return;const e=t.config;if(!("heatmaps"in e))return;const n=!!e.heatmaps;this.instance.persistence&&this.instance.persistence.register({[l2]:n}),this.qv=n,this.startIfEnabled()}getAndClearBuffer(){const t=this.Rt;return this.Rt=void 0,t}zv(t){My(t.originalEvent)&&this.Ir(t.originalEvent,"deadclick")}sn(){this.jv&&clearInterval(this.jv),this.jv=(de==null?void 0:de.visibilityState)==="visible"?setInterval(this.yl.bind(this),this.flushIntervalMilliseconds):null}Bv(){J&&de&&(this.Uv=this.yl.bind(this),kt(J,Nm,this.Uv),this.Wv=t=>this.Ir(t||(J==null?void 0:J.event)),kt(de,"click",this.Wv,{capture:!0}),this.Vv=t=>this.Gv(t||(J==null?void 0:J.event)),kt(de,"mousemove",this.Vv,{capture:!0}),this.Qv=new B8(this.instance,H$,this.zv.bind(this)),this.Qv.startIfEnabledOrStop(),this.Jv=this.sn.bind(this),kt(de,oh,this.Jv),this.ko=!0)}Hv(){var t;J&&de&&(this.Uv&&J.removeEventListener(Nm,this.Uv),this.Wv&&de.removeEventListener("click",this.Wv,{capture:!0}),this.Vv&&de.removeEventListener("mousemove",this.Vv,{capture:!0}),this.Jv&&de.removeEventListener(oh,this.Jv),clearTimeout(this.Zv),(t=this.Qv)===null||t===void 0||t.stop(),this.ko=!1)}Kv(t,e){const n=this.instance.scrollManager.scrollY(),r=this.instance.scrollManager.scrollX(),s=this.instance.scrollManager.scrollElement(),i=(function(o,l,u){let d=o;for(;d&&Ki(d)&&!pr(d,"body");){if(d===u)return!1;let v;try{var f,p,g;v=(f=(p=(g=d.ownerDocument)===null||g===void 0?void 0:g.defaultView)!==null&&p!==void 0?p:J)===null||f===void 0?void 0:f.getComputedStyle(d).position}catch{return!1}if(Ze(l,v))return!0;d=dT(d)}return!1})($f(t),["fixed","sticky"],s);return{x:t.clientX+(i?0:r),y:t.clientY+(i?0:n),target_fixed:i,type:e}}Ir(t,e="click"){var n;if(L8(t.target)||!My(t))return;const r=this.Kv(t,e);!((n=this.rageclicks)===null||n===void 0)&&n.isRageClick(t.clientX,t.clientY,new Date().getTime())&&hT($f(t),this.instance.config.rageclick)&&this.Qs(H(H({},r),{},{type:"rageclick"})),this.Qs(r)}Gv(t){!L8(t.target)&&My(t)&&(clearTimeout(this.Zv),this.Zv=setTimeout(()=>{this.Qs(this.Kv(t,"mousemove"))},500))}Qs(t){if(!J)return;const e=this.Mr.disable_capture_url_hashes?Ua(J.location.href):J.location.href,n=this.Mr.custom_personal_data_properties,r=this.Mr.mask_personal_data_properties?[...ed,...n||[]]:[],s=ch(e,r,uh);this.Rt=this.Rt||{},this.Rt[s]||(this.Rt[s]=[]),this.Rt[s].push(t)}yl(){this.Rt&&!Kr(this.Rt)&&this.instance.capture("$$heatmap",{$heatmap_data:this.getAndClearBuffer()})}},deadClicksAutocapture:B8,webVitalsAutocapture:class{constructor(t){var e;this._instance=t,this.qv=!1,this.ko=!1,this.Rt={navigationKey:void 0,url:void 0,metrics:[],firstMetricTimestamp:void 0},this.Xv=()=>{clearTimeout(this.Yv),this.Yv=void 0,this.Rt.metrics.length!==0&&(this._instance.capture("$web_vitals",H({$current_url:this.Rt.url},this.Rt.metrics.reduce((n,r)=>H(H({},n),{},{[`$web_vitals_${r.name}_event`]:H({},r),[`$web_vitals_${r.name}_value`]:r.value}),{}))),this.Rt={navigationKey:void 0,url:void 0,metrics:[],firstMetricTimestamp:void 0})},this.tf=n=>{var r;if(this.Rt=this.Rt||{navigationKey:void 0,url:void 0,metrics:[],firstMetricTimestamp:void 0},Qe(n==null?void 0:n.name)||Qe(n==null?void 0:n.value))return void Cl.error("Invalid metric received",n);const s=typeof n.navigationURL=="string"?n.navigationURL:void 0,i=this.ef(s);if(ce(i))return;const o=mn(n.navigationId)||typeof n.navigationId=="string"?`navigation:${n.navigationId}`:`url:${i}`;if(this.if&&n.value>=this.if)return void Cl.error("Ignoring metric with value >= "+this.if,n);this.Rt.navigationKey!==o&&(this.Xv(),this.Yv=setTimeout(this.Xv,this.flushToCaptureTimeoutMs)),ce(this.Rt.navigationKey)&&(this.Rt.navigationKey=o,this.Rt.url=i),this.Rt.firstMetricTimestamp=ce(this.Rt.firstMetricTimestamp)?Date.now():this.Rt.firstMetricTimestamp;const l=(r=this._instance.sessionManager)===null||r===void 0?void 0:r.checkAndGetSessionAndWindowId(!0),u=H(H(H({},n),s?{navigationURL:i}:{}),{},{$current_url:i,timestamp:Date.now()});if(delete u.entries,dt(n.attribution)&&this.attributionMetrics.indexOf(n.name)>-1){const d={};for(const f of FF){const p=f==="url"&&typeof n.attribution[f]=="string"?this.ef(n.attribution[f]):n.attribution[f];ce(p)||(d[f]=p)}u.attribution=d}else delete u.attribution;ce(l)||(u.$session_id=l.sessionId,u.$window_id=l.windowId),this.Rt.metrics.push(u),this.Rt.metrics.length===this.allowedMetrics.length&&this.Xv()},this.nf=()=>{if(this.ko)return;let n,r,s,i,o=!1;const l=$e.__PosthogExtensions__,u=l==null?void 0:l.postHogWebVitalsCallbacksByFlavor,d=(u==null?void 0:u[this.sf])||(this.sf==="web-vitals"&&ce(u)?l==null?void 0:l.postHogWebVitalsCallbacks:void 0);if(!ce(d)){const g=d.withoutAttribution,v=this.attributionMetrics;o=!ce(g),n=v.indexOf("LCP")>-1?d.onLCP:(g==null?void 0:g.onLCP)||d.onLCP,r=v.indexOf("CLS")>-1?d.onCLS:(g==null?void 0:g.onCLS)||d.onCLS,s=v.indexOf("FCP")>-1?d.onFCP:(g==null?void 0:g.onFCP)||d.onFCP,i=v.indexOf("INP")>-1?d.onINP:(g==null?void 0:g.onINP)||d.onINP}if(!(n&&r&&s&&i))return void Cl.error("web vitals callbacks not loaded - not starting");const f={reportSoftNavs:this.useSoftNavs},p=o&&this.attributionMetrics.indexOf("INP")>-1?H(H({},f),{},{includeProcessedEventEntries:!1}):f;this.allowedMetrics.indexOf("LCP")>-1&&n(this.tf.bind(this),f),this.allowedMetrics.indexOf("CLS")>-1&&r(this.tf.bind(this),f),this.allowedMetrics.indexOf("FCP")>-1&&s(this.tf.bind(this),f),this.allowedMetrics.indexOf("INP")>-1&&i(this.tf.bind(this),p),this.ko=!0},this.qv=!!(!((e=this._instance.persistence)===null||e===void 0)&&e.props[d2]),this.startIfEnabled()}get rf(){return this._instance.config.capture_performance}get allowedMetrics(){var t,e;const n=dt(this.rf)?(t=this.rf)===null||t===void 0?void 0:t.web_vitals_allowed_metrics:void 0;return Qe(n)?((e=this._instance.persistence)===null||e===void 0?void 0:e.props.$web_vitals_allowed_metrics)||gk:n}get flushToCaptureTimeoutMs(){return(dt(this.rf)?this.rf.web_vitals_delayed_flush_ms:void 0)||5e3}get attributionMetrics(){const t=dt(this.rf)?this.rf.web_vitals_attribution:void 0;return Nr(t)?t?gk:[]:We(t)?t:$F}get useAttribution(){return this.attributionMetrics.length>0}get useSoftNavs(){const t=dt(this.rf)?this.rf.__preview_web_vitals_soft_navs:void 0;return t!=null&&t}get if(){const t=dt(this.rf)&&mn(this.rf.__web_vitals_max_value)?this.rf.__web_vitals_max_value:mk;return t>0&&6e4>=t?mk:t}get isEnabled(){const t=ln==null?void 0:ln.protocol;if(t!=="http:"&&t!=="https:")return Cl.info("Web Vitals are disabled on non-http/https protocols"),!1;const e=dt(this.rf)?this.rf.web_vitals:Nr(this.rf)?this.rf:void 0;return Nr(e)?e:this.qv}startIfEnabled(){this.isEnabled&&!this.ko&&(Cl.info("enabled, starting..."),this.Ho(this.nf))}onRemoteConfig(t){if(!t.ok)return;const e=t.config;if(!("capturePerformance"in e))return;const n=dt(e.capturePerformance)&&!!e.capturePerformance.web_vitals,r=dt(e.capturePerformance)?e.capturePerformance.web_vitals_allowed_metrics:void 0;this._instance.persistence&&(this._instance.persistence.register({[d2]:n}),this._instance.persistence.register({[F5]:r})),this.qv=n,this.startIfEnabled()}get sf(){return this.useSoftNavs?this.useAttribution?"web-vitals-with-attribution-soft-navs":"web-vitals-soft-navs":this.useAttribution?"web-vitals-with-attribution":"web-vitals"}Ho(t){var e;const n=$e.__PosthogExtensions__,r=this.sf,s=n==null?void 0:n.postHogWebVitalsCallbacksByFlavor;s!=null&&s[r]||r==="web-vitals"&&ce(s)&&(n!=null&&n.postHogWebVitalsCallbacks)?t():n==null||(e=n.loadExternalDependency)===null||e===void 0||e.call(n,this._instance,r,i=>{i?Cl.error("failed to load script",i):t()})}ef(t){const e=t||(J==null?void 0:J.location.href);if(!e)return void Cl.error("Could not determine current URL");const n=this._instance.config.disable_capture_url_hashes?Ua(e):e,r=this._instance.config.custom_personal_data_properties,s=this._instance.config.mask_personal_data_properties?[...ed,...r||[]]:[];return ch(n,s,uh)}}},uV={exceptionObserver:class{constructor(t){var e;this.nf=()=>{var n;if(!J||!this.isEnabled||!(!((n=$e.__PosthogExtensions__)===null||n===void 0)&&n.errorWrappingFunctions))return;const r=$e.__PosthogExtensions__.errorWrappingFunctions.wrapOnError,s=$e.__PosthogExtensions__.errorWrappingFunctions.wrapUnhandledRejection,i=$e.__PosthogExtensions__.errorWrappingFunctions.wrapConsoleError;try{!this.af&&this.Mr.capture_unhandled_errors&&(this.af=r(this.captureException.bind(this))),!this.lf&&this.Mr.capture_unhandled_rejections&&(this.lf=s(this.captureException.bind(this))),!this.uf&&this.Mr.capture_console_errors&&(this.uf=i(this.captureException.bind(this)))}catch(o){vf.error("failed to start",o),this.hf()}},this._instance=t,this.cf=!!(!((e=this._instance.persistence)===null||e===void 0)&&e.props[c2]),this.wt=new aj(H(H({},(function(n={}){var r,s,i,o;return{refillRate:(r=(s=n.exceptionRateLimiterRefillRate)!==null&&s!==void 0?s:n.__exceptionRateLimiterRefillRate)!==null&&r!==void 0?r:1,bucketSize:(i=(o=n.exceptionRateLimiterBucketSize)!==null&&o!==void 0?o:n.__exceptionRateLimiterBucketSize)!==null&&i!==void 0?i:10}})(this._instance.config.error_tracking)),{},{refillInterval:1e4,A:vf})),this.Mr=this.df(),this.startIfEnabledOrStop()}df(){const t=this._instance.config.capture_exceptions;let e={capture_unhandled_errors:!1,capture_unhandled_rejections:!1,capture_console_errors:!1};return dt(t)?e=H(H({},e),t):(ce(t)?this.cf:t)&&(e=H(H({},e),{},{capture_unhandled_errors:!0,capture_unhandled_rejections:!0})),e}get isEnabled(){return this.Mr.capture_console_errors||this.Mr.capture_unhandled_errors||this.Mr.capture_unhandled_rejections}startIfEnabledOrStop(){this.isEnabled?(vf.info("enabled"),this.hf(),this.Ho(this.nf)):this.hf()}Ho(t){var e,n,r;!((e=$e.__PosthogExtensions__)===null||e===void 0)&&e.errorWrappingFunctions?t():(n=$e.__PosthogExtensions__)===null||n===void 0||(r=n.loadExternalDependency)===null||r===void 0||r.call(n,this._instance,"exception-autocapture",s=>{if(s)return vf.error("failed to load script",s);t()})}hf(){var t,e,n;(t=this.af)===null||t===void 0||t.call(this),this.af=void 0,(e=this.lf)===null||e===void 0||e.call(this),this.lf=void 0,(n=this.uf)===null||n===void 0||n.call(this),this.uf=void 0}onRemoteConfig(t){if(!t.ok)return;const e=t.config;"autocaptureExceptions"in e&&(this.cf=!!e.autocaptureExceptions||!1,this._instance.persistence&&this._instance.persistence.register({[c2]:this.cf}),this.Mr=this.df(),this.startIfEnabledOrStop())}onConfigChange(){this.Mr=this.df()}captureException(t){try{var e,n,r;const s=(e=t==null||(n=t.$exception_list)===null||n===void 0||(n=n[0])===null||n===void 0?void 0:n.type)!==null&&e!==void 0?e:"Exception";if(this.wt.consumeRateLimit(s))return void vf.info("Skipping exception capture because of client rate limiting.",{exception:s});(r=this._instance.exceptions)===null||r===void 0||r.sendExceptionEvent(t)}catch{}}},exceptions:class{constructor(t){var e,n;this.vf=[],this.ff=new _j([new Lj,new Uj,new Dj,new Nj,new Hj,new Vj,new $j,new zj],(function(r,...s){return(i,o=0)=>{const l=[],u=i.split(`
19
+ `),d=Math.min(u.length,o+1e3),f=[];for(let v=o;d>v;v++){const w=u[v];if(w.length>1024)continue;const _=g8.test(w)?w.replace(g8,"$1"):w;if(!_.match(/\S*Error: /)){for(const x of s){const S=x(_,r);if(S){l.push(S);const k=Rj(l);if(k){for(let C=f.length-1;C>=0;C--){const T=f[C];if(k.start>=T.start+T.length)break;f.pop()}f.push(k)}break}}if(Ij(l,f)>=50)break}}const p=[...f].sort((v,w)=>w.start-v.start),g=p[p.length-1];if(g){const v=x5(l,g);l.splice(g.start-v,v);for(const w of p)w.start-=v}for(const v of p)Mj(l,v);return f.some(v=>v.start===0&&l.length===v.length)&&(function(v){const w=v.map(x=>`${x.function}|${x.filename}|${x.lineno}|${x.colno}|${x.module}`);let _=0;for(let x=1;w.length>x;x++)Oj(w,x,_)&&(_=x);v.push(...v.splice(0,_))})(l),(function(v){if(!v.length)return[];const w=Array.from(v);return w.reverse(),w.slice(0,50).map(_=>{return H(H({},_),{},{filename:_.filename||(x=w,x[x.length-1]||{}).filename,function:_.function||"?"});var x})})(l)}})("web:javascript",Cj,Aj)),this._instance=t,this.vf=(e=(n=this._instance.persistence)===null||n===void 0?void 0:n.get_property("$error_tracking_suppression_rules"))!==null&&e!==void 0?e:[],this.pf=Rm(this.gf()),this.mf=new Zj(this.pf)}onConfigChange(){this.pf=Rm(this.gf()),this.mf.setConfig(this.pf)}onRemoteConfig(t){var e,n,r;if(!t.ok)return;const s=t.config;if(!("errorTracking"in s))return;const i=(e=(n=s.errorTracking)===null||n===void 0?void 0:n.suppressionRules)!==null&&e!==void 0?e:[],o=(r=s.errorTracking)===null||r===void 0?void 0:r.captureExtensionExceptions;this.vf=i,this._instance.persistence&&this._instance.persistence.register({[j5]:this.vf,[u2]:o})}get yf(){var t;const e=!!this._instance.get_property(u2),n=this._instance.config.error_tracking.captureExtensionExceptions;return(t=n??e)!==null&&t!==void 0&&t}buildProperties(t,e){return this.ff.buildFromUnknown(t,{syntheticException:e==null?void 0:e.syntheticException,mechanism:{handled:e==null?void 0:e.handled}})}addExceptionStep(t,e){if(this.pf.enabled)try{if(!lt(t)||t.trim().length===0)return void ci.warn("Ignoring exception step because message must be a non-empty string");const{sanitizedProperties:n,droppedKeys:r}=(function(s){if(!s)return{sanitizedProperties:{},droppedKeys:[]};const i=[];return{sanitizedProperties:Object.keys(s).reduce((o,l)=>Bj.has(l)?(i.push(l),o):(o[l]=s[l],o),{}),droppedKeys:i}})(this.bf(e));r.length>0&&ci.warn("Ignoring reserved exception step fields",{droppedKeys:r}),this.mf.add(H({[Tm]:t,[Am]:new Date().toISOString()},n))}catch(n){ci.error("Failed to add exception step. Ignoring breadcrumb.",n)}}sendExceptionEvent(t){try{const e=t.$exception_list;if(this._f(e)){if(this.wf(e))return this.kf("Exception dropped: matched a suppression rule"),void ci.info("Skipping exception capture because a suppression rule matched");if(!this.yf&&this.Sf(e))return this.kf("Exception dropped: thrown by a browser extension"),void ci.info("Skipping exception capture because it was thrown by an extension");if(!this.yf&&this.xf(e))return this.kf("Exception dropped: thrown by an injected browser script"),void ci.info("Skipping exception capture because it was thrown by an injected browser script");if(!this._instance.config.error_tracking.__capturePostHogExceptions&&this.$f(e))return this.kf("Exception dropped: thrown by the PostHog SDK"),void ci.info("Skipping exception capture because it was thrown by the PostHog SDK")}const n=this.pf.enabled&&Qe(t.$exception_steps)?this.Cf(t):t,r=(function(){const s=globalThis._posthogReleaseId;return typeof s=="string"&&s.length>0?s:void 0})();r&&(n.$release_id=r);try{const s=this._instance.capture("$exception",n,{_noTruncate:!0,_batchKey:"exceptionEvent",gh:!0});return s&&this.mf.clear(),s}catch(s){return Tk(s)||ci.error("Failed to capture exception event. Dropping this exception.",s),void this.mf.clear()}}catch(e){return void(Tk(e)||ci.error("Failed to process exception event. Ignoring this exception.",e))}}Cf(t){try{const e=this.mf.getAttachable();return e.length===0?t:H(H({},t),{},{$exception_steps:e})}catch(e){return ci.error("Failed to read buffered exception steps. Capturing exception without steps.",e),t}}kf(t){this.pf.enabled&&this.mf.add({[Tm]:t,[Am]:new Date().toISOString()})}bf(t){return dt(t)?H({},t):{}}gf(){var t,e;return(t=(e=this._instance.config.error_tracking)===null||e===void 0?void 0:e.exception_steps)!==null&&t!==void 0?t:{}}wf(t){if(t.length===0)return!1;try{const e=t.reduce((n,{type:r,value:s})=>(lt(r)&&r.length>0&&n.$exception_types.push(r),lt(s)&&s.length>0&&n.$exception_values.push(s),n),{$exception_types:[],$exception_values:[]});return this.vf.some(n=>{const r=n.values.map(s=>{const i=KT[s.operator],o=e[s.key];if(!i||!o)return!1;const l=We(s.value)?s.value:[s.value];return l.length>0&&i(l,o)});return n.type==="OR"?r.some(Boolean):r.every(Boolean)})}catch(e){return ci.warn("Failed to evaluate suppression rules. Capturing the exception.",e),!1}}Sf(t){const e=t.flatMap(r=>{var s,i;return(s=(i=r.stacktrace)===null||i===void 0?void 0:i.frames)!==null&&s!==void 0?s:[]}),n=e.filter(({filename:r})=>!!r&&JF.some(s=>r.startsWith(s)));return n.length!==0&&(!n.every(({filename:r})=>!!r&&r.startsWith(C2))||t.some(({type:r,value:s})=>r==="NoResponse"||lt(s)&&QF.some(({value:i,exact:o})=>o?s===i:s.includes(i)))&&!e.some(({in_app:r,filename:s})=>r&&!(s!=null&&s.startsWith(C2))))}xf(t){return t.some(({value:e})=>lt(e)&&eV.some(n=>e.includes(n)))}$f(t){if(t.length>0){var e,n,r,s;const i=(e=(n=t[0].stacktrace)===null||n===void 0?void 0:n.frames)!==null&&e!==void 0?e:[],o=i[i.length-1];return(r=o==null||(s=o.filename)===null||s===void 0?void 0:s.includes("posthog.com/static"))!==null&&r!==void 0&&r}return!1}_f(t){return!Qe(t)&&We(t)}}},dV=H({productTours:class{get Il(){return this._instance.persistence}constructor(t){this.Tf=null,this.If=null,this._instance=t}initialize(){this.loadIfEnabled()}onRemoteConfig(t){if(!t.ok)return;const e=t.config;if("productTours"in e){var n,r;if(this.Il&&this.Il.register({[Sx]:!!e.productTours}),!Iy(this._instance))return!this.Tf&&Qe((n=this.Il)===null||n===void 0?void 0:n.props.ph_product_tours)||w0.info("product tours disabled; stopping and clearing cached tours"),(r=this.Tf)===null||r===void 0||r.stop(),this.Tf=null,void this.clearCache();this.loadIfEnabled()}}loadIfEnabled(){!this.Tf&&Iy(this._instance)&&this.Ho(()=>this.Mf())}Ho(t){var e,n,r;!((e=$e.__PosthogExtensions__)===null||e===void 0)&&e.generateProductTours?t():(n=$e.__PosthogExtensions__)===null||n===void 0||(r=n.loadExternalDependency)===null||r===void 0||r.call(n,this._instance,"product-tours",s=>{s?w0.error("Could not load product tours script",s):t()})}Mf(){var t;!this.Tf&&(!((t=$e.__PosthogExtensions__)===null||t===void 0)&&t.generateProductTours)&&(this.Tf=$e.__PosthogExtensions__.generateProductTours(this._instance,!0))}getProductTours(t,e=!1){if(We(this.If)&&!e)return void t(this.If,{isLoaded:!0});const n=this.Il;if(n){const r=n.props[h2];if(We(r)&&!e)return this.If=r,void t(r,{isLoaded:!0})}this._instance._send_request({url:this._instance.requestRouter.endpointFor("api",`/api/product_tours/?token=${this._instance.config.token}`),method:"GET",timestampMode:"query",callback:r=>{if(!Iy(this._instance))return void t([],{isLoaded:!0});const s=r.statusCode;if(s!==200||!r.json){const o=`Product Tours API could not be loaded, status: ${s}`;return s===0?r.error||w0.warn(o):w0.error(o),void t([],{isLoaded:!1,error:o})}const i=We(r.json.product_tours)?r.json.product_tours:[];this.If=i,n&&n.register({[h2]:i}),t(i,{isLoaded:!0})}})}getActiveProductTours(t){Qe(this.Tf)?t([],{isLoaded:!1,error:"Product tours not loaded"}):this.Tf.getActiveProductTours(t)}showProductTour(t){var e;(e=this.Tf)===null||e===void 0||e.showTourById(t)}previewTour(t){this.Tf?this.Tf.previewTour(t):this.Ho(()=>{var e;this.Mf(),(e=this.Tf)===null||e===void 0||e.previewTour(t)})}dismissProductTour(){var t;(t=this.Tf)===null||t===void 0||t.dismissTour("user_clicked_skip")}nextStep(){var t;(t=this.Tf)===null||t===void 0||t.nextStep()}previousStep(){var t;(t=this.Tf)===null||t===void 0||t.previousStep()}clearCache(){var t;this.If=null,(t=this.Il)===null||t===void 0||t.unregister("ph_product_tours")}resetTour(t){var e;(e=this.Tf)===null||e===void 0||e.resetTour(t)}resetAllTours(){var t;(t=this.Tf)===null||t===void 0||t.resetAllTours()}cancelPendingTour(t){var e;(e=this.Tf)===null||e===void 0||e.cancelPendingTour(t)}}},Dg),fV={siteApps:class{constructor(t){this._instance=t,this.Ef=0,this.Pf=[],this.apps={}}get isEnabled(){return!!this._instance.config.opt_in_site_apps}Rf(t,e){if(!e)return;const n=this.globalsForEvent(e);this.Pf.push(n),this.Pf.length>1e3&&(this.Pf=this.Pf.slice(10))}get siteAppLoaders(){var t;return(t=$e._POSTHOG_REMOTE_CONFIG)===null||t===void 0||(t=t[this._instance.config.token])===null||t===void 0?void 0:t.siteApps}initialize(){if(this.isEnabled){const t=this._instance._addCaptureHook(this.Rf.bind(this));this.Af=()=>{t(),this.Pf=[],this.Af=void 0}}}globalsForEvent(t){var e,n,r,s,i,o,l;if(!t)throw new Error("Event payload is required");const u={},d=this._instance.get_property("$groups")||[],f=this._instance.get_property("$stored_group_properties")||{};for(const[v,w]of Object.entries(f))u[v]={id:d[v],type:v,properties:w};const{$set_once:p,$set:g}=t;return{event:H(H({},E5(t,zF)),{},{properties:H(H(H({},t.properties),g?{$set:H(H({},(e=(n=t.properties)===null||n===void 0?void 0:n.$set)!==null&&e!==void 0?e:{}),g)}:{}),p?{$set_once:H(H({},(r=(s=t.properties)===null||s===void 0?void 0:s.$set_once)!==null&&r!==void 0?r:{}),p)}:{}),elements_chain:(i=(o=t.properties)===null||o===void 0?void 0:o.$elements_chain)!==null&&i!==void 0?i:"",distinct_id:(l=t.properties)===null||l===void 0?void 0:l.distinct_id}),person:{properties:this._instance.get_property("$stored_person_properties")},groups:u}}Of(t){var e;const n=(e=t.tagName)===null||e===void 0?void 0:e.toLowerCase();return n==="style"&&this._instance.config.prepare_external_dependency_stylesheet?this._instance.config.prepare_external_dependency_stylesheet(t)||(Ti.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)||(Ti.error("prepare_external_dependency_script returned null"),null):t}Ff(){var t,e,n,r,s,i,o,l;if(!this._instance.config.prepare_external_dependency_stylesheet&&!this._instance.config.prepare_external_dependency_script)return()=>{};const u=de==null?void 0:de.defaultView,d=u==null||(t=u.Node)===null||t===void 0?void 0:t.prototype;if(!u||!d)return()=>{};if(this.Ef++,this.Df)return this.Lf();const f=[],p=this,g=new WeakSet,v=(x,S,k)=>{if(!(x!=null&&x[S]))return;const C=x[S];x[S]=k(C),f.push(()=>{x[S]=C})},w=x=>{if(g.has(x))return x;const S=p.Of(x);return S&&g.add(S),S},_=x=>x.map(S=>typeof S=="string"?S:w(S)).filter(S=>!cn(S));return v(d,"appendChild",x=>function(S){const k=w(S);return k?x.call(this,k):S}),v(d,"insertBefore",x=>function(S,k){const C=w(S);return C?x.call(this,C,k):S}),v(d,"replaceChild",x=>function(S,k){const C=w(S);return C?x.call(this,C,k):k}),[(e=u.Element)===null||e===void 0?void 0:e.prototype,(n=u.Document)===null||n===void 0?void 0:n.prototype,(r=u.DocumentFragment)===null||r===void 0?void 0:r.prototype].forEach(x=>{v(x,"append",S=>function(...k){return S.apply(this,_(k))}),v(x,"prepend",S=>function(...k){return S.apply(this,_(k))})}),[(s=u.Element)===null||s===void 0?void 0:s.prototype,(i=u.CharacterData)===null||i===void 0?void 0:i.prototype,(o=u.DocumentType)===null||o===void 0?void 0:o.prototype].forEach(x=>{v(x,"before",S=>function(...k){return S.apply(this,_(k))}),v(x,"after",S=>function(...k){return S.apply(this,_(k))}),v(x,"replaceWith",S=>function(...k){const C=_(k);return k.length&&!C.length?void 0:S.apply(this,C)})}),v((l=u.Element)===null||l===void 0?void 0:l.prototype,"insertAdjacentElement",x=>function(S,k){const C=w(k);return C?x.call(this,S,C):null}),this.Df=()=>{f.forEach(x=>x()),this.Df=void 0},this.Lf()}Lf(){let t=!1;return()=>{var e;t||(t=!0,this.Ef--,this.Ef===0&&((e=this.Df)===null||e===void 0||e.call(this)))}}Nf(t,e=!0){const n=this.Ff();try{const r=t(n);return e&&n(),r}catch(r){throw n(),r}}setupSiteApp(t){const e=this.apps[t.id],n=()=>{var i;!e.errored&&this.Pf.length&&(Ti.info(`Processing ${this.Pf.length} events for site app with id ${t.id}`),this.Pf.forEach(o=>this.Nf(()=>{var l;return(l=e.processEvent)===null||l===void 0?void 0:l.call(e,o)})),e.processedBuffer=!0),Object.values(this.apps).every(o=>o.processedBuffer||o.errored)&&((i=this.Af)===null||i===void 0||i.call(this))};let r=!1;const s=i=>{e.errored=!i,e.loaded=!0,Ti.info(`Site app with id ${t.id} ${i?"loaded":"errored"}`),r&&n()};try{const{processEvent:i}=this.Nf(o=>t.init({posthog:this._instance,callback(l){o(),s(l)}}),!1);i&&(e.processEvent=i),r=!0}catch(i){Ti.error(yk+t.id,i),s(!1)}if(r&&e.loaded)try{n()}catch(i){Ti.error(`Error while processing buffered events PostHog app with config id ${t.id}`,i),e.errored=!0}}qf(){const t=this.siteAppLoaders||[];for(const e of t)this.apps[e.id]={id:e.id,loaded:!1,errored:!1,processedBuffer:!1};for(const e of t)this.setupSiteApp(e)}jf(t){if(Object.keys(this.apps).length===0)return;const e=this.globalsForEvent(t);for(const n of Object.values(this.apps))try{this.Nf(()=>{var r;return(r=n.processEvent)===null||r===void 0?void 0:r.call(n,e)})}catch(r){Ti.error(`Error while processing event ${t.event} for site app ${n.id}`,r)}}onRemoteConfig(t){var e,n,r;if(!((e=this.siteAppLoaders)===null||e===void 0)&&e.length)return this.isEnabled?(this.qf(),void this._instance.on("eventCaptured",l=>this.jf(l))):void Ti.error('PostHog site apps are disabled. Enable the "opt_in_site_apps" config to proceed.');if((n=this.Af)===null||n===void 0||n.call(this),!t.ok)return;const s=t.config;if(!((r=s.siteApps)===null||r===void 0)&&r.length)if(this.isEnabled)for(const{id:l,url:u}of s.siteApps){var i,o;$e[`__$$ph_site_app_${l}`]=this._instance,(i=$e.__PosthogExtensions__)===null||i===void 0||(o=i.loadSiteApp)===null||o===void 0||o.call(i,this._instance,u,d=>{if(d)return Ti.error(yk+l,d)})}else Ti.error('PostHog site apps are disabled. Enable the "opt_in_site_apps" config to proceed.')}}},hV={tracingHeaders:class{constructor(t){this._instance=t,this.Bf=void 0,this.Hf=void 0,this.zf=void 0,this.nf=()=>{const e=this.Uf();var n,r;e?(ce(this.Bf)&&(this.Bf=(n=$e.__PosthogExtensions__)===null||n===void 0||(n=n.tracingHeadersPatchFns)===null||n===void 0?void 0:n._patchXHR(e,()=>this._instance.get_distinct_id(),this._instance.sessionManager)),ce(this.Hf)&&(this.Hf=(r=$e.__PosthogExtensions__)===null||r===void 0||(r=r.tracingHeadersPatchFns)===null||r===void 0?void 0:r._patchFetch(e,()=>this._instance.get_distinct_id(),this._instance.sessionManager))):this.hf()}}initialize(){this.startIfEnabledOrStop()}Ho(t){var e,n,r;!((e=$e.__PosthogExtensions__)===null||e===void 0)&&e.tracingHeadersPatchFns?t():(n=$e.__PosthogExtensions__)===null||n===void 0||(r=n.loadExternalDependency)===null||r===void 0||r.call(n,this._instance,"tracing-headers",s=>{if(s)return jF.error("failed to load script",s);t()})}Wf(){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}Uf(){const t=this.Wf();return We(t)?(We(this.zf)?this.zf.splice(0,this.zf.length,...t):this.zf=[...t],t.length>0?this.zf:void 0):(We(this.zf)&&this.zf.splice(0),this.zf=t||void 0,this.zf)}hf(){var t,e;(t=this.Bf)===null||t===void 0||t.call(this),(e=this.Hf)===null||e===void 0||e.call(this),this.Bf=void 0,this.Hf=void 0}startIfEnabledOrStop(){this.Uf()?this.Ho(this.nf):this.hf()}}},pV=H({surveys:class extends UF{constructor(t){var e;super(new GF(t),(e=t,{get projectToken(){return e.config.token},kv:new qF(e)})),this._instance=t}Qh(t,e){const n=e.query?Wh(t,e.query):t;return new Promise(r=>{var s;this._instance._send_request({method:e.method,url:this._instance.requestRouter.endpointFor((s=e.target)!==null&&s!==void 0?s:"api",n),data:e.body,headers:e.headers,timeout:e.timeoutMs,fireCallbackOnDrop:!0,transport:e.transport,compression:e.compression,timestampMode:e.sentAt,callback:r})})}}},Dg),mV={toolbar:class{constructor(t){this.instance=t}Vf(t){$e.ph_toolbar_state=t}Gf(){var t;return(t=$e.ph_toolbar_state)!==null&&t!==void 0?t:0}initialize(){return this.maybeLoadToolbar()}maybeLoadToolbar(t=void 0,e=void 0,n=void 0){var r,s;if(m2(this.instance.config)||!J||!de)return!1;t=(r=t)!==null&&r!==void 0?r:J.location,n=(s=n)!==null&&s!==void 0?s:J.history;try{if(!e){try{J.localStorage.setItem("test","test"),J.localStorage.removeItem("test")}catch{return!1}e=J==null?void 0:J.localStorage}const i=KF||jm(t.hash,"__posthog")||jm(t.hash,"state");let o;const l=i?f8(()=>JSON.parse(atob(decodeURIComponent(i))))||f8(()=>JSON.parse(decodeURIComponent(i))):null;return l&&l.action==="ph_authorize"?(o=l,o.source="url",o&&Object.keys(o).length>0&&(l.desiredHash?t.hash=l.desiredHash:n?n.replaceState(n.state,"",t.pathname+t.search):t.hash="")):(o=JSON.parse(e.getItem(wk)||"{}"),o.source="localstorage",delete o.userIntent),!(!o.token||this.instance.config.token!==o.token||(this.loadToolbar(o),0))}catch{return!1}}Qf(t){const e=$e.ph_load_toolbar||$e.ph_load_editor;!Qe(e)&&Yn(e)?e(t,this.instance):xk.warn("No toolbar load function found")}loadToolbar(t){const e=!!(de!=null&&de.getElementById("__POSTHOG_TOOLBAR__"));if(!J||e)return!1;const n=this.instance.requestRouter.region==="custom"&&this.instance.config.advanced_disable_toolbar_metrics,r=H(H({token:this.instance.config.token},t),{},{apiURL:this.instance.requestRouter.endpointFor("ui")},n?{instrument:!1}:{});if(J.localStorage.setItem(wk,JSON.stringify(H(H({},r),{},{source:void 0}))),this.Gf()===2)this.Qf(r);else if(this.Gf()===0){var s,i;this.Vf(1),(s=$e.__PosthogExtensions__)===null||s===void 0||(i=s.loadExternalDependency)===null||i===void 0||i.call(s,this.instance,"toolbar",o=>{if(o)return xk.error("[Toolbar] Failed to load",o),void this.Vf(0);this.Vf(2),this.Qf(r)}),kt(J,"turbolinks:load",()=>{this.Vf(0),this.loadToolbar(r)})}return!0}Jf(t){return this.loadToolbar(t)}maybeLoadEditor(t=void 0,e=void 0,n=void 0){return this.maybeLoadToolbar(t,e,n)}}},gV=H({experiments:class Rr{get Mr(){return this._instance.config}constructor(e){this._instance=e,this.getWebExperimentsAndEvaluateDisplayLogic=(n=!1)=>{this.getWebExperiments(r=>{Rr.Zf("retrieved web experiments from the server"),this.Kf=new Map,r.forEach(s=>{if(s.feature_flag_key){var i;this.Kf&&(Rr.Zf("setting flag key ",s.feature_flag_key," to web experiment ",s),(i=this.Kf)===null||i===void 0||i.set(s.feature_flag_key,s));const o=this._instance.getFeatureFlag(s.feature_flag_key);lt(o)&&s.variants[o]&&this.Xf(s.name,o,s.variants[o].transforms)}else if(s.variants)for(const o in s.variants){const l=s.variants[o];Rr.Yf(l,this._instance)&&this.Xf(s.name,o,l.transforms)}})},n)},this._instance.onFeatureFlags(n=>{this.onFeatureFlags(n)})}initialize(){}onFeatureFlags(e){if(this._is_bot())Rr.Zf(Ak);else if(!this.Mr.disable_web_experiments){if(Qe(this.Kf))return this.Kf=new Map,this.loadIfEnabled(),void this.previewWebExperiment();Rr.Zf("applying feature flags",e),e.forEach(n=>{var r;if(this.Kf&&(!((r=this.Kf)===null||r===void 0)&&r.has(n))){var s;const i=this._instance.getFeatureFlag(n),o=(s=this.Kf)===null||s===void 0?void 0:s.get(n);i&&(o!=null&&o.variants[i])&&this.Xf(o.name,i,o.variants[i].transforms)}})}}previewWebExperiment(){const e=Rr.getWindowLocation();if(e!=null&&e.search){const n=Ju(e==null?void 0:e.search,"__experiment_id"),r=Ju(e==null?void 0:e.search,"__experiment_variant");n&&r&&(Rr.Zf(`previewing web experiments ${n} && ${r}`),this.getWebExperiments(s=>{this.tp(parseInt(n),r,s)},!1,!0))}}loadIfEnabled(){this.Mr.disable_web_experiments||this.getWebExperimentsAndEvaluateDisplayLogic()}getWebExperiments(e,n,r){if(this.Mr.disable_web_experiments&&!r)return e([]);const s=this._instance.get_property("$web_experiments");if(s&&!n)return e(s);this._instance._send_request({url:this._instance.requestRouter.endpointFor("api",`/api/web_experiments/?token=${this.Mr.token}`),method:"GET",timestampMode:"query",callback:i=>e(i.statusCode===200&&i.json&&i.json.experiments||[])})}tp(e,n,r){const s=r.filter(i=>i.id===e);s&&s.length>0&&(Rr.Zf(`Previewing web experiment [${s[0].name}] with variant [${n}]`),this.Xf(s[0].name,n,s[0].variants[n].transforms))}static Yf(e,n){return!Qe(e.conditions)&&Rr.ep(e,n)&&Rr.np(e)}static ep(e,n){var r;if(Qe(e.conditions)||Qe((r=e.conditions)===null||r===void 0?void 0:r.url))return!0;const s=Rr.getWindowLocation();if(s){var i,o,l;const u=lT(n,s.href);return!(!((i=e.conditions)===null||i===void 0)&&i.url)||tV[(o=(l=e.conditions)===null||l===void 0?void 0:l.urlMatchType)!==null&&o!==void 0?o:"icontains"](e.conditions.url,u)}return!1}static getWindowLocation(){return J==null?void 0:J.location}static np(e){var n;if(Qe(e.conditions)||Qe((n=e.conditions)===null||n===void 0?void 0:n.utm))return!0;const r=wT();if(r.utm_source){var s,i,o,l,u,d,f,p;const g=!(!((s=e.conditions)===null||s===void 0||(s=s.utm)===null||s===void 0)&&s.utm_campaign)||((i=e.conditions)===null||i===void 0||(i=i.utm)===null||i===void 0?void 0:i.utm_campaign)==r.utm_campaign,v=!(!((o=e.conditions)===null||o===void 0||(o=o.utm)===null||o===void 0)&&o.utm_source)||((l=e.conditions)===null||l===void 0||(l=l.utm)===null||l===void 0?void 0:l.utm_source)==r.utm_source,w=!(!((u=e.conditions)===null||u===void 0||(u=u.utm)===null||u===void 0)&&u.utm_medium)||((d=e.conditions)===null||d===void 0||(d=d.utm)===null||d===void 0?void 0:d.utm_medium)==r.utm_medium,_=!(!((f=e.conditions)===null||f===void 0||(f=f.utm)===null||f===void 0)&&f.utm_term)||((p=e.conditions)===null||p===void 0||(p=p.utm)===null||p===void 0?void 0:p.utm_term)==r.utm_term;return g&&w&&_&&v}return!1}static Zf(e,...n){ve.info(`[WebExperiments] ${e}`,n)}Xf(e,n,r){this._is_bot()?Rr.Zf(Ak):n!=="control"?r.forEach(s=>{if(s.selector){var i;Rr.Zf(`applying transform of variant ${n} for experiment ${e} `,s);const o=(i=document)===null||i===void 0?void 0:i.querySelectorAll(s.selector);o==null||o.forEach(l=>{const u=l;s.html&&(u.innerHTML=s.html),s.css&&u.setAttribute("style",s.css)})}}):Rr.Zf("Control variants leave the page unmodified.")}_is_bot(){return Xn&&this._instance?WT(Xn,this.Mr.custom_blocked_useragents):void 0}}},Dg),vV={conversations:class{constructor(t){this._instance=t,this.sp=void 0,this._conversationsManager=null,this.rp=!1,this.ne=null,this.op=!1}initialize(){this.loadIfEnabled()}onRemoteConfig(t){if(this._instance.config.disable_conversations||(this.ap=t.ok,!t.ok))return;const e=t.config.conversations;Qe(e)||(Nr(e)?this.sp=e:(this.sp=e.enabled,this.ne=e),this.loadIfEnabled())}reset(){var t;(t=this._conversationsManager)===null||t===void 0||t.reset(),this._conversationsManager=null,this.sp=void 0,this.ne=null,this.ap=void 0,this.op=!1}loadIfEnabled(){if(this._conversationsManager||this.rp||this._instance.config.disable_conversations||m2(this._instance.config)||this._instance.config.cookieless_mode&&this._instance.consent.isOptedOut())return;const t=$e==null?void 0:$e.__PosthogExtensions__;if(t&&!ce(this.sp)&&this.sp)if(this.ne&&this.ne.token){this.rp=!0;try{const e=t.initConversations;if(e)return this.lp(e),void(this.rp=!1);const n=t.loadExternalDependency;if(!n)return void this.up(Px);n(this._instance,"conversations",r=>{r||!t.initConversations?this.up("Could not load conversations script",r):this.lp(t.initConversations),this.rp=!1})}catch(e){this.up("Error initializing conversations",e),this.rp=!1}}else zs.error("Conversations enabled but missing token in remote config.")}lp(t){if(this.ne)try{this._conversationsManager=t(this.ne,this._instance),this.op=!1,zs.info("Conversations loaded successfully")}catch(e){this.up("Error completing conversations initialization",e)}else zs.error("Cannot complete initialization: remote config is null")}up(t,e){zs.error(t,e),this._conversationsManager=null,this.rp=!1,this.op=!0}show(){this._conversationsManager?this._conversationsManager.show():zs.warn("Conversations not loaded yet.")}hide(){this._conversationsManager&&this._conversationsManager.hide()}isAvailable(){return this.sp===!0&&!cn(this._conversationsManager)}getUnavailableReason(){return this.isAvailable()?null:this._instance.config.disable_conversations?"disabled_by_config":m2(this._instance.config)?"disabled_for_toolbar":this._instance.config.cookieless_mode&&this._instance.consent.isOptedOut()?"consent_opted_out":this.ap===!1?"remote_config_failed":ce(this.sp)?this.ap?"disabled_in_project":"remote_config_pending":this.sp?Qe(this.ne)||!this.ne.token?"missing_token":$e!=null&&$e.__PosthogExtensions__?this.rp?"initializing":this.op?"load_failed":"not_loaded":"extensions_unavailable":"disabled_in_project"}isVisible(){var t,e;return(t=(e=this._conversationsManager)===null||e===void 0?void 0:e.isVisible())!==null&&t!==void 0&&t}sendMessage(t,e,n){var r=this;return Gt(function*(){return r._conversationsManager?r._conversationsManager.sendMessage(t,e,n):(zs.warn(Tl),null)})()}getMessages(t,e){var n=this;return Gt(function*(){return n._conversationsManager?n._conversationsManager.getMessages(t,e):(zs.warn(Tl),null)})()}markAsRead(t){var e=this;return Gt(function*(){return e._conversationsManager?e._conversationsManager.markAsRead(t):(zs.warn(Tl),null)})()}getTickets(t){var e=this;return Gt(function*(){return e._conversationsManager?e._conversationsManager.getTickets(t):(zs.warn(Tl),null)})()}requestRestoreLink(t){var e=this;return Gt(function*(){return e._conversationsManager?e._conversationsManager.requestRestoreLink(t):(zs.warn(Tl),null)})()}restoreFromToken(t){var e=this;return Gt(function*(){return e._conversationsManager?e._conversationsManager.restoreFromToken(t):(zs.warn(Tl),null)})()}restoreFromUrlToken(){var t=this;return Gt(function*(){return t._conversationsManager?t._conversationsManager.restoreFromUrlToken():(zs.warn(Tl),null)})()}getCurrentTicketId(){var t,e;return(t=(e=this._conversationsManager)===null||e===void 0?void 0:e.getCurrentTicketId())!==null&&t!==void 0?t:null}getWidgetSessionId(){var t,e;return(t=(e=this._conversationsManager)===null||e===void 0?void 0:e.getWidgetSessionId())!==null&&t!==void 0?t:null}$h(){var t;(t=this._conversationsManager)===null||t===void 0||t.setIdentity()}Ch(){var t;(t=this._conversationsManager)===null||t===void 0||t.clearIdentity()}}},yV={logs:class{constructor(t){var e;this._instance=t,this.name="logs",this.hp=!1,this.cp=!1,this.dp=!1,this.A=dn("[logs]"),this.vp=H(H({},this.A),{},{error:(...n)=>{n.some(Ik)||this.A.error(...n)}}),this.ol=[],this.fp=[],this.kd=0,this.To=!1,this.pp=[],this.gp=[],this.mp=!1,this.yp=!1,this.bp=()=>{var n,r;this.To||(this.kd=0,(n=this._p)===null||n===void 0||n.onReconnect(),(r=this.wp)===null||r===void 0||r.onReconnect())},this._instance&&(!((e=this._instance.config.logs)===null||e===void 0)&&e.captureConsoleLogs)&&(this.hp=!0),J&&kt(J,"online",this.bp)}kp(t,e,n,r){var s;const i=Rk((s=this._instance)===null||s===void 0||(s=s.config)===null||s===void 0?void 0:s.logs,n);return[new t$(this.Sp(t,e),i,this.vp,()=>this.xp(),o=>o(),void 0,r),i]}$p(){var t;const e=(t=this._instance)===null||t===void 0||(t=t.config)===null||t===void 0?void 0:t.logs;var n;return this._p&&this.Cp===e||((n=this._p)===null||n===void 0||n.reset(),this.Cp=e,[this._p,this.Tp]=this.kp(()=>this.ol,r=>{this.ol=r})),this._p}Ip(){var t;const e=(t=this._instance)===null||t===void 0||(t=t.config)===null||t===void 0?void 0:t.logs;var n;return this.wp&&this.Mp===e||((n=this.wp)===null||n===void 0||n.reset(),this.Mp=e,[this.wp,this.Ep]=this.kp(()=>this.fp,r=>{this.fp=r},{serviceNameDefault:"posthog-browser-logs",consoleCapture:!0},Mk)),this.wp}setup(t){var e;if(this.To)return;this.bo=t,!((e=this._instance)===null||e===void 0||(e=e.config)===null||e===void 0||(e=e.logs)===null||e===void 0)&&e.captureConsoleLogs&&(this.hp=!0),(this.hp||this.Pp()&&this.Rp())&&this.Ap();let n=!1;const r=t.onRemoteConfig(s=>{var i;n=s.ok&&((i=s.config.logs)===null||i===void 0?void 0:i.captureConsoleLogs)===!0,this.onRemoteConfig(s)});this.To?r.dispose():(this.Eo=r,n||this.loadIfEnabled())}dispose(){var t,e,n,r;this.To||(this.To=!0,this.Op(),(t=this.Eo)===null||t===void 0||t.dispose(),this.Eo=void 0,this.bo=void 0,this.dp=!1,J==null||J.removeEventListener("online",this.bp),(e=this.Fp)===null||e===void 0||e.call(this),this.Fp=void 0,(n=this._p)===null||n===void 0||n.reset(),(r=this.wp)===null||r===void 0||r.reset())}onRemoteConfig(t){var e,n;if(this.To)return;const r=t.ok?(e=t.config.logs)===null||e===void 0?void 0:e.captureConsoleLogs:void 0;Qe(r)?this.Dp():((n=this._instance)===null||n===void 0||(n=n.persistence)===null||n===void 0||n.register({$logs_capture_enabled_server_side:!!r}),r?(this.hp=!0,this.cp||this.Ap(),this.loadIfEnabled()):this.Dp())}reset(){var t,e,n,r;this.Op(),(t=this._p)===null||t===void 0||t.clearQueue(),this.ol=[],(e=this._p)===null||e===void 0||e.reset(),(n=this.wp)===null||n===void 0||n.clearQueue(),this.fp=[],(r=this.wp)===null||r===void 0||r.reset(),this.kd=0}captureLog(t){this.To||this.$p().captureLog(t)}captureConsoleLog(t){this.To||this.Ip().captureLog(t)}captureBufferedConsoleLog(t,e,n){this.To||this.Ip().captureLog(t,{context:e,occurredAtMs:n})}Rp(){var t;return!!(!((t=this._instance)===null||t===void 0||(t=t.persistence)===null||t===void 0||(t=t.props)===null||t===void 0)&&t[$5])}Pp(){var t,e,n;return!(!((t=this._instance)===null||t===void 0||(e=t.il)===null||e===void 0)&&e.call(t))||!!(!((n=$e._POSTHOG_REMOTE_CONFIG)===null||n===void 0||(n=n[this._instance.config.token])===null||n===void 0)&&n.config)}Ih(){var t;this.Op(),(t=this.wp)===null||t===void 0||t.clearQueue(),this.fp=[]}Dp(){this.hp||this.Op()}Ap(){var t;if(this.mp||!($e!=null&&$e.console))return;const e=Rk((t=this._instance)===null||t===void 0||(t=t.config)===null||t===void 0?void 0:t.logs).maxBufferSize;let n=!0;this.gp.push(()=>{n=!1});for(const r of nV){let s;try{s=rV($e.console[r])}catch{continue}s&&this.gp.push(dh($e.console,r,i=>{const o=(...l)=>{try{n&&this.Lp(r,l,e)}catch{}return i.apply($e.console,l)};return o.__rrweb_original__=s,o}))}this.mp=!0,this.Np=setTimeout(()=>{this.Op()},3e4)}Lp(t,e,n){var r;if(this.mp&&!this.yp&&e.length!==0)if(!((r=this._instance)===null||r===void 0)&&r.is_capturing()){if(n>this.pp.length){this.yp=!0;try{this.pp.push({level:t,args:e,occurredAtMs:Date.now(),context:this.xp()})}finally{this.yp=!1}}}else this.Op()}Op(){if(this.pp=[],this.mp){this.mp=!1,this.Np&&(clearTimeout(this.Np),this.Np=void 0);for(const t of this.gp)t();this.gp=[]}}qp(){const t=this.pp;return this.Op(),t}get logger(){return this.jp||(this.jp={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.jp}flushLogs(t){t?this.Bp(t):(this._p&&this._p.flush().catch(e=>this.Hp(e)),this.wp&&this.wp.flush().catch(e=>this.Hp(e)))}Hp(t){Ik(t)||this.A.error("PostHog logs flush failed:",t)}loadIfEnabled(){if(this.To||!this.hp||this.cp||this.dp)return;const t=$e==null?void 0:$e.__PosthogExtensions__;if(!t)return this.A.error("PostHog Extensions not found."),void this.Op();const e=t.loadExternalDependency;if(!e)return this.A.error(Px),void this.Op();this.dp=!0;try{e(this._instance,"logs",n=>{if(this.dp=!1,this.To||!this.hp)return;const r=t.logs;if(n||!(r!=null&&r.initializeLogs))this.A.error("Could not load logs script",n),this.Op();else{var s;const l=this.qp();var i,o;this.Fp=r.initializeLogs((s=this.bo)!==null&&s!==void 0?s:this._instance),this.cp=!0,l.length>0&&((i=r.replayConsoleBuffer)===null||i===void 0||i.call(r,(o=this.bo)!==null&&o!==void 0?o:this._instance,l))}})}catch(n){throw this.dp=!1,n}}Sp(t,e){const n=this._instance;return{get isDisabled(){return!1},get optedOut(){return!n.is_capturing()},getPersistedProperty:r=>r===Li.LogsQueue?t():void 0,setPersistedProperty(r,s){var i;r===Li.LogsQueue&&e((i=s)!==null&&i!==void 0?i:[])},js:r=>this.js(r),getLibraryId:()=>zn.LIB_NAME,getLibraryVersion:()=>zn.LIB_VERSION}}js(t){return new Promise(e=>{if(yT(this.kd,3))return void e({kind:"fatal",error:Ly(void 0,"logs endpoint is unreachable, dropping batch")});let n=!1;const r=i=>{n||(n=!0,clearTimeout(s),e(i))},s=setTimeout(()=>{this.A.warn("Logs request timed out before receiving a response"),r({kind:"retry-later",error:Ly(void 0,"logs request timed out")})},9e4);this._instance._send_request({method:"POST",url:this.zp(),data:t,compression:"best-available",batchKey:"logs",fireCallbackOnDrop:!0,callback:i=>{const o=i.statusCode;if(this.Up(o),o>=200&&300>o)r({kind:"ok"});else if(o===413)r({kind:"too-large"});else if(o!==0&&o!==408&&o!==429&&500>o)r({kind:"fatal",error:new Error(`logs request failed with status ${o}`)});else{var l;o===0?(i.error||this.A.warn("Logs request failed before receiving an HTTP response"),r({kind:"retry-later",error:Ly(i.error,"logs request failed before receiving an HTTP response")})):r({kind:"retry-later",error:(l=i.error)!==null&&l!==void 0?l:new Error(`logs request failed with status ${o}`)})}}})})}Up(t){(t!==0||this._instance.__loaded)&&(this.kd=_T(t,this.kd,3,()=>this.A.warn("Log requests are failing before receiving an HTTP response; this can happen due to network issues, CORS, browser blocking, or ad blockers. Stopped sending logs; will try again when connectivity changes.")))}Bp(t){this.ol.length>0&&this.Wp(t,this.ol,this.Tp,zn.LIB_NAME,e=>{this.ol=e}),this.fp.length>0&&this.Wp(t,this.fp,this.Ep,Mk,e=>{this.fp=e})}Wp(t,e,n,r,s){if(e.length===0)return;const i=e.map(l=>l.record);s([]);const o=M5(i,R5(n,zn.LIB_NAME,zn.LIB_VERSION),r,zn.LIB_VERSION);this._instance._send_request({method:"POST",url:this.zp(),data:o,compression:"best-available",batchKey:"logs",transport:t})}zp(){return this._instance.requestRouter.endpointFor("api","/i/v1/logs")+"?token="+encodeURIComponent(this._instance.config.token)}xp(){var t;const e={};if(e.distinctId=this._instance.get_distinct_id(),this._instance.sessionManager){const{sessionId:n,windowId:r,sessionStartTimestamp:s,lastActivityTimestamp:i}=this._instance.sessionManager.checkAndGetSessionAndWindowId(!0);e.sessionId=n,e.windowId=r,Qe(s)||(e.sessionStartTimestamp=s),Qe(i)||(e.lastActivityTimestamp=i)}if(!($e==null||(t=$e.location)===null||t===void 0)&&t.href&&(e.currentUrl=this._instance.config.disable_capture_url_hashes?Ua($e.location.href):$e.location.href),this._instance.featureFlags){const n=this._instance.featureFlags.getFlags();n&&n.length>0&&(e.activeFeatureFlags=n)}return e}}},_V={metrics:class{constructor(t){this._instance=t,this.A=dn("[metrics]"),this.To=!1}initialize(){this.onConfigChange()}onConfigChange(){var t;if(this.To)return;const e=!!(!((t=this._instance.config.metrics)===null||t===void 0)&&t.network);e&&!this.Vp?this.Vp=(n=>{let r=!0;const s=()=>r?(l=>{var u;const d=(u=l.config.metrics)===null||u===void 0?void 0:u.network;return d===!0?{}:d||void 0})(n):void 0,i=oV(n,s),o=aV(n,s);return()=>{r=!1,i(),o()}})(this._instance):!e&&this.Vp&&(this.Vp(),this.Vp=void 0)}$p(){var t;const e=(t=this._instance)===null||t===void 0||(t=t.config)===null||t===void 0?void 0:t.metrics;var n;return this._p&&this.Cp===e||((n=this._p)===null||n===void 0||n.reset(),this.Cp=e,this._p=new n$(this.Sp(),(function(r){var s,i,o,l,u;const d=r==null?void 0:r.resourceAttributes;return{serviceName:(s=d==null?void 0:d["service.name"])!==null&&s!==void 0?s:r==null?void 0:r.serviceName,serviceVersion:(i=d==null?void 0:d["service.version"])!==null&&i!==void 0?i:r==null?void 0:r.serviceVersion,environment:(o=d==null?void 0:d["deployment.environment"])!==null&&o!==void 0?o:r==null?void 0:r.environment,resourceAttributes:d,beforeSend:r==null?void 0:r.beforeSend,flushIntervalMs:(l=r==null?void 0:r.flushIntervalMs)!==null&&l!==void 0?l:1e4,maxSeriesPerFlush:(u=r==null?void 0:r.maxSeriesPerFlush)!==null&&u!==void 0?u:1e3}})(e),this.A)),this._p}count(t,e=1,n){this.$p().count(t,e,n)}gauge(t,e,n){this.$p().gauge(t,e,n)}histogram(t,e,n){this.$p().histogram(t,e,n)}flush(t){if(!this._p)return Promise.resolve();if(t){const e=this._p.drainWindow();return e&&this.Ys(e,t),Promise.resolve()}return this._p.flush().catch(e=>this.A.error("PostHog metrics flush failed:",e))}reset(){var t;(t=this._p)===null||t===void 0||t.reset()}dispose(){var t,e;this.To=!0,(t=this.Vp)===null||t===void 0||t.call(this),this.Vp=void 0,(e=this._p)===null||e===void 0||e.reset()}Sp(){const t=this._instance,e=this;return{get isDisabled(){return!1},get optedOut(){return!t.is_capturing()},Ys:n=>e.Ys(n),getLibraryId:()=>zn.LIB_NAME,getLibraryVersion:()=>zn.LIB_VERSION}}Ys(t,e){return new Promise(n=>{let r=!1;const s=o=>{r||(r=!0,clearTimeout(i),n(o))},i=setTimeout(()=>s({kind:"retry-later",error:new Error("metrics request timed out")}),9e4);this._instance._send_request(H(H({method:"POST",url:this.Gp(),data:t,compression:"best-available",batchKey:"metrics"},e&&{transport:e}),{},{fireCallbackOnDrop:!0,callback(o){const l=o.statusCode;if(l>=200&&300>l)s({kind:"ok"});else if(l===413)s({kind:"too-large"});else if(l!==0&&l!==408&&l!==429&&500>l)s({kind:"fatal",error:new Error(`metrics request failed with status ${l}`)});else{var u;s({kind:"retry-later",error:(u=o.error)!==null&&u!==void 0?u:new Error(`metrics request failed with status ${l}`)})}}}))})}Gp(){return this._instance.requestRouter.endpointFor("api","/i/v1/metrics")+"?token="+encodeURIComponent(this._instance.config.token)}}};Uf.__defaultExtensionClasses=H({},H(H(H(H(H(H(H(H(H(H(H(H(H({},Dg),lV),cV),uV),dV),fV),pV),hV),mV),gV),vV),yV),_V));const wV=(function(){zn.SDK_DIST_CHANNEL="npm";const t=Hf[Cf]=new Uf;return(function(){function e(){e.done||(e.done=!0,BT=!1,Mt(Hf,function(n){n._dom_loaded()}))}de!=null&&de.addEventListener?de.readyState==="complete"?e():kt(de,"DOMContentLoaded",e,{capture:!1}):J&&ve.error("Browser doesn't support `document.addEventListener` so PostHog couldn't be initialized")})(),t})();var Ce=wV,xV=(function(){var t=function(e,n){return t=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(r,s){r.__proto__=s}||function(r,s){for(var i in s)Object.prototype.hasOwnProperty.call(s,i)&&(r[i]=s[i])},t(e,n)};return function(e,n){if(typeof n!="function"&&n!==null)throw new TypeError("Class extends value "+String(n)+" is not a constructor or null");t(e,n);function r(){this.constructor=e}e.prototype=n===null?Object.create(n):(r.prototype=n.prototype,new r)}})();var bV=function(t,e,n){return typeof e=="symbol"&&(e=e.description?"[".concat(e.description,"]"):""),Object.defineProperty(t,"name",{configurable:!0,value:n?"".concat(n," ",e):e})},x0,Ok="__POSTHOG_REACT_SHARED_STATE__",Lk=typeof globalThis<"u"?globalThis:typeof window<"u"?window:{},fh;try{fh=Lk[Ok]=Lk[Ok]||new WeakMap}catch{fh=new WeakMap}fh.has(m.createContext)||fh.set(m.createContext,{});var sc=fh.get(m.createContext),T2;function SV(t){(!sc.defaultPostHogInstance||sc.defaultPostHogInstance===T2)&&(sc.defaultPostHogInstance=t),T2=t}function A2(){return T2}sc.context||(sc.context=m.createContext({get client(){return A2()||sc.defaultPostHogInstance},bootstrap:void 0}));var jx=sc.context;function sA(t,e,n){if(n===void 0&&(n=new WeakMap),t===e)return!0;if(typeof t!="object"||t===null||typeof e!="object"||e===null)return!1;if(n.has(t)&&n.get(t)===e)return!0;n.set(t,e);var r=Object.keys(t),s=Object.keys(e);if(r.length!==s.length)return!1;for(var i=0,o=r;i<o.length;i++){var l=o[i];if(!s.includes(l)||!sA(t[l],e[l],n))return!1}return!0}function kV(t){var e,n,r=t.children,s=t.client,i=t.apiKey,o=t.options,l=m.useRef(null),u=m.useMemo(function(){if(s)return i&&console.warn("[PostHog.js] You have provided both `client` and `apiKey` to `PostHogProvider`. `apiKey` will be ignored in favour of `client`."),o&&console.warn("[PostHog.js] You have provided both `client` and `options` to `PostHogProvider`. `options` will be ignored in favour of `client`."),s;var d=A2();return i||console.warn("[PostHog.js] No `apiKey` or `client` were provided to `PostHogProvider`. Using default global `window.posthog` instance. You must initialize it manually. This is not recommended behavior."),d},[s,i,JSON.stringify(o)]);return m.useEffect(function(){if(!(s||!i)){var d=A2(),f=l.current;f?(i!==f.apiKey&&console.warn("[PostHog.js] You have provided a different `apiKey` to `PostHogProvider` than the one that was already initialized. This is not supported by our provider and we'll keep using the previous key. If you need to toggle between API Keys you need to control the `client` yourself and pass it in as a prop rather than an `apiKey` prop."),o&&!sA(o,f.options)&&d.set_config(o),l.current={apiKey:i,options:o??{}}):(d.__loaded&&console.warn("[PostHog.js] `posthog` was already loaded elsewhere. This may cause issues."),d.init(i,o),l.current={apiKey:i,options:o??{}})}},[s,i,JSON.stringify(o)]),we.createElement(jx.Provider,{value:{client:u,bootstrap:(e=o==null?void 0:o.bootstrap)!==null&&e!==void 0?e:(n=s==null?void 0:s.config)===null||n===void 0?void 0:n.bootstrap}},r)}var Ny=function(t){return typeof t=="function"},EV=function(t){return t===void 0},xi=function(){var t=m.useContext(jx).client;return t},em=function(t){var e=Object.prototype.toString.call(t);return t instanceof Error||e==="[object Error]"||e==="[object Exception]"||e==="[object DOMException]"||e==="[object DOMError]"},CV=function(t,e){try{Object.defineProperty(t,"name",{value:e,writable:!0,enumerable:!0,configurable:!0})}catch{}},PV=function(t,e){for(var n=new WeakSet,r=t;!n.has(r);){if(n.add(r),!em(r.cause)){EV(r.cause)||(e.cause=r.cause),r.cause=e;return}r=r.cause}},TV=function(t,e){if(!e)return t;var n=new Error(em(t)?t.message:"Primitive value captured as exception: ".concat(String(t)));return CV(n,"React ErrorBoundary ".concat(em(t)?t.name:"Error")),n.stack=e,em(t)?(PV(t,n),t):n},Nk={componentStack:null,exceptionEvent:null,error:null},AV={INVALID_FALLBACK:"[PostHog.js][PostHogErrorBoundary] Invalid fallback prop, provide a valid React element or a function that returns a valid React element."},RV=(x0=(function(t){xV(e,t);function e(n){var r=t.call(this,n)||this;return r._resetError=function(){r.setState(Nk)},r.state=Nk,r}return e.prototype.componentDidCatch=function(n,r){var s=this.props.additionalProperties,i;Ny(s)?i=s(n,r):typeof s=="object"&&(i=s);var o=this.context.client,l=r.componentStack,u=o.captureException(TV(n,l),i);this.setState({error:n,componentStack:l??null,exceptionEvent:u})},e.prototype.render=function(){var n=this.props,r=n.children,s=n.fallback,i=this.state;if(i.componentStack==null)return Ny(r)?r():r;var o=Ny(s)?we.createElement(s,{error:i.error,componentStack:i.componentStack,exceptionEvent:i.exceptionEvent,resetError:this._resetError}):s;return we.isValidElement(o)?o:(console.warn(AV.INVALID_FALLBACK),we.createElement(we.Fragment,null))},e})(we.Component),bV(x0,"PostHogErrorBoundary"),(function(){x0.contextType=jx})(),x0);SV(Ce);var It;(function(t){t.assertEqual=s=>{};function e(s){}t.assertIs=e;function n(s){throw new Error}t.assertNever=n,t.arrayToEnum=s=>{const i={};for(const o of s)i[o]=o;return i},t.getValidEnumValues=s=>{const i=t.objectKeys(s).filter(l=>typeof s[s[l]]!="number"),o={};for(const l of i)o[l]=s[l];return t.objectValues(o)},t.objectValues=s=>t.objectKeys(s).map(function(i){return s[i]}),t.objectKeys=typeof Object.keys=="function"?s=>Object.keys(s):s=>{const i=[];for(const o in s)Object.prototype.hasOwnProperty.call(s,o)&&i.push(o);return i},t.find=(s,i)=>{for(const o of s)if(i(o))return o},t.isInteger=typeof Number.isInteger=="function"?s=>Number.isInteger(s):s=>typeof s=="number"&&Number.isFinite(s)&&Math.floor(s)===s;function r(s,i=" | "){return s.map(o=>typeof o=="string"?`'${o}'`:o).join(i)}t.joinValues=r,t.jsonStringifyReplacer=(s,i)=>typeof i=="bigint"?i.toString():i})(It||(It={}));var Dk;(function(t){t.mergeShapes=(e,n)=>({...e,...n})})(Dk||(Dk={}));const je=It.arrayToEnum(["string","nan","number","integer","float","boolean","date","bigint","symbol","function","undefined","null","array","object","unknown","promise","void","never","map","set"]),ba=t=>{switch(typeof t){case"undefined":return je.undefined;case"string":return je.string;case"number":return Number.isNaN(t)?je.nan:je.number;case"boolean":return je.boolean;case"function":return je.function;case"bigint":return je.bigint;case"symbol":return je.symbol;case"object":return Array.isArray(t)?je.array:t===null?je.null:t.then&&typeof t.then=="function"&&t.catch&&typeof t.catch=="function"?je.promise:typeof Map<"u"&&t instanceof Map?je.map:typeof Set<"u"&&t instanceof Set?je.set:typeof Date<"u"&&t instanceof Date?je.date:je.object;default:return je.unknown}},xe=It.arrayToEnum(["invalid_type","invalid_literal","custom","invalid_union","invalid_union_discriminator","invalid_enum_value","unrecognized_keys","invalid_arguments","invalid_return_type","invalid_date","invalid_string","too_small","too_big","invalid_intersection_types","not_multiple_of","not_finite"]);class zo extends Error{get errors(){return this.issues}constructor(e){super(),this.issues=[],this.addIssue=r=>{this.issues=[...this.issues,r]},this.addIssues=(r=[])=>{this.issues=[...this.issues,...r]};const n=new.target.prototype;Object.setPrototypeOf?Object.setPrototypeOf(this,n):this.__proto__=n,this.name="ZodError",this.issues=e}format(e){const n=e||function(i){return i.message},r={_errors:[]},s=i=>{for(const o of i.issues)if(o.code==="invalid_union")o.unionErrors.map(s);else if(o.code==="invalid_return_type")s(o.returnTypeError);else if(o.code==="invalid_arguments")s(o.argumentsError);else if(o.path.length===0)r._errors.push(n(o));else{let l=r,u=0;for(;u<o.path.length;){const d=o.path[u];u===o.path.length-1?(l[d]=l[d]||{_errors:[]},l[d]._errors.push(n(o))):l[d]=l[d]||{_errors:[]},l=l[d],u++}}};return s(this),r}static assert(e){if(!(e instanceof zo))throw new Error(`Not a ZodError: ${e}`)}toString(){return this.message}get message(){return JSON.stringify(this.issues,It.jsonStringifyReplacer,2)}get isEmpty(){return this.issues.length===0}flatten(e=n=>n.message){const n={},r=[];for(const s of this.issues)if(s.path.length>0){const i=s.path[0];n[i]=n[i]||[],n[i].push(e(s))}else r.push(e(s));return{formErrors:r,fieldErrors:n}}get formErrors(){return this.flatten()}}zo.create=t=>new zo(t);const R2=(t,e)=>{let n;switch(t.code){case xe.invalid_type:t.received===je.undefined?n="Required":n=`Expected ${t.expected}, received ${t.received}`;break;case xe.invalid_literal:n=`Invalid literal value, expected ${JSON.stringify(t.expected,It.jsonStringifyReplacer)}`;break;case xe.unrecognized_keys:n=`Unrecognized key(s) in object: ${It.joinValues(t.keys,", ")}`;break;case xe.invalid_union:n="Invalid input";break;case xe.invalid_union_discriminator:n=`Invalid discriminator value. Expected ${It.joinValues(t.options)}`;break;case xe.invalid_enum_value:n=`Invalid enum value. Expected ${It.joinValues(t.options)}, received '${t.received}'`;break;case xe.invalid_arguments:n="Invalid function arguments";break;case xe.invalid_return_type:n="Invalid function return type";break;case xe.invalid_date:n="Invalid date";break;case xe.invalid_string:typeof t.validation=="object"?"includes"in t.validation?(n=`Invalid input: must include "${t.validation.includes}"`,typeof t.validation.position=="number"&&(n=`${n} at one or more positions greater than or equal to ${t.validation.position}`)):"startsWith"in t.validation?n=`Invalid input: must start with "${t.validation.startsWith}"`:"endsWith"in t.validation?n=`Invalid input: must end with "${t.validation.endsWith}"`:It.assertNever(t.validation):t.validation!=="regex"?n=`Invalid ${t.validation}`:n="Invalid";break;case xe.too_small:t.type==="array"?n=`Array must contain ${t.exact?"exactly":t.inclusive?"at least":"more than"} ${t.minimum} element(s)`:t.type==="string"?n=`String must contain ${t.exact?"exactly":t.inclusive?"at least":"over"} ${t.minimum} character(s)`:t.type==="number"?n=`Number must be ${t.exact?"exactly equal to ":t.inclusive?"greater than or equal to ":"greater than "}${t.minimum}`:t.type==="bigint"?n=`Number must be ${t.exact?"exactly equal to ":t.inclusive?"greater than or equal to ":"greater than "}${t.minimum}`:t.type==="date"?n=`Date must be ${t.exact?"exactly equal to ":t.inclusive?"greater than or equal to ":"greater than "}${new Date(Number(t.minimum))}`:n="Invalid input";break;case xe.too_big:t.type==="array"?n=`Array must contain ${t.exact?"exactly":t.inclusive?"at most":"less than"} ${t.maximum} element(s)`:t.type==="string"?n=`String must contain ${t.exact?"exactly":t.inclusive?"at most":"under"} ${t.maximum} character(s)`:t.type==="number"?n=`Number must be ${t.exact?"exactly":t.inclusive?"less than or equal to":"less than"} ${t.maximum}`:t.type==="bigint"?n=`BigInt must be ${t.exact?"exactly":t.inclusive?"less than or equal to":"less than"} ${t.maximum}`:t.type==="date"?n=`Date must be ${t.exact?"exactly":t.inclusive?"smaller than or equal to":"smaller than"} ${new Date(Number(t.maximum))}`:n="Invalid input";break;case xe.custom:n="Invalid input";break;case xe.invalid_intersection_types:n="Intersection results could not be merged";break;case xe.not_multiple_of:n=`Number must be a multiple of ${t.multipleOf}`;break;case xe.not_finite:n="Number must be finite";break;default:n=e.defaultError,It.assertNever(t)}return{message:n}};let MV=R2;function IV(){return MV}const OV=t=>{const{data:e,path:n,errorMaps:r,issueData:s}=t,i=[...n,...s.path||[]],o={...s,path:i};if(s.message!==void 0)return{...s,path:i,message:s.message};let l="";const u=r.filter(d=>!!d).slice().reverse();for(const d of u)l=d(o,{data:e,defaultError:l}).message;return{...s,path:i,message:l}};function Te(t,e){const n=IV(),r=OV({issueData:e,data:t.data,path:t.path,errorMaps:[t.common.contextualErrorMap,t.schemaErrorMap,n,n===R2?void 0:R2].filter(s=>!!s)});t.common.issues.push(r)}class Fr{constructor(){this.value="valid"}dirty(){this.value==="valid"&&(this.value="dirty")}abort(){this.value!=="aborted"&&(this.value="aborted")}static mergeArray(e,n){const r=[];for(const s of n){if(s.status==="aborted")return st;s.status==="dirty"&&e.dirty(),r.push(s.value)}return{status:e.value,value:r}}static async mergeObjectAsync(e,n){const r=[];for(const s of n){const i=await s.key,o=await s.value;r.push({key:i,value:o})}return Fr.mergeObjectSync(e,r)}static mergeObjectSync(e,n){const r={};for(const s of n){const{key:i,value:o}=s;if(i.status==="aborted"||o.status==="aborted")return st;i.status==="dirty"&&e.dirty(),o.status==="dirty"&&e.dirty(),i.value!=="__proto__"&&(typeof o.value<"u"||s.alwaysSet)&&(r[i.value]=o.value)}return{status:e.value,value:r}}}const st=Object.freeze({status:"aborted"}),Pf=t=>({status:"dirty",value:t}),Xs=t=>({status:"valid",value:t}),jk=t=>t.status==="aborted",$k=t=>t.status==="dirty",nd=t=>t.status==="valid",Um=t=>typeof Promise<"u"&&t instanceof Promise;var Ue;(function(t){t.errToObj=e=>typeof e=="string"?{message:e}:e||{},t.toString=e=>typeof e=="string"?e:e==null?void 0:e.message})(Ue||(Ue={}));class Yi{constructor(e,n,r,s){this._cachedPath=[],this.parent=e,this.data=n,this._path=r,this._key=s}get path(){return this._cachedPath.length||(Array.isArray(this._key)?this._cachedPath.push(...this._path,...this._key):this._cachedPath.push(...this._path,this._key)),this._cachedPath}}const Fk=(t,e)=>{if(nd(e))return{success:!0,data:e.value};if(!t.common.issues.length)throw new Error("Validation failed but no issues detected.");return{success:!1,get error(){if(this._error)return this._error;const n=new zo(t.common.issues);return this._error=n,this._error}}};function ht(t){if(!t)return{};const{errorMap:e,invalid_type_error:n,required_error:r,description:s}=t;if(e&&(n||r))throw new Error(`Can't use "invalid_type_error" or "required_error" in conjunction with custom error map.`);return e?{errorMap:e,description:s}:{errorMap:(o,l)=>{const{message:u}=t;return o.code==="invalid_enum_value"?{message:u??l.defaultError}:typeof l.data>"u"?{message:u??r??l.defaultError}:o.code!=="invalid_type"?{message:l.defaultError}:{message:u??n??l.defaultError}},description:s}}class xt{get description(){return this._def.description}_getType(e){return ba(e.data)}_getOrReturnCtx(e,n){return n||{common:e.parent.common,data:e.data,parsedType:ba(e.data),schemaErrorMap:this._def.errorMap,path:e.path,parent:e.parent}}_processInputParams(e){return{status:new Fr,ctx:{common:e.parent.common,data:e.data,parsedType:ba(e.data),schemaErrorMap:this._def.errorMap,path:e.path,parent:e.parent}}}_parseSync(e){const n=this._parse(e);if(Um(n))throw new Error("Synchronous parse encountered promise.");return n}_parseAsync(e){const n=this._parse(e);return Promise.resolve(n)}parse(e,n){const r=this.safeParse(e,n);if(r.success)return r.data;throw r.error}safeParse(e,n){const r={common:{issues:[],async:(n==null?void 0:n.async)??!1,contextualErrorMap:n==null?void 0:n.errorMap},path:(n==null?void 0:n.path)||[],schemaErrorMap:this._def.errorMap,parent:null,data:e,parsedType:ba(e)},s=this._parseSync({data:e,path:r.path,parent:r});return Fk(r,s)}"~validate"(e){var r,s;const n={common:{issues:[],async:!!this["~standard"].async},path:[],schemaErrorMap:this._def.errorMap,parent:null,data:e,parsedType:ba(e)};if(!this["~standard"].async)try{const i=this._parseSync({data:e,path:[],parent:n});return nd(i)?{value:i.value}:{issues:n.common.issues}}catch(i){(s=(r=i==null?void 0:i.message)==null?void 0:r.toLowerCase())!=null&&s.includes("encountered")&&(this["~standard"].async=!0),n.common={issues:[],async:!0}}return this._parseAsync({data:e,path:[],parent:n}).then(i=>nd(i)?{value:i.value}:{issues:n.common.issues})}async parseAsync(e,n){const r=await this.safeParseAsync(e,n);if(r.success)return r.data;throw r.error}async safeParseAsync(e,n){const r={common:{issues:[],contextualErrorMap:n==null?void 0:n.errorMap,async:!0},path:(n==null?void 0:n.path)||[],schemaErrorMap:this._def.errorMap,parent:null,data:e,parsedType:ba(e)},s=this._parse({data:e,path:r.path,parent:r}),i=await(Um(s)?s:Promise.resolve(s));return Fk(r,i)}refine(e,n){const r=s=>typeof n=="string"||typeof n>"u"?{message:n}:typeof n=="function"?n(s):n;return this._refinement((s,i)=>{const o=e(s),l=()=>i.addIssue({code:xe.custom,...r(s)});return typeof Promise<"u"&&o instanceof Promise?o.then(u=>u?!0:(l(),!1)):o?!0:(l(),!1)})}refinement(e,n){return this._refinement((r,s)=>e(r)?!0:(s.addIssue(typeof n=="function"?n(r,s):n),!1))}_refinement(e){return new pc({schema:this,typeName:ot.ZodEffects,effect:{type:"refinement",refinement:e}})}superRefine(e){return this._refinement(e)}constructor(e){this.spa=this.safeParseAsync,this._def=e,this.parse=this.parse.bind(this),this.safeParse=this.safeParse.bind(this),this.parseAsync=this.parseAsync.bind(this),this.safeParseAsync=this.safeParseAsync.bind(this),this.spa=this.spa.bind(this),this.refine=this.refine.bind(this),this.refinement=this.refinement.bind(this),this.superRefine=this.superRefine.bind(this),this.optional=this.optional.bind(this),this.nullable=this.nullable.bind(this),this.nullish=this.nullish.bind(this),this.array=this.array.bind(this),this.promise=this.promise.bind(this),this.or=this.or.bind(this),this.and=this.and.bind(this),this.transform=this.transform.bind(this),this.brand=this.brand.bind(this),this.default=this.default.bind(this),this.catch=this.catch.bind(this),this.describe=this.describe.bind(this),this.pipe=this.pipe.bind(this),this.readonly=this.readonly.bind(this),this.isNullable=this.isNullable.bind(this),this.isOptional=this.isOptional.bind(this),this["~standard"]={version:1,vendor:"zod",validate:n=>this["~validate"](n)}}optional(){return jo.create(this,this._def)}nullable(){return mc.create(this,this._def)}nullish(){return this.nullable().optional()}array(){return Wi.create(this)}promise(){return Km.create(this,this._def)}or(e){return Zm.create([this,e],this._def)}and(e){return Wm.create(this,e,this._def)}transform(e){return new pc({...ht(this._def),schema:this,typeName:ot.ZodEffects,effect:{type:"transform",transform:e}})}default(e){const n=typeof e=="function"?e:()=>e;return new Ym({...ht(this._def),innerType:this,defaultValue:n,typeName:ot.ZodDefault})}brand(){return new lA({typeName:ot.ZodBranded,type:this,...ht(this._def)})}catch(e){const n=typeof e=="function"?e:()=>e;return new Xm({...ht(this._def),innerType:this,catchValue:n,typeName:ot.ZodCatch})}describe(e){const n=this.constructor;return new n({...this._def,description:e})}pipe(e){return Fx.create(this,e)}readonly(){return Qm.create(this)}isOptional(){return this.safeParse(void 0).success}isNullable(){return this.safeParse(null).success}}const LV=/^c[^\s-]{8,}$/i,NV=/^[0-9a-z]+$/,DV=/^[0-9A-HJKMNP-TV-Z]{26}$/i,jV=/^[0-9a-fA-F]{8}\b-[0-9a-fA-F]{4}\b-[0-9a-fA-F]{4}\b-[0-9a-fA-F]{4}\b-[0-9a-fA-F]{12}$/i,$V=/^[a-z0-9_-]{21}$/i,FV=/^[A-Za-z0-9-_]+\.[A-Za-z0-9-_]+\.[A-Za-z0-9-_]*$/,VV=/^[-+]?P(?!$)(?:(?:[-+]?\d+Y)|(?:[-+]?\d+[.,]\d+Y$))?(?:(?:[-+]?\d+M)|(?:[-+]?\d+[.,]\d+M$))?(?:(?:[-+]?\d+W)|(?:[-+]?\d+[.,]\d+W$))?(?:(?:[-+]?\d+D)|(?:[-+]?\d+[.,]\d+D$))?(?:T(?=[\d+-])(?:(?:[-+]?\d+H)|(?:[-+]?\d+[.,]\d+H$))?(?:(?:[-+]?\d+M)|(?:[-+]?\d+[.,]\d+M$))?(?:[-+]?\d+(?:[.,]\d+)?S)?)??$/,HV=/^(?!\.)(?!.*\.\.)([A-Z0-9_'+\-\.]*)[A-Z0-9_+-]@([A-Z0-9][A-Z0-9\-]*\.)+[A-Z]{2,}$/i,zV="^(\\p{Extended_Pictographic}|\\p{Emoji_Component})+$";let Dy;const UV=/^(?:(?:25[0-5]|2[0-4][0-9]|1[0-9][0-9]|[1-9][0-9]|[0-9])\.){3}(?:25[0-5]|2[0-4][0-9]|1[0-9][0-9]|[1-9][0-9]|[0-9])$/,BV=/^(?:(?:25[0-5]|2[0-4][0-9]|1[0-9][0-9]|[1-9][0-9]|[0-9])\.){3}(?:25[0-5]|2[0-4][0-9]|1[0-9][0-9]|[1-9][0-9]|[0-9])\/(3[0-2]|[12]?[0-9])$/,ZV=/^(([0-9a-fA-F]{1,4}:){7,7}[0-9a-fA-F]{1,4}|([0-9a-fA-F]{1,4}:){1,7}:|([0-9a-fA-F]{1,4}:){1,6}:[0-9a-fA-F]{1,4}|([0-9a-fA-F]{1,4}:){1,5}(:[0-9a-fA-F]{1,4}){1,2}|([0-9a-fA-F]{1,4}:){1,4}(:[0-9a-fA-F]{1,4}){1,3}|([0-9a-fA-F]{1,4}:){1,3}(:[0-9a-fA-F]{1,4}){1,4}|([0-9a-fA-F]{1,4}:){1,2}(:[0-9a-fA-F]{1,4}){1,5}|[0-9a-fA-F]{1,4}:((:[0-9a-fA-F]{1,4}){1,6})|:((:[0-9a-fA-F]{1,4}){1,7}|:)|fe80:(:[0-9a-fA-F]{0,4}){0,4}%[0-9a-zA-Z]{1,}|::(ffff(:0{1,4}){0,1}:){0,1}((25[0-5]|(2[0-4]|1{0,1}[0-9]){0,1}[0-9])\.){3,3}(25[0-5]|(2[0-4]|1{0,1}[0-9]){0,1}[0-9])|([0-9a-fA-F]{1,4}:){1,4}:((25[0-5]|(2[0-4]|1{0,1}[0-9]){0,1}[0-9])\.){3,3}(25[0-5]|(2[0-4]|1{0,1}[0-9]){0,1}[0-9]))$/,WV=/^(([0-9a-fA-F]{1,4}:){7,7}[0-9a-fA-F]{1,4}|([0-9a-fA-F]{1,4}:){1,7}:|([0-9a-fA-F]{1,4}:){1,6}:[0-9a-fA-F]{1,4}|([0-9a-fA-F]{1,4}:){1,5}(:[0-9a-fA-F]{1,4}){1,2}|([0-9a-fA-F]{1,4}:){1,4}(:[0-9a-fA-F]{1,4}){1,3}|([0-9a-fA-F]{1,4}:){1,3}(:[0-9a-fA-F]{1,4}){1,4}|([0-9a-fA-F]{1,4}:){1,2}(:[0-9a-fA-F]{1,4}){1,5}|[0-9a-fA-F]{1,4}:((:[0-9a-fA-F]{1,4}){1,6})|:((:[0-9a-fA-F]{1,4}){1,7}|:)|fe80:(:[0-9a-fA-F]{0,4}){0,4}%[0-9a-zA-Z]{1,}|::(ffff(:0{1,4}){0,1}:){0,1}((25[0-5]|(2[0-4]|1{0,1}[0-9]){0,1}[0-9])\.){3,3}(25[0-5]|(2[0-4]|1{0,1}[0-9]){0,1}[0-9])|([0-9a-fA-F]{1,4}:){1,4}:((25[0-5]|(2[0-4]|1{0,1}[0-9]){0,1}[0-9])\.){3,3}(25[0-5]|(2[0-4]|1{0,1}[0-9]){0,1}[0-9]))\/(12[0-8]|1[01][0-9]|[1-9]?[0-9])$/,qV=/^([0-9a-zA-Z+/]{4})*(([0-9a-zA-Z+/]{2}==)|([0-9a-zA-Z+/]{3}=))?$/,GV=/^([0-9a-zA-Z-_]{4})*(([0-9a-zA-Z-_]{2}(==)?)|([0-9a-zA-Z-_]{3}(=)?))?$/,iA="((\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-((0[13578]|1[02])-(0[1-9]|[12]\\d|3[01])|(0[469]|11)-(0[1-9]|[12]\\d|30)|(02)-(0[1-9]|1\\d|2[0-8])))",KV=new RegExp(`^${iA}$`);function oA(t){let e="[0-5]\\d";t.precision?e=`${e}\\.\\d{${t.precision}}`:t.precision==null&&(e=`${e}(\\.\\d+)?`);const n=t.precision?"+":"?";return`([01]\\d|2[0-3]):[0-5]\\d(:${e})${n}`}function YV(t){return new RegExp(`^${oA(t)}$`)}function XV(t){let e=`${iA}T${oA(t)}`;const n=[];return n.push(t.local?"Z?":"Z"),t.offset&&n.push("([+-]\\d{2}:?\\d{2})"),e=`${e}(${n.join("|")})`,new RegExp(`^${e}$`)}function QV(t,e){return!!((e==="v4"||!e)&&UV.test(t)||(e==="v6"||!e)&&ZV.test(t))}function JV(t,e){if(!FV.test(t))return!1;try{const[n]=t.split(".");if(!n)return!1;const r=n.replace(/-/g,"+").replace(/_/g,"/").padEnd(n.length+(4-n.length%4)%4,"="),s=JSON.parse(atob(r));return!(typeof s!="object"||s===null||"typ"in s&&(s==null?void 0:s.typ)!=="JWT"||!s.alg||e&&s.alg!==e)}catch{return!1}}function eH(t,e){return!!((e==="v4"||!e)&&BV.test(t)||(e==="v6"||!e)&&WV.test(t))}class Do extends xt{_parse(e){if(this._def.coerce&&(e.data=String(e.data)),this._getType(e)!==je.string){const i=this._getOrReturnCtx(e);return Te(i,{code:xe.invalid_type,expected:je.string,received:i.parsedType}),st}const r=new Fr;let s;for(const i of this._def.checks)if(i.kind==="min")e.data.length<i.value&&(s=this._getOrReturnCtx(e,s),Te(s,{code:xe.too_small,minimum:i.value,type:"string",inclusive:!0,exact:!1,message:i.message}),r.dirty());else if(i.kind==="max")e.data.length>i.value&&(s=this._getOrReturnCtx(e,s),Te(s,{code:xe.too_big,maximum:i.value,type:"string",inclusive:!0,exact:!1,message:i.message}),r.dirty());else if(i.kind==="length"){const o=e.data.length>i.value,l=e.data.length<i.value;(o||l)&&(s=this._getOrReturnCtx(e,s),o?Te(s,{code:xe.too_big,maximum:i.value,type:"string",inclusive:!0,exact:!0,message:i.message}):l&&Te(s,{code:xe.too_small,minimum:i.value,type:"string",inclusive:!0,exact:!0,message:i.message}),r.dirty())}else if(i.kind==="email")HV.test(e.data)||(s=this._getOrReturnCtx(e,s),Te(s,{validation:"email",code:xe.invalid_string,message:i.message}),r.dirty());else if(i.kind==="emoji")Dy||(Dy=new RegExp(zV,"u")),Dy.test(e.data)||(s=this._getOrReturnCtx(e,s),Te(s,{validation:"emoji",code:xe.invalid_string,message:i.message}),r.dirty());else if(i.kind==="uuid")jV.test(e.data)||(s=this._getOrReturnCtx(e,s),Te(s,{validation:"uuid",code:xe.invalid_string,message:i.message}),r.dirty());else if(i.kind==="nanoid")$V.test(e.data)||(s=this._getOrReturnCtx(e,s),Te(s,{validation:"nanoid",code:xe.invalid_string,message:i.message}),r.dirty());else if(i.kind==="cuid")LV.test(e.data)||(s=this._getOrReturnCtx(e,s),Te(s,{validation:"cuid",code:xe.invalid_string,message:i.message}),r.dirty());else if(i.kind==="cuid2")NV.test(e.data)||(s=this._getOrReturnCtx(e,s),Te(s,{validation:"cuid2",code:xe.invalid_string,message:i.message}),r.dirty());else if(i.kind==="ulid")DV.test(e.data)||(s=this._getOrReturnCtx(e,s),Te(s,{validation:"ulid",code:xe.invalid_string,message:i.message}),r.dirty());else if(i.kind==="url")try{new URL(e.data)}catch{s=this._getOrReturnCtx(e,s),Te(s,{validation:"url",code:xe.invalid_string,message:i.message}),r.dirty()}else i.kind==="regex"?(i.regex.lastIndex=0,i.regex.test(e.data)||(s=this._getOrReturnCtx(e,s),Te(s,{validation:"regex",code:xe.invalid_string,message:i.message}),r.dirty())):i.kind==="trim"?e.data=e.data.trim():i.kind==="includes"?e.data.includes(i.value,i.position)||(s=this._getOrReturnCtx(e,s),Te(s,{code:xe.invalid_string,validation:{includes:i.value,position:i.position},message:i.message}),r.dirty()):i.kind==="toLowerCase"?e.data=e.data.toLowerCase():i.kind==="toUpperCase"?e.data=e.data.toUpperCase():i.kind==="startsWith"?e.data.startsWith(i.value)||(s=this._getOrReturnCtx(e,s),Te(s,{code:xe.invalid_string,validation:{startsWith:i.value},message:i.message}),r.dirty()):i.kind==="endsWith"?e.data.endsWith(i.value)||(s=this._getOrReturnCtx(e,s),Te(s,{code:xe.invalid_string,validation:{endsWith:i.value},message:i.message}),r.dirty()):i.kind==="datetime"?XV(i).test(e.data)||(s=this._getOrReturnCtx(e,s),Te(s,{code:xe.invalid_string,validation:"datetime",message:i.message}),r.dirty()):i.kind==="date"?KV.test(e.data)||(s=this._getOrReturnCtx(e,s),Te(s,{code:xe.invalid_string,validation:"date",message:i.message}),r.dirty()):i.kind==="time"?YV(i).test(e.data)||(s=this._getOrReturnCtx(e,s),Te(s,{code:xe.invalid_string,validation:"time",message:i.message}),r.dirty()):i.kind==="duration"?VV.test(e.data)||(s=this._getOrReturnCtx(e,s),Te(s,{validation:"duration",code:xe.invalid_string,message:i.message}),r.dirty()):i.kind==="ip"?QV(e.data,i.version)||(s=this._getOrReturnCtx(e,s),Te(s,{validation:"ip",code:xe.invalid_string,message:i.message}),r.dirty()):i.kind==="jwt"?JV(e.data,i.alg)||(s=this._getOrReturnCtx(e,s),Te(s,{validation:"jwt",code:xe.invalid_string,message:i.message}),r.dirty()):i.kind==="cidr"?eH(e.data,i.version)||(s=this._getOrReturnCtx(e,s),Te(s,{validation:"cidr",code:xe.invalid_string,message:i.message}),r.dirty()):i.kind==="base64"?qV.test(e.data)||(s=this._getOrReturnCtx(e,s),Te(s,{validation:"base64",code:xe.invalid_string,message:i.message}),r.dirty()):i.kind==="base64url"?GV.test(e.data)||(s=this._getOrReturnCtx(e,s),Te(s,{validation:"base64url",code:xe.invalid_string,message:i.message}),r.dirty()):It.assertNever(i);return{status:r.value,value:e.data}}_regex(e,n,r){return this.refinement(s=>e.test(s),{validation:n,code:xe.invalid_string,...Ue.errToObj(r)})}_addCheck(e){return new Do({...this._def,checks:[...this._def.checks,e]})}email(e){return this._addCheck({kind:"email",...Ue.errToObj(e)})}url(e){return this._addCheck({kind:"url",...Ue.errToObj(e)})}emoji(e){return this._addCheck({kind:"emoji",...Ue.errToObj(e)})}uuid(e){return this._addCheck({kind:"uuid",...Ue.errToObj(e)})}nanoid(e){return this._addCheck({kind:"nanoid",...Ue.errToObj(e)})}cuid(e){return this._addCheck({kind:"cuid",...Ue.errToObj(e)})}cuid2(e){return this._addCheck({kind:"cuid2",...Ue.errToObj(e)})}ulid(e){return this._addCheck({kind:"ulid",...Ue.errToObj(e)})}base64(e){return this._addCheck({kind:"base64",...Ue.errToObj(e)})}base64url(e){return this._addCheck({kind:"base64url",...Ue.errToObj(e)})}jwt(e){return this._addCheck({kind:"jwt",...Ue.errToObj(e)})}ip(e){return this._addCheck({kind:"ip",...Ue.errToObj(e)})}cidr(e){return this._addCheck({kind:"cidr",...Ue.errToObj(e)})}datetime(e){return typeof e=="string"?this._addCheck({kind:"datetime",precision:null,offset:!1,local:!1,message:e}):this._addCheck({kind:"datetime",precision:typeof(e==null?void 0:e.precision)>"u"?null:e==null?void 0:e.precision,offset:(e==null?void 0:e.offset)??!1,local:(e==null?void 0:e.local)??!1,...Ue.errToObj(e==null?void 0:e.message)})}date(e){return this._addCheck({kind:"date",message:e})}time(e){return typeof e=="string"?this._addCheck({kind:"time",precision:null,message:e}):this._addCheck({kind:"time",precision:typeof(e==null?void 0:e.precision)>"u"?null:e==null?void 0:e.precision,...Ue.errToObj(e==null?void 0:e.message)})}duration(e){return this._addCheck({kind:"duration",...Ue.errToObj(e)})}regex(e,n){return this._addCheck({kind:"regex",regex:e,...Ue.errToObj(n)})}includes(e,n){return this._addCheck({kind:"includes",value:e,position:n==null?void 0:n.position,...Ue.errToObj(n==null?void 0:n.message)})}startsWith(e,n){return this._addCheck({kind:"startsWith",value:e,...Ue.errToObj(n)})}endsWith(e,n){return this._addCheck({kind:"endsWith",value:e,...Ue.errToObj(n)})}min(e,n){return this._addCheck({kind:"min",value:e,...Ue.errToObj(n)})}max(e,n){return this._addCheck({kind:"max",value:e,...Ue.errToObj(n)})}length(e,n){return this._addCheck({kind:"length",value:e,...Ue.errToObj(n)})}nonempty(e){return this.min(1,Ue.errToObj(e))}trim(){return new Do({...this._def,checks:[...this._def.checks,{kind:"trim"}]})}toLowerCase(){return new Do({...this._def,checks:[...this._def.checks,{kind:"toLowerCase"}]})}toUpperCase(){return new Do({...this._def,checks:[...this._def.checks,{kind:"toUpperCase"}]})}get isDatetime(){return!!this._def.checks.find(e=>e.kind==="datetime")}get isDate(){return!!this._def.checks.find(e=>e.kind==="date")}get isTime(){return!!this._def.checks.find(e=>e.kind==="time")}get isDuration(){return!!this._def.checks.find(e=>e.kind==="duration")}get isEmail(){return!!this._def.checks.find(e=>e.kind==="email")}get isURL(){return!!this._def.checks.find(e=>e.kind==="url")}get isEmoji(){return!!this._def.checks.find(e=>e.kind==="emoji")}get isUUID(){return!!this._def.checks.find(e=>e.kind==="uuid")}get isNANOID(){return!!this._def.checks.find(e=>e.kind==="nanoid")}get isCUID(){return!!this._def.checks.find(e=>e.kind==="cuid")}get isCUID2(){return!!this._def.checks.find(e=>e.kind==="cuid2")}get isULID(){return!!this._def.checks.find(e=>e.kind==="ulid")}get isIP(){return!!this._def.checks.find(e=>e.kind==="ip")}get isCIDR(){return!!this._def.checks.find(e=>e.kind==="cidr")}get isBase64(){return!!this._def.checks.find(e=>e.kind==="base64")}get isBase64url(){return!!this._def.checks.find(e=>e.kind==="base64url")}get minLength(){let e=null;for(const n of this._def.checks)n.kind==="min"&&(e===null||n.value>e)&&(e=n.value);return e}get maxLength(){let e=null;for(const n of this._def.checks)n.kind==="max"&&(e===null||n.value<e)&&(e=n.value);return e}}Do.create=t=>new Do({checks:[],typeName:ot.ZodString,coerce:(t==null?void 0:t.coerce)??!1,...ht(t)});function tH(t,e){const n=(t.toString().split(".")[1]||"").length,r=(e.toString().split(".")[1]||"").length,s=n>r?n:r,i=Number.parseInt(t.toFixed(s).replace(".","")),o=Number.parseInt(e.toFixed(s).replace(".",""));return i%o/10**s}class rd extends xt{constructor(){super(...arguments),this.min=this.gte,this.max=this.lte,this.step=this.multipleOf}_parse(e){if(this._def.coerce&&(e.data=Number(e.data)),this._getType(e)!==je.number){const i=this._getOrReturnCtx(e);return Te(i,{code:xe.invalid_type,expected:je.number,received:i.parsedType}),st}let r;const s=new Fr;for(const i of this._def.checks)i.kind==="int"?It.isInteger(e.data)||(r=this._getOrReturnCtx(e,r),Te(r,{code:xe.invalid_type,expected:"integer",received:"float",message:i.message}),s.dirty()):i.kind==="min"?(i.inclusive?e.data<i.value:e.data<=i.value)&&(r=this._getOrReturnCtx(e,r),Te(r,{code:xe.too_small,minimum:i.value,type:"number",inclusive:i.inclusive,exact:!1,message:i.message}),s.dirty()):i.kind==="max"?(i.inclusive?e.data>i.value:e.data>=i.value)&&(r=this._getOrReturnCtx(e,r),Te(r,{code:xe.too_big,maximum:i.value,type:"number",inclusive:i.inclusive,exact:!1,message:i.message}),s.dirty()):i.kind==="multipleOf"?tH(e.data,i.value)!==0&&(r=this._getOrReturnCtx(e,r),Te(r,{code:xe.not_multiple_of,multipleOf:i.value,message:i.message}),s.dirty()):i.kind==="finite"?Number.isFinite(e.data)||(r=this._getOrReturnCtx(e,r),Te(r,{code:xe.not_finite,message:i.message}),s.dirty()):It.assertNever(i);return{status:s.value,value:e.data}}gte(e,n){return this.setLimit("min",e,!0,Ue.toString(n))}gt(e,n){return this.setLimit("min",e,!1,Ue.toString(n))}lte(e,n){return this.setLimit("max",e,!0,Ue.toString(n))}lt(e,n){return this.setLimit("max",e,!1,Ue.toString(n))}setLimit(e,n,r,s){return new rd({...this._def,checks:[...this._def.checks,{kind:e,value:n,inclusive:r,message:Ue.toString(s)}]})}_addCheck(e){return new rd({...this._def,checks:[...this._def.checks,e]})}int(e){return this._addCheck({kind:"int",message:Ue.toString(e)})}positive(e){return this._addCheck({kind:"min",value:0,inclusive:!1,message:Ue.toString(e)})}negative(e){return this._addCheck({kind:"max",value:0,inclusive:!1,message:Ue.toString(e)})}nonpositive(e){return this._addCheck({kind:"max",value:0,inclusive:!0,message:Ue.toString(e)})}nonnegative(e){return this._addCheck({kind:"min",value:0,inclusive:!0,message:Ue.toString(e)})}multipleOf(e,n){return this._addCheck({kind:"multipleOf",value:e,message:Ue.toString(n)})}finite(e){return this._addCheck({kind:"finite",message:Ue.toString(e)})}safe(e){return this._addCheck({kind:"min",inclusive:!0,value:Number.MIN_SAFE_INTEGER,message:Ue.toString(e)})._addCheck({kind:"max",inclusive:!0,value:Number.MAX_SAFE_INTEGER,message:Ue.toString(e)})}get minValue(){let e=null;for(const n of this._def.checks)n.kind==="min"&&(e===null||n.value>e)&&(e=n.value);return e}get maxValue(){let e=null;for(const n of this._def.checks)n.kind==="max"&&(e===null||n.value<e)&&(e=n.value);return e}get isInt(){return!!this._def.checks.find(e=>e.kind==="int"||e.kind==="multipleOf"&&It.isInteger(e.value))}get isFinite(){let e=null,n=null;for(const r of this._def.checks){if(r.kind==="finite"||r.kind==="int"||r.kind==="multipleOf")return!0;r.kind==="min"?(n===null||r.value>n)&&(n=r.value):r.kind==="max"&&(e===null||r.value<e)&&(e=r.value)}return Number.isFinite(n)&&Number.isFinite(e)}}rd.create=t=>new rd({checks:[],typeName:ot.ZodNumber,coerce:(t==null?void 0:t.coerce)||!1,...ht(t)});class hh extends xt{constructor(){super(...arguments),this.min=this.gte,this.max=this.lte}_parse(e){if(this._def.coerce)try{e.data=BigInt(e.data)}catch{return this._getInvalidInput(e)}if(this._getType(e)!==je.bigint)return this._getInvalidInput(e);let r;const s=new Fr;for(const i of this._def.checks)i.kind==="min"?(i.inclusive?e.data<i.value:e.data<=i.value)&&(r=this._getOrReturnCtx(e,r),Te(r,{code:xe.too_small,type:"bigint",minimum:i.value,inclusive:i.inclusive,message:i.message}),s.dirty()):i.kind==="max"?(i.inclusive?e.data>i.value:e.data>=i.value)&&(r=this._getOrReturnCtx(e,r),Te(r,{code:xe.too_big,type:"bigint",maximum:i.value,inclusive:i.inclusive,message:i.message}),s.dirty()):i.kind==="multipleOf"?e.data%i.value!==BigInt(0)&&(r=this._getOrReturnCtx(e,r),Te(r,{code:xe.not_multiple_of,multipleOf:i.value,message:i.message}),s.dirty()):It.assertNever(i);return{status:s.value,value:e.data}}_getInvalidInput(e){const n=this._getOrReturnCtx(e);return Te(n,{code:xe.invalid_type,expected:je.bigint,received:n.parsedType}),st}gte(e,n){return this.setLimit("min",e,!0,Ue.toString(n))}gt(e,n){return this.setLimit("min",e,!1,Ue.toString(n))}lte(e,n){return this.setLimit("max",e,!0,Ue.toString(n))}lt(e,n){return this.setLimit("max",e,!1,Ue.toString(n))}setLimit(e,n,r,s){return new hh({...this._def,checks:[...this._def.checks,{kind:e,value:n,inclusive:r,message:Ue.toString(s)}]})}_addCheck(e){return new hh({...this._def,checks:[...this._def.checks,e]})}positive(e){return this._addCheck({kind:"min",value:BigInt(0),inclusive:!1,message:Ue.toString(e)})}negative(e){return this._addCheck({kind:"max",value:BigInt(0),inclusive:!1,message:Ue.toString(e)})}nonpositive(e){return this._addCheck({kind:"max",value:BigInt(0),inclusive:!0,message:Ue.toString(e)})}nonnegative(e){return this._addCheck({kind:"min",value:BigInt(0),inclusive:!0,message:Ue.toString(e)})}multipleOf(e,n){return this._addCheck({kind:"multipleOf",value:e,message:Ue.toString(n)})}get minValue(){let e=null;for(const n of this._def.checks)n.kind==="min"&&(e===null||n.value>e)&&(e=n.value);return e}get maxValue(){let e=null;for(const n of this._def.checks)n.kind==="max"&&(e===null||n.value<e)&&(e=n.value);return e}}hh.create=t=>new hh({checks:[],typeName:ot.ZodBigInt,coerce:(t==null?void 0:t.coerce)??!1,...ht(t)});class M2 extends xt{_parse(e){if(this._def.coerce&&(e.data=!!e.data),this._getType(e)!==je.boolean){const r=this._getOrReturnCtx(e);return Te(r,{code:xe.invalid_type,expected:je.boolean,received:r.parsedType}),st}return Xs(e.data)}}M2.create=t=>new M2({typeName:ot.ZodBoolean,coerce:(t==null?void 0:t.coerce)||!1,...ht(t)});class Bm extends xt{_parse(e){if(this._def.coerce&&(e.data=new Date(e.data)),this._getType(e)!==je.date){const i=this._getOrReturnCtx(e);return Te(i,{code:xe.invalid_type,expected:je.date,received:i.parsedType}),st}if(Number.isNaN(e.data.getTime())){const i=this._getOrReturnCtx(e);return Te(i,{code:xe.invalid_date}),st}const r=new Fr;let s;for(const i of this._def.checks)i.kind==="min"?e.data.getTime()<i.value&&(s=this._getOrReturnCtx(e,s),Te(s,{code:xe.too_small,message:i.message,inclusive:!0,exact:!1,minimum:i.value,type:"date"}),r.dirty()):i.kind==="max"?e.data.getTime()>i.value&&(s=this._getOrReturnCtx(e,s),Te(s,{code:xe.too_big,message:i.message,inclusive:!0,exact:!1,maximum:i.value,type:"date"}),r.dirty()):It.assertNever(i);return{status:r.value,value:new Date(e.data.getTime())}}_addCheck(e){return new Bm({...this._def,checks:[...this._def.checks,e]})}min(e,n){return this._addCheck({kind:"min",value:e.getTime(),message:Ue.toString(n)})}max(e,n){return this._addCheck({kind:"max",value:e.getTime(),message:Ue.toString(n)})}get minDate(){let e=null;for(const n of this._def.checks)n.kind==="min"&&(e===null||n.value>e)&&(e=n.value);return e!=null?new Date(e):null}get maxDate(){let e=null;for(const n of this._def.checks)n.kind==="max"&&(e===null||n.value<e)&&(e=n.value);return e!=null?new Date(e):null}}Bm.create=t=>new Bm({checks:[],coerce:(t==null?void 0:t.coerce)||!1,typeName:ot.ZodDate,...ht(t)});class Vk extends xt{_parse(e){if(this._getType(e)!==je.symbol){const r=this._getOrReturnCtx(e);return Te(r,{code:xe.invalid_type,expected:je.symbol,received:r.parsedType}),st}return Xs(e.data)}}Vk.create=t=>new Vk({typeName:ot.ZodSymbol,...ht(t)});class I2 extends xt{_parse(e){if(this._getType(e)!==je.undefined){const r=this._getOrReturnCtx(e);return Te(r,{code:xe.invalid_type,expected:je.undefined,received:r.parsedType}),st}return Xs(e.data)}}I2.create=t=>new I2({typeName:ot.ZodUndefined,...ht(t)});class O2 extends xt{_parse(e){if(this._getType(e)!==je.null){const r=this._getOrReturnCtx(e);return Te(r,{code:xe.invalid_type,expected:je.null,received:r.parsedType}),st}return Xs(e.data)}}O2.create=t=>new O2({typeName:ot.ZodNull,...ht(t)});class Hk extends xt{constructor(){super(...arguments),this._any=!0}_parse(e){return Xs(e.data)}}Hk.create=t=>new Hk({typeName:ot.ZodAny,...ht(t)});class L2 extends xt{constructor(){super(...arguments),this._unknown=!0}_parse(e){return Xs(e.data)}}L2.create=t=>new L2({typeName:ot.ZodUnknown,...ht(t)});class Ba extends xt{_parse(e){const n=this._getOrReturnCtx(e);return Te(n,{code:xe.invalid_type,expected:je.never,received:n.parsedType}),st}}Ba.create=t=>new Ba({typeName:ot.ZodNever,...ht(t)});class zk extends xt{_parse(e){if(this._getType(e)!==je.undefined){const r=this._getOrReturnCtx(e);return Te(r,{code:xe.invalid_type,expected:je.void,received:r.parsedType}),st}return Xs(e.data)}}zk.create=t=>new zk({typeName:ot.ZodVoid,...ht(t)});class Wi extends xt{_parse(e){const{ctx:n,status:r}=this._processInputParams(e),s=this._def;if(n.parsedType!==je.array)return Te(n,{code:xe.invalid_type,expected:je.array,received:n.parsedType}),st;if(s.exactLength!==null){const o=n.data.length>s.exactLength.value,l=n.data.length<s.exactLength.value;(o||l)&&(Te(n,{code:o?xe.too_big:xe.too_small,minimum:l?s.exactLength.value:void 0,maximum:o?s.exactLength.value:void 0,type:"array",inclusive:!0,exact:!0,message:s.exactLength.message}),r.dirty())}if(s.minLength!==null&&n.data.length<s.minLength.value&&(Te(n,{code:xe.too_small,minimum:s.minLength.value,type:"array",inclusive:!0,exact:!1,message:s.minLength.message}),r.dirty()),s.maxLength!==null&&n.data.length>s.maxLength.value&&(Te(n,{code:xe.too_big,maximum:s.maxLength.value,type:"array",inclusive:!0,exact:!1,message:s.maxLength.message}),r.dirty()),n.common.async)return Promise.all([...n.data].map((o,l)=>s.type._parseAsync(new Yi(n,o,n.path,l)))).then(o=>Fr.mergeArray(r,o));const i=[...n.data].map((o,l)=>s.type._parseSync(new Yi(n,o,n.path,l)));return Fr.mergeArray(r,i)}get element(){return this._def.type}min(e,n){return new Wi({...this._def,minLength:{value:e,message:Ue.toString(n)}})}max(e,n){return new Wi({...this._def,maxLength:{value:e,message:Ue.toString(n)}})}length(e,n){return new Wi({...this._def,exactLength:{value:e,message:Ue.toString(n)}})}nonempty(e){return this.min(1,e)}}Wi.create=(t,e)=>new Wi({type:t,minLength:null,maxLength:null,exactLength:null,typeName:ot.ZodArray,...ht(e)});function gu(t){if(t instanceof Vn){const e={};for(const n in t.shape){const r=t.shape[n];e[n]=jo.create(gu(r))}return new Vn({...t._def,shape:()=>e})}else return t instanceof Wi?new Wi({...t._def,type:gu(t.element)}):t instanceof jo?jo.create(gu(t.unwrap())):t instanceof mc?mc.create(gu(t.unwrap())):t instanceof fc?fc.create(t.items.map(e=>gu(e))):t}class Vn extends xt{constructor(){super(...arguments),this._cached=null,this.nonstrict=this.passthrough,this.augment=this.extend}_getCached(){if(this._cached!==null)return this._cached;const e=this._def.shape(),n=It.objectKeys(e);return this._cached={shape:e,keys:n},this._cached}_parse(e){if(this._getType(e)!==je.object){const d=this._getOrReturnCtx(e);return Te(d,{code:xe.invalid_type,expected:je.object,received:d.parsedType}),st}const{status:r,ctx:s}=this._processInputParams(e),{shape:i,keys:o}=this._getCached(),l=[];if(!(this._def.catchall instanceof Ba&&this._def.unknownKeys==="strip"))for(const d in s.data)o.includes(d)||l.push(d);const u=[];for(const d of o){const f=i[d],p=s.data[d];u.push({key:{status:"valid",value:d},value:f._parse(new Yi(s,p,s.path,d)),alwaysSet:d in s.data})}if(this._def.catchall instanceof Ba){const d=this._def.unknownKeys;if(d==="passthrough")for(const f of l)u.push({key:{status:"valid",value:f},value:{status:"valid",value:s.data[f]}});else if(d==="strict")l.length>0&&(Te(s,{code:xe.unrecognized_keys,keys:l}),r.dirty());else if(d!=="strip")throw new Error("Internal ZodObject error: invalid unknownKeys value.")}else{const d=this._def.catchall;for(const f of l){const p=s.data[f];u.push({key:{status:"valid",value:f},value:d._parse(new Yi(s,p,s.path,f)),alwaysSet:f in s.data})}}return s.common.async?Promise.resolve().then(async()=>{const d=[];for(const f of u){const p=await f.key,g=await f.value;d.push({key:p,value:g,alwaysSet:f.alwaysSet})}return d}).then(d=>Fr.mergeObjectSync(r,d)):Fr.mergeObjectSync(r,u)}get shape(){return this._def.shape()}strict(e){return Ue.errToObj,new Vn({...this._def,unknownKeys:"strict",...e!==void 0?{errorMap:(n,r)=>{var i,o;const s=((o=(i=this._def).errorMap)==null?void 0:o.call(i,n,r).message)??r.defaultError;return n.code==="unrecognized_keys"?{message:Ue.errToObj(e).message??s}:{message:s}}}:{}})}strip(){return new Vn({...this._def,unknownKeys:"strip"})}passthrough(){return new Vn({...this._def,unknownKeys:"passthrough"})}extend(e){return new Vn({...this._def,shape:()=>({...this._def.shape(),...e})})}merge(e){return new Vn({unknownKeys:e._def.unknownKeys,catchall:e._def.catchall,shape:()=>({...this._def.shape(),...e._def.shape()}),typeName:ot.ZodObject})}setKey(e,n){return this.augment({[e]:n})}catchall(e){return new Vn({...this._def,catchall:e})}pick(e){const n={};for(const r of It.objectKeys(e))e[r]&&this.shape[r]&&(n[r]=this.shape[r]);return new Vn({...this._def,shape:()=>n})}omit(e){const n={};for(const r of It.objectKeys(this.shape))e[r]||(n[r]=this.shape[r]);return new Vn({...this._def,shape:()=>n})}deepPartial(){return gu(this)}partial(e){const n={};for(const r of It.objectKeys(this.shape)){const s=this.shape[r];e&&!e[r]?n[r]=s:n[r]=s.optional()}return new Vn({...this._def,shape:()=>n})}required(e){const n={};for(const r of It.objectKeys(this.shape))if(e&&!e[r])n[r]=this.shape[r];else{let i=this.shape[r];for(;i instanceof jo;)i=i._def.innerType;n[r]=i}return new Vn({...this._def,shape:()=>n})}keyof(){return aA(It.objectKeys(this.shape))}}Vn.create=(t,e)=>new Vn({shape:()=>t,unknownKeys:"strip",catchall:Ba.create(),typeName:ot.ZodObject,...ht(e)});Vn.strictCreate=(t,e)=>new Vn({shape:()=>t,unknownKeys:"strict",catchall:Ba.create(),typeName:ot.ZodObject,...ht(e)});Vn.lazycreate=(t,e)=>new Vn({shape:t,unknownKeys:"strip",catchall:Ba.create(),typeName:ot.ZodObject,...ht(e)});class Zm extends xt{_parse(e){const{ctx:n}=this._processInputParams(e),r=this._def.options;function s(i){for(const l of i)if(l.result.status==="valid")return l.result;for(const l of i)if(l.result.status==="dirty")return n.common.issues.push(...l.ctx.common.issues),l.result;const o=i.map(l=>new zo(l.ctx.common.issues));return Te(n,{code:xe.invalid_union,unionErrors:o}),st}if(n.common.async)return Promise.all(r.map(async i=>{const o={...n,common:{...n.common,issues:[]},parent:null};return{result:await i._parseAsync({data:n.data,path:n.path,parent:o}),ctx:o}})).then(s);{let i;const o=[];for(const u of r){const d={...n,common:{...n.common,issues:[]},parent:null},f=u._parseSync({data:n.data,path:n.path,parent:d});if(f.status==="valid")return f;f.status==="dirty"&&!i&&(i={result:f,ctx:d}),d.common.issues.length&&o.push(d.common.issues)}if(i)return n.common.issues.push(...i.ctx.common.issues),i.result;const l=o.map(u=>new zo(u));return Te(n,{code:xe.invalid_union,unionErrors:l}),st}}get options(){return this._def.options}}Zm.create=(t,e)=>new Zm({options:t,typeName:ot.ZodUnion,...ht(e)});const Eo=t=>t instanceof D2?Eo(t.schema):t instanceof pc?Eo(t.innerType()):t instanceof Gm?[t.value]:t instanceof hc?t.options:t instanceof j2?It.objectValues(t.enum):t instanceof Ym?Eo(t._def.innerType):t instanceof I2?[void 0]:t instanceof O2?[null]:t instanceof jo?[void 0,...Eo(t.unwrap())]:t instanceof mc?[null,...Eo(t.unwrap())]:t instanceof lA||t instanceof Qm?Eo(t.unwrap()):t instanceof Xm?Eo(t._def.innerType):[];class $x extends xt{_parse(e){const{ctx:n}=this._processInputParams(e);if(n.parsedType!==je.object)return Te(n,{code:xe.invalid_type,expected:je.object,received:n.parsedType}),st;const r=this.discriminator,s=n.data[r],i=this.optionsMap.get(s);return i?n.common.async?i._parseAsync({data:n.data,path:n.path,parent:n}):i._parseSync({data:n.data,path:n.path,parent:n}):(Te(n,{code:xe.invalid_union_discriminator,options:Array.from(this.optionsMap.keys()),path:[r]}),st)}get discriminator(){return this._def.discriminator}get options(){return this._def.options}get optionsMap(){return this._def.optionsMap}static create(e,n,r){const s=new Map;for(const i of n){const o=Eo(i.shape[e]);if(!o.length)throw new Error(`A discriminator value for key \`${e}\` could not be extracted from all schema options`);for(const l of o){if(s.has(l))throw new Error(`Discriminator property ${String(e)} has duplicate value ${String(l)}`);s.set(l,i)}}return new $x({typeName:ot.ZodDiscriminatedUnion,discriminator:e,options:n,optionsMap:s,...ht(r)})}}function N2(t,e){const n=ba(t),r=ba(e);if(t===e)return{valid:!0,data:t};if(n===je.object&&r===je.object){const s=It.objectKeys(e),i=It.objectKeys(t).filter(l=>s.indexOf(l)!==-1),o={...t,...e};for(const l of i){const u=N2(t[l],e[l]);if(!u.valid)return{valid:!1};o[l]=u.data}return{valid:!0,data:o}}else if(n===je.array&&r===je.array){if(t.length!==e.length)return{valid:!1};const s=[];for(let i=0;i<t.length;i++){const o=t[i],l=e[i],u=N2(o,l);if(!u.valid)return{valid:!1};s.push(u.data)}return{valid:!0,data:s}}else return n===je.date&&r===je.date&&+t==+e?{valid:!0,data:t}:{valid:!1}}class Wm extends xt{_parse(e){const{status:n,ctx:r}=this._processInputParams(e),s=(i,o)=>{if(jk(i)||jk(o))return st;const l=N2(i.value,o.value);return l.valid?(($k(i)||$k(o))&&n.dirty(),{status:n.value,value:l.data}):(Te(r,{code:xe.invalid_intersection_types}),st)};return r.common.async?Promise.all([this._def.left._parseAsync({data:r.data,path:r.path,parent:r}),this._def.right._parseAsync({data:r.data,path:r.path,parent:r})]).then(([i,o])=>s(i,o)):s(this._def.left._parseSync({data:r.data,path:r.path,parent:r}),this._def.right._parseSync({data:r.data,path:r.path,parent:r}))}}Wm.create=(t,e,n)=>new Wm({left:t,right:e,typeName:ot.ZodIntersection,...ht(n)});class fc extends xt{_parse(e){const{status:n,ctx:r}=this._processInputParams(e);if(r.parsedType!==je.array)return Te(r,{code:xe.invalid_type,expected:je.array,received:r.parsedType}),st;if(r.data.length<this._def.items.length)return Te(r,{code:xe.too_small,minimum:this._def.items.length,inclusive:!0,exact:!1,type:"array"}),st;!this._def.rest&&r.data.length>this._def.items.length&&(Te(r,{code:xe.too_big,maximum:this._def.items.length,inclusive:!0,exact:!1,type:"array"}),n.dirty());const i=[...r.data].map((o,l)=>{const u=this._def.items[l]||this._def.rest;return u?u._parse(new Yi(r,o,r.path,l)):null}).filter(o=>!!o);return r.common.async?Promise.all(i).then(o=>Fr.mergeArray(n,o)):Fr.mergeArray(n,i)}get items(){return this._def.items}rest(e){return new fc({...this._def,rest:e})}}fc.create=(t,e)=>{if(!Array.isArray(t))throw new Error("You must pass an array of schemas to z.tuple([ ... ])");return new fc({items:t,typeName:ot.ZodTuple,rest:null,...ht(e)})};class qm extends xt{get keySchema(){return this._def.keyType}get valueSchema(){return this._def.valueType}_parse(e){const{status:n,ctx:r}=this._processInputParams(e);if(r.parsedType!==je.object)return Te(r,{code:xe.invalid_type,expected:je.object,received:r.parsedType}),st;const s=[],i=this._def.keyType,o=this._def.valueType;for(const l in r.data)s.push({key:i._parse(new Yi(r,l,r.path,l)),value:o._parse(new Yi(r,r.data[l],r.path,l)),alwaysSet:l in r.data});return r.common.async?Fr.mergeObjectAsync(n,s):Fr.mergeObjectSync(n,s)}get element(){return this._def.valueType}static create(e,n,r){return n instanceof xt?new qm({keyType:e,valueType:n,typeName:ot.ZodRecord,...ht(r)}):new qm({keyType:Do.create(),valueType:e,typeName:ot.ZodRecord,...ht(n)})}}class Uk extends xt{get keySchema(){return this._def.keyType}get valueSchema(){return this._def.valueType}_parse(e){const{status:n,ctx:r}=this._processInputParams(e);if(r.parsedType!==je.map)return Te(r,{code:xe.invalid_type,expected:je.map,received:r.parsedType}),st;const s=this._def.keyType,i=this._def.valueType,o=[...r.data.entries()].map(([l,u],d)=>({key:s._parse(new Yi(r,l,r.path,[d,"key"])),value:i._parse(new Yi(r,u,r.path,[d,"value"]))}));if(r.common.async){const l=new Map;return Promise.resolve().then(async()=>{for(const u of o){const d=await u.key,f=await u.value;if(d.status==="aborted"||f.status==="aborted")return st;(d.status==="dirty"||f.status==="dirty")&&n.dirty(),l.set(d.value,f.value)}return{status:n.value,value:l}})}else{const l=new Map;for(const u of o){const d=u.key,f=u.value;if(d.status==="aborted"||f.status==="aborted")return st;(d.status==="dirty"||f.status==="dirty")&&n.dirty(),l.set(d.value,f.value)}return{status:n.value,value:l}}}}Uk.create=(t,e,n)=>new Uk({valueType:e,keyType:t,typeName:ot.ZodMap,...ht(n)});class ph extends xt{_parse(e){const{status:n,ctx:r}=this._processInputParams(e);if(r.parsedType!==je.set)return Te(r,{code:xe.invalid_type,expected:je.set,received:r.parsedType}),st;const s=this._def;s.minSize!==null&&r.data.size<s.minSize.value&&(Te(r,{code:xe.too_small,minimum:s.minSize.value,type:"set",inclusive:!0,exact:!1,message:s.minSize.message}),n.dirty()),s.maxSize!==null&&r.data.size>s.maxSize.value&&(Te(r,{code:xe.too_big,maximum:s.maxSize.value,type:"set",inclusive:!0,exact:!1,message:s.maxSize.message}),n.dirty());const i=this._def.valueType;function o(u){const d=new Set;for(const f of u){if(f.status==="aborted")return st;f.status==="dirty"&&n.dirty(),d.add(f.value)}return{status:n.value,value:d}}const l=[...r.data.values()].map((u,d)=>i._parse(new Yi(r,u,r.path,d)));return r.common.async?Promise.all(l).then(u=>o(u)):o(l)}min(e,n){return new ph({...this._def,minSize:{value:e,message:Ue.toString(n)}})}max(e,n){return new ph({...this._def,maxSize:{value:e,message:Ue.toString(n)}})}size(e,n){return this.min(e,n).max(e,n)}nonempty(e){return this.min(1,e)}}ph.create=(t,e)=>new ph({valueType:t,minSize:null,maxSize:null,typeName:ot.ZodSet,...ht(e)});class D2 extends xt{get schema(){return this._def.getter()}_parse(e){const{ctx:n}=this._processInputParams(e);return this._def.getter()._parse({data:n.data,path:n.path,parent:n})}}D2.create=(t,e)=>new D2({getter:t,typeName:ot.ZodLazy,...ht(e)});class Gm extends xt{_parse(e){if(e.data!==this._def.value){const n=this._getOrReturnCtx(e);return Te(n,{received:n.data,code:xe.invalid_literal,expected:this._def.value}),st}return{status:"valid",value:e.data}}get value(){return this._def.value}}Gm.create=(t,e)=>new Gm({value:t,typeName:ot.ZodLiteral,...ht(e)});function aA(t,e){return new hc({values:t,typeName:ot.ZodEnum,...ht(e)})}class hc extends xt{_parse(e){if(typeof e.data!="string"){const n=this._getOrReturnCtx(e),r=this._def.values;return Te(n,{expected:It.joinValues(r),received:n.parsedType,code:xe.invalid_type}),st}if(this._cache||(this._cache=new Set(this._def.values)),!this._cache.has(e.data)){const n=this._getOrReturnCtx(e),r=this._def.values;return Te(n,{received:n.data,code:xe.invalid_enum_value,options:r}),st}return Xs(e.data)}get options(){return this._def.values}get enum(){const e={};for(const n of this._def.values)e[n]=n;return e}get Values(){const e={};for(const n of this._def.values)e[n]=n;return e}get Enum(){const e={};for(const n of this._def.values)e[n]=n;return e}extract(e,n=this._def){return hc.create(e,{...this._def,...n})}exclude(e,n=this._def){return hc.create(this.options.filter(r=>!e.includes(r)),{...this._def,...n})}}hc.create=aA;class j2 extends xt{_parse(e){const n=It.getValidEnumValues(this._def.values),r=this._getOrReturnCtx(e);if(r.parsedType!==je.string&&r.parsedType!==je.number){const s=It.objectValues(n);return Te(r,{expected:It.joinValues(s),received:r.parsedType,code:xe.invalid_type}),st}if(this._cache||(this._cache=new Set(It.getValidEnumValues(this._def.values))),!this._cache.has(e.data)){const s=It.objectValues(n);return Te(r,{received:r.data,code:xe.invalid_enum_value,options:s}),st}return Xs(e.data)}get enum(){return this._def.values}}j2.create=(t,e)=>new j2({values:t,typeName:ot.ZodNativeEnum,...ht(e)});class Km extends xt{unwrap(){return this._def.type}_parse(e){const{ctx:n}=this._processInputParams(e);if(n.parsedType!==je.promise&&n.common.async===!1)return Te(n,{code:xe.invalid_type,expected:je.promise,received:n.parsedType}),st;const r=n.parsedType===je.promise?n.data:Promise.resolve(n.data);return Xs(r.then(s=>this._def.type.parseAsync(s,{path:n.path,errorMap:n.common.contextualErrorMap})))}}Km.create=(t,e)=>new Km({type:t,typeName:ot.ZodPromise,...ht(e)});class pc extends xt{innerType(){return this._def.schema}sourceType(){return this._def.schema._def.typeName===ot.ZodEffects?this._def.schema.sourceType():this._def.schema}_parse(e){const{status:n,ctx:r}=this._processInputParams(e),s=this._def.effect||null,i={addIssue:o=>{Te(r,o),o.fatal?n.abort():n.dirty()},get path(){return r.path}};if(i.addIssue=i.addIssue.bind(i),s.type==="preprocess"){const o=s.transform(r.data,i);if(r.common.async)return Promise.resolve(o).then(async l=>{if(n.value==="aborted")return st;const u=await this._def.schema._parseAsync({data:l,path:r.path,parent:r});return u.status==="aborted"?st:u.status==="dirty"||n.value==="dirty"?Pf(u.value):u});{if(n.value==="aborted")return st;const l=this._def.schema._parseSync({data:o,path:r.path,parent:r});return l.status==="aborted"?st:l.status==="dirty"||n.value==="dirty"?Pf(l.value):l}}if(s.type==="refinement"){const o=l=>{const u=s.refinement(l,i);if(r.common.async)return Promise.resolve(u);if(u instanceof Promise)throw new Error("Async refinement encountered during synchronous parse operation. Use .parseAsync instead.");return l};if(r.common.async===!1){const l=this._def.schema._parseSync({data:r.data,path:r.path,parent:r});return l.status==="aborted"?st:(l.status==="dirty"&&n.dirty(),o(l.value),{status:n.value,value:l.value})}else return this._def.schema._parseAsync({data:r.data,path:r.path,parent:r}).then(l=>l.status==="aborted"?st:(l.status==="dirty"&&n.dirty(),o(l.value).then(()=>({status:n.value,value:l.value}))))}if(s.type==="transform")if(r.common.async===!1){const o=this._def.schema._parseSync({data:r.data,path:r.path,parent:r});if(!nd(o))return st;const l=s.transform(o.value,i);if(l instanceof Promise)throw new Error("Asynchronous transform encountered during synchronous parse operation. Use .parseAsync instead.");return{status:n.value,value:l}}else return this._def.schema._parseAsync({data:r.data,path:r.path,parent:r}).then(o=>nd(o)?Promise.resolve(s.transform(o.value,i)).then(l=>({status:n.value,value:l})):st);It.assertNever(s)}}pc.create=(t,e,n)=>new pc({schema:t,typeName:ot.ZodEffects,effect:e,...ht(n)});pc.createWithPreprocess=(t,e,n)=>new pc({schema:e,effect:{type:"preprocess",transform:t},typeName:ot.ZodEffects,...ht(n)});class jo extends xt{_parse(e){return this._getType(e)===je.undefined?Xs(void 0):this._def.innerType._parse(e)}unwrap(){return this._def.innerType}}jo.create=(t,e)=>new jo({innerType:t,typeName:ot.ZodOptional,...ht(e)});class mc extends xt{_parse(e){return this._getType(e)===je.null?Xs(null):this._def.innerType._parse(e)}unwrap(){return this._def.innerType}}mc.create=(t,e)=>new mc({innerType:t,typeName:ot.ZodNullable,...ht(e)});class Ym extends xt{_parse(e){const{ctx:n}=this._processInputParams(e);let r=n.data;return n.parsedType===je.undefined&&(r=this._def.defaultValue()),this._def.innerType._parse({data:r,path:n.path,parent:n})}removeDefault(){return this._def.innerType}}Ym.create=(t,e)=>new Ym({innerType:t,typeName:ot.ZodDefault,defaultValue:typeof e.default=="function"?e.default:()=>e.default,...ht(e)});class Xm extends xt{_parse(e){const{ctx:n}=this._processInputParams(e),r={...n,common:{...n.common,issues:[]}},s=this._def.innerType._parse({data:r.data,path:r.path,parent:{...r}});return Um(s)?s.then(i=>({status:"valid",value:i.status==="valid"?i.value:this._def.catchValue({get error(){return new zo(r.common.issues)},input:r.data})})):{status:"valid",value:s.status==="valid"?s.value:this._def.catchValue({get error(){return new zo(r.common.issues)},input:r.data})}}removeCatch(){return this._def.innerType}}Xm.create=(t,e)=>new Xm({innerType:t,typeName:ot.ZodCatch,catchValue:typeof e.catch=="function"?e.catch:()=>e.catch,...ht(e)});class Bk extends xt{_parse(e){if(this._getType(e)!==je.nan){const r=this._getOrReturnCtx(e);return Te(r,{code:xe.invalid_type,expected:je.nan,received:r.parsedType}),st}return{status:"valid",value:e.data}}}Bk.create=t=>new Bk({typeName:ot.ZodNaN,...ht(t)});class lA extends xt{_parse(e){const{ctx:n}=this._processInputParams(e),r=n.data;return this._def.type._parse({data:r,path:n.path,parent:n})}unwrap(){return this._def.type}}class Fx extends xt{_parse(e){const{status:n,ctx:r}=this._processInputParams(e);if(r.common.async)return(async()=>{const i=await this._def.in._parseAsync({data:r.data,path:r.path,parent:r});return i.status==="aborted"?st:i.status==="dirty"?(n.dirty(),Pf(i.value)):this._def.out._parseAsync({data:i.value,path:r.path,parent:r})})();{const s=this._def.in._parseSync({data:r.data,path:r.path,parent:r});return s.status==="aborted"?st:s.status==="dirty"?(n.dirty(),{status:"dirty",value:s.value}):this._def.out._parseSync({data:s.value,path:r.path,parent:r})}}static create(e,n){return new Fx({in:e,out:n,typeName:ot.ZodPipeline})}}class Qm extends xt{_parse(e){const n=this._def.innerType._parse(e),r=s=>(nd(s)&&(s.value=Object.freeze(s.value)),s);return Um(n)?n.then(s=>r(s)):r(n)}unwrap(){return this._def.innerType}}Qm.create=(t,e)=>new Qm({innerType:t,typeName:ot.ZodReadonly,...ht(e)});var ot;(function(t){t.ZodString="ZodString",t.ZodNumber="ZodNumber",t.ZodNaN="ZodNaN",t.ZodBigInt="ZodBigInt",t.ZodBoolean="ZodBoolean",t.ZodDate="ZodDate",t.ZodSymbol="ZodSymbol",t.ZodUndefined="ZodUndefined",t.ZodNull="ZodNull",t.ZodAny="ZodAny",t.ZodUnknown="ZodUnknown",t.ZodNever="ZodNever",t.ZodVoid="ZodVoid",t.ZodArray="ZodArray",t.ZodObject="ZodObject",t.ZodUnion="ZodUnion",t.ZodDiscriminatedUnion="ZodDiscriminatedUnion",t.ZodIntersection="ZodIntersection",t.ZodTuple="ZodTuple",t.ZodRecord="ZodRecord",t.ZodMap="ZodMap",t.ZodSet="ZodSet",t.ZodFunction="ZodFunction",t.ZodLazy="ZodLazy",t.ZodLiteral="ZodLiteral",t.ZodEnum="ZodEnum",t.ZodEffects="ZodEffects",t.ZodNativeEnum="ZodNativeEnum",t.ZodOptional="ZodOptional",t.ZodNullable="ZodNullable",t.ZodDefault="ZodDefault",t.ZodCatch="ZodCatch",t.ZodPromise="ZodPromise",t.ZodBranded="ZodBranded",t.ZodPipeline="ZodPipeline",t.ZodReadonly="ZodReadonly"})(ot||(ot={}));const Je=Do.create,cA=rd.create,mh=M2.create,Soe=L2.create;Ba.create;const sd=Wi.create,On=Vn.create,nH=Zm.create,rH=$x.create;Wm.create;fc.create;const uA=qm.create,Zk=Gm.create,jg=hc.create;Km.create;jo.create;mc.create;const sH=st,iH=On({token:Je().min(1)}),oH=t=>iH.parse(t).token,Vx="rivet_library_token";let gc="";const Jm=new Set,aH=()=>`Bearer ${gc}`,koe=()=>!!gc,Eoe=t=>(Jm.add(t),()=>Jm.delete(t)),lH=t=>{gc=t;try{window.sessionStorage.setItem(Vx,t)}catch{}Jm.forEach(e=>e())},dA=()=>{gc="";try{window.sessionStorage.removeItem(Vx)}catch{}Jm.forEach(t=>t())},cH=async()=>{if(!window.location.pathname.startsWith("/rivet/library"))return;const t=new URLSearchParams(window.location.hash.slice(1)).get("code");if(t){window.history.replaceState(null,"",window.location.pathname+window.location.search);try{const e=await fetch("/api/library/browser-sessions/exchange",{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({code:t})});if(e.ok){lH(oH(await e.json()));return}}catch{}}try{gc=window.sessionStorage.getItem(Vx)??""}catch{gc=""}},uH=async(t,e={})=>{const n=await fetch(`/api/library${t}`,{method:e.method??"GET",signal:e.signal,headers:{Authorization:`Bearer ${gc}`,"Content-Type":"application/json"},...e.body!==void 0?{body:JSON.stringify(e.body)}:{}});return dH(n)},dH=async t=>{const e=await t.text();let n;try{n=JSON.parse(e)}catch{if(t.ok)throw new Error("The library returned an invalid response.")}if(!t.ok){if(t.status===401)throw dA(),new Error("Sign in to access this library.");const r=n&&typeof n=="object"&&"error"in n&&typeof n.error=="string"&&n.error.trim()?n.error:`Library request failed (${t.status}).`;throw new Error(r)}return n};var b0={},jy={exports:{}},Wr={},$y={exports:{}},Fy={};/**
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 Wk;function fH(){return Wk||(Wk=1,(function(t){function e(U,ee){var Z=U.length;U.push(ee);e:for(;0<Z;){var j=Z-1>>>1,Q=U[j];if(0<s(Q,ee))U[j]=ee,U[Z]=Q,Z=j;else break e}}function n(U){return U.length===0?null:U[0]}function r(U){if(U.length===0)return null;var ee=U[0],Z=U.pop();if(Z!==ee){U[0]=Z;e:for(var j=0,Q=U.length,oe=Q>>>1;j<oe;){var re=2*(j+1)-1,ie=U[re],fe=re+1,_e=U[fe];if(0>s(ie,Z))fe<Q&&0>s(_e,ie)?(U[j]=_e,U[fe]=Z,j=fe):(U[j]=ie,U[re]=Z,j=re);else if(fe<Q&&0>s(_e,Z))U[j]=_e,U[fe]=Z,j=fe;else break e}}return ee}function s(U,ee){var Z=U.sortIndex-ee.sortIndex;return Z!==0?Z:U.id-ee.id}if(typeof performance=="object"&&typeof performance.now=="function"){var i=performance;t.unstable_now=function(){return i.now()}}else{var o=Date,l=o.now();t.unstable_now=function(){return o.now()-l}}var u=[],d=[],f=1,p=null,g=3,v=!1,w=!1,_=!1,x=typeof setTimeout=="function"?setTimeout:null,S=typeof clearTimeout=="function"?clearTimeout:null,k=typeof setImmediate<"u"?setImmediate:null;typeof navigator<"u"&&navigator.scheduling!==void 0&&navigator.scheduling.isInputPending!==void 0&&navigator.scheduling.isInputPending.bind(navigator.scheduling);function C(U){for(var ee=n(d);ee!==null;){if(ee.callback===null)r(d);else if(ee.startTime<=U)r(d),ee.sortIndex=ee.expirationTime,e(u,ee);else break;ee=n(d)}}function T(U){if(_=!1,C(U),!w)if(n(u)!==null)w=!0,V(A);else{var ee=n(d);ee!==null&&K(T,ee.startTime-U)}}function A(U,ee){w=!1,_&&(_=!1,S(R),R=-1),v=!0;var Z=g;try{for(C(ee),p=n(u);p!==null&&(!(p.expirationTime>ee)||U&&!D());){var j=p.callback;if(typeof j=="function"){p.callback=null,g=p.priorityLevel;var Q=j(p.expirationTime<=ee);ee=t.unstable_now(),typeof Q=="function"?p.callback=Q:p===n(u)&&r(u),C(ee)}else r(u);p=n(u)}if(p!==null)var oe=!0;else{var re=n(d);re!==null&&K(T,re.startTime-ee),oe=!1}return oe}finally{p=null,g=Z,v=!1}}var I=!1,M=null,R=-1,O=5,N=-1;function D(){return!(t.unstable_now()-N<O)}function $(){if(M!==null){var U=t.unstable_now();N=U;var ee=!0;try{ee=M(!0,U)}finally{ee?Y():(I=!1,M=null)}}else I=!1}var Y;if(typeof k=="function")Y=function(){k($)};else if(typeof MessageChannel<"u"){var B=new MessageChannel,G=B.port2;B.port1.onmessage=$,Y=function(){G.postMessage(null)}}else Y=function(){x($,0)};function V(U){M=U,I||(I=!0,Y())}function K(U,ee){R=x(function(){U(t.unstable_now())},ee)}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(U){U.callback=null},t.unstable_continueExecution=function(){w||v||(w=!0,V(A))},t.unstable_forceFrameRate=function(U){0>U||125<U?console.error("forceFrameRate takes a positive int between 0 and 125, forcing frame rates higher than 125 fps is not supported"):O=0<U?Math.floor(1e3/U):5},t.unstable_getCurrentPriorityLevel=function(){return g},t.unstable_getFirstCallbackNode=function(){return n(u)},t.unstable_next=function(U){switch(g){case 1:case 2:case 3:var ee=3;break;default:ee=g}var Z=g;g=ee;try{return U()}finally{g=Z}},t.unstable_pauseExecution=function(){},t.unstable_requestPaint=function(){},t.unstable_runWithPriority=function(U,ee){switch(U){case 1:case 2:case 3:case 4:case 5:break;default:U=3}var Z=g;g=U;try{return ee()}finally{g=Z}},t.unstable_scheduleCallback=function(U,ee,Z){var j=t.unstable_now();switch(typeof Z=="object"&&Z!==null?(Z=Z.delay,Z=typeof Z=="number"&&0<Z?j+Z:j):Z=j,U){case 1:var Q=-1;break;case 2:Q=250;break;case 5:Q=1073741823;break;case 4:Q=1e4;break;default:Q=5e3}return Q=Z+Q,U={id:f++,callback:ee,priorityLevel:U,startTime:Z,expirationTime:Q,sortIndex:-1},Z>j?(U.sortIndex=Z,e(d,U),n(u)===null&&U===n(d)&&(_?(S(R),R=-1):_=!0,K(T,Z-j))):(U.sortIndex=Q,e(u,U),w||v||(w=!0,V(A))),U},t.unstable_shouldYield=D,t.unstable_wrapCallback=function(U){var ee=g;return function(){var Z=g;g=ee;try{return U.apply(this,arguments)}finally{g=Z}}}})(Fy)),Fy}var qk;function hH(){return qk||(qk=1,$y.exports=fH()),$y.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 Gk;function pH(){if(Gk)return Wr;Gk=1;var t=cx(),e=hH();function n(a){for(var c="https://reactjs.org/docs/error-decoder.html?invariant="+a,h=1;h<arguments.length;h++)c+="&args[]="+encodeURIComponent(arguments[h]);return"Minified React error #"+a+"; visit "+c+" for the full message or use the non-minified dev environment for full errors and additional helpful warnings."}var r=new Set,s={};function i(a,c){o(a,c),o(a+"Capture",c)}function o(a,c){for(s[a]=c,a=0;a<c.length;a++)r.add(c[a])}var l=!(typeof window>"u"||typeof window.document>"u"||typeof window.document.createElement>"u"),u=Object.prototype.hasOwnProperty,d=/^[:A-Z_a-z\u00C0-\u00D6\u00D8-\u00F6\u00F8-\u02FF\u0370-\u037D\u037F-\u1FFF\u200C-\u200D\u2070-\u218F\u2C00-\u2FEF\u3001-\uD7FF\uF900-\uFDCF\uFDF0-\uFFFD][:A-Z_a-z\u00C0-\u00D6\u00D8-\u00F6\u00F8-\u02FF\u0370-\u037D\u037F-\u1FFF\u200C-\u200D\u2070-\u218F\u2C00-\u2FEF\u3001-\uD7FF\uF900-\uFDCF\uFDF0-\uFFFD\-.0-9\u00B7\u0300-\u036F\u203F-\u2040]*$/,f={},p={};function g(a){return u.call(p,a)?!0:u.call(f,a)?!1:d.test(a)?p[a]=!0:(f[a]=!0,!1)}function v(a,c,h,y){if(h!==null&&h.type===0)return!1;switch(typeof c){case"function":case"symbol":return!0;case"boolean":return y?!1:h!==null?!h.acceptsBooleans:(a=a.toLowerCase().slice(0,5),a!=="data-"&&a!=="aria-");default:return!1}}function w(a,c,h,y){if(c===null||typeof c>"u"||v(a,c,h,y))return!0;if(y)return!1;if(h!==null)switch(h.type){case 3:return!c;case 4:return c===!1;case 5:return isNaN(c);case 6:return isNaN(c)||1>c}return!1}function _(a,c,h,y,E,P,L){this.acceptsBooleans=c===2||c===3||c===4,this.attributeName=y,this.attributeNamespace=E,this.mustUseProperty=h,this.propertyName=a,this.type=c,this.sanitizeURL=P,this.removeEmptyString=L}var x={};"children dangerouslySetInnerHTML defaultValue defaultChecked innerHTML suppressContentEditableWarning suppressHydrationWarning style".split(" ").forEach(function(a){x[a]=new _(a,0,!1,a,null,!1,!1)}),[["acceptCharset","accept-charset"],["className","class"],["htmlFor","for"],["httpEquiv","http-equiv"]].forEach(function(a){var c=a[0];x[c]=new _(c,1,!1,a[1],null,!1,!1)}),["contentEditable","draggable","spellCheck","value"].forEach(function(a){x[a]=new _(a,2,!1,a.toLowerCase(),null,!1,!1)}),["autoReverse","externalResourcesRequired","focusable","preserveAlpha"].forEach(function(a){x[a]=new _(a,2,!1,a,null,!1,!1)}),"allowFullScreen async autoFocus autoPlay controls default defer disabled disablePictureInPicture disableRemotePlayback formNoValidate hidden loop noModule noValidate open playsInline readOnly required reversed scoped seamless itemScope".split(" ").forEach(function(a){x[a]=new _(a,3,!1,a.toLowerCase(),null,!1,!1)}),["checked","multiple","muted","selected"].forEach(function(a){x[a]=new _(a,3,!0,a,null,!1,!1)}),["capture","download"].forEach(function(a){x[a]=new _(a,4,!1,a,null,!1,!1)}),["cols","rows","size","span"].forEach(function(a){x[a]=new _(a,6,!1,a,null,!1,!1)}),["rowSpan","start"].forEach(function(a){x[a]=new _(a,5,!1,a.toLowerCase(),null,!1,!1)});var S=/[\-:]([a-z])/g;function k(a){return a[1].toUpperCase()}"accent-height alignment-baseline arabic-form baseline-shift cap-height clip-path clip-rule color-interpolation color-interpolation-filters color-profile color-rendering dominant-baseline enable-background fill-opacity fill-rule flood-color flood-opacity font-family font-size font-size-adjust font-stretch font-style font-variant font-weight glyph-name glyph-orientation-horizontal glyph-orientation-vertical horiz-adv-x horiz-origin-x image-rendering letter-spacing lighting-color marker-end marker-mid marker-start overline-position overline-thickness paint-order panose-1 pointer-events rendering-intent shape-rendering stop-color stop-opacity strikethrough-position strikethrough-thickness stroke-dasharray stroke-dashoffset stroke-linecap stroke-linejoin stroke-miterlimit stroke-opacity stroke-width text-anchor text-decoration text-rendering underline-position underline-thickness unicode-bidi unicode-range units-per-em v-alphabetic v-hanging v-ideographic v-mathematical vector-effect vert-adv-y vert-origin-x vert-origin-y word-spacing writing-mode xmlns:xlink x-height".split(" ").forEach(function(a){var c=a.replace(S,k);x[c]=new _(c,1,!1,a,null,!1,!1)}),"xlink:actuate xlink:arcrole xlink:role xlink:show xlink:title xlink:type".split(" ").forEach(function(a){var c=a.replace(S,k);x[c]=new _(c,1,!1,a,"http://www.w3.org/1999/xlink",!1,!1)}),["xml:base","xml:lang","xml:space"].forEach(function(a){var c=a.replace(S,k);x[c]=new _(c,1,!1,a,"http://www.w3.org/XML/1998/namespace",!1,!1)}),["tabIndex","crossOrigin"].forEach(function(a){x[a]=new _(a,1,!1,a.toLowerCase(),null,!1,!1)}),x.xlinkHref=new _("xlinkHref",1,!1,"xlink:href","http://www.w3.org/1999/xlink",!0,!1),["src","href","action","formAction"].forEach(function(a){x[a]=new _(a,1,!1,a.toLowerCase(),null,!0,!0)});function C(a,c,h,y){var E=x.hasOwnProperty(c)?x[c]:null;(E!==null?E.type!==0:y||!(2<c.length)||c[0]!=="o"&&c[0]!=="O"||c[1]!=="n"&&c[1]!=="N")&&(w(c,h,E,y)&&(h=null),y||E===null?g(c)&&(h===null?a.removeAttribute(c):a.setAttribute(c,""+h)):E.mustUseProperty?a[E.propertyName]=h===null?E.type===3?!1:"":h:(c=E.attributeName,y=E.attributeNamespace,h===null?a.removeAttribute(c):(E=E.type,h=E===3||E===4&&h===!0?"":""+h,y?a.setAttributeNS(y,c,h):a.setAttribute(c,h))))}var T=t.__SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED,A=Symbol.for("react.element"),I=Symbol.for("react.portal"),M=Symbol.for("react.fragment"),R=Symbol.for("react.strict_mode"),O=Symbol.for("react.profiler"),N=Symbol.for("react.provider"),D=Symbol.for("react.context"),$=Symbol.for("react.forward_ref"),Y=Symbol.for("react.suspense"),B=Symbol.for("react.suspense_list"),G=Symbol.for("react.memo"),V=Symbol.for("react.lazy"),K=Symbol.for("react.offscreen"),U=Symbol.iterator;function ee(a){return a===null||typeof a!="object"?null:(a=U&&a[U]||a["@@iterator"],typeof a=="function"?a:null)}var Z=Object.assign,j;function Q(a){if(j===void 0)try{throw Error()}catch(h){var c=h.stack.trim().match(/\n( *(at )?)/);j=c&&c[1]||""}return`
36
+ `+j+a}var oe=!1;function re(a,c){if(!a||oe)return"";oe=!0;var h=Error.prepareStackTrace;Error.prepareStackTrace=void 0;try{if(c)if(c=function(){throw Error()},Object.defineProperty(c.prototype,"props",{set:function(){throw Error()}}),typeof Reflect=="object"&&Reflect.construct){try{Reflect.construct(c,[])}catch(se){var y=se}Reflect.construct(a,[],c)}else{try{c.call()}catch(se){y=se}a.call(c.prototype)}else{try{throw Error()}catch(se){y=se}a()}}catch(se){if(se&&y&&typeof se.stack=="string"){for(var E=se.stack.split(`
37
+ `),P=y.stack.split(`
38
+ `),L=E.length-1,z=P.length-1;1<=L&&0<=z&&E[L]!==P[z];)z--;for(;1<=L&&0<=z;L--,z--)if(E[L]!==P[z]){if(L!==1||z!==1)do if(L--,z--,0>z||E[L]!==P[z]){var q=`
39
+ `+E[L].replace(" at new "," at ");return a.displayName&&q.includes("<anonymous>")&&(q=q.replace("<anonymous>",a.displayName)),q}while(1<=L&&0<=z);break}}}finally{oe=!1,Error.prepareStackTrace=h}return(a=a?a.displayName||a.name:"")?Q(a):""}function ie(a){switch(a.tag){case 5:return Q(a.type);case 16:return Q("Lazy");case 13:return Q("Suspense");case 19:return Q("SuspenseList");case 0:case 2:case 15:return a=re(a.type,!1),a;case 11:return a=re(a.type.render,!1),a;case 1:return a=re(a.type,!0),a;default:return""}}function fe(a){if(a==null)return null;if(typeof a=="function")return a.displayName||a.name||null;if(typeof a=="string")return a;switch(a){case M:return"Fragment";case I:return"Portal";case O:return"Profiler";case R:return"StrictMode";case Y:return"Suspense";case B:return"SuspenseList"}if(typeof a=="object")switch(a.$$typeof){case D:return(a.displayName||"Context")+".Consumer";case N:return(a._context.displayName||"Context")+".Provider";case $:var c=a.render;return a=a.displayName,a||(a=c.displayName||c.name||"",a=a!==""?"ForwardRef("+a+")":"ForwardRef"),a;case G:return c=a.displayName||null,c!==null?c:fe(a.type)||"Memo";case V:c=a._payload,a=a._init;try{return fe(a(c))}catch{}}return null}function _e(a){var c=a.type;switch(a.tag){case 24:return"Cache";case 9:return(c.displayName||"Context")+".Consumer";case 10:return(c._context.displayName||"Context")+".Provider";case 18:return"DehydratedFragment";case 11:return a=c.render,a=a.displayName||a.name||"",c.displayName||(a!==""?"ForwardRef("+a+")":"ForwardRef");case 7:return"Fragment";case 5:return c;case 4:return"Portal";case 3:return"Root";case 6:return"Text";case 16:return fe(c);case 8:return c===R?"StrictMode":"Mode";case 22:return"Offscreen";case 12:return"Profiler";case 21:return"Scope";case 13:return"Suspense";case 19:return"SuspenseList";case 25:return"TracingMarker";case 1:case 0:case 17:case 2:case 14:case 15:if(typeof c=="function")return c.displayName||c.name||null;if(typeof c=="string")return c}return null}function ue(a){switch(typeof a){case"boolean":case"number":case"string":case"undefined":return a;case"object":return a;default:return""}}function ae(a){var c=a.type;return(a=a.nodeName)&&a.toLowerCase()==="input"&&(c==="checkbox"||c==="radio")}function Oe(a){var c=ae(a)?"checked":"value",h=Object.getOwnPropertyDescriptor(a.constructor.prototype,c),y=""+a[c];if(!a.hasOwnProperty(c)&&typeof h<"u"&&typeof h.get=="function"&&typeof h.set=="function"){var E=h.get,P=h.set;return Object.defineProperty(a,c,{configurable:!0,get:function(){return E.call(this)},set:function(L){y=""+L,P.call(this,L)}}),Object.defineProperty(a,c,{enumerable:h.enumerable}),{getValue:function(){return y},setValue:function(L){y=""+L},stopTracking:function(){a._valueTracker=null,delete a[c]}}}}function Be(a){a._valueTracker||(a._valueTracker=Oe(a))}function Ee(a){if(!a)return!1;var c=a._valueTracker;if(!c)return!0;var h=c.getValue(),y="";return a&&(y=ae(a)?a.checked?"true":"false":a.value),a=y,a!==h?(c.setValue(a),!0):!1}function pt(a){if(a=a||(typeof document<"u"?document:void 0),typeof a>"u")return null;try{return a.activeElement||a.body}catch{return a.body}}function Ot(a,c){var h=c.checked;return Z({},c,{defaultChecked:void 0,defaultValue:void 0,value:void 0,checked:h??a._wrapperState.initialChecked})}function Qt(a,c){var h=c.defaultValue==null?"":c.defaultValue,y=c.checked!=null?c.checked:c.defaultChecked;h=ue(c.value!=null?c.value:h),a._wrapperState={initialChecked:y,initialValue:h,controlled:c.type==="checkbox"||c.type==="radio"?c.checked!=null:c.value!=null}}function bt(a,c){c=c.checked,c!=null&&C(a,"checked",c,!1)}function _t(a,c){bt(a,c);var h=ue(c.value),y=c.type;if(h!=null)y==="number"?(h===0&&a.value===""||a.value!=h)&&(a.value=""+h):a.value!==""+h&&(a.value=""+h);else if(y==="submit"||y==="reset"){a.removeAttribute("value");return}c.hasOwnProperty("value")?Ke(a,c.type,h):c.hasOwnProperty("defaultValue")&&Ke(a,c.type,ue(c.defaultValue)),c.checked==null&&c.defaultChecked!=null&&(a.defaultChecked=!!c.defaultChecked)}function qe(a,c,h){if(c.hasOwnProperty("value")||c.hasOwnProperty("defaultValue")){var y=c.type;if(!(y!=="submit"&&y!=="reset"||c.value!==void 0&&c.value!==null))return;c=""+a._wrapperState.initialValue,h||c===a.value||(a.value=c),a.defaultValue=c}h=a.name,h!==""&&(a.name=""),a.defaultChecked=!!a._wrapperState.initialChecked,h!==""&&(a.name=h)}function Ke(a,c,h){(c!=="number"||pt(a.ownerDocument)!==a)&&(h==null?a.defaultValue=""+a._wrapperState.initialValue:a.defaultValue!==""+h&&(a.defaultValue=""+h))}var Ct=Array.isArray;function Ae(a,c,h,y){if(a=a.options,c){c={};for(var E=0;E<h.length;E++)c["$"+h[E]]=!0;for(h=0;h<a.length;h++)E=c.hasOwnProperty("$"+a[h].value),a[h].selected!==E&&(a[h].selected=E),E&&y&&(a[h].defaultSelected=!0)}else{for(h=""+ue(h),c=null,E=0;E<a.length;E++){if(a[E].value===h){a[E].selected=!0,y&&(a[E].defaultSelected=!0);return}c!==null||a[E].disabled||(c=a[E])}c!==null&&(c.selected=!0)}}function Ye(a,c){if(c.dangerouslySetInnerHTML!=null)throw Error(n(91));return Z({},c,{value:void 0,defaultValue:void 0,children:""+a._wrapperState.initialValue})}function Lt(a,c){var h=c.value;if(h==null){if(h=c.children,c=c.defaultValue,h!=null){if(c!=null)throw Error(n(92));if(Ct(h)){if(1<h.length)throw Error(n(93));h=h[0]}c=h}c==null&&(c=""),h=c}a._wrapperState={initialValue:ue(h)}}function Ge(a,c){var h=ue(c.value),y=ue(c.defaultValue);h!=null&&(h=""+h,h!==a.value&&(a.value=h),c.defaultValue==null&&a.defaultValue!==h&&(a.defaultValue=h)),y!=null&&(a.defaultValue=""+y)}function Pt(a){var c=a.textContent;c===a._wrapperState.initialValue&&c!==""&&c!==null&&(a.value=c)}function is(a){switch(a){case"svg":return"http://www.w3.org/2000/svg";case"math":return"http://www.w3.org/1998/Math/MathML";default:return"http://www.w3.org/1999/xhtml"}}function vr(a,c){return a==null||a==="http://www.w3.org/1999/xhtml"?is(c):a==="http://www.w3.org/2000/svg"&&c==="foreignObject"?"http://www.w3.org/1999/xhtml":a}var Le,Ko=(function(a){return typeof MSApp<"u"&&MSApp.execUnsafeLocalFunction?function(c,h,y,E){MSApp.execUnsafeLocalFunction(function(){return a(c,h,y,E)})}:a})(function(a,c){if(a.namespaceURI!=="http://www.w3.org/2000/svg"||"innerHTML"in a)a.innerHTML=c;else{for(Le=Le||document.createElement("div"),Le.innerHTML="<svg>"+c.valueOf().toString()+"</svg>",c=Le.firstChild;a.firstChild;)a.removeChild(a.firstChild);for(;c.firstChild;)a.appendChild(c.firstChild)}});function Ln(a,c){if(c){var h=a.firstChild;if(h&&h===a.lastChild&&h.nodeType===3){h.nodeValue=c;return}}a.textContent=c}var Qn={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},al=["Webkit","ms","Moz","O"];Object.keys(Qn).forEach(function(a){al.forEach(function(c){c=c+a.charAt(0).toUpperCase()+a.substring(1),Qn[c]=Qn[a]})});function gn(a,c,h){return c==null||typeof c=="boolean"||c===""?"":h||typeof c!="number"||c===0||Qn.hasOwnProperty(a)&&Qn[a]?(""+c).trim():c+"px"}function vn(a,c){a=a.style;for(var h in c)if(c.hasOwnProperty(h)){var y=h.indexOf("--")===0,E=gn(h,c[h],y);h==="float"&&(h="cssFloat"),y?a.setProperty(h,E):a[h]=E}}var Sd=Z({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 Ms(a,c){if(c){if(Sd[a]&&(c.children!=null||c.dangerouslySetInnerHTML!=null))throw Error(n(137,a));if(c.dangerouslySetInnerHTML!=null){if(c.children!=null)throw Error(n(60));if(typeof c.dangerouslySetInnerHTML!="object"||!("__html"in c.dangerouslySetInnerHTML))throw Error(n(61))}if(c.style!=null&&typeof c.style!="object")throw Error(n(62))}}function yr(a,c){if(a.indexOf("-")===-1)return typeof c.is=="string";switch(a){case"annotation-xml":case"color-profile":case"font-face":case"font-face-src":case"font-face-uri":case"font-face-format":case"font-face-name":case"missing-glyph":return!1;default:return!0}}var Jn=null;function ro(a){return a=a.target||a.srcElement||window,a.correspondingUseElement&&(a=a.correspondingUseElement),a.nodeType===3?a.parentNode:a}var Qs=null,Nn=null,Is=null;function ll(a){if(a=Wd(a)){if(typeof Qs!="function")throw Error(n(280));var c=a.stateNode;c&&(c=Cp(c),Qs(a.stateNode,a.type,c))}}function so(a){Nn?Is?Is.push(a):Is=[a]:Nn=a}function os(){if(Nn){var a=Nn,c=Is;if(Is=Nn=null,ll(a),c)for(a=0;a<c.length;a++)ll(c[a])}}function Xe(a,c){return a(c)}function Nt(){}var Vt=!1;function Bn(a,c,h){if(Vt)return a(c,h);Vt=!0;try{return Xe(a,c,h)}finally{Vt=!1,(Nn!==null||Is!==null)&&(Nt(),os())}}function as(a,c){var h=a.stateNode;if(h===null)return null;var y=Cp(h);if(y===null)return null;h=y[c];e:switch(c){case"onClick":case"onClickCapture":case"onDoubleClick":case"onDoubleClickCapture":case"onMouseDown":case"onMouseDownCapture":case"onMouseMove":case"onMouseMoveCapture":case"onMouseUp":case"onMouseUpCapture":case"onMouseEnter":(y=!y.disabled)||(a=a.type,y=!(a==="button"||a==="input"||a==="select"||a==="textarea")),a=!y;break e;default:a=!1}if(a)return null;if(h&&typeof h!="function")throw Error(n(231,c,typeof h));return h}var Bt=!1;if(l)try{var Dn={};Object.defineProperty(Dn,"passive",{get:function(){Bt=!0}}),window.addEventListener("test",Dn,Dn),window.removeEventListener("test",Dn,Dn)}catch{Bt=!1}function Vr(a,c,h,y,E,P,L,z,q){var se=Array.prototype.slice.call(arguments,3);try{c.apply(h,se)}catch(ge){this.onError(ge)}}var Js=!1,lr=null,An=!1,cl=null,Sc={onError:function(a){Js=!0,lr=a}};function kc(a,c,h,y,E,P,L,z,q){Js=!1,lr=null,Vr.apply(Sc,arguments)}function Ec(a,c,h,y,E,P,L,z,q){if(kc.apply(this,arguments),Js){if(Js){var se=lr;Js=!1,lr=null}else throw Error(n(198));An||(An=!0,cl=se)}}function Os(a){var c=a,h=a;if(a.alternate)for(;c.return;)c=c.return;else{a=c;do c=a,(c.flags&4098)!==0&&(h=c.return),a=c.return;while(a)}return c.tag===3?h:null}function io(a){if(a.tag===13){var c=a.memoizedState;if(c===null&&(a=a.alternate,a!==null&&(c=a.memoizedState)),c!==null)return c.dehydrated}return null}function kd(a){if(Os(a)!==a)throw Error(n(188))}function Cc(a){var c=a.alternate;if(!c){if(c=Os(a),c===null)throw Error(n(188));return c!==a?null:a}for(var h=a,y=c;;){var E=h.return;if(E===null)break;var P=E.alternate;if(P===null){if(y=E.return,y!==null){h=y;continue}break}if(E.child===P.child){for(P=E.child;P;){if(P===h)return kd(E),a;if(P===y)return kd(E),c;P=P.sibling}throw Error(n(188))}if(h.return!==y.return)h=E,y=P;else{for(var L=!1,z=E.child;z;){if(z===h){L=!0,h=E,y=P;break}if(z===y){L=!0,y=E,h=P;break}z=z.sibling}if(!L){for(z=P.child;z;){if(z===h){L=!0,h=P,y=E;break}if(z===y){L=!0,y=P,h=E;break}z=z.sibling}if(!L)throw Error(n(189))}}if(h.alternate!==y)throw Error(n(190))}if(h.tag!==3)throw Error(n(188));return h.stateNode.current===h?a:c}function Ed(a){return a=Cc(a),a!==null?Pc(a):null}function Pc(a){if(a.tag===5||a.tag===6)return a;for(a=a.child;a!==null;){var c=Pc(a);if(c!==null)return c;a=a.sibling}return null}var Tc=e.unstable_scheduleCallback,Yo=e.unstable_cancelCallback,Cd=e.unstable_shouldYield,yv=e.unstable_requestPaint,Jt=e.unstable_now,_v=e.unstable_getCurrentPriorityLevel,Pd=e.unstable_ImmediatePriority,ap=e.unstable_UserBlockingPriority,Xo=e.unstable_NormalPriority,Td=e.unstable_LowPriority,Ad=e.unstable_IdlePriority,Ac=null,Ls=null;function lp(a){if(Ls&&typeof Ls.onCommitFiberRoot=="function")try{Ls.onCommitFiberRoot(Ac,a,void 0,(a.current.flags&128)===128)}catch{}}var ls=Math.clz32?Math.clz32:xv,wv=Math.log,Rd=Math.LN2;function xv(a){return a>>>=0,a===0?32:31-(wv(a)/Rd|0)|0}var Rc=64,Mc=4194304;function ul(a){switch(a&-a){case 1:return 1;case 2:return 2;case 4:return 4;case 8:return 8;case 16:return 16;case 32:return 32;case 64:case 128:case 256:case 512:case 1024:case 2048:case 4096:case 8192:case 16384:case 32768:case 65536:case 131072:case 262144:case 524288:case 1048576:case 2097152:return a&4194240;case 4194304:case 8388608:case 16777216:case 33554432:case 67108864:return a&130023424;case 134217728:return 134217728;case 268435456:return 268435456;case 536870912:return 536870912;case 1073741824:return 1073741824;default:return a}}function Ic(a,c){var h=a.pendingLanes;if(h===0)return 0;var y=0,E=a.suspendedLanes,P=a.pingedLanes,L=h&268435455;if(L!==0){var z=L&~E;z!==0?y=ul(z):(P&=L,P!==0&&(y=ul(P)))}else L=h&~E,L!==0?y=ul(L):P!==0&&(y=ul(P));if(y===0)return 0;if(c!==0&&c!==y&&(c&E)===0&&(E=y&-y,P=c&-c,E>=P||E===16&&(P&4194240)!==0))return c;if((y&4)!==0&&(y|=h&16),c=a.entangledLanes,c!==0)for(a=a.entanglements,c&=y;0<c;)h=31-ls(c),E=1<<h,y|=a[h],c&=~E;return y}function Md(a,c){switch(a){case 1:case 2:case 4:return c+250;case 8:case 16:case 32:case 64:case 128:case 256:case 512:case 1024:case 2048:case 4096:case 8192:case 16384:case 32768:case 65536:case 131072:case 262144:case 524288:case 1048576:case 2097152:return c+5e3;case 4194304:case 8388608:case 16777216:case 33554432:case 67108864:return-1;case 134217728:case 268435456:case 536870912:case 1073741824:return-1;default:return-1}}function bv(a,c){for(var h=a.suspendedLanes,y=a.pingedLanes,E=a.expirationTimes,P=a.pendingLanes;0<P;){var L=31-ls(P),z=1<<L,q=E[L];q===-1?((z&h)===0||(z&y)!==0)&&(E[L]=Md(z,c)):q<=c&&(a.expiredLanes|=z),P&=~z}}function Id(a){return a=a.pendingLanes&-1073741825,a!==0?a:a&1073741824?1073741824:0}function cp(){var a=Rc;return Rc<<=1,(Rc&4194240)===0&&(Rc=64),a}function dl(a){for(var c=[],h=0;31>h;h++)c.push(a);return c}function oo(a,c,h){a.pendingLanes|=c,c!==536870912&&(a.suspendedLanes=0,a.pingedLanes=0),a=a.eventTimes,c=31-ls(c),a[c]=h}function up(a,c){var h=a.pendingLanes&~c;a.pendingLanes=c,a.suspendedLanes=0,a.pingedLanes=0,a.expiredLanes&=c,a.mutableReadLanes&=c,a.entangledLanes&=c,c=a.entanglements;var y=a.eventTimes;for(a=a.expirationTimes;0<h;){var E=31-ls(h),P=1<<E;c[E]=0,y[E]=-1,a[E]=-1,h&=~P}}function Od(a,c){var h=a.entangledLanes|=c;for(a=a.entanglements;h;){var y=31-ls(h),E=1<<y;E&c|a[y]&c&&(a[y]|=c),h&=~E}}var Ft=0;function ao(a){return a&=-a,1<a?4<a?(a&268435455)!==0?16:536870912:4:1}var Ld,fl,dp,fp,hp,Oc=!1,Lc=[],ei=null,cs=null,Ns=null,Qo=new Map,Jo=new Map,ti=[],pp="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 F(a,c){switch(a){case"focusin":case"focusout":ei=null;break;case"dragenter":case"dragleave":cs=null;break;case"mouseover":case"mouseout":Ns=null;break;case"pointerover":case"pointerout":Qo.delete(c.pointerId);break;case"gotpointercapture":case"lostpointercapture":Jo.delete(c.pointerId)}}function le(a,c,h,y,E,P){return a===null||a.nativeEvent!==P?(a={blockedOn:c,domEventName:h,eventSystemFlags:y,nativeEvent:P,targetContainers:[E]},c!==null&&(c=Wd(c),c!==null&&fl(c)),a):(a.eventSystemFlags|=y,c=a.targetContainers,E!==null&&c.indexOf(E)===-1&&c.push(E),a)}function ke(a,c,h,y,E){switch(c){case"focusin":return ei=le(ei,a,c,h,y,E),!0;case"dragenter":return cs=le(cs,a,c,h,y,E),!0;case"mouseover":return Ns=le(Ns,a,c,h,y,E),!0;case"pointerover":var P=E.pointerId;return Qo.set(P,le(Qo.get(P)||null,a,c,h,y,E)),!0;case"gotpointercapture":return P=E.pointerId,Jo.set(P,le(Jo.get(P)||null,a,c,h,y,E)),!0}return!1}function he(a){var c=hl(a.target);if(c!==null){var h=Os(c);if(h!==null){if(c=h.tag,c===13){if(c=io(h),c!==null){a.blockedOn=c,hp(a.priority,function(){dp(h)});return}}else if(c===3&&h.stateNode.current.memoizedState.isDehydrated){a.blockedOn=h.tag===3?h.stateNode.containerInfo:null;return}}}a.blockedOn=null}function pe(a){if(a.blockedOn!==null)return!1;for(var c=a.targetContainers;0<c.length;){var h=ni(a.domEventName,a.eventSystemFlags,c[0],a.nativeEvent);if(h===null){h=a.nativeEvent;var y=new h.constructor(h.type,h);Jn=y,h.target.dispatchEvent(y),Jn=null}else return c=Wd(h),c!==null&&fl(c),a.blockedOn=h,!1;c.shift()}return!0}function Se(a,c,h){pe(a)&&h.delete(c)}function et(){Oc=!1,ei!==null&&pe(ei)&&(ei=null),cs!==null&&pe(cs)&&(cs=null),Ns!==null&&pe(Ns)&&(Ns=null),Qo.forEach(Se),Jo.forEach(Se)}function Pe(a,c){a.blockedOn===c&&(a.blockedOn=null,Oc||(Oc=!0,e.unstable_scheduleCallback(e.unstable_NormalPriority,et)))}function rn(a){function c(E){return Pe(E,a)}if(0<Lc.length){Pe(Lc[0],a);for(var h=1;h<Lc.length;h++){var y=Lc[h];y.blockedOn===a&&(y.blockedOn=null)}}for(ei!==null&&Pe(ei,a),cs!==null&&Pe(cs,a),Ns!==null&&Pe(Ns,a),Qo.forEach(c),Jo.forEach(c),h=0;h<ti.length;h++)y=ti[h],y.blockedOn===a&&(y.blockedOn=null);for(;0<ti.length&&(h=ti[0],h.blockedOn===null);)he(h),h.blockedOn===null&&ti.shift()}var yn=T.ReactCurrentBatchConfig,Pr=!0;function us(a,c,h,y){var E=Ft,P=yn.transition;yn.transition=null;try{Ft=1,ct(a,c,h,y)}finally{Ft=E,yn.transition=P}}function ds(a,c,h,y){var E=Ft,P=yn.transition;yn.transition=null;try{Ft=4,ct(a,c,h,y)}finally{Ft=E,yn.transition=P}}function ct(a,c,h,y){if(Pr){var E=ni(a,c,h,y);if(E===null)Fv(a,c,y,Ht,h),F(a,y);else if(ke(E,a,c,h,y))y.stopPropagation();else if(F(a,y),c&4&&-1<pp.indexOf(a)){for(;E!==null;){var P=Wd(E);if(P!==null&&Ld(P),P=ni(a,c,h,y),P===null&&Fv(a,c,y,Ht,h),P===E)break;E=P}E!==null&&y.stopPropagation()}else Fv(a,c,y,null,h)}}var Ht=null;function ni(a,c,h,y){if(Ht=null,a=ro(y),a=hl(a),a!==null)if(c=Os(a),c===null)a=null;else if(h=c.tag,h===13){if(a=io(c),a!==null)return a;a=null}else if(h===3){if(c.stateNode.current.memoizedState.isDehydrated)return c.tag===3?c.stateNode.containerInfo:null;a=null}else c!==a&&(a=null);return Ht=a,null}function R4(a){switch(a){case"cancel":case"click":case"close":case"contextmenu":case"copy":case"cut":case"auxclick":case"dblclick":case"dragend":case"dragstart":case"drop":case"focusin":case"focusout":case"input":case"invalid":case"keydown":case"keypress":case"keyup":case"mousedown":case"mouseup":case"paste":case"pause":case"play":case"pointercancel":case"pointerdown":case"pointerup":case"ratechange":case"reset":case"resize":case"seeked":case"submit":case"touchcancel":case"touchend":case"touchstart":case"volumechange":case"change":case"selectionchange":case"textInput":case"compositionstart":case"compositionend":case"compositionupdate":case"beforeblur":case"afterblur":case"beforeinput":case"blur":case"fullscreenchange":case"focus":case"hashchange":case"popstate":case"select":case"selectstart":return 1;case"drag":case"dragenter":case"dragexit":case"dragleave":case"dragover":case"mousemove":case"mouseout":case"mouseover":case"pointermove":case"pointerout":case"pointerover":case"scroll":case"toggle":case"touchmove":case"wheel":case"mouseenter":case"mouseleave":case"pointerenter":case"pointerleave":return 4;case"message":switch(_v()){case Pd:return 1;case ap:return 4;case Xo:case Td:return 16;case Ad:return 536870912;default:return 16}default:return 16}}var ea=null,Sv=null,mp=null;function M4(){if(mp)return mp;var a,c=Sv,h=c.length,y,E="value"in ea?ea.value:ea.textContent,P=E.length;for(a=0;a<h&&c[a]===E[a];a++);var L=h-a;for(y=1;y<=L&&c[h-y]===E[P-y];y++);return mp=E.slice(a,1<y?1-y:void 0)}function gp(a){var c=a.keyCode;return"charCode"in a?(a=a.charCode,a===0&&c===13&&(a=13)):a=c,a===10&&(a=13),32<=a||a===13?a:0}function vp(){return!0}function I4(){return!1}function fs(a){function c(h,y,E,P,L){this._reactName=h,this._targetInst=E,this.type=y,this.nativeEvent=P,this.target=L,this.currentTarget=null;for(var z in a)a.hasOwnProperty(z)&&(h=a[z],this[z]=h?h(P):P[z]);return this.isDefaultPrevented=(P.defaultPrevented!=null?P.defaultPrevented:P.returnValue===!1)?vp:I4,this.isPropagationStopped=I4,this}return Z(c.prototype,{preventDefault:function(){this.defaultPrevented=!0;var h=this.nativeEvent;h&&(h.preventDefault?h.preventDefault():typeof h.returnValue!="unknown"&&(h.returnValue=!1),this.isDefaultPrevented=vp)},stopPropagation:function(){var h=this.nativeEvent;h&&(h.stopPropagation?h.stopPropagation():typeof h.cancelBubble!="unknown"&&(h.cancelBubble=!0),this.isPropagationStopped=vp)},persist:function(){},isPersistent:vp}),c}var Nc={eventPhase:0,bubbles:0,cancelable:0,timeStamp:function(a){return a.timeStamp||Date.now()},defaultPrevented:0,isTrusted:0},kv=fs(Nc),Nd=Z({},Nc,{view:0,detail:0}),ON=fs(Nd),Ev,Cv,Dd,yp=Z({},Nd,{screenX:0,screenY:0,clientX:0,clientY:0,pageX:0,pageY:0,ctrlKey:0,shiftKey:0,altKey:0,metaKey:0,getModifierState:Tv,button:0,buttons:0,relatedTarget:function(a){return a.relatedTarget===void 0?a.fromElement===a.srcElement?a.toElement:a.fromElement:a.relatedTarget},movementX:function(a){return"movementX"in a?a.movementX:(a!==Dd&&(Dd&&a.type==="mousemove"?(Ev=a.screenX-Dd.screenX,Cv=a.screenY-Dd.screenY):Cv=Ev=0,Dd=a),Ev)},movementY:function(a){return"movementY"in a?a.movementY:Cv}}),O4=fs(yp),LN=Z({},yp,{dataTransfer:0}),NN=fs(LN),DN=Z({},Nd,{relatedTarget:0}),Pv=fs(DN),jN=Z({},Nc,{animationName:0,elapsedTime:0,pseudoElement:0}),$N=fs(jN),FN=Z({},Nc,{clipboardData:function(a){return"clipboardData"in a?a.clipboardData:window.clipboardData}}),VN=fs(FN),HN=Z({},Nc,{data:0}),L4=fs(HN),zN={Esc:"Escape",Spacebar:" ",Left:"ArrowLeft",Up:"ArrowUp",Right:"ArrowRight",Down:"ArrowDown",Del:"Delete",Win:"OS",Menu:"ContextMenu",Apps:"ContextMenu",Scroll:"ScrollLock",MozPrintableKey:"Unidentified"},UN={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"},BN={Alt:"altKey",Control:"ctrlKey",Meta:"metaKey",Shift:"shiftKey"};function ZN(a){var c=this.nativeEvent;return c.getModifierState?c.getModifierState(a):(a=BN[a])?!!c[a]:!1}function Tv(){return ZN}var WN=Z({},Nd,{key:function(a){if(a.key){var c=zN[a.key]||a.key;if(c!=="Unidentified")return c}return a.type==="keypress"?(a=gp(a),a===13?"Enter":String.fromCharCode(a)):a.type==="keydown"||a.type==="keyup"?UN[a.keyCode]||"Unidentified":""},code:0,location:0,ctrlKey:0,shiftKey:0,altKey:0,metaKey:0,repeat:0,locale:0,getModifierState:Tv,charCode:function(a){return a.type==="keypress"?gp(a):0},keyCode:function(a){return a.type==="keydown"||a.type==="keyup"?a.keyCode:0},which:function(a){return a.type==="keypress"?gp(a):a.type==="keydown"||a.type==="keyup"?a.keyCode:0}}),qN=fs(WN),GN=Z({},yp,{pointerId:0,width:0,height:0,pressure:0,tangentialPressure:0,tiltX:0,tiltY:0,twist:0,pointerType:0,isPrimary:0}),N4=fs(GN),KN=Z({},Nd,{touches:0,targetTouches:0,changedTouches:0,altKey:0,metaKey:0,ctrlKey:0,shiftKey:0,getModifierState:Tv}),YN=fs(KN),XN=Z({},Nc,{propertyName:0,elapsedTime:0,pseudoElement:0}),QN=fs(XN),JN=Z({},yp,{deltaX:function(a){return"deltaX"in a?a.deltaX:"wheelDeltaX"in a?-a.wheelDeltaX:0},deltaY:function(a){return"deltaY"in a?a.deltaY:"wheelDeltaY"in a?-a.wheelDeltaY:"wheelDelta"in a?-a.wheelDelta:0},deltaZ:0,deltaMode:0}),eD=fs(JN),tD=[9,13,27,32],Av=l&&"CompositionEvent"in window,jd=null;l&&"documentMode"in document&&(jd=document.documentMode);var nD=l&&"TextEvent"in window&&!jd,D4=l&&(!Av||jd&&8<jd&&11>=jd),j4=" ",$4=!1;function F4(a,c){switch(a){case"keyup":return tD.indexOf(c.keyCode)!==-1;case"keydown":return c.keyCode!==229;case"keypress":case"mousedown":case"focusout":return!0;default:return!1}}function V4(a){return a=a.detail,typeof a=="object"&&"data"in a?a.data:null}var Dc=!1;function rD(a,c){switch(a){case"compositionend":return V4(c);case"keypress":return c.which!==32?null:($4=!0,j4);case"textInput":return a=c.data,a===j4&&$4?null:a;default:return null}}function sD(a,c){if(Dc)return a==="compositionend"||!Av&&F4(a,c)?(a=M4(),mp=Sv=ea=null,Dc=!1,a):null;switch(a){case"paste":return null;case"keypress":if(!(c.ctrlKey||c.altKey||c.metaKey)||c.ctrlKey&&c.altKey){if(c.char&&1<c.char.length)return c.char;if(c.which)return String.fromCharCode(c.which)}return null;case"compositionend":return D4&&c.locale!=="ko"?null:c.data;default:return null}}var iD={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 H4(a){var c=a&&a.nodeName&&a.nodeName.toLowerCase();return c==="input"?!!iD[a.type]:c==="textarea"}function z4(a,c,h,y){so(y),c=Sp(c,"onChange"),0<c.length&&(h=new kv("onChange","change",null,h,y),a.push({event:h,listeners:c}))}var $d=null,Fd=null;function oD(a){o6(a,0)}function _p(a){var c=Hc(a);if(Ee(c))return a}function aD(a,c){if(a==="change")return c}var U4=!1;if(l){var Rv;if(l){var Mv="oninput"in document;if(!Mv){var B4=document.createElement("div");B4.setAttribute("oninput","return;"),Mv=typeof B4.oninput=="function"}Rv=Mv}else Rv=!1;U4=Rv&&(!document.documentMode||9<document.documentMode)}function Z4(){$d&&($d.detachEvent("onpropertychange",W4),Fd=$d=null)}function W4(a){if(a.propertyName==="value"&&_p(Fd)){var c=[];z4(c,Fd,a,ro(a)),Bn(oD,c)}}function lD(a,c,h){a==="focusin"?(Z4(),$d=c,Fd=h,$d.attachEvent("onpropertychange",W4)):a==="focusout"&&Z4()}function cD(a){if(a==="selectionchange"||a==="keyup"||a==="keydown")return _p(Fd)}function uD(a,c){if(a==="click")return _p(c)}function dD(a,c){if(a==="input"||a==="change")return _p(c)}function fD(a,c){return a===c&&(a!==0||1/a===1/c)||a!==a&&c!==c}var ri=typeof Object.is=="function"?Object.is:fD;function Vd(a,c){if(ri(a,c))return!0;if(typeof a!="object"||a===null||typeof c!="object"||c===null)return!1;var h=Object.keys(a),y=Object.keys(c);if(h.length!==y.length)return!1;for(y=0;y<h.length;y++){var E=h[y];if(!u.call(c,E)||!ri(a[E],c[E]))return!1}return!0}function q4(a){for(;a&&a.firstChild;)a=a.firstChild;return a}function G4(a,c){var h=q4(a);a=0;for(var y;h;){if(h.nodeType===3){if(y=a+h.textContent.length,a<=c&&y>=c)return{node:h,offset:c-a};a=y}e:{for(;h;){if(h.nextSibling){h=h.nextSibling;break e}h=h.parentNode}h=void 0}h=q4(h)}}function K4(a,c){return a&&c?a===c?!0:a&&a.nodeType===3?!1:c&&c.nodeType===3?K4(a,c.parentNode):"contains"in a?a.contains(c):a.compareDocumentPosition?!!(a.compareDocumentPosition(c)&16):!1:!1}function Y4(){for(var a=window,c=pt();c instanceof a.HTMLIFrameElement;){try{var h=typeof c.contentWindow.location.href=="string"}catch{h=!1}if(h)a=c.contentWindow;else break;c=pt(a.document)}return c}function Iv(a){var c=a&&a.nodeName&&a.nodeName.toLowerCase();return c&&(c==="input"&&(a.type==="text"||a.type==="search"||a.type==="tel"||a.type==="url"||a.type==="password")||c==="textarea"||a.contentEditable==="true")}function hD(a){var c=Y4(),h=a.focusedElem,y=a.selectionRange;if(c!==h&&h&&h.ownerDocument&&K4(h.ownerDocument.documentElement,h)){if(y!==null&&Iv(h)){if(c=y.start,a=y.end,a===void 0&&(a=c),"selectionStart"in h)h.selectionStart=c,h.selectionEnd=Math.min(a,h.value.length);else if(a=(c=h.ownerDocument||document)&&c.defaultView||window,a.getSelection){a=a.getSelection();var E=h.textContent.length,P=Math.min(y.start,E);y=y.end===void 0?P:Math.min(y.end,E),!a.extend&&P>y&&(E=y,y=P,P=E),E=G4(h,P);var L=G4(h,y);E&&L&&(a.rangeCount!==1||a.anchorNode!==E.node||a.anchorOffset!==E.offset||a.focusNode!==L.node||a.focusOffset!==L.offset)&&(c=c.createRange(),c.setStart(E.node,E.offset),a.removeAllRanges(),P>y?(a.addRange(c),a.extend(L.node,L.offset)):(c.setEnd(L.node,L.offset),a.addRange(c)))}}for(c=[],a=h;a=a.parentNode;)a.nodeType===1&&c.push({element:a,left:a.scrollLeft,top:a.scrollTop});for(typeof h.focus=="function"&&h.focus(),h=0;h<c.length;h++)a=c[h],a.element.scrollLeft=a.left,a.element.scrollTop=a.top}}var pD=l&&"documentMode"in document&&11>=document.documentMode,jc=null,Ov=null,Hd=null,Lv=!1;function X4(a,c,h){var y=h.window===h?h.document:h.nodeType===9?h:h.ownerDocument;Lv||jc==null||jc!==pt(y)||(y=jc,"selectionStart"in y&&Iv(y)?y={start:y.selectionStart,end:y.selectionEnd}:(y=(y.ownerDocument&&y.ownerDocument.defaultView||window).getSelection(),y={anchorNode:y.anchorNode,anchorOffset:y.anchorOffset,focusNode:y.focusNode,focusOffset:y.focusOffset}),Hd&&Vd(Hd,y)||(Hd=y,y=Sp(Ov,"onSelect"),0<y.length&&(c=new kv("onSelect","select",null,c,h),a.push({event:c,listeners:y}),c.target=jc)))}function wp(a,c){var h={};return h[a.toLowerCase()]=c.toLowerCase(),h["Webkit"+a]="webkit"+c,h["Moz"+a]="moz"+c,h}var $c={animationend:wp("Animation","AnimationEnd"),animationiteration:wp("Animation","AnimationIteration"),animationstart:wp("Animation","AnimationStart"),transitionend:wp("Transition","TransitionEnd")},Nv={},Q4={};l&&(Q4=document.createElement("div").style,"AnimationEvent"in window||(delete $c.animationend.animation,delete $c.animationiteration.animation,delete $c.animationstart.animation),"TransitionEvent"in window||delete $c.transitionend.transition);function xp(a){if(Nv[a])return Nv[a];if(!$c[a])return a;var c=$c[a],h;for(h in c)if(c.hasOwnProperty(h)&&h in Q4)return Nv[a]=c[h];return a}var J4=xp("animationend"),e6=xp("animationiteration"),t6=xp("animationstart"),n6=xp("transitionend"),r6=new Map,s6="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 ta(a,c){r6.set(a,c),i(c,[a])}for(var Dv=0;Dv<s6.length;Dv++){var jv=s6[Dv],mD=jv.toLowerCase(),gD=jv[0].toUpperCase()+jv.slice(1);ta(mD,"on"+gD)}ta(J4,"onAnimationEnd"),ta(e6,"onAnimationIteration"),ta(t6,"onAnimationStart"),ta("dblclick","onDoubleClick"),ta("focusin","onFocus"),ta("focusout","onBlur"),ta(n6,"onTransitionEnd"),o("onMouseEnter",["mouseout","mouseover"]),o("onMouseLeave",["mouseout","mouseover"]),o("onPointerEnter",["pointerout","pointerover"]),o("onPointerLeave",["pointerout","pointerover"]),i("onChange","change click focusin focusout input keydown keyup selectionchange".split(" ")),i("onSelect","focusout contextmenu dragend focusin keydown keyup mousedown mouseup selectionchange".split(" ")),i("onBeforeInput",["compositionend","keypress","textInput","paste"]),i("onCompositionEnd","compositionend focusout keydown keypress keyup mousedown".split(" ")),i("onCompositionStart","compositionstart focusout keydown keypress keyup mousedown".split(" ")),i("onCompositionUpdate","compositionupdate focusout keydown keypress keyup mousedown".split(" "));var zd="abort canplay canplaythrough durationchange emptied encrypted ended error loadeddata loadedmetadata loadstart pause play playing progress ratechange resize seeked seeking stalled suspend timeupdate volumechange waiting".split(" "),vD=new Set("cancel close invalid load scroll toggle".split(" ").concat(zd));function i6(a,c,h){var y=a.type||"unknown-event";a.currentTarget=h,Ec(y,c,void 0,a),a.currentTarget=null}function o6(a,c){c=(c&4)!==0;for(var h=0;h<a.length;h++){var y=a[h],E=y.event;y=y.listeners;e:{var P=void 0;if(c)for(var L=y.length-1;0<=L;L--){var z=y[L],q=z.instance,se=z.currentTarget;if(z=z.listener,q!==P&&E.isPropagationStopped())break e;i6(E,z,se),P=q}else for(L=0;L<y.length;L++){if(z=y[L],q=z.instance,se=z.currentTarget,z=z.listener,q!==P&&E.isPropagationStopped())break e;i6(E,z,se),P=q}}}if(An)throw a=cl,An=!1,cl=null,a}function sn(a,c){var h=c[Zv];h===void 0&&(h=c[Zv]=new Set);var y=a+"__bubble";h.has(y)||(a6(c,a,2,!1),h.add(y))}function $v(a,c,h){var y=0;c&&(y|=4),a6(h,a,y,c)}var bp="_reactListening"+Math.random().toString(36).slice(2);function Ud(a){if(!a[bp]){a[bp]=!0,r.forEach(function(h){h!=="selectionchange"&&(vD.has(h)||$v(h,!1,a),$v(h,!0,a))});var c=a.nodeType===9?a:a.ownerDocument;c===null||c[bp]||(c[bp]=!0,$v("selectionchange",!1,c))}}function a6(a,c,h,y){switch(R4(c)){case 1:var E=us;break;case 4:E=ds;break;default:E=ct}h=E.bind(null,c,h,a),E=void 0,!Bt||c!=="touchstart"&&c!=="touchmove"&&c!=="wheel"||(E=!0),y?E!==void 0?a.addEventListener(c,h,{capture:!0,passive:E}):a.addEventListener(c,h,!0):E!==void 0?a.addEventListener(c,h,{passive:E}):a.addEventListener(c,h,!1)}function Fv(a,c,h,y,E){var P=y;if((c&1)===0&&(c&2)===0&&y!==null)e:for(;;){if(y===null)return;var L=y.tag;if(L===3||L===4){var z=y.stateNode.containerInfo;if(z===E||z.nodeType===8&&z.parentNode===E)break;if(L===4)for(L=y.return;L!==null;){var q=L.tag;if((q===3||q===4)&&(q=L.stateNode.containerInfo,q===E||q.nodeType===8&&q.parentNode===E))return;L=L.return}for(;z!==null;){if(L=hl(z),L===null)return;if(q=L.tag,q===5||q===6){y=P=L;continue e}z=z.parentNode}}y=y.return}Bn(function(){var se=P,ge=ro(h),ye=[];e:{var me=r6.get(a);if(me!==void 0){var Me=kv,Fe=a;switch(a){case"keypress":if(gp(h)===0)break e;case"keydown":case"keyup":Me=qN;break;case"focusin":Fe="focus",Me=Pv;break;case"focusout":Fe="blur",Me=Pv;break;case"beforeblur":case"afterblur":Me=Pv;break;case"click":if(h.button===2)break e;case"auxclick":case"dblclick":case"mousedown":case"mousemove":case"mouseup":case"mouseout":case"mouseover":case"contextmenu":Me=O4;break;case"drag":case"dragend":case"dragenter":case"dragexit":case"dragleave":case"dragover":case"dragstart":case"drop":Me=NN;break;case"touchcancel":case"touchend":case"touchmove":case"touchstart":Me=YN;break;case J4:case e6:case t6:Me=$N;break;case n6:Me=QN;break;case"scroll":Me=ON;break;case"wheel":Me=eD;break;case"copy":case"cut":case"paste":Me=VN;break;case"gotpointercapture":case"lostpointercapture":case"pointercancel":case"pointerdown":case"pointermove":case"pointerout":case"pointerover":case"pointerup":Me=N4}var He=(c&4)!==0,Rn=!He&&a==="scroll",te=He?me!==null?me+"Capture":null:me;He=[];for(var X=se,ne;X!==null;){ne=X;var be=ne.stateNode;if(ne.tag===5&&be!==null&&(ne=be,te!==null&&(be=as(X,te),be!=null&&He.push(Bd(X,be,ne)))),Rn)break;X=X.return}0<He.length&&(me=new Me(me,Fe,null,h,ge),ye.push({event:me,listeners:He}))}}if((c&7)===0){e:{if(me=a==="mouseover"||a==="pointerover",Me=a==="mouseout"||a==="pointerout",me&&h!==Jn&&(Fe=h.relatedTarget||h.fromElement)&&(hl(Fe)||Fe[lo]))break e;if((Me||me)&&(me=ge.window===ge?ge:(me=ge.ownerDocument)?me.defaultView||me.parentWindow:window,Me?(Fe=h.relatedTarget||h.toElement,Me=se,Fe=Fe?hl(Fe):null,Fe!==null&&(Rn=Os(Fe),Fe!==Rn||Fe.tag!==5&&Fe.tag!==6)&&(Fe=null)):(Me=null,Fe=se),Me!==Fe)){if(He=O4,be="onMouseLeave",te="onMouseEnter",X="mouse",(a==="pointerout"||a==="pointerover")&&(He=N4,be="onPointerLeave",te="onPointerEnter",X="pointer"),Rn=Me==null?me:Hc(Me),ne=Fe==null?me:Hc(Fe),me=new He(be,X+"leave",Me,h,ge),me.target=Rn,me.relatedTarget=ne,be=null,hl(ge)===se&&(He=new He(te,X+"enter",Fe,h,ge),He.target=ne,He.relatedTarget=Rn,be=He),Rn=be,Me&&Fe)t:{for(He=Me,te=Fe,X=0,ne=He;ne;ne=Fc(ne))X++;for(ne=0,be=te;be;be=Fc(be))ne++;for(;0<X-ne;)He=Fc(He),X--;for(;0<ne-X;)te=Fc(te),ne--;for(;X--;){if(He===te||te!==null&&He===te.alternate)break t;He=Fc(He),te=Fc(te)}He=null}else He=null;Me!==null&&l6(ye,me,Me,He,!1),Fe!==null&&Rn!==null&&l6(ye,Rn,Fe,He,!0)}}e:{if(me=se?Hc(se):window,Me=me.nodeName&&me.nodeName.toLowerCase(),Me==="select"||Me==="input"&&me.type==="file")var ze=aD;else if(H4(me))if(U4)ze=dD;else{ze=cD;var tt=lD}else(Me=me.nodeName)&&Me.toLowerCase()==="input"&&(me.type==="checkbox"||me.type==="radio")&&(ze=uD);if(ze&&(ze=ze(a,se))){z4(ye,ze,h,ge);break e}tt&&tt(a,me,se),a==="focusout"&&(tt=me._wrapperState)&&tt.controlled&&me.type==="number"&&Ke(me,"number",me.value)}switch(tt=se?Hc(se):window,a){case"focusin":(H4(tt)||tt.contentEditable==="true")&&(jc=tt,Ov=se,Hd=null);break;case"focusout":Hd=Ov=jc=null;break;case"mousedown":Lv=!0;break;case"contextmenu":case"mouseup":case"dragend":Lv=!1,X4(ye,h,ge);break;case"selectionchange":if(pD)break;case"keydown":case"keyup":X4(ye,h,ge)}var nt;if(Av)e:{switch(a){case"compositionstart":var it="onCompositionStart";break e;case"compositionend":it="onCompositionEnd";break e;case"compositionupdate":it="onCompositionUpdate";break e}it=void 0}else Dc?F4(a,h)&&(it="onCompositionEnd"):a==="keydown"&&h.keyCode===229&&(it="onCompositionStart");it&&(D4&&h.locale!=="ko"&&(Dc||it!=="onCompositionStart"?it==="onCompositionEnd"&&Dc&&(nt=M4()):(ea=ge,Sv="value"in ea?ea.value:ea.textContent,Dc=!0)),tt=Sp(se,it),0<tt.length&&(it=new L4(it,a,null,h,ge),ye.push({event:it,listeners:tt}),nt?it.data=nt:(nt=V4(h),nt!==null&&(it.data=nt)))),(nt=nD?rD(a,h):sD(a,h))&&(se=Sp(se,"onBeforeInput"),0<se.length&&(ge=new L4("onBeforeInput","beforeinput",null,h,ge),ye.push({event:ge,listeners:se}),ge.data=nt))}o6(ye,c)})}function Bd(a,c,h){return{instance:a,listener:c,currentTarget:h}}function Sp(a,c){for(var h=c+"Capture",y=[];a!==null;){var E=a,P=E.stateNode;E.tag===5&&P!==null&&(E=P,P=as(a,h),P!=null&&y.unshift(Bd(a,P,E)),P=as(a,c),P!=null&&y.push(Bd(a,P,E))),a=a.return}return y}function Fc(a){if(a===null)return null;do a=a.return;while(a&&a.tag!==5);return a||null}function l6(a,c,h,y,E){for(var P=c._reactName,L=[];h!==null&&h!==y;){var z=h,q=z.alternate,se=z.stateNode;if(q!==null&&q===y)break;z.tag===5&&se!==null&&(z=se,E?(q=as(h,P),q!=null&&L.unshift(Bd(h,q,z))):E||(q=as(h,P),q!=null&&L.push(Bd(h,q,z)))),h=h.return}L.length!==0&&a.push({event:c,listeners:L})}var yD=/\r\n?/g,_D=/\u0000|\uFFFD/g;function c6(a){return(typeof a=="string"?a:""+a).replace(yD,`
40
+ `).replace(_D,"")}function kp(a,c,h){if(c=c6(c),c6(a)!==c&&h)throw Error(n(425))}function Ep(){}var Vv=null,Hv=null;function zv(a,c){return a==="textarea"||a==="noscript"||typeof c.children=="string"||typeof c.children=="number"||typeof c.dangerouslySetInnerHTML=="object"&&c.dangerouslySetInnerHTML!==null&&c.dangerouslySetInnerHTML.__html!=null}var Uv=typeof setTimeout=="function"?setTimeout:void 0,wD=typeof clearTimeout=="function"?clearTimeout:void 0,u6=typeof Promise=="function"?Promise:void 0,xD=typeof queueMicrotask=="function"?queueMicrotask:typeof u6<"u"?function(a){return u6.resolve(null).then(a).catch(bD)}:Uv;function bD(a){setTimeout(function(){throw a})}function Bv(a,c){var h=c,y=0;do{var E=h.nextSibling;if(a.removeChild(h),E&&E.nodeType===8)if(h=E.data,h==="/$"){if(y===0){a.removeChild(E),rn(c);return}y--}else h!=="$"&&h!=="$?"&&h!=="$!"||y++;h=E}while(h);rn(c)}function na(a){for(;a!=null;a=a.nextSibling){var c=a.nodeType;if(c===1||c===3)break;if(c===8){if(c=a.data,c==="$"||c==="$!"||c==="$?")break;if(c==="/$")return null}}return a}function d6(a){a=a.previousSibling;for(var c=0;a;){if(a.nodeType===8){var h=a.data;if(h==="$"||h==="$!"||h==="$?"){if(c===0)return a;c--}else h==="/$"&&c++}a=a.previousSibling}return null}var Vc=Math.random().toString(36).slice(2),ki="__reactFiber$"+Vc,Zd="__reactProps$"+Vc,lo="__reactContainer$"+Vc,Zv="__reactEvents$"+Vc,SD="__reactListeners$"+Vc,kD="__reactHandles$"+Vc;function hl(a){var c=a[ki];if(c)return c;for(var h=a.parentNode;h;){if(c=h[lo]||h[ki]){if(h=c.alternate,c.child!==null||h!==null&&h.child!==null)for(a=d6(a);a!==null;){if(h=a[ki])return h;a=d6(a)}return c}a=h,h=a.parentNode}return null}function Wd(a){return a=a[ki]||a[lo],!a||a.tag!==5&&a.tag!==6&&a.tag!==13&&a.tag!==3?null:a}function Hc(a){if(a.tag===5||a.tag===6)return a.stateNode;throw Error(n(33))}function Cp(a){return a[Zd]||null}var Wv=[],zc=-1;function ra(a){return{current:a}}function on(a){0>zc||(a.current=Wv[zc],Wv[zc]=null,zc--)}function en(a,c){zc++,Wv[zc]=a.current,a.current=c}var sa={},_r=ra(sa),Hr=ra(!1),pl=sa;function Uc(a,c){var h=a.type.contextTypes;if(!h)return sa;var y=a.stateNode;if(y&&y.__reactInternalMemoizedUnmaskedChildContext===c)return y.__reactInternalMemoizedMaskedChildContext;var E={},P;for(P in h)E[P]=c[P];return y&&(a=a.stateNode,a.__reactInternalMemoizedUnmaskedChildContext=c,a.__reactInternalMemoizedMaskedChildContext=E),E}function zr(a){return a=a.childContextTypes,a!=null}function Pp(){on(Hr),on(_r)}function f6(a,c,h){if(_r.current!==sa)throw Error(n(168));en(_r,c),en(Hr,h)}function h6(a,c,h){var y=a.stateNode;if(c=c.childContextTypes,typeof y.getChildContext!="function")return h;y=y.getChildContext();for(var E in y)if(!(E in c))throw Error(n(108,_e(a)||"Unknown",E));return Z({},h,y)}function Tp(a){return a=(a=a.stateNode)&&a.__reactInternalMemoizedMergedChildContext||sa,pl=_r.current,en(_r,a),en(Hr,Hr.current),!0}function p6(a,c,h){var y=a.stateNode;if(!y)throw Error(n(169));h?(a=h6(a,c,pl),y.__reactInternalMemoizedMergedChildContext=a,on(Hr),on(_r),en(_r,a)):on(Hr),en(Hr,h)}var co=null,Ap=!1,qv=!1;function m6(a){co===null?co=[a]:co.push(a)}function ED(a){Ap=!0,m6(a)}function ia(){if(!qv&&co!==null){qv=!0;var a=0,c=Ft;try{var h=co;for(Ft=1;a<h.length;a++){var y=h[a];do y=y(!0);while(y!==null)}co=null,Ap=!1}catch(E){throw co!==null&&(co=co.slice(a+1)),Tc(Pd,ia),E}finally{Ft=c,qv=!1}}return null}var Bc=[],Zc=0,Rp=null,Mp=0,Ds=[],js=0,ml=null,uo=1,fo="";function gl(a,c){Bc[Zc++]=Mp,Bc[Zc++]=Rp,Rp=a,Mp=c}function g6(a,c,h){Ds[js++]=uo,Ds[js++]=fo,Ds[js++]=ml,ml=a;var y=uo;a=fo;var E=32-ls(y)-1;y&=~(1<<E),h+=1;var P=32-ls(c)+E;if(30<P){var L=E-E%5;P=(y&(1<<L)-1).toString(32),y>>=L,E-=L,uo=1<<32-ls(c)+E|h<<E|y,fo=P+a}else uo=1<<P|h<<E|y,fo=a}function Gv(a){a.return!==null&&(gl(a,1),g6(a,1,0))}function Kv(a){for(;a===Rp;)Rp=Bc[--Zc],Bc[Zc]=null,Mp=Bc[--Zc],Bc[Zc]=null;for(;a===ml;)ml=Ds[--js],Ds[js]=null,fo=Ds[--js],Ds[js]=null,uo=Ds[--js],Ds[js]=null}var hs=null,ps=null,fn=!1,si=null;function v6(a,c){var h=Hs(5,null,null,0);h.elementType="DELETED",h.stateNode=c,h.return=a,c=a.deletions,c===null?(a.deletions=[h],a.flags|=16):c.push(h)}function y6(a,c){switch(a.tag){case 5:var h=a.type;return c=c.nodeType!==1||h.toLowerCase()!==c.nodeName.toLowerCase()?null:c,c!==null?(a.stateNode=c,hs=a,ps=na(c.firstChild),!0):!1;case 6:return c=a.pendingProps===""||c.nodeType!==3?null:c,c!==null?(a.stateNode=c,hs=a,ps=null,!0):!1;case 13:return c=c.nodeType!==8?null:c,c!==null?(h=ml!==null?{id:uo,overflow:fo}:null,a.memoizedState={dehydrated:c,treeContext:h,retryLane:1073741824},h=Hs(18,null,null,0),h.stateNode=c,h.return=a,a.child=h,hs=a,ps=null,!0):!1;default:return!1}}function Yv(a){return(a.mode&1)!==0&&(a.flags&128)===0}function Xv(a){if(fn){var c=ps;if(c){var h=c;if(!y6(a,c)){if(Yv(a))throw Error(n(418));c=na(h.nextSibling);var y=hs;c&&y6(a,c)?v6(y,h):(a.flags=a.flags&-4097|2,fn=!1,hs=a)}}else{if(Yv(a))throw Error(n(418));a.flags=a.flags&-4097|2,fn=!1,hs=a}}}function _6(a){for(a=a.return;a!==null&&a.tag!==5&&a.tag!==3&&a.tag!==13;)a=a.return;hs=a}function Ip(a){if(a!==hs)return!1;if(!fn)return _6(a),fn=!0,!1;var c;if((c=a.tag!==3)&&!(c=a.tag!==5)&&(c=a.type,c=c!=="head"&&c!=="body"&&!zv(a.type,a.memoizedProps)),c&&(c=ps)){if(Yv(a))throw w6(),Error(n(418));for(;c;)v6(a,c),c=na(c.nextSibling)}if(_6(a),a.tag===13){if(a=a.memoizedState,a=a!==null?a.dehydrated:null,!a)throw Error(n(317));e:{for(a=a.nextSibling,c=0;a;){if(a.nodeType===8){var h=a.data;if(h==="/$"){if(c===0){ps=na(a.nextSibling);break e}c--}else h!=="$"&&h!=="$!"&&h!=="$?"||c++}a=a.nextSibling}ps=null}}else ps=hs?na(a.stateNode.nextSibling):null;return!0}function w6(){for(var a=ps;a;)a=na(a.nextSibling)}function Wc(){ps=hs=null,fn=!1}function Qv(a){si===null?si=[a]:si.push(a)}var CD=T.ReactCurrentBatchConfig;function qd(a,c,h){if(a=h.ref,a!==null&&typeof a!="function"&&typeof a!="object"){if(h._owner){if(h=h._owner,h){if(h.tag!==1)throw Error(n(309));var y=h.stateNode}if(!y)throw Error(n(147,a));var E=y,P=""+a;return c!==null&&c.ref!==null&&typeof c.ref=="function"&&c.ref._stringRef===P?c.ref:(c=function(L){var z=E.refs;L===null?delete z[P]:z[P]=L},c._stringRef=P,c)}if(typeof a!="string")throw Error(n(284));if(!h._owner)throw Error(n(290,a))}return a}function Op(a,c){throw a=Object.prototype.toString.call(c),Error(n(31,a==="[object Object]"?"object with keys {"+Object.keys(c).join(", ")+"}":a))}function x6(a){var c=a._init;return c(a._payload)}function b6(a){function c(te,X){if(a){var ne=te.deletions;ne===null?(te.deletions=[X],te.flags|=16):ne.push(X)}}function h(te,X){if(!a)return null;for(;X!==null;)c(te,X),X=X.sibling;return null}function y(te,X){for(te=new Map;X!==null;)X.key!==null?te.set(X.key,X):te.set(X.index,X),X=X.sibling;return te}function E(te,X){return te=ha(te,X),te.index=0,te.sibling=null,te}function P(te,X,ne){return te.index=ne,a?(ne=te.alternate,ne!==null?(ne=ne.index,ne<X?(te.flags|=2,X):ne):(te.flags|=2,X)):(te.flags|=1048576,X)}function L(te){return a&&te.alternate===null&&(te.flags|=2),te}function z(te,X,ne,be){return X===null||X.tag!==6?(X=U1(ne,te.mode,be),X.return=te,X):(X=E(X,ne),X.return=te,X)}function q(te,X,ne,be){var ze=ne.type;return ze===M?ge(te,X,ne.props.children,be,ne.key):X!==null&&(X.elementType===ze||typeof ze=="object"&&ze!==null&&ze.$$typeof===V&&x6(ze)===X.type)?(be=E(X,ne.props),be.ref=qd(te,X,ne),be.return=te,be):(be=r0(ne.type,ne.key,ne.props,null,te.mode,be),be.ref=qd(te,X,ne),be.return=te,be)}function se(te,X,ne,be){return X===null||X.tag!==4||X.stateNode.containerInfo!==ne.containerInfo||X.stateNode.implementation!==ne.implementation?(X=B1(ne,te.mode,be),X.return=te,X):(X=E(X,ne.children||[]),X.return=te,X)}function ge(te,X,ne,be,ze){return X===null||X.tag!==7?(X=kl(ne,te.mode,be,ze),X.return=te,X):(X=E(X,ne),X.return=te,X)}function ye(te,X,ne){if(typeof X=="string"&&X!==""||typeof X=="number")return X=U1(""+X,te.mode,ne),X.return=te,X;if(typeof X=="object"&&X!==null){switch(X.$$typeof){case A:return ne=r0(X.type,X.key,X.props,null,te.mode,ne),ne.ref=qd(te,null,X),ne.return=te,ne;case I:return X=B1(X,te.mode,ne),X.return=te,X;case V:var be=X._init;return ye(te,be(X._payload),ne)}if(Ct(X)||ee(X))return X=kl(X,te.mode,ne,null),X.return=te,X;Op(te,X)}return null}function me(te,X,ne,be){var ze=X!==null?X.key:null;if(typeof ne=="string"&&ne!==""||typeof ne=="number")return ze!==null?null:z(te,X,""+ne,be);if(typeof ne=="object"&&ne!==null){switch(ne.$$typeof){case A:return ne.key===ze?q(te,X,ne,be):null;case I:return ne.key===ze?se(te,X,ne,be):null;case V:return ze=ne._init,me(te,X,ze(ne._payload),be)}if(Ct(ne)||ee(ne))return ze!==null?null:ge(te,X,ne,be,null);Op(te,ne)}return null}function Me(te,X,ne,be,ze){if(typeof be=="string"&&be!==""||typeof be=="number")return te=te.get(ne)||null,z(X,te,""+be,ze);if(typeof be=="object"&&be!==null){switch(be.$$typeof){case A:return te=te.get(be.key===null?ne:be.key)||null,q(X,te,be,ze);case I:return te=te.get(be.key===null?ne:be.key)||null,se(X,te,be,ze);case V:var tt=be._init;return Me(te,X,ne,tt(be._payload),ze)}if(Ct(be)||ee(be))return te=te.get(ne)||null,ge(X,te,be,ze,null);Op(X,be)}return null}function Fe(te,X,ne,be){for(var ze=null,tt=null,nt=X,it=X=0,nr=null;nt!==null&&it<ne.length;it++){nt.index>it?(nr=nt,nt=null):nr=nt.sibling;var Dt=me(te,nt,ne[it],be);if(Dt===null){nt===null&&(nt=nr);break}a&&nt&&Dt.alternate===null&&c(te,nt),X=P(Dt,X,it),tt===null?ze=Dt:tt.sibling=Dt,tt=Dt,nt=nr}if(it===ne.length)return h(te,nt),fn&&gl(te,it),ze;if(nt===null){for(;it<ne.length;it++)nt=ye(te,ne[it],be),nt!==null&&(X=P(nt,X,it),tt===null?ze=nt:tt.sibling=nt,tt=nt);return fn&&gl(te,it),ze}for(nt=y(te,nt);it<ne.length;it++)nr=Me(nt,te,it,ne[it],be),nr!==null&&(a&&nr.alternate!==null&&nt.delete(nr.key===null?it:nr.key),X=P(nr,X,it),tt===null?ze=nr:tt.sibling=nr,tt=nr);return a&&nt.forEach(function(pa){return c(te,pa)}),fn&&gl(te,it),ze}function He(te,X,ne,be){var ze=ee(ne);if(typeof ze!="function")throw Error(n(150));if(ne=ze.call(ne),ne==null)throw Error(n(151));for(var tt=ze=null,nt=X,it=X=0,nr=null,Dt=ne.next();nt!==null&&!Dt.done;it++,Dt=ne.next()){nt.index>it?(nr=nt,nt=null):nr=nt.sibling;var pa=me(te,nt,Dt.value,be);if(pa===null){nt===null&&(nt=nr);break}a&&nt&&pa.alternate===null&&c(te,nt),X=P(pa,X,it),tt===null?ze=pa:tt.sibling=pa,tt=pa,nt=nr}if(Dt.done)return h(te,nt),fn&&gl(te,it),ze;if(nt===null){for(;!Dt.done;it++,Dt=ne.next())Dt=ye(te,Dt.value,be),Dt!==null&&(X=P(Dt,X,it),tt===null?ze=Dt:tt.sibling=Dt,tt=Dt);return fn&&gl(te,it),ze}for(nt=y(te,nt);!Dt.done;it++,Dt=ne.next())Dt=Me(nt,te,it,Dt.value,be),Dt!==null&&(a&&Dt.alternate!==null&&nt.delete(Dt.key===null?it:Dt.key),X=P(Dt,X,it),tt===null?ze=Dt:tt.sibling=Dt,tt=Dt);return a&&nt.forEach(function(i7){return c(te,i7)}),fn&&gl(te,it),ze}function Rn(te,X,ne,be){if(typeof ne=="object"&&ne!==null&&ne.type===M&&ne.key===null&&(ne=ne.props.children),typeof ne=="object"&&ne!==null){switch(ne.$$typeof){case A:e:{for(var ze=ne.key,tt=X;tt!==null;){if(tt.key===ze){if(ze=ne.type,ze===M){if(tt.tag===7){h(te,tt.sibling),X=E(tt,ne.props.children),X.return=te,te=X;break e}}else if(tt.elementType===ze||typeof ze=="object"&&ze!==null&&ze.$$typeof===V&&x6(ze)===tt.type){h(te,tt.sibling),X=E(tt,ne.props),X.ref=qd(te,tt,ne),X.return=te,te=X;break e}h(te,tt);break}else c(te,tt);tt=tt.sibling}ne.type===M?(X=kl(ne.props.children,te.mode,be,ne.key),X.return=te,te=X):(be=r0(ne.type,ne.key,ne.props,null,te.mode,be),be.ref=qd(te,X,ne),be.return=te,te=be)}return L(te);case I:e:{for(tt=ne.key;X!==null;){if(X.key===tt)if(X.tag===4&&X.stateNode.containerInfo===ne.containerInfo&&X.stateNode.implementation===ne.implementation){h(te,X.sibling),X=E(X,ne.children||[]),X.return=te,te=X;break e}else{h(te,X);break}else c(te,X);X=X.sibling}X=B1(ne,te.mode,be),X.return=te,te=X}return L(te);case V:return tt=ne._init,Rn(te,X,tt(ne._payload),be)}if(Ct(ne))return Fe(te,X,ne,be);if(ee(ne))return He(te,X,ne,be);Op(te,ne)}return typeof ne=="string"&&ne!==""||typeof ne=="number"?(ne=""+ne,X!==null&&X.tag===6?(h(te,X.sibling),X=E(X,ne),X.return=te,te=X):(h(te,X),X=U1(ne,te.mode,be),X.return=te,te=X),L(te)):h(te,X)}return Rn}var qc=b6(!0),S6=b6(!1),Lp=ra(null),Np=null,Gc=null,Jv=null;function e1(){Jv=Gc=Np=null}function t1(a){var c=Lp.current;on(Lp),a._currentValue=c}function n1(a,c,h){for(;a!==null;){var y=a.alternate;if((a.childLanes&c)!==c?(a.childLanes|=c,y!==null&&(y.childLanes|=c)):y!==null&&(y.childLanes&c)!==c&&(y.childLanes|=c),a===h)break;a=a.return}}function Kc(a,c){Np=a,Jv=Gc=null,a=a.dependencies,a!==null&&a.firstContext!==null&&((a.lanes&c)!==0&&(Ur=!0),a.firstContext=null)}function $s(a){var c=a._currentValue;if(Jv!==a)if(a={context:a,memoizedValue:c,next:null},Gc===null){if(Np===null)throw Error(n(308));Gc=a,Np.dependencies={lanes:0,firstContext:a}}else Gc=Gc.next=a;return c}var vl=null;function r1(a){vl===null?vl=[a]:vl.push(a)}function k6(a,c,h,y){var E=c.interleaved;return E===null?(h.next=h,r1(c)):(h.next=E.next,E.next=h),c.interleaved=h,ho(a,y)}function ho(a,c){a.lanes|=c;var h=a.alternate;for(h!==null&&(h.lanes|=c),h=a,a=a.return;a!==null;)a.childLanes|=c,h=a.alternate,h!==null&&(h.childLanes|=c),h=a,a=a.return;return h.tag===3?h.stateNode:null}var oa=!1;function s1(a){a.updateQueue={baseState:a.memoizedState,firstBaseUpdate:null,lastBaseUpdate:null,shared:{pending:null,interleaved:null,lanes:0},effects:null}}function E6(a,c){a=a.updateQueue,c.updateQueue===a&&(c.updateQueue={baseState:a.baseState,firstBaseUpdate:a.firstBaseUpdate,lastBaseUpdate:a.lastBaseUpdate,shared:a.shared,effects:a.effects})}function po(a,c){return{eventTime:a,lane:c,tag:0,payload:null,callback:null,next:null}}function aa(a,c,h){var y=a.updateQueue;if(y===null)return null;if(y=y.shared,(At&2)!==0){var E=y.pending;return E===null?c.next=c:(c.next=E.next,E.next=c),y.pending=c,ho(a,h)}return E=y.interleaved,E===null?(c.next=c,r1(y)):(c.next=E.next,E.next=c),y.interleaved=c,ho(a,h)}function Dp(a,c,h){if(c=c.updateQueue,c!==null&&(c=c.shared,(h&4194240)!==0)){var y=c.lanes;y&=a.pendingLanes,h|=y,c.lanes=h,Od(a,h)}}function C6(a,c){var h=a.updateQueue,y=a.alternate;if(y!==null&&(y=y.updateQueue,h===y)){var E=null,P=null;if(h=h.firstBaseUpdate,h!==null){do{var L={eventTime:h.eventTime,lane:h.lane,tag:h.tag,payload:h.payload,callback:h.callback,next:null};P===null?E=P=L:P=P.next=L,h=h.next}while(h!==null);P===null?E=P=c:P=P.next=c}else E=P=c;h={baseState:y.baseState,firstBaseUpdate:E,lastBaseUpdate:P,shared:y.shared,effects:y.effects},a.updateQueue=h;return}a=h.lastBaseUpdate,a===null?h.firstBaseUpdate=c:a.next=c,h.lastBaseUpdate=c}function jp(a,c,h,y){var E=a.updateQueue;oa=!1;var P=E.firstBaseUpdate,L=E.lastBaseUpdate,z=E.shared.pending;if(z!==null){E.shared.pending=null;var q=z,se=q.next;q.next=null,L===null?P=se:L.next=se,L=q;var ge=a.alternate;ge!==null&&(ge=ge.updateQueue,z=ge.lastBaseUpdate,z!==L&&(z===null?ge.firstBaseUpdate=se:z.next=se,ge.lastBaseUpdate=q))}if(P!==null){var ye=E.baseState;L=0,ge=se=q=null,z=P;do{var me=z.lane,Me=z.eventTime;if((y&me)===me){ge!==null&&(ge=ge.next={eventTime:Me,lane:0,tag:z.tag,payload:z.payload,callback:z.callback,next:null});e:{var Fe=a,He=z;switch(me=c,Me=h,He.tag){case 1:if(Fe=He.payload,typeof Fe=="function"){ye=Fe.call(Me,ye,me);break e}ye=Fe;break e;case 3:Fe.flags=Fe.flags&-65537|128;case 0:if(Fe=He.payload,me=typeof Fe=="function"?Fe.call(Me,ye,me):Fe,me==null)break e;ye=Z({},ye,me);break e;case 2:oa=!0}}z.callback!==null&&z.lane!==0&&(a.flags|=64,me=E.effects,me===null?E.effects=[z]:me.push(z))}else Me={eventTime:Me,lane:me,tag:z.tag,payload:z.payload,callback:z.callback,next:null},ge===null?(se=ge=Me,q=ye):ge=ge.next=Me,L|=me;if(z=z.next,z===null){if(z=E.shared.pending,z===null)break;me=z,z=me.next,me.next=null,E.lastBaseUpdate=me,E.shared.pending=null}}while(!0);if(ge===null&&(q=ye),E.baseState=q,E.firstBaseUpdate=se,E.lastBaseUpdate=ge,c=E.shared.interleaved,c!==null){E=c;do L|=E.lane,E=E.next;while(E!==c)}else P===null&&(E.shared.lanes=0);wl|=L,a.lanes=L,a.memoizedState=ye}}function P6(a,c,h){if(a=c.effects,c.effects=null,a!==null)for(c=0;c<a.length;c++){var y=a[c],E=y.callback;if(E!==null){if(y.callback=null,y=h,typeof E!="function")throw Error(n(191,E));E.call(y)}}}var Gd={},Ei=ra(Gd),Kd=ra(Gd),Yd=ra(Gd);function yl(a){if(a===Gd)throw Error(n(174));return a}function i1(a,c){switch(en(Yd,c),en(Kd,a),en(Ei,Gd),a=c.nodeType,a){case 9:case 11:c=(c=c.documentElement)?c.namespaceURI:vr(null,"");break;default:a=a===8?c.parentNode:c,c=a.namespaceURI||null,a=a.tagName,c=vr(c,a)}on(Ei),en(Ei,c)}function Yc(){on(Ei),on(Kd),on(Yd)}function T6(a){yl(Yd.current);var c=yl(Ei.current),h=vr(c,a.type);c!==h&&(en(Kd,a),en(Ei,h))}function o1(a){Kd.current===a&&(on(Ei),on(Kd))}var _n=ra(0);function $p(a){for(var c=a;c!==null;){if(c.tag===13){var h=c.memoizedState;if(h!==null&&(h=h.dehydrated,h===null||h.data==="$?"||h.data==="$!"))return c}else if(c.tag===19&&c.memoizedProps.revealOrder!==void 0){if((c.flags&128)!==0)return c}else if(c.child!==null){c.child.return=c,c=c.child;continue}if(c===a)break;for(;c.sibling===null;){if(c.return===null||c.return===a)return null;c=c.return}c.sibling.return=c.return,c=c.sibling}return null}var a1=[];function l1(){for(var a=0;a<a1.length;a++)a1[a]._workInProgressVersionPrimary=null;a1.length=0}var Fp=T.ReactCurrentDispatcher,c1=T.ReactCurrentBatchConfig,_l=0,wn=null,Zn=null,er=null,Vp=!1,Xd=!1,Qd=0,PD=0;function wr(){throw Error(n(321))}function u1(a,c){if(c===null)return!1;for(var h=0;h<c.length&&h<a.length;h++)if(!ri(a[h],c[h]))return!1;return!0}function d1(a,c,h,y,E,P){if(_l=P,wn=c,c.memoizedState=null,c.updateQueue=null,c.lanes=0,Fp.current=a===null||a.memoizedState===null?MD:ID,a=h(y,E),Xd){P=0;do{if(Xd=!1,Qd=0,25<=P)throw Error(n(301));P+=1,er=Zn=null,c.updateQueue=null,Fp.current=OD,a=h(y,E)}while(Xd)}if(Fp.current=Up,c=Zn!==null&&Zn.next!==null,_l=0,er=Zn=wn=null,Vp=!1,c)throw Error(n(300));return a}function f1(){var a=Qd!==0;return Qd=0,a}function Ci(){var a={memoizedState:null,baseState:null,baseQueue:null,queue:null,next:null};return er===null?wn.memoizedState=er=a:er=er.next=a,er}function Fs(){if(Zn===null){var a=wn.alternate;a=a!==null?a.memoizedState:null}else a=Zn.next;var c=er===null?wn.memoizedState:er.next;if(c!==null)er=c,Zn=a;else{if(a===null)throw Error(n(310));Zn=a,a={memoizedState:Zn.memoizedState,baseState:Zn.baseState,baseQueue:Zn.baseQueue,queue:Zn.queue,next:null},er===null?wn.memoizedState=er=a:er=er.next=a}return er}function Jd(a,c){return typeof c=="function"?c(a):c}function h1(a){var c=Fs(),h=c.queue;if(h===null)throw Error(n(311));h.lastRenderedReducer=a;var y=Zn,E=y.baseQueue,P=h.pending;if(P!==null){if(E!==null){var L=E.next;E.next=P.next,P.next=L}y.baseQueue=E=P,h.pending=null}if(E!==null){P=E.next,y=y.baseState;var z=L=null,q=null,se=P;do{var ge=se.lane;if((_l&ge)===ge)q!==null&&(q=q.next={lane:0,action:se.action,hasEagerState:se.hasEagerState,eagerState:se.eagerState,next:null}),y=se.hasEagerState?se.eagerState:a(y,se.action);else{var ye={lane:ge,action:se.action,hasEagerState:se.hasEagerState,eagerState:se.eagerState,next:null};q===null?(z=q=ye,L=y):q=q.next=ye,wn.lanes|=ge,wl|=ge}se=se.next}while(se!==null&&se!==P);q===null?L=y:q.next=z,ri(y,c.memoizedState)||(Ur=!0),c.memoizedState=y,c.baseState=L,c.baseQueue=q,h.lastRenderedState=y}if(a=h.interleaved,a!==null){E=a;do P=E.lane,wn.lanes|=P,wl|=P,E=E.next;while(E!==a)}else E===null&&(h.lanes=0);return[c.memoizedState,h.dispatch]}function p1(a){var c=Fs(),h=c.queue;if(h===null)throw Error(n(311));h.lastRenderedReducer=a;var y=h.dispatch,E=h.pending,P=c.memoizedState;if(E!==null){h.pending=null;var L=E=E.next;do P=a(P,L.action),L=L.next;while(L!==E);ri(P,c.memoizedState)||(Ur=!0),c.memoizedState=P,c.baseQueue===null&&(c.baseState=P),h.lastRenderedState=P}return[P,y]}function A6(){}function R6(a,c){var h=wn,y=Fs(),E=c(),P=!ri(y.memoizedState,E);if(P&&(y.memoizedState=E,Ur=!0),y=y.queue,m1(O6.bind(null,h,y,a),[a]),y.getSnapshot!==c||P||er!==null&&er.memoizedState.tag&1){if(h.flags|=2048,ef(9,I6.bind(null,h,y,E,c),void 0,null),tr===null)throw Error(n(349));(_l&30)!==0||M6(h,c,E)}return E}function M6(a,c,h){a.flags|=16384,a={getSnapshot:c,value:h},c=wn.updateQueue,c===null?(c={lastEffect:null,stores:null},wn.updateQueue=c,c.stores=[a]):(h=c.stores,h===null?c.stores=[a]:h.push(a))}function I6(a,c,h,y){c.value=h,c.getSnapshot=y,L6(c)&&N6(a)}function O6(a,c,h){return h(function(){L6(c)&&N6(a)})}function L6(a){var c=a.getSnapshot;a=a.value;try{var h=c();return!ri(a,h)}catch{return!0}}function N6(a){var c=ho(a,1);c!==null&&li(c,a,1,-1)}function D6(a){var c=Ci();return typeof a=="function"&&(a=a()),c.memoizedState=c.baseState=a,a={pending:null,interleaved:null,lanes:0,dispatch:null,lastRenderedReducer:Jd,lastRenderedState:a},c.queue=a,a=a.dispatch=RD.bind(null,wn,a),[c.memoizedState,a]}function ef(a,c,h,y){return a={tag:a,create:c,destroy:h,deps:y,next:null},c=wn.updateQueue,c===null?(c={lastEffect:null,stores:null},wn.updateQueue=c,c.lastEffect=a.next=a):(h=c.lastEffect,h===null?c.lastEffect=a.next=a:(y=h.next,h.next=a,a.next=y,c.lastEffect=a)),a}function j6(){return Fs().memoizedState}function Hp(a,c,h,y){var E=Ci();wn.flags|=a,E.memoizedState=ef(1|c,h,void 0,y===void 0?null:y)}function zp(a,c,h,y){var E=Fs();y=y===void 0?null:y;var P=void 0;if(Zn!==null){var L=Zn.memoizedState;if(P=L.destroy,y!==null&&u1(y,L.deps)){E.memoizedState=ef(c,h,P,y);return}}wn.flags|=a,E.memoizedState=ef(1|c,h,P,y)}function $6(a,c){return Hp(8390656,8,a,c)}function m1(a,c){return zp(2048,8,a,c)}function F6(a,c){return zp(4,2,a,c)}function V6(a,c){return zp(4,4,a,c)}function H6(a,c){if(typeof c=="function")return a=a(),c(a),function(){c(null)};if(c!=null)return a=a(),c.current=a,function(){c.current=null}}function z6(a,c,h){return h=h!=null?h.concat([a]):null,zp(4,4,H6.bind(null,c,a),h)}function g1(){}function U6(a,c){var h=Fs();c=c===void 0?null:c;var y=h.memoizedState;return y!==null&&c!==null&&u1(c,y[1])?y[0]:(h.memoizedState=[a,c],a)}function B6(a,c){var h=Fs();c=c===void 0?null:c;var y=h.memoizedState;return y!==null&&c!==null&&u1(c,y[1])?y[0]:(a=a(),h.memoizedState=[a,c],a)}function Z6(a,c,h){return(_l&21)===0?(a.baseState&&(a.baseState=!1,Ur=!0),a.memoizedState=h):(ri(h,c)||(h=cp(),wn.lanes|=h,wl|=h,a.baseState=!0),c)}function TD(a,c){var h=Ft;Ft=h!==0&&4>h?h:4,a(!0);var y=c1.transition;c1.transition={};try{a(!1),c()}finally{Ft=h,c1.transition=y}}function W6(){return Fs().memoizedState}function AD(a,c,h){var y=da(a);if(h={lane:y,action:h,hasEagerState:!1,eagerState:null,next:null},q6(a))G6(c,h);else if(h=k6(a,c,h,y),h!==null){var E=Ar();li(h,a,y,E),K6(h,c,y)}}function RD(a,c,h){var y=da(a),E={lane:y,action:h,hasEagerState:!1,eagerState:null,next:null};if(q6(a))G6(c,E);else{var P=a.alternate;if(a.lanes===0&&(P===null||P.lanes===0)&&(P=c.lastRenderedReducer,P!==null))try{var L=c.lastRenderedState,z=P(L,h);if(E.hasEagerState=!0,E.eagerState=z,ri(z,L)){var q=c.interleaved;q===null?(E.next=E,r1(c)):(E.next=q.next,q.next=E),c.interleaved=E;return}}catch{}finally{}h=k6(a,c,E,y),h!==null&&(E=Ar(),li(h,a,y,E),K6(h,c,y))}}function q6(a){var c=a.alternate;return a===wn||c!==null&&c===wn}function G6(a,c){Xd=Vp=!0;var h=a.pending;h===null?c.next=c:(c.next=h.next,h.next=c),a.pending=c}function K6(a,c,h){if((h&4194240)!==0){var y=c.lanes;y&=a.pendingLanes,h|=y,c.lanes=h,Od(a,h)}}var Up={readContext:$s,useCallback:wr,useContext:wr,useEffect:wr,useImperativeHandle:wr,useInsertionEffect:wr,useLayoutEffect:wr,useMemo:wr,useReducer:wr,useRef:wr,useState:wr,useDebugValue:wr,useDeferredValue:wr,useTransition:wr,useMutableSource:wr,useSyncExternalStore:wr,useId:wr,unstable_isNewReconciler:!1},MD={readContext:$s,useCallback:function(a,c){return Ci().memoizedState=[a,c===void 0?null:c],a},useContext:$s,useEffect:$6,useImperativeHandle:function(a,c,h){return h=h!=null?h.concat([a]):null,Hp(4194308,4,H6.bind(null,c,a),h)},useLayoutEffect:function(a,c){return Hp(4194308,4,a,c)},useInsertionEffect:function(a,c){return Hp(4,2,a,c)},useMemo:function(a,c){var h=Ci();return c=c===void 0?null:c,a=a(),h.memoizedState=[a,c],a},useReducer:function(a,c,h){var y=Ci();return c=h!==void 0?h(c):c,y.memoizedState=y.baseState=c,a={pending:null,interleaved:null,lanes:0,dispatch:null,lastRenderedReducer:a,lastRenderedState:c},y.queue=a,a=a.dispatch=AD.bind(null,wn,a),[y.memoizedState,a]},useRef:function(a){var c=Ci();return a={current:a},c.memoizedState=a},useState:D6,useDebugValue:g1,useDeferredValue:function(a){return Ci().memoizedState=a},useTransition:function(){var a=D6(!1),c=a[0];return a=TD.bind(null,a[1]),Ci().memoizedState=a,[c,a]},useMutableSource:function(){},useSyncExternalStore:function(a,c,h){var y=wn,E=Ci();if(fn){if(h===void 0)throw Error(n(407));h=h()}else{if(h=c(),tr===null)throw Error(n(349));(_l&30)!==0||M6(y,c,h)}E.memoizedState=h;var P={value:h,getSnapshot:c};return E.queue=P,$6(O6.bind(null,y,P,a),[a]),y.flags|=2048,ef(9,I6.bind(null,y,P,h,c),void 0,null),h},useId:function(){var a=Ci(),c=tr.identifierPrefix;if(fn){var h=fo,y=uo;h=(y&~(1<<32-ls(y)-1)).toString(32)+h,c=":"+c+"R"+h,h=Qd++,0<h&&(c+="H"+h.toString(32)),c+=":"}else h=PD++,c=":"+c+"r"+h.toString(32)+":";return a.memoizedState=c},unstable_isNewReconciler:!1},ID={readContext:$s,useCallback:U6,useContext:$s,useEffect:m1,useImperativeHandle:z6,useInsertionEffect:F6,useLayoutEffect:V6,useMemo:B6,useReducer:h1,useRef:j6,useState:function(){return h1(Jd)},useDebugValue:g1,useDeferredValue:function(a){var c=Fs();return Z6(c,Zn.memoizedState,a)},useTransition:function(){var a=h1(Jd)[0],c=Fs().memoizedState;return[a,c]},useMutableSource:A6,useSyncExternalStore:R6,useId:W6,unstable_isNewReconciler:!1},OD={readContext:$s,useCallback:U6,useContext:$s,useEffect:m1,useImperativeHandle:z6,useInsertionEffect:F6,useLayoutEffect:V6,useMemo:B6,useReducer:p1,useRef:j6,useState:function(){return p1(Jd)},useDebugValue:g1,useDeferredValue:function(a){var c=Fs();return Zn===null?c.memoizedState=a:Z6(c,Zn.memoizedState,a)},useTransition:function(){var a=p1(Jd)[0],c=Fs().memoizedState;return[a,c]},useMutableSource:A6,useSyncExternalStore:R6,useId:W6,unstable_isNewReconciler:!1};function ii(a,c){if(a&&a.defaultProps){c=Z({},c),a=a.defaultProps;for(var h in a)c[h]===void 0&&(c[h]=a[h]);return c}return c}function v1(a,c,h,y){c=a.memoizedState,h=h(y,c),h=h==null?c:Z({},c,h),a.memoizedState=h,a.lanes===0&&(a.updateQueue.baseState=h)}var Bp={isMounted:function(a){return(a=a._reactInternals)?Os(a)===a:!1},enqueueSetState:function(a,c,h){a=a._reactInternals;var y=Ar(),E=da(a),P=po(y,E);P.payload=c,h!=null&&(P.callback=h),c=aa(a,P,E),c!==null&&(li(c,a,E,y),Dp(c,a,E))},enqueueReplaceState:function(a,c,h){a=a._reactInternals;var y=Ar(),E=da(a),P=po(y,E);P.tag=1,P.payload=c,h!=null&&(P.callback=h),c=aa(a,P,E),c!==null&&(li(c,a,E,y),Dp(c,a,E))},enqueueForceUpdate:function(a,c){a=a._reactInternals;var h=Ar(),y=da(a),E=po(h,y);E.tag=2,c!=null&&(E.callback=c),c=aa(a,E,y),c!==null&&(li(c,a,y,h),Dp(c,a,y))}};function Y6(a,c,h,y,E,P,L){return a=a.stateNode,typeof a.shouldComponentUpdate=="function"?a.shouldComponentUpdate(y,P,L):c.prototype&&c.prototype.isPureReactComponent?!Vd(h,y)||!Vd(E,P):!0}function X6(a,c,h){var y=!1,E=sa,P=c.contextType;return typeof P=="object"&&P!==null?P=$s(P):(E=zr(c)?pl:_r.current,y=c.contextTypes,P=(y=y!=null)?Uc(a,E):sa),c=new c(h,P),a.memoizedState=c.state!==null&&c.state!==void 0?c.state:null,c.updater=Bp,a.stateNode=c,c._reactInternals=a,y&&(a=a.stateNode,a.__reactInternalMemoizedUnmaskedChildContext=E,a.__reactInternalMemoizedMaskedChildContext=P),c}function Q6(a,c,h,y){a=c.state,typeof c.componentWillReceiveProps=="function"&&c.componentWillReceiveProps(h,y),typeof c.UNSAFE_componentWillReceiveProps=="function"&&c.UNSAFE_componentWillReceiveProps(h,y),c.state!==a&&Bp.enqueueReplaceState(c,c.state,null)}function y1(a,c,h,y){var E=a.stateNode;E.props=h,E.state=a.memoizedState,E.refs={},s1(a);var P=c.contextType;typeof P=="object"&&P!==null?E.context=$s(P):(P=zr(c)?pl:_r.current,E.context=Uc(a,P)),E.state=a.memoizedState,P=c.getDerivedStateFromProps,typeof P=="function"&&(v1(a,c,P,h),E.state=a.memoizedState),typeof c.getDerivedStateFromProps=="function"||typeof E.getSnapshotBeforeUpdate=="function"||typeof E.UNSAFE_componentWillMount!="function"&&typeof E.componentWillMount!="function"||(c=E.state,typeof E.componentWillMount=="function"&&E.componentWillMount(),typeof E.UNSAFE_componentWillMount=="function"&&E.UNSAFE_componentWillMount(),c!==E.state&&Bp.enqueueReplaceState(E,E.state,null),jp(a,h,E,y),E.state=a.memoizedState),typeof E.componentDidMount=="function"&&(a.flags|=4194308)}function Xc(a,c){try{var h="",y=c;do h+=ie(y),y=y.return;while(y);var E=h}catch(P){E=`
41
+ Error generating stack: `+P.message+`
42
+ `+P.stack}return{value:a,source:c,stack:E,digest:null}}function _1(a,c,h){return{value:a,source:null,stack:h??null,digest:c??null}}function w1(a,c){try{console.error(c.value)}catch(h){setTimeout(function(){throw h})}}var LD=typeof WeakMap=="function"?WeakMap:Map;function J6(a,c,h){h=po(-1,h),h.tag=3,h.payload={element:null};var y=c.value;return h.callback=function(){Xp||(Xp=!0,N1=y),w1(a,c)},h}function eS(a,c,h){h=po(-1,h),h.tag=3;var y=a.type.getDerivedStateFromError;if(typeof y=="function"){var E=c.value;h.payload=function(){return y(E)},h.callback=function(){w1(a,c)}}var P=a.stateNode;return P!==null&&typeof P.componentDidCatch=="function"&&(h.callback=function(){w1(a,c),typeof y!="function"&&(ca===null?ca=new Set([this]):ca.add(this));var L=c.stack;this.componentDidCatch(c.value,{componentStack:L!==null?L:""})}),h}function tS(a,c,h){var y=a.pingCache;if(y===null){y=a.pingCache=new LD;var E=new Set;y.set(c,E)}else E=y.get(c),E===void 0&&(E=new Set,y.set(c,E));E.has(h)||(E.add(h),a=GD.bind(null,a,c,h),c.then(a,a))}function nS(a){do{var c;if((c=a.tag===13)&&(c=a.memoizedState,c=c!==null?c.dehydrated!==null:!0),c)return a;a=a.return}while(a!==null);return null}function rS(a,c,h,y,E){return(a.mode&1)===0?(a===c?a.flags|=65536:(a.flags|=128,h.flags|=131072,h.flags&=-52805,h.tag===1&&(h.alternate===null?h.tag=17:(c=po(-1,1),c.tag=2,aa(h,c,1))),h.lanes|=1),a):(a.flags|=65536,a.lanes=E,a)}var ND=T.ReactCurrentOwner,Ur=!1;function Tr(a,c,h,y){c.child=a===null?S6(c,null,h,y):qc(c,a.child,h,y)}function sS(a,c,h,y,E){h=h.render;var P=c.ref;return Kc(c,E),y=d1(a,c,h,y,P,E),h=f1(),a!==null&&!Ur?(c.updateQueue=a.updateQueue,c.flags&=-2053,a.lanes&=~E,mo(a,c,E)):(fn&&h&&Gv(c),c.flags|=1,Tr(a,c,y,E),c.child)}function iS(a,c,h,y,E){if(a===null){var P=h.type;return typeof P=="function"&&!z1(P)&&P.defaultProps===void 0&&h.compare===null&&h.defaultProps===void 0?(c.tag=15,c.type=P,oS(a,c,P,y,E)):(a=r0(h.type,null,y,c,c.mode,E),a.ref=c.ref,a.return=c,c.child=a)}if(P=a.child,(a.lanes&E)===0){var L=P.memoizedProps;if(h=h.compare,h=h!==null?h:Vd,h(L,y)&&a.ref===c.ref)return mo(a,c,E)}return c.flags|=1,a=ha(P,y),a.ref=c.ref,a.return=c,c.child=a}function oS(a,c,h,y,E){if(a!==null){var P=a.memoizedProps;if(Vd(P,y)&&a.ref===c.ref)if(Ur=!1,c.pendingProps=y=P,(a.lanes&E)!==0)(a.flags&131072)!==0&&(Ur=!0);else return c.lanes=a.lanes,mo(a,c,E)}return x1(a,c,h,y,E)}function aS(a,c,h){var y=c.pendingProps,E=y.children,P=a!==null?a.memoizedState:null;if(y.mode==="hidden")if((c.mode&1)===0)c.memoizedState={baseLanes:0,cachePool:null,transitions:null},en(Jc,ms),ms|=h;else{if((h&1073741824)===0)return a=P!==null?P.baseLanes|h:h,c.lanes=c.childLanes=1073741824,c.memoizedState={baseLanes:a,cachePool:null,transitions:null},c.updateQueue=null,en(Jc,ms),ms|=a,null;c.memoizedState={baseLanes:0,cachePool:null,transitions:null},y=P!==null?P.baseLanes:h,en(Jc,ms),ms|=y}else P!==null?(y=P.baseLanes|h,c.memoizedState=null):y=h,en(Jc,ms),ms|=y;return Tr(a,c,E,h),c.child}function lS(a,c){var h=c.ref;(a===null&&h!==null||a!==null&&a.ref!==h)&&(c.flags|=512,c.flags|=2097152)}function x1(a,c,h,y,E){var P=zr(h)?pl:_r.current;return P=Uc(c,P),Kc(c,E),h=d1(a,c,h,y,P,E),y=f1(),a!==null&&!Ur?(c.updateQueue=a.updateQueue,c.flags&=-2053,a.lanes&=~E,mo(a,c,E)):(fn&&y&&Gv(c),c.flags|=1,Tr(a,c,h,E),c.child)}function cS(a,c,h,y,E){if(zr(h)){var P=!0;Tp(c)}else P=!1;if(Kc(c,E),c.stateNode===null)Wp(a,c),X6(c,h,y),y1(c,h,y,E),y=!0;else if(a===null){var L=c.stateNode,z=c.memoizedProps;L.props=z;var q=L.context,se=h.contextType;typeof se=="object"&&se!==null?se=$s(se):(se=zr(h)?pl:_r.current,se=Uc(c,se));var ge=h.getDerivedStateFromProps,ye=typeof ge=="function"||typeof L.getSnapshotBeforeUpdate=="function";ye||typeof L.UNSAFE_componentWillReceiveProps!="function"&&typeof L.componentWillReceiveProps!="function"||(z!==y||q!==se)&&Q6(c,L,y,se),oa=!1;var me=c.memoizedState;L.state=me,jp(c,y,L,E),q=c.memoizedState,z!==y||me!==q||Hr.current||oa?(typeof ge=="function"&&(v1(c,h,ge,y),q=c.memoizedState),(z=oa||Y6(c,h,z,y,me,q,se))?(ye||typeof L.UNSAFE_componentWillMount!="function"&&typeof L.componentWillMount!="function"||(typeof L.componentWillMount=="function"&&L.componentWillMount(),typeof L.UNSAFE_componentWillMount=="function"&&L.UNSAFE_componentWillMount()),typeof L.componentDidMount=="function"&&(c.flags|=4194308)):(typeof L.componentDidMount=="function"&&(c.flags|=4194308),c.memoizedProps=y,c.memoizedState=q),L.props=y,L.state=q,L.context=se,y=z):(typeof L.componentDidMount=="function"&&(c.flags|=4194308),y=!1)}else{L=c.stateNode,E6(a,c),z=c.memoizedProps,se=c.type===c.elementType?z:ii(c.type,z),L.props=se,ye=c.pendingProps,me=L.context,q=h.contextType,typeof q=="object"&&q!==null?q=$s(q):(q=zr(h)?pl:_r.current,q=Uc(c,q));var Me=h.getDerivedStateFromProps;(ge=typeof Me=="function"||typeof L.getSnapshotBeforeUpdate=="function")||typeof L.UNSAFE_componentWillReceiveProps!="function"&&typeof L.componentWillReceiveProps!="function"||(z!==ye||me!==q)&&Q6(c,L,y,q),oa=!1,me=c.memoizedState,L.state=me,jp(c,y,L,E);var Fe=c.memoizedState;z!==ye||me!==Fe||Hr.current||oa?(typeof Me=="function"&&(v1(c,h,Me,y),Fe=c.memoizedState),(se=oa||Y6(c,h,se,y,me,Fe,q)||!1)?(ge||typeof L.UNSAFE_componentWillUpdate!="function"&&typeof L.componentWillUpdate!="function"||(typeof L.componentWillUpdate=="function"&&L.componentWillUpdate(y,Fe,q),typeof L.UNSAFE_componentWillUpdate=="function"&&L.UNSAFE_componentWillUpdate(y,Fe,q)),typeof L.componentDidUpdate=="function"&&(c.flags|=4),typeof L.getSnapshotBeforeUpdate=="function"&&(c.flags|=1024)):(typeof L.componentDidUpdate!="function"||z===a.memoizedProps&&me===a.memoizedState||(c.flags|=4),typeof L.getSnapshotBeforeUpdate!="function"||z===a.memoizedProps&&me===a.memoizedState||(c.flags|=1024),c.memoizedProps=y,c.memoizedState=Fe),L.props=y,L.state=Fe,L.context=q,y=se):(typeof L.componentDidUpdate!="function"||z===a.memoizedProps&&me===a.memoizedState||(c.flags|=4),typeof L.getSnapshotBeforeUpdate!="function"||z===a.memoizedProps&&me===a.memoizedState||(c.flags|=1024),y=!1)}return b1(a,c,h,y,P,E)}function b1(a,c,h,y,E,P){lS(a,c);var L=(c.flags&128)!==0;if(!y&&!L)return E&&p6(c,h,!1),mo(a,c,P);y=c.stateNode,ND.current=c;var z=L&&typeof h.getDerivedStateFromError!="function"?null:y.render();return c.flags|=1,a!==null&&L?(c.child=qc(c,a.child,null,P),c.child=qc(c,null,z,P)):Tr(a,c,z,P),c.memoizedState=y.state,E&&p6(c,h,!0),c.child}function uS(a){var c=a.stateNode;c.pendingContext?f6(a,c.pendingContext,c.pendingContext!==c.context):c.context&&f6(a,c.context,!1),i1(a,c.containerInfo)}function dS(a,c,h,y,E){return Wc(),Qv(E),c.flags|=256,Tr(a,c,h,y),c.child}var S1={dehydrated:null,treeContext:null,retryLane:0};function k1(a){return{baseLanes:a,cachePool:null,transitions:null}}function fS(a,c,h){var y=c.pendingProps,E=_n.current,P=!1,L=(c.flags&128)!==0,z;if((z=L)||(z=a!==null&&a.memoizedState===null?!1:(E&2)!==0),z?(P=!0,c.flags&=-129):(a===null||a.memoizedState!==null)&&(E|=1),en(_n,E&1),a===null)return Xv(c),a=c.memoizedState,a!==null&&(a=a.dehydrated,a!==null)?((c.mode&1)===0?c.lanes=1:a.data==="$!"?c.lanes=8:c.lanes=1073741824,null):(L=y.children,a=y.fallback,P?(y=c.mode,P=c.child,L={mode:"hidden",children:L},(y&1)===0&&P!==null?(P.childLanes=0,P.pendingProps=L):P=s0(L,y,0,null),a=kl(a,y,h,null),P.return=c,a.return=c,P.sibling=a,c.child=P,c.child.memoizedState=k1(h),c.memoizedState=S1,a):E1(c,L));if(E=a.memoizedState,E!==null&&(z=E.dehydrated,z!==null))return DD(a,c,L,y,z,E,h);if(P){P=y.fallback,L=c.mode,E=a.child,z=E.sibling;var q={mode:"hidden",children:y.children};return(L&1)===0&&c.child!==E?(y=c.child,y.childLanes=0,y.pendingProps=q,c.deletions=null):(y=ha(E,q),y.subtreeFlags=E.subtreeFlags&14680064),z!==null?P=ha(z,P):(P=kl(P,L,h,null),P.flags|=2),P.return=c,y.return=c,y.sibling=P,c.child=y,y=P,P=c.child,L=a.child.memoizedState,L=L===null?k1(h):{baseLanes:L.baseLanes|h,cachePool:null,transitions:L.transitions},P.memoizedState=L,P.childLanes=a.childLanes&~h,c.memoizedState=S1,y}return P=a.child,a=P.sibling,y=ha(P,{mode:"visible",children:y.children}),(c.mode&1)===0&&(y.lanes=h),y.return=c,y.sibling=null,a!==null&&(h=c.deletions,h===null?(c.deletions=[a],c.flags|=16):h.push(a)),c.child=y,c.memoizedState=null,y}function E1(a,c){return c=s0({mode:"visible",children:c},a.mode,0,null),c.return=a,a.child=c}function Zp(a,c,h,y){return y!==null&&Qv(y),qc(c,a.child,null,h),a=E1(c,c.pendingProps.children),a.flags|=2,c.memoizedState=null,a}function DD(a,c,h,y,E,P,L){if(h)return c.flags&256?(c.flags&=-257,y=_1(Error(n(422))),Zp(a,c,L,y)):c.memoizedState!==null?(c.child=a.child,c.flags|=128,null):(P=y.fallback,E=c.mode,y=s0({mode:"visible",children:y.children},E,0,null),P=kl(P,E,L,null),P.flags|=2,y.return=c,P.return=c,y.sibling=P,c.child=y,(c.mode&1)!==0&&qc(c,a.child,null,L),c.child.memoizedState=k1(L),c.memoizedState=S1,P);if((c.mode&1)===0)return Zp(a,c,L,null);if(E.data==="$!"){if(y=E.nextSibling&&E.nextSibling.dataset,y)var z=y.dgst;return y=z,P=Error(n(419)),y=_1(P,y,void 0),Zp(a,c,L,y)}if(z=(L&a.childLanes)!==0,Ur||z){if(y=tr,y!==null){switch(L&-L){case 4:E=2;break;case 16:E=8;break;case 64:case 128:case 256:case 512:case 1024:case 2048:case 4096:case 8192:case 16384:case 32768:case 65536:case 131072:case 262144:case 524288:case 1048576:case 2097152:case 4194304:case 8388608:case 16777216:case 33554432:case 67108864:E=32;break;case 536870912:E=268435456;break;default:E=0}E=(E&(y.suspendedLanes|L))!==0?0:E,E!==0&&E!==P.retryLane&&(P.retryLane=E,ho(a,E),li(y,a,E,-1))}return H1(),y=_1(Error(n(421))),Zp(a,c,L,y)}return E.data==="$?"?(c.flags|=128,c.child=a.child,c=KD.bind(null,a),E._reactRetry=c,null):(a=P.treeContext,ps=na(E.nextSibling),hs=c,fn=!0,si=null,a!==null&&(Ds[js++]=uo,Ds[js++]=fo,Ds[js++]=ml,uo=a.id,fo=a.overflow,ml=c),c=E1(c,y.children),c.flags|=4096,c)}function hS(a,c,h){a.lanes|=c;var y=a.alternate;y!==null&&(y.lanes|=c),n1(a.return,c,h)}function C1(a,c,h,y,E){var P=a.memoizedState;P===null?a.memoizedState={isBackwards:c,rendering:null,renderingStartTime:0,last:y,tail:h,tailMode:E}:(P.isBackwards=c,P.rendering=null,P.renderingStartTime=0,P.last=y,P.tail=h,P.tailMode=E)}function pS(a,c,h){var y=c.pendingProps,E=y.revealOrder,P=y.tail;if(Tr(a,c,y.children,h),y=_n.current,(y&2)!==0)y=y&1|2,c.flags|=128;else{if(a!==null&&(a.flags&128)!==0)e:for(a=c.child;a!==null;){if(a.tag===13)a.memoizedState!==null&&hS(a,h,c);else if(a.tag===19)hS(a,h,c);else if(a.child!==null){a.child.return=a,a=a.child;continue}if(a===c)break e;for(;a.sibling===null;){if(a.return===null||a.return===c)break e;a=a.return}a.sibling.return=a.return,a=a.sibling}y&=1}if(en(_n,y),(c.mode&1)===0)c.memoizedState=null;else switch(E){case"forwards":for(h=c.child,E=null;h!==null;)a=h.alternate,a!==null&&$p(a)===null&&(E=h),h=h.sibling;h=E,h===null?(E=c.child,c.child=null):(E=h.sibling,h.sibling=null),C1(c,!1,E,h,P);break;case"backwards":for(h=null,E=c.child,c.child=null;E!==null;){if(a=E.alternate,a!==null&&$p(a)===null){c.child=E;break}a=E.sibling,E.sibling=h,h=E,E=a}C1(c,!0,h,null,P);break;case"together":C1(c,!1,null,null,void 0);break;default:c.memoizedState=null}return c.child}function Wp(a,c){(c.mode&1)===0&&a!==null&&(a.alternate=null,c.alternate=null,c.flags|=2)}function mo(a,c,h){if(a!==null&&(c.dependencies=a.dependencies),wl|=c.lanes,(h&c.childLanes)===0)return null;if(a!==null&&c.child!==a.child)throw Error(n(153));if(c.child!==null){for(a=c.child,h=ha(a,a.pendingProps),c.child=h,h.return=c;a.sibling!==null;)a=a.sibling,h=h.sibling=ha(a,a.pendingProps),h.return=c;h.sibling=null}return c.child}function jD(a,c,h){switch(c.tag){case 3:uS(c),Wc();break;case 5:T6(c);break;case 1:zr(c.type)&&Tp(c);break;case 4:i1(c,c.stateNode.containerInfo);break;case 10:var y=c.type._context,E=c.memoizedProps.value;en(Lp,y._currentValue),y._currentValue=E;break;case 13:if(y=c.memoizedState,y!==null)return y.dehydrated!==null?(en(_n,_n.current&1),c.flags|=128,null):(h&c.child.childLanes)!==0?fS(a,c,h):(en(_n,_n.current&1),a=mo(a,c,h),a!==null?a.sibling:null);en(_n,_n.current&1);break;case 19:if(y=(h&c.childLanes)!==0,(a.flags&128)!==0){if(y)return pS(a,c,h);c.flags|=128}if(E=c.memoizedState,E!==null&&(E.rendering=null,E.tail=null,E.lastEffect=null),en(_n,_n.current),y)break;return null;case 22:case 23:return c.lanes=0,aS(a,c,h)}return mo(a,c,h)}var mS,P1,gS,vS;mS=function(a,c){for(var h=c.child;h!==null;){if(h.tag===5||h.tag===6)a.appendChild(h.stateNode);else if(h.tag!==4&&h.child!==null){h.child.return=h,h=h.child;continue}if(h===c)break;for(;h.sibling===null;){if(h.return===null||h.return===c)return;h=h.return}h.sibling.return=h.return,h=h.sibling}},P1=function(){},gS=function(a,c,h,y){var E=a.memoizedProps;if(E!==y){a=c.stateNode,yl(Ei.current);var P=null;switch(h){case"input":E=Ot(a,E),y=Ot(a,y),P=[];break;case"select":E=Z({},E,{value:void 0}),y=Z({},y,{value:void 0}),P=[];break;case"textarea":E=Ye(a,E),y=Ye(a,y),P=[];break;default:typeof E.onClick!="function"&&typeof y.onClick=="function"&&(a.onclick=Ep)}Ms(h,y);var L;h=null;for(se in E)if(!y.hasOwnProperty(se)&&E.hasOwnProperty(se)&&E[se]!=null)if(se==="style"){var z=E[se];for(L in z)z.hasOwnProperty(L)&&(h||(h={}),h[L]="")}else se!=="dangerouslySetInnerHTML"&&se!=="children"&&se!=="suppressContentEditableWarning"&&se!=="suppressHydrationWarning"&&se!=="autoFocus"&&(s.hasOwnProperty(se)?P||(P=[]):(P=P||[]).push(se,null));for(se in y){var q=y[se];if(z=E!=null?E[se]:void 0,y.hasOwnProperty(se)&&q!==z&&(q!=null||z!=null))if(se==="style")if(z){for(L in z)!z.hasOwnProperty(L)||q&&q.hasOwnProperty(L)||(h||(h={}),h[L]="");for(L in q)q.hasOwnProperty(L)&&z[L]!==q[L]&&(h||(h={}),h[L]=q[L])}else h||(P||(P=[]),P.push(se,h)),h=q;else se==="dangerouslySetInnerHTML"?(q=q?q.__html:void 0,z=z?z.__html:void 0,q!=null&&z!==q&&(P=P||[]).push(se,q)):se==="children"?typeof q!="string"&&typeof q!="number"||(P=P||[]).push(se,""+q):se!=="suppressContentEditableWarning"&&se!=="suppressHydrationWarning"&&(s.hasOwnProperty(se)?(q!=null&&se==="onScroll"&&sn("scroll",a),P||z===q||(P=[])):(P=P||[]).push(se,q))}h&&(P=P||[]).push("style",h);var se=P;(c.updateQueue=se)&&(c.flags|=4)}},vS=function(a,c,h,y){h!==y&&(c.flags|=4)};function tf(a,c){if(!fn)switch(a.tailMode){case"hidden":c=a.tail;for(var h=null;c!==null;)c.alternate!==null&&(h=c),c=c.sibling;h===null?a.tail=null:h.sibling=null;break;case"collapsed":h=a.tail;for(var y=null;h!==null;)h.alternate!==null&&(y=h),h=h.sibling;y===null?c||a.tail===null?a.tail=null:a.tail.sibling=null:y.sibling=null}}function xr(a){var c=a.alternate!==null&&a.alternate.child===a.child,h=0,y=0;if(c)for(var E=a.child;E!==null;)h|=E.lanes|E.childLanes,y|=E.subtreeFlags&14680064,y|=E.flags&14680064,E.return=a,E=E.sibling;else for(E=a.child;E!==null;)h|=E.lanes|E.childLanes,y|=E.subtreeFlags,y|=E.flags,E.return=a,E=E.sibling;return a.subtreeFlags|=y,a.childLanes=h,c}function $D(a,c,h){var y=c.pendingProps;switch(Kv(c),c.tag){case 2:case 16:case 15:case 0:case 11:case 7:case 8:case 12:case 9:case 14:return xr(c),null;case 1:return zr(c.type)&&Pp(),xr(c),null;case 3:return y=c.stateNode,Yc(),on(Hr),on(_r),l1(),y.pendingContext&&(y.context=y.pendingContext,y.pendingContext=null),(a===null||a.child===null)&&(Ip(c)?c.flags|=4:a===null||a.memoizedState.isDehydrated&&(c.flags&256)===0||(c.flags|=1024,si!==null&&($1(si),si=null))),P1(a,c),xr(c),null;case 5:o1(c);var E=yl(Yd.current);if(h=c.type,a!==null&&c.stateNode!=null)gS(a,c,h,y,E),a.ref!==c.ref&&(c.flags|=512,c.flags|=2097152);else{if(!y){if(c.stateNode===null)throw Error(n(166));return xr(c),null}if(a=yl(Ei.current),Ip(c)){y=c.stateNode,h=c.type;var P=c.memoizedProps;switch(y[ki]=c,y[Zd]=P,a=(c.mode&1)!==0,h){case"dialog":sn("cancel",y),sn("close",y);break;case"iframe":case"object":case"embed":sn("load",y);break;case"video":case"audio":for(E=0;E<zd.length;E++)sn(zd[E],y);break;case"source":sn("error",y);break;case"img":case"image":case"link":sn("error",y),sn("load",y);break;case"details":sn("toggle",y);break;case"input":Qt(y,P),sn("invalid",y);break;case"select":y._wrapperState={wasMultiple:!!P.multiple},sn("invalid",y);break;case"textarea":Lt(y,P),sn("invalid",y)}Ms(h,P),E=null;for(var L in P)if(P.hasOwnProperty(L)){var z=P[L];L==="children"?typeof z=="string"?y.textContent!==z&&(P.suppressHydrationWarning!==!0&&kp(y.textContent,z,a),E=["children",z]):typeof z=="number"&&y.textContent!==""+z&&(P.suppressHydrationWarning!==!0&&kp(y.textContent,z,a),E=["children",""+z]):s.hasOwnProperty(L)&&z!=null&&L==="onScroll"&&sn("scroll",y)}switch(h){case"input":Be(y),qe(y,P,!0);break;case"textarea":Be(y),Pt(y);break;case"select":case"option":break;default:typeof P.onClick=="function"&&(y.onclick=Ep)}y=E,c.updateQueue=y,y!==null&&(c.flags|=4)}else{L=E.nodeType===9?E:E.ownerDocument,a==="http://www.w3.org/1999/xhtml"&&(a=is(h)),a==="http://www.w3.org/1999/xhtml"?h==="script"?(a=L.createElement("div"),a.innerHTML="<script><\/script>",a=a.removeChild(a.firstChild)):typeof y.is=="string"?a=L.createElement(h,{is:y.is}):(a=L.createElement(h),h==="select"&&(L=a,y.multiple?L.multiple=!0:y.size&&(L.size=y.size))):a=L.createElementNS(a,h),a[ki]=c,a[Zd]=y,mS(a,c,!1,!1),c.stateNode=a;e:{switch(L=yr(h,y),h){case"dialog":sn("cancel",a),sn("close",a),E=y;break;case"iframe":case"object":case"embed":sn("load",a),E=y;break;case"video":case"audio":for(E=0;E<zd.length;E++)sn(zd[E],a);E=y;break;case"source":sn("error",a),E=y;break;case"img":case"image":case"link":sn("error",a),sn("load",a),E=y;break;case"details":sn("toggle",a),E=y;break;case"input":Qt(a,y),E=Ot(a,y),sn("invalid",a);break;case"option":E=y;break;case"select":a._wrapperState={wasMultiple:!!y.multiple},E=Z({},y,{value:void 0}),sn("invalid",a);break;case"textarea":Lt(a,y),E=Ye(a,y),sn("invalid",a);break;default:E=y}Ms(h,E),z=E;for(P in z)if(z.hasOwnProperty(P)){var q=z[P];P==="style"?vn(a,q):P==="dangerouslySetInnerHTML"?(q=q?q.__html:void 0,q!=null&&Ko(a,q)):P==="children"?typeof q=="string"?(h!=="textarea"||q!=="")&&Ln(a,q):typeof q=="number"&&Ln(a,""+q):P!=="suppressContentEditableWarning"&&P!=="suppressHydrationWarning"&&P!=="autoFocus"&&(s.hasOwnProperty(P)?q!=null&&P==="onScroll"&&sn("scroll",a):q!=null&&C(a,P,q,L))}switch(h){case"input":Be(a),qe(a,y,!1);break;case"textarea":Be(a),Pt(a);break;case"option":y.value!=null&&a.setAttribute("value",""+ue(y.value));break;case"select":a.multiple=!!y.multiple,P=y.value,P!=null?Ae(a,!!y.multiple,P,!1):y.defaultValue!=null&&Ae(a,!!y.multiple,y.defaultValue,!0);break;default:typeof E.onClick=="function"&&(a.onclick=Ep)}switch(h){case"button":case"input":case"select":case"textarea":y=!!y.autoFocus;break e;case"img":y=!0;break e;default:y=!1}}y&&(c.flags|=4)}c.ref!==null&&(c.flags|=512,c.flags|=2097152)}return xr(c),null;case 6:if(a&&c.stateNode!=null)vS(a,c,a.memoizedProps,y);else{if(typeof y!="string"&&c.stateNode===null)throw Error(n(166));if(h=yl(Yd.current),yl(Ei.current),Ip(c)){if(y=c.stateNode,h=c.memoizedProps,y[ki]=c,(P=y.nodeValue!==h)&&(a=hs,a!==null))switch(a.tag){case 3:kp(y.nodeValue,h,(a.mode&1)!==0);break;case 5:a.memoizedProps.suppressHydrationWarning!==!0&&kp(y.nodeValue,h,(a.mode&1)!==0)}P&&(c.flags|=4)}else y=(h.nodeType===9?h:h.ownerDocument).createTextNode(y),y[ki]=c,c.stateNode=y}return xr(c),null;case 13:if(on(_n),y=c.memoizedState,a===null||a.memoizedState!==null&&a.memoizedState.dehydrated!==null){if(fn&&ps!==null&&(c.mode&1)!==0&&(c.flags&128)===0)w6(),Wc(),c.flags|=98560,P=!1;else if(P=Ip(c),y!==null&&y.dehydrated!==null){if(a===null){if(!P)throw Error(n(318));if(P=c.memoizedState,P=P!==null?P.dehydrated:null,!P)throw Error(n(317));P[ki]=c}else Wc(),(c.flags&128)===0&&(c.memoizedState=null),c.flags|=4;xr(c),P=!1}else si!==null&&($1(si),si=null),P=!0;if(!P)return c.flags&65536?c:null}return(c.flags&128)!==0?(c.lanes=h,c):(y=y!==null,y!==(a!==null&&a.memoizedState!==null)&&y&&(c.child.flags|=8192,(c.mode&1)!==0&&(a===null||(_n.current&1)!==0?Wn===0&&(Wn=3):H1())),c.updateQueue!==null&&(c.flags|=4),xr(c),null);case 4:return Yc(),P1(a,c),a===null&&Ud(c.stateNode.containerInfo),xr(c),null;case 10:return t1(c.type._context),xr(c),null;case 17:return zr(c.type)&&Pp(),xr(c),null;case 19:if(on(_n),P=c.memoizedState,P===null)return xr(c),null;if(y=(c.flags&128)!==0,L=P.rendering,L===null)if(y)tf(P,!1);else{if(Wn!==0||a!==null&&(a.flags&128)!==0)for(a=c.child;a!==null;){if(L=$p(a),L!==null){for(c.flags|=128,tf(P,!1),y=L.updateQueue,y!==null&&(c.updateQueue=y,c.flags|=4),c.subtreeFlags=0,y=h,h=c.child;h!==null;)P=h,a=y,P.flags&=14680066,L=P.alternate,L===null?(P.childLanes=0,P.lanes=a,P.child=null,P.subtreeFlags=0,P.memoizedProps=null,P.memoizedState=null,P.updateQueue=null,P.dependencies=null,P.stateNode=null):(P.childLanes=L.childLanes,P.lanes=L.lanes,P.child=L.child,P.subtreeFlags=0,P.deletions=null,P.memoizedProps=L.memoizedProps,P.memoizedState=L.memoizedState,P.updateQueue=L.updateQueue,P.type=L.type,a=L.dependencies,P.dependencies=a===null?null:{lanes:a.lanes,firstContext:a.firstContext}),h=h.sibling;return en(_n,_n.current&1|2),c.child}a=a.sibling}P.tail!==null&&Jt()>eu&&(c.flags|=128,y=!0,tf(P,!1),c.lanes=4194304)}else{if(!y)if(a=$p(L),a!==null){if(c.flags|=128,y=!0,h=a.updateQueue,h!==null&&(c.updateQueue=h,c.flags|=4),tf(P,!0),P.tail===null&&P.tailMode==="hidden"&&!L.alternate&&!fn)return xr(c),null}else 2*Jt()-P.renderingStartTime>eu&&h!==1073741824&&(c.flags|=128,y=!0,tf(P,!1),c.lanes=4194304);P.isBackwards?(L.sibling=c.child,c.child=L):(h=P.last,h!==null?h.sibling=L:c.child=L,P.last=L)}return P.tail!==null?(c=P.tail,P.rendering=c,P.tail=c.sibling,P.renderingStartTime=Jt(),c.sibling=null,h=_n.current,en(_n,y?h&1|2:h&1),c):(xr(c),null);case 22:case 23:return V1(),y=c.memoizedState!==null,a!==null&&a.memoizedState!==null!==y&&(c.flags|=8192),y&&(c.mode&1)!==0?(ms&1073741824)!==0&&(xr(c),c.subtreeFlags&6&&(c.flags|=8192)):xr(c),null;case 24:return null;case 25:return null}throw Error(n(156,c.tag))}function FD(a,c){switch(Kv(c),c.tag){case 1:return zr(c.type)&&Pp(),a=c.flags,a&65536?(c.flags=a&-65537|128,c):null;case 3:return Yc(),on(Hr),on(_r),l1(),a=c.flags,(a&65536)!==0&&(a&128)===0?(c.flags=a&-65537|128,c):null;case 5:return o1(c),null;case 13:if(on(_n),a=c.memoizedState,a!==null&&a.dehydrated!==null){if(c.alternate===null)throw Error(n(340));Wc()}return a=c.flags,a&65536?(c.flags=a&-65537|128,c):null;case 19:return on(_n),null;case 4:return Yc(),null;case 10:return t1(c.type._context),null;case 22:case 23:return V1(),null;case 24:return null;default:return null}}var qp=!1,br=!1,VD=typeof WeakSet=="function"?WeakSet:Set,Ne=null;function Qc(a,c){var h=a.ref;if(h!==null)if(typeof h=="function")try{h(null)}catch(y){Cn(a,c,y)}else h.current=null}function T1(a,c,h){try{h()}catch(y){Cn(a,c,y)}}var yS=!1;function HD(a,c){if(Vv=Pr,a=Y4(),Iv(a)){if("selectionStart"in a)var h={start:a.selectionStart,end:a.selectionEnd};else e:{h=(h=a.ownerDocument)&&h.defaultView||window;var y=h.getSelection&&h.getSelection();if(y&&y.rangeCount!==0){h=y.anchorNode;var E=y.anchorOffset,P=y.focusNode;y=y.focusOffset;try{h.nodeType,P.nodeType}catch{h=null;break e}var L=0,z=-1,q=-1,se=0,ge=0,ye=a,me=null;t:for(;;){for(var Me;ye!==h||E!==0&&ye.nodeType!==3||(z=L+E),ye!==P||y!==0&&ye.nodeType!==3||(q=L+y),ye.nodeType===3&&(L+=ye.nodeValue.length),(Me=ye.firstChild)!==null;)me=ye,ye=Me;for(;;){if(ye===a)break t;if(me===h&&++se===E&&(z=L),me===P&&++ge===y&&(q=L),(Me=ye.nextSibling)!==null)break;ye=me,me=ye.parentNode}ye=Me}h=z===-1||q===-1?null:{start:z,end:q}}else h=null}h=h||{start:0,end:0}}else h=null;for(Hv={focusedElem:a,selectionRange:h},Pr=!1,Ne=c;Ne!==null;)if(c=Ne,a=c.child,(c.subtreeFlags&1028)!==0&&a!==null)a.return=c,Ne=a;else for(;Ne!==null;){c=Ne;try{var Fe=c.alternate;if((c.flags&1024)!==0)switch(c.tag){case 0:case 11:case 15:break;case 1:if(Fe!==null){var He=Fe.memoizedProps,Rn=Fe.memoizedState,te=c.stateNode,X=te.getSnapshotBeforeUpdate(c.elementType===c.type?He:ii(c.type,He),Rn);te.__reactInternalSnapshotBeforeUpdate=X}break;case 3:var ne=c.stateNode.containerInfo;ne.nodeType===1?ne.textContent="":ne.nodeType===9&&ne.documentElement&&ne.removeChild(ne.documentElement);break;case 5:case 6:case 4:case 17:break;default:throw Error(n(163))}}catch(be){Cn(c,c.return,be)}if(a=c.sibling,a!==null){a.return=c.return,Ne=a;break}Ne=c.return}return Fe=yS,yS=!1,Fe}function nf(a,c,h){var y=c.updateQueue;if(y=y!==null?y.lastEffect:null,y!==null){var E=y=y.next;do{if((E.tag&a)===a){var P=E.destroy;E.destroy=void 0,P!==void 0&&T1(c,h,P)}E=E.next}while(E!==y)}}function Gp(a,c){if(c=c.updateQueue,c=c!==null?c.lastEffect:null,c!==null){var h=c=c.next;do{if((h.tag&a)===a){var y=h.create;h.destroy=y()}h=h.next}while(h!==c)}}function A1(a){var c=a.ref;if(c!==null){var h=a.stateNode;switch(a.tag){case 5:a=h;break;default:a=h}typeof c=="function"?c(a):c.current=a}}function _S(a){var c=a.alternate;c!==null&&(a.alternate=null,_S(c)),a.child=null,a.deletions=null,a.sibling=null,a.tag===5&&(c=a.stateNode,c!==null&&(delete c[ki],delete c[Zd],delete c[Zv],delete c[SD],delete c[kD])),a.stateNode=null,a.return=null,a.dependencies=null,a.memoizedProps=null,a.memoizedState=null,a.pendingProps=null,a.stateNode=null,a.updateQueue=null}function wS(a){return a.tag===5||a.tag===3||a.tag===4}function xS(a){e:for(;;){for(;a.sibling===null;){if(a.return===null||wS(a.return))return null;a=a.return}for(a.sibling.return=a.return,a=a.sibling;a.tag!==5&&a.tag!==6&&a.tag!==18;){if(a.flags&2||a.child===null||a.tag===4)continue e;a.child.return=a,a=a.child}if(!(a.flags&2))return a.stateNode}}function R1(a,c,h){var y=a.tag;if(y===5||y===6)a=a.stateNode,c?h.nodeType===8?h.parentNode.insertBefore(a,c):h.insertBefore(a,c):(h.nodeType===8?(c=h.parentNode,c.insertBefore(a,h)):(c=h,c.appendChild(a)),h=h._reactRootContainer,h!=null||c.onclick!==null||(c.onclick=Ep));else if(y!==4&&(a=a.child,a!==null))for(R1(a,c,h),a=a.sibling;a!==null;)R1(a,c,h),a=a.sibling}function M1(a,c,h){var y=a.tag;if(y===5||y===6)a=a.stateNode,c?h.insertBefore(a,c):h.appendChild(a);else if(y!==4&&(a=a.child,a!==null))for(M1(a,c,h),a=a.sibling;a!==null;)M1(a,c,h),a=a.sibling}var cr=null,oi=!1;function la(a,c,h){for(h=h.child;h!==null;)bS(a,c,h),h=h.sibling}function bS(a,c,h){if(Ls&&typeof Ls.onCommitFiberUnmount=="function")try{Ls.onCommitFiberUnmount(Ac,h)}catch{}switch(h.tag){case 5:br||Qc(h,c);case 6:var y=cr,E=oi;cr=null,la(a,c,h),cr=y,oi=E,cr!==null&&(oi?(a=cr,h=h.stateNode,a.nodeType===8?a.parentNode.removeChild(h):a.removeChild(h)):cr.removeChild(h.stateNode));break;case 18:cr!==null&&(oi?(a=cr,h=h.stateNode,a.nodeType===8?Bv(a.parentNode,h):a.nodeType===1&&Bv(a,h),rn(a)):Bv(cr,h.stateNode));break;case 4:y=cr,E=oi,cr=h.stateNode.containerInfo,oi=!0,la(a,c,h),cr=y,oi=E;break;case 0:case 11:case 14:case 15:if(!br&&(y=h.updateQueue,y!==null&&(y=y.lastEffect,y!==null))){E=y=y.next;do{var P=E,L=P.destroy;P=P.tag,L!==void 0&&((P&2)!==0||(P&4)!==0)&&T1(h,c,L),E=E.next}while(E!==y)}la(a,c,h);break;case 1:if(!br&&(Qc(h,c),y=h.stateNode,typeof y.componentWillUnmount=="function"))try{y.props=h.memoizedProps,y.state=h.memoizedState,y.componentWillUnmount()}catch(z){Cn(h,c,z)}la(a,c,h);break;case 21:la(a,c,h);break;case 22:h.mode&1?(br=(y=br)||h.memoizedState!==null,la(a,c,h),br=y):la(a,c,h);break;default:la(a,c,h)}}function SS(a){var c=a.updateQueue;if(c!==null){a.updateQueue=null;var h=a.stateNode;h===null&&(h=a.stateNode=new VD),c.forEach(function(y){var E=YD.bind(null,a,y);h.has(y)||(h.add(y),y.then(E,E))})}}function ai(a,c){var h=c.deletions;if(h!==null)for(var y=0;y<h.length;y++){var E=h[y];try{var P=a,L=c,z=L;e:for(;z!==null;){switch(z.tag){case 5:cr=z.stateNode,oi=!1;break e;case 3:cr=z.stateNode.containerInfo,oi=!0;break e;case 4:cr=z.stateNode.containerInfo,oi=!0;break e}z=z.return}if(cr===null)throw Error(n(160));bS(P,L,E),cr=null,oi=!1;var q=E.alternate;q!==null&&(q.return=null),E.return=null}catch(se){Cn(E,c,se)}}if(c.subtreeFlags&12854)for(c=c.child;c!==null;)kS(c,a),c=c.sibling}function kS(a,c){var h=a.alternate,y=a.flags;switch(a.tag){case 0:case 11:case 14:case 15:if(ai(c,a),Pi(a),y&4){try{nf(3,a,a.return),Gp(3,a)}catch(He){Cn(a,a.return,He)}try{nf(5,a,a.return)}catch(He){Cn(a,a.return,He)}}break;case 1:ai(c,a),Pi(a),y&512&&h!==null&&Qc(h,h.return);break;case 5:if(ai(c,a),Pi(a),y&512&&h!==null&&Qc(h,h.return),a.flags&32){var E=a.stateNode;try{Ln(E,"")}catch(He){Cn(a,a.return,He)}}if(y&4&&(E=a.stateNode,E!=null)){var P=a.memoizedProps,L=h!==null?h.memoizedProps:P,z=a.type,q=a.updateQueue;if(a.updateQueue=null,q!==null)try{z==="input"&&P.type==="radio"&&P.name!=null&&bt(E,P),yr(z,L);var se=yr(z,P);for(L=0;L<q.length;L+=2){var ge=q[L],ye=q[L+1];ge==="style"?vn(E,ye):ge==="dangerouslySetInnerHTML"?Ko(E,ye):ge==="children"?Ln(E,ye):C(E,ge,ye,se)}switch(z){case"input":_t(E,P);break;case"textarea":Ge(E,P);break;case"select":var me=E._wrapperState.wasMultiple;E._wrapperState.wasMultiple=!!P.multiple;var Me=P.value;Me!=null?Ae(E,!!P.multiple,Me,!1):me!==!!P.multiple&&(P.defaultValue!=null?Ae(E,!!P.multiple,P.defaultValue,!0):Ae(E,!!P.multiple,P.multiple?[]:"",!1))}E[Zd]=P}catch(He){Cn(a,a.return,He)}}break;case 6:if(ai(c,a),Pi(a),y&4){if(a.stateNode===null)throw Error(n(162));E=a.stateNode,P=a.memoizedProps;try{E.nodeValue=P}catch(He){Cn(a,a.return,He)}}break;case 3:if(ai(c,a),Pi(a),y&4&&h!==null&&h.memoizedState.isDehydrated)try{rn(c.containerInfo)}catch(He){Cn(a,a.return,He)}break;case 4:ai(c,a),Pi(a);break;case 13:ai(c,a),Pi(a),E=a.child,E.flags&8192&&(P=E.memoizedState!==null,E.stateNode.isHidden=P,!P||E.alternate!==null&&E.alternate.memoizedState!==null||(L1=Jt())),y&4&&SS(a);break;case 22:if(ge=h!==null&&h.memoizedState!==null,a.mode&1?(br=(se=br)||ge,ai(c,a),br=se):ai(c,a),Pi(a),y&8192){if(se=a.memoizedState!==null,(a.stateNode.isHidden=se)&&!ge&&(a.mode&1)!==0)for(Ne=a,ge=a.child;ge!==null;){for(ye=Ne=ge;Ne!==null;){switch(me=Ne,Me=me.child,me.tag){case 0:case 11:case 14:case 15:nf(4,me,me.return);break;case 1:Qc(me,me.return);var Fe=me.stateNode;if(typeof Fe.componentWillUnmount=="function"){y=me,h=me.return;try{c=y,Fe.props=c.memoizedProps,Fe.state=c.memoizedState,Fe.componentWillUnmount()}catch(He){Cn(y,h,He)}}break;case 5:Qc(me,me.return);break;case 22:if(me.memoizedState!==null){PS(ye);continue}}Me!==null?(Me.return=me,Ne=Me):PS(ye)}ge=ge.sibling}e:for(ge=null,ye=a;;){if(ye.tag===5){if(ge===null){ge=ye;try{E=ye.stateNode,se?(P=E.style,typeof P.setProperty=="function"?P.setProperty("display","none","important"):P.display="none"):(z=ye.stateNode,q=ye.memoizedProps.style,L=q!=null&&q.hasOwnProperty("display")?q.display:null,z.style.display=gn("display",L))}catch(He){Cn(a,a.return,He)}}}else if(ye.tag===6){if(ge===null)try{ye.stateNode.nodeValue=se?"":ye.memoizedProps}catch(He){Cn(a,a.return,He)}}else if((ye.tag!==22&&ye.tag!==23||ye.memoizedState===null||ye===a)&&ye.child!==null){ye.child.return=ye,ye=ye.child;continue}if(ye===a)break e;for(;ye.sibling===null;){if(ye.return===null||ye.return===a)break e;ge===ye&&(ge=null),ye=ye.return}ge===ye&&(ge=null),ye.sibling.return=ye.return,ye=ye.sibling}}break;case 19:ai(c,a),Pi(a),y&4&&SS(a);break;case 21:break;default:ai(c,a),Pi(a)}}function Pi(a){var c=a.flags;if(c&2){try{e:{for(var h=a.return;h!==null;){if(wS(h)){var y=h;break e}h=h.return}throw Error(n(160))}switch(y.tag){case 5:var E=y.stateNode;y.flags&32&&(Ln(E,""),y.flags&=-33);var P=xS(a);M1(a,P,E);break;case 3:case 4:var L=y.stateNode.containerInfo,z=xS(a);R1(a,z,L);break;default:throw Error(n(161))}}catch(q){Cn(a,a.return,q)}a.flags&=-3}c&4096&&(a.flags&=-4097)}function zD(a,c,h){Ne=a,ES(a)}function ES(a,c,h){for(var y=(a.mode&1)!==0;Ne!==null;){var E=Ne,P=E.child;if(E.tag===22&&y){var L=E.memoizedState!==null||qp;if(!L){var z=E.alternate,q=z!==null&&z.memoizedState!==null||br;z=qp;var se=br;if(qp=L,(br=q)&&!se)for(Ne=E;Ne!==null;)L=Ne,q=L.child,L.tag===22&&L.memoizedState!==null?TS(E):q!==null?(q.return=L,Ne=q):TS(E);for(;P!==null;)Ne=P,ES(P),P=P.sibling;Ne=E,qp=z,br=se}CS(a)}else(E.subtreeFlags&8772)!==0&&P!==null?(P.return=E,Ne=P):CS(a)}}function CS(a){for(;Ne!==null;){var c=Ne;if((c.flags&8772)!==0){var h=c.alternate;try{if((c.flags&8772)!==0)switch(c.tag){case 0:case 11:case 15:br||Gp(5,c);break;case 1:var y=c.stateNode;if(c.flags&4&&!br)if(h===null)y.componentDidMount();else{var E=c.elementType===c.type?h.memoizedProps:ii(c.type,h.memoizedProps);y.componentDidUpdate(E,h.memoizedState,y.__reactInternalSnapshotBeforeUpdate)}var P=c.updateQueue;P!==null&&P6(c,P,y);break;case 3:var L=c.updateQueue;if(L!==null){if(h=null,c.child!==null)switch(c.child.tag){case 5:h=c.child.stateNode;break;case 1:h=c.child.stateNode}P6(c,L,h)}break;case 5:var z=c.stateNode;if(h===null&&c.flags&4){h=z;var q=c.memoizedProps;switch(c.type){case"button":case"input":case"select":case"textarea":q.autoFocus&&h.focus();break;case"img":q.src&&(h.src=q.src)}}break;case 6:break;case 4:break;case 12:break;case 13:if(c.memoizedState===null){var se=c.alternate;if(se!==null){var ge=se.memoizedState;if(ge!==null){var ye=ge.dehydrated;ye!==null&&rn(ye)}}}break;case 19:case 17:case 21:case 22:case 23:case 25:break;default:throw Error(n(163))}br||c.flags&512&&A1(c)}catch(me){Cn(c,c.return,me)}}if(c===a){Ne=null;break}if(h=c.sibling,h!==null){h.return=c.return,Ne=h;break}Ne=c.return}}function PS(a){for(;Ne!==null;){var c=Ne;if(c===a){Ne=null;break}var h=c.sibling;if(h!==null){h.return=c.return,Ne=h;break}Ne=c.return}}function TS(a){for(;Ne!==null;){var c=Ne;try{switch(c.tag){case 0:case 11:case 15:var h=c.return;try{Gp(4,c)}catch(q){Cn(c,h,q)}break;case 1:var y=c.stateNode;if(typeof y.componentDidMount=="function"){var E=c.return;try{y.componentDidMount()}catch(q){Cn(c,E,q)}}var P=c.return;try{A1(c)}catch(q){Cn(c,P,q)}break;case 5:var L=c.return;try{A1(c)}catch(q){Cn(c,L,q)}}}catch(q){Cn(c,c.return,q)}if(c===a){Ne=null;break}var z=c.sibling;if(z!==null){z.return=c.return,Ne=z;break}Ne=c.return}}var UD=Math.ceil,Kp=T.ReactCurrentDispatcher,I1=T.ReactCurrentOwner,Vs=T.ReactCurrentBatchConfig,At=0,tr=null,jn=null,ur=0,ms=0,Jc=ra(0),Wn=0,rf=null,wl=0,Yp=0,O1=0,sf=null,Br=null,L1=0,eu=1/0,go=null,Xp=!1,N1=null,ca=null,Qp=!1,ua=null,Jp=0,of=0,D1=null,e0=-1,t0=0;function Ar(){return(At&6)!==0?Jt():e0!==-1?e0:e0=Jt()}function da(a){return(a.mode&1)===0?1:(At&2)!==0&&ur!==0?ur&-ur:CD.transition!==null?(t0===0&&(t0=cp()),t0):(a=Ft,a!==0||(a=window.event,a=a===void 0?16:R4(a.type)),a)}function li(a,c,h,y){if(50<of)throw of=0,D1=null,Error(n(185));oo(a,h,y),((At&2)===0||a!==tr)&&(a===tr&&((At&2)===0&&(Yp|=h),Wn===4&&fa(a,ur)),Zr(a,y),h===1&&At===0&&(c.mode&1)===0&&(eu=Jt()+500,Ap&&ia()))}function Zr(a,c){var h=a.callbackNode;bv(a,c);var y=Ic(a,a===tr?ur:0);if(y===0)h!==null&&Yo(h),a.callbackNode=null,a.callbackPriority=0;else if(c=y&-y,a.callbackPriority!==c){if(h!=null&&Yo(h),c===1)a.tag===0?ED(RS.bind(null,a)):m6(RS.bind(null,a)),xD(function(){(At&6)===0&&ia()}),h=null;else{switch(ao(y)){case 1:h=Pd;break;case 4:h=ap;break;case 16:h=Xo;break;case 536870912:h=Ad;break;default:h=Xo}h=$S(h,AS.bind(null,a))}a.callbackPriority=c,a.callbackNode=h}}function AS(a,c){if(e0=-1,t0=0,(At&6)!==0)throw Error(n(327));var h=a.callbackNode;if(tu()&&a.callbackNode!==h)return null;var y=Ic(a,a===tr?ur:0);if(y===0)return null;if((y&30)!==0||(y&a.expiredLanes)!==0||c)c=n0(a,y);else{c=y;var E=At;At|=2;var P=IS();(tr!==a||ur!==c)&&(go=null,eu=Jt()+500,bl(a,c));do try{WD();break}catch(z){MS(a,z)}while(!0);e1(),Kp.current=P,At=E,jn!==null?c=0:(tr=null,ur=0,c=Wn)}if(c!==0){if(c===2&&(E=Id(a),E!==0&&(y=E,c=j1(a,E))),c===1)throw h=rf,bl(a,0),fa(a,y),Zr(a,Jt()),h;if(c===6)fa(a,y);else{if(E=a.current.alternate,(y&30)===0&&!BD(E)&&(c=n0(a,y),c===2&&(P=Id(a),P!==0&&(y=P,c=j1(a,P))),c===1))throw h=rf,bl(a,0),fa(a,y),Zr(a,Jt()),h;switch(a.finishedWork=E,a.finishedLanes=y,c){case 0:case 1:throw Error(n(345));case 2:Sl(a,Br,go);break;case 3:if(fa(a,y),(y&130023424)===y&&(c=L1+500-Jt(),10<c)){if(Ic(a,0)!==0)break;if(E=a.suspendedLanes,(E&y)!==y){Ar(),a.pingedLanes|=a.suspendedLanes&E;break}a.timeoutHandle=Uv(Sl.bind(null,a,Br,go),c);break}Sl(a,Br,go);break;case 4:if(fa(a,y),(y&4194240)===y)break;for(c=a.eventTimes,E=-1;0<y;){var L=31-ls(y);P=1<<L,L=c[L],L>E&&(E=L),y&=~P}if(y=E,y=Jt()-y,y=(120>y?120:480>y?480:1080>y?1080:1920>y?1920:3e3>y?3e3:4320>y?4320:1960*UD(y/1960))-y,10<y){a.timeoutHandle=Uv(Sl.bind(null,a,Br,go),y);break}Sl(a,Br,go);break;case 5:Sl(a,Br,go);break;default:throw Error(n(329))}}}return Zr(a,Jt()),a.callbackNode===h?AS.bind(null,a):null}function j1(a,c){var h=sf;return a.current.memoizedState.isDehydrated&&(bl(a,c).flags|=256),a=n0(a,c),a!==2&&(c=Br,Br=h,c!==null&&$1(c)),a}function $1(a){Br===null?Br=a:Br.push.apply(Br,a)}function BD(a){for(var c=a;;){if(c.flags&16384){var h=c.updateQueue;if(h!==null&&(h=h.stores,h!==null))for(var y=0;y<h.length;y++){var E=h[y],P=E.getSnapshot;E=E.value;try{if(!ri(P(),E))return!1}catch{return!1}}}if(h=c.child,c.subtreeFlags&16384&&h!==null)h.return=c,c=h;else{if(c===a)break;for(;c.sibling===null;){if(c.return===null||c.return===a)return!0;c=c.return}c.sibling.return=c.return,c=c.sibling}}return!0}function fa(a,c){for(c&=~O1,c&=~Yp,a.suspendedLanes|=c,a.pingedLanes&=~c,a=a.expirationTimes;0<c;){var h=31-ls(c),y=1<<h;a[h]=-1,c&=~y}}function RS(a){if((At&6)!==0)throw Error(n(327));tu();var c=Ic(a,0);if((c&1)===0)return Zr(a,Jt()),null;var h=n0(a,c);if(a.tag!==0&&h===2){var y=Id(a);y!==0&&(c=y,h=j1(a,y))}if(h===1)throw h=rf,bl(a,0),fa(a,c),Zr(a,Jt()),h;if(h===6)throw Error(n(345));return a.finishedWork=a.current.alternate,a.finishedLanes=c,Sl(a,Br,go),Zr(a,Jt()),null}function F1(a,c){var h=At;At|=1;try{return a(c)}finally{At=h,At===0&&(eu=Jt()+500,Ap&&ia())}}function xl(a){ua!==null&&ua.tag===0&&(At&6)===0&&tu();var c=At;At|=1;var h=Vs.transition,y=Ft;try{if(Vs.transition=null,Ft=1,a)return a()}finally{Ft=y,Vs.transition=h,At=c,(At&6)===0&&ia()}}function V1(){ms=Jc.current,on(Jc)}function bl(a,c){a.finishedWork=null,a.finishedLanes=0;var h=a.timeoutHandle;if(h!==-1&&(a.timeoutHandle=-1,wD(h)),jn!==null)for(h=jn.return;h!==null;){var y=h;switch(Kv(y),y.tag){case 1:y=y.type.childContextTypes,y!=null&&Pp();break;case 3:Yc(),on(Hr),on(_r),l1();break;case 5:o1(y);break;case 4:Yc();break;case 13:on(_n);break;case 19:on(_n);break;case 10:t1(y.type._context);break;case 22:case 23:V1()}h=h.return}if(tr=a,jn=a=ha(a.current,null),ur=ms=c,Wn=0,rf=null,O1=Yp=wl=0,Br=sf=null,vl!==null){for(c=0;c<vl.length;c++)if(h=vl[c],y=h.interleaved,y!==null){h.interleaved=null;var E=y.next,P=h.pending;if(P!==null){var L=P.next;P.next=E,y.next=L}h.pending=y}vl=null}return a}function MS(a,c){do{var h=jn;try{if(e1(),Fp.current=Up,Vp){for(var y=wn.memoizedState;y!==null;){var E=y.queue;E!==null&&(E.pending=null),y=y.next}Vp=!1}if(_l=0,er=Zn=wn=null,Xd=!1,Qd=0,I1.current=null,h===null||h.return===null){Wn=1,rf=c,jn=null;break}e:{var P=a,L=h.return,z=h,q=c;if(c=ur,z.flags|=32768,q!==null&&typeof q=="object"&&typeof q.then=="function"){var se=q,ge=z,ye=ge.tag;if((ge.mode&1)===0&&(ye===0||ye===11||ye===15)){var me=ge.alternate;me?(ge.updateQueue=me.updateQueue,ge.memoizedState=me.memoizedState,ge.lanes=me.lanes):(ge.updateQueue=null,ge.memoizedState=null)}var Me=nS(L);if(Me!==null){Me.flags&=-257,rS(Me,L,z,P,c),Me.mode&1&&tS(P,se,c),c=Me,q=se;var Fe=c.updateQueue;if(Fe===null){var He=new Set;He.add(q),c.updateQueue=He}else Fe.add(q);break e}else{if((c&1)===0){tS(P,se,c),H1();break e}q=Error(n(426))}}else if(fn&&z.mode&1){var Rn=nS(L);if(Rn!==null){(Rn.flags&65536)===0&&(Rn.flags|=256),rS(Rn,L,z,P,c),Qv(Xc(q,z));break e}}P=q=Xc(q,z),Wn!==4&&(Wn=2),sf===null?sf=[P]:sf.push(P),P=L;do{switch(P.tag){case 3:P.flags|=65536,c&=-c,P.lanes|=c;var te=J6(P,q,c);C6(P,te);break e;case 1:z=q;var X=P.type,ne=P.stateNode;if((P.flags&128)===0&&(typeof X.getDerivedStateFromError=="function"||ne!==null&&typeof ne.componentDidCatch=="function"&&(ca===null||!ca.has(ne)))){P.flags|=65536,c&=-c,P.lanes|=c;var be=eS(P,z,c);C6(P,be);break e}}P=P.return}while(P!==null)}LS(h)}catch(ze){c=ze,jn===h&&h!==null&&(jn=h=h.return);continue}break}while(!0)}function IS(){var a=Kp.current;return Kp.current=Up,a===null?Up:a}function H1(){(Wn===0||Wn===3||Wn===2)&&(Wn=4),tr===null||(wl&268435455)===0&&(Yp&268435455)===0||fa(tr,ur)}function n0(a,c){var h=At;At|=2;var y=IS();(tr!==a||ur!==c)&&(go=null,bl(a,c));do try{ZD();break}catch(E){MS(a,E)}while(!0);if(e1(),At=h,Kp.current=y,jn!==null)throw Error(n(261));return tr=null,ur=0,Wn}function ZD(){for(;jn!==null;)OS(jn)}function WD(){for(;jn!==null&&!Cd();)OS(jn)}function OS(a){var c=jS(a.alternate,a,ms);a.memoizedProps=a.pendingProps,c===null?LS(a):jn=c,I1.current=null}function LS(a){var c=a;do{var h=c.alternate;if(a=c.return,(c.flags&32768)===0){if(h=$D(h,c,ms),h!==null){jn=h;return}}else{if(h=FD(h,c),h!==null){h.flags&=32767,jn=h;return}if(a!==null)a.flags|=32768,a.subtreeFlags=0,a.deletions=null;else{Wn=6,jn=null;return}}if(c=c.sibling,c!==null){jn=c;return}jn=c=a}while(c!==null);Wn===0&&(Wn=5)}function Sl(a,c,h){var y=Ft,E=Vs.transition;try{Vs.transition=null,Ft=1,qD(a,c,h,y)}finally{Vs.transition=E,Ft=y}return null}function qD(a,c,h,y){do tu();while(ua!==null);if((At&6)!==0)throw Error(n(327));h=a.finishedWork;var E=a.finishedLanes;if(h===null)return null;if(a.finishedWork=null,a.finishedLanes=0,h===a.current)throw Error(n(177));a.callbackNode=null,a.callbackPriority=0;var P=h.lanes|h.childLanes;if(up(a,P),a===tr&&(jn=tr=null,ur=0),(h.subtreeFlags&2064)===0&&(h.flags&2064)===0||Qp||(Qp=!0,$S(Xo,function(){return tu(),null})),P=(h.flags&15990)!==0,(h.subtreeFlags&15990)!==0||P){P=Vs.transition,Vs.transition=null;var L=Ft;Ft=1;var z=At;At|=4,I1.current=null,HD(a,h),kS(h,a),hD(Hv),Pr=!!Vv,Hv=Vv=null,a.current=h,zD(h),yv(),At=z,Ft=L,Vs.transition=P}else a.current=h;if(Qp&&(Qp=!1,ua=a,Jp=E),P=a.pendingLanes,P===0&&(ca=null),lp(h.stateNode),Zr(a,Jt()),c!==null)for(y=a.onRecoverableError,h=0;h<c.length;h++)E=c[h],y(E.value,{componentStack:E.stack,digest:E.digest});if(Xp)throw Xp=!1,a=N1,N1=null,a;return(Jp&1)!==0&&a.tag!==0&&tu(),P=a.pendingLanes,(P&1)!==0?a===D1?of++:(of=0,D1=a):of=0,ia(),null}function tu(){if(ua!==null){var a=ao(Jp),c=Vs.transition,h=Ft;try{if(Vs.transition=null,Ft=16>a?16:a,ua===null)var y=!1;else{if(a=ua,ua=null,Jp=0,(At&6)!==0)throw Error(n(331));var E=At;for(At|=4,Ne=a.current;Ne!==null;){var P=Ne,L=P.child;if((Ne.flags&16)!==0){var z=P.deletions;if(z!==null){for(var q=0;q<z.length;q++){var se=z[q];for(Ne=se;Ne!==null;){var ge=Ne;switch(ge.tag){case 0:case 11:case 15:nf(8,ge,P)}var ye=ge.child;if(ye!==null)ye.return=ge,Ne=ye;else for(;Ne!==null;){ge=Ne;var me=ge.sibling,Me=ge.return;if(_S(ge),ge===se){Ne=null;break}if(me!==null){me.return=Me,Ne=me;break}Ne=Me}}}var Fe=P.alternate;if(Fe!==null){var He=Fe.child;if(He!==null){Fe.child=null;do{var Rn=He.sibling;He.sibling=null,He=Rn}while(He!==null)}}Ne=P}}if((P.subtreeFlags&2064)!==0&&L!==null)L.return=P,Ne=L;else e:for(;Ne!==null;){if(P=Ne,(P.flags&2048)!==0)switch(P.tag){case 0:case 11:case 15:nf(9,P,P.return)}var te=P.sibling;if(te!==null){te.return=P.return,Ne=te;break e}Ne=P.return}}var X=a.current;for(Ne=X;Ne!==null;){L=Ne;var ne=L.child;if((L.subtreeFlags&2064)!==0&&ne!==null)ne.return=L,Ne=ne;else e:for(L=X;Ne!==null;){if(z=Ne,(z.flags&2048)!==0)try{switch(z.tag){case 0:case 11:case 15:Gp(9,z)}}catch(ze){Cn(z,z.return,ze)}if(z===L){Ne=null;break e}var be=z.sibling;if(be!==null){be.return=z.return,Ne=be;break e}Ne=z.return}}if(At=E,ia(),Ls&&typeof Ls.onPostCommitFiberRoot=="function")try{Ls.onPostCommitFiberRoot(Ac,a)}catch{}y=!0}return y}finally{Ft=h,Vs.transition=c}}return!1}function NS(a,c,h){c=Xc(h,c),c=J6(a,c,1),a=aa(a,c,1),c=Ar(),a!==null&&(oo(a,1,c),Zr(a,c))}function Cn(a,c,h){if(a.tag===3)NS(a,a,h);else for(;c!==null;){if(c.tag===3){NS(c,a,h);break}else if(c.tag===1){var y=c.stateNode;if(typeof c.type.getDerivedStateFromError=="function"||typeof y.componentDidCatch=="function"&&(ca===null||!ca.has(y))){a=Xc(h,a),a=eS(c,a,1),c=aa(c,a,1),a=Ar(),c!==null&&(oo(c,1,a),Zr(c,a));break}}c=c.return}}function GD(a,c,h){var y=a.pingCache;y!==null&&y.delete(c),c=Ar(),a.pingedLanes|=a.suspendedLanes&h,tr===a&&(ur&h)===h&&(Wn===4||Wn===3&&(ur&130023424)===ur&&500>Jt()-L1?bl(a,0):O1|=h),Zr(a,c)}function DS(a,c){c===0&&((a.mode&1)===0?c=1:(c=Mc,Mc<<=1,(Mc&130023424)===0&&(Mc=4194304)));var h=Ar();a=ho(a,c),a!==null&&(oo(a,c,h),Zr(a,h))}function KD(a){var c=a.memoizedState,h=0;c!==null&&(h=c.retryLane),DS(a,h)}function YD(a,c){var h=0;switch(a.tag){case 13:var y=a.stateNode,E=a.memoizedState;E!==null&&(h=E.retryLane);break;case 19:y=a.stateNode;break;default:throw Error(n(314))}y!==null&&y.delete(c),DS(a,h)}var jS;jS=function(a,c,h){if(a!==null)if(a.memoizedProps!==c.pendingProps||Hr.current)Ur=!0;else{if((a.lanes&h)===0&&(c.flags&128)===0)return Ur=!1,jD(a,c,h);Ur=(a.flags&131072)!==0}else Ur=!1,fn&&(c.flags&1048576)!==0&&g6(c,Mp,c.index);switch(c.lanes=0,c.tag){case 2:var y=c.type;Wp(a,c),a=c.pendingProps;var E=Uc(c,_r.current);Kc(c,h),E=d1(null,c,y,a,E,h);var P=f1();return c.flags|=1,typeof E=="object"&&E!==null&&typeof E.render=="function"&&E.$$typeof===void 0?(c.tag=1,c.memoizedState=null,c.updateQueue=null,zr(y)?(P=!0,Tp(c)):P=!1,c.memoizedState=E.state!==null&&E.state!==void 0?E.state:null,s1(c),E.updater=Bp,c.stateNode=E,E._reactInternals=c,y1(c,y,a,h),c=b1(null,c,y,!0,P,h)):(c.tag=0,fn&&P&&Gv(c),Tr(null,c,E,h),c=c.child),c;case 16:y=c.elementType;e:{switch(Wp(a,c),a=c.pendingProps,E=y._init,y=E(y._payload),c.type=y,E=c.tag=QD(y),a=ii(y,a),E){case 0:c=x1(null,c,y,a,h);break e;case 1:c=cS(null,c,y,a,h);break e;case 11:c=sS(null,c,y,a,h);break e;case 14:c=iS(null,c,y,ii(y.type,a),h);break e}throw Error(n(306,y,""))}return c;case 0:return y=c.type,E=c.pendingProps,E=c.elementType===y?E:ii(y,E),x1(a,c,y,E,h);case 1:return y=c.type,E=c.pendingProps,E=c.elementType===y?E:ii(y,E),cS(a,c,y,E,h);case 3:e:{if(uS(c),a===null)throw Error(n(387));y=c.pendingProps,P=c.memoizedState,E=P.element,E6(a,c),jp(c,y,null,h);var L=c.memoizedState;if(y=L.element,P.isDehydrated)if(P={element:y,isDehydrated:!1,cache:L.cache,pendingSuspenseBoundaries:L.pendingSuspenseBoundaries,transitions:L.transitions},c.updateQueue.baseState=P,c.memoizedState=P,c.flags&256){E=Xc(Error(n(423)),c),c=dS(a,c,y,h,E);break e}else if(y!==E){E=Xc(Error(n(424)),c),c=dS(a,c,y,h,E);break e}else for(ps=na(c.stateNode.containerInfo.firstChild),hs=c,fn=!0,si=null,h=S6(c,null,y,h),c.child=h;h;)h.flags=h.flags&-3|4096,h=h.sibling;else{if(Wc(),y===E){c=mo(a,c,h);break e}Tr(a,c,y,h)}c=c.child}return c;case 5:return T6(c),a===null&&Xv(c),y=c.type,E=c.pendingProps,P=a!==null?a.memoizedProps:null,L=E.children,zv(y,E)?L=null:P!==null&&zv(y,P)&&(c.flags|=32),lS(a,c),Tr(a,c,L,h),c.child;case 6:return a===null&&Xv(c),null;case 13:return fS(a,c,h);case 4:return i1(c,c.stateNode.containerInfo),y=c.pendingProps,a===null?c.child=qc(c,null,y,h):Tr(a,c,y,h),c.child;case 11:return y=c.type,E=c.pendingProps,E=c.elementType===y?E:ii(y,E),sS(a,c,y,E,h);case 7:return Tr(a,c,c.pendingProps,h),c.child;case 8:return Tr(a,c,c.pendingProps.children,h),c.child;case 12:return Tr(a,c,c.pendingProps.children,h),c.child;case 10:e:{if(y=c.type._context,E=c.pendingProps,P=c.memoizedProps,L=E.value,en(Lp,y._currentValue),y._currentValue=L,P!==null)if(ri(P.value,L)){if(P.children===E.children&&!Hr.current){c=mo(a,c,h);break e}}else for(P=c.child,P!==null&&(P.return=c);P!==null;){var z=P.dependencies;if(z!==null){L=P.child;for(var q=z.firstContext;q!==null;){if(q.context===y){if(P.tag===1){q=po(-1,h&-h),q.tag=2;var se=P.updateQueue;if(se!==null){se=se.shared;var ge=se.pending;ge===null?q.next=q:(q.next=ge.next,ge.next=q),se.pending=q}}P.lanes|=h,q=P.alternate,q!==null&&(q.lanes|=h),n1(P.return,h,c),z.lanes|=h;break}q=q.next}}else if(P.tag===10)L=P.type===c.type?null:P.child;else if(P.tag===18){if(L=P.return,L===null)throw Error(n(341));L.lanes|=h,z=L.alternate,z!==null&&(z.lanes|=h),n1(L,h,c),L=P.sibling}else L=P.child;if(L!==null)L.return=P;else for(L=P;L!==null;){if(L===c){L=null;break}if(P=L.sibling,P!==null){P.return=L.return,L=P;break}L=L.return}P=L}Tr(a,c,E.children,h),c=c.child}return c;case 9:return E=c.type,y=c.pendingProps.children,Kc(c,h),E=$s(E),y=y(E),c.flags|=1,Tr(a,c,y,h),c.child;case 14:return y=c.type,E=ii(y,c.pendingProps),E=ii(y.type,E),iS(a,c,y,E,h);case 15:return oS(a,c,c.type,c.pendingProps,h);case 17:return y=c.type,E=c.pendingProps,E=c.elementType===y?E:ii(y,E),Wp(a,c),c.tag=1,zr(y)?(a=!0,Tp(c)):a=!1,Kc(c,h),X6(c,y,E),y1(c,y,E,h),b1(null,c,y,!0,a,h);case 19:return pS(a,c,h);case 22:return aS(a,c,h)}throw Error(n(156,c.tag))};function $S(a,c){return Tc(a,c)}function XD(a,c,h,y){this.tag=a,this.key=h,this.sibling=this.child=this.return=this.stateNode=this.type=this.elementType=null,this.index=0,this.ref=null,this.pendingProps=c,this.dependencies=this.memoizedState=this.updateQueue=this.memoizedProps=null,this.mode=y,this.subtreeFlags=this.flags=0,this.deletions=null,this.childLanes=this.lanes=0,this.alternate=null}function Hs(a,c,h,y){return new XD(a,c,h,y)}function z1(a){return a=a.prototype,!(!a||!a.isReactComponent)}function QD(a){if(typeof a=="function")return z1(a)?1:0;if(a!=null){if(a=a.$$typeof,a===$)return 11;if(a===G)return 14}return 2}function ha(a,c){var h=a.alternate;return h===null?(h=Hs(a.tag,c,a.key,a.mode),h.elementType=a.elementType,h.type=a.type,h.stateNode=a.stateNode,h.alternate=a,a.alternate=h):(h.pendingProps=c,h.type=a.type,h.flags=0,h.subtreeFlags=0,h.deletions=null),h.flags=a.flags&14680064,h.childLanes=a.childLanes,h.lanes=a.lanes,h.child=a.child,h.memoizedProps=a.memoizedProps,h.memoizedState=a.memoizedState,h.updateQueue=a.updateQueue,c=a.dependencies,h.dependencies=c===null?null:{lanes:c.lanes,firstContext:c.firstContext},h.sibling=a.sibling,h.index=a.index,h.ref=a.ref,h}function r0(a,c,h,y,E,P){var L=2;if(y=a,typeof a=="function")z1(a)&&(L=1);else if(typeof a=="string")L=5;else e:switch(a){case M:return kl(h.children,E,P,c);case R:L=8,E|=8;break;case O:return a=Hs(12,h,c,E|2),a.elementType=O,a.lanes=P,a;case Y:return a=Hs(13,h,c,E),a.elementType=Y,a.lanes=P,a;case B:return a=Hs(19,h,c,E),a.elementType=B,a.lanes=P,a;case K:return s0(h,E,P,c);default:if(typeof a=="object"&&a!==null)switch(a.$$typeof){case N:L=10;break e;case D:L=9;break e;case $:L=11;break e;case G:L=14;break e;case V:L=16,y=null;break e}throw Error(n(130,a==null?a:typeof a,""))}return c=Hs(L,h,c,E),c.elementType=a,c.type=y,c.lanes=P,c}function kl(a,c,h,y){return a=Hs(7,a,y,c),a.lanes=h,a}function s0(a,c,h,y){return a=Hs(22,a,y,c),a.elementType=K,a.lanes=h,a.stateNode={isHidden:!1},a}function U1(a,c,h){return a=Hs(6,a,null,c),a.lanes=h,a}function B1(a,c,h){return c=Hs(4,a.children!==null?a.children:[],a.key,c),c.lanes=h,c.stateNode={containerInfo:a.containerInfo,pendingChildren:null,implementation:a.implementation},c}function JD(a,c,h,y,E){this.tag=c,this.containerInfo=a,this.finishedWork=this.pingCache=this.current=this.pendingChildren=null,this.timeoutHandle=-1,this.callbackNode=this.pendingContext=this.context=null,this.callbackPriority=0,this.eventTimes=dl(0),this.expirationTimes=dl(-1),this.entangledLanes=this.finishedLanes=this.mutableReadLanes=this.expiredLanes=this.pingedLanes=this.suspendedLanes=this.pendingLanes=0,this.entanglements=dl(0),this.identifierPrefix=y,this.onRecoverableError=E,this.mutableSourceEagerHydrationData=null}function Z1(a,c,h,y,E,P,L,z,q){return a=new JD(a,c,h,z,q),c===1?(c=1,P===!0&&(c|=8)):c=0,P=Hs(3,null,null,c),a.current=P,P.stateNode=a,P.memoizedState={element:y,isDehydrated:h,cache:null,transitions:null,pendingSuspenseBoundaries:null},s1(P),a}function e7(a,c,h){var y=3<arguments.length&&arguments[3]!==void 0?arguments[3]:null;return{$$typeof:I,key:y==null?null:""+y,children:a,containerInfo:c,implementation:h}}function FS(a){if(!a)return sa;a=a._reactInternals;e:{if(Os(a)!==a||a.tag!==1)throw Error(n(170));var c=a;do{switch(c.tag){case 3:c=c.stateNode.context;break e;case 1:if(zr(c.type)){c=c.stateNode.__reactInternalMemoizedMergedChildContext;break e}}c=c.return}while(c!==null);throw Error(n(171))}if(a.tag===1){var h=a.type;if(zr(h))return h6(a,h,c)}return c}function VS(a,c,h,y,E,P,L,z,q){return a=Z1(h,y,!0,a,E,P,L,z,q),a.context=FS(null),h=a.current,y=Ar(),E=da(h),P=po(y,E),P.callback=c??null,aa(h,P,E),a.current.lanes=E,oo(a,E,y),Zr(a,y),a}function i0(a,c,h,y){var E=c.current,P=Ar(),L=da(E);return h=FS(h),c.context===null?c.context=h:c.pendingContext=h,c=po(P,L),c.payload={element:a},y=y===void 0?null:y,y!==null&&(c.callback=y),a=aa(E,c,L),a!==null&&(li(a,E,L,P),Dp(a,E,L)),L}function o0(a){if(a=a.current,!a.child)return null;switch(a.child.tag){case 5:return a.child.stateNode;default:return a.child.stateNode}}function HS(a,c){if(a=a.memoizedState,a!==null&&a.dehydrated!==null){var h=a.retryLane;a.retryLane=h!==0&&h<c?h:c}}function W1(a,c){HS(a,c),(a=a.alternate)&&HS(a,c)}function t7(){return null}var zS=typeof reportError=="function"?reportError:function(a){console.error(a)};function q1(a){this._internalRoot=a}a0.prototype.render=q1.prototype.render=function(a){var c=this._internalRoot;if(c===null)throw Error(n(409));i0(a,c,null,null)},a0.prototype.unmount=q1.prototype.unmount=function(){var a=this._internalRoot;if(a!==null){this._internalRoot=null;var c=a.containerInfo;xl(function(){i0(null,a,null,null)}),c[lo]=null}};function a0(a){this._internalRoot=a}a0.prototype.unstable_scheduleHydration=function(a){if(a){var c=fp();a={blockedOn:null,target:a,priority:c};for(var h=0;h<ti.length&&c!==0&&c<ti[h].priority;h++);ti.splice(h,0,a),h===0&&he(a)}};function G1(a){return!(!a||a.nodeType!==1&&a.nodeType!==9&&a.nodeType!==11)}function l0(a){return!(!a||a.nodeType!==1&&a.nodeType!==9&&a.nodeType!==11&&(a.nodeType!==8||a.nodeValue!==" react-mount-point-unstable "))}function US(){}function n7(a,c,h,y,E){if(E){if(typeof y=="function"){var P=y;y=function(){var se=o0(L);P.call(se)}}var L=VS(c,y,a,0,null,!1,!1,"",US);return a._reactRootContainer=L,a[lo]=L.current,Ud(a.nodeType===8?a.parentNode:a),xl(),L}for(;E=a.lastChild;)a.removeChild(E);if(typeof y=="function"){var z=y;y=function(){var se=o0(q);z.call(se)}}var q=Z1(a,0,!1,null,null,!1,!1,"",US);return a._reactRootContainer=q,a[lo]=q.current,Ud(a.nodeType===8?a.parentNode:a),xl(function(){i0(c,q,h,y)}),q}function c0(a,c,h,y,E){var P=h._reactRootContainer;if(P){var L=P;if(typeof E=="function"){var z=E;E=function(){var q=o0(L);z.call(q)}}i0(c,L,a,E)}else L=n7(h,c,a,E,y);return o0(L)}Ld=function(a){switch(a.tag){case 3:var c=a.stateNode;if(c.current.memoizedState.isDehydrated){var h=ul(c.pendingLanes);h!==0&&(Od(c,h|1),Zr(c,Jt()),(At&6)===0&&(eu=Jt()+500,ia()))}break;case 13:xl(function(){var y=ho(a,1);if(y!==null){var E=Ar();li(y,a,1,E)}}),W1(a,1)}},fl=function(a){if(a.tag===13){var c=ho(a,134217728);if(c!==null){var h=Ar();li(c,a,134217728,h)}W1(a,134217728)}},dp=function(a){if(a.tag===13){var c=da(a),h=ho(a,c);if(h!==null){var y=Ar();li(h,a,c,y)}W1(a,c)}},fp=function(){return Ft},hp=function(a,c){var h=Ft;try{return Ft=a,c()}finally{Ft=h}},Qs=function(a,c,h){switch(c){case"input":if(_t(a,h),c=h.name,h.type==="radio"&&c!=null){for(h=a;h.parentNode;)h=h.parentNode;for(h=h.querySelectorAll("input[name="+JSON.stringify(""+c)+'][type="radio"]'),c=0;c<h.length;c++){var y=h[c];if(y!==a&&y.form===a.form){var E=Cp(y);if(!E)throw Error(n(90));Ee(y),_t(y,E)}}}break;case"textarea":Ge(a,h);break;case"select":c=h.value,c!=null&&Ae(a,!!h.multiple,c,!1)}},Xe=F1,Nt=xl;var r7={usingClientEntryPoint:!1,Events:[Wd,Hc,Cp,so,os,F1]},af={findFiberByHostInstance:hl,bundleType:0,version:"18.3.1",rendererPackageName:"react-dom"},s7={bundleType:af.bundleType,version:af.version,rendererPackageName:af.rendererPackageName,rendererConfig:af.rendererConfig,overrideHookState:null,overrideHookStateDeletePath:null,overrideHookStateRenamePath:null,overrideProps:null,overridePropsDeletePath:null,overridePropsRenamePath:null,setErrorHandler:null,setSuspenseHandler:null,scheduleUpdate:null,currentDispatcherRef:T.ReactCurrentDispatcher,findHostInstanceByFiber:function(a){return a=Ed(a),a===null?null:a.stateNode},findFiberByHostInstance:af.findFiberByHostInstance||t7,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 u0=__REACT_DEVTOOLS_GLOBAL_HOOK__;if(!u0.isDisabled&&u0.supportsFiber)try{Ac=u0.inject(s7),Ls=u0}catch{}}return Wr.__SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED=r7,Wr.createPortal=function(a,c){var h=2<arguments.length&&arguments[2]!==void 0?arguments[2]:null;if(!G1(c))throw Error(n(200));return e7(a,c,null,h)},Wr.createRoot=function(a,c){if(!G1(a))throw Error(n(299));var h=!1,y="",E=zS;return c!=null&&(c.unstable_strictMode===!0&&(h=!0),c.identifierPrefix!==void 0&&(y=c.identifierPrefix),c.onRecoverableError!==void 0&&(E=c.onRecoverableError)),c=Z1(a,1,!1,null,null,h,!1,y,E),a[lo]=c.current,Ud(a.nodeType===8?a.parentNode:a),new q1(c)},Wr.findDOMNode=function(a){if(a==null)return null;if(a.nodeType===1)return a;var c=a._reactInternals;if(c===void 0)throw typeof a.render=="function"?Error(n(188)):(a=Object.keys(a).join(","),Error(n(268,a)));return a=Ed(c),a=a===null?null:a.stateNode,a},Wr.flushSync=function(a){return xl(a)},Wr.hydrate=function(a,c,h){if(!l0(c))throw Error(n(200));return c0(null,a,c,!0,h)},Wr.hydrateRoot=function(a,c,h){if(!G1(a))throw Error(n(405));var y=h!=null&&h.hydratedSources||null,E=!1,P="",L=zS;if(h!=null&&(h.unstable_strictMode===!0&&(E=!0),h.identifierPrefix!==void 0&&(P=h.identifierPrefix),h.onRecoverableError!==void 0&&(L=h.onRecoverableError)),c=VS(c,null,a,1,h??null,E,!1,P,L),a[lo]=c.current,Ud(a),y)for(a=0;a<y.length;a++)h=y[a],E=h._getVersion,E=E(h._source),c.mutableSourceEagerHydrationData==null?c.mutableSourceEagerHydrationData=[h,E]:c.mutableSourceEagerHydrationData.push(h,E);return new a0(c)},Wr.render=function(a,c,h){if(!l0(c))throw Error(n(200));return c0(null,a,c,!1,h)},Wr.unmountComponentAtNode=function(a){if(!l0(a))throw Error(n(40));return a._reactRootContainer?(xl(function(){c0(null,null,a,!1,function(){a._reactRootContainer=null,a[lo]=null})}),!0):!1},Wr.unstable_batchedUpdates=F1,Wr.unstable_renderSubtreeIntoContainer=function(a,c,h,y){if(!l0(h))throw Error(n(200));if(a==null||a._reactInternals===void 0)throw Error(n(38));return c0(a,c,h,!1,y)},Wr.version="18.3.1-next-f1338f8080-20240426",Wr}var Kk;function fA(){if(Kk)return jy.exports;Kk=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(),jy.exports=pH(),jy.exports}var Yk;function mH(){if(Yk)return b0;Yk=1;var t=fA();return b0.createRoot=t.createRoot,b0.hydrateRoot=t.hydrateRoot,b0}var gH=mH();const vH=Mg(gH),Lo={BASE_URL:"/",DEV:!1,MODE:"production",PROD:!0,SSR:!1};function hA(t){return"init"in t}function $2(t){return typeof t.write=="function"}function yH(t){return!!t.onMount}function Xk(t){return"v"in t||"e"in t}function eg(t){if("e"in t)throw t.e;if((Lo?"production":void 0)!=="production"&&!("v"in t))throw new Error("[Bug] atom state is not initialized");return t.v}function tg(t){return typeof(t==null?void 0:t.then)=="function"}function _H(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 pA(t,e,n){if(!n.p.has(t)){n.p.add(t);const r=()=>n.p.delete(t);e.then(r,r)}}function mA(t,e,n){const r=n.get(t),s=r==null?void 0:r.t,i=e.p;if(!(s!=null&&s.size))return i;if(!i.size)return s;const o=new Set(s);for(const l of i)o.add(l);return o}function wH(t){return!!t.INTERNAL_onInit}const xH=(t,e,n,...r)=>n.read(...r),bH=(t,e,n,...r)=>n.write(...r),SH=(t,e,n)=>n.INTERNAL_onInit(e),kH=(t,e,n,r)=>{var s;return(s=n.onMount)==null?void 0:s.call(n,r)},EH=(t,e,n)=>{var r;const s=t[0];let i=s.get(n);if(!i){const o=t[6],l=t[9];i={d:new Map,p:new Set,n:0},s.set(n,i),(r=o.i)==null||r.call(o,n),wH(n)&&l(t,e,n)}return i},CH=(t,e)=>{var n;const r=t[1],s=t[3],i=t[4],o=t[5],l=t[6],u=t[13];if(!l.f&&!s.size&&!i.size&&!o.size)return;const d=[],f=p=>{try{p()}catch(g){d.push(g)}};do{l.f&&f(l.f);const p=new Set;for(const g of s){const v=(n=r.get(g))==null?void 0:n.l;if(v)for(const w of v)p.add(w)}s.clear();for(const g of o)p.add(g);o.clear();for(const g of i)p.add(g);i.clear();for(const g of p)f(g);s.size&&u(t,e)}while(s.size||o.size||i.size);if(d.length)throw new AggregateError(d)},PH=(t,e)=>{const n=t[1],r=t[2],s=t[3],i=t[11],o=t[14],l=t[17];if(!s.size)return;const u=[],d=[],f=new WeakSet,p=new WeakSet,g=[],v=[];for(const w of s)g.push(w),v.push(i(t,e,w));for(;g.length;){const w=g.length-1,_=g[w],x=v[w];if(p.has(_)){g.pop(),v.pop();continue}if(f.has(_)){if(r.get(_)===x.n)u.push(_),d.push(x);else if((Lo?"production":void 0)!=="production"&&r.has(_))throw new Error("[Bug] invalidated atom exists");p.add(_),g.pop(),v.pop();continue}f.add(_);for(const S of mA(_,x,n))f.has(S)||(g.push(S),v.push(i(t,e,S)))}for(let w=u.length-1;w>=0;--w){const _=u[w],x=d[w];let S=!1;for(const k of x.d.keys())if(k!==_&&s.has(k)){S=!0;break}S&&(r.set(_,x.n),o(t,e,_),l(t,e,_)),r.delete(_)}},F2=new WeakSet,TH=(t,e,n)=>{var r,s;const i=t[1],o=t[2],l=t[3],u=t[6],d=t[7],f=t[11],p=t[12],g=t[13],v=t[14],w=t[16],_=t[17],x=t[20],S=t[26],k=t[28],C=f(t,e,n),T=k[0];if(Xk(C)){if(i.has(n)&&o.get(n)!==C.n||C.m===T)return C.m=T,C;let G=!1;for(const[V,K]of C.d)if(v(t,e,V).n!==K){G=!0;break}if(!G)return C.m=T,C}let A=!0;const I=new Set(C.d.keys()),M=()=>{for(const G of I)C.d.delete(G)},R=()=>{if(i.has(n)){const G=!l.size;_(t,e,n),G&&(g(t,e),p(t,e))}},O=G=>{var V;if(G===n){const U=f(t,e,G);if(!Xk(U))if(hA(G))x(t,e,G,G.init);else throw new Error("no atom init");return eg(U)}const K=v(t,e,G);try{return eg(K)}finally{I.delete(G),C.d.set(G,K.n),tg(C.v)&&pA(n,C.v,K),i.has(n)&&((V=i.get(G))==null||V.t.add(n)),A||R()}};let N,D;const $={get signal(){return N||(N=new AbortController),N.signal},get setSelf(){return(Lo?"production":void 0)!=="production"&&console.warn("[DEPRECATED] setSelf is deprecated and will be removed in v3."),(Lo?"production":void 0)!=="production"&&!$2(n)&&console.warn("setSelf function cannot be used with read-only atom"),!D&&$2(n)&&(D=(...G)=>{if((Lo?"production":void 0)!=="production"&&A&&console.warn("setSelf function cannot be called in sync"),!A)try{return w(t,e,n,G)}finally{g(t,e),p(t,e)}}),D}},Y=C.n,B=o.get(n)===Y;try{(Lo?"production":void 0)!=="production"&&F2.delete(e);const G=d(t,e,n,O,$);if((Lo?"production":void 0)!=="production"&&F2.has(e)&&console.warn("Detected store mutation during atom read. This is not supported."),x(t,e,n,G),tg(G)){S(t,e,G,()=>N==null?void 0:N.abort());const V=()=>{M(),R()};G.then(V,V)}else M();return(r=u.r)==null||r.call(u,n),C.m=T,C}catch(G){if(_H(G))throw G;return delete C.v,C.e=G,++C.n,C.m=T,C}finally{A=!1,C.n!==Y&&B&&(o.set(n,C.n),l.add(n),(s=u.c)==null||s.call(u,n))}},AH=(t,e,n)=>{const r=t[1],s=t[2],i=t[11],o=[n];for(;o.length;){const l=o.pop(),u=i(t,e,l);for(const d of mA(l,u,r)){const f=i(t,e,d);s.get(d)!==f.n&&(s.set(d,f.n),o.push(d))}}},RH=(t,e,n,r)=>{const s=t[3],i=t[6],o=t[8],l=t[11],u=t[12],d=t[13],f=t[14],p=t[15],g=t[16],v=t[17],w=t[20],_=t[28];let x=!0;const S=C=>eg(f(t,e,C)),k=(C,...T)=>{var A;const I=l(t,e,C);try{if(C===n){if(!hA(C))throw new Error("atom not writable");(Lo?"production":void 0)!=="production"&&F2.add(e);const M=I.n,R=T[0];w(t,e,C,R),v(t,e,C),M!==I.n&&(++_[0],s.add(C),p(t,e,C),(A=i.c)==null||A.call(i,C));return}else return g(t,e,C,T)}finally{x||(d(t,e),u(t,e))}};try{return o(t,e,n,S,k,...r)}finally{x=!1}},MH=(t,e,n)=>{var r;const s=t[1],i=t[3],o=t[6],l=t[11],u=t[15],d=t[18],f=t[19],p=l(t,e,n),g=s.get(n);if(g&&p.d.size>0){for(const[v,w]of p.d)if(!g.d.has(v)){const _=l(t,e,v);d(t,e,v).t.add(n),g.d.add(v),w!==_.n&&(i.add(v),u(t,e,v),(r=o.c)==null||r.call(o,v))}for(const v of g.d)if(!p.d.has(v)){g.d.delete(v);const w=f(t,e,v);w==null||w.t.delete(n)}}},IH=(t,e,n)=>{var r;const s=t[1],i=t[4],o=t[6],l=t[10],u=t[11],d=t[12],f=t[13],p=t[14],g=t[16],v=t[18],w=u(t,e,n);let _=s.get(n);if(!_){p(t,e,n);for(const x of w.d.keys())v(t,e,x).t.add(n);if(_={l:new Set,d:new Set(w.d.keys()),t:new Set},s.set(n,_),$2(n)&&yH(n)){const x=()=>{let S=!0;const k=(...C)=>{try{return g(t,e,n,C)}finally{S||(f(t,e),d(t,e))}};try{const C=l(t,e,n,k);C&&(_.u=()=>{S=!0;try{C()}finally{S=!1}})}finally{S=!1}};i.add(x)}(r=o.m)==null||r.call(o,n)}return _},OH=(t,e,n)=>{var r,s;const i=t[1],o=t[5],l=t[6],u=t[11],d=t[19],f=u(t,e,n);let p=i.get(n);if(!p||p.l.size)return p;let g=!1;for(const v of p.t)if((r=i.get(v))!=null&&r.d.has(n)){g=!0;break}if(!g){p.u&&o.add(p.u),p=void 0,i.delete(n);for(const v of f.d.keys()){const w=d(t,e,v);w==null||w.t.delete(n)}(s=l.u)==null||s.call(l,n);return}return p},LH=(t,e,n,r)=>{const s=t[11],i=t[27],o=s(t,e,n),l="v"in o,u=o.v;if(tg(r))for(const d of o.d.keys())pA(n,r,s(t,e,d));o.v=r,delete o.e,(!l||!Object.is(u,o.v))&&(++o.n,tg(u)&&i(t,e,u))},NH=(t,e,n)=>{const r=t[14];return eg(r(t,e,n))},DH=(t,e,n,...r)=>{const s=t[3],i=t[12],o=t[13],l=t[16],u=s.size;try{return l(t,e,n,r)}finally{s.size!==u&&(o(t,e),i(t,e))}},jH=(t,e,n,r)=>{const s=t[12],i=t[13],o=t[18],l=t[19],d=o(t,e,n).l;return d.add(r),i(t,e),s(t,e),()=>{d.delete(r),l(t,e,n),i(t,e),s(t,e)}},$H=(t,e,n,r)=>{const s=t[25];let i=s.get(n);if(!i){i=new Set,s.set(n,i);const o=()=>s.delete(n);n.then(o,o)}i.add(r)},FH=(t,e,n)=>{const s=t[25].get(n);s==null||s.forEach(i=>i())},gA=new WeakMap;function VH(t){const e=gA.get(t);if((Lo?"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 HH(...t){const e={get(o){return r(n,e,o)},set(o,...l){return s(n,e,o,...l)},sub(o,l){return i(n,e,o,l)}},n=[new WeakMap,new WeakMap,new WeakMap,new Set,new Set,new Set,{},xH,bH,SH,kH,EH,CH,PH,TH,AH,RH,MH,IH,OH,LH,NH,DH,jH,void 0,new WeakMap,$H,FH,[0]].map((o,l)=>t[l]||o);gA.set(e,Object.freeze(n));const r=n[21],s=n[22],i=n[23];return e}const vA={};let zH=0;function ft(t,e){const n=`atom${++zH}`,r={toString(){return(vA?"production":void 0)!=="production"&&this.debugLabel?n+":"+this.debugLabel:n}};return typeof t=="function"?r.read=t:(r.init=t,r.read=UH,r.write=BH),e&&(r.write=e),r}function UH(t){return t(this)}function BH(t,e,n){return e(this,typeof n=="function"?n(t(this)):n)}function ZH(){return HH()}let yf;function WH(){return yf||(yf=ZH(),(vA?"production":void 0)!=="production"&&(globalThis.__JOTAI_DEFAULT_STORE__||(globalThis.__JOTAI_DEFAULT_STORE__=yf),globalThis.__JOTAI_DEFAULT_STORE__!==yf&&console.warn("Detected multiple Jotai instances. It may cause unexpected behavior with the default store. https://github.com/pmndrs/jotai/discussions/2044"))),yf}const qH={},GH=m.createContext(void 0);function $g(t){return m.useContext(GH)||WH()}const V2=t=>typeof(t==null?void 0:t.then)=="function",H2=t=>{t.status||(t.status="pending",t.then(e=>{t.status="fulfilled",t.value=e},e=>{t.status="rejected",t.reason=e}))},KH=we.use||(t=>{if(t.status==="pending")throw t;if(t.status==="fulfilled")return t.value;throw t.status==="rejected"?t.reason:(H2(t),t)}),Vy=new WeakMap,Qk=(t,e,n)=>{const r=VH(t),s=r[26];let i=Vy.get(e);return i||(i=new Promise((o,l)=>{let u=e;const d=g=>v=>{u===g&&o(v)},f=g=>v=>{u===g&&l(v)},p=()=>{try{const g=n();V2(g)?(Vy.set(g,i),u=g,g.then(d(g),f(g)),s(r,t,g,p)):o(g)}catch(g){l(g)}};e.then(d(e),f(e)),s(r,t,e,p)}),Vy.set(e,i)),i};function ut(t,e){const{delay:n,unstable_promiseStatus:r=!we.use}={},s=$g(),[[i,o,l],u]=m.useReducer(f=>{const p=s.get(t);return Object.is(f[0],p)&&f[1]===s&&f[2]===t?f:[p,s,t]},void 0,()=>[s.get(t),s,t]);let d=i;if((o!==s||l!==t)&&(u(),d=s.get(t)),m.useEffect(()=>{const f=s.sub(t,()=>{if(r)try{const p=s.get(t);V2(p)&&H2(Qk(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(u,n);return}u()});return u(),f},[s,t,n,r]),m.useDebugValue(d),V2(d)){const f=Qk(s,d,()=>s.get(t));return r&&H2(f),KH(f)}return d}function gt(t,e){const n=$g();return m.useCallback((...s)=>{if((qH?"production":void 0)!=="production"&&!("write"in t))throw new Error("not writable atom");return n.set(t,...s)},[n,t])}function yA(t,e){return[ut(t),gt(t)]}const Hx=m.createContext({});function zx(t){const e=m.useRef(null);return e.current===null&&(e.current=t()),e.current}const YH=typeof window<"u",Ux=YH?m.useLayoutEffect:m.useEffect,Fg=m.createContext(null);function Bx(t,e){t.indexOf(e)===-1&&t.push(e)}function ng(t,e){const n=t.indexOf(e);n>-1&&t.splice(n,1)}const Xi=(t,e,n)=>n>e?e:n<t?t:n;let Vg=()=>{};const Za={},_A=t=>/^-?(?:\d+(?:\.\d+)?|\.\d+)$/u.test(t),wA=t=>typeof t=="object"&&t!==null,xA=t=>/^0[^.\s]+$/u.test(t);function bA(t){let e;return()=>(e===void 0&&(e=t()),e)}const Ys=t=>t,qh=(...t)=>t.reduce((e,n)=>r=>n(e(r))),gh=(t,e,n)=>{const r=e-t;return r?(n-t)/r:1};class Zx{constructor(){this.subscriptions=[]}add(e){return Bx(this.subscriptions,e),()=>ng(this.subscriptions,e)}notify(e,n,r){const s=this.subscriptions.length;if(s)if(s===1)this.subscriptions[0](e,n,r);else for(let i=0;i<s;i++){const o=this.subscriptions[i];o&&o(e,n,r)}}getSize(){return this.subscriptions.length}clear(){this.subscriptions.length=0}}const Ss=t=>t*1e3,Ws=t=>t/1e3,SA=(t,e)=>e?t*(1e3/e):0,kA=(t,e,n)=>(((1-3*n+3*e)*t+(3*n-6*e))*t+3*e)*t,XH=1e-7,QH=12;function JH(t,e,n,r,s){let i,o,l=0;do o=e+(n-e)/2,i=kA(o,r,s)-t,i>0?n=o:e=o;while(Math.abs(i)>XH&&++l<QH);return o}function Gh(t,e,n,r){if(t===e&&n===r)return Ys;const s=i=>JH(i,0,1,t,n);return i=>i===0||i===1?i:kA(s(i),e,r)}const EA=t=>e=>e<=.5?t(2*e)/2:(2-t(2*(1-e)))/2,CA=t=>e=>1-t(1-e),PA=Gh(.33,1.53,.69,.99),Wx=CA(PA),TA=EA(Wx),AA=t=>t>=1?1:(t*=2)<1?.5*Wx(t):.5*(2-Math.pow(2,-10*(t-1))),qx=t=>1-Math.sin(Math.acos(t)),RA=CA(qx),MA=EA(qx),ez=Gh(.42,0,1,1),tz=Gh(0,0,.58,1),IA=Gh(.42,0,.58,1),nz=t=>Array.isArray(t)&&typeof t[0]!="number",OA=t=>Array.isArray(t)&&typeof t[0]=="number",rz={linear:Ys,easeIn:ez,easeInOut:IA,easeOut:tz,circIn:qx,circInOut:MA,circOut:RA,backIn:Wx,backInOut:TA,backOut:PA,anticipate:AA},sz=t=>typeof t=="string",Jk=t=>{if(OA(t)){Vg(t.length===4);const[e,n,r,s]=t;return Gh(e,n,r,s)}else if(sz(t))return rz[t];return t},S0=["setup","read","resolveKeyframes","preUpdate","update","preRender","render","postRender"];function iz(t){let e=new Set,n=new Set,r=!1,s=!1;const i=new WeakSet;let o={delta:0,timestamp:0,isProcessing:!1};function l(d){i.has(d)&&(u.schedule(d),t()),d(o)}const u={schedule:(d,f=!1,p=!1)=>{const v=p&&r?e:n;return f&&i.add(d),v.add(d),d},cancel:d=>{n.delete(d),i.delete(d)},process:d=>{if(o=d,r){s=!0;return}r=!0;const f=e;e=n,n=f,e.forEach(l),e.clear(),r=!1,s&&(s=!1,u.process(d))}};return u}const oz=40;function LA(t,e){let n=!1,r=!0;const s={delta:0,timestamp:0,isProcessing:!1},i=()=>n=!0,o=S0.reduce((C,T)=>(C[T]=iz(i),C),{}),{setup:l,read:u,resolveKeyframes:d,preUpdate:f,update:p,preRender:g,render:v,postRender:w}=o,_=()=>{const C=Za.useManualTiming,T=C?s.timestamp:performance.now();n=!1,C||(s.delta=r?1e3/60:Math.max(Math.min(T-s.timestamp,oz),1)),s.timestamp=T,s.isProcessing=!0,l.process(s),u.process(s),d.process(s),f.process(s),p.process(s),g.process(s),v.process(s),w.process(s),s.isProcessing=!1,n&&e&&(r=!1,t(_))},x=()=>{n=!0,r=!0,s.isProcessing||t(_)};return{schedule:S0.reduce((C,T)=>{const A=o[T];return C[T]=(I,M=!1,R=!1)=>(n||x(),A.schedule(I,M,R)),C},{}),cancel:C=>{for(let T=0;T<S0.length;T++)o[S0[T]].cancel(C)},state:s,steps:o}}const{schedule:Xt,cancel:Wa,state:fr,steps:Hy}=LA(typeof requestAnimationFrame<"u"?requestAnimationFrame:Ys,!0);let tm;function az(){tm=void 0}const Dr={now:()=>(tm===void 0&&Dr.set(fr.isProcessing||Za.useManualTiming?fr.timestamp:performance.now()),tm),set:t=>{tm=t,queueMicrotask(az)}},NA=t=>e=>typeof e=="string"&&e.startsWith(t),DA=NA("--"),lz=NA("var(--"),Gx=t=>lz(t)?cz.test(t.split("/*")[0].trim()):!1,cz=/var\(--(?:[\w-]+\s*|[\w-]+\s*,(?:\s*[^)(\s]|\s*\((?:[^)(]|\([^)(]*\))*\))+\s*)\)$/iu;function eE(t){return typeof t!="string"?!1:t.split("/*")[0].includes("var(--")}const gd={test:t=>typeof t=="number",parse:parseFloat,transform:t=>t},vh={...gd,transform:t=>Xi(0,1,t)},k0={...gd,default:1},Bf=t=>Math.round(t*1e5)/1e5,Kx=/-?(?:\d+(?:\.\d+)?|\.\d+)/gu;function uz(t){return t==null}const dz=/^(?:#[\da-f]{3,8}|(?:rgb|hsl)a?\((?:-?[\d.]+%?[,\s]+){2}-?[\d.]+%?\s*(?:[,/]\s*)?(?:\b\d+(?:\.\d+)?|\.\d+)?%?\))$/iu,Yx=(t,e)=>n=>!!(typeof n=="string"&&dz.test(n)&&n.startsWith(t)||e&&!uz(n)&&Object.prototype.hasOwnProperty.call(n,e)),jA=(t,e,n)=>r=>{if(typeof r!="string")return r;const[s,i,o,l]=r.match(Kx);return{[t]:parseFloat(s),[e]:parseFloat(i),[n]:parseFloat(o),alpha:l!==void 0?parseFloat(l):1}},fz=t=>Xi(0,255,t),zy={...gd,transform:t=>Math.round(fz(t))},Bl={test:Yx("rgb","red"),parse:jA("red","green","blue"),transform:({red:t,green:e,blue:n,alpha:r=1})=>"rgba("+zy.transform(t)+", "+zy.transform(e)+", "+zy.transform(n)+", "+Bf(vh.transform(r))+")"};function hz(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 z2={test:Yx("#"),parse:hz,transform:Bl.transform},Kh=t=>({test:e=>typeof e=="string"&&e.endsWith(t)&&e.split(" ").length===1,parse:parseFloat,transform:e=>`${e}${t}`}),Co=Kh("deg"),qi=Kh("%"),Ve=Kh("px"),pz=Kh("vh"),mz=Kh("vw"),tE={...qi,parse:t=>qi.parse(t)/100,transform:t=>qi.transform(t*100)},Su={test:Yx("hsl","hue"),parse:jA("hue","saturation","lightness"),transform:({hue:t,saturation:e,lightness:n,alpha:r=1})=>"hsla("+Math.round(t)+", "+qi.transform(Bf(e))+", "+qi.transform(Bf(n))+", "+Bf(vh.transform(r))+")"},Hn={test:t=>Bl.test(t)||z2.test(t)||Su.test(t),parse:t=>Bl.test(t)?Bl.parse(t):Su.test(t)?Su.parse(t):z2.parse(t),transform:t=>typeof t=="string"?t:t.hasOwnProperty("red")?Bl.transform(t):Su.transform(t),getAnimatableNone:t=>{const e=Hn.parse(t);return e.alpha=0,Hn.transform(e)}},gz=/(?:#[\da-f]{3,8}|(?:rgb|hsl)a?\((?:-?[\d.]+%?[,\s]+){2}-?[\d.]+%?\s*(?:[,/]\s*)?(?:\b\d+(?:\.\d+)?|\.\d+)?%?\))/giu;function vz(t){var e,n;return isNaN(t)&&typeof t=="string"&&(((e=t.match(Kx))==null?void 0:e.length)||0)+(((n=t.match(gz))==null?void 0:n.length)||0)>0}const $A="number",FA="color",yz="var",_z="var(",nE="${}",wz=/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 id(t){const e=t.toString(),n=[],r={color:[],number:[],var:[]},s=[];let i=0;const l=e.replace(wz,u=>(Hn.test(u)?(r.color.push(i),s.push(FA),n.push(Hn.parse(u))):u.startsWith(_z)?(r.var.push(i),s.push(yz),n.push(u)):(r.number.push(i),s.push($A),n.push(parseFloat(u))),++i,nE)).split(nE);return{values:n,split:l,indexes:r,types:s}}function xz(t){return id(t).values}function VA({split:t,types:e}){const n=t.length;return r=>{let s="";for(let i=0;i<n;i++)if(s+=t[i],r[i]!==void 0){const o=e[i];o===$A?s+=Bf(r[i]):o===FA?s+=Hn.transform(r[i]):s+=r[i]}return s}}function bz(t){return VA(id(t))}const Sz=t=>typeof t=="number"?0:Hn.test(t)?Hn.getAnimatableNone(t):t,kz=(t,e)=>typeof t=="number"?e!=null&&e.trim().endsWith("/")?t:0:Sz(t);function Ez(t){const e=id(t);return VA(e)(e.values.map((r,s)=>kz(r,e.split[s])))}const _i={test:vz,parse:xz,createTransformer:bz,getAnimatableNone:Ez};function Uy(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 Cz({hue:t,saturation:e,lightness:n,alpha:r}){t/=360,e/=100,n/=100;let s=0,i=0,o=0;if(!e)s=i=o=n;else{const l=n<.5?n*(1+e):n+e-n*e,u=2*n-l;s=Uy(u,l,t+1/3),i=Uy(u,l,t),o=Uy(u,l,t-1/3)}return{red:Math.round(s*255),green:Math.round(i*255),blue:Math.round(o*255),alpha:r}}function rg(t,e){return n=>n>0?e:t}const Yt=(t,e,n)=>t+(e-t)*n,By=(t,e,n)=>{const r=t*t,s=n*(e*e-r)+r;return s<0?0:Math.sqrt(s)},Pz=[z2,Bl,Su],Tz=t=>Pz.find(e=>e.test(t));function rE(t){const e=Tz(t);if(!e)return!1;let n=e.parse(t);return e===Su&&(n=Cz(n)),n}const sE=(t,e)=>{const n=rE(t),r=rE(e);if(!n||!r)return rg(t,e);const s={...n};return i=>(s.red=By(n.red,r.red,i),s.green=By(n.green,r.green,i),s.blue=By(n.blue,r.blue,i),s.alpha=Yt(n.alpha,r.alpha,i),Bl.transform(s))},U2=new Set(["none","hidden"]);function Az(t,e){return U2.has(t)?n=>n<=0?t:e:n=>n>=1?e:t}function Rz(t,e){return n=>Yt(t,e,n)}function Xx(t){return typeof t=="number"?Rz:typeof t=="string"?Gx(t)?rg:Hn.test(t)?sE:Oz:Array.isArray(t)?HA:typeof t=="object"?Hn.test(t)?sE:Mz:rg}function HA(t,e){const n=[...t],r=n.length,s=t.map((i,o)=>Xx(i)(i,e[o]));return i=>{for(let o=0;o<r;o++)n[o]=s[o](i);return n}}function Mz(t,e){const n={...t,...e},r={};for(const s in n)t[s]!==void 0&&e[s]!==void 0&&(r[s]=Xx(t[s])(t[s],e[s]));return s=>{for(const i in r)n[i]=r[i](s);return n}}function Iz(t,e){const n=[],r={color:0,var:0,number:0};for(let s=0;s<e.values.length;s++){const i=e.types[s],o=t.indexes[i][r[i]],l=t.values[o]??0;n[s]=l,r[i]++}return n}const Oz=(t,e)=>{const n=_i.createTransformer(e),r=id(t),s=id(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?U2.has(t)&&!s.values.length||U2.has(e)&&!r.values.length?Az(t,e):qh(HA(Iz(r,s),s.values),n):rg(t,e)};function zA(t,e,n){return typeof t=="number"&&typeof e=="number"&&typeof n=="number"?Yt(t,e,n):Xx(t)(t,e)}const Lz=t=>{const e=({timestamp:n})=>t(n);return{start:(n=!0)=>Xt.update(e,n),stop:()=>Wa(e),now:()=>fr.isProcessing?fr.timestamp:Dr.now()}},UA=(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)})`},sg=2e4;function Qx(t){let e=0;const n=50;let r=t.next(e);for(;!r.done&&e<sg;)e+=n,r=t.next(e);return e>=sg?1/0:e}function Nz(t,e=100,n){const r=n({...t,keyframes:[0,e]}),s=Math.min(Qx(r),sg);return{type:"keyframes",ease:i=>r.next(s*i).value/e,duration:Ws(s)}}const Pn={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 B2(t,e){return t*Math.sqrt(1-e*e)}const Dz=12;function jz(t,e,n){let r=n;for(let s=1;s<Dz;s++)r=r-t(r)/e(r);return r}const Zy=.001;function $z({duration:t=Pn.duration,bounce:e=Pn.bounce,velocity:n=Pn.velocity,mass:r=Pn.mass}){let s,i,o=1-e;o=Xi(Pn.minDamping,Pn.maxDamping,o),t=Xi(Pn.minDuration,Pn.maxDuration,Ws(t)),o<1?(s=d=>{const f=d*o,p=f*t,g=f-n,v=B2(d,o),w=Math.exp(-p);return Zy-g/v*w},i=d=>{const p=d*o*t,g=p*n+n,v=Math.pow(o,2)*Math.pow(d,2)*t,w=Math.exp(-p),_=B2(Math.pow(d,2),o);return(-s(d)+Zy>0?-1:1)*((g-v)*w)/_}):(s=d=>{const f=Math.exp(-d*t),p=(d-n)*t+1;return-Zy+f*p},i=d=>{const f=Math.exp(-d*t),p=(n-d)*(t*t);return f*p});const l=5/t,u=jz(s,i,l);if(t=Ss(t),isNaN(u))return{stiffness:Pn.stiffness,damping:Pn.damping,duration:t};{const d=Math.pow(u,2)*r;return{stiffness:d,damping:o*2*Math.sqrt(r*d),duration:t}}}const Fz=["duration","bounce"],Vz=["stiffness","damping","mass"];function iE(t,e){return e.some(n=>t[n]!==void 0)}function Hz(t){let e={velocity:Pn.velocity,stiffness:Pn.stiffness,damping:Pn.damping,mass:Pn.mass,isResolvedFromDuration:!1,...t};if(!iE(t,Vz)&&iE(t,Fz))if(e.velocity=0,t.visualDuration){const n=t.visualDuration,r=2*Math.PI/(n*1.2),s=r*r,i=2*Xi(.05,1,1-(t.bounce||0))*Math.sqrt(s);e={...e,mass:Pn.mass,stiffness:s,damping:i}}else{const n=$z({...t,velocity:0});e={...e,...n,mass:Pn.mass},e.isResolvedFromDuration=!0}return e}function ig(t=Pn.visualDuration,e=Pn.bounce){const n=typeof t!="object"?{visualDuration:t,keyframes:[0,1],bounce:e}:t;let{restSpeed:r,restDelta:s}=n;const i=n.keyframes[0],o=n.keyframes[n.keyframes.length-1],l={done:!1,value:i},{stiffness:u,damping:d,mass:f,duration:p,velocity:g,isResolvedFromDuration:v}=Hz({...n,velocity:-Ws(n.velocity||0)}),w=g||0,_=d/(2*Math.sqrt(u*f)),x=o-i,S=Ws(Math.sqrt(u/f)),k=Math.abs(x)<5;r||(r=k?Pn.restSpeed.granular:Pn.restSpeed.default),s||(s=k?Pn.restDelta.granular:Pn.restDelta.default);let C,T,A,I,M,R;if(_<1)A=B2(S,_),I=(w+_*S*x)/A,C=N=>{const D=Math.exp(-_*S*N);return o-D*(I*Math.sin(A*N)+x*Math.cos(A*N))},M=_*S*I+x*A,R=_*S*x-I*A,T=N=>Math.exp(-_*S*N)*(M*Math.sin(A*N)+R*Math.cos(A*N));else if(_===1){C=D=>o-Math.exp(-S*D)*(x+(w+S*x)*D);const N=w+S*x;T=D=>Math.exp(-S*D)*(S*N*D-w)}else{const N=S*Math.sqrt(_*_-1);C=B=>{const G=Math.exp(-_*S*B),V=Math.min(N*B,300);return o-G*((w+_*S*x)*Math.sinh(V)+N*x*Math.cosh(V))/N};const D=(w+_*S*x)/N,$=_*S*D-x*N,Y=_*S*x-D*N;T=B=>{const G=Math.exp(-_*S*B),V=Math.min(N*B,300);return G*($*Math.sinh(V)+Y*Math.cosh(V))}}const O={calculatedDuration:v&&p||null,velocity:N=>Ss(T(N)),next:N=>{if(!v&&_<1){const $=Math.exp(-_*S*N),Y=Math.sin(A*N),B=Math.cos(A*N),G=o-$*(I*Y+x*B),V=Ss($*(M*Y+R*B));return l.done=Math.abs(V)<=r&&Math.abs(o-G)<=s,l.value=l.done?o:G,l}const D=C(N);if(v)l.done=N>=p;else{const $=Ss(T(N));l.done=Math.abs($)<=r&&Math.abs(o-D)<=s}return l.value=l.done?o:D,l},toString:()=>{const N=Math.min(Qx(O),sg),D=UA($=>O.next(N*$).value,N,30);return N+"ms "+D},toTransition:()=>{}};return O}ig.applyToOptions=t=>{const e=Nz(t,100,ig);return t.ease=e.ease,t.duration=Ss(e.duration),t.type="keyframes",t};const zz=5;function BA(t,e,n){const r=Math.max(e-zz,0);return SA(n-t(r),e-r)}function Z2({keyframes:t,velocity:e=0,power:n=.8,timeConstant:r=325,bounceDamping:s=10,bounceStiffness:i=500,modifyTarget:o,min:l,max:u,restDelta:d=.5,restSpeed:f}){const p=t[0],g={done:!1,value:p},v=R=>l!==void 0&&R<l||u!==void 0&&R>u,w=R=>l===void 0?u:u===void 0||Math.abs(l-R)<Math.abs(u-R)?l:u;let _=n*e;const x=p+_,S=o===void 0?x:o(x);S!==x&&(_=S-p);const k=R=>-_*Math.exp(-R/r),C=R=>S+k(R),T=R=>{const O=k(R),N=C(R);g.done=Math.abs(O)<=d,g.value=g.done?S:N};let A,I;const M=R=>{v(g.value)&&(A=R,I=ig({keyframes:[g.value,w(g.value)],velocity:BA(C,R,g.value),damping:s,stiffness:i,restDelta:d,restSpeed:f}))};return M(0),{calculatedDuration:null,next:R=>{let O=!1;return!I&&A===void 0&&(O=!0,T(R),M(R)),A!==void 0&&R>=A?I.next(R-A):(!O&&T(R),g)}}}function Uz(t,e,n){const r=[],s=n||Za.mix||zA,i=t.length-1;for(let o=0;o<i;o++){let l=s(t[o],t[o+1]);if(e){const u=Array.isArray(e)?e[o]||Ys:e;l=qh(u,l)}r.push(l)}return r}function Bz(t,e,{clamp:n=!0,ease:r,mixer:s}={}){const i=t.length;if(Vg(i===e.length),i===1)return()=>e[0];if(i===2&&e[0]===e[1])return()=>e[1];const o=t[0]===t[1];t[0]>t[i-1]&&(t=[...t].reverse(),e=[...e].reverse());const l=Uz(e,r,s),u=l.length,d=f=>{if(o&&f<t[0])return e[0];let p=0;if(u>1)for(;p<t.length-2&&!(f<t[p+1]);p++);const g=gh(t[p],t[p+1],f);return l[p](g)};return n?f=>d(Xi(t[0],t[i-1],f)):d}function Zz(t,e){const n=t[t.length-1];for(let r=1;r<=e;r++){const s=gh(0,e,r);t.push(Yt(n,1,s))}}function Wz(t){const e=[0];return Zz(e,t.length-1),e}function qz(t,e){return t.map(n=>n*e)}function Gz(t,e){return t.map(()=>e||IA).splice(0,t.length-1)}function Zf({duration:t=300,keyframes:e,times:n,ease:r="easeInOut"}){const s=nz(r)?r.map(Jk):Jk(r),i={done:!1,value:e[0]},o=qz(n&&n.length===e.length?n:Wz(e),t),l=Bz(o,e,{ease:Array.isArray(s)?s:Gz(e,s)});return{calculatedDuration:t,next:u=>(i.value=l(u),i.done=u>=t,i)}}const Kz=t=>t!==null;function Hg(t,{repeat:e,repeatType:n="loop"},r,s=1){const i=t.filter(Kz),l=s<0||e&&n!=="loop"&&e%2===1?0:i.length-1;return!l||r===void 0?i[l]:r}const Yz={decay:Z2,inertia:Z2,tween:Zf,keyframes:Zf,spring:ig};function ZA(t){typeof t.type=="string"&&(t.type=Yz[t.type])}class Jx{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 Xz=t=>t/100;class og extends Jx{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!==Dr.now()&&this.tick(Dr.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;ZA(e);const{type:n=Zf,repeat:r=0,repeatDelay:s=0,repeatType:i,velocity:o=0}=e;let{keyframes:l}=e;const u=n||Zf;u!==Zf&&typeof l[0]!="number"&&(this.mixKeyframes=qh(Xz,zA(l[0],l[1])),l=[0,100]);const d=u({...e,keyframes:l});i==="mirror"&&(this.mirroredGenerator=u({...e,keyframes:[...l].reverse(),velocity:-o})),d.calculatedDuration===null&&(d.calculatedDuration=Qx(d));const{calculatedDuration:f}=d;this.calculatedDuration=f,this.resolvedDuration=f+s,this.totalDuration=this.resolvedDuration*(r+1)-s,this.generator=d}updateTime(e){const n=Math.round(e-this.startTime)*this.playbackSpeed;this.holdTime!==null?this.currentTime=this.holdTime:this.currentTime=n}tick(e,n=!1){const{generator:r,totalDuration:s,mixKeyframes:i,mirroredGenerator:o,resolvedDuration:l,calculatedDuration:u}=this;if(this.startTime===null)return r.next(0);const{delay:d=0,keyframes:f,repeat:p,repeatType:g,repeatDelay:v,type:w,onUpdate:_,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),k=this.playbackSpeed>=0?S<0:S>s;this.currentTime=Math.max(S,0),this.state==="finished"&&this.holdTime===null&&(this.currentTime=s);let C=this.currentTime,T=r;if(p){const R=Math.min(this.currentTime,s)/l;let O=Math.floor(R),N=R%1;!N&&R>=1&&(N=1),N===1&&O--,O=Math.min(O,p+1),!!(O%2)&&(g==="reverse"?(N=1-N,v&&(N-=v/l)):g==="mirror"&&(T=o)),C=Xi(0,1,N)*l}let A;k?(this.delayState.value=f[0],A=this.delayState):A=T.next(C),i&&!k&&(A.value=i(A.value));let{done:I}=A;!k&&u!==null&&(I=this.playbackSpeed>=0?this.currentTime>=s:this.currentTime<=0);const M=this.holdTime===null&&(this.state==="finished"||this.state==="running"&&I);return M&&w!==Z2&&(A.value=Hg(f,this.options,x,this.speed)),_&&_(A.value),M&&this.finish(),A}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=Ss(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 BA(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(Dr.now()),this.playbackSpeed=e,n&&this.driver&&(this.time=Ws(this.currentTime))}play(){var s,i;if(this.isStopped)return;const{driver:e=Lz,startTime:n}=this.options;this.driver||(this.driver=e(o=>this.tick(o))),(i=(s=this.options).onPlay)==null||i.call(s);const r=this.driver.now();this.state==="finished"?(this.updateFinished(),this.startTime=r):this.holdTime!==null?this.startTime=r-this.holdTime:this.startTime||(this.startTime=n??r),this.state==="finished"&&this.speed<0&&(this.startTime+=this.calculatedDuration),this.holdTime=null,this.state="running",this.driver.start()}pause(){this.state="paused",this.updateTime(Dr.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 Qz(t){for(let e=1;e<t.length;e++)t[e]??(t[e]=t[e-1])}const Zl=t=>t*180/Math.PI,W2=t=>{const e=Zl(Math.atan2(t[1],t[0]));return q2(e)},Jz={x:4,y:5,translateX:4,translateY:5,scaleX:0,scaleY:3,scale:t=>(Math.abs(t[0])+Math.abs(t[3]))/2,rotate:W2,rotateZ:W2,skewX:t=>Zl(Math.atan(t[1])),skewY:t=>Zl(Math.atan(t[2])),skew:t=>(Math.abs(t[1])+Math.abs(t[2]))/2},q2=t=>(t=t%360,t<0&&(t+=360),t),oE=W2,aE=t=>Math.sqrt(t[0]*t[0]+t[1]*t[1]),lE=t=>Math.sqrt(t[4]*t[4]+t[5]*t[5]),eU={x:12,y:13,z:14,translateX:12,translateY:13,translateZ:14,scaleX:aE,scaleY:lE,scale:t=>(aE(t)+lE(t))/2,rotateX:t=>q2(Zl(Math.atan2(t[6],t[5]))),rotateY:t=>q2(Zl(Math.atan2(-t[2],t[0]))),rotateZ:oE,rotate:oE,skewX:t=>Zl(Math.atan(t[4])),skewY:t=>Zl(Math.atan(t[1])),skew:t=>(Math.abs(t[1])+Math.abs(t[4]))/2};function G2(t){return t.includes("scale")?1:0}function K2(t,e){if(!t||t==="none")return G2(e);const n=t.match(/^matrix3d\(([-\d.e\s,]+)\)$/u);let r,s;if(n)r=eU,s=n;else{const l=t.match(/^matrix\(([-\d.e\s,]+)\)$/u);r=Jz,s=l}if(!s)return G2(e);const i=r[e],o=s[1].split(",").map(nU);return typeof i=="function"?i(o):o[i]}const tU=(t,e)=>{const{transform:n="none"}=getComputedStyle(t);return K2(n,e)};function nU(t){return parseFloat(t.trim())}const vd=["transformPerspective","x","y","z","translateX","translateY","translateZ","scale","scaleX","scaleY","rotate","rotateX","rotateY","rotateZ","skew","skewX","skewY"],yd=new Set([...vd,"pathRotation"]),cE=t=>t===gd||t===Ve,rU=new Set(["x","y","z"]),sU=vd.filter(t=>!rU.has(t));function iU(t){const e=[];return sU.forEach(n=>{const r=t.getValue(n);r!==void 0&&(e.push([n,r.get()]),r.set(n.startsWith("scale")?1:0))}),e}const La={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})=>K2(e,"x"),y:(t,{transform:e})=>K2(e,"y")};La.translateX=La.x;La.translateY=La.y;const ic=new Set;let Y2=!1,X2=!1,Q2=!1;function WA(){if(X2){const t=Array.from(ic).filter(r=>r.needsMeasurement),e=new Set(t.map(r=>r.element)),n=new Map;e.forEach(r=>{const s=iU(r);s.length&&(n.set(r,s),r.render())}),t.forEach(r=>r.measureInitialState()),e.forEach(r=>{r.render();const s=n.get(r);s&&s.forEach(([i,o])=>{var l;(l=r.getValue(i))==null||l.set(o)})}),t.forEach(r=>r.measureEndState()),t.forEach(r=>{r.suspendedScrollY!==void 0&&window.scrollTo(0,r.suspendedScrollY)})}X2=!1,Y2=!1,ic.forEach(t=>t.complete(Q2)),ic.clear()}function qA(){ic.forEach(t=>{t.readKeyframes(),t.needsMeasurement&&(X2=!0)})}function oU(){Q2=!0,qA(),WA(),Q2=!1}class eb{constructor(e,n,r,s,i,o=!1){this.state="pending",this.isAsync=!1,this.needsMeasurement=!1,this.unresolvedKeyframes=[...e],this.onComplete=n,this.name=r,this.motionValue=s,this.element=i,this.isAsync=o}scheduleResolve(){this.state="scheduled",this.isAsync?(ic.add(this),Y2||(Y2=!0,Xt.read(qA),Xt.resolveKeyframes(WA))):(this.readKeyframes(),this.complete())}readKeyframes(){const{unresolvedKeyframes:e,name:n,element:r,motionValue:s}=this;if(e[0]===null){const i=s==null?void 0:s.get(),o=e[e.length-1];if(i!==void 0)e[0]=i;else if(r&&n){const l=r.readValue(n,o);l!=null&&(e[0]=l)}e[0]===void 0&&(e[0]=o),s&&i===void 0&&s.set(e[0])}Qz(e)}setFinalKeyframe(){}measureInitialState(){}renderEndStyles(){}measureEndState(){}complete(e=!1){this.state="complete",this.onComplete(this.unresolvedKeyframes,this.finalKeyframe,e),ic.delete(this)}cancel(){this.state==="scheduled"&&(ic.delete(this),this.state="pending")}resume(){this.state==="pending"&&this.scheduleResolve()}}const aU=t=>t.startsWith("--");function GA(t,e,n){aU(e)?t.style.setProperty(e,n):t.style[e]=n}const lU={};function KA(t,e){const n=bA(t);return()=>lU[e]??n()}const cU=KA(()=>window.ScrollTimeline!==void 0,"scrollTimeline"),YA=KA(()=>{try{document.createElement("div").animate({opacity:0},{easing:"linear(0, 1)"})}catch{return!1}return!0},"linearEasing"),Tf=([t,e,n,r])=>`cubic-bezier(${t}, ${e}, ${n}, ${r})`,uE={linear:"linear",ease:"ease",easeIn:"ease-in",easeOut:"ease-out",easeInOut:"ease-in-out",circIn:Tf([0,.65,.55,1]),circOut:Tf([.55,0,1,.45]),backIn:Tf([.31,.01,.66,-.59]),backOut:Tf([.33,1.53,.69,.99])};function XA(t,e){if(t)return typeof t=="function"?YA()?UA(t,e):"ease-out":OA(t)?Tf(t):Array.isArray(t)?t.map(n=>XA(n,e)||uE.easeOut):uE[t]}function uU(t,e,n,{delay:r=0,duration:s=300,repeat:i=0,repeatType:o="loop",ease:l="easeOut",times:u}={},d=void 0){const f={[e]:n};u&&(f.offset=u);const p=XA(l,s);Array.isArray(p)&&(f.easing=p);const g={delay:r,duration:s,easing:Array.isArray(p)?"linear":p,fill:"both",iterations:i+1,direction:o==="reverse"?"alternate":"normal"};return d&&(g.pseudoElement=d),t.animate(f,g)}function QA(t){return typeof t=="function"&&"applyToOptions"in t}function dU({type:t,...e}){return QA(t)&&YA()?t.applyToOptions(e):(e.duration??(e.duration=300),e.ease??(e.ease="easeOut"),e)}class JA extends Jx{constructor(e){if(super(),this.finishedTime=null,this.isStopped=!1,this.manualStartTime=null,!e)return;const{element:n,name:r,keyframes:s,pseudoElement:i,allowFlatten:o=!1,finalKeyframe:l,onComplete:u}=e;this.isPseudoElement=!!i,this.allowFlatten=o,this.options=e,Vg(typeof e.type!="string");const d=dU(e);this.animation=uU(n,r,s,d,i),d.autoplay===!1&&this.animation.pause(),this.animation.onfinish=()=>{if(this.finishedTime=this.time,!i){const f=Hg(s,this.options,l,this.speed);this.updateMotionValue&&this.updateMotionValue(f),GA(n,r,f),this.animation.cancel()}u==null||u(),this.notifyFinished()}}play(){this.isStopped||(this.manualStartTime=null,this.animation.play(),this.state==="finished"&&this.updateFinished())}pause(){this.animation.pause()}complete(){var e,n;(n=(e=this.animation).finish)==null||n.call(e)}cancel(){try{this.animation.cancel()}catch{}}stop(){if(this.isStopped)return;this.isStopped=!0;const{state:e}=this;e==="idle"||e==="finished"||(this.updateMotionValue?this.updateMotionValue():this.commitStyles(),this.isPseudoElement||this.cancel())}commitStyles(){var n,r,s;const e=(n=this.options)==null?void 0:n.element;!this.isPseudoElement&&(e!=null&&e.isConnected)&&((s=(r=this.animation).commitStyles)==null||s.call(r))}get duration(){var n,r;const e=((r=(n=this.animation.effect)==null?void 0:n.getComputedTiming)==null?void 0:r.call(n).duration)||0;return 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=Ss(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&&cU()?(this.animation.timeline=e,n&&(this.animation.rangeStart=n),r&&(this.animation.rangeEnd=r),Ys):s(this)}}const eR={anticipate:AA,backInOut:TA,circInOut:MA};function fU(t){return t in eR}function hU(t){typeof t.ease=="string"&&fU(t.ease)&&(t.ease=eR[t.ease])}const Wy=10;class pU extends JA{constructor(e){hU(e),ZA(e),super(e),e.startTime!==void 0&&e.autoplay!==!1&&(this.startTime=e.startTime),this.options=e}updateMotionValue(e){const{motionValue:n,onUpdate:r,onComplete:s,element:i,...o}=this.options;if(!n)return;if(e!==void 0){n.set(e);return}const l=new og({...o,autoplay:!1}),u=Math.max(Wy,Dr.now()-this.startTime),d=Xi(0,Wy,u-Wy),f=l.sample(u).value,{name:p}=this.options;i&&p&&GA(i,p,f),n.setWithVelocity(l.sample(Math.max(0,u-d)).value,f,d),l.stop()}}const dE=(t,e)=>e==="zIndex"?!1:!!(typeof t=="number"||Array.isArray(t)||typeof t=="string"&&(_i.test(t)||t==="0")&&!t.startsWith("url("));function mU(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 gU(t,e,n,r){const s=t[0];if(s===null)return!1;if(e==="display"||e==="visibility")return!0;const i=t[t.length-1],o=dE(s,e),l=dE(i,e);return!o||!l?!1:mU(t)||(n==="spring"||QA(n))&&r}function J2(t){t.duration=0,t.type="keyframes"}const tR=new Set(["opacity","clipPath","filter","transform","backgroundColor"]),vU=/^(?:oklch|oklab|lab|lch|color|color-mix|light-dark)\(/;function yU(t){for(let e=0;e<t.length;e++)if(typeof t[e]=="string"&&vU.test(t[e]))return!0;return!1}const _U=new Set(["color","backgroundColor","outlineColor","fill","stroke","borderColor","borderTopColor","borderRightColor","borderBottomColor","borderLeftColor"]),wU=bA(()=>Object.hasOwnProperty.call(Element.prototype,"animate"));function xU(t){var p;const{motionValue:e,name:n,repeatDelay:r,repeatType:s,damping:i,type:o,keyframes:l}=t,u=(p=e==null?void 0:e.owner)==null?void 0:p.current;if(!(u instanceof HTMLElement)&&!(u instanceof SVGElement))return!1;const{onUpdate:d,transformTemplate:f}=e.owner.getProps();return wU()&&n&&(tR.has(n)||_U.has(n)&&yU(l))&&(n!=="transform"||!f)&&!d&&!r&&s!=="mirror"&&i!==0&&o!=="inertia"}const bU=40;class SU extends Jx{constructor({autoplay:e=!0,delay:n=0,type:r="keyframes",repeat:s=0,repeatDelay:i=0,repeatType:o="loop",keyframes:l,name:u,motionValue:d,element:f,...p}){var w;super(),this.stop=()=>{var _,x;this._animation&&(this._animation.stop(),(_=this.stopTimeline)==null||_.call(this)),(x=this.keyframeResolver)==null||x.cancel()},this.createdAt=Dr.now();const g={autoplay:e,delay:n,type:r,repeat:s,repeatDelay:i,repeatType:o,name:u,motionValue:d,element:f,...p},v=(f==null?void 0:f.KeyframeResolver)||eb;this.keyframeResolver=new v(l,(_,x,S)=>this.onKeyframesResolved(_,x,g,!S),u,d,f),(w=this.keyframeResolver)==null||w.scheduleResolve()}onKeyframesResolved(e,n,r,s){var S,k;this.keyframeResolver=void 0;const{name:i,type:o,velocity:l,delay:u,isHandoff:d,onUpdate:f}=r;this.resolvedAt=Dr.now();let p=!0;gU(e,i,o,l)||(p=!1,(Za.instantAnimations||!u)&&(f==null||f(Hg(e,r,n))),e[0]=e[e.length-1],J2(r),r.repeat=0);const v={startTime:s?this.resolvedAt?this.resolvedAt-this.createdAt>bU?this.resolvedAt:this.createdAt:this.createdAt:void 0,finalKeyframe:n,...r,keyframes:e},w=p&&!d&&xU(v),_=(k=(S=v.motionValue)==null?void 0:S.owner)==null?void 0:k.current;let x;if(w)try{x=new pU({...v,element:_})}catch{x=new og(v)}else x=new og(v);x.finished.then(()=>{this.notifyFinished()}).catch(Ys),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(),oU()),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 nR(t,e,n,r=0,s=1){const i=Array.from(t).sort((d,f)=>d.sortNodePosition(f)).indexOf(e),o=t.size,l=(o-1)*r;return typeof n=="function"?n(i,o):s===1?i*r:l-i*r}const fE=30,kU=t=>!isNaN(parseFloat(t));class EU{constructor(e,n={}){this.canTrackVelocity=null,this.events={},this.updateAndNotify=r=>{var i;const s=Dr.now();if(this.updatedAt!==s&&this.setPrevFrameValue(),this.prev=this.current,this.setCurrent(r),this.current!==this.prev&&((i=this.events.change)==null||i.notify(this.current),this.dependents))for(const o of this.dependents)o.dirty()},this.hasAnimated=!1,this.setCurrent(e),this.owner=n.owner}setCurrent(e){this.current=e,this.updatedAt=Dr.now(),this.canTrackVelocity===null&&e!==void 0&&(this.canTrackVelocity=kU(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 Zx);const r=this.events[e].add(n);return e==="change"?()=>{r(),Xt.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=Dr.now();if(!this.canTrackVelocity||this.prevFrameValue===void 0||e-this.updatedAt>fE)return 0;const n=Math.min(this.updatedAt-this.prevUpdatedAt,fE);return SA(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 od(t,e){return new EU(t,e)}function rR(t,e){if(t!=null&&t.inherit&&e){const{inherit:n,...r}=t;return{...e,...r}}return t}function tb(t,e){const n=(t==null?void 0:t[e])??(t==null?void 0:t.default)??t;return n!==t?rR(n,t):n}const CU={type:"spring",stiffness:500,damping:25,restSpeed:10},PU=t=>({type:"spring",stiffness:550,damping:t===0?2*Math.sqrt(550):30,restSpeed:10}),TU={type:"keyframes",duration:.8},AU={type:"keyframes",ease:[.25,.1,.35,1],duration:.3},RU=(t,{keyframes:e})=>e.length>2?TU:yd.has(t)?t.startsWith("scale")?PU(e[1]):CU:AU,MU=new Set(["when","delay","delayChildren","staggerChildren","staggerDirection","repeat","repeatType","repeatDelay","from","elapsed"]);function IU(t){for(const e in t)if(!MU.has(e))return!0;return!1}const nb=(t,e,n,r={},s,i)=>o=>{const l=tb(r,t)||{},u=l.delay||r.delay||0;let{elapsed:d=0}=r;d=d-Ss(u);const f={keyframes:Array.isArray(n)?n:[null,n],ease:"easeOut",velocity:e.getVelocity(),...l,delay:-d,onUpdate:g=>{e.set(g),l.onUpdate&&l.onUpdate(g)},onComplete:()=>{o(),l.onComplete&&l.onComplete()},name:t,motionValue:e,element:i?void 0:s};IU(l)||Object.assign(f,RU(t,f)),f.duration&&(f.duration=Ss(f.duration)),f.repeatDelay&&(f.repeatDelay=Ss(f.repeatDelay)),f.from!==void 0&&(f.keyframes[0]=f.from);let p=!1;if((f.type===!1||f.duration===0&&!f.repeatDelay)&&(J2(f),f.delay===0&&(p=!0)),(Za.instantAnimations||Za.skipAnimations||s!=null&&s.shouldSkipAnimations||l.skipAnimations)&&(p=!0,J2(f),f.delay=0),f.allowFlatten=!l.type&&!l.ease,p&&!i&&e.get()!==void 0){const g=Hg(f.keyframes,l);if(g!==void 0){Xt.update(()=>{f.onUpdate(g),f.onComplete()});return}}return l.isSync?new og(f):new SU(f)},OU=/^var\(--(?:([\w-]+)|([\w-]+), ?([a-zA-Z\d ()%#.,-]+))\)/u;function LU(t){const e=OU.exec(t);if(!e)return[,];const[,n,r,s]=e;return[`--${n??r}`,s]}function sR(t,e,n=1){const[r,s]=LU(t);if(!r)return;const i=window.getComputedStyle(e).getPropertyValue(r);if(i){const o=i.trim();return _A(o)?parseFloat(o):o}return Gx(s)?sR(s,e,n+1):s}function hE(t){const e=[{},{}];return t==null||t.values.forEach((n,r)=>{e[0][r]=n.get(),e[1][r]=n.getVelocity()}),e}function rb(t,e,n,r){if(typeof e=="function"){const[s,i]=hE(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]=hE(r);e=e(n!==void 0?n:t.custom,s,i)}return e}function oc(t,e,n){const r=t.getProps();return rb(r,e,n!==void 0?n:r.custom,t)}const iR=new Set(["width","height","top","left","right","bottom",...vd]),ew=t=>Array.isArray(t);function NU(t,e,n){t.hasValue(e)?t.getValue(e).set(n):t.addValue(e,od(n))}function DU(t){return ew(t)?t[t.length-1]||0:t}function jU(t,e){const n=oc(t,e);let{transitionEnd:r={},transition:s={},...i}=n||{};i={...i,...r};for(const o in i){const l=DU(i[o]);NU(t,o,l)}}const mr=t=>!!(t&&t.getVelocity);function $U(t){return!!(mr(t)&&t.add)}function tw(t,e){const n=t.getValue("willChange");if($U(n))return n.add(e);if(!n&&Za.WillChange){const r=new Za.WillChange("auto");t.addValue("willChange",r),r.add(e)}}function sb(t){return t.replace(/([A-Z])/g,e=>`-${e.toLowerCase()}`)}const FU="framerAppearId",oR="data-"+sb(FU);function aR(t){return t.props[oR]}function VU({protectedKeys:t,needsAnimating:e},n){const r=t.hasOwnProperty(n)&&e[n]!==!0;return e[n]=!1,r}function lR(t,e,{delay:n=0,transitionOverride:r,type:s}={}){let{transition:i,transitionEnd:o,...l}=e;const u=t.getDefaultTransition();i=i?rR(i,u):u;const d=i==null?void 0:i.reduceMotion,f=i==null?void 0:i.skipAnimations;r&&(i=r);const p=[],g=s&&t.animationState&&t.animationState.getState()[s],v=i==null?void 0:i.path;v&&v.animateVisualElement(t,l,i,n,p);for(const w in l){const _=t.getValue(w,t.latestValues[w]??null),x=l[w];if(x===void 0||g&&VU(g,w))continue;const S={delay:n,...tb(i||{},w)};f&&(S.skipAnimations=!0);const k=_.get();if(k!==void 0&&!_.isAnimating()&&!Array.isArray(x)&&x===k&&!S.velocity){Xt.update(()=>_.set(x));continue}let C=!1;if(window.MotionHandoffAnimation){const I=aR(t);if(I){const M=window.MotionHandoffAnimation(I,w,Xt);M!==null&&(S.startTime=M,C=!0)}}tw(t,w);const T=d??t.shouldReduceMotion;_.start(nb(w,_,x,T&&iR.has(w)?{type:!1}:S,t,C));const A=_.animation;A&&p.push(A)}if(o){const w=()=>Xt.update(()=>{o&&jU(t,o)});p.length?Promise.all(p).then(w):w()}return p}function nw(t,e,n={}){var u;const r=oc(t,e,n.type==="exit"?(u=t.presenceContext)==null?void 0:u.custom:void 0);let{transition:s=t.getDefaultTransition()||{}}=r||{};n.transitionOverride&&(s=n.transitionOverride);const i=r?()=>Promise.all(lR(t,r,n)):()=>Promise.resolve(),o=t.variantChildren&&t.variantChildren.size?(d=0)=>{const{delayChildren:f=0,staggerChildren:p,staggerDirection:g}=s;return HU(t,e,d,f,p,g,n)}:()=>Promise.resolve(),{when:l}=s;if(l){const[d,f]=l==="beforeChildren"?[i,o]:[o,i];return d().then(()=>f())}else return Promise.all([i(),o(n.delay)])}function HU(t,e,n=0,r=0,s=0,i=1,o){const l=[];for(const u of t.variantChildren)u.notify("AnimationStart",e),l.push(nw(u,e,{...o,delay:n+(typeof r=="function"?0:r)+nR(t.variantChildren,u,r,s,i)}).then(()=>u.notify("AnimationComplete",e)));return Promise.all(l)}function zU(t,e,n={}){t.notify("AnimationStart",e);let r;if(Array.isArray(e)){const s=e.map(i=>nw(t,i,n));r=Promise.all(s)}else if(typeof e=="string")r=nw(t,e,n);else{const s=typeof e=="function"?oc(t,e,n.custom):e;r=Promise.all(lR(t,s,n))}return r.then(()=>{t.notify("AnimationComplete",e)})}const UU={test:t=>t==="auto",parse:t=>t},cR=t=>e=>e.test(t),uR=[gd,Ve,qi,Co,mz,pz,UU],pE=t=>uR.find(cR(t));function BU(t){return typeof t=="number"?t===0:t!==null?t==="none"||t==="0"||xA(t):!0}const ZU=new Set(["brightness","contrast","saturate","opacity"]);function WU(t){const[e,n]=t.slice(0,-1).split("(");if(e==="drop-shadow")return t;const[r]=n.match(Kx)||[];if(!r)return t;const s=n.replace(r,"");let i=ZU.has(e)?1:0;return r!==n&&(i*=100),e+"("+i+s+")"}const qU=/\b([a-z-]*)\(.*?\)/gu,rw={..._i,getAnimatableNone:t=>{const e=t.match(qU);return e?e.map(WU).join(" "):t}},sw={..._i,getAnimatableNone:t=>{const e=_i.parse(t);return _i.createTransformer(t)(e.map(r=>typeof r=="number"?0:typeof r=="object"?{...r,alpha:1}:r))}},mE={...gd,transform:Math.round},GU={rotate:Co,pathRotation:Co,rotateX:Co,rotateY:Co,rotateZ:Co,scale:k0,scaleX:k0,scaleY:k0,scaleZ:k0,skew:Co,skewX:Co,skewY:Co,distance:Ve,translateX:Ve,translateY:Ve,translateZ:Ve,x:Ve,y:Ve,z:Ve,perspective:Ve,transformPerspective:Ve,opacity:vh,originX:tE,originY:tE,originZ:Ve},ag={borderWidth:Ve,borderTopWidth:Ve,borderRightWidth:Ve,borderBottomWidth:Ve,borderLeftWidth:Ve,borderRadius:Ve,borderTopLeftRadius:Ve,borderTopRightRadius:Ve,borderBottomRightRadius:Ve,borderBottomLeftRadius:Ve,width:Ve,maxWidth:Ve,height:Ve,maxHeight:Ve,top:Ve,right:Ve,bottom:Ve,left:Ve,inset:Ve,insetBlock:Ve,insetBlockStart:Ve,insetBlockEnd:Ve,insetInline:Ve,insetInlineStart:Ve,insetInlineEnd:Ve,padding:Ve,paddingTop:Ve,paddingRight:Ve,paddingBottom:Ve,paddingLeft:Ve,paddingBlock:Ve,paddingBlockStart:Ve,paddingBlockEnd:Ve,paddingInline:Ve,paddingInlineStart:Ve,paddingInlineEnd:Ve,margin:Ve,marginTop:Ve,marginRight:Ve,marginBottom:Ve,marginLeft:Ve,marginBlock:Ve,marginBlockStart:Ve,marginBlockEnd:Ve,marginInline:Ve,marginInlineStart:Ve,marginInlineEnd:Ve,fontSize:Ve,backgroundPositionX:Ve,backgroundPositionY:Ve,...GU,zIndex:mE,fillOpacity:vh,strokeOpacity:vh,numOctaves:mE},KU={...ag,color:Hn,backgroundColor:Hn,outlineColor:Hn,fill:Hn,stroke:Hn,borderColor:Hn,borderTopColor:Hn,borderRightColor:Hn,borderBottomColor:Hn,borderLeftColor:Hn,filter:rw,WebkitFilter:rw,mask:sw,WebkitMask:sw},dR=t=>KU[t],YU=new Set([rw,sw]);function fR(t,e){let n=dR(t);return YU.has(n)||(n=_i),n.getAnimatableNone?n.getAnimatableNone(e):void 0}const XU=new Set(["auto","none","0"]);function QU(t,e,n){let r=0,s;for(;r<t.length&&!s;){const i=t[r];typeof i=="string"&&!XU.has(i)&&id(i).values.length&&(s=t[r]),r++}if(s&&n)for(const i of e)t[i]=fR(n,s)}class JU extends eb{constructor(e,n,r,s,i){super(e,n,r,s,i,!0)}readKeyframes(){const{unresolvedKeyframes:e,element:n,name:r}=this;if(!n||!n.current)return;super.readKeyframes();for(let f=0;f<e.length;f++){let p=e[f];if(typeof p=="string"&&(p=p.trim(),Gx(p))){const g=sR(p,n.current);g!==void 0&&(e[f]=g),f===e.length-1&&(this.finalKeyframe=p)}}if(this.resolveNoneKeyframes(),!iR.has(r)||e.length!==2)return;const[s,i]=e,o=pE(s),l=pE(i),u=eE(s),d=eE(i);if(u!==d&&La[r]){this.needsMeasurement=!0;return}if(o!==l)if(cE(o)&&cE(l))for(let f=0;f<e.length;f++){const p=e[f];typeof p=="string"&&(e[f]=parseFloat(p))}else La[r]&&(this.needsMeasurement=!0)}resolveNoneKeyframes(){const{unresolvedKeyframes:e,name:n}=this,r=[];for(let s=0;s<e.length;s++)(e[s]===null||BU(e[s]))&&r.push(s);r.length&&QU(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=La[r](e.measureViewportBox(),window.getComputedStyle(e.current)),n[0]=this.measuredOrigin;const s=n[n.length-1];s!==void 0&&e.getValue(r,s).jump(s,!1)}measureEndState(){var l;const{element:e,name:n,unresolvedKeyframes:r}=this;if(!e||!e.current)return;const s=e.getValue(n);s&&s.jump(this.measuredOrigin,!1);const i=r.length-1,o=r[i];r[i]=La[n](e.measureViewportBox(),window.getComputedStyle(e.current)),o!==null&&this.finalKeyframe===void 0&&(this.finalKeyframe=o),(l=this.removedTransforms)!=null&&l.length&&this.removedTransforms.forEach(([u,d])=>{e.getValue(u).set(d)}),this.resolveNoneKeyframes()}}const ib=["borderTopLeftRadius","borderTopRightRadius","borderBottomRightRadius","borderBottomLeftRadius"];function hR(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 iw=(t,e)=>e&&typeof t=="number"?e.transform(t):t;function nm(t){return wA(t)&&"offsetHeight"in t&&!("ownerSVGElement"in t)}const{schedule:ob}=LA(queueMicrotask,!1),hi={x:!1,y:!1};function pR(){return hi.x||hi.y}function eB(t){return t==="x"||t==="y"?hi[t]?null:(hi[t]=!0,()=>{hi[t]=!1}):hi.x||hi.y?null:(hi.x=hi.y=!0,()=>{hi.x=hi.y=!1})}function mR(t,e){const n=hR(t),r=new AbortController,s={passive:!0,...e,signal:r.signal};return[n,s,()=>r.abort()]}function tB(t){return!(t.pointerType==="touch"||pR())}function nB(t,e,n={}){const[r,s,i]=mR(t,n);return r.forEach(o=>{let l=!1,u=!1,d;const f=()=>{o.removeEventListener("pointerleave",w)},p=x=>{d&&(d(x),d=void 0),f()},g=x=>{l=!1,window.removeEventListener("pointerup",g),window.removeEventListener("pointercancel",g),u&&(u=!1,p(x))},v=()=>{l=!0,window.addEventListener("pointerup",g,s),window.addEventListener("pointercancel",g,s)},w=x=>{if(x.pointerType!=="touch"){if(l){u=!0;return}p(x)}},_=x=>{if(!tB(x))return;u=!1;const S=e(o,x);typeof S=="function"&&(d=S,o.addEventListener("pointerleave",w,s))};o.addEventListener("pointerenter",_,s),o.addEventListener("pointerdown",v,s)}),i}const gR=(t,e)=>e?t===e?!0:gR(t,e.parentElement):!1,ab=t=>t.pointerType==="mouse"?typeof t.button!="number"||t.button<=0:t.isPrimary!==!1,rB=new Set(["BUTTON","INPUT","SELECT","TEXTAREA","A"]);function sB(t){return rB.has(t.tagName)||t.isContentEditable===!0}const iB=new Set(["INPUT","SELECT","TEXTAREA"]);function oB(t){return iB.has(t.tagName)||t.isContentEditable===!0}const rm=new WeakSet;function gE(t){return e=>{e.key==="Enter"&&t(e)}}function qy(t,e){t.dispatchEvent(new PointerEvent("pointer"+e,{isPrimary:!0,bubbles:!0}))}const aB=(t,e)=>{const n=t.currentTarget;if(!n)return;const r=gE(()=>{if(rm.has(n))return;qy(n,"down");const s=gE(()=>{qy(n,"up")}),i=()=>qy(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 vE(t){return ab(t)&&!pR()}const yE=new WeakSet;function lB(t,e,n={}){const[r,s,i]=mR(t,n),o=l=>{const u=l.currentTarget;if(!vE(l)||yE.has(l))return;rm.add(u),n.stopPropagation&&yE.add(l);const d=e(u,l),f={...s,capture:!0},p=(w,_)=>{window.removeEventListener("pointerup",g,f),window.removeEventListener("pointercancel",v,f),rm.has(u)&&rm.delete(u),vE(w)&&typeof d=="function"&&d(w,{success:_})},g=w=>{p(w,u===window||u===document||n.useGlobalTarget||gR(u,w.target))},v=w=>{p(w,!1)};window.addEventListener("pointerup",g,f),window.addEventListener("pointercancel",v,f)};return r.forEach(l=>{(n.useGlobalTarget?window:l).addEventListener("pointerdown",o,s),nm(l)&&(l.addEventListener("focus",d=>aB(d,s)),!sB(l)&&!l.hasAttribute("tabindex")&&(l.tabIndex=0))}),i}function lb(t){return wA(t)&&"ownerSVGElement"in t}const sm=new WeakMap;let xa;const vR=(t,e,n)=>(r,s)=>s&&s[0]?s[0][t+"Size"]:lb(r)&&"getBBox"in r?r.getBBox()[e]:r[n],cB=vR("inline","width","offsetWidth"),uB=vR("block","height","offsetHeight");function dB({target:t,borderBoxSize:e}){var n;(n=sm.get(t))==null||n.forEach(r=>{r(t,{get width(){return cB(t,e)},get height(){return uB(t,e)}})})}function fB(t){t.forEach(dB)}function hB(){typeof ResizeObserver>"u"||(xa=new ResizeObserver(fB))}function pB(t,e){xa||hB();const n=hR(t);return n.forEach(r=>{let s=sm.get(r);s||(s=new Set,sm.set(r,s)),s.add(e),xa==null||xa.observe(r)}),()=>{n.forEach(r=>{const s=sm.get(r);s==null||s.delete(e),s!=null&&s.size||xa==null||xa.unobserve(r)})}}const im=new Set;let ku;function mB(){ku=()=>{const t={get width(){return window.innerWidth},get height(){return window.innerHeight}};im.forEach(e=>e(t))},window.addEventListener("resize",ku)}function gB(t){return im.add(t),ku||mB(),()=>{im.delete(t),!im.size&&typeof ku=="function"&&(window.removeEventListener("resize",ku),ku=void 0)}}function _E(t,e){return typeof t=="function"?gB(t):pB(t,e)}function vB(t){return lb(t)&&t.tagName==="svg"}const yB=[...uR,Hn,_i],_B=t=>yB.find(cR(t)),wE=()=>({translate:0,scale:1,origin:0,originPoint:0}),Eu=()=>({x:wE(),y:wE()}),xE=()=>({min:0,max:0}),Kn=()=>({x:xE(),y:xE()}),wB=new WeakMap;function zg(t){return t!==null&&typeof t=="object"&&typeof t.start=="function"}function yh(t){return typeof t=="string"||Array.isArray(t)}const cb=["animate","whileInView","whileFocus","whileHover","whileTap","whileDrag","exit"],ub=["initial",...cb];function Ug(t){return zg(t.animate)||ub.some(e=>yh(t[e]))}function yR(t){return!!(Ug(t)||t.variants)}function xB(t,e,n){for(const r in e){const s=e[r],i=n[r];if(mr(s))t.addValue(r,s);else if(mr(i))t.addValue(r,od(s,{owner:t}));else if(i!==s)if(t.hasValue(r)){const o=t.getValue(r);o.liveStyle===!0?o.jump(s):o.hasAnimated||o.set(s)}else{const o=t.getStaticValue(r);t.addValue(r,od(o!==void 0?o:s,{owner:t}))}}for(const r in n)e[r]===void 0&&t.removeValue(r);return e}const lg={current:null},db={current:!1},bB=typeof window<"u";function _R(){if(db.current=!0,!!bB)if(window.matchMedia){const t=window.matchMedia("(prefers-reduced-motion)"),e=()=>lg.current=t.matches;t.addEventListener("change",e),e()}else lg.current=!1}const bE=["AnimationStart","AnimationComplete","Update","BeforeLayoutMeasure","LayoutMeasure","LayoutAnimationStart","LayoutAnimationComplete"];let cg={};function wR(t){cg=t}function SB(){return cg}class kB{scrapeMotionValuesFromProps(e,n,r){return{}}constructor({parent:e,props:n,presenceContext:r,reducedMotionConfig:s,skipAnimations:i,blockInitialAnimation:o,visualState:l},u={}){this.current=null,this.children=new Set,this.isVariantNode=!1,this.isControllingVariants=!1,this.shouldReduceMotion=null,this.shouldSkipAnimations=!1,this.values=new Map,this.KeyframeResolver=eb,this.features={},this.valueSubscriptions=new Map,this.prevMotionValues={},this.hasBeenMounted=!1,this.events={},this.propEventSubscriptions={},this.notifyUpdate=()=>this.notify("Update",this.latestValues),this.render=()=>{this.current&&(this.triggerBuild(),this.renderInstance(this.current,this.renderState,this.props.style,this.projection))},this.renderScheduledAt=0,this.scheduleRender=()=>{const v=Dr.now();this.renderScheduledAt<v&&(this.renderScheduledAt=v,Xt.render(this.render,!1,!0))};const{latestValues:d,renderState:f}=l;this.latestValues=d,this.baseTarget={...d},this.initialValues=n.initial?{...d}:{},this.renderState=f,this.parent=e,this.props=n,this.presenceContext=r,this.depth=e?e.depth+1:0,this.reducedMotionConfig=s,this.skipAnimationsConfig=i,this.options=u,this.blockInitialAnimation=!!o,this.isControllingVariants=Ug(n),this.isVariantNode=yR(n),this.isVariantNode&&(this.variantChildren=new Set),this.manuallyAnimateOnMount=!!(e&&e.current);const{willChange:p,...g}=this.scrapeMotionValuesFromProps(n,{},this);for(const v in g){const w=g[v];d[v]!==void 0&&mr(w)&&w.set(d[v])}}mount(e){var n,r;if(this.hasBeenMounted)for(const s in this.initialValues)(n=this.values.get(s))==null||n.jump(this.initialValues[s]),this.latestValues[s]=this.initialValues[s];this.current=e,wB.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:(db.current||_R(),this.shouldReduceMotion=lg.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(),Wa(this.notifyUpdate),Wa(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&&tR.has(e)&&this.current instanceof HTMLElement){const{factory:o,keyframes:l,times:u,ease:d,duration:f}=n.accelerate,p=new JA({element:this.current,name:e,keyframes:l,times:u,ease:d,duration:Ss(f)}),g=o(p);this.valueSubscriptions.set(e,()=>{g(),p.cancel()});return}const r=yd.has(e);r&&this.onBindTransform&&this.onBindTransform();const s=n.on("change",o=>{this.latestValues[e]=o,this.props.onUpdate&&Xt.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 cg){const n=cg[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):Kn()}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<bE.length;r++){const s=bE[r];this.propEventSubscriptions[s]&&(this.propEventSubscriptions[s](),delete this.propEventSubscriptions[s]);const i="on"+s,o=e[i];o&&(this.propEventSubscriptions[s]=this.on(s,o))}this.prevMotionValues=xB(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=od(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"&&(_A(r)||xA(r))?r=parseFloat(r):!_B(r)&&_i.test(n)&&(r=fR(e,n)),this.setBaseTarget(e,mr(r)?r.get():r)),mr(r)?r.get():r}setBaseTarget(e,n){this.baseTarget[e]=n}getBaseTarget(e){var i;const{initial:n}=this.props;let r;if(typeof n=="string"||typeof n=="object"){const o=rb(this.props,n,(i=this.presenceContext)==null?void 0:i.custom);o&&(r=o[e])}if(n&&r!==void 0)return r;const s=this.getBaseTargetFromProps(this.props,e);return s!==void 0&&!mr(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 Zx),this.events[e].add(n)}notify(e,...n){this.events[e]&&this.events[e].notify(...n)}scheduleRenderMicrotask(){ob.render(this.render)}}class xR extends kB{constructor(){super(...arguments),this.KeyframeResolver=JU}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;mr(e)&&(this.childSubscription=e.on("change",n=>{this.current&&(this.current.textContent=`${n}`)}))}}class el{constructor(e){this.isMounted=!1,this.node=e}update(){}}function bR({top:t,left:e,right:n,bottom:r}){return{x:{min:e,max:n},y:{min:t,max:r}}}function EB({x:t,y:e}){return{top:e.min,right:t.max,bottom:e.max,left:t.min}}function CB(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 Gy(t){return t===void 0||t===1}function ow({scale:t,scaleX:e,scaleY:n}){return!Gy(t)||!Gy(e)||!Gy(n)}function Hl(t){return ow(t)||SR(t)||t.z||t.rotate||t.rotateX||t.rotateY||t.skewX||t.skewY}function SR(t){return SE(t.x)||SE(t.y)}function SE(t){return t&&t!=="0%"}function ug(t,e,n){const r=t-n,s=e*r;return n+s}function kE(t,e,n,r,s){return s!==void 0&&(t=ug(t,s,r)),ug(t,n,r)+e}function aw(t,e=0,n=1,r,s){t.min=kE(t.min,e,n,r,s),t.max=kE(t.max,e,n,r,s)}function kR(t,{x:e,y:n}){aw(t.x,e.translate,e.scale,e.originPoint),aw(t.y,n.translate,n.scale,n.originPoint)}const EE=.999999999999,CE=1.0000000000001;function PB(t,e,n,r=!1){var l;const s=n.length;if(!s)return;e.x=e.y=1;let i,o;for(let u=0;u<s;u++){i=n[u],o=i.projectionDelta;const{visualElement:d}=i.options;d&&d.props.style&&d.props.style.display==="contents"||(r&&i.options.layoutScroll&&i.scroll&&i!==i.root&&(Vi(t.x,-i.scroll.offset.x),Vi(t.y,-i.scroll.offset.y)),o&&(e.x*=o.x.scale,e.y*=o.y.scale,kR(t,o)),r&&Hl(i.latestValues)&&om(t,i.latestValues,(l=i.layout)==null?void 0:l.layoutBox))}e.x<CE&&e.x>EE&&(e.x=1),e.y<CE&&e.y>EE&&(e.y=1)}function Vi(t,e){t.min+=e,t.max+=e}function PE(t,e,n,r,s=.5){const i=Yt(t.min,t.max,s);aw(t,e,n,i,r)}function TE(t,e){return typeof t=="string"?parseFloat(t)/100*(e.max-e.min):t}function om(t,e,n){const r=n??t;PE(t.x,TE(e.x,r.x),e.scaleX,e.scale,e.originX),PE(t.y,TE(e.y,r.y),e.scaleY,e.scale,e.originY)}function ER(t,e){return bR(CB(t.getBoundingClientRect(),e))}function TB(t,e,n){const r=ER(t,n),{scroll:s}=e;return s&&(Vi(r.x,s.offset.x),Vi(r.y,s.offset.y)),r}const AB={x:"translateX",y:"translateY",z:"translateZ",transformPerspective:"perspective"},RB=vd.length;function MB(t,e,n){let r="",s=!0;for(let o=0;o<RB;o++){const l=vd[o],u=t[l];if(u===void 0)continue;let d=!0;if(typeof u=="number")d=u===(l.startsWith("scale")?1:0);else{const f=parseFloat(u);d=l.startsWith("scale")?f===1:f===0}if(!d||n){const f=iw(u,ag[l]);if(!d){s=!1;const p=AB[l]||l;r+=`${p}(${f}) `}n&&(e[l]=f)}}const i=t.pathRotation;return i&&(s=!1,r+=`rotate(${iw(i,ag.pathRotation)}) `),r=r.trim(),n?r=n(e,s?"":r):s&&(r="none"),r}function fb(t,e,n){const{style:r,vars:s,transformOrigin:i}=t;let o=!1,l=!1;for(const u in e){const d=e[u];if(yd.has(u)){o=!0;continue}else if(DA(u)){s[u]=d;continue}else{const f=iw(d,ag[u]);u.startsWith("origin")?(l=!0,i[u]=f):r[u]=f}}if(e.transform||(o||n?r.transform=MB(e,t.transform,n):r.transform&&(r.transform="none")),l){const{originX:u="50%",originY:d="50%",originZ:f=0}=i;r.transformOrigin=`${u} ${d} ${f}`}}function CR(t,{style:e,vars:n},r,s){const i=t.style;let o;for(o in e)i[o]=e[o];s==null||s.applyProjectionStyles(i,r);for(o in n)i.setProperty(o,n[o])}function AE(t,e){return e.max===e.min?0:t/(e.max-e.min)*100}const _f={correct:(t,e)=>{if(!e.target)return t;if(typeof t=="string")if(Ve.test(t))t=parseFloat(t);else return t;const n=AE(t,e.target.x),r=AE(t,e.target.y);return`${n}% ${r}%`}},IB={correct:(t,{treeScale:e,projectionDelta:n})=>{const r=t,s=_i.parse(t);if(s.length>5)return r;const i=_i.createTransformer(t),o=typeof s[0]!="number"?1:0,l=n.x.scale*e.x,u=n.y.scale*e.y;s[0+o]/=l,s[1+o]/=u;const d=Yt(l,u,.5);return typeof s[2+o]=="number"&&(s[2+o]/=d),typeof s[3+o]=="number"&&(s[3+o]/=d),i(s)}},lw={borderRadius:{..._f,applyTo:[...ib]},borderTopLeftRadius:_f,borderTopRightRadius:_f,borderBottomLeftRadius:_f,borderBottomRightRadius:_f,boxShadow:IB};function PR(t,{layout:e,layoutId:n}){return yd.has(t)||t.startsWith("origin")||(e||n!==void 0)&&(!!lw[t]||t==="opacity")}function hb(t,e,n){var o;const r=t.style,s=e==null?void 0:e.style,i={};if(!r)return i;for(const l in r)(mr(r[l])||s&&mr(s[l])||PR(l,t)||((o=n==null?void 0:n.getValue(l))==null?void 0:o.liveStyle)!==void 0)&&(i[l]=r[l]);return i}function OB(t){return window.getComputedStyle(t)}class LB extends xR{constructor(){super(...arguments),this.type="html",this.renderInstance=CR}mount(e){Vg(!!e.style),super.mount(e)}readValueFromInstance(e,n){var r;if(yd.has(n))return(r=this.projection)!=null&&r.isProjecting?G2(n):tU(e,n);{const s=OB(e),i=(DA(n)?s.getPropertyValue(n):s[n])||0;return typeof i=="string"?i.trim():i}}measureInstanceViewportBox(e,{transformPagePoint:n}){return ER(e,n)}build(e,n,r){fb(e,n,r.transformTemplate)}scrapeMotionValuesFromProps(e,n,r){return hb(e,n,r)}}const NB={offset:"stroke-dashoffset",array:"stroke-dasharray"},DB={offset:"strokeDashoffset",array:"strokeDasharray"};function jB(t,e,n=1,r=0,s=!0){t.pathLength=1;const i=s?NB:DB;t[i.offset]=`${-r}`,t[i.array]=`${e} ${n}`}const $B=["offsetDistance","offsetPath","offsetRotate","offsetAnchor"];function TR(t,{attrX:e,attrY:n,attrScale:r,pathLength:s,pathSpacing:i=1,pathOffset:o=0,...l},u,d,f){if(fb(t,l,d),u){t.style.viewBox&&(t.attrs.viewBox=t.style.viewBox);return}t.attrs=t.style,t.style={};const{attrs:p,style:g}=t;p.transform&&(g.transform=p.transform,delete p.transform),(g.transform||p.transformOrigin)&&(g.transformOrigin=p.transformOrigin??"50% 50%",delete p.transformOrigin),g.transform&&(g.transformBox=(f==null?void 0:f.transformBox)??"fill-box",delete p.transformBox);for(const v of $B)p[v]!==void 0&&(g[v]=p[v],delete p[v]);e!==void 0&&(p.x=e),n!==void 0&&(p.y=n),r!==void 0&&(p.scale=r),s!==void 0&&jB(p,s,i,o,!1)}const AR=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"]),RR=t=>typeof t=="string"&&t.toLowerCase()==="svg";function FB(t,e,n,r){CR(t,e,void 0,r);for(const s in e.attrs)t.setAttribute(AR.has(s)?s:sb(s),e.attrs[s])}function MR(t,e,n){const r=hb(t,e,n);for(const s in t)if(mr(t[s])||mr(e[s])){const i=vd.indexOf(s)!==-1?"attr"+s.charAt(0).toUpperCase()+s.substring(1):s;r[i]=t[s]}return r}class VB extends xR{constructor(){super(...arguments),this.type="svg",this.isSVGTag=!1,this.measureInstanceViewportBox=Kn}getBaseTargetFromProps(e,n){return e[n]}readValueFromInstance(e,n){if(yd.has(n)){const r=dR(n);return r&&r.default||0}return n=AR.has(n)?n:sb(n),e.getAttribute(n)}scrapeMotionValuesFromProps(e,n,r){return MR(e,n,r)}build(e,n,r){TR(e,n,this.isSVGTag,r.transformTemplate,r.style)}renderInstance(e,n,r,s){FB(e,n,r,s)}mount(e){this.isSVGTag=RR(e.tagName),super.mount(e)}}const HB=ub.length;function IR(t){if(!t)return;if(!t.isControllingVariants){const n=t.parent?IR(t.parent)||{}:{};return t.props.initial!==void 0&&(n.initial=t.props.initial),n}const e={};for(let n=0;n<HB;n++){const r=ub[n],s=t.props[r];(yh(s)||s===!1)&&(e[r]=s)}return e}function OR(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 zB=[...cb].reverse(),UB=cb.length;function BB(t){return e=>Promise.all(e.map(({animation:n,options:r})=>zU(t,n,r)))}function ZB(t){let e=BB(t),n=RE(),r=!0,s=!1;const i=d=>(f,p)=>{var v;const g=oc(t,p,d==="exit"?(v=t.presenceContext)==null?void 0:v.custom:void 0);if(g){const{transition:w,transitionEnd:_,...x}=g;f={...f,...x,..._}}return f};function o(d){e=d(t)}function l(d){const{props:f}=t,p=IR(t.parent)||{},g=[],v=new Set;let w={},_=1/0;for(let S=0;S<UB;S++){const k=zB[S],C=n[k],T=f[k]!==void 0?f[k]:p[k],A=yh(T),I=k===d?C.isActive:null;I===!1&&(_=S);let M=T===p[k]&&T!==f[k]&&A;if(M&&(r||s)&&t.manuallyAnimateOnMount&&(M=!1),C.protectedKeys={...w},!C.isActive&&I===null||!T&&!C.prevProp||zg(T)||typeof T=="boolean")continue;if(k==="exit"&&C.isActive&&I!==!0){C.prevResolvedValues&&(w={...w,...C.prevResolvedValues});continue}const R=WB(C.prevProp,T);let O=R||k===d&&C.isActive&&!M&&A||S>_&&A,N=!1;const D=Array.isArray(T)?T:[T];let $=D.reduce(i(k),{});I===!1&&($={});const{prevResolvedValues:Y={}}=C,B={...Y,...$},G=U=>{O=!0,v.has(U)&&(N=!0,v.delete(U)),C.needsAnimating[U]=!0;const ee=t.getValue(U);ee&&(ee.liveStyle=!1)};for(const U in B){const ee=$[U],Z=Y[U];if(w.hasOwnProperty(U))continue;let j=!1;ew(ee)&&ew(Z)?j=!OR(ee,Z)||R:j=ee!==Z,j?ee!=null?G(U):v.add(U):ee!==void 0&&v.has(U)?G(U):C.protectedKeys[U]=!0}C.prevProp=T,C.prevResolvedValues=$,C.isActive&&(w={...w,...$}),(r||s)&&t.blockInitialAnimation&&(O=!1);const V=M&&R;O&&(!V||N)&&g.push(...D.map(U=>{const ee={type:k};if(typeof U=="string"&&(r||s)&&!V&&t.manuallyAnimateOnMount&&t.parent){const{parent:Z}=t,j=oc(Z,U);if(Z.enteringChildren&&j){const{delayChildren:Q}=j.transition||{};ee.delay=nR(Z.enteringChildren,t,Q)}}return{animation:U,options:ee}}))}if(v.size){const S={};if(typeof f.initial!="boolean"){const k=oc(t,Array.isArray(f.initial)?f.initial[0]:f.initial);k&&k.transition&&(S.transition=k.transition)}v.forEach(k=>{const C=t.getBaseTarget(k),T=t.getValue(k);T&&(T.liveStyle=!0),S[k]=C??null}),g.push({animation:S})}let x=!!g.length;return r&&(f.initial===!1||f.initial===f.animate)&&!t.manuallyAnimateOnMount&&(x=!1),r=!1,s=!1,x?e(g):Promise.resolve()}function u(d,f){var g;if(n[d].isActive===f)return Promise.resolve();(g=t.variantChildren)==null||g.forEach(v=>{var w;return(w=v.animationState)==null?void 0:w.setActive(d,f)}),n[d].isActive=f;const p=l(d);for(const v in n)n[v].protectedKeys={};return p}return{animateChanges:l,setActive:u,setAnimateFunction:o,getState:()=>n,reset:()=>{n=RE(),s=!0}}}function WB(t,e){return typeof e=="string"?e!==t:Array.isArray(e)?!OR(e,t):!1}function Al(t=!1){return{isActive:t,protectedKeys:{},needsAnimating:{},prevResolvedValues:{}}}function RE(){return{animate:Al(!0),whileInView:Al(),whileHover:Al(),whileTap:Al(),whileDrag:Al(),whileFocus:Al(),exit:Al()}}function cw(t,e){t.min=e.min,t.max=e.max}function ui(t,e){cw(t.x,e.x),cw(t.y,e.y)}function ME(t,e){t.translate=e.translate,t.scale=e.scale,t.originPoint=e.originPoint,t.origin=e.origin}const LR=1e-4,qB=1-LR,GB=1+LR,NR=.01,KB=0-NR,YB=0+NR;function jr(t){return t.max-t.min}function XB(t,e,n){return Math.abs(t-e)<=n}function IE(t,e,n,r=.5){t.origin=r,t.originPoint=Yt(e.min,e.max,t.origin),t.scale=jr(n)/jr(e),t.translate=Yt(n.min,n.max,t.origin)-t.originPoint,(t.scale>=qB&&t.scale<=GB||isNaN(t.scale))&&(t.scale=1),(t.translate>=KB&&t.translate<=YB||isNaN(t.translate))&&(t.translate=0)}function Wf(t,e,n,r){IE(t.x,e.x,n.x,r?r.originX:void 0),IE(t.y,e.y,n.y,r?r.originY:void 0)}function OE(t,e,n,r=0){const s=r?Yt(n.min,n.max,r):n.min;t.min=s+e.min,t.max=t.min+jr(e)}function QB(t,e,n,r){OE(t.x,e.x,n.x,r==null?void 0:r.x),OE(t.y,e.y,n.y,r==null?void 0:r.y)}function LE(t,e,n,r=0){const s=r?Yt(n.min,n.max,r):n.min;t.min=e.min-s,t.max=t.min+jr(e)}function dg(t,e,n,r){LE(t.x,e.x,n.x,r==null?void 0:r.x),LE(t.y,e.y,n.y,r==null?void 0:r.y)}function NE(t,e,n,r,s){return t-=e,t=ug(t,1/n,r),s!==void 0&&(t=ug(t,1/s,r)),t}function JB(t,e=0,n=1,r=.5,s,i=t,o=t){if(qi.test(e)&&(e=parseFloat(e),e=Yt(o.min,o.max,e/100)-o.min),typeof e!="number")return;let l=Yt(i.min,i.max,r);t===i&&(l-=e),t.min=NE(t.min,e,n,l,s),t.max=NE(t.max,e,n,l,s)}function DE(t,e,[n,r,s],i,o){JB(t,e[n],e[r],e[s],e.scale,i,o)}const eZ=["x","scaleX","originX"],tZ=["y","scaleY","originY"];function jE(t,e,n,r){DE(t.x,e,eZ,n?n.x:void 0,r?r.x:void 0),DE(t.y,e,tZ,n?n.y:void 0,r?r.y:void 0)}function $E(t){return t.translate===0&&t.scale===1}function DR(t){return $E(t.x)&&$E(t.y)}function FE(t,e){return t.min===e.min&&t.max===e.max}function nZ(t,e){return FE(t.x,e.x)&&FE(t.y,e.y)}function VE(t,e){return Math.round(t.min)===Math.round(e.min)&&Math.round(t.max)===Math.round(e.max)}function jR(t,e){return VE(t.x,e.x)&&VE(t.y,e.y)}function HE(t){return jr(t.x)/jr(t.y)}function zE(t,e){return t.translate===e.translate&&t.scale===e.scale&&t.originPoint===e.originPoint}function Ni(t){return[t("x"),t("y")]}function rZ(t,e,n){let r="";const s=t.x.translate/e.x,i=t.y.translate/e.y,o=(n==null?void 0:n.z)||0;if((s||i||o)&&(r=`translate3d(${s}px, ${i}px, ${o}px) `),(e.x!==1||e.y!==1)&&(r+=`scale(${1/e.x}, ${1/e.y}) `),n){const{transformPerspective:d,rotate:f,pathRotation:p,rotateX:g,rotateY:v,skewX:w,skewY:_}=n;d&&(r=`perspective(${d}px) ${r}`),f&&(r+=`rotate(${f}deg) `),p&&(r+=`rotate(${p}deg) `),g&&(r+=`rotateX(${g}deg) `),v&&(r+=`rotateY(${v}deg) `),w&&(r+=`skewX(${w}deg) `),_&&(r+=`skewY(${_}deg) `)}const l=t.x.scale*e.x,u=t.y.scale*e.y;return(l!==1||u!==1)&&(r+=`scale(${l}, ${u})`),r||"none"}const sZ=ib.length,UE=t=>typeof t=="string"?parseFloat(t):t,BE=t=>typeof t=="number"||Ve.test(t);function iZ(t,e,n,r,s,i){s?(t.opacity=Yt(0,n.opacity??1,oZ(r)),t.opacityExit=Yt(e.opacity??1,0,aZ(r))):i&&(t.opacity=Yt(e.opacity??1,n.opacity??1,r));for(let o=0;o<sZ;o++){const l=ib[o];let u=ZE(e,l),d=ZE(n,l);if(u===void 0&&d===void 0)continue;u||(u=0),d||(d=0),u===0||d===0||BE(u)===BE(d)?(t[l]=Math.max(Yt(UE(u),UE(d),r),0),(qi.test(d)||qi.test(u))&&(t[l]+="%")):t[l]=d}(e.rotate||n.rotate)&&(t.rotate=Yt(e.rotate||0,n.rotate||0,r))}function ZE(t,e){return t[e]!==void 0?t[e]:t.borderRadius}const oZ=$R(0,.5,RA),aZ=$R(.5,.95,Ys);function $R(t,e,n){return r=>r<t?0:r>e?1:n(gh(t,e,r))}function lZ(t,e,n){const r=mr(t)?t:od(t);return r.start(nb("",r,e,n)),r.animation}function _h(t,e,n,r={passive:!0}){return t.addEventListener(e,n,r),()=>t.removeEventListener(e,n,r)}const cZ=(t,e)=>t.depth-e.depth;class uZ{constructor(){this.children=[],this.isDirty=!1}add(e){Bx(this.children,e),this.isDirty=!0}remove(e){ng(this.children,e),this.isDirty=!0}forEach(e){this.isDirty&&this.children.sort(cZ),this.isDirty=!1,this.children.forEach(e)}}function dZ(t,e){const n=Dr.now(),r=({timestamp:s})=>{const i=s-n;i>=e&&(Wa(r),t(i-e))};return Xt.setup(r,!0),()=>Wa(r)}function am(t){return mr(t)?t.get():t}class fZ{constructor(){this.members=[]}add(e){Bx(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&&(ng(this.members,r),r.unmount())}e.scheduleRender()}remove(e){if(ng(this.members,e),e===this.prevLead&&(this.prevLead=void 0),e===this.lead){const n=this.members[this.members.length-1];n&&this.promote(n)}}relegate(e){var n;for(let r=this.members.indexOf(e)-1;r>=0;r--){const s=this.members[r];if(s.isPresent!==!1&&((n=s.instance)==null?void 0:n.isConnected)!==!1)return this.promote(s),!0}return!1}promote(e,n){var s;const r=this.lead;if(e!==r&&(this.prevLead=r,this.lead=e,e.show(),r)){r.updateSnapshot(),e.scheduleRender();const{layoutDependency:i}=r.options,{layoutDependency:o}=e.options;(i===void 0||i!==o)&&(e.resumeFrom=r,n&&(r.preserveOpacity=!0),r.snapshot&&(e.snapshot=r.snapshot,e.snapshot.latestValues=r.animationValues||r.latestValues),(s=e.root)!=null&&s.isUpdating&&(e.isLayoutDirty=!0)),e.options.crossfade===!1&&r.hide()}}exitAnimationComplete(){this.members.forEach(e=>{var n,r,s,i,o;(r=(n=e.options).onExitComplete)==null||r.call(n),(o=(s=e.resumingFrom)==null?void 0:(i=s.options).onExitComplete)==null||o.call(i)})}scheduleRender(){this.members.forEach(e=>e.instance&&e.scheduleRender(!1))}removeLeadSnapshot(){var e;(e=this.lead)!=null&&e.snapshot&&(this.lead.snapshot=void 0)}}const lm={hasAnimatedSinceResize:!0,hasEverUpdated:!1},Ky=["","X","Y","Z"],hZ=1e3;let pZ=0;function Yy(t,e,n,r){const{latestValues:s}=e;s[t]&&(n[t]=s[t],e.setStaticValue(t,0),r&&(r[t]=0))}function FR(t){if(t.hasCheckedOptimisedAppear=!0,t.root===t)return;const{visualElement:e}=t.options;if(!e)return;const n=aR(e);if(window.MotionHasOptimisedAnimation(n,"transform")){const{layout:s,layoutId:i}=t.options;window.MotionCancelOptimisedAnimation(n,"transform",Xt,!(s||i))}const{parent:r}=t;r&&!r.hasCheckedOptimisedAppear&&FR(r)}function VR({attachResizeListener:t,defaultParent:e,measureScroll:n,checkIsScrollRoot:r,resetTransform:s}){return class{constructor(o={},l=e==null?void 0:e()){this.id=pZ++,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(vZ),this.nodes.forEach(SZ),this.nodes.forEach(kZ),this.nodes.forEach(yZ)},this.resolvedRelativeTargetAt=0,this.linkedParentVersion=0,this.hasProjected=!1,this.isVisible=!0,this.animationProgress=0,this.sharedNodes=new Map,this.latestValues=o,this.root=l?l.root||l:this,this.path=l?[...l.path,l]:[],this.parent=l,this.depth=l?l.depth+1:0;for(let u=0;u<this.path.length;u++)this.path[u].shouldResetTransform=!0;this.root===this&&(this.nodes=new uZ)}addEventListener(o,l){return this.eventHandlers.has(o)||this.eventHandlers.set(o,new Zx),this.eventHandlers.get(o).add(l)}notifyListeners(o,...l){const u=this.eventHandlers.get(o);u&&u.notify(...l)}hasListeners(o){return this.eventHandlers.has(o)}mount(o){if(this.instance)return;this.isSVG=lb(o)&&!vB(o),this.instance=o;const{layoutId:l,layout:u,visualElement:d}=this.options;if(d&&!d.current&&d.mount(o),this.root.nodes.add(this),this.parent&&this.parent.children.add(this),this.root.hasTreeAnimated&&(u||l)&&(this.isLayoutDirty=!0),t){let f,p=0;const g=()=>this.root.updateBlockedByResize=!1;Xt.read(()=>{p=window.innerWidth}),t(o,()=>{const v=window.innerWidth;v!==p&&(p=v,this.root.updateBlockedByResize=!0,f&&f(),f=dZ(g,250),lm.hasAnimatedSinceResize&&(lm.hasAnimatedSinceResize=!1,this.nodes.forEach(GE)))})}l&&this.root.registerSharedNode(l,this),this.options.animate!==!1&&d&&(l||u)&&this.addEventListener("didUpdate",({delta:f,hasLayoutChanged:p,hasRelativeLayoutChanged:g,layout:v})=>{if(this.isTreeAnimationBlocked()){this.target=void 0,this.relativeTarget=void 0;return}const w=this.options.transition||d.getDefaultTransition()||AZ,{onLayoutAnimationStart:_,onLayoutAnimationComplete:x}=d.getProps(),S=!this.targetLayout||!jR(this.targetLayout,v),k=!p&&g;if(this.options.layoutRoot||this.resumeFrom||k||p&&(S||!this.currentAnimation)){this.resumeFrom&&(this.resumingFrom=this.resumeFrom,this.resumingFrom.resumingFrom=void 0);const C={...tb(w,"layout"),onPlay:_,onComplete:x};(d.shouldReduceMotion||this.options.layoutRoot)&&(C.delay=0,C.type=!1),this.startAnimation(C),this.setAnimationOrigin(f,k,C.path)}else p||GE(this),this.isLead()&&this.options.onExitComplete&&this.options.onExitComplete();this.targetLayout=v})}unmount(){this.options.layoutId&&this.willUpdate(),this.root.nodes.remove(this);const o=this.getStack();o&&o.remove(this),this.parent&&this.parent.children.delete(this),this.instance=void 0,this.eventHandlers.clear(),Wa(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(EZ),this.animationId++)}getTransformTemplate(){const{visualElement:o}=this.options;return o&&o.getProps().transformTemplate}willUpdate(o=!0){if(this.root.hasTreeAnimated=!0,this.root.isUpdateBlocked()){this.options.onExitComplete&&this.options.onExitComplete();return}if(window.MotionCancelOptimisedAnimation&&!this.hasCheckedOptimisedAppear&&FR(this),!this.root.isUpdating&&this.root.startUpdate(),this.isLayoutDirty)return;this.isLayoutDirty=!0;for(let f=0;f<this.path.length;f++){const p=this.path[f];p.shouldResetTransform=!0,(typeof p.latestValues.x=="string"||typeof p.latestValues.y=="string")&&(p.isLayoutDirty=!0),p.updateScroll("snapshot"),p.options.layoutRoot&&p.willUpdate(!1)}const{layoutId:l,layout:u}=this.options;if(l===void 0&&!u)return;const d=this.getTransformTemplate();this.prevTransformTemplateValue=d?d(this.latestValues,""):void 0,this.updateSnapshot(),o&&this.notifyListeners("willUpdate")}update(){if(this.updateScheduled=!1,this.isUpdateBlocked()){const u=this.updateBlockedByResize;this.unblockUpdate(),this.updateBlockedByResize=!1,this.clearAllSnapshots(),u&&this.nodes.forEach(wZ),this.nodes.forEach(WE);return}if(this.animationId<=this.animationCommitId){this.nodes.forEach(qE);return}this.animationCommitId=this.animationId,this.isUpdating?(this.isUpdating=!1,this.nodes.forEach(xZ),this.nodes.forEach(bZ),this.nodes.forEach(mZ),this.nodes.forEach(gZ)):this.nodes.forEach(qE),this.clearAllSnapshots();const l=Dr.now();fr.delta=Xi(0,1e3/60,l-fr.timestamp),fr.timestamp=l,fr.isProcessing=!0,Hy.update.process(fr),Hy.preRender.process(fr),Hy.render.process(fr),fr.isProcessing=!1}didUpdate(){this.updateScheduled||(this.updateScheduled=!0,ob.read(this.scheduleUpdate))}clearAllSnapshots(){this.nodes.forEach(_Z),this.sharedNodes.forEach(CZ)}scheduleUpdateProjection(){this.projectionUpdateScheduled||(this.projectionUpdateScheduled=!0,Xt.preRender(this.updateProjection,!1,!0))}scheduleCheckAfterUnmount(){Xt.postRender(()=>{this.isLayoutDirty?this.root.didUpdate():this.root.checkUpdateFailed()})}updateSnapshot(){this.snapshot||!this.instance||(this.snapshot=this.measure(),this.snapshot&&!jr(this.snapshot.measuredBox.x)&&!jr(this.snapshot.measuredBox.y)&&(this.snapshot=void 0))}updateLayout(){if(!this.instance||(this.updateScroll(),!(this.options.alwaysMeasureLayout&&this.isLead())&&!this.isLayoutDirty))return;if(this.resumeFrom&&!this.resumeFrom.instance)for(let u=0;u<this.path.length;u++)this.path[u].updateScroll();const o=this.layout;this.layout=this.measure(!1),this.layoutVersion++,this.layoutCorrected||(this.layoutCorrected=Kn()),this.isLayoutDirty=!1,this.projectionDelta=void 0,this.notifyListeners("measure",this.layout.layoutBox);const{visualElement:l}=this.options;l&&l.notify("LayoutMeasure",this.layout.layoutBox,o?o.layoutBox:void 0)}updateScroll(o="measure"){let l=!!(this.options.layoutScroll&&this.instance);if(this.scroll&&this.scroll.animationId===this.root.animationId&&this.scroll.phase===o&&(l=!1),l&&this.instance){const u=r(this.instance);this.scroll={animationId:this.root.animationId,phase:o,isRoot:u,offset:n(this.instance),wasRoot:this.scroll?this.scroll.isRoot:u}}}resetTransform(){if(!s)return;const o=this.isLayoutDirty||this.shouldResetTransform||this.options.alwaysMeasureLayout,l=this.projectionDelta&&!DR(this.projectionDelta),u=this.getTransformTemplate(),d=u?u(this.latestValues,""):void 0,f=d!==this.prevTransformTemplateValue;o&&this.instance&&(l||Hl(this.latestValues)||f)&&(s(this.instance,d),this.shouldResetTransform=!1,this.scheduleRender())}measure(o=!0){const l=this.measurePageBox();let u=this.removeElementScroll(l);return o&&(u=this.removeTransform(u)),RZ(u),{animationId:this.root.animationId,measuredBox:l,layoutBox:u,latestValues:{},source:this.id}}measurePageBox(){var d;const{visualElement:o}=this.options;if(!o)return Kn();const l=o.measureViewportBox();if(!(((d=this.scroll)==null?void 0:d.wasRoot)||this.path.some(MZ))){const{scroll:f}=this.root;f&&(Vi(l.x,f.offset.x),Vi(l.y,f.offset.y))}return l}removeElementScroll(o){var u;const l=Kn();if(ui(l,o),(u=this.scroll)!=null&&u.wasRoot)return l;for(let d=0;d<this.path.length;d++){const f=this.path[d],{scroll:p,options:g}=f;f!==this.root&&p&&g.layoutScroll&&(p.wasRoot&&ui(l,o),Vi(l.x,p.offset.x),Vi(l.y,p.offset.y))}return l}applyTransform(o,l=!1,u){var f,p;const d=u||Kn();ui(d,o);for(let g=0;g<this.path.length;g++){const v=this.path[g];!l&&v.options.layoutScroll&&v.scroll&&v!==v.root&&(Vi(d.x,-v.scroll.offset.x),Vi(d.y,-v.scroll.offset.y)),Hl(v.latestValues)&&om(d,v.latestValues,(f=v.layout)==null?void 0:f.layoutBox)}return Hl(this.latestValues)&&om(d,this.latestValues,(p=this.layout)==null?void 0:p.layoutBox),d}removeTransform(o){var u;const l=Kn();ui(l,o);for(let d=0;d<this.path.length;d++){const f=this.path[d];if(!Hl(f.latestValues))continue;let p;f.instance&&(ow(f.latestValues)&&f.updateSnapshot(),p=Kn(),ui(p,f.measurePageBox())),jE(l,f.latestValues,(u=f.snapshot)==null?void 0:u.layoutBox,p)}return Hl(this.latestValues)&&jE(l,this.latestValues),l}setTargetDelta(o){this.targetDelta=o,this.root.scheduleUpdateProjection(),this.isProjectionDirty=!0}setOptions(o){this.options={...this.options,...o,crossfade:o.crossfade!==void 0?o.crossfade:!0}}clearMeasurements(){this.scroll=void 0,this.layout=void 0,this.snapshot=void 0,this.prevTransformTemplateValue=void 0,this.targetDelta=void 0,this.target=void 0,this.isLayoutDirty=!1}forceRelativeParentToResolveTarget(){this.relativeParent&&this.relativeParent.resolvedRelativeTargetAt!==fr.timestamp&&this.relativeParent.resolveTargetDelta(!0)}resolveTargetDelta(o=!1){var v;const l=this.getLead();this.isProjectionDirty||(this.isProjectionDirty=l.isProjectionDirty),this.isTransformDirty||(this.isTransformDirty=l.isTransformDirty),this.isSharedProjectionDirty||(this.isSharedProjectionDirty=l.isSharedProjectionDirty);const u=!!this.resumingFrom||this!==l;if(!(o||u&&this.isSharedProjectionDirty||this.isProjectionDirty||(v=this.parent)!=null&&v.isProjectionDirty||this.attemptToResolveRelativeTarget||this.root.updateBlockedByResize))return;const{layout:f,layoutId:p}=this.options;if(!this.layout||!(f||p))return;this.resolvedRelativeTargetAt=fr.timestamp;const g=this.getClosestProjectingParent();g&&this.linkedParentVersion!==g.layoutVersion&&!g.options.layoutRoot&&this.removeRelativeTarget(),!this.targetDelta&&!this.relativeTarget&&(this.options.layoutAnchor!==!1&&g&&g.layout?this.createRelativeTarget(g,this.layout.layoutBox,g.layout.layoutBox):this.removeRelativeTarget()),!(!this.relativeTarget&&!this.targetDelta)&&(this.target||(this.target=Kn(),this.targetWithTransforms=Kn()),this.relativeTarget&&this.relativeTargetOrigin&&this.relativeParent&&this.relativeParent.target?(this.forceRelativeParentToResolveTarget(),QB(this.target,this.relativeTarget,this.relativeParent.target,this.options.layoutAnchor||void 0)):this.targetDelta?(this.resumingFrom?this.applyTransform(this.layout.layoutBox,!1,this.target):ui(this.target,this.layout.layoutBox),kR(this.target,this.targetDelta)):ui(this.target,this.layout.layoutBox),this.attemptToResolveRelativeTarget&&(this.attemptToResolveRelativeTarget=!1,this.options.layoutAnchor!==!1&&g&&!!g.resumingFrom==!!this.resumingFrom&&!g.options.layoutScroll&&g.target&&this.animationProgress!==1?this.createRelativeTarget(g,this.target,g.target):this.relativeParent=this.relativeTarget=void 0))}getClosestProjectingParent(){if(!(!this.parent||ow(this.parent.latestValues)||SR(this.parent.latestValues)))return this.parent.isProjecting()?this.parent:this.parent.getClosestProjectingParent()}isProjecting(){return!!((this.relativeTarget||this.targetDelta||this.options.layoutRoot)&&this.layout)}createRelativeTarget(o,l,u){this.relativeParent=o,this.linkedParentVersion=o.layoutVersion,this.forceRelativeParentToResolveTarget(),this.relativeTarget=Kn(),this.relativeTargetOrigin=Kn(),dg(this.relativeTargetOrigin,l,u,this.options.layoutAnchor||void 0),ui(this.relativeTarget,this.relativeTargetOrigin)}removeRelativeTarget(){this.relativeParent=this.relativeTarget=void 0}calcProjection(){var w;const o=this.getLead(),l=!!this.resumingFrom||this!==o;let u=!0;if((this.isProjectionDirty||(w=this.parent)!=null&&w.isProjectionDirty)&&(u=!1),l&&(this.isSharedProjectionDirty||this.isTransformDirty)&&(u=!1),this.resolvedRelativeTargetAt===fr.timestamp&&(u=!1),u)return;const{layout:d,layoutId:f}=this.options;if(this.isTreeAnimating=!!(this.parent&&this.parent.isTreeAnimating||this.currentAnimation||this.pendingAnimation),this.isTreeAnimating||(this.targetDelta=this.relativeTarget=void 0),!this.layout||!(d||f))return;ui(this.layoutCorrected,this.layout.layoutBox);const p=this.treeScale.x,g=this.treeScale.y;PB(this.layoutCorrected,this.treeScale,this.path,l),o.layout&&!o.target&&(this.treeScale.x!==1||this.treeScale.y!==1)&&(o.target=o.layout.layoutBox,o.targetWithTransforms=Kn());const{target:v}=o;if(!v){this.prevProjectionDelta&&(this.createProjectionDeltas(),this.scheduleRender());return}!this.projectionDelta||!this.prevProjectionDelta?this.createProjectionDeltas():(ME(this.prevProjectionDelta.x,this.projectionDelta.x),ME(this.prevProjectionDelta.y,this.projectionDelta.y)),Wf(this.projectionDelta,this.layoutCorrected,v,this.latestValues),(this.treeScale.x!==p||this.treeScale.y!==g||!zE(this.projectionDelta.x,this.prevProjectionDelta.x)||!zE(this.projectionDelta.y,this.prevProjectionDelta.y))&&(this.hasProjected=!0,this.scheduleRender(),this.notifyListeners("projectionUpdate",v))}hide(){this.isVisible=!1}show(){this.isVisible=!0}scheduleRender(o=!0){var l;if((l=this.options.visualElement)==null||l.scheduleRender(),o){const u=this.getStack();u&&u.scheduleRender()}this.resumingFrom&&!this.resumingFrom.instance&&(this.resumingFrom=void 0)}createProjectionDeltas(){this.prevProjectionDelta=Eu(),this.projectionDelta=Eu(),this.projectionDeltaWithTransform=Eu()}setAnimationOrigin(o,l=!1,u){const d=this.snapshot,f=d?d.latestValues:{},p={...this.latestValues},g=Eu();(!this.relativeParent||!this.relativeParent.options.layoutRoot)&&(this.relativeTarget=this.relativeTargetOrigin=void 0),this.attemptToResolveRelativeTarget=!l;const v=Kn(),w=d?d.source:void 0,_=this.layout?this.layout.source:void 0,x=w!==_,S=this.getStack(),k=!S||S.members.length<=1,C=!!(x&&!k&&this.options.crossfade===!0&&!this.path.some(TZ));this.animationProgress=0;let T;const A=u==null?void 0:u.interpolateProjection(o);this.mixTargetDelta=I=>{const M=I/1e3,R=A==null?void 0:A(M);R?(g.x.translate=R.x,g.x.scale=Yt(o.x.scale,1,M),g.x.origin=o.x.origin,g.x.originPoint=o.x.originPoint,g.y.translate=R.y,g.y.scale=Yt(o.y.scale,1,M),g.y.origin=o.y.origin,g.y.originPoint=o.y.originPoint):(KE(g.x,o.x,M),KE(g.y,o.y,M)),this.setTargetDelta(g),this.relativeTarget&&this.relativeTargetOrigin&&this.layout&&this.relativeParent&&this.relativeParent.layout&&(dg(v,this.layout.layoutBox,this.relativeParent.layout.layoutBox,this.options.layoutAnchor||void 0),PZ(this.relativeTarget,this.relativeTargetOrigin,v,M),T&&nZ(this.relativeTarget,T)&&(this.isProjectionDirty=!1),T||(T=Kn()),ui(T,this.relativeTarget)),x&&(this.animationValues=p,iZ(p,f,this.latestValues,M,C,k)),R&&R.rotate!==void 0&&(this.animationValues||(this.animationValues=p),this.animationValues.pathRotation=R.rotate),this.root.scheduleUpdateProjection(),this.scheduleRender(),this.animationProgress=M},this.mixTargetDelta(this.options.layoutRoot?1e3:0)}startAnimation(o){var l,u,d;this.notifyListeners("animationStart"),(l=this.currentAnimation)==null||l.stop(),(d=(u=this.resumingFrom)==null?void 0:u.currentAnimation)==null||d.stop(),this.pendingAnimation&&(Wa(this.pendingAnimation),this.pendingAnimation=void 0),this.pendingAnimation=Xt.update(()=>{lm.hasAnimatedSinceResize=!0,this.motionValue||(this.motionValue=od(0)),this.motionValue.jump(0,!1),this.currentAnimation=lZ(this.motionValue,[0,1e3],{...o,velocity:0,isSync:!0,onUpdate:f=>{this.mixTargetDelta(f),o.onUpdate&&o.onUpdate(f)},onComplete:()=>{o.onComplete&&o.onComplete(),this.completeAnimation()}}),this.resumingFrom&&(this.resumingFrom.currentAnimation=this.currentAnimation),this.pendingAnimation=void 0})}completeAnimation(){this.resumingFrom&&(this.resumingFrom.currentAnimation=void 0,this.resumingFrom.preserveOpacity=void 0);const o=this.getStack();o&&o.exitAnimationComplete(),this.resumingFrom=this.currentAnimation=this.animationValues=void 0,this.notifyListeners("animationComplete")}finishAnimation(){this.currentAnimation&&(this.mixTargetDelta&&this.mixTargetDelta(hZ),this.currentAnimation.stop()),this.completeAnimation()}applyTransformsToTarget(){const o=this.getLead();let{targetWithTransforms:l,target:u,layout:d,latestValues:f}=o;if(!(!l||!u||!d)){if(this!==o&&this.layout&&d&&HR(this.options.animationType,this.layout.layoutBox,d.layoutBox)){u=this.target||Kn();const p=jr(this.layout.layoutBox.x);u.x.min=o.target.x.min,u.x.max=u.x.min+p;const g=jr(this.layout.layoutBox.y);u.y.min=o.target.y.min,u.y.max=u.y.min+g}ui(l,u),om(l,f),Wf(this.projectionDeltaWithTransform,this.layoutCorrected,l,f)}}registerSharedNode(o,l){this.sharedNodes.has(o)||this.sharedNodes.set(o,new fZ),this.sharedNodes.get(o).add(l);const d=l.options.initialPromotionConfig;l.promote({transition:d?d.transition:void 0,preserveFollowOpacity:d&&d.shouldPreserveFollowOpacity?d.shouldPreserveFollowOpacity(l):void 0})}isLead(){const o=this.getStack();return o?o.lead===this:!0}getLead(){var l;const{layoutId:o}=this.options;return o?((l=this.getStack())==null?void 0:l.lead)||this:this}getPrevLead(){var l;const{layoutId:o}=this.options;return o?(l=this.getStack())==null?void 0:l.prevLead:void 0}getStack(){const{layoutId:o}=this.options;if(o)return this.root.sharedNodes.get(o)}promote({needsReset:o,transition:l,preserveFollowOpacity:u}={}){const d=this.getStack();d&&d.promote(this,u),o&&(this.projectionDelta=void 0,this.needsReset=!0),l&&this.setOptions({transition:l})}relegate(){const o=this.getStack();return o?o.relegate(this):!1}resetSkewAndRotation(){const{visualElement:o}=this.options;if(!o)return;let l=!1;const{latestValues:u}=o;if((u.z||u.rotate||u.rotateX||u.rotateY||u.rotateZ||u.skewX||u.skewY)&&(l=!0),!l)return;const d={};u.z&&Yy("z",o,d,this.animationValues);for(let f=0;f<Ky.length;f++)Yy(`rotate${Ky[f]}`,o,d,this.animationValues),Yy(`skew${Ky[f]}`,o,d,this.animationValues);o.render();for(const f in d)o.setStaticValue(f,d[f]),this.animationValues&&(this.animationValues[f]=d[f]);o.scheduleRender()}applyProjectionStyles(o,l){if(!this.instance||this.isSVG)return;if(!this.isVisible){o.visibility="hidden";return}const u=this.getTransformTemplate();if(this.needsReset){this.needsReset=!1,o.visibility="",o.opacity="",o.pointerEvents=am(l==null?void 0:l.pointerEvents)||"",o.transform=u?u(this.latestValues,""):"none";return}const d=this.getLead();if(!this.projectionDelta||!this.layout||!d.target){this.options.layoutId&&(o.opacity=this.latestValues.opacity!==void 0?this.latestValues.opacity:1,o.pointerEvents=am(l==null?void 0:l.pointerEvents)||""),this.hasProjected&&!Hl(this.latestValues)&&(o.transform=u?u({},""):"none",this.hasProjected=!1);return}o.visibility="";const f=d.animationValues||d.latestValues;this.applyTransformsToTarget();let p=rZ(this.projectionDeltaWithTransform,this.treeScale,f);u&&(p=u(f,p)),o.transform=p;const{x:g,y:v}=this.projectionDelta;o.transformOrigin=`${g.origin*100}% ${v.origin*100}% 0`,d.animationValues?o.opacity=d===this?f.opacity??this.latestValues.opacity??1:this.preserveOpacity?this.latestValues.opacity:f.opacityExit:o.opacity=d===this?f.opacity!==void 0?f.opacity:"":f.opacityExit!==void 0?f.opacityExit:0;for(const w in lw){if(f[w]===void 0)continue;const{correct:_,applyTo:x,isCSSVariable:S}=lw[w],k=p==="none"?f[w]:_(f[w],d);if(x){const C=x.length;for(let T=0;T<C;T++)o[x[T]]=k}else S?this.options.visualElement.renderState.vars[w]=k:o[w]=k}this.options.layoutId&&(o.pointerEvents=d===this?am(l==null?void 0:l.pointerEvents)||"":"none")}clearSnapshot(){this.resumeFrom=this.snapshot=void 0}resetTree(){this.root.nodes.forEach(o=>{var l;return(l=o.currentAnimation)==null?void 0:l.stop()}),this.root.nodes.forEach(WE),this.root.sharedNodes.clear()}}}function mZ(t){t.updateLayout()}function gZ(t){var n;const e=((n=t.resumeFrom)==null?void 0:n.snapshot)||t.snapshot;if(t.isLead()&&t.layout&&e&&t.hasListeners("didUpdate")){const{layoutBox:r,measuredBox:s}=t.layout,{animationType:i}=t.options,o=e.source!==t.layout.source;if(i==="size")Ni(p=>{const g=o?e.measuredBox[p]:e.layoutBox[p],v=jr(g);g.min=r[p].min,g.max=g.min+v});else if(i==="x"||i==="y"){const p=i==="x"?"y":"x";cw(o?e.measuredBox[p]:e.layoutBox[p],r[p])}else HR(i,e.layoutBox,r)&&Ni(p=>{const g=o?e.measuredBox[p]:e.layoutBox[p],v=jr(r[p]);g.max=g.min+v,t.relativeTarget&&!t.currentAnimation&&(t.isProjectionDirty=!0,t.relativeTarget[p].max=t.relativeTarget[p].min+v)});const l=Eu();Wf(l,r,e.layoutBox);const u=Eu();o?Wf(u,t.applyTransform(s,!0),e.measuredBox):Wf(u,r,e.layoutBox);const d=!DR(l);let f=!1;if(!t.resumeFrom){const p=t.getClosestProjectingParent();if(p&&!p.resumeFrom){const{snapshot:g,layout:v}=p;if(g&&v){const w=t.options.layoutAnchor||void 0,_=Kn();dg(_,e.layoutBox,g.layoutBox,w);const x=Kn();dg(x,r,v.layoutBox,w),jR(_,x)||(f=!0),p.options.layoutRoot&&(t.relativeTarget=x,t.relativeTargetOrigin=_,t.relativeParent=p)}}}t.notifyListeners("didUpdate",{layout:r,snapshot:e,delta:u,layoutDelta:l,hasLayoutChanged:d,hasRelativeLayoutChanged:f})}else if(t.isLead()){const{onExitComplete:r}=t.options;r&&r()}t.options.transition=void 0}function vZ(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 yZ(t){t.isProjectionDirty=t.isSharedProjectionDirty=t.isTransformDirty=!1}function _Z(t){t.clearSnapshot()}function WE(t){t.clearMeasurements()}function wZ(t){t.isLayoutDirty=!0,t.updateLayout()}function qE(t){t.isLayoutDirty=!1}function xZ(t){t.isAnimationBlocked&&t.layout&&!t.isLayoutDirty&&(t.snapshot=t.layout,t.isLayoutDirty=!0)}function bZ(t){const{visualElement:e}=t.options;e&&e.getProps().onBeforeLayoutMeasure&&e.notify("BeforeLayoutMeasure"),t.resetTransform()}function GE(t){t.finishAnimation(),t.targetDelta=t.relativeTarget=t.target=void 0,t.isProjectionDirty=!0}function SZ(t){t.resolveTargetDelta()}function kZ(t){t.calcProjection()}function EZ(t){t.resetSkewAndRotation()}function CZ(t){t.removeLeadSnapshot()}function KE(t,e,n){t.translate=Yt(e.translate,0,n),t.scale=Yt(e.scale,1,n),t.origin=e.origin,t.originPoint=e.originPoint}function YE(t,e,n,r){t.min=Yt(e.min,n.min,r),t.max=Yt(e.max,n.max,r)}function PZ(t,e,n,r){YE(t.x,e.x,n.x,r),YE(t.y,e.y,n.y,r)}function TZ(t){return t.animationValues&&t.animationValues.opacityExit!==void 0}const AZ={duration:.45,ease:[.4,0,.1,1]},XE=t=>typeof navigator<"u"&&navigator.userAgent&&navigator.userAgent.toLowerCase().includes(t),QE=XE("applewebkit/")&&!XE("chrome/")?Math.round:Ys;function JE(t){t.min=QE(t.min),t.max=QE(t.max)}function RZ(t){JE(t.x),JE(t.y)}function HR(t,e,n){return t==="position"||t==="preserve-aspect"&&!XB(HE(e),HE(n),.2)}function MZ(t){var e;return t!==t.root&&((e=t.scroll)==null?void 0:e.wasRoot)}const IZ=VR({attachResizeListener:(t,e)=>_h(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}),Xy={current:void 0},zR=VR({measureScroll:t=>({x:t.scrollLeft,y:t.scrollTop}),defaultParent:()=>{if(!Xy.current){const t=new IZ({});t.mount(window),t.setOptions({layoutScroll:!0}),Xy.current=t}return Xy.current},resetTransform:(t,e)=>{t.style.transform=e!==void 0?e:"none"},checkIsScrollRoot:t=>window.getComputedStyle(t).position==="fixed"}),pb=m.createContext({transformPagePoint:t=>t,isStatic:!1,reducedMotion:"never"});function eC(t,e){if(typeof t=="function")return t(e);t!=null&&(t.current=e)}function OZ(...t){return e=>{let n=!1;const r=t.map(s=>{const i=eC(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():eC(t[s],null)}}}}function LZ(...t){return m.useCallback(OZ(...t),t)}class NZ extends m.Component{getSnapshotBeforeUpdate(e){const n=this.props.childRef.current;if(nm(n)&&e.isPresent&&!this.props.isPresent&&this.props.pop!==!1){const r=n.offsetParent,s=nm(r)&&r.offsetWidth||0,i=nm(r)&&r.offsetHeight||0,o=getComputedStyle(n),l=this.props.sizeRef.current;l.height=parseFloat(o.height),l.width=parseFloat(o.width),l.top=n.offsetTop,l.left=n.offsetLeft,l.right=s-l.width-l.left,l.bottom=i-l.height-l.top,l.direction=o.direction}return null}componentDidUpdate(){}render(){return this.props.children}}function DZ({children:t,isPresent:e,anchorX:n,anchorY:r,root:s,pop:i}){var g;const o=m.useId(),l=m.useRef(null),u=m.useRef({width:0,height:0,top:0,left:0,right:0,bottom:0,direction:"ltr"}),{nonce:d}=m.useContext(pb),f=i!==!1?((g=t.props)==null?void 0:g.ref)??(t==null?void 0:t.ref):void 0,p=LZ(l,f);return m.useInsertionEffect(()=>{const{width:v,height:w,top:_,left:x,right:S,bottom:k,direction:C}=u.current;if(e||i===!1||!l.current||!v||!w)return;const T=C==="rtl",A=n==="left"?T?`right: ${S}`:`left: ${x}`:T?`left: ${x}`:`right: ${S}`,I=r==="bottom"?`bottom: ${k}`:`top: ${_}`;l.current.dataset.motionPopId=o;const M=document.createElement("style");d&&(M.nonce=d);const R=s??document.head;return R.appendChild(M),M.sheet&&M.sheet.insertRule(`
64
+ [data-motion-pop-id="${o}"] {
65
+ position: absolute !important;
66
+ width: ${v}px !important;
67
+ height: ${w}px !important;
68
+ ${A}px !important;
69
+ ${I}px !important;
70
+ }
71
+ `),()=>{var O;(O=l.current)==null||O.removeAttribute("data-motion-pop-id"),R.contains(M)&&R.removeChild(M)}},[e]),b.jsx(NZ,{isPresent:e,childRef:l,sizeRef:u,pop:i,children:i===!1?t:m.cloneElement(t,{ref:p})})}const jZ=({children:t,initial:e,isPresent:n,onExitComplete:r,custom:s,presenceAffectsLayout:i,mode:o,anchorX:l,anchorY:u,root:d})=>{const f=zx($Z),p=m.useId(),g=m.useRef(n),v=m.useRef(r);Ux(()=>{g.current=n,v.current=r});let w=!0,_=m.useMemo(()=>(w=!1,{id:p,initial:e,isPresent:n,custom:s,onExitComplete:x=>{f.set(x,!0);for(const S of f.values())if(!S)return;r&&r()},register:x=>(f.set(x,!1),()=>{var S;f.delete(x),!g.current&&!f.size&&((S=v.current)==null||S.call(v))})}),[n,f,r]);return i&&w&&(_={..._}),m.useMemo(()=>{f.forEach((x,S)=>f.set(S,!1))},[n]),m.useEffect(()=>{!n&&!f.size&&r&&r()},[n]),t=b.jsx(DZ,{pop:o==="popLayout",isPresent:n,anchorX:l,anchorY:u,root:d,children:t}),b.jsx(Fg.Provider,{value:_,children:t})};function $Z(){return new Map}function UR(t=!0){const e=m.useContext(Fg);if(e===null)return[!0,null];const{isPresent:n,onExitComplete:r,register:s}=e,i=m.useId();m.useEffect(()=>{if(t)return s(i)},[t]);const o=m.useCallback(()=>t&&r&&r(i),[i,r,t]);return!n&&r?[!1,o]:[!0]}const E0=t=>t.key||"";function tC(t){const e=[];return m.Children.forEach(t,n=>{m.isValidElement(n)&&e.push(n)}),e}const ks=({children:t,custom:e,initial:n=!0,onExitComplete:r,presenceAffectsLayout:s=!0,mode:i="sync",propagate:o=!1,anchorX:l="left",anchorY:u="top",root:d})=>{const[f,p]=UR(o),g=m.useMemo(()=>tC(t),[t]),v=o&&!f?[]:g.map(E0),w=m.useRef(!0),_=m.useRef(g),x=zx(()=>new Map),S=m.useRef(new Set),[k,C]=m.useState(g),[T,A]=m.useState(g);Ux(()=>{w.current=!1,_.current=g;for(let R=0;R<T.length;R++){const O=E0(T[R]);v.includes(O)?(x.delete(O),S.current.delete(O)):x.get(O)!==!0&&x.set(O,!1)}},[T,v.length,v.join("-")]);const I=[];if(g!==k){let R=[...g];for(let O=0;O<T.length;O++){const N=T[O],D=E0(N);v.includes(D)||(R.splice(O,0,N),I.push(N))}return i==="wait"&&I.length&&(R=I),A(tC(R)),C(g),null}const{forceRender:M}=m.useContext(Hx);return b.jsx(b.Fragment,{children:T.map(R=>{const O=E0(R),N=o&&!f?!1:g===T||v.includes(O),D=()=>{if(S.current.has(O))return;if(x.has(O))S.current.add(O),x.set(O,!0);else return;let $=!0;x.forEach(Y=>{Y||($=!1)}),$&&(M==null||M(),A(_.current),o&&(p==null||p()),r&&r())};return b.jsx(jZ,{isPresent:N,initial:!w.current||n?void 0:!1,custom:e,presenceAffectsLayout:s,mode:i,root:d,onExitComplete:N?void 0:D,anchorX:l,anchorY:u,children:R},O)})})},BR=m.createContext({strict:!1}),nC={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 rC=!1;function FZ(){if(rC)return;const t={};for(const e in nC)t[e]={isEnabled:n=>nC[e].some(r=>!!n[r])};wR(t),rC=!0}function ZR(){return FZ(),SB()}function VZ(t){const e=ZR();for(const n in t)e[n]={...e[n],...t[n]};wR(e)}const HZ=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 fg(t){return t.startsWith("while")||t.startsWith("drag")&&t!=="draggable"||t.startsWith("layout")||t.startsWith("onTap")||t.startsWith("onPan")||t.startsWith("onLayout")||HZ.has(t)}let WR=t=>!fg(t);function zZ(t){typeof t=="function"&&(WR=e=>e.startsWith("on")?!fg(e):t(e))}try{zZ(require("@emotion/is-prop-valid").default)}catch{}function UZ(t,e,n){const r={};for(const s in t)s==="values"&&typeof t.values=="object"||mr(t[s])||(WR(s)||n===!0&&fg(s)||!e&&!fg(s)||t.draggable&&s.startsWith("onDrag"))&&(r[s]=t[s]);return r}const Bg=m.createContext({});function BZ(t,e){if(Ug(t)){const{initial:n,animate:r}=t;return{initial:n===!1||yh(n)?n:void 0,animate:yh(r)?r:void 0}}return t.inherit!==!1?e:{}}function ZZ(t){const{initial:e,animate:n}=BZ(t,m.useContext(Bg));return m.useMemo(()=>({initial:e,animate:n}),[sC(e),sC(n)])}function sC(t){return Array.isArray(t)?t.join(" "):t}const mb=()=>({style:{},transform:{},transformOrigin:{},vars:{}});function qR(t,e,n){for(const r in e)!mr(e[r])&&!PR(r,n)&&(t[r]=e[r])}function WZ({transformTemplate:t},e){return m.useMemo(()=>{const n=mb();return fb(n,e,t),Object.assign({},n.vars,n.style)},[e])}function qZ(t,e){const n=t.style||{},r={};return qR(r,n,t),Object.assign(r,WZ(t,e)),r}function GZ(t,e){const n={},r=qZ(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 GR=()=>({...mb(),attrs:{}});function KZ(t,e,n,r){const s=m.useMemo(()=>{const i=GR();return TR(i,e,RR(r),t.transformTemplate,t.style),{...i.attrs,style:{...i.style}}},[e]);if(t.style){const i={};qR(i,t.style,t),s.style={...i,...s.style}}return s}const YZ=["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 gb(t){return typeof t!="string"||t.includes("-")?!1:!!(YZ.indexOf(t)>-1||/[A-Z]/u.test(t))}function XZ(t,e,n,{latestValues:r},s,i=!1,o){const u=(o??gb(t)?KZ:GZ)(e,r,s,t),d=UZ(e,typeof t=="string",i),f=t!==m.Fragment?{...d,...u,ref:n}:{},{children:p}=e,g=m.useMemo(()=>mr(p)?p.get():p,[p]);return m.createElement(t,{...f,children:g})}function QZ({scrapeMotionValuesFromProps:t,createRenderState:e},n,r,s){return{latestValues:JZ(n,r,s,t),renderState:e()}}function JZ(t,e,n,r){const s={},i=r(t,{});for(const g in i)s[g]=am(i[g]);let{initial:o,animate:l}=t;const u=Ug(t),d=yR(t);e&&d&&!u&&t.inherit!==!1&&(o===void 0&&(o=e.initial),l===void 0&&(l=e.animate));let f=n?n.initial===!1:!1;f=f||o===!1;const p=f?l:o;if(p&&typeof p!="boolean"&&!zg(p)){const g=Array.isArray(p)?p:[p];for(let v=0;v<g.length;v++){const w=rb(t,g[v]);if(w){const{transitionEnd:_,transition:x,...S}=w;for(const k in S){let C=S[k];if(Array.isArray(C)){const T=f?C.length-1:0;C=C[T]}C!==null&&(s[k]=C)}for(const k in _)s[k]=_[k]}}}return s}const KR=t=>(e,n)=>{const r=m.useContext(Bg),s=m.useContext(Fg),i=()=>QZ(t,e,r,s);return n?i():zx(i)},eW=KR({scrapeMotionValuesFromProps:hb,createRenderState:mb}),tW=KR({scrapeMotionValuesFromProps:MR,createRenderState:GR}),nW=Symbol.for("motionComponentSymbol");function rW(t,e,n){const r=m.useRef(n);m.useInsertionEffect(()=>{r.current=n});const s=m.useRef(null);return m.useCallback(i=>{var l;i&&((l=t.onMount)==null||l.call(t,i)),e&&(i?e.mount(i):e.unmount());const o=r.current;if(typeof o=="function")if(i){const u=o(i);typeof u=="function"&&(s.current=u)}else s.current?(s.current(),s.current=null):o(i);else o&&(o.current=i)},[e])}const YR=m.createContext({});function vu(t){return t&&typeof t=="object"&&Object.prototype.hasOwnProperty.call(t,"current")}function sW(t,e,n,r,s,i){var C,T;const{visualElement:o}=m.useContext(Bg),l=m.useContext(BR),u=m.useContext(Fg),d=m.useContext(pb),f=d.reducedMotion,p=d.skipAnimations,g=m.useRef(null),v=m.useRef(!1);r=r||l.renderer,!g.current&&r&&(g.current=r(t,{visualState:e,parent:o,props:n,presenceContext:u,blockInitialAnimation:u?u.initial===!1:!1,reducedMotionConfig:f,skipAnimations:p,isSVG:i}),v.current&&g.current&&(g.current.manuallyAnimateOnMount=!0));const w=g.current,_=m.useContext(YR);w&&!w.projection&&s&&(w.type==="html"||w.type==="svg")&&iW(g.current,n,s,_);const x=m.useRef(!1);m.useInsertionEffect(()=>{w&&x.current&&w.update(n,u)});const S=n[oR],k=m.useRef(!!S&&typeof window<"u"&&!((C=window.MotionHandoffIsComplete)!=null&&C.call(window,S))&&((T=window.MotionHasOptimisedAnimation)==null?void 0:T.call(window,S)));return Ux(()=>{v.current=!0,w&&(x.current=!0,window.MotionIsMounted=!0,w.updateFeatures(),w.scheduleRenderMicrotask(),k.current&&w.animationState&&w.animationState.animateChanges())}),m.useEffect(()=>{w&&(!k.current&&w.animationState&&w.animationState.animateChanges(),k.current&&(queueMicrotask(()=>{var A;(A=window.MotionHandoffMarkAsComplete)==null||A.call(window,S)}),k.current=!1),w.enteringChildren=void 0)}),w}function iW(t,e,n,r){const{layoutId:s,layout:i,drag:o,dragConstraints:l,layoutScroll:u,layoutRoot:d,layoutAnchor:f,layoutCrossfade:p}=e;t.projection=new n(t.latestValues,e["data-framer-portal-id"]?void 0:XR(t.parent)),t.projection.setOptions({layoutId:s,layout:i,alwaysMeasureLayout:!!o||l&&vu(l),visualElement:t,animationType:typeof i=="string"?i:"both",initialPromotionConfig:r,crossfade:p,layoutScroll:u,layoutRoot:d,layoutAnchor:f})}function XR(t){if(t)return t.options.allowProjection!==!1?t.projection:XR(t.parent)}function Qy(t,{forwardMotionProps:e=!1,type:n}={},r,s){r&&VZ(r);const i=n?n==="svg":gb(t),o=i?tW:eW;function l(d,f){let p;const g={...m.useContext(pb),...d,layoutId:oW(d)},{isStatic:v}=g,w=ZZ(d),_=o(d,v);if(!v&&typeof window<"u"){aW();const x=lW(g);p=x.MeasureLayout,w.visualElement=sW(t,_,g,s,x.ProjectionNode,i)}return b.jsxs(Bg.Provider,{value:w,children:[p&&w.visualElement?b.jsx(p,{visualElement:w.visualElement,...g}):null,XZ(t,d,rW(_,w.visualElement,f),_,v,e,i)]})}l.displayName=`motion.${typeof t=="string"?t:`create(${t.displayName??t.name??""})`}`;const u=m.forwardRef(l);return u[nW]=t,u}function oW({layoutId:t}){const e=m.useContext(Hx).id;return e&&t!==void 0?e+"-"+t:t}function aW(t,e){m.useContext(BR).strict}function lW(t){const e=ZR(),{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 cW(t,e){if(typeof Proxy>"u")return Qy;const n=new Map,r=(i,o)=>Qy(i,o,t,e),s=(i,o)=>r(i,o);return new Proxy(s,{get:(i,o)=>o==="create"?r:(n.has(o)||n.set(o,Qy(o,void 0,t,e)),n.get(o))})}const uW=(t,e)=>e.isSVG??gb(t)?new VB(e):new LB(e,{allowProjection:t!==m.Fragment});class dW extends el{constructor(e){super(e),e.animationState||(e.animationState=ZB(e))}updateAnimationControlsSubscription(){const{animate:e}=this.node.getProps();zg(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 fW=0;class hW extends el{constructor(){super(...arguments),this.id=fW++,this.isExitComplete=!1}update(){var i;if(!this.node.presenceContext)return;const{isPresent:e,onExitComplete:n}=this.node.presenceContext,{isPresent:r}=this.node.prevPresenceContext||{};if(!this.node.animationState||e===r)return;if(e&&r===!1){if(this.isExitComplete){const{initial:o,custom:l}=this.node.getProps();if(typeof o=="string"||typeof o=="object"&&o!==null&&!Array.isArray(o)){const u=oc(this.node,o,l);if(u){const{transition:d,transitionEnd:f,...p}=u;for(const g in p)(i=this.node.getValue(g))==null||i.jump(p[g])}}this.node.animationState.reset(),this.node.animationState.animateChanges()}else this.node.animationState.setActive("exit",!1);this.isExitComplete=!1;return}const s=this.node.animationState.setActive("exit",!e);n&&!e&&s.then(()=>{this.isExitComplete=!0,n(this.id)})}mount(){const{register:e,onExitComplete:n}=this.node.presenceContext||{};n&&n(this.id),e&&(this.unmount=e(this.id))}unmount(){}}const pW={animation:{Feature:dW},exit:{Feature:hW}};function Yh(t){return{point:{x:t.pageX,y:t.pageY}}}const mW=t=>e=>ab(e)&&t(e,Yh(e));function qf(t,e,n,r){return _h(t,e,mW(n),r)}const QR=({current:t})=>t?t.ownerDocument.defaultView:null,iC=(t,e)=>Math.abs(t-e);function gW(t,e){const n=iC(t.x,e.x),r=iC(t.y,e.y);return Math.sqrt(n**2+r**2)}const oC=new Set(["auto","scroll"]);class JR{constructor(e,n,{transformPagePoint:r,contextWindow:s=window,dragSnapToOrigin:i=!1,distanceThreshold:o=3,element:l}={}){if(this.startEvent=null,this.lastMoveEvent=null,this.lastMoveEventInfo=null,this.lastRawMoveEventInfo=null,this.handlers={},this.contextWindow=window,this.scrollPositions=new Map,this.removeScrollListeners=null,this.onElementScroll=w=>{this.handleScroll(w.target)},this.onWindowScroll=()=>{this.handleScroll(window)},this.updatePoint=()=>{if(!(this.lastMoveEvent&&this.lastMoveEventInfo))return;this.lastRawMoveEventInfo&&(this.lastMoveEventInfo=C0(this.lastRawMoveEventInfo,this.transformPagePoint));const w=Jy(this.lastMoveEventInfo,this.history),_=this.startEvent!==null,x=gW(w.offset,{x:0,y:0})>=this.distanceThreshold;if(!_&&!x)return;const{point:S}=w,{timestamp:k}=fr;this.history.push({...S,timestamp:k});const{onStart:C,onMove:T}=this.handlers;_||(C&&C(this.lastMoveEvent,w),this.startEvent=this.lastMoveEvent),T&&T(this.lastMoveEvent,w)},this.handlePointerMove=(w,_)=>{this.lastMoveEvent=w,this.lastRawMoveEventInfo=_,this.lastMoveEventInfo=C0(_,this.transformPagePoint),Xt.update(this.updatePoint,!0)},this.handlePointerUp=(w,_)=>{this.end();const{onEnd:x,onSessionEnd:S,resumeAnimation:k}=this.handlers;if((this.dragSnapToOrigin||!this.startEvent)&&k&&k(),!(this.lastMoveEvent&&this.lastMoveEventInfo))return;const C=Jy(w.type==="pointercancel"?this.lastMoveEventInfo:C0(_,this.transformPagePoint),this.history);this.startEvent&&x&&x(w,C),S&&S(w,C)},!ab(e))return;this.dragSnapToOrigin=i,this.handlers=n,this.transformPagePoint=r,this.distanceThreshold=o,this.contextWindow=s||window;const u=Yh(e),d=C0(u,this.transformPagePoint),{point:f}=d,{timestamp:p}=fr;this.history=[{...f,timestamp:p}];const{onSessionStart:g}=n;g&&g(e,Jy(d,this.history));const v={passive:!0,capture:!0};this.removeListeners=qh(qf(this.contextWindow,"pointermove",this.handlePointerMove,v),qf(this.contextWindow,"pointerup",this.handlePointerUp,v),qf(this.contextWindow,"pointercancel",this.handlePointerUp,v)),l&&this.startScrollTracking(l)}startScrollTracking(e){let n=e.parentElement;for(;n;){const r=getComputedStyle(n);(oC.has(r.overflowX)||oC.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),Xt.update(this.updatePoint,!0))}updateHandlers(e){this.handlers=e}end(){this.removeListeners&&this.removeListeners(),this.removeScrollListeners&&this.removeScrollListeners(),this.scrollPositions.clear(),Wa(this.updatePoint)}}function C0(t,e){return e?{point:e(t.point)}:t}function aC(t,e){return{x:t.x-e.x,y:t.y-e.y}}function Jy({point:t},e){return{point:t,delta:aC(t,eM(e)),offset:aC(t,vW(e)),velocity:yW(e,.1)}}function vW(t){return t[0]}function eM(t){return t[t.length-1]}function yW(t,e){if(t.length<2)return{x:0,y:0};let n=t.length-1,r=null;const s=eM(t);for(;n>=0&&(r=t[n],!(s.timestamp-r.timestamp>Ss(e)));)n--;if(!r)return{x:0,y:0};r===t[0]&&t.length>2&&s.timestamp-r.timestamp>Ss(e)*2&&(r=t[1]);const i=Ws(s.timestamp-r.timestamp);if(i===0)return{x:0,y:0};const o={x:(s.x-r.x)/i,y:(s.y-r.y)/i};return o.x===1/0&&(o.x=0),o.y===1/0&&(o.y=0),o}function _W(t,{min:e,max:n},r){return e!==void 0&&t<e?t=r?Yt(e,t,r.min):Math.max(t,e):n!==void 0&&t>n&&(t=r?Yt(n,t,r.max):Math.min(t,n)),t}function lC(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 wW(t,{top:e,left:n,bottom:r,right:s}){return{x:lC(t.x,n,s),y:lC(t.y,e,r)}}function cC(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 xW(t,e){return{x:cC(t.x,e.x),y:cC(t.y,e.y)}}function bW(t,e){let n=.5;const r=jr(t),s=jr(e);return s>r?n=gh(e.min,e.max-r,t.min):r>s&&(n=gh(t.min,t.max-s,e.min)),Xi(0,1,n)}function SW(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 uw=.35;function kW(t=uw){return t===!1?t=0:t===!0&&(t=uw),{x:uC(t,"left","right"),y:uC(t,"top","bottom")}}function uC(t,e,n){return{min:dC(t,e),max:dC(t,n)}}function dC(t,e){return typeof t=="number"?t:t[e]||0}const EW=new WeakMap;class CW{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=Kn(),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(Yh(p).point),this.stopAnimation()},o=(p,g)=>{const{drag:v,dragPropagation:w,onDragStart:_}=this.getProps();if(v&&!w&&(this.openDragLock&&this.openDragLock(),this.openDragLock=eB(v),!this.openDragLock))return;this.latestPointerEvent=p,this.latestPanInfo=g,this.isDragging=!0,this.currentDirection=null,this.resolveConstraints(),this.visualElement.projection&&(this.visualElement.projection.isAnimationBlocked=!0,this.visualElement.projection.target=void 0),Ni(S=>{let k=this.getAxisMotionValue(S).get()||0;if(qi.test(k)){const{projection:C}=this.visualElement;if(C&&C.layout){const T=C.layout.layoutBox[S];T&&(k=jr(T)*(parseFloat(k)/100))}}this.originPoint[S]=k}),_&&Xt.update(()=>_(p,g),!1,!0),tw(this.visualElement,"transform");const{animationState:x}=this.visualElement;x&&x.setActive("whileDrag",!0)},l=(p,g)=>{this.latestPointerEvent=p,this.latestPanInfo=g;const{dragPropagation:v,dragDirectionLock:w,onDirectionLock:_,onDrag:x}=this.getProps();if(!v&&!this.openDragLock)return;const{offset:S}=g;if(w&&this.currentDirection===null){this.currentDirection=TW(S),this.currentDirection!==null&&_&&_(this.currentDirection);return}this.updateAxis("x",g.point,S),this.updateAxis("y",g.point,S),this.visualElement.render(),x&&Xt.update(()=>x(p,g),!1,!0)},u=(p,g)=>{this.latestPointerEvent=p,this.latestPanInfo=g,this.stop(p,g),this.latestPointerEvent=null,this.latestPanInfo=null},d=()=>{const{dragSnapToOrigin:p}=this.getProps();(p||this.constraints)&&this.startAnimation({x:0,y:0})},{dragSnapToOrigin:f}=this.getProps();this.panSession=new JR(e,{onSessionStart:i,onStart:o,onMove:l,onSessionEnd:u,resumeAnimation:d},{transformPagePoint:this.visualElement.getTransformPagePoint(),dragSnapToOrigin:f,distanceThreshold:r,contextWindow:QR(this.visualElement),element:this.visualElement.current})}stop(e,n){const r=e||this.latestPointerEvent,s=n||this.latestPanInfo,i=this.isDragging;if(this.cancel(),!i||!s||!r)return;const{velocity:o}=s;this.startAnimation(o);const{onDragEnd:l}=this.getProps();l&&Xt.postRender(()=>l(r,s))}cancel(){this.isDragging=!1;const{projection:e,animationState:n}=this.visualElement;e&&(e.isAnimationBlocked=!1),this.endPanSession();const{dragPropagation:r}=this.getProps();!r&&this.openDragLock&&(this.openDragLock(),this.openDragLock=null),n&&n.setActive("whileDrag",!1)}endPanSession(){this.panSession&&this.panSession.end(),this.panSession=void 0}updateAxis(e,n,r){const{drag:s}=this.getProps();if(!r||!P0(e,s,this.currentDirection))return;const i=this.getAxisMotionValue(e);let o=this.originPoint[e]+r[e];this.constraints&&this.constraints[e]&&(o=_W(o,this.constraints[e],this.elastic[e])),i.set(o)}resolveConstraints(){var i;const{dragConstraints:e,dragElastic:n}=this.getProps(),r=this.visualElement.projection&&!this.visualElement.projection.layout?this.visualElement.projection.measure(!1):(i=this.visualElement.projection)==null?void 0:i.layout,s=this.constraints;e&&vu(e)?this.constraints||(this.constraints=this.resolveRefConstraints()):e&&r?this.constraints=wW(r.layoutBox,e):this.constraints=!1,this.elastic=kW(n),s!==this.constraints&&!vu(e)&&r&&this.constraints&&!this.hasMutatedConstraints&&Ni(o=>{this.constraints!==!1&&this.getAxisMotionValue(o)&&(this.constraints[o]=SW(r.layoutBox[o],this.constraints[o]))})}resolveRefConstraints(){const{dragConstraints:e,onMeasureDragConstraints:n}=this.getProps();if(!e||!vu(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=TB(r,s.root,this.visualElement.getTransformPagePoint());let o=xW(s.layout.layoutBox,i);if(n){const l=n(EB(o));this.hasMutatedConstraints=!!l,l&&(o=bR(l))}return o}startAnimation(e){const{drag:n,dragMomentum:r,dragElastic:s,dragTransition:i,dragSnapToOrigin:o,onDragTransitionEnd:l}=this.getProps(),u=this.constraints||{},d=Ni(f=>{if(!P0(f,n,this.currentDirection))return;let p=u&&u[f]||{};(o===!0||o===f)&&(p={min:0,max:0});const g=s?200:1e6,v=s?40:1e7,w={type:"inertia",velocity:r?e[f]:0,bounceStiffness:g,bounceDamping:v,timeConstant:750,restDelta:1,restSpeed:10,...i,...p};return this.startAxisValueAnimation(f,w)});return Promise.all(d).then(l)}startAxisValueAnimation(e,n){const r=this.getAxisMotionValue(e);return tw(this.visualElement,e),r.start(nb(e,r,0,n,this.visualElement,!1))}stopAnimation(){Ni(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){Ni(n=>{const{drag:r}=this.getProps();if(!P0(n,r,this.currentDirection))return;const{projection:s}=this.visualElement,i=this.getAxisMotionValue(n);if(s&&s.layout){const{min:o,max:l}=s.layout.layoutBox[n],u=i.get()||0;i.set(e[n]-Yt(o,l,.5)+u)}})}scalePositionWithinConstraints(){if(!this.visualElement.current)return;const{drag:e,dragConstraints:n}=this.getProps(),{projection:r}=this.visualElement;if(!vu(n)||!r||!this.constraints)return;this.stopAnimation();const s={x:0,y:0};Ni(o=>{const l=this.getAxisMotionValue(o);if(l&&this.constraints!==!1){const u=l.get();s[o]=bW({min:u,max:u},this.constraints[o])}});const{transformTemplate:i}=this.visualElement.getProps();this.visualElement.current.style.transform=i?i({},""):"none",r.root&&r.root.updateScroll(),r.updateLayout(),this.constraints=!1,this.resolveConstraints(),Ni(o=>{if(!P0(o,e,null))return;const l=this.getAxisMotionValue(o),{min:u,max:d}=this.constraints[o];l.set(Yt(u,d,s[o]))}),this.visualElement.render()}addListeners(){if(!this.visualElement.current)return;EW.set(this.visualElement,this);const e=this.visualElement.current,n=qf(e,"pointerdown",d=>{const{drag:f,dragListener:p=!0}=this.getProps(),g=d.target,v=g!==e&&oB(g);f&&p&&!v&&this.start(d)});let r;const s=()=>{const{dragConstraints:d}=this.getProps();vu(d)&&d.current&&(this.constraints=this.resolveRefConstraints(),r||(r=PW(e,d.current,()=>this.scalePositionWithinConstraints())))},{projection:i}=this.visualElement,o=i.addEventListener("measure",s);i&&!i.layout&&(i.root&&i.root.updateScroll(),i.updateLayout()),Xt.read(s);const l=_h(window,"resize",()=>this.scalePositionWithinConstraints()),u=i.addEventListener("didUpdate",(({delta:d,hasLayoutChanged:f})=>{this.isDragging&&f&&(Ni(p=>{const g=this.getAxisMotionValue(p);g&&(this.originPoint[p]+=d[p].translate,g.set(g.get()+d[p].translate))}),this.visualElement.render())}));return()=>{l(),n(),o(),u&&u(),r&&r()}}getProps(){const e=this.visualElement.getProps(),{drag:n=!1,dragDirectionLock:r=!1,dragPropagation:s=!1,dragConstraints:i=!1,dragElastic:o=uw,dragMomentum:l=!0}=e;return{...e,drag:n,dragDirectionLock:r,dragPropagation:s,dragConstraints:i,dragElastic:o,dragMomentum:l}}}function fC(t){let e=!0;return()=>{if(e){e=!1;return}t()}}function PW(t,e,n){const r=_E(t,fC(n)),s=_E(e,fC(n));return()=>{r(),s()}}function P0(t,e,n){return(e===!0||e===t)&&(n===null||n===t)}function TW(t,e=10){let n=null;return Math.abs(t.y)>e?n="y":Math.abs(t.x)>e&&(n="x"),n}class AW extends el{constructor(e){super(e),this.removeGroupControls=Ys,this.removeListeners=Ys,this.controls=new CW(e)}mount(){const{dragControls:e}=this.node.getProps();e&&(this.removeGroupControls=e.subscribe(this.controls)),this.removeListeners=this.controls.addListeners()||Ys}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 e_=t=>(e,n)=>{t&&Xt.update(()=>t(e,n),!1,!0)};class RW extends el{constructor(){super(...arguments),this.removePointerDownListener=Ys}onPointerDown(e){this.session=new JR(e,this.createPanHandlers(),{transformPagePoint:this.node.getTransformPagePoint(),contextWindow:QR(this.node)})}createPanHandlers(){const{onPanSessionStart:e,onPanStart:n,onPan:r,onPanEnd:s}=this.node.getProps();return{onSessionStart:e_(e),onStart:e_(n),onMove:e_(r),onEnd:(i,o)=>{delete this.session,s&&Xt.postRender(()=>s(i,o))}}}mount(){this.removePointerDownListener=qf(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 t_=!1;class MW extends m.Component{componentDidMount(){const{visualElement:e,layoutGroup:n,switchLayoutGroup:r,layoutId:s}=this.props,{projection:i}=e;i&&(n.group&&n.group.add(i),r&&r.register&&s&&r.register(i),t_&&i.root.didUpdate(),i.addEventListener("animationComplete",()=>{this.safeToRemove()}),i.setOptions({...i.options,layoutDependency:this.props.layoutDependency,onExitComplete:()=>this.safeToRemove()})),lm.hasEverUpdated=!0}getSnapshotBeforeUpdate(e){const{layoutDependency:n,visualElement:r,drag:s,isPresent:i}=this.props,{projection:o}=r;return o&&(o.isPresent=i,e.layoutDependency!==n&&o.setOptions({...o.options,layoutDependency:n}),t_=!0,s||e.layoutDependency!==n||n===void 0||e.isPresent!==i?o.willUpdate():this.safeToRemove(),e.isPresent!==i&&(i?o.promote():o.relegate()||Xt.postRender(()=>{const l=o.getStack();(!l||!l.members.length)&&this.safeToRemove()}))),null}componentDidUpdate(){const{visualElement:e,layoutAnchor:n}=this.props,{projection:r}=e;r&&(r.options.layoutAnchor=n,r.root.didUpdate(),ob.postRender(()=>{!r.currentAnimation&&r.isLead()&&this.safeToRemove()}))}componentWillUnmount(){const{visualElement:e,layoutGroup:n,switchLayoutGroup:r}=this.props,{projection:s}=e;t_=!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 tM(t){const[e,n]=UR(),r=m.useContext(Hx);return b.jsx(MW,{...t,layoutGroup:r,switchLayoutGroup:m.useContext(YR),isPresent:e,safeToRemove:n})}const IW={pan:{Feature:RW},drag:{Feature:AW,ProjectionNode:zR,MeasureLayout:tM}};function hC(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&&Xt.postRender(()=>i(e,Yh(e)))}class OW extends el{mount(){const{current:e}=this.node;e&&(this.unmount=nB(e,(n,r)=>(hC(this.node,r,"Start"),s=>hC(this.node,s,"End"))))}unmount(){}}class LW extends el{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=qh(_h(this.node.current,"focus",()=>this.onFocus()),_h(this.node.current,"blur",()=>this.onBlur()))}unmount(){}}function pC(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&&Xt.postRender(()=>i(e,Yh(e)))}class NW extends el{mount(){const{current:e}=this.node;if(!e)return;const{globalTapTarget:n,propagate:r}=this.node.props;this.unmount=lB(e,(s,i)=>(pC(this.node,i,"Start"),(o,{success:l})=>pC(this.node,o,l?"End":"Cancel")),{useGlobalTarget:n,stopPropagation:(r==null?void 0:r.tap)===!1})}unmount(){}}const dw=new WeakMap,n_=new WeakMap,DW=t=>{const e=dw.get(t.target);e&&e(t)},jW=t=>{t.forEach(DW)};function $W({root:t,...e}){const n=t||document;n_.has(n)||n_.set(n,{});const r=n_.get(n),s=JSON.stringify(e);return r[s]||(r[s]=new IntersectionObserver(jW,{root:t,...e})),r[s]}function FW(t,e,n){const r=$W(e);return dw.set(t,n),r.observe(t),()=>{dw.delete(t),r.unobserve(t)}}const VW={some:0,all:1};class HW extends el{constructor(){super(...arguments),this.hasEnteredView=!1,this.isInView=!1}startObserver(){var u;(u=this.stopObserver)==null||u.call(this);const{viewport:e={}}=this.node.getProps(),{root:n,margin:r,amount:s="some",once:i}=e,o={root:n?n.current:void 0,rootMargin:r,threshold:typeof s=="number"?s:VW[s]},l=d=>{const{isIntersecting:f}=d;if(this.isInView===f||(this.isInView=f,i&&!f&&this.hasEnteredView))return;f&&(this.hasEnteredView=!0),this.node.animationState&&this.node.animationState.setActive("whileInView",f);const{onViewportEnter:p,onViewportLeave:g}=this.node.getProps(),v=f?p:g;v&&v(d)};this.stopObserver=FW(this.node.current,o,l)}mount(){this.startObserver()}update(){if(typeof IntersectionObserver>"u")return;const{props:e,prevProps:n}=this.node;["amount","margin","root"].some(zW(e,n))&&this.startObserver()}unmount(){var e;(e=this.stopObserver)==null||e.call(this),this.hasEnteredView=!1,this.isInView=!1}}function zW({viewport:t={}},{viewport:e={}}={}){return n=>t[n]!==e[n]}const UW={inView:{Feature:HW},tap:{Feature:NW},focus:{Feature:LW},hover:{Feature:OW}},BW={layout:{ProjectionNode:zR,MeasureLayout:tM}},ZW={...pW,...UW,...IW,...BW},$o=cW(ZW,uW);function WW(){!db.current&&_R();const[t]=m.useState(lg.current);return t}const wi=$o;var Xh=fA();const qW=Mg(Xh);function GW(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 KW=t=>{switch(t){case"success":return QW;case"info":return eq;case"warning":return JW;case"error":return tq;default:return null}},YW=Array(12).fill(0),XW=({visible:t,className:e})=>we.createElement("div",{className:["sonner-loading-wrapper",e].filter(Boolean).join(" "),"data-visible":t},we.createElement("div",{className:"sonner-spinner"},YW.map((n,r)=>we.createElement("div",{className:"sonner-loading-bar",key:`spinner-bar-${r}`})))),QW=we.createElement("svg",{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 20 20",fill:"currentColor",height:"20",width:"20","aria-hidden":"true"},we.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"})),JW=we.createElement("svg",{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24",fill:"currentColor",height:"20",width:"20","aria-hidden":"true"},we.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"})),eq=we.createElement("svg",{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 20 20",fill:"currentColor",height:"20",width:"20","aria-hidden":"true"},we.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"})),tq=we.createElement("svg",{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 20 20",fill:"currentColor",height:"20",width:"20","aria-hidden":"true"},we.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"})),nq=we.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"},we.createElement("line",{x1:"18",y1:"6",x2:"6",y2:"18"}),we.createElement("line",{x1:"6",y1:"6",x2:"18",y2:"18"})),rq=()=>{const[t,e]=we.useState(document.hidden);return we.useEffect(()=>{const n=()=>{e(document.hidden)};return document.addEventListener("visibilitychange",n),()=>document.removeEventListener("visibilitychange",n)},[]),t};let sq=1;const iq=100,mC=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:sq++};class oq{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-iq;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=mC(e),i=this.pendingDismissals.get(s);i!==void 0&&(cancelAnimationFrame(i),this.pendingDismissals.delete(s),this.dismissedToasts.delete(s));const o=this.dismissedToasts.has(s),l=e.dismissible===void 0?!0:e.dismissible;return o&&(this.dismissedToasts.delete(s),this.toasts=this.toasts.filter(d=>d.id!==s)),(o?void 0:this.toasts.find(d=>d.id===s))?this.toasts=this.toasts.map(d=>d.id===s?(this.publish({...d,...e,id:s,title:n}),{...d,...e,id:s,dismissible:l,title:n}):d):this.addToast({title:n,...r,dismissible:l,id:s}),s},this.dismiss=e=>{if(e==null)return this.getActiveToasts().forEach(r=>{this.dismissedToasts.add(r.id),this.subscribers.forEach(s=>s({id:r.id,dismiss:!0}))}),e;this.dismissedToasts.add(e);const n=this.pendingDismissals.get(e);return n!==void 0&&cancelAnimationFrame(n),this.pendingDismissals.set(e,requestAnimationFrame(()=>{this.pendingDismissals.delete(e),this.subscribers.forEach(r=>r({id:e,dismiss:!0}))})),e},this.message=(e,n)=>this.create({...n,message:e,type:void 0}),this.error=(e,n)=>this.create({...n,message:e,type:"error"}),this.success=(e,n)=>this.create({...n,type:"success",message:e}),this.info=(e,n)=>this.create({...n,type:"info",message:e}),this.warning=(e,n)=>this.create({...n,type:"warning",message:e}),this.loading=(e,n)=>this.create({...n,type:"loading",message:e}),this.promise=(e,n)=>{if(!n)return;let r;n.loading!==void 0&&(r=this.create({...n,promise:e,type:"loading",message:n.loading,description:typeof n.description!="function"?n.description:void 0}));const s=Promise.resolve(e instanceof Function?e():e);let i=r!==void 0,o;const l=s.then(async d=>{if(o=["resolve",d],we.isValidElement(d))i=!1,this.create({id:r,type:"default",message:d});else if(lq(d)&&!d.ok){i=!1;const p=typeof n.error=="function"?await n.error(`HTTP error! status: ${d.status}`):n.error,g=typeof n.description=="function"?await n.description(`HTTP error! status: ${d.status}`):n.description,w=typeof p=="object"&&!we.isValidElement(p)?p:{message:p};this.create({id:r,type:"error",description:g,...w})}else if(d instanceof Error){i=!1;const p=typeof n.error=="function"?await n.error(d):n.error,g=typeof n.description=="function"?await n.description(d):n.description,w=typeof p=="object"&&!we.isValidElement(p)?p:{message:p};this.create({id:r,type:"error",description:g,...w})}else if(n.success!==void 0){i=!1;const p=typeof n.success=="function"?await n.success(d):n.success,g=typeof n.description=="function"?await n.description(d):n.description,w=typeof p=="object"&&!we.isValidElement(p)?p:{message:p};this.create({id:r,type:"success",description:g,...w})}}).catch(async d=>{if(o=["reject",d],n.error!==void 0){i=!1;const f=typeof n.error=="function"?await n.error(d):n.error,p=typeof n.description=="function"?await n.description(d):n.description,v=typeof f=="object"&&!we.isValidElement(f)?f:{message:f};this.create({id:r,type:"error",description:p,...v})}}).finally(()=>{i&&(this.dismiss(r),r=void 0),n.finally==null||n.finally.call(n)}),u=()=>new Promise((d,f)=>l.then(()=>o[0]==="reject"?f(o[1]):d(o[1])).catch(f));return typeof r!="string"&&typeof r!="number"?{unwrap:u}:Object.assign(r,{unwrap:u})},this.custom=(e,n)=>{const r=mC(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 qr=new oq,aq=(t,e)=>qr.message(t,e),lq=t=>t&&typeof t=="object"&&"ok"in t&&typeof t.ok=="boolean"&&"status"in t&&typeof t.status=="number",cq=aq,uq=()=>qr.toasts,dq=()=>qr.getActiveToasts(),Rt=Object.assign(cq,{success:qr.success,info:qr.info,warning:qr.warning,error:qr.error,custom:qr.custom,message:qr.message,promise:qr.promise,dismiss:qr.dismiss,loading:qr.loading},{getHistory:uq,getToasts:dq});GW("[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 T0(t){return t.label!==void 0}const fq=3,hq="24px",pq="16px",gC=4e3,mq=356,gq=14,vq=45,yq=200;function Ai(...t){return t.filter(Boolean).join(" ")}function _q(t){const[e,n]=t.split("-"),r=[];return e&&r.push(e),n&&r.push(n),r}const wq=t=>{var e,n,r,s,i,o,l,u,d;const{invert:f,toast:p,unstyled:g,interacting:v,setHeights:w,visibleToasts:_,heights:x,index:S,toasts:k,expanded:C,removeToast:T,defaultRichColors:A,closeButton:I,style:M,cancelButtonStyle:R,actionButtonStyle:O,className:N="",descriptionClassName:D="",duration:$,position:Y,gap:B,expandByDefault:G,classNames:V,icons:K,closeButtonAriaLabel:U="Close toast"}=t,[ee,Z]=we.useState(null),[j,Q]=we.useState(null),[oe,re]=we.useState(!1),[ie,fe]=we.useState(!1),[_e,ue]=we.useState(!1),[ae,Oe]=we.useState(!1),[Be,Ee]=we.useState(!1),[pt,Ot]=we.useState(0),[Qt,bt]=we.useState(0),_t=we.useRef(p.duration||$||gC),qe=we.useRef(null),Ke=we.useRef(null),Ct=S===0,Ae=S+1<=_,Ye=p.type,Lt=Ye??"default",Ge=p.dismissible!==!1,Pt=p.className||"",is=p.descriptionClassName||"",vr=we.useMemo(()=>x.findIndex(Xe=>Xe.toastId===p.id)||0,[x,p.id]),Le=we.useMemo(()=>{var Xe;return(Xe=p.closeButton)!=null?Xe:I},[p.closeButton,I]),Ko=we.useMemo(()=>p.duration||$||gC,[p.duration,$]),Ln=we.useRef(0),Qn=we.useRef(0),al=we.useRef(0),gn=we.useRef(null),[vn,Sd]=Y.split("-"),Ms=we.useMemo(()=>x.reduce((Xe,Nt,Vt)=>Vt>=vr?Xe:Xe+Nt.height,0),[x,vr]),yr=rq(),Jn=we.useMemo(()=>{var Xe;return(Xe=t.swipeDirections)!=null?Xe:_q(Y)},[t.swipeDirections,Y]),ro=p.invert||f,Qs=Ye==="loading";Qn.current=we.useMemo(()=>vr*B+Ms,[vr,Ms]),we.useEffect(()=>{_t.current=Ko},[Ko]),we.useEffect(()=>{re(!0)},[]),we.useEffect(()=>{const Xe=Ke.current;if(Xe){const Nt=Xe.getBoundingClientRect().height;return bt(Nt),w(Vt=>[{toastId:p.id,height:Nt,position:p.position},...Vt]),()=>w(Vt=>Vt.filter(Bn=>Bn.toastId!==p.id))}},[w,p.id]),we.useLayoutEffect(()=>{if(!oe)return;const Xe=Ke.current,Nt=Xe.style.height;Xe.style.height="auto";const Vt=Xe.getBoundingClientRect().height;Xe.style.height=Nt,bt(Vt),w(Bn=>Bn.find(Bt=>Bt.toastId===p.id)?Bn.map(Bt=>Bt.toastId===p.id?{...Bt,height:Vt}:Bt):[{toastId:p.id,height:Vt,position:p.position},...Bn])},[oe,p.title,p.description,w,p.id,p.jsx,p.action,p.cancel]);const Nn=we.useCallback(()=>{fe(!0),Ot(Qn.current),w(Xe=>Xe.filter(Nt=>Nt.toastId!==p.id)),setTimeout(()=>{T(p)},yq)},[p,T,w,Qn]);we.useEffect(()=>{if(p.promise&&Ye==="loading"||p.duration===1/0||p.type==="loading")return;let Xe;return C||v||yr?(()=>{if(al.current<Ln.current){const Bn=new Date().getTime()-Ln.current;_t.current=_t.current-Bn}al.current=new Date().getTime()})():(()=>{_t.current!==1/0&&(Ln.current=new Date().getTime(),Xe=setTimeout(()=>{p.onAutoClose==null||p.onAutoClose.call(p,p),Nn()},_t.current))})(),()=>clearTimeout(Xe)},[C,v,p,Ye,yr,Nn]),we.useEffect(()=>{p.delete&&(Nn(),p.onDismiss==null||p.onDismiss.call(p,p))},[Nn,p.delete]);function Is(){var Xe;if(K!=null&&K.loading){var Nt;return we.createElement("div",{className:Ai(V==null?void 0:V.loader,p==null||(Nt=p.classNames)==null?void 0:Nt.loader,"sonner-loader"),"data-visible":Ye==="loading"},K.loading)}return we.createElement(XW,{className:Ai(V==null?void 0:V.loader,p==null||(Xe=p.classNames)==null?void 0:Xe.loader),visible:Ye==="loading"})}const ll=p.icon||(K==null?void 0:K[Ye])||KW(Ye);var so,os;return we.createElement("li",{tabIndex:0,ref:Ke,className:Ai(N,Pt,V==null?void 0:V.toast,p==null||(e=p.classNames)==null?void 0:e.toast,V==null?void 0:V[Lt],p==null||(n=p.classNames)==null?void 0:n[Lt]),"data-sonner-toast":"","data-rich-colors":(so=p.richColors)!=null?so:A,"data-styled":!(p.jsx||p.unstyled||g),"data-mounted":oe,"data-promise":!!p.promise,"data-swiped":Be,"data-removed":ie,"data-visible":Ae,"data-y-position":vn,"data-x-position":Sd,"data-index":S,"data-front":Ct,"data-swiping":_e,"data-dismissible":Ge,"data-type":Ye,"data-invert":ro,"data-swipe-out":ae,"data-swipe-direction":j,"data-expanded":!!(C||G&&oe),"data-testid":p.testId,style:{"--index":S,"--toasts-before":S,"--z-index":k.length-S,"--offset":`${ie?pt:Qn.current}px`,"--initial-height":G?"auto":`${Qt}px`,...M,...p.style},onDragEnd:()=>{ue(!1),Z(null),gn.current=null},onPointerDown:Xe=>{Xe.button!==2&&(Qs||!Ge||(qe.current=new Date,Ot(Qn.current),Xe.target.setPointerCapture(Xe.pointerId),Xe.target.tagName!=="BUTTON"&&(ue(!0),gn.current={x:Xe.clientX,y:Xe.clientY})))},onPointerUp:()=>{var Xe,Nt,Vt;if(ae||!Ge)return;gn.current=null;const Bn=Number(((Xe=Ke.current)==null?void 0:Xe.style.getPropertyValue("--swipe-amount-x").replace("px",""))||0),as=Number(((Nt=Ke.current)==null?void 0:Nt.style.getPropertyValue("--swipe-amount-y").replace("px",""))||0),Bt=new Date().getTime()-((Vt=qe.current)==null?void 0:Vt.getTime()),Dn=ee==="x"?Bn:as,Vr=Math.abs(Dn)/Bt;if((ee==="x"?Jn.includes(Bn>0?"right":"left"):Jn.includes(as>0?"bottom":"top"))&&(Math.abs(Dn)>=vq||Vr>.11)){Ot(Qn.current),p.onDismiss==null||p.onDismiss.call(p,p),Q(ee==="x"?Bn>0?"right":"left":as>0?"down":"up"),Nn(),Oe(!0);return}else{var lr,An;(lr=Ke.current)==null||lr.style.setProperty("--swipe-amount-x","0px"),(An=Ke.current)==null||An.style.setProperty("--swipe-amount-y","0px")}Ee(!1),ue(!1),Z(null)},onPointerMove:Xe=>{var Nt,Vt,Bn;if(!gn.current||!Ge||((Nt=window.getSelection())==null?void 0:Nt.toString().length)>0)return;const Bt=Xe.clientY-gn.current.y,Dn=Xe.clientX-gn.current.x;!ee&&(Math.abs(Dn)>1||Math.abs(Bt)>1)&&Z(Math.abs(Dn)>Math.abs(Bt)?"x":"y");let Vr={x:0,y:0};const Js=lr=>1/(1.5+Math.abs(lr)/20);if(ee==="y"){if(Jn.includes("top")||Jn.includes("bottom"))if(Jn.includes("top")&&Bt<0||Jn.includes("bottom")&&Bt>0)Vr.y=Bt;else{const lr=Bt*Js(Bt);Vr.y=Math.abs(lr)<Math.abs(Bt)?lr:Bt}}else if(ee==="x"&&(Jn.includes("left")||Jn.includes("right")))if(Jn.includes("left")&&Dn<0||Jn.includes("right")&&Dn>0)Vr.x=Dn;else{const lr=Dn*Js(Dn);Vr.x=Math.abs(lr)<Math.abs(Dn)?lr:Dn}(Math.abs(Vr.x)>0||Math.abs(Vr.y)>0)&&Ee(!0),(Vt=Ke.current)==null||Vt.style.setProperty("--swipe-amount-x",`${Vr.x}px`),(Bn=Ke.current)==null||Bn.style.setProperty("--swipe-amount-y",`${Vr.y}px`)}},Le&&!p.jsx&&Ye!=="loading"?we.createElement("button",{"aria-label":U,"data-disabled":Qs,"data-close-button":!0,onClick:Qs||!Ge?()=>{}:()=>{Nn(),p.onDismiss==null||p.onDismiss.call(p,p)},className:Ai(V==null?void 0:V.closeButton,p==null||(r=p.classNames)==null?void 0:r.closeButton)},(os=K==null?void 0:K.close)!=null?os:nq):null,(Ye||p.icon||p.promise)&&p.icon!==null&&((K==null?void 0:K[Ye])!==null||p.icon)?we.createElement("div",{"data-icon":"",className:Ai(V==null?void 0:V.icon,p==null||(s=p.classNames)==null?void 0:s.icon)},Ye==="loading"?p.icon||Is():p.promise?Is():null,Ye!=="loading"?ll:null):null,we.createElement("div",{"data-content":"",className:Ai(V==null?void 0:V.content,p==null||(i=p.classNames)==null?void 0:i.content)},we.createElement("div",{"data-title":"",className:Ai(V==null?void 0:V.title,p==null||(o=p.classNames)==null?void 0:o.title)},p.jsx?p.jsx:typeof p.title=="function"?p.title():p.title),p.description?we.createElement("div",{"data-description":"",className:Ai(D,is,V==null?void 0:V.description,p==null||(l=p.classNames)==null?void 0:l.description)},typeof p.description=="function"?p.description():p.description):null),we.isValidElement(p.cancel)?p.cancel:p.cancel&&T0(p.cancel)?we.createElement("button",{"data-button":!0,"data-cancel":!0,style:p.cancelButtonStyle||R,onClick:Xe=>{T0(p.cancel)&&Ge&&(p.cancel.onClick==null||p.cancel.onClick.call(p.cancel,Xe),Nn())},className:Ai(V==null?void 0:V.cancelButton,p==null||(u=p.classNames)==null?void 0:u.cancelButton)},p.cancel.label):null,we.isValidElement(p.action)?p.action:p.action&&T0(p.action)?we.createElement("button",{"data-button":!0,"data-action":!0,style:p.actionButtonStyle||O,onClick:Xe=>{T0(p.action)&&(p.action.onClick==null||p.action.onClick.call(p.action,Xe),!Xe.defaultPrevented&&Nn())},className:Ai(V==null?void 0:V.actionButton,p==null||(d=p.classNames)==null?void 0:d.actionButton)},p.action.label):null)};function vC(){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 xq(t,e){const n={};return[t,e].forEach((r,s)=>{const i=s===1,o=i?"--mobile-offset":"--offset",l=i?pq:hq;function u(d){["top","right","bottom","left"].forEach(f=>{n[`${o}-${f}`]=typeof d=="number"?`${d}px`:d})}typeof r=="number"||typeof r=="string"?u(r):typeof r=="object"?["top","right","bottom","left"].forEach(d=>{r[d]===void 0?n[`${o}-${d}`]=l:n[`${o}-${d}`]=typeof r[d]=="number"?`${r[d]}px`:r[d]}):u(l)}),n}const bq=we.forwardRef(function(e,n){const{id:r,invert:s,position:i="bottom-right",hotkey:o=["altKey","KeyT"],expand:l,closeButton:u,className:d,offset:f,mobileOffset:p,theme:g="light",richColors:v,duration:w,style:_,visibleToasts:x=fq,toastOptions:S,dir:k=vC(),gap:C=gq,icons:T,customAriaLabel:A,containerAriaLabel:I="Notifications"}=e,[M,R]=we.useState([]),O=we.useMemo(()=>r?M.filter(re=>re.toasterId===r):M.filter(re=>!re.toasterId),[M,r]),N=we.useMemo(()=>Array.from(new Set([i].concat(O.filter(re=>re.position).map(re=>re.position)))),[O,i]),[D,$]=we.useState([]),[Y,B]=we.useState(!1),[G,V]=we.useState(!1),[K,U]=we.useState(g!=="system"?g:typeof window<"u"&&window.matchMedia&&window.matchMedia("(prefers-color-scheme: dark)").matches?"dark":"light"),ee=we.useRef(null),Z=o.join("+").replace(/Key/g,"").replace(/Digit/g,""),j=we.useRef(null),Q=we.useRef(!1),oe=we.useCallback(re=>{R(ie=>{var fe;return(fe=ie.find(_e=>_e.id===re.id))!=null&&fe.delete||qr.dismiss(re.id),ie.filter(({id:_e})=>_e!==re.id)})},[]);return we.useEffect(()=>qr.subscribe(re=>{if(re.dismiss){requestAnimationFrame(()=>{R(ie=>ie.map(fe=>fe.id===re.id?{...fe,delete:!0}:fe))});return}setTimeout(()=>{qW.flushSync(()=>{R(ie=>{const fe=ie.findIndex(_e=>_e.id===re.id);return fe!==-1?[...ie.slice(0,fe),{...ie[fe],...re},...ie.slice(fe+1)]:[re,...ie]})})})}),[]),we.useEffect(()=>{if(g!=="system"){U(g);return}if(g==="system"&&(window.matchMedia&&window.matchMedia("(prefers-color-scheme: dark)").matches?U("dark"):U("light")),typeof window>"u")return;const re=window.matchMedia("(prefers-color-scheme: dark)");try{re.addEventListener("change",({matches:ie})=>{U(ie?"dark":"light")})}catch{re.addListener(({matches:fe})=>{try{U(fe?"dark":"light")}catch(_e){console.error(_e)}})}},[g]),we.useEffect(()=>{M.length<=1&&B(!1)},[M]),we.useEffect(()=>{const re=ie=>{var fe;if(o.length>0&&o.every(ae=>ie[ae]||ie.code===ae)){var ue;B(!0),(ue=ee.current)==null||ue.focus()}ie.code==="Escape"&&(document.activeElement===ee.current||(fe=ee.current)!=null&&fe.contains(document.activeElement))&&B(!1)};return document.addEventListener("keydown",re),()=>document.removeEventListener("keydown",re)},[o]),we.useEffect(()=>{if(ee.current)return()=>{j.current&&(j.current.focus({preventScroll:!0}),j.current=null,Q.current=!1)}},[ee.current]),we.createElement("section",{ref:n,"aria-label":A??`${I} ${Z}`,tabIndex:-1,"aria-live":"polite","aria-relevant":"additions text","aria-atomic":"false",suppressHydrationWarning:!0,"data-react-aria-top-layer":!0},N.map((re,ie)=>{var fe;const[_e,ue]=re.split("-");return O.length?we.createElement("ol",{key:re,dir:k==="auto"?vC():k,tabIndex:-1,ref:ee,className:d,"data-sonner-toaster":!0,"data-sonner-theme":K,"data-y-position":_e,"data-x-position":ue,style:{"--front-toast-height":`${((fe=D[0])==null?void 0:fe.height)||0}px`,"--width":`${mq}px`,"--gap":`${C}px`,..._,...xq(f,p)},onBlur:ae=>{Q.current&&!ae.currentTarget.contains(ae.relatedTarget)&&(Q.current=!1,j.current&&(j.current.focus({preventScroll:!0}),j.current=null))},onFocus:ae=>{ae.target instanceof HTMLElement&&ae.target.dataset.dismissible==="false"||Q.current||(Q.current=!0,j.current=ae.relatedTarget)},onMouseEnter:()=>B(!0),onMouseMove:()=>B(!0),onMouseLeave:()=>{G||B(!1)},onDragEnd:()=>B(!1),onPointerDown:ae=>{ae.target instanceof HTMLElement&&ae.target.dataset.dismissible==="false"||V(!0)},onPointerUp:()=>V(!1)},O.filter(ae=>!ae.position&&ie===0||ae.position===re).map((ae,Oe)=>{var Be,Ee;return we.createElement(wq,{key:ae.id,icons:T,index:Oe,toast:ae,defaultRichColors:v,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:(Ee=S==null?void 0:S.closeButton)!=null?Ee:u,interacting:G,position:re,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(pt=>pt.position==ae.position),heights:D.filter(pt=>pt.position==ae.position),setHeights:$,expandByDefault:l,gap:C,expanded:Y,swipeDirections:e.swipeDirections})})):null}))}),Sq=new Map([["bold",m.createElement(m.Fragment,null,m.createElement("path",{d:"M228,128a12,12,0,0,1-12,12H69l51.52,51.51a12,12,0,0,1-17,17l-72-72a12,12,0,0,1,0-17l72-72a12,12,0,0,1,17,17L69,116H216A12,12,0,0,1,228,128Z"}))],["duotone",m.createElement(m.Fragment,null,m.createElement("path",{d:"M112,56V200L40,128Z",opacity:"0.2"}),m.createElement("path",{d:"M216,120H120V56a8,8,0,0,0-13.66-5.66l-72,72a8,8,0,0,0,0,11.32l72,72A8,8,0,0,0,120,200V136h96a8,8,0,0,0,0-16ZM104,180.69,51.31,128,104,75.31Z"}))],["fill",m.createElement(m.Fragment,null,m.createElement("path",{d:"M224,128a8,8,0,0,1-8,8H120v64a8,8,0,0,1-13.66,5.66l-72-72a8,8,0,0,1,0-11.32l72-72A8,8,0,0,1,120,56v64h96A8,8,0,0,1,224,128Z"}))],["light",m.createElement(m.Fragment,null,m.createElement("path",{d:"M222,128a6,6,0,0,1-6,6H54.49l61.75,61.76a6,6,0,1,1-8.48,8.48l-72-72a6,6,0,0,1,0-8.48l72-72a6,6,0,0,1,8.48,8.48L54.49,122H216A6,6,0,0,1,222,128Z"}))],["regular",m.createElement(m.Fragment,null,m.createElement("path",{d:"M224,128a8,8,0,0,1-8,8H59.31l58.35,58.34a8,8,0,0,1-11.32,11.32l-72-72a8,8,0,0,1,0-11.32l72-72a8,8,0,0,1,11.32,11.32L59.31,120H216A8,8,0,0,1,224,128Z"}))],["thin",m.createElement(m.Fragment,null,m.createElement("path",{d:"M220,128a4,4,0,0,1-4,4H49.66l65.17,65.17a4,4,0,0,1-5.66,5.66l-72-72a4,4,0,0,1,0-5.66l72-72a4,4,0,0,1,5.66,5.66L49.66,124H216A4,4,0,0,1,220,128Z"}))]]),kq=new Map([["bold",m.createElement(m.Fragment,null,m.createElement("path",{d:"M228,104a12,12,0,0,1-24,0V69l-59.51,59.51a12,12,0,0,1-17-17L187,52H152a12,12,0,0,1,0-24h64a12,12,0,0,1,12,12Zm-44,24a12,12,0,0,0-12,12v64H52V84h64a12,12,0,0,0,0-24H48A20,20,0,0,0,28,80V208a20,20,0,0,0,20,20H176a20,20,0,0,0,20-20V140A12,12,0,0,0,184,128Z"}))],["duotone",m.createElement(m.Fragment,null,m.createElement("path",{d:"M184,80V208a8,8,0,0,1-8,8H48a8,8,0,0,1-8-8V80a8,8,0,0,1,8-8H176A8,8,0,0,1,184,80Z",opacity:"0.2"}),m.createElement("path",{d:"M224,104a8,8,0,0,1-16,0V59.32l-66.33,66.34a8,8,0,0,1-11.32-11.32L196.68,48H152a8,8,0,0,1,0-16h64a8,8,0,0,1,8,8Zm-40,24a8,8,0,0,0-8,8v72H48V80h72a8,8,0,0,0,0-16H48A16,16,0,0,0,32,80V208a16,16,0,0,0,16,16H176a16,16,0,0,0,16-16V136A8,8,0,0,0,184,128Z"}))],["fill",m.createElement(m.Fragment,null,m.createElement("path",{d:"M192,136v72a16,16,0,0,1-16,16H48a16,16,0,0,1-16-16V80A16,16,0,0,1,48,64h72a8,8,0,0,1,0,16H48V208H176V136a8,8,0,0,1,16,0Zm32-96a8,8,0,0,0-8-8H152a8,8,0,0,0-5.66,13.66L172.69,72l-42.35,42.34a8,8,0,0,0,11.32,11.32L184,83.31l26.34,26.35A8,8,0,0,0,224,104Z"}))],["light",m.createElement(m.Fragment,null,m.createElement("path",{d:"M222,104a6,6,0,0,1-12,0V54.49l-69.75,69.75a6,6,0,0,1-8.48-8.48L201.51,46H152a6,6,0,0,1,0-12h64a6,6,0,0,1,6,6Zm-38,26a6,6,0,0,0-6,6v72a2,2,0,0,1-2,2H48a2,2,0,0,1-2-2V80a2,2,0,0,1,2-2h72a6,6,0,0,0,0-12H48A14,14,0,0,0,34,80V208a14,14,0,0,0,14,14H176a14,14,0,0,0,14-14V136A6,6,0,0,0,184,130Z"}))],["regular",m.createElement(m.Fragment,null,m.createElement("path",{d:"M224,104a8,8,0,0,1-16,0V59.32l-66.33,66.34a8,8,0,0,1-11.32-11.32L196.68,48H152a8,8,0,0,1,0-16h64a8,8,0,0,1,8,8Zm-40,24a8,8,0,0,0-8,8v72H48V80h72a8,8,0,0,0,0-16H48A16,16,0,0,0,32,80V208a16,16,0,0,0,16,16H176a16,16,0,0,0,16-16V136A8,8,0,0,0,184,128Z"}))],["thin",m.createElement(m.Fragment,null,m.createElement("path",{d:"M220,104a4,4,0,0,1-8,0V49.66l-73.16,73.17a4,4,0,0,1-5.66-5.66L206.34,44H152a4,4,0,0,1,0-8h64a4,4,0,0,1,4,4Zm-36,28a4,4,0,0,0-4,4v72a4,4,0,0,1-4,4H48a4,4,0,0,1-4-4V80a4,4,0,0,1,4-4h72a4,4,0,0,0,0-8H48A12,12,0,0,0,36,80V208a12,12,0,0,0,12,12H176a12,12,0,0,0,12-12V136A4,4,0,0,0,184,132Z"}))]]),Eq=new Map([["bold",m.createElement(m.Fragment,null,m.createElement("path",{d:"M208.49,120.49a12,12,0,0,1-17,0L140,69V216a12,12,0,0,1-24,0V69L64.49,120.49a12,12,0,0,1-17-17l72-72a12,12,0,0,1,17,0l72,72A12,12,0,0,1,208.49,120.49Z"}))],["duotone",m.createElement(m.Fragment,null,m.createElement("path",{d:"M200,112H56l72-72Z",opacity:"0.2"}),m.createElement("path",{d:"M205.66,106.34l-72-72a8,8,0,0,0-11.32,0l-72,72A8,8,0,0,0,56,120h64v96a8,8,0,0,0,16,0V120h64a8,8,0,0,0,5.66-13.66ZM75.31,104,128,51.31,180.69,104Z"}))],["fill",m.createElement(m.Fragment,null,m.createElement("path",{d:"M207.39,115.06A8,8,0,0,1,200,120H136v96a8,8,0,0,1-16,0V120H56a8,8,0,0,1-5.66-13.66l72-72a8,8,0,0,1,11.32,0l72,72A8,8,0,0,1,207.39,115.06Z"}))],["light",m.createElement(m.Fragment,null,m.createElement("path",{d:"M204.24,116.24a6,6,0,0,1-8.48,0L134,54.49V216a6,6,0,0,1-12,0V54.49L60.24,116.24a6,6,0,0,1-8.48-8.48l72-72a6,6,0,0,1,8.48,0l72,72A6,6,0,0,1,204.24,116.24Z"}))],["regular",m.createElement(m.Fragment,null,m.createElement("path",{d:"M205.66,117.66a8,8,0,0,1-11.32,0L136,59.31V216a8,8,0,0,1-16,0V59.31L61.66,117.66a8,8,0,0,1-11.32-11.32l72-72a8,8,0,0,1,11.32,0l72,72A8,8,0,0,1,205.66,117.66Z"}))],["thin",m.createElement(m.Fragment,null,m.createElement("path",{d:"M202.83,114.83a4,4,0,0,1-5.66,0L132,49.66V216a4,4,0,0,1-8,0V49.66L58.83,114.83a4,4,0,0,1-5.66-5.66l72-72a4,4,0,0,1,5.66,0l72,72A4,4,0,0,1,202.83,114.83Z"}))]]),Cq=new Map([["bold",m.createElement(m.Fragment,null,m.createElement("path",{d:"M216.49,104.49l-80,80a12,12,0,0,1-17,0l-80-80a12,12,0,0,1,17-17L128,159l71.51-71.52a12,12,0,0,1,17,17Z"}))],["duotone",m.createElement(m.Fragment,null,m.createElement("path",{d:"M208,96l-80,80L48,96Z",opacity:"0.2"}),m.createElement("path",{d:"M215.39,92.94A8,8,0,0,0,208,88H48a8,8,0,0,0-5.66,13.66l80,80a8,8,0,0,0,11.32,0l80-80A8,8,0,0,0,215.39,92.94ZM128,164.69,67.31,104H188.69Z"}))],["fill",m.createElement(m.Fragment,null,m.createElement("path",{d:"M213.66,101.66l-80,80a8,8,0,0,1-11.32,0l-80-80A8,8,0,0,1,48,88H208a8,8,0,0,1,5.66,13.66Z"}))],["light",m.createElement(m.Fragment,null,m.createElement("path",{d:"M212.24,100.24l-80,80a6,6,0,0,1-8.48,0l-80-80a6,6,0,0,1,8.48-8.48L128,167.51l75.76-75.75a6,6,0,0,1,8.48,8.48Z"}))],["regular",m.createElement(m.Fragment,null,m.createElement("path",{d:"M213.66,101.66l-80,80a8,8,0,0,1-11.32,0l-80-80A8,8,0,0,1,53.66,90.34L128,164.69l74.34-74.35a8,8,0,0,1,11.32,11.32Z"}))],["thin",m.createElement(m.Fragment,null,m.createElement("path",{d:"M210.83,98.83l-80,80a4,4,0,0,1-5.66,0l-80-80a4,4,0,0,1,5.66-5.66L128,170.34l77.17-77.17a4,4,0,1,1,5.66,5.66Z"}))]]),Pq=new Map([["bold",m.createElement(m.Fragment,null,m.createElement("path",{d:"M184.49,136.49l-80,80a12,12,0,0,1-17-17L159,128,87.51,56.49a12,12,0,1,1,17-17l80,80A12,12,0,0,1,184.49,136.49Z"}))],["duotone",m.createElement(m.Fragment,null,m.createElement("path",{d:"M176,128,96,208V48Z",opacity:"0.2"}),m.createElement("path",{d:"M181.66,122.34l-80-80A8,8,0,0,0,88,48V208a8,8,0,0,0,13.66,5.66l80-80A8,8,0,0,0,181.66,122.34ZM104,188.69V67.31L164.69,128Z"}))],["fill",m.createElement(m.Fragment,null,m.createElement("path",{d:"M181.66,133.66l-80,80A8,8,0,0,1,88,208V48a8,8,0,0,1,13.66-5.66l80,80A8,8,0,0,1,181.66,133.66Z"}))],["light",m.createElement(m.Fragment,null,m.createElement("path",{d:"M180.24,132.24l-80,80a6,6,0,0,1-8.48-8.48L167.51,128,91.76,52.24a6,6,0,0,1,8.48-8.48l80,80A6,6,0,0,1,180.24,132.24Z"}))],["regular",m.createElement(m.Fragment,null,m.createElement("path",{d:"M181.66,133.66l-80,80a8,8,0,0,1-11.32-11.32L164.69,128,90.34,53.66a8,8,0,0,1,11.32-11.32l80,80A8,8,0,0,1,181.66,133.66Z"}))],["thin",m.createElement(m.Fragment,null,m.createElement("path",{d:"M178.83,130.83l-80,80a4,4,0,0,1-5.66-5.66L170.34,128,93.17,50.83a4,4,0,0,1,5.66-5.66l80,80A4,4,0,0,1,178.83,130.83Z"}))]]),Tq=new Map([["bold",m.createElement(m.Fragment,null,m.createElement("path",{d:"M128,20A108,108,0,0,0,31.85,177.23L21,209.66A20,20,0,0,0,46.34,235l32.43-10.81A108,108,0,1,0,128,20Zm0,192a84,84,0,0,1-42.06-11.27,12,12,0,0,0-6-1.62,12.1,12.1,0,0,0-3.8.62l-29.79,9.93,9.93-29.79a12,12,0,0,0-1-9.81A84,84,0,1,1,128,212Z"}))],["duotone",m.createElement(m.Fragment,null,m.createElement("path",{d:"M224,128A96,96,0,0,1,79.93,211.11h0L42.54,223.58a8,8,0,0,1-10.12-10.12l12.47-37.39h0A96,96,0,1,1,224,128Z",opacity:"0.2"}),m.createElement("path",{d:"M128,24A104,104,0,0,0,36.18,176.88L24.83,210.93a16,16,0,0,0,20.24,20.24l34.05-11.35A104,104,0,1,0,128,24Zm0,192a87.87,87.87,0,0,1-44.06-11.81,8,8,0,0,0-6.54-.67L40,216,52.47,178.6a8,8,0,0,0-.66-6.54A88,88,0,1,1,128,216Z"}))],["fill",m.createElement(m.Fragment,null,m.createElement("path",{d:"M232,128A104,104,0,0,1,79.12,219.82L45.07,231.17a16,16,0,0,1-20.24-20.24l11.35-34.05A104,104,0,1,1,232,128Z"}))],["light",m.createElement(m.Fragment,null,m.createElement("path",{d:"M128,26A102,102,0,0,0,38.35,176.69L26.73,211.56a14,14,0,0,0,17.71,17.71l34.87-11.62A102,102,0,1,0,128,26Zm0,192a90,90,0,0,1-45.06-12.08,6.09,6.09,0,0,0-3-.81,6.2,6.2,0,0,0-1.9.31L40.65,217.88a2,2,0,0,1-2.53-2.53L50.58,178a6,6,0,0,0-.5-4.91A90,90,0,1,1,128,218Z"}))],["regular",m.createElement(m.Fragment,null,m.createElement("path",{d:"M128,24A104,104,0,0,0,36.18,176.88L24.83,210.93a16,16,0,0,0,20.24,20.24l34.05-11.35A104,104,0,1,0,128,24Zm0,192a87.87,87.87,0,0,1-44.06-11.81,8,8,0,0,0-6.54-.67L40,216,52.47,178.6a8,8,0,0,0-.66-6.54A88,88,0,1,1,128,216Z"}))],["thin",m.createElement(m.Fragment,null,m.createElement("path",{d:"M128,28A100,100,0,0,0,40.53,176.5l-11.9,35.69a12,12,0,0,0,15.18,15.18l35.69-11.9A100,100,0,1,0,128,28Zm0,192a92,92,0,0,1-46.07-12.35,4.05,4.05,0,0,0-2-.54,3.93,3.93,0,0,0-1.27.21L41.28,219.78a4,4,0,0,1-5.06-5.06l12.46-37.38a4,4,0,0,0-.33-3.27A92,92,0,1,1,128,220Z"}))]]),Aq=new Map([["bold",m.createElement(m.Fragment,null,m.createElement("path",{d:"M232.49,80.49l-128,128a12,12,0,0,1-17,0l-56-56a12,12,0,1,1,17-17L96,183,215.51,63.51a12,12,0,0,1,17,17Z"}))],["duotone",m.createElement(m.Fragment,null,m.createElement("path",{d:"M232,56V200a16,16,0,0,1-16,16H40a16,16,0,0,1-16-16V56A16,16,0,0,1,40,40H216A16,16,0,0,1,232,56Z",opacity:"0.2"}),m.createElement("path",{d:"M205.66,85.66l-96,96a8,8,0,0,1-11.32,0l-40-40a8,8,0,0,1,11.32-11.32L104,164.69l90.34-90.35a8,8,0,0,1,11.32,11.32Z"}))],["fill",m.createElement(m.Fragment,null,m.createElement("path",{d:"M216,40H40A16,16,0,0,0,24,56V200a16,16,0,0,0,16,16H216a16,16,0,0,0,16-16V56A16,16,0,0,0,216,40ZM205.66,85.66l-96,96a8,8,0,0,1-11.32,0l-40-40a8,8,0,0,1,11.32-11.32L104,164.69l90.34-90.35a8,8,0,0,1,11.32,11.32Z"}))],["light",m.createElement(m.Fragment,null,m.createElement("path",{d:"M228.24,76.24l-128,128a6,6,0,0,1-8.48,0l-56-56a6,6,0,0,1,8.48-8.48L96,191.51,219.76,67.76a6,6,0,0,1,8.48,8.48Z"}))],["regular",m.createElement(m.Fragment,null,m.createElement("path",{d:"M229.66,77.66l-128,128a8,8,0,0,1-11.32,0l-56-56a8,8,0,0,1,11.32-11.32L96,188.69,218.34,66.34a8,8,0,0,1,11.32,11.32Z"}))],["thin",m.createElement(m.Fragment,null,m.createElement("path",{d:"M226.83,74.83l-128,128a4,4,0,0,1-5.66,0l-56-56a4,4,0,0,1,5.66-5.66L96,194.34,221.17,69.17a4,4,0,1,1,5.66,5.66Z"}))]]),Rq=new Map([["bold",m.createElement(m.Fragment,null,m.createElement("path",{d:"M236,128a108,108,0,0,1-216,0c0-42.52,24.73-81.34,63-98.9A12,12,0,1,1,93,50.91C63.24,64.57,44,94.83,44,128a84,84,0,0,0,168,0c0-33.17-19.24-63.43-49-77.09A12,12,0,1,1,173,29.1C211.27,46.66,236,85.48,236,128Z"}))],["duotone",m.createElement(m.Fragment,null,m.createElement("path",{d:"M224,128a96,96,0,1,1-96-96A96,96,0,0,1,224,128Z",opacity:"0.2"}),m.createElement("path",{d:"M232,128a104,104,0,0,1-208,0c0-41,23.81-78.36,60.66-95.27a8,8,0,0,1,6.68,14.54C60.15,61.59,40,93.27,40,128a88,88,0,0,0,176,0c0-34.73-20.15-66.41-51.34-80.73a8,8,0,0,1,6.68-14.54C208.19,49.64,232,87,232,128Z"}))],["fill",m.createElement(m.Fragment,null,m.createElement("path",{d:"M128,24A104,104,0,1,0,232,128,104.11,104.11,0,0,0,128,24Zm0,176A72,72,0,0,1,92,65.64a8,8,0,0,1,8,13.85,56,56,0,1,0,56,0,8,8,0,0,1,8-13.85A72,72,0,0,1,128,200Z"}))],["light",m.createElement(m.Fragment,null,m.createElement("path",{d:"M230,128a102,102,0,0,1-204,0c0-40.18,23.35-76.86,59.5-93.45a6,6,0,0,1,5,10.9C58.61,60.09,38,92.49,38,128a90,90,0,0,0,180,0c0-35.51-20.61-67.91-52.5-82.55a6,6,0,0,1,5-10.9C206.65,51.14,230,87.82,230,128Z"}))],["regular",m.createElement(m.Fragment,null,m.createElement("path",{d:"M232,128a104,104,0,0,1-208,0c0-41,23.81-78.36,60.66-95.27a8,8,0,0,1,6.68,14.54C60.15,61.59,40,93.27,40,128a88,88,0,0,0,176,0c0-34.73-20.15-66.41-51.34-80.73a8,8,0,0,1,6.68-14.54C208.19,49.64,232,87,232,128Z"}))],["thin",m.createElement(m.Fragment,null,m.createElement("path",{d:"M228,128a100,100,0,0,1-200,0c0-39.4,22.9-75.37,58.33-91.63a4,4,0,1,1,3.34,7.27C57.07,58.6,36,91.71,36,128a92,92,0,0,0,184,0c0-36.29-21.07-69.4-53.67-84.36a4,4,0,1,1,3.34-7.27C205.1,52.63,228,88.6,228,128Z"}))]]),Mq=new Map([["bold",m.createElement(m.Fragment,null,m.createElement("path",{d:"M216,28H88A12,12,0,0,0,76,40V76H40A12,12,0,0,0,28,88V216a12,12,0,0,0,12,12H168a12,12,0,0,0,12-12V180h36a12,12,0,0,0,12-12V40A12,12,0,0,0,216,28ZM156,204H52V100H156Zm48-48H180V88a12,12,0,0,0-12-12H100V52H204Z"}))],["duotone",m.createElement(m.Fragment,null,m.createElement("path",{d:"M216,40V168H168V88H88V40Z",opacity:"0.2"}),m.createElement("path",{d:"M216,32H88a8,8,0,0,0-8,8V80H40a8,8,0,0,0-8,8V216a8,8,0,0,0,8,8H168a8,8,0,0,0,8-8V176h40a8,8,0,0,0,8-8V40A8,8,0,0,0,216,32ZM160,208H48V96H160Zm48-48H176V88a8,8,0,0,0-8-8H96V48H208Z"}))],["fill",m.createElement(m.Fragment,null,m.createElement("path",{d:"M216,32H88a8,8,0,0,0-8,8V80H40a8,8,0,0,0-8,8V216a8,8,0,0,0,8,8H168a8,8,0,0,0,8-8V176h40a8,8,0,0,0,8-8V40A8,8,0,0,0,216,32Zm-8,128H176V88a8,8,0,0,0-8-8H96V48H208Z"}))],["light",m.createElement(m.Fragment,null,m.createElement("path",{d:"M216,34H88a6,6,0,0,0-6,6V82H40a6,6,0,0,0-6,6V216a6,6,0,0,0,6,6H168a6,6,0,0,0,6-6V174h42a6,6,0,0,0,6-6V40A6,6,0,0,0,216,34ZM162,210H46V94H162Zm48-48H174V88a6,6,0,0,0-6-6H94V46H210Z"}))],["regular",m.createElement(m.Fragment,null,m.createElement("path",{d:"M216,32H88a8,8,0,0,0-8,8V80H40a8,8,0,0,0-8,8V216a8,8,0,0,0,8,8H168a8,8,0,0,0,8-8V176h40a8,8,0,0,0,8-8V40A8,8,0,0,0,216,32ZM160,208H48V96H160Zm48-48H176V88a8,8,0,0,0-8-8H96V48H208Z"}))],["thin",m.createElement(m.Fragment,null,m.createElement("path",{d:"M216,36H88a4,4,0,0,0-4,4V84H40a4,4,0,0,0-4,4V216a4,4,0,0,0,4,4H168a4,4,0,0,0,4-4V172h44a4,4,0,0,0,4-4V40A4,4,0,0,0,216,36ZM164,212H44V92H164Zm48-48H172V88a4,4,0,0,0-4-4H92V44H212Z"}))]]),Iq=new Map([["bold",m.createElement(m.Fragment,null,m.createElement("path",{d:"M144,128a16,16,0,1,1-16-16A16,16,0,0,1,144,128ZM60,112a16,16,0,1,0,16,16A16,16,0,0,0,60,112Zm136,0a16,16,0,1,0,16,16A16,16,0,0,0,196,112Z"}))],["duotone",m.createElement(m.Fragment,null,m.createElement("path",{d:"M240,96v64a16,16,0,0,1-16,16H32a16,16,0,0,1-16-16V96A16,16,0,0,1,32,80H224A16,16,0,0,1,240,96Z",opacity:"0.2"}),m.createElement("path",{d:"M140,128a12,12,0,1,1-12-12A12,12,0,0,1,140,128Zm56-12a12,12,0,1,0,12,12A12,12,0,0,0,196,116ZM60,116a12,12,0,1,0,12,12A12,12,0,0,0,60,116Z"}))],["fill",m.createElement(m.Fragment,null,m.createElement("path",{d:"M224,80H32A16,16,0,0,0,16,96v64a16,16,0,0,0,16,16H224a16,16,0,0,0,16-16V96A16,16,0,0,0,224,80ZM60,140a12,12,0,1,1,12-12A12,12,0,0,1,60,140Zm68,0a12,12,0,1,1,12-12A12,12,0,0,1,128,140Zm68,0a12,12,0,1,1,12-12A12,12,0,0,1,196,140Z"}))],["light",m.createElement(m.Fragment,null,m.createElement("path",{d:"M138,128a10,10,0,1,1-10-10A10,10,0,0,1,138,128ZM60,118a10,10,0,1,0,10,10A10,10,0,0,0,60,118Zm136,0a10,10,0,1,0,10,10A10,10,0,0,0,196,118Z"}))],["regular",m.createElement(m.Fragment,null,m.createElement("path",{d:"M140,128a12,12,0,1,1-12-12A12,12,0,0,1,140,128Zm56-12a12,12,0,1,0,12,12A12,12,0,0,0,196,116ZM60,116a12,12,0,1,0,12,12A12,12,0,0,0,60,116Z"}))],["thin",m.createElement(m.Fragment,null,m.createElement("path",{d:"M136,128a8,8,0,1,1-8-8A8,8,0,0,1,136,128Zm-76-8a8,8,0,1,0,8,8A8,8,0,0,0,60,120Zm136,0a8,8,0,1,0,8,8A8,8,0,0,0,196,120Z"}))]]),Oq=new Map([["bold",m.createElement(m.Fragment,null,m.createElement("path",{d:"M248.23,112.31A20,20,0,0,0,232,104H220V88a20,20,0,0,0-20-20H132L105.34,48a20.12,20.12,0,0,0-12-4H40A20,20,0,0,0,20,64V208a12,12,0,0,0,12,12H211.1a12,12,0,0,0,11.33-8l28.49-81.47.06-.17A20,20,0,0,0,248.23,112.31ZM92,68l28.8,21.6A12,12,0,0,0,128,92h68v12H69.77a20,20,0,0,0-18.94,13.58L44,137.15V68ZM202.59,196H48.89l23.72-68H226.37Z"}))],["duotone",m.createElement(m.Fragment,null,m.createElement("path",{d:"M208,88v24H69.77a8,8,0,0,0-7.59,5.47L32,208V64a8,8,0,0,1,8-8H93.33a8,8,0,0,1,4.8,1.6L128,80h72A8,8,0,0,1,208,88Z",opacity:"0.2"}),m.createElement("path",{d:"M245,110.64A16,16,0,0,0,232,104H216V88a16,16,0,0,0-16-16H130.67L102.94,51.2a16.14,16.14,0,0,0-9.6-3.2H40A16,16,0,0,0,24,64V208a8,8,0,0,0,8,8H211.1a8,8,0,0,0,7.59-5.47l28.49-85.47A16.05,16.05,0,0,0,245,110.64ZM93.34,64,123.2,86.4A8,8,0,0,0,128,88h72v16H69.77a16,16,0,0,0-15.18,10.94L40,158.7V64Zm112,136H43.1l26.67-80H232Z"}))],["fill",m.createElement(m.Fragment,null,m.createElement("path",{d:"M245,110.64A16,16,0,0,0,232,104H216V88a16,16,0,0,0-16-16H130.67L102.94,51.2a16.14,16.14,0,0,0-9.6-3.2H40A16,16,0,0,0,24,64V208h0a8,8,0,0,0,8,8H211.1a8,8,0,0,0,7.59-5.47l28.49-85.47A16.05,16.05,0,0,0,245,110.64ZM93.34,64,123.2,86.4A8,8,0,0,0,128,88h72v16H69.77a16,16,0,0,0-15.18,10.94L40,158.7V64Z"}))],["light",m.createElement(m.Fragment,null,m.createElement("path",{d:"M243.36,111.81A14,14,0,0,0,232,106H214V88a14,14,0,0,0-14-14H130L101.74,52.8a14.06,14.06,0,0,0-8.4-2.8H40A14,14,0,0,0,26,64V208a6,6,0,0,0,6,6H211.1a6,6,0,0,0,5.69-4.1l28.49-85.47A14,14,0,0,0,243.36,111.81ZM40,62H93.34a2,2,0,0,1,1.2.4L124.4,84.8A6,6,0,0,0,128,86h72a2,2,0,0,1,2,2v18H69.77a14,14,0,0,0-13.28,9.57L38,171V64A2,2,0,0,1,40,62Zm193.9,58.63L206.78,202H40.33l27.54-82.63a2,2,0,0,1,1.9-1.37H232a2,2,0,0,1,1.9,2.63Z"}))],["regular",m.createElement(m.Fragment,null,m.createElement("path",{d:"M245,110.64A16,16,0,0,0,232,104H216V88a16,16,0,0,0-16-16H130.67L102.94,51.2a16.14,16.14,0,0,0-9.6-3.2H40A16,16,0,0,0,24,64V208h0a8,8,0,0,0,8,8H211.1a8,8,0,0,0,7.59-5.47l28.49-85.47A16.05,16.05,0,0,0,245,110.64ZM93.34,64,123.2,86.4A8,8,0,0,0,128,88h72v16H69.77a16,16,0,0,0-15.18,10.94L40,158.7V64Zm112,136H43.1l26.67-80H232Z"}))],["thin",m.createElement(m.Fragment,null,m.createElement("path",{d:"M241.72,113a11.88,11.88,0,0,0-9.73-5H212V88a12,12,0,0,0-12-12H129.33l-28.8-21.6a12.05,12.05,0,0,0-7.2-2.4H40A12,12,0,0,0,28,64V208a4,4,0,0,0,4,4H211.09a4,4,0,0,0,3.79-2.74l28.49-85.47A11.86,11.86,0,0,0,241.72,113ZM40,60H93.33a4,4,0,0,1,2.4.8L125.6,83.2a4,4,0,0,0,2.4.8h72a4,4,0,0,1,4,4v20H69.76a12,12,0,0,0-11.38,8.21L36,183.35V64A4,4,0,0,1,40,60Zm195.78,61.26L208.2,204H37.55L66,118.74A4,4,0,0,1,69.76,116H232a4,4,0,0,1,3.79,5.26Z"}))]]),Lq=new Map([["bold",m.createElement(m.Fragment,null,m.createElement("path",{d:"M216,68H132L105.33,48a20.12,20.12,0,0,0-12-4H40A20,20,0,0,0,20,64V200a20,20,0,0,0,20,20H216.89A19.13,19.13,0,0,0,236,200.89V88A20,20,0,0,0,216,68Zm-4,128H44V68H92l28.8,21.6A12,12,0,0,0,128,92h84Z"}))],["duotone",m.createElement(m.Fragment,null,m.createElement("path",{d:"M224,88V200.89a7.11,7.11,0,0,1-7.11,7.11H40a8,8,0,0,1-8-8V64a8,8,0,0,1,8-8H93.33a8,8,0,0,1,4.8,1.6L128,80h88A8,8,0,0,1,224,88Z",opacity:"0.2"}),m.createElement("path",{d:"M216,72H130.67L102.93,51.2a16.12,16.12,0,0,0-9.6-3.2H40A16,16,0,0,0,24,64V200a16,16,0,0,0,16,16H216.89A15.13,15.13,0,0,0,232,200.89V88A16,16,0,0,0,216,72Zm0,128H40V64H93.33L123.2,86.4A8,8,0,0,0,128,88h88Z"}))],["fill",m.createElement(m.Fragment,null,m.createElement("path",{d:"M232,88V200.89A15.13,15.13,0,0,1,216.89,216H40a16,16,0,0,1-16-16V64A16,16,0,0,1,40,48H93.33a16.12,16.12,0,0,1,9.6,3.2L130.67,72H216A16,16,0,0,1,232,88Z"}))],["light",m.createElement(m.Fragment,null,m.createElement("path",{d:"M216,74H130L101.73,52.8a14,14,0,0,0-8.4-2.8H40A14,14,0,0,0,26,64V200a14,14,0,0,0,14,14H216.89A13.12,13.12,0,0,0,230,200.89V88A14,14,0,0,0,216,74Zm2,126.89a1.11,1.11,0,0,1-1.11,1.11H40a2,2,0,0,1-2-2V64a2,2,0,0,1,2-2H93.33a2,2,0,0,1,1.2.4L124.4,84.8A6,6,0,0,0,128,86h88a2,2,0,0,1,2,2Z"}))],["regular",m.createElement(m.Fragment,null,m.createElement("path",{d:"M216,72H130.67L102.93,51.2a16.12,16.12,0,0,0-9.6-3.2H40A16,16,0,0,0,24,64V200a16,16,0,0,0,16,16H216.89A15.13,15.13,0,0,0,232,200.89V88A16,16,0,0,0,216,72Zm0,128H40V64H93.33L123.2,86.4A8,8,0,0,0,128,88h88Z"}))],["thin",m.createElement(m.Fragment,null,m.createElement("path",{d:"M216,76H129.33l-28.8-21.6a12.05,12.05,0,0,0-7.2-2.4H40A12,12,0,0,0,28,64V200a12,12,0,0,0,12,12H216.89A11.12,11.12,0,0,0,228,200.89V88A12,12,0,0,0,216,76Zm4,124.89a3.12,3.12,0,0,1-3.11,3.11H40a4,4,0,0,1-4-4V64a4,4,0,0,1,4-4H93.33a4,4,0,0,1,2.4.8L125.6,83.2a4,4,0,0,0,2.4.8h88a4,4,0,0,1,4,4Z"}))]]),Nq=new Map([["bold",m.createElement(m.Fragment,null,m.createElement("path",{d:"M232.49,215.51,185,168a92.12,92.12,0,1,0-17,17l47.53,47.54a12,12,0,0,0,17-17ZM44,112a68,68,0,1,1,68,68A68.07,68.07,0,0,1,44,112Z"}))],["duotone",m.createElement(m.Fragment,null,m.createElement("path",{d:"M192,112a80,80,0,1,1-80-80A80,80,0,0,1,192,112Z",opacity:"0.2"}),m.createElement("path",{d:"M229.66,218.34,179.6,168.28a88.21,88.21,0,1,0-11.32,11.31l50.06,50.07a8,8,0,0,0,11.32-11.32ZM40,112a72,72,0,1,1,72,72A72.08,72.08,0,0,1,40,112Z"}))],["fill",m.createElement(m.Fragment,null,m.createElement("path",{d:"M168,112a56,56,0,1,1-56-56A56,56,0,0,1,168,112Zm61.66,117.66a8,8,0,0,1-11.32,0l-50.06-50.07a88,88,0,1,1,11.32-11.31l50.06,50.06A8,8,0,0,1,229.66,229.66ZM112,184a72,72,0,1,0-72-72A72.08,72.08,0,0,0,112,184Z"}))],["light",m.createElement(m.Fragment,null,m.createElement("path",{d:"M228.24,219.76l-51.38-51.38a86.15,86.15,0,1,0-8.48,8.48l51.38,51.38a6,6,0,0,0,8.48-8.48ZM38,112a74,74,0,1,1,74,74A74.09,74.09,0,0,1,38,112Z"}))],["regular",m.createElement(m.Fragment,null,m.createElement("path",{d:"M229.66,218.34l-50.07-50.06a88.11,88.11,0,1,0-11.31,11.31l50.06,50.07a8,8,0,0,0,11.32-11.32ZM40,112a72,72,0,1,1,72,72A72.08,72.08,0,0,1,40,112Z"}))],["thin",m.createElement(m.Fragment,null,m.createElement("path",{d:"M226.83,221.17l-52.7-52.7a84.1,84.1,0,1,0-5.66,5.66l52.7,52.7a4,4,0,0,0,5.66-5.66ZM36,112a76,76,0,1,1,76,76A76.08,76.08,0,0,1,36,112Z"}))]]),Dq=new Map([["bold",m.createElement(m.Fragment,null,m.createElement("path",{d:"M230.14,70.54,185.46,25.85a20,20,0,0,0-28.29,0L33.86,149.17A19.85,19.85,0,0,0,28,163.31V208a20,20,0,0,0,20,20H92.69a19.86,19.86,0,0,0,14.14-5.86L230.14,98.82a20,20,0,0,0,0-28.28ZM91,204H52V165l84-84,39,39ZM192,103,153,64l18.34-18.34,39,39Z"}))],["duotone",m.createElement(m.Fragment,null,m.createElement("path",{d:"M221.66,90.34,192,120,136,64l29.66-29.66a8,8,0,0,1,11.31,0L221.66,79A8,8,0,0,1,221.66,90.34Z",opacity:"0.2"}),m.createElement("path",{d:"M227.31,73.37,182.63,28.68a16,16,0,0,0-22.63,0L36.69,152A15.86,15.86,0,0,0,32,163.31V208a16,16,0,0,0,16,16H92.69A15.86,15.86,0,0,0,104,219.31L227.31,96a16,16,0,0,0,0-22.63ZM92.69,208H48V163.31l88-88L180.69,120ZM192,108.68,147.31,64l24-24L216,84.68Z"}))],["fill",m.createElement(m.Fragment,null,m.createElement("path",{d:"M227.31,73.37,182.63,28.68a16,16,0,0,0-22.63,0L36.69,152A15.86,15.86,0,0,0,32,163.31V208a16,16,0,0,0,16,16H92.69A15.86,15.86,0,0,0,104,219.31L227.31,96a16,16,0,0,0,0-22.63ZM192,108.68,147.31,64l24-24L216,84.68Z"}))],["light",m.createElement(m.Fragment,null,m.createElement("path",{d:"M225.9,74.78,181.21,30.09a14,14,0,0,0-19.8,0L38.1,153.41a13.94,13.94,0,0,0-4.1,9.9V208a14,14,0,0,0,14,14H92.69a13.94,13.94,0,0,0,9.9-4.1L225.9,94.58a14,14,0,0,0,0-19.8ZM94.1,209.41a2,2,0,0,1-1.41.59H48a2,2,0,0,1-2-2V163.31a2,2,0,0,1,.59-1.41L136,72.48,183.51,120ZM217.41,86.1,192,111.51,144.49,64,169.9,38.58a2,2,0,0,1,2.83,0l44.68,44.69a2,2,0,0,1,0,2.83Z"}))],["regular",m.createElement(m.Fragment,null,m.createElement("path",{d:"M227.31,73.37,182.63,28.68a16,16,0,0,0-22.63,0L36.69,152A15.86,15.86,0,0,0,32,163.31V208a16,16,0,0,0,16,16H92.69A15.86,15.86,0,0,0,104,219.31L227.31,96a16,16,0,0,0,0-22.63ZM92.69,208H48V163.31l88-88L180.69,120ZM192,108.68,147.31,64l24-24L216,84.68Z"}))],["thin",m.createElement(m.Fragment,null,m.createElement("path",{d:"M224.49,76.2,179.8,31.51a12,12,0,0,0-17,0L133.17,61.17h0L39.52,154.83A11.9,11.9,0,0,0,36,163.31V208a12,12,0,0,0,12,12H92.69a12,12,0,0,0,8.48-3.51L224.48,93.17a12,12,0,0,0,0-17Zm-129,134.63A4,4,0,0,1,92.69,212H48a4,4,0,0,1-4-4V163.31a4,4,0,0,1,1.17-2.83L136,69.65,186.34,120ZM218.83,87.51,192,114.34,141.66,64l26.82-26.83a4,4,0,0,1,5.66,0l44.69,44.68a4,4,0,0,1,0,5.66Z"}))]]),jq=new Map([["bold",m.createElement(m.Fragment,null,m.createElement("path",{d:"M238.15,78.54,177.46,17.86a20,20,0,0,0-28.3,0L97.2,70c-12.43-3.33-36.68-5.72-61.74,14.5a20,20,0,0,0-1.6,29.73l45.46,45.47-39.8,39.8a12,12,0,0,0,17,17l39.8-39.81,45.47,45.46A20,20,0,0,0,155.91,228c.46,0,.93,0,1.4-.05A20,20,0,0,0,171.87,220c4.69-6.23,11-16.13,14.44-28s3.45-22.88.16-33.4l51.7-51.87A20,20,0,0,0,238.15,78.54Zm-74.26,68.79a12,12,0,0,0-2.23,13.84c3.43,6.86,6.9,21-6.28,40.65L54.08,100.53c21.09-14.59,39.53-6.64,41-6a11.67,11.67,0,0,0,13.81-2.29l54.43-54.61,55,55Z"}))],["duotone",m.createElement(m.Fragment,null,m.createElement("path",{d:"M229.66,98.34,172.39,155.8c11.46,22.93-1.72,45.86-10.11,57a8,8,0,0,1-12,.83L42.34,105.76A8,8,0,0,1,43,93.85c29.65-23.92,57.4-10,57.4-10l57.27-57.46a8,8,0,0,1,11.31,0L229.66,87A8,8,0,0,1,229.66,98.34Z",opacity:"0.2"}),m.createElement("path",{d:"M235.32,81.37,174.63,20.69a16,16,0,0,0-22.63,0L98.37,74.49c-10.66-3.34-35-7.37-60.4,13.14a16,16,0,0,0-1.29,23.78L85,159.71,42.34,202.34a8,8,0,0,0,11.32,11.32L96.29,171l48.29,48.29A16,16,0,0,0,155.9,224c.38,0,.75,0,1.13,0a15.93,15.93,0,0,0,11.64-6.33c19.64-26.1,17.75-47.32,13.19-60L235.33,104A16,16,0,0,0,235.32,81.37ZM224,92.69h0l-57.27,57.46a8,8,0,0,0-1.49,9.22c9.46,18.93-1.8,38.59-9.34,48.62L48,100.08c12.08-9.74,23.64-12.31,32.48-12.31A40.13,40.13,0,0,1,96.81,91a8,8,0,0,0,9.25-1.51L163.32,32,224,92.68Z"}))],["fill",m.createElement(m.Fragment,null,m.createElement("path",{d:"M235.33,104l-53.47,53.65c4.56,12.67,6.45,33.89-13.19,60A15.93,15.93,0,0,1,157,224c-.38,0-.75,0-1.13,0a16,16,0,0,1-11.32-4.69L96.29,171,53.66,213.66a8,8,0,0,1-11.32-11.32L85,159.71l-48.3-48.3A16,16,0,0,1,38,87.63c25.42-20.51,49.75-16.48,60.4-13.14L152,20.7a16,16,0,0,1,22.63,0l60.69,60.68A16,16,0,0,1,235.33,104Z"}))],["light",m.createElement(m.Fragment,null,m.createElement("path",{d:"M233.91,82.79,173.22,22.1a14,14,0,0,0-19.81,0L98.93,76.77c-9.52-3.25-34-8.34-59.71,12.41A14,14,0,0,0,38.1,110l49.71,49.71-44.05,44a6,6,0,1,0,8.48,8.48l44.05-44.05L146,217.89a14,14,0,0,0,9.9,4.11q.49,0,1,0a14,14,0,0,0,10.19-5.54c19.72-26.21,17.15-47.23,12.46-59.3l54.37-54.55A14,14,0,0,0,233.91,82.79ZM225.42,94.1h0l-57.27,57.46a6,6,0,0,0-1.11,6.92c9.94,19.88-1.71,40.32-9.54,50.72a2,2,0,0,1-3,.2L46.58,101.51a2,2,0,0,1,.18-3c12.5-10.09,24.5-12.76,33.7-12.76a42.13,42.13,0,0,1,17.25,3.41A6,6,0,0,0,104.64,88L161.9,30.59a2,2,0,0,1,2.83,0l60.69,60.68A2,2,0,0,1,225.42,94.1Z"}))],["regular",m.createElement(m.Fragment,null,m.createElement("path",{d:"M235.32,81.37,174.63,20.69a16,16,0,0,0-22.63,0L98.37,74.49c-10.66-3.34-35-7.37-60.4,13.14a16,16,0,0,0-1.29,23.78L85,159.71,42.34,202.34a8,8,0,0,0,11.32,11.32L96.29,171l48.29,48.29A16,16,0,0,0,155.9,224c.38,0,.75,0,1.13,0a15.93,15.93,0,0,0,11.64-6.33c19.64-26.1,17.75-47.32,13.19-60L235.33,104A16,16,0,0,0,235.32,81.37ZM224,92.69h0l-57.27,57.46a8,8,0,0,0-1.49,9.22c9.46,18.93-1.8,38.59-9.34,48.62L48,100.08c12.08-9.74,23.64-12.31,32.48-12.31A40.13,40.13,0,0,1,96.81,91a8,8,0,0,0,9.25-1.51L163.32,32,224,92.68Z"}))],["thin",m.createElement(m.Fragment,null,m.createElement("path",{d:"M232.49,84.2,171.8,23.51a12,12,0,0,0-17,0L99.45,79.07c-8.08-3-32.79-9.45-59,11.67a12,12,0,0,0-1,17.84l51.13,51.13L45.17,205.17a4,4,0,0,0,5.66,5.66l45.46-45.47,51.12,51.12A12,12,0,0,0,155.9,220c.28,0,.57,0,.85,0a12,12,0,0,0,8.73-4.74c19.83-26.36,16.51-47.18,11.71-58.57l55.3-55.49A12,12,0,0,0,232.49,84.2Zm-5.66,11.31h0L169.56,153a4,4,0,0,0-.75,4.61c10.43,20.85-1.62,42-9.73,52.83a4,4,0,0,1-6,.4L45.17,102.93a4,4,0,0,1,.33-6C58.44,86.53,70.86,83.74,80.44,83.74A43.9,43.9,0,0,1,98.6,87.38a4,4,0,0,0,4.62-.75l57.27-57.46a4,4,0,0,1,5.66,0l60.68,60.69A4,4,0,0,1,226.83,95.51Z"}))]]),$q=new Map([["bold",m.createElement(m.Fragment,null,m.createElement("path",{d:"M216,36H40A20,20,0,0,0,20,56V200a20,20,0,0,0,20,20H216a20,20,0,0,0,20-20V56A20,20,0,0,0,216,36ZM44,60H76V196H44ZM212,196H100V60H212Z"}))],["duotone",m.createElement(m.Fragment,null,m.createElement("path",{d:"M88,48V208H40a8,8,0,0,1-8-8V56a8,8,0,0,1,8-8Z",opacity:"0.2"}),m.createElement("path",{d:"M216,40H40A16,16,0,0,0,24,56V200a16,16,0,0,0,16,16H216a16,16,0,0,0,16-16V56A16,16,0,0,0,216,40ZM40,56H80V200H40ZM216,200H96V56H216V200Z"}))],["fill",m.createElement(m.Fragment,null,m.createElement("path",{d:"M216,40H40A16,16,0,0,0,24,56V200a16,16,0,0,0,16,16H216a16,16,0,0,0,16-16V56A16,16,0,0,0,216,40Zm0,160H88V56H216V200Z"}))],["light",m.createElement(m.Fragment,null,m.createElement("path",{d:"M216,42H40A14,14,0,0,0,26,56V200a14,14,0,0,0,14,14H216a14,14,0,0,0,14-14V56A14,14,0,0,0,216,42ZM38,200V56a2,2,0,0,1,2-2H82V202H40A2,2,0,0,1,38,200Zm180,0a2,2,0,0,1-2,2H94V54H216a2,2,0,0,1,2,2Z"}))],["regular",m.createElement(m.Fragment,null,m.createElement("path",{d:"M216,40H40A16,16,0,0,0,24,56V200a16,16,0,0,0,16,16H216a16,16,0,0,0,16-16V56A16,16,0,0,0,216,40ZM40,56H80V200H40ZM216,200H96V56H216V200Z"}))],["thin",m.createElement(m.Fragment,null,m.createElement("path",{d:"M216,44H40A12,12,0,0,0,28,56V200a12,12,0,0,0,12,12H216a12,12,0,0,0,12-12V56A12,12,0,0,0,216,44ZM36,200V56a4,4,0,0,1,4-4H84V204H40A4,4,0,0,1,36,200Zm184,0a4,4,0,0,1-4,4H92V52H216a4,4,0,0,1,4,4Z"}))]]),Fq=new Map([["bold",m.createElement(m.Fragment,null,m.createElement("path",{d:"M144.49,136.49l-40,40a12,12,0,0,1-17-17L107,140H24a12,12,0,0,1,0-24h83L87.51,96.49a12,12,0,0,1,17-17l40,40A12,12,0,0,1,144.49,136.49ZM200,28H136a12,12,0,0,0,0,24h52V204H136a12,12,0,0,0,0,24h64a12,12,0,0,0,12-12V40A12,12,0,0,0,200,28Z"}))],["duotone",m.createElement(m.Fragment,null,m.createElement("path",{d:"M200,40V216H40a16,16,0,0,1-16-16V56A16,16,0,0,1,40,40Z",opacity:"0.2"}),m.createElement("path",{d:"M141.66,133.66l-40,40a8,8,0,0,1-11.32-11.32L116.69,136H24a8,8,0,0,1,0-16h92.69L90.34,93.66a8,8,0,0,1,11.32-11.32l40,40A8,8,0,0,1,141.66,133.66ZM200,32H136a8,8,0,0,0,0,16h56V208H136a8,8,0,0,0,0,16h64a8,8,0,0,0,8-8V40A8,8,0,0,0,200,32Z"}))],["fill",m.createElement(m.Fragment,null,m.createElement("path",{d:"M141.66,133.66l-40,40A8,8,0,0,1,88,168V136H24a8,8,0,0,1,0-16H88V88a8,8,0,0,1,13.66-5.66l40,40A8,8,0,0,1,141.66,133.66ZM200,32H136a8,8,0,0,0,0,16h56V208H136a8,8,0,0,0,0,16h64a8,8,0,0,0,8-8V40A8,8,0,0,0,200,32Z"}))],["light",m.createElement(m.Fragment,null,m.createElement("path",{d:"M140.24,132.24l-40,40a6,6,0,0,1-8.48-8.48L121.51,134H24a6,6,0,0,1,0-12h97.51L91.76,92.24a6,6,0,0,1,8.48-8.48l40,40A6,6,0,0,1,140.24,132.24ZM200,34H136a6,6,0,0,0,0,12h58V210H136a6,6,0,0,0,0,12h64a6,6,0,0,0,6-6V40A6,6,0,0,0,200,34Z"}))],["regular",m.createElement(m.Fragment,null,m.createElement("path",{d:"M141.66,133.66l-40,40a8,8,0,0,1-11.32-11.32L116.69,136H24a8,8,0,0,1,0-16h92.69L90.34,93.66a8,8,0,0,1,11.32-11.32l40,40A8,8,0,0,1,141.66,133.66ZM200,32H136a8,8,0,0,0,0,16h56V208H136a8,8,0,0,0,0,16h64a8,8,0,0,0,8-8V40A8,8,0,0,0,200,32Z"}))],["thin",m.createElement(m.Fragment,null,m.createElement("path",{d:"M138.83,130.83l-40,40a4,4,0,0,1-5.66-5.66L126.34,132H24a4,4,0,0,1,0-8H126.34L93.17,90.83a4,4,0,0,1,5.66-5.66l40,40A4,4,0,0,1,138.83,130.83ZM200,36H136a4,4,0,0,0,0,8h60V212H136a4,4,0,0,0,0,8h64a4,4,0,0,0,4-4V40A4,4,0,0,0,200,36Z"}))]]),Vq=new Map([["bold",m.createElement(m.Fragment,null,m.createElement("path",{d:"M124,216a12,12,0,0,1-12,12H48a12,12,0,0,1-12-12V40A12,12,0,0,1,48,28h64a12,12,0,0,1,0,24H60V204h52A12,12,0,0,1,124,216Zm108.49-96.49-40-40a12,12,0,0,0-17,17L195,116H112a12,12,0,0,0,0,24h83l-19.52,19.51a12,12,0,0,0,17,17l40-40A12,12,0,0,0,232.49,119.51Z"}))],["duotone",m.createElement(m.Fragment,null,m.createElement("path",{d:"M224,56V200a16,16,0,0,1-16,16H48V40H208A16,16,0,0,1,224,56Z",opacity:"0.2"}),m.createElement("path",{d:"M120,216a8,8,0,0,1-8,8H48a8,8,0,0,1-8-8V40a8,8,0,0,1,8-8h64a8,8,0,0,1,0,16H56V208h56A8,8,0,0,1,120,216Zm109.66-93.66-40-40a8,8,0,0,0-11.32,11.32L204.69,120H112a8,8,0,0,0,0,16h92.69l-26.35,26.34a8,8,0,0,0,11.32,11.32l40-40A8,8,0,0,0,229.66,122.34Z"}))],["fill",m.createElement(m.Fragment,null,m.createElement("path",{d:"M120,216a8,8,0,0,1-8,8H48a8,8,0,0,1-8-8V40a8,8,0,0,1,8-8h64a8,8,0,0,1,0,16H56V208h56A8,8,0,0,1,120,216Zm109.66-93.66-40-40A8,8,0,0,0,176,88v32H112a8,8,0,0,0,0,16h64v32a8,8,0,0,0,13.66,5.66l40-40A8,8,0,0,0,229.66,122.34Z"}))],["light",m.createElement(m.Fragment,null,m.createElement("path",{d:"M118,216a6,6,0,0,1-6,6H48a6,6,0,0,1-6-6V40a6,6,0,0,1,6-6h64a6,6,0,0,1,0,12H54V210h58A6,6,0,0,1,118,216Zm110.24-92.24-40-40a6,6,0,0,0-8.48,8.48L209.51,122H112a6,6,0,0,0,0,12h97.51l-29.75,29.76a6,6,0,1,0,8.48,8.48l40-40A6,6,0,0,0,228.24,123.76Z"}))],["regular",m.createElement(m.Fragment,null,m.createElement("path",{d:"M120,216a8,8,0,0,1-8,8H48a8,8,0,0,1-8-8V40a8,8,0,0,1,8-8h64a8,8,0,0,1,0,16H56V208h56A8,8,0,0,1,120,216Zm109.66-93.66-40-40a8,8,0,0,0-11.32,11.32L204.69,120H112a8,8,0,0,0,0,16h92.69l-26.35,26.34a8,8,0,0,0,11.32,11.32l40-40A8,8,0,0,0,229.66,122.34Z"}))],["thin",m.createElement(m.Fragment,null,m.createElement("path",{d:"M116,216a4,4,0,0,1-4,4H48a4,4,0,0,1-4-4V40a4,4,0,0,1,4-4h64a4,4,0,0,1,0,8H52V212h60A4,4,0,0,1,116,216Zm110.83-90.83-40-40a4,4,0,0,0-5.66,5.66L214.34,124H112a4,4,0,0,0,0,8H214.34l-33.17,33.17a4,4,0,0,0,5.66,5.66l40-40A4,4,0,0,0,226.83,125.17Z"}))]]),Hq=new Map([["bold",m.createElement(m.Fragment,null,m.createElement("path",{d:"M199,125.31l-49.88-18.39L130.69,57a19.92,19.92,0,0,0-37.38,0L74.92,106.92,25,125.31a19.92,19.92,0,0,0,0,37.38l49.88,18.39L93.31,231a19.92,19.92,0,0,0,37.38,0l18.39-49.88L199,162.69a19.92,19.92,0,0,0,0-37.38Zm-63.38,35.16a12,12,0,0,0-7.11,7.11L112,212.28l-16.47-44.7a12,12,0,0,0-7.11-7.11L43.72,144l44.7-16.47a12,12,0,0,0,7.11-7.11L112,75.72l16.47,44.7a12,12,0,0,0,7.11,7.11L180.28,144ZM140,40a12,12,0,0,1,12-12h12V16a12,12,0,0,1,24,0V28h12a12,12,0,0,1,0,24H188V64a12,12,0,0,1-24,0V52H152A12,12,0,0,1,140,40ZM252,88a12,12,0,0,1-12,12h-4v4a12,12,0,0,1-24,0v-4h-4a12,12,0,0,1,0-24h4V72a12,12,0,0,1,24,0v4h4A12,12,0,0,1,252,88Z"}))],["duotone",m.createElement(m.Fragment,null,m.createElement("path",{d:"M194.82,151.43l-55.09,20.3-20.3,55.09a7.92,7.92,0,0,1-14.86,0l-20.3-55.09-55.09-20.3a7.92,7.92,0,0,1,0-14.86l55.09-20.3,20.3-55.09a7.92,7.92,0,0,1,14.86,0l20.3,55.09,55.09,20.3A7.92,7.92,0,0,1,194.82,151.43Z",opacity:"0.2"}),m.createElement("path",{d:"M197.58,129.06,146,110l-19-51.62a15.92,15.92,0,0,0-29.88,0L78,110l-51.62,19a15.92,15.92,0,0,0,0,29.88L78,178l19,51.62a15.92,15.92,0,0,0,29.88,0L146,178l51.62-19a15.92,15.92,0,0,0,0-29.88ZM137,164.22a8,8,0,0,0-4.74,4.74L112,223.85,91.78,169A8,8,0,0,0,87,164.22L32.15,144,87,123.78A8,8,0,0,0,91.78,119L112,64.15,132.22,119a8,8,0,0,0,4.74,4.74L191.85,144ZM144,40a8,8,0,0,1,8-8h16V16a8,8,0,0,1,16,0V32h16a8,8,0,0,1,0,16H184V64a8,8,0,0,1-16,0V48H152A8,8,0,0,1,144,40ZM248,88a8,8,0,0,1-8,8h-8v8a8,8,0,0,1-16,0V96h-8a8,8,0,0,1,0-16h8V72a8,8,0,0,1,16,0v8h8A8,8,0,0,1,248,88Z"}))],["fill",m.createElement(m.Fragment,null,m.createElement("path",{d:"M208,144a15.78,15.78,0,0,1-10.42,14.94L146,178l-19,51.62a15.92,15.92,0,0,1-29.88,0L78,178l-51.62-19a15.92,15.92,0,0,1,0-29.88L78,110l19-51.62a15.92,15.92,0,0,1,29.88,0L146,110l51.62,19A15.78,15.78,0,0,1,208,144ZM152,48h16V64a8,8,0,0,0,16,0V48h16a8,8,0,0,0,0-16H184V16a8,8,0,0,0-16,0V32H152a8,8,0,0,0,0,16Zm88,32h-8V72a8,8,0,0,0-16,0v8h-8a8,8,0,0,0,0,16h8v8a8,8,0,0,0,16,0V96h8a8,8,0,0,0,0-16Z"}))],["light",m.createElement(m.Fragment,null,m.createElement("path",{d:"M196.89,130.94,144.4,111.6,125.06,59.11a13.92,13.92,0,0,0-26.12,0L79.6,111.6,27.11,130.94a13.92,13.92,0,0,0,0,26.12L79.6,176.4l19.34,52.49a13.92,13.92,0,0,0,26.12,0L144.4,176.4l52.49-19.34a13.92,13.92,0,0,0,0-26.12Zm-4.15,14.86-55.08,20.3a6,6,0,0,0-3.56,3.56l-20.3,55.08a1.92,1.92,0,0,1-3.6,0L89.9,169.66a6,6,0,0,0-3.56-3.56L31.26,145.8a1.92,1.92,0,0,1,0-3.6l55.08-20.3a6,6,0,0,0,3.56-3.56l20.3-55.08a1.92,1.92,0,0,1,3.6,0l20.3,55.08a6,6,0,0,0,3.56,3.56l55.08,20.3a1.92,1.92,0,0,1,0,3.6ZM146,40a6,6,0,0,1,6-6h18V16a6,6,0,0,1,12,0V34h18a6,6,0,0,1,0,12H182V64a6,6,0,0,1-12,0V46H152A6,6,0,0,1,146,40ZM246,88a6,6,0,0,1-6,6H230v10a6,6,0,0,1-12,0V94H208a6,6,0,0,1,0-12h10V72a6,6,0,0,1,12,0V82h10A6,6,0,0,1,246,88Z"}))],["regular",m.createElement(m.Fragment,null,m.createElement("path",{d:"M197.58,129.06,146,110l-19-51.62a15.92,15.92,0,0,0-29.88,0L78,110l-51.62,19a15.92,15.92,0,0,0,0,29.88L78,178l19,51.62a15.92,15.92,0,0,0,29.88,0L146,178l51.62-19a15.92,15.92,0,0,0,0-29.88ZM137,164.22a8,8,0,0,0-4.74,4.74L112,223.85,91.78,169A8,8,0,0,0,87,164.22L32.15,144,87,123.78A8,8,0,0,0,91.78,119L112,64.15,132.22,119a8,8,0,0,0,4.74,4.74L191.85,144ZM144,40a8,8,0,0,1,8-8h16V16a8,8,0,0,1,16,0V32h16a8,8,0,0,1,0,16H184V64a8,8,0,0,1-16,0V48H152A8,8,0,0,1,144,40ZM248,88a8,8,0,0,1-8,8h-8v8a8,8,0,0,1-16,0V96h-8a8,8,0,0,1,0-16h8V72a8,8,0,0,1,16,0v8h8A8,8,0,0,1,248,88Z"}))],["thin",m.createElement(m.Fragment,null,m.createElement("path",{d:"M196.2,132.81l-53.36-19.65L123.19,59.8a11.93,11.93,0,0,0-22.38,0L81.16,113.16,27.8,132.81a11.93,11.93,0,0,0,0,22.38l53.36,19.65,19.65,53.36a11.93,11.93,0,0,0,22.38,0l19.65-53.36,53.36-19.65a11.93,11.93,0,0,0,0-22.38Zm-2.77,14.87L138.35,168a4,4,0,0,0-2.37,2.37l-20.3,55.08a3.92,3.92,0,0,1-7.36,0L88,170.35A4,4,0,0,0,85.65,168l-55.08-20.3a3.92,3.92,0,0,1,0-7.36L85.65,120A4,4,0,0,0,88,117.65l20.3-55.08a3.92,3.92,0,0,1,7.36,0L136,117.65a4,4,0,0,0,2.37,2.37l55.08,20.3a3.92,3.92,0,0,1,0,7.36ZM148,40a4,4,0,0,1,4-4h20V16a4,4,0,0,1,8,0V36h20a4,4,0,0,1,0,8H180V64a4,4,0,0,1-8,0V44H152A4,4,0,0,1,148,40Zm96,48a4,4,0,0,1-4,4H228v12a4,4,0,0,1-8,0V92H208a4,4,0,0,1,0-8h12V72a4,4,0,0,1,8,0V84h12A4,4,0,0,1,244,88Z"}))]]),zq=new Map([["bold",m.createElement(m.Fragment,null,m.createElement("path",{d:"M100,36H56A20,20,0,0,0,36,56v44a20,20,0,0,0,20,20h44a20,20,0,0,0,20-20V56A20,20,0,0,0,100,36ZM96,96H60V60H96ZM200,36H156a20,20,0,0,0-20,20v44a20,20,0,0,0,20,20h44a20,20,0,0,0,20-20V56A20,20,0,0,0,200,36Zm-4,60H160V60h36Zm-96,40H56a20,20,0,0,0-20,20v44a20,20,0,0,0,20,20h44a20,20,0,0,0,20-20V156A20,20,0,0,0,100,136Zm-4,60H60V160H96Zm104-60H156a20,20,0,0,0-20,20v44a20,20,0,0,0,20,20h44a20,20,0,0,0,20-20V156A20,20,0,0,0,200,136Zm-4,60H160V160h36Z"}))],["duotone",m.createElement(m.Fragment,null,m.createElement("path",{d:"M112,56v48a8,8,0,0,1-8,8H56a8,8,0,0,1-8-8V56a8,8,0,0,1,8-8h48A8,8,0,0,1,112,56Zm88-8H152a8,8,0,0,0-8,8v48a8,8,0,0,0,8,8h48a8,8,0,0,0,8-8V56A8,8,0,0,0,200,48Zm-96,96H56a8,8,0,0,0-8,8v48a8,8,0,0,0,8,8h48a8,8,0,0,0,8-8V152A8,8,0,0,0,104,144Zm96,0H152a8,8,0,0,0-8,8v48a8,8,0,0,0,8,8h48a8,8,0,0,0,8-8V152A8,8,0,0,0,200,144Z",opacity:"0.2"}),m.createElement("path",{d:"M200,136H152a16,16,0,0,0-16,16v48a16,16,0,0,0,16,16h48a16,16,0,0,0,16-16V152A16,16,0,0,0,200,136Zm0,64H152V152h48v48ZM104,40H56A16,16,0,0,0,40,56v48a16,16,0,0,0,16,16h48a16,16,0,0,0,16-16V56A16,16,0,0,0,104,40Zm0,64H56V56h48v48Zm96-64H152a16,16,0,0,0-16,16v48a16,16,0,0,0,16,16h48a16,16,0,0,0,16-16V56A16,16,0,0,0,200,40Zm0,64H152V56h48v48Zm-96,32H56a16,16,0,0,0-16,16v48a16,16,0,0,0,16,16h48a16,16,0,0,0,16-16V152A16,16,0,0,0,104,136Zm0,64H56V152h48v48Z"}))],["fill",m.createElement(m.Fragment,null,m.createElement("path",{d:"M120,56v48a16,16,0,0,1-16,16H56a16,16,0,0,1-16-16V56A16,16,0,0,1,56,40h48A16,16,0,0,1,120,56Zm80-16H152a16,16,0,0,0-16,16v48a16,16,0,0,0,16,16h48a16,16,0,0,0,16-16V56A16,16,0,0,0,200,40Zm-96,96H56a16,16,0,0,0-16,16v48a16,16,0,0,0,16,16h48a16,16,0,0,0,16-16V152A16,16,0,0,0,104,136Zm96,0H152a16,16,0,0,0-16,16v48a16,16,0,0,0,16,16h48a16,16,0,0,0,16-16V152A16,16,0,0,0,200,136Z"}))],["light",m.createElement(m.Fragment,null,m.createElement("path",{d:"M104,42H56A14,14,0,0,0,42,56v48a14,14,0,0,0,14,14h48a14,14,0,0,0,14-14V56A14,14,0,0,0,104,42Zm2,62a2,2,0,0,1-2,2H56a2,2,0,0,1-2-2V56a2,2,0,0,1,2-2h48a2,2,0,0,1,2,2Zm94-62H152a14,14,0,0,0-14,14v48a14,14,0,0,0,14,14h48a14,14,0,0,0,14-14V56A14,14,0,0,0,200,42Zm2,62a2,2,0,0,1-2,2H152a2,2,0,0,1-2-2V56a2,2,0,0,1,2-2h48a2,2,0,0,1,2,2Zm-98,34H56a14,14,0,0,0-14,14v48a14,14,0,0,0,14,14h48a14,14,0,0,0,14-14V152A14,14,0,0,0,104,138Zm2,62a2,2,0,0,1-2,2H56a2,2,0,0,1-2-2V152a2,2,0,0,1,2-2h48a2,2,0,0,1,2,2Zm94-62H152a14,14,0,0,0-14,14v48a14,14,0,0,0,14,14h48a14,14,0,0,0,14-14V152A14,14,0,0,0,200,138Zm2,62a2,2,0,0,1-2,2H152a2,2,0,0,1-2-2V152a2,2,0,0,1,2-2h48a2,2,0,0,1,2,2Z"}))],["regular",m.createElement(m.Fragment,null,m.createElement("path",{d:"M104,40H56A16,16,0,0,0,40,56v48a16,16,0,0,0,16,16h48a16,16,0,0,0,16-16V56A16,16,0,0,0,104,40Zm0,64H56V56h48v48Zm96-64H152a16,16,0,0,0-16,16v48a16,16,0,0,0,16,16h48a16,16,0,0,0,16-16V56A16,16,0,0,0,200,40Zm0,64H152V56h48v48Zm-96,32H56a16,16,0,0,0-16,16v48a16,16,0,0,0,16,16h48a16,16,0,0,0,16-16V152A16,16,0,0,0,104,136Zm0,64H56V152h48v48Zm96-64H152a16,16,0,0,0-16,16v48a16,16,0,0,0,16,16h48a16,16,0,0,0,16-16V152A16,16,0,0,0,200,136Zm0,64H152V152h48v48Z"}))],["thin",m.createElement(m.Fragment,null,m.createElement("path",{d:"M104,44H56A12,12,0,0,0,44,56v48a12,12,0,0,0,12,12h48a12,12,0,0,0,12-12V56A12,12,0,0,0,104,44Zm4,60a4,4,0,0,1-4,4H56a4,4,0,0,1-4-4V56a4,4,0,0,1,4-4h48a4,4,0,0,1,4,4Zm92-60H152a12,12,0,0,0-12,12v48a12,12,0,0,0,12,12h48a12,12,0,0,0,12-12V56A12,12,0,0,0,200,44Zm4,60a4,4,0,0,1-4,4H152a4,4,0,0,1-4-4V56a4,4,0,0,1,4-4h48a4,4,0,0,1,4,4ZM104,140H56a12,12,0,0,0-12,12v48a12,12,0,0,0,12,12h48a12,12,0,0,0,12-12V152A12,12,0,0,0,104,140Zm4,60a4,4,0,0,1-4,4H56a4,4,0,0,1-4-4V152a4,4,0,0,1,4-4h48a4,4,0,0,1,4,4Zm92-60H152a12,12,0,0,0-12,12v48a12,12,0,0,0,12,12h48a12,12,0,0,0,12-12V152A12,12,0,0,0,200,140Zm4,60a4,4,0,0,1-4,4H152a4,4,0,0,1-4-4V152a4,4,0,0,1,4-4h48a4,4,0,0,1,4,4Z"}))]]),Uq=new Map([["bold",m.createElement(m.Fragment,null,m.createElement("path",{d:"M242.79,149.32,223.7,97.11A20,20,0,0,0,198.12,85.2l-61.31,22.22L147.7,45.18A20,20,0,0,0,131.55,22L76.87,12.31A19.94,19.94,0,0,0,53.76,28.55l-25,143.13A48,48,0,0,0,67.4,227.26a51.19,51.19,0,0,0,8.7.74H224a20,20,0,0,0,20-20V156.19A21.74,21.74,0,0,0,242.79,149.32ZM99,184.18a23.84,23.84,0,0,1-9.86,15.56,23.28,23.28,0,0,1-17.56,3.89,24,24,0,0,1-19.23-27.82L76.71,36.66,123.37,45,99,184.18Zm23.64,4.13,9.39-53.64,70.49-25.54,16.3,44.59-96.23,34.87C122.62,188.5,122.65,188.41,122.66,188.31ZM220,204H150.52L220,178.82ZM89.22,174.07l-1.4,8A12,12,0,0,1,76,192a12.35,12.35,0,0,1-2.08-.18,12,12,0,0,1-9.75-13.89l1.4-8a12,12,0,0,1,23.64,4.14Z"}))],["duotone",m.createElement(m.Fragment,null,m.createElement("path",{d:"M135.88,43.11l-25,143.14a35.71,35.71,0,0,1-41.34,29.2h0a36,36,0,0,1-28.95-41.71l25-143.13a8,8,0,0,1,9.19-6.49l54.67,9.73A8,8,0,0,1,135.88,43.11Z",opacity:"0.2"}),m.createElement("path",{d:"M88,180a12,12,0,1,1-12-12A12,12,0,0,1,88,180Zm152-23.81V208a16,16,0,0,1-16,16H76a46.36,46.36,0,0,1-7.94-.68,44,44,0,0,1-35.43-50.95l25-143.13a15.94,15.94,0,0,1,18.47-13L130.84,26a16,16,0,0,1,12.92,18.52l-12.08,69L199.49,89a16,16,0,0,1,20.45,9.52L239,150.69A18.35,18.35,0,0,1,240,156.19ZM103,184.87,128,41.74,73.46,32l-25,143.1A28,28,0,0,0,70.9,207.57,27.29,27.29,0,0,0,91.46,203,27.84,27.84,0,0,0,103,184.87ZM116.78,195,224,156.11,204.92,104,128.5,131.7l-9.78,55.92A44.63,44.63,0,0,1,116.78,195ZM224,173.12,127.74,208H224Z"}))],["fill",m.createElement(m.Fragment,null,m.createElement("path",{d:"M240,155.91a16,16,0,0,0-1-5.22L219.94,98.48A16,16,0,0,0,199.49,89l-67.81,24.57,12.08-69A16,16,0,0,0,130.84,26L76.17,16.25a15.94,15.94,0,0,0-18.47,13l-25,143.12A43.82,43.82,0,0,0,75.78,224H224a16,16,0,0,0,16-16ZM76,196a16,16,0,1,1,16-16A16,16,0,0,1,76,196Zm42.72-8.38,9.78-55.92L204.92,104,224,156.11,116.78,195A44.89,44.89,0,0,0,118.72,187.62ZM224,208H127.74L224,173.11Z"}))],["light",m.createElement(m.Fragment,null,m.createElement("path",{d:"M86,180a10,10,0,1,1-10-10A10,10,0,0,1,86,180Zm152-23.81V208a14,14,0,0,1-14,14H76a44.18,44.18,0,0,1-7.58-.65,42,42,0,0,1-33.81-48.64l25-143.13A13.94,13.94,0,0,1,75.82,18.22l54.67,9.72a14,14,0,0,1,11.3,16.21l-12.67,72.44,71-25.75a14,14,0,0,1,17.89,8.32l19.09,52.22A15.66,15.66,0,0,1,238,156.19Zm-133.07,29L130,42.08a2,2,0,0,0-1.58-2.32L73.72,30l-.34,0a1.84,1.84,0,0,0-1.07.35,2,2,0,0,0-.82,1.3l-25,143.13a30,30,0,0,0,24.09,34.76,29.25,29.25,0,0,0,22-4.89,29.81,29.81,0,0,0,12.33-19.44Zm8.25,13.17L224.71,158a2,2,0,0,0,1.11-1,1.86,1.86,0,0,0,.06-1.46l-19.09-52.21a2,2,0,0,0-2.53-1.17l-77.53,28.09-10,57.07A41.9,41.9,0,0,1,113.18,198.38ZM226,170.27,116.35,210H224a2,2,0,0,0,2-2Z"}))],["regular",m.createElement(m.Fragment,null,m.createElement("path",{d:"M88,180a12,12,0,1,1-12-12A12,12,0,0,1,88,180Zm152-23.81V208a16,16,0,0,1-16,16H76a46.36,46.36,0,0,1-7.94-.68,44,44,0,0,1-35.43-50.95l25-143.13a15.94,15.94,0,0,1,18.47-13L130.84,26a16,16,0,0,1,12.92,18.52l-12.08,69L199.49,89a16,16,0,0,1,20.45,9.52L239,150.69A18.35,18.35,0,0,1,240,156.19ZM103,184.87,128,41.74,73.46,32l-25,143.1A28,28,0,0,0,70.9,207.57,27.29,27.29,0,0,0,91.46,203,27.84,27.84,0,0,0,103,184.87ZM116.78,195,224,156.11,204.92,104,128.5,131.7l-9.78,55.92A44.63,44.63,0,0,1,116.78,195ZM224,173.12,127.74,208H224Z"}))],["thin",m.createElement(m.Fragment,null,m.createElement("path",{d:"M235.27,152.07,216.19,99.85a12,12,0,0,0-15.34-7.13l-74.3,26.92,13.27-75.83a12,12,0,0,0-9.68-13.9L75.47,20.19a11.75,11.75,0,0,0-8.89,2,11.9,11.9,0,0,0-4.94,7.77l-25,143.13A40,40,0,0,0,68.8,219.39,42.68,42.68,0,0,0,76,220H224a12,12,0,0,0,12-12V156.19A14,14,0,0,0,235.27,152.07Zm-31.7-51.83a4,4,0,0,1,5.1,2.36l19.09,52.21a3.9,3.9,0,0,1-.13,3,3.94,3.94,0,0,1-2.24,2L108.78,202.11a40,40,0,0,0,6-15.17L125,128.73ZM93.75,206.29a31.25,31.25,0,0,1-23.55,5.22,32,32,0,0,1-25.71-37.08l25-143.13a4,4,0,0,1,1.64-2.59A3.85,3.85,0,0,1,73.38,28a4,4,0,0,1,.69.06l54.67,9.73a4,4,0,0,1,3.2,4.64l-25,143.13h0A31.79,31.79,0,0,1,93.75,206.29ZM228,208a4,4,0,0,1-4,4H105l123-44.59ZM84,180a8,8,0,1,1-8-8A8,8,0,0,1,84,180Z"}))]]),Bq=new Map([["bold",m.createElement(m.Fragment,null,m.createElement("path",{d:"M216,48H180V36A28,28,0,0,0,152,8H104A28,28,0,0,0,76,36V48H40a12,12,0,0,0,0,24h4V208a20,20,0,0,0,20,20H192a20,20,0,0,0,20-20V72h4a12,12,0,0,0,0-24ZM100,36a4,4,0,0,1,4-4h48a4,4,0,0,1,4,4V48H100Zm88,168H68V72H188ZM116,104v64a12,12,0,0,1-24,0V104a12,12,0,0,1,24,0Zm48,0v64a12,12,0,0,1-24,0V104a12,12,0,0,1,24,0Z"}))],["duotone",m.createElement(m.Fragment,null,m.createElement("path",{d:"M200,56V208a8,8,0,0,1-8,8H64a8,8,0,0,1-8-8V56Z",opacity:"0.2"}),m.createElement("path",{d:"M216,48H176V40a24,24,0,0,0-24-24H104A24,24,0,0,0,80,40v8H40a8,8,0,0,0,0,16h8V208a16,16,0,0,0,16,16H192a16,16,0,0,0,16-16V64h8a8,8,0,0,0,0-16ZM96,40a8,8,0,0,1,8-8h48a8,8,0,0,1,8,8v8H96Zm96,168H64V64H192ZM112,104v64a8,8,0,0,1-16,0V104a8,8,0,0,1,16,0Zm48,0v64a8,8,0,0,1-16,0V104a8,8,0,0,1,16,0Z"}))],["fill",m.createElement(m.Fragment,null,m.createElement("path",{d:"M216,48H176V40a24,24,0,0,0-24-24H104A24,24,0,0,0,80,40v8H40a8,8,0,0,0,0,16h8V208a16,16,0,0,0,16,16H192a16,16,0,0,0,16-16V64h8a8,8,0,0,0,0-16ZM112,168a8,8,0,0,1-16,0V104a8,8,0,0,1,16,0Zm48,0a8,8,0,0,1-16,0V104a8,8,0,0,1,16,0Zm0-120H96V40a8,8,0,0,1,8-8h48a8,8,0,0,1,8,8Z"}))],["light",m.createElement(m.Fragment,null,m.createElement("path",{d:"M216,50H174V40a22,22,0,0,0-22-22H104A22,22,0,0,0,82,40V50H40a6,6,0,0,0,0,12H50V208a14,14,0,0,0,14,14H192a14,14,0,0,0,14-14V62h10a6,6,0,0,0,0-12ZM94,40a10,10,0,0,1,10-10h48a10,10,0,0,1,10,10V50H94ZM194,208a2,2,0,0,1-2,2H64a2,2,0,0,1-2-2V62H194ZM110,104v64a6,6,0,0,1-12,0V104a6,6,0,0,1,12,0Zm48,0v64a6,6,0,0,1-12,0V104a6,6,0,0,1,12,0Z"}))],["regular",m.createElement(m.Fragment,null,m.createElement("path",{d:"M216,48H176V40a24,24,0,0,0-24-24H104A24,24,0,0,0,80,40v8H40a8,8,0,0,0,0,16h8V208a16,16,0,0,0,16,16H192a16,16,0,0,0,16-16V64h8a8,8,0,0,0,0-16ZM96,40a8,8,0,0,1,8-8h48a8,8,0,0,1,8,8v8H96Zm96,168H64V64H192ZM112,104v64a8,8,0,0,1-16,0V104a8,8,0,0,1,16,0Zm48,0v64a8,8,0,0,1-16,0V104a8,8,0,0,1,16,0Z"}))],["thin",m.createElement(m.Fragment,null,m.createElement("path",{d:"M216,52H172V40a20,20,0,0,0-20-20H104A20,20,0,0,0,84,40V52H40a4,4,0,0,0,0,8H52V208a12,12,0,0,0,12,12H192a12,12,0,0,0,12-12V60h12a4,4,0,0,0,0-8ZM92,40a12,12,0,0,1,12-12h48a12,12,0,0,1,12,12V52H92ZM196,208a4,4,0,0,1-4,4H64a4,4,0,0,1-4-4V60H196ZM108,104v64a4,4,0,0,1-8,0V104a4,4,0,0,1,8,0Zm48,0v64a4,4,0,0,1-8,0V104a4,4,0,0,1,8,0Z"}))]]),Zq=new Map([["bold",m.createElement(m.Fragment,null,m.createElement("path",{d:"M234.38,210a123.36,123.36,0,0,0-60.78-53.23,76,76,0,1,0-91.2,0A123.36,123.36,0,0,0,21.62,210a12,12,0,1,0,20.77,12c18.12-31.32,50.12-50,85.61-50s67.49,18.69,85.61,50a12,12,0,0,0,20.77-12ZM76,96a52,52,0,1,1,52,52A52.06,52.06,0,0,1,76,96Z"}))],["duotone",m.createElement(m.Fragment,null,m.createElement("path",{d:"M192,96a64,64,0,1,1-64-64A64,64,0,0,1,192,96Z",opacity:"0.2"}),m.createElement("path",{d:"M230.92,212c-15.23-26.33-38.7-45.21-66.09-54.16a72,72,0,1,0-73.66,0C63.78,166.78,40.31,185.66,25.08,212a8,8,0,1,0,13.85,8c18.84-32.56,52.14-52,89.07-52s70.23,19.44,89.07,52a8,8,0,1,0,13.85-8ZM72,96a56,56,0,1,1,56,56A56.06,56.06,0,0,1,72,96Z"}))],["fill",m.createElement(m.Fragment,null,m.createElement("path",{d:"M230.93,220a8,8,0,0,1-6.93,4H32a8,8,0,0,1-6.92-12c15.23-26.33,38.7-45.21,66.09-54.16a72,72,0,1,1,73.66,0c27.39,8.95,50.86,27.83,66.09,54.16A8,8,0,0,1,230.93,220Z"}))],["light",m.createElement(m.Fragment,null,m.createElement("path",{d:"M229.19,213c-15.81-27.32-40.63-46.49-69.47-54.62a70,70,0,1,0-63.44,0C67.44,166.5,42.62,185.67,26.81,213a6,6,0,1,0,10.38,6C56.4,185.81,90.34,166,128,166s71.6,19.81,90.81,53a6,6,0,1,0,10.38-6ZM70,96a58,58,0,1,1,58,58A58.07,58.07,0,0,1,70,96Z"}))],["regular",m.createElement(m.Fragment,null,m.createElement("path",{d:"M230.92,212c-15.23-26.33-38.7-45.21-66.09-54.16a72,72,0,1,0-73.66,0C63.78,166.78,40.31,185.66,25.08,212a8,8,0,1,0,13.85,8c18.84-32.56,52.14-52,89.07-52s70.23,19.44,89.07,52a8,8,0,1,0,13.85-8ZM72,96a56,56,0,1,1,56,56A56.06,56.06,0,0,1,72,96Z"}))],["thin",m.createElement(m.Fragment,null,m.createElement("path",{d:"M227.46,214c-16.52-28.56-43-48.06-73.68-55.09a68,68,0,1,0-51.56,0c-30.64,7-57.16,26.53-73.68,55.09a4,4,0,0,0,6.92,4C55,184.19,89.62,164,128,164s73,20.19,92.54,54a4,4,0,0,0,3.46,2,3.93,3.93,0,0,0,2-.54A4,4,0,0,0,227.46,214ZM68,96a60,60,0,1,1,60,60A60.07,60.07,0,0,1,68,96Z"}))]]),Wq=new Map([["bold",m.createElement(m.Fragment,null,m.createElement("path",{d:"M208.49,191.51a12,12,0,0,1-17,17L128,145,64.49,208.49a12,12,0,0,1-17-17L111,128,47.51,64.49a12,12,0,0,1,17-17L128,111l63.51-63.52a12,12,0,0,1,17,17L145,128Z"}))],["duotone",m.createElement(m.Fragment,null,m.createElement("path",{d:"M216,56V200a16,16,0,0,1-16,16H56a16,16,0,0,1-16-16V56A16,16,0,0,1,56,40H200A16,16,0,0,1,216,56Z",opacity:"0.2"}),m.createElement("path",{d:"M205.66,194.34a8,8,0,0,1-11.32,11.32L128,139.31,61.66,205.66a8,8,0,0,1-11.32-11.32L116.69,128,50.34,61.66A8,8,0,0,1,61.66,50.34L128,116.69l66.34-66.35a8,8,0,0,1,11.32,11.32L139.31,128Z"}))],["fill",m.createElement(m.Fragment,null,m.createElement("path",{d:"M208,32H48A16,16,0,0,0,32,48V208a16,16,0,0,0,16,16H208a16,16,0,0,0,16-16V48A16,16,0,0,0,208,32ZM181.66,170.34a8,8,0,0,1-11.32,11.32L128,139.31,85.66,181.66a8,8,0,0,1-11.32-11.32L116.69,128,74.34,85.66A8,8,0,0,1,85.66,74.34L128,116.69l42.34-42.35a8,8,0,0,1,11.32,11.32L139.31,128Z"}))],["light",m.createElement(m.Fragment,null,m.createElement("path",{d:"M204.24,195.76a6,6,0,1,1-8.48,8.48L128,136.49,60.24,204.24a6,6,0,0,1-8.48-8.48L119.51,128,51.76,60.24a6,6,0,0,1,8.48-8.48L128,119.51l67.76-67.75a6,6,0,0,1,8.48,8.48L136.49,128Z"}))],["regular",m.createElement(m.Fragment,null,m.createElement("path",{d:"M205.66,194.34a8,8,0,0,1-11.32,11.32L128,139.31,61.66,205.66a8,8,0,0,1-11.32-11.32L116.69,128,50.34,61.66A8,8,0,0,1,61.66,50.34L128,116.69l66.34-66.35a8,8,0,0,1,11.32,11.32L139.31,128Z"}))],["thin",m.createElement(m.Fragment,null,m.createElement("path",{d:"M202.83,197.17a4,4,0,0,1-5.66,5.66L128,133.66,58.83,202.83a4,4,0,0,1-5.66-5.66L122.34,128,53.17,58.83a4,4,0,0,1,5.66-5.66L128,122.34l69.17-69.17a4,4,0,1,1,5.66,5.66L133.66,128Z"}))]]),qq=new Map([["bold",m.createElement(m.Fragment,null,m.createElement("path",{d:"M218.12,209.56l-61-95.8,59.72-65.69a12,12,0,0,0-17.76-16.14L143.81,92.77,106.12,33.56A12,12,0,0,0,96,28H48A12,12,0,0,0,37.88,46.44l61,95.8L39.12,207.93a12,12,0,1,0,17.76,16.14l55.31-60.84,37.69,59.21A12,12,0,0,0,160,228h48a12,12,0,0,0,10.12-18.44ZM166.59,204,69.86,52H89.41l96.73,152Z"}))],["duotone",m.createElement(m.Fragment,null,m.createElement("path",{d:"M208,216H160L48,40H96Z",opacity:"0.2"}),m.createElement("path",{d:"M214.75,211.71l-62.6-98.38,61.77-67.95a8,8,0,0,0-11.84-10.76L143.24,99.34,102.75,35.71A8,8,0,0,0,96,32H48a8,8,0,0,0-6.75,12.3l62.6,98.37-61.77,68a8,8,0,1,0,11.84,10.76l58.84-64.72,40.49,63.63A8,8,0,0,0,160,224h48a8,8,0,0,0,6.75-12.29ZM164.39,208,62.57,48h29L193.43,208Z"}))],["fill",m.createElement(m.Fragment,null,m.createElement("path",{d:"M215,219.85a8,8,0,0,1-7,4.15H160a8,8,0,0,1-6.75-3.71l-40.49-63.63L53.92,221.38a8,8,0,0,1-11.84-10.76l61.77-68L41.25,44.3A8,8,0,0,1,48,32H96a8,8,0,0,1,6.75,3.71l40.49,63.63,58.84-64.72a8,8,0,0,1,11.84,10.76l-61.77,67.95,62.6,98.38A8,8,0,0,1,215,219.85Z"}))],["light",m.createElement(m.Fragment,null,m.createElement("path",{d:"M213.06,212.78l-63.42-99.66L212.44,44A6,6,0,1,0,203.56,36L143,102.62l-41.9-65.84A6,6,0,0,0,96,34H48a6,6,0,0,0-5.06,9.22l63.42,99.66L43.56,212A6,6,0,0,0,52.44,220L113,153.38l41.9,65.84A6,6,0,0,0,160,222h48a6,6,0,0,0,5.06-9.22ZM163.29,210,58.93,46H92.71L197.07,210Z"}))],["regular",m.createElement(m.Fragment,null,m.createElement("path",{d:"M214.75,211.71l-62.6-98.38,61.77-67.95a8,8,0,0,0-11.84-10.76L143.24,99.34,102.75,35.71A8,8,0,0,0,96,32H48a8,8,0,0,0-6.75,12.3l62.6,98.37-61.77,68a8,8,0,1,0,11.84,10.76l58.84-64.72,40.49,63.63A8,8,0,0,0,160,224h48a8,8,0,0,0,6.75-12.29ZM164.39,208,62.57,48h29L193.43,208Z"}))],["thin",m.createElement(m.Fragment,null,m.createElement("path",{d:"M211.37,213.85,147.13,112.9,211,42.69A4,4,0,0,0,205,37.31L142.68,105.9,99.38,37.85A4,4,0,0,0,96,36H48a4,4,0,0,0-3.37,6.15L108.87,143.1,45,213.31A4,4,0,1,0,51,218.69l62.36-68.59,43.3,68.05A4,4,0,0,0,160,220h48a4,4,0,0,0,3.37-6.15ZM162.2,212,55.29,44H93.8L200.71,212Z"}))]]),Gq=m.createContext({color:"currentColor",size:"1em",weight:"regular",mirrored:!1}),nn=m.forwardRef((t,e)=>{const{alt:n,color:r,size:s,weight:i,mirrored:o,children:l,weights:u,...d}=t,{color:f="currentColor",size:p,weight:g="regular",mirrored:v=!1,...w}=m.useContext(Gq);return m.createElement("svg",{ref:e,xmlns:"http://www.w3.org/2000/svg",width:s??p,height:s??p,fill:r??f,viewBox:"0 0 256 256",transform:o||v?"scale(-1, 1)":void 0,...w,...d},!!n&&m.createElement("title",null,n),l,u.get(i??g))});nn.displayName="IconBase";const nM=m.forwardRef((t,e)=>m.createElement(nn,{ref:e,...t,weights:Sq}));nM.displayName="ArrowLeftIcon";const Kq=nM,rM=m.forwardRef((t,e)=>m.createElement(nn,{ref:e,...t,weights:kq}));rM.displayName="ArrowSquareOutIcon";const Yq=rM,sM=m.forwardRef((t,e)=>m.createElement(nn,{ref:e,...t,weights:Eq}));sM.displayName="ArrowUpIcon";const Xq=sM,iM=m.forwardRef((t,e)=>m.createElement(nn,{ref:e,...t,weights:Cq}));iM.displayName="CaretDownIcon";const Qq=iM,oM=m.forwardRef((t,e)=>m.createElement(nn,{ref:e,...t,weights:Pq}));oM.displayName="CaretRightIcon";const Jq=oM,aM=m.forwardRef((t,e)=>m.createElement(nn,{ref:e,...t,weights:Tq}));aM.displayName="ChatCircleIcon";const eG=aM,lM=m.forwardRef((t,e)=>m.createElement(nn,{ref:e,...t,weights:Aq}));lM.displayName="CheckIcon";const tG=lM,cM=m.forwardRef((t,e)=>m.createElement(nn,{ref:e,...t,weights:Rq}));cM.displayName="CircleNotchIcon";const Zg=cM,uM=m.forwardRef((t,e)=>m.createElement(nn,{ref:e,...t,weights:Mq}));uM.displayName="CopyIcon";const wh=uM,dM=m.forwardRef((t,e)=>m.createElement(nn,{ref:e,...t,weights:Iq}));dM.displayName="DotsThreeIcon";const nG=dM,fM=m.forwardRef((t,e)=>m.createElement(nn,{ref:e,...t,weights:Oq}));fM.displayName="FolderOpenIcon";const rG=fM,hM=m.forwardRef((t,e)=>m.createElement(nn,{ref:e,...t,weights:Lq}));hM.displayName="FolderSimpleIcon";const sG=hM,pM=m.forwardRef((t,e)=>m.createElement(nn,{ref:e,...t,weights:Nq}));pM.displayName="MagnifyingGlassIcon";const iG=pM,mM=m.forwardRef((t,e)=>m.createElement(nn,{ref:e,...t,weights:Dq}));mM.displayName="PencilSimpleIcon";const gM=mM,vM=m.forwardRef((t,e)=>m.createElement(nn,{ref:e,...t,weights:jq}));vM.displayName="PushPinIcon";const fw=vM,yM=m.forwardRef((t,e)=>m.createElement(nn,{ref:e,...t,weights:$q}));yM.displayName="SidebarSimpleIcon";const oG=yM,_M=m.forwardRef((t,e)=>m.createElement(nn,{ref:e,...t,weights:Fq}));_M.displayName="SignInIcon";const aG=_M,wM=m.forwardRef((t,e)=>m.createElement(nn,{ref:e,...t,weights:Vq}));wM.displayName="SignOutIcon";const lG=wM,xM=m.forwardRef((t,e)=>m.createElement(nn,{ref:e,...t,weights:Hq}));xM.displayName="SparkleIcon";const r_=xM,bM=m.forwardRef((t,e)=>m.createElement(nn,{ref:e,...t,weights:zq}));bM.displayName="SquaresFourIcon";const cG=bM,SM=m.forwardRef((t,e)=>m.createElement(nn,{ref:e,...t,weights:Uq}));SM.displayName="SwatchesIcon";const kM=SM,EM=m.forwardRef((t,e)=>m.createElement(nn,{ref:e,...t,weights:Bq}));EM.displayName="TrashIcon";const CM=EM,PM=m.forwardRef((t,e)=>m.createElement(nn,{ref:e,...t,weights:Zq}));PM.displayName="UserIcon";const uG=PM,TM=m.forwardRef((t,e)=>m.createElement(nn,{ref:e,...t,weights:Wq}));TM.displayName="XIcon";const vb=TM,AM=m.forwardRef((t,e)=>m.createElement(nn,{ref:e,...t,weights:qq}));AM.displayName="XLogoIcon";const dG=AM,fG="/assets/arena-Db0j1set.png",hG="data:image/svg+xml,%3csvg%20width='38'%20height='42'%20viewBox='0%200%2038%2042'%20fill='none'%20xmlns='http://www.w3.org/2000/svg'%3e%3cg%20clip-path='url(%23clip0_2543_2)'%3e%3cmask%20id='mask0_2543_2'%20style='mask-type:luminance'%20maskUnits='userSpaceOnUse'%20x='0'%20y='0'%20width='38'%20height='42'%3e%3cpath%20d='M0%200H38V42H0V0Z'%20fill='white'/%3e%3c/mask%3e%3cg%20mask='url(%23mask0_2543_2)'%3e%3cpath%20d='M19.025%2011.898C22.321%2011.898%2024.995%209.237%2024.995%205.949C24.995%202.661%2022.324%200%2019.025%200C15.726%200%2013.055%202.662%2013.055%205.95C13.055%209.237%2015.726%2011.898%2019.025%2011.898ZM19.025%2041.945C22.321%2041.945%2024.995%2039.283%2024.995%2035.995C24.995%2032.708%2022.324%2030.046%2019.025%2030.046C15.726%2030.046%2013.055%2032.708%2013.055%2035.996C13.055%2039.283%2015.726%2041.945%2019.025%2041.945ZM5.97%2019.41C9.266%2019.41%2011.94%2016.748%2011.94%2013.46C11.94%2010.173%209.268%207.511%205.97%207.511C2.67%207.511%200%2010.175%200%2013.463C0%2016.752%202.67%2019.413%205.97%2019.413V19.41ZM32.08%2034.434C35.376%2034.434%2038.05%2031.772%2038.05%2028.484C38.05%2025.197%2035.379%2022.535%2032.08%2022.535C28.781%2022.535%2026.11%2025.197%2026.11%2028.485C26.11%2031.772%2028.781%2034.434%2032.08%2034.434ZM32.08%2019.41C35.376%2019.41%2038.05%2016.748%2038.05%2013.46C38.05%2010.174%2035.379%207.512%2032.08%207.512C28.781%207.512%2026.11%2010.174%2026.11%2013.461C26.11%2016.748%2028.781%2019.41%2032.08%2019.41ZM5.97%2034.433C9.266%2034.433%2011.94%2031.771%2011.94%2028.483C11.94%2025.196%209.268%2022.535%205.97%2022.535C2.67%2022.535%200%2025.202%200%2028.486C0%2031.771%202.67%2034.436%205.97%2034.436V34.433Z'%20fill='white'/%3e%3c/g%3e%3c/g%3e%3cdefs%3e%3cclipPath%20id='clip0_2543_2'%3e%3crect%20width='38'%20height='42'%20fill='white'/%3e%3c/clipPath%3e%3c/defs%3e%3c/svg%3e";function RM(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=RM(t[e]))&&(r&&(r+=" "),r+=n)}else for(n in t)t[n]&&(r&&(r+=" "),r+=n);return r}function MM(){for(var t,e,n=0,r="",s=arguments.length;n<s;n++)(t=arguments[n])&&(e=RM(t))&&(r&&(r+=" "),r+=e);return r}const pG=(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},mG=(t,e)=>({classGroupId:t,validator:e}),IM=(t=new Map,e=null,n)=>({nextPart:t,validators:e,classGroupId:n}),hg="-",yC=[],gG="arbitrary..",vG=t=>{const e=_G(t),{conflictingClassGroups:n,conflictingClassGroupModifiers:r}=t;return{getClassGroupId:o=>{if(o.startsWith("[")&&o.endsWith("]"))return yG(o);const l=o.split(hg),u=l[0]===""&&l.length>1?1:0;return OM(l,u,e)},getConflictingClassGroupIds:(o,l)=>{if(l){const u=r[o],d=n[o];return u?d?pG(d,u):u:d||yC}return n[o]||yC}}},OM=(t,e,n)=>{if(t.length-e===0)return n.classGroupId;const s=t[e],i=n.nextPart.get(s);if(i){const d=OM(t,e+1,i);if(d)return d}const o=n.validators;if(o===null)return;const l=e===0?t.join(hg):t.slice(e).join(hg),u=o.length;for(let d=0;d<u;d++){const f=o[d];if(f.validator(l))return f.classGroupId}},yG=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?gG+r:void 0})(),_G=t=>{const{theme:e,classGroups:n}=t;return wG(n,e)},wG=(t,e)=>{const n=IM();for(const r in t){const s=t[r];yb(s,n,r,e)}return n},yb=(t,e,n,r)=>{const s=t.length;for(let i=0;i<s;i++){const o=t[i];xG(o,e,n,r)}},xG=(t,e,n,r)=>{if(typeof t=="string"){bG(t,e,n);return}if(typeof t=="function"){SG(t,e,n,r);return}kG(t,e,n,r)},bG=(t,e,n)=>{const r=t===""?e:LM(e,t);r.classGroupId=n},SG=(t,e,n,r)=>{if(EG(t)){yb(t(r),e,n,r);return}e.validators===null&&(e.validators=[]),e.validators.push(mG(n,t))},kG=(t,e,n,r)=>{const s=Object.entries(t),i=s.length;for(let o=0;o<i;o++){const[l,u]=s[o];yb(u,LM(e,l),n,r)}},LM=(t,e)=>{let n=t;const r=e.split(hg),s=r.length;for(let i=0;i<s;i++){const o=r[i];let l=n.nextPart.get(o);l||(l=IM(),n.nextPart.set(o,l)),n=l}return n},EG=t=>"isThemeGetter"in t&&t.isThemeGetter===!0,CG=t=>{if(t<1)return{get:()=>{},set:()=>{}};let e=0,n=Object.create(null),r=Object.create(null);const s=(i,o)=>{n[i]=o,e++,e>t&&(e=0,r=n,n=Object.create(null))};return{get(i){let o=n[i];if(o!==void 0)return o;if((o=r[i])!==void 0)return s(i,o),o},set(i,o){i in n?n[i]=o:s(i,o)}}},hw="!",_C=":",PG=[],wC=(t,e,n,r,s)=>({modifiers:t,hasImportantModifier:e,baseClassName:n,maybePostfixModifierPosition:r,isExternal:s}),TG=t=>{const{prefix:e,experimentalParseClassName:n}=t;let r=s=>{const i=[];let o=0,l=0,u=0,d;const f=s.length;for(let _=0;_<f;_++){const x=s[_];if(o===0&&l===0){if(x===_C){i.push(s.slice(u,_)),u=_+1;continue}if(x==="/"){d=_;continue}}x==="["?o++:x==="]"?o--:x==="("?l++:x===")"&&l--}const p=i.length===0?s:s.slice(u);let g=p,v=!1;p.endsWith(hw)?(g=p.slice(0,-1),v=!0):p.startsWith(hw)&&(g=p.slice(1),v=!0);const w=d&&d>u?d-u:void 0;return wC(i,v,g,w)};if(e){const s=e+_C,i=r;r=o=>o.startsWith(s)?i(o.slice(s.length)):wC(PG,!1,o,void 0,!0)}if(n){const s=r;r=i=>n({className:i,parseClassName:s})}return r},AG=t=>{const e=new Map;return t.orderSensitiveModifiers.forEach((n,r)=>{e.set(n,1e6+r)}),n=>{const r=[];let s=[];for(let i=0;i<n.length;i++){const o=n[i],l=o[0]==="[",u=e.has(o);l||u?(s.length>0&&(s.sort(),r.push(...s),s=[]),r.push(o)):s.push(o)}return s.length>0&&(s.sort(),r.push(...s)),r}},RG=t=>({cache:CG(t.cacheSize),parseClassName:TG(t),sortModifiers:AG(t),postfixLookupClassGroupIds:MG(t),...vG(t)}),MG=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},IG=/\s+/,OG=(t,e)=>{const{parseClassName:n,getClassGroupId:r,getConflictingClassGroupIds:s,sortModifiers:i,postfixLookupClassGroupIds:o}=e,l=[],u=t.trim().split(IG);let d="";for(let f=u.length-1;f>=0;f-=1){const p=u[f],{isExternal:g,modifiers:v,hasImportantModifier:w,baseClassName:_,maybePostfixModifierPosition:x}=n(p);if(g){d=p+(d.length>0?" "+d:d);continue}let S=!!x,k;if(S){const M=_.substring(0,x);k=r(M);const R=k&&o[k]?r(_):void 0;R&&R!==k&&(k=R,S=!1)}else k=r(_);if(!k){if(!S){d=p+(d.length>0?" "+d:d);continue}if(k=r(_),!k){d=p+(d.length>0?" "+d:d);continue}S=!1}const C=v.length===0?"":v.length===1?v[0]:i(v).join(":"),T=w?C+hw:C,A=T+k;if(l.indexOf(A)>-1)continue;l.push(A);const I=s(k,S);for(let M=0;M<I.length;++M){const R=I[M];l.push(T+R)}d=p+(d.length>0?" "+d:d)}return d},LG=(...t)=>{let e=0,n,r,s="";for(;e<t.length;)(n=t[e++])&&(r=NM(n))&&(s&&(s+=" "),s+=r);return s},NM=t=>{if(typeof t=="string")return t;let e,n="";for(let r=0;r<t.length;r++)t[r]&&(e=NM(t[r]))&&(n&&(n+=" "),n+=e);return n},NG=(t,...e)=>{let n,r,s,i;const o=u=>{const d=e.reduce((f,p)=>p(f),t());return n=RG(d),r=n.cache.get,s=n.cache.set,i=l,l(u)},l=u=>{const d=r(u);if(d)return d;const f=OG(u,n);return s(u,f),f};return i=o,(...u)=>i(LG(...u))},DG=[],qn=t=>{const e=n=>n[t]||DG;return e.isThemeGetter=!0,e.themeKey=t,e},DM=/^\[(?:(\w[\w-]*):)?(.+)\]$/i,jM=/^\((?:(\w[\w-]*):)?(.+)\)$/i,jG=/^\d+(?:\.\d+)?\/\d+(?:\.\d+)?$/,$G=/^(\d+(\.\d+)?)?(xs|sm|md|lg|xl)$/,FG=/\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$/,VG=/^(rgba?|hsla?|hwb|(ok)?(lab|lch)|color-mix|color|light-dark)\(.+\)$/,HG=/^(inset_)?-?((\d+)?\.?(\d+)[a-z]+|0)_-?((\d+)?\.?(\d+)[a-z]+|0)/,zG=/^(url|image|image-set|cross-fade|element|(repeating-)?(linear|radial|conic)-gradient)\(.+\)$/,ya=t=>jG.test(t),mt=t=>!!t&&!Number.isNaN(Number(t)),Ri=t=>!!t&&Number.isInteger(Number(t)),s_=t=>t.endsWith("%")&&mt(t.slice(0,-1)),_o=t=>$G.test(t),$M=()=>!0,UG=t=>FG.test(t)&&!VG.test(t),_b=()=>!1,BG=t=>HG.test(t),ZG=t=>zG.test(t),WG=t=>!Ie(t)&&!De(t),qG=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)),GG=t=>tl(t,HM,_b),Ie=t=>DM.test(t),Rl=t=>tl(t,zM,UG),xC=t=>tl(t,nK,mt),KG=t=>tl(t,BM,$M),YG=t=>tl(t,UM,_b),bC=t=>tl(t,FM,_b),XG=t=>tl(t,VM,ZG),A0=t=>tl(t,ZM,BG),De=t=>jM.test(t),wf=t=>xc(t,zM),QG=t=>xc(t,UM),SC=t=>xc(t,FM),JG=t=>xc(t,HM),eK=t=>xc(t,VM),R0=t=>xc(t,ZM,!0),tK=t=>xc(t,BM,!0),tl=(t,e,n)=>{const r=DM.exec(t);return r?r[1]?e(r[1]):n(r[2]):!1},xc=(t,e,n=!1)=>{const r=jM.exec(t);return r?r[1]?e(r[1]):n:!1},FM=t=>t==="position"||t==="percentage",VM=t=>t==="image"||t==="url",HM=t=>t==="length"||t==="size"||t==="bg-size",zM=t=>t==="length",nK=t=>t==="number",UM=t=>t==="family-name",BM=t=>t==="number"||t==="weight",ZM=t=>t==="shadow",rK=()=>{const t=qn("color"),e=qn("font"),n=qn("text"),r=qn("font-weight"),s=qn("tracking"),i=qn("leading"),o=qn("breakpoint"),l=qn("container"),u=qn("spacing"),d=qn("radius"),f=qn("shadow"),p=qn("inset-shadow"),g=qn("text-shadow"),v=qn("drop-shadow"),w=qn("blur"),_=qn("perspective"),x=qn("aspect"),S=qn("ease"),k=qn("animate"),C=()=>["auto","avoid","all","avoid-page","page","left","right","column"],T=()=>["center","top","bottom","left","right","top-left","left-top","top-right","right-top","bottom-right","right-bottom","bottom-left","left-bottom"],A=()=>[...T(),De,Ie],I=()=>["auto","hidden","clip","visible","scroll"],M=()=>["auto","contain","none"],R=()=>[De,Ie,u],O=()=>[ya,"full","auto",...R()],N=()=>[Ri,"none","subgrid",De,Ie],D=()=>["auto",{span:["full",Ri,De,Ie]},Ri,De,Ie],$=()=>[Ri,"auto",De,Ie],Y=()=>["auto","min","max","fr",De,Ie],B=()=>["start","end","center","between","around","evenly","stretch","baseline","center-safe","end-safe"],G=()=>["start","end","center","stretch","center-safe","end-safe"],V=()=>["auto",...R()],K=()=>[ya,"auto","full","dvw","dvh","lvw","lvh","svw","svh","min","max","fit",...R()],U=()=>[l,ya,"screen","full","dvw","lvw","svw","min","max","fit",...R()],ee=()=>[ya,"screen","full","lh","dvh","lvh","svh","min","max","fit",...R()],Z=()=>[t,De,Ie],j=()=>[...T(),SC,bC,{position:[De,Ie]}],Q=()=>["no-repeat",{repeat:["","x","y","space","round"]}],oe=()=>["auto","cover","contain",JG,GG,{size:[De,Ie]}],re=()=>[s_,wf,Rl],ie=()=>["","none","full",d,De,Ie],fe=()=>["",mt,wf,Rl],_e=()=>["solid","dashed","dotted","double"],ue=()=>["normal","multiply","screen","overlay","darken","lighten","color-dodge","color-burn","hard-light","soft-light","difference","exclusion","hue","saturation","color","luminosity"],ae=()=>[mt,s_,SC,bC],Oe=()=>["","none",w,De,Ie],Be=()=>["none",mt,De,Ie],Ee=()=>["none",mt,De,Ie],pt=()=>[mt,De,Ie],Ot=()=>[ya,"full",...R()];return{cacheSize:500,theme:{animate:["spin","ping","pulse","bounce"],aspect:["video"],blur:[_o],breakpoint:[_o],color:[$M],container:[_o],"drop-shadow":[_o],ease:["in","out","in-out"],font:[WG],"font-weight":["thin","extralight","light","normal","medium","semibold","bold","extrabold","black"],"inset-shadow":[_o],leading:["none","tight","snug","normal","relaxed","loose"],perspective:["dramatic","near","normal","midrange","distant","none"],radius:[_o],shadow:[_o],spacing:["px",mt],text:[_o],"text-shadow":[_o],tracking:["tighter","tight","normal","wide","wider","widest"]},classGroups:{aspect:[{aspect:["auto","square",ya,Ie,De,x]}],container:["container"],"container-type":[{"@container":["","normal","size",De,Ie]}],"container-named":[qG],columns:[{columns:[mt,"auto",Ie,De,l]}],"break-after":[{"break-after":C()}],"break-before":[{"break-before":C()}],"break-inside":[{"break-inside":["auto","avoid","avoid-page","avoid-column"]}],"box-decoration":[{"box-decoration":["slice","clone"]}],box:[{box:["border","content"]}],display:["block","inline-block","inline","flex","inline-flex","table","inline-table","table-caption","table-cell","table-column","table-column-group","table-footer-group","table-header-group","table-row-group","table-row","flow-root","grid","inline-grid","contents","list-item","hidden"],sr:["sr-only","not-sr-only"],float:[{float:["right","left","none","start","end"]}],clear:[{clear:["left","right","both","none","start","end"]}],isolation:["isolate","isolation-auto"],"object-fit":[{object:["contain","cover","fill","none","scale-down"]}],"object-position":[{object:A()}],overflow:[{overflow:I()}],"overflow-x":[{"overflow-x":I()}],"overflow-y":[{"overflow-y":I()}],overscroll:[{overscroll:M()}],"overscroll-x":[{"overscroll-x":M()}],"overscroll-y":[{"overscroll-y":M()}],position:["static","fixed","absolute","relative","sticky"],inset:[{inset:O()}],"inset-x":[{"inset-x":O()}],"inset-y":[{"inset-y":O()}],start:[{"inset-s":O(),start:O()}],end:[{"inset-e":O(),end:O()}],"inset-bs":[{"inset-bs":O()}],"inset-be":[{"inset-be":O()}],top:[{top:O()}],right:[{right:O()}],bottom:[{bottom:O()}],left:[{left:O()}],visibility:["visible","invisible","collapse"],z:[{z:[Ri,"auto",De,Ie]}],basis:[{basis:[ya,"full","auto",l,...R()]}],"flex-direction":[{flex:["row","row-reverse","col","col-reverse"]}],"flex-wrap":[{flex:["nowrap","wrap","wrap-reverse"]}],flex:[{flex:[mt,ya,"auto","initial","none",Ie]}],grow:[{grow:["",mt,De,Ie]}],shrink:[{shrink:["",mt,De,Ie]}],order:[{order:[Ri,"first","last","none",De,Ie]}],"grid-cols":[{"grid-cols":N()}],"col-start-end":[{col:D()}],"col-start":[{"col-start":$()}],"col-end":[{"col-end":$()}],"grid-rows":[{"grid-rows":N()}],"row-start-end":[{row:D()}],"row-start":[{"row-start":$()}],"row-end":[{"row-end":$()}],"grid-flow":[{"grid-flow":["row","col","dense","row-dense","col-dense"]}],"auto-cols":[{"auto-cols":Y()}],"auto-rows":[{"auto-rows":Y()}],gap:[{gap:R()}],"gap-x":[{"gap-x":R()}],"gap-y":[{"gap-y":R()}],"justify-content":[{justify:[...B(),"normal"]}],"justify-items":[{"justify-items":[...G(),"normal"]}],"justify-self":[{"justify-self":["auto",...G()]}],"align-content":[{content:["normal",...B()]}],"align-items":[{items:[...G(),{baseline:["","last"]}]}],"align-self":[{self:["auto",...G(),{baseline:["","last"]}]}],"place-content":[{"place-content":B()}],"place-items":[{"place-items":[...G(),"baseline"]}],"place-self":[{"place-self":["auto",...G()]}],p:[{p:R()}],px:[{px:R()}],py:[{py:R()}],ps:[{ps:R()}],pe:[{pe:R()}],pbs:[{pbs:R()}],pbe:[{pbe:R()}],pt:[{pt:R()}],pr:[{pr:R()}],pb:[{pb:R()}],pl:[{pl:R()}],m:[{m:V()}],mx:[{mx:V()}],my:[{my:V()}],ms:[{ms:V()}],me:[{me:V()}],mbs:[{mbs:V()}],mbe:[{mbe:V()}],mt:[{mt:V()}],mr:[{mr:V()}],mb:[{mb:V()}],ml:[{ml:V()}],"space-x":[{"space-x":R()}],"space-x-reverse":["space-x-reverse"],"space-y":[{"space-y":R()}],"space-y-reverse":["space-y-reverse"],size:[{size:K()}],"inline-size":[{inline:["auto",...U()]}],"min-inline-size":[{"min-inline":["auto",...U()]}],"max-inline-size":[{"max-inline":["none",...U()]}],"block-size":[{block:["auto",...ee()]}],"min-block-size":[{"min-block":["auto",...ee()]}],"max-block-size":[{"max-block":["none",...ee()]}],w:[{w:[l,"screen",...K()]}],"min-w":[{"min-w":[l,"screen","none",...K()]}],"max-w":[{"max-w":[l,"screen","none","prose",{screen:[o]},...K()]}],h:[{h:["screen","lh",...K()]}],"min-h":[{"min-h":["screen","lh","none",...K()]}],"max-h":[{"max-h":["screen","lh","none",...K()]}],"font-size":[{text:["base",n,wf,Rl]}],"font-smoothing":["antialiased","subpixel-antialiased"],"font-style":["italic","not-italic"],"font-weight":[{font:[r,tK,KG]}],"font-stretch":[{"font-stretch":["ultra-condensed","extra-condensed","condensed","semi-condensed","normal","semi-expanded","expanded","extra-expanded","ultra-expanded",s_,Ie]}],"font-family":[{font:[QG,YG,e]}],"font-features":[{"font-features":[Ie]}],"fvn-normal":["normal-nums"],"fvn-ordinal":["ordinal"],"fvn-slashed-zero":["slashed-zero"],"fvn-figure":["lining-nums","oldstyle-nums"],"fvn-spacing":["proportional-nums","tabular-nums"],"fvn-fraction":["diagonal-fractions","stacked-fractions"],tracking:[{tracking:[s,De,Ie]}],"line-clamp":[{"line-clamp":[mt,"none",De,xC]}],leading:[{leading:["none",i,...R()]}],"list-image":[{"list-image":["none",De,Ie]}],"list-style-position":[{list:["inside","outside"]}],"list-style-type":[{list:["disc","decimal","none",De,Ie]}],"text-alignment":[{text:["left","center","right","justify","start","end"]}],"placeholder-color":[{placeholder:Z()}],"text-color":[{text:Z()}],"text-decoration":["underline","overline","line-through","no-underline"],"text-decoration-style":[{decoration:[..._e(),"wavy"]}],"text-decoration-thickness":[{decoration:[mt,"from-font","auto",De,Rl]}],"text-decoration-color":[{decoration:Z()}],"underline-offset":[{"underline-offset":[mt,"auto",De,Ie]}],"text-transform":["uppercase","lowercase","capitalize","normal-case"],"text-overflow":["truncate","text-ellipsis","text-clip"],"text-wrap":[{text:["wrap","nowrap","balance","pretty"]}],indent:[{indent:R()}],"tab-size":[{tab:[Ri,De,Ie]}],"vertical-align":[{align:["baseline","top","middle","bottom","text-top","text-bottom","sub","super",De,Ie]}],whitespace:[{whitespace:["normal","nowrap","pre","pre-line","pre-wrap","break-spaces"]}],break:[{break:["normal","words","all","keep"]}],wrap:[{wrap:["break-word","anywhere","normal"]}],hyphens:[{hyphens:["none","manual","auto"]}],content:[{content:["none",De,Ie]}],"bg-attachment":[{bg:["fixed","local","scroll"]}],"bg-clip":[{"bg-clip":["border","padding","content","text"]}],"bg-origin":[{"bg-origin":["border","padding","content"]}],"bg-position":[{bg:j()}],"bg-repeat":[{bg:Q()}],"bg-size":[{bg:oe()}],"bg-image":[{bg:["none",{linear:[{to:["t","tr","r","br","b","bl","l","tl"]},Ri,De,Ie],radial:["",De,Ie],conic:["",Ri,De,Ie]},eK,XG]}],"bg-color":[{bg:Z()}],"gradient-from-pos":[{from:re()}],"gradient-via-pos":[{via:re()}],"gradient-to-pos":[{to:re()}],"gradient-from":[{from:Z()}],"gradient-via":[{via:Z()}],"gradient-to":[{to:Z()}],rounded:[{rounded:ie()}],"rounded-s":[{"rounded-s":ie()}],"rounded-e":[{"rounded-e":ie()}],"rounded-t":[{"rounded-t":ie()}],"rounded-r":[{"rounded-r":ie()}],"rounded-b":[{"rounded-b":ie()}],"rounded-l":[{"rounded-l":ie()}],"rounded-ss":[{"rounded-ss":ie()}],"rounded-se":[{"rounded-se":ie()}],"rounded-ee":[{"rounded-ee":ie()}],"rounded-es":[{"rounded-es":ie()}],"rounded-tl":[{"rounded-tl":ie()}],"rounded-tr":[{"rounded-tr":ie()}],"rounded-br":[{"rounded-br":ie()}],"rounded-bl":[{"rounded-bl":ie()}],"border-w":[{border:fe()}],"border-w-x":[{"border-x":fe()}],"border-w-y":[{"border-y":fe()}],"border-w-s":[{"border-s":fe()}],"border-w-e":[{"border-e":fe()}],"border-w-bs":[{"border-bs":fe()}],"border-w-be":[{"border-be":fe()}],"border-w-t":[{"border-t":fe()}],"border-w-r":[{"border-r":fe()}],"border-w-b":[{"border-b":fe()}],"border-w-l":[{"border-l":fe()}],"divide-x":[{"divide-x":fe()}],"divide-x-reverse":["divide-x-reverse"],"divide-y":[{"divide-y":fe()}],"divide-y-reverse":["divide-y-reverse"],"border-style":[{border:[..._e(),"hidden","none"]}],"divide-style":[{divide:[..._e(),"hidden","none"]}],"border-color":[{border:Z()}],"border-color-x":[{"border-x":Z()}],"border-color-y":[{"border-y":Z()}],"border-color-s":[{"border-s":Z()}],"border-color-e":[{"border-e":Z()}],"border-color-bs":[{"border-bs":Z()}],"border-color-be":[{"border-be":Z()}],"border-color-t":[{"border-t":Z()}],"border-color-r":[{"border-r":Z()}],"border-color-b":[{"border-b":Z()}],"border-color-l":[{"border-l":Z()}],"divide-color":[{divide:Z()}],"outline-style":[{outline:[..._e(),"none","hidden"]}],"outline-offset":[{"outline-offset":[mt,De,Ie]}],"outline-w":[{outline:["",mt,wf,Rl]}],"outline-color":[{outline:Z()}],shadow:[{shadow:["","inner","none",f,R0,A0]}],"shadow-color":[{shadow:Z()}],"inset-shadow":[{"inset-shadow":["none",p,R0,A0]}],"inset-shadow-color":[{"inset-shadow":Z()}],"ring-w":[{ring:fe()}],"ring-w-inset":["ring-inset"],"ring-color":[{ring:Z()}],"ring-offset-w":[{"ring-offset":[mt,Rl]}],"ring-offset-color":[{"ring-offset":Z()}],"inset-ring-w":[{"inset-ring":fe()}],"inset-ring-color":[{"inset-ring":Z()}],"text-shadow":[{"text-shadow":["none",g,R0,A0]}],"text-shadow-color":[{"text-shadow":Z()}],opacity:[{opacity:[mt,De,Ie]}],"mix-blend":[{"mix-blend":[...ue(),"plus-darker","plus-lighter"]}],"bg-blend":[{"bg-blend":ue()}],"mask-clip":[{"mask-clip":["border","padding","content","fill","stroke","view"]},"mask-no-clip"],"mask-composite":[{mask:["add","subtract","intersect","exclude"]}],"mask-image-linear-pos":[{"mask-linear":[mt]}],"mask-image-linear-from-pos":[{"mask-linear-from":ae()}],"mask-image-linear-to-pos":[{"mask-linear-to":ae()}],"mask-image-linear-from-color":[{"mask-linear-from":Z()}],"mask-image-linear-to-color":[{"mask-linear-to":Z()}],"mask-image-t-from-pos":[{"mask-t-from":ae()}],"mask-image-t-to-pos":[{"mask-t-to":ae()}],"mask-image-t-from-color":[{"mask-t-from":Z()}],"mask-image-t-to-color":[{"mask-t-to":Z()}],"mask-image-r-from-pos":[{"mask-r-from":ae()}],"mask-image-r-to-pos":[{"mask-r-to":ae()}],"mask-image-r-from-color":[{"mask-r-from":Z()}],"mask-image-r-to-color":[{"mask-r-to":Z()}],"mask-image-b-from-pos":[{"mask-b-from":ae()}],"mask-image-b-to-pos":[{"mask-b-to":ae()}],"mask-image-b-from-color":[{"mask-b-from":Z()}],"mask-image-b-to-color":[{"mask-b-to":Z()}],"mask-image-l-from-pos":[{"mask-l-from":ae()}],"mask-image-l-to-pos":[{"mask-l-to":ae()}],"mask-image-l-from-color":[{"mask-l-from":Z()}],"mask-image-l-to-color":[{"mask-l-to":Z()}],"mask-image-x-from-pos":[{"mask-x-from":ae()}],"mask-image-x-to-pos":[{"mask-x-to":ae()}],"mask-image-x-from-color":[{"mask-x-from":Z()}],"mask-image-x-to-color":[{"mask-x-to":Z()}],"mask-image-y-from-pos":[{"mask-y-from":ae()}],"mask-image-y-to-pos":[{"mask-y-to":ae()}],"mask-image-y-from-color":[{"mask-y-from":Z()}],"mask-image-y-to-color":[{"mask-y-to":Z()}],"mask-image-radial":[{"mask-radial":[De,Ie]}],"mask-image-radial-from-pos":[{"mask-radial-from":ae()}],"mask-image-radial-to-pos":[{"mask-radial-to":ae()}],"mask-image-radial-from-color":[{"mask-radial-from":Z()}],"mask-image-radial-to-color":[{"mask-radial-to":Z()}],"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":T()}],"mask-image-conic-pos":[{"mask-conic":[mt]}],"mask-image-conic-from-pos":[{"mask-conic-from":ae()}],"mask-image-conic-to-pos":[{"mask-conic-to":ae()}],"mask-image-conic-from-color":[{"mask-conic-from":Z()}],"mask-image-conic-to-color":[{"mask-conic-to":Z()}],"mask-mode":[{mask:["alpha","luminance","match"]}],"mask-origin":[{"mask-origin":["border","padding","content","fill","stroke","view"]}],"mask-position":[{mask:j()}],"mask-repeat":[{mask:Q()}],"mask-size":[{mask:oe()}],"mask-type":[{"mask-type":["alpha","luminance"]}],"mask-image":[{mask:["none",De,Ie]}],filter:[{filter:["","none",De,Ie]}],blur:[{blur:Oe()}],brightness:[{brightness:[mt,De,Ie]}],contrast:[{contrast:[mt,De,Ie]}],"drop-shadow":[{"drop-shadow":["","none",v,R0,A0]}],"drop-shadow-color":[{"drop-shadow":Z()}],grayscale:[{grayscale:["",mt,De,Ie]}],"hue-rotate":[{"hue-rotate":[mt,De,Ie]}],invert:[{invert:["",mt,De,Ie]}],saturate:[{saturate:[mt,De,Ie]}],sepia:[{sepia:["",mt,De,Ie]}],"backdrop-filter":[{"backdrop-filter":["","none",De,Ie]}],"backdrop-blur":[{"backdrop-blur":Oe()}],"backdrop-brightness":[{"backdrop-brightness":[mt,De,Ie]}],"backdrop-contrast":[{"backdrop-contrast":[mt,De,Ie]}],"backdrop-grayscale":[{"backdrop-grayscale":["",mt,De,Ie]}],"backdrop-hue-rotate":[{"backdrop-hue-rotate":[mt,De,Ie]}],"backdrop-invert":[{"backdrop-invert":["",mt,De,Ie]}],"backdrop-opacity":[{"backdrop-opacity":[mt,De,Ie]}],"backdrop-saturate":[{"backdrop-saturate":[mt,De,Ie]}],"backdrop-sepia":[{"backdrop-sepia":["",mt,De,Ie]}],"border-collapse":[{border:["collapse","separate"]}],"border-spacing":[{"border-spacing":R()}],"border-spacing-x":[{"border-spacing-x":R()}],"border-spacing-y":[{"border-spacing-y":R()}],"table-layout":[{table:["auto","fixed"]}],caption:[{caption:["top","bottom"]}],transition:[{transition:["","all","colors","opacity","shadow","transform","none",De,Ie]}],"transition-behavior":[{transition:["normal","discrete"]}],duration:[{duration:[mt,"initial",De,Ie]}],ease:[{ease:["linear","initial",S,De,Ie]}],delay:[{delay:[mt,De,Ie]}],animate:[{animate:["none",k,De,Ie]}],backface:[{backface:["hidden","visible"]}],perspective:[{perspective:[_,De,Ie]}],"perspective-origin":[{"perspective-origin":A()}],rotate:[{rotate:Be()}],"rotate-x":[{"rotate-x":Be()}],"rotate-y":[{"rotate-y":Be()}],"rotate-z":[{"rotate-z":Be()}],scale:[{scale:Ee()}],"scale-x":[{"scale-x":Ee()}],"scale-y":[{"scale-y":Ee()}],"scale-z":[{"scale-z":Ee()}],"scale-3d":["scale-3d"],skew:[{skew:pt()}],"skew-x":[{"skew-x":pt()}],"skew-y":[{"skew-y":pt()}],transform:[{transform:[De,Ie,"","none","gpu","cpu"]}],"transform-origin":[{origin:A()}],"transform-style":[{transform:["3d","flat"]}],translate:[{translate:Ot()}],"translate-x":[{"translate-x":Ot()}],"translate-y":[{"translate-y":Ot()}],"translate-z":[{"translate-z":Ot()}],"translate-none":["translate-none"],zoom:[{zoom:[Ri,De,Ie]}],accent:[{accent:Z()}],appearance:[{appearance:["none","auto"]}],"caret-color":[{caret:Z()}],"color-scheme":[{scheme:["normal","dark","light","light-dark","only-dark","only-light"]}],cursor:[{cursor:["auto","default","pointer","wait","text","move","help","not-allowed","none","context-menu","progress","cell","crosshair","vertical-text","alias","copy","no-drop","grab","grabbing","all-scroll","col-resize","row-resize","n-resize","e-resize","s-resize","w-resize","ne-resize","nw-resize","se-resize","sw-resize","ew-resize","ns-resize","nesw-resize","nwse-resize","zoom-in","zoom-out",De,Ie]}],"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":Z()}],"scrollbar-track-color":[{"scrollbar-track":Z()}],"scrollbar-gutter":[{"scrollbar-gutter":["auto","stable","both"]}],"scrollbar-w":[{scrollbar:["auto","thin","none"]}],"scroll-m":[{"scroll-m":R()}],"scroll-mx":[{"scroll-mx":R()}],"scroll-my":[{"scroll-my":R()}],"scroll-ms":[{"scroll-ms":R()}],"scroll-me":[{"scroll-me":R()}],"scroll-mbs":[{"scroll-mbs":R()}],"scroll-mbe":[{"scroll-mbe":R()}],"scroll-mt":[{"scroll-mt":R()}],"scroll-mr":[{"scroll-mr":R()}],"scroll-mb":[{"scroll-mb":R()}],"scroll-ml":[{"scroll-ml":R()}],"scroll-p":[{"scroll-p":R()}],"scroll-px":[{"scroll-px":R()}],"scroll-py":[{"scroll-py":R()}],"scroll-ps":[{"scroll-ps":R()}],"scroll-pe":[{"scroll-pe":R()}],"scroll-pbs":[{"scroll-pbs":R()}],"scroll-pbe":[{"scroll-pbe":R()}],"scroll-pt":[{"scroll-pt":R()}],"scroll-pr":[{"scroll-pr":R()}],"scroll-pb":[{"scroll-pb":R()}],"scroll-pl":[{"scroll-pl":R()}],"snap-align":[{snap:["start","end","center","align-none"]}],"snap-stop":[{snap:["normal","always"]}],"snap-type":[{snap:["none","x","y","both"]}],"snap-strictness":[{snap:["mandatory","proximity"]}],touch:[{touch:["auto","none","manipulation"]}],"touch-x":[{"touch-pan":["x","left","right"]}],"touch-y":[{"touch-pan":["y","up","down"]}],"touch-pz":["touch-pinch-zoom"],select:[{select:["none","text","all","auto"]}],"will-change":[{"will-change":["auto","scroll","contents","transform",De,Ie]}],fill:[{fill:["none",...Z()]}],"stroke-w":[{stroke:[mt,wf,Rl,xC]}],stroke:[{stroke:["none",...Z()]}],"forced-color-adjust":[{"forced-color-adjust":["auto","none"]}]},conflictingClassGroups:{"container-named":["container-type"],overflow:["overflow-x","overflow-y"],overscroll:["overscroll-x","overscroll-y"],inset:["inset-x","inset-y","inset-bs","inset-be","start","end","top","right","bottom","left"],"inset-x":["start","end","right","left"],"inset-y":["inset-bs","inset-be","top","bottom"],flex:["basis","grow","shrink"],gap:["gap-x","gap-y"],p:["px","py","ps","pe","pbs","pbe","pt","pr","pb","pl"],px:["ps","pe","pr","pl"],py:["pbs","pbe","pt","pb"],m:["mx","my","ms","me","mbs","mbe","mt","mr","mb","ml"],mx:["ms","me","mr","ml"],my:["mbs","mbe","mt","mb"],size:["w","h"],"font-size":["leading"],"fvn-normal":["fvn-ordinal","fvn-slashed-zero","fvn-figure","fvn-spacing","fvn-fraction"],"fvn-ordinal":["fvn-normal"],"fvn-slashed-zero":["fvn-normal"],"fvn-figure":["fvn-normal"],"fvn-spacing":["fvn-normal"],"fvn-fraction":["fvn-normal"],"line-clamp":["display","overflow"],rounded:["rounded-s","rounded-e","rounded-t","rounded-r","rounded-b","rounded-l","rounded-ss","rounded-se","rounded-ee","rounded-es","rounded-tl","rounded-tr","rounded-br","rounded-bl"],"rounded-s":["rounded-ss","rounded-es"],"rounded-e":["rounded-se","rounded-ee"],"rounded-t":["rounded-tl","rounded-tr"],"rounded-r":["rounded-tr","rounded-br"],"rounded-b":["rounded-br","rounded-bl"],"rounded-l":["rounded-tl","rounded-bl"],"border-spacing":["border-spacing-x","border-spacing-y"],"border-w":["border-w-x","border-w-y","border-w-s","border-w-e","border-w-bs","border-w-be","border-w-t","border-w-r","border-w-b","border-w-l"],"border-w-x":["border-w-s","border-w-e","border-w-r","border-w-l"],"border-w-y":["border-w-bs","border-w-be","border-w-t","border-w-b"],"border-color":["border-color-x","border-color-y","border-color-s","border-color-e","border-color-bs","border-color-be","border-color-t","border-color-r","border-color-b","border-color-l"],"border-color-x":["border-color-s","border-color-e","border-color-r","border-color-l"],"border-color-y":["border-color-bs","border-color-be","border-color-t","border-color-b"],translate:["translate-x","translate-y","translate-none"],"translate-none":["translate","translate-x","translate-y","translate-z"],"scroll-m":["scroll-mx","scroll-my","scroll-ms","scroll-me","scroll-mbs","scroll-mbe","scroll-mt","scroll-mr","scroll-mb","scroll-ml"],"scroll-mx":["scroll-ms","scroll-me","scroll-mr","scroll-ml"],"scroll-my":["scroll-mbs","scroll-mbe","scroll-mt","scroll-mb"],"scroll-p":["scroll-px","scroll-py","scroll-ps","scroll-pe","scroll-pbs","scroll-pbe","scroll-pt","scroll-pr","scroll-pb","scroll-pl"],"scroll-px":["scroll-ps","scroll-pe","scroll-pr","scroll-pl"],"scroll-py":["scroll-pbs","scroll-pbe","scroll-pt","scroll-pb"],touch:["touch-x","touch-y","touch-pz"],"touch-x":["touch"],"touch-y":["touch"],"touch-pz":["touch"]},conflictingClassGroupModifiers:{"font-size":["leading"]},postfixLookupClassGroups:["container-type"],orderSensitiveModifiers:["*","**","after","backdrop","before","details-content","file","first-letter","first-line","marker","placeholder","selection"]}},sK=NG(rK);function Ut(...t){return sK(MM(t))}const Gf=({provider:t,className:e})=>{if(t==="x")return b.jsx(dG,{className:Ut("h-6 w-6",e),"aria-hidden":"true"});if(t==="pinterest")return b.jsx("svg",{viewBox:"0 0 24 24",className:Ut("h-6 w-6",e),"aria-hidden":"true",children:b.jsx("path",{fill:"currentColor",d:"M12 0C5.373 0 0 5.372 0 12c0 5.084 3.163 9.426 7.627 11.174-.105-.949-.2-2.405.042-3.441.218-.937 1.407-5.965 1.407-5.965s-.359-.719-.359-1.781c0-1.669.967-2.915 2.171-2.915 1.024 0 1.518.769 1.518 1.69 0 1.029-.655 2.568-.994 3.995-.283 1.194.599 2.169 1.777 2.169 2.132 0 3.772-2.249 3.772-5.495 0-2.873-2.064-4.882-5.012-4.882-3.414 0-5.418 2.561-5.418 5.207 0 1.031.397 2.137.893 2.739.098.119.112.223.083.344-.091.379-.293 1.194-.333 1.361-.052.22-.174.266-.401.16-1.499-.698-2.436-2.889-2.436-4.649 0-3.785 2.75-7.262 7.929-7.262 4.163 0 7.398 2.967 7.398 6.931 0 4.136-2.607 7.464-6.227 7.464-1.216 0-2.36-.631-2.75-1.378l-.748 2.853c-.271 1.043-1.002 2.35-1.492 3.146A12.004 12.004 0 0 0 12 24c6.627 0 12-5.373 12-12C24 5.372 18.627 0 12 0z"})});const n=t==="cosmos"?hG:fG;return b.jsx("span",{"aria-hidden":"true",className:Ut("h-6 w-6",t==="cosmos"?"bg-current":"bg-[#b1b1b1]",e),style:{WebkitMaskImage:`url("${n}")`,maskImage:`url("${n}")`,WebkitMaskSize:"contain",maskSize:"contain",WebkitMaskRepeat:"no-repeat",maskRepeat:"no-repeat",WebkitMaskPosition:"center",maskPosition:"center"}})},iK=On({hash:Je().regex(/^[a-f0-9]{64}$/),mimeType:jg(["image/png","image/jpeg","image/webp","image/gif","image/avif"])}),oK=On({id:Je().min(1),title:Je().trim().min(1),url:Je().url().refine(t=>{try{const e=new URL(t);return["http:","https:"].includes(e.protocol)&&!e.username&&!e.password}catch{return!1}}).optional(),reason:Je().optional(),image:iK.optional().catch(void 0)}).refine(t=>!!(t.url||t.image),{message:"A reference requires a public URL or an image"}),aK=(...t)=>{const e=[],n=new Set,r=new Set;for(const s of t.flatMap(i=>i??[])){const i=oK.safeParse(s);if(!i.success)continue;const o=i.data,l=o.url?new URL(o.url).href:void 0;if(n.has(o.id)||l&&r.has(l)){const u=e.find(d=>d.url===l&&(l!==void 0||d.id===o.id));u&&!u.image&&o.image&&(u.id===o.id||!n.has(o.id))&&(u.id=o.id,u.image=o.image,n.add(o.id));continue}e.push({...o,...l?{url:l}:{}}),n.add(o.id),l&&r.add(l)}return e.length?e:void 0},lK=t=>{const e=new URL(t).hostname.replace(/^www\./,"");return e==="are.na"?"arena":e==="pinterest.com"||e==="pin.it"?"pinterest":e==="x.com"?"x":e==="cosmos.so"?"cosmos":null},cK=({reference:t,imageUrl:e,onOpen:n})=>{const[r,s]=m.useState(!1),i=!!e&&!r,o=t.url?lK(t.url):null,l=t.url??(i?e:void 0),u=l?"a":"span",d=i&&t.url?new URL(t.url).hostname:t.title;return b.jsxs(u,{href:l,target:l?"_blank":void 0,rel:l?"noopener noreferrer":void 0,"aria-label":t.title,onPointerDown:f=>f.stopPropagation(),onKeyDown:f=>{(f.key!=="ArrowUp"&&f.key!=="ArrowDown"||f.altKey||f.ctrlKey||f.metaKey||f.shiftKey)&&f.stopPropagation()},onClick:f=>{f.stopPropagation(),l&&n()},className:Ut("border-main-border bg-main-input text-content hover:border-content-muted/50 flex max-w-full min-w-0 shrink-0 items-center gap-1.5 overflow-hidden rounded-md border pr-1.5 text-xs focus-visible:outline-2 focus-visible:-outline-offset-2",!i&&"py-1.5 pl-2"),children:[i?b.jsx("img",{src:e,alt:"",className:"h-8 w-12 shrink-0 object-contain",width:48,height:32,onError:()=>s(!0)}):null,o&&(i||o==="cosmos")?b.jsx(Gf,{provider:o,className:Ut("h-3.5 w-3.5 shrink-0",o==="pinterest"&&"text-[#e60023]")}):null,!i||!o?b.jsx("span",{className:"max-w-40 truncate",children:d}):null]})},uK=({references:t,source:e,sessionId:n,variantId:r,projectPath:s,className:i})=>{const o=xi(),l=aK(t);return l?b.jsx("div",{className:Ut("ph-no-capture flex min-w-0 flex-nowrap gap-1.5 overflow-x-auto pr-3 pb-2",i),"aria-label":"References",children:l.map(u=>{var p;const d=s?`?${new URLSearchParams({projectPath:s})}`:"",f=u.image&&n&&r?`/api/variants/${encodeURIComponent(n)}/${encodeURIComponent(r)}/references/${encodeURIComponent(u.id)}/image${d}`:void 0;return b.jsx(cK,{reference:u,imageUrl:f,onOpen:()=>o==null?void 0:o.capture("preview_reference_opened",{variant_source:e,reference_count:l.length})},`${u.id}:${((p=u.image)==null?void 0:p.hash)??""}:${f??""}`)})}):null},Poe=t=>{const e=t.pathname.split("/").filter(Boolean).map(decodeURIComponent),n=e[3];if(e[2]==="references")return{kind:"references"};if(e[2]!=="projects"||!n)return{kind:"library"};const r=e[4]==="variants"?e[5]:void 0,s=e[4]==="variants"?e[6]:void 0,i=new URLSearchParams(t.search);return r&&s&&i.get("edit")!=="1"?{kind:"preview",projectId:n,sessionId:r,variantId:s}:{kind:"workspace",projectId:n,sessionId:r,variantId:s}},Toe=t=>{if(t.kind==="references")return"/rivet/library/references";if(t.kind==="library"||!t.projectId)return"/rivet/library";const e=`/rivet/library/projects/${encodeURIComponent(t.projectId)}`;return t.sessionId&&t.variantId?`${e}/variants/${encodeURIComponent(t.sessionId)}/${encodeURIComponent(t.variantId)}${t.kind==="workspace"?"?edit=1":""}`:e},dK=t=>{const e=new URLSearchParams(t),n=e.get("historySession"),r=e.get("historyVariant");return n&&r?{sessionId:n,variantId:r}:null},kC=t=>typeof t=="boolean"?`${t}`:t===0?"0":t,EC=MM,fK=(t,e)=>n=>{var r;if((e==null?void 0:e.variants)==null)return EC(t,n==null?void 0:n.class,n==null?void 0:n.className);const{variants:s,defaultVariants:i}=e,o=Object.keys(s).map(d=>{const f=n==null?void 0:n[d],p=i==null?void 0:i[d];if(f===null)return null;const g=kC(f)||kC(p);return s[d][g]}),l=n&&Object.entries(n).reduce((d,f)=>{let[p,g]=f;return g===void 0||(d[p]=g),d},{}),u=e==null||(r=e.compoundVariants)===null||r===void 0?void 0:r.reduce((d,f)=>{let{class:p,className:g,...v}=f;return Object.entries(v).every(w=>{let[_,x]=w;return Array.isArray(x)?x.includes({...i,...l}[_]):{...i,...l}[_]===x})?[...d,p,g]:d},[]);return EC(t,o,u,n==null?void 0:n.class,n==null?void 0:n.className)},WM={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"}},qM=m.createContext(null);function Qh(){const t=m.useContext(qM);return t?t.classes:WM.pill}function hK(t){const e=document.documentElement;e.classList.add("transitioning"),e.offsetHeight,t(),setTimeout(()=>e.classList.remove("transitioning"),200)}function pK({children:t,defaultShape:e="pill"}){const[n,r]=m.useState(e),s=m.useCallback(i=>{hK(()=>r(i))},[]);return b.jsx(qM.Provider,{value:{shape:n,setShape:s,classes:WM[n]},children:t})}const mK=fK(["group/button relative isolate inline-flex cursor-pointer items-center justify-center outline-none","transition-colors duration-80 motion-reduce:transition-none","disabled:pointer-events-none disabled:opacity-50","focus-visible:ring-1 focus-visible:ring-[color:var(--focus-ring,#6B97FF)]"],{variants:{variant:{primary:"text-background",secondary:"text-foreground",tertiary:"text-foreground",ghost:"text-muted-foreground hover:text-foreground aria-expanded:text-foreground aria-pressed:text-foreground"},size:{default:"h-9 gap-1.5 px-4 text-[13px]",compact:"h-7 gap-1 px-3 text-[12px]",icon:"h-9 w-9 p-0 [&_svg]:h-4 [&_svg]:w-4","icon-compact":"h-7 w-7 p-0 [&_svg]:h-3.5 [&_svg]:w-3.5"},iconLeft:{true:""},iconRight:{true:""}},compoundVariants:[{size:"compact",iconLeft:!0,className:"pl-2"},{size:"default",iconLeft:!0,className:"pl-3"},{size:"compact",iconRight:!0,className:"pr-2"},{size:"default",iconRight:!0,className:"pr-3"}],defaultVariants:{variant:"secondary",size:"default"}}),CC={default:16,compact:14},gK={primary:"[--btn-bg:var(--foreground)] group-hover/button:[--btn-bg:color-mix(in_oklab,var(--foreground)_90%,var(--background))] group-active/button:[--btn-bg:color-mix(in_oklab,var(--foreground)_80%,var(--background))] bg-[var(--btn-bg)] shadow-[0_0_0_1px_var(--btn-bg)] group-active/button:shadow-[0_0_0_0px_var(--btn-bg)]",secondary:"[--btn-bg:var(--accent)] group-hover/button:[--btn-bg:color-mix(in_oklab,var(--accent)_80%,var(--background))] group-active/button:[--btn-bg:var(--accent)] bg-[var(--btn-bg)] shadow-[0_0_0_1px_var(--btn-bg)] group-active/button:shadow-[0_0_0_0px_var(--btn-bg)]",tertiary:"bg-transparent shadow-[0_0_0_1px_var(--border),inset_0_0_0_0px_var(--border)] group-hover/button:bg-hover group-active/button:bg-active group-active/button:shadow-[0_0_0_0px_var(--border),inset_0_0_0_1px_var(--border)]",ghost:"bg-transparent shadow-[0_0_0_1px_transparent] group-hover/button:bg-hover group-hover/button:shadow-[0_0_0_1px_var(--hover)] group-active/button:bg-active group-active/button:shadow-[0_0_0_0px_var(--active)] group-aria-expanded/button:bg-active group-aria-expanded/button:shadow-[0_0_0_0px_var(--active)] group-aria-pressed/button:bg-active group-aria-pressed/button:shadow-[0_0_0_0px_var(--active)]"},GM=m.forwardRef(({className:t,variant:e,size:n,isLoading:r=!1,leadingIcon:s,trailingIcon:i,disabled:o,children:l,type:u="button",...d},f)=>{const p=e??"secondary",g=n??"default",v=g==="icon"||g==="icon-compact",w=g==="compact"||g==="icon-compact",_=w?CC.compact:CC.default,x=Qh();return b.jsxs("button",{...d,ref:f,type:u,disabled:o||r,"aria-busy":r||d["aria-busy"],className:Ut(mK({variant:p,size:g,iconLeft:!v&&!!s,iconRight:!v&&!!i}),x.button,t),children:[b.jsx("span",{"aria-hidden":!0,className:Ut("absolute inset-px rounded-[inherit] transition-[box-shadow,background-color] [transition-duration:180ms,80ms] [transition-timing-function:cubic-bezier(0.23,1,0.32,1),ease] group-active/button:[transition-duration:80ms,80ms] motion-reduce:transition-none",gK[p])}),b.jsxs("span",{className:"relative inline-flex items-center justify-center gap-[inherit]",children:[b.jsxs("span",{className:Ut("inline-flex items-center justify-center gap-[inherit]",r&&"opacity-0"),children:[s&&!v?b.jsx(s,{size:_,strokeWidth:1.5,"aria-hidden":!0}):null,b.jsx("span",{className:"[text-box:trim-both_cap_alphabetic]",children:l}),i&&!v?b.jsx(i,{size:_,strokeWidth:1.5,"aria-hidden":!0}):null]}),r?b.jsx("span",{"aria-hidden":!0,className:"absolute inset-0 flex items-center justify-center",children:b.jsx("svg",{className:w?"h-7 w-7":"h-9 w-9",viewBox:"0 0 24 24",fill:"none",children:b.jsx("path",{d:"M 12 12 C 14 8.5 19 8.5 19 12 C 19 15.5 14 15.5 12 12 C 10 8.5 5 8.5 5 12 C 5 15.5 10 15.5 12 12 Z",stroke:"currentColor",strokeWidth:"1.125",strokeLinecap:"round",pathLength:"100",className:"motion-safe:animate-[spinner-move_2s_linear_infinite,spinner-dash_4s_ease-in-out_infinite]",style:{strokeDasharray:"15 85"}})})}):null]})]})});GM.displayName="Button";var vK=Object.defineProperty,_d=(t,e)=>vK(t,"name",{value:e,configurable:!0}),KM=!!(typeof window<"u"&&window.document&&window.document.createElement);function Kt(t,e,{checkForDefaultPrevented:n=!0}={}){return _d(function(s){if(t==null||t(s),n===!1||!s||!s.defaultPrevented)return e==null?void 0:e(s)},"handleEvent")}_d(Kt,"composeEventHandlers");function yK(t){var e;if(!KM)throw new Error("Cannot access window outside of the DOM");return((e=t==null?void 0:t.ownerDocument)==null?void 0:e.defaultView)??window}_d(yK,"getOwnerWindow");function pw(t){if(!KM)throw new Error("Cannot access document outside of the DOM");return(t==null?void 0:t.ownerDocument)??document}_d(pw,"getOwnerDocument");function YM(t,e=!1){const{activeElement:n}=pw(t);if(!(n!=null&&n.nodeName))return null;if(XM(n)&&n.contentDocument)return YM(n.contentDocument.body,e);if(e){const r=n.getAttribute("aria-activedescendant");if(r){const s=pw(n).getElementById(r);if(s)return s}}return n}_d(YM,"getActiveElement");function XM(t){return t.tagName==="IFRAME"}_d(XM,"isFrame");var _K=Object.defineProperty,wb=(t,e)=>_K(t,"name",{value:e,configurable:!0});function mw(t,e){if(typeof t=="function")return t(e);t!=null&&(t.current=e)}wb(mw,"setRef");function QM(...t){return e=>{let n=!1;const r=t.map(s=>{const i=mw(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():mw(t[s],null)}}}}wb(QM,"composeRefs");function tn(...t){return m.useCallback(QM(...t),t)}wb(tn,"useComposedRefs");var wK=Object.defineProperty,Zs=(t,e)=>wK(t,"name",{value:e,configurable:!0});function xK(t,e){const n=m.createContext(e);n.displayName=t+"Context";const r=Zs(i=>{const{children:o,...l}=i,u=m.useMemo(()=>l,Object.values(l));return b.jsx(n.Provider,{value:u,children:o})},"Provider");r.displayName=t+"Provider";function s(i,o={}){const{optional:l=!1}=o,u=m.useContext(n);if(u)return u;if(e!==void 0)return e;if(!l)throw new Error(`\`${i}\` must be used within \`${t}\``)}return Zs(s,"useContext"),[r,s]}Zs(xK,"createContext");function to(t,e=[]){let n=[];function r(i,o){const l=m.createContext(o);l.displayName=i+"Context";const u=n.length;n=[...n,o];const d=Zs(p=>{var S;const{scope:g,children:v,...w}=p,_=((S=g==null?void 0:g[t])==null?void 0:S[u])||l,x=m.useMemo(()=>w,Object.values(w));return b.jsx(_.Provider,{value:x,children:v})},"Provider");d.displayName=i+"Provider";function f(p,g,v={}){var S;const{optional:w=!1}=v,_=((S=g==null?void 0:g[t])==null?void 0:S[u])||l,x=m.useContext(_);if(x)return x;if(o!==void 0)return o;if(!w)throw new Error(`\`${p}\` must be used within \`${i}\``)}return Zs(f,"useContext"),[d,f]}Zs(r,"createContext");const s=Zs(()=>{const i=n.map(o=>m.createContext(o));return Zs(function(l){const u=(l==null?void 0:l[t])||i;return m.useMemo(()=>({[`__scope${t}`]:{...l,[t]:u}}),[l,u])},"useScope")},"createScope");return s.scopeName=t,[r,JM(s,...e)]}Zs(to,"createContextScope");function JM(...t){const e=t[0];if(t.length===1)return e;const n=Zs(()=>{const r=t.map(s=>({useScope:s(),scopeName:s.scopeName}));return Zs(function(i){const o=r.reduce((l,{useScope:u,scopeName:d})=>{const p=u(i)[`__scope${d}`];return{...l,...p}},{});return m.useMemo(()=>({[`__scope${e.scopeName}`]:o}),[o])},"useComposedScopes")},"createScope");return n.scopeName=e.scopeName,n}Zs(JM,"composeContextScopes");var bK=Object.defineProperty,bi=(t,e)=>bK(t,"name",{value:e,configurable:!0});function qa(t){const e=m.forwardRef((n,r)=>{let{children:s,...i}=n,o=null,l=!1;const u=[];gw(s)&&typeof M0=="function"&&(s=M0(s._payload)),m.Children.forEach(s,g=>{var v;if(sI(g)){l=!0;const w=g;let _="child"in w.props?w.props.child:w.props.children;gw(_)&&typeof M0=="function"&&(_=M0(_._payload)),o=SK(w,_),u.push((v=o==null?void 0:o.props)==null?void 0:v.children)}else u.push(g)}),o?o=m.cloneElement(o,void 0,u):!l&&m.Children.count(s)===1&&m.isValidElement(s)&&(o=s);const d=o?rI(o):void 0,f=tn(r,d);if(!o){if(s||s===0)throw new Error(l?CK(t):EK(t));return s}const p=nI(i,o.props??{});return o.type!==m.Fragment&&(p.ref=r?f:d),m.cloneElement(o,p)});return e.displayName=`${t}.Slot`,e}bi(qa,"createSlot");var eI=Symbol.for("radix.slottable");function tI(t){const e=bi(n=>"child"in n?n.children(n.child):n.children,"Slottable");return e.displayName=`${t}.Slottable`,e.__radixId=eI,e}bi(tI,"createSlottable");var SK=bi((t,e)=>{if("child"in t.props){const n=t.props.child;return m.isValidElement(n)?m.cloneElement(n,void 0,t.props.children(n.props.children)):null}return m.isValidElement(e)?e:null},"getSlottableElementFromSlottable");function nI(t,e){const n={...e};for(const r in e){const s=t[r],i=e[r];/^on[A-Z]/.test(r)?s&&i?n[r]=(...l)=>{const u=i(...l);return s(...l),u}:s&&(n[r]=s):r==="style"?n[r]={...s,...i}:r==="className"&&(n[r]=[s,i].filter(Boolean).join(" "))}return{...t,...n}}bi(nI,"mergeProps");function rI(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)}bi(rI,"getElementRef");function sI(t){return m.isValidElement(t)&&typeof t.type=="function"&&"__radixId"in t.type&&t.type.__radixId===eI}bi(sI,"isSlottable");var kK=Symbol.for("react.lazy");function gw(t){return t!=null&&typeof t=="object"&&"$$typeof"in t&&t.$$typeof===kK&&"_payload"in t&&iI(t._payload)}bi(gw,"isLazyComponent");function iI(t){return typeof t=="object"&&t!==null&&"then"in t}bi(iI,"isPromiseLike");var EK=bi(t=>`${t} failed to slot onto its children. Expected a single React element child or \`Slottable\`.`,"createSlotError"),CK=bi(t=>`${t} failed to slot onto its \`Slottable\`. Expected \`Slottable\` to receive a single React element child.`,"createSlottableError"),M0=Uh[" use ".trim().toString()],PK=Object.defineProperty,TK=(t,e)=>PK(t,"name",{value:e,configurable:!0}),AK=["a","button","div","form","h2","h3","img","input","label","li","nav","ol","p","select","span","svg","ul"],En=AK.reduce((t,e)=>{const n=qa(`Primitive.${e}`),r=m.forwardRef((s,i)=>{const{asChild:o,...l}=s,u=o?n:e;return typeof window<"u"&&(window[Symbol.for("radix-ui")]=!0),b.jsx(u,{...l,ref:i})});return r.displayName=`Primitive.${e}`,{...t,[e]:r}},{});function oI(t,e){t&&Xh.flushSync(()=>t.dispatchEvent(e))}TK(oI,"dispatchDiscreteCustomEvent");var RK=Object.defineProperty,MK=(t,e)=>RK(t,"name",{value:e,configurable:!0});function vc(t){const e=m.useRef(t);return m.useEffect(()=>{e.current=t}),m.useMemo(()=>((...n)=>{var r;return(r=e.current)==null?void 0:r.call(e,...n)}),[])}MK(vc,"useCallbackRef");var IK=Object.defineProperty,sr=(t,e)=>IK(t,"name",{value:e,configurable:!0}),vw="dismissableLayer.update",OK="dismissableLayer.pointerDownOutside",LK="dismissableLayer.focusOutside",PC,aI=m.createContext({layers:new Set,layersWithOutsidePointerEventsDisabled:new Set,branches:new Set,dismissableSurfaces:new Set}),xb=m.forwardRef(sr(function(e,n){const{disableOutsidePointerEvents:r=!1,deferPointerDownOutside:s=!1,onEscapeKeyDown:i,onPointerDownOutside:o,onFocusOutside:l,onInteractOutside:u,onDismiss:d,...f}=e,p=m.useContext(aI),[g,v]=m.useState(null),w=(g==null?void 0:g.ownerDocument)??(globalThis==null?void 0:globalThis.document),[,_]=m.useState({}),x=tn(n,v),S=Array.from(p.layers),[k]=[...p.layersWithOutsidePointerEventsDisabled].slice(-1),C=k?S.indexOf(k):-1,T=g?S.indexOf(g):-1,A=p.layersWithOutsidePointerEventsDisabled.size>0,I=T>=C,M=m.useRef(!1),R=cI($=>{o==null||o($),u==null||u($),$.defaultPrevented||d==null||d()},{ownerDocument:w,deferPointerDownOutside:s,isDeferredPointerDownOutsideRef:M,dismissableSurfaces:p.dismissableSurfaces,shouldHandlePointerDownOutside:m.useCallback($=>{if(!($ instanceof Node))return!1;const Y=[...p.branches].some(B=>B.contains($));return I&&!Y},[p.branches,I])}),O=uI($=>{if(s&&M.current)return;const Y=$.target;[...p.branches].some(G=>G.contains(Y))||(l==null||l($),u==null||u($),$.defaultPrevented||d==null||d())},w),N=g?T===S.length-1:!1,D=vc($=>{$.key==="Escape"&&(i==null||i($),!$.defaultPrevented&&d&&($.preventDefault(),d()))});return m.useEffect(()=>{if(N)return w.addEventListener("keydown",D,{capture:!0}),()=>w.removeEventListener("keydown",D,{capture:!0})},[w,N,D]),m.useEffect(()=>{if(g)return r&&(p.layersWithOutsidePointerEventsDisabled.size===0&&(PC=w.body.style.pointerEvents,w.body.style.pointerEvents="none"),p.layersWithOutsidePointerEventsDisabled.add(g)),p.layers.add(g),yw(),()=>{r&&(p.layersWithOutsidePointerEventsDisabled.delete(g),p.layersWithOutsidePointerEventsDisabled.size===0&&(w.body.style.pointerEvents=PC))}},[g,w,r,p]),m.useEffect(()=>()=>{g&&(p.layers.delete(g),p.layersWithOutsidePointerEventsDisabled.delete(g),yw())},[g,p]),m.useEffect(()=>{const $=sr(()=>_({}),"handleUpdate");return document.addEventListener(vw,$),()=>document.removeEventListener(vw,$)},[]),b.jsx(En.div,{...f,ref:x,style:{pointerEvents:A?I?"auto":"none":void 0,...e.style},onFocusCapture:Kt(e.onFocusCapture,O.onFocusCapture),onBlurCapture:Kt(e.onBlurCapture,O.onBlurCapture),onPointerDownCapture:Kt(e.onPointerDownCapture,R.onPointerDownCapture)})},"DismissableLayer"));function lI(){const t=m.useContext(aI),[e,n]=m.useState(null);return m.useEffect(()=>{if(e)return t.dismissableSurfaces.add(e),()=>{t.dismissableSurfaces.delete(e)}},[e,t.dismissableSurfaces]),n}sr(lI,"useDismissableLayerSurface");var NK=sr(()=>!0,"IS_TRUE");function cI(t,e){const{ownerDocument:n=globalThis==null?void 0:globalThis.document,deferPointerDownOutside:r=!1,isDeferredPointerDownOutsideRef:s,dismissableSurfaces:i,shouldHandlePointerDownOutside:o=NK}=e,l=vc(t),u=m.useRef(!1),d=m.useRef(!1),f=m.useRef(new Map),p=m.useRef(()=>{});return m.useEffect(()=>{function g(){d.current=!1,s.current=!1,f.current.clear()}sr(g,"resetOutsideInteraction");function v(){return Array.from(f.current.values()).some(Boolean)}sr(v,"isOutsideInteractionIntercepted");function w(C){if(!d.current)return;const T=C.target;T instanceof Node&&[...i].some(I=>I.contains(T))||f.current.set(C.type,!0),C.type==="click"&&window.setTimeout(()=>{d.current&&p.current()},0)}sr(w,"handleInteractionCapture");function _(C){d.current&&f.current.set(C.type,!1)}sr(_,"handleInteractionBubble");const x=sr(C=>{if(C.target&&!u.current){let T=function(){n.removeEventListener("click",p.current);const I=v();g(),I||bb(OK,l,A,{discrete:!0})};if(sr(T,"handleAndDispatchPointerDownOutsideEvent"),!o(C.target)){n.removeEventListener("click",p.current),g(),u.current=!1;return}const A={originalEvent:C};d.current=!0,s.current=r&&C.button===0,f.current.clear(),!r||C.button!==0?T():(n.removeEventListener("click",p.current),p.current=T,n.addEventListener("click",p.current,{once:!0}))}else n.removeEventListener("click",p.current),g();u.current=!1},"handlePointerDown"),S=["pointerup","mousedown","mouseup","touchstart","touchend","click"];for(const C of S)n.addEventListener(C,w,!0),n.addEventListener(C,_);const k=window.setTimeout(()=>{n.addEventListener("pointerdown",x)},0);return()=>{window.clearTimeout(k),n.removeEventListener("pointerdown",x),n.removeEventListener("click",p.current);for(const C of S)n.removeEventListener(C,w,!0),n.removeEventListener(C,_)}},[n,l,r,s,i,o]),{onPointerDownCapture:sr(()=>u.current=!0,"onPointerDownCapture")}}sr(cI,"usePointerDownOutside");function uI(t,e=globalThis==null?void 0:globalThis.document){const n=vc(t),r=m.useRef(!1);return m.useEffect(()=>{const s=sr(i=>{i.target&&!r.current&&bb(LK,n,{originalEvent:i},{discrete:!1})},"handleFocus");return e.addEventListener("focusin",s),()=>e.removeEventListener("focusin",s)},[e,n]),{onFocusCapture:sr(()=>r.current=!0,"onFocusCapture"),onBlurCapture:sr(()=>r.current=!1,"onBlurCapture")}}sr(uI,"useFocusOutside");function yw(){const t=new CustomEvent(vw);document.dispatchEvent(t)}sr(yw,"dispatchUpdate");function bb(t,e,n,{discrete:r}){const s=n.originalEvent.target,i=new CustomEvent(t,{bubbles:!1,cancelable:!0,detail:n});e&&s.addEventListener(t,e,{once:!0}),r?oI(s,i):s.dispatchEvent(i)}sr(bb,"handleAndDispatchCustomEvent");var Qr=globalThis!=null&&globalThis.document?m.useLayoutEffect:()=>{},DK=Object.defineProperty,jK=(t,e)=>DK(t,"name",{value:e,configurable:!0}),$K=Uh[" useId ".trim().toString()]||(()=>{}),FK=0;function Fa(t){const[e,n]=m.useState($K());return Qr(()=>{t||n(r=>r??String(FK++))},[t]),t||(e?`radix-${e}`:"")}jK(Fa,"useId");const VK=["top","right","bottom","left"],Ga=Math.min,Fo=Math.max,pg=Math.round,I0=Math.floor,Vo=t=>({x:t,y:t}),HK={left:"right",right:"left",bottom:"top",top:"bottom"};function dI(t,e,n){return Fo(t,Ga(e,n))}function Uo(t,e){return typeof t=="function"?t(e):t}function Ka(t){return t.split("-")[0]}function wd(t){return t.split("-")[1]}function Sb(t){return t==="x"?"y":"x"}function kb(t){return t==="y"?"height":"width"}function Bi(t){const e=t[0];return e==="t"||e==="b"?"y":"x"}function Eb(t){return Sb(Bi(t))}function zK(t,e,n){n===void 0&&(n=!1);const r=wd(t),s=Eb(t),i=kb(s);let o=s==="x"?r===(n?"end":"start")?"right":"left":r==="start"?"bottom":"top";return e.reference[i]>e.floating[i]&&(o=mg(o)),[o,mg(o)]}function UK(t){const e=mg(t);return[_w(t),e,_w(e)]}function _w(t){return t.includes("start")?t.replace("start","end"):t.replace("end","start")}const TC=["left","right"],AC=["right","left"],BK=["top","bottom"],ZK=["bottom","top"];function WK(t,e,n){switch(t){case"top":case"bottom":return n?e?AC:TC:e?TC:AC;case"left":case"right":return e?BK:ZK;default:return[]}}function qK(t,e,n,r){const s=wd(t);let i=WK(Ka(t),n==="start",r);return s&&(i=i.map(o=>o+"-"+s),e&&(i=i.concat(i.map(_w)))),i}function mg(t){const e=Ka(t);return HK[e]+t.slice(e.length)}function GK(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 fI(t){return typeof t!="number"?GK(t):{top:t,right:t,bottom:t,left:t}}function gg(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 RC(t,e,n){let{reference:r,floating:s}=t;const i=Bi(e),o=Eb(e),l=kb(o),u=Ka(e),d=i==="y",f=r.x+r.width/2-s.width/2,p=r.y+r.height/2-s.height/2,g=r[l]/2-s[l]/2;let v;switch(u){case"top":v={x:f,y:r.y-s.height};break;case"bottom":v={x:f,y:r.y+r.height};break;case"right":v={x:r.x+r.width,y:p};break;case"left":v={x:r.x-s.width,y:p};break;default:v={x:r.x,y:r.y}}const w=wd(e);return w&&(v[o]+=g*(w==="end"?1:-1)*(n&&d?-1:1)),v}async function KK(t,e){var n;e===void 0&&(e={});const{x:r,y:s,platform:i,rects:o,elements:l,strategy:u}=t,{boundary:d="clippingAncestors",rootBoundary:f="viewport",elementContext:p="floating",altBoundary:g=!1,padding:v=0}=Uo(e,t),w=fI(v),x=l[g?p==="floating"?"reference":"floating":p],S=gg(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(l.floating)),boundary:d,rootBoundary:f,strategy:u})),k=p==="floating"?{x:r,y:s,width:o.floating.width,height:o.floating.height}:o.reference,C=await(i.getOffsetParent==null?void 0:i.getOffsetParent(l.floating)),T=await(i.isElement==null?void 0:i.isElement(C))&&await(i.getScale==null?void 0:i.getScale(C))||{x:1,y:1},A=gg(i.convertOffsetParentRelativeRectToViewportRelativeRect?await i.convertOffsetParentRelativeRectToViewportRelativeRect({elements:l,rect:k,offsetParent:C,strategy:u}):k);return{top:(S.top-A.top+w.top)/T.y,bottom:(A.bottom-S.bottom+w.bottom)/T.y,left:(S.left-A.left+w.left)/T.x,right:(A.right-S.right+w.right)/T.x}}const YK=50,XK=async(t,e,n)=>{const{placement:r="bottom",strategy:s="absolute",middleware:i=[],platform:o}=n,l=o.detectOverflow?o:{...o,detectOverflow:KK},u=await(o.isRTL==null?void 0:o.isRTL(e));let d=await o.getElementRects({reference:t,floating:e,strategy:s}),{x:f,y:p}=RC(d,r,u),g=r,v=0;const w={};for(let _=0;_<i.length;_++){const x=i[_];if(!x)continue;const{name:S,fn:k}=x,{x:C,y:T,data:A,reset:I}=await k({x:f,y:p,initialPlacement:r,placement:g,strategy:s,middlewareData:w,rects:d,platform:l,elements:{reference:t,floating:e}});f=C??f,p=T??p,w[S]={...w[S],...A},I&&v<YK&&(v++,typeof I=="object"&&(I.placement&&(g=I.placement),I.rects&&(d=I.rects===!0?await o.getElementRects({reference:t,floating:e,strategy:s}):I.rects),{x:f,y:p}=RC(d,g,u)),_=-1)}return{x:f,y:p,placement:g,strategy:s,middlewareData:w}},QK=t=>({name:"arrow",options:t,async fn(e){const{x:n,y:r,placement:s,rects:i,platform:o,elements:l,middlewareData:u}=e,{element:d,padding:f=0}=Uo(t,e)||{};if(d==null)return{};const p=fI(f),g={x:n,y:r},v=Eb(s),w=kb(v),_=await o.getDimensions(d),x=v==="y",S=x?"top":"left",k=x?"bottom":"right",C=x?"clientHeight":"clientWidth",T=i.reference[w]+i.reference[v]-g[v]-i.floating[w],A=g[v]-i.reference[v],I=await(o.getOffsetParent==null?void 0:o.getOffsetParent(d));let M=I?I[C]:0;(!M||!await(o.isElement==null?void 0:o.isElement(I)))&&(M=l.floating[C]||i.floating[w]);const R=T/2-A/2,O=M/2-_[w]/2-1,N=Ga(p[S],O),D=Ga(p[k],O),$=M-_[w]-D,Y=M/2-_[w]/2+R,B=dI(N,Y,$),G=!u.arrow&&wd(s)!=null&&Y!==B&&i.reference[w]/2-(Y<N?N:D)-_[w]/2<0,V=G?Y<N?Y-N:Y-$:0;return{[v]:g[v]+V,data:{[v]:B,centerOffset:Y-B-V,...G&&{alignmentOffset:V}},reset:G}}}),JK=function(t){return t===void 0&&(t={}),{name:"flip",options:t,async fn(e){var n,r;const{placement:s,middlewareData:i,rects:o,initialPlacement:l,platform:u,elements:d}=e,{mainAxis:f=!0,crossAxis:p=!0,fallbackPlacements:g,fallbackStrategy:v="bestFit",fallbackAxisSideDirection:w="none",flipAlignment:_=!0,...x}=Uo(t,e);if((n=i.arrow)!=null&&n.alignmentOffset)return{};const S=Ka(s),k=Bi(l),C=Ka(l)===l,T=await(u.isRTL==null?void 0:u.isRTL(d.floating)),A=g||(C||!_?[mg(l)]:UK(l)),I=w!=="none";!g&&I&&A.push(...qK(l,_,w,T));const M=[l,...A],R=await u.detectOverflow(e,x),O=[];let N=((r=i.flip)==null?void 0:r.overflows)||[];if(f&&O.push(R[S]),p){const B=zK(s,o,T);O.push(R[B[0]],R[B[1]])}if(N=[...N,{placement:s,overflows:O}],!O.every(B=>B<=0)){var D,$;const B=(((D=i.flip)==null?void 0:D.index)||0)+1,G=M[B];if(G&&(!(p==="alignment"?k!==Bi(G):!1)||N.every(U=>Bi(U.placement)===k?U.overflows[0]>0:!0)))return{data:{index:B,overflows:N},reset:{placement:G}};let V=($=N.filter(K=>K.overflows[0]<=0).sort((K,U)=>K.overflows[1]-U.overflows[1])[0])==null?void 0:$.placement;if(!V)switch(v){case"bestFit":{var Y;const K=(Y=N.filter(U=>{if(I){const ee=Bi(U.placement);return ee===k||ee==="y"}return!0}).map(U=>[U.placement,U.overflows.filter(ee=>ee>0).reduce((ee,Z)=>ee+Z,0)]).sort((U,ee)=>U[1]-ee[1])[0])==null?void 0:Y[0];K&&(V=K);break}case"initialPlacement":V=l;break}if(s!==V)return{reset:{placement:V}}}return{}}}};function MC(t,e){return{top:t.top-e.height,right:t.right-e.width,bottom:t.bottom-e.height,left:t.left-e.width}}function IC(t){return VK.some(e=>t[e]>=0)}const eY=function(t){return t===void 0&&(t={}),{name:"hide",options:t,async fn(e){const{rects:n,platform:r}=e,{strategy:s="referenceHidden",...i}=Uo(t,e);switch(s){case"referenceHidden":{const o=await r.detectOverflow(e,{...i,elementContext:"reference"}),l=MC(o,n.reference);return{data:{referenceHiddenOffsets:l,referenceHidden:IC(l)}}}case"escaped":{const o=await r.detectOverflow(e,{...i,altBoundary:!0}),l=MC(o,n.floating);return{data:{escapedOffsets:l,escaped:IC(l)}}}default:return{}}}}},hI=new Set(["left","top"]);async function tY(t,e){const{placement:n,platform:r,elements:s}=t,i=await(r.isRTL==null?void 0:r.isRTL(s.floating)),o=Ka(n),l=wd(n),u=Bi(n)==="y",d=hI.has(o)?-1:1,f=i&&u?-1:1,p=Uo(e,t);let{mainAxis:g,crossAxis:v,alignmentAxis:w}=typeof p=="number"?{mainAxis:p,crossAxis:0,alignmentAxis:null}:{mainAxis:p.mainAxis||0,crossAxis:p.crossAxis||0,alignmentAxis:p.alignmentAxis};return l&&typeof w=="number"&&(v=l==="end"?w*-1:w),u?{x:v*f,y:g*d}:{x:g*d,y:v*f}}const nY=function(t){return t===void 0&&(t=0),{name:"offset",options:t,async fn(e){var n,r;const{x:s,y:i,placement:o,middlewareData:l}=e,u=await tY(e,t);return o===((n=l.offset)==null?void 0:n.placement)&&(r=l.arrow)!=null&&r.alignmentOffset?{}:{x:s+u.x,y:i+u.y,data:{...u,placement:o}}}}},rY=function(t){return t===void 0&&(t={}),{name:"shift",options:t,async fn(e){const{x:n,y:r,placement:s,platform:i}=e,{mainAxis:o=!0,crossAxis:l=!1,limiter:u={fn:k=>{let{x:C,y:T}=k;return{x:C,y:T}}},...d}=Uo(t,e),f={x:n,y:r},p=await i.detectOverflow(e,d),g=Bi(s),v=Sb(g);let w=f[v],_=f[g];const x=(k,C)=>dI(C+p[k==="y"?"top":"left"],C,C-p[k==="y"?"bottom":"right"]);o&&(w=x(v,w)),l&&(_=x(g,_));const S=u.fn({...e,[v]:w,[g]:_});return{...S,data:{x:S.x-n,y:S.y-r,enabled:{[v]:o,[g]:l}}}}}},sY=function(t){return t===void 0&&(t={}),{options:t,fn(e){var n,r;const{x:s,y:i,placement:o,rects:l,middlewareData:u}=e,{offset:d=0,mainAxis:f=!0,crossAxis:p=!0}=Uo(t,e),g={x:s,y:i},v=Bi(o),w=Sb(v);let _=g[w],x=g[v];const S=Uo(d,e),k=typeof S=="number"?{mainAxis:S,crossAxis:0}:{mainAxis:(n=S.mainAxis)!=null?n:0,crossAxis:(r=S.crossAxis)!=null?r:0};if(f){const A=w==="y"?"height":"width",I=l.reference[w]-l.floating[A]+k.mainAxis,M=l.reference[w]+l.reference[A]-k.mainAxis;_<I?_=I:_>M&&(_=M)}if(p){var C,T;const A=w==="y"?"width":"height",I=hI.has(Ka(o)),M=l.reference[v]-l.floating[A]+(I&&((C=u.offset)==null?void 0:C[v])||0)+(I?0:k.crossAxis),R=l.reference[v]+l.reference[A]+(I?0:((T=u.offset)==null?void 0:T[v])||0)-(I?k.crossAxis:0);x<M?x=M:x>R&&(x=R)}return{[w]:_,[v]:x}}}},iY=function(t){return t===void 0&&(t={}),{name:"size",options:t,async fn(e){const{placement:n,rects:r,platform:s,elements:i}=e,{apply:o=()=>{},...l}=Uo(t,e),u=await s.detectOverflow(e,l),d=Ka(n),f=wd(n),p=Bi(n)==="y",{width:g,height:v}=r.floating;let w,_;d==="top"||d==="bottom"?(w=d,_=f===(await(s.isRTL==null?void 0:s.isRTL(i.floating))?"start":"end")?"left":"right"):(_=d,w=f==="end"?"top":"bottom");const x=v-u.top-u.bottom,S=g-u.left-u.right,k=Ga(v-u[w],x),C=Ga(g-u[_],S),T=e.middlewareData.shift,A=!T;let I=k,M=C;T!=null&&T.enabled.x&&(M=S),T!=null&&T.enabled.y&&(I=x),A&&!f&&(p?M=g-2*Fo(u.left,u.right):I=v-2*Fo(u.top,u.bottom)),await o({...e,availableWidth:M,availableHeight:I});const R=await s.getDimensions(i.floating);return g!==R.width||v!==R.height?{reset:{rects:!0}}:{}}}};function Wg(){return typeof window<"u"}function xd(t){return pI(t)?(t.nodeName||"").toLowerCase():"#document"}function Jr(t){var e;return(t==null||(e=t.ownerDocument)==null?void 0:e.defaultView)||window}function Go(t){var e;return(e=(pI(t)?t.ownerDocument:t.document)||window.document)==null?void 0:e.documentElement}function pI(t){return Wg()?t instanceof Node||t instanceof Jr(t).Node:!1}function Qi(t){return Wg()?t instanceof Element||t instanceof Jr(t).Element:!1}function nl(t){return Wg()?t instanceof HTMLElement||t instanceof Jr(t).HTMLElement:!1}function OC(t){return!Wg()||typeof ShadowRoot>"u"?!1:t instanceof ShadowRoot||t instanceof Jr(t).ShadowRoot}function qg(t){const{overflow:e,overflowX:n,overflowY:r,display:s}=Ji(t);return/auto|scroll|overlay|hidden|clip/.test(e+r+n)&&s!=="inline"&&s!=="contents"}function oY(t){return/^(table|td|th)$/.test(xd(t))}function Gg(t){try{if(t.matches(":popover-open"))return!0}catch{}try{return t.matches(":modal")}catch{return!1}}const aY=/transform|translate|scale|rotate|perspective|filter/,lY=/paint|layout|strict|content/,Ml=t=>!!t&&t!=="none";let i_;function Cb(t){const e=Qi(t)?Ji(t):t;return Ml(e.transform)||Ml(e.translate)||Ml(e.scale)||Ml(e.rotate)||Ml(e.perspective)||!Pb()&&(Ml(e.backdropFilter)||Ml(e.filter))||aY.test(e.willChange||"")||lY.test(e.contain||"")}function cY(t){let e=yc(t);for(;nl(e)&&!xh(e);){if(Cb(e))return e;if(Gg(e))return null;e=yc(e)}return null}function Pb(){return i_==null&&(i_=typeof CSS<"u"&&CSS.supports&&CSS.supports("-webkit-backdrop-filter","none")),i_}function xh(t){return/^(html|body|#document)$/.test(xd(t))}function Ji(t){return Jr(t).getComputedStyle(t)}function Kg(t){return Qi(t)?{scrollLeft:t.scrollLeft,scrollTop:t.scrollTop}:{scrollLeft:t.scrollX,scrollTop:t.scrollY}}function yc(t){if(xd(t)==="html")return t;const e=t.assignedSlot||t.parentNode||OC(t)&&t.host||Go(t);return OC(e)?e.host:e}function mI(t){const e=yc(t);return xh(e)?(t.ownerDocument||t).body:nl(e)&&qg(e)?e:mI(e)}function bh(t,e,n){var r;e===void 0&&(e=[]),n===void 0&&(n=!0);const s=mI(t),i=s===((r=t.ownerDocument)==null?void 0:r.body),o=Jr(s);if(i){const l=ww(o);return e.concat(o,o.visualViewport||[],qg(s)?s:[],l&&n?bh(l):[])}else return e.concat(s,bh(s,[],n))}function ww(t){return t.parent&&Object.getPrototypeOf(t.parent)?t.frameElement:null}function gI(t){const e=Ji(t);let n=parseFloat(e.width)||0,r=parseFloat(e.height)||0;const s=nl(t),i=s?t.offsetWidth:n,o=s?t.offsetHeight:r,l=pg(n)!==i||pg(r)!==o;return l&&(n=i,r=o),{width:n,height:r,$:l}}function Tb(t){return Qi(t)?t:t.contextElement}function Mu(t){const e=Tb(t);if(!nl(e))return Vo(1);const n=e.getBoundingClientRect(),{width:r,height:s,$:i}=gI(e);let o=(i?pg(n.width):n.width)/r,l=(i?pg(n.height):n.height)/s;return(!o||!Number.isFinite(o))&&(o=1),(!l||!Number.isFinite(l))&&(l=1),{x:o,y:l}}const uY=Vo(0);function vI(t){const e=Jr(t);return!Pb()||!e.visualViewport?uY:{x:e.visualViewport.offsetLeft,y:e.visualViewport.offsetTop}}function dY(t,e,n){return e===void 0&&(e=!1),!!n&&e&&n===Jr(t)}function _c(t,e,n,r){e===void 0&&(e=!1),n===void 0&&(n=!1);const s=t.getBoundingClientRect(),i=Tb(t);let o=Vo(1);e&&(r?Qi(r)&&(o=Mu(r)):o=Mu(t));const l=dY(i,n,r)?vI(i):Vo(0);let u=(s.left+l.x)/o.x,d=(s.top+l.y)/o.y,f=s.width/o.x,p=s.height/o.y;if(i&&r){const g=Jr(i),v=Qi(r)?Jr(r):r;let w=g,_=ww(w);for(;_&&v!==w;){const x=Mu(_),S=_.getBoundingClientRect(),k=Ji(_),C=S.left+(_.clientLeft+parseFloat(k.paddingLeft))*x.x,T=S.top+(_.clientTop+parseFloat(k.paddingTop))*x.y;u*=x.x,d*=x.y,f*=x.x,p*=x.y,u+=C,d+=T,w=Jr(_),_=ww(w)}}return gg({width:f,height:p,x:u,y:d})}function Yg(t,e){const n=Kg(t).scrollLeft;return e?e.left+n:_c(Go(t)).left+n}function yI(t,e){const n=t.getBoundingClientRect(),r=n.left+e.scrollLeft-Yg(t,n),s=n.top+e.scrollTop;return{x:r,y:s}}function fY(t){let{elements:e,rect:n,offsetParent:r,strategy:s}=t;const i=s==="fixed",o=Go(r),l=e?Gg(e.floating):!1;if(r===o||l&&i)return n;let u={scrollLeft:0,scrollTop:0},d=Vo(1);const f=Vo(0),p=nl(r);if((p||!i)&&((xd(r)!=="body"||qg(o))&&(u=Kg(r)),p)){const v=_c(r);d=Mu(r),f.x=v.x+r.clientLeft,f.y=v.y+r.clientTop}const g=o&&!p&&!i?yI(o,u):Vo(0);return{width:n.width*d.x,height:n.height*d.y,x:n.x*d.x-u.scrollLeft*d.x+f.x+g.x,y:n.y*d.y-u.scrollTop*d.y+f.y+g.y}}function hY(t){return t.getClientRects?Array.from(t.getClientRects()):[]}function pY(t){const e=Kg(t),n=t.ownerDocument.body,r=Fo(t.scrollWidth,t.clientWidth,n.scrollWidth,n.clientWidth),s=Fo(t.scrollHeight,t.clientHeight,n.scrollHeight,n.clientHeight);let i=-e.scrollLeft+Yg(t);const o=-e.scrollTop;return Ji(n).direction==="rtl"&&(i+=Fo(t.clientWidth,n.clientWidth)-r),{width:r,height:s,x:i,y:o}}const mY=25;function gY(t,e,n){n===void 0&&(n="viewport");const r=n==="layoutViewport",s=Jr(t),i=Go(t),o=s.visualViewport;let l=i.clientWidth,u=i.clientHeight,d=0,f=0;if(o){const g=!Pb()||e==="fixed";r?g||(d=-o.offsetLeft,f=-o.offsetTop):(l=o.width,u=o.height,g&&(d=o.offsetLeft,f=o.offsetTop))}if(Yg(i)<=0){const g=i.ownerDocument,v=g.body,w=getComputedStyle(v),_=g.compatMode==="CSS1Compat"&&parseFloat(w.marginLeft)+parseFloat(w.marginRight)||0,x=Math.abs(i.clientWidth-v.clientWidth-_),S=getComputedStyle(i).scrollbarGutter==="stable both-edges"?x/2:x;S<=mY&&(l-=S)}return{width:l,height:u,x:d,y:f}}function vY(t,e){const n=_c(t,!0,e==="fixed"),r=n.top+t.clientTop,s=n.left+t.clientLeft,i=Mu(t),o=t.clientWidth*i.x,l=t.clientHeight*i.y,u=s*i.x,d=r*i.y;return{width:o,height:l,x:u,y:d}}function LC(t,e,n){let r;if(e==="viewport"||e==="layoutViewport")r=gY(t,n,e);else if(e==="document")r=pY(Go(t));else if(Qi(e))r=vY(e,n);else{const s=vI(t);r={x:e.x-s.x,y:e.y-s.y,width:e.width,height:e.height}}return gg(r)}function yY(t,e){const n=e.get(t);if(n)return n;let r=bh(t,[],!1).filter(l=>Qi(l)&&xd(l)!=="body"),s=null;const i=Ji(t).position==="fixed";let o=i?yc(t):t;for(;Qi(o)&&!xh(o);){const l=Ji(o),u=Cb(o),d=s?s.position:i?"fixed":"";!u&&(d==="fixed"||d==="absolute"&&l.position==="static")?r=r.filter(p=>p!==o):s=l,o=yc(o)}return e.set(t,r),r}function _Y(t){let{element:e,boundary:n,rootBoundary:r,strategy:s}=t;const o=[...n==="clippingAncestors"?Gg(e)?[]:yY(e,this._c):[].concat(n),r],l=LC(e,o[0],s);let u=l.top,d=l.right,f=l.bottom,p=l.left;for(let g=1;g<o.length;g++){const v=LC(e,o[g],s);u=Fo(v.top,u),d=Ga(v.right,d),f=Ga(v.bottom,f),p=Fo(v.left,p)}return{width:d-p,height:f-u,x:p,y:u}}function wY(t){const{width:e,height:n}=gI(t);return{width:e,height:n}}function xY(t,e,n){const r=nl(e),s=Go(e),i=n==="fixed",o=_c(t,!0,i,e);let l={scrollLeft:0,scrollTop:0};const u=Vo(0);if((r||!i)&&((xd(e)!=="body"||qg(s))&&(l=Kg(e)),r)){const g=_c(e,!0,i,e);u.x=g.x+e.clientLeft,u.y=g.y+e.clientTop}!r&&s&&(u.x=Yg(s));const d=s&&!r&&!i?yI(s,l):Vo(0),f=o.left+l.scrollLeft-u.x-d.x,p=o.top+l.scrollTop-u.y-d.y;return{x:f,y:p,width:o.width,height:o.height}}function o_(t){return Ji(t).position==="static"}function NC(t,e){if(!nl(t)||Ji(t).position==="fixed")return null;if(e)return e(t);let n=t.offsetParent;return Go(t)===n&&(n=n.ownerDocument.body),n}function _I(t,e){const n=Jr(t);if(Gg(t))return n;if(!nl(t)){let s=yc(t);for(;s&&!xh(s);){if(Qi(s)&&!o_(s))return s;s=yc(s)}return n}let r=NC(t,e);for(;r&&oY(r)&&o_(r);)r=NC(r,e);return r&&xh(r)&&o_(r)&&!Cb(r)?n:r||cY(t)||n}const bY=async function(t){const e=this.getOffsetParent||_I,n=this.getDimensions,r=await n(t.floating);return{reference:xY(t.reference,await e(t.floating),t.strategy),floating:{x:0,y:0,width:r.width,height:r.height}}};function SY(t){return Ji(t).direction==="rtl"}const kY={convertOffsetParentRelativeRectToViewportRelativeRect:fY,getDocumentElement:Go,getClippingRect:_Y,getOffsetParent:_I,getElementRects:bY,getClientRects:hY,getDimensions:wY,getScale:Mu,isElement:Qi,isRTL:SY};function wI(t,e){return t.x===e.x&&t.y===e.y&&t.width===e.width&&t.height===e.height}function EY(t,e,n){let r=null,s;const i=Go(t);function o(){var f;clearTimeout(s),(f=r)==null||f.disconnect(),r=null}function l(f,p){f===void 0&&(f=!1),p===void 0&&(p=1),o();const g=t.getBoundingClientRect(),{left:v,top:w,width:_,height:x}=g;if(f||e(),!_||!x)return;const S=I0(w),k=I0(i.clientWidth-(v+_)),C=I0(i.clientHeight-(w+x)),T=I0(v),I={rootMargin:-S+"px "+-k+"px "+-C+"px "+-T+"px",threshold:Fo(0,Ga(1,p))||1};let M=!0;function R(O){const N=O[0].intersectionRatio;if(!wI(g,t.getBoundingClientRect()))return l();if(N!==p){if(!M)return l();N?l(!1,N):s=setTimeout(()=>{l(!1,1e-7)},1e3)}M=!1}try{r=new IntersectionObserver(R,{...I,root:i.ownerDocument})}catch{r=new IntersectionObserver(R,I)}r.observe(t)}const u=Jr(t),d=()=>l(n);return u.addEventListener("resize",d),l(!0),()=>{u.removeEventListener("resize",d),o()}}function CY(t,e,n,r){r===void 0&&(r={});const{ancestorScroll:s=!0,ancestorResize:i=!0,elementResize:o=typeof ResizeObserver=="function",layoutShift:l=typeof IntersectionObserver=="function",animationFrame:u=!1}=r,d=Tb(t),f=s||i?[...d?bh(d):[],...e?bh(e):[]]:[];f.forEach(S=>{s&&S.addEventListener("scroll",n),i&&S.addEventListener("resize",n)});const p=d&&l?EY(d,n,i):null;let g=-1,v=null;o&&(v=new ResizeObserver(S=>{let[k]=S;k&&k.target===d&&v&&e&&(v.unobserve(e),cancelAnimationFrame(g),g=requestAnimationFrame(()=>{var C;(C=v)==null||C.observe(e)})),n()}),d&&!u&&v.observe(d),e&&v.observe(e));let w,_=u?_c(t):null;u&&x();function x(){const S=_c(t);_&&!wI(_,S)&&n(),_=S,w=requestAnimationFrame(x)}return n(),()=>{var S;f.forEach(k=>{s&&k.removeEventListener("scroll",n),i&&k.removeEventListener("resize",n)}),p==null||p(),(S=v)==null||S.disconnect(),v=null,u&&cancelAnimationFrame(w)}}const PY=nY,TY=rY,AY=JK,RY=iY,MY=eY,DC=QK,IY=sY,OY=(t,e,n)=>{const r=new Map,s=n??{},i={...kY,...s.platform,_c:r};return XK(t,e,{...s,platform:i})};var LY=typeof document<"u",NY=function(){},cm=LY?m.useLayoutEffect:NY;function vg(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(!vg(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)&&!vg(t[i],e[i]))return!1}return!0}return t!==t&&e!==e}function xI(t){return typeof window>"u"?1:(t.ownerDocument.defaultView||window).devicePixelRatio||1}function jC(t,e){const n=xI(t);return Math.round(e*n)/n}function a_(t){const e=m.useRef(t);return cm(()=>{e.current=t}),e}function DY(t){t===void 0&&(t={});const{placement:e="bottom",strategy:n="absolute",middleware:r=[],platform:s,elements:{reference:i,floating:o}={},transform:l=!0,whileElementsMounted:u,open:d}=t,[f,p]=m.useState({x:0,y:0,strategy:n,placement:e,middlewareData:{},isPositioned:!1}),[g,v]=m.useState(r);vg(g,r)||v(r);const[w,_]=m.useState(null),[x,S]=m.useState(null),k=m.useCallback(U=>{U!==I.current&&(I.current=U,_(U))},[]),C=m.useCallback(U=>{U!==M.current&&(M.current=U,S(U))},[]),T=i||w,A=o||x,I=m.useRef(null),M=m.useRef(null),R=m.useRef(f),O=u!=null,N=a_(u),D=a_(s),$=a_(d),Y=m.useCallback(()=>{if(!I.current||!M.current)return;const U={placement:e,strategy:n,middleware:g};D.current&&(U.platform=D.current),OY(I.current,M.current,U).then(ee=>{const Z={...ee,isPositioned:$.current!==!1};B.current&&!vg(R.current,Z)&&(R.current=Z,Xh.flushSync(()=>{p(Z)}))})},[g,e,n,D,$]);cm(()=>{d===!1&&R.current.isPositioned&&(R.current.isPositioned=!1,p(U=>({...U,isPositioned:!1})))},[d]);const B=m.useRef(!1);cm(()=>(B.current=!0,()=>{B.current=!1}),[]),cm(()=>{if(T&&(I.current=T),A&&(M.current=A),T&&A){if(N.current)return N.current(T,A,Y);Y()}},[T,A,Y,N,O]);const G=m.useMemo(()=>({reference:I,floating:M,setReference:k,setFloating:C}),[k,C]),V=m.useMemo(()=>({reference:T,floating:A}),[T,A]),K=m.useMemo(()=>{const U={position:n,left:0,top:0};if(!V.floating)return U;const ee=jC(V.floating,f.x),Z=jC(V.floating,f.y);return l?{...U,transform:"translate("+ee+"px, "+Z+"px)",...xI(V.floating)>=1.5&&{willChange:"transform"}}:{position:n,left:ee,top:Z}},[n,l,V.floating,f.x,f.y]);return m.useMemo(()=>({...f,update:Y,refs:G,elements:V,floatingStyles:K}),[f,Y,G,V,K])}const jY=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?DC({element:r.current,padding:s}).fn(n):{}:r?DC({element:r,padding:s}).fn(n):{}}}},$Y=(t,e)=>{const n=PY(t);return{name:n.name,fn:n.fn,options:[t,e]}},FY=(t,e)=>{const n=TY(t);return{name:n.name,fn:n.fn,options:[t,e]}},VY=(t,e)=>({fn:IY(t).fn,options:[t,e]}),HY=(t,e)=>{const n=AY(t);return{name:n.name,fn:n.fn,options:[t,e]}},zY=(t,e)=>{const n=RY(t);return{name:n.name,fn:n.fn,options:[t,e]}},UY=(t,e)=>{const n=MY(t);return{name:n.name,fn:n.fn,options:[t,e]}},BY=(t,e)=>{const n=jY(t);return{name:n.name,fn:n.fn,options:[t,e]}};var ZY=Object.defineProperty,WY=(t,e)=>ZY(t,"name",{value:e,configurable:!0});function Ab(t){const[e,n]=m.useState(void 0);return Qr(()=>{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 o,l;if("borderBoxSize"in i){const u=i.borderBoxSize,d=Array.isArray(u)?u[0]:u;o=d.inlineSize,l=d.blockSize}else o=t.offsetWidth,l=t.offsetHeight;n({width:o,height:l})});return r.observe(t,{box:"border-box"}),()=>r.unobserve(t)}else n(void 0)},[t]),e}WY(Ab,"useSize");var qY=Object.defineProperty,Va=(t,e)=>qY(t,"name",{value:e,configurable:!0}),bI="Popper",[SI,Xg]=to(bI),[GY,kI]=SI(bI),KY=Va(t=>{const{__scopePopper:e,children:n}=t,[r,s]=m.useState(null),[i,o]=m.useState(void 0);return b.jsx(GY,{scope:e,anchor:r,onAnchorChange:s,placementState:i,setPlacementState:o,children:n})},"Popper"),YY="PopperAnchor",XY=m.forwardRef(Va(function(e,n){const{__scopePopper:r,virtualRef:s,...i}=e,o=kI(YY,r),l=m.useRef(null),u=o.onAnchorChange,d=m.useCallback(_=>{l.current=_,_&&u(_)},[u]),f=tn(n,d),p=m.useRef(null);m.useEffect(()=>{if(!s)return;const _=p.current;p.current=s.current,_!==p.current&&u(p.current)});const g=o.placementState&&Qg(o.placementState),v=g==null?void 0:g[0],w=g==null?void 0:g[1];return s?null:b.jsx(En.div,{"data-radix-popper-side":v,"data-radix-popper-align":w,...i,ref:f})},"PopperAnchor")),EI="PopperContent",[QY,Aoe]=SI(EI),JY=m.forwardRef(Va(function(e,n){var ae,Oe,Be,Ee,pt,Ot,Qt;const{__scopePopper:r,side:s="bottom",sideOffset:i=0,align:o="center",alignOffset:l=0,arrowPadding:u=0,avoidCollisions:d=!0,collisionBoundary:f=[],collisionPadding:p=0,sticky:g="partial",hideWhenDetached:v=!1,updatePositionStrategy:w="optimized",onPlaced:_,...x}=e,S=kI(EI,r),[k,C]=m.useState(null),T=tn(n,C),[A,I]=m.useState(null),M=Ab(A),R=(M==null?void 0:M.width)??0,O=(M==null?void 0:M.height)??0,N=s+(o!=="center"?"-"+o:""),D=typeof p=="number"?p:{top:0,right:0,bottom:0,left:0,...p},$=Array.isArray(f)?f:[f],Y=$.length>0,B={padding:D,boundary:$.filter(CI),altBoundary:Y},{refs:G,floatingStyles:V,placement:K,isPositioned:U,middlewareData:ee}=DY({strategy:"fixed",placement:N,whileElementsMounted:Va((...bt)=>CY(...bt,{animationFrame:w==="always"}),"whileElementsMounted"),elements:{reference:S.anchor},middleware:[$Y({mainAxis:i+O,alignmentAxis:l}),d&&FY({mainAxis:!0,crossAxis:!1,limiter:g==="partial"?VY():void 0,...B}),d&&HY({...B}),zY({...B,apply:Va(({elements:bt,rects:_t,availableWidth:qe,availableHeight:Ke})=>{const{width:Ct,height:Ae}=_t.reference,Ye=bt.floating.style;Ye.setProperty("--radix-popper-available-width",`${qe}px`),Ye.setProperty("--radix-popper-available-height",`${Ke}px`),Ye.setProperty("--radix-popper-anchor-width",`${Ct}px`),Ye.setProperty("--radix-popper-anchor-height",`${Ae}px`)},"apply")}),A&&BY({element:A,padding:u}),eX({arrowWidth:R,arrowHeight:O}),v&&UY({strategy:"referenceHidden",...B,boundary:Y?B.boundary:void 0})]}),Z=S.setPlacementState;Qr(()=>(Z(K),()=>{Z(void 0)}),[K,Z]);const[j,Q]=Qg(K),oe=vc(_);Qr(()=>{U&&(oe==null||oe())},[U,oe]);const re=(ae=ee.arrow)==null?void 0:ae.x,ie=(Oe=ee.arrow)==null?void 0:Oe.y,fe=((Be=ee.arrow)==null?void 0:Be.centerOffset)!==0,[_e,ue]=m.useState();return Qr(()=>{k&&ue(window.getComputedStyle(k).zIndex)},[k]),b.jsx("div",{ref:G.setFloating,"data-radix-popper-content-wrapper":"",style:{...V,transform:U?V.transform:"translate(0, -200%)",minWidth:"max-content",zIndex:_e,"--radix-popper-transform-origin":[(Ee=ee.transformOrigin)==null?void 0:Ee.x,(pt=ee.transformOrigin)==null?void 0:pt.y].join(" "),...((Ot=ee.hide)==null?void 0:Ot.referenceHidden)&&{visibility:"hidden",pointerEvents:"none"}},dir:e.dir,children:b.jsx(QY,{scope:r,placedSide:j,placedAlign:Q,onArrowChange:I,arrowX:re,arrowY:ie,shouldHideArrow:fe,children:b.jsx(En.div,{"data-side":j,"data-align":Q,...x,ref:T,style:{...x.style,animation:U?(Qt=x.style)==null?void 0:Qt.animation:"none"}})})})},"PopperContent"));function CI(t){return t!==null}Va(CI,"isNotNull");var eX=Va(t=>({name:"transformOrigin",options:t,fn(e){var x,S,k;const{placement:n,rects:r,middlewareData:s}=e,o=((x=s.arrow)==null?void 0:x.centerOffset)!==0,l=o?0:t.arrowWidth,u=o?0:t.arrowHeight,[d,f]=Qg(n),p={start:"0%",center:"50%",end:"100%"}[f],g=(((S=s.arrow)==null?void 0:S.x)??0)+l/2,v=(((k=s.arrow)==null?void 0:k.y)??0)+u/2;let w="",_="";return d==="bottom"?(w=o?p:`${g}px`,_=`${-u}px`):d==="top"?(w=o?p:`${g}px`,_=`${r.floating.height+u}px`):d==="right"?(w=`${-u}px`,_=o?p:`${v}px`):d==="left"&&(w=`${r.floating.width+u}px`,_=o?p:`${v}px`),{data:{x:w,y:_}}}}),"transformOrigin");function Qg(t){const[e,n="center"]=t.split("-");return[e,n]}Va(Qg,"getSideAndAlignFromPlacement");var PI=KY,TI=XY,AI=JY,tX=Object.defineProperty,nX=(t,e)=>tX(t,"name",{value:e,configurable:!0}),Rb=m.forwardRef(nX(function(e,n){var u;const{container:r,...s}=e,[i,o]=m.useState(!1);Qr(()=>o(!0),[]);const l=r||i&&((u=globalThis==null?void 0:globalThis.document)==null?void 0:u.body);return l?Xh.createPortal(b.jsx(En.div,{...s,ref:n}),l):null},"Portal")),rX=Object.defineProperty,Bo=(t,e)=>rX(t,"name",{value:e,configurable:!0});function RI(t,e){return m.useReducer((n,r)=>e[n][r]??n,t)}Bo(RI,"useStateMachine");var rl=Bo(t=>{const{present:e,children:n}=t,r=MI(e),s=typeof n=="function"?n({present:r.isPresent}):m.Children.only(n),i=II(r.ref,OI(s));return typeof n=="function"||r.isPresent?m.cloneElement(s,{ref:i}):null},"Presence");function MI(t){const[e,n]=m.useState(),r=m.useRef(null),s=m.useRef(t),i=m.useRef("none"),o=m.useRef(void 0),l=t?"mounted":"unmounted",[u,d]=RI(l,{mounted:{UNMOUNT:"unmounted",ANIMATION_OUT:"unmountSuspended"},unmountSuspended:{MOUNT:"mounted",ANIMATION_END:"unmounted"},unmounted:{MOUNT:"mounted"}});return m.useEffect(()=>{u==="mounted"?(i.current=o.current??yu(r.current),o.current=void 0):i.current="none"},[u]),Qr(()=>{const f=r.current,p=s.current;if(p!==t){const v=i.current,w=yu(f);t?(o.current=w,d("MOUNT")):w==="none"||(f==null?void 0:f.display)==="none"?d("UNMOUNT"):d(p&&v!==w?"ANIMATION_OUT":"UNMOUNT"),s.current=t}},[t,d]),Qr(()=>{if(e){let f;const p=e.ownerDocument.defaultView??window,g=Bo(w=>{const x=yu(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",f=p.setTimeout(()=>{e.style.animationFillMode==="forwards"&&(e.style.animationFillMode=S)})}},"handleAnimationEnd"),v=Bo(w=>{w.target===e&&(i.current=yu(r.current))},"handleAnimationStart");return e.addEventListener("animationstart",v),e.addEventListener("animationcancel",g),e.addEventListener("animationend",g),()=>{p.clearTimeout(f),e.removeEventListener("animationstart",v),e.removeEventListener("animationcancel",g),e.removeEventListener("animationend",g)}}else d("ANIMATION_END")},[e,d]),{isPresent:["mounted","unmountSuspended"].includes(u),ref:m.useCallback(f=>{if(f){const p=getComputedStyle(f);r.current=p,o.current=yu(p)}else r.current=null;n(f)},[])}}Bo(MI,"usePresence");function xw(t,e){if(typeof t=="function")return t(e);t!=null&&(t.current=e)}Bo(xw,"setRef");function II(...t){const e=m.useRef(t);return e.current=t,m.useCallback(n=>{const r=e.current;let s=!1;const i=r.map(o=>{const l=xw(o,n);return!s&&typeof l=="function"&&(s=!0),l});if(s)return()=>{for(let o=0;o<i.length;o++){const l=i[o];typeof l=="function"?l():xw(r[o],null)}}},[])}Bo(II,"useStableComposedRefs");function yu(t){return(t==null?void 0:t.animationName)||"none"}Bo(yu,"getAnimationName");function OI(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)}Bo(OI,"getElementRef");var sX=Object.defineProperty,iX=(t,e)=>sX(t,"name",{value:e,configurable:!0}),$C=Uh[" useEffectEvent ".trim().toString()],FC=Uh[" useInsertionEffect ".trim().toString()];function LI(t){if(typeof $C=="function")return $C(t);const e=m.useRef(()=>{throw new Error("Cannot call an event handler while rendering.")});return typeof FC=="function"?FC(()=>{e.current=t}):Qr(()=>{e.current=t}),m.useMemo(()=>((...n)=>{var r;return(r=e.current)==null?void 0:r.call(e,...n)}),[])}iX(LI,"useEffectEvent");var oX=Object.defineProperty,Jh=(t,e)=>oX(t,"name",{value:e,configurable:!0}),aX=Uh[" useInsertionEffect ".trim().toString()]||Qr;function sl({prop:t,defaultProp:e,onChange:n=Jh(()=>{},"onChange"),caller:r}){const[s,i,o]=NI({defaultProp:e,onChange:n}),l=t!==void 0,u=l?t:s,d=m.useCallback(f=>{var p;if(l){const g=DI(f)?f(t):f;g!==t&&((p=o.current)==null||p.call(o,g))}else i(f)},[l,t,i,o]);return[u,d]}Jh(sl,"useControllableState");function NI({defaultProp:t,onChange:e}){const[n,r]=m.useState(t),s=m.useRef(n),i=m.useRef(e);return aX(()=>{i.current=e},[e]),m.useEffect(()=>{var o;s.current!==n&&((o=i.current)==null||o.call(i,n),s.current=n)},[n,s]),[n,r,i]}Jh(NI,"useUncontrolledState");function DI(t){return typeof t=="function"}Jh(DI,"isFunction");var VC=Symbol("RADIX:SYNC_STATE");function lX(t,e,n,r){const{prop:s,defaultProp:i,onChange:o,caller:l}=e,u=s!==void 0,d=LI(o),f=[{...n,state:i}];r&&f.push(r);const[p,g]=m.useReducer((x,S)=>{if(S.type===VC)return{...x,state:S.state};const k=t(x,S);return u&&!Object.is(k.state,x.state)&&d(k.state),k},...f),v=p.state,w=m.useRef(v);m.useEffect(()=>{w.current!==v&&(w.current=v,u||d(v))},[v,w,u]);const _=m.useMemo(()=>s!==void 0?{...p,state:s}:p,[p,s]);return m.useEffect(()=>{u&&!Object.is(s,p.state)&&g({type:VC,state:s})},[s,p.state,u]),[_,g]}Jh(lX,"useControllableStateReducer");var cX=Object.defineProperty,uX=(t,e)=>cX(t,"name",{value:e,configurable:!0}),dX=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"}),fX=m.forwardRef(uX(function(e,n){return b.jsx(En.span,{...e,ref:n,style:{...dX,...e.style}})},"VisuallyHidden")),hX=fX,pX=Object.defineProperty,or=(t,e)=>pX(t,"name",{value:e,configurable:!0}),[Mb,Roe]=to("Tooltip",[Xg]),Ib=Xg(),mX="TooltipProvider",gX=700,bw="tooltip.open",[vX,Ob]=Mb(mX),yX=or(t=>{const{__scopeTooltip:e,delayDuration:n=gX,skipDelayDuration:r=300,disableHoverableContent:s=!1,children:i}=t,o=m.useRef(!0),l=m.useRef(!1),u=m.useRef(0);return m.useEffect(()=>{const d=u.current;return()=>window.clearTimeout(d)},[]),b.jsx(vX,{scope:e,isOpenDelayedRef:o,delayDuration:n,onOpen:m.useCallback(()=>{r<=0||(window.clearTimeout(u.current),o.current=!1)},[r]),onClose:m.useCallback(()=>{r<=0||(window.clearTimeout(u.current),u.current=window.setTimeout(()=>o.current=!0,r))},[r]),isPointerInTransitRef:l,onPointerInTransitChange:m.useCallback(d=>{l.current=d},[]),disableHoverableContent:s,children:i})},"TooltipProvider"),Sw="Tooltip",[_X,ep]=Mb(Sw),wX=or(t=>{const{__scopeTooltip:e,children:n,open:r,defaultOpen:s,onOpenChange:i,disableHoverableContent:o,delayDuration:l}=t,u=Ob(Sw,t.__scopeTooltip),d=Ib(e),[f,p]=m.useState(null),[g,v]=m.useState(void 0),w=Fa(),_=m.useRef(0),x=o??u.disableHoverableContent,S=l??u.delayDuration,k=m.useRef(!1),[C,T]=sl({prop:r,defaultProp:s??!1,onChange:or(N=>{N?(u.onOpen(),document.dispatchEvent(new CustomEvent(bw))):u.onClose(),i==null||i(N)},"onChange"),caller:Sw}),A=m.useMemo(()=>C?k.current?"delayed-open":"instant-open":"closed",[C]),I=m.useCallback(()=>{window.clearTimeout(_.current),_.current=0,k.current=!1,T(!0)},[T]),M=m.useCallback(()=>{window.clearTimeout(_.current),_.current=0,T(!1)},[T]),R=m.useCallback(()=>{window.clearTimeout(_.current),_.current=window.setTimeout(()=>{k.current=!0,T(!0),_.current=0},S)},[S,T]);m.useEffect(()=>()=>{_.current&&(window.clearTimeout(_.current),_.current=0)},[]);const O=g??w;return b.jsx(PI,{...d,children:b.jsx(_X,{scope:e,contentId:O,setContentId:v,open:C,stateAttribute:A,trigger:f,onTriggerChange:p,onTriggerEnter:m.useCallback(()=>{u.isOpenDelayedRef.current?R():I()},[u.isOpenDelayedRef,R,I]),onTriggerLeave:m.useCallback(()=>{x?M():(window.clearTimeout(_.current),_.current=0)},[M,x]),onOpen:I,onClose:M,disableHoverableContent:x,children:n})})},"Tooltip"),HC="TooltipTrigger",xX=m.forwardRef(or(function(e,n){const{__scopeTooltip:r,...s}=e,i=ep(HC,r),o=Ob(HC,r),l=Ib(r),u=m.useRef(null),d=tn(n,u,i.onTriggerChange),f=m.useRef(!1),p=m.useRef(!1),g=m.useCallback(()=>f.current=!1,[]);return m.useEffect(()=>()=>document.removeEventListener("pointerup",g),[g]),b.jsx(TI,{asChild:!0,...l,children:b.jsx(En.button,{"aria-describedby":i.open?i.contentId:void 0,"data-state":i.stateAttribute,...s,ref:d,onPointerMove:Kt(e.onPointerMove,v=>{v.pointerType!=="touch"&&!p.current&&!o.isPointerInTransitRef.current&&(i.onTriggerEnter(),p.current=!0)}),onPointerLeave:Kt(e.onPointerLeave,()=>{i.onTriggerLeave(),p.current=!1}),onPointerDown:Kt(e.onPointerDown,()=>{i.open&&i.onClose(),f.current=!0,document.addEventListener("pointerup",g,{once:!0})}),onFocus:Kt(e.onFocus,()=>{f.current||i.onOpen()}),onBlur:Kt(e.onBlur,i.onClose),onClick:Kt(e.onClick,i.onClose)})})},"TooltipTrigger")),jI="TooltipPortal",[bX,SX]=Mb(jI,{forceMount:void 0}),kX=or(t=>{const{__scopeTooltip:e,forceMount:n,children:r,container:s}=t,i=ep(jI,e);return b.jsx(bX,{scope:e,forceMount:n,children:b.jsx(rl,{present:n||i.open,children:b.jsx(Rb,{asChild:!0,container:s,children:r})})})},"TooltipPortal"),Sh="TooltipContent",EX=m.forwardRef(or(function(e,n){const r=SX(Sh,e.__scopeTooltip),{forceMount:s=r.forceMount,side:i="top",...o}=e,l=ep(Sh,e.__scopeTooltip);return b.jsx(rl,{present:s||l.open,children:l.disableHoverableContent?b.jsx($I,{side:i,...o,ref:n}):b.jsx(CX,{side:i,...o,ref:n})})},"TooltipContent")),CX=m.forwardRef(or(function(e,n){const r=ep(Sh,e.__scopeTooltip),s=Ob(Sh,e.__scopeTooltip),i=m.useRef(null),o=tn(n,i),[l,u]=m.useState(null),{trigger:d,onClose:f}=r,p=i.current,{onPointerInTransitChange:g}=s,v=m.useCallback(()=>{u(null),g(!1)},[g]),w=m.useCallback((_,x)=>{const S=_.currentTarget,k={x:_.clientX,y:_.clientY},C=FI(k,S.getBoundingClientRect()),T=VI(k,C),A=HI(x.getBoundingClientRect()),I=UI([...T,...A]);u(I),g(!0)},[g]);return m.useEffect(()=>()=>v(),[v]),m.useEffect(()=>{if(d&&p){const _=or(S=>w(S,p),"handleTriggerLeave"),x=or(S=>w(S,d),"handleContentLeave");return d.addEventListener("pointerleave",_),p.addEventListener("pointerleave",x),()=>{d.removeEventListener("pointerleave",_),p.removeEventListener("pointerleave",x)}}},[d,p,w,v]),m.useEffect(()=>{if(l){const _=or(x=>{const S=x.target,k={x:x.clientX,y:x.clientY},C=(d==null?void 0:d.contains(S))||(p==null?void 0:p.contains(S)),T=!zI(k,l);C?v():T&&(v(),f())},"handleTrackPointerGrace");return document.addEventListener("pointermove",_),()=>document.removeEventListener("pointermove",_)}},[d,p,l,f,v]),b.jsx($I,{...e,ref:o})},"TooltipContentHoverable")),PX=tI("TooltipContent"),$I=m.forwardRef(or(function(e,n){const{__scopeTooltip:r,children:s,"aria-label":i,id:o,onEscapeKeyDown:l,onPointerDownOutside:u,...d}=e,f=ep(Sh,r),p=Ib(r),{onClose:g}=f;m.useEffect(()=>(document.addEventListener(bw,g),()=>document.removeEventListener(bw,g)),[g]),m.useEffect(()=>{if(f.trigger){const w=or(_=>{_.target instanceof Node&&_.target.contains(f.trigger)&&g()},"handleScroll");return window.addEventListener("scroll",w,{capture:!0}),()=>window.removeEventListener("scroll",w,{capture:!0})}},[f.trigger,g]);const{setContentId:v}=f;return Qr(()=>(v(o),()=>{v(void 0)}),[o,v]),b.jsx(xb,{asChild:!0,disableOutsidePointerEvents:!1,onEscapeKeyDown:l,onPointerDownOutside:u,onFocusOutside:w=>w.preventDefault(),onDismiss:g,children:b.jsxs(AI,{"data-state":f.stateAttribute,role:i?void 0:"tooltip",id:i?void 0:f.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:[b.jsx(PX,{children:s}),i?b.jsx(hX,{id:f.contentId,role:"tooltip",children:i}):null]})})},"TooltipContentImpl"));function FI(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")}}or(FI,"getExitSideFromRect");function VI(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}or(VI,"getPaddedExitPoints");function HI(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}]}or(HI,"getPointsFromRect");function zI(t,e){const{x:n,y:r}=t;let s=!1;for(let i=0,o=e.length-1;i<e.length;o=i++){const l=e[i],u=e[o],d=l.x,f=l.y,p=u.x,g=u.y;f>r!=g>r&&n<(p-d)*(r-f)/(g-f)+d&&(s=!s)}return s}or(zI,"isPointInPolygon");function UI(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),BI(e)}or(UI,"getHull");function BI(t){if(t.length<=1)return t.slice();const e=[];for(let r=0;r<t.length;r++){const s=t[r];for(;e.length>=2;){const i=e[e.length-1],o=e[e.length-2];if((i.x-o.x)*(s.y-o.y)>=(i.y-o.y)*(s.x-o.x))e.pop();else break}e.push(s)}e.pop();const n=[];for(let r=t.length-1;r>=0;r--){const s=t[r];for(;n.length>=2;){const i=n[n.length-1],o=n[n.length-2];if((i.x-o.x)*(s.y-o.y)>=(i.y-o.y)*(s.x-o.x))n.pop();else break}n.push(s)}return n.pop(),e.length===1&&n.length===1&&e[0].x===n[0].x&&e[0].y===n[0].y?e:e.concat(n)}or(BI,"getHullPresorted");var TX=yX,AX=wX,RX=xX,MX=kX,IX=EX;const Kf={normal:"'wght' 400",medium:"'wght' 450",semibold:"'wght' 550"},ZI=m.createContext(null);function WI({value:t,children:e}){return b.jsx(ZI.Provider,{value:t,children:e})}function OX(t){switch(t){case"top":return{y:4};case"bottom":return{y:-4};case"left":return{x:4};case"right":return{x:-4}}}function Lb({content:t,children:e,side:n="top",sideOffset:r=8,delayDuration:s=200,className:i,forceOpen:o,onOpenChange:l}){const[u,d]=m.useState(!1),f=o!==void 0?o:u,[p,g]=m.useState(!1),v=Qh(),w=m.useContext(ZI);m.useEffect(()=>{f&&g(!0)},[f]);const _=()=>{f||g(!1)},x=OX(n);return b.jsx(TX,{delayDuration:s,children:b.jsxs(AX,{open:f,onOpenChange:S=>{d(S),l==null||l(S)},children:[b.jsx(RX,{asChild:!0,children:e}),p&&b.jsx(MX,{forceMount:!0,container:w??void 0,children:b.jsx(IX,{side:n,sideOffset:r,forceMount:!0,className:"z-tooltip",children:b.jsx($o.div,{className:Ut("bg-neutral-900 text-white text-[12px] px-2 py-1 border border-white/10 shadow-lg",v.bg,i),style:{fontVariationSettings:Kf.medium},initial:{opacity:0,scale:.8,...x},animate:{opacity:f?1:0,scale:f?1:.9,x:0,y:0},transition:f?{type:"spring",duration:.34,bounce:.55}:{duration:.1},onAnimationComplete:_,children:t})})})]})})}const Gi=m.forwardRef(({title:t,shortcut:e,...n},r)=>{const s=b.jsx(GM,{ref:r,...n});return t?b.jsx(Lb,{content:b.jsxs("div",{className:"flex flex-row items-center gap-2",children:[b.jsx("span",{children:t}),e?b.jsx("span",{className:"rounded bg-white/15 px-1.5 py-0.5 text-[11px]",children:e}):null]}),children:s}):s});Gi.displayName="Button";var LX=Object.defineProperty,$r=(t,e)=>LX(t,"name",{value:e,configurable:!0}),l_="focusScope.autoFocusOnMount",c_="focusScope.autoFocusOnUnmount",zC={bubbles:!1,cancelable:!0},qI=m.forwardRef($r(function(e,n){const{loop:r=!1,trapped:s=!1,onMountAutoFocus:i,onUnmountAutoFocus:o,...l}=e,[u,d]=m.useState(null),f=vc(i),p=vc(o),g=m.useRef(null),v=tn(n,d),w=m.useRef({paused:!1,pause(){this.paused=!0},resume(){this.paused=!1}}).current;m.useEffect(()=>{if(s){let x=function(T){if(w.paused||!u)return;const A=T.target;u.contains(A)?g.current=A:Po(g.current,{select:!0})},S=function(T){if(w.paused||!u)return;const A=T.relatedTarget;A!==null&&(u.contains(A)||Po(g.current,{select:!0}))},k=function(T){if(document.activeElement===document.body)for(const I of T)I.removedNodes.length>0&&Po(u)};$r(x,"handleFocusIn"),$r(S,"handleFocusOut"),$r(k,"handleMutations"),document.addEventListener("focusin",x),document.addEventListener("focusout",S);const C=new MutationObserver(k);return u&&C.observe(u,{childList:!0,subtree:!0}),()=>{document.removeEventListener("focusin",x),document.removeEventListener("focusout",S),C.disconnect()}}},[s,u,w.paused]),m.useEffect(()=>{if(u){UC.add(w);const x=document.activeElement;if(!u.contains(x)){const k=new CustomEvent(l_,zC);u.addEventListener(l_,f),u.dispatchEvent(k),k.defaultPrevented||(GI(JI(Nb(u)),{select:!0}),document.activeElement===x&&Po(u))}return()=>{u.removeEventListener(l_,f),setTimeout(()=>{const k=new CustomEvent(c_,zC);u.addEventListener(c_,p),u.dispatchEvent(k),k.defaultPrevented||Po(x??document.body,{select:!0}),u.removeEventListener(c_,p),UC.remove(w)},0)}}},[u,f,p,w]);const _=m.useCallback(x=>{if(!r&&!s||w.paused)return;const S=x.key==="Tab"&&!x.altKey&&!x.ctrlKey&&!x.metaKey,k=document.activeElement;if(S&&k){const C=x.currentTarget,[T,A]=KI(C);T&&A?!x.shiftKey&&k===A?(x.preventDefault(),r&&Po(T,{select:!0})):x.shiftKey&&k===T&&(x.preventDefault(),r&&Po(A,{select:!0})):k===C&&x.preventDefault()}},[r,s,w.paused]);return b.jsx(En.div,{tabIndex:-1,...l,ref:v,onKeyDown:_})},"FocusScope"));function GI(t,{select:e=!1}={}){const n=document.activeElement;for(const r of t)if(Po(r,{select:e}),document.activeElement!==n)return}$r(GI,"focusFirst");function KI(t){const e=Nb(t),n=kw(e,t),r=kw(e.reverse(),t);return[n,r]}$r(KI,"getTabbableEdges");function Nb(t){const e=[],n=document.createTreeWalker(t,NodeFilter.SHOW_ELEMENT,{acceptNode:$r(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}$r(Nb,"getTabbableCandidates");function kw(t,e){const n=typeof e.checkVisibility=="function"&&e.checkVisibility({checkVisibilityCSS:!0});for(const r of t)if(!(n?!r.checkVisibility({checkVisibilityCSS:!0}):YI(r,{upTo:e})))return r}$r(kw,"findVisible");function YI(t,{upTo:e}){if(getComputedStyle(t).visibility==="hidden")return!0;for(;t;){if(e!==void 0&&t===e)return!1;if(getComputedStyle(t).display==="none")return!0;t=t.parentElement}return!1}$r(YI,"isHidden");function XI(t){return t instanceof HTMLInputElement&&"select"in t}$r(XI,"isSelectableInput");function Po(t,{select:e=!1}={}){if(t&&t.focus){const n=document.activeElement;t.focus({preventScroll:!0}),t!==n&&XI(t)&&e&&t.select()}}$r(Po,"focus");var UC=QI();function QI(){let t=[];return{add(e){const n=t[0];e!==n&&(n==null||n.pause()),t=Ew(t,e),t.unshift(e)},remove(e){var n;t=Ew(t,e),(n=t[0])==null||n.resume()}}}$r(QI,"createFocusScopesStack");function Ew(t,e){const n=[...t],r=n.indexOf(e);return r!==-1&&n.splice(r,1),n}$r(Ew,"arrayRemove");function JI(t){return t.filter(e=>e.tagName!=="A")}$r(JI,"removeLinks");var NX=Object.defineProperty,Db=(t,e)=>NX(t,"name",{value:e,configurable:!0}),O0=0,Mi=null;function DX(t){return Jg(),t.children}Db(DX,"FocusGuards");function Jg(){m.useEffect(()=>{Mi||(Mi={start:Cw(),end:Cw()});const{start:t,end:e}=Mi;return document.body.firstElementChild!==t&&document.body.insertAdjacentElement("afterbegin",t),document.body.lastElementChild!==e&&document.body.insertAdjacentElement("beforeend",e),O0++,()=>{O0===1&&(Mi==null||Mi.start.remove(),Mi==null||Mi.end.remove(),Mi=null),O0=Math.max(0,O0-1)}},[])}Db(Jg,"useFocusGuards");function Cw(){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}Db(Cw,"createFocusGuard");var Hi=function(){return Hi=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},Hi.apply(this,arguments)};function eO(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 jX(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 um="right-scroll-bar-position",dm="width-before-scroll-bar",$X="with-scroll-bars-hidden",FX="--removed-body-scroll-bar-size";function u_(t,e){return typeof t=="function"?t(e):t&&(t.current=e),t}function VX(t,e){var n=m.useState(function(){return{value:t,callback:e,facade:{get current(){return n.value},set current(r){var s=n.value;s!==r&&(n.value=r,n.callback(r,s))}}}})[0];return n.callback=e,n.facade}var HX=typeof window<"u"?m.useLayoutEffect:m.useEffect,BC=new WeakMap;function zX(t,e){var n=VX(null,function(r){return t.forEach(function(s){return u_(s,r)})});return HX(function(){var r=BC.get(n);if(r){var s=new Set(r),i=new Set(t),o=n.current;s.forEach(function(l){i.has(l)||u_(l,null)}),i.forEach(function(l){s.has(l)||u_(l,o)})}BC.set(n,t)},[t]),n}function UX(t){return t}function BX(t,e){e===void 0&&(e=UX);var n=[],r=!1,s={read:function(){if(r)throw new Error("Sidecar: could not `read` from an `assigned` medium. `read` could be used only with `useMedium`.");return n.length?n[n.length-1]:t},useMedium:function(i){var o=e(i,r);return n.push(o),function(){n=n.filter(function(l){return l!==o})}},assignSyncMedium:function(i){for(r=!0;n.length;){var o=n;n=[],o.forEach(i)}n={push:function(l){return i(l)},filter:function(){return n}}},assignMedium:function(i){r=!0;var o=[];if(n.length){var l=n;n=[],l.forEach(i),o=n}var u=function(){var f=o;o=[],f.forEach(i)},d=function(){return Promise.resolve().then(u)};d(),n={push:function(f){o.push(f),d()},filter:function(f){return o=o.filter(f),n}}}};return s}function ZX(t){t===void 0&&(t={});var e=BX(null);return e.options=Hi({async:!0,ssr:!1},t),e}var tO=function(t){var e=t.sideCar,n=eO(t,["sideCar"]);if(!e)throw new Error("Sidecar: please provide `sideCar` property to import the right car");var r=e.read();if(!r)throw new Error("Sidecar medium not found");return m.createElement(r,Hi({},n))};tO.isSideCarExport=!0;function WX(t,e){return t.useMedium(e),tO}var nO=ZX(),d_=function(){},ev=m.forwardRef(function(t,e){var n=m.useRef(null),r=m.useState({onScrollCapture:d_,onWheelCapture:d_,onTouchMoveCapture:d_}),s=r[0],i=r[1],o=t.forwardProps,l=t.children,u=t.className,d=t.removeScrollBar,f=t.enabled,p=t.shards,g=t.sideCar,v=t.noRelative,w=t.noIsolation,_=t.inert,x=t.allowPinchZoom,S=t.as,k=S===void 0?"div":S,C=t.gapMode,T=eO(t,["forwardProps","children","className","removeScrollBar","enabled","shards","sideCar","noRelative","noIsolation","inert","allowPinchZoom","as","gapMode"]),A=g,I=zX([n,e]),M=Hi(Hi({},T),s);return m.createElement(m.Fragment,null,f&&m.createElement(A,{sideCar:nO,removeScrollBar:d,shards:p,noRelative:v,noIsolation:w,inert:_,setCallbacks:i,allowPinchZoom:!!x,lockRef:n,gapMode:C}),o?m.cloneElement(m.Children.only(l),Hi(Hi({},M),{ref:I})):m.createElement(k,Hi({},M,{className:u,ref:I}),l))});ev.defaultProps={enabled:!0,removeScrollBar:!0,inert:!1};ev.classNames={fullWidth:dm,zeroRight:um};var qX=function(){if(typeof __webpack_nonce__<"u")return __webpack_nonce__};function GX(){if(!document)return null;var t=document.createElement("style");t.type="text/css";var e=qX();return e&&t.setAttribute("nonce",e),t}function KX(t,e){t.styleSheet?t.styleSheet.cssText=e:t.appendChild(document.createTextNode(e))}function YX(t){var e=document.head||document.getElementsByTagName("head")[0];e.appendChild(t)}var XX=function(){var t=0,e=null;return{add:function(n){t==0&&(e=GX())&&(KX(e,n),YX(e)),t++},remove:function(){t--,!t&&e&&(e.parentNode&&e.parentNode.removeChild(e),e=null)}}},QX=function(){var t=XX();return function(e,n){m.useEffect(function(){return t.add(e),function(){t.remove()}},[e&&n])}},rO=function(){var t=QX(),e=function(n){var r=n.styles,s=n.dynamic;return t(r,s),null};return e},JX={left:0,top:0,right:0,gap:0},f_=function(t){return parseInt(t||"",10)||0},eQ=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[f_(n),f_(r),f_(s)]},tQ=function(t){if(t===void 0&&(t="margin"),typeof window>"u")return JX;var e=eQ(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])}},nQ=rO(),Iu="data-scroll-locked",rQ=function(t,e,n,r){var s=t.left,i=t.top,o=t.right,l=t.gap;return n===void 0&&(n="margin"),`
72
+ .`.concat($X,` {
73
+ overflow: hidden `).concat(r,`;
74
+ padding-right: `).concat(l,"px ").concat(r,`;
75
+ }
76
+ body[`).concat(Iu,`] {
77
+ overflow: hidden `).concat(r,`;
78
+ overscroll-behavior: contain;
79
+ `).concat([e&&"position: relative ".concat(r,";"),n==="margin"&&`
80
+ padding-left: `.concat(s,`px;
81
+ padding-top: `).concat(i,`px;
82
+ padding-right: `).concat(o,`px;
83
+ margin-left:0;
84
+ margin-top:0;
85
+ margin-right: `).concat(l,"px ").concat(r,`;
86
+ `),n==="padding"&&"padding-right: ".concat(l,"px ").concat(r,";")].filter(Boolean).join(""),`
87
+ }
88
+
89
+ .`).concat(um,` {
90
+ right: `).concat(l,"px ").concat(r,`;
91
+ }
92
+
93
+ .`).concat(dm,` {
94
+ margin-right: `).concat(l,"px ").concat(r,`;
95
+ }
96
+
97
+ .`).concat(um," .").concat(um,` {
98
+ right: 0 `).concat(r,`;
99
+ }
100
+
101
+ .`).concat(dm," .").concat(dm,` {
102
+ margin-right: 0 `).concat(r,`;
103
+ }
104
+
105
+ body[`).concat(Iu,`] {
106
+ `).concat(FX,": ").concat(l,`px;
107
+ }
108
+ `)},ZC=function(){var t=parseInt(document.body.getAttribute(Iu)||"0",10);return isFinite(t)?t:0},sQ=function(){m.useEffect(function(){return document.body.setAttribute(Iu,(ZC()+1).toString()),function(){var t=ZC()-1;t<=0?document.body.removeAttribute(Iu):document.body.setAttribute(Iu,t.toString())}},[])},iQ=function(t){var e=t.noRelative,n=t.noImportant,r=t.gapMode,s=r===void 0?"margin":r;sQ();var i=m.useMemo(function(){return tQ(s)},[s]);return m.createElement(nQ,{styles:rQ(i,!e,s,n?"":"!important")})},Pw=!1;if(typeof window<"u")try{var L0=Object.defineProperty({},"passive",{get:function(){return Pw=!0,!0}});window.addEventListener("test",L0,L0),window.removeEventListener("test",L0,L0)}catch{Pw=!1}var uu=Pw?{passive:!1}:!1,oQ=function(t){return t.tagName==="TEXTAREA"},sO=function(t,e){if(!(t instanceof Element))return!1;var n=window.getComputedStyle(t);return n[e]!=="hidden"&&!(n.overflowY===n.overflowX&&!oQ(t)&&n[e]==="visible")},aQ=function(t){return sO(t,"overflowY")},lQ=function(t){return sO(t,"overflowX")},WC=function(t,e){var n=e.ownerDocument,r=e;do{typeof ShadowRoot<"u"&&r instanceof ShadowRoot&&(r=r.host);var s=iO(t,r);if(s){var i=oO(t,r),o=i[1],l=i[2];if(o>l)return!0}r=r.parentNode}while(r&&r!==n.body);return!1},cQ=function(t){var e=t.scrollTop,n=t.scrollHeight,r=t.clientHeight;return[e,n,r]},uQ=function(t){var e=t.scrollLeft,n=t.scrollWidth,r=t.clientWidth;return[e,n,r]},iO=function(t,e){return t==="v"?aQ(e):lQ(e)},oO=function(t,e){return t==="v"?cQ(e):uQ(e)},dQ=function(t,e){return t==="h"&&e==="rtl"?-1:1},fQ=function(t,e,n,r,s){var i=dQ(t,window.getComputedStyle(e).direction),o=i*r,l=n.target,u=e.contains(l),d=!1,f=o>0,p=0,g=0;do{if(!l)break;var v=oO(t,l),w=v[0],_=v[1],x=v[2],S=_-x-i*w;(w||S)&&iO(t,l)&&(p+=S,g+=w);var k=l.parentNode;l=k&&k.nodeType===Node.DOCUMENT_FRAGMENT_NODE?k.host:k}while(!u&&l!==document.body||u&&(e.contains(l)||e===l));return(f&&Math.abs(p)<1||!f&&Math.abs(g)<1)&&(d=!0),d},N0=function(t){return"changedTouches"in t?[t.changedTouches[0].clientX,t.changedTouches[0].clientY]:[0,0]},qC=function(t){return[t.deltaX,t.deltaY]},GC=function(t){return t&&"current"in t?t.current:t},hQ=function(t,e){return t[0]===e[0]&&t[1]===e[1]},pQ=function(t){return`
109
+ .block-interactivity-`.concat(t,` {pointer-events: none;}
110
+ .allow-interactivity-`).concat(t,` {pointer-events: all;}
111
+ `)},mQ=0,du=[];function gQ(t){var e=m.useRef([]),n=m.useRef([0,0]),r=m.useRef(),s=m.useState(mQ++)[0],i=m.useState(rO)[0],o=m.useRef(t);m.useEffect(function(){o.current=t},[t]),m.useEffect(function(){if(t.inert){document.body.classList.add("block-interactivity-".concat(s));var _=jX([t.lockRef.current],(t.shards||[]).map(GC),!0).filter(Boolean);return _.forEach(function(x){return x.classList.add("allow-interactivity-".concat(s))}),function(){document.body.classList.remove("block-interactivity-".concat(s)),_.forEach(function(x){return x.classList.remove("allow-interactivity-".concat(s))})}}},[t.inert,t.lockRef.current,t.shards]);var l=m.useCallback(function(_,x){if("touches"in _&&_.touches.length===2||_.type==="wheel"&&_.ctrlKey)return!o.current.allowPinchZoom;var S=N0(_),k=n.current,C="deltaX"in _?_.deltaX:k[0]-S[0],T="deltaY"in _?_.deltaY:k[1]-S[1],A,I=_.target,M=Math.abs(C)>Math.abs(T)?"h":"v";if("touches"in _&&M==="h"&&I.type==="range")return!1;var R=window.getSelection(),O=R&&R.anchorNode,N=O?O===I||O.contains(I):!1;if(N)return!1;var D=WC(M,I);if(!D)return!0;if(D?A=M:(A=M==="v"?"h":"v",D=WC(M,I)),!D)return!1;if(!r.current&&"changedTouches"in _&&(C||T)&&(r.current=A),!A)return!0;var $=r.current||A;return fQ($,x,_,$==="h"?C:T)},[]),u=m.useCallback(function(_){var x=_;if(!(!du.length||du[du.length-1]!==i)){var S="deltaY"in x?qC(x):N0(x),k=e.current.filter(function(A){return A.name===x.type&&(A.target===x.target||x.target===A.shadowParent)&&hQ(A.delta,S)})[0];if(k&&k.should){x.cancelable&&x.preventDefault();return}if(!k){var C=(o.current.shards||[]).map(GC).filter(Boolean).filter(function(A){return A.contains(x.target)}),T=C.length>0?l(x,C[0]):!o.current.noIsolation;T&&x.cancelable&&x.preventDefault()}}},[]),d=m.useCallback(function(_,x,S,k){var C={name:_,delta:x,target:S,should:k,shadowParent:vQ(S)};e.current.push(C),setTimeout(function(){e.current=e.current.filter(function(T){return T!==C})},1)},[]),f=m.useCallback(function(_){n.current=N0(_),r.current=void 0},[]),p=m.useCallback(function(_){d(_.type,qC(_),_.target,l(_,t.lockRef.current))},[]),g=m.useCallback(function(_){d(_.type,N0(_),_.target,l(_,t.lockRef.current))},[]);m.useEffect(function(){return du.push(i),t.setCallbacks({onScrollCapture:p,onWheelCapture:p,onTouchMoveCapture:g}),document.addEventListener("wheel",u,uu),document.addEventListener("touchmove",u,uu),document.addEventListener("touchstart",f,uu),function(){du=du.filter(function(_){return _!==i}),document.removeEventListener("wheel",u,uu),document.removeEventListener("touchmove",u,uu),document.removeEventListener("touchstart",f,uu)}},[]);var v=t.removeScrollBar,w=t.inert;return m.createElement(m.Fragment,null,w?m.createElement(i,{styles:pQ(s)}):null,v?m.createElement(iQ,{noRelative:t.noRelative,gapMode:t.gapMode}):null)}function vQ(t){for(var e=null;t!==null;)t instanceof ShadowRoot&&(e=t.host,t=t.host),t=t.parentNode;return e}const yQ=WX(nO,gQ);var jb=m.forwardRef(function(t,e){return m.createElement(ev,Hi({},t,{ref:e,sideCar:yQ}))});jb.classNames=ev.classNames;var _Q=function(t){if(typeof document>"u")return null;var e=Array.isArray(t)?t[0]:t;return e.ownerDocument.body},fu=new WeakMap,D0=new WeakMap,j0={},h_=0,aO=function(t){return t&&(t.host||aO(t.parentNode))},wQ=function(t,e){return e.map(function(n){if(t.contains(n))return n;var r=aO(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})},xQ=function(t,e,n,r){var s=wQ(e,Array.isArray(t)?t:[t]);j0[n]||(j0[n]=new WeakMap);var i=j0[n],o=[],l=new Set,u=new Set(s),d=function(p){!p||l.has(p)||(l.add(p),d(p.parentNode))};s.forEach(d);var f=function(p){!p||u.has(p)||Array.prototype.forEach.call(p.children,function(g){if(l.has(g))f(g);else try{var v=g.getAttribute(r),w=v!==null&&v!=="false",_=(fu.get(g)||0)+1,x=(i.get(g)||0)+1;fu.set(g,_),i.set(g,x),o.push(g),_===1&&w&&D0.set(g,!0),x===1&&g.setAttribute(n,"true"),w||g.setAttribute(r,"true")}catch(S){console.error("aria-hidden: cannot operate on ",g,S)}})};return f(e),l.clear(),h_++,function(){o.forEach(function(p){var g=fu.get(p)-1,v=i.get(p)-1;fu.set(p,g),i.set(p,v),g||(D0.has(p)||p.removeAttribute(r),D0.delete(p)),v||p.removeAttribute(n)}),h_--,h_||(fu=new WeakMap,fu=new WeakMap,D0=new WeakMap,j0={})}},lO=function(t,e,n){n===void 0&&(n="data-aria-hidden");var r=Array.from(Array.isArray(t)?t:[t]),s=_Q(t);return s?(r.push.apply(r,Array.from(s.querySelectorAll("[aria-live], script"))),xQ(r,s,n,"aria-hidden")):function(){return null}},bQ=Object.defineProperty,As=(t,e)=>bQ(t,"name",{value:e,configurable:!0}),$b="Dialog",[cO,Moe]=to($b),[SQ,Si]=cO($b),tv=As(t=>{const{__scopeDialog:e,children:n,open:r,defaultOpen:s,onOpenChange:i,modal:o=!0}=t,l=m.useRef(null),u=m.useRef(null),[d,f]=sl({prop:r,defaultProp:s??!1,onChange:i,caller:$b}),[p,g]=m.useState(0),[v,w]=m.useState(0);return b.jsx(SQ,{scope:e,triggerRef:l,contentRef:u,contentId:Fa(),titleId:Fa(),descriptionId:Fa(),titlePresent:p>0,descriptionPresent:v>0,setTitleCount:g,setDescriptionCount:w,open:d,onOpenChange:f,onOpenToggle:m.useCallback(()=>f(_=>!_),[f]),modal:o,children:n})},"Dialog"),kQ="DialogTrigger",Ioe=m.forwardRef(As(function(e,n){const{__scopeDialog:r,...s}=e,i=Si(kQ,r),o=tn(n,i.triggerRef);return b.jsx(En.button,{type:"button","aria-haspopup":"dialog","aria-expanded":i.open,"aria-controls":i.open?i.contentId:void 0,"data-state":av(i.open),...s,ref:o,onClick:Kt(e.onClick,i.onOpenToggle)})},"DialogTrigger")),uO="DialogPortal",[EQ,dO]=cO(uO,{forceMount:void 0}),nv=As(t=>{const{__scopeDialog:e,forceMount:n,children:r,container:s}=t,i=Si(uO,e);return b.jsx(EQ,{scope:e,forceMount:n,children:m.Children.map(r,o=>b.jsx(rl,{present:n||i.open,children:b.jsx(Rb,{asChild:!0,container:s,children:o})}))})},"DialogPortal"),Tw="DialogOverlay",rv=m.forwardRef(As(function(e,n){const r=dO(Tw,e.__scopeDialog),{forceMount:s=r.forceMount,...i}=e,o=Si(Tw,e.__scopeDialog);return o.modal?b.jsx(rl,{present:s||o.open,children:b.jsx(PQ,{...i,ref:n})}):null},"DialogOverlay")),CQ=qa("DialogOverlay.RemoveScroll"),PQ=m.forwardRef(As(function(e,n){const{__scopeDialog:r,...s}=e,i=Si(Tw,r),o=lI(),l=tn(n,o);return b.jsx(jb,{as:CQ,allowPinchZoom:!0,shards:[i.contentRef],children:b.jsx(En.div,{"data-state":av(i.open),...s,ref:l,style:{pointerEvents:"auto",...s.style}})})},"DialogOverlayImpl")),kh="DialogContent",sv=m.forwardRef(As(function(e,n){const r=dO(kh,e.__scopeDialog),{forceMount:s=r.forceMount,...i}=e,o=Si(kh,e.__scopeDialog);return b.jsx(rl,{present:s||o.open,children:o.modal?b.jsx(TQ,{...i,ref:n}):b.jsx(AQ,{...i,ref:n})})},"DialogContent")),TQ=m.forwardRef(As(function(e,n){const r=Si(kh,e.__scopeDialog),s=m.useRef(null),i=tn(n,r.contentRef,s);return m.useEffect(()=>{const o=s.current;if(o)return lO(o)},[]),b.jsx(fO,{...e,ref:i,trapFocus:r.open,disableOutsidePointerEvents:r.open,onCloseAutoFocus:Kt(e.onCloseAutoFocus,o=>{var l;o.preventDefault(),(l=r.triggerRef.current)==null||l.focus()}),onPointerDownOutside:Kt(e.onPointerDownOutside,o=>{const l=o.detail.originalEvent,u=l.button===0&&l.ctrlKey===!0;(l.button===2||u)&&o.preventDefault()}),onFocusOutside:Kt(e.onFocusOutside,o=>o.preventDefault())})},"DialogContentModal")),AQ=m.forwardRef(As(function(e,n){const r=Si(kh,e.__scopeDialog),s=m.useRef(!1),i=m.useRef(!1);return b.jsx(fO,{...e,ref:n,trapFocus:!1,disableOutsidePointerEvents:!1,onCloseAutoFocus:o=>{var l,u;(l=e.onCloseAutoFocus)==null||l.call(e,o),o.defaultPrevented||(s.current||(u=r.triggerRef.current)==null||u.focus(),o.preventDefault()),s.current=!1,i.current=!1},onInteractOutside:o=>{var d,f;(d=e.onInteractOutside)==null||d.call(e,o),o.defaultPrevented||(s.current=!0,o.detail.originalEvent.type==="pointerdown"&&(i.current=!0));const l=o.target;((f=r.triggerRef.current)==null?void 0:f.contains(l))&&o.preventDefault(),o.detail.originalEvent.type==="focusin"&&i.current&&o.preventDefault()}})},"DialogContentNonModal")),fO=m.forwardRef(As(function(e,n){const{__scopeDialog:r,trapFocus:s,onOpenAutoFocus:i,onCloseAutoFocus:o,...l}=e,u=Si(kh,r);return Jg(),b.jsx(b.Fragment,{children:b.jsx(qI,{asChild:!0,loop:!0,trapped:s,onMountAutoFocus:i,onUnmountAutoFocus:o,children:b.jsx(xb,{role:"dialog",id:u.contentId,"aria-describedby":u.descriptionPresent?u.descriptionId:void 0,"aria-labelledby":u.titlePresent?u.titleId:void 0,"data-state":av(u.open),...l,ref:n,deferPointerDownOutside:!0,onDismiss:()=>u.onOpenChange(!1)})})})},"DialogContentImpl")),RQ="DialogTitle",iv=m.forwardRef(As(function(e,n){const{__scopeDialog:r,...s}=e,i=Si(RQ,r),{setTitleCount:o}=i;return Qr(()=>(o(l=>l+1),()=>o(l=>l-1)),[o]),b.jsx(En.h2,{id:i.titleId,...s,ref:n})},"DialogTitle")),MQ="DialogDescription",ov=m.forwardRef(As(function(e,n){const{__scopeDialog:r,...s}=e,i=Si(MQ,r),{setDescriptionCount:o}=i;return Qr(()=>(o(l=>l+1),()=>o(l=>l-1)),[o]),b.jsx(En.p,{id:i.descriptionId,...s,ref:n})},"DialogDescription")),IQ="DialogClose",Ooe=m.forwardRef(As(function(e,n){const{__scopeDialog:r,...s}=e,i=Si(IQ,r);return b.jsx(En.button,{type:"button",...s,ref:n,onClick:Kt(e.onClick,()=>i.onOpenChange(!1))})},"DialogClose"));function av(t){return t?"open":"closed"}As(av,"getState");var OQ=Object.defineProperty,il=(t,e)=>OQ(t,"name",{value:e,configurable:!0}),Fb="Popover",[hO,Loe]=to(Fb,[Xg]),Vb=Xg(),[LQ,bd]=hO(Fb),NQ=il(t=>{const{__scopePopover:e,children:n,open:r,defaultOpen:s,onOpenChange:i,modal:o=!1}=t,l=Vb(e),u=m.useRef(null),[d,f]=m.useState(!1),[p,g]=sl({prop:r,defaultProp:s??!1,onChange:i,caller:Fb});return b.jsx(PI,{...l,children:b.jsx(LQ,{scope:e,contentId:Fa(),triggerRef:u,open:p,onOpenChange:g,onOpenToggle:m.useCallback(()=>g(v=>!v),[g]),hasCustomAnchor:d,onCustomAnchorAdd:m.useCallback(()=>f(!0),[]),onCustomAnchorRemove:m.useCallback(()=>f(!1),[]),modal:o,children:n})})},"Popover"),DQ="PopoverTrigger",jQ=m.forwardRef(il(function(e,n){const{__scopePopover:r,...s}=e,i=bd(DQ,r),o=Vb(r),l=tn(n,i.triggerRef),u=b.jsx(En.button,{type:"button","aria-haspopup":"dialog","aria-expanded":i.open,"aria-controls":i.open?i.contentId:void 0,"data-state":Hb(i.open),...s,ref:l,onClick:Kt(e.onClick,i.onOpenToggle)});return i.hasCustomAnchor?u:b.jsx(TI,{asChild:!0,...o,children:u})},"PopoverTrigger")),pO="PopoverPortal",[$Q,FQ]=hO(pO,{forceMount:void 0}),VQ=il(t=>{const{__scopePopover:e,forceMount:n,children:r,container:s}=t,i=bd(pO,e);return b.jsx($Q,{scope:e,forceMount:n,children:b.jsx(rl,{present:n||i.open,children:b.jsx(Rb,{asChild:!0,container:s,children:r})})})},"PopoverPortal"),Eh="PopoverContent",HQ=m.forwardRef(il(function(e,n){const r=FQ(Eh,e.__scopePopover),{forceMount:s=r.forceMount,...i}=e,o=bd(Eh,e.__scopePopover);return b.jsx(rl,{present:s||o.open,children:o.modal?b.jsx(UQ,{...i,ref:n}):b.jsx(BQ,{...i,ref:n})})},"PopoverContent")),zQ=qa("PopoverContent.RemoveScroll"),UQ=m.forwardRef(il(function(e,n){const r=bd(Eh,e.__scopePopover),s=m.useRef(null),i=tn(n,s),o=m.useRef(!1);return m.useEffect(()=>{const l=s.current;if(l)return lO(l)},[]),b.jsx(jb,{as:zQ,allowPinchZoom:!0,children:b.jsx(mO,{...e,ref:i,trapFocus:r.open,disableOutsidePointerEvents:!0,onCloseAutoFocus:Kt(e.onCloseAutoFocus,l=>{var u;l.preventDefault(),o.current||(u=r.triggerRef.current)==null||u.focus()}),onPointerDownOutside:Kt(e.onPointerDownOutside,l=>{const u=l.detail.originalEvent,d=u.button===0&&u.ctrlKey===!0,f=u.button===2||d;o.current=f},{checkForDefaultPrevented:!1}),onFocusOutside:Kt(e.onFocusOutside,l=>l.preventDefault(),{checkForDefaultPrevented:!1})})})},"PopoverContentModal")),BQ=m.forwardRef(il(function(e,n){const r=bd(Eh,e.__scopePopover),s=m.useRef(!1),i=m.useRef(!1);return b.jsx(mO,{...e,ref:n,trapFocus:!1,disableOutsidePointerEvents:!1,onCloseAutoFocus:o=>{var l,u;(l=e.onCloseAutoFocus)==null||l.call(e,o),o.defaultPrevented||(s.current||(u=r.triggerRef.current)==null||u.focus(),o.preventDefault()),s.current=!1,i.current=!1},onInteractOutside:o=>{var d,f;(d=e.onInteractOutside)==null||d.call(e,o),o.defaultPrevented||(s.current=!0,o.detail.originalEvent.type==="pointerdown"&&(i.current=!0));const l=o.target;((f=r.triggerRef.current)==null?void 0:f.contains(l))&&o.preventDefault(),o.detail.originalEvent.type==="focusin"&&i.current&&o.preventDefault()}})},"PopoverContentNonModal")),mO=m.forwardRef(il(function(e,n){const{__scopePopover:r,trapFocus:s,onOpenAutoFocus:i,onCloseAutoFocus:o,disableOutsidePointerEvents:l,onEscapeKeyDown:u,onPointerDownOutside:d,onFocusOutside:f,onInteractOutside:p,...g}=e,v=bd(Eh,r),w=Vb(r);return Jg(),b.jsx(qI,{asChild:!0,loop:!0,trapped:s,onMountAutoFocus:i,onUnmountAutoFocus:o,children:b.jsx(xb,{asChild:!0,disableOutsidePointerEvents:l,onInteractOutside:p,onEscapeKeyDown:u,onPointerDownOutside:d,onFocusOutside:f,onDismiss:()=>v.onOpenChange(!1),deferPointerDownOutside:!0,children:b.jsx(AI,{"data-state":Hb(v.open),role:"dialog",id:v.contentId,...w,...g,ref:n,style:{...g.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 Hb(t){return t?"open":"closed"}il(Hb,"getState");var zb=NQ,Ub=jQ,Bb=VQ,Zb=HQ;const Ch={fast:{type:"spring",duration:.08,bounce:0},moderate:{type:"spring",duration:.16,bounce:.15}},ZQ="data-hover-dead-zone";function gO(t,e={}){const{axis:n="y",snapTolerancePx:r=1/0}=e,s=m.useRef(new Map),[i,o]=m.useState(null),[l,u]=m.useState([]),d=m.useRef([]),f=m.useRef(0),p=m.useRef(null),g=m.useRef(null),v=m.useCallback(()=>{const C=[];return s.current.forEach((T,A)=>{C[A]={top:T.offsetTop,height:T.offsetHeight,left:T.offsetLeft,width:T.offsetWidth}}),C},[]),w=m.useCallback(()=>{if(!t.current)return;const T=v();d.current=T,u(T)},[t,v]),_=m.useCallback((C,T)=>{T?s.current.set(C,T):s.current.delete(C),g.current!==null&&cancelAnimationFrame(g.current),g.current=requestAnimationFrame(()=>{g.current=null,w()})},[w]),x=m.useCallback(C=>{const T=C.clientX,A=C.clientY,I=C.target instanceof Element&&C.target.closest(`[${ZQ}]`)!==null;p.current!==null&&cancelAnimationFrame(p.current),p.current=requestAnimationFrame(()=>{p.current=null;const M=t.current;if(!M)return;if(I){o(null);return}const R=v(),O=d.current;(R.length!==O.length||R.some((oe,re)=>{const ie=O[re];return!ie||!oe||oe.top!==ie.top||oe.height!==ie.height||oe.left!==ie.left||oe.width!==ie.width}))&&(d.current=R,u(R));const D=M.getBoundingClientRect(),$=n==="x"?T:A;let Y=null,B=1/0,G=null;const V=d.current,K=n==="x"?M.scrollLeft:M.scrollTop,U=n==="x"?M.clientLeft:M.clientTop,ee=n==="x"?D.left:D.top,Z=n==="x"?M.offsetWidth:M.offsetHeight,j=n==="x"?D.width:D.height,Q=Z>0?j/Z:1;for(let oe=0;oe<V.length;oe++){const re=V[oe];if(!re)continue;const ie=n==="x"?re.left:re.top,fe=ee+(U+ie-K)*Q,_e=(n==="x"?re.width:re.height)*Q,ue=fe+_e;$>=fe&&$<=ue&&(G=oe);let ae=0;$<fe?ae=fe-$:$>ue&&(ae=$-ue),ae<B&&(B=ae,Y=oe)}o(G??(B<=r?Y:null))})},[n,t,r,v]),S=m.useCallback(()=>{f.current+=1,w()},[w]),k=m.useCallback(()=>{p.current!==null&&(cancelAnimationFrame(p.current),p.current=null),o(null)},[]);return m.useEffect(()=>()=>{p.current!==null&&cancelAnimationFrame(p.current),g.current!==null&&cancelAnimationFrame(g.current)},[]),{activeIndex:i,setActiveIndex:o,itemRects:l,sessionRef:f,handlers:{onMouseMove:x,onMouseEnter:S,onMouseLeave:k},registerItem:_,measureItems:w}}function WQ(t,e,n){m.useEffect(()=>(t(e,n.current),()=>t(e,null)),[e,t,n])}let fm=0;const qQ=()=>{fm+=1;let t=!1;return()=>{t||(t=!0,fm=Math.max(0,fm-1))}},GQ=()=>fm>0,KQ='[data-menu-item]:not([disabled]):not([aria-disabled="true"])',vO=({itemSelector:t=KQ,loop:e=!1,onDismiss:n}={})=>{const r=m.useRef(null),s=m.useRef(null),i=m.useRef(n),o=m.useRef(!1);i.current=n;const l=m.useCallback(f=>{var p;if(r.current=f,f){o.current=!1;const g=qQ(),v=f.ownerDocument.defaultView;let w;const _=()=>{v==null||v.clearTimeout(w),w=v==null?void 0:v.setTimeout(()=>{const x=f.ownerDocument.activeElement;(x==null?void 0:x.tagName)==="IFRAME"&&!f.contains(x)&&i.current&&(o.current=!0,i.current())})};v==null||v.addEventListener("blur",_),s.current=()=>{v==null||v.removeEventListener("blur",_),v==null||v.clearTimeout(w),g()}}else(p=s.current)==null||p.call(s),s.current=null},[]),u=f=>{o.current&&f.preventDefault()},d=m.useCallback(f=>{var k;const{key:p}=f;if(p!=="ArrowDown"&&p!=="ArrowUp"&&p!=="Home"&&p!=="End")return;const g=r.current;if(!g)return;const v=Array.from(g.querySelectorAll(t));if(v.length===0)return;f.preventDefault(),f.stopPropagation();const w=v.indexOf(document.activeElement),_=v.length-1,x=C=>{if(w===-1)return C===1?0:_;const T=w+C;return e?(T+v.length)%v.length:Math.min(Math.max(T,0),_)};let S;p==="Home"?S=0:p==="End"?S=_:p==="ArrowDown"?S=x(1):S=x(-1),(k=v[S])==null||k.focus()},[t,e]);return{containerRef:l,onKeyDown:d,onCloseAutoFocus:u}};var hm={exports:{}},YQ=hm.exports,KC;function XQ(){return KC||(KC=1,(function(t){(function(e,n){t.exports?t.exports=n():e.log=n()})(YQ,function(){var e=function(){},n="undefined",r=typeof window!==n&&typeof window.navigator!==n&&/Trident\/|MSIE /.test(window.navigator.userAgent),s=["trace","debug","info","warn","error"],i={},o=null;function l(_,x){var S=_[x];if(typeof S.bind=="function")return S.bind(_);try{return Function.prototype.bind.call(S,_)}catch{return function(){return Function.prototype.apply.apply(S,[_,arguments])}}}function u(){console.log&&(console.log.apply?console.log.apply(console,arguments):Function.prototype.apply.apply(console.log,[console,arguments])),console.trace&&console.trace()}function d(_){return _==="debug"&&(_="log"),typeof console===n?!1:_==="trace"&&r?u:console[_]!==void 0?l(console,_):console.log!==void 0?l(console,"log"):e}function f(){for(var _=this.getLevel(),x=0;x<s.length;x++){var S=s[x];this[S]=x<_?e:this.methodFactory(S,_,this.name)}if(this.log=this.debug,typeof console===n&&_<this.levels.SILENT)return"No console available for logging"}function p(_){return function(){typeof console!==n&&(f.call(this),this[_].apply(this,arguments))}}function g(_,x,S){return d(_)||p.apply(this,arguments)}function v(_,x){var S=this,k,C,T,A="loglevel";typeof _=="string"?A+=":"+_:typeof _=="symbol"&&(A=void 0);function I(D){var $=(s[D]||"silent").toUpperCase();if(!(typeof window===n||!A)){try{window.localStorage[A]=$;return}catch{}try{window.document.cookie=encodeURIComponent(A)+"="+$+";"}catch{}}}function M(){var D;if(!(typeof window===n||!A)){try{D=window.localStorage[A]}catch{}if(typeof D===n)try{var $=window.document.cookie,Y=encodeURIComponent(A),B=$.indexOf(Y+"=");B!==-1&&(D=/^([^;]+)/.exec($.slice(B+Y.length+1))[1])}catch{}return S.levels[D]===void 0&&(D=void 0),D}}function R(){if(!(typeof window===n||!A)){try{window.localStorage.removeItem(A)}catch{}try{window.document.cookie=encodeURIComponent(A)+"=; expires=Thu, 01 Jan 1970 00:00:00 UTC"}catch{}}}function O(D){var $=D;if(typeof $=="string"&&S.levels[$.toUpperCase()]!==void 0&&($=S.levels[$.toUpperCase()]),typeof $=="number"&&$>=0&&$<=S.levels.SILENT)return $;throw new TypeError("log.setLevel() called with invalid level: "+D)}S.name=_,S.levels={TRACE:0,DEBUG:1,INFO:2,WARN:3,ERROR:4,SILENT:5},S.methodFactory=x||g,S.getLevel=function(){return T??C??k},S.setLevel=function(D,$){return T=O(D),$!==!1&&I(T),f.call(S)},S.setDefaultLevel=function(D){C=O(D),M()||S.setLevel(D,!1)},S.resetLevel=function(){T=null,R(),f.call(S)},S.enableAll=function(D){S.setLevel(S.levels.TRACE,D)},S.disableAll=function(D){S.setLevel(S.levels.SILENT,D)},S.rebuild=function(){if(o!==S&&(k=O(o.getLevel())),f.call(S),o===S)for(var D in i)i[D].rebuild()},k=O(o?o.getLevel():"WARN");var N=M();N!=null&&(T=O(N)),f.call(S)}o=new v,o.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 v(x,o.methodFactory)),S};var w=typeof window!==n?window.log:void 0;return o.noConflict=function(){return typeof window!==n&&window.log===o&&(window.log=w),o},o.getLoggers=function(){return i},o.default=o,o})})(hm)),hm.exports}var QQ=XQ();const pi=Mg(QQ),JQ="INFO",eJ=JQ.toUpperCase();pi.setLevel(pi.levels[eJ]||pi.levels.INFO);const Rs=t=>{const e=t?`[${t}] `:"";return{trace:(n,...r)=>pi.trace(`${e}${n}`,...r),debug:(n,...r)=>pi.debug(`${e}${n}`,...r),info:(n,...r)=>pi.info(`${e}${n}`,...r),warn:(n,...r)=>pi.warn(`${e}${n}`,...r),error:(n,...r)=>{pi.error(`${e}${n}`,...r);try{const i=r.map(l=>l instanceof Error?l.message:String(l)).join(" ").slice(0,512),o={source:"ui",error_message:n,service:t??"unknown",error_type:"logged_error",url:window.location.pathname,error_args_count:r.length,...i?{error_detail:i}:{}};Ce.capture("logger_error",o)}catch(s){console.error("[logger] Failed to send logger_error to PostHog:",s)}},api:(n,...r)=>pi.info(`${e}API: ${n}`,...r),hook:(n,...r)=>pi.debug(`${e}Hook: ${n}`,...r),mount:(n,...r)=>pi.debug(`${e}Mount: ${n}`,...r)}},YC=Rs("useVariantsUiState"),tJ={groups:[],rows:{}},$0={pinned:[],order:tJ},Af="pinned",nJ="top",p_=t=>`rows:${t}`,XC=t=>e=>e.pinned.includes(t)?e:{...e,pinned:[...e.pinned,t]},rJ=t=>e=>({...e,pinned:e.pinned.filter(n=>n!==t)}),sJ=(t,e)=>n=>{if(t===Af){const r=new Set(e);return{...n,pinned:[...e,...n.pinned.filter(s=>!r.has(s))]}}return t===nJ?{...n,order:{...n.order,groups:e}}:{...n,order:{...n.order,rows:{...n.order.rows,[t.slice(5)]:e}}}},iJ=t=>{const e=t?`?projectPath=${encodeURIComponent(t)}`:"",[n,r]=m.useState($0),s=m.useRef(n);s.current=n;const i=m.useRef(!1),o=m.useRef([]),l=m.useCallback(v=>{t&&fetch(`/api/variants/ui-state${e}`,{method:"PUT",headers:{"Content-Type":"application/json"},body:JSON.stringify({uiState:v})}).catch(w=>{YC.warn("persist failed — arrangement kept for this session only",w)})},[t,e]);m.useEffect(()=>{if(r($0),s.current=$0,i.current=!1,o.current=[],!t)return;let v=!1;return(async()=>{try{const w=await fetch(`/api/variants/ui-state${e}`);if(!w.ok||v)return;const _=await w.json();if(v)return;let x=_.uiState??$0;const S=o.current;o.current=[];for(const k of S)x=k(x);i.current=!0,s.current=x,r(x),S.length>0&&l(x)}catch(w){YC.warn("load failed — arrangement is session-local until reload",w)}})(),()=>{v=!0}},[t,e,l]);const u=m.useCallback(v=>{const w=v(s.current);s.current=w,r(w),i.current?l(w):o.current.push(v)},[l]),d=m.useCallback(v=>{const w=!s.current.pinned.includes(v);u(w?XC(v):rJ(v))},[u]),f=m.useCallback(v=>{s.current.pinned.includes(v)||u(XC(v))},[u]),p=m.useCallback((v,w)=>{u(sJ(v,w))},[u]),g=m.useMemo(()=>new Set(n.pinned),[n.pinned]);return{pinnedKeys:n.pinned,pinnedKeySet:g,listOrder:n.order,togglePin:d,pinItem:f,reorder:p}},oJ=t=>{const{containerRef:e,dragged:n,yieldToSelector:r,restrictToSelector:s,onReorder:i}=t,[o,l]=m.useState(null),u=m.useCallback(p=>{const g=e.current;return g?Array.from(g.querySelectorAll(`[data-reorder-container="${CSS.escape(p)}"]`)):[]},[e]),d=m.useCallback(p=>{if(!n){o&&l(null);return}const g=e.current;if(!g)return;if(r){const S=g.querySelector(r);if(S){const k=S.getBoundingClientRect();if(p.clientY>=k.top&&p.clientY<=k.bottom){o&&l(null);return}}}if(s){const S=g.querySelector(s),k=S==null?void 0:S.getBoundingClientRect();if(!k||p.clientY<k.top||p.clientY>k.bottom){o&&l(null);return}}const v=u(n.container);if(v.length===0){o&&l(null);return}const w=g.getBoundingClientRect().top;let _=v.length;for(let S=0;S<v.length;S++){const k=v[S].getBoundingClientRect();if(p.clientY<k.top+k.height/2){_=S;break}}let x;_===0?x=v[0].getBoundingClientRect().top-w-1:_===v.length?x=v[v.length-1].getBoundingClientRect().bottom-w:x=(v[_-1].getBoundingClientRect().bottom+v[_].getBoundingClientRect().top)/2-w,(!o||o.index!==_||o.container!==n.container)&&l({container:n.container,index:_,top:x})},[e,n,o,u,r,s]),f=m.useCallback(()=>{if(!n||!o)return;l(null);const p=u(o.container).map(w=>w.dataset.reorderKey).filter(w=>!!w),g=p.indexOf(n.key);if(g===-1)return;p.splice(g,1);const v=o.index>g?o.index-1:o.index;p.splice(v,0,n.key),i(o.container,p)},[n,o,u,i]);return{dropTarget:o,onPointerMove:d,onPointerUp:f}},yO=(t,e)=>`style:${t}:${e}`,_O=t=>`text:${t}`,wO=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"]},xO=t=>wO(t)[0],F0=(t,e)=>wO(t).includes(e),aJ=t=>{const e=xO(t.elementId),n=t.batchId?`:${t.batchId}`:"";return t.type==="style"?`${yO(e,t.property)}${n}`:`${_O(e)}${n}`},dr=[];for(let t=0;t<256;++t)dr.push((t+256).toString(16).slice(1));function lJ(t,e=0){return(dr[t[e+0]]+dr[t[e+1]]+dr[t[e+2]]+dr[t[e+3]]+"-"+dr[t[e+4]]+dr[t[e+5]]+"-"+dr[t[e+6]]+dr[t[e+7]]+"-"+dr[t[e+8]]+dr[t[e+9]]+"-"+dr[t[e+10]]+dr[t[e+11]]+dr[t[e+12]]+dr[t[e+13]]+dr[t[e+14]]+dr[t[e+15]]).toLowerCase()}const cJ=new Uint8Array(16);function uJ(){return crypto.getRandomValues(cJ)}function QC(t,e,n){return crypto.randomUUID?crypto.randomUUID():dJ(t)}function dJ(t,e,n){var s;t=t||{};const r=t.random??((s=t.rng)==null?void 0:s.call(t))??uJ();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,lJ(r)}const fJ=300;class hJ{constructor(){ma(this,"history",{current:new Map,past:[],future:[]});ma(this,"pendingChanges",new Map);ma(this,"currentBatchId",null);ma(this,"debounceTimer",null);ma(this,"onChangeCallbacks",[]);ma(this,"stateBeforePending",null);ma(this,"transactionDepth",0)}recordChange(e){this.pendingChanges.size===0&&(this.currentBatchId=QC(),this.stateBeforePending=new Map(this.history.current)),this.currentBatchId&&(e.batchId=this.currentBatchId);const n=xO(e.elementId),r=e.type==="style"?yO(n,e.property):_O(n),s=Array.from(this.history.current.entries()).find(([o])=>o===r||o.startsWith(`${r}:`));if(s){const o=s[1];e.type==="style"&&o.type==="style"?e.oldValue=o.oldValue:e.type==="text"&&o.type==="text"&&(e.oldText=o.oldText)}const i=aJ(e);this.history.current.set(i,e),this.pendingChanges.set(i,e),this.debounceTimer&&clearTimeout(this.debounceTimer),this.debounceTimer=setTimeout(()=>{this.commitPending()},fJ),this.notifyChange()}flushPending(){this.debounceTimer&&(clearTimeout(this.debounceTimer),this.debounceTimer=null),this.commitPending()}removeChange(e){const n=this.history.current.get(e)??this.pendingChanges.get(e)??null,r=this.history.current.has(e),s=this.pendingChanges.has(e);return!r&&!s?null:(r&&this.history.current.delete(e),s&&this.pendingChanges.delete(e),n&&this.stateBeforePending&&(this.stateBeforePending=this.removeChangeFromSnapshotById(this.stateBeforePending,n.id)),s&&this.pendingChanges.size===0&&(this.debounceTimer&&(clearTimeout(this.debounceTimer),this.debounceTimer=null),this.stateBeforePending=null,this.currentBatchId=null),r&&(this.history.future=[]),n&&(this.history.past=this.history.past.map(i=>this.removeChangeFromSnapshotById(i,n.id)).filter(i=>i.size>0)),this.notifyChange(),n)}removeChangeById(e){const n=Array.from(this.history.current.entries()).find(([,s])=>s.id===e);if(n)return this.removeChange(n[0]);const r=Array.from(this.pendingChanges.entries()).find(([,s])=>s.id===e);return r?this.removeChange(r[0]):null}removeChangeFromSnapshotById(e,n){return new Map(Array.from(e.entries()).filter(([,r])=>r.id!==n))}commitPending(){this.pendingChanges.size===0||!this.stateBeforePending||this.transactionDepth>0||(this.history.past.push(this.stateBeforePending),this.history.future=[],this.pendingChanges.clear(),this.stateBeforePending=null,this.currentBatchId=null,this.notifyChange())}undo(){this.pendingChanges.size>0&&this.commitPending();const e=this.history.past.pop();if(!e)return null;const n=new Map(this.history.current);this.history.future.push(n),this.history.current=e,this.notifyChange();const r=[];for(const[s,i]of n)this.history.current.has(s)||r.push(i);return r}redo(){const e=this.history.future.pop();if(!e)return null;const n=new Map(this.history.current);this.history.past.push(n),this.history.current=e,this.notifyChange();const r=[];for(const[s,i]of this.history.current)n.has(s)||r.push(i);return r}getChanges(){return Array.from(this.history.current.values())}getStyleChanges(){return Array.from(this.history.current.values()).filter(e=>e.type==="style")}getTextChanges(){return Array.from(this.history.current.values()).filter(e=>e.type==="text")}getChangeCount(){return this.getUniqueBatchCount(this.history.current.values())}getStyleBatchCount(){return this.getUniqueBatchCount(Array.from(this.history.current.values()).filter(e=>e.type==="style"))}getTextBatchCount(){return this.getUniqueBatchCount(Array.from(this.history.current.values()).filter(e=>e.type==="text"))}getUniqueBatchCount(e){const n=new Set;for(const r of e)r.batchId?n.add(r.batchId):n.add(r.id);return n.size}canUndo(){return this.history.past.length>0||this.pendingChanges.size>0}canRedo(){return this.history.future.length>0}clear(){this.debounceTimer&&(clearTimeout(this.debounceTimer),this.debounceTimer=null),this.history={current:new Map,past:[],future:[]},this.pendingChanges.clear(),this.stateBeforePending=null,this.currentBatchId=null,this.notifyChange()}getStyleChange(e,n){return Array.from(this.history.current.values()).filter(s=>s.type==="style"&&F0(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"&&F0(r.elementId,e)).sort((r,s)=>s.timestamp-r.timestamp)[0]}hasChanges(e){return Array.from(this.history.current.values()).some(n=>F0(n.elementId,e))}getChangesForElement(e){return Array.from(this.history.current.values()).filter(n=>F0(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=QC(),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 yg={kind:"base"};function Ph(t){return t.kind==="base"?"base":`variant:${t.sessionId}:${t.variantId}`}function pJ(t,e){return t.kind==="base"&&e.kind,t.kind==="variant"&&e.kind==="variant"?t.sessionId===e.sessionId&&t.variantId===e.variantId:!1}const mJ={resize:{default:!1},variants:{default:!1},designSystemEditor:{default:!1},branchDiff:{default:!1},gitUi:{default:!0},createProject:{default:!1},deployPrototype:{default:!1},canvasShare:{default:!1},variantSend:{default:!1},generativeControls:{default:!1},refineMode:{default:!1},designContextViewer:{default:!1},variantReferences:{default:!1},inspectorUndoRedo:{default:!1}},bO=Object.fromEntries(Object.entries(mJ).map(([t,e])=>[t,{isEnabled:e.default}]));ft("view");const SO=ft(!0),kO=ft(null),gJ=ft("chat"),EO=ft(0),vJ=ft({name:null,email:null}),JC=ft(yg);ft(null);const Th=new Map,yJ=t=>{const e=Ph(t);let n=Th.get(e);return n||(n=new hJ,Th.set(e,n)),n};ft(t=>yJ(t(JC)),(t,e,n)=>{Th.set(Ph(t(JC)),n)});const _J=t=>{for(const e of[...Th.keys()])e==="base"||t.has(e)||Th.delete(e)},Ah=ft(new Map),e3=ft(null);ft(null);const Aw=ft(0),_g=ft(null),Rw=ft(!1),Mw=ft(null),CO=ft(!1),PO=ft(!1),Iw=ft(null),pm=ft(null),ad=ft(null),Wb=ft(null),Zo=ft(null),TO=ft(!1),tp=ft({active:!1}),AO=ft([]),t3=ft(null),wJ=(t,e,n)=>{let r=!1;const s=new Map(t);for(const[i,o]of t)o.target&&pJ(o.target,e)&&(s.set(i,{...o,target:n}),r=!0);return r?s:t},xJ=ft(null,(t,e,n)=>{const r=u=>{const d=u??yg;return d.kind==="variant"&&!n.has(Ph(d))},s=t(Ah);let i=null;for(const[u,d]of s)r(d.target)&&(i??(i=new Set)).add(u);if(i){const u=new Map(s);for(const d of i)u.delete(d);e(Ah,u)}const o=t(e3);o&&r(o.target)&&(e(e3,null),e(CJ,!1));const l=t(t3);l&&(i!=null&&i.has(l.commentId))&&e(t3,null),_J(n)}),Ow=ft(bO),bJ=ft(!1),qb=ft(null),RO=ft(null),lv=ft(!0),SJ=ft(!1),MO=ft(!1),IO=ft(null),kJ=()=>{var t;return typeof window>"u"?null:((t=window.__RIVET_BOOTSTRAP__)==null?void 0:t.agentApplyMode)??null},cv=ft(kJ()),EJ=ft(null),CJ=ft(!1);ft(0);ft(0);function PJ(t){return t==="cursor"?"Cursor":t==="codex"?"Codex":t==="claude-desktop"?"Claude":"Claude Code"}const TJ=["⡡⠊⢔⠡","⠊⡰⡡⡘","⢔⢅⠈⢢","⡁⢂⠆⡍","⢔⠨⢑⢐","⠨⡑⡠⠊"],Gb=({className:t,"data-testid":e}={})=>b.jsx("div",{className:`rivet-sparkle relative overflow-hidden font-mono leading-none ${t??"text-base text-primary"}`,style:{height:"1em",width:"4ch"},"aria-hidden":"true","data-testid":e,children:b.jsx("div",{className:"rivet-sparkle-strip",children:TJ.map((n,r)=>b.jsx("span",{className:"block",style:{height:"1em",lineHeight:"1em"},children:n},r))})}),OO=({primaryLabel:t,primaryIcon:e,primaryAction:n,isDisabled:r=!1,isDropdownDisabled:s=!1,isLoading:i=!1,loadingLabel:o,dropdownAriaLabel:l="More actions",dropdownItems:u})=>{const[d,f]=m.useState(!1),p=i?o??t:t,g=u.length>0;return b.jsxs("div",{className:"flex items-stretch",children:[b.jsxs("button",{onClick:n,disabled:r||i,className:`bg-main-hover hover:bg-main-input flex h-7 shrink-0 items-center gap-1.5 px-3 text-xs font-medium text-white transition-colors disabled:cursor-not-allowed disabled:opacity-50 ${g?"rounded-l-md":"rounded-md"}`,children:[e?b.jsx(e,{className:"h-3.5 w-3.5",weight:"bold"}):null,p]}),g?b.jsxs(zb,{open:d,onOpenChange:f,children:[b.jsx(Ub,{asChild:!0,children:b.jsx("button",{"aria-label":l,disabled:s||i,title:l,className:"bg-main-hover hover:bg-main-input h-7 shrink-0 rounded-r-md border-l border-white/20 px-1.5 text-white transition-colors disabled:cursor-not-allowed disabled:opacity-50",children:b.jsx(Qq,{className:"h-3.5 w-3.5",weight:"bold"})})}),b.jsx(Bb,{children:b.jsx(Zb,{className:"border-divider bg-main z-[60] min-w-[140px] rounded-lg border p-1 shadow-lg",sideOffset:5,align:"end",children:u.map(v=>{const w=v.icon;return b.jsxs("button",{onClick:()=>{v.isDisabled||(v.onClick(),f(!1))},disabled:v.isDisabled,className:"text-content hover:bg-hover flex w-full items-center gap-2 rounded px-3 py-1.5 text-xs transition-colors disabled:cursor-not-allowed disabled:opacity-50",children:[w?b.jsx(w,{className:"h-3.5 w-3.5",weight:"bold"}):null,v.label]},v.label)})})})]}):null]})},wc=({label:t,children:e,side:n="top",sideOffset:r=8,delayDuration:s=300,disabled:i=!1,forceOpen:o})=>i?b.jsx(b.Fragment,{children:e}):b.jsx(Lb,{content:t,side:n,sideOffset:r,delayDuration:s,forceOpen:o,children:e}),uv="/__rivet/preview",n3=`${uv}/variant/`,r3=`${uv}/history/`,LO=t=>t?t.startsWith("/")?t:`/${t}`:"/",AJ=t=>`${uv}/variant/${encodeURIComponent(t.sessionId)}/${encodeURIComponent(t.variantId)}${LO(t.routePath)}`,RJ=t=>`${uv}/history/${encodeURIComponent(t.sessionId)}/${encodeURIComponent(t.variantId)}${LO(t.routePath)}`,MJ=t=>{try{const e=new URL(t,"http://localhost");return e.pathname.startsWith(n3)||e.pathname.startsWith(r3)}catch{return t.startsWith(n3)||t.startsWith(r3)}},s3=t=>{var s,i,o,l;const{sessionId:e,variant:n,projectContext:r}=t;return n.status!=="succeeded"?null:((s=n.preview)==null?void 0:s.kind)==="static_artifact"?n.preview.url:e&&(((i=n.preview)==null?void 0:i.kind)==="dev_server"||typeof n.port=="number")?AJ({sessionId:e,variantId:n.workItemId,routePath:t.routePath}):e&&(r==null?void 0:r.kind)==="fresh"&&((o=r.executionPlan)==null?void 0:o.mode)!=="vite_app"&&((l=n.preview)==null?void 0:l.kind)!=="dev_server"?`/api/variants/${e}/static/${n.workItemId}`:null},i3="/rivet/",NO=t=>{if(!t.startsWith(i3))return null;const e=t.slice(i3.length);return!e||e==="/"?null:`/${e}`},ld=(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(()=>{})},IJ=(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),ld(r,e))}},wg=(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}}},o3=6,DO="original",Kb="Original",jO="The original state of your app before any variants were generated.",a3=200,$O="h-6 w-6 rounded",Lw=[.33,1,.68,1],Nw=.22,Mn=Rs("AgentVariantsPanel"),m_=()=>{var t;(t=window.getSelection())==null||t.removeAllRanges()},hu=t=>{var e;return!!t.hasTree&&((e=t.serve)==null?void 0:e.kind)==="dev-server"},OJ=t=>{var e;return t?t.kind==="existing"?!0:((e=t.executionPlan)==null?void 0:e.mode)==="vite_app":!1};function g_(t,...e){return t?e.some(n=>(n??"").toLowerCase().includes(t)):!0}const LJ=(t,e)=>{if(t.kind==="original")return null;const n=t.kind==="active"?t.variant.runLabel:t.entry.runLabel,r=n==null?void 0:n.trim();return r?t.kind==="active"?e?{label:r,run:t.variant.requestId?{sessionId:e,requestId:t.variant.requestId}:{sessionId:e,runLabel:r}}:null:{label:r,run:t.entry.requestId?{sessionId:t.entry.sessionId,requestId:t.entry.requestId}:{sessionId:t.entry.sessionId,runLabel:r}}:null},FO=t=>{const e="requestId"in t?["request",t.requestId]:["label",t.runLabel];return`run:${JSON.stringify([t.sessionId,...e])}`},NJ="original",Dw="pinned-section";function VO(t){return`rivet:collapsedRuns:${t}`}function V0(t){try{const e=window.localStorage.getItem(VO(t)),n=e?JSON.parse(e):null;return Array.isArray(n)?new Set(n.filter(r=>typeof r=="string")):new Set}catch{return new Set}}function v_(t,e){try{window.localStorage.setItem(VO(t),JSON.stringify([...e]))}catch{}}const l3=(t,e)=>{const n=[],r=new Map;for(const s of t){const i=LJ(s,e);let o="";s.kind==="original"?o=NJ:i&&(o=FO(i.run));let l=r.get(o);l||(l={key:o,label:(i==null?void 0:i.label)??null,run:(i==null?void 0:i.run)??null,rows:[]},r.set(o,l),n.push(l)),l.rows.push(s)}return n};async function Ii(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 DJ=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},Yf=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")},HO=t=>{var e;return((e=t.previewUnavailable)==null?void 0:e.reason)==="idle_timeout"},jJ=t=>t.status==="succeeded"&&!Yf(t)&&(!t.previewUnavailable||HO(t)),y_=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"},c3=(t,e,n)=>{const r=t.includes("?")?"&":"?";return`${t}${r}${encodeURIComponent(e)}=${encodeURIComponent(n)}`},$J=t=>{var e;return DJ(t)&&((e=t.preview)==null?void 0:e.kind)==="static_artifact"},u3=(t,e)=>t.map(n=>`${n.workItemId}:${e[n.workItemId]??""}`).join("|"),FJ=(t,e)=>t.length===e.length&&t.every((n,r)=>{var i,o;const s=e[r];return n.sessionId===s.sessionId&&n.variantId===s.variantId&&n.requestId===s.requestId&&n.label===s.label&&n.brief===s.brief&&JSON.stringify(n.references)===JSON.stringify(s.references)&&n.runLabel===s.runLabel&&n.createdAt===s.createdAt&&((i=n.serve)==null?void 0:i.kind)===((o=s.serve)==null?void 0:o.kind)&&n.hasTree===s.hasTree}),VJ=()=>{var Qo,Jo,ti,pp;const t=$g(),e=ut(tp),n=ut(TO),r=m.useRef(!1),s=ut(AO),i=ut(qb),o=ut(lv),l=ut(Ow),u=((Qo=l.deployPrototype)==null?void 0:Qo.isEnabled)??!1,d=((Jo=l.canvasShare)==null?void 0:Jo.isEnabled)??!1,f=((ti=l.variantSend)==null?void 0:ti.isEnabled)??!1,p=((pp=l.designContextViewer)==null?void 0:pp.isEnabled)??!1,g=ut(MO),v=ut(IO),w=gt(Aw),_=gt(_g),x=gt(Rw),S=gt(Mw),k=gt(CO),C=gt(PO),T=gt(ad),A=ut(ad),I=gt(Wb),M=gt(kO);m.useEffect(()=>(M("Directions"),()=>M(null)),[M]);const R=ut(Zo),O=gt(Zo),N=m.useCallback((F=!1)=>{if(IJ(R),O(null),F&&R){const le=wg("ended",R);Ce.capture(le.event,le.properties)}},[O,R]),D=ut(Iw),$=gt(Iw),Y=ut(pm),B=gt(pm),G=Y?`${Y.sessionId}:${Y.variantId}`:null,[V,K]=m.useState(""),[U,ee]=m.useReducer(F=>F+1,0),Z=m.useMemo(()=>i!==null?V0(i):new Set,[i,U]),j=m.useCallback(F=>{if(i===null)return;const le=new Set(V0(i));le.delete(F)||le.add(F),v_(i,le),ee()},[i]),[Q,oe]=m.useState(null),[re,ie]=m.useState(null),[fe,_e]=m.useState(!1),[ue,ae]=m.useState({}),[Oe,Be]=m.useState(null),[Ee,pt]=m.useState({}),[Ot,Qt]=m.useState(null),[bt,_t]=m.useState([]),qe=m.useRef([]);qe.current=bt;const[Ke,Ct]=m.useState(!1),[Ae]=m.useState(()=>dK(window.location.search)),Ye=m.useRef(!1),Lt=m.useRef(!1);Lt.current=Ae!==null||Y!==null||D!==null||Ke;const Ge=m.useMemo(()=>e.active?e.variants:[],[e]),Pt=m.useMemo(()=>Ge.filter($J),[Ge]),is=m.useMemo(()=>u3(Pt,ue),[Pt,ue]),vr=(Oe==null?void 0:Oe.key)===is?Oe.shareUrl:null,Le=e.active?e.sessionId:null,Ko=m.useMemo(()=>{const F=new Set;for(const le of Ge)le.adoptedSource&&F.add(`${le.adoptedSource.sessionId}:${le.adoptedSource.variantId}`);return F},[Ge]),Ln=m.useMemo(()=>[...bt.filter(le=>le.sessionId!==Le&&!Ko.has(`${le.sessionId}:${le.variantId}`))].sort((le,ke)=>{const he=new Date(le.createdAt).getTime(),pe=new Date(ke.createdAt).getTime();return(Number.isNaN(pe)?0:pe)-(Number.isNaN(he)?0:he)}),[Ko,bt,Le]),Qn=m.useMemo(()=>Y?Ge.find(F=>{var le,ke;return((le=F.adoptedSource)==null?void 0:le.sessionId)===Y.sessionId&&((ke=F.adoptedSource)==null?void 0:ke.variantId)===Y.variantId})??null:null,[Y,Ge]),al=m.useMemo(()=>Y?Ln.find(F=>F.sessionId===Y.sessionId&&F.variantId===Y.variantId)??null:null,[Y,Ln]),gn=e.active?e.projectContext:null,vn=(gn==null?void 0:gn.kind)==="fresh"?gn.workspacePath:i,Sd=!e.active&&Ln.length>0&&Ln.every(F=>F.projectKind==="fresh"),Ms=e.active?OJ(gn):!!i&&!Sd,yr=m.useMemo(()=>vn?`?projectPath=${encodeURIComponent(vn)}`:"",[vn]),{pinnedKeys:Jn,pinnedKeySet:ro,listOrder:Qs,togglePin:Nn,pinItem:Is,reorder:ll}=iJ(vn),so=m.useRef(null),os=m.useRef(null),Xe=typeof window>"u"?"/":NO(window.location.pathname)??"/",Nt=m.useRef(null),Vt=m.useRef(!1),Bn=m.useCallback((F,le)=>{le.button!==0&&le.pointerType==="mouse"||(le.preventDefault(),m_(),Nt.current={kind:"live",variantId:F,startX:le.clientX,startY:le.clientY,committed:!1})},[]),as=m.useCallback((F,le)=>{le.button!==0&&le.pointerType==="mouse"||(le.preventDefault(),m_(),Nt.current={kind:"past",entry:F,startX:le.clientX,startY:le.clientY,committed:!1})},[]);m.useEffect(()=>{const F=he=>{const pe=Nt.current;if(!pe)return;const Se=he.clientX-pe.startX,et=he.clientY-pe.startY;if(!pe.committed){if(Se*Se+et*et<o3*o3)return;if(m_(),pe.kind==="live"){const Pe=Ge.find(yn=>yn.workItemId===pe.variantId);if(!Pe||Pe.status!=="succeeded"){Nt.current=null;return}const rn=s3({sessionId:Le,variant:Pe,projectContext:gn,routePath:Xe});T({sessionId:Le??"",variantId:Pe.workItemId,label:Pe.label||"Direction",url:rn,source:"live",runLabel:Pe.runLabel,description:Pe.description})}else{const{entry:Pe}=pe,rn=hu(Pe),yn=rn?RJ({sessionId:Pe.sessionId,variantId:Pe.variantId,routePath:Xe}):`/api/variants/history/${encodeURIComponent(Pe.sessionId)}/${encodeURIComponent(Pe.variantId)}/preview${yr}`;if(T({sessionId:Pe.sessionId,variantId:Pe.variantId,label:Pe.label||"Direction",url:yn,source:rn?"history-dev-server":"history-static",runLabel:Pe.runLabel,description:Pe.brief}),rn){const Pr=c3(`/api/variants/history/${encodeURIComponent(Pe.sessionId)}/${encodeURIComponent(Pe.variantId)}/run${yr}`,"targetAddressed","1");(async()=>{try{if(!(await fetch(Pr,{method:"POST"})).ok)return;const ds=c3(yn,"replay",String(Date.now()));T(ct=>!ct||ct.sessionId!==Pe.sessionId||ct.variantId!==Pe.variantId||ct.source!=="history-dev-server"?ct:{...ct,url:ds}),O(ct=>{if(!ct)return ct;const Ht=ni=>!ni||ni.sessionId!==Pe.sessionId||ni.variantId!==Pe.variantId?ni:{...ni,url:ds};return{...ct,left:Ht(ct.left),right:Ht(ct.right)}})}catch(us){Mn.warn("history replay drag boot failed",us)}})()}}pe.committed=!0}I({x:he.clientX,y:he.clientY})},le=()=>{const he=Nt.current;he!=null&&he.committed&&(Vt.current=!0,window.setTimeout(()=>{Vt.current=!1},0)),Nt.current=null,I(null)},ke=he=>{if(he.key!=="Escape")return;const pe=Nt.current;pe!=null&&pe.committed&&(pe.kind==="past"&&hu(pe.entry)&&ld({sessionId:pe.entry.sessionId,variantId:pe.entry.variantId,source:"history-dev-server"}),Nt.current=null,T(null),I(null))};return window.addEventListener("pointermove",F),window.addEventListener("pointerup",le),window.addEventListener("pointercancel",le),window.addEventListener("keydown",ke),()=>{window.removeEventListener("pointermove",F),window.removeEventListener("pointerup",le),window.removeEventListener("pointercancel",le),window.removeEventListener("keydown",ke)}},[Ge,Le,gn,Xe,yr,T,I,O]);const Bt=m.useCallback(()=>{var F;(F=Nt.current)!=null&&F.committed&&(Vt.current=!0,window.setTimeout(()=>{Vt.current=!1},0)),Nt.current=null,I(null),A&&(A.source==="history-dev-server"&&ld({sessionId:A.sessionId,variantId:A.variantId,source:"history-dev-server"}),T(null))},[A,T,I]),Dn=m.useCallback((F,le)=>{const ke=!ro.has(F);Ce.capture(ke?"variants_panel.direction_pinned":"variants_panel.direction_unpinned",{method:le}),Nn(F)},[ro,Nn]),Vr=m.useCallback(()=>{A&&(Ce.capture("variants_panel.direction_pinned",{method:"drag"}),Is(`row:past:${A.sessionId}:${A.variantId}`),Bt())},[A,Bt,Is]),Js=m.useCallback(F=>{Ce.capture("variants_panel.direction_unpinned",{method:"drag"}),Nn(F),Bt()},[Nn,Bt]),lr=m.useCallback((F,le)=>{ll(F,le),Bt()},[ll,Bt]),An=m.useMemo(()=>{var le;if(Ke||G)return null;const F=D?Ge.find(ke=>ke.workItemId===D):null;return D&&!F?null:F?Yf(F)?F.workItemId:null:e.active?((le=Ge.find(ke=>{var he,pe;return Yf(ke)&&(((he=ke.preview)==null?void 0:he.kind)==="static_artifact"||((pe=ke.preview)==null?void 0:pe.kind)==="dev_server")}))==null?void 0:le.workItemId)??null:null},[D,G,Ke,e,Ge]),cl=Ke||Ms&&D===null&&G===null&&An===null,Sc=m.useCallback(async F=>{var ke,he,pe,Se;if(!Le)return;const le=(F==null?void 0:F.workItemId)??null;oe({kind:"switch",variantId:le??void 0});try{if(((ke=F==null?void 0:F.preview)==null?void 0:ke.kind)==="static_artifact"){if(x(!1),S(null),((he=F.refinement)==null?void 0:he.status)==="succeeded"){const Pe=F.preview.url.includes("?")?"&":"?";_(`${F.preview.url}${Pe}refinement=${encodeURIComponent(F.refinement.workItemId)}`)}else _(F.preview.url);w(Pe=>Pe+1);return}if(le&&Le&&e.active&&e.projectContext.kind==="fresh"&&((pe=e.projectContext.executionPlan)==null?void 0:pe.mode)!=="vite_app"&&((Se=F==null?void 0:F.preview)==null?void 0:Se.kind)!=="dev_server"){x(!1),S(null),_(`/api/variants/${Le}/static/${le}`),w(Pe=>Pe+1);return}const et=F&&le?s3({sessionId:Le,variant:F,projectContext:e.active?e.projectContext:null,routePath:Xe}):null;if(et){x(!1),S(null),_(et),w(Pe=>Pe+1);return}Ce.capture("variants_panel.preview_display_failed",{sessionId:Le,variantId:le,previewKind:F?y_(F):"none",hasPreview:!!(F!=null&&F.preview),hasPort:typeof(F==null?void 0:F.port)=="number",errorMessage:"No addressable dev-server preview URL"}),x(!1),S(null)}catch(et){Mn.warn("preview display failed",et),Ce.capture("variants_panel.preview_display_failed",{sessionId:Le,variantId:le,previewKind:F?y_(F):"none",hasPreview:!!(F!=null&&F.preview),hasPort:typeof(F==null?void 0:F.port)=="number",errorMessage:et instanceof Error?et.message:String(et)}),x(!1),S(null)}finally{oe(null)}},[Le,e,Xe,w,_,x,S]),kc=m.useRef(!1),Ec=m.useRef(null),Os=m.useRef(0),io=m.useCallback(()=>{if(Os.current++,k(!1),C(!1),!kc.current)return;const F=Ec.current;kc.current=!1,Ec.current=null;const le=F?new URLSearchParams({sessionId:F.sessionId,variantId:F.variantId}):null,ke=le?`/api/variants/history/replay/stop?${le.toString()}`:"/api/variants/history/replay/stop";fetch(ke,{method:"POST"}).catch(he=>Mn.warn("history replay stop failed",he))},[k,C]),kd=m.useCallback(async F=>{if(Le){oe({kind:"switch",variantId:F.workItemId});try{const le=await fetch(`/api/variants/${Le}/preview-port`,{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({variantId:F.workItemId})});if(!le.ok){const ke=await Ii(le);throw new Error(ke.message??`Preview restoration failed (${le.status})`)}}catch(le){Mn.warn("preview restoration failed",le),Ce.capture("variants_panel.preview_display_failed",{sessionId:Le,variantId:F.workItemId,previewKind:"dev_server",hasPreview:!1,hasPort:!1,errorMessage:le instanceof Error?le.message:String(le)})}finally{oe(null)}}},[Le]),Cc=m.useCallback(F=>{var Se,et,Pe,rn,yn;if(Vt.current){Vt.current=!1;return}const le=Yf(F),ke=F.status==="pending"||F.status==="running"||jJ(F);io();const he=y_(F),pe=Ge.find(Pr=>Pr.workItemId===D);Ce.capture("variants_panel.preview_requested",{sessionId:Le,fromVariantId:pe==null?void 0:pe.workItemId,toVariantId:F.workItemId,variantStatus:F.status,isPreviewReady:le,isArmed:ke,previewKind:he,hasPreview:!!F.preview,hasPort:typeof F.port=="number",viewEnabled:((et=(Se=F.actions)==null?void 0:Se.view)==null?void 0:et.enabled)??null,previewUnavailableReason:((Pe=F.previewUnavailable)==null?void 0:Pe.reason)??null}),$(F.workItemId),B(null),le?(os.current=F.workItemId,Ct(!1),N(!0),Sc(F)):(os.current=null,Ct(!1),_(null),x(!1),ke&&Ce.capture("variants_panel.preview_armed",{sessionId:Le,fromVariantId:pe==null?void 0:pe.workItemId,toVariantId:F.workItemId,variantStatus:F.status,previewKind:he,hasPreview:!!F.preview,hasPort:typeof F.port=="number",viewEnabled:((yn=(rn=F.actions)==null?void 0:rn.view)==null?void 0:yn.enabled)??null}),HO(F)&&kd(F)),Ce.capture("variants_panel.preview_switched",{sessionId:Le,fromVariantId:pe==null?void 0:pe.workItemId,toVariantId:F.workItemId,armed:ke})},[D,Le,N,$,B,io,kd,Sc,Ge,_,x]),Ed=e.active?`${e.sessionId}:${e.stage}`:"inactive",Pc=m.useRef(!1);m.useEffect(()=>{if(o)return;let F=!1;return(async()=>{try{const le=await fetch(`/api/variants/history${yr}`,{credentials:"same-origin"});if(!le.ok)return;const ke=await le.json();if(F)return;const he=(ke.variants??[]).filter(pe=>{var Se,et;return((Se=pe.preview)==null?void 0:Se.kind)==="static"||((et=pe.serve)==null?void 0:et.kind)==="static"||hu(pe)});if(!Pc.current&&!Lt.current&&Ed==="inactive"&&he.length>0&&he.every(pe=>pe.projectKind==="fresh")){const pe=[...he].sort((Se,et)=>new Date(et.createdAt).getTime()-new Date(Se.createdAt).getTime()).find(Se=>!hu(Se));pe&&(Pc.current=!0,B({sessionId:pe.sessionId,variantId:pe.variantId,previewKind:"static",references:pe.references,projectPath:vn??void 0}),Ct(!1),_(`/api/variants/history/${encodeURIComponent(pe.sessionId)}/${encodeURIComponent(pe.variantId)}/preview${yr}`))}if(B(pe=>{if(!pe)return pe;const Se=he.find(et=>et.sessionId===pe.sessionId&&et.variantId===pe.variantId);return!Se||JSON.stringify(pe.references)===JSON.stringify(Se.references)?pe:{...pe,references:Se.references}}),FJ(qe.current,he))return;qe.current=he,_t(he)}catch(le){Mn.warn("Failed to load past variants",le)}})(),()=>{F=!0}},[o,vn,Ed,yr,_,B]);const Tc=m.useCallback(()=>{kc.current=!1,Ec.current=null,k(!1),C(!1),B(null),$(null),Ct(!0),x(!1),S(null),_(null),w(F=>F+1)},[$,k,C,w,_,S,B,x]),Yo=m.useCallback(F=>{if(Vt.current){Vt.current=!1;return}if(N(!0),B({sessionId:F.sessionId,variantId:F.variantId,previewKind:hu(F)?"dev_server":"static",references:F.references,projectPath:vn??void 0}),$(null),Ct(!1),hu(F)){const le=++Os.current;kc.current=!0,Ec.current={sessionId:F.sessionId,variantId:F.variantId},k(!0),C(!0),(async()=>{oe({kind:"switch"}),Ce.capture("variants_panel.history_replay_started",{sessionId:F.sessionId,variantId:F.variantId});const ke=he=>Ce.capture("variants_panel.history_replay_failed",{sessionId:F.sessionId,variantId:F.variantId,...he});try{const he=await fetch(`/api/variants/history/${encodeURIComponent(F.sessionId)}/${encodeURIComponent(F.variantId)}/run${yr}`,{method:"POST"});if(le!==Os.current)return;if(!he.ok){const{errorCode:pe}=await Ii(he);Mn.warn(`history replay failed: HTTP ${he.status} ${pe??""}`),ke({httpStatus:he.status,errorCode:pe}),Tc();return}C(!1),x(!0),S(null),_(null),w(pe=>pe+1),Ce.capture("variants_panel.history_replay_ready",{sessionId:F.sessionId,variantId:F.variantId})}catch(he){if(le!==Os.current)return;Mn.warn("history replay failed",he),ke({errorMessage:he instanceof Error?he.message:String(he)}),Tc()}finally{oe(null)}})();return}io(),x(!1),S(null),_(`/api/variants/history/${encodeURIComponent(F.sessionId)}/${encodeURIComponent(F.variantId)}/preview${yr}`)},[vn,Tc,oe,k,C,w,B,$,_,S,N,x,io,yr]);m.useEffect(()=>{if(!Ae||Ye.current)return;const F=bt.find(le=>le.sessionId===Ae.sessionId&&le.variantId===Ae.variantId);F&&(Ye.current=!0,Yo(F))},[Ae,bt,Yo]);const Cd=m.useCallback(async()=>{io();const F=()=>{N(!0),$(null),B(null),Ct(!0),os.current=null,x(!1),S(null),_(null),w(le=>le+1)};if(!Le){F();return}oe({kind:"switch"});try{const le=await fetch(`/api/variants/${Le}/preview-port`,{method:"POST",headers:{"content-type":"application/json"},body:JSON.stringify({variantId:null})});if(!le.ok){Mn.warn(`switch to original failed: HTTP ${le.status}`);return}F(),x(!0),Ce.capture("variants_panel.preview_switched",{sessionId:Le,fromVariantId:D,toVariantId:null,target:"original",armed:!1})}catch(le){Mn.warn("preview-port original switch failed",le)}finally{oe(null)}},[D,Le,$,B,w,_,S,N,x,io]),yv=m.useCallback(async F=>{var ke,he;const le=((he=(ke=F.actions)==null?void 0:ke.commit)==null?void 0:he.enabled)??F.status==="succeeded";if(!(!Le||!le)){Ce.capture("variants_panel.commit_clicked",{sessionId:Le,variantId:F.workItemId,variantLabel:F.label}),oe({kind:"commit",variantId:F.workItemId});try{const pe=await fetch(`/api/variants/${Le}/commit`,{method:"POST",headers:{"content-type":"application/json"},body:JSON.stringify({variantId:F.workItemId})});if(!pe.ok){const{message:et,errorCode:Pe}=await Ii(pe);Mn.warn(`commit failed: HTTP ${pe.status} ${Pe??""} ${et??""}`),Ce.capture("variants_panel.commit_failed",{sessionId:Le,variantId:F.workItemId,httpStatus:pe.status,errorCode:Pe??null,errorMessage:et??null}),Rt.error("Couldn't send direction",{description:et??`The server rejected the request (HTTP ${pe.status}). Try again, or pick a different direction.`});return}const Se=await pe.json().catch(()=>null);Ce.capture("variants_panel.commit_succeeded",{sessionId:Le,variantId:F.workItemId,payloadKind:(Se==null?void 0:Se.payloadKind)??null,duplicate:(Se==null?void 0:Se.duplicate)??!1}),Rt.success(`Sent "${F.label}" to your project`,{description:(Se==null?void 0:Se.payloadKind)==="project-created"?`Project created at ${(Se==null?void 0:Se.destinationPath)??"destination"}.`:"Direction diff applied to your working tree (uncommitted)."}),(Se==null?void 0:Se.payloadKind)!=="project-created"&&(_(null),x(!1),w(et=>et+1))}catch(pe){Mn.warn("commit failed",pe),Ce.capture("variants_panel.commit_failed",{sessionId:Le,variantId:F.workItemId,httpStatus:null,errorCode:"NETWORK_ERROR",errorMessage:pe instanceof Error?pe.message:String(pe)}),Rt.error("Couldn't send direction",{description:"Network or server error. Check that the Rivet backend is reachable and try again."})}finally{oe(null)}}},[Le,w,_,x]),Jt=m.useCallback(async(F,le,ke)=>{Ce.capture("variants_panel.deploy_clicked",{sessionId:F,variantId:le,variantLabel:ke});try{const he=await fetch(`/api/variants/${F}/deploy`,{method:"POST",headers:{"content-type":"application/json"},body:JSON.stringify({variantId:le,...i?{projectPath:i}:{}})});if(!he.ok){const{message:et,errorCode:Pe}=await Ii(he);return Mn.warn(`deploy failed: HTTP ${he.status} ${Pe??""} ${et??""}`),Ce.capture("variants_panel.deploy_failed",{sessionId:F,variantId:le,httpStatus:he.status,errorCode:Pe??null,errorMessage:et??null}),Rt.error("Couldn't deploy this direction",{description:et??`The server rejected the request (HTTP ${he.status}). Try again.`}),null}const pe=await he.json().catch(()=>null),Se=pe==null?void 0:pe.shareUrl;return Se?(await navigator.clipboard.writeText(Se).catch(()=>{}),Ce.capture("variants_panel.deploy_succeeded",{sessionId:F,variantId:le}),Rt.success(`"${ke}" is live — link copied`,{action:{label:"Open",onClick:()=>window.open(Se,"_blank","noopener")}}),Se):(Rt.error("Couldn't deploy this direction",{description:"The deploy host returned an unexpected response."}),null)}catch(he){return Mn.warn("deploy failed",he),Ce.capture("variants_panel.deploy_failed",{sessionId:F,variantId:le,httpStatus:null,errorCode:"NETWORK_ERROR",errorMessage:he instanceof Error?he.message:String(he)}),Rt.error("Couldn't deploy this direction",{description:"Network or server error. Check that the Rivet backend is reachable and try again."}),null}},[i]),_v=m.useCallback(async F=>{if(!Le)return;const le=ue[F.workItemId];if(le){await navigator.clipboard.writeText(le).catch(()=>{}),Rt.success("Share link copied",{action:{label:"Open",onClick:()=>window.open(le,"_blank","noopener")}});return}oe({kind:"deploy",variantId:F.workItemId});try{const ke=await Jt(Le,F.workItemId,F.label);ke&&ae(he=>({...he,[F.workItemId]:ke}))}finally{oe(null)}},[Le,ue,Jt]),Pd=m.useCallback(async()=>{if(!(!Le||Pt.length===0)){if(vr){await navigator.clipboard.writeText(vr).catch(()=>{}),Rt.success("Canvas link copied",{action:{label:"Open",onClick:()=>window.open(vr,"_blank","noopener")}});return}Ce.capture("variants_panel.deploy_clicked",{sessionId:Le,variantId:"canvas",variantLabel:"Canvas",variantCount:Pt.length}),oe({kind:"deploy-canvas"});try{const F=await fetch(`/api/variants/${Le}/canvas/deploy`,{method:"POST",headers:{"content-type":"application/json"},body:JSON.stringify({variantIds:Pt.map(Se=>Se.workItemId),...i?{projectPath:i}:{}})});if(!F.ok){const{message:Se,errorCode:et}=await Ii(F);Mn.warn(`canvas deploy failed: HTTP ${F.status} ${et??""} ${Se??""}`),Ce.capture("variants_panel.deploy_failed",{sessionId:Le,variantId:"canvas",httpStatus:F.status,errorCode:et??null,errorMessage:Se??null,variantCount:Pt.length}),Rt.error("Couldn't share this canvas",{description:Se??`The server rejected the request (HTTP ${F.status}). Try again.`});return}const le=await F.json().catch(()=>null),ke=le==null?void 0:le.shareUrl;if(!ke){Rt.error("Couldn't share this canvas",{description:"The deploy host returned an unexpected response."});return}const he=Object.fromEntries(((le==null?void 0:le.variants)??[]).filter(Se=>typeof Se.variantId=="string"&&typeof Se.shareUrl=="string").map(Se=>[Se.variantId,Se.shareUrl])),pe=Object.keys(he).length>0?{...ue,...he}:ue;pe!==ue&&ae(pe),await navigator.clipboard.writeText(ke).catch(()=>{}),Be({key:u3(Pt,pe),shareUrl:ke}),Ce.capture("variants_panel.deploy_succeeded",{sessionId:Le,variantId:"canvas",variantCount:Pt.length}),Rt.success("Canvas is live — link copied",{action:{label:"Open",onClick:()=>window.open(ke,"_blank","noopener")}})}catch(F){Mn.warn("canvas deploy failed",F),Ce.capture("variants_panel.deploy_failed",{sessionId:Le,variantId:"canvas",httpStatus:null,errorCode:"NETWORK_ERROR",errorMessage:F instanceof Error?F.message:String(F),variantCount:Pt.length}),Rt.error("Couldn't share this canvas",{description:"Network or server error. Check that the Rivet backend is reachable and try again."})}finally{oe(null)}}},[vr,Pt,ue,i,Le]),ap=m.useCallback(async F=>{const le=`${F.sessionId}:${F.variantId}`,ke=Ee[le];if(ke){await navigator.clipboard.writeText(ke).catch(()=>{}),Rt.success("Share link copied",{action:{label:"Open",onClick:()=>window.open(ke,"_blank","noopener")}});return}Qt(le);try{const he=await Jt(F.sessionId,F.variantId,F.label);he&&pt(pe=>({...pe,[le]:he}))}finally{Qt(null)}},[Ee,Jt]),Xo=m.useCallback(async F=>{if(Le){Ce.capture("variants_panel.remove_clicked",{sessionId:Le,variantId:F.workItemId,variantLabelLength:F.label.length}),oe({kind:"remove",variantId:F.workItemId});try{const le=await fetch(`/api/variants/${Le}/${F.workItemId}/remove`,{method:"POST",headers:{"content-type":"application/json"},body:"{}"});if(!le.ok){const{message:ke}=await Ii(le);Mn.warn(`remove failed: HTTP ${le.status} ${ke??""}`),Rt.error("Couldn't remove direction",{description:ke??`The server rejected the request (HTTP ${le.status}). Try again.`});return}(F.workItemId===An||F.workItemId===D)&&($(null),_(null),x(!1),w(ke=>ke+1))}catch(le){Mn.warn("remove failed",le),Rt.error("Couldn't remove direction",{description:"Network or server error. Try again."})}finally{oe(null)}}},[Le,D,An,$,_,x,w]),Td=m.useCallback(async F=>{if(!vn){Rt.error("Couldn't remove direction",{description:"No project path available."});return}Ce.capture("variants_panel.remove_past_clicked",{sessionId:F.sessionId,variantId:F.variantId});const le=`${F.sessionId}:${F.variantId}`,ke=he=>he.sessionId===F.sessionId&&he.variantId===F.variantId;oe({kind:"remove",variantId:le}),_t(he=>he.filter(pe=>!ke(pe))),G===le&&(B(null),_(null),x(!1),w(he=>he+1));try{const he=await fetch(`/api/variants/history/${encodeURIComponent(F.sessionId)}/${encodeURIComponent(F.variantId)}/remove`,{method:"POST",headers:{"content-type":"application/json"},body:JSON.stringify({projectPath:vn})});if(!he.ok){const{message:pe}=await Ii(he);_t(Se=>Se.some(ke)?Se:[...Se,F]),Rt.error("Couldn't remove direction",{description:pe??`The server rejected the request (HTTP ${he.status}). Try again.`})}}catch(he){Mn.warn("remove past failed",he),_t(pe=>pe.some(ke)?pe:[...pe,F]),Rt.error("Couldn't remove direction",{description:"Network or server error. Try again."})}finally{oe(null)}},[vn,G,B,_,x,w]),Ad=m.useCallback(F=>{ie(F)},[]),Ac=m.useCallback(F=>{if(!F.label||!F.run)return;const le=F.rows.flatMap(he=>he.kind==="active"?[he.variant]:[]),ke=F.rows.flatMap(he=>he.kind==="past"?[he.entry]:[]);le.length===0&&ke.length===0||ie({kind:"run",label:F.label,variants:le,entries:ke})},[]),Ls=m.useCallback(async()=>{if(!(!re||fe)){_e(!0);try{if(re.kind==="active")await Xo(re.variant);else if(re.kind==="past")await Td(re.entry);else{for(const F of re.variants)await Xo(F);for(const F of re.entries)await Td(F)}}finally{_e(!1),ie(null)}}},[re,fe,Xo,Td]),[lp,ls]=m.useState(null),[wv,Rd]=m.useState(null),xv=m.useCallback(F=>{Rd(F)},[]),Rc=m.useCallback(()=>{Rd(null)},[]),Mc=m.useCallback(async F=>{const le=F.trim();if(le)try{await navigator.clipboard.writeText(le),Rt.success("Copied")}catch{Rt.error("Couldn't copy")}},[]),ul=m.useCallback(async(F,le)=>{Rd(null);const ke=le.trim();if(!ke||F.kind==="original")return;if(F.kind==="active"){if(!Le||ke===F.variant.label)return;Ce.capture("variants_panel.rename",{sessionId:Le,variantId:F.variant.workItemId,labelLength:ke.length,past:!1});try{const Se=await fetch(`/api/variants/${Le}/${F.variant.workItemId}/rename`,{method:"POST",headers:{"content-type":"application/json"},body:JSON.stringify({label:ke})});if(!Se.ok){const{message:et}=await Ii(Se);Rt.error("Couldn't rename direction",{description:et??`The server rejected the request (HTTP ${Se.status}). Try again.`})}}catch(Se){Mn.warn("rename failed",Se),Rt.error("Couldn't rename direction",{description:"Network or server error. Try again."})}return}const{entry:he}=F;if(ke===he.label.trim())return;if(!vn){Rt.error("Couldn't rename direction",{description:"No project path available."});return}Ce.capture("variants_panel.rename",{sessionId:he.sessionId,variantId:he.variantId,labelLength:ke.length,past:!0});const pe=Se=>Se.sessionId===he.sessionId&&Se.variantId===he.variantId;_t(Se=>Se.map(et=>pe(et)?{...et,label:ke}:et));try{const Se=await fetch(`/api/variants/history/${encodeURIComponent(he.sessionId)}/${encodeURIComponent(he.variantId)}/rename`,{method:"POST",headers:{"content-type":"application/json"},body:JSON.stringify({label:ke,projectPath:vn})});if(!Se.ok){const{message:et}=await Ii(Se);_t(Pe=>Pe.map(rn=>pe(rn)?{...rn,label:he.label}:rn)),Rt.error("Couldn't rename direction",{description:et??`The server rejected the request (HTTP ${Se.status}). Try again.`})}}catch(Se){Mn.warn("rename failed",Se),_t(et=>et.map(Pe=>pe(Pe)?{...Pe,label:he.label}:Pe)),Rt.error("Couldn't rename direction",{description:"Network or server error. Try again."})}},[Le,vn]),[Ic,Md]=m.useState(null),bv=m.useCallback(F=>{Md(F)},[]),Id=m.useCallback(()=>{Md(null)},[]),cp=m.useCallback(async(F,le)=>{if(Md(null),!F.label||!F.run)return;const ke=F.label,he=le.trim();if(!he||he===ke)return;Ce.capture("variants_panel.rename_run",{runLabelLength:he.length});const pe="requestId"in F.run?F.run.requestId:void 0,Se=pe?F.key:FO({sessionId:F.run.sessionId,runLabel:he}),et=Se!==F.key;let Pe=!1,rn=!1;if(i!==null&&et){const ct=V0(i);Pe=ct.has(F.key),rn=ct.has(Se),Pe&&(ct.add(Se),v_(i,ct),ee())}const yn=ct=>{if(i===null||!et)return;const Ht=V0(i);ct?Ht.delete(F.key):(Pe?Ht.add(F.key):Ht.delete(F.key),rn?Ht.add(Se):Ht.delete(Se)),v_(i,Ht),ee()},Pr=new Set(F.rows.flatMap(ct=>ct.kind==="past"?[`${ct.entry.sessionId}:${ct.entry.variantId}`]:[])),us=ct=>Pr.has(`${ct.sessionId}:${ct.variantId}`);_t(ct=>ct.map(Ht=>us(Ht)?{...Ht,runLabel:he}:Ht));const ds=()=>_t(ct=>ct.map(Ht=>us(Ht)?{...Ht,runLabel:ke}:Ht));try{const ct=await fetch("/api/variants/runs/rename",{method:"POST",headers:{"content-type":"application/json"},body:JSON.stringify({sessionId:F.run.sessionId,...pe?{requestId:pe}:{},runLabel:ke,label:he,...vn?{projectPath:vn}:{}})});if(ct.ok)yn(!0);else{const{message:Ht}=await Ii(ct);ds(),yn(!1),Rt.error("Couldn't rename run",{description:Ht??`The server rejected the request (HTTP ${ct.status}). Try again.`})}}catch(ct){Mn.warn("run rename failed",ct),ds(),yn(!1),Rt.error("Couldn't rename run",{description:"Network or server error. Try again."})}},[vn,i,_t]);m.useEffect(()=>{const F=n&&!r.current;if(r.current=n,so.current!==Le){const ke=so.current===null;so.current=Le;const he=t.get(pm);if(F&&Ae&&(he==null?void 0:he.sessionId)===Ae.sessionId&&(he==null?void 0:he.variantId)===Ae.variantId||(os.current=null,Be(null),_(null),x(!1),S(null),N(),$(null),B(null),Ct(!1),Pc.current=!1,!ke))return}if(G||Ke||!An||e.active!==!0||os.current===An)return;const le=Ge.find(ke=>ke.workItemId===An);le&&(os.current=An,N(),Sc(le))},[Le,n,Ae,t,G,Ke,An,e,Ge,Sc,N,$,B,_,S,x]),m.useEffect(()=>{!Y||!Qn||(os.current=null,B(null),$(Qn.workItemId),Ct(!1))},[Qn,Y,Le,$,B]),m.useEffect(()=>{!Y||Qn||al||B(null)},[Qn,Y,al,Le,B,Ln]),m.useEffect(()=>{const F=V.trim().toLowerCase(),le=[...Ge.map(Pe=>({kind:"active",variant:Pe})),...Ln.map(Pe=>({kind:"past",entry:Pe})),...Ms?[{kind:"original"}]:[]],ke=F?le.filter(Pe=>d3(Pe,F)):le,{pinned:he,unpinned:pe}=f3(p3(l3(ke,Le),Qs),Jn,Le),Se=[...Z.has(Dw)?[]:he,...pe.flatMap(Pe=>Pe.key!==""&&Z.has(Pe.key)?[]:Pe.rows)];if(Se.length===0)return;const et=Pe=>{if(GQ())return;if(Pe.key==="Enter"){const Ht=Ge.find(ni=>ni.workItemId===lp);Ht&&(Pe.preventDefault(),Cc(Ht));return}if(Pe.key!=="ArrowUp"&&Pe.key!=="ArrowDown")return;Pe.preventDefault();const rn=D??An;let yn=rn?`live:${rn}`:null;G?yn=`past:${G}`:cl&&(yn=DO);const Pr=yn?Se.findIndex(Ht=>cd(Ht)===yn):-1;let us;if(Pr===-1?us=Pe.key==="ArrowDown"?0:Se.length-1:Pe.key==="ArrowDown"?us=Math.min(Pr+1,Se.length-1):us=Math.max(Pr-1,0),us===Pr)return;const ds=Se[us];ds.kind==="active"?Cc(ds.variant):ds.kind==="past"?Yo(ds.entry):Cd();const ct=document.querySelector(`[data-variant-key="${cd(ds)}"]`);ct instanceof HTMLElement&&ct.focus({preventScroll:!0})};return window.addEventListener("keydown",et),()=>window.removeEventListener("keydown",et)},[Ge,Ln,V,Ms,Z,Jn,Qs,Le,D,G,cl,An,lp,Cc,Yo,Cd]);const dl=Ge.find(F=>F.workItemId===An)??null,oo=G?Ln.find(F=>`${F.sessionId}:${F.variantId}`===G)??null:null,up=!!oo,Od=e.active?e.artifacts??[]:[],ao=[...(e.active?Ge:[]).map(F=>({kind:"active",variant:F})),...Ln.map(F=>({kind:"past",entry:F})),...Ms?[{kind:"original"}]:[]],Ld=V.trim().toLowerCase(),fl=Ld?ao.filter(F=>d3(F,Ld)):ao,dp=p3(l3(fl,Le),Qs),{pinned:fp,unpinned:hp}=f3(dp,Jn,Le);let Oc=null;A&&(Oc=A.source==="live"?`live:${A.variantId}`:`past:${A.sessionId}:${A.variantId}`);const Lc=new Set(Ge.map(F=>F.requestId).filter(Boolean)),ei=s.filter(F=>!Lc.has(F.requestId)),cs=ei.length>0,Ns=o&&!cs&&ao.length===0;return b.jsxs("div",{className:"flex h-full min-h-0 flex-col",children:[ao.length>0?b.jsx("div",{className:"pt-2 pr-5 pb-1 pl-3",children:b.jsxs("div",{className:"relative",children:[b.jsx(iG,{size:13,className:"text-content-muted pointer-events-none absolute top-1/2 left-2 -translate-y-1/2"}),b.jsx("input",{type:"text",value:V,onChange:F=>K(F.target.value),placeholder:"Search directions…","aria-label":"Search directions",className:"border-main-border bg-main-input/40 text-content placeholder:text-content-muted focus:ring-content-muted/40 w-full rounded-md border py-1.5 pr-2 pl-7 text-xs focus:ring-1 focus:outline-none"})]})}):null,b.jsxs("div",{className:"flex-1 [scrollbar-gutter:stable] overflow-y-auto px-3 py-2",children:[cs?b.jsx(nee,{groups:ei}):null,Ns?b.jsx(ree,{}):null,e.active&&ao.length===0&&!cs&&!Ns?b.jsx(see,{}):null,!e.active&&!cs&&!Ns&&Ln.length===0&&!Ms?b.jsx(iee,{isMCPSession:g,mcpEditor:v}):null,ao.length>0&&fl.length===0?b.jsxs("p",{className:"text-content-muted px-1 py-6 text-center text-xs",children:["No directions match “",V.trim(),"”."]}):null,fl.length>0?b.jsx(WJ,{groups:hp,pinned:fp,pinnedKeys:ro,draggedRowKey:Oc,onDropPin:Vr,onDropUnpin:Js,onTogglePin:Dn,onReorder:lr,collapsedRuns:Z,onToggleRun:j,activeVariantId:D??An,activePastKey:G,isOriginalSelected:cl,busy:Q,editingKey:wv,onSelectActive:Cc,onSelectPast:Yo,onSelectOriginal:Cd,onActivePointerDown:Bn,onPastPointerDown:as,onHover:ls,onRemove:F=>Ad({kind:"active",variant:F}),onRemovePast:F=>Ad({kind:"past",entry:F}),onStartRename:xv,onCommitRename:ul,onCancelRename:Rc,editingRunKey:Ic,onStartRunRename:bv,onCommitRunRename:cp,onCancelRunRename:Id,onRemoveRun:Ac,onCopyVariantContext:Mc,activeSessionId:e.active?e.sessionId:null,projectPath:vn}):null,e.active&&p?b.jsx(QJ,{artifacts:Od}):null]}),up&&oo?b.jsx(KJ,{entry:oo,deploying:Ot===G,deployedUrl:G?Ee[G]??null:null,onDeploy:ap,isDeployDisabled:!u}):null,!up&&e.active?b.jsx(tee,{selectedVariant:dl,busy:Q,onSend:yv,onDeploy:_v,onDeployCanvas:Pd,canDeploy:u&&(gn==null?void 0:gn.kind)==="fresh",canDeployCanvas:u&&d&&(gn==null?void 0:gn.kind)==="fresh",canSendToAgent:f,canvasVariantCount:Pt.length,canvasDeployedUrl:vr,deployedUrl:dl?ue[dl.workItemId]??null:null}):null,b.jsx(zJ,{target:re,isConfirming:fe,onCancel:()=>ie(null),onConfirm:Ls})]})},HJ=t=>t.kind==="active"?t.variant.label.trim()||"this direction":t.kind==="run"?t.label.trim()||"this run":t.entry.label.trim()||"this direction",zJ=({target:t,isConfirming:e,onCancel:n,onConfirm:r})=>{if(!t)return null;const s=HJ(t),i=t.kind==="run",o=i?t.variants.length+t.entries.length:0,l=i?"Remove run":"Remove direction";return b.jsx(tv,{open:!0,onOpenChange:u=>{!u&&!e&&n()},children:b.jsxs(nv,{children:[b.jsx(rv,{className:"z-max fixed inset-0 bg-black/40"}),b.jsx(sv,{className:"z-max border-main-border bg-main font-main fixed top-1/2 left-1/2 w-[360px] -translate-x-1/2 -translate-y-1/2 rounded-lg border shadow-2xl outline-none",children:b.jsxs("div",{className:"flex flex-col gap-3 p-4",children:[b.jsx(iv,{className:"text-content text-base font-medium",children:i?"Remove run?":"Remove direction?"}),b.jsx(ov,{className:"text-content-subtle text-sm leading-5",children:i?`This removes all ${o} directions in “${s}”.`:`This removes “${s}” from the directions list.`}),b.jsxs("div",{className:"flex justify-end gap-2 pt-1",children:[b.jsx("button",{type:"button",onClick:n,disabled:e,className:"text-content-subtle hover:bg-main-hover hover:text-content rounded-md px-3 py-1.5 text-sm font-medium transition-colors disabled:cursor-not-allowed disabled:opacity-50",children:"Cancel"}),b.jsx("button",{type:"button","aria-label":"Confirm remove direction",onClick:r,disabled:e,className:"rounded-md bg-red-500/15 px-3 py-1.5 text-sm font-medium text-red-200 transition-colors hover:bg-red-500/25 disabled:cursor-not-allowed disabled:opacity-50",children:e?"Removing...":l})]})]})})]})})},cd=t=>t.kind==="active"?`live:${t.variant.workItemId}`:t.kind==="past"?`past:${t.entry.sessionId}:${t.entry.variantId}`:DO,d3=(t,e)=>t.kind==="active"?g_(e,t.variant.label,t.variant.runLabel):t.kind==="past"?g_(e,t.entry.label,t.entry.runLabel,t.entry.brief):g_(e,Kb,jO),zO=(t,e)=>t.startsWith("live:")?`row:past:${e??""}:${t.slice(5)}`:`row:${t}`,UO=(t,e)=>zO(cd(t),e),f3=(t,e,n)=>{if(e.length===0)return{pinned:[],unpinned:t};const r=new Set(e),s=new Map,i=[];for(const l of t){const u=[];for(const d of l.rows){const f=UO(d,n);r.has(f)?s.set(f,d):u.push(d)}u.length>0&&i.push(u.length===l.rows.length?l:{...l,rows:u})}return{pinned:e.flatMap(l=>{const u=s.get(l);return u?[u]:[]}),unpinned:i}},h3=(t,e,n)=>{if(!e||e.length===0)return t;const r=new Map(e.map((o,l)=>[o,l])),s=t.filter(o=>!r.has(n(o)));if(s.length===t.length)return t;const i=t.flatMap(o=>{const l=r.get(n(o));return l===void 0?[]:[{item:o,index:l}]}).sort((o,l)=>o.index-l.index).map(({item:o})=>o);return[...s,...i]},p3=(t,e)=>{const n=t.map(r=>{const s=e.rows[r.key];return!s||s.length===0?r:{...r,rows:h3(r.rows,s,cd)}});return h3(n,e.groups,r=>r.key)},UJ=t=>t.length<=a3?t:`${t.slice(0,a3-1)}…`,BJ=(t,e)=>t.kind==="active"?e?`${e}:${t.variant.workItemId}`:null:t.kind==="past"?`${t.entry.sessionId}:${t.entry.variantId}`:null,ZJ=t=>{var s,i;const e=[t.label.trim(),(s=t.description)==null?void 0:s.trim()].filter(o=>!!o).join(`
112
+ `);if(!t.reference)return e;if(t.projectId)return`rivet variants get ${t.projectId}/${t.reference}`;const n=((i=t.projectPath)==null?void 0:i.trim())??"",r=n?` --project '${n.replace(/'/g,"'\\''")}'`:"";return`rivet variants get ${t.reference}${r}`},WJ=({groups:t,pinned:e,pinnedKeys:n,draggedRowKey:r,onDropPin:s,onDropUnpin:i,onTogglePin:o,onReorder:l,collapsedRuns:u,onToggleRun:d,activeVariantId:f,activePastKey:p,isOriginalSelected:g,busy:v,editingKey:w,onSelectActive:_,onSelectPast:x,onSelectOriginal:S,onActivePointerDown:k,onPastPointerDown:C,onHover:T,onRemove:A,onRemovePast:I,onStartRename:M,onCommitRename:R,onCancelRename:O,editingRunKey:N,onStartRunRename:D,onCommitRunRename:$,onCancelRunRename:Y,onRemoveRun:B,onCopyVariantContext:G,activeSessionId:V,projectPath:K})=>{const U=m.useRef(null),{activeIndex:ee,itemRects:Z,sessionRef:j,handlers:Q,registerItem:oe}=gO(U,{snapTolerancePx:5}),[re,ie]=m.useState(!1),[fe,_e]=m.useState(!1),ue=u.has(Dw),ae=r!==null,Oe=m.useMemo(()=>{if(!r)return null;const Ae=zO(r,V);if(n.has(Ae))return{container:Af,key:Ae};const Ye=t.find(Lt=>Lt.rows.some(Ge=>cd(Ge)===r));return Ye?{container:p_(Ye.key),key:r}:null},[r,n,t,V]),Be=(Oe==null?void 0:Oe.container)===Af,{dropTarget:Ee,onPointerMove:pt,onPointerUp:Ot}=oJ({containerRef:U,dragged:Oe,yieldToSelector:Be?void 0:"[data-pinned-drop-zone]",restrictToSelector:Be?"[data-pinned-drop-zone]":void 0,onReorder:l}),Qt=ee!==null?Z[ee]:null,bt=Ae=>Ae.kind==="active"?Ae.variant.workItemId===f:Ae.kind==="past"?`${Ae.entry.sessionId}:${Ae.entry.variantId}`===p:g,_t=(Ae,Ye,Lt,Ge)=>{const Pt=cd(Ae),is=UO(Ae,V);return b.jsx(GJ,{rowKey:Pt,row:Ae,index:Ye,isSelected:bt(Ae),isEditing:w===Pt,isPinned:n.has(is),onTogglePin:vr=>o(is,vr),reorderContainer:Lt,reorderKey:Lt===Af?is:Pt,isNested:Ge,busy:v,registerItem:oe,onSelectActive:_,onSelectPast:x,onSelectOriginal:S,onActivePointerDown:k,onPastPointerDown:C,onHover:T,onRemove:A,onRemovePast:I,onStartRename:M,onCommitRename:R,onCancelRename:O,onCopyVariantContext:G,activeSessionId:V,projectPath:K},Pt)};let qe=0;const Ke=Ae=>{if(Ae.key==="")return Ae.rows.map(Pt=>_t(Pt,qe++,p_(Ae.key),!1));const Ye=u.has(Ae.key),Lt=Ye?null:Ae.rows.map(Pt=>_t(Pt,qe++,p_(Ae.key),!0)),Ge=Ae.label;return b.jsx(qJ,{label:Ge??Kb,collapsed:Ye,onToggle:()=>d(Ae.key),directionCount:Ae.rows.length,isEditing:Ge!==null&&N===Ae.key,onStartRename:Ge!==null?()=>D(Ae.key):void 0,onCommitRename:Ge!==null?Pt=>$(Ae,Pt):void 0,onCancelRename:Y,onRemove:Ge!==null?()=>B(Ae):void 0,children:Lt},Ae.key)},Ct=e.length>0||ae;return b.jsxs("div",{ref:U,className:"relative",onMouseEnter:Q.onMouseEnter,onMouseMove:Q.onMouseMove,onMouseLeave:Q.onMouseLeave,onPointerMove:pt,onPointerUp:Ae=>{var Ye;if(Be&&Oe){const Lt=(Ye=U.current)==null?void 0:Ye.querySelector("[data-pinned-drop-zone]"),Ge=Lt==null?void 0:Lt.getBoundingClientRect();if(!(Ge!==void 0&&Ae.clientY>=Ge.top&&Ae.clientY<=Ge.bottom)){i(Oe.key);return}}Ot()},children:[Oe&&Ee?b.jsx("div",{className:"bg-content-muted pointer-events-none absolute right-1 left-1 z-20 h-0.5 rounded-full",style:{top:Ee.top}}):null,b.jsx(ks,{children:Qt&&b.jsx(wi.div,{className:"bg-hover pointer-events-none absolute z-0 rounded-md",initial:{opacity:0,top:Qt.top,left:Qt.left,width:Qt.width,height:Qt.height},animate:{opacity:1,top:Qt.top,left:Qt.left,width:Qt.width,height:Qt.height},exit:{opacity:0,transition:{duration:.06}},transition:{...Ch.fast,opacity:{duration:.08}}},j.current)}),b.jsxs("ul",{className:"relative flex flex-col gap-2",children:[b.jsx(ks,{initial:!1,children:Ct?b.jsxs(wi.li,{initial:{height:0,opacity:0},animate:{height:"auto",opacity:1},exit:{height:0,opacity:0},transition:{duration:Nw,ease:Lw},"data-pinned-drop-zone":"",className:Ut("overflow-hidden rounded-lg bg-white/[0.012] transition-shadow",ae&&"ring-content-muted/30 ring-1",ae&&re&&"ring-content-muted/70 bg-white/[0.03]"),onPointerEnter:ae?()=>ie(!0):void 0,onPointerLeave:ae?()=>ie(!1):void 0,onPointerUp:ae?()=>{ie(!1),s()}:void 0,children:[b.jsx("div",{"data-hover-dead-zone":"",children:b.jsxs("button",{type:"button",onClick:()=>d(Dw),"aria-expanded":!ue,"aria-label":`${ue?"Expand":"Collapse"} pinned items`,className:"focus-visible:ring-content-muted/40 flex w-full items-center gap-2 px-3 py-2 text-left transition-colors hover:bg-white/[0.03] focus:outline-none focus-visible:ring-1 focus-visible:ring-inset",children:[b.jsx(fw,{size:13,weight:"fill",className:"text-content-muted shrink-0"}),b.jsx("span",{className:"text-content min-w-0 flex-1 truncate text-sm font-medium",children:"Pinned"})]})}),b.jsx(ks,{initial:!1,children:!ue&&b.jsx(wi.div,{initial:{height:0,opacity:0},animate:{height:"auto",opacity:1},exit:{height:0,opacity:0},transition:{duration:Nw,ease:Lw},className:"overflow-hidden",children:e.length>0?b.jsx("ul",{className:"flex flex-col gap-2",children:e.map(Ae=>_t(Ae,qe++,Af,!1))}):null},"body")})]},"pinned-section"):null}),Ct&&t.length>0?b.jsxs("li",{className:Ut("mt-2 overflow-hidden rounded-lg bg-white/[0.012] transition-shadow",Be&&"ring-content-muted/30 ring-1",Be&&fe&&"ring-content-muted/70 bg-white/[0.03]"),onPointerEnter:Be?()=>_e(!0):void 0,onPointerLeave:Be?()=>_e(!1):void 0,onPointerUp:Be?()=>_e(!1):void 0,children:[b.jsxs("div",{"data-hover-dead-zone":"",className:"flex w-full items-center gap-2 px-3 py-2",children:[b.jsx(cG,{size:13,weight:"fill",className:"text-content-muted shrink-0"}),b.jsx("span",{className:"text-content min-w-0 flex-1 truncate text-sm font-medium",children:"Directions"})]}),b.jsx("ul",{className:"flex flex-col gap-2",children:t.map(Ae=>Ke(Ae))})]}):t.map(Ae=>Ke(Ae))]})]})},BO=({open:t,onOpenChange:e,triggerLabel:n,actions:r})=>{const{containerRef:s,onKeyDown:i}=vO({onDismiss:()=>e(!1)});return b.jsxs(zb,{open:t,onOpenChange:e,children:[b.jsx(wc,{label:n,children:b.jsx(Ub,{asChild:!0,children:b.jsx(Gi,{type:"button",variant:"ghost",size:"icon-compact","aria-label":n,onClick:o=>o.stopPropagation(),onPointerDown:o=>o.stopPropagation(),className:$O,children:b.jsx(nG,{size:15,weight:"bold"})})})}),b.jsx(Bb,{children:b.jsx(Zb,{ref:s,onKeyDown:i,role:"menu",side:"bottom",align:"end",sideOffset:4,onCloseAutoFocus:o=>o.preventDefault(),className:"bg-popover shadow-surface-4 z-[60] min-w-[160px] rounded-lg p-1",children:r.map(o=>b.jsxs("button",{type:"button",role:"menuitem","data-menu-item":!0,disabled:o.disabled,onClick:l=>{l.stopPropagation(),e(!1),o.onSelect()},onPointerDown:l=>l.stopPropagation(),className:"text-content hover:bg-hover focus:bg-hover flex w-full items-center gap-2 rounded-md px-3 py-1.5 text-xs transition-colors focus:outline-none disabled:cursor-not-allowed disabled:opacity-50",children:[o.icon,o.label]},o.key))})})]})},qJ=({label:t,collapsed:e,directionCount:n,onToggle:r,isEditing:s=!1,onStartRename:i,onCommitRename:o,onCancelRename:l,onRemove:u,children:d})=>{const f=xi(),[p,g]=m.useState(!1),v=[...i?[{key:"rename",label:"Rename",icon:b.jsx(gM,{size:13,weight:"bold"}),onSelect:i}]:[],...u?[{key:"remove",label:"Remove",icon:b.jsx(CM,{size:13,weight:"bold"}),onSelect:u}]:[]],w=e?b.jsx(sG,{size:13,weight:"fill",className:"shrink-0 text-sky-400"}):b.jsx(rG,{size:13,weight:"fill",className:"shrink-0 text-sky-400"});return s&&o&&l?b.jsxs("li",{className:"overflow-hidden rounded-lg bg-white/[0.012]",children:[b.jsxs("div",{"data-hover-dead-zone":"",className:"bg-main-input flex w-full items-center gap-2 px-3 py-2",children:[w,b.jsx("span",{className:"min-w-0 flex-1",children:b.jsx(ZO,{initial:t,onCommit:o,onCancel:l})})]}),b.jsx(ks,{initial:!1,children:!e&&b.jsx(wi.ul,{className:"overflow-hidden",children:d},"body")})]}):b.jsxs("li",{className:"overflow-hidden rounded-lg bg-white/[0.012]",children:[b.jsxs("div",{"data-hover-dead-zone":"",className:"group relative",children:[b.jsxs("button",{type:"button",onClick:_=>{if((_.metaKey||_.ctrlKey)&&v.length>0){g(!0);return}f==null||f.capture("variants_panel.folder_toggled",{isCollapsed:!e,directionCount:n}),r()},"aria-expanded":!e,"aria-label":`${e?"Expand":"Collapse"} ${t} directions`,className:"focus-visible:ring-content-muted/40 flex w-full items-center gap-2 px-3 py-2 text-left transition-colors hover:bg-white/[0.03] focus:outline-none focus-visible:ring-1 focus-visible:ring-inset",children:[w,b.jsx("span",{className:"text-content min-w-0 flex-1 truncate text-sm font-medium",children:t})]}),v.length>0&&b.jsx("div",{className:Ut("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",p&&"pointer-events-auto opacity-100"),children:b.jsx(BO,{open:p,onOpenChange:g,triggerLabel:`${t} run actions`,actions:v})})]}),b.jsx(ks,{initial:!1,children:!e&&b.jsx(wi.ul,{initial:{height:0,opacity:0},animate:{height:"auto",opacity:1},exit:{height:0,opacity:0},transition:{duration:Nw,ease:Lw},className:"overflow-hidden",children:d},"body")})]})},GJ=({rowKey:t,row:e,index:n,isSelected:r,isEditing:s,isPinned:i,onTogglePin:o,reorderContainer:l,reorderKey:u,isNested:d,busy:f,registerItem:p,onSelectActive:g,onSelectPast:v,onSelectOriginal:w,onActivePointerDown:_,onPastPointerDown:x,onHover:S,onRemove:k,onRemovePast:C,onStartRename:T,onCommitRename:A,onCancelRename:I,onCopyVariantContext:M,activeSessionId:R,projectPath:O})=>{var Oe,Be;const N=ut(RO),D=m.useRef(null);WQ(p,n,D);const[$,Y]=m.useState(!1),B=e.kind==="active",G=e.kind==="original",V=e.kind==="active"?e.variant:null,K=e.kind==="past"?e.entry:null,U=V?V.status==="succeeded":!0,ee=V?Yf(V):!0,Z=V!==null&&(V.status==="pending"||V.status==="running"),j=(V==null?void 0:V.status)==="failed",Q=(V==null?void 0:V.status)==="cancelled",oe=V!==null&&(f==null?void 0:f.kind)==="remove"&&f.variantId===V.workItemId,re=V!==null&&(((Oe=V.refinement)==null?void 0:Oe.status)==="pending"||((Be=V.refinement)==null?void 0:Be.status)==="running");let ie=Kb;V?ie=V.label||`Direction ${n+1}`:K&&(ie=K.label.trim()||"Untitled direction");let fe=jO;V?fe=V.description:K&&(fe=K.brief);const _e=fe?UJ(fe):null,ue=BJ(e,R),ae=ue?"Copy variant reference":"Copy description";return s?b.jsx("li",{ref:D,"data-proximity-index":n,"data-reorder-container":l,"data-reorder-key":u,className:"group relative z-10",children:b.jsx("div",{className:Ut("bg-main-input flex w-full items-start gap-2 rounded-md py-2 pr-3",d?"pl-[33px]":"pl-3"),children:b.jsxs("span",{className:"min-w-0 flex-1",children:[b.jsx(ZO,{initial:ie,onCommit:Ee=>A(e,Ee),onCancel:I}),_e&&b.jsx("span",{className:"text-content-muted mt-1 line-clamp-2 block text-xs leading-snug",children:_e})]})})}):b.jsxs("li",{ref:D,"data-proximity-index":n,"data-reorder-container":l,"data-reorder-key":u,className:Ut("group relative z-10 rounded-md",r&&"bg-main-input"),onMouseEnter:V?()=>S(V.workItemId):void 0,onMouseLeave:B?()=>S(null):void 0,children:[b.jsx("div",{role:"button",tabIndex:0,"data-variant-id":V==null?void 0:V.workItemId,"data-variant-key":t,onClick:Ee=>{if(Ee.metaKey||Ee.ctrlKey){Y(!0);return}const pt=window.getSelection();pt&&!pt.isCollapsed||(e.kind==="active"?g(e.variant):e.kind==="past"?v(e.entry):w())},onKeyDown:Ee=>{(Ee.key==="Enter"||Ee.key===" ")&&(Ee.preventDefault(),Ee.stopPropagation(),e.kind==="active"?g(e.variant):e.kind==="past"?v(e.entry):w())},onPointerDown:Ee=>{Ee.metaKey||Ee.ctrlKey||(e.kind==="active"?ee&&_(e.variant.workItemId,Ee):e.kind==="past"&&x(e.entry,Ee))},"aria-pressed":r,"aria-disabled":B?!1:void 0,"aria-busy":Z||re,className:Ut("flex w-full items-start gap-2 rounded-md py-2 pr-3 text-left transition-colors focus:outline-none",d?"pl-[33px]":"pl-3",ee&&"cursor-grab active:cursor-grabbing",!ee&&"cursor-pointer"),style:ee?{touchAction:"none"}:void 0,children:b.jsxs("span",{className:"min-w-0 flex-1",children:[b.jsxs("span",{className:"flex items-center gap-2 pr-12",children:[(Z||re)&&b.jsx(Gb,{className:"text-content-muted shrink-0 text-sm","data-testid":re&&!Z?"variant-refining":void 0}),b.jsx(wc,{label:"Double-click to rename",disabled:G,children:b.jsx("span",{onDoubleClick:Ee=>{Ee.stopPropagation(),G||T(t)},className:Ut("min-w-0 flex-1 truncate text-sm font-medium select-text",G?"cursor-default":"cursor-text",U||r?"text-content":"text-content-muted"),children:ie})}),j&&b.jsx(wc,{label:(V==null?void 0:V.errorMessage)??(V==null?void 0:V.errorCode)??"Failed",disabled:!(V!=null&&V.errorMessage)&&!(V!=null&&V.errorCode),children:b.jsx("span",{className:"shrink-0",children:b.jsx(m3,{label:"Failed"})})}),Q&&b.jsx(m3,{label:"Cancelled"})]}),_e&&b.jsx("span",{className:"text-content-muted mt-0.5 line-clamp-2 block cursor-text text-xs leading-snug select-text",children:_e})]})}),G?null:b.jsx(uK,{references:(V==null?void 0:V.references)??(K==null?void 0:K.references),source:B?"active":"history",sessionId:(K==null?void 0:K.sessionId)??R,variantId:(K==null?void 0:K.variantId)??(V==null?void 0:V.workItemId),projectPath:O,className:d?"pl-[33px]":"pl-3"}),b.jsxs("div",{className:Ut("absolute top-1.5 right-2 flex items-center gap-0.5 transition-opacity duration-150 motion-reduce:transition-none","pointer-events-none opacity-0 group-hover:pointer-events-auto group-hover:opacity-100 has-[:focus-visible]:pointer-events-auto has-[:focus-visible]:opacity-100",$&&"pointer-events-auto opacity-100"),children:[b.jsx(Gi,{variant:"ghost",size:"icon-compact",title:i?"Unpin direction":"Pin direction","aria-label":i?"Unpin direction":"Pin direction","aria-pressed":i,onPointerDown:Ee=>Ee.stopPropagation(),onKeyDown:Ee=>{(Ee.key!=="ArrowUp"&&Ee.key!=="ArrowDown"||Ee.altKey||Ee.ctrlKey||Ee.metaKey||Ee.shiftKey)&&Ee.stopPropagation()},onClick:Ee=>{Ee.stopPropagation(),o("button")},className:$O,children:b.jsx(fw,{weight:i?"fill":"bold"})}),b.jsx(BO,{open:$,onOpenChange:Y,triggerLabel:"Direction actions",actions:[...fe||ue?[{key:"copy",label:ae,icon:b.jsx(wh,{size:13,weight:"bold"}),onSelect:()=>M(ZJ({label:ie,description:fe,reference:ue,projectId:N,projectPath:O}))}]:[],{key:"pin",label:i?"Unpin":"Pin",icon:b.jsx(fw,{size:13,weight:"bold"}),onSelect:()=>o("menu")},...G?[]:[{key:"rename",label:"Rename",icon:b.jsx(gM,{size:13,weight:"bold"}),onSelect:()=>T(t)},{key:"remove",label:"Remove",icon:b.jsx(CM,{size:13,weight:"bold"}),disabled:oe,onSelect:()=>{e.kind==="active"?k(e.variant):e.kind==="past"&&C(e.entry)}}]]})]})]})},ZO=({initial:t,onCommit:e,onCancel:n})=>{const[r,s]=m.useState(t),i=m.useRef(!1),o=m.useCallback(u=>{u&&(u.focus(),u.select())},[]),l=u=>{i.current||(i.current=!0,u?e(r):n())};return b.jsx("input",{ref:o,type:"text",value:r,maxLength:120,"aria-label":"Rename direction",onChange:u=>s(u.target.value),onKeyDown:u=>{u.stopPropagation(),u.key==="Enter"?(u.preventDefault(),l(!0)):u.key==="Escape"&&(u.preventDefault(),l(!1))},onBlur:()=>l(!0),onClick:u=>u.stopPropagation(),onPointerDown:u=>u.stopPropagation(),className:"border-content-muted/40 bg-main text-content focus:ring-content-muted/50 w-full rounded border px-1.5 py-0.5 text-sm font-medium focus:ring-1 focus:outline-none"})},m3=({label:t})=>b.jsx("span",{className:"bg-main-input text-content-muted shrink-0 rounded-full px-1.5 py-0.5 text-[10px] font-medium tracking-wide uppercase",children:t}),KJ=({entry:t,deploying:e,deployedUrl:n,onDeploy:r,isDeployDisabled:s=!1})=>{const o=e?"Deploying…":n?"Copy link":"Share";return b.jsxs("div",{className:"border-main-border bg-main-light flex shrink-0 items-center justify-between gap-3 border-t px-3 py-4",children:[b.jsxs("div",{className:"min-w-0",children:[b.jsx("div",{className:"text-content truncate text-sm font-medium",children:t.label.trim()||"Untitled direction"}),n?b.jsx("div",{className:"text-content-muted text-[11px]",children:"Deployed — share link ready"}):null]}),b.jsxs("button",{type:"button",onClick:()=>r(t),disabled:e||s,title:n?`Copy share link (${n})`:"Deploy this direction and get a public link to share",className:"border-main-border text-content hover:bg-main-input flex shrink-0 items-center gap-1 rounded-md border px-2 py-1.5 text-xs font-medium transition-colors disabled:cursor-not-allowed disabled:opacity-50",children:[n&&!e?b.jsx(wh,{size:12,weight:"bold"}):null,o]})]})},YJ={agent_browser:"Browser extracted",cache:"Cached",static:"Bundled catalog",manual:"Manual"},XJ={design_context:"DESIGN.md",source_context:"Source",qa_report:"QA",asset:"Asset"},QJ=({artifacts:t})=>{const[e,n]=m.useState(null),r=m.useMemo(()=>e&&t.some(i=>i.id===e)?e:null,[t,e]);if(t.length===0)return null;const s=i=>{n(o=>o===i?null:i)};return b.jsxs("section",{"aria-label":"Directions session artifacts",className:"mt-4",children:[b.jsx("div",{className:"flex shrink-0 items-center px-3 py-2",children:b.jsx("span",{className:"text-content truncate text-sm font-medium",children:"Artifacts"})}),b.jsx("ul",{className:"mt-2 space-y-1 px-1",children:t.map(i=>b.jsx(JJ,{artifact:i,isExpanded:i.id===r,onToggle:()=>s(i.id)},i.id))})]})},JJ=({artifact:t,isExpanded:e,onToggle:n})=>{const r=XJ[t.kind],s=t.source?YJ[t.source]:null,i=[t.kind==="design_context"?null:s,t.summary].filter(Boolean).join(" · "),o=t.kind==="design_context"&&!!t.viewUrl,l=`${e?"Hide":"View"} ${r} artifact${t.label?`: ${t.label}`:""}`;return o?b.jsx("li",{className:"border-main-border rounded-md border",children:b.jsxs("div",{className:"flex w-full items-center justify-between gap-2 px-3 py-2 text-left text-xs",children:[b.jsxs("span",{className:"flex min-w-0 flex-1 flex-col",children:[b.jsxs("span",{className:"flex items-center gap-2",children:[b.jsx("span",{className:"border-content-muted/30 bg-main-input text-content-muted shrink-0 rounded-full border px-2 py-0.5 text-[9px] font-semibold tracking-wide uppercase",children:r}),b.jsx("span",{className:"text-content truncate text-xs font-medium",children:t.label})]}),i?b.jsx("span",{className:"text-content-muted mt-0.5 truncate text-[11px]",children:i}):null]}),b.jsx("a",{href:t.viewUrl,target:"_blank",rel:"noreferrer",onClick:()=>{Ce.capture("visual_editor_design_context_opened",{context_kind:"design_system",artifact_source:t.source})},"aria-label":`Open ${r} artifact${t.label?`: ${t.label}`:""}`,className:"text-content-muted hover:bg-main-input hover:text-content focus-visible:ring-content-muted/40 shrink-0 rounded p-1 transition-colors focus:outline-none focus-visible:ring-1",children:b.jsx(Yq,{className:"h-3.5 w-3.5",weight:"bold"})})]})}):b.jsxs("li",{className:"border-main-border rounded-md border",children:[b.jsxs("button",{type:"button",onClick:n,"aria-expanded":e,"aria-label":l,className:"hover:bg-main-input flex w-full items-center justify-between gap-2 px-3 py-2 text-left text-xs transition-colors",children:[b.jsxs("span",{className:"flex min-w-0 flex-1 flex-col",children:[b.jsxs("span",{className:"flex items-center gap-2",children:[b.jsx("span",{className:"text-content-muted text-[10px] font-semibold tracking-wide uppercase",children:r}),b.jsx("span",{className:"text-content truncate text-xs font-medium",children:t.label})]}),i?b.jsx("span",{className:"text-content-muted mt-0.5 truncate text-[11px]",children:i}):null]}),b.jsx("span",{className:"text-content-muted shrink-0 text-[11px]",children:e?"Hide":"View"})]}),e?b.jsx("div",{className:"border-main-border bg-main-light border-t px-3 py-2",children:b.jsx(eee,{artifact:t})}):null]})},eee=({artifact:t})=>b.jsxs("div",{className:"text-content-muted space-y-1 text-[11px]",children:[t.summary?b.jsx("p",{children:t.summary}):null,t.path?b.jsxs("p",{children:["Stored at ",t.path]}):null,!t.summary&&!t.path?b.jsx("p",{children:"No inline content available for this artifact."}):null]}),tee=({selectedVariant:t,busy:e,onSend:n,onDeploy:r,onDeployCanvas:s,canDeploy:i,canDeployCanvas:o,canSendToAgent:l,canvasVariantCount:u,canvasDeployedUrl:d,deployedUrl:f})=>{var M,R,O,N;const p=t?((R=(M=t.actions)==null?void 0:M.commit)==null?void 0:R.enabled)??t.status==="succeeded":!1,g=p&&e===null,v=(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),_=(e==null?void 0:e.kind)==="deploy-canvas",x=!i||!p||e!==null,S=o&&u>0,C=w?"Deploying…":f?"Copy link":"Share",A=_?"Sharing…":d?"Copy canvas link":"Share canvas",I=v?"Applying…":"Apply to project";return b.jsxs("div",{className:"border-main-border bg-main-light flex shrink-0 items-center justify-between gap-3 border-t px-3 py-4",children:[b.jsx("div",{className:"min-w-0",children:t?b.jsxs(b.Fragment,{children:[b.jsx("div",{className:"text-content truncate text-sm font-medium",children:t.label.trim()||"Untitled direction"}),f?b.jsx("div",{className:"text-content-muted text-[11px]",children:"Deployed — share link ready"}):null]}):null}),b.jsxs("div",{className:"flex shrink-0 items-center gap-2",children:[b.jsx(OO,{primaryLabel:C,primaryIcon:f&&!w?wh:void 0,primaryAction:()=>{t&&r(t)},isDisabled:x,isDropdownDisabled:e!==null,isLoading:w,loadingLabel:"Deploying…",dropdownAriaLabel:"More share actions",dropdownItems:S?[{label:A,icon:d&&!_?wh:void 0,onClick:s,isDisabled:e!==null}]:[]}),l?b.jsx("button",{type:"button",onClick:()=>{t&&n(t)},disabled:!g,title:(N=(O=t==null?void 0:t.actions)==null?void 0:O.commit)==null?void 0:N.reason,className:"bg-secondary text-secondary-foreground hover:bg-accent rounded-md px-2 py-1.5 text-xs font-medium transition-colors disabled:cursor-not-allowed disabled:opacity-50",children:I}):null]})]})},WO=()=>b.jsx("div",{"data-testid":"direction-skeleton-row","aria-hidden":"true",className:"flex w-full items-start rounded-md px-3 py-2",children:b.jsxs("span",{className:"min-w-0 flex-1",children:[b.jsxs("span",{className:"flex items-center gap-2",children:[b.jsx(Gb,{className:"text-content-muted shrink-0 text-sm"}),b.jsx("span",{className:"bg-muted-foreground/15 h-3.5 w-28 animate-pulse rounded"})]}),b.jsx("span",{className:"mt-1.5 flex",children:b.jsx("span",{className:"bg-muted-foreground/10 h-2.5 w-full max-w-[14rem] animate-pulse rounded"})})]})}),nee=({groups:t})=>b.jsx("div",{className:"space-y-0.5",children:t.flatMap(e=>Array.from({length:Math.max(1,e.count)}).map((n,r)=>b.jsx(WO,{},`${e.requestId}-${r}`)))}),ree=()=>b.jsx("div",{"data-testid":"direction-boot-skeletons",className:"space-y-0.5",children:Array.from({length:3}).map((t,e)=>b.jsx(WO,{},e))}),see=()=>b.jsxs("div",{className:"flex flex-col items-center gap-2 px-4 py-8 text-center",children:[b.jsx("div",{className:"text-content text-sm",children:"No directions yet"}),b.jsx("div",{className:"text-content-muted text-xs",children:"They’ll appear here as they generate."})]}),g3="Try different ways to create a dropdown that feels fluid and dynamic",iee=({isMCPSession:t=!1,mcpEditor:e=null})=>{const[n,r]=m.useState(!1),s=PJ(e),i=t?s:"your coding agent",o=()=>{navigator.clipboard.writeText(g3).then(()=>{r(!0),setTimeout(()=>r(!1),2e3)})};return b.jsxs("div",{className:"flex flex-col items-start gap-3 px-2 py-2",children:[b.jsx("p",{className:"text-content text-sm font-medium",children:"Create your first direction"}),b.jsxs("p",{className:"text-content-muted text-xs",children:["Use ",i," to generate directions."]}),b.jsxs("div",{className:"w-full",children:[b.jsx("p",{className:"text-content-muted mb-2 text-xs",children:"Here's a sample prompt to use:"}),b.jsxs("div",{className:"border-main-border bg-main-input relative rounded-md border px-3 py-2.5 pr-8",children:[b.jsxs("p",{className:"text-content-muted text-xs leading-snug",children:["“",g3,"”"]}),b.jsx("button",{type:"button",onClick:o,className:"text-content-muted hover:bg-main-border hover:text-content absolute top-2 right-2 rounded p-0.5 transition-colors",title:"Copy to clipboard",children:n?b.jsx(tG,{className:"h-3.5 w-3.5 text-emerald-500",weight:"bold"}):b.jsx(wh,{className:"h-3.5 w-3.5",weight:"bold"})})]})]})]})},oee="rivet:show-projects",aee=t=>{const e=new URLSearchParams(t),n=e.get("libraryOrigin");if(e.get("library")!=="1"||!n)return null;try{const r=new URL(n);return r.protocol!=="http:"&&r.protocol!=="https:"?null:r.origin}catch{return null}},lee=({onClose:t,libraryOrigin:e})=>{const n=xi(),r=ut(kO),s=ut(qb),i=aee(window.location.search),o=window.parent!==window&&i!==null,l=(s==null?void 0:s.split(/[\\/]/).filter(Boolean).pop())??"Project";if(!t)return null;let u=r?b.jsx("span",{className:"text-content min-w-0 truncate text-sm font-medium",title:r,children:r}):b.jsx("span",{});if(o||e){const d=b.jsxs("ol",{className:"flex min-w-0 items-center gap-1 text-xs",children:[b.jsx("li",{className:"shrink-0",children:b.jsx("button",{type:o?"button":"submit",name:o?void 0:"view",value:o?void 0:"projects",onClick:()=>{o&&i?window.parent.postMessage(oee,i):n==null||n.capture("library_view_changed",{view:"projects"})},className:"text-content-subtle hover:bg-main-input hover:text-content focus-visible:outline-content rounded px-1 py-1 focus-visible:outline focus-visible:outline-2",children:"Projects"})}),b.jsx("li",{"aria-hidden":!0,className:"text-content-subtle shrink-0",children:b.jsx(Jq,{className:"h-3 w-3"})}),b.jsx("li",{className:"min-w-0",children:b.jsx("span",{"aria-current":"page",title:l,className:"text-content block truncate font-medium",children:l})})]});u=b.jsx("nav",{"aria-label":"Project breadcrumb",className:"ph-no-capture min-w-0 flex-1","data-rivet-private":!0,children:o?d:b.jsx("form",{action:"/api/library/browser-launches",method:"post",children:d})})}return b.jsxs("div",{className:"border-main-border bg-main-light z-10 flex flex-shrink-0 items-center justify-between gap-2 border-b px-2.5 py-2.5",children:[u,b.jsx(wc,{label:"Close panel",side:"bottom",children:b.jsx("button",{onClick:t,"aria-label":"Close panel",className:"text-content-subtle hover:bg-main-input hover:text-content flex h-6 w-6 flex-shrink-0 items-center justify-center rounded p-1 transition-colors",children:b.jsx(oG,{className:"h-4 w-4",weight:"bold"})})})]})},Ya=(t,e={})=>{if(!window.location.pathname.startsWith("/rivet/library"))return fetch(t,e);const n=new Headers(e.headers);return n.set("Authorization",aH()),fetch(t,{...e,headers:n})},cee=5e3,uee=()=>{const t=window.location.pathname.startsWith("/rivet/library");return nh({queryKey:["rivet-account"],queryFn:async({signal:e})=>{const n=await Ya(t?"/api/account":"/api/config",{signal:e});if(!n.ok)throw new Error("Could not load your account.");if(t)return n.json();const r=await n.json();return{isAuthenticated:r.agentModeAvailable,name:r.name,email:r.email,userId:r.userId}},refetchInterval:cee,retry:!1})},xg="rivet_just_signed_in",dee=t=>{const e=t.toLowerCase();return e.includes("timed out")?"timeout":e.includes("pop-up blocked")?"popup_blocked":e.includes("window was closed")?"popup_closed":e.includes("store session")?"credential_store_failed":"provider_failed"},__=({outcome:t,authAttemptId:e,startedAt:n,now:r,failureReason:s,entryPoint:i="editor_gate"})=>({event:`visual_editor_auth_${t}`,properties:{auth_attempt_id:e,duration_ms:r-n,entry_point:i,method:"google_oauth",...s?{failure_reason:s}:{}}}),v3=Rs("useLogin"),fee=2e3,hee=60,y3="Connecting to Google...",_3="https://rivet-proxy.onrender.com",pee=`<!doctype html>
113
+ <html lang="en">
114
+ <head>
115
+ <meta charset="utf-8" />
116
+ <meta name="viewport" content="width=device-width, initial-scale=1" />
117
+ <title>${y3}</title>
118
+ <style>
119
+ :root { color-scheme: light dark; }
120
+ body {
121
+ margin: 0;
122
+ min-height: 100vh;
123
+ display: grid;
124
+ place-items: center;
125
+ font-family: Inter, system-ui, -apple-system, Segoe UI, sans-serif;
126
+ background: #111215;
127
+ color: #f3f4f6;
128
+ }
129
+ .panel {
130
+ border: 1px solid rgba(255, 255, 255, 0.16);
131
+ border-radius: 12px;
132
+ padding: 18px 22px;
133
+ background: rgba(255, 255, 255, 0.06);
134
+ font-size: 14px;
135
+ }
136
+ </style>
137
+ </head>
138
+ <body>
139
+ <div class="panel">${y3}</div>
140
+ </body>
141
+ </html>`,mee=On({success:mh(),authUrl:Je().optional(),sessionId:Je().optional(),pollSecret:Je().optional(),error:Je().optional(),message:Je().optional()}),gee=On({success:mh(),token:Je().optional(),refreshToken:Je().optional(),user:On({id:Je().optional(),email:Je().optional()}).optional(),error:Je().optional(),message:Je().optional()}),qO=(t="editor_gate",e)=>{const n=xi(),[r,s]=m.useState(!1),[i,o]=m.useState(null);return{startLogin:m.useCallback(async()=>{var g;const u=globalThis.crypto.randomUUID(),d=Date.now();s(!0),o(null);const f=__({outcome:"started",authAttemptId:u,entryPoint:t,startedAt:d,now:d});n==null||n.capture(f.event,f.properties);let p=null;try{if(p=window.open("","_blank"),!p)throw new Error("Pop-up blocked. Please allow pop-ups and try again.");try{p.document.open(),p.document.write(pee),p.document.close()}catch(x){v3.warn("Failed to render loading state in auth popup:",x)}const v=await fetch(`${_3}/api/auth/google/start`,{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({source:"core"})}),w=mee.safeParse(await v.json());if(!w.success)throw new Error("Invalid Google login response");const _=w.data;if(!v.ok||!_.success||!_.authUrl||!_.sessionId||!_.pollSecret)throw new Error(_.error||_.message||"Failed to start Google login");if(p.closed)throw new Error("Sign-in window was closed before Google login started.");p.location.href=_.authUrl;for(let x=0;x<hee;x+=1){if(p.closed)throw new Error("Sign-in window was closed before authentication completed.");const S=await fetch(`${_3}/api/auth/google/token`,{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({session:_.sessionId,pollSecret:_.pollSecret})}),k=gee.safeParse(await S.json());if(!k.success)throw new Error("Invalid Google token response");const C=k.data;if(C.success&&C.token&&((g=C.user)!=null&&g.email)){const T={email:C.user.email,token:C.token,refreshToken:C.refreshToken,userId:C.user.id};if(e)await e(T);else if(!(await Ya("/api/auth/store",{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify(T)})).ok)throw new Error("Signed in, but failed to store session locally.");p.close(),window.sessionStorage.setItem(xg,"1");const A=__({outcome:"completed",authAttemptId:u,entryPoint:t,startedAt:d,now:Date.now()});n==null||n.capture(A.event,A.properties),window.location.reload();return}if(C.error&&C.error!=="Pending")throw new Error(C.error||"Google login failed");await new Promise(T=>setTimeout(T,fee))}throw new Error("Authentication timed out. Please try again.")}catch(v){p&&!p.closed&&p.close();const w=v instanceof Error?v.message:"Failed to start login flow";v3.warn("Login failed:",w);const _=__({outcome:"failed",authAttemptId:u,entryPoint:t,startedAt:d,now:Date.now(),failureReason:dee(w)});n==null||n.capture(_.event,_.properties),o(w),s(!1)}},[n,t,e]),isStartingLogin:r,loginError:i}},vee=Rs("useIntegrations"),yee=On({provider:Je(),status:Je(),externalUsername:Je().nullable(),connectedAt:Je()}),_ee=On({integrations:sd(yee).optional()}),wee=On({authUrl:Je().min(1).optional(),error:Je().optional()}),xee=On({error:Je().optional()}),w_=["integrations"],bee="rivet:connect-result",See=t=>typeof t=="object"&&t!==null&&t.type===bee,kee=ft(null),w3=async()=>{const t=await Ya("/api/integrations");if(!t.ok)throw new Error(`Failed to load integrations (${t.status})`);return _ee.parse(await t.json()).integrations??[]},Eee=()=>{const t=EP(),[e,n]=yA(kee),r=nh({queryKey:w_,queryFn:w3,staleTime:1e4}),s=m.useCallback(async()=>(await t.invalidateQueries({queryKey:w_,refetchType:"none"}),t.fetchQuery({queryKey:w_,queryFn:w3})),[t]),i=m.useCallback(async l=>{const u=window.open("","_blank","width=560,height=720");if(!u)throw new Error("Popup blocked. Allow popups to connect.");n(l);try{const d=await Ya(`/api/integrations/${l}/connect`,{method:"POST"}),f=wee.safeParse(await d.json().catch(()=>({}))),p=f.success?f.data:{};if(!d.ok||!p.authUrl)throw u.close(),new Error(p.error||`Could not connect ${l}`);return u.location.href=p.authUrl,await new Promise(g=>{let v=!1,w=null;const _=async(S,k=!1)=>{if(!v){v=!0,window.removeEventListener("message",x),w&&clearInterval(w);try{const T=(await s()).some(A=>A.provider===l&&A.status==="connected");g(k&&T?"connected":S)}catch{g(S)}}},x=S=>{if(See(S.data)&&S.data.provider===l){if(S.data.status==="error"){vee.warn(`Connect failed for ${l}:`,S.data.message),_("failed");return}_("connected")}};window.addEventListener("message",x),w=setInterval(()=>{u.closed&&_("closed",!0)},500)})}finally{n(null)}},[s,n]),o=m.useCallback(async l=>{n(l);try{const u=await Ya(`/api/integrations/${l}`,{method:"DELETE"});if(!u.ok){const d=xee.safeParse(await u.json().catch(()=>({}))),f=d.success?d.data:{};throw new Error(f.error||`Could not disconnect ${l}`)}await s()}finally{n(null)}},[s,n]);return{integrations:r.data??[],isLoading:r.isPending,error:r.error instanceof Error?r.error.message:null,pendingProvider:e,connect:i,disconnect:o,refetch:s}},Il=({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}:{}}}),np=async(t,e="GET",n)=>{if(window.location.pathname.startsWith("/rivet/library"))return uH(t,{method:e,body:n});const r=await Ya(t.replace(/^\/profile/,"/api/reference-profiles"),{method:e,headers:{"Content-Type":"application/json"},...n!==void 0?{body:JSON.stringify(n)}:{}}),s=await r.text();let i;try{i=JSON.parse(s)}catch{throw new Error(`Reference profile request failed (${r.status})`)}if(!r.ok)throw new Error(i.error??`Request failed (${r.status})`);return i},GO=()=>np("/profile"),Cee=t=>nh({queryKey:["cosmos-profile"],queryFn:GO,enabled:t}),Pee=t=>np("/profile/discoveries","POST",{url:t}),Tee=({discoveryId:t,collectionIds:e,runtime:n})=>np("/profile/import-plans","POST",{discoveryId:t,collectionIds:e,runtime:n}),Aee=t=>np("/profile","PATCH",{isEnabled:!0,runtime:t}),Ree=t=>np(`/profile/import-plans/${t.id}/imports`,"POST",{revision:t.revision,isApproved:!0}),jw=Je().regex(/^[1-9]\d{0,15}$/).refine(t=>Number.isSafeInteger(Number(t))),Mee=Je().min(1).max(4096),KO=t=>{const e=()=>new Error("Use an HTTPS Cosmos profile URL such as https://www.cosmos.so/username");let n;try{n=new URL(t)}catch{throw e()}const r=n.pathname.split("/").filter(Boolean);if(n.protocol!=="https:"||n.username||n.password||n.port||!["cosmos.so","www.cosmos.so"].includes(n.hostname)||r.length!==1)throw e();let s;try{s=decodeURIComponent(r[0])}catch{throw e()}if(!/^[a-zA-Z0-9_.-]{1,100}$/.test(s)||["e","login","signup","explore","search","collections","settings","api","profile"].includes(s.toLowerCase()))throw e();return{username:s,url:`https://www.cosmos.so/${encodeURIComponent(s)}`}};Je().max(2048).transform((t,e)=>{try{return KO(t).url}catch(n){return e.addIssue({code:xe.custom,message:n instanceof Error?n.message:"Invalid Cosmos profile URL"}),sH}});const Iee=t=>{const e=()=>new Error("Use an HTTPS Cosmos collection URL such as https://www.cosmos.so/owner/collection");let n;try{n=new URL(t)}catch{throw e()}const r=n.pathname.split("/").filter(Boolean);if(n.protocol!=="https:"||n.username||n.password||n.port||!["cosmos.so","www.cosmos.so"].includes(n.hostname)||r.length<2||r.length>3||r[0]==="e")throw e();let s;try{s=r.map(i=>decodeURIComponent(i))}catch{throw e()}if(s.some(i=>!i.length||i.length>300||/[/\\\p{Cc}]/u.test(i)))throw e();return{ownerUsername:s[0],slug:s[1],subcollectionSlug:s[2],url:`https://www.cosmos.so/${s.map(encodeURIComponent).join("/")}`}},Oee=Je().url().refine(t=>{const e=new URL(t);return e.protocol==="https:"&&e.hostname==="cdn.cosmos.so"&&!e.username&&!e.password&&!e.port}),Lee=On({id:jw,title:Je().min(1).max(500),url:Je().url().transform(t=>Iee(t).url),children:sd(jw)}),Nee=On({id:jw,url:Je().url(),title:Je().max(1e3),text:Je().max(1e5),author:Je().nullable(),owner:Je().nullable(),sourceUrl:Je().url().nullable(),images:sd(On({url:Oee,representation:jg(["image","video-cover"])})).max(100),unsupportedReason:Je().optional()}),Dee=On({collection:Lee,elements:sd(Nee),total:cA().int().nonnegative(),nextCursor:Mee.nullable()});rH("status",[Dee.extend({status:Zk("ok")}),On({status:Zk("error"),message:Je(),reason:jg(["rate_limited","provider_unavailable","collection_unavailable"]).optional(),retryAfterMs:cA().nonnegative().optional()})]);const jee=({isOpen:t,onClose:e,onImported:n})=>{const[r,s]=m.useState(""),[i,o]=m.useState(null),[l,u]=m.useState([]),[d,f]=m.useState(""),[p,g]=m.useState(null),[v,w]=m.useState(null),[_,x]=m.useState(!1),S=m.useRef(0),k=xi(),C=()=>{S.current+=1,s(""),o(null),u([]),f(""),g(null),w(null),x(!1)},T=()=>{k==null||k.capture("visual_editor_cosmos_modal_closed"),C(),e()},A=async O=>{O.preventDefault(),w(null);let N;try{N=KO(r.trim()).url}catch($){w($ instanceof Error?$.message:"Invalid Cosmos profile URL");return}k==null||k.capture("visual_editor_cosmos_discovery_started");const D=++S.current;x(!0);try{const $=await Pee(N);if(D!==S.current)return;o($),u([]),k==null||k.capture("visual_editor_cosmos_discovery_completed",{collection_count:$.collections.length})}catch($){if(D!==S.current)return;w($ instanceof Error?$.message:"Could not find Cosmos profile"),k==null||k.capture("visual_editor_cosmos_discovery_failed")}finally{D===S.current&&x(!1)}},I=async()=>{if(!i||l.length===0||!d)return;w(null),k==null||k.capture("visual_editor_cosmos_plan_started",{collection_count:l.length,runtime:d});const O=++S.current;x(!0);try{const N=await Tee({discoveryId:i.id,collectionIds:l,runtime:d});if(O!==S.current)return;g(N),k==null||k.capture("visual_editor_cosmos_plan_completed",{collection_count:N.collectionCount,reference_count:N.referenceCount})}catch(N){if(O!==S.current)return;w(N instanceof Error?N.message:"Could not prepare import plan"),k==null||k.capture("visual_editor_cosmos_plan_failed")}finally{O===S.current&&x(!1)}},M=async()=>{if(!p||!d)return;w(null),k==null||k.capture("visual_editor_cosmos_import_started",{collection_count:p.collectionCount,reference_count:p.referenceCount});const O=++S.current;x(!0);try{if((await GO()).profile.isEnabled||await Aee(d),await Ree(p),k==null||k.capture("visual_editor_cosmos_import_completed",{reference_count:p.referenceCount}),n(),O!==S.current)return;C(),e()}catch(N){if(k==null||k.capture("visual_editor_cosmos_import_failed"),O!==S.current)return;w(N instanceof Error?N.message:"Could not start Cosmos import")}finally{O===S.current&&x(!1)}},R=O=>{u(N=>N.includes(O)?N.filter(D=>D!==O):[...N,O]),k==null||k.capture("visual_editor_cosmos_collection_toggled")};return b.jsx(tv,{open:t,onOpenChange:O=>!O&&T(),children:b.jsxs(nv,{children:[b.jsx(rv,{className:"z-max fixed inset-0 bg-black/60"}),b.jsxs(sv,{className:"z-max border-main-border bg-main font-main fixed top-1/2 left-1/2 max-h-[min(680px,calc(100vh-32px))] w-[min(440px,calc(100vw-32px))] -translate-x-1/2 -translate-y-1/2 overflow-y-auto rounded-lg border shadow-2xl outline-none",children:[b.jsxs("div",{className:"border-main-border bg-main-light flex items-center justify-between rounded-t-lg border-b px-4 py-2",children:[b.jsx(iv,{className:"text-content text-base font-medium",children:"Connect Cosmos"}),b.jsx(Gi,{onClick:T,title:"Close","aria-label":"Close",variant:"ghost",size:"icon-compact",children:b.jsx(vb,{className:"h-4 w-4",weight:"bold"})})]}),b.jsxs("div",{className:"space-y-4 p-4",children:[b.jsx(ov,{className:"text-content-subtle text-sm",children:"Add public collections from a Cosmos profile to your design references."}),i?null:b.jsxs("form",{onSubmit:O=>void A(O),className:"space-y-4",children:[b.jsx("label",{className:"text-content block text-sm font-medium",htmlFor:"cosmos-profile-url",children:"Cosmos profile URL"}),b.jsx("input",{id:"cosmos-profile-url",type:"url",required:!0,autoFocus:!0,value:r,onChange:O=>s(O.target.value),placeholder:"https://www.cosmos.so/username",className:"border-main-border bg-main-input text-content placeholder:text-content-muted focus:border-secondary w-full rounded-md border px-3 py-2 text-sm outline-none"}),b.jsx("button",{type:"submit",disabled:_,className:"bg-secondary text-secondary-foreground hover:bg-accent rounded-md px-4 py-2 text-sm font-medium disabled:opacity-50",children:_?"Finding collections…":"Continue"})]}),i&&!p?b.jsxs("div",{className:"space-y-4",children:[b.jsxs("p",{className:"text-content text-sm font-medium",children:["Choose collections from"," ",i.profile.title||i.profile.username]}),b.jsx("div",{className:"border-main-border max-h-60 divide-y overflow-y-auto rounded-md border",children:i.collections.map(O=>b.jsxs("label",{className:"text-content hover:bg-main-light flex cursor-pointer items-center gap-3 px-3 py-2 text-sm",children:[b.jsx("input",{type:"checkbox",checked:l.includes(O.id),disabled:_,onChange:()=>R(O.id)}),b.jsx("span",{className:"min-w-0 flex-1 truncate",children:O.title}),b.jsx("span",{className:"text-content-muted text-xs",children:O.total??"—"})]},O.id))}),i.collections.length===0?b.jsx("p",{className:"text-content-muted text-sm",children:"No public collections found for this profile."}):null,b.jsxs("label",{className:"text-content flex items-center justify-between gap-3 text-sm",children:["Analysis runtime",b.jsxs("select",{value:d,disabled:_,onChange:O=>{const N=O.target.value;f(N),k==null||k.capture("visual_editor_cosmos_runtime_selected",{runtime:N})},className:"border-main-border bg-main-input rounded-md border px-2 py-1.5",children:[b.jsx("option",{value:"",disabled:!0,children:"Select a runtime"}),b.jsx("option",{value:"codex",children:"Codex"}),b.jsx("option",{value:"claude",children:"Claude"}),b.jsx("option",{value:"cursor",children:"Cursor"})]})]}),b.jsx("button",{type:"button",onClick:()=>void I(),disabled:_||l.length===0||!d,className:"bg-secondary text-secondary-foreground hover:bg-accent rounded-md px-4 py-2 text-sm font-medium disabled:opacity-50",children:_?"Preparing plan…":"Review import plan"}),b.jsx("button",{type:"button",onClick:()=>{k==null||k.capture("visual_editor_cosmos_profile_changed"),C()},disabled:_,className:"text-content-muted hover:text-content ml-3 text-sm",children:"Use another profile"})]}):null,p?b.jsxs("div",{className:"space-y-4 text-sm",children:[b.jsxs("p",{className:"text-content",children:[p.collectionCount," ",p.collectionCount===1?"collection":"collections"," ·"," ",p.referenceCount," ",p.referenceCount===1?"reference":"references"," ·"," ",p.imageCount," ",p.imageCount===1?"image":"images"]}),b.jsx("p",{className:"text-content-subtle",children:p.scopeDisclosure}),b.jsx("p",{className:"text-content-subtle",children:p.usageDisclosure}),b.jsxs("p",{className:"text-content-muted text-xs",children:[p.reusableCount," reusable · ",p.unsupportedCount," ","unsupported · runtime: ",d]}),b.jsx("button",{type:"button",onClick:()=>void M(),disabled:_,className:"bg-secondary text-secondary-foreground hover:bg-accent rounded-md px-4 py-2 text-sm font-medium disabled:opacity-50",children:_?"Starting import…":"Approve and import"}),b.jsx("button",{type:"button",onClick:()=>{k==null||k.capture("visual_editor_cosmos_plan_revised"),g(null)},disabled:_,className:"text-content-muted hover:text-content ml-3 text-sm",children:"Change selection"})]}):null,v?b.jsx("p",{role:"alert",className:"text-sm text-red-300",children:v}):null]})]})]})})},x3=Rs("ConnectorsModal"),$ee=[{provider:"x",name:"X",iconClassName:"text-content",icon:b.jsx(Gf,{provider:"x"})},{provider:"pinterest",name:"Pinterest",iconClassName:"text-[#e60023]",icon:b.jsx(Gf,{provider:"pinterest"})},{provider:"arena",name:"Are.na",iconClassName:"text-content",icon:b.jsx(Gf,{provider:"arena"})}],Fee={name:"Cosmos",iconClassName:"text-content",icon:b.jsx(Gf,{provider:"cosmos"})},b3=({meta:t,status:e,actionLabel:n,buttonLabel:r,isDisabled:s,isHighlighted:i,onAction:o})=>b.jsxs("li",{className:`flex min-h-[64px] items-center gap-3 py-3 ${i?"ring-secondary -mx-2 rounded-md px-2 ring-2":""}`,children:[b.jsx("span",{className:`grid h-7 w-7 flex-none place-items-center ${t.iconClassName}`,"aria-hidden":"true",children:t.icon}),b.jsxs("div",{className:"min-w-0 flex-1",children:[b.jsx("span",{className:"text-content block text-sm font-medium",children:t.name}),b.jsx("span",{className:"text-content-muted block truncate text-xs",children:e})]}),b.jsx("button",{type:"button","aria-label":n,onClick:o,disabled:s,className:"active-push bg-main-input text-content hover:bg-main-input/80 inline-flex min-h-8 w-24 flex-none items-center justify-center rounded-md px-3 text-xs font-medium transition-colors disabled:cursor-not-allowed disabled:opacity-50",children:r})]}),$w=({isOpen:t,onClose:e,context:n="menu",highlightProvider:r=null})=>{var I;const{integrations:s,isLoading:i,error:o,pendingProvider:l,connect:u,disconnect:d}=Eee(),f=xi(),[p,g]=m.useState(null),[v,w]=m.useState(!1),_=Cee(t),x=M=>s.find(R=>R.provider===M),S=m.useCallback(M=>{const R=Date.now(),O=Il({action:"connect",outcome:"started",provider:M,entryPoint:n});f==null||f.capture(O.event,O.properties),u(M).then(N=>{const D=Date.now()-R;if(N==="connected"){const Y=Il({action:"connect",outcome:"completed",provider:M,entryPoint:n,durationMs:D});f==null||f.capture(Y.event,Y.properties);return}const $=Il({action:"connect",outcome:"failed",provider:M,entryPoint:n,durationMs:D,failureReason:N==="closed"?"popup_closed":"provider_failed"});f==null||f.capture($.event,$.properties)}).catch(N=>{const D=N instanceof Error?N.message:"Could not connect.",$=Il({action:"connect",outcome:"failed",provider:M,entryPoint:n,durationMs:Date.now()-R,failureReason:D.includes("Popup blocked")?"popup_blocked":"request_failed"});f==null||f.capture($.event,$.properties),x3.warn(`Connect error for ${M}:`,D),Rt.error(D)})},[u,n,f]),k=m.useCallback(M=>{const R=Date.now(),O=Il({action:"disconnect",outcome:"started",provider:M,entryPoint:n});f==null||f.capture(O.event,O.properties),d(M).then(()=>{const N=Il({action:"disconnect",outcome:"completed",provider:M,entryPoint:n,durationMs:Date.now()-R});f==null||f.capture(N.event,N.properties)}).catch(N=>{const D=N instanceof Error?N.message:"Could not disconnect.",$=Il({action:"disconnect",outcome:"failed",provider:M,entryPoint:n,durationMs:Date.now()-R,failureReason:"request_failed"});f==null||f.capture($.event,$.properties),x3.warn(`Disconnect error for ${M}:`,D),Rt.error(D)})},[n,d,f]),C=n==="onboarding",T=(I=_.data)==null?void 0:I.sources.some(M=>M.provider==="cosmos");let A=T?"Connected":"Not connected";return _.isError&&(A="Status unavailable"),_.isPending&&(A="Checking status…"),b.jsxs(b.Fragment,{children:[b.jsx(tv,{open:t,onOpenChange:M=>!M&&e(),children:b.jsxs(nv,{children:[b.jsx(rv,{className:"z-max fixed inset-0 bg-black/40"}),b.jsx(sv,{ref:g,className:"z-max border-main-border bg-main font-main fixed top-1/2 left-1/2 w-[min(440px,calc(100vw-32px))] -translate-x-1/2 -translate-y-1/2 rounded-lg border shadow-2xl outline-none",children:b.jsxs(WI,{value:p,children:[b.jsxs("div",{className:"border-main-border bg-main-light flex items-center justify-between rounded-t-lg border-b px-4 py-2",children:[b.jsx(iv,{className:"text-content text-base font-medium",children:"Connect design references"}),b.jsx(Gi,{onClick:e,title:"Close","aria-label":"Close",variant:"ghost",size:"icon-compact",children:b.jsx(vb,{className:"h-4 w-4",weight:"bold"})})]}),b.jsxs("div",{className:"flex flex-col gap-4 p-4",children:[b.jsx(ov,{className:"text-content-subtle text-sm",children:"Connect your references to add them to your Rivet library. Rivet can use them to inspire new design directions."}),o?b.jsx("p",{className:"rounded-lg bg-red-500/10 px-4 py-3 text-[13px] font-medium text-red-300",children:o}):null,b.jsxs("ul",{className:"divide-main-border divide-y","aria-label":"Design reference services",children:[$ee.map(M=>{const R=x(M.provider),O=(R==null?void 0:R.status)==="connected",N=R==null?void 0:R.externalUsername;let D=O?`Connected${N?` as @${N}`:""}`:"Not connected";i&&(D="Checking status…");const $=l===M.provider,Y=O?"Disconnect":"Connect";return b.jsx(b3,{meta:M,status:D,actionLabel:`${Y} ${M.name}`,buttonLabel:$?`${Y}ing…`:Y,isDisabled:i||$,isHighlighted:r===M.provider,onAction:()=>O?k(M.provider):S(M.provider)},M.provider)}),b.jsx(b3,{meta:Fee,status:A,actionLabel:T?"Add Cosmos profile":"Connect Cosmos",buttonLabel:T?"Add profile":"Connect",isDisabled:!1,isHighlighted:!1,onAction:()=>{f==null||f.capture("visual_editor_cosmos_modal_opened"),w(!0)}})]}),C?b.jsxs("div",{className:"flex items-center justify-between gap-4",children:[b.jsx("p",{className:"text-content-subtle text-xs",children:"You can always do this later from the account menu."}),b.jsx("button",{type:"button",onClick:e,className:"active-push bg-secondary text-secondary-foreground hover:bg-accent flex-none rounded-lg px-3.5 py-2 text-[13px] font-medium transition-colors",children:"Skip for now"})]}):null]})]})})]})}),b.jsx(jee,{isOpen:v,onClose:()=>w(!1),onImported:()=>{_.refetch()}})]})},S3=({className:t=""})=>b.jsx("span",{"aria-hidden":"true",className:`rivet-skeleton block rounded ${t}`.trim()}),Vee=Rs("SupportTicketModal"),k3=5e3,x_="feedback",Hee=On({error:Je().optional(),details:nH([Je(),On({formErrors:sd(Je()).optional(),fieldErrors:uA(Je(),sd(Je()).optional()).optional()})]).optional()}),zee=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},Uee=async t=>{let e;try{const n=Hee.safeParse(await t.json());e=n.success?n.data:void 0}catch{e=void 0}if(t.status===400){if(typeof(e==null?void 0:e.details)=="string"&&e.details.trim())return e.details;if(typeof(e==null?void 0:e.details)=="object"&&e.details!==null){const n=zee(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}`},Bee=({isOpen:t,onClose:e,contactEmail:n})=>{const r=xi(),[s,i]=m.useState(""),[o,l]=m.useState(!1),[u,d]=m.useState(null),f=m.useCallback(()=>{i("")},[]),p=m.useCallback(()=>{o||(f(),e())},[o,e,f]),g=m.useCallback(async()=>{const x=s.trim();if(!(!x||o)){l(!0);try{const S=typeof(r==null?void 0:r.get_session_id)=="function"?r.get_session_id():void 0,k=typeof(r==null?void 0:r.get_distinct_id)=="function"?r.get_distinct_id():void 0,C=n==null?void 0:n.trim(),T=await Ya("/api/support/tickets",{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({type:x_,message:x,contactEmail:C||void 0,metadata:{posthogSessionId:S??void 0,posthogDistinctId:k??void 0,appVersion:"0.20.0",appEnvironment:"production",pageUrl:window.location.href,userAgent:navigator.userAgent,submittedAt:new Date().toISOString()}})});if(!T.ok){const A=await Uee(T);throw new Error(A)}r==null||r.capture("support_ticket_submitted",{ticket_type:x_,has_posthog_session_id:!!S}),Rt.success("Feedback sent",{description:"Thanks for sharing this."}),f(),e()}catch(S){const k=S instanceof Error?S.message:"Failed to send message";r==null||r.capture("support_ticket_submit_failed",{ticket_type:x_,error:k}),Vee.error("Failed to submit support ticket:",k),Rt.error("Could not send feedback",{description:k})}finally{l(!1)}}},[n,o,s,e,r,f]),v=m.useCallback(x=>{x.key==="Enter"&&(x.metaKey||x.ctrlKey)&&(x.preventDefault(),g())},[g]),w=k3-s.length,_=o||s.trim().length===0;return b.jsx(tv,{open:t,onOpenChange:x=>!x&&p(),children:b.jsxs(nv,{children:[b.jsx(rv,{className:"z-max fixed inset-0 bg-black/40"}),b.jsx(sv,{ref:d,className:"z-max border-main-border bg-main font-main fixed top-1/2 left-1/2 w-[440px] -translate-x-1/2 -translate-y-1/2 rounded-lg border shadow-2xl outline-none",children:b.jsxs(WI,{value:u,children:[b.jsxs("div",{className:"border-main-border bg-main-light flex items-center justify-between rounded-t-lg border-b px-4 py-2",children:[b.jsx(iv,{className:"text-content text-base font-medium",children:"Send feedback"}),b.jsx(Gi,{onClick:p,disabled:o,title:"Close","aria-label":"Close",variant:"ghost",size:"icon-compact",children:b.jsx(vb,{className:"h-4 w-4",weight:"bold"})})]}),b.jsxs("div",{className:"flex flex-col gap-3 p-4",children:[b.jsx(ov,{className:"text-content-subtle text-sm",children:"Tell us what happened or what we can improve."}),b.jsxs("div",{className:"bg-main-input rounded-lg outline outline-1 outline-transparent transition-[outline-color] focus-within:outline-white/20",children:[b.jsx("textarea",{id:"support-ticket-message","aria-label":"Your feedback",value:s,onChange:x=>i(x.target.value),onKeyDown:v,maxLength:k3,rows:6,disabled:o,placeholder:"What happened?",className:"text-content placeholder-content-subtle max-h-64 w-full resize-none overflow-y-auto bg-transparent pt-3 pr-3 pb-1 pl-3 text-sm focus:outline-none disabled:opacity-50"}),b.jsxs("div",{className:"flex items-center justify-between px-3 pt-1 pb-3",children:[b.jsx("span",{className:"text-content-subtle text-xs",children:"Context details are included automatically."}),b.jsxs("div",{className:"flex items-center gap-2",children:[w<=500&&b.jsx("span",{className:"text-content-subtle text-xs",children:w}),b.jsx(Gi,{onClick:g,disabled:_,title:"Send feedback",shortcut:"⌘↵","aria-label":"Send feedback",size:"icon-compact",children:o?b.jsx(Zg,{className:"h-5 w-5 animate-spin",weight:"bold"}):b.jsx(Xq,{className:"h-5 w-5",weight:"bold"})})]})]})]})]})]})})]})})},Zee=Rs("ProfileAvatar"),YO=(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):""},Wee=(t,e)=>YO(t,e).charAt(0).toUpperCase(),qee=({className:t="",side:e="bottom",align:n="end"})=>{var Y,B,G;const r=uee(),s=((Y=r.data)==null?void 0:Y.name)??null,i=((B=r.data)==null?void 0:B.email)??null,o=((G=r.data)==null?void 0:G.isAuthenticated)===!0,l=xi(),{startLogin:u,isStartingLogin:d,loginError:f}=qO("account_menu"),[p,g]=m.useState(!1),[v,w]=m.useState(!1),[_,x]=m.useState(!1),[S,k]=m.useState(!1),{containerRef:C,onKeyDown:T,onCloseAutoFocus:A}=vO({onDismiss:()=>$(!1)}),I=Wee(s,i);if(r.isPending)return b.jsxs("span",{"data-testid":"profile-avatar-skeleton","aria-hidden":"true",className:`flex shrink-0 items-center gap-2 ${t}`.trim(),children:[b.jsx(S3,{className:"h-8 w-8 rounded-full"}),b.jsx(S3,{className:"h-3.5 w-16"})]});const M=YO(s,i),R=(s==null?void 0:s.trim())||null,O=(i==null?void 0:i.trim())||null,N=async()=>{k(!0);try{const V=await Ya("/api/auth/logout",{method:"POST",credentials:"same-origin"});if(!V.ok)throw new Error(`Logout failed: ${V.status}`);window.location.pathname.startsWith("/rivet/library")&&dA()}catch(V){Zee.warn("Logout request failed",V),Rt.error("Could not log out. Please try again."),k(!1);return}window.location.reload()};let D="Log in";o&&(D=M||"Account"),r.error&&!r.data&&(D="Account unavailable");const $=V=>{g(V),l==null||l.capture(`visual_editor_account_menu_${V?"opened":"closed"}`,{is_authenticated:o})};return b.jsxs(b.Fragment,{children:[b.jsxs(zb,{open:p,onOpenChange:$,children:[b.jsx(Ub,{asChild:!0,children:b.jsxs("button",{type:"button","aria-label":"Account","data-rivet-private":!0,className:`ph-no-capture text-content-muted hover:text-content flex shrink-0 items-center gap-2 transition-colors select-none ${t}`,children:[b.jsx("span",{className:"border-main-border bg-main-input flex h-8 w-8 items-center justify-center rounded-full border text-xs leading-none font-semibold",children:I||b.jsx(uG,{className:"h-4 w-4",weight:"bold"})}),b.jsx("span",{className:"max-w-[8rem] truncate text-sm font-medium",children:D})]})}),b.jsx(Bb,{children:b.jsxs(Zb,{"data-rivet-private":!0,ref:C,onKeyDown:T,onCloseAutoFocus:A,role:"menu",className:"ph-no-capture bg-popover shadow-surface-4 z-[60] min-w-[180px] rounded-lg p-1",side:e,sideOffset:6,align:n,children:[R||O?b.jsxs("div",{className:"border-main-border border-b px-3 py-2",children:[R?b.jsx("div",{className:"text-content truncate text-sm font-medium",children:R}):null,O?b.jsx("div",{className:"text-content-muted truncate text-xs",children:O}):null]}):null,b.jsxs("button",{type:"button",role:"menuitem","data-menu-item":!0,onClick:()=>{$(!1),w(!0)},disabled:!o,className:"text-content hover:bg-hover focus-visible:bg-hover mt-1 flex w-full items-center gap-2 rounded-md px-3 py-1.5 text-sm transition-colors focus:outline-none disabled:cursor-not-allowed disabled:opacity-50",children:[b.jsx(kM,{className:"h-4 w-4",weight:"bold"}),"Connect design references"]}),b.jsxs("button",{type:"button",role:"menuitem","data-menu-item":!0,onClick:()=>{$(!1),x(!0)},className:"text-content hover:bg-hover focus-visible:bg-hover mt-1 flex w-full items-center gap-2 rounded-md px-3 py-1.5 text-sm transition-colors focus:outline-none",children:[b.jsx(eG,{className:"h-4 w-4",weight:"bold"}),"Share feedback"]}),o?b.jsxs("button",{type:"button",role:"menuitem","data-menu-item":!0,onClick:N,disabled:S,className:"text-content hover:bg-hover focus-visible:bg-hover mt-1 flex w-full items-center gap-2 rounded-md px-3 py-1.5 text-sm transition-colors focus:outline-none disabled:cursor-not-allowed disabled:opacity-50",children:[b.jsx(lG,{className:"h-4 w-4",weight:"bold"}),S?"Logging out…":"Log out"]}):null,!o&&!r.error?b.jsxs("button",{type:"button",role:"menuitem","data-menu-item":!0,onClick:()=>{u()},disabled:d,className:"text-content hover:bg-hover focus-visible:bg-hover mt-1 flex w-full items-center gap-2 rounded-md px-3 py-1.5 text-sm focus:outline-none disabled:opacity-50",children:[b.jsx(aG,{className:"h-4 w-4",weight:"bold"}),d?"Logging in…":"Log in"]}):null,r.error?b.jsx("button",{type:"button",role:"menuitem","data-menu-item":!0,onClick:()=>{r.refetch()},className:"text-content mt-1 px-3 py-1.5 text-sm",children:"Retry account"}):null,f?b.jsx("p",{role:"alert",className:"max-w-64 px-3 py-2 text-sm text-red-300",children:f}):null]})})]}),v?b.jsx($w,{isOpen:!0,onClose:()=>w(!1)}):null,b.jsx(Bee,{isOpen:_,onClose:()=>x(!1),contactEmail:i??void 0})]})},Gee=({onClose:t,libraryOrigin:e})=>b.jsxs("div",{className:"bg-main font-main scrollbar-hide relative flex h-full w-full cursor-auto flex-col overflow-hidden shadow-2xl","data-cy":"element-inspector",children:[b.jsx(lee,{onClose:t,libraryOrigin:e}),b.jsx("div",{className:"flex min-h-0 flex-1 flex-col",children:b.jsx(VJ,{})}),b.jsx("div",{className:"border-main-border bg-main-light flex flex-shrink-0 items-center border-t px-2.5 py-2.5",children:b.jsx(qee,{side:"top",align:"start"})})]});async function Kee(t,e){const{delaysMs:n,shouldRetry:r,onRetry:s}=e;for(let i=1;;i++)try{return await t(i)}catch(o){const l=n[i-1];if(l===void 0||r&&!r(o))throw o;s==null||s(o,i,l),await new Promise(u=>setTimeout(u,l))}}const E3=Rs("useServerConfig"),XO=[250,500,1e3,2e3,4e3],C3=XO.length+1,Yee=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}},Xee=()=>{const[t,e]=m.useState(null),[n,r]=m.useState(!0),[s,i]=m.useState(null),o=m.useCallback(async()=>{try{r(!0),i(null);const l=await Kee(Yee,{delaysMs:XO,onRetry:(u,d,f)=>{E3.warn(`Server config fetch failed (attempt ${d}); retrying in ${f}ms`,u)}});return e(l),l}catch(l){const u=l instanceof Error?l.message:"Failed to fetch server config";throw i(u),E3.warn("Error fetching server config:",l),l}finally{r(!1)}},[]);return{config:t,fetchConfig:o,isLoading:n,error:s}},Qee="#1C1C20",wo=[118,118,124],P3=.85,Jee=3,ete=.15,H0=36,tte=4.4,nte=.7,rte=3.5,ste=.8,T3=9,ite=11,ote=[1.35,1.12,.95,.85],ate=[0,1.1,2.3,3.1],lte=[0,.35,.16,.13],cte=[.9,.5,.4,.35],Ol=3,b_=[[{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}]],z0=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},mm=t=>{const e=Math.min(1,Math.max(0,t));return e*e*(3-2*e)},Ll=(t,e)=>(Math.round(t/e-.5)+.5)*e,ute=Math.sin(Math.PI/3),A3=(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*ute;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()},dte=(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)-T3}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)-T3}return mm(.5-r/(2*ite))},QO=({className:t="",trackGlobalLoaderCount:e=!0})=>{const n=gt(EO),r=m.useRef(null),s=m.useCallback(i=>{var N;if((N=r.current)==null||N.call(r),r.current=null,!i)return;const o=i.getContext("2d");if(!o)return;e&&n(D=>D+1);const l=window.matchMedia("(prefers-reduced-motion: reduce)").matches;let u=[],d=0,f=0,p=H0,g=H0,v=null,w=null,_=0,x=-1;const S=new Array(33),k=D=>{const $=Math.round(D*32);let Y=S[$];if(!Y){const B=$/32,G=Math.round(wo[0]+(255-wo[0])*B),V=Math.round(wo[1]+(255-wo[1])*B),K=Math.round(wo[2]+(255-wo[2])*B);Y=`rgba(${G}, ${V}, ${K}, ${P3})`,S[$]=Y}return Y},C=D=>{const $=1-.35*D,Y=Math.round(wo[0]*$),B=Math.round(wo[1]*$),G=Math.round(wo[2]*$);return`rgba(${Y}, ${B}, ${G}, ${P3})`},T=D=>{let $=Math.floor(Math.random()*b_.length);$===x&&($=($+1)%b_.length),x=$;const Y=[0,0,0,0],B=b_[$].map((j,Q)=>{const oe=j.level,re=Y[oe]++,ie=ate[oe]+re*lte[oe],fe=cte[oe]+z0($*131+Q*17+5)*.2;if(j.hline){const ae=Ll((j.y??0)*f,g);return{hline:!0,x1:Ll(j.x1*d,p),x2:Ll(j.x2*d,p),y1:ae,y2:ae,level:oe,start:ie,dur:fe}}const _e=Ll(j.x1*d,p),ue=Ll((j.y1??0)*f,g);return{hline:!1,x1:_e,y1:ue,x2:Math.max(Ll(j.x2*d,p),_e+p),y2:Math.max(Ll((j.y2??0)*f,g),ue+g),level:oe,start:ie,dur:fe}}),G=B.reduce((j,Q)=>Math.max(j,Q.start+Q.dur),0),V=u.length,K=new Float32Array(V*Ol),U=new Int16Array(V*Ol).fill(-1),ee=new Uint8Array(V),Z=B[0];for(let j=0;j<V;j++){const Q=u[j];Q.x>Z.x1&&Q.x<Z.x2&&Q.y>Z.y1&&Q.y<Z.y2&&(ee[j]=1);const oe=j*Ol;for(let re=0;re<B.length;re++){const ie=dte(Q.x,Q.y,B[re]);if(ie<=.02)continue;let fe=oe;for(let _e=oe;_e<oe+Ol;_e++){if(U[_e]===-1){fe=_e;break}K[_e]<K[fe]&&(fe=_e)}(U[fe]===-1||ie>K[fe])&&(K[fe]=ie,U[fe]=re)}}return{startT:D,buildEnd:G,els:B,frame:Z,cellQ:K,cellEl:U,inFrame:ee}},A=()=>{const D=i.getBoundingClientRect();d=Math.max(1,D.width),f=Math.max(1,D.height);const $=Math.min(2,window.devicePixelRatio||1);i.width=Math.round(d*$),i.height=Math.round(f*$),o.setTransform($,0,0,$,0,0);const Y=Math.max(8,Math.round(d/H0)),B=Math.max(6,Math.round(f/H0));p=d/Y,g=f/B,u=[];for(let G=0;G<B;G++){const V=B>1?G/(B-1):.5,K=tte*(1+nte*.4*(V*2-1));for(let U=0;U<Y;U++){const ee=G*8191+U*131+1,Z={x:(U+.5)*p,y:(G+.5)*g,size:K,seed:ee,phase:z0(ee),kind:0};Z.kind=Math.floor(z0(ee*97)*3),u.push(Z)}}w=null,v=null},I=new Float32Array(32),M=D=>{o.fillStyle=Qee,o.fillRect(0,0,d,f),v||(v=T(D+.2)),D>=v.startT+v.buildEnd+rte&&(w=v,_=D,v=T(D+.2));let $=0;w&&($=1-mm((D-_)/ste),$<=0&&(w=null));const Y=v;for(let Z=0;Z<Y.els.length;Z++){const j=Y.els[Z];I[Z]=mm(Math.min(1,Math.max(0,(D-Y.startT-j.start)/j.dur)))}const B=I[0],G=C(0),V=C(B),K=$>0?C($):G,U=$>0?C(Math.max(B,$)):V,ee=u.length;for(let Z=0;Z<ee;Z++){const j=u[Z];let Q=0,oe=0;const re=Z*Ol;for(let Be=re;Be<re+Ol;Be++){const Ee=Y.cellEl[Be];if(Ee<0)break;const pt=Y.cellQ[Be]*I[Ee];pt>Q&&(Q=pt,oe=Y.els[Ee].level)}if(w)for(let Be=re;Be<re+Ol;Be++){const Ee=w.cellEl[Be];if(Ee<0)break;const pt=w.cellQ[Be]*$;pt>Q&&(Q=pt,oe=w.els[Ee].level)}const ie=D/Jee+j.phase,fe=Math.floor(ie),_e=ie-fe,ue=mm(Math.min(_e,1-_e)/ete),ae=Math.floor(z0(j.seed*97+fe*7919)*3);ae!==j.kind&&Q<.02&&ue<.05&&(j.kind=ae);const Oe=Math.max(ue*(1-Q),Q);if(!(Oe<.01))if(Q<.02){const Be=Y.inFrame[Z]===1,Ee=w?w.inFrame[Z]===1:!1;Be?o.fillStyle=Ee?U:V:o.fillStyle=Ee?K:G;const pt=Math.max(Be?B:0,Ee?$:0);A3(o,j.kind,j.x,j.y,j.size*Oe*(1-.2*pt))}else{o.fillStyle=k(Q);const Be=1+(ote[oe]-1)*Q;A3(o,j.kind,j.x,j.y,j.size*Oe*Be)}}};A();let R=0;if(l)v=T(-100),M(0);else{const D=performance.now(),$=Y=>{M((Y-D)/1e3),R=requestAnimationFrame($)};R=requestAnimationFrame($)}const O=new ResizeObserver(()=>{A(),l&&(v=T(-100),M(0))});O.observe(i),r.current=()=>{cancelAnimationFrame(R),O.disconnect(),e&&n(D=>D-1)}},[e,n]);return b.jsx("canvas",{ref:s,"aria-hidden":"true",className:`h-full w-full ${t}`.trim()})},fte=async(t=null)=>{if(t)return hte(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 U0();if(!e.ok)return{isOk:!1,unavailableReason:"rivet_unreachable",upstreamStatus:null};let r;try{r=await e.json()}catch{return U0()}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}:U0()},JO=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}}},hte=t=>JO(t),U0=()=>JO("/"),S_=Rs("usePreviewUpstreamHealth"),pte=500,mte=4e3,gte=15e3,vte=3,yte=(t,e={})=>{const n=m.useRef(null),r=m.useRef(null),s=e.probeMsWhileDown??pte,i=e.probeMsWhileUp??mte,o=e.firstUnreachableCaptureAfterMs??gte,l=e.rerunProbeImmediatelyOnVersion,u=e.probePath??null,d=e.skip??!1,f=m.useRef(e.onPersistentUpstreamServerErrors);f.current=e.onPersistentUpstreamServerErrors;const[p,g]=m.useState(t==="static"),[v,w]=m.useState(0),[_,x]=m.useState(null),[S,k]=m.useState(0),[C,T]=m.useState(!1),[A,I]=m.useState(!1),[M,R]=m.useState(t==="static"?null:"upstream_unreachable");return m.useEffect(()=>{if(t==="static"){g(!0),x(null),k(0),T(!1),I(!0),R(null);return}if(d){g(!1),x(null),k(0),T(!1),I(!0),R("upstream_unreachable"),n.current=null;return}let O=!0;const N=Date.now();x(N),k(0),T(!1),g(!1),I(!1),R("upstream_unreachable");const D={current:!1},$={current:!1},Y={current:!1},B={current:null},G={current:!1},V={current:!1},K={current:0},U={current:!1},ee={current:null};let Z=null;const j=()=>{Y.current||(Y.current=!0,O&&I(!0))},Q=()=>{Z!==null&&(clearTimeout(Z),Z=null)},oe=(ie,fe)=>{Q(),Z=setTimeout(fe,ie)},re=async()=>{var pt;if(!O)return;k(Ot=>Ot+1);const{isOk:ie,unavailableReason:fe,upstreamStatus:_e}=await fte(u);if(!O)return;j(),ee.current=_e;const ue=ie&&_e!==null&&_e>=500;ue&&V.current?K.current+=1:ie&&!ue&&(K.current=0);const ae=K.current>=vte;if(ae&&!U.current&&_e!==null&&(U.current=!0,Ce==null||Ce.capture("preview_upstream_error_responses",{framework:t,upstream_status:_e,consecutive_count:K.current}),S_.warn(`Preview upstream is listening but has served ${K.current} consecutive ${_e} responses`),(pt=f.current)==null||pt.call(f,{upstreamStatus:_e,consecutiveCount:K.current})),ie&&!ae){ue||(V.current=!0,U.current=!1);const Ot=!G.current;G.current=!0,g(!0),R(null),B.current=null,$.current=!1,T(!1),D.current?Ot&&(Ce==null||Ce.capture("preview_upstream_restored",{framework:t})):(D.current=!0,Ce==null||Ce.capture("preview_dev_server_ready",{framework:t,ready_after_ms:Date.now()-N})),oe(i,re);return}const Be=G.current;G.current=!1,g(!1),R(fe),B.current===null&&(B.current=Date.now(),$.current=!1,T(!1)),Be&&(Ce==null||Ce.capture("preview_upstream_lost",{framework:t,upstream_status:_e}),w(Ot=>Ot+1),S_.warn("Preview upstream became unavailable after it was ready"));const Ee=Date.now()-B.current;Ee>=o&&!$.current&&($.current=!0,T(!0),Ce==null||Ce.capture("preview_dev_server_unreachable",{framework:t,elapsed_ms:Ee,upstream_status:ee.current}),S_.warn("Dev server did not become ready within timeout window")),oe(s,re)};return n.current=()=>oe(0,re),oe(0,re),()=>{O=!1,n.current=null,Q()}},[t,s,i,o,u,d]),m.useEffect(()=>{var N;if(t==="static"||l===void 0)return;const O=r.current;r.current=l,O!==null&&O!==l&&((N=n.current)==null||N.call(n))},[t,l]),{isUpstreamReady:p,iframeRemountKey:v,probeStartedAt:_,probeAttemptCount:S,isFirstUnreachableWindowExceeded:C,initialProbeComplete:A,unavailableReason:M}};function _te(t){return t.enteringSplit&&t.isExistingSession&&t.hasActiveVariantProxy}const e9=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}`},t9=({agentApplyMode:t,url:e})=>e.startsWith("/")?`${e9(t)}${e}`:e,wte="allow-scripts allow-same-origin allow-forms allow-popups allow-modals",xte=t=>wte,bte=Rs("PreviewSurface"),R3=(t,e)=>t==="about:blank"?"blank":t.includes("/api/variants/")?"static_artifact":e.kind==="variant"?"dev_server":"original",n9=({target:t,src:e,framework:n,remountKey:r})=>(ut(cv),b.jsx("div",{className:"relative h-full w-full",children:b.jsx("iframe",{src:e,className:"h-full w-full border-none",title:"Project Preview",sandbox:xte(),onLoad:()=>{Ce==null||Ce.capture("preview_iframe_loaded",{framework:n,src:e}),t.kind==="variant"&&(Ce==null||Ce.capture("variants_panel.preview_displayed",{sessionId:t.sessionId,variantId:t.variantId,renderedTarget:"variant",iframeSrcKind:R3(e,t),framework:n}))},onError:()=>{Ce==null||Ce.capture("preview_iframe_load_failed",{framework:n,src:e}),t.kind==="variant"&&(Ce==null||Ce.capture("variants_panel.preview_display_failed",{sessionId:t.sessionId,variantId:t.variantId,renderedTarget:"variant",iframeSrcKind:R3(e,t),framework:n})),bte.warn("Preview iframe failed to load",{framework:n,src:e})}},r)})),Ste=m.lazy(()=>SP(()=>Promise.resolve().then(()=>sre),void 0)),kte={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"},Ete={sm:"text-lg font-semibold text-content",md:"text-2xl font-semibold text-content",lg:"text-3xl font-semibold text-content"},Cte={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"},Ou=({backdrop:t,media:e,title:n,description:r,actions:s,tone:i="neutral",fill:o="surface",size:l="md",children:u,state:d,role:f="status",busy:p=!1,className:g=""})=>{const v=m.useCallback(_=>{_&&d&&(Ce==null||Ce.capture("status_surface_shown",{state:d,tone:i,fill:o}))},[d,i,o]),w=!!(e||n||r||u||s!=null&&s.length);return b.jsxs("div",{ref:v,className:`${kte[o]} ${g}`.trim(),role:f,"aria-live":"polite","aria-busy":p||void 0,"data-state":d,children:[t?b.jsx("div",{className:"absolute inset-0",children:t}):null,w?b.jsxs("div",{className:"relative z-10 flex max-w-sm flex-col items-center gap-5 text-center",children:[e,n?b.jsx("h2",{className:Ete[l],children:n}):null,r?b.jsx("p",{className:"text-content-muted text-base leading-relaxed",children:r}):null,u,s!=null&&s.length?b.jsx("div",{className:"flex flex-row items-center gap-3",children:s.map(_=>b.jsx("button",{type:"button",onClick:_.onClick,className:Cte[_.variant??"neutral"],children:_.label},_.label))}):null]}):null]})},Fw=({loader:t="coalesce",trackGlobalLoaderCount:e,size:n="lg",...r})=>t==="coalesce"?b.jsx(Ou,{...r,size:n,busy:!0,backdrop:b.jsx(QO,{trackGlobalLoaderCount:e})}):t==="logo"?b.jsx(Ou,{...r,size:n,busy:!0,backdrop:b.jsx(m.Suspense,{fallback:null,children:b.jsx(Ste,{className:"absolute inset-0"})})}):b.jsx(Ou,{...r,size:n,busy:!0,media:b.jsx(Zg,{"aria-hidden":!0,className:"text-content h-8 w-8 shrink-0 animate-spin",weight:"bold"})}),r9=({icon:t,...e})=>b.jsx(Ou,{...e,tone:"neutral",media:t?b.jsx("div",{className:"text-content-muted",children:t}):void 0}),Yb=t=>b.jsx(Ou,{...t,tone:"error",role:"alert"}),M3="/static/",Pte=t=>{try{return new URL(t,"http://localhost").pathname.endsWith(M3)}catch{return t.endsWith(M3)}},Tte=t=>t==="spawn_error"?"The direction is saved, but its preview process didn’t start.":t==="exited"?"The direction is saved, but its preview stopped before it was ready.":t==="timeout"?"The direction is saved, but its preview took too long to become ready.":t==="dependency_install_failed"?"The direction is saved, but its dependencies couldn’t be prepared. Fix the installation error, then retry the preview.":t==="compile_error"?"The direction is saved, but its app couldn’t compile. Fix the app error, then retry the preview.":t==="missing_dev_script"?"The direction is saved, but Rivet couldn’t find a dev script to preview it.":t==="missing_static_entry"?"The direction is saved, but Rivet couldn’t find an HTML entry to preview it.":"The direction is saved, but Rivet couldn’t prepare its preview.",Ate=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:Tte(t.previewUnavailable.reason),detail:t.previewUnavailable.portInUse?"The preview port was already in use.":void 0,isError:!0}:null,Rte=({issue:t,retryTarget:e})=>{const n=xi(),r=m.useRef(!1),[s,i]=m.useState(!1),[o,l]=m.useState(null),u=async()=>{if(!(!e||r.current)){r.current=!0,i(!0),l(null),n==null||n.capture("preview_retry_clicked",{session_id:e.sessionId,variant_id:e.variantId});try{const d=await fetch(`/api/variants/${encodeURIComponent(e.sessionId)}/preview-port`,{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({variantId:e.variantId,retry:!0})});if(!d.ok){const f=On({message:Je().optional()}).safeParse(await d.json().catch(()=>({}))),p=f.success?f.data:{};throw new Error(p.message??"The preview could not restart. Try again.")}}catch(d){l(d instanceof Error?d.message:"The preview could not restart. Try again.")}finally{r.current=!1,i(!1)}}};return b.jsxs(Ou,{fill:"overlay",size:"sm",state:t.state,role:t.isError?"alert":"status",tone:t.isError?"error":"neutral",title:t.title,description:t.description,busy:s,actions:e&&!s?[{label:"Retry preview",onClick:()=>void u()}]:void 0,children:[s?b.jsx("p",{className:"text-content-subtle text-xs",children:"Starting preview…"}):null,o?b.jsx("p",{className:"text-content-subtle text-xs",children:o}):null,t.detail?b.jsx("p",{className:"text-content-subtle text-xs leading-relaxed break-words",children:t.detail}):null]})},Mte=({isInteractionDisabled:t=!1,framework:e,userPort:n})=>{var _t;const r=ut(Aw),s=gt(Aw),i=ut(_g),o=gt(_g),l=ut(tp),u=ut(cv),d=ut(Rw),f=ut(Mw),p=ut(CO),g=ut(PO),v=gt(Mw),w=ut(Zo),_=ut(pm),x=gt(Rw),S=l.active&&l.projectContext.kind==="fresh",k=ut(Iw),C=l.active?l.variants.find(qe=>qe.workItemId===k&&(qe.status==="pending"||qe.status==="running"||qe.status==="succeeded"&&!qe.preview&&typeof qe.port!="number"&&(!qe.previewUnavailable||qe.previewUnavailable.reason==="idle_timeout")))??null:null,T=l.active&&l.variants.some(qe=>qe.status==="pending"||qe.status==="running"),A=S||T,I=l.active?l.variants.find(qe=>qe.workItemId===k)??null:null,M=I?Ate(I):null,R=e==="static"&&i!==null&&Pte(i);m.useEffect(()=>{l.active||x(!1)},[l.active,x]);const O=m.useRef(!1);m.useEffect(()=>{const qe=!!(w!=null&&w.left||w!=null&&w.right),Ke=qe&&!O.current;O.current=qe;const Ct=l.active?l.sessionId:null;!Ct||!_te({enteringSplit:Ke,isExistingSession:l.active&&l.projectContext.kind==="existing",hasActiveVariantProxy:d&&f!==null})||(x(!1),v(null),s(Ae=>Ae+1),fetch(`/api/variants/${encodeURIComponent(Ct)}/preview-port`,{method:"POST",headers:{"content-type":"application/json"},body:JSON.stringify({variantId:null})}).catch(()=>{}))},[w,l,d,f,x,v,s]);const D=m.useMemo(()=>{var Lt;if(d||i&&!R||!l.active)return null;const{stage:qe,variants:Ke}=l,Ct=qe==="ready"||qe==="degraded",Ae=Ke.some(Ge=>{var Pt,is;return((Pt=Ge.refinement)==null?void 0:Pt.status)==="pending"||((is=Ge.refinement)==null?void 0:is.status)==="running"});if(!Ct&&!Ae)return null;const Ye=Ke.find(Ge=>{var Pt;return Ge.status==="succeeded"&&((Pt=Ge.preview)==null?void 0:Pt.kind)==="static_artifact"});return((Lt=Ye==null?void 0:Ye.preview)==null?void 0:Lt.kind)==="static_artifact"?Ye.preview.url:null},[R,i,d,l])??i,$=m.useMemo(()=>!l.active||!D?null:l.variants.find(qe=>{var Ke;return((Ke=qe.preview)==null?void 0:Ke.kind)==="static_artifact"&&D.startsWith(qe.preview.url)})??null,[D,l]),Y=m.useMemo(()=>{if((_==null?void 0:_.previewKind)==="static")return{kind:"variant",sessionId:_.sessionId,variantId:_.variantId};if(!l.active)return yg;if($)return{kind:"variant",sessionId:l.sessionId,variantId:$.workItemId};if(D){const Ke=D.match(/\/__rivet\/preview\/variant\/([^/]+)\/([^/?#]+)/),Ct=Ke!=null&&Ke[1]?decodeURIComponent(Ke[1]):null,Ae=Ke!=null&&Ke[2]?decodeURIComponent(Ke[2]):null;if(Ct===l.sessionId&&Ae&&l.variants.some(Ge=>Ge.workItemId===Ae))return{kind:"variant",sessionId:l.sessionId,variantId:Ae};const Ye=D.match(/\/api\/variants\/[^/]+\/static\/([^/?#]+)/),Lt=Ye!=null&&Ye[1]?decodeURIComponent(Ye[1]):null;if(Lt&&l.variants.some(Ge=>Ge.workItemId===Lt))return{kind:"variant",sessionId:l.sessionId,variantId:Lt}}const qe=!!(w!=null&&w.left||w!=null&&w.right);return(!qe||S)&&!D&&d&&f&&l.variants.some(Ke=>Ke.workItemId===f)?{kind:"variant",sessionId:l.sessionId,variantId:f}:(!qe||S)&&!D&&k&&l.variants.some(Ke=>Ke.workItemId===k)?{kind:"variant",sessionId:l.sessionId,variantId:k}:yg},[_,$,l,d,f,D,w,S,k]),B=m.useRef(null);m.useEffect(()=>{var Ae,Ye;if(!$||((Ae=$.preview)==null?void 0:Ae.kind)!=="static_artifact"||((Ye=$.refinement)==null?void 0:Ye.status)!=="succeeded")return;const qe=`${$.workItemId}:${$.refinement.workItemId}`;if(B.current===qe)return;B.current=qe;const Ke=$.preview.url.includes("?")?"&":"?",Ct=`${$.preview.url}${Ke}refinement=${encodeURIComponent($.refinement.workItemId)}`;D!==Ct&&(o(Ct),s(Lt=>Lt+1))},[D,$,s,o,l]);const G=D!==null&&MJ(D),V=D!==null&&!G||S&&!d&&!G,{isUpstreamReady:K,iframeRemountKey:U,probeAttemptCount:ee,initialProbeComplete:Z}=yte(e,{rerunProbeImmediatelyOnVersion:r,probePath:G?D:null,skip:V}),[j,Q]=m.useState(()=>p&&K?r:null),oe=m.useRef(null);m.useEffect(()=>{if(!p){oe.current=null,Q(null);return}if(j===r){oe.current=null;return}const qe=oe.current;if(!qe||qe.remountKey!==r){oe.current={remountKey:r,probeAttemptCount:ee};return}K&&ee>qe.probeAttemptCount&&(oe.current=null,Q(r))},[j,r,p,ee,K]);const ie=D!==null&&!G||K,_e=g||p&&j!==r||p&&!ie,ue=`${U}:${r}`,ae=NO(window.location.pathname),Oe=e==="static"?`/static${ae??"/"}`:ae??"/",Be=e9(u);let Ee=null;D&&(Ee=t9({agentApplyMode:u,url:D}));const Ot=C||M||_e?"about:blank":(G&&!ie?"about:blank":Ee)??(ie?`${Be}${Oe}`:"about:blank"),Qt=!!C||!!M||!ie&&Z;let bt=null;if(_e)bt=b.jsx(Fw,{fill:"overlay",loader:"coalesce",trackGlobalLoaderCount:!1,state:"preview_replay_boot"});else if(C)bt=b.jsx(Fw,{fill:"overlay",loader:"coalesce",trackGlobalLoaderCount:!1,state:"variant_building",children:b.jsx("span",{className:"sr-only",children:"Building your direction"})});else if(M){const qe=l.active&&I&&M.state==="preview_unavailable"&&((_t=I.previewUnavailable)==null?void 0:_t.reason)!=="missing_static_entry"?{sessionId:l.sessionId,variantId:I.workItemId}:void 0;bt=b.jsx(Rte,{issue:M,retryTarget:qe},I==null?void 0:I.workItemId)}else Qt&&(bt=A?b.jsx(r9,{fill:"overlay",state:"preview_no_selection",title:"Nothing to preview yet",description:"Pick a direction from the panel."}):b.jsx(Yb,{fill:"overlay",state:"preview_offline",title:"Preview isn't connected",description:"Rivet lost connection to your project.",actions:[{label:"Reload",onClick:()=>window.location.reload()}]}));return b.jsx("div",{className:"relative flex h-full min-h-0 w-full flex-col",children:b.jsxs("div",{className:"relative min-h-0 flex-1",children:[bt,b.jsx(n9,{target:Y,src:Ot,framework:e,remountKey:ue})]})})};function I3({side:t,sessionId:e,variantId:n,url:r,label:s,source:i,isFallback:o=!1}){var C;const l=ut(Zo),u=gt(Zo),d=xi(),f=ut(tp),p=ut(cv),g=m.useRef(!1),v=m.useCallback(()=>{g.current||(g.current=!0,ld({source:i,sessionId:e,variantId:n}))},[i,e,n]),w=m.useCallback(()=>{if(o){u(null);const M=wg("ended",l);d==null||d.capture(M.event,M.properties);return}v();const T={...l};delete T[t];const A=T.left||T.right?T:null;u(A);const I=wg(A?"updated":"ended",A??l);d==null||d.capture(I.event,I.properties)},[o,d,u,t,l,v]),_=m.useMemo(()=>({kind:"variant",sessionId:e,variantId:n}),[e,n]),x=m.useMemo(()=>!f.active||f.sessionId!==e?null:f.variants.find(T=>T.workItemId===n)??null,[e,n,f]),S=m.useMemo(()=>{var A,I;let T=r;if(((A=x==null?void 0:x.preview)==null?void 0:A.kind)==="static_artifact"&&((I=x.refinement)==null?void 0:I.status)==="succeeded"){const M=x.preview.url.includes("?")?"&":"?";T=`${x.preview.url}${M}refinement=${encodeURIComponent(x.refinement.workItemId)}`}return t9({agentApplyMode:p,url:T})},[p,x,r]),k=((C=x==null?void 0:x.refinement)==null?void 0:C.status)==="succeeded"?`${n}:${x.refinement.workItemId}`:n;return b.jsxs("div",{className:"variant-split-secondary","data-cy":"variant-split-pane","data-variant-id":n,children:[b.jsxs("div",{className:"variant-split-secondary-toolbar",children:[b.jsx("span",{className:"variant-split-secondary-label",title:s,children:s}),b.jsx(wc,{label:"Collapse",children:b.jsx("button",{type:"button",className:"variant-split-secondary-close",onClick:w,"aria-label":"Collapse split view",children:b.jsx("svg",{width:"12",height:"12",viewBox:"0 0 12 12","aria-hidden":"true",focusable:"false",children:b.jsx("path",{d:"M2.5 2.5 L9.5 9.5 M9.5 2.5 L2.5 9.5",stroke:"currentColor",strokeWidth:"1.4",strokeLinecap:"round"})})})})]}),b.jsx("div",{className:"variant-split-secondary-body relative min-h-0 flex-1",children:b.jsx(n9,{target:_,src:S,framework:"static",remountKey:k})})]})}function Ite(){const t=ut(ad),e=ut(Wb);return!t||!e?null:Xh.createPortal(b.jsx("div",{"aria-hidden":"true",className:"border-main-border bg-main pointer-events-none fixed top-0 left-0 z-[70] flex max-w-60 items-center gap-2 rounded-md border px-3 py-1.5 shadow-lg",style:{transform:`translate3d(${e.x+12}px, ${e.y+12}px, 0)`},children:b.jsx("span",{className:"text-content truncate text-sm font-medium",children:t.label})}),document.body)}function Ote(){const t=ut(ad),e=ut(Wb),n=ut(Zo),r=gt(ad),s=gt(Zo),i=xi(),o=m.useRef(null),[l,u]=m.useState(null),[d,f]=m.useState("hidden");m.useEffect(()=>{t||(f("hidden"),u(null))},[t]);const p=m.useCallback((v,w)=>{const _=o.current;if(!_)return null;const x=_.getBoundingClientRect();return v<x.left||v>x.right||w<x.top||w>x.bottom?null:v<(x.left+x.right)/2?"left":"right"},[]);if(m.useEffect(()=>{if(!t||!e)return;const v=p(e.x,e.y);u(w=>w===v?w:v),f(w=>{if(w==="exiting")return w;const _=v!==null?"visible":"hidden";return w===_?w:_})},[t,e,p]),m.useEffect(()=>{if(!t)return;const v=w=>{const _=p(w.clientX,w.clientY);if(_&&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[_];S&&(S.sessionId!==x.sessionId||S.variantId!==x.variantId)&&ld(S);const k={...n??{},[_]:x};s(k);const C=wg(n?"updated":"started",k);i==null||i.capture(C.event,C.properties),f("exiting"),window.setTimeout(()=>r(null),220)}else ld(t),f("exiting"),window.setTimeout(()=>r(null),220)};return window.addEventListener("pointerup",v),window.addEventListener("pointercancel",v),()=>{window.removeEventListener("pointerup",v),window.removeEventListener("pointercancel",v)}},[t,p,i,r,s,n]),!t)return null;const g=["variant-drop-zones",d==="visible"&&"is-visible",d==="exiting"&&"is-exiting"].filter(Boolean).join(" ");return b.jsxs("div",{ref:o,className:g,"aria-hidden":"true",children:[b.jsx(O3,{side:"left",hovered:l==="left",canDrop:!!t.url,label:t.label}),b.jsx(O3,{side:"right",hovered:l==="right",canDrop:!!t.url,label:t.label})]})}function O3({side:t,hovered:e,canDrop:n,label:r}){return b.jsxs("div",{className:["variant-drop-zone",`is-${t}`,e&&"is-hover",!n&&"is-disabled"].filter(Boolean).join(" "),children:[b.jsxs("div",{className:"variant-drop-zone-inner",children:[b.jsx("div",{className:`variant-drop-zone-icon is-${t}`}),b.jsx("div",{className:"variant-drop-zone-caption",children:n?`Add ${t} split`:"Split unavailable for this direction"})]}),b.jsx("div",{className:"variant-drop-zone-preview","aria-hidden":"true",children:b.jsx("div",{className:"variant-drop-zone-preview-label",children:r})}),b.jsx("div",{className:"variant-drop-zone-border"})]})}const s9=(t,e,n)=>{var i,o;if(!t.active||t.sessionId!==e)return null;const r=t.variants.find(l=>l.workItemId===n);if(((i=r==null?void 0:r.preview)==null?void 0:i.kind)!=="static_artifact")return null;if(((o=r.refinement)==null?void 0:o.status)!=="succeeded")return r.preview.url;const s=r.preview.url.includes("?")?"&":"?";return`${r.preview.url}${s}refinement=${encodeURIComponent(r.refinement.workItemId)}`},L3=(t,e)=>{if(!t)return;const n=s9(e,t.sessionId,t.variantId);return!n||n===t.url?t:{...t,url:n}},Lte=()=>b.jsx("div",{"data-testid":"preview-boot-skeleton",role:"status","aria-busy":"true","aria-label":"Loading preview",className:"bg-main flex h-full min-h-0 w-full flex-1 flex-col p-3",children:b.jsx("div",{className:"border-main-border relative min-h-0 flex-1 overflow-hidden rounded-lg border",children:b.jsx(QO,{trackGlobalLoaderCount:!1})})}),Nte=({isLoading:t=!1,isInteractionDisabled:e=!1})=>{const{config:n,fetchConfig:r,isLoading:s,error:i}=Xee();return m.useEffect(()=>{r().catch(o=>{Ce==null||Ce.capture("preview_config_load_failed",{message:o instanceof Error?o.message:"unknown_error",attempts:C3})})},[r]),s?b.jsx(Lte,{}):i||!n?b.jsx(Yb,{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:()=>{Ce==null||Ce.capture("preview_config_retry_clicked"),r().catch(o=>{Ce==null||Ce.capture("preview_config_load_failed",{message:o instanceof Error?o.message:"unknown_error",attempts:C3})})}}]}):b.jsx(Dte,{isLoading:t,isInteractionDisabled:e,framework:n.framework,userPort:n.userPort})};function Dte(t){const e=ut(Zo),n=ut(ad),r=ut(tp),s=ut(_g),i=e==null?void 0:e.left,o=e==null?void 0:e.right,l=m.useMemo(()=>{var A,I;if(!r.active||r.projectContext.kind!=="fresh"||!(!!i!=!!o))return;const _=(A=i??o)==null?void 0:A.variantId,x=r.variants.filter(M=>{var R;return M.status==="succeeded"&&((R=M.preview)==null?void 0:R.kind)==="static_artifact"&&M.workItemId!==_}),S=s==null?void 0:s.replace(/[?&]refinement=[^&]*$/,""),C=x.find(M=>{var R;return((R=M.preview)==null?void 0:R.kind)==="static_artifact"&&M.preview.url===S})??x[0];if(((I=C==null?void 0:C.preview)==null?void 0:I.kind)!=="static_artifact")return;const T=s9(r,r.sessionId,C.workItemId);if(T)return{sessionId:r.sessionId,variantId:C.workItemId,label:C.label,url:T,source:"live"}},[r,i,o,s]),u=L3(i,r)??(o?l:void 0),d=L3(o,r)??(i?l:void 0),f=!i&&!!u,p=!o&&!!d,g=!!(u||d),v=b.jsx(Mte,{isInteractionDisabled:t.isInteractionDisabled,framework:t.framework,userPort:t.userPort});return b.jsx("div",{className:"relative flex h-full min-h-0 w-full flex-1 flex-col",children:b.jsxs("div",{className:`variant-preview-region relative flex h-full min-h-0 w-full flex-1 flex-col ${n?"is-dragging":""} ${g?"is-split":""}`,children:[b.jsxs("div",{className:"variant-preview-row flex h-full min-h-0 w-full flex-1",children:[u&&b.jsx(I3,{side:"left",sessionId:u.sessionId,variantId:u.variantId,url:u.url,label:u.label,source:u.source,isFallback:f},`left-${u.sessionId}:${u.variantId}:${u.url}`),!(u&&d)&&b.jsx("div",{className:"variant-preview-primary flex h-full min-h-0 flex-1 flex-col",children:v}),d&&b.jsx(I3,{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}`)]}),b.jsx("div",{className:"variant-preview-atmosphere","aria-hidden":"true"}),b.jsx(Ote,{}),b.jsx(Ite,{})]})})}function To(t){if(t===void 0)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return t}function i9(t,e){t.prototype=Object.create(e.prototype),t.prototype.constructor=t,t.__proto__=e}/*!
142
+ * GSAP 3.15.0
143
+ * https://gsap.com
144
+ *
145
+ * @license Copyright 2008-2026, GreenSock. All rights reserved.
146
+ * Subject to the terms at https://gsap.com/standard-license
147
+ * @author: Jack Doyle, jack@greensock.com
148
+ */var Es={autoSleep:120,force3D:"auto",nullTargetWarn:1,units:{lineHeight:""}},Rh={duration:.5,overwrite:!1,delay:0},Xb,gr,pn,qs=1e8,qt=1/qs,Vw=Math.PI*2,jte=Vw/4,$te=0,o9=Math.sqrt,Fte=Math.cos,Vte=Math.sin,ar=function(e){return typeof e=="string"},Tn=function(e){return typeof e=="function"},Wo=function(e){return typeof e=="number"},Qb=function(e){return typeof e>"u"},eo=function(e){return typeof e=="object"},es=function(e){return e!==!1},Jb=function(){return typeof window<"u"},B0=function(e){return Tn(e)||ar(e)},a9=typeof ArrayBuffer=="function"&&ArrayBuffer.isView||function(){},Cr=Array.isArray,Hte=/random\([^)]+\)/g,zte=/,\s*/g,N3=/(?:-?\.?\d|\.)+/gi,l9=/[-+=.]*\d+[.e\-+]*\d*[e\-+]*\d*/g,Cu=/[-+=.]*\d+[.e-]*\d*[a-z%]*/g,k_=/[-+=.]*\d+\.?\d*(?:e-|e\+)?\d*/gi,c9=/[+-]=-?[.\d]+/,Ute=/[^,'"\[\]\s]+/gi,Bte=/^[+\-=e\s\d]*\d+[.\d]*([a-z]*|%)\s*$/i,Sn,Di,Hw,e4,Ps={},bg={},u9,d9=function(e){return(bg=ud(e,Ps))&&ss},t4=function(e,n){return console.warn("Invalid property",e,"set to",n,"Missing plugin? gsap.registerPlugin()")},Mh=function(e,n){return!n&&console.warn(e)},f9=function(e,n){return e&&(Ps[e]=n)&&bg&&(bg[e]=n)||Ps},Ih=function(){return 0},Zte={suppressEvents:!0,isStart:!0,kill:!1},gm={suppressEvents:!0,kill:!1},Wte={suppressEvents:!0},n4={},Ha=[],zw={},h9,vs={},E_={},D3=30,vm=[],r4="",s4=function(e){var n=e[0],r,s;if(eo(n)||Tn(n)||(e=[e]),!(r=(n._gsap||{}).harness)){for(s=vm.length;s--&&!vm[s].targetTest(n););r=vm[s]}for(s=e.length;s--;)e[s]&&(e[s]._gsap||(e[s]._gsap=new N9(e[s],r)))||e.splice(s,1);return e},ac=function(e){return e._gsap||s4(Gs(e))[0]._gsap},p9=function(e,n,r){return(r=e[n])&&Tn(r)?e[n]():Qb(r)&&e.getAttribute&&e.getAttribute(n)||r},ts=function(e,n){return(e=e.split(",")).forEach(n)||e},In=function(e){return Math.round(e*1e5)/1e5||0},bn=function(e){return Math.round(e*1e7)/1e7||0},Lu=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},qte=function(e,n){for(var r=n.length,s=0;e.indexOf(n[s])<0&&++s<r;);return s<r},Sg=function(){var e=Ha.length,n=Ha.slice(0),r,s;for(zw={},Ha.length=0,r=0;r<e;r++)s=n[r],s&&s._lazy&&(s.render(s._lazy[0],s._lazy[1],!0)._lazy=0)},i4=function(e){return!!(e._initted||e._startAt||e.add)},m9=function(e,n,r,s){Ha.length&&!gr&&Sg(),e.render(n,r,!!(gr&&n<0&&i4(e))),Ha.length&&!gr&&Sg()},g9=function(e){var n=parseFloat(e);return(n||n===0)&&(e+"").match(Ute).length<2?n:ar(e)?e.trim():e},v9=function(e){return e},Ts=function(e,n){for(var r in n)r in e||(e[r]=n[r]);return e},Gte=function(e){return function(n,r){for(var s in r)s in n||s==="duration"&&e||s==="ease"||(n[s]=r[s])}},ud=function(e,n){for(var r in n)e[r]=n[r];return e},j3=function t(e,n){for(var r in n)r!=="__proto__"&&r!=="constructor"&&r!=="prototype"&&(e[r]=eo(n[r])?t(e[r]||(e[r]={}),n[r]):n[r]);return e},kg=function(e,n){var r={},s;for(s in e)s in n||(r[s]=e[s]);return r},Xf=function(e){var n=e.parent||Sn,r=e.keyframes?Gte(Cr(e.keyframes)):Ts;if(es(e.inherit))for(;n;)r(e,n.vars.defaults),n=n.parent||n._dp;return e},Kte=function(e,n){for(var r=e.length,s=r===n.length;s&&r--&&e[r]===n[r];);return r<0},y9=function(e,n,r,s,i){var o=e[s],l;if(i)for(l=n[i];o&&o[i]>l;)o=o._prev;return o?(n._next=o._next,o._next=n):(n._next=e[r],e[r]=n),n._next?n._next._prev=n:e[s]=n,n._prev=o,n.parent=n._dp=e,n},dv=function(e,n,r,s){r===void 0&&(r="_first"),s===void 0&&(s="_last");var i=n._prev,o=n._next;i?i._next=o:e[r]===n&&(e[r]=o),o?o._prev=i:e[s]===n&&(e[s]=i),n._next=n._prev=n.parent=null},Xa=function(e,n){e.parent&&(!n||e.parent.autoRemoveChildren)&&e.parent.remove&&e.parent.remove(e),e._act=0},lc=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},Yte=function(e){for(var n=e.parent;n&&n.parent;)n._dirty=1,n.totalDuration(),n=n.parent;return e},Uw=function(e,n,r,s){return e._startAt&&(gr?e._startAt.revert(gm):e.vars.immediateRender&&!e.vars.autoRevert||e._startAt.render(n,!0,s))},Xte=function t(e){return!e||e._ts&&t(e.parent)},$3=function(e){return e._repeat?dd(e._tTime,e=e.duration()+e._rDelay)*e:0},dd=function(e,n){var r=Math.floor(e=bn(e/n));return e&&r===e?r-1:r},Eg=function(e,n){return(e-n._start)*n._ts+(n._ts>=0?0:n._dirty?n.totalDuration():n._tDur)},fv=function(e){return e._end=bn(e._start+(e._tDur/Math.abs(e._ts||e._rts||qt)||0))},hv=function(e,n){var r=e._dp;return r&&r.smoothChildTiming&&e._ts&&(e._start=bn(r._time-(e._ts>0?n/e._ts:((e._dirty?e.totalDuration():e._tDur)-n)/-e._ts)),fv(e),r._dirty||lc(r,e)),e},_9=function(e,n){var r;if((n._time||!n._dur&&n._initted||n._start<e._time&&(n._dur||!n.add))&&(r=Eg(e.rawTime(),n),(!n._dur||rp(0,n.totalDuration(),r)-n._tTime>qt)&&n.render(r,!0)),lc(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=-qt}},zi=function(e,n,r,s){return n.parent&&Xa(n),n._start=bn((Wo(r)?r:r||e!==Sn?Us(e,r,n):e._time)+n._delay),n._end=bn(n._start+(n.totalDuration()/Math.abs(n.timeScale())||0)),y9(e,n,"_first","_last",e._sort?"_start":0),Bw(n)||(e._recent=n),s||_9(e,n),e._ts<0&&hv(e,e._tTime),e},w9=function(e,n){return(Ps.ScrollTrigger||t4("scrollTrigger",n))&&Ps.ScrollTrigger.create(n,e)},x9=function(e,n,r,s,i){if(a4(e,n,i),!e._initted)return 1;if(!r&&e._pt&&!gr&&(e._dur&&e.vars.lazy!==!1||!e._dur&&e.vars.lazy)&&h9!==ws.frame)return Ha.push(e),e._lazy=[i,s],1},Qte=function t(e){var n=e.parent;return n&&n._ts&&n._initted&&!n._lock&&(n.rawTime()<0||t(n))},Bw=function(e){var n=e.data;return n==="isFromStart"||n==="isStart"},Jte=function(e,n,r,s){var i=e.ratio,o=n<0||!n&&(!e._start&&Qte(e)&&!(!e._initted&&Bw(e))||(e._ts<0||e._dp._ts<0)&&!Bw(e))?0:1,l=e._rDelay,u=0,d,f,p;if(l&&e._repeat&&(u=rp(0,e._tDur,n),f=dd(u,l),e._yoyo&&f&1&&(o=1-o),f!==dd(e._tTime,l)&&(i=1-o,e.vars.repeatRefresh&&e._initted&&e.invalidate())),o!==i||gr||s||e._zTime===qt||!n&&e._zTime){if(!e._initted&&x9(e,n,s,r,u))return;for(p=e._zTime,e._zTime=n||(r?qt:0),r||(r=n&&!p),e.ratio=o,e._from&&(o=1-o),e._time=0,e._tTime=u,d=e._pt;d;)d.r(o,d.d),d=d._next;n<0&&Uw(e,n,r,!0),e._onUpdate&&!r&&xs(e,"onUpdate"),u&&e._repeat&&!r&&e.parent&&xs(e,"onRepeat"),(n>=e._tDur||n<0)&&e.ratio===o&&(o&&Xa(e,1),!r&&!gr&&(xs(e,o?"onComplete":"onReverseComplete",!0),e._prom&&e._prom()))}else e._zTime||(e._zTime=n)},ene=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}},fd=function(e,n,r,s){var i=e._repeat,o=bn(n)||0,l=e._tTime/e._tDur;return l&&!s&&(e._time*=o/e._dur),e._dur=o,e._tDur=i?i<0?1e10:bn(o*(i+1)+e._rDelay*i):o,l>0&&!s&&hv(e,e._tTime=e._tDur*l),e.parent&&fv(e),r||lc(e.parent,e),e},F3=function(e){return e instanceof Yr?lc(e):fd(e,e._dur)},tne={_start:0,endTime:Ih,totalDuration:Ih},Us=function t(e,n,r){var s=e.labels,i=e._recent||tne,o=e.duration()>=qs?i.endTime(!1):e._dur,l,u,d;return ar(n)&&(isNaN(n)||n in s)?(u=n.charAt(0),d=n.substr(-1)==="%",l=n.indexOf("="),u==="<"||u===">"?(l>=0&&(n=n.replace(/=/,"")),(u==="<"?i._start:i.endTime(i._repeat>=0))+(parseFloat(n.substr(1))||0)*(d?(l<0?i:r).totalDuration()/100:1)):l<0?(n in s||(s[n]=o),s[n]):(u=parseFloat(n.charAt(l-1)+n.substr(l+1)),d&&r&&(u=u/100*(Cr(r)?r[0]:r).totalDuration()),l>1?t(e,n.substr(0,l-1),r)+u:o+u)):n==null?o:+n},Qf=function(e,n,r){var s=Wo(n[1]),i=(s?2:1)+(e<2?0:1),o=n[i],l,u;if(s&&(o.duration=n[1]),o.parent=r,e){for(l=o,u=r;u&&!("immediateRender"in l);)l=u.vars.defaults||{},u=es(u.vars.inherit)&&u.parent;o.immediateRender=es(l.immediateRender),e<2?o.runBackwards=1:o.startAt=n[i-1]}return new Un(n[0],o,n[i+1])},ol=function(e,n){return e||e===0?n(e):n},rp=function(e,n,r){return r<e?e:r>n?n:r},kr=function(e,n){return!ar(e)||!(n=Bte.exec(e))?"":n[1]},nne=function(e,n,r){return ol(r,function(s){return rp(e,n,s)})},Zw=[].slice,b9=function(e,n){return e&&eo(e)&&"length"in e&&(!n&&!e.length||e.length-1 in e&&eo(e[0]))&&!e.nodeType&&e!==Di},rne=function(e,n,r){return r===void 0&&(r=[]),e.forEach(function(s){var i;return ar(s)&&!n||b9(s,1)?(i=r).push.apply(i,Gs(s)):r.push(s)})||r},Gs=function(e,n,r){return pn&&!n&&pn.selector?pn.selector(e):ar(e)&&!r&&(Hw||!hd())?Zw.call((n||e4).querySelectorAll(e),0):Cr(e)?rne(e,r):b9(e)?Zw.call(e,0):e?[e]:[]},Ww=function(e){return e=Gs(e)[0]||Mh("Invalid scope")||{},function(n){var r=e.current||e.nativeElement||e;return Gs(n,r.querySelectorAll?r:r===e?Mh("Invalid scope")||e4.createElement("div"):e)}},S9=function(e){return e.sort(function(){return .5-Math.random()})},k9=function(e){if(Tn(e))return e;var n=eo(e)?e:{each:e},r=cc(n.ease),s=n.from||0,i=parseFloat(n.base)||0,o={},l=s>0&&s<1,u=isNaN(s)||l,d=n.axis,f=s,p=s;return ar(s)?f=p={center:.5,edges:.5,end:1}[s]||0:!l&&u&&(f=s[0],p=s[1]),function(g,v,w){var _=(w||n).length,x=o[_],S,k,C,T,A,I,M,R,O;if(!x){if(O=n.grid==="auto"?0:(n.grid||[1,qs])[1],!O){for(M=-qs;M<(M=w[O++].getBoundingClientRect().left)&&O<_;);O<_&&O--}for(x=o[_]=[],S=u?Math.min(O,_)*f-.5:s%O,k=O===qs?0:u?_*p/O-.5:s/O|0,M=0,R=qs,I=0;I<_;I++)C=I%O-S,T=k-(I/O|0),x[I]=A=d?Math.abs(d==="y"?T:C):o9(C*C+T*T),A>M&&(M=A),A<R&&(R=A);s==="random"&&S9(x),x.max=M-R,x.min=R,x.v=_=(parseFloat(n.amount)||parseFloat(n.each)*(O>_?_-1:d?d==="y"?_/O:O:Math.max(O,_/O))||0)*(s==="edges"?-1:1),x.b=_<0?i-_:i,x.u=kr(n.amount||n.each)||0,r=r&&_<0?gne(r):r}return _=(x[g]-x.min)/x.max||0,bn(x.b+(r?r(_):_)*x.v)+x.u}},qw=function(e){var n=Math.pow(10,((e+"").split(".")[1]||"").length);return function(r){var s=bn(Math.round(parseFloat(r)/e)*e*n);return(s-s%1)/n+(Wo(r)?0:kr(r))}},E9=function(e,n){var r=Cr(e),s,i;return!r&&eo(e)&&(s=r=e.radius||qs,e.values?(e=Gs(e.values),(i=!Wo(e[0]))&&(s*=s)):e=qw(e.increment)),ol(n,r?Tn(e)?function(o){return i=e(o),Math.abs(i-o)<=s?i:o}:function(o){for(var l=parseFloat(i?o.x:o),u=parseFloat(i?o.y:0),d=qs,f=0,p=e.length,g,v;p--;)i?(g=e[p].x-l,v=e[p].y-u,g=g*g+v*v):g=Math.abs(e[p]-l),g<d&&(d=g,f=p);return f=!s||d<=s?e[f]:o,i||f===o||Wo(o)?f:f+kr(o)}:qw(e))},C9=function(e,n,r,s){return ol(Cr(e)?!n:r===!0?!!(r=0):!s,function(){return Cr(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})},sne=function(){for(var e=arguments.length,n=new Array(e),r=0;r<e;r++)n[r]=arguments[r];return function(s){return n.reduce(function(i,o){return o(i)},s)}},ine=function(e,n){return function(r){return e(parseFloat(r))+(n||kr(r))}},one=function(e,n,r){return T9(e,n,0,1,r)},P9=function(e,n,r){return ol(r,function(s){return e[~~n(s)]})},ane=function t(e,n,r){var s=n-e;return Cr(e)?P9(e,t(0,e.length),n):ol(r,function(i){return(s+(i-e)%s)%s+e})},lne=function t(e,n,r){var s=n-e,i=s*2;return Cr(e)?P9(e,t(0,e.length-1),n):ol(r,function(o){return o=(i+(o-e)%i)%i||0,e+(o>s?i-o:o)})},Oh=function(e){return e.replace(Hte,function(n){var r=n.indexOf("[")+1,s=n.substring(r||7,r?n.indexOf("]"):n.length-1).split(zte);return C9(r?s:+s[0],r?0:+s[1],+s[2]||1e-5)})},T9=function(e,n,r,s,i){var o=n-e,l=s-r;return ol(i,function(u){return r+((u-e)/o*l||0)})},cne=function t(e,n,r,s){var i=isNaN(e+n)?0:function(v){return(1-v)*e+v*n};if(!i){var o=ar(e),l={},u,d,f,p,g;if(r===!0&&(s=1)&&(r=null),o)e={p:e},n={p:n};else if(Cr(e)&&!Cr(n)){for(f=[],p=e.length,g=p-2,d=1;d<p;d++)f.push(t(e[d-1],e[d]));p--,i=function(w){w*=p;var _=Math.min(g,~~w);return f[_](w-_)},r=n}else s||(e=ud(Cr(e)?[]:{},e));if(!f){for(u in n)o4.call(l,e,u,"get",n[u]);i=function(w){return u4(w,l)||(o?e.p:e)}}}return ol(r,i)},V3=function(e,n,r){var s=e.labels,i=qs,o,l,u;for(o in s)l=s[o]-n,l<0==!!r&&l&&i>(l=Math.abs(l))&&(u=o,i=l);return u},xs=function(e,n,r){var s=e.vars,i=s[n],o=pn,l=e._ctx,u,d,f;if(i)return u=s[n+"Params"],d=s.callbackScope||e,r&&Ha.length&&Sg(),l&&(pn=l),f=u?i.apply(d,u):i.call(d),pn=o,f},Rf=function(e){return Xa(e),e.scrollTrigger&&e.scrollTrigger.kill(!!gr),e.progress()<1&&xs(e,"onInterrupt"),e},Pu,A9=[],R9=function(e){if(e)if(e=!e.name&&e.default||e,Jb()||e.headless){var n=e.name,r=Tn(e),s=n&&!r&&e.init?function(){this._props=[]}:e,i={init:Ih,render:u4,add:o4,kill:Cne,modifier:Ene,rawVars:0},o={targetTest:0,get:0,getSetter:c4,aliases:{},register:0};if(hd(),e!==s){if(vs[n])return;Ts(s,Ts(kg(e,i),o)),ud(s.prototype,ud(i,kg(e,o))),vs[s.prop=n]=s,e.targetTest&&(vm.push(s),n4[n]=1),n=(n==="css"?"CSS":n.charAt(0).toUpperCase()+n.substr(1))+"Plugin"}f9(n,s),e.register&&e.register(ss,s,ns)}else A9.push(e)},Zt=255,Mf={aqua:[0,Zt,Zt],lime:[0,Zt,0],silver:[192,192,192],black:[0,0,0],maroon:[128,0,0],teal:[0,128,128],blue:[0,0,Zt],navy:[0,0,128],white:[Zt,Zt,Zt],olive:[128,128,0],yellow:[Zt,Zt,0],orange:[Zt,165,0],gray:[128,128,128],purple:[128,0,128],green:[0,128,0],red:[Zt,0,0],pink:[Zt,192,203],cyan:[0,Zt,Zt],transparent:[Zt,Zt,Zt,0]},C_=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)*Zt+.5|0},M9=function(e,n,r){var s=e?Wo(e)?[e>>16,e>>8&Zt,e&Zt]:0:Mf.black,i,o,l,u,d,f,p,g,v,w;if(!s){if(e.substr(-1)===","&&(e=e.substr(0,e.length-1)),Mf[e])s=Mf[e];else if(e.charAt(0)==="#"){if(e.length<6&&(i=e.charAt(1),o=e.charAt(2),l=e.charAt(3),e="#"+i+i+o+o+l+l+(e.length===5?e.charAt(4)+e.charAt(4):"")),e.length===9)return s=parseInt(e.substr(1,6),16),[s>>16,s>>8&Zt,s&Zt,parseInt(e.substr(7),16)/255];e=parseInt(e.substr(1),16),s=[e>>16,e>>8&Zt,e&Zt]}else if(e.substr(0,3)==="hsl"){if(s=w=e.match(N3),!n)u=+s[0]%360/360,d=+s[1]/100,f=+s[2]/100,o=f<=.5?f*(d+1):f+d-f*d,i=f*2-o,s.length>3&&(s[3]*=1),s[0]=C_(u+1/3,i,o),s[1]=C_(u,i,o),s[2]=C_(u-1/3,i,o);else if(~e.indexOf("="))return s=e.match(l9),r&&s.length<4&&(s[3]=1),s}else s=e.match(N3)||Mf.transparent;s=s.map(Number)}return n&&!w&&(i=s[0]/Zt,o=s[1]/Zt,l=s[2]/Zt,p=Math.max(i,o,l),g=Math.min(i,o,l),f=(p+g)/2,p===g?u=d=0:(v=p-g,d=f>.5?v/(2-p-g):v/(p+g),u=p===i?(o-l)/v+(o<l?6:0):p===o?(l-i)/v+2:(i-o)/v+4,u*=60),s[0]=~~(u+.5),s[1]=~~(d*100+.5),s[2]=~~(f*100+.5)),r&&s.length<4&&(s[3]=1),s},I9=function(e){var n=[],r=[],s=-1;return e.split(za).forEach(function(i){var o=i.match(Cu)||[];n.push.apply(n,o),r.push(s+=o.length+1)}),n.c=r,n},H3=function(e,n,r){var s="",i=(e+s).match(za),o=n?"hsla(":"rgba(",l=0,u,d,f,p;if(!i)return e;if(i=i.map(function(g){return(g=M9(g,n,1))&&o+(n?g[0]+","+g[1]+"%,"+g[2]+"%,"+g[3]:g.join(","))+")"}),r&&(f=I9(e),u=r.c,u.join(s)!==f.c.join(s)))for(d=e.replace(za,"1").split(Cu),p=d.length-1;l<p;l++)s+=d[l]+(~u.indexOf(l)?i.shift()||o+"0,0,0,0)":(f.length?f:i.length?i:r).shift());if(!d)for(d=e.split(za),p=d.length-1;l<p;l++)s+=d[l]+i[l];return s+d[p]},za=(function(){var t="(?:\\b(?:(?:rgb|rgba|hsl|hsla)\\(.+?\\))|\\B#(?:[0-9a-f]{3,4}){1,2}\\b",e;for(e in Mf)t+="|"+e+"\\b";return new RegExp(t+")","gi")})(),une=/hsl[a]?\(/,O9=function(e){var n=e.join(" "),r;if(za.lastIndex=0,za.test(n))return r=une.test(n),e[1]=H3(e[1],r),e[0]=H3(e[0],r,I9(e[1])),!0},Lh,ws=(function(){var t=Date.now,e=500,n=33,r=t(),s=r,i=1e3/240,o=i,l=[],u,d,f,p,g,v,w=function _(x){var S=t()-s,k=x===!0,C,T,A,I;if((S>e||S<0)&&(r+=S-n),s+=S,A=s-r,C=A-o,(C>0||k)&&(I=++p.frame,g=A-p.time*1e3,p.time=A=A/1e3,o+=C+(C>=i?4:i-C),T=1),k||(u=d(_)),T)for(v=0;v<l.length;v++)l[v](A,g,I,x)};return p={time:0,frame:0,tick:function(){w(!0)},deltaRatio:function(x){return g/(1e3/(x||60))},wake:function(){u9&&(!Hw&&Jb()&&(Di=Hw=window,e4=Di.document||{},Ps.gsap=ss,(Di.gsapVersions||(Di.gsapVersions=[])).push(ss.version),d9(bg||Di.GreenSockGlobals||!Di.gsap&&Di||{}),A9.forEach(R9)),f=typeof requestAnimationFrame<"u"&&requestAnimationFrame,u&&p.sleep(),d=f||function(x){return setTimeout(x,o-p.time*1e3+1|0)},Lh=1,w(2))},sleep:function(){(f?cancelAnimationFrame:clearTimeout)(u),Lh=0,d=Ih},lagSmoothing:function(x,S){e=x||1/0,n=Math.min(S||33,e)},fps:function(x){i=1e3/(x||240),o=p.time*1e3+i},add:function(x,S,k){var C=S?function(T,A,I,M){x(T,A,I,M),p.remove(C)}:x;return p.remove(x),l[k?"unshift":"push"](C),hd(),C},remove:function(x,S){~(S=l.indexOf(x))&&l.splice(S,1)&&v>=S&&v--},_listeners:l},p})(),hd=function(){return!Lh&&ws.wake()},Et={},dne=/^[\d.\-M][\d.\-,\s]/,fne=/["']/g,hne=function(e){for(var n={},r=e.substr(1,e.length-3).split(":"),s=r[0],i=1,o=r.length,l,u,d;i<o;i++)u=r[i],l=i!==o-1?u.lastIndexOf(","):u.length,d=u.substr(0,l),n[s]=isNaN(d)?d.replace(fne,"").trim():+d,s=u.substr(l+1).trim();return n},pne=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)},mne=function(e){var n=(e+"").split("("),r=Et[n[0]];return r&&n.length>1&&r.config?r.config.apply(null,~e.indexOf("{")?[hne(n[1])]:pne(e).split(",").map(g9)):Et._CE&&dne.test(e)?Et._CE("",e):r},gne=function(e){return function(n){return 1-e(1-n)}},cc=function(e,n){return e&&(Tn(e)?e:Et[e]||mne(e))||n},bc=function(e,n,r,s){r===void 0&&(r=function(u){return 1-n(1-u)}),s===void 0&&(s=function(u){return u<.5?n(u*2)/2:1-n((1-u)*2)/2});var i={easeIn:n,easeOut:r,easeInOut:s},o;return ts(e,function(l){Et[l]=Ps[l]=i,Et[o=l.toLowerCase()]=r;for(var u in i)Et[o+(u==="easeIn"?".in":u==="easeOut"?".out":".inOut")]=Et[l+"."+u]=i[u]}),i},L9=function(e){return function(n){return n<.5?(1-e(1-n*2))/2:.5+e((n-.5)*2)/2}},P_=function t(e,n,r){var s=n>=1?n:1,i=(r||(e?.3:.45))/(n<1?n:1),o=i/Vw*(Math.asin(1/s)||0),l=function(f){return f===1?1:s*Math.pow(2,-10*f)*Vte((f-o)*i)+1},u=e==="out"?l:e==="in"?function(d){return 1-l(1-d)}:L9(l);return i=Vw/i,u.config=function(d,f){return t(e,d,f)},u},T_=function t(e,n){n===void 0&&(n=1.70158);var r=function(o){return o?--o*o*((n+1)*o+n)+1:0},s=e==="out"?r:e==="in"?function(i){return 1-r(1-i)}:L9(r);return s.config=function(i){return t(e,i)},s};ts("Linear,Quad,Cubic,Quart,Quint,Strong",function(t,e){var n=e<5?e+1:e;bc(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})});Et.Linear.easeNone=Et.none=Et.Linear.easeIn;bc("Elastic",P_("in"),P_("out"),P_());(function(t,e){var n=1/e,r=2*n,s=2.5*n,i=function(l){return l<n?t*l*l:l<r?t*Math.pow(l-1.5/e,2)+.75:l<s?t*(l-=2.25/e)*l+.9375:t*Math.pow(l-2.625/e,2)+.984375};bc("Bounce",function(o){return 1-i(1-o)},i)})(7.5625,2.75);bc("Expo",function(t){return Math.pow(2,10*(t-1))*t+t*t*t*t*t*t*(1-t)});bc("Circ",function(t){return-(o9(1-t*t)-1)});bc("Sine",function(t){return t===1?1:-Fte(t*jte)+1});bc("Back",T_("in"),T_("out"),T_());Et.SteppedEase=Et.steps=Ps.SteppedEase={config:function(e,n){e===void 0&&(e=1);var r=1/e,s=e+(n?0:1),i=n?1:0,o=1-qt;return function(l){return((s*rp(0,o,l)|0)+i)*r}}};Rh.ease=Et["quad.out"];ts("onComplete,onUpdate,onStart,onRepeat,onReverseComplete,onInterrupt",function(t){return r4+=t+","+t+"Params,"});var N9=function(e,n){this.id=$te++,e._gsap=this,this.target=e,this.harness=n,this.get=n?n.get:p9,this.set=n?n.getSetter:c4},Nh=(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,fd(this,+n.duration,1,1),this.data=n.data,pn&&(this._ctx=pn,pn.data.push(this)),Lh||ws.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,fd(this,this._repeat<0?r:(r-this._repeat*this._rDelay)/(this._repeat+1))):this._tDur},e.totalTime=function(r,s){if(hd(),!arguments.length)return this._tTime;var i=this._dp;if(i&&i.smoothChildTiming&&this._ts){for(hv(this,r),!i._dp||i.parent||_9(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)&&zi(this._dp,this,this._start-this._delay)}return(this._tTime!==r||!this._dur&&!s||this._initted&&Math.abs(this._zTime)===qt||!this._initted&&this._dur&&r||!r&&!this._initted&&(this.add||this._ptLookup))&&(this._ts||(this._pTime=r),m9(this,r,s)),this},e.time=function(r,s){return arguments.length?this.totalTime(Math.min(this.totalDuration(),r+$3(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)+$3(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?dd(this._tTime,i)+1:1},e.timeScale=function(r,s){if(!arguments.length)return this._rts===-qt?0:this._rts;if(this._rts===r)return this;var i=this.parent&&this._ts?Eg(this.parent._time,this):this._tTime;return this._rts=+r||0,this._ts=this._ps||r===-qt?0:this._rts,this.totalTime(rp(-Math.abs(this._delay),this.totalDuration(),i),s!==!1),fv(this),Yte(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):(hd(),this._ts=this._rts,this.totalTime(this.parent&&!this.parent.smoothChildTiming?this.rawTime():this._tTime||this._pTime,this.progress()===1&&Math.abs(this._zTime)!==qt&&(this._tTime-=qt)))),this):this._ps},e.startTime=function(r){if(arguments.length){this._start=bn(r);var s=this.parent||this._dp;return s&&(s._sort||!this.parent)&&zi(s,this,this._start-this._delay),this}return this._start},e.endTime=function(r){return this._start+(es(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?Eg(s.rawTime(r),this):this._tTime:this._tTime},e.revert=function(r){r===void 0&&(r=Wte);var s=gr;return gr=r,i4(this)&&(this.timeline&&this.timeline.revert(r),this.totalTime(-.01,r.suppressEvents)),this.data!=="nested"&&r.kill!==!1&&this.kill(),gr=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,F3(this)):this._repeat===-2?1/0:this._repeat},e.repeatDelay=function(r){if(arguments.length){var s=this._time;return this._rDelay=r,F3(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(Us(this,r),es(s))},e.restart=function(r,s){return this.play().totalTime(r?-this._delay:0,es(s)),this._dur||(this._zTime=-qt),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?-qt:0)),this):this._rts<0},e.invalidate=function(){return this._initted=this._act=0,this._zTime=-qt,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)-qt)},e.eventCallback=function(r,s,i){var o=this.vars;return arguments.length>1?(s?(o[r]=s,i&&(o[r+"Params"]=i),r==="onUpdate"&&(this._onUpdate=s)):delete o[r],this):o[r]},e.then=function(r){var s=this,i=s._prom;return new Promise(function(o){var l=Tn(r)?r:v9,u=function(){var f=s.then;s.then=null,i&&i(),Tn(l)&&(l=l(s))&&(l.then||l===s)&&(s.then=f),o(l),s.then=f};s._initted&&s.totalProgress()===1&&s._ts>=0||!s._tTime&&s._ts<0?u():s._prom=u})},e.kill=function(){Rf(this)},t})();Ts(Nh.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:-qt,_prom:0,_ps:!1,_rts:1});var Yr=(function(t){i9(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=es(r.sortChildren),Sn&&zi(r.parent||Sn,To(i),s),r.reversed&&i.reverse(),r.paused&&i.paused(!0),r.scrollTrigger&&w9(To(i),r.scrollTrigger),i}var n=e.prototype;return n.to=function(s,i,o){return Qf(0,arguments,this),this},n.from=function(s,i,o){return Qf(1,arguments,this),this},n.fromTo=function(s,i,o,l){return Qf(2,arguments,this),this},n.set=function(s,i,o){return i.duration=0,i.parent=this,Xf(i).repeatDelay||(i.repeat=0),i.immediateRender=!!i.immediateRender,new Un(s,i,Us(this,o),1),this},n.call=function(s,i,o){return zi(this,Un.delayedCall(0,s,i),o)},n.staggerTo=function(s,i,o,l,u,d,f){return o.duration=i,o.stagger=o.stagger||l,o.onComplete=d,o.onCompleteParams=f,o.parent=this,new Un(s,o,Us(this,u)),this},n.staggerFrom=function(s,i,o,l,u,d,f){return o.runBackwards=1,Xf(o).immediateRender=es(o.immediateRender),this.staggerTo(s,i,o,l,u,d,f)},n.staggerFromTo=function(s,i,o,l,u,d,f,p){return l.startAt=o,Xf(l).immediateRender=es(l.immediateRender),this.staggerTo(s,i,l,u,d,f,p)},n.render=function(s,i,o){var l=this._time,u=this._dirty?this.totalDuration():this._tDur,d=this._dur,f=s<=0?0:bn(s),p=this._zTime<0!=s<0&&(this._initted||!d),g,v,w,_,x,S,k,C,T,A,I,M;if(this!==Sn&&f>u&&s>=0&&(f=u),f!==this._tTime||o||p){if(l!==this._time&&d&&(f+=this._time-l,s+=this._time-l),g=f,T=this._start,C=this._ts,S=!C,p&&(d||(l=this._zTime),(s||!i)&&(this._zTime=s)),this._repeat){if(I=this._yoyo,x=d+this._rDelay,this._repeat<-1&&s<0)return this.totalTime(x*100+s,i,o);if(g=bn(f%x),f===u?(_=this._repeat,g=d):(A=bn(f/x),_=~~A,_&&_===A&&(g=d,_--),g>d&&(g=d)),A=dd(this._tTime,x),!l&&this._tTime&&A!==_&&this._tTime-A*x-this._dur<=0&&(A=_),I&&_&1&&(g=d-g,M=1),_!==A&&!this._lock){var R=I&&A&1,O=R===(I&&_&1);if(_<A&&(R=!R),l=R?0:f%d?d:f,this._lock=1,this.render(l||(M?0:bn(_*x)),i,!d)._lock=0,this._tTime=f,!i&&this.parent&&xs(this,"onRepeat"),this.vars.repeatRefresh&&!M&&(this.invalidate()._lock=1,A=_),l&&l!==this._time||S!==!this._ts||this.vars.onRepeat&&!this.parent&&!this._act)return this;if(d=this._dur,u=this._tDur,O&&(this._lock=2,l=R?d:-1e-4,this.render(l,!0),this.vars.repeatRefresh&&!M&&this.invalidate()),this._lock=0,!this._ts&&!S)return this}}if(this._hasPause&&!this._forcing&&this._lock<2&&(k=ene(this,bn(l),bn(g)),k&&(f-=g-(g=k._start))),this._tTime=f,this._time=g,this._act=!!C,this._initted||(this._onUpdate=this.vars.onUpdate,this._initted=1,this._zTime=s,l=0),!l&&f&&d&&!i&&!A&&(xs(this,"onStart"),this._tTime!==f))return this;if(g>=l&&s>=0)for(v=this._first;v;){if(w=v._next,(v._act||g>=v._start)&&v._ts&&k!==v){if(v.parent!==this)return this.render(s,i,o);if(v.render(v._ts>0?(g-v._start)*v._ts:(v._dirty?v.totalDuration():v._tDur)+(g-v._start)*v._ts,i,o),g!==this._time||!this._ts&&!S){k=0,w&&(f+=this._zTime=-qt);break}}v=w}else{v=this._last;for(var N=s<0?s:g;v;){if(w=v._prev,(v._act||N<=v._end)&&v._ts&&k!==v){if(v.parent!==this)return this.render(s,i,o);if(v.render(v._ts>0?(N-v._start)*v._ts:(v._dirty?v.totalDuration():v._tDur)+(N-v._start)*v._ts,i,o||gr&&i4(v)),g!==this._time||!this._ts&&!S){k=0,w&&(f+=this._zTime=N?-qt:qt);break}}v=w}}if(k&&!i&&(this.pause(),k.render(g>=l?0:-qt)._zTime=g>=l?1:-1,this._ts))return this._start=T,fv(this),this.render(s,i,o);this._onUpdate&&!i&&xs(this,"onUpdate",!0),(f===u&&this._tTime>=this.totalDuration()||!f&&l)&&(T===this._start||Math.abs(C)!==Math.abs(this._ts))&&(this._lock||((s||!d)&&(f===u&&this._ts>0||!f&&this._ts<0)&&Xa(this,1),!i&&!(s<0&&!l)&&(f||l||!u)&&(xs(this,f===u&&s>=0?"onComplete":"onReverseComplete",!0),this._prom&&!(f<u&&this.timeScale()>0)&&this._prom())))}return this},n.add=function(s,i){var o=this;if(Wo(i)||(i=Us(this,i,s)),!(s instanceof Nh)){if(Cr(s))return s.forEach(function(l){return o.add(l,i)}),this;if(ar(s))return this.addLabel(s,i);if(Tn(s))s=Un.delayedCall(0,s);else return this}return this!==s?zi(this,s,i):this},n.getChildren=function(s,i,o,l){s===void 0&&(s=!0),i===void 0&&(i=!0),o===void 0&&(o=!0),l===void 0&&(l=-qs);for(var u=[],d=this._first;d;)d._start>=l&&(d instanceof Un?i&&u.push(d):(o&&u.push(d),s&&u.push.apply(u,d.getChildren(!0,i,o)))),d=d._next;return u},n.getById=function(s){for(var i=this.getChildren(1,1,1),o=i.length;o--;)if(i[o].vars.id===s)return i[o]},n.remove=function(s){return ar(s)?this.removeLabel(s):Tn(s)?this.killTweensOf(s):(s.parent===this&&dv(this,s),s===this._recent&&(this._recent=this._last),lc(this))},n.totalTime=function(s,i){return arguments.length?(this._forcing=1,!this._dp&&this._ts&&(this._start=bn(ws.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]=Us(this,i),this},n.removeLabel=function(s){return delete this.labels[s],this},n.addPause=function(s,i,o){var l=Un.delayedCall(0,i||Ih,o);return l.data="isPause",this._hasPause=1,zi(this,l,Us(this,s))},n.removePause=function(s){var i=this._first;for(s=Us(this,s);i;)i._start===s&&i.data==="isPause"&&Xa(i),i=i._next},n.killTweensOf=function(s,i,o){for(var l=this.getTweensOf(s,o),u=l.length;u--;)Na!==l[u]&&l[u].kill(s,i);return this},n.getTweensOf=function(s,i){for(var o=[],l=Gs(s),u=this._first,d=Wo(i),f;u;)u instanceof Un?qte(u._targets,l)&&(d?(!Na||u._initted&&u._ts)&&u.globalTime(0)<=i&&u.globalTime(u.totalDuration())>i:!i||u.isActive())&&o.push(u):(f=u.getTweensOf(l,i)).length&&o.push.apply(o,f),u=u._next;return o},n.tweenTo=function(s,i){i=i||{};var o=this,l=Us(o,s),u=i,d=u.startAt,f=u.onStart,p=u.onStartParams,g=u.immediateRender,v,w=Un.to(o,Ts({ease:i.ease||"none",lazy:!1,immediateRender:!1,time:l,overwrite:"auto",duration:i.duration||Math.abs((l-(d&&"time"in d?d.time:o._time))/o.timeScale())||qt,onStart:function(){if(o.pause(),!v){var x=i.duration||Math.abs((l-(d&&"time"in d?d.time:o._time))/o.timeScale());w._dur!==x&&fd(w,x,0,1).render(w._time,!0,!0),v=1}f&&f.apply(w,p||[])}},i));return g?w.render(0):w},n.tweenFromTo=function(s,i,o){return this.tweenTo(i,Ts({startAt:{time:Us(this,s)}},o))},n.recent=function(){return this._recent},n.nextLabel=function(s){return s===void 0&&(s=this._time),V3(this,Us(this,s))},n.previousLabel=function(s){return s===void 0&&(s=this._time),V3(this,Us(this,s),1)},n.currentLabel=function(s){return arguments.length?this.seek(s,!0):this.previousLabel(this._time+qt)},n.shiftChildren=function(s,i,o){o===void 0&&(o=0);var l=this._first,u=this.labels,d;for(s=bn(s);l;)l._start>=o&&(l._start+=s,l._end+=s),l=l._next;if(i)for(d in u)u[d]>=o&&(u[d]+=s);return lc(this)},n.invalidate=function(s){var i=this._first;for(this._lock=0;i;)i.invalidate(s),i=i._next;return t.prototype.invalidate.call(this,s)},n.clear=function(s){s===void 0&&(s=!0);for(var i=this._first,o;i;)o=i._next,this.remove(i),i=o;return this._dp&&(this._time=this._tTime=this._pTime=0),s&&(this.labels={}),lc(this)},n.totalDuration=function(s){var i=0,o=this,l=o._last,u=qs,d,f,p;if(arguments.length)return o.timeScale((o._repeat<0?o.duration():o.totalDuration())/(o.reversed()?-s:s));if(o._dirty){for(p=o.parent;l;)d=l._prev,l._dirty&&l.totalDuration(),f=l._start,f>u&&o._sort&&l._ts&&!o._lock?(o._lock=1,zi(o,l,f-l._delay,1)._lock=0):u=f,f<0&&l._ts&&(i-=f,(!p&&!o._dp||p&&p.smoothChildTiming)&&(o._start+=bn(f/o._ts),o._time-=f,o._tTime-=f),o.shiftChildren(-f,!1,-1/0),u=0),l._end>i&&l._ts&&(i=l._end),l=d;fd(o,o===Sn&&o._time>i?o._time:i,1,1),o._dirty=0}return o._tDur},e.updateRoot=function(s){if(Sn._ts&&(m9(Sn,Eg(s,Sn)),h9=ws.frame),ws.frame>=D3){D3+=Es.autoSleep||120;var i=Sn._first;if((!i||!i._ts)&&Es.autoSleep&&ws._listeners.length<2){for(;i&&!i._ts;)i=i._next;i||ws.sleep()}}},e})(Nh);Ts(Yr.prototype,{_lock:0,_hasPause:0,_forcing:0});var vne=function(e,n,r,s,i,o,l){var u=new ns(this._pt,e,n,0,1,H9,null,i),d=0,f=0,p,g,v,w,_,x,S,k;for(u.b=r,u.e=s,r+="",s+="",(S=~s.indexOf("random("))&&(s=Oh(s)),o&&(k=[r,s],o(k,e,n),r=k[0],s=k[1]),g=r.match(k_)||[];p=k_.exec(s);)w=p[0],_=s.substring(d,p.index),v?v=(v+1)%5:_.substr(-5)==="rgba("&&(v=1),w!==g[f++]&&(x=parseFloat(g[f-1])||0,u._pt={_next:u._pt,p:_||f===1?_:",",s:x,c:w.charAt(1)==="="?Lu(x,w)-x:parseFloat(w)-x,m:v&&v<4?Math.round:0},d=k_.lastIndex);return u.c=d<s.length?s.substring(d,s.length):"",u.fp=l,(c9.test(s)||S)&&(u.e=0),this._pt=u,u},o4=function(e,n,r,s,i,o,l,u,d,f){Tn(s)&&(s=s(i||0,e,o));var p=e[n],g=r!=="get"?r:Tn(p)?d?e[n.indexOf("set")||!Tn(e["get"+n.substr(3)])?n:"get"+n.substr(3)](d):e[n]():p,v=Tn(p)?d?bne:F9:l4,w;if(ar(s)&&(~s.indexOf("random(")&&(s=Oh(s)),s.charAt(1)==="="&&(w=Lu(g,s)+(kr(g)||0),(w||w===0)&&(s=w))),!f||g!==s||Gw)return!isNaN(g*s)&&s!==""?(w=new ns(this._pt,e,n,+g||0,s-(g||0),typeof p=="boolean"?kne:V9,0,v),d&&(w.fp=d),l&&w.modifier(l,this,e),this._pt=w):(!p&&!(n in e)&&t4(n,s),vne.call(this,e,n,g,s,v,u||Es.stringFilter,d))},yne=function(e,n,r,s,i){if(Tn(e)&&(e=Jf(e,i,n,r,s)),!eo(e)||e.style&&e.nodeType||Cr(e)||a9(e))return ar(e)?Jf(e,i,n,r,s):e;var o={},l;for(l in e)o[l]=Jf(e[l],i,n,r,s);return o},D9=function(e,n,r,s,i,o){var l,u,d,f;if(vs[e]&&(l=new vs[e]).init(i,l.rawVars?n[e]:yne(n[e],s,i,o,r),r,s,o)!==!1&&(r._pt=u=new ns(r._pt,i,e,0,1,l.render,l,0,l.priority),r!==Pu))for(d=r._ptLookup[r._targets.indexOf(i)],f=l._props.length;f--;)d[l._props[f]]=u;return l},Na,Gw,a4=function t(e,n,r){var s=e.vars,i=s.ease,o=s.startAt,l=s.immediateRender,u=s.lazy,d=s.onUpdate,f=s.runBackwards,p=s.yoyoEase,g=s.keyframes,v=s.autoRevert,w=e._dur,_=e._startAt,x=e._targets,S=e.parent,k=S&&S.data==="nested"?S.vars.targets:x,C=e._overwrite==="auto"&&!Xb,T=e.timeline,A=s.easeReverse||p,I,M,R,O,N,D,$,Y,B,G,V,K,U;if(T&&(!g||!i)&&(i="none"),e._ease=cc(i,Rh.ease),e._rEase=A&&(cc(A)||e._ease),e._from=!T&&!!s.runBackwards,e._from&&(e.ratio=1),!T||g&&!s.stagger){if(Y=x[0]?ac(x[0]).harness:0,K=Y&&s[Y.prop],I=kg(s,n4),_&&(_._zTime<0&&_.progress(1),n<0&&f&&l&&!v?_.render(-1,!0):_.revert(f&&w?gm:Zte),_._lazy=0),o){if(Xa(e._startAt=Un.set(x,Ts({data:"isStart",overwrite:!1,parent:S,immediateRender:!0,lazy:!_&&es(u),startAt:null,delay:0,onUpdate:d&&function(){return xs(e,"onUpdate")},stagger:0},o))),e._startAt._dp=0,e._startAt._sat=e,n<0&&(gr||!l&&!v)&&e._startAt.revert(gm),l&&w&&n<=0&&r<=0){n&&(e._zTime=n);return}}else if(f&&w&&!_){if(n&&(l=!1),R=Ts({overwrite:!1,data:"isFromStart",lazy:l&&!_&&es(u),immediateRender:l,stagger:0,parent:S},I),K&&(R[Y.prop]=K),Xa(e._startAt=Un.set(x,R)),e._startAt._dp=0,e._startAt._sat=e,n<0&&(gr?e._startAt.revert(gm):e._startAt.render(-1,!0)),e._zTime=n,!l)t(e._startAt,qt,qt);else if(!n)return}for(e._pt=e._ptCache=0,u=w&&es(u)||u&&!w,M=0;M<x.length;M++){if(N=x[M],$=N._gsap||s4(x)[M]._gsap,e._ptLookup[M]=G={},zw[$.id]&&Ha.length&&Sg(),V=k===x?M:k.indexOf(N),Y&&(B=new Y).init(N,K||I,e,V,k)!==!1&&(e._pt=O=new ns(e._pt,N,B.name,0,1,B.render,B,0,B.priority),B._props.forEach(function(ee){G[ee]=O}),B.priority&&(D=1)),!Y||K)for(R in I)vs[R]&&(B=D9(R,I,e,V,N,k))?B.priority&&(D=1):G[R]=O=o4.call(e,N,R,"get",I[R],V,k,0,s.stringFilter);e._op&&e._op[M]&&e.kill(N,e._op[M]),C&&e._pt&&(Na=e,Sn.killTweensOf(N,G,e.globalTime(n)),U=!e.parent,Na=0),e._pt&&u&&(zw[$.id]=1)}D&&z9(e),e._onInit&&e._onInit(e)}e._onUpdate=d,e._initted=(!e._op||e._pt)&&!U,g&&n<=0&&T.render(qs,!0,!0)},_ne=function(e,n,r,s,i,o,l,u){var d=(e._pt&&e._ptCache||(e._ptCache={}))[n],f,p,g,v;if(!d)for(d=e._ptCache[n]=[],g=e._ptLookup,v=e._targets.length;v--;){if(f=g[v][n],f&&f.d&&f.d._pt)for(f=f.d._pt;f&&f.p!==n&&f.fp!==n;)f=f._next;if(!f)return Gw=1,e.vars[n]="+=0",a4(e,l),Gw=0,u?Mh(n+" not eligible for reset. Try splitting into individual properties"):1;d.push(f)}for(v=d.length;v--;)p=d[v],f=p._pt||p,f.s=(s||s===0)&&!i?s:f.s+(s||0)+o*f.c,f.c=r-f.s,p.e&&(p.e=In(r)+kr(p.e)),p.b&&(p.b=f.s+kr(p.b))},wne=function(e,n){var r=e[0]?ac(e[0]).harness:0,s=r&&r.aliases,i,o,l,u;if(!s)return n;i=ud({},n);for(o in s)if(o in i)for(u=s[o].split(","),l=u.length;l--;)i[u[l]]=i[o];return i},xne=function(e,n,r,s){var i=n.ease||s||"power1.inOut",o,l;if(Cr(n))l=r[e]||(r[e]=[]),n.forEach(function(u,d){return l.push({t:d/(n.length-1)*100,v:u,e:i})});else for(o in n)l=r[o]||(r[o]=[]),o==="ease"||l.push({t:parseFloat(e),v:n[o],e:i})},Jf=function(e,n,r,s,i){return Tn(e)?e.call(n,r,s,i):ar(e)&&~e.indexOf("random(")?Oh(e):e},j9=r4+"repeat,repeatDelay,yoyo,repeatRefresh,yoyoEase,easeReverse,autoRevert",$9={};ts(j9+",id,stagger,delay,duration,paused,scrollTrigger",function(t){return $9[t]=1});var Un=(function(t){i9(e,t);function e(r,s,i,o){var l;typeof s=="number"&&(i.duration=s,s=i,i=null),l=t.call(this,o?s:Xf(s))||this;var u=l.vars,d=u.duration,f=u.delay,p=u.immediateRender,g=u.stagger,v=u.overwrite,w=u.keyframes,_=u.defaults,x=u.scrollTrigger,S=s.parent||Sn,k=(Cr(r)||a9(r)?Wo(r[0]):"length"in s)?[r]:Gs(r),C,T,A,I,M,R,O,N;if(l._targets=k.length?s4(k):Mh("GSAP target "+r+" not found. https://gsap.com",!Es.nullTargetWarn)||[],l._ptLookup=[],l._overwrite=v,w||g||B0(d)||B0(f)){s=l.vars;var D=s.easeReverse||s.yoyoEase;if(C=l.timeline=new Yr({data:"nested",defaults:_||{},targets:S&&S.data==="nested"?S.vars.targets:k}),C.kill(),C.parent=C._dp=To(l),C._start=0,g||B0(d)||B0(f)){if(I=k.length,O=g&&k9(g),eo(g))for(M in g)~j9.indexOf(M)&&(N||(N={}),N[M]=g[M]);for(T=0;T<I;T++)A=kg(s,$9),A.stagger=0,D&&(A.easeReverse=D),N&&ud(A,N),R=k[T],A.duration=+Jf(d,To(l),T,R,k),A.delay=(+Jf(f,To(l),T,R,k)||0)-l._delay,!g&&I===1&&A.delay&&(l._delay=f=A.delay,l._start+=f,A.delay=0),C.to(R,A,O?O(T,R,k):0),C._ease=Et.none;C.duration()?d=f=0:l.timeline=0}else if(w){Xf(Ts(C.vars.defaults,{ease:"none"})),C._ease=cc(w.ease||s.ease||"none");var $=0,Y,B,G;if(Cr(w))w.forEach(function(V){return C.to(k,V,">")}),C.duration();else{A={};for(M in w)M==="ease"||M==="easeEach"||xne(M,w[M],A,w.easeEach);for(M in A)for(Y=A[M].sort(function(V,K){return V.t-K.t}),$=0,T=0;T<Y.length;T++)B=Y[T],G={ease:B.e,duration:(B.t-(T?Y[T-1].t:0))/100*d},G[M]=B.v,C.to(k,G,$),$+=G.duration;C.duration()<d&&C.to({},{duration:d-C.duration()})}}d||l.duration(d=C.duration())}else l.timeline=0;return v===!0&&!Xb&&(Na=To(l),Sn.killTweensOf(k),Na=0),zi(S,To(l),i),s.reversed&&l.reverse(),s.paused&&l.paused(!0),(p||!d&&!w&&l._start===bn(S._time)&&es(p)&&Xte(To(l))&&S.data!=="nested")&&(l._tTime=-qt,l.render(Math.max(0,-f)||0)),x&&w9(To(l),x),l}var n=e.prototype;return n.render=function(s,i,o){var l=this._time,u=this._tDur,d=this._dur,f=s<0,p=s>u-qt&&!f?u:s<qt?0:s,g,v,w,_,x,S,k,C;if(!d)Jte(this,s,i,o);else if(p!==this._tTime||!s||o||!this._initted&&this._tTime||this._startAt&&this._zTime<0!==f||this._lazy){if(g=p,C=this.timeline,this._repeat){if(_=d+this._rDelay,this._repeat<-1&&f)return this.totalTime(_*100+s,i,o);if(g=bn(p%_),p===u?(w=this._repeat,g=d):(x=bn(p/_),w=~~x,w&&w===x?(g=d,w--):g>d&&(g=d)),S=this._yoyo&&w&1,S&&(g=d-g),x=dd(this._tTime,_),g===l&&!o&&this._initted&&w===x)return this._tTime=p,this;w!==x&&this.vars.repeatRefresh&&!S&&!this._lock&&g!==_&&this._initted&&(this._lock=o=1,this.render(bn(_*w),!0).invalidate()._lock=0)}if(!this._initted){if(x9(this,f?s:g,o,i,p))return this._tTime=0,this;if(l!==this._time&&!(o&&this.vars.repeatRefresh&&w!==x))return this;if(d!==this._dur)return this.render(s,i,o)}if(this._rEase){var T=g<l;if(T!==this._inv){var A=T?l:d-l;this._inv=T,this._from&&(this.ratio=1-this.ratio),this._invRatio=this.ratio,this._invTime=l,this._invRecip=A?(T?-1:1)/A:0,this._invScale=T?-this.ratio:1-this.ratio,this._invEase=T?this._rEase:this._ease}this.ratio=k=this._invRatio+this._invScale*this._invEase((g-this._invTime)*this._invRecip)}else this.ratio=k=this._ease(g/d);if(this._from&&(this.ratio=k=1-k),this._tTime=p,this._time=g,!this._act&&this._ts&&(this._act=1,this._lazy=0),!l&&p&&!i&&!x&&(xs(this,"onStart"),this._tTime!==p))return this;for(v=this._pt;v;)v.r(k,v.d),v=v._next;C&&C.render(s<0?s:C._dur*C._ease(g/this._dur),i,o)||this._startAt&&(this._zTime=s),this._onUpdate&&!i&&(f&&Uw(this,s,i,o),xs(this,"onUpdate")),this._repeat&&w!==x&&this.vars.onRepeat&&!i&&this.parent&&xs(this,"onRepeat"),(p===this._tDur||!p)&&this._tTime===p&&(f&&!this._onUpdate&&Uw(this,s,!0,!0),(s||!d)&&(p===this._tDur&&this._ts>0||!p&&this._ts<0)&&Xa(this,1),!i&&!(f&&!l)&&(p||l||S)&&(xs(this,p===u?"onComplete":"onReverseComplete",!0),this._prom&&!(p<u&&this.timeScale()>0)&&this._prom()))}return this},n.targets=function(){return this._targets},n.invalidate=function(s){return(!s||!this.vars.runBackwards)&&(this._startAt=0),this._pt=this._op=this._onUpdate=this._lazy=this.ratio=0,this._ptLookup=[],this.timeline&&this.timeline.invalidate(s),t.prototype.invalidate.call(this,s)},n.resetTo=function(s,i,o,l,u){Lh||ws.wake(),this._ts||this.play();var d=Math.min(this._dur,(this._dp._time-this._start)*this._ts),f;return this._initted||a4(this,d),f=this._ease(d/this._dur),_ne(this,s,i,o,l,f,d,u)?this.resetTo(s,i,o,l,1):(hv(this,0),this.parent||y9(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?Rf(this):this.scrollTrigger&&this.scrollTrigger.kill(!!gr),this;if(this.timeline){var o=this.timeline.totalDuration();return this.timeline.killTweensOf(s,i,Na&&Na.vars.overwrite!==!0)._first||Rf(this),this.parent&&o!==this.timeline.totalDuration()&&fd(this,this._dur*this.timeline._tDur/o,0,1),this}var l=this._targets,u=s?Gs(s):l,d=this._ptLookup,f=this._pt,p,g,v,w,_,x,S;if((!i||i==="all")&&Kte(l,u))return i==="all"&&(this._pt=0),Rf(this);for(p=this._op=this._op||[],i!=="all"&&(ar(i)&&(_={},ts(i,function(k){return _[k]=1}),i=_),i=wne(l,i)),S=l.length;S--;)if(~u.indexOf(l[S])){g=d[S],i==="all"?(p[S]=i,w=g,v={}):(v=p[S]=p[S]||{},w=i);for(_ in w)x=g&&g[_],x&&((!("kill"in x.d)||x.d.kill(_)===!0)&&dv(this,x,"_pt"),delete g[_]),v!=="all"&&(v[_]=1)}return this._initted&&!this._pt&&f&&Rf(this),this},e.to=function(s,i){return new e(s,i,arguments[2])},e.from=function(s,i){return Qf(1,arguments)},e.delayedCall=function(s,i,o,l){return new e(i,0,{immediateRender:!1,lazy:!1,overwrite:!1,delay:s,onComplete:i,onReverseComplete:i,onCompleteParams:o,onReverseCompleteParams:o,callbackScope:l})},e.fromTo=function(s,i,o){return Qf(2,arguments)},e.set=function(s,i){return i.duration=0,i.repeatDelay||(i.repeat=0),new e(s,i)},e.killTweensOf=function(s,i,o){return Sn.killTweensOf(s,i,o)},e})(Nh);Ts(Un.prototype,{_targets:[],_lazy:0,_startAt:0,_op:0,_onInit:0});ts("staggerTo,staggerFrom,staggerFromTo",function(t){Un[t]=function(){var e=new Yr,n=Zw.call(arguments,0);return n.splice(t==="staggerFromTo"?5:4,0,0),e[t].apply(e,n)}});var l4=function(e,n,r){return e[n]=r},F9=function(e,n,r){return e[n](r)},bne=function(e,n,r,s){return e[n](s.fp,r)},Sne=function(e,n,r){return e.setAttribute(n,r)},c4=function(e,n){return Tn(e[n])?F9:Qb(e[n])&&e.setAttribute?Sne:l4},V9=function(e,n){return n.set(n.t,n.p,Math.round((n.s+n.c*e)*1e6)/1e6,n)},kne=function(e,n){return n.set(n.t,n.p,!!(n.s+n.c*e),n)},H9=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)},u4=function(e,n){for(var r=n._pt;r;)r.r(e,r.d),r=r._next},Ene=function(e,n,r,s){for(var i=this._pt,o;i;)o=i._next,i.p===s&&i.modifier(e,n,r),i=o},Cne=function(e){for(var n=this._pt,r,s;n;)s=n._next,n.p===e&&!n.op||n.op===e?dv(this,n,"_pt"):n.dep||(r=1),n=s;return!r},Pne=function(e,n,r,s){s.mSet(e,n,s.m.call(s.tween,r,s.mt),s)},z9=function(e){for(var n=e._pt,r,s,i,o;n;){for(r=n._next,s=i;s&&s.pr>n.pr;)s=s._next;(n._prev=s?s._prev:o)?n._prev._next=n:i=n,(n._next=s)?s._prev=n:o=n,n=r}e._pt=i},ns=(function(){function t(n,r,s,i,o,l,u,d,f){this.t=r,this.s=i,this.c=o,this.p=s,this.r=l||V9,this.d=u||this,this.set=d||l4,this.pr=f||0,this._next=n,n&&(n._prev=this)}var e=t.prototype;return e.modifier=function(r,s,i){this.mSet=this.mSet||this.set,this.set=Pne,this.m=r,this.mt=i,this.tween=s},t})();ts(r4+"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 n4[t]=1});Ps.TweenMax=Ps.TweenLite=Un;Ps.TimelineLite=Ps.TimelineMax=Yr;Sn=new Yr({sortChildren:!1,defaults:Rh,autoRemoveChildren:!0,id:"root",smoothChildTiming:!0});Es.stringFilter=O9;var uc=[],ym={},Tne=[],z3=0,Ane=0,A_=function(e){return(ym[e]||Tne).map(function(n){return n()})},Kw=function(){var e=Date.now(),n=[];e-z3>2&&(A_("matchMediaInit"),uc.forEach(function(r){var s=r.queries,i=r.conditions,o,l,u,d;for(l in s)o=Di.matchMedia(s[l]).matches,o&&(u=1),o!==i[l]&&(i[l]=o,d=1);d&&(r.revert(),u&&n.push(r))}),A_("matchMediaRevert"),n.forEach(function(r){return r.onMatch(r,function(s){return r.add(null,s)})}),z3=e,A_("matchMedia"))},U9=(function(){function t(n,r){this.selector=r&&Ww(r),this.data=[],this._r=[],this.isReverted=!1,this.id=Ane++,n&&this.add(n)}var e=t.prototype;return e.add=function(r,s,i){Tn(r)&&(i=s,s=r,r=Tn);var o=this,l=function(){var d=pn,f=o.selector,p;return d&&d!==o&&d.data.push(o),i&&(o.selector=Ww(i)),pn=o,p=s.apply(o,arguments),Tn(p)&&o._r.push(p),pn=d,o.selector=f,o.isReverted=!1,p};return o.last=l,r===Tn?l(o,function(u){return o.add(null,u)}):r?o[r]=l:l},e.ignore=function(r){var s=pn;pn=null,r(this),pn=s},e.getTweens=function(){var r=[];return this.data.forEach(function(s){return s instanceof t?r.push.apply(r,s.getTweens()):s instanceof Un&&!(s.parent&&s.parent.data==="nested")&&r.push(s)}),r},e.clear=function(){this._r.length=this.data.length=0},e.kill=function(r,s){var i=this;if(r?(function(){for(var l=i.getTweens(),u=i.data.length,d;u--;)d=i.data[u],d.data==="isFlip"&&(d.revert(),d.getChildren(!0,!0,!1).forEach(function(f){return l.splice(l.indexOf(f),1)}));for(l.map(function(f){return{g:f._dur||f._delay||f._sat&&!f._sat.vars.immediateRender?f.globalTime(0):-1/0,t:f}}).sort(function(f,p){return p.g-f.g||-1/0}).forEach(function(f){return f.t.revert(r)}),u=i.data.length;u--;)d=i.data[u],d instanceof Yr?d.data!=="nested"&&(d.scrollTrigger&&d.scrollTrigger.revert(),d.kill()):!(d instanceof Un)&&d.revert&&d.revert(r);i._r.forEach(function(f){return f(r,i)}),i.isReverted=!0})():this.data.forEach(function(l){return l.kill&&l.kill()}),this.clear(),s)for(var o=uc.length;o--;)uc[o].id===this.id&&uc.splice(o,1)},e.revert=function(r){this.kill(r||{})},t})(),Rne=(function(){function t(n){this.contexts=[],this.scope=n,pn&&pn.data.push(this)}var e=t.prototype;return e.add=function(r,s,i){eo(r)||(r={matches:r});var o=new U9(0,i||this.scope),l=o.conditions={},u,d,f;pn&&!o.selector&&(o.selector=pn.selector),this.contexts.push(o),s=o.add("onMatch",s),o.queries=r;for(d in r)d==="all"?f=1:(u=Di.matchMedia(r[d]),u&&(uc.indexOf(o)<0&&uc.push(o),(l[d]=u.matches)&&(f=1),u.addListener?u.addListener(Kw):u.addEventListener("change",Kw)));return f&&s(o,function(p){return o.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})(),Cg={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 R9(s)})},timeline:function(e){return new Yr(e)},getTweensOf:function(e,n){return Sn.getTweensOf(e,n)},getProperty:function(e,n,r,s){ar(e)&&(e=Gs(e)[0]);var i=ac(e||{}).get,o=r?v9:g9;return r==="native"&&(r=""),e&&(n?o((vs[n]&&vs[n].get||i)(e,n,r,s)):function(l,u,d){return o((vs[l]&&vs[l].get||i)(e,l,u,d))})},quickSetter:function(e,n,r){if(e=Gs(e),e.length>1){var s=e.map(function(f){return ss.quickSetter(f,n,r)}),i=s.length;return function(f){for(var p=i;p--;)s[p](f)}}e=e[0]||{};var o=vs[n],l=ac(e),u=l.harness&&(l.harness.aliases||{})[n]||n,d=o?function(f){var p=new o;Pu._pt=0,p.init(e,r?f+r:f,Pu,0,[e]),p.render(1,p),Pu._pt&&u4(1,Pu)}:l.set(e,u);return o?d:function(f){return d(e,u,r?f+r:f,l,1)}},quickTo:function(e,n,r){var s,i=ss.to(e,Ts((s={},s[n]="+=0.1",s.paused=!0,s.stagger=0,s),r||{})),o=function(u,d,f){return i.resetTo(n,u,d,f)};return o.tween=i,o},isTweening:function(e){return Sn.getTweensOf(e,!0).length>0},defaults:function(e){return e&&e.ease&&(e.ease=cc(e.ease,Rh.ease)),j3(Rh,e||{})},config:function(e){return j3(Es,e||{})},registerEffect:function(e){var n=e.name,r=e.effect,s=e.plugins,i=e.defaults,o=e.extendTimeline;(s||"").split(",").forEach(function(l){return l&&!vs[l]&&!Ps[l]&&Mh(n+" effect requires "+l+" plugin.")}),E_[n]=function(l,u,d){return r(Gs(l),Ts(u||{},i),d)},o&&(Yr.prototype[n]=function(l,u,d){return this.add(E_[n](l,eo(u)?u:(d=u)&&{},this),d)})},registerEase:function(e,n){Et[e]=cc(n)},parseEase:function(e,n){return arguments.length?cc(e,n):Et},getById:function(e){return Sn.getById(e)},exportRoot:function(e,n){e===void 0&&(e={});var r=new Yr(e),s,i;for(r.smoothChildTiming=es(e.smoothChildTiming),Sn.remove(r),r._dp=0,r._time=r._tTime=Sn._time,s=Sn._first;s;)i=s._next,(n||!(!s._dur&&s instanceof Un&&s.vars.onComplete===s._targets[0]))&&zi(r,s,s._start-s._delay),s=i;return zi(Sn,r,0),r},context:function(e,n){return e?new U9(e,n):pn},matchMedia:function(e){return new Rne(e)},matchMediaRefresh:function(){return uc.forEach(function(e){var n=e.conditions,r,s;for(s in n)n[s]&&(n[s]=!1,r=1);r&&e.revert()})||Kw()},addEventListener:function(e,n){var r=ym[e]||(ym[e]=[]);~r.indexOf(n)||r.push(n)},removeEventListener:function(e,n){var r=ym[e],s=r&&r.indexOf(n);s>=0&&r.splice(s,1)},utils:{wrap:ane,wrapYoyo:lne,distribute:k9,random:C9,snap:E9,normalize:one,getUnit:kr,clamp:nne,splitColor:M9,toArray:Gs,selector:Ww,mapRange:T9,pipe:sne,unitize:ine,interpolate:cne,shuffle:S9},install:d9,effects:E_,ticker:ws,updateRoot:Yr.updateRoot,plugins:vs,globalTimeline:Sn,core:{PropTween:ns,globals:f9,Tween:Un,Timeline:Yr,Animation:Nh,getCache:ac,_removeLinkedListItem:dv,reverting:function(){return gr},context:function(e){return e&&pn&&(pn.data.push(e),e._ctx=pn),pn},suppressOverwrites:function(e){return Xb=e}}};ts("to,from,fromTo,delayedCall,set,killTweensOf",function(t){return Cg[t]=Un[t]});ws.add(Yr.updateRoot);Pu=Cg.to({},{duration:0});var Mne=function(e,n){for(var r=e._pt;r&&r.p!==n&&r.op!==n&&r.fp!==n;)r=r._next;return r},Ine=function(e,n){var r=e._targets,s,i,o;for(s in n)for(i=r.length;i--;)o=e._ptLookup[i][s],o&&(o=o.d)&&(o._pt&&(o=Mne(o,s)),o&&o.modifier&&o.modifier(n[s],e,r[i],s))},R_=function(e,n){return{name:e,headless:1,rawVars:1,init:function(s,i,o){o._onInit=function(l){var u,d;if(ar(i)&&(u={},ts(i,function(f){return u[f]=1}),i=u),n){u={};for(d in i)u[d]=n(i[d]);i=u}Ine(l,i)}}}},ss=Cg.registerPlugin({name:"attr",init:function(e,n,r,s,i){var o,l,u;this.tween=r;for(o in n)u=e.getAttribute(o)||"",l=this.add(e,"setAttribute",(u||0)+"",n[o],s,i,0,0,o),l.op=o,l.b=u,this._props.push(o)},render:function(e,n){for(var r=n._pt;r;)gr?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)}},R_("roundProps",qw),R_("modifiers"),R_("snap",E9))||Cg;Un.version=Yr.version=ss.version="3.15.0";u9=1;Jb()&&hd();Et.Power0;Et.Power1;Et.Power2;Et.Power3;Et.Power4;Et.Linear;Et.Quad;Et.Cubic;Et.Quart;Et.Quint;Et.Strong;Et.Elastic;Et.Back;Et.SteppedEase;Et.Bounce;Et.Sine;Et.Expo;Et.Circ;/*!
149
+ * CSSPlugin 3.15.0
150
+ * https://gsap.com
151
+ *
152
+ * Copyright 2008-2026, GreenSock. All rights reserved.
153
+ * Subject to the terms at https://gsap.com/standard-license
154
+ * @author: Jack Doyle, jack@greensock.com
155
+ */var U3,Da,Nu,d4,Wl,B3,f4,One=function(){return typeof window<"u"},qo={},zl=180/Math.PI,Du=Math.PI/180,pu=Math.atan2,Z3=1e8,h4=/([A-Z])/g,Lne=/(left|right|width|margin|padding|x)/i,Nne=/[\s,\(]\S/,Zi={autoAlpha:"opacity,visibility",scale:"scaleX,scaleY",alpha:"opacity"},Yw=function(e,n){return n.set(n.t,n.p,Math.round((n.s+n.c*e)*1e4)/1e4+n.u,n)},Dne=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)},jne=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)},$ne=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)},Fne=function(e,n){var r=n.s+n.c*e;n.set(n.t,n.p,~~(r+(r<0?-.5:.5))+n.u,n)},B9=function(e,n){return n.set(n.t,n.p,e?n.e:n.b,n)},Z9=function(e,n){return n.set(n.t,n.p,e!==1?n.b:n.e,n)},Vne=function(e,n,r){return e.style[n]=r},Hne=function(e,n,r){return e.style.setProperty(n,r)},zne=function(e,n,r){return e._gsap[n]=r},Une=function(e,n,r){return e._gsap.scaleX=e._gsap.scaleY=r},Bne=function(e,n,r,s,i){var o=e._gsap;o.scaleX=o.scaleY=r,o.renderTransform(i,o)},Zne=function(e,n,r,s,i){var o=e._gsap;o[n]=r,o.renderTransform(i,o)},kn="transform",rs=kn+"Origin",Wne=function t(e,n){var r=this,s=this.target,i=s.style,o=s._gsap;if(e in qo&&i){if(this.tfm=this.tfm||{},e!=="transform")e=Zi[e]||e,~e.indexOf(",")?e.split(",").forEach(function(l){return r.tfm[l]=Ao(s,l)}):this.tfm[e]=o.x?o[e]:Ao(s,e),e===rs&&(this.tfm.zOrigin=o.zOrigin);else return Zi.transform.split(",").forEach(function(l){return t.call(r,l,n)});if(this.props.indexOf(kn)>=0)return;o.svg&&(this.svgo=s.getAttribute("data-svg-origin"),this.props.push(rs,n,"")),e=kn}(i||n)&&this.props.push(e,n,i[e])},W9=function(e){e.translate&&(e.removeProperty("translate"),e.removeProperty("scale"),e.removeProperty("rotate"))},qne=function(){var e=this.props,n=this.target,r=n.style,s=n._gsap,i,o;for(i=0;i<e.length;i+=3)e[i+1]?e[i+1]===2?n[e[i]](e[i+2]):n[e[i]]=e[i+2]:e[i+2]?r[e[i]]=e[i+2]:r.removeProperty(e[i].substr(0,2)==="--"?e[i]:e[i].replace(h4,"-$1").toLowerCase());if(this.tfm){for(o in this.tfm)s[o]=this.tfm[o];s.svg&&(s.renderTransform(),n.setAttribute("data-svg-origin",this.svgo||"")),i=f4(),(!i||!i.isStart)&&!r[kn]&&(W9(r),s.zOrigin&&r[rs]&&(r[rs]+=" "+s.zOrigin+"px",s.zOrigin=0,s.renderTransform()),s.uncache=1)}},q9=function(e,n){var r={target:e,props:[],revert:qne,save:Wne};return e._gsap||ss.core.getCache(e),n&&e.style&&e.nodeType&&n.split(",").forEach(function(s){return r.save(s)}),r},G9,Xw=function(e,n){var r=Da.createElementNS?Da.createElementNS((n||"http://www.w3.org/1999/xhtml").replace(/^https/,"http"),e):Da.createElement(e);return r&&r.style?r:Da.createElement(e)},bs=function t(e,n,r){var s=getComputedStyle(e);return s[n]||s.getPropertyValue(n.replace(h4,"-$1").toLowerCase())||s.getPropertyValue(n)||!r&&t(e,pd(n)||n,1)||""},W3="O,Moz,ms,Ms,Webkit".split(","),pd=function(e,n,r){var s=n||Wl,i=s.style,o=5;if(e in i&&!r)return e;for(e=e.charAt(0).toUpperCase()+e.substr(1);o--&&!(W3[o]+e in i););return o<0?null:(o===3?"ms":o>=0?W3[o]:"")+e},Qw=function(){One()&&window.document&&(U3=window,Da=U3.document,Nu=Da.documentElement,Wl=Xw("div")||{style:{}},Xw("div"),kn=pd(kn),rs=kn+"Origin",Wl.style.cssText="border-width:0;line-height:0;position:absolute;padding:0",G9=!!pd("perspective"),f4=ss.core.reverting,d4=1)},q3=function(e){var n=e.ownerSVGElement,r=Xw("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},G3=function(e,n){for(var r=n.length;r--;)if(e.hasAttribute(n[r]))return e.getAttribute(n[r])},K9=function(e){var n,r;try{n=e.getBBox()}catch{n=q3(e),r=1}return n&&(n.width||n.height)||r||(n=q3(e)),n&&!n.width&&!n.x&&!n.y?{x:+G3(e,["x","cx","x1"])||0,y:+G3(e,["y","cy","y1"])||0,width:0,height:0}:n},Y9=function(e){return!!(e.getCTM&&(!e.parentNode||e.ownerSVGElement)&&K9(e))},Qa=function(e,n){if(n){var r=e.style,s;n in qo&&n!==rs&&(n=kn),r.removeProperty?(s=n.substr(0,2),(s==="ms"||n.substr(0,6)==="webkit")&&(n="-"+n),r.removeProperty(s==="--"?n:n.replace(h4,"-$1").toLowerCase())):r.removeAttribute(n)}},ja=function(e,n,r,s,i,o){var l=new ns(e._pt,n,r,0,1,o?Z9:B9);return e._pt=l,l.b=s,l.e=i,e._props.push(r),l},K3={deg:1,rad:1,turn:1},Gne={grid:1,flex:1},Ja=function t(e,n,r,s){var i=parseFloat(r)||0,o=(r+"").trim().substr((i+"").length)||"px",l=Wl.style,u=Lne.test(n),d=e.tagName.toLowerCase()==="svg",f=(d?"client":"offset")+(u?"Width":"Height"),p=100,g=s==="px",v=s==="%",w,_,x,S;if(s===o||!i||K3[s]||K3[o])return i;if(o!=="px"&&!g&&(i=t(e,n,r,"px")),S=e.getCTM&&Y9(e),(v||o==="%")&&(qo[n]||~n.indexOf("adius")))return w=S?e.getBBox()[u?"width":"height"]:e[f],In(v?i/w*p:i/100*w);if(l[u?"width":"height"]=p+(g?o:s),_=s!=="rem"&&~n.indexOf("adius")||s==="em"&&e.appendChild&&!d?e:e.parentNode,S&&(_=(e.ownerSVGElement||{}).parentNode),(!_||_===Da||!_.appendChild)&&(_=Da.body),x=_._gsap,x&&v&&x.width&&u&&x.time===ws.time&&!x.uncache)return In(i/x.width*p);if(v&&(n==="height"||n==="width")){var k=e.style[n];e.style[n]=p+s,w=e[f],k?e.style[n]=k:Qa(e,n)}else(v||o==="%")&&!Gne[bs(_,"display")]&&(l.position=bs(e,"position")),_===e&&(l.position="static"),_.appendChild(Wl),w=Wl[f],_.removeChild(Wl),l.position="absolute";return u&&v&&(x=ac(_),x.time=ws.time,x.width=_[f]),In(g?w*i/p:w&&i?p/w*i:0)},Ao=function(e,n,r,s){var i;return d4||Qw(),n in Zi&&n!=="transform"&&(n=Zi[n],~n.indexOf(",")&&(n=n.split(",")[0])),qo[n]&&n!=="transform"?(i=jh(e,s),i=n!=="transformOrigin"?i[n]:i.svg?i.origin:Tg(bs(e,rs))+" "+i.zOrigin+"px"):(i=e.style[n],(!i||i==="auto"||s||~(i+"").indexOf("calc("))&&(i=Pg[n]&&Pg[n](e,n,r)||bs(e,n)||p9(e,n)||(n==="opacity"?1:0))),r&&!~(i+"").trim().indexOf(" ")?Ja(e,n,i,r)+r:i},Kne=function(e,n,r,s){if(!r||r==="none"){var i=pd(n,e,1),o=i&&bs(e,i,1);o&&o!==r?(n=i,r=o):n==="borderColor"&&(r=bs(e,"borderTopColor"))}var l=new ns(this._pt,e.style,n,0,1,H9),u=0,d=0,f,p,g,v,w,_,x,S,k,C,T,A;if(l.b=r,l.e=s,r+="",s+="",s.substring(0,6)==="var(--"&&(s=bs(e,s.substring(4,s.indexOf(")")))),s==="auto"&&(_=e.style[n],e.style[n]=s,s=bs(e,n)||s,_?e.style[n]=_:Qa(e,n)),f=[r,s],O9(f),r=f[0],s=f[1],g=r.match(Cu)||[],A=s.match(Cu)||[],A.length){for(;p=Cu.exec(s);)x=p[0],k=s.substring(u,p.index),w?w=(w+1)%5:(k.substr(-5)==="rgba("||k.substr(-5)==="hsla(")&&(w=1),x!==(_=g[d++]||"")&&(v=parseFloat(_)||0,T=_.substr((v+"").length),x.charAt(1)==="="&&(x=Lu(v,x)+T),S=parseFloat(x),C=x.substr((S+"").length),u=Cu.lastIndex-C.length,C||(C=C||Es.units[n]||T,u===s.length&&(s+=C,l.e+=C)),T!==C&&(v=Ja(e,n,_,C)||0),l._pt={_next:l._pt,p:k||d===1?k:",",s:v,c:S-v,m:w&&w<4||n==="zIndex"?Math.round:0});l.c=u<s.length?s.substring(u,s.length):""}else l.r=n==="display"&&s==="none"?Z9:B9;return c9.test(s)&&(l.e=0),this._pt=l,l},Y3={top:"0%",bottom:"100%",left:"0%",right:"100%",center:"50%"},Yne=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]=Y3[r]||r,n[1]=Y3[s]||s,n.join(" ")},Xne=function(e,n){if(n.tween&&n.tween._time===n.tween._dur){var r=n.t,s=r.style,i=n.u,o=r._gsap,l,u,d;if(i==="all"||i===!0)s.cssText="",u=1;else for(i=i.split(","),d=i.length;--d>-1;)l=i[d],qo[l]&&(u=1,l=l==="transformOrigin"?rs:kn),Qa(r,l);u&&(Qa(r,kn),o&&(o.svg&&r.removeAttribute("transform"),s.scale=s.rotate=s.translate="none",jh(r,1),o.uncache=1,W9(s)))}},Pg={clearProps:function(e,n,r,s,i){if(i.data!=="isFromStart"){var o=e._pt=new ns(e._pt,n,r,0,0,Xne);return o.u=s,o.pr=-10,o.tween=i,e._props.push(r),1}}},Dh=[1,0,0,1,0,0],X9={},Q9=function(e){return e==="matrix(1, 0, 0, 1, 0, 0)"||e==="none"||!e},X3=function(e){var n=bs(e,kn);return Q9(n)?Dh:n.substr(7).match(l9).map(In)},p4=function(e,n){var r=e._gsap||ac(e),s=e.style,i=X3(e),o,l,u,d;return r.svg&&e.getAttribute("transform")?(u=e.transform.baseVal.consolidate().matrix,i=[u.a,u.b,u.c,u.d,u.e,u.f],i.join(",")==="1,0,0,1,0,0"?Dh:i):(i===Dh&&!e.offsetParent&&e!==Nu&&!r.svg&&(u=s.display,s.display="block",o=e.parentNode,(!o||!e.offsetParent&&!e.getBoundingClientRect().width)&&(d=1,l=e.nextElementSibling,Nu.appendChild(e)),i=X3(e),u?s.display=u:Qa(e,"display"),d&&(l?o.insertBefore(e,l):o?o.appendChild(e):Nu.removeChild(e))),n&&i.length>6?[i[0],i[1],i[4],i[5],i[12],i[13]]:i)},Jw=function(e,n,r,s,i,o){var l=e._gsap,u=i||p4(e,!0),d=l.xOrigin||0,f=l.yOrigin||0,p=l.xOffset||0,g=l.yOffset||0,v=u[0],w=u[1],_=u[2],x=u[3],S=u[4],k=u[5],C=n.split(" "),T=parseFloat(C[0])||0,A=parseFloat(C[1])||0,I,M,R,O;r?u!==Dh&&(M=v*x-w*_)&&(R=T*(x/M)+A*(-_/M)+(_*k-x*S)/M,O=T*(-w/M)+A*(v/M)-(v*k-w*S)/M,T=R,A=O):(I=K9(e),T=I.x+(~C[0].indexOf("%")?T/100*I.width:T),A=I.y+(~(C[1]||C[0]).indexOf("%")?A/100*I.height:A)),s||s!==!1&&l.smooth?(S=T-d,k=A-f,l.xOffset=p+(S*v+k*_)-S,l.yOffset=g+(S*w+k*x)-k):l.xOffset=l.yOffset=0,l.xOrigin=T,l.yOrigin=A,l.smooth=!!s,l.origin=n,l.originIsAbsolute=!!r,e.style[rs]="0px 0px",o&&(ja(o,l,"xOrigin",d,T),ja(o,l,"yOrigin",f,A),ja(o,l,"xOffset",p,l.xOffset),ja(o,l,"yOffset",g,l.yOffset)),e.setAttribute("data-svg-origin",T+" "+A)},jh=function(e,n){var r=e._gsap||new N9(e);if("x"in r&&!n&&!r.uncache)return r;var s=e.style,i=r.scaleX<0,o="px",l="deg",u=getComputedStyle(e),d=bs(e,rs)||"0",f,p,g,v,w,_,x,S,k,C,T,A,I,M,R,O,N,D,$,Y,B,G,V,K,U,ee,Z,j,Q,oe,re,ie;return f=p=g=_=x=S=k=C=T=0,v=w=1,r.svg=!!(e.getCTM&&Y9(e)),u.translate&&((u.translate!=="none"||u.scale!=="none"||u.rotate!=="none")&&(s[kn]=(u.translate!=="none"?"translate3d("+(u.translate+" 0 0").split(" ").slice(0,3).join(", ")+") ":"")+(u.rotate!=="none"?"rotate("+u.rotate+") ":"")+(u.scale!=="none"?"scale("+u.scale.split(" ").join(",")+") ":"")+(u[kn]!=="none"?u[kn]:"")),s.scale=s.rotate=s.translate="none"),M=p4(e,r.svg),r.svg&&(r.uncache?(U=e.getBBox(),d=r.xOrigin-U.x+"px "+(r.yOrigin-U.y)+"px",K=""):K=!n&&e.getAttribute("data-svg-origin"),Jw(e,K||d,!!K||r.originIsAbsolute,r.smooth!==!1,M)),A=r.xOrigin||0,I=r.yOrigin||0,M!==Dh&&(D=M[0],$=M[1],Y=M[2],B=M[3],f=G=M[4],p=V=M[5],M.length===6?(v=Math.sqrt(D*D+$*$),w=Math.sqrt(B*B+Y*Y),_=D||$?pu($,D)*zl:0,k=Y||B?pu(Y,B)*zl+_:0,k&&(w*=Math.abs(Math.cos(k*Du))),r.svg&&(f-=A-(A*D+I*Y),p-=I-(A*$+I*B))):(ie=M[6],oe=M[7],Z=M[8],j=M[9],Q=M[10],re=M[11],f=M[12],p=M[13],g=M[14],R=pu(ie,Q),x=R*zl,R&&(O=Math.cos(-R),N=Math.sin(-R),K=G*O+Z*N,U=V*O+j*N,ee=ie*O+Q*N,Z=G*-N+Z*O,j=V*-N+j*O,Q=ie*-N+Q*O,re=oe*-N+re*O,G=K,V=U,ie=ee),R=pu(-Y,Q),S=R*zl,R&&(O=Math.cos(-R),N=Math.sin(-R),K=D*O-Z*N,U=$*O-j*N,ee=Y*O-Q*N,re=B*N+re*O,D=K,$=U,Y=ee),R=pu($,D),_=R*zl,R&&(O=Math.cos(R),N=Math.sin(R),K=D*O+$*N,U=G*O+V*N,$=$*O-D*N,V=V*O-G*N,D=K,G=U),x&&Math.abs(x)+Math.abs(_)>359.9&&(x=_=0,S=180-S),v=In(Math.sqrt(D*D+$*$+Y*Y)),w=In(Math.sqrt(V*V+ie*ie)),R=pu(G,V),k=Math.abs(R)>2e-4?R*zl:0,T=re?1/(re<0?-re:re):0),r.svg&&(K=e.getAttribute("transform"),r.forceCSS=e.setAttribute("transform","")||!Q9(bs(e,kn)),K&&e.setAttribute("transform",K))),Math.abs(k)>90&&Math.abs(k)<270&&(i?(v*=-1,k+=_<=0?180:-180,_+=_<=0?180:-180):(w*=-1,k+=k<=0?180:-180)),n=n||r.uncache,r.x=f-((r.xPercent=f&&(!n&&r.xPercent||(Math.round(e.offsetWidth/2)===Math.round(-f)?-50:0)))?e.offsetWidth*r.xPercent/100:0)+o,r.y=p-((r.yPercent=p&&(!n&&r.yPercent||(Math.round(e.offsetHeight/2)===Math.round(-p)?-50:0)))?e.offsetHeight*r.yPercent/100:0)+o,r.z=g+o,r.scaleX=In(v),r.scaleY=In(w),r.rotation=In(_)+l,r.rotationX=In(x)+l,r.rotationY=In(S)+l,r.skewX=k+l,r.skewY=C+l,r.transformPerspective=T+o,(r.zOrigin=parseFloat(d.split(" ")[2])||!n&&r.zOrigin||0)&&(s[rs]=Tg(d)),r.xOffset=r.yOffset=0,r.force3D=Es.force3D,r.renderTransform=r.svg?Jne:G9?J9:Qne,r.uncache=0,r},Tg=function(e){return(e=e.split(" "))[0]+" "+e[1]},M_=function(e,n,r){var s=kr(n);return In(parseFloat(n)+parseFloat(Ja(e,"x",r+"px",s)))+s},Qne=function(e,n){n.z="0px",n.rotationY=n.rotationX="0deg",n.force3D=0,J9(e,n)},Nl="0deg",xf="0px",Dl=") ",J9=function(e,n){var r=n||this,s=r.xPercent,i=r.yPercent,o=r.x,l=r.y,u=r.z,d=r.rotation,f=r.rotationY,p=r.rotationX,g=r.skewX,v=r.skewY,w=r.scaleX,_=r.scaleY,x=r.transformPerspective,S=r.force3D,k=r.target,C=r.zOrigin,T="",A=S==="auto"&&e&&e!==1||S===!0;if(C&&(p!==Nl||f!==Nl)){var I=parseFloat(f)*Du,M=Math.sin(I),R=Math.cos(I),O;I=parseFloat(p)*Du,O=Math.cos(I),o=M_(k,o,M*O*-C),l=M_(k,l,-Math.sin(I)*-C),u=M_(k,u,R*O*-C+C)}x!==xf&&(T+="perspective("+x+Dl),(s||i)&&(T+="translate("+s+"%, "+i+"%) "),(A||o!==xf||l!==xf||u!==xf)&&(T+=u!==xf||A?"translate3d("+o+", "+l+", "+u+") ":"translate("+o+", "+l+Dl),d!==Nl&&(T+="rotate("+d+Dl),f!==Nl&&(T+="rotateY("+f+Dl),p!==Nl&&(T+="rotateX("+p+Dl),(g!==Nl||v!==Nl)&&(T+="skew("+g+", "+v+Dl),(w!==1||_!==1)&&(T+="scale("+w+", "+_+Dl),k.style[kn]=T||"translate(0, 0)"},Jne=function(e,n){var r=n||this,s=r.xPercent,i=r.yPercent,o=r.x,l=r.y,u=r.rotation,d=r.skewX,f=r.skewY,p=r.scaleX,g=r.scaleY,v=r.target,w=r.xOrigin,_=r.yOrigin,x=r.xOffset,S=r.yOffset,k=r.forceCSS,C=parseFloat(o),T=parseFloat(l),A,I,M,R,O;u=parseFloat(u),d=parseFloat(d),f=parseFloat(f),f&&(f=parseFloat(f),d+=f,u+=f),u||d?(u*=Du,d*=Du,A=Math.cos(u)*p,I=Math.sin(u)*p,M=Math.sin(u-d)*-g,R=Math.cos(u-d)*g,d&&(f*=Du,O=Math.tan(d-f),O=Math.sqrt(1+O*O),M*=O,R*=O,f&&(O=Math.tan(f),O=Math.sqrt(1+O*O),A*=O,I*=O)),A=In(A),I=In(I),M=In(M),R=In(R)):(A=p,R=g,I=M=0),(C&&!~(o+"").indexOf("px")||T&&!~(l+"").indexOf("px"))&&(C=Ja(v,"x",o,"px"),T=Ja(v,"y",l,"px")),(w||_||x||S)&&(C=In(C+w-(w*A+_*M)+x),T=In(T+_-(w*I+_*R)+S)),(s||i)&&(O=v.getBBox(),C=In(C+s/100*O.width),T=In(T+i/100*O.height)),O="matrix("+A+","+I+","+M+","+R+","+C+","+T+")",v.setAttribute("transform",O),k&&(v.style[kn]=O)},ere=function(e,n,r,s,i){var o=360,l=ar(i),u=parseFloat(i)*(l&&~i.indexOf("rad")?zl:1),d=u-s,f=s+d+"deg",p,g;return l&&(p=i.split("_")[1],p==="short"&&(d%=o,d!==d%(o/2)&&(d+=d<0?o:-o)),p==="cw"&&d<0?d=(d+o*Z3)%o-~~(d/o)*o:p==="ccw"&&d>0&&(d=(d-o*Z3)%o-~~(d/o)*o)),e._pt=g=new ns(e._pt,n,r,s,d,Dne),g.e=f,g.u="deg",e._props.push(r),g},Q3=function(e,n){for(var r in n)e[r]=n[r];return e},tre=function(e,n,r){var s=Q3({},r._gsap),i="perspective,force3D,transformOrigin,svgOrigin",o=r.style,l,u,d,f,p,g,v,w;s.svg?(d=r.getAttribute("transform"),r.setAttribute("transform",""),o[kn]=n,l=jh(r,1),Qa(r,kn),r.setAttribute("transform",d)):(d=getComputedStyle(r)[kn],o[kn]=n,l=jh(r,1),o[kn]=d);for(u in qo)d=s[u],f=l[u],d!==f&&i.indexOf(u)<0&&(v=kr(d),w=kr(f),p=v!==w?Ja(r,u,d,w):parseFloat(d),g=parseFloat(f),e._pt=new ns(e._pt,l,u,p,g-p,Yw),e._pt.u=w||0,e._props.push(u));Q3(l,s)};ts("padding,margin,Width,Radius",function(t,e){var n="Top",r="Right",s="Bottom",i="Left",o=(e<3?[n,r,s,i]:[n+i,n+r,s+r,s+i]).map(function(l){return e<2?t+l:"border"+l+t});Pg[e>1?"border"+t:t]=function(l,u,d,f,p){var g,v;if(arguments.length<4)return g=o.map(function(w){return Ao(l,w,d)}),v=g.join(" "),v.split(g[0]).length===5?g[0]:v;g=(f+"").split(" "),v={},o.forEach(function(w,_){return v[w]=g[_]=g[_]||g[(_-1)/2|0]}),l.init(u,v,p)}});var eL={name:"css",register:Qw,targetTest:function(e){return e.style&&e.nodeType},init:function(e,n,r,s,i){var o=this._props,l=e.style,u=r.vars.startAt,d,f,p,g,v,w,_,x,S,k,C,T,A,I,M,R,O;d4||Qw(),this.styles=this.styles||q9(e),R=this.styles.props,this.tween=r;for(_ in n)if(_!=="autoRound"&&(f=n[_],!(vs[_]&&D9(_,n,r,s,e,i)))){if(v=typeof f,w=Pg[_],v==="function"&&(f=f.call(r,s,e,i),v=typeof f),v==="string"&&~f.indexOf("random(")&&(f=Oh(f)),w)w(this,e,_,f,r)&&(M=1);else if(_.substr(0,2)==="--")d=(getComputedStyle(e).getPropertyValue(_)+"").trim(),f+="",za.lastIndex=0,za.test(d)||(x=kr(d),S=kr(f),S?x!==S&&(d=Ja(e,_,d,S)+S):x&&(f+=x)),this.add(l,"setProperty",d,f,s,i,0,0,_),o.push(_),R.push(_,0,l[_]);else if(v!=="undefined"){if(u&&_ in u?(d=typeof u[_]=="function"?u[_].call(r,s,e,i):u[_],ar(d)&&~d.indexOf("random(")&&(d=Oh(d)),kr(d+"")||d==="auto"||(d+=Es.units[_]||kr(Ao(e,_))||""),(d+"").charAt(1)==="="&&(d=Ao(e,_))):d=Ao(e,_),g=parseFloat(d),k=v==="string"&&f.charAt(1)==="="&&f.substr(0,2),k&&(f=f.substr(2)),p=parseFloat(f),_ in Zi&&(_==="autoAlpha"&&(g===1&&Ao(e,"visibility")==="hidden"&&p&&(g=0),R.push("visibility",0,l.visibility),ja(this,l,"visibility",g?"inherit":"hidden",p?"inherit":"hidden",!p)),_!=="scale"&&_!=="transform"&&(_=Zi[_],~_.indexOf(",")&&(_=_.split(",")[0]))),C=_ in qo,C){if(this.styles.save(_),O=f,v==="string"&&f.substring(0,6)==="var(--"){if(f=bs(e,f.substring(4,f.indexOf(")"))),f.substring(0,5)==="calc("){var N=e.style.perspective;e.style.perspective=f,f=bs(e,"perspective"),N?e.style.perspective=N:Qa(e,"perspective")}p=parseFloat(f)}if(T||(A=e._gsap,A.renderTransform&&!n.parseTransform||jh(e,n.parseTransform),I=n.smoothOrigin!==!1&&A.smooth,T=this._pt=new ns(this._pt,l,kn,0,1,A.renderTransform,A,0,-1),T.dep=1),_==="scale")this._pt=new ns(this._pt,A,"scaleY",A.scaleY,(k?Lu(A.scaleY,k+p):p)-A.scaleY||0,Yw),this._pt.u=0,o.push("scaleY",_),_+="X";else if(_==="transformOrigin"){R.push(rs,0,l[rs]),f=Yne(f),A.svg?Jw(e,f,0,I,0,this):(S=parseFloat(f.split(" ")[2])||0,S!==A.zOrigin&&ja(this,A,"zOrigin",A.zOrigin,S),ja(this,l,_,Tg(d),Tg(f)));continue}else if(_==="svgOrigin"){Jw(e,f,1,I,0,this);continue}else if(_ in X9){ere(this,A,_,g,k?Lu(g,k+f):f);continue}else if(_==="smoothOrigin"){ja(this,A,"smooth",A.smooth,f);continue}else if(_==="force3D"){A[_]=f;continue}else if(_==="transform"){tre(this,f,e);continue}}else _ in l||(_=pd(_)||_);if(C||(p||p===0)&&(g||g===0)&&!Nne.test(f)&&_ in l)x=(d+"").substr((g+"").length),p||(p=0),S=kr(f)||(_ in Es.units?Es.units[_]:x),x!==S&&(g=Ja(e,_,d,S)),this._pt=new ns(this._pt,C?A:l,_,g,(k?Lu(g,k+p):p)-g,!C&&(S==="px"||_==="zIndex")&&n.autoRound!==!1?Fne:Yw),this._pt.u=S||0,C&&O!==f?(this._pt.b=d,this._pt.e=O,this._pt.r=$ne):x!==S&&S!=="%"&&(this._pt.b=d,this._pt.r=jne);else if(_ in l)Kne.call(this,e,_,d,k?k+f:f);else if(_ in e)this.add(e,_,d||e[_],k?k+f:f,s,i);else if(_!=="parseTransform"){t4(_,f);continue}C||(_ in l?R.push(_,0,l[_]):typeof e[_]=="function"?R.push(_,2,e[_]()):R.push(_,1,d||e[_])),o.push(_)}}M&&z9(this)},render:function(e,n){if(n.tween._time||!f4())for(var r=n._pt;r;)r.r(e,r.d),r=r._next;else n.styles.revert()},get:Ao,aliases:Zi,getSetter:function(e,n,r){var s=Zi[n];return s&&s.indexOf(",")<0&&(n=s),n in qo&&n!==rs&&(e._gsap.x||Ao(e,"x"))?r&&B3===r?n==="scale"?Une:zne:(B3=r||{})&&(n==="scale"?Bne:Zne):e.style&&!Qb(e.style[n])?Vne:~n.indexOf("-")?Hne:c4(e,n)},core:{_removeProperty:Qa,_getMatrix:p4}};ss.utils.checkPrefix=pd;ss.core.getStyleSaver=q9;(function(t,e,n,r){var s=ts(t+","+e+","+n,function(i){qo[i]=1});ts(e,function(i){Es.units[i]="deg",X9[i]=1}),Zi[s[13]]=t+","+e,ts(r,function(i){var o=i.split(":");Zi[o[1]]=s[o[0]]})})("x,y,z,scale,scaleX,scaleY,xPercent,yPercent","rotation,rotationX,rotationY,skewX,skewY","transform,transformOrigin,svgOrigin,force3D,smoothOrigin,transformPerspective","0:translateX,1:translateY,2:translateZ,8:rotate,8:rotationZ,8:rotateZ,9:rotateX,10:rotateY");ts("x,y,z,top,right,bottom,left,width,height,fontSize,padding,margin,perspective",function(t){Es.units[t]="px"});ss.registerPlugin(eL);var fi=ss.registerPlugin(eL)||ss;fi.core.Tween;const _m="/assets/logo-animation",I_=1280,nre=[{id:"eraser",src:`${_m}/eraser.png`,cssW:189,cssH:74,rot:-90,fit:337,localX:60,localY:168,seaX:.2,seaY:.27,seaRot:-8},{id:"clasp",src:`${_m}/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:`${_m}/playdough.png`,cssW:236,cssH:206,rot:5,fit:150,localX:182,localY:277,seaX:.52,seaY:.79,seaRot:6}],rre=[{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}],ex=({className:t})=>{const e=m.useRef(null),n=m.useRef(null),r=m.useRef(null);return m.useEffect(()=>{const s=e.current,i=n.current,o=r.current;if(!s||!i||!o)return;const l=window.matchMedia("(prefers-reduced-motion: reduce)").matches,u=(S,k)=>S+Math.random()*(k-S);let d=null,f,p=1;const g=nre.map(S=>({...S})),v=()=>{s.querySelectorAll(".la-obj").forEach(R=>R.remove());const S=s.getBoundingClientRect(),k=S.width||I_,C=S.height||I_*.64;p=k/I_,i.style.width=`${242*p}px`,i.style.height=`${250*p}px`;const A=250*p/337,I=[],M=(R,O,N)=>{const D=document.createElement("div");return D.className="la-obj",D.style.width=`${O}px`,D.innerHTML=`<img src="${R}" alt="" style="${N?"transform:scaleX(-1)":""}">`,s.appendChild(D),D};return rre.forEach((R,O)=>{const N=R.w*p,D=M(`${_m}/sea/${R.k}.png`,N,O%2===0);fi.set(D,{x:R.x*k-N/2,y:R.y*C-N/2,rotation:R.r,opacity:1,scale:0,transformOrigin:"50% 50%"}),I.push({el:D,hero:!1,rest:1})}),g.forEach(R=>{const O=R.cssW*p;R.el=M(R.src,O,!!R.flip),R.finalScale=R.fit*A/(R.cssW*p),fi.set(R.el,{x:R.seaX*k-O/2,y:R.seaY*C-R.cssH*p/2,rotation:R.seaRot,opacity:1,scale:0,transformOrigin:"50% 50%",zIndex:30}),I.push({el:R.el,hero:!0,rest:150/R.cssW})}),I},w=(S,k)=>{const C=s.getBoundingClientRect(),T=o.getBoundingClientRect();return{x:T.left-C.left+S/326*T.width,y:T.top-C.top+k/337*T.height}},_=()=>{d&&d.revert();const S=v();if(l){d=fi.context(()=>{S.filter(T=>!T.hero).forEach(T=>fi.set(T.el,{scale:0})),g.forEach(T=>{if(!T.el)return;const A=w(T.localX,T.localY);fi.set(T.el,{x:A.x-T.cssW*p/2,y:A.y-T.cssH*p/2,rotation:T.rot,scale:T.finalScale})})},s);return}const k=[],C=[];d=fi.context(()=>{const T=fi.timeline();T.to(S.map(A=>A.el),{scale:A=>S[A].rest,duration:.5,ease:"steps(4)",stagger:{each:.045,from:"random"}}),T.add(()=>{S.forEach(({el:A,hero:I},M)=>{const R=I?k:C,O=M%2?1:-1;R.push(fi.to(A,{rotation:"+="+u(2.5,6)*O,duration:u(.5,.9),repeat:-1,yoyo:!0,ease:"steps(2)",delay:u(0,.4)}),fi.to(A,{y:"+="+u(5,11)*O,x:"+="+u(4,9)*-O,duration:u(.7,1.2),repeat:-1,yoyo:!0,ease:"steps(3)",delay:u(0,.4)}))})},"<0.1"),T.to({},{duration:1.1}),T.add("pick"),g.forEach((A,I)=>{A.el&&T.to(A.el,{scale:150/A.cssW*1.2,duration:.28,ease:"steps(3)",yoyo:!0,repeat:1},"pick+="+I*.08)}),T.add("clear","pick+=0.7"),T.add(()=>C.forEach(A=>A.kill()),"clear"),T.to(S.filter(A=>!A.hero).map(A=>A.el),{scale:0,rotation:"+=40",duration:.5,ease:"steps(5)",overwrite:"auto",stagger:{each:.025,from:"random"}},"clear"),T.add("assemble","clear+=0.25"),T.add(()=>k.forEach(A=>A.kill()),"assemble"),g.forEach((A,I)=>{if(!A.el||A.finalScale===void 0)return;const M=w(A.localX,A.localY);T.to(A.el,{x:M.x-A.cssW*p/2,y:M.y-A.cssH*p/2,rotation:A.rot,scale:A.finalScale,duration:1.05,ease:"steps(9)",overwrite:"auto"},"assemble+="+I*.12)}),g.forEach(A=>{!A.el||A.finalScale===void 0||T.to(A.el,{scale:A.finalScale*1.03,duration:.16,ease:"steps(2)",yoyo:!0,repeat:1},"assemble+=1.45")})},s)};fi.ticker.fps(12),_();const x=()=>{clearTimeout(f),f=setTimeout(_,250)};return window.addEventListener("resize",x),()=>{window.removeEventListener("resize",x),clearTimeout(f),d==null||d.revert(),s.querySelectorAll(".la-obj").forEach(S=>S.remove())}},[]),b.jsx("div",{ref:e,className:`la-scene ${t??""}`,children:b.jsx("div",{ref:n,className:"la-logo-stage",children:b.jsx("svg",{ref:r,className:"la-mark",viewBox:"0 0 326 337","aria-hidden":"true"})})})},sre=Object.freeze(Object.defineProperty({__proto__:null,default:ex},Symbol.toStringTag,{value:"Module"})),J3=({isSigningIn:t})=>t?b.jsxs(b.Fragment,{children:[b.jsx("div",{className:"h-5 w-5 animate-spin rounded-full border-2 border-current border-t-transparent"}),b.jsx("span",{children:"Signing in..."})]}):b.jsxs(b.Fragment,{children:[b.jsx("img",{src:"https://www.gstatic.com/firebasejs/ui/2.0.0/images/auth/google.svg",alt:"Google",className:"h-5 w-5"}),b.jsx("span",{children:"Sign in with Google"})]}),ire=({isSigningIn:t,onStartSignIn:e,errorMessage:n=null,displayMode:r="full"})=>r==="modal"?b.jsxs("div",{className:"glass-panel relative w-full max-w-sm overflow-hidden rounded-2xl border border-white/10 font-main text-white shadow-2xl",children:[b.jsx(ex,{className:"relative z-0 h-44 w-full"}),b.jsxs("div",{className:"relative z-10 flex flex-col items-center gap-6 px-8 pb-12 pt-8",children:[b.jsxs("div",{className:"flex flex-col items-center gap-2 text-center",children:[b.jsx("h1",{className:"text-xl font-medium text-content",children:"Welcome to Rivet"}),b.jsx("p",{className:"text-sm leading-relaxed text-content-muted",children:"Rivet understands your references, and then explores dozens of design directions with you."})]}),b.jsx("button",{onClick:e,disabled:t,className:"glass-panel active-push flex cursor-pointer items-center gap-3 rounded-xl px-8 py-3.5 text-sm font-medium transition-colors hover:bg-main-hover disabled:cursor-not-allowed disabled:opacity-50",children:b.jsx(J3,{isSigningIn:t})}),n?b.jsx("p",{className:"text-center text-xs text-red-200",children:n}):null]})]}):b.jsxs("div",{className:"relative flex min-h-screen flex-col items-center justify-center overflow-hidden bg-white font-main text-[#18181b]",children:[b.jsx(ex,{className:"absolute inset-0 z-0"}),b.jsxs("div",{className:"pointer-events-none absolute inset-x-0 bottom-0 z-10 flex flex-col items-center gap-5 pb-[14vh]",children:[b.jsxs("div",{className:"flex flex-col items-center gap-2 px-6 text-center",children:[b.jsx("h1",{className:"text-xl font-medium tracking-tight text-[#18181b]",children:"Welcome to Rivet"}),b.jsx("p",{className:"max-w-md text-sm leading-relaxed text-[#71717a]",children:"Rivet understands your references, and then explores dozens of design directions with you."})]}),b.jsx("button",{onClick:e,disabled:t,className:"active-push pointer-events-auto flex cursor-pointer items-center gap-3 rounded-full border border-black/10 bg-white px-8 py-3.5 text-sm font-medium text-[#18181b] shadow-[0_8px_24px_rgba(40,33,28,0.14)] transition-colors hover:bg-[#faf9f7] disabled:cursor-not-allowed disabled:opacity-50",children:b.jsx(J3,{isSigningIn:t})}),n?b.jsx("p",{className:"text-center text-xs text-red-500",children:n}):null]})]}),ore="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",are=({message:t})=>b.jsx("div",{className:"relative flex min-h-screen flex-col items-center justify-center overflow-hidden bg-[#1c1c20] font-main text-white",children:b.jsxs("div",{className:"flex flex-col items-center gap-10",children:[b.jsx("img",{src:ore,alt:"Rivet",className:"h-8 w-auto object-contain"}),b.jsxs("div",{className:"glass-panel flex items-center gap-3 rounded-xl px-8 py-3.5 text-sm font-medium",children:[b.jsx(Zg,{className:"h-5 w-5 shrink-0 animate-spin text-primary",weight:"bold"}),b.jsx("span",{children:t})]})]})}),lre="data:image/svg+xml,%3csvg%20width='128'%20height='128'%20viewBox='0%200%20128%20128'%20fill='none'%20xmlns='http://www.w3.org/2000/svg'%3e%3cpath%20d='M70.5245%206.60961C66.8741%202.95923%2060.9556%202.95922%2057.3053%206.60961L8.61753%2055.2973C4.96715%2058.9477%204.96714%2064.8662%208.61752%2068.5166L26.3518%2086.2508C30.0022%2089.9012%2035.9206%2089.9012%2039.571%2086.2508L92.033%2033.7889C93.5989%2032.2229%2093.5989%2029.684%2092.033%2028.1181L70.5245%206.60961Z'%20fill='%23EC4423'%20fill-opacity='0.8'/%3e%3cpath%20d='M119.208%2068.5159C122.858%2064.8655%20122.858%2058.947%20119.208%2055.2966L70.5199%206.60891C66.8695%202.95853%2060.951%202.95851%2057.3007%206.6089L32.8391%2031.0705L88.1364%2086.3678C91.7868%2090.0182%2097.7053%2090.0182%20101.356%2086.3678L119.208%2068.5159Z'%20fill='%23EC4423'%20fill-opacity='0.8'/%3e%3cpath%20d='M64.0164%2077.3398L44.0436%2097.3127C41.1057%20100.251%2041.1057%20105.014%2044.0436%20107.952L58.5067%20122.415C61.4446%20125.353%2066.2079%20125.353%2069.1458%20122.415L83.7991%20107.762C86.737%20104.824%2086.737%20100.06%2083.7991%2097.1225L64.0164%2077.3398Z'%20fill='%23EC4423'%20fill-opacity='0.8'/%3e%3c/svg%3e",Ag=44,bf=8,Z0=16,cre=4,eP=-18,ure=.18,dre=[.22,1,.36,1],tP=.92,fre=1,hre=.95,pre=.4,mre=[.19,1,.22,1],O_=0,gre=1,vre=0,yre=0,_re=0,tL=({position:t,viewport:e,boundsLeft:n=0})=>{const r=n+bf,s=Math.max(r,e.width-Ag-bf),i=Math.max(bf,e.height-Ag-bf);return{x:Math.min(s,Math.max(r,t.x)),y:Math.min(i,Math.max(bf,t.y))}},m4=()=>({width:window.innerWidth,height:window.innerHeight}),wre=({position:t,boundsLeftPx:e=0})=>tL({position:t,viewport:m4(),boundsLeft:e}),xre=()=>{if(typeof window>"u")return{x:Z0,y:Z0};const t=m4();return{x:t.width-Ag-Z0,y:t.height-Ag-Z0}},bre=({deltaX:t,deltaY:e})=>Math.hypot(t,e)>=cre,Sre=t=>t.button===void 0||t.button<=_re,nP=t=>{const e=t.nativeEvent;return{x:Number.isFinite(t.clientX)?t.clientX:e.clientX,y:Number.isFinite(t.clientY)?t.clientY:e.clientY}},kre=({isVisible:t,isPanelOpen:e,isReducedMotion:n,position:r,dragBoundsLeftPx:s=0,onToggle:i,onPositionChange:o})=>{const l=m.useRef(null),u=m.useRef(!1),[d,f]=m.useState(!1),[p,g]=m.useState(!1),v=n?!1:{opacity:O_,scale:tP,x:eP},w=n?{opacity:O_}:{opacity:O_,scale:tP,x:eP},_=n?{duration:yre}:{duration:ure,ease:dre,scale:{duration:pre,ease:mre}},x=m.useCallback(()=>{const A=l.current;A&&(u.current=A.hasMoved),l.current=null,f(!1)},[]),S=m.useCallback(A=>{const I=l.current;if(!I)return;const M=nP(A),R=M.x-I.startPointer.x,O=M.y-I.startPointer.y,N=I.hasMoved||bre({deltaX:R,deltaY:O});l.current={...I,hasMoved:N},N&&o(tL({position:{x:I.startPosition.x+R,y:I.startPosition.y+O},viewport:m4(),boundsLeft:s}))},[o,s]),k=m.useCallback(A=>{if(l.current||!Sre(A))return;const I=nP(A);l.current={startPointer:I,startPosition:r,hasMoved:!1},f(!0)},[r]),C=m.useCallback(()=>{if(u.current){u.current=!1;return}i()},[i]),T=e?"Close panel":"Open panel";return b.jsxs(b.Fragment,{children:[d?b.jsx("div",{className:"fixed inset-0 z-40 cursor-grabbing","data-cy":"rivet-panel-launcher-drag-surface",onPointerMove:S,onPointerUp:x,onPointerCancel:x,onMouseMove:S,onMouseUp:x}):null,b.jsx(ks,{children:t?b.jsx(wc,{label:T,side:"top",forceOpen:p&&!d?void 0:!1,children:b.jsx(wi.button,{type:"button","aria-label":T,"data-cy":"reopen-panel",onMouseEnter:()=>g(!0),onMouseLeave:()=>g(!1),initial:v,animate:{opacity:gre,scale:fre,x:vre},whileTap:{scale:hre},exit:w,transition:_,onPointerDown:k,onMouseDown:k,onPointerMove:S,onPointerUp:x,onPointerCancel:x,onMouseMove:S,onMouseUp:x,onClick:C,className:`bg-main absolute z-50 flex h-11 w-11 touch-none select-none items-center justify-center overflow-hidden rounded-full border border-white/10 shadow-[0_2px_8px_rgba(0,0,0,0.2),0_4px_16px_rgba(0,0,0,0.1)] transition-[background-color,box-shadow] duration-150 hover:bg-[#2a2a2a] focus:outline-none focus-visible:ring-2 focus-visible:ring-white/75 ${d?"cursor-grabbing shadow-[0_4px_12px_rgba(0,0,0,0.28),0_10px_24px_rgba(0,0,0,0.16)]":"cursor-grab"}`,style:{left:r.x,top:r.y,willChange:"left, top, transform"},children:b.jsx("img",{src:lre,alt:"","aria-hidden":"true",draggable:!1,className:"h-4 w-4 brightness-0 invert"})})}):null})]})},L_=Rs("useConfig"),Ere=300*1e3,Cre=1800*1e3,Pre=60*1e3,Tre=300*1e3,Are=()=>{var t;return typeof window>"u"?null:((t=window.__RIVET_BOOTSTRAP__)==null?void 0:t.queueAccessToken)??null},Rre=()=>{var t;return typeof window>"u"?null:((t=window.__RIVET_BOOTSTRAP__)==null?void 0:t.agentApplyMode)??null},Mre=On({agentModeAvailable:mh(),email:Je().optional(),userId:Je().optional(),name:Je().optional(),isMCPSession:mh(),mcpEditor:Je().nullable(),agentApplyMode:jg(["embedded","external"]).nullable().optional(),queueAccessToken:Je().nullable().optional(),projectPath:Je(),projectId:Je().uuid().nullable().optional(),libraryOrigin:Je().url().nullable()}),Ire=On({featureFlags:uA(Je(),On({isEnabled:mh()})).optional()}),Ore=t=>({...bO,...t??{}}),Lre=()=>{const t=ut(Ow),e=gt(Ow),n=gt(MO),r=gt(IO),s=gt(cv),i=gt(EJ),o=gt(SJ),l=gt(bJ),u=gt(lv),d=gt(vJ),f=gt(RO),p=m.useCallback(k=>{o(k.agentModeAvailable),f(k.projectId??null),d({name:k.name??null,email:k.email??null}),k.isMCPSession&&n(!0),k.mcpEditor&&r(k.mcpEditor),s(k.agentApplyMode??Rre()??null),i(k.queueAccessToken??Are())},[s,o,n,r,i,f,d]),g=nh({queryKey:["rivet-config"],queryFn:async()=>{const k=await fetch("/api/config");if(!k.ok)throw new Error(`Failed to fetch config: ${k.statusText}`);return Mre.parse(await k.json())},staleTime:Ere,gcTime:Cre}),v=nh({queryKey:["rivet-feature-flags"],queryFn:async()=>{const k=await fetch("/api/feature-flags");if(!k.ok)throw new Error(`Failed to fetch feature flags: ${k.statusText}`);return Ire.parse(await k.json())},staleTime:Pre,gcTime:Tre}),{refetch:w}=g,{refetch:_}=v;m.useLayoutEffect(()=>{g.data&&(p(g.data),u(!1),L_.info("Config loaded:",g.data)),v.data&&(e(Ore(v.data.featureFlags)),l(!0))},[g.data,v.data,p,u,e,l]),m.useLayoutEffect(()=>{g.error&&(l(!0),u(!1),L_.warn("Failed to load config:",g.error instanceof Error?g.error.message:"Failed to load config")),v.error&&(l(!0),L_.warn("Failed to load feature flags:",v.error instanceof Error?v.error.message:"Failed to load feature flags"))},[g.error,v.error,u,l]);const x=m.useCallback(async()=>{const[k]=await Promise.all([w(),_()]);return k.data?k.data:null},[w,_]);let S=null;return g.error instanceof Error?S=g.error.message:g.error&&(S="Failed to load config"),{config:g.data??null,featureFlags:t,loading:g.isPending||!g.error&&v.isPending,error:S,refetchConfig:x}},mu=Rs("useOAuthCallback"),Nre="https://rivet-proxy.onrender.com",Dre=()=>{const[t,e]=m.useState({isProcessing:!1,isComplete:!1,error:null});return m.useEffect(()=>{const n=new AbortController;let r=!1;return(async()=>{var l,u,d;const i=window.location.hash,o=window.location.search;if(!(!i||!i.includes("access_token"))&&!r){e({isProcessing:!0,isComplete:!1,error:null});try{mu.info("Processing OAuth callback...");const f=new URLSearchParams(i.substring(1)),p=f.get("access_token"),g=f.get("refresh_token"),w=new URLSearchParams(o).get("session");if(!p)throw new Error("No access token found in URL");if(!w)throw new Error("No session ID found in URL");mu.info(`Completing OAuth with session: ${w}`);const _=await fetch(`${Nre}/api/auth/google/complete`,{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({sessionId:w,accessToken:p,refreshToken:g}),signal:n.signal}),x=await _.json();if(!_.ok||!x.success)throw new Error(x.error||x.message||"Failed to complete authentication");if(mu.info("OAuth authentication completed successfully"),r)return;if((l=x.user)!=null&&l.id?(Ce.identify(x.user.id,{...x.user.email?{email:x.user.email}:{}}),x.user.email&&Ce.alias(x.user.email,x.user.id)):(u=x.user)!=null&&u.email&&Ce.identify(x.user.email,{email:x.user.email}),(d=x.user)!=null&&d.email&&p)try{const k=await fetch("/api/auth/store",{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({email:x.user.email,token:p,refreshToken:g,userId:x.user.id}),signal:n.signal});k.ok||mu.warn(`Local auth store returned ${k.status}`)}catch(k){if(r)return;mu.warn("Failed to store auth locally:",k)}if(r)return;window.sessionStorage.setItem(xg,"1");const S=window.location.pathname;window.history.replaceState({},document.title,S),e({isProcessing:!1,isComplete:!0,error:null})}catch(f){if(r)return;const p=f instanceof Error?f.message:"Unknown error occurred";mu.warn("OAuth callback error:",f),e({isProcessing:!1,isComplete:!1,error:p})}}})(),()=>{r=!0,n.abort()}},[]),t},N_=Rs("useAgentVariantsSession"),jre=t=>typeof t.pendingCount=="number"&&t.pendingCount===0&&(t.pendingVariantRequests??0)===0&&(t.leasedVariantRequests??0)===0&&(t.activeLeases??[]).length===0,rP=(t,e,n)=>{e.size===0&&!n||t.set(Ah,r=>{if(r.size===0)return r;const s=new Map(r);let i=!1;for(const[o,l]of r)l.status==="sending"&&l.variantRequestId&&(e.has(l.variantRequestId)||n&&l.variantRequest!==void 0)&&(s.delete(o),i=!0);return i?s:r})},$re=(t,e)=>{var s;if(t.size===0)return t;let n=!1;const r=new Map(t);for(const[i,o]of t){if(o.status!=="sending"||!o.awaitingSnapshotOutcome||o.variantRequest!==void 0)continue;const l=o.target;if(!l||l.kind!=="variant"||l.sessionId!==e.sessionId)continue;const u=(s=e.variants.find(d=>d.workItemId===l.variantId))==null?void 0:s.refinement;u&&(u.status==="succeeded"?(r.set(i,{...o,status:"complete",awaitingSnapshotOutcome:void 0}),n=!0):(u.status==="failed"||u.status==="cancelled")&&(r.set(i,{...o,status:"error",awaitingSnapshotOutcome:void 0}),n=!0))}return n?r:t},Fre=({enabled:t=!0}={})=>{const e=gt(tp),n=gt(TO),r=gt(SO),s=gt(gJ),i=gt(AO),o=gt(xJ),l=$g(),u=m.useRef(null);m.useEffect(()=>{if(n(!1),!t)return;const d=new EventSource("/api/variants/events");return d.onmessage=f=>{try{const p=JSON.parse(f.data),g=u.current;if(p.active){const _=new Set(p.variants.map(x=>x.requestId).filter(x=>!!x));i(x=>x.filter(k=>!_.has(k.requestId))),rP(l,_,!1),l.set(Ah,x=>{let S=x;for(const k of p.variants){const C=k.adoptedSource;C&&(S=wJ(S,{kind:"variant",sessionId:C.sessionId,variantId:C.variantId},{kind:"variant",sessionId:p.sessionId,variantId:k.workItemId}))}return S}),l.set(Ah,x=>$re(x,p)),p.sessionId!==u.current&&(u.current=p.sessionId,r(!0),s("directions"))}else u.current=null,rP(l,new Set,jre(p));e(p),n(!0);const v=!p.active&&g!==null,w=p.active&&p.sessionId!==g;if(w&&fetch(`/api/variants/${p.sessionId}/preview-port`,{method:"POST",headers:{"content-type":"application/json"},body:JSON.stringify({variantId:null})}).catch(_=>N_.warn("failed to reset preview-port on session switch",_)),v||w){const _=new Set;if(p.active)for(const S of p.variants)_.add(Ph({kind:"variant",sessionId:p.sessionId,variantId:S.workItemId}));const x=l.get(Zo);for(const S of[x==null?void 0:x.left,x==null?void 0:x.right])S&&_.add(Ph({kind:"variant",sessionId:S.sessionId,variantId:S.variantId}));o(_)}}catch(p){N_.warn("failed to parse SSE event payload",p)}},d.onerror=f=>{N_.warn("SSE error (auto-reconnects)",f)},()=>{d.close()}},[t,e,n,r,s,i,o,l])};var Vre=Object.defineProperty,ir=(t,e)=>Vre(t,"name",{value:e,configurable:!0});function g4(t){const e=t+"CollectionProvider",[n,r]=to(e),[s,i]=n(e,{collectionRef:{current:null},itemMap:new Map}),o=ir(_=>{const{scope:x,children:S}=_,k=m.useRef(null),C=m.useRef(new Map).current;return b.jsx(s,{scope:x,itemMap:C,collectionRef:k,children:S})},"CollectionProvider");o.displayName=e;const l=t+"CollectionSlot",u=qa(l),d=m.forwardRef((_,x)=>{const{scope:S,children:k}=_,C=i(l,S),T=tn(x,C.collectionRef);return b.jsx(u,{ref:T,children:k})});d.displayName=l;const f=t+"CollectionItemSlot",p="data-radix-collection-item",g=qa(f),v=m.forwardRef((_,x)=>{const{scope:S,children:k,...C}=_,T=m.useRef(null),A=tn(x,T),I=i(f,S);return m.useEffect(()=>(I.itemMap.set(T,{ref:T,...C}),()=>void I.itemMap.delete(T))),b.jsx(g,{[p]:"",ref:A,children:k})});v.displayName=f;function w(_){const x=i(t+"CollectionConsumer",_);return m.useCallback(()=>{const k=x.collectionRef.current;if(!k)return[];const C=Array.from(k.querySelectorAll(`[${p}]`));return Array.from(x.itemMap.values()).sort((I,M)=>C.indexOf(I.ref.current)-C.indexOf(M.ref.current))},[x.collectionRef,x.itemMap])}return ir(w,"useCollection"),[{Provider:o,Slot:d,ItemSlot:v},w,r]}ir(g4,"createCollection");var sP=new WeakMap,Fn,gs,D_=(gs=class extends Map{constructor(n){super(n);rt(this,Fn);Re(this,Fn,[...super.keys()]),sP.set(this,!0)}set(n,r){return sP.get(this)&&(this.has(n)?W(this,Fn)[W(this,Fn).indexOf(n)]=n:W(this,Fn).push(n)),super.set(n,r),this}insert(n,r,s){const i=this.has(r),o=W(this,Fn).length,l=v4(n);let u=l>=0?l:o+l;const d=u<0||u>=o?-1:u;if(d===this.size||i&&d===this.size-1||d===-1)return this.set(r,s),this;const f=this.size+(i?0:1);l<0&&u++;const p=[...W(this,Fn)];let g,v=!1;for(let w=u;w<f;w++)if(u===w){let _=p[w];p[w]===r&&(_=p[w+1]),i&&this.delete(r),g=this.get(_),this.set(r,s)}else{!v&&p[w-1]===r&&(v=!0);const _=p[v?w:w-1],x=g;g=this.get(_),this.delete(_),this.set(_,x)}return this}with(n,r,s){const i=new gs(this);return i.insert(n,r,s),i}before(n){const r=W(this,Fn).indexOf(n)-1;if(!(r<0))return this.entryAt(r)}setBefore(n,r,s){const i=W(this,Fn).indexOf(n);return i===-1?this:this.insert(i,r,s)}after(n){let r=W(this,Fn).indexOf(n);if(r=r===-1||r===this.size-1?-1:r+1,r!==-1)return this.entryAt(r)}setAfter(n,r,s){const i=W(this,Fn).indexOf(n);return i===-1?this:this.insert(i+1,r,s)}first(){return this.entryAt(0)}last(){return this.entryAt(-1)}clear(){return Re(this,Fn,[]),super.clear()}delete(n){const r=super.delete(n);return r&&W(this,Fn).splice(W(this,Fn).indexOf(n),1),r}deleteAt(n){const r=this.keyAt(n);return r!==void 0?this.delete(r):!1}at(n){const r=wm(W(this,Fn),n);if(r!==void 0)return this.get(r)}entryAt(n){const r=wm(W(this,Fn),n);if(r!==void 0)return[r,this.get(r)]}indexOf(n){return W(this,Fn).indexOf(n)}keyAt(n){return wm(W(this,Fn),n)}from(n,r){const s=this.indexOf(n);if(s===-1)return;let i=s+r;return i<0&&(i=0),i>=this.size&&(i=this.size-1),this.at(i)}keyFrom(n,r){const s=this.indexOf(n);if(s===-1)return;let i=s+r;return i<0&&(i=0),i>=this.size&&(i=this.size-1),this.keyAt(i)}find(n,r){let s=0;for(const i of this){if(Reflect.apply(n,r,[i,s,this]))return i;s++}}findIndex(n,r){let s=0;for(const i of this){if(Reflect.apply(n,r,[i,s,this]))return s;s++}return-1}filter(n,r){const s=[];let i=0;for(const o of this)Reflect.apply(n,r,[o,i,this])&&s.push(o),i++;return new gs(s)}map(n,r){const s=[];let i=0;for(const o of this)s.push([o[0],Reflect.apply(n,r,[o,i,this])]),i++;return new gs(s)}reduce(...n){const[r,s]=n;let i=0,o=s??this.at(0);for(const l of this)i===0&&n.length===1?o=l:o=Reflect.apply(r,this,[o,l,i,this]),i++;return o}reduceRight(...n){const[r,s]=n;let i=s??this.at(-1);for(let o=this.size-1;o>=0;o--){const l=this.at(o);o===this.size-1&&n.length===1?i=l:i=Reflect.apply(r,this,[i,l,o,this])}return i}toSorted(n){const r=[...this.entries()].sort(n);return new gs(r)}toReversed(){const n=new gs;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 gs(r)}slice(n,r){const s=new gs;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 o=n;o<=i;o++){const l=this.keyAt(o),u=this.get(l);s.set(l,u)}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}},Fn=new WeakMap,ir(gs,"OrderedDict"),gs);function wm(t,e){if("at"in Array.prototype)return Array.prototype.at.call(t,e);const n=nL(t,e);return n===-1?void 0:t[n]}ir(wm,"at");function nL(t,e){const n=t.length,r=v4(e),s=r>=0?r:n+r;return s<0||s>=n?-1:s}ir(nL,"toSafeIndex");function v4(t){return t!==t||t===0?0:Math.trunc(t)}ir(v4,"toSafeInteger");function Hre(t){const e=t+"CollectionProvider",[n,r]=to(e),[s,i]=n(e,{collectionElement:null,collectionRef:{current:null},collectionRefObject:{current:null},itemMap:new D_,setItemMap:ir(()=>{},"setItemMap")}),o=ir(({state:C,...T})=>C?b.jsx(u,{...T,state:C}):b.jsx(l,{...T}),"CollectionProvider");o.displayName=e;const l=ir(C=>{const T=x();return b.jsx(u,{...C,state:T})},"CollectionInit");l.displayName=e+"Init";const u=ir(C=>{const{scope:T,children:A,state:I}=C,M=m.useRef(null),[R,O]=m.useState(null),N=tn(M,O),[D,$]=I;return m.useEffect(()=>{if(!R)return;const Y=iL(()=>{});return Y.observe(R,{childList:!0,subtree:!0}),()=>{Y.disconnect()}},[R]),b.jsx(s,{scope:T,itemMap:D,setItemMap:$,collectionRef:N,collectionRefObject:M,collectionElement:R,children:A})},"CollectionProviderImpl");u.displayName=e+"Impl";const d=t+"CollectionSlot",f=qa(d),p=m.forwardRef((C,T)=>{const{scope:A,children:I}=C,M=i(d,A),R=tn(T,M.collectionRef);return b.jsx(f,{ref:R,children:I})});p.displayName=d;const g=t+"CollectionItemSlot",v="data-radix-collection-item",w=qa(g),_=m.forwardRef((C,T)=>{const{scope:A,children:I,...M}=C,R=m.useRef(null),[O,N]=m.useState(null),D=tn(T,R,N),$=i(g,A),{setItemMap:Y}=$,B=m.useRef(M);rL(B.current,M)||(B.current=M);const G=B.current;return m.useEffect(()=>{const V=G;return Y(K=>O?K.has(O)?K.set(O,{...V,element:O}).toSorted(tx):(K.set(O,{...V,element:O}),K.toSorted(tx)):K),()=>{Y(K=>!O||!K.has(O)?K:(K.delete(O),new D_(K)))}},[O,G,Y]),b.jsx(w,{[v]:"",ref:D,children:I})});_.displayName=g;function x(){return m.useState(new D_)}ir(x,"useInitCollection");function S(C){const{itemMap:T}=i(t+"CollectionConsumer",C);return T}return ir(S,"useCollection"),[{Provider:o,Slot:p,ItemSlot:_},{createCollectionScope:r,useCollection:S,useInitCollection:x}]}ir(Hre,"createCollection");function rL(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}ir(rL,"shallowEqual");function sL(t,e){return!!(e.compareDocumentPosition(t)&Node.DOCUMENT_POSITION_PRECEDING)}ir(sL,"isElementPreceding");function tx(t,e){return!t[1].element||!e[1].element?0:sL(t[1].element,e[1].element)?-1:1}ir(tx,"sortByDocumentPosition");function iL(t){return new MutationObserver(n=>{for(const r of n)if(r.type==="childList"){t();return}})}ir(iL,"getChildListObserver");var zre=Object.defineProperty,sp=(t,e)=>zre(t,"name",{value:e,configurable:!0}),y4="Collapsible",[Ure,oL]=to(y4),[Bre,_4]=Ure(y4),Zre=m.forwardRef(sp(function(e,n){const{__scopeCollapsible:r,open:s,defaultOpen:i,disabled:o,onOpenChange:l,...u}=e,[d,f]=sl({prop:s,defaultProp:i??!1,onChange:l,caller:y4});return b.jsx(Bre,{scope:r,disabled:o,contentId:Fa(),open:d,onOpenToggle:m.useCallback(()=>f(p=>!p),[f]),children:b.jsx(En.div,{"data-state":pv(d),"data-disabled":o?"":void 0,...u,ref:n})})},"Collapsible")),Wre="CollapsibleTrigger",qre=m.forwardRef(sp(function(e,n){const{__scopeCollapsible:r,...s}=e,i=_4(Wre,r);return b.jsx(En.button,{type:"button","aria-controls":i.open?i.contentId:void 0,"aria-expanded":i.open||!1,"data-state":pv(i.open),"data-disabled":i.disabled?"":void 0,disabled:i.disabled,...s,ref:n,onClick:Kt(e.onClick,i.onOpenToggle)})},"CollapsibleTrigger")),aL="CollapsibleContent",Gre=m.forwardRef(sp(function(e,n){const{forceMount:r,...s}=e,i=_4(aL,e.__scopeCollapsible);return b.jsx(rl,{present:r||i.open,children:({present:o})=>b.jsx(Kre,{...s,ref:n,present:o})})},"CollapsibleContent")),Kre=m.forwardRef(sp(function(e,n){const{__scopeCollapsible:r,present:s,children:i,...o}=e,l=_4(aL,r),[u,d]=m.useState(s),f=m.useRef(null),p=tn(n,f),g=m.useRef(0),v=g.current,w=m.useRef(0),_=w.current,x=l.open||u,S=m.useRef(x),k=m.useRef(void 0);return m.useEffect(()=>{const C=requestAnimationFrame(()=>S.current=!1);return()=>cancelAnimationFrame(C)},[]),Qr(()=>{const C=f.current;if(C){k.current=k.current||{transitionDuration:C.style.transitionDuration,animationName:C.style.animationName},C.style.transitionDuration="0s",C.style.animationName="none";const T=C.getBoundingClientRect();g.current=T.height,w.current=T.width,S.current||(C.style.transitionDuration=k.current.transitionDuration,C.style.animationName=k.current.animationName),d(s)}},[l.open,s]),b.jsx(En.div,{"data-state":pv(l.open),"data-disabled":l.disabled?"":void 0,id:l.contentId,hidden:!x,...o,ref:p,style:{"--radix-collapsible-content-height":v?`${v}px`:void 0,"--radix-collapsible-content-width":_?`${_}px`:void 0,...e.style},children:x&&i})},"CollapsibleContentImpl"));function pv(t){return t?"open":"closed"}sp(pv,"getState");var Yre=Zre,Xre=qre,Qre=Gre,Jre=Object.defineProperty,ese=(t,e)=>Jre(t,"name",{value:e,configurable:!0}),tse=m.createContext(void 0);function w4(t){const e=m.useContext(tse);return t||e||"ltr"}ese(w4,"useDirection");var nse=Object.defineProperty,Cs=(t,e)=>nse(t,"name",{value:e,configurable:!0}),no="Accordion",rse=["Home","End","ArrowDown","ArrowUp","ArrowLeft","ArrowRight"],[x4,sse,ise]=g4(no),[mv,Noe]=to(no,[ise,oL]),b4=oL(),ose=m.forwardRef(Cs(function(e,n){const{type:r,...s}=e,i=s,o=s;return b.jsx(x4.Provider,{scope:e.__scopeAccordion,children:r==="multiple"?b.jsx(use,{...o,ref:n}):b.jsx(cse,{...i,ref:n})})},"Accordion")),[lL,ase]=mv(no),[cL,lse]=mv(no,{collapsible:!1}),cse=m.forwardRef(Cs(function(e,n){const{value:r,defaultValue:s,onValueChange:i=Cs(()=>{},"onValueChange"),collapsible:o=!1,...l}=e,[u,d]=sl({prop:r,defaultProp:s??"",onChange:i,caller:no});return b.jsx(lL,{scope:e.__scopeAccordion,value:m.useMemo(()=>u?[u]:[],[u]),onItemOpen:d,onItemClose:m.useCallback(()=>o&&d(""),[o,d]),children:b.jsx(cL,{scope:e.__scopeAccordion,collapsible:o,children:b.jsx(uL,{...l,ref:n})})})},"AccordionImplSingle")),use=m.forwardRef(Cs(function(e,n){const{value:r,defaultValue:s,onValueChange:i=Cs(()=>{},"onValueChange"),...o}=e,[l,u]=sl({prop:r,defaultProp:s??[],onChange:i,caller:no}),d=m.useCallback(p=>u((g=[])=>[...g,p]),[u]),f=m.useCallback(p=>u((g=[])=>g.filter(v=>v!==p)),[u]);return b.jsx(lL,{scope:e.__scopeAccordion,value:l,onItemOpen:d,onItemClose:f,children:b.jsx(cL,{scope:e.__scopeAccordion,collapsible:!0,children:b.jsx(uL,{...o,ref:n})})})},"AccordionImplMultiple")),[dse,gv]=mv(no),uL=m.forwardRef(Cs(function(e,n){const{__scopeAccordion:r,disabled:s,dir:i,orientation:o="vertical",...l}=e,u=m.useRef(null),d=tn(u,n),f=sse(r),g=w4(i)==="ltr",v=Kt(e.onKeyDown,w=>{var O;if(!rse.includes(w.key))return;const _=w.target,x=f().filter(N=>{var D;return!((D=N.ref.current)!=null&&D.disabled)}),S=x.findIndex(N=>N.ref.current===_),k=x.length;if(S===-1)return;w.preventDefault();let C=S;const T=0,A=k-1,I=Cs(()=>{C=S+1,C>A&&(C=T)},"moveNext"),M=Cs(()=>{C=S-1,C<T&&(C=A)},"movePrev");switch(w.key){case"Home":C=T;break;case"End":C=A;break;case"ArrowRight":o==="horizontal"&&(g?I():M());break;case"ArrowDown":o==="vertical"&&I();break;case"ArrowLeft":o==="horizontal"&&(g?M():I());break;case"ArrowUp":o==="vertical"&&M();break}const R=C%k;(O=x[R].ref.current)==null||O.focus()});return b.jsx(dse,{scope:r,disabled:s,direction:i,orientation:o,children:b.jsx(x4.Slot,{scope:r,children:b.jsx(En.div,{...l,"data-orientation":o,ref:d,onKeyDown:s?void 0:v})})})},"AccordionImpl")),nx="AccordionItem",[fse,S4]=mv(nx),hse=m.forwardRef(Cs(function(e,n){const{__scopeAccordion:r,value:s,...i}=e,o=gv(nx,r),l=ase(nx,r),u=b4(r),d=Fa(),f=s&&l.value.includes(s)||!1,p=o.disabled||e.disabled;return b.jsx(fse,{scope:r,open:f,disabled:p,triggerId:d,children:b.jsx(Yre,{"data-orientation":o.orientation,"data-state":k4(f),...u,...i,ref:n,disabled:p,open:f,onOpenChange:g=>{g?l.onItemOpen(s):l.onItemClose(s)}})})},"AccordionItem")),pse="AccordionHeader",mse=m.forwardRef(Cs(function(e,n){const{__scopeAccordion:r,...s}=e,i=gv(no,r),o=S4(pse,r);return b.jsx(En.h3,{"data-orientation":i.orientation,"data-state":k4(o.open),"data-disabled":o.disabled?"":void 0,...s,ref:n})},"AccordionHeader")),iP="AccordionTrigger",gse=m.forwardRef(Cs(function(e,n){const{__scopeAccordion:r,...s}=e,i=gv(no,r),o=S4(iP,r),l=lse(iP,r),u=b4(r);return b.jsx(x4.ItemSlot,{scope:r,children:b.jsx(Xre,{"aria-disabled":o.open&&!l.collapsible||void 0,"data-orientation":i.orientation,id:o.triggerId,...u,...s,ref:n})})},"AccordionTrigger")),vse="AccordionContent",yse=m.forwardRef(Cs(function(e,n){const{__scopeAccordion:r,...s}=e,i=gv(no,r),o=S4(vse,r),l=b4(r);return b.jsx(Qre,{role:"region","aria-labelledby":o.triggerId,"data-orientation":i.orientation,...l,...s,ref:n,style:{"--radix-accordion-content-height":"var(--radix-collapsible-content-height)","--radix-accordion-content-width":"var(--radix-collapsible-content-width)",...e.style}})},"AccordionContent"));function k4(t){return t?"open":"closed"}Cs(k4,"getState");var dL=ose,_se=hse,wse=mse,xse=gse,bse=yse;/**
156
+ * @license lucide-react v1.52.0 - ISC
157
+ *
158
+ * This source code is licensed under the ISC license.
159
+ * See the LICENSE file in the root directory of this source tree.
160
+ */const Sse=t=>t==null?void 0:t.replace(/([a-z0-9])([A-Z])/g,"$1-$2").toLowerCase();/**
161
+ * @license lucide-react v1.52.0 - ISC
162
+ *
163
+ * This source code is licensed under the ISC license.
164
+ * See the LICENSE file in the root directory of this source tree.
165
+ */function kse(t,e,n=[]){if(e==null)throw new Error("[lucide]: iconNode is required when icon name is used");return{name:Sse(t),size:24,node:e,...n.length>0?{aliases:n}:{}}}/**
166
+ * @license lucide-react v1.52.0 - ISC
167
+ *
168
+ * This source code is licensed under the ISC license.
169
+ * See the LICENSE file in the root directory of this source tree.
170
+ */const Ese=t=>{let e="",n=!1;for(const r of t){if(r==="-"||r==="_"||r<=" "){n=e.length>0;continue}e.length===0?e+=r.toLowerCase():e+=n?r.toUpperCase():r,n=!1}return e};/**
171
+ * @license lucide-react v1.52.0 - ISC
172
+ *
173
+ * This source code is licensed under the ISC license.
174
+ * See the LICENSE file in the root directory of this source tree.
175
+ */const Cse=t=>{const e=Ese(t);return e.charAt(0).toUpperCase()+e.slice(1)};/**
176
+ * @license lucide-react v1.52.0 - ISC
177
+ *
178
+ * This source code is licensed under the ISC license.
179
+ * See the LICENSE file in the root directory of this source tree.
180
+ */const rx=(...t)=>t.filter((e,n,r)=>!!e&&e.trim()!==""&&r.indexOf(e)===n).join(" ").trim();/**
181
+ * @license lucide-react v1.52.0 - ISC
182
+ *
183
+ * This source code is licensed under the ISC license.
184
+ * See the LICENSE file in the root directory of this source tree.
185
+ */const jl={xmlns:"http://www.w3.org/2000/svg",width:24,height:24,viewBox:"0 0 24 24",fill:"none",stroke:"currentColor","stroke-width":2,"stroke-linecap":"round","stroke-linejoin":"round"};/**
186
+ * @license lucide-react v1.52.0 - ISC
187
+ *
188
+ * This source code is licensed under the ISC license.
189
+ * See the LICENSE file in the root directory of this source tree.
190
+ */function j_(t){return t!=null}function Pse(t,e={}){var g,v;const n=e.attributeNames??{},r=w=>n[w]??w,s=t.size??t.width??jl.width,i=t.size??t.height??jl.height,o=((g=t.aliases)==null?void 0:g.filter(w=>typeof w=="string"&&w.trim()!=="").map(w=>`lucide-${w}`))??[],l=[...t.name?[`lucide-${t.name}`]:[],...o],u=((v=e.className)==null?void 0:v.split(" ").filter(Boolean))??[],d=e.includeDefaultClasses===!1?rx(...u):rx("lucide",...l,...u),f=e.absoluteStrokeWidth?Number(e.strokeWidth??jl["stroke-width"])*Number(t.size??t.width??jl.width)/Number(e.size??e.width??jl.width):e.strokeWidth??jl["stroke-width"];return["svg",{...Object.entries(jl).reduce((w,[_,x])=>(w[r(_)]=x,w),{}),..."color"in e&&e.color&&{[r("stroke")]:e.color},..."size"in e&&j_(e.size)&&{[r("width")]:e.size,[r("height")]:e.size},..."width"in e&&j_(e.width)&&{[r("width")]:e.width},..."height"in e&&j_(e.height)&&{[r("height")]:e.height},[r("stroke-width")]:f,...d&&{[r("class")]:d},[r("viewBox")]:`0 0 ${s} ${i}`,...e.hasA11yProp===!1?{[r("aria-hidden")]:"true"}:{},..."attributes"in e&&e.attributes},t.node.map(w=>{const[_,x,S]=w,k=e.nonScalingStroke?{[r("vector-effect")]:"non-scaling-stroke",...x}:x;return S?[_,k,S]:[_,k]})]}/**
191
+ * @license lucide-react v1.52.0 - ISC
192
+ *
193
+ * This source code is licensed under the ISC license.
194
+ * See the LICENSE file in the root directory of this source tree.
195
+ */function Tse(t,e={}){return Pse(t,{...e,attributeNames:{...e.attributeNames,class:"className","stroke-width":"strokeWidth","stroke-linecap":"strokeLinecap","stroke-linejoin":"strokeLinejoin","vector-effect":"vectorEffect"}})}/**
196
+ * @license lucide-react v1.52.0 - ISC
197
+ *
198
+ * This source code is licensed under the ISC license.
199
+ * See the LICENSE file in the root directory of this source tree.
200
+ */const Ase=t=>{for(const e in t)if(e.startsWith("aria-")||e==="role"||e==="title")return!0;return!1},Rse=m.createContext({}),Mse=()=>m.useContext(Rse),Ise=m.forwardRef(({color:t,size:e,width:n,height:r,strokeWidth:s,absoluteStrokeWidth:i,nonScalingStroke:o,className:l="",children:u,iconNode:d=[],icon:f={node:d,aliases:[],size:24},...p},g)=>{const{size:v=24,strokeWidth:w=2,absoluteStrokeWidth:_=!1,nonScalingStroke:x=!1,color:S="currentColor",className:k=""}=Mse()??{},C=!!u||Ase(p),[T,A,I=[]]=Tse(f,{color:t??S,width:n??e??v,height:r??e??v,strokeWidth:s??w,absoluteStrokeWidth:i??_,nonScalingStroke:o??x,className:rx(k,l),hasA11yProp:C,attributes:p});return m.createElement(T,{ref:g,...A},[...I.map(([M,R])=>m.createElement(M,R)),...Array.isArray(u)?u:[u]])});/**
201
+ * @license lucide-react v1.52.0 - ISC
202
+ *
203
+ * This source code is licensed under the ISC license.
204
+ * See the LICENSE file in the root directory of this source tree.
205
+ */function at(t,e=[],n=[]){const r=typeof t=="string"?kse(t,e,n):t,s=m.forwardRef(({className:i,...o},l)=>m.createElement(Ise,{ref:l,icon:r,className:i,...o}));return r.name&&(s.displayName=Cse(r.name)),s}/**
206
+ * @license lucide-react v1.52.0 - ISC
207
+ *
208
+ * This source code is licensed under the ISC license.
209
+ * See the LICENSE file in the root directory of this source tree.
210
+ */const fL={name:"arrow-left",size:24,node:[["path",{d:"m12 19-7-7 7-7",key:"1l729n"}],["path",{d:"M19 12H5",key:"x3x0zl"}]]};fL.node;const Ose=at(fL);/**
211
+ * @license lucide-react v1.52.0 - ISC
212
+ *
213
+ * This source code is licensed under the ISC license.
214
+ * See the LICENSE file in the root directory of this source tree.
215
+ */const hL={name:"arrow-right",size:24,node:[["path",{d:"M5 12h14",key:"1ays0h"}],["path",{d:"m12 5 7 7-7 7",key:"xquz4c"}]]};hL.node;const Lse=at(hL);/**
216
+ * @license lucide-react v1.52.0 - ISC
217
+ *
218
+ * This source code is licensed under the ISC license.
219
+ * See the LICENSE file in the root directory of this source tree.
220
+ */const pL={name:"arrow-up",size:24,node:[["path",{d:"m5 12 7-7 7 7",key:"hav0vg"}],["path",{d:"M12 19V5",key:"x0mq9r"}]]};pL.node;const Nse=at(pL);/**
221
+ * @license lucide-react v1.52.0 - ISC
222
+ *
223
+ * This source code is licensed under the ISC license.
224
+ * See the LICENSE file in the root directory of this source tree.
225
+ */const mL={name:"bell",size:24,node:[["path",{d:"M10.268 21a2 2 0 0 0 3.464 0",key:"vwvbt9"}],["path",{d:"M3.262 15.326A1 1 0 0 0 4 17h16a1 1 0 0 0 .74-1.673C19.41 13.956 18 12.499 18 8A6 6 0 0 0 6 8c0 4.499-1.411 5.956-2.738 7.326",key:"11g9vi"}]]};mL.node;const Dse=at(mL);/**
226
+ * @license lucide-react v1.52.0 - ISC
227
+ *
228
+ * This source code is licensed under the ISC license.
229
+ * See the LICENSE file in the root directory of this source tree.
230
+ */const gL={name:"brain",size:24,node:[["path",{d:"M12 18V5",key:"adv99a"}],["path",{d:"M15 13a4.17 4.17 0 0 1-3-4 4.17 4.17 0 0 1-3 4",key:"1e3is1"}],["path",{d:"M17.598 6.5A3 3 0 1 0 12 5a3 3 0 1 0-5.598 1.5",key:"1gqd8o"}],["path",{d:"M17.997 5.125a4 4 0 0 1 2.526 5.77",key:"iwvgf7"}],["path",{d:"M18 18a4 4 0 0 0 2-7.464",key:"efp6ie"}],["path",{d:"M19.967 17.483A4 4 0 1 1 12 18a4 4 0 1 1-7.967-.517",key:"1gq6am"}],["path",{d:"M6 18a4 4 0 0 1-2-7.464",key:"k1g0md"}],["path",{d:"M6.003 5.125a4 4 0 0 0-2.526 5.77",key:"q97ue3"}]]};gL.node;const jse=at(gL);/**
231
+ * @license lucide-react v1.52.0 - ISC
232
+ *
233
+ * This source code is licensed under the ISC license.
234
+ * See the LICENSE file in the root directory of this source tree.
235
+ */const vL={name:"check",size:24,node:[["path",{d:"M20 6 9 17l-5-5",key:"1gmf2c"}]]};vL.node;const $se=at(vL);/**
236
+ * @license lucide-react v1.52.0 - ISC
237
+ *
238
+ * This source code is licensed under the ISC license.
239
+ * See the LICENSE file in the root directory of this source tree.
240
+ */const yL={name:"chevron-down",size:24,node:[["path",{d:"m6 9 6 6 6-6",key:"qrunsl"}]]};yL.node;const Fse=at(yL);/**
241
+ * @license lucide-react v1.52.0 - ISC
242
+ *
243
+ * This source code is licensed under the ISC license.
244
+ * See the LICENSE file in the root directory of this source tree.
245
+ */const _L={name:"chevron-right",size:24,node:[["path",{d:"m9 18 6-6-6-6",key:"mthhwq"}]]};_L.node;const Vse=at(_L);/**
246
+ * @license lucide-react v1.52.0 - ISC
247
+ *
248
+ * This source code is licensed under the ISC license.
249
+ * See the LICENSE file in the root directory of this source tree.
250
+ */const wL={name:"circle",size:24,node:[["circle",{cx:"12",cy:"12",r:"10",key:"1mglay"}]]};wL.node;const Hse=at(wL);/**
251
+ * @license lucide-react v1.52.0 - ISC
252
+ *
253
+ * This source code is licensed under the ISC license.
254
+ * See the LICENSE file in the root directory of this source tree.
255
+ */const xL={name:"clock",size:24,node:[["circle",{cx:"12",cy:"12",r:"10",key:"1mglay"}],["path",{d:"M12 6v6l4 2",key:"mmk7yg"}]]};xL.node;const zse=at(xL);/**
256
+ * @license lucide-react v1.52.0 - ISC
257
+ *
258
+ * This source code is licensed under the ISC license.
259
+ * See the LICENSE file in the root directory of this source tree.
260
+ */const bL={name:"copy",size:24,node:[["rect",{width:"14",height:"14",x:"8",y:"8",rx:"2",ry:"2",key:"17jyea"}],["path",{d:"M4 16c-1.1 0-2-.9-2-2V4c0-1.1.9-2 2-2h10c1.1 0 2 .9 2 2",key:"zix9uf"}]]};bL.node;const Use=at(bL);/**
261
+ * @license lucide-react v1.52.0 - ISC
262
+ *
263
+ * This source code is licensed under the ISC license.
264
+ * See the LICENSE file in the root directory of this source tree.
265
+ */const SL={name:"dot",size:24,node:[["circle",{cx:"12",cy:"12",r:"1",key:"41hilf"}]]};SL.node;const Bse=at(SL);/**
266
+ * @license lucide-react v1.52.0 - ISC
267
+ *
268
+ * This source code is licensed under the ISC license.
269
+ * See the LICENSE file in the root directory of this source tree.
270
+ */const kL={name:"globe",size:24,node:[["circle",{cx:"12",cy:"12",r:"10",key:"1mglay"}],["path",{d:"M12 2a14.5 14.5 0 0 0 0 20 14.5 14.5 0 0 0 0-20",key:"13o1zl"}],["path",{d:"M2 12h20",key:"9i4pu4"}]]};kL.node;const Zse=at(kL);/**
271
+ * @license lucide-react v1.52.0 - ISC
272
+ *
273
+ * This source code is licensed under the ISC license.
274
+ * See the LICENSE file in the root directory of this source tree.
275
+ */const EL={name:"heart",size:24,node:[["path",{d:"M2 9.5a5.5 5.5 0 0 1 9.591-3.676.56.56 0 0 0 .818 0A5.49 5.49 0 0 1 22 9.5c0 2.29-1.5 4-3 5.5l-5.492 5.313a2 2 0 0 1-3 .019L5 15c-1.5-1.5-3-3.2-3-5.5",key:"mvr1a0"}]]};EL.node;const Wse=at(EL);/**
276
+ * @license lucide-react v1.52.0 - ISC
277
+ *
278
+ * This source code is licensed under the ISC license.
279
+ * See the LICENSE file in the root directory of this source tree.
280
+ */const CL={name:"house",size:24,node:[["path",{d:"M15 21v-8a1 1 0 0 0-1-1h-4a1 1 0 0 0-1 1v8",key:"5wwlr5"}],["path",{d:"M3 10a2 2 0 0 1 .709-1.528l7-6a2 2 0 0 1 2.582 0l7 6A2 2 0 0 1 21 10v9a2 2 0 0 1-2 2H5a2 2 0 0 1-2-2z",key:"r6nss1"}]],aliases:["home"]};CL.node;const qse=at(CL);/**
281
+ * @license lucide-react v1.52.0 - ISC
282
+ *
283
+ * This source code is licensed under the ISC license.
284
+ * See the LICENSE file in the root directory of this source tree.
285
+ */const PL={name:"image",size:24,node:[["rect",{width:"18",height:"18",x:"3",y:"3",rx:"2",ry:"2",key:"1m3agn"}],["circle",{cx:"9",cy:"9",r:"2",key:"af1f0g"}],["path",{d:"m21 15-3.086-3.086a2 2 0 0 0-2.828 0L6 21",key:"1xmnt7"}]]};PL.node;const Gse=at(PL);/**
286
+ * @license lucide-react v1.52.0 - ISC
287
+ *
288
+ * This source code is licensed under the ISC license.
289
+ * See the LICENSE file in the root directory of this source tree.
290
+ */const TL={name:"inbox",size:24,node:[["polyline",{points:"22 12 16 12 14 15 10 15 8 12 2 12",key:"o97t9d"}],["path",{d:"M5.45 5.11 2 12v6a2 2 0 0 0 2 2h16a2 2 0 0 0 2-2v-6l-3.45-6.89A2 2 0 0 0 16.76 4H7.24a2 2 0 0 0-1.79 1.11z",key:"oot6mr"}]]};TL.node;const Kse=at(TL);/**
291
+ * @license lucide-react v1.52.0 - ISC
292
+ *
293
+ * This source code is licensed under the ISC license.
294
+ * See the LICENSE file in the root directory of this source tree.
295
+ */const AL={name:"lightbulb",size:24,node:[["path",{d:"M15 14c.2-1 .7-1.7 1.5-2.5 1-.9 1.5-2.2 1.5-3.5A6 6 0 0 0 6 8c0 1 .2 2.2 1.5 3.5.7.7 1.3 1.5 1.5 2.5",key:"1gvzjb"}],["path",{d:"M9 18h6",key:"x1upvd"}],["path",{d:"M10 22h4",key:"ceow96"}]]};AL.node;const Yse=at(AL);/**
296
+ * @license lucide-react v1.52.0 - ISC
297
+ *
298
+ * This source code is licensed under the ISC license.
299
+ * See the LICENSE file in the root directory of this source tree.
300
+ */const RL={name:"link",size:24,node:[["path",{d:"M10 13a5 5 0 0 0 7.54.54l3-3a5 5 0 0 0-7.07-7.07l-1.72 1.71",key:"1cjeqo"}],["path",{d:"M14 11a5 5 0 0 0-7.54-.54l-3 3a5 5 0 0 0 7.07 7.07l1.71-1.71",key:"19qd67"}]]};RL.node;const Xse=at(RL);/**
301
+ * @license lucide-react v1.52.0 - ISC
302
+ *
303
+ * This source code is licensed under the ISC license.
304
+ * See the LICENSE file in the root directory of this source tree.
305
+ */const ML={name:"loader",size:24,node:[["path",{d:"M12 2v4",key:"3427ic"}],["path",{d:"m16.2 7.8 2.9-2.9",key:"r700ao"}],["path",{d:"M18 12h4",key:"wj9ykh"}],["path",{d:"m16.2 16.2 2.9 2.9",key:"1bxg5t"}],["path",{d:"M12 18v4",key:"jadmvz"}],["path",{d:"m4.9 19.1 2.9-2.9",key:"bwix9q"}],["path",{d:"M2 12h4",key:"j09sii"}],["path",{d:"m4.9 4.9 2.9 2.9",key:"giyufr"}]]};ML.node;const Qse=at(ML);/**
306
+ * @license lucide-react v1.52.0 - ISC
307
+ *
308
+ * This source code is licensed under the ISC license.
309
+ * See the LICENSE file in the root directory of this source tree.
310
+ */const IL={name:"lock",size:24,node:[["rect",{width:"18",height:"11",x:"3",y:"11",rx:"2",ry:"2",key:"1w4ew1"}],["path",{d:"M7 11V7a5 5 0 0 1 10 0v4",key:"fwvmzm"}]]};IL.node;const Jse=at(IL);/**
311
+ * @license lucide-react v1.52.0 - ISC
312
+ *
313
+ * This source code is licensed under the ISC license.
314
+ * See the LICENSE file in the root directory of this source tree.
315
+ */const OL={name:"mail",size:24,node:[["path",{d:"m22 7-8.991 5.727a2 2 0 0 1-2.009 0L2 7",key:"132q7q"}],["rect",{x:"2",y:"4",width:"20",height:"16",rx:"2",key:"izxlao"}]]};OL.node;const eie=at(OL);/**
316
+ * @license lucide-react v1.52.0 - ISC
317
+ *
318
+ * This source code is licensed under the ISC license.
319
+ * See the LICENSE file in the root directory of this source tree.
320
+ */const LL={name:"menu",size:24,node:[["path",{d:"M4 5h16",key:"1tepv9"}],["path",{d:"M4 12h16",key:"1lakjw"}],["path",{d:"M4 19h16",key:"1djgab"}]]};LL.node;const tie=at(LL);/**
321
+ * @license lucide-react v1.52.0 - ISC
322
+ *
323
+ * This source code is licensed under the ISC license.
324
+ * See the LICENSE file in the root directory of this source tree.
325
+ */const NL={name:"message-circle",size:24,node:[["path",{d:"M2.992 16.342a2 2 0 0 1 .094 1.167l-1.065 3.29a1 1 0 0 0 1.236 1.168l3.413-.998a2 2 0 0 1 1.099.092 10 10 0 1 0-4.777-4.719",key:"1sd12s"}]]};NL.node;const nie=at(NL);/**
326
+ * @license lucide-react v1.52.0 - ISC
327
+ *
328
+ * This source code is licensed under the ISC license.
329
+ * See the LICENSE file in the root directory of this source tree.
330
+ */const DL={name:"monitor",size:24,node:[["rect",{width:"20",height:"14",x:"2",y:"3",rx:"2",key:"48i651"}],["line",{x1:"8",x2:"16",y1:"21",y2:"21",key:"1svkeh"}],["line",{x1:"12",x2:"12",y1:"17",y2:"21",key:"vw1qmm"}]]};DL.node;const rie=at(DL);/**
331
+ * @license lucide-react v1.52.0 - ISC
332
+ *
333
+ * This source code is licensed under the ISC license.
334
+ * See the LICENSE file in the root directory of this source tree.
335
+ */const jL={name:"moon",size:24,node:[["path",{d:"M20.985 12.486a9 9 0 1 1-9.473-9.472c.405-.022.617.46.402.803a6 6 0 0 0 8.268 8.268c.344-.215.825-.004.803.401",key:"kfwtm"}]]};jL.node;const sie=at(jL);/**
336
+ * @license lucide-react v1.52.0 - ISC
337
+ *
338
+ * This source code is licensed under the ISC license.
339
+ * See the LICENSE file in the root directory of this source tree.
340
+ */const $L={name:"paintbrush",size:24,node:[["path",{d:"m14.622 17.897-10.68-2.913",key:"vj2p1u"}],["path",{d:"M18.376 2.622a1 1 0 1 1 3.002 3.002L17.36 9.643a.5.5 0 0 0 0 .707l.944.944a2.41 2.41 0 0 1 0 3.408l-.944.944a.5.5 0 0 1-.707 0L8.354 7.348a.5.5 0 0 1 0-.707l.944-.944a2.41 2.41 0 0 1 3.408 0l.944.944a.5.5 0 0 0 .707 0z",key:"18tc5c"}],["path",{d:"M9 8c-1.804 2.71-3.97 3.46-6.583 3.948a.507.507 0 0 0-.302.819l7.32 8.883a1 1 0 0 0 1.185.204C12.735 20.405 16 16.792 16 15",key:"ytzfxy"}]]};$L.node;const iie=at($L);/**
341
+ * @license lucide-react v1.52.0 - ISC
342
+ *
343
+ * This source code is licensed under the ISC license.
344
+ * See the LICENSE file in the root directory of this source tree.
345
+ */const FL={name:"palette",size:24,node:[["path",{d:"M12 22a1 1 0 0 1 0-20 10 9 0 0 1 10 9 5 5 0 0 1-5 5h-2.25a1.75 1.75 0 0 0-1.4 2.8l.3.4a1.75 1.75 0 0 1-1.4 2.8z",key:"e79jfc"}],["circle",{cx:"13.5",cy:"6.5",r:".5",fill:"currentColor",key:"1okk4w"}],["circle",{cx:"17.5",cy:"10.5",r:".5",fill:"currentColor",key:"f64h9f"}],["circle",{cx:"6.5",cy:"12.5",r:".5",fill:"currentColor",key:"qy21gx"}],["circle",{cx:"8.5",cy:"7.5",r:".5",fill:"currentColor",key:"fotxhn"}]]};FL.node;const oie=at(FL);/**
346
+ * @license lucide-react v1.52.0 - ISC
347
+ *
348
+ * This source code is licensed under the ISC license.
349
+ * See the LICENSE file in the root directory of this source tree.
350
+ */const VL={name:"pause",size:24,node:[["rect",{x:"14",y:"3",width:"5",height:"18",rx:"1",key:"kaeet6"}],["rect",{x:"5",y:"3",width:"5",height:"18",rx:"1",key:"1wsw3u"}]]};VL.node;const aie=at(VL);/**
351
+ * @license lucide-react v1.52.0 - ISC
352
+ *
353
+ * This source code is licensed under the ISC license.
354
+ * See the LICENSE file in the root directory of this source tree.
355
+ */const HL={name:"pencil",size:24,node:[["path",{d:"M21.174 6.812a1 1 0 0 0-3.986-3.987L3.842 16.174a2 2 0 0 0-.5.83l-1.321 4.352a.5.5 0 0 0 .623.622l4.353-1.32a2 2 0 0 0 .83-.497z",key:"1a8usu"}],["path",{d:"m15 5 4 4",key:"1mk7zo"}]]};HL.node;const lie=at(HL);/**
356
+ * @license lucide-react v1.52.0 - ISC
357
+ *
358
+ * This source code is licensed under the ISC license.
359
+ * See the LICENSE file in the root directory of this source tree.
360
+ */const zL={name:"pipette",size:24,node:[["path",{d:"m12 9-8.414 8.414A2 2 0 0 0 3 18.828v1.344a2 2 0 0 1-.586 1.414A2 2 0 0 1 3.828 21h1.344a2 2 0 0 0 1.414-.586L15 12",key:"1y3wsu"}],["path",{d:"m18 9 .4.4a1 1 0 1 1-3 3l-3.8-3.8a1 1 0 1 1 3-3l.4.4 3.4-3.4a1 1 0 1 1 3 3z",key:"110lr1"}],["path",{d:"m2 22 .414-.414",key:"jhxm08"}]]};zL.node;const cie=at(zL);/**
361
+ * @license lucide-react v1.52.0 - ISC
362
+ *
363
+ * This source code is licensed under the ISC license.
364
+ * See the LICENSE file in the root directory of this source tree.
365
+ */const UL={name:"play",size:24,node:[["path",{d:"M5 5a2 2 0 0 1 3.008-1.728l11.997 6.998a2 2 0 0 1 .003 3.458l-12 7A2 2 0 0 1 5 19z",key:"10ikf1"}]]};UL.node;const uie=at(UL);/**
366
+ * @license lucide-react v1.52.0 - ISC
367
+ *
368
+ * This source code is licensed under the ISC license.
369
+ * See the LICENSE file in the root directory of this source tree.
370
+ */const BL={name:"plus",size:24,node:[["path",{d:"M5 12h14",key:"1ays0h"}],["path",{d:"M12 5v14",key:"s699le"}]]};BL.node;const die=at(BL);/**
371
+ * @license lucide-react v1.52.0 - ISC
372
+ *
373
+ * This source code is licensed under the ISC license.
374
+ * See the LICENSE file in the root directory of this source tree.
375
+ */const ZL={name:"rectangle-horizontal",size:24,node:[["rect",{width:"20",height:"12",x:"2",y:"6",rx:"2",key:"9lu3g6"}]]};ZL.node;const fie=at(ZL);/**
376
+ * @license lucide-react v1.52.0 - ISC
377
+ *
378
+ * This source code is licensed under the ISC license.
379
+ * See the LICENSE file in the root directory of this source tree.
380
+ */const WL={name:"rocket",size:24,node:[["path",{d:"M12 15v5s3.03-.55 4-2c1.08-1.62 0-5 0-5",key:"qeys4"}],["path",{d:"M4.5 16.5c-1.5 1.26-2 5-2 5s3.74-.5 5-2c.71-.84.7-2.13-.09-2.91a2.18 2.18 0 0 0-2.91-.09",key:"u4xsad"}],["path",{d:"M9 12a22 22 0 0 1 2-3.95A12.88 12.88 0 0 1 22 2c0 2.72-.78 7.5-6 11a22.4 22.4 0 0 1-4 2z",key:"676m9"}],["path",{d:"M9 12H4s.55-3.03 2-4c1.62-1.08 5 .05 5 .05",key:"92ym6u"}]]};WL.node;const hie=at(WL);/**
381
+ * @license lucide-react v1.52.0 - ISC
382
+ *
383
+ * This source code is licensed under the ISC license.
384
+ * See the LICENSE file in the root directory of this source tree.
385
+ */const qL={name:"rotate-ccw",size:24,node:[["path",{d:"M3 12a9 9 0 1 0 9-9 9.75 9.75 0 0 0-6.74 2.74L3 8",key:"1357e3"}],["path",{d:"M3 3v5h5",key:"1xhq8a"}]]};qL.node;const pie=at(qL);/**
386
+ * @license lucide-react v1.52.0 - ISC
387
+ *
388
+ * This source code is licensed under the ISC license.
389
+ * See the LICENSE file in the root directory of this source tree.
390
+ */const GL={name:"search",size:24,node:[["path",{d:"m21 21-4.34-4.34",key:"14j7rj"}],["circle",{cx:"11",cy:"11",r:"8",key:"4ej97u"}]]};GL.node;const mie=at(GL);/**
391
+ * @license lucide-react v1.52.0 - ISC
392
+ *
393
+ * This source code is licensed under the ISC license.
394
+ * See the LICENSE file in the root directory of this source tree.
395
+ */const KL={name:"settings",size:24,node:[["path",{d:"M9.671 4.136a2.34 2.34 0 0 1 4.659 0 2.34 2.34 0 0 0 3.319 1.915 2.34 2.34 0 0 1 2.33 4.033 2.34 2.34 0 0 0 0 3.831 2.34 2.34 0 0 1-2.33 4.033 2.34 2.34 0 0 0-3.319 1.915 2.34 2.34 0 0 1-4.659 0 2.34 2.34 0 0 0-3.32-1.915 2.34 2.34 0 0 1-2.33-4.033 2.34 2.34 0 0 0 0-3.831A2.34 2.34 0 0 1 6.35 6.051a2.34 2.34 0 0 0 3.319-1.915",key:"1i5ecw"}],["circle",{cx:"12",cy:"12",r:"3",key:"1v7zrd"}]]};KL.node;const gie=at(KL);/**
396
+ * @license lucide-react v1.52.0 - ISC
397
+ *
398
+ * This source code is licensed under the ISC license.
399
+ * See the LICENSE file in the root directory of this source tree.
400
+ */const YL={name:"shield",size:24,node:[["path",{d:"M20 13c0 5-3.5 7.5-7.66 8.95a1 1 0 0 1-.67-.01C7.5 20.5 4 18 4 13V6a1 1 0 0 1 1-1c2 0 4.5-1.2 6.24-2.72a1.17 1.17 0 0 1 1.52 0C14.51 3.81 17 5 19 5a1 1 0 0 1 1 1z",key:"oel41y"}]]};YL.node;const vie=at(YL);/**
401
+ * @license lucide-react v1.52.0 - ISC
402
+ *
403
+ * This source code is licensed under the ISC license.
404
+ * See the LICENSE file in the root directory of this source tree.
405
+ */const XL={name:"skip-forward",size:24,node:[["path",{d:"M21 4v16",key:"7j8fe9"}],["path",{d:"M6.029 4.285A2 2 0 0 0 3 6v12a2 2 0 0 0 3.029 1.715l9.997-5.998a2 2 0 0 0 .003-3.432z",key:"zs4d6"}]]};XL.node;const yie=at(XL);/**
406
+ * @license lucide-react v1.52.0 - ISC
407
+ *
408
+ * This source code is licensed under the ISC license.
409
+ * See the LICENSE file in the root directory of this source tree.
410
+ */const QL={name:"square-library",size:24,node:[["rect",{width:"18",height:"18",x:"3",y:"3",rx:"2",key:"afitv7"}],["path",{d:"M7 7v10",key:"d5nglc"}],["path",{d:"M11 7v10",key:"pptsnr"}],["path",{d:"m15 7 2 10",key:"1m7qm5"}]],aliases:["library-square"]};QL.node;const _ie=at(QL);/**
411
+ * @license lucide-react v1.52.0 - ISC
412
+ *
413
+ * This source code is licensed under the ISC license.
414
+ * See the LICENSE file in the root directory of this source tree.
415
+ */const JL={name:"star",size:24,node:[["path",{d:"M11.525 2.295a.53.53 0 0 1 .95 0l2.31 4.679a2.123 2.123 0 0 0 1.595 1.16l5.166.756a.53.53 0 0 1 .294.904l-3.736 3.638a2.123 2.123 0 0 0-.611 1.878l.882 5.14a.53.53 0 0 1-.771.56l-4.618-2.428a2.122 2.122 0 0 0-1.973 0L6.396 21.01a.53.53 0 0 1-.77-.56l.881-5.139a2.122 2.122 0 0 0-.611-1.879L2.16 9.795a.53.53 0 0 1 .294-.906l5.165-.755a2.122 2.122 0 0 0 1.597-1.16z",key:"r04s7s"}]]};JL.node;const wie=at(JL);/**
416
+ * @license lucide-react v1.52.0 - ISC
417
+ *
418
+ * This source code is licensed under the ISC license.
419
+ * See the LICENSE file in the root directory of this source tree.
420
+ */const eN={name:"sun",size:24,node:[["circle",{cx:"12",cy:"12",r:"4",key:"4exip2"}],["path",{d:"M12 2v2",key:"tus03m"}],["path",{d:"M12 20v2",key:"1lh1kg"}],["path",{d:"m4.93 4.93 1.41 1.41",key:"149t6j"}],["path",{d:"m17.66 17.66 1.41 1.41",key:"ptbguv"}],["path",{d:"M2 12h2",key:"1t8f8n"}],["path",{d:"M20 12h2",key:"1q8mjw"}],["path",{d:"m6.34 17.66-1.41 1.41",key:"1m8zz5"}],["path",{d:"m19.07 4.93-1.41 1.41",key:"1shlcs"}]]};eN.node;const xie=at(eN);/**
421
+ * @license lucide-react v1.52.0 - ISC
422
+ *
423
+ * This source code is licensed under the ISC license.
424
+ * See the LICENSE file in the root directory of this source tree.
425
+ */const tN={name:"user",size:24,node:[["path",{d:"M19 21v-2a4 4 0 0 0-4-4H9a4 4 0 0 0-4 4v2",key:"975kel"}],["circle",{cx:"12",cy:"7",r:"4",key:"17ys0d"}]]};tN.node;const bie=at(tN);/**
426
+ * @license lucide-react v1.52.0 - ISC
427
+ *
428
+ * This source code is licensed under the ISC license.
429
+ * See the LICENSE file in the root directory of this source tree.
430
+ */const nN={name:"users",size:24,node:[["path",{d:"M16 21v-2a4 4 0 0 0-4-4H6a4 4 0 0 0-4 4v2",key:"1yyitq"}],["path",{d:"M16 3.128a4 4 0 0 1 0 7.744",key:"16gr8j"}],["path",{d:"M22 21v-2a4 4 0 0 0-3-3.87",key:"kshegd"}],["circle",{cx:"9",cy:"7",r:"4",key:"nufk8"}]]};nN.node;const Sie=at(nN);/**
431
+ * @license lucide-react v1.52.0 - ISC
432
+ *
433
+ * This source code is licensed under the ISC license.
434
+ * See the LICENSE file in the root directory of this source tree.
435
+ */const rN={name:"x",size:24,node:[["path",{d:"M18 6 6 18",key:"1bl5f8"}],["path",{d:"m6 6 12 12",key:"d8bk6v"}]]};rN.node;const kie=at(rN),Eie={"chevron-right":Vse,"chevron-down":Fse,pipette:cie,x:kie,copy:Use,menu:tie,dot:Bse,monitor:rie,sun:xie,moon:sie,"rectangle-horizontal":fie,circle:Hse,"square-library":_ie,clock:zse,star:wie,settings:gie,plus:die,"arrow-left":Ose,"arrow-right":Lse,"arrow-up":Nse,search:mie,loader:Qse,users:Sie,lock:Jse,mail:eie,bell:Dse,shield:vie,palette:oie,lightbulb:Yse,rocket:hie,heart:Wse,paintbrush:iie,brain:jse,globe:Zse,user:bie,image:Gse,link:Xse,check:$se,"rotate-ccw":pie,play:uie,pause:aie,home:qse,"message-circle":nie,inbox:Kse,pencil:lie,"skip-forward":yie},oP={lucide:Eie},sN=m.createContext(null);function Cie(t){const e=m.useContext(sN);return e?oP[e.iconLibrary][t]:oP.lucide[t]}function Pie({children:t,defaultLibrary:e="lucide"}){const[n,r]=m.useState(e),s=m.useCallback(i=>{r(i)},[]);return b.jsx(sN.Provider,{value:{iconLibrary:n,setIconLibrary:s},children:t})}const iN=m.createContext(null);function E4(){return m.useContext(iN)}const oN=m.createContext(null);function aN(){const t=m.useContext(oN);if(!t)throw new Error("AccordionTrigger/AccordionContent must be used within an AccordionItem");return t}const Tie=m.forwardRef((t,e)=>{const{children:n,type:r="single",className:s,...i}=t,o=m.useRef(null),l=m.useRef(new Map),[u,d]=m.useState(new Map),{activeIndex:f,setActiveIndex:p,itemRects:g,sessionRef:v,handlers:w,registerItem:_,measureItems:x}=gO(o),S=m.useCallback((ue,ae)=>{ae?l.current.set(ue,ae):l.current.delete(ue)},[]),k=m.useCallback(()=>{if(!o.current)return;const ue=new Map;l.current.forEach((ae,Oe)=>{ue.set(Oe,{top:ae.offsetTop,left:ae.offsetLeft,width:ae.offsetWidth,height:ae.offsetHeight})}),d(ue)},[]),[C,T]=m.useState(()=>r==="single"?t.defaultValue??"":""),[A,I]=m.useState(()=>r==="multiple"?t.defaultValue??[]:[]),M=t.onValueChange,R=t.onValueChange,O=t.value,N=new Set(r==="multiple"?t.value??A:(()=>{const ue=t.value??C;return ue?[ue]:[]})()),D=m.useCallback(ue=>{const ae=t;ae.onValueChange?ae.onValueChange(ue):T(ue)},[M]),$=m.useCallback(ue=>{const ae=t;ae.onValueChange?ae.onValueChange(ue):I(ue)},[R]),Y=m.useCallback(ue=>{if(r==="multiple"){const ae=t.value??A;$(ae.filter(Oe=>Oe!==ue))}else D("")},[r,D,$,A,O]);m.useEffect(()=>{x(),k()},[x,k,n]);const B=[...N].join(",");m.useEffect(()=>{x(),k()},[x,k,B]);const[G,V]=m.useState(null),K=f!==null?g[f]:null,U=G!==null?g[G]:null,ee=f!==null&&!u.has(f),Z=Qh(),{value:j,defaultValue:Q,onValueChange:oe,collapsible:re,type:ie,...fe}=i,_e=r==="multiple"?{type:"multiple",value:t.value??A,onValueChange:$}:{type:"single",collapsible:t.collapsible??!0,value:t.value??C,onValueChange:D};return b.jsx(iN.Provider,{value:{registerItem:_,registerFullItem:S,activeIndex:f,grouped:!0,remeasure:()=>{x(),k()},openValues:N,openItemRects:u,toggleValue:Y},children:b.jsx(dL,{..._e,asChild:!0,children:b.jsxs("div",{ref:ue=>{o.current=ue,typeof e=="function"?e(ue):e&&(e.current=ue)},onMouseEnter:w.onMouseEnter,onMouseMove:ue=>{const ae=o.current;if(ae){const Oe=ae.getBoundingClientRect(),Be=ae.offsetHeight,Ee=Oe.height,pt=Be>0?Ee/Be:1,Ot=(ue.clientY-Oe.top)/pt+ae.scrollTop;for(const[Qt,bt]of u){const _t=g[Qt];if(!_t)continue;const qe=_t.top+_t.height,Ke=bt.top+bt.height;if(Ot>=qe&&Ot<=Ke){p(null);return}}}w.onMouseMove(ue)},onMouseLeave:w.onMouseLeave,onFocus:ue=>{var Oe;const ae=(Oe=ue.target.closest("[data-proximity-index]"))==null?void 0:Oe.getAttribute("data-proximity-index");if(ae!=null){const Be=Number(ae);p(Be),V(ue.target.matches(":focus-visible")?Be:null)}},onBlur:ue=>{var ae;(ae=o.current)!=null&&ae.contains(ue.relatedTarget)||(V(null),p(null))},className:Ut("relative flex flex-col gap-0.5 w-72 max-w-full",s),...fe,children:[b.jsx(ks,{children:[...u.entries()].map(([ue,ae])=>b.jsx($o.div,{className:`absolute ${Z.bg} bg-accent/20 dark:bg-accent/12 pointer-events-none`,initial:!1,animate:{top:ae.top,left:ae.left,width:ae.width,height:ae.height,opacity:ee?.7:1},exit:{opacity:0,transition:{duration:.12}},transition:{top:{duration:0},left:{duration:0},width:{duration:0},height:{duration:0},opacity:{duration:.08}}},`expanded-${ue}`))}),b.jsx(ks,{children:K&&b.jsx($o.div,{className:`absolute ${Z.bg} bg-hover pointer-events-none`,initial:{opacity:0,top:K.top,left:K.left,width:K.width,height:K.height},animate:{opacity:1,top:K.top,left:K.left,width:K.width,height:K.height},exit:{opacity:0,transition:{duration:.06}},transition:{...Ch.fast,opacity:{duration:.08}}},v.current)}),b.jsx(ks,{children:U&&b.jsx($o.div,{className:`absolute ${Z.focusRing} pointer-events-none z-20 border border-[#6B97FF]`,initial:!1,animate:{left:U.left-2,top:U.top-2,width:U.width+4,height:U.height+4},exit:{opacity:0,transition:{duration:.06}},transition:{...Ch.fast,opacity:{duration:.08}}})}),n]})})})});Tie.displayName="AccordionGroup";const lN=m.forwardRef(({children:t,type:e="single",collapsible:n=!0,defaultValue:r,value:s,onValueChange:i,className:o,...l},u)=>{const[d,f]=m.useState(()=>e==="single"?r??"":""),[p,g]=m.useState(()=>e==="multiple"?r??[]:[]),v=new Set(e==="multiple"?s??p:(()=>{const k=s??d;return k?[k]:[]})()),w=m.useCallback(k=>{i?i(k):f(k)},[i]),_=m.useCallback(k=>{i?i(k):g(k)},[i]),x=m.useCallback(k=>{e==="multiple"?_((s??p).filter(T=>T!==k)):w("")},[e,s,p,w,_]),S=e==="multiple"?{type:"multiple",value:s??p,defaultValue:r,onValueChange:_}:{type:"single",collapsible:n,value:s??d,defaultValue:r,onValueChange:w};return b.jsx(dL,{...S,asChild:!0,children:b.jsx("div",{ref:u,className:Ut("w-72 max-w-full flex flex-col gap-0.5",o),...l,children:b.jsx(cN.Provider,{value:v,children:b.jsx(uN.Provider,{value:x,children:t})})})})});lN.displayName="Accordion";const cN=m.createContext(new Set),uN=m.createContext(()=>{}),dN=m.forwardRef(({value:t,index:e,disabled:n,children:r,className:s,...i},o)=>{const l=m.useRef(null),u=E4(),d=m.useContext(cN),f=m.useContext(uN),p=Qh(),g=u!=null&&u.grouped?u.openValues.has(t):d.has(t),v=m.useRef(null),w=m.useCallback(()=>{u!=null&&u.grouped?u.toggleValue(t):f(t)},[u,f,t]);return m.useEffect(()=>{if(u!=null&&u.grouped&&e!==void 0)return u.registerItem(e,v.current),()=>u.registerItem(e,null)},[e,u]),m.useEffect(()=>{if(u!=null&&u.grouped&&e!==void 0)return g?u.registerFullItem(e,l.current):u.registerFullItem(e,null),()=>u.registerFullItem(e,null)},[e,u,g]),b.jsx(oN.Provider,{value:{index:e,value:t,isOpen:g,onToggle:w,triggerRef:v},children:b.jsxs(_se,{ref:_=>{l.current=_,typeof o=="function"?o(_):o&&(o.current=_)},value:t,disabled:n,"data-proximity-index":e,className:Ut(!(u!=null&&u.grouped)&&"relative",s),...i,children:[!(u!=null&&u.grouped)&&b.jsx(ks,{children:g&&b.jsx($o.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]})})});dN.displayName="AccordionItem";const fN=m.forwardRef(({children:t,className:e,...n},r)=>{const s=Cie("chevron-right"),i=E4(),{index:o,isOpen:l,triggerRef:u}=aN(),d=Qh(),[f,p]=m.useState(!1),g=i!=null&&i.grouped?i.activeIndex===o:f,v=b.jsx(wse,{asChild:!0,children:b.jsx("div",{children:b.jsxs(xse,{ref:r,className:Ut(`relative z-10 flex items-center gap-2.5 ${d.item} px-3 py-2 w-full cursor-pointer outline-none select-none`,!(i!=null&&i.grouped)&&"focus-visible:ring-1 focus-visible:ring-[#6B97FF] focus-visible:ring-offset-0",e),...n,children:[b.jsxs("span",{className:"inline-grid text-[13px] flex-1 text-left",children:[b.jsx("span",{className:"col-start-1 row-start-1 invisible",style:{fontVariationSettings:Kf.semibold},"aria-hidden":"true",children:t}),b.jsx("span",{className:Ut("col-start-1 row-start-1 transition-[color,font-variation-settings] duration-80",l||g?"text-foreground":"text-muted-foreground"),style:{fontVariationSettings:l?Kf.semibold:Kf.normal},children:t})]}),b.jsx($o.span,{className:"shrink-0 inline-flex items-center justify-center",animate:{rotate:l?90:0},transition:Ch.fast,children:b.jsx(s,{size:16,strokeWidth:l||g?2:1.5,className:Ut("transition-[color,stroke-width] duration-80",l||g?"text-foreground":"text-muted-foreground")})})]})})});return i!=null&&i.grouped?b.jsx("div",{ref:u,children:v}):b.jsxs("div",{className:"relative",onMouseEnter:()=>p(!0),onMouseLeave:()=>p(!1),children:[b.jsx(ks,{children:f&&b.jsx($o.div,{className:`absolute inset-0 ${d.bg} bg-hover pointer-events-none`,initial:{opacity:0},animate:{opacity:1},exit:{opacity:0,transition:{duration:.06}},transition:{duration:.08}})}),v]})});fN.displayName="AccordionTrigger";const hN=m.forwardRef(({children:t,className:e,...n},r)=>{const s=E4(),{isOpen:i}=aN();return b.jsx(ks,{initial:!1,children:i&&b.jsx(bse,{forceMount:!0,asChild:!0,...n,children:b.jsx($o.div,{ref:r,className:Ut("overflow-hidden",e),initial:{height:0},animate:{height:"auto"},exit:{height:0},transition:{...Ch.moderate,bounce:0},onUpdate:()=>{s==null||s.remeasure()},onAnimationComplete:()=>{s==null||s.remeasure()},children:b.jsx("div",{className:"px-3 pb-3 pt-1 text-[13px] text-muted-foreground",children:t})})})})});hN.displayName="AccordionContent";const xm=({children:t,defaultValue:e=[],className:n=""})=>b.jsx(lN,{type:"multiple",defaultValue:e,className:Ut("w-full",n),children:t}),Aie=({value:t,title:e,description:n,dataCy:r,icon:s,children:i,className:o=""})=>{const l=o.includes("first-item");return b.jsxs(dN,{value:t,className:Ut("w-full",!l&&"border-t border-main-border"),children:[b.jsxs(fN,{"data-cy":r,children:[s?b.jsx("span",{className:"mr-1 inline-flex items-center",children:s}):null,e]}),b.jsxs(hN,{children:[n?b.jsx("p",{className:"pb-2 text-sm text-content-subtle",children:n}):null,i]})]})};xm.Item=Aie;const Rie=({message:t,isLoading:e=!0})=>b.jsxs("div",{className:"flex items-center gap-2 text-sm text-content",children:[e?b.jsx(Zg,{className:"h-4 w-4 shrink-0 animate-spin text-primary",weight:"bold"}):null,b.jsx("span",{className:"whitespace-pre-wrap font-sans",children:t})]}),Mie=()=>{const t=m.useRef(Date.now()),[e,n]=m.useState(0);return m.useEffect(()=>{const r=()=>n(Math.max(0,Math.floor((Date.now()-t.current)/1e3)));r();const s=setInterval(r,1e3);return()=>clearInterval(s)},[]),e},Iie=t=>{const e=Math.floor(t/60),n=t%60;return`${e}:${n.toString().padStart(2,"0")}`},aP="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",lP="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",Oie="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",bm=["Applying","Thinking","Planning","Crafting"],Lie=bm.reduce((t,e)=>t.length>=e.length?t:e),Nie=20,Die="Still working — runs can take a few minutes.",jie=({hint:t,showElapsed:e=!0})=>{const[n,r]=m.useState(0),s=Mie();m.useEffect(()=>{const o=setInterval(()=>{r(l=>(l+1)%bm.length)},4e3);return()=>clearInterval(o)},[]);const i=t??(e&&s>=Nie?Die:null);return b.jsxs("div",{role:"status",className:"flex items-center gap-2 px-3 py-1","data-cy":"thinking-indicator",children:[b.jsx(wi.svg,{"aria-hidden":!0,width:20,height:20,viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:1.5,strokeLinecap:"round",strokeLinejoin:"round",className:"shrink-0 text-muted-foreground",children:b.jsx(wi.path,{animate:{d:[aP,lP,Oie,lP,aP]},transition:{d:{duration:6,ease:"easeInOut",repeat:1/0,times:[0,.25,.5,.75,1]}}})}),b.jsxs("span",{className:"inline-grid overflow-hidden text-sm font-medium",style:{fontVariationSettings:Kf.medium},children:[b.jsx("span",{className:"shimmer-text invisible col-start-1 row-start-1","aria-hidden":"true",children:Lie}),b.jsx(ks,{mode:"popLayout",initial:!1,children:b.jsx(wi.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:bm[n]},bm[n])})]}),e?b.jsx("span",{className:"text-xs tabular-nums text-content-subtle","data-cy":"thinking-elapsed",children:Iie(s)}):null,i?b.jsx("span",{className:"text-xs text-content-subtle",children:i}):null]})};var $ie=Object.defineProperty,Fie=(t,e)=>$ie(t,"name",{value:e,configurable:!0});function C4(t,[e,n]){return Math.min(n,Math.max(e,t))}Fie(C4,"clamp");var Vie=Object.defineProperty,Hie=(t,e)=>Vie(t,"name",{value:e,configurable:!0});function pN(t){const e=m.useRef({value:t,previous:t});return m.useMemo(()=>(e.current.value!==t&&(e.current.previous=e.current.value,e.current.value=t),e.current.previous),[t])}Hie(pN,"usePrevious");var zie=Object.defineProperty,jt=(t,e)=>zie(t,"name",{value:e,configurable:!0}),mN=["PageUp","PageDown"],gN=["ArrowUp","ArrowDown","ArrowLeft","ArrowRight"],vN={"from-left":["Home","PageDown","ArrowDown","ArrowLeft"],"from-right":["Home","PageDown","ArrowDown","ArrowRight"],"from-bottom":["Home","PageDown","ArrowDown","ArrowLeft"],"from-top":["Home","PageDown","ArrowUp","ArrowLeft"]},ip="Slider",[sx,Uie,Bie]=g4(ip),[P4,Doe]=to(ip,[Bie]),[Zie,op]=P4(ip),Wie=m.forwardRef(jt(function(e,n){const{name:r,min:s=0,max:i=100,step:o=1,orientation:l="horizontal",disabled:u=!1,minStepsBetweenThumbs:d=0,defaultValue:f=[s],value:p,onValueChange:g=jt(()=>{},"onValueChange"),onValueCommit:v=jt(()=>{},"onValueCommit"),inverted:w=!1,form:_,...x}=e,S=m.useRef(new Set),k=m.useRef(0),C=m.useRef(!1),A=l==="horizontal"?qie:Gie,[I,M]=m.useState(null),R=tn(n,M),[O=[],N]=sl({prop:p,defaultProp:f,onChange:jt(K=>{var ee;(ee=[...S.current][k.current])==null||ee.focus({preventScroll:!0,focusVisible:C.current}),C.current=!1,g(K)},"onChange")}),D=m.useRef(O),$=m.useRef(O);m.useEffect(()=>{const K=_?I==null?void 0:I.ownerDocument.getElementById(_):I==null?void 0:I.closest("form");if(K instanceof HTMLFormElement){const U=jt(()=>N($.current),"reset");return K.addEventListener("reset",U),()=>K.removeEventListener("reset",U)}},[I,_,N]);function Y(K){const U=EN(O,K);V(K,U)}jt(Y,"handleSlideStart");function B(K){V(K,k.current)}jt(B,"handleSlideMove");function G(){String(O)!==String(D.current)&&v(O)}jt(G,"handleSlideEnd");function V(K,U,{commit:ee}={commit:!1}){const Z=A4(o),j=eh(Math.round((K-s)/o)*o+s,Z),Q=C4(j,[s,i]);N((oe=[])=>{const re=SN(oe,Q,U);if(TN(re,d*o)){k.current=re.indexOf(Q);const ie=String(re)!==String(oe);return ie&&ee&&v(re),ie?re:oe}else return oe})}return jt(V,"updateValues"),b.jsx(Zie,{scope:e.__scopeSlider,name:r,disabled:u,min:s,max:i,valueIndexToChangeRef:k,thumbs:S.current,values:O,orientation:l,form:_,children:b.jsx(sx.Provider,{scope:e.__scopeSlider,children:b.jsx(sx.Slot,{scope:e.__scopeSlider,children:b.jsx(A,{"aria-disabled":u,"data-disabled":u?"":void 0,...x,ref:R,onPointerDown:Kt(x.onPointerDown,()=>{u||(D.current=O,C.current=!1)}),min:s,max:i,inverted:w,onSlideStart:u?void 0:Y,onSlideMove:u?void 0:B,onSlideEnd:u?void 0:G,onHomeKeyDown:()=>{u||(C.current=!0,V(s,0,{commit:!0}))},onEndKeyDown:()=>{u||(C.current=!0,V(i,O.length-1,{commit:!0}))},onStepKeyDown:({event:K,direction:U})=>{if(!u){C.current=!0;const j=mN.includes(K.key)||K.shiftKey&&gN.includes(K.key)?10:1,Q=k.current,oe=O[Q],re=AN(oe,{min:s,step:o,direction:U,multiplier:j});V(re,Q,{commit:!0})}}})})})})},"Slider")),[yN,_N]=P4(ip,{startEdge:"left",endEdge:"right",size:"width",direction:1}),qie=m.forwardRef(jt(function(e,n){const{min:r,max:s,dir:i,inverted:o,onSlideStart:l,onSlideMove:u,onSlideEnd:d,onStepKeyDown:f,...p}=e,[g,v]=m.useState(null),w=tn(n,v),_=m.useRef(void 0),x=w4(i),S=x==="ltr",k=S&&!o||!S&&o;function C(T){const A=_.current||g.getBoundingClientRect(),I=[0,A.width],R=vv(I,k?[r,s]:[s,r]);return _.current=A,R(T-A.left)}return jt(C,"getValueFromPointer"),b.jsx(yN,{scope:e.__scopeSlider,startEdge:k?"left":"right",endEdge:k?"right":"left",direction:k?1:-1,size:"width",children:b.jsx(wN,{dir:x,"data-orientation":"horizontal",...p,ref:w,style:{...p.style,"--radix-slider-thumb-transform":"translateX(-50%)"},onSlideStart:T=>{const A=C(T.clientX);l==null||l(A)},onSlideMove:T=>{const A=C(T.clientX);u==null||u(A)},onSlideEnd:()=>{_.current=void 0,d==null||d()},onStepKeyDown:T=>{const I=vN[k?"from-left":"from-right"].includes(T.key);f==null||f({event:T,direction:I?-1:1})}})})},"SliderHorizontal")),Gie=m.forwardRef(jt(function(e,n){const{min:r,max:s,inverted:i,onSlideStart:o,onSlideMove:l,onSlideEnd:u,onStepKeyDown:d,...f}=e,p=m.useRef(null),g=tn(n,p),v=m.useRef(void 0),w=!i;function _(x){const S=v.current||p.current.getBoundingClientRect(),k=[0,S.height],T=vv(k,w?[s,r]:[r,s]);return v.current=S,T(x-S.top)}return jt(_,"getValueFromPointer"),b.jsx(yN,{scope:e.__scopeSlider,startEdge:w?"bottom":"top",endEdge:w?"top":"bottom",size:"height",direction:w?1:-1,children:b.jsx(wN,{"data-orientation":"vertical",...f,ref:g,style:{...f.style,"--radix-slider-thumb-transform":"translateY(50%)"},onSlideStart:x=>{const S=_(x.clientY);o==null||o(S)},onSlideMove:x=>{const S=_(x.clientY);l==null||l(S)},onSlideEnd:()=>{v.current=void 0,u==null||u()},onStepKeyDown:x=>{const k=vN[w?"from-bottom":"from-top"].includes(x.key);d==null||d({event:x,direction:k?-1:1})}})})},"SliderVertical")),wN=m.forwardRef(jt(function(e,n){const{__scopeSlider:r,onSlideStart:s,onSlideMove:i,onSlideEnd:o,onHomeKeyDown:l,onEndKeyDown:u,onStepKeyDown:d,...f}=e,p=op(ip,r);return b.jsx(En.span,{...f,ref:n,onKeyDown:Kt(e.onKeyDown,g=>{g.key==="Home"?(l(g),g.preventDefault()):g.key==="End"?(u(g),g.preventDefault()):mN.concat(gN).includes(g.key)&&(d(g),g.preventDefault())}),onPointerDown:Kt(e.onPointerDown,g=>{const v=g.target;v.setPointerCapture(g.pointerId),g.preventDefault(),p.thumbs.has(v)?v.focus({preventScroll:!0,focusVisible:!1}):s(g)}),onPointerMove:Kt(e.onPointerMove,g=>{g.target.hasPointerCapture(g.pointerId)&&i(g)}),onPointerUp:Kt(e.onPointerUp,g=>{const v=g.target;v.hasPointerCapture(g.pointerId)&&(v.releasePointerCapture(g.pointerId),o(g))})})},"SliderImpl")),Kie="SliderTrack",Yie=m.forwardRef(jt(function(e,n){const{__scopeSlider:r,...s}=e,i=op(Kie,r);return b.jsx(En.span,{"data-disabled":i.disabled?"":void 0,"data-orientation":i.orientation,...s,ref:n})},"SliderTrack")),cP="SliderRange",Xie=m.forwardRef(jt(function(e,n){const{__scopeSlider:r,...s}=e,i=op(cP,r),o=_N(cP,r),l=m.useRef(null),u=tn(n,l),d=i.values.length,f=i.values.map(v=>T4(v,i.min,i.max)),p=d>1?Math.min(...f):0,g=100-Math.max(...f);return b.jsx(En.span,{"data-orientation":i.orientation,"data-disabled":i.disabled?"":void 0,...s,ref:u,style:{...e.style,[o.startEdge]:p+"%",[o.endEdge]:g+"%"}})},"SliderRange")),Qie="SliderThumb",[Jie,xN]=P4(Qie),eoe="SliderThumbProvider";function bN(t){const{__scopeSlider:e,name:n,children:r,internal_do_not_use_render:s}=t,i=op(eoe,e),o=Uie(e),[l,u]=m.useState(null),d=m.useMemo(()=>l?o().findIndex(x=>x.ref.current===l):-1,[o,l]),f=Ab(l),p=l?!!i.form||!!l.closest("form"):!0,g=i.values[d],v=n??(i.name?i.name+(i.values.length>1?"[]":""):void 0),w=g===void 0?0:T4(g,i.min,i.max);m.useEffect(()=>{if(l)return i.thumbs.add(l),()=>{i.thumbs.delete(l)}},[l,i.thumbs]);const _={value:g,name:v,form:i.form,isFormControl:p,index:d,thumb:l,onThumbChange:u,percent:w,size:f};return b.jsx(Jie,{scope:e,..._,children:RN(s)?s(_):r})}jt(bN,"SliderThumbProvider");var $_="SliderThumbTrigger",toe=m.forwardRef(jt(function(e,n){const{__scopeSlider:r,...s}=e,i=op($_,r),o=_N($_,r),{index:l,value:u,percent:d,size:f,onThumbChange:p}=xN($_,r),g=tn(n,p),v=kN(l,i.values.length),w=f==null?void 0:f[o.size],_=w?CN(w,d,o.direction):0;return b.jsx("span",{style:{transform:"var(--radix-slider-thumb-transform)",position:"absolute",[o.startEdge]:`calc(${d}% + ${_}px)`},children:b.jsx(sx.ItemSlot,{scope:r,children:b.jsx(En.span,{role:"slider","aria-label":e["aria-label"]||v,"aria-valuemin":i.min,"aria-valuenow":u,"aria-valuemax":i.max,"aria-orientation":i.orientation,"data-orientation":i.orientation,"data-disabled":i.disabled?"":void 0,tabIndex:i.disabled?void 0:0,...s,ref:g,style:u===void 0?{display:"none"}:e.style,onFocus:Kt(e.onFocus,()=>{i.valueIndexToChangeRef.current=l})})})})},"SliderThumbTrigger")),noe=m.forwardRef(jt(function(e,n){const{__scopeSlider:r,name:s,...i}=e;return b.jsx(bN,{__scopeSlider:r,name:s,internal_do_not_use_render:({index:o,isFormControl:l})=>b.jsxs(b.Fragment,{children:[b.jsx(toe,{...i,ref:n,__scopeSlider:r}),l?b.jsx(soe,{__scopeSlider:r},o):null]})})},"SliderThumb")),roe="SliderBubbleInput",soe=m.forwardRef(jt(function({__scopeSlider:e,...n},r){const{value:s,name:i,form:o}=xN(roe,e),l=m.useRef(null),u=tn(l,r),d=pN(s);return m.useEffect(()=>{const f=l.current;if(!f)return;const p=window.HTMLInputElement.prototype,v=Object.getOwnPropertyDescriptor(p,"value").set;if(d!==s&&v){const w=new Event("input",{bubbles:!0});v.call(f,s),f.dispatchEvent(w)}},[d,s]),b.jsx(En.input,{style:{display:"none"},name:i,form:o,...n,ref:u,defaultValue:s})},"SliderBubbleInput"));function SN(t=[],e,n){const r=[...t];return r[n]=e,r.sort((s,i)=>s-i)}jt(SN,"getNextSortedValues");function T4(t,e,n){const i=100/(n-e)*(t-e);return C4(i,[0,100])}jt(T4,"convertValueToPercentage");function kN(t,e){return e>2?`Value ${t+1} of ${e}`:e===2?["Minimum","Maximum"][t]:void 0}jt(kN,"getLabel");function EN(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)}jt(EN,"getClosestValueIndex");function CN(t,e,n){const r=t/2,i=vv([0,50],[0,r]);return(r-i(e)*n)*n}jt(CN,"getThumbInBoundsOffset");function PN(t){return t.slice(0,-1).map((e,n)=>t[n+1]-e)}jt(PN,"getStepsBetweenValues");function TN(t,e){if(e>0){const n=PN(t);return Math.min(...n)>=e}return!0}jt(TN,"hasMinStepsBetweenValues");function vv(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])}}jt(vv,"linearScale");function A4(t){if(!Number.isFinite(t))return 0;const e=t.toString();if(e.includes("e")){const[r,s]=e.split("e"),i=r.split(".")[1]||"",o=Number(s);return Math.max(0,i.length-o)}const n=e.split(".")[1];return n?n.length:0}jt(A4,"getDecimalCount");function eh(t,e){const n=Math.pow(10,e);return Math.round(t*n)/n}jt(eh,"roundValue");function AN(t,{min:e,step:n,direction:r,multiplier:s}){const i=A4(n),o=(t-e)/n,l=Math.round(o),u=eh(l*n+e,i)===eh(t,i);let d;return u?d=l+s*r:r>0?d=Math.ceil(o):d=Math.floor(o),eh(d*n+e,i)}jt(AN,"getNextStepValue");function RN(t){return typeof t=="function"}jt(RN,"isFunction");const ix=m.forwardRef(({className:t,...e},n)=>b.jsxs(Wie,{ref:n,className:Ut("relative flex w-full touch-none select-none items-center","data-[disabled]:opacity-50",t),...e,children:[b.jsx(Yie,{className:"relative h-1 w-full grow overflow-hidden rounded-full bg-input",children:b.jsx(Xie,{className:"absolute h-full bg-primary"})}),b.jsx(noe,{className:Ut("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")})]}));ix.displayName="Slider";const ioe=[{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"}],ooe=[{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"}],aoe=[{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"}],W0=[{name:"Accordion",path:"components/Accordion.tsx",status:"showcased",note:"Reusable primitive shown with local item composition."},{name:"AgentVariantsPanel",path:"components/AgentVariantsPanel.tsx",status:"feature-only",note:"Requires live variant session state and editor atoms."},{name:"AuthProgressScreen",path:"components/AuthProgressScreen.tsx",status:"feature-only",note:"Auth flow surface; represented through progress treatment."},{name:"AuthScreenView",path:"components/AuthScreenView.tsx",status:"feature-only",note:"Auth flow surface that depends on sign-in actions."},{name:"Button",path:"components/Button.tsx",status:"showcased",note:"Reusable tooltip-wrapped button shown in multiple states."},{name:"CommentCarouselLayer",path:"components/CommentCarouselLayer.tsx",status:"feature-only",note:"Preview overlay layer tied to iframe geometry."},{name:"CommentMarker",path:"components/CommentMarker.tsx",status:"feature-only",note:"Preview overlay marker tied to comment positions."},{name:"CommentPopover",path:"components/CommentPopover.tsx",status:"feature-only",note:"Comment workflow popover tied to editor state."},{name:"CommentReferenceChip",path:"components/CommentReferenceChip.tsx",status:"feature-only",note:"Comment workflow chip tied to selected references."},{name:"CommentReferencePicker",path:"components/CommentReferencePicker.tsx",status:"feature-only",note:"Comment workflow picker tied to preview elements."},{name:"ElementInspector",path:"components/ElementInspector.tsx",status:"feature-only",note:"Primary editor surface with many app-level dependencies."},{name:"GitHome",path:"components/GitHome.tsx",status:"feature-only",note:"Git dashboard tied to repository state."},{name:"IframePreview",path:"components/IframePreview.tsx",status:"unsuitable",note:"Needs live iframe target and cross-window integration."},{name:"PreviewFrame",path:"components/PreviewFrame.tsx",status:"unsuitable",note:"Requires proxied app URL and iframe lifecycle."},{name:"PreviewSurface",path:"components/PreviewSurface.tsx",status:"unsuitable",note:"Requires preview iframe and overlay orchestration."},{name:"ProfileAvatar",path:"components/ProfileAvatar.tsx",status:"feature-only",note:"Account chrome tied to user identity data."},{name:"Progress",path:"components/Progress.tsx",status:"showcased",note:"Reusable inline loading/status primitive."},{name:"SecondaryVariantIframe",path:"components/SecondaryVariantIframe.tsx",status:"unsuitable",note:"Requires variant preview iframe lifecycle."},{name:"SparkleLoader",path:"components/SparkleLoader.tsx",status:"showcased",note:"Reusable loading animation shown in feedback states."},{name:"SplitButton",path:"components/SplitButton.tsx",status:"showcased",note:"Reusable compound action button shown with dropdown."},{name:"StatusSurface",path:"components/StatusSurface.tsx",status:"showcased",note:"Unified full-surface primitive: LoadingSurface / EmptyState / ErrorState."},{name:"SupportTicketModal",path:"components/SupportTicketModal.tsx",status:"feature-only",note:"Support workflow modal tied to form submission."},{name:"ThinkingIndicator",path:"components/ThinkingIndicator.tsx",status:"showcased",note:"Reusable thinking/loading indicator shown in feedback states."},{name:"Tooltip",path:"components/Tooltip.tsx",status:"showcased",note:"Reusable tooltip API shown with hover target."},{name:"VariantDragGhost",path:"components/VariantDragGhost.tsx",status:"feature-only",note:"Drag visual tied to variant split interactions."},{name:"VariantSplitDropZones",path:"components/VariantSplitDropZones.tsx",status:"feature-only",note:"Drop-zone visual tied to variant split interactions."},{name:"ui/accordion",path:"components/ui/accordion.tsx",status:"showcased",note:"Radix accordion primitive backing the local Accordion showcase."},{name:"ui/slider",path:"components/ui/slider.tsx",status:"showcased",note:"Radix slider primitive shown in enabled and disabled states."},{name:"ui/tooltip",path:"components/ui/tooltip.tsx",status:"showcased",note:"Radix tooltip primitive shown with forced-open preview."}],loe=()=>{window.location.hash=""},xo=({title:t,eyebrow:e,description:n,children:r})=>b.jsxs("section",{className:"border-border bg-card shadow-surface-3 rounded-2xl border p-5",children:[b.jsxs("div",{className:"mb-5 max-w-2xl",children:[b.jsx("p",{className:"text-primary text-xs font-semibold tracking-[0.18em] uppercase",children:e}),b.jsx("h2",{className:"text-foreground mt-2 text-xl font-semibold",children:t}),b.jsx("p",{className:"text-muted-foreground mt-2 text-sm leading-6",children:n})]}),r]}),uP=({swatches:t})=>b.jsx("div",{className:"grid gap-3 sm:grid-cols-2 lg:grid-cols-3",children:t.map(e=>b.jsxs("div",{className:"border-border bg-surface-2 rounded-xl border p-3",children:[b.jsx("div",{className:`h-16 rounded-lg ${e.className}`}),b.jsxs("div",{className:"mt-3 flex items-center justify-between gap-3",children:[b.jsx("span",{className:"text-foreground text-sm font-medium",children:e.name}),b.jsx("code",{className:"bg-muted text-muted-foreground rounded px-2 py-1 text-xs",children:e.utility})]})]},e.name))}),coe=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",uoe=()=>{const t=W0.filter(n=>n.status==="showcased").length,e=W0.filter(n=>n.status==="cataloged").length;return b.jsx("main",{className:"bg-main font-main text-content h-screen overflow-y-auto",children:b.jsxs("div",{className:"mx-auto flex w-full max-w-6xl flex-col gap-6 px-6 py-6 lg:px-8",children:[b.jsxs("header",{className:"border-border bg-surface-2 shadow-surface-4 rounded-3xl border p-6",children:[b.jsxs("button",{type:"button",onClick:loe,className:"text-content-subtle hover:text-content mb-6 inline-flex items-center gap-2 text-sm transition-colors",children:[b.jsx(Kq,{className:"h-4 w-4",weight:"bold"}),"Back to editor"]}),b.jsxs("div",{className:"flex flex-col gap-5 lg:flex-row lg:items-end lg:justify-between",children:[b.jsxs("div",{className:"max-w-3xl",children:[b.jsx("p",{className:"text-primary text-xs font-semibold tracking-[0.22em] uppercase",children:"Local component gallery"}),b.jsx("h1",{className:"text-foreground mt-3 text-4xl font-semibold tracking-tight",children:"Rivet design system"}),b.jsx("p",{className:"text-muted-foreground mt-3 text-base leading-7",children:"A Storybook-like route for checking the current UI primitives, tokens, and interaction states inside the Vite app."})]}),b.jsx("div",{className:"border-border bg-surface-3 rounded-2xl border p-4",children:b.jsxs("div",{className:"text-content-muted flex items-center gap-3 text-sm",children:[b.jsx(kM,{className:"text-primary h-5 w-5",weight:"bold"}),"Open with ",b.jsx("code",{className:"text-content",children:"#/design-system"})]})})]})]}),b.jsx(xo,{eyebrow:"Controls",title:"Button, split button, and tooltip",description:"Rivet's shared Button exposes variants and sizes backed by Fluid Functionalism, alongside the split button and tooltip controls.",children:b.jsxs("div",{className:"grid gap-4 lg:grid-cols-[1fr_1fr]",children:[b.jsxs("div",{className:"border-border bg-surface-2 rounded-xl border p-4",children:[b.jsx("p",{className:"text-foreground mb-3 text-sm font-medium",children:"Rivet Button"}),b.jsxs("div",{className:"flex flex-wrap items-center gap-3",children:[b.jsx(Gi,{title:"Primary action",shortcut:"D",variant:"primary",children:"Design action"}),b.jsx(Gi,{title:"Secondary action",variant:"secondary",children:"Secondary"}),b.jsx(Gi,{title:"Disabled action",disabled:!0,variant:"tertiary",children:"Disabled"}),b.jsx(OO,{primaryLabel:"Ship",primaryIcon:r_,primaryAction:()=>{},dropdownItems:[{label:"Create PR",onClick:()=>{}},{label:"Copy branch",onClick:()=>{}}]})]})]}),b.jsxs("div",{className:"border-border bg-surface-2 rounded-xl border p-4",children:[b.jsx("p",{className:"text-foreground mb-3 text-sm font-medium",children:"Tooltip states"}),b.jsxs("div",{className:"flex flex-wrap items-center gap-4",children:[b.jsx(wc,{label:"Rivet tooltip API",side:"bottom",children:b.jsx("button",{className:"border-border bg-surface-4 text-content rounded-lg border px-4 py-2 text-sm",children:"Hover target"})}),b.jsx(Lb,{content:"Forced open preview",forceOpen:!0,side:"right",children:b.jsx("button",{className:"bg-selected text-content rounded-lg px-4 py-2 text-sm",children:"UI tooltip"})})]})]})]})}),b.jsx(xo,{eyebrow:"Tokens",title:"Surface ladder",description:"Surface tokens move from the base app background toward raised panels without leaving the dark Rivet palette.",children:b.jsx(uP,{swatches:ioe})}),b.jsx(xo,{eyebrow:"Tokens",title:"Color roles",description:"Named roles should communicate purpose: brand, selection, neutral accent, and outcome colors.",children:b.jsx(uP,{swatches:ooe})}),b.jsx(xo,{eyebrow:"Type",title:"Typography",description:"Satoshi remains the default UI voice with clear hierarchy and muted support text.",children:b.jsxs("div",{className:"grid gap-4 lg:grid-cols-3",children:[b.jsxs("div",{className:"border-border bg-surface-2 rounded-xl border p-4",children:[b.jsx("p",{className:"text-primary text-xs tracking-[0.18em] uppercase",children:"Display"}),b.jsx("p",{className:"text-foreground mt-2 text-3xl font-semibold tracking-tight",children:"Visual edits, quickly"})]}),b.jsxs("div",{className:"border-border bg-surface-2 rounded-xl border p-4",children:[b.jsx("p",{className:"text-foreground text-sm font-semibold",children:"Panel heading"}),b.jsx("p",{className:"text-muted-foreground mt-2 text-sm leading-6",children:"Body copy uses compact line height and muted contrast for dense inspector panels."})]}),b.jsxs("div",{className:"border-border bg-surface-2 rounded-xl border p-4",children:[b.jsx("p",{className:"text-content-subtle text-xs font-medium tracking-[0.16em] uppercase",children:"Micro label"}),b.jsx("code",{className:"bg-muted text-muted-foreground mt-3 block rounded-lg px-3 py-2 text-xs",children:"font-main text-content"})]})]})}),b.jsx(xo,{eyebrow:"Layout",title:"Spacing rhythm",description:"A compact spacing scale keeps editor chrome dense while preserving scannable groupings.",children:b.jsx("div",{className:"border-border bg-surface-2 rounded-xl border p-4",children:b.jsx("div",{className:"flex flex-col gap-3",children:aoe.map(n=>b.jsxs("div",{className:"flex items-center gap-4",children:[b.jsx("code",{className:"text-muted-foreground w-16 text-xs",children:n.name}),b.jsx("div",{className:`${n.className} bg-primary h-4 rounded`}),b.jsx("div",{className:"bg-border h-px flex-1"})]},n.name))})})}),b.jsx(xo,{eyebrow:"Primitives",title:"Accordion and slider",description:"Representative Radix primitives styled through the local component layer.",children:b.jsxs("div",{className:"grid gap-4 lg:grid-cols-2",children:[b.jsxs(xm,{defaultValue:["foundations"],className:"border-border bg-surface-2 rounded-xl border p-2",children:[b.jsx(xm.Item,{value:"foundations",title:"Foundations",description:"Tokens, surfaces, type, and spacing.",className:"first-item",icon:b.jsx(r_,{className:"text-primary h-4 w-4"}),children:b.jsx("p",{children:"Use these pieces before adding one-off visual rules."})}),b.jsx(xm.Item,{value:"components",title:"Components",description:"Buttons, tooltips, accordions, sliders.",children:b.jsx("p",{children:"Keep states visible in this route as the system evolves."})})]}),b.jsxs("div",{className:"border-border bg-surface-2 rounded-xl border p-5",children:[b.jsx("p",{className:"text-foreground mb-5 text-sm font-medium",children:"Slider states"}),b.jsxs("div",{className:"space-y-6",children:[b.jsx(ix,{defaultValue:[64],max:100,step:1}),b.jsx(ix,{defaultValue:[36],max:100,step:1,disabled:!0})]})]})]})}),b.jsx(xo,{eyebrow:"Feedback",title:"Motion and loading",description:"Loading states use existing CSS animation utilities and avoid per-frame React work where possible.",children:b.jsxs("div",{className:"grid gap-4 sm:grid-cols-3",children:[b.jsxs("div",{className:"border-border bg-surface-2 rounded-xl border p-4",children:[b.jsx("p",{className:"text-foreground mb-4 text-sm font-medium",children:"Progress"}),b.jsx(Rie,{message:"Applying visual change..."})]}),b.jsxs("div",{className:"border-border bg-surface-2 rounded-xl border p-4",children:[b.jsx("p",{className:"text-foreground mb-4 text-sm font-medium",children:"Sparkle strip"}),b.jsx(Gb,{className:"text-primary text-xl"})]}),b.jsxs("div",{className:"border-border bg-surface-2 rounded-xl border p-4",children:[b.jsx("p",{className:"text-foreground mb-4 text-sm font-medium",children:"Shimmer text"}),b.jsx("span",{className:"shimmer-text text-sm font-medium",children:"Generating variants"})]}),b.jsx("div",{className:"border-border bg-surface-2 rounded-xl border p-4 sm:col-span-3",children:b.jsx(jie,{hint:"Reading selected elements"})})]})}),b.jsx(xo,{eyebrow:"Feedback",title:"Status surfaces",description:"The unified full-surface system: one StatusSurface primitive with LoadingSurface / EmptyState / ErrorState wrappers. Every full-page loading, empty, and error state routes through these so they share layout, copy tone, and a single status_surface_shown impression event. Inline loaders (Sparkle, ThinkingIndicator, above) stay inline and are deliberately not part of this system.",children:b.jsxs("div",{className:"grid gap-4 sm:grid-cols-2",children:[b.jsx("div",{className:"border-border relative h-56 overflow-hidden rounded-xl border",children:b.jsx(Fw,{fill:"surface",loader:"coalesce",trackGlobalLoaderCount:!1})}),b.jsx("div",{className:"border-border relative h-56 overflow-hidden rounded-xl border",children:b.jsx(r9,{icon:b.jsx(r_,{size:32}),title:"Nothing to preview yet",description:"Pick a direction from the panel."})}),b.jsx("div",{className:"border-border relative h-56 overflow-hidden rounded-xl border",children:b.jsx(Yb,{fill:"surface",size:"sm",title:"Preview isn't connected",description:"Rivet lost connection to your project.",actions:[{label:"Reload",onClick:()=>{}}]})})]})}),b.jsxs(xo,{eyebrow:"Inventory",title:"Component coverage",description:"Every current component file is accounted for here. Reusable primitives are rendered above; app surfaces that need live editor, git, auth, iframe, or generated state are cataloged instead of mounted unsafely.",children:[b.jsxs("div",{className:"mb-4 grid gap-3 sm:grid-cols-3",children:[b.jsxs("div",{className:"border-border bg-surface-2 rounded-xl border p-4",children:[b.jsx("p",{className:"text-content-subtle text-xs tracking-[0.16em] uppercase",children:"Total components"}),b.jsx("p",{className:"text-foreground mt-2 text-2xl font-semibold",children:W0.length})]}),b.jsxs("div",{className:"border-border bg-surface-2 rounded-xl border p-4",children:[b.jsx("p",{className:"text-content-subtle text-xs tracking-[0.16em] uppercase",children:"Showcased"}),b.jsx("p",{className:"text-accent-success mt-2 text-2xl font-semibold",children:t})]}),b.jsxs("div",{className:"border-border bg-surface-2 rounded-xl border p-4",children:[b.jsx("p",{className:"text-content-subtle text-xs tracking-[0.16em] uppercase",children:"Cataloged"}),b.jsx("p",{className:"text-primary mt-2 text-2xl font-semibold",children:e})]})]}),b.jsxs("div",{className:"border-border overflow-hidden rounded-xl border",children:[b.jsxs("div",{className:"border-border bg-surface-3 text-content-subtle grid grid-cols-[minmax(140px,1fr)_minmax(110px,auto)_minmax(220px,2fr)] border-b px-4 py-3 text-xs font-semibold tracking-[0.14em] uppercase",children:[b.jsx("span",{children:"Component"}),b.jsx("span",{children:"Status"}),b.jsx("span",{children:"Coverage note"})]}),b.jsx("div",{className:"divide-border bg-surface-2 divide-y",children:W0.map(n=>b.jsxs("div",{className:"grid grid-cols-[minmax(140px,1fr)_minmax(110px,auto)_minmax(220px,2fr)] gap-3 px-4 py-3 text-sm",children:[b.jsxs("div",{children:[b.jsx("p",{className:"text-foreground font-medium",children:n.name}),b.jsx("code",{className:"text-muted-foreground text-xs",children:n.path})]}),b.jsx("div",{children:b.jsx("span",{className:`inline-flex rounded-full border px-2 py-1 text-xs font-medium ${coe(n.status)}`,children:n.status})}),b.jsx("p",{className:"text-muted-foreground",children:n.note})]},n.path))})]})]})]})})},doe=t=>(t.startsWith("#/")?t.slice(2):t.slice(1)).split("?")[0]==="design-system"?"design-system":"editor",ox=274,Rg=395,F_=Math.min(Rg,Math.round((ox+Rg)/2*1.1)),dP="rivet:panelWidth:v2",foe=t=>{if(!(t instanceof HTMLElement))return!1;const e=t.tagName.toLowerCase();return t.isContentEditable||e==="input"||e==="textarea"||e==="select"},hoe=({projectPath:t,libraryOrigin:e})=>{const n=ut(EO)>0,[r,s]=yA(SO),i=WW(),[o,l]=m.useState(()=>{if(typeof window>"u")return F_;const A=Number(window.localStorage.getItem(dP));return Number.isFinite(A)&&A>=ox&&A<=Rg?A:F_}),[u,d]=m.useState(!1),[f,p]=m.useState(xre),g=r?o:0,[v,w]=m.useState(r);m.useEffect(()=>{if(!r){w(!1);return}p(A=>wre({position:A,boundsLeftPx:o}))},[r,o]),m.useEffect(()=>{window.localStorage.setItem(dP,String(o))},[o]),m.useEffect(()=>{if(!r)return;const A=I=>{I.key==="Escape"&&(foe(I.target)||(I.preventDefault(),s(!1)))};return window.addEventListener("keydown",A),()=>window.removeEventListener("keydown",A)},[r,s]);const _=m.useCallback(A=>{A.preventDefault(),A.stopPropagation();const I=A.clientX,M=o;d(!0);const R=N=>{const D=Math.min(Rg,Math.max(ox,M+(N.clientX-I)));l(D)},O=()=>{window.removeEventListener("pointermove",R),window.removeEventListener("pointerup",O),window.removeEventListener("pointercancel",O),d(!1)};window.addEventListener("pointermove",R),window.addEventListener("pointerup",O),window.addEventListener("pointercancel",O)},[o]),x=m.useCallback(()=>l(F_),[]),S=Dre(),k=ut(lv);Fre({enabled:!k});const C=S.isProcessing?"Completing authentication...":null,T=gt(qb);return m.useEffect(()=>{T(t??null)},[t,T]),b.jsxs(wi.div,{className:"relative flex h-screen overflow-hidden",initial:!1,animate:{opacity:1},transition:{duration:.5,ease:"easeOut"},"data-cy":"rivet-app",children:[C!==null?b.jsx("div",{className:"absolute inset-0 z-50",children:b.jsx(are,{message:C})}):null,b.jsx(Nte,{}),b.jsx(b.Fragment,{children:n?null:b.jsxs(b.Fragment,{children:[b.jsx("div",{className:"relative order-first h-full flex-shrink-0",style:{width:v?o:0},children:b.jsxs(wi.div,{className:"absolute inset-y-0 left-0 z-30",initial:!1,animate:{x:r?0:-o},transition:i?{duration:0}:{duration:.2,ease:[.22,1,.36,1]},onAnimationComplete:()=>{r&&w(!0)},style:{width:o,willChange:"transform"},children:[b.jsx(Gee,{onClose:()=>s(!1),libraryOrigin:e}),b.jsx("div",{role:"separator","aria-orientation":"vertical","aria-label":"Resize panel",onPointerDown:_,onDoubleClick:x,className:"group/resize absolute inset-y-0 right-0 z-20 flex w-3 cursor-col-resize touch-none justify-end",children:b.jsx("span",{className:`h-full transition-all duration-150 ${u?"bg-content-muted w-0.5":"bg-divider group-hover/resize:bg-content-muted w-px group-hover/resize:w-0.5"}`})})]})}),u&&b.jsx("div",{className:"fixed inset-0 z-[100] cursor-col-resize"}),b.jsx(kre,{isVisible:!0,isPanelOpen:r,isReducedMotion:!!i,position:f,dragBoundsLeftPx:g,onPositionChange:p,onToggle:()=>s(A=>!A)})]})}),b.jsx(bq,{duration:5e3,richColors:!0,toastOptions:{style:{maxHeight:"150px",overflow:"hidden"}}})]})},ax="rivet_connect_deep_link",poe=()=>{if(typeof window>"u")return null;const t=new URLSearchParams(window.location.search),e=t.get("connect"),n=e??window.sessionStorage.getItem(ax);if(n!=="pinterest"&&n!=="arena"&&n!=="x")return null;if(window.sessionStorage.setItem(ax,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},moe=poe(),goe=()=>{const[t,e]=m.useState(window.location.hash),[n]=m.useState(()=>typeof window<"u"&&window.sessionStorage.getItem(xg)==="1"),[r,s]=m.useState(!1),[i,o]=m.useState(moe);m.useEffect(()=>{n&&window.sessionStorage.removeItem(xg)},[n]);const{config:l,refetchConfig:u,loading:d,error:f}=Lre(),p=gt(lv),{startLogin:g,isStartingLogin:v,loginError:w}=qO(),[_,x]=m.useState(!1);m.useEffect(()=>{l!=null&&l.userId?(Ce.identify(l.userId,{...l.email?{email:l.email}:{}}),l.email&&Ce.alias(l.email,l.userId)):l!=null&&l.email&&Ce.identify(l.email,{email:l.email})},[l==null?void 0:l.userId,l==null?void 0:l.email]),m.useEffect(()=>{l&&Ce.register({source:"visual_editor",surface:"visual_editor"})},[l]);const S=l!=null&&l.agentModeAvailable!==!0,k=doe(t),C=m.useCallback(async()=>{x(!0),p(!0);try{await u()}finally{p(!1),x(!1)}},[u,p]);if(m.useEffect(()=>{const M=()=>{const R=window.location.hash;e(R)};return window.addEventListener("hashchange",M),()=>window.removeEventListener("hashchange",M)},[]),k==="design-system")return b.jsx(uoe,{});if(!d&&l===null&&!_){const M=f||"Could not load Rivet configuration.";return b.jsx("div",{className:"bg-main flex h-screen items-center justify-center px-6",children:b.jsxs("div",{className:"border-divider bg-main w-full max-w-md rounded-lg border p-6 text-center shadow-lg",children:[b.jsx("p",{className:"text-content text-sm font-medium",children:"We could not start Rivet yet."}),b.jsx("p",{className:"text-content-dim mt-2 text-xs",children:M}),b.jsx("button",{type:"button",className:"border-divider text-content hover:bg-main/80 mt-4 rounded-md border px-3 py-1.5 text-xs",onClick:()=>{C()},children:"Retry"})]})})}if(S)return b.jsx(ire,{isSigningIn:v,onStartSignIn:()=>{g()},errorMessage:w,displayMode:"full"});const A=(l==null?void 0:l.agentModeAvailable)===!0&&i!==null,I=(l==null?void 0:l.agentModeAvailable)===!0&&n&&!r&&!A;return b.jsxs(b.Fragment,{children:[b.jsx(hoe,{projectPath:l==null?void 0:l.projectPath,libraryOrigin:(l==null?void 0:l.libraryOrigin)??null}),b.jsx($w,{context:"onboarding",isOpen:I,onClose:()=>s(!0)}),b.jsx($w,{context:"menu",isOpen:A,highlightProvider:i,onClose:()=>{window.sessionStorage.removeItem(ax),o(null)}})]})},voe=m.lazy(()=>SP(()=>import("./LibraryEntry-Db0yQPRU.js"),[])),MN=window.location.pathname.startsWith("/rivet/library"),yoe="phc_Ntj9tXHbS64XgYxlTfhglRmFivFsfm0AERph4ZlnNH",_oe=new V7,woe={session_recording:{maskAllInputs:!0,maskTextSelector:"[data-rivet-private]"}},xoe=()=>b.jsx("div",{style:{display:"flex",height:"100vh",alignItems:"center",justifyContent:"center"},children:b.jsx("p",{style:{fontSize:"14px",color:"#6b7280"},children:"Something went wrong. Please reload the page."})}),IN=document.getElementById("root");if(!IN)throw new Error("Rivet root element is missing");const fP=()=>vH.createRoot(IN).render(b.jsx(we.StrictMode,{children:b.jsx(kV,{apiKey:yoe,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",...woe,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.20.0",env:"production"})}},children:b.jsx(RV,{fallback:b.jsx(xoe,{}),children:b.jsx(p7,{client:_oe,children:b.jsx(pK,{defaultShape:"rounded",children:b.jsx(Pie,{defaultLibrary:"lucide",children:MN?b.jsx(m.Suspense,{fallback:b.jsx("div",{className:"bg-background h-screen"}),children:b.jsx(voe,{})}):b.jsx(goe,{})})})})})})}));MN?cH().then(fP):fP();export{Soe as $,iv as A,Gi as B,Zb as C,tv as D,ov as E,Rt as F,lre as G,Xh as H,mie as I,aH as J,nh as K,MM as L,Gf as M,$se as N,jg as O,Bb as P,L7 as Q,zb as R,Bh as S,Ub as T,On as U,Je as V,cA as W,kie as X,sd as Y,Zk as Z,nH as _,H7 as a,oK as a0,xe as a1,sH as a2,mh as a3,Ioe as a4,Ooe as a5,uH as a6,uee as a7,Ut as a8,Poe as a9,Toe as aa,Ose as ab,qee as ac,bq as ad,oee as ae,Eoe as af,koe as ag,qO as ah,lH as ai,oH as aj,B7 as b,m as c,Z7 as d,G7 as e,W7 as f,j7 as g,th as h,Gr as i,K7 as j,Y7 as k,q7 as l,RP as m,hr as n,at as o,xi as p,vO as q,TP as r,Q1 as s,b as t,EP as u,fw as v,lie as w,nv as x,rv as y,sv as z};