rivet-design 0.21.0 → 0.21.2

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 (187) hide show
  1. package/dist/agent-variants/WorkerExecutorService.d.ts.map +1 -1
  2. package/dist/agent-variants/WorkerExecutorService.js +7 -1
  3. package/dist/agent-variants/WorkerExecutorService.js.map +1 -1
  4. package/dist/agent-variants/WorktreeOrchestrator.d.ts +0 -1
  5. package/dist/agent-variants/WorktreeOrchestrator.d.ts.map +1 -1
  6. package/dist/agent-variants/WorktreeOrchestrator.js +2 -19
  7. package/dist/agent-variants/WorktreeOrchestrator.js.map +1 -1
  8. package/dist/agent-variants/contracts.d.ts +388 -388
  9. package/dist/agent-variants/directionAuthoring.d.ts +1 -1
  10. package/dist/agent-variants/directionAuthoring.d.ts.map +1 -1
  11. package/dist/agent-variants/directionAuthoring.js +9 -1
  12. package/dist/agent-variants/directionAuthoring.js.map +1 -1
  13. package/dist/agent-variants/guidancePrompt.d.ts.map +1 -1
  14. package/dist/agent-variants/guidancePrompt.js +24 -13
  15. package/dist/agent-variants/guidancePrompt.js.map +1 -1
  16. package/dist/agent-variants/variantContext.d.ts +1 -0
  17. package/dist/agent-variants/variantContext.d.ts.map +1 -1
  18. package/dist/agent-variants/variantContext.js +5 -4
  19. package/dist/agent-variants/variantContext.js.map +1 -1
  20. package/dist/agent-variants/workItemContextFiles.d.ts +17 -0
  21. package/dist/agent-variants/workItemContextFiles.d.ts.map +1 -0
  22. package/dist/agent-variants/workItemContextFiles.js +41 -0
  23. package/dist/agent-variants/workItemContextFiles.js.map +1 -0
  24. package/dist/cli/commands/contextRequest.d.ts.map +1 -1
  25. package/dist/cli/commands/contextRequest.js +4 -3
  26. package/dist/cli/commands/contextRequest.js.map +1 -1
  27. package/dist/cli/commands/guidanceUpload.d.ts +3 -0
  28. package/dist/cli/commands/guidanceUpload.d.ts.map +1 -0
  29. package/dist/cli/commands/guidanceUpload.js +39 -0
  30. package/dist/cli/commands/guidanceUpload.js.map +1 -0
  31. package/dist/cli/commands/mcpServe.js +1 -1
  32. package/dist/cli/commands/mcpServe.js.map +1 -1
  33. package/dist/index.d.ts +1 -0
  34. package/dist/index.d.ts.map +1 -1
  35. package/dist/index.js +25 -9
  36. package/dist/index.js.map +1 -1
  37. package/dist/library/BrowserSessions.d.ts +24 -8
  38. package/dist/library/BrowserSessions.d.ts.map +1 -1
  39. package/dist/library/BrowserSessions.js +67 -45
  40. package/dist/library/BrowserSessions.js.map +1 -1
  41. package/dist/library/HubServer.js +1 -1
  42. package/dist/library/HubServer.js.map +1 -1
  43. package/dist/routes/account.d.ts.map +1 -1
  44. package/dist/routes/account.js +7 -2
  45. package/dist/routes/account.js.map +1 -1
  46. package/dist/routes/installRef.d.ts +3 -0
  47. package/dist/routes/installRef.d.ts.map +1 -0
  48. package/dist/routes/installRef.js +18 -0
  49. package/dist/routes/installRef.js.map +1 -0
  50. package/dist/routes/library/app.d.ts.map +1 -1
  51. package/dist/routes/library/app.js +3 -8
  52. package/dist/routes/library/app.js.map +1 -1
  53. package/dist/routes/library/browserAccess.d.ts +0 -1
  54. package/dist/routes/library/browserAccess.d.ts.map +1 -1
  55. package/dist/routes/library/browserAccess.js +27 -20
  56. package/dist/routes/library/browserAccess.js.map +1 -1
  57. package/dist/routes/library/guidance.d.ts.map +1 -1
  58. package/dist/routes/library/guidance.js +3 -2
  59. package/dist/routes/library/guidance.js.map +1 -1
  60. package/dist/routes/library/index.d.ts.map +1 -1
  61. package/dist/routes/library/index.js +2 -4
  62. package/dist/routes/library/index.js.map +1 -1
  63. package/dist/routes/library/middleware.d.ts +1 -1
  64. package/dist/routes/library/middleware.d.ts.map +1 -1
  65. package/dist/routes/library/middleware.js +15 -3
  66. package/dist/routes/library/middleware.js.map +1 -1
  67. package/dist/routes/library/schemas.d.ts +2 -2
  68. package/dist/routes/variantRequestSchema.d.ts +7 -7
  69. package/dist/server.d.ts.map +1 -1
  70. package/dist/server.js +2 -0
  71. package/dist/server.js.map +1 -1
  72. package/dist/services/AuthService.d.ts.map +1 -1
  73. package/dist/services/AuthService.js +41 -15
  74. package/dist/services/AuthService.js.map +1 -1
  75. package/dist/services/BrowserAgentClient.d.ts.map +1 -1
  76. package/dist/services/BrowserAgentClient.js +13 -3
  77. package/dist/services/BrowserAgentClient.js.map +1 -1
  78. package/dist/services/ConfigManager.d.ts +23 -3
  79. package/dist/services/ConfigManager.d.ts.map +1 -1
  80. package/dist/services/ConfigManager.js +117 -24
  81. package/dist/services/ConfigManager.js.map +1 -1
  82. package/dist/services/GatewayClient.d.ts.map +1 -1
  83. package/dist/services/GatewayClient.js +3 -2
  84. package/dist/services/GatewayClient.js.map +1 -1
  85. package/dist/services/IntegrationsClient.d.ts +4 -4
  86. package/dist/services/IntegrationsClient.d.ts.map +1 -1
  87. package/dist/services/IntegrationsClient.js +5 -11
  88. package/dist/services/IntegrationsClient.js.map +1 -1
  89. package/dist/services/ProjectRegistry.d.ts +2 -2
  90. package/dist/services/PrototypeDeployService.d.ts.map +1 -1
  91. package/dist/services/PrototypeDeployService.js +3 -2
  92. package/dist/services/PrototypeDeployService.js.map +1 -1
  93. package/dist/services/VariantRunService.d.ts +1 -1
  94. package/dist/services/VariantRunService.d.ts.map +1 -1
  95. package/dist/services/VariantRunService.js +17 -2
  96. package/dist/services/VariantRunService.js.map +1 -1
  97. package/dist/services/authUpdate.d.ts +8 -0
  98. package/dist/services/authUpdate.d.ts.map +1 -0
  99. package/dist/services/authUpdate.js +21 -0
  100. package/dist/services/authUpdate.js.map +1 -0
  101. package/dist/services/guidanceDelivery.d.ts +15 -0
  102. package/dist/services/guidanceDelivery.d.ts.map +1 -0
  103. package/dist/services/guidanceDelivery.js +112 -0
  104. package/dist/services/guidanceDelivery.js.map +1 -0
  105. package/dist/services/guidanceImages.d.ts +18 -0
  106. package/dist/services/guidanceImages.d.ts.map +1 -0
  107. package/dist/services/guidanceImages.js +74 -0
  108. package/dist/services/guidanceImages.js.map +1 -0
  109. package/dist/services/pendingLogin.d.ts +2 -0
  110. package/dist/services/pendingLogin.d.ts.map +1 -1
  111. package/dist/services/pendingLogin.js +4 -2
  112. package/dist/services/pendingLogin.js.map +1 -1
  113. package/dist/services/profiles/DesignProfiles.d.ts +67 -11
  114. package/dist/services/profiles/DesignProfiles.d.ts.map +1 -1
  115. package/dist/services/profiles/DesignProfiles.js +62 -5
  116. package/dist/services/profiles/DesignProfiles.js.map +1 -1
  117. package/dist/services/profiles/ProfileMedia.d.ts +1 -0
  118. package/dist/services/profiles/ProfileMedia.d.ts.map +1 -1
  119. package/dist/services/profiles/ProfileMedia.js +13 -11
  120. package/dist/services/profiles/ProfileMedia.js.map +1 -1
  121. package/dist/services/profiles/ProfilePlanning.d.ts +5 -5
  122. package/dist/services/profiles/ProfilePreparation.d.ts.map +1 -1
  123. package/dist/services/profiles/ProfilePreparation.js +12 -8
  124. package/dist/services/profiles/ProfilePreparation.js.map +1 -1
  125. package/dist/services/profiles/ReferenceReader.d.ts +4 -4
  126. package/dist/services/profiles/profileContext.d.ts +1 -1
  127. package/dist/services/profiles/profileContext.d.ts.map +1 -1
  128. package/dist/services/profiles/profileContext.js +36 -4
  129. package/dist/services/profiles/profileContext.js.map +1 -1
  130. package/dist/storage/library/BrowserAuthorizationRecords.d.ts +54 -0
  131. package/dist/storage/library/BrowserAuthorizationRecords.d.ts.map +1 -0
  132. package/dist/storage/library/BrowserAuthorizationRecords.js +175 -0
  133. package/dist/storage/library/BrowserAuthorizationRecords.js.map +1 -0
  134. package/dist/storage/library/ProjectPreviewCache.d.ts +2 -2
  135. package/dist/storage/library/database.d.ts +2 -1
  136. package/dist/storage/library/database.d.ts.map +1 -1
  137. package/dist/storage/library/database.js +5 -36
  138. package/dist/storage/library/database.js.map +1 -1
  139. package/dist/storage/library/migrations.d.ts +1 -0
  140. package/dist/storage/library/migrations.d.ts.map +1 -1
  141. package/dist/storage/library/migrations.js +14 -1
  142. package/dist/storage/library/migrations.js.map +1 -1
  143. package/dist/storage/library/schema/browserAuthorization.d.ts +191 -0
  144. package/dist/storage/library/schema/browserAuthorization.d.ts.map +1 -0
  145. package/dist/storage/library/schema/browserAuthorization.js +20 -0
  146. package/dist/storage/library/schema/browserAuthorization.js.map +1 -0
  147. package/dist/storage/profiles/ProfilePlans.d.ts +19 -19
  148. package/dist/storage/profiles/ProfileRecords.d.ts +4 -4
  149. package/dist/storage/profiles/ProfileRecords.d.ts.map +1 -1
  150. package/dist/storage/profiles/ProfileRecords.js +12 -3
  151. package/dist/storage/profiles/ProfileRecords.js.map +1 -1
  152. package/dist/storage/profiles/migrations.d.ts +2 -2
  153. package/dist/storage/profiles/migrations.d.ts.map +1 -1
  154. package/dist/storage/profiles/migrations.js +3 -0
  155. package/dist/storage/profiles/migrations.js.map +1 -1
  156. package/dist/storage/profiles/planSchema.d.ts +5 -5
  157. package/dist/storage/profiles/schema.d.ts +29 -3
  158. package/dist/storage/profiles/schema.d.ts.map +1 -1
  159. package/dist/storage/profiles/schema.js +1 -0
  160. package/dist/storage/profiles/schema.js.map +1 -1
  161. package/dist/types/cosmos-profile.d.ts +6 -6
  162. package/dist/types/cosmos.d.ts +20 -20
  163. package/dist/types/design-library.d.ts +3 -3
  164. package/dist/types/design-profile.d.ts +40 -40
  165. package/dist/types/design-profile.d.ts.map +1 -1
  166. package/dist/types/design-profile.js +2 -1
  167. package/dist/types/design-profile.js.map +1 -1
  168. package/dist/types/guidance.d.ts +391 -5
  169. package/dist/types/guidance.d.ts.map +1 -1
  170. package/dist/types/guidance.js +27 -1
  171. package/dist/types/guidance.js.map +1 -1
  172. package/dist/types/reference-connectors.d.ts +10 -10
  173. package/dist/types/reference-onboarding.d.ts +65 -65
  174. package/dist/types/reference-pages.d.ts +12 -12
  175. package/dist/types/variant-reference.d.ts +4 -4
  176. package/dist/utils/installRef.d.ts +8 -0
  177. package/dist/utils/installRef.d.ts.map +1 -0
  178. package/dist/utils/installRef.js +34 -0
  179. package/dist/utils/installRef.js.map +1 -0
  180. package/dist/utils/skills/cli-guidance.d.ts +1 -1
  181. package/dist/utils/skills/cli-guidance.js +3 -3
  182. package/package.json +4 -2
  183. package/src/ui/dist/assets/LibraryEntry-B5kPF3Ey.js +36 -0
  184. package/src/ui/dist/assets/main-Er_TRZTd.js +435 -0
  185. package/src/ui/dist/index.html +1 -1
  186. package/src/ui/dist/assets/LibraryEntry-BmQyIG74.js +0 -36
  187. package/src/ui/dist/assets/main-C-Pki9j3.js +0 -435
@@ -0,0 +1,435 @@
1
+ var W7=Object.defineProperty;var a8=t=>{throw TypeError(t)};var q7=(t,e,n)=>e in t?W7(t,e,{enumerable:!0,configurable:!0,writable:!0,value:n}):t[e]=n;var wa=(t,e,n)=>q7(t,typeof e!="symbol"?e+"":e,n),sy=(t,e,n)=>e.has(t)||a8("Cannot "+n);var W=(t,e,n)=>(sy(t,e,"read from private field"),n?n.call(t):e.get(t)),rt=(t,e,n)=>e.has(t)?a8("Cannot add the same private member more than once"):e instanceof WeakSet?e.add(t):e.set(t,n),Re=(t,e,n,r)=>(sy(t,e,"write to private field"),r?r.call(t,n):e.set(t,n),n),wt=(t,e,n)=>(sy(t,e,"access private method"),n);var _0=(t,e,n,r)=>({set _(s){Re(t,e,s,n)},get _(){return W(t,e,r)}});function G7(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 K7="modulepreload",Y7=function(t){return"/"+t},l8={},XP=function(e,n,r){let s=Promise.resolve();if(n&&n.length>0){let o=function(d){return Promise.all(d.map(f=>Promise.resolve(f).then(h=>({status:"fulfilled",value:h}),h=>({status:"rejected",reason:h}))))};document.getElementsByTagName("link");const l=document.querySelector("meta[property=csp-nonce]"),u=(l==null?void 0:l.nonce)||(l==null?void 0:l.getAttribute("nonce"));s=o(n.map(d=>{if(d=Y7(d),d in l8)return;l8[d]=!0;const f=d.endsWith(".css"),h=f?'[rel="stylesheet"]':"";if(document.querySelector(`link[href="${d}"]${h}`))return;const g=document.createElement("link");if(g.rel=f?"stylesheet":K7,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 Vg(t){return t&&t.__esModule&&Object.prototype.hasOwnProperty.call(t,"default")?t.default:t}var iy={exports:{}},gf={},oy={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 c8;function X7(){if(c8)return vt;c8=1;var t=Symbol.for("react.element"),e=Symbol.for("react.portal"),n=Symbol.for("react.fragment"),r=Symbol.for("react.strict_mode"),s=Symbol.for("react.profiler"),i=Symbol.for("react.provider"),o=Symbol.for("react.context"),l=Symbol.for("react.forward_ref"),u=Symbol.for("react.suspense"),d=Symbol.for("react.memo"),f=Symbol.for("react.lazy"),h=Symbol.iterator;function g(j){return j===null||typeof j!="object"?null:(j=h&&j[h]||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 A=Array.isArray,T=Object.prototype.hasOwnProperty,I={current:null},M={key:!0,ref:!0,__self:!0,__source:!0};function R(j,Q,oe){var ne,se={},de=null,ve=null;if(Q!=null)for(ne in Q.ref!==void 0&&(ve=Q.ref),Q.key!==void 0&&(de=""+Q.key),Q)T.call(Q,ne)&&!M.hasOwnProperty(ne)&&(se[ne]=Q[ne]);var ue=arguments.length-2;if(ue===1)se.children=oe;else if(1<ue){for(var ae=Array(ue),Oe=0;Oe<ue;Oe++)ae[Oe]=arguments[Oe+2];se.children=ae}if(j&&j.defaultProps)for(ne in ue=j.defaultProps,ue)se[ne]===void 0&&(se[ne]=ue[ne]);return{$$typeof:t,type:j,key:de,ref:ve,props:se,_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 F=/\/+/g;function K(j,Q){return typeof j=="object"&&j!==null&&j.key!=null?D(""+j.key):Q.toString(36)}function B(j,Q,oe,ne,se){var de=typeof j;(de==="undefined"||de==="boolean")&&(j=null);var ve=!1;if(j===null)ve=!0;else switch(de){case"string":case"number":ve=!0;break;case"object":switch(j.$$typeof){case t:case e:ve=!0}}if(ve)return ve=j,se=se(ve),j=ne===""?"."+K(ve,0):ne,A(se)?(oe="",j!=null&&(oe=j.replace(F,"$&/")+"/"),B(se,Q,oe,"",function(Oe){return Oe})):se!=null&&(N(se)&&(se=O(se,oe+(!se.key||ve&&ve.key===se.key?"":(""+se.key).replace(F,"$&/")+"/")+j)),Q.push(se)),1;if(ve=0,ne=ne===""?".":ne+":",A(j))for(var ue=0;ue<j.length;ue++){de=j[ue];var ae=ne+K(de,ue);ve+=B(de,Q,oe,ae,se)}else if(ae=g(j),typeof ae=="function")for(j=ae.call(j),ue=0;!(de=j.next()).done;)de=de.value,ae=ne+K(de,ue++),ve+=B(de,Q,oe,ae,se);else if(de==="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 ve}function G(j,Q,oe){if(j==null)return j;var ne=[],se=0;return B(j,ne,"","",function(de){return Q.call(oe,de,se++)}),ne}function H(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 Y={current:null},U={transition:null},J={ReactCurrentDispatcher:Y,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=J,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 ne=w({},j.props),se=j.key,de=j.ref,ve=j._owner;if(Q!=null){if(Q.ref!==void 0&&(de=Q.ref,ve=I.current),Q.key!==void 0&&(se=""+Q.key),j.type&&j.type.defaultProps)var ue=j.type.defaultProps;for(ae in Q)T.call(Q,ae)&&!M.hasOwnProperty(ae)&&(ne[ae]=Q[ae]===void 0&&ue!==void 0?ue[ae]:Q[ae])}var ae=arguments.length-2;if(ae===1)ne.children=oe;else if(1<ae){ue=Array(ae);for(var Oe=0;Oe<ae;Oe++)ue[Oe]=arguments[Oe+2];ne.children=ue}return{$$typeof:t,type:j.type,key:se,ref:de,props:ne,_owner:ve}},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:H}},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 Y.current.useCallback(j,Q)},vt.useContext=function(j){return Y.current.useContext(j)},vt.useDebugValue=function(){},vt.useDeferredValue=function(j){return Y.current.useDeferredValue(j)},vt.useEffect=function(j,Q){return Y.current.useEffect(j,Q)},vt.useId=function(){return Y.current.useId()},vt.useImperativeHandle=function(j,Q,oe){return Y.current.useImperativeHandle(j,Q,oe)},vt.useInsertionEffect=function(j,Q){return Y.current.useInsertionEffect(j,Q)},vt.useLayoutEffect=function(j,Q){return Y.current.useLayoutEffect(j,Q)},vt.useMemo=function(j,Q){return Y.current.useMemo(j,Q)},vt.useReducer=function(j,Q,oe){return Y.current.useReducer(j,Q,oe)},vt.useRef=function(j){return Y.current.useRef(j)},vt.useState=function(j){return Y.current.useState(j)},vt.useSyncExternalStore=function(j,Q,oe){return Y.current.useSyncExternalStore(j,Q,oe)},vt.useTransition=function(){return Y.current.useTransition()},vt.version="18.3.1",vt}var u8;function kx(){return u8||(u8=1,oy.exports=X7()),oy.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 d8;function Q7(){if(d8)return gf;d8=1;var t=kx(),e=Symbol.for("react.element"),n=Symbol.for("react.fragment"),r=Object.prototype.hasOwnProperty,s=t.__SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED.ReactCurrentOwner,i={key:!0,ref:!0,__self:!0,__source:!0};function o(l,u,d){var f,h={},g=null,v=null;d!==void 0&&(g=""+d),u.key!==void 0&&(g=""+u.key),u.ref!==void 0&&(v=u.ref);for(f in u)r.call(u,f)&&!i.hasOwnProperty(f)&&(h[f]=u[f]);if(l&&l.defaultProps)for(f in u=l.defaultProps,u)h[f]===void 0&&(h[f]=u[f]);return{$$typeof:e,type:l,key:g,ref:v,props:h,_owner:s.current}}return gf.Fragment=n,gf.jsx=o,gf.jsxs=o,gf}var f8;function J7(){return f8||(f8=1,iy.exports=Q7()),iy.exports}var b=J7(),m=kx();const we=Vg(m),Xh=G7({__proto__:null,default:we},[m]),QP=m.createContext(void 0),JP=t=>{const e=m.useContext(QP);if(!e)throw new Error("No QueryClient set, use QueryClientProvider to set one");return e},ej=({client:t,children:e})=>(m.useEffect(()=>(t.mount(),()=>{t.unmount()}),[t]),b.jsx(QP.Provider,{value:t,children:e})),tj={setTimeout:(t,e)=>setTimeout(t,e),clearTimeout:t=>clearTimeout(t),setInterval:(t,e)=>setInterval(t,e),clearInterval:t=>clearInterval(t)};var Ta,Sx,HP,nj=(HP=class{constructor(){rt(this,Ta,tj);rt(this,Sx,!1)}setTimeoutProvider(t){Re(this,Ta,t)}setTimeout(t,e){return W(this,Ta).setTimeout(t,e)}clearTimeout(t){W(this,Ta).clearTimeout(t)}setInterval(t,e){return W(this,Ta).setInterval(t,e)}clearInterval(t){W(this,Ta).clearInterval(t)}},Ta=new WeakMap,Sx=new WeakMap,HP);const ql=new nj;function rj(t){setTimeout(t,0)}const sj=typeof window>"u"||"Deno"in globalThis;function Kr(){}function ij(t,e){return typeof t=="function"?t(e):t}function e5(t){return typeof t=="number"&&t>=0&&t!==1/0}function t5(t,e){return Math.max(t+(e||0)-Date.now(),0)}function hn(t,e){return typeof t=="function"?t(e):t}function h8(t,e){const{type:n="all",exact:r,fetchStatus:s,predicate:i,queryKey:o,stale:l}=t;if(o){if(r){if(e.queryHash!==Ex(o,e.options))return!1}else if(!ed(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 p8(t,e){const{exact:n,status:r,predicate:s,mutationKey:i}=t;if(i){if(!e.options.mutationKey)return!1;if(n){if(ch(e.options.mutationKey)!==ch(i))return!1}else if(!ed(e.options.mutationKey,i))return!1}return!(r&&e.state.status!==r||s&&!s(e))}function Ex(t,e){return((e==null?void 0:e.queryKeyHashFn)||ch)(t)}function ch(t){return JSON.stringify(t,(e,n)=>J_(n)?Object.keys(n).sort().reduce((r,s)=>(r[s]=n[s],r),{}):n)}function ed(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(!ed(t[r],e[r]))return!1;return!0}const n=Object.keys(e);for(const r of n)if(!ed(t[r],e[r]))return!1;return!0}return!1}const oj=Object.prototype.hasOwnProperty;function n5(t,e,n=0){if(t===e)return t;if(n>500)return e;const r=m8(t)&&m8(e);if(!r&&!(J_(t)&&J_(e)))return e;const s=(r?t:Object.keys(t)).length,i=r?e:Object.keys(e),o=i.length,l=r?new Array(o):{};let u=0;for(let d=0;d<o;d++){const f=r?d:i[d],h=t[f],g=e[f];if(h===g){l[f]=h,(r?d<s:oj.call(t,f))&&u++;continue}if(h===null||g===null||typeof h!="object"||typeof g!="object"){l[f]=g;continue}const v=n5(h,g,n+1);l[f]=v,v===h&&u++}return s===o&&u===s?t:l}function ay(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 m8(t){return Array.isArray(t)&&t.length===Object.keys(t).length}function J_(t){if(!g8(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!(!g8(r)||!r.hasOwnProperty("isPrototypeOf")||e!==Object.prototype)}function g8(t){return Object.prototype.toString.call(t)==="[object Object]"}function aj(t){return new Promise(e=>{ql.setTimeout(e,t)})}function e2(t,e,n){return typeof n.structuralSharing=="function"?n.structuralSharing(t,e):n.structuralSharing!==!1?n5(t,e):e}function lj(t,e,n=0){const r=[...t,e];return n&&r.length>n?r.slice(1):r}function cj(t,e,n=0){const r=[e,...t];return n&&r.length>n?r.slice(0,-1):r}const Cx=Symbol();function r5(t,e){return!t.queryFn&&(e!=null&&e.initialPromise)?()=>e.initialPromise:!t.queryFn||t.queryFn===Cx?()=>Promise.reject(new Error(`Missing queryFn: '${t.queryHash}'`)):t.queryFn}function s5(t,e){return typeof t=="function"?t(...e):!!t}function uj(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 dj=()=>sj;const Px=()=>dj();var Qh=class{constructor(){this.listeners=new Set,this.subscribe=this.subscribe.bind(this)}subscribe(t){return this.listeners.add(t),this.onSubscribe(),()=>{this.listeners.delete(t),this.onUnsubscribe()}}hasListeners(){return this.listeners.size>0}onSubscribe(){}onUnsubscribe(){}},Xl,Ra,Hu,zP,fj=(zP=class extends Qh{constructor(){super();rt(this,Xl);rt(this,Ra);rt(this,Hu);Re(this,Hu,e=>{if(typeof window<"u"&&window.addEventListener){const n=()=>e();return window.addEventListener("visibilitychange",n,!1),()=>{window.removeEventListener("visibilitychange",n)}}})}onSubscribe(){W(this,Ra)||this.setEventListener(W(this,Hu))}onUnsubscribe(){var e;this.hasListeners()||((e=W(this,Ra))==null||e.call(this),Re(this,Ra,void 0))}setEventListener(e){var n;Re(this,Hu,e),(n=W(this,Ra))==null||n.call(this),Re(this,Ra,e(r=>{typeof r=="boolean"?this.setFocused(r):this.onFocus()}))}setFocused(e){W(this,Xl)!==e&&(Re(this,Xl,e),this.onFocus())}onFocus(){const e=this.isFocused();this.listeners.forEach(n=>{n(e)})}isFocused(){var e;return typeof W(this,Xl)=="boolean"?W(this,Xl):((e=globalThis.document)==null?void 0:e.visibilityState)!=="hidden"}},Xl=new WeakMap,Ra=new WeakMap,Hu=new WeakMap,zP);const Ax=new fj,hj=rj;function pj(){let t=[],e=0,n=l=>{l()},r=l=>{l()},s=hj;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 pr=pj();var zu,Ma,Uu,UP,mj=(UP=class extends Qh{constructor(){super();rt(this,zu,!0);rt(this,Ma);rt(this,Uu);Re(this,Uu,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,Ma)||this.setEventListener(W(this,Uu))}onUnsubscribe(){var e;this.hasListeners()||((e=W(this,Ma))==null||e.call(this),Re(this,Ma,void 0))}setEventListener(e){var n;Re(this,Uu,e),(n=W(this,Ma))==null||n.call(this),Re(this,Ma,e(this.setOnline.bind(this)))}setOnline(e){W(this,zu)!==e&&(Re(this,zu,e),this.listeners.forEach(n=>{n(e)}))}isOnline(){return W(this,zu)}},zu=new WeakMap,Ma=new WeakMap,Uu=new WeakMap,UP);const Im=new mj;function gj(t){return Math.min(1e3*2**t,3e4)}function i5(t){return(t??"online")==="online"?Im.isOnline():!0}var t2=class extends Error{constructor(t){super("CancelledError"),this.revert=t==null?void 0:t.revert,this.silent=t==null?void 0:t.silent}};function o5(t){let e=!1,n=0,r,s="pending",i,o;const l=new Promise((k,C)=>{i=k,o=C});l.catch(Kr);const u=()=>s!=="pending",d=k=>{var C;if(!u()){const A=new t2(k);_(A),(C=t.onCancel)==null||C.call(t,A)}},f=()=>{e=!0},h=()=>{e=!1},g=()=>Ax.isFocused()&&(t.networkMode==="always"||Im.isOnline())&&t.canRun(),v=()=>i5(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=A=>{(u()||g())&&k(A)},(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(A){k=Promise.reject(A)}Promise.resolve(k).then(w).catch(A=>{var O;if(u())return;const T=t.retry??(Px()?0:3),I=t.retryDelay??gj,M=typeof I=="function"?I(n,A):I,R=T===!0||typeof T=="number"&&n<T||typeof T=="function"&&T(n,A);if(e||!R){_(A);return}n++,(O=t.onFail)==null||O.call(t,n,A),aj(M).then(()=>g()?void 0:x()).then(()=>{e?_(A):S()})})};return{promise:l,status:()=>s,cancel:d,continue:()=>(r==null||r(),l),cancelRetry:f,continueRetry:h,canStart:v,start:()=>(v()?S():x().then(S),l)}}var Ql,BP,a5=(BP=class{constructor(){rt(this,Ql)}destroy(){this.clearGcTimeout()}scheduleGc(){this.clearGcTimeout(),e5(this.gcTime)&&Re(this,Ql,ql.setTimeout(()=>{this.optionalRemove()},this.gcTime))}updateGcTime(t){this.gcTime=Math.max(this.gcTime||0,t??(Px()?1/0:3e5))}clearGcTimeout(){W(this,Ql)!==void 0&&(ql.clearTimeout(W(this,Ql)),Re(this,Ql,void 0))}},Ql=new WeakMap,BP);function vj(t){return{onFetch:(e,n)=>{var f,h,g,v,w;const r=e.options,s=(g=(h=(f=e.fetchOptions)==null?void 0:f.meta)==null?void 0:h.fetchMore)==null?void 0:g.direction,i=((v=e.state.data)==null?void 0:v.pages)||[],o=((w=e.state.data)==null?void 0:w.pageParams)||[];let l={pages:[],pageParams:[]},u=0;const d=async()=>{let _=!1;const x=C=>{uj(C,()=>e.signal,()=>_=!0)},S=r5(e.options,e.fetchOptions),k=async(C,A,T)=>{if(_)return Promise.reject(e.signal.reason);if(A==null&&C.pages.length)return Promise.resolve(C);const M=(()=>{const D={client:e.client,queryKey:e.queryKey,pageParam:A,direction:T?"backward":"forward",meta:e.options.meta};return x(D),D})(),R=await S(M),{maxPages:O}=e.options,N=T?cj:lj;return{pages:N(C.pages,R,O),pageParams:N(C.pageParams,A,O)}};if(s&&i.length){const C=s==="backward",A=C?yj:v8,T={pages:i,pageParams:o};l=await k(T,A(r,T),C)}else{const C=t??i.length;do{const A=u===0?o[0]??r.initialPageParam:v8(r,l);if(u>0&&A==null)break;l=await k(l,A),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 v8(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 yj(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 Bu,Jl,Zu,Zs,ec,Yn,Wh,tc,vi,Eo,ZP,_j=(ZP=class extends a5{constructor(e){super();rt(this,vi);rt(this,Bu);rt(this,Jl);rt(this,Zu);rt(this,Zs);rt(this,ec);rt(this,Yn);rt(this,Wh);rt(this,tc);Re(this,tc,!1),Re(this,Wh,e.defaultOptions),this.setOptions(e.options),this.observers=[],Re(this,ec,e.client),Re(this,Zs,W(this,ec).getQueryCache()),this.queryKey=e.queryKey,this.queryHash=e.queryHash,Re(this,Jl,_8(this.options)),this.state=e.state??W(this,Jl),this.scheduleGc()}get meta(){return this.options.meta}get queryType(){return W(this,Bu)}get promise(){var e;return(e=W(this,Yn))==null?void 0:e.promise}setOptions(e){if(this.options={...W(this,Wh),...e},e!=null&&e._type&&Re(this,Bu,e._type),this.updateGcTime(this.options.gcTime),this.state&&this.state.data===void 0){const n=_8(this.options);n.data!==void 0&&(this.setState(y8(n.data,n.dataUpdatedAt)),Re(this,Jl,n))}}optionalRemove(){!this.observers.length&&this.state.fetchStatus==="idle"&&W(this,Zs).remove(this)}setData(e,n){const r=e2(this.state.data,e,this.options);return wt(this,vi,Eo).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,vi,Eo).call(this,{type:"setState",state:e})}cancel(e){var r,s;const n=(r=W(this,Yn))==null?void 0:r.promise;return(s=W(this,Yn))==null||s.cancel(e),n?n.then(Kr).catch(Kr):Promise.resolve()}destroy(){super.destroy(),this.cancel({silent:!0})}get resetState(){return W(this,Jl)}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===Cx||!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:!t5(this.state.dataUpdatedAt,e)}onFocus(){var e,n;(e=this.observers.find(r=>r.shouldFetchOnWindowFocus()))==null||e.refetch({cancelRefetch:!1}),(n=W(this,Yn))==null||n.continue()}onOnline(){var e,n;(e=this.observers.find(r=>r.shouldFetchOnReconnect()))==null||e.refetch({cancelRefetch:!1}),(n=W(this,Yn))==null||n.continue()}addObserver(e){this.observers.includes(e)||(this.observers.push(e),this.clearGcTimeout(),W(this,Zs).notify({type:"observerAdded",query:this,observer:e}))}removeObserver(e){const n=this.observers.indexOf(e);n!==-1&&(this.observers.splice(n,1),this.observers.length||(W(this,Yn)&&(W(this,tc)||this.state.fetchStatus==="paused"&&this.state.status==="pending"?W(this,Yn).cancel({revert:!0}):W(this,Yn).cancelRetry()),this.scheduleGc()),W(this,Zs).notify({type:"observerRemoved",query:this,observer:e}))}getObserversCount(){return this.observers.length}invalidate(){this.state.isInvalidated||wt(this,vi,Eo).call(this,{type:"invalidate"})}async fetch(e,n){var d,f,h,g,v,w,_,x,S,k,C,A;if(this.state.fetchStatus!=="idle"&&((d=W(this,Yn))==null?void 0:d.status())!=="rejected"){if(this.state.data!==void 0&&(n!=null&&n.cancelRefetch))this.cancel({silent:!0});else if(W(this,Yn))return W(this,Yn).continueRetry(),W(this,Yn).promise}if(e&&this.setOptions(e),!this.options.queryFn){const T=this.observers.find(I=>I.options.queryFn);T&&this.setOptions(T.options)}const r=new AbortController,s=T=>{Object.defineProperty(T,"signal",{enumerable:!0,get:()=>(Re(this,tc,!0),r.signal)})},i=()=>{const T=r5(this.options,n),M=(()=>{const R={client:W(this,ec),queryKey:this.queryKey,meta:this.meta};return s(R),R})();return Re(this,tc,!1),this.options.persister?this.options.persister(T,M,this):T(M)},l=(()=>{const T={fetchOptions:n,options:this.options,queryKey:this.queryKey,client:W(this,ec),state:this.state,fetchFn:i};return s(T),T})();(f=W(this,Bu)==="infinite"?vj(this.options.pages):this.options.behavior)==null||f.onFetch(l,this),Re(this,Zu,this.state),(this.state.fetchStatus==="idle"||this.state.fetchMeta!==((h=l.fetchOptions)==null?void 0:h.meta))&&wt(this,vi,Eo).call(this,{type:"fetch",meta:(g=l.fetchOptions)==null?void 0:g.meta});const u=Re(this,Yn,o5({initialPromise:n==null?void 0:n.initialPromise,fn:l.fetchFn,onCancel:T=>{T instanceof t2&&T.revert&&this.setState({...W(this,Zu),fetchStatus:"idle"}),r.abort()},onFail:(T,I)=>{wt(this,vi,Eo).call(this,{type:"failed",failureCount:T,error:I})},onPause:()=>{wt(this,vi,Eo).call(this,{type:"pause"})},onContinue:()=>{wt(this,vi,Eo).call(this,{type:"continue"})},retry:l.options.retry,retryDelay:l.options.retryDelay,networkMode:l.options.networkMode,canRun:()=>!0}));try{const T=await u.start();if(T===void 0)throw new Error(`${this.queryHash} data is undefined`);return this.setData(T),(w=(v=W(this,Zs).config).onSuccess)==null||w.call(v,T,this),(x=(_=W(this,Zs).config).onSettled)==null||x.call(_,T,this.state.error,this),T}catch(T){if(T instanceof t2){if(T.silent)return W(this,Yn).promise;if(T.revert){if(this.state.data===void 0)throw T;return this.state.data}}throw wt(this,vi,Eo).call(this,{type:"error",error:T}),(k=(S=W(this,Zs).config).onError)==null||k.call(S,T,this),(A=(C=W(this,Zs).config).onSettled)==null||A.call(C,this.state.data,T,this),T}finally{W(this,Yn)===u&&Re(this,Yn,void 0),this.scheduleGc()}}},Bu=new WeakMap,Jl=new WeakMap,Zu=new WeakMap,Zs=new WeakMap,ec=new WeakMap,Yn=new WeakMap,Wh=new WeakMap,tc=new WeakMap,vi=new WeakSet,Eo=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,...l5(r.data,this.options),fetchMeta:e.meta??null};case"success":const s={...r,...y8(e.data,e.dataUpdatedAt),dataUpdateCount:r.dataUpdateCount+1,...!e.manual&&{fetchStatus:"idle",fetchFailureCount:0,fetchFailureReason:null}};return Re(this,Zu,e.manual?s:void 0),s;case"error":const i=e.error;return{...r,error:i,errorUpdateCount:r.errorUpdateCount+1,errorUpdatedAt:Date.now(),fetchFailureCount:r.fetchFailureCount+1,fetchFailureReason:i,fetchStatus:"idle",status:"error",isInvalidated:!0};case"invalidate":return{...r,isInvalidated:!0};case"setState":return{...r,...e.state}}};this.state=n(this.state),pr.batch(()=>{this.observers.slice().forEach(r=>{r.onQueryUpdate()}),W(this,Zs).notify({query:this,type:"updated",action:e})})},ZP);function l5(t,e){return{fetchFailureCount:0,fetchFailureReason:null,fetchStatus:i5(e.networkMode)?"fetching":"paused",...t===void 0&&{error:null,status:"pending"}}}function y8(t,e){return{data:t,dataUpdatedAt:e??Date.now(),error:null,isInvalidated:!1,status:"success"}}function _8(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 Or,St,qh,Lr,nc,Wu,Oo,Gh,qu,Gu,rc,sc,Ia,Ku,$t,If,n2,r2,s2,i2,o2,a2,l2,c2,WP,wj=(WP=class extends Qh{constructor(e,n){super();rt(this,$t);rt(this,Or);rt(this,St);rt(this,qh);rt(this,Lr);rt(this,nc);rt(this,Wu);rt(this,Oo);rt(this,Gh);rt(this,qu);rt(this,Gu);rt(this,rc);rt(this,sc);rt(this,Ia);rt(this,Ku,new Set);this.options=n,Re(this,Or,e),Re(this,Oo,null),this.bindMethods(),this.setOptions(n)}bindMethods(){this.refetch=this.refetch.bind(this)}onSubscribe(){this.listeners.size===1&&(W(this,St).addObserver(this),w8(W(this,St),this.options)?wt(this,$t,If).call(this):this.updateResult(),wt(this,$t,o2).call(this))}onUnsubscribe(){this.hasListeners()||this.destroy()}shouldFetchOnReconnect(){return u2(W(this,St),this.options,this.options.refetchOnReconnect)}shouldFetchOnWindowFocus(){return u2(W(this,St),this.options,this.options.refetchOnWindowFocus)}destroy(){this.listeners=new Set,wt(this,$t,a2).call(this),wt(this,$t,l2).call(this),W(this,St).removeObserver(this)}setOptions(e){const n=this.options,r=W(this,St);if(this.options=W(this,Or).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,c2).call(this),W(this,St).setOptions(this.options),n._defaulted&&!ay(this.options,n)&&W(this,Or).getQueryCache().notify({type:"observerOptionsUpdated",query:W(this,St),observer:this});const s=this.hasListeners();s&&x8(W(this,St),r,this.options,n)&&wt(this,$t,If).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,r2).call(this);const i=wt(this,$t,s2).call(this);s&&(W(this,St)!==r||hn(this.options.enabled,W(this,St))!==hn(n.enabled,W(this,St))||i!==W(this,Ia))&&wt(this,$t,i2).call(this,i)}getOptimisticResult(e){const n=W(this,Or).getQueryCache().build(W(this,Or),e),r=this.createResult(n,e);return ay(this.getCurrentResult(),r)||(Re(this,Lr,r),Re(this,Wu,this.options),Re(this,nc,W(this,St).state)),r}getCurrentResult(){return W(this,Lr)}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,Ku).add(e)}getCurrentQuery(){return W(this,St)}refetch({...e}={}){return this.fetch({...e})}fetchOptimistic(e){const n=W(this,Or).defaultQueryOptions(e),r=W(this,Or).getQueryCache().build(W(this,Or),n);let s=()=>{},i;const o=new Promise(l=>{i=l,s=W(this,Or).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,If).call(this,{...e,cancelRefetch:e.cancelRefetch??!0}).then(()=>(this.updateResult(),W(this,Lr)))}createResult(e,n){var I;const r=W(this,St),s=this.options,i=W(this,Lr),o=W(this,nc),l=W(this,Wu),u=e!==r?e.state:W(this,qh),{state:d}=e;let f={...d},h=!1,g;if(n._optimisticResults){const M=this.hasListeners(),R=!M&&w8(e,n),O=M&&x8(e,r,n,s);(R||O)&&(f={...f,...l5(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,Gu))==null?void 0:I.state.data,W(this,Gu)):n.placeholderData,M!==void 0&&(_="success",g=e2(i==null?void 0:i.data,M,n),h=!0)}if(n.select&&g!==void 0&&!x)if(i&&g===(o==null?void 0:o.data)&&n.select===W(this,Gh))g=W(this,qu);else try{Re(this,Gh,n.select),g=n.select(g),g=e2(i==null?void 0:i.data,g,n),Re(this,qu,g),Re(this,Oo,null)}catch(M){Re(this,Oo,M)}else g===void 0&&Re(this,Oo,null);W(this,Oo)&&(v=W(this,Oo),g=W(this,qu),w=Date.now(),_="error",h=!1);const S=f.fetchStatus==="fetching",k=_==="pending",C=_==="error",A=k&&S,T=g!==void 0;return{status:_,fetchStatus:f.fetchStatus,isPending:k,isSuccess:_==="success",isError:C,isInitialLoading:A,isLoading:A,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&&!T,isPaused:f.fetchStatus==="paused",isPlaceholderData:h,isRefetchError:C&&T,isStale:Tx(e,n),refetch:this.refetch,isEnabled:hn(n.enabled,e)!==!1}}updateResult(){const e=W(this,Lr),n=this.createResult(W(this,St),this.options);if(Re(this,nc,W(this,St).state),Re(this,Wu,this.options),W(this,nc).data!==void 0&&Re(this,Gu,W(this,St)),ay(n,e))return;Re(this,Lr,n);const s=(()=>{if(!e)return!0;const{notifyOnChangeProps:i}=this.options,o=typeof i=="function"?i():i;if(o==="all"||!o&&!W(this,Ku).size)return!0;const l=new Set(o??W(this,Ku));return this.options.throwOnError&&l.add("error"),Object.keys(W(this,Lr)).some(u=>{const d=u;return W(this,Lr)[d]!==e[d]&&l.has(d)})})();pr.batch(()=>{s&&this.listeners.forEach(i=>{i(W(this,Lr))}),W(this,Or).getQueryCache().notify({query:W(this,St),type:"observerResultsUpdated"})})}onQueryUpdate(){this.updateResult(),this.hasListeners()&&wt(this,$t,o2).call(this)}},Or=new WeakMap,St=new WeakMap,qh=new WeakMap,Lr=new WeakMap,nc=new WeakMap,Wu=new WeakMap,Oo=new WeakMap,Gh=new WeakMap,qu=new WeakMap,Gu=new WeakMap,rc=new WeakMap,sc=new WeakMap,Ia=new WeakMap,Ku=new WeakMap,$t=new WeakSet,If=function(e){wt(this,$t,c2).call(this);let n=W(this,St).fetch(this.options,e);return e!=null&&e.throwOnError||(n=n.catch(Kr)),n},n2=function(e){return!Px()&&hn(this.options.enabled,W(this,St))!==!1&&e5(e)},r2=function(){wt(this,$t,a2).call(this);const e=hn(this.options.staleTime,W(this,St));if(W(this,Lr).isStale||!wt(this,$t,n2).call(this,e))return;const n=t5(W(this,Lr).dataUpdatedAt,e)+1;Re(this,rc,ql.setTimeout(()=>{W(this,Lr).isStale||this.updateResult()},n))},s2=function(){return hn(this.options.refetchInterval,W(this,St))??!1},i2=function(e){wt(this,$t,l2).call(this),Re(this,Ia,e),!(W(this,Ia)===0||!wt(this,$t,n2).call(this,W(this,Ia)))&&Re(this,sc,ql.setInterval(()=>{(this.options.refetchIntervalInBackground||Ax.isFocused())&&wt(this,$t,If).call(this)},W(this,Ia)))},o2=function(){wt(this,$t,r2).call(this),wt(this,$t,i2).call(this,wt(this,$t,s2).call(this))},a2=function(){W(this,rc)!==void 0&&(ql.clearTimeout(W(this,rc)),Re(this,rc,void 0))},l2=function(){W(this,sc)!==void 0&&(ql.clearInterval(W(this,sc)),Re(this,sc,void 0))},c2=function(){const e=W(this,Or).getQueryCache().build(W(this,Or),this.options);if(e===W(this,St))return;const n=W(this,St);Re(this,St,e),Re(this,qh,e.state),this.hasListeners()&&(n==null||n.removeObserver(this),e.addObserver(this))},WP);function xj(t,e){return hn(e.enabled,t)!==!1&&t.state.data===void 0&&!(t.state.status==="error"&&hn(e.retryOnMount,t)===!1)}function w8(t,e){return xj(t,e)||t.state.data!==void 0&&u2(t,e,e.refetchOnMount)}function u2(t,e,n){if(hn(e.enabled,t)!==!1&&hn(e.staleTime,t)!=="static"){const r=hn(n,t);return r==="always"||r!==!1&&Tx(t,e)}return!1}function x8(t,e,n,r){return(t!==e||hn(r.enabled,t)===!1)&&(!n.suspense||t.state.status!=="error")&&Tx(t,n)}function Tx(t,e){return hn(e.enabled,t)!==!1&&t.isStaleByTime(hn(e.staleTime,t))}var Kh,Vi,kr,ic,Hi,Ea,qP,bj=(qP=class extends a5{constructor(e){super();rt(this,Hi);rt(this,Kh);rt(this,Vi);rt(this,kr);rt(this,ic);Re(this,Kh,e.client),this.mutationId=e.mutationId,Re(this,kr,e.mutationCache),Re(this,Vi,[]),this.state=e.state||Sj(),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,Vi).includes(e)||(W(this,Vi).push(e),this.clearGcTimeout(),W(this,kr).notify({type:"observerAdded",mutation:this,observer:e}))}removeObserver(e){Re(this,Vi,W(this,Vi).filter(n=>n!==e)),this.scheduleGc(),W(this,kr).notify({type:"observerRemoved",mutation:this,observer:e})}optionalRemove(){W(this,Vi).length||(this.state.status==="pending"?this.scheduleGc():W(this,kr).remove(this))}continue(){var e;return((e=W(this,ic))==null?void 0:e.continue())??(this.state.status==="pending"?this.execute(this.state.variables):Promise.resolve())}async execute(e){var l,u,d,f,h,g,v,w,_,x,S,k,C,A,T,I,M,R;const n=()=>{wt(this,Hi,Ea).call(this,{type:"continue"})},r={client:W(this,Kh),meta:this.options.meta,mutationKey:this.options.mutationKey},s=Re(this,ic,o5({fn:()=>this.options.mutationFn?this.options.mutationFn(e,r):Promise.reject(new Error("No mutationFn found")),onFail:(O,N)=>{wt(this,Hi,Ea).call(this,{type:"failed",failureCount:O,error:N})},onPause:()=>{wt(this,Hi,Ea).call(this,{type:"pause"})},onContinue:n,retry:this.options.retry??0,retryDelay:this.options.retryDelay,networkMode:this.options.networkMode,canRun:()=>W(this,kr).canRun(this)})),i=this.state.status==="pending",o=!s.canStart();try{if(i)n();else{wt(this,Hi,Ea).call(this,{type:"pending",variables:e,isPaused:o}),W(this,kr).config.onMutate&&await W(this,kr).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,Hi,Ea).call(this,{type:"pending",context:N,variables:e,isPaused:o})}const O=await s.start();return await((f=(d=W(this,kr).config).onSuccess)==null?void 0:f.call(d,O,e,this.state.context,this,r)),await((g=(h=this.options).onSuccess)==null?void 0:g.call(h,O,e,this.state.context,r)),await((w=(v=W(this,kr).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,Hi,Ea).call(this,{type:"success",data:O}),O}catch(O){try{await((k=(S=W(this,kr).config).onError)==null?void 0:k.call(S,O,e,this.state.context,this,r))}catch(N){Promise.reject(N)}try{await((A=(C=this.options).onError)==null?void 0:A.call(C,O,e,this.state.context,r))}catch(N){Promise.reject(N)}try{await((I=(T=W(this,kr).config).onSettled)==null?void 0:I.call(T,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,Hi,Ea).call(this,{type:"error",error:O}),O}finally{W(this,ic)===s&&Re(this,ic,void 0),W(this,kr).runNext(this)}}},Kh=new WeakMap,Vi=new WeakMap,kr=new WeakMap,ic=new WeakMap,Hi=new WeakSet,Ea=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),pr.batch(()=>{W(this,Vi).forEach(r=>{r.onMutationUpdate(e)}),W(this,kr).notify({mutation:this,type:"updated",action:e})})},qP);function Sj(){return{context:void 0,data:void 0,error:null,failureCount:0,failureReason:null,isPaused:!1,status:"idle",variables:void 0,submittedAt:0}}var Lo,yi,Yh,GP,kj=(GP=class extends Qh{constructor(e={}){super();rt(this,Lo);rt(this,yi);rt(this,Yh);this.config=e,Re(this,Lo,new Set),Re(this,yi,new Map),Re(this,Yh,0)}build(e,n,r){const s=new bj({client:e,mutationCache:this,mutationId:++_0(this,Yh)._,options:e.defaultMutationOptions(n),state:r});return this.add(s),s}add(e){W(this,Lo).add(e);const n=w0(e);if(typeof n=="string"){const r=W(this,yi).get(n);r?r.push(e):W(this,yi).set(n,[e])}this.notify({type:"added",mutation:e})}remove(e){if(W(this,Lo).delete(e)){const n=w0(e);if(typeof n=="string"){const r=W(this,yi).get(n);if(r)if(r.length>1){const s=r.indexOf(e);s!==-1&&r.splice(s,1)}else r[0]===e&&W(this,yi).delete(n)}}this.notify({type:"removed",mutation:e})}canRun(e){var r;const n=w0(e);if(typeof n=="string"){const s=(r=W(this,yi).get(n))==null?void 0:r.find(i=>i.state.status==="pending");return!s||s===e}else return!0}runNext(e){var r,s;const n=w0(e);return typeof n=="string"?((s=(r=W(this,yi).get(n))==null?void 0:r.find(i=>i!==e&&i.state.isPaused))==null?void 0:s.continue())??Promise.resolve():Promise.resolve()}clear(){pr.batch(()=>{W(this,Lo).forEach(e=>{this.notify({type:"removed",mutation:e})}),W(this,Lo).clear(),W(this,yi).clear()})}getAll(){return Array.from(W(this,Lo))}find(e){const n={exact:!0,...e};return this.getAll().find(r=>p8(n,r))}findAll(e={}){return this.getAll().filter(n=>p8(e,n))}notify(e){pr.batch(()=>{this.listeners.forEach(n=>{n(e)})})}resumePausedMutations(){const e=this.getAll().filter(n=>n.state.isPaused);return pr.batch(()=>Promise.all(e.map(n=>n.continue().catch(Kr))))}},Lo=new WeakMap,yi=new WeakMap,Yh=new WeakMap,GP);function w0(t){var e;return(e=t.options.scope)==null?void 0:e.id}var zi,KP,Ej=(KP=class extends Qh{constructor(e={}){super();rt(this,zi);this.config=e,Re(this,zi,new Map)}build(e,n,r){const s=n.queryKey,i=n.queryHash??Ex(s,n);let o=this.get(i);return o||(o=new _j({client:e,queryKey:s,queryHash:i,options:e.defaultQueryOptions(n),state:r,defaultOptions:e.getQueryDefaults(s)}),this.add(o)),o}add(e){W(this,zi).has(e.queryHash)||(W(this,zi).set(e.queryHash,e),this.notify({type:"added",query:e}))}remove(e){W(this,zi).get(e.queryHash)===e&&(e.destroy(),W(this,zi).delete(e.queryHash),this.notify({type:"removed",query:e}))}clear(){pr.batch(()=>{this.getAll().forEach(e=>{this.remove(e)})})}get(e){return W(this,zi).get(e)}getAll(){return[...W(this,zi).values()]}find(e){const n={exact:!0,...e};return this.getAll().find(r=>h8(n,r))}findAll(e={}){const n=this.getAll();return Object.keys(e).length>0?n.filter(r=>h8(e,r)):n}notify(e){pr.batch(()=>{this.listeners.forEach(n=>{n(e)})})}onFocus(){pr.batch(()=>{this.getAll().forEach(e=>{e.onFocus()})})}onOnline(){pr.batch(()=>{this.getAll().forEach(e=>{e.onOnline()})})}},zi=new WeakMap,KP),xn,Oa,La,Yu,Xu,Na,Qu,Ju,YP,Cj=(YP=class{constructor(t={}){rt(this,xn);rt(this,Oa);rt(this,La);rt(this,Yu);rt(this,Xu);rt(this,Na);rt(this,Qu);rt(this,Ju);Re(this,xn,t.queryCache||new Ej),Re(this,Oa,t.mutationCache||new kj),Re(this,La,t.defaultOptions||{}),Re(this,Yu,new Map),Re(this,Xu,new Map),Re(this,Na,0)}mount(){_0(this,Na)._++,W(this,Na)===1&&(Re(this,Qu,Ax.subscribe(async t=>{t&&(await this.resumePausedMutations(),W(this,xn).onFocus())})),Re(this,Ju,Im.subscribe(async t=>{t&&(await this.resumePausedMutations(),W(this,xn).onOnline())})))}unmount(){var t,e;_0(this,Na)._--,W(this,Na)===0&&((t=W(this,Qu))==null||t.call(this),Re(this,Qu,void 0),(e=W(this,Ju))==null||e.call(this),Re(this,Ju,void 0))}isFetching(t){return W(this,xn).findAll({...t,fetchStatus:"fetching"}).length}isMutating(t){return W(this,Oa).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=ij(e,s);if(i!==void 0)return W(this,xn).build(this,r).setData(i,{...n,manual:!0})}setQueriesData(t,e,n){return pr.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);pr.batch(()=>{e.findAll(t).forEach(n=>{e.remove(n)})})}resetQueries(t,e){const n=W(this,xn);return pr.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=pr.batch(()=>W(this,xn).findAll(t).map(s=>s.cancel(n)));return Promise.all(r).then(Kr).catch(Kr)}invalidateQueries(t,e={}){return pr.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=pr.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(Kr)),s.state.fetchStatus==="paused"?Promise.resolve():i}));return Promise.all(r).then(Kr)}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(Kr).catch(Kr)}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(Kr).catch(Kr)}ensureInfiniteQueryData(t){return t._type="infinite",this.ensureQueryData(t)}resumePausedMutations(){return Im.isOnline()?W(this,Oa).resumePausedMutations():Promise.resolve()}getQueryCache(){return W(this,xn)}getMutationCache(){return W(this,Oa)}getDefaultOptions(){return W(this,La)}setDefaultOptions(t){Re(this,La,t)}setQueryDefaults(t,e){W(this,Yu).set(ch(t),{queryKey:t,defaultOptions:e})}getQueryDefaults(t){const e=[...W(this,Yu).values()],n={};return e.forEach(r=>{ed(t,r.queryKey)&&Object.assign(n,r.defaultOptions)}),n}setMutationDefaults(t,e){W(this,Xu).set(ch(t),{mutationKey:t,defaultOptions:e})}getMutationDefaults(t){const e=[...W(this,Xu).values()],n={};return e.forEach(r=>{ed(t,r.mutationKey)&&Object.assign(n,r.defaultOptions)}),n}defaultQueryOptions(t){if(t._defaulted)return t;const e={...W(this,La).queries,...this.getQueryDefaults(t.queryKey),...t,_defaulted:!0};return e.queryHash||(e.queryHash=Ex(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===Cx&&(e.enabled=!1),e}defaultMutationOptions(t){return t!=null&&t._defaulted?t:{...W(this,La).mutations,...(t==null?void 0:t.mutationKey)&&this.getMutationDefaults(t.mutationKey),...t,_defaulted:!0}}clear(){W(this,xn).clear(),W(this,Oa).clear()}},xn=new WeakMap,Oa=new WeakMap,La=new WeakMap,Yu=new WeakMap,Xu=new WeakMap,Na=new WeakMap,Qu=new WeakMap,Ju=new WeakMap,YP);const c5=m.createContext(!1),Pj=()=>m.useContext(c5);c5.Provider;function Aj(){let t=!1;return{clearReset:()=>{t=!1},reset:()=>{t=!0},isReset:()=>t}}const Tj=m.createContext(Aj()),Rj=()=>m.useContext(Tj),Mj=(t,e,n)=>{const r=n!=null&&n.state.error&&typeof t.throwOnError=="function"?s5(t.throwOnError,[n.state.error,n]):t.throwOnError;(t.suspense||r)&&(e.isReset()||(t.retryOnMount=!1))},Ij=t=>{m.useEffect(()=>{t.clearReset()},[t])},Oj=({result:t,errorResetBoundary:e,throwOnError:n,query:r,suspense:s})=>t.isError&&!e.isReset()&&!t.isFetching&&r&&(s&&t.data===void 0||s5(n,[t.error,r])),Lj=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))}},Nj=(t,e)=>(t==null?void 0:t.suspense)&&e.isPending,Dj=(t,e,n)=>e.fetchOptimistic(t).catch(()=>{n.clearReset()});function jj(t,e,n){const r=Pj(),s=Rj(),i=JP(),o=i.defaultQueryOptions(t),l=i.getQueryCache().get(o.queryHash),u=t.subscribed!==!1;o._optimisticResults=r?"isRestoring":u?"optimistic":void 0,Lj(o),Mj(o,s,l),Ij(s);const[d]=m.useState(()=>new e(i,o)),f=d.getOptimisticResult(o),h=!r&&u;if(m.useSyncExternalStore(m.useCallback(g=>{const v=h?d.subscribe(pr.batchCalls(g)):Kr;return d.updateResult(),v},[d,h]),()=>d.getCurrentResult(),()=>d.getCurrentResult()),m.useEffect(()=>{d.setOptions(o)},[o,d]),Nj(o,f))throw Dj(o,d,s);if(Oj({result:f,errorResetBoundary:s,throwOnError:o.throwOnError,query:l,suspense:o.suspense}))throw f.error;return o.notifyOnChangeProps?f:d.trackResult(f)}function uh(t,e){return jj(t,wj)}const ee="u">typeof window?window:void 0,Pr="u">typeof globalThis?globalThis:ee,Qn=Pr==null?void 0:Pr.navigator,he=Pr==null?void 0:Pr.document,Wt=Pr==null?void 0:Pr.location,dh=Pr==null?void 0:Pr.fetch,Rx=Pr!=null&&Pr.XMLHttpRequest&&"withCredentials"in new Pr.XMLHttpRequest?Pr.XMLHttpRequest:void 0,b8=Pr==null?void 0:Pr.AbortController,$j=Pr==null?void 0:Pr.CompressionStream,Nr=Qn==null?void 0:Qn.userAgent,vf=typeof globalThis<"u"?globalThis:ee;vf&&typeof self>"u"&&(vf.self=vf),vf&&typeof File>"u"&&(vf.File=function(){});const $e=ee??{},Fj="0.9.2",$o={DEBUG:!1,LIB_VERSION:Fj,LIB_NAME:"browser-common"};var ji=(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})({}),d2=(function(t){return t.GZipJS="gzip-js",t.Base64="base64",t})({});const Vj=["$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"],Hj=["token"];function ze(t,e){return t.indexOf(e)!==-1}const td=function(t){return t.trim()},f2=function(t){return t.replace(/^\$/,"")};function u5(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 d5=Object.prototype,Mx=d5.hasOwnProperty,Hg=d5.toString,Ue=Array.isArray||function(t){return Hg.call(t)==="[object Array]"},Ln=t=>typeof t=="function",st=t=>t===Object(t)&&!Ue(t),Yr=t=>{if(st(t)){for(const e in t)if(Mx.call(t,e))return!1;return!0}return!1},ce=t=>t===void 0,ct=t=>Hg.call(t)=="[object String]",Hf=t=>ct(t)&&t.trim().length===0,cn=t=>t===null,Je=t=>ce(t)||cn(t),mn=t=>Hg.call(t)=="[object Number]"&&t==t,Co=t=>mn(t)&&t>0,jr=t=>Hg.call(t)==="[object Boolean]",zj=t=>ze(Vj,t),Uj=t=>ze(Hj,t);function f5(t){return t===null||typeof t!="object"}function Om(t,e){return{}.toString.call(t)===`[object ${e}]`}function Sd(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 h5(t,Error)}}function Ix(t){return"u">typeof Event&&h5(t,Event)}function h5(t,e){try{return t instanceof e}catch{return!1}}const Bj=[!0,"true",1,"1","yes"],ly=t=>ze(Bj,t),Zj=[!1,"false",0,"0","no"];function S8(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 Kt(t){return function(){var e=this,n=arguments;return new Promise(function(r,s){var i=t.apply(e,n);function o(u){S8(i,r,s,o,l,"next",u)}function l(u){S8(i,r,s,o,l,"throw",u)}o(void 0)})}}const Wj=["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"],x0=new Map,k8=function(t,e=[]){if(!t)return!1;const n=(function(o,l){let u="";for(let d=0;l.length>d;d++){const f=l[d];u+=f.length+":"+f}return o.length+":"+o+"|"+l.length+":"+u})(t,e),r=x0.get(n);if(r!==void 0)return r;const s=t.toLowerCase(),i=Wj.concat(e).some(o=>s.indexOf(o.toLowerCase())!==-1);return 256>x0.size||x0.clear(),x0.set(n,i),i};function Wi(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),Wi(s??n,e,n,r))}var qj=class{constructor(t){this.C={},this.I=t.I,this.R=Wi(t.bucketSize,0,100,t.A),this.$=Wi(t.refillRate,0,this.R,t.A),this.O=Wi(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 nd="Mobile",fh="Android",Lm="Tablet",p5="Android Tablet",m5="iPad",g5="Apple Watch",nm="Safari",zg="BlackBerry",v5="Samsung Internet",rm="Chrome",y5="Chrome iOS",_5="Internet Explorer",w5="Internet Explorer Mobile",x5="Opera",b5="Microsoft Edge",sm="Firefox",S5="Firefox iOS",Nm="Nintendo",Dm="PlayStation",Ug="Xbox",k5="Android Mobile",E5="Mobile Safari",cy="Windows",C5="Windows Phone",E8="Nokia",h2="Ouya",Gj="Generic "+nd.toLowerCase(),P5="Generic "+Lm.toLowerCase(),p2="Konqueror",A5="Oculus Browser",T5="Vivaldi",R5="Yandex",M5="Whale",I5="DuckDuckGo",O5="Pale Moon",L5="Waterfox",m2="Brave",N5="Claude",D5="Codex",j5="ChatGPT",$5="Google Search App",uy=new RegExp("Version/(\\d+(\\.\\d+)?)"),dy=new RegExp("(Claude|Codex|ChatGPT)\\/(\\d+(\\.\\d+)?)"),Kj=new RegExp(Ug,"i"),Yj=new RegExp("PlayStation \\w+","i"),Xj=new RegExp("Nintendo \\w+","i"),Ox=new RegExp("BlackBerry|PlayBook|BB10","i"),Qj={"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?m2:null})(n)||(r!=null&&r.detectGoogleSearchApp&&ze(t,"GSA/")?$5:ze(t," OPR/")&&ze(t,"Mini")?"Opera Mini":ze(t," OPR/")?x5:Ox.test(t)?zg:ze(t,"IEMobile")||ze(t,"WPDesktop")?w5:ze(t,"OculusBrowser")?A5:ze(t,"SamsungBrowser")?v5:ze(t,"Edge")||ze(t,"Edg/")?b5:ze(t,"Vivaldi/")?T5:ze(t,"YaBrowser/")?R5:ze(t,"Whale/")?M5:ze(t,"DuckDuckGo/")||ze(t,"Ddg/")?I5:ze(t,"Claude/")?N5:ze(t,"Codex/")?D5:ze(t,"ChatGPT/")?j5:ze(t,"FBIOS")?"Facebook Mobile":ze(t,"UCWEB")||ze(t,"UCBrowser")?"UC Browser":ze(t,"CriOS")?y5:ze(t,"CrMo")||ze(t,rm)?rm:ze(t,fh)&&ze(t,nm)?k5:ze(t,"FxiOS")?S5:ze(t.toLowerCase(),p2.toLowerCase())?p2:ze(t,"Brave/")?m2:((i,o)=>o&&ze(o,"Apple")||(function(l){return ze(l,nm)&&!ze(l,rm)&&!ze(l,fh)})(i))(t,e)?ze(t,nd)?E5:nm:ze(t,"PaleMoon/")?O5:ze(t,"Waterfox/")?L5:ze(t,sm)?sm:ze(t,"MSIE")||ze(t,"Trident/")?_5:ze(t,"Gecko")?sm:"")},Jj={[w5]:[new RegExp("rv:(\\d+(\\.\\d+)?)")],[b5]:[new RegExp("Edge?\\/(\\d+(\\.\\d+)?)")],[rm]:[new RegExp("(Chrome|CrMo)\\/(\\d+(\\.\\d+)?)")],[y5]:[new RegExp("CriOS\\/(\\d+(\\.\\d+)?)")],"UC Browser":[new RegExp("(UCBrowser|UCWEB)\\/(\\d+(\\.\\d+)?)")],[nm]:[uy],[E5]:[uy],[x5]:[new RegExp("(Opera|OPR)\\/(\\d+(\\.\\d+)?)")],[sm]:[new RegExp("Firefox\\/(\\d+(\\.\\d+)?)")],[S5]:[new RegExp("FxiOS\\/(\\d+(\\.\\d+)?)")],[p2]:[new RegExp("Konqueror[:/]?(\\d+(\\.\\d+)?)","i")],[zg]:[new RegExp("BlackBerry (\\d+(\\.\\d+)?)"),uy],[k5]:[new RegExp("android\\s(\\d+(\\.\\d+)?)","i")],[v5]:[new RegExp("SamsungBrowser\\/(\\d+(\\.\\d+)?)")],[A5]:[new RegExp("OculusBrowser\\/(\\d+(\\.\\d+)?)")],[T5]:[new RegExp("Vivaldi\\/(\\d+(\\.\\d+)?)")],[R5]:[new RegExp("YaBrowser\\/(\\d+(\\.\\d+)?)")],[M5]:[new RegExp("Whale\\/(\\d+(\\.\\d+)?)")],[m2]:[new RegExp("Brave\\/(\\d+(\\.\\d+)?)")],[N5]:[dy],[D5]:[dy],[j5]:[dy],[I5]:[new RegExp("(DuckDuckGo|Ddg)\\/(\\d+(\\.\\d+)?)")],[O5]:[new RegExp("PaleMoon\\/(\\d+(\\.\\d+)?)")],[L5]:[new RegExp("Waterfox\\/(\\d+(\\.\\d+)?)")],[$5]:[new RegExp("GSA\\/(\\d+(\\.\\d+)?)")],[_5]:[new RegExp("(rv:|MSIE )(\\d+(\\.\\d+)?)")],Mozilla:[new RegExp("rv:(\\d+(\\.\\d+)?)")]},e$=function(t,e,n,r){const s=F5(t,e,n,r),i=Jj[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=>[Ug,t&&t[1]||""]],[new RegExp(Nm,"i"),[Nm,""]],[new RegExp(Dm,"i"),[Dm,""]],[Ox,[zg,""]],[new RegExp(cy,"i"),(t,e)=>{if(/Phone/.test(e)||/WPDesktop/.test(e))return[C5,""];if(new RegExp(nd).test(e)&&!/IEMobile\b/.test(e))return["Windows Mobile",""];const n=/Windows NT ([0-9.]+)/i.exec(e);if(n&&n[1]){let r=Qj[n[1]]||"";return/arm/i.test(e)&&(r="RT"),[cy,r]}return[cy,""]}],[/((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]?[fh,[t[2],t[3],t[4]||"0"].join(".")]:[fh,""]],[/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",""]]],V5=function(t){for(let e=0;C8.length>e;e++){const[n,r]=C8[e],s=n.exec(t),i=s&&(Ln(r)?r(s,t):r);if(i)return i}return["",""]},H5=function(t){return Xj.test(t)?Nm:Yj.test(t)?Dm:Kj.test(t)?Ug:new RegExp(h2,"i").test(t)?h2:new RegExp("(Windows Phone|WPDesktop)","i").test(t)?C5:/iPad/.test(t)?m5:/iPod/.test(t)?"iPod Touch":/iPhone/.test(t)?"iPhone":/(watch)(?: ?os[,/]|\d,\d\/)[\d.]+/i.test(t)?g5:Ox.test(t)?zg:/(kobo)\s(ereader|touch)/i.test(t)?"Kobo":new RegExp(E8,"i").test(t)?E8:/(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(nd).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)?fh:p5:new RegExp("(pda|Mobile)","i").test(t)?Gj:new RegExp(Lm,"i").test(t)&&!new RegExp("Tablet pc","i").test(t)?P5:""},t$=function(t,e){var n;const r=H5(t);return r===m5||r===p5||r==="Kobo"||r==="Kindle Fire"||r===P5?Lm:r===Nm||r===Ug||r===Dm||r===h2?"Console":r===g5?"Wearable":r?nd:(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)?nd:Lm:"Desktop";var s,i,o},fy=/\bFBAV\/(\d+(?:\.\d+)*)/i,P8=[[/\bInstagram(?:[ /](\d+(?:\.\d+)*))?\b/i,"Instagram"],[/\bBarcelona[ /](\d+(?:\.\d+)*)?/i,"Threads"],[/\b(?:MessengerForiOS|(?:FBAN|FB_IAB)\/Orca-Android)\b/i,"Messenger",fy],[/\bFBAN\/EMA\b/i,"Facebook Lite",fy],[/\b(?:FBIOS|(?:FBAN|FB_IAB)\/(?:FB4A|FBIOS))\b/i,"Facebook",fy],[/\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"]],g2="[Truncated]",Jh="[Unserializable]";function Iu(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 z5(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=Jh}Object.defineProperty(t,r,{value:s,enumerable:!0,writable:!0,configurable:!0})}return t}const im=3e5;var U5=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,im);if(!e)return this.ts=n,void(this.es=n+r);this.es=Math.max(this.es,Math.min(n+r,this.ts+im))}remainingMs(){const t=Date.now();if(this.ts-5e3>t)return this.reset(),0;const e=Math.min(im,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 n$=/^[0-9a-f]{8}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{12}$/i;function A8(t,e){return typeof(n=t)=="string"&&n$.test(n)?t:e();var n}function B5(t,e){const n=new Error(e);try{Object.defineProperty(n,"name",{value:t,writable:!0,enumerable:!0,configurable:!0})}catch{}return n}function Ga(t){return t&&t.split("#")[0]}function T8(t){try{return t()}catch{return}}function Z5(t,e){const n=setTimeout(t,e);return n!=null&&n.unref&&(n==null||n.unref()),n}function R8(t,e,n){return W5.apply(this,arguments)}function W5(){return(W5=Kt(function*(t,e,n){let r;try{return yield Promise.race([t,new Promise((s,i)=>{r=Z5(()=>{try{n==null||n(),s()}catch(o){i(o)}},e)})])}finally{clearTimeout(r)}})).apply(this,arguments)}let b0,M8,hy;function r$(t){const e=globalThis._posthogChunkIds;if(!e)return;const n=Object.keys(e);return hy&&n.length===M8||(M8=n.length,hy=n.reduce((r,s)=>{b0||(b0={});const i=b0[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,b0[s]=[d,f];break}}}return r},{})),hy}function zf(t){return zf=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},zf(t)}function s$(t,e,n){return(e=(function(r){var s=(function(i){if(zf(i)!="object"||!i)return i;var o=i[Symbol.toPrimitive];if(o!==void 0){var l=o.call(i,"string");if(zf(l)!="object")return l;throw new TypeError("@@toPrimitive must return a primitive value.")}return String(i)})(r);return zf(s)=="symbol"?s:s+""})(e))in t?Object.defineProperty(t,e,{value:n,enumerable:!0,configurable:!0,writable:!0}):t[e]=n,t}function I8(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 $(t){for(var e=1;arguments.length>e;e++){var n=arguments[e]!=null?arguments[e]:{};e%2?I8(Object(n),!0).forEach(function(r){s$(t,r,n[r])}):Object.getOwnPropertyDescriptors?Object.defineProperties(t,Object.getOwnPropertyDescriptors(n)):I8(Object(n)).forEach(function(r){Object.defineProperty(t,r,Object.getOwnPropertyDescriptor(n,r))})}return t}var i$=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 Kt(function*(){for(const n of t)n.stacktrace&&n.stacktrace.frames&&Ue(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 $($({},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 Kt(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?$($({type:typeof e.type=="string"&&e.type.length>0?e.type:"generic"},typeof e.handled=="boolean"?{handled:e.handled}:e.handled===void 0?{handled:!0}:{}),{},{synthetic:typeof e.synthetic=="boolean"?e.synthetic:s.synthetic,exception_id:u}):{type:"chained",source:o,synthetic:s.synthetic,exception_id:u,parent_id:i},f={type:s.type,value:s.value,mechanism:d};s.stack&&(f.stacktrace={type:"raw",frames:s.stack}),n.push(f),s.cause&&r(s.cause,u,"cause");for(const h of(l=s.errors)!==null&&l!==void 0?l:[])r(h,u,"member")};return r(t),n}buildParsingContext(t){var e;return{chunkIdMap:r$(this.stackParser),skipFirstLines:(e=t.skipFirstLines)!==null&&e!==void 0?e:1}}getAggregateErrors(t){try{if(Sd(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 Ue(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,A;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{A=k.length}catch{return C}if(!Number.isInteger(A)||0>A||A>4294967295)return C;const T=[];for(let I=0;50>r&&1e3>s&&A>I;I++){let M;s++;try{M=_.next(k[I])}catch{r++,M=this.coerceFallback(f(v+1))}M&&T.push(M)}return $($({},C),{},{errors:T})},f=(g,v=0)=>$($({},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)}),h=f(n);return $($({},h),{},{apply:g=>{var v;return(v=d(g,n))!==null&&v!==void 0?v:this.coerceFallback(h)}})}};const o$=/^([a-z][a-z0-9.+-]+):/i,a$=["http","https","file","blob","app","capacitor","ionic","webpack","webpack-internal","ng"];function l$(t){if(!t||t==="<anonymous>")return!1;const e=o$.exec(t);return!e||a$.includes(e[1].toLowerCase())}function v2(t,e,n,r,s){const i={platform:t,filename:e,function:n==="<anonymous>"?"?":n,in_app:l$(e)};return ce(r)||(i.lineno=r),ce(s)||(i.colno=s),i}const q5=(t,e)=>{const n=t.indexOf("safari-extension")!==-1,r=t.indexOf("safari-web-extension")!==-1;return n||r?[t.indexOf("@")!==-1?t.split("@")[0]:"?",n?`safari-extension:${e}`:`safari-web-extension:${e}`]:[t,e]},c$=/^\s*at (\S+?)(?::(\d+))(?::(\d+))\s*$/i,u$=/^\s*at (?:(.+?\)(?: \[.+\])?|.*?) ?\((?:address at )?)?(?:async )?((?:<anonymous>|[-a-z]+:|.*bundle|\/)?.*?)(?::(\d+))?(?::(\d+))?\)?\s*$/i,d$=/\((\S*)(?::(\d+))(?::(\d+))\)/,f$=(t,e)=>{const n=c$.exec(t);if(n){const[,s,i,o]=n;return v2(e,s,"?",+i,+o)}const r=u$.exec(t);if(r){if(r[2]&&r[2].indexOf("eval")===0){const o=d$.exec(r[2]);o&&(r[2]=o[1],r[3]=o[2],r[4]=o[3])}const[s,i]=q5(r[1]||"?",r[2]);return v2(e,i,s,r[3]?+r[3]:void 0,r[4]?+r[4]:void 0)}},h$=/^\s*(.*?)(?:\((.*?)\))?(?:^|@)?((?:[-a-z]+)?:\/.*?|\[native code\]|[^@]*(?:bundle|\d+\.js)|\/[\w\-. /=]+)(?::(\d+))?(?::(\d+))?\s*$/i,p$=/(\S+) line (\d+)(?: > eval line \d+)* > eval/i,m$=(t,e)=>{const n=h$.exec(t);if(n){if(n[3]&&n[3].indexOf(" > eval")>-1){const i=p$.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]=q5(s,r),v2(e,r,s,n[4]?+n[4]:void 0,n[5]?+n[5]:void 0)}},O8=/\(error: (.*)\)/;function Lx(t,e){return t.filename===e.filename&&t.function===e.function&&t.module===e.module&&t.lineno===e.lineno&&t.colno===e.colno}function g$(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(!Lx(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 v$(t,e){const n=e.start+e.length,r=K5(t,e);r&&t.splice(n+r===t.length?n:e.start,r)}function G5(t,e){let n=e.start;for(;n>0&&Lx(t[n-1],t[n-1+e.length]);)n--;return e.start-n}function K5(t,e){const n=e.start+e.length;let r=n;for(;t.length>r&&Lx(t[r],t[r-e.length]);)r++;return r-n}function y$(t,e){const n=e[0];let r=t.length-(n?G5(t,n):0);for(const s of e)r-=K5(t,s);return r}function _$(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 w$=class{match(t){return this.isDOMException(t)||this.isDOMError(t)}coerce(t,e){const n=ct(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 Om(t,"DOMException")}isDOMError(t){return Om(t,"DOMError")}},x$=class{match(t){return Sd(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}}},b$=class{match(t){return!!Om(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 $($({},r),{},{stack:(n=this.lr(t))!==null&&n!==void 0?n:r.stack,synthetic:!0})}ar(t){return ct(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(ct(r.filename)&&r.filename.length!==0&&s!==0)return`Error
18
+ at ${r.filename}:${s}:${i}`}};const S$=/^(?:[Uu]ncaught (?:exception: )?)?(?:((?:Eval|Internal|Range|Reference|Syntax|Type|URI|)Error): )?(.*)$/i;var k$=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(S$);return r&&(e=r[1],n=r[2]),[e,n]}};const E$=["fatal","error","warning","log","info","debug"];function Y5(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 C$=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(Ix(t))return t.constructor.name;const e="name"in t?t.name:void 0;return ct(e)&&!Hf(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: ${Y5(t)}`}isSeverityLevel(t){return ct(t)&&!Hf(t)&&E$.indexOf(t)>=0}getStack(t){try{return ct(t.stacktrace)&&t.stacktrace.length>0?t.stacktrace:ct(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(Sd(n))return n}}getObjectClassName(t){try{const e=Object.getPrototypeOf(t);return e?e.constructor.name:void 0}catch{return}}},P$=class{match(t){return Ix(t)}coerce(t,e){var n;const r=t.constructor.name;return{type:r,value:`${r} captured as exception with keys: ${Y5(t)}`,stack:(n=e.syntheticException)===null||n===void 0?void 0:n.stack,synthetic:!0}}},A$=class{match(t){return f5(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}}},T$=class{match(t){return Om(t,"PromiseRejectionEvent")||this.isCustomEventWrappingRejection(t)}isCustomEventWrappingRejection(t){if(!Ix(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 f5(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 jm="$message",$m="$timestamp",R$=new Set([jm,$m]),py={enabled:!0,max_bytes:32768};function Fm(t){var e;return t?{enabled:(e=t.enabled)!==null&&e!==void 0?e:py.enabled,max_bytes:I$(t.max_bytes,py.max_bytes)}:$({},py)}var M$=class{constructor(t){this.ns=[],this.ss=0,this.Mr=Fm(t)}setConfig(t){this.Mr=Fm(t),this.rs()}add(t){const e=(function(r){let s;try{s=u5(r)}catch{return}try{const i=JSON.parse(s);if(!st(i))return;const o=i,l=o[jm],u=o[$m];return!ct(l)||l.trim().length===0||!ct(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 I$(t,e){if(!mn(t)||t===1/0||t===-1/0)return e;const n=Math.floor(t);return 0>n?e:n}const L8=t=>{if(typeof t!="string")return t;try{return JSON.parse(t)}catch{return t}};function N8(t){return typeof t=="string"||t}function D8(t){return typeof t=="string"?t:void 0}const O$=["$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","$react_native_version"],X5="NativeGzipValidationError",y2=t=>t.length>=2&&t[0]===31&&t[1]===139,j8=(t,e)=>t===d2.GZipJS||e===d2.GZipJS||e==="gzip",$8=t=>!(!t||typeof t!="object")&&("name"in t?String(t.name):"")==="NotReadableError";let yf;const S0=t=>{throw B5(X5,`Native gzip produced invalid output: ${t}`)},L$=(F8=Kt(function*(t,e){18>t.size&&S0("too-short");const n=new Uint8Array(yield t.slice(0,10).arrayBuffer());y2(n)&&n[2]===8||S0("invalid-header");const r=new DataView(yield t.slice(t.size-8).arrayBuffer());r.getUint32(0,!0)!==(i=>{const o=(()=>{if(yf)return yf;yf=[];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;yf[u]=d>>>0}return yf})();let l=4294967295;for(let u=0;i.length>u;u++)l=o[255&(l^i[u])]^l>>>8;return(4294967295^l)>>>0})(e)&&S0("invalid-crc");const s=e.length>>>0;r.getUint32(4,!0)!==s&&S0("invalid-size")}),function(t,e){return F8.apply(this,arguments)});var F8;function _2(){return _2=Kt(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=Kt(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 L$(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}),_2.apply(this,arguments)}function Q5(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 Er="[redacted]",N$=/^[A-Za-z0-9+/\n\r]+=*$/,D$=/^[A-Za-z0-9_-]+={0,2}$/,j$=/[-_]/,$$=/^data:[^,\s]*;base64,/i,F$=/^[A-Za-z0-9+/_-]+={0,2}$/,V$=/\bph[a-z]_[A-Za-z0-9_-]{20,}\b/g,H$=/^(authorization|cookie|set-cookie|x-api-key|api[-_]?key|api[-_]?token|access[-_]?token|refresh[-_]?token|token|password|secret|client[-_]?secret|private[-_]?key)$/i,J5=/[a-z][a-z0-9+.-]{0,63}:[^\s<>"]+/gi,z$=/[\s<>"]/,eA=new RegExp(J5.source,"i"),tA=/[a-z][a-z0-9+.-]{0,63}:\/\//i,U$=new RegExp(`^${tA.source}`,"i"),B$=new RegExp(tA.source,"gi"),Z$=/(^|[-_./;])(auth|token|secret|password|passwd|pwd|credential|signature|sig|key|hmac|sas|bearer|jwt|session|sessionid)([-_./;]|$)/i,W$=/^(code|AWSAccessKeyId|GoogleAccessId|Policy)$/i,q$=/[\u00A0\u1680\u2000-\u200A\u202F\u205F\u3000]/g,G$=/[A-Za-z0-9._%+-]{1,64}@[A-Za-z0-9.-]{1,255}\.[A-Za-z]{2,24}/g,K$=/\b(?:(?:25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)\.){3}(?:25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)\b/g,Y$=/(^|[^\w:])((?:(?:[0-9A-Fa-f]{1,4}:){7}[0-9A-Fa-f]{1,4}|(?:[0-9A-Fa-f]{1,4}:){1,7}:|(?:[0-9A-Fa-f]{1,4}:){1,6}:[0-9A-Fa-f]{1,4}(?::[0-9A-Fa-f]{1,4}){0,5}|::(?:[0-9A-Fa-f]{1,4}(?::[0-9A-Fa-f]{1,4}){0,6})))(?=$|[^\w:])/g,X$=/\b\d{3}[ .-]\d{2}[ .-]\d{4}\b/g,Q$=/\b\d(?:[ ./-]?\d){12,}\b/g,V8=/\d+/g,J$=/(^|[^\w+])((?:\+?1[ ./-]?)?(?:\(\d{3}\)[ ./-]?|\d{3}[ ./-])\d{3}[ ./-]\d{4})(?![\w])/g,eF=/(^|[^\w])(\+\d{1,3}(?:[ ./()-]{0,2}\d){7,13})(?![\w])/g;function w2(t){return(function(e){return H$.test(e)})(t)||Z$.test(t)||W$.test(t)}function my(t){return t.split("&",129).length>128}function tF(t,e,n){return w2(t)||e.includes(";")&&(function(r){return r.split(";").some(s=>w2(s.split("=",1)[0]))})(e)?Er:eA.test(e)?n?Nx(e,{allowNestedUrls:!1,stripPunctuation:!0}):Er:e}function nA(t,e){const n=new URLSearchParams;let r=!1,s=!1;for(const[i,o]of new URLSearchParams(t)){const l=tF(i,o,e);r||(r=l!==o),s=w2(i)||l!==o,n.append(i,l)}return{changed:r,lastFieldSensitive:s,serialized:n.toString()}}function H8(t,e){if(!t.includes("="))return{value:nF(t,e),lastFieldSensitive:!1};const n=nA(t,e);return{value:n.changed?n.serialized:t,lastFieldSensitive:n.lastFieldSensitive}}function nF(t,e){return e?Nx(t,{allowNestedUrls:!1,stripPunctuation:!0}):eA.test(t)?Er:t}function rF(t,e,n){return t==="#"?!e.fragment&&(e.fragment=!0):t==="?"&&(e.fragment?n!=="="&&!e.fragmentQuery&&(e.fragmentQuery=!0):!e.query&&(e.query=!0))}function gy(t,e){var n;if(t.length>8192&&U$.test(t))return Er;const{address:r,suffix:s}=e.stripPunctuation?(function(x){let S=x.length;for(;S>0&&".,;:!?)]}'".includes(x[S-1]);)S--;return{address:x.slice(0,S),suffix:x.slice(S)}})(t):{address:t,suffix:""};let i;try{i=new URL(r)}catch{return Er+s}const o=i.search.slice(1),l=i.hash!=="",u=(function(x){const S=x.slice(1),k=S.indexOf("?");return 0>k?{head:S,tail:null}:{head:S.slice(0,k),tail:S.slice(k+1)}})(i.hash);if(my(o)||my(u.head)||my((n=u.tail)!==null&&n!==void 0?n:""))return Er+s;let d=!1;(i.username||i.password)&&(i.username=Er,i.password="",d=!0);const f=nA(o,e.allowNestedUrls);f.changed&&(i.search=f.serialized,d=!0);const h=H8(u.head,e.allowNestedUrls),g=u.tail===null?null:(v=u.tail,h.lastFieldSensitive?{value:v===""?"":Er,lastFieldSensitive:!0}:H8(v,e.allowNestedUrls));var v;const w=g===null?h.value:`${h.value}?${g.value}`;w!==i.hash.slice(1)&&(i.hash=w,d=!0);const _=l?g??h:f;return(d?i.toString():r)+(_.lastFieldSensitive?"":s)}function Nx(t,e){return t.replace(J5,n=>(function(r,s){const i=(function(u){if(!u.includes("://"))return[];const d=[...u.matchAll(B$)].map(_=>_.index),f=[],h={query:!1,fragment:!1,fragmentQuery:!1};let g=0,v=!1,w="";for(let _=0;u.length>_&&d.length>g;_++){d[g]===_&&(_>0&&w!=="="&&f.push(_),g++);const x=u[_];rF(x,h,w)?(w=x,v=!0):v&&"=&".includes(x)&&(w=x)}return f})(r);if(i.length===0)return gy(r,s);let o="",l=0;for(const u of i)o+=gy(r.slice(l,u),$($({},s),{},{stripPunctuation:!1})),l=u;return o+gy(r.slice(l),s)})(n,$($({},e),{},{stripPunctuation:e.stripPunctuation&&n.length!==t.length})))}function sF(t,e){return(function(n){return n.length>=10240&&(N$.test(n)||(function(r){const s=$$.exec(r);if(!s)return!1;let i;try{i=decodeURIComponent(r.slice(s[0].length))}catch{return!1}return F$.test(i.replace(/[\r\n]/g,""))})(n)||j$.test(n)&&D$.test(n))})(t)?"[binary data redacted - not supported by PostHog MCP analytics]":(function(n,r,s){const i=4*s.maxStringLength;if(n.length>i){const o=r(n.slice(0,(function(l,u){let d=u;for(;d>0&&!z$.test(l[d-1]);)d--;return d})(n,i)));if(o.length>=2*s.maxStringLength)return o+s.truncationSuffix}return r(n)})(t,n=>(function(r){return Nx(r,{allowNestedUrls:!0,stripPunctuation:!0})})((function(r){let s=r.replace(q$," ");return s=s.replace(G$,Er),s=s.replace(K$,Er),s=s.replace(Y$,`$1${Er}`),s=s.replace(Q$,oF),s=s.replace(X$,Er),s=s.replace(J$,`$1${Er}`),s=s.replace(eF,`$1${Er}`),s})((function(r){return r.replace(V$,Er)})(n))),e)}function iF(t){let e=0,n=!1;for(let r=t.length-1;r>=0;r--){let s=t.charCodeAt(r)-48;if(0>s||s>9)return!1;n&&(s*=2,s>9&&(s-=9)),e+=s,n=!n}return e%10==0}function oF(t){const e=[];for(let i=V8.exec(t);i!==null;i=V8.exec(t))e.push({digits:i[0],start:i.index,end:i.index+i[0].length});let n="",r=0,s=0;for(;e.length>s;){let i="",o=-1;for(let l=s;e.length>l&&(i+=e[l].digits,19>=i.length);l++)i.length>=13&&iF(i)&&(o=l);0>o?s++:(n+=t.slice(r,e[s].start)+Er,r=e[o].end,s=o+1)}return n+t.slice(r)}const aF={}.propertyIsEnumerable;function Vm(t,e){try{return rA(t,e,{ancestors:new WeakSet,remainingNodes:1e4},0)}catch{return[]}}function Dx(t,e,n,r){if(0>=n.remainingNodes)return{stringValue:g2};if(n.remainingNodes--,jr(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:Iu(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:g2};if(t instanceof Date){const s=t.getTime(),i=Number.isFinite(s)?t.toISOString():String(t);return{stringValue:typeof i=="string"?Iu(i):String(i)}}n.ancestors.add(t);try{try{const s=t.toJSON;if(typeof s=="function")return Dx(s.call(t),e,n,r+1)}catch{}return Ue(t)?{arrayValue:{values:lF(t,e,n,r+1)}}:{kvlistValue:{values:rA(t,e,n,r+1)}}}finally{n.ancestors.delete(t)}}return{stringValue:Iu(String(t))}}function lF(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(Je(l))continue;s.push(Dx(l,e,n,r))}catch{s.push({stringValue:Jh})}return t.length>o&&s.push({stringValue:g2}),s}function rA(t,e,n,r){const s=[];for(const i in t)if(aF.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:Iu(i),value:Dx(o,e,n,r)})}catch{s.push({key:Iu(i),value:{stringValue:Jh}})}}return s}function sA(t,e,n){return $($($($({},z5({},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 cF=["service.name","deployment.environment","service.version","telemetry.sdk.name","telemetry.sdk.version"];function iA(t,e){const n=z5({},t),r={};for(const s of cF)({}).hasOwnProperty.call(n,s)&&(r[s]=n[s],delete n[s]);return[...Vm(n,e),...Vm(r,e)]}const z8={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"},oA={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}},uF=oA.info;function dF(t){try{return Iu(String(t))}catch{return Jh}}function fF(t,e,n,r){const s=t.level||"info",{text:i,number:o}=oA[s]||uF,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),Je(e.sessionStartTimestamp)||(u.sessionStartTimestamp=String(e.sessionStartTimestamp)),Je(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=$({},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=Jh}Object.defineProperty(d,v,{value:w,enumerable:!0,writable:!0,configurable:!0})}}const h={timeUnixNano:l,observedTimeUnixNano:l,severityNumber:o,severityText:i,body:{stringValue:dF(t.body)},attributes:Vm(d,n)};return t.trace_id&&(h.traceId=t.trace_id),t.span_id&&(h.spanId=t.span_id),ce(t.trace_flags)||(h.flags=t.trace_flags),h}function aA(t,e,n){return sA(t,e,n)}function lA(t,e,n,r){return{resourceLogs:[{resource:{attributes:iA(e)},scopeLogs:[{scope:{name:n,version:r},logRecords:t}]}]}}var cA=class{constructor(t){this.ls=t,this.us=0}get pending(){return!!this.cs}arm(t){this.clear(),this.us=Date.now()+t,this.cs=Z5(()=>{this.cs=void 0,this.ls()},t)}armNoEarlierThan(t){this.cs&&Date.now()+t<=this.us||this.arm(t)}clear(){this.cs&&(clearTimeout(this.cs),this.cs=void 0)}};function uA(){return .75+.5*Math.random()}function dA(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 hF=class{constructor(t,e,n,r,s,i=()=>Promise.resolve(),o){var l;this._instance=t,this.Mr=e,this.A=n,this.hs=r,this.ds=s,this.vs=i,this.fs=o,this.ps=new cA(()=>this.gs()),this.ys=null,this.bs=0,this._s=0,this.ws=new U5,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(ji.LogsQueue,[])}reset(){this.ps.clear(),this.xs=0,this.$s=0,this.Cs=!1,this.ks=0,this.Ss=1,this.ws.reset(),this.Es=this.Mr.maxBatchRecordsPerPost}onReconnect(){this.ks=0,this.Ss=1,this.ws.isOpen()?this.As()&&this.Fs():this.gs()}captureLog(t,e){var n;if(this._instance.isDisabled||this._instance.optedOut||!(t!=null&&t.body))return;const r=this.Os(t);if(r===null)return;if(!r.body)return void this.A.info("Log was rejected in beforeSend function");if(!this.Ds())return;const s={record:fF(r,(n=e==null?void 0:e.context)!==null&&n!==void 0?n:this.hs(),this.A,e==null?void 0:e.occurredAtMs)};this.ds(()=>this.Ls(s))}Os(t){const e=this.Mr.beforeSend;if(!e)return t;const n=Ue(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 Kt(function*(){if(!t._instance.isDisabled)return t.ys||(t.ys=t.Ns().finally(()=>{t.ys=null})),t.ys})()}Ns(){var t=this;return Kt(function*(){var e;t.ps.clear();let n=(e=t._instance.getPersistedProperty(ji.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=lA(d.map(g=>g.record),t.qs(),(i=t.fs)!==null&&i!==void 0?i:t._instance.getLibraryId(),t._instance.getLibraryVersion()),h=yield t._instance.js(f);if(t._s!==l)return;if(h.kind==="too-large"&&d.length>1)t.Es=Math.max(1,Math.floor(d.length/2)),t.A.warn(`Logs batch of size ${d.length} was too large for the ingestion endpoint, reducing batch size to ${t.Es}`);else if(t.ws.record(h),t.ps.pending&&t.ps.arm(Math.max(t.Ms,t.ws.remainingMs())),h.kind==="retry-later"||(h.kind==="too-large"?t.A.warn("Dropping a single log record with batch size 1 — the record is larger than the server cap and cannot be split further."):h.kind==="ok"&&t.Mr.maxBatchRecordsPerPost>t.Es&&(t.Es=Math.min(t.Mr.maxBatchRecordsPerPost,t.Es+1)),yield t.Bs(d.length),n=(o=t._instance.getPersistedProperty(ji.LogsQueue))!==null&&o!==void 0?o:[],s+=d.length,h.kind==="fatal"))throw h.error}})()}Bs(t){var e=this;return Kt(function*(){var n;const r=Math.max(0,t-e.bs),s=(n=e._instance.getPersistedProperty(ji.LogsQueue))!==null&&n!==void 0?n:[];e._instance.setPersistedProperty(ji.LogsQueue,s.slice(r)),yield e.vs()})()}qs(){return aA(this.Mr,this._instance.getLibraryId(),this._instance.getLibraryVersion())}Ls(t){var e;if(this._instance.optedOut)return;const n=(e=this._instance.getPersistedProperty(ji.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(ji.LogsQueue,n),this.Ts>n.length||this.ws.isOpen()?this.Fs():this.gs()}Fs(){this.ps.pending||this.ps.arm(Math.max(this.Ms,this.ws.remainingMs()))}zs(){return Math.max(dA(this.Ms,this.ks,this.Ss,3e4),this.ws.remainingMs())}As(){const t=this._instance.getPersistedProperty(ji.LogsQueue);return!!t&&t.length>0}shutdown(t){var e=this;return Kt(function*(){e.ps.clear();const n=e.flush().catch(()=>{});t!==void 0?yield R8(n,t):yield n})()}flushWithTimeout(t){var e=this;return Kt(function*(){const n=e.flush();yield R8(n,t,()=>{n.catch(()=>{})})})()}gs(){this.flush().then(()=>{this.ks=0,this.Ss=1},t=>{this.ks++,this.Ss=uA(),this.A.error("PostHog logs flush failed:",t)}).finally(()=>{!this._instance.isDisabled&&this.As()&&this.ps.armNoEarlierThan(this.zs())})}};const vy=[0,5,10,25,50,75,100,250,500,750,1e3,2500,5e3,7500,1e4];function U8(t){return String(t)+"000000"}function B8(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 pF=class{constructor(t,e,n){this._instance=t,this.Mr=e,this.A=n,this.Hs=new Map,this.ps=new cA(()=>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 U5,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=Kt(function*(){e&&(yield e.catch(()=>{})),yield t.Zs()});return function(){return r.apply(this,arguments)}})()().finally(()=>{this.ys===n&&(this.ys=null)});return this.ys=n,n}drainWindow(){if(this.Hs.size===0)return null;const t=this.Hs;return this.Hs=new Map,this.Us=!1,this.Ws=new Map,this.Vs=new Set,this.Js(t)}reset(){this.Gs++,this.ws.reset(),this.ks=0,this.Ss=1,this.ps.clear(),this.Hs=new Map,this.ys=null,this.Us=!1,this.Ws=new Map,this.Vs=new Set}Qs(t){if(this._instance.isDisabled||this._instance.optedOut)return;const e=this.Os(t);if(e===null)return;if(!e.name||typeof e.name!="string")return void this.A.warn("Dropping metric with empty name");if(typeof e.value!="number"||!Number.isFinite(e.value))return void this.A.warn(`Dropping metric '${e.name}': value must be a finite number`);if(e.type==="count"&&0>e.value)return void this.A.warn(`Dropping count '${e.name}': counters are monotonic, value must be >= 0`);let n,r;try{n=e.attributes?$({},e.attributes):void 0,r=B8(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.Hs.get(r);if(!s){if(!this.Ks())return;s={name:e.name,type:e.type,unit:e.unit,attributes:n,windowStartMs:Date.now()},this.Hs.set(r,s)}const i=this.Ws.get(e.name);i===void 0?this.Ws.set(e.name,e.type):i===e.type||this.Vs.has(e.name)||(this.Vs.add(e.name),this.A.warn(`Metric name '${e.name}' is already used as a ${i}; recording it as a ${e.type} too will blend both series in charts. Use a distinct name.`)),this.Xs(s,e.value),this.Fs()}Ks(){return this.Mr.maxSeriesPerFlush>this.Hs.size||(this.Us||(this.Us=!0,this.A.warn(`Metric series cap reached (${this.Mr.maxSeriesPerFlush} per flush window); dropping new series until the next flush. Reduce attribute cardinality.`)),!1)}Xs(t,e){switch(t.type){case"count":var n;t.total=((n=t.total)!==null&&n!==void 0?n:0)+e;break;case"gauge":t.last=e;break;case"histogram":{t.hist||(t.hist={count:0,sum:0,min:e,max:e,bucketCounts:new Array(vy.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,vy)]+=1;break}}}Os(t){const e=this.Mr.beforeSend;if(!e)return t;const n=Ue(e)?e:[e];let r=t;for(const s of n)try{const i=s(r);if(!i)return this.A.info("Metric was rejected in beforeSend function"),null;r=i}catch(i){return this.A.error("Error in beforeSend function for metric:",i),null}return r}Fs(){this.ps.pending||this.ps.arm(this.zs())}zs(){return Math.max(dA(this.Mr.flushIntervalMs,this.ks,this.Ss,3e4),this.ws.remainingMs())}Zs(){var t=this;return Kt(function*(){if(t.ps.clear(),t.Hs.size===0)return;const e=t.Hs;t.Hs=new Map,t.Us=!1,t.Ws=new Map,t.Vs=new Set;const n=t.Gs,r=yield t._instance.Ys(t.Js(e));if(n===t.Gs)switch(t.ws.record(r),r.kind==="retry-later"?(t.ks++,t.Ss=uA()):(t.ks=0,t.Ss=1),t.ps.pending&&t.ps.arm(t.zs()),r.kind){case"ok":return;case"retry-later":return t.co(e),void t.ps.armNoEarlierThan(t.zs());case"too-large":return void t.A.warn("Metrics batch exceeded the server size limit and was dropped");case"fatal":return void t.A.error("Failed to send metrics batch:",r.error)}})()}Js(t){return e=this.ho(t),n=(function(i,o,l){return sA(i,o,l)})(this.Mr,this._instance.getLibraryId(),this._instance.getLibraryVersion()),r=this._instance.getLibraryId(),s=this._instance.getLibraryVersion(),{resourceMetrics:[{resource:{attributes:iA(n)},scopeMetrics:[{scope:{name:r,version:s},metrics:e}]}]};var e,n,r,s}ho(t){const e=U8(Date.now()),n=new Map;for(const o of t.values()){var r;const l=B8(o.type,o.name,o.unit,void 0);let u=n.get(l);u||(u=$({name:o.name},o.unit&&{unit:o.unit}),o.type==="count"?u.sum={aggregationTemporality:1,isMonotonic:!0,dataPoints:[]}:o.type==="gauge"?u.gauge={dataPoints:[]}:u.histogram={aggregationTemporality:1,dataPoints:[]},n.set(l,u));const d=Vm((r=o.attributes)!==null&&r!==void 0?r:{},this.A),f=U8(o.windowStartMs);if(o.type==="count"){var s;const h={attributes:d,startTimeUnixNano:f,timeUnixNano:e,asDouble:(s=o.total)!==null&&s!==void 0?s:0};u.sum.dataPoints.push(h)}else if(o.type==="gauge"){var i;const h={attributes:d,timeUnixNano:e,asDouble:(i=o.last)!==null&&i!==void 0?i:0};u.gauge.dataPoints.push(h)}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:vy})}return Array.from(n.values())}co(t){for(const[r,s]of t){const i=this.Hs.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.Hs.set(r,s)}}};const fA=(t,{debugEnabled:e}={})=>{const n={N(r,...s){let i;try{i=typeof window>"u"?void 0:window}catch{return}i&&($o.DEBUG||i.POSTHOG_DEBUG||e)&&!ce(i.console)&&i.console&&("__rrweb_original__"in i.console[r]?i.console[r].__rrweb_original__:i.console[r])(t,...s)},debug(...r){n.N("debug",...r)},info(...r){n.N("log",...r)},warn(...r){n.N("warn",...r)},error(...r){n.N("error",...r)},critical(...r){console.error(t,...r)},uninitializedWarning(r){n.error(`You must initialize PostHog before calling ${r}`)},createLogger:(r,s)=>fA(`${t} ${r}`,s)};return n},ye=fA("[PostHog.js]"),dn=ye.createLogger,mF=dn("[ExternalScriptsLoader]"),Hm=t=>{const e=he==null?void 0:he.querySelectorAll("script");if(e){for(let n=0;e.length>n;n++)if(e[n].src===t||e[n].getAttribute("src")===t)return e[n]}},zl=(t,e,n)=>{if(t.config.disable_external_dependency_loading)return mF.warn(`${e} was requested but loading of external scripts is disabled.`),n("Loading of external scripts is disabled");const r=Hm(e);if(r){if(r.__posthog_loading_callback_fired)return n();const i=r.__posthog_loading_error;return i?n(i):(r.addEventListener("load",o=>{r.__posthog_loading_callback_fired=!0,n(void 0,o)}),void r.addEventListener("error",o=>{r.__posthog_loading_error=o,n(o)}))}const s=()=>{if(!he)return n("document not found");if(Hm(e))return zl(t,e,n);let i=he.createElement("script");if(i.type="text/javascript",i.crossOrigin="anonymous",i.src=e,i.onload=l=>{i.__posthog_loading_callback_fired=!0,n(void 0,l)},i.onerror=l=>{i.__posthog_loading_error=l,n(l)},t.config.prepare_external_dependency_script&&(i=t.config.prepare_external_dependency_script(i)),!i)return n("prepare_external_dependency_script returned null");if(t.config.external_scripts_inject_target==="head")he.head.appendChild(i);else{const l=he.querySelectorAll("body > script");var o;l.length>0?(o=l[0].parentNode)===null||o===void 0||o.insertBefore(i,l[0]):he.body.appendChild(i)}};he!=null&&he.body?s():he==null||he.addEventListener("DOMContentLoaded",s)},yy={},Z8=(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 zl(t,s,n)}const r=t.config.strict_script_versioning;if(r){const s=t.requestRouter.endpointFor("assets",`/static/${t.version}/${e}.js`),i=yy[s];if(r==="fallback"&&i){if(Hm(i))return void zl(t,i,n);delete yy[s]}return void zl(t,s,r==="fallback"?(o,l)=>{if(o)if(typeof o=="string")n(o);else{var u;const d=Z8(t,e);yy[s]=d;const f=Hm(s);f==null||(u=f.parentNode)===null||u===void 0||u.removeChild(f),zl(t,d,n)}else n(void 0,l)}:n)}zl(t,Z8(t,e),n)},$e.__PosthogExtensions__.loadSiteApp=(t,e,n)=>{const r=t.requestRouter.endpointFor("api",e);zl(t,r,n)},$o.DEBUG=!1,$o.LIB_VERSION="1.438.2",$o.LIB_NAME="web";var Un=$o;const x2="$early_access_features",No="$active_feature_flags",oc="$feature_flag_details",hh="$feature_flag_errors",Ba="$feature_flag_evaluated_at",ac="$feature_flag_request_id",Uf="$minimal_flag_called_events",_i="$enabled_feature_flags",Da="$stored_group_properties",ja="$stored_person_properties",$a="$flag_call_reported",Of="$flag_call_reported_session_id",Fa="$feature_flag_payloads",Di="$override_feature_flags",Ul="$override_feature_flag_payloads",ph="visibilitychange",gF="$people_distinct_id",hi="distinct_id",jx="$device_id",_y="$device_model",zm="__alias",vF="__cmpns",W8="$fbc",Ou="$fbc_persistence",q8="$fbp",Bf="$fbp_persistence",b2="__timers",hA="$autocapture_disabled_server_side",S2="$heatmaps_enabled_server_side",k2="$exception_capture_enabled_server_side",pA="$error_tracking_suppression_rules",E2="$error_tracking_capture_extension_exceptions",C2="$web_vitals_enabled_server_side",$x="$dead_clicks_enabled_server_side",Fx="$product_tours_enabled_server_side",mA="$logs_capture_enabled_server_side",gA="$web_vitals_allowed_metrics",Zf="$session_recording_remote_config",yF="$session_recording_enabled_server_side",_F="$replay_sample_rate",wF="$replay_override_sampling",xF="$replay_override_linked_flag",bF="$replay_override_url_trigger",SF="$replay_override_event_trigger",Su="$sesid",vA="$session_is_sampled",kF="$session_past_minimum_duration",EF="$session_recording_url_trigger_activated_session",CF="$session_recording_event_trigger_activated_session",PF="$debug_first_full_snapshot_timestamp",AF="$sess_rec_flush_size",yA="$groups",Lf="$surveys",Um="$surveys_loaded_at",_A="$surveys_activated",wA="$surveys_activated_session",xA="$surveys_activated_timestamps",P2="ph_product_tours",TF="$product_tours_activated",RF="$product_tours_activated_session",MF="$conversations_widget_session_id",IF="$conversations_ticket_id",OF="$conversations_widget_state",LF="$conversations_user_traits",Dr="$user_state",A2="$client_session_props",NF="$capture_rate_limit",bA="$initial_campaign_params",SA="$initial_referrer_info",ku="$initial_person_info",Vx="$epp",wy="$posthog_cookieless",kA="$cookieless_mode",EA="$sdk_debug_extensions_init_method",CA="$sdk_debug_extensions_init_time_ms",Hx="$sdk_debug_recording_script_not_loaded",zx="$sdk_debug_replay_stale_config",PA="$sdk_debug_replay_event_trigger_status",AA="$sdk_debug_replay_linked_flag_trigger_status",TA="$sdk_debug_replay_matched_recording_trigger_groups",RA="$sdk_debug_replay_pending_trigger_conditions",MA="$sdk_debug_replay_remote_trigger_matching_config",IA="$sdk_debug_replay_trigger_groups_count",OA="$sdk_debug_replay_url_trigger_status",DF="$session_recording_start_reason",Ux="PostHog loadExternalDependency extension not found.",Do="anonymous",om="identified",LA="identified_only",Bm="beforeunload",Bx="$pageview",G8="$pageleave",NA="$identify",K8="$groupidentify";function Eu(t,e){Ue(t)&&t.forEach(e)}function Tt(t,e){if(!Je(t))if(Ue(t))t.forEach(e);else if((n=>n instanceof FormData)(t))t.forEach((n,r)=>e(n,r));else for(const n in t)Mx.call(t,n)&&e(t[n],n)}const qt=function(t,...e){for(const n of e)for(const r in n)n[r]!==void 0&&(t[r]=n[r]);return t};function am(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 jF=function(t){return function(...e){try{return t.apply(this,e)}catch(n){ye.critical("Implementation error. Please turn on debug mode and open a ticket on https://app.posthog.com/home#panel=support%3Asupport%3A."),ye.critical(n)}}},Zx=function(t){const e={};return Tt(t,function(n,r){(ct(n)&&n.length>0||mn(n))&&(e[r]=n)}),e};function DA(t){const e=$({},t);for(const n of["name","message","stack","cause","errors"])try{n in t&&(e[n]=t[n])}catch{}return e}const $F=["herokuapp.com","vercel.app","netlify.app"];function FF(t){const e=t==null?void 0:t.hostname;if(!ct(e))return!1;const n=e.split(".").slice(-2).join(".");for(const r of $F)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 T2(t){return t.name==="ph_toolbar_internal"}const Wf=t=>{if(he){try{const e=t+"=",n=he.cookie.split(";").filter(r=>r.length);for(let r=0;n.length>r;r++){let s=n[r];for(;s.charAt(0)==" ";)s=s.substring(1,s.length);if(s.indexOf(e)===0)return decodeURIComponent(s.substring(e.length,s.length))}}catch{}return null}};Math.trunc||(Math.trunc=function(t){return 0>t?Math.ceil(t):Math.floor(t)}),Number.isInteger||(Number.isInteger=function(t){return mn(t)&&isFinite(t)&&Math.floor(t)===t});var VF=class R2{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 R2(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 R2(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}},HF=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 VF.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 zF}};let jA=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};ee&&!ce(ee.crypto)&&crypto.getRandomValues&&(jA=t=>crypto.getRandomValues(t));var zF=class{nextUint32(){return this.Rt.length>this.Et||(jA(this.Rt),this.Et=0),this.Rt[this.Et++]}constructor(){this.Rt=new Uint32Array(8),this.Et=1/0}};let Y8;const wi=()=>UF().toString(),UF=()=>(Y8||(Y8=new HF)).generate();let _f="";const BF=/[a-z0-9][a-z0-9-]+\.[a-z]{2,}$/i;let ou=null;const ln={At(){if(!cn(ou))return ou;if(ou=!1,he)try{const t=`__ph_cookie_support_${wi()}`;ln.$t(t,"xyz"),ou=Wf(t)==='"xyz"',ln.Pt(t)}catch{ou=!1}return ou},Dt(t){ye.error("cookieStore error: "+t)},Ot:Wf,Lt(t){let e;try{e=JSON.parse(ln.Ot(t))||{}}catch{}return e},$t(t,e,n,r,s){if(!he)return!1;try{let i="",o="";const l=(function(d,f){if(f){let h=(function(g,v=he){if(_f)return _f;if(!v||["localhost","127.0.0.1"].includes(g))return"";const w=g.split(".");let _=Math.min(w.length,8);const x="dmn_chk_"+wi();for(;!_f&&_--;){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",_f=S)}return _f})(d);if(!h){const g=(v=>{const w=v.match(BF);return w?w[0]:""})(d);g!==h&&ye.info("Warning: cookie subdomain discovery mismatch",g,h),h=g}return h?"; domain=."+h:""}return""})(he.location.hostname,r);if(n){const d=new Date;d.setTime(d.getTime()+864e5*n),i="; expires="+d.toUTCString()}s&&(o="; secure");const u=t+"="+encodeURIComponent(JSON.stringify(e))+i+"; SameSite=Lax; path=/"+l+o;return u.length>3686.4&&ye.warn("cookieStore warning: large cookie, len="+u.length),he.cookie=u,!0}catch{return!1}},Pt(t,e){if(he!=null&&he.cookie&&(!e||!cn(Wf(t))))try{ln.$t(t,"",-1,e)}catch{return}}};let xy=null;const yt={At(){if(!cn(xy))return xy;let t=!0;if(ce(ee))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||ye.error("localStorage unsupported; falling back to cookie store"),xy=t,t},Dt(t){ye.error("localStorage error: "+t)},Ot(t){try{return ee==null?void 0:ee.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 ee==null||ee.localStorage.setItem(t,JSON.stringify(e)),!0}catch(n){yt.Dt(n)}return!1},Pt(t){try{ee==null||ee.localStorage.removeItem(t)}catch(e){yt.Dt(e)}}},by=[ja,No,_i,oc,Fa,ac,Ba,hh,$a],Bl=[jx,hi,Su,vA,Vx,ku,Ou,Dr],Zm=t=>t+"_cpm",ZF=["__proto__","constructor","prototype"],Sy=t=>{if(!st(t))return{};const e={};return Object.keys(t).forEach(n=>{ZF.indexOf(n)===-1&&(e[n]=t[n])}),e},ky=(t,e=[])=>{const n={};return[...Bl,...e].forEach(r=>{const s=t[r];ce(s)||cn(s)||s===""||(n[r]=s)}),n},$A=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)},X8=(t,e)=>({p:e,f:$A(JSON.stringify(t))}),Q8=(t,e)=>{if(!e)return{properties:[],isValid:!1};try{const n=ln.Lt(Zm(t)),r=(n==null?void 0:n.f)===$A(e)&&Ue(n.p);return{properties:r?n.p:[],isValid:r}}catch{return{properties:[],isValid:!1}}},Ey=(t,e)=>e+"|"+(ln.Ot(Zm(t))||""),au={},M2={At:()=>!0,Dt(t){ye.error("memoryStorage error: "+t)},Ot:t=>t in au?au[t]:null,Lt:t=>t in au?au[t]:null,$t:(t,e)=>(au[t]=e,!0),Pt(t){delete au[t]}};let Tl=null;const zt={At(){if(!cn(Tl))return Tl;if(Tl=!0,ce(ee))Tl=!1;else try{const t="__support__";zt.$t(t,"xyz"),zt.Ot(t)!=='"xyz"'&&(Tl=!1),zt.Pt(t)}catch{Tl=!1}return Tl},Dt(t){ye.error("sessionStorage error: ",t)},Ot(t){try{return ee==null?void 0:ee.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 ee==null||ee.sessionStorage.setItem(t,JSON.stringify(e)),!0}catch(n){zt.Dt(n)}return!1},Pt(t){try{ee==null||ee.sessionStorage.removeItem(t)}catch(e){zt.Dt(e)}}};var WF=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 ly(t)?1:ze(Zj,t)?0:-1}get No(){const t=this.Mr.opt_out_capturing_persistence_type,e=t==="localStorage"?yt:ln,n=e.At()?e:M2;if(!this.jo||this.jo!==n){this.jo=n;const r=t==="localStorage"?ln:yt;r.Ot(this.qo)&&(this.jo.Ot(this.qo)||this.optInOut(ly(r.Ot(this.qo))),r.Pt(this.qo,this.Mr.cross_subdomain_cookie))}return this.jo}Do(){return!!this.Mr.respect_dnt&&[Qn==null?void 0:Qn.doNotTrack,Qn==null?void 0:Qn.msDoNotTrack,$e.doNotTrack,Qn==null?void 0:Qn.globalPrivacyControl].some(t=>ly(t))}};function FA(t,e){var n;const r=t==null||(n=t.config)===null||n===void 0?void 0:n.get_current_url;if(!Ln(r))return e;try{const s=r(e);return ct(s)&&s?s:e}catch(s){return ye.error("Error in get_current_url, falling back to window.location.href",s),e}}function J8(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 mr(t,e){return!!t&&!!t.tagName&&t.tagName.toLowerCase()===e.toLowerCase()}function VA(t){return!!t&&t.nodeType===3}function Wx(t){return!!t&&t.nodeType===11&&ki(t.host)}function qx(t){return t?td(t).split(/\s+/):[]}function ek(t,e){const n=(function(r){var s;const i=ee==null||(s=ee.location)===null||s===void 0?void 0:s.href;return ce(i)?void 0:FA(r,i)})(e);return!!(n&&t&&t.some(r=>n.match(r)))}function rd(t){let e="";switch(typeof t.className){case"string":e=t.className;break;case"object":e=(t.className&&"baseVal"in t.className?t.className.baseVal:null)||t.getAttribute("class")||"";break;default:e=""}return qx(e)}function HA(t){return Je(t)?null:td(t).split(/(\s+)/).filter(e=>Lu(e)).join("").replace(/[\r\n]/g," ").replace(/[ ]+/g," ").substring(0,255)}function mh(t){let e="";return lc(t)&&!sd(t)&&t.childNodes&&t.childNodes.length&&Tt(t.childNodes,function(n){var r;VA(n)&&n.textContent&&(e+=(r=HA(n.textContent))!==null&&r!==void 0?r:"")}),td(e)}function qf(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 Gx=["a","button","form","input","select","textarea","label"];function I2(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 O2(t,e){if(ce(e))return!0;for(const n of t)if(e.some(r=>I2(n,r)))return!0;return!1}function zA(t){const e=t.parentNode;return!(!e||!ki(e))&&e}const Cy=[".ph-no-autocapture","[data-ph-no-autocapture]"],UA=["next","previous","prev",">","<","→","←","›","‹","»","«","▶","◀","❯","❮"],Kx=[...UA,"+","-","−","–"],tk=Kx.length+10,qF=["button","a","input","select","textarea","label"],GF=["button","link","tab","menuitem","option"],nk=(t,e)=>/[a-z0-9]/i.test(e)?ze(Kx,e)?new RegExp(`\\b${e}\\b`).test(t):t.includes(e):t===e,KF=t=>ze(qF,t.tagName.toLowerCase())||ze(GF,(t.getAttribute("role")||"").toLowerCase());function Py(t){let e="",n="";const r=o=>{ki(o)&&lc(o)&&!sd(o)&&(e+=` ${mh(o)}`,n=n||o.getAttribute("aria-label")||"",Tt(o.childNodes,r))};r(t),e=td(e.replace(/\s+/g," "));const s=(Lu(e)?e:"").toLowerCase(),i=t.getAttribute("aria-label")||(s?"":n);return{safeText:s,ariaLabel:td(i).toLowerCase()}}const rk=[".ph-no-rageclick",".ph-no-capture"],YF=["","text","search","email","password","url","tel","number"];function BA(t,e){if(!ee||Yx(t))return!1;let n,r,s;var i,o;if(jr(e)?(n=!!e&&rk,r=void 0,s=!1):(n=(i=e==null?void 0:e.css_selector_ignorelist)!==null&&i!==void 0?i:rk,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))&&(!!mr(u,"textarea")||(mr(u,"input")?ze(YF,(u.getAttribute("type")||"").toLowerCase()):(function(d){var f;if(d.isContentEditable)return!0;const h=(f=d.getAttribute)===null||f===void 0?void 0:f.call(d,"contenteditable");return h==="true"||h===""})(u)))})(t))return!1;const{targetElementList:l}=ZA(t,!1);return!(r&&(function(u,{safeText:d,ariaLabel:f}){let h;if(u===!0)h=UA;else{if(!Ue(u))return!1;if(u.length>tk)return ye.error(`[PostHog] content_ignorelist array cannot exceed ${tk} items. Use css_selector_ignorelist for more complex matching.`),!1;h=u.map(g=>g.toLowerCase())}return h.some(g=>nk(d,g)||nk(f,g))})(r,(function(u,d){for(const f of d)if(KF(f))return Py(f);for(const f of d){try{if((ee==null?void 0:ee.getComputedStyle(f).getPropertyValue("cursor"))!=="pointer")break}catch{break}const h=Py(f);if(h.safeText||h.ariaLabel)return h}return Py(u)})(t,l))||O2(l,n))}const Yx=t=>!t||mr(t,"html")||!ki(t),ZA=(t,e)=>{if(!ee||Yx(t))return{parentIsUsefulElement:!1,targetElementList:[]};let n=!1;const r=[t];let s=t;for(;s.parentNode&&!mr(s,"body");){if(Wx(s.parentNode)){r.push(s.parentNode.host),s=s.parentNode.host;continue}const i=zA(s);if(!i)break;if(e||Gx.indexOf(i.tagName.toLowerCase())>-1)n=!0;else try{const o=ee.getComputedStyle(i);o&&o.getPropertyValue("cursor")==="pointer"&&(n=!0)}catch{}r.push(i),s=i}return{parentIsUsefulElement:n,targetElementList:r}};function lc(t){const e=new Set;let n=0;for(let i=t;i.parentNode&&!mr(i,"body");i=i.parentNode){if(n++>=1e3||e.has(i))return!1;e.add(i);const o=rd(i);if(ze(o,"ph-sensitive")||ze(o,"ph-no-capture"))return!1}if(ze(rd(t),"ph-include"))return!0;const r=t.type||"";if(ct(r))switch(r.toLowerCase()){case"hidden":case"password":return!1}const s=t.name||t.id||"";return!ct(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 sd(t){return!!(mr(t,"input")&&!["button","checkbox","submit","reset"].includes(t.type)||mr(t,"select")||mr(t,"textarea")||t.getAttribute("contenteditable")==="true")}const sk=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}))$"),ik=/(^|[^0-9A-Za-z_])([0-9][0-9 -]*[0-9])(?=$|[^0-9A-Za-z_])/g,XF=[16,15,14,13],QF=new RegExp("^(\\d{3}-?\\d{2}-?\\d{4})$"),ok=new RegExp("(^|[^0-9])((?!000|666)[0-9]{3}-?(?!00)[0-9]{2}-?(?!0000)[0-9]{4})(?=$|([^0-9]))","g"),ak=/[0-9A-Za-z_]/;function JF(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 Lu(t,e=!0){return!(Je(t)||ct(t)&&(t=td(t),(e?sk.test((t||"").replace(/[- ]/g,"")):(function(n){let r;for(ik.lastIndex=0;r=ik.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 XF){const u=o+l;if(i.length>=u){const d=i.slice(o,u);if(sk.test(d)&&JF(d))return!0}}}return!1})(t))||(e?QF.test(t):(function(n){let r;for(ok.lastIndex=0;r=ok.exec(n);){const s=r[1],i=r[3];if(!(s&&i&&ak.test(s)&&ak.test(i)))return!0}return!1})(t))))}function lk(t){let e=mh(t);return e=`${e} ${WA(t)}`.trim(),Lu(e)?e:""}function WA(t){let e="";return t&&t.childNodes&&t.childNodes.length&&Tt(t.childNodes,function(n){var r;if(n&&((r=n.tagName)===null||r===void 0?void 0:r.toLowerCase())==="span")try{const s=mh(n);e=`${e} ${s}`.trim(),n.childNodes&&n.childNodes.length&&(e=`${e} ${WA(n)}`.trim())}catch(s){ye.error("[AutoCapture]",s)}}),e}function ck(t){return t.replace(/"|\\"/g,'\\"')}function eV(t){const e=t.attr__class;if(e)return Ue(e)?e:qx(e)}const k0=dn("[Dead Clicks]"),tV=()=>!0,nV=t=>{var e;const n=!!(!((e=t.instance.persistence)===null||e===void 0)&&e.get_property($x)),r=t.instance.config.capture_dead_clicks;return jr(r)?r:!!st(r)||n};var uk=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({[$x]:e.captureDeadClicks}),this.startIfEnabledOrStop())}startIfEnabledOrStop(){this.isEnabled(this)?this.zo(()=>{this.Ho()}):this.stop()}zo(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?k0.error("failed to load script",s):t()})}Ho(){var t;if(he){if(!this.Bo&&(!((t=$e.__PosthogExtensions__)===null||t===void 0)&&t.initDeadClicksAutocapture)){const e=st(this.instance.config.capture_dead_clicks)?$({},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(he),k0.info("starting...")}}else k0.error("`document` not found. Cannot start.")}stop(){this.Bo&&(this.Bo.stop(),this.Bo=void 0,k0.info("stopping..."))}};const wf=dn("[SegmentIntegration]");function dk(t,e,n=!0){const r=t.config.segment;if(!r)return e();const{analytics:s,filterProperties:i}=(l=>Ln(l.register))(o=r)?{analytics:o}:o;var o;(function(l,u,d,f){const h=v=>{const w=()=>v.anonymousId()||wi();l.config.get_device_id=w,f&&v.id()&&(l.register({distinct_id:v.id(),$device_id:w()}),l.persistence.set_property(Dr,om)),d(f?void 0:v.anonymousId()||void 0)},g=u.user();"then"in g&&Ln(g.then)?g.then(h):h(g)})(t,s,l=>{s.register(((u,d,{filterProperties:f}={})=>{typeof Promise<"u"&&Promise.resolve||wf.warn("This browser does not have Promise support, and can not use the segment integration");const h=(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()||(wf.info("No userId set, resetting PostHog"),u.reset()),w||(d=void 0),g.event.userId&&g.event.userId!==u.get_distinct_id()&&(wf.info("UserId set, identifying with PostHog"),u.identify(g.event.userId));let _=u.calculateEventProperties(v,g.event.properties);if(!Je(f)){const x=g.event.properties||{},S={};for(const C of Object.keys(_))Mx.call(x,C)||(S[C]=_[C]);const k=((C,A)=>{const T=Ue(C)?C:[C];let I=$({},A);for(const M of T)try{if(I=M(I),Je(I))return null}catch(R){return wf.error("Error in Segment filterProperties:",R),null}return I})(f,S);if(Je(k))return g;_=k}return g.event.properties=Object.assign({},_,g.event.properties),g};return{name:"PostHog JS",type:"enrichment",version:"1.0.0",isLoaded(){return!0},load(){return Promise.resolve()},track(g){return h(g,g.event.event)},page(g){return h(g,Bx)},identify(g){return h(g,NA)},screen(g){return h(g,"$screen")}}})(t,l,{filterProperties:i})).then(()=>{e()},u=>{wf.error("Failed to register the Segment integration",u),e()})},n)}const qA="posthog-js";function GA(t,{organization:e,projectId:n,prefix:r,severityAllowList:s=["error"],sendExceptionsToPostHog:i=!0}={}){return o=>{var l,u,d,f,h;if(s!=="*"&&!s.includes(o.level)||!t.__loaded)return o;o.tags||(o.tags={});const g=t.requestRouter.endpointFor("ui",`/project/${t.config.token}/person/${t.get_distinct_id()}`);o.tags["PostHog Person URL"]=g,t.sessionRecordingStarted()&&(o.tags["PostHog Recording URL"]=t.get_session_replay_url({withTimestamp:!0}));const v=((l=o.exception)===null||l===void 0?void 0:l.values)||[],w=v.map(S=>$($({},S),{},{stacktrace:S.stacktrace?$($({},S.stacktrace),{},{type:"raw",frames:(S.stacktrace.frames||[]).map(k=>$($({},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:(h=v[0])===null||h===void 0?void 0:h.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 rV=class{constructor(t,e,n,r,s,i){this.name=qA,this.setupOnce=function(o){o(GA(t,{organization:e,projectId:n,prefix:r,severityAllowList:s,sendExceptionsToPostHog:i==null||i}))}}},fk=class{constructor(t){this.Uo=(e,n,r)=>{r&&(r.noSessionId||r.activityTimeout||r.sessionPastMaximumLength||r.crossTabAdoption)&&(ye.info("[PageViewManager] Session rotated, clearing pageview state",{sessionId:e,changeReason:r}),this.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=ee==null?void 0:ee.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 h=i>1?Wi(o/i,0,1,ye):1,g=i>1?Wi(l/i,0,1,ye):1,v=u>1?Wi(d/u,0,1,ye):1,w=u>1?Wi(f/u,0,1,ye):1;r=qt(r,{$prev_pageview_last_scroll:o,$prev_pageview_last_scroll_percentage:h,$prev_pageview_max_scroll:l,$prev_pageview_max_scroll_percentage:g,$prev_pageview_last_content:d,$prev_pageview_last_content_percentage:v,$prev_pageview_max_content:f,$prev_pageview_max_content_percentage:w})}}return n.pathname&&(r.$prev_pageview_pathname=n.pathname),n.timestamp&&(r.$prev_pageview_duration=(t.getTime()-n.timestamp.getTime())/1e3),r}};const xf=["flags","surveys"],sV={[gF]:{exposure:"hidden"},[zm]:{exposure:"hidden"},[vF]:{exposure:"hidden"},[b2]:{exposure:"hidden"},[Ou]:{exposure:"hidden"},[Bf]:{exposure:"hidden"},[hA]:{exposure:"event"},[S2]:{exposure:"hidden"},[mA]:{exposure:"hidden"},[k2]:{exposure:"event"},[pA]:{exposure:"hidden"},[E2]:{exposure:"event"},[C2]:{exposure:"event"},[$x]:{exposure:"event"},[Fx]:{exposure:"hidden"},[gA]:{exposure:"event"},[Zf]:{exposure:"hidden"},[yF]:{exposure:"hidden"},[Su]:{exposure:"hidden"},[vA]:{exposure:"event"},[_F]:{exposure:"event",shouldSkipFromEventProperties:t=>cn(t)},[kF]:{exposure:"event"},[EF]:{exposure:"event"},[CF]:{exposure:"event"},[PF]:{exposure:"event"},[AF]:{exposure:"hidden"},[_i]:{exposure:"hidden",storageGroup:"flags"},[No]:{exposure:"hidden",storageGroup:"flags"},[x2]:{exposure:"hidden"},[oc]:{exposure:"hidden",storageGroup:"flags"},[Fa]:{exposure:"hidden",storageGroup:"flags"},[ac]:{exposure:"hidden",storageGroup:"flags",volatile:!0},[Uf]:{exposure:"hidden",storageGroup:"flags"},[Di]:{exposure:"hidden"},[Ul]:{exposure:"hidden"},[ja]:{exposure:"hidden"},[Da]:{exposure:"hidden"},[Lf]:{exposure:"hidden",storageGroup:"surveys"},[Um]:{exposure:"hidden",storageGroup:"surveys",volatile:!0},[_A]:{exposure:"event"},[wA]:{exposure:"hidden"},[xA]:{exposure:"hidden"},[P2]:{exposure:"hidden"},[TF]:{exposure:"hidden"},[RF]:{exposure:"hidden"},[MF]:{exposure:"event"},[IF]:{exposure:"event"},[OF]:{exposure:"event"},[LF]:{exposure:"event"},[$a]:{exposure:"hidden"},[Of]:{exposure:"hidden"},[yA]:{exposure:"event"},[hh]:{exposure:"hidden"},[Ba]:{exposure:"hidden",storageGroup:"flags",volatile:!0},[Dr]:{exposure:"hidden"},[A2]:{exposure:"hidden"},[NF]:{exposure:"hidden"},[bA]:{exposure:"hidden"},[SA]:{exposure:"hidden"},[ku]:{exposure:"hidden"},[Vx]:{exposure:"hidden"},[wF]:{exposure:"event"},[xF]:{exposure:"event"},[bF]:{exposure:"event"},[SF]:{exposure:"event"},[EA]:{exposure:"event"},[CA]:{exposure:"event"},[Hx]:{exposure:"hidden"},[zx]:{exposure:"hidden"},[PA]:{exposure:"hidden"},[AA]:{exposure:"hidden"},[TA]:{exposure:"hidden"},[RA]:{exposure:"hidden"},[MA]:{exposure:"hidden"},[IA]:{exposure:"hidden"},[OA]:{exposure:"hidden"},[DF]:{exposure:"event"}},iV=[["$posthog_sr_group_event_trigger_",{exposure:"hidden"}],["$posthog_sr_group_url_trigger_",{exposure:"hidden"}],["$posthog_sr_group_sampling_",{exposure:"hidden"}]],ir=t=>{const e=sV[t];if(e)return e;for(const[n,r]of iV)if(t.indexOf(n)===0)return r};function KA(){try{return Intl.DateTimeFormat().resolvedOptions().timeZone}catch{return}}const YA=()=>{try{return"u">typeof window&&window.navigator.onLine!==!1}catch{return!1}},XA=(t,e)=>t>=e&&YA(),QA=(t,e,n,r)=>{if(t===0){if(YA()){const s=e+1;return s===n&&r(),s}return e}return 0},Cu=(t,e)=>{try{let n;return JSON.stringify(t,(r,s)=>{var i;return Sd(s)?((i=n)!==null&&i!==void 0||(n=new WeakMap),n.has(s)||n.set(s,DA(s)),n.get(s)):typeof s=="bigint"?s.toString():s},e)}catch{return u5(t)}},Bo=t=>{const e=he==null?void 0:he.createElement("a");return ce(e)?null:(e.href=t,e)},id=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(!Ue(r)||2>r.length)return"";{let s=r[1];try{s=decodeURIComponent(s)}catch{ye.error("Skipping decoding for malformed query param: "+s)}return s.replace(/\+/g," ")}},gh=function(t,e,n){if(!t||!e||!e.length)return t;const r=t.split("#"),s=r[1],i=(r[0]||"").split("?"),o=i[1],l=i[0],u=(o||"").split("&"),d=[];for(let h=0;u.length>h;h++){const g=u[h].split("=");Ue(g)&&(e.includes(g[0])?d.push(g[0]+"="+n):d.push(u[h]))}let f=l;return o!=null&&(f+="?"+d.join("&")),s!=null&&(f+="#"+s),f},Wm=function(t,e){const n=t.match(new RegExp(e+"=([^&]*)"));return n?n[1]:null},od=["gclid","gclsrc","dclid","gbraid","wbraid","fbclid","msclkid","twclid","li_fat_id","igshid","ttclid","rdt_cid","epik","qclid","sccid","oppref","irclid","_kx"],oV=["utm_source","utm_medium","utm_campaign","utm_content","utm_term","gad_source","mc_cid",...od],vh="<masked>",aV=["li_fat_id"];function JA(t,e,n){if(!he)return{};const r=e?[...od,...n||[]]:[],s=eT(gh(he.URL,r,vh),t),i=(function(){const o={};return Tt(aV,function(l){const u=Wf(l);o[l]=u||null}),o})();return qt(i,s)}function eT(t,e){const n=oV.concat(e||[]),r={};return Tt(n,function(s){const i=id(t,s);r[s]=i||null}),r}function tT(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=he?id(he.referrer,n):"";s.length&&(r.ph_keyword=s)}return r}function nT(){return navigator.language||navigator.userLanguage}function lV(){const t=nT();return typeof t=="string"?t.split("-")[0]:void 0}const qm="$direct";function rT(){return(he==null?void 0:he.referrer)||qm}function sT(t,e,n=!1){const r=t?[...od,...e||[]]:[],s=n?Ga(Wt==null?void 0:Wt.href):Wt==null?void 0:Wt.href,i=s==null?void 0:s.substring(0,1e3);return{r:rT().substring(0,1e3),u:i?gh(i,r,vh):void 0}}function iT(t,e=!1){var n;const{r,u:s}=t,i=e?Ga(s):s,o={$referrer:r,$referring_domain:r==null?void 0:r==qm?qm:(n=Bo(r))===null||n===void 0?void 0:n.host};if(i){o.$current_url=i;const l=Bo(i);o.$host=l==null?void 0:l.host,o.$pathname=l==null?void 0:l.pathname;const u=eT(i);qt(o,u)}if(r){const l=tT(r);qt(o,l)}return o}function cV(){try{return new Date().getTimezoneOffset()}catch{return}}const uV={flags:Ba,surveys:Um},dV=["cookie","localstorage","localstorage+cookie","sessionstorage","memory"],E0=t=>`${t}_cookie_identity_change_pending`,C0=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},Fn="main",Po=[_i,No,oc,Fa,ac,Ba,Uf,ja],Ay=t=>Po.indexOf(t)!==-1,oT=[Ou,Bf],hk=t=>oT.indexOf(t)!==-1,xa=(t,e)=>{try{return JSON.stringify(t)===JSON.stringify(e)}catch{return t===e}},lu=t=>{if(!t)return{};const e=JSON.parse(t);return st(e)?e:{}},pk=(t,e)=>{Tt(t,(n,r)=>{const s=ir(r);s&&s.exposure!=="event"||{}.hasOwnProperty.call(e,r)||delete t[r]})};var Ty=class{constructor(t,e,n=!0,r=!t.cookieless_mode){if(this.Zo={},this.Jo=!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.ca(t),this.Xo=this.ha(t),this.load(r),this.da(),t.debug&&ye.info("Persistence loaded",t.persistence,$({},this.props)),this.update_config(t,t,e),this.save(),ee){const s=()=>this.flush();kt(ee,"beforeunload",s,{capture:!1}),kt(ee,"pagehide",s,{capture:!1}),this.va=i=>{if(this.Jo&&(!i.storageArea||i.storageArea===(ee==null?void 0:ee.localStorage))&&i.key)if(i.key!==this.ua){if(this.Xo){const o=xf.find(l=>i.key===this.fa(l));o&&this.pa(i.key,o)}}else this.pa(i.key,Fn)},kt(ee,"storage",this.va)}}markCrossTabFeatureFlagChanges(t){Object.entries(t).forEach(([e,n])=>{const r=this.ea.get(e);if(!Ay(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&&ee&&(ee.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!==Fn&&(l.persisted=!1),!1}r=lu(s)}catch{return!1}const i=e===Fn?r:yt.Lt(this.ua);if(i&&this.ya(i))return!1;const o=this.ba(r,e,n);return e===Fn&&this.Xo&&!xa(this._a().main,r)||this.wa(r,e,!0,s),o}ya(t){const e=this.props[hi],n=t[hi];return!ce(e)&&!ce(n)&&e!==n}wa(t,e,n,r){const s=this.ma(e);s.storageValue=r,e!==Fn&&(s.persisted=n);try{s.fingerprint=this.ka(t,e)}catch{s.fingerprint=void 0}}ba(t,e,n){let r=!1;return Po.forEach(s=>{var i;const o=(i=ir(s))===null||i===void 0?void 0:i.storageGroup;if(e===Fn&&this.Xo&&o||e!==Fn&&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&&xa(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.Jo)return!1;try{this.sa=!1;const t=yt.Ot(this.ua),e=this.ma(Fn);let n,r=!1,s=!1;if(t!==e.storageValue)if(cn(t))e.storageValue=null;else{if(n=lu(t),this.sa=!this.na&&this.ya(n),this.sa)return!1;s=this.ba(n,Fn,!1),!this.Xo||xa(this._a().main,n)?this.wa(n,Fn,!0,t):e.storageValue=t,r=!0}return this.Xo&&xf.forEach(i=>{const o=yt.Ot(this.fa(i)),l=this.ma(i),u=n||{},d=r&&Po.some(h=>{var g;return((g=ir(h))===null||g===void 0?void 0:g.storageGroup)===i&&h 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=lu(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=ir(t);n!=null&&n.volatile||(this.ma((this.Xo?n==null?void 0:n.storageGroup:void 0)||Fn).fingerprint=void 0,this.Ta(t))}Ia(){Po.forEach(t=>this.ea.set(t,!0))}da(){if(this.Jo)try{const t=yt.Ot(this.ua),e=lu(t);this.ma(Fn).storageValue=t,Po.forEach(n=>{var r;const s=this.Xo?(r=ir(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)?lu(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(Ue(e)?e:[]),o=new Set(Ue(this.props[t])?this.props[t]:[]);return n.forEach(l=>o.has(l)?i.add(l):i.delete(l)),Array.from(i)}const r=st(e)?$({},e):{},s=st(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(!Ay(t))return;const r=this.ea.get(t);if(r===!0)return;let s=e;if(this.Jo)try{var i;const l=this.Xo?(i=ir(t))===null||i===void 0?void 0:i.storageGroup:void 0,u=l?this.fa(l):this.ua;s=lu(yt.Ot(u))[t]}catch{}const o=new Set(r||[]);if(t==="$active_feature_flags"){if(!ce(e)&&!Ue(e)||!ce(s)&&!Ue(s)||!Ue(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(!st(n))return void(xa(s,n)?this.ea.delete(t):this.ga(t,!0));{if(!ce(e)&&!st(e)||ce(e)&&Yr(n)&&ce(s))return void this.ga(t,!0);const l=st(e)?e:{},u=st(s)?s:{};new Set([...Object.keys(l),...Object.keys(n)]).forEach(d=>{d in l==d in n&&xa(l[d],n[d])||o.add(d)}),o.forEach(d=>{d in u==d in n&&xa(u[d],n[d])&&o.delete(d)})}}o.size?this.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=ky(t,this.Mr.cookie_persisted_properties||[]),n=X8(e,this.Mr.cookie_persisted_properties||[]),r=JSON.stringify(e)+"|"+JSON.stringify(n),s=ln.Ot(this.ua)||void 0;s&&Ey(this.ua,s)===r&&(this.Ra=r,this.Aa=s)}catch{}else try{const e=ln.Ot(this.ua)||void 0;this.Ra=e?Ey(this.ua,e):void 0,this.Aa=e}catch{}}syncCookieProperties(){return this.Fa(this.Mr)}Fa(t,e=!1){if(this.hi&&!e||this.ta||!t.cookieWinsOnConflict||t.persistence.toLowerCase()!=="localstorage+cookie")return!1;let n;try{n=ln.Ot(this.ua)||void 0}catch{}if(!n||n===this.Aa)return!1;const r=Ey(this.ua,n);let s;try{s=Sy(JSON.parse(n))}catch{return!1}if((ln.Ot(this.ua)||void 0)!==n)return!1;this.Ra=r,this.Aa=n;const i=Q8(this.ua,n),o=[...Bl,...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[_])}),Yr(s))return!1;const u="distinct_id"in s||s.$user_state==="anonymous"||s.$user_state==="identified",d=this.props,f=d[hi],h=d[Dr],g=qt({},d);[...Bl,...t.cookie_persisted_properties||[]].forEach(_=>{if(o.indexOf(_)!==-1&&!(_ in s)&&!l[_]&&(u||_!=="distinct_id"&&_!=="$user_state")){const x=g[_];(i.isValid||Bl.indexOf(_)===-1||x!==!1&&x!==0)&&delete g[_]}}),this.props=qt(g,s),Po.forEach(_=>{const x=_ in this.props;_ in d===x&&xa(d[_],this.props[_])||(x?this.Ma(_,d[_],this.props[_]):this.ga(_,!0))}),!u||"$user_state"in s||"$user_state"in this.props||this.xa(Dr,Do);const v=this.props[hi],w=this.props[Dr];return!u||v===f&&w===h||(this.na=!0,this.Yo=!0,zt.$t(E0(this.ua),!0),this.$a(ja),this.$a(No),this.$a(_i),this.$a(oc),this.$a(Fa),this.$a(ac),this.$a(Ba),this.$a(hh),this.$a($a),w!=="anonymous"||h!=="identified"&&s.$user_state!=="anonymous"&&(ce(f)||v===f)||(pk(this.props,s),this.$a(Da)),w==="identified"?this.props.$user_id=v:delete this.props.$user_id,this.$a(zm)),!0}consumeCookieIdentityChange(){const t=E0(this.ua),e=this.Yo||!!zt.Ot(t);return this.Yo=!1,e&&zt.Pt(t),e}Oa(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.Zo[Fn],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}ca(t){dV.indexOf(t.persistence.toLowerCase())===-1&&(ye.critical("Unknown persistence type "+t.persistence+"; falling back to localStorage+cookie"),t.persistence="localStorage+cookie");const e=((o=[],l=!1,u=()=>!1)=>{const d=[...Bl,...o];return $($({},yt),{},{Lt(f){try{let g,v={};try{g=ln.Ot(f)||void 0,v=g?Sy(JSON.parse(g)):{}}catch{}const w=JSON.parse(yt.Ot(f)||"{}");let _;if(l){const x=Q8(f,g),S=[...Bl,...x.properties],k={};Object.keys(v).forEach(A=>{const T=v[A];cn(T)||T===""||A==="$user_state"&&T!=="anonymous"&&T!=="identified"||(k[A]=T)});const C="distinct_id"in k||k.$user_state==="anonymous"||k.$user_state==="identified";if(Object.keys(k).length>0){var h;const A=w[hi],T=(h=w.$user_state)!==null&&h!==void 0?h:Do;d.forEach(I=>{if(S.indexOf(I)!==-1&&!(I in v)&&(C||I!=="distinct_id"&&I!=="$user_state")){const M=w[I];(x.isValid||Bl.indexOf(I)===-1||M!==!1&&M!==0)&&delete w[I]}}),!C||"$user_state"in v||"$user_state"in w||(w[Dr]=Do),!C||("distinct_id"in k?k[hi]:w[hi])===A&&("$user_state"in k?k[Dr]:w[Dr])===T||(by.forEach(I=>delete w[I]),k.$user_state==="identified"&&"distinct_id"in k?w.$user_id=k[hi]:delete w.$user_id,k.$user_state!=="identified"&&(delete w[yA],delete w[Da]),delete w.__alias)}_=qt(w,k)}else _=qt(v,w);return u()||yt.$t(f,_),_}catch{}return null},$t(f,h,g,v,w,_){const x=yt.$t(f,h,void 0,void 0,_);try{const S=ky(h,o);if(Object.keys(S).length){if(l){const k=Zm(f),C=X8(S,o);if(ln.$t(k,C,g,v,w,_),ln.Ot(k)!==JSON.stringify(C)){ln.Pt(k,v);const A=ky(h);return ln.$t(f,A,g,v,w,_),x}}ln.$t(f,S,g,v,w,_)}}catch(S){yt.Dt(S)}return x},Pt(f,h){try{ee==null||ee.localStorage.removeItem(f),ln.Pt(f,h),ln.Pt(Zm(f),h)}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.At()?(n=yt,s=!0):i==="localstorage+cookie"&&e.At()?(n=e,s=!0,r=!0):i==="sessionstorage"&&zt.At()?n=zt:i==="memory"?n=M2:i==="cookie"&&ln.At()?(n=ln,r=!0):e.At()?(n=e,s=!0,r=!0):ln.At()?(n=ln,r=!0):n=M2,this.Jo=s,this.Ko=r,n}fa(t){return`${this.ua}__${t}`}ha(t){return this.Jo&&!!t.split_storage}properties(){const t={};return Tt(this.props,(e,n)=>{const r=ir(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=Sy(ln.Lt(this.ua)),Tt(r,(l,u)=>{(ce(l)||cn(l)||l==="")&&delete r[u]})}catch{}const s=this.No.Lt(this.ua);if(s&&(this.props=qt({},s)),this.Xo&&this.ja(),e&&s){var i,o;const l=n==null?void 0:n[hi],u=(i=n==null?void 0:n.$user_state)!==null&&i!==void 0?i:Do,d=s[hi],f=(o=s.$user_state)!==null&&o!==void 0?o:Do;if(d!==l||f!==u){this.Yo=!0,this.hi||zt.$t(E0(this.ua),!0);const h=qt({},this.props);by.forEach(v=>delete h[v]),f!=="anonymous"||u!=="identified"&&r.$user_state!=="anonymous"&&(ce(l)||d===l)||(pk(h,r),delete h[Da]),this.props=h;const g=new Set;by.forEach(v=>{var w;const _=(w=ir(v))===null||w===void 0?void 0:w.storageGroup;_&&g.add(_)}),g.forEach(v=>{if(this.hi)return;const w={};Tt(this.props,(_,x)=>{var S;((S=ir(x))===null||S===void 0?void 0:S.storageGroup)===v&&(w[x]=_)}),Yr(w)?(yt.Pt(this.fa(v)),this.Zo[v]={}):yt.$t(this.fa(v),w)&&(this.Zo[v]={persisted:!0,fingerprint:this.ka(w,v)})})}}zt.Ot(E0(this.ua))&&(this.Yo=!0)}ja(){for(const t of xf){const e=yt.Lt(this.fa(t));if(e&&!Yr(e)){const n=this.ma(t);n.persisted=!0,this.Ba(t)||(n.fingerprint=this.ka(e,t)),this.za(t,e)||qt(this.props,e)}}}Ba(t){return Object.keys(this.props).some(e=>{var n;return((n=ir(e))===null||n===void 0?void 0:n.storageGroup)===t})}za(t,e){const n=uV[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=ir(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"||oT.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&&ye.warn("skipping persistence write because storage belongs to a different distinct ID"));if(this.Xo)return this.Ha(),void(n&&this.oa.forEach(s=>s()));const r=this.Ua(this.No,this.ua,this.props,Fn);r==="written"&&this.Pa(this.props),r!=="failed"&&(this.ea.clear(),this.na=!1,this.ra.clear()),n&&this.oa.forEach(s=>s())}Ha(){const{main:t,groups:e}=this._a(),n=this.Ua(this.No,this.ua,t,Fn);n==="written"&&this.Pa(t),n!=="failed"&&(this.na=!1,this.ra.clear(),Po.forEach(s=>{var i;!((i=ir(s))===null||i===void 0)&&i.storageGroup||this.ea.delete(s)}));for(const s of xf){var r;const i=e[s];if(Yr(i)&&!(!((r=this.Zo[s])===null||r===void 0)&&r.persisted)){Po.forEach(l=>{var u;((u=ir(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"&&Po.forEach(l=>{const u=ir(l);(u==null?void 0:u.storageGroup)!==s||o!=="written"&&u.volatile||this.ea.delete(l)})}}_a(){const t={},e={flags:{},surveys:{}};return Tt(this.props,(n,r)=>{var s;const i=(s=ir(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===Fn)return JSON.stringify(t)+"|"+this.Wa+"|"+this.Va+"|"+this.Ga;const n={};return Tt(t,(r,s)=>{var i;n[s]=!((i=ir(s))===null||i===void 0)&&i.volatile?"__volatile__":r}),JSON.stringify(n)}Ua(t,e,n,r){const s=this.ma(r);if(r!==Fn&&!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!==Fn&&(s.persisted=!0),ce(i)||(s.fingerprint=i),this.Jo&&(s.storageValue=yt.Ot(e)),"written"):(this.Mr.debug&&ye.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 xf)yt.Pt(this.fa(e));t?delete this.Zo[Fn]:this.Zo={},this.Ra=void 0,this.Aa=void 0}clear(){this.remove(),this.props={}}register_once(t,e,n){if(st(t)){this.syncCookieProperties(),ce(e)&&(e="None"),this.Wa=ce(n)?this.Qa:n;let r=!1;if(Tt(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(st(t)){this.syncCookieProperties(),this.Wa=ce(e)?this.Qa:e;let n=!1;if(Tt(t,(r,s)=>{t.hasOwnProperty(s)&&(this.props[s]!==r||st(r)||Ue(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=he==null?void 0:he.URL;if(t===this.la)return;const e=JA(this.Mr.custom_campaign_params,this.Mr.mask_personal_data_properties,this.Mr.custom_personal_data_properties),n=!Yr(Zx(e));return n&&this.register(e),this.la=t,n?e:void 0}update_search_keyword(){this.register((function(){const t=he==null?void 0:he.referrer;return t?tT(t):{}})())}update_referrer_info(){var t;this.register_once({$referrer:rT(),$referring_domain:(he==null?void 0:he.referrer)&&((t=Bo(he.referrer))===null||t===void 0?void 0:t.host)||qm},void 0)}set_initial_person_info(){if(this.props.$initial_campaign_params||this.props.$initial_referrer_info)return;const t=sT(this.Mr.mask_personal_data_properties,this.Mr.custom_personal_data_properties,this.Mr.disable_capture_url_hashes);this.register_once({[ku]:this.Ko?{r:C0(t.r),u:t.u?C0(t.u):void 0}:t},void 0)}get_initial_props(){const t={};Tt([SA,bA],n=>{const r=this.props[n];r&&Tt(r,function(s,i){t["$initial_"+f2(i)]=s})});const e=this.props[ku];if(e){const n=(function(r,s=!1){const i=iT(r,s),o={};return Tt(i,function(l,u){o[`$initial_${f2(u)}`]=l}),o})(e,this.Mr.disable_capture_url_hashes);qt(t,n)}return t}safe_merge(t){return Tt(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.Fa(e,u),this.Mr=t,!l&&(r||s||o)&&(this.Ra=void 0,this.Aa=void 0,this.Fa($($({},t),{},{cookie_persisted_properties:e.cookie_persisted_properties}),u));const d=i||o?this.ca(t):this.No;this.Za();const f=this.ha(t),h=i||f!==this.Xo,g=!l&&(h||t.cross_subdomain_cookie!==this.Va||t.secure_cookie!==this.Ga)&&this.Oa(u);this.ia=h;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),h){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.Zo[Fn],this.Na()))}finally{this.ia=!1,g&&this.qa()}}Za(){const t=this.props[ku];if(!this.Ko||!st(t)||typeof t.r!="string")return;const e=C0(t.r),n=typeof t.u=="string"?C0(t.u):t.u;e===t.r&&n===t.u||this.xa(ku,$($({},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(b2,n),this.save()}remove_event_timer(t){const e=this.props.__timers||{},n=e[t];return ce(n)||(delete e[t],this.xa(b2,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),hk(t)&&!xa(s,e)&&this.ra.add(t),this.Ma(t,s,e),!((r=ir(t))===null||r===void 0)&&r.volatile||this.Ta(t))}$a(t,e=!0){delete this.props[t],e&&(Ay(t)&&this.ga(t,!0),hk(t)&&this.ra.add(t),this.Ta(t))}Ta(t){var e;const n=(e=ir(t))===null||e===void 0?void 0:e.storageGroup;n&&(this.ma(n).dirty=!0)}ma(t){return this.Zo[t]||(this.Zo[t]={})}};const xs={GZipJS:"gzip-js",Base64:"base64"},bf={Activation:"events",Cancellation:"cancelEvents"},Ry={Popover:"popover",API:"api",Widget:"widget"},ws={SHOWN:"survey shown",DISMISSED:"survey dismissed",SENT:"survey sent"},My={SURVEY_ID:"$survey_id",SURVEY_ITERATION:"$survey_iteration",SURVEY_LAST_SEEN_DATE:"$survey_last_seen_date"},L2={Popover:"popover",Inline:"inline"};function P0(t){let e=!0;return{dispose(){if(e){e=!1;const n=t();n&&Ln(n.then)&&n.then(void 0,()=>{})}}}}const fV={SHOWN:"product tour shown"},mk={TOUR_LAST_SEEN_DATE:"$product_tour_last_seen_date",TOUR_TYPE:"$product_tour_type"},gk=dn("[RateLimiter]");var hV=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=>{gk.info(`${r||"events"} is quota limited.`),this.serverLimits[r]=new Date().getTime()+6e4})}catch(r){return void gk.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.Ja(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!Ue(e)||!e.includes(t)}Xa(){var t;if(this.Ka("$current_url")&&this.Ka("$pathname")&&(Wt!=null&&Wt.pathname))return`${(t=Wt.origin)!==null&&t!==void 0?t:""}${Wt.pathname}`}Ja(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 ba=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 ba.info("Using preloaded remote config",this.remoteConfig),void this.el(this.remoteConfig);if(this._instance.il())return void ba.warn("Remote config is disabled. Falling back to local config.");this.Ya(t=>{if(!t)return ba.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){ba.error("Error loading remote config",t),this.el()}}el(t,e){!t&&e&&(e.statusCode===0?e.error||ba.warn("Failed to fetch remote config from PostHog."):ba.error("Failed to fetch remote config from PostHog."));try{this._instance.el(t?{ok:!0,config:t}:{ok:!1})}catch(r){ba.error("Error applying remote config",r)}if((t==null?void 0:t.hasFeatureFlags)!==!1&&!this._instance.config.advanced_disable_feature_flags_on_first_load)try{var n;(n=this._instance.featureFlags)===null||n===void 0||n.ensureFlagsLoaded()}catch(r){ba.error("Error loading feature flags",r)}}},Ys=Uint8Array,Qr=Uint16Array,ad=Uint32Array,Xx=new Ys([0,0,0,0,0,0,0,0,1,1,1,1,2,2,2,2,3,3,3,3,4,4,4,4,5,5,5,5,0,0,0,0]),Qx=new Ys([0,0,0,0,1,1,2,2,3,3,4,4,5,5,6,6,7,7,8,8,9,9,10,10,11,11,12,12,13,13,0,0]),vk=new Ys([16,17,18,0,8,7,9,6,10,5,11,4,12,3,13,2,14,1,15]),lT=function(t,e){for(var n=new Qr(31),r=0;31>r;++r)n[r]=e+=1<<t[r-1];var s=new ad(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]},cT=lT(Xx,2),N2=cT[1];cT[0][28]=258,N2[258]=28;for(var yk=lT(Qx,0)[1],uT=new Qr(32768),un=0;32768>un;++un){var cu=(43690&un)>>>1|(21845&un)<<1;uT[un]=((65280&(cu=(61680&(cu=(52428&cu)>>>2|(13107&cu)<<2))>>>4|(3855&cu)<<4))>>>8|(255&cu)<<8)>>>1}var Gf=function(t,e,n){for(var r=t.length,s=0,i=new Qr(e);r>s;++s)++i[t[s]-1];var o,l=new Qr(e);for(s=0;e>s;++s)l[s]=l[s-1]+i[s-1]<<1;for(o=new Qr(r),s=0;r>s;++s)o[s]=uT[l[t[s]-1]++]>>>15-t[s];return o},gc=new Ys(288);for(un=0;144>un;++un)gc[un]=8;for(un=144;256>un;++un)gc[un]=9;for(un=256;280>un;++un)gc[un]=7;for(un=280;288>un;++un)gc[un]=8;var Gm=new Ys(32);for(un=0;32>un;++un)Gm[un]=5;var pV=Gf(gc,9),mV=Gf(Gm,5),dT=function(t){return(t/8|0)+(7&t&&1)},fT=function(t,e,n){(n==null||n>t.length)&&(n=t.length);var r=new(t instanceof Qr?Qr:t instanceof ad?ad:Ys)(n-e);return r.set(t.subarray(e,n)),r},wo=function(t,e,n){var r=e/8|0;t[r]|=n<<=7&e,t[r+1]|=n>>>8},Sf=function(t,e,n){var r=e/8|0;t[r]|=n<<=7&e,t[r+1]|=n>>>8,t[r+2]|=n>>>16},Iy=function(t,e){for(var n=[],r=0;t.length>r;++r)t[r]&&n.push({s:r,f:t[r]});var s=n.length,i=n.slice();if(!s)return[new Ys(0),0];if(s==1){var o=new Ys(n[0].s+1);return o[n[0].s]=1,[o,1]}n.sort(function(T,I){return T.f-I.f}),n.push({s:-1,f:25001});var l=n[0],u=n[1],d=0,f=1,h=2;for(n[0]={s:-1,f:l.f+u.f,l,r:u};f!=s-1;)l=n[n[h].f>n[d].f?d++:h++],u=n[d!=f&&n[h].f>n[d].f?d++:h++],n[f++]={s:-1,f:l.f+u.f,l,r:u};var g=i[0].s;for(r=1;s>r;++r)i[r].s>g&&(g=i[r].s);var v=new Qr(g+1),w=D2(n[f-1],v,0);if(w>e){r=0;var _=0,x=w-e,S=1<<x;for(i.sort(function(T,I){return v[I.s]-v[T.s]||T.f-I.f});s>r;++r){var k=i[r].s;if(e>=v[k])break;_+=S-(1<<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 A=i[r].s;v[A]==e&&(--v[A],++_)}w=e}return[new Ys(v),w]},D2=function(t,e,n){return t.s==-1?Math.max(D2(t.l,e,n+1),D2(t.r,e,n+1)):e[t.s]=n},_k=function(t){for(var e=t.length;e&&!t[--e];);for(var n=new Qr(++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]},kf=function(t,e){for(var n=0,r=0;e.length>r;++r)n+=t[r]*e[r];return n},j2=function(t,e,n){var r=n.length,s=dT(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)},wk=function(t,e,n,r,s,i,o,l,u,d,f){wo(e,f++,n),++s[256];for(var h=Iy(s,15),g=h[0],v=h[1],w=Iy(i,15),_=w[0],x=w[1],S=_k(g),k=S[0],C=S[1],A=_k(_),T=A[0],I=A[1],M=new Qr(19),R=0;k.length>R;++R)M[31&k[R]]++;for(R=0;T.length>R;++R)M[31&T[R]]++;for(var O=Iy(M,7),N=O[0],D=O[1],F=19;F>4&&!N[vk[F-1]];--F);var K,B,G,H,Y=d+5<<3,U=kf(s,gc)+kf(i,Gm)+o,J=kf(s,g)+kf(i,_)+o+14+3*F+kf(M,N)+(2*M[16]+3*M[17]+7*M[18]);if(U>=Y&&J>=Y)return j2(e,f,t.subarray(u,u+d));if(wo(e,f,1+(U>J)),f+=2,U>J){K=Gf(g,v),B=g,G=Gf(_,x),H=_;var Z=Gf(N,D);for(wo(e,f,C-257),wo(e,f+5,I-1),wo(e,f+10,F-4),f+=14,R=0;F>R;++R)wo(e,f+3*R,N[vk[R]]);f+=3*F;for(var j=[k,T],Q=0;2>Q;++Q){var oe=j[Q];for(R=0;oe.length>R;++R)wo(e,f,Z[ne=31&oe[R]]),f+=N[ne],ne>15&&(wo(e,f,oe[R]>>>5&127),f+=oe[R]>>>12)}}else K=pV,B=gc,G=mV,H=Gm;for(R=0;l>R;++R)if(r[R]>255){var ne;Sf(e,f,K[257+(ne=r[R]>>>18&31)]),f+=B[ne+257],ne>7&&(wo(e,f,r[R]>>>23&31),f+=Xx[ne]);var se=31&r[R];Sf(e,f,G[se]),f+=H[se],se>3&&(Sf(e,f,r[R]>>>5&8191),f+=Qx[se])}else Sf(e,f,K[r[R]]),f+=B[r[R]];return Sf(e,f,K[256]),f+B[256]},gV=new ad([65540,131080,131088,131104,262176,1048704,1048832,2114560,2117632]),vV=(function(){for(var t=new ad(256),e=0;256>e;++e){for(var n=e,r=9;--r;)n=(1&n&&3988292384)^n>>>1;t[e]=n}return t})(),Oy=function(t,e,n){for(;n;++e)t[e]=n,n>>>=8};function yV(t,e){e===void 0&&(e={});var n=(function(){var h=4294967295;return{p(g){for(var v=h,w=0;g.length>w;++w)v=vV[255&v^g[w]]^v>>>8;h=v},d(){return 4294967295^h}}})(),r=t.length;n.p(t);var s,i,o,l,u,d=(l=10+((s=e).filename&&s.filename.length+1||0),u=8,(function(h,g,v,w,_,x){var S=h.length,k=new Ys(w+S+5*(1+Math.floor(S/7e3))+_),C=k.subarray(w,k.length-_),A=0;if(!g||8>S)for(var T=0;S>=T;T+=65535){var I=T+65535;S>I?A=j2(C,A,h.subarray(T,I)):(C[T]=x,A=j2(C,A,h.subarray(T,S)))}else{for(var M=gV[g-1],R=M>>>13,O=8191&M,N=(1<<v)-1,D=new Qr(32768),F=new Qr(N+1),K=Math.ceil(v/3),B=2*K,G=function(Lt){return(h[Lt]^h[Lt+1]<<K^h[Lt+2]<<B)&N},H=new ad(25e3),Y=new Qr(288),U=new Qr(32),J=0,Z=0,j=(T=0,0),Q=0,oe=0;S>T;++T){var ne=G(T),se=32767&T,de=F[ne];if(D[se]=de,F[ne]=se,T>=Q){var ve=S-T;if((J>7e3||j>24576)&&ve>423){A=wk(h,C,0,H,Y,U,Z,j,oe,T-oe,A),j=J=Z=0,oe=T;for(var ue=0;286>ue;++ue)Y[ue]=0;for(ue=0;30>ue;++ue)U[ue]=0}var ae=2,Oe=0,We=O,Ee=se-de&32767;if(ve>2&&ne==G(T-Ee))for(var pt=Math.min(R,ve)-1,Ot=Math.min(32767,T),en=Math.min(258,ve);Ot>=Ee&&--We&&se!=de;){if(h[T+ae]==h[T+ae-Ee]){for(var bt=0;en>bt&&h[T+bt]==h[T+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=T-Ee+ue+32768&32767,Ct=Ke-D[Ke]+32768&32767;Ct>qe&&(qe=Ct,de=Ke)}}}Ee+=(se=de)-(de=D[se])+32768&32767}if(Oe){H[j++]=268435456|N2[ae]<<18|yk[Oe];var Te=31&N2[ae],Ye=31&yk[Oe];Z+=Xx[Te]+Qx[Ye],++Y[257+Te],++U[Ye],Q=T+ae,++J}else H[j++]=h[T],++Y[h[T]]}}A=wk(h,C,x,H,Y,U,Z,j,oe,T-oe,A)}return fT(k,0,w+dT(A)+_)})(i=t,(o=e).level==null?6:o.level,o.mem==null?Math.ceil(1.5*Math.max(8,Math.min(13,Math.log(i.length)))):12+o.mem,l,u,!0)),f=d.length;return(function(h,g){var v=g.filename;if(h[0]=31,h[1]=139,h[2]=8,h[8]=2>g.level?4:g.level==9?2:0,h[9]=3,g.mtime!=0&&Oy(h,4,Math.floor(new Date(g.mtime||Date.now())/1e3)),v){h[3]=8;for(var w=0;v.length>=w;++w)h[w+10]=v.charCodeAt(w)}})(d,e),Oy(d,f-8,n.d()),Oy(d,f-4,r),d}const _V=!!Rx||!!dh,hT=new WeakMap,pT="text/plain";let Ly=0,lm=!1;const mT=(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}`:""}`},ep=(t,e,n=!0)=>{var r;const[s,i]=t.split("?"),o=$({},e),l=(r=i==null?void 0:i.split("&").map(d=>{var f;const[h,g]=d.split("="),v=n&&(f=o[h])!==null&&f!==void 0?f:g;return delete o[h],`${h}=${v}`}))!==null&&r!==void 0?r:[],u=(function(d,f="&"){let h,g;const v=[];return Tt(d,function(w,_){ce(w)||ce(_)||_==="undefined"||(h=encodeURIComponent((x=>x instanceof File)(w)?w.name:w.toString()),g=encodeURIComponent(_),v[v.length]=g+"="+h)}),v.join(f)})(o);return u&&l.push(u),l.length>0?`${s}?${l.join("&")}`:s},Ny=t=>{if(t.nl)return t.nl;const{data:e,compression:n}=t;if(!e)return;if(n===xs.GZipJS){const s=yV((function(i){var o=i.length;if(typeof TextEncoder<"u")return new TextEncoder().encode(i);for(var l=new Ys(i.length+(i.length>>>1)),u=0,d=function(v){l[u++]=v},f=0;o>f;++f){if(u+5>l.length){var h=new Ys(u+8+(o-f<<1));h.set(l),l=h}var g=i.charCodeAt(f);128>g?d(g):2048>g?(d(192|g>>>6),d(128|63&g)):g>55295&&57344>g?(d(240|(g=65536+(1047552&g)|1023&i.charCodeAt(++f))>>>18),d(128|g>>>12&63),d(128|g>>>6&63),d(128|63&g)):(d(224|g>>>12),d(128|g>>>6&63),d(128|63&g))}return fT(l,0,u)})(Cu(e)),{mtime:0});return{contentType:pT,body:s.buffer.slice(s.byteOffset,s.byteOffset+s.byteLength),estimatedSize:s.byteLength}}if(n===xs.Base64){const s=(function(o){return o&&btoa(encodeURIComponent(o).replace(/%([0-9A-F]{2})/g,(l,u)=>String.fromCharCode(parseInt(u,16))))})(Cu(e)),i=(o=>"data="+encodeURIComponent(typeof o=="string"?o:Cu(o)))(s);return{contentType:"application/x-www-form-urlencoded",body:i,estimatedSize:new Blob([i]).size}}const r=Cu(e);return{contentType:"application/json",body:r,estimatedSize:new Blob([r]).size}},gT=t=>{const e=()=>t.transport==="sendBeacon"?{url:ep(t.url,{compression:xs.Base64}),encodedBody:Ny($($({},t),{},{compression:xs.Base64,nl:void 0}))}:{url:mT(t.url,"compression"),encodedBody:Ny($($({},t),{},{compression:void 0,nl:void 0}))};let n;try{n=Ny(t)}catch(s){if(j8(t.compression,id(t.url,"compression")))return ye.error("Failed to gzip request body, sending uncompressed payload",s),e();throw s}return n&&j8(t.compression,id(t.url,"compression"))&&!((r=n.body)instanceof ArrayBuffer?y2(new Uint8Array(r)):ArrayBuffer.isView(r)&&y2(new Uint8Array(r.buffer,r.byteOffset,r.byteLength)))?(lm=!0,e()):{url:t.url,encodedBody:n};var r},vT=t=>{try{return gT(t)}catch(n){var e;return ye.error(n),void((e=t.callback)===null||e===void 0||e.call(t,{statusCode:0,error:n}))}},wV=(function(){var t=Kt(function*(e){const n=yield(function(s){return _2.apply(this,arguments)})(Cu(e.data),Un.DEBUG,{rethrow:!0});if(!n)return e;const r=yield n.arrayBuffer();return $($({},e),{},{nl:{contentType:pT,body:r,estimatedSize:r.byteLength}})});return function(e){return t.apply(this,arguments)}})(),xV=/Failed to fetch|NetworkError|Load failed/i,yT=t=>(t==null?void 0:t.name)==="TypeError"&&xV.test((t==null?void 0:t.message)||""),_T=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,im):void 0})(t());return ce(e)?void 0:Math.min(e,3e4)}catch{return}},wT=t=>{const e=vT(t);if(!e)return;const n=new Rx;hT.set(n,!0);const{url:r,encodedBody:s}=e;n.open(t.method||"GET",r,!0);const{contentType:i,body:o}=s??{};Tt(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,_T(()=>n.getResponseHeader("Retry-After")))}},n.send(o)},xT=t=>{const e=vT(t);if(!e)return;const{url:n,encodedBody:r}=e,{contentType:s,body:i,estimatedSize:o}=r??{},l=new Headers;Tt(t.headers,function(w,_){l.append(_,w)}),s&&l.append("Content-Type",s);let u=null,d=!1;if(b8){const w=new b8;u={signal:w.signal,timeout:setTimeout(()=>{d=!0;try{w.abort(B5("AbortError","PostHog request timed out"+((_=t.timeout)?` after ${_}ms`:"")))}catch(x){h(x)}var _},t.timeout)}}let f=!1;const h=w=>{var _;f||(f=!0,d&&(w==null?void 0:w.name)==="AbortError"||yT(w)?ye.warn(w):ye.error(w),(_=t.callback)===null||_===void 0||_.call(t,{statusCode:0,error:w}))};let g=0;const v=()=>{Ly-=g,g=0,u&&clearTimeout(u.timeout)};try{const w=$({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>Ly+_,w.keepalive&&(g=_,Ly+=g),dh(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(A){ye.error(A)}f=!0,v(),(k=t.callback)===null||k===void 0||k.call(t,C,_T(()=>x.headers.get("Retry-After")))})).catch(x=>{v(),h(x)}).finally(v)}catch(w){v(),h(w)}},$2=t=>{try{var e;const{url:n,encodedBody:r}=gT(t),{contentType:s,body:i,estimatedSize:o}=r??{};if(!i)return;const l=i instanceof Blob?i:new Blob([i],{type:s});if(Qn.sendBeacon(n,l))return;const u=Ue(t.data)?t.data:(e=t.data)===null||e===void 0?void 0:e.batch;if(Ue(u)&&u.length>1&&(o??0)>16384){const d=Math.ceil(u.length/2),f=h=>Ue(t.data)?h:$($({},t.data),{},{batch:h});return $2($($({},t),{},{data:f(u.slice(0,d))})),void $2($($({},t),{},{data:f(u.slice(d))}))}ye.warn(`Beacon of ~${o??0} bytes was rejected by the browser, falling back to ${dh?"fetch":"XHR"}`),dh?xT($($({},t),{},{sl:!0})):wT(t)}catch(n){ye.warn("Beacon send failed",n)}},xk=(t,e,n,r)=>{const s=r==="query"?e==="POST"?"sent_at":"_":void 0;return ep(n===xs.GZipJS?mT(t,"compression"):t,$($({},s?{[s]:Date.now().toString()}:{}),n===xs.GZipJS?{}:{compression:n}))},bV=(()=>{const t=[];return dh&&t.push({transport:"fetch",method:xT}),Rx&&t.push({transport:"XHR",method:wT}),Qn!=null&&Qn.sendBeacon&&t.push({transport:"sendBeacon",method:$2}),t})();let bT=!_V&&(Nr==null?void 0:Nr.indexOf("MSIE"))===-1&&(Nr==null?void 0:Nr.indexOf("Mozilla"))===-1;function ST(t,e,n){var r,s,i;n&&(e=$($({},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=$($({},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 h=$($({},o),{},{callback:l??(x=>{var S;return(S=o.callback)===null||S===void 0?void 0:S.call(o,x)})});h.timeout=h.timeout||6e4;const g=(u=h.transport)!==null&&u!==void 0?u:"fetch";g==="sendBeacon"&&ce(h.compression)&&h.data&&(h.compression=xs.Base64),h.method==="POST"&&h.data&&(h.timestampMode==="capture-body"?h.data=(x=>{var S,k;const C=(Ue(x)?x:[x]).map(T=>$($({},T),T.timestamp instanceof Date&&!isNaN(T.timestamp.getTime())?{timestamp:T.timestamp.toISOString()}:{})),A=C[0];return{api_key:(S=A==null||(k=A.properties)===null||k===void 0?void 0:k.token)!==null&&S!==void 0?S:A==null?void 0:A.token,batch:C,sent_at:new Date().toISOString()}})(h.data):h.timestampMode==="body"&&(h.data=((x,S=new Date().toISOString())=>Ue(x)?x.map(k=>$($({},k),{},{sent_at:S})):$($({},x),{},{sent_at:S}))(h.data))),h.url=xk(h.url,h.method,h.compression,h.timestampMode);const v=bV.filter(x=>!h.disableTransport||!x.transport||!h.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;yT(k)?ye.warn(k):ye.error(k),(S=h.callback)===null||S===void 0||S.call(h,{statusCode:0,error:k})}};g!=="sendBeacon"&&!h.preferSyncCompression&&h.data&&h.compression===xs.GZipJS&&$j&&typeof Promise<"u"&&!lm?wV(h).then(x=>{_(x)}).catch(x=>{if($8(x))return lm=!0,void _($($({},h),{},{compression:void 0,url:xk(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 $8(S)||k===X5})(x)&&(lm=!0),_(h)}):_(h)})(e,(o,l)=>{var u,d,f;t.rateLimiter.checkForLimiting(o),400>o.statusCode||(u=(d=t.config).on_request_error)===null||u===void 0||u.call(d,o),n?n(o,l):(f=e.callback)===null||f===void 0||f.call(e,o)})):e.fireCallbackOnDrop&&((i=e.callback)===null||i===void 0||i.call(e,{statusCode:0}))}var SV=class{constructor(t,e){this.rl=!0,this.ol=[],this.al=Wi((e==null?void 0:e.flush_interval_ms)||3e3,250,5e3,ye.createLogger("flush interval"),3e3),this.ll=t}enqueue(t){this.ol.push(t),this.ul||this.cl()}unload(){this.hl();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),{},{callback:void 0}),"sendBeacon")})}enable(){this.rl=!1,this.cl()}cl(){this.rl||(this.ul=setTimeout(()=>{this.hl(),this.fl()},this.al))}fl(){if(this.ol.length>0){const t=this.dl();for(const e in t)this.vl(t[e])}}vl(t,e){try{this.ll(t,e)}catch(n){ye.error(n)}}hl(){clearTimeout(this.ul),this.ul=void 0}dl(){const t={},e={};Tt(this.ol,n=>{var r;const s=n,i=((s?s.batchKey:null)||s.url)+(s.batchGroup?`:${s.batchGroup}`:"");ce(t[i])&&(t[i]=$($({},s),{},{data:[],callback:void 0,fireCallbackOnDrop:void 0}),e[i]=[]),(r=t[i].data)===null||r===void 0||r.push(s.data),s.callback&&e[i].push(s.callback)});for(const n in e){const r=e[n];r.length&&(t[n].callback=s=>{for(const i of r)i(s)})}return this.ol=[],t}};const kV=["retriesPerformedSoFar"];var EV=class{constructor(t){this._instance=t,this.pl=!1,this.gl=3e3,this.ol=[],this.ol=[],this.ml=!0,this.resume()}resume(){if(!ce(ee)&&"onLine"in ee.navigator){if(this.ml=ee.navigator.onLine,this.yl)return;this.yl=()=>{this.ml=!0,this.fl()},this.bl=()=>{this.ml=!1},kt(ee,"online",this.yl),kt(ee,"offline",this.bl)}}get length(){return this.ol.length}retriableRequest(t,e){let{retriesPerformedSoFar:n}=t,r=Q5(t,kV);Co(n)&&(r.url=ep(r.url,{retry_count:n})),ST(this._instance,e?$($({},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($({retriesPerformedSoFar:n},r),i);s.statusCode===0&&ye.warn(`Request failed before receiving an HTTP response; this can happen due to network issues, CORS, browser blocking, or ad blockers. Stopped retrying after ${n??0} retries.`)}(o=r.callback)===null||o===void 0||o.call(r,s)})}Ls(t,e){const n=t.retriesPerformedSoFar||0;t.retriesPerformedSoFar=n+1;const r=Math.max((function(o){const l=3e3*Math.pow(2,o),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)"),ye.warn(i),this.pl||(this.pl=!0,this._l())}_l(){if(this.wl&&clearTimeout(this.wl),this.ol.length===0)return this.pl=!1,void(this.wl=void 0);this.wl=setTimeout(()=>{this.ml&&this.ol.length>0&&this.fl(),this._l()},this.gl)}fl(){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.pl=!1,ce(ee)||(this.yl&&(ee.removeEventListener("online",this.yl),this.yl=void 0),this.bl&&(ee.removeEventListener("offline",this.bl),this.bl=void 0));for(const{requestOptions:t}of this.ol)try{this._instance._send_request($($({},t),{},{callback:Ue(t.data)?void 0:t.callback,transport:"sendBeacon"}))}catch(e){ye.error(e)}this.ol=[]}},CV=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(ee,"scroll",this.kl,{capture:!0}),kt(ee,"scrollend",this.kl,{capture:!0}),kt(ee,"resize",this.kl)}scrollElement(){if(this.xl){const n=Ue(this.xl)?this.xl:[this.xl];for(const r of n){var t;const s=ee==null||(t=ee.document)===null||t===void 0?void 0:t.querySelector(r);if(s)return s}return}var e;return ee==null||(e=ee.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 ee?t==="y"?ee.scrollY||ee.pageYOffset||((e=ee.document)===null||e===void 0||(e=e.documentElement)===null||e===void 0?void 0:e.scrollTop)||0:ee.scrollX||ee.pageXOffset||((n=ee.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 PV=t=>sT(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 bk=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({[A2]:o})},this._instance=t,this.Ml=e,this.Il=n,this.Tl=r||PV,this.Ml.onSessionId(this.qe)}Cl(){return this.Il.props[A2]}getSetOnceProps(){var t;const e=(t=this.Cl())===null||t===void 0?void 0:t.props;return e?"r"in e?iT(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 Tt(Zx(this.getSetOnceProps()),(e,n)=>{n==="$current_url"&&(n="url"),t[`$session_entry_${f2(n)}`]=e}),t}},Km=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 uu=dn("[SessionId]"),Sk=864e5;var kk=class{on(t,e){return this.Pl.on(t,e)}constructor(t,e,n){var r;if(this.Rl=null,this.Al=null,this.Fl=[],this.Ol=void 0,this.Dl=!1,this.Pl=new Km,this.Ll=(i,o)=>!(!Co(i)||!Co(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||wi,this.jl=n||wi;const s=this.Mr.persistence_name||this.Mr.token;if(this._sessionTimeoutMs=1e3*Wi(this.Mr.session_idle_timeout_seconds||1800,60,36e3,uu.createLogger("session_idle_timeout_seconds"),1800),t.register({$configured_session_timeout_ms:this._sessionTimeoutMs}),this.Bl(),this.zl="ph_"+s+"_window_id",this.Hl="ph_"+s+"_primary_window_exists",this.Ul()){const i=zt.Lt(this.zl),o=zt.Lt(this.Hl);i&&!o?this.je=i:zt.Pt(this.zl),zt.$t(this.Hl,!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.Fl)&&(this.Fl=[]),this.Fl.push(t),this.Xt&&t(this.Xt,this.je),()=>{this.Fl=this.Fl.filter(e=>e!==t)}}Ul(){return this.Mr.persistence!=="memory"&&!this.Il.hi&&zt.At()}Vl(t){t!==this.je&&(this.je=t,this.Ul()&&zt.$t(this.zl,t))}Gl(){return this.je?this.je:this.Ul()?zt.Lt(this.zl):null}Ql(t){const e=this.Rl;return!cn(e)&&!cn(t)&&5e3>Math.abs(t-e)}Zl(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({[Su]:[e,t,n]}))}Jl(){var t;const e=(t=this.Mr)===null||t===void 0?void 0:t.persistence_save_debounce_ms;return Co(e)&&e>0}Kl(){this.Jl()?this.Il.refreshKey(Su):(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({[Su]:[this._sessionActivityTimestamp,(t=this.Xt)!==null&&t!==void 0?t:null,this._sessionStartTimestamp]}),this.Il.flush())}tu(){const[t]=this.Yl(),e=Co(t)?t:0,n=Co(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[Su];return Ue(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.Zl(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 uu.error("Bootstrap sessionID cannot be in the future"):i}catch(i){return void uu.error("Invalid sessionID in bootstrap",i)}})(t);return!ce(n)&&(e?this.Nl={sessionId:t,sessionStartTimestamp:n}:this.Zl(t,new Date().getTime(),n),!0)}destroy(){this.Dl=!0,this.Xl(),clearTimeout(this.iu),this.iu=void 0,this.Ol&&ee&&(ee.removeEventListener(Bm,this.Ol,{capture:!1}),this.Ol=void 0),this.Fl=[]}Wl(){this.Ol=()=>{this.Xl(),this.Ul()&&zt.Pt(this.Hl)},kt(ee,Bm,this.Ol,{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 h=this.Gl();const g=this.Nl,v=!!g&&(g.sessionStartTimestamp>r+6e4||r-g.sessionStartTimestamp>Sk),w=g?v:Co(u)&&Math.abs(r-u)>Sk;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||uu.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(),h=this.jl(),uu.info("new session ID assigned",{sessionId:l,windowId:h,bootstrapped:!!M,changeReason:{noSessionId:S,activityTimeout:C,sessionPastMaximumLength:w}}),u=M?g.sessionStartTimestamp:r,this.Nl=void 0,_=!0}else h||(h=this.jl(),_=!0),x=x||l!==k,x&&(uu.info("adopted cross-tab session id",{sessionId:l,windowId:h}),_=!0);const A=Co(f)&&t&&!w?f:r,T=Co(u)?u:new Date().getTime();this.Vl(h),this.Zl(l,A,T),t||this.Bl();const I={noSessionId:S,activityTimeout:C,sessionPastMaximumLength:w,crossTabAdoption:x};return _&&this.Fl.forEach(M=>M(l,h,I)),{sessionId:l,windowId:h,sessionStartTimestamp:T,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 kT=function(t,e){if(!t)return!1;const n=t.userAgent;if(n&&k8(n,e))return!0;try{const r=t==null?void 0:t.userAgentData;if(r!=null&&r.brands&&r.brands.some(s=>k8(s==null?void 0:s.brand,e)))return!0}catch{}return!!t.webdriver};function ET(){return(ET=Kt(function*(){const t=Qn==null?void 0:Qn.userAgentData;if(t!=null&&t.getHighEntropyValues)try{const e=yield t.getHighEntropyValues(["model"]),n=e==null?void 0:e.model;return ct(n)&&n.length>0?n:void 0}catch(e){return void ye.info("Unable to resolve $device_model from userAgentData.getHighEntropyValues",e)}})).apply(this,arguments)}function AV(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 CT(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 Ym=(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}},A0=t=>t.toLowerCase(),PT={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=>Ym(n,r))),not_regex:(t,e)=>e.every(n=>t.every(r=>!Ym(n,r))),icontains:(t,e)=>e.map(A0).some(n=>t.map(A0).some(r=>n.includes(r))),not_icontains:(t,e)=>e.map(A0).every(n=>t.map(A0).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 AT(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=PT[r.operator];return!!i&&i(r.values.map(String),[String(s)])})}function Dy(t,e,n){return Cu({distinct_id:t,userPropertiesToSet:e,userPropertiesToSetOnce:n})}const F2="custom",Ek="i.posthog.com",TV=/^\/static\//,RV=["/s/","/e/","/i/"];var MV=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(`.${Ek}`,".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":F2),this.nu[this.apiHost]}su(t){if(!TV.test(t))return;const e=this.instance.config.asset_host;return typeof e=="string"&&e.trim().replace(/\/$/,"")||void 0}ru(t){const e=Bo(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=Bo(n))===null||i===void 0?void 0:i.href)||n;r=s(new URL(o)).toString()}if(s&&t==="api"&&RV.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===F2)return this.ou(t,e,this.apiHost+e);const n=Ek+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 At=dn("[Surveys]"),TT=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){At.error("Failed to persist survey seen state",e)}},IV=[Ry.Popover,Ry.Widget,Ry.API],OV={ignoreConditions:!1,ignoreDelay:!1,displayType:L2.Popover},LV=dn("[PostHog ExternalIntegrations]"),NV={intercom:"intercom-integration",crispChat:"crisp-chat-integration"};var DV=class{constructor(t){this._instance=t}zo(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 LV.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.zo(NV[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())}}},jV=class{constructor(t,e){this.A=t,this.bo=e,this.lu=new Map,this.To=!1}add(t){var e=this;return Kt(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&&Ln(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)}}},$V=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 Ck="extensionsRemoteConfig";var FV=class{constructor(t){this.instance=t,this.To=!1,this.A=ye,this.cu=t.hu,this.kv=new $V(t),this.onEvent=e=>P0(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 P0(()=>{});const n=s=>{try{e(s)}catch(i){this.A.error("Browser extension remote config listener failed",i)}},r=this.instance.du.on(Ck,n);return this.cu&&n(this.cu),P0(r)},this.vu=new jV(ye.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(jx);return typeof t=="string"?t:void 0}get library(){return{name:Un.LIB_NAME,version:Un.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 P0(this.instance.fu(t))}handleRemoteConfig(t){this.To||(this.cu=t,this.instance.du.emit(Ck,t))}sendRequest(t){var e=this;return Kt(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?ep(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"?d2.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 Kf={};let jy=0;const Yf=()=>{},Pk='Consent opt in/out is not valid with cookieless_mode="always" and will be ignored',du="Surveys module not available",Ak="sanitize_properties is deprecated. Use before_send instead",RT="Invalid value for property_denylist config: ",VV=["$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"],HV=["$feature_flag_called","$$heatmap","$snapshot"],Tk=t=>t.charAt(0)==="$"&&!ze(HV,t),zV=/^[A-Za-z0-9_-]{1,400}$/,Rk=/^fb\.[0-9]+\.[0-9]+\.[A-Za-z0-9_-]+(?:\.[A-Za-z0-9_-]+)?$/,Mk=/^fb\.[0-9]+\.[0-9]+\.[0-9]+$/,UV=["token","distinct_id",kA],Nf="posthog",BV=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},$y=t=>{var e;return $({api_host:"https://us.i.posthog.com",flags_api_host:null,ui_host:null,asset_host:null,token:"",autocapture:!0,cross_subdomain_cookie:FF(he==null?void 0:he.location),persistence:"localStorage+cookie",persistence_name:"",cookie_persisted_properties:[],loaded:Yf,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:Wt&&ct(Wt==null?void 0:Wt.search)&&Wt.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:(ee==null||(e=ee.location)===null||e===void 0?void 0:e.protocol)==="https:",ip:!1,opt_out_capturing_by_default:!1,opt_out_persistence_by_default:!1,opt_out_useragent_filter:!1,opt_out_capturing_persistence_type:"localStorage",consent_persistence_name:null,opt_out_capturing_cookie_prefix:null,opt_in_site_apps:!1,property_denylist:[],respect_dnt:!1,sanitize_properties:null,request_headers:{},request_batching:!0,properties_string_max_length:65535,mask_all_element_attributes:!1,mask_all_text:!1,mask_personal_data_properties:!1,custom_personal_data_properties:[],advanced_disable_flags:!1,advanced_disable_decide:!1,advanced_disable_feature_flags:!1,advanced_disable_feature_flags_on_first_load:!1,advanced_only_evaluate_survey_feature_flags:!1,advanced_feature_flags_dedup_per_session:!1,advanced_enable_surveys:!1,advanced_disable_toolbar_metrics:!1,feature_flag_request_timeout_ms:3e3,feature_flag_request_max_retries:1,surveys_request_timeout_ms:1e4,on_request_error(n){ye.error("Bad HTTP status: "+n.statusCode+" "+n.text)},get_device_id:n=>n,capture_performance:void 0,name:"posthog",bootstrap:{},disable_compression:!1,session_idle_timeout_seconds:1800,person_profiles:LA,before_send:void 0,get_current_url:void 0,request_queue_config:{flush_interval_ms:3e3},error_tracking:{},_onCapture:Yf},(n=>({rageclick:n&&n>="2026-05-30"?{content_ignorelist:Kx,ignore_text_selection:!0}:!n||"2025-11-30">n||{content_ignorelist:!0},capture_pageview:!n||"2025-05-24">n||"history_change",session_recording:BV(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))},ZV=[["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"]],Ik=t=>{const e={};for(const[s,i]of ZV)ce(t[s])||(e[i]=t[s]);const n=qt({},e,t),r=t.__preview_external_dependency_versioned_paths;return ce(r)||(ce(t.strict_script_versioning)&&(n.strict_script_versioning=!!r),ct(r)&&ce(t.asset_host)&&(n.asset_host=r)),Ue(t.property_blacklist)&&(ce(t.property_denylist)?n.property_denylist=t.property_blacklist:Ue(t.property_denylist)?n.property_denylist=[...t.property_blacklist,...t.property_denylist]:ye.error(RT+t.property_denylist)),n};var WV=class{constructor(){this.__forceAllowLocalhost=!1}get pu(){return this.__forceAllowLocalhost}set pu(t){ye.error("WebPerformanceObserver is deprecated and has no impact on network capture. Use `_forceAllowLocalhostNetworkCapture` on `posthog.sessionRecording`"),this.__forceAllowLocalhost=t}},Xf=class Ca{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(wi());this.register({distinct_id:r,$device_id:r}),e.set_property(Dr,Do)}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 WV,this.Mu=!1,this.version=Un.LIB_VERSION,this.Eu=new Set,this.Pu="",this.du=new Km,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=$y(),this.SentryIntegration=rV,this.sentryIntegration=r=>(function(s,i){const o=GA(s,i);return{name:qA,processEvent:l=>o(l)}})(this,r),this.__request_queue=[],this.__loaded=!1,this.analyticsDefaultEndpoint="/e/",this.Fu=!1,this.Ou=null,this.Du=null,this.Lu=null,this.scrollManager=new CV(this),this.pageViewManager=new fk(this),this.rateLimiter=new hV(this),this.requestRouter=new MV(this),this.consent=new WF(this),this.externalIntegrations=new DV(this);const n=(e=Ca.__defaultExtensionClasses)!==null&&e!==void 0?e:{};this.featureFlags=n.featureFlags&&new n.featureFlags(this),this.toolbar=n.toolbar&&new n.toolbar(this),this.surveys=n.surveys&&new n.surveys(this),this.conversations=n.conversations&&new n.conversations(this),this.logs=n.logs&&new n.logs(this),this.metrics=n.metrics&&new n.metrics(this),this.experiments=n.experiments&&new n.experiments(this),this.exceptions=n.exceptions&&new n.exceptions(this),this.people={set:(r,s,i)=>{const o=ct(r)?{[r]:s}:r;this.setPersonProperties(o),i==null||i({})},set_once:(r,s,i)=>{const o=ct(r)?{[r]:s}:r;this.setPersonProperties(void 0,o),i==null||i({})}},this.on("eventCaptured",r=>ye.info(`send "${r==null?void 0:r.event}"`,r))}init(e,n,r){if(r&&r!==Nf){var s;const i=(s=Kf[r])!==null&&s!==void 0?s:new Ca;return i._init(e,n,r),Kf[r]=i,Kf[Nf][r]=i,i}return this._init(e,n,r)}_init(e,n={},r){var s,i,o;const l=ct(e)?e.trim():"";if(!l)return ye.critical("PostHog was initialized without a token. This likely indicates a misconfiguration. Please check the first argument passed to posthog.init()"),this;var 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=$y(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=$y(n.defaults),f=Ik(n),h=qt({},d,f,{name:r,token:l});st(d.rageclick)&&st(f.rageclick)&&(h.rageclick=qt({},d.rageclick,f.rageclick)),st(d.session_recording)&&st(f.session_recording)&&(h.session_recording=qt({},d.session_recording,f.session_recording)),this.set_config(h),this.config.on_xhr_error&&ye.error("on_xhr_error is deprecated. Use on_request_error instead"),this.compression=n.disable_compression?void 0:xs.GZipJS;const g=this.Cu(),v=!this.yu();if(this.persistence=new Ty(this.config,g,!0,v),this.sessionPersistence=this.config.persistence==="sessionStorage"||this.config.persistence==="memory"?this.persistence:new Ty($($({},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.At()){const k=zt.Lt(this.Pu);Ue(k)&&k.forEach(C=>{ct(C)&&this.Eu.add(C)})}else zt.Pt(this.Pu);const w=$({},this.persistence.props),_=$({},this.sessionPersistence.props);this.register({$initialization_time:new Date().toISOString()}),this.Bu=new SV((k,C)=>this.zu(k,C),this.config.request_queue_config),this.Hu=new EV(this),this.__request_queue=[];const x=this.yu();x||(this.sessionManager=new kk(this),this.sessionPropsManager=new bk(this,this.sessionManager,this.persistence),this.sessionManager.onSessionId((k,C,A)=>{(A!=null&&A.activityTimeout||A!=null&&A.sessionPastMaximumLength||A!=null&&A.crossTabAdoption)&&this.Uu()})),this.Wu(),this.config.__preview_deferred_init_extensions?(ye.info("Deferring extension initialization to improve startup performance"),setTimeout(()=>{this.Vu(x)},0)):(ye.info("Initializing extensions synchronously"),this.Vu(x)),Un.DEBUG=Un.DEBUG||this.config.debug,Un.DEBUG&&ye.info("Starting in debug mode",{this:this,config:n,thisC:$({},this.config),p:w,s:_}),this.config.identity_distinct_id&&!(!((s=n.bootstrap)===null||s===void 0)&&s.distinctID)&&(n.bootstrap=$($({},n.bootstrap),{},{distinctID:this.config.identity_distinct_id,isIdentifiedID:!0}));const S=(i=n.bootstrap)===null||i===void 0?void 0:i.distinctID;if(this.wu=!!S&&!Hf(S),(o=n.bootstrap)===null||o===void 0?void 0:o.distinctID){const k=n.bootstrap.distinctID,C=this.get_distinct_id(),A=this.persistence.get_property(Dr);if(n.bootstrap.isIdentifiedID&&C!=null&&C!==k&&A==="anonymous")this.identify(k);else if(n.bootstrap.isIdentifiedID&&C!=null&&C!==k&&A==="identified")ye.warn("Bootstrap distinctID differs from an already-identified user. The existing identity is preserved. Call reset() before reinitializing if you intend to switch users.");else{const T=this.config.get_device_id(wi()),I=n.bootstrap.isIdentifiedID?T:k;this.persistence.set_property(Dr,n.bootstrap.isIdentifiedID?om:Do),this.register({distinct_id:k,$device_id:I})}}if(x)this.register_once({distinct_id:wy,$device_id:null},"");else if(!this.get_distinct_id()){const k=this.config.get_device_id(wi());this.register_once({distinct_id:k,$device_id:k},""),this.persistence.set_property(Dr,Do)}return kt(ee,"onpagehide"in self?"pagehide":"unload",this._handle_unload.bind(this),{passive:!1}),kt(ee,"pageshow",()=>{var k;this.Tu=!1,this.Iu||(k=this.Hu)===null||k===void 0||k.resume()}),n.segment?dk(this,()=>this.Gu()):this.Gu(),Ln(this.config._onCapture)&&this.config._onCapture!==Yf&&(ye.warn("onCapture is deprecated. Please use `before_send` instead"),this.on("eventCaptured",k=>this.config._onCapture(k.event,k))),this.config.ip&&ye.warn('The `ip` config option has NO EFFECT AT ALL and has been deprecated. Use a custom transformation or "Discard IP data" project setting instead. See https://posthog.com/tutorials/web-redact-properties#hiding-customer-ip-address for more information.'),this.config.disableDeviceModel||(function(){return ET.apply(this,arguments)})().then(k=>{k&&this.register({[_y]:k})}).catch(Yf),this}Qu(e){const n=e;return ct(n.name)&&Ln(n.setup)}Zu(e,n){this.Qu(e)?n.push(()=>{this.Ju().add(e).catch(()=>{var r;return(r=e.dispose)===null||r===void 0?void 0:r.call(e)}).catch(r=>{ye.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=Ca.__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)),Ln(this.featureFlags.onReloading)&&Ln(this.featureFlags.setup)?this.Ku||(this.Ku=this.featureFlags.onReloading(()=>{this.du.emit("featureFlagsReloading",!0)}),this.Ju().add(this.featureFlags)):(o=(l=this.featureFlags).initialize)===null||o===void 0||o.call(l))}Vu(e){const n=performance.now(),r=$($({},Ca.__defaultExtensionClasses),this.config.__extensionClasses),s=[];var i,o,l,u,d,f,h,g;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.Zu(this.autocapture=new r.autocapture(this),s),r.surveys&&this.Zu(this.surveys=(o=this.surveys)!==null&&o!==void 0?o:new r.surveys(this),s),r.logs&&this.Zu(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,nV)),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=(h=this.experiments)!==null&&h!==void 0?h:new r.experiments(this)),r.webMCP&&this.lu.push(this.webMCP=(g=this.webMCP)!==null&&g!==void 0?g:new r.webMCP(this)),this.lu.forEach(v=>{v.initialize&&s.push(()=>{var w;(w=v.initialize)===null||w===void 0||w.call(v)})}),s.push(()=>{if(this.Xu){const v=this.Xu;this.Xu=void 0,this.lu.forEach(w=>{var _;return(_=w.onRemoteConfig)===null||_===void 0?void 0:_.call(w,v)})}}),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){ye.error("Error initializing extension:",i)}}const r=Math.round(performance.now()-n);this.register_for_session({[EA]:this.config.__preview_deferred_init_extensions?"deferred":"synchronous",[CA]:r}),this.config.__preview_deferred_init_extensions&&ye.info(`PostHog extensions initialized (${r}ms)`)}el(e){var n;if(!he||!he.body)return ye.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.hu=e,this.compression=void 0,e.ok){var r;const s=e.config;s.supportedCompression&&!this.config.disable_compression&&(this.compression=ze(s.supportedCompression,xs.GZipJS)?xs.GZipJS:ze(s.supportedCompression,xs.Base64)?xs.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:LA}),(n=this.tc)===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){ye.critical("`loaded` function failed",e)}if(this.ec(),this.config.internal_or_test_user_hostname&&(Wt==null?void 0:Wt.hostname)){const e=Wt.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.nc()},1),this.sc=new aT(this),this.sc.load()}ec(){var e;this.is_capturing()&&this.config.request_batching&&((e=this.Bu)===null||e===void 0||e.enable())}_dom_loaded(){this.is_capturing()&&Eu(this.__request_queue,e=>this.zu(e)),this.__request_queue=[],this.ec()}_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.rc()&&this.capture(G8),(s=this.logs)===null||s===void 0||s.flushLogs("sendBeacon"),(i=this.Bu)===null||i===void 0||i.unload(),(o=this.Hu)===null||o===void 0||o.unload()):this.rc()&&this.capture(G8,null,{transport:"sendBeacon"})}_send_request(e){ST(this,e)}zu(e,n){this.Hu?this.Hu.retriableRequest(e,n):this._send_request(n?$($({},e),{},{transport:n}):e)}_execute_array(e){jy++;try{let n;const r=[],s=[],i=[];Eu(e,l=>{if(l)if(n=l[0],Ue(n))i.push(l);else if(Ln(l))try{l.call(this)}catch(u){ye.error("Error executing queued PostHog call",l,u)}else Ue(l)&&n==="alias"?r.push(l):Ue(l)&&n.indexOf("capture")!==-1&&Ln(this[n])?i.push(l):s.push(l)});const o=function(l,u){Eu(l,function(d){try{if(Ue(d[0])){let f=u;Tt(d,function(h){f=f[h[0]].apply(f,h.slice(1))})}else u[d[0]].apply(u,d.slice(1))}catch(f){ye.error("Error executing queued PostHog call",d,f)}})};o(r,this),o(s,this),o(i,this)}finally{jy--}}push(e){if(jy>0&&Ue(e)&&ct(e[0])){const n=Ca.prototype[e[0]];return void(Ln(n)&&n.apply(this,e.slice(1)))}this._execute_array([e])}get oc(){return{property:W8,persistenceKey:Ou,cookieName:"_fbc",pattern:Rk,register:(e,n)=>{var r;return(r=this.persistence)===null||r===void 0?void 0:r.register({[Ou]:{value:e,delivered:n}})},unregister:()=>{var e;return(e=this.persistence)===null||e===void 0?void 0:e.unregister(Ou)}}}get ac(){return{property:q8,persistenceKey:Bf,cookieName:"_fbp",pattern:Mk,register:(e,n)=>{var r;return(r=this.persistence)===null||r===void 0?void 0:r.register({[Bf]:{value:e,delivered:n}})},unregister:()=>{var e;return(e=this.persistence)===null||e===void 0?void 0:e.unregister(Bf)}}}lc(e){var n;const r=(n=this.persistence)===null||n===void 0?void 0:n.get_property(e.persistenceKey);return ct(r)&&e.pattern.test(r)?{value:r,delivered:!1}:st(r)&&ct(r.value)&&e.pattern.test(r.value)?{value:r.value,delivered:r.delivered===!0}:void 0}uc(e,n,r){return n===(r==null?void 0:r.value)?{value:n,pending:!r.delivered}:(e.register(n,!1),{value:n,pending:!0})}cc(e){if(!this.config.save_campaign_params||this.yu())return;const n=Wf(e.cookieName);return ct(n)&&e.pattern.test(n)?n:void 0}hc(e,n,r,s){if(!this.persistence)return;const i=this.oc;this.persistence.refreshKey(i.persistenceKey);const o=this.lc(i);if(s)return void i.unregister();if(r)return ct(n)&&Rk.test(n)?this.uc(i,n,o):void i.unregister();const l=ct(e)&&zV.test(e)?e:void 0,u=this.cc(i);return u&&((d,f,h)=>{const g=d.split(".");if(f)return g[3]===f;if(!h)return!0;const v=h.value.split(".");return g[3]===v[3]||Number(g[2])>Number(v[2])})(u,l,o)?this.uc(i,u,o):l?(o==null?void 0:o.value.split(".")[3])===l?{value:o.value,pending:!o.delivered}:this.uc(i,`fb.1.${Date.now()}.${l}`,o):o?{value:o.value,pending:!o.delivered}:void 0}dc(e,n,r){if(!this.persistence)return;const s=this.ac;this.persistence.refreshKey(s.persistenceKey);const i=this.lc(s);if(r)return void s.unregister();if(n)return ct(e)&&Mk.test(e)?this.uc(s,e,i):void s.unregister();const o=this.cc(s);return o?this.uc(s,o,i):i?{value:i.value,pending:!i.delivered}:void 0}vc(e,n){if(!this.persistence)return;this.persistence.refreshKey(e.persistenceKey);const r=this.lc(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 ye.uninitializedWarning("posthog.capture");if(!this.is_capturing())return;if(ce(e)||!ct(e))return void ye.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 ye.critical("This capture call is ignored due to client rate limiting.");let u;n!=null&&n.$current_url&&!ct(n==null?void 0:n.$current_url)&&(ye.error("Invalid `$current_url` property provided to `posthog.capture`. Input must be a string. Ignoring provided value."),n==null||delete n.$current_url),e!=="$exception"||r!=null&&r.fc||ye.warn("Using `posthog.capture('$exception')` is unreliable because it does not attach required metadata. Use `posthog.captureException(error)` instead, which attaches required metadata automatically."),this.sessionPersistence.update_search_keyword(),this.config.save_campaign_params&&(u=this.sessionPersistence.update_campaign_params()),this.config.save_referrer&&this.sessionPersistence.update_referrer_info(),(this.config.save_campaign_params||this.config.save_referrer)&&this.persistence.set_initial_person_info();const d=new Date,f=(r==null?void 0:r.timestamp)||d,h=A8(r==null?void 0:r.uuid,wi);let g={uuid:h,event:e,properties:this.calculateEventProperties(e,n||{},f,h)};e==="$pageview"&&this.config.__preview_capture_bot_pageviews&&o&&(g.event="$bot_pageview",g.properties.$browser_type="bot"),l&&(g.properties.$lib_rate_limit_remaining_tokens=l.remainingTokens);const v=e==="$feature_flag_called"&&g.properties.$feature_flag_has_experiment===!1&&this.get_property("$minimal_flag_called_events")===!0;r!=null&&r.$set&&!v&&(g.$set=r==null?void 0:r.$set);const w=st(n==null?void 0:n.$set)?n.$set:void 0,_=Ue(n==null?void 0:n.$unset)?n.$unset:[],x=(r==null?void 0:r.$unset)||[],S=B=>{var G;const H=!!(r!=null&&r.$set)&&B in r.$set;return{hasProvided:H||!!w&&B in w,provided:H?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(W8),C=S(q8),A=[{channel:this.oc,hasProvided:k.hasProvided,update:this.hc(u==null?void 0:u.fbclid,k.provided,k.hasProvided,k.unset)},{channel:this.ac,hasProvided:C.hasProvided,update:this.dc(C.provided,C.hasProvided,C.unset)}];for(const{channel:B,hasProvided:G,update:H}of A)H&&g.properties.$process_person_profile===!0&&H.pending&&!G&&!v&&(g.$set=$({[B.property]:H.value},g.$set));const T=r==null?void 0:r.$unset;T&&(g.$unset=T);const I=v?void 0:this.gc(r==null?void 0:r.$set_once,e!==K8,e===NA);if(I&&(g.$set_once=I),r!=null&&r._noTruncate||(M=this.config.properties_string_max_length,g=(function(B,G){const H=new Set;return(function Y(U,J){if(U!==Object(U))return G?G(U):U;if(H.has(U))return;let Z;if(H.add(U),Ue(U))Z=[],Eu(U,j=>{Z.push(Y(j))});else{const j={};Tt(Sd(U)?DA(U):U,(Q,oe)=>{H.has(Q)||(j[oe]=Y(Q))}),Z=j}return Z})(B)})(g,B=>ct(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 H={},Y=U=>{B[U]!==void 0&&(H[U]=B[U])};return O$.forEach(Y),G.forEach(Y),H})(g.properties,UV)),e===ws.DISMISSED||e===ws.SENT){const B=n==null?void 0:n[My.SURVEY_ID],G=n==null?void 0:n[My.SURVEY_ITERATION];TT({id:B,current_iteration:G}),g.$set=$($({},g.$set),{},{[AV({id:B,current_iteration:G},e===ws.SENT?"responded":"dismissed")]:!0})}else e===ws.SHOWN&&(g.$set=$($({},g.$set),{},{[My.SURVEY_LAST_SEEN_DATE]:new Date().toISOString()}));var M;if(e===fV.SHOWN){const B=n==null?void 0:n[mk.TOUR_TYPE];B&&(g.$set=$($({},g.$set),{},{[`${mk.TOUR_LAST_SEEN_DATE}/${B}`]:new Date().toISOString()}))}const R=$($({},g.properties.$set),g.$set);if(Yr(R)||this.setPersonPropertiesForFlags(R),!Je(this.config.before_send)){const B=this.Os(g);if(!B)return;g=B,g.uuid=A8(g.uuid,wi)}this.sessionRecording&&!this.Au&&Tk(e)&&(this.Au=!0,setTimeout(()=>this.Au=!1,3e4));const O=A.filter(({channel:B,update:G})=>{var H,Y,U;const J=(H=(Y=g.$set)===null||Y===void 0?void 0:Y[B.property])!==null&&H!==void 0?H:st((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)&&J===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),F=$($($({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:H}of O)this.vc(G,H.value)}}:{});if(!this.config.request_batching||r&&!(r!=null&&r._batchKey)||r!=null&&r.send_instantly){var K;let B;!F.transport&&!F.callback&&Yr((K=this.config.request_headers)!==null&&K!==void 0?K:{})&&this.Tu&&(B="sendBeacon"),this.zu(F,B)}else this.Bu.enqueue(F);return g}_addCaptureHook(e){return this.on("eventCaptured",n=>e(n.event,n))}getExtension(e){var n;return(n=this.tc)===null||n===void 0?void 0:n.getExtension(e)}Ju(){var e;return(e=this.tc)!==null&&e!==void 0?e:this.tc=new FV(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)}}mc(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.yc()),(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.mc();const o=i?void 0:this.persistence.remove_event_timer(e);let l=$({},n);if(l.token=this.config.token,l.$config_defaults=this.config.defaults,this.yu()&&(l[kA]=!0),e==="$snapshot"){const k=$($({},this.persistence.properties()),this.sessionPersistence.properties());return l.distinct_id=k.distinct_id,(!ct(l.distinct_id)&&!mn(l.distinct_id)||Hf(l.distinct_id))&&ye.error("Invalid distinct_id for replay event. This indicates a bug in your implementation"),l}const u=(function(k,C,A,T=!1){var I,M,R,O;if(!Nr)return{};const N=k?[...od,...C||[]]:[],[D,F]=V5(Nr),[K,B]=(function(ne){for(let se=0;P8.length>se;se++){const[de,ve,ue]=P8[se],ae=ne.match(de);if(ae){const Oe=ue&&ne.match(ue)||ae;return[ve,(Oe==null?void 0:Oe[1])||""]}}return["",""]})(Nr),G=(function(){const ne="u">typeof navigator?navigator:void 0;return ne!=null&&ne.brave?{brave:!0}:{}})(),H={};ce(A)||(H.detectGoogleSearchApp=A);const Y={},U=(I=navigator)===null||I===void 0||(I=I.userAgentData)===null||I===void 0?void 0:I.platform,J=(M=navigator)===null||M===void 0?void 0:M.maxTouchPoints,Z=ee==null||(R=ee.screen)===null||R===void 0?void 0:R.width,j=ee==null||(O=ee.screen)===null||O===void 0?void 0:O.height,Q=ee==null?void 0:ee.devicePixelRatio;ce(U)||(Y.userAgentDataPlatform=U),ce(J)||(Y.maxTouchPoints=J),ce(Z)||(Y.screenWidth=Z),ce(j)||(Y.screenHeight=j),ce(Q)||(Y.devicePixelRatio=Q);const oe=qt(Zx({$os:D,$os_version:F,$browser:F5(Nr,navigator.vendor,G,H),$webview_app:K,$webview_app_version:B,$device:H5(Nr),$device_type:t$(Nr,Y),$timezone:KA(),$timezone_offset:cV()}),{$current_url:gh(T?Ga(Wt==null?void 0:Wt.href):Wt==null?void 0:Wt.href,N,vh),$host:Wt==null?void 0:Wt.host,$pathname:Wt==null?void 0:Wt.pathname,$raw_user_agent:Nr.length>1e3?Nr.substring(0,997)+"...":Nr,$browser_version:e$(Nr,navigator.vendor,G,H),$browser_language:nT(),$browser_language_prefix:lV(),$screen_height:ee==null?void 0:ee.screen.height,$screen_width:ee==null?void 0:ee.screen.width,$viewport_height:ee==null?void 0:ee.innerHeight,$viewport_width:ee==null?void 0:ee.innerWidth,$lib:$o.LIB_NAME,$lib_version:$o.LIB_VERSION,$insert_id:Math.random().toString(36).substring(2,10)+Math.random().toString(36).substring(2,10),$time:Date.now()/1e3});return $o.SDK_DIST_CHANNEL&&(oe.$sdk_dist_channel=$o.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&&qt(l,this.sessionPropsManager.getSessionProps());try{var d;if(this.sessionRecording){const k=this.sessionRecording.sdkDebugProperties,C=!this.Au&&Tk(e);for(const A in k)(C||ze(VV,A))&&(l[A]=k[A])}l.$sdk_debug_retry_queue_size=(d=this.Hu)===null||d===void 0?void 0:d.length}catch(k){l.$sdk_debug_error_capturing_properties=String(k)}let f;if(this.requestRouter.region===F2&&(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=qt(l,f),e==="$pageview"&&he&&(l.title=he.title),!ce(o)){const k=r.getTime()-o;l.$duration=parseFloat((k/1e3).toFixed(3))}Nr&&this.config.opt_out_useragent_filter&&(l.$browser_type=this._is_bot()?"bot":"browser");const h=this.persistence.properties(),g=this.sessionPersistence.properties(),v=l.$groups,w=h.$groups;st(v)&&!Yr(v)&&(l.$groups=$($({},st(w)?w:{}),v)),Tt(["$referrer","$referring_domain"],k=>{k in h&&delete g[k]});const _={};if(this.Ru.length>0)for(const k of this.Ru.slice())try{qt(_,k())}catch(C){ye.error("Failed to produce browser extension event properties",C)}l=qt({},u,h,g,$($({},_),l)),l.$is_identified=this._isIdentified(),Ue(this.config.property_denylist)?Tt(this.config.property_denylist,function(k){delete l[k]}):ye.error(RT+this.config.property_denylist+" or property_blacklist config: "+this.config.property_blacklist);const x=this.config.sanitize_properties;x&&(ye.error(Ak),l=x(l,e));const S=this.bc();return l.$process_person_profile=S,S&&!i&&this._c("_calculate_event_properties"),l}gc(e,n=!0,r=!1){var s;if(!this.persistence||!this.bc()||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=qt({},i,o||{},e||{});const u=this.config.sanitize_properties;return u&&(ye.error(Ak),l=u(l,"$set_once")),n&&(this.Mu=!0),Yr(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.mc(),(r=this.sessionPersistence)===null||r===void 0||r.register(e),Object.keys(e).forEach(s=>this.Eu.add(s)),this.yc()}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.yc()}wc(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.yc()}yc(){var e;if(!this.Pu)return;if(this.config.persistence==="memory"||!((e=this.sessionPersistence)===null||e===void 0)&&e.hi||!zt.At())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:du}),()=>{})}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:du})}getActiveMatchingSurveys(e,n=!1){this.surveys?this.surveys.getActiveMatchingSurveys(e,n):e([],{isLoaded:!1,error:du})}onActiveMatchingSurveysChanged(e){return this.surveys?this.surveys.onActiveMatchingSurveysChanged(e):(e([],{isLoaded:!1,error:du}),()=>{})}renderSurvey(e,n){var r;(r=this.surveys)===null||r===void 0||r.renderSurvey(e,n)}displaySurvey(e,n=OV){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:du}}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:du})}kc(e){return!e||Hf(e)?(ye.critical("Unique user id has not been set in posthog.identify"),!1):e==="$posthog_cookieless"?(ye.critical(`The string "${e}" was set in posthog.identify which indicates an error. This ID is only used as a sentinel value.`),!1):!["distinct_id","distinctid"].includes(e.toLowerCase())&&!["undefined","null"].includes(e.toLowerCase())||(ye.critical(`The string "${e}" was set in posthog.identify which indicates an error. This ID should be unique to the user and not a hardcoded string.`),!1)}identify(e,n,r){if(!this.__loaded||!this.persistence)return ye.uninitializedWarning("posthog.identify");if(mn(e)&&(e=e.toString(),ye.warn("The first argument to posthog.identify was a number, but it should be a string. It has been converted to a string.")),!this.kc(e)||!this._c("posthog.identify"))return;this.ku();const s=this.get_distinct_id(),i=this.persistence.syncCookieProperties()&&this.get_distinct_id()!==s,o=this.mc(!1),l=this.persistence.Oa();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(zm),this.register({distinct_id:e}));const h=(this.persistence.get_property("$user_state")||"anonymous")===Do,g=e!==f,v=!g&&h;if(g&&h){var d;const w=this.config.reuseAnonymousId?{distinct_id:e}:{distinct_id:e,$anon_distinct_id:f};this.persistence.set_property(Dr,om),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=Dy(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(Dr,om);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=Dy(e,n,r))}else(n||r)&&this.setPersonProperties(n,r);g||i||o?(this.reloadFeatureFlags(),this.featureFlags?this.featureFlags.resetFlagCallReported():this.unregister($a)):v&&(n||r)&&this.reloadFeatureFlags(),u=!0}finally{l&&this.persistence.qa(u)}}setPersonProperties(e,n){if(!e&&!n||!this._c("posthog.setPersonProperties"))return;const r=Dy(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)):ye.info("A duplicate setPersonProperties call was made with the same properties. It has been ignored.")}unsetPersonProperties(e){var n;const r=(Ue(e)?e:[e]).filter(s=>ct(s)&&s.length>0);r.length!==0&&this._c("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 ye.error("posthog.group requires a group type and group key");(s=this.persistence)===null||s===void 0||s.syncCookieProperties(),this.mc();const i=this.getGroups(),o=i[e]!==n;if(o&&this.resetGroupPropertiesForFlags(e),this.register({$groups:$($({},i),{},{[e]:n})}),(o||r)&&this.bc()){const l={$group_type:e,$group_key:n};r&&(l.$group_set=r),this.capture(K8,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._c("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=jr(e)?e:e==null?void 0:e.resetDeviceID,r=jr(e)||e==null?void 0:e.bootstrap;this.Sc(n,!1,r)}Sc(e,n=!1,r){var s,i,o,l,u,d;if(ye.info("reset"),!this.__loaded)return ye.uninitializedWarning("posthog.reset");const f=r==null?void 0:r.sessionID;this.config.bootstrap=r||((s=this.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 h=this.get_property(jx),g=this.get_property(_y),v=this.get_property(Zf);(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.Oa)===null||d===void 0?void 0:d.call(u),x=this.Su;this.Su=x||n;let S=!1;try{var k,C,A,T,I,M,R,O,N,D,F,K,B;if((k=this.persistence)===null||k===void 0||k.clear(),(C=this.sessionPersistence)===null||C===void 0||C.clear(),this.Eu.clear(),this.yc(),ce(v)||(D=this.persistence)===null||D===void 0||D.register({$session_recording_remote_config:v}),(A=this.surveys)===null||A===void 0||A.reset(),(T=this.featureFlags)===null||T===void 0||T.reset(),(I=this.conversations)===null||I===void 0||I.reset(),(M=this.logs)===null||M===void 0||M.reset(),(R=this.metrics)===null||R===void 0||R.reset(),(O=this.persistence)===null||O===void 0||O.set_property("$user_state","anonymous"),(N=this.sessionManager)===null||N===void 0||N.resetSessionId(),this.Lu=null,this.config.cookieless_mode==="always")this.register_once({distinct_id:wy,$device_id:null},"");else{const Y=this.config.get_device_id(wi());this.register_once({distinct_id:Y,$device_id:e?Y:h},""),e||ce(g)||this.register({[_y]: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})),(F=this.featureFlags)===null||F===void 0||F.initialize(),!Je(f)&&!(!((K=this.sessionManager)===null||K===void 0)&&K.setBootstrapSessionId(f,!0)))){const Y=$({},r);delete Y.sessionID,this.config.bootstrap=Y}delete this.config.identity_distinct_id,delete this.config.identity_hash,delete this.config.identity_claims,S=!0}finally{var G,H;this.Su=x,_&&((G=this.persistence)===null||G===void 0||(H=G.qa)===null||H===void 0||H.call(G,S))}this.reloadFeatureFlags()}shutdown(e){var n=this;return Kt(function*(){var r,s,i,o,l,u,d,f;if(n.__loaded){n.Iu=!0,n.Ju().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.Hu)===null||u===void 0||u.unload();try{var h;(h=n.featureFlags)===null||h===void 0||h.destroy()}catch(g){ye.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 ye.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.xc()}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.$c()}get_distinct_id(){return this.get_property("distinct_id")}getGroups(){return this.get_property("$groups")||{}}get_session_id(){var e,n;return(e=(n=this.sessionManager)===null||n===void 0?void 0:n.checkAndGetSessionAndWindowId(!0).sessionId)!==null&&e!==void 0?e:""}get_session_replay_url(e){if(!this.sessionManager)return"";const{sessionId:n,sessionStartTimestamp:r}=this.sessionManager.checkAndGetSessionAndWindowId(!0);let s=this.requestRouter.endpointFor("ui",`/project/${this.config.token}/replay/${n}`);if(e!=null&&e.withTimestamp&&r){var i;const o=(i=e.timestampLookBack)!==null&&i!==void 0?i:10;if(!r)return s;s+=`?t=${Math.max(Math.floor((new Date().getTime()-r)/1e3)-o,0)}`}return s}alias(e,n){return e===this.get_property("$people_distinct_id")?(ye.critical("Attempting to create alias for existing People user - aborting."),-2):this._c("posthog.alias")?(ce(n)&&(n=this.get_distinct_id()),e!==n?(this.wc(zm,e),this.capture("$create_alias",{alias:e,distinct_id:n})):(ye.warn("alias matches current distinct_id - skipping api call."),this.identify(e),-1)):void 0}set_config(e){const n=$({},this.config);if(st(e)){var r,s,i,o,l,u,d,f,h,g,v,w,_,x;qt(this.config,Ik(e));const T=this.Cu();if(this.persistence){const M=this.config.persistence==="sessionStorage"||this.config.persistence==="memory";var S,k;if(M&&this.sessionPersistence!==this.persistence&&((S=this.sessionPersistence)===null||S===void 0||S.remove(),(k=this.sessionPersistence)===null||k===void 0||k.destroy()),this.persistence.update_config(this.config,n,T),M)this.sessionPersistence=this.persistence;else if(this.sessionPersistence===this.persistence)this.sessionPersistence=new Ty($($({},this.config),{},{persistence:"sessionStorage"}),T,!1);else{var C;(C=this.sessionPersistence)===null||C===void 0||C.update_config($($({},this.config),{},{persistence:"sessionStorage"}),$($({},n),{},{persistence:"sessionStorage"}),T)}}const I=this.Nu(this.config.debug);var A;jr(I)&&(this.config.debug=I),jr(this.config.debug)&&(this.config.debug?(Un.DEBUG=!0,yt.At()&&yt.$t("ph_debug",!0),ye.info("set_config",{config:e,oldConfig:n,newConfig:$({},this.config)})):(Un.DEBUG=!1,yt.At()&&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.webMCP)===null||u===void 0||u.startIfEnabled(),(d=this.sessionRecording)===null||d===void 0||d.startIfEnabledOrStop(),(f=this.tracingHeaders)===null||f===void 0||f.startIfEnabledOrStop(),(h=this.autocapture)===null||h===void 0||h.startIfEnabled(),(g=this.heatmaps)===null||g===void 0||g.startIfEnabled(),("capture_pageview"in e||"disable_capture_url_hashes"in e)&&((A=this.historyAutocapture)===null||A===void 0||A.startIfEnabledOrStop()),(v=this.exceptionObserver)===null||v===void 0||v.startIfEnabledOrStop(),(w=this.deadClicksAutocapture)===null||w===void 0||w.startIfEnabledOrStop(),(_=this.surveys)===null||_===void 0||_.loadIfEnabled(),this.xu(),(x=this.externalIntegrations)===null||x===void 0||x.startIfEnabledOrStop(),!n.segment&&this.config.segment&&this.persistence&&dk(this,Yf,!1)}}_overrideSDKInfo(e,n){Un.LIB_NAME=e,Un.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($($({},r),n))}catch{return}}addExceptionStep(e,n){var r;(r=this.exceptions)===null||r===void 0||r.addExceptionStep(e,n)}captureLog(e){var n;(n=this.logs)===null||n===void 0||n.captureLog(e)}get logger(){var e,n;return(e=(n=this.logs)===null||n===void 0?void 0:n.logger)!==null&&e!==void 0?e:Ca.Cc}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:Nf;return n!==Nf&&(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"}bc(){var e,n;return!(this.config.person_profiles==="never"||this.config.person_profiles==="identified_only"&&!this._isIdentified()&&Yr(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))}rc(){return this.config.capture_pageleave===!0||this.config.capture_pageleave==="if_capture_pageview"&&!!this.config.capture_pageview}createPersonProfile(){this.bc()||this._c("posthog.createPersonProfile")&&this.setPersonProperties({},{})}setInternalOrTestUser(){this._c("posthog.setInternalOrTestUser")&&this.setPersonProperties({$internal_or_test_user:!0})}_c(e){return this.config.person_profiles==="never"?(ye.error(e+' was called, but process_person is set to "never". This call will be ignored.'),!1):(this.bu(),this.wc(Vx,!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.Tc(),((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.yc(),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.Sc(!0,!0),(s=this.sessionManager)===null||s===void 0||s.destroy(),(i=this.pageViewManager)===null||i===void 0||i.destroy(),this.sessionManager=new kk(this),this.pageViewManager=new fk(this),this.persistence&&(this.sessionPropsManager=new bk(this,this.sessionManager,this.persistence));const v=(o=(l=this.config.__extensionClasses)===null||l===void 0?void 0:l.sessionRecording)!==null&&o!==void 0?o:(u=Ca.__defaultExtensionClasses)===null||u===void 0?void 0:u.sessionRecording;var d,f;v&&(this.sessionRecording=this.mu(this.sessionRecording,new v(this)),this.hu&&((d=this.sessionRecording)===null||d===void 0||(f=d.onRemoteConfig)===null||f===void 0||f.call(d,this.hu)))}var h,g;this.consent.optInOut(!0),this.xu(),this.ec(),(n=this.sessionRecording)===null||n===void 0||n.startIfEnabledOrStop(),this.config.cookieless_mode=="on_reject"&&((h=this.surveys)===null||h===void 0||h.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.nc()}else ye.warn(Pk)}opt_out_capturing(){this.config.cookieless_mode!=="always"?(this.consent.optInOut(!1),this.xu(),this.config.cookieless_mode==="on_reject"&&this.$u()):ye.warn(Pk)}$u(){var e,n;const r=this.sessionRecording;r==null||r.dispose({discardBufferedEvents:!0}),this.get_distinct_id()!=="$posthog_cookieless"&&this.Sc(!0,!0),this.register({distinct_id:wy,$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.nc(),this.ec()}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 Qn?kT(Qn,this.config.custom_blocked_useragents):void 0}nc(){he&&(he.visibilityState==="visible"?this.Fu||(this.Fu=!0,this.capture(Bx,{title:he.title},{send_instantly:!0}),this.Ou&&(he.removeEventListener(ph,this.Ou),this.Ou=null)):this.Ou||(this.Ou=this.nc.bind(this),kt(he,ph,this.Ou)))}debug(e){e===!1?(ee==null||ee.console.log("You've disabled debug mode."),this.set_config({debug:!1})):(ee==null||ee.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?(ye.warn("Config field 'advanced_disable_decide' is deprecated. Please use 'advanced_disable_flags' instead. The old field will be removed in a future major version."),!0):(function(n,r,s,i,o){const l=r in n&&!Je(n[r]),u=s in n&&!Je(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,ye)}Os(e){var n;if(Je(this.config.before_send))return e;const r=Object.keys((n=e.properties)!==null&&n!==void 0?n:{}).filter(Uj),s=Ue(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),Je(i)){const l=`Event '${e.event}' was rejected in beforeSend function`;return zj(e.event)?ye.warn(`${l}. This can cause unexpected behavior.`):ye.info(l),null}i.properties&&!Yr(i.properties)||ye.warn(`Event '${e.event}' has no properties after beforeSend function, this is likely an error.`)}catch(l){return ye.error(`Error in beforeSend function for event '${e.event}':`,l),null}for(const o of r)if(i.properties&&Je(i.properties[o]))return ye.warn(`Event '${e.event}' had its '${o}' property removed in a beforeSend function. This property is required for ingestion, so the event will be dropped.`),null;return i}getPageViewId(){var e;return(e=this.pageViewManager.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=jr(e)&&!e,r=yt.At()&&yt.Ot("ph_debug")==="true";return!n&&(!!r||e)}};Xf.__defaultExtensionClasses={},Xf.Cc=(()=>{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]]=jF(t.prototype[e[n]])})(Xf,["identify"]);var MT=class{constructor(t){this.disabled=t===!1;const e=st(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 Fy="$copy_autocapture",Vy=dn("[AutoCapture]");function Hy(t,e){return e.length>t?e.slice(0,t)+"...":e}function qV(t){if(t.previousElementSibling)return t.previousElementSibling;let e=t;do e=e.previousSibling;while(e&&!ki(e));return e}function GV(t,{e,maskAllElementAttributes:n,maskAllText:r,elementAttributeIgnoreList:s,elementsChainAsString:i,disableCaptureUrlHashes:o}){var l,u;if(!ki(t))return{props:{}};const d=[t],f=new Set([t]);let h=t;for(;h.parentNode&&!mr(h,"body")&&1e3>d.length;){if(Wx(h.parentNode)){const I=h.parentNode.host;if(f.has(I))break;f.add(I),d.push(I),h=I;continue}if(!ki(h.parentNode)||f.has(h.parentNode))break;f.add(h.parentNode),d.push(h.parentNode),h=h.parentNode}const g=e.type==="click"&&t.namespaceURI==="http://www.w3.org/2000/svg"?d.findIndex(I=>mr(I,"button")||mr(I,"a")):-1;g>0&&(r=r||d.slice(0,g+1).some(I=>!lc(I)||sd(I)));const v=[],w={};let _,x=!1,S=!1;if(Tt(d,I=>{const M=lc(I);if(mr(I,"a")&&!n&&!(s!=null&&s.includes("href"))){const R=I.getAttribute("href");x=!!(M&&R&&Lu(R))&&(o?Ga(R):R)}ze(rd(I),"ph-no-capture")&&(S=!0),v.push((function(R,O,N,D,F=!1){const K=R.tagName.toLowerCase(),B={tag_name:K};Gx.indexOf(K)>-1&&!N&&(B.$el_text=K.toLowerCase()==="a"||K.toLowerCase()==="button"?Hy(1024,lk(R)):Hy(1024,mh(R)));const G=rd(R);O||D!=null&&D.includes("class")||0>=G.length||(B.classes=G.filter(function(J){return J!==""})),Tt(R.attributes,function(J){var Z;if((!sd(R)||["name","id","class","aria-label"].indexOf(J.name)!==-1)&&!(D!=null&&D.includes(J.name))&&!O&&Lu(J.value)&&(!ct(Z=J.name)||Z.substring(0,10)!=="_ngcontent"&&Z.substring(0,7)!=="_nghost")){let j=J.value;J.name==="class"&&(j=qx(j).join(" ")),B["attr__"+J.name]=Hy(1024,J.name==="href"&&F?Ga(j):j)}});let H=1,Y=1,U=R;for(;U=qV(U);)H++,U.tagName===R.tagName&&Y++;return B.nth_child=H,B.nth_of_type=Y,B})(I,n,r,s,o)),Tt((function(R){if(!lc(R))return{};const O={};return Tt(R.attributes,function(N){if(N.name&&N.name.indexOf("data-ph-capture-attribute")===0){const D=N.name.replace("data-ph-capture-attribute-",""),F=N.value;D&&F&&Lu(F)&&(O[D]=F)}}),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=mr(t,"a")||mr(t,"button")?lk(t):mh(t)),x){var k,C;v[0].attr__href=x;const I=(k=Bo(x))===null||k===void 0?void 0:k.host,M=ee==null||(C=ee.location)===null||C===void 0?void 0:C.host;I&&M&&I!==M&&(_=x)}return{props:qt((T=e.type,{$event_type:T,$ce_version:1}),i?{}:{$elements:v},{$elements_chain:(A=v,Ue(A)?(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 K of M.attr_class)N+=`.${K.replace(/"/g,"")}`}const D=$($($($({},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),F={};return am(D).sort(([K],[B])=>(function(G,H){return H>G?-1:G>H?1:0})(K,B)).forEach(([K,B])=>F[ck(K.toString())]=ck(B.toString())),N+=":",N+=am(F).map(([K,B])=>`${K}="${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:eV(M),attr_id:M.attr__id,nth_child:M.nth_child,nth_of_type:M.nth_of_type,attributes:{}};return am(M).filter(([D])=>D.indexOf("attr__")===0).forEach(([D,F])=>N.attributes[D]=F),N})})(A)):"")},!((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 A,T}var KV=class{do(){this.vo=void 0,clearTimeout(this.fo),this.fo=void 0}po(t){var e;if(!lc(t))return!0;const n=(e=this.mo().css_selector_ignorelist)!==null&&e!==void 0?e:Cy,r=new Set;let s=t;for(;s;){if(r.size>=1e3||r.has(s))return!0;r.add(s);const i=s,o=rd(i);if(ze(o,"ph-no-capture")||ze(o,"ph-sensitive")||sd(i)||n.some(u=>I2(i,u)))return!0;const l=s.parentNode;s=Wx(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=qf(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=qf(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&&(mr(r,"html")||mr(r,"body"))){var s;if(n.excluded)return null;const i=(s=this.mo().css_selector_ignorelist)!==null&&s!==void 0?s:Cy;return[r,he==null?void 0:he.documentElement,he==null?void 0:he.body].some(o=>{if(!o)return!1;const l=rd(o);return ze(l,"ph-no-capture")||ze(l,"ph-sensitive")||!lc(o)||sd(o)||i.some(u=>I2(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 MT(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 Vy.info("Disabling Automatic Event Collection because this browser is not supported");if(!ee||!he)return;const t=this.Ao=e=>{e=e||(ee==null?void 0:ee.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.Fo(e,"$autocapture",n)}catch(n){Vy.error("Failed to capture event",n)}};if(kt(ee,"blur",t),kt(he,"submit",t,{capture:!0}),kt(he,"change",t,{capture:!0}),kt(he,"click",t,{capture:!0}),Tt(["pointerdown","pointermove","pointerup","pointercancel"],e=>{kt(he,e,t,{capture:!0})}),this.mo().capture_copied_text){const e=this.Oo=n=>{n=n||(ee==null?void 0:ee.event);try{this.Fo(n,Fy)}catch(r){Vy.error("Failed to capture clipboard event",r)}};kt(he,"copy",e,{capture:!0}),kt(he,"cut",e,{capture:!0}),kt(he,"paste",e,{capture:!0})}}Po(){this.do(),this.Ao&&(ee==null||ee.removeEventListener("blur",this.Ao),Tt(["pointerdown","pointermove","pointerup","pointercancel"],t=>{he==null||he.removeEventListener(t,this.Ao,!0)}),he==null||he.removeEventListener("submit",this.Ao,!0),he==null||he.removeEventListener("change",this.Ao,!0),he==null||he.removeEventListener("click",this.Ao,!0),this.Ao=void 0),this.Oo&&(he==null||he.removeEventListener("copy",this.Oo,!0),he==null||he.removeEventListener("cut",this.Oo,!0),he==null||he.removeEventListener("paste",this.Oo,!0),this.Oo=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;jr(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=he==null?void 0:he.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(hA),r=this.So,s=this.mo();if(!s.remoteRequestsDisabled&&!this.xo)return!1;const i=s.remoteRequestsDisabled&&!this.xo;if(cn(r)&&!jr(n)&&!i)return!1;const o=(e=this.So)!==null&&e!==void 0?e:!!n;return!!s.enabled&&!o}Fo(t,e="$autocapture",n){if(!this.isEnabled)return void this.do();let r=n||qf(t);VA(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()))&&BA(r,s.rageclick)&&this.Fo(t,"$rageclick",n);const o=e===Fy,l=o?$($({},s),{},{dom_event_allowlist:void 0}):s;if(r&&(function(h,g,v,w,_,x){var S;if(!ee||Yx(h)||v!=null&&v.url_allowlist&&!ek(v.url_allowlist,x)||v!=null&&v.url_ignorelist&&ek(v.url_ignorelist,x))return!1;if(v!=null&&v.dom_event_allowlist){const T=v.dom_event_allowlist;if(T&&!T.some(I=>g.type===I))return!1}const{parentIsUsefulElement:k,targetElementList:C}=ZA(h,w);if(!(function(T,I){const M=I==null?void 0:I.element_allowlist;if(ce(M))return!0;for(const R of T)if(M.some(O=>R.tagName.toLowerCase()===O))return!0;return!1})(C,v)||!O2(C,v==null?void 0:v.css_selector_allowlist)||O2(C,(S=v==null?void 0:v.css_selector_ignorelist)!==null&&S!==void 0?S:Cy))return!1;try{const T=ee.getComputedStyle(h);if(T&&T.getPropertyValue("cursor")==="pointer"&&g.type==="click")return!0}catch{}const A=h.tagName.toLowerCase();switch(A){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&&(Gx.indexOf(A)>-1||h.getAttribute("contenteditable")==="true")}})(r,t,l,o,o?["copy","cut","paste"]:void 0,{config:{get_current_url:s.getCurrentUrl}})){var u;const{props:h,explicitNoCapture:g,target:v}=GV(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&&(h.$element_selectors=w),e===Fy){const _=t.type||"clipboard";if(_!=="paste"){var d,f;const x=ee==null||(d=ee.getSelection())===null||d===void 0?void 0:d.toString(),S=HA(x);if(!S)return!1;h.$selected_content=S,h.$clipboard_text_length=(f=x==null?void 0:x.length)!==null&&f!==void 0?f:0}h.$copy_type=_}return(u=this.bo)===null||u===void 0||u.capture(e,h),!0}}isBrowserSupported(){return Ln(he==null?void 0:he.querySelectorAll)}},YV=class{constructor(t){this._instance=t}refresh(t){const e=this._instance.config,n=st(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 Ef=dn("[ExceptionAutocapture]"),Ok=()=>{},Lk=t=>{var e;if(Ln(t))return(e=t.__posthog_layer__)!==null&&e!==void 0?e:t.__rrweb_layer__};function ld(t,e,n){try{if(!(e in t))return Ok;const r={next:t[e]},s=n(function(...i){return r.next.apply(this,i)});return Ln(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=Lk(i);for(;o;){if(o.next===s)return void(o.next=r.next);i=o.next,o=Lk(i)}}}catch{return Ok}}const XV=dn("[TracingHeaders]"),Rl=dn("[Web Vitals]"),Nk=9e5,Dk=["CLS","FCP","INP","LCP"],QV=["INP","LCP"],JV=["interactionTarget","interactionType","inputDelay","processingDuration","presentationDelay","loadState","target","url","timeToFirstByte","resourceLoadDelay","resourceLoadDuration","elementRenderDelay","largestShiftTarget","largestShiftTime","largestShiftValue","firstByteToFCP"],zy="disabled",jk="lazy_loading",xo=dn("[SessionRecording]"),eH=[Hx,zx,PA,AA,TA,RA,MA,IA,OA],tH=dn("[Heatmaps]");function Uy(t){return st(t)&&"clientX"in t&&"clientY"in t&&mn(t.clientX)&&mn(t.clientY)}const T0=dn("[Product Tours]"),By=t=>{var e;return!t.config.disable_product_tours&&!!(!((e=t.persistence)===null||e===void 0)&&e.get_property(Fx))},nH=["$set_once","$set"],Mi=dn("[SiteApps]"),$k="Error while initializing PostHog app with config id ",IT=(t,e)=>t!=null&&t.then?t.then(e):e(t),fu="SDK is not enabled or survey functionality is not yet loaded",Fk="Disabled. Not loading surveys.";var rH=class{constructor(e,n){this.wo=e,this.Ic=n,this.name="surveys",this._surveyEventReceiver=null,this._surveyManager=null,this.Mc=!1,this.Ec=!1,this.Pc=[],this.Rc=[],this.Ac=null,this.Fc=null,this.To=!1,this.Oc=new Set,this.onRemoteConfig=r=>{if(this.To||this.Mr.disableSurveys)return;if(!r.ok)return this.Ec=!0,this.Dc({isLoaded:!1,error:"Remote config unavailable. Not loading surveys."}),At.warn("Remote config unavailable. Not loading surveys.");const s=r.config.surveys;if(Je(s))return At.warn("Flags not loaded yet. Not loading surveys.");this.Lc=jr(s)?s:s.length>0,At.info(`flags response received, isSurveysEnabled: ${this.Lc}`),this.loadIfEnabled()},this.Dc=r=>{this.Rc.slice().forEach(s=>this.Nc(s,r))}}setup(e){if(!this.To)return this.qc=e,IT(e.kv.initialize(),()=>{if(this.qc!==e||this.To)return;this.qc=void 0,this.bo=e;const n=e.onRemoteConfig(this.onRemoteConfig);this.To?n.dispose():(this.Eo=n,this.loadIfEnabled())})}dispose(){var e,n,r,s,i;this.To||(this.To=!0,this.qc=void 0,this.bo=void 0,(e=this.Eo)===null||e===void 0||e.dispose(),this.Eo=void 0,(n=this._surveyEventReceiver)===null||n===void 0||n.dispose(),this._surveyEventReceiver=null,(r=this._surveyManager)===null||r===void 0||(s=r.dispose)===null||s===void 0||s.call(r),this._surveyManager=null,this.Pc=[],this.Rc.forEach(o=>{o.active=!1}),this.Rc=[],(i=this.jc)===null||i===void 0||i.call(this),this.jc=void 0,this.Ac=null,this.Oc.forEach(o=>clearTimeout(o)),this.Oc.clear())}get Mr(){return this.wo.get()}initialize(){this.loadIfEnabled()}reset(){var e,n;(e=this._surveyManager)===null||e===void 0||(n=e.clearInMemoryInProgressSurveyState)===null||n===void 0||n.call(e);try{var r;(r=this._surveyEventReceiver)===null||r===void 0||r.reset(),localStorage.removeItem("lastSeenSurveyDate");const s=[];for(let i=0;i<localStorage.length;i++){const o=localStorage.key(i);(o!=null&&o.startsWith("seenSurvey_")||o!=null&&o.startsWith("inProgressSurvey_"))&&s.push(o)}s.forEach(i=>localStorage.removeItem(i))}catch{}this.Dc()}loadIfEnabled(){if(this.To||!this.bo)return;const e=this.Mr;if(this._surveyManager)return;if(this.Mc)return void At.info("Already initializing surveys, skipping...");if(e.disableSurveys)return void At.info(Fk);if(e.cookielessMode&&this.wo.isOptedOut())return void At.info("Not loading surveys in cookieless mode without consent.");const n=this.wo.getExtensions();if(!n)return void this.Bc("PostHog Extensions not found.");if(ce(this.Lc)&&!e.advancedEnableSurveys)return;const r=this.Lc||e.advancedEnableSurveys;this.Mc=!0,this.Ec=!1;try{const s=n.generateSurveys;if(s)return this.zc(s,r),void(this.Mc=!1);const i=n.loadExternalDependency;if(!i)return this.Bc(Ux),void(this.Mc=!1);i(o=>{try{if(this.To)return;const l=this.wo.getExtensions();o||!(l!=null&&l.generateSurveys)?this.Bc("Could not load surveys script",o):this.zc(l.generateSurveys,r)}finally{this.Mc=!1}})}catch(s){throw this.Mc=!1,this.Bc("Error initializing surveys",s),s}}zc(e,n){var r,s;if(this.To)return;this._surveyManager=e(n),this._surveyEventReceiver=this.wo.createEventReceiver(this.Dc);const i=(r=(s=this.bo)!==null&&s!==void 0?s:this.Ic)===null||r===void 0?void 0:r.kv.get(Lf);i&&this.Hc(i),At.info("Surveys loaded successfully"),this.Uc(),this.Dc(),this.Wc({isLoaded:!0})}Bc(e,n){this.Ec=!0,At.error(e,n),this.Dc({isLoaded:!1,error:e}),this.Wc({isLoaded:!1,error:e})}onSurveysLoaded(e){return this.Pc.push(e),this._surveyManager&&this.Wc({isLoaded:!0}),()=>{this.Pc=this.Pc.filter(n=>n!==e)}}getSurveys(e,n=!1){var r;const s=(r=this.bo)!==null&&r!==void 0?r:this.Ic;if(!s||this.To)return;if(this.Mr.disableSurveys)return At.info(Fk),e([]);const i=s.kv.get(Lf);if(i&&!n)return e(i,{isLoaded:!0}),void(this.Vc()&&this.getSurveys(()=>{},!0));if(this.Ac)return void this.Ac.then(({surveys:u,context:d})=>{this.To||e(u,d)}).catch(u=>At.error("Error in survey callback",u));const o=this.Gc("/api/surveys/",{method:"GET",query:{token:s.projectToken},sentAt:"query",timeoutMs:this.Mr.requestTimeoutMs}).then(u=>{try{return this.Qc(s,u)}catch(d){return At.error("Error processing surveys response",d),this.Qc(s,{statusCode:0,error:d})}},u=>this.Qc(s,{statusCode:0,error:u}));this.Ac=o;const l=()=>{this.Ac===o&&(this.Ac=null)};o.then(u=>{l(),this.To||(this.Dc(u.context),e(u.surveys,u.context))},l).catch(u=>At.error("Error in survey callback",u))}Gc(e,n){const r=this.bo;return r?r.sendRequest(e,n):new Promise(s=>s({statusCode:0,error:new Error(fu)}))}Qc(e,n){if(this.To)return{surveys:[],context:{isLoaded:!1,error:fu}};const r=n.statusCode;if(r!==200||!n.json){const i=`Surveys API could not be loaded, status: ${r}`;return r!==0?At.error(i):n.error||At.warn(i),this.Fc=Date.now(),{surveys:[],context:{isLoaded:!1,error:i}}}this.Fc=null;const s=n.json.surveys||[];return e.kv.set({[Lf]:s,[Um]:Date.now()}),this.Hc(s),{surveys:s,context:{isLoaded:!0}}}Hc(e){var n;const r=e.filter(s=>(function(i){return!(!i.start_date||i.end_date)})(s)&&(CT(s)||(function(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)&&o.length)})(s)));(n=this._surveyEventReceiver)===null||n===void 0||n.replace(r)}Vc(){return this.Zc()&&!this.Ac&&!this.Jc()}Zc(){var e,n;const r=(e=(n=this.bo)!==null&&n!==void 0?n:this.Ic)===null||e===void 0?void 0:e.kv.get(Um);return mn(r)&&Date.now()-r>3e5}Jc(){return mn(this.Fc)&&3e5>Date.now()-this.Fc}markSurveyAsSeen(e,n){var r;const s={id:e,current_iteration:(r=n==null?void 0:n.iteration)!==null&&r!==void 0?r:null};TT(s);try{localStorage.setItem("lastSeenSurveyDate",new Date().toISOString())}catch{}this.Dc()}Wc(e){for(const n of this.Pc)try{if(!e.isLoaded)return n([],e);this.getSurveys(n)}catch(r){At.error("Error in survey callback",r)}}getActiveMatchingSurveys(e,n=!1){if(!Je(this._surveyManager))return this._surveyManager.getActiveMatchingSurveys(e,n);At.warn("init was not called")}onActiveMatchingSurveysChanged(e){var n,r;if(this.To)return()=>{};const s={callback:e,active:!0,revision:0};this.Rc.push(s),this.Uc();const i=(n=(r=this.bo)!==null&&r!==void 0?r:this.Ic)===null||n===void 0?void 0:n.kv.get(Lf);return this.Mr.disableSurveys||!this._surveyManager&&this.Ec&&!this.Mc||!i&&!Je(this.Fc)&&!this.Ac?this.Nc(s,{isLoaded:!1}):this._surveyManager&&this.Nc(s),()=>{var o;s.active=!1,this.Rc=this.Rc.filter(l=>l!==s),this.Rc.length===0&&((o=this.jc)===null||o===void 0||o.call(this),this.jc=void 0)}}Uc(){var e,n,r;this._surveyManager&&this.Rc.length>0&&((e=this.jc)!==null&&e!==void 0||(this.jc=(n=(r=this.wo).onMatchingConditionsChanged)===null||n===void 0?void 0:n.call(r,this.Dc)))}Nc(e,n){if(this.To||!e.active)return;const r=++e.revision,s=i=>{if(!this.To&&e.active&&r===e.revision)try{const o=n??{isLoaded:!0},l=JSON.stringify([i,o]);if(l===e.lastResult)return;e.lastResult=l,e.callback(i,o)}catch(o){At.error("Error in active matching surveys callback",o)}};try{n&&!n.isLoaded?s([]):this.getActiveMatchingSurveys(s)}catch(i){At.error("Error in active matching surveys callback",i)}}Kc(e){let n=null;return this.getSurveys(r=>{var s;n=(s=r.find(i=>i.id===e))!==null&&s!==void 0?s:null}),n}Xc(e){if(Je(this._surveyManager))return{eligible:!1,reason:fu};const n=typeof e=="string"?this.Kc(e):e;return n?this._surveyManager.checkSurveyEligibility(n):{eligible:!1,reason:"Survey not found"}}Yc(e){if(!this.wo.isCapturing())return{eligible:!1,reason:"PostHog is not capturing, so a survey response cannot be recorded"};if(Je(this._surveyManager))return{eligible:!1,reason:fu};const n=typeof e=="string"?this.Kc(e):e;return n?this._surveyManager.checkSurveyRenderability(n):{eligible:!1,reason:"Survey not found"}}canRenderSurvey(e){if(Je(this._surveyManager))return At.warn("init was not called"),{visible:!1,disabledReason:fu};const n=this.Yc(e);return{visible:n.eligible,disabledReason:n.reason}}canRenderSurveyAsync(e,n){return Je(this._surveyManager)?(At.warn("init was not called"),Promise.resolve({visible:!1,disabledReason:fu})):new Promise(r=>{this.getSurveys(s=>{var i;const o=(i=s.find(l=>l.id===e))!==null&&i!==void 0?i:null;if(o){const l=this.Yc(o);r({visible:l.eligible,disabledReason:l.reason})}else r({visible:!1,disabledReason:"Survey not found"})},n)})}renderSurvey(e,n,r){var s;if(!this.wo.isCapturing())return;if(Je(this._surveyManager))return void At.warn("init was not called");const i=typeof e=="string"?this.Kc(e):e;if(!(i!=null&&i.id))return void At.warn("Survey not found");if(!IV.includes(i.type))return void At.warn(`Surveys of type ${i.type} cannot be rendered in the app`);const o=he==null?void 0:he.querySelector(n);if(o){if(!((s=i.appearance)===null||s===void 0)&&s.surveyPopupDelaySeconds){At.info(`Rendering survey ${i.id} with delay of ${i.appearance.surveyPopupDelaySeconds} seconds`);const l=setTimeout(()=>{var u,d;this.Oc.delete(l),!this.To&&this.wo.isCapturing()&&(At.info(`Rendering survey ${i.id} with delay of ${(u=i.appearance)===null||u===void 0?void 0:u.surveyPopupDelaySeconds} seconds`),(d=this._surveyManager)===null||d===void 0||d.renderSurvey(i,o,r),At.info(`Survey ${i.id} rendered`))},1e3*i.appearance.surveyPopupDelaySeconds);return void this.Oc.add(l)}this._surveyManager.renderSurvey(i,o,r)}else At.warn("Survey element not found")}displaySurvey(e,n){var r;if(!this.wo.isCapturing())return;if(Je(this._surveyManager))return void At.warn("init was not called");const s=this.Kc(e);if(!s)return void At.warn("Survey not found");let i=s;if(!((r=s.appearance)===null||r===void 0)&&r.surveyPopupDelaySeconds&&n.ignoreDelay&&(i=$($({},s),{},{appearance:$($({},s.appearance),{},{surveyPopupDelaySeconds:0})})),n.displayType!==L2.Popover&&n.initialResponses&&At.warn("initialResponses is only supported for popover surveys. prefill will not be applied."),n.ignoreConditions===!1){const o=this.Xc(s);if(!o.eligible)return void At.warn("Survey is not eligible to be displayed: ",o.reason)}n.displayType!==L2.Inline?this._surveyManager.handlePopoverSurvey(i,n):this.renderSurvey(i,n.selector,n.properties)}cancelPendingSurvey(e){Je(this._surveyManager)?At.warn("init was not called"):this._surveyManager.cancelSurvey(e)}handlePageUnload(){var e,n;(e=this._surveyManager)===null||e===void 0||(n=e.handlePageUnload)===null||n===void 0||n.call(e)}};function hu(t,e,n){if(Je(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 sH=class{constructor(t){this._instance=t,this.th=new Set,this.eh=new Set,this.ih=new Km,this.nh=(e,n)=>this.sh(e,n)&&this.rh(e,n)&&this.oh(e,n)&&this.ah(e,n),this.sh=(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.uh=(e=this._instance)===null||e===void 0?void 0:e._addCaptureHook((n,r)=>{this.on(n,r)}))}dispose(){var t,e;(t=this.uh)===null||t===void 0||t.call(this),this.uh=void 0,(e=this._instance)===null||e===void 0||(e=e.autocapture)===null||e===void 0||e.setElementSelectors(new Set,this),this.ih=new Km}register(t){var e,n;if(!ce((e=this._instance)===null||e===void 0?void 0:e._addCaptureHook)&&(t.forEach(r=>{var s;this.th.add(r),(s=r.steps)===null||s===void 0||s.forEach(i=>{this.eh.add((i==null?void 0:i.event)||"")})}),(n=this._instance)===null||n===void 0?void 0:n.autocapture)){const r=new Set;this.th.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.th.clear(),this.eh.clear(),this.register(t)}on(t,e){e!=null&&t.length!=0&&(this.eh.has(t)||this.eh.has(e.event))&&this.th.forEach(n=>{this.hh(e,n)&&this.ih.emit("actionCaptured",n.name)})}dh(t){this.onAction("actionCaptured",e=>t(e))}hh(t,e){if((e==null?void 0:e.steps)==null)return!1;for(const n of e.steps)if(this.nh(t,n))return!0;return!1}onAction(t,e){return this.ih.on(t,e)}rh(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"||!hu(r,e.url,e.url_matching||"contains"))return!1}return!0}oh(t,e){return!!this.fh(t,e)&&!!this.ph(t,e)&&!!this.gh(t,e)}fh(t,e){var n;if(!(e!=null&&e.href))return!0;const r=this.mh(t);if(r.length>0)return r.some(i=>hu(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&&hu((function(i){const o=i.match(/(?::|")href="(.*?)"/);return o?o[1]:""})(s),e.href,e.href_matching||"exact")}ph(t,e){var n;if(!(e!=null&&e.text))return!0;const r=this.mh(t);if(r.length>0)return r.some(u=>hu(u.text,e.text,e.text_matching||"exact")||hu(u.$el_text,e.text,e.text_matching||"exact"));const s=(t==null||(n=t.properties)===null||n===void 0?void 0:n.$elements_chain)||"";return!!s&&(i=(function(u){const d=[],f=/(?::|")text="(.*?)"/g;let h;for(;!Je(h=f.exec(u));)d.includes(h[1])||d.push(h[1]);return d})(s),o=e.text,l=e.text_matching||"exact",i.some(u=>hu(u,o,l)));var i,o,l}gh(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}mh(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}ah(t,e){return!(e!=null&&e.properties)||e.properties.length===0||AT(e.properties.reduce((n,r)=>{const s=Ue(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)}},iH=class{constructor(t,e){var n,r;this.yh=[],this._instance=t,this.bh=e,this._h=new Map,this.wh=new Map,this.kh=new Map,this.Sh=(n=this._instance)===null||n===void 0||(r=n.onSessionId)===null||r===void 0?void 0:r.call(n,s=>this.xh(s))}$h(t){return!1}Ch(){return null}Th(t){}Ih(){}Mh(t,e){return!!t&&AT(t.propertyFilters,e==null?void 0:e.properties)}Eh(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}Ph(t,e,n){const r=(n===bf.Activation?this._h:this.wh).get(t);let s=[];return this.Rh(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.Mh(l,e)})}register(t){this.Ah(t,!1)}replace(t){this.Ah(t,!0)}Ah(t,e){var n;ce((n=this._instance)===null||n===void 0?void 0:n._addCaptureHook)||(this.Fh(t,e),this.Oh(t,e))}Oh(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.kh.clear(),n.length===0)return void(e&&((r=this.Dh)===null||r===void 0||r.replace([])));this.Dh||(this.Dh=new sH(this._instance),this.Dh.init(),this.Dh.dh(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.kh.get(l.name))!==null&&u!==void 0?u:[];d.includes(i.id)||d.push(i.id),this.kh.set(l.name,d)}})}),e?this.Dh.replace(s):this.Dh.register(s)}Lh(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)})}Fh(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.Eh(t,bf.Activation),l=this.Eh(t,bf.Cancellation);e?(this._h=o,this.wh=l):(this.Lh(this._h,o),this.Lh(this.wh,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.uh)!==null&&n!==void 0||(this.uh=(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.Nh(),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.qh(t,i,e);if(l==="consume")return s.info("event consumed activated item, removing it",{event:t,itemId:i}),void this.jh([i]);if(l==="persist")return s.info("shown item promoted to persisted activation",{event:t,itemId:i}),this.Bh(i),void this.zh([i])}if(this.wh.has(t)){const l=this.Ph(t,e,bf.Cancellation);l.length>0&&(s.info("cancel event matched, cancelling items",{event:t,itemsToCancel:l.map(u=>u.id)}),this.jh(l.map(u=>u.id)),l.forEach(u=>this.Hh(u.id)))}if(!this._h.has(t))return;s.info("event name matched",{event:t,eventPayload:e,items:this._h.get(t)});const o=this.Ph(t,e,bf.Activation);this.Uh(o.map(l=>l.id))}onAction(t){this.kh.has(t)&&this.Uh(this.kh.get(t)||[])}Uh(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.$h(i)?this.Bh(i)&&this.Wh(i):s.push(i);s.length>0&&(this.yh=[...new Set([...this.yh,...s])]),this.Nh().info("updating activated items",{activatedItems:this.getActivatedIds()}),this.Vh()}Bh(t){this.yh=this.yh.filter(n=>n!==t);const e=this.Gh();return!e.includes(t)&&(this.Qh([...e,t]),this.Zh(),!0)}jh(t){const e=new Set(t);this.yh=this.yh.filter(s=>!e.has(s));const n=this.Jh(),r=n.filter(s=>!e.has(s));r.length!==n.length&&(this.Qh(r),r.length===0&&this.Kh()),this.zh(t),this.Vh()}Vh(){try{var t;(t=this.bh)===null||t===void 0||t.call(this)}catch(e){this.Nh().error("Error while handling activated items change",e)}}Xh(){var t;const e=this.Ch();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:{}}Wh(t){if(!this.Ch())return;const e=this.Xh();this.Th($($({},e),{},{[t]:Date.now()}))}zh(t){if(!this.Ch())return;const e=this.Xh(),n={};let r=!1;for(const[s,i]of Object.entries(e))t.includes(s)?r=!0:n[s]=i;r&&(Yr(n)?this.Ih():this.Th(n))}Yh(){this.Ch()&&this.Ih()}getActivationTimestamp(t){if(!this.Gh().includes(t))return;const e=this.Xh()[t];return mn(e)?e:void 0}Jh(){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])||[]}Gh(){var t,e,n;const r=this.Jh();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:[]}Zh(){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)}Kh(){this.sd()}xh(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.Jh(),s=this.Xh();r.length>0&&(this.Qh([]),r.filter(i=>mn(s[i])).forEach(i=>this.Hh(i))),this.Kh(),this.Yh(),r.length>0&&this.Vh()}}getActivatedIds(){return[...new Set([...this.Gh(),...this.yh])].filter(t=>!this.rd(t))}dispose(){var t,e,n;(t=this.Sh)===null||t===void 0||t.call(this),this.Sh=void 0,(e=this.uh)===null||e===void 0||e.call(this),this.uh=void 0,(n=this.Dh)===null||n===void 0||n.dispose(),this.Dh=void 0}reset(){this.yh=[],this.Jh().length>0&&this.Qh([]),this.Kh(),this.Yh(),this.Vh()}getEventToItemsMap(){return this._h}od(){return this.Dh}},oH=class extends iH{constructor(t,e){super(t,e)}td(){return _A}ed(){return wA}Ch(){return xA}Th(t){var e;(e=this._instance)===null||e===void 0||(e=e.persistence)===null||e===void 0||e.register({$surveys_activated_timestamps:t})}Ih(){var t;(t=this._instance)===null||t===void 0||(t=t.persistence)===null||t===void 0||t.unregister("$surveys_activated_timestamps")}$h(t){var e;let n;this.Rh(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 ws.SHOWN}Rh(t){var e;(e=this._instance)===null||e===void 0||e.getSurveys(t)}Hh(t){var e;(e=this._instance)===null||e===void 0||e.cancelPendingSurvey(t)}Nh(){return At}Qh(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}qh(t,e,n){var r;if(t===ws.SENT&&(n==null||(r=n.properties)===null||r===void 0?void 0:r.$survey_completed)===!1)return"ignore";let s;return this.Rh(i=>{s=i.find(o=>o.id===e)}),!s||(function(i){var o;return CT(i)&&!!(!((o=i.conditions)===null||o===void 0||(o=o.events)===null||o===void 0)&&o.repeatedActivation)||i.schedule==="always"})(s)?t===ws.SHOWN?"consume":"ignore":t===ws.SHOWN?"persist":t===ws.DISMISSED||t===ws.SENT?"consume":"ignore"}getSurveys(){return this.getActivatedIds()}getEventToSurveys(){return this.getEventToItemsMap()}},aH=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)}},lH=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 oH(this._instance,t)}onMatchingConditionsChanged(t){const e=this._instance._addCaptureHook(i=>{i!=="$pageview"&&i!==ws.SHOWN&&i!==ws.DISMISSED&&i!==ws.SENT||t()}),n=()=>t();kt(ee,"PHSurveyShown",n);let r=!1;const s=this._instance.onFeatureFlags(()=>{r&&t()});return r=!0,()=>{r=!1,e(),s(),ee==null||ee.removeEventListener("PHSurveyShown",n)}}};const cH=ee!=null&&ee.location?Wm(ee.location.hash,"__posthog")||Wm(location.hash,"state"):null,Vk="_postHogToolbarParams",Hk=dn("[Toolbar]"),zk=dn("[FeatureFlags]"),Ml=dn("[FeatureFlags]",{debugEnabled:!0}),Zy=`" failed. Feature flags didn't load in time.`,uH=[502,504],Uk=["click","keydown","wheel","touchstart","pointerdown"],Bk="connection_error",Zk=t=>{const e={};for(let n=0;t.length>n;n++)e[t[n]]=!0;return e},Wk=t=>{const e={};for(const[n,r]of am(t||{}))r&&(e[n]=r);return e};var dH=class{constructor(t){this.name="featureFlags",this.ld=!1,this.featureFlagEventHandlers=[],this.A=zk,this.ud={},this.hd={},this.dd=[],this.vd=new Set,this.fd=new Set,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||!this.Id||this.Id.visibilityState==="hidden"||Date.now()-((n=this.Md)!==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.Ed())},this.Pd=()=>{this.Sd&&this.Td===this.Cd||this.Rd()},this.sn=()=>{var e;((e=this.Id)===null||e===void 0?void 0:e.visibilityState)==="visible"&&this.Rd()},this.wo=t}get Ad(){}Fd(){this.bo&&this.Od()}setup(t){try{this.Dd=typeof window>"u"?void 0:window,this.Id=typeof document>"u"?void 0:document}catch{this.Dd=void 0,this.Id=void 0}return this.qc=t,this.A=t.logger.createLogger("[FeatureFlags]"),IT(t.kv.initialize(),()=>{this.qc===t&&(this.qc=void 0,this.bo=t,this.Ld(t))})}Ld(t){var e;if(this.bo===t)return this.Dd&&kt(this.Dd,"online",this.rn),this.Od(),this.Nd=t.registerDynamicEventProperties(()=>this.qd()?this.ud:this.hd),this.jd=(e=this.Ad)===null||e===void 0?void 0:e.onCrossTabFeatureFlagChange(()=>{this.Bd(),this.zd(),this.Hd()}),this.zd(),this.initialize()}Rd(){this.Sd=!0,this.Td=this.Cd,this.$d()}Od(){var t;const e=this.Mr.refreshIntervalMs,n=!this.Mr.remoteRequestsDisabled&&this.Id&&!ce(e)&&e>0?e:void 0;this.Mr.idleRefreshBackoff||(this.Td=n),n!==this.Cd&&(this.Ud(),ce(n)||(this.Cd=n,this.Td=n,this.Ed(),!((t=this.Id)===null||t===void 0)&&t.addEventListener&&(kt(this.Id,ph,this.sn),Eu(Uk,r=>{kt(this.Id,r,this.Pd,{capture:!0})}))))}Ed(){ce(this.Cd)||(ce(this.Wd)||clearInterval(this.Wd),this.Md=Date.now(),this.Wd=setInterval(this.$d,this.Cd))}Ud(){var t,e;ce(this.Wd)||(clearInterval(this.Wd),this.Wd=void 0,(t=this.Id)===null||t===void 0||(e=t.removeEventListener)===null||e===void 0||e.call(t,"visibilitychange",this.sn),Eu(Uk,n=>{var r,s;(r=this.Id)===null||r===void 0||(s=r.removeEventListener)===null||s===void 0||s.call(r,n,this.Pd,{capture:!0})})),this.Cd=void 0,this.Td=void 0,this.Sd=!1,this.Md=void 0}destroy(){this.Vd()}dispose(){this.Vd()}Vd(){var t,e,n;this.Ud(),this.md++,this.bd=!1,this.qc=void 0,this.Gd(this.vd,"cancelled"),this.Gd(this.fd,"cancelled"),this.bo&&(this.Qd(),(t=this.Nd)===null||t===void 0||t.dispose(),this.Nd=void 0,(e=this.jd)===null||e===void 0||e.call(this),this.jd=void 0,this.dd=[],(n=this.Dd)===null||n===void 0||n.removeEventListener("online",this.rn),this.bo=void 0)}get Mr(){return this.wo.get()}Zd(t){var e;return this.Jd&&t in this.Jd?this.Jd[t]:(e=this.bo)===null||e===void 0?void 0:e.kv.get(t)}Bd(){return!!this.Jd&&(this.Jd=void 0,!0)}Kd(){var t;return!ce((t=this.bo)===null||t===void 0?void 0:t.kv.get("$enabled_feature_flags"))&&this.Bd()}$t(t){this.Xd(()=>{var e;return(e=this.bo)===null||e===void 0?void 0:e.kv.set(t)})}Yd(t,e,n){if(!this.Ad||!t.$enabled_feature_flags)return;const r=this.Zd("$enabled_feature_flags")||{},s=t.$enabled_feature_flags||{},i=e.flags||e.featureFlags,o=e.flags?Object.entries(e.flags).filter(([,x])=>!(x!=null&&x.failed)).map(([x])=>x):[],l=!!e.errorsWhileComputingFlags&&!!e.flags,u=l?o:n&&!Ue(i)?Object.keys(i||{}):Array.from(new Set([...Object.keys(r),...Object.keys(s)])),d=this.Zd("$feature_flag_payloads")||{},f=t.$feature_flag_payloads||{},h=l||n?u:Array.from(new Set([...Object.keys(d),...Object.keys(f)])),g=!l&&!n,v=!!g||u,w=!!g||h,_={[No]:v,[_i]:v,[Fa]:w};t.$feature_flag_details&&(_[oc]=v);for(const x of[ac,Ba,Uf])ce(t[x])||(_[x]=!0);this.Ad.markCrossTabFeatureFlagChanges(_)}Pt(t){this.Xd(()=>{var e;return(e=this.bo)===null||e===void 0?void 0:e.kv.remove(t)})}Xd(t){try{t()}catch(e){this.A.error("Failed to update feature flag persistence",e)}}zd(){const t={};for(const r of[No,Fa,ac,Di]){const s=this.Zd(r);ce(s)||(t[r]=s)}this.ud=t;const e=$({},t),n=this.Zd(_i);if(n)for(const[r,s]of Object.entries(n))e[`$feature/${r}`]=s;this.hd=e}qd(){const t=this.Mr.cacheTtlMs;if(!t||0>=t)return!1;const e=this.Zd(Ba);return typeof e!="number"||Date.now()-e>t}tv(){return!!this.qd()&&(this.wd||this.gd||(this.wd=!0,this.A.warn("Feature flag cache is stale, triggering refresh..."),this.reloadFeatureFlags()),!0)}ev(){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}):[]}iv(){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.nv({featureFlags:l,featureFlagPayloads:u},void 0,{persist:!1})}}updateFlags(t,e,n){var r,s;const i=n!=null&&n.merge&&(r=this.Zd("$enabled_feature_flags"))!==null&&r!==void 0?r:{},o=n!=null&&n.merge&&(s=this.Zd("$feature_flag_payloads"))!==null&&s!==void 0?s:{},l=$($({},i),t),u=$($({},o),e),d={};for(const[f,h]of Object.entries(l))d[f]={key:f,enabled:N8(h),variant:D8(h),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.nv({flags:d})}get hasLoadedFlags(){return this.pd}getFlags(){return Object.keys(this.getFlagVariants())}getFlagsWithDetails(){const t=this.Zd(oc),e=this.Zd(Di),n=this.Zd(Ul);if(!n&&!e)return t||{};const r=qt({},t||{}),s=[...new Set([...Object.keys(n||{}),...Object.keys(e||{})])];for(const l of s){var i,o;const u=r[l],d=e==null?void 0:e[l],f=ce(d)?(i=u==null?void 0:u.enabled)!==null&&i!==void 0&&i:!!d,h=ce(d)?u==null?void 0:u.variant:typeof d=="string"?d:void 0,g=n==null?void 0:n[l],v=$($({},u),{},{enabled:f,variant:f?h??(u==null?void 0:u.variant):void 0});f!==(u==null?void 0:u.enabled)&&(v.original_enabled=u==null?void 0:u.enabled),h!==(u==null?void 0:u.variant)&&(v.original_variant=u==null?void 0:u.variant),g&&(v.metadata=$($({},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.ld||(this.A.warn(" Overriding feature flag details!",{flagDetails:t,overriddenPayloads:n,finalDetails:r}),this.ld=!0),r}getAllFeatureFlags(){const t=this.getFlagVariants(),e=this.getFlagPayloads();return Object.keys(t).map(n=>{const r=t[n];return{key:n,enabled:N8(r),variant:D8(r),payload:L8(e[n])}})}getFlagVariants(){const t=this.Zd(_i),e=this.Zd(Di);if(!e)return t||{};const n=qt({},t||{}),r=Object.keys(e);for(let s=0;r.length>s;s++)n[r[s]]=e[r[s]];return this.ld||(this.A.warn(" Overriding feature flags!",{enabledFlags:t,overriddenFlags:e,finalFlags:n}),this.ld=!0),n}getFlagPayloads(){const t=this.Zd(Fa),e=this.Zd(Ul);if(!e)return t||{};const n=qt({},t||{}),r=Object.keys(e);for(let s=0;r.length>s;s++)n[r[s]]=e[r[s]];return this.ld||(this.A.warn(" Overriding feature flag payloads!",{flagPayloads:t,overriddenPayloads:e,finalPayloads:n}),this.ld=!0),n}reloadFeatureFlags(){this.yd||this.Mr.featureFlagsDisabled||this.xd()||(this.gd&&(this.bd=!0),this.sv||(this.dd.slice().forEach(t=>{try{t()}catch(e){this.A.error("Error while running feature flags reloading callback",e)}}),this.sv=setTimeout(()=>{this.rv()},5)))}reloadFeatureFlagsAsync(){return!this.bo||this.yd||this.Mr.featureFlagsDisabled||this.Mr.remoteRequestsDisabled||this.xd()?Promise.resolve({status:"skipped"}):new Promise(t=>{this.vd.add(t),this.reloadFeatureFlags()})}Gd(t,e){t.forEach(n=>n({status:e})),t.clear()}Qd(){clearTimeout(this.sv),this.sv=void 0}onReloading(t){return this.dd.push(t),()=>{this.dd=this.dd.filter(e=>e!==t)}}ensureFlagsLoaded(){this.pd||this.gd||this.sv||this.reloadFeatureFlags()}setAnonymousDistinctId(t){this.$anon_distinct_id=t}setReloadingPaused(t){this.yd=t}resetFlagCallReported(){this.Pt($a)}rv(t){var e;this.Qd();const n=this.bo;if(!n||this.Mr.remoteRequestsDisabled||this.xd())return void this.Gd(this.vd,"skipped");if(this.gd)return void(this.bd=!0);const r={token:n.projectToken,distinct_id:n.distinctId,groups:n.groups,$anon_distinct_id:this.$anon_distinct_id,person_properties:$($($({},n.initialPersonProperties),this.Zd("$stored_person_properties")||{}),{},{$lib:n.library.name,$lib_version:n.library.version}),group_properties:this.Zd(Da),timezone:KA()};ce(n.deviceId)||(r.$device_id=n.deviceId),(t!=null&&t.disableFlags||this.Mr.featureFlagsDisabled)&&(r.disable_flags=!0);const s=this.ev();s.length&&(r.evaluation_contexts=s);const i=this.iv();ce(i)||(r.flag_keys=i);const o=this.Mr.onlyEvaluateSurveyFeatureFlags,l="/flags/?v=2"+(o?"&only_evaluate_survey_feature_flags=true":""),u=this.md,d=this.vd;this.vd=new Set,this.fd=d,this.gd=!0;const f=()=>{this.bd&&(this.bd=!1,this.rv())},h=x=>{var S,k;const C=(S=x.json)!==null&&S!==void 0?S:{},A=x.statusCode!==200;if(this.gd=!1,u!==this.md)return void f();if(this.ov(x.statusCode),A||this.bd||(this.$anon_distinct_id=void 0),r.disable_flags&&!this.bd)return void this.Gd(d,"skipped");this._d=!A;const T=[];x.error?T.push(x.error instanceof Error&&x.error.name==="AbortError"?"timeout":x.error instanceof Error?Bk:"unknown_error"):x.statusCode!==200&&T.push(`api_error_${x.statusCode}`),C.errorsWhileComputingFlags&&T.push("errors_while_computing_flags");const I=!!(!((k=C.quotaLimited)===null||k===void 0)&&k.includes("feature_flags"));I&&T.push("quota_limited"),this.$t({[hh]:T}),I?this.A.warn("You have hit your feature flags quota limit, and will not be able to load feature flags until the quota is reset. Please visit https://posthog.com/docs/billing/limits-alerts to learn more."):r.disable_flags||this.nv(C,A,{partialResponse:o}),this.Gd(d,r.disable_flags?"skipped":T.length||!C.flags&&!C.featureFlags?"error":"loaded"),f()},g=x=>{this.gd=!1,u===this.md&&(this.$t({[hh]:[Bk]}),this.A.error("Feature flag request failed",x),this.Kd()&&this.Hd(!0),this.Gd(d,"error")),f()};let v=(e=this.Mr.requestMaxRetries)!==null&&e!==void 0?e:1;const w=()=>v>0&&u===this.md,_=()=>{if(u!==this.md||!this.bo||this.Mr.remoteRequestsDisabled)return this.gd=!1,this.Gd(d,"skipped"),void f();try{n.sendRequest(l,{target:"flags",method:"POST",body:r,compression:this.Mr.compression,sentAt:"body",timeoutMs:this.Mr.requestTimeoutMs}).then(x=>{if((S=>uH.includes(S.statusCode)||(k=>k.statusCode===0&&k.error instanceof Error&&k.error.name==="AbortError")(S))(x)&&w())return v--,void setTimeout(_,500);h(x)}).catch(g)}catch(x){g(x)}};_()}xd(){return XA(this.kd,3)}ov(t){this.kd=QA(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+Zy);if(this.tv())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+Zy);if(this.tv())return;const n=this.getFlagVariants(),r=t in n,s=n[t],i=this.getFlagPayloads()[t],o=String(s),l=this.Zd("$feature_flag_request_id")||void 0,u=this.Zd("$feature_flag_evaluated_at")||void 0;let d,f=this.Zd("$flag_call_reported")||{};if(this.Mr.deduplicateCallsPerSession){var h;const O=(h=this.bo)===null||h===void 0?void 0:h.session.sessionId,N=this.Zd(Of);O&&O!==N&&(f={},d=O)}if(!e.send_event&&"send_event"in e)d&&this.$t({[$a]:f,[Of]:d});else if(t in f&&f[t].includes(o))d&&this.$t({[$a]:f,[Of]:d});else{var g,v,w,_,x,S,k,C,A,T,I,M,R;Ue(f[t])?f[t].push(o):f[t]=[o],this.$t($({[$a]:f},d?{[Of]:d}:{}));const O=this.getFeatureFlagDetails(t),N=[...(g=this.Zd("$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 F=(C=O==null||(A=O.reason)===null||A===void 0?void 0:A.description)!==null&&C!==void 0?C:O==null||(T=O.reason)===null||T===void 0?void 0:T.code;F&&(D.$feature_flag_reason=F),!(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.av(D)}return r?{key:t,enabled:!!s,variant:typeof s=="string"?s:void 0,payload:L8(i)}:void 0}av(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.lv(t,e)}lv(t,e){var n=this;return Kt(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.ev();i.length&&(s.evaluation_contexts=i);const o=n.iv();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+Zy),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.nv(t,e,n)}nv(t,e,n){if(!this.bo)return;this.pd=!0;const r=((s,i={},o={},l={},u,d=zk)=>{const f=((C,A)=>{const T=C.flags;if(T){const I=Object.fromEntries(Object.keys(T).map(R=>{var O;return[R,(O=T[R].variant)!==null&&O!==void 0?O:T[R].enabled]})),M=Object.fromEntries(Object.keys(T).filter(R=>T[R].enabled).filter(R=>{var O;return!ce((O=T[R].metadata)===null||O===void 0?void 0:O.payload)}).map(R=>{var O;return[R,(O=T[R].metadata)===null||O===void 0?void 0:O.payload]}));return $($({},C),{},{featureFlags:I,featureFlagPayloads:M})}return C.featureFlags&&A.warn("Using an older version of the feature flags endpoint. Please upgrade your PostHog server to the latest version"),C})(s,d),h=f.flags,g=f.featureFlags,v=f.featureFlagPayloads;if(!g)return;const w=s.requestId,_=s.evaluatedAt;if(Ue(g)){d.warn("v1 of the feature flags endpoint is deprecated. Please use the latest version.");const C={};if(g)for(let A=0;g.length>A;A++)C[g[A]]=!0;return{[No]:g,[_i]:C,[Uf]:!1}}let x=g,S=v,k=h;if(u!=null&&u.partialResponse){const C=Object.keys(x),A=S||{};x=$($({},i),x),S=$($({},o),A),C.forEach(T=>{T in A||S==null||delete S[T]}),k=$($({},l),k)}else if(s.errorsWhileComputingFlags)if(h){const C=new Set(Object.keys(h).filter(T=>{var I;return!(!((I=h[T])===null||I===void 0)&&I.failed)}));x=$($({},i),Object.fromEntries(Object.entries(x).filter(([T])=>C.has(T))));const A=Object.fromEntries(Object.entries(S||{}).filter(([T])=>C.has(T)));S=$($({},o),A),C.forEach(T=>{T in A||S==null||delete S[T]}),k=$($({},l),Object.fromEntries(Object.entries(k||{}).filter(([T])=>C.has(T))))}else x=$($({},i),x),S=$($({},o),S),k=$($({},l),k);return $($({[No]:Object.keys(Wk(x)),[_i]:x||{},[Fa]:S||{},[oc]:k||{},[Uf]:s.minimalFlagCalledEvents===!0},w?{[ac]:w}:{}),_?{[Ba]:_}:{})})(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(_i));this.Jd=r,s||this.$t(r)}else this.Bd(),this.Yd(r,t,!!(n!=null&&n.partialResponse)),this.$t(r);else e&&this.Kd();e||(this.wd=!1),this.Hd(e)}override(t,e=!1){this.A.warn("override is deprecated. Please use overrideFeatureFlags instead."),this.overrideFeatureFlags({flags:t,suppressWarning:e})}overrideFeatureFlags(t){this.uv(t)}uv(t){if(this.bo){if(t===!1)return this.Pt([Di,Ul]),this.Hd(),void Ml.info("All overrides cleared");if(Ue(t))return this.$t({[Di]:Zk(t)}),this.Hd(),void Ml.info("Flag overrides set",{flags:t});if(t&&typeof t=="object"&&("flags"in t||"payloads"in t)){var e;const n=t;this.ld=!!((e=n.suppressWarning)!==null&&e!==void 0&&e);const r={},s=n.flags,i=n.payloads;return s&&(r[Di]=Ue(s)?Zk(s):s),i&&(r[Ul]=i),Object.keys(r).length&&this.$t(r),s===!1&&i===!1?this.Pt([Di,Ul]):s===!1?this.Pt(Di):i===!1&&this.Pt(Ul),this.Hd(),s===!1?Ml.info("Flag overrides cleared"):s&&Ml.info("Flag overrides set",{flags:s}),void(i===!1?Ml.info("Payload overrides cleared"):i&&Ml.info("Payload overrides set",{payloads:i}))}if(t&&typeof t=="object")return this.$t({[Di]:t}),this.Hd(),void Ml.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.hv();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.Zd("$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=$($({},this.getFlagVariants()),{},{[t]:e});(r=this.Ad)===null||r===void 0||r.markCrossTabFeatureFlagChanges({$active_feature_flags:[t],$enabled_feature_flags:[t],$stored_person_properties:Object.keys(i)}),this.$t({[No]:Object.keys(Wk(l)),[_i]:l,[ja]:$($({},this.Zd("$stored_person_properties")||{}),i)}),this.Hd();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.Zd(x2);!r||e?this.dv(t,n):t(r)}dv(t,e){var n=this;return Kt(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({[x2]: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)}})()}hv(){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),{})}}Hd(t){this.zd();const{flags:e,flagVariants:n}=this.hv();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.vv(t,e)}vv(t,e=!0){const n=this.Zd("$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({[ja]:$($($({},n),i),r)}),e&&this.reloadFeatureFlags()}unsetPersonPropertiesForFlags(t,e=!0){const n=$({},this.Zd("$stored_person_properties")||{});t.forEach(r=>{delete n[r]}),this.$t({[ja]:n}),e&&this.reloadFeatureFlags()}resetPersonPropertiesForFlags(t=!0){this.Pt(ja),t&&this.reloadFeatureFlags()}setGroupPropertiesForFlags(t,e=!0){const n=this.Zd("$stored_group_properties")||{},r=$({},n);for(const s of Object.keys(t))r[s]=$($({},n[s]),t[s]);this.$t({[Da]:r}),e&&this.reloadFeatureFlags()}resetGroupPropertiesForFlags(t){if(t){const e=this.Zd("$stored_group_properties")||{};this.$t({[Da]:$($({},e),{},{[t]:{}})})}else this.Pt(Da)}reset(){this.md++,this.Gd(this.vd,"cancelled"),this.Gd(this.fd,"cancelled"),this.bd=!1,this.ud={},this.hd={},this.Jd=void 0,this.pd=!1,this.yd=!1,this._d=!1,this.$anon_distinct_id=void 0,this.Qd(),this.ld=!1,this.kd=0}};const qk=dn("[FeatureFlags]");var fH=class{constructor(t,e=!1){this.fv=!1,this.update(t,e)}update(t,e){this.pv=((n,r)=>{var s,i,o,l,u,d,f,h;return{bootstrap:{featureFlags:(s=(i=n.bootstrap)===null||i===void 0?void 0:i.featureFlags)!==null&&s!==void 0?s:void 0,featureFlagPayloads:(o=(l=n.bootstrap)===null||l===void 0?void 0:l.featureFlagPayloads)!==null&&o!==void 0?o:void 0},remoteRequestsDisabled:r,featureFlagsDisabled:!!n.advanced_disable_feature_flags,onlyEvaluateSurveyFeatureFlags:!!n.advanced_only_evaluate_survey_feature_flags,deduplicateCallsPerSession:!!n.advanced_feature_flags_dedup_per_session,cacheTtlMs:n.feature_flag_cache_ttl_ms,refreshIntervalMs:(u=n.remote_config_refresh_interval_ms)!==null&&u!==void 0?u:3e5,idleRefreshBackoff: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=(h=n.evaluation_contexts)!==null&&h!==void 0?h:n.evaluation_environments)!==null&&f!==void 0?f:[],flagKeys:Ue(n.flag_keys)?n.flag_keys:void 0}})(t,e),!t.evaluation_environments||t.evaluation_contexts||this.fv||(qk.warn("evaluation_environments is deprecated. Use evaluation_contexts instead. evaluation_environments will be removed in a future version."),this.fv=!0),ce(t.flag_keys)||Ue(t.flag_keys)||qk.error("Invalid flag_keys found:",t.flag_keys,"Expected array of non-empty strings")}get(){return this.pv}};const Gk=t=>Sd(t)&&(t.name==="RangeError"&&t.message.indexOf("Maximum call stack size exceeded")===0||t.name==="InternalError"&&t.message==="too much recursion"),di=dn("[Error tracking]"),V2="webkit-masked-url:",hH=[{value:"isolatedAPI.contexts.topHostname",exact:!1},{value:"No response from target",exact:!0}],pH=["chrome-extension://","moz-extension://","safari-extension:","safari-web-extension:",V2],mH=["__firefox__","__gCrWeb"],Kk="Refusing to render web experiment since the viewer is a likely bot",gH={icontains:(t,e)=>e.toLowerCase().indexOf(t.toLowerCase())>-1,not_icontains:(t,e)=>e.toLowerCase().indexOf(t.toLowerCase())===-1,regex:(t,e)=>Ym(e,t),not_regex:(t,e)=>!Ym(e,t),exact:(t,e)=>e===t,is_not:(t,e)=>e!==t},Us=dn("[Conversations]"),Il="Conversations not available yet.";function Yk(t,e){var n,r,s,i,o,l,u;const d=(n=t==null?void 0:t.flushIntervalMs)!==null&&n!==void 0?n:3e3,f=(r=t==null?void 0:t.maxBufferSize)!==null&&r!==void 0?r:100,h=e!=null&&e.consoleCapture?void 0:(s=t==null?void 0:t.maxLogsPerInterval)!==null&&s!==void 0?s:1e3,g=ce(h)?Math.max(f,2048):Math.max(f,h),v=$($({},(function(){let w="",_="";try{const x=Qn==null?void 0:Qn.userAgent;x&&([w,_]=V5(x))}catch{}return(function(x,S){const k=(function(C){if(C)return{}.hasOwnProperty.call(z8,C)?z8[C]:C})(x);return $($({},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:h,backgroundFlushBudgetMs:0,terminationFlushBudgetMs:0}}const vH=["debug","log","warn","error","info"],yH=t=>{for(;t!=null&&t.__rrweb_original__;)t=t.__rrweb_original__;return t},Xk="console",OT="__posthogHandledLogsRequestError",Wy=(t,e)=>{const n=t instanceof Error?t:new Error(e);return n[OT]=!0,n},Qk=t=>!!t&&typeof t=="object"&&t[OT]===!0,Xm=dn("[NetworkMetrics]"),Jx=()=>{var t;return!(ee==null||(t=ee.performance)===null||t===void 0)&&t.now?ee.performance.now():Date.now()},_H={"http:":80,"https:":443},wH=new Set(["CONNECT","DELETE","GET","HEAD","OPTIONS","PATCH","POST","PUT","TRACE"]),LT=(t,e)=>{var n;const r=String(e);return{method:String(t).toUpperCase(),url:((n=Bo(r))===null||n===void 0?void 0:n.href)||r}},H2=(t,e,n,r,s,i,o=!1)=>{try{var l,u;const d=s();if(!d)return;const f=n||void 0,h=Jx()-r,g=Bo(e.url);if(g&&g.protocol!=="http:"&&g.protocol!=="https:")return;const v={url:(g==null?void 0:g.href)||e.url,method:e.method},w=Ln(d.name)?d.name(v):ct(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=$($($($($({},(S=>{const k=wH.has(S)?S:"_OTHER";return $({"http.request.method":k},k==="_OTHER"&&S!==k?{"http.request.method_original":S}:{})})(v.method)),g?(S=>{return{"server.address":S.hostname.startsWith("[")&&S.hostname.endsWith("]")?S.hostname.slice(1,-1):S.hostname,"server.port":Number(S.port)||_H[S.protocol],"url.scheme":S.protocol.slice(0,-1),"url.template":(k=S.pathname,k.split("/").map(C=>(A=>/^\d+$/.test(A)||A.length>=8&&/^[0-9a-f-]*\d[0-9a-f-]*$/i.test(A))(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:h}));(u=t.metrics)===null||u===void 0||u.histogram(w,h,{unit:"ms",attributes:x})}catch(d){Xm.error("Failed to record network metric",d)}},NT=()=>{},xH=(t,e)=>Ln(ee==null?void 0:ee.fetch)?ld(ee,"fetch",n=>function(...r){const s=Jx(),i=n.apply(this,r);if(!e())return i;try{var o,l,u;const[d,f]=r,h=LT((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=>(H2(t,h,g==null?void 0:g.status,s,e,void 0,!0),g),g=>{throw H2(t,h,void 0,s,e,g),g})}catch(d){return Xm.error("Failed to observe fetch",d),i}}):NT,bH=(t,e)=>{var n;const r=ee==null||(n=ee.XMLHttpRequest)===null||n===void 0?void 0:n.prototype;if(!r)return NT;const s=new WeakMap,i=ld(r,"open",l=>function(...u){try{hT.has(this)||s.set(this,LT(u[0],u[1]))}catch(d){Xm.error("Failed to observe XHR open",d)}return l.apply(this,u)}),o=ld(r,"send",l=>function(...u){let d;try{const f=s.get(this);if(f&&e()){const h=Jx();d=()=>{this.removeEventListener("loadend",d),H2(t,f,this.status,h,e)},kt(this,"loadend",d)}}catch(f){Xm.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()}},Jk=new WeakMap,SH={maxStringLength:2048,truncationSuffix:"..."};function eE(t){if(t)return t===!0?{intent:!0,model:!0}:{intent:t.intent!==!1,model:t.model!==!1}}function Sa(t,e){return{}.hasOwnProperty.call(t,e)}function qy(t,e){const n=Object.create(t);return e&&Object.defineProperty(n,"inputSchema",{configurable:!0,enumerable:!0,writable:!0,value:e}),n}function tE(t,e,n=!1){if(!ct(t))return;const r=t.trim();return r?(n?sF(r,SH):r).slice(0,e):void 0}function nE(t){try{return st(t)&&t.isError===!0}catch{return!1}}const Bg={featureFlags:class extends dH{constructor(t){const e=new fH(t.config,t.il());super(e),this.name="featureFlags",this._instance=t,this.gv=e}get Ad(){return this._instance.persistence}updateConfig(t,e){this.gv.update(t,e),this.Fd()}}},kH={sessionRecording:class{get Mr(){return this._instance.config}get Il(){return this._instance.persistence}get started(){var t;return!!(!((t=this.mv)===null||t===void 0)&&t.isStarted)}get status(){var t,e;return this.yv==="awaiting_config"||this.yv==="missing_config"?this.yv:(t=(e=this.mv)===null||e===void 0?void 0:e.status)!==null&&t!==void 0?t:this.yv}constructor(t){if(this._instance=t,this._forceAllowLocalhostNetworkCapture=!1,this.yv=zy,this.bv=void 0,this._v=!1,this.Je=(()=>{var e,n;if(!(he!=null&&he.visibilityState)||he.visibilityState==="visible")return!0;const r=ee==null||(e=ee.performance)===null||e===void 0||(n=e.getEntriesByType)===null||n===void 0?void 0:n.call(e,"visibility-state");return!(r!=null&&r.length)||r.some(s=>s.name==="visible")})(),this.sn=()=>{var e,n;(he==null?void 0:he.visibilityState)==="visible"&&(this.Je=!0,(e=this.mv)===null||e===void 0||(n=e.setDocumentWasEverVisible)===null||n===void 0||n.call(e,!0))},!this._instance.sessionManager)throw xo.error("started without valid sessionManager"),new Error("[SessionRecording] started without valid sessionManager. This is a bug.");if(this.Mr.cookieless_mode==="always")throw new Error('[SessionRecording] cannot be used with cookieless_mode="always"');he!=null&&he.addEventListener&&kt(he,"visibilitychange",this.sn)}initialize(){this.startIfEnabledOrStop()}dispose({discardBufferedEvents:t=!1}={}){var e;this._v=!0,he==null||(e=he.removeEventListener)===null||e===void 0||e.call(he,"visibilitychange",this.sn),t?this.wv(!0):this.stopRecording()}get Sv(){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 ee&&e&&n&&!r}startIfEnabledOrStop(t){var e;if(this._v||this.Sv&&(!((e=this.mv)===null||e===void 0)&&e.isStarted))return;const n=!ce(Object.assign)&&!ce(Array.from);this.Sv&&n?(this.xv(t),xo.info("starting")):(this.yv=zy,this.stopRecording())}xv(t){var e,n;if(this.Sv)if(this.yv!=="awaiting_config"&&this.yv!=="missing_config"&&(this.yv=jk),($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.$v(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.Cv,o=>{if(!this._v&&this.Sv&&this._instance.sessionManager===i)return o?(this._instance.register_for_session({$sdk_debug_recording_script_not_loaded:!0}),xo.error("could not load recorder",o)):void this.$v(t);this.yv="disabled"})}}stopRecording(){var t,e;(t=this.bv)===null||t===void 0||t.call(this),this.bv=void 0,(e=this.mv)===null||e===void 0||e.stop()}wv(t=!1){var e,n;(e=this.bv)===null||e===void 0||e.call(this),this.bv=void 0,(n=this.mv)===null||n===void 0||n.discard({discardProducerEvents:t})}Tv(){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")}Iv(t,e){if(Je(t))return null;const n=mn(t)?t:parseFloat(t);return typeof(r=n)!="number"||!Number.isFinite(r)||0>r||r>1?(xo.warn(`${e} must be between 0 and 1. Ignoring invalid value:`,t),null):n;var r}Mv(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.Iv((i=this.Mr.session_recording)===null||i===void 0?void 0:i.sampleRate,"session_recording.sampleRate"),u=this.Iv(o==null?void 0:o.sampleRate,"remote config sampleRate"),d=l??u;Je(d)&&this.Tv();const f=o==null?void 0:o.minimumDurationMilliseconds;r.register({[Zf]:$($({cache_timestamp:Date.now(),enabled:!!o},o),{},{networkPayloadCapture:$({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.bv)===null||e===void 0||e.call(this),this.bv=(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.Mv(e),void this.wv()):(this.Mv(e),void this.startIfEnabledOrStop()):(this.yv==="awaiting_config"&&(this.yv="missing_config",this._instance.register_for_session({[zx]:!0}),xo.warn("config refresh failed, recording will not start until page reload")),void this.startIfEnabledOrStop())}log(t,e="log"){var n;!((n=this.mv)===null||n===void 0)&&n.log?this.mv.log(t,e):xo.warn("log called before recorder was ready")}get Cv(){var t,e;const n=(t=this._instance)===null||t===void 0||(t=t.persistence)===null||t===void 0?void 0:t.get_property(Zf);return(n==null||(e=n.scriptConfig)===null||e===void 0?void 0:e.script)||"lazy-recorder"}Ev(){const t=this._instance.get_property(Zf);if(!t)return!1;let e;try{e=typeof t=="object"?t:JSON.parse(t)}catch(n){return xo.warn("persisted remote config for session recording is invalid and will be ignored",n),!1}return!Je(e.cache_timestamp)&&36e5>=Date.now()-e.cache_timestamp}$v(t){var e,n,r;if(!this._v&&this.Sv&&this._instance.sessionManager){if(!(!((e=$e.__PosthogExtensions__)===null||e===void 0)&&e.initSessionRecording))return xo.warn("Called on script loaded before session recording is available. This can be caused by adblockers."),void this._instance.register_for_session({[Hx]:!0});var s;if(this.mv||(this.mv=(s=$e.__PosthogExtensions__)===null||s===void 0?void 0:s.initSessionRecording(this._instance,this.Je),this.mv._forceAllowLocalhostNetworkCapture=this._forceAllowLocalhostNetworkCapture),!this.Ev())return this.yv==="missing_config"||this.yv==="awaiting_config"?void 0:(this.yv="awaiting_config",xo.info("persisted remote config is stale, requesting fresh config before starting"),void new aT(this._instance).load());this.yv=jk,(n=(r=this.mv).setDocumentWasEverVisible)===null||n===void 0||n.call(r,this.Je),this.mv.start(t)}else this.yv=zy}onRRwebEmit(t){var e,n;(e=this.mv)===null||e===void 0||(n=e.onRRwebEmit)===null||n===void 0||n.call(e,t)}overrideLinkedFlag(){var t,e;this.mv||(e=this.Il)===null||e===void 0||e.register({$replay_override_linked_flag:!0}),(t=this.mv)===null||t===void 0||t.overrideLinkedFlag()}overrideSampling(){var t,e;this.mv||(e=this.Il)===null||e===void 0||e.register({$replay_override_sampling:!0}),(t=this.mv)===null||t===void 0||t.overrideSampling()}overrideTrigger(t){var e,n;this.mv||(n=this.Il)===null||n===void 0||n.register({[t==="url"?"$replay_override_url_trigger":"$replay_override_event_trigger"]:!0}),(e=this.mv)===null||e===void 0||e.overrideTrigger(t)}get sdkDebugProperties(){var t;const e={};for(const r of eH){var n;const s=(n=this._instance.sessionPersistence)===null||n===void 0?void 0:n.get_property(r);ce(s)||(e[r]=s)}return $($({},e),((t=this.mv)===null||t===void 0?void 0:t.sdkDebugProperties)||{$recording_status:this.status})}tryAddCustomEvent(t,e){var n;return!!(!((n=this.mv)===null||n===void 0)&&n.tryAddCustomEvent(t,e))}flushBeforeIdentityReset(){var t,e;(t=this.mv)===null||t===void 0||(e=t.flushBeforeIdentityReset)===null||e===void 0||e.call(t)}}},EH={autocapture:class extends KV{constructor(t){super(new YV(t)),this.instance=t}},historyAutocapture:class{constructor(t){this.Pv=!1,this._instance=t,this.Rv=this.Av()}initialize(){this.startIfEnabled()}get isEnabled(){const t=this.Fv();return!!(t.path||t.search||this.Ov(t))}startIfEnabled(){this.isEnabled&&(ye.info("History API monitoring enabled, starting..."),this.monitorHistoryChanges())}startIfEnabledOrStop(){this.stop(),this.Rv=this.Av(),this.startIfEnabled()}stop(){this.Dv&&this.Dv(),this.Dv=void 0,this.Lv&&this.Lv(),this.Lv=void 0,ye.info("History API monitoring stopped")}monitorHistoryChanges(){ee&&ee.history&&(this.Nv("pushState"),this.Nv("replaceState"),this.qv(),this.Ov()&&this.jv())}Nv(t){var e;if(!ee||!((e=ee.history[t])===null||e===void 0)&&e.__posthog_wrapped__)return;const n=this;ld(ee.history,t,r=>function(s,i,o){var l;n.Bv(o)&&n.zv(),r.call(this,s,i,o),n.Hv(t,!n.Pv&&(ee==null||(l=ee.event)===null||l===void 0?void 0:l.type)!=="popstate")})}Av(){const t=ee==null?void 0:ee.location;if(t!=null&&t.pathname)return{pathname:t.pathname,search:t.search,hash:t.hash}}Fv(){const t=this._instance.config.capture_pageview;return t==="history_change"?{path:!0}:st(t)?t:{}}Ov(t=this.Fv()){return!!t.hash&&!this._instance.config.disable_capture_url_hashes}Uv(t){const e=this.Fv(),n=this.Rv;return!(!n||!(e.path&&t.pathname!==n.pathname||e.search&&t.search!==n.search||this.Ov(e)&&t.hash!==n.hash))}Hv(t,e=!1){try{e||this.zv();const n=this.Av();if(!n)return;if(this.Uv(n)){const r=()=>this._instance.capture(Bx,{navigation_type:t});e?(this.Wv=r,Promise.resolve().then(()=>this.zv())):r()}this.Rv=n}catch(n){ye.error(`Error capturing ${t} pageview`,n)}}Bv(t){var e,n;return!(Je(t)||!ee)&&((e=Bo(String(t)))===null||e===void 0?void 0:e.href)!==((n=ee.location)===null||n===void 0?void 0:n.href)}zv(){const t=this.Wv;if(t){this.Wv=void 0,this.Pv=!0;try{t()}catch(e){ye.error("Error capturing deferred pageview",e)}finally{this.Pv=!1}this.Rv=this.Av()}}qv(){if(this.Dv)return;const t=()=>{this.Hv("popstate")};kt(ee,"popstate",t),this.Dv=()=>{ee&&ee.removeEventListener("popstate",t)}}jv(){if(this.Lv)return;const t=()=>{this.Hv("hashchange")};kt(ee,"hashchange",t),this.Lv=()=>{ee&&ee.removeEventListener("hashchange",t)}}},heatmaps:class{get Mr(){return this.instance.config}constructor(t){var e;this.Vv=!1,this.ko=!1,this.Gv=null,this.instance=t,this.Vv=!!(!((e=this.instance.persistence)===null||e===void 0)&&e.props[S2]),this.rageclicks=new MT(t.config.rageclick)}initialize(){this.startIfEnabled()}get flushIntervalMilliseconds(){let t=5e3;return st(this.Mr.capture_heatmaps)&&this.Mr.capture_heatmaps.flush_interval_milliseconds&&(t=this.Mr.capture_heatmaps.flush_interval_milliseconds),t}get isEnabled(){return Je(this.Mr.capture_heatmaps)?Je(this.Mr.enable_heatmaps)?this.Vv:this.Mr.enable_heatmaps:this.Mr.capture_heatmaps!==!1}startIfEnabled(){if(this.isEnabled){if(this.ko)return;tH.info("starting..."),this.Qv(),this.sn()}else{var t;clearInterval((t=this.Gv)!==null&&t!==void 0?t:void 0),this.Zv(),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({[S2]:n}),this.Vv=n,this.startIfEnabled()}getAndClearBuffer(){const t=this.Rt;return this.Rt=void 0,t}Jv(t){Uy(t.originalEvent)&&this.Ir(t.originalEvent,"deadclick")}sn(){this.Gv&&clearInterval(this.Gv),this.Gv=(he==null?void 0:he.visibilityState)==="visible"?setInterval(this.fl.bind(this),this.flushIntervalMilliseconds):null}Qv(){ee&&he&&(this.Kv=this.fl.bind(this),kt(ee,Bm,this.Kv),this.Xv=t=>this.Ir(t||(ee==null?void 0:ee.event)),kt(he,"click",this.Xv,{capture:!0}),this.Yv=t=>this.tf(t||(ee==null?void 0:ee.event)),kt(he,"mousemove",this.Yv,{capture:!0}),this.ef=new uk(this.instance,tV,this.Jv.bind(this)),this.ef.startIfEnabledOrStop(),this.if=this.sn.bind(this),kt(he,ph,this.if),this.ko=!0)}Zv(){var t;ee&&he&&(this.Kv&&ee.removeEventListener(Bm,this.Kv),this.Xv&&he.removeEventListener("click",this.Xv,{capture:!0}),this.Yv&&he.removeEventListener("mousemove",this.Yv,{capture:!0}),this.if&&he.removeEventListener(ph,this.if),clearTimeout(this.nf),(t=this.ef)===null||t===void 0||t.stop(),this.ko=!1)}sf(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)&&!mr(d,"body");){if(d===u)return!1;let v;try{var f,h,g;v=(f=(h=(g=d.ownerDocument)===null||g===void 0?void 0:g.defaultView)!==null&&h!==void 0?h:ee)===null||f===void 0?void 0:f.getComputedStyle(d).position}catch{return!1}if(ze(l,v))return!0;d=zA(d)}return!1})(qf(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(J8(t.target)||!Uy(t))return;const r=this.sf(t,e);!((n=this.rageclicks)===null||n===void 0)&&n.isRageClick(t.clientX,t.clientY,new Date().getTime())&&BA(qf(t),this.instance.config.rageclick)&&this.Qs($($({},r),{},{type:"rageclick"})),this.Qs(r)}tf(t){!J8(t.target)&&Uy(t)&&(clearTimeout(this.nf),this.nf=setTimeout(()=>{this.Qs(this.sf(t,"mousemove"))},500))}Qs(t){if(!ee)return;const e=this.Mr.disable_capture_url_hashes?Ga(ee.location.href):ee.location.href,n=this.Mr.custom_personal_data_properties,r=this.Mr.mask_personal_data_properties?[...od,...n||[]]:[],s=gh(e,r,vh);this.Rt=this.Rt||{},this.Rt[s]||(this.Rt[s]=[]),this.Rt[s].push(t)}fl(){this.Rt&&!Yr(this.Rt)&&this.instance.capture("$$heatmap",{$heatmap_data:this.getAndClearBuffer()})}},deadClicksAutocapture:uk,webVitalsAutocapture:class{constructor(t){var e;this._instance=t,this.Vv=!1,this.ko=!1,this.Rt={navigationKey:void 0,url:void 0,metrics:[],firstMetricTimestamp:void 0},this.rf=()=>{clearTimeout(this.af),this.af=void 0,this.Rt.metrics.length!==0&&(this._instance.capture("$web_vitals",$({$current_url:this.Rt.url},this.Rt.metrics.reduce((n,r)=>$($({},n),{},{[`$web_vitals_${r.name}_event`]:$({},r),[`$web_vitals_${r.name}_value`]:r.value}),{}))),this.Rt={navigationKey:void 0,url:void 0,metrics:[],firstMetricTimestamp:void 0})},this.lf=n=>{var r;if(this.Rt=this.Rt||{navigationKey:void 0,url:void 0,metrics:[],firstMetricTimestamp:void 0},Je(n==null?void 0:n.name)||Je(n==null?void 0:n.value))return void Rl.error("Invalid metric received",n);const s=typeof n.navigationURL=="string"?n.navigationURL:void 0,i=this.uf(s);if(ce(i))return;const o=mn(n.navigationId)||typeof n.navigationId=="string"?`navigation:${n.navigationId}`:`url:${i}`;if(this.cf&&n.value>=this.cf)return void Rl.error("Ignoring metric with value >= "+this.cf,n);this.Rt.navigationKey!==o&&(this.rf(),this.af=setTimeout(this.rf,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=$($($({},n),s?{navigationURL:i}:{}),{},{$current_url:i,timestamp:Date.now()});if(delete u.entries,st(n.attribution)&&this.attributionMetrics.indexOf(n.name)>-1){const d={};for(const f of JV){const h=f==="url"&&typeof n.attribution[f]=="string"?this.uf(n.attribution[f]):n.attribution[f];ce(h)||(d[f]=h)}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.rf()},this.hf=()=>{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.df])||(this.df==="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 Rl.error("web vitals callbacks not loaded - not starting");const f={reportSoftNavs:this.useSoftNavs},h=o&&this.attributionMetrics.indexOf("INP")>-1?$($({},f),{},{includeProcessedEventEntries:!1}):f;this.allowedMetrics.indexOf("LCP")>-1&&n(this.lf.bind(this),f),this.allowedMetrics.indexOf("CLS")>-1&&r(this.lf.bind(this),f),this.allowedMetrics.indexOf("FCP")>-1&&s(this.lf.bind(this),f),this.allowedMetrics.indexOf("INP")>-1&&i(this.lf.bind(this),h),this.ko=!0},this.Vv=!!(!((e=this._instance.persistence)===null||e===void 0)&&e.props[C2]),this.startIfEnabled()}get vf(){return this._instance.config.capture_performance}get allowedMetrics(){var t,e;const n=st(this.vf)?(t=this.vf)===null||t===void 0?void 0:t.web_vitals_allowed_metrics:void 0;return Je(n)?((e=this._instance.persistence)===null||e===void 0?void 0:e.props.$web_vitals_allowed_metrics)||Dk:n}get flushToCaptureTimeoutMs(){return(st(this.vf)?this.vf.web_vitals_delayed_flush_ms:void 0)||5e3}get attributionMetrics(){const t=st(this.vf)?this.vf.web_vitals_attribution:void 0;return jr(t)?t?Dk:[]:Ue(t)?t:QV}get useAttribution(){return this.attributionMetrics.length>0}get useSoftNavs(){const t=st(this.vf)?this.vf.__preview_web_vitals_soft_navs:void 0;return t!=null&&t}get cf(){const t=st(this.vf)&&mn(this.vf.__web_vitals_max_value)?this.vf.__web_vitals_max_value:Nk;return t>0&&6e4>=t?Nk:t}get isEnabled(){const t=Wt==null?void 0:Wt.protocol;if(t!=="http:"&&t!=="https:")return Rl.info("Web Vitals are disabled on non-http/https protocols"),!1;const e=st(this.vf)?this.vf.web_vitals:jr(this.vf)?this.vf:void 0;return jr(e)?e:this.Vv}startIfEnabled(){this.isEnabled&&!this.ko&&(Rl.info("enabled, starting..."),this.zo(this.hf))}onRemoteConfig(t){if(!t.ok)return;const e=t.config;if(!("capturePerformance"in e))return;const n=st(e.capturePerformance)&&!!e.capturePerformance.web_vitals,r=st(e.capturePerformance)?e.capturePerformance.web_vitals_allowed_metrics:void 0;this._instance.persistence&&(this._instance.persistence.register({[C2]:n}),this._instance.persistence.register({[gA]:r})),this.Vv=n,this.startIfEnabled()}get df(){return this.useSoftNavs?this.useAttribution?"web-vitals-with-attribution-soft-navs":"web-vitals-soft-navs":this.useAttribution?"web-vitals-with-attribution":"web-vitals"}zo(t){var e;const n=$e.__PosthogExtensions__,r=this.df,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?Rl.error("failed to load script",i):t()})}uf(t){const e=t||(ee==null?void 0:ee.location.href);if(!e)return void Rl.error("Could not determine current URL");const n=this._instance.config.disable_capture_url_hashes?Ga(e):e,r=this._instance.config.custom_personal_data_properties,s=this._instance.config.mask_personal_data_properties?[...od,...r||[]]:[];return gh(n,s,vh)}}},CH={exceptionObserver:class{constructor(t){var e;this.hf=()=>{var n;if(!ee||!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.ff&&this.Mr.capture_unhandled_errors&&(this.ff=r(this.captureException.bind(this))),!this.pf&&this.Mr.capture_unhandled_rejections&&(this.pf=s(this.captureException.bind(this))),!this.gf&&this.Mr.capture_console_errors&&(this.gf=i(this.captureException.bind(this)))}catch(o){Ef.error("failed to start",o),this.mf()}},this._instance=t,this.yf=!!(!((e=this._instance.persistence)===null||e===void 0)&&e.props[k2]),this.wt=new qj($($({},(function(n={}){var r,s,i,o;return{refillRate:(r=(s=n.exceptionRateLimiterRefillRate)!==null&&s!==void 0?s:n.__exceptionRateLimiterRefillRate)!==null&&r!==void 0?r:1,bucketSize:(i=(o=n.exceptionRateLimiterBucketSize)!==null&&o!==void 0?o:n.__exceptionRateLimiterBucketSize)!==null&&i!==void 0?i:10}})(this._instance.config.error_tracking)),{},{refillInterval:1e4,A:Ef})),this.Mr=this.bf(),this.startIfEnabledOrStop()}bf(){const t=this._instance.config.capture_exceptions;let e={capture_unhandled_errors:!1,capture_unhandled_rejections:!1,capture_console_errors:!1};return st(t)?e=$($({},e),t):(ce(t)?this.yf:t)&&(e=$($({},e),{},{capture_unhandled_errors:!0,capture_unhandled_rejections:!0})),e}get isEnabled(){return this.Mr.capture_console_errors||this.Mr.capture_unhandled_errors||this.Mr.capture_unhandled_rejections}startIfEnabledOrStop(){this.isEnabled?(Ef.info("enabled"),this.mf(),this.zo(this.hf)):this.mf()}zo(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 Ef.error("failed to load script",s);t()})}mf(){var t,e,n;(t=this.ff)===null||t===void 0||t.call(this),this.ff=void 0,(e=this.pf)===null||e===void 0||e.call(this),this.pf=void 0,(n=this.gf)===null||n===void 0||n.call(this),this.gf=void 0}onRemoteConfig(t){if(!t.ok)return;const e=t.config;"autocaptureExceptions"in e&&(this.yf=!!e.autocaptureExceptions||!1,this._instance.persistence&&this._instance.persistence.register({[k2]:this.yf}),this.Mr=this.bf(),this.startIfEnabledOrStop())}onConfigChange(){this.Mr=this.bf()}captureException(t){try{var e,n,r;const s=(e=t==null||(n=t.$exception_list)===null||n===void 0||(n=n[0])===null||n===void 0?void 0:n.type)!==null&&e!==void 0?e:"Exception";if(this.wt.consumeRateLimit(s))return void Ef.info("Skipping exception capture because of client rate limiting.",{exception:s});(r=this._instance.exceptions)===null||r===void 0||r.sendExceptionEvent(t)}catch{}}},exceptions:class{constructor(t){var e,n;this._f=[],this.wf=new i$([new w$,new T$,new b$,new x$,new P$,new C$,new k$,new A$],(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 _=O8.test(w)?w.replace(O8,"$1"):w;if(!_.match(/\S*Error: /)){for(const x of s){const S=x(_,r);if(S){l.push(S);const k=g$(l);if(k){for(let C=f.length-1;C>=0;C--){const A=f[C];if(k.start>=A.start+A.length)break;f.pop()}f.push(k)}break}}if(y$(l,f)>=50)break}}const h=[...f].sort((v,w)=>w.start-v.start),g=h[h.length-1];if(g){const v=G5(l,g);l.splice(g.start-v,v);for(const w of h)w.start-=v}for(const v of h)v$(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++)_$(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 $($({},_),{},{filename:_.filename||(x=w,x[x.length-1]||{}).filename,function:_.function||"?"});var x})})(l)}})("web:javascript",f$,m$)),this._instance=t,this._f=(e=(n=this._instance.persistence)===null||n===void 0?void 0:n.get_property("$error_tracking_suppression_rules"))!==null&&e!==void 0?e:[],this.kf=Fm(this.Sf()),this.xf=new M$(this.kf)}onConfigChange(){this.kf=Fm(this.Sf()),this.xf.setConfig(this.kf)}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._f=i,this._instance.persistence&&this._instance.persistence.register({[pA]:this._f,[E2]:o})}get $f(){var t;const e=!!this._instance.get_property(E2),n=this._instance.config.error_tracking.captureExtensionExceptions;return(t=n??e)!==null&&t!==void 0&&t}buildProperties(t,e){return this.wf.buildFromUnknown(t,{syntheticException:e==null?void 0:e.syntheticException,mechanism:{handled:e==null?void 0:e.handled}})}addExceptionStep(t,e){if(this.kf.enabled)try{if(!ct(t)||t.trim().length===0)return void di.warn("Ignoring exception step because message must be a non-empty string");const{sanitizedProperties:n,droppedKeys:r}=(function(s){if(!s)return{sanitizedProperties:{},droppedKeys:[]};const i=[];return{sanitizedProperties:Object.keys(s).reduce((o,l)=>R$.has(l)?(i.push(l),o):(o[l]=s[l],o),{}),droppedKeys:i}})(this.Cf(e));r.length>0&&di.warn("Ignoring reserved exception step fields",{droppedKeys:r}),this.xf.add($({[jm]:t,[$m]:new Date().toISOString()},n))}catch(n){di.error("Failed to add exception step. Ignoring breadcrumb.",n)}}sendExceptionEvent(t){try{const e=t.$exception_list;if(this.Tf(e)){if(this.If(e))return this.Mf("Exception dropped: matched a suppression rule"),void di.info("Skipping exception capture because a suppression rule matched");if(!this.$f&&this.Ef(e))return this.Mf("Exception dropped: thrown by a browser extension"),void di.info("Skipping exception capture because it was thrown by an extension");if(!this.$f&&this.Pf(e))return this.Mf("Exception dropped: thrown by an injected browser script"),void di.info("Skipping exception capture because it was thrown by an injected browser script");if(!this._instance.config.error_tracking.__capturePostHogExceptions&&this.Rf(e))return this.Mf("Exception dropped: thrown by the PostHog SDK"),void di.info("Skipping exception capture because it was thrown by the PostHog SDK")}const n=this.kf.enabled&&Je(t.$exception_steps)?this.Af(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",fc:!0});return s&&this.xf.clear(),s}catch(s){return Gk(s)||di.error("Failed to capture exception event. Dropping this exception.",s),void this.xf.clear()}}catch(e){return void(Gk(e)||di.error("Failed to process exception event. Ignoring this exception.",e))}}Af(t){try{const e=this.xf.getAttachable();return e.length===0?t:$($({},t),{},{$exception_steps:e})}catch(e){return di.error("Failed to read buffered exception steps. Capturing exception without steps.",e),t}}Mf(t){this.kf.enabled&&this.xf.add({[jm]:t,[$m]:new Date().toISOString()})}Cf(t){return st(t)?$({},t):{}}Sf(){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:{}}If(t){if(t.length===0)return!1;try{const e=t.reduce((n,{type:r,value:s})=>(ct(r)&&r.length>0&&n.$exception_types.push(r),ct(s)&&s.length>0&&n.$exception_values.push(s),n),{$exception_types:[],$exception_values:[]});return this._f.some(n=>{const r=n.values.map(s=>{const i=PT[s.operator],o=e[s.key];if(!i||!o)return!1;const l=Ue(s.value)?s.value:[s.value];return l.length>0&&i(l,o)});return n.type==="OR"?r.some(Boolean):r.every(Boolean)})}catch(e){return di.warn("Failed to evaluate suppression rules. Capturing the exception.",e),!1}}Ef(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&&pH.some(s=>r.startsWith(s)));return n.length!==0&&(!n.every(({filename:r})=>!!r&&r.startsWith(V2))||t.some(({type:r,value:s})=>r==="NoResponse"||ct(s)&&hH.some(({value:i,exact:o})=>o?s===i:s.includes(i)))&&!e.some(({in_app:r,filename:s})=>r&&!(s!=null&&s.startsWith(V2))))}Pf(t){return t.some(({value:e})=>ct(e)&&mH.some(n=>e.includes(n)))}Rf(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}Tf(t){return!Je(t)&&Ue(t)}}},PH=$({productTours:class{get Il(){return this._instance.persistence}constructor(t){this.Ff=null,this.Of=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({[Fx]:!!e.productTours}),!By(this._instance))return!this.Ff&&Je((n=this.Il)===null||n===void 0?void 0:n.props.ph_product_tours)||T0.info("product tours disabled; stopping and clearing cached tours"),(r=this.Ff)===null||r===void 0||r.stop(),this.Ff=null,void this.clearCache();this.loadIfEnabled()}}loadIfEnabled(){!this.Ff&&By(this._instance)&&this.zo(()=>this.Df())}zo(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?T0.error("Could not load product tours script",s):t()})}Df(){var t;!this.Ff&&(!((t=$e.__PosthogExtensions__)===null||t===void 0)&&t.generateProductTours)&&(this.Ff=$e.__PosthogExtensions__.generateProductTours(this._instance,!0))}getProductTours(t,e=!1){if(Ue(this.Of)&&!e)return void t(this.Of,{isLoaded:!0});const n=this.Il;if(n){const r=n.props[P2];if(Ue(r)&&!e)return this.Of=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(!By(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||T0.warn(o):T0.error(o),void t([],{isLoaded:!1,error:o})}const i=Ue(r.json.product_tours)?r.json.product_tours:[];this.Of=i,n&&n.register({[P2]:i}),t(i,{isLoaded:!0})}})}getActiveProductTours(t){Je(this.Ff)?t([],{isLoaded:!1,error:"Product tours not loaded"}):this.Ff.getActiveProductTours(t)}showProductTour(t){var e;(e=this.Ff)===null||e===void 0||e.showTourById(t)}previewTour(t){this.Ff?this.Ff.previewTour(t):this.zo(()=>{var e;this.Df(),(e=this.Ff)===null||e===void 0||e.previewTour(t)})}dismissProductTour(){var t;(t=this.Ff)===null||t===void 0||t.dismissTour("user_clicked_skip")}nextStep(){var t;(t=this.Ff)===null||t===void 0||t.nextStep()}previousStep(){var t;(t=this.Ff)===null||t===void 0||t.previousStep()}clearCache(){var t;this.Of=null,(t=this.Il)===null||t===void 0||t.unregister("ph_product_tours")}resetTour(t){var e;(e=this.Ff)===null||e===void 0||e.resetTour(t)}resetAllTours(){var t;(t=this.Ff)===null||t===void 0||t.resetAllTours()}cancelPendingTour(t){var e;(e=this.Ff)===null||e===void 0||e.cancelPendingTour(t)}}},Bg),AH={siteApps:class{constructor(t){this._instance=t,this.Lf=0,this.Nf=[],this.apps={}}get isEnabled(){return!!this._instance.config.opt_in_site_apps}qf(t,e){if(!e)return;const n=this.globalsForEvent(e);this.Nf.push(n),this.Nf.length>1e3&&(this.Nf=this.Nf.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.qf.bind(this));this.jf=()=>{t(),this.Nf=[],this.jf=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:h,$set:g}=t;return{event:$($({},Q5(t,nH)),{},{properties:$($($({},t.properties),g?{$set:$($({},(e=(n=t.properties)===null||n===void 0?void 0:n.$set)!==null&&e!==void 0?e:{}),g)}:{}),h?{$set_once:$($({},(r=(s=t.properties)===null||s===void 0?void 0:s.$set_once)!==null&&r!==void 0?r:{}),h)}:{}),elements_chain:(i=(o=t.properties)===null||o===void 0?void 0:o.$elements_chain)!==null&&i!==void 0?i:"",distinct_id:(l=t.properties)===null||l===void 0?void 0:l.distinct_id}),person:{properties:this._instance.get_property("$stored_person_properties")},groups:u}}Bf(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)||(Mi.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)||(Mi.error("prepare_external_dependency_script returned null"),null):t}zf(){var t,e,n,r,s,i,o,l;if(!this._instance.config.prepare_external_dependency_stylesheet&&!this._instance.config.prepare_external_dependency_script)return()=>{};const u=he==null?void 0:he.defaultView,d=u==null||(t=u.Node)===null||t===void 0?void 0:t.prototype;if(!u||!d)return()=>{};if(this.Lf++,this.Hf)return this.Uf();const f=[],h=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=h.Bf(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.Hf=()=>{f.forEach(x=>x()),this.Hf=void 0},this.Uf()}Uf(){let t=!1;return()=>{var e;t||(t=!0,this.Lf--,this.Lf===0&&((e=this.Hf)===null||e===void 0||e.call(this)))}}Wf(t,e=!0){const n=this.zf();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.Nf.length&&(Mi.info(`Processing ${this.Nf.length} events for site app with id ${t.id}`),this.Nf.forEach(o=>this.Wf(()=>{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.jf)===null||i===void 0||i.call(this))};let r=!1;const s=i=>{e.errored=!i,e.loaded=!0,Mi.info(`Site app with id ${t.id} ${i?"loaded":"errored"}`),r&&n()};try{const{processEvent:i}=this.Wf(o=>t.init({posthog:this._instance,callback(l){o(),s(l)}}),!1);i&&(e.processEvent=i),r=!0}catch(i){Mi.error($k+t.id,i),s(!1)}if(r&&e.loaded)try{n()}catch(i){Mi.error(`Error while processing buffered events PostHog app with config id ${t.id}`,i),e.errored=!0}}Vf(){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)}Gf(t){if(Object.keys(this.apps).length===0)return;const e=this.globalsForEvent(t);for(const n of Object.values(this.apps))try{this.Wf(()=>{var r;return(r=n.processEvent)===null||r===void 0?void 0:r.call(n,e)})}catch(r){Mi.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.Vf(),void this._instance.on("eventCaptured",l=>this.Gf(l))):void Mi.error('PostHog site apps are disabled. Enable the "opt_in_site_apps" config to proceed.');if((n=this.jf)===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 Mi.error($k+l,d)})}else Mi.error('PostHog site apps are disabled. Enable the "opt_in_site_apps" config to proceed.')}}},TH={tracingHeaders:class{constructor(t){this._instance=t,this.Qf=void 0,this.Zf=void 0,this.Jf=void 0,this.hf=()=>{const e=this.Kf();var n,r;e?(ce(this.Qf)&&(this.Qf=(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.Zf)&&(this.Zf=(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.mf()}}initialize(){this.startIfEnabledOrStop()}zo(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 XV.error("failed to load script",s);t()})}Xf(){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}Kf(){const t=this.Xf();return Ue(t)?(Ue(this.Jf)?this.Jf.splice(0,this.Jf.length,...t):this.Jf=[...t],t.length>0?this.Jf:void 0):(Ue(this.Jf)&&this.Jf.splice(0),this.Jf=t||void 0,this.Jf)}mf(){var t,e;(t=this.Qf)===null||t===void 0||t.call(this),(e=this.Zf)===null||e===void 0||e.call(this),this.Qf=void 0,this.Zf=void 0}startIfEnabledOrStop(){this.Kf()?this.zo(this.hf):this.mf()}}},RH=$({surveys:class extends rH{constructor(t){var e;super(new lH(t),(e=t,{get projectToken(){return e.config.token},kv:new aH(e)})),this._instance=t}Gc(t,e){const n=e.query?ep(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})})}}},Bg),MH={toolbar:class{constructor(t){this.instance=t}Yf(t){$e.ph_toolbar_state=t}tp(){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(T2(this.instance.config)||!ee||!he)return!1;t=(r=t)!==null&&r!==void 0?r:ee.location,n=(s=n)!==null&&s!==void 0?s:ee.history;try{if(!e){try{ee.localStorage.setItem("test","test"),ee.localStorage.removeItem("test")}catch{return!1}e=ee==null?void 0:ee.localStorage}const i=cH||Wm(t.hash,"__posthog")||Wm(t.hash,"state");let o;const l=i?T8(()=>JSON.parse(atob(decodeURIComponent(i))))||T8(()=>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(Vk)||"{}"),o.source="localstorage",delete o.userIntent),!(!o.token||this.instance.config.token!==o.token||(this.loadToolbar(o),0))}catch{return!1}}ep(t){const e=$e.ph_load_toolbar||$e.ph_load_editor;!Je(e)&&Ln(e)?e(t,this.instance):Hk.warn("No toolbar load function found")}loadToolbar(t){const e=!!(he!=null&&he.getElementById("__POSTHOG_TOOLBAR__"));if(!ee||e)return!1;const n=this.instance.requestRouter.region==="custom"&&this.instance.config.advanced_disable_toolbar_metrics,r=$($({token:this.instance.config.token},t),{},{apiURL:this.instance.requestRouter.endpointFor("ui")},n?{instrument:!1}:{});if(ee.localStorage.setItem(Vk,JSON.stringify($($({},r),{},{source:void 0}))),this.tp()===2)this.ep(r);else if(this.tp()===0){var s,i;this.Yf(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 Hk.error("[Toolbar] Failed to load",o),void this.Yf(0);this.Yf(2),this.ep(r)}),kt(ee,"turbolinks:load",()=>{this.Yf(0),this.loadToolbar(r)})}return!0}np(t){return this.loadToolbar(t)}maybeLoadEditor(t=void 0,e=void 0,n=void 0){return this.maybeLoadToolbar(t,e,n)}}},IH=$({experiments:class Ir{get Mr(){return this._instance.config}constructor(e){this._instance=e,this.getWebExperimentsAndEvaluateDisplayLogic=(n=!1)=>{this.getWebExperiments(r=>{Ir.sp("retrieved web experiments from the server"),this.rp=new Map,r.forEach(s=>{if(s.feature_flag_key){var i;this.rp&&(Ir.sp("setting flag key ",s.feature_flag_key," to web experiment ",s),(i=this.rp)===null||i===void 0||i.set(s.feature_flag_key,s));const o=this._instance.getFeatureFlag(s.feature_flag_key);ct(o)&&s.variants[o]&&this.op(s.name,o,s.variants[o].transforms)}else if(s.variants)for(const o in s.variants){const l=s.variants[o];Ir.ap(l,this._instance)&&this.op(s.name,o,l.transforms)}})},n)},this._instance.onFeatureFlags(n=>{this.onFeatureFlags(n)})}initialize(){}onFeatureFlags(e){if(this._is_bot())Ir.sp(Kk);else if(!this.Mr.disable_web_experiments){if(Je(this.rp))return this.rp=new Map,this.loadIfEnabled(),void this.previewWebExperiment();Ir.sp("applying feature flags",e),e.forEach(n=>{var r;if(this.rp&&(!((r=this.rp)===null||r===void 0)&&r.has(n))){var s;const i=this._instance.getFeatureFlag(n),o=(s=this.rp)===null||s===void 0?void 0:s.get(n);i&&(o!=null&&o.variants[i])&&this.op(o.name,i,o.variants[i].transforms)}})}}previewWebExperiment(){const e=Ir.getWindowLocation();if(e!=null&&e.search){const n=id(e==null?void 0:e.search,"__experiment_id"),r=id(e==null?void 0:e.search,"__experiment_variant");n&&r&&(Ir.sp(`previewing web experiments ${n} && ${r}`),this.getWebExperiments(s=>{this.lp(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||[])})}lp(e,n,r){const s=r.filter(i=>i.id===e);s&&s.length>0&&(Ir.sp(`Previewing web experiment [${s[0].name}] with variant [${n}]`),this.op(s[0].name,n,s[0].variants[n].transforms))}static ap(e,n){return!Je(e.conditions)&&Ir.up(e,n)&&Ir.cp(e)}static up(e,n){var r;if(Je(e.conditions)||Je((r=e.conditions)===null||r===void 0?void 0:r.url))return!0;const s=Ir.getWindowLocation();if(s){var i,o,l;const u=FA(n,s.href);return!(!((i=e.conditions)===null||i===void 0)&&i.url)||gH[(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 ee==null?void 0:ee.location}static cp(e){var n;if(Je(e.conditions)||Je((n=e.conditions)===null||n===void 0?void 0:n.utm))return!0;const r=JA();if(r.utm_source){var s,i,o,l,u,d,f,h;const g=!(!((s=e.conditions)===null||s===void 0||(s=s.utm)===null||s===void 0)&&s.utm_campaign)||((i=e.conditions)===null||i===void 0||(i=i.utm)===null||i===void 0?void 0:i.utm_campaign)==r.utm_campaign,v=!(!((o=e.conditions)===null||o===void 0||(o=o.utm)===null||o===void 0)&&o.utm_source)||((l=e.conditions)===null||l===void 0||(l=l.utm)===null||l===void 0?void 0:l.utm_source)==r.utm_source,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)||((h=e.conditions)===null||h===void 0||(h=h.utm)===null||h===void 0?void 0:h.utm_term)==r.utm_term;return g&&w&&_&&v}return!1}static sp(e,...n){ye.info(`[WebExperiments] ${e}`,n)}op(e,n,r){this._is_bot()?Ir.sp(Kk):n!=="control"?r.forEach(s=>{if(s.selector){var i;Ir.sp(`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)})}}):Ir.sp("Control variants leave the page unmodified.")}_is_bot(){return Qn&&this._instance?kT(Qn,this.Mr.custom_blocked_useragents):void 0}}},Bg),OH={conversations:class{constructor(t){this._instance=t,this.hp=void 0,this._conversationsManager=null,this.dp=!1,this.ne=null,this.vp=!1}initialize(){this.loadIfEnabled()}onRemoteConfig(t){if(this._instance.config.disable_conversations||(this.fp=t.ok,!t.ok))return;const e=t.config.conversations;Je(e)||(jr(e)?this.hp=e:(this.hp=e.enabled,this.ne=e),this.loadIfEnabled())}reset(){var t;(t=this._conversationsManager)===null||t===void 0||t.reset(),this._conversationsManager=null,this.hp=void 0,this.ne=null,this.fp=void 0,this.vp=!1}loadIfEnabled(){if(this._conversationsManager||this.dp||this._instance.config.disable_conversations||T2(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.hp)&&this.hp)if(this.ne&&this.ne.token){this.dp=!0;try{const e=t.initConversations;if(e)return this.pp(e),void(this.dp=!1);const n=t.loadExternalDependency;if(!n)return void this.gp(Ux);n(this._instance,"conversations",r=>{r||!t.initConversations?this.gp("Could not load conversations script",r):this.pp(t.initConversations),this.dp=!1})}catch(e){this.gp("Error initializing conversations",e),this.dp=!1}}else Us.error("Conversations enabled but missing token in remote config.")}pp(t){if(this.ne)try{this._conversationsManager=t(this.ne,this._instance),this.vp=!1,Us.info("Conversations loaded successfully")}catch(e){this.gp("Error completing conversations initialization",e)}else Us.error("Cannot complete initialization: remote config is null")}gp(t,e){Us.error(t,e),this._conversationsManager=null,this.dp=!1,this.vp=!0}show(){this._conversationsManager?this._conversationsManager.show():Us.warn("Conversations not loaded yet.")}hide(){this._conversationsManager&&this._conversationsManager.hide()}isAvailable(){return this.hp===!0&&!cn(this._conversationsManager)}getUnavailableReason(){return this.isAvailable()?null:this._instance.config.disable_conversations?"disabled_by_config":T2(this._instance.config)?"disabled_for_toolbar":this._instance.config.cookieless_mode&&this._instance.consent.isOptedOut()?"consent_opted_out":this.fp===!1?"remote_config_failed":ce(this.hp)?this.fp?"disabled_in_project":"remote_config_pending":this.hp?Je(this.ne)||!this.ne.token?"missing_token":$e!=null&&$e.__PosthogExtensions__?this.dp?"initializing":this.vp?"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 Kt(function*(){return r._conversationsManager?r._conversationsManager.sendMessage(t,e,n):(Us.warn(Il),null)})()}getMessages(t,e){var n=this;return Kt(function*(){return n._conversationsManager?n._conversationsManager.getMessages(t,e):(Us.warn(Il),null)})()}markAsRead(t){var e=this;return Kt(function*(){return e._conversationsManager?e._conversationsManager.markAsRead(t):(Us.warn(Il),null)})()}getTickets(t){var e=this;return Kt(function*(){return e._conversationsManager?e._conversationsManager.getTickets(t):(Us.warn(Il),null)})()}requestRestoreLink(t){var e=this;return Kt(function*(){return e._conversationsManager?e._conversationsManager.requestRestoreLink(t):(Us.warn(Il),null)})()}restoreFromToken(t){var e=this;return Kt(function*(){return e._conversationsManager?e._conversationsManager.restoreFromToken(t):(Us.warn(Il),null)})()}restoreFromUrlToken(){var t=this;return Kt(function*(){return t._conversationsManager?t._conversationsManager.restoreFromUrlToken():(Us.warn(Il),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}xc(){var t;(t=this._conversationsManager)===null||t===void 0||t.setIdentity()}$c(){var t;(t=this._conversationsManager)===null||t===void 0||t.clearIdentity()}}},LH={logs:class{constructor(t){var e;this._instance=t,this.name="logs",this.mp=!1,this.yp=!1,this.bp=!1,this.A=dn("[logs]"),this._p=$($({},this.A),{},{error:(...n)=>{n.some(Qk)||this.A.error(...n)}}),this.ol=[],this.wp=[],this.kd=0,this.To=!1,this.kp=[],this.Sp=[],this.xp=!1,this.$p=!1,this.Cp=()=>{var n,r;this.To||(this.kd=0,(n=this.Tp)===null||n===void 0||n.onReconnect(),(r=this.Ip)===null||r===void 0||r.onReconnect())},this._instance&&(!((e=this._instance.config.logs)===null||e===void 0)&&e.captureConsoleLogs)&&(this.mp=!0),ee&&kt(ee,"online",this.Cp)}Mp(t,e,n,r){var s;const i=Yk((s=this._instance)===null||s===void 0||(s=s.config)===null||s===void 0?void 0:s.logs,n);return[new hF(this.Ep(t,e),i,this._p,()=>this.Pp(),o=>o(),void 0,r),i]}Rp(){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.Tp&&this.Ap===e||((n=this.Tp)===null||n===void 0||n.reset(),this.Ap=e,[this.Tp,this.Fp]=this.Mp(()=>this.ol,r=>{this.ol=r})),this.Tp}Op(){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.Ip&&this.Dp===e||((n=this.Ip)===null||n===void 0||n.reset(),this.Dp=e,[this.Ip,this.Lp]=this.Mp(()=>this.wp,r=>{this.wp=r},{serviceNameDefault:"posthog-browser-logs",consoleCapture:!0},Xk)),this.Ip}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.mp=!0),(this.mp||this.Np()&&this.qp())&&this.jp();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.Bp(),(t=this.Eo)===null||t===void 0||t.dispose(),this.Eo=void 0,this.bo=void 0,this.bp=!1,ee==null||ee.removeEventListener("online",this.Cp),(e=this.zp)===null||e===void 0||e.call(this),this.zp=void 0,(n=this.Tp)===null||n===void 0||n.reset(),(r=this.Ip)===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;Je(r)?this.Hp():((n=this._instance)===null||n===void 0||(n=n.persistence)===null||n===void 0||n.register({$logs_capture_enabled_server_side:!!r}),r?(this.mp=!0,this.yp||this.jp(),this.loadIfEnabled()):this.Hp())}reset(){var t,e,n,r;this.Bp(),(t=this.Tp)===null||t===void 0||t.clearQueue(),this.ol=[],(e=this.Tp)===null||e===void 0||e.reset(),(n=this.Ip)===null||n===void 0||n.clearQueue(),this.wp=[],(r=this.Ip)===null||r===void 0||r.reset(),this.kd=0}captureLog(t){this.To||this.Rp().captureLog(t)}captureConsoleLog(t){this.To||this.Op().captureLog(t)}captureBufferedConsoleLog(t,e,n){this.To||this.Op().captureLog(t,{context:e,occurredAtMs:n})}qp(){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[mA])}Np(){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)}Tc(){var t;this.Bp(),(t=this.Ip)===null||t===void 0||t.clearQueue(),this.wp=[]}Hp(){this.mp||this.Bp()}jp(){var t;if(this.xp||!($e!=null&&$e.console))return;const e=Yk((t=this._instance)===null||t===void 0||(t=t.config)===null||t===void 0?void 0:t.logs).maxBufferSize;let n=!0;this.Sp.push(()=>{n=!1});for(const r of vH){let s;try{s=yH($e.console[r])}catch{continue}s&&this.Sp.push(ld($e.console,r,i=>{const o=(...l)=>{try{n&&this.Up(r,l,e)}catch{}return i.apply($e.console,l)};return o.__rrweb_original__=s,o}))}this.xp=!0,this.Wp=setTimeout(()=>{this.Bp()},3e4)}Up(t,e,n){var r;if(this.xp&&!this.$p&&e.length!==0)if(!((r=this._instance)===null||r===void 0)&&r.is_capturing()){if(n>this.kp.length){this.$p=!0;try{this.kp.push({level:t,args:e,occurredAtMs:Date.now(),context:this.Pp()})}finally{this.$p=!1}}}else this.Bp()}Bp(){if(this.kp=[],this.xp){this.xp=!1,this.Wp&&(clearTimeout(this.Wp),this.Wp=void 0);for(const t of this.Sp)t();this.Sp=[]}}Vp(){const t=this.kp;return this.Bp(),t}get logger(){return this.Gp||(this.Gp={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.Gp}flushLogs(t){t?this.Qp(t):(this.Tp&&this.Tp.flush().catch(e=>this.Zp(e)),this.Ip&&this.Ip.flush().catch(e=>this.Zp(e)))}Zp(t){Qk(t)||this.A.error("PostHog logs flush failed:",t)}loadIfEnabled(){if(this.To||!this.mp||this.yp||this.bp)return;const t=$e==null?void 0:$e.__PosthogExtensions__;if(!t)return this.A.error("PostHog Extensions not found."),void this.Bp();const e=t.loadExternalDependency;if(!e)return this.A.error(Ux),void this.Bp();this.bp=!0;try{e(this._instance,"logs",n=>{if(this.bp=!1,this.To||!this.mp)return;const r=t.logs;if(n||!(r!=null&&r.initializeLogs))this.A.error("Could not load logs script",n),this.Bp();else{var s;const l=this.Vp();var i,o;this.zp=r.initializeLogs((s=this.bo)!==null&&s!==void 0?s:this._instance),this.yp=!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.bp=!1,n}}Ep(t,e){const n=this._instance;return{get isDisabled(){return!1},get optedOut(){return!n.is_capturing()},getPersistedProperty:r=>r===ji.LogsQueue?t():void 0,setPersistedProperty(r,s){var i;r===ji.LogsQueue&&e((i=s)!==null&&i!==void 0?i:[])},js:r=>this.js(r),getLibraryId:()=>Un.LIB_NAME,getLibraryVersion:()=>Un.LIB_VERSION}}js(t){return new Promise(e=>{if(XA(this.kd,3))return void e({kind:"fatal",error:Wy(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:Wy(void 0,"logs request timed out")})},9e4);this._instance._send_request({method:"POST",url:this.Jp(),data:t,compression:"best-available",batchKey:"logs",fireCallbackOnDrop:!0,callback:i=>{const o=i.statusCode;if(this.Kp(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:Wy(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}`)})}}})})}Kp(t){(t!==0||this._instance.__loaded)&&(this.kd=QA(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.")))}Qp(t){this.ol.length>0&&this.Xp(t,this.ol,this.Fp,Un.LIB_NAME,e=>{this.ol=e}),this.wp.length>0&&this.Xp(t,this.wp,this.Lp,Xk,e=>{this.wp=e})}Xp(t,e,n,r,s){if(e.length===0)return;const i=e.map(l=>l.record);s([]);const o=lA(i,aA(n,Un.LIB_NAME,Un.LIB_VERSION),r,Un.LIB_VERSION);this._instance._send_request({method:"POST",url:this.Jp(),data:o,compression:"best-available",batchKey:"logs",transport:t})}Jp(){return this._instance.requestRouter.endpointFor("api","/i/v1/logs")+"?token="+encodeURIComponent(this._instance.config.token)}Pp(){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,Je(s)||(e.sessionStartTimestamp=s),Je(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?Ga($e.location.href):$e.location.href),this._instance.featureFlags){const n=this._instance.featureFlags.getFlags();n&&n.length>0&&(e.activeFeatureFlags=n)}return e}}},NH={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.Yp?this.Yp=(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=xH(n,s),o=bH(n,s);return()=>{r=!1,i(),o()}})(this._instance):!e&&this.Yp&&(this.Yp(),this.Yp=void 0)}Rp(){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.Tp&&this.Ap===e||((n=this.Tp)===null||n===void 0||n.reset(),this.Ap=e,this.Tp=new pF(this.Ep(),(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.Tp}count(t,e=1,n){this.Rp().count(t,e,n)}gauge(t,e,n){this.Rp().gauge(t,e,n)}histogram(t,e,n){this.Rp().histogram(t,e,n)}flush(t){if(!this.Tp)return Promise.resolve();if(t){const e=this.Tp.drainWindow();return e&&this.Ys(e,t),Promise.resolve()}return this.Tp.flush().catch(e=>this.A.error("PostHog metrics flush failed:",e))}reset(){var t;(t=this.Tp)===null||t===void 0||t.reset()}dispose(){var t,e;this.To=!0,(t=this.Yp)===null||t===void 0||t.call(this),this.Yp=void 0,(e=this.Tp)===null||e===void 0||e.reset()}Ep(){const t=this._instance,e=this;return{get isDisabled(){return!1},get optedOut(){return!t.is_capturing()},Ys:n=>e.Ys(n),getLibraryId:()=>Un.LIB_NAME,getLibraryVersion:()=>Un.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($($({method:"POST",url:this.tg(),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}`)})}}}))})}tg(){return this._instance.requestRouter.endpointFor("api","/i/v1/metrics")+"?token="+encodeURIComponent(this._instance.config.token)}}},DH={webMCP:class{constructor(t){this._instance=t,this.eg=!1}initialize(){this.startIfEnabled()}startIfEnabled(){if(!this._instance.config.capture_webmcp||this.eg)return;const t=he==null?void 0:he.modelContext;if(!t||!Ln(t.registerTool))return;const e=Jk.get(t);if(e)return e.instances.add(this._instance),void(this.eg=!0);const n={instances:new Set([this._instance])},r=t.registerTool,s=this;ld(t,"registerTool",i=>{const o=i;return function(l,...u){let d=l;try{d=s.ig(l,n)}catch{return o.call(this,l,...u)}return o.call(this,d,...u)}}),t.registerTool!==r&&(Jk.set(t,n),this.eg=!0)}ig(t,e){if(!t||!Ln(t.execute))return t;const n=t.execute,r=this,{tool:s,injected:i}=(function(o,l){const u={intent:!1,model:!1},d=o.inputSchema;if(d&&(Sa(d,"$ref")||Sa(d,"oneOf")||Sa(d,"anyOf")||Sa(d,"allOf")||d.additionalProperties===!0||st(d.additionalProperties)||d.type&&d.type!=="object"||d.properties&&!st(d.properties)||d.required&&!Ue(d.required))||!ce(d)&&!st(d))return{tool:qy(o),injected:u};const f=(d==null?void 0:d.properties)||{};if(u.intent=l.intent&&!Sa(f,"context"),u.model=l.model&&!Sa(f,"llm_model"),!u.intent&&!u.model)return{tool:qy(o),injected:u};const h=$({},f),g=Ue(d==null?void 0:d.required)?[...d.required]:[];return u.intent&&(h.context={type:"string",description:`Explain why this tool is called and how it supports the user's goal. Describe the abstract purpose only. Do not include personal or identifying information. Generalize specific entities as roles such as "a customer".`},g.includes("context")||g.push("context")),u.model&&(h.llm_model={type:"string",description:'The exact model identifier you are running as, taken from your system prompt or environment. Pass "unknown" if you do not know it. Never guess.'},g.includes("llm_model")||g.push("llm_model")),{tool:qy(o,$($({},d),{},{type:(d==null?void 0:d.type)||"object",properties:h,required:g})),injected:u}})(t,(function(o){const l={intent:!1,model:!1};for(const u of o.instances){const d=eE(u.config.capture_webmcp);l.intent||(l.intent=(d==null?void 0:d.intent)===!0),l.model||(l.model=(d==null?void 0:d.model)===!0)}return l})(e));return Object.defineProperty(s,"execute",{configurable:!0,enumerable:!0,writable:!0,value(...o){const l=new Date,u=(function(g,v){if(!st(g))return{};try{const w=v.intent?tE(g.context,2048,!0):void 0,_=v.model?tE(g.llm_model,256):void 0;return $($({},w&&w!=="{}"?{intent:w}:{}),_&&_.toLowerCase()!=="unknown"?{model:_}:{})}catch{return{}}})(o[0],i),d=(function(g,v){const w=g[0];if(!st(w))return g;try{const _=v.intent&&Sa(w,"context"),x=v.model&&Sa(w,"llm_model");if(!_&&!x)return g;const S=$({},w);return _&&delete S.context,x&&delete S.llm_model,[S,...g.slice(1)]}catch{return g}})(o,i);let f;try{f=n.apply(this===s?t:this,d)}catch(g){throw r.ng(e,s,l,!0,u),g}return(h=f)&&typeof h.then=="function"?Promise.resolve(f).then(g=>(r.ng(e,s,l,nE(g),u),g),g=>{throw r.ng(e,s,l,!0,u),g}):(r.ng(e,s,l,nE(f),u),f);var h}}),s}ng(t,e,n,r,s){const i=Date.now()-n.getTime();for(const o of t.instances){const l=eE(o.config.capture_webmcp);if(l)try{o.capture("$mcp_tool_call",$($({$mcp_source:"posthog_mcp_analytics",$mcp_interface:"webmcp",$mcp_tool_name:e.name,$mcp_resource_name:e.name,$mcp_tool_description:e.description,$mcp_server_name:Wt==null?void 0:Wt.hostname,$mcp_duration_ms:i,$mcp_is_error:r},l.intent&&s.intent?{$mcp_intent:s.intent,$mcp_intent_source:"context_parameter"}:{}),l.model&&s.model?{$mcp_llm_model:s.model,$mcp_llm_model_source:"self_reported"}:{}),{timestamp:n})}catch{continue}}}}};Xf.__defaultExtensionClasses=$({},$($($($($($($($($($($($($($({},Bg),kH),EH),CH),PH),AH),RH),TH),MH),IH),OH),LH),NH),DH));const jH=(function(){Un.SDK_DIST_CHANNEL="npm";const t=Kf[Nf]=new Xf;return(function(){function e(){e.done||(e.done=!0,bT=!1,Tt(Kf,function(n){n._dom_loaded()}))}he!=null&&he.addEventListener?he.readyState==="complete"?e():kt(he,"DOMContentLoaded",e,{capture:!1}):ee&&ye.error("Browser doesn't support `document.addEventListener` so PostHog couldn't be initialized")})(),t})();var Ce=jH,$H=(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 FH=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})},R0,rE="__POSTHOG_REACT_SHARED_STATE__",sE=typeof globalThis<"u"?globalThis:typeof window<"u"?window:{},yh;try{yh=sE[rE]=sE[rE]||new WeakMap}catch{yh=new WeakMap}yh.has(m.createContext)||yh.set(m.createContext,{});var cc=yh.get(m.createContext),z2;function VH(t){(!cc.defaultPostHogInstance||cc.defaultPostHogInstance===z2)&&(cc.defaultPostHogInstance=t),z2=t}function U2(){return z2}cc.context||(cc.context=m.createContext({get client(){return U2()||cc.defaultPostHogInstance},bootstrap:void 0}));var eb=cc.context;function DT(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)||!DT(t[l],e[l],n))return!1}return!0}function HH(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=U2();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=U2(),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&&!DT(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(eb.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 Gy=function(t){return typeof t=="function"},zH=function(t){return t===void 0},Ei=function(){var t=m.useContext(eb).client;return t},cm=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]"},UH=function(t,e){try{Object.defineProperty(t,"name",{value:e,writable:!0,enumerable:!0,configurable:!0})}catch{}},BH=function(t,e){for(var n=new WeakSet,r=t;!n.has(r);){if(n.add(r),!cm(r.cause)){zH(r.cause)||(e.cause=r.cause),r.cause=e;return}r=r.cause}},ZH=function(t,e){if(!e)return t;var n=new Error(cm(t)?t.message:"Primitive value captured as exception: ".concat(String(t)));return UH(n,"React ErrorBoundary ".concat(cm(t)?t.name:"Error")),n.stack=e,cm(t)?(BH(t,n),t):n},iE={componentStack:null,exceptionEvent:null,error:null},WH={INVALID_FALLBACK:"[PostHog.js][PostHogErrorBoundary] Invalid fallback prop, provide a valid React element or a function that returns a valid React element."},qH=(R0=(function(t){$H(e,t);function e(n){var r=t.call(this,n)||this;return r._resetError=function(){r.setState(iE)},r.state=iE,r}return e.prototype.componentDidCatch=function(n,r){var s=this.props.additionalProperties,i;Gy(s)?i=s(n,r):typeof s=="object"&&(i=s);var o=this.context.client,l=r.componentStack,u=o.captureException(ZH(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 Gy(r)?r():r;var o=Gy(s)?we.createElement(s,{error:i.error,componentStack:i.componentStack,exceptionEvent:i.exceptionEvent,resetError:this._resetError}):s;return we.isValidElement(o)?o:(console.warn(WH.INVALID_FALLBACK),we.createElement(we.Fragment,null))},e})(we.Component),FH(R0,"PostHogErrorBoundary"),(function(){R0.contextType=eb})(),R0);VH(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 oE;(function(t){t.mergeShapes=(e,n)=>({...e,...n})})(oE||(oE={}));const je=It.arrayToEnum(["string","nan","number","integer","float","boolean","date","bigint","symbol","function","undefined","null","array","object","unknown","promise","void","never","map","set"]),Aa=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 B2=(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 GH=B2;function KH(){return GH}const YH=t=>{const{data:e,path:n,errorMaps:r,issueData:s}=t,i=[...n,...s.path||[]],o={...s,path:i};if(s.message!==void 0)return{...s,path:i,message:s.message};let l="";const u=r.filter(d=>!!d).slice().reverse();for(const d of u)l=d(o,{data:e,defaultError:l}).message;return{...s,path:i,message:l}};function Ae(t,e){const n=KH(),r=YH({issueData:e,data:t.data,path:t.path,errorMaps:[t.common.contextualErrorMap,t.schemaErrorMap,n,n===B2?void 0:B2].filter(s=>!!s)});t.common.issues.push(r)}class Vr{constructor(){this.value="valid"}dirty(){this.value==="valid"&&(this.value="dirty")}abort(){this.value!=="aborted"&&(this.value="aborted")}static mergeArray(e,n){const r=[];for(const s of n){if(s.status==="aborted")return it;s.status==="dirty"&&e.dirty(),r.push(s.value)}return{status:e.value,value:r}}static async mergeObjectAsync(e,n){const r=[];for(const s of n){const i=await s.key,o=await s.value;r.push({key:i,value:o})}return Vr.mergeObjectSync(e,r)}static mergeObjectSync(e,n){const r={};for(const s of n){const{key:i,value:o}=s;if(i.status==="aborted"||o.status==="aborted")return it;i.status==="dirty"&&e.dirty(),o.status==="dirty"&&e.dirty(),i.value!=="__proto__"&&(typeof o.value<"u"||s.alwaysSet)&&(r[i.value]=o.value)}return{status:e.value,value:r}}}const it=Object.freeze({status:"aborted"}),Df=t=>({status:"dirty",value:t}),Qs=t=>({status:"valid",value:t}),aE=t=>t.status==="aborted",lE=t=>t.status==="dirty",cd=t=>t.status==="valid",Qm=t=>typeof Promise<"u"&&t instanceof Promise;var Ze;(function(t){t.errToObj=e=>typeof e=="string"?{message:e}:e||{},t.toString=e=>typeof e=="string"?e:e==null?void 0:e.message})(Ze||(Ze={}));class Ji{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 cE=(t,e)=>{if(cd(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 Aa(e.data)}_getOrReturnCtx(e,n){return n||{common:e.parent.common,data:e.data,parsedType:Aa(e.data),schemaErrorMap:this._def.errorMap,path:e.path,parent:e.parent}}_processInputParams(e){return{status:new Vr,ctx:{common:e.parent.common,data:e.data,parsedType:Aa(e.data),schemaErrorMap:this._def.errorMap,path:e.path,parent:e.parent}}}_parseSync(e){const n=this._parse(e);if(Qm(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:Aa(e)},s=this._parseSync({data:e,path:r.path,parent:r});return cE(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:Aa(e)};if(!this["~standard"].async)try{const i=this._parseSync({data:e,path:[],parent:n});return cd(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=>cd(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:Aa(e)},s=this._parse({data:e,path:r.path,parent:r}),i=await(Qm(s)?s:Promise.resolve(s));return cE(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 _c({schema:this,typeName:at.ZodEffects,effect:{type:"refinement",refinement:e}})}superRefine(e){return this._refinement(e)}constructor(e){this.spa=this.safeParseAsync,this._def=e,this.parse=this.parse.bind(this),this.safeParse=this.safeParse.bind(this),this.parseAsync=this.parseAsync.bind(this),this.safeParseAsync=this.safeParseAsync.bind(this),this.spa=this.spa.bind(this),this.refine=this.refine.bind(this),this.refinement=this.refinement.bind(this),this.superRefine=this.superRefine.bind(this),this.optional=this.optional.bind(this),this.nullable=this.nullable.bind(this),this.nullish=this.nullish.bind(this),this.array=this.array.bind(this),this.promise=this.promise.bind(this),this.or=this.or.bind(this),this.and=this.and.bind(this),this.transform=this.transform.bind(this),this.brand=this.brand.bind(this),this.default=this.default.bind(this),this.catch=this.catch.bind(this),this.describe=this.describe.bind(this),this.pipe=this.pipe.bind(this),this.readonly=this.readonly.bind(this),this.isNullable=this.isNullable.bind(this),this.isOptional=this.isOptional.bind(this),this["~standard"]={version:1,vendor:"zod",validate:n=>this["~validate"](n)}}optional(){return Vo.create(this,this._def)}nullable(){return wc.create(this,this._def)}nullish(){return this.nullable().optional()}array(){return Ki.create(this)}promise(){return sg.create(this,this._def)}or(e){return eg.create([this,e],this._def)}and(e){return tg.create(this,e,this._def)}transform(e){return new _c({...ht(this._def),schema:this,typeName:at.ZodEffects,effect:{type:"transform",transform:e}})}default(e){const n=typeof e=="function"?e:()=>e;return new ig({...ht(this._def),innerType:this,defaultValue:n,typeName:at.ZodDefault})}brand(){return new VT({typeName:at.ZodBranded,type:this,...ht(this._def)})}catch(e){const n=typeof e=="function"?e:()=>e;return new og({...ht(this._def),innerType:this,catchValue:n,typeName:at.ZodCatch})}describe(e){const n=this.constructor;return new n({...this._def,description:e})}pipe(e){return nb.create(this,e)}readonly(){return ag.create(this)}isOptional(){return this.safeParse(void 0).success}isNullable(){return this.safeParse(null).success}}const XH=/^c[^\s-]{8,}$/i,QH=/^[0-9a-z]+$/,JH=/^[0-9A-HJKMNP-TV-Z]{26}$/i,ez=/^[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,tz=/^[a-z0-9_-]{21}$/i,nz=/^[A-Za-z0-9-_]+\.[A-Za-z0-9-_]+\.[A-Za-z0-9-_]*$/,rz=/^[-+]?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)?)??$/,sz=/^(?!\.)(?!.*\.\.)([A-Z0-9_'+\-\.]*)[A-Z0-9_+-]@([A-Z0-9][A-Z0-9\-]*\.)+[A-Z]{2,}$/i,iz="^(\\p{Extended_Pictographic}|\\p{Emoji_Component})+$";let Ky;const oz=/^(?:(?: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])$/,az=/^(?:(?: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])$/,lz=/^(([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]))$/,cz=/^(([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])$/,uz=/^([0-9a-zA-Z+/]{4})*(([0-9a-zA-Z+/]{2}==)|([0-9a-zA-Z+/]{3}=))?$/,dz=/^([0-9a-zA-Z-_]{4})*(([0-9a-zA-Z-_]{2}(==)?)|([0-9a-zA-Z-_]{3}(=)?))?$/,jT="((\\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])))",fz=new RegExp(`^${jT}$`);function $T(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 hz(t){return new RegExp(`^${$T(t)}$`)}function pz(t){let e=`${jT}T${$T(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 mz(t,e){return!!((e==="v4"||!e)&&oz.test(t)||(e==="v6"||!e)&&lz.test(t))}function gz(t,e){if(!nz.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 vz(t,e){return!!((e==="v4"||!e)&&az.test(t)||(e==="v6"||!e)&&cz.test(t))}class Fo extends xt{_parse(e){if(this._def.coerce&&(e.data=String(e.data)),this._getType(e)!==je.string){const i=this._getOrReturnCtx(e);return Ae(i,{code:xe.invalid_type,expected:je.string,received:i.parsedType}),it}const r=new Vr;let s;for(const i of this._def.checks)if(i.kind==="min")e.data.length<i.value&&(s=this._getOrReturnCtx(e,s),Ae(s,{code: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),Ae(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?Ae(s,{code:xe.too_big,maximum:i.value,type:"string",inclusive:!0,exact:!0,message:i.message}):l&&Ae(s,{code:xe.too_small,minimum:i.value,type:"string",inclusive:!0,exact:!0,message:i.message}),r.dirty())}else if(i.kind==="email")sz.test(e.data)||(s=this._getOrReturnCtx(e,s),Ae(s,{validation:"email",code:xe.invalid_string,message:i.message}),r.dirty());else if(i.kind==="emoji")Ky||(Ky=new RegExp(iz,"u")),Ky.test(e.data)||(s=this._getOrReturnCtx(e,s),Ae(s,{validation:"emoji",code:xe.invalid_string,message:i.message}),r.dirty());else if(i.kind==="uuid")ez.test(e.data)||(s=this._getOrReturnCtx(e,s),Ae(s,{validation:"uuid",code:xe.invalid_string,message:i.message}),r.dirty());else if(i.kind==="nanoid")tz.test(e.data)||(s=this._getOrReturnCtx(e,s),Ae(s,{validation:"nanoid",code:xe.invalid_string,message:i.message}),r.dirty());else if(i.kind==="cuid")XH.test(e.data)||(s=this._getOrReturnCtx(e,s),Ae(s,{validation:"cuid",code:xe.invalid_string,message:i.message}),r.dirty());else if(i.kind==="cuid2")QH.test(e.data)||(s=this._getOrReturnCtx(e,s),Ae(s,{validation:"cuid2",code:xe.invalid_string,message:i.message}),r.dirty());else if(i.kind==="ulid")JH.test(e.data)||(s=this._getOrReturnCtx(e,s),Ae(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),Ae(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),Ae(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),Ae(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),Ae(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),Ae(s,{code:xe.invalid_string,validation:{endsWith:i.value},message:i.message}),r.dirty()):i.kind==="datetime"?pz(i).test(e.data)||(s=this._getOrReturnCtx(e,s),Ae(s,{code:xe.invalid_string,validation:"datetime",message:i.message}),r.dirty()):i.kind==="date"?fz.test(e.data)||(s=this._getOrReturnCtx(e,s),Ae(s,{code:xe.invalid_string,validation:"date",message:i.message}),r.dirty()):i.kind==="time"?hz(i).test(e.data)||(s=this._getOrReturnCtx(e,s),Ae(s,{code:xe.invalid_string,validation:"time",message:i.message}),r.dirty()):i.kind==="duration"?rz.test(e.data)||(s=this._getOrReturnCtx(e,s),Ae(s,{validation:"duration",code:xe.invalid_string,message:i.message}),r.dirty()):i.kind==="ip"?mz(e.data,i.version)||(s=this._getOrReturnCtx(e,s),Ae(s,{validation:"ip",code:xe.invalid_string,message:i.message}),r.dirty()):i.kind==="jwt"?gz(e.data,i.alg)||(s=this._getOrReturnCtx(e,s),Ae(s,{validation:"jwt",code:xe.invalid_string,message:i.message}),r.dirty()):i.kind==="cidr"?vz(e.data,i.version)||(s=this._getOrReturnCtx(e,s),Ae(s,{validation:"cidr",code:xe.invalid_string,message:i.message}),r.dirty()):i.kind==="base64"?uz.test(e.data)||(s=this._getOrReturnCtx(e,s),Ae(s,{validation:"base64",code:xe.invalid_string,message:i.message}),r.dirty()):i.kind==="base64url"?dz.test(e.data)||(s=this._getOrReturnCtx(e,s),Ae(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,...Ze.errToObj(r)})}_addCheck(e){return new Fo({...this._def,checks:[...this._def.checks,e]})}email(e){return this._addCheck({kind:"email",...Ze.errToObj(e)})}url(e){return this._addCheck({kind:"url",...Ze.errToObj(e)})}emoji(e){return this._addCheck({kind:"emoji",...Ze.errToObj(e)})}uuid(e){return this._addCheck({kind:"uuid",...Ze.errToObj(e)})}nanoid(e){return this._addCheck({kind:"nanoid",...Ze.errToObj(e)})}cuid(e){return this._addCheck({kind:"cuid",...Ze.errToObj(e)})}cuid2(e){return this._addCheck({kind:"cuid2",...Ze.errToObj(e)})}ulid(e){return this._addCheck({kind:"ulid",...Ze.errToObj(e)})}base64(e){return this._addCheck({kind:"base64",...Ze.errToObj(e)})}base64url(e){return this._addCheck({kind:"base64url",...Ze.errToObj(e)})}jwt(e){return this._addCheck({kind:"jwt",...Ze.errToObj(e)})}ip(e){return this._addCheck({kind:"ip",...Ze.errToObj(e)})}cidr(e){return this._addCheck({kind:"cidr",...Ze.errToObj(e)})}datetime(e){return typeof e=="string"?this._addCheck({kind:"datetime",precision:null,offset:!1,local:!1,message:e}):this._addCheck({kind:"datetime",precision:typeof(e==null?void 0:e.precision)>"u"?null:e==null?void 0:e.precision,offset:(e==null?void 0:e.offset)??!1,local:(e==null?void 0:e.local)??!1,...Ze.errToObj(e==null?void 0:e.message)})}date(e){return this._addCheck({kind:"date",message:e})}time(e){return typeof e=="string"?this._addCheck({kind:"time",precision:null,message:e}):this._addCheck({kind:"time",precision:typeof(e==null?void 0:e.precision)>"u"?null:e==null?void 0:e.precision,...Ze.errToObj(e==null?void 0:e.message)})}duration(e){return this._addCheck({kind:"duration",...Ze.errToObj(e)})}regex(e,n){return this._addCheck({kind:"regex",regex:e,...Ze.errToObj(n)})}includes(e,n){return this._addCheck({kind:"includes",value:e,position:n==null?void 0:n.position,...Ze.errToObj(n==null?void 0:n.message)})}startsWith(e,n){return this._addCheck({kind:"startsWith",value:e,...Ze.errToObj(n)})}endsWith(e,n){return this._addCheck({kind:"endsWith",value:e,...Ze.errToObj(n)})}min(e,n){return this._addCheck({kind:"min",value:e,...Ze.errToObj(n)})}max(e,n){return this._addCheck({kind:"max",value:e,...Ze.errToObj(n)})}length(e,n){return this._addCheck({kind:"length",value:e,...Ze.errToObj(n)})}nonempty(e){return this.min(1,Ze.errToObj(e))}trim(){return new Fo({...this._def,checks:[...this._def.checks,{kind:"trim"}]})}toLowerCase(){return new Fo({...this._def,checks:[...this._def.checks,{kind:"toLowerCase"}]})}toUpperCase(){return new Fo({...this._def,checks:[...this._def.checks,{kind:"toUpperCase"}]})}get isDatetime(){return!!this._def.checks.find(e=>e.kind==="datetime")}get isDate(){return!!this._def.checks.find(e=>e.kind==="date")}get isTime(){return!!this._def.checks.find(e=>e.kind==="time")}get isDuration(){return!!this._def.checks.find(e=>e.kind==="duration")}get isEmail(){return!!this._def.checks.find(e=>e.kind==="email")}get isURL(){return!!this._def.checks.find(e=>e.kind==="url")}get isEmoji(){return!!this._def.checks.find(e=>e.kind==="emoji")}get isUUID(){return!!this._def.checks.find(e=>e.kind==="uuid")}get isNANOID(){return!!this._def.checks.find(e=>e.kind==="nanoid")}get isCUID(){return!!this._def.checks.find(e=>e.kind==="cuid")}get isCUID2(){return!!this._def.checks.find(e=>e.kind==="cuid2")}get isULID(){return!!this._def.checks.find(e=>e.kind==="ulid")}get isIP(){return!!this._def.checks.find(e=>e.kind==="ip")}get isCIDR(){return!!this._def.checks.find(e=>e.kind==="cidr")}get isBase64(){return!!this._def.checks.find(e=>e.kind==="base64")}get isBase64url(){return!!this._def.checks.find(e=>e.kind==="base64url")}get minLength(){let e=null;for(const n of this._def.checks)n.kind==="min"&&(e===null||n.value>e)&&(e=n.value);return e}get maxLength(){let e=null;for(const n of this._def.checks)n.kind==="max"&&(e===null||n.value<e)&&(e=n.value);return e}}Fo.create=t=>new Fo({checks:[],typeName:at.ZodString,coerce:(t==null?void 0:t.coerce)??!1,...ht(t)});function yz(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 ud 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 Ae(i,{code:xe.invalid_type,expected:je.number,received:i.parsedType}),it}let r;const s=new Vr;for(const i of this._def.checks)i.kind==="int"?It.isInteger(e.data)||(r=this._getOrReturnCtx(e,r),Ae(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),Ae(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),Ae(r,{code:xe.too_big,maximum:i.value,type:"number",inclusive:i.inclusive,exact:!1,message:i.message}),s.dirty()):i.kind==="multipleOf"?yz(e.data,i.value)!==0&&(r=this._getOrReturnCtx(e,r),Ae(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),Ae(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,Ze.toString(n))}gt(e,n){return this.setLimit("min",e,!1,Ze.toString(n))}lte(e,n){return this.setLimit("max",e,!0,Ze.toString(n))}lt(e,n){return this.setLimit("max",e,!1,Ze.toString(n))}setLimit(e,n,r,s){return new ud({...this._def,checks:[...this._def.checks,{kind:e,value:n,inclusive:r,message:Ze.toString(s)}]})}_addCheck(e){return new ud({...this._def,checks:[...this._def.checks,e]})}int(e){return this._addCheck({kind:"int",message:Ze.toString(e)})}positive(e){return this._addCheck({kind:"min",value:0,inclusive:!1,message:Ze.toString(e)})}negative(e){return this._addCheck({kind:"max",value:0,inclusive:!1,message:Ze.toString(e)})}nonpositive(e){return this._addCheck({kind:"max",value:0,inclusive:!0,message:Ze.toString(e)})}nonnegative(e){return this._addCheck({kind:"min",value:0,inclusive:!0,message:Ze.toString(e)})}multipleOf(e,n){return this._addCheck({kind:"multipleOf",value:e,message:Ze.toString(n)})}finite(e){return this._addCheck({kind:"finite",message:Ze.toString(e)})}safe(e){return this._addCheck({kind:"min",inclusive:!0,value:Number.MIN_SAFE_INTEGER,message:Ze.toString(e)})._addCheck({kind:"max",inclusive:!0,value:Number.MAX_SAFE_INTEGER,message:Ze.toString(e)})}get minValue(){let e=null;for(const n of this._def.checks)n.kind==="min"&&(e===null||n.value>e)&&(e=n.value);return e}get maxValue(){let e=null;for(const n of this._def.checks)n.kind==="max"&&(e===null||n.value<e)&&(e=n.value);return e}get isInt(){return!!this._def.checks.find(e=>e.kind==="int"||e.kind==="multipleOf"&&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)}}ud.create=t=>new ud({checks:[],typeName:at.ZodNumber,coerce:(t==null?void 0:t.coerce)||!1,...ht(t)});class _h 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 Vr;for(const i of this._def.checks)i.kind==="min"?(i.inclusive?e.data<i.value:e.data<=i.value)&&(r=this._getOrReturnCtx(e,r),Ae(r,{code: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),Ae(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),Ae(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 Ae(n,{code:xe.invalid_type,expected:je.bigint,received:n.parsedType}),it}gte(e,n){return this.setLimit("min",e,!0,Ze.toString(n))}gt(e,n){return this.setLimit("min",e,!1,Ze.toString(n))}lte(e,n){return this.setLimit("max",e,!0,Ze.toString(n))}lt(e,n){return this.setLimit("max",e,!1,Ze.toString(n))}setLimit(e,n,r,s){return new _h({...this._def,checks:[...this._def.checks,{kind:e,value:n,inclusive:r,message:Ze.toString(s)}]})}_addCheck(e){return new _h({...this._def,checks:[...this._def.checks,e]})}positive(e){return this._addCheck({kind:"min",value:BigInt(0),inclusive:!1,message:Ze.toString(e)})}negative(e){return this._addCheck({kind:"max",value:BigInt(0),inclusive:!1,message:Ze.toString(e)})}nonpositive(e){return this._addCheck({kind:"max",value:BigInt(0),inclusive:!0,message:Ze.toString(e)})}nonnegative(e){return this._addCheck({kind:"min",value:BigInt(0),inclusive:!0,message:Ze.toString(e)})}multipleOf(e,n){return this._addCheck({kind:"multipleOf",value:e,message:Ze.toString(n)})}get minValue(){let e=null;for(const n of this._def.checks)n.kind==="min"&&(e===null||n.value>e)&&(e=n.value);return e}get maxValue(){let e=null;for(const n of this._def.checks)n.kind==="max"&&(e===null||n.value<e)&&(e=n.value);return e}}_h.create=t=>new _h({checks:[],typeName:at.ZodBigInt,coerce:(t==null?void 0:t.coerce)??!1,...ht(t)});class Z2 extends xt{_parse(e){if(this._def.coerce&&(e.data=!!e.data),this._getType(e)!==je.boolean){const r=this._getOrReturnCtx(e);return Ae(r,{code:xe.invalid_type,expected:je.boolean,received:r.parsedType}),it}return Qs(e.data)}}Z2.create=t=>new Z2({typeName:at.ZodBoolean,coerce:(t==null?void 0:t.coerce)||!1,...ht(t)});class Jm 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 Ae(i,{code:xe.invalid_type,expected:je.date,received:i.parsedType}),it}if(Number.isNaN(e.data.getTime())){const i=this._getOrReturnCtx(e);return Ae(i,{code:xe.invalid_date}),it}const r=new Vr;let s;for(const i of this._def.checks)i.kind==="min"?e.data.getTime()<i.value&&(s=this._getOrReturnCtx(e,s),Ae(s,{code: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),Ae(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 Jm({...this._def,checks:[...this._def.checks,e]})}min(e,n){return this._addCheck({kind:"min",value:e.getTime(),message:Ze.toString(n)})}max(e,n){return this._addCheck({kind:"max",value:e.getTime(),message:Ze.toString(n)})}get minDate(){let e=null;for(const n of this._def.checks)n.kind==="min"&&(e===null||n.value>e)&&(e=n.value);return e!=null?new Date(e):null}get maxDate(){let e=null;for(const n of this._def.checks)n.kind==="max"&&(e===null||n.value<e)&&(e=n.value);return e!=null?new Date(e):null}}Jm.create=t=>new Jm({checks:[],coerce:(t==null?void 0:t.coerce)||!1,typeName:at.ZodDate,...ht(t)});class uE extends xt{_parse(e){if(this._getType(e)!==je.symbol){const r=this._getOrReturnCtx(e);return Ae(r,{code:xe.invalid_type,expected:je.symbol,received:r.parsedType}),it}return Qs(e.data)}}uE.create=t=>new uE({typeName:at.ZodSymbol,...ht(t)});class W2 extends xt{_parse(e){if(this._getType(e)!==je.undefined){const r=this._getOrReturnCtx(e);return Ae(r,{code:xe.invalid_type,expected:je.undefined,received:r.parsedType}),it}return Qs(e.data)}}W2.create=t=>new W2({typeName:at.ZodUndefined,...ht(t)});class q2 extends xt{_parse(e){if(this._getType(e)!==je.null){const r=this._getOrReturnCtx(e);return Ae(r,{code:xe.invalid_type,expected:je.null,received:r.parsedType}),it}return Qs(e.data)}}q2.create=t=>new q2({typeName:at.ZodNull,...ht(t)});class dE extends xt{constructor(){super(...arguments),this._any=!0}_parse(e){return Qs(e.data)}}dE.create=t=>new dE({typeName:at.ZodAny,...ht(t)});class G2 extends xt{constructor(){super(...arguments),this._unknown=!0}_parse(e){return Qs(e.data)}}G2.create=t=>new G2({typeName:at.ZodUnknown,...ht(t)});class Ka extends xt{_parse(e){const n=this._getOrReturnCtx(e);return Ae(n,{code:xe.invalid_type,expected:je.never,received:n.parsedType}),it}}Ka.create=t=>new Ka({typeName:at.ZodNever,...ht(t)});class fE extends xt{_parse(e){if(this._getType(e)!==je.undefined){const r=this._getOrReturnCtx(e);return Ae(r,{code:xe.invalid_type,expected:je.void,received:r.parsedType}),it}return Qs(e.data)}}fE.create=t=>new fE({typeName:at.ZodVoid,...ht(t)});class Ki extends xt{_parse(e){const{ctx:n,status:r}=this._processInputParams(e),s=this._def;if(n.parsedType!==je.array)return Ae(n,{code:xe.invalid_type,expected:je.array,received:n.parsedType}),it;if(s.exactLength!==null){const o=n.data.length>s.exactLength.value,l=n.data.length<s.exactLength.value;(o||l)&&(Ae(n,{code:o?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&&(Ae(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&&(Ae(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 Ji(n,o,n.path,l)))).then(o=>Vr.mergeArray(r,o));const i=[...n.data].map((o,l)=>s.type._parseSync(new Ji(n,o,n.path,l)));return Vr.mergeArray(r,i)}get element(){return this._def.type}min(e,n){return new Ki({...this._def,minLength:{value:e,message:Ze.toString(n)}})}max(e,n){return new Ki({...this._def,maxLength:{value:e,message:Ze.toString(n)}})}length(e,n){return new Ki({...this._def,exactLength:{value:e,message:Ze.toString(n)}})}nonempty(e){return this.min(1,e)}}Ki.create=(t,e)=>new Ki({type:t,minLength:null,maxLength:null,exactLength:null,typeName:at.ZodArray,...ht(e)});function wu(t){if(t instanceof Hn){const e={};for(const n in t.shape){const r=t.shape[n];e[n]=Vo.create(wu(r))}return new Hn({...t._def,shape:()=>e})}else return t instanceof Ki?new Ki({...t._def,type:wu(t.element)}):t instanceof Vo?Vo.create(wu(t.unwrap())):t instanceof wc?wc.create(wu(t.unwrap())):t instanceof vc?vc.create(t.items.map(e=>wu(e))):t}class Hn 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 Ae(d,{code:xe.invalid_type,expected:je.object,received:d.parsedType}),it}const{status:r,ctx:s}=this._processInputParams(e),{shape:i,keys:o}=this._getCached(),l=[];if(!(this._def.catchall instanceof Ka&&this._def.unknownKeys==="strip"))for(const d in s.data)o.includes(d)||l.push(d);const u=[];for(const d of o){const f=i[d],h=s.data[d];u.push({key:{status:"valid",value:d},value:f._parse(new Ji(s,h,s.path,d)),alwaysSet:d in s.data})}if(this._def.catchall instanceof Ka){const d=this._def.unknownKeys;if(d==="passthrough")for(const f of l)u.push({key:{status:"valid",value:f},value:{status:"valid",value:s.data[f]}});else if(d==="strict")l.length>0&&(Ae(s,{code: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 h=s.data[f];u.push({key:{status:"valid",value:f},value:d._parse(new Ji(s,h,s.path,f)),alwaysSet:f in s.data})}}return s.common.async?Promise.resolve().then(async()=>{const d=[];for(const f of u){const h=await f.key,g=await f.value;d.push({key:h,value:g,alwaysSet:f.alwaysSet})}return d}).then(d=>Vr.mergeObjectSync(r,d)):Vr.mergeObjectSync(r,u)}get shape(){return this._def.shape()}strict(e){return Ze.errToObj,new Hn({...this._def,unknownKeys:"strict",...e!==void 0?{errorMap:(n,r)=>{var i,o;const s=((o=(i=this._def).errorMap)==null?void 0:o.call(i,n,r).message)??r.defaultError;return n.code==="unrecognized_keys"?{message:Ze.errToObj(e).message??s}:{message:s}}}:{}})}strip(){return new Hn({...this._def,unknownKeys:"strip"})}passthrough(){return new Hn({...this._def,unknownKeys:"passthrough"})}extend(e){return new Hn({...this._def,shape:()=>({...this._def.shape(),...e})})}merge(e){return new Hn({unknownKeys:e._def.unknownKeys,catchall:e._def.catchall,shape:()=>({...this._def.shape(),...e._def.shape()}),typeName:at.ZodObject})}setKey(e,n){return this.augment({[e]:n})}catchall(e){return new Hn({...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 Hn({...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 Hn({...this._def,shape:()=>n})}deepPartial(){return wu(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 Hn({...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 Vo;)i=i._def.innerType;n[r]=i}return new Hn({...this._def,shape:()=>n})}keyof(){return FT(It.objectKeys(this.shape))}}Hn.create=(t,e)=>new Hn({shape:()=>t,unknownKeys:"strip",catchall:Ka.create(),typeName:at.ZodObject,...ht(e)});Hn.strictCreate=(t,e)=>new Hn({shape:()=>t,unknownKeys:"strict",catchall:Ka.create(),typeName:at.ZodObject,...ht(e)});Hn.lazycreate=(t,e)=>new Hn({shape:t,unknownKeys:"strip",catchall:Ka.create(),typeName:at.ZodObject,...ht(e)});class eg 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 Ae(n,{code:xe.invalid_union,unionErrors:o}),it}if(n.common.async)return Promise.all(r.map(async i=>{const o={...n,common:{...n.common,issues:[]},parent:null};return{result:await i._parseAsync({data:n.data,path:n.path,parent:o}),ctx:o}})).then(s);{let i;const o=[];for(const u of r){const d={...n,common:{...n.common,issues:[]},parent:null},f=u._parseSync({data:n.data,path:n.path,parent:d});if(f.status==="valid")return f;f.status==="dirty"&&!i&&(i={result:f,ctx:d}),d.common.issues.length&&o.push(d.common.issues)}if(i)return n.common.issues.push(...i.ctx.common.issues),i.result;const l=o.map(u=>new Zo(u));return Ae(n,{code:xe.invalid_union,unionErrors:l}),it}}get options(){return this._def.options}}eg.create=(t,e)=>new eg({options:t,typeName:at.ZodUnion,...ht(e)});const Ao=t=>t instanceof Y2?Ao(t.schema):t instanceof _c?Ao(t.innerType()):t instanceof rg?[t.value]:t instanceof yc?t.options:t instanceof X2?It.objectValues(t.enum):t instanceof ig?Ao(t._def.innerType):t instanceof W2?[void 0]:t instanceof q2?[null]:t instanceof Vo?[void 0,...Ao(t.unwrap())]:t instanceof wc?[null,...Ao(t.unwrap())]:t instanceof VT||t instanceof ag?Ao(t.unwrap()):t instanceof og?Ao(t._def.innerType):[];class tb extends xt{_parse(e){const{ctx:n}=this._processInputParams(e);if(n.parsedType!==je.object)return Ae(n,{code:xe.invalid_type,expected:je.object,received:n.parsedType}),it;const r=this.discriminator,s=n.data[r],i=this.optionsMap.get(s);return i?n.common.async?i._parseAsync({data:n.data,path:n.path,parent:n}):i._parseSync({data:n.data,path:n.path,parent:n}):(Ae(n,{code:xe.invalid_union_discriminator,options:Array.from(this.optionsMap.keys()),path:[r]}),it)}get discriminator(){return this._def.discriminator}get options(){return this._def.options}get optionsMap(){return this._def.optionsMap}static create(e,n,r){const s=new Map;for(const i of n){const o=Ao(i.shape[e]);if(!o.length)throw new Error(`A discriminator value for key \`${e}\` could not be extracted from all schema options`);for(const l of o){if(s.has(l))throw new Error(`Discriminator property ${String(e)} has duplicate value ${String(l)}`);s.set(l,i)}}return new tb({typeName:at.ZodDiscriminatedUnion,discriminator:e,options:n,optionsMap:s,...ht(r)})}}function K2(t,e){const n=Aa(t),r=Aa(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=K2(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=K2(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 tg extends xt{_parse(e){const{status:n,ctx:r}=this._processInputParams(e),s=(i,o)=>{if(aE(i)||aE(o))return it;const l=K2(i.value,o.value);return l.valid?((lE(i)||lE(o))&&n.dirty(),{status:n.value,value:l.data}):(Ae(r,{code:xe.invalid_intersection_types}),it)};return r.common.async?Promise.all([this._def.left._parseAsync({data:r.data,path:r.path,parent:r}),this._def.right._parseAsync({data:r.data,path:r.path,parent:r})]).then(([i,o])=>s(i,o)):s(this._def.left._parseSync({data:r.data,path:r.path,parent:r}),this._def.right._parseSync({data:r.data,path:r.path,parent:r}))}}tg.create=(t,e,n)=>new tg({left:t,right:e,typeName:at.ZodIntersection,...ht(n)});class vc extends xt{_parse(e){const{status:n,ctx:r}=this._processInputParams(e);if(r.parsedType!==je.array)return Ae(r,{code:xe.invalid_type,expected:je.array,received:r.parsedType}),it;if(r.data.length<this._def.items.length)return Ae(r,{code:xe.too_small,minimum:this._def.items.length,inclusive:!0,exact:!1,type:"array"}),it;!this._def.rest&&r.data.length>this._def.items.length&&(Ae(r,{code: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 Ji(r,o,r.path,l)):null}).filter(o=>!!o);return r.common.async?Promise.all(i).then(o=>Vr.mergeArray(n,o)):Vr.mergeArray(n,i)}get items(){return this._def.items}rest(e){return new vc({...this._def,rest:e})}}vc.create=(t,e)=>{if(!Array.isArray(t))throw new Error("You must pass an array of schemas to z.tuple([ ... ])");return new vc({items:t,typeName:at.ZodTuple,rest:null,...ht(e)})};class ng 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 Ae(r,{code:xe.invalid_type,expected:je.object,received:r.parsedType}),it;const s=[],i=this._def.keyType,o=this._def.valueType;for(const l in r.data)s.push({key:i._parse(new Ji(r,l,r.path,l)),value:o._parse(new Ji(r,r.data[l],r.path,l)),alwaysSet:l in r.data});return r.common.async?Vr.mergeObjectAsync(n,s):Vr.mergeObjectSync(n,s)}get element(){return this._def.valueType}static create(e,n,r){return n instanceof xt?new ng({keyType:e,valueType:n,typeName:at.ZodRecord,...ht(r)}):new ng({keyType:Fo.create(),valueType:e,typeName:at.ZodRecord,...ht(n)})}}class hE 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 Ae(r,{code:xe.invalid_type,expected:je.map,received:r.parsedType}),it;const s=this._def.keyType,i=this._def.valueType,o=[...r.data.entries()].map(([l,u],d)=>({key:s._parse(new Ji(r,l,r.path,[d,"key"])),value:i._parse(new Ji(r,u,r.path,[d,"value"]))}));if(r.common.async){const l=new Map;return Promise.resolve().then(async()=>{for(const u of o){const d=await u.key,f=await u.value;if(d.status==="aborted"||f.status==="aborted")return it;(d.status==="dirty"||f.status==="dirty")&&n.dirty(),l.set(d.value,f.value)}return{status:n.value,value:l}})}else{const l=new Map;for(const u of o){const d=u.key,f=u.value;if(d.status==="aborted"||f.status==="aborted")return it;(d.status==="dirty"||f.status==="dirty")&&n.dirty(),l.set(d.value,f.value)}return{status:n.value,value:l}}}}hE.create=(t,e,n)=>new hE({valueType:e,keyType:t,typeName:at.ZodMap,...ht(n)});class wh extends xt{_parse(e){const{status:n,ctx:r}=this._processInputParams(e);if(r.parsedType!==je.set)return Ae(r,{code:xe.invalid_type,expected:je.set,received:r.parsedType}),it;const s=this._def;s.minSize!==null&&r.data.size<s.minSize.value&&(Ae(r,{code: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&&(Ae(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 it;f.status==="dirty"&&n.dirty(),d.add(f.value)}return{status:n.value,value:d}}const l=[...r.data.values()].map((u,d)=>i._parse(new Ji(r,u,r.path,d)));return r.common.async?Promise.all(l).then(u=>o(u)):o(l)}min(e,n){return new wh({...this._def,minSize:{value:e,message:Ze.toString(n)}})}max(e,n){return new wh({...this._def,maxSize:{value:e,message:Ze.toString(n)}})}size(e,n){return this.min(e,n).max(e,n)}nonempty(e){return this.min(1,e)}}wh.create=(t,e)=>new wh({valueType:t,minSize:null,maxSize:null,typeName:at.ZodSet,...ht(e)});class Y2 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})}}Y2.create=(t,e)=>new Y2({getter:t,typeName:at.ZodLazy,...ht(e)});class rg extends xt{_parse(e){if(e.data!==this._def.value){const n=this._getOrReturnCtx(e);return Ae(n,{received:n.data,code:xe.invalid_literal,expected:this._def.value}),it}return{status:"valid",value:e.data}}get value(){return this._def.value}}rg.create=(t,e)=>new rg({value:t,typeName:at.ZodLiteral,...ht(e)});function FT(t,e){return new yc({values:t,typeName:at.ZodEnum,...ht(e)})}class yc extends xt{_parse(e){if(typeof e.data!="string"){const n=this._getOrReturnCtx(e),r=this._def.values;return Ae(n,{expected:It.joinValues(r),received:n.parsedType,code:xe.invalid_type}),it}if(this._cache||(this._cache=new Set(this._def.values)),!this._cache.has(e.data)){const n=this._getOrReturnCtx(e),r=this._def.values;return Ae(n,{received:n.data,code:xe.invalid_enum_value,options:r}),it}return Qs(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 yc.create(e,{...this._def,...n})}exclude(e,n=this._def){return yc.create(this.options.filter(r=>!e.includes(r)),{...this._def,...n})}}yc.create=FT;class X2 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 Ae(r,{expected:It.joinValues(s),received:r.parsedType,code:xe.invalid_type}),it}if(this._cache||(this._cache=new Set(It.getValidEnumValues(this._def.values))),!this._cache.has(e.data)){const s=It.objectValues(n);return Ae(r,{received:r.data,code:xe.invalid_enum_value,options:s}),it}return Qs(e.data)}get enum(){return this._def.values}}X2.create=(t,e)=>new X2({values:t,typeName:at.ZodNativeEnum,...ht(e)});class sg 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 Ae(n,{code:xe.invalid_type,expected:je.promise,received:n.parsedType}),it;const r=n.parsedType===je.promise?n.data:Promise.resolve(n.data);return Qs(r.then(s=>this._def.type.parseAsync(s,{path:n.path,errorMap:n.common.contextualErrorMap})))}}sg.create=(t,e)=>new sg({type:t,typeName:at.ZodPromise,...ht(e)});class _c extends xt{innerType(){return this._def.schema}sourceType(){return this._def.schema._def.typeName===at.ZodEffects?this._def.schema.sourceType():this._def.schema}_parse(e){const{status:n,ctx:r}=this._processInputParams(e),s=this._def.effect||null,i={addIssue:o=>{Ae(r,o),o.fatal?n.abort():n.dirty()},get path(){return r.path}};if(i.addIssue=i.addIssue.bind(i),s.type==="preprocess"){const o=s.transform(r.data,i);if(r.common.async)return Promise.resolve(o).then(async l=>{if(n.value==="aborted")return it;const u=await this._def.schema._parseAsync({data:l,path:r.path,parent:r});return u.status==="aborted"?it:u.status==="dirty"||n.value==="dirty"?Df(u.value):u});{if(n.value==="aborted")return it;const l=this._def.schema._parseSync({data:o,path:r.path,parent:r});return l.status==="aborted"?it:l.status==="dirty"||n.value==="dirty"?Df(l.value):l}}if(s.type==="refinement"){const o=l=>{const u=s.refinement(l,i);if(r.common.async)return Promise.resolve(u);if(u instanceof Promise)throw new Error("Async refinement encountered during synchronous parse operation. Use .parseAsync instead.");return l};if(r.common.async===!1){const l=this._def.schema._parseSync({data:r.data,path:r.path,parent:r});return l.status==="aborted"?it:(l.status==="dirty"&&n.dirty(),o(l.value),{status:n.value,value:l.value})}else return this._def.schema._parseAsync({data:r.data,path:r.path,parent:r}).then(l=>l.status==="aborted"?it:(l.status==="dirty"&&n.dirty(),o(l.value).then(()=>({status:n.value,value:l.value}))))}if(s.type==="transform")if(r.common.async===!1){const o=this._def.schema._parseSync({data:r.data,path:r.path,parent:r});if(!cd(o))return it;const l=s.transform(o.value,i);if(l instanceof Promise)throw new Error("Asynchronous transform encountered during synchronous parse operation. Use .parseAsync instead.");return{status:n.value,value:l}}else return this._def.schema._parseAsync({data:r.data,path:r.path,parent:r}).then(o=>cd(o)?Promise.resolve(s.transform(o.value,i)).then(l=>({status:n.value,value:l})):it);It.assertNever(s)}}_c.create=(t,e,n)=>new _c({schema:t,typeName:at.ZodEffects,effect:e,...ht(n)});_c.createWithPreprocess=(t,e,n)=>new _c({schema:e,effect:{type:"preprocess",transform:t},typeName:at.ZodEffects,...ht(n)});class Vo extends xt{_parse(e){return this._getType(e)===je.undefined?Qs(void 0):this._def.innerType._parse(e)}unwrap(){return this._def.innerType}}Vo.create=(t,e)=>new Vo({innerType:t,typeName:at.ZodOptional,...ht(e)});class wc extends xt{_parse(e){return this._getType(e)===je.null?Qs(null):this._def.innerType._parse(e)}unwrap(){return this._def.innerType}}wc.create=(t,e)=>new wc({innerType:t,typeName:at.ZodNullable,...ht(e)});class ig 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}}ig.create=(t,e)=>new ig({innerType:t,typeName:at.ZodDefault,defaultValue:typeof e.default=="function"?e.default:()=>e.default,...ht(e)});class og 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 Qm(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}}og.create=(t,e)=>new og({innerType:t,typeName:at.ZodCatch,catchValue:typeof e.catch=="function"?e.catch:()=>e.catch,...ht(e)});class pE extends xt{_parse(e){if(this._getType(e)!==je.nan){const r=this._getOrReturnCtx(e);return Ae(r,{code:xe.invalid_type,expected:je.nan,received:r.parsedType}),it}return{status:"valid",value:e.data}}}pE.create=t=>new pE({typeName:at.ZodNaN,...ht(t)});class VT 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 nb 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"?it:i.status==="dirty"?(n.dirty(),Df(i.value)):this._def.out._parseAsync({data:i.value,path:r.path,parent:r})})();{const s=this._def.in._parseSync({data:r.data,path:r.path,parent:r});return s.status==="aborted"?it:s.status==="dirty"?(n.dirty(),{status:"dirty",value:s.value}):this._def.out._parseSync({data:s.value,path:r.path,parent:r})}}static create(e,n){return new nb({in:e,out:n,typeName:at.ZodPipeline})}}class ag extends xt{_parse(e){const n=this._def.innerType._parse(e),r=s=>(cd(s)&&(s.value=Object.freeze(s.value)),s);return Qm(n)?n.then(s=>r(s)):r(n)}unwrap(){return this._def.innerType}}ag.create=(t,e)=>new ag({innerType:t,typeName:at.ZodReadonly,...ht(e)});var at;(function(t){t.ZodString="ZodString",t.ZodNumber="ZodNumber",t.ZodNaN="ZodNaN",t.ZodBigInt="ZodBigInt",t.ZodBoolean="ZodBoolean",t.ZodDate="ZodDate",t.ZodSymbol="ZodSymbol",t.ZodUndefined="ZodUndefined",t.ZodNull="ZodNull",t.ZodAny="ZodAny",t.ZodUnknown="ZodUnknown",t.ZodNever="ZodNever",t.ZodVoid="ZodVoid",t.ZodArray="ZodArray",t.ZodObject="ZodObject",t.ZodUnion="ZodUnion",t.ZodDiscriminatedUnion="ZodDiscriminatedUnion",t.ZodIntersection="ZodIntersection",t.ZodTuple="ZodTuple",t.ZodRecord="ZodRecord",t.ZodMap="ZodMap",t.ZodSet="ZodSet",t.ZodFunction="ZodFunction",t.ZodLazy="ZodLazy",t.ZodLiteral="ZodLiteral",t.ZodEnum="ZodEnum",t.ZodEffects="ZodEffects",t.ZodNativeEnum="ZodNativeEnum",t.ZodOptional="ZodOptional",t.ZodNullable="ZodNullable",t.ZodDefault="ZodDefault",t.ZodCatch="ZodCatch",t.ZodPromise="ZodPromise",t.ZodBranded="ZodBranded",t.ZodPipeline="ZodPipeline",t.ZodReadonly="ZodReadonly"})(at||(at={}));const Xe=Fo.create,HT=ud.create,xh=Z2.create,kae=G2.create;Ka.create;const dd=Ki.create,Tn=Hn.create,_z=eg.create,wz=tb.create;tg.create;vc.create;const zT=ng.create,mE=rg.create,Zg=yc.create;sg.create;Vo.create;wc.create;const xz=it,bz=Tn({token:Xe().min(1)}),Sz=t=>bz.parse(t).token,Wg="rivet_library_token";let Wo="",fd=0,xi=null,gE=!1;const Q2=new Set,bh=()=>Q2.forEach(t=>t()),Eae=()=>xi,Cae=()=>fd,Sh=()=>{try{const t=window.localStorage.getItem(Wg)??"";Wo!==t&&(fd+=1),Wo=t,xi=null}catch{xi="Rivet cannot access browser storage. Allow site storage and try again."}},UT=()=>{gE||(window.addEventListener("storage",t=>{t.key!==Wg&&t.key!==null||(Sh(),bh())}),gE=!0)},Pae=()=>!!Wo,Aae=t=>(UT(),Q2.add(t),()=>Q2.delete(t)),kz=(t,e)=>{if(e!==void 0&&Sh(),e!==void 0&&e!==fd)throw new Error("Sign-in was cancelled because the browser login changed.");try{window.localStorage.setItem(Wg,t)}catch{throw xi="Rivet cannot save browser access. Allow site storage and try again.",bh(),new Error(xi)}Wo=t,fd+=1,xi=null,bh()},BT=()=>{Wo="",fd+=1,xi=null;try{window.localStorage.removeItem(Wg)}catch{xi="Rivet cannot clear browser storage. Allow site storage and try again."}bh()},Ez=async()=>{if(!window.location.pathname.startsWith("/rivet/library"))return;UT(),Sh();const t=fd,e=new URLSearchParams(window.location.hash.slice(1)).get("code");if(e){window.history.replaceState(null,"",window.location.pathname+window.location.search);try{const n=await fetch("/api/library/browser-sessions/exchange",{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({code:e})});if(n.ok){kz(Sz(await n.json()),t);return}n.status>=500&&!Wo&&(xi="Rivet is temporarily unavailable. Please retry this link.")}catch{!Wo&&!xi&&(xi="Rivet could not open this link. Please retry when the server is available.")}}bh()},ZT=async(t,e={})=>{Sh();const n=Wo,r=new Headers(e.headers);r.set("Authorization",`Bearer ${n}`);const s=await fetch(t,{...e,headers:r});return s.status===401&&(Sh(),Wo===n&&BT()),s},Cz=async(t,e={})=>{const n=await ZT(`/api/library${t}`,{method:e.method??"GET",signal:e.signal,headers:{"Content-Type":"application/json"},...e.body!==void 0?{body:JSON.stringify(e.body)}:{}});return Pz(n)},Pz=async t=>{const e=await t.text();let n;try{n=JSON.parse(e)}catch{if(t.ok)throw new Error("The library returned an invalid response.")}if(!t.ok){if(t.status===401)throw new Error("Sign in to access this library.");const r=n&&typeof n=="object"&&"error"in n&&typeof n.error=="string"&&n.error.trim()?n.error:`Library request failed (${t.status}).`;throw new Error(r)}return n};var M0={},Yy={exports:{}},qr={},Xy={exports:{}},Qy={};/**
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 vE;function Az(){return vE||(vE=1,(function(t){function e(U,J){var Z=U.length;U.push(J);e:for(;0<Z;){var j=Z-1>>>1,Q=U[j];if(0<s(Q,J))U[j]=J,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 J=U[0],Z=U.pop();if(Z!==J){U[0]=Z;e:for(var j=0,Q=U.length,oe=Q>>>1;j<oe;){var ne=2*(j+1)-1,se=U[ne],de=ne+1,ve=U[de];if(0>s(se,Z))de<Q&&0>s(ve,se)?(U[j]=ve,U[de]=Z,j=de):(U[j]=se,U[ne]=Z,j=ne);else if(de<Q&&0>s(ve,Z))U[j]=ve,U[de]=Z,j=de;else break e}}return J}function s(U,J){var Z=U.sortIndex-J.sortIndex;return Z!==0?Z:U.id-J.id}if(typeof performance=="object"&&typeof performance.now=="function"){var i=performance;t.unstable_now=function(){return i.now()}}else{var o=Date,l=o.now();t.unstable_now=function(){return o.now()-l}}var u=[],d=[],f=1,h=null,g=3,v=!1,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 J=n(d);J!==null;){if(J.callback===null)r(d);else if(J.startTime<=U)r(d),J.sortIndex=J.expirationTime,e(u,J);else break;J=n(d)}}function A(U){if(_=!1,C(U),!w)if(n(u)!==null)w=!0,H(T);else{var J=n(d);J!==null&&Y(A,J.startTime-U)}}function T(U,J){w=!1,_&&(_=!1,S(R),R=-1),v=!0;var Z=g;try{for(C(J),h=n(u);h!==null&&(!(h.expirationTime>J)||U&&!D());){var j=h.callback;if(typeof j=="function"){h.callback=null,g=h.priorityLevel;var Q=j(h.expirationTime<=J);J=t.unstable_now(),typeof Q=="function"?h.callback=Q:h===n(u)&&r(u),C(J)}else r(u);h=n(u)}if(h!==null)var oe=!0;else{var ne=n(d);ne!==null&&Y(A,ne.startTime-J),oe=!1}return oe}finally{h=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 F(){if(M!==null){var U=t.unstable_now();N=U;var J=!0;try{J=M(!0,U)}finally{J?K():(I=!1,M=null)}}else I=!1}var K;if(typeof k=="function")K=function(){k(F)};else if(typeof MessageChannel<"u"){var B=new MessageChannel,G=B.port2;B.port1.onmessage=F,K=function(){G.postMessage(null)}}else K=function(){x(F,0)};function H(U){M=U,I||(I=!0,K())}function Y(U,J){R=x(function(){U(t.unstable_now())},J)}t.unstable_IdlePriority=5,t.unstable_ImmediatePriority=1,t.unstable_LowPriority=4,t.unstable_NormalPriority=3,t.unstable_Profiling=null,t.unstable_UserBlockingPriority=2,t.unstable_cancelCallback=function(U){U.callback=null},t.unstable_continueExecution=function(){w||v||(w=!0,H(T))},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 J=3;break;default:J=g}var Z=g;g=J;try{return U()}finally{g=Z}},t.unstable_pauseExecution=function(){},t.unstable_requestPaint=function(){},t.unstable_runWithPriority=function(U,J){switch(U){case 1:case 2:case 3:case 4:case 5:break;default:U=3}var Z=g;g=U;try{return J()}finally{g=Z}},t.unstable_scheduleCallback=function(U,J,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:J,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,Y(A,Z-j))):(U.sortIndex=Q,e(u,U),w||v||(w=!0,H(T))),U},t.unstable_shouldYield=D,t.unstable_wrapCallback=function(U){var J=g;return function(){var Z=g;g=J;try{return U.apply(this,arguments)}finally{g=Z}}}})(Qy)),Qy}var yE;function Tz(){return yE||(yE=1,Xy.exports=Az()),Xy.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 _E;function Rz(){if(_E)return qr;_E=1;var t=kx(),e=Tz();function n(a){for(var c="https://reactjs.org/docs/error-decoder.html?invariant="+a,p=1;p<arguments.length;p++)c+="&args[]="+encodeURIComponent(arguments[p]);return"Minified React error #"+a+"; visit "+c+" for the full message or use the non-minified dev environment for full errors and additional helpful warnings."}var r=new Set,s={};function i(a,c){o(a,c),o(a+"Capture",c)}function o(a,c){for(s[a]=c,a=0;a<c.length;a++)r.add(c[a])}var l=!(typeof window>"u"||typeof window.document>"u"||typeof window.document.createElement>"u"),u=Object.prototype.hasOwnProperty,d=/^[:A-Z_a-z\u00C0-\u00D6\u00D8-\u00F6\u00F8-\u02FF\u0370-\u037D\u037F-\u1FFF\u200C-\u200D\u2070-\u218F\u2C00-\u2FEF\u3001-\uD7FF\uF900-\uFDCF\uFDF0-\uFFFD][:A-Z_a-z\u00C0-\u00D6\u00D8-\u00F6\u00F8-\u02FF\u0370-\u037D\u037F-\u1FFF\u200C-\u200D\u2070-\u218F\u2C00-\u2FEF\u3001-\uD7FF\uF900-\uFDCF\uFDF0-\uFFFD\-.0-9\u00B7\u0300-\u036F\u203F-\u2040]*$/,f={},h={};function g(a){return u.call(h,a)?!0:u.call(f,a)?!1:d.test(a)?h[a]=!0:(f[a]=!0,!1)}function v(a,c,p,y){if(p!==null&&p.type===0)return!1;switch(typeof c){case"function":case"symbol":return!0;case"boolean":return y?!1:p!==null?!p.acceptsBooleans:(a=a.toLowerCase().slice(0,5),a!=="data-"&&a!=="aria-");default:return!1}}function w(a,c,p,y){if(c===null||typeof c>"u"||v(a,c,p,y))return!0;if(y)return!1;if(p!==null)switch(p.type){case 3:return!c;case 4:return c===!1;case 5:return isNaN(c);case 6:return isNaN(c)||1>c}return!1}function _(a,c,p,y,E,P,L){this.acceptsBooleans=c===2||c===3||c===4,this.attributeName=y,this.attributeNamespace=E,this.mustUseProperty=p,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,p,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,p,E,y)&&(p=null),y||E===null?g(c)&&(p===null?a.removeAttribute(c):a.setAttribute(c,""+p)):E.mustUseProperty?a[E.propertyName]=p===null?E.type===3?!1:"":p:(c=E.attributeName,y=E.attributeNamespace,p===null?a.removeAttribute(c):(E=E.type,p=E===3||E===4&&p===!0?"":""+p,y?a.setAttributeNS(y,c,p):a.setAttribute(c,p))))}var A=t.__SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED,T=Symbol.for("react.element"),I=Symbol.for("react.portal"),M=Symbol.for("react.fragment"),R=Symbol.for("react.strict_mode"),O=Symbol.for("react.profiler"),N=Symbol.for("react.provider"),D=Symbol.for("react.context"),F=Symbol.for("react.forward_ref"),K=Symbol.for("react.suspense"),B=Symbol.for("react.suspense_list"),G=Symbol.for("react.memo"),H=Symbol.for("react.lazy"),Y=Symbol.for("react.offscreen"),U=Symbol.iterator;function J(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(p){var c=p.stack.trim().match(/\n( *(at )?)/);j=c&&c[1]||""}return`
36
+ `+j+a}var oe=!1;function ne(a,c){if(!a||oe)return"";oe=!0;var p=Error.prepareStackTrace;Error.prepareStackTrace=void 0;try{if(c)if(c=function(){throw Error()},Object.defineProperty(c.prototype,"props",{set:function(){throw Error()}}),typeof Reflect=="object"&&Reflect.construct){try{Reflect.construct(c,[])}catch(ie){var y=ie}Reflect.construct(a,[],c)}else{try{c.call()}catch(ie){y=ie}a.call(c.prototype)}else{try{throw Error()}catch(ie){y=ie}a()}}catch(ie){if(ie&&y&&typeof ie.stack=="string"){for(var E=ie.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=p}return(a=a?a.displayName||a.name:"")?Q(a):""}function se(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=ne(a.type,!1),a;case 11:return a=ne(a.type.render,!1),a;case 1:return a=ne(a.type,!0),a;default:return""}}function de(a){if(a==null)return null;if(typeof a=="function")return a.displayName||a.name||null;if(typeof a=="string")return a;switch(a){case M:return"Fragment";case I:return"Portal";case O:return"Profiler";case R:return"StrictMode";case K: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 F: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:de(a.type)||"Memo";case H:c=a._payload,a=a._init;try{return de(a(c))}catch{}}return null}function ve(a){var c=a.type;switch(a.tag){case 24:return"Cache";case 9:return(c.displayName||"Context")+".Consumer";case 10:return(c._context.displayName||"Context")+".Provider";case 18:return"DehydratedFragment";case 11:return a=c.render,a=a.displayName||a.name||"",c.displayName||(a!==""?"ForwardRef("+a+")":"ForwardRef");case 7:return"Fragment";case 5:return c;case 4:return"Portal";case 3:return"Root";case 6:return"Text";case 16:return de(c);case 8:return c===R?"StrictMode":"Mode";case 22:return"Offscreen";case 12:return"Profiler";case 21:return"Scope";case 13:return"Suspense";case 19:return"SuspenseList";case 25:return"TracingMarker";case 1:case 0:case 17:case 2:case 14:case 15:if(typeof c=="function")return c.displayName||c.name||null;if(typeof c=="string")return c}return null}function ue(a){switch(typeof a){case"boolean":case"number":case"string":case"undefined":return a;case"object":return a;default:return""}}function 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",p=Object.getOwnPropertyDescriptor(a.constructor.prototype,c),y=""+a[c];if(!a.hasOwnProperty(c)&&typeof p<"u"&&typeof p.get=="function"&&typeof p.set=="function"){var E=p.get,P=p.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:p.enumerable}),{getValue:function(){return y},setValue:function(L){y=""+L},stopTracking:function(){a._valueTracker=null,delete a[c]}}}}function We(a){a._valueTracker||(a._valueTracker=Oe(a))}function Ee(a){if(!a)return!1;var c=a._valueTracker;if(!c)return!0;var p=c.getValue(),y="";return a&&(y=ae(a)?a.checked?"true":"false":a.value),a=y,a!==p?(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 p=c.checked;return Z({},c,{defaultChecked:void 0,defaultValue:void 0,value:void 0,checked:p??a._wrapperState.initialChecked})}function en(a,c){var p=c.defaultValue==null?"":c.defaultValue,y=c.checked!=null?c.checked:c.defaultChecked;p=ue(c.value!=null?c.value:p),a._wrapperState={initialChecked:y,initialValue:p,controlled:c.type==="checkbox"||c.type==="radio"?c.checked!=null:c.value!=null}}function bt(a,c){c=c.checked,c!=null&&C(a,"checked",c,!1)}function _t(a,c){bt(a,c);var p=ue(c.value),y=c.type;if(p!=null)y==="number"?(p===0&&a.value===""||a.value!=p)&&(a.value=""+p):a.value!==""+p&&(a.value=""+p);else if(y==="submit"||y==="reset"){a.removeAttribute("value");return}c.hasOwnProperty("value")?Ke(a,c.type,p):c.hasOwnProperty("defaultValue")&&Ke(a,c.type,ue(c.defaultValue)),c.checked==null&&c.defaultChecked!=null&&(a.defaultChecked=!!c.defaultChecked)}function qe(a,c,p){if(c.hasOwnProperty("value")||c.hasOwnProperty("defaultValue")){var y=c.type;if(!(y!=="submit"&&y!=="reset"||c.value!==void 0&&c.value!==null))return;c=""+a._wrapperState.initialValue,p||c===a.value||(a.value=c),a.defaultValue=c}p=a.name,p!==""&&(a.name=""),a.defaultChecked=!!a._wrapperState.initialChecked,p!==""&&(a.name=p)}function Ke(a,c,p){(c!=="number"||pt(a.ownerDocument)!==a)&&(p==null?a.defaultValue=""+a._wrapperState.initialValue:a.defaultValue!==""+p&&(a.defaultValue=""+p))}var Ct=Array.isArray;function Te(a,c,p,y){if(a=a.options,c){c={};for(var E=0;E<p.length;E++)c["$"+p[E]]=!0;for(p=0;p<a.length;p++)E=c.hasOwnProperty("$"+a[p].value),a[p].selected!==E&&(a[p].selected=E),E&&y&&(a[p].defaultSelected=!0)}else{for(p=""+ue(p),c=null,E=0;E<a.length;E++){if(a[E].value===p){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 p=c.value;if(p==null){if(p=c.children,c=c.defaultValue,p!=null){if(c!=null)throw Error(n(92));if(Ct(p)){if(1<p.length)throw Error(n(93));p=p[0]}c=p}c==null&&(c=""),p=c}a._wrapperState={initialValue:ue(p)}}function Ge(a,c){var p=ue(c.value),y=ue(c.defaultValue);p!=null&&(p=""+p,p!==a.value&&(a.value=p),c.defaultValue==null&&a.defaultValue!==p&&(a.defaultValue=p)),y!=null&&(a.defaultValue=""+y)}function Pt(a){var c=a.textContent;c===a._wrapperState.initialValue&&c!==""&&c!==null&&(a.value=c)}function as(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 yr(a,c){return a==null||a==="http://www.w3.org/1999/xhtml"?as(c):a==="http://www.w3.org/2000/svg"&&c==="foreignObject"?"http://www.w3.org/1999/xhtml":a}var Le,ea=(function(a){return typeof MSApp<"u"&&MSApp.execUnsafeLocalFunction?function(c,p,y,E){MSApp.execUnsafeLocalFunction(function(){return a(c,p,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 Nn(a,c){if(c){var p=a.firstChild;if(p&&p===a.lastChild&&p.nodeType===3){p.nodeValue=c;return}}a.textContent=c}var er={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},dl=["Webkit","ms","Moz","O"];Object.keys(er).forEach(function(a){dl.forEach(function(c){c=c+a.charAt(0).toUpperCase()+a.substring(1),er[c]=er[a]})});function gn(a,c,p){return c==null||typeof c=="boolean"||c===""?"":p||typeof c!="number"||c===0||er.hasOwnProperty(a)&&er[a]?(""+c).trim():c+"px"}function vn(a,c){a=a.style;for(var p in c)if(c.hasOwnProperty(p)){var y=p.indexOf("--")===0,E=gn(p,c[p],y);p==="float"&&(p="cssFloat"),y?a.setProperty(p,E):a[p]=E}}var Md=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 Is(a,c){if(c){if(Md[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 _r(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 tr=null;function oo(a){return a=a.target||a.srcElement||window,a.correspondingUseElement&&(a=a.correspondingUseElement),a.nodeType===3?a.parentNode:a}var ei=null,Dn=null,Os=null;function fl(a){if(a=ef(a)){if(typeof ei!="function")throw Error(n(280));var c=a.stateNode;c&&(c=Lp(c),ei(a.stateNode,a.type,c))}}function ao(a){Dn?Os?Os.push(a):Os=[a]:Dn=a}function ls(){if(Dn){var a=Dn,c=Os;if(Os=Dn=null,fl(a),c)for(a=0;a<c.length;a++)fl(c[a])}}function Qe(a,c){return a(c)}function Nt(){}var Vt=!1;function Wn(a,c,p){if(Vt)return a(c,p);Vt=!0;try{return Qe(a,c,p)}finally{Vt=!1,(Dn!==null||Os!==null)&&(Nt(),ls())}}function cs(a,c){var p=a.stateNode;if(p===null)return null;var y=Lp(p);if(y===null)return null;p=y[c];e:switch(c){case"onClick":case"onClickCapture":case"onDoubleClick":case"onDoubleClickCapture":case"onMouseDown":case"onMouseDownCapture":case"onMouseMove":case"onMouseMoveCapture":case"onMouseUp":case"onMouseUpCapture":case"onMouseEnter":(y=!y.disabled)||(a=a.type,y=!(a==="button"||a==="input"||a==="select"||a==="textarea")),a=!y;break e;default:a=!1}if(a)return null;if(p&&typeof p!="function")throw Error(n(231,c,typeof p));return p}var Bt=!1;if(l)try{var jn={};Object.defineProperty(jn,"passive",{get:function(){Bt=!0}}),window.addEventListener("test",jn,jn),window.removeEventListener("test",jn,jn)}catch{Bt=!1}function Hr(a,c,p,y,E,P,L,z,q){var ie=Array.prototype.slice.call(arguments,3);try{c.apply(p,ie)}catch(ge){this.onError(ge)}}var ti=!1,cr=null,Rn=!1,hl=null,Pc={onError:function(a){ti=!0,cr=a}};function Ac(a,c,p,y,E,P,L,z,q){ti=!1,cr=null,Hr.apply(Pc,arguments)}function Tc(a,c,p,y,E,P,L,z,q){if(Ac.apply(this,arguments),ti){if(ti){var ie=cr;ti=!1,cr=null}else throw Error(n(198));Rn||(Rn=!0,hl=ie)}}function Ls(a){var c=a,p=a;if(a.alternate)for(;c.return;)c=c.return;else{a=c;do c=a,(c.flags&4098)!==0&&(p=c.return),a=c.return;while(a)}return c.tag===3?p:null}function lo(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 Id(a){if(Ls(a)!==a)throw Error(n(188))}function Rc(a){var c=a.alternate;if(!c){if(c=Ls(a),c===null)throw Error(n(188));return c!==a?null:a}for(var p=a,y=c;;){var E=p.return;if(E===null)break;var P=E.alternate;if(P===null){if(y=E.return,y!==null){p=y;continue}break}if(E.child===P.child){for(P=E.child;P;){if(P===p)return Id(E),a;if(P===y)return Id(E),c;P=P.sibling}throw Error(n(188))}if(p.return!==y.return)p=E,y=P;else{for(var L=!1,z=E.child;z;){if(z===p){L=!0,p=E,y=P;break}if(z===y){L=!0,y=E,p=P;break}z=z.sibling}if(!L){for(z=P.child;z;){if(z===p){L=!0,p=P,y=E;break}if(z===y){L=!0,y=P,p=E;break}z=z.sibling}if(!L)throw Error(n(189))}}if(p.alternate!==y)throw Error(n(190))}if(p.tag!==3)throw Error(n(188));return p.stateNode.current===p?a:c}function Od(a){return a=Rc(a),a!==null?Mc(a):null}function Mc(a){if(a.tag===5||a.tag===6)return a;for(a=a.child;a!==null;){var c=Mc(a);if(c!==null)return c;a=a.sibling}return null}var Ic=e.unstable_scheduleCallback,ta=e.unstable_cancelCallback,Ld=e.unstable_shouldYield,Pv=e.unstable_requestPaint,tn=e.unstable_now,Av=e.unstable_getCurrentPriorityLevel,Nd=e.unstable_ImmediatePriority,mp=e.unstable_UserBlockingPriority,na=e.unstable_NormalPriority,Dd=e.unstable_LowPriority,jd=e.unstable_IdlePriority,Oc=null,Ns=null;function gp(a){if(Ns&&typeof Ns.onCommitFiberRoot=="function")try{Ns.onCommitFiberRoot(Oc,a,void 0,(a.current.flags&128)===128)}catch{}}var us=Math.clz32?Math.clz32:Rv,Tv=Math.log,$d=Math.LN2;function Rv(a){return a>>>=0,a===0?32:31-(Tv(a)/$d|0)|0}var Lc=64,Nc=4194304;function pl(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 Dc(a,c){var p=a.pendingLanes;if(p===0)return 0;var y=0,E=a.suspendedLanes,P=a.pingedLanes,L=p&268435455;if(L!==0){var z=L&~E;z!==0?y=pl(z):(P&=L,P!==0&&(y=pl(P)))}else L=p&~E,L!==0?y=pl(L):P!==0&&(y=pl(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|=p&16),c=a.entangledLanes,c!==0)for(a=a.entanglements,c&=y;0<c;)p=31-us(c),E=1<<p,y|=a[p],c&=~E;return y}function Fd(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 Mv(a,c){for(var p=a.suspendedLanes,y=a.pingedLanes,E=a.expirationTimes,P=a.pendingLanes;0<P;){var L=31-us(P),z=1<<L,q=E[L];q===-1?((z&p)===0||(z&y)!==0)&&(E[L]=Fd(z,c)):q<=c&&(a.expiredLanes|=z),P&=~z}}function Vd(a){return a=a.pendingLanes&-1073741825,a!==0?a:a&1073741824?1073741824:0}function vp(){var a=Lc;return Lc<<=1,(Lc&4194240)===0&&(Lc=64),a}function ml(a){for(var c=[],p=0;31>p;p++)c.push(a);return c}function co(a,c,p){a.pendingLanes|=c,c!==536870912&&(a.suspendedLanes=0,a.pingedLanes=0),a=a.eventTimes,c=31-us(c),a[c]=p}function yp(a,c){var p=a.pendingLanes&~c;a.pendingLanes=c,a.suspendedLanes=0,a.pingedLanes=0,a.expiredLanes&=c,a.mutableReadLanes&=c,a.entangledLanes&=c,c=a.entanglements;var y=a.eventTimes;for(a=a.expirationTimes;0<p;){var E=31-us(p),P=1<<E;c[E]=0,y[E]=-1,a[E]=-1,p&=~P}}function Hd(a,c){var p=a.entangledLanes|=c;for(a=a.entanglements;p;){var y=31-us(p),E=1<<y;E&c|a[y]&c&&(a[y]|=c),p&=~E}}var Ft=0;function uo(a){return a&=-a,1<a?4<a?(a&268435455)!==0?16:536870912:4:1}var zd,gl,_p,wp,xp,jc=!1,$c=[],ni=null,ds=null,Ds=null,ra=new Map,sa=new Map,ri=[],bp="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 V(a,c){switch(a){case"focusin":case"focusout":ni=null;break;case"dragenter":case"dragleave":ds=null;break;case"mouseover":case"mouseout":Ds=null;break;case"pointerover":case"pointerout":ra.delete(c.pointerId);break;case"gotpointercapture":case"lostpointercapture":sa.delete(c.pointerId)}}function le(a,c,p,y,E,P){return a===null||a.nativeEvent!==P?(a={blockedOn:c,domEventName:p,eventSystemFlags:y,nativeEvent:P,targetContainers:[E]},c!==null&&(c=ef(c),c!==null&&gl(c)),a):(a.eventSystemFlags|=y,c=a.targetContainers,E!==null&&c.indexOf(E)===-1&&c.push(E),a)}function ke(a,c,p,y,E){switch(c){case"focusin":return ni=le(ni,a,c,p,y,E),!0;case"dragenter":return ds=le(ds,a,c,p,y,E),!0;case"mouseover":return Ds=le(Ds,a,c,p,y,E),!0;case"pointerover":var P=E.pointerId;return ra.set(P,le(ra.get(P)||null,a,c,p,y,E)),!0;case"gotpointercapture":return P=E.pointerId,sa.set(P,le(sa.get(P)||null,a,c,p,y,E)),!0}return!1}function fe(a){var c=vl(a.target);if(c!==null){var p=Ls(c);if(p!==null){if(c=p.tag,c===13){if(c=lo(p),c!==null){a.blockedOn=c,xp(a.priority,function(){_p(p)});return}}else if(c===3&&p.stateNode.current.memoizedState.isDehydrated){a.blockedOn=p.tag===3?p.stateNode.containerInfo:null;return}}}a.blockedOn=null}function pe(a){if(a.blockedOn!==null)return!1;for(var c=a.targetContainers;0<c.length;){var p=si(a.domEventName,a.eventSystemFlags,c[0],a.nativeEvent);if(p===null){p=a.nativeEvent;var y=new p.constructor(p.type,p);tr=y,p.target.dispatchEvent(y),tr=null}else return c=ef(p),c!==null&&gl(c),a.blockedOn=p,!1;c.shift()}return!0}function Se(a,c,p){pe(a)&&p.delete(c)}function et(){jc=!1,ni!==null&&pe(ni)&&(ni=null),ds!==null&&pe(ds)&&(ds=null),Ds!==null&&pe(Ds)&&(Ds=null),ra.forEach(Se),sa.forEach(Se)}function Pe(a,c){a.blockedOn===c&&(a.blockedOn=null,jc||(jc=!0,e.unstable_scheduleCallback(e.unstable_NormalPriority,et)))}function sn(a){function c(E){return Pe(E,a)}if(0<$c.length){Pe($c[0],a);for(var p=1;p<$c.length;p++){var y=$c[p];y.blockedOn===a&&(y.blockedOn=null)}}for(ni!==null&&Pe(ni,a),ds!==null&&Pe(ds,a),Ds!==null&&Pe(Ds,a),ra.forEach(c),sa.forEach(c),p=0;p<ri.length;p++)y=ri[p],y.blockedOn===a&&(y.blockedOn=null);for(;0<ri.length&&(p=ri[0],p.blockedOn===null);)fe(p),p.blockedOn===null&&ri.shift()}var yn=A.ReactCurrentBatchConfig,Tr=!0;function fs(a,c,p,y){var E=Ft,P=yn.transition;yn.transition=null;try{Ft=1,ut(a,c,p,y)}finally{Ft=E,yn.transition=P}}function hs(a,c,p,y){var E=Ft,P=yn.transition;yn.transition=null;try{Ft=4,ut(a,c,p,y)}finally{Ft=E,yn.transition=P}}function ut(a,c,p,y){if(Tr){var E=si(a,c,p,y);if(E===null)Gv(a,c,y,Ht,p),V(a,y);else if(ke(E,a,c,p,y))y.stopPropagation();else if(V(a,y),c&4&&-1<bp.indexOf(a)){for(;E!==null;){var P=ef(E);if(P!==null&&zd(P),P=si(a,c,p,y),P===null&&Gv(a,c,y,Ht,p),P===E)break;E=P}E!==null&&y.stopPropagation()}else Gv(a,c,y,null,p)}}var Ht=null;function si(a,c,p,y){if(Ht=null,a=oo(y),a=vl(a),a!==null)if(c=Ls(a),c===null)a=null;else if(p=c.tag,p===13){if(a=lo(c),a!==null)return a;a=null}else if(p===3){if(c.stateNode.current.memoizedState.isDehydrated)return c.tag===3?c.stateNode.containerInfo:null;a=null}else c!==a&&(a=null);return Ht=a,null}function q4(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(Av()){case Nd:return 1;case mp:return 4;case na:case Dd:return 16;case jd:return 536870912;default:return 16}default:return 16}}var ia=null,Iv=null,Sp=null;function G4(){if(Sp)return Sp;var a,c=Iv,p=c.length,y,E="value"in ia?ia.value:ia.textContent,P=E.length;for(a=0;a<p&&c[a]===E[a];a++);var L=p-a;for(y=1;y<=L&&c[p-y]===E[P-y];y++);return Sp=E.slice(a,1<y?1-y:void 0)}function kp(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 Ep(){return!0}function K4(){return!1}function ps(a){function c(p,y,E,P,L){this._reactName=p,this._targetInst=E,this.type=y,this.nativeEvent=P,this.target=L,this.currentTarget=null;for(var z in a)a.hasOwnProperty(z)&&(p=a[z],this[z]=p?p(P):P[z]);return this.isDefaultPrevented=(P.defaultPrevented!=null?P.defaultPrevented:P.returnValue===!1)?Ep:K4,this.isPropagationStopped=K4,this}return Z(c.prototype,{preventDefault:function(){this.defaultPrevented=!0;var p=this.nativeEvent;p&&(p.preventDefault?p.preventDefault():typeof p.returnValue!="unknown"&&(p.returnValue=!1),this.isDefaultPrevented=Ep)},stopPropagation:function(){var p=this.nativeEvent;p&&(p.stopPropagation?p.stopPropagation():typeof p.cancelBubble!="unknown"&&(p.cancelBubble=!0),this.isPropagationStopped=Ep)},persist:function(){},isPersistent:Ep}),c}var Fc={eventPhase:0,bubbles:0,cancelable:0,timeStamp:function(a){return a.timeStamp||Date.now()},defaultPrevented:0,isTrusted:0},Ov=ps(Fc),Ud=Z({},Fc,{view:0,detail:0}),_D=ps(Ud),Lv,Nv,Bd,Cp=Z({},Ud,{screenX:0,screenY:0,clientX:0,clientY:0,pageX:0,pageY:0,ctrlKey:0,shiftKey:0,altKey:0,metaKey:0,getModifierState:jv,button:0,buttons:0,relatedTarget:function(a){return a.relatedTarget===void 0?a.fromElement===a.srcElement?a.toElement:a.fromElement:a.relatedTarget},movementX:function(a){return"movementX"in a?a.movementX:(a!==Bd&&(Bd&&a.type==="mousemove"?(Lv=a.screenX-Bd.screenX,Nv=a.screenY-Bd.screenY):Nv=Lv=0,Bd=a),Lv)},movementY:function(a){return"movementY"in a?a.movementY:Nv}}),Y4=ps(Cp),wD=Z({},Cp,{dataTransfer:0}),xD=ps(wD),bD=Z({},Ud,{relatedTarget:0}),Dv=ps(bD),SD=Z({},Fc,{animationName:0,elapsedTime:0,pseudoElement:0}),kD=ps(SD),ED=Z({},Fc,{clipboardData:function(a){return"clipboardData"in a?a.clipboardData:window.clipboardData}}),CD=ps(ED),PD=Z({},Fc,{data:0}),X4=ps(PD),AD={Esc:"Escape",Spacebar:" ",Left:"ArrowLeft",Up:"ArrowUp",Right:"ArrowRight",Down:"ArrowDown",Del:"Delete",Win:"OS",Menu:"ContextMenu",Apps:"ContextMenu",Scroll:"ScrollLock",MozPrintableKey:"Unidentified"},TD={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"},RD={Alt:"altKey",Control:"ctrlKey",Meta:"metaKey",Shift:"shiftKey"};function MD(a){var c=this.nativeEvent;return c.getModifierState?c.getModifierState(a):(a=RD[a])?!!c[a]:!1}function jv(){return MD}var ID=Z({},Ud,{key:function(a){if(a.key){var c=AD[a.key]||a.key;if(c!=="Unidentified")return c}return a.type==="keypress"?(a=kp(a),a===13?"Enter":String.fromCharCode(a)):a.type==="keydown"||a.type==="keyup"?TD[a.keyCode]||"Unidentified":""},code:0,location:0,ctrlKey:0,shiftKey:0,altKey:0,metaKey:0,repeat:0,locale:0,getModifierState:jv,charCode:function(a){return a.type==="keypress"?kp(a):0},keyCode:function(a){return a.type==="keydown"||a.type==="keyup"?a.keyCode:0},which:function(a){return a.type==="keypress"?kp(a):a.type==="keydown"||a.type==="keyup"?a.keyCode:0}}),OD=ps(ID),LD=Z({},Cp,{pointerId:0,width:0,height:0,pressure:0,tangentialPressure:0,tiltX:0,tiltY:0,twist:0,pointerType:0,isPrimary:0}),Q4=ps(LD),ND=Z({},Ud,{touches:0,targetTouches:0,changedTouches:0,altKey:0,metaKey:0,ctrlKey:0,shiftKey:0,getModifierState:jv}),DD=ps(ND),jD=Z({},Fc,{propertyName:0,elapsedTime:0,pseudoElement:0}),$D=ps(jD),FD=Z({},Cp,{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}),VD=ps(FD),HD=[9,13,27,32],$v=l&&"CompositionEvent"in window,Zd=null;l&&"documentMode"in document&&(Zd=document.documentMode);var zD=l&&"TextEvent"in window&&!Zd,J4=l&&(!$v||Zd&&8<Zd&&11>=Zd),e6=" ",t6=!1;function n6(a,c){switch(a){case"keyup":return HD.indexOf(c.keyCode)!==-1;case"keydown":return c.keyCode!==229;case"keypress":case"mousedown":case"focusout":return!0;default:return!1}}function r6(a){return a=a.detail,typeof a=="object"&&"data"in a?a.data:null}var Vc=!1;function UD(a,c){switch(a){case"compositionend":return r6(c);case"keypress":return c.which!==32?null:(t6=!0,e6);case"textInput":return a=c.data,a===e6&&t6?null:a;default:return null}}function BD(a,c){if(Vc)return a==="compositionend"||!$v&&n6(a,c)?(a=G4(),Sp=Iv=ia=null,Vc=!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 J4&&c.locale!=="ko"?null:c.data;default:return null}}var ZD={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 s6(a){var c=a&&a.nodeName&&a.nodeName.toLowerCase();return c==="input"?!!ZD[a.type]:c==="textarea"}function i6(a,c,p,y){ao(y),c=Mp(c,"onChange"),0<c.length&&(p=new Ov("onChange","change",null,p,y),a.push({event:p,listeners:c}))}var Wd=null,qd=null;function WD(a){S6(a,0)}function Pp(a){var c=Zc(a);if(Ee(c))return a}function qD(a,c){if(a==="change")return c}var o6=!1;if(l){var Fv;if(l){var Vv="oninput"in document;if(!Vv){var a6=document.createElement("div");a6.setAttribute("oninput","return;"),Vv=typeof a6.oninput=="function"}Fv=Vv}else Fv=!1;o6=Fv&&(!document.documentMode||9<document.documentMode)}function l6(){Wd&&(Wd.detachEvent("onpropertychange",c6),qd=Wd=null)}function c6(a){if(a.propertyName==="value"&&Pp(qd)){var c=[];i6(c,qd,a,oo(a)),Wn(WD,c)}}function GD(a,c,p){a==="focusin"?(l6(),Wd=c,qd=p,Wd.attachEvent("onpropertychange",c6)):a==="focusout"&&l6()}function KD(a){if(a==="selectionchange"||a==="keyup"||a==="keydown")return Pp(qd)}function YD(a,c){if(a==="click")return Pp(c)}function XD(a,c){if(a==="input"||a==="change")return Pp(c)}function QD(a,c){return a===c&&(a!==0||1/a===1/c)||a!==a&&c!==c}var ii=typeof Object.is=="function"?Object.is:QD;function Gd(a,c){if(ii(a,c))return!0;if(typeof a!="object"||a===null||typeof c!="object"||c===null)return!1;var p=Object.keys(a),y=Object.keys(c);if(p.length!==y.length)return!1;for(y=0;y<p.length;y++){var E=p[y];if(!u.call(c,E)||!ii(a[E],c[E]))return!1}return!0}function u6(a){for(;a&&a.firstChild;)a=a.firstChild;return a}function d6(a,c){var p=u6(a);a=0;for(var y;p;){if(p.nodeType===3){if(y=a+p.textContent.length,a<=c&&y>=c)return{node:p,offset:c-a};a=y}e:{for(;p;){if(p.nextSibling){p=p.nextSibling;break e}p=p.parentNode}p=void 0}p=u6(p)}}function f6(a,c){return a&&c?a===c?!0:a&&a.nodeType===3?!1:c&&c.nodeType===3?f6(a,c.parentNode):"contains"in a?a.contains(c):a.compareDocumentPosition?!!(a.compareDocumentPosition(c)&16):!1:!1}function h6(){for(var a=window,c=pt();c instanceof a.HTMLIFrameElement;){try{var p=typeof c.contentWindow.location.href=="string"}catch{p=!1}if(p)a=c.contentWindow;else break;c=pt(a.document)}return c}function Hv(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 JD(a){var c=h6(),p=a.focusedElem,y=a.selectionRange;if(c!==p&&p&&p.ownerDocument&&f6(p.ownerDocument.documentElement,p)){if(y!==null&&Hv(p)){if(c=y.start,a=y.end,a===void 0&&(a=c),"selectionStart"in p)p.selectionStart=c,p.selectionEnd=Math.min(a,p.value.length);else if(a=(c=p.ownerDocument||document)&&c.defaultView||window,a.getSelection){a=a.getSelection();var E=p.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=d6(p,P);var L=d6(p,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=p;a=a.parentNode;)a.nodeType===1&&c.push({element:a,left:a.scrollLeft,top:a.scrollTop});for(typeof p.focus=="function"&&p.focus(),p=0;p<c.length;p++)a=c[p],a.element.scrollLeft=a.left,a.element.scrollTop=a.top}}var e7=l&&"documentMode"in document&&11>=document.documentMode,Hc=null,zv=null,Kd=null,Uv=!1;function p6(a,c,p){var y=p.window===p?p.document:p.nodeType===9?p:p.ownerDocument;Uv||Hc==null||Hc!==pt(y)||(y=Hc,"selectionStart"in y&&Hv(y)?y={start:y.selectionStart,end:y.selectionEnd}:(y=(y.ownerDocument&&y.ownerDocument.defaultView||window).getSelection(),y={anchorNode:y.anchorNode,anchorOffset:y.anchorOffset,focusNode:y.focusNode,focusOffset:y.focusOffset}),Kd&&Gd(Kd,y)||(Kd=y,y=Mp(zv,"onSelect"),0<y.length&&(c=new Ov("onSelect","select",null,c,p),a.push({event:c,listeners:y}),c.target=Hc)))}function Ap(a,c){var p={};return p[a.toLowerCase()]=c.toLowerCase(),p["Webkit"+a]="webkit"+c,p["Moz"+a]="moz"+c,p}var zc={animationend:Ap("Animation","AnimationEnd"),animationiteration:Ap("Animation","AnimationIteration"),animationstart:Ap("Animation","AnimationStart"),transitionend:Ap("Transition","TransitionEnd")},Bv={},m6={};l&&(m6=document.createElement("div").style,"AnimationEvent"in window||(delete zc.animationend.animation,delete zc.animationiteration.animation,delete zc.animationstart.animation),"TransitionEvent"in window||delete zc.transitionend.transition);function Tp(a){if(Bv[a])return Bv[a];if(!zc[a])return a;var c=zc[a],p;for(p in c)if(c.hasOwnProperty(p)&&p in m6)return Bv[a]=c[p];return a}var g6=Tp("animationend"),v6=Tp("animationiteration"),y6=Tp("animationstart"),_6=Tp("transitionend"),w6=new Map,x6="abort auxClick cancel canPlay canPlayThrough click close contextMenu copy cut drag dragEnd dragEnter dragExit dragLeave dragOver dragStart drop durationChange emptied encrypted ended error gotPointerCapture input invalid keyDown keyPress keyUp load loadedData loadedMetadata loadStart lostPointerCapture mouseDown mouseMove mouseOut mouseOver mouseUp paste pause play playing pointerCancel pointerDown pointerMove pointerOut pointerOver pointerUp progress rateChange reset resize seeked seeking stalled submit suspend timeUpdate touchCancel touchEnd touchStart volumeChange scroll toggle touchMove waiting wheel".split(" ");function oa(a,c){w6.set(a,c),i(c,[a])}for(var Zv=0;Zv<x6.length;Zv++){var Wv=x6[Zv],t7=Wv.toLowerCase(),n7=Wv[0].toUpperCase()+Wv.slice(1);oa(t7,"on"+n7)}oa(g6,"onAnimationEnd"),oa(v6,"onAnimationIteration"),oa(y6,"onAnimationStart"),oa("dblclick","onDoubleClick"),oa("focusin","onFocus"),oa("focusout","onBlur"),oa(_6,"onTransitionEnd"),o("onMouseEnter",["mouseout","mouseover"]),o("onMouseLeave",["mouseout","mouseover"]),o("onPointerEnter",["pointerout","pointerover"]),o("onPointerLeave",["pointerout","pointerover"]),i("onChange","change click focusin focusout input keydown keyup selectionchange".split(" ")),i("onSelect","focusout contextmenu dragend focusin keydown keyup mousedown mouseup selectionchange".split(" ")),i("onBeforeInput",["compositionend","keypress","textInput","paste"]),i("onCompositionEnd","compositionend focusout keydown keypress keyup mousedown".split(" ")),i("onCompositionStart","compositionstart focusout keydown keypress keyup mousedown".split(" ")),i("onCompositionUpdate","compositionupdate focusout keydown keypress keyup mousedown".split(" "));var Yd="abort canplay canplaythrough durationchange emptied encrypted ended error loadeddata loadedmetadata loadstart pause play playing progress ratechange resize seeked seeking stalled suspend timeupdate volumechange waiting".split(" "),r7=new Set("cancel close invalid load scroll toggle".split(" ").concat(Yd));function b6(a,c,p){var y=a.type||"unknown-event";a.currentTarget=p,Tc(y,c,void 0,a),a.currentTarget=null}function S6(a,c){c=(c&4)!==0;for(var p=0;p<a.length;p++){var y=a[p],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,ie=z.currentTarget;if(z=z.listener,q!==P&&E.isPropagationStopped())break e;b6(E,z,ie),P=q}else for(L=0;L<y.length;L++){if(z=y[L],q=z.instance,ie=z.currentTarget,z=z.listener,q!==P&&E.isPropagationStopped())break e;b6(E,z,ie),P=q}}}if(Rn)throw a=hl,Rn=!1,hl=null,a}function on(a,c){var p=c[e1];p===void 0&&(p=c[e1]=new Set);var y=a+"__bubble";p.has(y)||(k6(c,a,2,!1),p.add(y))}function qv(a,c,p){var y=0;c&&(y|=4),k6(p,a,y,c)}var Rp="_reactListening"+Math.random().toString(36).slice(2);function Xd(a){if(!a[Rp]){a[Rp]=!0,r.forEach(function(p){p!=="selectionchange"&&(r7.has(p)||qv(p,!1,a),qv(p,!0,a))});var c=a.nodeType===9?a:a.ownerDocument;c===null||c[Rp]||(c[Rp]=!0,qv("selectionchange",!1,c))}}function k6(a,c,p,y){switch(q4(c)){case 1:var E=fs;break;case 4:E=hs;break;default:E=ut}p=E.bind(null,c,p,a),E=void 0,!Bt||c!=="touchstart"&&c!=="touchmove"&&c!=="wheel"||(E=!0),y?E!==void 0?a.addEventListener(c,p,{capture:!0,passive:E}):a.addEventListener(c,p,!0):E!==void 0?a.addEventListener(c,p,{passive:E}):a.addEventListener(c,p,!1)}function Gv(a,c,p,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=vl(z),L===null)return;if(q=L.tag,q===5||q===6){y=P=L;continue e}z=z.parentNode}}y=y.return}Wn(function(){var ie=P,ge=oo(p),_e=[];e:{var me=w6.get(a);if(me!==void 0){var Me=Ov,Fe=a;switch(a){case"keypress":if(kp(p)===0)break e;case"keydown":case"keyup":Me=OD;break;case"focusin":Fe="focus",Me=Dv;break;case"focusout":Fe="blur",Me=Dv;break;case"beforeblur":case"afterblur":Me=Dv;break;case"click":if(p.button===2)break e;case"auxclick":case"dblclick":case"mousedown":case"mousemove":case"mouseup":case"mouseout":case"mouseover":case"contextmenu":Me=Y4;break;case"drag":case"dragend":case"dragenter":case"dragexit":case"dragleave":case"dragover":case"dragstart":case"drop":Me=xD;break;case"touchcancel":case"touchend":case"touchmove":case"touchstart":Me=DD;break;case g6:case v6:case y6:Me=kD;break;case _6:Me=$D;break;case"scroll":Me=_D;break;case"wheel":Me=VD;break;case"copy":case"cut":case"paste":Me=CD;break;case"gotpointercapture":case"lostpointercapture":case"pointercancel":case"pointerdown":case"pointermove":case"pointerout":case"pointerover":case"pointerup":Me=Q4}var He=(c&4)!==0,Mn=!He&&a==="scroll",te=He?me!==null?me+"Capture":null:me;He=[];for(var X=ie,re;X!==null;){re=X;var be=re.stateNode;if(re.tag===5&&be!==null&&(re=be,te!==null&&(be=cs(X,te),be!=null&&He.push(Qd(X,be,re)))),Mn)break;X=X.return}0<He.length&&(me=new Me(me,Fe,null,p,ge),_e.push({event:me,listeners:He}))}}if((c&7)===0){e:{if(me=a==="mouseover"||a==="pointerover",Me=a==="mouseout"||a==="pointerout",me&&p!==tr&&(Fe=p.relatedTarget||p.fromElement)&&(vl(Fe)||Fe[fo]))break e;if((Me||me)&&(me=ge.window===ge?ge:(me=ge.ownerDocument)?me.defaultView||me.parentWindow:window,Me?(Fe=p.relatedTarget||p.toElement,Me=ie,Fe=Fe?vl(Fe):null,Fe!==null&&(Mn=Ls(Fe),Fe!==Mn||Fe.tag!==5&&Fe.tag!==6)&&(Fe=null)):(Me=null,Fe=ie),Me!==Fe)){if(He=Y4,be="onMouseLeave",te="onMouseEnter",X="mouse",(a==="pointerout"||a==="pointerover")&&(He=Q4,be="onPointerLeave",te="onPointerEnter",X="pointer"),Mn=Me==null?me:Zc(Me),re=Fe==null?me:Zc(Fe),me=new He(be,X+"leave",Me,p,ge),me.target=Mn,me.relatedTarget=re,be=null,vl(ge)===ie&&(He=new He(te,X+"enter",Fe,p,ge),He.target=re,He.relatedTarget=Mn,be=He),Mn=be,Me&&Fe)t:{for(He=Me,te=Fe,X=0,re=He;re;re=Uc(re))X++;for(re=0,be=te;be;be=Uc(be))re++;for(;0<X-re;)He=Uc(He),X--;for(;0<re-X;)te=Uc(te),re--;for(;X--;){if(He===te||te!==null&&He===te.alternate)break t;He=Uc(He),te=Uc(te)}He=null}else He=null;Me!==null&&E6(_e,me,Me,He,!1),Fe!==null&&Mn!==null&&E6(_e,Mn,Fe,He,!0)}}e:{if(me=ie?Zc(ie):window,Me=me.nodeName&&me.nodeName.toLowerCase(),Me==="select"||Me==="input"&&me.type==="file")var Be=qD;else if(s6(me))if(o6)Be=XD;else{Be=KD;var tt=GD}else(Me=me.nodeName)&&Me.toLowerCase()==="input"&&(me.type==="checkbox"||me.type==="radio")&&(Be=YD);if(Be&&(Be=Be(a,ie))){i6(_e,Be,p,ge);break e}tt&&tt(a,me,ie),a==="focusout"&&(tt=me._wrapperState)&&tt.controlled&&me.type==="number"&&Ke(me,"number",me.value)}switch(tt=ie?Zc(ie):window,a){case"focusin":(s6(tt)||tt.contentEditable==="true")&&(Hc=tt,zv=ie,Kd=null);break;case"focusout":Kd=zv=Hc=null;break;case"mousedown":Uv=!0;break;case"contextmenu":case"mouseup":case"dragend":Uv=!1,p6(_e,p,ge);break;case"selectionchange":if(e7)break;case"keydown":case"keyup":p6(_e,p,ge)}var nt;if($v)e:{switch(a){case"compositionstart":var ot="onCompositionStart";break e;case"compositionend":ot="onCompositionEnd";break e;case"compositionupdate":ot="onCompositionUpdate";break e}ot=void 0}else Vc?n6(a,p)&&(ot="onCompositionEnd"):a==="keydown"&&p.keyCode===229&&(ot="onCompositionStart");ot&&(J4&&p.locale!=="ko"&&(Vc||ot!=="onCompositionStart"?ot==="onCompositionEnd"&&Vc&&(nt=G4()):(ia=ge,Iv="value"in ia?ia.value:ia.textContent,Vc=!0)),tt=Mp(ie,ot),0<tt.length&&(ot=new X4(ot,a,null,p,ge),_e.push({event:ot,listeners:tt}),nt?ot.data=nt:(nt=r6(p),nt!==null&&(ot.data=nt)))),(nt=zD?UD(a,p):BD(a,p))&&(ie=Mp(ie,"onBeforeInput"),0<ie.length&&(ge=new X4("onBeforeInput","beforeinput",null,p,ge),_e.push({event:ge,listeners:ie}),ge.data=nt))}S6(_e,c)})}function Qd(a,c,p){return{instance:a,listener:c,currentTarget:p}}function Mp(a,c){for(var p=c+"Capture",y=[];a!==null;){var E=a,P=E.stateNode;E.tag===5&&P!==null&&(E=P,P=cs(a,p),P!=null&&y.unshift(Qd(a,P,E)),P=cs(a,c),P!=null&&y.push(Qd(a,P,E))),a=a.return}return y}function Uc(a){if(a===null)return null;do a=a.return;while(a&&a.tag!==5);return a||null}function E6(a,c,p,y,E){for(var P=c._reactName,L=[];p!==null&&p!==y;){var z=p,q=z.alternate,ie=z.stateNode;if(q!==null&&q===y)break;z.tag===5&&ie!==null&&(z=ie,E?(q=cs(p,P),q!=null&&L.unshift(Qd(p,q,z))):E||(q=cs(p,P),q!=null&&L.push(Qd(p,q,z)))),p=p.return}L.length!==0&&a.push({event:c,listeners:L})}var s7=/\r\n?/g,i7=/\u0000|\uFFFD/g;function C6(a){return(typeof a=="string"?a:""+a).replace(s7,`
40
+ `).replace(i7,"")}function Ip(a,c,p){if(c=C6(c),C6(a)!==c&&p)throw Error(n(425))}function Op(){}var Kv=null,Yv=null;function Xv(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 Qv=typeof setTimeout=="function"?setTimeout:void 0,o7=typeof clearTimeout=="function"?clearTimeout:void 0,P6=typeof Promise=="function"?Promise:void 0,a7=typeof queueMicrotask=="function"?queueMicrotask:typeof P6<"u"?function(a){return P6.resolve(null).then(a).catch(l7)}:Qv;function l7(a){setTimeout(function(){throw a})}function Jv(a,c){var p=c,y=0;do{var E=p.nextSibling;if(a.removeChild(p),E&&E.nodeType===8)if(p=E.data,p==="/$"){if(y===0){a.removeChild(E),sn(c);return}y--}else p!=="$"&&p!=="$?"&&p!=="$!"||y++;p=E}while(p);sn(c)}function aa(a){for(;a!=null;a=a.nextSibling){var c=a.nodeType;if(c===1||c===3)break;if(c===8){if(c=a.data,c==="$"||c==="$!"||c==="$?")break;if(c==="/$")return null}}return a}function A6(a){a=a.previousSibling;for(var c=0;a;){if(a.nodeType===8){var p=a.data;if(p==="$"||p==="$!"||p==="$?"){if(c===0)return a;c--}else p==="/$"&&c++}a=a.previousSibling}return null}var Bc=Math.random().toString(36).slice(2),Pi="__reactFiber$"+Bc,Jd="__reactProps$"+Bc,fo="__reactContainer$"+Bc,e1="__reactEvents$"+Bc,c7="__reactListeners$"+Bc,u7="__reactHandles$"+Bc;function vl(a){var c=a[Pi];if(c)return c;for(var p=a.parentNode;p;){if(c=p[fo]||p[Pi]){if(p=c.alternate,c.child!==null||p!==null&&p.child!==null)for(a=A6(a);a!==null;){if(p=a[Pi])return p;a=A6(a)}return c}a=p,p=a.parentNode}return null}function ef(a){return a=a[Pi]||a[fo],!a||a.tag!==5&&a.tag!==6&&a.tag!==13&&a.tag!==3?null:a}function Zc(a){if(a.tag===5||a.tag===6)return a.stateNode;throw Error(n(33))}function Lp(a){return a[Jd]||null}var t1=[],Wc=-1;function la(a){return{current:a}}function an(a){0>Wc||(a.current=t1[Wc],t1[Wc]=null,Wc--)}function nn(a,c){Wc++,t1[Wc]=a.current,a.current=c}var ca={},wr=la(ca),zr=la(!1),yl=ca;function qc(a,c){var p=a.type.contextTypes;if(!p)return ca;var y=a.stateNode;if(y&&y.__reactInternalMemoizedUnmaskedChildContext===c)return y.__reactInternalMemoizedMaskedChildContext;var E={},P;for(P in p)E[P]=c[P];return y&&(a=a.stateNode,a.__reactInternalMemoizedUnmaskedChildContext=c,a.__reactInternalMemoizedMaskedChildContext=E),E}function Ur(a){return a=a.childContextTypes,a!=null}function Np(){an(zr),an(wr)}function T6(a,c,p){if(wr.current!==ca)throw Error(n(168));nn(wr,c),nn(zr,p)}function R6(a,c,p){var y=a.stateNode;if(c=c.childContextTypes,typeof y.getChildContext!="function")return p;y=y.getChildContext();for(var E in y)if(!(E in c))throw Error(n(108,ve(a)||"Unknown",E));return Z({},p,y)}function Dp(a){return a=(a=a.stateNode)&&a.__reactInternalMemoizedMergedChildContext||ca,yl=wr.current,nn(wr,a),nn(zr,zr.current),!0}function M6(a,c,p){var y=a.stateNode;if(!y)throw Error(n(169));p?(a=R6(a,c,yl),y.__reactInternalMemoizedMergedChildContext=a,an(zr),an(wr),nn(wr,a)):an(zr),nn(zr,p)}var ho=null,jp=!1,n1=!1;function I6(a){ho===null?ho=[a]:ho.push(a)}function d7(a){jp=!0,I6(a)}function ua(){if(!n1&&ho!==null){n1=!0;var a=0,c=Ft;try{var p=ho;for(Ft=1;a<p.length;a++){var y=p[a];do y=y(!0);while(y!==null)}ho=null,jp=!1}catch(E){throw ho!==null&&(ho=ho.slice(a+1)),Ic(Nd,ua),E}finally{Ft=c,n1=!1}}return null}var Gc=[],Kc=0,$p=null,Fp=0,js=[],$s=0,_l=null,po=1,mo="";function wl(a,c){Gc[Kc++]=Fp,Gc[Kc++]=$p,$p=a,Fp=c}function O6(a,c,p){js[$s++]=po,js[$s++]=mo,js[$s++]=_l,_l=a;var y=po;a=mo;var E=32-us(y)-1;y&=~(1<<E),p+=1;var P=32-us(c)+E;if(30<P){var L=E-E%5;P=(y&(1<<L)-1).toString(32),y>>=L,E-=L,po=1<<32-us(c)+E|p<<E|y,mo=P+a}else po=1<<P|p<<E|y,mo=a}function r1(a){a.return!==null&&(wl(a,1),O6(a,1,0))}function s1(a){for(;a===$p;)$p=Gc[--Kc],Gc[Kc]=null,Fp=Gc[--Kc],Gc[Kc]=null;for(;a===_l;)_l=js[--$s],js[$s]=null,mo=js[--$s],js[$s]=null,po=js[--$s],js[$s]=null}var ms=null,gs=null,fn=!1,oi=null;function L6(a,c){var p=zs(5,null,null,0);p.elementType="DELETED",p.stateNode=c,p.return=a,c=a.deletions,c===null?(a.deletions=[p],a.flags|=16):c.push(p)}function N6(a,c){switch(a.tag){case 5:var p=a.type;return c=c.nodeType!==1||p.toLowerCase()!==c.nodeName.toLowerCase()?null:c,c!==null?(a.stateNode=c,ms=a,gs=aa(c.firstChild),!0):!1;case 6:return c=a.pendingProps===""||c.nodeType!==3?null:c,c!==null?(a.stateNode=c,ms=a,gs=null,!0):!1;case 13:return c=c.nodeType!==8?null:c,c!==null?(p=_l!==null?{id:po,overflow:mo}:null,a.memoizedState={dehydrated:c,treeContext:p,retryLane:1073741824},p=zs(18,null,null,0),p.stateNode=c,p.return=a,a.child=p,ms=a,gs=null,!0):!1;default:return!1}}function i1(a){return(a.mode&1)!==0&&(a.flags&128)===0}function o1(a){if(fn){var c=gs;if(c){var p=c;if(!N6(a,c)){if(i1(a))throw Error(n(418));c=aa(p.nextSibling);var y=ms;c&&N6(a,c)?L6(y,p):(a.flags=a.flags&-4097|2,fn=!1,ms=a)}}else{if(i1(a))throw Error(n(418));a.flags=a.flags&-4097|2,fn=!1,ms=a}}}function D6(a){for(a=a.return;a!==null&&a.tag!==5&&a.tag!==3&&a.tag!==13;)a=a.return;ms=a}function Vp(a){if(a!==ms)return!1;if(!fn)return D6(a),fn=!0,!1;var c;if((c=a.tag!==3)&&!(c=a.tag!==5)&&(c=a.type,c=c!=="head"&&c!=="body"&&!Xv(a.type,a.memoizedProps)),c&&(c=gs)){if(i1(a))throw j6(),Error(n(418));for(;c;)L6(a,c),c=aa(c.nextSibling)}if(D6(a),a.tag===13){if(a=a.memoizedState,a=a!==null?a.dehydrated:null,!a)throw Error(n(317));e:{for(a=a.nextSibling,c=0;a;){if(a.nodeType===8){var p=a.data;if(p==="/$"){if(c===0){gs=aa(a.nextSibling);break e}c--}else p!=="$"&&p!=="$!"&&p!=="$?"||c++}a=a.nextSibling}gs=null}}else gs=ms?aa(a.stateNode.nextSibling):null;return!0}function j6(){for(var a=gs;a;)a=aa(a.nextSibling)}function Yc(){gs=ms=null,fn=!1}function a1(a){oi===null?oi=[a]:oi.push(a)}var f7=A.ReactCurrentBatchConfig;function tf(a,c,p){if(a=p.ref,a!==null&&typeof a!="function"&&typeof a!="object"){if(p._owner){if(p=p._owner,p){if(p.tag!==1)throw Error(n(309));var y=p.stateNode}if(!y)throw Error(n(147,a));var 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(!p._owner)throw Error(n(290,a))}return a}function Hp(a,c){throw a=Object.prototype.toString.call(c),Error(n(31,a==="[object Object]"?"object with keys {"+Object.keys(c).join(", ")+"}":a))}function $6(a){var c=a._init;return c(a._payload)}function F6(a){function c(te,X){if(a){var re=te.deletions;re===null?(te.deletions=[X],te.flags|=16):re.push(X)}}function p(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=ya(te,X),te.index=0,te.sibling=null,te}function P(te,X,re){return te.index=re,a?(re=te.alternate,re!==null?(re=re.index,re<X?(te.flags|=2,X):re):(te.flags|=2,X)):(te.flags|=1048576,X)}function L(te){return a&&te.alternate===null&&(te.flags|=2),te}function z(te,X,re,be){return X===null||X.tag!==6?(X=Q1(re,te.mode,be),X.return=te,X):(X=E(X,re),X.return=te,X)}function q(te,X,re,be){var Be=re.type;return Be===M?ge(te,X,re.props.children,be,re.key):X!==null&&(X.elementType===Be||typeof Be=="object"&&Be!==null&&Be.$$typeof===H&&$6(Be)===X.type)?(be=E(X,re.props),be.ref=tf(te,X,re),be.return=te,be):(be=d0(re.type,re.key,re.props,null,te.mode,be),be.ref=tf(te,X,re),be.return=te,be)}function ie(te,X,re,be){return X===null||X.tag!==4||X.stateNode.containerInfo!==re.containerInfo||X.stateNode.implementation!==re.implementation?(X=J1(re,te.mode,be),X.return=te,X):(X=E(X,re.children||[]),X.return=te,X)}function ge(te,X,re,be,Be){return X===null||X.tag!==7?(X=Al(re,te.mode,be,Be),X.return=te,X):(X=E(X,re),X.return=te,X)}function _e(te,X,re){if(typeof X=="string"&&X!==""||typeof X=="number")return X=Q1(""+X,te.mode,re),X.return=te,X;if(typeof X=="object"&&X!==null){switch(X.$$typeof){case T:return re=d0(X.type,X.key,X.props,null,te.mode,re),re.ref=tf(te,null,X),re.return=te,re;case I:return X=J1(X,te.mode,re),X.return=te,X;case H:var be=X._init;return _e(te,be(X._payload),re)}if(Ct(X)||J(X))return X=Al(X,te.mode,re,null),X.return=te,X;Hp(te,X)}return null}function me(te,X,re,be){var Be=X!==null?X.key:null;if(typeof re=="string"&&re!==""||typeof re=="number")return Be!==null?null:z(te,X,""+re,be);if(typeof re=="object"&&re!==null){switch(re.$$typeof){case T:return re.key===Be?q(te,X,re,be):null;case I:return re.key===Be?ie(te,X,re,be):null;case H:return Be=re._init,me(te,X,Be(re._payload),be)}if(Ct(re)||J(re))return Be!==null?null:ge(te,X,re,be,null);Hp(te,re)}return null}function Me(te,X,re,be,Be){if(typeof be=="string"&&be!==""||typeof be=="number")return te=te.get(re)||null,z(X,te,""+be,Be);if(typeof be=="object"&&be!==null){switch(be.$$typeof){case T:return te=te.get(be.key===null?re:be.key)||null,q(X,te,be,Be);case I:return te=te.get(be.key===null?re:be.key)||null,ie(X,te,be,Be);case H:var tt=be._init;return Me(te,X,re,tt(be._payload),Be)}if(Ct(be)||J(be))return te=te.get(re)||null,ge(X,te,be,Be,null);Hp(X,be)}return null}function Fe(te,X,re,be){for(var Be=null,tt=null,nt=X,ot=X=0,sr=null;nt!==null&&ot<re.length;ot++){nt.index>ot?(sr=nt,nt=null):sr=nt.sibling;var Dt=me(te,nt,re[ot],be);if(Dt===null){nt===null&&(nt=sr);break}a&&nt&&Dt.alternate===null&&c(te,nt),X=P(Dt,X,ot),tt===null?Be=Dt:tt.sibling=Dt,tt=Dt,nt=sr}if(ot===re.length)return p(te,nt),fn&&wl(te,ot),Be;if(nt===null){for(;ot<re.length;ot++)nt=_e(te,re[ot],be),nt!==null&&(X=P(nt,X,ot),tt===null?Be=nt:tt.sibling=nt,tt=nt);return fn&&wl(te,ot),Be}for(nt=y(te,nt);ot<re.length;ot++)sr=Me(nt,te,ot,re[ot],be),sr!==null&&(a&&sr.alternate!==null&&nt.delete(sr.key===null?ot:sr.key),X=P(sr,X,ot),tt===null?Be=sr:tt.sibling=sr,tt=sr);return a&&nt.forEach(function(_a){return c(te,_a)}),fn&&wl(te,ot),Be}function He(te,X,re,be){var Be=J(re);if(typeof Be!="function")throw Error(n(150));if(re=Be.call(re),re==null)throw Error(n(151));for(var tt=Be=null,nt=X,ot=X=0,sr=null,Dt=re.next();nt!==null&&!Dt.done;ot++,Dt=re.next()){nt.index>ot?(sr=nt,nt=null):sr=nt.sibling;var _a=me(te,nt,Dt.value,be);if(_a===null){nt===null&&(nt=sr);break}a&&nt&&_a.alternate===null&&c(te,nt),X=P(_a,X,ot),tt===null?Be=_a:tt.sibling=_a,tt=_a,nt=sr}if(Dt.done)return p(te,nt),fn&&wl(te,ot),Be;if(nt===null){for(;!Dt.done;ot++,Dt=re.next())Dt=_e(te,Dt.value,be),Dt!==null&&(X=P(Dt,X,ot),tt===null?Be=Dt:tt.sibling=Dt,tt=Dt);return fn&&wl(te,ot),Be}for(nt=y(te,nt);!Dt.done;ot++,Dt=re.next())Dt=Me(nt,te,ot,Dt.value,be),Dt!==null&&(a&&Dt.alternate!==null&&nt.delete(Dt.key===null?ot:Dt.key),X=P(Dt,X,ot),tt===null?Be=Dt:tt.sibling=Dt,tt=Dt);return a&&nt.forEach(function(Z7){return c(te,Z7)}),fn&&wl(te,ot),Be}function Mn(te,X,re,be){if(typeof re=="object"&&re!==null&&re.type===M&&re.key===null&&(re=re.props.children),typeof re=="object"&&re!==null){switch(re.$$typeof){case T:e:{for(var Be=re.key,tt=X;tt!==null;){if(tt.key===Be){if(Be=re.type,Be===M){if(tt.tag===7){p(te,tt.sibling),X=E(tt,re.props.children),X.return=te,te=X;break e}}else if(tt.elementType===Be||typeof Be=="object"&&Be!==null&&Be.$$typeof===H&&$6(Be)===tt.type){p(te,tt.sibling),X=E(tt,re.props),X.ref=tf(te,tt,re),X.return=te,te=X;break e}p(te,tt);break}else c(te,tt);tt=tt.sibling}re.type===M?(X=Al(re.props.children,te.mode,be,re.key),X.return=te,te=X):(be=d0(re.type,re.key,re.props,null,te.mode,be),be.ref=tf(te,X,re),be.return=te,te=be)}return L(te);case I:e:{for(tt=re.key;X!==null;){if(X.key===tt)if(X.tag===4&&X.stateNode.containerInfo===re.containerInfo&&X.stateNode.implementation===re.implementation){p(te,X.sibling),X=E(X,re.children||[]),X.return=te,te=X;break e}else{p(te,X);break}else c(te,X);X=X.sibling}X=J1(re,te.mode,be),X.return=te,te=X}return L(te);case H:return tt=re._init,Mn(te,X,tt(re._payload),be)}if(Ct(re))return Fe(te,X,re,be);if(J(re))return He(te,X,re,be);Hp(te,re)}return typeof re=="string"&&re!==""||typeof re=="number"?(re=""+re,X!==null&&X.tag===6?(p(te,X.sibling),X=E(X,re),X.return=te,te=X):(p(te,X),X=Q1(re,te.mode,be),X.return=te,te=X),L(te)):p(te,X)}return Mn}var Xc=F6(!0),V6=F6(!1),zp=la(null),Up=null,Qc=null,l1=null;function c1(){l1=Qc=Up=null}function u1(a){var c=zp.current;an(zp),a._currentValue=c}function d1(a,c,p){for(;a!==null;){var y=a.alternate;if((a.childLanes&c)!==c?(a.childLanes|=c,y!==null&&(y.childLanes|=c)):y!==null&&(y.childLanes&c)!==c&&(y.childLanes|=c),a===p)break;a=a.return}}function Jc(a,c){Up=a,l1=Qc=null,a=a.dependencies,a!==null&&a.firstContext!==null&&((a.lanes&c)!==0&&(Br=!0),a.firstContext=null)}function Fs(a){var c=a._currentValue;if(l1!==a)if(a={context:a,memoizedValue:c,next:null},Qc===null){if(Up===null)throw Error(n(308));Qc=a,Up.dependencies={lanes:0,firstContext:a}}else Qc=Qc.next=a;return c}var xl=null;function f1(a){xl===null?xl=[a]:xl.push(a)}function H6(a,c,p,y){var E=c.interleaved;return E===null?(p.next=p,f1(c)):(p.next=E.next,E.next=p),c.interleaved=p,go(a,y)}function go(a,c){a.lanes|=c;var p=a.alternate;for(p!==null&&(p.lanes|=c),p=a,a=a.return;a!==null;)a.childLanes|=c,p=a.alternate,p!==null&&(p.childLanes|=c),p=a,a=a.return;return p.tag===3?p.stateNode:null}var da=!1;function h1(a){a.updateQueue={baseState:a.memoizedState,firstBaseUpdate:null,lastBaseUpdate:null,shared:{pending:null,interleaved:null,lanes:0},effects:null}}function z6(a,c){a=a.updateQueue,c.updateQueue===a&&(c.updateQueue={baseState:a.baseState,firstBaseUpdate:a.firstBaseUpdate,lastBaseUpdate:a.lastBaseUpdate,shared:a.shared,effects:a.effects})}function vo(a,c){return{eventTime:a,lane:c,tag:0,payload:null,callback:null,next:null}}function fa(a,c,p){var y=a.updateQueue;if(y===null)return null;if(y=y.shared,(Rt&2)!==0){var E=y.pending;return E===null?c.next=c:(c.next=E.next,E.next=c),y.pending=c,go(a,p)}return E=y.interleaved,E===null?(c.next=c,f1(y)):(c.next=E.next,E.next=c),y.interleaved=c,go(a,p)}function Bp(a,c,p){if(c=c.updateQueue,c!==null&&(c=c.shared,(p&4194240)!==0)){var y=c.lanes;y&=a.pendingLanes,p|=y,c.lanes=p,Hd(a,p)}}function U6(a,c){var p=a.updateQueue,y=a.alternate;if(y!==null&&(y=y.updateQueue,p===y)){var E=null,P=null;if(p=p.firstBaseUpdate,p!==null){do{var L={eventTime:p.eventTime,lane:p.lane,tag:p.tag,payload:p.payload,callback:p.callback,next:null};P===null?E=P=L:P=P.next=L,p=p.next}while(p!==null);P===null?E=P=c:P=P.next=c}else E=P=c;p={baseState:y.baseState,firstBaseUpdate:E,lastBaseUpdate:P,shared:y.shared,effects:y.effects},a.updateQueue=p;return}a=p.lastBaseUpdate,a===null?p.firstBaseUpdate=c:a.next=c,p.lastBaseUpdate=c}function Zp(a,c,p,y){var E=a.updateQueue;da=!1;var P=E.firstBaseUpdate,L=E.lastBaseUpdate,z=E.shared.pending;if(z!==null){E.shared.pending=null;var q=z,ie=q.next;q.next=null,L===null?P=ie:L.next=ie,L=q;var ge=a.alternate;ge!==null&&(ge=ge.updateQueue,z=ge.lastBaseUpdate,z!==L&&(z===null?ge.firstBaseUpdate=ie:z.next=ie,ge.lastBaseUpdate=q))}if(P!==null){var _e=E.baseState;L=0,ge=ie=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=p,He.tag){case 1:if(Fe=He.payload,typeof Fe=="function"){_e=Fe.call(Me,_e,me);break e}_e=Fe;break e;case 3:Fe.flags=Fe.flags&-65537|128;case 0:if(Fe=He.payload,me=typeof Fe=="function"?Fe.call(Me,_e,me):Fe,me==null)break e;_e=Z({},_e,me);break e;case 2:da=!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?(ie=ge=Me,q=_e):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=_e),E.baseState=q,E.firstBaseUpdate=ie,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);kl|=L,a.lanes=L,a.memoizedState=_e}}function B6(a,c,p){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=p,typeof E!="function")throw Error(n(191,E));E.call(y)}}}var nf={},Ai=la(nf),rf=la(nf),sf=la(nf);function bl(a){if(a===nf)throw Error(n(174));return a}function p1(a,c){switch(nn(sf,c),nn(rf,a),nn(Ai,nf),a=c.nodeType,a){case 9:case 11:c=(c=c.documentElement)?c.namespaceURI:yr(null,"");break;default:a=a===8?c.parentNode:c,c=a.namespaceURI||null,a=a.tagName,c=yr(c,a)}an(Ai),nn(Ai,c)}function eu(){an(Ai),an(rf),an(sf)}function Z6(a){bl(sf.current);var c=bl(Ai.current),p=yr(c,a.type);c!==p&&(nn(rf,a),nn(Ai,p))}function m1(a){rf.current===a&&(an(Ai),an(rf))}var _n=la(0);function Wp(a){for(var c=a;c!==null;){if(c.tag===13){var p=c.memoizedState;if(p!==null&&(p=p.dehydrated,p===null||p.data==="$?"||p.data==="$!"))return c}else if(c.tag===19&&c.memoizedProps.revealOrder!==void 0){if((c.flags&128)!==0)return c}else if(c.child!==null){c.child.return=c,c=c.child;continue}if(c===a)break;for(;c.sibling===null;){if(c.return===null||c.return===a)return null;c=c.return}c.sibling.return=c.return,c=c.sibling}return null}var g1=[];function v1(){for(var a=0;a<g1.length;a++)g1[a]._workInProgressVersionPrimary=null;g1.length=0}var qp=A.ReactCurrentDispatcher,y1=A.ReactCurrentBatchConfig,Sl=0,wn=null,qn=null,nr=null,Gp=!1,of=!1,af=0,h7=0;function xr(){throw Error(n(321))}function _1(a,c){if(c===null)return!1;for(var p=0;p<c.length&&p<a.length;p++)if(!ii(a[p],c[p]))return!1;return!0}function w1(a,c,p,y,E,P){if(Sl=P,wn=c,c.memoizedState=null,c.updateQueue=null,c.lanes=0,qp.current=a===null||a.memoizedState===null?v7:y7,a=p(y,E),of){P=0;do{if(of=!1,af=0,25<=P)throw Error(n(301));P+=1,nr=qn=null,c.updateQueue=null,qp.current=_7,a=p(y,E)}while(of)}if(qp.current=Xp,c=qn!==null&&qn.next!==null,Sl=0,nr=qn=wn=null,Gp=!1,c)throw Error(n(300));return a}function x1(){var a=af!==0;return af=0,a}function Ti(){var a={memoizedState:null,baseState:null,baseQueue:null,queue:null,next:null};return nr===null?wn.memoizedState=nr=a:nr=nr.next=a,nr}function Vs(){if(qn===null){var a=wn.alternate;a=a!==null?a.memoizedState:null}else a=qn.next;var c=nr===null?wn.memoizedState:nr.next;if(c!==null)nr=c,qn=a;else{if(a===null)throw Error(n(310));qn=a,a={memoizedState:qn.memoizedState,baseState:qn.baseState,baseQueue:qn.baseQueue,queue:qn.queue,next:null},nr===null?wn.memoizedState=nr=a:nr=nr.next=a}return nr}function lf(a,c){return typeof c=="function"?c(a):c}function b1(a){var c=Vs(),p=c.queue;if(p===null)throw Error(n(311));p.lastRenderedReducer=a;var y=qn,E=y.baseQueue,P=p.pending;if(P!==null){if(E!==null){var L=E.next;E.next=P.next,P.next=L}y.baseQueue=E=P,p.pending=null}if(E!==null){P=E.next,y=y.baseState;var z=L=null,q=null,ie=P;do{var ge=ie.lane;if((Sl&ge)===ge)q!==null&&(q=q.next={lane:0,action:ie.action,hasEagerState:ie.hasEagerState,eagerState:ie.eagerState,next:null}),y=ie.hasEagerState?ie.eagerState:a(y,ie.action);else{var _e={lane:ge,action:ie.action,hasEagerState:ie.hasEagerState,eagerState:ie.eagerState,next:null};q===null?(z=q=_e,L=y):q=q.next=_e,wn.lanes|=ge,kl|=ge}ie=ie.next}while(ie!==null&&ie!==P);q===null?L=y:q.next=z,ii(y,c.memoizedState)||(Br=!0),c.memoizedState=y,c.baseState=L,c.baseQueue=q,p.lastRenderedState=y}if(a=p.interleaved,a!==null){E=a;do P=E.lane,wn.lanes|=P,kl|=P,E=E.next;while(E!==a)}else E===null&&(p.lanes=0);return[c.memoizedState,p.dispatch]}function S1(a){var c=Vs(),p=c.queue;if(p===null)throw Error(n(311));p.lastRenderedReducer=a;var y=p.dispatch,E=p.pending,P=c.memoizedState;if(E!==null){p.pending=null;var L=E=E.next;do P=a(P,L.action),L=L.next;while(L!==E);ii(P,c.memoizedState)||(Br=!0),c.memoizedState=P,c.baseQueue===null&&(c.baseState=P),p.lastRenderedState=P}return[P,y]}function W6(){}function q6(a,c){var p=wn,y=Vs(),E=c(),P=!ii(y.memoizedState,E);if(P&&(y.memoizedState=E,Br=!0),y=y.queue,k1(Y6.bind(null,p,y,a),[a]),y.getSnapshot!==c||P||nr!==null&&nr.memoizedState.tag&1){if(p.flags|=2048,cf(9,K6.bind(null,p,y,E,c),void 0,null),rr===null)throw Error(n(349));(Sl&30)!==0||G6(p,c,E)}return E}function G6(a,c,p){a.flags|=16384,a={getSnapshot:c,value:p},c=wn.updateQueue,c===null?(c={lastEffect:null,stores:null},wn.updateQueue=c,c.stores=[a]):(p=c.stores,p===null?c.stores=[a]:p.push(a))}function K6(a,c,p,y){c.value=p,c.getSnapshot=y,X6(c)&&Q6(a)}function Y6(a,c,p){return p(function(){X6(c)&&Q6(a)})}function X6(a){var c=a.getSnapshot;a=a.value;try{var p=c();return!ii(a,p)}catch{return!0}}function Q6(a){var c=go(a,1);c!==null&&ui(c,a,1,-1)}function J6(a){var c=Ti();return typeof a=="function"&&(a=a()),c.memoizedState=c.baseState=a,a={pending:null,interleaved:null,lanes:0,dispatch:null,lastRenderedReducer:lf,lastRenderedState:a},c.queue=a,a=a.dispatch=g7.bind(null,wn,a),[c.memoizedState,a]}function cf(a,c,p,y){return a={tag:a,create:c,destroy:p,deps:y,next:null},c=wn.updateQueue,c===null?(c={lastEffect:null,stores:null},wn.updateQueue=c,c.lastEffect=a.next=a):(p=c.lastEffect,p===null?c.lastEffect=a.next=a:(y=p.next,p.next=a,a.next=y,c.lastEffect=a)),a}function eS(){return Vs().memoizedState}function Kp(a,c,p,y){var E=Ti();wn.flags|=a,E.memoizedState=cf(1|c,p,void 0,y===void 0?null:y)}function Yp(a,c,p,y){var E=Vs();y=y===void 0?null:y;var P=void 0;if(qn!==null){var L=qn.memoizedState;if(P=L.destroy,y!==null&&_1(y,L.deps)){E.memoizedState=cf(c,p,P,y);return}}wn.flags|=a,E.memoizedState=cf(1|c,p,P,y)}function tS(a,c){return Kp(8390656,8,a,c)}function k1(a,c){return Yp(2048,8,a,c)}function nS(a,c){return Yp(4,2,a,c)}function rS(a,c){return Yp(4,4,a,c)}function sS(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 iS(a,c,p){return p=p!=null?p.concat([a]):null,Yp(4,4,sS.bind(null,c,a),p)}function E1(){}function oS(a,c){var p=Vs();c=c===void 0?null:c;var y=p.memoizedState;return y!==null&&c!==null&&_1(c,y[1])?y[0]:(p.memoizedState=[a,c],a)}function aS(a,c){var p=Vs();c=c===void 0?null:c;var y=p.memoizedState;return y!==null&&c!==null&&_1(c,y[1])?y[0]:(a=a(),p.memoizedState=[a,c],a)}function lS(a,c,p){return(Sl&21)===0?(a.baseState&&(a.baseState=!1,Br=!0),a.memoizedState=p):(ii(p,c)||(p=vp(),wn.lanes|=p,kl|=p,a.baseState=!0),c)}function p7(a,c){var p=Ft;Ft=p!==0&&4>p?p:4,a(!0);var y=y1.transition;y1.transition={};try{a(!1),c()}finally{Ft=p,y1.transition=y}}function cS(){return Vs().memoizedState}function m7(a,c,p){var y=ga(a);if(p={lane:y,action:p,hasEagerState:!1,eagerState:null,next:null},uS(a))dS(c,p);else if(p=H6(a,c,p,y),p!==null){var E=Mr();ui(p,a,y,E),fS(p,c,y)}}function g7(a,c,p){var y=ga(a),E={lane:y,action:p,hasEagerState:!1,eagerState:null,next:null};if(uS(a))dS(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,p);if(E.hasEagerState=!0,E.eagerState=z,ii(z,L)){var q=c.interleaved;q===null?(E.next=E,f1(c)):(E.next=q.next,q.next=E),c.interleaved=E;return}}catch{}finally{}p=H6(a,c,E,y),p!==null&&(E=Mr(),ui(p,a,y,E),fS(p,c,y))}}function uS(a){var c=a.alternate;return a===wn||c!==null&&c===wn}function dS(a,c){of=Gp=!0;var p=a.pending;p===null?c.next=c:(c.next=p.next,p.next=c),a.pending=c}function fS(a,c,p){if((p&4194240)!==0){var y=c.lanes;y&=a.pendingLanes,p|=y,c.lanes=p,Hd(a,p)}}var Xp={readContext:Fs,useCallback:xr,useContext:xr,useEffect:xr,useImperativeHandle:xr,useInsertionEffect:xr,useLayoutEffect:xr,useMemo:xr,useReducer:xr,useRef:xr,useState:xr,useDebugValue:xr,useDeferredValue:xr,useTransition:xr,useMutableSource:xr,useSyncExternalStore:xr,useId:xr,unstable_isNewReconciler:!1},v7={readContext:Fs,useCallback:function(a,c){return Ti().memoizedState=[a,c===void 0?null:c],a},useContext:Fs,useEffect:tS,useImperativeHandle:function(a,c,p){return p=p!=null?p.concat([a]):null,Kp(4194308,4,sS.bind(null,c,a),p)},useLayoutEffect:function(a,c){return Kp(4194308,4,a,c)},useInsertionEffect:function(a,c){return Kp(4,2,a,c)},useMemo:function(a,c){var p=Ti();return c=c===void 0?null:c,a=a(),p.memoizedState=[a,c],a},useReducer:function(a,c,p){var y=Ti();return c=p!==void 0?p(c):c,y.memoizedState=y.baseState=c,a={pending:null,interleaved:null,lanes:0,dispatch:null,lastRenderedReducer:a,lastRenderedState:c},y.queue=a,a=a.dispatch=m7.bind(null,wn,a),[y.memoizedState,a]},useRef:function(a){var c=Ti();return a={current:a},c.memoizedState=a},useState:J6,useDebugValue:E1,useDeferredValue:function(a){return Ti().memoizedState=a},useTransition:function(){var a=J6(!1),c=a[0];return a=p7.bind(null,a[1]),Ti().memoizedState=a,[c,a]},useMutableSource:function(){},useSyncExternalStore:function(a,c,p){var y=wn,E=Ti();if(fn){if(p===void 0)throw Error(n(407));p=p()}else{if(p=c(),rr===null)throw Error(n(349));(Sl&30)!==0||G6(y,c,p)}E.memoizedState=p;var P={value:p,getSnapshot:c};return E.queue=P,tS(Y6.bind(null,y,P,a),[a]),y.flags|=2048,cf(9,K6.bind(null,y,P,p,c),void 0,null),p},useId:function(){var a=Ti(),c=rr.identifierPrefix;if(fn){var p=mo,y=po;p=(y&~(1<<32-us(y)-1)).toString(32)+p,c=":"+c+"R"+p,p=af++,0<p&&(c+="H"+p.toString(32)),c+=":"}else p=h7++,c=":"+c+"r"+p.toString(32)+":";return a.memoizedState=c},unstable_isNewReconciler:!1},y7={readContext:Fs,useCallback:oS,useContext:Fs,useEffect:k1,useImperativeHandle:iS,useInsertionEffect:nS,useLayoutEffect:rS,useMemo:aS,useReducer:b1,useRef:eS,useState:function(){return b1(lf)},useDebugValue:E1,useDeferredValue:function(a){var c=Vs();return lS(c,qn.memoizedState,a)},useTransition:function(){var a=b1(lf)[0],c=Vs().memoizedState;return[a,c]},useMutableSource:W6,useSyncExternalStore:q6,useId:cS,unstable_isNewReconciler:!1},_7={readContext:Fs,useCallback:oS,useContext:Fs,useEffect:k1,useImperativeHandle:iS,useInsertionEffect:nS,useLayoutEffect:rS,useMemo:aS,useReducer:S1,useRef:eS,useState:function(){return S1(lf)},useDebugValue:E1,useDeferredValue:function(a){var c=Vs();return qn===null?c.memoizedState=a:lS(c,qn.memoizedState,a)},useTransition:function(){var a=S1(lf)[0],c=Vs().memoizedState;return[a,c]},useMutableSource:W6,useSyncExternalStore:q6,useId:cS,unstable_isNewReconciler:!1};function ai(a,c){if(a&&a.defaultProps){c=Z({},c),a=a.defaultProps;for(var p in a)c[p]===void 0&&(c[p]=a[p]);return c}return c}function C1(a,c,p,y){c=a.memoizedState,p=p(y,c),p=p==null?c:Z({},c,p),a.memoizedState=p,a.lanes===0&&(a.updateQueue.baseState=p)}var Qp={isMounted:function(a){return(a=a._reactInternals)?Ls(a)===a:!1},enqueueSetState:function(a,c,p){a=a._reactInternals;var y=Mr(),E=ga(a),P=vo(y,E);P.payload=c,p!=null&&(P.callback=p),c=fa(a,P,E),c!==null&&(ui(c,a,E,y),Bp(c,a,E))},enqueueReplaceState:function(a,c,p){a=a._reactInternals;var y=Mr(),E=ga(a),P=vo(y,E);P.tag=1,P.payload=c,p!=null&&(P.callback=p),c=fa(a,P,E),c!==null&&(ui(c,a,E,y),Bp(c,a,E))},enqueueForceUpdate:function(a,c){a=a._reactInternals;var p=Mr(),y=ga(a),E=vo(p,y);E.tag=2,c!=null&&(E.callback=c),c=fa(a,E,y),c!==null&&(ui(c,a,y,p),Bp(c,a,y))}};function hS(a,c,p,y,E,P,L){return a=a.stateNode,typeof a.shouldComponentUpdate=="function"?a.shouldComponentUpdate(y,P,L):c.prototype&&c.prototype.isPureReactComponent?!Gd(p,y)||!Gd(E,P):!0}function pS(a,c,p){var y=!1,E=ca,P=c.contextType;return typeof P=="object"&&P!==null?P=Fs(P):(E=Ur(c)?yl:wr.current,y=c.contextTypes,P=(y=y!=null)?qc(a,E):ca),c=new c(p,P),a.memoizedState=c.state!==null&&c.state!==void 0?c.state:null,c.updater=Qp,a.stateNode=c,c._reactInternals=a,y&&(a=a.stateNode,a.__reactInternalMemoizedUnmaskedChildContext=E,a.__reactInternalMemoizedMaskedChildContext=P),c}function mS(a,c,p,y){a=c.state,typeof c.componentWillReceiveProps=="function"&&c.componentWillReceiveProps(p,y),typeof c.UNSAFE_componentWillReceiveProps=="function"&&c.UNSAFE_componentWillReceiveProps(p,y),c.state!==a&&Qp.enqueueReplaceState(c,c.state,null)}function P1(a,c,p,y){var E=a.stateNode;E.props=p,E.state=a.memoizedState,E.refs={},h1(a);var P=c.contextType;typeof P=="object"&&P!==null?E.context=Fs(P):(P=Ur(c)?yl:wr.current,E.context=qc(a,P)),E.state=a.memoizedState,P=c.getDerivedStateFromProps,typeof P=="function"&&(C1(a,c,P,p),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&&Qp.enqueueReplaceState(E,E.state,null),Zp(a,p,E,y),E.state=a.memoizedState),typeof E.componentDidMount=="function"&&(a.flags|=4194308)}function tu(a,c){try{var p="",y=c;do p+=se(y),y=y.return;while(y);var E=p}catch(P){E=`
41
+ Error generating stack: `+P.message+`
42
+ `+P.stack}return{value:a,source:c,stack:E,digest:null}}function A1(a,c,p){return{value:a,source:null,stack:p??null,digest:c??null}}function T1(a,c){try{console.error(c.value)}catch(p){setTimeout(function(){throw p})}}var w7=typeof WeakMap=="function"?WeakMap:Map;function gS(a,c,p){p=vo(-1,p),p.tag=3,p.payload={element:null};var y=c.value;return p.callback=function(){i0||(i0=!0,B1=y),T1(a,c)},p}function vS(a,c,p){p=vo(-1,p),p.tag=3;var y=a.type.getDerivedStateFromError;if(typeof y=="function"){var E=c.value;p.payload=function(){return y(E)},p.callback=function(){T1(a,c)}}var P=a.stateNode;return P!==null&&typeof P.componentDidCatch=="function"&&(p.callback=function(){T1(a,c),typeof y!="function"&&(pa===null?pa=new Set([this]):pa.add(this));var L=c.stack;this.componentDidCatch(c.value,{componentStack:L!==null?L:""})}),p}function yS(a,c,p){var y=a.pingCache;if(y===null){y=a.pingCache=new w7;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(p)||(E.add(p),a=L7.bind(null,a,c,p),c.then(a,a))}function _S(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 wS(a,c,p,y,E){return(a.mode&1)===0?(a===c?a.flags|=65536:(a.flags|=128,p.flags|=131072,p.flags&=-52805,p.tag===1&&(p.alternate===null?p.tag=17:(c=vo(-1,1),c.tag=2,fa(p,c,1))),p.lanes|=1),a):(a.flags|=65536,a.lanes=E,a)}var x7=A.ReactCurrentOwner,Br=!1;function Rr(a,c,p,y){c.child=a===null?V6(c,null,p,y):Xc(c,a.child,p,y)}function xS(a,c,p,y,E){p=p.render;var P=c.ref;return Jc(c,E),y=w1(a,c,p,y,P,E),p=x1(),a!==null&&!Br?(c.updateQueue=a.updateQueue,c.flags&=-2053,a.lanes&=~E,yo(a,c,E)):(fn&&p&&r1(c),c.flags|=1,Rr(a,c,y,E),c.child)}function bS(a,c,p,y,E){if(a===null){var P=p.type;return typeof P=="function"&&!X1(P)&&P.defaultProps===void 0&&p.compare===null&&p.defaultProps===void 0?(c.tag=15,c.type=P,SS(a,c,P,y,E)):(a=d0(p.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(p=p.compare,p=p!==null?p:Gd,p(L,y)&&a.ref===c.ref)return yo(a,c,E)}return c.flags|=1,a=ya(P,y),a.ref=c.ref,a.return=c,c.child=a}function SS(a,c,p,y,E){if(a!==null){var P=a.memoizedProps;if(Gd(P,y)&&a.ref===c.ref)if(Br=!1,c.pendingProps=y=P,(a.lanes&E)!==0)(a.flags&131072)!==0&&(Br=!0);else return c.lanes=a.lanes,yo(a,c,E)}return R1(a,c,p,y,E)}function kS(a,c,p){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},nn(ru,vs),vs|=p;else{if((p&1073741824)===0)return a=P!==null?P.baseLanes|p:p,c.lanes=c.childLanes=1073741824,c.memoizedState={baseLanes:a,cachePool:null,transitions:null},c.updateQueue=null,nn(ru,vs),vs|=a,null;c.memoizedState={baseLanes:0,cachePool:null,transitions:null},y=P!==null?P.baseLanes:p,nn(ru,vs),vs|=y}else P!==null?(y=P.baseLanes|p,c.memoizedState=null):y=p,nn(ru,vs),vs|=y;return Rr(a,c,E,p),c.child}function ES(a,c){var p=c.ref;(a===null&&p!==null||a!==null&&a.ref!==p)&&(c.flags|=512,c.flags|=2097152)}function R1(a,c,p,y,E){var P=Ur(p)?yl:wr.current;return P=qc(c,P),Jc(c,E),p=w1(a,c,p,y,P,E),y=x1(),a!==null&&!Br?(c.updateQueue=a.updateQueue,c.flags&=-2053,a.lanes&=~E,yo(a,c,E)):(fn&&y&&r1(c),c.flags|=1,Rr(a,c,p,E),c.child)}function CS(a,c,p,y,E){if(Ur(p)){var P=!0;Dp(c)}else P=!1;if(Jc(c,E),c.stateNode===null)e0(a,c),pS(c,p,y),P1(c,p,y,E),y=!0;else if(a===null){var L=c.stateNode,z=c.memoizedProps;L.props=z;var q=L.context,ie=p.contextType;typeof ie=="object"&&ie!==null?ie=Fs(ie):(ie=Ur(p)?yl:wr.current,ie=qc(c,ie));var ge=p.getDerivedStateFromProps,_e=typeof ge=="function"||typeof L.getSnapshotBeforeUpdate=="function";_e||typeof L.UNSAFE_componentWillReceiveProps!="function"&&typeof L.componentWillReceiveProps!="function"||(z!==y||q!==ie)&&mS(c,L,y,ie),da=!1;var me=c.memoizedState;L.state=me,Zp(c,y,L,E),q=c.memoizedState,z!==y||me!==q||zr.current||da?(typeof ge=="function"&&(C1(c,p,ge,y),q=c.memoizedState),(z=da||hS(c,p,z,y,me,q,ie))?(_e||typeof L.UNSAFE_componentWillMount!="function"&&typeof L.componentWillMount!="function"||(typeof L.componentWillMount=="function"&&L.componentWillMount(),typeof L.UNSAFE_componentWillMount=="function"&&L.UNSAFE_componentWillMount()),typeof L.componentDidMount=="function"&&(c.flags|=4194308)):(typeof L.componentDidMount=="function"&&(c.flags|=4194308),c.memoizedProps=y,c.memoizedState=q),L.props=y,L.state=q,L.context=ie,y=z):(typeof L.componentDidMount=="function"&&(c.flags|=4194308),y=!1)}else{L=c.stateNode,z6(a,c),z=c.memoizedProps,ie=c.type===c.elementType?z:ai(c.type,z),L.props=ie,_e=c.pendingProps,me=L.context,q=p.contextType,typeof q=="object"&&q!==null?q=Fs(q):(q=Ur(p)?yl:wr.current,q=qc(c,q));var Me=p.getDerivedStateFromProps;(ge=typeof Me=="function"||typeof L.getSnapshotBeforeUpdate=="function")||typeof L.UNSAFE_componentWillReceiveProps!="function"&&typeof L.componentWillReceiveProps!="function"||(z!==_e||me!==q)&&mS(c,L,y,q),da=!1,me=c.memoizedState,L.state=me,Zp(c,y,L,E);var Fe=c.memoizedState;z!==_e||me!==Fe||zr.current||da?(typeof Me=="function"&&(C1(c,p,Me,y),Fe=c.memoizedState),(ie=da||hS(c,p,ie,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=ie):(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 M1(a,c,p,y,P,E)}function M1(a,c,p,y,E,P){ES(a,c);var L=(c.flags&128)!==0;if(!y&&!L)return E&&M6(c,p,!1),yo(a,c,P);y=c.stateNode,x7.current=c;var z=L&&typeof p.getDerivedStateFromError!="function"?null:y.render();return c.flags|=1,a!==null&&L?(c.child=Xc(c,a.child,null,P),c.child=Xc(c,null,z,P)):Rr(a,c,z,P),c.memoizedState=y.state,E&&M6(c,p,!0),c.child}function PS(a){var c=a.stateNode;c.pendingContext?T6(a,c.pendingContext,c.pendingContext!==c.context):c.context&&T6(a,c.context,!1),p1(a,c.containerInfo)}function AS(a,c,p,y,E){return Yc(),a1(E),c.flags|=256,Rr(a,c,p,y),c.child}var I1={dehydrated:null,treeContext:null,retryLane:0};function O1(a){return{baseLanes:a,cachePool:null,transitions:null}}function TS(a,c,p){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),nn(_n,E&1),a===null)return o1(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=f0(L,y,0,null),a=Al(a,y,p,null),P.return=c,a.return=c,P.sibling=a,c.child=P,c.child.memoizedState=O1(p),c.memoizedState=I1,a):L1(c,L));if(E=a.memoizedState,E!==null&&(z=E.dehydrated,z!==null))return b7(a,c,L,y,z,E,p);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=ya(E,q),y.subtreeFlags=E.subtreeFlags&14680064),z!==null?P=ya(z,P):(P=Al(P,L,p,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?O1(p):{baseLanes:L.baseLanes|p,cachePool:null,transitions:L.transitions},P.memoizedState=L,P.childLanes=a.childLanes&~p,c.memoizedState=I1,y}return P=a.child,a=P.sibling,y=ya(P,{mode:"visible",children:y.children}),(c.mode&1)===0&&(y.lanes=p),y.return=c,y.sibling=null,a!==null&&(p=c.deletions,p===null?(c.deletions=[a],c.flags|=16):p.push(a)),c.child=y,c.memoizedState=null,y}function L1(a,c){return c=f0({mode:"visible",children:c},a.mode,0,null),c.return=a,a.child=c}function Jp(a,c,p,y){return y!==null&&a1(y),Xc(c,a.child,null,p),a=L1(c,c.pendingProps.children),a.flags|=2,c.memoizedState=null,a}function b7(a,c,p,y,E,P,L){if(p)return c.flags&256?(c.flags&=-257,y=A1(Error(n(422))),Jp(a,c,L,y)):c.memoizedState!==null?(c.child=a.child,c.flags|=128,null):(P=y.fallback,E=c.mode,y=f0({mode:"visible",children:y.children},E,0,null),P=Al(P,E,L,null),P.flags|=2,y.return=c,P.return=c,y.sibling=P,c.child=y,(c.mode&1)!==0&&Xc(c,a.child,null,L),c.child.memoizedState=O1(L),c.memoizedState=I1,P);if((c.mode&1)===0)return Jp(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=A1(P,y,void 0),Jp(a,c,L,y)}if(z=(L&a.childLanes)!==0,Br||z){if(y=rr,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,go(a,E),ui(y,a,E,-1))}return Y1(),y=A1(Error(n(421))),Jp(a,c,L,y)}return E.data==="$?"?(c.flags|=128,c.child=a.child,c=N7.bind(null,a),E._reactRetry=c,null):(a=P.treeContext,gs=aa(E.nextSibling),ms=c,fn=!0,oi=null,a!==null&&(js[$s++]=po,js[$s++]=mo,js[$s++]=_l,po=a.id,mo=a.overflow,_l=c),c=L1(c,y.children),c.flags|=4096,c)}function RS(a,c,p){a.lanes|=c;var y=a.alternate;y!==null&&(y.lanes|=c),d1(a.return,c,p)}function N1(a,c,p,y,E){var P=a.memoizedState;P===null?a.memoizedState={isBackwards:c,rendering:null,renderingStartTime:0,last:y,tail:p,tailMode:E}:(P.isBackwards=c,P.rendering=null,P.renderingStartTime=0,P.last=y,P.tail=p,P.tailMode=E)}function MS(a,c,p){var y=c.pendingProps,E=y.revealOrder,P=y.tail;if(Rr(a,c,y.children,p),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&&RS(a,p,c);else if(a.tag===19)RS(a,p,c);else if(a.child!==null){a.child.return=a,a=a.child;continue}if(a===c)break e;for(;a.sibling===null;){if(a.return===null||a.return===c)break e;a=a.return}a.sibling.return=a.return,a=a.sibling}y&=1}if(nn(_n,y),(c.mode&1)===0)c.memoizedState=null;else switch(E){case"forwards":for(p=c.child,E=null;p!==null;)a=p.alternate,a!==null&&Wp(a)===null&&(E=p),p=p.sibling;p=E,p===null?(E=c.child,c.child=null):(E=p.sibling,p.sibling=null),N1(c,!1,E,p,P);break;case"backwards":for(p=null,E=c.child,c.child=null;E!==null;){if(a=E.alternate,a!==null&&Wp(a)===null){c.child=E;break}a=E.sibling,E.sibling=p,p=E,E=a}N1(c,!0,p,null,P);break;case"together":N1(c,!1,null,null,void 0);break;default:c.memoizedState=null}return c.child}function e0(a,c){(c.mode&1)===0&&a!==null&&(a.alternate=null,c.alternate=null,c.flags|=2)}function yo(a,c,p){if(a!==null&&(c.dependencies=a.dependencies),kl|=c.lanes,(p&c.childLanes)===0)return null;if(a!==null&&c.child!==a.child)throw Error(n(153));if(c.child!==null){for(a=c.child,p=ya(a,a.pendingProps),c.child=p,p.return=c;a.sibling!==null;)a=a.sibling,p=p.sibling=ya(a,a.pendingProps),p.return=c;p.sibling=null}return c.child}function S7(a,c,p){switch(c.tag){case 3:PS(c),Yc();break;case 5:Z6(c);break;case 1:Ur(c.type)&&Dp(c);break;case 4:p1(c,c.stateNode.containerInfo);break;case 10:var y=c.type._context,E=c.memoizedProps.value;nn(zp,y._currentValue),y._currentValue=E;break;case 13:if(y=c.memoizedState,y!==null)return y.dehydrated!==null?(nn(_n,_n.current&1),c.flags|=128,null):(p&c.child.childLanes)!==0?TS(a,c,p):(nn(_n,_n.current&1),a=yo(a,c,p),a!==null?a.sibling:null);nn(_n,_n.current&1);break;case 19:if(y=(p&c.childLanes)!==0,(a.flags&128)!==0){if(y)return MS(a,c,p);c.flags|=128}if(E=c.memoizedState,E!==null&&(E.rendering=null,E.tail=null,E.lastEffect=null),nn(_n,_n.current),y)break;return null;case 22:case 23:return c.lanes=0,kS(a,c,p)}return yo(a,c,p)}var IS,D1,OS,LS;IS=function(a,c){for(var p=c.child;p!==null;){if(p.tag===5||p.tag===6)a.appendChild(p.stateNode);else if(p.tag!==4&&p.child!==null){p.child.return=p,p=p.child;continue}if(p===c)break;for(;p.sibling===null;){if(p.return===null||p.return===c)return;p=p.return}p.sibling.return=p.return,p=p.sibling}},D1=function(){},OS=function(a,c,p,y){var E=a.memoizedProps;if(E!==y){a=c.stateNode,bl(Ai.current);var P=null;switch(p){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=Op)}Is(p,y);var L;p=null;for(ie in E)if(!y.hasOwnProperty(ie)&&E.hasOwnProperty(ie)&&E[ie]!=null)if(ie==="style"){var z=E[ie];for(L in z)z.hasOwnProperty(L)&&(p||(p={}),p[L]="")}else ie!=="dangerouslySetInnerHTML"&&ie!=="children"&&ie!=="suppressContentEditableWarning"&&ie!=="suppressHydrationWarning"&&ie!=="autoFocus"&&(s.hasOwnProperty(ie)?P||(P=[]):(P=P||[]).push(ie,null));for(ie in y){var q=y[ie];if(z=E!=null?E[ie]:void 0,y.hasOwnProperty(ie)&&q!==z&&(q!=null||z!=null))if(ie==="style")if(z){for(L in z)!z.hasOwnProperty(L)||q&&q.hasOwnProperty(L)||(p||(p={}),p[L]="");for(L in q)q.hasOwnProperty(L)&&z[L]!==q[L]&&(p||(p={}),p[L]=q[L])}else p||(P||(P=[]),P.push(ie,p)),p=q;else ie==="dangerouslySetInnerHTML"?(q=q?q.__html:void 0,z=z?z.__html:void 0,q!=null&&z!==q&&(P=P||[]).push(ie,q)):ie==="children"?typeof q!="string"&&typeof q!="number"||(P=P||[]).push(ie,""+q):ie!=="suppressContentEditableWarning"&&ie!=="suppressHydrationWarning"&&(s.hasOwnProperty(ie)?(q!=null&&ie==="onScroll"&&on("scroll",a),P||z===q||(P=[])):(P=P||[]).push(ie,q))}p&&(P=P||[]).push("style",p);var ie=P;(c.updateQueue=ie)&&(c.flags|=4)}},LS=function(a,c,p,y){p!==y&&(c.flags|=4)};function uf(a,c){if(!fn)switch(a.tailMode){case"hidden":c=a.tail;for(var p=null;c!==null;)c.alternate!==null&&(p=c),c=c.sibling;p===null?a.tail=null:p.sibling=null;break;case"collapsed":p=a.tail;for(var y=null;p!==null;)p.alternate!==null&&(y=p),p=p.sibling;y===null?c||a.tail===null?a.tail=null:a.tail.sibling=null:y.sibling=null}}function br(a){var c=a.alternate!==null&&a.alternate.child===a.child,p=0,y=0;if(c)for(var E=a.child;E!==null;)p|=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;)p|=E.lanes|E.childLanes,y|=E.subtreeFlags,y|=E.flags,E.return=a,E=E.sibling;return a.subtreeFlags|=y,a.childLanes=p,c}function k7(a,c,p){var y=c.pendingProps;switch(s1(c),c.tag){case 2:case 16:case 15:case 0:case 11:case 7:case 8:case 12:case 9:case 14:return br(c),null;case 1:return Ur(c.type)&&Np(),br(c),null;case 3:return y=c.stateNode,eu(),an(zr),an(wr),v1(),y.pendingContext&&(y.context=y.pendingContext,y.pendingContext=null),(a===null||a.child===null)&&(Vp(c)?c.flags|=4:a===null||a.memoizedState.isDehydrated&&(c.flags&256)===0||(c.flags|=1024,oi!==null&&(q1(oi),oi=null))),D1(a,c),br(c),null;case 5:m1(c);var E=bl(sf.current);if(p=c.type,a!==null&&c.stateNode!=null)OS(a,c,p,y,E),a.ref!==c.ref&&(c.flags|=512,c.flags|=2097152);else{if(!y){if(c.stateNode===null)throw Error(n(166));return br(c),null}if(a=bl(Ai.current),Vp(c)){y=c.stateNode,p=c.type;var P=c.memoizedProps;switch(y[Pi]=c,y[Jd]=P,a=(c.mode&1)!==0,p){case"dialog":on("cancel",y),on("close",y);break;case"iframe":case"object":case"embed":on("load",y);break;case"video":case"audio":for(E=0;E<Yd.length;E++)on(Yd[E],y);break;case"source":on("error",y);break;case"img":case"image":case"link":on("error",y),on("load",y);break;case"details":on("toggle",y);break;case"input":en(y,P),on("invalid",y);break;case"select":y._wrapperState={wasMultiple:!!P.multiple},on("invalid",y);break;case"textarea":Lt(y,P),on("invalid",y)}Is(p,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&&Ip(y.textContent,z,a),E=["children",z]):typeof z=="number"&&y.textContent!==""+z&&(P.suppressHydrationWarning!==!0&&Ip(y.textContent,z,a),E=["children",""+z]):s.hasOwnProperty(L)&&z!=null&&L==="onScroll"&&on("scroll",y)}switch(p){case"input":We(y),qe(y,P,!0);break;case"textarea":We(y),Pt(y);break;case"select":case"option":break;default:typeof P.onClick=="function"&&(y.onclick=Op)}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=as(p)),a==="http://www.w3.org/1999/xhtml"?p==="script"?(a=L.createElement("div"),a.innerHTML="<script><\/script>",a=a.removeChild(a.firstChild)):typeof y.is=="string"?a=L.createElement(p,{is:y.is}):(a=L.createElement(p),p==="select"&&(L=a,y.multiple?L.multiple=!0:y.size&&(L.size=y.size))):a=L.createElementNS(a,p),a[Pi]=c,a[Jd]=y,IS(a,c,!1,!1),c.stateNode=a;e:{switch(L=_r(p,y),p){case"dialog":on("cancel",a),on("close",a),E=y;break;case"iframe":case"object":case"embed":on("load",a),E=y;break;case"video":case"audio":for(E=0;E<Yd.length;E++)on(Yd[E],a);E=y;break;case"source":on("error",a),E=y;break;case"img":case"image":case"link":on("error",a),on("load",a),E=y;break;case"details":on("toggle",a),E=y;break;case"input":en(a,y),E=Ot(a,y),on("invalid",a);break;case"option":E=y;break;case"select":a._wrapperState={wasMultiple:!!y.multiple},E=Z({},y,{value:void 0}),on("invalid",a);break;case"textarea":Lt(a,y),E=Ye(a,y),on("invalid",a);break;default:E=y}Is(p,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&&ea(a,q)):P==="children"?typeof q=="string"?(p!=="textarea"||q!=="")&&Nn(a,q):typeof q=="number"&&Nn(a,""+q):P!=="suppressContentEditableWarning"&&P!=="suppressHydrationWarning"&&P!=="autoFocus"&&(s.hasOwnProperty(P)?q!=null&&P==="onScroll"&&on("scroll",a):q!=null&&C(a,P,q,L))}switch(p){case"input":We(a),qe(a,y,!1);break;case"textarea":We(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?Te(a,!!y.multiple,P,!1):y.defaultValue!=null&&Te(a,!!y.multiple,y.defaultValue,!0);break;default:typeof E.onClick=="function"&&(a.onclick=Op)}switch(p){case"button":case"input":case"select":case"textarea":y=!!y.autoFocus;break e;case"img":y=!0;break e;default:y=!1}}y&&(c.flags|=4)}c.ref!==null&&(c.flags|=512,c.flags|=2097152)}return br(c),null;case 6:if(a&&c.stateNode!=null)LS(a,c,a.memoizedProps,y);else{if(typeof y!="string"&&c.stateNode===null)throw Error(n(166));if(p=bl(sf.current),bl(Ai.current),Vp(c)){if(y=c.stateNode,p=c.memoizedProps,y[Pi]=c,(P=y.nodeValue!==p)&&(a=ms,a!==null))switch(a.tag){case 3:Ip(y.nodeValue,p,(a.mode&1)!==0);break;case 5:a.memoizedProps.suppressHydrationWarning!==!0&&Ip(y.nodeValue,p,(a.mode&1)!==0)}P&&(c.flags|=4)}else y=(p.nodeType===9?p:p.ownerDocument).createTextNode(y),y[Pi]=c,c.stateNode=y}return br(c),null;case 13:if(an(_n),y=c.memoizedState,a===null||a.memoizedState!==null&&a.memoizedState.dehydrated!==null){if(fn&&gs!==null&&(c.mode&1)!==0&&(c.flags&128)===0)j6(),Yc(),c.flags|=98560,P=!1;else if(P=Vp(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[Pi]=c}else Yc(),(c.flags&128)===0&&(c.memoizedState=null),c.flags|=4;br(c),P=!1}else oi!==null&&(q1(oi),oi=null),P=!0;if(!P)return c.flags&65536?c:null}return(c.flags&128)!==0?(c.lanes=p,c):(y=y!==null,y!==(a!==null&&a.memoizedState!==null)&&y&&(c.child.flags|=8192,(c.mode&1)!==0&&(a===null||(_n.current&1)!==0?Gn===0&&(Gn=3):Y1())),c.updateQueue!==null&&(c.flags|=4),br(c),null);case 4:return eu(),D1(a,c),a===null&&Xd(c.stateNode.containerInfo),br(c),null;case 10:return u1(c.type._context),br(c),null;case 17:return Ur(c.type)&&Np(),br(c),null;case 19:if(an(_n),P=c.memoizedState,P===null)return br(c),null;if(y=(c.flags&128)!==0,L=P.rendering,L===null)if(y)uf(P,!1);else{if(Gn!==0||a!==null&&(a.flags&128)!==0)for(a=c.child;a!==null;){if(L=Wp(a),L!==null){for(c.flags|=128,uf(P,!1),y=L.updateQueue,y!==null&&(c.updateQueue=y,c.flags|=4),c.subtreeFlags=0,y=p,p=c.child;p!==null;)P=p,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}),p=p.sibling;return nn(_n,_n.current&1|2),c.child}a=a.sibling}P.tail!==null&&tn()>su&&(c.flags|=128,y=!0,uf(P,!1),c.lanes=4194304)}else{if(!y)if(a=Wp(L),a!==null){if(c.flags|=128,y=!0,p=a.updateQueue,p!==null&&(c.updateQueue=p,c.flags|=4),uf(P,!0),P.tail===null&&P.tailMode==="hidden"&&!L.alternate&&!fn)return br(c),null}else 2*tn()-P.renderingStartTime>su&&p!==1073741824&&(c.flags|=128,y=!0,uf(P,!1),c.lanes=4194304);P.isBackwards?(L.sibling=c.child,c.child=L):(p=P.last,p!==null?p.sibling=L:c.child=L,P.last=L)}return P.tail!==null?(c=P.tail,P.rendering=c,P.tail=c.sibling,P.renderingStartTime=tn(),c.sibling=null,p=_n.current,nn(_n,y?p&1|2:p&1),c):(br(c),null);case 22:case 23:return K1(),y=c.memoizedState!==null,a!==null&&a.memoizedState!==null!==y&&(c.flags|=8192),y&&(c.mode&1)!==0?(vs&1073741824)!==0&&(br(c),c.subtreeFlags&6&&(c.flags|=8192)):br(c),null;case 24:return null;case 25:return null}throw Error(n(156,c.tag))}function E7(a,c){switch(s1(c),c.tag){case 1:return Ur(c.type)&&Np(),a=c.flags,a&65536?(c.flags=a&-65537|128,c):null;case 3:return eu(),an(zr),an(wr),v1(),a=c.flags,(a&65536)!==0&&(a&128)===0?(c.flags=a&-65537|128,c):null;case 5:return m1(c),null;case 13:if(an(_n),a=c.memoizedState,a!==null&&a.dehydrated!==null){if(c.alternate===null)throw Error(n(340));Yc()}return a=c.flags,a&65536?(c.flags=a&-65537|128,c):null;case 19:return an(_n),null;case 4:return eu(),null;case 10:return u1(c.type._context),null;case 22:case 23:return K1(),null;case 24:return null;default:return null}}var t0=!1,Sr=!1,C7=typeof WeakSet=="function"?WeakSet:Set,Ne=null;function nu(a,c){var p=a.ref;if(p!==null)if(typeof p=="function")try{p(null)}catch(y){Cn(a,c,y)}else p.current=null}function j1(a,c,p){try{p()}catch(y){Cn(a,c,y)}}var NS=!1;function P7(a,c){if(Kv=Tr,a=h6(),Hv(a)){if("selectionStart"in a)var p={start:a.selectionStart,end:a.selectionEnd};else e:{p=(p=a.ownerDocument)&&p.defaultView||window;var y=p.getSelection&&p.getSelection();if(y&&y.rangeCount!==0){p=y.anchorNode;var E=y.anchorOffset,P=y.focusNode;y=y.focusOffset;try{p.nodeType,P.nodeType}catch{p=null;break e}var L=0,z=-1,q=-1,ie=0,ge=0,_e=a,me=null;t:for(;;){for(var Me;_e!==p||E!==0&&_e.nodeType!==3||(z=L+E),_e!==P||y!==0&&_e.nodeType!==3||(q=L+y),_e.nodeType===3&&(L+=_e.nodeValue.length),(Me=_e.firstChild)!==null;)me=_e,_e=Me;for(;;){if(_e===a)break t;if(me===p&&++ie===E&&(z=L),me===P&&++ge===y&&(q=L),(Me=_e.nextSibling)!==null)break;_e=me,me=_e.parentNode}_e=Me}p=z===-1||q===-1?null:{start:z,end:q}}else p=null}p=p||{start:0,end:0}}else p=null;for(Yv={focusedElem:a,selectionRange:p},Tr=!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,Mn=Fe.memoizedState,te=c.stateNode,X=te.getSnapshotBeforeUpdate(c.elementType===c.type?He:ai(c.type,He),Mn);te.__reactInternalSnapshotBeforeUpdate=X}break;case 3:var re=c.stateNode.containerInfo;re.nodeType===1?re.textContent="":re.nodeType===9&&re.documentElement&&re.removeChild(re.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=NS,NS=!1,Fe}function df(a,c,p){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&&j1(c,p,P)}E=E.next}while(E!==y)}}function n0(a,c){if(c=c.updateQueue,c=c!==null?c.lastEffect:null,c!==null){var p=c=c.next;do{if((p.tag&a)===a){var y=p.create;p.destroy=y()}p=p.next}while(p!==c)}}function $1(a){var c=a.ref;if(c!==null){var p=a.stateNode;switch(a.tag){case 5:a=p;break;default:a=p}typeof c=="function"?c(a):c.current=a}}function DS(a){var c=a.alternate;c!==null&&(a.alternate=null,DS(c)),a.child=null,a.deletions=null,a.sibling=null,a.tag===5&&(c=a.stateNode,c!==null&&(delete c[Pi],delete c[Jd],delete c[e1],delete c[c7],delete c[u7])),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 jS(a){return a.tag===5||a.tag===3||a.tag===4}function $S(a){e:for(;;){for(;a.sibling===null;){if(a.return===null||jS(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 F1(a,c,p){var y=a.tag;if(y===5||y===6)a=a.stateNode,c?p.nodeType===8?p.parentNode.insertBefore(a,c):p.insertBefore(a,c):(p.nodeType===8?(c=p.parentNode,c.insertBefore(a,p)):(c=p,c.appendChild(a)),p=p._reactRootContainer,p!=null||c.onclick!==null||(c.onclick=Op));else if(y!==4&&(a=a.child,a!==null))for(F1(a,c,p),a=a.sibling;a!==null;)F1(a,c,p),a=a.sibling}function V1(a,c,p){var y=a.tag;if(y===5||y===6)a=a.stateNode,c?p.insertBefore(a,c):p.appendChild(a);else if(y!==4&&(a=a.child,a!==null))for(V1(a,c,p),a=a.sibling;a!==null;)V1(a,c,p),a=a.sibling}var ur=null,li=!1;function ha(a,c,p){for(p=p.child;p!==null;)FS(a,c,p),p=p.sibling}function FS(a,c,p){if(Ns&&typeof Ns.onCommitFiberUnmount=="function")try{Ns.onCommitFiberUnmount(Oc,p)}catch{}switch(p.tag){case 5:Sr||nu(p,c);case 6:var y=ur,E=li;ur=null,ha(a,c,p),ur=y,li=E,ur!==null&&(li?(a=ur,p=p.stateNode,a.nodeType===8?a.parentNode.removeChild(p):a.removeChild(p)):ur.removeChild(p.stateNode));break;case 18:ur!==null&&(li?(a=ur,p=p.stateNode,a.nodeType===8?Jv(a.parentNode,p):a.nodeType===1&&Jv(a,p),sn(a)):Jv(ur,p.stateNode));break;case 4:y=ur,E=li,ur=p.stateNode.containerInfo,li=!0,ha(a,c,p),ur=y,li=E;break;case 0:case 11:case 14:case 15:if(!Sr&&(y=p.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)&&j1(p,c,L),E=E.next}while(E!==y)}ha(a,c,p);break;case 1:if(!Sr&&(nu(p,c),y=p.stateNode,typeof y.componentWillUnmount=="function"))try{y.props=p.memoizedProps,y.state=p.memoizedState,y.componentWillUnmount()}catch(z){Cn(p,c,z)}ha(a,c,p);break;case 21:ha(a,c,p);break;case 22:p.mode&1?(Sr=(y=Sr)||p.memoizedState!==null,ha(a,c,p),Sr=y):ha(a,c,p);break;default:ha(a,c,p)}}function VS(a){var c=a.updateQueue;if(c!==null){a.updateQueue=null;var p=a.stateNode;p===null&&(p=a.stateNode=new C7),c.forEach(function(y){var E=D7.bind(null,a,y);p.has(y)||(p.add(y),y.then(E,E))})}}function ci(a,c){var p=c.deletions;if(p!==null)for(var y=0;y<p.length;y++){var E=p[y];try{var P=a,L=c,z=L;e:for(;z!==null;){switch(z.tag){case 5:ur=z.stateNode,li=!1;break e;case 3:ur=z.stateNode.containerInfo,li=!0;break e;case 4:ur=z.stateNode.containerInfo,li=!0;break e}z=z.return}if(ur===null)throw Error(n(160));FS(P,L,E),ur=null,li=!1;var q=E.alternate;q!==null&&(q.return=null),E.return=null}catch(ie){Cn(E,c,ie)}}if(c.subtreeFlags&12854)for(c=c.child;c!==null;)HS(c,a),c=c.sibling}function HS(a,c){var p=a.alternate,y=a.flags;switch(a.tag){case 0:case 11:case 14:case 15:if(ci(c,a),Ri(a),y&4){try{df(3,a,a.return),n0(3,a)}catch(He){Cn(a,a.return,He)}try{df(5,a,a.return)}catch(He){Cn(a,a.return,He)}}break;case 1:ci(c,a),Ri(a),y&512&&p!==null&&nu(p,p.return);break;case 5:if(ci(c,a),Ri(a),y&512&&p!==null&&nu(p,p.return),a.flags&32){var E=a.stateNode;try{Nn(E,"")}catch(He){Cn(a,a.return,He)}}if(y&4&&(E=a.stateNode,E!=null)){var P=a.memoizedProps,L=p!==null?p.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),_r(z,L);var ie=_r(z,P);for(L=0;L<q.length;L+=2){var ge=q[L],_e=q[L+1];ge==="style"?vn(E,_e):ge==="dangerouslySetInnerHTML"?ea(E,_e):ge==="children"?Nn(E,_e):C(E,ge,_e,ie)}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?Te(E,!!P.multiple,Me,!1):me!==!!P.multiple&&(P.defaultValue!=null?Te(E,!!P.multiple,P.defaultValue,!0):Te(E,!!P.multiple,P.multiple?[]:"",!1))}E[Jd]=P}catch(He){Cn(a,a.return,He)}}break;case 6:if(ci(c,a),Ri(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(ci(c,a),Ri(a),y&4&&p!==null&&p.memoizedState.isDehydrated)try{sn(c.containerInfo)}catch(He){Cn(a,a.return,He)}break;case 4:ci(c,a),Ri(a);break;case 13:ci(c,a),Ri(a),E=a.child,E.flags&8192&&(P=E.memoizedState!==null,E.stateNode.isHidden=P,!P||E.alternate!==null&&E.alternate.memoizedState!==null||(U1=tn())),y&4&&VS(a);break;case 22:if(ge=p!==null&&p.memoizedState!==null,a.mode&1?(Sr=(ie=Sr)||ge,ci(c,a),Sr=ie):ci(c,a),Ri(a),y&8192){if(ie=a.memoizedState!==null,(a.stateNode.isHidden=ie)&&!ge&&(a.mode&1)!==0)for(Ne=a,ge=a.child;ge!==null;){for(_e=Ne=ge;Ne!==null;){switch(me=Ne,Me=me.child,me.tag){case 0:case 11:case 14:case 15:df(4,me,me.return);break;case 1:nu(me,me.return);var Fe=me.stateNode;if(typeof Fe.componentWillUnmount=="function"){y=me,p=me.return;try{c=y,Fe.props=c.memoizedProps,Fe.state=c.memoizedState,Fe.componentWillUnmount()}catch(He){Cn(y,p,He)}}break;case 5:nu(me,me.return);break;case 22:if(me.memoizedState!==null){BS(_e);continue}}Me!==null?(Me.return=me,Ne=Me):BS(_e)}ge=ge.sibling}e:for(ge=null,_e=a;;){if(_e.tag===5){if(ge===null){ge=_e;try{E=_e.stateNode,ie?(P=E.style,typeof P.setProperty=="function"?P.setProperty("display","none","important"):P.display="none"):(z=_e.stateNode,q=_e.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(_e.tag===6){if(ge===null)try{_e.stateNode.nodeValue=ie?"":_e.memoizedProps}catch(He){Cn(a,a.return,He)}}else if((_e.tag!==22&&_e.tag!==23||_e.memoizedState===null||_e===a)&&_e.child!==null){_e.child.return=_e,_e=_e.child;continue}if(_e===a)break e;for(;_e.sibling===null;){if(_e.return===null||_e.return===a)break e;ge===_e&&(ge=null),_e=_e.return}ge===_e&&(ge=null),_e.sibling.return=_e.return,_e=_e.sibling}}break;case 19:ci(c,a),Ri(a),y&4&&VS(a);break;case 21:break;default:ci(c,a),Ri(a)}}function Ri(a){var c=a.flags;if(c&2){try{e:{for(var p=a.return;p!==null;){if(jS(p)){var y=p;break e}p=p.return}throw Error(n(160))}switch(y.tag){case 5:var E=y.stateNode;y.flags&32&&(Nn(E,""),y.flags&=-33);var P=$S(a);V1(a,P,E);break;case 3:case 4:var L=y.stateNode.containerInfo,z=$S(a);F1(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 A7(a,c,p){Ne=a,zS(a)}function zS(a,c,p){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||t0;if(!L){var z=E.alternate,q=z!==null&&z.memoizedState!==null||Sr;z=t0;var ie=Sr;if(t0=L,(Sr=q)&&!ie)for(Ne=E;Ne!==null;)L=Ne,q=L.child,L.tag===22&&L.memoizedState!==null?ZS(E):q!==null?(q.return=L,Ne=q):ZS(E);for(;P!==null;)Ne=P,zS(P),P=P.sibling;Ne=E,t0=z,Sr=ie}US(a)}else(E.subtreeFlags&8772)!==0&&P!==null?(P.return=E,Ne=P):US(a)}}function US(a){for(;Ne!==null;){var c=Ne;if((c.flags&8772)!==0){var p=c.alternate;try{if((c.flags&8772)!==0)switch(c.tag){case 0:case 11:case 15:Sr||n0(5,c);break;case 1:var y=c.stateNode;if(c.flags&4&&!Sr)if(p===null)y.componentDidMount();else{var E=c.elementType===c.type?p.memoizedProps:ai(c.type,p.memoizedProps);y.componentDidUpdate(E,p.memoizedState,y.__reactInternalSnapshotBeforeUpdate)}var P=c.updateQueue;P!==null&&B6(c,P,y);break;case 3:var L=c.updateQueue;if(L!==null){if(p=null,c.child!==null)switch(c.child.tag){case 5:p=c.child.stateNode;break;case 1:p=c.child.stateNode}B6(c,L,p)}break;case 5:var z=c.stateNode;if(p===null&&c.flags&4){p=z;var q=c.memoizedProps;switch(c.type){case"button":case"input":case"select":case"textarea":q.autoFocus&&p.focus();break;case"img":q.src&&(p.src=q.src)}}break;case 6:break;case 4:break;case 12:break;case 13:if(c.memoizedState===null){var ie=c.alternate;if(ie!==null){var ge=ie.memoizedState;if(ge!==null){var _e=ge.dehydrated;_e!==null&&sn(_e)}}}break;case 19:case 17:case 21:case 22:case 23:case 25:break;default:throw Error(n(163))}Sr||c.flags&512&&$1(c)}catch(me){Cn(c,c.return,me)}}if(c===a){Ne=null;break}if(p=c.sibling,p!==null){p.return=c.return,Ne=p;break}Ne=c.return}}function BS(a){for(;Ne!==null;){var c=Ne;if(c===a){Ne=null;break}var p=c.sibling;if(p!==null){p.return=c.return,Ne=p;break}Ne=c.return}}function ZS(a){for(;Ne!==null;){var c=Ne;try{switch(c.tag){case 0:case 11:case 15:var p=c.return;try{n0(4,c)}catch(q){Cn(c,p,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{$1(c)}catch(q){Cn(c,P,q)}break;case 5:var L=c.return;try{$1(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 T7=Math.ceil,r0=A.ReactCurrentDispatcher,H1=A.ReactCurrentOwner,Hs=A.ReactCurrentBatchConfig,Rt=0,rr=null,$n=null,dr=0,vs=0,ru=la(0),Gn=0,ff=null,kl=0,s0=0,z1=0,hf=null,Zr=null,U1=0,su=1/0,_o=null,i0=!1,B1=null,pa=null,o0=!1,ma=null,a0=0,pf=0,Z1=null,l0=-1,c0=0;function Mr(){return(Rt&6)!==0?tn():l0!==-1?l0:l0=tn()}function ga(a){return(a.mode&1)===0?1:(Rt&2)!==0&&dr!==0?dr&-dr:f7.transition!==null?(c0===0&&(c0=vp()),c0):(a=Ft,a!==0||(a=window.event,a=a===void 0?16:q4(a.type)),a)}function ui(a,c,p,y){if(50<pf)throw pf=0,Z1=null,Error(n(185));co(a,p,y),((Rt&2)===0||a!==rr)&&(a===rr&&((Rt&2)===0&&(s0|=p),Gn===4&&va(a,dr)),Wr(a,y),p===1&&Rt===0&&(c.mode&1)===0&&(su=tn()+500,jp&&ua()))}function Wr(a,c){var p=a.callbackNode;Mv(a,c);var y=Dc(a,a===rr?dr:0);if(y===0)p!==null&&ta(p),a.callbackNode=null,a.callbackPriority=0;else if(c=y&-y,a.callbackPriority!==c){if(p!=null&&ta(p),c===1)a.tag===0?d7(qS.bind(null,a)):I6(qS.bind(null,a)),a7(function(){(Rt&6)===0&&ua()}),p=null;else{switch(uo(y)){case 1:p=Nd;break;case 4:p=mp;break;case 16:p=na;break;case 536870912:p=jd;break;default:p=na}p=t8(p,WS.bind(null,a))}a.callbackPriority=c,a.callbackNode=p}}function WS(a,c){if(l0=-1,c0=0,(Rt&6)!==0)throw Error(n(327));var p=a.callbackNode;if(iu()&&a.callbackNode!==p)return null;var y=Dc(a,a===rr?dr:0);if(y===0)return null;if((y&30)!==0||(y&a.expiredLanes)!==0||c)c=u0(a,y);else{c=y;var E=Rt;Rt|=2;var P=KS();(rr!==a||dr!==c)&&(_o=null,su=tn()+500,Cl(a,c));do try{I7();break}catch(z){GS(a,z)}while(!0);c1(),r0.current=P,Rt=E,$n!==null?c=0:(rr=null,dr=0,c=Gn)}if(c!==0){if(c===2&&(E=Vd(a),E!==0&&(y=E,c=W1(a,E))),c===1)throw p=ff,Cl(a,0),va(a,y),Wr(a,tn()),p;if(c===6)va(a,y);else{if(E=a.current.alternate,(y&30)===0&&!R7(E)&&(c=u0(a,y),c===2&&(P=Vd(a),P!==0&&(y=P,c=W1(a,P))),c===1))throw p=ff,Cl(a,0),va(a,y),Wr(a,tn()),p;switch(a.finishedWork=E,a.finishedLanes=y,c){case 0:case 1:throw Error(n(345));case 2:Pl(a,Zr,_o);break;case 3:if(va(a,y),(y&130023424)===y&&(c=U1+500-tn(),10<c)){if(Dc(a,0)!==0)break;if(E=a.suspendedLanes,(E&y)!==y){Mr(),a.pingedLanes|=a.suspendedLanes&E;break}a.timeoutHandle=Qv(Pl.bind(null,a,Zr,_o),c);break}Pl(a,Zr,_o);break;case 4:if(va(a,y),(y&4194240)===y)break;for(c=a.eventTimes,E=-1;0<y;){var L=31-us(y);P=1<<L,L=c[L],L>E&&(E=L),y&=~P}if(y=E,y=tn()-y,y=(120>y?120:480>y?480:1080>y?1080:1920>y?1920:3e3>y?3e3:4320>y?4320:1960*T7(y/1960))-y,10<y){a.timeoutHandle=Qv(Pl.bind(null,a,Zr,_o),y);break}Pl(a,Zr,_o);break;case 5:Pl(a,Zr,_o);break;default:throw Error(n(329))}}}return Wr(a,tn()),a.callbackNode===p?WS.bind(null,a):null}function W1(a,c){var p=hf;return a.current.memoizedState.isDehydrated&&(Cl(a,c).flags|=256),a=u0(a,c),a!==2&&(c=Zr,Zr=p,c!==null&&q1(c)),a}function q1(a){Zr===null?Zr=a:Zr.push.apply(Zr,a)}function R7(a){for(var c=a;;){if(c.flags&16384){var p=c.updateQueue;if(p!==null&&(p=p.stores,p!==null))for(var y=0;y<p.length;y++){var E=p[y],P=E.getSnapshot;E=E.value;try{if(!ii(P(),E))return!1}catch{return!1}}}if(p=c.child,c.subtreeFlags&16384&&p!==null)p.return=c,c=p;else{if(c===a)break;for(;c.sibling===null;){if(c.return===null||c.return===a)return!0;c=c.return}c.sibling.return=c.return,c=c.sibling}}return!0}function va(a,c){for(c&=~z1,c&=~s0,a.suspendedLanes|=c,a.pingedLanes&=~c,a=a.expirationTimes;0<c;){var p=31-us(c),y=1<<p;a[p]=-1,c&=~y}}function qS(a){if((Rt&6)!==0)throw Error(n(327));iu();var c=Dc(a,0);if((c&1)===0)return Wr(a,tn()),null;var p=u0(a,c);if(a.tag!==0&&p===2){var y=Vd(a);y!==0&&(c=y,p=W1(a,y))}if(p===1)throw p=ff,Cl(a,0),va(a,c),Wr(a,tn()),p;if(p===6)throw Error(n(345));return a.finishedWork=a.current.alternate,a.finishedLanes=c,Pl(a,Zr,_o),Wr(a,tn()),null}function G1(a,c){var p=Rt;Rt|=1;try{return a(c)}finally{Rt=p,Rt===0&&(su=tn()+500,jp&&ua())}}function El(a){ma!==null&&ma.tag===0&&(Rt&6)===0&&iu();var c=Rt;Rt|=1;var p=Hs.transition,y=Ft;try{if(Hs.transition=null,Ft=1,a)return a()}finally{Ft=y,Hs.transition=p,Rt=c,(Rt&6)===0&&ua()}}function K1(){vs=ru.current,an(ru)}function Cl(a,c){a.finishedWork=null,a.finishedLanes=0;var p=a.timeoutHandle;if(p!==-1&&(a.timeoutHandle=-1,o7(p)),$n!==null)for(p=$n.return;p!==null;){var y=p;switch(s1(y),y.tag){case 1:y=y.type.childContextTypes,y!=null&&Np();break;case 3:eu(),an(zr),an(wr),v1();break;case 5:m1(y);break;case 4:eu();break;case 13:an(_n);break;case 19:an(_n);break;case 10:u1(y.type._context);break;case 22:case 23:K1()}p=p.return}if(rr=a,$n=a=ya(a.current,null),dr=vs=c,Gn=0,ff=null,z1=s0=kl=0,Zr=hf=null,xl!==null){for(c=0;c<xl.length;c++)if(p=xl[c],y=p.interleaved,y!==null){p.interleaved=null;var E=y.next,P=p.pending;if(P!==null){var L=P.next;P.next=E,y.next=L}p.pending=y}xl=null}return a}function GS(a,c){do{var p=$n;try{if(c1(),qp.current=Xp,Gp){for(var y=wn.memoizedState;y!==null;){var E=y.queue;E!==null&&(E.pending=null),y=y.next}Gp=!1}if(Sl=0,nr=qn=wn=null,of=!1,af=0,H1.current=null,p===null||p.return===null){Gn=1,ff=c,$n=null;break}e:{var P=a,L=p.return,z=p,q=c;if(c=dr,z.flags|=32768,q!==null&&typeof q=="object"&&typeof q.then=="function"){var ie=q,ge=z,_e=ge.tag;if((ge.mode&1)===0&&(_e===0||_e===11||_e===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=_S(L);if(Me!==null){Me.flags&=-257,wS(Me,L,z,P,c),Me.mode&1&&yS(P,ie,c),c=Me,q=ie;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){yS(P,ie,c),Y1();break e}q=Error(n(426))}}else if(fn&&z.mode&1){var Mn=_S(L);if(Mn!==null){(Mn.flags&65536)===0&&(Mn.flags|=256),wS(Mn,L,z,P,c),a1(tu(q,z));break e}}P=q=tu(q,z),Gn!==4&&(Gn=2),hf===null?hf=[P]:hf.push(P),P=L;do{switch(P.tag){case 3:P.flags|=65536,c&=-c,P.lanes|=c;var te=gS(P,q,c);U6(P,te);break e;case 1:z=q;var X=P.type,re=P.stateNode;if((P.flags&128)===0&&(typeof X.getDerivedStateFromError=="function"||re!==null&&typeof re.componentDidCatch=="function"&&(pa===null||!pa.has(re)))){P.flags|=65536,c&=-c,P.lanes|=c;var be=vS(P,z,c);U6(P,be);break e}}P=P.return}while(P!==null)}XS(p)}catch(Be){c=Be,$n===p&&p!==null&&($n=p=p.return);continue}break}while(!0)}function KS(){var a=r0.current;return r0.current=Xp,a===null?Xp:a}function Y1(){(Gn===0||Gn===3||Gn===2)&&(Gn=4),rr===null||(kl&268435455)===0&&(s0&268435455)===0||va(rr,dr)}function u0(a,c){var p=Rt;Rt|=2;var y=KS();(rr!==a||dr!==c)&&(_o=null,Cl(a,c));do try{M7();break}catch(E){GS(a,E)}while(!0);if(c1(),Rt=p,r0.current=y,$n!==null)throw Error(n(261));return rr=null,dr=0,Gn}function M7(){for(;$n!==null;)YS($n)}function I7(){for(;$n!==null&&!Ld();)YS($n)}function YS(a){var c=e8(a.alternate,a,vs);a.memoizedProps=a.pendingProps,c===null?XS(a):$n=c,H1.current=null}function XS(a){var c=a;do{var p=c.alternate;if(a=c.return,(c.flags&32768)===0){if(p=k7(p,c,vs),p!==null){$n=p;return}}else{if(p=E7(p,c),p!==null){p.flags&=32767,$n=p;return}if(a!==null)a.flags|=32768,a.subtreeFlags=0,a.deletions=null;else{Gn=6,$n=null;return}}if(c=c.sibling,c!==null){$n=c;return}$n=c=a}while(c!==null);Gn===0&&(Gn=5)}function Pl(a,c,p){var y=Ft,E=Hs.transition;try{Hs.transition=null,Ft=1,O7(a,c,p,y)}finally{Hs.transition=E,Ft=y}return null}function O7(a,c,p,y){do iu();while(ma!==null);if((Rt&6)!==0)throw Error(n(327));p=a.finishedWork;var E=a.finishedLanes;if(p===null)return null;if(a.finishedWork=null,a.finishedLanes=0,p===a.current)throw Error(n(177));a.callbackNode=null,a.callbackPriority=0;var P=p.lanes|p.childLanes;if(yp(a,P),a===rr&&($n=rr=null,dr=0),(p.subtreeFlags&2064)===0&&(p.flags&2064)===0||o0||(o0=!0,t8(na,function(){return iu(),null})),P=(p.flags&15990)!==0,(p.subtreeFlags&15990)!==0||P){P=Hs.transition,Hs.transition=null;var L=Ft;Ft=1;var z=Rt;Rt|=4,H1.current=null,P7(a,p),HS(p,a),JD(Yv),Tr=!!Kv,Yv=Kv=null,a.current=p,A7(p),Pv(),Rt=z,Ft=L,Hs.transition=P}else a.current=p;if(o0&&(o0=!1,ma=a,a0=E),P=a.pendingLanes,P===0&&(pa=null),gp(p.stateNode),Wr(a,tn()),c!==null)for(y=a.onRecoverableError,p=0;p<c.length;p++)E=c[p],y(E.value,{componentStack:E.stack,digest:E.digest});if(i0)throw i0=!1,a=B1,B1=null,a;return(a0&1)!==0&&a.tag!==0&&iu(),P=a.pendingLanes,(P&1)!==0?a===Z1?pf++:(pf=0,Z1=a):pf=0,ua(),null}function iu(){if(ma!==null){var a=uo(a0),c=Hs.transition,p=Ft;try{if(Hs.transition=null,Ft=16>a?16:a,ma===null)var y=!1;else{if(a=ma,ma=null,a0=0,(Rt&6)!==0)throw Error(n(331));var E=Rt;for(Rt|=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 ie=z[q];for(Ne=ie;Ne!==null;){var ge=Ne;switch(ge.tag){case 0:case 11:case 15:df(8,ge,P)}var _e=ge.child;if(_e!==null)_e.return=ge,Ne=_e;else for(;Ne!==null;){ge=Ne;var me=ge.sibling,Me=ge.return;if(DS(ge),ge===ie){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 Mn=He.sibling;He.sibling=null,He=Mn}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:df(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 re=L.child;if((L.subtreeFlags&2064)!==0&&re!==null)re.return=L,Ne=re;else e:for(L=X;Ne!==null;){if(z=Ne,(z.flags&2048)!==0)try{switch(z.tag){case 0:case 11:case 15:n0(9,z)}}catch(Be){Cn(z,z.return,Be)}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(Rt=E,ua(),Ns&&typeof Ns.onPostCommitFiberRoot=="function")try{Ns.onPostCommitFiberRoot(Oc,a)}catch{}y=!0}return y}finally{Ft=p,Hs.transition=c}}return!1}function QS(a,c,p){c=tu(p,c),c=gS(a,c,1),a=fa(a,c,1),c=Mr(),a!==null&&(co(a,1,c),Wr(a,c))}function Cn(a,c,p){if(a.tag===3)QS(a,a,p);else for(;c!==null;){if(c.tag===3){QS(c,a,p);break}else if(c.tag===1){var y=c.stateNode;if(typeof c.type.getDerivedStateFromError=="function"||typeof y.componentDidCatch=="function"&&(pa===null||!pa.has(y))){a=tu(p,a),a=vS(c,a,1),c=fa(c,a,1),a=Mr(),c!==null&&(co(c,1,a),Wr(c,a));break}}c=c.return}}function L7(a,c,p){var y=a.pingCache;y!==null&&y.delete(c),c=Mr(),a.pingedLanes|=a.suspendedLanes&p,rr===a&&(dr&p)===p&&(Gn===4||Gn===3&&(dr&130023424)===dr&&500>tn()-U1?Cl(a,0):z1|=p),Wr(a,c)}function JS(a,c){c===0&&((a.mode&1)===0?c=1:(c=Nc,Nc<<=1,(Nc&130023424)===0&&(Nc=4194304)));var p=Mr();a=go(a,c),a!==null&&(co(a,c,p),Wr(a,p))}function N7(a){var c=a.memoizedState,p=0;c!==null&&(p=c.retryLane),JS(a,p)}function D7(a,c){var p=0;switch(a.tag){case 13:var y=a.stateNode,E=a.memoizedState;E!==null&&(p=E.retryLane);break;case 19:y=a.stateNode;break;default:throw Error(n(314))}y!==null&&y.delete(c),JS(a,p)}var e8;e8=function(a,c,p){if(a!==null)if(a.memoizedProps!==c.pendingProps||zr.current)Br=!0;else{if((a.lanes&p)===0&&(c.flags&128)===0)return Br=!1,S7(a,c,p);Br=(a.flags&131072)!==0}else Br=!1,fn&&(c.flags&1048576)!==0&&O6(c,Fp,c.index);switch(c.lanes=0,c.tag){case 2:var y=c.type;e0(a,c),a=c.pendingProps;var E=qc(c,wr.current);Jc(c,p),E=w1(null,c,y,a,E,p);var P=x1();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,Ur(y)?(P=!0,Dp(c)):P=!1,c.memoizedState=E.state!==null&&E.state!==void 0?E.state:null,h1(c),E.updater=Qp,c.stateNode=E,E._reactInternals=c,P1(c,y,a,p),c=M1(null,c,y,!0,P,p)):(c.tag=0,fn&&P&&r1(c),Rr(null,c,E,p),c=c.child),c;case 16:y=c.elementType;e:{switch(e0(a,c),a=c.pendingProps,E=y._init,y=E(y._payload),c.type=y,E=c.tag=$7(y),a=ai(y,a),E){case 0:c=R1(null,c,y,a,p);break e;case 1:c=CS(null,c,y,a,p);break e;case 11:c=xS(null,c,y,a,p);break e;case 14:c=bS(null,c,y,ai(y.type,a),p);break e}throw Error(n(306,y,""))}return c;case 0:return y=c.type,E=c.pendingProps,E=c.elementType===y?E:ai(y,E),R1(a,c,y,E,p);case 1:return y=c.type,E=c.pendingProps,E=c.elementType===y?E:ai(y,E),CS(a,c,y,E,p);case 3:e:{if(PS(c),a===null)throw Error(n(387));y=c.pendingProps,P=c.memoizedState,E=P.element,z6(a,c),Zp(c,y,null,p);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=tu(Error(n(423)),c),c=AS(a,c,y,p,E);break e}else if(y!==E){E=tu(Error(n(424)),c),c=AS(a,c,y,p,E);break e}else for(gs=aa(c.stateNode.containerInfo.firstChild),ms=c,fn=!0,oi=null,p=V6(c,null,y,p),c.child=p;p;)p.flags=p.flags&-3|4096,p=p.sibling;else{if(Yc(),y===E){c=yo(a,c,p);break e}Rr(a,c,y,p)}c=c.child}return c;case 5:return Z6(c),a===null&&o1(c),y=c.type,E=c.pendingProps,P=a!==null?a.memoizedProps:null,L=E.children,Xv(y,E)?L=null:P!==null&&Xv(y,P)&&(c.flags|=32),ES(a,c),Rr(a,c,L,p),c.child;case 6:return a===null&&o1(c),null;case 13:return TS(a,c,p);case 4:return p1(c,c.stateNode.containerInfo),y=c.pendingProps,a===null?c.child=Xc(c,null,y,p):Rr(a,c,y,p),c.child;case 11:return y=c.type,E=c.pendingProps,E=c.elementType===y?E:ai(y,E),xS(a,c,y,E,p);case 7:return Rr(a,c,c.pendingProps,p),c.child;case 8:return Rr(a,c,c.pendingProps.children,p),c.child;case 12:return Rr(a,c,c.pendingProps.children,p),c.child;case 10:e:{if(y=c.type._context,E=c.pendingProps,P=c.memoizedProps,L=E.value,nn(zp,y._currentValue),y._currentValue=L,P!==null)if(ii(P.value,L)){if(P.children===E.children&&!zr.current){c=yo(a,c,p);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=vo(-1,p&-p),q.tag=2;var ie=P.updateQueue;if(ie!==null){ie=ie.shared;var ge=ie.pending;ge===null?q.next=q:(q.next=ge.next,ge.next=q),ie.pending=q}}P.lanes|=p,q=P.alternate,q!==null&&(q.lanes|=p),d1(P.return,p,c),z.lanes|=p;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|=p,z=L.alternate,z!==null&&(z.lanes|=p),d1(L,p,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}Rr(a,c,E.children,p),c=c.child}return c;case 9:return E=c.type,y=c.pendingProps.children,Jc(c,p),E=Fs(E),y=y(E),c.flags|=1,Rr(a,c,y,p),c.child;case 14:return y=c.type,E=ai(y,c.pendingProps),E=ai(y.type,E),bS(a,c,y,E,p);case 15:return SS(a,c,c.type,c.pendingProps,p);case 17:return y=c.type,E=c.pendingProps,E=c.elementType===y?E:ai(y,E),e0(a,c),c.tag=1,Ur(y)?(a=!0,Dp(c)):a=!1,Jc(c,p),pS(c,y,E),P1(c,y,E,p),M1(null,c,y,!0,a,p);case 19:return MS(a,c,p);case 22:return kS(a,c,p)}throw Error(n(156,c.tag))};function t8(a,c){return Ic(a,c)}function j7(a,c,p,y){this.tag=a,this.key=p,this.sibling=this.child=this.return=this.stateNode=this.type=this.elementType=null,this.index=0,this.ref=null,this.pendingProps=c,this.dependencies=this.memoizedState=this.updateQueue=this.memoizedProps=null,this.mode=y,this.subtreeFlags=this.flags=0,this.deletions=null,this.childLanes=this.lanes=0,this.alternate=null}function zs(a,c,p,y){return new j7(a,c,p,y)}function X1(a){return a=a.prototype,!(!a||!a.isReactComponent)}function $7(a){if(typeof a=="function")return X1(a)?1:0;if(a!=null){if(a=a.$$typeof,a===F)return 11;if(a===G)return 14}return 2}function ya(a,c){var p=a.alternate;return p===null?(p=zs(a.tag,c,a.key,a.mode),p.elementType=a.elementType,p.type=a.type,p.stateNode=a.stateNode,p.alternate=a,a.alternate=p):(p.pendingProps=c,p.type=a.type,p.flags=0,p.subtreeFlags=0,p.deletions=null),p.flags=a.flags&14680064,p.childLanes=a.childLanes,p.lanes=a.lanes,p.child=a.child,p.memoizedProps=a.memoizedProps,p.memoizedState=a.memoizedState,p.updateQueue=a.updateQueue,c=a.dependencies,p.dependencies=c===null?null:{lanes:c.lanes,firstContext:c.firstContext},p.sibling=a.sibling,p.index=a.index,p.ref=a.ref,p}function d0(a,c,p,y,E,P){var L=2;if(y=a,typeof a=="function")X1(a)&&(L=1);else if(typeof a=="string")L=5;else e:switch(a){case M:return Al(p.children,E,P,c);case R:L=8,E|=8;break;case O:return a=zs(12,p,c,E|2),a.elementType=O,a.lanes=P,a;case K:return a=zs(13,p,c,E),a.elementType=K,a.lanes=P,a;case B:return a=zs(19,p,c,E),a.elementType=B,a.lanes=P,a;case Y:return f0(p,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 F:L=11;break e;case G:L=14;break e;case H:L=16,y=null;break e}throw Error(n(130,a==null?a:typeof a,""))}return c=zs(L,p,c,E),c.elementType=a,c.type=y,c.lanes=P,c}function Al(a,c,p,y){return a=zs(7,a,y,c),a.lanes=p,a}function f0(a,c,p,y){return a=zs(22,a,y,c),a.elementType=Y,a.lanes=p,a.stateNode={isHidden:!1},a}function Q1(a,c,p){return a=zs(6,a,null,c),a.lanes=p,a}function J1(a,c,p){return c=zs(4,a.children!==null?a.children:[],a.key,c),c.lanes=p,c.stateNode={containerInfo:a.containerInfo,pendingChildren:null,implementation:a.implementation},c}function F7(a,c,p,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=ml(0),this.expirationTimes=ml(-1),this.entangledLanes=this.finishedLanes=this.mutableReadLanes=this.expiredLanes=this.pingedLanes=this.suspendedLanes=this.pendingLanes=0,this.entanglements=ml(0),this.identifierPrefix=y,this.onRecoverableError=E,this.mutableSourceEagerHydrationData=null}function ey(a,c,p,y,E,P,L,z,q){return a=new F7(a,c,p,z,q),c===1?(c=1,P===!0&&(c|=8)):c=0,P=zs(3,null,null,c),a.current=P,P.stateNode=a,P.memoizedState={element:y,isDehydrated:p,cache:null,transitions:null,pendingSuspenseBoundaries:null},h1(P),a}function V7(a,c,p){var y=3<arguments.length&&arguments[3]!==void 0?arguments[3]:null;return{$$typeof:I,key:y==null?null:""+y,children:a,containerInfo:c,implementation:p}}function n8(a){if(!a)return ca;a=a._reactInternals;e:{if(Ls(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(Ur(c.type)){c=c.stateNode.__reactInternalMemoizedMergedChildContext;break e}}c=c.return}while(c!==null);throw Error(n(171))}if(a.tag===1){var p=a.type;if(Ur(p))return R6(a,p,c)}return c}function r8(a,c,p,y,E,P,L,z,q){return a=ey(p,y,!0,a,E,P,L,z,q),a.context=n8(null),p=a.current,y=Mr(),E=ga(p),P=vo(y,E),P.callback=c??null,fa(p,P,E),a.current.lanes=E,co(a,E,y),Wr(a,y),a}function h0(a,c,p,y){var E=c.current,P=Mr(),L=ga(E);return p=n8(p),c.context===null?c.context=p:c.pendingContext=p,c=vo(P,L),c.payload={element:a},y=y===void 0?null:y,y!==null&&(c.callback=y),a=fa(E,c,L),a!==null&&(ui(a,E,L,P),Bp(a,E,L)),L}function p0(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 s8(a,c){if(a=a.memoizedState,a!==null&&a.dehydrated!==null){var p=a.retryLane;a.retryLane=p!==0&&p<c?p:c}}function ty(a,c){s8(a,c),(a=a.alternate)&&s8(a,c)}function H7(){return null}var i8=typeof reportError=="function"?reportError:function(a){console.error(a)};function ny(a){this._internalRoot=a}m0.prototype.render=ny.prototype.render=function(a){var c=this._internalRoot;if(c===null)throw Error(n(409));h0(a,c,null,null)},m0.prototype.unmount=ny.prototype.unmount=function(){var a=this._internalRoot;if(a!==null){this._internalRoot=null;var c=a.containerInfo;El(function(){h0(null,a,null,null)}),c[fo]=null}};function m0(a){this._internalRoot=a}m0.prototype.unstable_scheduleHydration=function(a){if(a){var c=wp();a={blockedOn:null,target:a,priority:c};for(var p=0;p<ri.length&&c!==0&&c<ri[p].priority;p++);ri.splice(p,0,a),p===0&&fe(a)}};function ry(a){return!(!a||a.nodeType!==1&&a.nodeType!==9&&a.nodeType!==11)}function g0(a){return!(!a||a.nodeType!==1&&a.nodeType!==9&&a.nodeType!==11&&(a.nodeType!==8||a.nodeValue!==" react-mount-point-unstable "))}function o8(){}function z7(a,c,p,y,E){if(E){if(typeof y=="function"){var P=y;y=function(){var ie=p0(L);P.call(ie)}}var L=r8(c,y,a,0,null,!1,!1,"",o8);return a._reactRootContainer=L,a[fo]=L.current,Xd(a.nodeType===8?a.parentNode:a),El(),L}for(;E=a.lastChild;)a.removeChild(E);if(typeof y=="function"){var z=y;y=function(){var ie=p0(q);z.call(ie)}}var q=ey(a,0,!1,null,null,!1,!1,"",o8);return a._reactRootContainer=q,a[fo]=q.current,Xd(a.nodeType===8?a.parentNode:a),El(function(){h0(c,q,p,y)}),q}function v0(a,c,p,y,E){var P=p._reactRootContainer;if(P){var L=P;if(typeof E=="function"){var z=E;E=function(){var q=p0(L);z.call(q)}}h0(c,L,a,E)}else L=z7(p,c,a,E,y);return p0(L)}zd=function(a){switch(a.tag){case 3:var c=a.stateNode;if(c.current.memoizedState.isDehydrated){var p=pl(c.pendingLanes);p!==0&&(Hd(c,p|1),Wr(c,tn()),(Rt&6)===0&&(su=tn()+500,ua()))}break;case 13:El(function(){var y=go(a,1);if(y!==null){var E=Mr();ui(y,a,1,E)}}),ty(a,1)}},gl=function(a){if(a.tag===13){var c=go(a,134217728);if(c!==null){var p=Mr();ui(c,a,134217728,p)}ty(a,134217728)}},_p=function(a){if(a.tag===13){var c=ga(a),p=go(a,c);if(p!==null){var y=Mr();ui(p,a,c,y)}ty(a,c)}},wp=function(){return Ft},xp=function(a,c){var p=Ft;try{return Ft=a,c()}finally{Ft=p}},ei=function(a,c,p){switch(c){case"input":if(_t(a,p),c=p.name,p.type==="radio"&&c!=null){for(p=a;p.parentNode;)p=p.parentNode;for(p=p.querySelectorAll("input[name="+JSON.stringify(""+c)+'][type="radio"]'),c=0;c<p.length;c++){var y=p[c];if(y!==a&&y.form===a.form){var E=Lp(y);if(!E)throw Error(n(90));Ee(y),_t(y,E)}}}break;case"textarea":Ge(a,p);break;case"select":c=p.value,c!=null&&Te(a,!!p.multiple,c,!1)}},Qe=G1,Nt=El;var U7={usingClientEntryPoint:!1,Events:[ef,Zc,Lp,ao,ls,G1]},mf={findFiberByHostInstance:vl,bundleType:0,version:"18.3.1",rendererPackageName:"react-dom"},B7={bundleType:mf.bundleType,version:mf.version,rendererPackageName:mf.rendererPackageName,rendererConfig:mf.rendererConfig,overrideHookState:null,overrideHookStateDeletePath:null,overrideHookStateRenamePath:null,overrideProps:null,overridePropsDeletePath:null,overridePropsRenamePath:null,setErrorHandler:null,setSuspenseHandler:null,scheduleUpdate:null,currentDispatcherRef:A.ReactCurrentDispatcher,findHostInstanceByFiber:function(a){return a=Od(a),a===null?null:a.stateNode},findFiberByHostInstance:mf.findFiberByHostInstance||H7,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 y0=__REACT_DEVTOOLS_GLOBAL_HOOK__;if(!y0.isDisabled&&y0.supportsFiber)try{Oc=y0.inject(B7),Ns=y0}catch{}}return qr.__SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED=U7,qr.createPortal=function(a,c){var p=2<arguments.length&&arguments[2]!==void 0?arguments[2]:null;if(!ry(c))throw Error(n(200));return V7(a,c,null,p)},qr.createRoot=function(a,c){if(!ry(a))throw Error(n(299));var p=!1,y="",E=i8;return c!=null&&(c.unstable_strictMode===!0&&(p=!0),c.identifierPrefix!==void 0&&(y=c.identifierPrefix),c.onRecoverableError!==void 0&&(E=c.onRecoverableError)),c=ey(a,1,!1,null,null,p,!1,y,E),a[fo]=c.current,Xd(a.nodeType===8?a.parentNode:a),new ny(c)},qr.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=Od(c),a=a===null?null:a.stateNode,a},qr.flushSync=function(a){return El(a)},qr.hydrate=function(a,c,p){if(!g0(c))throw Error(n(200));return v0(null,a,c,!0,p)},qr.hydrateRoot=function(a,c,p){if(!ry(a))throw Error(n(405));var y=p!=null&&p.hydratedSources||null,E=!1,P="",L=i8;if(p!=null&&(p.unstable_strictMode===!0&&(E=!0),p.identifierPrefix!==void 0&&(P=p.identifierPrefix),p.onRecoverableError!==void 0&&(L=p.onRecoverableError)),c=r8(c,null,a,1,p??null,E,!1,P,L),a[fo]=c.current,Xd(a),y)for(a=0;a<y.length;a++)p=y[a],E=p._getVersion,E=E(p._source),c.mutableSourceEagerHydrationData==null?c.mutableSourceEagerHydrationData=[p,E]:c.mutableSourceEagerHydrationData.push(p,E);return new m0(c)},qr.render=function(a,c,p){if(!g0(c))throw Error(n(200));return v0(null,a,c,!1,p)},qr.unmountComponentAtNode=function(a){if(!g0(a))throw Error(n(40));return a._reactRootContainer?(El(function(){v0(null,null,a,!1,function(){a._reactRootContainer=null,a[fo]=null})}),!0):!1},qr.unstable_batchedUpdates=G1,qr.unstable_renderSubtreeIntoContainer=function(a,c,p,y){if(!g0(p))throw Error(n(200));if(a==null||a._reactInternals===void 0)throw Error(n(38));return v0(a,c,p,!1,y)},qr.version="18.3.1-next-f1338f8080-20240426",qr}var wE;function WT(){if(wE)return Yy.exports;wE=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(),Yy.exports=Rz(),Yy.exports}var xE;function Mz(){if(xE)return M0;xE=1;var t=WT();return M0.createRoot=t.createRoot,M0.hydrateRoot=t.hydrateRoot,M0}var Iz=Mz();const Oz=Vg(Iz),jo={BASE_URL:"/",DEV:!1,MODE:"production",PROD:!0,SSR:!1};function qT(t){return"init"in t}function J2(t){return typeof t.write=="function"}function Lz(t){return!!t.onMount}function bE(t){return"v"in t||"e"in t}function lg(t){if("e"in t)throw t.e;if((jo?"production":void 0)!=="production"&&!("v"in t))throw new Error("[Bug] atom state is not initialized");return t.v}function cg(t){return typeof(t==null?void 0:t.then)=="function"}function Nz(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 GT(t,e,n){if(!n.p.has(t)){n.p.add(t);const r=()=>n.p.delete(t);e.then(r,r)}}function KT(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 Dz(t){return!!t.INTERNAL_onInit}const jz=(t,e,n,...r)=>n.read(...r),$z=(t,e,n,...r)=>n.write(...r),Fz=(t,e,n)=>n.INTERNAL_onInit(e),Vz=(t,e,n,r)=>{var s;return(s=n.onMount)==null?void 0:s.call(n,r)},Hz=(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),Dz(n)&&l(t,e,n)}return i},zz=(t,e)=>{var n;const r=t[1],s=t[3],i=t[4],o=t[5],l=t[6],u=t[13];if(!l.f&&!s.size&&!i.size&&!o.size)return;const d=[],f=h=>{try{h()}catch(g){d.push(g)}};do{l.f&&f(l.f);const h=new Set;for(const g of s){const v=(n=r.get(g))==null?void 0:n.l;if(v)for(const w of v)h.add(w)}s.clear();for(const g of o)h.add(g);o.clear();for(const g of i)h.add(g);i.clear();for(const g of h)f(g);s.size&&u(t,e)}while(s.size||o.size||i.size);if(d.length)throw new AggregateError(d)},Uz=(t,e)=>{const n=t[1],r=t[2],s=t[3],i=t[11],o=t[14],l=t[17];if(!s.size)return;const u=[],d=[],f=new WeakSet,h=new WeakSet,g=[],v=[];for(const 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(h.has(_)){g.pop(),v.pop();continue}if(f.has(_)){if(r.get(_)===x.n)u.push(_),d.push(x);else if((jo?"production":void 0)!=="production"&&r.has(_))throw new Error("[Bug] invalidated atom exists");h.add(_),g.pop(),v.pop();continue}f.add(_);for(const S of KT(_,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(_)}},ew=new WeakSet,Bz=(t,e,n)=>{var r,s;const i=t[1],o=t[2],l=t[3],u=t[6],d=t[7],f=t[11],h=t[12],g=t[13],v=t[14],w=t[16],_=t[17],x=t[20],S=t[26],k=t[28],C=f(t,e,n),A=k[0];if(bE(C)){if(i.has(n)&&o.get(n)!==C.n||C.m===A)return C.m=A,C;let G=!1;for(const[H,Y]of C.d)if(v(t,e,H).n!==Y){G=!0;break}if(!G)return C.m=A,C}let T=!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),h(t,e))}},O=G=>{var H;if(G===n){const U=f(t,e,G);if(!bE(U))if(qT(G))x(t,e,G,G.init);else throw new Error("no atom init");return lg(U)}const Y=v(t,e,G);try{return lg(Y)}finally{I.delete(G),C.d.set(G,Y.n),cg(C.v)&&GT(n,C.v,Y),i.has(n)&&((H=i.get(G))==null||H.t.add(n)),T||R()}};let N,D;const F={get signal(){return N||(N=new AbortController),N.signal},get setSelf(){return(jo?"production":void 0)!=="production"&&console.warn("[DEPRECATED] setSelf is deprecated and will be removed in v3."),(jo?"production":void 0)!=="production"&&!J2(n)&&console.warn("setSelf function cannot be used with read-only atom"),!D&&J2(n)&&(D=(...G)=>{if((jo?"production":void 0)!=="production"&&T&&console.warn("setSelf function cannot be called in sync"),!T)try{return w(t,e,n,G)}finally{g(t,e),h(t,e)}}),D}},K=C.n,B=o.get(n)===K;try{(jo?"production":void 0)!=="production"&&ew.delete(e);const G=d(t,e,n,O,F);if((jo?"production":void 0)!=="production"&&ew.has(e)&&console.warn("Detected store mutation during atom read. This is not supported."),x(t,e,n,G),cg(G)){S(t,e,G,()=>N==null?void 0:N.abort());const H=()=>{M(),R()};G.then(H,H)}else M();return(r=u.r)==null||r.call(u,n),C.m=A,C}catch(G){if(Nz(G))throw G;return delete C.v,C.e=G,++C.n,C.m=A,C}finally{T=!1,C.n!==K&&B&&(o.set(n,C.n),l.add(n),(s=u.c)==null||s.call(u,n))}},Zz=(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 KT(l,u,r)){const f=i(t,e,d);s.get(d)!==f.n&&(s.set(d,f.n),o.push(d))}}},Wz=(t,e,n,r)=>{const s=t[3],i=t[6],o=t[8],l=t[11],u=t[12],d=t[13],f=t[14],h=t[15],g=t[16],v=t[17],w=t[20],_=t[28];let x=!0;const S=C=>lg(f(t,e,C)),k=(C,...A)=>{var T;const I=l(t,e,C);try{if(C===n){if(!qT(C))throw new Error("atom not writable");(jo?"production":void 0)!=="production"&&ew.add(e);const M=I.n,R=A[0];w(t,e,C,R),v(t,e,C),M!==I.n&&(++_[0],s.add(C),h(t,e,C),(T=i.c)==null||T.call(i,C));return}else return g(t,e,C,A)}finally{x||(d(t,e),u(t,e))}};try{return o(t,e,n,S,k,...r)}finally{x=!1}},qz=(t,e,n)=>{var r;const s=t[1],i=t[3],o=t[6],l=t[11],u=t[15],d=t[18],f=t[19],h=l(t,e,n),g=s.get(n);if(g&&h.d.size>0){for(const[v,w]of h.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(!h.d.has(v)){g.d.delete(v);const w=f(t,e,v);w==null||w.t.delete(n)}}},Gz=(t,e,n)=>{var r;const s=t[1],i=t[4],o=t[6],l=t[10],u=t[11],d=t[12],f=t[13],h=t[14],g=t[16],v=t[18],w=u(t,e,n);let _=s.get(n);if(!_){h(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,_),J2(n)&&Lz(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 _},Kz=(t,e,n)=>{var r,s;const i=t[1],o=t[5],l=t[6],u=t[11],d=t[19],f=u(t,e,n);let h=i.get(n);if(!h||h.l.size)return h;let g=!1;for(const v of h.t)if((r=i.get(v))!=null&&r.d.has(n)){g=!0;break}if(!g){h.u&&o.add(h.u),h=void 0,i.delete(n);for(const v of f.d.keys()){const w=d(t,e,v);w==null||w.t.delete(n)}(s=l.u)==null||s.call(l,n);return}return h},Yz=(t,e,n,r)=>{const s=t[11],i=t[27],o=s(t,e,n),l="v"in o,u=o.v;if(cg(r))for(const d of o.d.keys())GT(n,r,s(t,e,d));o.v=r,delete o.e,(!l||!Object.is(u,o.v))&&(++o.n,cg(u)&&i(t,e,u))},Xz=(t,e,n)=>{const r=t[14];return lg(r(t,e,n))},Qz=(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))}},Jz=(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)}},eU=(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)},tU=(t,e,n)=>{const s=t[25].get(n);s==null||s.forEach(i=>i())},YT=new WeakMap;function nU(t){const e=YT.get(t);if((jo?"production":void 0)!=="production"&&!e)throw new Error("Store must be created by buildStore to read its building blocks");const n=e[24];return n?n(e,t):e}function rU(...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,{},jz,$z,Fz,Vz,Hz,zz,Uz,Bz,Zz,Wz,qz,Gz,Kz,Yz,Xz,Qz,Jz,void 0,new WeakMap,eU,tU,[0]].map((o,l)=>t[l]||o);YT.set(e,Object.freeze(n));const r=n[21],s=n[22],i=n[23];return e}const XT={};let sU=0;function ft(t,e){const n=`atom${++sU}`,r={toString(){return(XT?"production":void 0)!=="production"&&this.debugLabel?n+":"+this.debugLabel:n}};return typeof t=="function"?r.read=t:(r.init=t,r.read=iU,r.write=oU),e&&(r.write=e),r}function iU(t){return t(this)}function oU(t,e,n){return e(this,typeof n=="function"?n(t(this)):n)}function aU(){return rU()}let Cf;function lU(){return Cf||(Cf=aU(),(XT?"production":void 0)!=="production"&&(globalThis.__JOTAI_DEFAULT_STORE__||(globalThis.__JOTAI_DEFAULT_STORE__=Cf),globalThis.__JOTAI_DEFAULT_STORE__!==Cf&&console.warn("Detected multiple Jotai instances. It may cause unexpected behavior with the default store. https://github.com/pmndrs/jotai/discussions/2044"))),Cf}const cU={},uU=m.createContext(void 0);function qg(t){return m.useContext(uU)||lU()}const tw=t=>typeof(t==null?void 0:t.then)=="function",nw=t=>{t.status||(t.status="pending",t.then(e=>{t.status="fulfilled",t.value=e},e=>{t.status="rejected",t.reason=e}))},dU=we.use||(t=>{if(t.status==="pending")throw t;if(t.status==="fulfilled")return t.value;throw t.status==="rejected"?t.reason:(nw(t),t)}),Jy=new WeakMap,SE=(t,e,n)=>{const r=nU(t),s=r[26];let i=Jy.get(e);return i||(i=new Promise((o,l)=>{let u=e;const d=g=>v=>{u===g&&o(v)},f=g=>v=>{u===g&&l(v)},h=()=>{try{const g=n();tw(g)?(Jy.set(g,i),u=g,g.then(d(g),f(g)),s(r,t,g,h)):o(g)}catch(g){l(g)}};e.then(d(e),f(e)),s(r,t,e,h)}),Jy.set(e,i)),i};function dt(t,e){const{delay:n,unstable_promiseStatus:r=!we.use}={},s=qg(),[[i,o,l],u]=m.useReducer(f=>{const h=s.get(t);return Object.is(f[0],h)&&f[1]===s&&f[2]===t?f:[h,s,t]},void 0,()=>[s.get(t),s,t]);let d=i;if((o!==s||l!==t)&&(u(),d=s.get(t)),m.useEffect(()=>{const f=s.sub(t,()=>{if(r)try{const h=s.get(t);tw(h)&&nw(SE(s,h,()=>s.get(t)))}catch{}if(typeof n=="number"){console.warn(`[DEPRECATED] delay option is deprecated and will be removed in v3.
43
+
44
+ Migration guide:
45
+
46
+ Create a custom hook like the following.
47
+
48
+ function useAtomValueWithDelay<Value>(
49
+ atom: Atom<Value>,
50
+ options: { delay: number },
51
+ ): Value {
52
+ const { delay } = options
53
+ const store = useStore(options)
54
+ const [value, setValue] = useState(() => store.get(atom))
55
+ useEffect(() => {
56
+ const unsub = store.sub(atom, () => {
57
+ setTimeout(() => setValue(store.get(atom)), delay)
58
+ })
59
+ return unsub
60
+ }, [store, atom, delay])
61
+ return value
62
+ }
63
+ `),setTimeout(u,n);return}u()});return u(),f},[s,t,n,r]),m.useDebugValue(d),tw(d)){const f=SE(s,d,()=>s.get(t));return r&&nw(f),dU(f)}return d}function gt(t,e){const n=qg();return m.useCallback((...s)=>{if((cU?"production":void 0)!=="production"&&!("write"in t))throw new Error("not writable atom");return n.set(t,...s)},[n,t])}function QT(t,e){return[dt(t),gt(t)]}const rb=m.createContext({});function sb(t){const e=m.useRef(null);return e.current===null&&(e.current=t()),e.current}const fU=typeof window<"u",ib=fU?m.useLayoutEffect:m.useEffect,Gg=m.createContext(null);function ob(t,e){t.indexOf(e)===-1&&t.push(e)}function ug(t,e){const n=t.indexOf(e);n>-1&&t.splice(n,1)}const eo=(t,e,n)=>n>e?e:n<t?t:n;let Kg=()=>{};const Ya={},JT=t=>/^-?(?:\d+(?:\.\d+)?|\.\d+)$/u.test(t),eR=t=>typeof t=="object"&&t!==null,tR=t=>/^0[^.\s]+$/u.test(t);function nR(t){let e;return()=>(e===void 0&&(e=t()),e)}const Xs=t=>t,tp=(...t)=>t.reduce((e,n)=>r=>n(e(r))),kh=(t,e,n)=>{const r=e-t;return r?(n-t)/r:1};class ab{constructor(){this.subscriptions=[]}add(e){return ob(this.subscriptions,e),()=>ug(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 Es=t=>t*1e3,qs=t=>t/1e3,rR=(t,e)=>e?t*(1e3/e):0,sR=(t,e,n)=>(((1-3*n+3*e)*t+(3*n-6*e))*t+3*e)*t,hU=1e-7,pU=12;function mU(t,e,n,r,s){let i,o,l=0;do o=e+(n-e)/2,i=sR(o,r,s)-t,i>0?n=o:e=o;while(Math.abs(i)>hU&&++l<pU);return o}function np(t,e,n,r){if(t===e&&n===r)return Xs;const s=i=>mU(i,0,1,t,n);return i=>i===0||i===1?i:sR(s(i),e,r)}const iR=t=>e=>e<=.5?t(2*e)/2:(2-t(2*(1-e)))/2,oR=t=>e=>1-t(1-e),aR=np(.33,1.53,.69,.99),lb=oR(aR),lR=iR(lb),cR=t=>t>=1?1:(t*=2)<1?.5*lb(t):.5*(2-Math.pow(2,-10*(t-1))),cb=t=>1-Math.sin(Math.acos(t)),uR=oR(cb),dR=iR(cb),gU=np(.42,0,1,1),vU=np(0,0,.58,1),fR=np(.42,0,.58,1),yU=t=>Array.isArray(t)&&typeof t[0]!="number",hR=t=>Array.isArray(t)&&typeof t[0]=="number",_U={linear:Xs,easeIn:gU,easeInOut:fR,easeOut:vU,circIn:cb,circInOut:dR,circOut:uR,backIn:lb,backInOut:lR,backOut:aR,anticipate:cR},wU=t=>typeof t=="string",kE=t=>{if(hR(t)){Kg(t.length===4);const[e,n,r,s]=t;return np(e,n,r,s)}else if(wU(t))return _U[t];return t},I0=["setup","read","resolveKeyframes","preUpdate","update","preRender","render","postRender"];function xU(t){let e=new Set,n=new Set,r=!1,s=!1;const i=new WeakSet;let o={delta:0,timestamp:0,isProcessing:!1};function l(d){i.has(d)&&(u.schedule(d),t()),d(o)}const u={schedule:(d,f=!1,h=!1)=>{const v=h&&r?e:n;return f&&i.add(d),v.add(d),d},cancel:d=>{n.delete(d),i.delete(d)},process:d=>{if(o=d,r){s=!0;return}r=!0;const f=e;e=n,n=f,e.forEach(l),e.clear(),r=!1,s&&(s=!1,u.process(d))}};return u}const bU=40;function pR(t,e){let n=!1,r=!0;const s={delta:0,timestamp:0,isProcessing:!1},i=()=>n=!0,o=I0.reduce((C,A)=>(C[A]=xU(i),C),{}),{setup:l,read:u,resolveKeyframes:d,preUpdate:f,update:h,preRender:g,render:v,postRender:w}=o,_=()=>{const C=Ya.useManualTiming,A=C?s.timestamp:performance.now();n=!1,C||(s.delta=r?1e3/60:Math.max(Math.min(A-s.timestamp,bU),1)),s.timestamp=A,s.isProcessing=!0,l.process(s),u.process(s),d.process(s),f.process(s),h.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:I0.reduce((C,A)=>{const T=o[A];return C[A]=(I,M=!1,R=!1)=>(n||x(),T.schedule(I,M,R)),C},{}),cancel:C=>{for(let A=0;A<I0.length;A++)o[I0[A]].cancel(C)},state:s,steps:o}}const{schedule:Qt,cancel:Xa,state:hr,steps:e_}=pR(typeof requestAnimationFrame<"u"?requestAnimationFrame:Xs,!0);let um;function SU(){um=void 0}const $r={now:()=>(um===void 0&&$r.set(hr.isProcessing||Ya.useManualTiming?hr.timestamp:performance.now()),um),set:t=>{um=t,queueMicrotask(SU)}},mR=t=>e=>typeof e=="string"&&e.startsWith(t),gR=mR("--"),kU=mR("var(--"),ub=t=>kU(t)?EU.test(t.split("/*")[0].trim()):!1,EU=/var\(--(?:[\w-]+\s*|[\w-]+\s*,(?:\s*[^)(\s]|\s*\((?:[^)(]|\([^)(]*\))*\))+\s*)\)$/iu;function EE(t){return typeof t!="string"?!1:t.split("/*")[0].includes("var(--")}const kd={test:t=>typeof t=="number",parse:parseFloat,transform:t=>t},Eh={...kd,transform:t=>eo(0,1,t)},O0={...kd,default:1},Qf=t=>Math.round(t*1e5)/1e5,db=/-?(?:\d+(?:\.\d+)?|\.\d+)/gu;function CU(t){return t==null}const PU=/^(?:#[\da-f]{3,8}|(?:rgb|hsl)a?\((?:-?[\d.]+%?[,\s]+){2}-?[\d.]+%?\s*(?:[,/]\s*)?(?:\b\d+(?:\.\d+)?|\.\d+)?%?\))$/iu,fb=(t,e)=>n=>!!(typeof n=="string"&&PU.test(n)&&n.startsWith(t)||e&&!CU(n)&&Object.prototype.hasOwnProperty.call(n,e)),vR=(t,e,n)=>r=>{if(typeof r!="string")return r;const[s,i,o,l]=r.match(db);return{[t]:parseFloat(s),[e]:parseFloat(i),[n]:parseFloat(o),alpha:l!==void 0?parseFloat(l):1}},AU=t=>eo(0,255,t),t_={...kd,transform:t=>Math.round(AU(t))},Gl={test:fb("rgb","red"),parse:vR("red","green","blue"),transform:({red:t,green:e,blue:n,alpha:r=1})=>"rgba("+t_.transform(t)+", "+t_.transform(e)+", "+t_.transform(n)+", "+Qf(Eh.transform(r))+")"};function TU(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 rw={test:fb("#"),parse:TU,transform:Gl.transform},rp=t=>({test:e=>typeof e=="string"&&e.endsWith(t)&&e.split(" ").length===1,parse:parseFloat,transform:e=>`${e}${t}`}),To=rp("deg"),Yi=rp("%"),Ve=rp("px"),RU=rp("vh"),MU=rp("vw"),CE={...Yi,parse:t=>Yi.parse(t)/100,transform:t=>Yi.transform(t*100)},Pu={test:fb("hsl","hue"),parse:vR("hue","saturation","lightness"),transform:({hue:t,saturation:e,lightness:n,alpha:r=1})=>"hsla("+Math.round(t)+", "+Yi.transform(Qf(e))+", "+Yi.transform(Qf(n))+", "+Qf(Eh.transform(r))+")"},zn={test:t=>Gl.test(t)||rw.test(t)||Pu.test(t),parse:t=>Gl.test(t)?Gl.parse(t):Pu.test(t)?Pu.parse(t):rw.parse(t),transform:t=>typeof t=="string"?t:t.hasOwnProperty("red")?Gl.transform(t):Pu.transform(t),getAnimatableNone:t=>{const e=zn.parse(t);return e.alpha=0,zn.transform(e)}},IU=/(?:#[\da-f]{3,8}|(?:rgb|hsl)a?\((?:-?[\d.]+%?[,\s]+){2}-?[\d.]+%?\s*(?:[,/]\s*)?(?:\b\d+(?:\.\d+)?|\.\d+)?%?\))/giu;function OU(t){var e,n;return isNaN(t)&&typeof t=="string"&&(((e=t.match(db))==null?void 0:e.length)||0)+(((n=t.match(IU))==null?void 0:n.length)||0)>0}const yR="number",_R="color",LU="var",NU="var(",PE="${}",DU=/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 hd(t){const e=t.toString(),n=[],r={color:[],number:[],var:[]},s=[];let i=0;const l=e.replace(DU,u=>(zn.test(u)?(r.color.push(i),s.push(_R),n.push(zn.parse(u))):u.startsWith(NU)?(r.var.push(i),s.push(LU),n.push(u)):(r.number.push(i),s.push(yR),n.push(parseFloat(u))),++i,PE)).split(PE);return{values:n,split:l,indexes:r,types:s}}function jU(t){return hd(t).values}function wR({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===yR?s+=Qf(r[i]):o===_R?s+=zn.transform(r[i]):s+=r[i]}return s}}function $U(t){return wR(hd(t))}const FU=t=>typeof t=="number"?0:zn.test(t)?zn.getAnimatableNone(t):t,VU=(t,e)=>typeof t=="number"?e!=null&&e.trim().endsWith("/")?t:0:FU(t);function HU(t){const e=hd(t);return wR(e)(e.values.map((r,s)=>VU(r,e.split[s])))}const bi={test:OU,parse:jU,createTransformer:$U,getAnimatableNone:HU};function n_(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 zU({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=n_(u,l,t+1/3),i=n_(u,l,t),o=n_(u,l,t-1/3)}return{red:Math.round(s*255),green:Math.round(i*255),blue:Math.round(o*255),alpha:r}}function dg(t,e){return n=>n>0?e:t}const Xt=(t,e,n)=>t+(e-t)*n,r_=(t,e,n)=>{const r=t*t,s=n*(e*e-r)+r;return s<0?0:Math.sqrt(s)},UU=[rw,Gl,Pu],BU=t=>UU.find(e=>e.test(t));function AE(t){const e=BU(t);if(!e)return!1;let n=e.parse(t);return e===Pu&&(n=zU(n)),n}const TE=(t,e)=>{const n=AE(t),r=AE(e);if(!n||!r)return dg(t,e);const s={...n};return i=>(s.red=r_(n.red,r.red,i),s.green=r_(n.green,r.green,i),s.blue=r_(n.blue,r.blue,i),s.alpha=Xt(n.alpha,r.alpha,i),Gl.transform(s))},sw=new Set(["none","hidden"]);function ZU(t,e){return sw.has(t)?n=>n<=0?t:e:n=>n>=1?e:t}function WU(t,e){return n=>Xt(t,e,n)}function hb(t){return typeof t=="number"?WU:typeof t=="string"?ub(t)?dg:zn.test(t)?TE:KU:Array.isArray(t)?xR:typeof t=="object"?zn.test(t)?TE:qU:dg}function xR(t,e){const n=[...t],r=n.length,s=t.map((i,o)=>hb(i)(i,e[o]));return i=>{for(let o=0;o<r;o++)n[o]=s[o](i);return n}}function qU(t,e){const n={...t,...e},r={};for(const s in n)t[s]!==void 0&&e[s]!==void 0&&(r[s]=hb(t[s])(t[s],e[s]));return s=>{for(const i in r)n[i]=r[i](s);return n}}function GU(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 KU=(t,e)=>{const n=bi.createTransformer(e),r=hd(t),s=hd(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?sw.has(t)&&!s.values.length||sw.has(e)&&!r.values.length?ZU(t,e):tp(xR(GU(r,s),s.values),n):dg(t,e)};function bR(t,e,n){return typeof t=="number"&&typeof e=="number"&&typeof n=="number"?Xt(t,e,n):hb(t)(t,e)}const YU=t=>{const e=({timestamp:n})=>t(n);return{start:(n=!0)=>Qt.update(e,n),stop:()=>Xa(e),now:()=>hr.isProcessing?hr.timestamp:$r.now()}},SR=(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)})`},fg=2e4;function pb(t){let e=0;const n=50;let r=t.next(e);for(;!r.done&&e<fg;)e+=n,r=t.next(e);return e>=fg?1/0:e}function XU(t,e=100,n){const r=n({...t,keyframes:[0,e]}),s=Math.min(pb(r),fg);return{type:"keyframes",ease:i=>r.next(s*i).value/e,duration:qs(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 iw(t,e){return t*Math.sqrt(1-e*e)}const QU=12;function JU(t,e,n){let r=n;for(let s=1;s<QU;s++)r=r-t(r)/e(r);return r}const s_=.001;function eB({duration:t=Pn.duration,bounce:e=Pn.bounce,velocity:n=Pn.velocity,mass:r=Pn.mass}){let s,i,o=1-e;o=eo(Pn.minDamping,Pn.maxDamping,o),t=eo(Pn.minDuration,Pn.maxDuration,qs(t)),o<1?(s=d=>{const f=d*o,h=f*t,g=f-n,v=iw(d,o),w=Math.exp(-h);return s_-g/v*w},i=d=>{const h=d*o*t,g=h*n+n,v=Math.pow(o,2)*Math.pow(d,2)*t,w=Math.exp(-h),_=iw(Math.pow(d,2),o);return(-s(d)+s_>0?-1:1)*((g-v)*w)/_}):(s=d=>{const f=Math.exp(-d*t),h=(d-n)*t+1;return-s_+f*h},i=d=>{const f=Math.exp(-d*t),h=(n-d)*(t*t);return f*h});const l=5/t,u=JU(s,i,l);if(t=Es(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 tB=["duration","bounce"],nB=["stiffness","damping","mass"];function RE(t,e){return e.some(n=>t[n]!==void 0)}function rB(t){let e={velocity:Pn.velocity,stiffness:Pn.stiffness,damping:Pn.damping,mass:Pn.mass,isResolvedFromDuration:!1,...t};if(!RE(t,nB)&&RE(t,tB))if(e.velocity=0,t.visualDuration){const n=t.visualDuration,r=2*Math.PI/(n*1.2),s=r*r,i=2*eo(.05,1,1-(t.bounce||0))*Math.sqrt(s);e={...e,mass:Pn.mass,stiffness:s,damping:i}}else{const n=eB({...t,velocity:0});e={...e,...n,mass:Pn.mass},e.isResolvedFromDuration=!0}return e}function hg(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:h,velocity:g,isResolvedFromDuration:v}=rB({...n,velocity:-qs(n.velocity||0)}),w=g||0,_=d/(2*Math.sqrt(u*f)),x=o-i,S=qs(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,A,T,I,M,R;if(_<1)T=iw(S,_),I=(w+_*S*x)/T,C=N=>{const D=Math.exp(-_*S*N);return o-D*(I*Math.sin(T*N)+x*Math.cos(T*N))},M=_*S*I+x*T,R=_*S*x-I*T,A=N=>Math.exp(-_*S*N)*(M*Math.sin(T*N)+R*Math.cos(T*N));else if(_===1){C=D=>o-Math.exp(-S*D)*(x+(w+S*x)*D);const N=w+S*x;A=D=>Math.exp(-S*D)*(S*N*D-w)}else{const N=S*Math.sqrt(_*_-1);C=B=>{const G=Math.exp(-_*S*B),H=Math.min(N*B,300);return o-G*((w+_*S*x)*Math.sinh(H)+N*x*Math.cosh(H))/N};const D=(w+_*S*x)/N,F=_*S*D-x*N,K=_*S*x-D*N;A=B=>{const G=Math.exp(-_*S*B),H=Math.min(N*B,300);return G*(F*Math.sinh(H)+K*Math.cosh(H))}}const O={calculatedDuration:v&&h||null,velocity:N=>Es(A(N)),next:N=>{if(!v&&_<1){const F=Math.exp(-_*S*N),K=Math.sin(T*N),B=Math.cos(T*N),G=o-F*(I*K+x*B),H=Es(F*(M*K+R*B));return l.done=Math.abs(H)<=r&&Math.abs(o-G)<=s,l.value=l.done?o:G,l}const D=C(N);if(v)l.done=N>=h;else{const F=Es(A(N));l.done=Math.abs(F)<=r&&Math.abs(o-D)<=s}return l.value=l.done?o:D,l},toString:()=>{const N=Math.min(pb(O),fg),D=SR(F=>O.next(N*F).value,N,30);return N+"ms "+D},toTransition:()=>{}};return O}hg.applyToOptions=t=>{const e=XU(t,100,hg);return t.ease=e.ease,t.duration=Es(e.duration),t.type="keyframes",t};const sB=5;function kR(t,e,n){const r=Math.max(e-sB,0);return rR(n-t(r),e-r)}function ow({keyframes:t,velocity:e=0,power:n=.8,timeConstant:r=325,bounceDamping:s=10,bounceStiffness:i=500,modifyTarget:o,min:l,max:u,restDelta:d=.5,restSpeed:f}){const h=t[0],g={done:!1,value:h},v=R=>l!==void 0&&R<l||u!==void 0&&R>u,w=R=>l===void 0?u:u===void 0||Math.abs(l-R)<Math.abs(u-R)?l:u;let _=n*e;const x=h+_,S=o===void 0?x:o(x);S!==x&&(_=S-h);const k=R=>-_*Math.exp(-R/r),C=R=>S+k(R),A=R=>{const O=k(R),N=C(R);g.done=Math.abs(O)<=d,g.value=g.done?S:N};let T,I;const M=R=>{v(g.value)&&(T=R,I=hg({keyframes:[g.value,w(g.value)],velocity:kR(C,R,g.value),damping:s,stiffness:i,restDelta:d,restSpeed:f}))};return M(0),{calculatedDuration:null,next:R=>{let O=!1;return!I&&T===void 0&&(O=!0,A(R),M(R)),T!==void 0&&R>=T?I.next(R-T):(!O&&A(R),g)}}}function iB(t,e,n){const r=[],s=n||Ya.mix||bR,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]||Xs:e;l=tp(u,l)}r.push(l)}return r}function oB(t,e,{clamp:n=!0,ease:r,mixer:s}={}){const i=t.length;if(Kg(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=iB(e,r,s),u=l.length,d=f=>{if(o&&f<t[0])return e[0];let h=0;if(u>1)for(;h<t.length-2&&!(f<t[h+1]);h++);const g=kh(t[h],t[h+1],f);return l[h](g)};return n?f=>d(eo(t[0],t[i-1],f)):d}function aB(t,e){const n=t[t.length-1];for(let r=1;r<=e;r++){const s=kh(0,e,r);t.push(Xt(n,1,s))}}function lB(t){const e=[0];return aB(e,t.length-1),e}function cB(t,e){return t.map(n=>n*e)}function uB(t,e){return t.map(()=>e||fR).splice(0,t.length-1)}function Jf({duration:t=300,keyframes:e,times:n,ease:r="easeInOut"}){const s=yU(r)?r.map(kE):kE(r),i={done:!1,value:e[0]},o=cB(n&&n.length===e.length?n:lB(e),t),l=oB(o,e,{ease:Array.isArray(s)?s:uB(e,s)});return{calculatedDuration:t,next:u=>(i.value=l(u),i.done=u>=t,i)}}const dB=t=>t!==null;function Yg(t,{repeat:e,repeatType:n="loop"},r,s=1){const i=t.filter(dB),l=s<0||e&&n!=="loop"&&e%2===1?0:i.length-1;return!l||r===void 0?i[l]:r}const fB={decay:ow,inertia:ow,tween:Jf,keyframes:Jf,spring:hg};function ER(t){typeof t.type=="string"&&(t.type=fB[t.type])}class mb{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 hB=t=>t/100;class pg extends mb{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!==$r.now()&&this.tick($r.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;ER(e);const{type:n=Jf,repeat:r=0,repeatDelay:s=0,repeatType:i,velocity:o=0}=e;let{keyframes:l}=e;const u=n||Jf;u!==Jf&&typeof l[0]!="number"&&(this.mixKeyframes=tp(hB,bR(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=pb(d));const{calculatedDuration:f}=d;this.calculatedDuration=f,this.resolvedDuration=f+s,this.totalDuration=this.resolvedDuration*(r+1)-s,this.generator=d}updateTime(e){const n=Math.round(e-this.startTime)*this.playbackSpeed;this.holdTime!==null?this.currentTime=this.holdTime:this.currentTime=n}tick(e,n=!1){const{generator:r,totalDuration:s,mixKeyframes:i,mirroredGenerator:o,resolvedDuration:l,calculatedDuration:u}=this;if(this.startTime===null)return r.next(0);const{delay:d=0,keyframes:f,repeat:h,repeatType:g,repeatDelay:v,type: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,A=r;if(h){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,h+1),!!(O%2)&&(g==="reverse"?(N=1-N,v&&(N-=v/l)):g==="mirror"&&(A=o)),C=eo(0,1,N)*l}let T;k?(this.delayState.value=f[0],T=this.delayState):T=A.next(C),i&&!k&&(T.value=i(T.value));let{done:I}=T;!k&&u!==null&&(I=this.playbackSpeed>=0?this.currentTime>=s:this.currentTime<=0);const M=this.holdTime===null&&(this.state==="finished"||this.state==="running"&&I);return M&&w!==ow&&(T.value=Yg(f,this.options,x,this.speed)),_&&_(T.value),M&&this.finish(),T}then(e,n){return this.finished.then(e,n)}get duration(){return qs(this.calculatedDuration)}get iterationDuration(){const{delay:e=0}=this.options||{};return this.duration+qs(e)}get time(){return qs(this.currentTime)}set time(e){e=Es(e),this.currentTime=e,this.startTime===null||this.holdTime!==null||this.playbackSpeed===0?this.holdTime=e:this.driver&&(this.startTime=this.driver.now()-e/this.playbackSpeed),this.driver?this.driver.start(!1):(this.startTime=0,this.state="paused",this.holdTime=e,this.tick(e))}getGeneratorVelocity(){const e=this.currentTime;if(e<=0)return this.options.velocity||0;if(this.generator.velocity)return this.generator.velocity(e);const n=this.generator.next(e).value;return kR(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($r.now()),this.playbackSpeed=e,n&&this.driver&&(this.time=qs(this.currentTime))}play(){var s,i;if(this.isStopped)return;const{driver:e=YU,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($r.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 pB(t){for(let e=1;e<t.length;e++)t[e]??(t[e]=t[e-1])}const Kl=t=>t*180/Math.PI,aw=t=>{const e=Kl(Math.atan2(t[1],t[0]));return lw(e)},mB={x:4,y:5,translateX:4,translateY:5,scaleX:0,scaleY:3,scale:t=>(Math.abs(t[0])+Math.abs(t[3]))/2,rotate:aw,rotateZ:aw,skewX:t=>Kl(Math.atan(t[1])),skewY:t=>Kl(Math.atan(t[2])),skew:t=>(Math.abs(t[1])+Math.abs(t[2]))/2},lw=t=>(t=t%360,t<0&&(t+=360),t),ME=aw,IE=t=>Math.sqrt(t[0]*t[0]+t[1]*t[1]),OE=t=>Math.sqrt(t[4]*t[4]+t[5]*t[5]),gB={x:12,y:13,z:14,translateX:12,translateY:13,translateZ:14,scaleX:IE,scaleY:OE,scale:t=>(IE(t)+OE(t))/2,rotateX:t=>lw(Kl(Math.atan2(t[6],t[5]))),rotateY:t=>lw(Kl(Math.atan2(-t[2],t[0]))),rotateZ:ME,rotate:ME,skewX:t=>Kl(Math.atan(t[4])),skewY:t=>Kl(Math.atan(t[1])),skew:t=>(Math.abs(t[1])+Math.abs(t[4]))/2};function cw(t){return t.includes("scale")?1:0}function uw(t,e){if(!t||t==="none")return cw(e);const n=t.match(/^matrix3d\(([-\d.e\s,]+)\)$/u);let r,s;if(n)r=gB,s=n;else{const l=t.match(/^matrix\(([-\d.e\s,]+)\)$/u);r=mB,s=l}if(!s)return cw(e);const i=r[e],o=s[1].split(",").map(yB);return typeof i=="function"?i(o):o[i]}const vB=(t,e)=>{const{transform:n="none"}=getComputedStyle(t);return uw(n,e)};function yB(t){return parseFloat(t.trim())}const Ed=["transformPerspective","x","y","z","translateX","translateY","translateZ","scale","scaleX","scaleY","rotate","rotateX","rotateY","rotateZ","skew","skewX","skewY"],Cd=new Set([...Ed,"pathRotation"]),LE=t=>t===kd||t===Ve,_B=new Set(["x","y","z"]),wB=Ed.filter(t=>!_B.has(t));function xB(t){const e=[];return wB.forEach(n=>{const r=t.getValue(n);r!==void 0&&(e.push([n,r.get()]),r.set(n.startsWith("scale")?1:0))}),e}const Va={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})=>uw(e,"x"),y:(t,{transform:e})=>uw(e,"y")};Va.translateX=Va.x;Va.translateY=Va.y;const uc=new Set;let dw=!1,fw=!1,hw=!1;function CR(){if(fw){const t=Array.from(uc).filter(r=>r.needsMeasurement),e=new Set(t.map(r=>r.element)),n=new Map;e.forEach(r=>{const s=xB(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)})}fw=!1,dw=!1,uc.forEach(t=>t.complete(hw)),uc.clear()}function PR(){uc.forEach(t=>{t.readKeyframes(),t.needsMeasurement&&(fw=!0)})}function bB(){hw=!0,PR(),CR(),hw=!1}class gb{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?(uc.add(this),dw||(dw=!0,Qt.read(PR),Qt.resolveKeyframes(CR))):(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])}pB(e)}setFinalKeyframe(){}measureInitialState(){}renderEndStyles(){}measureEndState(){}complete(e=!1){this.state="complete",this.onComplete(this.unresolvedKeyframes,this.finalKeyframe,e),uc.delete(this)}cancel(){this.state==="scheduled"&&(uc.delete(this),this.state="pending")}resume(){this.state==="pending"&&this.scheduleResolve()}}const SB=t=>t.startsWith("--");function AR(t,e,n){SB(e)?t.style.setProperty(e,n):t.style[e]=n}const kB={};function TR(t,e){const n=nR(t);return()=>kB[e]??n()}const EB=TR(()=>window.ScrollTimeline!==void 0,"scrollTimeline"),RR=TR(()=>{try{document.createElement("div").animate({opacity:0},{easing:"linear(0, 1)"})}catch{return!1}return!0},"linearEasing"),jf=([t,e,n,r])=>`cubic-bezier(${t}, ${e}, ${n}, ${r})`,NE={linear:"linear",ease:"ease",easeIn:"ease-in",easeOut:"ease-out",easeInOut:"ease-in-out",circIn:jf([0,.65,.55,1]),circOut:jf([.55,0,1,.45]),backIn:jf([.31,.01,.66,-.59]),backOut:jf([.33,1.53,.69,.99])};function MR(t,e){if(t)return typeof t=="function"?RR()?SR(t,e):"ease-out":hR(t)?jf(t):Array.isArray(t)?t.map(n=>MR(n,e)||NE.easeOut):NE[t]}function CB(t,e,n,{delay:r=0,duration:s=300,repeat:i=0,repeatType:o="loop",ease:l="easeOut",times:u}={},d=void 0){const f={[e]:n};u&&(f.offset=u);const h=MR(l,s);Array.isArray(h)&&(f.easing=h);const g={delay:r,duration:s,easing:Array.isArray(h)?"linear":h,fill:"both",iterations:i+1,direction:o==="reverse"?"alternate":"normal"};return d&&(g.pseudoElement=d),t.animate(f,g)}function IR(t){return typeof t=="function"&&"applyToOptions"in t}function PB({type:t,...e}){return IR(t)&&RR()?t.applyToOptions(e):(e.duration??(e.duration=300),e.ease??(e.ease="easeOut"),e)}class OR extends mb{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,Kg(typeof e.type!="string");const d=PB(e);this.animation=CB(n,r,s,d,i),d.autoplay===!1&&this.animation.pause(),this.animation.onfinish=()=>{if(this.finishedTime=this.time,!i){const f=Yg(s,this.options,l,this.speed);this.updateMotionValue&&this.updateMotionValue(f),AR(n,r,f),this.animation.cancel()}u==null||u(),this.notifyFinished()}}play(){this.isStopped||(this.manualStartTime=null,this.animation.play(),this.state==="finished"&&this.updateFinished())}pause(){this.animation.pause()}complete(){var e,n;(n=(e=this.animation).finish)==null||n.call(e)}cancel(){try{this.animation.cancel()}catch{}}stop(){if(this.isStopped)return;this.isStopped=!0;const{state:e}=this;e==="idle"||e==="finished"||(this.updateMotionValue?this.updateMotionValue():this.commitStyles(),this.isPseudoElement||this.cancel())}commitStyles(){var n,r,s;const e=(n=this.options)==null?void 0:n.element;!this.isPseudoElement&&(e!=null&&e.isConnected)&&((s=(r=this.animation).commitStyles)==null||s.call(r))}get duration(){var n,r;const e=((r=(n=this.animation.effect)==null?void 0:n.getComputedTiming)==null?void 0:r.call(n).duration)||0;return qs(Number(e))}get iterationDuration(){const{delay:e=0}=this.options||{};return this.duration+qs(e)}get time(){return qs(Number(this.animation.currentTime)||0)}set time(e){const n=this.finishedTime!==null;this.manualStartTime=null,this.finishedTime=null,this.animation.currentTime=Es(e),n&&this.animation.pause()}get speed(){return this.animation.playbackRate}set speed(e){e<0&&(this.finishedTime=null),this.animation.playbackRate=e}get state(){return this.finishedTime!==null?"finished":this.animation.playState}get startTime(){return this.manualStartTime??Number(this.animation.startTime)}set startTime(e){this.manualStartTime=this.animation.startTime=e}attachTimeline({timeline:e,rangeStart:n,rangeEnd:r,observe:s}){var i;return this.allowFlatten&&((i=this.animation.effect)==null||i.updateTiming({easing:"linear"})),this.animation.onfinish=null,e&&EB()?(this.animation.timeline=e,n&&(this.animation.rangeStart=n),r&&(this.animation.rangeEnd=r),Xs):s(this)}}const LR={anticipate:cR,backInOut:lR,circInOut:dR};function AB(t){return t in LR}function TB(t){typeof t.ease=="string"&&AB(t.ease)&&(t.ease=LR[t.ease])}const i_=10;class RB extends OR{constructor(e){TB(e),ER(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 pg({...o,autoplay:!1}),u=Math.max(i_,$r.now()-this.startTime),d=eo(0,i_,u-i_),f=l.sample(u).value,{name:h}=this.options;i&&h&&AR(i,h,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"&&(bi.test(t)||t==="0")&&!t.startsWith("url("));function MB(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 IB(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:MB(t)||(n==="spring"||IR(n))&&r}function pw(t){t.duration=0,t.type="keyframes"}const NR=new Set(["opacity","clipPath","filter","transform","backgroundColor"]),OB=/^(?:oklch|oklab|lab|lch|color|color-mix|light-dark)\(/;function LB(t){for(let e=0;e<t.length;e++)if(typeof t[e]=="string"&&OB.test(t[e]))return!0;return!1}const NB=new Set(["color","backgroundColor","outlineColor","fill","stroke","borderColor","borderTopColor","borderRightColor","borderBottomColor","borderLeftColor"]),DB=nR(()=>Object.hasOwnProperty.call(Element.prototype,"animate"));function jB(t){var h;const{motionValue:e,name:n,repeatDelay:r,repeatType:s,damping:i,type:o,keyframes:l}=t,u=(h=e==null?void 0:e.owner)==null?void 0:h.current;if(!(u instanceof HTMLElement)&&!(u instanceof SVGElement))return!1;const{onUpdate:d,transformTemplate:f}=e.owner.getProps();return DB()&&n&&(NR.has(n)||NB.has(n)&&LB(l))&&(n!=="transform"||!f)&&!d&&!r&&s!=="mirror"&&i!==0&&o!=="inertia"}const $B=40;class FB extends mb{constructor({autoplay:e=!0,delay:n=0,type:r="keyframes",repeat:s=0,repeatDelay:i=0,repeatType:o="loop",keyframes:l,name:u,motionValue:d,element:f,...h}){var w;super(),this.stop=()=>{var _,x;this._animation&&(this._animation.stop(),(_=this.stopTimeline)==null||_.call(this)),(x=this.keyframeResolver)==null||x.cancel()},this.createdAt=$r.now();const g={autoplay:e,delay:n,type:r,repeat:s,repeatDelay:i,repeatType:o,name:u,motionValue:d,element:f,...h},v=(f==null?void 0:f.KeyframeResolver)||gb;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=$r.now();let h=!0;IB(e,i,o,l)||(h=!1,(Ya.instantAnimations||!u)&&(f==null||f(Yg(e,r,n))),e[0]=e[e.length-1],pw(r),r.repeat=0);const v={startTime:s?this.resolvedAt?this.resolvedAt-this.createdAt>$B?this.resolvedAt:this.createdAt:this.createdAt:void 0,finalKeyframe:n,...r,keyframes:e},w=h&&!d&&jB(v),_=(k=(S=v.motionValue)==null?void 0:S.owner)==null?void 0:k.current;let x;if(w)try{x=new RB({...v,element:_})}catch{x=new pg(v)}else x=new pg(v);x.finished.then(()=>{this.notifyFinished()}).catch(Xs),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(),bB()),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 DR(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 jE=30,VB=t=>!isNaN(parseFloat(t));class HB{constructor(e,n={}){this.canTrackVelocity=null,this.events={},this.updateAndNotify=r=>{var i;const s=$r.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=$r.now(),this.canTrackVelocity===null&&e!==void 0&&(this.canTrackVelocity=VB(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 ab);const r=this.events[e].add(n);return e==="change"?()=>{r(),Qt.read(()=>{this.events.change.getSize()||this.stop()})}:r}clearListeners(){for(const e in this.events)this.events[e].clear()}attach(e,n){this.passiveEffect=e,this.stopPassiveEffect=n}set(e){this.passiveEffect?this.passiveEffect(e,this.updateAndNotify):this.updateAndNotify(e)}setWithVelocity(e,n,r){this.set(n),this.prev=void 0,this.prevFrameValue=e,this.prevUpdatedAt=this.updatedAt-r}jump(e,n=!0){this.updateAndNotify(e),this.prev=e,this.prevUpdatedAt=this.prevFrameValue=void 0,n&&this.stop(),this.stopPassiveEffect&&this.stopPassiveEffect()}dirty(){var e;(e=this.events.change)==null||e.notify(this.current)}addDependent(e){this.dependents||(this.dependents=new Set),this.dependents.add(e)}removeDependent(e){this.dependents&&this.dependents.delete(e)}get(){return this.current}getPrevious(){return this.prev}getVelocity(){const e=$r.now();if(!this.canTrackVelocity||this.prevFrameValue===void 0||e-this.updatedAt>jE)return 0;const n=Math.min(this.updatedAt-this.prevUpdatedAt,jE);return rR(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 pd(t,e){return new HB(t,e)}function jR(t,e){if(t!=null&&t.inherit&&e){const{inherit:n,...r}=t;return{...e,...r}}return t}function vb(t,e){const n=(t==null?void 0:t[e])??(t==null?void 0:t.default)??t;return n!==t?jR(n,t):n}const zB={type:"spring",stiffness:500,damping:25,restSpeed:10},UB=t=>({type:"spring",stiffness:550,damping:t===0?2*Math.sqrt(550):30,restSpeed:10}),BB={type:"keyframes",duration:.8},ZB={type:"keyframes",ease:[.25,.1,.35,1],duration:.3},WB=(t,{keyframes:e})=>e.length>2?BB:Cd.has(t)?t.startsWith("scale")?UB(e[1]):zB:ZB,qB=new Set(["when","delay","delayChildren","staggerChildren","staggerDirection","repeat","repeatType","repeatDelay","from","elapsed"]);function GB(t){for(const e in t)if(!qB.has(e))return!0;return!1}const yb=(t,e,n,r={},s,i)=>o=>{const l=vb(r,t)||{},u=l.delay||r.delay||0;let{elapsed:d=0}=r;d=d-Es(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};GB(l)||Object.assign(f,WB(t,f)),f.duration&&(f.duration=Es(f.duration)),f.repeatDelay&&(f.repeatDelay=Es(f.repeatDelay)),f.from!==void 0&&(f.keyframes[0]=f.from);let h=!1;if((f.type===!1||f.duration===0&&!f.repeatDelay)&&(pw(f),f.delay===0&&(h=!0)),(Ya.instantAnimations||Ya.skipAnimations||s!=null&&s.shouldSkipAnimations||l.skipAnimations)&&(h=!0,pw(f),f.delay=0),f.allowFlatten=!l.type&&!l.ease,h&&!i&&e.get()!==void 0){const g=Yg(f.keyframes,l);if(g!==void 0){Qt.update(()=>{f.onUpdate(g),f.onComplete()});return}}return l.isSync?new pg(f):new FB(f)},KB=/^var\(--(?:([\w-]+)|([\w-]+), ?([a-zA-Z\d ()%#.,-]+))\)/u;function YB(t){const e=KB.exec(t);if(!e)return[,];const[,n,r,s]=e;return[`--${n??r}`,s]}function $R(t,e,n=1){const[r,s]=YB(t);if(!r)return;const i=window.getComputedStyle(e).getPropertyValue(r);if(i){const o=i.trim();return JT(o)?parseFloat(o):o}return ub(s)?$R(s,e,n+1):s}function $E(t){const e=[{},{}];return t==null||t.values.forEach((n,r)=>{e[0][r]=n.get(),e[1][r]=n.getVelocity()}),e}function _b(t,e,n,r){if(typeof e=="function"){const[s,i]=$E(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]=$E(r);e=e(n!==void 0?n:t.custom,s,i)}return e}function dc(t,e,n){const r=t.getProps();return _b(r,e,n!==void 0?n:r.custom,t)}const FR=new Set(["width","height","top","left","right","bottom",...Ed]),mw=t=>Array.isArray(t);function XB(t,e,n){t.hasValue(e)?t.getValue(e).set(n):t.addValue(e,pd(n))}function QB(t){return mw(t)?t[t.length-1]||0:t}function JB(t,e){const n=dc(t,e);let{transitionEnd:r={},transition:s={},...i}=n||{};i={...i,...r};for(const o in i){const l=QB(i[o]);XB(t,o,l)}}const gr=t=>!!(t&&t.getVelocity);function eZ(t){return!!(gr(t)&&t.add)}function gw(t,e){const n=t.getValue("willChange");if(eZ(n))return n.add(e);if(!n&&Ya.WillChange){const r=new Ya.WillChange("auto");t.addValue("willChange",r),r.add(e)}}function wb(t){return t.replace(/([A-Z])/g,e=>`-${e.toLowerCase()}`)}const tZ="framerAppearId",VR="data-"+wb(tZ);function HR(t){return t.props[VR]}function nZ({protectedKeys:t,needsAnimating:e},n){const r=t.hasOwnProperty(n)&&e[n]!==!0;return e[n]=!1,r}function zR(t,e,{delay:n=0,transitionOverride:r,type:s}={}){let{transition:i,transitionEnd:o,...l}=e;const u=t.getDefaultTransition();i=i?jR(i,u):u;const d=i==null?void 0:i.reduceMotion,f=i==null?void 0:i.skipAnimations;r&&(i=r);const h=[],g=s&&t.animationState&&t.animationState.getState()[s],v=i==null?void 0:i.path;v&&v.animateVisualElement(t,l,i,n,h);for(const w in l){const _=t.getValue(w,t.latestValues[w]??null),x=l[w];if(x===void 0||g&&nZ(g,w))continue;const S={delay:n,...vb(i||{},w)};f&&(S.skipAnimations=!0);const k=_.get();if(k!==void 0&&!_.isAnimating()&&!Array.isArray(x)&&x===k&&!S.velocity){Qt.update(()=>_.set(x));continue}let C=!1;if(window.MotionHandoffAnimation){const I=HR(t);if(I){const M=window.MotionHandoffAnimation(I,w,Qt);M!==null&&(S.startTime=M,C=!0)}}gw(t,w);const A=d??t.shouldReduceMotion;_.start(yb(w,_,x,A&&FR.has(w)?{type:!1}:S,t,C));const T=_.animation;T&&h.push(T)}if(o){const w=()=>Qt.update(()=>{o&&JB(t,o)});h.length?Promise.all(h).then(w):w()}return h}function vw(t,e,n={}){var u;const r=dc(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(zR(t,r,n)):()=>Promise.resolve(),o=t.variantChildren&&t.variantChildren.size?(d=0)=>{const{delayChildren:f=0,staggerChildren:h,staggerDirection:g}=s;return rZ(t,e,d,f,h,g,n)}:()=>Promise.resolve(),{when:l}=s;if(l){const[d,f]=l==="beforeChildren"?[i,o]:[o,i];return d().then(()=>f())}else return Promise.all([i(),o(n.delay)])}function rZ(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(vw(u,e,{...o,delay:n+(typeof r=="function"?0:r)+DR(t.variantChildren,u,r,s,i)}).then(()=>u.notify("AnimationComplete",e)));return Promise.all(l)}function sZ(t,e,n={}){t.notify("AnimationStart",e);let r;if(Array.isArray(e)){const s=e.map(i=>vw(t,i,n));r=Promise.all(s)}else if(typeof e=="string")r=vw(t,e,n);else{const s=typeof e=="function"?dc(t,e,n.custom):e;r=Promise.all(zR(t,s,n))}return r.then(()=>{t.notify("AnimationComplete",e)})}const iZ={test:t=>t==="auto",parse:t=>t},UR=t=>e=>e.test(t),BR=[kd,Ve,Yi,To,MU,RU,iZ],FE=t=>BR.find(UR(t));function oZ(t){return typeof t=="number"?t===0:t!==null?t==="none"||t==="0"||tR(t):!0}const aZ=new Set(["brightness","contrast","saturate","opacity"]);function lZ(t){const[e,n]=t.slice(0,-1).split("(");if(e==="drop-shadow")return t;const[r]=n.match(db)||[];if(!r)return t;const s=n.replace(r,"");let i=aZ.has(e)?1:0;return r!==n&&(i*=100),e+"("+i+s+")"}const cZ=/\b([a-z-]*)\(.*?\)/gu,yw={...bi,getAnimatableNone:t=>{const e=t.match(cZ);return e?e.map(lZ).join(" "):t}},_w={...bi,getAnimatableNone:t=>{const e=bi.parse(t);return bi.createTransformer(t)(e.map(r=>typeof r=="number"?0:typeof r=="object"?{...r,alpha:1}:r))}},VE={...kd,transform:Math.round},uZ={rotate:To,pathRotation:To,rotateX:To,rotateY:To,rotateZ:To,scale:O0,scaleX:O0,scaleY:O0,scaleZ:O0,skew:To,skewX:To,skewY:To,distance:Ve,translateX:Ve,translateY:Ve,translateZ:Ve,x:Ve,y:Ve,z:Ve,perspective:Ve,transformPerspective:Ve,opacity:Eh,originX:CE,originY:CE,originZ:Ve},mg={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,...uZ,zIndex:VE,fillOpacity:Eh,strokeOpacity:Eh,numOctaves:VE},dZ={...mg,color:zn,backgroundColor:zn,outlineColor:zn,fill:zn,stroke:zn,borderColor:zn,borderTopColor:zn,borderRightColor:zn,borderBottomColor:zn,borderLeftColor:zn,filter:yw,WebkitFilter:yw,mask:_w,WebkitMask:_w},ZR=t=>dZ[t],fZ=new Set([yw,_w]);function WR(t,e){let n=ZR(t);return fZ.has(n)||(n=bi),n.getAnimatableNone?n.getAnimatableNone(e):void 0}const hZ=new Set(["auto","none","0"]);function pZ(t,e,n){let r=0,s;for(;r<t.length&&!s;){const i=t[r];typeof i=="string"&&!hZ.has(i)&&hd(i).values.length&&(s=t[r]),r++}if(s&&n)for(const i of e)t[i]=WR(n,s)}class mZ extends gb{constructor(e,n,r,s,i){super(e,n,r,s,i,!0)}readKeyframes(){const{unresolvedKeyframes:e,element:n,name:r}=this;if(!n||!n.current)return;super.readKeyframes();for(let f=0;f<e.length;f++){let h=e[f];if(typeof h=="string"&&(h=h.trim(),ub(h))){const g=$R(h,n.current);g!==void 0&&(e[f]=g),f===e.length-1&&(this.finalKeyframe=h)}}if(this.resolveNoneKeyframes(),!FR.has(r)||e.length!==2)return;const[s,i]=e,o=FE(s),l=FE(i),u=EE(s),d=EE(i);if(u!==d&&Va[r]){this.needsMeasurement=!0;return}if(o!==l)if(LE(o)&&LE(l))for(let f=0;f<e.length;f++){const h=e[f];typeof h=="string"&&(e[f]=parseFloat(h))}else Va[r]&&(this.needsMeasurement=!0)}resolveNoneKeyframes(){const{unresolvedKeyframes:e,name:n}=this,r=[];for(let s=0;s<e.length;s++)(e[s]===null||oZ(e[s]))&&r.push(s);r.length&&pZ(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=Va[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]=Va[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 xb=["borderTopLeftRadius","borderTopRightRadius","borderBottomRightRadius","borderBottomLeftRadius"];function qR(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 ww=(t,e)=>e&&typeof t=="number"?e.transform(t):t;function dm(t){return eR(t)&&"offsetHeight"in t&&!("ownerSVGElement"in t)}const{schedule:bb}=pR(queueMicrotask,!1),mi={x:!1,y:!1};function GR(){return mi.x||mi.y}function gZ(t){return t==="x"||t==="y"?mi[t]?null:(mi[t]=!0,()=>{mi[t]=!1}):mi.x||mi.y?null:(mi.x=mi.y=!0,()=>{mi.x=mi.y=!1})}function KR(t,e){const n=qR(t),r=new AbortController,s={passive:!0,...e,signal:r.signal};return[n,s,()=>r.abort()]}function vZ(t){return!(t.pointerType==="touch"||GR())}function yZ(t,e,n={}){const[r,s,i]=KR(t,n);return r.forEach(o=>{let l=!1,u=!1,d;const f=()=>{o.removeEventListener("pointerleave",w)},h=x=>{d&&(d(x),d=void 0),f()},g=x=>{l=!1,window.removeEventListener("pointerup",g),window.removeEventListener("pointercancel",g),u&&(u=!1,h(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}h(x)}},_=x=>{if(!vZ(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 YR=(t,e)=>e?t===e?!0:YR(t,e.parentElement):!1,Sb=t=>t.pointerType==="mouse"?typeof t.button!="number"||t.button<=0:t.isPrimary!==!1,_Z=new Set(["BUTTON","INPUT","SELECT","TEXTAREA","A"]);function wZ(t){return _Z.has(t.tagName)||t.isContentEditable===!0}const xZ=new Set(["INPUT","SELECT","TEXTAREA"]);function bZ(t){return xZ.has(t.tagName)||t.isContentEditable===!0}const fm=new WeakSet;function HE(t){return e=>{e.key==="Enter"&&t(e)}}function o_(t,e){t.dispatchEvent(new PointerEvent("pointer"+e,{isPrimary:!0,bubbles:!0}))}const SZ=(t,e)=>{const n=t.currentTarget;if(!n)return;const r=HE(()=>{if(fm.has(n))return;o_(n,"down");const s=HE(()=>{o_(n,"up")}),i=()=>o_(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 zE(t){return Sb(t)&&!GR()}const UE=new WeakSet;function kZ(t,e,n={}){const[r,s,i]=KR(t,n),o=l=>{const u=l.currentTarget;if(!zE(l)||UE.has(l))return;fm.add(u),n.stopPropagation&&UE.add(l);const d=e(u,l),f={...s,capture:!0},h=(w,_)=>{window.removeEventListener("pointerup",g,f),window.removeEventListener("pointercancel",v,f),fm.has(u)&&fm.delete(u),zE(w)&&typeof d=="function"&&d(w,{success:_})},g=w=>{h(w,u===window||u===document||n.useGlobalTarget||YR(u,w.target))},v=w=>{h(w,!1)};window.addEventListener("pointerup",g,f),window.addEventListener("pointercancel",v,f)};return r.forEach(l=>{(n.useGlobalTarget?window:l).addEventListener("pointerdown",o,s),dm(l)&&(l.addEventListener("focus",d=>SZ(d,s)),!wZ(l)&&!l.hasAttribute("tabindex")&&(l.tabIndex=0))}),i}function kb(t){return eR(t)&&"ownerSVGElement"in t}const hm=new WeakMap;let Pa;const XR=(t,e,n)=>(r,s)=>s&&s[0]?s[0][t+"Size"]:kb(r)&&"getBBox"in r?r.getBBox()[e]:r[n],EZ=XR("inline","width","offsetWidth"),CZ=XR("block","height","offsetHeight");function PZ({target:t,borderBoxSize:e}){var n;(n=hm.get(t))==null||n.forEach(r=>{r(t,{get width(){return EZ(t,e)},get height(){return CZ(t,e)}})})}function AZ(t){t.forEach(PZ)}function TZ(){typeof ResizeObserver>"u"||(Pa=new ResizeObserver(AZ))}function RZ(t,e){Pa||TZ();const n=qR(t);return n.forEach(r=>{let s=hm.get(r);s||(s=new Set,hm.set(r,s)),s.add(e),Pa==null||Pa.observe(r)}),()=>{n.forEach(r=>{const s=hm.get(r);s==null||s.delete(e),s!=null&&s.size||Pa==null||Pa.unobserve(r)})}}const pm=new Set;let Au;function MZ(){Au=()=>{const t={get width(){return window.innerWidth},get height(){return window.innerHeight}};pm.forEach(e=>e(t))},window.addEventListener("resize",Au)}function IZ(t){return pm.add(t),Au||MZ(),()=>{pm.delete(t),!pm.size&&typeof Au=="function"&&(window.removeEventListener("resize",Au),Au=void 0)}}function BE(t,e){return typeof t=="function"?IZ(t):RZ(t,e)}function OZ(t){return kb(t)&&t.tagName==="svg"}const LZ=[...BR,zn,bi],NZ=t=>LZ.find(UR(t)),ZE=()=>({translate:0,scale:1,origin:0,originPoint:0}),Tu=()=>({x:ZE(),y:ZE()}),WE=()=>({min:0,max:0}),Xn=()=>({x:WE(),y:WE()}),DZ=new WeakMap;function Xg(t){return t!==null&&typeof t=="object"&&typeof t.start=="function"}function Ch(t){return typeof t=="string"||Array.isArray(t)}const Eb=["animate","whileInView","whileFocus","whileHover","whileTap","whileDrag","exit"],Cb=["initial",...Eb];function Qg(t){return Xg(t.animate)||Cb.some(e=>Ch(t[e]))}function QR(t){return!!(Qg(t)||t.variants)}function jZ(t,e,n){for(const r in e){const s=e[r],i=n[r];if(gr(s))t.addValue(r,s);else if(gr(i))t.addValue(r,pd(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,pd(o!==void 0?o:s,{owner:t}))}}for(const r in n)e[r]===void 0&&t.removeValue(r);return e}const gg={current:null},Pb={current:!1},$Z=typeof window<"u";function JR(){if(Pb.current=!0,!!$Z)if(window.matchMedia){const t=window.matchMedia("(prefers-reduced-motion)"),e=()=>gg.current=t.matches;t.addEventListener("change",e),e()}else gg.current=!1}const qE=["AnimationStart","AnimationComplete","Update","BeforeLayoutMeasure","LayoutMeasure","LayoutAnimationStart","LayoutAnimationComplete"];let vg={};function eM(t){vg=t}function FZ(){return vg}class VZ{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=gb,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=$r.now();this.renderScheduledAt<v&&(this.renderScheduledAt=v,Qt.render(this.render,!1,!0))};const{latestValues:d,renderState:f}=l;this.latestValues=d,this.baseTarget={...d},this.initialValues=n.initial?{...d}:{},this.renderState=f,this.parent=e,this.props=n,this.presenceContext=r,this.depth=e?e.depth+1:0,this.reducedMotionConfig=s,this.skipAnimationsConfig=i,this.options=u,this.blockInitialAnimation=!!o,this.isControllingVariants=Qg(n),this.isVariantNode=QR(n),this.isVariantNode&&(this.variantChildren=new Set),this.manuallyAnimateOnMount=!!(e&&e.current);const{willChange:h,...g}=this.scrapeMotionValuesFromProps(n,{},this);for(const v in g){const w=g[v];d[v]!==void 0&&gr(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,DZ.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:(Pb.current||JR(),this.shouldReduceMotion=gg.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(),Xa(this.notifyUpdate),Xa(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&&NR.has(e)&&this.current instanceof HTMLElement){const{factory:o,keyframes:l,times:u,ease:d,duration:f}=n.accelerate,h=new OR({element:this.current,name:e,keyframes:l,times:u,ease:d,duration:Es(f)}),g=o(h);this.valueSubscriptions.set(e,()=>{g(),h.cancel()});return}const r=Cd.has(e);r&&this.onBindTransform&&this.onBindTransform();const s=n.on("change",o=>{this.latestValues[e]=o,this.props.onUpdate&&Qt.preRender(this.notifyUpdate),r&&this.projection&&(this.projection.isTransformDirty=!0),this.scheduleRender()});let i;typeof window<"u"&&window.MotionCheckAppearSync&&(i=window.MotionCheckAppearSync(this,e,n)),this.valueSubscriptions.set(e,()=>{s(),i&&i()})}sortNodePosition(e){return!this.current||!this.sortInstanceNodePosition||this.type!==e.type?0:this.sortInstanceNodePosition(this.current,e.current)}updateFeatures(){let e="animation";for(e in vg){const n=vg[e];if(!n)continue;const{isEnabled:r,Feature:s}=n;if(!this.features[e]&&s&&r(this.props)&&(this.features[e]=new s(this)),this.features[e]){const i=this.features[e];i.isMounted?i.update():(i.mount(),i.isMounted=!0)}}}triggerBuild(){this.build(this.renderState,this.latestValues,this.props)}measureViewportBox(){return this.current?this.measureInstanceViewportBox(this.current,this.props):Xn()}getStaticValue(e){return this.latestValues[e]}setStaticValue(e,n){this.latestValues[e]=n}update(e,n){(e.transformTemplate||this.props.transformTemplate)&&this.scheduleRender(),this.prevProps=this.props,this.props=e,this.prevPresenceContext=this.presenceContext,this.presenceContext=n;for(let r=0;r<qE.length;r++){const s=qE[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=jZ(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=pd(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"&&(JT(r)||tR(r))?r=parseFloat(r):!NZ(r)&&bi.test(n)&&(r=WR(e,n)),this.setBaseTarget(e,gr(r)?r.get():r)),gr(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=_b(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&&!gr(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 ab),this.events[e].add(n)}notify(e,...n){this.events[e]&&this.events[e].notify(...n)}scheduleRenderMicrotask(){bb.render(this.render)}}class tM extends VZ{constructor(){super(...arguments),this.KeyframeResolver=mZ}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;gr(e)&&(this.childSubscription=e.on("change",n=>{this.current&&(this.current.textContent=`${n}`)}))}}class il{constructor(e){this.isMounted=!1,this.node=e}update(){}}function nM({top:t,left:e,right:n,bottom:r}){return{x:{min:e,max:n},y:{min:t,max:r}}}function HZ({x:t,y:e}){return{top:e.min,right:t.max,bottom:e.max,left:t.min}}function zZ(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 a_(t){return t===void 0||t===1}function xw({scale:t,scaleX:e,scaleY:n}){return!a_(t)||!a_(e)||!a_(n)}function Zl(t){return xw(t)||rM(t)||t.z||t.rotate||t.rotateX||t.rotateY||t.skewX||t.skewY}function rM(t){return GE(t.x)||GE(t.y)}function GE(t){return t&&t!=="0%"}function yg(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=yg(t,s,r)),yg(t,n,r)+e}function bw(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 sM(t,{x:e,y:n}){bw(t.x,e.translate,e.scale,e.originPoint),bw(t.y,n.translate,n.scale,n.originPoint)}const YE=.999999999999,XE=1.0000000000001;function UZ(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&&(Ui(t.x,-i.scroll.offset.x),Ui(t.y,-i.scroll.offset.y)),o&&(e.x*=o.x.scale,e.y*=o.y.scale,sM(t,o)),r&&Zl(i.latestValues)&&mm(t,i.latestValues,(l=i.layout)==null?void 0:l.layoutBox))}e.x<XE&&e.x>YE&&(e.x=1),e.y<XE&&e.y>YE&&(e.y=1)}function Ui(t,e){t.min+=e,t.max+=e}function QE(t,e,n,r,s=.5){const i=Xt(t.min,t.max,s);bw(t,e,n,i,r)}function JE(t,e){return typeof t=="string"?parseFloat(t)/100*(e.max-e.min):t}function mm(t,e,n){const r=n??t;QE(t.x,JE(e.x,r.x),e.scaleX,e.scale,e.originX),QE(t.y,JE(e.y,r.y),e.scaleY,e.scale,e.originY)}function iM(t,e){return nM(zZ(t.getBoundingClientRect(),e))}function BZ(t,e,n){const r=iM(t,n),{scroll:s}=e;return s&&(Ui(r.x,s.offset.x),Ui(r.y,s.offset.y)),r}const ZZ={x:"translateX",y:"translateY",z:"translateZ",transformPerspective:"perspective"},WZ=Ed.length;function qZ(t,e,n){let r="",s=!0;for(let o=0;o<WZ;o++){const l=Ed[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=ww(u,mg[l]);if(!d){s=!1;const h=ZZ[l]||l;r+=`${h}(${f}) `}n&&(e[l]=f)}}const i=t.pathRotation;return i&&(s=!1,r+=`rotate(${ww(i,mg.pathRotation)}) `),r=r.trim(),n?r=n(e,s?"":r):s&&(r="none"),r}function Ab(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(Cd.has(u)){o=!0;continue}else if(gR(u)){s[u]=d;continue}else{const f=ww(d,mg[u]);u.startsWith("origin")?(l=!0,i[u]=f):r[u]=f}}if(e.transform||(o||n?r.transform=qZ(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 oM(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 eC(t,e){return e.max===e.min?0:t/(e.max-e.min)*100}const Pf={correct:(t,e)=>{if(!e.target)return t;if(typeof t=="string")if(Ve.test(t))t=parseFloat(t);else return t;const n=eC(t,e.target.x),r=eC(t,e.target.y);return`${n}% ${r}%`}},GZ={correct:(t,{treeScale:e,projectionDelta:n})=>{const r=t,s=bi.parse(t);if(s.length>5)return r;const i=bi.createTransformer(t),o=typeof s[0]!="number"?1:0,l=n.x.scale*e.x,u=n.y.scale*e.y;s[0+o]/=l,s[1+o]/=u;const d=Xt(l,u,.5);return typeof s[2+o]=="number"&&(s[2+o]/=d),typeof s[3+o]=="number"&&(s[3+o]/=d),i(s)}},Sw={borderRadius:{...Pf,applyTo:[...xb]},borderTopLeftRadius:Pf,borderTopRightRadius:Pf,borderBottomLeftRadius:Pf,borderBottomRightRadius:Pf,boxShadow:GZ};function aM(t,{layout:e,layoutId:n}){return Cd.has(t)||t.startsWith("origin")||(e||n!==void 0)&&(!!Sw[t]||t==="opacity")}function Tb(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)(gr(r[l])||s&&gr(s[l])||aM(l,t)||((o=n==null?void 0:n.getValue(l))==null?void 0:o.liveStyle)!==void 0)&&(i[l]=r[l]);return i}function KZ(t){return window.getComputedStyle(t)}class YZ extends tM{constructor(){super(...arguments),this.type="html",this.renderInstance=oM}mount(e){Kg(!!e.style),super.mount(e)}readValueFromInstance(e,n){var r;if(Cd.has(n))return(r=this.projection)!=null&&r.isProjecting?cw(n):vB(e,n);{const s=KZ(e),i=(gR(n)?s.getPropertyValue(n):s[n])||0;return typeof i=="string"?i.trim():i}}measureInstanceViewportBox(e,{transformPagePoint:n}){return iM(e,n)}build(e,n,r){Ab(e,n,r.transformTemplate)}scrapeMotionValuesFromProps(e,n,r){return Tb(e,n,r)}}const XZ={offset:"stroke-dashoffset",array:"stroke-dasharray"},QZ={offset:"strokeDashoffset",array:"strokeDasharray"};function JZ(t,e,n=1,r=0,s=!0){t.pathLength=1;const i=s?XZ:QZ;t[i.offset]=`${-r}`,t[i.array]=`${e} ${n}`}const eW=["offsetDistance","offsetPath","offsetRotate","offsetAnchor"];function lM(t,{attrX:e,attrY:n,attrScale:r,pathLength:s,pathSpacing:i=1,pathOffset:o=0,...l},u,d,f){if(Ab(t,l,d),u){t.style.viewBox&&(t.attrs.viewBox=t.style.viewBox);return}t.attrs=t.style,t.style={};const{attrs:h,style:g}=t;h.transform&&(g.transform=h.transform,delete h.transform),(g.transform||h.transformOrigin)&&(g.transformOrigin=h.transformOrigin??"50% 50%",delete h.transformOrigin),g.transform&&(g.transformBox=(f==null?void 0:f.transformBox)??"fill-box",delete h.transformBox);for(const v of eW)h[v]!==void 0&&(g[v]=h[v],delete h[v]);e!==void 0&&(h.x=e),n!==void 0&&(h.y=n),r!==void 0&&(h.scale=r),s!==void 0&&JZ(h,s,i,o,!1)}const cM=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"]),uM=t=>typeof t=="string"&&t.toLowerCase()==="svg";function tW(t,e,n,r){oM(t,e,void 0,r);for(const s in e.attrs)t.setAttribute(cM.has(s)?s:wb(s),e.attrs[s])}function dM(t,e,n){const r=Tb(t,e,n);for(const s in t)if(gr(t[s])||gr(e[s])){const i=Ed.indexOf(s)!==-1?"attr"+s.charAt(0).toUpperCase()+s.substring(1):s;r[i]=t[s]}return r}class nW extends tM{constructor(){super(...arguments),this.type="svg",this.isSVGTag=!1,this.measureInstanceViewportBox=Xn}getBaseTargetFromProps(e,n){return e[n]}readValueFromInstance(e,n){if(Cd.has(n)){const r=ZR(n);return r&&r.default||0}return n=cM.has(n)?n:wb(n),e.getAttribute(n)}scrapeMotionValuesFromProps(e,n,r){return dM(e,n,r)}build(e,n,r){lM(e,n,this.isSVGTag,r.transformTemplate,r.style)}renderInstance(e,n,r,s){tW(e,n,r,s)}mount(e){this.isSVGTag=uM(e.tagName),super.mount(e)}}const rW=Cb.length;function fM(t){if(!t)return;if(!t.isControllingVariants){const n=t.parent?fM(t.parent)||{}:{};return t.props.initial!==void 0&&(n.initial=t.props.initial),n}const e={};for(let n=0;n<rW;n++){const r=Cb[n],s=t.props[r];(Ch(s)||s===!1)&&(e[r]=s)}return e}function hM(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 sW=[...Eb].reverse(),iW=Eb.length;function oW(t){return e=>Promise.all(e.map(({animation:n,options:r})=>sZ(t,n,r)))}function aW(t){let e=oW(t),n=tC(),r=!0,s=!1;const i=d=>(f,h)=>{var v;const g=dc(t,h,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,h=fM(t.parent)||{},g=[],v=new Set;let w={},_=1/0;for(let S=0;S<iW;S++){const k=sW[S],C=n[k],A=f[k]!==void 0?f[k]:h[k],T=Ch(A),I=k===d?C.isActive:null;I===!1&&(_=S);let M=A===h[k]&&A!==f[k]&&T;if(M&&(r||s)&&t.manuallyAnimateOnMount&&(M=!1),C.protectedKeys={...w},!C.isActive&&I===null||!A&&!C.prevProp||Xg(A)||typeof A=="boolean")continue;if(k==="exit"&&C.isActive&&I!==!0){C.prevResolvedValues&&(w={...w,...C.prevResolvedValues});continue}const R=lW(C.prevProp,A);let O=R||k===d&&C.isActive&&!M&&T||S>_&&T,N=!1;const D=Array.isArray(A)?A:[A];let F=D.reduce(i(k),{});I===!1&&(F={});const{prevResolvedValues:K={}}=C,B={...K,...F},G=U=>{O=!0,v.has(U)&&(N=!0,v.delete(U)),C.needsAnimating[U]=!0;const J=t.getValue(U);J&&(J.liveStyle=!1)};for(const U in B){const J=F[U],Z=K[U];if(w.hasOwnProperty(U))continue;let j=!1;mw(J)&&mw(Z)?j=!hM(J,Z)||R:j=J!==Z,j?J!=null?G(U):v.add(U):J!==void 0&&v.has(U)?G(U):C.protectedKeys[U]=!0}C.prevProp=A,C.prevResolvedValues=F,C.isActive&&(w={...w,...F}),(r||s)&&t.blockInitialAnimation&&(O=!1);const H=M&&R;O&&(!H||N)&&g.push(...D.map(U=>{const J={type:k};if(typeof U=="string"&&(r||s)&&!H&&t.manuallyAnimateOnMount&&t.parent){const{parent:Z}=t,j=dc(Z,U);if(Z.enteringChildren&&j){const{delayChildren:Q}=j.transition||{};J.delay=DR(Z.enteringChildren,t,Q)}}return{animation:U,options:J}}))}if(v.size){const S={};if(typeof f.initial!="boolean"){const k=dc(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),A=t.getValue(k);A&&(A.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 h=l(d);for(const v in n)n[v].protectedKeys={};return h}return{animateChanges:l,setActive:u,setAnimateFunction:o,getState:()=>n,reset:()=>{n=tC(),s=!0}}}function lW(t,e){return typeof e=="string"?e!==t:Array.isArray(e)?!hM(e,t):!1}function Ol(t=!1){return{isActive:t,protectedKeys:{},needsAnimating:{},prevResolvedValues:{}}}function tC(){return{animate:Ol(!0),whileInView:Ol(),whileHover:Ol(),whileTap:Ol(),whileDrag:Ol(),whileFocus:Ol(),exit:Ol()}}function kw(t,e){t.min=e.min,t.max=e.max}function fi(t,e){kw(t.x,e.x),kw(t.y,e.y)}function nC(t,e){t.translate=e.translate,t.scale=e.scale,t.originPoint=e.originPoint,t.origin=e.origin}const pM=1e-4,cW=1-pM,uW=1+pM,mM=.01,dW=0-mM,fW=0+mM;function Fr(t){return t.max-t.min}function hW(t,e,n){return Math.abs(t-e)<=n}function rC(t,e,n,r=.5){t.origin=r,t.originPoint=Xt(e.min,e.max,t.origin),t.scale=Fr(n)/Fr(e),t.translate=Xt(n.min,n.max,t.origin)-t.originPoint,(t.scale>=cW&&t.scale<=uW||isNaN(t.scale))&&(t.scale=1),(t.translate>=dW&&t.translate<=fW||isNaN(t.translate))&&(t.translate=0)}function eh(t,e,n,r){rC(t.x,e.x,n.x,r?r.originX:void 0),rC(t.y,e.y,n.y,r?r.originY:void 0)}function sC(t,e,n,r=0){const s=r?Xt(n.min,n.max,r):n.min;t.min=s+e.min,t.max=t.min+Fr(e)}function pW(t,e,n,r){sC(t.x,e.x,n.x,r==null?void 0:r.x),sC(t.y,e.y,n.y,r==null?void 0:r.y)}function iC(t,e,n,r=0){const s=r?Xt(n.min,n.max,r):n.min;t.min=e.min-s,t.max=t.min+Fr(e)}function _g(t,e,n,r){iC(t.x,e.x,n.x,r==null?void 0:r.x),iC(t.y,e.y,n.y,r==null?void 0:r.y)}function oC(t,e,n,r,s){return t-=e,t=yg(t,1/n,r),s!==void 0&&(t=yg(t,1/s,r)),t}function mW(t,e=0,n=1,r=.5,s,i=t,o=t){if(Yi.test(e)&&(e=parseFloat(e),e=Xt(o.min,o.max,e/100)-o.min),typeof e!="number")return;let l=Xt(i.min,i.max,r);t===i&&(l-=e),t.min=oC(t.min,e,n,l,s),t.max=oC(t.max,e,n,l,s)}function aC(t,e,[n,r,s],i,o){mW(t,e[n],e[r],e[s],e.scale,i,o)}const gW=["x","scaleX","originX"],vW=["y","scaleY","originY"];function lC(t,e,n,r){aC(t.x,e,gW,n?n.x:void 0,r?r.x:void 0),aC(t.y,e,vW,n?n.y:void 0,r?r.y:void 0)}function cC(t){return t.translate===0&&t.scale===1}function gM(t){return cC(t.x)&&cC(t.y)}function uC(t,e){return t.min===e.min&&t.max===e.max}function yW(t,e){return uC(t.x,e.x)&&uC(t.y,e.y)}function dC(t,e){return Math.round(t.min)===Math.round(e.min)&&Math.round(t.max)===Math.round(e.max)}function vM(t,e){return dC(t.x,e.x)&&dC(t.y,e.y)}function fC(t){return Fr(t.x)/Fr(t.y)}function hC(t,e){return t.translate===e.translate&&t.scale===e.scale&&t.originPoint===e.originPoint}function $i(t){return[t("x"),t("y")]}function _W(t,e,n){let r="";const s=t.x.translate/e.x,i=t.y.translate/e.y,o=(n==null?void 0:n.z)||0;if((s||i||o)&&(r=`translate3d(${s}px, ${i}px, ${o}px) `),(e.x!==1||e.y!==1)&&(r+=`scale(${1/e.x}, ${1/e.y}) `),n){const{transformPerspective:d,rotate:f,pathRotation:h,rotateX:g,rotateY:v,skewX:w,skewY:_}=n;d&&(r=`perspective(${d}px) ${r}`),f&&(r+=`rotate(${f}deg) `),h&&(r+=`rotate(${h}deg) `),g&&(r+=`rotateX(${g}deg) `),v&&(r+=`rotateY(${v}deg) `),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 wW=xb.length,pC=t=>typeof t=="string"?parseFloat(t):t,mC=t=>typeof t=="number"||Ve.test(t);function xW(t,e,n,r,s,i){s?(t.opacity=Xt(0,n.opacity??1,bW(r)),t.opacityExit=Xt(e.opacity??1,0,SW(r))):i&&(t.opacity=Xt(e.opacity??1,n.opacity??1,r));for(let o=0;o<wW;o++){const l=xb[o];let u=gC(e,l),d=gC(n,l);if(u===void 0&&d===void 0)continue;u||(u=0),d||(d=0),u===0||d===0||mC(u)===mC(d)?(t[l]=Math.max(Xt(pC(u),pC(d),r),0),(Yi.test(d)||Yi.test(u))&&(t[l]+="%")):t[l]=d}(e.rotate||n.rotate)&&(t.rotate=Xt(e.rotate||0,n.rotate||0,r))}function gC(t,e){return t[e]!==void 0?t[e]:t.borderRadius}const bW=yM(0,.5,uR),SW=yM(.5,.95,Xs);function yM(t,e,n){return r=>r<t?0:r>e?1:n(kh(t,e,r))}function kW(t,e,n){const r=gr(t)?t:pd(t);return r.start(yb("",r,e,n)),r.animation}function Ph(t,e,n,r={passive:!0}){return t.addEventListener(e,n,r),()=>t.removeEventListener(e,n,r)}const EW=(t,e)=>t.depth-e.depth;class CW{constructor(){this.children=[],this.isDirty=!1}add(e){ob(this.children,e),this.isDirty=!0}remove(e){ug(this.children,e),this.isDirty=!0}forEach(e){this.isDirty&&this.children.sort(EW),this.isDirty=!1,this.children.forEach(e)}}function PW(t,e){const n=$r.now(),r=({timestamp:s})=>{const i=s-n;i>=e&&(Xa(r),t(i-e))};return Qt.setup(r,!0),()=>Xa(r)}function gm(t){return gr(t)?t.get():t}class AW{constructor(){this.members=[]}add(e){ob(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&&(ug(this.members,r),r.unmount())}e.scheduleRender()}remove(e){if(ug(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 vm={hasAnimatedSinceResize:!0,hasEverUpdated:!1},l_=["","X","Y","Z"],TW=1e3;let RW=0;function c_(t,e,n,r){const{latestValues:s}=e;s[t]&&(n[t]=s[t],e.setStaticValue(t,0),r&&(r[t]=0))}function _M(t){if(t.hasCheckedOptimisedAppear=!0,t.root===t)return;const{visualElement:e}=t.options;if(!e)return;const n=HR(e);if(window.MotionHasOptimisedAnimation(n,"transform")){const{layout:s,layoutId:i}=t.options;window.MotionCancelOptimisedAnimation(n,"transform",Qt,!(s||i))}const{parent:r}=t;r&&!r.hasCheckedOptimisedAppear&&_M(r)}function wM({attachResizeListener:t,defaultParent:e,measureScroll:n,checkIsScrollRoot:r,resetTransform:s}){return class{constructor(o={},l=e==null?void 0:e()){this.id=RW++,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(OW),this.nodes.forEach(FW),this.nodes.forEach(VW),this.nodes.forEach(LW)},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 CW)}addEventListener(o,l){return this.eventHandlers.has(o)||this.eventHandlers.set(o,new ab),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=kb(o)&&!OZ(o),this.instance=o;const{layoutId:l,layout:u,visualElement:d}=this.options;if(d&&!d.current&&d.mount(o),this.root.nodes.add(this),this.parent&&this.parent.children.add(this),this.root.hasTreeAnimated&&(u||l)&&(this.isLayoutDirty=!0),t){let f,h=0;const g=()=>this.root.updateBlockedByResize=!1;Qt.read(()=>{h=window.innerWidth}),t(o,()=>{const v=window.innerWidth;v!==h&&(h=v,this.root.updateBlockedByResize=!0,f&&f(),f=PW(g,250),vm.hasAnimatedSinceResize&&(vm.hasAnimatedSinceResize=!1,this.nodes.forEach(_C)))})}l&&this.root.registerSharedNode(l,this),this.options.animate!==!1&&d&&(l||u)&&this.addEventListener("didUpdate",({delta:f,hasLayoutChanged:h,hasRelativeLayoutChanged:g,layout:v})=>{if(this.isTreeAnimationBlocked()){this.target=void 0,this.relativeTarget=void 0;return}const w=this.options.transition||d.getDefaultTransition()||ZW,{onLayoutAnimationStart:_,onLayoutAnimationComplete:x}=d.getProps(),S=!this.targetLayout||!vM(this.targetLayout,v),k=!h&&g;if(this.options.layoutRoot||this.resumeFrom||k||h&&(S||!this.currentAnimation)){this.resumeFrom&&(this.resumingFrom=this.resumeFrom,this.resumingFrom.resumingFrom=void 0);const C={...vb(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 h||_C(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(),Xa(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(HW),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&&_M(this),!this.root.isUpdating&&this.root.startUpdate(),this.isLayoutDirty)return;this.isLayoutDirty=!0;for(let f=0;f<this.path.length;f++){const h=this.path[f];h.shouldResetTransform=!0,(typeof h.latestValues.x=="string"||typeof h.latestValues.y=="string")&&(h.isLayoutDirty=!0),h.updateScroll("snapshot"),h.options.layoutRoot&&h.willUpdate(!1)}const{layoutId:l,layout:u}=this.options;if(l===void 0&&!u)return;const d=this.getTransformTemplate();this.prevTransformTemplateValue=d?d(this.latestValues,""):void 0,this.updateSnapshot(),o&&this.notifyListeners("willUpdate")}update(){if(this.updateScheduled=!1,this.isUpdateBlocked()){const u=this.updateBlockedByResize;this.unblockUpdate(),this.updateBlockedByResize=!1,this.clearAllSnapshots(),u&&this.nodes.forEach(DW),this.nodes.forEach(vC);return}if(this.animationId<=this.animationCommitId){this.nodes.forEach(yC);return}this.animationCommitId=this.animationId,this.isUpdating?(this.isUpdating=!1,this.nodes.forEach(jW),this.nodes.forEach($W),this.nodes.forEach(MW),this.nodes.forEach(IW)):this.nodes.forEach(yC),this.clearAllSnapshots();const l=$r.now();hr.delta=eo(0,1e3/60,l-hr.timestamp),hr.timestamp=l,hr.isProcessing=!0,e_.update.process(hr),e_.preRender.process(hr),e_.render.process(hr),hr.isProcessing=!1}didUpdate(){this.updateScheduled||(this.updateScheduled=!0,bb.read(this.scheduleUpdate))}clearAllSnapshots(){this.nodes.forEach(NW),this.sharedNodes.forEach(zW)}scheduleUpdateProjection(){this.projectionUpdateScheduled||(this.projectionUpdateScheduled=!0,Qt.preRender(this.updateProjection,!1,!0))}scheduleCheckAfterUnmount(){Qt.postRender(()=>{this.isLayoutDirty?this.root.didUpdate():this.root.checkUpdateFailed()})}updateSnapshot(){this.snapshot||!this.instance||(this.snapshot=this.measure(),this.snapshot&&!Fr(this.snapshot.measuredBox.x)&&!Fr(this.snapshot.measuredBox.y)&&(this.snapshot=void 0))}updateLayout(){if(!this.instance||(this.updateScroll(),!(this.options.alwaysMeasureLayout&&this.isLead())&&!this.isLayoutDirty))return;if(this.resumeFrom&&!this.resumeFrom.instance)for(let u=0;u<this.path.length;u++)this.path[u].updateScroll();const o=this.layout;this.layout=this.measure(!1),this.layoutVersion++,this.layoutCorrected||(this.layoutCorrected=Xn()),this.isLayoutDirty=!1,this.projectionDelta=void 0,this.notifyListeners("measure",this.layout.layoutBox);const{visualElement:l}=this.options;l&&l.notify("LayoutMeasure",this.layout.layoutBox,o?o.layoutBox:void 0)}updateScroll(o="measure"){let l=!!(this.options.layoutScroll&&this.instance);if(this.scroll&&this.scroll.animationId===this.root.animationId&&this.scroll.phase===o&&(l=!1),l&&this.instance){const u=r(this.instance);this.scroll={animationId:this.root.animationId,phase:o,isRoot:u,offset:n(this.instance),wasRoot:this.scroll?this.scroll.isRoot:u}}}resetTransform(){if(!s)return;const o=this.isLayoutDirty||this.shouldResetTransform||this.options.alwaysMeasureLayout,l=this.projectionDelta&&!gM(this.projectionDelta),u=this.getTransformTemplate(),d=u?u(this.latestValues,""):void 0,f=d!==this.prevTransformTemplateValue;o&&this.instance&&(l||Zl(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)),WW(u),{animationId:this.root.animationId,measuredBox:l,layoutBox:u,latestValues:{},source:this.id}}measurePageBox(){var d;const{visualElement:o}=this.options;if(!o)return Xn();const l=o.measureViewportBox();if(!(((d=this.scroll)==null?void 0:d.wasRoot)||this.path.some(qW))){const{scroll:f}=this.root;f&&(Ui(l.x,f.offset.x),Ui(l.y,f.offset.y))}return l}removeElementScroll(o){var u;const l=Xn();if(fi(l,o),(u=this.scroll)!=null&&u.wasRoot)return l;for(let d=0;d<this.path.length;d++){const f=this.path[d],{scroll:h,options:g}=f;f!==this.root&&h&&g.layoutScroll&&(h.wasRoot&&fi(l,o),Ui(l.x,h.offset.x),Ui(l.y,h.offset.y))}return l}applyTransform(o,l=!1,u){var f,h;const d=u||Xn();fi(d,o);for(let g=0;g<this.path.length;g++){const v=this.path[g];!l&&v.options.layoutScroll&&v.scroll&&v!==v.root&&(Ui(d.x,-v.scroll.offset.x),Ui(d.y,-v.scroll.offset.y)),Zl(v.latestValues)&&mm(d,v.latestValues,(f=v.layout)==null?void 0:f.layoutBox)}return Zl(this.latestValues)&&mm(d,this.latestValues,(h=this.layout)==null?void 0:h.layoutBox),d}removeTransform(o){var u;const l=Xn();fi(l,o);for(let d=0;d<this.path.length;d++){const f=this.path[d];if(!Zl(f.latestValues))continue;let h;f.instance&&(xw(f.latestValues)&&f.updateSnapshot(),h=Xn(),fi(h,f.measurePageBox())),lC(l,f.latestValues,(u=f.snapshot)==null?void 0:u.layoutBox,h)}return Zl(this.latestValues)&&lC(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!==hr.timestamp&&this.relativeParent.resolveTargetDelta(!0)}resolveTargetDelta(o=!1){var v;const l=this.getLead();this.isProjectionDirty||(this.isProjectionDirty=l.isProjectionDirty),this.isTransformDirty||(this.isTransformDirty=l.isTransformDirty),this.isSharedProjectionDirty||(this.isSharedProjectionDirty=l.isSharedProjectionDirty);const u=!!this.resumingFrom||this!==l;if(!(o||u&&this.isSharedProjectionDirty||this.isProjectionDirty||(v=this.parent)!=null&&v.isProjectionDirty||this.attemptToResolveRelativeTarget||this.root.updateBlockedByResize))return;const{layout:f,layoutId:h}=this.options;if(!this.layout||!(f||h))return;this.resolvedRelativeTargetAt=hr.timestamp;const g=this.getClosestProjectingParent();g&&this.linkedParentVersion!==g.layoutVersion&&!g.options.layoutRoot&&this.removeRelativeTarget(),!this.targetDelta&&!this.relativeTarget&&(this.options.layoutAnchor!==!1&&g&&g.layout?this.createRelativeTarget(g,this.layout.layoutBox,g.layout.layoutBox):this.removeRelativeTarget()),!(!this.relativeTarget&&!this.targetDelta)&&(this.target||(this.target=Xn(),this.targetWithTransforms=Xn()),this.relativeTarget&&this.relativeTargetOrigin&&this.relativeParent&&this.relativeParent.target?(this.forceRelativeParentToResolveTarget(),pW(this.target,this.relativeTarget,this.relativeParent.target,this.options.layoutAnchor||void 0)):this.targetDelta?(this.resumingFrom?this.applyTransform(this.layout.layoutBox,!1,this.target):fi(this.target,this.layout.layoutBox),sM(this.target,this.targetDelta)):fi(this.target,this.layout.layoutBox),this.attemptToResolveRelativeTarget&&(this.attemptToResolveRelativeTarget=!1,this.options.layoutAnchor!==!1&&g&&!!g.resumingFrom==!!this.resumingFrom&&!g.options.layoutScroll&&g.target&&this.animationProgress!==1?this.createRelativeTarget(g,this.target,g.target):this.relativeParent=this.relativeTarget=void 0))}getClosestProjectingParent(){if(!(!this.parent||xw(this.parent.latestValues)||rM(this.parent.latestValues)))return this.parent.isProjecting()?this.parent:this.parent.getClosestProjectingParent()}isProjecting(){return!!((this.relativeTarget||this.targetDelta||this.options.layoutRoot)&&this.layout)}createRelativeTarget(o,l,u){this.relativeParent=o,this.linkedParentVersion=o.layoutVersion,this.forceRelativeParentToResolveTarget(),this.relativeTarget=Xn(),this.relativeTargetOrigin=Xn(),_g(this.relativeTargetOrigin,l,u,this.options.layoutAnchor||void 0),fi(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===hr.timestamp&&(u=!1),u)return;const{layout:d,layoutId:f}=this.options;if(this.isTreeAnimating=!!(this.parent&&this.parent.isTreeAnimating||this.currentAnimation||this.pendingAnimation),this.isTreeAnimating||(this.targetDelta=this.relativeTarget=void 0),!this.layout||!(d||f))return;fi(this.layoutCorrected,this.layout.layoutBox);const h=this.treeScale.x,g=this.treeScale.y;UZ(this.layoutCorrected,this.treeScale,this.path,l),o.layout&&!o.target&&(this.treeScale.x!==1||this.treeScale.y!==1)&&(o.target=o.layout.layoutBox,o.targetWithTransforms=Xn());const{target:v}=o;if(!v){this.prevProjectionDelta&&(this.createProjectionDeltas(),this.scheduleRender());return}!this.projectionDelta||!this.prevProjectionDelta?this.createProjectionDeltas():(nC(this.prevProjectionDelta.x,this.projectionDelta.x),nC(this.prevProjectionDelta.y,this.projectionDelta.y)),eh(this.projectionDelta,this.layoutCorrected,v,this.latestValues),(this.treeScale.x!==h||this.treeScale.y!==g||!hC(this.projectionDelta.x,this.prevProjectionDelta.x)||!hC(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=Tu(),this.projectionDelta=Tu(),this.projectionDeltaWithTransform=Tu()}setAnimationOrigin(o,l=!1,u){const d=this.snapshot,f=d?d.latestValues:{},h={...this.latestValues},g=Tu();(!this.relativeParent||!this.relativeParent.options.layoutRoot)&&(this.relativeTarget=this.relativeTargetOrigin=void 0),this.attemptToResolveRelativeTarget=!l;const v=Xn(),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(BW));this.animationProgress=0;let A;const T=u==null?void 0:u.interpolateProjection(o);this.mixTargetDelta=I=>{const M=I/1e3,R=T==null?void 0:T(M);R?(g.x.translate=R.x,g.x.scale=Xt(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=Xt(o.y.scale,1,M),g.y.origin=o.y.origin,g.y.originPoint=o.y.originPoint):(wC(g.x,o.x,M),wC(g.y,o.y,M)),this.setTargetDelta(g),this.relativeTarget&&this.relativeTargetOrigin&&this.layout&&this.relativeParent&&this.relativeParent.layout&&(_g(v,this.layout.layoutBox,this.relativeParent.layout.layoutBox,this.options.layoutAnchor||void 0),UW(this.relativeTarget,this.relativeTargetOrigin,v,M),A&&yW(this.relativeTarget,A)&&(this.isProjectionDirty=!1),A||(A=Xn()),fi(A,this.relativeTarget)),x&&(this.animationValues=h,xW(h,f,this.latestValues,M,C,k)),R&&R.rotate!==void 0&&(this.animationValues||(this.animationValues=h),this.animationValues.pathRotation=R.rotate),this.root.scheduleUpdateProjection(),this.scheduleRender(),this.animationProgress=M},this.mixTargetDelta(this.options.layoutRoot?1e3:0)}startAnimation(o){var l,u,d;this.notifyListeners("animationStart"),(l=this.currentAnimation)==null||l.stop(),(d=(u=this.resumingFrom)==null?void 0:u.currentAnimation)==null||d.stop(),this.pendingAnimation&&(Xa(this.pendingAnimation),this.pendingAnimation=void 0),this.pendingAnimation=Qt.update(()=>{vm.hasAnimatedSinceResize=!0,this.motionValue||(this.motionValue=pd(0)),this.motionValue.jump(0,!1),this.currentAnimation=kW(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(TW),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&&xM(this.options.animationType,this.layout.layoutBox,d.layoutBox)){u=this.target||Xn();const h=Fr(this.layout.layoutBox.x);u.x.min=o.target.x.min,u.x.max=u.x.min+h;const g=Fr(this.layout.layoutBox.y);u.y.min=o.target.y.min,u.y.max=u.y.min+g}fi(l,u),mm(l,f),eh(this.projectionDeltaWithTransform,this.layoutCorrected,l,f)}}registerSharedNode(o,l){this.sharedNodes.has(o)||this.sharedNodes.set(o,new AW),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&&c_("z",o,d,this.animationValues);for(let f=0;f<l_.length;f++)c_(`rotate${l_[f]}`,o,d,this.animationValues),c_(`skew${l_[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=gm(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=gm(l==null?void 0:l.pointerEvents)||""),this.hasProjected&&!Zl(this.latestValues)&&(o.transform=u?u({},""):"none",this.hasProjected=!1);return}o.visibility="";const f=d.animationValues||d.latestValues;this.applyTransformsToTarget();let h=_W(this.projectionDeltaWithTransform,this.treeScale,f);u&&(h=u(f,h)),o.transform=h;const{x:g,y:v}=this.projectionDelta;o.transformOrigin=`${g.origin*100}% ${v.origin*100}% 0`,d.animationValues?o.opacity=d===this?f.opacity??this.latestValues.opacity??1:this.preserveOpacity?this.latestValues.opacity:f.opacityExit:o.opacity=d===this?f.opacity!==void 0?f.opacity:"":f.opacityExit!==void 0?f.opacityExit:0;for(const w in Sw){if(f[w]===void 0)continue;const{correct:_,applyTo:x,isCSSVariable:S}=Sw[w],k=h==="none"?f[w]:_(f[w],d);if(x){const C=x.length;for(let A=0;A<C;A++)o[x[A]]=k}else S?this.options.visualElement.renderState.vars[w]=k:o[w]=k}this.options.layoutId&&(o.pointerEvents=d===this?gm(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(vC),this.root.sharedNodes.clear()}}}function MW(t){t.updateLayout()}function IW(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")$i(h=>{const g=o?e.measuredBox[h]:e.layoutBox[h],v=Fr(g);g.min=r[h].min,g.max=g.min+v});else if(i==="x"||i==="y"){const h=i==="x"?"y":"x";kw(o?e.measuredBox[h]:e.layoutBox[h],r[h])}else xM(i,e.layoutBox,r)&&$i(h=>{const g=o?e.measuredBox[h]:e.layoutBox[h],v=Fr(r[h]);g.max=g.min+v,t.relativeTarget&&!t.currentAnimation&&(t.isProjectionDirty=!0,t.relativeTarget[h].max=t.relativeTarget[h].min+v)});const l=Tu();eh(l,r,e.layoutBox);const u=Tu();o?eh(u,t.applyTransform(s,!0),e.measuredBox):eh(u,r,e.layoutBox);const d=!gM(l);let f=!1;if(!t.resumeFrom){const h=t.getClosestProjectingParent();if(h&&!h.resumeFrom){const{snapshot:g,layout:v}=h;if(g&&v){const w=t.options.layoutAnchor||void 0,_=Xn();_g(_,e.layoutBox,g.layoutBox,w);const x=Xn();_g(x,r,v.layoutBox,w),vM(_,x)||(f=!0),h.options.layoutRoot&&(t.relativeTarget=x,t.relativeTargetOrigin=_,t.relativeParent=h)}}}t.notifyListeners("didUpdate",{layout:r,snapshot:e,delta:u,layoutDelta:l,hasLayoutChanged:d,hasRelativeLayoutChanged:f})}else if(t.isLead()){const{onExitComplete:r}=t.options;r&&r()}t.options.transition=void 0}function OW(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 LW(t){t.isProjectionDirty=t.isSharedProjectionDirty=t.isTransformDirty=!1}function NW(t){t.clearSnapshot()}function vC(t){t.clearMeasurements()}function DW(t){t.isLayoutDirty=!0,t.updateLayout()}function yC(t){t.isLayoutDirty=!1}function jW(t){t.isAnimationBlocked&&t.layout&&!t.isLayoutDirty&&(t.snapshot=t.layout,t.isLayoutDirty=!0)}function $W(t){const{visualElement:e}=t.options;e&&e.getProps().onBeforeLayoutMeasure&&e.notify("BeforeLayoutMeasure"),t.resetTransform()}function _C(t){t.finishAnimation(),t.targetDelta=t.relativeTarget=t.target=void 0,t.isProjectionDirty=!0}function FW(t){t.resolveTargetDelta()}function VW(t){t.calcProjection()}function HW(t){t.resetSkewAndRotation()}function zW(t){t.removeLeadSnapshot()}function wC(t,e,n){t.translate=Xt(e.translate,0,n),t.scale=Xt(e.scale,1,n),t.origin=e.origin,t.originPoint=e.originPoint}function xC(t,e,n,r){t.min=Xt(e.min,n.min,r),t.max=Xt(e.max,n.max,r)}function UW(t,e,n,r){xC(t.x,e.x,n.x,r),xC(t.y,e.y,n.y,r)}function BW(t){return t.animationValues&&t.animationValues.opacityExit!==void 0}const ZW={duration:.45,ease:[.4,0,.1,1]},bC=t=>typeof navigator<"u"&&navigator.userAgent&&navigator.userAgent.toLowerCase().includes(t),SC=bC("applewebkit/")&&!bC("chrome/")?Math.round:Xs;function kC(t){t.min=SC(t.min),t.max=SC(t.max)}function WW(t){kC(t.x),kC(t.y)}function xM(t,e,n){return t==="position"||t==="preserve-aspect"&&!hW(fC(e),fC(n),.2)}function qW(t){var e;return t!==t.root&&((e=t.scroll)==null?void 0:e.wasRoot)}const GW=wM({attachResizeListener:(t,e)=>Ph(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}),u_={current:void 0},bM=wM({measureScroll:t=>({x:t.scrollLeft,y:t.scrollTop}),defaultParent:()=>{if(!u_.current){const t=new GW({});t.mount(window),t.setOptions({layoutScroll:!0}),u_.current=t}return u_.current},resetTransform:(t,e)=>{t.style.transform=e!==void 0?e:"none"},checkIsScrollRoot:t=>window.getComputedStyle(t).position==="fixed"}),Rb=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 KW(...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 YW(...t){return m.useCallback(KW(...t),t)}class XW extends m.Component{getSnapshotBeforeUpdate(e){const n=this.props.childRef.current;if(dm(n)&&e.isPresent&&!this.props.isPresent&&this.props.pop!==!1){const r=n.offsetParent,s=dm(r)&&r.offsetWidth||0,i=dm(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 QW({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(Rb),f=i!==!1?((g=t.props)==null?void 0:g.ref)??(t==null?void 0:t.ref):void 0,h=YW(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 A=C==="rtl",T=n==="left"?A?`right: ${S}`:`left: ${x}`:A?`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
+ ${T}px !important;
69
+ ${I}px !important;
70
+ }
71
+ `),()=>{var O;(O=l.current)==null||O.removeAttribute("data-motion-pop-id"),R.contains(M)&&R.removeChild(M)}},[e]),b.jsx(XW,{isPresent:e,childRef:l,sizeRef:u,pop:i,children:i===!1?t:m.cloneElement(t,{ref:h})})}const JW=({children:t,initial:e,isPresent:n,onExitComplete:r,custom:s,presenceAffectsLayout:i,mode:o,anchorX:l,anchorY:u,root:d})=>{const f=sb(eq),h=m.useId(),g=m.useRef(n),v=m.useRef(r);ib(()=>{g.current=n,v.current=r});let w=!0,_=m.useMemo(()=>(w=!1,{id:h,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(QW,{pop:o==="popLayout",isPresent:n,anchorX:l,anchorY:u,root:d,children:t}),b.jsx(Gg.Provider,{value:_,children:t})};function eq(){return new Map}function SM(t=!0){const e=m.useContext(Gg);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 L0=t=>t.key||"";function CC(t){const e=[];return m.Children.forEach(t,n=>{m.isValidElement(n)&&e.push(n)}),e}const Cs=({children:t,custom:e,initial:n=!0,onExitComplete:r,presenceAffectsLayout:s=!0,mode:i="sync",propagate:o=!1,anchorX:l="left",anchorY:u="top",root:d})=>{const[f,h]=SM(o),g=m.useMemo(()=>CC(t),[t]),v=o&&!f?[]:g.map(L0),w=m.useRef(!0),_=m.useRef(g),x=sb(()=>new Map),S=m.useRef(new Set),[k,C]=m.useState(g),[A,T]=m.useState(g);ib(()=>{w.current=!1,_.current=g;for(let R=0;R<A.length;R++){const O=L0(A[R]);v.includes(O)?(x.delete(O),S.current.delete(O)):x.get(O)!==!0&&x.set(O,!1)}},[A,v.length,v.join("-")]);const I=[];if(g!==k){let R=[...g];for(let O=0;O<A.length;O++){const N=A[O],D=L0(N);v.includes(D)||(R.splice(O,0,N),I.push(N))}return i==="wait"&&I.length&&(R=I),T(CC(R)),C(g),null}const{forceRender:M}=m.useContext(rb);return b.jsx(b.Fragment,{children:A.map(R=>{const O=L0(R),N=o&&!f?!1:g===A||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 F=!0;x.forEach(K=>{K||(F=!1)}),F&&(M==null||M(),T(_.current),o&&(h==null||h()),r&&r())};return b.jsx(JW,{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)})})},kM=m.createContext({strict:!1}),PC={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 AC=!1;function tq(){if(AC)return;const t={};for(const e in PC)t[e]={isEnabled:n=>PC[e].some(r=>!!n[r])};eM(t),AC=!0}function EM(){return tq(),FZ()}function nq(t){const e=EM();for(const n in t)e[n]={...e[n],...t[n]};eM(e)}const rq=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 wg(t){return t.startsWith("while")||t.startsWith("drag")&&t!=="draggable"||t.startsWith("layout")||t.startsWith("onTap")||t.startsWith("onPan")||t.startsWith("onLayout")||rq.has(t)}let CM=t=>!wg(t);function sq(t){typeof t=="function"&&(CM=e=>e.startsWith("on")?!wg(e):t(e))}try{sq(require("@emotion/is-prop-valid").default)}catch{}function iq(t,e,n){const r={};for(const s in t)s==="values"&&typeof t.values=="object"||gr(t[s])||(CM(s)||n===!0&&wg(s)||!e&&!wg(s)||t.draggable&&s.startsWith("onDrag"))&&(r[s]=t[s]);return r}const Jg=m.createContext({});function oq(t,e){if(Qg(t)){const{initial:n,animate:r}=t;return{initial:n===!1||Ch(n)?n:void 0,animate:Ch(r)?r:void 0}}return t.inherit!==!1?e:{}}function aq(t){const{initial:e,animate:n}=oq(t,m.useContext(Jg));return m.useMemo(()=>({initial:e,animate:n}),[TC(e),TC(n)])}function TC(t){return Array.isArray(t)?t.join(" "):t}const Mb=()=>({style:{},transform:{},transformOrigin:{},vars:{}});function PM(t,e,n){for(const r in e)!gr(e[r])&&!aM(r,n)&&(t[r]=e[r])}function lq({transformTemplate:t},e){return m.useMemo(()=>{const n=Mb();return Ab(n,e,t),Object.assign({},n.vars,n.style)},[e])}function cq(t,e){const n=t.style||{},r={};return PM(r,n,t),Object.assign(r,lq(t,e)),r}function uq(t,e){const n={},r=cq(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 AM=()=>({...Mb(),attrs:{}});function dq(t,e,n,r){const s=m.useMemo(()=>{const i=AM();return lM(i,e,uM(r),t.transformTemplate,t.style),{...i.attrs,style:{...i.style}}},[e]);if(t.style){const i={};PM(i,t.style,t),s.style={...i,...s.style}}return s}const fq=["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 Ib(t){return typeof t!="string"||t.includes("-")?!1:!!(fq.indexOf(t)>-1||/[A-Z]/u.test(t))}function hq(t,e,n,{latestValues:r},s,i=!1,o){const u=(o??Ib(t)?dq:uq)(e,r,s,t),d=iq(e,typeof t=="string",i),f=t!==m.Fragment?{...d,...u,ref:n}:{},{children:h}=e,g=m.useMemo(()=>gr(h)?h.get():h,[h]);return m.createElement(t,{...f,children:g})}function pq({scrapeMotionValuesFromProps:t,createRenderState:e},n,r,s){return{latestValues:mq(n,r,s,t),renderState:e()}}function mq(t,e,n,r){const s={},i=r(t,{});for(const g in i)s[g]=gm(i[g]);let{initial:o,animate:l}=t;const u=Qg(t),d=QR(t);e&&d&&!u&&t.inherit!==!1&&(o===void 0&&(o=e.initial),l===void 0&&(l=e.animate));let f=n?n.initial===!1:!1;f=f||o===!1;const h=f?l:o;if(h&&typeof h!="boolean"&&!Xg(h)){const g=Array.isArray(h)?h:[h];for(let v=0;v<g.length;v++){const w=_b(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 A=f?C.length-1:0;C=C[A]}C!==null&&(s[k]=C)}for(const k in _)s[k]=_[k]}}}return s}const TM=t=>(e,n)=>{const r=m.useContext(Jg),s=m.useContext(Gg),i=()=>pq(t,e,r,s);return n?i():sb(i)},gq=TM({scrapeMotionValuesFromProps:Tb,createRenderState:Mb}),vq=TM({scrapeMotionValuesFromProps:dM,createRenderState:AM}),yq=Symbol.for("motionComponentSymbol");function _q(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 RM=m.createContext({});function xu(t){return t&&typeof t=="object"&&Object.prototype.hasOwnProperty.call(t,"current")}function wq(t,e,n,r,s,i){var C,A;const{visualElement:o}=m.useContext(Jg),l=m.useContext(kM),u=m.useContext(Gg),d=m.useContext(Rb),f=d.reducedMotion,h=d.skipAnimations,g=m.useRef(null),v=m.useRef(!1);r=r||l.renderer,!g.current&&r&&(g.current=r(t,{visualState:e,parent:o,props:n,presenceContext:u,blockInitialAnimation:u?u.initial===!1:!1,reducedMotionConfig:f,skipAnimations:h,isSVG:i}),v.current&&g.current&&(g.current.manuallyAnimateOnMount=!0));const w=g.current,_=m.useContext(RM);w&&!w.projection&&s&&(w.type==="html"||w.type==="svg")&&xq(g.current,n,s,_);const x=m.useRef(!1);m.useInsertionEffect(()=>{w&&x.current&&w.update(n,u)});const S=n[VR],k=m.useRef(!!S&&typeof window<"u"&&!((C=window.MotionHandoffIsComplete)!=null&&C.call(window,S))&&((A=window.MotionHasOptimisedAnimation)==null?void 0:A.call(window,S)));return ib(()=>{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 T;(T=window.MotionHandoffMarkAsComplete)==null||T.call(window,S)}),k.current=!1),w.enteringChildren=void 0)}),w}function xq(t,e,n,r){const{layoutId:s,layout:i,drag:o,dragConstraints:l,layoutScroll:u,layoutRoot:d,layoutAnchor:f,layoutCrossfade:h}=e;t.projection=new n(t.latestValues,e["data-framer-portal-id"]?void 0:MM(t.parent)),t.projection.setOptions({layoutId:s,layout:i,alwaysMeasureLayout:!!o||l&&xu(l),visualElement:t,animationType:typeof i=="string"?i:"both",initialPromotionConfig:r,crossfade:h,layoutScroll:u,layoutRoot:d,layoutAnchor:f})}function MM(t){if(t)return t.options.allowProjection!==!1?t.projection:MM(t.parent)}function d_(t,{forwardMotionProps:e=!1,type:n}={},r,s){r&&nq(r);const i=n?n==="svg":Ib(t),o=i?vq:gq;function l(d,f){let h;const g={...m.useContext(Rb),...d,layoutId:bq(d)},{isStatic:v}=g,w=aq(d),_=o(d,v);if(!v&&typeof window<"u"){Sq();const x=kq(g);h=x.MeasureLayout,w.visualElement=wq(t,_,g,s,x.ProjectionNode,i)}return b.jsxs(Jg.Provider,{value:w,children:[h&&w.visualElement?b.jsx(h,{visualElement:w.visualElement,...g}):null,hq(t,d,_q(_,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[yq]=t,u}function bq({layoutId:t}){const e=m.useContext(rb).id;return e&&t!==void 0?e+"-"+t:t}function Sq(t,e){m.useContext(kM).strict}function kq(t){const e=EM(),{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 Eq(t,e){if(typeof Proxy>"u")return d_;const n=new Map,r=(i,o)=>d_(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,d_(o,void 0,t,e)),n.get(o))})}const Cq=(t,e)=>e.isSVG??Ib(t)?new nW(e):new YZ(e,{allowProjection:t!==m.Fragment});class Pq extends il{constructor(e){super(e),e.animationState||(e.animationState=aW(e))}updateAnimationControlsSubscription(){const{animate:e}=this.node.getProps();Xg(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 Aq=0;class Tq extends il{constructor(){super(...arguments),this.id=Aq++,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=dc(this.node,o,l);if(u){const{transition:d,transitionEnd:f,...h}=u;for(const g in h)(i=this.node.getValue(g))==null||i.jump(h[g])}}this.node.animationState.reset(),this.node.animationState.animateChanges()}else this.node.animationState.setActive("exit",!1);this.isExitComplete=!1;return}const s=this.node.animationState.setActive("exit",!e);n&&!e&&s.then(()=>{this.isExitComplete=!0,n(this.id)})}mount(){const{register:e,onExitComplete:n}=this.node.presenceContext||{};n&&n(this.id),e&&(this.unmount=e(this.id))}unmount(){}}const Rq={animation:{Feature:Pq},exit:{Feature:Tq}};function sp(t){return{point:{x:t.pageX,y:t.pageY}}}const Mq=t=>e=>Sb(e)&&t(e,sp(e));function th(t,e,n,r){return Ph(t,e,Mq(n),r)}const IM=({current:t})=>t?t.ownerDocument.defaultView:null,RC=(t,e)=>Math.abs(t-e);function Iq(t,e){const n=RC(t.x,e.x),r=RC(t.y,e.y);return Math.sqrt(n**2+r**2)}const MC=new Set(["auto","scroll"]);class OM{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=N0(this.lastRawMoveEventInfo,this.transformPagePoint));const w=f_(this.lastMoveEventInfo,this.history),_=this.startEvent!==null,x=Iq(w.offset,{x:0,y:0})>=this.distanceThreshold;if(!_&&!x)return;const{point:S}=w,{timestamp:k}=hr;this.history.push({...S,timestamp:k});const{onStart:C,onMove:A}=this.handlers;_||(C&&C(this.lastMoveEvent,w),this.startEvent=this.lastMoveEvent),A&&A(this.lastMoveEvent,w)},this.handlePointerMove=(w,_)=>{this.lastMoveEvent=w,this.lastRawMoveEventInfo=_,this.lastMoveEventInfo=N0(_,this.transformPagePoint),Qt.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=f_(w.type==="pointercancel"?this.lastMoveEventInfo:N0(_,this.transformPagePoint),this.history);this.startEvent&&x&&x(w,C),S&&S(w,C)},!Sb(e))return;this.dragSnapToOrigin=i,this.handlers=n,this.transformPagePoint=r,this.distanceThreshold=o,this.contextWindow=s||window;const u=sp(e),d=N0(u,this.transformPagePoint),{point:f}=d,{timestamp:h}=hr;this.history=[{...f,timestamp:h}];const{onSessionStart:g}=n;g&&g(e,f_(d,this.history));const v={passive:!0,capture:!0};this.removeListeners=tp(th(this.contextWindow,"pointermove",this.handlePointerMove,v),th(this.contextWindow,"pointerup",this.handlePointerUp,v),th(this.contextWindow,"pointercancel",this.handlePointerUp,v)),l&&this.startScrollTracking(l)}startScrollTracking(e){let n=e.parentElement;for(;n;){const r=getComputedStyle(n);(MC.has(r.overflowX)||MC.has(r.overflowY))&&this.scrollPositions.set(n,{x:n.scrollLeft,y:n.scrollTop}),n=n.parentElement}this.scrollPositions.set(window,{x:window.scrollX,y:window.scrollY}),window.addEventListener("scroll",this.onElementScroll,{capture:!0}),window.addEventListener("scroll",this.onWindowScroll),this.removeScrollListeners=()=>{window.removeEventListener("scroll",this.onElementScroll,{capture:!0}),window.removeEventListener("scroll",this.onWindowScroll)}}handleScroll(e){const n=this.scrollPositions.get(e);if(!n)return;const r=e===window,s=r?{x:window.scrollX,y:window.scrollY}:{x:e.scrollLeft,y:e.scrollTop},i={x:s.x-n.x,y:s.y-n.y};i.x===0&&i.y===0||(r?this.lastMoveEventInfo&&(this.lastMoveEventInfo.point.x+=i.x,this.lastMoveEventInfo.point.y+=i.y):this.history.length>0&&(this.history[0].x-=i.x,this.history[0].y-=i.y),this.scrollPositions.set(e,s),Qt.update(this.updatePoint,!0))}updateHandlers(e){this.handlers=e}end(){this.removeListeners&&this.removeListeners(),this.removeScrollListeners&&this.removeScrollListeners(),this.scrollPositions.clear(),Xa(this.updatePoint)}}function N0(t,e){return e?{point:e(t.point)}:t}function IC(t,e){return{x:t.x-e.x,y:t.y-e.y}}function f_({point:t},e){return{point:t,delta:IC(t,LM(e)),offset:IC(t,Oq(e)),velocity:Lq(e,.1)}}function Oq(t){return t[0]}function LM(t){return t[t.length-1]}function Lq(t,e){if(t.length<2)return{x:0,y:0};let n=t.length-1,r=null;const s=LM(t);for(;n>=0&&(r=t[n],!(s.timestamp-r.timestamp>Es(e)));)n--;if(!r)return{x:0,y:0};r===t[0]&&t.length>2&&s.timestamp-r.timestamp>Es(e)*2&&(r=t[1]);const i=qs(s.timestamp-r.timestamp);if(i===0)return{x:0,y:0};const o={x:(s.x-r.x)/i,y:(s.y-r.y)/i};return o.x===1/0&&(o.x=0),o.y===1/0&&(o.y=0),o}function Nq(t,{min:e,max:n},r){return e!==void 0&&t<e?t=r?Xt(e,t,r.min):Math.max(t,e):n!==void 0&&t>n&&(t=r?Xt(n,t,r.max):Math.min(t,n)),t}function OC(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 Dq(t,{top:e,left:n,bottom:r,right:s}){return{x:OC(t.x,n,s),y:OC(t.y,e,r)}}function LC(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 jq(t,e){return{x:LC(t.x,e.x),y:LC(t.y,e.y)}}function $q(t,e){let n=.5;const r=Fr(t),s=Fr(e);return s>r?n=kh(e.min,e.max-r,t.min):r>s&&(n=kh(t.min,t.max-s,e.min)),eo(0,1,n)}function Fq(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 Ew=.35;function Vq(t=Ew){return t===!1?t=0:t===!0&&(t=Ew),{x:NC(t,"left","right"),y:NC(t,"top","bottom")}}function NC(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 Hq=new WeakMap;class zq{constructor(e){this.openDragLock=null,this.isDragging=!1,this.currentDirection=null,this.originPoint={x:0,y:0},this.constraints=!1,this.hasMutatedConstraints=!1,this.elastic=Xn(),this.latestPointerEvent=null,this.latestPanInfo=null,this.visualElement=e}start(e,{snapToCursor:n=!1,distanceThreshold:r}={}){const{presenceContext:s}=this.visualElement;if(s&&s.isPresent===!1)return;const i=h=>{n&&this.snapToCursor(sp(h).point),this.stopAnimation()},o=(h,g)=>{const{drag:v,dragPropagation:w,onDragStart:_}=this.getProps();if(v&&!w&&(this.openDragLock&&this.openDragLock(),this.openDragLock=gZ(v),!this.openDragLock))return;this.latestPointerEvent=h,this.latestPanInfo=g,this.isDragging=!0,this.currentDirection=null,this.resolveConstraints(),this.visualElement.projection&&(this.visualElement.projection.isAnimationBlocked=!0,this.visualElement.projection.target=void 0),$i(S=>{let k=this.getAxisMotionValue(S).get()||0;if(Yi.test(k)){const{projection:C}=this.visualElement;if(C&&C.layout){const A=C.layout.layoutBox[S];A&&(k=Fr(A)*(parseFloat(k)/100))}}this.originPoint[S]=k}),_&&Qt.update(()=>_(h,g),!1,!0),gw(this.visualElement,"transform");const{animationState:x}=this.visualElement;x&&x.setActive("whileDrag",!0)},l=(h,g)=>{this.latestPointerEvent=h,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=Bq(S),this.currentDirection!==null&&_&&_(this.currentDirection);return}this.updateAxis("x",g.point,S),this.updateAxis("y",g.point,S),this.visualElement.render(),x&&Qt.update(()=>x(h,g),!1,!0)},u=(h,g)=>{this.latestPointerEvent=h,this.latestPanInfo=g,this.stop(h,g),this.latestPointerEvent=null,this.latestPanInfo=null},d=()=>{const{dragSnapToOrigin:h}=this.getProps();(h||this.constraints)&&this.startAnimation({x:0,y:0})},{dragSnapToOrigin:f}=this.getProps();this.panSession=new OM(e,{onSessionStart:i,onStart:o,onMove:l,onSessionEnd:u,resumeAnimation:d},{transformPagePoint:this.visualElement.getTransformPagePoint(),dragSnapToOrigin:f,distanceThreshold:r,contextWindow:IM(this.visualElement),element:this.visualElement.current})}stop(e,n){const r=e||this.latestPointerEvent,s=n||this.latestPanInfo,i=this.isDragging;if(this.cancel(),!i||!s||!r)return;const{velocity:o}=s;this.startAnimation(o);const{onDragEnd:l}=this.getProps();l&&Qt.postRender(()=>l(r,s))}cancel(){this.isDragging=!1;const{projection:e,animationState:n}=this.visualElement;e&&(e.isAnimationBlocked=!1),this.endPanSession();const{dragPropagation:r}=this.getProps();!r&&this.openDragLock&&(this.openDragLock(),this.openDragLock=null),n&&n.setActive("whileDrag",!1)}endPanSession(){this.panSession&&this.panSession.end(),this.panSession=void 0}updateAxis(e,n,r){const{drag:s}=this.getProps();if(!r||!D0(e,s,this.currentDirection))return;const i=this.getAxisMotionValue(e);let o=this.originPoint[e]+r[e];this.constraints&&this.constraints[e]&&(o=Nq(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&&xu(e)?this.constraints||(this.constraints=this.resolveRefConstraints()):e&&r?this.constraints=Dq(r.layoutBox,e):this.constraints=!1,this.elastic=Vq(n),s!==this.constraints&&!xu(e)&&r&&this.constraints&&!this.hasMutatedConstraints&&$i(o=>{this.constraints!==!1&&this.getAxisMotionValue(o)&&(this.constraints[o]=Fq(r.layoutBox[o],this.constraints[o]))})}resolveRefConstraints(){const{dragConstraints:e,onMeasureDragConstraints:n}=this.getProps();if(!e||!xu(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=BZ(r,s.root,this.visualElement.getTransformPagePoint());let o=jq(s.layout.layoutBox,i);if(n){const l=n(HZ(o));this.hasMutatedConstraints=!!l,l&&(o=nM(l))}return o}startAnimation(e){const{drag:n,dragMomentum:r,dragElastic:s,dragTransition:i,dragSnapToOrigin:o,onDragTransitionEnd:l}=this.getProps(),u=this.constraints||{},d=$i(f=>{if(!D0(f,n,this.currentDirection))return;let h=u&&u[f]||{};(o===!0||o===f)&&(h={min:0,max:0});const g=s?200:1e6,v=s?40:1e7,w={type:"inertia",velocity:r?e[f]:0,bounceStiffness:g,bounceDamping:v,timeConstant:750,restDelta:1,restSpeed:10,...i,...h};return this.startAxisValueAnimation(f,w)});return Promise.all(d).then(l)}startAxisValueAnimation(e,n){const r=this.getAxisMotionValue(e);return gw(this.visualElement,e),r.start(yb(e,r,0,n,this.visualElement,!1))}stopAnimation(){$i(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){$i(n=>{const{drag:r}=this.getProps();if(!D0(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]-Xt(o,l,.5)+u)}})}scalePositionWithinConstraints(){if(!this.visualElement.current)return;const{drag:e,dragConstraints:n}=this.getProps(),{projection:r}=this.visualElement;if(!xu(n)||!r||!this.constraints)return;this.stopAnimation();const s={x:0,y:0};$i(o=>{const l=this.getAxisMotionValue(o);if(l&&this.constraints!==!1){const u=l.get();s[o]=$q({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(),$i(o=>{if(!D0(o,e,null))return;const l=this.getAxisMotionValue(o),{min:u,max:d}=this.constraints[o];l.set(Xt(u,d,s[o]))}),this.visualElement.render()}addListeners(){if(!this.visualElement.current)return;Hq.set(this.visualElement,this);const e=this.visualElement.current,n=th(e,"pointerdown",d=>{const{drag:f,dragListener:h=!0}=this.getProps(),g=d.target,v=g!==e&&bZ(g);f&&h&&!v&&this.start(d)});let r;const s=()=>{const{dragConstraints:d}=this.getProps();xu(d)&&d.current&&(this.constraints=this.resolveRefConstraints(),r||(r=Uq(e,d.current,()=>this.scalePositionWithinConstraints())))},{projection:i}=this.visualElement,o=i.addEventListener("measure",s);i&&!i.layout&&(i.root&&i.root.updateScroll(),i.updateLayout()),Qt.read(s);const l=Ph(window,"resize",()=>this.scalePositionWithinConstraints()),u=i.addEventListener("didUpdate",(({delta:d,hasLayoutChanged:f})=>{this.isDragging&&f&&($i(h=>{const g=this.getAxisMotionValue(h);g&&(this.originPoint[h]+=d[h].translate,g.set(g.get()+d[h].translate))}),this.visualElement.render())}));return()=>{l(),n(),o(),u&&u(),r&&r()}}getProps(){const e=this.visualElement.getProps(),{drag:n=!1,dragDirectionLock:r=!1,dragPropagation:s=!1,dragConstraints:i=!1,dragElastic:o=Ew,dragMomentum:l=!0}=e;return{...e,drag:n,dragDirectionLock:r,dragPropagation:s,dragConstraints:i,dragElastic:o,dragMomentum:l}}}function jC(t){let e=!0;return()=>{if(e){e=!1;return}t()}}function Uq(t,e,n){const r=BE(t,jC(n)),s=BE(e,jC(n));return()=>{r(),s()}}function D0(t,e,n){return(e===!0||e===t)&&(n===null||n===t)}function Bq(t,e=10){let n=null;return Math.abs(t.y)>e?n="y":Math.abs(t.x)>e&&(n="x"),n}class Zq extends il{constructor(e){super(e),this.removeGroupControls=Xs,this.removeListeners=Xs,this.controls=new zq(e)}mount(){const{dragControls:e}=this.node.getProps();e&&(this.removeGroupControls=e.subscribe(this.controls)),this.removeListeners=this.controls.addListeners()||Xs}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 h_=t=>(e,n)=>{t&&Qt.update(()=>t(e,n),!1,!0)};class Wq extends il{constructor(){super(...arguments),this.removePointerDownListener=Xs}onPointerDown(e){this.session=new OM(e,this.createPanHandlers(),{transformPagePoint:this.node.getTransformPagePoint(),contextWindow:IM(this.node)})}createPanHandlers(){const{onPanSessionStart:e,onPanStart:n,onPan:r,onPanEnd:s}=this.node.getProps();return{onSessionStart:h_(e),onStart:h_(n),onMove:h_(r),onEnd:(i,o)=>{delete this.session,s&&Qt.postRender(()=>s(i,o))}}}mount(){this.removePointerDownListener=th(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 p_=!1;class qq 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),p_&&i.root.didUpdate(),i.addEventListener("animationComplete",()=>{this.safeToRemove()}),i.setOptions({...i.options,layoutDependency:this.props.layoutDependency,onExitComplete:()=>this.safeToRemove()})),vm.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}),p_=!0,s||e.layoutDependency!==n||n===void 0||e.isPresent!==i?o.willUpdate():this.safeToRemove(),e.isPresent!==i&&(i?o.promote():o.relegate()||Qt.postRender(()=>{const l=o.getStack();(!l||!l.members.length)&&this.safeToRemove()}))),null}componentDidUpdate(){const{visualElement:e,layoutAnchor:n}=this.props,{projection:r}=e;r&&(r.options.layoutAnchor=n,r.root.didUpdate(),bb.postRender(()=>{!r.currentAnimation&&r.isLead()&&this.safeToRemove()}))}componentWillUnmount(){const{visualElement:e,layoutGroup:n,switchLayoutGroup:r}=this.props,{projection:s}=e;p_=!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 NM(t){const[e,n]=SM(),r=m.useContext(rb);return b.jsx(qq,{...t,layoutGroup:r,switchLayoutGroup:m.useContext(RM),isPresent:e,safeToRemove:n})}const Gq={pan:{Feature:Wq},drag:{Feature:Zq,ProjectionNode:bM,MeasureLayout:NM}};function $C(t,e,n){const{props:r}=t;t.animationState&&r.whileHover&&t.animationState.setActive("whileHover",n==="Start");const s="onHover"+n,i=r[s];i&&Qt.postRender(()=>i(e,sp(e)))}class Kq extends il{mount(){const{current:e}=this.node;e&&(this.unmount=yZ(e,(n,r)=>($C(this.node,r,"Start"),s=>$C(this.node,s,"End"))))}unmount(){}}class Yq extends il{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=tp(Ph(this.node.current,"focus",()=>this.onFocus()),Ph(this.node.current,"blur",()=>this.onBlur()))}unmount(){}}function FC(t,e,n){const{props:r}=t;if(t.current instanceof HTMLButtonElement&&t.current.disabled)return;t.animationState&&r.whileTap&&t.animationState.setActive("whileTap",n==="Start");const s="onTap"+(n==="End"?"":n),i=r[s];i&&Qt.postRender(()=>i(e,sp(e)))}class Xq extends il{mount(){const{current:e}=this.node;if(!e)return;const{globalTapTarget:n,propagate:r}=this.node.props;this.unmount=kZ(e,(s,i)=>(FC(this.node,i,"Start"),(o,{success:l})=>FC(this.node,o,l?"End":"Cancel")),{useGlobalTarget:n,stopPropagation:(r==null?void 0:r.tap)===!1})}unmount(){}}const Cw=new WeakMap,m_=new WeakMap,Qq=t=>{const e=Cw.get(t.target);e&&e(t)},Jq=t=>{t.forEach(Qq)};function eG({root:t,...e}){const n=t||document;m_.has(n)||m_.set(n,{});const r=m_.get(n),s=JSON.stringify(e);return r[s]||(r[s]=new IntersectionObserver(Jq,{root:t,...e})),r[s]}function tG(t,e,n){const r=eG(e);return Cw.set(t,n),r.observe(t),()=>{Cw.delete(t),r.unobserve(t)}}const nG={some:0,all:1};class rG extends il{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:nG[s]},l=d=>{const{isIntersecting:f}=d;if(this.isInView===f||(this.isInView=f,i&&!f&&this.hasEnteredView))return;f&&(this.hasEnteredView=!0),this.node.animationState&&this.node.animationState.setActive("whileInView",f);const{onViewportEnter:h,onViewportLeave:g}=this.node.getProps(),v=f?h:g;v&&v(d)};this.stopObserver=tG(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(sG(e,n))&&this.startObserver()}unmount(){var e;(e=this.stopObserver)==null||e.call(this),this.hasEnteredView=!1,this.isInView=!1}}function sG({viewport:t={}},{viewport:e={}}={}){return n=>t[n]!==e[n]}const iG={inView:{Feature:rG},tap:{Feature:Xq},focus:{Feature:Yq},hover:{Feature:Kq}},oG={layout:{ProjectionNode:bM,MeasureLayout:NM}},aG={...Rq,...iG,...Gq,...oG},Ho=Eq(aG,Cq);function lG(){!Pb.current&&JR();const[t]=m.useState(gg.current);return t}const Si=Ho;var ip=WT();const cG=Vg(ip);function uG(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 dG=t=>{switch(t){case"success":return pG;case"info":return gG;case"warning":return mG;case"error":return vG;default:return null}},fG=Array(12).fill(0),hG=({visible:t,className:e})=>we.createElement("div",{className:["sonner-loading-wrapper",e].filter(Boolean).join(" "),"data-visible":t},we.createElement("div",{className:"sonner-spinner"},fG.map((n,r)=>we.createElement("div",{className:"sonner-loading-bar",key:`spinner-bar-${r}`})))),pG=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"})),mG=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"})),gG=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"})),vG=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"})),yG=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"})),_G=()=>{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 wG=1;const xG=100,VC=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:wG++};class bG{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-xG;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=VC(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(kG(d)&&!d.ok){i=!1;const h=typeof n.error=="function"?await n.error(`HTTP error! status: ${d.status}`):n.error,g=typeof n.description=="function"?await n.description(`HTTP error! status: ${d.status}`):n.description,w=typeof h=="object"&&!we.isValidElement(h)?h:{message:h};this.create({id:r,type:"error",description:g,...w})}else if(d instanceof Error){i=!1;const h=typeof n.error=="function"?await n.error(d):n.error,g=typeof n.description=="function"?await n.description(d):n.description,w=typeof h=="object"&&!we.isValidElement(h)?h:{message:h};this.create({id:r,type:"error",description:g,...w})}else if(n.success!==void 0){i=!1;const h=typeof n.success=="function"?await n.success(d):n.success,g=typeof n.description=="function"?await n.description(d):n.description,w=typeof h=="object"&&!we.isValidElement(h)?h:{message:h};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,h=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:h,...v})}}).finally(()=>{i&&(this.dismiss(r),r=void 0),n.finally==null||n.finally.call(n)}),u=()=>new Promise((d,f)=>l.then(()=>o[0]==="reject"?f(o[1]):d(o[1])).catch(f));return typeof r!="string"&&typeof r!="number"?{unwrap:u}:Object.assign(r,{unwrap:u})},this.custom=(e,n)=>{const r=VC(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 Gr=new bG,SG=(t,e)=>Gr.message(t,e),kG=t=>t&&typeof t=="object"&&"ok"in t&&typeof t.ok=="boolean"&&"status"in t&&typeof t.status=="number",EG=SG,CG=()=>Gr.toasts,PG=()=>Gr.getActiveToasts(),Mt=Object.assign(EG,{success:Gr.success,info:Gr.info,warning:Gr.warning,error:Gr.error,custom:Gr.custom,message:Gr.message,promise:Gr.promise,dismiss:Gr.dismiss,loading:Gr.loading},{getHistory:CG,getToasts:PG});uG("[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 j0(t){return t.label!==void 0}const AG=3,TG="24px",RG="16px",HC=4e3,MG=356,IG=14,OG=45,LG=200;function Ii(...t){return t.filter(Boolean).join(" ")}function NG(t){const[e,n]=t.split("-"),r=[];return e&&r.push(e),n&&r.push(n),r}const DG=t=>{var e,n,r,s,i,o,l,u,d;const{invert:f,toast:h,unstyled:g,interacting:v,setHeights:w,visibleToasts:_,heights:x,index:S,toasts:k,expanded:C,removeToast:A,defaultRichColors:T,closeButton:I,style:M,cancelButtonStyle:R,actionButtonStyle:O,className:N="",descriptionClassName:D="",duration:F,position:K,gap:B,expandByDefault:G,classNames:H,icons:Y,closeButtonAriaLabel:U="Close toast"}=t,[J,Z]=we.useState(null),[j,Q]=we.useState(null),[oe,ne]=we.useState(!1),[se,de]=we.useState(!1),[ve,ue]=we.useState(!1),[ae,Oe]=we.useState(!1),[We,Ee]=we.useState(!1),[pt,Ot]=we.useState(0),[en,bt]=we.useState(0),_t=we.useRef(h.duration||F||HC),qe=we.useRef(null),Ke=we.useRef(null),Ct=S===0,Te=S+1<=_,Ye=h.type,Lt=Ye??"default",Ge=h.dismissible!==!1,Pt=h.className||"",as=h.descriptionClassName||"",yr=we.useMemo(()=>x.findIndex(Qe=>Qe.toastId===h.id)||0,[x,h.id]),Le=we.useMemo(()=>{var Qe;return(Qe=h.closeButton)!=null?Qe:I},[h.closeButton,I]),ea=we.useMemo(()=>h.duration||F||HC,[h.duration,F]),Nn=we.useRef(0),er=we.useRef(0),dl=we.useRef(0),gn=we.useRef(null),[vn,Md]=K.split("-"),Is=we.useMemo(()=>x.reduce((Qe,Nt,Vt)=>Vt>=yr?Qe:Qe+Nt.height,0),[x,yr]),_r=_G(),tr=we.useMemo(()=>{var Qe;return(Qe=t.swipeDirections)!=null?Qe:NG(K)},[t.swipeDirections,K]),oo=h.invert||f,ei=Ye==="loading";er.current=we.useMemo(()=>yr*B+Is,[yr,Is]),we.useEffect(()=>{_t.current=ea},[ea]),we.useEffect(()=>{ne(!0)},[]),we.useEffect(()=>{const Qe=Ke.current;if(Qe){const Nt=Qe.getBoundingClientRect().height;return bt(Nt),w(Vt=>[{toastId:h.id,height:Nt,position:h.position},...Vt]),()=>w(Vt=>Vt.filter(Wn=>Wn.toastId!==h.id))}},[w,h.id]),we.useLayoutEffect(()=>{if(!oe)return;const Qe=Ke.current,Nt=Qe.style.height;Qe.style.height="auto";const Vt=Qe.getBoundingClientRect().height;Qe.style.height=Nt,bt(Vt),w(Wn=>Wn.find(Bt=>Bt.toastId===h.id)?Wn.map(Bt=>Bt.toastId===h.id?{...Bt,height:Vt}:Bt):[{toastId:h.id,height:Vt,position:h.position},...Wn])},[oe,h.title,h.description,w,h.id,h.jsx,h.action,h.cancel]);const Dn=we.useCallback(()=>{de(!0),Ot(er.current),w(Qe=>Qe.filter(Nt=>Nt.toastId!==h.id)),setTimeout(()=>{A(h)},LG)},[h,A,w,er]);we.useEffect(()=>{if(h.promise&&Ye==="loading"||h.duration===1/0||h.type==="loading")return;let Qe;return C||v||_r?(()=>{if(dl.current<Nn.current){const Wn=new Date().getTime()-Nn.current;_t.current=_t.current-Wn}dl.current=new Date().getTime()})():(()=>{_t.current!==1/0&&(Nn.current=new Date().getTime(),Qe=setTimeout(()=>{h.onAutoClose==null||h.onAutoClose.call(h,h),Dn()},_t.current))})(),()=>clearTimeout(Qe)},[C,v,h,Ye,_r,Dn]),we.useEffect(()=>{h.delete&&(Dn(),h.onDismiss==null||h.onDismiss.call(h,h))},[Dn,h.delete]);function Os(){var Qe;if(Y!=null&&Y.loading){var Nt;return we.createElement("div",{className:Ii(H==null?void 0:H.loader,h==null||(Nt=h.classNames)==null?void 0:Nt.loader,"sonner-loader"),"data-visible":Ye==="loading"},Y.loading)}return we.createElement(hG,{className:Ii(H==null?void 0:H.loader,h==null||(Qe=h.classNames)==null?void 0:Qe.loader),visible:Ye==="loading"})}const fl=h.icon||(Y==null?void 0:Y[Ye])||dG(Ye);var ao,ls;return we.createElement("li",{tabIndex:0,ref:Ke,className:Ii(N,Pt,H==null?void 0:H.toast,h==null||(e=h.classNames)==null?void 0:e.toast,H==null?void 0:H[Lt],h==null||(n=h.classNames)==null?void 0:n[Lt]),"data-sonner-toast":"","data-rich-colors":(ao=h.richColors)!=null?ao:T,"data-styled":!(h.jsx||h.unstyled||g),"data-mounted":oe,"data-promise":!!h.promise,"data-swiped":We,"data-removed":se,"data-visible":Te,"data-y-position":vn,"data-x-position":Md,"data-index":S,"data-front":Ct,"data-swiping":ve,"data-dismissible":Ge,"data-type":Ye,"data-invert":oo,"data-swipe-out":ae,"data-swipe-direction":j,"data-expanded":!!(C||G&&oe),"data-testid":h.testId,style:{"--index":S,"--toasts-before":S,"--z-index":k.length-S,"--offset":`${se?pt:er.current}px`,"--initial-height":G?"auto":`${en}px`,...M,...h.style},onDragEnd:()=>{ue(!1),Z(null),gn.current=null},onPointerDown:Qe=>{Qe.button!==2&&(ei||!Ge||(qe.current=new Date,Ot(er.current),Qe.target.setPointerCapture(Qe.pointerId),Qe.target.tagName!=="BUTTON"&&(ue(!0),gn.current={x:Qe.clientX,y:Qe.clientY})))},onPointerUp:()=>{var Qe,Nt,Vt;if(ae||!Ge)return;gn.current=null;const Wn=Number(((Qe=Ke.current)==null?void 0:Qe.style.getPropertyValue("--swipe-amount-x").replace("px",""))||0),cs=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()),jn=J==="x"?Wn:cs,Hr=Math.abs(jn)/Bt;if((J==="x"?tr.includes(Wn>0?"right":"left"):tr.includes(cs>0?"bottom":"top"))&&(Math.abs(jn)>=OG||Hr>.11)){Ot(er.current),h.onDismiss==null||h.onDismiss.call(h,h),Q(J==="x"?Wn>0?"right":"left":cs>0?"down":"up"),Dn(),Oe(!0);return}else{var cr,Rn;(cr=Ke.current)==null||cr.style.setProperty("--swipe-amount-x","0px"),(Rn=Ke.current)==null||Rn.style.setProperty("--swipe-amount-y","0px")}Ee(!1),ue(!1),Z(null)},onPointerMove:Qe=>{var Nt,Vt,Wn;if(!gn.current||!Ge||((Nt=window.getSelection())==null?void 0:Nt.toString().length)>0)return;const Bt=Qe.clientY-gn.current.y,jn=Qe.clientX-gn.current.x;!J&&(Math.abs(jn)>1||Math.abs(Bt)>1)&&Z(Math.abs(jn)>Math.abs(Bt)?"x":"y");let Hr={x:0,y:0};const ti=cr=>1/(1.5+Math.abs(cr)/20);if(J==="y"){if(tr.includes("top")||tr.includes("bottom"))if(tr.includes("top")&&Bt<0||tr.includes("bottom")&&Bt>0)Hr.y=Bt;else{const cr=Bt*ti(Bt);Hr.y=Math.abs(cr)<Math.abs(Bt)?cr:Bt}}else if(J==="x"&&(tr.includes("left")||tr.includes("right")))if(tr.includes("left")&&jn<0||tr.includes("right")&&jn>0)Hr.x=jn;else{const cr=jn*ti(jn);Hr.x=Math.abs(cr)<Math.abs(jn)?cr:jn}(Math.abs(Hr.x)>0||Math.abs(Hr.y)>0)&&Ee(!0),(Vt=Ke.current)==null||Vt.style.setProperty("--swipe-amount-x",`${Hr.x}px`),(Wn=Ke.current)==null||Wn.style.setProperty("--swipe-amount-y",`${Hr.y}px`)}},Le&&!h.jsx&&Ye!=="loading"?we.createElement("button",{"aria-label":U,"data-disabled":ei,"data-close-button":!0,onClick:ei||!Ge?()=>{}:()=>{Dn(),h.onDismiss==null||h.onDismiss.call(h,h)},className:Ii(H==null?void 0:H.closeButton,h==null||(r=h.classNames)==null?void 0:r.closeButton)},(ls=Y==null?void 0:Y.close)!=null?ls:yG):null,(Ye||h.icon||h.promise)&&h.icon!==null&&((Y==null?void 0:Y[Ye])!==null||h.icon)?we.createElement("div",{"data-icon":"",className:Ii(H==null?void 0:H.icon,h==null||(s=h.classNames)==null?void 0:s.icon)},Ye==="loading"?h.icon||Os():h.promise?Os():null,Ye!=="loading"?fl:null):null,we.createElement("div",{"data-content":"",className:Ii(H==null?void 0:H.content,h==null||(i=h.classNames)==null?void 0:i.content)},we.createElement("div",{"data-title":"",className:Ii(H==null?void 0:H.title,h==null||(o=h.classNames)==null?void 0:o.title)},h.jsx?h.jsx:typeof h.title=="function"?h.title():h.title),h.description?we.createElement("div",{"data-description":"",className:Ii(D,as,H==null?void 0:H.description,h==null||(l=h.classNames)==null?void 0:l.description)},typeof h.description=="function"?h.description():h.description):null),we.isValidElement(h.cancel)?h.cancel:h.cancel&&j0(h.cancel)?we.createElement("button",{"data-button":!0,"data-cancel":!0,style:h.cancelButtonStyle||R,onClick:Qe=>{j0(h.cancel)&&Ge&&(h.cancel.onClick==null||h.cancel.onClick.call(h.cancel,Qe),Dn())},className:Ii(H==null?void 0:H.cancelButton,h==null||(u=h.classNames)==null?void 0:u.cancelButton)},h.cancel.label):null,we.isValidElement(h.action)?h.action:h.action&&j0(h.action)?we.createElement("button",{"data-button":!0,"data-action":!0,style:h.actionButtonStyle||O,onClick:Qe=>{j0(h.action)&&(h.action.onClick==null||h.action.onClick.call(h.action,Qe),!Qe.defaultPrevented&&Dn())},className:Ii(H==null?void 0:H.actionButton,h==null||(d=h.classNames)==null?void 0:d.actionButton)},h.action.label):null)};function zC(){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 jG(t,e){const n={};return[t,e].forEach((r,s)=>{const i=s===1,o=i?"--mobile-offset":"--offset",l=i?RG:TG;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 $G=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:h,theme:g="light",richColors:v,duration:w,style:_,visibleToasts:x=AG,toastOptions:S,dir:k=zC(),gap:C=IG,icons:A,customAriaLabel:T,containerAriaLabel:I="Notifications"}=e,[M,R]=we.useState([]),O=we.useMemo(()=>r?M.filter(ne=>ne.toasterId===r):M.filter(ne=>!ne.toasterId),[M,r]),N=we.useMemo(()=>Array.from(new Set([i].concat(O.filter(ne=>ne.position).map(ne=>ne.position)))),[O,i]),[D,F]=we.useState([]),[K,B]=we.useState(!1),[G,H]=we.useState(!1),[Y,U]=we.useState(g!=="system"?g:typeof window<"u"&&window.matchMedia&&window.matchMedia("(prefers-color-scheme: dark)").matches?"dark":"light"),J=we.useRef(null),Z=o.join("+").replace(/Key/g,"").replace(/Digit/g,""),j=we.useRef(null),Q=we.useRef(!1),oe=we.useCallback(ne=>{R(se=>{var de;return(de=se.find(ve=>ve.id===ne.id))!=null&&de.delete||Gr.dismiss(ne.id),se.filter(({id:ve})=>ve!==ne.id)})},[]);return we.useEffect(()=>Gr.subscribe(ne=>{if(ne.dismiss){requestAnimationFrame(()=>{R(se=>se.map(de=>de.id===ne.id?{...de,delete:!0}:de))});return}setTimeout(()=>{cG.flushSync(()=>{R(se=>{const de=se.findIndex(ve=>ve.id===ne.id);return de!==-1?[...se.slice(0,de),{...se[de],...ne},...se.slice(de+1)]:[ne,...se]})})})}),[]),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 ne=window.matchMedia("(prefers-color-scheme: dark)");try{ne.addEventListener("change",({matches:se})=>{U(se?"dark":"light")})}catch{ne.addListener(({matches:de})=>{try{U(de?"dark":"light")}catch(ve){console.error(ve)}})}},[g]),we.useEffect(()=>{M.length<=1&&B(!1)},[M]),we.useEffect(()=>{const ne=se=>{var de;if(o.length>0&&o.every(ae=>se[ae]||se.code===ae)){var ue;B(!0),(ue=J.current)==null||ue.focus()}se.code==="Escape"&&(document.activeElement===J.current||(de=J.current)!=null&&de.contains(document.activeElement))&&B(!1)};return document.addEventListener("keydown",ne),()=>document.removeEventListener("keydown",ne)},[o]),we.useEffect(()=>{if(J.current)return()=>{j.current&&(j.current.focus({preventScroll:!0}),j.current=null,Q.current=!1)}},[J.current]),we.createElement("section",{ref:n,"aria-label":T??`${I} ${Z}`,tabIndex:-1,"aria-live":"polite","aria-relevant":"additions text","aria-atomic":"false",suppressHydrationWarning:!0,"data-react-aria-top-layer":!0},N.map((ne,se)=>{var de;const[ve,ue]=ne.split("-");return O.length?we.createElement("ol",{key:ne,dir:k==="auto"?zC():k,tabIndex:-1,ref:J,className:d,"data-sonner-toaster":!0,"data-sonner-theme":Y,"data-y-position":ve,"data-x-position":ue,style:{"--front-toast-height":`${((de=D[0])==null?void 0:de.height)||0}px`,"--width":`${MG}px`,"--gap":`${C}px`,..._,...jG(f,h)},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"||H(!0)},onPointerUp:()=>H(!1)},O.filter(ae=>!ae.position&&se===0||ae.position===ne).map((ae,Oe)=>{var We,Ee;return we.createElement(DG,{key:ae.id,icons:A,index:Oe,toast:ae,defaultRichColors:v,duration:(We=S==null?void 0:S.duration)!=null?We: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:ne,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:F,expandByDefault:l,gap:C,expanded:K,swipeDirections:e.swipeDirections})})):null}))}),FG=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"}))]]),VG=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"}))]]),HG=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"}))]]),zG=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"}))]]),UG=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"}))]]),BG=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"}))]]),ZG=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"}))]]),WG=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"}))]]),qG=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"}))]]),GG=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"}))]]),KG=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"}))]]),YG=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"}))]]),XG=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"}))]]),QG=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"}))]]),JG=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"}))]]),eK=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"}))]]),tK=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"}))]]),nK=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"}))]]),rK=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"}))]]),sK=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"}))]]),iK=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"}))]]),oK=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"}))]]),aK=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"}))]]),lK=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"}))]]),cK=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"}))]]),uK=m.createContext({color:"currentColor",size:"1em",weight:"regular",mirrored:!1}),rn=m.forwardRef((t,e)=>{const{alt:n,color:r,size:s,weight:i,mirrored:o,children:l,weights:u,...d}=t,{color:f="currentColor",size:h,weight:g="regular",mirrored:v=!1,...w}=m.useContext(uK);return m.createElement("svg",{ref:e,xmlns:"http://www.w3.org/2000/svg",width:s??h,height:s??h,fill:r??f,viewBox:"0 0 256 256",transform:o||v?"scale(-1, 1)":void 0,...w,...d},!!n&&m.createElement("title",null,n),l,u.get(i??g))});rn.displayName="IconBase";const DM=m.forwardRef((t,e)=>m.createElement(rn,{ref:e,...t,weights:FG}));DM.displayName="ArrowLeftIcon";const dK=DM,jM=m.forwardRef((t,e)=>m.createElement(rn,{ref:e,...t,weights:VG}));jM.displayName="ArrowSquareOutIcon";const fK=jM,$M=m.forwardRef((t,e)=>m.createElement(rn,{ref:e,...t,weights:HG}));$M.displayName="ArrowUpIcon";const hK=$M,FM=m.forwardRef((t,e)=>m.createElement(rn,{ref:e,...t,weights:zG}));FM.displayName="CaretDownIcon";const pK=FM,VM=m.forwardRef((t,e)=>m.createElement(rn,{ref:e,...t,weights:UG}));VM.displayName="CaretRightIcon";const mK=VM,HM=m.forwardRef((t,e)=>m.createElement(rn,{ref:e,...t,weights:BG}));HM.displayName="ChatCircleIcon";const gK=HM,zM=m.forwardRef((t,e)=>m.createElement(rn,{ref:e,...t,weights:ZG}));zM.displayName="CheckIcon";const vK=zM,UM=m.forwardRef((t,e)=>m.createElement(rn,{ref:e,...t,weights:WG}));UM.displayName="CircleNotchIcon";const ev=UM,BM=m.forwardRef((t,e)=>m.createElement(rn,{ref:e,...t,weights:qG}));BM.displayName="CopyIcon";const Ah=BM,ZM=m.forwardRef((t,e)=>m.createElement(rn,{ref:e,...t,weights:GG}));ZM.displayName="DotsThreeIcon";const yK=ZM,WM=m.forwardRef((t,e)=>m.createElement(rn,{ref:e,...t,weights:KG}));WM.displayName="FolderOpenIcon";const _K=WM,qM=m.forwardRef((t,e)=>m.createElement(rn,{ref:e,...t,weights:YG}));qM.displayName="FolderSimpleIcon";const wK=qM,GM=m.forwardRef((t,e)=>m.createElement(rn,{ref:e,...t,weights:XG}));GM.displayName="MagnifyingGlassIcon";const xK=GM,KM=m.forwardRef((t,e)=>m.createElement(rn,{ref:e,...t,weights:QG}));KM.displayName="PencilSimpleIcon";const YM=KM,XM=m.forwardRef((t,e)=>m.createElement(rn,{ref:e,...t,weights:JG}));XM.displayName="PushPinIcon";const Pw=XM,QM=m.forwardRef((t,e)=>m.createElement(rn,{ref:e,...t,weights:eK}));QM.displayName="SidebarSimpleIcon";const bK=QM,JM=m.forwardRef((t,e)=>m.createElement(rn,{ref:e,...t,weights:tK}));JM.displayName="SignInIcon";const SK=JM,eI=m.forwardRef((t,e)=>m.createElement(rn,{ref:e,...t,weights:nK}));eI.displayName="SignOutIcon";const kK=eI,tI=m.forwardRef((t,e)=>m.createElement(rn,{ref:e,...t,weights:rK}));tI.displayName="SparkleIcon";const g_=tI,nI=m.forwardRef((t,e)=>m.createElement(rn,{ref:e,...t,weights:sK}));nI.displayName="SquaresFourIcon";const EK=nI,rI=m.forwardRef((t,e)=>m.createElement(rn,{ref:e,...t,weights:iK}));rI.displayName="SwatchesIcon";const sI=rI,iI=m.forwardRef((t,e)=>m.createElement(rn,{ref:e,...t,weights:oK}));iI.displayName="TrashIcon";const oI=iI,aI=m.forwardRef((t,e)=>m.createElement(rn,{ref:e,...t,weights:aK}));aI.displayName="UserIcon";const CK=aI,lI=m.forwardRef((t,e)=>m.createElement(rn,{ref:e,...t,weights:lK}));lI.displayName="XIcon";const Ob=lI,cI=m.forwardRef((t,e)=>m.createElement(rn,{ref:e,...t,weights:cK}));cI.displayName="XLogoIcon";const PK=cI,AK="/assets/arena-Db0j1set.png",TK="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 uI(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=uI(t[e]))&&(r&&(r+=" "),r+=n)}else for(n in t)t[n]&&(r&&(r+=" "),r+=n);return r}function dI(){for(var t,e,n=0,r="",s=arguments.length;n<s;n++)(t=arguments[n])&&(e=uI(t))&&(r&&(r+=" "),r+=e);return r}const RK=(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},MK=(t,e)=>({classGroupId:t,validator:e}),fI=(t=new Map,e=null,n)=>({nextPart:t,validators:e,classGroupId:n}),xg="-",UC=[],IK="arbitrary..",OK=t=>{const e=NK(t),{conflictingClassGroups:n,conflictingClassGroupModifiers:r}=t;return{getClassGroupId:o=>{if(o.startsWith("[")&&o.endsWith("]"))return LK(o);const l=o.split(xg),u=l[0]===""&&l.length>1?1:0;return hI(l,u,e)},getConflictingClassGroupIds:(o,l)=>{if(l){const u=r[o],d=n[o];return u?d?RK(d,u):u:d||UC}return n[o]||UC}}},hI=(t,e,n)=>{if(t.length-e===0)return n.classGroupId;const s=t[e],i=n.nextPart.get(s);if(i){const d=hI(t,e+1,i);if(d)return d}const o=n.validators;if(o===null)return;const l=e===0?t.join(xg):t.slice(e).join(xg),u=o.length;for(let d=0;d<u;d++){const f=o[d];if(f.validator(l))return f.classGroupId}},LK=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?IK+r:void 0})(),NK=t=>{const{theme:e,classGroups:n}=t;return DK(n,e)},DK=(t,e)=>{const n=fI();for(const r in t){const s=t[r];Lb(s,n,r,e)}return n},Lb=(t,e,n,r)=>{const s=t.length;for(let i=0;i<s;i++){const o=t[i];jK(o,e,n,r)}},jK=(t,e,n,r)=>{if(typeof t=="string"){$K(t,e,n);return}if(typeof t=="function"){FK(t,e,n,r);return}VK(t,e,n,r)},$K=(t,e,n)=>{const r=t===""?e:pI(e,t);r.classGroupId=n},FK=(t,e,n,r)=>{if(HK(t)){Lb(t(r),e,n,r);return}e.validators===null&&(e.validators=[]),e.validators.push(MK(n,t))},VK=(t,e,n,r)=>{const s=Object.entries(t),i=s.length;for(let o=0;o<i;o++){const[l,u]=s[o];Lb(u,pI(e,l),n,r)}},pI=(t,e)=>{let n=t;const r=e.split(xg),s=r.length;for(let i=0;i<s;i++){const o=r[i];let l=n.nextPart.get(o);l||(l=fI(),n.nextPart.set(o,l)),n=l}return n},HK=t=>"isThemeGetter"in t&&t.isThemeGetter===!0,zK=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)}}},Aw="!",BC=":",UK=[],ZC=(t,e,n,r,s)=>({modifiers:t,hasImportantModifier:e,baseClassName:n,maybePostfixModifierPosition:r,isExternal:s}),BK=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===BC){i.push(s.slice(u,_)),u=_+1;continue}if(x==="/"){d=_;continue}}x==="["?o++:x==="]"?o--:x==="("?l++:x===")"&&l--}const h=i.length===0?s:s.slice(u);let g=h,v=!1;h.endsWith(Aw)?(g=h.slice(0,-1),v=!0):h.startsWith(Aw)&&(g=h.slice(1),v=!0);const w=d&&d>u?d-u:void 0;return ZC(i,v,g,w)};if(e){const s=e+BC,i=r;r=o=>o.startsWith(s)?i(o.slice(s.length)):ZC(UK,!1,o,void 0,!0)}if(n){const s=r;r=i=>n({className:i,parseClassName:s})}return r},ZK=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}},WK=t=>({cache:zK(t.cacheSize),parseClassName:BK(t),sortModifiers:ZK(t),postfixLookupClassGroupIds:qK(t),...OK(t)}),qK=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},GK=/\s+/,KK=(t,e)=>{const{parseClassName:n,getClassGroupId:r,getConflictingClassGroupIds:s,sortModifiers:i,postfixLookupClassGroupIds:o}=e,l=[],u=t.trim().split(GK);let d="";for(let f=u.length-1;f>=0;f-=1){const h=u[f],{isExternal:g,modifiers:v,hasImportantModifier:w,baseClassName:_,maybePostfixModifierPosition:x}=n(h);if(g){d=h+(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=h+(d.length>0?" "+d:d);continue}if(k=r(_),!k){d=h+(d.length>0?" "+d:d);continue}S=!1}const C=v.length===0?"":v.length===1?v[0]:i(v).join(":"),A=w?C+Aw:C,T=A+k;if(l.indexOf(T)>-1)continue;l.push(T);const I=s(k,S);for(let M=0;M<I.length;++M){const R=I[M];l.push(A+R)}d=h+(d.length>0?" "+d:d)}return d},YK=(...t)=>{let e=0,n,r,s="";for(;e<t.length;)(n=t[e++])&&(r=mI(n))&&(s&&(s+=" "),s+=r);return s},mI=t=>{if(typeof t=="string")return t;let e,n="";for(let r=0;r<t.length;r++)t[r]&&(e=mI(t[r]))&&(n&&(n+=" "),n+=e);return n},XK=(t,...e)=>{let n,r,s,i;const o=u=>{const d=e.reduce((f,h)=>h(f),t());return n=WK(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=KK(u,n);return s(u,f),f};return i=o,(...u)=>i(YK(...u))},QK=[],Kn=t=>{const e=n=>n[t]||QK;return e.isThemeGetter=!0,e.themeKey=t,e},gI=/^\[(?:(\w[\w-]*):)?(.+)\]$/i,vI=/^\((?:(\w[\w-]*):)?(.+)\)$/i,JK=/^\d+(?:\.\d+)?\/\d+(?:\.\d+)?$/,eY=/^(\d+(\.\d+)?)?(xs|sm|md|lg|xl)$/,tY=/\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$/,nY=/^(rgba?|hsla?|hwb|(ok)?(lab|lch)|color-mix|color|light-dark)\(.+\)$/,rY=/^(inset_)?-?((\d+)?\.?(\d+)[a-z]+|0)_-?((\d+)?\.?(\d+)[a-z]+|0)/,sY=/^(url|image|image-set|cross-fade|element|(repeating-)?(linear|radial|conic)-gradient)\(.+\)$/,ka=t=>JK.test(t),mt=t=>!!t&&!Number.isNaN(Number(t)),Oi=t=>!!t&&Number.isInteger(Number(t)),v_=t=>t.endsWith("%")&&mt(t.slice(0,-1)),bo=t=>eY.test(t),yI=()=>!0,iY=t=>tY.test(t)&&!nY.test(t),Nb=()=>!1,oY=t=>rY.test(t),aY=t=>sY.test(t),lY=t=>!Ie(t)&&!De(t),cY=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)),uY=t=>ol(t,xI,Nb),Ie=t=>gI.test(t),Ll=t=>ol(t,bI,iY),WC=t=>ol(t,yY,mt),dY=t=>ol(t,kI,yI),fY=t=>ol(t,SI,Nb),qC=t=>ol(t,_I,Nb),hY=t=>ol(t,wI,aY),$0=t=>ol(t,EI,oY),De=t=>vI.test(t),Af=t=>Ec(t,bI),pY=t=>Ec(t,SI),GC=t=>Ec(t,_I),mY=t=>Ec(t,xI),gY=t=>Ec(t,wI),F0=t=>Ec(t,EI,!0),vY=t=>Ec(t,kI,!0),ol=(t,e,n)=>{const r=gI.exec(t);return r?r[1]?e(r[1]):n(r[2]):!1},Ec=(t,e,n=!1)=>{const r=vI.exec(t);return r?r[1]?e(r[1]):n:!1},_I=t=>t==="position"||t==="percentage",wI=t=>t==="image"||t==="url",xI=t=>t==="length"||t==="size"||t==="bg-size",bI=t=>t==="length",yY=t=>t==="number",SI=t=>t==="family-name",kI=t=>t==="number"||t==="weight",EI=t=>t==="shadow",_Y=()=>{const t=Kn("color"),e=Kn("font"),n=Kn("text"),r=Kn("font-weight"),s=Kn("tracking"),i=Kn("leading"),o=Kn("breakpoint"),l=Kn("container"),u=Kn("spacing"),d=Kn("radius"),f=Kn("shadow"),h=Kn("inset-shadow"),g=Kn("text-shadow"),v=Kn("drop-shadow"),w=Kn("blur"),_=Kn("perspective"),x=Kn("aspect"),S=Kn("ease"),k=Kn("animate"),C=()=>["auto","avoid","all","avoid-page","page","left","right","column"],A=()=>["center","top","bottom","left","right","top-left","left-top","top-right","right-top","bottom-right","right-bottom","bottom-left","left-bottom"],T=()=>[...A(),De,Ie],I=()=>["auto","hidden","clip","visible","scroll"],M=()=>["auto","contain","none"],R=()=>[De,Ie,u],O=()=>[ka,"full","auto",...R()],N=()=>[Oi,"none","subgrid",De,Ie],D=()=>["auto",{span:["full",Oi,De,Ie]},Oi,De,Ie],F=()=>[Oi,"auto",De,Ie],K=()=>["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"],H=()=>["auto",...R()],Y=()=>[ka,"auto","full","dvw","dvh","lvw","lvh","svw","svh","min","max","fit",...R()],U=()=>[l,ka,"screen","full","dvw","lvw","svw","min","max","fit",...R()],J=()=>[ka,"screen","full","lh","dvh","lvh","svh","min","max","fit",...R()],Z=()=>[t,De,Ie],j=()=>[...A(),GC,qC,{position:[De,Ie]}],Q=()=>["no-repeat",{repeat:["","x","y","space","round"]}],oe=()=>["auto","cover","contain",mY,uY,{size:[De,Ie]}],ne=()=>[v_,Af,Ll],se=()=>["","none","full",d,De,Ie],de=()=>["",mt,Af,Ll],ve=()=>["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,v_,GC,qC],Oe=()=>["","none",w,De,Ie],We=()=>["none",mt,De,Ie],Ee=()=>["none",mt,De,Ie],pt=()=>[mt,De,Ie],Ot=()=>[ka,"full",...R()];return{cacheSize:500,theme:{animate:["spin","ping","pulse","bounce"],aspect:["video"],blur:[bo],breakpoint:[bo],color:[yI],container:[bo],"drop-shadow":[bo],ease:["in","out","in-out"],font:[lY],"font-weight":["thin","extralight","light","normal","medium","semibold","bold","extrabold","black"],"inset-shadow":[bo],leading:["none","tight","snug","normal","relaxed","loose"],perspective:["dramatic","near","normal","midrange","distant","none"],radius:[bo],shadow:[bo],spacing:["px",mt],text:[bo],"text-shadow":[bo],tracking:["tighter","tight","normal","wide","wider","widest"]},classGroups:{aspect:[{aspect:["auto","square",ka,Ie,De,x]}],container:["container"],"container-type":[{"@container":["","normal","size",De,Ie]}],"container-named":[cY],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:T()}],overflow:[{overflow:I()}],"overflow-x":[{"overflow-x":I()}],"overflow-y":[{"overflow-y":I()}],overscroll:[{overscroll:M()}],"overscroll-x":[{"overscroll-x":M()}],"overscroll-y":[{"overscroll-y":M()}],position:["static","fixed","absolute","relative","sticky"],inset:[{inset:O()}],"inset-x":[{"inset-x":O()}],"inset-y":[{"inset-y":O()}],start:[{"inset-s":O(),start:O()}],end:[{"inset-e":O(),end:O()}],"inset-bs":[{"inset-bs":O()}],"inset-be":[{"inset-be":O()}],top:[{top:O()}],right:[{right:O()}],bottom:[{bottom:O()}],left:[{left:O()}],visibility:["visible","invisible","collapse"],z:[{z:[Oi,"auto",De,Ie]}],basis:[{basis:[ka,"full","auto",l,...R()]}],"flex-direction":[{flex:["row","row-reverse","col","col-reverse"]}],"flex-wrap":[{flex:["nowrap","wrap","wrap-reverse"]}],flex:[{flex:[mt,ka,"auto","initial","none",Ie]}],grow:[{grow:["",mt,De,Ie]}],shrink:[{shrink:["",mt,De,Ie]}],order:[{order:[Oi,"first","last","none",De,Ie]}],"grid-cols":[{"grid-cols":N()}],"col-start-end":[{col:D()}],"col-start":[{"col-start":F()}],"col-end":[{"col-end":F()}],"grid-rows":[{"grid-rows":N()}],"row-start-end":[{row:D()}],"row-start":[{"row-start":F()}],"row-end":[{"row-end":F()}],"grid-flow":[{"grid-flow":["row","col","dense","row-dense","col-dense"]}],"auto-cols":[{"auto-cols":K()}],"auto-rows":[{"auto-rows":K()}],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:H()}],mx:[{mx:H()}],my:[{my:H()}],ms:[{ms:H()}],me:[{me:H()}],mbs:[{mbs:H()}],mbe:[{mbe:H()}],mt:[{mt:H()}],mr:[{mr:H()}],mb:[{mb:H()}],ml:[{ml:H()}],"space-x":[{"space-x":R()}],"space-x-reverse":["space-x-reverse"],"space-y":[{"space-y":R()}],"space-y-reverse":["space-y-reverse"],size:[{size:Y()}],"inline-size":[{inline:["auto",...U()]}],"min-inline-size":[{"min-inline":["auto",...U()]}],"max-inline-size":[{"max-inline":["none",...U()]}],"block-size":[{block:["auto",...J()]}],"min-block-size":[{"min-block":["auto",...J()]}],"max-block-size":[{"max-block":["none",...J()]}],w:[{w:[l,"screen",...Y()]}],"min-w":[{"min-w":[l,"screen","none",...Y()]}],"max-w":[{"max-w":[l,"screen","none","prose",{screen:[o]},...Y()]}],h:[{h:["screen","lh",...Y()]}],"min-h":[{"min-h":["screen","lh","none",...Y()]}],"max-h":[{"max-h":["screen","lh","none",...Y()]}],"font-size":[{text:["base",n,Af,Ll]}],"font-smoothing":["antialiased","subpixel-antialiased"],"font-style":["italic","not-italic"],"font-weight":[{font:[r,vY,dY]}],"font-stretch":[{"font-stretch":["ultra-condensed","extra-condensed","condensed","semi-condensed","normal","semi-expanded","expanded","extra-expanded","ultra-expanded",v_,Ie]}],"font-family":[{font:[pY,fY,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,WC]}],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:[...ve(),"wavy"]}],"text-decoration-thickness":[{decoration:[mt,"from-font","auto",De,Ll]}],"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:[Oi,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"]},Oi,De,Ie],radial:["",De,Ie],conic:["",Oi,De,Ie]},gY,hY]}],"bg-color":[{bg:Z()}],"gradient-from-pos":[{from:ne()}],"gradient-via-pos":[{via:ne()}],"gradient-to-pos":[{to:ne()}],"gradient-from":[{from:Z()}],"gradient-via":[{via:Z()}],"gradient-to":[{to:Z()}],rounded:[{rounded:se()}],"rounded-s":[{"rounded-s":se()}],"rounded-e":[{"rounded-e":se()}],"rounded-t":[{"rounded-t":se()}],"rounded-r":[{"rounded-r":se()}],"rounded-b":[{"rounded-b":se()}],"rounded-l":[{"rounded-l":se()}],"rounded-ss":[{"rounded-ss":se()}],"rounded-se":[{"rounded-se":se()}],"rounded-ee":[{"rounded-ee":se()}],"rounded-es":[{"rounded-es":se()}],"rounded-tl":[{"rounded-tl":se()}],"rounded-tr":[{"rounded-tr":se()}],"rounded-br":[{"rounded-br":se()}],"rounded-bl":[{"rounded-bl":se()}],"border-w":[{border:de()}],"border-w-x":[{"border-x":de()}],"border-w-y":[{"border-y":de()}],"border-w-s":[{"border-s":de()}],"border-w-e":[{"border-e":de()}],"border-w-bs":[{"border-bs":de()}],"border-w-be":[{"border-be":de()}],"border-w-t":[{"border-t":de()}],"border-w-r":[{"border-r":de()}],"border-w-b":[{"border-b":de()}],"border-w-l":[{"border-l":de()}],"divide-x":[{"divide-x":de()}],"divide-x-reverse":["divide-x-reverse"],"divide-y":[{"divide-y":de()}],"divide-y-reverse":["divide-y-reverse"],"border-style":[{border:[...ve(),"hidden","none"]}],"divide-style":[{divide:[...ve(),"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:[...ve(),"none","hidden"]}],"outline-offset":[{"outline-offset":[mt,De,Ie]}],"outline-w":[{outline:["",mt,Af,Ll]}],"outline-color":[{outline:Z()}],shadow:[{shadow:["","inner","none",f,F0,$0]}],"shadow-color":[{shadow:Z()}],"inset-shadow":[{"inset-shadow":["none",h,F0,$0]}],"inset-shadow-color":[{"inset-shadow":Z()}],"ring-w":[{ring:de()}],"ring-w-inset":["ring-inset"],"ring-color":[{ring:Z()}],"ring-offset-w":[{"ring-offset":[mt,Ll]}],"ring-offset-color":[{"ring-offset":Z()}],"inset-ring-w":[{"inset-ring":de()}],"inset-ring-color":[{"inset-ring":Z()}],"text-shadow":[{"text-shadow":["none",g,F0,$0]}],"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":A()}],"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,F0,$0]}],"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":T()}],rotate:[{rotate:We()}],"rotate-x":[{"rotate-x":We()}],"rotate-y":[{"rotate-y":We()}],"rotate-z":[{"rotate-z":We()}],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:T()}],"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:[Oi,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,Af,Ll,WC]}],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"]}},wY=XK(_Y);function Ut(...t){return wY(dI(t))}const nh=({provider:t,className:e})=>{if(t==="x")return b.jsx(PK,{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"?TK:AK;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"}})},xY=Tn({hash:Xe().regex(/^[a-f0-9]{64}$/),mimeType:Zg(["image/png","image/jpeg","image/webp","image/gif","image/avif"])}),bY=Tn({id:Xe().min(1),title:Xe().trim().min(1),url:Xe().url().refine(t=>{try{const e=new URL(t);return["http:","https:"].includes(e.protocol)&&!e.username&&!e.password}catch{return!1}}).optional(),reason:Xe().optional(),image:xY.optional().catch(void 0)}).refine(t=>!!(t.url||t.image),{message:"A reference requires a public URL or an image"}),SY=(...t)=>{const e=[],n=new Set,r=new Set;for(const s of t.flatMap(i=>i??[])){const i=bY.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},kY=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},EY=({reference:t,imageUrl:e,onOpen:n})=>{const[r,s]=m.useState(!1),i=!!e&&!r,o=t.url?kY(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(nh,{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]})},CY=({references:t,source:e,sessionId:n,variantId:r,projectPath:s,className:i})=>{const o=Ei(),l=SY(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 h;const d=s?`?${new URLSearchParams({projectPath:s})}`:"",f=u.image&&n&&r?`/api/variants/${encodeURIComponent(n)}/${encodeURIComponent(r)}/references/${encodeURIComponent(u.id)}/image${d}`:void 0;return b.jsx(EY,{reference:u,imageUrl:f,onOpen:()=>o==null?void 0:o.capture("preview_reference_opened",{variant_source:e,reference_count:l.length})},`${u.id}:${((h=u.image)==null?void 0:h.hash)??""}:${f??""}`)})}):null},Rae=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}},Mae=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},PY=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,YC=dI,AY=(t,e)=>n=>{var r;if((e==null?void 0:e.variants)==null)return YC(t,n==null?void 0:n.class,n==null?void 0:n.className);const{variants:s,defaultVariants:i}=e,o=Object.keys(s).map(d=>{const f=n==null?void 0:n[d],h=i==null?void 0:i[d];if(f===null)return null;const g=KC(f)||KC(h);return s[d][g]}),l=n&&Object.entries(n).reduce((d,f)=>{let[h,g]=f;return g===void 0||(d[h]=g),d},{}),u=e==null||(r=e.compoundVariants)===null||r===void 0?void 0:r.reduce((d,f)=>{let{class:h,className:g,...v}=f;return Object.entries(v).every(w=>{let[_,x]=w;return Array.isArray(x)?x.includes({...i,...l}[_]):{...i,...l}[_]===x})?[...d,h,g]:d},[]);return YC(t,o,u,n==null?void 0:n.class,n==null?void 0:n.className)},CI={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"}},PI=m.createContext(null);function op(){const t=m.useContext(PI);return t?t.classes:CI.pill}function TY(t){const e=document.documentElement;e.classList.add("transitioning"),e.offsetHeight,t(),setTimeout(()=>e.classList.remove("transitioning"),200)}function RY({children:t,defaultShape:e="pill"}){const[n,r]=m.useState(e),s=m.useCallback(i=>{TY(()=>r(i))},[]);return b.jsx(PI.Provider,{value:{shape:n,setShape:s,classes:CI[n]},children:t})}const MY=AY(["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"}}),XC={default:16,compact:14},IY={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)]"},AI=m.forwardRef(({className:t,variant:e,size:n,isLoading:r=!1,leadingIcon:s,trailingIcon:i,disabled:o,children:l,type:u="button",...d},f)=>{const h=e??"secondary",g=n??"default",v=g==="icon"||g==="icon-compact",w=g==="compact"||g==="icon-compact",_=w?XC.compact:XC.default,x=op();return b.jsxs("button",{...d,ref:f,type:u,disabled:o||r,"aria-busy":r||d["aria-busy"],className:Ut(MY({variant:h,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",IY[h])}),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]})]})});AI.displayName="Button";var OY=Object.defineProperty,Pd=(t,e)=>OY(t,"name",{value:e,configurable:!0}),TI=!!(typeof window<"u"&&window.document&&window.document.createElement);function Yt(t,e,{checkForDefaultPrevented:n=!0}={}){return Pd(function(s){if(t==null||t(s),n===!1||!s||!s.defaultPrevented)return e==null?void 0:e(s)},"handleEvent")}Pd(Yt,"composeEventHandlers");function LY(t){var e;if(!TI)throw new Error("Cannot access window outside of the DOM");return((e=t==null?void 0:t.ownerDocument)==null?void 0:e.defaultView)??window}Pd(LY,"getOwnerWindow");function Tw(t){if(!TI)throw new Error("Cannot access document outside of the DOM");return(t==null?void 0:t.ownerDocument)??document}Pd(Tw,"getOwnerDocument");function RI(t,e=!1){const{activeElement:n}=Tw(t);if(!(n!=null&&n.nodeName))return null;if(MI(n)&&n.contentDocument)return RI(n.contentDocument.body,e);if(e){const r=n.getAttribute("aria-activedescendant");if(r){const s=Tw(n).getElementById(r);if(s)return s}}return n}Pd(RI,"getActiveElement");function MI(t){return t.tagName==="IFRAME"}Pd(MI,"isFrame");var NY=Object.defineProperty,Db=(t,e)=>NY(t,"name",{value:e,configurable:!0});function Rw(t,e){if(typeof t=="function")return t(e);t!=null&&(t.current=e)}Db(Rw,"setRef");function II(...t){return e=>{let n=!1;const r=t.map(s=>{const i=Rw(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():Rw(t[s],null)}}}}Db(II,"composeRefs");function Jt(...t){return m.useCallback(II(...t),t)}Db(Jt,"useComposedRefs");var DY=Object.defineProperty,Ws=(t,e)=>DY(t,"name",{value:e,configurable:!0});function jY(t,e){const n=m.createContext(e);n.displayName=t+"Context";const r=Ws(i=>{const{children:o,...l}=i,u=m.useMemo(()=>l,Object.values(l));return b.jsx(n.Provider,{value:u,children:o})},"Provider");r.displayName=t+"Provider";function s(i,o={}){const{optional:l=!1}=o,u=m.useContext(n);if(u)return u;if(e!==void 0)return e;if(!l)throw new Error(`\`${i}\` must be used within \`${t}\``)}return Ws(s,"useContext"),[r,s]}Ws(jY,"createContext");function so(t,e=[]){let n=[];function r(i,o){const l=m.createContext(o);l.displayName=i+"Context";const u=n.length;n=[...n,o];const d=Ws(h=>{var S;const{scope:g,children:v,...w}=h,_=((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(h,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(`\`${h}\` must be used within \`${i}\``)}return Ws(f,"useContext"),[d,f]}Ws(r,"createContext");const s=Ws(()=>{const i=n.map(o=>m.createContext(o));return Ws(function(l){const u=(l==null?void 0:l[t])||i;return m.useMemo(()=>({[`__scope${t}`]:{...l,[t]:u}}),[l,u])},"useScope")},"createScope");return s.scopeName=t,[r,OI(s,...e)]}Ws(so,"createContextScope");function OI(...t){const e=t[0];if(t.length===1)return e;const n=Ws(()=>{const r=t.map(s=>({useScope:s(),scopeName:s.scopeName}));return Ws(function(i){const o=r.reduce((l,{useScope:u,scopeName:d})=>{const h=u(i)[`__scope${d}`];return{...l,...h}},{});return m.useMemo(()=>({[`__scope${e.scopeName}`]:o}),[o])},"useComposedScopes")},"createScope");return n.scopeName=e.scopeName,n}Ws(OI,"composeContextScopes");var $Y=Object.defineProperty,Js=(t,e)=>$Y(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=[];Mw(s)&&typeof V0=="function"&&(s=V0(s._payload)),m.Children.forEach(s,g=>{var v;if($I(g)){l=!0;const w=g;let _="child"in w.props?w.props.child:w.props.children;Mw(_)&&typeof V0=="function"&&(_=V0(_._payload)),o=FY(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?jI(o):void 0,f=Jt(r,d);if(!o){if(s||s===0)throw new Error(l?zY(t):HY(t));return s}const h=DI(i,o.props??{});return o.type!==m.Fragment&&(h.ref=r?f:d),m.cloneElement(o,h)});return e.displayName=`${t}.Slot`,e}Js(Qa,"createSlot");var LI=Symbol.for("radix.slottable");function NI(t){const e=Js(n=>"child"in n?n.children(n.child):n.children,"Slottable");return e.displayName=`${t}.Slottable`,e.__radixId=LI,e}Js(NI,"createSlottable");var FY=Js((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 DI(t,e){const n={...e};for(const r in e){const s=t[r],i=e[r];/^on[A-Z]/.test(r)?s&&i?n[r]=(...l)=>{const u=i(...l);return s(...l),u}:s&&(n[r]=s):r==="style"?n[r]={...s,...i}:r==="className"?n[r]=[s,i].filter(Boolean).join(" "):r==="aria-describedby"&&(n[r]=VI(i,s))}return{...t,...n}}Js(DI,"mergeProps");function jI(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)}Js(jI,"getElementRef");function $I(t){return m.isValidElement(t)&&typeof t.type=="function"&&"__radixId"in t.type&&t.type.__radixId===LI}Js($I,"isSlottable");var VY=Symbol.for("react.lazy");function Mw(t){return t!=null&&typeof t=="object"&&"$$typeof"in t&&t.$$typeof===VY&&"_payload"in t&&FI(t._payload)}Js(Mw,"isLazyComponent");function FI(t){return typeof t=="object"&&t!==null&&"then"in t}Js(FI,"isPromiseLike");function VI(...t){const e=new Set;for(const n of t)if(typeof n=="string")for(const r of String(n).trim().split(/\s+/))r&&e.add(r);return e.size>0?Array.from(e).join(" "):void 0}Js(VI,"concatAriaDescribedby");var HY=Js(t=>`${t} failed to slot onto its children. Expected a single React element child or \`Slottable\`.`,"createSlotError"),zY=Js(t=>`${t} failed to slot onto its \`Slottable\`. Expected \`Slottable\` to receive a single React element child.`,"createSlottableError"),V0=Xh[" use ".trim().toString()],UY=Object.defineProperty,BY=(t,e)=>UY(t,"name",{value:e,configurable:!0}),ZY=["a","button","div","form","h2","h3","img","input","label","li","nav","ol","p","select","span","svg","ul"],En=ZY.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 HI(t,e){t&&ip.flushSync(()=>t.dispatchEvent(e))}BY(HI,"dispatchDiscreteCustomEvent");var WY=Object.defineProperty,qY=(t,e)=>WY(t,"name",{value:e,configurable:!0});function xc(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)}),[])}qY(xc,"useCallbackRef");var GY=Object.defineProperty,or=(t,e)=>GY(t,"name",{value:e,configurable:!0}),Iw="dismissableLayer.update",KY="dismissableLayer.pointerDownOutside",YY="dismissableLayer.focusOutside",QC,zI=m.createContext({layers:new Set,layersWithOutsidePointerEventsDisabled:new Set,branches:new Set,dismissableSurfaces:new Set}),jb=m.forwardRef(or(function(e,n){const{disableOutsidePointerEvents:r=!1,deferPointerDownOutside:s=!1,onEscapeKeyDown:i,onPointerDownOutside:o,onFocusOutside:l,onInteractOutside:u,onDismiss:d,...f}=e,h=m.useContext(zI),[g,v]=m.useState(null),w=(g==null?void 0:g.ownerDocument)??(globalThis==null?void 0:globalThis.document),[,_]=m.useState({}),x=Jt(n,v),S=Array.from(h.layers),[k]=[...h.layersWithOutsidePointerEventsDisabled].slice(-1),C=k?S.indexOf(k):-1,A=g?S.indexOf(g):-1,T=h.layersWithOutsidePointerEventsDisabled.size>0,I=A>=C,M=m.useRef(!1),R=BI(F=>{o==null||o(F),u==null||u(F),F.defaultPrevented||d==null||d()},{ownerDocument:w,deferPointerDownOutside:s,isDeferredPointerDownOutsideRef:M,dismissableSurfaces:h.dismissableSurfaces,shouldHandlePointerDownOutside:m.useCallback(F=>{if(!(F instanceof Node))return!1;const K=[...h.branches].some(B=>B.contains(F));return I&&!K},[h.branches,I])}),O=ZI(F=>{if(s&&M.current)return;const K=F.target;[...h.branches].some(G=>G.contains(K))||(l==null||l(F),u==null||u(F),F.defaultPrevented||d==null||d())},w),N=g?A===S.length-1:!1,D=xc(F=>{F.key==="Escape"&&(i==null||i(F),!F.defaultPrevented&&d&&(F.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&&(h.layersWithOutsidePointerEventsDisabled.size===0&&(QC=w.body.style.pointerEvents,w.body.style.pointerEvents="none"),h.layersWithOutsidePointerEventsDisabled.add(g)),h.layers.add(g),Ow(),()=>{r&&(h.layersWithOutsidePointerEventsDisabled.delete(g),h.layersWithOutsidePointerEventsDisabled.size===0&&(w.body.style.pointerEvents=QC))}},[g,w,r,h]),m.useEffect(()=>()=>{g&&(h.layers.delete(g),h.layersWithOutsidePointerEventsDisabled.delete(g),Ow())},[g,h]),m.useEffect(()=>{const F=or(()=>_({}),"handleUpdate");return document.addEventListener(Iw,F),()=>document.removeEventListener(Iw,F)},[]),b.jsx(En.div,{...f,ref:x,style:{pointerEvents:T?I?"auto":"none":void 0,...e.style},onFocusCapture:Yt(e.onFocusCapture,O.onFocusCapture),onBlurCapture:Yt(e.onBlurCapture,O.onBlurCapture),onPointerDownCapture:Yt(e.onPointerDownCapture,R.onPointerDownCapture)})},"DismissableLayer"));function UI(){const t=m.useContext(zI),[e,n]=m.useState(null);return m.useEffect(()=>{if(e)return t.dismissableSurfaces.add(e),()=>{t.dismissableSurfaces.delete(e)}},[e,t.dismissableSurfaces]),n}or(UI,"useDismissableLayerSurface");var XY=or(()=>!0,"IS_TRUE");function BI(t,e){const{ownerDocument:n=globalThis==null?void 0:globalThis.document,deferPointerDownOutside:r=!1,isDeferredPointerDownOutsideRef:s,dismissableSurfaces:i,shouldHandlePointerDownOutside:o=XY}=e,l=xc(t),u=m.useRef(!1),d=m.useRef(!1),f=m.useRef(new Map),h=m.useRef(()=>{});return m.useEffect(()=>{function g(){d.current=!1,s.current=!1,f.current.clear()}or(g,"resetOutsideInteraction");function v(){return Array.from(f.current.values()).some(Boolean)}or(v,"isOutsideInteractionIntercepted");function w(C){if(!d.current)return;const A=C.target;A instanceof Node&&[...i].some(I=>I.contains(A))||f.current.set(C.type,!0),C.type==="click"&&window.setTimeout(()=>{d.current&&h.current()},0)}or(w,"handleInteractionCapture");function _(C){d.current&&f.current.set(C.type,!1)}or(_,"handleInteractionBubble");const x=or(C=>{if(C.target&&!u.current){let A=function(){n.removeEventListener("click",h.current);const I=v();g(),I||$b(KY,l,T,{discrete:!0})};if(or(A,"handleAndDispatchPointerDownOutsideEvent"),!o(C.target)){n.removeEventListener("click",h.current),g(),u.current=!1;return}const T={originalEvent:C};d.current=!0,s.current=r&&C.button===0,f.current.clear(),!r||C.button!==0?A():(n.removeEventListener("click",h.current),h.current=A,n.addEventListener("click",h.current,{once:!0}))}else n.removeEventListener("click",h.current),g();u.current=!1},"handlePointerDown"),S=["pointerup","mousedown","mouseup","touchstart","touchend","click"];for(const 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",h.current);for(const C of S)n.removeEventListener(C,w,!0),n.removeEventListener(C,_)}},[n,l,r,s,i,o]),{onPointerDownCapture:or(()=>u.current=!0,"onPointerDownCapture")}}or(BI,"usePointerDownOutside");function ZI(t,e=globalThis==null?void 0:globalThis.document){const n=xc(t),r=m.useRef(!1);return m.useEffect(()=>{const s=or(i=>{i.target&&!r.current&&$b(YY,n,{originalEvent:i},{discrete:!1})},"handleFocus");return e.addEventListener("focusin",s),()=>e.removeEventListener("focusin",s)},[e,n]),{onFocusCapture:or(()=>r.current=!0,"onFocusCapture"),onBlurCapture:or(()=>r.current=!1,"onBlurCapture")}}or(ZI,"useFocusOutside");function Ow(){const t=new CustomEvent(Iw);document.dispatchEvent(t)}or(Ow,"dispatchUpdate");function $b(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?HI(s,i):s.dispatchEvent(i)}or($b,"handleAndDispatchCustomEvent");var Jr=globalThis!=null&&globalThis.document?m.useLayoutEffect:()=>{},QY=Object.defineProperty,JY=(t,e)=>QY(t,"name",{value:e,configurable:!0}),eX=Xh[" useId ".trim().toString()]||(()=>{}),tX=0;function Xi(t){const[e,n]=m.useState(eX());return Jr(()=>{t||n(r=>r??String(tX++))},[t]),t||(e?`radix-${e}`:"")}JY(Xi,"useId");const nX=["top","right","bottom","left"],Ja=Math.min,zo=Math.max,bg=Math.round,H0=Math.floor,Uo=t=>({x:t,y:t}),rX={left:"right",right:"left",bottom:"top",top:"bottom"};function WI(t,e,n){return zo(t,Ja(e,n))}function qo(t,e){return typeof t=="function"?t(e):t}function el(t){return t.split("-")[0]}function Ad(t){return t.split("-")[1]}function Fb(t){return t==="x"?"y":"x"}function Vb(t){return t==="y"?"height":"width"}function qi(t){const e=t[0];return e==="t"||e==="b"?"y":"x"}function Hb(t){return Fb(qi(t))}function sX(t,e,n){n===void 0&&(n=!1);const r=Ad(t),s=Hb(t),i=Vb(s);let o=s==="x"?r===(n?"end":"start")?"right":"left":r==="start"?"bottom":"top";return e.reference[i]>e.floating[i]&&(o=Sg(o)),[o,Sg(o)]}function iX(t){const e=Sg(t);return[Lw(t),e,Lw(e)]}function Lw(t){return t.includes("start")?t.replace("start","end"):t.replace("end","start")}const JC=["left","right"],e3=["right","left"],oX=["top","bottom"],aX=["bottom","top"];function lX(t,e,n){switch(t){case"top":case"bottom":return n?e?e3:JC:e?JC:e3;case"left":case"right":return e?oX:aX;default:return[]}}function cX(t,e,n,r){const s=Ad(t);let i=lX(el(t),n==="start",r);return s&&(i=i.map(o=>o+"-"+s),e&&(i=i.concat(i.map(Lw)))),i}function Sg(t){const e=el(t);return rX[e]+t.slice(e.length)}function uX(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 qI(t){return typeof t!="number"?uX(t):{top:t,right:t,bottom:t,left:t}}function kg(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 t3(t,e,n){let{reference:r,floating:s}=t;const i=qi(e),o=Hb(e),l=Vb(o),u=el(e),d=i==="y",f=r.x+r.width/2-s.width/2,h=r.y+r.height/2-s.height/2,g=r[l]/2-s[l]/2;let v;switch(u){case"top":v={x:f,y:r.y-s.height};break;case"bottom":v={x:f,y:r.y+r.height};break;case"right":v={x:r.x+r.width,y:h};break;case"left":v={x:r.x-s.width,y:h};break;default:v={x:r.x,y:r.y}}const w=Ad(e);return w&&(v[o]+=g*(w==="end"?1:-1)*(n&&d?-1:1)),v}async function dX(t,e){var n;e===void 0&&(e={});const{x:r,y:s,platform:i,rects:o,elements:l,strategy:u}=t,{boundary:d="clippingAncestors",rootBoundary:f="viewport",elementContext:h="floating",altBoundary:g=!1,padding:v=0}=qo(e,t),w=qI(v),x=l[g?h==="floating"?"reference":"floating":h],S=kg(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=h==="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)),A=await(i.isElement==null?void 0:i.isElement(C))&&await(i.getScale==null?void 0:i.getScale(C))||{x:1,y:1},T=kg(i.convertOffsetParentRelativeRectToViewportRelativeRect?await i.convertOffsetParentRelativeRectToViewportRelativeRect({elements:l,rect:k,offsetParent:C,strategy:u}):k);return{top:(S.top-T.top+w.top)/A.y,bottom:(T.bottom-S.bottom+w.bottom)/A.y,left:(S.left-T.left+w.left)/A.x,right:(T.right-S.right+w.right)/A.x}}const fX=50,hX=async(t,e,n)=>{const{placement:r="bottom",strategy:s="absolute",middleware:i=[],platform:o}=n,l=o.detectOverflow?o:{...o,detectOverflow:dX},u=await(o.isRTL==null?void 0:o.isRTL(e));let d=await o.getElementRects({reference:t,floating:e,strategy:s}),{x:f,y:h}=t3(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:A,data:T,reset:I}=await k({x:f,y:h,initialPlacement:r,placement:g,strategy:s,middlewareData:w,rects:d,platform:l,elements:{reference:t,floating:e}});f=C??f,h=A??h,w[S]={...w[S],...T},I&&v<fX&&(v++,typeof I=="object"&&(I.placement&&(g=I.placement),I.rects&&(d=I.rects===!0?await o.getElementRects({reference:t,floating:e,strategy:s}):I.rects),{x:f,y:h}=t3(d,g,u)),_=-1)}return{x:f,y:h,placement:g,strategy:s,middlewareData:w}},pX=t=>({name:"arrow",options:t,async fn(e){const{x:n,y:r,placement:s,rects:i,platform:o,elements:l,middlewareData:u}=e,{element:d,padding:f=0}=qo(t,e)||{};if(d==null)return{};const h=qI(f),g={x:n,y:r},v=Hb(s),w=Vb(v),_=await o.getDimensions(d),x=v==="y",S=x?"top":"left",k=x?"bottom":"right",C=x?"clientHeight":"clientWidth",A=i.reference[w]+i.reference[v]-g[v]-i.floating[w],T=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=A/2-T/2,O=M/2-_[w]/2-1,N=Ja(h[S],O),D=Ja(h[k],O),F=M-_[w]-D,K=M/2-_[w]/2+R,B=WI(N,K,F),G=!u.arrow&&Ad(s)!=null&&K!==B&&i.reference[w]/2-(K<N?N:D)-_[w]/2<0,H=G?K<N?K-N:K-F:0;return{[v]:g[v]+H,data:{[v]:B,centerOffset:K-B-H,...G&&{alignmentOffset:H}},reset:G}}}),mX=function(t){return t===void 0&&(t={}),{name:"flip",options:t,async fn(e){var n,r;const{placement:s,middlewareData:i,rects:o,initialPlacement:l,platform:u,elements:d}=e,{mainAxis:f=!0,crossAxis:h=!0,fallbackPlacements:g,fallbackStrategy:v="bestFit",fallbackAxisSideDirection:w="none",flipAlignment:_=!0,...x}=qo(t,e);if((n=i.arrow)!=null&&n.alignmentOffset)return{};const S=el(s),k=qi(l),C=el(l)===l,A=await(u.isRTL==null?void 0:u.isRTL(d.floating)),T=g||(C||!_?[Sg(l)]:iX(l)),I=w!=="none";!g&&I&&T.push(...cX(l,_,w,A));const M=[l,...T],R=await u.detectOverflow(e,x),O=[];let N=((r=i.flip)==null?void 0:r.overflows)||[];if(f&&O.push(R[S]),h){const B=sX(s,o,A);O.push(R[B[0]],R[B[1]])}if(N=[...N,{placement:s,overflows:O}],!O.every(B=>B<=0)){var D,F;const B=(((D=i.flip)==null?void 0:D.index)||0)+1,G=M[B];if(G&&(!(h==="alignment"?k!==qi(G):!1)||N.every(U=>qi(U.placement)===k?U.overflows[0]>0:!0)))return{data:{index:B,overflows:N},reset:{placement:G}};let H=(F=N.filter(Y=>Y.overflows[0]<=0).sort((Y,U)=>Y.overflows[1]-U.overflows[1])[0])==null?void 0:F.placement;if(!H)switch(v){case"bestFit":{var K;const Y=(K=N.filter(U=>{if(I){const J=qi(U.placement);return J===k||J==="y"}return!0}).map(U=>[U.placement,U.overflows.filter(J=>J>0).reduce((J,Z)=>J+Z,0)]).sort((U,J)=>U[1]-J[1])[0])==null?void 0:K[0];Y&&(H=Y);break}case"initialPlacement":H=l;break}if(s!==H)return{reset:{placement:H}}}return{}}}};function n3(t,e){return{top:t.top-e.height,right:t.right-e.width,bottom:t.bottom-e.height,left:t.left-e.width}}function r3(t){return nX.some(e=>t[e]>=0)}const gX=function(t){return t===void 0&&(t={}),{name:"hide",options:t,async fn(e){const{rects:n,platform:r}=e,{strategy:s="referenceHidden",...i}=qo(t,e);switch(s){case"referenceHidden":{const o=await r.detectOverflow(e,{...i,elementContext:"reference"}),l=n3(o,n.reference);return{data:{referenceHiddenOffsets:l,referenceHidden:r3(l)}}}case"escaped":{const o=await r.detectOverflow(e,{...i,altBoundary:!0}),l=n3(o,n.floating);return{data:{escapedOffsets:l,escaped:r3(l)}}}default:return{}}}}},GI=new Set(["left","top"]);async function vX(t,e){const{placement:n,platform:r,elements:s}=t,i=await(r.isRTL==null?void 0:r.isRTL(s.floating)),o=el(n),l=Ad(n),u=qi(n)==="y",d=GI.has(o)?-1:1,f=i&&u?-1:1,h=qo(e,t);let{mainAxis:g,crossAxis:v,alignmentAxis:w}=typeof h=="number"?{mainAxis:h,crossAxis:0,alignmentAxis:null}:{mainAxis:h.mainAxis||0,crossAxis:h.crossAxis||0,alignmentAxis:h.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 yX=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 vX(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}}}}},_X=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:A}=k;return{x:C,y:A}}},...d}=qo(t,e),f={x:n,y:r},h=await i.detectOverflow(e,d),g=qi(s),v=Fb(g);let w=f[v],_=f[g];const x=(k,C)=>WI(C+h[k==="y"?"top":"left"],C,C-h[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}}}}}},wX=function(t){return t===void 0&&(t={}),{options:t,fn(e){var n,r;const{x:s,y:i,placement:o,rects:l,middlewareData:u}=e,{offset:d=0,mainAxis:f=!0,crossAxis:h=!0}=qo(t,e),g={x:s,y:i},v=qi(o),w=Fb(v);let _=g[w],x=g[v];const S=qo(d,e),k=typeof S=="number"?{mainAxis:S,crossAxis:0}:{mainAxis:(n=S.mainAxis)!=null?n:0,crossAxis:(r=S.crossAxis)!=null?r:0};if(f){const T=w==="y"?"height":"width",I=l.reference[w]-l.floating[T]+k.mainAxis,M=l.reference[w]+l.reference[T]-k.mainAxis;_<I?_=I:_>M&&(_=M)}if(h){var C,A;const T=w==="y"?"width":"height",I=GI.has(el(o)),M=l.reference[v]-l.floating[T]+(I&&((C=u.offset)==null?void 0:C[v])||0)+(I?0:k.crossAxis),R=l.reference[v]+l.reference[T]+(I?0:((A=u.offset)==null?void 0:A[v])||0)-(I?k.crossAxis:0);x<M?x=M:x>R&&(x=R)}return{[w]:_,[v]:x}}}},xX=function(t){return t===void 0&&(t={}),{name:"size",options:t,async fn(e){const{placement:n,rects:r,platform:s,elements:i}=e,{apply:o=()=>{},...l}=qo(t,e),u=await s.detectOverflow(e,l),d=el(n),f=Ad(n),h=qi(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=Ja(v-u[w],x),C=Ja(g-u[_],S),A=e.middlewareData.shift,T=!A;let I=k,M=C;A!=null&&A.enabled.x&&(M=S),A!=null&&A.enabled.y&&(I=x),T&&!f&&(h?M=g-2*zo(u.left,u.right):I=v-2*zo(u.top,u.bottom)),await o({...e,availableWidth:M,availableHeight:I});const R=await s.getDimensions(i.floating);return g!==R.width||v!==R.height?{reset:{rects:!0}}:{}}}};function tv(){return typeof window<"u"}function Td(t){return KI(t)?(t.nodeName||"").toLowerCase():"#document"}function es(t){var e;return(t==null||(e=t.ownerDocument)==null?void 0:e.defaultView)||window}function Qo(t){var e;return(e=(KI(t)?t.ownerDocument:t.document)||window.document)==null?void 0:e.documentElement}function KI(t){return tv()?t instanceof Node||t instanceof es(t).Node:!1}function to(t){return tv()?t instanceof Element||t instanceof es(t).Element:!1}function al(t){return tv()?t instanceof HTMLElement||t instanceof es(t).HTMLElement:!1}function s3(t){return!tv()||typeof ShadowRoot>"u"?!1:t instanceof ShadowRoot||t instanceof es(t).ShadowRoot}function nv(t){const{overflow:e,overflowX:n,overflowY:r,display:s}=no(t);return/auto|scroll|overlay|hidden|clip/.test(e+r+n)&&s!=="inline"&&s!=="contents"}function bX(t){return/^(table|td|th)$/.test(Td(t))}function rv(t){try{if(t.matches(":popover-open"))return!0}catch{}try{return t.matches(":modal")}catch{return!1}}const SX=/transform|translate|scale|rotate|perspective|filter/,kX=/paint|layout|strict|content/,Nl=t=>!!t&&t!=="none";let y_;function zb(t){const e=to(t)?no(t):t;return Nl(e.transform)||Nl(e.translate)||Nl(e.scale)||Nl(e.rotate)||Nl(e.perspective)||!Ub()&&(Nl(e.backdropFilter)||Nl(e.filter))||SX.test(e.willChange||"")||kX.test(e.contain||"")}function EX(t){let e=bc(t);for(;al(e)&&!Th(e);){if(zb(e))return e;if(rv(e))return null;e=bc(e)}return null}function Ub(){return y_==null&&(y_=typeof CSS<"u"&&CSS.supports&&CSS.supports("-webkit-backdrop-filter","none")),y_}function Th(t){return/^(html|body|#document)$/.test(Td(t))}function no(t){return es(t).getComputedStyle(t)}function sv(t){return to(t)?{scrollLeft:t.scrollLeft,scrollTop:t.scrollTop}:{scrollLeft:t.scrollX,scrollTop:t.scrollY}}function bc(t){if(Td(t)==="html")return t;const e=t.assignedSlot||t.parentNode||s3(t)&&t.host||Qo(t);return s3(e)?e.host:e}function YI(t){const e=bc(t);return Th(e)?(t.ownerDocument||t).body:al(e)&&nv(e)?e:YI(e)}function Rh(t,e,n){var r;e===void 0&&(e=[]),n===void 0&&(n=!0);const s=YI(t),i=s===((r=t.ownerDocument)==null?void 0:r.body),o=es(s);if(i){const l=Nw(o);return e.concat(o,o.visualViewport||[],nv(s)?s:[],l&&n?Rh(l):[])}else return e.concat(s,Rh(s,[],n))}function Nw(t){return t.parent&&Object.getPrototypeOf(t.parent)?t.frameElement:null}function XI(t){const e=no(t);let n=parseFloat(e.width)||0,r=parseFloat(e.height)||0;const s=al(t),i=s?t.offsetWidth:n,o=s?t.offsetHeight:r,l=bg(n)!==i||bg(r)!==o;return l&&(n=i,r=o),{width:n,height:r,$:l}}function Bb(t){return to(t)?t:t.contextElement}function Nu(t){const e=Bb(t);if(!al(e))return Uo(1);const n=e.getBoundingClientRect(),{width:r,height:s,$:i}=XI(e);let o=(i?bg(n.width):n.width)/r,l=(i?bg(n.height):n.height)/s;return(!o||!Number.isFinite(o))&&(o=1),(!l||!Number.isFinite(l))&&(l=1),{x:o,y:l}}const CX=Uo(0);function QI(t){const e=es(t);return!Ub()||!e.visualViewport?CX:{x:e.visualViewport.offsetLeft,y:e.visualViewport.offsetTop}}function PX(t,e,n){return e===void 0&&(e=!1),!!n&&e&&n===es(t)}function Sc(t,e,n,r){e===void 0&&(e=!1),n===void 0&&(n=!1);const s=t.getBoundingClientRect(),i=Bb(t);let o=Uo(1);e&&(r?to(r)&&(o=Nu(r)):o=Nu(t));const l=PX(i,n,r)?QI(i):Uo(0);let u=(s.left+l.x)/o.x,d=(s.top+l.y)/o.y,f=s.width/o.x,h=s.height/o.y;if(i&&r){const g=es(i),v=to(r)?es(r):r;let w=g,_=Nw(w);for(;_&&v!==w;){const x=Nu(_),S=_.getBoundingClientRect(),k=no(_),C=S.left+(_.clientLeft+parseFloat(k.paddingLeft))*x.x,A=S.top+(_.clientTop+parseFloat(k.paddingTop))*x.y;u*=x.x,d*=x.y,f*=x.x,h*=x.y,u+=C,d+=A,w=es(_),_=Nw(w)}}return kg({width:f,height:h,x:u,y:d})}function iv(t,e){const n=sv(t).scrollLeft;return e?e.left+n:Sc(Qo(t)).left+n}function JI(t,e){const n=t.getBoundingClientRect(),r=n.left+e.scrollLeft-iv(t,n),s=n.top+e.scrollTop;return{x:r,y:s}}function AX(t){let{elements:e,rect:n,offsetParent:r,strategy:s}=t;const i=s==="fixed",o=Qo(r),l=e?rv(e.floating):!1;if(r===o||l&&i)return n;let u={scrollLeft:0,scrollTop:0},d=Uo(1);const f=Uo(0),h=al(r);if((h||!i)&&((Td(r)!=="body"||nv(o))&&(u=sv(r)),h)){const v=Sc(r);d=Nu(r),f.x=v.x+r.clientLeft,f.y=v.y+r.clientTop}const g=o&&!h&&!i?JI(o,u):Uo(0);return{width:n.width*d.x,height:n.height*d.y,x:n.x*d.x-u.scrollLeft*d.x+f.x+g.x,y:n.y*d.y-u.scrollTop*d.y+f.y+g.y}}function TX(t){return t.getClientRects?Array.from(t.getClientRects()):[]}function RX(t){const e=sv(t),n=t.ownerDocument.body,r=zo(t.scrollWidth,t.clientWidth,n.scrollWidth,n.clientWidth),s=zo(t.scrollHeight,t.clientHeight,n.scrollHeight,n.clientHeight);let i=-e.scrollLeft+iv(t);const o=-e.scrollTop;return no(n).direction==="rtl"&&(i+=zo(t.clientWidth,n.clientWidth)-r),{width:r,height:s,x:i,y:o}}const MX=25;function IX(t,e,n){n===void 0&&(n="viewport");const r=n==="layoutViewport",s=es(t),i=Qo(t),o=s.visualViewport;let l=i.clientWidth,u=i.clientHeight,d=0,f=0;if(o){const g=!Ub()||e==="fixed";r?g||(d=-o.offsetLeft,f=-o.offsetTop):(l=o.width,u=o.height,g&&(d=o.offsetLeft,f=o.offsetTop))}if(iv(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<=MX&&(l-=S)}return{width:l,height:u,x:d,y:f}}function OX(t,e){const n=Sc(t,!0,e==="fixed"),r=n.top+t.clientTop,s=n.left+t.clientLeft,i=Nu(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 i3(t,e,n){let r;if(e==="viewport"||e==="layoutViewport")r=IX(t,n,e);else if(e==="document")r=RX(Qo(t));else if(to(e))r=OX(e,n);else{const s=QI(t);r={x:e.x-s.x,y:e.y-s.y,width:e.width,height:e.height}}return kg(r)}function LX(t,e){const n=e.get(t);if(n)return n;let r=Rh(t,[],!1).filter(l=>to(l)&&Td(l)!=="body"),s=null;const i=no(t).position==="fixed";let o=i?bc(t):t;for(;to(o)&&!Th(o);){const l=no(o),u=zb(o),d=s?s.position:i?"fixed":"";!u&&(d==="fixed"||d==="absolute"&&l.position==="static")?r=r.filter(h=>h!==o):s=l,o=bc(o)}return e.set(t,r),r}function NX(t){let{element:e,boundary:n,rootBoundary:r,strategy:s}=t;const o=[...n==="clippingAncestors"?rv(e)?[]:LX(e,this._c):[].concat(n),r],l=i3(e,o[0],s);let u=l.top,d=l.right,f=l.bottom,h=l.left;for(let g=1;g<o.length;g++){const v=i3(e,o[g],s);u=zo(v.top,u),d=Ja(v.right,d),f=Ja(v.bottom,f),h=zo(v.left,h)}return{width:d-h,height:f-u,x:h,y:u}}function DX(t){const{width:e,height:n}=XI(t);return{width:e,height:n}}function jX(t,e,n){const r=al(e),s=Qo(e),i=n==="fixed",o=Sc(t,!0,i,e);let l={scrollLeft:0,scrollTop:0};const u=Uo(0);if((r||!i)&&((Td(e)!=="body"||nv(s))&&(l=sv(e)),r)){const g=Sc(e,!0,i,e);u.x=g.x+e.clientLeft,u.y=g.y+e.clientTop}!r&&s&&(u.x=iv(s));const d=s&&!r&&!i?JI(s,l):Uo(0),f=o.left+l.scrollLeft-u.x-d.x,h=o.top+l.scrollTop-u.y-d.y;return{x:f,y:h,width:o.width,height:o.height}}function __(t){return no(t).position==="static"}function o3(t,e){if(!al(t)||no(t).position==="fixed")return null;if(e)return e(t);let n=t.offsetParent;return Qo(t)===n&&(n=n.ownerDocument.body),n}function eO(t,e){const n=es(t);if(rv(t))return n;if(!al(t)){let s=bc(t);for(;s&&!Th(s);){if(to(s)&&!__(s))return s;s=bc(s)}return n}let r=o3(t,e);for(;r&&bX(r)&&__(r);)r=o3(r,e);return r&&Th(r)&&__(r)&&!zb(r)?n:r||EX(t)||n}const $X=async function(t){const e=this.getOffsetParent||eO,n=this.getDimensions,r=await n(t.floating);return{reference:jX(t.reference,await e(t.floating),t.strategy),floating:{x:0,y:0,width:r.width,height:r.height}}};function FX(t){return no(t).direction==="rtl"}const VX={convertOffsetParentRelativeRectToViewportRelativeRect:AX,getDocumentElement:Qo,getClippingRect:NX,getOffsetParent:eO,getElementRects:$X,getClientRects:TX,getDimensions:DX,getScale:Nu,isElement:to,isRTL:FX};function tO(t,e){return t.x===e.x&&t.y===e.y&&t.width===e.width&&t.height===e.height}function HX(t,e,n){let r=null,s;const i=Qo(t);function o(){var f;clearTimeout(s),(f=r)==null||f.disconnect(),r=null}function l(f,h){f===void 0&&(f=!1),h===void 0&&(h=1),o();const g=t.getBoundingClientRect(),{left:v,top:w,width:_,height:x}=g;if(f||e(),!_||!x)return;const S=H0(w),k=H0(i.clientWidth-(v+_)),C=H0(i.clientHeight-(w+x)),A=H0(v),I={rootMargin:-S+"px "+-k+"px "+-C+"px "+-A+"px",threshold:zo(0,Ja(1,h))||1};let M=!0;function R(O){const N=O[0].intersectionRatio;if(!tO(g,t.getBoundingClientRect()))return l();if(N!==h){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=es(t),d=()=>l(n);return u.addEventListener("resize",d),l(!0),()=>{u.removeEventListener("resize",d),o()}}function zX(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=Bb(t),f=s||i?[...d?Rh(d):[],...e?Rh(e):[]]:[];f.forEach(S=>{s&&S.addEventListener("scroll",n),i&&S.addEventListener("resize",n)});const h=d&&l?HX(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?Sc(t):null;u&&x();function x(){const S=Sc(t);_&&!tO(_,S)&&n(),_=S,w=requestAnimationFrame(x)}return n(),()=>{var S;f.forEach(k=>{s&&k.removeEventListener("scroll",n),i&&k.removeEventListener("resize",n)}),h==null||h(),(S=v)==null||S.disconnect(),v=null,u&&cancelAnimationFrame(w)}}const UX=yX,BX=_X,ZX=mX,WX=xX,qX=gX,a3=pX,GX=wX,KX=(t,e,n)=>{const r=new Map,s=n??{},i={...VX,...s.platform,_c:r};return hX(t,e,{...s,platform:i})};var YX=typeof document<"u",XX=function(){},ym=YX?m.useLayoutEffect:XX;function Eg(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(!Eg(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)&&!Eg(t[i],e[i]))return!1}return!0}return t!==t&&e!==e}function nO(t){return typeof window>"u"?1:(t.ownerDocument.defaultView||window).devicePixelRatio||1}function l3(t,e){const n=nO(t);return Math.round(e*n)/n}function w_(t){const e=m.useRef(t);return ym(()=>{e.current=t}),e}function QX(t){t===void 0&&(t={});const{placement:e="bottom",strategy:n="absolute",middleware:r=[],platform:s,elements:{reference:i,floating:o}={},transform:l=!0,whileElementsMounted:u,open:d}=t,[f,h]=m.useState({x:0,y:0,strategy:n,placement:e,middlewareData:{},isPositioned:!1}),[g,v]=m.useState(r);Eg(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))},[]),A=i||w,T=o||x,I=m.useRef(null),M=m.useRef(null),R=m.useRef(f),O=u!=null,N=w_(u),D=w_(s),F=w_(d),K=m.useCallback(()=>{if(!I.current||!M.current)return;const U={placement:e,strategy:n,middleware:g};D.current&&(U.platform=D.current),KX(I.current,M.current,U).then(J=>{const Z={...J,isPositioned:F.current!==!1};B.current&&!Eg(R.current,Z)&&(R.current=Z,ip.flushSync(()=>{h(Z)}))})},[g,e,n,D,F]);ym(()=>{d===!1&&R.current.isPositioned&&(R.current.isPositioned=!1,h(U=>({...U,isPositioned:!1})))},[d]);const B=m.useRef(!1);ym(()=>(B.current=!0,()=>{B.current=!1}),[]),ym(()=>{if(A&&(I.current=A),T&&(M.current=T),A&&T){if(N.current)return N.current(A,T,K);K()}},[A,T,K,N,O]);const G=m.useMemo(()=>({reference:I,floating:M,setReference:k,setFloating:C}),[k,C]),H=m.useMemo(()=>({reference:A,floating:T}),[A,T]),Y=m.useMemo(()=>{const U={position:n,left:0,top:0};if(!H.floating)return U;const J=l3(H.floating,f.x),Z=l3(H.floating,f.y);return l?{...U,transform:"translate("+J+"px, "+Z+"px)",...nO(H.floating)>=1.5&&{willChange:"transform"}}:{position:n,left:J,top:Z}},[n,l,H.floating,f.x,f.y]);return m.useMemo(()=>({...f,update:K,refs:G,elements:H,floatingStyles:Y}),[f,K,G,H,Y])}const JX=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?a3({element:r.current,padding:s}).fn(n):{}:r?a3({element:r,padding:s}).fn(n):{}}}},eQ=(t,e)=>{const n=UX(t);return{name:n.name,fn:n.fn,options:[t,e]}},tQ=(t,e)=>{const n=BX(t);return{name:n.name,fn:n.fn,options:[t,e]}},nQ=(t,e)=>({fn:GX(t).fn,options:[t,e]}),rQ=(t,e)=>{const n=ZX(t);return{name:n.name,fn:n.fn,options:[t,e]}},sQ=(t,e)=>{const n=WX(t);return{name:n.name,fn:n.fn,options:[t,e]}},iQ=(t,e)=>{const n=qX(t);return{name:n.name,fn:n.fn,options:[t,e]}},oQ=(t,e)=>{const n=JX(t);return{name:n.name,fn:n.fn,options:[t,e]}};var aQ=Object.defineProperty,lQ=(t,e)=>aQ(t,"name",{value:e,configurable:!0});function Zb(t){const[e,n]=m.useState(void 0);return Jr(()=>{if(t){n({width:t.offsetWidth,height:t.offsetHeight});let r=0;const s=new ResizeObserver(i=>{if(!Array.isArray(i)||!i.length)return;const o=i[0];window.cancelAnimationFrame(r),r=window.requestAnimationFrame(()=>{let l,u;if("borderBoxSize"in o){const d=o.borderBoxSize,f=Array.isArray(d)?d[0]:d;l=f.inlineSize,u=f.blockSize}else l=t.offsetWidth,u=t.offsetHeight;n({width:l,height:u})})});return s.observe(t,{box:"border-box"}),()=>{window.cancelAnimationFrame(r),s.unobserve(t)}}else n(void 0)},[t]),e}lQ(Zb,"useSize");var cQ=Object.defineProperty,Za=(t,e)=>cQ(t,"name",{value:e,configurable:!0}),c3={Partial:"partial"},u3={Optimized:"optimized",Always:"always"},rO="Popper",[sO,ov]=so(rO),[uQ,iO]=sO(rO),oO=Za(t=>{const{__scopePopper:e,children:n}=t,[r,s]=m.useState(null),[i,o]=m.useState(void 0);return b.jsx(uQ,{scope:e,anchor:r,onAnchorChange:s,placementState:i,setPlacementState:o,children:n})},"Popper"),dQ="PopperAnchor",aO=m.forwardRef(Za(function(e,n){const{__scopePopper:r,virtualRef:s,...i}=e,o=iO(dQ,r),l=m.useRef(null),u=o.onAnchorChange,d=m.useCallback(_=>{l.current=_,_&&u(_)},[u]),f=Jt(n,d),h=m.useRef(null);m.useEffect(()=>{if(!s)return;const _=h.current;h.current=s.current,_!==h.current&&u(h.current)});const g=o.placementState&&av(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")),lO="PopperContent",[fQ,Iae]=sO(lO),cO=m.forwardRef(Za(function(e,n){var ae,Oe,We,Ee,pt,Ot,en;const{__scopePopper:r,side:s="bottom",sideOffset:i=0,align:o="center",alignOffset:l=0,arrowPadding:u=0,avoidCollisions:d=!0,collisionBoundary:f=[],collisionPadding:h=0,sticky:g=c3.Partial,hideWhenDetached:v=!1,updatePositionStrategy:w=u3.Optimized,onPlaced:_,...x}=e,S=iO(lO,r),[k,C]=m.useState(null),A=Jt(n,C),[T,I]=m.useState(null),M=Zb(T),R=(M==null?void 0:M.width)??0,O=(M==null?void 0:M.height)??0,N=s+(o!=="center"?"-"+o:""),D=typeof h=="number"?h:{top:0,right:0,bottom:0,left:0,...h},F=Array.isArray(f)?f:[f],K=F.length>0,B={padding:D,boundary:F.filter(uO),altBoundary:K},{refs:G,floatingStyles:H,placement:Y,isPositioned:U,middlewareData:J}=QX({strategy:"fixed",placement:N,whileElementsMounted:Za((...bt)=>zX(...bt,{animationFrame:w===u3.Always}),"whileElementsMounted"),elements:{reference:S.anchor},middleware:[eQ({mainAxis:i+O,alignmentAxis:l}),d&&tQ({mainAxis:!0,crossAxis:!1,limiter:g===c3.Partial?nQ():void 0,...B}),d&&rQ({...B}),sQ({...B,apply:Za(({elements:bt,rects:_t,availableWidth:qe,availableHeight:Ke})=>{const{width:Ct,height:Te}=_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",`${Te}px`)},"apply")}),T&&oQ({element:T,padding:u}),hQ({arrowWidth:R,arrowHeight:O}),v&&iQ({strategy:"referenceHidden",...B,boundary:K?B.boundary:void 0})]}),Z=S.setPlacementState;Jr(()=>(Z(Y),()=>{Z(void 0)}),[Y,Z]);const[j,Q]=av(Y),oe=xc(_);Jr(()=>{U&&(oe==null||oe())},[U,oe]);const ne=(ae=J.arrow)==null?void 0:ae.x,se=(Oe=J.arrow)==null?void 0:Oe.y,de=((We=J.arrow)==null?void 0:We.centerOffset)!==0,[ve,ue]=m.useState();return Jr(()=>{k&&ue(window.getComputedStyle(k).zIndex)},[k]),b.jsx("div",{ref:G.setFloating,"data-radix-popper-content-wrapper":"",style:{...H,transform:U?H.transform:"translate(0, -200%)",minWidth:"max-content",zIndex:ve,"--radix-popper-transform-origin":[(Ee=J.transformOrigin)==null?void 0:Ee.x,(pt=J.transformOrigin)==null?void 0:pt.y].join(" "),...((Ot=J.hide)==null?void 0:Ot.referenceHidden)&&{visibility:"hidden",pointerEvents:"none"}},dir:e.dir,children:b.jsx(fQ,{scope:r,placedSide:j,placedAlign:Q,onArrowChange:I,arrowX:ne,arrowY:se,shouldHideArrow:de,children:b.jsx(En.div,{"data-side":j,"data-align":Q,...x,ref:A,style:{...x.style,animation:U?(en=x.style)==null?void 0:en.animation:"none"}})})})},"PopperContent"));function uO(t){return t!==null}Za(uO,"isNotNull");var hQ=Za(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]=av(n),h={start:"0%",center:"50%",end:"100%"}[f],g=(((S=s.arrow)==null?void 0:S.x)??0)+l/2,v=(((k=s.arrow)==null?void 0:k.y)??0)+u/2;let w="",_="";return d==="bottom"?(w=o?h:`${g}px`,_=`${-u}px`):d==="top"?(w=o?h:`${g}px`,_=`${r.floating.height+u}px`):d==="right"?(w=`${-u}px`,_=o?h:`${v}px`):d==="left"&&(w=`${r.floating.width+u}px`,_=o?h:`${v}px`),{data:{x:w,y:_}}}}),"transformOrigin");function av(t){const[e,n="center"]=t.split("-");return[e,n]}Za(av,"getSideAndAlignFromPlacement");var pQ=Object.defineProperty,mQ=(t,e)=>pQ(t,"name",{value:e,configurable:!0}),Wb=m.forwardRef(mQ(function(e,n){var u;const{container:r,...s}=e,[i,o]=m.useState(!1);Jr(()=>o(!0),[]);const l=r||i&&((u=globalThis==null?void 0:globalThis.document)==null?void 0:u.body);return l?ip.createPortal(b.jsx(En.div,{...s,ref:n}),l):null},"Portal")),gQ=Object.defineProperty,Go=(t,e)=>gQ(t,"name",{value:e,configurable:!0});function dO(t,e){return m.useReducer((n,r)=>e[n][r]??n,t)}Go(dO,"useStateMachine");var ll=Go(t=>{const{present:e,children:n}=t,r=fO(e),s=typeof n=="function"?n({present:r.isPresent}):m.Children.only(n),i=hO(r.ref,pO(s));return typeof n=="function"||r.isPresent?m.cloneElement(s,{ref:i}):null},"Presence");function fO(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]=dO(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??bu(r.current),o.current=void 0):i.current="none"},[u]),Jr(()=>{const f=r.current,h=s.current;if(h!==t){const v=i.current,w=bu(f);t?(o.current=w,d("MOUNT")):w==="none"||(f==null?void 0:f.display)==="none"?d("UNMOUNT"):d(h&&v!==w?"ANIMATION_OUT":"UNMOUNT"),s.current=t}},[t,d]),Jr(()=>{if(e){let f;const h=e.ownerDocument.defaultView??window,g=Go(w=>{const x=bu(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=h.setTimeout(()=>{e.style.animationFillMode==="forwards"&&(e.style.animationFillMode=S)})}},"handleAnimationEnd"),v=Go(w=>{w.target===e&&(i.current=bu(r.current))},"handleAnimationStart");return e.addEventListener("animationstart",v),e.addEventListener("animationcancel",g),e.addEventListener("animationend",g),()=>{h.clearTimeout(f),e.removeEventListener("animationstart",v),e.removeEventListener("animationcancel",g),e.removeEventListener("animationend",g)}}else d("ANIMATION_END")},[e,d]),{isPresent:["mounted","unmountSuspended"].includes(u),ref:m.useCallback(f=>{if(f){const h=getComputedStyle(f);r.current=h,o.current=bu(h)}else r.current=null;n(f)},[])}}Go(fO,"usePresence");function Dw(t,e){if(typeof t=="function")return t(e);t!=null&&(t.current=e)}Go(Dw,"setRef");function hO(...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=Dw(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():Dw(r[o],null)}}},[])}Go(hO,"useStableComposedRefs");function bu(t){return(t==null?void 0:t.animationName)||"none"}Go(bu,"getAnimationName");function pO(t){var r,s;let e=(r=Object.getOwnPropertyDescriptor(t.props,"ref"))==null?void 0:r.get,n=e&&"isReactWarning"in e&&e.isReactWarning;return n?t.ref:(e=(s=Object.getOwnPropertyDescriptor(t,"ref"))==null?void 0:s.get,n=e&&"isReactWarning"in e&&e.isReactWarning,n?t.props.ref:t.props.ref||t.ref)}Go(pO,"getElementRef");var vQ=Object.defineProperty,yQ=(t,e)=>vQ(t,"name",{value:e,configurable:!0}),d3=Xh[" useEffectEvent ".trim().toString()],f3=Xh[" useInsertionEffect ".trim().toString()];function mO(t){if(typeof d3=="function")return d3(t);const e=m.useRef(()=>{throw new Error("Cannot call an event handler while rendering.")});return typeof f3=="function"?f3(()=>{e.current=t}):Jr(()=>{e.current=t}),m.useMemo(()=>((...n)=>{var r;return(r=e.current)==null?void 0:r.call(e,...n)}),[])}yQ(mO,"useEffectEvent");var _Q=Object.defineProperty,ap=(t,e)=>_Q(t,"name",{value:e,configurable:!0}),wQ=Xh[" useInsertionEffect ".trim().toString()]||Jr;function cl({prop:t,defaultProp:e,onChange:n=ap(()=>{},"onChange"),caller:r}){const[s,i,o]=gO({defaultProp:e,onChange:n}),l=t!==void 0,u=l?t:s,d=m.useCallback(f=>{var h;if(l){const g=vO(f)?f(t):f;g!==t&&((h=o.current)==null||h.call(o,g))}else i(f)},[l,t,i,o]);return[u,d]}ap(cl,"useControllableState");function gO({defaultProp:t,onChange:e}){const[n,r]=m.useState(t),s=m.useRef(n),i=m.useRef(e);return wQ(()=>{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]}ap(gO,"useUncontrolledState");function vO(t){return typeof t=="function"}ap(vO,"isFunction");var h3=Symbol("RADIX:SYNC_STATE");function xQ(t,e,n,r){const{prop:s,defaultProp:i,onChange:o,caller:l}=e,u=s!==void 0,d=mO(o),f=[{...n,state:i}];r&&f.push(r);const[h,g]=m.useReducer((x,S)=>{if(S.type===h3)return{...x,state:S.state};const k=t(x,S);return u&&!Object.is(k.state,x.state)&&d(k.state),k},...f),v=h.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?{...h,state:s}:h,[h,s]);return m.useEffect(()=>{u&&!Object.is(s,h.state)&&g({type:h3,state:s})},[s,h.state,u]),[_,g]}ap(xQ,"useControllableStateReducer");var bQ=Object.defineProperty,SQ=(t,e)=>bQ(t,"name",{value:e,configurable:!0}),kQ=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"}),EQ=m.forwardRef(SQ(function(e,n){return b.jsx(En.span,{...e,ref:n,style:{...kQ,...e.style}})},"VisuallyHidden")),CQ=Object.defineProperty,Jn=(t,e)=>CQ(t,"name",{value:e,configurable:!0}),[qb,Oae]=so("Tooltip",[ov]),Gb=ov(),PQ="TooltipProvider",AQ=700,jw="tooltip.open",[TQ,Kb]=qb(PQ),RQ=Jn(t=>{const{__scopeTooltip:e,delayDuration:n=AQ,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(TQ,{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"),$w="Tooltip",[MQ,lp]=qb($w),IQ=Jn(t=>{const{__scopeTooltip:e,children:n,open:r,defaultOpen:s,onOpenChange:i,disableHoverableContent:o,delayDuration:l}=t,u=Kb($w,t.__scopeTooltip),d=Gb(e),[f,h]=m.useState(null),[g,v]=m.useState(void 0),w=Xi(),_=m.useRef(0),x=o??u.disableHoverableContent,S=l??u.delayDuration,k=m.useRef(!1),[C,A]=cl({prop:r,defaultProp:s??!1,onChange:Jn(N=>{N?(u.onOpen(),document.dispatchEvent(new CustomEvent(jw))):u.onClose(),i==null||i(N)},"onChange"),caller:$w}),T=m.useMemo(()=>C?k.current?"delayed-open":"instant-open":"closed",[C]),I=m.useCallback(()=>{window.clearTimeout(_.current),_.current=0,k.current=!1,A(!0)},[A]),M=m.useCallback(()=>{window.clearTimeout(_.current),_.current=0,A(!1)},[A]),R=m.useCallback(()=>{window.clearTimeout(_.current),_.current=window.setTimeout(()=>{k.current=!0,A(!0),_.current=0},S)},[S,A]);m.useEffect(()=>()=>{_.current&&(window.clearTimeout(_.current),_.current=0)},[]);const O=g??w;return b.jsx(oO,{...d,children:b.jsx(MQ,{scope:e,contentId:O,setContentId:v,open:C,stateAttribute:T,trigger:f,onTriggerChange:h,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"),p3="TooltipTrigger",OQ=m.forwardRef(Jn(function(e,n){const{__scopeTooltip:r,"aria-describedby":s,...i}=e,o=lp(p3,r),l=Kb(p3,r),u=Gb(r),d=m.useRef(null),f=Jt(n,d,o.onTriggerChange),h=m.useRef(!1),g=m.useRef(!1),v=m.useCallback(()=>h.current=!1,[]);return m.useEffect(()=>()=>document.removeEventListener("pointerup",v),[v]),b.jsx(aO,{asChild:!0,...u,children:b.jsx(En.button,{"aria-describedby":o.open?CO(s,o.contentId):s,"data-state":o.stateAttribute,...i,ref:f,onPointerMove:Yt(e.onPointerMove,w=>{w.pointerType!=="touch"&&!g.current&&!l.isPointerInTransitRef.current&&(o.onTriggerEnter(),g.current=!0)}),onPointerLeave:Yt(e.onPointerLeave,()=>{o.onTriggerLeave(),g.current=!1}),onPointerDown:Yt(e.onPointerDown,()=>{o.open&&o.onClose(),h.current=!0,document.addEventListener("pointerup",v,{once:!0})}),onFocus:Yt(e.onFocus,()=>{h.current||o.onOpen()}),onBlur:Yt(e.onBlur,o.onClose),onClick:Yt(e.onClick,o.onClose)})})},"TooltipTrigger")),yO="TooltipPortal",[LQ,NQ]=qb(yO,{forceMount:void 0}),DQ=Jn(t=>{const{__scopeTooltip:e,forceMount:n,children:r,container:s}=t,i=lp(yO,e);return b.jsx(LQ,{scope:e,forceMount:n,children:b.jsx(ll,{present:n||i.open,children:b.jsx(Wb,{asChild:!0,container:s,children:r})})})},"TooltipPortal"),Mh="TooltipContent",jQ=m.forwardRef(Jn(function(e,n){const r=NQ(Mh,e.__scopeTooltip),{forceMount:s=r.forceMount,side:i="top",...o}=e,l=lp(Mh,e.__scopeTooltip);return b.jsx(ll,{present:s||l.open,children:l.disableHoverableContent?b.jsx(_O,{side:i,...o,ref:n}):b.jsx($Q,{side:i,...o,ref:n})})},"TooltipContent")),$Q=m.forwardRef(Jn(function(e,n){const r=lp(Mh,e.__scopeTooltip),s=Kb(Mh,e.__scopeTooltip),i=m.useRef(null),o=Jt(n,i),[l,u]=m.useState(null),{trigger:d,onClose:f}=r,h=i.current,{onPointerInTransitChange:g}=s,v=m.useCallback(()=>{u(null),g(!1)},[g]),w=m.useCallback((_,x)=>{const S=_.currentTarget,k={x:_.clientX,y:_.clientY},C=wO(k,S.getBoundingClientRect()),A=xO(k,C),T=bO(x.getBoundingClientRect()),I=kO([...A,...T]);u(I),g(!0)},[g]);return m.useEffect(()=>()=>v(),[v]),m.useEffect(()=>{if(d&&h){const _=Jn(S=>w(S,h),"handleTriggerLeave"),x=Jn(S=>w(S,d),"handleContentLeave");return d.addEventListener("pointerleave",_),h.addEventListener("pointerleave",x),()=>{d.removeEventListener("pointerleave",_),h.removeEventListener("pointerleave",x)}}},[d,h,w,v]),m.useEffect(()=>{if(l){const _=Jn(x=>{const S=x.target,k={x:x.clientX,y:x.clientY},C=(d==null?void 0:d.contains(S))||(h==null?void 0:h.contains(S)),A=!SO(k,l);C?v():A&&(v(),f())},"handleTrackPointerGrace");return document.addEventListener("pointermove",_),()=>document.removeEventListener("pointermove",_)}},[d,h,l,f,v]),b.jsx(_O,{...e,ref:o})},"TooltipContentHoverable")),FQ=NI("TooltipContent"),_O=m.forwardRef(Jn(function(e,n){const{__scopeTooltip:r,children:s,"aria-label":i,id:o,onEscapeKeyDown:l,onPointerDownOutside:u,...d}=e,f=lp(Mh,r),h=Gb(r),{onClose:g}=f;m.useEffect(()=>(document.addEventListener(jw,g),()=>document.removeEventListener(jw,g)),[g]),m.useEffect(()=>{if(f.trigger){const w=Jn(_=>{_.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 Jr(()=>(v(o),()=>{v(void 0)}),[o,v]),b.jsx(jb,{asChild:!0,disableOutsidePointerEvents:!1,onEscapeKeyDown:l,onPointerDownOutside:u,onFocusOutside:w=>w.preventDefault(),onDismiss:g,children:b.jsxs(cO,{"data-state":f.stateAttribute,role:i?void 0:"tooltip",id:i?void 0:f.contentId,...h,...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(FQ,{children:s}),i?b.jsx(EQ,{id:f.contentId,role:"tooltip",children:i}):null]})})},"TooltipContentImpl"));function wO(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")}}Jn(wO,"getExitSideFromRect");function xO(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}Jn(xO,"getPaddedExitPoints");function bO(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}]}Jn(bO,"getPointsFromRect");function SO(t,e){const{x:n,y:r}=t;let s=!1;for(let i=0,o=e.length-1;i<e.length;o=i++){const l=e[i],u=e[o],d=l.x,f=l.y,h=u.x,g=u.y;f>r!=g>r&&n<(h-d)*(r-f)/(g-f)+d&&(s=!s)}return s}Jn(SO,"isPointInPolygon");function kO(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),EO(e)}Jn(kO,"getHull");function EO(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)}Jn(EO,"getHullPresorted");function CO(...t){const e=new Set;for(const n of t)if(typeof n=="string")for(const r of String(n).trim().split(/\s+/))r&&e.add(r);return e.size>0?Array.from(e).join(" "):void 0}Jn(CO,"concatAriaDescribedby");const rh={normal:"'wght' 400",medium:"'wght' 450",semibold:"'wght' 550"},PO=m.createContext(null);function AO({value:t,children:e}){return b.jsx(PO.Provider,{value:t,children:e})}function VQ(t){switch(t){case"top":return{y:4};case"bottom":return{y:-4};case"left":return{x:4};case"right":return{x:-4}}}function Yb({content:t,children:e,side:n="top",sideOffset:r=8,delayDuration:s=200,className:i,forceOpen:o,onOpenChange:l}){const[u,d]=m.useState(!1),f=o!==void 0?o:u,[h,g]=m.useState(!1),v=op(),w=m.useContext(PO);m.useEffect(()=>{f&&g(!0)},[f]);const _=()=>{f||g(!1)},x=VQ(n);return b.jsx(RQ,{delayDuration:s,children:b.jsxs(IQ,{open:f,onOpenChange:S=>{d(S),l==null||l(S)},children:[b.jsx(OQ,{asChild:!0,children:e}),h&&b.jsx(DQ,{forceMount:!0,container:w??void 0,children:b.jsx(jQ,{side:n,sideOffset:r,forceMount:!0,className:"z-tooltip",children:b.jsx(Ho.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:rh.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 Qi=m.forwardRef(({title:t,shortcut:e,...n},r)=>{const s=b.jsx(AI,{ref:r,...n});return t?b.jsx(Yb,{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});Qi.displayName="Button";var HQ=Object.defineProperty,Zn=(t,e)=>HQ(t,"name",{value:e,configurable:!0}),x_="focusScope.autoFocusOnMount",b_="focusScope.autoFocusOnUnmount",m3={bubbles:!1,cancelable:!0},TO=m.forwardRef(Zn(function(e,n){const{loop:r=!1,trapped:s=!1,branches:i,onMountAutoFocus:o,onUnmountAutoFocus:l,...u}=e,[d,f]=m.useState(null),h=xc(o),g=xc(l),v=m.useRef(null),w=Jt(n,f),_=m.useRef(i);m.useEffect(()=>{_.current=i});const x=m.useCallback(C=>{var A;return C?d!=null&&d.contains(C)?!0:!!((A=_.current)!=null&&A.some(T=>T.contains(C))):!1},[d]),S=m.useRef({paused:!1,pause(){this.paused=!0},resume(){this.paused=!1}}).current;m.useEffect(()=>{if(s){let C=function(M){if(S.paused||!d)return;const R=M.target;x(R)?v.current=R:Ro(v.current,{select:!0})},A=function(M){if(S.paused||!d)return;const R=M.relatedTarget;R!==null&&(x(R)||Ro(v.current,{select:!0}))},T=function(M){if(document.activeElement===document.body)for(const O of M)O.removedNodes.length>0&&Ro(d)};Zn(C,"handleFocusIn"),Zn(A,"handleFocusOut"),Zn(T,"handleMutations"),document.addEventListener("focusin",C),document.addEventListener("focusout",A);const I=new MutationObserver(T);return d&&I.observe(d,{childList:!0,subtree:!0}),()=>{document.removeEventListener("focusin",C),document.removeEventListener("focusout",A),I.disconnect()}}},[s,d,S.paused,x]),m.useEffect(()=>{if(d){g3.add(S);const C=document.activeElement;if(!d.contains(C)){const T=new CustomEvent(x_,m3);d.addEventListener(x_,h),d.dispatchEvent(T),T.defaultPrevented||(IO(jO(Jb(d)),{select:!0}),document.activeElement===C&&Ro(d))}return()=>{d.removeEventListener(x_,h),setTimeout(()=>{const T=new CustomEvent(b_,m3);d.addEventListener(b_,g),d.dispatchEvent(T),T.defaultPrevented||Ro(C??document.body,{select:!0}),d.removeEventListener(b_,g),g3.remove(S)},0)}}},[d,h,g,S]);const k=m.useCallback(C=>{if(!r&&!s||S.paused)return;const A=C.key==="Tab"&&!C.altKey&&!C.ctrlKey&&!C.metaKey,T=document.activeElement;if(A&&T){const I=C.currentTarget,[M,R]=OO(I);M&&R?!C.shiftKey&&T===R?(C.preventDefault(),r&&Ro(M,{select:!0})):C.shiftKey&&T===M&&(C.preventDefault(),r&&Ro(R,{select:!0})):T===I&&C.preventDefault()}},[r,s,S.paused]);return b.jsx(En.div,{tabIndex:-1,...u,ref:w,onKeyDown:k})},"FocusScope")),RO=m.createContext(null);function Xb({registry:t,children:e}){return t?b.jsx(RO.Provider,{value:t,children:e}):e}Zn(Xb,"FocusScopeBranchProvider");function Qb(){const[t,e]=m.useState([]),n=m.useMemo(()=>({add:Zn(r=>e(s=>s.includes(r)?s:[...s,r]),"add"),remove:Zn(r=>e(s=>s.filter(i=>i!==r)),"remove")}),[]);return{nodes:t,registry:n}}Zn(Qb,"useFocusScopeBranchRegistry");function MO(t){const e=m.useContext(RO);m.useEffect(()=>{if(!(!t||!e))return e.add(t),()=>e.remove(t)},[t,e])}Zn(MO,"useFocusScopeBranch");function IO(t,{select:e=!1}={}){const n=document.activeElement;for(const r of t)if(Ro(r,{select:e}),document.activeElement!==n)return}Zn(IO,"focusFirst");function OO(t){const e=Jb(t),n=Fw(e,t),r=Fw(e.reverse(),t);return[n,r]}Zn(OO,"getTabbableEdges");function Jb(t){const e=[],n=document.createTreeWalker(t,NodeFilter.SHOW_ELEMENT,{acceptNode:Zn(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}Zn(Jb,"getTabbableCandidates");function Fw(t,e){const n=typeof e.checkVisibility=="function"&&e.checkVisibility({checkVisibilityCSS:!0});for(const r of t)if(!(n?!r.checkVisibility({checkVisibilityCSS:!0}):LO(r,{upTo:e})))return r}Zn(Fw,"findVisible");function LO(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}Zn(LO,"isHidden");function NO(t){return t instanceof HTMLInputElement&&"select"in t}Zn(NO,"isSelectableInput");function Ro(t,{select:e=!1}={}){if(t&&t.focus){const n=document.activeElement;t.focus({preventScroll:!0}),t!==n&&NO(t)&&e&&t.select()}}Zn(Ro,"focus");var g3=DO();function DO(){let t=[];return{add(e){const n=t[0];e!==n&&(n==null||n.pause()),t=Vw(t,e),t.unshift(e)},remove(e){var n;t=Vw(t,e),(n=t[0])==null||n.resume()}}}Zn(DO,"createFocusScopesStack");function Vw(t,e){const n=[...t],r=n.indexOf(e);return r!==-1&&n.splice(r,1),n}Zn(Vw,"arrayRemove");function jO(t){return t.filter(e=>e.tagName!=="A")}Zn(jO,"removeLinks");var zQ=Object.defineProperty,e4=(t,e)=>zQ(t,"name",{value:e,configurable:!0}),z0=0,Li=null;function UQ(t){return lv(),t.children}e4(UQ,"FocusGuards");function lv(){m.useEffect(()=>{Li||(Li={start:Hw(),end:Hw()});const{start:t,end:e}=Li;return document.body.firstElementChild!==t&&document.body.insertAdjacentElement("afterbegin",t),document.body.lastElementChild!==e&&document.body.insertAdjacentElement("beforeend",e),z0++,()=>{z0===1&&(Li==null||Li.start.remove(),Li==null||Li.end.remove(),Li=null),z0=Math.max(0,z0-1)}},[])}e4(lv,"useFocusGuards");function Hw(){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}e4(Hw,"createFocusGuard");var Bi=function(){return Bi=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},Bi.apply(this,arguments)};function $O(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 BQ(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 _m="right-scroll-bar-position",wm="width-before-scroll-bar",ZQ="with-scroll-bars-hidden",WQ="--removed-body-scroll-bar-size";function S_(t,e){return typeof t=="function"?t(e):t&&(t.current=e),t}function qQ(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 GQ=typeof window<"u"?m.useLayoutEffect:m.useEffect,v3=new WeakMap;function KQ(t,e){var n=qQ(null,function(r){return t.forEach(function(s){return S_(s,r)})});return GQ(function(){var r=v3.get(n);if(r){var s=new Set(r),i=new Set(t),o=n.current;s.forEach(function(l){i.has(l)||S_(l,null)}),i.forEach(function(l){s.has(l)||S_(l,o)})}v3.set(n,t)},[t]),n}function YQ(t){return t}function XQ(t,e){e===void 0&&(e=YQ);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 QQ(t){t===void 0&&(t={});var e=XQ(null);return e.options=Bi({async:!0,ssr:!1},t),e}var FO=function(t){var e=t.sideCar,n=$O(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,Bi({},n))};FO.isSideCarExport=!0;function JQ(t,e){return t.useMedium(e),FO}var VO=QQ(),k_=function(){},cv=m.forwardRef(function(t,e){var n=m.useRef(null),r=m.useState({onScrollCapture:k_,onWheelCapture:k_,onTouchMoveCapture:k_}),s=r[0],i=r[1],o=t.forwardProps,l=t.children,u=t.className,d=t.removeScrollBar,f=t.enabled,h=t.shards,g=t.sideCar,v=t.noRelative,w=t.noIsolation,_=t.inert,x=t.allowPinchZoom,S=t.as,k=S===void 0?"div":S,C=t.gapMode,A=$O(t,["forwardProps","children","className","removeScrollBar","enabled","shards","sideCar","noRelative","noIsolation","inert","allowPinchZoom","as","gapMode"]),T=g,I=KQ([n,e]),M=Bi(Bi({},A),s);return m.createElement(m.Fragment,null,f&&m.createElement(T,{sideCar:VO,removeScrollBar:d,shards:h,noRelative:v,noIsolation:w,inert:_,setCallbacks:i,allowPinchZoom:!!x,lockRef:n,gapMode:C}),o?m.cloneElement(m.Children.only(l),Bi(Bi({},M),{ref:I})):m.createElement(k,Bi({},M,{className:u,ref:I}),l))});cv.defaultProps={enabled:!0,removeScrollBar:!0,inert:!1};cv.classNames={fullWidth:wm,zeroRight:_m};var eJ=function(){if(typeof __webpack_nonce__<"u")return __webpack_nonce__};function tJ(){if(!document)return null;var t=document.createElement("style");t.type="text/css";var e=eJ();return e&&t.setAttribute("nonce",e),t}function nJ(t,e){t.styleSheet?t.styleSheet.cssText=e:t.appendChild(document.createTextNode(e))}function rJ(t){var e=document.head||document.getElementsByTagName("head")[0];e.appendChild(t)}var sJ=function(){var t=0,e=null;return{add:function(n){t==0&&(e=tJ())&&(nJ(e,n),rJ(e)),t++},remove:function(){t--,!t&&e&&(e.parentNode&&e.parentNode.removeChild(e),e=null)}}},iJ=function(){var t=sJ();return function(e,n){m.useEffect(function(){return t.add(e),function(){t.remove()}},[e&&n])}},HO=function(){var t=iJ(),e=function(n){var r=n.styles,s=n.dynamic;return t(r,s),null};return e},oJ={left:0,top:0,right:0,gap:0},E_=function(t){return parseInt(t||"",10)||0},aJ=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[E_(n),E_(r),E_(s)]},lJ=function(t){if(t===void 0&&(t="margin"),typeof window>"u")return oJ;var e=aJ(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])}},cJ=HO(),Du="data-scroll-locked",uJ=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(ZQ,` {
73
+ overflow: hidden `).concat(r,`;
74
+ padding-right: `).concat(l,"px ").concat(r,`;
75
+ }
76
+ body[`).concat(Du,`] {
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(_m,` {
90
+ right: `).concat(l,"px ").concat(r,`;
91
+ }
92
+
93
+ .`).concat(wm,` {
94
+ margin-right: `).concat(l,"px ").concat(r,`;
95
+ }
96
+
97
+ .`).concat(_m," .").concat(_m,` {
98
+ right: 0 `).concat(r,`;
99
+ }
100
+
101
+ .`).concat(wm," .").concat(wm,` {
102
+ margin-right: 0 `).concat(r,`;
103
+ }
104
+
105
+ body[`).concat(Du,`] {
106
+ `).concat(WQ,": ").concat(l,`px;
107
+ }
108
+ `)},y3=function(){var t=parseInt(document.body.getAttribute(Du)||"0",10);return isFinite(t)?t:0},dJ=function(){m.useEffect(function(){return document.body.setAttribute(Du,(y3()+1).toString()),function(){var t=y3()-1;t<=0?document.body.removeAttribute(Du):document.body.setAttribute(Du,t.toString())}},[])},fJ=function(t){var e=t.noRelative,n=t.noImportant,r=t.gapMode,s=r===void 0?"margin":r;dJ();var i=m.useMemo(function(){return lJ(s)},[s]);return m.createElement(cJ,{styles:uJ(i,!e,s,n?"":"!important")})},zw=!1;if(typeof window<"u")try{var U0=Object.defineProperty({},"passive",{get:function(){return zw=!0,!0}});window.addEventListener("test",U0,U0),window.removeEventListener("test",U0,U0)}catch{zw=!1}var pu=zw?{passive:!1}:!1,hJ=function(t){return t.tagName==="TEXTAREA"},zO=function(t,e){if(!(t instanceof Element))return!1;var n=window.getComputedStyle(t);return n[e]!=="hidden"&&!(n.overflowY===n.overflowX&&!hJ(t)&&n[e]==="visible")},pJ=function(t){return zO(t,"overflowY")},mJ=function(t){return zO(t,"overflowX")},_3=function(t,e){var n=e.ownerDocument,r=e;do{typeof ShadowRoot<"u"&&r instanceof ShadowRoot&&(r=r.host);var s=UO(t,r);if(s){var i=BO(t,r),o=i[1],l=i[2];if(o>l)return!0}r=r.parentNode}while(r&&r!==n.body);return!1},gJ=function(t){var e=t.scrollTop,n=t.scrollHeight,r=t.clientHeight;return[e,n,r]},vJ=function(t){var e=t.scrollLeft,n=t.scrollWidth,r=t.clientWidth;return[e,n,r]},UO=function(t,e){return t==="v"?pJ(e):mJ(e)},BO=function(t,e){return t==="v"?gJ(e):vJ(e)},yJ=function(t,e){return t==="h"&&e==="rtl"?-1:1},_J=function(t,e,n,r,s){var i=yJ(t,window.getComputedStyle(e).direction),o=i*r,l=n.target,u=e.contains(l),d=!1,f=o>0,h=0,g=0;do{if(!l)break;var v=BO(t,l),w=v[0],_=v[1],x=v[2],S=_-x-i*w;(w||S)&&UO(t,l)&&(h+=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(h)<1||!f&&Math.abs(g)<1)&&(d=!0),d},B0=function(t){return"changedTouches"in t?[t.changedTouches[0].clientX,t.changedTouches[0].clientY]:[0,0]},w3=function(t){return[t.deltaX,t.deltaY]},x3=function(t){return t&&"current"in t?t.current:t},wJ=function(t,e){return t[0]===e[0]&&t[1]===e[1]},xJ=function(t){return`
109
+ .block-interactivity-`.concat(t,` {pointer-events: none;}
110
+ .allow-interactivity-`).concat(t,` {pointer-events: all;}
111
+ `)},bJ=0,mu=[];function SJ(t){var e=m.useRef([]),n=m.useRef([0,0]),r=m.useRef(),s=m.useState(bJ++)[0],i=m.useState(HO)[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 _=BQ([t.lockRef.current],(t.shards||[]).map(x3),!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=B0(_),k=n.current,C="deltaX"in _?_.deltaX:k[0]-S[0],A="deltaY"in _?_.deltaY:k[1]-S[1],T,I=_.target,M=Math.abs(C)>Math.abs(A)?"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=_3(M,I);if(!D)return!0;if(D?T=M:(T=M==="v"?"h":"v",D=_3(M,I)),!D)return!1;if(!r.current&&"changedTouches"in _&&(C||A)&&(r.current=T),!T)return!0;var F=r.current||T;return _J(F,x,_,F==="h"?C:A)},[]),u=m.useCallback(function(_){var x=_;if(!(!mu.length||mu[mu.length-1]!==i)){var S="deltaY"in x?w3(x):B0(x),k=e.current.filter(function(T){return T.name===x.type&&(T.target===x.target||x.target===T.shadowParent)&&wJ(T.delta,S)})[0];if(k&&k.should){x.cancelable&&x.preventDefault();return}if(!k){var C=(o.current.shards||[]).map(x3).filter(Boolean).filter(function(T){return T.contains(x.target)}),A=C.length>0?l(x,C[0]):!o.current.noIsolation;A&&x.cancelable&&x.preventDefault()}}},[]),d=m.useCallback(function(_,x,S,k){var C={name:_,delta:x,target:S,should:k,shadowParent:kJ(S)};e.current.push(C),setTimeout(function(){e.current=e.current.filter(function(A){return A!==C})},1)},[]),f=m.useCallback(function(_){n.current=B0(_),r.current=void 0},[]),h=m.useCallback(function(_){d(_.type,w3(_),_.target,l(_,t.lockRef.current))},[]),g=m.useCallback(function(_){d(_.type,B0(_),_.target,l(_,t.lockRef.current))},[]);m.useEffect(function(){return mu.push(i),t.setCallbacks({onScrollCapture:h,onWheelCapture:h,onTouchMoveCapture:g}),document.addEventListener("wheel",u,pu),document.addEventListener("touchmove",u,pu),document.addEventListener("touchstart",f,pu),function(){mu=mu.filter(function(_){return _!==i}),document.removeEventListener("wheel",u,pu),document.removeEventListener("touchmove",u,pu),document.removeEventListener("touchstart",f,pu)}},[]);var v=t.removeScrollBar,w=t.inert;return m.createElement(m.Fragment,null,w?m.createElement(i,{styles:xJ(s)}):null,v?m.createElement(fJ,{noRelative:t.noRelative,gapMode:t.gapMode}):null)}function kJ(t){for(var e=null;t!==null;)t instanceof ShadowRoot&&(e=t.host,t=t.host),t=t.parentNode;return e}const EJ=JQ(VO,SJ);var t4=m.forwardRef(function(t,e){return m.createElement(cv,Bi({},t,{ref:e,sideCar:EJ}))});t4.classNames=cv.classNames;var CJ=function(t){if(typeof document>"u")return null;var e=Array.isArray(t)?t[0]:t;return e.ownerDocument.body},gu=new WeakMap,Z0=new WeakMap,W0={},C_=0,ZO=function(t){return t&&(t.host||ZO(t.parentNode))},PJ=function(t,e){return e.map(function(n){if(t.contains(n))return n;var r=ZO(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})},AJ=function(t,e,n,r){var s=PJ(e,Array.isArray(t)?t:[t]);W0[n]||(W0[n]=new WeakMap);var i=W0[n],o=[],l=new Set,u=new Set(s),d=function(h){!h||l.has(h)||(l.add(h),d(h.parentNode))};s.forEach(d);var f=function(h){!h||u.has(h)||Array.prototype.forEach.call(h.children,function(g){if(l.has(g))f(g);else try{var v=g.getAttribute(r),w=v!==null&&v!=="false",_=(gu.get(g)||0)+1,x=(i.get(g)||0)+1;gu.set(g,_),i.set(g,x),o.push(g),_===1&&w&&Z0.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(),C_++,function(){o.forEach(function(h){var g=gu.get(h)-1,v=i.get(h)-1;gu.set(h,g),i.set(h,v),g||(Z0.has(h)||h.removeAttribute(r),Z0.delete(h)),v||h.removeAttribute(n)}),C_--,C_||(gu=new WeakMap,gu=new WeakMap,Z0=new WeakMap,W0={})}},WO=function(t,e,n){n===void 0&&(n="data-aria-hidden");var r=Array.from(Array.isArray(t)?t:[t]),s=CJ(t);return s?(r.push.apply(r,Array.from(s.querySelectorAll("[aria-live], script"))),AJ(r,s,n,"aria-hidden")):function(){return null}},TJ=Object.defineProperty,os=(t,e)=>TJ(t,"name",{value:e,configurable:!0}),n4="Dialog",[qO,Lae]=so(n4),[RJ,Ci]=qO(n4),uv=os(t=>{const{__scopeDialog:e,children:n,open:r,defaultOpen:s,onOpenChange:i,modal:o=!0}=t,l=m.useRef(null),u=m.useRef(null),{nodes:d,registry:f}=Qb(),[h,g]=cl({prop:r,defaultProp:s??!1,onChange:i,caller:n4}),[v,w]=m.useState(0),[_,x]=m.useState(0);return b.jsx(RJ,{scope:e,triggerRef:l,contentRef:u,contentId:Xi(),titleId:Xi(),descriptionId:Xi(),titlePresent:v>0,descriptionPresent:_>0,setTitleCount:w,setDescriptionCount:x,open:h,onOpenChange:g,onOpenToggle:m.useCallback(()=>g(S=>!S),[g]),modal:o,branchNodes:d,branchRegistry:f,children:n})},"Dialog"),MJ="DialogTrigger",Nae=m.forwardRef(os(function(e,n){const{__scopeDialog:r,...s}=e,i=Ci(MJ,r),o=Jt(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":gv(i.open),...s,ref:o,onClick:Yt(e.onClick,i.onOpenToggle)})},"DialogTrigger")),GO="DialogPortal",[IJ,KO]=qO(GO,{forceMount:void 0}),dv=os(t=>{const{__scopeDialog:e,forceMount:n,children:r,container:s}=t,i=Ci(GO,e);return b.jsx(IJ,{scope:e,forceMount:n,children:m.Children.map(r,o=>b.jsx(ll,{present:n||i.open,children:b.jsx(Wb,{asChild:!0,container:s,children:o})}))})},"DialogPortal"),Uw="DialogOverlay",fv=m.forwardRef(os(function(e,n){const r=KO(Uw,e.__scopeDialog),{forceMount:s=r.forceMount,...i}=e,o=Ci(Uw,e.__scopeDialog);return o.modal?b.jsx(ll,{present:s||o.open,children:b.jsx(LJ,{...i,ref:n})}):null},"DialogOverlay")),OJ=Qa("DialogOverlay.RemoveScroll"),LJ=m.forwardRef(os(function(e,n){const{__scopeDialog:r,...s}=e,i=Ci(Uw,r),o=UI(),l=Jt(n,o);return b.jsx(t4,{as:OJ,allowPinchZoom:!0,shards:m.useMemo(()=>[i.contentRef,...i.branchNodes.map(u=>({current:u}))],[i.contentRef,i.branchNodes]),children:b.jsx(En.div,{"data-state":gv(i.open),...s,ref:l,style:{pointerEvents:"auto",...s.style}})})},"DialogOverlayImpl")),Ih="DialogContent",hv=m.forwardRef(os(function(e,n){const r=KO(Ih,e.__scopeDialog),{forceMount:s=r.forceMount,...i}=e,o=Ci(Ih,e.__scopeDialog);return b.jsx(ll,{present:s||o.open,children:o.modal?b.jsx(NJ,{...i,ref:n}):b.jsx(DJ,{...i,ref:n})})},"DialogContent")),NJ=m.forwardRef(os(function(e,n){const r=Ci(Ih,e.__scopeDialog),s=m.useRef(null),i=Jt(n,r.contentRef,s);return m.useEffect(()=>{const o=s.current;if(o)return WO(o)},[]),b.jsx(YO,{...e,ref:i,trapFocus:r.open,disableOutsidePointerEvents:r.open,onCloseAutoFocus:Yt(e.onCloseAutoFocus,o=>{var l;o.preventDefault(),(l=r.triggerRef.current)==null||l.focus()}),onPointerDownOutside:Yt(e.onPointerDownOutside,o=>{const l=o.detail.originalEvent,u=l.button===0&&l.ctrlKey===!0;(l.button===2||u)&&o.preventDefault()}),onFocusOutside:Yt(e.onFocusOutside,o=>o.preventDefault())})},"DialogContentModal")),DJ=m.forwardRef(os(function(e,n){const r=Ci(Ih,e.__scopeDialog),s=m.useRef(!1),i=m.useRef(!1);return b.jsx(YO,{...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")),YO=m.forwardRef(os(function(e,n){const{__scopeDialog:r,trapFocus:s,onOpenAutoFocus:i,onCloseAutoFocus:o,"aria-describedby":l,children:u,...d}=e,f=Ci(Ih,r);return lv(),b.jsx(Xb,{registry:f.branchRegistry,children:b.jsx(TO,{asChild:!0,loop:!0,trapped:s,branches:f.branchNodes,onMountAutoFocus:i,onUnmountAutoFocus:o,children:b.jsx(jb,{role:"dialog",id:f.contentId,"aria-labelledby":f.titlePresent?f.titleId:void 0,"aria-describedby":f.descriptionPresent?XO(l,f.descriptionId):l,"data-state":gv(f.open),...d,ref:n,deferPointerDownOutside:!0,onDismiss:()=>f.onOpenChange(!1),children:u})})})},"DialogContentImpl")),pv=m.forwardRef(os(function(e,n){const{__scopeDialog:r,...s}=e,i=Ci("DialogTitle",r),{setTitleCount:o}=i;return Jr(()=>(o(l=>l+1),()=>o(l=>l-1)),[o]),b.jsx(En.h2,{id:i.titleId,...s,ref:n})},"DialogTitle")),mv=m.forwardRef(os(function(e,n){const{__scopeDialog:r,...s}=e,i=Ci("DialogDescription",r),{setDescriptionCount:o}=i;return Jr(()=>(o(l=>l+1),()=>o(l=>l-1)),[o]),b.jsx(En.p,{id:i.descriptionId,...s,ref:n})},"DialogDescription")),jJ="DialogClose",Dae=m.forwardRef(os(function(e,n){const{__scopeDialog:r,...s}=e,i=Ci(jJ,r);return b.jsx(En.button,{type:"button",...s,ref:n,onClick:Yt(e.onClick,()=>i.onOpenChange(!1))})},"DialogClose"));function XO(...t){const e=new Set;for(const n of t)if(typeof n=="string")for(const r of String(n).trim().split(/\s+/))r&&e.add(r);return e.size>0?Array.from(e).join(" "):void 0}os(XO,"concatAriaDescribedby");function gv(t){return t?"open":"closed"}os(gv,"getState");var $J=Object.defineProperty,Jo=(t,e)=>$J(t,"name",{value:e,configurable:!0}),r4="Popover",[QO,jae]=so(r4,[ov]),s4=ov(),[FJ,Rd]=QO(r4),i4=Jo(t=>{const{__scopePopover:e,children:n,open:r,defaultOpen:s,onOpenChange:i,modal:o=!1}=t,l=s4(e),u=m.useRef(null),[d,f]=m.useState(!1),[h,g]=m.useState(0),[v,w]=m.useState(0),[_,x]=cl({prop:r,defaultProp:s??!1,onChange:i,caller:r4});return b.jsx(oO,{...l,children:b.jsx(FJ,{scope:e,contentId:Xi(),titleId:Xi(),descriptionId:Xi(),titlePresent:h>0,descriptionPresent:v>0,setTitleCount:g,setDescriptionCount:w,triggerRef:u,open:_,onOpenChange:x,onOpenToggle:m.useCallback(()=>x(S=>!S),[x]),hasCustomAnchor:d,onCustomAnchorAdd:m.useCallback(()=>f(!0),[]),onCustomAnchorRemove:m.useCallback(()=>f(!1),[]),modal:o,children:n})})},"Popover"),VJ="PopoverTrigger",o4=m.forwardRef(Jo(function(e,n){const{__scopePopover:r,...s}=e,i=Rd(VJ,r),o=s4(r),l=Jt(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":c4(i.open),...s,ref:l,onClick:Yt(e.onClick,i.onOpenToggle)});return i.hasCustomAnchor?u:b.jsx(aO,{asChild:!0,...o,children:u})},"PopoverTrigger")),JO="PopoverPortal",[HJ,zJ]=QO(JO,{forceMount:void 0}),a4=Jo(t=>{const{__scopePopover:e,forceMount:n,children:r,container:s}=t,i=Rd(JO,e);return b.jsx(HJ,{scope:e,forceMount:n,children:b.jsx(ll,{present:n||i.open,children:b.jsx(Wb,{asChild:!0,container:s,children:r})})})},"PopoverPortal"),Oh="PopoverContent",l4=m.forwardRef(Jo(function(e,n){const r=zJ(Oh,e.__scopePopover),{forceMount:s=r.forceMount,...i}=e,o=Rd(Oh,e.__scopePopover);return b.jsx(ll,{present:s||o.open,children:o.modal?b.jsx(BJ,{...i,ref:n}):b.jsx(ZJ,{...i,ref:n})})},"PopoverContent")),UJ=Qa("PopoverContent.RemoveScroll"),BJ=m.forwardRef(Jo(function(e,n){const r=Rd(Oh,e.__scopePopover),s=m.useRef(null),i=Jt(n,s),o=m.useRef(!1),{nodes:l,registry:u}=Qb();return m.useEffect(()=>{const d=s.current;if(d)return WO(d)},[]),b.jsx(t4,{as:UJ,allowPinchZoom:!0,shards:m.useMemo(()=>[s,...l.map(d=>({current:d}))],[s,l]),children:b.jsx(e9,{...e,ref:i,branchNodes:l,branchRegistry:u,trapFocus:r.open,disableOutsidePointerEvents:!0,onCloseAutoFocus:Yt(e.onCloseAutoFocus,d=>{var f;d.preventDefault(),o.current||(f=r.triggerRef.current)==null||f.focus()}),onPointerDownOutside:Yt(e.onPointerDownOutside,d=>{const f=d.detail.originalEvent,h=f.button===0&&f.ctrlKey===!0,g=f.button===2||h;o.current=g},{checkForDefaultPrevented:!1}),onFocusOutside:Yt(e.onFocusOutside,d=>d.preventDefault(),{checkForDefaultPrevented:!1})})})},"PopoverContentModal")),ZJ=m.forwardRef(Jo(function(e,n){const r=Rd(Oh,e.__scopePopover),s=m.useRef(!1),i=m.useRef(!1);return b.jsx(e9,{...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")),e9=m.forwardRef(Jo(function(e,n){const{__scopePopover:r,trapFocus:s,onOpenAutoFocus:i,onCloseAutoFocus:o,disableOutsidePointerEvents:l,onEscapeKeyDown:u,onPointerDownOutside:d,onFocusOutside:f,onInteractOutside:h,"aria-describedby":g,branchNodes:v,branchRegistry:w,..._}=e,x=Rd(Oh,r),S=s4(r),[k,C]=m.useState(null),A=Jt(n,C);return MO(k),lv(),b.jsx(Xb,{registry:w,children:b.jsx(TO,{asChild:!0,loop:!0,trapped:s,branches:v,onMountAutoFocus:i,onUnmountAutoFocus:o,children:b.jsx(jb,{asChild:!0,disableOutsidePointerEvents:l,onInteractOutside:h,onEscapeKeyDown:u,onPointerDownOutside:d,onFocusOutside:f,onDismiss:()=>x.onOpenChange(!1),deferPointerDownOutside:!0,children:b.jsx(cO,{"data-state":c4(x.open),role:"dialog",id:x.contentId,"aria-labelledby":x.titlePresent?x.titleId:void 0,"aria-describedby":x.descriptionPresent?t9(g,x.descriptionId):g,...S,..._,ref:A,style:{..._.style,"--radix-popover-content-transform-origin":"var(--radix-popper-transform-origin)","--radix-popover-content-available-width":"var(--radix-popper-available-width)","--radix-popover-content-available-height":"var(--radix-popper-available-height)","--radix-popover-trigger-width":"var(--radix-popper-anchor-width)","--radix-popover-trigger-height":"var(--radix-popper-anchor-height)"}})})})})},"PopoverContentImpl"));function c4(t){return t?"open":"closed"}Jo(c4,"getState");function t9(...t){const e=new Set;for(const n of t)if(typeof n=="string")for(const r of String(n).trim().split(/\s+/))r&&e.add(r);return e.size>0?Array.from(e).join(" "):void 0}Jo(t9,"concatAriaDescribedby");const Lh={fast:{type:"spring",duration:.08,bounce:0},moderate:{type:"spring",duration:.16,bounce:.15}},WJ="data-hover-dead-zone";function n9(t,e={}){const{axis:n="y",snapTolerancePx:r=1/0}=e,s=m.useRef(new Map),[i,o]=m.useState(null),[l,u]=m.useState([]),d=m.useRef([]),f=m.useRef(0),h=m.useRef(null),g=m.useRef(null),v=m.useCallback(()=>{const C=[];return s.current.forEach((A,T)=>{C[T]={top:A.offsetTop,height:A.offsetHeight,left:A.offsetLeft,width:A.offsetWidth}}),C},[]),w=m.useCallback(()=>{if(!t.current)return;const A=v();d.current=A,u(A)},[t,v]),_=m.useCallback((C,A)=>{A?s.current.set(C,A):s.current.delete(C),g.current!==null&&cancelAnimationFrame(g.current),g.current=requestAnimationFrame(()=>{g.current=null,w()})},[w]),x=m.useCallback(C=>{const A=C.clientX,T=C.clientY,I=C.target instanceof Element&&C.target.closest(`[${WJ}]`)!==null;h.current!==null&&cancelAnimationFrame(h.current),h.current=requestAnimationFrame(()=>{h.current=null;const M=t.current;if(!M)return;if(I){o(null);return}const R=v(),O=d.current;(R.length!==O.length||R.some((oe,ne)=>{const se=O[ne];return!se||!oe||oe.top!==se.top||oe.height!==se.height||oe.left!==se.left||oe.width!==se.width}))&&(d.current=R,u(R));const D=M.getBoundingClientRect(),F=n==="x"?A:T;let K=null,B=1/0,G=null;const H=d.current,Y=n==="x"?M.scrollLeft:M.scrollTop,U=n==="x"?M.clientLeft:M.clientTop,J=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<H.length;oe++){const ne=H[oe];if(!ne)continue;const se=n==="x"?ne.left:ne.top,de=J+(U+se-Y)*Q,ve=(n==="x"?ne.width:ne.height)*Q,ue=de+ve;F>=de&&F<=ue&&(G=oe);let ae=0;F<de?ae=de-F:F>ue&&(ae=F-ue),ae<B&&(B=ae,K=oe)}o(G??(B<=r?K:null))})},[n,t,r,v]),S=m.useCallback(()=>{f.current+=1,w()},[w]),k=m.useCallback(()=>{h.current!==null&&(cancelAnimationFrame(h.current),h.current=null),o(null)},[]);return m.useEffect(()=>()=>{h.current!==null&&cancelAnimationFrame(h.current),g.current!==null&&cancelAnimationFrame(g.current)},[]),{activeIndex:i,setActiveIndex:o,itemRects:l,sessionRef:f,handlers:{onMouseMove:x,onMouseEnter:S,onMouseLeave:k},registerItem:_,measureItems:w}}function qJ(t,e,n){m.useEffect(()=>(t(e,n.current),()=>t(e,null)),[e,t,n])}let xm=0;const GJ=()=>{xm+=1;let t=!1;return()=>{t||(t=!0,xm=Math.max(0,xm-1))}},KJ=()=>xm>0,YJ='[data-menu-item]:not([disabled]):not([aria-disabled="true"])',r9=({itemSelector:t=YJ,loop:e=!1,onDismiss:n}={})=>{const r=m.useRef(null),s=m.useRef(null),i=m.useRef(n),o=m.useRef(!1);i.current=n;const l=m.useCallback(f=>{var h;if(r.current=f,f){o.current=!1;const g=GJ(),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(h=s.current)==null||h.call(s),s.current=null},[]),u=f=>{o.current&&f.preventDefault()},d=m.useCallback(f=>{var k;const{key:h}=f;if(h!=="ArrowDown"&&h!=="ArrowUp"&&h!=="Home"&&h!=="End")return;const g=r.current;if(!g)return;const v=Array.from(g.querySelectorAll(t));if(v.length===0)return;f.preventDefault(),f.stopPropagation();const w=v.indexOf(document.activeElement),_=v.length-1,x=C=>{if(w===-1)return C===1?0:_;const A=w+C;return e?(A+v.length)%v.length:Math.min(Math.max(A,0),_)};let S;h==="Home"?S=0:h==="End"?S=_:h==="ArrowDown"?S=x(1):S=x(-1),(k=v[S])==null||k.focus()},[t,e]);return{containerRef:l,onKeyDown:d,onCloseAutoFocus:u}};var bm={exports:{}},XJ=bm.exports,b3;function QJ(){return b3||(b3=1,(function(t){(function(e,n){t.exports?t.exports=n():e.log=n()})(XJ,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 h(_){return function(){typeof console!==n&&(f.call(this),this[_].apply(this,arguments))}}function g(_,x,S){return d(_)||h.apply(this,arguments)}function v(_,x){var S=this,k,C,A,T="loglevel";typeof _=="string"?T+=":"+_:typeof _=="symbol"&&(T=void 0);function I(D){var F=(s[D]||"silent").toUpperCase();if(!(typeof window===n||!T)){try{window.localStorage[T]=F;return}catch{}try{window.document.cookie=encodeURIComponent(T)+"="+F+";"}catch{}}}function M(){var D;if(!(typeof window===n||!T)){try{D=window.localStorage[T]}catch{}if(typeof D===n)try{var F=window.document.cookie,K=encodeURIComponent(T),B=F.indexOf(K+"=");B!==-1&&(D=/^([^;]+)/.exec(F.slice(B+K.length+1))[1])}catch{}return S.levels[D]===void 0&&(D=void 0),D}}function R(){if(!(typeof window===n||!T)){try{window.localStorage.removeItem(T)}catch{}try{window.document.cookie=encodeURIComponent(T)+"=; expires=Thu, 01 Jan 1970 00:00:00 UTC"}catch{}}}function O(D){var F=D;if(typeof F=="string"&&S.levels[F.toUpperCase()]!==void 0&&(F=S.levels[F.toUpperCase()]),typeof F=="number"&&F>=0&&F<=S.levels.SILENT)return F;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 A??C??k},S.setLevel=function(D,F){return A=O(D),F!==!1&&I(A),f.call(S)},S.setDefaultLevel=function(D){C=O(D),M()||S.setLevel(D,!1)},S.resetLevel=function(){A=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&&(A=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})})(bm)),bm.exports}var JJ=QJ();const gi=Vg(JJ),eee="INFO",tee=eee.toUpperCase();gi.setLevel(gi.levels[tee]||gi.levels.INFO);const Ms=t=>{const e=t?`[${t}] `:"";return{trace:(n,...r)=>gi.trace(`${e}${n}`,...r),debug:(n,...r)=>gi.debug(`${e}${n}`,...r),info:(n,...r)=>gi.info(`${e}${n}`,...r),warn:(n,...r)=>gi.warn(`${e}${n}`,...r),error:(n,...r)=>{gi.error(`${e}${n}`,...r);try{const i=r.map(l=>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)=>gi.info(`${e}API: ${n}`,...r),hook:(n,...r)=>gi.debug(`${e}Hook: ${n}`,...r),mount:(n,...r)=>gi.debug(`${e}Mount: ${n}`,...r)}},S3=Ms("useVariantsUiState"),nee={groups:[],rows:{}},q0={pinned:[],order:nee},$f="pinned",ree="top",P_=t=>`rows:${t}`,k3=t=>e=>e.pinned.includes(t)?e:{...e,pinned:[...e.pinned,t]},see=t=>e=>({...e,pinned:e.pinned.filter(n=>n!==t)}),iee=(t,e)=>n=>{if(t===$f){const r=new Set(e);return{...n,pinned:[...e,...n.pinned.filter(s=>!r.has(s))]}}return t===ree?{...n,order:{...n.order,groups:e}}:{...n,order:{...n.order,rows:{...n.order.rows,[t.slice(5)]:e}}}},oee=t=>{const e=t?`?projectPath=${encodeURIComponent(t)}`:"",[n,r]=m.useState(q0),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=>{S3.warn("persist failed — arrangement kept for this session only",w)})},[t,e]);m.useEffect(()=>{if(r(q0),s.current=q0,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??q0;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){S3.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?k3(v):see(v))},[u]),f=m.useCallback(v=>{s.current.pinned.includes(v)||u(k3(v))},[u]),h=m.useCallback((v,w)=>{u(iee(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:h}},aee=t=>{const{containerRef:e,dragged:n,yieldToSelector:r,restrictToSelector:s,onReorder:i}=t,[o,l]=m.useState(null),u=m.useCallback(h=>{const g=e.current;return g?Array.from(g.querySelectorAll(`[data-reorder-container="${CSS.escape(h)}"]`)):[]},[e]),d=m.useCallback(h=>{if(!n){o&&l(null);return}const g=e.current;if(!g)return;if(r){const S=g.querySelector(r);if(S){const k=S.getBoundingClientRect();if(h.clientY>=k.top&&h.clientY<=k.bottom){o&&l(null);return}}}if(s){const S=g.querySelector(s),k=S==null?void 0:S.getBoundingClientRect();if(!k||h.clientY<k.top||h.clientY>k.bottom){o&&l(null);return}}const v=u(n.container);if(v.length===0){o&&l(null);return}const w=g.getBoundingClientRect().top;let _=v.length;for(let S=0;S<v.length;S++){const k=v[S].getBoundingClientRect();if(h.clientY<k.top+k.height/2){_=S;break}}let 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 h=u(o.container).map(w=>w.dataset.reorderKey).filter(w=>!!w),g=h.indexOf(n.key);if(g===-1)return;h.splice(g,1);const v=o.index>g?o.index-1:o.index;h.splice(v,0,n.key),i(o.container,h)},[n,o,u,i]);return{dropTarget:o,onPointerMove:d,onPointerUp:f}},s9=(t,e)=>`style:${t}:${e}`,i9=t=>`text:${t}`,o9=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"]},a9=t=>o9(t)[0],G0=(t,e)=>o9(t).includes(e),lee=t=>{const e=a9(t.elementId),n=t.batchId?`:${t.batchId}`:"";return t.type==="style"?`${s9(e,t.property)}${n}`:`${i9(e)}${n}`},fr=[];for(let t=0;t<256;++t)fr.push((t+256).toString(16).slice(1));function cee(t,e=0){return(fr[t[e+0]]+fr[t[e+1]]+fr[t[e+2]]+fr[t[e+3]]+"-"+fr[t[e+4]]+fr[t[e+5]]+"-"+fr[t[e+6]]+fr[t[e+7]]+"-"+fr[t[e+8]]+fr[t[e+9]]+"-"+fr[t[e+10]]+fr[t[e+11]]+fr[t[e+12]]+fr[t[e+13]]+fr[t[e+14]]+fr[t[e+15]]).toLowerCase()}const uee=new Uint8Array(16);function dee(){return crypto.getRandomValues(uee)}function E3(t,e,n){return crypto.randomUUID?crypto.randomUUID():fee(t)}function fee(t,e,n){var s;t=t||{};const r=t.random??((s=t.rng)==null?void 0:s.call(t))??dee();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,cee(r)}const hee=300;class pee{constructor(){wa(this,"history",{current:new Map,past:[],future:[]});wa(this,"pendingChanges",new Map);wa(this,"currentBatchId",null);wa(this,"debounceTimer",null);wa(this,"onChangeCallbacks",[]);wa(this,"stateBeforePending",null);wa(this,"transactionDepth",0)}recordChange(e){this.pendingChanges.size===0&&(this.currentBatchId=E3(),this.stateBeforePending=new Map(this.history.current)),this.currentBatchId&&(e.batchId=this.currentBatchId);const n=a9(e.elementId),r=e.type==="style"?s9(n,e.property):i9(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=lee(e);this.history.current.set(i,e),this.pendingChanges.set(i,e),this.debounceTimer&&clearTimeout(this.debounceTimer),this.debounceTimer=setTimeout(()=>{this.commitPending()},hee),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"&&G0(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"&&G0(r.elementId,e)).sort((r,s)=>s.timestamp-r.timestamp)[0]}hasChanges(e){return Array.from(this.history.current.values()).some(n=>G0(n.elementId,e))}getChangesForElement(e){return Array.from(this.history.current.values()).filter(n=>G0(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=E3(),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 Cg={kind:"base"};function Nh(t){return t.kind==="base"?"base":`variant:${t.sessionId}:${t.variantId}`}function mee(t,e){return t.kind==="base"&&e.kind,t.kind==="variant"&&e.kind==="variant"?t.sessionId===e.sessionId&&t.variantId===e.variantId:!1}const gee={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}},l9=Object.fromEntries(Object.entries(gee).map(([t,e])=>[t,{isEnabled:e.default}]));ft("view");const c9=ft(!0),u9=ft(null),vee=ft("chat"),d9=ft(0),yee=ft({name:null,email:null}),C3=ft(Cg);ft(null);const Dh=new Map,_ee=t=>{const e=Nh(t);let n=Dh.get(e);return n||(n=new pee,Dh.set(e,n)),n};ft(t=>_ee(t(C3)),(t,e,n)=>{Dh.set(Nh(t(C3)),n)});const wee=t=>{for(const e of[...Dh.keys()])e==="base"||t.has(e)||Dh.delete(e)},jh=ft(new Map),P3=ft(null);ft(null);const Bw=ft(0),Pg=ft(null),Zw=ft(!1),Ww=ft(null),f9=ft(!1),h9=ft(!1),qw=ft(null),Sm=ft(null),md=ft(null),u4=ft(null),Ko=ft(null),p9=ft(!1),cp=ft({active:!1}),m9=ft([]),A3=ft(null),xee=(t,e,n)=>{let r=!1;const s=new Map(t);for(const[i,o]of t)o.target&&mee(o.target,e)&&(s.set(i,{...o,target:n}),r=!0);return r?s:t},bee=ft(null,(t,e,n)=>{const r=u=>{const d=u??Cg;return d.kind==="variant"&&!n.has(Nh(d))},s=t(jh);let i=null;for(const[u,d]of s)r(d.target)&&(i??(i=new Set)).add(u);if(i){const u=new Map(s);for(const d of i)u.delete(d);e(jh,u)}const o=t(P3);o&&r(o.target)&&(e(P3,null),e(Pee,!1));const l=t(A3);l&&(i!=null&&i.has(l.commentId))&&e(A3,null),wee(n)}),Gw=ft(l9),See=ft(!1),d4=ft(null),g9=ft(null),vv=ft(!0),kee=ft(!1),v9=ft(!1),y9=ft(null),Eee=()=>{var t;return typeof window>"u"?null:((t=window.__RIVET_BOOTSTRAP__)==null?void 0:t.agentApplyMode)??null},yv=ft(Eee()),Cee=ft(null),Pee=ft(!1);ft(0);ft(0);function Aee(t){return t==="cursor"?"Cursor":t==="codex"?"Codex":t==="claude-desktop"?"Claude":"Claude Code"}const Tee=["⡡⠊⢔⠡","⠊⡰⡡⡘","⢔⢅⠈⢢","⡁⢂⠆⡍","⢔⠨⢑⢐","⠨⡑⡠⠊"],f4=({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:Tee.map((n,r)=>b.jsx("span",{className:"block",style:{height:"1em",lineHeight:"1em"},children:n},r))})}),_9=({primaryLabel:t,primaryIcon:e,primaryAction:n,isDisabled:r=!1,isDropdownDisabled:s=!1,isLoading:i=!1,loadingLabel:o,dropdownAriaLabel:l="More actions",dropdownItems:u})=>{const[d,f]=m.useState(!1),h=i?o??t:t,g=u.length>0;return b.jsxs("div",{className:"flex items-stretch",children:[b.jsxs("button",{onClick:n,disabled:r||i,className:`bg-main-hover hover:bg-main-input flex h-7 shrink-0 items-center gap-1.5 px-3 text-xs font-medium text-white transition-colors disabled:cursor-not-allowed disabled:opacity-50 ${g?"rounded-l-md":"rounded-md"}`,children:[e?b.jsx(e,{className:"h-3.5 w-3.5",weight:"bold"}):null,h]}),g?b.jsxs(i4,{open:d,onOpenChange:f,children:[b.jsx(o4,{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(pK,{className:"h-3.5 w-3.5",weight:"bold"})})}),b.jsx(a4,{children:b.jsx(l4,{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]})},kc=({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(Yb,{content:t,side:n,sideOffset:r,delayDuration:s,forceOpen:o,children:e}),_v="/__rivet/preview",T3=`${_v}/variant/`,R3=`${_v}/history/`,w9=t=>t?t.startsWith("/")?t:`/${t}`:"/",Ree=t=>`${_v}/variant/${encodeURIComponent(t.sessionId)}/${encodeURIComponent(t.variantId)}${w9(t.routePath)}`,Mee=t=>`${_v}/history/${encodeURIComponent(t.sessionId)}/${encodeURIComponent(t.variantId)}${w9(t.routePath)}`,Iee=t=>{try{const e=new URL(t,"http://localhost");return e.pathname.startsWith(T3)||e.pathname.startsWith(R3)}catch{return t.startsWith(T3)||t.startsWith(R3)}},M3=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")?Ree({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/",x9=t=>{if(!t.startsWith(I3))return null;const e=t.slice(I3.length);return!e||e==="/"?null:`/${e}`},gd=(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(()=>{})},Oee=(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),gd(r,e))}},Ag=(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,b9="original",h4="Original",S9="The original state of your app before any variants were generated.",L3=200,k9="h-6 w-6 rounded",Kw=[.33,1,.68,1],Yw=.22,In=Ms("AgentVariantsPanel"),A_=()=>{var t;(t=window.getSelection())==null||t.removeAllRanges()},vu=t=>{var e;return!!t.hasTree&&((e=t.serve)==null?void 0:e.kind)==="dev-server"},Lee=t=>{var e;return t?t.kind==="existing"?!0:((e=t.executionPlan)==null?void 0:e.mode)==="vite_app":!1};function T_(t,...e){return t?e.some(n=>(n??"").toLowerCase().includes(t)):!0}const Nee=(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},E9=t=>{const e="requestId"in t?["request",t.requestId]:["label",t.runLabel];return`run:${JSON.stringify([t.sessionId,...e])}`},Dee="original",Xw="pinned-section";function C9(t){return`rivet:collapsedRuns:${t}`}function K0(t){try{const e=window.localStorage.getItem(C9(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 R_(t,e){try{window.localStorage.setItem(C9(t),JSON.stringify([...e]))}catch{}}const N3=(t,e)=>{const n=[],r=new Map;for(const s of t){const i=Nee(s,e);let o="";s.kind==="original"?o=Dee:i&&(o=E9(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 Ni(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 jee=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},sh=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")},P9=t=>{var e;return((e=t.previewUnavailable)==null?void 0:e.reason)==="idle_timeout"},$ee=t=>t.status==="succeeded"&&!sh(t)&&(!t.previewUnavailable||P9(t)),M_=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"},D3=(t,e,n)=>{const r=t.includes("?")?"&":"?";return`${t}${r}${encodeURIComponent(e)}=${encodeURIComponent(n)}`},Fee=t=>{var e;return jee(t)&&((e=t.preview)==null?void 0:e.kind)==="static_artifact"},j3=(t,e)=>t.map(n=>`${n.workItemId}:${e[n.workItemId]??""}`).join("|"),Vee=(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}),Hee=()=>{var ra,sa,ri,bp;const t=qg(),e=dt(cp),n=dt(p9),r=m.useRef(!1),s=dt(m9),i=dt(d4),o=dt(vv),l=dt(Gw),u=((ra=l.deployPrototype)==null?void 0:ra.isEnabled)??!1,d=((sa=l.canvasShare)==null?void 0:sa.isEnabled)??!1,f=((ri=l.variantSend)==null?void 0:ri.isEnabled)??!1,h=((bp=l.designContextViewer)==null?void 0:bp.isEnabled)??!1,g=dt(v9),v=dt(y9),w=gt(Bw),_=gt(Pg),x=gt(Zw),S=gt(Ww),k=gt(f9),C=gt(h9),A=gt(md),T=dt(md),I=gt(u4),M=gt(u9);m.useEffect(()=>(M("Directions"),()=>M(null)),[M]);const R=dt(Ko),O=gt(Ko),N=m.useCallback((V=!1)=>{if(Oee(R),O(null),V&&R){const le=Ag("ended",R);Ce.capture(le.event,le.properties)}},[O,R]),D=dt(qw),F=gt(qw),K=dt(Sm),B=gt(Sm),G=K?`${K.sessionId}:${K.variantId}`:null,[H,Y]=m.useState(""),[U,J]=m.useReducer(V=>V+1,0),Z=m.useMemo(()=>i!==null?K0(i):new Set,[i,U]),j=m.useCallback(V=>{if(i===null)return;const le=new Set(K0(i));le.delete(V)||le.add(V),R_(i,le),J()},[i]),[Q,oe]=m.useState(null),[ne,se]=m.useState(null),[de,ve]=m.useState(!1),[ue,ae]=m.useState({}),[Oe,We]=m.useState(null),[Ee,pt]=m.useState({}),[Ot,en]=m.useState(null),[bt,_t]=m.useState([]),qe=m.useRef([]);qe.current=bt;const[Ke,Ct]=m.useState(!1),[Te]=m.useState(()=>PY(window.location.search)),Ye=m.useRef(!1),Lt=m.useRef(!1);Lt.current=Te!==null||K!==null||D!==null||Ke;const Ge=m.useMemo(()=>e.active?e.variants:[],[e]),Pt=m.useMemo(()=>Ge.filter(Fee),[Ge]),as=m.useMemo(()=>j3(Pt,ue),[Pt,ue]),yr=(Oe==null?void 0:Oe.key)===as?Oe.shareUrl:null,Le=e.active?e.sessionId:null,ea=m.useMemo(()=>{const V=new Set;for(const le of Ge)le.adoptedSource&&V.add(`${le.adoptedSource.sessionId}:${le.adoptedSource.variantId}`);return V},[Ge]),Nn=m.useMemo(()=>[...bt.filter(le=>le.sessionId!==Le&&!ea.has(`${le.sessionId}:${le.variantId}`))].sort((le,ke)=>{const fe=new Date(le.createdAt).getTime(),pe=new Date(ke.createdAt).getTime();return(Number.isNaN(pe)?0:pe)-(Number.isNaN(fe)?0:fe)}),[ea,bt,Le]),er=m.useMemo(()=>K?Ge.find(V=>{var le,ke;return((le=V.adoptedSource)==null?void 0:le.sessionId)===K.sessionId&&((ke=V.adoptedSource)==null?void 0:ke.variantId)===K.variantId})??null:null,[K,Ge]),dl=m.useMemo(()=>K?Nn.find(V=>V.sessionId===K.sessionId&&V.variantId===K.variantId)??null:null,[K,Nn]),gn=e.active?e.projectContext:null,vn=(gn==null?void 0:gn.kind)==="fresh"?gn.workspacePath:i,Md=!e.active&&Nn.length>0&&Nn.every(V=>V.projectKind==="fresh"),Is=e.active?Lee(gn):!!i&&!Md,_r=m.useMemo(()=>vn?`?projectPath=${encodeURIComponent(vn)}`:"",[vn]),{pinnedKeys:tr,pinnedKeySet:oo,listOrder:ei,togglePin:Dn,pinItem:Os,reorder:fl}=oee(vn),ao=m.useRef(null),ls=m.useRef(null),Qe=typeof window>"u"?"/":x9(window.location.pathname)??"/",Nt=m.useRef(null),Vt=m.useRef(!1),Wn=m.useCallback((V,le)=>{le.button!==0&&le.pointerType==="mouse"||(le.preventDefault(),A_(),Nt.current={kind:"live",variantId:V,startX:le.clientX,startY:le.clientY,committed:!1})},[]),cs=m.useCallback((V,le)=>{le.button!==0&&le.pointerType==="mouse"||(le.preventDefault(),A_(),Nt.current={kind:"past",entry:V,startX:le.clientX,startY:le.clientY,committed:!1})},[]);m.useEffect(()=>{const V=fe=>{const pe=Nt.current;if(!pe)return;const Se=fe.clientX-pe.startX,et=fe.clientY-pe.startY;if(!pe.committed){if(Se*Se+et*et<O3*O3)return;if(A_(),pe.kind==="live"){const Pe=Ge.find(yn=>yn.workItemId===pe.variantId);if(!Pe||Pe.status!=="succeeded"){Nt.current=null;return}const sn=M3({sessionId:Le,variant:Pe,projectContext:gn,routePath:Qe});A({sessionId:Le??"",variantId:Pe.workItemId,label:Pe.label||"Direction",url:sn,source:"live",runLabel:Pe.runLabel,description:Pe.description})}else{const{entry:Pe}=pe,sn=vu(Pe),yn=sn?Mee({sessionId:Pe.sessionId,variantId:Pe.variantId,routePath:Qe}):`/api/variants/history/${encodeURIComponent(Pe.sessionId)}/${encodeURIComponent(Pe.variantId)}/preview${_r}`;if(A({sessionId:Pe.sessionId,variantId:Pe.variantId,label:Pe.label||"Direction",url:yn,source:sn?"history-dev-server":"history-static",runLabel:Pe.runLabel,description:Pe.brief}),sn){const Tr=D3(`/api/variants/history/${encodeURIComponent(Pe.sessionId)}/${encodeURIComponent(Pe.variantId)}/run${_r}`,"targetAddressed","1");(async()=>{try{if(!(await fetch(Tr,{method:"POST"})).ok)return;const hs=D3(yn,"replay",String(Date.now()));A(ut=>!ut||ut.sessionId!==Pe.sessionId||ut.variantId!==Pe.variantId||ut.source!=="history-dev-server"?ut:{...ut,url:hs}),O(ut=>{if(!ut)return ut;const Ht=si=>!si||si.sessionId!==Pe.sessionId||si.variantId!==Pe.variantId?si:{...si,url:hs};return{...ut,left:Ht(ut.left),right:Ht(ut.right)}})}catch(fs){In.warn("history replay drag boot failed",fs)}})()}}pe.committed=!0}I({x:fe.clientX,y:fe.clientY})},le=()=>{const fe=Nt.current;fe!=null&&fe.committed&&(Vt.current=!0,window.setTimeout(()=>{Vt.current=!1},0)),Nt.current=null,I(null)},ke=fe=>{if(fe.key!=="Escape")return;const pe=Nt.current;pe!=null&&pe.committed&&(pe.kind==="past"&&vu(pe.entry)&&gd({sessionId:pe.entry.sessionId,variantId:pe.entry.variantId,source:"history-dev-server"}),Nt.current=null,A(null),I(null))};return window.addEventListener("pointermove",V),window.addEventListener("pointerup",le),window.addEventListener("pointercancel",le),window.addEventListener("keydown",ke),()=>{window.removeEventListener("pointermove",V),window.removeEventListener("pointerup",le),window.removeEventListener("pointercancel",le),window.removeEventListener("keydown",ke)}},[Ge,Le,gn,Qe,_r,A,I,O]);const Bt=m.useCallback(()=>{var V;(V=Nt.current)!=null&&V.committed&&(Vt.current=!0,window.setTimeout(()=>{Vt.current=!1},0)),Nt.current=null,I(null),T&&(T.source==="history-dev-server"&&gd({sessionId:T.sessionId,variantId:T.variantId,source:"history-dev-server"}),A(null))},[T,A,I]),jn=m.useCallback((V,le)=>{const ke=!oo.has(V);Ce.capture(ke?"variants_panel.direction_pinned":"variants_panel.direction_unpinned",{method:le}),Dn(V)},[oo,Dn]),Hr=m.useCallback(()=>{T&&(Ce.capture("variants_panel.direction_pinned",{method:"drag"}),Os(`row:past:${T.sessionId}:${T.variantId}`),Bt())},[T,Bt,Os]),ti=m.useCallback(V=>{Ce.capture("variants_panel.direction_unpinned",{method:"drag"}),Dn(V),Bt()},[Dn,Bt]),cr=m.useCallback((V,le)=>{fl(V,le),Bt()},[fl,Bt]),Rn=m.useMemo(()=>{var le;if(Ke||G)return null;const V=D?Ge.find(ke=>ke.workItemId===D):null;return D&&!V?null:V?sh(V)?V.workItemId:null:e.active?((le=Ge.find(ke=>{var fe,pe;return sh(ke)&&(((fe=ke.preview)==null?void 0:fe.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]),hl=Ke||Is&&D===null&&G===null&&Rn===null,Pc=m.useCallback(async V=>{var ke,fe,pe,Se;if(!Le)return;const le=(V==null?void 0:V.workItemId)??null;oe({kind:"switch",variantId:le??void 0});try{if(((ke=V==null?void 0:V.preview)==null?void 0:ke.kind)==="static_artifact"){if(x(!1),S(null),((fe=V.refinement)==null?void 0:fe.status)==="succeeded"){const Pe=V.preview.url.includes("?")?"&":"?";_(`${V.preview.url}${Pe}refinement=${encodeURIComponent(V.refinement.workItemId)}`)}else _(V.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=V==null?void 0:V.preview)==null?void 0:Se.kind)!=="dev_server"){x(!1),S(null),_(`/api/variants/${Le}/static/${le}`),w(Pe=>Pe+1);return}const et=V&&le?M3({sessionId:Le,variant:V,projectContext:e.active?e.projectContext:null,routePath:Qe}):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:V?M_(V):"none",hasPreview:!!(V!=null&&V.preview),hasPort:typeof(V==null?void 0:V.port)=="number",errorMessage:"No addressable dev-server preview URL"}),x(!1),S(null)}catch(et){In.warn("preview display failed",et),Ce.capture("variants_panel.preview_display_failed",{sessionId:Le,variantId:le,previewKind:V?M_(V):"none",hasPreview:!!(V!=null&&V.preview),hasPort:typeof(V==null?void 0:V.port)=="number",errorMessage:et instanceof Error?et.message:String(et)}),x(!1),S(null)}finally{oe(null)}},[Le,e,Qe,w,_,x,S]),Ac=m.useRef(!1),Tc=m.useRef(null),Ls=m.useRef(0),lo=m.useCallback(()=>{if(Ls.current++,k(!1),C(!1),!Ac.current)return;const V=Tc.current;Ac.current=!1,Tc.current=null;const le=V?new URLSearchParams({sessionId:V.sessionId,variantId:V.variantId}):null,ke=le?`/api/variants/history/replay/stop?${le.toString()}`:"/api/variants/history/replay/stop";fetch(ke,{method:"POST"}).catch(fe=>In.warn("history replay stop failed",fe))},[k,C]),Id=m.useCallback(async V=>{if(Le){oe({kind:"switch",variantId:V.workItemId});try{const le=await fetch(`/api/variants/${Le}/preview-port`,{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({variantId:V.workItemId})});if(!le.ok){const ke=await Ni(le);throw new Error(ke.message??`Preview restoration failed (${le.status})`)}}catch(le){In.warn("preview restoration failed",le),Ce.capture("variants_panel.preview_display_failed",{sessionId:Le,variantId:V.workItemId,previewKind:"dev_server",hasPreview:!1,hasPort:!1,errorMessage:le instanceof Error?le.message:String(le)})}finally{oe(null)}}},[Le]),Rc=m.useCallback(V=>{var Se,et,Pe,sn,yn;if(Vt.current){Vt.current=!1;return}const le=sh(V),ke=V.status==="pending"||V.status==="running"||$ee(V);lo();const fe=M_(V),pe=Ge.find(Tr=>Tr.workItemId===D);Ce.capture("variants_panel.preview_requested",{sessionId:Le,fromVariantId:pe==null?void 0:pe.workItemId,toVariantId:V.workItemId,variantStatus:V.status,isPreviewReady:le,isArmed:ke,previewKind:fe,hasPreview:!!V.preview,hasPort:typeof V.port=="number",viewEnabled:((et=(Se=V.actions)==null?void 0:Se.view)==null?void 0:et.enabled)??null,previewUnavailableReason:((Pe=V.previewUnavailable)==null?void 0:Pe.reason)??null}),F(V.workItemId),B(null),le?(ls.current=V.workItemId,Ct(!1),N(!0),Pc(V)):(ls.current=null,Ct(!1),_(null),x(!1),ke&&Ce.capture("variants_panel.preview_armed",{sessionId:Le,fromVariantId:pe==null?void 0:pe.workItemId,toVariantId:V.workItemId,variantStatus:V.status,previewKind:fe,hasPreview:!!V.preview,hasPort:typeof V.port=="number",viewEnabled:((yn=(sn=V.actions)==null?void 0:sn.view)==null?void 0:yn.enabled)??null}),P9(V)&&Id(V)),Ce.capture("variants_panel.preview_switched",{sessionId:Le,fromVariantId:pe==null?void 0:pe.workItemId,toVariantId:V.workItemId,armed:ke})},[D,Le,N,F,B,lo,Id,Pc,Ge,_,x]),Od=e.active?`${e.sessionId}:${e.stage}`:"inactive",Mc=m.useRef(!1);m.useEffect(()=>{if(o)return;let V=!1;return(async()=>{try{const le=await fetch(`/api/variants/history${_r}`,{credentials:"same-origin"});if(!le.ok)return;const ke=await le.json();if(V)return;const fe=(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"||vu(pe)});if(!Mc.current&&!Lt.current&&Od==="inactive"&&fe.length>0&&fe.every(pe=>pe.projectKind==="fresh")){const pe=[...fe].sort((Se,et)=>new Date(et.createdAt).getTime()-new Date(Se.createdAt).getTime()).find(Se=>!vu(Se));pe&&(Mc.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${_r}`))}if(B(pe=>{if(!pe)return pe;const Se=fe.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}}),Vee(qe.current,fe))return;qe.current=fe,_t(fe)}catch(le){In.warn("Failed to load past variants",le)}})(),()=>{V=!0}},[o,vn,Od,_r,_,B]);const Ic=m.useCallback(()=>{Ac.current=!1,Tc.current=null,k(!1),C(!1),B(null),F(null),Ct(!0),x(!1),S(null),_(null),w(V=>V+1)},[F,k,C,w,_,S,B,x]),ta=m.useCallback(V=>{if(Vt.current){Vt.current=!1;return}if(N(!0),B({sessionId:V.sessionId,variantId:V.variantId,previewKind:vu(V)?"dev_server":"static",references:V.references,projectPath:vn??void 0}),F(null),Ct(!1),vu(V)){const le=++Ls.current;Ac.current=!0,Tc.current={sessionId:V.sessionId,variantId:V.variantId},k(!0),C(!0),(async()=>{oe({kind:"switch"}),Ce.capture("variants_panel.history_replay_started",{sessionId:V.sessionId,variantId:V.variantId});const ke=fe=>Ce.capture("variants_panel.history_replay_failed",{sessionId:V.sessionId,variantId:V.variantId,...fe});try{const fe=await fetch(`/api/variants/history/${encodeURIComponent(V.sessionId)}/${encodeURIComponent(V.variantId)}/run${_r}`,{method:"POST"});if(le!==Ls.current)return;if(!fe.ok){const{errorCode:pe}=await Ni(fe);In.warn(`history replay failed: HTTP ${fe.status} ${pe??""}`),ke({httpStatus:fe.status,errorCode:pe}),Ic();return}C(!1),x(!0),S(null),_(null),w(pe=>pe+1),Ce.capture("variants_panel.history_replay_ready",{sessionId:V.sessionId,variantId:V.variantId})}catch(fe){if(le!==Ls.current)return;In.warn("history replay failed",fe),ke({errorMessage:fe instanceof Error?fe.message:String(fe)}),Ic()}finally{oe(null)}})();return}lo(),x(!1),S(null),_(`/api/variants/history/${encodeURIComponent(V.sessionId)}/${encodeURIComponent(V.variantId)}/preview${_r}`)},[vn,Ic,oe,k,C,w,B,F,_,S,N,x,lo,_r]);m.useEffect(()=>{if(!Te||Ye.current)return;const V=bt.find(le=>le.sessionId===Te.sessionId&&le.variantId===Te.variantId);V&&(Ye.current=!0,ta(V))},[Te,bt,ta]);const Ld=m.useCallback(async()=>{lo();const V=()=>{N(!0),F(null),B(null),Ct(!0),ls.current=null,x(!1),S(null),_(null),w(le=>le+1)};if(!Le){V();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){In.warn(`switch to original failed: HTTP ${le.status}`);return}V(),x(!0),Ce.capture("variants_panel.preview_switched",{sessionId:Le,fromVariantId:D,toVariantId:null,target:"original",armed:!1})}catch(le){In.warn("preview-port original switch failed",le)}finally{oe(null)}},[D,Le,F,B,w,_,S,N,x,lo]),Pv=m.useCallback(async V=>{var ke,fe;const le=((fe=(ke=V.actions)==null?void 0:ke.commit)==null?void 0:fe.enabled)??V.status==="succeeded";if(!(!Le||!le)){Ce.capture("variants_panel.commit_clicked",{sessionId:Le,variantId:V.workItemId,variantLabel:V.label}),oe({kind:"commit",variantId:V.workItemId});try{const pe=await fetch(`/api/variants/${Le}/commit`,{method:"POST",headers:{"content-type":"application/json"},body:JSON.stringify({variantId:V.workItemId})});if(!pe.ok){const{message:et,errorCode:Pe}=await Ni(pe);In.warn(`commit failed: HTTP ${pe.status} ${Pe??""} ${et??""}`),Ce.capture("variants_panel.commit_failed",{sessionId:Le,variantId:V.workItemId,httpStatus:pe.status,errorCode:Pe??null,errorMessage:et??null}),Mt.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:V.workItemId,payloadKind:(Se==null?void 0:Se.payloadKind)??null,duplicate:(Se==null?void 0:Se.duplicate)??!1}),Mt.success(`Sent "${V.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){In.warn("commit failed",pe),Ce.capture("variants_panel.commit_failed",{sessionId:Le,variantId:V.workItemId,httpStatus:null,errorCode:"NETWORK_ERROR",errorMessage:pe instanceof Error?pe.message:String(pe)}),Mt.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]),tn=m.useCallback(async(V,le,ke)=>{Ce.capture("variants_panel.deploy_clicked",{sessionId:V,variantId:le,variantLabel:ke});try{const fe=await fetch(`/api/variants/${V}/deploy`,{method:"POST",headers:{"content-type":"application/json"},body:JSON.stringify({variantId:le,...i?{projectPath:i}:{}})});if(!fe.ok){const{message:et,errorCode:Pe}=await Ni(fe);return In.warn(`deploy failed: HTTP ${fe.status} ${Pe??""} ${et??""}`),Ce.capture("variants_panel.deploy_failed",{sessionId:V,variantId:le,httpStatus:fe.status,errorCode:Pe??null,errorMessage:et??null}),Mt.error("Couldn't deploy this direction",{description:et??`The server rejected the request (HTTP ${fe.status}). Try again.`}),null}const pe=await fe.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:V,variantId:le}),Mt.success(`"${ke}" is live — link copied`,{action:{label:"Open",onClick:()=>window.open(Se,"_blank","noopener")}}),Se):(Mt.error("Couldn't deploy this direction",{description:"The deploy host returned an unexpected response."}),null)}catch(fe){return In.warn("deploy failed",fe),Ce.capture("variants_panel.deploy_failed",{sessionId:V,variantId:le,httpStatus:null,errorCode:"NETWORK_ERROR",errorMessage:fe instanceof Error?fe.message:String(fe)}),Mt.error("Couldn't deploy this direction",{description:"Network or server error. Check that the Rivet backend is reachable and try again."}),null}},[i]),Av=m.useCallback(async V=>{if(!Le)return;const le=ue[V.workItemId];if(le){await navigator.clipboard.writeText(le).catch(()=>{}),Mt.success("Share link copied",{action:{label:"Open",onClick:()=>window.open(le,"_blank","noopener")}});return}oe({kind:"deploy",variantId:V.workItemId});try{const ke=await tn(Le,V.workItemId,V.label);ke&&ae(fe=>({...fe,[V.workItemId]:ke}))}finally{oe(null)}},[Le,ue,tn]),Nd=m.useCallback(async()=>{if(!(!Le||Pt.length===0)){if(yr){await navigator.clipboard.writeText(yr).catch(()=>{}),Mt.success("Canvas link copied",{action:{label:"Open",onClick:()=>window.open(yr,"_blank","noopener")}});return}Ce.capture("variants_panel.deploy_clicked",{sessionId:Le,variantId:"canvas",variantLabel:"Canvas",variantCount:Pt.length}),oe({kind:"deploy-canvas"});try{const V=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(!V.ok){const{message:Se,errorCode:et}=await Ni(V);In.warn(`canvas deploy failed: HTTP ${V.status} ${et??""} ${Se??""}`),Ce.capture("variants_panel.deploy_failed",{sessionId:Le,variantId:"canvas",httpStatus:V.status,errorCode:et??null,errorMessage:Se??null,variantCount:Pt.length}),Mt.error("Couldn't share this canvas",{description:Se??`The server rejected the request (HTTP ${V.status}). Try again.`});return}const le=await V.json().catch(()=>null),ke=le==null?void 0:le.shareUrl;if(!ke){Mt.error("Couldn't share this canvas",{description:"The deploy host returned an unexpected response."});return}const fe=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(fe).length>0?{...ue,...fe}:ue;pe!==ue&&ae(pe),await navigator.clipboard.writeText(ke).catch(()=>{}),We({key:j3(Pt,pe),shareUrl:ke}),Ce.capture("variants_panel.deploy_succeeded",{sessionId:Le,variantId:"canvas",variantCount:Pt.length}),Mt.success("Canvas is live — link copied",{action:{label:"Open",onClick:()=>window.open(ke,"_blank","noopener")}})}catch(V){In.warn("canvas deploy failed",V),Ce.capture("variants_panel.deploy_failed",{sessionId:Le,variantId:"canvas",httpStatus:null,errorCode:"NETWORK_ERROR",errorMessage:V instanceof Error?V.message:String(V),variantCount:Pt.length}),Mt.error("Couldn't share this canvas",{description:"Network or server error. Check that the Rivet backend is reachable and try again."})}finally{oe(null)}}},[yr,Pt,ue,i,Le]),mp=m.useCallback(async V=>{const le=`${V.sessionId}:${V.variantId}`,ke=Ee[le];if(ke){await navigator.clipboard.writeText(ke).catch(()=>{}),Mt.success("Share link copied",{action:{label:"Open",onClick:()=>window.open(ke,"_blank","noopener")}});return}en(le);try{const fe=await tn(V.sessionId,V.variantId,V.label);fe&&pt(pe=>({...pe,[le]:fe}))}finally{en(null)}},[Ee,tn]),na=m.useCallback(async V=>{if(Le){Ce.capture("variants_panel.remove_clicked",{sessionId:Le,variantId:V.workItemId,variantLabelLength:V.label.length}),oe({kind:"remove",variantId:V.workItemId});try{const le=await fetch(`/api/variants/${Le}/${V.workItemId}/remove`,{method:"POST",headers:{"content-type":"application/json"},body:"{}"});if(!le.ok){const{message:ke}=await Ni(le);In.warn(`remove failed: HTTP ${le.status} ${ke??""}`),Mt.error("Couldn't remove direction",{description:ke??`The server rejected the request (HTTP ${le.status}). Try again.`});return}(V.workItemId===Rn||V.workItemId===D)&&(F(null),_(null),x(!1),w(ke=>ke+1))}catch(le){In.warn("remove failed",le),Mt.error("Couldn't remove direction",{description:"Network or server error. Try again."})}finally{oe(null)}}},[Le,D,Rn,F,_,x,w]),Dd=m.useCallback(async V=>{if(!vn){Mt.error("Couldn't remove direction",{description:"No project path available."});return}Ce.capture("variants_panel.remove_past_clicked",{sessionId:V.sessionId,variantId:V.variantId});const le=`${V.sessionId}:${V.variantId}`,ke=fe=>fe.sessionId===V.sessionId&&fe.variantId===V.variantId;oe({kind:"remove",variantId:le}),_t(fe=>fe.filter(pe=>!ke(pe))),G===le&&(B(null),_(null),x(!1),w(fe=>fe+1));try{const fe=await fetch(`/api/variants/history/${encodeURIComponent(V.sessionId)}/${encodeURIComponent(V.variantId)}/remove`,{method:"POST",headers:{"content-type":"application/json"},body:JSON.stringify({projectPath:vn})});if(!fe.ok){const{message:pe}=await Ni(fe);_t(Se=>Se.some(ke)?Se:[...Se,V]),Mt.error("Couldn't remove direction",{description:pe??`The server rejected the request (HTTP ${fe.status}). Try again.`})}}catch(fe){In.warn("remove past failed",fe),_t(pe=>pe.some(ke)?pe:[...pe,V]),Mt.error("Couldn't remove direction",{description:"Network or server error. Try again."})}finally{oe(null)}},[vn,G,B,_,x,w]),jd=m.useCallback(V=>{se(V)},[]),Oc=m.useCallback(V=>{if(!V.label||!V.run)return;const le=V.rows.flatMap(fe=>fe.kind==="active"?[fe.variant]:[]),ke=V.rows.flatMap(fe=>fe.kind==="past"?[fe.entry]:[]);le.length===0&&ke.length===0||se({kind:"run",label:V.label,variants:le,entries:ke})},[]),Ns=m.useCallback(async()=>{if(!(!ne||de)){ve(!0);try{if(ne.kind==="active")await na(ne.variant);else if(ne.kind==="past")await Dd(ne.entry);else{for(const V of ne.variants)await na(V);for(const V of ne.entries)await Dd(V)}}finally{ve(!1),se(null)}}},[ne,de,na,Dd]),[gp,us]=m.useState(null),[Tv,$d]=m.useState(null),Rv=m.useCallback(V=>{$d(V)},[]),Lc=m.useCallback(()=>{$d(null)},[]),Nc=m.useCallback(async V=>{const le=V.trim();if(le)try{await navigator.clipboard.writeText(le),Mt.success("Copied")}catch{Mt.error("Couldn't copy")}},[]),pl=m.useCallback(async(V,le)=>{$d(null);const ke=le.trim();if(!ke||V.kind==="original")return;if(V.kind==="active"){if(!Le||ke===V.variant.label)return;Ce.capture("variants_panel.rename",{sessionId:Le,variantId:V.variant.workItemId,labelLength:ke.length,past:!1});try{const Se=await fetch(`/api/variants/${Le}/${V.variant.workItemId}/rename`,{method:"POST",headers:{"content-type":"application/json"},body:JSON.stringify({label:ke})});if(!Se.ok){const{message:et}=await Ni(Se);Mt.error("Couldn't rename direction",{description:et??`The server rejected the request (HTTP ${Se.status}). Try again.`})}}catch(Se){In.warn("rename failed",Se),Mt.error("Couldn't rename direction",{description:"Network or server error. Try again."})}return}const{entry:fe}=V;if(ke===fe.label.trim())return;if(!vn){Mt.error("Couldn't rename direction",{description:"No project path available."});return}Ce.capture("variants_panel.rename",{sessionId:fe.sessionId,variantId:fe.variantId,labelLength:ke.length,past:!0});const pe=Se=>Se.sessionId===fe.sessionId&&Se.variantId===fe.variantId;_t(Se=>Se.map(et=>pe(et)?{...et,label:ke}:et));try{const Se=await fetch(`/api/variants/history/${encodeURIComponent(fe.sessionId)}/${encodeURIComponent(fe.variantId)}/rename`,{method:"POST",headers:{"content-type":"application/json"},body:JSON.stringify({label:ke,projectPath:vn})});if(!Se.ok){const{message:et}=await Ni(Se);_t(Pe=>Pe.map(sn=>pe(sn)?{...sn,label:fe.label}:sn)),Mt.error("Couldn't rename direction",{description:et??`The server rejected the request (HTTP ${Se.status}). Try again.`})}}catch(Se){In.warn("rename failed",Se),_t(et=>et.map(Pe=>pe(Pe)?{...Pe,label:fe.label}:Pe)),Mt.error("Couldn't rename direction",{description:"Network or server error. Try again."})}},[Le,vn]),[Dc,Fd]=m.useState(null),Mv=m.useCallback(V=>{Fd(V)},[]),Vd=m.useCallback(()=>{Fd(null)},[]),vp=m.useCallback(async(V,le)=>{if(Fd(null),!V.label||!V.run)return;const ke=V.label,fe=le.trim();if(!fe||fe===ke)return;Ce.capture("variants_panel.rename_run",{runLabelLength:fe.length});const pe="requestId"in V.run?V.run.requestId:void 0,Se=pe?V.key:E9({sessionId:V.run.sessionId,runLabel:fe}),et=Se!==V.key;let Pe=!1,sn=!1;if(i!==null&&et){const ut=K0(i);Pe=ut.has(V.key),sn=ut.has(Se),Pe&&(ut.add(Se),R_(i,ut),J())}const yn=ut=>{if(i===null||!et)return;const Ht=K0(i);ut?Ht.delete(V.key):(Pe?Ht.add(V.key):Ht.delete(V.key),sn?Ht.add(Se):Ht.delete(Se)),R_(i,Ht),J()},Tr=new Set(V.rows.flatMap(ut=>ut.kind==="past"?[`${ut.entry.sessionId}:${ut.entry.variantId}`]:[])),fs=ut=>Tr.has(`${ut.sessionId}:${ut.variantId}`);_t(ut=>ut.map(Ht=>fs(Ht)?{...Ht,runLabel:fe}:Ht));const hs=()=>_t(ut=>ut.map(Ht=>fs(Ht)?{...Ht,runLabel:ke}:Ht));try{const ut=await fetch("/api/variants/runs/rename",{method:"POST",headers:{"content-type":"application/json"},body:JSON.stringify({sessionId:V.run.sessionId,...pe?{requestId:pe}:{},runLabel:ke,label:fe,...vn?{projectPath:vn}:{}})});if(ut.ok)yn(!0);else{const{message:Ht}=await Ni(ut);hs(),yn(!1),Mt.error("Couldn't rename run",{description:Ht??`The server rejected the request (HTTP ${ut.status}). Try again.`})}}catch(ut){In.warn("run rename failed",ut),hs(),yn(!1),Mt.error("Couldn't rename run",{description:"Network or server error. Try again."})}},[vn,i,_t]);m.useEffect(()=>{const V=n&&!r.current;if(r.current=n,ao.current!==Le){const ke=ao.current===null;ao.current=Le;const fe=t.get(Sm);if(V&&Te&&(fe==null?void 0:fe.sessionId)===Te.sessionId&&(fe==null?void 0:fe.variantId)===Te.variantId||(ls.current=null,We(null),_(null),x(!1),S(null),N(),F(null),B(null),Ct(!1),Mc.current=!1,!ke))return}if(G||Ke||!Rn||e.active!==!0||ls.current===Rn)return;const le=Ge.find(ke=>ke.workItemId===Rn);le&&(ls.current=Rn,N(),Pc(le))},[Le,n,Te,t,G,Ke,Rn,e,Ge,Pc,N,F,B,_,S,x]),m.useEffect(()=>{!K||!er||(ls.current=null,B(null),F(er.workItemId),Ct(!1))},[er,K,Le,F,B]),m.useEffect(()=>{!K||er||dl||B(null)},[er,K,dl,Le,B,Nn]),m.useEffect(()=>{const V=H.trim().toLowerCase(),le=[...Ge.map(Pe=>({kind:"active",variant:Pe})),...Nn.map(Pe=>({kind:"past",entry:Pe})),...Is?[{kind:"original"}]:[]],ke=V?le.filter(Pe=>$3(Pe,V)):le,{pinned:fe,unpinned:pe}=F3(H3(N3(ke,Le),ei),tr,Le),Se=[...Z.has(Xw)?[]:fe,...pe.flatMap(Pe=>Pe.key!==""&&Z.has(Pe.key)?[]:Pe.rows)];if(Se.length===0)return;const et=Pe=>{if(KJ())return;if(Pe.key==="Enter"){const Ht=Ge.find(si=>si.workItemId===gp);Ht&&(Pe.preventDefault(),Rc(Ht));return}if(Pe.key!=="ArrowUp"&&Pe.key!=="ArrowDown")return;Pe.preventDefault();const sn=D??Rn;let yn=sn?`live:${sn}`:null;G?yn=`past:${G}`:hl&&(yn=b9);const Tr=yn?Se.findIndex(Ht=>vd(Ht)===yn):-1;let fs;if(Tr===-1?fs=Pe.key==="ArrowDown"?0:Se.length-1:Pe.key==="ArrowDown"?fs=Math.min(Tr+1,Se.length-1):fs=Math.max(Tr-1,0),fs===Tr)return;const hs=Se[fs];hs.kind==="active"?Rc(hs.variant):hs.kind==="past"?ta(hs.entry):Ld();const ut=document.querySelector(`[data-variant-key="${vd(hs)}"]`);ut instanceof HTMLElement&&ut.focus({preventScroll:!0})};return window.addEventListener("keydown",et),()=>window.removeEventListener("keydown",et)},[Ge,Nn,H,Is,Z,tr,ei,Le,D,G,hl,Rn,gp,Rc,ta,Ld]);const ml=Ge.find(V=>V.workItemId===Rn)??null,co=G?Nn.find(V=>`${V.sessionId}:${V.variantId}`===G)??null:null,yp=!!co,Hd=e.active?e.artifacts??[]:[],uo=[...(e.active?Ge:[]).map(V=>({kind:"active",variant:V})),...Nn.map(V=>({kind:"past",entry:V})),...Is?[{kind:"original"}]:[]],zd=H.trim().toLowerCase(),gl=zd?uo.filter(V=>$3(V,zd)):uo,_p=H3(N3(gl,Le),ei),{pinned:wp,unpinned:xp}=F3(_p,tr,Le);let jc=null;T&&(jc=T.source==="live"?`live:${T.variantId}`:`past:${T.sessionId}:${T.variantId}`);const $c=new Set(Ge.map(V=>V.requestId).filter(Boolean)),ni=s.filter(V=>!$c.has(V.requestId)),ds=ni.length>0,Ds=o&&!ds&&uo.length===0;return b.jsxs("div",{className:"flex h-full min-h-0 flex-col",children:[uo.length>0?b.jsx("div",{className:"pt-2 pr-5 pb-1 pl-3",children:b.jsxs("div",{className:"relative",children:[b.jsx(xK,{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:H,onChange:V=>Y(V.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:[ds?b.jsx(rte,{groups:ni}):null,Ds?b.jsx(ste,{}):null,e.active&&uo.length===0&&!ds&&!Ds?b.jsx(ite,{}):null,!e.active&&!ds&&!Ds&&Nn.length===0&&!Is?b.jsx(ote,{isMCPSession:g,mcpEditor:v}):null,uo.length>0&&gl.length===0?b.jsxs("p",{className:"text-content-muted px-1 py-6 text-center text-xs",children:["No directions match “",H.trim(),"”."]}):null,gl.length>0?b.jsx(qee,{groups:xp,pinned:wp,pinnedKeys:oo,draggedRowKey:jc,onDropPin:Hr,onDropUnpin:ti,onTogglePin:jn,onReorder:cr,collapsedRuns:Z,onToggleRun:j,activeVariantId:D??Rn,activePastKey:G,isOriginalSelected:hl,busy:Q,editingKey:Tv,onSelectActive:Rc,onSelectPast:ta,onSelectOriginal:Ld,onActivePointerDown:Wn,onPastPointerDown:cs,onHover:us,onRemove:V=>jd({kind:"active",variant:V}),onRemovePast:V=>jd({kind:"past",entry:V}),onStartRename:Rv,onCommitRename:pl,onCancelRename:Lc,editingRunKey:Dc,onStartRunRename:Mv,onCommitRunRename:vp,onCancelRunRename:Vd,onRemoveRun:Oc,onCopyVariantContext:Nc,activeSessionId:e.active?e.sessionId:null,projectPath:vn}):null,e.active&&h?b.jsx(Jee,{artifacts:Hd}):null]}),yp&&co?b.jsx(Yee,{entry:co,deploying:Ot===G,deployedUrl:G?Ee[G]??null:null,onDeploy:mp,isDeployDisabled:!u}):null,!yp&&e.active?b.jsx(nte,{selectedVariant:ml,busy:Q,onSend:Pv,onDeploy:Av,onDeployCanvas:Nd,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:yr,deployedUrl:ml?ue[ml.workItemId]??null:null}):null,b.jsx(Uee,{target:ne,isConfirming:de,onCancel:()=>se(null),onConfirm:Ns})]})},zee=t=>t.kind==="active"?t.variant.label.trim()||"this direction":t.kind==="run"?t.label.trim()||"this run":t.entry.label.trim()||"this direction",Uee=({target:t,isConfirming:e,onCancel:n,onConfirm:r})=>{if(!t)return null;const s=zee(t),i=t.kind==="run",o=i?t.variants.length+t.entries.length:0,l=i?"Remove run":"Remove direction";return b.jsx(uv,{open:!0,onOpenChange:u=>{!u&&!e&&n()},children:b.jsxs(dv,{children:[b.jsx(fv,{className:"z-max fixed inset-0 bg-black/40"}),b.jsx(hv,{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(pv,{className:"text-content text-base font-medium",children:i?"Remove run?":"Remove direction?"}),b.jsx(mv,{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})]})]})})]})})},vd=t=>t.kind==="active"?`live:${t.variant.workItemId}`:t.kind==="past"?`past:${t.entry.sessionId}:${t.entry.variantId}`:b9,$3=(t,e)=>t.kind==="active"?T_(e,t.variant.label,t.variant.runLabel):t.kind==="past"?T_(e,t.entry.label,t.entry.runLabel,t.entry.brief):T_(e,h4,S9),A9=(t,e)=>t.startsWith("live:")?`row:past:${e??""}:${t.slice(5)}`:`row:${t}`,T9=(t,e)=>A9(vd(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=T9(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}},V3=(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]},H3=(t,e)=>{const n=t.map(r=>{const s=e.rows[r.key];return!s||s.length===0?r:{...r,rows:V3(r.rows,s,vd)}});return V3(n,e.groups,r=>r.key)},Bee=t=>t.length<=L3?t:`${t.slice(0,L3-1)}…`,Zee=(t,e)=>t.kind==="active"?e?`${e}:${t.variant.workItemId}`:null:t.kind==="past"?`${t.entry.sessionId}:${t.entry.variantId}`:null,Wee=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}`},qee=({groups:t,pinned:e,pinnedKeys:n,draggedRowKey:r,onDropPin:s,onDropUnpin:i,onTogglePin:o,onReorder:l,collapsedRuns:u,onToggleRun:d,activeVariantId:f,activePastKey:h,isOriginalSelected:g,busy:v,editingKey:w,onSelectActive:_,onSelectPast:x,onSelectOriginal:S,onActivePointerDown:k,onPastPointerDown:C,onHover:A,onRemove:T,onRemovePast:I,onStartRename:M,onCommitRename:R,onCancelRename:O,editingRunKey:N,onStartRunRename:D,onCommitRunRename:F,onCancelRunRename:K,onRemoveRun:B,onCopyVariantContext:G,activeSessionId:H,projectPath:Y})=>{const U=m.useRef(null),{activeIndex:J,itemRects:Z,sessionRef:j,handlers:Q,registerItem:oe}=n9(U,{snapTolerancePx:5}),[ne,se]=m.useState(!1),[de,ve]=m.useState(!1),ue=u.has(Xw),ae=r!==null,Oe=m.useMemo(()=>{if(!r)return null;const Te=A9(r,H);if(n.has(Te))return{container:$f,key:Te};const Ye=t.find(Lt=>Lt.rows.some(Ge=>vd(Ge)===r));return Ye?{container:P_(Ye.key),key:r}:null},[r,n,t,H]),We=(Oe==null?void 0:Oe.container)===$f,{dropTarget:Ee,onPointerMove:pt,onPointerUp:Ot}=aee({containerRef:U,dragged:Oe,yieldToSelector:We?void 0:"[data-pinned-drop-zone]",restrictToSelector:We?"[data-pinned-drop-zone]":void 0,onReorder:l}),en=J!==null?Z[J]:null,bt=Te=>Te.kind==="active"?Te.variant.workItemId===f:Te.kind==="past"?`${Te.entry.sessionId}:${Te.entry.variantId}`===h:g,_t=(Te,Ye,Lt,Ge)=>{const Pt=vd(Te),as=T9(Te,H);return b.jsx(Kee,{rowKey:Pt,row:Te,index:Ye,isSelected:bt(Te),isEditing:w===Pt,isPinned:n.has(as),onTogglePin:yr=>o(as,yr),reorderContainer:Lt,reorderKey:Lt===$f?as:Pt,isNested:Ge,busy:v,registerItem:oe,onSelectActive:_,onSelectPast:x,onSelectOriginal:S,onActivePointerDown:k,onPastPointerDown:C,onHover:A,onRemove:T,onRemovePast:I,onStartRename:M,onCommitRename:R,onCancelRename:O,onCopyVariantContext:G,activeSessionId:H,projectPath:Y},Pt)};let qe=0;const Ke=Te=>{if(Te.key==="")return Te.rows.map(Pt=>_t(Pt,qe++,P_(Te.key),!1));const Ye=u.has(Te.key),Lt=Ye?null:Te.rows.map(Pt=>_t(Pt,qe++,P_(Te.key),!0)),Ge=Te.label;return b.jsx(Gee,{label:Ge??h4,collapsed:Ye,onToggle:()=>d(Te.key),directionCount:Te.rows.length,isEditing:Ge!==null&&N===Te.key,onStartRename:Ge!==null?()=>D(Te.key):void 0,onCommitRename:Ge!==null?Pt=>F(Te,Pt):void 0,onCancelRename:K,onRemove:Ge!==null?()=>B(Te):void 0,children:Lt},Te.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:Te=>{var Ye;if(We&&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&&Te.clientY>=Ge.top&&Te.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(Cs,{children:en&&b.jsx(Si.div,{className:"bg-hover pointer-events-none absolute z-0 rounded-md",initial:{opacity:0,top:en.top,left:en.left,width:en.width,height:en.height},animate:{opacity:1,top:en.top,left:en.left,width:en.width,height:en.height},exit:{opacity:0,transition:{duration:.06}},transition:{...Lh.fast,opacity:{duration:.08}}},j.current)}),b.jsxs("ul",{className:"relative flex flex-col gap-2",children:[b.jsx(Cs,{initial:!1,children:Ct?b.jsxs(Si.li,{initial:{height:0,opacity:0},animate:{height:"auto",opacity:1},exit:{height:0,opacity:0},transition:{duration:Yw,ease:Kw},"data-pinned-drop-zone":"",className:Ut("overflow-hidden rounded-lg bg-white/[0.012] transition-shadow",ae&&"ring-content-muted/30 ring-1",ae&&ne&&"ring-content-muted/70 bg-white/[0.03]"),onPointerEnter:ae?()=>se(!0):void 0,onPointerLeave:ae?()=>se(!1):void 0,onPointerUp:ae?()=>{se(!1),s()}:void 0,children:[b.jsx("div",{"data-hover-dead-zone":"",children:b.jsxs("button",{type:"button",onClick:()=>d(Xw),"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(Pw,{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(Cs,{initial:!1,children:!ue&&b.jsx(Si.div,{initial:{height:0,opacity:0},animate:{height:"auto",opacity:1},exit:{height:0,opacity:0},transition:{duration:Yw,ease:Kw},className:"overflow-hidden",children:e.length>0?b.jsx("ul",{className:"flex flex-col gap-2",children:e.map(Te=>_t(Te,qe++,$f,!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",We&&"ring-content-muted/30 ring-1",We&&de&&"ring-content-muted/70 bg-white/[0.03]"),onPointerEnter:We?()=>ve(!0):void 0,onPointerLeave:We?()=>ve(!1):void 0,onPointerUp:We?()=>ve(!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(EK,{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(Te=>Ke(Te))})]}):t.map(Te=>Ke(Te))]})]})},R9=({open:t,onOpenChange:e,triggerLabel:n,actions:r})=>{const{containerRef:s,onKeyDown:i}=r9({onDismiss:()=>e(!1)});return b.jsxs(i4,{open:t,onOpenChange:e,children:[b.jsx(kc,{label:n,children:b.jsx(o4,{asChild:!0,children:b.jsx(Qi,{type:"button",variant:"ghost",size:"icon-compact","aria-label":n,onClick:o=>o.stopPropagation(),onPointerDown:o=>o.stopPropagation(),className:k9,children:b.jsx(yK,{size:15,weight:"bold"})})})}),b.jsx(a4,{children:b.jsx(l4,{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))})})]})},Gee=({label:t,collapsed:e,directionCount:n,onToggle:r,isEditing:s=!1,onStartRename:i,onCommitRename:o,onCancelRename:l,onRemove:u,children:d})=>{const f=Ei(),[h,g]=m.useState(!1),v=[...i?[{key:"rename",label:"Rename",icon:b.jsx(YM,{size:13,weight:"bold"}),onSelect:i}]:[],...u?[{key:"remove",label:"Remove",icon:b.jsx(oI,{size:13,weight:"bold"}),onSelect:u}]:[]],w=e?b.jsx(wK,{size:13,weight:"fill",className:"shrink-0 text-sky-400"}):b.jsx(_K,{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(M9,{initial:t,onCommit:o,onCancel:l})})]}),b.jsx(Cs,{initial:!1,children:!e&&b.jsx(Si.ul,{className:"overflow-hidden",children:d},"body")})]}):b.jsxs("li",{className:"overflow-hidden rounded-lg bg-white/[0.012]",children:[b.jsxs("div",{"data-hover-dead-zone":"",className:"group relative",children:[b.jsxs("button",{type:"button",onClick:_=>{if((_.metaKey||_.ctrlKey)&&v.length>0){g(!0);return}f==null||f.capture("variants_panel.folder_toggled",{isCollapsed:!e,directionCount:n}),r()},"aria-expanded":!e,"aria-label":`${e?"Expand":"Collapse"} ${t} directions`,className:"focus-visible:ring-content-muted/40 flex w-full items-center gap-2 px-3 py-2 text-left transition-colors hover:bg-white/[0.03] focus:outline-none focus-visible:ring-1 focus-visible:ring-inset",children:[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",h&&"pointer-events-auto opacity-100"),children:b.jsx(R9,{open:h,onOpenChange:g,triggerLabel:`${t} run actions`,actions:v})})]}),b.jsx(Cs,{initial:!1,children:!e&&b.jsx(Si.ul,{initial:{height:0,opacity:0},animate:{height:"auto",opacity:1},exit:{height:0,opacity:0},transition:{duration:Yw,ease:Kw},className:"overflow-hidden",children:d},"body")})]})},Kee=({rowKey:t,row:e,index:n,isSelected:r,isEditing:s,isPinned:i,onTogglePin:o,reorderContainer:l,reorderKey:u,isNested:d,busy:f,registerItem:h,onSelectActive:g,onSelectPast:v,onSelectOriginal:w,onActivePointerDown:_,onPastPointerDown:x,onHover:S,onRemove:k,onRemovePast:C,onStartRename:A,onCommitRename:T,onCancelRename:I,onCopyVariantContext:M,activeSessionId:R,projectPath:O})=>{var Oe,We;const N=dt(g9),D=m.useRef(null);qJ(h,n,D);const[F,K]=m.useState(!1),B=e.kind==="active",G=e.kind==="original",H=e.kind==="active"?e.variant:null,Y=e.kind==="past"?e.entry:null,U=H?H.status==="succeeded":!0,J=H?sh(H):!0,Z=H!==null&&(H.status==="pending"||H.status==="running"),j=(H==null?void 0:H.status)==="failed",Q=(H==null?void 0:H.status)==="cancelled",oe=H!==null&&(f==null?void 0:f.kind)==="remove"&&f.variantId===H.workItemId,ne=H!==null&&(((Oe=H.refinement)==null?void 0:Oe.status)==="pending"||((We=H.refinement)==null?void 0:We.status)==="running");let se=h4;H?se=H.label||`Direction ${n+1}`:Y&&(se=Y.label.trim()||"Untitled direction");let de=S9;H?de=H.description:Y&&(de=Y.brief);const ve=de?Bee(de):null,ue=Zee(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(M9,{initial:se,onCommit:Ee=>T(e,Ee),onCancel:I}),ve&&b.jsx("span",{className:"text-content-muted mt-1 line-clamp-2 block text-xs leading-snug",children:ve})]})})}):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:H?()=>S(H.workItemId):void 0,onMouseLeave:B?()=>S(null):void 0,children:[b.jsx("div",{role:"button",tabIndex:0,"data-variant-id":H==null?void 0:H.workItemId,"data-variant-key":t,onClick:Ee=>{if(Ee.metaKey||Ee.ctrlKey){K(!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"?J&&_(e.variant.workItemId,Ee):e.kind==="past"&&x(e.entry,Ee))},"aria-pressed":r,"aria-disabled":B?!1:void 0,"aria-busy":Z||ne,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",J&&"cursor-grab active:cursor-grabbing",!J&&"cursor-pointer"),style:J?{touchAction:"none"}:void 0,children:b.jsxs("span",{className:"min-w-0 flex-1",children:[b.jsxs("span",{className:"flex items-center gap-2 pr-12",children:[(Z||ne)&&b.jsx(f4,{className:"text-content-muted shrink-0 text-sm","data-testid":ne&&!Z?"variant-refining":void 0}),b.jsx(kc,{label:"Double-click to rename",disabled:G,children:b.jsx("span",{onDoubleClick:Ee=>{Ee.stopPropagation(),G||A(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:se})}),j&&b.jsx(kc,{label:(H==null?void 0:H.errorMessage)??(H==null?void 0:H.errorCode)??"Failed",disabled:!(H!=null&&H.errorMessage)&&!(H!=null&&H.errorCode),children:b.jsx("span",{className:"shrink-0",children:b.jsx(z3,{label:"Failed"})})}),Q&&b.jsx(z3,{label:"Cancelled"})]}),ve&&b.jsx("span",{className:"text-content-muted mt-0.5 line-clamp-2 block cursor-text text-xs leading-snug select-text",children:ve})]})}),G?null:b.jsx(CY,{references:(H==null?void 0:H.references)??(Y==null?void 0:Y.references),source:B?"active":"history",sessionId:(Y==null?void 0:Y.sessionId)??R,variantId:(Y==null?void 0:Y.variantId)??(H==null?void 0:H.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",F&&"pointer-events-auto opacity-100"),children:[b.jsx(Qi,{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:k9,children:b.jsx(Pw,{weight:i?"fill":"bold"})}),b.jsx(R9,{open:F,onOpenChange:K,triggerLabel:"Direction actions",actions:[...de||ue?[{key:"copy",label:ae,icon:b.jsx(Ah,{size:13,weight:"bold"}),onSelect:()=>M(Wee({label:se,description:de,reference:ue,projectId:N,projectPath:O}))}]:[],{key:"pin",label:i?"Unpin":"Pin",icon:b.jsx(Pw,{size:13,weight:"bold"}),onSelect:()=>o("menu")},...G?[]:[{key:"rename",label:"Rename",icon:b.jsx(YM,{size:13,weight:"bold"}),onSelect:()=>A(t)},{key:"remove",label:"Remove",icon:b.jsx(oI,{size:13,weight:"bold"}),disabled:oe,onSelect:()=>{e.kind==="active"?k(e.variant):e.kind==="past"&&C(e.entry)}}]]})]})]})},M9=({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"})},z3=({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}),Yee=({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(Ah,{size:12,weight:"bold"}):null,o]})]})},Xee={agent_browser:"Browser extracted",cache:"Cached",static:"Bundled catalog",manual:"Manual"},Qee={design_context:"DESIGN.md",source_context:"Source",qa_report:"QA",asset:"Asset"},Jee=({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(ete,{artifact:i,isExpanded:i.id===r,onToggle:()=>s(i.id)},i.id))})]})},ete=({artifact:t,isExpanded:e,onToggle:n})=>{const r=Qee[t.kind],s=t.source?Xee[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(fK,{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(tte,{artifact:t})}):null]})},tte=({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]}),nte=({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 h=t?((R=(M=t.actions)==null?void 0:M.commit)==null?void 0:R.enabled)??t.status==="succeeded":!1,g=h&&e===null,v=(e==null?void 0:e.kind)==="commit"&&e.variantId===(t==null?void 0:t.workItemId),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||!h||e!==null,S=o&&u>0,C=w?"Deploying…":f?"Copy link":"Share",T=_?"Sharing…":d?"Copy canvas link":"Share canvas",I=v?"Applying…":"Apply to project";return b.jsxs("div",{className:"border-main-border bg-main-light flex shrink-0 items-center justify-between gap-3 border-t px-3 py-4",children:[b.jsx("div",{className:"min-w-0",children:t?b.jsxs(b.Fragment,{children:[b.jsx("div",{className:"text-content truncate text-sm font-medium",children:t.label.trim()||"Untitled direction"}),f?b.jsx("div",{className:"text-content-muted text-[11px]",children:"Deployed — share link ready"}):null]}):null}),b.jsxs("div",{className:"flex shrink-0 items-center gap-2",children:[b.jsx(_9,{primaryLabel:C,primaryIcon:f&&!w?Ah:void 0,primaryAction:()=>{t&&r(t)},isDisabled:x,isDropdownDisabled:e!==null,isLoading:w,loadingLabel:"Deploying…",dropdownAriaLabel:"More share actions",dropdownItems:S?[{label:T,icon:d&&!_?Ah: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]})]})},I9=()=>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(f4,{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"})})]})}),rte=({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(I9,{},`${e.requestId}-${r}`)))}),ste=()=>b.jsx("div",{"data-testid":"direction-boot-skeletons",className:"space-y-0.5",children:Array.from({length:3}).map((t,e)=>b.jsx(I9,{},e))}),ite=()=>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."})]}),U3="Try different ways to create a dropdown that feels fluid and dynamic",ote=({isMCPSession:t=!1,mcpEditor:e=null})=>{const[n,r]=m.useState(!1),s=Aee(e),i=t?s:"your coding agent",o=()=>{navigator.clipboard.writeText(U3).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:["“",U3,"”"]}),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(vK,{className:"h-3.5 w-3.5 text-emerald-500",weight:"bold"}):b.jsx(Ah,{className:"h-3.5 w-3.5",weight:"bold"})})]})]})]})},ate="rivet:show-projects",lte=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}},cte=({onClose:t,libraryOrigin:e})=>{const n=Ei(),r=dt(u9),s=dt(d4),i=lte(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(ate,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(mK,{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(kc,{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(bK,{className:"h-4 w-4",weight:"bold"})})})]})},tl=(t,e={})=>window.location.pathname.startsWith("/rivet/library")?ZT(t,e):fetch(t,e),ute=5e3,dte=()=>{const t=window.location.pathname.startsWith("/rivet/library");return uh({queryKey:["rivet-account"],queryFn:async({signal:e})=>{const n=await tl(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:ute,retry:!1})},Tg="rivet_just_signed_in",fte=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"},I_=({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}:{}}}),B3=Ms("useLogin"),hte=2e3,pte=60,Z3="Connecting to Google...",W3="https://rivet-proxy.onrender.com",mte=`<!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>${Z3}</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">${Z3}</div>
140
+ </body>
141
+ </html>`,gte=Tn({success:xh(),authUrl:Xe().optional(),sessionId:Xe().optional(),pollSecret:Xe().optional(),error:Xe().optional(),message:Xe().optional()}),vte=Tn({success:xh(),token:Xe().optional(),refreshToken:Xe().optional(),user:Tn({id:Xe().optional(),email:Xe().optional()}).optional(),error:Xe().optional(),message:Xe().optional()}),yte="/api/auth/install-ref",_te=Tn({installRef:Xe().nullable()}),wte=async()=>{try{const t=await fetch(yte);if(!t.ok)return;const e=_te.safeParse(await t.json());return e.success?e.data.installRef??void 0:void 0}catch{return}},O9=(t="editor_gate",e)=>{const n=Ei(),[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=I_({outcome:"started",authAttemptId:u,entryPoint:t,startedAt:d,now:d});n==null||n.capture(f.event,f.properties);let h=null;try{if(h=window.open("","_blank"),!h)throw new Error("Pop-up blocked. Please allow pop-ups and try again.");try{h.document.open(),h.document.write(mte),h.document.close()}catch(S){B3.warn("Failed to render loading state in auth popup:",S)}const v=await wte(),w=await fetch(`${W3}/api/auth/google/start`,{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({source:"core",...v?{ref:v}:{}})}),_=gte.safeParse(await w.json());if(!_.success)throw new Error("Invalid Google login response");const x=_.data;if(!w.ok||!x.success||!x.authUrl||!x.sessionId||!x.pollSecret)throw new Error(x.error||x.message||"Failed to start Google login");if(h.closed)throw new Error("Sign-in window was closed before Google login started.");h.location.href=x.authUrl;for(let S=0;S<pte;S+=1){if(h.closed)throw new Error("Sign-in window was closed before authentication completed.");const k=await fetch(`${W3}/api/auth/google/token`,{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({session:x.sessionId,pollSecret:x.pollSecret})}),C=vte.safeParse(await k.json());if(!C.success)throw new Error("Invalid Google token response");const A=C.data;if(A.success&&A.token&&((g=A.user)!=null&&g.email)){const T={email:A.user.email,token:A.token,refreshToken:A.refreshToken,userId:A.user.id,...v?{installRef:v}:{}};if(e)await e(T);else if(!(await tl("/api/auth/store",{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify(T)})).ok)throw new Error("Signed in, but failed to store session locally.");h.close(),window.sessionStorage.setItem(Tg,"1");const I=I_({outcome:"completed",authAttemptId:u,entryPoint:t,startedAt:d,now:Date.now()});n==null||n.capture(I.event,I.properties),window.location.reload();return}if(A.error&&A.error!=="Pending")throw new Error(A.error||"Google login failed");await new Promise(T=>setTimeout(T,hte))}throw new Error("Authentication timed out. Please try again.")}catch(v){h&&!h.closed&&h.close();const w=v instanceof Error?v.message:"Failed to start login flow";B3.warn("Login failed:",w);const _=I_({outcome:"failed",authAttemptId:u,entryPoint:t,startedAt:d,now:Date.now(),failureReason:fte(w)});n==null||n.capture(_.event,_.properties),o(w),s(!1)}},[n,t,e]),isStartingLogin:r,loginError:i}},xte=Ms("useIntegrations"),bte=Tn({provider:Xe(),status:Xe(),externalUsername:Xe().nullable(),connectedAt:Xe()}),Ste=Tn({integrations:dd(bte).optional()}),kte=Tn({authUrl:Xe().min(1).optional(),error:Xe().optional()}),Ete=Tn({error:Xe().optional()}),O_=["integrations"],Cte="rivet:connect-result",Pte=t=>typeof t=="object"&&t!==null&&t.type===Cte,Ate=ft(null),q3=async()=>{const t=await tl("/api/integrations");if(!t.ok)throw new Error(`Failed to load integrations (${t.status})`);return Ste.parse(await t.json()).integrations??[]},Tte=()=>{const t=JP(),[e,n]=QT(Ate),r=uh({queryKey:O_,queryFn:q3,staleTime:1e4}),s=m.useCallback(async()=>(await t.invalidateQueries({queryKey:O_,refetchType:"none"}),t.fetchQuery({queryKey:O_,queryFn:q3})),[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 tl(`/api/integrations/${l}/connect`,{method:"POST"}),f=kte.safeParse(await d.json().catch(()=>({}))),h=f.success?f.data:{};if(!d.ok||!h.authUrl)throw u.close(),new Error(h.error||`Could not connect ${l}`);return u.location.href=h.authUrl,await new Promise(g=>{let v=!1,w=null;const _=async(S,k=!1)=>{if(!v){v=!0,window.removeEventListener("message",x),w&&clearInterval(w);try{const A=(await s()).some(T=>T.provider===l&&T.status==="connected");g(k&&A?"connected":S)}catch{g(S)}}},x=S=>{if(Pte(S.data)&&S.data.provider===l){if(S.data.status==="error"){xte.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 tl(`/api/integrations/${l}`,{method:"DELETE"});if(!u.ok){const d=Ete.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}},Dl=({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}:{}}}),up=async(t,e="GET",n)=>{if(window.location.pathname.startsWith("/rivet/library"))return Cz(t,{method:e,body:n});const r=await tl(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},L9=()=>up("/profile"),Rte=t=>uh({queryKey:["cosmos-profile"],queryFn:L9,enabled:t}),Mte=t=>up("/profile/discoveries","POST",{url:t}),Ite=({discoveryId:t,collectionIds:e,runtime:n})=>up("/profile/import-plans","POST",{discoveryId:t,collectionIds:e,runtime:n}),Ote=t=>up("/profile","PATCH",{isEnabled:!0,runtime:t}),Lte=t=>up(`/profile/import-plans/${t.id}/imports`,"POST",{revision:t.revision,isApproved:!0}),Qw=Xe().regex(/^[1-9]\d{0,15}$/).refine(t=>Number.isSafeInteger(Number(t))),Nte=Xe().min(1).max(4096),N9=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)}`}};Xe().max(2048).transform((t,e)=>{try{return N9(t).url}catch(n){return e.addIssue({code:xe.custom,message:n instanceof Error?n.message:"Invalid Cosmos profile URL"}),xz}});const Dte=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("/")}`}},jte=Xe().url().refine(t=>{const e=new URL(t);return e.protocol==="https:"&&e.hostname==="cdn.cosmos.so"&&!e.username&&!e.password&&!e.port}),$te=Tn({id:Qw,title:Xe().min(1).max(500),url:Xe().url().transform(t=>Dte(t).url),children:dd(Qw)}),Fte=Tn({id:Qw,url:Xe().url(),title:Xe().max(1e3),text:Xe().max(1e5),author:Xe().nullable(),owner:Xe().nullable(),sourceUrl:Xe().url().nullable(),images:dd(Tn({url:jte,representation:Zg(["image","video-cover"])})).max(100),unsupportedReason:Xe().optional()}),Vte=Tn({collection:$te,elements:dd(Fte),total:HT().int().nonnegative(),nextCursor:Nte.nullable()});wz("status",[Vte.extend({status:mE("ok")}),Tn({status:mE("error"),message:Xe(),reason:Zg(["rate_limited","provider_unavailable","collection_unavailable"]).optional(),retryAfterMs:HT().nonnegative().optional()})]);const Hte=({isOpen:t,onClose:e,onImported:n})=>{const[r,s]=m.useState(""),[i,o]=m.useState(null),[l,u]=m.useState([]),[d,f]=m.useState(""),[h,g]=m.useState(null),[v,w]=m.useState(null),[_,x]=m.useState(!1),S=m.useRef(0),k=Ei(),C=()=>{S.current+=1,s(""),o(null),u([]),f(""),g(null),w(null),x(!1)},A=()=>{k==null||k.capture("visual_editor_cosmos_modal_closed"),C(),e()},T=async O=>{O.preventDefault(),w(null);let N;try{N=N9(r.trim()).url}catch(F){w(F instanceof Error?F.message:"Invalid Cosmos profile URL");return}k==null||k.capture("visual_editor_cosmos_discovery_started");const D=++S.current;x(!0);try{const F=await Mte(N);if(D!==S.current)return;o(F),u([]),k==null||k.capture("visual_editor_cosmos_discovery_completed",{collection_count:F.collections.length})}catch(F){if(D!==S.current)return;w(F instanceof Error?F.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 Ite({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(!h||!d)return;w(null),k==null||k.capture("visual_editor_cosmos_import_started",{collection_count:h.collectionCount,reference_count:h.referenceCount});const O=++S.current;x(!0);try{if((await L9()).profile.isEnabled||await Ote(d),await Lte(h),k==null||k.capture("visual_editor_cosmos_import_completed",{reference_count:h.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(uv,{open:t,onOpenChange:O=>!O&&A(),children:b.jsxs(dv,{children:[b.jsx(fv,{className:"z-max fixed inset-0 bg-black/60"}),b.jsxs(hv,{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(pv,{className:"text-content text-base font-medium",children:"Connect Cosmos"}),b.jsx(Qi,{onClick:A,title:"Close","aria-label":"Close",variant:"ghost",size:"icon-compact",children:b.jsx(Ob,{className:"h-4 w-4",weight:"bold"})})]}),b.jsxs("div",{className:"space-y-4 p-4",children:[b.jsx(mv,{className:"text-content-subtle text-sm",children:"Add public collections from a Cosmos profile to your design references."}),i?null:b.jsxs("form",{onSubmit:O=>void T(O),className:"space-y-4",children:[b.jsx("label",{className:"text-content block text-sm font-medium",htmlFor:"cosmos-profile-url",children:"Cosmos profile URL"}),b.jsx("input",{id:"cosmos-profile-url",type:"url",required:!0,autoFocus:!0,value:r,onChange:O=>s(O.target.value),placeholder:"https://www.cosmos.so/username",className:"border-main-border bg-main-input text-content placeholder:text-content-muted focus:border-secondary w-full rounded-md border px-3 py-2 text-sm outline-none"}),b.jsx("button",{type:"submit",disabled:_,className:"bg-secondary text-secondary-foreground hover:bg-accent rounded-md px-4 py-2 text-sm font-medium disabled:opacity-50",children:_?"Finding collections…":"Continue"})]}),i&&!h?b.jsxs("div",{className:"space-y-4",children:[b.jsxs("p",{className:"text-content text-sm font-medium",children:["Choose collections from"," ",i.profile.title||i.profile.username]}),b.jsx("div",{className:"border-main-border max-h-60 divide-y overflow-y-auto rounded-md border",children:i.collections.map(O=>b.jsxs("label",{className:"text-content hover:bg-main-light flex cursor-pointer items-center gap-3 px-3 py-2 text-sm",children:[b.jsx("input",{type:"checkbox",checked:l.includes(O.id),disabled:_,onChange:()=>R(O.id)}),b.jsx("span",{className:"min-w-0 flex-1 truncate",children:O.title}),b.jsx("span",{className:"text-content-muted text-xs",children:O.total??"—"})]},O.id))}),i.collections.length===0?b.jsx("p",{className:"text-content-muted text-sm",children:"No public collections found for this profile."}):null,b.jsxs("label",{className:"text-content flex items-center justify-between gap-3 text-sm",children:["Analysis runtime",b.jsxs("select",{value:d,disabled:_,onChange:O=>{const 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,h?b.jsxs("div",{className:"space-y-4 text-sm",children:[b.jsxs("p",{className:"text-content",children:[h.collectionCount," ",h.collectionCount===1?"collection":"collections"," ·"," ",h.referenceCount," ",h.referenceCount===1?"reference":"references"," ·"," ",h.imageCount," ",h.imageCount===1?"image":"images"]}),b.jsx("p",{className:"text-content-subtle",children:h.scopeDisclosure}),b.jsx("p",{className:"text-content-subtle",children:h.usageDisclosure}),b.jsxs("p",{className:"text-content-muted text-xs",children:[h.reusableCount," reusable · ",h.unsupportedCount," ","unsupported · runtime: ",d]}),b.jsx("button",{type:"button",onClick:()=>void M(),disabled:_,className:"bg-secondary text-secondary-foreground hover:bg-accent rounded-md px-4 py-2 text-sm font-medium disabled:opacity-50",children:_?"Starting import…":"Approve and import"}),b.jsx("button",{type:"button",onClick:()=>{k==null||k.capture("visual_editor_cosmos_plan_revised"),g(null)},disabled:_,className:"text-content-muted hover:text-content ml-3 text-sm",children:"Change selection"})]}):null,v?b.jsx("p",{role:"alert",className:"text-sm text-red-300",children:v}):null]})]})]})})},G3=Ms("ConnectorsModal"),zte=[{provider:"x",name:"X",iconClassName:"text-content",icon:b.jsx(nh,{provider:"x"})},{provider:"pinterest",name:"Pinterest",iconClassName:"text-[#e60023]",icon:b.jsx(nh,{provider:"pinterest"})},{provider:"arena",name:"Are.na",iconClassName:"text-content",icon:b.jsx(nh,{provider:"arena"})}],Ute={name:"Cosmos",iconClassName:"text-content",icon:b.jsx(nh,{provider:"cosmos"})},K3=({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})]}),Jw=({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}=Tte(),f=Ei(),[h,g]=m.useState(null),[v,w]=m.useState(!1),_=Rte(t),x=M=>s.find(R=>R.provider===M),S=m.useCallback(M=>{const R=Date.now(),O=Dl({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 K=Dl({action:"connect",outcome:"completed",provider:M,entryPoint:n,durationMs:D});f==null||f.capture(K.event,K.properties);return}const F=Dl({action:"connect",outcome:"failed",provider:M,entryPoint:n,durationMs:D,failureReason:N==="closed"?"popup_closed":"provider_failed"});f==null||f.capture(F.event,F.properties)}).catch(N=>{const D=N instanceof Error?N.message:"Could not connect.",F=Dl({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(F.event,F.properties),G3.warn(`Connect error for ${M}:`,D),Mt.error(D)})},[u,n,f]),k=m.useCallback(M=>{const R=Date.now(),O=Dl({action:"disconnect",outcome:"started",provider:M,entryPoint:n});f==null||f.capture(O.event,O.properties),d(M).then(()=>{const N=Dl({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.",F=Dl({action:"disconnect",outcome:"failed",provider:M,entryPoint:n,durationMs:Date.now()-R,failureReason:"request_failed"});f==null||f.capture(F.event,F.properties),G3.warn(`Disconnect error for ${M}:`,D),Mt.error(D)})},[n,d,f]),C=n==="onboarding",A=(I=_.data)==null?void 0:I.sources.some(M=>M.provider==="cosmos");let T=A?"Connected":"Not connected";return _.isError&&(T="Status unavailable"),_.isPending&&(T="Checking status…"),b.jsxs(b.Fragment,{children:[b.jsx(uv,{open:t,onOpenChange:M=>!M&&e(),children:b.jsxs(dv,{children:[b.jsx(fv,{className:"z-max fixed inset-0 bg-black/40"}),b.jsx(hv,{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(AO,{value:h,children:[b.jsxs("div",{className:"border-main-border bg-main-light flex items-center justify-between rounded-t-lg border-b px-4 py-2",children:[b.jsx(pv,{className:"text-content text-base font-medium",children:"Connect design references"}),b.jsx(Qi,{onClick:e,title:"Close","aria-label":"Close",variant:"ghost",size:"icon-compact",children:b.jsx(Ob,{className:"h-4 w-4",weight:"bold"})})]}),b.jsxs("div",{className:"flex flex-col gap-4 p-4",children:[b.jsx(mv,{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:[zte.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 F=l===M.provider,K=O?"Disconnect":"Connect";return b.jsx(K3,{meta:M,status:D,actionLabel:`${K} ${M.name}`,buttonLabel:F?`${K}ing…`:K,isDisabled:i||F,isHighlighted:r===M.provider,onAction:()=>O?k(M.provider):S(M.provider)},M.provider)}),b.jsx(K3,{meta:Ute,status:T,actionLabel:A?"Add Cosmos profile":"Connect Cosmos",buttonLabel:A?"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(Hte,{isOpen:v,onClose:()=>w(!1),onImported:()=>{_.refetch()}})]})},Y3=({className:t=""})=>b.jsx("span",{"aria-hidden":"true",className:`rivet-skeleton block rounded ${t}`.trim()}),Bte=Ms("SupportTicketModal"),X3=5e3,L_="feedback",Zte=Tn({error:Xe().optional(),details:_z([Xe(),Tn({formErrors:dd(Xe()).optional(),fieldErrors:zT(Xe(),dd(Xe()).optional()).optional()})]).optional()}),Wte=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},qte=async t=>{let e;try{const n=Zte.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=Wte(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}`},Gte=({isOpen:t,onClose:e,contactEmail:n})=>{const r=Ei(),[s,i]=m.useState(""),[o,l]=m.useState(!1),[u,d]=m.useState(null),f=m.useCallback(()=>{i("")},[]),h=m.useCallback(()=>{o||(f(),e())},[o,e,f]),g=m.useCallback(async()=>{const 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(),A=await tl("/api/support/tickets",{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({type:L_,message:x,contactEmail:C||void 0,metadata:{posthogSessionId:S??void 0,posthogDistinctId:k??void 0,appVersion:"0.21.2",appEnvironment:"production",pageUrl:window.location.href,userAgent:navigator.userAgent,submittedAt:new Date().toISOString()}})});if(!A.ok){const T=await qte(A);throw new Error(T)}r==null||r.capture("support_ticket_submitted",{ticket_type:L_,has_posthog_session_id:!!S}),Mt.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:L_,error:k}),Bte.error("Failed to submit support ticket:",k),Mt.error("Could not send feedback",{description:k})}finally{l(!1)}}},[n,o,s,e,r,f]),v=m.useCallback(x=>{x.key==="Enter"&&(x.metaKey||x.ctrlKey)&&(x.preventDefault(),g())},[g]),w=X3-s.length,_=o||s.trim().length===0;return b.jsx(uv,{open:t,onOpenChange:x=>!x&&h(),children:b.jsxs(dv,{children:[b.jsx(fv,{className:"z-max fixed inset-0 bg-black/40"}),b.jsx(hv,{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(AO,{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(pv,{className:"text-content text-base font-medium",children:"Send feedback"}),b.jsx(Qi,{onClick:h,disabled:o,title:"Close","aria-label":"Close",variant:"ghost",size:"icon-compact",children:b.jsx(Ob,{className:"h-4 w-4",weight:"bold"})})]}),b.jsxs("div",{className:"flex flex-col gap-3 p-4",children:[b.jsx(mv,{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:X3,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(Qi,{onClick:g,disabled:_,title:"Send feedback",shortcut:"⌘↵","aria-label":"Send feedback",size:"icon-compact",children:o?b.jsx(ev,{className:"h-5 w-5 animate-spin",weight:"bold"}):b.jsx(hK,{className:"h-5 w-5",weight:"bold"})})]})]})]})]})]})})]})})},Kte=Ms("ProfileAvatar"),D9=(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):""},Yte=(t,e)=>D9(t,e).charAt(0).toUpperCase(),Xte=({className:t="",side:e="bottom",align:n="end"})=>{var K,B,G;const r=dte(),s=((K=r.data)==null?void 0:K.name)??null,i=((B=r.data)==null?void 0:B.email)??null,o=((G=r.data)==null?void 0:G.isAuthenticated)===!0,l=Ei(),{startLogin:u,isStartingLogin:d,loginError:f}=O9("account_menu"),[h,g]=m.useState(!1),[v,w]=m.useState(!1),[_,x]=m.useState(!1),[S,k]=m.useState(!1),{containerRef:C,onKeyDown:A,onCloseAutoFocus:T}=r9({onDismiss:()=>F(!1)}),I=Yte(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(Y3,{className:"h-8 w-8 rounded-full"}),b.jsx(Y3,{className:"h-3.5 w-16"})]});const M=D9(s,i),R=(s==null?void 0:s.trim())||null,O=(i==null?void 0:i.trim())||null,N=async()=>{k(!0);try{const H=await tl("/api/auth/logout",{method:"POST",credentials:"same-origin"});if(!H.ok)throw new Error(`Logout failed: ${H.status}`);window.location.pathname.startsWith("/rivet/library")&&BT()}catch(H){Kte.warn("Logout request failed",H),Mt.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 F=H=>{g(H),l==null||l.capture(`visual_editor_account_menu_${H?"opened":"closed"}`,{is_authenticated:o})};return b.jsxs(b.Fragment,{children:[b.jsxs(i4,{open:h,onOpenChange:F,children:[b.jsx(o4,{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(CK,{className:"h-4 w-4",weight:"bold"})}),b.jsx("span",{className:"max-w-[8rem] truncate text-sm font-medium",children:D})]})}),b.jsx(a4,{children:b.jsxs(l4,{"data-rivet-private":!0,ref:C,onKeyDown:A,onCloseAutoFocus:T,role:"menu",className:"ph-no-capture bg-popover shadow-surface-4 z-[60] min-w-[180px] rounded-lg p-1",side:e,sideOffset:6,align:n,children:[R||O?b.jsxs("div",{className:"border-main-border border-b px-3 py-2",children:[R?b.jsx("div",{className:"text-content truncate text-sm font-medium",children:R}):null,O?b.jsx("div",{className:"text-content-muted truncate text-xs",children:O}):null]}):null,b.jsxs("button",{type:"button",role:"menuitem","data-menu-item":!0,onClick:()=>{F(!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(sI,{className:"h-4 w-4",weight:"bold"}),"Connect design references"]}),b.jsxs("button",{type:"button",role:"menuitem","data-menu-item":!0,onClick:()=>{F(!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(gK,{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(kK,{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(SK,{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(Jw,{isOpen:!0,onClose:()=>w(!1)}):null,b.jsx(Gte,{isOpen:_,onClose:()=>x(!1),contactEmail:i??void 0})]})},Qte=({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(cte,{onClose:t,libraryOrigin:e}),b.jsx("div",{className:"flex min-h-0 flex-1 flex-col",children:b.jsx(Hee,{})}),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(Xte,{side:"top",align:"start"})})]});async function Jte(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 Q3=Ms("useServerConfig"),j9=[250,500,1e3,2e3,4e3],J3=j9.length+1,ene=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}},tne=()=>{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 Jte(ene,{delaysMs:j9,onRetry:(u,d,f)=>{Q3.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),Q3.warn("Error fetching server config:",l),l}finally{r(!1)}},[]);return{config:t,fetchConfig:o,isLoading:n,error:s}},nne="#1C1C20",So=[118,118,124],eP=.85,rne=3,sne=.15,Y0=36,ine=4.4,one=.7,ane=3.5,lne=.8,tP=9,cne=11,une=[1.35,1.12,.95,.85],dne=[0,1.1,2.3,3.1],fne=[0,.35,.16,.13],hne=[.9,.5,.4,.35],jl=3,N_=[[{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}]],X0=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},km=t=>{const e=Math.min(1,Math.max(0,t));return e*e*(3-2*e)},$l=(t,e)=>(Math.round(t/e-.5)+.5)*e,pne=Math.sin(Math.PI/3),nP=(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*pne;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()},mne=(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)-tP}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)-tP}return km(.5-r/(2*cne))},$9=({className:t="",trackGlobalLoaderCount:e=!0})=>{const n=gt(d9),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,h=Y0,g=Y0,v=null,w=null,_=0,x=-1;const S=new Array(33),k=D=>{const F=Math.round(D*32);let K=S[F];if(!K){const B=F/32,G=Math.round(So[0]+(255-So[0])*B),H=Math.round(So[1]+(255-So[1])*B),Y=Math.round(So[2]+(255-So[2])*B);K=`rgba(${G}, ${H}, ${Y}, ${eP})`,S[F]=K}return K},C=D=>{const F=1-.35*D,K=Math.round(So[0]*F),B=Math.round(So[1]*F),G=Math.round(So[2]*F);return`rgba(${K}, ${B}, ${G}, ${eP})`},A=D=>{let F=Math.floor(Math.random()*N_.length);F===x&&(F=(F+1)%N_.length),x=F;const K=[0,0,0,0],B=N_[F].map((j,Q)=>{const oe=j.level,ne=K[oe]++,se=dne[oe]+ne*fne[oe],de=hne[oe]+X0(F*131+Q*17+5)*.2;if(j.hline){const ae=$l((j.y??0)*f,g);return{hline:!0,x1:$l(j.x1*d,h),x2:$l(j.x2*d,h),y1:ae,y2:ae,level:oe,start:se,dur:de}}const ve=$l(j.x1*d,h),ue=$l((j.y1??0)*f,g);return{hline:!1,x1:ve,y1:ue,x2:Math.max($l(j.x2*d,h),ve+h),y2:Math.max($l((j.y2??0)*f,g),ue+g),level:oe,start:se,dur:de}}),G=B.reduce((j,Q)=>Math.max(j,Q.start+Q.dur),0),H=u.length,Y=new Float32Array(H*jl),U=new Int16Array(H*jl).fill(-1),J=new Uint8Array(H),Z=B[0];for(let j=0;j<H;j++){const Q=u[j];Q.x>Z.x1&&Q.x<Z.x2&&Q.y>Z.y1&&Q.y<Z.y2&&(J[j]=1);const oe=j*jl;for(let ne=0;ne<B.length;ne++){const se=mne(Q.x,Q.y,B[ne]);if(se<=.02)continue;let de=oe;for(let ve=oe;ve<oe+jl;ve++){if(U[ve]===-1){de=ve;break}Y[ve]<Y[de]&&(de=ve)}(U[de]===-1||se>Y[de])&&(Y[de]=se,U[de]=ne)}}return{startT:D,buildEnd:G,els:B,frame:Z,cellQ:Y,cellEl:U,inFrame:J}},T=()=>{const D=i.getBoundingClientRect();d=Math.max(1,D.width),f=Math.max(1,D.height);const F=Math.min(2,window.devicePixelRatio||1);i.width=Math.round(d*F),i.height=Math.round(f*F),o.setTransform(F,0,0,F,0,0);const K=Math.max(8,Math.round(d/Y0)),B=Math.max(6,Math.round(f/Y0));h=d/K,g=f/B,u=[];for(let G=0;G<B;G++){const H=B>1?G/(B-1):.5,Y=ine*(1+one*.4*(H*2-1));for(let U=0;U<K;U++){const J=G*8191+U*131+1,Z={x:(U+.5)*h,y:(G+.5)*g,size:Y,seed:J,phase:X0(J),kind:0};Z.kind=Math.floor(X0(J*97)*3),u.push(Z)}}w=null,v=null},I=new Float32Array(32),M=D=>{o.fillStyle=nne,o.fillRect(0,0,d,f),v||(v=A(D+.2)),D>=v.startT+v.buildEnd+ane&&(w=v,_=D,v=A(D+.2));let F=0;w&&(F=1-km((D-_)/lne),F<=0&&(w=null));const K=v;for(let Z=0;Z<K.els.length;Z++){const j=K.els[Z];I[Z]=km(Math.min(1,Math.max(0,(D-K.startT-j.start)/j.dur)))}const B=I[0],G=C(0),H=C(B),Y=F>0?C(F):G,U=F>0?C(Math.max(B,F)):H,J=u.length;for(let Z=0;Z<J;Z++){const j=u[Z];let Q=0,oe=0;const ne=Z*jl;for(let We=ne;We<ne+jl;We++){const Ee=K.cellEl[We];if(Ee<0)break;const pt=K.cellQ[We]*I[Ee];pt>Q&&(Q=pt,oe=K.els[Ee].level)}if(w)for(let We=ne;We<ne+jl;We++){const Ee=w.cellEl[We];if(Ee<0)break;const pt=w.cellQ[We]*F;pt>Q&&(Q=pt,oe=w.els[Ee].level)}const se=D/rne+j.phase,de=Math.floor(se),ve=se-de,ue=km(Math.min(ve,1-ve)/sne),ae=Math.floor(X0(j.seed*97+de*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 We=K.inFrame[Z]===1,Ee=w?w.inFrame[Z]===1:!1;We?o.fillStyle=Ee?U:H:o.fillStyle=Ee?Y:G;const pt=Math.max(We?B:0,Ee?F:0);nP(o,j.kind,j.x,j.y,j.size*Oe*(1-.2*pt))}else{o.fillStyle=k(Q);const We=1+(une[oe]-1)*Q;nP(o,j.kind,j.x,j.y,j.size*Oe*We)}}};T();let R=0;if(l)v=A(-100),M(0);else{const D=performance.now(),F=K=>{M((K-D)/1e3),R=requestAnimationFrame(F)};R=requestAnimationFrame(F)}const O=new ResizeObserver(()=>{T(),l&&(v=A(-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()})},gne=async(t=null)=>{if(t)return vne(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 Q0();if(!e.ok)return{isOk:!1,unavailableReason:"rivet_unreachable",upstreamStatus:null};let r;try{r=await e.json()}catch{return Q0()}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}:Q0()},F9=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}}},vne=t=>F9(t),Q0=()=>F9("/"),D_=Ms("usePreviewUpstreamHealth"),yne=500,_ne=4e3,wne=15e3,xne=3,bne=(t,e={})=>{const n=m.useRef(null),r=m.useRef(null),s=e.probeMsWhileDown??yne,i=e.probeMsWhileUp??_ne,o=e.firstUnreachableCaptureAfterMs??wne,l=e.rerunProbeImmediatelyOnVersion,u=e.probePath??null,d=e.skip??!1,f=m.useRef(e.onPersistentUpstreamServerErrors);f.current=e.onPersistentUpstreamServerErrors;const[h,g]=m.useState(t==="static"),[v,w]=m.useState(0),[_,x]=m.useState(null),[S,k]=m.useState(0),[C,A]=m.useState(!1),[T,I]=m.useState(!1),[M,R]=m.useState(t==="static"?null:"upstream_unreachable");return m.useEffect(()=>{if(t==="static"){g(!0),x(null),k(0),A(!1),I(!0),R(null);return}if(d){g(!1),x(null),k(0),A(!1),I(!0),R("upstream_unreachable"),n.current=null;return}let O=!0;const N=Date.now();x(N),k(0),A(!1),g(!1),I(!1),R("upstream_unreachable");const D={current:!1},F={current:!1},K={current:!1},B={current:null},G={current:!1},H={current:!1},Y={current:0},U={current:!1},J={current:null};let Z=null;const j=()=>{K.current||(K.current=!0,O&&I(!0))},Q=()=>{Z!==null&&(clearTimeout(Z),Z=null)},oe=(se,de)=>{Q(),Z=setTimeout(de,se)},ne=async()=>{var pt;if(!O)return;k(Ot=>Ot+1);const{isOk:se,unavailableReason:de,upstreamStatus:ve}=await gne(u);if(!O)return;j(),J.current=ve;const ue=se&&ve!==null&&ve>=500;ue&&H.current?Y.current+=1:se&&!ue&&(Y.current=0);const ae=Y.current>=xne;if(ae&&!U.current&&ve!==null&&(U.current=!0,Ce==null||Ce.capture("preview_upstream_error_responses",{framework:t,upstream_status:ve,consecutive_count:Y.current}),D_.warn(`Preview upstream is listening but has served ${Y.current} consecutive ${ve} responses`),(pt=f.current)==null||pt.call(f,{upstreamStatus:ve,consecutiveCount:Y.current})),se&&!ae){ue||(H.current=!0,U.current=!1);const Ot=!G.current;G.current=!0,g(!0),R(null),B.current=null,F.current=!1,A(!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,ne);return}const We=G.current;G.current=!1,g(!1),R(de),B.current===null&&(B.current=Date.now(),F.current=!1,A(!1)),We&&(Ce==null||Ce.capture("preview_upstream_lost",{framework:t,upstream_status:ve}),w(Ot=>Ot+1),D_.warn("Preview upstream became unavailable after it was ready"));const Ee=Date.now()-B.current;Ee>=o&&!F.current&&(F.current=!0,A(!0),Ce==null||Ce.capture("preview_dev_server_unreachable",{framework:t,elapsed_ms:Ee,upstream_status:J.current}),D_.warn("Dev server did not become ready within timeout window")),oe(s,ne)};return n.current=()=>oe(0,ne),oe(0,ne),()=>{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:h,iframeRemountKey:v,probeStartedAt:_,probeAttemptCount:S,isFirstUnreachableWindowExceeded:C,initialProbeComplete:T,unavailableReason:M}};function Sne(t){return t.enteringSplit&&t.isExistingSession&&t.hasActiveVariantProxy}const V9=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}`},H9=({agentApplyMode:t,url:e})=>e.startsWith("/")?`${V9(t)}${e}`:e,kne="allow-scripts allow-same-origin allow-forms allow-popups allow-modals",Ene=t=>kne,Cne=Ms("PreviewSurface"),rP=(t,e)=>t==="about:blank"?"blank":t.includes("/api/variants/")?"static_artifact":e.kind==="variant"?"dev_server":"original",z9=({target:t,src:e,framework:n,remountKey:r})=>(dt(yv),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:Ene(),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:rP(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:rP(e,t),framework:n})),Cne.warn("Preview iframe failed to load",{framework:n,src:e})}},r)})),Pne=m.lazy(()=>XP(()=>Promise.resolve().then(()=>lse),void 0)),Ane={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"},Tne={sm:"text-lg font-semibold text-content",md:"text-2xl font-semibold text-content",lg:"text-3xl font-semibold text-content"},Rne={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"},ju=({backdrop:t,media:e,title:n,description:r,actions:s,tone:i="neutral",fill:o="surface",size:l="md",children:u,state:d,role:f="status",busy:h=!1,className:g=""})=>{const v=m.useCallback(_=>{_&&d&&(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:`${Ane[o]} ${g}`.trim(),role:f,"aria-live":"polite","aria-busy":h||void 0,"data-state":d,children:[t?b.jsx("div",{className:"absolute inset-0",children:t}):null,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:Tne[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:Rne[_.variant??"neutral"],children:_.label},_.label))}):null]}):null]})},ex=({loader:t="coalesce",trackGlobalLoaderCount:e,size:n="lg",...r})=>t==="coalesce"?b.jsx(ju,{...r,size:n,busy:!0,backdrop:b.jsx($9,{trackGlobalLoaderCount:e})}):t==="logo"?b.jsx(ju,{...r,size:n,busy:!0,backdrop:b.jsx(m.Suspense,{fallback:null,children:b.jsx(Pne,{className:"absolute inset-0"})})}):b.jsx(ju,{...r,size:n,busy:!0,media:b.jsx(ev,{"aria-hidden":!0,className:"text-content h-8 w-8 shrink-0 animate-spin",weight:"bold"})}),U9=({icon:t,...e})=>b.jsx(ju,{...e,tone:"neutral",media:t?b.jsx("div",{className:"text-content-muted",children:t}):void 0}),p4=t=>b.jsx(ju,{...t,tone:"error",role:"alert"}),sP="/static/",Mne=t=>{try{return new URL(t,"http://localhost").pathname.endsWith(sP)}catch{return t.endsWith(sP)}},Ine=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.",One=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:Ine(t.previewUnavailable.reason),detail:t.previewUnavailable.portInUse?"The preview port was already in use.":void 0,isError:!0}:null,Lne=({issue:t,retryTarget:e})=>{const n=Ei(),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=Tn({message:Xe().optional()}).safeParse(await d.json().catch(()=>({}))),h=f.success?f.data:{};throw new Error(h.message??"The preview could not restart. Try again.")}}catch(d){l(d instanceof Error?d.message:"The preview could not restart. Try again.")}finally{r.current=!1,i(!1)}}};return b.jsxs(ju,{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]})},Nne=({isInteractionDisabled:t=!1,framework:e,userPort:n})=>{var _t;const r=dt(Bw),s=gt(Bw),i=dt(Pg),o=gt(Pg),l=dt(cp),u=dt(yv),d=dt(Zw),f=dt(Ww),h=dt(f9),g=dt(h9),v=gt(Ww),w=dt(Ko),_=dt(Sm),x=gt(Zw),S=l.active&&l.projectContext.kind==="fresh",k=dt(qw),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,A=l.active&&l.variants.some(qe=>qe.status==="pending"||qe.status==="running"),T=S||A,I=l.active?l.variants.find(qe=>qe.workItemId===k)??null:null,M=I?One(I):null,R=e==="static"&&i!==null&&Mne(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||!Sne({enteringSplit:Ke,isExistingSession:l.active&&l.projectContext.kind==="existing",hasActiveVariantProxy:d&&f!==null})||(x(!1),v(null),s(Te=>Te+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",Te=Ke.some(Ge=>{var Pt,as;return((Pt=Ge.refinement)==null?void 0:Pt.status)==="pending"||((as=Ge.refinement)==null?void 0:as.status)==="running"});if(!Ct&&!Te)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,F=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]),K=m.useMemo(()=>{if((_==null?void 0:_.previewKind)==="static")return{kind:"variant",sessionId:_.sessionId,variantId:_.variantId};if(!l.active)return Cg;if(F)return{kind:"variant",sessionId:l.sessionId,variantId:F.workItemId};if(D){const Ke=D.match(/\/__rivet\/preview\/variant\/([^/]+)\/([^/?#]+)/),Ct=Ke!=null&&Ke[1]?decodeURIComponent(Ke[1]):null,Te=Ke!=null&&Ke[2]?decodeURIComponent(Ke[2]):null;if(Ct===l.sessionId&&Te&&l.variants.some(Ge=>Ge.workItemId===Te))return{kind:"variant",sessionId:l.sessionId,variantId:Te};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}:Cg},[_,F,l,d,f,D,w,S,k]),B=m.useRef(null);m.useEffect(()=>{var Te,Ye;if(!F||((Te=F.preview)==null?void 0:Te.kind)!=="static_artifact"||((Ye=F.refinement)==null?void 0:Ye.status)!=="succeeded")return;const qe=`${F.workItemId}:${F.refinement.workItemId}`;if(B.current===qe)return;B.current=qe;const Ke=F.preview.url.includes("?")?"&":"?",Ct=`${F.preview.url}${Ke}refinement=${encodeURIComponent(F.refinement.workItemId)}`;D!==Ct&&(o(Ct),s(Lt=>Lt+1))},[D,F,s,o,l]);const G=D!==null&&Iee(D),H=D!==null&&!G||S&&!d&&!G,{isUpstreamReady:Y,iframeRemountKey:U,probeAttemptCount:J,initialProbeComplete:Z}=bne(e,{rerunProbeImmediatelyOnVersion:r,probePath:G?D:null,skip:H}),[j,Q]=m.useState(()=>h&&Y?r:null),oe=m.useRef(null);m.useEffect(()=>{if(!h){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:J};return}Y&&J>qe.probeAttemptCount&&(oe.current=null,Q(r))},[j,r,h,J,Y]);const se=D!==null&&!G||Y,ve=g||h&&j!==r||h&&!se,ue=`${U}:${r}`,ae=x9(window.location.pathname),Oe=e==="static"?`/static${ae??"/"}`:ae??"/",We=V9(u);let Ee=null;D&&(Ee=H9({agentApplyMode:u,url:D}));const Ot=C||M||ve?"about:blank":(G&&!se?"about:blank":Ee)??(se?`${We}${Oe}`:"about:blank"),en=!!C||!!M||!se&&Z;let bt=null;if(ve)bt=b.jsx(ex,{fill:"overlay",loader:"coalesce",trackGlobalLoaderCount:!1,state:"preview_replay_boot"});else if(C)bt=b.jsx(ex,{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(Lne,{issue:M,retryTarget:qe},I==null?void 0:I.workItemId)}else en&&(bt=T?b.jsx(U9,{fill:"overlay",state:"preview_no_selection",title:"Nothing to preview yet",description:"Pick a direction from the panel."}):b.jsx(p4,{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(z9,{target:K,src:Ot,framework:e,remountKey:ue})]})})};function iP({side:t,sessionId:e,variantId:n,url:r,label:s,source:i,isFallback:o=!1}){var C;const l=dt(Ko),u=gt(Ko),d=Ei(),f=dt(cp),h=dt(yv),g=m.useRef(!1),v=m.useCallback(()=>{g.current||(g.current=!0,gd({source:i,sessionId:e,variantId:n}))},[i,e,n]),w=m.useCallback(()=>{if(o){u(null);const M=Ag("ended",l);d==null||d.capture(M.event,M.properties);return}v();const A={...l};delete A[t];const T=A.left||A.right?A:null;u(T);const I=Ag(T?"updated":"ended",T??l);d==null||d.capture(I.event,I.properties)},[o,d,u,t,l,v]),_=m.useMemo(()=>({kind:"variant",sessionId:e,variantId:n}),[e,n]),x=m.useMemo(()=>!f.active||f.sessionId!==e?null:f.variants.find(A=>A.workItemId===n)??null,[e,n,f]),S=m.useMemo(()=>{var T,I;let A=r;if(((T=x==null?void 0:x.preview)==null?void 0:T.kind)==="static_artifact"&&((I=x.refinement)==null?void 0:I.status)==="succeeded"){const M=x.preview.url.includes("?")?"&":"?";A=`${x.preview.url}${M}refinement=${encodeURIComponent(x.refinement.workItemId)}`}return H9({agentApplyMode:h,url:A})},[h,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(kc,{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(z9,{target:_,src:S,framework:"static",remountKey:k})})]})}function Dne(){const t=dt(md),e=dt(u4);return!t||!e?null:ip.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 jne(){const t=dt(md),e=dt(u4),n=dt(Ko),r=gt(md),s=gt(Ko),i=Ei(),o=m.useRef(null),[l,u]=m.useState(null),[d,f]=m.useState("hidden");m.useEffect(()=>{t||(f("hidden"),u(null))},[t]);const h=m.useCallback((v,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=h(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,h]),m.useEffect(()=>{if(!t)return;const v=w=>{const _=h(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)&&gd(S);const k={...n??{},[_]:x};s(k);const C=Ag(n?"updated":"started",k);i==null||i.capture(C.event,C.properties),f("exiting"),window.setTimeout(()=>r(null),220)}else gd(t),f("exiting"),window.setTimeout(()=>r(null),220)};return window.addEventListener("pointerup",v),window.addEventListener("pointercancel",v),()=>{window.removeEventListener("pointerup",v),window.removeEventListener("pointercancel",v)}},[t,h,i,r,s,n]),!t)return null;const g=["variant-drop-zones",d==="visible"&&"is-visible",d==="exiting"&&"is-exiting"].filter(Boolean).join(" ");return b.jsxs("div",{ref:o,className:g,"aria-hidden":"true",children:[b.jsx(oP,{side:"left",hovered:l==="left",canDrop:!!t.url,label:t.label}),b.jsx(oP,{side:"right",hovered:l==="right",canDrop:!!t.url,label:t.label})]})}function oP({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 B9=(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)}`},aP=(t,e)=>{if(!t)return;const n=B9(e,t.sessionId,t.variantId);return!n||n===t.url?t:{...t,url:n}},$ne=()=>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($9,{trackGlobalLoaderCount:!1})})}),Fne=({isLoading:t=!1,isInteractionDisabled:e=!1})=>{const{config:n,fetchConfig:r,isLoading:s,error:i}=tne();return m.useEffect(()=>{r().catch(o=>{Ce==null||Ce.capture("preview_config_load_failed",{message:o instanceof Error?o.message:"unknown_error",attempts:J3})})},[r]),s?b.jsx($ne,{}):i||!n?b.jsx(p4,{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:J3})})}}]}):b.jsx(Vne,{isLoading:t,isInteractionDisabled:e,framework:n.framework,userPort:n.userPort})};function Vne(t){const e=dt(Ko),n=dt(md),r=dt(cp),s=dt(Pg),i=e==null?void 0:e.left,o=e==null?void 0:e.right,l=m.useMemo(()=>{var T,I;if(!r.active||r.projectContext.kind!=="fresh"||!(!!i!=!!o))return;const _=(T=i??o)==null?void 0:T.variantId,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 A=B9(r,r.sessionId,C.workItemId);if(A)return{sessionId:r.sessionId,variantId:C.workItemId,label:C.label,url:A,source:"live"}},[r,i,o,s]),u=aP(i,r)??(o?l:void 0),d=aP(o,r)??(i?l:void 0),f=!i&&!!u,h=!o&&!!d,g=!!(u||d),v=b.jsx(Nne,{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(iP,{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(iP,{side:"right",sessionId:d.sessionId,variantId:d.variantId,url:d.url,label:d.label,source:d.source,isFallback:h},`right-${d.sessionId}:${d.variantId}:${d.url}`)]}),b.jsx("div",{className:"variant-preview-atmosphere","aria-hidden":"true"}),b.jsx(jne,{}),b.jsx(Dne,{})]})})}function Mo(t){if(t===void 0)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return t}function Z9(t,e){t.prototype=Object.create(e.prototype),t.prototype.constructor=t,t.__proto__=e}/*!
142
+ * GSAP 3.15.0
143
+ * https://gsap.com
144
+ *
145
+ * @license Copyright 2008-2026, GreenSock. All rights reserved.
146
+ * Subject to the terms at https://gsap.com/standard-license
147
+ * @author: Jack Doyle, jack@greensock.com
148
+ */var Ps={autoSleep:120,force3D:"auto",nullTargetWarn:1,units:{lineHeight:""}},$h={duration:.5,overwrite:!1,delay:0},m4,vr,pn,Gs=1e8,Gt=1/Gs,tx=Math.PI*2,Hne=tx/4,zne=0,W9=Math.sqrt,Une=Math.cos,Bne=Math.sin,lr=function(e){return typeof e=="string"},An=function(e){return typeof e=="function"},Yo=function(e){return typeof e=="number"},g4=function(e){return typeof e>"u"},ro=function(e){return typeof e=="object"},ts=function(e){return e!==!1},v4=function(){return typeof window<"u"},J0=function(e){return An(e)||lr(e)},q9=typeof ArrayBuffer=="function"&&ArrayBuffer.isView||function(){},Ar=Array.isArray,Zne=/random\([^)]+\)/g,Wne=/,\s*/g,lP=/(?:-?\.?\d|\.)+/gi,G9=/[-+=.]*\d+[.e\-+]*\d*[e\-+]*\d*/g,Ru=/[-+=.]*\d+[.e-]*\d*[a-z%]*/g,j_=/[-+=.]*\d+\.?\d*(?:e-|e\+)?\d*/gi,K9=/[+-]=-?[.\d]+/,qne=/[^,'"\[\]\s]+/gi,Gne=/^[+\-=e\s\d]*\d+[.\d]*([a-z]*|%)\s*$/i,Sn,Fi,nx,y4,Ts={},Rg={},Y9,X9=function(e){return(Rg=yd(e,Ts))&&is},_4=function(e,n){return console.warn("Invalid property",e,"set to",n,"Missing plugin? gsap.registerPlugin()")},Fh=function(e,n){return!n&&console.warn(e)},Q9=function(e,n){return e&&(Ts[e]=n)&&Rg&&(Rg[e]=n)||Ts},Vh=function(){return 0},Kne={suppressEvents:!0,isStart:!0,kill:!1},Em={suppressEvents:!0,kill:!1},Yne={suppressEvents:!0},w4={},Wa=[],rx={},J9,_s={},$_={},cP=30,Cm=[],x4="",b4=function(e){var n=e[0],r,s;if(ro(n)||An(n)||(e=[e]),!(r=(n._gsap||{}).harness)){for(s=Cm.length;s--&&!Cm[s].targetTest(n););r=Cm[s]}for(s=e.length;s--;)e[s]&&(e[s]._gsap||(e[s]._gsap=new xL(e[s],r)))||e.splice(s,1);return e},fc=function(e){return e._gsap||b4(Ks(e))[0]._gsap},eL=function(e,n,r){return(r=e[n])&&An(r)?e[n]():g4(r)&&e.getAttribute&&e.getAttribute(n)||r},ns=function(e,n){return(e=e.split(",")).forEach(n)||e},On=function(e){return Math.round(e*1e5)/1e5||0},bn=function(e){return Math.round(e*1e7)/1e7||0},$u=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},Xne=function(e,n){for(var r=n.length,s=0;e.indexOf(n[s])<0&&++s<r;);return s<r},Mg=function(){var e=Wa.length,n=Wa.slice(0),r,s;for(rx={},Wa.length=0,r=0;r<e;r++)s=n[r],s&&s._lazy&&(s.render(s._lazy[0],s._lazy[1],!0)._lazy=0)},S4=function(e){return!!(e._initted||e._startAt||e.add)},tL=function(e,n,r,s){Wa.length&&!vr&&Mg(),e.render(n,r,!!(vr&&n<0&&S4(e))),Wa.length&&!vr&&Mg()},nL=function(e){var n=parseFloat(e);return(n||n===0)&&(e+"").match(qne).length<2?n:lr(e)?e.trim():e},rL=function(e){return e},Rs=function(e,n){for(var r in n)r in e||(e[r]=n[r]);return e},Qne=function(e){return function(n,r){for(var s in r)s in n||s==="duration"&&e||s==="ease"||(n[s]=r[s])}},yd=function(e,n){for(var r in n)e[r]=n[r];return e},uP=function t(e,n){for(var r in n)r!=="__proto__"&&r!=="constructor"&&r!=="prototype"&&(e[r]=ro(n[r])?t(e[r]||(e[r]={}),n[r]):n[r]);return e},Ig=function(e,n){var r={},s;for(s in e)s in n||(r[s]=e[s]);return r},ih=function(e){var n=e.parent||Sn,r=e.keyframes?Qne(Ar(e.keyframes)):Rs;if(ts(e.inherit))for(;n;)r(e,n.vars.defaults),n=n.parent||n._dp;return e},Jne=function(e,n){for(var r=e.length,s=r===n.length;s&&r--&&e[r]===n[r];);return r<0},sL=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},wv=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},nl=function(e,n){e.parent&&(!n||e.parent.autoRemoveChildren)&&e.parent.remove&&e.parent.remove(e),e._act=0},hc=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},ere=function(e){for(var n=e.parent;n&&n.parent;)n._dirty=1,n.totalDuration(),n=n.parent;return e},sx=function(e,n,r,s){return e._startAt&&(vr?e._startAt.revert(Em):e.vars.immediateRender&&!e.vars.autoRevert||e._startAt.render(n,!0,s))},tre=function t(e){return!e||e._ts&&t(e.parent)},dP=function(e){return e._repeat?_d(e._tTime,e=e.duration()+e._rDelay)*e:0},_d=function(e,n){var r=Math.floor(e=bn(e/n));return e&&r===e?r-1:r},Og=function(e,n){return(e-n._start)*n._ts+(n._ts>=0?0:n._dirty?n.totalDuration():n._tDur)},xv=function(e){return e._end=bn(e._start+(e._tDur/Math.abs(e._ts||e._rts||Gt)||0))},bv=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)),xv(e),r._dirty||hc(r,e)),e},iL=function(e,n){var r;if((n._time||!n._dur&&n._initted||n._start<e._time&&(n._dur||!n.add))&&(r=Og(e.rawTime(),n),(!n._dur||dp(0,n.totalDuration(),r)-n._tTime>Gt)&&n.render(r,!0)),hc(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=-Gt}},Zi=function(e,n,r,s){return n.parent&&nl(n),n._start=bn((Yo(r)?r:r||e!==Sn?Bs(e,r,n):e._time)+n._delay),n._end=bn(n._start+(n.totalDuration()/Math.abs(n.timeScale())||0)),sL(e,n,"_first","_last",e._sort?"_start":0),ix(n)||(e._recent=n),s||iL(e,n),e._ts<0&&bv(e,e._tTime),e},oL=function(e,n){return(Ts.ScrollTrigger||_4("scrollTrigger",n))&&Ts.ScrollTrigger.create(n,e)},aL=function(e,n,r,s,i){if(E4(e,n,i),!e._initted)return 1;if(!r&&e._pt&&!vr&&(e._dur&&e.vars.lazy!==!1||!e._dur&&e.vars.lazy)&&J9!==bs.frame)return Wa.push(e),e._lazy=[i,s],1},nre=function t(e){var n=e.parent;return n&&n._ts&&n._initted&&!n._lock&&(n.rawTime()<0||t(n))},ix=function(e){var n=e.data;return n==="isFromStart"||n==="isStart"},rre=function(e,n,r,s){var i=e.ratio,o=n<0||!n&&(!e._start&&nre(e)&&!(!e._initted&&ix(e))||(e._ts<0||e._dp._ts<0)&&!ix(e))?0:1,l=e._rDelay,u=0,d,f,h;if(l&&e._repeat&&(u=dp(0,e._tDur,n),f=_d(u,l),e._yoyo&&f&1&&(o=1-o),f!==_d(e._tTime,l)&&(i=1-o,e.vars.repeatRefresh&&e._initted&&e.invalidate())),o!==i||vr||s||e._zTime===Gt||!n&&e._zTime){if(!e._initted&&aL(e,n,s,r,u))return;for(h=e._zTime,e._zTime=n||(r?Gt:0),r||(r=n&&!h),e.ratio=o,e._from&&(o=1-o),e._time=0,e._tTime=u,d=e._pt;d;)d.r(o,d.d),d=d._next;n<0&&sx(e,n,r,!0),e._onUpdate&&!r&&Ss(e,"onUpdate"),u&&e._repeat&&!r&&e.parent&&Ss(e,"onRepeat"),(n>=e._tDur||n<0)&&e.ratio===o&&(o&&nl(e,1),!r&&!vr&&(Ss(e,o?"onComplete":"onReverseComplete",!0),e._prom&&e._prom()))}else e._zTime||(e._zTime=n)},sre=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}},wd=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&&bv(e,e._tTime=e._tDur*l),e.parent&&xv(e),r||hc(e.parent,e),e},fP=function(e){return e instanceof Xr?hc(e):wd(e,e._dur)},ire={_start:0,endTime:Vh,totalDuration:Vh},Bs=function t(e,n,r){var s=e.labels,i=e._recent||ire,o=e.duration()>=Gs?i.endTime(!1):e._dur,l,u,d;return lr(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*(Ar(r)?r[0]:r).totalDuration()),l>1?t(e,n.substr(0,l-1),r)+u:o+u)):n==null?o:+n},oh=function(e,n,r){var s=Yo(n[1]),i=(s?2:1)+(e<2?0:1),o=n[i],l,u;if(s&&(o.duration=n[1]),o.parent=r,e){for(l=o,u=r;u&&!("immediateRender"in l);)l=u.vars.defaults||{},u=ts(u.vars.inherit)&&u.parent;o.immediateRender=ts(l.immediateRender),e<2?o.runBackwards=1:o.startAt=n[i-1]}return new Bn(n[0],o,n[i+1])},ul=function(e,n){return e||e===0?n(e):n},dp=function(e,n,r){return r<e?e:r>n?n:r},Cr=function(e,n){return!lr(e)||!(n=Gne.exec(e))?"":n[1]},ore=function(e,n,r){return ul(r,function(s){return dp(e,n,s)})},ox=[].slice,lL=function(e,n){return e&&ro(e)&&"length"in e&&(!n&&!e.length||e.length-1 in e&&ro(e[0]))&&!e.nodeType&&e!==Fi},are=function(e,n,r){return r===void 0&&(r=[]),e.forEach(function(s){var i;return lr(s)&&!n||lL(s,1)?(i=r).push.apply(i,Ks(s)):r.push(s)})||r},Ks=function(e,n,r){return pn&&!n&&pn.selector?pn.selector(e):lr(e)&&!r&&(nx||!xd())?ox.call((n||y4).querySelectorAll(e),0):Ar(e)?are(e,r):lL(e)?ox.call(e,0):e?[e]:[]},ax=function(e){return e=Ks(e)[0]||Fh("Invalid scope")||{},function(n){var r=e.current||e.nativeElement||e;return Ks(n,r.querySelectorAll?r:r===e?Fh("Invalid scope")||y4.createElement("div"):e)}},cL=function(e){return e.sort(function(){return .5-Math.random()})},uL=function(e){if(An(e))return e;var n=ro(e)?e:{each:e},r=pc(n.ease),s=n.from||0,i=parseFloat(n.base)||0,o={},l=s>0&&s<1,u=isNaN(s)||l,d=n.axis,f=s,h=s;return lr(s)?f=h={center:.5,edges:.5,end:1}[s]||0:!l&&u&&(f=s[0],h=s[1]),function(g,v,w){var _=(w||n).length,x=o[_],S,k,C,A,T,I,M,R,O;if(!x){if(O=n.grid==="auto"?0:(n.grid||[1,Gs])[1],!O){for(M=-Gs;M<(M=w[O++].getBoundingClientRect().left)&&O<_;);O<_&&O--}for(x=o[_]=[],S=u?Math.min(O,_)*f-.5:s%O,k=O===Gs?0:u?_*h/O-.5:s/O|0,M=0,R=Gs,I=0;I<_;I++)C=I%O-S,A=k-(I/O|0),x[I]=T=d?Math.abs(d==="y"?A:C):W9(C*C+A*A),T>M&&(M=T),T<R&&(R=T);s==="random"&&cL(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=Cr(n.amount||n.each)||0,r=r&&_<0?wre(r):r}return _=(x[g]-x.min)/x.max||0,bn(x.b+(r?r(_):_)*x.v)+x.u}},lx=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+(Yo(r)?0:Cr(r))}},dL=function(e,n){var r=Ar(e),s,i;return!r&&ro(e)&&(s=r=e.radius||Gs,e.values?(e=Ks(e.values),(i=!Yo(e[0]))&&(s*=s)):e=lx(e.increment)),ul(n,r?An(e)?function(o){return i=e(o),Math.abs(i-o)<=s?i:o}:function(o){for(var l=parseFloat(i?o.x:o),u=parseFloat(i?o.y:0),d=Gs,f=0,h=e.length,g,v;h--;)i?(g=e[h].x-l,v=e[h].y-u,g=g*g+v*v):g=Math.abs(e[h]-l),g<d&&(d=g,f=h);return f=!s||d<=s?e[f]:o,i||f===o||Yo(o)?f:f+Cr(o)}:lx(e))},fL=function(e,n,r,s){return ul(Ar(e)?!n:r===!0?!!(r=0):!s,function(){return Ar(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})},lre=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)}},cre=function(e,n){return function(r){return e(parseFloat(r))+(n||Cr(r))}},ure=function(e,n,r){return pL(e,n,0,1,r)},hL=function(e,n,r){return ul(r,function(s){return e[~~n(s)]})},dre=function t(e,n,r){var s=n-e;return Ar(e)?hL(e,t(0,e.length),n):ul(r,function(i){return(s+(i-e)%s)%s+e})},fre=function t(e,n,r){var s=n-e,i=s*2;return Ar(e)?hL(e,t(0,e.length-1),n):ul(r,function(o){return o=(i+(o-e)%i)%i||0,e+(o>s?i-o:o)})},Hh=function(e){return e.replace(Zne,function(n){var r=n.indexOf("[")+1,s=n.substring(r||7,r?n.indexOf("]"):n.length-1).split(Wne);return fL(r?s:+s[0],r?0:+s[1],+s[2]||1e-5)})},pL=function(e,n,r,s,i){var o=n-e,l=s-r;return ul(i,function(u){return r+((u-e)/o*l||0)})},hre=function t(e,n,r,s){var i=isNaN(e+n)?0:function(v){return(1-v)*e+v*n};if(!i){var o=lr(e),l={},u,d,f,h,g;if(r===!0&&(s=1)&&(r=null),o)e={p:e},n={p:n};else if(Ar(e)&&!Ar(n)){for(f=[],h=e.length,g=h-2,d=1;d<h;d++)f.push(t(e[d-1],e[d]));h--,i=function(w){w*=h;var _=Math.min(g,~~w);return f[_](w-_)},r=n}else s||(e=yd(Ar(e)?[]:{},e));if(!f){for(u in n)k4.call(l,e,u,"get",n[u]);i=function(w){return A4(w,l)||(o?e.p:e)}}}return ul(r,i)},hP=function(e,n,r){var s=e.labels,i=Gs,o,l,u;for(o in s)l=s[o]-n,l<0==!!r&&l&&i>(l=Math.abs(l))&&(u=o,i=l);return u},Ss=function(e,n,r){var s=e.vars,i=s[n],o=pn,l=e._ctx,u,d,f;if(i)return u=s[n+"Params"],d=s.callbackScope||e,r&&Wa.length&&Mg(),l&&(pn=l),f=u?i.apply(d,u):i.call(d),pn=o,f},Ff=function(e){return nl(e),e.scrollTrigger&&e.scrollTrigger.kill(!!vr),e.progress()<1&&Ss(e,"onInterrupt"),e},Mu,mL=[],gL=function(e){if(e)if(e=!e.name&&e.default||e,v4()||e.headless){var n=e.name,r=An(e),s=n&&!r&&e.init?function(){this._props=[]}:e,i={init:Vh,render:A4,add:k4,kill:Rre,modifier:Tre,rawVars:0},o={targetTest:0,get:0,getSetter:P4,aliases:{},register:0};if(xd(),e!==s){if(_s[n])return;Rs(s,Rs(Ig(e,i),o)),yd(s.prototype,yd(i,Ig(e,o))),_s[s.prop=n]=s,e.targetTest&&(Cm.push(s),w4[n]=1),n=(n==="css"?"CSS":n.charAt(0).toUpperCase()+n.substr(1))+"Plugin"}Q9(n,s),e.register&&e.register(is,s,rs)}else mL.push(e)},Zt=255,Vf={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]},F_=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},vL=function(e,n,r){var s=e?Yo(e)?[e>>16,e>>8&Zt,e&Zt]:0:Vf.black,i,o,l,u,d,f,h,g,v,w;if(!s){if(e.substr(-1)===","&&(e=e.substr(0,e.length-1)),Vf[e])s=Vf[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(lP),!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]=F_(u+1/3,i,o),s[1]=F_(u,i,o),s[2]=F_(u-1/3,i,o);else if(~e.indexOf("="))return s=e.match(G9),r&&s.length<4&&(s[3]=1),s}else s=e.match(lP)||Vf.transparent;s=s.map(Number)}return n&&!w&&(i=s[0]/Zt,o=s[1]/Zt,l=s[2]/Zt,h=Math.max(i,o,l),g=Math.min(i,o,l),f=(h+g)/2,h===g?u=d=0:(v=h-g,d=f>.5?v/(2-h-g):v/(h+g),u=h===i?(o-l)/v+(o<l?6:0):h===o?(l-i)/v+2:(i-o)/v+4,u*=60),s[0]=~~(u+.5),s[1]=~~(d*100+.5),s[2]=~~(f*100+.5)),r&&s.length<4&&(s[3]=1),s},yL=function(e){var n=[],r=[],s=-1;return e.split(qa).forEach(function(i){var o=i.match(Ru)||[];n.push.apply(n,o),r.push(s+=o.length+1)}),n.c=r,n},pP=function(e,n,r){var s="",i=(e+s).match(qa),o=n?"hsla(":"rgba(",l=0,u,d,f,h;if(!i)return e;if(i=i.map(function(g){return(g=vL(g,n,1))&&o+(n?g[0]+","+g[1]+"%,"+g[2]+"%,"+g[3]:g.join(","))+")"}),r&&(f=yL(e),u=r.c,u.join(s)!==f.c.join(s)))for(d=e.replace(qa,"1").split(Ru),h=d.length-1;l<h;l++)s+=d[l]+(~u.indexOf(l)?i.shift()||o+"0,0,0,0)":(f.length?f:i.length?i:r).shift());if(!d)for(d=e.split(qa),h=d.length-1;l<h;l++)s+=d[l]+i[l];return s+d[h]},qa=(function(){var t="(?:\\b(?:(?:rgb|rgba|hsl|hsla)\\(.+?\\))|\\B#(?:[0-9a-f]{3,4}){1,2}\\b",e;for(e in Vf)t+="|"+e+"\\b";return new RegExp(t+")","gi")})(),pre=/hsl[a]?\(/,_L=function(e){var n=e.join(" "),r;if(qa.lastIndex=0,qa.test(n))return r=pre.test(n),e[1]=pP(e[1],r),e[0]=pP(e[0],r,yL(e[1])),!0},zh,bs=(function(){var t=Date.now,e=500,n=33,r=t(),s=r,i=1e3/240,o=i,l=[],u,d,f,h,g,v,w=function _(x){var S=t()-s,k=x===!0,C,A,T,I;if((S>e||S<0)&&(r+=S-n),s+=S,T=s-r,C=T-o,(C>0||k)&&(I=++h.frame,g=T-h.time*1e3,h.time=T=T/1e3,o+=C+(C>=i?4:i-C),A=1),k||(u=d(_)),A)for(v=0;v<l.length;v++)l[v](T,g,I,x)};return h={time:0,frame:0,tick:function(){w(!0)},deltaRatio:function(x){return g/(1e3/(x||60))},wake:function(){Y9&&(!nx&&v4()&&(Fi=nx=window,y4=Fi.document||{},Ts.gsap=is,(Fi.gsapVersions||(Fi.gsapVersions=[])).push(is.version),X9(Rg||Fi.GreenSockGlobals||!Fi.gsap&&Fi||{}),mL.forEach(gL)),f=typeof requestAnimationFrame<"u"&&requestAnimationFrame,u&&h.sleep(),d=f||function(x){return setTimeout(x,o-h.time*1e3+1|0)},zh=1,w(2))},sleep:function(){(f?cancelAnimationFrame:clearTimeout)(u),zh=0,d=Vh},lagSmoothing:function(x,S){e=x||1/0,n=Math.min(S||33,e)},fps:function(x){i=1e3/(x||240),o=h.time*1e3+i},add:function(x,S,k){var C=S?function(A,T,I,M){x(A,T,I,M),h.remove(C)}:x;return h.remove(x),l[k?"unshift":"push"](C),xd(),C},remove:function(x,S){~(S=l.indexOf(x))&&l.splice(S,1)&&v>=S&&v--},_listeners:l},h})(),xd=function(){return!zh&&bs.wake()},Et={},mre=/^[\d.\-M][\d.\-,\s]/,gre=/["']/g,vre=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(gre,"").trim():+d,s=u.substr(l+1).trim();return n},yre=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)},_re=function(e){var n=(e+"").split("("),r=Et[n[0]];return r&&n.length>1&&r.config?r.config.apply(null,~e.indexOf("{")?[vre(n[1])]:yre(e).split(",").map(nL)):Et._CE&&mre.test(e)?Et._CE("",e):r},wre=function(e){return function(n){return 1-e(1-n)}},pc=function(e,n){return e&&(An(e)?e:Et[e]||_re(e))||n},Cc=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 ns(e,function(l){Et[l]=Ts[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},wL=function(e){return function(n){return n<.5?(1-e(1-n*2))/2:.5+e((n-.5)*2)/2}},V_=function t(e,n,r){var s=n>=1?n:1,i=(r||(e?.3:.45))/(n<1?n:1),o=i/tx*(Math.asin(1/s)||0),l=function(f){return f===1?1:s*Math.pow(2,-10*f)*Bne((f-o)*i)+1},u=e==="out"?l:e==="in"?function(d){return 1-l(1-d)}:wL(l);return i=tx/i,u.config=function(d,f){return t(e,d,f)},u},H_=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)}:wL(r);return s.config=function(i){return t(e,i)},s};ns("Linear,Quad,Cubic,Quart,Quint,Strong",function(t,e){var n=e<5?e+1:e;Cc(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;Cc("Elastic",V_("in"),V_("out"),V_());(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};Cc("Bounce",function(o){return 1-i(1-o)},i)})(7.5625,2.75);Cc("Expo",function(t){return Math.pow(2,10*(t-1))*t+t*t*t*t*t*t*(1-t)});Cc("Circ",function(t){return-(W9(1-t*t)-1)});Cc("Sine",function(t){return t===1?1:-Une(t*Hne)+1});Cc("Back",H_("in"),H_("out"),H_());Et.SteppedEase=Et.steps=Ts.SteppedEase={config:function(e,n){e===void 0&&(e=1);var r=1/e,s=e+(n?0:1),i=n?1:0,o=1-Gt;return function(l){return((s*dp(0,o,l)|0)+i)*r}}};$h.ease=Et["quad.out"];ns("onComplete,onUpdate,onStart,onRepeat,onReverseComplete,onInterrupt",function(t){return x4+=t+","+t+"Params,"});var xL=function(e,n){this.id=zne++,e._gsap=this,this.target=e,this.harness=n,this.get=n?n.get:eL,this.set=n?n.getSetter:P4},Uh=(function(){function t(n){this.vars=n,this._delay=+n.delay||0,(this._repeat=n.repeat===1/0?-2:n.repeat||0)&&(this._rDelay=n.repeatDelay||0,this._yoyo=!!n.yoyo||!!n.yoyoEase),this._ts=1,wd(this,+n.duration,1,1),this.data=n.data,pn&&(this._ctx=pn,pn.data.push(this)),zh||bs.wake()}var e=t.prototype;return e.delay=function(r){return r||r===0?(this.parent&&this.parent.smoothChildTiming&&this.startTime(this._start+r-this._delay),this._delay=r,this):this._delay},e.duration=function(r){return arguments.length?this.totalDuration(this._repeat>0?r+(r+this._rDelay)*this._repeat:r):this.totalDuration()&&this._dur},e.totalDuration=function(r){return arguments.length?(this._dirty=0,wd(this,this._repeat<0?r:(r-this._repeat*this._rDelay)/(this._repeat+1))):this._tDur},e.totalTime=function(r,s){if(xd(),!arguments.length)return this._tTime;var i=this._dp;if(i&&i.smoothChildTiming&&this._ts){for(bv(this,r),!i._dp||i.parent||iL(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)===Gt||!this._initted&&this._dur&&r||!r&&!this._initted&&(this.add||this._ptLookup))&&(this._ts||(this._pTime=r),tL(this,r,s)),this},e.time=function(r,s){return arguments.length?this.totalTime(Math.min(this.totalDuration(),r+dP(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)+dP(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?_d(this._tTime,i)+1:1},e.timeScale=function(r,s){if(!arguments.length)return this._rts===-Gt?0:this._rts;if(this._rts===r)return this;var i=this.parent&&this._ts?Og(this.parent._time,this):this._tTime;return this._rts=+r||0,this._ts=this._ps||r===-Gt?0:this._rts,this.totalTime(dp(-Math.abs(this._delay),this.totalDuration(),i),s!==!1),xv(this),ere(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):(xd(),this._ts=this._rts,this.totalTime(this.parent&&!this.parent.smoothChildTiming?this.rawTime():this._tTime||this._pTime,this.progress()===1&&Math.abs(this._zTime)!==Gt&&(this._tTime-=Gt)))),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+(ts(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?Og(s.rawTime(r),this):this._tTime:this._tTime},e.revert=function(r){r===void 0&&(r=Yne);var s=vr;return vr=r,S4(this)&&(this.timeline&&this.timeline.revert(r),this.totalTime(-.01,r.suppressEvents)),this.data!=="nested"&&r.kill!==!1&&this.kill(),vr=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,fP(this)):this._repeat===-2?1/0:this._repeat},e.repeatDelay=function(r){if(arguments.length){var s=this._time;return this._rDelay=r,fP(this),s?this.time(s):this}return this._rDelay},e.yoyo=function(r){return arguments.length?(this._yoyo=r,this):this._yoyo},e.seek=function(r,s){return this.totalTime(Bs(this,r),ts(s))},e.restart=function(r,s){return this.play().totalTime(r?-this._delay:0,ts(s)),this._dur||(this._zTime=-Gt),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?-Gt:0)),this):this._rts<0},e.invalidate=function(){return this._initted=this._act=0,this._zTime=-Gt,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)-Gt)},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=An(r)?r:rL,u=function(){var f=s.then;s.then=null,i&&i(),An(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(){Ff(this)},t})();Rs(Uh.prototype,{_time:0,_start:0,_end:0,_tTime:0,_tDur:0,_dirty:0,_repeat:0,_yoyo:!1,parent:null,_initted:!1,_rDelay:0,_ts:1,_dp:0,ratio:0,_zTime:-Gt,_prom:0,_ps:!1,_rts:1});var Xr=(function(t){Z9(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=ts(r.sortChildren),Sn&&Zi(r.parent||Sn,Mo(i),s),r.reversed&&i.reverse(),r.paused&&i.paused(!0),r.scrollTrigger&&oL(Mo(i),r.scrollTrigger),i}var n=e.prototype;return n.to=function(s,i,o){return oh(0,arguments,this),this},n.from=function(s,i,o){return oh(1,arguments,this),this},n.fromTo=function(s,i,o,l){return oh(2,arguments,this),this},n.set=function(s,i,o){return i.duration=0,i.parent=this,ih(i).repeatDelay||(i.repeat=0),i.immediateRender=!!i.immediateRender,new Bn(s,i,Bs(this,o),1),this},n.call=function(s,i,o){return Zi(this,Bn.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 Bn(s,o,Bs(this,u)),this},n.staggerFrom=function(s,i,o,l,u,d,f){return o.runBackwards=1,ih(o).immediateRender=ts(o.immediateRender),this.staggerTo(s,i,o,l,u,d,f)},n.staggerFromTo=function(s,i,o,l,u,d,f,h){return l.startAt=o,ih(l).immediateRender=ts(l.immediateRender),this.staggerTo(s,i,l,u,d,f,h)},n.render=function(s,i,o){var l=this._time,u=this._dirty?this.totalDuration():this._tDur,d=this._dur,f=s<=0?0:bn(s),h=this._zTime<0!=s<0&&(this._initted||!d),g,v,w,_,x,S,k,C,A,T,I,M;if(this!==Sn&&f>u&&s>=0&&(f=u),f!==this._tTime||o||h){if(l!==this._time&&d&&(f+=this._time-l,s+=this._time-l),g=f,A=this._start,C=this._ts,S=!C,h&&(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):(T=bn(f/x),_=~~T,_&&_===T&&(g=d,_--),g>d&&(g=d)),T=_d(this._tTime,x),!l&&this._tTime&&T!==_&&this._tTime-T*x-this._dur<=0&&(T=_),I&&_&1&&(g=d-g,M=1),_!==T&&!this._lock){var R=I&&T&1,O=R===(I&&_&1);if(_<T&&(R=!R),l=R?0:f%d?d:f,this._lock=1,this.render(l||(M?0:bn(_*x)),i,!d)._lock=0,this._tTime=f,!i&&this.parent&&Ss(this,"onRepeat"),this.vars.repeatRefresh&&!M&&(this.invalidate()._lock=1,T=_),l&&l!==this._time||S!==!this._ts||this.vars.onRepeat&&!this.parent&&!this._act)return this;if(d=this._dur,u=this._tDur,O&&(this._lock=2,l=R?d:-1e-4,this.render(l,!0),this.vars.repeatRefresh&&!M&&this.invalidate()),this._lock=0,!this._ts&&!S)return this}}if(this._hasPause&&!this._forcing&&this._lock<2&&(k=sre(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&&!T&&(Ss(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=-Gt);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||vr&&S4(v)),g!==this._time||!this._ts&&!S){k=0,w&&(f+=this._zTime=N?-Gt:Gt);break}}v=w}}if(k&&!i&&(this.pause(),k.render(g>=l?0:-Gt)._zTime=g>=l?1:-1,this._ts))return this._start=A,xv(this),this.render(s,i,o);this._onUpdate&&!i&&Ss(this,"onUpdate",!0),(f===u&&this._tTime>=this.totalDuration()||!f&&l)&&(A===this._start||Math.abs(C)!==Math.abs(this._ts))&&(this._lock||((s||!d)&&(f===u&&this._ts>0||!f&&this._ts<0)&&nl(this,1),!i&&!(s<0&&!l)&&(f||l||!u)&&(Ss(this,f===u&&s>=0?"onComplete":"onReverseComplete",!0),this._prom&&!(f<u&&this.timeScale()>0)&&this._prom())))}return this},n.add=function(s,i){var o=this;if(Yo(i)||(i=Bs(this,i,s)),!(s instanceof Uh)){if(Ar(s))return s.forEach(function(l){return o.add(l,i)}),this;if(lr(s))return this.addLabel(s,i);if(An(s))s=Bn.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=-Gs);for(var u=[],d=this._first;d;)d._start>=l&&(d instanceof Bn?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 lr(s)?this.removeLabel(s):An(s)?this.killTweensOf(s):(s.parent===this&&wv(this,s),s===this._recent&&(this._recent=this._last),hc(this))},n.totalTime=function(s,i){return arguments.length?(this._forcing=1,!this._dp&&this._ts&&(this._start=bn(bs.time-(this._ts>0?s/this._ts:(this.totalDuration()-s)/-this._ts))),t.prototype.totalTime.call(this,s,i),this._forcing=0,this):this._tTime},n.addLabel=function(s,i){return this.labels[s]=Bs(this,i),this},n.removeLabel=function(s){return delete this.labels[s],this},n.addPause=function(s,i,o){var l=Bn.delayedCall(0,i||Vh,o);return l.data="isPause",this._hasPause=1,Zi(this,l,Bs(this,s))},n.removePause=function(s){var i=this._first;for(s=Bs(this,s);i;)i._start===s&&i.data==="isPause"&&nl(i),i=i._next},n.killTweensOf=function(s,i,o){for(var l=this.getTweensOf(s,o),u=l.length;u--;)Ha!==l[u]&&l[u].kill(s,i);return this},n.getTweensOf=function(s,i){for(var o=[],l=Ks(s),u=this._first,d=Yo(i),f;u;)u instanceof Bn?Xne(u._targets,l)&&(d?(!Ha||u._initted&&u._ts)&&u.globalTime(0)<=i&&u.globalTime(u.totalDuration())>i:!i||u.isActive())&&o.push(u):(f=u.getTweensOf(l,i)).length&&o.push.apply(o,f),u=u._next;return o},n.tweenTo=function(s,i){i=i||{};var o=this,l=Bs(o,s),u=i,d=u.startAt,f=u.onStart,h=u.onStartParams,g=u.immediateRender,v,w=Bn.to(o,Rs({ease:i.ease||"none",lazy:!1,immediateRender:!1,time:l,overwrite:"auto",duration:i.duration||Math.abs((l-(d&&"time"in d?d.time:o._time))/o.timeScale())||Gt,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&&wd(w,x,0,1).render(w._time,!0,!0),v=1}f&&f.apply(w,h||[])}},i));return g?w.render(0):w},n.tweenFromTo=function(s,i,o){return this.tweenTo(i,Rs({startAt:{time:Bs(this,s)}},o))},n.recent=function(){return this._recent},n.nextLabel=function(s){return s===void 0&&(s=this._time),hP(this,Bs(this,s))},n.previousLabel=function(s){return s===void 0&&(s=this._time),hP(this,Bs(this,s),1)},n.currentLabel=function(s){return arguments.length?this.seek(s,!0):this.previousLabel(this._time+Gt)},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 hc(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={}),hc(this)},n.totalDuration=function(s){var i=0,o=this,l=o._last,u=Gs,d,f,h;if(arguments.length)return o.timeScale((o._repeat<0?o.duration():o.totalDuration())/(o.reversed()?-s:s));if(o._dirty){for(h=o.parent;l;)d=l._prev,l._dirty&&l.totalDuration(),f=l._start,f>u&&o._sort&&l._ts&&!o._lock?(o._lock=1,Zi(o,l,f-l._delay,1)._lock=0):u=f,f<0&&l._ts&&(i-=f,(!h&&!o._dp||h&&h.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;wd(o,o===Sn&&o._time>i?o._time:i,1,1),o._dirty=0}return o._tDur},e.updateRoot=function(s){if(Sn._ts&&(tL(Sn,Og(s,Sn)),J9=bs.frame),bs.frame>=cP){cP+=Ps.autoSleep||120;var i=Sn._first;if((!i||!i._ts)&&Ps.autoSleep&&bs._listeners.length<2){for(;i&&!i._ts;)i=i._next;i||bs.sleep()}}},e})(Uh);Rs(Xr.prototype,{_lock:0,_hasPause:0,_forcing:0});var xre=function(e,n,r,s,i,o,l){var u=new rs(this._pt,e,n,0,1,PL,null,i),d=0,f=0,h,g,v,w,_,x,S,k;for(u.b=r,u.e=s,r+="",s+="",(S=~s.indexOf("random("))&&(s=Hh(s)),o&&(k=[r,s],o(k,e,n),r=k[0],s=k[1]),g=r.match(j_)||[];h=j_.exec(s);)w=h[0],_=s.substring(d,h.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)==="="?$u(x,w)-x:parseFloat(w)-x,m:v&&v<4?Math.round:0},d=j_.lastIndex);return u.c=d<s.length?s.substring(d,s.length):"",u.fp=l,(K9.test(s)||S)&&(u.e=0),this._pt=u,u},k4=function(e,n,r,s,i,o,l,u,d,f){An(s)&&(s=s(i||0,e,o));var h=e[n],g=r!=="get"?r:An(h)?d?e[n.indexOf("set")||!An(e["get"+n.substr(3)])?n:"get"+n.substr(3)](d):e[n]():h,v=An(h)?d?Cre:EL:C4,w;if(lr(s)&&(~s.indexOf("random(")&&(s=Hh(s)),s.charAt(1)==="="&&(w=$u(g,s)+(Cr(g)||0),(w||w===0)&&(s=w))),!f||g!==s||cx)return!isNaN(g*s)&&s!==""?(w=new rs(this._pt,e,n,+g||0,s-(g||0),typeof h=="boolean"?Are:CL,0,v),d&&(w.fp=d),l&&w.modifier(l,this,e),this._pt=w):(!h&&!(n in e)&&_4(n,s),xre.call(this,e,n,g,s,v,u||Ps.stringFilter,d))},bre=function(e,n,r,s,i){if(An(e)&&(e=ah(e,i,n,r,s)),!ro(e)||e.style&&e.nodeType||Ar(e)||q9(e))return lr(e)?ah(e,i,n,r,s):e;var o={},l;for(l in e)o[l]=ah(e[l],i,n,r,s);return o},bL=function(e,n,r,s,i,o){var l,u,d,f;if(_s[e]&&(l=new _s[e]).init(i,l.rawVars?n[e]:bre(n[e],s,i,o,r),r,s,o)!==!1&&(r._pt=u=new rs(r._pt,i,e,0,1,l.render,l,0,l.priority),r!==Mu))for(d=r._ptLookup[r._targets.indexOf(i)],f=l._props.length;f--;)d[l._props[f]]=u;return l},Ha,cx,E4=function t(e,n,r){var s=e.vars,i=s.ease,o=s.startAt,l=s.immediateRender,u=s.lazy,d=s.onUpdate,f=s.runBackwards,h=s.yoyoEase,g=s.keyframes,v=s.autoRevert,w=e._dur,_=e._startAt,x=e._targets,S=e.parent,k=S&&S.data==="nested"?S.vars.targets:x,C=e._overwrite==="auto"&&!m4,A=e.timeline,T=s.easeReverse||h,I,M,R,O,N,D,F,K,B,G,H,Y,U;if(A&&(!g||!i)&&(i="none"),e._ease=pc(i,$h.ease),e._rEase=T&&(pc(T)||e._ease),e._from=!A&&!!s.runBackwards,e._from&&(e.ratio=1),!A||g&&!s.stagger){if(K=x[0]?fc(x[0]).harness:0,Y=K&&s[K.prop],I=Ig(s,w4),_&&(_._zTime<0&&_.progress(1),n<0&&f&&l&&!v?_.render(-1,!0):_.revert(f&&w?Em:Kne),_._lazy=0),o){if(nl(e._startAt=Bn.set(x,Rs({data:"isStart",overwrite:!1,parent:S,immediateRender:!0,lazy:!_&&ts(u),startAt:null,delay:0,onUpdate:d&&function(){return Ss(e,"onUpdate")},stagger:0},o))),e._startAt._dp=0,e._startAt._sat=e,n<0&&(vr||!l&&!v)&&e._startAt.revert(Em),l&&w&&n<=0&&r<=0){n&&(e._zTime=n);return}}else if(f&&w&&!_){if(n&&(l=!1),R=Rs({overwrite:!1,data:"isFromStart",lazy:l&&!_&&ts(u),immediateRender:l,stagger:0,parent:S},I),Y&&(R[K.prop]=Y),nl(e._startAt=Bn.set(x,R)),e._startAt._dp=0,e._startAt._sat=e,n<0&&(vr?e._startAt.revert(Em):e._startAt.render(-1,!0)),e._zTime=n,!l)t(e._startAt,Gt,Gt);else if(!n)return}for(e._pt=e._ptCache=0,u=w&&ts(u)||u&&!w,M=0;M<x.length;M++){if(N=x[M],F=N._gsap||b4(x)[M]._gsap,e._ptLookup[M]=G={},rx[F.id]&&Wa.length&&Mg(),H=k===x?M:k.indexOf(N),K&&(B=new K).init(N,Y||I,e,H,k)!==!1&&(e._pt=O=new rs(e._pt,N,B.name,0,1,B.render,B,0,B.priority),B._props.forEach(function(J){G[J]=O}),B.priority&&(D=1)),!K||Y)for(R in I)_s[R]&&(B=bL(R,I,e,H,N,k))?B.priority&&(D=1):G[R]=O=k4.call(e,N,R,"get",I[R],H,k,0,s.stringFilter);e._op&&e._op[M]&&e.kill(N,e._op[M]),C&&e._pt&&(Ha=e,Sn.killTweensOf(N,G,e.globalTime(n)),U=!e.parent,Ha=0),e._pt&&u&&(rx[F.id]=1)}D&&AL(e),e._onInit&&e._onInit(e)}e._onUpdate=d,e._initted=(!e._op||e._pt)&&!U,g&&n<=0&&A.render(Gs,!0,!0)},Sre=function(e,n,r,s,i,o,l,u){var d=(e._pt&&e._ptCache||(e._ptCache={}))[n],f,h,g,v;if(!d)for(d=e._ptCache[n]=[],g=e._ptLookup,v=e._targets.length;v--;){if(f=g[v][n],f&&f.d&&f.d._pt)for(f=f.d._pt;f&&f.p!==n&&f.fp!==n;)f=f._next;if(!f)return cx=1,e.vars[n]="+=0",E4(e,l),cx=0,u?Fh(n+" not eligible for reset. Try splitting into individual properties"):1;d.push(f)}for(v=d.length;v--;)h=d[v],f=h._pt||h,f.s=(s||s===0)&&!i?s:f.s+(s||0)+o*f.c,f.c=r-f.s,h.e&&(h.e=On(r)+Cr(h.e)),h.b&&(h.b=f.s+Cr(h.b))},kre=function(e,n){var r=e[0]?fc(e[0]).harness:0,s=r&&r.aliases,i,o,l,u;if(!s)return n;i=yd({},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},Ere=function(e,n,r,s){var i=n.ease||s||"power1.inOut",o,l;if(Ar(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})},ah=function(e,n,r,s,i){return An(e)?e.call(n,r,s,i):lr(e)&&~e.indexOf("random(")?Hh(e):e},SL=x4+"repeat,repeatDelay,yoyo,repeatRefresh,yoyoEase,easeReverse,autoRevert",kL={};ns(SL+",id,stagger,delay,duration,paused,scrollTrigger",function(t){return kL[t]=1});var Bn=(function(t){Z9(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:ih(s))||this;var u=l.vars,d=u.duration,f=u.delay,h=u.immediateRender,g=u.stagger,v=u.overwrite,w=u.keyframes,_=u.defaults,x=u.scrollTrigger,S=s.parent||Sn,k=(Ar(r)||q9(r)?Yo(r[0]):"length"in s)?[r]:Ks(r),C,A,T,I,M,R,O,N;if(l._targets=k.length?b4(k):Fh("GSAP target "+r+" not found. https://gsap.com",!Ps.nullTargetWarn)||[],l._ptLookup=[],l._overwrite=v,w||g||J0(d)||J0(f)){s=l.vars;var D=s.easeReverse||s.yoyoEase;if(C=l.timeline=new Xr({data:"nested",defaults:_||{},targets:S&&S.data==="nested"?S.vars.targets:k}),C.kill(),C.parent=C._dp=Mo(l),C._start=0,g||J0(d)||J0(f)){if(I=k.length,O=g&&uL(g),ro(g))for(M in g)~SL.indexOf(M)&&(N||(N={}),N[M]=g[M]);for(A=0;A<I;A++)T=Ig(s,kL),T.stagger=0,D&&(T.easeReverse=D),N&&yd(T,N),R=k[A],T.duration=+ah(d,Mo(l),A,R,k),T.delay=(+ah(f,Mo(l),A,R,k)||0)-l._delay,!g&&I===1&&T.delay&&(l._delay=f=T.delay,l._start+=f,T.delay=0),C.to(R,T,O?O(A,R,k):0),C._ease=Et.none;C.duration()?d=f=0:l.timeline=0}else if(w){ih(Rs(C.vars.defaults,{ease:"none"})),C._ease=pc(w.ease||s.ease||"none");var F=0,K,B,G;if(Ar(w))w.forEach(function(H){return C.to(k,H,">")}),C.duration();else{T={};for(M in w)M==="ease"||M==="easeEach"||Ere(M,w[M],T,w.easeEach);for(M in T)for(K=T[M].sort(function(H,Y){return H.t-Y.t}),F=0,A=0;A<K.length;A++)B=K[A],G={ease:B.e,duration:(B.t-(A?K[A-1].t:0))/100*d},G[M]=B.v,C.to(k,G,F),F+=G.duration;C.duration()<d&&C.to({},{duration:d-C.duration()})}}d||l.duration(d=C.duration())}else l.timeline=0;return v===!0&&!m4&&(Ha=Mo(l),Sn.killTweensOf(k),Ha=0),Zi(S,Mo(l),i),s.reversed&&l.reverse(),s.paused&&l.paused(!0),(h||!d&&!w&&l._start===bn(S._time)&&ts(h)&&tre(Mo(l))&&S.data!=="nested")&&(l._tTime=-Gt,l.render(Math.max(0,-f)||0)),x&&oL(Mo(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,h=s>u-Gt&&!f?u:s<Gt?0:s,g,v,w,_,x,S,k,C;if(!d)rre(this,s,i,o);else if(h!==this._tTime||!s||o||!this._initted&&this._tTime||this._startAt&&this._zTime<0!==f||this._lazy){if(g=h,C=this.timeline,this._repeat){if(_=d+this._rDelay,this._repeat<-1&&f)return this.totalTime(_*100+s,i,o);if(g=bn(h%_),h===u?(w=this._repeat,g=d):(x=bn(h/_),w=~~x,w&&w===x?(g=d,w--):g>d&&(g=d)),S=this._yoyo&&w&1,S&&(g=d-g),x=_d(this._tTime,_),g===l&&!o&&this._initted&&w===x)return this._tTime=h,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(aL(this,f?s:g,o,i,h))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 A=g<l;if(A!==this._inv){var T=A?l:d-l;this._inv=A,this._from&&(this.ratio=1-this.ratio),this._invRatio=this.ratio,this._invTime=l,this._invRecip=T?(A?-1:1)/T:0,this._invScale=A?-this.ratio:1-this.ratio,this._invEase=A?this._rEase:this._ease}this.ratio=k=this._invRatio+this._invScale*this._invEase((g-this._invTime)*this._invRecip)}else this.ratio=k=this._ease(g/d);if(this._from&&(this.ratio=k=1-k),this._tTime=h,this._time=g,!this._act&&this._ts&&(this._act=1,this._lazy=0),!l&&h&&!i&&!x&&(Ss(this,"onStart"),this._tTime!==h))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&&sx(this,s,i,o),Ss(this,"onUpdate")),this._repeat&&w!==x&&this.vars.onRepeat&&!i&&this.parent&&Ss(this,"onRepeat"),(h===this._tDur||!h)&&this._tTime===h&&(f&&!this._onUpdate&&sx(this,s,!0,!0),(s||!d)&&(h===this._tDur&&this._ts>0||!h&&this._ts<0)&&nl(this,1),!i&&!(f&&!l)&&(h||l||S)&&(Ss(this,h===u?"onComplete":"onReverseComplete",!0),this._prom&&!(h<u&&this.timeScale()>0)&&this._prom()))}return this},n.targets=function(){return this._targets},n.invalidate=function(s){return(!s||!this.vars.runBackwards)&&(this._startAt=0),this._pt=this._op=this._onUpdate=this._lazy=this.ratio=0,this._ptLookup=[],this.timeline&&this.timeline.invalidate(s),t.prototype.invalidate.call(this,s)},n.resetTo=function(s,i,o,l,u){zh||bs.wake(),this._ts||this.play();var d=Math.min(this._dur,(this._dp._time-this._start)*this._ts),f;return this._initted||E4(this,d),f=this._ease(d/this._dur),Sre(this,s,i,o,l,f,d,u)?this.resetTo(s,i,o,l,1):(bv(this,0),this.parent||sL(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?Ff(this):this.scrollTrigger&&this.scrollTrigger.kill(!!vr),this;if(this.timeline){var o=this.timeline.totalDuration();return this.timeline.killTweensOf(s,i,Ha&&Ha.vars.overwrite!==!0)._first||Ff(this),this.parent&&o!==this.timeline.totalDuration()&&wd(this,this._dur*this.timeline._tDur/o,0,1),this}var l=this._targets,u=s?Ks(s):l,d=this._ptLookup,f=this._pt,h,g,v,w,_,x,S;if((!i||i==="all")&&Jne(l,u))return i==="all"&&(this._pt=0),Ff(this);for(h=this._op=this._op||[],i!=="all"&&(lr(i)&&(_={},ns(i,function(k){return _[k]=1}),i=_),i=kre(l,i)),S=l.length;S--;)if(~u.indexOf(l[S])){g=d[S],i==="all"?(h[S]=i,w=g,v={}):(v=h[S]=h[S]||{},w=i);for(_ in w)x=g&&g[_],x&&((!("kill"in x.d)||x.d.kill(_)===!0)&&wv(this,x,"_pt"),delete g[_]),v!=="all"&&(v[_]=1)}return this._initted&&!this._pt&&f&&Ff(this),this},e.to=function(s,i){return new e(s,i,arguments[2])},e.from=function(s,i){return oh(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 oh(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})(Uh);Rs(Bn.prototype,{_targets:[],_lazy:0,_startAt:0,_op:0,_onInit:0});ns("staggerTo,staggerFrom,staggerFromTo",function(t){Bn[t]=function(){var e=new Xr,n=ox.call(arguments,0);return n.splice(t==="staggerFromTo"?5:4,0,0),e[t].apply(e,n)}});var C4=function(e,n,r){return e[n]=r},EL=function(e,n,r){return e[n](r)},Cre=function(e,n,r,s){return e[n](s.fp,r)},Pre=function(e,n,r){return e.setAttribute(n,r)},P4=function(e,n){return An(e[n])?EL:g4(e[n])&&e.setAttribute?Pre:C4},CL=function(e,n){return n.set(n.t,n.p,Math.round((n.s+n.c*e)*1e6)/1e6,n)},Are=function(e,n){return n.set(n.t,n.p,!!(n.s+n.c*e),n)},PL=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)},A4=function(e,n){for(var r=n._pt;r;)r.r(e,r.d),r=r._next},Tre=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},Rre=function(e){for(var n=this._pt,r,s;n;)s=n._next,n.p===e&&!n.op||n.op===e?wv(this,n,"_pt"):n.dep||(r=1),n=s;return!r},Mre=function(e,n,r,s){s.mSet(e,n,s.m.call(s.tween,r,s.mt),s)},AL=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},rs=(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||CL,this.d=u||this,this.set=d||C4,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=Mre,this.m=r,this.mt=i,this.tween=s},t})();ns(x4+"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 w4[t]=1});Ts.TweenMax=Ts.TweenLite=Bn;Ts.TimelineLite=Ts.TimelineMax=Xr;Sn=new Xr({sortChildren:!1,defaults:$h,autoRemoveChildren:!0,id:"root",smoothChildTiming:!0});Ps.stringFilter=_L;var mc=[],Pm={},Ire=[],mP=0,Ore=0,z_=function(e){return(Pm[e]||Ire).map(function(n){return n()})},ux=function(){var e=Date.now(),n=[];e-mP>2&&(z_("matchMediaInit"),mc.forEach(function(r){var s=r.queries,i=r.conditions,o,l,u,d;for(l in s)o=Fi.matchMedia(s[l]).matches,o&&(u=1),o!==i[l]&&(i[l]=o,d=1);d&&(r.revert(),u&&n.push(r))}),z_("matchMediaRevert"),n.forEach(function(r){return r.onMatch(r,function(s){return r.add(null,s)})}),mP=e,z_("matchMedia"))},TL=(function(){function t(n,r){this.selector=r&&ax(r),this.data=[],this._r=[],this.isReverted=!1,this.id=Ore++,n&&this.add(n)}var e=t.prototype;return e.add=function(r,s,i){An(r)&&(i=s,s=r,r=An);var o=this,l=function(){var d=pn,f=o.selector,h;return d&&d!==o&&d.data.push(o),i&&(o.selector=ax(i)),pn=o,h=s.apply(o,arguments),An(h)&&o._r.push(h),pn=d,o.selector=f,o.isReverted=!1,h};return o.last=l,r===An?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 Bn&&!(s.parent&&s.parent.data==="nested")&&r.push(s)}),r},e.clear=function(){this._r.length=this.data.length=0},e.kill=function(r,s){var i=this;if(r?(function(){for(var l=i.getTweens(),u=i.data.length,d;u--;)d=i.data[u],d.data==="isFlip"&&(d.revert(),d.getChildren(!0,!0,!1).forEach(function(f){return l.splice(l.indexOf(f),1)}));for(l.map(function(f){return{g:f._dur||f._delay||f._sat&&!f._sat.vars.immediateRender?f.globalTime(0):-1/0,t:f}}).sort(function(f,h){return h.g-f.g||-1/0}).forEach(function(f){return f.t.revert(r)}),u=i.data.length;u--;)d=i.data[u],d instanceof Xr?d.data!=="nested"&&(d.scrollTrigger&&d.scrollTrigger.revert(),d.kill()):!(d instanceof Bn)&&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=mc.length;o--;)mc[o].id===this.id&&mc.splice(o,1)},e.revert=function(r){this.kill(r||{})},t})(),Lre=(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){ro(r)||(r={matches:r});var o=new TL(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=Fi.matchMedia(r[d]),u&&(mc.indexOf(o)<0&&mc.push(o),(l[d]=u.matches)&&(f=1),u.addListener?u.addListener(ux):u.addEventListener("change",ux)));return f&&s(o,function(h){return o.add(null,h)}),this},e.revert=function(r){this.kill(r||{})},e.kill=function(r){this.contexts.forEach(function(s){return s.kill(r,!0)})},t})(),Lg={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 gL(s)})},timeline:function(e){return new Xr(e)},getTweensOf:function(e,n){return Sn.getTweensOf(e,n)},getProperty:function(e,n,r,s){lr(e)&&(e=Ks(e)[0]);var i=fc(e||{}).get,o=r?rL:nL;return r==="native"&&(r=""),e&&(n?o((_s[n]&&_s[n].get||i)(e,n,r,s)):function(l,u,d){return o((_s[l]&&_s[l].get||i)(e,l,u,d))})},quickSetter:function(e,n,r){if(e=Ks(e),e.length>1){var s=e.map(function(f){return is.quickSetter(f,n,r)}),i=s.length;return function(f){for(var h=i;h--;)s[h](f)}}e=e[0]||{};var o=_s[n],l=fc(e),u=l.harness&&(l.harness.aliases||{})[n]||n,d=o?function(f){var h=new o;Mu._pt=0,h.init(e,r?f+r:f,Mu,0,[e]),h.render(1,h),Mu._pt&&A4(1,Mu)}: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=is.to(e,Rs((s={},s[n]="+=0.1",s.paused=!0,s.stagger=0,s),r||{})),o=function(u,d,f){return i.resetTo(n,u,d,f)};return o.tween=i,o},isTweening:function(e){return Sn.getTweensOf(e,!0).length>0},defaults:function(e){return e&&e.ease&&(e.ease=pc(e.ease,$h.ease)),uP($h,e||{})},config:function(e){return uP(Ps,e||{})},registerEffect:function(e){var n=e.name,r=e.effect,s=e.plugins,i=e.defaults,o=e.extendTimeline;(s||"").split(",").forEach(function(l){return l&&!_s[l]&&!Ts[l]&&Fh(n+" effect requires "+l+" plugin.")}),$_[n]=function(l,u,d){return r(Ks(l),Rs(u||{},i),d)},o&&(Xr.prototype[n]=function(l,u,d){return this.add($_[n](l,ro(u)?u:(d=u)&&{},this),d)})},registerEase:function(e,n){Et[e]=pc(n)},parseEase:function(e,n){return arguments.length?pc(e,n):Et},getById:function(e){return Sn.getById(e)},exportRoot:function(e,n){e===void 0&&(e={});var r=new Xr(e),s,i;for(r.smoothChildTiming=ts(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 Bn&&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 TL(e,n):pn},matchMedia:function(e){return new Lre(e)},matchMediaRefresh:function(){return mc.forEach(function(e){var n=e.conditions,r,s;for(s in n)n[s]&&(n[s]=!1,r=1);r&&e.revert()})||ux()},addEventListener:function(e,n){var r=Pm[e]||(Pm[e]=[]);~r.indexOf(n)||r.push(n)},removeEventListener:function(e,n){var r=Pm[e],s=r&&r.indexOf(n);s>=0&&r.splice(s,1)},utils:{wrap:dre,wrapYoyo:fre,distribute:uL,random:fL,snap:dL,normalize:ure,getUnit:Cr,clamp:ore,splitColor:vL,toArray:Ks,selector:ax,mapRange:pL,pipe:lre,unitize:cre,interpolate:hre,shuffle:cL},install:X9,effects:$_,ticker:bs,updateRoot:Xr.updateRoot,plugins:_s,globalTimeline:Sn,core:{PropTween:rs,globals:Q9,Tween:Bn,Timeline:Xr,Animation:Uh,getCache:fc,_removeLinkedListItem:wv,reverting:function(){return vr},context:function(e){return e&&pn&&(pn.data.push(e),e._ctx=pn),pn},suppressOverwrites:function(e){return m4=e}}};ns("to,from,fromTo,delayedCall,set,killTweensOf",function(t){return Lg[t]=Bn[t]});bs.add(Xr.updateRoot);Mu=Lg.to({},{duration:0});var Nre=function(e,n){for(var r=e._pt;r&&r.p!==n&&r.op!==n&&r.fp!==n;)r=r._next;return r},Dre=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=Nre(o,s)),o&&o.modifier&&o.modifier(n[s],e,r[i],s))},U_=function(e,n){return{name:e,headless:1,rawVars:1,init:function(s,i,o){o._onInit=function(l){var u,d;if(lr(i)&&(u={},ns(i,function(f){return u[f]=1}),i=u),n){u={};for(d in i)u[d]=n(i[d]);i=u}Dre(l,i)}}}},is=Lg.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;)vr?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)}},U_("roundProps",lx),U_("modifiers"),U_("snap",dL))||Lg;Bn.version=Xr.version=is.version="3.15.0";Y9=1;v4()&&xd();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 gP,za,Fu,T4,Yl,vP,R4,jre=function(){return typeof window<"u"},Xo={},Wl=180/Math.PI,Vu=Math.PI/180,yu=Math.atan2,yP=1e8,M4=/([A-Z])/g,$re=/(left|right|width|margin|padding|x)/i,Fre=/[\s,\(]\S/,Gi={autoAlpha:"opacity,visibility",scale:"scaleX,scaleY",alpha:"opacity"},dx=function(e,n){return n.set(n.t,n.p,Math.round((n.s+n.c*e)*1e4)/1e4+n.u,n)},Vre=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)},Hre=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)},zre=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)},Ure=function(e,n){var r=n.s+n.c*e;n.set(n.t,n.p,~~(r+(r<0?-.5:.5))+n.u,n)},RL=function(e,n){return n.set(n.t,n.p,e?n.e:n.b,n)},ML=function(e,n){return n.set(n.t,n.p,e!==1?n.b:n.e,n)},Bre=function(e,n,r){return e.style[n]=r},Zre=function(e,n,r){return e.style.setProperty(n,r)},Wre=function(e,n,r){return e._gsap[n]=r},qre=function(e,n,r){return e._gsap.scaleX=e._gsap.scaleY=r},Gre=function(e,n,r,s,i){var o=e._gsap;o.scaleX=o.scaleY=r,o.renderTransform(i,o)},Kre=function(e,n,r,s,i){var o=e._gsap;o[n]=r,o.renderTransform(i,o)},kn="transform",ss=kn+"Origin",Yre=function t(e,n){var r=this,s=this.target,i=s.style,o=s._gsap;if(e in Xo&&i){if(this.tfm=this.tfm||{},e!=="transform")e=Gi[e]||e,~e.indexOf(",")?e.split(",").forEach(function(l){return r.tfm[l]=Io(s,l)}):this.tfm[e]=o.x?o[e]:Io(s,e),e===ss&&(this.tfm.zOrigin=o.zOrigin);else return Gi.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(ss,n,"")),e=kn}(i||n)&&this.props.push(e,n,i[e])},IL=function(e){e.translate&&(e.removeProperty("translate"),e.removeProperty("scale"),e.removeProperty("rotate"))},Xre=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(M4,"-$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=R4(),(!i||!i.isStart)&&!r[kn]&&(IL(r),s.zOrigin&&r[ss]&&(r[ss]+=" "+s.zOrigin+"px",s.zOrigin=0,s.renderTransform()),s.uncache=1)}},OL=function(e,n){var r={target:e,props:[],revert:Xre,save:Yre};return e._gsap||is.core.getCache(e),n&&e.style&&e.nodeType&&n.split(",").forEach(function(s){return r.save(s)}),r},LL,fx=function(e,n){var r=za.createElementNS?za.createElementNS((n||"http://www.w3.org/1999/xhtml").replace(/^https/,"http"),e):za.createElement(e);return r&&r.style?r:za.createElement(e)},ks=function t(e,n,r){var s=getComputedStyle(e);return s[n]||s.getPropertyValue(n.replace(M4,"-$1").toLowerCase())||s.getPropertyValue(n)||!r&&t(e,bd(n)||n,1)||""},_P="O,Moz,ms,Ms,Webkit".split(","),bd=function(e,n,r){var s=n||Yl,i=s.style,o=5;if(e in i&&!r)return e;for(e=e.charAt(0).toUpperCase()+e.substr(1);o--&&!(_P[o]+e in i););return o<0?null:(o===3?"ms":o>=0?_P[o]:"")+e},hx=function(){jre()&&window.document&&(gP=window,za=gP.document,Fu=za.documentElement,Yl=fx("div")||{style:{}},fx("div"),kn=bd(kn),ss=kn+"Origin",Yl.style.cssText="border-width:0;line-height:0;position:absolute;padding:0",LL=!!bd("perspective"),R4=is.core.reverting,T4=1)},wP=function(e){var n=e.ownerSVGElement,r=fx("svg",n&&n.getAttribute("xmlns")||"http://www.w3.org/2000/svg"),s=e.cloneNode(!0),i;s.style.display="block",r.appendChild(s),Fu.appendChild(r);try{i=s.getBBox()}catch{}return r.removeChild(s),Fu.removeChild(r),i},xP=function(e,n){for(var r=n.length;r--;)if(e.hasAttribute(n[r]))return e.getAttribute(n[r])},NL=function(e){var n,r;try{n=e.getBBox()}catch{n=wP(e),r=1}return n&&(n.width||n.height)||r||(n=wP(e)),n&&!n.width&&!n.x&&!n.y?{x:+xP(e,["x","cx","x1"])||0,y:+xP(e,["y","cy","y1"])||0,width:0,height:0}:n},DL=function(e){return!!(e.getCTM&&(!e.parentNode||e.ownerSVGElement)&&NL(e))},rl=function(e,n){if(n){var r=e.style,s;n in Xo&&n!==ss&&(n=kn),r.removeProperty?(s=n.substr(0,2),(s==="ms"||n.substr(0,6)==="webkit")&&(n="-"+n),r.removeProperty(s==="--"?n:n.replace(M4,"-$1").toLowerCase())):r.removeAttribute(n)}},Ua=function(e,n,r,s,i,o){var l=new rs(e._pt,n,r,0,1,o?ML:RL);return e._pt=l,l.b=s,l.e=i,e._props.push(r),l},bP={deg:1,rad:1,turn:1},Qre={grid:1,flex:1},sl=function t(e,n,r,s){var i=parseFloat(r)||0,o=(r+"").trim().substr((i+"").length)||"px",l=Yl.style,u=$re.test(n),d=e.tagName.toLowerCase()==="svg",f=(d?"client":"offset")+(u?"Width":"Height"),h=100,g=s==="px",v=s==="%",w,_,x,S;if(s===o||!i||bP[s]||bP[o])return i;if(o!=="px"&&!g&&(i=t(e,n,r,"px")),S=e.getCTM&&DL(e),(v||o==="%")&&(Xo[n]||~n.indexOf("adius")))return w=S?e.getBBox()[u?"width":"height"]:e[f],On(v?i/w*h:i/100*w);if(l[u?"width":"height"]=h+(g?o:s),_=s!=="rem"&&~n.indexOf("adius")||s==="em"&&e.appendChild&&!d?e:e.parentNode,S&&(_=(e.ownerSVGElement||{}).parentNode),(!_||_===za||!_.appendChild)&&(_=za.body),x=_._gsap,x&&v&&x.width&&u&&x.time===bs.time&&!x.uncache)return On(i/x.width*h);if(v&&(n==="height"||n==="width")){var k=e.style[n];e.style[n]=h+s,w=e[f],k?e.style[n]=k:rl(e,n)}else(v||o==="%")&&!Qre[ks(_,"display")]&&(l.position=ks(e,"position")),_===e&&(l.position="static"),_.appendChild(Yl),w=Yl[f],_.removeChild(Yl),l.position="absolute";return u&&v&&(x=fc(_),x.time=bs.time,x.width=_[f]),On(g?w*i/h:w&&i?h/w*i:0)},Io=function(e,n,r,s){var i;return T4||hx(),n in Gi&&n!=="transform"&&(n=Gi[n],~n.indexOf(",")&&(n=n.split(",")[0])),Xo[n]&&n!=="transform"?(i=Zh(e,s),i=n!=="transformOrigin"?i[n]:i.svg?i.origin:Dg(ks(e,ss))+" "+i.zOrigin+"px"):(i=e.style[n],(!i||i==="auto"||s||~(i+"").indexOf("calc("))&&(i=Ng[n]&&Ng[n](e,n,r)||ks(e,n)||eL(e,n)||(n==="opacity"?1:0))),r&&!~(i+"").trim().indexOf(" ")?sl(e,n,i,r)+r:i},Jre=function(e,n,r,s){if(!r||r==="none"){var i=bd(n,e,1),o=i&&ks(e,i,1);o&&o!==r?(n=i,r=o):n==="borderColor"&&(r=ks(e,"borderTopColor"))}var l=new rs(this._pt,e.style,n,0,1,PL),u=0,d=0,f,h,g,v,w,_,x,S,k,C,A,T;if(l.b=r,l.e=s,r+="",s+="",s.substring(0,6)==="var(--"&&(s=ks(e,s.substring(4,s.indexOf(")")))),s==="auto"&&(_=e.style[n],e.style[n]=s,s=ks(e,n)||s,_?e.style[n]=_:rl(e,n)),f=[r,s],_L(f),r=f[0],s=f[1],g=r.match(Ru)||[],T=s.match(Ru)||[],T.length){for(;h=Ru.exec(s);)x=h[0],k=s.substring(u,h.index),w?w=(w+1)%5:(k.substr(-5)==="rgba("||k.substr(-5)==="hsla(")&&(w=1),x!==(_=g[d++]||"")&&(v=parseFloat(_)||0,A=_.substr((v+"").length),x.charAt(1)==="="&&(x=$u(v,x)+A),S=parseFloat(x),C=x.substr((S+"").length),u=Ru.lastIndex-C.length,C||(C=C||Ps.units[n]||A,u===s.length&&(s+=C,l.e+=C)),A!==C&&(v=sl(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"?ML:RL;return K9.test(s)&&(l.e=0),this._pt=l,l},SP={top:"0%",bottom:"100%",left:"0%",right:"100%",center:"50%"},ese=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]=SP[r]||r,n[1]=SP[s]||s,n.join(" ")},tse=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],Xo[l]&&(u=1,l=l==="transformOrigin"?ss:kn),rl(r,l);u&&(rl(r,kn),o&&(o.svg&&r.removeAttribute("transform"),s.scale=s.rotate=s.translate="none",Zh(r,1),o.uncache=1,IL(s)))}},Ng={clearProps:function(e,n,r,s,i){if(i.data!=="isFromStart"){var o=e._pt=new rs(e._pt,n,r,0,0,tse);return o.u=s,o.pr=-10,o.tween=i,e._props.push(r),1}}},Bh=[1,0,0,1,0,0],jL={},$L=function(e){return e==="matrix(1, 0, 0, 1, 0, 0)"||e==="none"||!e},kP=function(e){var n=ks(e,kn);return $L(n)?Bh:n.substr(7).match(G9).map(On)},I4=function(e,n){var r=e._gsap||fc(e),s=e.style,i=kP(e),o,l,u,d;return r.svg&&e.getAttribute("transform")?(u=e.transform.baseVal.consolidate().matrix,i=[u.a,u.b,u.c,u.d,u.e,u.f],i.join(",")==="1,0,0,1,0,0"?Bh:i):(i===Bh&&!e.offsetParent&&e!==Fu&&!r.svg&&(u=s.display,s.display="block",o=e.parentNode,(!o||!e.offsetParent&&!e.getBoundingClientRect().width)&&(d=1,l=e.nextElementSibling,Fu.appendChild(e)),i=kP(e),u?s.display=u:rl(e,"display"),d&&(l?o.insertBefore(e,l):o?o.appendChild(e):Fu.removeChild(e))),n&&i.length>6?[i[0],i[1],i[4],i[5],i[12],i[13]]:i)},px=function(e,n,r,s,i,o){var l=e._gsap,u=i||I4(e,!0),d=l.xOrigin||0,f=l.yOrigin||0,h=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(" "),A=parseFloat(C[0])||0,T=parseFloat(C[1])||0,I,M,R,O;r?u!==Bh&&(M=v*x-w*_)&&(R=A*(x/M)+T*(-_/M)+(_*k-x*S)/M,O=A*(-w/M)+T*(v/M)-(v*k-w*S)/M,A=R,T=O):(I=NL(e),A=I.x+(~C[0].indexOf("%")?A/100*I.width:A),T=I.y+(~(C[1]||C[0]).indexOf("%")?T/100*I.height:T)),s||s!==!1&&l.smooth?(S=A-d,k=T-f,l.xOffset=h+(S*v+k*_)-S,l.yOffset=g+(S*w+k*x)-k):l.xOffset=l.yOffset=0,l.xOrigin=A,l.yOrigin=T,l.smooth=!!s,l.origin=n,l.originIsAbsolute=!!r,e.style[ss]="0px 0px",o&&(Ua(o,l,"xOrigin",d,A),Ua(o,l,"yOrigin",f,T),Ua(o,l,"xOffset",h,l.xOffset),Ua(o,l,"yOffset",g,l.yOffset)),e.setAttribute("data-svg-origin",A+" "+T)},Zh=function(e,n){var r=e._gsap||new xL(e);if("x"in r&&!n&&!r.uncache)return r;var s=e.style,i=r.scaleX<0,o="px",l="deg",u=getComputedStyle(e),d=ks(e,ss)||"0",f,h,g,v,w,_,x,S,k,C,A,T,I,M,R,O,N,D,F,K,B,G,H,Y,U,J,Z,j,Q,oe,ne,se;return f=h=g=_=x=S=k=C=A=0,v=w=1,r.svg=!!(e.getCTM&&DL(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=I4(e,r.svg),r.svg&&(r.uncache?(U=e.getBBox(),d=r.xOrigin-U.x+"px "+(r.yOrigin-U.y)+"px",Y=""):Y=!n&&e.getAttribute("data-svg-origin"),px(e,Y||d,!!Y||r.originIsAbsolute,r.smooth!==!1,M)),T=r.xOrigin||0,I=r.yOrigin||0,M!==Bh&&(D=M[0],F=M[1],K=M[2],B=M[3],f=G=M[4],h=H=M[5],M.length===6?(v=Math.sqrt(D*D+F*F),w=Math.sqrt(B*B+K*K),_=D||F?yu(F,D)*Wl:0,k=K||B?yu(K,B)*Wl+_:0,k&&(w*=Math.abs(Math.cos(k*Vu))),r.svg&&(f-=T-(T*D+I*K),h-=I-(T*F+I*B))):(se=M[6],oe=M[7],Z=M[8],j=M[9],Q=M[10],ne=M[11],f=M[12],h=M[13],g=M[14],R=yu(se,Q),x=R*Wl,R&&(O=Math.cos(-R),N=Math.sin(-R),Y=G*O+Z*N,U=H*O+j*N,J=se*O+Q*N,Z=G*-N+Z*O,j=H*-N+j*O,Q=se*-N+Q*O,ne=oe*-N+ne*O,G=Y,H=U,se=J),R=yu(-K,Q),S=R*Wl,R&&(O=Math.cos(-R),N=Math.sin(-R),Y=D*O-Z*N,U=F*O-j*N,J=K*O-Q*N,ne=B*N+ne*O,D=Y,F=U,K=J),R=yu(F,D),_=R*Wl,R&&(O=Math.cos(R),N=Math.sin(R),Y=D*O+F*N,U=G*O+H*N,F=F*O-D*N,H=H*O-G*N,D=Y,G=U),x&&Math.abs(x)+Math.abs(_)>359.9&&(x=_=0,S=180-S),v=On(Math.sqrt(D*D+F*F+K*K)),w=On(Math.sqrt(H*H+se*se)),R=yu(G,H),k=Math.abs(R)>2e-4?R*Wl:0,A=ne?1/(ne<0?-ne:ne):0),r.svg&&(Y=e.getAttribute("transform"),r.forceCSS=e.setAttribute("transform","")||!$L(ks(e,kn)),Y&&e.setAttribute("transform",Y))),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=h-((r.yPercent=h&&(!n&&r.yPercent||(Math.round(e.offsetHeight/2)===Math.round(-h)?-50:0)))?e.offsetHeight*r.yPercent/100:0)+o,r.z=g+o,r.scaleX=On(v),r.scaleY=On(w),r.rotation=On(_)+l,r.rotationX=On(x)+l,r.rotationY=On(S)+l,r.skewX=k+l,r.skewY=C+l,r.transformPerspective=A+o,(r.zOrigin=parseFloat(d.split(" ")[2])||!n&&r.zOrigin||0)&&(s[ss]=Dg(d)),r.xOffset=r.yOffset=0,r.force3D=Ps.force3D,r.renderTransform=r.svg?rse:LL?FL:nse,r.uncache=0,r},Dg=function(e){return(e=e.split(" "))[0]+" "+e[1]},B_=function(e,n,r){var s=Cr(n);return On(parseFloat(n)+parseFloat(sl(e,"x",r+"px",s)))+s},nse=function(e,n){n.z="0px",n.rotationY=n.rotationX="0deg",n.force3D=0,FL(e,n)},Fl="0deg",Tf="0px",Vl=") ",FL=function(e,n){var r=n||this,s=r.xPercent,i=r.yPercent,o=r.x,l=r.y,u=r.z,d=r.rotation,f=r.rotationY,h=r.rotationX,g=r.skewX,v=r.skewY,w=r.scaleX,_=r.scaleY,x=r.transformPerspective,S=r.force3D,k=r.target,C=r.zOrigin,A="",T=S==="auto"&&e&&e!==1||S===!0;if(C&&(h!==Fl||f!==Fl)){var I=parseFloat(f)*Vu,M=Math.sin(I),R=Math.cos(I),O;I=parseFloat(h)*Vu,O=Math.cos(I),o=B_(k,o,M*O*-C),l=B_(k,l,-Math.sin(I)*-C),u=B_(k,u,R*O*-C+C)}x!==Tf&&(A+="perspective("+x+Vl),(s||i)&&(A+="translate("+s+"%, "+i+"%) "),(T||o!==Tf||l!==Tf||u!==Tf)&&(A+=u!==Tf||T?"translate3d("+o+", "+l+", "+u+") ":"translate("+o+", "+l+Vl),d!==Fl&&(A+="rotate("+d+Vl),f!==Fl&&(A+="rotateY("+f+Vl),h!==Fl&&(A+="rotateX("+h+Vl),(g!==Fl||v!==Fl)&&(A+="skew("+g+", "+v+Vl),(w!==1||_!==1)&&(A+="scale("+w+", "+_+Vl),k.style[kn]=A||"translate(0, 0)"},rse=function(e,n){var r=n||this,s=r.xPercent,i=r.yPercent,o=r.x,l=r.y,u=r.rotation,d=r.skewX,f=r.skewY,h=r.scaleX,g=r.scaleY,v=r.target,w=r.xOrigin,_=r.yOrigin,x=r.xOffset,S=r.yOffset,k=r.forceCSS,C=parseFloat(o),A=parseFloat(l),T,I,M,R,O;u=parseFloat(u),d=parseFloat(d),f=parseFloat(f),f&&(f=parseFloat(f),d+=f,u+=f),u||d?(u*=Vu,d*=Vu,T=Math.cos(u)*h,I=Math.sin(u)*h,M=Math.sin(u-d)*-g,R=Math.cos(u-d)*g,d&&(f*=Vu,O=Math.tan(d-f),O=Math.sqrt(1+O*O),M*=O,R*=O,f&&(O=Math.tan(f),O=Math.sqrt(1+O*O),T*=O,I*=O)),T=On(T),I=On(I),M=On(M),R=On(R)):(T=h,R=g,I=M=0),(C&&!~(o+"").indexOf("px")||A&&!~(l+"").indexOf("px"))&&(C=sl(v,"x",o,"px"),A=sl(v,"y",l,"px")),(w||_||x||S)&&(C=On(C+w-(w*T+_*M)+x),A=On(A+_-(w*I+_*R)+S)),(s||i)&&(O=v.getBBox(),C=On(C+s/100*O.width),A=On(A+i/100*O.height)),O="matrix("+T+","+I+","+M+","+R+","+C+","+A+")",v.setAttribute("transform",O),k&&(v.style[kn]=O)},sse=function(e,n,r,s,i){var o=360,l=lr(i),u=parseFloat(i)*(l&&~i.indexOf("rad")?Wl:1),d=u-s,f=s+d+"deg",h,g;return l&&(h=i.split("_")[1],h==="short"&&(d%=o,d!==d%(o/2)&&(d+=d<0?o:-o)),h==="cw"&&d<0?d=(d+o*yP)%o-~~(d/o)*o:h==="ccw"&&d>0&&(d=(d-o*yP)%o-~~(d/o)*o)),e._pt=g=new rs(e._pt,n,r,s,d,Vre),g.e=f,g.u="deg",e._props.push(r),g},EP=function(e,n){for(var r in n)e[r]=n[r];return e},ise=function(e,n,r){var s=EP({},r._gsap),i="perspective,force3D,transformOrigin,svgOrigin",o=r.style,l,u,d,f,h,g,v,w;s.svg?(d=r.getAttribute("transform"),r.setAttribute("transform",""),o[kn]=n,l=Zh(r,1),rl(r,kn),r.setAttribute("transform",d)):(d=getComputedStyle(r)[kn],o[kn]=n,l=Zh(r,1),o[kn]=d);for(u in Xo)d=s[u],f=l[u],d!==f&&i.indexOf(u)<0&&(v=Cr(d),w=Cr(f),h=v!==w?sl(r,u,d,w):parseFloat(d),g=parseFloat(f),e._pt=new rs(e._pt,l,u,h,g-h,dx),e._pt.u=w||0,e._props.push(u));EP(l,s)};ns("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});Ng[e>1?"border"+t:t]=function(l,u,d,f,h){var g,v;if(arguments.length<4)return g=o.map(function(w){return Io(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,h)}});var VL={name:"css",register:hx,targetTest:function(e){return e.style&&e.nodeType},init:function(e,n,r,s,i){var o=this._props,l=e.style,u=r.vars.startAt,d,f,h,g,v,w,_,x,S,k,C,A,T,I,M,R,O;T4||hx(),this.styles=this.styles||OL(e),R=this.styles.props,this.tween=r;for(_ in n)if(_!=="autoRound"&&(f=n[_],!(_s[_]&&bL(_,n,r,s,e,i)))){if(v=typeof f,w=Ng[_],v==="function"&&(f=f.call(r,s,e,i),v=typeof f),v==="string"&&~f.indexOf("random(")&&(f=Hh(f)),w)w(this,e,_,f,r)&&(M=1);else if(_.substr(0,2)==="--")d=(getComputedStyle(e).getPropertyValue(_)+"").trim(),f+="",qa.lastIndex=0,qa.test(d)||(x=Cr(d),S=Cr(f),S?x!==S&&(d=sl(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[_],lr(d)&&~d.indexOf("random(")&&(d=Hh(d)),Cr(d+"")||d==="auto"||(d+=Ps.units[_]||Cr(Io(e,_))||""),(d+"").charAt(1)==="="&&(d=Io(e,_))):d=Io(e,_),g=parseFloat(d),k=v==="string"&&f.charAt(1)==="="&&f.substr(0,2),k&&(f=f.substr(2)),h=parseFloat(f),_ in Gi&&(_==="autoAlpha"&&(g===1&&Io(e,"visibility")==="hidden"&&h&&(g=0),R.push("visibility",0,l.visibility),Ua(this,l,"visibility",g?"inherit":"hidden",h?"inherit":"hidden",!h)),_!=="scale"&&_!=="transform"&&(_=Gi[_],~_.indexOf(",")&&(_=_.split(",")[0]))),C=_ in Xo,C){if(this.styles.save(_),O=f,v==="string"&&f.substring(0,6)==="var(--"){if(f=ks(e,f.substring(4,f.indexOf(")"))),f.substring(0,5)==="calc("){var N=e.style.perspective;e.style.perspective=f,f=ks(e,"perspective"),N?e.style.perspective=N:rl(e,"perspective")}h=parseFloat(f)}if(A||(T=e._gsap,T.renderTransform&&!n.parseTransform||Zh(e,n.parseTransform),I=n.smoothOrigin!==!1&&T.smooth,A=this._pt=new rs(this._pt,l,kn,0,1,T.renderTransform,T,0,-1),A.dep=1),_==="scale")this._pt=new rs(this._pt,T,"scaleY",T.scaleY,(k?$u(T.scaleY,k+h):h)-T.scaleY||0,dx),this._pt.u=0,o.push("scaleY",_),_+="X";else if(_==="transformOrigin"){R.push(ss,0,l[ss]),f=ese(f),T.svg?px(e,f,0,I,0,this):(S=parseFloat(f.split(" ")[2])||0,S!==T.zOrigin&&Ua(this,T,"zOrigin",T.zOrigin,S),Ua(this,l,_,Dg(d),Dg(f)));continue}else if(_==="svgOrigin"){px(e,f,1,I,0,this);continue}else if(_ in jL){sse(this,T,_,g,k?$u(g,k+f):f);continue}else if(_==="smoothOrigin"){Ua(this,T,"smooth",T.smooth,f);continue}else if(_==="force3D"){T[_]=f;continue}else if(_==="transform"){ise(this,f,e);continue}}else _ in l||(_=bd(_)||_);if(C||(h||h===0)&&(g||g===0)&&!Fre.test(f)&&_ in l)x=(d+"").substr((g+"").length),h||(h=0),S=Cr(f)||(_ in Ps.units?Ps.units[_]:x),x!==S&&(g=sl(e,_,d,S)),this._pt=new rs(this._pt,C?T:l,_,g,(k?$u(g,k+h):h)-g,!C&&(S==="px"||_==="zIndex")&&n.autoRound!==!1?Ure:dx),this._pt.u=S||0,C&&O!==f?(this._pt.b=d,this._pt.e=O,this._pt.r=zre):x!==S&&S!=="%"&&(this._pt.b=d,this._pt.r=Hre);else if(_ in l)Jre.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"){_4(_,f);continue}C||(_ in l?R.push(_,0,l[_]):typeof e[_]=="function"?R.push(_,2,e[_]()):R.push(_,1,d||e[_])),o.push(_)}}M&&AL(this)},render:function(e,n){if(n.tween._time||!R4())for(var r=n._pt;r;)r.r(e,r.d),r=r._next;else n.styles.revert()},get:Io,aliases:Gi,getSetter:function(e,n,r){var s=Gi[n];return s&&s.indexOf(",")<0&&(n=s),n in Xo&&n!==ss&&(e._gsap.x||Io(e,"x"))?r&&vP===r?n==="scale"?qre:Wre:(vP=r||{})&&(n==="scale"?Gre:Kre):e.style&&!g4(e.style[n])?Bre:~n.indexOf("-")?Zre:P4(e,n)},core:{_removeProperty:rl,_getMatrix:I4}};is.utils.checkPrefix=bd;is.core.getStyleSaver=OL;(function(t,e,n,r){var s=ns(t+","+e+","+n,function(i){Xo[i]=1});ns(e,function(i){Ps.units[i]="deg",jL[i]=1}),Gi[s[13]]=t+","+e,ns(r,function(i){var o=i.split(":");Gi[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");ns("x,y,z,top,right,bottom,left,width,height,fontSize,padding,margin,perspective",function(t){Ps.units[t]="px"});is.registerPlugin(VL);var pi=is.registerPlugin(VL)||is;pi.core.Tween;const Am="/assets/logo-animation",Z_=1280,ose=[{id:"eraser",src:`${Am}/eraser.png`,cssW:189,cssH:74,rot:-90,fit:337,localX:60,localY:168,seaX:.2,seaY:.27,seaRot:-8},{id:"clasp",src:`${Am}/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:`${Am}/playdough.png`,cssW:236,cssH:206,rot:5,fit:150,localX:182,localY:277,seaX:.52,seaY:.79,seaRot:6}],ase=[{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}],mx=({className:t})=>{const e=m.useRef(null),n=m.useRef(null),r=m.useRef(null);return m.useEffect(()=>{const s=e.current,i=n.current,o=r.current;if(!s||!i||!o)return;const l=window.matchMedia("(prefers-reduced-motion: reduce)").matches,u=(S,k)=>S+Math.random()*(k-S);let d=null,f,h=1;const g=ose.map(S=>({...S})),v=()=>{s.querySelectorAll(".la-obj").forEach(R=>R.remove());const S=s.getBoundingClientRect(),k=S.width||Z_,C=S.height||Z_*.64;h=k/Z_,i.style.width=`${242*h}px`,i.style.height=`${250*h}px`;const T=250*h/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 ase.forEach((R,O)=>{const N=R.w*h,D=M(`${Am}/sea/${R.k}.png`,N,O%2===0);pi.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*h;R.el=M(R.src,O,!!R.flip),R.finalScale=R.fit*T/(R.cssW*h),pi.set(R.el,{x:R.seaX*k-O/2,y:R.seaY*C-R.cssH*h/2,rotation:R.seaRot,opacity:1,scale:0,transformOrigin:"50% 50%",zIndex:30}),I.push({el:R.el,hero:!0,rest:150/R.cssW})}),I},w=(S,k)=>{const C=s.getBoundingClientRect(),A=o.getBoundingClientRect();return{x:A.left-C.left+S/326*A.width,y:A.top-C.top+k/337*A.height}},_=()=>{d&&d.revert();const S=v();if(l){d=pi.context(()=>{S.filter(A=>!A.hero).forEach(A=>pi.set(A.el,{scale:0})),g.forEach(A=>{if(!A.el)return;const T=w(A.localX,A.localY);pi.set(A.el,{x:T.x-A.cssW*h/2,y:T.y-A.cssH*h/2,rotation:A.rot,scale:A.finalScale})})},s);return}const k=[],C=[];d=pi.context(()=>{const A=pi.timeline();A.to(S.map(T=>T.el),{scale:T=>S[T].rest,duration:.5,ease:"steps(4)",stagger:{each:.045,from:"random"}}),A.add(()=>{S.forEach(({el:T,hero:I},M)=>{const R=I?k:C,O=M%2?1:-1;R.push(pi.to(T,{rotation:"+="+u(2.5,6)*O,duration:u(.5,.9),repeat:-1,yoyo:!0,ease:"steps(2)",delay:u(0,.4)}),pi.to(T,{y:"+="+u(5,11)*O,x:"+="+u(4,9)*-O,duration:u(.7,1.2),repeat:-1,yoyo:!0,ease:"steps(3)",delay:u(0,.4)}))})},"<0.1"),A.to({},{duration:1.1}),A.add("pick"),g.forEach((T,I)=>{T.el&&A.to(T.el,{scale:150/T.cssW*1.2,duration:.28,ease:"steps(3)",yoyo:!0,repeat:1},"pick+="+I*.08)}),A.add("clear","pick+=0.7"),A.add(()=>C.forEach(T=>T.kill()),"clear"),A.to(S.filter(T=>!T.hero).map(T=>T.el),{scale:0,rotation:"+=40",duration:.5,ease:"steps(5)",overwrite:"auto",stagger:{each:.025,from:"random"}},"clear"),A.add("assemble","clear+=0.25"),A.add(()=>k.forEach(T=>T.kill()),"assemble"),g.forEach((T,I)=>{if(!T.el||T.finalScale===void 0)return;const M=w(T.localX,T.localY);A.to(T.el,{x:M.x-T.cssW*h/2,y:M.y-T.cssH*h/2,rotation:T.rot,scale:T.finalScale,duration:1.05,ease:"steps(9)",overwrite:"auto"},"assemble+="+I*.12)}),g.forEach(T=>{!T.el||T.finalScale===void 0||A.to(T.el,{scale:T.finalScale*1.03,duration:.16,ease:"steps(2)",yoyo:!0,repeat:1},"assemble+=1.45")})},s)};pi.ticker.fps(12),_();const 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"})})})},lse=Object.freeze(Object.defineProperty({__proto__:null,default:mx},Symbol.toStringTag,{value:"Module"})),CP=({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"})]}),cse=({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(mx,{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(CP,{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(mx,{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(CP,{isSigningIn:t})}),n?b.jsx("p",{className:"text-center text-xs text-red-500",children:n}):null]})]}),use="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",dse=({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:use,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(ev,{className:"h-5 w-5 shrink-0 animate-spin text-primary",weight:"bold"}),b.jsx("span",{children:t})]})]})}),fse="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",jg=44,Rf=8,em=16,hse=4,PP=-18,pse=.18,mse=[.22,1,.36,1],AP=.92,gse=1,vse=.95,yse=.4,_se=[.19,1,.22,1],W_=0,wse=1,xse=0,bse=0,Sse=0,HL=({position:t,viewport:e,boundsLeft:n=0})=>{const r=n+Rf,s=Math.max(r,e.width-jg-Rf),i=Math.max(Rf,e.height-jg-Rf);return{x:Math.min(s,Math.max(r,t.x)),y:Math.min(i,Math.max(Rf,t.y))}},O4=()=>({width:window.innerWidth,height:window.innerHeight}),kse=({position:t,boundsLeftPx:e=0})=>HL({position:t,viewport:O4(),boundsLeft:e}),Ese=()=>{if(typeof window>"u")return{x:em,y:em};const t=O4();return{x:t.width-jg-em,y:t.height-jg-em}},Cse=({deltaX:t,deltaY:e})=>Math.hypot(t,e)>=hse,Pse=t=>t.button===void 0||t.button<=Sse,TP=t=>{const e=t.nativeEvent;return{x:Number.isFinite(t.clientX)?t.clientX:e.clientX,y:Number.isFinite(t.clientY)?t.clientY:e.clientY}},Ase=({isVisible:t,isPanelOpen:e,isReducedMotion:n,position:r,dragBoundsLeftPx:s=0,onToggle:i,onPositionChange:o})=>{const l=m.useRef(null),u=m.useRef(!1),[d,f]=m.useState(!1),[h,g]=m.useState(!1),v=n?!1:{opacity:W_,scale:AP,x:PP},w=n?{opacity:W_}:{opacity:W_,scale:AP,x:PP},_=n?{duration:bse}:{duration:pse,ease:mse,scale:{duration:yse,ease:_se}},x=m.useCallback(()=>{const T=l.current;T&&(u.current=T.hasMoved),l.current=null,f(!1)},[]),S=m.useCallback(T=>{const I=l.current;if(!I)return;const M=TP(T),R=M.x-I.startPointer.x,O=M.y-I.startPointer.y,N=I.hasMoved||Cse({deltaX:R,deltaY:O});l.current={...I,hasMoved:N},N&&o(HL({position:{x:I.startPosition.x+R,y:I.startPosition.y+O},viewport:O4(),boundsLeft:s}))},[o,s]),k=m.useCallback(T=>{if(l.current||!Pse(T))return;const I=TP(T);l.current={startPointer:I,startPosition:r,hasMoved:!1},f(!0)},[r]),C=m.useCallback(()=>{if(u.current){u.current=!1;return}i()},[i]),A=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(Cs,{children:t?b.jsx(kc,{label:A,side:"top",forceOpen:h&&!d?void 0:!1,children:b.jsx(Si.button,{type:"button","aria-label":A,"data-cy":"reopen-panel",onMouseEnter:()=>g(!0),onMouseLeave:()=>g(!1),initial:v,animate:{opacity:wse,scale:gse,x:xse},whileTap:{scale:vse},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:fse,alt:"","aria-hidden":"true",draggable:!1,className:"h-4 w-4 brightness-0 invert"})})}):null})]})},q_=Ms("useConfig"),Tse=300*1e3,Rse=1800*1e3,Mse=60*1e3,Ise=300*1e3,Ose=()=>{var t;return typeof window>"u"?null:((t=window.__RIVET_BOOTSTRAP__)==null?void 0:t.queueAccessToken)??null},Lse=()=>{var t;return typeof window>"u"?null:((t=window.__RIVET_BOOTSTRAP__)==null?void 0:t.agentApplyMode)??null},Nse=Tn({agentModeAvailable:xh(),email:Xe().optional(),userId:Xe().optional(),name:Xe().optional(),isMCPSession:xh(),mcpEditor:Xe().nullable(),agentApplyMode:Zg(["embedded","external"]).nullable().optional(),queueAccessToken:Xe().nullable().optional(),projectPath:Xe(),projectId:Xe().uuid().nullable().optional(),libraryOrigin:Xe().url().nullable()}),Dse=Tn({featureFlags:zT(Xe(),Tn({isEnabled:xh()})).optional()}),jse=t=>({...l9,...t??{}}),$se=()=>{const t=dt(Gw),e=gt(Gw),n=gt(v9),r=gt(y9),s=gt(yv),i=gt(Cee),o=gt(kee),l=gt(See),u=gt(vv),d=gt(yee),f=gt(g9),h=m.useCallback(k=>{o(k.agentModeAvailable),f(k.projectId??null),d({name:k.name??null,email:k.email??null}),k.isMCPSession&&n(!0),k.mcpEditor&&r(k.mcpEditor),s(k.agentApplyMode??Lse()??null),i(k.queueAccessToken??Ose())},[s,o,n,r,i,f,d]),g=uh({queryKey:["rivet-config"],queryFn:async()=>{const k=await fetch("/api/config");if(!k.ok)throw new Error(`Failed to fetch config: ${k.statusText}`);return Nse.parse(await k.json())},staleTime:Tse,gcTime:Rse}),v=uh({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 Dse.parse(await k.json())},staleTime:Mse,gcTime:Ise}),{refetch:w}=g,{refetch:_}=v;m.useLayoutEffect(()=>{g.data&&(h(g.data),u(!1),q_.info("Config loaded:",g.data)),v.data&&(e(jse(v.data.featureFlags)),l(!0))},[g.data,v.data,h,u,e,l]),m.useLayoutEffect(()=>{g.error&&(l(!0),u(!1),q_.warn("Failed to load config:",g.error instanceof Error?g.error.message:"Failed to load config")),v.error&&(l(!0),q_.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}},_u=Ms("useOAuthCallback"),Fse="https://rivet-proxy.onrender.com",Vse=()=>{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{_u.info("Processing OAuth callback...");const f=new URLSearchParams(i.substring(1)),h=f.get("access_token"),g=f.get("refresh_token"),w=new URLSearchParams(o).get("session");if(!h)throw new Error("No access token found in URL");if(!w)throw new Error("No session ID found in URL");_u.info(`Completing OAuth with session: ${w}`);const _=await fetch(`${Fse}/api/auth/google/complete`,{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({sessionId:w,accessToken:h,refreshToken:g}),signal:n.signal}),x=await _.json();if(!_.ok||!x.success)throw new Error(x.error||x.message||"Failed to complete authentication");if(_u.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&&h)try{const k=await fetch("/api/auth/store",{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({email:x.user.email,token:h,refreshToken:g,userId:x.user.id}),signal:n.signal});k.ok||_u.warn(`Local auth store returned ${k.status}`)}catch(k){if(r)return;_u.warn("Failed to store auth locally:",k)}if(r)return;window.sessionStorage.setItem(Tg,"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 h=f instanceof Error?f.message:"Unknown error occurred";_u.warn("OAuth callback error:",f),e({isProcessing:!1,isComplete:!1,error:h})}}})(),()=>{r=!0,n.abort()}},[]),t},G_=Ms("useAgentVariantsSession"),Hse=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(jh,r=>{if(r.size===0)return r;const s=new Map(r);let i=!1;for(const[o,l]of r)l.status==="sending"&&l.variantRequestId&&(e.has(l.variantRequestId)||n&&l.variantRequest!==void 0)&&(s.delete(o),i=!0);return i?s:r})},zse=(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},Use=({enabled:t=!0}={})=>{const e=gt(cp),n=gt(p9),r=gt(c9),s=gt(vee),i=gt(m9),o=gt(bee),l=qg(),u=m.useRef(null);m.useEffect(()=>{if(n(!1),!t)return;const d=new EventSource("/api/variants/events");return d.onmessage=f=>{try{const h=JSON.parse(f.data),g=u.current;if(h.active){const _=new Set(h.variants.map(x=>x.requestId).filter(x=>!!x));i(x=>x.filter(k=>!_.has(k.requestId))),RP(l,_,!1),l.set(jh,x=>{let S=x;for(const k of h.variants){const C=k.adoptedSource;C&&(S=xee(S,{kind:"variant",sessionId:C.sessionId,variantId:C.variantId},{kind:"variant",sessionId:h.sessionId,variantId:k.workItemId}))}return S}),l.set(jh,x=>zse(x,h)),h.sessionId!==u.current&&(u.current=h.sessionId,r(!0),s("directions"))}else u.current=null,RP(l,new Set,Hse(h));e(h),n(!0);const v=!h.active&&g!==null,w=h.active&&h.sessionId!==g;if(w&&fetch(`/api/variants/${h.sessionId}/preview-port`,{method:"POST",headers:{"content-type":"application/json"},body:JSON.stringify({variantId:null})}).catch(_=>G_.warn("failed to reset preview-port on session switch",_)),v||w){const _=new Set;if(h.active)for(const S of h.variants)_.add(Nh({kind:"variant",sessionId:h.sessionId,variantId:S.workItemId}));const x=l.get(Ko);for(const S of[x==null?void 0:x.left,x==null?void 0:x.right])S&&_.add(Nh({kind:"variant",sessionId:S.sessionId,variantId:S.variantId}));o(_)}}catch(h){G_.warn("failed to parse SSE event payload",h)}},d.onerror=f=>{G_.warn("SSE error (auto-reconnects)",f)},()=>{d.close()}},[t,e,n,r,s,i,o,l])};var Bse=Object.defineProperty,ar=(t,e)=>Bse(t,"name",{value:e,configurable:!0});function L4(t){const e=t+"CollectionProvider",[n,r]=so(e),[s,i]=n(e,{collectionRef:{current:null},itemMap:new Map}),o=ar(_=>{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),A=Jt(x,C.collectionRef);return b.jsx(u,{ref:A,children:k})});d.displayName=l;const f=t+"CollectionItemSlot",h="data-radix-collection-item",g=Qa(f),v=m.forwardRef((_,x)=>{const{scope:S,children:k,...C}=_,A=m.useRef(null),T=Jt(x,A),I=i(f,S);return m.useEffect(()=>(I.itemMap.set(A,{ref:A,...C}),()=>void I.itemMap.delete(A))),b.jsx(g,{[h]:"",ref:T,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(`[${h}]`));return Array.from(x.itemMap.values()).sort((I,M)=>C.indexOf(I.ref.current)-C.indexOf(M.ref.current))},[x.collectionRef,x.itemMap])}return ar(w,"useCollection"),[{Provider:o,Slot:d,ItemSlot:v},w,r]}ar(L4,"createCollection");var MP=new WeakMap,Vn,ys,K_=(ys=class extends Map{constructor(n){super(n);rt(this,Vn);Re(this,Vn,[...super.keys()]),MP.set(this,!0)}set(n,r){return MP.get(this)&&(this.has(n)?W(this,Vn)[W(this,Vn).indexOf(n)]=n:W(this,Vn).push(n)),super.set(n,r),this}insert(n,r,s){const i=this.has(r),o=W(this,Vn).length,l=N4(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 h=[...W(this,Vn)];let g,v=!1;for(let w=u;w<f;w++)if(u===w){let _=h[w];h[w]===r&&(_=h[w+1]),i&&this.delete(r),g=this.get(_),this.set(r,s)}else{!v&&h[w-1]===r&&(v=!0);const _=h[v?w:w-1],x=g;g=this.get(_),this.delete(_),this.set(_,x)}return this}with(n,r,s){const i=new ys(this);return i.insert(n,r,s),i}before(n){const r=W(this,Vn).indexOf(n)-1;if(!(r<0))return this.entryAt(r)}setBefore(n,r,s){const i=W(this,Vn).indexOf(n);return i===-1?this:this.insert(i,r,s)}after(n){let r=W(this,Vn).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,Vn).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,Vn,[]),super.clear()}delete(n){const r=super.delete(n);return r&&W(this,Vn).splice(W(this,Vn).indexOf(n),1),r}deleteAt(n){const r=this.keyAt(n);return r!==void 0?this.delete(r):!1}at(n){const r=Tm(W(this,Vn),n);if(r!==void 0)return this.get(r)}entryAt(n){const r=Tm(W(this,Vn),n);if(r!==void 0)return[r,this.get(r)]}indexOf(n){return W(this,Vn).indexOf(n)}keyAt(n){return Tm(W(this,Vn),n)}from(n,r){const s=this.indexOf(n);if(s===-1)return;let i=s+r;return i<0&&(i=0),i>=this.size&&(i=this.size-1),this.at(i)}keyFrom(n,r){const s=this.indexOf(n);if(s===-1)return;let i=s+r;return i<0&&(i=0),i>=this.size&&(i=this.size-1),this.keyAt(i)}find(n,r){let s=0;for(const i of this){if(Reflect.apply(n,r,[i,s,this]))return i;s++}}findIndex(n,r){let s=0;for(const i of this){if(Reflect.apply(n,r,[i,s,this]))return s;s++}return-1}filter(n,r){const s=[];let i=0;for(const o of this)Reflect.apply(n,r,[o,i,this])&&s.push(o),i++;return new ys(s)}map(n,r){const s=[];let i=0;for(const o of this)s.push([o[0],Reflect.apply(n,r,[o,i,this])]),i++;return new ys(s)}reduce(...n){const[r,s]=n;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 ys(r)}toReversed(){const n=new ys;for(let r=this.size-1;r>=0;r--){const s=this.keyAt(r),i=this.get(s);n.set(s,i)}return n}toSpliced(...n){const r=[...this.entries()];return r.splice(...n),new ys(r)}slice(n,r){const s=new ys;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}},Vn=new WeakMap,ar(ys,"OrderedDict"),ys);function Tm(t,e){if("at"in Array.prototype)return Array.prototype.at.call(t,e);const n=zL(t,e);return n===-1?void 0:t[n]}ar(Tm,"at");function zL(t,e){const n=t.length,r=N4(e),s=r>=0?r:n+r;return s<0||s>=n?-1:s}ar(zL,"toSafeIndex");function N4(t){return t!==t||t===0?0:Math.trunc(t)}ar(N4,"toSafeInteger");function Zse(t){const e=t+"CollectionProvider",[n,r]=so(e),[s,i]=n(e,{collectionElement:null,collectionRef:{current:null},collectionRefObject:{current:null},itemMap:new K_,setItemMap:ar(()=>{},"setItemMap")}),o=ar(({state:C,...A})=>C?b.jsx(u,{...A,state:C}):b.jsx(l,{...A}),"CollectionProvider");o.displayName=e;const l=ar(C=>{const A=x();return b.jsx(u,{...C,state:A})},"CollectionInit");l.displayName=e+"Init";const u=ar(C=>{const{scope:A,children:T,state:I}=C,M=m.useRef(null),[R,O]=m.useState(null),N=Jt(M,O),[D,F]=I;return m.useEffect(()=>{if(!R)return;const K=ZL(()=>{});return K.observe(R,{childList:!0,subtree:!0}),()=>{K.disconnect()}},[R]),b.jsx(s,{scope:A,itemMap:D,setItemMap:F,collectionRef:N,collectionRefObject:M,collectionElement:R,children:T})},"CollectionProviderImpl");u.displayName=e+"Impl";const d=t+"CollectionSlot",f=Qa(d),h=m.forwardRef((C,A)=>{const{scope:T,children:I}=C,M=i(d,T),R=Jt(A,M.collectionRef);return b.jsx(f,{ref:R,children:I})});h.displayName=d;const g=t+"CollectionItemSlot",v="data-radix-collection-item",w=Qa(g),_=m.forwardRef((C,A)=>{const{scope:T,children:I,...M}=C,R=m.useRef(null),[O,N]=m.useState(null),D=Jt(A,R,N),F=i(g,T),{setItemMap:K}=F,B=m.useRef(M);UL(B.current,M)||(B.current=M);const G=B.current;return m.useEffect(()=>{const H=G;return K(Y=>O?Y.has(O)?Y.set(O,{...H,element:O}).toSorted(gx):(Y.set(O,{...H,element:O}),Y.toSorted(gx)):Y),()=>{K(Y=>!O||!Y.has(O)?Y:(Y.delete(O),new K_(Y)))}},[O,G,K]),b.jsx(w,{[v]:"",ref:D,children:I})});_.displayName=g;function x(){return m.useState(new K_)}ar(x,"useInitCollection");function S(C){const{itemMap:A}=i(t+"CollectionConsumer",C);return A}return ar(S,"useCollection"),[{Provider:o,Slot:h,ItemSlot:_},{createCollectionScope:r,useCollection:S,useInitCollection:x}]}ar(Zse,"createCollection");function UL(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}ar(UL,"shallowEqual");function BL(t,e){return!!(e.compareDocumentPosition(t)&Node.DOCUMENT_POSITION_PRECEDING)}ar(BL,"isElementPreceding");function gx(t,e){return!t[1].element||!e[1].element?0:BL(t[1].element,e[1].element)?-1:1}ar(gx,"sortByDocumentPosition");function ZL(t){return new MutationObserver(n=>{for(const r of n)if(r.type==="childList"){t();return}})}ar(ZL,"getChildListObserver");var Wse=Object.defineProperty,fp=(t,e)=>Wse(t,"name",{value:e,configurable:!0}),D4="Collapsible",[qse,WL]=so(D4),[Gse,j4]=qse(D4),Kse=m.forwardRef(fp(function(e,n){const{__scopeCollapsible:r,open:s,defaultOpen:i,disabled:o,onOpenChange:l,...u}=e,[d,f]=cl({prop:s,defaultProp:i??!1,onChange:l,caller:D4});return b.jsx(Gse,{scope:r,disabled:o,contentId:Xi(),open:d,onOpenToggle:m.useCallback(()=>f(h=>!h),[f]),children:b.jsx(En.div,{"data-state":Sv(d),"data-disabled":o?"":void 0,...u,ref:n})})},"Collapsible")),Yse="CollapsibleTrigger",Xse=m.forwardRef(fp(function(e,n){const{__scopeCollapsible:r,...s}=e,i=j4(Yse,r);return b.jsx(En.button,{type:"button","aria-controls":i.open?i.contentId:void 0,"aria-expanded":i.open||!1,"data-state":Sv(i.open),"data-disabled":i.disabled?"":void 0,disabled:i.disabled,...s,ref:n,onClick:Yt(e.onClick,i.onOpenToggle)})},"CollapsibleTrigger")),qL="CollapsibleContent",Qse=m.forwardRef(fp(function(e,n){const{forceMount:r,...s}=e,i=j4(qL,e.__scopeCollapsible);return b.jsx(ll,{present:r||i.open,children:({present:o})=>b.jsx(Jse,{...s,ref:n,present:o})})},"CollapsibleContent")),Jse=m.forwardRef(fp(function(e,n){const{__scopeCollapsible:r,present:s,children:i,...o}=e,l=j4(qL,r),[u,d]=m.useState(s),f=m.useRef(null),h=Jt(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)},[]),Jr(()=>{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 A=C.getBoundingClientRect();g.current=A.height,w.current=A.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":Sv(l.open),"data-disabled":l.disabled?"":void 0,id:l.contentId,hidden:!x,...o,ref:h,style:{"--radix-collapsible-content-height":v?`${v}px`:void 0,"--radix-collapsible-content-width":_?`${_}px`:void 0,...e.style},children:x&&i})},"CollapsibleContentImpl"));function Sv(t){return t?"open":"closed"}fp(Sv,"getState");var eie=Object.defineProperty,tie=(t,e)=>eie(t,"name",{value:e,configurable:!0}),nie={LTR:"ltr"},rie=m.createContext(void 0);function $4(t){const e=m.useContext(rie);return t||e||nie.LTR}tie($4,"useDirection");var sie=Object.defineProperty,As=(t,e)=>sie(t,"name",{value:e,configurable:!0}),iie={Multiple:"multiple"},Mf={Vertical:"vertical",Horizontal:"horizontal"},oie={LTR:"ltr"},io="Accordion",aie=["Home","End","ArrowDown","ArrowUp","ArrowLeft","ArrowRight"],[F4,lie,cie]=L4(io),[kv,$ae]=so(io,[cie,WL]),V4=WL(),GL=m.forwardRef(As(function(e,n){const{type:r,...s}=e,i=s,o=s;return b.jsx(F4.Provider,{scope:e.__scopeAccordion,children:r===iie.Multiple?b.jsx(hie,{...o,ref:n}):b.jsx(fie,{...i,ref:n})})},"Accordion")),[KL,uie]=kv(io),[YL,die]=kv(io,{collapsible:!1}),fie=m.forwardRef(As(function(e,n){const{value:r,defaultValue:s,onValueChange:i=As(()=>{},"onValueChange"),collapsible:o=!1,...l}=e,[u,d]=cl({prop:r,defaultProp:s??"",onChange:i,caller:io});return b.jsx(KL,{scope:e.__scopeAccordion,value:m.useMemo(()=>u?[u]:[],[u]),onItemOpen:d,onItemClose:m.useCallback(()=>o&&d(""),[o,d]),children:b.jsx(YL,{scope:e.__scopeAccordion,collapsible:o,children:b.jsx(XL,{...l,ref:n})})})},"AccordionImplSingle")),hie=m.forwardRef(As(function(e,n){const{value:r,defaultValue:s,onValueChange:i=As(()=>{},"onValueChange"),...o}=e,[l,u]=cl({prop:r,defaultProp:s??[],onChange:i,caller:io}),d=m.useCallback(h=>u((g=[])=>[...g,h]),[u]),f=m.useCallback(h=>u((g=[])=>g.filter(v=>v!==h)),[u]);return b.jsx(KL,{scope:e.__scopeAccordion,value:l,onItemOpen:d,onItemClose:f,children:b.jsx(YL,{scope:e.__scopeAccordion,collapsible:!0,children:b.jsx(XL,{...o,ref:n})})})},"AccordionImplMultiple")),[pie,Ev]=kv(io),XL=m.forwardRef(As(function(e,n){const{__scopeAccordion:r,disabled:s,dir:i,orientation:o=Mf.Vertical,...l}=e,u=m.useRef(null),d=Jt(u,n),f=lie(r),g=$4(i)===oie.LTR,v=Yt(e.onKeyDown,w=>{var O;if(!aie.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 A=0,T=k-1,I=As(()=>{C=S+1,C>T&&(C=A)},"moveNext"),M=As(()=>{C=S-1,C<A&&(C=T)},"movePrev");switch(w.key){case"Home":C=A;break;case"End":C=T;break;case"ArrowRight":o===Mf.Horizontal&&(g?I():M());break;case"ArrowDown":o===Mf.Vertical&&I();break;case"ArrowLeft":o===Mf.Horizontal&&(g?M():I());break;case"ArrowUp":o===Mf.Vertical&&M();break}const R=C%k;(O=x[R].ref.current)==null||O.focus()});return b.jsx(pie,{scope:r,disabled:s,direction:i,orientation:o,children:b.jsx(F4.Slot,{scope:r,children:b.jsx(En.div,{...l,"data-orientation":o,ref:d,onKeyDown:s?void 0:v})})})},"AccordionImpl")),vx="AccordionItem",[mie,H4]=kv(vx),gie=m.forwardRef(As(function(e,n){const{__scopeAccordion:r,value:s,...i}=e,o=Ev(vx,r),l=uie(vx,r),u=V4(r),d=Xi(),f=s&&l.value.includes(s)||!1,h=o.disabled||e.disabled;return b.jsx(mie,{scope:r,open:f,disabled:h,triggerId:d,children:b.jsx(Kse,{"data-orientation":o.orientation,"data-state":z4(f),...u,...i,ref:n,disabled:h,open:f,onOpenChange:g=>{g?l.onItemOpen(s):l.onItemClose(s)}})})},"AccordionItem")),vie="AccordionHeader",yie=m.forwardRef(As(function(e,n){const{__scopeAccordion:r,...s}=e,i=Ev(io,r),o=H4(vie,r);return b.jsx(En.h3,{"data-orientation":i.orientation,"data-state":z4(o.open),"data-disabled":o.disabled?"":void 0,...s,ref:n})},"AccordionHeader")),IP="AccordionTrigger",_ie=m.forwardRef(As(function(e,n){const{__scopeAccordion:r,...s}=e,i=Ev(io,r),o=H4(IP,r),l=die(IP,r),u=V4(r);return b.jsx(F4.ItemSlot,{scope:r,children:b.jsx(Xse,{"aria-disabled":o.open&&!l.collapsible||void 0,"data-orientation":i.orientation,id:o.triggerId,...u,...s,ref:n})})},"AccordionTrigger")),wie="AccordionContent",xie=m.forwardRef(As(function(e,n){const{__scopeAccordion:r,...s}=e,i=Ev(io,r),o=H4(wie,r),l=V4(r);return b.jsx(Qse,{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 z4(t){return t?"open":"closed"}As(z4,"getState");/**
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 bie=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 Sie(t,e,n=[]){if(e==null)throw new Error("[lucide]: iconNode is required when icon name is used");return{name:bie(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 kie=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 Eie=t=>{const e=kie(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 yx=(...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 Hl={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 Y_(t){return t!=null}function Cie(t,e={}){var g,v;const n=e.attributeNames??{},r=w=>n[w]??w,s=t.size??t.width??Hl.width,i=t.size??t.height??Hl.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?yx(...u):yx("lucide",...l,...u),f=e.absoluteStrokeWidth?Number(e.strokeWidth??Hl["stroke-width"])*Number(t.size??t.width??Hl.width)/Number(e.size??e.width??Hl.width):e.strokeWidth??Hl["stroke-width"];return["svg",{...Object.entries(Hl).reduce((w,[_,x])=>(w[r(_)]=x,w),{}),..."color"in e&&e.color&&{[r("stroke")]:e.color},..."size"in e&&Y_(e.size)&&{[r("width")]:e.size,[r("height")]:e.size},..."width"in e&&Y_(e.width)&&{[r("width")]:e.width},..."height"in e&&Y_(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 Pie(t,e={}){return Cie(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 Aie=t=>{for(const e in t)if(e.startsWith("aria-")||e==="role"||e==="title")return!0;return!1},Tie=m.createContext({}),Rie=()=>m.useContext(Tie),Mie=m.forwardRef(({color:t,size:e,width:n,height:r,strokeWidth:s,absoluteStrokeWidth:i,nonScalingStroke:o,className:l="",children:u,iconNode:d=[],icon:f={node:d,aliases:[],size:24},...h},g)=>{const{size:v=24,strokeWidth:w=2,absoluteStrokeWidth:_=!1,nonScalingStroke:x=!1,color:S="currentColor",className:k=""}=Rie()??{},C=!!u||Aie(h),[A,T,I=[]]=Pie(f,{color:t??S,width:n??e??v,height:r??e??v,strokeWidth:s??w,absoluteStrokeWidth:i??_,nonScalingStroke:o??x,className:yx(k,l),hasA11yProp:C,attributes:h});return m.createElement(A,{ref:g,...T},[...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 lt(t,e=[],n=[]){const r=typeof t=="string"?Sie(t,e,n):t,s=m.forwardRef(({className:i,...o},l)=>m.createElement(Mie,{ref:l,icon:r,className:i,...o}));return r.name&&(s.displayName=Eie(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 QL={name:"arrow-left",size:24,node:[["path",{d:"m12 19-7-7 7-7",key:"1l729n"}],["path",{d:"M19 12H5",key:"x3x0zl"}]]};QL.node;const Iie=lt(QL);/**
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 JL={name:"arrow-right",size:24,node:[["path",{d:"M5 12h14",key:"1ays0h"}],["path",{d:"m12 5 7 7-7 7",key:"xquz4c"}]]};JL.node;const Oie=lt(JL);/**
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 eN={name:"arrow-up",size:24,node:[["path",{d:"m5 12 7-7 7 7",key:"hav0vg"}],["path",{d:"M12 19V5",key:"x0mq9r"}]]};eN.node;const Lie=lt(eN);/**
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 tN={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"}]]};tN.node;const Nie=lt(tN);/**
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 nN={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"}]]};nN.node;const Die=lt(nN);/**
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 rN={name:"check",size:24,node:[["path",{d:"M20 6 9 17l-5-5",key:"1gmf2c"}]]};rN.node;const jie=lt(rN);/**
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 sN={name:"chevron-down",size:24,node:[["path",{d:"m6 9 6 6 6-6",key:"qrunsl"}]]};sN.node;const $ie=lt(sN);/**
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 iN={name:"chevron-right",size:24,node:[["path",{d:"m9 18 6-6-6-6",key:"mthhwq"}]]};iN.node;const Fie=lt(iN);/**
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 oN={name:"circle",size:24,node:[["circle",{cx:"12",cy:"12",r:"10",key:"1mglay"}]]};oN.node;const Vie=lt(oN);/**
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 aN={name:"clock",size:24,node:[["circle",{cx:"12",cy:"12",r:"10",key:"1mglay"}],["path",{d:"M12 6v6l4 2",key:"mmk7yg"}]]};aN.node;const Hie=lt(aN);/**
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 lN={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"}]]};lN.node;const zie=lt(lN);/**
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 cN={name:"dot",size:24,node:[["circle",{cx:"12",cy:"12",r:"1",key:"41hilf"}]]};cN.node;const Uie=lt(cN);/**
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 uN={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"}]]};uN.node;const Bie=lt(uN);/**
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 dN={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"}]]};dN.node;const Zie=lt(dN);/**
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 fN={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"]};fN.node;const Wie=lt(fN);/**
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 hN={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"}]]};hN.node;const qie=lt(hN);/**
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 pN={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"}]]};pN.node;const Gie=lt(pN);/**
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 mN={name:"lightbulb",size:24,node:[["path",{d:"M15 14c.2-1 .7-1.7 1.5-2.5 1-.9 1.5-2.2 1.5-3.5A6 6 0 0 0 6 8c0 1 .2 2.2 1.5 3.5.7.7 1.3 1.5 1.5 2.5",key:"1gvzjb"}],["path",{d:"M9 18h6",key:"x1upvd"}],["path",{d:"M10 22h4",key:"ceow96"}]]};mN.node;const Kie=lt(mN);/**
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 gN={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"}]]};gN.node;const Yie=lt(gN);/**
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 vN={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"}]]};vN.node;const Xie=lt(vN);/**
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 yN={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"}]]};yN.node;const Qie=lt(yN);/**
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 _N={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"}]]};_N.node;const Jie=lt(_N);/**
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 wN={name:"menu",size:24,node:[["path",{d:"M4 5h16",key:"1tepv9"}],["path",{d:"M4 12h16",key:"1lakjw"}],["path",{d:"M4 19h16",key:"1djgab"}]]};wN.node;const eoe=lt(wN);/**
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 xN={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"}]]};xN.node;const toe=lt(xN);/**
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 bN={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"}]]};bN.node;const noe=lt(bN);/**
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 SN={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"}]]};SN.node;const roe=lt(SN);/**
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 kN={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"}]]};kN.node;const soe=lt(kN);/**
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 EN={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"}]]};EN.node;const ioe=lt(EN);/**
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 CN={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"}]]};CN.node;const ooe=lt(CN);/**
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 PN={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"}]]};PN.node;const aoe=lt(PN);/**
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 AN={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"}]]};AN.node;const loe=lt(AN);/**
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 TN={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"}]]};TN.node;const coe=lt(TN);/**
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 RN={name:"plus",size:24,node:[["path",{d:"M5 12h14",key:"1ays0h"}],["path",{d:"M12 5v14",key:"s699le"}]]};RN.node;const uoe=lt(RN);/**
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 MN={name:"rectangle-horizontal",size:24,node:[["rect",{width:"20",height:"12",x:"2",y:"6",rx:"2",key:"9lu3g6"}]]};MN.node;const doe=lt(MN);/**
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 IN={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"}]]};IN.node;const foe=lt(IN);/**
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 ON={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"}]]};ON.node;const hoe=lt(ON);/**
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 LN={name:"search",size:24,node:[["path",{d:"m21 21-4.34-4.34",key:"14j7rj"}],["circle",{cx:"11",cy:"11",r:"8",key:"4ej97u"}]]};LN.node;const poe=lt(LN);/**
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 NN={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"}]]};NN.node;const moe=lt(NN);/**
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 DN={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"}]]};DN.node;const goe=lt(DN);/**
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 jN={name:"skip-forward",size:24,node:[["path",{d:"M21 4v16",key:"7j8fe9"}],["path",{d:"M6.029 4.285A2 2 0 0 0 3 6v12a2 2 0 0 0 3.029 1.715l9.997-5.998a2 2 0 0 0 .003-3.432z",key:"zs4d6"}]]};jN.node;const voe=lt(jN);/**
406
+ * @license lucide-react v1.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 $N={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"]};$N.node;const yoe=lt($N);/**
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 FN={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"}]]};FN.node;const _oe=lt(FN);/**
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 VN={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"}]]};VN.node;const woe=lt(VN);/**
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 HN={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"}]]};HN.node;const xoe=lt(HN);/**
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 zN={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"}]]};zN.node;const boe=lt(zN);/**
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 UN={name:"x",size:24,node:[["path",{d:"M18 6 6 18",key:"1bl5f8"}],["path",{d:"m6 6 12 12",key:"d8bk6v"}]]};UN.node;const Soe=lt(UN),koe={"chevron-right":Fie,"chevron-down":$ie,pipette:loe,x:Soe,copy:zie,menu:eoe,dot:Uie,monitor:noe,sun:woe,moon:roe,"rectangle-horizontal":doe,circle:Vie,"square-library":yoe,clock:Hie,star:_oe,settings:moe,plus:uoe,"arrow-left":Iie,"arrow-right":Oie,"arrow-up":Lie,search:poe,loader:Xie,users:boe,lock:Qie,mail:Jie,bell:Nie,shield:goe,palette:ioe,lightbulb:Kie,rocket:foe,heart:Zie,paintbrush:soe,brain:Die,globe:Bie,user:xoe,image:qie,link:Yie,check:jie,"rotate-ccw":hoe,play:coe,pause:ooe,home:Wie,"message-circle":toe,inbox:Gie,pencil:aoe,"skip-forward":voe},OP={lucide:koe},BN=m.createContext(null);function Eoe(t){const e=m.useContext(BN);return e?OP[e.iconLibrary][t]:OP.lucide[t]}function Coe({children:t,defaultLibrary:e="lucide"}){const[n,r]=m.useState(e),s=m.useCallback(i=>{r(i)},[]);return b.jsx(BN.Provider,{value:{iconLibrary:n,setIconLibrary:s},children:t})}const ZN=m.createContext(null);function U4(){return m.useContext(ZN)}const WN=m.createContext(null);function qN(){const t=m.useContext(WN);if(!t)throw new Error("AccordionTrigger/AccordionContent must be used within an AccordionItem");return t}const Poe=m.forwardRef((t,e)=>{const{children:n,type:r="single",className:s,...i}=t,o=m.useRef(null),l=m.useRef(new Map),[u,d]=m.useState(new Map),{activeIndex:f,setActiveIndex:h,itemRects:g,sessionRef:v,handlers:w,registerItem:_,measureItems:x}=n9(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,A]=m.useState(()=>r==="single"?t.defaultValue??"":""),[T,I]=m.useState(()=>r==="multiple"?t.defaultValue??[]:[]),M=t.onValueChange,R=t.onValueChange,O=t.value,N=new Set(r==="multiple"?t.value??T:(()=>{const ue=t.value??C;return ue?[ue]:[]})()),D=m.useCallback(ue=>{const ae=t;ae.onValueChange?ae.onValueChange(ue):A(ue)},[M]),F=m.useCallback(ue=>{const ae=t;ae.onValueChange?ae.onValueChange(ue):I(ue)},[R]),K=m.useCallback(ue=>{if(r==="multiple"){const ae=t.value??T;F(ae.filter(Oe=>Oe!==ue))}else D("")},[r,D,F,T,O]);m.useEffect(()=>{x(),k()},[x,k,n]);const B=[...N].join(",");m.useEffect(()=>{x(),k()},[x,k,B]);const[G,H]=m.useState(null),Y=f!==null?g[f]:null,U=G!==null?g[G]:null,J=f!==null&&!u.has(f),Z=op(),{value:j,defaultValue:Q,onValueChange:oe,collapsible:ne,type:se,...de}=i,ve=r==="multiple"?{type:"multiple",value:t.value??T,onValueChange:F}:{type:"single",collapsible:t.collapsible??!0,value:t.value??C,onValueChange:D};return b.jsx(ZN.Provider,{value:{registerItem:_,registerFullItem:S,activeIndex:f,grouped:!0,remeasure:()=>{x(),k()},openValues:N,openItemRects:u,toggleValue:K},children:b.jsx(GL,{...ve,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(),We=ae.offsetHeight,Ee=Oe.height,pt=We>0?Ee/We:1,Ot=(ue.clientY-Oe.top)/pt+ae.scrollTop;for(const[en,bt]of u){const _t=g[en];if(!_t)continue;const qe=_t.top+_t.height,Ke=bt.top+bt.height;if(Ot>=qe&&Ot<=Ke){h(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 We=Number(ae);h(We),H(ue.target.matches(":focus-visible")?We:null)}},onBlur:ue=>{var ae;(ae=o.current)!=null&&ae.contains(ue.relatedTarget)||(H(null),h(null))},className:Ut("relative flex flex-col gap-0.5 w-72 max-w-full",s),...de,children:[b.jsx(Cs,{children:[...u.entries()].map(([ue,ae])=>b.jsx(Ho.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:J?.7:1},exit:{opacity:0,transition:{duration:.12}},transition:{top:{duration:0},left:{duration:0},width:{duration:0},height:{duration:0},opacity:{duration:.08}}},`expanded-${ue}`))}),b.jsx(Cs,{children:Y&&b.jsx(Ho.div,{className:`absolute ${Z.bg} bg-hover pointer-events-none`,initial:{opacity:0,top:Y.top,left:Y.left,width:Y.width,height:Y.height},animate:{opacity:1,top:Y.top,left:Y.left,width:Y.width,height:Y.height},exit:{opacity:0,transition:{duration:.06}},transition:{...Lh.fast,opacity:{duration:.08}}},v.current)}),b.jsx(Cs,{children:U&&b.jsx(Ho.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:{...Lh.fast,opacity:{duration:.08}}})}),n]})})})});Poe.displayName="AccordionGroup";const GN=m.forwardRef(({children:t,type:e="single",collapsible:n=!0,defaultValue:r,value:s,onValueChange:i,className:o,...l},u)=>{const[d,f]=m.useState(()=>e==="single"?r??"":""),[h,g]=m.useState(()=>e==="multiple"?r??[]:[]),v=new Set(e==="multiple"?s??h:(()=>{const k=s??d;return k?[k]:[]})()),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??h).filter(A=>A!==k)):w("")},[e,s,h,w,_]),S=e==="multiple"?{type:"multiple",value:s??h,defaultValue:r,onValueChange:_}:{type:"single",collapsible:n,value:s??d,defaultValue:r,onValueChange:w};return b.jsx(GL,{...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(KN.Provider,{value:v,children:b.jsx(YN.Provider,{value:x,children:t})})})})});GN.displayName="Accordion";const KN=m.createContext(new Set),YN=m.createContext(()=>{}),XN=m.forwardRef(({value:t,index:e,disabled:n,children:r,className:s,...i},o)=>{const l=m.useRef(null),u=U4(),d=m.useContext(KN),f=m.useContext(YN),h=op(),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(WN.Provider,{value:{index:e,value:t,isOpen:g,onToggle:w,triggerRef:v},children:b.jsxs(gie,{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(Cs,{children:g&&b.jsx(Ho.div,{className:`absolute inset-0 ${h.bg} bg-accent/20 dark:bg-accent/12 pointer-events-none`,initial:{opacity:0},animate:{opacity:1},exit:{opacity:0,transition:{duration:.06}},transition:{duration:.08}})}),r]})})});XN.displayName="AccordionItem";const QN=m.forwardRef(({children:t,className:e,...n},r)=>{const s=Eoe("chevron-right"),i=U4(),{index:o,isOpen:l,triggerRef:u}=qN(),d=op(),[f,h]=m.useState(!1),g=i!=null&&i.grouped?i.activeIndex===o:f,v=b.jsx(yie,{asChild:!0,children:b.jsx("div",{children:b.jsxs(_ie,{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:rh.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?rh.semibold:rh.normal},children:t})]}),b.jsx(Ho.span,{className:"shrink-0 inline-flex items-center justify-center",animate:{rotate:l?90:0},transition:Lh.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:()=>h(!0),onMouseLeave:()=>h(!1),children:[b.jsx(Cs,{children:f&&b.jsx(Ho.div,{className:`absolute inset-0 ${d.bg} bg-hover pointer-events-none`,initial:{opacity:0},animate:{opacity:1},exit:{opacity:0,transition:{duration:.06}},transition:{duration:.08}})}),v]})});QN.displayName="AccordionTrigger";const JN=m.forwardRef(({children:t,className:e,...n},r)=>{const s=U4(),{isOpen:i}=qN();return b.jsx(Cs,{initial:!1,children:i&&b.jsx(xie,{forceMount:!0,asChild:!0,...n,children:b.jsx(Ho.div,{ref:r,className:Ut("overflow-hidden",e),initial:{height:0},animate:{height:"auto"},exit:{height:0},transition:{...Lh.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})})})})});JN.displayName="AccordionContent";const Rm=({children:t,defaultValue:e=[],className:n=""})=>b.jsx(GN,{type:"multiple",defaultValue:e,className:Ut("w-full",n),children:t}),Aoe=({value:t,title:e,description:n,dataCy:r,icon:s,children:i,className:o=""})=>{const l=o.includes("first-item");return b.jsxs(XN,{value:t,className:Ut("w-full",!l&&"border-t border-main-border"),children:[b.jsxs(QN,{"data-cy":r,children:[s?b.jsx("span",{className:"mr-1 inline-flex items-center",children:s}):null,e]}),b.jsxs(JN,{children:[n?b.jsx("p",{className:"pb-2 text-sm text-content-subtle",children:n}):null,i]})]})};Rm.Item=Aoe;const Toe=({message:t,isLoading:e=!0})=>b.jsxs("div",{className:"flex items-center gap-2 text-sm text-content",children:[e?b.jsx(ev,{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})]}),Roe=()=>{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},Moe=t=>{const e=Math.floor(t/60),n=t%60;return`${e}:${n.toString().padStart(2,"0")}`},LP="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",NP="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",Ioe="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",Mm=["Applying","Thinking","Planning","Crafting"],Ooe=Mm.reduce((t,e)=>t.length>=e.length?t:e),Loe=20,Noe="Still working — runs can take a few minutes.",Doe=({hint:t,showElapsed:e=!0})=>{const[n,r]=m.useState(0),s=Roe();m.useEffect(()=>{const o=setInterval(()=>{r(l=>(l+1)%Mm.length)},4e3);return()=>clearInterval(o)},[]);const i=t??(e&&s>=Loe?Noe:null);return b.jsxs("div",{role:"status",className:"flex items-center gap-2 px-3 py-1","data-cy":"thinking-indicator",children:[b.jsx(Si.svg,{"aria-hidden":!0,width:20,height:20,viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:1.5,strokeLinecap:"round",strokeLinejoin:"round",className:"shrink-0 text-muted-foreground",children:b.jsx(Si.path,{animate:{d:[LP,NP,Ioe,NP,LP]},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:rh.medium},children:[b.jsx("span",{className:"shimmer-text invisible col-start-1 row-start-1","aria-hidden":"true",children:Ooe}),b.jsx(Cs,{mode:"popLayout",initial:!1,children:b.jsx(Si.span,{className:"shimmer-text col-start-1 row-start-1",initial:{y:"80%",opacity:0},animate:{y:0,opacity:1,transition:{duration:.24,ease:[.4,0,.2,1]}},exit:{y:"-80%",opacity:0,transition:{duration:.16,ease:[.4,0,.2,1]}},children:Mm[n]},Mm[n])})]}),e?b.jsx("span",{className:"text-xs tabular-nums text-content-subtle","data-cy":"thinking-elapsed",children:Moe(s)}):null,i?b.jsx("span",{className:"text-xs text-content-subtle",children:i}):null]})};var joe=Object.defineProperty,$oe=(t,e)=>joe(t,"name",{value:e,configurable:!0});function $g(t,[e,n]){return Math.min(n,Math.max(e,t))}$oe($g,"clamp");var Foe=Object.defineProperty,Voe=(t,e)=>Foe(t,"name",{value:e,configurable:!0});function eD(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])}Voe(eD,"usePrevious");var Hoe=Object.defineProperty,jt=(t,e)=>Hoe(t,"name",{value:e,configurable:!0}),DP={Horizontal:"horizontal"},zoe={LTR:"ltr"},tD=["PageUp","PageDown"],nD=["ArrowUp","ArrowDown","ArrowLeft","ArrowRight"],rD={"from-left":["Home","PageDown","ArrowDown","ArrowLeft"],"from-right":["Home","PageDown","ArrowDown","ArrowRight"],"from-bottom":["Home","PageDown","ArrowDown","ArrowLeft"],"from-top":["Home","PageDown","ArrowUp","ArrowLeft"]},hp="Slider",[_x,Uoe,Boe]=L4(hp),[B4,Fae]=so(hp,[Boe]),[Zoe,pp]=B4(hp),Woe=m.forwardRef(jt(function(e,n){const{name:r,min:s=0,max:i=100,step:o=1,orientation:l=DP.Horizontal,disabled:u=!1,minStepsBetweenThumbs:d=0,preserveThumbOrder:f=!1,defaultValue:h=[s],value:g,onValueChange:v=jt(()=>{},"onValueChange"),onValueCommit:w=jt(()=>{},"onValueCommit"),inverted:_=!1,form:x,...S}=e,k=m.useRef(new Set),C=m.useRef(0),A=m.useRef(!1),I=l===DP.Horizontal?qoe:Goe,[M,R]=m.useState(null),O=Jt(n,R),[N=[],D]=cl({prop:g,defaultProp:h,onChange:jt(U=>{var Z;(Z=[...k.current][C.current])==null||Z.focus({preventScroll:!0,focusVisible:A.current}),A.current=!1,v(U)},"onChange")}),F=m.useRef(N),K=m.useRef(N);m.useEffect(()=>{const U=x?M==null?void 0:M.ownerDocument.getElementById(x):M==null?void 0:M.closest("form");if(U instanceof HTMLFormElement){const J=jt(()=>D(K.current),"reset");return U.addEventListener("reset",J),()=>U.removeEventListener("reset",J)}},[M,x,D]);function B(U){const J=dD(N,U);Y(U,J)}jt(B,"handleSlideStart");function G(U){Y(U,C.current)}jt(G,"handleSlideMove");function H(){String(N)!==String(F.current)&&w(N)}jt(H,"handleSlideEnd");function Y(U,J,{commit:Z}={commit:!1}){const j=W4(o),Q=lh(Math.round((U-s)/o)*o+s,j),oe=$g(Q,[s,i]);D((ne=[])=>{const se=d*o,de=f?$g(oe,[ne[J-1]===void 0?s:ne[J-1]+se,ne[J+1]===void 0?i:ne[J+1]-se]):oe,ve=cD(ne,de,J);if(pD(ve,se)){C.current=f?J:ve.indexOf(de);const ue=String(ve)!==String(ne);return ue&&Z&&w(ve),ue?ve:ne}else return ne})}return jt(Y,"updateValues"),b.jsx(Zoe,{scope:e.__scopeSlider,name:r,disabled:u,min:s,max:i,valueIndexToChangeRef:C,thumbs:k.current,values:N,orientation:l,form:x,children:b.jsx(_x.Provider,{scope:e.__scopeSlider,children:b.jsx(_x.Slot,{scope:e.__scopeSlider,children:b.jsx(I,{"aria-disabled":u,"data-disabled":u?"":void 0,...S,ref:O,onPointerDown:Yt(S.onPointerDown,()=>{u||(F.current=N,A.current=!1)}),min:s,max:i,inverted:_,onSlideStart:u?void 0:B,onSlideMove:u?void 0:G,onSlideEnd:u?void 0:H,onHomeKeyDown:()=>{u||(A.current=!0,Y(s,0,{commit:!0}))},onEndKeyDown:()=>{u||(A.current=!0,Y(i,N.length-1,{commit:!0}))},onStepKeyDown:({event:U,direction:J})=>{if(!u){A.current=!0;const Q=tD.includes(U.key)||U.shiftKey&&nD.includes(U.key)?10:1,oe=C.current,ne=N[oe],se=mD(ne,{min:s,step:o,direction:J,multiplier:Q});Y(se,oe,{commit:!0})}}})})})})},"Slider")),[sD,iD]=B4(hp,{startEdge:"left",endEdge:"right",size:"width",direction:1}),qoe=m.forwardRef(jt(function(e,n){const{min:r,max:s,dir:i,inverted:o,onSlideStart:l,onSlideMove:u,onSlideEnd:d,onStepKeyDown:f,...h}=e,[g,v]=m.useState(null),w=Jt(n,v),_=m.useRef(void 0),x=$4(i),S=x===zoe.LTR,k=S&&!o||!S&&o;function C(A){const T=_.current||g.getBoundingClientRect(),I=[0,T.width],R=Cv(I,k?[r,s]:[s,r]);return _.current=T,R(A-T.left)}return jt(C,"getValueFromPointer"),b.jsx(sD,{scope:e.__scopeSlider,startEdge:k?"left":"right",endEdge:k?"right":"left",direction:k?1:-1,size:"width",children:b.jsx(oD,{dir:x,"data-orientation":"horizontal",...h,ref:w,style:{...h.style,"--radix-slider-thumb-transform":"translateX(-50%)"},onSlideStart:A=>{const T=C(A.clientX);l==null||l(T)},onSlideMove:A=>{const T=C(A.clientX);u==null||u(T)},onSlideEnd:()=>{_.current=void 0,d==null||d()},onStepKeyDown:A=>{const I=rD[k?"from-left":"from-right"].includes(A.key);f==null||f({event:A,direction:I?-1:1})}})})},"SliderHorizontal")),Goe=m.forwardRef(jt(function(e,n){const{min:r,max:s,inverted:i,onSlideStart:o,onSlideMove:l,onSlideEnd:u,onStepKeyDown:d,...f}=e,h=m.useRef(null),g=Jt(n,h),v=m.useRef(void 0),w=!i;function _(x){const S=v.current||h.current.getBoundingClientRect(),k=[0,S.height],A=Cv(k,w?[s,r]:[r,s]);return v.current=S,A(x-S.top)}return jt(_,"getValueFromPointer"),b.jsx(sD,{scope:e.__scopeSlider,startEdge:w?"bottom":"top",endEdge:w?"top":"bottom",size:"height",direction:w?1:-1,children:b.jsx(oD,{"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=rD[w?"from-bottom":"from-top"].includes(x.key);d==null||d({event:x,direction:k?-1:1})}})})},"SliderVertical")),oD=m.forwardRef(jt(function(e,n){const{__scopeSlider:r,onSlideStart:s,onSlideMove:i,onSlideEnd:o,onHomeKeyDown:l,onEndKeyDown:u,onStepKeyDown:d,...f}=e,h=pp(hp,r);return b.jsx(En.span,{...f,ref:n,onKeyDown:Yt(e.onKeyDown,g=>{g.key==="Home"?(l(g),g.preventDefault()):g.key==="End"?(u(g),g.preventDefault()):tD.concat(nD).includes(g.key)&&(d(g),g.preventDefault())}),onPointerDown:Yt(e.onPointerDown,g=>{const v=g.target;v.setPointerCapture(g.pointerId),g.preventDefault(),h.thumbs.has(v)?v.focus({preventScroll:!0,focusVisible:!1}):s(g)}),onPointerMove:Yt(e.onPointerMove,g=>{g.target.hasPointerCapture(g.pointerId)&&i(g)}),onPointerUp:Yt(e.onPointerUp,g=>{const v=g.target;v.hasPointerCapture(g.pointerId)&&(v.releasePointerCapture(g.pointerId),o(g))})})},"SliderImpl")),Koe="SliderTrack",Yoe=m.forwardRef(jt(function(e,n){const{__scopeSlider:r,...s}=e,i=pp(Koe,r);return b.jsx(En.span,{"data-disabled":i.disabled?"":void 0,"data-orientation":i.orientation,...s,ref:n})},"SliderTrack")),jP="SliderRange",Xoe=m.forwardRef(jt(function(e,n){const{__scopeSlider:r,...s}=e,i=pp(jP,r),o=iD(jP,r),l=m.useRef(null),u=Jt(n,l),d=i.values.length,f=i.values.map(v=>Z4(v,i.min,i.max)),h=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]:h+"%",[o.endEdge]:g+"%"}})},"SliderRange")),Qoe="SliderThumb",[Joe,aD]=B4(Qoe),eae="SliderThumbProvider";function lD(t){const{__scopeSlider:e,name:n,children:r,internal_do_not_use_render:s}=t,i=pp(eae,e),o=Uoe(e),[l,u]=m.useState(null),d=m.useMemo(()=>l?o().findIndex(x=>x.ref.current===l):-1,[o,l]),f=Zb(l),h=l?!!i.form||!!l.closest("form"):!0,g=i.values[d],v=n??(i.name?i.name+(i.values.length>1?"[]":""):void 0),w=g===void 0?0:Z4(g,i.min,i.max);m.useEffect(()=>{if(l)return i.thumbs.add(l),()=>{i.thumbs.delete(l)}},[l,i.thumbs]);const _={value:g,name:v,form:i.form,isFormControl:h,index:d,thumb:l,onThumbChange:u,percent:w,size:f};return b.jsx(Joe,{scope:e,..._,children:gD(s)?s(_):r})}jt(lD,"SliderThumbProvider");var X_="SliderThumbTrigger",tae=m.forwardRef(jt(function(e,n){const{__scopeSlider:r,...s}=e,i=pp(X_,r),o=iD(X_,r),{index:l,value:u,percent:d,size:f,onThumbChange:h}=aD(X_,r),g=Jt(n,h),v=uD(l,i.values.length),w=f==null?void 0:f[o.size],_=w?fD(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(_x.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:Yt(e.onFocus,()=>{i.valueIndexToChangeRef.current=l})})})})},"SliderThumbTrigger")),nae=m.forwardRef(jt(function(e,n){const{__scopeSlider:r,name:s,...i}=e;return b.jsx(lD,{__scopeSlider:r,name:s,internal_do_not_use_render:({index:o,isFormControl:l})=>b.jsxs(b.Fragment,{children:[b.jsx(tae,{...i,ref:n,__scopeSlider:r}),l?b.jsx(sae,{__scopeSlider:r},o):null]})})},"SliderThumb")),rae="SliderBubbleInput",sae=m.forwardRef(jt(function({__scopeSlider:e,...n},r){const{value:s,name:i,form:o}=aD(rae,e),l=m.useRef(null),u=Jt(l,r),d=eD(s);return m.useEffect(()=>{const f=l.current;if(!f)return;const h=window.HTMLInputElement.prototype,v=Object.getOwnPropertyDescriptor(h,"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 cD(t=[],e,n){const r=[...t];return r[n]=e,r.sort((s,i)=>s-i)}jt(cD,"getNextSortedValues");function Z4(t,e,n){const i=100/(n-e)*(t-e);return $g(i,[0,100])}jt(Z4,"convertValueToPercentage");function uD(t,e){return e>2?`Value ${t+1} of ${e}`:e===2?["Minimum","Maximum"][t]:void 0}jt(uD,"getLabel");function dD(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(dD,"getClosestValueIndex");function fD(t,e,n){const r=t/2,i=Cv([0,50],[0,r]);return(r-i(e)*n)*n}jt(fD,"getThumbInBoundsOffset");function hD(t){return t.slice(0,-1).map((e,n)=>t[n+1]-e)}jt(hD,"getStepsBetweenValues");function pD(t,e){if(e>0){const n=hD(t);return Math.min(...n)>=e}return!0}jt(pD,"hasMinStepsBetweenValues");function Cv(t,e){return n=>{if(t[0]===t[1]||e[0]===e[1])return e[0];const r=(e[1]-e[0])/(t[1]-t[0]);return e[0]+r*(n-t[0])}}jt(Cv,"linearScale");function W4(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(W4,"getDecimalCount");function lh(t,e){const n=Math.pow(10,e);return Math.round(t*n)/n}jt(lh,"roundValue");function mD(t,{min:e,step:n,direction:r,multiplier:s}){const i=W4(n),o=(t-e)/n,l=Math.round(o),u=lh(l*n+e,i)===lh(t,i);let d;return u?d=l+s*r:r>0?d=Math.ceil(o):d=Math.floor(o),lh(d*n+e,i)}jt(mD,"getNextStepValue");function gD(t){return typeof t=="function"}jt(gD,"isFunction");const wx=m.forwardRef(({className:t,...e},n)=>b.jsxs(Woe,{ref:n,className:Ut("relative flex w-full touch-none select-none items-center","data-[disabled]:opacity-50",t),...e,children:[b.jsx(Yoe,{className:"relative h-1 w-full grow overflow-hidden rounded-full bg-input",children:b.jsx(Xoe,{className:"absolute h-full bg-primary"})}),b.jsx(nae,{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")})]}));wx.displayName="Slider";const iae=[{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"}],oae=[{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"}],aae=[{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"}],tm=[{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."}],lae=()=>{window.location.hash=""},ko=({title:t,eyebrow:e,description:n,children:r})=>b.jsxs("section",{className:"border-border bg-card shadow-surface-3 rounded-2xl border p-5",children:[b.jsxs("div",{className:"mb-5 max-w-2xl",children:[b.jsx("p",{className:"text-primary text-xs font-semibold tracking-[0.18em] uppercase",children:e}),b.jsx("h2",{className:"text-foreground mt-2 text-xl font-semibold",children:t}),b.jsx("p",{className:"text-muted-foreground mt-2 text-sm leading-6",children:n})]}),r]}),$P=({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))}),cae=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",uae=()=>{const t=tm.filter(n=>n.status==="showcased").length,e=tm.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:lae,className:"text-content-subtle hover:text-content mb-6 inline-flex items-center gap-2 text-sm transition-colors",children:[b.jsx(dK,{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(sI,{className:"text-primary h-5 w-5",weight:"bold"}),"Open with ",b.jsx("code",{className:"text-content",children:"#/design-system"})]})})]})]}),b.jsx(ko,{eyebrow:"Controls",title:"Button, split button, and tooltip",description:"Rivet's shared Button exposes variants and sizes backed by Fluid Functionalism, alongside the split button and tooltip controls.",children:b.jsxs("div",{className:"grid gap-4 lg:grid-cols-[1fr_1fr]",children:[b.jsxs("div",{className:"border-border bg-surface-2 rounded-xl border p-4",children:[b.jsx("p",{className:"text-foreground mb-3 text-sm font-medium",children:"Rivet Button"}),b.jsxs("div",{className:"flex flex-wrap items-center gap-3",children:[b.jsx(Qi,{title:"Primary action",shortcut:"D",variant:"primary",children:"Design action"}),b.jsx(Qi,{title:"Secondary action",variant:"secondary",children:"Secondary"}),b.jsx(Qi,{title:"Disabled action",disabled:!0,variant:"tertiary",children:"Disabled"}),b.jsx(_9,{primaryLabel:"Ship",primaryIcon:g_,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(kc,{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(Yb,{content:"Forced open preview",forceOpen:!0,side:"right",children:b.jsx("button",{className:"bg-selected text-content rounded-lg px-4 py-2 text-sm",children:"UI tooltip"})})]})]})]})}),b.jsx(ko,{eyebrow:"Tokens",title:"Surface ladder",description:"Surface tokens move from the base app background toward raised panels without leaving the dark Rivet palette.",children:b.jsx($P,{swatches:iae})}),b.jsx(ko,{eyebrow:"Tokens",title:"Color roles",description:"Named roles should communicate purpose: brand, selection, neutral accent, and outcome colors.",children:b.jsx($P,{swatches:oae})}),b.jsx(ko,{eyebrow:"Type",title:"Typography",description:"Satoshi remains the default UI voice with clear hierarchy and muted support text.",children:b.jsxs("div",{className:"grid gap-4 lg:grid-cols-3",children:[b.jsxs("div",{className:"border-border bg-surface-2 rounded-xl border p-4",children:[b.jsx("p",{className:"text-primary text-xs tracking-[0.18em] uppercase",children:"Display"}),b.jsx("p",{className:"text-foreground mt-2 text-3xl font-semibold tracking-tight",children:"Visual edits, quickly"})]}),b.jsxs("div",{className:"border-border bg-surface-2 rounded-xl border p-4",children:[b.jsx("p",{className:"text-foreground text-sm font-semibold",children:"Panel heading"}),b.jsx("p",{className:"text-muted-foreground mt-2 text-sm leading-6",children:"Body copy uses compact line height and muted contrast for dense inspector panels."})]}),b.jsxs("div",{className:"border-border bg-surface-2 rounded-xl border p-4",children:[b.jsx("p",{className:"text-content-subtle text-xs font-medium tracking-[0.16em] uppercase",children:"Micro label"}),b.jsx("code",{className:"bg-muted text-muted-foreground mt-3 block rounded-lg px-3 py-2 text-xs",children:"font-main text-content"})]})]})}),b.jsx(ko,{eyebrow:"Layout",title:"Spacing rhythm",description:"A compact spacing scale keeps editor chrome dense while preserving scannable groupings.",children:b.jsx("div",{className:"border-border bg-surface-2 rounded-xl border p-4",children:b.jsx("div",{className:"flex flex-col gap-3",children:aae.map(n=>b.jsxs("div",{className:"flex items-center gap-4",children:[b.jsx("code",{className:"text-muted-foreground w-16 text-xs",children:n.name}),b.jsx("div",{className:`${n.className} bg-primary h-4 rounded`}),b.jsx("div",{className:"bg-border h-px flex-1"})]},n.name))})})}),b.jsx(ko,{eyebrow:"Primitives",title:"Accordion and slider",description:"Representative Radix primitives styled through the local component layer.",children:b.jsxs("div",{className:"grid gap-4 lg:grid-cols-2",children:[b.jsxs(Rm,{defaultValue:["foundations"],className:"border-border bg-surface-2 rounded-xl border p-2",children:[b.jsx(Rm.Item,{value:"foundations",title:"Foundations",description:"Tokens, surfaces, type, and spacing.",className:"first-item",icon:b.jsx(g_,{className:"text-primary h-4 w-4"}),children:b.jsx("p",{children:"Use these pieces before adding one-off visual rules."})}),b.jsx(Rm.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(wx,{defaultValue:[64],max:100,step:1}),b.jsx(wx,{defaultValue:[36],max:100,step:1,disabled:!0})]})]})]})}),b.jsx(ko,{eyebrow:"Feedback",title:"Motion and loading",description:"Loading states use existing CSS animation utilities and avoid per-frame React work where possible.",children:b.jsxs("div",{className:"grid gap-4 sm:grid-cols-3",children:[b.jsxs("div",{className:"border-border bg-surface-2 rounded-xl border p-4",children:[b.jsx("p",{className:"text-foreground mb-4 text-sm font-medium",children:"Progress"}),b.jsx(Toe,{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(f4,{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(Doe,{hint:"Reading selected elements"})})]})}),b.jsx(ko,{eyebrow:"Feedback",title:"Status surfaces",description:"The unified full-surface system: one StatusSurface primitive with LoadingSurface / EmptyState / ErrorState wrappers. Every full-page loading, empty, and error state routes through these so they share layout, copy tone, and a single status_surface_shown impression event. Inline loaders (Sparkle, ThinkingIndicator, above) stay inline and are deliberately not part of this system.",children:b.jsxs("div",{className:"grid gap-4 sm:grid-cols-2",children:[b.jsx("div",{className:"border-border relative h-56 overflow-hidden rounded-xl border",children:b.jsx(ex,{fill:"surface",loader:"coalesce",trackGlobalLoaderCount:!1})}),b.jsx("div",{className:"border-border relative h-56 overflow-hidden rounded-xl border",children:b.jsx(U9,{icon:b.jsx(g_,{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(p4,{fill:"surface",size:"sm",title:"Preview isn't connected",description:"Rivet lost connection to your project.",actions:[{label:"Reload",onClick:()=>{}}]})})]})}),b.jsxs(ko,{eyebrow:"Inventory",title:"Component coverage",description:"Every current component file is accounted for here. Reusable primitives are rendered above; app surfaces that need live editor, git, auth, iframe, or generated state are cataloged instead of mounted unsafely.",children:[b.jsxs("div",{className:"mb-4 grid gap-3 sm:grid-cols-3",children:[b.jsxs("div",{className:"border-border bg-surface-2 rounded-xl border p-4",children:[b.jsx("p",{className:"text-content-subtle text-xs tracking-[0.16em] uppercase",children:"Total components"}),b.jsx("p",{className:"text-foreground mt-2 text-2xl font-semibold",children:tm.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:tm.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 ${cae(n.status)}`,children:n.status})}),b.jsx("p",{className:"text-muted-foreground",children:n.note})]},n.path))})]})]})]})})},dae=t=>(t.startsWith("#/")?t.slice(2):t.slice(1)).split("?")[0]==="design-system"?"design-system":"editor",xx=274,Fg=395,Q_=Math.min(Fg,Math.round((xx+Fg)/2*1.1)),FP="rivet:panelWidth:v2",fae=t=>{if(!(t instanceof HTMLElement))return!1;const e=t.tagName.toLowerCase();return t.isContentEditable||e==="input"||e==="textarea"||e==="select"},hae=({projectPath:t,libraryOrigin:e})=>{const n=dt(d9)>0,[r,s]=QT(c9),i=lG(),[o,l]=m.useState(()=>{if(typeof window>"u")return Q_;const T=Number(window.localStorage.getItem(FP));return Number.isFinite(T)&&T>=xx&&T<=Fg?T:Q_}),[u,d]=m.useState(!1),[f,h]=m.useState(Ese),g=r?o:0,[v,w]=m.useState(r);m.useEffect(()=>{if(!r){w(!1);return}h(T=>kse({position:T,boundsLeftPx:o}))},[r,o]),m.useEffect(()=>{window.localStorage.setItem(FP,String(o))},[o]),m.useEffect(()=>{if(!r)return;const T=I=>{I.key==="Escape"&&(fae(I.target)||(I.preventDefault(),s(!1)))};return window.addEventListener("keydown",T),()=>window.removeEventListener("keydown",T)},[r,s]);const _=m.useCallback(T=>{T.preventDefault(),T.stopPropagation();const I=T.clientX,M=o;d(!0);const R=N=>{const D=Math.min(Fg,Math.max(xx,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(Q_),[]),S=Vse(),k=dt(vv);Use({enabled:!k});const C=S.isProcessing?"Completing authentication...":null,A=gt(d4);return m.useEffect(()=>{A(t??null)},[t,A]),b.jsxs(Si.div,{className:"relative flex h-screen overflow-hidden",initial:!1,animate:{opacity:1},transition:{duration:.5,ease:"easeOut"},"data-cy":"rivet-app",children:[C!==null?b.jsx("div",{className:"absolute inset-0 z-50",children:b.jsx(dse,{message:C})}):null,b.jsx(Fne,{}),b.jsx(b.Fragment,{children:n?null:b.jsxs(b.Fragment,{children:[b.jsx("div",{className:"relative order-first h-full flex-shrink-0",style:{width:v?o:0},children:b.jsxs(Si.div,{className:"absolute inset-y-0 left-0 z-30",initial:!1,animate:{x:r?0:-o},transition:i?{duration:0}:{duration:.2,ease:[.22,1,.36,1]},onAnimationComplete:()=>{r&&w(!0)},style:{width:o,willChange:"transform"},children:[b.jsx(Qte,{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(Ase,{isVisible:!0,isPanelOpen:r,isReducedMotion:!!i,position:f,dragBoundsLeftPx:g,onPositionChange:h,onToggle:()=>s(T=>!T)})]})}),b.jsx($G,{duration:5e3,richColors:!0,toastOptions:{style:{maxHeight:"150px",overflow:"hidden"}}})]})},bx="rivet_connect_deep_link",pae=()=>{if(typeof window>"u")return null;const t=new URLSearchParams(window.location.search),e=t.get("connect"),n=e??window.sessionStorage.getItem(bx);if(n!=="pinterest"&&n!=="arena"&&n!=="x")return null;if(window.sessionStorage.setItem(bx,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},mae=pae(),gae=()=>{const[t,e]=m.useState(window.location.hash),[n]=m.useState(()=>typeof window<"u"&&window.sessionStorage.getItem(Tg)==="1"),[r,s]=m.useState(!1),[i,o]=m.useState(mae);m.useEffect(()=>{n&&window.sessionStorage.removeItem(Tg)},[n]);const{config:l,refetchConfig:u,loading:d,error:f}=$se(),h=gt(vv),{startLogin:g,isStartingLogin:v,loginError:w}=O9(),[_,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=dae(t),C=m.useCallback(async()=>{x(!0),h(!0);try{await u()}finally{h(!1),x(!1)}},[u,h]);if(m.useEffect(()=>{const M=()=>{const R=window.location.hash;e(R)};return window.addEventListener("hashchange",M),()=>window.removeEventListener("hashchange",M)},[]),k==="design-system")return b.jsx(uae,{});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(cse,{isSigningIn:v,onStartSignIn:()=>{g()},errorMessage:w,displayMode:"full"});const T=(l==null?void 0:l.agentModeAvailable)===!0&&i!==null,I=(l==null?void 0:l.agentModeAvailable)===!0&&n&&!r&&!T;return b.jsxs(b.Fragment,{children:[b.jsx(hae,{projectPath:l==null?void 0:l.projectPath,libraryOrigin:(l==null?void 0:l.libraryOrigin)??null}),b.jsx(Jw,{context:"onboarding",isOpen:I,onClose:()=>s(!0)}),b.jsx(Jw,{context:"menu",isOpen:T,highlightProvider:i,onClose:()=>{window.sessionStorage.removeItem(bx),o(null)}})]})},vae=m.lazy(()=>XP(()=>import("./LibraryEntry-B5kPF3Ey.js"),[])),vD=window.location.pathname.startsWith("/rivet/library"),yae="phc_Ntj9tXHbS64XgYxlTfhglRmFivFsfm0AERph4ZlnNH",_ae=new Cj,wae={session_recording:{maskAllInputs:!0,maskTextSelector:"[data-rivet-private]"}},xae=()=>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."})}),yD=document.getElementById("root");if(!yD)throw new Error("Rivet root element is missing");const VP=()=>Oz.createRoot(yD).render(b.jsx(we.StrictMode,{children:b.jsx(HH,{apiKey:yae,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",...wae,mask_all_text:!1,mask_all_element_attributes:!1,loaded:t=>{t.register({source:"visual_editor",surface:"visual_editor",telemetry_version:2,rivet_version:"0.21.2",env:"production"})}},children:b.jsx(qH,{fallback:b.jsx(xae,{}),children:b.jsx(ej,{client:_ae,children:b.jsx(RY,{defaultShape:"rounded",children:b.jsx(Coe,{defaultLibrary:"lucide",children:vD?b.jsx(m.Suspense,{fallback:b.jsx("div",{className:"bg-background h-screen"}),children:b.jsx(vae,{})}):b.jsx(gae,{})})})})})})}));vD?Ez().then(VP):VP();export{kae as $,dv as A,Qi as B,fv as C,uv as D,hv as E,pv as F,mv as G,Mt as H,fse as I,ip as J,poe as K,ZT as L,uh as M,dI as N,jie as O,i4 as P,wj as Q,nh as R,Qh as S,Zg as T,Tn as U,Xe as V,HT as W,Soe as X,dd as Y,mE as Z,_z as _,Pj as a,bY as a0,xe as a1,xz as a2,xh as a3,Nae as a4,Dae as a5,Cz as a6,dte as a7,Ut as a8,Rae as a9,Mae as aa,Iie as ab,Xte as ac,$G as ad,ate as ae,Aae as af,Pae as ag,Eae as ah,O9 as ai,kz as aj,Sz as ak,Cae as al,Rj as b,m as c,Mj as d,Lj as e,Ij as f,Sj as g,ch as h,Kr as i,Nj as j,Dj as k,Oj as l,s5 as m,pr as n,lt as o,Ei as p,r9 as q,n5 as r,ay as s,b as t,JP as u,Pw as v,o4 as w,a4 as x,l4 as y,aoe as z};