rivet-design 0.28.1 → 0.28.3

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 (89) hide show
  1. package/dist/cli/commands/libraryOpen.js +1 -0
  2. package/dist/cli/commands/mcpServe.js +5 -1
  3. package/dist/cli/commands/open.js +17 -6
  4. package/dist/cli/commands/profile.js +8 -1
  5. package/dist/cli/commands/profileDisconnect.d.ts +3 -0
  6. package/dist/cli/commands/profileDisconnect.js +34 -0
  7. package/dist/cli/commands/serve.js +2 -0
  8. package/dist/cli/commands/shared.js +4 -1
  9. package/dist/cli/envelope.d.ts +1 -0
  10. package/dist/cli/router.js +8 -2
  11. package/dist/jest.globalSetup.d.ts +3 -0
  12. package/dist/jest.globalSetup.js +19 -0
  13. package/dist/library/browserLaunch.d.ts +2 -1
  14. package/dist/library/browserLaunch.js +3 -2
  15. package/dist/proxy-middleware/proxy-config.d.ts +0 -1
  16. package/dist/proxy-middleware/proxy-config.js +6 -34
  17. package/dist/routes/agentVariants.js +20 -173
  18. package/dist/routes/referenceProfiles.js +3 -3
  19. package/dist/routes/static.js +8 -2
  20. package/dist/server.d.ts +1 -1
  21. package/dist/server.js +15 -26
  22. package/dist/services/AuthService.js +7 -61
  23. package/dist/services/IntegrationsClient.d.ts +2 -1
  24. package/dist/services/IntegrationsClient.js +46 -20
  25. package/dist/services/TelemetryService.d.ts +16 -2
  26. package/dist/services/TelemetryService.js +18 -0
  27. package/dist/services/accessTokenRefresh.js +2 -2
  28. package/dist/services/profiles/DesignProfiles.d.ts +16 -0
  29. package/dist/services/profiles/DesignProfiles.js +78 -17
  30. package/dist/services/profiles/ProfileAnalysis.d.ts +3 -0
  31. package/dist/services/profiles/ProfileAnalysis.js +66 -1
  32. package/dist/services/profiles/ProfileImports.d.ts +2 -0
  33. package/dist/services/profiles/ProfileImports.js +2 -0
  34. package/dist/services/templates/viteReactTs.js +1 -1
  35. package/dist/storage/profiles/ProfileRecords.d.ts +17 -0
  36. package/dist/storage/profiles/ProfileRecords.js +45 -7
  37. package/dist/storage/profiles/migrations.d.ts +2 -2
  38. package/dist/storage/profiles/migrations.js +7 -0
  39. package/dist/storage/profiles/schema.d.ts +48 -0
  40. package/dist/storage/profiles/schema.js +3 -0
  41. package/dist/types/api-responses.d.ts +39 -0
  42. package/dist/types/api-responses.js +12 -1
  43. package/dist/types/design-profile.d.ts +12 -0
  44. package/dist/types/design-profile.js +10 -1
  45. package/dist/types/rivet-page-types.d.ts +48 -0
  46. package/dist/types/rivet-page-types.js +6 -0
  47. package/dist/utils/failureReason.js +1 -1
  48. package/dist/utils/hostedLogPrivacy.js +1 -1
  49. package/dist/utils/launchRuntime.d.ts +2 -0
  50. package/dist/utils/launchRuntime.js +12 -0
  51. package/dist/utils/rivetPage.d.ts +8 -0
  52. package/dist/utils/rivetPage.js +24 -0
  53. package/dist/utils/rivetPage.testHelpers.d.ts +6 -0
  54. package/dist/utils/rivetPage.testHelpers.js +18 -0
  55. package/dist/utils/rivetPageDocument.d.ts +7 -0
  56. package/dist/utils/rivetPageDocument.js +41 -0
  57. package/dist/utils/scriptJson.d.ts +2 -0
  58. package/dist/utils/scriptJson.js +9 -0
  59. package/dist/utils/skills/cli-guidance.d.ts +1 -1
  60. package/dist/utils/skills/cli-guidance.js +2 -1
  61. package/dist/utils/uiDistPath.d.ts +2 -0
  62. package/dist/utils/uiDistPath.js +22 -0
  63. package/package.json +8 -5
  64. package/src/ui/dist/assets/LibraryEntry-CSU5OJwC.js +2 -0
  65. package/src/ui/dist/assets/google-g-CpxN0HWb.png +0 -0
  66. package/src/ui/dist/assets/main-B89lcZEY.css +1 -0
  67. package/src/ui/dist/assets/main-DeCxjHC1.js +204 -0
  68. package/src/ui/dist/index.html +3 -3
  69. package/src/ui/dist/pages/empty-project.html +53 -0
  70. package/src/ui/dist/pages/rivet-page.html +53 -0
  71. package/dist/routes/emptyStatePage.d.ts +0 -2
  72. package/dist/routes/emptyStatePage.js +0 -589
  73. package/src/ui/dist/assets/LibraryEntry-DS6Ce0sW.js +0 -112
  74. package/src/ui/dist/assets/logo-animation/clasp.png +0 -0
  75. package/src/ui/dist/assets/logo-animation/eraser.png +0 -0
  76. package/src/ui/dist/assets/logo-animation/playdough.png +0 -0
  77. package/src/ui/dist/assets/logo-animation/sea/bubblephone.png +0 -0
  78. package/src/ui/dist/assets/logo-animation/sea/cart.png +0 -0
  79. package/src/ui/dist/assets/logo-animation/sea/chair.png +0 -0
  80. package/src/ui/dist/assets/logo-animation/sea/desk.png +0 -0
  81. package/src/ui/dist/assets/logo-animation/sea/mug.png +0 -0
  82. package/src/ui/dist/assets/logo-animation/sea/pitcher.png +0 -0
  83. package/src/ui/dist/assets/logo-animation/sea/pot.png +0 -0
  84. package/src/ui/dist/assets/logo-animation/sea/startac.png +0 -0
  85. package/src/ui/dist/assets/logo-animation/sea/terracotta-1.png +0 -0
  86. package/src/ui/dist/assets/logo-animation/sea/terracotta-2.png +0 -0
  87. package/src/ui/dist/assets/logo-animation/sea/vhsplant.png +0 -0
  88. package/src/ui/dist/assets/main-CQSk-6km.css +0 -1
  89. package/src/ui/dist/assets/main-DkKRuatC.js +0 -218
@@ -1,218 +0,0 @@
1
- var qC=t=>{throw TypeError(t)};var x_=(t,e,n)=>e.has(t)||qC("Cannot "+n);var B=(t,e,n)=>(x_(t,e,"read from private field"),n?n.call(t):e.get(t)),rt=(t,e,n)=>e.has(t)?qC("Cannot add the same private member more than once"):e instanceof WeakSet?e.add(t):e.set(t,n),De=(t,e,n,r)=>(x_(t,e,"write to private field"),r?r.call(t,n):e.set(t,n),n),xt=(t,e,n)=>(x_(t,e,"access private method"),n);var E0=(t,e,n,r)=>({set _(s){De(t,e,s,n)},get _(){return B(t,e,r)}});function I7(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 O7="modulepreload",M7=function(t){return"/"+t},YC={},YI=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=M7(d),d in YC)return;YC[d]=!0;const f=d.endsWith(".css"),h=f?'[rel="stylesheet"]':"";if(document.querySelector(`link[href="${d}"]${h}`))return;const m=document.createElement("link");if(m.rel=f?"stylesheet":O7,f||(m.as="script"),m.crossOrigin="",m.href=d,u&&m.setAttribute("nonce",u),document.head.appendChild(m),f)return new Promise((g,_)=>{m.addEventListener("load",g),m.addEventListener("error",()=>_(new Error(`Unable to preload CSS for ${d}`)))})}))}function i(o){const l=new Event("vite:preloadError",{cancelable:!0});if(l.payload=o,window.dispatchEvent(l),!l.defaultPrevented)throw o}return s.then(o=>{for(const l of o||[])l.status==="rejected"&&i(l.reason);return e().catch(i)})};function iy(t){return t&&t.__esModule&&Object.prototype.hasOwnProperty.call(t,"default")?t.default:t}var S_={exports:{}},vh={},k_={exports:{}},It={};/**
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 XC;function L7(){if(XC)return It;XC=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 m(j){return j===null||typeof j!="object"?null:(j=h&&j[h]||j["@@iterator"],typeof j=="function"?j:null)}var g={isMounted:function(){return!1},enqueueForceUpdate:function(){},enqueueReplaceState:function(){},enqueueSetState:function(){}},_=Object.assign,y={};function b(j,Y,ue){this.props=j,this.context=Y,this.refs=y,this.updater=ue||g}b.prototype.isReactComponent={},b.prototype.setState=function(j,Y){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,Y,"setState")},b.prototype.forceUpdate=function(j){this.updater.enqueueForceUpdate(this,j,"forceUpdate")};function x(){}x.prototype=b.prototype;function S(j,Y,ue){this.props=j,this.context=Y,this.refs=y,this.updater=ue||g}var E=S.prototype=new x;E.constructor=S,_(E,b.prototype),E.isPureReactComponent=!0;var C=Array.isArray,R=Object.prototype.hasOwnProperty,O={current:null},I={key:!0,ref:!0,__self:!0,__source:!0};function A(j,Y,ue){var ie,ce={},he=null,ke=null;if(Y!=null)for(ie in Y.ref!==void 0&&(ke=Y.ref),Y.key!==void 0&&(he=""+Y.key),Y)R.call(Y,ie)&&!I.hasOwnProperty(ie)&&(ce[ie]=Y[ie]);var ve=arguments.length-2;if(ve===1)ce.children=ue;else if(1<ve){for(var pe=Array(ve),Ne=0;Ne<ve;Ne++)pe[Ne]=arguments[Ne+2];ce.children=pe}if(j&&j.defaultProps)for(ie in ve=j.defaultProps,ve)ce[ie]===void 0&&(ce[ie]=ve[ie]);return{$$typeof:t,type:j,key:he,ref:ke,props:ce,_owner:O.current}}function L(j,Y){return{$$typeof:t,type:j.type,key:Y,ref:j.ref,props:j.props,_owner:j._owner}}function N(j){return typeof j=="object"&&j!==null&&j.$$typeof===t}function H(j){var Y={"=":"=0",":":"=2"};return"$"+j.replace(/[=:]/g,function(ue){return Y[ue]})}var $=/\/+/g;function W(j,Y){return typeof j=="object"&&j!==null&&j.key!=null?H(""+j.key):Y.toString(36)}function X(j,Y,ue,ie,ce){var he=typeof j;(he==="undefined"||he==="boolean")&&(j=null);var ke=!1;if(j===null)ke=!0;else switch(he){case"string":case"number":ke=!0;break;case"object":switch(j.$$typeof){case t:case e:ke=!0}}if(ke)return ke=j,ce=ce(ke),j=ie===""?"."+W(ke,0):ie,C(ce)?(ue="",j!=null&&(ue=j.replace($,"$&/")+"/"),X(ce,Y,ue,"",function(Ne){return Ne})):ce!=null&&(N(ce)&&(ce=L(ce,ue+(!ce.key||ke&&ke.key===ce.key?"":(""+ce.key).replace($,"$&/")+"/")+j)),Y.push(ce)),1;if(ke=0,ie=ie===""?".":ie+":",C(j))for(var ve=0;ve<j.length;ve++){he=j[ve];var pe=ie+W(he,ve);ke+=X(he,Y,ue,pe,ce)}else if(pe=m(j),typeof pe=="function")for(j=pe.call(j),ve=0;!(he=j.next()).done;)he=he.value,pe=ie+W(he,ve++),ke+=X(he,Y,ue,pe,ce);else if(he==="object")throw Y=String(j),Error("Objects are not valid as a React child (found: "+(Y==="[object Object]"?"object with keys {"+Object.keys(j).join(", ")+"}":Y)+"). If you meant to render a collection of children, use an array instead.");return ke}function z(j,Y,ue){if(j==null)return j;var ie=[],ce=0;return X(j,ie,"","",function(he){return Y.call(ue,he,ce++)}),ie}function K(j){if(j._status===-1){var Y=j._result;Y=Y(),Y.then(function(ue){(j._status===0||j._status===-1)&&(j._status=1,j._result=ue)},function(ue){(j._status===0||j._status===-1)&&(j._status=2,j._result=ue)}),j._status===-1&&(j._status=0,j._result=Y)}if(j._status===1)return j._result.default;throw j._result}var te={current:null},Z={transition:null},J={ReactCurrentDispatcher:te,ReactCurrentBatchConfig:Z,ReactCurrentOwner:O};function q(){throw Error("act(...) is not supported in production builds of React.")}return It.Children={map:z,forEach:function(j,Y,ue){z(j,function(){Y.apply(this,arguments)},ue)},count:function(j){var Y=0;return z(j,function(){Y++}),Y},toArray:function(j){return z(j,function(Y){return Y})||[]},only:function(j){if(!N(j))throw Error("React.Children.only expected to receive a single React element child.");return j}},It.Component=b,It.Fragment=n,It.Profiler=s,It.PureComponent=S,It.StrictMode=r,It.Suspense=u,It.__SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED=J,It.act=q,It.cloneElement=function(j,Y,ue){if(j==null)throw Error("React.cloneElement(...): The argument must be a React element, but you passed "+j+".");var ie=_({},j.props),ce=j.key,he=j.ref,ke=j._owner;if(Y!=null){if(Y.ref!==void 0&&(he=Y.ref,ke=O.current),Y.key!==void 0&&(ce=""+Y.key),j.type&&j.type.defaultProps)var ve=j.type.defaultProps;for(pe in Y)R.call(Y,pe)&&!I.hasOwnProperty(pe)&&(ie[pe]=Y[pe]===void 0&&ve!==void 0?ve[pe]:Y[pe])}var pe=arguments.length-2;if(pe===1)ie.children=ue;else if(1<pe){ve=Array(pe);for(var Ne=0;Ne<pe;Ne++)ve[Ne]=arguments[Ne+2];ie.children=ve}return{$$typeof:t,type:j.type,key:ce,ref:he,props:ie,_owner:ke}},It.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},It.createElement=A,It.createFactory=function(j){var Y=A.bind(null,j);return Y.type=j,Y},It.createRef=function(){return{current:null}},It.forwardRef=function(j){return{$$typeof:l,render:j}},It.isValidElement=N,It.lazy=function(j){return{$$typeof:f,_payload:{_status:-1,_result:j},_init:K}},It.memo=function(j,Y){return{$$typeof:d,type:j,compare:Y===void 0?null:Y}},It.startTransition=function(j){var Y=Z.transition;Z.transition={};try{j()}finally{Z.transition=Y}},It.unstable_act=q,It.useCallback=function(j,Y){return te.current.useCallback(j,Y)},It.useContext=function(j){return te.current.useContext(j)},It.useDebugValue=function(){},It.useDeferredValue=function(j){return te.current.useDeferredValue(j)},It.useEffect=function(j,Y){return te.current.useEffect(j,Y)},It.useId=function(){return te.current.useId()},It.useImperativeHandle=function(j,Y,ue){return te.current.useImperativeHandle(j,Y,ue)},It.useInsertionEffect=function(j,Y){return te.current.useInsertionEffect(j,Y)},It.useLayoutEffect=function(j,Y){return te.current.useLayoutEffect(j,Y)},It.useMemo=function(j,Y){return te.current.useMemo(j,Y)},It.useReducer=function(j,Y,ue){return te.current.useReducer(j,Y,ue)},It.useRef=function(j){return te.current.useRef(j)},It.useState=function(j){return te.current.useState(j)},It.useSyncExternalStore=function(j,Y,ue){return te.current.useSyncExternalStore(j,Y,ue)},It.useTransition=function(){return te.current.useTransition()},It.version="18.3.1",It}var QC;function oS(){return QC||(QC=1,k_.exports=L7()),k_.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 JC;function N7(){if(JC)return vh;JC=1;var t=oS(),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={},m=null,g=null;d!==void 0&&(m=""+d),u.key!==void 0&&(m=""+u.key),u.ref!==void 0&&(g=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:m,ref:g,props:h,_owner:s.current}}return vh.Fragment=n,vh.jsx=o,vh.jsxs=o,vh}var eP;function D7(){return eP||(eP=1,S_.exports=N7()),S_.exports}var T=D7();const $7="x-rivet-editor-token",tP="editorToken",F7=["/api/account","/api/config","/api/auth/store","/api/auth/logout","/api/library/browser-launches","/api/integrations","/api/reference-profiles"],j7=/^\/api\/variants\/(?:[^/]+\/static\/|history\/[^/]+\/[^/]+\/(?:preview(?:\/|$)|site\/)|[^/]+\/[^/]+\/references\/[^/]+\/image\/?$)/,z7=(t,e="GET")=>{const n=t.split(/[?#]/)[0].toLowerCase();return/^\/api\/variants(?:\/|$)/.test(n)?!["GET","HEAD"].includes(e.toUpperCase())||!j7.test(n):F7.some(r=>n===r||n.startsWith(`${r}/`))},Eb="rivet_editor_token";let Cb;const V7=()=>{if(window.location.pathname.startsWith("/rivet/library"))return;const t=new URLSearchParams(window.location.hash.slice(1)),e=t.get(tP);if(e===null)return;Cb=e||null,t.delete(tP);const n=t.toString();window.history.replaceState(null,"",`${window.location.pathname}${window.location.search}${n?`#${n}`:""}`);try{e?window.sessionStorage.setItem(Eb,e):window.sessionStorage.removeItem(Eb)}catch{}},H7=()=>{if(Cb!==void 0)return Cb;try{return window.sessionStorage.getItem(Eb)}catch{return null}};var v=oS();const Se=iy(v),Of=I7({__proto__:null,default:Se},[v]);var U7={};const ae="u">typeof window?window:void 0,fs="u">typeof globalThis?globalThis:ae,Wr=fs==null?void 0:fs.navigator,Oe=fs==null?void 0:fs.document,ln=fs==null?void 0:fs.location,_p=fs==null?void 0:fs.fetch,aS=fs!=null&&fs.XMLHttpRequest&&"withCredentials"in new fs.XMLHttpRequest?fs.XMLHttpRequest:void 0,nP=fs==null?void 0:fs.AbortController,Z7=fs==null?void 0:fs.CompressionStream,Ss=Wr==null?void 0:Wr.userAgent,yh=typeof globalThis<"u"?globalThis:ae;yh&&typeof self>"u"&&(yh.self=yh),yh&&typeof File>"u"&&(yh.File=function(){});const et=ae??{},B7="0.10.7",Ia={DEBUG:!1,LIB_VERSION:B7,LIB_NAME:"browser-common"};var Lo=(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})({}),Pb=(function(t){return t.GZipJS="gzip-js",t.Base64="base64",t})({});const W7=["$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"],K7=["token"];function We(t,e){return t.indexOf(e)!==-1}const rf=function(t){return t.trim()},Tb=function(t){return t.replace(/^\$/,"")};function XI(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 QI=Object.prototype,lS=QI.hasOwnProperty,oy=QI.toString,He=Array.isArray||function(t){return oy.call(t)==="[object Array]"},Nn=t=>typeof t=="function",ct=t=>t===Object(t)&&!He(t),zs=t=>{if(ct(t)){for(const e in t)if(lS.call(t,e))return!1;return!0}return!1},le=t=>t===void 0,dt=t=>oy.call(t)=="[object String]",Xh=t=>dt(t)&&t.trim().length===0,Tn=t=>t===null,ot=t=>le(t)||Tn(t),Bn=t=>oy.call(t)=="[object Number]"&&t==t,ya=t=>Bn(t)&&t>0,Es=t=>oy.call(t)==="[object Boolean]",G7=t=>We(W7,t),q7=t=>We(K7,t);function JI(t){return t===null||typeof t!="object"}function Kg(t,e){return{}.toString.call(t)===`[object ${e}]`}function Mf(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 eO(t,Error)}}function cS(t){return"u">typeof Event&&eO(t,Event)}function eO(t,e){try{return t instanceof e}catch{return!1}}const Y7=[!0,"true",1,"1","yes"],E_=t=>We(Y7,t),X7=[!1,"false",0,"0","no"];function rP(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 un(t){return function(){var e=this,n=arguments;return new Promise(function(r,s){var i=t.apply(e,n);function o(u){rP(i,r,s,o,l,"next",u)}function l(u){rP(i,r,s,o,l,"throw",u)}o(void 0)})}}const Q7=["amazonbot","amazonproductbot","app.hypefactors.com","applebot","archive.org_bot","awariobot","backlinksextendedbot","baiduspider","bingbot","bingpreview","chrome-lighthouse","dataforseobot","deepscan","duckduckbot","facebookexternal","facebookcatalog","http://yandex.com/bots","hubspot","ia_archiver","leikibot","linkedinbot","meta-externalagent","mj12bot","msnbot","nessus","petalbot","pinterestbot","prerender","rogerbot","screaming frog","sebot-wa","sitebulb","slackbot","slurp","trendictionbot","turnitin","twitterbot","vercel-screenshot","vercelbot","yahoo! slurp","yandexbot","zoombot","bot.htm","bot.php","(bot;","bot/","crawler","ahrefsbot","ahrefssiteaudit","semrushbot","siteauditbot","splitsignalbot","gptbot","oai-searchbot","chatgpt-user","perplexitybot","better uptime bot","sentryuptimebot","uptimerobot","headlesschrome","lightpanda","cypress","google-hoteladsverifier","adsbot-google","apis-google","duplexweb-google","feedfetcher-google","google favicon","google web preview","google-read-aloud","googlebot","googleother","google-cloudvertexbot","googleweblight","mediapartners-google","storebot-google","google-inspectiontool","bytespider"],C0=new Map,sP=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=C0.get(n);if(r!==void 0)return r;const s=t.toLowerCase(),i=Q7.concat(e).some(o=>s.indexOf(o.toLowerCase())!==-1);return 256>C0.size||C0.clear(),C0.set(n,i),i};function Zo(t,e,n,r,s){return e>n&&(r.warn("min cannot be greater than max."),e=n),Bn(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),Zo(s??n,e,n,r))}var J7=class{constructor(t){this.C={},this.I=t.I,this.A=Zo(t.bucketSize,0,100,t.R),this.O=Zo(t.refillRate,0,this.A,t.R),this.$=Zo(t.refillInterval,0,864e5,t.R)}F(t,e){const n=Math.floor((e-t.lastAccess)/this.$);n>0&&(t.tokens=Math.min(t.tokens+n*this.O,this.A),t.lastAccess=t.lastAccess+n*this.$)}consumeRateLimit(t){var e;const n=Date.now(),r=String(t);let s=this.C[r];return s?this.F(s,n):(s={tokens:this.A,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 wp="Mobile",bp="Android",Rb="Tablet",tO="Android Tablet",nO="iPad",rO="Apple Watch",pg="Safari",ay="BlackBerry",sO="Samsung Internet",mg="Chrome",iO="Chrome iOS",oO="Internet Explorer",aO="Internet Explorer Mobile",lO="Opera",cO="Microsoft Edge",gg="Firefox",uO="Firefox iOS",Gg="Nintendo",qg="PlayStation",ly="Xbox",dO="Android Mobile",fO="Mobile Safari",C_="Windows",hO="Windows Phone",iP="Nokia",Ab="Ouya",pO="Generic tablet",Ib="Konqueror",mO="Oculus Browser",gO="Vivaldi",vO="Yandex",yO="Whale",_O="DuckDuckGo",wO="Pale Moon",bO="Waterfox",Ob="Brave",xO="Claude",SO="Codex",kO="ChatGPT",EO="Google Search App",P_=new RegExp("Version/(\\d+(\\.\\d+)?)"),T_=new RegExp("(Claude|Codex|ChatGPT)\\/(\\d+(\\.\\d+)?)"),ez=new RegExp(ly,"i"),tz=new RegExp("PlayStation \\w+","i"),nz=new RegExp("Nintendo \\w+","i"),uS=new RegExp("BlackBerry|PlayBook|BB10","i"),rz={"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"},CO=function(t,e,n,r){return e=e||"",(function(i){return i!=null&&i.brave?Ob:null})(n)||(r!=null&&r.detectGoogleSearchApp&&We(t,"GSA/")?EO:We(t," OPR/")&&We(t,"Mini")?"Opera Mini":We(t," OPR/")?lO:uS.test(t)?ay:We(t,"IEMobile")||We(t,"WPDesktop")?aO:We(t,"OculusBrowser")?mO:We(t,"SamsungBrowser")?sO:We(t,"Edge")||We(t,"Edg/")?cO:We(t,"Vivaldi/")?gO:We(t,"YaBrowser/")?vO:We(t,"Whale/")?yO:We(t,"DuckDuckGo/")||We(t,"Ddg/")?_O:We(t,"Claude/")?xO:We(t,"Codex/")?SO:We(t,"ChatGPT/")?kO:We(t,"FBIOS")?"Facebook Mobile":We(t,"UCWEB")||We(t,"UCBrowser")?"UC Browser":We(t,"CriOS")?iO:We(t,"CrMo")||We(t,mg)?mg:We(t,bp)&&We(t,pg)?dO:We(t,"FxiOS")?uO:We(t.toLowerCase(),Ib.toLowerCase())?Ib:We(t,"Brave/")?Ob:((i,o)=>o&&We(o,"Apple")||(function(l){return We(l,pg)&&!We(l,mg)&&!We(l,bp)})(i))(t,e)?We(t,wp)?fO:pg:We(t,"PaleMoon/")?wO:We(t,"Waterfox/")?bO:We(t,gg)?gg:We(t,"MSIE")||We(t,"Trident/")?oO:We(t,"Gecko")?gg:"")},sz={[aO]:[new RegExp("rv:(\\d+(\\.\\d+)?)")],[cO]:[new RegExp("Edge?\\/(\\d+(\\.\\d+)?)")],[mg]:[new RegExp("(Chrome|CrMo)\\/(\\d+(\\.\\d+)?)")],[iO]:[new RegExp("CriOS\\/(\\d+(\\.\\d+)?)")],"UC Browser":[new RegExp("(UCBrowser|UCWEB)\\/(\\d+(\\.\\d+)?)")],[pg]:[P_],[fO]:[P_],[lO]:[new RegExp("(Opera|OPR)\\/(\\d+(\\.\\d+)?)")],[gg]:[new RegExp("Firefox\\/(\\d+(\\.\\d+)?)")],[uO]:[new RegExp("FxiOS\\/(\\d+(\\.\\d+)?)")],[Ib]:[new RegExp("Konqueror[:/]?(\\d+(\\.\\d+)?)","i")],[ay]:[new RegExp("BlackBerry (\\d+(\\.\\d+)?)"),P_],[dO]:[new RegExp("android\\s(\\d+(\\.\\d+)?)","i")],[sO]:[new RegExp("SamsungBrowser\\/(\\d+(\\.\\d+)?)")],[mO]:[new RegExp("OculusBrowser\\/(\\d+(\\.\\d+)?)")],[gO]:[new RegExp("Vivaldi\\/(\\d+(\\.\\d+)?)")],[vO]:[new RegExp("YaBrowser\\/(\\d+(\\.\\d+)?)")],[yO]:[new RegExp("Whale\\/(\\d+(\\.\\d+)?)")],[Ob]:[new RegExp("Brave\\/(\\d+(\\.\\d+)?)")],[xO]:[T_],[SO]:[T_],[kO]:[T_],[_O]:[new RegExp("(DuckDuckGo|Ddg)\\/(\\d+(\\.\\d+)?)")],[wO]:[new RegExp("PaleMoon\\/(\\d+(\\.\\d+)?)")],[bO]:[new RegExp("Waterfox\\/(\\d+(\\.\\d+)?)")],[EO]:[new RegExp("GSA\\/(\\d+(\\.\\d+)?)")],[oO]:[new RegExp("(rv:|MSIE )(\\d+(\\.\\d+)?)")],Mozilla:[new RegExp("rv:(\\d+(\\.\\d+)?)")]},iz=function(t,e,n,r){const s=CO(t,e,n,r),i=sz[s];if(le(i))return null;for(let o=0;i.length>o;o++){const l=t.match(i[o]);if(l)return parseFloat(l[l.length-2])}return null},oP=[[new RegExp("Xbox; Xbox (.*?)[);]","i"),t=>[ly,t&&t[1]||""]],[new RegExp(Gg,"i"),[Gg,""]],[new RegExp(qg,"i"),[qg,""]],[uS,[ay,""]],[new RegExp(C_,"i"),(t,e)=>{if(/Phone/.test(e)||/WPDesktop/.test(e))return[hO,""];if(new RegExp(wp).test(e)&&!/IEMobile\b/.test(e))return["Windows Mobile",""];const n=/Windows NT ([0-9.]+)/i.exec(e);if(n&&n[1]){let r=rz[n[1]]||"";return/arm/i.test(e)&&(r="RT"),[C_,r]}return[C_,""]}],[/((iPhone|iPad|iPod).*?OS (\d+)_(\d+)_?(\d+)?|iPhone)/,t=>t&&t[3]?["iOS",[t[3],t[4],t[5]||"0"].join(".")]:["iOS",""]],[/(watch.*\/(\d+\.\d+\.\d+)|watch os,(\d+\.\d+),)/i,t=>{let e="";return t&&t.length>=3&&(e=le(t[2])?t[3]:t[2]),["watchOS",e]}],[new RegExp("(Android (\\d+)\\.(\\d+)\\.?(\\d+)?|Android)","i"),t=>t&&t[2]?[bp,[t[2],t[3],t[4]||"0"].join(".")]:[bp,""]],[/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",""]]],PO=function(t){for(let e=0;oP.length>e;e++){const[n,r]=oP[e],s=n.exec(t),i=s&&(Nn(r)?r(s,t):r);if(i)return i}return["",""]},TO=function(t){return nz.test(t)?Gg:tz.test(t)?qg:ez.test(t)?ly:new RegExp(Ab,"i").test(t)?Ab:new RegExp("(Windows Phone|WPDesktop)","i").test(t)?hO:/iPad/.test(t)?nO:/iPod/.test(t)?"iPod Touch":/iPhone/.test(t)?"iPhone":/(watch)(?: ?os[,/]|\d,\d\/)[\d.]+/i.test(t)?rO:uS.test(t)?ay:/(kobo)\s(ereader|touch)/i.test(t)?"Kobo":new RegExp(iP,"i").test(t)?iP:/(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(wp).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)?bp:tO:new RegExp("(pda|Mobile)","i").test(t)?"Generic mobile":new RegExp(Rb,"i").test(t)&&!new RegExp("Tablet pc","i").test(t)?pO:""},oz=function(t,e){var n;const r=TO(t);return r===nO||r===tO||r==="Kobo"||r==="Kindle Fire"||r===pO?Rb:r===Gg||r===ly||r===qg||r===Ab?"Console":r===rO?"Wearable":r?wp:(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)?wp:Rb:"Desktop";var s,i,o},R_=/\bFBAV\/(\d+(?:\.\d+)*)/i,aP=[[/\bInstagram(?:[ /](\d+(?:\.\d+)*))?\b/i,"Instagram"],[/\bBarcelona[ /](\d+(?:\.\d+)*)?/i,"Threads"],[/\b(?:MessengerForiOS|(?:FBAN|FB_IAB)\/Orca-Android)\b/i,"Messenger",R_],[/\bFBAN\/EMA\b/i,"Facebook Lite",R_],[/\b(?:FBIOS|(?:FBAN|FB_IAB)\/(?:FB4A|FBIOS))\b/i,"Facebook",R_],[/\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"]],Mb="[Truncated]",fm="[Unserializable]";function Od(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 RO(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=fm}Object.defineProperty(t,r,{value:s,enumerable:!0,writable:!0,configurable:!0})}return t}const A_=3e5;var AO=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,A_);if(!e)return this.ts=n,void(this.es=n+r);this.es=Math.max(this.es,Math.min(n+r,this.ts+A_))}remainingMs(){const t=Date.now();if(this.ts-5e3>t)return this.reset(),0;const e=Math.min(A_,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 az=/^[0-9a-f]{8}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{12}$/i;function lP(t,e){return typeof(n=t)=="string"&&az.test(n)?t:e();var n}function IO(t,e){const n=new Error(e);try{Object.defineProperty(n,"name",{value:t,writable:!0,enumerable:!0,configurable:!0})}catch{}return n}function jl(t){return t&&t.split("#")[0]}function cP(t){try{return t()}catch{return}}function OO(t,e){const n=setTimeout(t,e);return n!=null&&n.unref&&(n==null||n.unref()),n}function uP(t,e,n){return MO.apply(this,arguments)}function MO(){return(MO=un(function*(t,e,n){let r;try{return yield Promise.race([t,new Promise((s,i)=>{r=OO(()=>{try{n==null||n(),s()}catch(o){i(o)}},e)})])}finally{clearTimeout(r)}})).apply(this,arguments)}function Qh(t){return Qh=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},Qh(t)}function lz(t,e,n){return(e=(function(r){var s=(function(i){if(Qh(i)!="object"||!i)return i;var o=i[Symbol.toPrimitive];if(o!==void 0){var l=o.call(i,"string");if(Qh(l)!="object")return l;throw new TypeError("@@toPrimitive must return a primitive value.")}return String(i)})(r);return Qh(s)=="symbol"?s:s+""})(e))in t?Object.defineProperty(t,e,{value:n,enumerable:!0,configurable:!0,writable:!0}):t[e]=n,t}function dP(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 F(t){for(var e=1;arguments.length>e;e++){var n=arguments[e]!=null?arguments[e]:{};e%2?dP(Object(n),!0).forEach(function(r){lz(t,r,n[r])}):Object.getOwnPropertyDescriptors?Object.defineProperties(t,Object.getOwnPropertyDescriptors(n)):dP(Object(n)).forEach(function(r){Object.defineProperty(t,r,Object.getOwnPropertyDescriptor(n,r))})}return t}let _h,fP,hP,ed;function cz(t){var e;const n=globalThis._posthogChunkIds,r=globalThis._debugIds;if(!n&&!r)return;const s=n?Object.keys(n):[],i=r?Object.keys(r):[];if(ed&&pP(n,s,fP)&&pP(r,i,hP))return ed;fP=n?F({},n):void 0,hP=r?F({},r):void 0,ed={},(e=_h)!==null&&e!==void 0||(_h={});const o=(l,u)=>{for(const f of l){const h=u[f];if(!h)continue;const m=_h==null?void 0:_h[f];if(m){ed[m]=h;continue}const g=t(f);for(let _=g.length-1;_>=0;_--){var d;const y=(d=g[_])===null||d===void 0?void 0:d.filename;if(y){ed[y]=h,_h[f]=y;break}}}};return r&&o(i,r),n&&o(s,n),ed}function pP(t,e,n){return t&&n?e.length===Object.keys(n).length&&e.every(r=>t[r]===n[r]):t===n}var uz=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 un(function*(){for(const n of t)n.stacktrace&&n.stacktrace.frames&&He(n.stacktrace.frames)&&(n.stacktrace.frames=yield e.applyModifiers(n.stacktrace.frames));return t})()}coerceFallback(t){var e;return{type:"Error",value:"Unknown error",stack:(e=t.syntheticException)===null||e===void 0?void 0:e.stack,synthetic:!0}}parseStacktrace(t,e){var n;let r,s;if(t.cause!=null&&(r=this.parseStacktrace(t.cause,e)),t.stack!=""&&t.stack!=null)try{s=this.applyChunkIds(this.stackParser(t.stack,t.synthetic?e.skipFirstLines:0),e.chunkIdMap)}catch{}return F(F({},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 un(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?F(F({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:cz(this.stackParser),skipFirstLines:(e=t.skipFirstLines)!==null&&e!==void 0?e:1}}getAggregateErrors(t){try{if(Mf(t)){let n=Object.getPrototypeOf(t);for(let r=0;n&&100>r;r++){var e;const s=(e=Object.getOwnPropertyDescriptor(n,"constructor"))===null||e===void 0?void 0:e.value;if(typeof s=="function"&&s.name==="AggregateError"){const i=t.errors;return He(i)?i:void 0}n=Object.getPrototypeOf(n)}}}catch{}}buildCoercingContext(t,e,n=0){let r=0,s=0,i=!1;const o=new Set,l=[],u={},d=(m,g,_=0)=>{const y=f(g,_),b=y.apply;if(y.apply=O=>{l.push(m);try{return b(O)}finally{l.pop()}},_>4||_>0&&l.indexOf(m)!==-1)return this.coerceFallback(y);const x=typeof m=="object"&&m!==null||typeof m=="function";if(_===0&&r>=50||x&&o.has(m))return;x&&o.add(m),_===0&&r++;const S=this.getAggregateErrors(m);let E,C;i||(i=!!S);try{if(E=this.applyCoercers(m,y),!E)throw u}catch(O){if(O===u)return void(_===0&&r--);if(!i)throw O;E=this.coerceFallback(y)}if(!S||r>=50)return E;try{C=S.length}catch{return E}if(!Number.isInteger(C)||0>C||C>4294967295)return E;const R=[];for(let O=0;50>r&&1e3>s&&C>O;O++){let I;s++;try{I=y.next(S[O])}catch{r++,I=this.coerceFallback(f(g+1))}I&&R.push(I)}return F(F({},E),{},{errors:R})},f=(m,g=0)=>F(F({},e),{},{syntheticException:m==0?e.syntheticException:void 0,mechanism:m==0?t:{},apply(_){const y=d(_,m,g+1);if(!y)throw u;return y},next:_=>d(_,m+1)}),h=f(n);return F(F({},h),{},{apply:m=>{var g;return(g=d(m,n))!==null&&g!==void 0?g:this.coerceFallback(h)}})}};const dz=/^([a-z][a-z0-9.+-]+):/i,fz=["http","https","file","blob","app","capacitor","ionic","webpack","webpack-internal","ng"];function hz(t){if(!t||t==="<anonymous>")return!1;const e=dz.exec(t);return!e||fz.includes(e[1].toLowerCase())}function Lb(t,e,n,r,s){const i={platform:t,filename:e,function:n==="<anonymous>"?"?":n,in_app:hz(e)};return le(r)||(i.lineno=r),le(s)||(i.colno=s),i}const LO=(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]},pz=/^\s*at (\S+?)(?::(\d+))(?::(\d+))\s*$/i,mz=/^\s*at (?:(.+?\)(?: \[.+\])?|.*?) ?\((?:address at )?)?(?:async )?((?:<anonymous>|[-a-z]+:|.*bundle|\/)?.*?)(?::(\d+))?(?::(\d+))?\)?\s*$/i,gz=/\((\S*)(?::(\d+))(?::(\d+))\)/,vz=(t,e)=>{const n=pz.exec(t);if(n){const[,s,i,o]=n;return Lb(e,s,"?",+i,+o)}const r=mz.exec(t);if(r){if(r[2]&&r[2].indexOf("eval")===0){const o=gz.exec(r[2]);o&&(r[2]=o[1],r[3]=o[2],r[4]=o[3])}const[s,i]=LO(r[1]||"?",r[2]);return Lb(e,i,s,r[3]?+r[3]:void 0,r[4]?+r[4]:void 0)}},yz=/^\s*(.*?)(?:\((.*?)\))?(?:^|@)?((?:[-a-z]+)?:\/.*?|\[native code\]|[^@]*(?:bundle|\d+\.js)|\/[\w\-. /=]+)(?::(\d+))?(?::(\d+))?\s*$/i,_z=/(\S+) line (\d+)(?: > eval line \d+)* > eval/i,wz=(t,e)=>{const n=yz.exec(t);if(n){if(n[3]&&n[3].indexOf(" > eval")>-1){const i=_z.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]=LO(s,r),Lb(e,r,s,n[4]?+n[4]:void 0,n[5]?+n[5]:void 0)}},mP=/\(error: (.*)\)/;function dS(t,e){return t.filename===e.filename&&t.function===e.function&&t.module===e.module&&t.lineno===e.lineno&&t.colno===e.colno}function bz(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(!dS(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 xz(t,e){const n=e.start+e.length,r=DO(t,e);r&&t.splice(n+r===t.length?n:e.start,r)}function NO(t,e){let n=e.start;for(;n>0&&dS(t[n-1],t[n-1+e.length]);)n--;return e.start-n}function DO(t,e){const n=e.start+e.length;let r=n;for(;t.length>r&&dS(t[r],t[r-e.length]);)r++;return r-n}function Sz(t,e){const n=e[0];let r=t.length-(n?NO(t,n):0);for(const s of e)r-=DO(t,s);return r}function kz(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 Ez=class{match(t){return this.isDOMException(t)||this.isDOMError(t)}coerce(t,e){const n=dt(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 Kg(t,"DOMException")}isDOMError(t){return Kg(t,"DOMError")}},Cz=class{match(t){return Mf(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}}},Pz=class{match(t){return!!Kg(t,"ErrorEvent")&&(t.error!=null||this.yr(t))}coerce(t,e){var n;if(t.error!=null)return e.apply(t.error);const r=e.apply(t.message);return F(F({},r),{},{stack:(n=this.br(t))!==null&&n!==void 0?n:r.stack,synthetic:!0})}yr(t){return dt(t.message)&&t.message.length>0}br(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(dt(r.filename)&&r.filename.length!==0&&s!==0)return`Error
18
- at ${r.filename}:${s}:${i}`}};const Tz=/^(?:[Uu]ncaught (?:exception: )?)?(?:((?:Eval|Internal|Range|Reference|Syntax|Type|URI|)Error): )?(.*)$/i;var Rz=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(Tz);return r&&(e=r[1],n=r[2]),[e,n]}};const Az=["fatal","error","warning","log","info","debug"];function $O(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 Iz=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(cS(t))return t.constructor.name;const e="name"in t?t.name:void 0;return dt(e)&&!Xh(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: ${$O(t)}`}isSeverityLevel(t){return dt(t)&&!Xh(t)&&Az.indexOf(t)>=0}getStack(t){try{return dt(t.stacktrace)&&t.stacktrace.length>0?t.stacktrace:dt(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(Mf(n))return n}}getObjectClassName(t){try{const e=Object.getPrototypeOf(t);return e?e.constructor.name:void 0}catch{return}}},Oz=class{match(t){return cS(t)}coerce(t,e){var n;const r=t.constructor.name;return{type:r,value:`${r} captured as exception with keys: ${$O(t)}`,stack:(n=e.syntheticException)===null||n===void 0?void 0:n.stack,synthetic:!0}}},Mz=class{match(t){return JI(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}}},Lz=class{match(t){return Kg(t,"PromiseRejectionEvent")||this.isCustomEventWrappingRejection(t)}isCustomEventWrappingRejection(t){if(!cS(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 JI(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 Yg="$message",Xg="$timestamp",Nz=new Set([Yg,Xg]),I_={enabled:!0,max_bytes:32768};function Qg(t){var e;return t?{enabled:(e=t.enabled)!==null&&e!==void 0?e:I_.enabled,max_bytes:$z(t.max_bytes,I_.max_bytes)}:F({},I_)}var Dz=class{constructor(t){this.ns=[],this.ss=0,this.Fr=Qg(t)}setConfig(t){this.Fr=Qg(t),this.rs()}add(t){const e=(function(r){let s;try{s=XI(r)}catch{return}try{const i=JSON.parse(s);if(!ct(i))return;const o=i,l=o[Yg],u=o[Xg];return!dt(l)||l.trim().length===0||!dt(u)&&!Bn(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.Fr.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.Fr.max_bytes&&this.ns.length>0;){const t=this.ns.shift();t&&(this.ss-=t.bytes)}}};function $z(t,e){if(!Bn(t)||t===1/0||t===-1/0)return e;const n=Math.floor(t);return 0>n?e:n}const gP=t=>{if(typeof t!="string")return t;try{return JSON.parse(t)}catch{return t}};function vP(t){return typeof t=="string"||t}function yP(t){return typeof t=="string"?t:void 0}const Fz=["$feature_flag","$feature_flag_response","$feature_flag_has_experiment","$feature_flag_id","$feature_flag_version","$feature_flag_reason","$feature_flag_request_id","$feature_flag_evaluated_at","$feature_flag_error","locally_evaluated","$groups","$process_person_profile","$geoip_disable","$current_url","$pathname","$referring_domain","utm_source","utm_medium","utm_campaign","utm_content","utm_term","gad_source","mc_cid","gclid","gclsrc","dclid","gbraid","wbraid","fbclid","msclkid","twclid","li_fat_id","igshid","ttclid","rdt_cid","epik","qclid","sccid","oppref","bfcid","irclid","_kx","$session_id","$window_id","$lib","$lib_version","$device_id","$is_server"],FO="NativeGzipValidationError",Nb=t=>t.length>=2&&t[0]===31&&t[1]===139,_P=(t,e)=>t===Pb.GZipJS||e===Pb.GZipJS||e==="gzip",wP=t=>!(!t||typeof t!="object")&&("name"in t?String(t.name):"")==="NotReadableError";let wh;const P0=t=>{throw IO(FO,`Native gzip produced invalid output: ${t}`)},jz=(function(){var t=un(function*(e,n){18>e.size&&P0("too-short");const r=new Uint8Array(yield e.slice(0,10).arrayBuffer());Nb(r)&&r[2]===8||P0("invalid-header");const s=new DataView(yield e.slice(e.size-8).arrayBuffer());s.getUint32(0,!0)!==(o=>{const l=(()=>{if(wh)return wh;wh=[];for(let d=0;256>d;d++){let f=d;for(let h=0;8>h;h++)f=1&f?3988292384^f>>>1:f>>>1;wh[d]=f>>>0}return wh})();let u=4294967295;for(let d=0;o.length>d;d++)u=l[255&(u^o[d])]^u>>>8;return(4294967295^u)>>>0})(n)&&P0("invalid-crc");const i=n.length>>>0;s.getUint32(4,!0)!==i&&P0("invalid-size")});return function(e,n){return t.apply(this,arguments)}})();function Db(){return Db=un(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=un(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 jz(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}),Db.apply(this,arguments)}function jO(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 us="[redacted]",zz=/^[A-Za-z0-9+/\n\r]+=*$/,Vz=/^[A-Za-z0-9_-]+={0,2}$/,Hz=/[-_]/,Uz=/^data:[^,\s]*;base64,/i,Zz=/^[A-Za-z0-9+/_-]+={0,2}$/,Bz=/\bph[a-z]_[A-Za-z0-9_-]{20,}\b/g,Wz=/^(authorization|cookie|set-cookie|x-api-key|api[-_]?key|api[-_]?token|access[-_]?token|refresh[-_]?token|token|password|secret|client[-_]?secret|private[-_]?key)$/i,zO=/[a-z][a-z0-9+.-]{0,63}:[^\s<>"]+/gi,Kz=/[\s<>"]/,VO=new RegExp(zO.source,"i"),HO=/[a-z][a-z0-9+.-]{0,63}:\/\//i,Gz=new RegExp(`^${HO.source}`,"i"),qz=new RegExp(HO.source,"gi"),Yz=/(^|[-_./;])(auth|token|secret|password|passwd|pwd|credential|signature|sig|key|hmac|sas|bearer|jwt|session|sessionid)([-_./;]|$)/i,Xz=/^(code|AWSAccessKeyId|GoogleAccessId|Policy)$/i,Qz=/[\u00A0\u1680\u2000-\u200A\u202F\u205F\u3000]/g,Jz=/[A-Za-z0-9._%+-]{1,64}@[A-Za-z0-9.-]{1,255}\.[A-Za-z]{2,24}/g,eV=/\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,tV=/(^|[^\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,nV=/\b\d{3}[ .-]\d{2}[ .-]\d{4}\b/g,rV=/\b\d(?:[ ./-]?\d){12,}\b/g,bP=/\d+/g,sV=/(^|[^\w+])((?:\+?1[ ./-]?)?(?:\(\d{3}\)[ ./-]?|\d{3}[ ./-])\d{3}[ ./-]\d{4})(?![\w])/g,iV=/(^|[^\w])(\+\d{1,3}(?:[ ./()-]{0,2}\d){7,13})(?![\w])/g;function $b(t){return(function(e){return Wz.test(e)})(t)||Yz.test(t)||Xz.test(t)}function O_(t){return t.split("&",129).length>128}function oV(t,e,n){return $b(t)||e.includes(";")&&(function(r){return r.split(";").some(s=>$b(s.split("=",1)[0]))})(e)?us:VO.test(e)?n?fS(e,{allowNestedUrls:!1,stripPunctuation:!0}):us:e}function UO(t,e){const n=new URLSearchParams;let r=!1,s=!1;for(const[i,o]of new URLSearchParams(t)){const l=Jg(i),u=Jg(o);r||(r=l!==i||u!==o);const d=oV(l,u,e);r||(r=d!==u),s=$b(l)||d!==u,n.append(l,d)}return{changed:r,lastFieldSensitive:s,serialized:n.toString()}}function xP(t,e){if(!t.includes("="))return{value:aV(t,e),lastFieldSensitive:!1};const n=UO(t,e);return{value:n.changed?n.serialized:t,lastFieldSensitive:n.lastFieldSensitive}}function aV(t,e){return e?fS(t,{allowNestedUrls:!1,stripPunctuation:!0}):VO.test(t)?us:t}function lV(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 M_(t,e){var n;if(t.length>8192&&Gz.test(t))return us;const{address:r,suffix:s}=e.stripPunctuation?(function(b){let x=b.length;for(;x>0&&".,;:!?)]}'".includes(b[x-1]);)x--;return{address:b.slice(0,x),suffix:b.slice(x)}})(t):{address:t,suffix:""};let i;try{i=new URL(r)}catch{return us+s}const o=i.search.slice(1),l=i.hash!=="",u=(function(b){const x=b.slice(1),S=x.indexOf("?");return 0>S?{head:x,tail:null}:{head:x.slice(0,S),tail:x.slice(S+1)}})(i.hash);if(O_(o)||O_(u.head)||O_((n=u.tail)!==null&&n!==void 0?n:""))return us+s;let d=!1;(i.username||i.password)&&(i.username=us,i.password="",d=!0);const f=UO(o,e.allowNestedUrls);f.changed&&(i.search=f.serialized,d=!0);const h=xP(u.head,e.allowNestedUrls),m=u.tail===null?null:(g=u.tail,h.lastFieldSensitive?{value:g===""?"":us,lastFieldSensitive:!0}:xP(g,e.allowNestedUrls));var g;const _=m===null?h.value:`${h.value}?${m.value}`;_!==i.hash.slice(1)&&(i.hash=_,d=!0);const y=l?m??h:f;return(d?Jg(i.toString()):r)+(y.lastFieldSensitive?"":s)}function fS(t,e){return t.replace(zO,n=>(function(r,s){const i=(function(u){if(!u.includes("://"))return[];const d=[...u.matchAll(qz)].map(y=>y.index),f=[],h={query:!1,fragment:!1,fragmentQuery:!1};let m=0,g=!1,_="";for(let y=0;u.length>y&&d.length>m;y++){d[m]===y&&(y>0&&_!=="="&&f.push(y),m++);const b=u[y];lV(b,h,_)?(_=b,g=!0):g&&"=&".includes(b)&&(_=b)}return f})(r);if(i.length===0)return M_(r,s);let o="",l=0;for(const u of i)o+=M_(r.slice(l,u),F(F({},s),{},{stripPunctuation:!1})),l=u;return o+M_(r.slice(l),s)})(n,F(F({},e),{},{stripPunctuation:e.stripPunctuation&&n.length!==t.length})))}function Jg(t){return t.replace(Bz,us)}function ZO(t,e){return(function(n){return n.length>=10240&&(zz.test(n)||(function(r){const s=Uz.exec(r);if(!s)return!1;let i;try{i=decodeURIComponent(r.slice(s[0].length))}catch{return!1}return Zz.test(i.replace(/[\r\n]/g,""))})(n)||Hz.test(n)&&Vz.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&&!Kz.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 fS(r,{allowNestedUrls:!0,stripPunctuation:!0})})((function(r){let s=r.replace(Qz," ");return s=s.replace(Jz,us),s=s.replace(eV,us),s=s.replace(tV,`$1${us}`),s=s.replace(rV,uV),s=s.replace(nV,us),s=s.replace(sV,`$1${us}`),s=s.replace(iV,`$1${us}`),s})(Jg(n))),e)}function cV(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 uV(t){const e=[];for(let i=bP.exec(t);i!==null;i=bP.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&&cV(i)&&(o=l);0>o?s++:(n+=t.slice(r,e[s].start)+us,r=e[o].end,s=o+1)}return n+t.slice(r)}const dV={}.propertyIsEnumerable;function ev(t,e){try{return BO(t,e,{ancestors:new WeakSet,remainingNodes:1e4},0)}catch{return[]}}function hS(t,e,n,r){if(0>=n.remainingNodes)return{stringValue:Mb};if(n.remainingNodes--,Es(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:Od(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:Mb};if(t instanceof Date){const s=t.getTime(),i=Number.isFinite(s)?t.toISOString():String(t);return{stringValue:typeof i=="string"?Od(i):String(i)}}n.ancestors.add(t);try{try{const s=t.toJSON;if(typeof s=="function")return hS(s.call(t),e,n,r+1)}catch{}return He(t)?{arrayValue:{values:fV(t,e,n,r+1)}}:{kvlistValue:{values:BO(t,e,n,r+1)}}}finally{n.ancestors.delete(t)}}return{stringValue:Od(String(t))}}function fV(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(ot(l))continue;s.push(hS(l,e,n,r))}catch{s.push({stringValue:fm})}return t.length>o&&s.push({stringValue:Mb}),s}function BO(t,e,n,r){const s=[];for(const i in t)if(dV.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(Tn(o)||le(o))continue;s.push({key:Od(i),value:hS(o,e,n,r)})}catch{s.push({key:Od(i),value:{stringValue:fm}})}}return s}function WO(t,e,n){return F(F(F(F({},RO({},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 hV=["service.name","deployment.environment","service.version","telemetry.sdk.name","telemetry.sdk.version"];function KO(t,e){const n=RO({},t),r={};for(const s of hV)({}).hasOwnProperty.call(n,s)&&(r[s]=n[s],delete n[s]);return[...ev(n,e),...ev(r,e)]}const SP={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"},GO={text:"INFO",number:9},pV={trace:{text:"TRACE",number:1},debug:{text:"DEBUG",number:5},info:GO,warn:{text:"WARN",number:13},error:{text:"ERROR",number:17},fatal:{text:"FATAL",number:21}};function mV(t){try{return Od(String(t))}catch{return fm}}function gV(t,e,n,r){const s=t.level||"info",{text:i,number:o}=pV[s]||GO,l=(function(m=Date.now()){return String(m)+"000000"})(Bn(r)?r:void 0),u={};e.distinctId&&(u.posthogDistinctId=e.distinctId),e.sessionId&&(u.sessionId=e.sessionId),e.windowId&&(u["window.id"]=e.windowId),ot(e.sessionStartTimestamp)||(u.sessionStartTimestamp=String(e.sessionStartTimestamp)),ot(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=F({},u),f=t.attributes;if(f){let m=[];try{m=Object.keys(f)}catch{m=[]}for(const g of m){let _;try{_=f[g]}catch{_=fm}Object.defineProperty(d,g,{value:_,enumerable:!0,writable:!0,configurable:!0})}}const h={timeUnixNano:l,observedTimeUnixNano:l,severityNumber:o,severityText:i,body:{stringValue:mV(t.body)},attributes:ev(d,n)};return t.trace_id&&(h.traceId=t.trace_id),t.span_id&&(h.spanId=t.span_id),le(t.trace_flags)||(h.flags=t.trace_flags),h}function qO(t,e,n){return WO(t,e,n)}function YO(t,e,n,r){return{resourceLogs:[{resource:{attributes:KO(e)},scopeLogs:[{scope:{name:n,version:r},logRecords:t}]}]}}var XO=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=OO(()=>{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 QO(){return .75+.5*Math.random()}function JO(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 vV=class{constructor(t,e,n,r,s,i=()=>Promise.resolve(),o){var l;this._instance=t,this.Fr=e,this.R=n,this.hs=r,this.ds=s,this.vs=i,this.fs=o,this.ps=new XO(()=>this.gs()),this.ys=null,this.bs=0,this._s=0,this.ws=new AO,this.ks=0,this.Ss=1,this.xs=0,this.$s=0,this.Cs=!1,this.Ts=e.maxBufferSize,this.Is=Math.max((l=e.maxQueueSize)!==null&&l!==void 0?l:e.maxBufferSize,e.maxBufferSize),this.Ms=e.flushIntervalMs,this.Es=e.maxBatchRecordsPerPost,this.As=e.rateCapWindowMs,this.Rs=e.maxLogsPerInterval}clearQueue(){this._s++,this._instance.setPersistedProperty(Lo.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.Fr.maxBatchRecordsPerPost}onReconnect(){this.ks=0,this.Ss=1,this.ws.isOpen()?this.Ps()&&this.Os():this.gs()}captureLog(t,e){var n;if(this._instance.isDisabled||this._instance.optedOut||!(t!=null&&t.body))return;const r=this.Fs(t);if(r===null)return;if(!r.body)return void this.R.info("Log was rejected in beforeSend function");if(!this.Ds())return;const s={record:gV(r,(n=e==null?void 0:e.context)!==null&&n!==void 0?n:this.hs(),this.R,e==null?void 0:e.occurredAtMs)};this.ds(()=>this.Ls(s))}Fs(t){const e=this.Fr.beforeSend;if(!e)return t;const n=He(e)?e:[e];let r=t;for(const s of n)try{const i=s(r);if(!i)return this.R.info("Log was rejected in beforeSend function"),null;r=i}catch(i){return this.R.error("Error in beforeSend function for log:",i),null}return r}Ds(){if(this.Rs===void 0)return!0;const t=Date.now(),e=t-this.xs;return this.As>e&&e>=0||(this.xs=t,this.$s=0,this.Cs=!1),this.Rs>this.$s?(this.$s++,!0):(this.Cs||(this.R.warn(`captureLog dropping logs: exceeded ${this.Rs} logs per ${this.As}ms`),this.Cs=!0),!1)}flush(){var t=this;return un(function*(){if(!t._instance.isDisabled)return t.ys||(t.ys=t.Ns().finally(()=>{t.ys=null})),t.ys})()}Ns(){var t=this;return un(function*(){var e;t.ps.clear();let n=(e=t._instance.getPersistedProperty(Lo.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=YO(d.map(m=>m.record),t.js(),(i=t.fs)!==null&&i!==void 0?i:t._instance.getLibraryId(),t._instance.getLibraryVersion()),h=yield t._instance.qs(f);if(t._s!==l)return;if(h.kind==="too-large"&&d.length>1)t.Es=Math.max(1,Math.floor(d.length/2)),t.R.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.R.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.Fr.maxBatchRecordsPerPost>t.Es&&(t.Es=Math.min(t.Fr.maxBatchRecordsPerPost,t.Es+1)),yield t.Bs(d.length),n=(o=t._instance.getPersistedProperty(Lo.LogsQueue))!==null&&o!==void 0?o:[],s+=d.length,h.kind==="fatal"))throw h.error}})()}Bs(t){var e=this;return un(function*(){var n;const r=Math.max(0,t-e.bs),s=(n=e._instance.getPersistedProperty(Lo.LogsQueue))!==null&&n!==void 0?n:[];e._instance.setPersistedProperty(Lo.LogsQueue,s.slice(r)),yield e.vs()})()}js(){return qO(this.Fr,this._instance.getLibraryId(),this._instance.getLibraryVersion())}Ls(t){var e;if(this._instance.optedOut)return;const n=(e=this._instance.getPersistedProperty(Lo.LogsQueue))!==null&&e!==void 0?e:[];this.Is>n.length||(n.shift(),this.bs++,this.R.info("Logs queue is full, dropping oldest record.")),n.push(t),this._instance.setPersistedProperty(Lo.LogsQueue,n),this.Ts>n.length||this.ws.isOpen()?this.Os():this.gs()}Os(){this.ps.pending||this.ps.arm(Math.max(this.Ms,this.ws.remainingMs()))}zs(){return Math.max(JO(this.Ms,this.ks,this.Ss,3e4),this.ws.remainingMs())}Ps(){const t=this._instance.getPersistedProperty(Lo.LogsQueue);return!!t&&t.length>0}shutdown(t){var e=this;return un(function*(){e.ps.clear();const n=e.flush().catch(()=>{});t!==void 0?yield uP(n,t):yield n})()}flushWithTimeout(t){var e=this;return un(function*(){const n=e.flush();yield uP(n,t,()=>{n.catch(()=>{})})})()}gs(){this.flush().then(()=>{this.ks=0,this.Ss=1},t=>{this.ks++,this.Ss=QO(),this.R.error("PostHog logs flush failed:",t)}).finally(()=>{!this._instance.isDisabled&&this.Ps()&&this.ps.armNoEarlierThan(this.zs())})}};const yV=/^[0-9a-f]+$/;function kP(t,e,n){return typeof t=="string"&&t.length===e&&t!==n&&yV.test(t)}const _V=/^([0-9a-f]{2})-([0-9a-f]{32})-([0-9a-f]{16})-([0-9a-f]{2})(-.*)?$/,wV="00",T0=[0,5,10,25,50,75,100,250,500,750,1e3,2500,5e3,7500,1e4];function Fb(t){return String(t)+"000000"}function L_(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 bV=class{constructor(t,e,n){this._instance=t,this.Fr=e,this.R=n,this.Hs=new Map,this.ps=new XO(()=>this.flush().catch(r=>{this.R.error("Metrics flush failed:",r)})),this.ys=null,this.Us=!1,this.Ws=new Map,this.Vs=new Set,this.Gs=new Map,this.Qs=new Set,this.Js=!1,this.ws=new AO,this.ks=0,this.Ss=1,this.Zs=0}count(t,e=1,n){this.Ks({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.Ks({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.Ks({name:t,type:"histogram",value:e,unit:n==null?void 0:n.unit,attributes:n==null?void 0:n.attributes,bounds:He(n==null?void 0:n.bounds)?n.bounds.slice():n==null?void 0:n.bounds})}flush(){var t=this;const e=this.ys,n=(function(){var r=un(function*(){e&&(yield e.catch(()=>{})),yield t.Ys()});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.Xs(),this._o(t)}reset(){this.Zs++,this.ws.reset(),this.ks=0,this.Ss=1,this.ps.clear(),this.ys=null,this.Xs(),this.Gs=new Map,this.Js=!1}Xs(){this.Hs=new Map,this.Us=!1,this.Ws=new Map,this.Vs=new Set,this.Qs=new Set}Ks(t){if(this._instance.isDisabled||this._instance.optedOut)return;const e=this.Fs(t);if(e===null)return;if(!e.name||typeof e.name!="string")return void this.R.warn("Dropping metric with empty name");if(typeof e.value!="number"||!Number.isFinite(e.value))return void this.R.warn(`Dropping metric '${e.name}': value must be a finite number`);if(e.type!=="count"&&e.type!=="gauge"&&e.type!=="histogram")return void this.R.warn(`Dropping metric '${e.name}': unknown type '${String(e.type)}'`);if(e.type==="count"&&0>e.value)return void this.R.warn(`Dropping count '${e.name}': counters are monotonic, value must be >= 0`);let n,r;try{n=e.attributes?F({},e.attributes):void 0,r=L_(e.type,e.name,e.unit,n)}catch(u){return void this.R.warn(`Dropping metric '${e.name}': attributes could not be serialized`,u)}let s,i=this.Hs.get(r);if(!i&&!this.ko()||e.type==="histogram"&&(s=this.So(e.name,e.unit,e.bounds),!s))return;i||(i={name:e.name,type:e.type,unit:e.unit,attributes:n,windowStartMs:Date.now(),hist:s&&xV(s)},this.Hs.set(r,i));const o=this.Ws.get(e.name);o===void 0?this.Ws.set(e.name,e.type):o===e.type||this.Vs.has(e.name)||(this.Vs.add(e.name),this.R.warn(`Metric name '${e.name}' is already used as a ${o}; recording it as a ${e.type} too will blend both series in charts. Use a distinct name.`)),this.xo(i,e.value);const l=this.$o();l&&(i.exemplar=F(F({},l),{},{value:e.value,timeMs:Date.now()})),this.Os()}$o(){try{var t,e;const n=(function(r){const s=(function(o){if(typeof o!="string")return;const l=_V.exec(o.trim());if(!l)return;const[,u,d,f,h,m]=l;return u==="ff"||u==="00"&&m||!(function(g){return kP(g,32,"00000000000000000000000000000000")})(d)||!(function(g){return kP(g,16,"0000000000000000")})(f)?void 0:{version:u,traceId:d,spanId:f,flags:h}})(r);return s&&{traceId:s.traceId,spanId:s.spanId,flags:(i=s.flags,1&parseInt(i,16)?"01":wV)};var i})((t=(e=this._instance).getActiveSpan)===null||t===void 0||(t=t.call(e))===null||t===void 0?void 0:t.traceparent());if(n&&n.flags==="01")return{traceId:n.traceId,spanId:n.spanId}}catch{}}ko(){return this.Fr.maxSeriesPerFlush>this.Hs.size||(this.Us||(this.Us=!0,this.R.warn(`Metric series cap reached (${this.Fr.maxSeriesPerFlush} per flush window); dropping new series until the next flush. Reduce attribute cardinality.`)),!1)}So(t,e,n){if(n!==void 0&&!(function(o){if(!He(o)||o.length===0)return!1;for(let l=0;o.length>l;l++)if(!Number.isFinite(o[l])||l>0&&o[l-1]>=o[l])return!1;return!0})(n))return void this.R.warn(`Dropping histogram '${t}': bounds must be a non-empty array of finite, strictly increasing numbers`);const r=L_("histogram",t,e,void 0),s=this.Gs.get(r);if(s)return this.Co(t,r,s,n),s;if(this.Gs.size>=this.Fr.maxSeriesPerFlush)return this.Js||(this.Js=!0,this.R.warn(`Histogram bounds limit reached (${this.Fr.maxSeriesPerFlush} distinct histograms); new histograms that pass custom bounds are dropped. Reduce histogram name cardinality.`)),n&&!EP(n,T0)?void 0:T0;const i=n?n.slice():T0;return this.Gs.set(r,i),i}Co(t,e,n,r){EP(n,r??T0)||this.Qs.has(e)||(this.Qs.add(e),this.R.warn(`Histogram '${t}' already uses the bounds [${n.join(", ")}]; samples that pass different bounds are recorded in those buckets.`))}xo(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":{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,r.bounds)]+=1;break}}}Fs(t){const e=this.Fr.beforeSend;if(!e)return t;const n=He(e)?e:[e];let r=t;for(const s of n)try{const i=s(r);if(!i)return this.R.info("Metric was rejected in beforeSend function"),null;r=i}catch(i){return this.R.error("Error in beforeSend function for metric:",i),null}return r}Os(){this.ps.pending||this.ps.arm(this.zs())}zs(){return Math.max(JO(this.Fr.flushIntervalMs,this.ks,this.Ss,3e4),this.ws.remainingMs())}Ys(){var t=this;return un(function*(){if(t.ps.clear(),t.Hs.size===0)return;const e=t.Hs;t.Xs();const n=t.Zs,r=yield t._instance.To(t._o(e));if(n===t.Zs)switch(t.ws.record(r),r.kind==="retry-later"?(t.ks++,t.Ss=QO()):(t.ks=0,t.Ss=1),t.ps.pending&&t.ps.arm(t.zs()),r.kind){case"ok":return;case"retry-later":return t.Io(e),void t.ps.armNoEarlierThan(t.zs());case"too-large":return void t.R.warn("Metrics batch exceeded the server size limit and was dropped");case"fatal":return void t.R.error("Failed to send metrics batch:",r.error)}})()}_o(t){return e=this.Mo(t),n=(function(i,o,l){return WO(i,o,l)})(this.Fr,this._instance.getLibraryId(),this._instance.getLibraryVersion()),r=this._instance.getLibraryId(),s=this._instance.getLibraryVersion(),{resourceMetrics:[{resource:{attributes:KO(n)},scopeMetrics:[{scope:{name:r,version:s},metrics:e}]}]};var e,n,r,s}Mo(t){const e=Fb(Date.now()),n=new Map;for(const o of t.values()){var r;const l=L_(o.type,o.name,o.unit,void 0);let u=n.get(l);u||(u=F({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=ev((r=o.attributes)!==null&&r!==void 0?r:{},this.R),f=Fb(o.windowStartMs),h=SV(o.exemplar);if(o.type==="count"){var s;const m=F({attributes:d,startTimeUnixNano:f,timeUnixNano:e,asDouble:(s=o.total)!==null&&s!==void 0?s:0},h);u.sum.dataPoints.push(m)}else if(o.type==="gauge"){var i;const m=F({attributes:d,timeUnixNano:e,asDouble:(i=o.last)!==null&&i!==void 0?i:0},h);u.gauge.dataPoints.push(m)}else{const m=o.hist,g=F({attributes:d,startTimeUnixNano:f,timeUnixNano:e,count:m.count,sum:m.sum,min:m.min,max:m.max,bucketCounts:m.bucketCounts,explicitBounds:m.bounds},h);u.histogram.dataPoints.push(g)}}return Array.from(n.values())}Io(t){for(const[s,i]of t){var e;const o=this.Hs.get(s);if(o)switch(o.windowStartMs=Math.min(o.windowStartMs,i.windowStartMs),o.exemplar=(e=o.exemplar)!==null&&e!==void 0?e:i.exemplar,o.type){case"count":var n,r;o.total=((n=o.total)!==null&&n!==void 0?n:0)+((r=i.total)!==null&&r!==void 0?r:0);break;case"gauge":break;case"histogram":{const l=o.hist,u=i.hist;l.count+=u.count,l.sum+=u.sum,l.min=Math.min(l.min,u.min),l.max=Math.max(l.max,u.max);for(let d=0;l.bucketCounts.length>d;d++)l.bucketCounts[d]+=u.bucketCounts[d];break}}else this.ko()&&this.Hs.set(s,i)}}};function EP(t,e){if(t===e)return!0;if(t.length!==e.length)return!1;for(let n=0;t.length>n;n++)if(t[n]!==e[n])return!1;return!0}function xV(t){return{bounds:t,count:0,sum:0,min:1/0,max:-1/0,bucketCounts:new Array(t.length+1).fill(0)}}function SV(t){return t?{exemplars:[{filteredAttributes:[],timeUnixNano:Fb(t.timeMs),asDouble:t.value,traceId:t.traceId,spanId:t.spanId}]}:{}}const eM=(t,{debugEnabled:e}={})=>{const n={N(r,...s){let i;try{i=typeof window>"u"?void 0:window}catch{return}i&&(Ia.DEBUG||i.POSTHOG_DEBUG||e)&&!le(i.console)&&i.console&&("__rrweb_original__"in i.console[r]?i.console[r].__rrweb_original__:i.console[r])(t,...s)},debug(...r){n.N("debug",...r)},info(...r){n.N("log",...r)},warn(...r){n.N("warn",...r)},error(...r){n.N("error",...r)},critical(...r){console.error(t,...r)},uninitializedWarning(r){n.error(`You must initialize PostHog before calling ${r}`)},createLogger:(r,s)=>eM(`${t} ${r}`,s)};return n},ge=eM("[PostHog.js]"),En=(t,e)=>ge.createLogger(t,e),kV=En("[ExternalScriptsLoader]"),tv=t=>{const e=Oe==null?void 0:Oe.querySelectorAll("script");if(e){for(let n=0;e.length>n;n++)if(e[n].src===t||e[n].getAttribute("src")===t)return e[n]}},td=(t,e,n)=>{if(t.config.disable_external_dependency_loading)return kV.warn(`${e} was requested but loading of external scripts is disabled.`),n("Loading of external scripts is disabled");const r=()=>{if(Oe==null||Oe.removeEventListener("DOMContentLoaded",r),t.config.disable_external_dependency_loading)return n("Loading of external scripts is disabled");if(!Oe)return n("document not found");let i=Oe.createElement("script");if(i.type="text/javascript",i.crossOrigin="anonymous",i.src=e,i.onload=u=>{i.__posthog_loading_callback_fired=!0,n(void 0,u)},i.onerror=u=>{i.__posthog_loading_error=u,n(u)},t.config.prepare_external_dependency_script&&(i=t.config.prepare_external_dependency_script(i)),!i)return n("prepare_external_dependency_script returned null");if(t.config.disable_external_dependency_loading)return n("Loading of external scripts is disabled");const o=tv(i.src);if(o){if(o.integrity!==i.integrity||o.crossOrigin!==i.crossOrigin||o.nonce!==i.nonce)return n("Existing script conflicts with prepared script policy");if(o.__posthog_loading_callback_fired)return n();const u=o.__posthog_loading_error;return u?n(u):(o.addEventListener("load",d=>{o.__posthog_loading_callback_fired=!0,n(void 0,d)}),void o.addEventListener("error",d=>{o.__posthog_loading_error=d,n(d)}))}if(!Oe.body)return s();if(t.config.external_scripts_inject_target==="head")Oe.head.appendChild(i);else{const u=Oe.querySelectorAll("body > script");var l;u.length>0?(l=u[0].parentNode)===null||l===void 0||l.insertBefore(i,u[0]):Oe.body.appendChild(i)}},s=()=>{Oe==null||Oe.addEventListener("DOMContentLoaded",r)};Oe!=null&&Oe.body||tv(e)?r():s()},N_={},CP=(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)};et.__PosthogExtensions__=et.__PosthogExtensions__||{},et.__PosthogExtensions__.loadExternalDependency=(t,e,n)=>{if(e==="remote-config"){const s=t.requestRouter.endpointFor("assets",`/array/${t.config.token}/config.js`);return void td(t,s,n)}const r=t.config.strict_script_versioning;if(r){const s=t.requestRouter.endpointFor("assets",`/static/${t.version}/${e}.js`),i=N_[s];if(r==="fallback"&&i){if(tv(i))return void td(t,i,n);delete N_[s]}return void td(t,s,r==="fallback"?(o,l)=>{if(o)if(typeof o=="string")n(o);else{var u;const d=CP(t,e);N_[s]=d;const f=tv(s);f==null||(u=f.parentNode)===null||u===void 0||u.removeChild(f),td(t,d,n)}else n(void 0,l)}:n)}td(t,CP(t,e),n)},et.__PosthogExtensions__.loadSiteApp=(t,e,n)=>{const r=t.requestRouter.endpointFor("api",e);td(t,r,n)},Ia.DEBUG=!1,Ia.LIB_VERSION="1.447.3",Ia.LIB_NAME="web";var js=Ia;const jb="$early_access_features",Ta="$active_feature_flags",ru="$feature_flag_details",xp="$feature_flag_errors",zl="$feature_flag_evaluated_at",su="$feature_flag_request_id",Jh="$minimal_flag_called_events",uo="$enabled_feature_flags",Il="$stored_group_properties",Ol="$stored_person_properties",zo="$flag_call_reported",$h="$flag_call_reported_session_id",Ml="$feature_flag_payloads",Mo="$override_feature_flags",zc="$override_feature_flag_payloads",Md="visibilitychange",tM="$autocapture_disabled_server_side",Fh="$surveys",nv="$surveys_loaded_at",zb="PostHog loadExternalDependency extension not found.",Vb="$surveys_activated",vg="$surveys_activated_session",yg="$surveys_activated_timestamps",EV="$people_distinct_id",Di="distinct_id",pS="$device_id",D_="$device_model",rv="__alias",CV="__cmpns",PP="$fbc",Ld="$fbc_persistence",TP="$fbp",ep="$fbp_persistence",Hb="__timers",Ub="$heatmaps_enabled_server_side",Zb="$exception_capture_enabled_server_side",nM="$error_tracking_suppression_rules",Bb="$error_tracking_capture_extension_exceptions",Wb="$web_vitals_enabled_server_side",mS="$dead_clicks_enabled_server_side",gS="$product_tours_enabled_server_side",rM="$logs_capture_enabled_server_side",sM="$web_vitals_allowed_metrics",tp="$session_recording_remote_config",PV="$session_recording_enabled_server_side",TV="$replay_sample_rate",RV="$replay_override_sampling",AV="$replay_override_linked_flag",IV="$replay_override_url_trigger",OV="$replay_override_event_trigger",bd="$sesid",iM="$session_is_sampled",MV="$session_past_minimum_duration",LV="$session_recording_url_trigger_activated_session",NV="$session_recording_event_trigger_activated_session",DV="$debug_first_full_snapshot_timestamp",$V="$sess_rec_flush_size",oM="$groups",Kb="ph_product_tours",FV="$product_tours_activated",jV="$product_tours_activated_session",zV="$conversations_widget_session_id",VV="$conversations_ticket_id",HV="$conversations_widget_state",UV="$conversations_user_traits",cs="$user_state",Gb="$client_session_props",aM="$capture_rate_limit",lM="$initial_campaign_params",cM="$initial_referrer_info",xd="$initial_person_info",vS="$epp",$_="$posthog_cookieless",uM="$cookieless_mode",dM="$sdk_debug_extensions_init_method",fM="$sdk_debug_extensions_init_time_ms",yS="$sdk_debug_recording_script_not_loaded",_S="$sdk_debug_replay_stale_config",hM="$sdk_debug_replay_event_trigger_status",pM="$sdk_debug_replay_linked_flag_trigger_status",mM="$sdk_debug_replay_matched_recording_trigger_groups",gM="$sdk_debug_replay_pending_trigger_conditions",vM="$sdk_debug_replay_remote_trigger_matching_config",yM="$sdk_debug_replay_trigger_groups_count",_M="$sdk_debug_replay_url_trigger_status",ZV="$session_recording_start_reason",Ra="anonymous",_g="identified",wM="identified_only",sv="beforeunload",wS="$pageview",RP="$pageleave",bM="$identify",AP="$groupidentify";function Sd(t,e){He(t)&&t.forEach(e)}function Zt(t,e){if(!ot(t))if(He(t))t.forEach(e);else if((n=>n instanceof FormData)(t))t.forEach((n,r)=>e(n,r));else for(const n in t)lS.call(t,n)&&e(t[n],n)}const mn=function(t,...e){for(const n of e)for(const r in n)n[r]!==void 0&&(t[r]=n[r]);return t};function wg(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 BV=function(t){return function(...e){try{return t.apply(this,e)}catch(n){ge.critical("Implementation error. Please turn on debug mode and open a ticket on https://app.posthog.com/home#panel=support%3Asupport%3A."),ge.critical(n)}}},bS=function(t){const e={};return Zt(t,function(n,r){(dt(n)&&n.length>0||Bn(n))&&(e[r]=n)}),e};function xM(t){const e=F({},t);for(const n of["name","message","stack","cause","errors"])try{n in t&&(e[n]=t[n])}catch{}return e}const WV=["herokuapp.com","vercel.app","netlify.app"];function KV(t){const e=t==null?void 0:t.hostname;if(!dt(e))return!1;const n=e.split(".").slice(-2).join(".");for(const r of WV)if(n===r)return!1;return!0}function Lt(t,e,n,r){const{capture:s=!1,passive:i=!0}=r??{};t==null||t.addEventListener(e,n,{capture:s,passive:i})}function F_(t){return t.name==="ph_toolbar_internal"}const np=t=>{if(Oe){try{const e=t+"=",n=Oe.cookie.split(";").filter(r=>r.length);for(let r=0;n.length>r;r++){let s=n[r];for(;s.charAt(0)==" ";)s=s.substring(1,s.length);if(s.indexOf(e)===0)return decodeURIComponent(s.substring(e.length,s.length))}}catch{}return null}};var GV=class qb{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 qb(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 qb(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}},qV=class{generate(){const t=this.generateOrAbort();if(!le(t))return t;{this.Tt=0;const e=this.generateOrAbort();if(le(e))throw new Error("Could not generate UUID after timestamp reset");return e}}generateOrAbort(){const t=(()=>{const e=Date.now();return Bn(e)&&isFinite(e)?Math.min(Math.max(Math.floor(e),0),0xffffffffffff):0})();if(t>this.Tt)this.Tt=t,this.It();else{if(this.Tt>=t+1e4)return;this.Mt++,this.Mt>4398046511103&&(this.Tt++,this.It())}return GV.fromFieldsV7(this.Tt,Math.trunc(this.Mt/Math.pow(2,30)),this.Mt&Math.pow(2,30)-1,this.At.nextUint32())}It(){this.Mt=1024*this.At.nextUint32()+(1023&this.At.nextUint32())}constructor(){this.Tt=0,this.Mt=0,this.At=new YV}};const IP=t=>{if("u">typeof UUIDV7_DENY_WEAK_RNG&&UUIDV7_DENY_WEAK_RNG)throw new Error("no cryptographically strong RNG available");for(let e=0;t.length>e;e++)t[e]=65536*Math.trunc(65536*Math.random())+Math.trunc(65536*Math.random());return t};let OP;var YV=class{nextUint32(){var t;return this.Rt.length>this.Et||(((t=OP)!==null&&t!==void 0?t:OP="u">typeof window&&!le(window.crypto)&&crypto.getRandomValues?e=>{try{return crypto.getRandomValues(e)}catch{return IP(e)}}:IP)(this.Rt),this.Et=0),this.Rt[this.Et++]}constructor(){this.Rt=new Uint32Array(8),this.Et=1/0}};let MP;const fo=()=>XV().toString(),XV=()=>(MP||(MP=new qV)).generate();let bh="";const QV=/[a-z0-9][a-z0-9-]+\.[a-z]{2,}$/i;let nd=null;const yn={Ot(){if(!Tn(nd))return nd;if(nd=!1,Oe)try{const t=`__ph_cookie_support_${fo()}`;yn.$t(t,"xyz"),nd=np(t)==='"xyz"',yn.Dt(t)}catch{nd=!1}return nd},Pt(t){ge.error("cookieStore error: "+t)},Lt:np,Ft(t){let e;try{e=JSON.parse(yn.Lt(t))||{}}catch{}return e},$t(t,e,n,r,s){if(!Oe)return!1;try{let i="",o="";const l=(function(d,f){if(f){let h=(function(m,g=Oe){if(bh)return bh;if(!g||["localhost","127.0.0.1"].includes(m))return"";const _=m.split(".");let y=Math.min(_.length,8);const b="dmn_chk_"+fo();for(;!bh&&y--;){const x=_.slice(y).join("."),S=b+"=1;domain=."+x+";path=/";g.cookie=S+";max-age=3",g.cookie.includes(b)&&(g.cookie=S+";max-age=0",bh=x)}return bh})(d);if(!h){const m=(g=>{const _=g.match(QV);return _?_[0]:""})(d);m!==h&&ge.info("Warning: cookie subdomain discovery mismatch",m,h),h=m}return h?"; domain=."+h:""}return""})(Oe.location.hostname,r);if(n){const d=new Date;d.setTime(d.getTime()+864e5*n),i="; expires="+d.toUTCString()}s&&(o="; secure");const u=t+"="+encodeURIComponent(JSON.stringify(e))+i+"; SameSite=Lax; path=/"+l+o;return u.length>3686.4&&ge.warn("cookieStore warning: large cookie, len="+u.length),Oe.cookie=u,!0}catch{return!1}},Dt(t,e){if(Oe!=null&&Oe.cookie&&(!e||!Tn(np(t))))try{yn.$t(t,"",-1,e)}catch{return}}};let j_=null;const At={Ot(){if(!Tn(j_))return j_;let t=!0;if(le(ae))t=!1;else try{const e="__mplssupport__";At.$t(e,"xyz"),At.Lt(e)!=='"xyz"'&&(t=!1),At.Dt(e)}catch{t=!1}return t||ge.error("localStorage unsupported; falling back to cookie store"),j_=t,t},Pt(t){ge.error("localStorage error: "+t)},Lt(t){try{return ae==null?void 0:ae.localStorage.getItem(t)}catch(e){At.Pt(e)}return null},Ft(t){try{return JSON.parse(At.Lt(t))||{}}catch{}return null},$t(t,e){try{return ae==null||ae.localStorage.setItem(t,JSON.stringify(e)),!0}catch(n){At.Pt(n)}return!1},Dt(t){try{ae==null||ae.localStorage.removeItem(t)}catch(e){At.Pt(e)}}},z_=[Ol,Ta,uo,ru,Ml,su,zl,xp,zo],Vc=[pS,Di,bd,iM,vS,xd,Ld,cs],rp=t=>t+"_cpm",JV=["__proto__","constructor","prototype"],V_=t=>{if(!ct(t))return{};const e={};return Object.keys(t).forEach(n=>{JV.indexOf(n)===-1&&(e[n]=t[n])}),e},H_=(t,e=[])=>{const n={};return[...Vc,...e].forEach(r=>{const s=t[r];le(s)||Tn(s)||s===""||(n[r]=s)}),n},SM=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)},LP=(t,e)=>({p:e,f:SM(JSON.stringify(t))}),NP=(t,e)=>{if(!e)return{properties:[],isValid:!1};try{const n=yn.Ft(rp(t)),r=(n==null?void 0:n.f)===SM(e)&&He(n.p);return{properties:r?n.p:[],isValid:r}}catch{return{properties:[],isValid:!1}}},U_=(t,e)=>e+"|"+(yn.Lt(rp(t))||""),rd={},Yb={Ot:()=>!0,Pt(t){ge.error("memoryStorage error: "+t)},Lt:t=>t in rd?rd[t]:null,Ft:t=>t in rd?rd[t]:null,$t:(t,e)=>(rd[t]=e,!0),Dt(t){delete rd[t]}};let Pc=null;const cn={Ot(){if(!Tn(Pc))return Pc;if(Pc=!0,le(ae))Pc=!1;else try{const t="__support__";cn.$t(t,"xyz"),cn.Lt(t)!=='"xyz"'&&(Pc=!1),cn.Dt(t)}catch{Pc=!1}return Pc},Pt(t){ge.error("sessionStorage error: ",t)},Lt(t){try{return ae==null?void 0:ae.sessionStorage.getItem(t)}catch(e){cn.Pt(e)}return null},Ft(t){try{return JSON.parse(cn.Lt(t))||null}catch{}return null},$t(t,e){try{return ae==null||ae.sessionStorage.setItem(t,JSON.stringify(e)),!0}catch(n){cn.Pt(n)}return!1},Dt(t){try{ae==null||ae.sessionStorage.removeItem(t)}catch(e){cn.Pt(e)}}};var eH=class{constructor(t){this._instance=t}get Fr(){return this._instance.config}get consent(){return this.Fl()?0:this.Dl}isOptedOut(){return this.Fr.cookieless_mode==="always"||this.isRejected()||this.consent===-1&&this.Fr.cookieless_mode==="on_reject"}isOptedIn(){return!this.isOptedOut()}isExplicitlyOptedOut(){return this.consent===0}isRejected(){return this.consent===0||this.consent===-1&&this.Fr.opt_out_capturing_by_default}optInOut(t){this.Ll.$t(this.Nl,t?1:0,this.Fr.cookie_expiration,this.Fr.cross_subdomain_cookie,this.Fr.secure_cookie)}reset(){this.Ll.Dt(this.Nl,this.Fr.cross_subdomain_cookie)}get Nl(){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 Dl(){const t=this.Ll.Lt(this.Nl);return E_(t)?1:We(X7,t)?0:-1}get Ll(){const t=this.Fr.opt_out_capturing_persistence_type,e=t==="localStorage"?At:yn,n=e.Ot()?e:Yb;if(!this.jl||this.jl!==n){this.jl=n;const r=t==="localStorage"?yn:At;r.Lt(this.Nl)&&(this.jl.Lt(this.Nl)||this.optInOut(E_(r.Lt(this.Nl))),r.Dt(this.Nl,this.Fr.cross_subdomain_cookie))}return this.jl}Fl(){return!!this.Fr.respect_dnt&&[Wr==null?void 0:Wr.doNotTrack,Wr==null?void 0:Wr.msDoNotTrack,et.doNotTrack,Wr==null?void 0:Wr.globalPrivacyControl].some(t=>E_(t))}};function kM(t,e){var n;const r=t==null||(n=t.config)===null||n===void 0?void 0:n.get_current_url;if(!Nn(r))return e;try{const s=r(e);return dt(s)&&s?s:e}catch(s){return ge.error("Error in get_current_url, falling back to window.location.href",s),e}}function DP(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 Ui(t){return!!t&&t.nodeType===1}function or(t,e){return!!t&&!!t.tagName&&t.tagName.toLowerCase()===e.toLowerCase()}function EM(t){return!!t&&t.nodeType===3}function iv(t){return!!t&&t.nodeType===11&&Ui(t.host)}function xS(t){return t?rf(t).split(/\s+/):[]}function $P(t,e){const n=(function(r){var s;const i=typeof window>"u"?void 0:window,o=i==null||(s=i.location)===null||s===void 0?void 0:s.href;return le(o)?void 0:kM(r,o)})(e);return!!(n&&t&&t.some(r=>n.match(r)))}function iu(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 xS(e)}function CM(t){return ot(t)?null:rf(t).split(/(\s+)/).filter(e=>Nd(e)).join("").replace(/[\r\n]/g," ").replace(/[ ]+/g," ").substring(0,255)}function Sp(t){let e="";return Vl(t)&&!sf(t)&&t.childNodes&&t.childNodes.length&&Zt(t.childNodes,function(n){var r;EM(n)&&n.textContent&&(e+=(r=CM(n.textContent))!==null&&r!==void 0?r:"")}),rf(e)}function sp(t){var e;return le(t.target)?t.srcElement||null:!((e=t.target)===null||e===void 0)&&e.shadowRoot?t.composedPath()[0]||null:t.target||null}const SS=["a","button","form","input","select","textarea","label"];function jh(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 Xb(t,e){if(le(e))return!0;for(const n of t)if(e.some(r=>jh(n,r)))return!0;return!1}function PM(t){const e=t.parentNode;return!(!e||!Ui(e))&&e}const R0=[".ph-no-autocapture","[data-ph-no-autocapture]"],TM=["next","previous","prev",">","<","→","←","›","‹","»","«","▶","◀","❯","❮"],kS=[...TM,"+","-","−","–"],FP=kS.length+10,tH=["button","a","input","select","textarea","label"],nH=["button","link","tab","menuitem","option"],jP=(t,e)=>/[a-z0-9]/i.test(e)?We(kS,e)?new RegExp(`\\b${e}\\b`).test(t):t.includes(e):t===e,rH=t=>We(tH,t.tagName.toLowerCase())||We(nH,(t.getAttribute("role")||"").toLowerCase());function Z_(t){let e="",n="";const r=o=>{Ui(o)&&Vl(o)&&!sf(o)&&(e+=` ${Sp(o)}`,n=n||o.getAttribute("aria-label")||"",Zt(o.childNodes,r))};r(t),e=rf(e.replace(/\s+/g," "));const s=(Nd(e)?e:"").toLowerCase(),i=t.getAttribute("aria-label")||(s?"":n);return{safeText:s,ariaLabel:rf(i).toLowerCase()}}const zP=[".ph-no-rageclick",".ph-no-capture"],sH=["","text","search","email","password","url","tel","number"];function RM(t,e){if(!(!(typeof window>"u")&&window)||ES(t))return!1;let n,r,s;var i,o;if(Es(e)?(n=!!e&&zP,r=void 0,s=!1):(n=(i=e==null?void 0:e.css_selector_ignorelist)!==null&&i!==void 0?i:zP,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||!Ui(u))&&(!!or(u,"textarea")||(or(u,"input")?We(sH,(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}=AM(t,!1);return!(r&&(function(u,{safeText:d,ariaLabel:f}){let h;if(u===!0)h=TM;else{if(!He(u))return!1;if(u.length>FP)return ge.error(`[PostHog] content_ignorelist array cannot exceed ${FP} items. Use css_selector_ignorelist for more complex matching.`),!1;h=u.map(m=>m.toLowerCase())}return h.some(m=>jP(d,m)||jP(f,m))})(r,(function(u,d){for(const h of d)if(rH(h))return Z_(h);for(const h of d){try{var f;if(((f=window)===null||f===void 0?void 0:f.getComputedStyle(h).getPropertyValue("cursor"))!=="pointer")break}catch{break}const m=Z_(h);if(m.safeText||m.ariaLabel)return m}return Z_(u)})(t,l))||Xb(l,n))}const ES=t=>!t||or(t,"html")||!Ui(t),AM=(t,e)=>{const n=typeof window>"u"?void 0:window;if(!n||ES(t))return{parentIsUsefulElement:!1,targetElementList:[]};let r=!1;const s=[t];let i=t;for(;i.parentNode&&!or(i,"body");){if(iv(i.parentNode)){s.push(i.parentNode.host),i=i.parentNode.host;continue}const o=PM(i);if(!o)break;if(e||SS.indexOf(o.tagName.toLowerCase())>-1)r=!0;else try{const l=n.getComputedStyle(o);l&&l.getPropertyValue("cursor")==="pointer"&&(r=!0)}catch{}s.push(o),i=o}return{parentIsUsefulElement:r,targetElementList:s}};function Vl(t){const e=new Set;let n=0;for(let i=t;i.parentNode&&!or(i,"body");i=i.parentNode){if(n++>=1e3||e.has(i))return!1;e.add(i);const o=iu(i);if(We(o,"ph-sensitive")||We(o,"ph-no-capture"))return!1}if(We(iu(t),"ph-include"))return!0;const r=t.type||"";if(dt(r))switch(r.toLowerCase()){case"hidden":case"password":return!1}const s=t.name||t.id||"";return!dt(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 sf(t){return!!(or(t,"input")&&!["button","checkbox","submit","reset"].includes(t.type)||or(t,"select")||or(t,"textarea")||t.getAttribute("contenteditable")==="true")}const VP=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}))$"),HP=/(^|[^0-9A-Za-z_])([0-9][0-9 -]*[0-9])(?=$|[^0-9A-Za-z_])/g,iH=[16,15,14,13],oH=new RegExp("^(\\d{3}-?\\d{2}-?\\d{4})$"),UP=new RegExp("(^|[^0-9])((?!000|666)[0-9]{3}-?(?!00)[0-9]{2}-?(?!0000)[0-9]{4})(?=$|([^0-9]))","g"),ZP=/[0-9A-Za-z_]/;function aH(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 Nd(t,e=!0){return!(ot(t)||dt(t)&&(t=rf(t),(e?VP.test((t||"").replace(/[- ]/g,"")):(function(n){let r;for(HP.lastIndex=0;r=HP.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 iH){const u=o+l;if(i.length>=u){const d=i.slice(o,u);if(VP.test(d)&&aH(d))return!0}}}return!1})(t))||(e?oH.test(t):(function(n){let r;for(UP.lastIndex=0;r=UP.exec(n);){const s=r[1],i=r[3];if(!(s&&i&&ZP.test(s)&&ZP.test(i)))return!0}return!1})(t))))}function BP(t){let e=Sp(t);return e=`${e} ${IM(t)}`.trim(),Nd(e)?e:""}function IM(t){let e="";return t&&t.childNodes&&t.childNodes.length&&Zt(t.childNodes,function(n){var r;if(n&&((r=n.tagName)===null||r===void 0?void 0:r.toLowerCase())==="span")try{const s=Sp(n);e=`${e} ${s}`.trim(),n.childNodes&&n.childNodes.length&&(e=`${e} ${IM(n)}`.trim())}catch(s){ge.error("[AutoCapture]",s)}}),e}function WP(t){return t.replace(/"|\\"/g,'\\"')}function lH(t){const e=t.attr__class;if(e)return He(e)?e:xS(e)}const A0=En("[Dead Clicks]"),cH=()=>!0,uH=t=>{var e;const n=!!(!((e=t.instance.persistence)===null||e===void 0)&&e.get_property(mS)),r=t.instance.config.capture_dead_clicks;return Es(r)?r:!!ct(r)||n};var KP=class{get lazyLoadedDeadClicksAutocapture(){return this.ql}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({[mS]:e.captureDeadClicks}),this.startIfEnabledOrStop())}startIfEnabledOrStop(){this.isEnabled(this)?this.Bl(()=>{this.zl()}):this.stop()}Bl(t){var e,n,r;!((e=et.__PosthogExtensions__)===null||e===void 0)&&e.initDeadClicksAutocapture?t():(n=et.__PosthogExtensions__)===null||n===void 0||(r=n.loadExternalDependency)===null||r===void 0||r.call(n,this.instance,"dead-clicks-autocapture",s=>{s?A0.error("failed to load script",s):t()})}zl(){var t;if(Oe){if(!this.ql&&(!((t=et.__PosthogExtensions__)===null||t===void 0)&&t.initDeadClicksAutocapture)){const e=ct(this.instance.config.capture_dead_clicks)?F({},this.instance.config.capture_dead_clicks):{};e.__onCapture=this.onCapture,this.onCapture&&(e.capture_dead_swipes=!1),this.ql=et.__PosthogExtensions__.initDeadClicksAutocapture(this.instance,e),this.ql.start(Oe),A0.info("starting...")}}else A0.error("`document` not found. Cannot start.")}stop(){this.ql&&(this.ql.stop(),this.ql=void 0,A0.info("stopping..."))}};const xh=En("[SegmentIntegration]");function GP(t,e,n=!0){const r=t.config.segment;if(!r)return e();const{analytics:s,filterProperties:i}=(l=>Nn(l.register))(o=r)?{analytics:o}:o;var o;(function(l,u,d,f){const h=g=>{const _=()=>g.anonymousId()||fo();l.config.get_device_id=_,f&&g.id()&&(l.register({distinct_id:g.id(),$device_id:_()}),l.persistence.set_property(cs,_g)),d(f?void 0:g.anonymousId()||void 0)},m=u.user();"then"in m&&Nn(m.then)?m.then(h):h(m)})(t,s,l=>{s.register(((u,d,{filterProperties:f}={})=>{typeof Promise<"u"&&Promise.resolve||xh.warn("This browser does not have Promise support, and can not use the segment integration");const h=(m,g)=>{if(!g)return m;const _=!!d&&m.event.anonymousId===d&&!m.event.userId;_||m.event.userId||m.event.anonymousId===u.get_distinct_id()||(xh.info("No userId set, resetting PostHog"),u.reset()),_||(d=void 0),m.event.userId&&m.event.userId!==u.get_distinct_id()&&(xh.info("UserId set, identifying with PostHog"),u.identify(m.event.userId));let y=u.calculateEventProperties(g,m.event.properties);if(!ot(f)){const b=m.event.properties||{},x={};for(const E of Object.keys(y))lS.call(b,E)||(x[E]=y[E]);const S=((E,C)=>{const R=He(E)?E:[E];let O=F({},C);for(const I of R)try{if(O=I(O),ot(O))return null}catch(A){return xh.error("Error in Segment filterProperties:",A),null}return O})(f,x);if(ot(S))return m;y=S}return m.event.properties=Object.assign({},y,m.event.properties),m};return{name:"PostHog JS",type:"enrichment",version:"1.0.0",isLoaded(){return!0},load(){return Promise.resolve()},track(m){return h(m,m.event.event)},page(m){return h(m,wS)},identify(m){return h(m,bM)},screen(m){return h(m,"$screen")}}})(t,l,{filterProperties:i})).then(()=>{e()},u=>{xh.error("Failed to register the Segment integration",u),e()})},n)}const OM="posthog-js";function MM(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 m=t.requestRouter.endpointFor("ui",`/project/${t.config.token}/person/${t.get_distinct_id()}`);o.tags["PostHog Person URL"]=m,t.sessionRecordingStarted()&&(o.tags["PostHog Recording URL"]=t.get_session_replay_url({withTimestamp:!0}));const g=((l=o.exception)===null||l===void 0?void 0:l.values)||[],_=g.map(x=>F(F({},x),{},{stacktrace:x.stacktrace?F(F({},x.stacktrace),{},{type:"raw",frames:(x.stacktrace.frames||[]).map(S=>F(F({},S),{},{platform:"web:javascript"}))}):void 0})),y={$exception_message:((u=g[0])===null||u===void 0?void 0:u.value)||o.message,$exception_type:(d=g[0])===null||d===void 0?void 0:d.type,$exception_level:o.level,$exception_list:_,$sentry_event_id:o.event_id,$sentry_exception:o.exception,$sentry_exception_message:((f=g[0])===null||f===void 0?void 0:f.value)||o.message,$sentry_exception_type:(h=g[0])===null||h===void 0?void 0:h.type,$sentry_tags:o.tags};var b;return e&&n&&(y.$sentry_url=(r||"https://sentry.io/organizations/")+e+"/issues/?project="+n+"&query="+o.event_id),i&&((b=t.exceptions)===null||b===void 0||b.sendExceptionEvent(y)),o}}var dH=class{constructor(t,e,n,r,s,i){this.name=OM,this.setupOnce=function(o){o(MM(t,{organization:e,projectId:n,prefix:r,severityAllowList:s,sendExceptionsToPostHog:i==null||i}))}}},qP=class{constructor(t){this.Hl=(e,n,r)=>{r&&(r.noSessionId||r.activityTimeout||r.sessionPastMaximumLength||r.crossTabAdoption)&&(ge.info("[PageViewManager] Session rotated, clearing pageview state",{sessionId:e,changeReason:r}),this.Ul=void 0,this._instance.scrollManager.resetContext())},this._instance=t,this.Wl()}Wl(){var t;this.Vl=(t=this._instance.sessionManager)===null||t===void 0?void 0:t.onSessionId(this.Hl)}destroy(){var t;(t=this.Vl)===null||t===void 0||t.call(this),this.Vl=void 0}doPageView(t,e){var n;const r=this.Gl(t,e);return this.Ul={pathname:(n=ae==null?void 0:ae.location.pathname)!==null&&n!==void 0?n:"",pageViewId:e,timestamp:t},this._instance.scrollManager.resetContext(),r}doPageLeave(t){var e;return this.Gl(t,(e=this.Ul)===null||e===void 0?void 0:e.pageViewId)}doEvent(){var t;return{$pageview_id:(t=this.Ul)===null||t===void 0?void 0:t.pageViewId}}Gl(t,e){const n=this.Ul;if(!n)return{$pageview_id:e};let r={$pageview_id:e,$prev_pageview_id:n.pageViewId};const s=this._instance.scrollManager.getContext();if(s&&!this._instance.config.disable_scroll_properties){let{maxScrollHeight:i,lastScrollY:o,maxScrollY:l,maxContentHeight:u,lastContentY:d,maxContentY:f}=s;if(!(le(i)||le(o)||le(l)||le(u)||le(d)||le(f))){i=Math.ceil(i),o=Math.ceil(o),l=Math.ceil(l),u=Math.ceil(u),d=Math.ceil(d),f=Math.ceil(f);const h=i>1?Zo(o/i,0,1,ge):1,m=i>1?Zo(l/i,0,1,ge):1,g=u>1?Zo(d/u,0,1,ge):1,_=u>1?Zo(f/u,0,1,ge):1;r=mn(r,{$prev_pageview_last_scroll:o,$prev_pageview_last_scroll_percentage:h,$prev_pageview_max_scroll:l,$prev_pageview_max_scroll_percentage:m,$prev_pageview_last_content:d,$prev_pageview_last_content_percentage:g,$prev_pageview_max_content:f,$prev_pageview_max_content_percentage:_})}}return n.pathname&&(r.$prev_pageview_pathname=n.pathname),n.timestamp&&(r.$prev_pageview_duration=(t.getTime()-n.timestamp.getTime())/1e3),r}};const Sh=["flags","surveys"],fH={[EV]:{exposure:"hidden"},[rv]:{exposure:"hidden"},[CV]:{exposure:"hidden"},[Hb]:{exposure:"hidden"},[Ld]:{exposure:"hidden"},[ep]:{exposure:"hidden"},[tM]:{exposure:"event"},[Ub]:{exposure:"hidden"},[rM]:{exposure:"hidden"},[Zb]:{exposure:"event"},[nM]:{exposure:"hidden"},[Bb]:{exposure:"event"},[Wb]:{exposure:"event"},[mS]:{exposure:"event"},[gS]:{exposure:"hidden"},[sM]:{exposure:"event"},[tp]:{exposure:"hidden"},[PV]:{exposure:"hidden"},[bd]:{exposure:"hidden"},[iM]:{exposure:"event"},[TV]:{exposure:"event",shouldSkipFromEventProperties:t=>Tn(t)},[MV]:{exposure:"event"},[LV]:{exposure:"event"},[NV]:{exposure:"event"},[DV]:{exposure:"event"},[$V]:{exposure:"hidden"},[uo]:{exposure:"hidden",storageGroup:"flags"},[Ta]:{exposure:"hidden",storageGroup:"flags"},[jb]:{exposure:"hidden"},[ru]:{exposure:"hidden",storageGroup:"flags"},[Ml]:{exposure:"hidden",storageGroup:"flags"},[su]:{exposure:"hidden",storageGroup:"flags",volatile:!0},[Jh]:{exposure:"hidden",storageGroup:"flags"},[Mo]:{exposure:"hidden"},[zc]:{exposure:"hidden"},[Ol]:{exposure:"hidden"},[Il]:{exposure:"hidden"},[Fh]:{exposure:"hidden",storageGroup:"surveys"},[nv]:{exposure:"hidden",storageGroup:"surveys",volatile:!0},[Vb]:{exposure:"event"},[vg]:{exposure:"hidden"},[yg]:{exposure:"hidden"},[Kb]:{exposure:"hidden"},[FV]:{exposure:"hidden"},[jV]:{exposure:"hidden"},[zV]:{exposure:"event"},[VV]:{exposure:"event"},[HV]:{exposure:"event"},[UV]:{exposure:"event"},[zo]:{exposure:"hidden"},[$h]:{exposure:"hidden"},[oM]:{exposure:"event"},[xp]:{exposure:"hidden"},[zl]:{exposure:"hidden",storageGroup:"flags",volatile:!0},[cs]:{exposure:"hidden"},[Gb]:{exposure:"hidden"},[aM]:{exposure:"hidden"},[lM]:{exposure:"hidden"},[cM]:{exposure:"hidden"},[xd]:{exposure:"hidden"},[vS]:{exposure:"hidden"},[RV]:{exposure:"event"},[AV]:{exposure:"event"},[IV]:{exposure:"event"},[OV]:{exposure:"event"},[dM]:{exposure:"event"},[fM]:{exposure:"event"},[yS]:{exposure:"hidden"},[_S]:{exposure:"hidden"},[hM]:{exposure:"hidden"},[pM]:{exposure:"hidden"},[mM]:{exposure:"hidden"},[gM]:{exposure:"hidden"},[vM]:{exposure:"hidden"},[yM]:{exposure:"hidden"},[_M]:{exposure:"hidden"},[ZV]:{exposure:"event"}},hH=[["$posthog_sr_group_event_trigger_",{exposure:"hidden"}],["$posthog_sr_group_url_trigger_",{exposure:"hidden"}],["$posthog_sr_group_sampling_",{exposure:"hidden"}]],Lr=t=>{const e=fH[t];if(e)return e;for(const[n,r]of hH)if(t.indexOf(n)===0)return r};function CS(){try{return Intl.DateTimeFormat().resolvedOptions().timeZone}catch{return}}const Yo=t=>{const e=typeof document>"u"?void 0:document,n=e==null?void 0:e.createElement("a");return le(n)?null:(n.href=t,n)},LM=()=>{try{return"u">typeof window&&window.navigator.onLine!==!1}catch{return!1}},NM=(t,e)=>t>=e&&LM(),DM=(t,e,n,r)=>{if(t===0){if(LM()){const s=e+1;return s===n&&r(),s}return e}return 0},kd=(t,e)=>{try{let n;return JSON.stringify(t,(r,s)=>{var i;return Mf(s)?((i=n)!==null&&i!==void 0||(n=new WeakMap),n.has(s)||n.set(s,xM(s)),n.get(s)):typeof s=="bigint"?s.toString():s},e)}catch{return XI(t)}},of=function(t,e){const n=((t.split("#")[0]||"").split(/\?(.*)/)[1]||"").replace(/^\?+/g,"").split("&");let r;for(let s=0;n.length>s;s++){const i=n[s].split(/=(.*)/);if(i[0]===e){r=i;break}}if(!He(r)||2>r.length)return"";{let s=r[1].replace(/\+/g," ");try{s=decodeURIComponent(s)}catch{ge.error("Skipping decoding for malformed query param: "+s)}return s}},kp=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 m=u[h].split("?");let g=0;for(;m.length>g&&!e.includes(m[g].split("=")[0]);)g++;d.push(m.length>g?m.slice(0,g).concat(m[g].split("=")[0]+"="+n).join("?"):u[h])}let f=l;return o!=null&&(f+="?"+d.join("&")),s!=null&&(f+="#"+s),f},ov=function(t,e){const n=t.match(new RegExp(e+"=([^&]*)"));return n?n[1]:null},af=["gclid","gclsrc","dclid","gbraid","wbraid","fbclid","msclkid","twclid","li_fat_id","igshid","ttclid","rdt_cid","epik","qclid","sccid","oppref","bfcid","irclid","_kx"],pH=["utm_source","utm_medium","utm_campaign","utm_content","utm_term","gad_source","mc_cid",...af],Ep="<masked>",mH=["li_fat_id"];function $M(t,e,n){if(!Oe)return{};const r=e?[...af,...n||[]]:[],s=FM(kp(Oe.URL,r,Ep),t),i=(function(){const o={};return Zt(mH,function(l){const u=np(l);o[l]=u||null}),o})();return mn(i,s)}function FM(t,e){const n=pH.concat(e||[]),r={};return Zt(n,function(s){const i=of(t,s);r[s]=i||null}),r}function jM(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(!Tn(e)){r.$search_engine=e;const s=Oe?of(Oe.referrer,n):"";s.length&&(r.ph_keyword=s)}return r}function zM(){return navigator.language||navigator.userLanguage}function gH(){const t=zM();return typeof t=="string"?t.split("-")[0]:void 0}const av="$direct";function VM(){return(Oe==null?void 0:Oe.referrer)||av}function HM(t,e,n=!1){const r=t?[...af,...e||[]]:[],s=n?jl(ln==null?void 0:ln.href):ln==null?void 0:ln.href,i=s==null?void 0:s.substring(0,1e3);return{r:VM().substring(0,1e3),u:i?kp(i,r,Ep):void 0}}function UM(t,e=!1){var n;const{r,u:s}=t,i=e?jl(s):s,o={$referrer:r,$referring_domain:r==null?void 0:r==av?av:(n=Yo(r))===null||n===void 0?void 0:n.host};if(i){o.$current_url=i;const l=Yo(i);o.$host=l==null?void 0:l.host,o.$pathname=l==null?void 0:l.pathname;const u=FM(i);mn(o,u)}if(r){const l=jM(r);mn(o,l)}return o}function vH(){try{return new Date().getTimezoneOffset()}catch{return}}const yH={flags:zl,surveys:nv},_H=["cookie","localstorage","localstorage+cookie","sessionstorage","memory"],I0=t=>`${t}_cookie_identity_change_pending`,O0=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},cr="main",_a=[uo,Ta,ru,Ml,su,zl,Jh,Ol],B_=t=>_a.indexOf(t)!==-1,ZM=[Ld,ep],YP=t=>ZM.indexOf(t)!==-1,fl=(t,e)=>{try{return JSON.stringify(t)===JSON.stringify(e)}catch{return t===e}},sd=t=>{if(!t)return{};const e=JSON.parse(t);return ct(e)?e:{}},XP=(t,e)=>{Zt(t,(n,r)=>{const s=Lr(r);s&&s.exposure!=="event"||{}.hasOwnProperty.call(e,r)||delete t[r]})};var W_=class{constructor(t,e,n=!0,r=!t.cookieless_mode){if(this.Ql={},this.Jl=!1,this.Zl=!1,this.Kl=!1,this.Yl=!1,this.Xl=!1,this.tu=new Map,this.eu=!1,this.iu=!1,this.nu=!1,this.su=new Set,this.ru=new Set,this.Fr=t,this.ou=n,this.props={},this.au=void 0,this.lu=(s=>{let i="";return s.token&&(i=s.token.replace(/\+/g,"PL").replace(/\//g,"SL").replace(/=/g,"EQ")),s.persistence_name?"ph_"+s.persistence_name:"ph_"+i+"_posthog"})(t),this.fi=t.disable_persistence||!!e,this.Ll=this.uu(t),this.Kl=this.cu(t),this.load(r),this.hu(),t.debug&&ge.info("Persistence loaded",t.persistence,F({},this.props)),this.update_config(t,t,e),this.save(),ae){const s=()=>this.flush();Lt(ae,"beforeunload",s,{capture:!1}),Lt(ae,"pagehide",s,{capture:!1}),this.du=i=>{if(this.Jl&&(!i.storageArea||i.storageArea===(ae==null?void 0:ae.localStorage))&&i.key)if(i.key!==this.lu){if(this.Kl){const o=Sh.find(l=>i.key===this.vu(l));o&&this.fu(i.key,o)}}else this.fu(i.key,cr)},Lt(ae,"storage",this.du)}}markCrossTabFeatureFlagChanges(t){Object.entries(t).forEach(([e,n])=>{const r=this.tu.get(e);if(!B_(e)||r===!0)return;if(n===!0)return void this.pu(e,!0);const s=new Set(r||[]);n.forEach(i=>s.add(i)),s.size&&this.pu(e,s)})}onCrossTabFeatureFlagChange(t){return this.ru.add(t),()=>this.ru.delete(t)}destroy(){this.du&&ae&&(ae.removeEventListener("storage",this.du),this.du=void 0),this.ru.clear()}fu(t,e,n=!0){if(this.fi)return!1;let r,s;try{if(s=At.Lt(t),Tn(s)){const l=this.gu(e);return l.storageValue=null,e!==cr&&(l.persisted=!1),!1}r=sd(s)}catch{return!1}const i=e===cr?r:At.Ft(this.lu);if(i&&this.mu(i))return!1;const o=this.yu(r,e,n);return e===cr&&this.Kl&&!fl(this.bu().main,r)||this._u(r,e,!0,s),o}mu(t){const e=this.props[Di],n=t[Di];return!le(e)&&!le(n)&&e!==n}_u(t,e,n,r){const s=this.gu(e);s.storageValue=r,e!==cr&&(s.persisted=n);try{s.fingerprint=this.wu(t,e)}catch{s.fingerprint=void 0}}yu(t,e,n){let r=!1;return _a.forEach(s=>{var i;const o=(i=Lr(s))===null||i===void 0?void 0:i.storageGroup;if(e===cr&&this.Kl&&o||e!==cr&&o!==e)return;const l=s in t,u=this.ku(s,l?t[s]:void 0),d=this.tu.has(s)?s in this.props:l;d===s in this.props&&fl(u,this.props[s])||(d?this.Su(s,u,!1):this.xu(s,!1),r=!0)}),r&&n&&this.ru.forEach(s=>s()),r}$u(){if(!this.Jl)return!1;try{this.nu=!1;const t=At.Lt(this.lu),e=this.gu(cr);let n,r=!1,s=!1;if(t!==e.storageValue)if(Tn(t))e.storageValue=null;else{if(n=sd(t),this.nu=!this.iu&&this.mu(n),this.nu)return!1;s=this.yu(n,cr,!1),!this.Kl||fl(this.bu().main,n)?this._u(n,cr,!0,t):e.storageValue=t,r=!0}return this.Kl&&Sh.forEach(i=>{const o=At.Lt(this.vu(i)),l=this.gu(i),u=n||{},d=r&&_a.some(h=>{var m;return((m=Lr(h))===null||m===void 0?void 0:m.storageGroup)===i&&h in u});if(o===l.storageValue&&!d)return;if(Tn(o))return l.storageValue=null,l.persisted=!1,void(d&&(s=this.yu(u,i,!1)||s));const f=sd(o);s=this.yu(f,i,!1)||s,this._u(f,i,!0,o)}),s}catch{return!1}}pu(t,e){this.tu.set(t,e);const n=Lr(t);n!=null&&n.volatile||(this.gu((this.Kl?n==null?void 0:n.storageGroup:void 0)||cr).fingerprint=void 0,this.Cu(t))}Tu(){_a.forEach(t=>this.tu.set(t,!0))}hu(){if(this.Jl)try{const t=At.Lt(this.lu),e=sd(t);this.gu(cr).storageValue=t,_a.forEach(n=>{var r;const s=this.Kl?(r=Lr(n))===null||r===void 0?void 0:r.storageGroup:void 0,i=s?At.Lt(this.vu(s)):null;if(s){const l=this.gu(s);l.storageValue=i,l.persisted=!Tn(i)}const o=s&&!Tn(i)?sd(i):e;n in this.props?this.Iu(n,o[n],this.props[n]):n in o&&this.pu(n,!0)})}catch{}}ku(t,e){const n=this.tu.get(t);if(!n)return e;if(n===!0)return this.props[t];if(t==="$active_feature_flags"){const i=new Set(He(e)?e:[]),o=new Set(He(this.props[t])?this.props[t]:[]);return n.forEach(l=>o.has(l)?i.add(l):i.delete(l)),Array.from(i)}const r=ct(e)?F({},e):{},s=ct(this.props[t])?this.props[t]:{};return n.forEach(i=>{i in s?r[i]=s[i]:delete r[i]}),r}Iu(t,e,n){if(!B_(t))return;const r=this.tu.get(t);if(r===!0)return;let s=e;if(this.Jl)try{var i;const l=this.Kl?(i=Lr(t))===null||i===void 0?void 0:i.storageGroup:void 0,u=l?this.vu(l):this.lu;s=sd(At.Lt(u))[t]}catch{}const o=new Set(r||[]);if(t==="$active_feature_flags"){if(!le(e)&&!He(e)||!le(s)&&!He(s)||!He(n))return void this.pu(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(!ct(n))return void(fl(s,n)?this.tu.delete(t):this.pu(t,!0));{if(!le(e)&&!ct(e)||le(e)&&zs(n)&&le(s))return void this.pu(t,!0);const l=ct(e)?e:{},u=ct(s)?s:{};new Set([...Object.keys(l),...Object.keys(n)]).forEach(d=>{d in l==d in n&&fl(l[d],n[d])||o.add(d)}),o.forEach(d=>{d in u==d in n&&fl(u[d],n[d])&&o.delete(d)})}}o.size?this.pu(t,o):this.tu.delete(t)}Mu(){var t;const e=(t=this.Fr)===null||t===void 0?void 0:t.persistence_save_debounce_ms;return Bn(e)&&e>0?e:0}Eu(t){if(this.Fr.cookieWinsOnConflict&&this.Fr.persistence.toLowerCase()==="localstorage+cookie")if(t)try{const e=H_(t,this.Fr.cookie_persisted_properties||[]),n=LP(e,this.Fr.cookie_persisted_properties||[]),r=JSON.stringify(e)+"|"+JSON.stringify(n),s=yn.Lt(this.lu)||void 0;s&&U_(this.lu,s)===r&&(this.Au=r,this.Ru=s)}catch{}else try{const e=yn.Lt(this.lu)||void 0;this.Au=e?U_(this.lu,e):void 0,this.Ru=e}catch{}}syncCookieProperties(){return this.Pu(this.Fr)}Pu(t,e=!1){if(this.fi&&!e||this.Xl||!t.cookieWinsOnConflict||t.persistence.toLowerCase()!=="localstorage+cookie")return!1;let n;try{n=yn.Lt(this.lu)||void 0}catch{}if(!n||n===this.Ru)return!1;const r=U_(this.lu,n);let s;try{s=V_(JSON.parse(n))}catch{return!1}if((yn.Lt(this.lu)||void 0)!==n)return!1;this.Au=r,this.Ru=n;const i=NP(this.lu,n),o=[...Vc,...i.properties],l={};if(Object.keys(s).forEach(y=>{const b=s[y];(le(b)||Tn(b)||b===""||y==="$user_state"&&b!=="anonymous"&&b!=="identified")&&(l[y]=!0,delete s[y])}),zs(s))return!1;const u="distinct_id"in s||s.$user_state==="anonymous"||s.$user_state==="identified",d=this.props,f=d[Di],h=d[cs],m=mn({},d);[...Vc,...t.cookie_persisted_properties||[]].forEach(y=>{if(o.indexOf(y)!==-1&&!(y in s)&&!l[y]&&(u||y!=="distinct_id"&&y!=="$user_state")){const b=m[y];(i.isValid||Vc.indexOf(y)===-1||b!==!1&&b!==0)&&delete m[y]}}),this.props=mn(m,s),_a.forEach(y=>{const b=y in this.props;y in d===b&&fl(d[y],this.props[y])||(b?this.Iu(y,d[y],this.props[y]):this.pu(y,!0))}),!u||"$user_state"in s||"$user_state"in this.props||this.Su(cs,Ra);const g=this.props[Di],_=this.props[cs];return!u||g===f&&_===h||(this.iu=!0,this.Yl=!0,cn.$t(I0(this.lu),!0),this.xu(Ol),this.xu(Ta),this.xu(uo),this.xu(ru),this.xu(Ml),this.xu(su),this.xu(zl),this.xu(xp),this.xu(zo),_!=="anonymous"||h!=="identified"&&s.$user_state!=="anonymous"&&(le(f)||g===f)||(XP(this.props,s),this.xu(Il)),_==="identified"?this.props.$user_id=g:delete this.props.$user_id,this.xu(rv)),!0}consumeCookieIdentityChange(){const t=I0(this.lu),e=this.Yl||!!cn.Lt(t);return this.Yl=!1,e&&cn.Dt(t),e}Ou(t=!1){return!(this.Xl||this.fi&&!t||!this.Fr.cookieWinsOnConflict||this.Fr.persistence.toLowerCase()!=="localstorage+cookie"||(this.Xl=!0,0))}Fu(){this.Xl&&(le(this.Du)||(clearTimeout(this.Du),this.Du=void 0),delete this.Ql[cr],this.Lu(!0))}Nu(t=!0){if(this.Xl)try{t?this.Fu():le(this.Du)||(clearTimeout(this.Du),this.Du=void 0)}finally{this.Xl=!1}}isDisabled(){return!!this.fi}uu(t){_H.indexOf(t.persistence.toLowerCase())===-1&&(ge.critical("Unknown persistence type "+t.persistence+"; falling back to localStorage+cookie"),t.persistence="localStorage+cookie");const e=((o=[],l=!1,u=()=>!1)=>{const d=[...Vc,...o];return F(F({},At),{},{ju(f){return[yn.Lt(f),yn.Lt(rp(f)),At.Lt(f)].join("\0")},Ft(f){try{let m,g={};try{m=yn.Lt(f)||void 0,g=m?V_(JSON.parse(m)):{}}catch{}const _=JSON.parse(At.Lt(f)||"{}");let y;if(l){const b=NP(f,m),x=[...Vc,...b.properties],S={};Object.keys(g).forEach(C=>{const R=g[C];Tn(R)||R===""||C==="$user_state"&&R!=="anonymous"&&R!=="identified"||(S[C]=R)});const E="distinct_id"in S||S.$user_state==="anonymous"||S.$user_state==="identified";if(Object.keys(S).length>0){var h;const C=_[Di],R=(h=_.$user_state)!==null&&h!==void 0?h:Ra;d.forEach(O=>{if(x.indexOf(O)!==-1&&!(O in g)&&(E||O!=="distinct_id"&&O!=="$user_state")){const I=_[O];(b.isValid||Vc.indexOf(O)===-1||I!==!1&&I!==0)&&delete _[O]}}),!E||"$user_state"in g||"$user_state"in _||(_[cs]=Ra),!E||("distinct_id"in S?S[Di]:_[Di])===C&&("$user_state"in S?S[cs]:_[cs])===R||(z_.forEach(O=>delete _[O]),S.$user_state==="identified"&&"distinct_id"in S?_.$user_id=S[Di]:delete _.$user_id,S.$user_state!=="identified"&&(delete _[oM],delete _[Il]),delete _.__alias)}y=mn(_,S)}else y=mn(g,_);return u()||At.$t(f,y),y}catch{}return null},$t(f,h,m,g,_,y){const b=At.$t(f,h,void 0,void 0,y);try{const x=H_(h,o);if(Object.keys(x).length){if(l){const S=rp(f),E=LP(x,o);if(yn.$t(S,E,m,g,_,y),yn.Lt(S)!==JSON.stringify(E)){yn.Dt(S,g);const C=H_(h);return yn.$t(f,C,m,g,_,y),b}}yn.$t(f,x,m,g,_,y)}}catch(x){At.Pt(x)}return b},Dt(f,h){try{ae==null||ae.localStorage.removeItem(f),yn.Dt(f,h),yn.Dt(rp(f),h)}catch(m){At.Pt(m)}}})})(t.cookie_persisted_properties||[],t.cookieWinsOnConflict,()=>!!this.fi);let n,r=!1,s=!1;const i=t.persistence.toLowerCase();return i==="localstorage"&&At.Ot()?(n=At,s=!0):i==="localstorage+cookie"&&e.Ot()?(n=e,s=!0,r=!0):i==="sessionstorage"&&cn.Ot()?n=cn:i==="memory"?n=Yb:i==="cookie"&&yn.Ot()?(n=yn,r=!0):e.Ot()?(n=e,s=!0,r=!0):yn.Ot()?(n=yn,r=!0):n=Yb,this.Jl=s,this.Zl=r,n}vu(t){return`${this.lu}__${t}`}cu(t){return this.Jl&&!!t.split_storage}properties(){const t={};return Zt(this.props,(e,n)=>{const r=Lr(n);if(!r||r.exposure==="event"){var s;if(!(r==null||(s=r.shouldSkipFromEventProperties)===null||s===void 0)&&s.call(r,e))return;t[n]=e}}),t}load(t=!1){if(this.fi&&!t)return;const e=this.Fr.cookieWinsOnConflict&&this.Fr.persistence.toLowerCase()==="localstorage+cookie",n=e?At.Ft(this.lu):null;let r={};if(e)try{r=V_(yn.Ft(this.lu)),Zt(r,(l,u)=>{(le(l)||Tn(l)||l==="")&&delete r[u]})}catch{}const s=this.Ll.Ft(this.lu);if(s&&(this.props=mn({},s)),this.Kl&&this.qu(),e&&s){var i,o;const l=n==null?void 0:n[Di],u=(i=n==null?void 0:n.$user_state)!==null&&i!==void 0?i:Ra,d=s[Di],f=(o=s.$user_state)!==null&&o!==void 0?o:Ra;if(d!==l||f!==u){this.Yl=!0,this.fi||cn.$t(I0(this.lu),!0);const h=mn({},this.props);z_.forEach(g=>delete h[g]),f!=="anonymous"||u!=="identified"&&r.$user_state!=="anonymous"&&(le(l)||d===l)||(XP(h,r),delete h[Il]),this.props=h;const m=new Set;z_.forEach(g=>{var _;const y=(_=Lr(g))===null||_===void 0?void 0:_.storageGroup;y&&m.add(y)}),m.forEach(g=>{if(this.fi)return;const _={};Zt(this.props,(y,b)=>{var x;((x=Lr(b))===null||x===void 0?void 0:x.storageGroup)===g&&(_[b]=y)}),zs(_)?(At.Dt(this.vu(g)),this.Ql[g]={}):At.$t(this.vu(g),_)&&(this.Ql[g]={persisted:!0,fingerprint:this.wu(_,g)})})}}cn.Lt(I0(this.lu))&&(this.Yl=!0)}qu(){for(const t of Sh){const e=At.Ft(this.vu(t));if(e&&!zs(e)){const n=this.gu(t);n.persisted=!0,this.Bu(t)||(n.fingerprint=this.wu(e,t)),this.zu(t,e)||mn(this.props,e)}}}Bu(t){return Object.keys(this.props).some(e=>{var n;return((n=Lr(e))===null||n===void 0?void 0:n.storageGroup)===t})}zu(t,e){const n=yH[t];if(!n)return!1;const r=e[n],s=this.props[n];return Bn(r)&&Bn(s)&&s>r}refreshKey(t){this.Hu([t])}Hu(t){if(this.fi)return;let e,n=!1;const r=()=>(n||(e=this.Ll.Ft(this.lu),n=!0),e);t.forEach(s=>{var i;if(this.su.has(s))return;const o=this.Kl?(i=Lr(s))===null||i===void 0?void 0:i.storageGroup:void 0,l=o?At.Ft(this.vu(o)):r();if(l&&s in l)this.Su(s,l[s],!1);else{if(o){const u=r();if(u&&s in u)return void this.Su(s,u[s],!1)}this.xu(s,!1)}})}refreshMetaIdentifiers(){if(this.fi)return;const t=this.Uu();(le(t)||t!==this.Wu)&&(this.Hu(ZM),this.Vu(t))}Vu(t=this.Uu()){this.Wu=this.su.size===0?t:void 0}Uu(){const t=this.Ll.ju?this.Ll.ju(this.lu):this.Ll.Lt(this.lu);return dt(t)?t:void 0}save(){if(this.fi)return;const t=this.Mu();t>0?le(this.Du)&&(this.Du=setTimeout(()=>{this.Du=void 0,this.Lu()},t)):this.Lu()}flush(){le(this.Du)||(clearTimeout(this.Du),this.Du=void 0,this.Lu())}Lu(t=!1){if(this.fi||this.Xl&&!t)return;t||(this.syncCookieProperties(),this.Fr.cookieWinsOnConflict&&this.Fr.persistence.toLowerCase()==="localstorage+cookie"||this.refreshMetaIdentifiers());const e=!t&&!this.eu;e||(this.nu=!1);const n=!!e&&this.$u();if(this.nu)return void(this.Fr.debug&&ge.warn("skipping persistence write because storage belongs to a different distinct ID"));if(this.Kl)return this.Gu(),void(n&&this.ru.forEach(s=>s()));const r=this.Qu(this.Ll,this.lu,this.props,cr);r==="written"&&this.Eu(this.props),r!=="failed"&&(this.tu.clear(),this.iu=!1,this.su.clear()),r==="written"&&this.Vu(),n&&this.ru.forEach(s=>s())}Gu(){const{main:t,groups:e}=this.bu(),n=this.Qu(this.Ll,this.lu,t,cr);n==="written"&&this.Eu(t),n!=="failed"&&(this.iu=!1,this.su.clear(),_a.forEach(s=>{var i;!((i=Lr(s))===null||i===void 0)&&i.storageGroup||this.tu.delete(s)})),n==="written"&&this.Vu();for(const s of Sh){var r;const i=e[s];if(zs(i)&&!(!((r=this.Ql[s])===null||r===void 0)&&r.persisted)){_a.forEach(l=>{var u;((u=Lr(l))===null||u===void 0?void 0:u.storageGroup)===s&&this.tu.delete(l)});continue}const o=this.Qu(At,this.vu(s),i,s);o!=="failed"&&_a.forEach(l=>{const u=Lr(l);(u==null?void 0:u.storageGroup)!==s||o!=="written"&&u.volatile||this.tu.delete(l)})}}bu(){const t={},e={flags:{},surveys:{}};return Zt(this.props,(n,r)=>{var s;const i=(s=Lr(r))===null||s===void 0?void 0:s.storageGroup;i?e[i][r]=n:t[r]=n}),{main:t,groups:e}}wu(t,e){if(e===cr)return JSON.stringify(t)+"|"+this.Ju+"|"+this.Zu+"|"+this.Ku;const n={};return Zt(t,(r,s)=>{var i;n[s]=!((i=Lr(s))===null||i===void 0)&&i.volatile?"__volatile__":r}),JSON.stringify(n)}Qu(t,e,n,r){const s=this.gu(r);if(r!==cr&&!s.dirty&&!le(s.fingerprint))return"skipped";let i;try{if(i=this.wu(n,r),i===s.fingerprint)return s.dirty=!1,"skipped"}catch{i=void 0}return t.$t(e,n,this.Ju,this.Zu,this.Ku,this.Fr.debug)?(s.dirty=!1,r!==cr&&(s.persisted=!0),le(i)||(s.fingerprint=i),this.Jl&&(s.storageValue=At.Lt(e)),"written"):(this.Fr.debug&&ge.warn(`failed to persist storage entry "${e}"; will retry on next save`),"failed")}remove({keepGroupEntries:t=!1}={}){if(this.Tu(),le(this.Du)||(clearTimeout(this.Du),this.Du=void 0),this.Ll.Dt(this.lu,!1),this.Ll.Dt(this.lu,!0),!t&&this.ou)for(const e of Sh)At.Dt(this.vu(e));t?delete this.Ql[cr]:this.Ql={},this.Au=void 0,this.Ru=void 0}clear(){this.remove(),this.props={}}register_once(t,e,n){if(ct(t)){this.syncCookieProperties(),le(e)&&(e="None"),this.Ju=le(n)?this.Yu:n;let r=!1;if(Zt(t,(s,i)=>{this.props.hasOwnProperty(i)&&this.props[i]!==e||(this.Su(i,s),r=!0)}),r)return this.save(),!0}return!1}register(t,e){if(ct(t)){this.syncCookieProperties(),this.Ju=le(e)?this.Yu:e;let n=!1;if(Zt(t,(r,s)=>{t.hasOwnProperty(s)&&(this.props[s]!==r||ct(r)||He(r))&&(this.Su(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.xu(r),n=!0);n&&this.save()}update_campaign_params(){const t=Oe==null?void 0:Oe.URL;if(t===this.au)return;const e=$M(this.Fr.custom_campaign_params,this.Fr.mask_personal_data_properties,this.Fr.custom_personal_data_properties),n=!zs(bS(e));return n&&this.register(e),this.au=t,n?e:void 0}update_search_keyword(){this.register((function(){const t=Oe==null?void 0:Oe.referrer;return t?jM(t):{}})())}update_referrer_info(){var t;this.register_once({$referrer:VM(),$referring_domain:(Oe==null?void 0:Oe.referrer)&&((t=Yo(Oe.referrer))===null||t===void 0?void 0:t.host)||av},void 0)}set_initial_person_info(){if(this.props.$initial_campaign_params||this.props.$initial_referrer_info)return;const t=HM(this.Fr.mask_personal_data_properties,this.Fr.custom_personal_data_properties,this.Fr.disable_capture_url_hashes);this.register_once({[xd]:this.Zl?{r:O0(t.r),u:t.u?O0(t.u):void 0}:t},void 0)}get_initial_props(){const t={};Zt([cM,lM],n=>{const r=this.props[n];r&&Zt(r,function(s,i){t["$initial_"+Tb(i)]=s})});const e=this.props[xd];if(e){const n=(function(r,s=!1){const i=UM(r,s),o={};return Zt(i,function(l,u){o[`$initial_${Tb(u)}`]=l}),o})(e,this.Fr.disable_capture_url_hashes);mn(t,n)}return t}safe_merge(t){return Zt(this.props,function(e,n){n in t||(t[n]=e)}),t}update_config(t,e,n){const r=t.persistence!==e.persistence,s=!((g,_)=>{if(g.length!==_.length)return!1;const y=[...g].sort(),b=[..._].sort();return y.every((x,S)=>x===b[S])})(t.cookie_persisted_properties||[],e.cookie_persisted_properties||[]),i=r||s,o=t.cookieWinsOnConflict!==e.cookieWinsOnConflict,l=t.disable_persistence||!!n,u=!!this.fi&&!l;l||this.Pu(e,u),this.Fr=t,!l&&(r||s||o)&&(this.Au=void 0,this.Ru=void 0,this.Pu(F(F({},t),{},{cookie_persisted_properties:e.cookie_persisted_properties}),u));const d=i||o?this.uu(t):this.Ll;this.Xu();const f=this.cu(t),h=i||f!==this.Kl,m=!l&&(h||t.cross_subdomain_cookie!==this.Zu||t.secure_cookie!==this.Ku)&&this.Ou(u);this.eu=h;try{if(this.Yu=this.Ju=t.cookie_expiration,this.set_disabled(l),this.set_cross_subdomain(t.cross_subdomain_cookie),this.set_secure(t.secure_cookie),h){const g=this.props;this.clear(),this.Ll=d,this.Kl=f,this.props=g,this.save()}else o&&(this.Ll=d,l||(delete this.Ql[cr],this.Lu()))}finally{this.eu=!1,m&&this.Nu()}}Xu(){const t=this.props[xd];if(!this.Zl||!ct(t)||typeof t.r!="string")return;const e=O0(t.r),n=typeof t.u=="string"?O0(t.u):t.u;e===t.r&&n===t.u||this.Su(xd,F(F({},t),{},{r:e,u:n}))}set_disabled(t){this.fi=t,this.fi?this.remove():this.save()}set_cross_subdomain(t){t!==this.Zu&&(this.Zu=t,this.remove({keepGroupEntries:!0}),this.save())}set_secure(t){t!==this.Ku&&(this.Ku=t,this.remove({keepGroupEntries:!0}),this.save())}set_event_timer(t,e){const n=this.props.__timers||{};n[t]=e,this.Su(Hb,n),this.save()}remove_event_timer(t){const e=this.props.__timers||{},n=e[t];return le(n)||(delete e[t],this.Su(Hb,e),this.save()),n}get_property(t){return this.props[t]}set_property(t,e){this.Su(t,e),this.save()}Su(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.iu=!0),YP(t)&&!fl(s,e)&&this.su.add(t),this.Iu(t,s,e),!((r=Lr(t))===null||r===void 0)&&r.volatile||this.Cu(t))}xu(t,e=!0){delete this.props[t],e&&(B_(t)&&this.pu(t,!0),YP(t)&&this.su.add(t),this.Cu(t))}Cu(t){var e;const n=(e=Lr(t))===null||e===void 0?void 0:e.storageGroup;n&&(this.gu(n).dirty=!0)}gu(t){return this.Ql[t]||(this.Ql[t]={})}};const fi={GZipJS:"gzip-js",Base64:"base64"},kh={Activation:"events",Cancellation:"cancelEvents"},K_={Popover:"popover",API:"api",Widget:"widget"},di={SHOWN:"survey shown",DISMISSED:"survey dismissed",SENT:"survey sent"},G_={SURVEY_ID:"$survey_id",SURVEY_ITERATION:"$survey_iteration",SURVEY_LAST_SEEN_DATE:"$survey_last_seen_date"},Qb={Popover:"popover",Inline:"inline"};function M0(t){let e=!0;return{dispose(){if(e){e=!1;const n=t();n&&Nn(n.then)&&n.then(void 0,()=>{})}}}}const wH={SHOWN:"product tour shown"},QP={TOUR_LAST_SEEN_DATE:"$product_tour_last_seen_date",TOUR_TYPE:"$product_tour_type"},JP=En("[RateLimiter]");var bH=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=>{JP.info(`${r||"events"} is quota limited.`),this.serverLimits[r]=new Date().getTime()+6e4})}catch(r){return void JP.warn(`could not rate limit - continuing. Error: "${r==null?void 0:r.message}"`,{text:n})}},this.instance=t,this.lastEventRateLimited=this.clientRateLimitContext(!0).isRateLimited}get captureEventsPerSecond(){var t;return((t=this.instance.config.rate_limiting)===null||t===void 0?void 0:t.events_per_second)||10}get captureEventsBurstLimit(){var t;return Math.max(((t=this.instance.config.rate_limiting)===null||t===void 0?void 0:t.events_burst_limit)||10*this.captureEventsPerSecond,this.captureEventsPerSecond)}get isClientRateLimited(){return 1>this.tc().tokens}clientRateLimitContext(t=!1){var e;const n=this.tc(),r=1>n.tokens;if(r||t||(n.tokens=Math.max(0,n.tokens-1)),r&&!t){const s=(Bn(n.dropped)?n.dropped:0)+1;n.dropped=s,!this.lastEventRateLimited&&this.ec(s)&&(n.dropped=0)}return this.lastEventRateLimited=r,(e=this.instance.persistence)===null||e===void 0||e.set_property("$capture_rate_limit",n),{isRateLimited:r,remainingTokens:n.tokens}}tc(){var t;const{captureEventsBurstLimit:e,captureEventsPerSecond:n}=this,r=new Date().getTime(),s=(t=this.instance.persistence)===null||t===void 0?void 0:t.get_property(aM),i=s?F({},s):{tokens:e,last:r};return i.tokens+=Math.max(0,r-i.last)/1e3*n,i.last=Math.max(i.last,r),i.tokens>e&&(i.tokens=e),i}nc(t){const e=this.instance.config.property_denylist;return!He(e)||!e.includes(t)}sc(){var t;if(this.nc("$current_url")&&this.nc("$pathname")&&(ln!=null&&ln.pathname))return`${(t=ln.origin)!==null&&t!==void 0?t:""}${ln.pathname}`}ec(t){var e,n;const{captureEventsBurstLimit:r,captureEventsPerSecond:s}=this,i=this.sc(),o=this.nc("$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 hl=En("[RemoteConfig]");var BM=class{constructor(t){this._instance=t}get remoteConfig(){var t;return(t=et._POSTHOG_REMOTE_CONFIG)===null||t===void 0||(t=t[this._instance.config.token])===null||t===void 0?void 0:t.config}rc(t){var e,n,r;!((e=et.__PosthogExtensions__)===null||e===void 0)&&e.loadExternalDependency?(n=et.__PosthogExtensions__)===null||n===void 0||(r=n.loadExternalDependency)===null||r===void 0||r.call(n,this._instance,"remote-config",()=>t(this.remoteConfig)):t()}oc(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 hl.info("Using preloaded remote config",this.remoteConfig),void this.ac(this.remoteConfig);if(this._instance.lc())return void hl.warn("Remote config is disabled. Falling back to local config.");this.rc(t=>{if(!t)return hl.info("No config found after loading remote JS config. Falling back to JSON."),void this.oc(e=>{this.ac(e.json,e)});this.ac(t)})}catch(t){hl.error("Error loading remote config",t),this.ac()}}ac(t,e){!t&&e&&(e.statusCode===0?e.error||hl.warn("Failed to fetch remote config from PostHog."):hl.error("Failed to fetch remote config from PostHog."));try{this._instance.ac(t?{ok:!0,config:t}:{ok:!1})}catch(r){hl.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){hl.error("Error loading feature flags",r)}}},Zi=Uint8Array,Hs=Uint16Array,lf=Uint32Array,PS=new Zi([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]),TS=new Zi([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]),e8=new Zi([16,17,18,0,8,7,9,6,10,5,11,4,12,3,13,2,14,1,15]),WM=function(t,e){for(var n=new Hs(31),r=0;31>r;++r)n[r]=e+=1<<t[r-1];var s=new lf(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]},KM=WM(PS,2),Jb=KM[1];KM[0][28]=258,Jb[258]=28;for(var t8=WM(TS,0)[1],GM=new Hs(32768),Rn=0;32768>Rn;++Rn){var id=(43690&Rn)>>>1|(21845&Rn)<<1;GM[Rn]=((65280&(id=(61680&(id=(52428&id)>>>2|(13107&id)<<2))>>>4|(3855&id)<<4))>>>8|(255&id)<<8)>>>1}var ip=function(t,e,n){for(var r=t.length,s=0,i=new Hs(e);r>s;++s)++i[t[s]-1];var o,l=new Hs(e);for(s=0;e>s;++s)l[s]=l[s-1]+i[s-1]<<1;for(o=new Hs(r),s=0;r>s;++s)o[s]=GM[l[t[s]-1]++]>>>15-t[s];return o},vu=new Zi(288);for(Rn=0;144>Rn;++Rn)vu[Rn]=8;for(Rn=144;256>Rn;++Rn)vu[Rn]=9;for(Rn=256;280>Rn;++Rn)vu[Rn]=7;for(Rn=280;288>Rn;++Rn)vu[Rn]=8;var lv=new Zi(32);for(Rn=0;32>Rn;++Rn)lv[Rn]=5;var xH=ip(vu,9),SH=ip(lv,5),qM=function(t){return(t/8|0)+(7&t&&1)},YM=function(t,e,n){(n==null||n>t.length)&&(n=t.length);var r=new(t instanceof Hs?Hs:t instanceof lf?lf:Zi)(n-e);return r.set(t.subarray(e,n)),r},ha=function(t,e,n){var r=e/8|0;t[r]|=n<<=7&e,t[r+1]|=n>>>8},Eh=function(t,e,n){var r=e/8|0;t[r]|=n<<=7&e,t[r+1]|=n>>>8,t[r+2]|=n>>>16},q_=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 Zi(0),0];if(s==1){var o=new Zi(n[0].s+1);return o[n[0].s]=1,[o,1]}n.sort(function(R,O){return R.f-O.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 m=i[0].s;for(r=1;s>r;++r)i[r].s>m&&(m=i[r].s);var g=new Hs(m+1),_=e2(n[f-1],g,0);if(_>e){r=0;var y=0,b=_-e,x=1<<b;for(i.sort(function(R,O){return g[O.s]-g[R.s]||R.f-O.f});s>r;++r){var S=i[r].s;if(e>=g[S])break;y+=x-(1<<_-g[S]),g[S]=e}for(y>>>=b;y>0;){var E=i[r].s;e>g[E]?y-=1<<e-g[E]++-1:++r}for(;r>=0&&y;--r){var C=i[r].s;g[C]==e&&(--g[C],++y)}_=e}return[new Zi(g),_]},e2=function(t,e,n){return t.s==-1?Math.max(e2(t.l,e,n+1),e2(t.r,e,n+1)):e[t.s]=n},n8=function(t){for(var e=t.length;e&&!t[--e];);for(var n=new Hs(++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]},Ch=function(t,e){for(var n=0,r=0;e.length>r;++r)n+=t[r]*e[r];return n},t2=function(t,e,n){var r=n.length,s=qM(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)},r8=function(t,e,n,r,s,i,o,l,u,d,f){ha(e,f++,n),++s[256];for(var h=q_(s,15),m=h[0],g=h[1],_=q_(i,15),y=_[0],b=_[1],x=n8(m),S=x[0],E=x[1],C=n8(y),R=C[0],O=C[1],I=new Hs(19),A=0;S.length>A;++A)I[31&S[A]]++;for(A=0;R.length>A;++A)I[31&R[A]]++;for(var L=q_(I,7),N=L[0],H=L[1],$=19;$>4&&!N[e8[$-1]];--$);var W,X,z,K,te=d+5<<3,Z=Ch(s,vu)+Ch(i,lv)+o,J=Ch(s,m)+Ch(i,y)+o+14+3*$+Ch(I,N)+(2*I[16]+3*I[17]+7*I[18]);if(Z>=te&&J>=te)return t2(e,f,t.subarray(u,u+d));if(ha(e,f,1+(Z>J)),f+=2,Z>J){W=ip(m,g),X=m,z=ip(y,b),K=y;var q=ip(N,H);for(ha(e,f,E-257),ha(e,f+5,O-1),ha(e,f+10,$-4),f+=14,A=0;$>A;++A)ha(e,f+3*A,N[e8[A]]);f+=3*$;for(var j=[S,R],Y=0;2>Y;++Y){var ue=j[Y];for(A=0;ue.length>A;++A)ha(e,f,q[ie=31&ue[A]]),f+=N[ie],ie>15&&(ha(e,f,ue[A]>>>5&127),f+=ue[A]>>>12)}}else W=xH,X=vu,z=SH,K=lv;for(A=0;l>A;++A)if(r[A]>255){var ie;Eh(e,f,W[257+(ie=r[A]>>>18&31)]),f+=X[ie+257],ie>7&&(ha(e,f,r[A]>>>23&31),f+=PS[ie]);var ce=31&r[A];Eh(e,f,z[ce]),f+=K[ce],ce>3&&(Eh(e,f,r[A]>>>5&8191),f+=TS[ce])}else Eh(e,f,W[r[A]]),f+=X[r[A]];return Eh(e,f,W[256]),f+X[256]},kH=new lf([65540,131080,131088,131104,262176,1048704,1048832,2114560,2117632]),EH=(function(){for(var t=new lf(256),e=0;256>e;++e){for(var n=e,r=9;--r;)n=(1&n&&3988292384)^n>>>1;t[e]=n}return t})(),Y_=function(t,e,n){for(;n;++e)t[e]=n,n>>>=8};function CH(t,e){e===void 0&&(e={});var n=(function(){var h=4294967295;return{p(m){for(var g=h,_=0;m.length>_;++_)g=EH[255&g^m[_]]^g>>>8;h=g},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,m,g,_,y,b){var x=h.length,S=new Zi(_+x+5*(1+Math.floor(x/7e3))+y),E=S.subarray(_,S.length-y),C=0;if(!m||8>x)for(var R=0;x>=R;R+=65535){var O=R+65535;x>O?C=t2(E,C,h.subarray(R,O)):(E[R]=b,C=t2(E,C,h.subarray(R,x)))}else{for(var I=kH[m-1],A=I>>>13,L=8191&I,N=(1<<g)-1,H=new Hs(32768),$=new Hs(N+1),W=Math.ceil(g/3),X=2*W,z=function(St){return(h[St]^h[St+1]<<W^h[St+2]<<X)&N},K=new lf(25e3),te=new Hs(288),Z=new Hs(32),J=0,q=0,j=(R=0,0),Y=0,ue=0;x>R;++R){var ie=z(R),ce=32767&R,he=$[ie];if(H[ce]=he,$[ie]=ce,R>=Y){var ke=x-R;if((J>7e3||j>24576)&&ke>423){C=r8(h,E,0,K,te,Z,q,j,ue,R-ue,C),j=J=q=0,ue=R;for(var ve=0;286>ve;++ve)te[ve]=0;for(ve=0;30>ve;++ve)Z[ve]=0}var pe=2,Ne=0,Ae=L,$e=ce-he&32767;if(ke>2&&ie==z(R-$e))for(var kt=Math.min(A,ke)-1,fn=Math.min(32767,R),on=Math.min(258,ke);fn>=$e&&--Ae&&ce!=he;){if(h[R+pe]==h[R+pe-$e]){for(var Et=0;on>Et&&h[R+Et]==h[R+Et-$e];++Et);if(Et>pe){if(pe=Et,Ne=$e,Et>kt)break;var Gt=Math.min($e,Et-2),vn=0;for(ve=0;Gt>ve;++ve){var Qt=R-$e+ve+32768&32767,Me=Qt-H[Qt]+32768&32767;Me>vn&&(vn=Me,he=Qt)}}}$e+=(ce=he)-(he=H[ce])+32768&32767}if(Ne){K[j++]=268435456|Jb[pe]<<18|t8[Ne];var Qe=31&Jb[pe],Te=31&t8[Ne];q+=PS[Qe]+TS[Te],++te[257+Qe],++Z[Te],Y=R+pe,++J}else K[j++]=h[R],++te[h[R]]}}C=r8(h,E,b,K,te,Z,q,j,ue,R-ue,C)}return YM(S,0,_+qM(C)+y)})(i=t,(o=e).level==null?6:o.level,o.mem==null?Math.ceil(1.5*Math.max(8,Math.min(13,Math.log(i.length)))):12+o.mem,l,u,!0)),f=d.length;return(function(h,m){var g=m.filename;if(h[0]=31,h[1]=139,h[2]=8,h[8]=2>m.level?4:m.level==9?2:0,h[9]=3,m.mtime!=0&&Y_(h,4,Math.floor(new Date(m.mtime||Date.now())/1e3)),g){h[3]=8;for(var _=0;g.length>=_;++_)h[_+10]=g.charCodeAt(_)}})(d,e),Y_(d,f-8,n.d()),Y_(d,f-4,r),d}const PH=!!aS||!!_p,XM=new WeakMap,QM="text/plain";let X_=0,bg=!1;const JM=(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}`:""}`},cy=(t,e,n=!0)=>{var r;const[s,i]=t.split("?"),o=F({},e),l=(r=i==null?void 0:i.split("&").map(d=>{var f;const[h,m]=d.split("="),g=n&&(f=o[h])!==null&&f!==void 0?f:m;return delete o[h],`${h}=${g}`}))!==null&&r!==void 0?r:[],u=(function(d,f="&"){let h,m;const g=[];return Zt(d,function(_,y){le(_)||le(y)||y==="undefined"||(h=encodeURIComponent((b=>b instanceof File)(_)?_.name:_.toString()),m=encodeURIComponent(y),g[g.length]=m+"="+h)}),g.join(f)})(o);return u&&l.push(u),l.length>0?`${s}?${l.join("&")}`:s},Q_=t=>{if(t.cr)return t.cr;const{data:e,compression:n}=t;if(!e)return;if(n===fi.GZipJS){const s=CH((function(i){var o=i.length;if(typeof TextEncoder<"u")return new TextEncoder().encode(i);for(var l=new Zi(i.length+(i.length>>>1)),u=0,d=function(g){l[u++]=g},f=0;o>f;++f){if(u+5>l.length){var h=new Zi(u+8+(o-f<<1));h.set(l),l=h}var m=i.charCodeAt(f);128>m?d(m):2048>m?(d(192|m>>>6),d(128|63&m)):m>55295&&57344>m?(d(240|(m=65536+(1047552&m)|1023&i.charCodeAt(++f))>>>18),d(128|m>>>12&63),d(128|m>>>6&63),d(128|63&m)):(d(224|m>>>12),d(128|m>>>6&63),d(128|63&m))}return YM(l,0,u)})(kd(e)),{mtime:0});return{contentType:QM,body:s.buffer.slice(s.byteOffset,s.byteOffset+s.byteLength),estimatedSize:s.byteLength}}if(n===fi.Base64){const s=(function(o){return o&&btoa(encodeURIComponent(o).replace(/%([0-9A-F]{2})/g,(l,u)=>String.fromCharCode(parseInt(u,16))))})(kd(e)),i=(o=>"data="+encodeURIComponent(typeof o=="string"?o:kd(o)))(s);return{contentType:"application/x-www-form-urlencoded",body:i,estimatedSize:new Blob([i]).size}}const r=kd(e);return{contentType:"application/json",body:r,estimatedSize:new Blob([r]).size}},eL=t=>{const e=()=>t.transport==="sendBeacon"?{url:cy(t.url,{compression:fi.Base64}),encodedBody:Q_(F(F({},t),{},{compression:fi.Base64,cr:void 0}))}:{url:JM(t.url,"compression"),encodedBody:Q_(F(F({},t),{},{compression:void 0,cr:void 0}))};let n;try{n=Q_(t)}catch(s){if(_P(t.compression,of(t.url,"compression")))return ge.error("Failed to gzip request body, sending uncompressed payload",s),e();throw s}return n&&_P(t.compression,of(t.url,"compression"))&&!((r=n.body)instanceof ArrayBuffer?Nb(new Uint8Array(r)):ArrayBuffer.isView(r)&&Nb(new Uint8Array(r.buffer,r.byteOffset,r.byteLength)))?(bg=!0,e()):{url:t.url,encodedBody:n};var r},tL=t=>{try{return eL(t)}catch(n){var e;return ge.error(n),void((e=t.callback)===null||e===void 0||e.call(t,{statusCode:0,error:n}))}},TH=(function(){var t=un(function*(e){const n=yield(function(s){return Db.apply(this,arguments)})(kd(e.data),js.DEBUG,{rethrow:!0});if(!n)return e;const r=yield n.arrayBuffer();return F(F({},e),{},{cr:{contentType:QM,body:r,estimatedSize:r.byteLength}})});return function(e){return t.apply(this,arguments)}})(),nL=t=>IO("AbortError","PostHog request timed out"+(t?` after ${t}ms`:"")),RH=/Failed to fetch|NetworkError|Load failed/i,rL=t=>(t==null?void 0:t.name)==="TypeError"&&RH.test((t==null?void 0:t.message)||""),sL=t=>{try{const e=(function(n,r=Date.now(),s=3e5){if(typeof n!="string"||!n)return;const i=n.trim(),o=/^\d+\s*,/.test(i)?i.slice(0,i.indexOf(",")).trim():i;if(/^\d+$/.test(o)){const d=1e3*Math.min(Number(o),s/1e3);return d>0?d:void 0}if(!/^(Mon|Tue|Wed|Thu|Fri|Sat|Sun)[a-z]*[ ,]/.test(o))return;const l=/^\w{3} \w{3} /.test(o)?o+" GMT":o,u=Date.parse(l)-r;return Number.isFinite(u)&&u>0?Math.min(u,s):void 0})(t());return le(e)?void 0:Math.min(e,3e4)}catch{return}},iL=t=>{const e=tL(t);if(!e)return;const n=new aS;XM.set(n,!0);const{url:r,encodedBody:s}=e;n.open(t.method||"GET",r,!0);const{contentType:i,body:o}=s??{};Zt(t.headers,function(u,d){n.setRequestHeader(d,u)}),i&&n.setRequestHeader("Content-Type",i),t.timeout&&(n.timeout=t.timeout);let l=!1;n.ontimeout=()=>{l=!0},n.onloadend=()=>{var u;if(l){var d;const h=nL(t.timeout);return ge.warn(h),void((d=t.callback)===null||d===void 0||d.call(t,{statusCode:0,error:h}))}const f={statusCode:n.status,text:n.responseText};if(n.status===200)try{f.json=JSON.parse(n.responseText)}catch{}(u=t.callback)===null||u===void 0||u.call(t,f,sL(()=>n.getResponseHeader("Retry-After")))},n.send(o)},oL=t=>{const e=tL(t);if(!e)return;const{url:n,encodedBody:r}=e,{contentType:s,body:i,estimatedSize:o}=r??{},l=new Headers;Zt(t.headers,function(_,y){l.append(y,_)}),s&&l.append("Content-Type",s);let u=null,d=!1;if(nP){const _=new nP;u={signal:_.signal,timeout:setTimeout(()=>{d=!0;try{_.abort(nL(t.timeout))}catch(y){h(y)}},t.timeout)}}let f=!1;const h=_=>{var y;f||(f=!0,d&&(_==null?void 0:_.name)==="AbortError"||rL(_)?ge.warn(_):ge.error(_),(y=t.callback)===null||y===void 0||y.call(t,{statusCode:0,error:_}))};let m=0;const g=()=>{X_-=m,m=0,u&&clearTimeout(u.timeout)};try{const _=F({method:(t==null?void 0:t.method)||"GET",headers:l,referrerPolicy:"strict-origin",body:i,signal:u==null?void 0:u.signal},t.fetchOptions),y=o??(le(i)?0:void 0);_.keepalive=_.method==="POST"&&!t.Ol&&_.keepalive!==!1&&_.body===i&&!le(y)&&y>=0&&52428.8>X_+y,_.keepalive&&(m=y,X_+=m),_p(n,_).then(b=>b.text().then(x=>{var S;if(f)return;const E={statusCode:b.status,text:x};if(b.status===200)try{E.json=JSON.parse(x)}catch(C){ge.error(C)}f=!0,g(),(S=t.callback)===null||S===void 0||S.call(t,E,sL(()=>b.headers.get("Retry-After")))})).catch(b=>{g(),h(b)}).finally(g)}catch(_){g(),h(_)}},n2=t=>{try{var e;const{url:n,encodedBody:r}=eL(t),{contentType:s,body:i,estimatedSize:o}=r??{};if(!i)return;const l=i instanceof Blob?i:new Blob([i],{type:s});if(Wr.sendBeacon(n,l))return;const u=He(t.data)?t.data:(e=t.data)===null||e===void 0?void 0:e.batch;if(He(u)&&u.length>1&&(o??0)>16384){const d=Math.ceil(u.length/2),f=h=>He(t.data)?h:F(F({},t.data),{},{batch:h});return n2(F(F({},t),{},{data:f(u.slice(0,d))})),void n2(F(F({},t),{},{data:f(u.slice(d))}))}ge.warn(`Beacon of ~${o??0} bytes was rejected by the browser, falling back to ${_p?"fetch":"XHR"}`),_p?oL(F(F({},t),{},{Ol:!0})):iL(t)}catch(n){ge.warn("Beacon send failed",n)}},s8=(t,e,n,r)=>{const s=r==="query"?e==="POST"?"sent_at":"_":void 0;return cy(n===fi.GZipJS?JM(t,"compression"):t,F(F({},s?{[s]:Date.now().toString()}:{}),n===fi.GZipJS?{}:{compression:n}))},AH=(()=>{const t=[];return _p&&t.push({transport:"fetch",method:oL}),aS&&t.push({transport:"XHR",method:iL}),Wr!=null&&Wr.sendBeacon&&t.push({transport:"sendBeacon",method:n2}),t})();let aL=!PH&&(Ss==null?void 0:Ss.indexOf("MSIE"))===-1&&(Ss==null?void 0:Ss.indexOf("Mozilla"))===-1;function lL(t,e,n){var r,s,i,o;n&&(e=F(F({},e),{},{callback:l=>n(l)})),t.__loaded?aL?t.__request_queue.push(e):t.rateLimiter.isServerRateLimited(e.batchKey)?e.fireCallbackOnDrop&&((i=e.callback)===null||i===void 0||i.call(e,{statusCode:429})):(e.transport=e.transport||t.config.api_transport,e.headers=F(F({},t.config.request_headers),e.headers),e.compression=e.compression==="best-available"?(r=t.compression)!==null&&r!==void 0?r:e.compressionFallback:e.compression,(le(t.config.disable_beacon)?t.config.__preview_disable_beacon:t.config.disable_beacon)&&(e.disableTransport=["sendBeacon"]),e.fetchOptions=e.fetchOptions||t.config.fetch_options,(s=e.onDispatch)===null||s===void 0||s.call(e),((l,u)=>{var d,f,h;const m=F(F({},l),{},{callback:u??(x=>{var S;return(S=l.callback)===null||S===void 0?void 0:S.call(l,x)})});m.timeout=m.timeout||6e4;const g=(d=m.transport)!==null&&d!==void 0?d:"fetch";g==="sendBeacon"&&le(m.compression)&&m.data&&(m.compression=fi.Base64),m.method==="POST"&&m.data&&(m.timestampMode==="capture-body"?m.data=(x=>{var S,E;const C=(He(x)?x:[x]).map(O=>F(F({},O),O.timestamp instanceof Date&&!isNaN(O.timestamp.getTime())?{timestamp:O.timestamp.toISOString()}:{})),R=C[0];return{api_key:(S=R==null||(E=R.properties)===null||E===void 0?void 0:E.token)!==null&&S!==void 0?S:R==null?void 0:R.token,batch:C,sent_at:new Date().toISOString()}})(m.data):m.timestampMode==="body"&&(m.data=((x,S=new Date().toISOString())=>He(x)?x.map(E=>F(F({},E),{},{sent_at:S})):F(F({},x),{},{sent_at:S}))(m.data))),m.url=s8(m.url,m.method,m.compression,m.timestampMode);const _=AH.filter(x=>!m.disableTransport||!x.transport||!m.disableTransport.includes(x.transport)),y=(f=(h=(function(x,S){for(let E=0;x.length>E;E++)if(S(x[E]))return x[E]})(_,x=>x.transport===g))===null||h===void 0?void 0:h.method)!==null&&f!==void 0?f:_[0].method;if(!y)throw new Error("No available transport method");const b=x=>{try{y(x)}catch(E){var S;rL(E)?ge.warn(E):ge.error(E),(S=m.callback)===null||S===void 0||S.call(m,{statusCode:0,error:E})}};g!=="sendBeacon"&&!m.preferSyncCompression&&m.data&&m.compression===fi.GZipJS&&Z7&&typeof Promise<"u"&&!bg?TH(m).then(x=>{b(x)}).catch(x=>{if(wP(x))return bg=!0,void b(F(F({},m),{},{compression:void 0,url:s8(l.url,l.method,void 0,l.timestampMode)}));(S=>{if(!S||typeof S!="object")return!1;const E="name"in S?String(S.name):"";return wP(S)||E===FO})(x)&&(bg=!0),b(m)}):b(m)})(e,(l,u)=>{var d,f,h;t.rateLimiter.checkForLimiting(l),400>l.statusCode||(d=(f=t.config).on_request_error)===null||d===void 0||d.call(f,l),n?n(l,u):(h=e.callback)===null||h===void 0||h.call(e,l)})):e.fireCallbackOnDrop&&((o=e.callback)===null||o===void 0||o.call(e,{statusCode:0}))}var IH=class{constructor(t,e){this.uc=!0,this.cc=[],this.hc=Zo((e==null?void 0:e.flush_interval_ms)||3e3,250,5e3,ge.createLogger("flush interval"),3e3),this.dc=t}enqueue(t){this.cc.push(t),this.vc||this.fc()}unload(){this.gc();const t=this.cc.length>0?this.mc():{},e=Object.values(t);[...e.filter(n=>n.url.indexOf("/e")===0),...e.filter(n=>n.url.indexOf("/e")!==0)].map(n=>{this.yc(F(F({},n),{},{callback:void 0}),"sendBeacon")})}enable(){this.uc=!1,this.fc()}fc(){this.uc||(this.vc=setTimeout(()=>{this.gc(),this.bc()},this.hc))}bc(){if(this.cc.length>0){const t=this.mc();for(const e in t)this.yc(t[e])}}yc(t,e){try{this.dc(t,e)}catch(n){ge.error(n)}}gc(){clearTimeout(this.vc),this.vc=void 0}mc(){const t={},e={};Zt(this.cc,n=>{var r;const s=n,i=((s?s.batchKey:null)||s.url)+(s.batchGroup?`:${s.batchGroup}`:"");le(t[i])&&(t[i]=F(F({},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.cc=[],t}};const OH=["retriesPerformedSoFar"];var MH=class{constructor(t){this._instance=t,this._c=!1,this.wc=3e3,this.cc=[],this.cc=[],this.kc=!0,this.resume()}resume(){if(!le(ae)&&"onLine"in ae.navigator){if(this.kc=ae.navigator.onLine,this.Sc)return;this.Sc=()=>{this.kc=!0,this.bc()},this.xc=()=>{this.kc=!1},Lt(ae,"online",this.Sc),Lt(ae,"offline",this.xc)}}get length(){return this.cc.length}retriableRequest(t,e){let{retriesPerformedSoFar:n}=t,r=jO(t,OH);ya(n)&&(r.url=cy(r.url,{retry_count:n})),lL(this._instance,e?F(F({},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(F({retriesPerformedSoFar:n},r),i);s.statusCode===0&&ge.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.cc.push({retryAt:s,requestOptions:t});let i=`Enqueued failed request for retry in ${r}`;navigator.onLine||(i+=" (Browser is offline)"),ge.warn(i),this._c||(this._c=!0,this.$c())}$c(){if(this.Cc&&clearTimeout(this.Cc),this.cc.length===0)return this._c=!1,void(this.Cc=void 0);this.Cc=setTimeout(()=>{this.kc&&this.cc.length>0&&this.bc(),this.$c()},this.wc)}bc(){const t=Date.now(),e=[],n=this.cc.filter(r=>t>r.retryAt||(e.push(r),!1));if(this.cc=e,n.length>0)for(const{requestOptions:r}of n)this.retriableRequest(r)}unload(){this.Cc&&(clearTimeout(this.Cc),this.Cc=void 0),this._c=!1,le(ae)||(this.Sc&&(ae.removeEventListener("online",this.Sc),this.Sc=void 0),this.xc&&(ae.removeEventListener("offline",this.xc),this.xc=void 0));for(const{requestOptions:t}of this.cc)try{this._instance._send_request(F(F({},t),{},{callback:He(t.data)?void 0:t.callback,transport:"sendBeacon"}))}catch(e){ge.error(e)}this.cc=[]}},LH=class{constructor(t){this._instance=t,this.Tc=()=>{var e,n,r,s;this.Ic||(this.Ic={});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.Ic.lastScrollY=Math.ceil(o),this.Ic.maxScrollY=Math.max(o,(e=this.Ic.maxScrollY)!==null&&e!==void 0?e:0),this.Ic.maxScrollHeight=Math.max(l,(n=this.Ic.maxScrollHeight)!==null&&n!==void 0?n:0),this.Ic.lastContentY=u,this.Ic.maxContentY=Math.max(u,(r=this.Ic.maxContentY)!==null&&r!==void 0?r:0),this.Ic.maxContentHeight=Math.max(d,(s=this.Ic.maxContentHeight)!==null&&s!==void 0?s:0)}}get Mc(){return this._instance.config.scroll_root_selector}getContext(){return this.Ic}resetContext(){const t=this.Ic;return this.Ic=void 0,setTimeout(this.Tc,0),t}startMeasuringScrollPosition(){Lt(ae,"scroll",this.Tc,{capture:!0}),Lt(ae,"scrollend",this.Tc,{capture:!0}),Lt(ae,"resize",this.Tc)}scrollElement(){if(this.Mc){const n=He(this.Mc)?this.Mc:[this.Mc];for(const r of n){var t;const s=ae==null||(t=ae.document)===null||t===void 0?void 0:t.querySelector(r);if(s)return s}return}var e;return ae==null||(e=ae.document)===null||e===void 0?void 0:e.documentElement}Ec(t){var e,n;const r=t==="y"?"scrollTop":"scrollLeft";if(this.Mc){const s=this.scrollElement();return s&&s[r]||0}return ae?t==="y"?ae.scrollY||ae.pageYOffset||((e=ae.document)===null||e===void 0||(e=e.documentElement)===null||e===void 0?void 0:e.scrollTop)||0:ae.scrollX||ae.pageXOffset||((n=ae.document)===null||n===void 0||(n=n.documentElement)===null||n===void 0?void 0:n.scrollLeft)||0:0}scrollY(){return this.Ec("y")}scrollX(){return this.Ec("x")}};const NH=t=>HM(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 i8=class{constructor(t,e,n,r){this.je=s=>{const i=this.Ac();if(i&&i.sessionId===s)return;const o={sessionId:s,props:this.Rc(this._instance)};this.Pc.register({[Gb]:o})},this._instance=t,this.Oc=e,this.Pc=n,this.Rc=r||NH,this.Oc.onSessionId(this.je)}Ac(){return this.Pc.props[Gb]}getSetOnceProps(){var t;const e=(t=this.Ac())===null||t===void 0?void 0:t.props;return e?"r"in e?UM(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 Zt(bS(this.getSetOnceProps()),(e,n)=>{n==="$current_url"&&(n="url"),t[`$session_entry_${Tb(n)}`]=e}),t}},cv=class{on(t,e){return this.Eo[t]||(this.Eo[t]=[]),this.Eo[t].push(e),()=>{this.Eo[t]=this.Eo[t].filter(n=>n!==e)}}emit(t,e){for(const n of this.Eo[t]||[])n(e);for(const n of this.Eo["*"]||[])n(t,e)}constructor(){this.Eo={}}};const od=En("[SessionId]"),o8=864e5;var a8=class{on(t,e){return this.Fc.on(t,e)}constructor(t,e,n){var r;if(this.Dc=null,this.Lc=null,this.Nc=[],this.jc=void 0,this.qc=!1,this.Fc=new cv,this.Bc=(i,o)=>!(!ya(i)||!ya(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.Fr=t.config,this.Pc=t.persistence,this.Be=void 0,this.Xt=void 0,this._sessionStartTimestamp=null,this.zc=void 0,this._sessionActivityTimestamp=null,this.Hc=e||fo,this.Uc=n||fo;const s=this.Fr.persistence_name||this.Fr.token;if(this._sessionTimeoutMs=1e3*Zo(this.Fr.session_idle_timeout_seconds||1800,60,36e3,od.createLogger("session_idle_timeout_seconds"),1800),t.register({$configured_session_timeout_ms:this._sessionTimeoutMs}),this.Wc(),this.Vc="ph_"+s+"_window_id",this.Gc="ph_"+s+"_primary_window_exists",this.Qc()){const i=cn.Ft(this.Vc),o=cn.Ft(this.Gc);i&&!o?this.Be=i:cn.Dt(this.Vc),cn.$t(this.Gc,!0)}!((r=this.Fr.bootstrap)===null||r===void 0)&&r.sessionID&&this.setBootstrapSessionId(this.Fr.bootstrap.sessionID),this.Jc()}get sessionTimeoutMs(){return this._sessionTimeoutMs}onSessionId(t){return le(this.Nc)&&(this.Nc=[]),this.Nc.push(t),this.Xt&&t(this.Xt,this.Be),()=>{this.Nc=this.Nc.filter(e=>e!==t)}}Qc(){return this.Fr.persistence!=="memory"&&!this.Pc.fi&&cn.Ot()}Zc(t){t!==this.Be&&(this.Be=t,this.Qc()&&cn.$t(this.Vc,t))}Kc(){return this.Be?this.Be:this.Qc()?cn.Ft(this.Vc):null}Yc(t){const e=this.Dc;return!Tn(e)&&!Tn(t)&&5e3>Math.abs(t-e)}Xc(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.Yc(e)||(this.Dc=e,this.Pc.register({[bd]:[e,t,n]}))}eh(){var t;const e=(t=this.Fr)===null||t===void 0?void 0:t.persistence_save_debounce_ms;return ya(e)&&e>0}ih(){this.eh()?this.Pc.refreshKey(bd):(this.Pc.flush(),this.Pc.load())}nh(){var t;if(Tn(this._sessionActivityTimestamp)||this._sessionActivityTimestamp===this.Dc)return;this.ih();const[,e,n]=this.sh();e===this.Xt&&n===this._sessionStartTimestamp&&(this.Dc=this._sessionActivityTimestamp,this.Pc.register({[bd]:[this._sessionActivityTimestamp,(t=this.Xt)!==null&&t!==void 0?t:null,this._sessionStartTimestamp]}),this.Pc.flush())}rh(){const[t]=this.sh(),e=ya(t)?t:0,n=ya(this._sessionActivityTimestamp)?this._sessionActivityTimestamp:0;return Math.max(e,n)}oh(t){return this.ih(),this.Bc(t,this.rh())}sh(){const t=this.Pc.props[bd];return He(t)&&t.length===2&&t.push(t[0]),t||[0,null,0]}resetSessionId(){this.Dc=null,this.zc=void 0,clearTimeout(this.ah),this.ah=void 0,this.Xc(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 od.error("Bootstrap sessionID cannot be in the future"):i}catch(i){return void od.error("Invalid sessionID in bootstrap",i)}})(t);return!le(n)&&(e?this.zc={sessionId:t,sessionStartTimestamp:n}:this.Xc(t,new Date().getTime(),n),!0)}destroy(){this.qc=!0,this.nh(),clearTimeout(this.ah),this.ah=void 0,this.jc&&ae&&(ae.removeEventListener(sv,this.jc,{capture:!1}),this.jc=void 0),this.Nc=[]}Jc(){this.jc=()=>{this.nh(),this.Qc()&&cn.Dt(this.Gc)},Lt(ae,sv,this.jc,{capture:!1})}checkAndGetSessionAndWindowId(t=!1,e=null,n=!1){if(this.Fr.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.Lc=r;else if(Tn(this.Lc)||this.Lc>r||r-this.Lc>=1e3){var i,o;(i=(o=this.Pc).syncCookieProperties)===null||i===void 0||i.call(o),this.Lc=r}let[,l,u]=this.sh();const d=!le(s)&&l!==s,f=this.rh();let h=this.Kc();const m=this.zc,g=!!m&&(m.sessionStartTimestamp>r+6e4||r-m.sessionStartTimestamp>o8),_=m?g:ya(u)&&Math.abs(r-u)>o8;let y=!1,b=d,x=!l||!!m;const S=l;let E=!x&&!t&&this.Bc(r,f);if(E&&(E=this.oh(r),E||od.info("cross-tab refresh kept the session alive",{sessionId:l}),[,l,u]=this.sh(),E||(x=!l||!!m)),x||E||_){b=!1;const I=m&&!g;l=I?m.sessionId:this.Hc(),h=this.Uc(),od.info("new session ID assigned",{sessionId:l,windowId:h,bootstrapped:!!I,changeReason:{noSessionId:x,activityTimeout:E,sessionPastMaximumLength:_}}),u=I?m.sessionStartTimestamp:r,this.zc=void 0,y=!0}else h||(h=this.Uc(),y=!0),b=b||l!==S,b&&(od.info("adopted cross-tab session id",{sessionId:l,windowId:h}),y=!0);const C=ya(f)&&t&&!_?f:r,R=ya(u)?u:new Date().getTime();this.Zc(h),this.Xc(l,C,R),t||this.Wc();const O={noSessionId:x,activityTimeout:E,sessionPastMaximumLength:_,crossTabAdoption:b};return y&&this.Nc.forEach(I=>I(l,h,O)),{sessionId:l,windowId:h,sessionStartTimestamp:R,changeReason:y?O:void 0,lastActivityTimestamp:f}}Wc(){this.qc||(clearTimeout(this.ah),this.ah=setTimeout(()=>{if(!this.qc)if(this.oh(new Date().getTime())){const t=this.Xt;this.resetSessionId(),this.Fc.emit("forcedIdleReset",{idleSessionId:t})}else this.Wc()},1.1*this.sessionTimeoutMs))}};const l8=Object.freeze(["2026-08-30","2026-08-29","2026-06-25","2026-05-30","2026-01-30","2025-11-30","2025-05-24"]),cL=function(t,e){if(!t)return!1;const n=t.userAgent;if(n&&sP(n,e))return!0;try{const r=t==null?void 0:t.userAgentData;if(r!=null&&r.brands&&r.brands.some(s=>sP(s==null?void 0:s.brand,e)))return!0}catch{}return!!t.webdriver};function uL(){return(uL=un(function*(){const t=Wr==null?void 0:Wr.userAgentData;if(t!=null&&t.getHighEntropyValues)try{const e=yield t.getHighEntropyValues(["model"]),n=e==null?void 0:e.model;return dt(n)&&n.length>0?n:void 0}catch(e){return void ge.info("Unable to resolve $device_model from userAgentData.getHighEntropyValues",e)}})).apply(this,arguments)}function DH(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 dL(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 uv=(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}},L0=t=>t.toLowerCase(),fL={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=>uv(n,r))),not_regex:(t,e)=>e.every(n=>t.every(r=>!uv(n,r))),icontains:(t,e)=>e.map(L0).some(n=>t.map(L0).some(r=>n.includes(r))),not_icontains:(t,e)=>e.map(L0).every(n=>t.map(L0).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 hL(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=fL[r.operator];return!!i&&i(r.values.map(String),[String(s)])})}function J_(t,e,n){return kd({distinct_id:t,userPropertiesToSet:e,userPropertiesToSetOnce:n})}const r2="custom",c8="i.posthog.com",$H=/^\/static\//,FH=["/s/","/e/","/i/"];var jH=class{constructor(t){this.uh={},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(`.${c8}`,".posthog.com")),e==="https://app.posthog.com"?"https://us.posthog.com":e}get region(){return this.uh[this.apiHost]||(this.uh[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":r2),this.uh[this.apiHost]}hh(t){if(!$H.test(t))return;const e=this.instance.config.asset_host;return typeof e=="string"&&e.trim().replace(/\/$/,"")||void 0}dh(t){const e=Yo(t);return e?e.protocol+"//"+e.host+e.pathname:void 0}fh(t,e,n){if(t==="ui")return n;let r=n;const s=this.instance.config.rewriteRequestPath;if(s){var i;const o=((i=Yo(n))===null||i===void 0?void 0:i.href)||n;r=s(new URL(o)).toString()}if(s&&t==="api"&&FH.some(o=>e.indexOf(o)===0)){const o=this.dh(r);if(o){const l=this.apiHost;let u=this.ph;(u==null?void 0:u.apiHost)===l&&u.rewriteRequestPath===s||(u={apiHost:l,rewriteRequestPath:s,urls:new Set},this.ph=u),u.urls.add(o)}}return r}isIngestionEndpoint(t){const e=this.ph,n=this.dh(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.fh(t,e,this.uiHost+e);if(t==="flags")return this.fh(t,e,this.flagsApiHost+e);if(t==="assets"){const r=this.hh(e);if(r)return this.fh(t,e,`${r}${e}`)}if(this.region===r2)return this.fh(t,e,this.apiHost+e);const n=c8+e;switch(t){case"assets":return this.fh(t,e,`https://${this.region}-assets.${n}`);case"api":return this.fh(t,e,`https://${this.region}.${n}`)}}};const Ut=En("[Surveys]"),pL=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){Ut.error("Failed to persist survey seen state",e)}},zH=[K_.Popover,K_.Widget,K_.API],VH={ignoreConditions:!1,ignoreDelay:!1,displayType:Qb.Popover},HH=En("[PostHog ExternalIntegrations]"),UH={intercom:"intercom-integration",crispChat:"crisp-chat-integration"};var ZH=class{constructor(t){this._instance=t}Bl(t,e){var n,r;(n=et.__PosthogExtensions__)===null||n===void 0||(r=n.loadExternalDependency)===null||r===void 0||r.call(n,this._instance,t,s=>{if(s)return HH.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=et.__PosthogExtensions__)===null||e===void 0||(e=e.integrations)===null||e===void 0)&&e[s])&&this.Bl(UH[s],()=>{var o;(o=et.__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=et.__PosthogExtensions__)===null||n===void 0||(n=n.integrations)===null||n===void 0)&&n[s])&&((r=et.__PosthogExtensions__)===null||r===void 0||(r=r.integrations)===null||r===void 0||(r=r[s])===null||r===void 0||r.stop())}}},mL=class{constructor(t){this.disabled=t===!1;const e=ct(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 s2=()=>typeof window>"u"?void 0:window,Ph=()=>typeof document>"u"?void 0:document,ew="$copy_autocapture",BH=["password","hidden","file","checkbox","button","submit","reset","image"],N0=En("[AutoCapture]");function tw(t,e){return e.length>t?e.slice(0,t)+"...":e}function WH(t){if(t.previousElementSibling)return t.previousElementSibling;let e=t;do e=e.previousSibling;while(e&&!Ui(e));return e}function KH(t,{e,maskAllElementAttributes:n,maskAllText:r,elementAttributeIgnoreList:s,elementsChainAsString:i,disableCaptureUrlHashes:o}){var l,u;if(!Ui(t))return{props:{}};const d=[t],f=new Set([t]);let h=t;for(;h.parentNode&&!or(h,"body")&&1e3>d.length;){if(iv(h.parentNode)){const O=h.parentNode.host;if(f.has(O))break;f.add(O),d.push(O),h=O;continue}if(!Ui(h.parentNode)||f.has(h.parentNode))break;f.add(h.parentNode),d.push(h.parentNode),h=h.parentNode}const m=e.type==="click"&&t.namespaceURI==="http://www.w3.org/2000/svg"?d.findIndex(O=>or(O,"button")||or(O,"a")):-1;m>0&&(r=r||d.slice(0,m+1).some(O=>!Vl(O)||sf(O)));const g=[],_={};let y,b=!1,x=!1;if(Zt(d,O=>{const I=Vl(O);if(or(O,"a")&&!n&&!(s!=null&&s.includes("href"))){const A=O.getAttribute("href");b=!!(I&&A&&Nd(A))&&(o?jl(A):A)}We(iu(O),"ph-no-capture")&&(x=!0),g.push((function(A,L,N,H,$=!1){const W=A.tagName.toLowerCase(),X={tag_name:W};SS.indexOf(W)>-1&&!N&&(X.$el_text=W.toLowerCase()==="a"||W.toLowerCase()==="button"?tw(1024,BP(A)):tw(1024,Sp(A)));const z=iu(A);L||H!=null&&H.includes("class")||0>=z.length||(X.classes=z.filter(function(J){return J!==""})),Zt(A.attributes,function(J){var q;if((!sf(A)||["name","id","class","aria-label"].indexOf(J.name)!==-1)&&!(H!=null&&H.includes(J.name))&&!L&&Nd(J.value)&&(!dt(q=J.name)||q.substring(0,10)!=="_ngcontent"&&q.substring(0,7)!=="_nghost")){let j=J.value;J.name==="class"&&(j=xS(j).join(" ")),X["attr__"+J.name]=tw(1024,J.name==="href"&&$?jl(j):j)}});let K=1,te=1,Z=A;for(;Z=WH(Z);)K++,Z.tagName===A.tagName&&te++;return X.nth_child=K,X.nth_of_type=te,X})(O,n,r,s,o)),Zt((function(A){if(!Vl(A))return{};const L={};return Zt(A.attributes,function(N){if(N.name&&N.name.indexOf("data-ph-capture-attribute")===0){const H=N.name.replace("data-ph-capture-attribute-",""),$=N.value;H&&$&&Nd($)&&(L[H]=$)}}),L})(O),(A,L)=>{({}).hasOwnProperty.call(_,L)||(_[L]=A)})}),x)return{props:{},explicitNoCapture:x};if(m>0&&(t=d[m],g.splice(0,m)),r||(g[0].$el_text=or(t,"a")||or(t,"button")?BP(t):Sp(t)),b){var S,E;g[0].attr__href=b;const O=(S=Yo(b))===null||S===void 0?void 0:S.host,I=(E=s2())===null||E===void 0||(E=E.location)===null||E===void 0?void 0:E.host;O&&I&&O!==I&&(y=b)}return{props:mn((R=e.type,{$event_type:R,$ce_version:1}),i?{}:{$elements:g},{$elements_chain:(C=g,He(C)?(function(O){return O.map(I=>{var A,L;let N="";if(I.tag_name&&(N+=I.tag_name),I.attr_class){I.attr_class.sort();for(const W of I.attr_class)N+=`.${W.replace(/"/g,"")}`}const H=F(F(F(F({},I.text?{text:I.text}:{}),{},{"nth-child":(A=I.nth_child)!==null&&A!==void 0?A:0,"nth-of-type":(L=I.nth_of_type)!==null&&L!==void 0?L:0},I.href?{href:I.href}:{}),I.attr_id?{attr_id:I.attr_id}:{}),I.attributes),$={};return wg(H).sort(([W],[X])=>(function(z,K){return K>z?-1:z>K?1:0})(W,X)).forEach(([W,X])=>$[WP(W.toString())]=WP(X.toString())),N+=":",N+=wg($).map(([W,X])=>`${W}="${X}"`).join(""),N}).join(";")})((function(O){return O.map(I=>{var A,L;const N={text:(A=I.$el_text)===null||A===void 0?void 0:A.slice(0,400),tag_name:I.tag_name,href:(L=I.attr__href)===null||L===void 0?void 0:L.slice(0,2048),attr_class:lH(I),attr_id:I.attr__id,nth_child:I.nth_child,nth_of_type:I.nth_of_type,attributes:{}};return wg(I).filter(([H])=>H.indexOf("attr__")===0).forEach(([H,$])=>N.attributes[H]=$),N})})(C)):"")},!((l=g[0])===null||l===void 0)&&l.$el_text?{$el_text:(u=g[0])===null||u===void 0?void 0:u.$el_text}:{},y&&e.type==="click"?{$external_click_url:y}:{},_),target:t};var C,R}const gL="autocapture";var GH=class{vl(){this.fl=void 0,clearTimeout(this.pl),this.pl=void 0}gl(t){var e;if(!Vl(t))return!0;const n=(e=this.ml().css_selector_ignorelist)!==null&&e!==void 0?e:R0,r=new Set;let s=t;for(;s;){if(r.size>=1e3||r.has(s))return!0;r.add(s);const i=s,o=iu(i);if(We(o,"ph-no-capture")||We(o,"ph-sensitive")||sf(i)||n.some(u=>jh(i,u)))return!0;const l=s.parentNode;s=iv(l)?l.host:l&&Ui(l)?l:null}return!1}yl(t){if(!this.isEnabled||t.type==="pointercancel")return void this.vl();if(t.type==="pointerdown"){var e;this.vl();const r=sp(t);return void(t.isPrimary&&t.button===0&&!t.ctrlKey&&r&&Ui(r)&&(this.fl={target:r,excluded:this.gl(r),id:t.pointerId,x:t.clientX,y:t.clientY,released:!1,distinctId:(e=this.Fa)===null||e===void 0?void 0:e.distinctId}))}const n=this.fl;n&&(t.pointerId!==n.id||Math.abs(t.clientX-n.x)>5||Math.abs(t.clientY-n.y)>5?this.vl():t.type==="pointerup"&&(n.released=!0,this.pl=setTimeout(()=>this.vl(),0)))}bl(t){var e;const n=this.fl;this.vl();const r=sp(t);if(n!=null&&n.released&&n.target.isConnected&&n.distinctId===((e=this.Fa)===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&&(or(r,"html")||or(r,"body"))){var s,i,o;if(n.excluded)return null;const l=(s=this.ml().css_selector_ignorelist)!==null&&s!==void 0?s:R0;return[r,(i=Ph())===null||i===void 0?void 0:i.documentElement,(o=Ph())===null||o===void 0?void 0:o.body].some(u=>{if(!u)return!1;const d=iu(u);return We(d,"ph-no-capture")||We(d,"ph-sensitive")||!Vl(u)||sf(u)||l.some(f=>jh(u,f))})?null:n.target}}constructor(t){this.Na=t,this.name=gL,this._l=!1,this.wl=null,this.kl=!1,this.Sl=new Map,this.xl=!1,this.Fr={enabled:!1,rageclick:!1,maskAllElementAttributes:!1,maskAllText:!1,disableCaptureUrlHashes:!1,remoteRequestsDisabled:!1},this.Ti=!1,this.Na.refresh(this.Fr),this.rageclicks=new mL(this.Fr.rageclick),this.$l=null}setup(t){this.Cl(),this.Fa=t;const e=t.onRemoteConfig(this.onRemoteConfig.bind(this));this.Ti?e.dispose():(this.Za=e,this.startIfEnabled())}dispose(){var t;this.Ti||(this.Ti=!0,this.Fa=void 0,(t=this.Za)===null||t===void 0||t.dispose(),this.Za=void 0,this.Sl.clear(),this.$l=null,this.Tl())}ml(){return this.Na.refresh(this.Fr),this.Fr}Cl(){var t,e;return this.ml(),this.Fr.url_allowlist=(t=this.Fr.url_allowlist)===null||t===void 0?void 0:t.map(n=>new RegExp(n)),this.Fr.url_ignorelist=(e=this.Fr.url_ignorelist)===null||e===void 0?void 0:e.map(n=>new RegExp(n)),this.Fr}Il(){const t=s2(),e=Ph();if(!this.isBrowserSupported())return void N0.info("Disabling Automatic Event Collection because this browser is not supported");if(!t||!e)return;this.Ml=t,this.El=e;const n=this.Al=r=>{r=r||(t==null?void 0:t.event);try{if(r.type==="blur")return void this.vl();if(r.type.indexOf("pointer")===0)return void this.yl(r);const s=r.type==="click"?this.bl(r):void 0;if(Tn(s))return;this.Rl(r,"$autocapture",s)}catch(s){N0.error("Failed to capture event",s)}};if(Lt(t,"blur",n),Lt(e,"submit",n,{capture:!0}),Lt(e,"change",n,{capture:!0}),Lt(e,"click",n,{capture:!0}),Zt(["pointerdown","pointermove","pointerup","pointercancel"],r=>{Lt(e,r,n,{capture:!0})}),this.ml().capture_copied_text){const r=this.Pl=s=>{s=s||(t==null?void 0:t.event);try{this.Rl(s,ew)}catch(i){N0.error("Failed to capture clipboard event",i)}};Lt(e,"copy",r,{capture:!0}),Lt(e,"cut",r,{capture:!0}),Lt(e,"paste",r,{capture:!0})}}Tl(){const t=this.Ml,e=this.El;this.vl(),this.Al&&(t==null||t.removeEventListener("blur",this.Al),Zt(["pointerdown","pointermove","pointerup","pointercancel"],n=>{e==null||e.removeEventListener(n,this.Al,!0)}),e==null||e.removeEventListener("submit",this.Al,!0),e==null||e.removeEventListener("change",this.Al,!0),e==null||e.removeEventListener("click",this.Al,!0),this.Al=void 0),this.Pl&&(e==null||e.removeEventListener("copy",this.Pl,!0),e==null||e.removeEventListener("cut",this.Pl,!0),e==null||e.removeEventListener("paste",this.Pl,!0),this.Pl=void 0),this.Ml=void 0,this.El=void 0,this._l=!1}startIfEnabled(){this.isEnabled||this.vl(),!this.Ti&&this.Fa&&this.isEnabled&&!this._l&&(this.Il(),this._l=!0)}onRemoteConfig(t){if(this.Ti)return;if(this.kl=!0,!t.ok)return void this.startIfEnabled();const e=t.config;e.elementsChainAsString&&(this.xl=e.elementsChainAsString);const n=e.autocapture_opt_out;var r;Es(n)&&((r=this.Fa)===null||r===void 0||r.kv.set("$autocapture_disabled_server_side",n),this.wl=n),this.startIfEnabled()}setElementSelectors(t,e=this){if(this.Ti)return;t.size?this.Sl.set(e,new Set(t)):this.Sl.delete(e);const n=new Set;this.Sl.forEach(r=>{r.forEach(s=>n.add(s))}),this.$l=n}getElementSelectors(t,e){var n;const r=[];return(n=this.$l)===null||n===void 0||n.forEach(s=>{var i;const o=(i=Ph())===null||i===void 0?void 0:i.querySelectorAll(s);o==null||o.forEach(l=>{t!==l&&e!==l||We(r,s)||r.push(s)})}),r}get isEnabled(){var t,e;if(this.Ti)return!1;const n=(t=this.Fa)===null||t===void 0?void 0:t.kv.get(tM),r=this.wl,s=this.ml();if(!s.remoteRequestsDisabled&&!this.kl)return!1;const i=s.remoteRequestsDisabled&&!this.kl;if(Tn(r)&&!Es(n)&&!i)return!1;const o=(e=this.wl)!==null&&e!==void 0?e:!!n;return!!s.enabled&&!o}Rl(t,e="$autocapture",n){if(!this.isEnabled)return void this.vl();let r=n||sp(t);EM(r)&&(r=r.parentNode||null);const s=this.Cl();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()))&&RM(r,s.rageclick)&&this.Rl(t,"$rageclick",n);const o=e===ew,l=o?F(F({},s),{},{dom_event_allowlist:void 0}):s;if(r&&(function(m,g,_,y,b,x){var S;const E=typeof window>"u"?void 0:window;if(!E||ES(m)||_!=null&&_.url_allowlist&&!$P(_.url_allowlist,x)||_!=null&&_.url_ignorelist&&$P(_.url_ignorelist,x))return!1;if(_!=null&&_.dom_event_allowlist){const I=_.dom_event_allowlist;if(I&&!I.some(A=>g.type===A))return!1}const{parentIsUsefulElement:C,targetElementList:R}=AM(m,y);if(!(function(I,A){const L=A==null?void 0:A.element_allowlist;if(le(L))return!0;for(const N of I)if(L.some(H=>N.tagName.toLowerCase()===H))return!0;return!1})(R,_)||!Xb(R,_==null?void 0:_.css_selector_allowlist)||Xb(R,(S=_==null?void 0:_.css_selector_ignorelist)!==null&&S!==void 0?S:R0))return!1;try{const I=E.getComputedStyle(m);if(I&&I.getPropertyValue("cursor")==="pointer"&&g.type==="click")return!0}catch{}const O=m.tagName.toLowerCase();switch(O){case"html":return!1;case"form":return(b||["submit"]).indexOf(g.type)>=0;case"input":case"select":case"textarea":return(b||["change","click"]).indexOf(g.type)>=0;default:return C?(b||["click"]).indexOf(g.type)>=0:(b||["click"]).indexOf(g.type)>=0&&(SS.indexOf(O)>-1||m.getAttribute("contenteditable")==="true")}})(r,t,l,o,o?["copy","cut","paste"]:void 0,{config:{get_current_url:s.getCurrentUrl}})){var u;const{props:m,explicitNoCapture:g,target:_}=KH(r,{e:t,maskAllElementAttributes:s.maskAllElementAttributes,maskAllText:s.maskAllText,elementAttributeIgnoreList:s.element_attribute_ignorelist,elementsChainAsString:this.xl,disableCaptureUrlHashes:s.disableCaptureUrlHashes});if(g)return!1;const y=this.getElementSelectors(r,_);if(y&&y.length>0&&(m.$element_selectors=y),e===ew){const b=t.type||"clipboard";if(b!=="paste"){var d,f;const x=(d=s2())===null||d===void 0||(d=d.getSelection())===null||d===void 0?void 0:d.toString(),S=CM(x);if(!S)return!1;m.$selected_content=S,m.$clipboard_text_length=(f=x==null?void 0:x.length)!==null&&f!==void 0?f:0}m.$copy_type=b}if(e==="$autocapture"&&t.type==="change"&&s.capture_value_css_selector_allowlist&&!s.maskAllText&&(or(h=r,"input")?!We(BH,h.type):or(h,"textarea")||or(h,"select")&&!h.multiple)&&(function(b,x){var S;if(!Vl(b))return!1;const E=(S=x.css_selector_ignorelist)!==null&&S!==void 0?S:R0,C=new Set;let R=b;for(or(b,"select")&&(R=b.options[b.selectedIndex]||b);R;){const O=R,I=iu(O);if(C.size>=1e3||C.has(R)||We(I,"ph-sensitive")||We(I,"ph-no-capture")||E.some(L=>jh(O,L)))return!1;C.add(R);const A=R.assignedSlot||R.parentNode;R=iv(A)?A.host:A&&Ui(A)?A:null}return!0})(r,s)&&!r.querySelector(".ph-no-capture, .ph-sensitive")){const b=s.capture_value_css_selector_allowlist;let x=!1;try{x=Nn(b)?!!b(r):He(b)&&b.some(S=>jh(r,S))}catch(S){N0.error("capture_value_css_selector_allowlist threw",S)}x&&(m.$input_value=r.value)}return(u=this.Fa)===null||u===void 0||u.capture(e,m),!0}var h}isBrowserSupported(){var t;return Nn((t=Ph())===null||t===void 0?void 0:t.querySelectorAll)}};const vL="featureFlags",yL="logs",Cp=()=>{var t;return!(ae==null||(t=ae.performance)===null||t===void 0)&&t.now?ae.performance.now():Date.now()},qH=[50,75,100,150,200,300,400,500,750,1e3,1500,2e3,3e3,5e3,1e4];var YH=class{constructor(t){this._instance=t}initialize(){}get(t){const e=this._instance.persistence;if(typeof t=="string")return e==null?void 0:e.get_property(t);const n={};for(const r of t){const s=e==null?void 0:e.get_property(r);le(s)||(n[r]=s)}return n}set(t,e){var n;(n=this._instance.persistence)===null||n===void 0||n.register(typeof t=="string"?{[t]:e}:t)}remove(t){var e;(e=this._instance.persistence)===null||e===void 0||e.unregister(t)}},XH=class{constructor(t){this.instance=t,this.R=ge,this.kv=new YH(t),this.onSession=e=>M0(this.instance.onSessionId(n=>{try{e(n)}catch(r){this.R.error("Browser extension session listener failed",r)}})),this.onEvent=e=>M0(this.instance._addCaptureHook((n,r)=>{if(r)try{e({event:n,properties:r.properties})}catch(s){this.R.error("Browser extension event listener failed",s)}})),this.onRemoteConfig=e=>{const n=s=>{try{e(s)}catch(i){this.R.error("Browser extension remote config listener failed",i)}},r=this.instance.dr.on("extensionsRemoteConfig",n);return this.instance.vr&&n(this.instance.vr),M0(r)}}get logger(){return this.R}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(pS);return typeof t=="string"?t:void 0}get library(){return{name:js.LIB_NAME,version:js.LIB_VERSION}}get initialPersonProperties(){var t,e;return(t=(e=this.instance.persistence)===null||e===void 0?void 0:e.get_initial_props())!==null&&t!==void 0?t:{}}get groups(){return this.instance.getGroups()}get session(){try{var t,e,n,r,s;const i=(t=this.instance.sessionManager)===null||t===void 0?void 0:t.checkAndGetSessionAndWindowId(!0);return{sessionId:(e=i==null?void 0:i.sessionId)!==null&&e!==void 0?e:"",windowId:(n=i==null?void 0:i.windowId)!==null&&n!==void 0?n:"",sessionStartTimestamp:(r=i==null?void 0:i.sessionStartTimestamp)!==null&&r!==void 0?r:0,lastActivityTimestamp:(s=i==null?void 0:i.lastActivityTimestamp)!==null&&s!==void 0?s:0}}catch{return{sessionId:"",windowId:"",sessionStartTimestamp:0,lastActivityTimestamp:0}}}get isOptedOut(){return this.instance.has_opted_out_capturing()}get canCapture(){return Nn(this.instance.is_capturing)?this.instance.is_capturing():!this.isOptedOut}get isRateLimited(){var t;return!!(!((t=this.instance.rateLimiter)===null||t===void 0)&&t.isClientRateLimited)}get projectToken(){return this.instance.config.token}getExtension(t){let e;switch(t){case vL:case"featureFlagsCommon":e=this.instance.featureFlags;break;case yL:e=this.instance.logs;break;case"surveys":e=this.instance.surveys;break;case gL:e=this.instance.autocapture}return e}capture(t,e,n){if(!n)return this.pr(this.instance.capture(t,e));const r=F({timestamp:n.timestamp,uuid:n.uuid,$set:n.set,$set_once:n.setOnce},n.delivery==="unload"?{transport:"sendBeacon",send_instantly:!0}:{});return this.pr(this.instance.capture(t,e,r))}pr(t){var e;return!le(t)||!(!((e=this.instance.rateLimiter)===null||e===void 0)&&e.lastEventRateLimited)}registerDynamicEventProperties(t){return M0(this.instance.mr(t))}sendRequest(t){var e=this;return un(function*(n,r={}){var s;const i=(s=r.target)!==null&&s!==void 0?s:"api",o=r.query?cy(n,r.query):n,l=e.instance.requestRouter.endpointFor(i,o),u={method:r.method,url:l,data:r.body,headers:r.headers,timeout:r.timeoutMs,fireCallbackOnDrop:!0,transport:r.transport,compression:r.compression,compressionFallback:r.target==="flags"&&r.compression==="best-available"?Pb.Base64:void 0,timestampMode:r.sentAt};return i==="api"&&n==="/i/v1/logs"&&(u.batchKey="logs"),r.transport==="sendBeacon"?(e.instance._send_request(u),{statusCode:202}):new Promise(d=>{var f;if(u.callback=d,i==="flags"&&((f=e.instance.config.metrics)===null||f===void 0?void 0:f.flags)){let h;u.onDispatch=()=>{h=Cp()},u.callback=m=>{le(h)||e.gr(l,m,Cp()-h),d(m)}}e.instance._send_request(u)})}).apply(this,arguments)}gr(t,e,n){try{var r,s,i;const o=e.statusCode||void 0,l={"server.address":((r=(s=Yo(t))===null||s===void 0?void 0:s.hostname)!==null&&r!==void 0?r:t).replace(/^\[(.*)\]$/,"$1")};o&&(l["http.response.status_code"]=o);const u=((f,h)=>f?400>f?void 0:String(f):(h==null?void 0:h.name)==="AbortError"?"timeout":"_OTHER")(o,e.error);u&&(l["error.type"]=u);const d=CS();d&&(l["client.timezone"]=d),(i=this.instance.metrics)===null||i===void 0||i.histogram("posthog.flags.request.duration",n,{unit:"ms",attributes:l,bounds:qH})}catch(o){ge.error("Failed to record the /flags request duration",o)}}};const op={};let nw=0;const ap=()=>{},u8='Consent opt in/out is not valid with cookieless_mode="always" and will be ignored',ad="Surveys module not available",d8="sanitize_properties is deprecated. Use before_send instead",_L="Invalid value for property_denylist config: ",QH=["$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"],JH=["$feature_flag_called","$$heatmap","$snapshot"],f8=t=>t.charAt(0)==="$"&&!We(JH,t),eU=/^[A-Za-z0-9_-]{1,400}$/,h8=/^fb\.[0-9]+\.[0-9]+\.[A-Za-z0-9_-]+(?:\.[A-Za-z0-9_-]+)?$/,p8=/^fb\.[0-9]+\.[0-9]+\.[0-9]+$/,tU=["token","distinct_id",uM],zh="posthog",nU=[...l8].sort()[l8.length-1],rU=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},rw=t=>{var e;return F({api_host:"https://us.i.posthog.com",flags_api_host:null,ui_host:null,asset_host:null,token:"",autocapture:!0,cross_subdomain_cookie:KV(Oe==null?void 0:Oe.location),persistence:"localStorage+cookie",persistence_name:"",cookie_persisted_properties:[],loaded:ap,save_campaign_params:!0,custom_campaign_params:[],custom_blocked_useragents:[],save_referrer:!0,capture_pageleave:"if_capture_pageview",defaults:t??"unset",__preview_deferred_init_extensions:!1,__preview_replay_sync_fetch:!0,__preview_external_dependency_versioned_paths:!1,__preview_cookie_wins_on_conflict:!1,debug:ln&&dt(ln==null?void 0:ln.search)&&ln.search.indexOf("__posthog_debug=true")!==-1||!1,cookie_expiration:365,upgrade:!1,disable_session_recording:!1,disable_persistence:!1,disable_web_experiments:!0,disable_surveys:!1,disable_surveys_automatic_display:!1,disable_conversations:!1,disable_product_tours:!1,disableDeviceModel:!1,reuseAnonymousId:!1,disable_external_dependency_loading:!1,strict_script_versioning:"fallback",enable_recording_console_log:void 0,secure_cookie:(ae==null||(e=ae.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){ge.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:wM,before_send:void 0,get_current_url:void 0,request_queue_config:{flush_interval_ms:3e3},error_tracking:{},_onCapture:ap},(n=>({rageclick:n&&n>="2026-05-30"?{content_ignorelist:kS,ignore_text_selection:!0}:!n||"2025-11-30">n||{content_ignorelist:!0},capture_pageview:!n||"2025-05-24">n||"history_change",session_recording:rU(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))},sU=[["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"]],m8=t=>{const e={};for(const[s,i]of sU)le(t[s])||(e[i]=t[s]);const n=mn({},e,t),r=t.__preview_external_dependency_versioned_paths;return le(r)||(le(t.strict_script_versioning)&&(n.strict_script_versioning=!!r),dt(r)&&le(t.asset_host)&&(n.asset_host=r)),He(t.property_blacklist)&&(le(t.property_denylist)?n.property_denylist=t.property_blacklist:He(t.property_denylist)?n.property_denylist=[...t.property_blacklist,...t.property_denylist]:ge.error(_L+t.property_denylist)),n};var iU=class{constructor(){this.__forceAllowLocalhost=!1}get gh(){return this.__forceAllowLocalhost}set gh(t){ge.error("WebPerformanceObserver is deprecated and has no impact on network capture. Use `_forceAllowLocalhostNetworkCapture` on `posthog.sessionRecording`"),this.__forceAllowLocalhost=t}},lp=class gl{mh(e){if(!e)return;const n=this.yh.indexOf(e);n!==-1&&this.yh.splice(n,1)}bh(e,n){var r;return this.mh(e),this.yh.push(n),(r=n.initialize)===null||r===void 0||r.call(n),n}_h(){return this.config.cookieless_mode==="always"||this.config.cookieless_mode==="on_reject"&&this.consent.isRejected()}wh(){if(this.kh||this.config.reuseAnonymousId||this.config.segment||this._h())return;const e=this.config.persistence==="memory"||this.config.persistence==="sessionStorage";if(!e&&!this.config.disable_persistence||this.Sh)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.kh=!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}`)}xh(){const e=this.persistence;if(!e||this.$h)return;if(this._h())return void(this.config.cookieless_mode==="on_reject"&&this.get_distinct_id()!=="$posthog_cookieless"&&(this.Ch(),this.Th()));if(this.get_distinct_id()!=="$posthog_cookieless")return;this.Ih()||e.load(!0);const n=this.get_distinct_id();if(!n||n==="$posthog_cookieless"){const r=this.config.get_device_id(fo());this.register({distinct_id:r,$device_id:r}),e.set_property(cs,Ra)}this.Ch()}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.Mh=!1,this.Eh=!1,this.webPerformance=new iU,this.Ah=!1,this.version=js.LIB_VERSION,this.Rh=new Set,this.Ph="",this.dr=new cv,this.yh=[],this.Oh=[],this.Fh=!1,this.Sh=!1,this.kh=!1,this.$h=!1,this._calculate_event_properties=this.calculateEventProperties.bind(this),this.config=rw(),this.SentryIntegration=dH,this.sentryIntegration=r=>(function(s,i){const o=MM(s,i);return{name:OM,processEvent:l=>o(l)}})(this,r),this.__request_queue=[],this.__loaded=!1,this.analyticsDefaultEndpoint="/e/",this.Dh=!1,this.Lh=null,this.Nh=null,this.jh=null,this.scrollManager=new LH(this),this.pageViewManager=new qP(this),this.rateLimiter=new bH(this),this.requestRouter=new jH(this),this.consent=new eH(this),this.externalIntegrations=new ZH(this);const n=(e=gl.__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=dt(r)?{[r]:s}:r;this.setPersonProperties(o),i==null||i({})},set_once:(r,s,i)=>{const o=dt(r)?{[r]:s}:r;this.setPersonProperties(void 0,o),i==null||i({})}},this.on("eventCaptured",r=>ge.info(`send "${r==null?void 0:r.event}"`,r))}init(e,n,r){if(r&&r!==zh){var s;const i=(s=op[r])!==null&&s!==void 0?s:new gl;return i._init(e,n,r),op[r]=i,op[zh][r]=i,i}return this._init(e,n,r)}_init(e,n={},r){var s,i,o;const l=dt(e)?e.trim():"";if(!l)return ge.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=rw(n.defaults),n.debug=this.qh(n.debug),this.Bh=n,this.zh=[],n.person_profiles?this.Nh=n.person_profiles:n.process_person&&(this.Nh=n.process_person);const d=rw(n.defaults),f=m8(n),h=mn({},d,f,{name:r,token:l});ct(d.rageclick)&&ct(f.rageclick)&&(h.rageclick=mn({},d.rageclick,f.rageclick)),ct(d.session_recording)&&ct(f.session_recording)&&(h.session_recording=mn({},d.session_recording,f.session_recording)),this.set_config(h),this.config.on_xhr_error&&ge.error("on_xhr_error is deprecated. Use on_request_error instead"),this.compression=n.disable_compression?void 0:fi.GZipJS;const m=this.Ih(),g=!this._h();if(this.persistence=new W_(this.config,m,!0,g),this.sessionPersistence=this.config.persistence==="sessionStorage"||this.config.persistence==="memory"?this.persistence:new W_(F(F({},this.config),{},{persistence:"sessionStorage"}),m,!1,g),this.Ph="ph_"+(this.config.persistence_name||this.config.token)+"_session_registered_properties",this.config.persistence!=="memory"&&!m&&cn.Ot()){const S=cn.Ft(this.Ph);He(S)&&S.forEach(E=>{dt(E)&&this.Rh.add(E)})}else cn.Dt(this.Ph);const _=F({},this.persistence.props),y=F({},this.sessionPersistence.props);this.register({$initialization_time:new Date().toISOString()}),this.Hh=new IH((S,E)=>this.Uh(S,E),this.config.request_queue_config),this.Wh=new MH(this),this.__request_queue=[];const b=this._h();b||(this.sessionManager=new a8(this),this.sessionPropsManager=new i8(this,this.sessionManager,this.persistence),this.sessionManager.onSessionId((S,E,C)=>{(C!=null&&C.activityTimeout||C!=null&&C.sessionPastMaximumLength||C!=null&&C.crossTabAdoption)&&this.Vh()})),this.Gh(),this.config.__preview_deferred_init_extensions?(ge.info("Deferring extension initialization to improve startup performance"),this.Qh=setTimeout(()=>{this.Qh=void 0,this.Jh(b)},0)):(ge.info("Initializing extensions synchronously"),this.Jh(b)),js.DEBUG=js.DEBUG||this.config.debug,js.DEBUG&&ge.info("Starting in debug mode",{this:this,config:n,thisC:F({},this.config),p:_,s:y}),this.config.identity_distinct_id&&!(!((s=n.bootstrap)===null||s===void 0)&&s.distinctID)&&(n.bootstrap=F(F({},n.bootstrap),{},{distinctID:this.config.identity_distinct_id,isIdentifiedID:!0}));const x=(i=n.bootstrap)===null||i===void 0?void 0:i.distinctID;if(this.Sh=!!x&&!Xh(x),(o=n.bootstrap)===null||o===void 0?void 0:o.distinctID){const S=n.bootstrap.distinctID,E=this.get_distinct_id(),C=this.persistence.get_property(cs);if(n.bootstrap.isIdentifiedID&&E!=null&&E!==S&&C==="anonymous")this.identify(S);else if(n.bootstrap.isIdentifiedID&&E!=null&&E!==S&&C==="identified")ge.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 R=this.config.get_device_id(fo()),O=n.bootstrap.isIdentifiedID?R:S;this.persistence.set_property(cs,n.bootstrap.isIdentifiedID?_g:Ra),this.register({distinct_id:S,$device_id:O})}}if(b)this.register_once({distinct_id:$_,$device_id:null},"");else if(!this.get_distinct_id()){const S=this.config.get_device_id(fo());this.register_once({distinct_id:S,$device_id:S},""),this.persistence.set_property(cs,Ra)}return Lt(ae,"onpagehide"in self?"pagehide":"unload",this._handle_unload.bind(this),{passive:!1}),Lt(ae,"pageshow",S=>{if(this.Mh=!1,!this.Eh){var E;if(S.persisted&&this.persistence){const C=this.persistence.get_property(Di),R=this.persistence.get_property(cs);this.persistence.load(),this.Zh()||C===this.persistence.get_property("distinct_id")&&R===this.persistence.get_property("$user_state")||this.Kh()}(E=this.Wh)===null||E===void 0||E.resume()}}),n.segment?GP(this,()=>this.Yh()):this.Yh(),Nn(this.config._onCapture)&&this.config._onCapture!==ap&&(ge.warn("onCapture is deprecated. Please use `before_send` instead"),this.on("eventCaptured",S=>this.config._onCapture(S.event,S))),this.config.ip&&ge.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 uL.apply(this,arguments)})().then(S=>{S&&this.register({[D_]:S})}).catch(ap),this}Xh(e){const n=e;return dt(n.name)&&Nn(n.setup)}ed(e,n){var r=this;this.Xh(e)?n.push(un(function*(){try{yield e.setup(r.nd())}catch(i){ge.error(`Failed to set up extension "${e.name}"`,i);try{var s;yield(s=e.dispose)===null||s===void 0?void 0:s.call(e)}catch(o){ge.error(`Failed to dispose extension "${e.name}"`,o)}}})):this.yh.push(e)}Gh(){var e,n,r,s=this;const i=(e=(n=this.config.__extensionClasses)===null||n===void 0?void 0:n.featureFlags)!==null&&e!==void 0?e:(r=gl.__defaultExtensionClasses)===null||r===void 0?void 0:r.featureFlags;var o,l,u;if(i)if(this.featureFlags&&this.featureFlags instanceof i||((o=this.sd)===null||o===void 0||o.call(this),this.sd=void 0,this.featureFlags=new i(this)),Nn(this.featureFlags.onReloading)&&Nn(this.featureFlags.setup)){if(!this.sd){this.sd=this.featureFlags.onReloading(()=>{this.dr.emit("featureFlagsReloading",!0)});const d=this.featureFlags;un(function*(){try{yield d.setup(s.nd())}catch(f){ge.error("Failed to set up feature flags",f);const h=s.sd;s.sd=void 0;try{h==null||h()}catch(m){ge.error("Failed to unsubscribe feature flag reloading",m)}try{yield d.dispose()}catch(m){ge.error("Failed to dispose feature flags",m)}}})()}}else(l=(u=this.featureFlags).initialize)===null||l===void 0||l.call(u)}Jh(e){const n=performance.now(),r=F(F({},gl.__defaultExtensionClasses),this.config.__extensionClasses),s=[];var i,o,l,u,d,f,h,m;r.exceptions&&this.yh.push(this.exceptions=(i=this.exceptions)!==null&&i!==void 0?i:new r.exceptions(this)),r.historyAutocapture&&this.yh.push(this.historyAutocapture=new r.historyAutocapture(this)),r.tracingHeaders&&this.yh.push(this.tracingHeaders=new r.tracingHeaders(this)),r.siteApps&&this.yh.push(this.siteApps=new r.siteApps(this)),r.sessionRecording&&!e&&this.yh.push(this.sessionRecording=new r.sessionRecording(this)),this.config.disable_scroll_properties||s.push(()=>{this.scrollManager.startMeasuringScrollPosition()}),r.autocapture&&this.ed(this.autocapture=new r.autocapture(this),s),r.surveys&&this.ed(this.surveys=(o=this.surveys)!==null&&o!==void 0?o:new r.surveys(this),s),r.logs&&this.ed(this.logs=(l=this.logs)!==null&&l!==void 0?l:new r.logs(this),s),r.metrics&&this.yh.push(this.metrics=(u=this.metrics)!==null&&u!==void 0?u:new r.metrics(this)),r.conversations&&this.yh.push(this.conversations=(d=this.conversations)!==null&&d!==void 0?d:new r.conversations(this)),r.productTours&&this.yh.push(this.productTours=new r.productTours(this)),r.heatmaps&&this.yh.push(this.heatmaps=new r.heatmaps(this)),r.webVitalsAutocapture&&this.yh.push(this.webVitalsAutocapture=new r.webVitalsAutocapture(this)),r.exceptionObserver&&this.yh.push(this.exceptionObserver=new r.exceptionObserver(this)),r.deadClicksAutocapture&&this.yh.push(this.deadClicksAutocapture=new r.deadClicksAutocapture(this,uH)),r.toolbar&&this.yh.push(this.toolbar=(f=this.toolbar)!==null&&f!==void 0?f:new r.toolbar(this)),r.experiments&&this.yh.push(this.experiments=(h=this.experiments)!==null&&h!==void 0?h:new r.experiments(this)),r.webMCP&&this.yh.push(this.webMCP=(m=this.webMCP)!==null&&m!==void 0?m:new r.webMCP(this)),this.yh.forEach(g=>{g.initialize&&s.push(()=>{var _;(_=g.initialize)===null||_===void 0||_.call(g)})}),s.push(()=>{if(this.rd){const g=this.rd;this.rd=void 0,this.yh.forEach(_=>{var y;return(y=_.onRemoteConfig)===null||y===void 0?void 0:y.call(_,g)})}}),this.od(s,n)}od(e,n){for(;e.length>0;){if(this.config.__preview_deferred_init_extensions&&performance.now()-n>=30&&e.length>0)return void(this.Qh=setTimeout(()=>{this.Qh=void 0,this.od(e,n)},0));const s=e.shift();if(s)try{s()}catch(i){ge.error("Error initializing extension:",i)}}const r=Math.round(performance.now()-n);this.register_for_session({[dM]:this.config.__preview_deferred_init_extensions?"deferred":"synchronous",[fM]:r}),this.config.__preview_deferred_init_extensions&&ge.info(`PostHog extensions initialized (${r}ms)`)}ac(e){if(!Oe||!Oe.body)return ge.info("document not ready yet, trying again in 500 milliseconds..."),void setTimeout(()=>{this.ac(e)},500);if(this.config.__preview_deferred_init_extensions&&(this.rd=e),this.vr=e,this.compression=void 0,e.ok){var n;const r=e.config;r.supportedCompression&&!this.config.disable_compression&&(this.compression=We(r.supportedCompression,fi.GZipJS)?fi.GZipJS:We(r.supportedCompression,fi.Base64)?fi.Base64:void 0),!((n=r.analytics)===null||n===void 0)&&n.endpoint&&(this.analyticsDefaultEndpoint=r.analytics.endpoint)}this.set_config({person_profiles:this.Nh?this.Nh:wM}),this.dr.emit("extensionsRemoteConfig",e),this.yh.forEach(r=>{var s;return(s=r.onRemoteConfig)===null||s===void 0?void 0:s.call(r,e)})}Yh(){try{this.config.loaded(this)}catch(e){ge.critical("`loaded` function failed",e)}if(this.ad(),this.config.internal_or_test_user_hostname&&(ln==null?void 0:ln.hostname)){const e=ln.hostname,n=this.config.internal_or_test_user_hostname;(typeof n=="string"?e===n:n.test(e))&&this.setInternalOrTestUser()}this.config.capture_pageview&&setTimeout(()=>{(this.consent.isOptedIn()||this._h())&&this.ld()},1),this.ud=new BM(this),this.ud.load()}ad(){var e;this.is_capturing()&&this.config.request_batching&&((e=this.Hh)===null||e===void 0||e.enable())}_dom_loaded(){this.is_capturing()&&Sd(this.__request_queue,e=>this.Uh(e)),this.__request_queue=[],this.ad()}_handle_unload(){var e,n,r,s,i,o;this.Mh=!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.hd()&&this.capture(RP),(s=this.logs)===null||s===void 0||s.flushLogs("sendBeacon"),(i=this.Hh)===null||i===void 0||i.unload(),(o=this.Wh)===null||o===void 0||o.unload()):this.hd()&&this.capture(RP,null,{transport:"sendBeacon"})}_send_request(e){lL(this,e)}Uh(e,n){this.Wh?this.Wh.retriableRequest(e,n):this._send_request(n?F(F({},e),{},{transport:n}):e)}_execute_array(e){nw++;try{let n;const r=[],s=[],i=[];Sd(e,l=>{if(l)if(n=l[0],He(n))i.push(l);else if(Nn(l))try{l.call(this)}catch(u){ge.error("Error executing queued PostHog call",l,u)}else He(l)&&n==="alias"?r.push(l):He(l)&&n.indexOf("capture")!==-1&&Nn(this[n])?i.push(l):s.push(l)});const o=function(l,u){Sd(l,function(d){try{if(He(d[0])){let f=u;Zt(d,function(h){f=f[h[0]].apply(f,h.slice(1))})}else u[d[0]].apply(u,d.slice(1))}catch(f){ge.error("Error executing queued PostHog call",d,f)}})};o(r,this),o(s,this),o(i,this)}finally{nw--}}push(e){if(nw>0&&He(e)&&dt(e[0])){const n=gl.prototype[e[0]];return void(Nn(n)&&n.apply(this,e.slice(1)))}this._execute_array([e])}get dd(){return{property:PP,persistenceKey:Ld,cookieName:"_fbc",pattern:h8,register:(e,n)=>{var r;return(r=this.persistence)===null||r===void 0?void 0:r.register({[Ld]:{value:e,delivered:n}})},unregister:()=>{var e;return(e=this.persistence)===null||e===void 0?void 0:e.unregister(Ld)}}}get vd(){return{property:TP,persistenceKey:ep,cookieName:"_fbp",pattern:p8,register:(e,n)=>{var r;return(r=this.persistence)===null||r===void 0?void 0:r.register({[ep]:{value:e,delivered:n}})},unregister:()=>{var e;return(e=this.persistence)===null||e===void 0?void 0:e.unregister(ep)}}}fd(e){var n;const r=(n=this.persistence)===null||n===void 0?void 0:n.get_property(e.persistenceKey);return dt(r)&&e.pattern.test(r)?{value:r,delivered:!1}:ct(r)&&dt(r.value)&&e.pattern.test(r.value)?{value:r.value,delivered:r.delivered===!0}:void 0}pd(e,n,r){return n===(r==null?void 0:r.value)?{value:n,pending:!r.delivered}:(e.register(n,!1),{value:n,pending:!0})}gd(e){if(!this.config.save_campaign_params||this._h())return;const n=np(e.cookieName);return dt(n)&&e.pattern.test(n)?n:void 0}md(e,n,r,s){if(!this.persistence)return;const i=this.dd;this.persistence.refreshMetaIdentifiers();const o=this.fd(i);if(s)return void i.unregister();if(r)return dt(n)&&h8.test(n)?this.pd(i,n,o):void i.unregister();const l=dt(e)&&eU.test(e)?e:void 0,u=this.gd(i);return u&&((d,f,h)=>{const m=d.split(".");if(f)return m[3]===f;if(!h)return!0;const g=h.value.split(".");return m[3]===g[3]||Number(m[2])>Number(g[2])})(u,l,o)?this.pd(i,u,o):l?(o==null?void 0:o.value.split(".")[3])===l?{value:o.value,pending:!o.delivered}:this.pd(i,`fb.1.${Date.now()}.${l}`,o):o?{value:o.value,pending:!o.delivered}:void 0}yd(e,n,r){if(!this.persistence)return;const s=this.vd;this.persistence.refreshMetaIdentifiers();const i=this.fd(s);if(r)return void s.unregister();if(n)return dt(e)&&p8.test(e)?this.pd(s,e,i):void s.unregister();const o=this.gd(s);return o?this.pd(s,o,i):i?{value:i.value,pending:!i.delivered}:void 0}bd(e,n){if(!this.persistence)return;this.persistence.refreshMetaIdentifiers();const r=this.fd(e);(r==null?void 0:r.value)!==n||r.delivered||e.register(n,!0)}capture(e,n,r){var s,i,o;if(!(this.__loaded&&this.persistence&&this.sessionPersistence&&this.Hh))return void ge.uninitializedWarning("posthog.capture");if(!this.is_capturing())return void ge.info(`Event "${e}" was not captured because capturing is disabled (opted out or consent pending).`);if(le(e)||!dt(e))return void ge.error("No event name provided to posthog.capture");if(this.xh(),e==="$snapshot"&&this._h())return;const l=!this.config.opt_out_useragent_filter&&this._is_bot();if(l&&!this.config.__preview_capture_bot_pageviews)return void ge.info(`Event "${e}" was not captured because the user agent looks like a bot. Set \`opt_out_useragent_filter: true\` to capture it.`);const u=r!=null&&r.skip_client_rate_limiting?void 0:this.rateLimiter.clientRateLimitContext();if(u!=null&&u.isRateLimited)return void ge.critical("This capture call is ignored due to client rate limiting.");let d;n!=null&&n.$current_url&&!dt(n==null?void 0:n.$current_url)&&(ge.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._d||ge.warn("Using `posthog.capture('$exception')` is unreliable because it does not attach required metadata. Use `posthog.captureException(error)` instead, which attaches required metadata automatically."),this.sessionPersistence.update_search_keyword(),this.config.save_campaign_params&&(d=this.sessionPersistence.update_campaign_params()),this.config.save_referrer&&this.sessionPersistence.update_referrer_info(),(this.config.save_campaign_params||this.config.save_referrer)&&this.persistence.set_initial_person_info();const f=new Date,h=(r==null?void 0:r.timestamp)||f,m=lP(r==null?void 0:r.uuid,fo);let g={uuid:m,event:e,properties:this.calculateEventProperties(e,n||{},h,m)};e==="$pageview"&&this.config.__preview_capture_bot_pageviews&&l&&(g.event="$bot_pageview",g.properties.$browser_type="bot"),u&&(g.properties.$lib_rate_limit_remaining_tokens=u.remainingTokens);const _=e==="$feature_flag_called"&&g.properties.$feature_flag_has_experiment===!1&&this.get_property("$minimal_flag_called_events")===!0;r!=null&&r.$set&&!_&&(g.$set=r==null?void 0:r.$set);const y=ct(n==null?void 0:n.$set)?n.$set:void 0,b=He(n==null?void 0:n.$unset)?n.$unset:[],x=(r==null?void 0:r.$unset)||[],S=z=>{var K;const te=!!(r!=null&&r.$set)&&z in r.$set;return{hasProvided:te||!!y&&z in y,provided:te?r==null||(K=r.$set)===null||K===void 0?void 0:K[z]:y==null?void 0:y[z],unset:b.indexOf(z)!==-1||x.indexOf(z)!==-1}},E=S(PP),C=S(TP),R=[{channel:this.dd,hasProvided:E.hasProvided,update:this.md(d==null?void 0:d.fbclid,E.provided,E.hasProvided,E.unset)},{channel:this.vd,hasProvided:C.hasProvided,update:this.yd(C.provided,C.hasProvided,C.unset)}];for(const{channel:z,hasProvided:K,update:te}of R)te&&g.properties.$process_person_profile===!0&&te.pending&&!K&&!_&&(g.$set=F({[z.property]:te.value},g.$set));const O=r==null?void 0:r.$unset;O&&(g.$unset=O);const I=_?void 0:this.wd(r==null?void 0:r.$set_once,e!==AP,e===bM);if(I&&(g.$set_once=I),r!=null&&r._noTruncate||(A=this.config.properties_string_max_length,g=(function(z,K){const te=new Set;return(function Z(J,q){if(J!==Object(J))return K?K(J):J;if(te.has(J))return;let j;if(te.add(J),He(J))j=[],Sd(J,Y=>{j.push(Z(Y))});else{const Y={};Zt(Mf(J)?xM(J):J,(ue,ie)=>{te.has(ue)||(Y[ie]=Z(ue))}),j=Y}return j})(z)})(g,z=>dt(z)?z.slice(0,A):z)),g.timestamp=h,le(r==null?void 0:r.timestamp)||(g.properties.$event_time_override_provided=!0,g.properties.$event_time_override_system_time=f),_&&(g.properties=((z,K=[])=>{const te={},Z=J=>{z[J]!==void 0&&(te[J]=z[J])};return Fz.forEach(Z),K.forEach(Z),te})(g.properties,tU)),e===di.DISMISSED||e===di.SENT){const z=n==null?void 0:n[G_.SURVEY_ID],K=n==null?void 0:n[G_.SURVEY_ITERATION];pL({id:z,current_iteration:K}),g.$set=F(F({},g.$set),{},{[DH({id:z,current_iteration:K},e===di.SENT?"responded":"dismissed")]:!0})}else e===di.SHOWN&&(g.$set=F(F({},g.$set),{},{[G_.SURVEY_LAST_SEEN_DATE]:new Date().toISOString()}));var A;if(e===wH.SHOWN){const z=n==null?void 0:n[QP.TOUR_TYPE];z&&(g.$set=F(F({},g.$set),{},{[`${QP.TOUR_LAST_SEEN_DATE}/${z}`]:new Date().toISOString()}))}const L=F(F({},g.properties.$set),g.$set);if(zs(L)||this.setPersonPropertiesForFlags(L),!ot(this.config.before_send)){const z=this.Fs(g);if(!z)return;g=z,g.uuid=lP(g.uuid,fo)}this.sessionRecording&&!this.Fh&&f8(e)&&(this.Fh=!0,setTimeout(()=>this.Fh=!1,3e4));const N=R.filter(({channel:z,update:K})=>{var te,Z,J;const q=(te=(Z=g.$set)===null||Z===void 0?void 0:Z[z.property])!==null&&te!==void 0?te:ct((J=g.properties)===null||J===void 0?void 0:J.$set)?g.properties.$set[z.property]:void 0;return(K==null?void 0:K.pending)&&q===K.value});this.dr.emit("eventCaptured",g);const H=(s=r==null?void 0:r._url)!==null&&s!==void 0?s:this.requestRouter.endpointFor("api",this.analyticsDefaultEndpoint),$=(r==null?void 0:r._batchKey)==="recordings"||/\/s\/(?:\?|$)/.test(H),W=F(F(F({method:"POST",url:H,data:g,compression:"best-available",preferSyncCompression:r==null?void 0:r.send_instantly,timestampMode:$?"body":"capture-body",batchKey:r==null?void 0:r._batchKey},$&&(!((i=g.properties)===null||i===void 0)&&i.$session_id)?{batchGroup:g.properties.$session_id+(g.properties.$window_id?`-${g.properties.$window_id}`:"")}:{}),r!=null&&r.transport?{transport:r.transport}:{}),N.length?{fireCallbackOnDrop:!0,callback:z=>{if(z.statusCode>=200&&300>z.statusCode)for(const{channel:K,update:te}of N)this.bd(K,te.value)}}:{});if(!this.config.request_batching||r&&!(r!=null&&r._batchKey)||r!=null&&r.send_instantly){var X;let z;!W.transport&&!W.callback&&zs((X=this.config.request_headers)!==null&&X!==void 0?X:{})&&this.Mh&&(z="sendBeacon"),this.Uh(W,z)}else this.Hh.enqueue(W);return(o=this.featureFlags)===null||o===void 0||o.sendFlagCallsPendingCapture(),g}_addCaptureHook(e){return this.on("eventCaptured",n=>e(n.event,n))}getExtension(e){var n;return(n=this.kd)===null||n===void 0?void 0:n.getExtension(e)}nd(){var e;return(e=this.kd)!==null&&e!==void 0?e:this.kd=new XH(this)}mr(e){this.Oh.push(e);let n=!0;return()=>{if(!n)return;n=!1;const r=this.Oh.indexOf(e);r!==-1&&this.Oh.splice(r,1)}}Zh(e=!0){var n;return!!(!((n=this.persistence)===null||n===void 0)&&n.consumeCookieIdentityChange())&&(this.Kh(e),!0)}Kh(e=!0){var n,r,s;this.jh=null,((n=this.persistence)===null||n===void 0?void 0:n.get_property("$user_state"))==="anonymous"&&((s=this.sessionPersistence)===null||s===void 0||s.clear(),this.Rh.clear(),this.Sd()),(r=this.featureFlags)===null||r===void 0||r.reset(),e&&this.reloadFeatureFlags()}calculateEventProperties(e,n,r,s,i){if(r=r||new Date,!this.persistence||!this.sessionPersistence)return n;this.xh(),this.persistence.syncCookieProperties(),this.Zh();const o=i?void 0:this.persistence.remove_event_timer(e);let l=F({},n);if(l.token=this.config.token,l.$config_defaults=this.config.defaults==="latest"?nU:this.config.defaults,this._h()&&(l[uM]=!0),e==="$snapshot"){const S=F(F({},this.persistence.properties()),this.sessionPersistence.properties());return l.distinct_id=S.distinct_id,(!dt(l.distinct_id)&&!Bn(l.distinct_id)||Xh(l.distinct_id))&&ge.error("Invalid distinct_id for replay event. This indicates a bug in your implementation"),l}const u=(function(S,E,C,R=!1){var O,I,A,L;if(!Ss)return{};const N=S?[...af,...E||[]]:[],[H,$]=PO(Ss),[W,X]=(function(ie){for(let ce=0;aP.length>ce;ce++){const[he,ke,ve]=aP[ce],pe=ie.match(he);if(pe){const Ne=ve&&ie.match(ve)||pe;return[ke,(Ne==null?void 0:Ne[1])||""]}}return["",""]})(Ss),z=(function(){const ie="u">typeof navigator?navigator:void 0;return ie!=null&&ie.brave?{brave:!0}:{}})(),K={};le(C)||(K.detectGoogleSearchApp=C);const te={},Z=(O=navigator)===null||O===void 0||(O=O.userAgentData)===null||O===void 0?void 0:O.platform,J=(I=navigator)===null||I===void 0?void 0:I.maxTouchPoints,q=ae==null||(A=ae.screen)===null||A===void 0?void 0:A.width,j=ae==null||(L=ae.screen)===null||L===void 0?void 0:L.height,Y=ae==null?void 0:ae.devicePixelRatio;le(Z)||(te.userAgentDataPlatform=Z),le(J)||(te.maxTouchPoints=J),le(q)||(te.screenWidth=q),le(j)||(te.screenHeight=j),le(Y)||(te.devicePixelRatio=Y);const ue=mn(bS({$os:H,$os_version:$,$browser:CO(Ss,navigator.vendor,z,K),$webview_app:W,$webview_app_version:X,$device:TO(Ss),$device_type:oz(Ss,te),$timezone:CS(),$timezone_offset:vH()}),{$current_url:kp(R?jl(ln==null?void 0:ln.href):ln==null?void 0:ln.href,N,Ep),$host:ln==null?void 0:ln.host,$pathname:ln==null?void 0:ln.pathname,$raw_user_agent:Ss.length>1e3?Ss.substring(0,997)+"...":Ss,$browser_version:iz(Ss,navigator.vendor,z,K),$browser_language:zM(),$browser_language_prefix:gH(),$screen_height:ae==null?void 0:ae.screen.height,$screen_width:ae==null?void 0:ae.screen.width,$viewport_height:ae==null?void 0:ae.innerHeight,$viewport_width:ae==null?void 0:ae.innerWidth,$lib:Ia.LIB_NAME,$lib_version:Ia.LIB_VERSION,$insert_id:Math.random().toString(36).substring(2,10)+Math.random().toString(36).substring(2,10),$time:Date.now()/1e3});return Ia.SDK_DIST_CHANNEL&&(ue.$sdk_dist_channel=Ia.SDK_DIST_CHANNEL),ue})(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:S,windowId:E}=this.sessionManager.checkAndGetSessionAndWindowId(i,r.getTime(),!0);l.$session_id=S,l.$window_id=E}this.sessionPropsManager&&mn(l,this.sessionPropsManager.getSessionProps());try{var d;if(this.sessionRecording){const S=this.sessionRecording.sdkDebugProperties,E=!this.Fh&&f8(e);for(const C in S)(E||We(QH,C))&&(l[C]=S[C])}l.$sdk_debug_retry_queue_size=(d=this.Wh)===null||d===void 0?void 0:d.length}catch(S){l.$sdk_debug_error_capturing_properties=String(S)}let f;if(this.requestRouter.region===r2&&(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=mn(l,f),e==="$pageview"&&Oe&&(l.title=Oe.title),!le(o)){const S=r.getTime()-o;l.$duration=parseFloat((S/1e3).toFixed(3))}Ss&&this.config.opt_out_useragent_filter&&(l.$browser_type=this._is_bot()?"bot":"browser");const h=this.persistence.properties(),m=this.sessionPersistence.properties(),g=l.$groups,_=h.$groups;ct(g)&&!zs(g)&&(l.$groups=F(F({},ct(_)?_:{}),g)),Zt(["$referrer","$referring_domain"],S=>{S in h&&delete m[S]});const y={};if(this.Oh.length>0)for(const S of this.Oh.slice())try{mn(y,S())}catch(E){ge.error("Failed to produce browser extension event properties",E)}l=mn({},u,h,m,F(F({},y),l)),l.$is_identified=this._isIdentified(),He(this.config.property_denylist)?Zt(this.config.property_denylist,function(S){delete l[S]}):ge.error(_L+this.config.property_denylist+" or property_blacklist config: "+this.config.property_blacklist);const b=this.config.sanitize_properties;b&&(ge.error(d8),l=b(l,e));const x=this.xd();return l.$process_person_profile=x,x&&!i&&this.$d("_calculate_event_properties"),l}wd(e,n=!0,r=!1){var s;if(!this.persistence||!this.xd()||this.Ah&&!r)return e;const i=this.persistence.get_initial_props(),o=(s=this.sessionPropsManager)===null||s===void 0?void 0:s.getSetOnceProps();let l=mn({},i,o||{},e||{});const u=this.config.sanitize_properties;return u&&(ge.error(d8),l=u(l,"$set_once")),n&&(this.Ah=!0),zs(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.Zh(),(r=this.sessionPersistence)===null||r===void 0||r.register(e),Object.keys(e).forEach(s=>this.Rh.add(s)),this.Sd()}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.Rh.delete(e),this.Sd()}Cd(e,n){this.register({[e]:n})}Vh(){this.Rh.forEach(e=>{var n;(n=this.sessionPersistence)===null||n===void 0||n.unregister(e)}),this.Rh.clear(),this.Sd()}Sd(){var e;if(!this.Ph)return;if(this.config.persistence==="memory"||!((e=this.sessionPersistence)===null||e===void 0)&&e.fi||!cn.Ot())return void cn.Dt(this.Ph);const n=[];this.Rh.forEach(r=>n.push(r)),n.length>0?cn.$t(this.Ph,n):cn.Dt(this.Ph)}getFeatureFlag(e,n){var r;return(r=this.featureFlags)===null||r===void 0?void 0:r.getFeatureFlag(e,n)}getFeatureFlagPayload(e){var n;return(n=this.featureFlags)===null||n===void 0?void 0:n.getFeatureFlagPayload(e)}getFeatureFlagResult(e,n){var r;return(r=this.featureFlags)===null||r===void 0?void 0:r.getFeatureFlagResult(e,n)}getAllFeatureFlags(){var e,n;return(e=(n=this.featureFlags)===null||n===void 0?void 0:n.getAllFeatureFlags())!==null&&e!==void 0?e:[]}isFeatureEnabled(e,n){var r,s;return(r=(s=this.featureFlags)===null||s===void 0?void 0:s.isFeatureEnabled(e,n))!==null&&r!==void 0?r:n==null?void 0:n.defaultValue}reloadFeatureFlags(){var e;(e=this.featureFlags)===null||e===void 0||e.reloadFeatureFlags()}updateFlags(e,n,r){var s;(s=this.featureFlags)===null||s===void 0||s.updateFlags(e,n,r)}updateEarlyAccessFeatureEnrollment(e,n,r){var s;(s=this.featureFlags)===null||s===void 0||s.updateEarlyAccessFeatureEnrollment(e,n,r)}getEarlyAccessFeatures(e,n=!1,r){var s;return(s=this.featureFlags)===null||s===void 0?void 0:s.getEarlyAccessFeatures(e,n,r)}on(e,n){return this.dr.on(e,n)}onFeatureFlags(e){return this.featureFlags?this.featureFlags.onFeatureFlags(e):(e([],{},{errorsLoading:!0}),()=>{})}onSurveysLoaded(e){return this.surveys?this.surveys.onSurveysLoaded(e):(e([],{isLoaded:!1,error:ad}),()=>{})}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:ad})}getActiveMatchingSurveys(e,n=!1){this.surveys?this.surveys.getActiveMatchingSurveys(e,n):e([],{isLoaded:!1,error:ad})}onActiveMatchingSurveysChanged(e){return this.surveys?this.surveys.onActiveMatchingSurveysChanged(e):(e([],{isLoaded:!1,error:ad}),()=>{})}renderSurvey(e,n){var r;(r=this.surveys)===null||r===void 0||r.renderSurvey(e,n)}displaySurvey(e,n=VH){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:ad}}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:ad})}Td(e){return!e||Xh(e)?(ge.critical("Unique user id has not been set in posthog.identify"),!1):e==="$posthog_cookieless"?(ge.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())||(ge.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 ge.uninitializedWarning("posthog.identify");if(Bn(e)&&(e=e.toString(),ge.warn("The first argument to posthog.identify was a number, but it should be a string. It has been converted to a string.")),!this.Td(e)||!this.$d("posthog.identify"))return;this.xh();const s=this.get_distinct_id(),i=this.persistence.syncCookieProperties()&&this.get_distinct_id()!==s,o=this.Zh(!1),l=this.persistence.Ou();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(rv),this.register({distinct_id:e}));const h=(this.persistence.get_property("$user_state")||"anonymous")===Ra,m=e!==f,g=!m&&h;if(m&&h){var d;const _=this.config.reuseAnonymousId?{distinct_id:e}:{distinct_id:e,$anon_distinct_id:f};this.persistence.set_property(cs,_g),this.setPersonPropertiesForFlags({$set:n||{},$set_once:r||{}},!1),this.config.cookieWinsOnConflict&&this.persistence.Fu(),this.capture("$identify",_,{$set:n||{},$set_once:r||{}})&&(this.jh=J_(e,n,r)),(d=this.featureFlags)===null||d===void 0||d.setAnonymousDistinctId(this.config.reuseAnonymousId?void 0:f)}else if(g){this.persistence.set_property(cs,_g);const _=n||{},y=r||{};this.setPersonPropertiesForFlags({$set:_,$set_once:y},!1),this.config.cookieWinsOnConflict&&this.persistence.Fu(),this.capture("$set",{$set:_,$set_once:y})&&(this.jh=J_(e,n,r))}else(n||r)&&this.setPersonProperties(n,r);m||i||o?(this.reloadFeatureFlags(),this.featureFlags?this.featureFlags.resetFlagCallReported():this.unregister(zo)):g&&(n||r)&&this.reloadFeatureFlags(),u=!0}finally{l&&this.persistence.Nu(u)}}setPersonProperties(e,n){if(!e&&!n||!this.$d("posthog.setPersonProperties"))return;const r=J_(this.get_distinct_id(),e,n);this.jh!==r?(this.setPersonPropertiesForFlags({$set:e||{},$set_once:n||{}},!0),this.capture("$set",{$set:e||{},$set_once:n||{}})&&(this.jh=r)):ge.info("A duplicate setPersonProperties call was made with the same properties. It has been ignored.")}unsetPersonProperties(e){var n;const r=(He(e)?e:[e]).filter(s=>dt(s)&&s.length>0);r.length!==0&&this.$d("posthog.unsetPersonProperties")&&((n=this.featureFlags)===null||n===void 0||n.unsetPersonPropertiesForFlags(r,!0),this.capture("$set",{$unset:r}),this.jh=null)}group(e,n,r){var s;if(!e||!n)return void ge.error("posthog.group requires a group type and group key");(s=this.persistence)===null||s===void 0||s.syncCookieProperties(),this.Zh();const i=this.getGroups(),o=i[e]!==n;if(o&&this.resetGroupPropertiesForFlags(e),this.register({$groups:F(F({},i),{},{[e]:n})}),(o||r)&&this.xd()){const l={$group_type:e,$group_key:n};r&&(l.$group_set=r),this.capture(AP,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.$d("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=Es(e)?e:e==null?void 0:e.resetDeviceID,r=Es(e)||e==null?void 0:e.bootstrap;this.Id(n,!1,r)}Id(e,n=!1,r){var s,i,o,l,u,d;if(ge.info("reset"),!this.__loaded)return ge.uninitializedWarning("posthog.reset");const f=r==null?void 0:r.sessionID;this.config.bootstrap=r||((s=this.Bh)===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.lc());const h=this.get_property(pS),m=this.get_property(D_),g=this.get_property(tp);(l=this.sessionRecording)===null||l===void 0||l.flushBeforeIdentityReset();const _=this.is_capturing();n||this.consent.reset(),n||!_||this.is_capturing()||console.warn("[PostHog.js]","reset() cleared the stored consent, and capturing is now off because of `opt_out_capturing_by_default`. Call opt_in_capturing() again, and prefer calling reset() before opting in rather than after.");const y=(u=this.persistence)===null||u===void 0||(d=u.Ou)===null||d===void 0?void 0:d.call(u),b=this.$h;this.$h=b||n;let x=!1;try{var S,E,C,R,O,I,A,L,N,H,$,W,X;if((S=this.persistence)===null||S===void 0||S.clear(),(E=this.sessionPersistence)===null||E===void 0||E.clear(),this.Rh.clear(),this.Sd(),le(g)||(H=this.persistence)===null||H===void 0||H.register({$session_recording_remote_config:g}),(C=this.surveys)===null||C===void 0||C.reset(),(R=this.featureFlags)===null||R===void 0||R.reset(),(O=this.conversations)===null||O===void 0||O.reset(),(I=this.logs)===null||I===void 0||I.reset(),(A=this.metrics)===null||A===void 0||A.reset(),(L=this.persistence)===null||L===void 0||L.set_property("$user_state","anonymous"),(N=this.sessionManager)===null||N===void 0||N.resetSessionId(),this.jh=null,this.config.cookieless_mode==="always")this.register_once({distinct_id:$_,$device_id:null},"");else{const Z=this.config.get_device_id(fo());this.register_once({distinct_id:Z,$device_id:e?Z:h},""),e||le(m)||this.register({[D_]:m})}if(this.register({$last_posthog_reset:new Date().toISOString()},1),r&&(r.distinctID&&!this._h()&&((X=this.persistence)===null||X===void 0||X.set_property("$user_state",r.isIdentifiedID?"identified":"anonymous"),this.register({distinct_id:r.distinctID})),($=this.featureFlags)===null||$===void 0||$.initialize(),!ot(f)&&!(!((W=this.sessionManager)===null||W===void 0)&&W.setBootstrapSessionId(f,!0)))){const Z=F({},r);delete Z.sessionID,this.config.bootstrap=Z}delete this.config.identity_distinct_id,delete this.config.identity_hash,delete this.config.identity_claims,x=!0}finally{var z,K;this.$h=b,y&&((z=this.persistence)===null||z===void 0||(K=z.Nu)===null||K===void 0||K.call(z,x))}var te;this.vr&&((te=this.conversations)===null||te===void 0||te.onRemoteConfig(this.vr)),this.reloadFeatureFlags()}shutdown(e){var n=this;return un(function*(){if(!n.__loaded)return void ge.uninitializedWarning("posthog.shutdown");n.Eh=!0,clearTimeout(n.Qh),n.Qh=void 0;const r=n.sd;n.sd=void 0;for(const s of[()=>{var i;return(i=n.sessionRecording)===null||i===void 0?void 0:i.dispose()},()=>{var i;return(i=n.logs)===null||i===void 0?void 0:i.flushLogs("sendBeacon")},()=>{var i;return(i=n.metrics)===null||i===void 0?void 0:i.flush("sendBeacon")},()=>{var i;return(i=n.metrics)===null||i===void 0?void 0:i.dispose()},()=>{var i;return(i=n.logs)===null||i===void 0?void 0:i.dispose()},()=>{var i;return(i=n.surveys)===null||i===void 0?void 0:i.dispose()},()=>{var i;return(i=n.autocapture)===null||i===void 0?void 0:i.dispose()},()=>r==null?void 0:r(),()=>{var i;return(i=n.Hh)===null||i===void 0?void 0:i.unload()},()=>{var i;return(i=n.Wh)===null||i===void 0?void 0:i.unload()},()=>{var i;return(i=n.featureFlags)===null||i===void 0?void 0:i.destroy()},()=>{var i;return(i=n.persistence)===null||i===void 0?void 0:i.destroy()},()=>{var i;return(i=n.sessionPersistence)===null||i===void 0?void 0:i.destroy()}])try{const i=s();i&&Nn(i.then)&&i.then(void 0,o=>{ge.error("Error during shutdown",o)})}catch(i){ge.error("Error during shutdown",i)}})()}setIdentity(e,n){var r;delete this.config.identity_claims,this.config.identity_distinct_id=e,this.config.identity_hash=n,this.alias(e),(r=this.conversations)===null||r===void 0||r.Md()}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.Ed()}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")?(ge.critical("Attempting to create alias for existing People user - aborting."),-2):this.$d("posthog.alias")?(le(n)&&(n=this.get_distinct_id()),e!==n?(this.Cd(rv,e),this.capture("$create_alias",{alias:e,distinct_id:n})):(ge.warn("alias matches current distinct_id - skipping api call."),this.identify(e),-1)):void 0}set_config(e){const n=F({},this.config);if(ct(e)){var r,s,i,o,l,u,d,f,h,m,g,_,y,b;mn(this.config,m8(e));const R=this.Ih();if(this.persistence){const I=this.config.persistence==="sessionStorage"||this.config.persistence==="memory";var x,S;if(I&&this.sessionPersistence!==this.persistence&&((x=this.sessionPersistence)===null||x===void 0||x.remove(),(S=this.sessionPersistence)===null||S===void 0||S.destroy()),this.persistence.update_config(this.config,n,R),I)this.sessionPersistence=this.persistence;else if(this.sessionPersistence===this.persistence)this.sessionPersistence=new W_(F(F({},this.config),{},{persistence:"sessionStorage"}),R,!1);else{var E;(E=this.sessionPersistence)===null||E===void 0||E.update_config(F(F({},this.config),{},{persistence:"sessionStorage"}),F(F({},n),{},{persistence:"sessionStorage"}),R)}}const O=this.qh(this.config.debug);var C;Es(O)&&(this.config.debug=O),Es(this.config.debug)&&(this.config.debug?(js.DEBUG=!0,At.Ot()&&At.$t("ph_debug",!0),ge.info("set_config",{config:e,oldConfig:n,newConfig:F({},this.config)})):(js.DEBUG=!1,At.Ot()&&At.Dt("ph_debug"))),(r=this.featureFlags)===null||r===void 0||(s=r.updateConfig)===null||s===void 0||s.call(r,this.config,this.lc()),(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(),(m=this.heatmaps)===null||m===void 0||m.startIfEnabled(),("capture_pageview"in e||"disable_capture_url_hashes"in e)&&((C=this.historyAutocapture)===null||C===void 0||C.startIfEnabledOrStop()),(g=this.exceptionObserver)===null||g===void 0||g.startIfEnabledOrStop(),(_=this.deadClicksAutocapture)===null||_===void 0||_.startIfEnabledOrStop(),(y=this.surveys)===null||y===void 0||y.loadIfEnabled(),this.Ch(),(b=this.externalIntegrations)===null||b===void 0||b.startIfEnabledOrStop(),!n.segment&&this.config.segment&&this.persistence&&GP(this,ap,!1)}}_overrideSDKInfo(e,n){js.LIB_NAME=e,js.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(F(F({},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:gl.Ad}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:zh;return n!==zh&&(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"}xd(){var e,n;return!(this.config.person_profiles==="never"||this.config.person_profiles==="identified_only"&&!this._isIdentified()&&zs(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))}hd(){return this.config.capture_pageleave===!0||this.config.capture_pageleave==="if_capture_pageview"&&!!this.config.capture_pageview}createPersonProfile(){this.xd()||this.$d("posthog.createPersonProfile")&&this.setPersonProperties({},{})}setInternalOrTestUser(){this.$d("posthog.setInternalOrTestUser")&&this.setPersonProperties({$internal_or_test_user:!0})}$d(e){return this.config.person_profiles==="never"?(ge.error(e+' was called, but process_person is set to "never". This call will be ignored.'),!1):(this.wh(),this.Cd(vS,!0),!0)}Ih(){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")}Ch(){var e,n;const r=this.Ih();var s,i,o;return this.is_capturing()||(s=this.logs)===null||s===void 0||s.Rd(),((e=this.persistence)===null||e===void 0?void 0:e.fi)!==r&&((i=this.persistence)===null||i===void 0||i.set_disabled(r)),((n=this.sessionPersistence)===null||n===void 0?void 0:n.fi)!==r&&((o=this.sessionPersistence)===null||o===void 0||o.set_disabled(r)),this.Sd(),r}opt_in_capturing(e){var n,r,s;if(this.config.cookieless_mode==="always")return void ge.warn(u8);if(this._h()){var i,o,l,u,d,f;(i=this.sessionRecording)===null||i===void 0||i.dispose({discardBufferedEvents:!0}),this.Id(!0,!0),(o=this.sessionManager)===null||o===void 0||o.destroy(),(l=this.pageViewManager)===null||l===void 0||l.destroy(),this.sessionManager=new a8(this),this.pageViewManager=new qP(this),this.persistence&&(this.sessionPropsManager=new i8(this,this.sessionManager,this.persistence));const x=(u=(d=this.config.__extensionClasses)===null||d===void 0?void 0:d.sessionRecording)!==null&&u!==void 0?u:(f=gl.__defaultExtensionClasses)===null||f===void 0?void 0:f.sessionRecording;var h,m;x&&(this.sessionRecording=this.bh(this.sessionRecording,new x(this)),this.vr&&((h=this.sessionRecording)===null||h===void 0||(m=h.onRemoteConfig)===null||m===void 0||m.call(h,this.vr)))}const g=this.consent.consent===1;var _,y,b;g&&this.xh(),this.consent.optInOut(!0),this.Ch(),this.ad(),(n=this.sessionRecording)===null||n===void 0||n.startIfEnabledOrStop(),this.config.cookieless_mode=="on_reject"&&((_=this.surveys)===null||_===void 0||_.loadIfEnabled(),(y=this.conversations)===null||y===void 0||y.loadIfEnabled()),g||!le(e==null?void 0:e.captureEventName)&&!(e!=null&&e.captureEventName)||this.capture((b=e==null?void 0:e.captureEventName)!==null&&b!==void 0?b:"$opt_in",e==null?void 0:e.captureProperties,{send_instantly:!0}),(r=this.persistence)===null||r===void 0||r.syncCookieProperties(),this.Zh(),(s=this.featureFlags)===null||s===void 0||s.sendFlagCallsPendingCapture(),this.config.capture_pageview&&this.ld()}opt_out_capturing(){this.config.cookieless_mode!=="always"?(this.consent.optInOut(!1),this.Ch(),this.config.cookieless_mode==="on_reject"&&this.Th()):ge.warn(u8)}Th(){var e,n;const r=this.sessionRecording;r==null||r.dispose({discardBufferedEvents:!0}),this.get_distinct_id()!=="$posthog_cookieless"&&this.Id(!0,!0),this.register({distinct_id:$_,$device_id:null}),this.mh(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.ld(),this.ad()}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.$h&&(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.Ch()}_is_bot(){return Wr?cL(Wr,this.config.custom_blocked_useragents):void 0}ld(){Oe&&(Oe.visibilityState==="visible"?this.Dh||(this.Dh=!0,this.capture(wS,{title:Oe.title},{send_instantly:!0}),this.Lh&&(Oe.removeEventListener(Md,this.Lh),this.Lh=null)):this.Lh||(this.Lh=this.ld.bind(this),Lt(Oe,Md,this.Lh)))}debug(e){e===!1?(ae==null||ae.console.log("You've disabled debug mode."),this.set_config({debug:!1})):(ae==null||ae.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}))}lc(){const e=this.Bh||{};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?(ge.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&&!ot(n[r]),u=s in n&&!ot(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,ge)}Fs(e){var n;if(ot(this.config.before_send))return e;const r=Object.keys((n=e.properties)!==null&&n!==void 0?n:{}).filter(q7),s=He(this.config.before_send)?this.config.before_send:[this.config.before_send];let i=e;for(const o of s)try{if(i=o(i),ot(i)){const l=`Event '${e.event}' was rejected in beforeSend function`;return G7(e.event)?ge.warn(`${l}. This can cause unexpected behavior.`):ge.info(l),null}i.properties&&!zs(i.properties)||ge.warn(`Event '${e.event}' has no properties after beforeSend function, this is likely an error.`)}catch(l){return ge.error(`Error in beforeSend function for event '${e.event}':`,l),null}for(const o of r)if(i.properties&&ot(i.properties[o]))return ge.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.Ul)===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)})}qh(e){const n=Es(e)&&!e,r=At.Ot()&&At.Lt("ph_debug")==="true";return!n&&(!!r||e)}};lp.__defaultExtensionClasses={},lp.Ad=(()=>{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]]=BV(t.prototype[e[n]])})(lp,["identify"]);const oU=["[data-ph-capture-value]"];var aU=class{constructor(t){this._instance=t}refresh(t){var e;const n=this._instance.config,r=ct(n.autocapture)?n.autocapture:void 0;t.enabled=!!n.autocapture,t.rageclick=n.rageclick,t.maskAllElementAttributes=n.mask_all_element_attributes,t.maskAllText=n.mask_all_text,t.disableCaptureUrlHashes=n.disable_capture_url_hashes,t.getCurrentUrl=n.get_current_url,t.remoteRequestsDisabled=this._instance.lc(),t.url_allowlist=r==null?void 0:r.url_allowlist,t.url_ignorelist=r==null?void 0:r.url_ignorelist,t.dom_event_allowlist=r==null?void 0:r.dom_event_allowlist,t.element_allowlist=r==null?void 0:r.element_allowlist,t.css_selector_allowlist=r==null?void 0:r.css_selector_allowlist,t.css_selector_ignorelist=r==null?void 0:r.css_selector_ignorelist,t.element_attribute_ignorelist=r==null?void 0:r.element_attribute_ignorelist,t.capture_copied_text=r==null?void 0:r.capture_copied_text,t.capture_value_css_selector_allowlist=(e=r==null?void 0:r.capture_value_css_selector_allowlist)!==null&&e!==void 0?e:oU}};const Th=En("[ExceptionAutocapture]"),g8=()=>{},v8=t=>{var e;if(Nn(t))return(e=t.__posthog_layer__)!==null&&e!==void 0?e:t.__rrweb_layer__};function cf(t,e,n){try{if(!(e in t))return g8;const r={next:t[e]},s=n(function(...i){return r.next.apply(this,i)});return Nn(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=v8(i);for(;o;){if(o.next===s)return void(o.next=r.next);i=o.next,o=v8(i)}}}catch{return g8}}const lU=En("[TracingHeaders]"),Tc=En("[Web Vitals]"),y8=9e5,_8=["CLS","FCP","INP","LCP"],cU=["INP","LCP"],uU=["interactionTarget","interactionType","inputDelay","processingDuration","presentationDelay","loadState","target","url","timeToFirstByte","resourceLoadDelay","resourceLoadDuration","elementRenderDelay","largestShiftTarget","largestShiftTime","largestShiftValue","firstByteToFCP"],sw="disabled",w8="lazy_loading",pa=En("[SessionRecording]"),dU=[yS,_S,hM,pM,mM,gM,vM,yM,_M],fU=En("[Heatmaps]");function iw(t){return ct(t)&&"clientX"in t&&"clientY"in t&&Bn(t.clientX)&&Bn(t.clientY)}const D0=En("[Product Tours]"),ow=t=>{var e;return!t.config.disable_product_tours&&!!(!((e=t.persistence)===null||e===void 0)&&e.get_property(gS))},hU=["$set_once","$set"],Ro=En("[SiteApps]"),b8="Error while initializing PostHog app with config id ";function ld(t,e,n){if(ot(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 pU=class{constructor(t){this.$i=t,this.Ao=new Set,this.Ro=new Set,this.Po=new cv,this.Oo=(e,n)=>this.Fo(e,n)&&this.Do(e,n)&&this.Lo(e,n)&&this.No(e,n),this.Fo=(e,n)=>!(n!=null&&n.event)||(e==null?void 0:e.event)===(n==null?void 0:n.event)}init(){var t,e;le((t=this.$i)===null||t===void 0?void 0:t.subscribeCapture)||(this.jo=(e=this.$i)===null||e===void 0?void 0:e.subscribeCapture((n,r)=>{this.on(n,r)}))}dispose(){var t,e,n;(t=this.jo)===null||t===void 0||t.call(this),this.jo=void 0,(e=this.$i)===null||e===void 0||(n=e.setElementSelectors)===null||n===void 0||n.call(e,new Set,this),this.Po=new cv}register(t){var e,n;if(!le((e=this.$i)===null||e===void 0?void 0:e.subscribeCapture)&&(t.forEach(r=>{var s;this.Ao.add(r),(s=r.steps)===null||s===void 0||s.forEach(i=>{this.Ro.add((i==null?void 0:i.event)||"")})}),(n=this.$i)===null||n===void 0?void 0:n.setElementSelectors)){const r=new Set;this.Ao.forEach(s=>{var i;(i=s.steps)===null||i===void 0||i.forEach(o=>{o!=null&&o.selector&&r.add(o.selector)})}),this.$i.setElementSelectors(r,this)}}replace(t){this.Ao.clear(),this.Ro.clear(),this.register(t)}on(t,e){e!=null&&t.length!=0&&(this.Ro.has(t)||this.Ro.has(e.event))&&this.Ao.forEach(n=>{this.qo(e,n)&&this.Po.emit("actionCaptured",n.name)})}Bo(t){this.onAction("actionCaptured",e=>t(e))}qo(t,e){if((e==null?void 0:e.steps)==null)return!1;for(const n of e.steps)if(this.Oo(t,n))return!0;return!1}onAction(t,e){return this.Po.on(t,e)}Do(t,e){if(e!=null&&e.url){var n;let i=t==null||(n=t.properties)===null||n===void 0?void 0:n.$current_url;if(!(t!=null&&t.properties)||!("$current_url"in t.properties))try{var r,s;i=(r=this.$i)===null||r===void 0||(s=r.getActionUrl)===null||s===void 0?void 0:s.call(r)}catch{return!1}if(!i||typeof i!="string"||!ld(i,e.url,e.url_matching||"contains"))return!1}return!0}Lo(t,e){return!!this.zo(t,e)&&!!this.Ho(t,e)&&!!this.Uo(t,e)}zo(t,e){var n;if(!(e!=null&&e.href))return!0;const r=this.Wo(t);if(r.length>0)return r.some(i=>ld(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&&ld((function(i){const o=i.match(/(?::|")href="(.*?)"/);return o?o[1]:""})(s),e.href,e.href_matching||"exact")}Ho(t,e){var n;if(!(e!=null&&e.text))return!0;const r=this.Wo(t);if(r.length>0)return r.some(u=>ld(u.text,e.text,e.text_matching||"exact")||ld(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(;!ot(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=>ld(u,o,l)));var i,o,l}Uo(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}Wo(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}No(t,e){return!(e!=null&&e.properties)||e.properties.length===0||hL(e.properties.reduce((n,r)=>{const s=He(r.value)?r.value.map(String):r.value!=null?[String(r.value)]:[];return n[r.key]={values:s,operator:r.operator||"exact"},n},{}),t==null?void 0:t.properties)}},mU=class{constructor(t,e){this.Vo=e,this.Go=[],this.$i=t,this.Qo=new Map,this.Jo=new Map,this.Zo=new Map}Ko(){var t,e;this.Yo=(t=(e=this.$i).subscribeSession)===null||t===void 0?void 0:t.call(e,n=>this.Xo(n))}ta(t){return!1}ea(){return null}ia(t){}na(){}sa(t,e){return!!t&&hL(t.propertyFilters,e==null?void 0:e.properties)}ra(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}oa(t,e,n){const r=(n===kh.Activation?this.Qo:this.Jo).get(t);let s=[];return this.aa(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.sa(l,e)})}register(t){this.la(t,!1)}replace(t){this.la(t,!0)}la(t,e){le(this.$i.subscribeCapture)||(this.ua(t,e),this.ca(t,e))}ca(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.Zo.clear(),n.length===0)return void(e&&((r=this.ha)===null||r===void 0||r.replace([])));this.ha||(this.ha=new pU(this.$i),this.ha.init(),this.ha.Bo(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.Zo.get(l.name))!==null&&u!==void 0?u:[];d.includes(i.id)||d.push(i.id),this.Zo.set(l.name,d)}})}),e?this.ha.replace(s):this.ha.register(s)}da(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)})}ua(t,e){var n,r,s;const i=t.filter(d=>{var f,h;return((f=d.conditions)===null||f===void 0?void 0:f.events)&&((h=d.conditions)===null||h===void 0||(h=h.events)===null||h===void 0||(h=h.values)===null||h===void 0?void 0:h.length)>0}),o=t.filter(d=>{var f,h;return((f=d.conditions)===null||f===void 0?void 0:f.cancelEvents)&&((h=d.conditions)===null||h===void 0||(h=h.cancelEvents)===null||h===void 0||(h=h.values)===null||h===void 0?void 0:h.length)>0}),l=this.ra(t,kh.Activation),u=this.ra(t,kh.Cancellation);e?(this.Qo=l,this.Jo=u):(this.da(this.Qo,l),this.da(this.Jo,u)),(i.length!==0||o.length!==0||t.some(d=>{var f;return(f=d.conditions)===null||f===void 0||(f=f.actions)===null||f===void 0||(f=f.values)===null||f===void 0?void 0:f.length}))&&((n=this.jo)!==null&&n!==void 0||(this.jo=(r=(s=this.$i).subscribeCapture)===null||r===void 0?void 0:r.call(s,(d,f)=>{this.onEvent(d,f)})))}onEvent(t,e){var n,r;const s=this.va(),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.fa(t,i,e);if(l==="consume")return s.info("event consumed activated item, removing it",{event:t,itemId:i}),void this.pa([i]);if(l==="persist")return s.info("shown item promoted to persisted activation",{event:t,itemId:i}),this.ga(i),void this.ma([i])}if(this.Jo.has(t)){const l=this.oa(t,e,kh.Cancellation);l.length>0&&(s.info("cancel event matched, cancelling items",{event:t,itemsToCancel:l.map(u=>u.id)}),this.pa(l.map(u=>u.id)),l.forEach(u=>this.ya(u.id)))}if(!this.Qo.has(t))return;s.info("event name matched",{event:t,eventPayload:e,items:this.Qo.get(t)});const o=this.oa(t,e,kh.Activation);this.ba(o.map(l=>l.id))}onAction(t){this.Zo.has(t)&&this.ba(this.Zo.get(t)||[])}ba(t){if(t.length===0)return;const e=!!this.$i.getSessionId(),n=[];for(const r of t)e&&this.ta(r)?this.ga(r)&&this._a(r):n.push(r);n.length>0&&(this.Go=[...new Set([...this.Go,...n])]),this.va().info("updating activated items",{activatedItems:this.getActivatedIds()}),this.wa()}ga(t){this.Go=this.Go.filter(n=>n!==t);const e=this.ka();return!e.includes(t)&&(this.Sa([...e,t]),this.xa(),!0)}pa(t){const e=new Set(t);this.Go=this.Go.filter(s=>!e.has(s));const n=this.$a(),r=n.filter(s=>!e.has(s));r.length!==n.length&&(this.Sa(r),r.length===0&&this.Ca()),this.ma(t),this.wa()}wa(){try{var t;(t=this.Vo)===null||t===void 0||t.call(this)}catch(e){this.va().error("Error while handling activated items change",e)}}Ta(){const t=this.ea();if(!t)return{};const e=this.$i.getProperty(t);return e&&typeof e=="object"?e:{}}_a(t){if(!this.ea())return;const e=this.Ta();this.ia(F(F({},e),{},{[t]:Date.now()}))}ma(t){if(!this.ea())return;const e=this.Ta(),n={};let r=!1;for(const[s,i]of Object.entries(e))t.includes(s)?r=!0:n[s]=i;r&&(zs(n)?this.na():this.ia(n))}Ia(){this.ea()&&this.na()}getActivationTimestamp(t){if(!this.ka().includes(t))return;const e=this.Ta()[t];return Bn(e)?e:void 0}$a(){const t=this.Ma();return this.$i.getProperty(t)||[]}ka(){const t=this.$a();if(t.length===0)return[];const e=this.$i.getProperty(this.Ea()),n=this.$i.getSessionId();return n&&e===n?t:[]}xa(){const t=this.$i.getSessionId();t&&this.Aa(t)}Ca(){this.Ra()}Xo(t){const e=this.$i.getProperty(this.Ea());if(e&&e!==t){const n=this.$a(),r=this.Ta();n.length>0&&(this.Sa([]),n.filter(s=>Bn(r[s])).forEach(s=>this.ya(s))),this.Ca(),this.Ia(),n.length>0&&this.wa()}}getActivatedIds(){return[...new Set([...this.ka(),...this.Go])].filter(t=>!this.Pa(t))}dispose(){var t,e,n;(t=this.Yo)===null||t===void 0||t.call(this),this.Yo=void 0,(e=this.jo)===null||e===void 0||e.call(this),this.jo=void 0,(n=this.ha)===null||n===void 0||n.dispose(),this.ha=void 0}reset(){this.Go=[],this.$a().length>0&&this.Sa([]),this.Ca(),this.Ia(),this.wa()}getEventToItemsMap(){return this.Qo}Oa(){return this.ha}},gU=class extends mU{constructor(t,e,n,r){var s;super({subscribeCapture(i){const o=t.onEvent(l=>i(l.event,l));return()=>o.dispose()},subscribeSession(i){const o=t.onSession(i);return()=>o.dispose()},getSessionId(){var i;return(i=t.session)===null||i===void 0?void 0:i.sessionId},getProperty:i=>t.kv.get(i),getActionUrl:n==null?void 0:n.getActionUrl,setElementSelectors:(s=n==null?void 0:n.setElementSelectors)!==null&&s!==void 0?s:(i,o)=>{var l;return(l=t.getExtension("autocapture"))===null||l===void 0?void 0:l.setElementSelectors(i,o)}},r),this.Fa=t,this.Da=e,this.Ko()}Ma(){return Vb}Ea(){return vg}ea(){return yg}ia(t){this.Fa.kv.set({[yg]:t})}na(){this.Fa.kv.remove(yg)}ta(t){var e;let n;this.aa(s=>{n=s.find(i=>i.id===t)});const r=n==null||(e=n.appearance)===null||e===void 0?void 0:e.surveyPopupDelaySeconds;return Bn(r)&&r>0}La(){return di.SHOWN}aa(t){this.Da.getSurveys(t)}ya(t){this.Da.cancelPendingSurvey(t)}va(){return Ut}Sa(t){this.Fa.kv.set({[Vb]:t})}Aa(t){this.Fa.kv.set({[vg]:t})}Ra(){this.Fa.kv.remove(vg)}Pa(){return!1}fa(t,e,n){var r;if(t===di.SENT&&(n==null||(r=n.properties)===null||r===void 0?void 0:r.$survey_completed)===!1)return"ignore";let s;return this.aa(i=>{s=i.find(o=>o.id===e)}),!s||(function(i){var o;return dL(i)&&!!(!((o=i.conditions)===null||o===void 0||(o=o.events)===null||o===void 0)&&o.repeatedActivation)||i.schedule==="always"})(s)?t===di.SHOWN?"consume":"ignore":t===di.SHOWN?"persist":t===di.DISMISSED||t===di.SENT?"consume":"ignore"}getSurveys(){return this.getActivatedIds()}getEventToSurveys(){return this.getEventToItemsMap()}};const RS=(t,e)=>t!=null&&t.then?t.then(e):e(t),cd="SDK is not enabled or survey functionality is not yet loaded",x8="Disabled. Not loading surveys.";var vU=class{constructor(t){this.Na=t,this.name="surveys",this._surveyEventReceiver=null,this._surveyManager=null,this.ja=!1,this.qa=!1,this.Ba=[],this.za=[],this.Ha=null,this.Ua=null,this.Ti=!1,this.Wa=new Set,this.onRemoteConfig=e=>{if(this.Ti||this.Fr.disableSurveys)return;if(!e.ok)return this.qa=!0,this.Va({isLoaded:!1,error:"Remote config unavailable. Not loading surveys."}),Ut.warn("Remote config unavailable. Not loading surveys.");const n=e.config.surveys;if(ot(n))return Ut.warn("Flags not loaded yet. Not loading surveys.");this.Ga=Es(n)?n:n.length>0,Ut.info(`flags response received, isSurveysEnabled: ${this.Ga}`),this.loadIfEnabled()},this.Va=e=>{this.za.slice().forEach(n=>this.Qa(n,e))}}setup(t){if(!this.Ti)return this.Ja=t,RS(t.kv.initialize(),()=>{if(this.Ja!==t||this.Ti)return;this.Ja=void 0,this.Fa=t;const e=t.onRemoteConfig(this.onRemoteConfig);this.Ti?e.dispose():(this.Za=e,this.loadIfEnabled())})}dispose(){var t,e,n,r,s;this.Ti||(this.Ti=!0,this.Ja=void 0,this.Fa=void 0,(t=this.Za)===null||t===void 0||t.dispose(),this.Za=void 0,(e=this._surveyEventReceiver)===null||e===void 0||e.dispose(),this._surveyEventReceiver=null,(n=this._surveyManager)===null||n===void 0||(r=n.dispose)===null||r===void 0||r.call(n),this._surveyManager=null,this.Ba=[],this.za.forEach(i=>{i.active=!1}),this.za=[],(s=this.Ka)===null||s===void 0||s.call(this),this.Ka=void 0,this.Ha=null,this.Wa.forEach(i=>clearTimeout(i)),this.Wa.clear())}get Fr(){return this.Na.get()}getRenderContext(){if(!this.Fa)return;const t=this;return{client:this.Fa,get config(){return t.Fr},surveys:t}}initialize(){this.loadIfEnabled()}reset(){var t,e;(t=this._surveyManager)===null||t===void 0||(e=t.clearInMemoryInProgressSurveyState)===null||e===void 0||e.call(t);try{var n;(n=this._surveyEventReceiver)===null||n===void 0||n.reset(),localStorage.removeItem("lastSeenSurveyDate");const r=[];for(let s=0;s<localStorage.length;s++){const i=localStorage.key(s);(i!=null&&i.startsWith("seenSurvey_")||i!=null&&i.startsWith("inProgressSurvey_"))&&r.push(i)}r.forEach(s=>localStorage.removeItem(s))}catch{}this.Va()}loadIfEnabled(){if(this.Ti||!this.Fa)return;const t=this.Fr;if(this._surveyManager)return;if(this.ja)return void Ut.info("Already initializing surveys, skipping...");if(t.disableSurveys)return void Ut.info(x8);if(t.cookielessMode&&this.Fa.isOptedOut)return void Ut.info("Not loading surveys in cookieless mode without consent.");const e=this.Na.getExtensions();if(!e)return void this.Ya("PostHog Extensions not found.");if(le(this.Ga)&&!t.advancedEnableSurveys)return;const n=this.Ga||t.advancedEnableSurveys;this.ja=!0,this.qa=!1;try{const r=e.generateSurveys;if(r)return this.Xa(r,n),void(this.ja=!1);const s=e.loadExternalDependency;if(!s)return this.Ya(zb),void(this.ja=!1);s(i=>{try{if(this.Ti)return;const o=this.Na.getExtensions();i||!(o!=null&&o.generateSurveys)?this.Ya("Could not load surveys script",i):this.Xa(o.generateSurveys,n)}finally{this.ja=!1}})}catch(r){throw this.ja=!1,this.Ya("Error initializing surveys",r),r}}Xa(t,e){var n;if(this.Ti)return;this._surveyManager=t(e),this._surveyEventReceiver=this.tl(this.Fa,this.Va);const r=(n=this.Fa)===null||n===void 0?void 0:n.kv.get(Fh);r&&this.el(r),Ut.info("Surveys loaded successfully"),this.il(),this.Va(),this.nl({isLoaded:!0})}tl(t,e){return new gU(t,this,void 0,e)}Ya(t,e){this.qa=!0,Ut.error(t,e),this.Va({isLoaded:!1,error:t}),this.nl({isLoaded:!1,error:t})}onSurveysLoaded(t){return this.Ba.push(t),this._surveyManager&&this.nl({isLoaded:!0}),()=>{this.Ba=this.Ba.filter(e=>e!==t)}}getSurveys(t,e=!1){if(this.Ti)return;const n=this.Fa;if(!n)return t([],{isLoaded:!1,error:cd});if(this.Fr.disableSurveys)return Ut.info(x8),t([]);const r=n.kv.get(Fh);if(r&&!e)return t(r,{isLoaded:!0}),void(this.sl()&&this.getSurveys(()=>{},!0));if(this.Ha)return void this.Ha.then(({surveys:o,context:l})=>{this.Ti||t(o,l)}).catch(o=>Ut.error("Error in survey callback",o));const s=n.sendRequest("/api/surveys/",{method:"GET",query:{token:n.projectToken},sentAt:"query",timeoutMs:this.Fr.requestTimeoutMs}).then(o=>{try{return this.rl(n,o)}catch(l){return Ut.error("Error processing surveys response",l),this.rl(n,{statusCode:0,error:l})}},o=>this.rl(n,{statusCode:0,error:o}));this.Ha=s;const i=()=>{this.Ha===s&&(this.Ha=null)};s.then(o=>{i(),this.Ti||(this.Va(o.context),t(o.surveys,o.context))},i).catch(o=>Ut.error("Error in survey callback",o))}rl(t,e){if(this.Ti)return{surveys:[],context:{isLoaded:!1,error:cd}};const n=e.statusCode;if(n!==200||!e.json){const s=`Surveys API could not be loaded, status: ${n}`;return n!==0?Ut.error(s):e.error||Ut.warn(s),this.Ua=Date.now(),{surveys:[],context:{isLoaded:!1,error:s}}}this.Ua=null;const r=e.json.surveys||[];return t.kv.set({[Fh]:r,[nv]:Date.now()}),this.el(r),{surveys:r,context:{isLoaded:!0}}}el(t){const e=t.filter(n=>(function(r){return!(!r.start_date||r.end_date)})(n)&&(dL(n)||(function(r){var s;return!!(!((s=r.conditions)===null||s===void 0||(s=s.actions)===null||s===void 0||(s=s.values)===null||s===void 0)&&s.length)})(n)));this.al(e)}al(t){var e;(e=this._surveyEventReceiver)===null||e===void 0||e.replace(t)}sl(){return this.ll()&&!this.Ha&&!this.ul()}ll(){var t;const e=(t=this.Fa)===null||t===void 0?void 0:t.kv.get(nv);return Bn(e)&&Date.now()-e>3e5}ul(){return Bn(this.Ua)&&3e5>Date.now()-this.Ua}markSurveyAsSeen(t,e){var n;const r={id:t,current_iteration:(n=e==null?void 0:e.iteration)!==null&&n!==void 0?n:null};pL(r);try{localStorage.setItem("lastSeenSurveyDate",new Date().toISOString())}catch{}this.Va()}nl(t){for(const e of this.Ba){if(this.Ti)return;try{t.isLoaded?this.getSurveys(e):e([],t)}catch(n){Ut.error("Error in survey callback",n)}}}getActiveMatchingSurveys(t,e=!1){if(!ot(this._surveyManager))return this._surveyManager.getActiveMatchingSurveys(t,e);Ut.warn("init was not called")}onActiveMatchingSurveysChanged(t){var e;if(this.Ti)return()=>{};const n={callback:t,active:!0,revision:0};this.za.push(n),this.il();const r=(e=this.Fa)===null||e===void 0?void 0:e.kv.get(Fh);return this.Fr.disableSurveys||!this._surveyManager&&this.qa&&!this.ja||!r&&!ot(this.Ua)&&!this.Ha?this.Qa(n,{isLoaded:!1}):this._surveyManager&&this.Qa(n),()=>{var s;n.active=!1,this.za=this.za.filter(i=>i!==n),this.za.length===0&&((s=this.Ka)===null||s===void 0||s.call(this),this.Ka=void 0)}}il(){var t,e,n;this._surveyManager&&this.za.length>0&&((t=this.Ka)!==null&&t!==void 0||(this.Ka=(e=(n=this.Na).onMatchingConditionsChanged)===null||e===void 0?void 0:e.call(n,this.Va)))}Qa(t,e){if(this.Ti||!t.active)return;const n=++t.revision,r=s=>{if(!this.Ti&&t.active&&n===t.revision)try{const i=e??{isLoaded:!0},o=JSON.stringify([s,i]);if(o===t.lastResult)return;t.lastResult=o,t.callback(s,i)}catch(i){Ut.error("Error in active matching surveys callback",i)}};try{e&&!e.isLoaded?r([]):this.getActiveMatchingSurveys(r)}catch(s){Ut.error("Error in active matching surveys callback",s)}}cl(t){let e=null;return this.getSurveys(n=>{var r;e=(r=n.find(s=>s.id===t))!==null&&r!==void 0?r:null}),e}hl(t){if(ot(this._surveyManager))return{eligible:!1,reason:cd};const e=typeof t=="string"?this.cl(t):t;return e?this._surveyManager.checkSurveyEligibility(e):{eligible:!1,reason:"Survey not found"}}dl(t){var e;if(!(!((e=this.Fa)===null||e===void 0)&&e.canCapture))return{eligible:!1,reason:"PostHog is not capturing, so a survey response cannot be recorded"};if(ot(this._surveyManager))return{eligible:!1,reason:cd};const n=typeof t=="string"?this.cl(t):t;return n?this._surveyManager.checkSurveyRenderability(n):{eligible:!1,reason:"Survey not found"}}canRenderSurvey(t){if(ot(this._surveyManager))return Ut.warn("init was not called"),{visible:!1,disabledReason:cd};const e=this.dl(t);return{visible:e.eligible,disabledReason:e.reason}}canRenderSurveyAsync(t,e){return ot(this._surveyManager)?(Ut.warn("init was not called"),Promise.resolve({visible:!1,disabledReason:cd})):new Promise(n=>{this.getSurveys(r=>{var s;const i=(s=r.find(o=>o.id===t))!==null&&s!==void 0?s:null;if(i){const o=this.dl(i);n({visible:o.eligible,disabledReason:o.reason})}else n({visible:!1,disabledReason:"Survey not found"})},e)})}renderSurvey(t,e,n){var r,s,i;if(!(!((r=this.Fa)===null||r===void 0)&&r.canCapture))return;if(ot(this._surveyManager))return void Ut.warn("init was not called");const o=typeof t=="string"?this.cl(t):t;if(!(o!=null&&o.id))return void Ut.warn("Survey not found");if(!zH.includes(o.type))return void Ut.warn(`Surveys of type ${o.type} cannot be rendered in the app`);const l=(s=typeof document>"u"?void 0:document)===null||s===void 0?void 0:s.querySelector(e);if(l){if(!((i=o.appearance)===null||i===void 0)&&i.surveyPopupDelaySeconds){Ut.info(`Rendering survey ${o.id} with delay of ${o.appearance.surveyPopupDelaySeconds} seconds`);const u=setTimeout(()=>{var d,f,h;this.Wa.delete(u),!this.Ti&&(!((d=this.Fa)===null||d===void 0)&&d.canCapture)&&(Ut.info(`Rendering survey ${o.id} with delay of ${(f=o.appearance)===null||f===void 0?void 0:f.surveyPopupDelaySeconds} seconds`),(h=this._surveyManager)===null||h===void 0||h.renderSurvey(o,l,n),Ut.info(`Survey ${o.id} rendered`))},1e3*o.appearance.surveyPopupDelaySeconds);return void this.Wa.add(u)}this._surveyManager.renderSurvey(o,l,n)}else Ut.warn("Survey element not found")}displaySurvey(t,e){var n,r;if(!(!((n=this.Fa)===null||n===void 0)&&n.canCapture))return;if(ot(this._surveyManager))return void Ut.warn("init was not called");const s=this.cl(t);if(!s)return void Ut.warn("Survey not found");let i=s;if(!((r=s.appearance)===null||r===void 0)&&r.surveyPopupDelaySeconds&&e.ignoreDelay&&(i=F(F({},s),{},{appearance:F(F({},s.appearance),{},{surveyPopupDelaySeconds:0})})),e.displayType!==Qb.Popover&&e.initialResponses&&Ut.warn("initialResponses is only supported for popover surveys. prefill will not be applied."),e.ignoreConditions===!1){const o=this.hl(s);if(!o.eligible)return void Ut.warn("Survey is not eligible to be displayed: ",o.reason)}e.displayType!==Qb.Inline?this._surveyManager.handlePopoverSurvey(i,e):this.renderSurvey(i,e.selector,e.properties)}cancelPendingSurvey(t){ot(this._surveyManager)?Ut.warn("init was not called"):this._surveyManager.cancelSurvey(t)}handlePageUnload(){var t,e;(t=this._surveyManager)===null||t===void 0||(e=t.handlePageUnload)===null||e===void 0||e.call(t)}},yU=class{constructor(t){this._instance=t}get(){var t,e,n,r;const s=(t=this._instance)===null||t===void 0?void 0:t.config;return{disableSurveys:!!(s!=null&&s.disable_surveys),cookielessMode:!!(s!=null&&s.cookieless_mode),advancedEnableSurveys:!!(s!=null&&s.advanced_enable_surveys),requestTimeoutMs:(e=s==null?void 0:s.surveys_request_timeout_ms)!==null&&e!==void 0?e:1e4,prefillFromUrl:!!(!(s==null||(n=s.surveys)===null||n===void 0)&&n.prefillFromUrl),automaticDisplay:!(s!=null&&s.disable_surveys_automatic_display),featureFlagEvaluation:!(s!=null&&s.advanced_disable_feature_flags),overrideLanguage:s==null?void 0:s.override_display_language,prepareStylesheet:s==null?void 0:s.prepare_external_dependency_stylesheet,get_current_url:s==null?void 0:s.get_current_url,uiHost:(r=this._instance)===null||r===void 0||(r=r.requestRouter)===null||r===void 0?void 0:r.endpointFor("ui","")}}getExtensions(){const t=et==null?void 0:et.__PosthogExtensions__;if(!t||!this._instance)return;const e=this._instance,{generateSurveys:n,loadExternalDependency:r}=t;return{generateSurveys:n?s=>n(e,s):void 0,loadExternalDependency:r?s=>r(e,"surveys",s):void 0}}onMatchingConditionsChanged(t){var e,n;const r=(e=this._instance)===null||e===void 0?void 0:e._addCaptureHook(l=>{l!=="$pageview"&&l!==di.SHOWN&&l!==di.DISMISSED&&l!==di.SENT||t()}),s=()=>t();Lt(ae,"PHSurveyShown",s);let i=!1;const o=(n=this._instance)===null||n===void 0?void 0:n.onFeatureFlags(()=>{i&&t()});return i=!0,()=>{i=!1,r==null||r(),o==null||o(),ae==null||ae.removeEventListener("PHSurveyShown",s)}}};const _U=ae!=null&&ae.location?ov(ae.location.hash,"__posthog")||ov(location.hash,"state"):null,S8="_postHogToolbarParams",k8=En("[Toolbar]"),E8=En("[FeatureFlags]"),Rc=En("[FeatureFlags]",{debugEnabled:!0}),aw=`" failed. Feature flags didn't load in time.`,wU=[502,504],C8=["click","keydown","wheel","touchstart","pointerdown"],P8="connection_error",T8=t=>{const e={};for(let n=0;t.length>n;n++)e[t[n]]=!0;return e},R8=t=>{const e={};for(const[n,r]of wg(t||{}))r&&(e[n]=r);return e},bU=(t,e)=>t.distinctId===e.distinctId&&t.sessionId===e.sessionId&&((n,r)=>{const s=Object.keys(n);return s.length===Object.keys(r).length&&s.every(i=>n[i]===r[i])})(t.groups,e.groups);var xU=class{constructor(t){this.name="featureFlags",this.Pd=!1,this.featureFlagEventHandlers=[],this.R=E8,this.Od={},this.Fd={},this.Dd=[],this.Ld=new Set,this.Nd=new Set,this.jd=!1,this.qd=!1,this.Bd=0,this.zd=!1,this.Hd=!1,this.Ud=!1,this.Wd=new Map,this.Vd=!1,this.Gd=!1,this.Qd=!1,this.Jd=0,this.Zd=!1,this.sn=()=>{const e=this.Kd();this.Jd=0,e&&this.reloadFeatureFlags()},this.Yd=()=>{var e,n;const r=this.Xd,s=(e=this.tv)!==null&&e!==void 0?e:r;le(r)||le(s)||this.Fr.remoteRequestsDisabled||!this.ev||this.ev.visibilityState==="hidden"||Date.now()-((n=this.iv)!==null&&n!==void 0?n:0)<s||(this.tv=this.Zd||!this.Fr.idleRefreshBackoff?r:Math.min(2*s,36e5),this.Zd=!1,this.reloadFeatureFlags(),this.nv())},this.sv=()=>{this.Zd&&this.tv===this.Xd||this.rv()},this.an=()=>{var e;((e=this.ev)===null||e===void 0?void 0:e.visibilityState)==="visible"&&this.rv()},this.Na=t}get ov(){}av(){this.Fa&&this.lv()}setup(t){try{this.uv=typeof window>"u"?void 0:window,this.ev=typeof document>"u"?void 0:document}catch{this.uv=void 0,this.ev=void 0}return this.Ja=t,this.R=t.logger.createLogger("[FeatureFlags]"),RS(t.kv.initialize(),()=>{this.Ja===t&&(this.Ja=void 0,this.Fa=t,this.hv(t))})}hv(t){var e;if(this.Fa===t)return this.uv&&Lt(this.uv,"online",this.sn),this.lv(),this.dv=t.registerDynamicEventProperties(()=>this.vv()?this.Od:this.Fd),this.fv=(e=this.ov)===null||e===void 0?void 0:e.onCrossTabFeatureFlagChange(()=>{this.pv(),this.gv(),this.mv()}),this.gv(),this.initialize()}rv(){this.Zd=!0,this.tv=this.Xd,this.Yd()}lv(){var t;const e=this.Fr.refreshIntervalMs,n=!this.Fr.remoteRequestsDisabled&&this.ev&&!le(e)&&e>0?e:void 0;this.Fr.idleRefreshBackoff||(this.tv=n),n!==this.Xd&&(this.yv(),le(n)||(this.Xd=n,this.tv=n,this.nv(),!((t=this.ev)===null||t===void 0)&&t.addEventListener&&(Lt(this.ev,Md,this.an),Sd(C8,r=>{Lt(this.ev,r,this.sv,{capture:!0})}))))}nv(){le(this.Xd)||(le(this.bv)||clearInterval(this.bv),this.iv=Date.now(),this.bv=setInterval(this.Yd,this.Xd))}yv(){var t,e;le(this.bv)||(clearInterval(this.bv),this.bv=void 0,(t=this.ev)===null||t===void 0||(e=t.removeEventListener)===null||e===void 0||e.call(t,"visibilitychange",this.an),Sd(C8,n=>{var r,s;(r=this.ev)===null||r===void 0||(s=r.removeEventListener)===null||s===void 0||s.call(r,n,this.sv,{capture:!0})})),this.Xd=void 0,this.tv=void 0,this.Zd=!1,this.iv=void 0}destroy(){this._v()}dispose(){this._v()}_v(){var t,e,n;this.yv(),this.Bd++,this.Hd=!1,this.Ja=void 0,this.wv(this.Ld,"cancelled"),this.wv(this.Nd,"cancelled"),this.Fa&&(this.Sv(),(t=this.dv)===null||t===void 0||t.dispose(),this.dv=void 0,(e=this.fv)===null||e===void 0||e.call(this),this.fv=void 0,this.Dd=[],(n=this.uv)===null||n===void 0||n.removeEventListener("online",this.sn),this.Fa=void 0)}get Fr(){return this.Na.get()}xv(t){var e;return this.$v&&t in this.$v?this.$v[t]:(e=this.Fa)===null||e===void 0?void 0:e.kv.get(t)}pv(){return!!this.$v&&(this.$v=void 0,!0)}Cv(){var t;return!le((t=this.Fa)===null||t===void 0?void 0:t.kv.get("$enabled_feature_flags"))&&this.pv()}$t(t){this.Tv(()=>{var e;return(e=this.Fa)===null||e===void 0?void 0:e.kv.set(t)})}Iv(t,e,n){if(!this.ov||!t.$enabled_feature_flags)return;const r=this.xv("$enabled_feature_flags")||{},s=t.$enabled_feature_flags||{},i=e.flags||e.featureFlags,o=e.flags?Object.entries(e.flags).filter(([,b])=>!(b!=null&&b.failed)).map(([b])=>b):[],l=!!e.errorsWhileComputingFlags&&!!e.flags,u=l?o:n&&!He(i)?Object.keys(i||{}):Array.from(new Set([...Object.keys(r),...Object.keys(s)])),d=this.xv("$feature_flag_payloads")||{},f=t.$feature_flag_payloads||{},h=l||n?u:Array.from(new Set([...Object.keys(d),...Object.keys(f)])),m=!l&&!n,g=!!m||u,_=!!m||h,y={[Ta]:g,[uo]:g,[Ml]:_};t.$feature_flag_details&&(y[ru]=g);for(const b of[su,zl,Jh])le(t[b])||(y[b]=!0);this.ov.markCrossTabFeatureFlagChanges(y)}Dt(t){this.Tv(()=>{var e;return(e=this.Fa)===null||e===void 0?void 0:e.kv.remove(t)})}Tv(t){try{t()}catch(e){this.R.error("Failed to update feature flag persistence",e)}}gv(){const t={};for(const r of[Ta,Ml,su,Mo]){const s=this.xv(r);le(s)||(t[r]=s)}this.Od=t;const e=F({},t),n=this.xv(uo);if(n)for(const[r,s]of Object.entries(n))e[`$feature/${r}`]=s;this.Fd=e}vv(){const t=this.Fr.cacheTtlMs;if(!t||0>=t)return!1;const e=this.xv(zl);return typeof e!="number"||Date.now()-e>t}Mv(){return!!this.vv()&&(this.Qd||this.qd||(this.Qd=!0,this.R.warn("Feature flag cache is stale, triggering refresh..."),this.reloadFeatureFlags()),!0)}Ev(){const t=this.Fr.evaluationContexts;return t!=null&&t.length?t.filter(e=>{const n=e&&typeof e=="string"&&e.trim().length>0;return n||this.R.error("Invalid evaluation context found:",e,"Expected non-empty string"),n}):[]}Av(){const t=this.Fr.flagKeys;if(!le(t))return t.filter(e=>{const n=e&&typeof e=="string"&&e.trim().length>0;return n||this.R.error("Invalid flag key found:",e,"Expected non-empty string"),n})}initialize(){var t,e;const n=this.Fr,r=(t=(e=n.bootstrap)===null||e===void 0?void 0:e.featureFlags)!==null&&t!==void 0?t:{};if(Object.keys(r).length){var s,i;const o=(s=(i=n.bootstrap)===null||i===void 0?void 0:i.featureFlagPayloads)!==null&&s!==void 0?s:{},l=Object.keys(r).filter(d=>!le(r[d])).reduce((d,f)=>(d[f]=r[f],d),{}),u=Object.keys(o).filter(d=>l[d]).reduce((d,f)=>(d[f]=o[f],d),{});return this.Rv({featureFlags:l,featureFlagPayloads:u},void 0,{persist:!1})}}updateFlags(t,e,n){var r,s;const i=n!=null&&n.merge&&(r=this.xv("$enabled_feature_flags"))!==null&&r!==void 0?r:{},o=n!=null&&n.merge&&(s=this.xv("$feature_flag_payloads"))!==null&&s!==void 0?s:{},l=F(F({},i),t),u=F(F({},o),e),d={};for(const[f,h]of Object.entries(l))d[f]={key:f,enabled:vP(h),variant:yP(h),reason:void 0,metadata:le(u==null?void 0:u[f])?void 0:{id:0,version:void 0,description:void 0,payload:u[f]}};this.Rv({flags:d})}get hasLoadedFlags(){return this.jd}getFlags(){return Object.keys(this.getFlagVariants())}getFlagsWithDetails(){const t=this.xv(ru),e=this.xv(Mo),n=this.xv(zc);if(!n&&!e)return t||{};const r=mn({},t||{}),s=[...new Set([...Object.keys(n||{}),...Object.keys(e||{})])];for(const l of s){var i,o;const u=r[l],d=e==null?void 0:e[l],f=le(d)?(i=u==null?void 0:u.enabled)!==null&&i!==void 0&&i:!!d,h=le(d)?u==null?void 0:u.variant:typeof d=="string"?d:void 0,m=n==null?void 0:n[l],g=F(F({},u),{},{enabled:f,variant:f?h??(u==null?void 0:u.variant):void 0});f!==(u==null?void 0:u.enabled)&&(g.original_enabled=u==null?void 0:u.enabled),h!==(u==null?void 0:u.variant)&&(g.original_variant=u==null?void 0:u.variant),m&&(g.metadata=F(F({},u==null?void 0:u.metadata),{},{payload:m,original_payload:u==null||(o=u.metadata)===null||o===void 0?void 0:o.payload})),r[l]=g}return this.Pd||(this.R.warn(" Overriding feature flag details!",{flagDetails:t,overriddenPayloads:n,finalDetails:r}),this.Pd=!0),r}getAllFeatureFlags(){const t=this.getFlagVariants(),e=this.getFlagPayloads();return Object.keys(t).map(n=>{const r=t[n];return{key:n,enabled:vP(r),variant:yP(r),payload:gP(e[n])}})}getFlagVariants(){const t=this.xv(uo),e=this.xv(Mo);if(!e)return t||{};const n=mn({},t||{}),r=Object.keys(e);for(let s=0;r.length>s;s++)n[r[s]]=e[r[s]];return this.Pd||(this.R.warn(" Overriding feature flags!",{enabledFlags:t,overriddenFlags:e,finalFlags:n}),this.Pd=!0),n}getFlagPayloads(){const t=this.xv(Ml),e=this.xv(zc);if(!e)return t||{};const n=mn({},t||{}),r=Object.keys(e);for(let s=0;r.length>s;s++)n[r[s]]=e[r[s]];return this.Pd||(this.R.warn(" Overriding feature flag payloads!",{flagPayloads:t,overriddenPayloads:e,finalPayloads:n}),this.Pd=!0),n}reloadFeatureFlags(){this.zd||this.Fr.featureFlagsDisabled||this.Kd()||(this.Ud&&this.R.warn("reloadFeatureFlags() was called inside an onFeatureFlags callback. This callback also runs when flags change in other tabs, so this can cause a request loop."),this.qd&&(this.Hd=!0),this.Pv||(this.Dd.slice().forEach(t=>{try{t()}catch(e){this.R.error("Error while running feature flags reloading callback",e)}}),this.Pv=setTimeout(()=>{this.Ov()},5)))}reloadFeatureFlagsAsync(){return!this.Fa||this.zd||this.Fr.featureFlagsDisabled||this.Fr.remoteRequestsDisabled||this.Kd()?Promise.resolve({status:"skipped"}):new Promise(t=>{this.Ld.add(t),this.reloadFeatureFlags()})}wv(t,e){t.forEach(n=>n({status:e})),t.clear()}Sv(){clearTimeout(this.Pv),this.Pv=void 0}onReloading(t){return this.Dd.push(t),()=>{this.Dd=this.Dd.filter(e=>e!==t)}}ensureFlagsLoaded(){this.jd||this.qd||this.Pv||this.reloadFeatureFlags()}setAnonymousDistinctId(t){this.$anon_distinct_id=t}setReloadingPaused(t){this.zd=t}resetFlagCallReported(){this.Dt(zo),this.Wd=new Map}sendFlagCallsPendingCapture(){var t;if(this.Wd.size!==0&&!this.Vd&&(!((t=this.Fa)===null||t===void 0)&&t.canCapture)&&!this.Fa.isRateLimited){this.Vd=!0;try{const e=this.getFlagVariants();for(const n of Array.from(this.Wd.keys())){const r=this.Wd.get(n);if(r){if(r.value!==String(e[n])||!bU(r.context,this.Fv())){this.Wd.delete(n);continue}if(this.getFeatureFlagResult(n),this.Wd.has(n))break}}}finally{this.Vd=!1}}}Ov(t){var e;this.Sv();const n=this.Fa;if(!n||this.Fr.remoteRequestsDisabled||this.Kd())return void this.wv(this.Ld,"skipped");if(this.qd)return void(this.Hd=!0);const r={token:n.projectToken,distinct_id:n.distinctId,groups:n.groups,$anon_distinct_id:this.$anon_distinct_id,person_properties:F(F(F({},n.initialPersonProperties),this.xv("$stored_person_properties")||{}),{},{$lib:n.library.name,$lib_version:n.library.version}),group_properties:this.xv(Il),timezone:CS()};le(n.deviceId)||(r.$device_id=n.deviceId),(t!=null&&t.disableFlags||this.Fr.featureFlagsDisabled)&&(r.disable_flags=!0);const s=this.Ev();s.length&&(r.evaluation_contexts=s);const i=this.Av();le(i)||(r.flag_keys=i);const o=this.Fr.onlyEvaluateSurveyFeatureFlags,l="/flags/?v=2"+(o?"&only_evaluate_survey_feature_flags=true":""),u=this.Bd,d=this.Ld;this.Ld=new Set,this.Nd=d,this.qd=!0;const f=()=>{this.Hd&&(this.Hd=!1,this.Ov())},h=b=>{var x,S;const E=(x=b.json)!==null&&x!==void 0?x:{},C=b.statusCode!==200;if(this.qd=!1,u!==this.Bd)return void f();if(this.Dv(b.statusCode),C||this.Hd||(this.$anon_distinct_id=void 0),r.disable_flags&&!this.Hd)return void this.wv(d,"skipped");this.Gd=!C;const R=[];b.error?R.push(b.error instanceof Error&&b.error.name==="AbortError"?"timeout":b.error instanceof Error?P8:"unknown_error"):b.statusCode!==200&&R.push(`api_error_${b.statusCode}`),E.errorsWhileComputingFlags&&R.push("errors_while_computing_flags");const O=!!(!((S=E.quotaLimited)===null||S===void 0)&&S.includes("feature_flags"));O&&R.push("quota_limited"),this.$t({[xp]:R}),O?this.R.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.Rv(E,C,{partialResponse:o}),this.wv(d,r.disable_flags?"skipped":R.length||!E.flags&&!E.featureFlags?"error":"loaded"),f()},m=b=>{this.qd=!1,u===this.Bd&&(this.$t({[xp]:[P8]}),this.R.error("Feature flag request failed",b),this.Cv()&&this.mv(!0),this.wv(d,"error")),f()};let g=(e=this.Fr.requestMaxRetries)!==null&&e!==void 0?e:1;const _=()=>g>0&&u===this.Bd,y=()=>{if(u!==this.Bd||!this.Fa||this.Fr.remoteRequestsDisabled)return this.qd=!1,this.wv(d,"skipped"),void f();try{n.sendRequest(l,{target:"flags",method:"POST",body:r,compression:this.Fr.compression,sentAt:"body",timeoutMs:this.Fr.requestTimeoutMs}).then(b=>{if((x=>wU.includes(x.statusCode)||(S=>S.statusCode===0&&S.error instanceof Error&&S.error.name==="AbortError")(x))(b)&&_())return g--,void setTimeout(y,500);h(b)}).catch(m)}catch(b){m(b)}};y()}Kd(){return NM(this.Jd,3)}Dv(t){this.Jd=DM(t,this.Jd,3,()=>this.R.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.Gd)return;if(!(this.jd||this.getFlags()&&this.getFlags().length>0))return void this.R.warn('getFeatureFlag for key "'+t+aw);if(this.Mv())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.Gd)return;if(!(this.jd||this.getFlags()&&this.getFlags().length>0))return void this.R.warn('getFeatureFlagResult for key "'+t+aw);if(this.Mv())return;const n=this.getFlagVariants(),r=t in n,s=n[t],i=this.getFlagPayloads()[t],o=String(s),l=this.xv("$feature_flag_request_id")||void 0,u=this.xv("$feature_flag_evaluated_at")||void 0;let d,f=this.xv("$flag_call_reported")||{};if(this.Fr.deduplicateCallsPerSession){var h;const W=(h=this.Fa)===null||h===void 0||(h=h.session)===null||h===void 0?void 0:h.sessionId,X=this.xv($h);W&&W!==X&&(f={},d=W)}if(!e.send_event&&"send_event"in e)d&&this.$t({[zo]:f,[$h]:d});else{var m,g,_;const W=!(!((m=this.Fa)===null||m===void 0)&&m.canCapture),X=!W&&!(!((g=this.Fa)===null||g===void 0)&&g.isRateLimited);var y;if(X?this.Wd.delete(t):(W&&Object.keys(f).length>0&&(f={},this.$t({[zo]:f})),!((y=f[t])===null||y===void 0)&&y.includes(o)||this.Lv(t,o)),X&&!(!((_=f[t])===null||_===void 0)&&_.includes(o))){var b,x,S,E,C,R,O,I,A,L,N,H,$;He(f[t])?f[t].push(o):f[t]=[o],this.$t(F({[zo]:f},d?{[$h]:d}:{}));const z=this.getFeatureFlagDetails(t),K=[...(b=this.xv("$feature_flag_errors"))!==null&&b!==void 0?b:[]];le(s)&&K.push("flag_missing");const te={$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:(x=(S=this.Fr.bootstrap)===null||S===void 0||(S=S.featureFlags)===null||S===void 0?void 0:S[t])!==null&&x!==void 0?x:null,$feature_flag_bootstrapped_payload:(E=(C=this.Fr.bootstrap)===null||C===void 0||(C=C.featureFlagPayloads)===null||C===void 0?void 0:C[t])!==null&&E!==void 0?E:null,$used_bootstrap_value:!this.Gd};le(z==null||(R=z.metadata)===null||R===void 0?void 0:R.has_experiment)||(te.$feature_flag_has_experiment=z.metadata.has_experiment),le(z==null||(O=z.metadata)===null||O===void 0?void 0:O.version)||(te.$feature_flag_version=z.metadata.version);const Z=(I=z==null||(A=z.reason)===null||A===void 0?void 0:A.description)!==null&&I!==void 0?I:z==null||(L=z.reason)===null||L===void 0?void 0:L.code;Z&&(te.$feature_flag_reason=Z),!(z==null||(N=z.metadata)===null||N===void 0)&&N.id&&(te.$feature_flag_id=z.metadata.id),le(z==null?void 0:z.original_variant)&&le(z==null?void 0:z.original_enabled)||(te.$feature_flag_original_response=le(z.original_variant)?z.original_enabled:z.original_variant),!(z==null||(H=z.metadata)===null||H===void 0)&&H.original_payload&&(te.$feature_flag_original_payload=z==null||($=z.metadata)===null||$===void 0?void 0:$.original_payload),K.length&&(te.$feature_flag_error=K.join(",")),this.Nv(te)||(this.jv(t,o),this.Lv(t,o))}else d&&this.$t({[zo]:f,[$h]:d})}return r?{key:t,enabled:!!s,variant:typeof s=="string"?s:void 0,payload:gP(i)}:void 0}Nv(t){try{var e;return((e=this.Fa)===null||e===void 0?void 0:e.capture("$feature_flag_called",t))!==!1}catch(n){return this.R.error("Failed to capture feature flag call",n),!0}}Lv(t,e){this.Wd.set(t,{value:e,context:this.Fv()})}Fv(){var t,e,n;return{distinctId:(t=this.Fa)===null||t===void 0?void 0:t.distinctId,groups:F({},(e=this.Fa)===null||e===void 0?void 0:e.groups),sessionId:this.Fr.deduplicateCallsPerSession?(n=this.Fa)===null||n===void 0||(n=n.session)===null||n===void 0?void 0:n.sessionId:void 0}}jv(t,e){const n=this.xv("$flag_call_reported")||{},r=n[t];He(r)&&r.includes(e)&&(n[t]=r.filter(s=>s!==e),this.$t({[zo]:n}))}getRemoteConfigPayload(t,e){this.qv(t,e)}qv(t,e){var n=this;return un(function*(){const r=n.Fa;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.Av();let l;le(o)||(s.flag_keys=o);try{var u;const d=(u=(yield r.sendRequest("/flags/?v=2",{target:"flags",method:"POST",body:s,compression:n.Fr.compression,sentAt:"body",timeoutMs:n.Fr.requestTimeoutMs})).json)===null||u===void 0?void 0:u.featureFlagPayloads;l=(d==null?void 0:d[t])||void 0}catch(d){return void n.R.error("Remote config feature flag request failed",d)}try{e(l)}catch(d){n.R.error("Remote config feature flag callback failed",d)}})()}isFeatureEnabled(t,e={}){if(e.fresh&&!this.Gd)return e.defaultValue;if(!(this.jd||this.getFlags()&&this.getFlags().length>0))return this.R.warn('isFeatureEnabled for key "'+t+aw),e.defaultValue;const n=this.getFeatureFlag(t,e);return le(n)?e.defaultValue:!!n}addFeatureFlagsHandler(t){this.featureFlagEventHandlers.push(t)}removeFeatureFlagsHandler(t){this.featureFlagEventHandlers=this.featureFlagEventHandlers.filter(e=>e!==t)}receivedFeatureFlags(t,e,n){this.Rv(t,e,n)}Rv(t,e,n){if(!this.Fa)return;this.jd=!0;const r=((s,i={},o={},l={},u,d=E8)=>{const f=((E,C)=>{const R=E.flags;if(R){const O=Object.fromEntries(Object.keys(R).map(A=>{var L;return[A,(L=R[A].variant)!==null&&L!==void 0?L:R[A].enabled]})),I=Object.fromEntries(Object.keys(R).filter(A=>R[A].enabled).filter(A=>{var L;return!le((L=R[A].metadata)===null||L===void 0?void 0:L.payload)}).map(A=>{var L;return[A,(L=R[A].metadata)===null||L===void 0?void 0:L.payload]}));return F(F({},E),{},{featureFlags:O,featureFlagPayloads:I})}return E.featureFlags&&C.warn("Using an older version of the feature flags endpoint. Please upgrade your PostHog server to the latest version"),E})(s,d),h=f.flags,m=f.featureFlags,g=f.featureFlagPayloads;if(!m)return;const _=s.requestId,y=s.evaluatedAt;if(He(m)){d.warn("v1 of the feature flags endpoint is deprecated. Please use the latest version.");const E={};if(m)for(let C=0;m.length>C;C++)E[m[C]]=!0;return{[Ta]:m,[uo]:E,[Jh]:!1}}let b=m,x=g,S=h;if(u!=null&&u.partialResponse){const E=Object.keys(b),C=x||{};b=F(F({},i),b),x=F(F({},o),C),E.forEach(R=>{R in C||x==null||delete x[R]}),S=F(F({},l),S)}else if(s.errorsWhileComputingFlags)if(h){const E=new Set(Object.keys(h).filter(R=>{var O;return!(!((O=h[R])===null||O===void 0)&&O.failed)}));b=F(F({},i),Object.fromEntries(Object.entries(b).filter(([R])=>E.has(R))));const C=Object.fromEntries(Object.entries(x||{}).filter(([R])=>E.has(R)));x=F(F({},o),C),E.forEach(R=>{R in C||x==null||delete x[R]}),S=F(F({},l),Object.fromEntries(Object.entries(S||{}).filter(([R])=>E.has(R))))}else b=F(F({},i),b),x=F(F({},o),x),S=F(F({},l),S);return F(F({[Ta]:Object.keys(R8(b)),[uo]:b||{},[Ml]:x||{},[ru]:S||{},[Jh]:s.minimalFlagCalledEvents===!0},_?{[su]:_}:{}),y?{[zl]:y}:{})})(t,this.getFlagVariants(),this.getFlagPayloads(),this.getFlagsWithDetails(),n,this.R);if(r)if((n==null?void 0:n.persist)===!1){const s=!le(this.Fa.kv.get(uo));this.$v=r,s||this.$t(r)}else this.pv(),this.Iv(r,t,!!(n!=null&&n.partialResponse)),this.$t(r);else e&&this.Cv();e||(this.Qd=!1),this.mv(e)}override(t,e=!1){this.R.warn("override is deprecated. Please use overrideFeatureFlags instead."),this.overrideFeatureFlags({flags:t,suppressWarning:e})}overrideFeatureFlags(t){this.Bv(t)}Bv(t){if(this.Fa){if(t===!1)return this.Dt([Mo,zc]),this.mv(),void Rc.info("All overrides cleared");if(He(t))return this.$t({[Mo]:T8(t)}),this.mv(),void Rc.info("Flag overrides set",{flags:t});if(t&&typeof t=="object"&&("flags"in t||"payloads"in t)){var e;const n=t;this.Pd=!!((e=n.suppressWarning)!==null&&e!==void 0&&e);const r={},s=n.flags,i=n.payloads;return s&&(r[Mo]=He(s)?T8(s):s),i&&(r[zc]=i),Object.keys(r).length&&this.$t(r),s===!1&&i===!1?this.Dt([Mo,zc]):s===!1?this.Dt(Mo):i===!1&&this.Dt(zc),this.mv(),s===!1?Rc.info("Flag overrides cleared"):s&&Rc.info("Flag overrides set",{flags:s}),void(i===!1?Rc.info("Payload overrides cleared"):i&&Rc.info("Payload overrides set",{payloads:i}))}if(t&&typeof t=="object")return this.$t({[Mo]:t}),this.mv(),void Rc.info("Flag overrides set",{flags:t});this.R.warn("Invalid overrideOptions provided to overrideFeatureFlags",{overrideOptions:t})}else this.R.warn("posthog.featureFlags.overrideFeatureFlags called before feature flags were ready")}onFeatureFlags(t){if(this.addFeatureFlagsHandler(t),this.jd){const{flags:e,flagVariants:n}=this.zv();try{t(e,n)}catch(r){this.R.error("Error while running feature flags callback",r)}}return()=>this.removeFeatureFlagsHandler(t)}updateEarlyAccessFeatureEnrollment(t,e,n){var r;const s=(this.xv("$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=F(F({},this.getFlagVariants()),{},{[t]:e});(r=this.ov)===null||r===void 0||r.markCrossTabFeatureFlagChanges({$active_feature_flags:[t],$enabled_feature_flags:[t],$stored_person_properties:Object.keys(i)}),this.$t({[Ta]:Object.keys(R8(l)),[uo]:l,[Ol]:F(F({},this.xv("$stored_person_properties")||{}),i)}),this.mv();try{var u;(u=this.Fa)===null||u===void 0||u.capture("$feature_enrollment_update",o)}catch(d){this.R.error("Failed to capture early access feature enrollment",d)}}getEarlyAccessFeatures(t,e=!1,n){const r=this.xv(jb);!r||e?this.Hv(t,n):t(r)}Hv(t,e){var n=this;return un(function*(){const r=n.Fa;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({[jb]:i})}catch(o){return void n.R.error("Early access feature request failed",o)}try{t(i)}catch(o){n.R.error("Early access feature callback failed",o)}})()}zv(){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),{})}}mv(t){this.gv();const{flags:e,flagVariants:n}=this.zv(),r=this.Ud;this.Ud=!0,this.featureFlagEventHandlers.forEach(s=>{try{s(e,n,{errorsLoading:t})}catch(i){this.R.error("Error while running feature flags callback",i)}}),this.Ud=r}setPersonPropertiesForFlags(t,e=!0){this.Uv(t,e)}Uv(t,e=!0){const n=this.xv("$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({[Ol]:F(F(F({},n),i),r)}),e&&this.reloadFeatureFlags()}unsetPersonPropertiesForFlags(t,e=!0){const n=F({},this.xv("$stored_person_properties")||{});t.forEach(r=>{delete n[r]}),this.$t({[Ol]:n}),e&&this.reloadFeatureFlags()}resetPersonPropertiesForFlags(t=!0){this.Dt(Ol),t&&this.reloadFeatureFlags()}setGroupPropertiesForFlags(t,e=!0){const n=this.xv("$stored_group_properties")||{},r=F({},n);for(const s of Object.keys(t))r[s]=F(F({},n[s]),t[s]);this.$t({[Il]:r}),e&&this.reloadFeatureFlags()}resetGroupPropertiesForFlags(t){if(t){const e=this.xv("$stored_group_properties")||{};this.$t({[Il]:F(F({},e),{},{[t]:{}})})}else this.Dt(Il)}reset(){this.Bd++,this.wv(this.Ld,"cancelled"),this.wv(this.Nd,"cancelled"),this.Hd=!1,this.Od={},this.Fd={},this.$v=void 0,this.jd=!1,this.zd=!1,this.Gd=!1,this.$anon_distinct_id=void 0,this.Sv(),this.Pd=!1,this.Jd=0,this.Wd=new Map}};const A8=En("[FeatureFlags]");var SU=class{constructor(t,e=!1){this.Wv=!1,this.update(t,e)}update(t,e){this.Vv=((n,r)=>{var s,i,o,l,u,d,f,h;return{bootstrap:{featureFlags:(s=(i=n.bootstrap)===null||i===void 0?void 0:i.featureFlags)!==null&&s!==void 0?s:void 0,featureFlagPayloads:(o=(l=n.bootstrap)===null||l===void 0?void 0:l.featureFlagPayloads)!==null&&o!==void 0?o:void 0},remoteRequestsDisabled:r,featureFlagsDisabled:!!n.advanced_disable_feature_flags,onlyEvaluateSurveyFeatureFlags:!!n.advanced_only_evaluate_survey_feature_flags,deduplicateCallsPerSession:!!n.advanced_feature_flags_dedup_per_session,cacheTtlMs:n.feature_flag_cache_ttl_ms,refreshIntervalMs:(u=n.remote_config_refresh_interval_ms)!==null&&u!==void 0?u:3e5,idleRefreshBackoff:le(n.remote_config_refresh_interval_ms),requestTimeoutMs:n.feature_flag_request_timeout_ms,requestMaxRetries:Math.max(0,(d=n.feature_flag_request_max_retries)!==null&&d!==void 0?d:1),compression:n.disable_compression?void 0:"best-available",evaluationContexts:(f=(h=n.evaluation_contexts)!==null&&h!==void 0?h:n.evaluation_environments)!==null&&f!==void 0?f:[],flagKeys:He(n.flag_keys)?n.flag_keys:void 0}})(t,e),!t.evaluation_environments||t.evaluation_contexts||this.Wv||(A8.warn("evaluation_environments is deprecated. Use evaluation_contexts instead. evaluation_environments will be removed in a future version."),this.Wv=!0),le(t.flag_keys)||He(t.flag_keys)||A8.error("Invalid flag_keys found:",t.flag_keys,"Expected array of non-empty strings")}get(){return this.Vv}},$0=class extends xU{constructor(t){const e=new SU(t.config,t.lc());super(e),this.name=vL,this._instance=t,this.Gv=e}get ov(){return this._instance.persistence}updateConfig(t,e){this.Gv.update(t,e),this.av()}};const I8=t=>Mf(t)&&(t.name==="RangeError"&&t.message.indexOf("Maximum call stack size exceeded")===0||t.name==="InternalError"&&t.message==="too much recursion"),no=En("[Error tracking]"),i2="webkit-masked-url:",kU=[{value:"isolatedAPI.contexts.topHostname",exact:!1},{value:"No response from target",exact:!0}],EU=["chrome-extension://","moz-extension://","safari-extension:","safari-web-extension:",i2],CU=["__firefox__","__gCrWeb"];function O8(t,e){(e==null||e>t.length)&&(e=t.length);for(var n=0,r=Array(e);e>n;n++)r[n]=t[n];return r}function PU(t,e){return(function(n){if(Array.isArray(n))return n})(t)||(function(n,r){var s=n==null?null:typeof Symbol<"u"&&n[Symbol.iterator]||n["@@iterator"];if(s!=null){var i,o,l,u,d=[],f=!0,h=!1;try{if(l=(s=s.call(n)).next,r!==0)for(;!(f=(i=l.call(s)).done)&&(d.push(i.value),d.length!==r);f=!0);}catch(m){h=!0,o=m}finally{try{if(!f&&s.return!=null&&(u=s.return(),Object(u)!==u))return}finally{if(h)throw o}}return d}})(t,e)||(function(n,r){if(n){if(typeof n=="string")return O8(n,r);var s={}.toString.call(n).slice(8,-1);return s==="Object"&&n.constructor&&(s=n.constructor.name),s==="Map"||s==="Set"?Array.from(n):s==="Arguments"||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(s)?O8(n,r):void 0}})(t,e)||(function(){throw new TypeError(`Invalid attempt to destructure non-iterable instance.
19
- In order to be iterable, non-array objects must have a [Symbol.iterator]() method.`)})()}const wL=Object.entries,M8=Object.setPrototypeOf,TU=Object.isFrozen,RU=Object.getPrototypeOf,AU=Object.getOwnPropertyDescriptor;let Kr=Object.freeze,Yr=Object.seal,vd=Object.create,bL=typeof Reflect<"u"&&Reflect,o2=bL.apply,a2=bL.construct;Kr||(Kr=function(t){return t}),Yr||(Yr=function(t){return t}),o2||(o2=function(t,e){for(var n=arguments.length,r=new Array(n>2?n-2:0),s=2;n>s;s++)r[s-2]=arguments[s];return t.apply(e,r)}),a2||(a2=function(t){for(var e=arguments.length,n=new Array(e>1?e-1:0),r=1;e>r;r++)n[r-1]=arguments[r];return new t(...n)});const ud=gr([].forEach),IU=gr([].lastIndexOf),L8=gr([].pop),dd=gr([].push),OU=gr([].splice),bl=Array.isArray,Vh=gr("".toLowerCase),lw=gr("".toString),N8=gr("".match),Rh=gr("".replace),D8=gr("".indexOf),MU=gr("".trim),LU=gr(0 .toString),NU=gr(Boolean.prototype.toString),$8=typeof BigInt>"u"?null:gr(BigInt.prototype.toString),F8=typeof Symbol>"u"?null:gr(Symbol.prototype.toString),Nr=gr({}.hasOwnProperty),F0=gr({}.toString),Mr=gr(/t/.test),Ac=(j8=TypeError,function(){for(var t=arguments.length,e=new Array(t),n=0;t>n;n++)e[n]=arguments[n];return a2(j8,e)});var j8;function gr(t){return function(e){e instanceof RegExp&&(e.lastIndex=0);for(var n=arguments.length,r=new Array(n>1?n-1:0),s=1;n>s;s++)r[s-1]=arguments[s];return o2(t,e,r)}}function Ht(t,e){let n=arguments.length>2&&arguments[2]!==void 0?arguments[2]:Vh;if(M8&&M8(t,null),!bl(e))return t;let r=e.length;for(;r--;){let s=e[r];if(typeof s=="string"){const i=n(s);i!==s&&(TU(e)||(e[r]=i),s=i)}t[s]=!0}return t}function DU(t){for(let e=0;t.length>e;e++)Nr(t,e)||(t[e]=null);return t}function os(t){const e=vd(null);for(const r of wL(t)){var n=PU(r,2);const s=n[0],i=n[1];Nr(t,s)&&(e[s]=bl(i)?DU(i):i&&typeof i=="object"&&i.constructor===Object?os(i):i)}return e}function ro(t,e){for(;t!==null;){const n=AU(t,e);if(n){if(n.get)return gr(n.get);if(typeof n.value=="function")return gr(n.value)}t=RU(t)}return function(){return null}}const z8=Kr(["a","abbr","acronym","address","area","article","aside","audio","b","bdi","bdo","big","blink","blockquote","body","br","button","canvas","caption","center","cite","code","col","colgroup","content","data","datalist","dd","decorator","del","details","dfn","dialog","dir","div","dl","dt","element","em","fieldset","figcaption","figure","font","footer","form","h1","h2","h3","h4","h5","h6","head","header","hgroup","hr","html","i","img","input","ins","kbd","label","legend","li","main","map","mark","marquee","menu","menuitem","meter","nav","nobr","ol","optgroup","option","output","p","picture","pre","progress","q","rp","rt","ruby","s","samp","search","section","select","shadow","slot","small","source","spacer","span","strike","strong","style","sub","summary","sup","table","tbody","td","template","textarea","tfoot","th","thead","time","tr","track","tt","u","ul","var","video","wbr"]),cw=Kr(["svg","a","altglyph","altglyphdef","altglyphitem","animatecolor","animatemotion","animatetransform","circle","clippath","defs","desc","ellipse","enterkeyhint","exportparts","filter","font","g","glyph","glyphref","hkern","image","inputmode","line","lineargradient","marker","mask","metadata","mpath","part","path","pattern","polygon","polyline","radialgradient","rect","stop","style","switch","symbol","text","textpath","title","tref","tspan","view","vkern"]),uw=Kr(["feBlend","feColorMatrix","feComponentTransfer","feComposite","feConvolveMatrix","feDiffuseLighting","feDisplacementMap","feDistantLight","feDropShadow","feFlood","feFuncA","feFuncB","feFuncG","feFuncR","feGaussianBlur","feImage","feMerge","feMergeNode","feMorphology","feOffset","fePointLight","feSpecularLighting","feSpotLight","feTile","feTurbulence"]),$U=Kr(["animate","color-profile","cursor","discard","font-face","font-face-format","font-face-name","font-face-src","font-face-uri","foreignobject","hatch","hatchpath","mesh","meshgradient","meshpatch","meshrow","missing-glyph","script","set","solidcolor","unknown","use"]),dw=Kr(["math","menclose","merror","mfenced","mfrac","mglyph","mi","mlabeledtr","mmultiscripts","mn","mo","mover","mpadded","mphantom","mroot","mrow","ms","mspace","msqrt","mstyle","msub","msup","msubsup","mtable","mtd","mtext","mtr","munder","munderover","mprescripts"]),FU=Kr(["maction","maligngroup","malignmark","mlongdiv","mscarries","mscarry","msgroup","mstack","msline","msrow","semantics","annotation","annotation-xml","mprescripts","none"]),V8=Kr(["#text"]),H8=Kr(["accept","action","align","alt","autocapitalize","autocomplete","autopictureinpicture","autoplay","background","bgcolor","border","capture","cellpadding","cellspacing","checked","cite","class","clear","color","cols","colspan","command","commandfor","controls","controlslist","coords","crossorigin","datetime","decoding","default","dir","disabled","disablepictureinpicture","disableremoteplayback","download","draggable","enctype","enterkeyhint","exportparts","face","for","headers","height","hidden","high","href","hreflang","id","inert","inputmode","integrity","ismap","kind","label","lang","list","loading","loop","low","max","maxlength","media","method","min","minlength","multiple","muted","name","nonce","noshade","novalidate","nowrap","open","optimum","part","pattern","placeholder","playsinline","popover","popovertarget","popovertargetaction","poster","preload","pubdate","radiogroup","readonly","rel","required","rev","reversed","role","rows","rowspan","spellcheck","scope","selected","shape","size","sizes","slot","span","srclang","start","src","srcset","step","style","summary","tabindex","title","translate","type","usemap","valign","value","width","wrap","xmlns"]),fw=Kr(["accent-height","accumulate","additive","alignment-baseline","amplitude","ascent","attributename","attributetype","azimuth","basefrequency","baseline-shift","begin","bias","by","class","clip","clippathunits","clip-path","clip-rule","color","color-interpolation","color-interpolation-filters","color-profile","color-rendering","cx","cy","d","dx","dy","diffuseconstant","direction","display","divisor","dominant-baseline","dur","edgemode","elevation","end","exponent","fill","fill-opacity","fill-rule","filter","filterunits","flood-color","flood-opacity","font-family","font-size","font-size-adjust","font-stretch","font-style","font-variant","font-weight","fx","fy","g1","g2","glyph-name","glyphref","gradientunits","gradienttransform","height","href","id","image-rendering","in","in2","intercept","k","k1","k2","k3","k4","kerning","keypoints","keysplines","keytimes","lang","lengthadjust","letter-spacing","kernelmatrix","kernelunitlength","lighting-color","local","marker-end","marker-mid","marker-start","markerheight","markerunits","markerwidth","maskcontentunits","maskunits","max","mask","mask-type","media","method","mode","min","name","numoctaves","offset","operator","opacity","order","orient","orientation","origin","overflow","paint-order","path","pathlength","patterncontentunits","patterntransform","patternunits","points","preservealpha","preserveaspectratio","primitiveunits","r","rx","ry","radius","refx","refy","repeatcount","repeatdur","restart","result","rotate","scale","seed","shape-rendering","slope","specularconstant","specularexponent","spreadmethod","startoffset","stddeviation","stitchtiles","stop-color","stop-opacity","stroke-dasharray","stroke-dashoffset","stroke-linecap","stroke-linejoin","stroke-miterlimit","stroke-opacity","stroke","stroke-width","style","surfacescale","systemlanguage","tabindex","tablevalues","targetx","targety","transform","transform-origin","text-anchor","text-decoration","text-orientation","text-rendering","textlength","type","u1","u2","unicode","values","viewbox","visibility","version","vert-adv-y","vert-origin-x","vert-origin-y","width","word-spacing","wrap","writing-mode","xchannelselector","ychannelselector","x","x1","x2","xmlns","y","y1","y2","z","zoomandpan"]),U8=Kr(["accent","accentunder","align","bevelled","close","columnalign","columnlines","columnspacing","columnspan","denomalign","depth","dir","display","displaystyle","encoding","fence","frame","height","href","id","largeop","length","linethickness","lquote","lspace","mathbackground","mathcolor","mathsize","mathvariant","maxsize","minsize","movablelimits","notation","numalign","open","rowalign","rowlines","rowspacing","rowspan","rspace","rquote","scriptlevel","scriptminsize","scriptsizemultiplier","selection","separator","separators","stretchy","subscriptshift","supscriptshift","symmetric","voffset","width","xmlns"]),j0=Kr(["xlink:href","xml:id","xlink:title","xml:space","xmlns:xlink"]),jU=Yr(/{{[\w\W]*|^[\w\W]*}}/g),zU=Yr(/<%[\w\W]*|^[\w\W]*%>/g),VU=Yr(/\${[\w\W]*/g),HU=Yr(/^data-[\-\w.\u00B7-\uFFFF]+$/),UU=Yr(/^aria-[\-\w]+$/),Z8=Yr(/^(?:(?:(?:f|ht)tps?|mailto|tel|callto|sms|cid|xmpp|matrix):|[^a-z]|[a-z+.\-]+(?:[^a-z+.\-:]|$))/i),ZU=Yr(/^(?:\w+script|data):/i),BU=Yr(/[\u0000-\u0020\u00A0\u1680\u180E\u2000-\u2029\u205F\u3000]/g),WU=Yr(/^html$/i),KU=Yr(/^[a-z][.\w]*(-[.\w]+)+$/i),B8=Yr(/<[/\w!]/g),W8=Yr(/<[/\w]/g),GU=Yr(/<\/no(script|embed|frames)/i),qU=Yr(/\/>/i),YU=function(){return typeof window>"u"?null:window},pl=function(t,e,n,r){return Nr(t,e)&&bl(t[e])?Ht(r.base?os(r.base):{},t[e],r.transform):n};var XU=(function t(){let e=arguments.length>0&&arguments[0]!==void 0?arguments[0]:YU();const n=D=>t(D);if(n.version="3.4.13",n.removed=[],!e||!e.document||e.document.nodeType!==9||!e.Element)return n.isSupported=!1,n;let r=e.document;const s=r,i=s.currentScript,o=e.HTMLTemplateElement,l=e.Node,u=e.NodeFilter,d=e.DOMParser,f=e.trustedTypes,h=e.Element.prototype,m=ro(h,"cloneNode"),g=ro(h,"remove"),_=ro(h,"nextSibling"),y=ro(h,"childNodes"),b=ro(h,"parentNode"),x=ro(h,"shadowRoot"),S=ro(h,"attributes"),E=l&&l.prototype?ro(l.prototype,"nodeType"):null,C=l&&l.prototype?ro(l.prototype,"nodeName"):null,R=l&&l.prototype?ro(l.prototype,"ownerDocument"):null;if(typeof o=="function"){const D=r.createElement("template");D.content&&D.content.ownerDocument&&(r=D.content.ownerDocument)}let O,I,A="",L=!1,N=0;const H=function(){if(N>0)throw Ac('A configured TRUSTED_TYPES_POLICY callback (createHTML or createScriptURL) must not call DOMPurify.sanitize, as that causes infinite recursion. Do not pass a policy whose callbacks wrap DOMPurify as TRUSTED_TYPES_POLICY; see the "DOMPurify and Trusted Types" section of the README.')},$=function(D){H(),N++;try{return O.createHTML(D)}finally{N--}},W=r.implementation,X=r.createNodeIterator,z=r.createDocumentFragment,K=r.getElementsByTagName,te=s.importNode;let Z={afterSanitizeAttributes:[],afterSanitizeElements:[],afterSanitizeShadowDOM:[],beforeSanitizeAttributes:[],beforeSanitizeElements:[],beforeSanitizeShadowDOM:[],uponSanitizeAttribute:[],uponSanitizeElement:[],uponSanitizeShadowNode:[]};n.isSupported=typeof wL=="function"&&typeof b=="function"&&W&&W.createHTMLDocument!==void 0;const J=jU,q=zU,j=VU,Y=HU,ue=UU,ie=ZU,ce=BU,he=KU;let ke=Z8,ve=null;const pe=Ht({},[...z8,...cw,...uw,...dw,...V8]);let Ne=null;const Ae=Ht({},[...H8,...fw,...U8,...j0]);let $e=Object.seal(vd(null,{tagNameCheck:{writable:!0,configurable:!1,enumerable:!0,value:null},attributeNameCheck:{writable:!0,configurable:!1,enumerable:!0,value:null},allowCustomizedBuiltInElements:{writable:!0,configurable:!1,enumerable:!0,value:!1}})),kt=null,fn=null;const on=Object.seal(vd(null,{tagCheck:{writable:!0,configurable:!1,enumerable:!0,value:null},attributeCheck:{writable:!0,configurable:!1,enumerable:!0,value:null}}));let Et=!0,Gt=!0,vn=!1,Qt=!0,Me=!1,Qe=!0,Te=!1,St=!1,be=null,Nt=null,ft=!1,pt=!1,qn=!1,Ei=!1,xn=!0,nr=!1;const Gi="user-content-";let ps=!0,Xr=!1,Yn={},hn=null;const Qr=Ht({},["annotation-xml","audio","colgroup","desc","foreignobject","head","iframe","math","mi","mn","mo","ms","mtext","noembed","noframes","noscript","plaintext","script","selectedcontent","style","svg","template","thead","title","video","xmp"]);let ar=null;const vo=Ht({},["audio","video","img","source","image","track"]);let zr=null;const Xn=Ht({},["alt","class","for","id","label","name","pattern","placeholder","role","summary","title","value","style","xmlns"]),Pr="http://www.w3.org/1998/Math/MathML",ni="http://www.w3.org/2000/svg",rr="http://www.w3.org/1999/xhtml";let ms=rr,st=!1,sn=null;const Jt=Ht({},[Pr,ni,rr],lw),pn=Kr(["mi","mo","mn","ms","mtext"]);let Sn=Ht({},pn);const Bt=Kr(["annotation-xml"]);let In=Ht({},Bt);const Jr=Ht({},["title","style","font","a","script"]);let Qn=null;const vr=["application/xhtml+xml","text/html"];let Vt=null,Ci=null;const Uf=r.createElement("form"),Ka=function(D){return D instanceof RegExp||D instanceof Function},yo=function(){let D=arguments.length>0&&arguments[0]!==void 0?arguments[0]:{};if(Ci&&Ci===D)return;D&&typeof D=="object"||(D={}),D=os(D),Qn=vr.indexOf(D.PARSER_MEDIA_TYPE)===-1?"text/html":D.PARSER_MEDIA_TYPE,Vt=Qn==="application/xhtml+xml"?lw:Vh,ve=pl(D,"ALLOWED_TAGS",pe,{transform:Vt}),Ne=pl(D,"ALLOWED_ATTR",Ae,{transform:Vt}),sn=pl(D,"ALLOWED_NAMESPACES",Jt,{transform:lw}),zr=pl(D,"ADD_URI_SAFE_ATTR",Xn,{transform:Vt,base:Xn}),ar=pl(D,"ADD_DATA_URI_TAGS",vo,{transform:Vt,base:vo}),hn=pl(D,"FORBID_CONTENTS",Qr,{transform:Vt}),kt=pl(D,"FORBID_TAGS",os({}),{transform:Vt}),fn=pl(D,"FORBID_ATTR",os({}),{transform:Vt}),Yn=!!Nr(D,"USE_PROFILES")&&(D.USE_PROFILES&&typeof D.USE_PROFILES=="object"?os(D.USE_PROFILES):D.USE_PROFILES),Et=D.ALLOW_ARIA_ATTR!==!1,Gt=D.ALLOW_DATA_ATTR!==!1,vn=D.ALLOW_UNKNOWN_PROTOCOLS||!1,Qt=D.ALLOW_SELF_CLOSE_IN_ATTR!==!1,Me=D.SAFE_FOR_TEMPLATES||!1,Qe=D.SAFE_FOR_XML!==!1,Te=D.WHOLE_DOCUMENT||!1,pt=D.RETURN_DOM||!1,qn=D.RETURN_DOM_FRAGMENT||!1,Ei=D.RETURN_TRUSTED_TYPE||!1,ft=D.FORCE_BODY||!1,xn=D.SANITIZE_DOM!==!1,nr=D.SANITIZE_NAMED_PROPS||!1,ps=D.KEEP_CONTENT!==!1,Xr=D.IN_PLACE||!1,ke=(function(me){try{return Mr(me,""),!0}catch{return!1}})(D.ALLOWED_URI_REGEXP)?D.ALLOWED_URI_REGEXP:Z8,ms=typeof D.NAMESPACE=="string"?D.NAMESPACE:rr,Sn=Nr(D,"MATHML_TEXT_INTEGRATION_POINTS")&&D.MATHML_TEXT_INTEGRATION_POINTS&&typeof D.MATHML_TEXT_INTEGRATION_POINTS=="object"?os(D.MATHML_TEXT_INTEGRATION_POINTS):Ht({},pn),In=Nr(D,"HTML_INTEGRATION_POINTS")&&D.HTML_INTEGRATION_POINTS&&typeof D.HTML_INTEGRATION_POINTS=="object"?os(D.HTML_INTEGRATION_POINTS):Ht({},Bt);const de=Nr(D,"CUSTOM_ELEMENT_HANDLING")&&D.CUSTOM_ELEMENT_HANDLING&&typeof D.CUSTOM_ELEMENT_HANDLING=="object"?os(D.CUSTOM_ELEMENT_HANDLING):vd(null);if($e=vd(null),Nr(de,"tagNameCheck")&&Ka(de.tagNameCheck)&&($e.tagNameCheck=de.tagNameCheck),Nr(de,"attributeNameCheck")&&Ka(de.attributeNameCheck)&&($e.attributeNameCheck=de.attributeNameCheck),Nr(de,"allowCustomizedBuiltInElements")&&typeof de.allowCustomizedBuiltInElements=="boolean"&&($e.allowCustomizedBuiltInElements=de.allowCustomizedBuiltInElements),Yr($e),Me&&(Gt=!1),qn&&(pt=!0),Yn&&(ve=Ht({},V8),Ne=vd(null),Yn.html===!0&&(Ht(ve,z8),Ht(Ne,H8)),Yn.svg===!0&&(Ht(ve,cw),Ht(Ne,fw),Ht(Ne,j0)),Yn.svgFilters===!0&&(Ht(ve,uw),Ht(Ne,fw),Ht(Ne,j0)),Yn.mathMl===!0&&(Ht(ve,dw),Ht(Ne,U8),Ht(Ne,j0))),on.tagCheck=null,on.attributeCheck=null,Nr(D,"ADD_TAGS")&&(typeof D.ADD_TAGS=="function"?on.tagCheck=D.ADD_TAGS:bl(D.ADD_TAGS)&&(ve===pe&&(ve=os(ve)),Ht(ve,D.ADD_TAGS,Vt))),Nr(D,"ADD_ATTR")&&(typeof D.ADD_ATTR=="function"?on.attributeCheck=D.ADD_ATTR:bl(D.ADD_ATTR)&&(Ne===Ae&&(Ne=os(Ne)),Ht(Ne,D.ADD_ATTR,Vt))),Nr(D,"ADD_URI_SAFE_ATTR")&&bl(D.ADD_URI_SAFE_ATTR)&&Ht(zr,D.ADD_URI_SAFE_ATTR,Vt),Nr(D,"FORBID_CONTENTS")&&bl(D.FORBID_CONTENTS)&&(hn===Qr&&(hn=os(hn)),Ht(hn,D.FORBID_CONTENTS,Vt)),Nr(D,"ADD_FORBID_CONTENTS")&&bl(D.ADD_FORBID_CONTENTS)&&(hn===Qr&&(hn=os(hn)),Ht(hn,D.ADD_FORBID_CONTENTS,Vt)),ps&&(ve["#text"]=!0),Te&&Ht(ve,["html","head","body"]),ve.table&&(Ht(ve,["tbody"]),delete kt.tbody),D.TRUSTED_TYPES_POLICY){if(typeof D.TRUSTED_TYPES_POLICY.createHTML!="function")throw Ac('TRUSTED_TYPES_POLICY configuration option must provide a "createHTML" hook.');if(typeof D.TRUSTED_TYPES_POLICY.createScriptURL!="function")throw Ac('TRUSTED_TYPES_POLICY configuration option must provide a "createScriptURL" hook.');const me=O;O=D.TRUSTED_TYPES_POLICY;try{A=$("")}catch(xe){throw O=me,xe}}else D.TRUSTED_TYPES_POLICY===null?(O=void 0,A=""):(O===void 0&&(L||(I=(function(me,xe){if(typeof me!="object"||typeof me.createPolicy!="function")return null;let Be=null;const vt="data-tt-policy-suffix";xe&&xe.hasAttribute(vt)&&(Be=xe.getAttribute(vt));const mt="dompurify"+(Be?"#"+Be:"");try{return me.createPolicy(mt,{createHTML:$t=>$t,createScriptURL:$t=>$t})}catch{return console.warn("TrustedTypes policy "+mt+" could not be created."),null}})(f,i),L=!0),O=I),O&&typeof A=="string"&&(A=$("")));Kr&&Kr(D),Ci=D},Tr=Ht({},[...cw,...uw,...$U]),Pi=Ht({},[...dw,...FU]),Rs=function(D){dd(n.removed,{element:D});try{b(D).removeChild(D)}catch{if(g(D),!b(D))throw Ac("a node selected for removal could not be detached from its tree and cannot be safely returned; refusing to sanitize in place")}},qi=function(D){ri(D);const de=y(D);if(de){const xe=[];ud(de,Be=>{dd(xe,Be)}),ud(xe,Be=>{try{g(Be)}catch{}})}const me=S(D);if(me)for(let xe=me.length-1;xe>=0;--xe){const Be=me[xe],vt=Be&&Be.name;if(typeof vt=="string")try{D.removeAttribute(vt)}catch{}}},As=function(D,de){try{dd(n.removed,{attribute:de.getAttributeNode(D),from:de})}catch{dd(n.removed,{attribute:null,from:de})}if(de.removeAttribute(D),D==="is")if(pt||qn)try{Rs(de)}catch{}else try{de.setAttribute(D,"")}catch{}},Ga=function(D){const de=S(D);if(de)for(let me=de.length-1;me>=0;--me){const xe=de[me],Be=xe&&xe.name;if(typeof Be=="string"&&!Ne[Vt(Be)])try{D.removeAttribute(Be)}catch{}}},ri=function(D){const de=[D];for(;de.length>0;){const me=de.pop();(E?E(me):me.nodeType)===1&&Ga(me);const xe=y(me);if(xe)for(let Be=xe.length-1;Be>=0;--Be)de.push(xe[Be])}},dc=function(D){let de=null,me=null;if(ft)D="<remove></remove>"+D;else{const vt=N8(D,/^[\r\n\t ]+/);me=vt&&vt[0]}Qn==="application/xhtml+xml"&&ms===rr&&(D='<html xmlns="http://www.w3.org/1999/xhtml"><head></head><body>'+D+"</body></html>");const xe=O?$(D):D;if(ms===rr)try{de=new d().parseFromString(xe,Qn)}catch{}if(!de||!de.documentElement){de=W.createDocument(ms,"template",null);try{de.documentElement.innerHTML=st?A:xe}catch{}}const Be=de.body||de.documentElement;return D&&me&&Be.insertBefore(r.createTextNode(me),Be.childNodes[0]||null),ms===rr?K.call(de,Te?"html":"body")[0]:Te?de.documentElement:Be},Tu=function(D){const de=R?R(D):D.ownerDocument;return X.call(de||D,D,u.SHOW_ELEMENT|u.SHOW_COMMENT|u.SHOW_TEXT|u.SHOW_PROCESSING_INSTRUCTION|u.SHOW_CDATA_SECTION,null)},qa=function(D){return D=Rh(D,J," "),D=Rh(D,q," "),Rh(D,j," ")},an=function(D){var de;D.normalize();const me=R?R(D):D.ownerDocument,xe=X.call(me||D,D,u.SHOW_TEXT|u.SHOW_COMMENT|u.SHOW_CDATA_SECTION|u.SHOW_PROCESSING_INSTRUCTION,null);let Be=xe.nextNode();for(;Be;)Be.data=qa(Be.data),Be=xe.nextNode();const vt=(de=D.querySelectorAll)===null||de===void 0?void 0:de.call(D,"template");vt&&ud(vt,mt=>{si(mt.content)&&an(mt.content)})},_o=function(D){const de=C?C(D):null;return typeof de=="string"&&Vt(de)==="form"&&(typeof D.nodeName!="string"||typeof D.textContent!="string"||typeof D.removeChild!="function"||D.attributes!==S(D)||typeof D.removeAttribute!="function"||typeof D.setAttribute!="function"||typeof D.namespaceURI!="string"||typeof D.insertBefore!="function"||typeof D.hasChildNodes!="function"||D.nodeType!==E(D)||D.childNodes!==y(D))},si=function(D){if(!E||typeof D!="object"||D===null)return!1;try{return E(D)===11}catch{return!1}},wo=function(D){if(!E||typeof D!="object"||D===null)return!1;try{return typeof E(D)=="number"}catch{return!1}};function Vr(D,de,me){D.length!==0&&ud(D,xe=>{xe.call(n,de,me,Ci)})}const fc=function(D,de,me,xe){return D.length===0?de:de===me||de===xe?os(de):de},hc=function(D,de){if(Vr(Z.beforeSanitizeElements,D,null),D!==de&&b(D)===null)return Xr&&ri(D),!0;if(_o(D))return Rs(D),!0;const me=Vt(C?C(D):D.nodeName);if(ve=fc(Z.uponSanitizeElement,ve,pe,be),Vr(Z.uponSanitizeElement,D,{tagName:me,allowedTags:ve}),D!==de&&b(D)===null)return Xr&&ri(D),!0;if((function(xe,Be){return!!(Qe&&xe.hasChildNodes()&&!wo(xe.firstElementChild)&&Mr(B8,xe.textContent)&&Mr(B8,xe.innerHTML))||!(!Qe||xe.namespaceURI!==rr||Be!=="style"||!wo(xe.firstElementChild))||xe.nodeType===7||!(!Qe||xe.nodeType!==8||!Mr(W8,xe.data))})(D,me))return Rs(D),!0;if(kt[me]||!(on.tagCheck instanceof Function&&on.tagCheck(me))&&!ve[me]){const xe=(function(Be,vt,mt){if(!kt[vt]&&Ru(vt)&&($e.tagNameCheck instanceof RegExp&&Mr($e.tagNameCheck,vt)||$e.tagNameCheck instanceof Function&&$e.tagNameCheck(vt)))return!1;if(ps&&!hn[vt]){const $t=b(Be),qt=y(Be);if(qt&&$t)for(let yt=qt.length-1;yt>=0;--yt){const On=Be===mt?m(qt[yt],!0):qt[yt];$t.insertBefore(On,_(Be))}}return Rs(Be),!0})(D,me,de);return xe===!1&&Vr(Z.afterSanitizeElements,D,null),xe}if((E?E(D):D.nodeType)===1&&!(function(xe){let Be=b(xe);Be&&Be.tagName||(Be={namespaceURI:ms,tagName:"template"});const vt=Vh(xe.tagName),mt=Vh(Be.tagName);return!!sn[xe.namespaceURI]&&(xe.namespaceURI===ni?(function($t,qt,yt){return qt.namespaceURI===rr?$t==="svg":qt.namespaceURI===Pr?$t==="svg"&&(yt==="annotation-xml"||Sn[yt]):!!Tr[$t]})(vt,Be,mt):xe.namespaceURI===Pr?(function($t,qt,yt){return qt.namespaceURI===rr?$t==="math":qt.namespaceURI===ni?$t==="math"&&In[yt]:!!Pi[$t]})(vt,Be,mt):xe.namespaceURI===rr?(function($t,qt,yt){return!(qt.namespaceURI===ni&&!In[yt])&&!(qt.namespaceURI===Pr&&!Sn[yt])&&!Pi[$t]&&(Jr[$t]||!Tr[$t])})(vt,Be,mt):!(Qn!=="application/xhtml+xml"||!sn[xe.namespaceURI]))})(D)||(me==="noscript"||me==="noembed"||me==="noframes")&&Mr(GU,D.innerHTML))return Rs(D),!0;if(Me&&D.nodeType===3){const xe=qa(D.textContent);D.textContent!==xe&&(dd(n.removed,{element:D.cloneNode()}),D.textContent=xe)}return Vr(Z.afterSanitizeElements,D,null),!1},ra=function(D,de,me){if(fn[de]||Qe&&de==="patchsrc"||Qe&&de==="for"&&D!=="label"&&D!=="output"||xn&&(de==="id"||de==="name")&&(me in r||me in Uf))return!1;const xe=Ne[de]||on.attributeCheck instanceof Function&&on.attributeCheck(de,D);if(!(Gt&&Mr(Y,de))){if(!(Et&&Mr(ue,de))){if(xe){if(!zr[de]){if(!Mr(ke,Rh(me,ce,""))){if((de!=="src"&&de!=="xlink:href"&&de!=="href"||D==="script"||D8(me,"data:")!==0||!ar[D])&&!(vn&&!Mr(ie,Rh(me,ce,"")))){if(me)return!1}}}}else if(!(Ru(D)&&($e.tagNameCheck instanceof RegExp&&Mr($e.tagNameCheck,D)||$e.tagNameCheck instanceof Function&&$e.tagNameCheck(D))&&($e.attributeNameCheck instanceof RegExp&&Mr($e.attributeNameCheck,de)||$e.attributeNameCheck instanceof Function&&$e.attributeNameCheck(de,D))||de==="is"&&$e.allowCustomizedBuiltInElements&&($e.tagNameCheck instanceof RegExp&&Mr($e.tagNameCheck,me)||$e.tagNameCheck instanceof Function&&$e.tagNameCheck(me))))return!1}}return!0},es=Ht({},["annotation-xml","color-profile","font-face","font-face-format","font-face-name","font-face-src","font-face-uri","missing-glyph"]),Ru=function(D){return!es[Vh(D)]&&Mr(he,D)},gs=function(D,de,me,xe){if(O&&typeof f=="object"&&typeof f.getAttributeType=="function"&&!me)switch(f.getAttributeType(D,de)){case"TrustedHTML":return $(xe);case"TrustedScriptURL":return(function(Be){H(),N++;try{return O.createScriptURL(Be)}finally{N--}})(xe)}return xe},Zf=function(D,de,me,xe){try{me?D.setAttributeNS(me,de,xe):D.setAttribute(de,xe),_o(D)?Rs(D):L8(n.removed)}catch{As(de,D)}},Au=function(D){Vr(Z.beforeSanitizeAttributes,D,null);const de=D.attributes;if(!de||_o(D))return;Ne=fc(Z.uponSanitizeAttribute,Ne,Ae,Nt);const me={attrName:"",attrValue:"",keepAttr:!0,allowedAttributes:Ne,forceKeepAttr:void 0};let xe=de.length;const Be=Vt(D.nodeName);for(;xe--;){const vt=de[xe],mt=vt.name,$t=vt.namespaceURI,qt=vt.value,yt=Vt(mt),On=qt;let it=mt==="value"?On:MU(On);me.attrName=yt,me.attrValue=it,me.keepAttr=!0,me.forceKeepAttr=void 0,Vr(Z.uponSanitizeAttribute,D,me),it=me.attrValue,!nr||yt!=="id"&&yt!=="name"||D8(it,Gi)===0||(As(mt,D),it=Gi+it),Qe&&Mr(/((--!?|])>)|<\/(style|script|title|xmp|textarea|noscript|iframe|noembed|noframes)/i,it)||yt==="attributename"&&N8(it,"href")?As(mt,D):me.forceKeepAttr||(!me.keepAttr||!Qt&&Mr(qU,it)?As(mt,D):(Me&&(it=qa(it)),ra(Be,yt,it)?(it=gs(Be,yt,$t,it),it!==On&&Zf(D,mt,$t,it)):As(mt,D)))}Vr(Z.afterSanitizeAttributes,D,null)},bo=function(D){let de=null;const me=Tu(D);for(Vr(Z.beforeSanitizeShadowDOM,D,null);de=me.nextNode();)if(Vr(Z.uponSanitizeShadowNode,de,null),hc(de,D),Au(de),si(de.content)&&bo(de.content),(E?E(de):de.nodeType)===1){const xe=x(de);si(xe)&&(xo(xe),bo(xe))}Vr(Z.afterSanitizeShadowDOM,D,null)},xo=function(D){const de=[{node:D,shadow:null}];for(;de.length>0;){const me=de.pop();if(me.shadow){bo(me.shadow);continue}const xe=me.node,Be=(E?E(xe):xe.nodeType)===1,vt=y(xe);if(vt)for(let mt=vt.length-1;mt>=0;--mt)de.push({node:vt[mt],shadow:null});if(Be){const mt=C?C(xe):null;if(typeof mt=="string"&&Vt(mt)==="template"){const $t=xe.content;si($t)&&de.push({node:$t,shadow:null})}}if(Be){const mt=x(xe);si(mt)&&de.push({node:null,shadow:mt},{node:mt,shadow:null})}}};return n.sanitize=function(D){let de=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{},me=null,xe=null,Be=null,vt=null;if(st=!D,st&&(D="<!-->"),typeof D!="string"&&!wo(D)&&typeof(D=(function(yt){switch(typeof yt){case"string":return yt;case"number":return LU(yt);case"boolean":return NU(yt);case"bigint":return $8?$8(yt):"0";case"symbol":return F8?F8(yt):"Symbol()";case"undefined":default:return F0(yt);case"function":case"object":{if(yt===null)return F0(yt);const On=yt,it=ro(On,"toString");if(typeof it=="function"){const Rr=it(On);return typeof Rr=="string"?Rr:F0(Rr)}return F0(yt)}}})(D))!="string")throw Ac("dirty is not a string, aborting");if(!n.isSupported)return D;St?(ve=be,Ne=Nt):yo(de),(Z.uponSanitizeElement.length>0||Z.uponSanitizeAttribute.length>0)&&(ve=os(ve)),Z.uponSanitizeAttribute.length>0&&(Ne=os(Ne)),n.removed=[];const mt=Xr&&typeof D!="string"&&wo(D);if(mt){(function(On){if(!Qe)return;const it=[On];for(;it.length>0;){const Rr=it.pop(),Ya=E?E(Rr):Rr.nodeType;if(Ya===7||Ya===8&&Mr(W8,Rr.data)){try{g(Rr)}catch{}continue}if(Ya===1){const yr=Rr,sa=Vt(C?C(Rr):Rr.nodeName);try{yr.hasAttribute&&yr.hasAttribute("patchsrc")&&yr.removeAttribute("patchsrc"),yr.hasAttribute&&yr.hasAttribute("for")&&sa!=="label"&&sa!=="output"&&yr.removeAttribute("for")}catch{}}const So=y(Rr);if(So)for(let yr=So.length-1;yr>=0;--yr)it.push(So[yr])}})(D);const yt=C?C(D):D.nodeName;if(typeof yt=="string"){const On=Vt(yt);if(!ve[On]||kt[On])throw qi(D),Ac("root node is forbidden and cannot be sanitized in-place")}if(_o(D))throw qi(D),Ac("root node is clobbered and cannot be sanitized in-place");try{xo(D)}catch(On){throw qi(D),On}}else if(wo(D))me=dc("<!---->"),xe=me.ownerDocument.importNode(D,!0),xe.nodeType===1&&xe.nodeName==="BODY"||xe.nodeName==="HTML"?me=xe:me.appendChild(xe),xo(xe);else{if(!pt&&!Me&&!Te&&D.indexOf("<")===-1)return O&&Ei?$(D):D;if(me=dc(D),!me)return pt?null:Ei?A:""}me&&ft&&Rs(me.firstChild);const $t=mt?D:me;try{const yt=Tu($t);for(;Be=yt.nextNode();)hc(Be,$t),Au(Be),si(Be.content)&&bo(Be.content)}catch(yt){throw mt&&(qi(D),ud(n.removed,On=>{On.element&&ri(On.element)})),yt}if(mt)return ud(n.removed,yt=>{yt.element&&ri(yt.element)}),Me&&an(D),D;if(pt){if(Me&&an(me),qn)for(vt=z.call(me.ownerDocument);me.firstChild;)vt.appendChild(me.firstChild);else vt=me;return(Ne.shadowroot||Ne.shadowrootmode)&&(vt=te.call(s,vt,!0)),vt}let qt=Te?me.outerHTML:me.innerHTML;return Te&&ve["!doctype"]&&me.ownerDocument&&me.ownerDocument.doctype&&me.ownerDocument.doctype.name&&Mr(WU,me.ownerDocument.doctype.name)&&(qt="<!DOCTYPE "+me.ownerDocument.doctype.name+`>
20
- `+qt),Me&&(qt=qa(qt)),O&&Ei?$(qt):qt},n.setConfig=function(){yo(arguments.length>0&&arguments[0]!==void 0?arguments[0]:{}),St=!0,be=ve,Nt=Ne},n.clearConfig=function(){Ci=null,St=!1,be=null,Nt=null,O=I,A=""},n.isValidAttribute=function(D,de,me){Ci||yo({});const xe=Vt(D),Be=Vt(de);return ra(xe,Be,me)},n.addHook=function(D,de){typeof de=="function"&&Nr(Z,D)&&dd(Z[D],de)},n.removeHook=function(D,de){if(Nr(Z,D)){if(de!==void 0){const me=IU(Z[D],de);return me===-1?void 0:OU(Z[D],me,1)[0]}return L8(Z[D])}},n.removeHooks=function(D){Nr(Z,D)&&(Z[D]=[])},n.removeAllHooks=function(){Z={afterSanitizeAttributes:[],afterSanitizeElements:[],afterSanitizeShadowDOM:[],beforeSanitizeAttributes:[],beforeSanitizeElements:[],beforeSanitizeShadowDOM:[],uponSanitizeAttribute:[],uponSanitizeElement:[],uponSanitizeShadowNode:[]}},n})();const K8="Refusing to render web experiment since the viewer is a likely bot",G8={ADD_ATTR:(t,e)=>t==="target"&&e==="a"||t==="form"&&/^(button|fieldset|input|output|select|textarea)$/.test(e),ADD_URI_SAFE_ATTR:["form"]};let q8;const QU={icontains:(t,e)=>e.toLowerCase().indexOf(t.toLowerCase())>-1,not_icontains:(t,e)=>e.toLowerCase().indexOf(t.toLowerCase())===-1,regex:(t,e)=>uv(e,t),not_regex:(t,e)=>!uv(e,t),exact:(t,e)=>e===t,is_not:(t,e)=>e!==t},Ni=En("[Conversations]"),Ic="Conversations not available yet.";function Y8(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,m=le(h)?Math.max(f,2048):Math.max(f,h),g=F(F({},(function(){let _="",y="";try{var b;const x="u">typeof globalThis?globalThis:"u">typeof window?window:void 0,S=x==null||(b=x.navigator)===null||b===void 0?void 0:b.userAgent;S&&([_,y]=PO(S))}catch{}return(function(x,S){const E=(function(C){if(C)return{}.hasOwnProperty.call(SP,C)?SP[C]:C})(x);return F(F({},E?{"os.name":E}:{}),S?{"os.version":S}:{})})(_,y)})()),t==null?void 0:t.resourceAttributes);return{serviceName:(i=(o=g==null?void 0:g["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=g==null?void 0:g["service.version"])!==null&&l!==void 0?l:t==null?void 0:t.serviceVersion,environment:(u=g==null?void 0:g["deployment.environment"])!==null&&u!==void 0?u:t==null?void 0:t.environment,resourceAttributes:g,beforeSend:t==null?void 0:t.beforeSend,flushIntervalMs:d,maxBufferSize:f,maxQueueSize:m,maxBatchRecordsPerPost:100,rateCapWindowMs:d,maxLogsPerInterval:h,backgroundFlushBudgetMs:0,terminationFlushBudgetMs:0}}const JU=["debug","log","warn","error","info"],eZ=t=>{for(;t!=null&&t.__rrweb_original__;)t=t.__rrweb_original__;return t},X8="console",xL="__posthogHandledLogsRequestError",hw=(t,e)=>{const n=t instanceof Error?t:new Error(e);return n[xL]=!0,n},Q8=t=>!!t&&typeof t=="object"&&t[xL]===!0;var tZ=class{get Qv(){return F(F({},this.R),{},{error:(...t)=>{t.some(Q8)||this.R.error(...t)}})}constructor(t,e){var n;this.Na=t,this.Jv=e,this.name="logs",this.Zv=!1,this.Kv=!1,this.Yv=!1,this.R=En("[logs]"),this.cc=[],this.Xv=[],this.Jd=0,this.tf=!1,this.Ti=!1,this.ef=[],this.if=[],this.nf=!1,this.sf=!1,this.rf=!1,this.af=()=>{var r,s;this.Ti||(this.Jd=0,(r=this.lf)===null||r===void 0||r.onReconnect(),(s=this.uf)===null||s===void 0||s.onReconnect())},this.Zv=!!(!((n=t.get())===null||n===void 0)&&n.captureConsoleLogs)}get cf(){return!0}hf(){}df(){if(!this.rf){try{this.uv=typeof window>"u"?void 0:window}catch{this.uv=void 0}this.uv&&(Lt(this.uv,"online",this.af),this.rf=!0)}}vf(t,e,n,r){this.df();const s=Y8(this.Na.get(),n);return[new vV(this.ff(t,e),s,this.Qv,()=>this.Jv(),i=>i(),void 0,r),s]}pf(){const t=this.Na.get();var e;return this.lf&&this.gf===t||((e=this.lf)===null||e===void 0||e.reset(),this.gf=t,[this.lf,this.mf]=this.vf(()=>this.cc,n=>{this.cc=n})),this.lf}yf(){const t=this.Na.get();var e;return this.uf&&this.bf===t||((e=this.uf)===null||e===void 0||e.reset(),this.bf=t,[this.uf,this._f]=this.vf(()=>this.Xv,n=>{this.Xv=n},{serviceNameDefault:"posthog-browser-logs",consoleCapture:!0},X8)),this.uf}setup(t){if(!this.Ti&&!this.tf)return this.tf=!0,this.Fa=t,this.R=t.logger.createLogger("[logs]"),RS(t.kv.initialize(),()=>{this.Ti||this.hv(t)})}hv(t){var e;this.df(),!((e=this.Na.get())===null||e===void 0)&&e.captureConsoleLogs&&(this.Zv=!0),(this.Zv||this.Na.remoteConfigWillArrive&&t.kv.get(this.Na.captureHintKey))&&this.wf();let n=!1;const r=t.onRemoteConfig(s=>{var i;n=s.ok&&((i=s.config.logs)===null||i===void 0?void 0:i.captureConsoleLogs)===!0,this.onRemoteConfig(s)});this.Ti?r.dispose():(this.Za=r,n||this.loadIfEnabled())}dispose(){var t,e,n,r,s,i,o;this.Ti||(this.Ti=!0,this.kf(),(t=this.Za)===null||t===void 0||t.dispose(),this.Za=void 0,this.Fa=void 0,this.Yv=!1,(e=this.uv)===null||e===void 0||e.removeEventListener("online",this.af),(n=this.Sf)===null||n===void 0||n.call(this),this.Sf=void 0,(r=this.lf)===null||r===void 0||r.clearQueue(),(s=this.uf)===null||s===void 0||s.clearQueue(),(i=this.lf)===null||i===void 0||i.reset(),(o=this.uf)===null||o===void 0||o.reset())}onRemoteConfig(t){var e,n;if(this.Ti)return;const r=t.ok?(e=t.config.logs)===null||e===void 0?void 0:e.captureConsoleLogs:void 0;ot(r)?this.xf():((n=this.Fa)===null||n===void 0||n.kv.set(this.Na.captureHintKey,!!r),r?(this.Zv=!0,this.Kv||this.wf(),this.loadIfEnabled()):this.xf())}reset(){var t,e,n,r;this.kf(),(t=this.lf)===null||t===void 0||t.clearQueue(),this.cc=[],(e=this.lf)===null||e===void 0||e.reset(),(n=this.uf)===null||n===void 0||n.clearQueue(),this.Xv=[],(r=this.uf)===null||r===void 0||r.reset(),this.Jd=0}captureLog(t){!this.Ti&&this.Fa&&this.pf().captureLog(t)}captureConsoleLog(t){!this.Ti&&this.Fa&&this.yf().captureLog(t)}captureBufferedConsoleLog(t,e,n){!this.Ti&&this.Fa&&this.yf().captureLog(t,{context:e,occurredAtMs:n})}Rd(){var t;this.kf(),(t=this.uf)===null||t===void 0||t.clearQueue(),this.Xv=[]}xf(){this.Zv||this.kf()}wf(){var t;if(this.nf||!(!((t=this.uv)===null||t===void 0)&&t.console))return;const e=Y8(this.Na.get()).maxBufferSize;let n=!0;this.if.push(()=>{n=!1});for(const r of JU){let s;try{s=eZ(this.uv.console[r])}catch{continue}s&&this.if.push(cf(this.uv.console,r,i=>{const o=(...l)=>{try{n&&this.$f(r,l,e)}catch{}return i.apply(this.uv.console,l)};return o.__rrweb_original__=s,o}))}this.nf=!0,this.Cf=setTimeout(()=>{this.kf()},3e4)}$f(t,e,n){var r;if(this.nf&&!this.sf&&e.length!==0)if(!((r=this.Fa)===null||r===void 0)&&r.canCapture){if(n>this.ef.length){this.sf=!0;try{this.ef.push({level:t,args:e,occurredAtMs:Date.now(),context:this.Jv()})}finally{this.sf=!1}}}else this.kf()}kf(){if(this.ef=[],this.nf){this.nf=!1,this.Cf&&(clearTimeout(this.Cf),this.Cf=void 0);for(const t of this.if)t();this.if=[]}}Tf(){const t=this.ef;return this.kf(),t}get logger(){return this.If||(this.If={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.If}flushLogs(t){this.Fa&&(t?this.Mf(t):(this.lf&&this.lf.flush().catch(e=>this.Ef(e)),this.uf&&this.uf.flush().catch(e=>this.Ef(e))))}flush(){var t=this;return un(function*(){var e,n;const r=(e=t.lf)===null||e===void 0?void 0:e.flush().catch(i=>t.Ef(i)),s=(n=t.uf)===null||n===void 0?void 0:n.flush().catch(i=>t.Ef(i));yield r,yield s})()}Ef(t){Q8(t)||this.R.error("PostHog logs flush failed:",t)}loadIfEnabled(){if(this.Ti||!this.Zv||this.Kv||this.Yv)return;const t=this.hf();if(t){this.Yv=!0;try{t((e,n)=>{if(this.Yv=!1,!this.Ti&&this.Zv)if(e||!n)this.R.error("Could not load logs script",e),this.kf();else{const r=this.Tf();this.Sf=n.initialize(this.Fa),this.Kv=!0,r.length>0&&n.replay(this.Fa,r)}})}catch(e){throw this.Yv=!1,e}}else this.kf()}ff(t,e){const n=this.Fa;return{get isDisabled(){return!1},get optedOut(){return!n.canCapture},getPersistedProperty:r=>r===Lo.LogsQueue?t():void 0,setPersistedProperty(r,s){r===Lo.LogsQueue&&e(s??[])},qs:r=>this.qs(r),getLibraryId:()=>n.library.name,getLibraryVersion:()=>n.library.version}}qs(t){return new Promise(e=>{if(NM(this.Jd,3))return void e({kind:"fatal",error:hw(void 0,"logs endpoint is unreachable, dropping batch")});let n=!1;const r=o=>{n||(n=!0,clearTimeout(s),e(o))},s=setTimeout(()=>{this.R.warn("Logs request timed out before receiving a response"),r({kind:"retry-later",error:hw(void 0,"logs request timed out")})},9e4),i=this.cf;this.Fa.sendRequest("/i/v1/logs",{method:"POST",query:{token:this.Fa.projectToken},body:t,compression:"best-available",timeoutMs:6e4}).then(o=>{var l;const u=o.statusCode;this.Af(u,i),u>=200&&300>u?r({kind:"ok"}):u===413?r({kind:"too-large"}):u!==0&&u!==408&&u!==429&&500>u?r({kind:"fatal",error:new Error(`logs request failed with status ${u}`)}):u===0?(o.error||this.R.warn("Logs request failed before receiving an HTTP response"),r({kind:"retry-later",error:hw(o.error,"logs request failed before receiving an HTTP response")})):r({kind:"retry-later",error:(l=o.error)!==null&&l!==void 0?l:new Error(`logs request failed with status ${u}`)})},o=>{r({kind:"retry-later",error:o})})})}Af(t,e){(t!==0||e)&&(this.Jd=DM(t,this.Jd,3,()=>this.R.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.")))}Mf(t){this.cc.length>0&&this.Rf(t,this.cc,this.mf,this.Fa.library.name,e=>{this.cc=e}),this.Xv.length>0&&this.Rf(t,this.Xv,this._f,X8,e=>{this.Xv=e})}Rf(t,e,n,r,s){if(e.length===0)return;const i=e.map(l=>l.record);s([]);const o=YO(i,qO(n,this.Fa.library.name,this.Fa.library.version),r,this.Fa.library.version);this.Fa.sendRequest("/i/v1/logs",{method:"POST",query:{token:this.Fa.projectToken},body:o,compression:"best-available",transport:t,timeoutMs:6e4}).catch(l=>this.Ef(l))}};const dv=En("[NetworkMetrics]"),nZ={"http:":80,"https:":443},rZ=new Set(["CONNECT","DELETE","GET","HEAD","OPTIONS","PATCH","POST","PUT","TRACE"]),SL=(t,e)=>{var n;const r=String(e);return{method:String(t).toUpperCase(),url:((n=Yo(r))===null||n===void 0?void 0:n.href)||r}},l2=(t,e,n,r,s,i,o=!1)=>{try{var l,u;const d=s();if(!d)return;const f=n||void 0,h=Cp()-r,m=Yo(e.url);if(m&&m.protocol!=="http:"&&m.protocol!=="https:")return;const g={url:(m==null?void 0:m.href)||e.url,method:e.method},_=Nn(d.name)?d.name(g):dt(d.name)?d.name:"http.client.request.duration";if(!_)return;const y=o&&!f?void 0:((x,S)=>x?400>x?void 0:String(x):(S==null?void 0:S.name)||"_OTHER")(f,i),b=F(F(F(F(F({},(x=>{const S=rZ.has(x)?x:"_OTHER";return F({"http.request.method":S},S==="_OTHER"&&x!==S?{"http.request.method_original":x}:{})})(g.method)),m?(x=>{return{"server.address":x.hostname.startsWith("[")&&x.hostname.endsWith("]")?x.hostname.slice(1,-1):x.hostname,"server.port":Number(x.port)||nZ[x.protocol],"url.scheme":x.protocol.slice(0,-1),"url.template":(S=x.pathname,S.split("/").map(E=>(C=>/^\d+$/.test(C)||C.length>=8&&/^[0-9a-f-]*\d[0-9a-f-]*$/i.test(C))(E)?":id":E).join("/"))};var S})(m):{}),f?{"http.response.status_code":f}:{}),y?{"error.type":y}:{}),(l=d.attributes)===null||l===void 0?void 0:l.call(d,g,{status:f,durationMs:h}));(u=t.metrics)===null||u===void 0||u.histogram(_,h,{unit:"ms",attributes:b})}catch(d){dv.error("Failed to record network metric",d)}},kL=()=>{},sZ=(t,e)=>Nn(ae==null?void 0:ae.fetch)?cf(ae,"fetch",n=>function(...r){const s=Cp(),i=n.apply(this,r);if(!e())return i;try{var o,l,u;const[d,f]=r,h=SL((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(m=>(l2(t,h,m==null?void 0:m.status,s,e,void 0,!0),m),m=>{throw l2(t,h,void 0,s,e,m),m})}catch(d){return dv.error("Failed to observe fetch",d),i}}):kL,iZ=(t,e)=>{var n;const r=ae==null||(n=ae.XMLHttpRequest)===null||n===void 0?void 0:n.prototype;if(!r)return kL;const s=new WeakMap,i=cf(r,"open",l=>function(...u){try{XM.has(this)||s.set(this,SL(u[0],u[1]))}catch(d){dv.error("Failed to observe XHR open",d)}return l.apply(this,u)}),o=cf(r,"send",l=>function(...u){let d;try{const f=s.get(this);if(f&&e()){const h=Cp();d=()=>{this.removeEventListener("loadend",d),l2(t,f,this.status,h,e)},Lt(this,"loadend",d)}}catch(f){dv.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()}},J8=new WeakMap,oZ=new Set(["$comment","$defs","$id","$schema","additionalProperties","default","definitions","deprecated","description","examples","minProperties","properties","readOnly","required","title","type","writeOnly"]),aZ={maxStringLength:2048,truncationSuffix:"..."},lZ={maxStringLength:2048,truncationSuffix:"..."};function eT(t){if(t)return t===!0?{intent:!0,model:!0}:{intent:t.intent!==!1,model:t.model!==!1}}function pw(t,e){return{}.hasOwnProperty.call(t,e)}function mw(t,e){const n=Object.create(t);return e&&Object.defineProperty(n,"inputSchema",{configurable:!0,enumerable:!0,writable:!0,value:e}),n}function tT(t,e,n=!1){if(!dt(t))return;const r=t.trim();return r?(n?ZO(r,aZ):r).slice(0,e):void 0}function nT(t){try{return ct(t)&&t.isError===!0}catch{return!1}}function EL(t){return ZO(t||"Unknown error",lZ).slice(0,2048)}function cZ(t,e){try{return EL(e?(function(n){try{return!ct(n)||!He(n.content)?void 0:n.content.filter(r=>ct(r)&&r.type==="text"&&dt(r.text)).map(r=>r.text).join(" ").trim()||void 0}catch{return}})(t):ct(t)&&dt(t.message)?t.message:dt(t)?t:String(t))}catch{return"Unknown error"}}function uZ(t,e,n){return e.errorResult?[{type:"Error",value:n,mechanism:{type:"generic",handled:!0,synthetic:!0,exception_id:0}}]:t.buildProperties(e.error,{handled:!0}).$exception_list.map(r=>F(F({},r),{},{value:EL(r.value)}))}function dZ(t,e){if(e)return"Error";try{if(!ct(t))return"Error";let n=dt(t.name)?t.name.trim():"";const r=t.constructor;return n&&n!=="Error"||!Nn(r)||r.name==="Error"||(n=r.name),(n||"Error").slice(0,256)}catch{return"Error"}}function fZ(t,e){return{message:cZ(t,e),type:dZ(t,e)}}lp.__defaultExtensionClasses=F({},((...t)=>mn({},...t))({featureFlags:$0},{sessionRecording:class{get Fr(){return this._instance.config}get Pc(){return this._instance.persistence}get started(){var t;return!!(!((t=this.Pf)===null||t===void 0)&&t.isStarted)}get status(){var t,e;return this.Of==="awaiting_config"||this.Of==="missing_config"?this.Of:(t=(e=this.Pf)===null||e===void 0?void 0:e.status)!==null&&t!==void 0?t:this.Of}constructor(t){if(this._instance=t,this._forceAllowLocalhostNetworkCapture=!1,this.Of=sw,this.Ff=void 0,this.Df=!1,this.Ye=(()=>{var e,n;if(!(Oe!=null&&Oe.visibilityState)||Oe.visibilityState==="visible")return!0;const r=ae==null||(e=ae.performance)===null||e===void 0||(n=e.getEntriesByType)===null||n===void 0?void 0:n.call(e,"visibility-state");return!(r!=null&&r.length)||r.some(s=>s.name==="visible")})(),this.an=()=>{var e,n;(Oe==null?void 0:Oe.visibilityState)==="visible"&&(this.Ye=!0,(e=this.Pf)===null||e===void 0||(n=e.setDocumentWasEverVisible)===null||n===void 0||n.call(e,!0))},!this._instance.sessionManager)throw pa.error("started without valid sessionManager"),new Error("[SessionRecording] started without valid sessionManager. This is a bug.");if(this.Fr.cookieless_mode==="always")throw new Error('[SessionRecording] cannot be used with cookieless_mode="always"');Oe!=null&&Oe.addEventListener&&Lt(Oe,"visibilitychange",this.an)}initialize(){this.startIfEnabledOrStop()}dispose({discardBufferedEvents:t=!1}={}){var e;this.Df=!0,Oe==null||(e=Oe.removeEventListener)===null||e===void 0||e.call(Oe,"visibilitychange",this.an),t?this.Lf(!0):this.stopRecording()}get Nf(){var t;const e=!!(!((t=this._instance.get_property("$session_recording_remote_config"))===null||t===void 0)&&t.enabled),n=!this.Fr.disable_session_recording,r=this.Fr.disable_session_recording||this._instance.consent.isOptedOut();return ae&&e&&n&&!r}startIfEnabledOrStop(t){var e;if(this.Df||this.Nf&&(!((e=this.Pf)===null||e===void 0)&&e.isStarted))return;const n=!le(Object.assign)&&!le(Array.from);this.Nf&&n?(this.jf(t),pa.info("starting")):(this.Of=sw,this.stopRecording())}jf(t){var e,n;if(this.Nf)if(this.Of!=="awaiting_config"&&this.Of!=="missing_config"&&(this.Of=w8),(et==null||(e=et.__PosthogExtensions__)===null||e===void 0||(e=e.rrweb)===null||e===void 0?void 0:e.record)&&((n=et.__PosthogExtensions__)===null||n===void 0?void 0:n.initSessionRecording))this.qf(t);else{var r,s;const i=this._instance.sessionManager;(r=et.__PosthogExtensions__)===null||r===void 0||(s=r.loadExternalDependency)===null||s===void 0||s.call(r,this._instance,this.Bf,o=>{if(!this.Df&&this.Nf&&this._instance.sessionManager===i)return o?(this._instance.register_for_session({$sdk_debug_recording_script_not_loaded:!0}),pa.error("could not load recorder",o)):void this.qf(t);this.Of="disabled"})}}stopRecording(){var t,e;(t=this.Ff)===null||t===void 0||t.call(this),this.Ff=void 0,(e=this.Pf)===null||e===void 0||e.stop()}Lf(t=!1){var e,n;(e=this.Ff)===null||e===void 0||e.call(this),this.Ff=void 0,(n=this.Pf)===null||n===void 0||n.discard({discardProducerEvents:t})}zf(){var t,e;(t=this.Pc)===null||t===void 0||t.unregister("$session_is_sampled"),(e=this.Pc)===null||e===void 0||e.unregister("$replay_sample_rate")}Hf(t,e){if(ot(t))return null;const n=Bn(t)?t:parseFloat(t);return typeof(r=n)!="number"||!Number.isFinite(r)||0>r||r>1?(pa.warn(`${e} must be between 0 and 1. Ignoring invalid value:`,t),null):n;var r}Uf(t){if(this.Pc){var e,n;const r=this.Pc,s=()=>{var i;const o=t.sessionRecording===!1?void 0:t.sessionRecording,l=this.Hf((i=this.Fr.session_recording)===null||i===void 0?void 0:i.sampleRate,"session_recording.sampleRate"),u=this.Hf(o==null?void 0:o.sampleRate,"remote config sampleRate"),d=l??u;ot(d)&&this.zf();const f=o==null?void 0:o.minimumDurationMilliseconds;r.register({[tp]:F(F({cache_timestamp:Date.now(),enabled:!!o},o),{},{networkPayloadCapture:F({capturePerformance:t.capturePerformance},o==null?void 0:o.networkPayloadCapture),canvasRecording:{enabled:o==null?void 0:o.recordCanvas,fps:o==null?void 0:o.canvasFps,quality:o==null?void 0:o.canvasQuality},sampleRate:d,minimumDurationMilliseconds:le(f)?null:f,endpoint:o==null?void 0:o.endpoint,triggerMatchType:o==null?void 0:o.triggerMatchType,masking:o==null?void 0:o.masking,urlTriggers:o==null?void 0:o.urlTriggers,version:o==null?void 0:o.version,triggerGroups:o==null?void 0:o.triggerGroups})})};s(),(e=this.Ff)===null||e===void 0||e.call(this),this.Ff=(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.Uf(e),void this.Lf()):(this.Uf(e),void this.startIfEnabledOrStop()):(this.Of==="awaiting_config"&&(this.Of="missing_config",this._instance.register_for_session({[_S]:!0}),pa.warn("config refresh failed, recording will not start until page reload")),void this.startIfEnabledOrStop())}log(t,e="log"){var n;!((n=this.Pf)===null||n===void 0)&&n.log?this.Pf.log(t,e):pa.warn("log called before recorder was ready")}get Bf(){var t,e;const n=(t=this._instance)===null||t===void 0||(t=t.persistence)===null||t===void 0?void 0:t.get_property(tp);return(n==null||(e=n.scriptConfig)===null||e===void 0?void 0:e.script)||"lazy-recorder"}Wf(){const t=this._instance.get_property(tp);if(!t)return!1;let e;try{e=typeof t=="object"?t:JSON.parse(t)}catch(n){return pa.warn("persisted remote config for session recording is invalid and will be ignored",n),!1}return!ot(e.cache_timestamp)&&36e5>=Date.now()-e.cache_timestamp}qf(t){var e,n,r;if(!this.Df&&this.Nf&&this._instance.sessionManager){if(!(!((e=et.__PosthogExtensions__)===null||e===void 0)&&e.initSessionRecording))return pa.warn("Called on script loaded before session recording is available. This can be caused by adblockers."),void this._instance.register_for_session({[yS]:!0});var s;if(this.Pf||(this.Pf=(s=et.__PosthogExtensions__)===null||s===void 0?void 0:s.initSessionRecording(this._instance,this.Ye),this.Pf._forceAllowLocalhostNetworkCapture=this._forceAllowLocalhostNetworkCapture),!this.Wf())return this.Of==="missing_config"||this.Of==="awaiting_config"?void 0:(this.Of="awaiting_config",pa.info("persisted remote config is stale, requesting fresh config before starting"),void new BM(this._instance).load());this.Of=w8,(n=(r=this.Pf).setDocumentWasEverVisible)===null||n===void 0||n.call(r,this.Ye),this.Pf.start(t)}else this.Of=sw}onRRwebEmit(t){var e,n;(e=this.Pf)===null||e===void 0||(n=e.onRRwebEmit)===null||n===void 0||n.call(e,t)}overrideLinkedFlag(){var t,e;this.Pf||(e=this.Pc)===null||e===void 0||e.register({$replay_override_linked_flag:!0}),(t=this.Pf)===null||t===void 0||t.overrideLinkedFlag()}overrideSampling(){var t,e;this.Pf||(e=this.Pc)===null||e===void 0||e.register({$replay_override_sampling:!0}),(t=this.Pf)===null||t===void 0||t.overrideSampling()}overrideTrigger(t){var e,n;this.Pf||(n=this.Pc)===null||n===void 0||n.register({[t==="url"?"$replay_override_url_trigger":"$replay_override_event_trigger"]:!0}),(e=this.Pf)===null||e===void 0||e.overrideTrigger(t)}get sdkDebugProperties(){var t;const e={};for(const r of dU){var n;const s=(n=this._instance.sessionPersistence)===null||n===void 0?void 0:n.get_property(r);le(s)||(e[r]=s)}return F(F({},e),((t=this.Pf)===null||t===void 0?void 0:t.sdkDebugProperties)||{$recording_status:this.status})}tryAddCustomEvent(t,e){var n;return!!(!((n=this.Pf)===null||n===void 0)&&n.tryAddCustomEvent(t,e))}flushBeforeIdentityReset(){var t,e;(t=this.Pf)===null||t===void 0||(e=t.flushBeforeIdentityReset)===null||e===void 0||e.call(t)}}},{autocapture:class extends GH{constructor(t){super(new aU(t)),this.instance=t}},historyAutocapture:class{constructor(t){this.Vf=!1,this._instance=t,this.Gf=this.Qf()}initialize(){this.startIfEnabled()}get isEnabled(){const t=this.Jf();return!!(t.path||t.search||this.Zf(t))}startIfEnabled(){this.isEnabled&&(ge.info("History API monitoring enabled, starting..."),this.monitorHistoryChanges())}startIfEnabledOrStop(){this.stop(),this.Gf=this.Qf(),this.startIfEnabled()}stop(){this.Kf&&this.Kf(),this.Kf=void 0,this.Yf&&this.Yf(),this.Yf=void 0,ge.info("History API monitoring stopped")}monitorHistoryChanges(){ae&&ae.history&&(this.Xf("pushState"),this.Xf("replaceState"),this.tp(),this.Zf()&&this.ep())}Xf(t){var e;if(!ae||!((e=ae.history[t])===null||e===void 0)&&e.__posthog_wrapped__)return;const n=this;cf(ae.history,t,r=>function(s,i,o){var l;n.np(o)&&n.sp(),r.call(this,s,i,o),n.rp(t,!n.Vf&&(ae==null||(l=ae.event)===null||l===void 0?void 0:l.type)!=="popstate")})}Qf(){const t=ae==null?void 0:ae.location;if(t!=null&&t.pathname)return{pathname:t.pathname,search:t.search,hash:t.hash}}Jf(){const t=this._instance.config.capture_pageview;return t==="history_change"?{path:!0}:ct(t)?t:{}}Zf(t=this.Jf()){return!!t.hash&&!this._instance.config.disable_capture_url_hashes}op(t){const e=this.Jf(),n=this.Gf;return!(!n||!(e.path&&t.pathname!==n.pathname||e.search&&t.search!==n.search||this.Zf(e)&&t.hash!==n.hash))}rp(t,e=!1){try{e||this.sp();const n=this.Qf();if(!n)return;if(this.op(n)){const r=()=>this._instance.capture(wS,{navigation_type:t});e?(this.ap=r,Promise.resolve().then(()=>this.sp())):r()}this.Gf=n}catch(n){ge.error(`Error capturing ${t} pageview`,n)}}np(t){var e,n;return!(ot(t)||!ae)&&((e=Yo(String(t)))===null||e===void 0?void 0:e.href)!==((n=ae.location)===null||n===void 0?void 0:n.href)}sp(){const t=this.ap;if(t){this.ap=void 0,this.Vf=!0;try{t()}catch(e){ge.error("Error capturing deferred pageview",e)}finally{this.Vf=!1}this.Gf=this.Qf()}}tp(){if(this.Kf)return;const t=()=>{this.rp("popstate")};Lt(ae,"popstate",t),this.Kf=()=>{ae&&ae.removeEventListener("popstate",t)}}ep(){if(this.Yf)return;const t=()=>{this.rp("hashchange")};Lt(ae,"hashchange",t),this.Yf=()=>{ae&&ae.removeEventListener("hashchange",t)}}},heatmaps:class{get Fr(){return this.instance.config}constructor(t){var e;this.lp=!1,this._l=!1,this.up=null,this.instance=t,this.lp=!!(!((e=this.instance.persistence)===null||e===void 0)&&e.props[Ub]),this.rageclicks=new mL(t.config.rageclick)}initialize(){this.startIfEnabled()}get flushIntervalMilliseconds(){let t=5e3;return ct(this.Fr.capture_heatmaps)&&this.Fr.capture_heatmaps.flush_interval_milliseconds&&(t=this.Fr.capture_heatmaps.flush_interval_milliseconds),t}get isEnabled(){return ot(this.Fr.capture_heatmaps)?ot(this.Fr.enable_heatmaps)?this.lp:this.Fr.enable_heatmaps:this.Fr.capture_heatmaps!==!1}startIfEnabled(){if(this.isEnabled){if(this._l)return;fU.info("starting..."),this.cp(),this.an()}else{var t;clearInterval((t=this.up)!==null&&t!==void 0?t:void 0),this.hp(),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({[Ub]:n}),this.lp=n,this.startIfEnabled()}getAndClearBuffer(){const t=this.Rt;return this.Rt=void 0,t}dp(t){iw(t.originalEvent)&&this.Pr(t.originalEvent,"deadclick")}an(){this.up&&clearInterval(this.up),this.up=(Oe==null?void 0:Oe.visibilityState)==="visible"?setInterval(this.bc.bind(this),this.flushIntervalMilliseconds):null}cp(){ae&&Oe&&(this.vp=this.bc.bind(this),Lt(ae,sv,this.vp),this.fp=t=>this.Pr(t||(ae==null?void 0:ae.event)),Lt(Oe,"click",this.fp,{capture:!0}),this.pp=t=>this.gp(t||(ae==null?void 0:ae.event)),Lt(Oe,"mousemove",this.pp,{capture:!0}),this.mp=new KP(this.instance,cH,this.dp.bind(this)),this.mp.startIfEnabledOrStop(),this.yp=this.an.bind(this),Lt(Oe,Md,this.yp),this._l=!0)}hp(){var t;ae&&Oe&&(this.vp&&ae.removeEventListener(sv,this.vp),this.fp&&Oe.removeEventListener("click",this.fp,{capture:!0}),this.pp&&Oe.removeEventListener("mousemove",this.pp,{capture:!0}),this.yp&&Oe.removeEventListener(Md,this.yp),clearTimeout(this.bp),(t=this.mp)===null||t===void 0||t.stop(),this._l=!1)}_p(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&&Ui(d)&&!or(d,"body");){if(d===u)return!1;let g;try{var f,h,m;g=(f=(h=(m=d.ownerDocument)===null||m===void 0?void 0:m.defaultView)!==null&&h!==void 0?h:ae)===null||f===void 0?void 0:f.getComputedStyle(d).position}catch{return!1}if(We(l,g))return!0;d=PM(d)}return!1})(sp(t),["fixed","sticky"],s);return{x:t.clientX+(i?0:r),y:t.clientY+(i?0:n),target_fixed:i,type:e}}Pr(t,e="click"){var n;if(DP(t.target)||!iw(t))return;const r=this._p(t,e);!((n=this.rageclicks)===null||n===void 0)&&n.isRageClick(t.clientX,t.clientY,new Date().getTime())&&RM(sp(t),this.instance.config.rageclick)&&this.Ks(F(F({},r),{},{type:"rageclick"})),this.Ks(r)}gp(t){!DP(t.target)&&iw(t)&&(clearTimeout(this.bp),this.bp=setTimeout(()=>{this.Ks(this._p(t,"mousemove"))},500))}Ks(t){if(!ae)return;const e=this.Fr.disable_capture_url_hashes?jl(ae.location.href):ae.location.href,n=this.Fr.custom_personal_data_properties,r=this.Fr.mask_personal_data_properties?[...af,...n||[]]:[],s=kp(e,r,Ep);this.Rt=this.Rt||{},this.Rt[s]||(this.Rt[s]=[]),this.Rt[s].push(t)}bc(){this.Rt&&!zs(this.Rt)&&this.instance.capture("$$heatmap",{$heatmap_data:this.getAndClearBuffer()})}},deadClicksAutocapture:KP,webVitalsAutocapture:class{constructor(t){var e;this._instance=t,this.lp=!1,this._l=!1,this.Rt={navigationKey:void 0,url:void 0,metrics:[],firstMetricTimestamp:void 0},this.wp=(n=!1)=>{clearTimeout(this.kp),this.kp=void 0,this.Rt.metrics.length!==0&&(this._instance.capture("$web_vitals",F({$current_url:this.Rt.url},this.Rt.metrics.reduce((r,s)=>F(F({},r),{},{[`$web_vitals_${s.name}_event`]:F({},s),[`$web_vitals_${s.name}_value`]:s.value}),{})),n?{transport:"sendBeacon",send_instantly:!0}:void 0),this.Rt={navigationKey:void 0,url:void 0,metrics:[],firstMetricTimestamp:void 0})},this.Sp=n=>{var r;if(this.Rt=this.Rt||{navigationKey:void 0,url:void 0,metrics:[],firstMetricTimestamp:void 0},ot(n==null?void 0:n.name)||ot(n==null?void 0:n.value))return void Tc.error("Invalid metric received",n);const s=typeof n.navigationURL=="string"?n.navigationURL:void 0,i=this.xp(s);if(le(i))return;const o=Bn(n.navigationId)||typeof n.navigationId=="string"?`navigation:${n.navigationId}`:`url:${i}`;if(this.$p&&n.value>=this.$p)return void Tc.error("Ignoring metric with value >= "+this.$p,n);this.Rt.navigationKey!==o&&(this.wp(),this.kp=setTimeout(this.wp,this.flushToCaptureTimeoutMs)),le(this.Rt.navigationKey)&&(this.Rt.navigationKey=o,this.Rt.url=i),this.Rt.firstMetricTimestamp=le(this.Rt.firstMetricTimestamp)?Date.now():this.Rt.firstMetricTimestamp;const l=(r=this._instance.sessionManager)===null||r===void 0?void 0:r.checkAndGetSessionAndWindowId(!0),u=F(F(F({},n),s?{navigationURL:i}:{}),{},{$current_url:i,timestamp:Date.now()});if(delete u.entries,ct(n.attribution)&&this.attributionMetrics.indexOf(n.name)>-1){const d={};for(const f of uU){const h=f==="url"&&typeof n.attribution[f]=="string"?this.xp(n.attribution[f]):n.attribution[f];le(h)||(d[f]=h)}u.attribution=d}else delete u.attribution;le(l)||(u.$session_id=l.sessionId,u.$window_id=l.windowId),this.Rt.metrics.push(u),this.Rt.metrics.length===this.allowedMetrics.length&&this.wp()},this.Cp=()=>{if(this._l)return;let n,r,s,i,o=!1;const l=et.__PosthogExtensions__,u=l==null?void 0:l.postHogWebVitalsCallbacksByFlavor,d=(u==null?void 0:u[this.Tp])||(this.Tp==="web-vitals"&&le(u)?l==null?void 0:l.postHogWebVitalsCallbacks:void 0);if(!le(d)){const g=d.withoutAttribution,_=this.attributionMetrics;o=!le(g),n=_.indexOf("LCP")>-1?d.onLCP:(g==null?void 0:g.onLCP)||d.onLCP,r=_.indexOf("CLS")>-1?d.onCLS:(g==null?void 0:g.onCLS)||d.onCLS,s=_.indexOf("FCP")>-1?d.onFCP:(g==null?void 0:g.onFCP)||d.onFCP,i=_.indexOf("INP")>-1?d.onINP:(g==null?void 0:g.onINP)||d.onINP}if(!(n&&r&&s&&i))return void Tc.error("web vitals callbacks not loaded - not starting");const f={reportSoftNavs:this.useSoftNavs},h=o&&this.attributionMetrics.indexOf("INP")>-1?F(F({},f),{},{includeProcessedEventEntries:!1}):f;this.allowedMetrics.indexOf("LCP")>-1&&n(this.Sp.bind(this),f),this.allowedMetrics.indexOf("CLS")>-1&&r(this.Sp.bind(this),f),this.allowedMetrics.indexOf("FCP")>-1&&s(this.Sp.bind(this),f),this.allowedMetrics.indexOf("INP")>-1&&i(this.Sp.bind(this),h);const m=ae==null?void 0:ae.document;Lt(m,Md,()=>{(m==null?void 0:m.visibilityState)==="hidden"&&this.wp(!0)}),Lt(ae,"pagehide",()=>this.wp(!0)),this._l=!0},this.lp=!!(!((e=this._instance.persistence)===null||e===void 0)&&e.props[Wb]),this.startIfEnabled()}get Ip(){return this._instance.config.capture_performance}get allowedMetrics(){var t,e;const n=ct(this.Ip)?(t=this.Ip)===null||t===void 0?void 0:t.web_vitals_allowed_metrics:void 0;return ot(n)?((e=this._instance.persistence)===null||e===void 0?void 0:e.props.$web_vitals_allowed_metrics)||_8:n}get flushToCaptureTimeoutMs(){return(ct(this.Ip)?this.Ip.web_vitals_delayed_flush_ms:void 0)||5e3}get attributionMetrics(){const t=ct(this.Ip)?this.Ip.web_vitals_attribution:void 0;return Es(t)?t?_8:[]:He(t)?t:cU}get useAttribution(){return this.attributionMetrics.length>0}get useSoftNavs(){const t=ct(this.Ip)?this.Ip.__preview_web_vitals_soft_navs:void 0;return t!=null&&t}get $p(){const t=ct(this.Ip)&&Bn(this.Ip.__web_vitals_max_value)?this.Ip.__web_vitals_max_value:y8;return t>0&&6e4>=t?y8:t}get isEnabled(){const t=ln==null?void 0:ln.protocol;if(t!=="http:"&&t!=="https:")return Tc.info("Web Vitals are disabled on non-http/https protocols"),!1;const e=ct(this.Ip)?this.Ip.web_vitals:Es(this.Ip)?this.Ip:void 0;return Es(e)?e:this.lp}startIfEnabled(){this.isEnabled&&!this._l&&(Tc.info("enabled, starting..."),this.Bl(this.Cp))}onRemoteConfig(t){if(!t.ok)return;const e=t.config;if(!("capturePerformance"in e))return;const n=ct(e.capturePerformance)&&!!e.capturePerformance.web_vitals,r=ct(e.capturePerformance)?e.capturePerformance.web_vitals_allowed_metrics:void 0;this._instance.persistence&&(this._instance.persistence.register({[Wb]:n}),this._instance.persistence.register({[sM]:r})),this.lp=n,this.startIfEnabled()}get Tp(){return this.useSoftNavs?this.useAttribution?"web-vitals-with-attribution-soft-navs":"web-vitals-soft-navs":this.useAttribution?"web-vitals-with-attribution":"web-vitals"}Bl(t){var e;const n=et.__PosthogExtensions__,r=this.Tp,s=n==null?void 0:n.postHogWebVitalsCallbacksByFlavor;s!=null&&s[r]||r==="web-vitals"&&le(s)&&(n!=null&&n.postHogWebVitalsCallbacks)?t():n==null||(e=n.loadExternalDependency)===null||e===void 0||e.call(n,this._instance,r,i=>{i?Tc.error("failed to load script",i):t()})}xp(t){const e=t||(ae==null?void 0:ae.location.href);if(!e)return void Tc.error("Could not determine current URL");const n=this._instance.config.disable_capture_url_hashes?jl(e):e,r=this._instance.config.custom_personal_data_properties,s=this._instance.config.mask_personal_data_properties?[...af,...r||[]]:[];return kp(n,s,Ep)}}},{exceptionObserver:class{constructor(t){var e;this.Cp=()=>{var n;if(!ae||!this.isEnabled||!(!((n=et.__PosthogExtensions__)===null||n===void 0)&&n.errorWrappingFunctions))return;const r=et.__PosthogExtensions__.errorWrappingFunctions.wrapOnError,s=et.__PosthogExtensions__.errorWrappingFunctions.wrapUnhandledRejection,i=et.__PosthogExtensions__.errorWrappingFunctions.wrapConsoleError;try{!this.Mp&&this.Fr.capture_unhandled_errors&&(this.Mp=r(this.captureException.bind(this))),!this.Ep&&this.Fr.capture_unhandled_rejections&&(this.Ep=s(this.captureException.bind(this))),!this.Ap&&this.Fr.capture_console_errors&&(this.Ap=i(this.captureException.bind(this)))}catch(o){Th.error("failed to start",o),this.Rp()}},this._instance=t,this.Pp=!!(!((e=this._instance.persistence)===null||e===void 0)&&e.props[Zb]),this.kt=new J7(F(F({},(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,R:Th})),this.Fr=this.Op(),this.startIfEnabledOrStop()}Op(){const t=this._instance.config.capture_exceptions;let e={capture_unhandled_errors:!1,capture_unhandled_rejections:!1,capture_console_errors:!1};return ct(t)?e=F(F({},e),t):(le(t)?this.Pp:t)&&(e=F(F({},e),{},{capture_unhandled_errors:!0,capture_unhandled_rejections:!0})),e}get isEnabled(){return this.Fr.capture_console_errors||this.Fr.capture_unhandled_errors||this.Fr.capture_unhandled_rejections}startIfEnabledOrStop(){this.isEnabled?(Th.info("enabled"),this.Rp(),this.Bl(this.Cp)):this.Rp()}Bl(t){var e,n,r;!((e=et.__PosthogExtensions__)===null||e===void 0)&&e.errorWrappingFunctions?t():(n=et.__PosthogExtensions__)===null||n===void 0||(r=n.loadExternalDependency)===null||r===void 0||r.call(n,this._instance,"exception-autocapture",s=>{if(s)return Th.error("failed to load script",s);t()})}Rp(){var t,e,n;(t=this.Mp)===null||t===void 0||t.call(this),this.Mp=void 0,(e=this.Ep)===null||e===void 0||e.call(this),this.Ep=void 0,(n=this.Ap)===null||n===void 0||n.call(this),this.Ap=void 0}onRemoteConfig(t){if(!t.ok)return;const e=t.config;"autocaptureExceptions"in e&&(this.Pp=!!e.autocaptureExceptions||!1,this._instance.persistence&&this._instance.persistence.register({[Zb]:this.Pp}),this.Fr=this.Op(),this.startIfEnabledOrStop())}onConfigChange(){this.Fr=this.Op()}captureException(t){try{var e,n,r;const s=(e=t==null||(n=t.$exception_list)===null||n===void 0||(n=n[0])===null||n===void 0?void 0:n.type)!==null&&e!==void 0?e:"Exception";if(this.kt.consumeRateLimit(s))return void Th.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.Fp=[],this.Dp=new uz([new Ez,new Lz,new Pz,new Cz,new Oz,new Iz,new Rz,new Mz],(function(r,...s){return(i,o=0)=>{const l=[],u=i.split(`
21
- `),d=Math.min(u.length,o+1e3),f=[];for(let g=o;d>g;g++){const _=u[g];if(_.length>1024)continue;const y=mP.test(_)?_.replace(mP,"$1"):_;if(!y.match(/\S*Error: /)){for(const b of s){const x=b(y,r);if(x){l.push(x);const S=bz(l);if(S){for(let E=f.length-1;E>=0;E--){const C=f[E];if(S.start>=C.start+C.length)break;f.pop()}f.push(S)}break}}if(Sz(l,f)>=50)break}}const h=[...f].sort((g,_)=>_.start-g.start),m=h[h.length-1];if(m){const g=NO(l,m);l.splice(m.start-g,g);for(const _ of h)_.start-=g}for(const g of h)xz(l,g);return f.some(g=>g.start===0&&l.length===g.length)&&(function(g){const _=g.map(b=>`${b.function}|${b.filename}|${b.lineno}|${b.colno}|${b.module}`);let y=0;for(let b=1;_.length>b;b++)kz(_,b,y)&&(y=b);g.push(...g.splice(0,y))})(l),(function(g){if(!g.length)return[];const _=Array.from(g);return _.reverse(),_.slice(0,50).map(y=>{return F(F({},y),{},{filename:y.filename||(b=_,b[b.length-1]||{}).filename,function:y.function||"?"});var b})})(l)}})("web:javascript",vz,wz)),this._instance=t,this.Fp=(e=(n=this._instance.persistence)===null||n===void 0?void 0:n.get_property("$error_tracking_suppression_rules"))!==null&&e!==void 0?e:[],this.Lp=Qg(this.Np()),this.jp=new Dz(this.Lp)}onConfigChange(){this.Lp=Qg(this.Np()),this.jp.setConfig(this.Lp)}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.Fp=i,this._instance.persistence&&this._instance.persistence.register({[nM]:this.Fp,[Bb]:o})}get qp(){var t;const e=!!this._instance.get_property(Bb),n=this._instance.config.error_tracking.captureExtensionExceptions;return(t=n??e)!==null&&t!==void 0&&t}buildProperties(t,e){return this.Dp.buildFromUnknown(t,{syntheticException:e==null?void 0:e.syntheticException,mechanism:{handled:e==null?void 0:e.handled}})}addExceptionStep(t,e){if(this.Lp.enabled)try{if(!dt(t)||t.trim().length===0)return void no.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)=>Nz.has(l)?(i.push(l),o):(o[l]=s[l],o),{}),droppedKeys:i}})(this.Bp(e));r.length>0&&no.warn("Ignoring reserved exception step fields",{droppedKeys:r}),this.jp.add(F({[Yg]:t,[Xg]:new Date().toISOString()},n))}catch(n){no.error("Failed to add exception step. Ignoring breadcrumb.",n)}}sendExceptionEvent(t){try{const e=t.$exception_list;if(this.zp(e)){if(this.Hp(e))return this.Up("Exception dropped: matched a suppression rule"),void no.info("Skipping exception capture because a suppression rule matched");if(!this.qp&&this.Wp(e))return this.Up("Exception dropped: thrown by a browser extension"),void no.info("Skipping exception capture because it was thrown by an extension");if(!this.qp&&this.Vp(e))return this.Up("Exception dropped: thrown by an injected browser script"),void no.info("Skipping exception capture because it was thrown by an injected browser script");if(!this._instance.config.error_tracking.__capturePostHogExceptions&&this.Gp(e))return this.Up("Exception dropped: thrown by the PostHog SDK"),void no.info("Skipping exception capture because it was thrown by the PostHog SDK")}const n=this.Lp.enabled&&ot(t.$exception_steps)?this.Qp(t):t,r=(function(){if("u">typeof process){var s;const o=(s=U7.POSTHOG_RELEASE_ID)===null||s===void 0?void 0:s.trim();if(o)return o}const i=globalThis._posthogReleaseId;return typeof i=="string"&&i.length>0?i:void 0})();r&&(n.$release_id=r);try{const s=this._instance.capture("$exception",n,{_noTruncate:!0,_batchKey:"exceptionEvent",_d:!0});return s&&this.jp.clear(),s}catch(s){return I8(s)||no.error("Failed to capture exception event. Dropping this exception.",s),void this.jp.clear()}}catch(e){return void(I8(e)||no.error("Failed to process exception event. Ignoring this exception.",e))}}Qp(t){try{const e=this.jp.getAttachable();return e.length===0?t:F(F({},t),{},{$exception_steps:e})}catch(e){return no.error("Failed to read buffered exception steps. Capturing exception without steps.",e),t}}Up(t){this.Lp.enabled&&this.jp.add({[Yg]:t,[Xg]:new Date().toISOString()})}Bp(t){return ct(t)?F({},t):{}}Np(){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:{}}Hp(t){if(t.length===0)return!1;try{const e=t.reduce((n,{type:r,value:s})=>(dt(r)&&r.length>0&&n.$exception_types.push(r),dt(s)&&s.length>0&&n.$exception_values.push(s),n),{$exception_types:[],$exception_values:[]});return this.Fp.some(n=>{const r=n.values.map(s=>{const i=fL[s.operator],o=e[s.key];if(!i||!o)return!1;const l=He(s.value)?s.value:[s.value];return l.length>0&&i(l,o)});return n.type==="OR"?r.some(Boolean):r.every(Boolean)})}catch(e){return no.warn("Failed to evaluate suppression rules. Capturing the exception.",e),!1}}Wp(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&&EU.some(s=>r.startsWith(s)));return n.length!==0&&(!n.every(({filename:r})=>!!r&&r.startsWith(i2))||t.some(({type:r,value:s})=>r==="NoResponse"||dt(s)&&kU.some(({value:i,exact:o})=>o?s===i:s.includes(i)))&&!e.some(({in_app:r,filename:s})=>r&&!(s!=null&&s.startsWith(i2))))}Vp(t){return t.some(({value:e})=>dt(e)&&CU.some(n=>e.includes(n)))}Gp(t){if(t.length>0){var e,n,r,s;const i=(e=(n=t[0].stacktrace)===null||n===void 0?void 0:n.frames)!==null&&e!==void 0?e:[],o=i[i.length-1];return(r=o==null||(s=o.filename)===null||s===void 0?void 0:s.includes("posthog.com/static"))!==null&&r!==void 0&&r}return!1}zp(t){return!ot(t)&&He(t)}}},{productTours:class{get Pc(){return this._instance.persistence}constructor(t){this.Jp=null,this.Zp=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.Pc&&this.Pc.register({[gS]:!!e.productTours}),!ow(this._instance))return!this.Jp&&ot((n=this.Pc)===null||n===void 0?void 0:n.props.ph_product_tours)||D0.info("product tours disabled; stopping and clearing cached tours"),(r=this.Jp)===null||r===void 0||r.stop(),this.Jp=null,void this.clearCache();this.loadIfEnabled()}}loadIfEnabled(){!this.Jp&&ow(this._instance)&&this.Bl(()=>this.Kp())}Bl(t){var e,n,r;!((e=et.__PosthogExtensions__)===null||e===void 0)&&e.generateProductTours?t():(n=et.__PosthogExtensions__)===null||n===void 0||(r=n.loadExternalDependency)===null||r===void 0||r.call(n,this._instance,"product-tours",s=>{s?D0.error("Could not load product tours script",s):t()})}Kp(){var t;!this.Jp&&(!((t=et.__PosthogExtensions__)===null||t===void 0)&&t.generateProductTours)&&(this.Jp=et.__PosthogExtensions__.generateProductTours(this._instance,!0))}getProductTours(t,e=!1){if(He(this.Zp)&&!e)return void t(this.Zp,{isLoaded:!0});const n=this.Pc;if(n){const r=n.props[Kb];if(He(r)&&!e)return this.Zp=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(!ow(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||D0.warn(o):D0.error(o),void t([],{isLoaded:!1,error:o})}const i=He(r.json.product_tours)?r.json.product_tours:[];this.Zp=i,n&&n.register({[Kb]:i}),t(i,{isLoaded:!0})}})}getActiveProductTours(t){ot(this.Jp)?t([],{isLoaded:!1,error:"Product tours not loaded"}):this.Jp.getActiveProductTours(t)}showProductTour(t){var e;(e=this.Jp)===null||e===void 0||e.showTourById(t)}previewTour(t){this.Jp?this.Jp.previewTour(t):this.Bl(()=>{var e;this.Kp(),(e=this.Jp)===null||e===void 0||e.previewTour(t)})}dismissProductTour(){var t;(t=this.Jp)===null||t===void 0||t.dismissTour("user_clicked_skip")}nextStep(){var t;(t=this.Jp)===null||t===void 0||t.nextStep()}previousStep(){var t;(t=this.Jp)===null||t===void 0||t.previousStep()}clearCache(){var t;this.Zp=null,(t=this.Pc)===null||t===void 0||t.unregister("ph_product_tours")}resetTour(t){var e;(e=this.Jp)===null||e===void 0||e.resetTour(t)}resetAllTours(){var t;(t=this.Jp)===null||t===void 0||t.resetAllTours()}cancelPendingTour(t){var e;(e=this.Jp)===null||e===void 0||e.cancelPendingTour(t)}},featureFlags:$0},{siteApps:class{constructor(t){this._instance=t,this.Yp=0,this.Xp=[],this.apps={}}get isEnabled(){return!!this._instance.config.opt_in_site_apps}tg(t,e){if(!e)return;const n=this.globalsForEvent(e);this.Xp.push(n),this.Xp.length>1e3&&(this.Xp=this.Xp.slice(10))}get siteAppLoaders(){var t;return(t=et._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.tg.bind(this));this.eg=()=>{t(),this.Xp=[],this.eg=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[g,_]of Object.entries(f))u[g]={id:d[g],type:g,properties:_};const{$set_once:h,$set:m}=t;return{event:F(F({},jO(t,hU)),{},{properties:F(F(F({},t.properties),m?{$set:F(F({},(e=(n=t.properties)===null||n===void 0?void 0:n.$set)!==null&&e!==void 0?e:{}),m)}:{}),h?{$set_once:F(F({},(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}}ig(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)||(Ro.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)||(Ro.error("prepare_external_dependency_script returned null"),null):t}ng(){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=Oe==null?void 0:Oe.defaultView,d=u==null||(t=u.Node)===null||t===void 0?void 0:t.prototype;if(!u||!d)return()=>{};if(this.Yp++,this.sg)return this.rg();const f=[],h=this,m=new WeakSet,g=(b,x,S)=>{if(!(b!=null&&b[x]))return;const E=b[x];b[x]=S(E),f.push(()=>{b[x]=E})},_=b=>{if(m.has(b))return b;const x=h.ig(b);return x&&m.add(x),x},y=b=>b.map(x=>typeof x=="string"?x:_(x)).filter(x=>!Tn(x));return g(d,"appendChild",b=>function(x){const S=_(x);return S?b.call(this,S):x}),g(d,"insertBefore",b=>function(x,S){const E=_(x);return E?b.call(this,E,S):x}),g(d,"replaceChild",b=>function(x,S){const E=_(x);return E?b.call(this,E,S):S}),[(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(b=>{g(b,"append",x=>function(...S){return x.apply(this,y(S))}),g(b,"prepend",x=>function(...S){return x.apply(this,y(S))})}),[(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(b=>{g(b,"before",x=>function(...S){return x.apply(this,y(S))}),g(b,"after",x=>function(...S){return x.apply(this,y(S))}),g(b,"replaceWith",x=>function(...S){const E=y(S);return S.length&&!E.length?void 0:x.apply(this,E)})}),g((l=u.Element)===null||l===void 0?void 0:l.prototype,"insertAdjacentElement",b=>function(x,S){const E=_(S);return E?b.call(this,x,E):null}),this.sg=()=>{f.forEach(b=>b()),this.sg=void 0},this.rg()}rg(){let t=!1;return()=>{var e;t||(t=!0,this.Yp--,this.Yp===0&&((e=this.sg)===null||e===void 0||e.call(this)))}}og(t,e=!0){const n=this.ng();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.Xp.length&&(Ro.info(`Processing ${this.Xp.length} events for site app with id ${t.id}`),this.Xp.forEach(o=>this.og(()=>{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.eg)===null||i===void 0||i.call(this))};let r=!1;const s=i=>{e.errored=!i,e.loaded=!0,Ro.info(`Site app with id ${t.id} ${i?"loaded":"errored"}`),r&&n()};try{const{processEvent:i}=this.og(o=>t.init({posthog:this._instance,callback(l){o(),s(l)}}),!1);i&&(e.processEvent=i),r=!0}catch(i){Ro.error(b8+t.id,i),s(!1)}if(r&&e.loaded)try{n()}catch(i){Ro.error(`Error while processing buffered events PostHog app with config id ${t.id}`,i),e.errored=!0}}ag(){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)}lg(t){if(Object.keys(this.apps).length===0)return;const e=this.globalsForEvent(t);for(const n of Object.values(this.apps))try{this.og(()=>{var r;return(r=n.processEvent)===null||r===void 0?void 0:r.call(n,e)})}catch(r){Ro.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.ag(),void this._instance.on("eventCaptured",l=>this.lg(l))):void Ro.error('PostHog site apps are disabled. Enable the "opt_in_site_apps" config to proceed.');if((n=this.eg)===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;et[`__$$ph_site_app_${l}`]=this._instance,(i=et.__PosthogExtensions__)===null||i===void 0||(o=i.loadSiteApp)===null||o===void 0||o.call(i,this._instance,u,d=>{if(d)return Ro.error(b8+l,d)})}else Ro.error('PostHog site apps are disabled. Enable the "opt_in_site_apps" config to proceed.')}}},{surveys:class extends vU{constructor(t){super(new yU(t))}},featureFlags:$0},{tracingHeaders:class{constructor(t){this._instance=t,this.ug=void 0,this.cg=void 0,this.hg=void 0,this.Cp=()=>{const e=this.dg();var n,r;e?(le(this.ug)&&(this.ug=(n=et.__PosthogExtensions__)===null||n===void 0||(n=n.tracingHeadersPatchFns)===null||n===void 0?void 0:n._patchXHR(e,()=>this._instance.get_distinct_id(),this._instance.sessionManager)),le(this.cg)&&(this.cg=(r=et.__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.Rp()}}initialize(){this.startIfEnabledOrStop()}Bl(t){var e,n,r;!((e=et.__PosthogExtensions__)===null||e===void 0)&&e.tracingHeadersPatchFns?t():(n=et.__PosthogExtensions__)===null||n===void 0||(r=n.loadExternalDependency)===null||r===void 0||r.call(n,this._instance,"tracing-headers",s=>{if(s)return lU.error("failed to load script",s);t()})}vg(){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}dg(){const t=this.vg();return He(t)?(He(this.hg)?this.hg.splice(0,this.hg.length,...t):this.hg=[...t],t.length>0?this.hg:void 0):(He(this.hg)&&this.hg.splice(0),this.hg=t||void 0,this.hg)}Rp(){var t,e;(t=this.ug)===null||t===void 0||t.call(this),(e=this.cg)===null||e===void 0||e.call(this),this.ug=void 0,this.cg=void 0}startIfEnabledOrStop(){this.dg()?this.Bl(this.Cp):this.Rp()}}},{toolbar:class{constructor(t){this.instance=t}fg(t){et.ph_toolbar_state=t}pg(){var t;return(t=et.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(F_(this.instance.config)||!ae||!Oe)return!1;t=(r=t)!==null&&r!==void 0?r:ae.location,n=(s=n)!==null&&s!==void 0?s:ae.history;try{if(!e){try{ae.localStorage.setItem("test","test"),ae.localStorage.removeItem("test")}catch{return!1}e=ae==null?void 0:ae.localStorage}const i=_U||ov(t.hash,"__posthog")||ov(t.hash,"state");let o;const l=i?cP(()=>JSON.parse(atob(decodeURIComponent(i))))||cP(()=>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(S8)||"{}"),o.source="localstorage",delete o.userIntent),!(!o.token||this.instance.config.token!==o.token||(this.loadToolbar(o),0))}catch{return!1}}gg(t){const e=et.ph_load_toolbar||et.ph_load_editor;!ot(e)&&Nn(e)?e(t,this.instance):k8.warn("No toolbar load function found")}loadToolbar(t){const e=!!(Oe!=null&&Oe.getElementById("__POSTHOG_TOOLBAR__"));if(!ae||e)return!1;const n=this.instance.requestRouter.region==="custom"&&this.instance.config.advanced_disable_toolbar_metrics,r=F(F({token:this.instance.config.token},t),{},{apiURL:this.instance.requestRouter.endpointFor("ui")},n?{instrument:!1}:{});if(ae.localStorage.setItem(S8,JSON.stringify(F(F({},r),{},{source:void 0}))),this.pg()===2)this.gg(r);else if(this.pg()===0){var s,i;this.fg(1),(s=et.__PosthogExtensions__)===null||s===void 0||(i=s.loadExternalDependency)===null||i===void 0||i.call(s,this.instance,"toolbar",o=>{if(o)return k8.error("[Toolbar] Failed to load",o),void this.fg(0);this.fg(2),this.gg(r)}),Lt(ae,"turbolinks:load",()=>{this.fg(0),this.loadToolbar(r)})}return!0}mg(t){return this.loadToolbar(t)}maybeLoadEditor(t=void 0,e=void 0,n=void 0){return this.maybeLoadToolbar(t,e,n)}}},{experiments:class ur{get Fr(){return this._instance.config}constructor(e){this._instance=e,this.getWebExperimentsAndEvaluateDisplayLogic=(n=!1)=>{this.getWebExperiments(r=>{ur.yg("retrieved web experiments from the server"),this.bg=new Map,r.forEach(s=>{if(s.feature_flag_key){var i;this.bg&&(ur.yg("setting flag key ",s.feature_flag_key," to web experiment ",s),(i=this.bg)===null||i===void 0||i.set(s.feature_flag_key,s));const o=this._instance.getFeatureFlag(s.feature_flag_key);dt(o)&&s.variants[o]&&this._g(s,o)}else if(s.variants)for(const o in s.variants){const l=s.variants[o];ur.wg(l,this._instance)&&this.kg(s.name,o,l.transforms)}})},n)},this._instance.onFeatureFlags(n=>{this.onFeatureFlags(n)})}initialize(){}onFeatureFlags(e){if(this._is_bot())ur.yg(K8);else if(!this.Fr.disable_web_experiments){if(ot(this.bg))return this.bg=new Map,this.loadIfEnabled(),void this.previewWebExperiment();ur.yg("applying feature flags",e),e.forEach(n=>{var r;if(this.bg&&(!((r=this.bg)===null||r===void 0)&&r.has(n))){var s;const i=this._instance.getFeatureFlag(n),o=(s=this.bg)===null||s===void 0?void 0:s.get(n);i&&(o!=null&&o.variants[i])&&this._g(o,i)}})}}previewWebExperiment(){const e=ur.getWindowLocation();if(e!=null&&e.search){const n=of(e==null?void 0:e.search,"__experiment_id"),r=of(e==null?void 0:e.search,"__experiment_variant");n&&r&&(ur.yg(`previewing web experiments ${n} && ${r}`),this.getWebExperiments(s=>{this.Sg(parseInt(n),r,s)},!1,!0))}}loadIfEnabled(){this.Fr.disable_web_experiments||this.getWebExperimentsAndEvaluateDisplayLogic()}getWebExperiments(e,n,r){if(this.Fr.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.Fr.token}`),method:"GET",timestampMode:"query",callback:i=>e(i.statusCode===200&&i.json&&i.json.experiments||[])})}Sg(e,n,r){const s=r.filter(i=>i.id===e);s&&s.length>0&&(ur.yg(`Previewing web experiment [${s[0].name}] with variant [${n}]`),this.kg(s[0].name,n,s[0].variants[n].transforms))}_g(e,n){const r=e.variants[n];ur.xg(r,this._instance)?this.kg(e.name,n,r.transforms):ur.yg(`skipping variant ${n} of experiment ${e.name} because this page does not match its url conditions`)}static wg(e,n){return!ot(e.conditions)&&ur.xg(e,n)&&ur.$g(e)}static xg(e,n){var r;if(ot(e.conditions)||ot((r=e.conditions)===null||r===void 0?void 0:r.url))return!0;const s=ur.getWindowLocation();if(s){var i,o,l;const u=kM(n,s.href);return!(!((i=e.conditions)===null||i===void 0)&&i.url)||QU[(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 ae==null?void 0:ae.location}static $g(e){var n;if(ot(e.conditions)||ot((n=e.conditions)===null||n===void 0?void 0:n.utm))return!0;const r=$M();if(r.utm_source){var s,i,o,l,u,d,f,h;const m=!(!((s=e.conditions)===null||s===void 0||(s=s.utm)===null||s===void 0)&&s.utm_campaign)||((i=e.conditions)===null||i===void 0||(i=i.utm)===null||i===void 0?void 0:i.utm_campaign)==r.utm_campaign,g=!(!((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,_=!(!((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,y=!(!((f=e.conditions)===null||f===void 0||(f=f.utm)===null||f===void 0)&&f.utm_term)||((h=e.conditions)===null||h===void 0||(h=h.utm)===null||h===void 0?void 0:h.utm_term)==r.utm_term;return m&&_&&y&&g}return!1}static yg(e,...n){ge.info(`[WebExperiments] ${e}`,n)}static Cg(e,...n){ge.warn(`[WebExperiments] ${e}`,n)}static Tg(e){(e.namespaceURI==="http://www.w3.org/1999/xhtml"&&e.localName==="template"?e.content:e).querySelectorAll("a[target], template").forEach(n=>{var r;if(n.localName==="template")return void(n.namespaceURI==="http://www.w3.org/1999/xhtml"&&ur.Tg(n));if(n.namespaceURI!=="http://www.w3.org/1999/xhtml"||((r=n.getAttribute("target"))===null||r===void 0?void 0:r.toLowerCase())!=="_blank")return void n.removeAttribute("target");const s=(n.getAttribute("rel")||"").split(/\s+/).filter(i=>i&&!/^(opener|noopener)$/i.test(i));s.push("noopener"),n.setAttribute("rel",s.join(" "))})}kg(e,n,r){this._is_bot()?ur.yg(K8):n!=="control"?r.forEach(s=>{if(s.selector){var i;ur.yg(`applying transform of variant ${n} for experiment ${e} `,s);const o=(i=document)===null||i===void 0?void 0:i.querySelectorAll(s.selector);if(!(o!=null&&o.length))return void ur.Cg(`no element on this page matches selector ${s.selector} of variant ${n} for experiment ${e}`);const l=new Map;o==null||o.forEach(u=>{if(u.localName.toLowerCase()==="script")return;const d=u;if(s.html){var f;const m=u.namespaceURI==="http://www.w3.org/1998/Math/MathML"&&u.localName==="annotation-xml"&&((f=u.getAttribute("encoding"))===null||f===void 0?void 0:f.toLowerCase())||"",g=JSON.stringify([u.namespaceURI,u.localName,m]);let _=l.get(g);if(ot(_)){var h;const y=(h=q8)!==null&&h!==void 0?h:q8=XU(),b=u.ownerDocument.implementation.createHTMLDocument(""),x=b.createElementNS(u.namespaceURI,u.localName);m&&x.setAttribute("encoding",m);const S=b.createRange();S.selectNodeContents(x);const E=u.namespaceURI==="http://www.w3.org/2000/svg"&&/^(foreignObject|desc|title)$/.test(u.localName)||/^(text\/html|application\/xhtml\+xml)$/.test(m)?"http://www.w3.org/1999/xhtml":u.namespaceURI,C=S.createContextualFragment(s.html);u.namespaceURI==="http://www.w3.org/1998/Math/MathML"&&/^(mi|mo|mn|ms|mtext)$/.test(u.localName)?(x.appendChild(C),y.sanitize(x,F(F({},G8),{},{NAMESPACE:E||void 0,IN_PLACE:!0}))):(x.namespaceURI==="http://www.w3.org/1999/xhtml"&&x.localName==="template"?x.content:x).appendChild(y.sanitize(C,F(F({},G8),{},{NAMESPACE:E||void 0,RETURN_DOM_FRAGMENT:!0}))),ur.Tg(x),_=x.innerHTML,l.set(g,_)}d.innerHTML=_}s.css&&d.setAttribute("style",s.css)})}}):ur.yg("Control variants leave the page unmodified.")}_is_bot(){return Wr&&this._instance?cL(Wr,this.Fr.custom_blocked_useragents):void 0}},featureFlags:$0},{conversations:class{constructor(t){this._instance=t,this.Ig=void 0,this._conversationsManager=null,this.Mg=!1,this.ie=null,this.Eg=!1,this.Ag=0,this.Rg=null,this.Pg=null}initialize(){this.loadIfEnabled()}onRemoteConfig(t){if(this._instance.config.disable_conversations)return void(this.Rg=null);if(this.Og=t.ok,!t.ok)return;const e=t.config.conversations;ot(e)?this.Rg=null:(Es(e)?this.Ig=e:(this.Ig=e.enabled,this.ie=e),this.Ig||(this.Rg=null),this.loadIfEnabled())}reset(){var t;(t=this._conversationsManager)===null||t===void 0||t.reset(),this._conversationsManager=null,this.Ag++,this.Ig=void 0,this.ie=null,this.Og=void 0,this.Eg=!1,this.Rg=null}loadIfEnabled(){if(this._conversationsManager||this.Mg||this._instance.config.disable_conversations||F_(this._instance.config)||this._instance.config.cookieless_mode&&this._instance.consent.isOptedOut())return;const t=et==null?void 0:et.__PosthogExtensions__;if(t&&!le(this.Ig)&&this.Ig)if(this.ie&&this.ie.token){this.Mg=!0;try{const e=t.initConversations;if(e)return this.Fg(e),void(this.Mg=!1);const n=t.loadExternalDependency;if(!n)return void this.Dg(zb);const r=this.Ag;n(this._instance,"conversations",s=>{if(r!==this.Ag)return this.Mg=!1,void this.loadIfEnabled();s||!t.initConversations?this.Dg("Could not load conversations script",s):this.Fg(t.initConversations),this.Mg=!1})}catch(e){this.Dg("Error initializing conversations",e),this.Mg=!1}}else Ni.error("Conversations enabled but missing token in remote config.")}Fg(t){if(this.ie){try{this._conversationsManager=t(this.ie,this._instance),this.Eg=!1,Ni.info("Conversations loaded successfully")}catch(e){return void this.Dg("Error completing conversations initialization",e)}this.Pg&&this._conversationsManager.setTheme(this.Pg),this.Lg()}else Ni.error("Cannot complete initialization: remote config is null")}Lg(){const t=this.Rg;this.Rg=null,this._conversationsManager&&t&&(t==="open"?this._conversationsManager.open():this._conversationsManager.close())}Dg(t,e){Ni.error(t,e),this._conversationsManager=null,this.Mg=!1,this.Eg=!0}show(){this._conversationsManager?this._conversationsManager.show():Ni.warn("Conversations not loaded yet.")}hide(){this.Rg==="open"&&(this.Rg=null),this._conversationsManager&&this._conversationsManager.hide()}open(){this._conversationsManager?(this.Rg=null,this._conversationsManager.open()):this.Rg="open"}close(){this._conversationsManager?(this.Rg=null,this._conversationsManager.close()):this.Rg="close"}setTheme(t){var e,n;this.Pg=F(F(F({},this.Pg),t),{},{dark:F(F({},(e=this.Pg)===null||e===void 0?void 0:e.dark),t==null?void 0:t.dark)}),(n=this._conversationsManager)===null||n===void 0||n.setTheme(t)}isAvailable(){return this.Ig===!0&&!Tn(this._conversationsManager)}getUnavailableReason(){return this.isAvailable()?null:this._instance.config.disable_conversations?"disabled_by_config":F_(this._instance.config)?"disabled_for_toolbar":this._instance.config.cookieless_mode&&this._instance.consent.isOptedOut()?"consent_opted_out":this.Og===!1?"remote_config_failed":le(this.Ig)?this.Og?"disabled_in_project":"remote_config_pending":this.Ig?ot(this.ie)||!this.ie.token?"missing_token":et!=null&&et.__PosthogExtensions__?this.Mg?"initializing":this.Eg?"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 un(function*(){return r._conversationsManager?r._conversationsManager.sendMessage(t,e,n):(Ni.warn(Ic),null)})()}getMessages(t,e){var n=this;return un(function*(){return n._conversationsManager?n._conversationsManager.getMessages(t,e):(Ni.warn(Ic),null)})()}markAsRead(t){var e=this;return un(function*(){return e._conversationsManager?e._conversationsManager.markAsRead(t):(Ni.warn(Ic),null)})()}getTickets(t){var e=this;return un(function*(){return e._conversationsManager?e._conversationsManager.getTickets(t):(Ni.warn(Ic),null)})()}requestRestoreLink(t){var e=this;return un(function*(){return e._conversationsManager?e._conversationsManager.requestRestoreLink(t):(Ni.warn(Ic),null)})()}restoreFromToken(t){var e=this;return un(function*(){return e._conversationsManager?e._conversationsManager.restoreFromToken(t):(Ni.warn(Ic),null)})()}restoreFromUrlToken(){var t=this;return un(function*(){return t._conversationsManager?t._conversationsManager.restoreFromUrlToken():(Ni.warn(Ic),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}Md(){var t;(t=this._conversationsManager)===null||t===void 0||t.setIdentity()}Ed(){var t;(t=this._conversationsManager)===null||t===void 0||t.clearIdentity()}}},{logs:class extends tZ{constructor(t){super({get(){var e;return t==null||(e=t.config)===null||e===void 0?void 0:e.logs},captureHintKey:rM,get remoteConfigWillArrive(){var e,n;return!(!((e=t.lc)===null||e===void 0)&&e.call(t))||!!(!((n=et._POSTHOG_REMOTE_CONFIG)===null||n===void 0||(n=n[t.config.token])===null||n===void 0)&&n.config)}},()=>(function(e){var n;const r={};if(r.distinctId=e.get_distinct_id(),e.sessionManager){const{sessionId:s,windowId:i,sessionStartTimestamp:o,lastActivityTimestamp:l}=e.sessionManager.checkAndGetSessionAndWindowId(!0);r.sessionId=s,r.windowId=i,ot(o)||(r.sessionStartTimestamp=o),ot(l)||(r.lastActivityTimestamp=l)}if(!(et==null||(n=et.location)===null||n===void 0)&&n.href&&(r.currentUrl=e.config.disable_capture_url_hashes?jl(et.location.href):et.location.href),e.featureFlags){const s=e.featureFlags.getFlags();s&&s.length>0&&(r.activeFeatureFlags=s)}return r})(t)),this._instance=t,this.name=yL,this.df()}get cf(){return this._instance.__loaded}hf(){const t=En("[logs]"),e=et==null?void 0:et.__PosthogExtensions__;if(!e)return void t.error("PostHog Extensions not found.");const n=e.loadExternalDependency;if(n)return r=>{n(this._instance,"logs",s=>{const i=e.logs;r(s,i!=null&&i.initializeLogs?{initialize:o=>i.initializeLogs(o),replay(o,l){var u;return(u=i.replayConsoleBuffer)===null||u===void 0?void 0:u.call(i,o,l)}}:void 0)})};t.error(zb)}}},{metrics:class{constructor(t){this._instance=t,this.R=En("[metrics]"),this.Ti=!1}initialize(){this.onConfigChange()}onConfigChange(){var t;if(this.Ti)return;const e=!!(!((t=this._instance.config.metrics)===null||t===void 0)&&t.network);e&&!this.Ng?this.Ng=(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=sZ(n,s),o=iZ(n,s);return()=>{r=!1,i(),o()}})(this._instance):!e&&this.Ng&&(this.Ng(),this.Ng=void 0)}pf(){var t;if(this.Ti)return;const e=(t=this._instance)===null||t===void 0||(t=t.config)===null||t===void 0?void 0:t.metrics;var n;return this.lf&&this.gf===e||((n=this.lf)===null||n===void 0||n.reset(),this.gf=e,this.lf=new bV(this.ff(),(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.R)),this.lf}count(t,e=1,n){var r;(r=this.pf())===null||r===void 0||r.count(t,e,n)}gauge(t,e,n){var r;(r=this.pf())===null||r===void 0||r.gauge(t,e,n)}histogram(t,e,n){var r;(r=this.pf())===null||r===void 0||r.histogram(t,e,n)}flush(t){if(!this.lf)return Promise.resolve();if(t){const e=this.lf.drainWindow();return e&&this.To(e,t),Promise.resolve()}return this.lf.flush().catch(e=>this.R.error("PostHog metrics flush failed:",e))}reset(){var t;(t=this.lf)===null||t===void 0||t.reset()}dispose(){var t,e;this.Ti=!0,(t=this.Ng)===null||t===void 0||t.call(this),this.Ng=void 0,(e=this.lf)===null||e===void 0||e.reset()}ff(){const t=this._instance,e=this;return{get isDisabled(){return!1},get optedOut(){return!t.is_capturing()},To:n=>e.To(n),getLibraryId:()=>js.LIB_NAME,getLibraryVersion:()=>js.LIB_VERSION}}To(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(F(F({method:"POST",url:this.jg(),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}`)})}}}))})}jg(){return this._instance.requestRouter.endpointFor("api","/i/v1/metrics")+"?token="+encodeURIComponent(this._instance.config.token)}}},{webMCP:class{constructor(t){this._instance=t,this.qg=!1}initialize(){this.startIfEnabled()}startIfEnabled(){if(!this._instance.config.capture_webmcp||this.qg)return;const t=Oe==null?void 0:Oe.modelContext;if(!t||!Nn(t.registerTool))return;const e=J8.get(t);if(e)return e.instances.add(this._instance),void(this.qg=!0);const n={instances:new Set([this._instance])},r=t.registerTool,s=this;cf(t,"registerTool",i=>{const o=i;return function(l,...u){let d=l;try{d=s.Bg(l,n)}catch{return o.call(this,l,...u)}return o.call(this,d,...u)}}),t.registerTool!==r&&(J8.set(t,n),this.qg=!0)}Bg(t,e){if(!t||!Nn(t.execute))return t;const n=t.execute,r=this,{tool:s,injected:i}=(function(o,l){const u={intent:!1,model:!1},d=o.inputSchema;if(!(function(_){return!!le(_)||ct(_)&&Object.keys(_).every(y=>oZ.has(y)||y.startsWith("x-"))&&_.additionalProperties!==!0&&!ct(_.additionalProperties)&&(!_.type||_.type==="object")&&(!_.properties||ct(_.properties))&&(!_.required||He(_.required))})(d))return{tool:mw(o),injected:u};const f=(d==null?void 0:d.properties)||{},h=_=>pw(f,_)||He(d==null?void 0:d.required)&&d.required.includes(_);if(u.intent=l.intent&&!h("context"),u.model=l.model&&!h("llm_model"),!u.intent&&!u.model)return{tool:mw(o),injected:u};const m=F({},f),g=He(d==null?void 0:d.required)?[...d.required]:[];return u.intent&&(m.context={type:"string",description:`Explain why this tool is called and how it supports the user's goal. Describe the abstract purpose only. Do not include personal or identifying information. Generalize specific entities as roles such as "a customer".`},g.includes("context")||g.push("context")),u.model&&(m.llm_model={type:"string",description:`The model identifier you are running as, for example "claude-opus-4-8" or "gpt-5.2". Pass "unknown" if you are not certain. Recorded for the site developer's analytics.`},g.includes("llm_model")||g.push("llm_model")),{tool:mw(o,F(F({},d),{},{type:(d==null?void 0:d.type)||"object",properties:m,required:g})),injected:u}})(t,(function(o){const l={intent:!1,model:!1};for(const u of o.instances){const d=eT(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,_){if(!ct(g))return{};try{const y=_.intent?tT(g.context,2048,!0):void 0,b=_.model?tT(g.llm_model,256):void 0;return F(F({},y&&y!=="{}"?{intent:y}:{}),b&&b.toLowerCase()!=="unknown"?{model:b}:{})}catch{return{}}})(o[0],i),d=(function(g,_){const y=g[0];if(!ct(y))return g;try{const b=_.intent&&pw(y,"context"),x=_.model&&pw(y,"llm_model");if(!b&&!x)return g;const S=F({},y);return b&&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.zg(e,s,l,{error:g,errorResult:!1},u),g}if((h=f)&&typeof h.then=="function")return Promise.resolve(f).then(g=>{const _=nT(g)?{error:g,errorResult:!0}:void 0;return r.zg(e,s,l,_,u),g},g=>{throw r.zg(e,s,l,{error:g,errorResult:!1},u),g});var h;const m=nT(f)?{error:f,errorResult:!0}:void 0;return r.zg(e,s,l,m,u),f}}),s}zg(t,e,n,r,s){const i=Date.now()-n.getTime();let o;for(const u of t.instances){var l;const d=eT(u.config.capture_webmcp);if(d){r&&!o&&(o=fZ(r.error,r.errorResult));try{u.capture("$mcp_tool_call",F(F(F({$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:ln==null?void 0:ln.hostname,$mcp_duration_ms:i,$mcp_is_error:!!r},o?{$mcp_error_type:o.type,$mcp_error_message:o.message}:{}),d.intent&&s.intent?{$mcp_intent:s.intent,$mcp_intent_source:"context_parameter"}:{}),d.model&&s.model?{$mcp_llm_model:s.model,$mcp_llm_model_source:"self_reported"}:{}),{timestamp:n})}catch{continue}if(r&&o&&u.exceptions&&(!((l=u.exceptionObserver)===null||l===void 0)&&l.isEnabled))try{const f={$exception_list:uZ(u.exceptions,r,o.message),$exception_level:"error",$exception_source:"mcp.tool_call",$mcp_interface:"webmcp",$mcp_tool_name:e.name,$mcp_resource_name:e.name,$mcp_tool_description:e.description,$mcp_server_name:ln==null?void 0:ln.hostname};u.exceptionObserver.captureException(f)}catch{}}}}}}));const hZ=(function(){js.SDK_DIST_CHANNEL="npm";const t=op[zh]=new lp;return(function(){function e(){e.done||(e.done=!0,aL=!1,Zt(op,function(n){n._dom_loaded()}))}Oe!=null&&Oe.addEventListener?Oe.readyState==="complete"?e():Lt(Oe,"DOMContentLoaded",e,{capture:!1}):ae&&ge.error("Browser doesn't support `document.addEventListener` so PostHog couldn't be initialized")})(),t})();var Xe=hZ;function c2(t){const e=Object.values(t).filter(r=>typeof r=="number");return Object.entries(t).filter(([r,s])=>e.indexOf(+r)===-1).map(([r,s])=>s)}function rT(t,e="|"){return t.map(n=>AL(n)).join(e)}function u2(t,e){return typeof e=="bigint"?e.toString():e}class pZ{constructor(e){this._getter=e,this._value=void 0}get value(){const e=this._getter;return e!==void 0&&(this._value=e(),this._getter=void 0),this._value}}function uy(t){return new pZ(t)}function mZ(t){return t==null}function AS(t){const e=t.startsWith("^")?1:0,n=t.endsWith("$")?t.length-1:t.length;return t.slice(e,n)}function gZ(t,e){const n=t/e,r=Math.round(n),s=4*Number.EPSILON*Math.max(Math.abs(n),1);return Math.abs(n-r)<s?0:n-r}function Za(t,e,n){Object.defineProperty(t,e,{value:n,writable:!0,enumerable:!0,configurable:!0})}function IS(t){const e=Object.getOwnPropertyDescriptor(t,"shape");return e!=null&&e.get?e.get.raw:e==null?void 0:e.value}function $a(t){return IS(t._zod.def)??t._zod.def.shape}function CL(t,e,n){Object.defineProperty(t,e,{get(){const r=n();return Za(this,e,r),r},enumerable:!0,configurable:!0})}function PL(t,e,n){e in t?Za(t,e,n):t[e]=n}function yu(t,e,n,r){const s=$a(e);for(const i of n){const o=Object.getOwnPropertyDescriptor(s,i);o.enumerable&&(o.get?CL(t,i,()=>{const l=e._zod.def.shape[i];return r?r(l,i):l}):PL(t,i,r?r(o.value,i):o.value))}}function vZ(t,e){for(const n of Reflect.ownKeys(e)){const r=Object.getOwnPropertyDescriptor(e,n);r.enumerable&&(r.get?CL(t,n,()=>e[n]):PL(t,n,r.value))}}function hi(...t){const e={};for(const n of t){const r=Object.getOwnPropertyDescriptors(n);Object.assign(e,r)}return Object.defineProperties({},e)}function yZ(t){return JSON.stringify(t)}function _Z(t){return t.toLowerCase().trim().replace(/[^\w\s-]/g,"").replace(/[\s_-]+/g,"-").replace(/^-+|-+$/g,"")}const TL="captureStackTrace"in Error?Error.captureStackTrace:(...t)=>{};function Pp(t){return typeof t=="object"&&t!==null&&!Array.isArray(t)}const wZ=uy(()=>{var t;if(mo.jitless||typeof navigator<"u"&&((t=navigator==null?void 0:navigator.userAgent)!=null&&t.includes("Cloudflare")))return!1;try{const e=Function;return new e(""),!0}catch{return!1}});function uf(t){if(Pp(t)===!1)return!1;const e=t.constructor;if(e===void 0||typeof e!="function")return!0;const n=e.prototype;return!(Pp(n)===!1||Object.prototype.hasOwnProperty.call(n,"isPrototypeOf")===!1)}function RL(t){return uf(t)?{...t}:Array.isArray(t)?[...t]:t instanceof Map?new Map(t):t instanceof Set?new Set(t):t}const bZ=new Set(["string","number","symbol"]);function df(t){return t.replace(/[.*+?^${}()|[\]\\]/g,"\\$&")}function oc(t,e,n){const r=new t._zod.constr(e??t._zod.def);return(!e||n!=null&&n.parent)&&(r._zod.parent=t),r}function nt(t){const e=t;if(!e)return{};if(typeof e=="string")return{error:()=>e};if((e==null?void 0:e.message)!==void 0){if((e==null?void 0:e.error)!==void 0)throw new Error("Cannot specify both `message` and `error` params");e.error=e.message}return delete e.message,typeof e.error=="string"?{...e,error:()=>e.error}:e}function AL(t){return typeof t=="bigint"?t.toString()+"n":typeof t=="string"?`"${t}"`:`${t}`}function xZ(t){return Object.keys(t).filter(e=>t[e]._zod.optin!==void 0&&t[e]._zod.optout==="optional")}const IL={safeint:[Number.MIN_SAFE_INTEGER,Number.MAX_SAFE_INTEGER],int32:[-2147483648,2147483647],uint32:[0,4294967295],float32:[-34028234663852886e22,34028234663852886e22],float64:[-Number.MAX_VALUE,Number.MAX_VALUE]},SZ={int64:[BigInt("-9223372036854775808"),BigInt("9223372036854775807")],uint64:[BigInt(0),BigInt("18446744073709551615")]};function kZ(t,e){const n=t._zod.def,r=n.checks;if(r&&r.length>0)throw new Error(".pick() cannot be used on object schemas containing refinements");const i={};return yu(i,t,dy(t,e)),oc(t,hi(n,{shape:i,checks:[]}))}function dy(t,e){var s;const n=$a(t),r=[];for(const i of Reflect.ownKeys(e)){if(!((s=Object.getOwnPropertyDescriptor(n,i))!=null&&s.enumerable))throw new Error(`Unrecognized key: "${String(i)}"`);e[i]&&r.push(i)}return r}function EZ(t,e){const n=t._zod.def,r=n.checks;if(r&&r.length>0)throw new Error(".omit() cannot be used on object schemas containing refinements");const i=new Set(dy(t,e)),o={};return yu(o,t,Reflect.ownKeys($a(t)).filter(l=>!i.has(l))),oc(t,hi(n,{shape:o,checks:[]}))}function CZ(t,e){if(!uf(e))throw new Error("Invalid input to extend: expected a plain object");const n=t._zod.def.checks;if(n&&n.length>0){const s=$a(t);for(const i of Reflect.ownKeys(e))if(Object.getOwnPropertyDescriptor(s,i)!==void 0)throw new Error("Cannot overwrite keys on object schemas containing refinements. Use `.safeExtend()` instead.")}return oc(t,hi(t._zod.def,{shape:OL(t,e)}))}function OL(t,e){const n={};return yu(n,t,Reflect.ownKeys($a(t))),vZ(n,e),n}function PZ(t,e){if(!uf(e))throw new Error("Invalid input to safeExtend: expected a plain object");return oc(t,hi(t._zod.def,{shape:OL(t,e)}))}function TZ(t,e){var s,i;if(!((s=e==null?void 0:e._zod)!=null&&s.def))throw new Error("Invalid input to merge: expected an object schema. To merge a plain shape, use `.extend()`.");if((i=t._zod.def.checks)!=null&&i.length)throw new Error(".merge() cannot be used on object schemas containing refinements. Use .safeExtend() instead.");const n={};yu(n,t,Reflect.ownKeys($a(t))),yu(n,e,Reflect.ownKeys($a(e)));const r=hi(t._zod.def,{shape:n,get catchall(){return e._zod.def.catchall},checks:e._zod.def.checks??[]});return oc(t,r)}function sT(t,e,n,r="partial"){const i=e._zod.def.checks;if(i&&i.length>0)throw new Error(`.${r}() cannot be used on object schemas containing refinements`);const l=n?new Set(dy(e,n)):void 0,u={};return yu(u,e,Reflect.ownKeys($a(e)),t&&((d,f)=>l&&!l.has(f)?d:new t({type:"optional",innerType:d}))),oc(e,hi(e._zod.def,{shape:u,checks:[]}))}function RZ(t,e,n){const r=n?new Set(dy(e,n)):void 0,s={};return yu(s,e,Reflect.ownKeys($a(e)),(i,o)=>r&&!r.has(o)?i:new t({type:"nonoptional",innerType:i})),oc(e,hi(e._zod.def,{shape:s}))}function Oa(t,e=0){var n;if(t.aborted===!0)return!0;for(let r=e;r<t.issues.length;r++)if(((n=t.issues[r])==null?void 0:n.continue)!==!0)return!0;return!1}function AZ(t,e=0){var n;if(t.aborted===!0)return!0;for(let r=e;r<t.issues.length;r++)if(((n=t.issues[r])==null?void 0:n.continue)===!1)return!0;return!1}function Ed(t,e){return e.map(n=>{var r;return(r=n).path??(r.path=[]),n.path.unshift(t),n})}function Ah(t){return typeof t=="string"?t:t==null?void 0:t.message}function iT(t){const e=[];for(const n of t??[]){const r=n._zod.def;if(!/_(length|size)$|_equals$/.test(r.check))break;const s=r.maximum??r.length??r.size;s>=0&&e.push([s,n])}return e}function d2(t,e,n){var r;for(let s=e;s<t.length;s++)(r=t[s]).schema??(r.schema=n)}function Kl(t,e,n){var u,d,f,h,m,g,_,y,b,x;var r;const s=(d=(u=t.inst)==null?void 0:u._zod)==null?void 0:d.traits;s!=null&&s.has("$ZodType")&&(s.has("$ZodCheck")?(r=t).schema??(r.schema=t.inst):t.schema=t.inst);const i=t.schema!==t.inst?(h=(f=t.schema)==null?void 0:f._zod.def)==null?void 0:h.error:void 0,o=t.message?t.message:Ah((_=(g=(m=t.inst)==null?void 0:m._zod.def)==null?void 0:g.error)==null?void 0:_.call(g,t))??Ah(i==null?void 0:i(t))??Ah((y=e==null?void 0:e.error)==null?void 0:y.call(e,t))??Ah((b=n.customError)==null?void 0:b.call(n,t))??Ah((x=n.localeError)==null?void 0:x.call(n,t))??"Invalid input",l={};for(const S of Object.keys(t))S==="inst"||S==="schema"||S==="continue"||S==="input"||S==="__proto__"||(l[S]=t[S]);return l.path??(l.path=[]),l.message=o,e!=null&&e.reportInput&&(l.input=t.input),l}const IZ=/[\uD800-\uDBFF]/;function OS(t){const e=t.length;if(!IZ.test(t))return e;let n=e;for(let r=0;r<e-1;r++)(t.charCodeAt(r)&64512)===55296&&(t.charCodeAt(r+1)&64512)===56320&&(n--,r++);return n}function MS(t){return Array.isArray(t)?"array":typeof t=="string"?"string":"unknown"}function OZ(t){const e=typeof t;switch(e){case"number":return Number.isNaN(t)?"nan":"number";case"object":{if(t===null)return"null";if(Array.isArray(t))return"array";const n=t;if(n&&Object.getPrototypeOf(n)!==Object.prototype&&"constructor"in n&&n.constructor)return n.constructor.name}}return e}function Tp(...t){const[e,n,r]=t;return typeof e=="string"?{message:e,code:"custom",input:n,inst:r}:{...e}}function MZ(t,e){for(const n in e){const r=Object.getOwnPropertyDescriptor(e,n);r.get?Object.defineProperty(t,n,{...r,enumerable:!1}):LZ(t,n,r.value)}}function Gl(t,e,n,r=!0){return Object.defineProperty(t,e,{configurable:!0,writable:!0,enumerable:r,value:n}),n}function ML(t,e,n){return Gl(t,e,n,!1)}function LL(t,e){for(const n in t){const r=t[n];Object.defineProperty(e,n,{configurable:!0,enumerable:!0,get(){return Gl(this,n,r(this))},set(s){Gl(this,n,s)}})}return e}function LZ(t,e,n){Object.defineProperty(t,e,{configurable:!0,get(){return this==null?n:Gl(this,e,n.bind(this))},set(r){Gl(this,e,r)}})}function NZ(t,e){const n=Object.getPrototypeOf(t);return e in n?void 0:n}let gw,vl=!1;const DZ={configurable:!0,get(){vl=!0}};function nn(t,e,n){const r=Object.getPrototypeOf(t._zod);if(e in r&&gw!==t._zod){gw=void 0;return}gw=t._zod,Object.defineProperty(r,e,{configurable:!0,get(){Object.defineProperty(this,e,DZ);const s=vl;vl=!1;try{const i=n(this);return vl?delete this[e]:Object.defineProperty(this,e,{configurable:!0,writable:!0,value:i}),vl=vl||s,i}catch(i){throw delete this[e],vl=vl||s,i}},set(s){Object.defineProperty(this,e,{configurable:!0,writable:!0,value:s})}})}function $Z(t,e,n,r){const s=NZ(t,e);s&&Object.defineProperty(s,e,{configurable:!0,get(){const i={configurable:!0,writable:!0,enumerable:r,value:void 0};return Object.defineProperty(this,e,i),i.value=n(this),Object.defineProperty(this,e,i),i.value},set(i){Object.defineProperty(this,e,{configurable:!0,writable:!0,enumerable:r,value:i})}})}const FZ="~constantCatch";function jZ(t){const e=()=>t;return e[FZ]=!0,e}var oT;const NL=Object.freeze({status:"aborted"}),vw={value:void 0,enumerable:!1};let aT="captureStackTrace"in Error?Error:null;function zZ(t){const e=aT;if(e){const n=e.stackTraceLimit;if(typeof n=="number"){try{e.stackTraceLimit=0}catch{return aT=null,new t}try{return new t}finally{e.stackTraceLimit=n}}}return new t}function fe(t,e,n,r){const s={};function i(m){this.def=m,this.constr=h,this.traits=new Set}i.prototype=s;const o=n,l=o&&new WeakSet;function u(m,g){if(m._zod){if(m._zod.traits.has(t))return}else{vw.value=new i(g);try{Object.defineProperty(m,"_zod",vw)}finally{vw.value=void 0}}if(m._zod.traits.add(t),e(m,g),l){const y=Object.getPrototypeOf(m),b=m._zod.constr.prototype;let x=y;for(;x&&x!==b;)x=Object.getPrototypeOf(x);const S=x??y;l.has(S)||(l.add(S),MZ(S,o))}const _=h.prototype;for(const y in _)Object.prototype.hasOwnProperty.call(_,y)&&(y in m||(m[y]=_[y].bind(m)))}const d=(r==null?void 0:r.Parent)??Object;class f extends d{}Object.defineProperty(f,"name",{value:t});function h(m){var b;const g=r!=null&&r.Parent?zZ(f):this;u(g,m);const _=g._zod.deferred;if(_){for(const x of _)x();g._zod.deferred=void 0}const y=(b=globalThis.__zod_globalConfig)==null?void 0:b.postProcessor;return y&&y(g),g}return Object.defineProperty(h,"init",{value:u}),Object.defineProperty(h,Symbol.hasInstance,{value:m=>{var g,_;return r!=null&&r.Parent&&m instanceof r.Parent?!0:(_=(g=m==null?void 0:m._zod)==null?void 0:g.traits)==null?void 0:_.has(t)}}),Object.defineProperty(h,"name",{value:t}),h}class ou extends Error{constructor(){super("Encountered Promise during synchronous parse. Use .parseAsync() instead.")}}class DL extends Error{constructor(e){super(`Encountered unidirectional transform during encode: ${e}`),this.name="ZodEncodeError"}}(oT=globalThis).__zod_globalConfig??(oT.__zod_globalConfig={});const mo=globalThis.__zod_globalConfig;function Xo(t){return t&&Object.assign(mo,t),mo}function VZ(){const t=this._zod;return t.message??(t.message=JSON.stringify(t.def,u2,2)),t.message}function HZ(t){this._zod.message=t}const UZ={get:VZ,set:HZ,enumerable:!0,configurable:!0},yw={value:void 0,enumerable:!1},lT=new WeakSet([Object.prototype,Error.prototype]),ZZ=(t,e)=>{t.name="$ZodError",yw.value=e,Object.defineProperty(t,"issues",yw),yw.value=void 0,Object.defineProperty(t,"message",UZ);const n=Object.getPrototypeOf(t);lT.has(n)||(lT.add(n),Object.defineProperty(n,"toString",{configurable:!0,enumerable:!1,get(){const r=()=>this.message;return Object.defineProperty(this,"toString",{value:r,configurable:!0,writable:!0}),r},set(r){Object.defineProperty(this,"toString",{value:r,configurable:!0,writable:!0})}}))},BZ=fe("$ZodError",ZZ);function WZ(t,e,n){return Object.prototype.hasOwnProperty.call(t,e)||(e==="__proto__"?Object.defineProperty(t,e,{value:n(),writable:!0,enumerable:!0,configurable:!0}):t[e]=n()),t[e]}function KZ(t,e=n=>n.message){const n={},r=[];for(const s of t.issues)s.path.length>0?WZ(n,s.path[0],()=>[]).push(e(s)):r.push(e(s));return{formErrors:r,fieldErrors:n}}function GZ(t,e=n=>n.message){const n={_errors:[]},r=(s,i=[])=>{for(const o of s.issues)if(o.code==="invalid_union"&&o.errors.length)o.errors.map(l=>r({issues:l},[...i,...o.path]));else if(o.code==="invalid_key")r({issues:o.issues},[...i,...o.path]);else if(o.code==="invalid_element")r({issues:o.issues},[...i,...o.path]);else{const l=[...i,...o.path];if(l.length===0)n._errors.push(e(o));else{let u=n,d=0;for(;d<l.length;){const f=l[d],h=d===l.length-1;if(f==="_errors"){h&&u._errors.push(e(o)),d++;continue}Object.prototype.hasOwnProperty.call(u,f)||Object.defineProperty(u,f,{value:{_errors:[]},enumerable:!0,writable:!0,configurable:!0});const m=u[f];h&&m._errors.push(e(o)),u=m,d++}}}};return r(t),n}function fy(t,e){return{callee:(e==null?void 0:e.callee)??t,Err:e==null?void 0:e.Err}}const LS=t=>{const e=(n,r,s,i)=>{const o=s?{...s,async:!1}:{async:!1},l=n._zod.run({value:r,issues:[]},o);if(l instanceof Promise)throw new ou;if(l.issues.length){const u=new((i==null?void 0:i.Err)??t)(l.issues.map(d=>Kl(d,o,Xo())));throw TL(u,(i==null?void 0:i.callee)??e),u}return l.value};return e},NS=t=>{const e=async(n,r,s,i)=>{const o=s?{...s,async:!0}:{async:!0};let l=n._zod.run({value:r,issues:[]},o);if(l instanceof Promise&&(l=await l),l.issues.length){const u=new((i==null?void 0:i.Err)??t)(l.issues.map(d=>Kl(d,o,Xo())));throw TL(u,(i==null?void 0:i.callee)??e),u}return l.value};return e},DS=t=>(e,n,r)=>{const s=r?{...r,async:!1}:{async:!1},i=e._zod.run({value:n,issues:[]},s);if(i instanceof Promise)throw new ou;return i.issues.length?$L(t,i.issues,s):{success:!0,data:i.value}};function $L(t,e,n){let r;return{success:!1,get error(){return r||(r=new t(e.map(s=>Kl(s,n,Xo()))),e=void 0,n=void 0),r},set error(s){r=s,e=void 0,n=void 0}}}const $S=t=>async(e,n,r)=>{const s=r?{...r,async:!0}:{async:!0};let i=e._zod.run({value:n,issues:[]},s);return i instanceof Promise&&(i=await i),i.issues.length?$L(t,i.issues,s):{success:!0,data:i.value}},qZ=Symbol.for("zod.compile.invalid"),YZ=Symbol.for("zod.compile.fallback"),XZ=((t,e,n)=>{const r=t._zod.bag.validator;if(r!==void 0){if(r(e)!==qZ)return!0;if(r.definite===!0&&n===void 0)return!1}return QZ(t,e,n)});function QZ(t,e,n){const r=n?{...n,async:!1,abortEarly:!0}:{async:!1,abortEarly:!0},s=t._zod.bag.fallbackRun;let i;if(s?(r[YZ]=!0,i=s({value:e,issues:[]},r)):i=t._zod.run({value:e,issues:[]},r),i instanceof Promise)throw new ou;return i.issues.length===0}const JZ=async(t,e,n)=>{const r=n?{...n,async:!0,abortEarly:!0}:{async:!0,abortEarly:!0};let s=t._zod.run({value:e,issues:[]},r);return s instanceof Promise&&(s=await s),s.issues.length===0},eB=t=>{const e=LS(t),n=(r,s,i,o)=>{const l=i?{...i,direction:"backward"}:{direction:"backward"};return e(r,s,l,fy(n,o))};return n},tB=t=>{const e=LS(t),n=(r,s,i,o)=>e(r,s,i,fy(n,o));return n},nB=t=>{const e=NS(t),n=async(r,s,i,o)=>{const l=i?{...i,direction:"backward"}:{direction:"backward"};return await e(r,s,l,fy(n,o))};return n},rB=t=>{const e=NS(t),n=async(r,s,i,o)=>await e(r,s,i,fy(n,o));return n},sB=t=>(e,n,r)=>{const s=r?{...r,direction:"backward"}:{direction:"backward"};return DS(t)(e,n,s)},iB=t=>(e,n,r)=>DS(t)(e,n,r),oB=t=>async(e,n,r)=>{const s=r?{...r,direction:"backward"}:{direction:"backward"};return $S(t)(e,n,s)},aB=t=>async(e,n,r)=>$S(t)(e,n,r),lB=/^[cC][0-9a-z]{6,}$/,cB=/^[0-9a-z]+$/,uB=/^[0-7][0-9A-HJKMNP-TV-Za-hjkmnp-tv-z]{25}$/,dB=/^[0-9a-vA-V]{20}$/,fB=/^[A-Za-z0-9]{27}$/,hB=/^[a-zA-Z0-9_-]{21}$/;function pB(t){return new RegExp(`^[a-zA-Z0-9_-]{${t}}$`)}const mB=/^P(?:(\d+W)|(?!.*W)(?=\d|T\d)(\d+Y)?(\d+M)?(\d+D)?(T(?=\d)(\d+H)?(\d+M)?(\d+([.,]\d+)?S)?)?)$/,gB=/^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{12})$/,cT=t=>t?new RegExp(`^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-${t}[0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12})$`):/^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$/,vB=/^(?:[A-Za-z0-9_'+\-]+\.)*[A-Za-z0-9_'+\-]*[A-Za-z0-9_+-]@(?:[A-Za-z0-9][A-Za-z0-9\-]*\.)+[A-Za-z]{2,}$/,yB="^(?=[\\s\\S]*[\\p{Extended_Pictographic}\\p{Regional_Indicator}\\u20E3])[\\p{Extended_Pictographic}\\p{Emoji_Component}]+$";function _B(){return new RegExp(yB,"u")}const wB=/^(?:(?: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])$/,bB=/^(([0-9a-fA-F]{1,4}:){7}[0-9a-fA-F]{1,4}|([0-9a-fA-F]{1,4}:){1,7}:|([0-9a-fA-F]{1,4}:){1,6}:[0-9a-fA-F]{1,4}|([0-9a-fA-F]{1,4}:){1,5}(:[0-9a-fA-F]{1,4}){1,2}|([0-9a-fA-F]{1,4}:){1,4}(:[0-9a-fA-F]{1,4}){1,3}|([0-9a-fA-F]{1,4}:){1,3}(:[0-9a-fA-F]{1,4}){1,4}|([0-9a-fA-F]{1,4}:){1,2}(:[0-9a-fA-F]{1,4}){1,5}|[0-9a-fA-F]{1,4}:((:[0-9a-fA-F]{1,4}){1,6})|:((:[0-9a-fA-F]{1,4}){1,7}|:))$/,xB=/^((25[0-5]|2[0-4][0-9]|1[0-9][0-9]|[1-9][0-9]|[0-9])\.){3}(25[0-5]|2[0-4][0-9]|1[0-9][0-9]|[1-9][0-9]|[0-9])\/([0-9]|[1-2][0-9]|3[0-2])$/,SB=/^(([0-9a-fA-F]{1,4}:){7}[0-9a-fA-F]{1,4}|([0-9a-fA-F]{1,4}:){1,7}:|([0-9a-fA-F]{1,4}:){1,6}:[0-9a-fA-F]{1,4}|([0-9a-fA-F]{1,4}:){1,5}(:[0-9a-fA-F]{1,4}){1,2}|([0-9a-fA-F]{1,4}:){1,4}(:[0-9a-fA-F]{1,4}){1,3}|([0-9a-fA-F]{1,4}:){1,3}(:[0-9a-fA-F]{1,4}){1,4}|([0-9a-fA-F]{1,4}:){1,2}(:[0-9a-fA-F]{1,4}){1,5}|[0-9a-fA-F]{1,4}:((:[0-9a-fA-F]{1,4}){1,6})|:((:[0-9a-fA-F]{1,4}){1,7}|:))\/(12[0-8]|1[01][0-9]|[1-9]?[0-9])$/,kB=/^$|^(?:[0-9a-zA-Z+/]{4})*(?:(?:[0-9a-zA-Z+/]{2}==)|(?:[0-9a-zA-Z+/]{3}=))?$/,EB=/^(?:[A-Za-z0-9_-]{4})*(?:[A-Za-z0-9_-]{2,3})?$/,CB=/^https?$/,PB=/^\+[1-9]\d{6,14}$/,FL="(?:(?:\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\\d|30)|(?:02)-(?:0[1-9]|1\\d|2[0-8])))";function TB(t){return new RegExp(`^${t}$`)}const RB=TB(FL);function f2(t){const e="(?:[01]\\d|2[0-3]):[0-5]\\d";return typeof t.precision=="number"?t.precision===-1?`${e}`:t.precision===0?`${e}:[0-5]\\d`:`${e}:[0-5]\\d\\.\\d{${t.precision}}`:t.seconds?`${e}:[0-5]\\d(?:\\.\\d+)?`:`${e}(?::[0-5]\\d(?:\\.\\d+)?)?`}function AB(t){return new RegExp(`^${f2(t)}$`)}function IB(t){const e=["Z"];t.offset&&e.push("([+-](?:[01]\\d|2[0-3]):[0-5]\\d)");const n=`${f2({precision:t.precision,seconds:!0})}(?:${e.join("|")})`,r=t.local?`${n}|${f2({precision:t.precision})}`:n;return new RegExp(`^${FL}T(?:${r})$`)}const OB=/^[\s\S]{0,}$/,MB=/^-?\d+$/,FS=/^-?\d+(?:\.\d+)?$/,LB=/^(?:true|false)$/i,NB=/^[^A-Z]*$/,DB=/^[^a-z]*$/,Js=fe("$ZodCheck",(t,e)=>{var n;t._zod??(t._zod={}),t._zod.def=e,(n=t._zod).onattach??(n.onattach=[])}),jS=t=>{const e=t.value;return!mZ(e)&&e.length!==void 0},fv={number:"number",bigint:"bigint",object:"date"},jL=fe("$ZodCheckLessThan",(t,e)=>{Js.init(t,e);const n=fv[typeof e.value];t._zod.check=r=>{(e.inclusive?r.value<=e.value:r.value<e.value)||r.issues.push({origin:fv[typeof r.value]??n,code:"too_big",maximum:typeof e.value=="object"?e.value.getTime():e.value,input:r.value,inclusive:e.inclusive,inst:t,continue:!e.abort})}}),zL=fe("$ZodCheckGreaterThan",(t,e)=>{Js.init(t,e);const n=fv[typeof e.value];t._zod.check=r=>{(e.inclusive?r.value>=e.value:r.value>e.value)||r.issues.push({origin:fv[typeof r.value]??n,code:"too_small",minimum:typeof e.value=="object"?e.value.getTime():e.value,input:r.value,inclusive:e.inclusive,inst:t,continue:!e.abort})}}),$B=fe("$ZodCheckMultipleOf",(t,e)=>{Js.init(t,e),t._zod.check=n=>{if(typeof n.value!=typeof e.value)throw new Error("Cannot mix number and bigint in multiple_of check.");(typeof n.value=="bigint"?e.value!==BigInt(0)&&n.value%e.value===BigInt(0):gZ(n.value,e.value)===0)||n.issues.push({origin:typeof n.value,code:"not_multiple_of",divisor:e.value,input:n.value,inst:t,continue:!e.abort})}}),FB=fe("$ZodCheckNumberFormat",(t,e)=>{var o;Js.init(t,e),e.format=e.format||"float64";const n=(o=e.format)==null?void 0:o.includes("int"),r=n?"int":"number",[s,i]=IL[e.format];t._zod.check=l=>{const u=l.value;if(n){if(!Number.isInteger(u)){l.issues.push({expected:r,format:e.format,code:"invalid_type",continue:!1,input:u,inst:t});return}if(!Number.isSafeInteger(u)){u>0?l.issues.push({input:u,code:"too_big",maximum:Number.MAX_SAFE_INTEGER,note:"Integers must be within the safe integer range.",inst:t,origin:r,inclusive:!0,continue:!e.abort}):l.issues.push({input:u,code:"too_small",minimum:Number.MIN_SAFE_INTEGER,note:"Integers must be within the safe integer range.",inst:t,origin:r,inclusive:!0,continue:!e.abort});return}}u<s&&l.issues.push({origin:"number",input:u,code:"too_small",minimum:s,inclusive:!0,inst:t,continue:!e.abort}),u>i&&l.issues.push({origin:"number",input:u,code:"too_big",maximum:i,inclusive:!0,inst:t,continue:!e.abort})}}),jB=fe("$ZodCheckMaxLength",(t,e)=>{var n;Js.init(t,e),(n=t._zod.def).when??(n.when=jS),t._zod.check=r=>{const s=r.value,i=s.length;if((typeof s=="string"&&i>e.maximum?OS(s):i)<=e.maximum)return;const l=MS(s);r.issues.push({origin:l,code:"too_big",maximum:e.maximum,inclusive:!0,input:s,inst:t,continue:!e.abort})}}),zB=fe("$ZodCheckMinLength",(t,e)=>{var n;Js.init(t,e),(n=t._zod.def).when??(n.when=jS),t._zod.check=r=>{const s=r.value,i=s.length;if((typeof s=="string"&&i>=e.minimum&&i<e.minimum*2?OS(s):i)>=e.minimum)return;const l=MS(s);r.issues.push({origin:l,code:"too_small",minimum:e.minimum,inclusive:!0,input:s,inst:t,continue:!e.abort})}}),VB=fe("$ZodCheckLengthEquals",(t,e)=>{var n;Js.init(t,e),(n=t._zod.def).when??(n.when=jS),t._zod.check=r=>{const s=r.value,i=s.length,o=typeof s=="string"&&i>=e.length&&i<=e.length*2?OS(s):i;if(o===e.length)return;const l=MS(s),u=o>e.length;r.issues.push({origin:l,...u?{code:"too_big",maximum:e.length}:{code:"too_small",minimum:e.length},inclusive:!0,exact:!0,input:r.value,inst:t,continue:!e.abort})}}),hy=fe("$ZodCheckStringFormat",(t,e)=>{var n,r;Js.init(t,e),e.pattern?(n=t._zod).check??(n.check=s=>{e.pattern.lastIndex=0,!e.pattern.test(s.value)&&s.issues.push({origin:"string",code:"invalid_format",format:e.format,input:s.value,...e.pattern?{pattern:e.pattern.toString()}:{},inst:t,continue:!e.abort})}):(r=t._zod).check??(r.check=()=>{})}),HB=fe("$ZodCheckRegex",(t,e)=>{hy.init(t,e),t._zod.check=n=>{e.pattern.lastIndex=0,!e.pattern.test(n.value)&&n.issues.push({origin:"string",code:"invalid_format",format:"regex",input:n.value,pattern:e.pattern.toString(),inst:t,continue:!e.abort})}}),UB=fe("$ZodCheckLowerCase",(t,e)=>{e.pattern??(e.pattern=NB),hy.init(t,e)}),ZB=fe("$ZodCheckUpperCase",(t,e)=>{e.pattern??(e.pattern=DB),hy.init(t,e)}),BB=fe("$ZodCheckIncludes",(t,e)=>{Js.init(t,e);const n=df(e.includes),r=new RegExp(typeof e.position=="number"?`^.{${e.position},}${n}`:n);e.pattern=r,t._zod.check=s=>{s.value.includes(e.includes,e.position)||s.issues.push({origin:"string",code:"invalid_format",format:"includes",includes:e.includes,input:s.value,inst:t,continue:!e.abort})}}),WB=fe("$ZodCheckStartsWith",(t,e)=>{Js.init(t,e);const n=new RegExp(`^${df(e.prefix)}.*`);e.pattern??(e.pattern=n),t._zod.check=r=>{r.value.startsWith(e.prefix)||r.issues.push({origin:"string",code:"invalid_format",format:"starts_with",prefix:e.prefix,input:r.value,inst:t,continue:!e.abort})}}),KB=fe("$ZodCheckEndsWith",(t,e)=>{Js.init(t,e);const n=new RegExp(`.*${df(e.suffix)}$`);e.pattern??(e.pattern=n),t._zod.check=r=>{r.value.endsWith(e.suffix)||r.issues.push({origin:"string",code:"invalid_format",format:"ends_with",suffix:e.suffix,input:r.value,inst:t,continue:!e.abort})}}),GB=fe("$ZodCheckOverwrite",(t,e)=>{Js.init(t,e),t._zod.check=n=>{n.value=e.tx(n.value)}});class qB{constructor(e=[],n={}){this.content=[],this.indent=0,this.args=e,this.closed=n}indented(e){this.indent+=1;try{e(this)}finally{this.indent-=1}}write(e){if(typeof e=="function"){e(this,{execution:"sync"}),e(this,{execution:"async"});return}const r=e.split(`
22
- `).filter(o=>o),s=Math.min(...r.map(o=>o.length-o.trimStart().length)),i=r.map(o=>o.slice(s)).map(o=>" ".repeat(this.indent*2)+o);for(const o of i)this.content.push(o)}compile(){const e=Function,n=(this==null?void 0:this.content)??[""];return new e(...Object.keys(this.closed),`return function (${this.args.join(", ")}) {
23
- ${n.join(`
24
- `)}
25
- };`)(...Object.values(this.closed))}}const YB={major:4,minor:6,patch:7},Wn=fe("$ZodType",(t,e)=>{var i;var n;t??(t={}),t._zod.def=e,t._zod.bag=t._zod.bag||{},t._zod.version=YB;const r=t._zod.def.checks,s=t._zod.traits.has("$ZodCheck")?[t,...r??[]]:r!=null&&r.length?[...r]:[];for(const o of s)for(const l of o._zod.onattach)l(t);if(s.length===0)(n=t._zod).deferred??(n.deferred=[]),(i=t._zod.deferred)==null||i.push(()=>{t._zod.run=t._zod.parse});else{const o=(u,d,f)=>{if(u.memo)return u;let h=Oa(u),m;for(const g of d){if(g._zod.def.when){if(AZ(u)||!g._zod.def.when(u))continue}else if(h)continue;const _=u.issues.length,y=g._zod.check(u);if(y instanceof Promise&&(f==null?void 0:f.async)===!1)throw new ou;if(m||y instanceof Promise)m=(m??Promise.resolve()).then(async()=>{await y,u.issues.length!==_&&(d2(u.issues,_,t),h||(h=Oa(u,_)))});else{if(u.issues.length===_)continue;d2(u.issues,_,t),h||(h=Oa(u,_))}}return m?m.then(()=>u):u},l=(u,d,f)=>{if(Oa(u))return u.aborted=!0,u;const h=o(d,s,f);if(h instanceof Promise){if(f.async===!1)throw new ou;return h.then(m=>t._zod.parse(m,f))}return t._zod.parse(h,f)};t._zod.run=(u,d)=>{if(d.skipChecks)return t._zod.parse(u,d);if(d.direction==="backward"){const h=t._zod.parse({value:u.value,issues:[]},{...d,skipChecks:!0});return h instanceof Promise?h.then(m=>l(m,u,d)):l(h,u,d)}const f=t._zod.parse(u,d);if(f instanceof Promise){if(d.async===!1)throw new ou;return f.then(h=>o(h,s,d))}return o(f,s,d)}}},{get"~standard"(){return ML(this,"~standard",HL(this))},set"~standard"(t){Gl(this,"~standard",t)}}),VL=(t,e)=>t.issues.length?{issues:t.issues.map(n=>Kl(n,e,Xo()))}:{value:t.value};async function XB(t,e){const n={async:!0};return VL(await t._zod.run({value:e,issues:[]},n),n)}function HL(t){return{validate:e=>{const n={async:!1};try{const r=t._zod.run({value:e,issues:[]},n);if(!(r instanceof Promise))return VL(r,n)}catch{}return XB(t,e)},vendor:"zod",version:1}}const zS=fe("$ZodString",(t,e)=>{Wn.init(t,e),t._zod.pattern=e.pattern??OB,t._zod.parse=(n,r)=>{if(e.coerce)try{n.value=String(n.value)}catch{}return typeof n.value=="string"||n.issues.push({expected:"string",code:"invalid_type",input:n.value,inst:t}),n}}),$n=fe("$ZodStringFormat",(t,e)=>{hy.init(t,e),zS.init(t,e)}),QB=fe("$ZodGUID",(t,e)=>{e.pattern??(e.pattern=gB),$n.init(t,e)}),JB=fe("$ZodUUID",(t,e)=>{if(e.version){const r={v1:1,v2:2,v3:3,v4:4,v5:5,v6:6,v7:7,v8:8}[e.version];if(r===void 0)throw new Error(`Invalid UUID version: "${e.version}"`);e.pattern??(e.pattern=cT(r))}else e.pattern??(e.pattern=cT());$n.init(t,e)}),eW=fe("$ZodEmail",(t,e)=>{e.pattern??(e.pattern=vB),$n.init(t,e)}),UL=1,hv=2;function ZL(t){try{return typeof URL<"u"&&typeof URL.canParse=="function"?URL.canParse(t):(new URL(t),!0)}catch{return!1}}function tW(t,e){return!("normalize"in e)&&!("hostname"in e)&&!("protocol"in e)?ZL(t)||hv:nW(t,e)}function nW(t,e){var n;if(!e.normalize&&((n=e.protocol)==null?void 0:n.source)===CB.source&&!/^https?:\/\//i.test(t))return UL;try{if(typeof URL<"u"){const r=URL;if(typeof r.parse=="function")return r.parse(t)??hv}return new URL(t)}catch{return hv}}const rW=/[\t\n\r]/g;function uT(t){return t.replace(rW,"")}function sW(t,e){return e.lastIndex=0,e.test(t.hostname)}function iW(t,e){return e.lastIndex=0,e.test(t.protocol.endsWith(":")?t.protocol.slice(0,-1):t.protocol)}const oW=fe("$ZodURL",(t,e)=>{$n.init(t,e),t._zod.check=n=>{try{const r=n.value.trim(),s=tW(r,e);if(s===UL){n.issues.push({code:"invalid_format",format:"url",note:"Invalid URL format",input:n.value,inst:t,continue:!e.abort});return}if(s===hv){n.issues.push({code:"invalid_format",format:"url",input:n.value,inst:t,continue:!e.abort});return}if(s===!0){n.value=uT(r);return}e.hostname&&!sW(s,e.hostname)&&n.issues.push({code:"invalid_format",format:"url",note:"Invalid hostname",pattern:e.hostname.source,input:n.value,inst:t,continue:!e.abort}),e.protocol&&!iW(s,e.protocol)&&n.issues.push({code:"invalid_format",format:"url",note:"Invalid protocol",pattern:e.protocol.source,input:n.value,inst:t,continue:!e.abort}),n.value=e.normalize?s.href:uT(r);return}catch{n.issues.push({code:"invalid_format",format:"url",input:n.value,inst:t,continue:!e.abort})}}}),aW=fe("$ZodEmoji",(t,e)=>{e.pattern??(e.pattern=_B()),$n.init(t,e)}),lW=fe("$ZodNanoID",(t,e)=>{if(e.length!==void 0&&(!Number.isInteger(e.length)||e.length<1))throw new Error(`Invalid nanoid length: ${e.length}`);e.pattern??(e.pattern=e.length===void 0?hB:pB(e.length)),$n.init(t,e)}),cW=fe("$ZodCUID",(t,e)=>{e.pattern??(e.pattern=lB),$n.init(t,e)}),uW=fe("$ZodCUID2",(t,e)=>{e.pattern??(e.pattern=cB),$n.init(t,e)}),dW=fe("$ZodULID",(t,e)=>{e.pattern??(e.pattern=uB),$n.init(t,e)}),fW=fe("$ZodXID",(t,e)=>{e.pattern??(e.pattern=dB),$n.init(t,e)}),hW=fe("$ZodKSUID",(t,e)=>{e.pattern??(e.pattern=fB),$n.init(t,e)}),pW=fe("$ZodISODateTime",(t,e)=>{e.pattern??(e.pattern=IB(e)),$n.init(t,e)}),mW=fe("$ZodISODate",(t,e)=>{e.pattern??(e.pattern=RB),$n.init(t,e)}),gW=fe("$ZodISOTime",(t,e)=>{e.pattern??(e.pattern=AB(e)),$n.init(t,e)}),vW=fe("$ZodISODuration",(t,e)=>{e.pattern??(e.pattern=mB),$n.init(t,e)}),yW=fe("$ZodIPv4",(t,e)=>{e.pattern??(e.pattern=wB),$n.init(t,e)}),_W=/^[0-9a-fA-F:.]+$/;function BL(t){return _W.test(t)?ZL(`http://[${t}]`):!1}const wW=fe("$ZodIPv6",(t,e)=>{e.pattern??(e.pattern=bB),$n.init(t,e),t._zod.check=n=>{BL(n.value)||n.issues.push({code:"invalid_format",format:"ipv6",input:n.value,inst:t,continue:!e.abort})}}),bW=fe("$ZodCIDRv4",(t,e)=>{e.pattern??(e.pattern=xB),$n.init(t,e)});function xW(t){const e=t.split("/");if(e.length!==2)return!1;const[n,r]=e;if(!r)return!1;const s=Number(r);return`${s}`!==r||s<0||s>128?!1:BL(n)}const SW=fe("$ZodCIDRv6",(t,e)=>{e.pattern??(e.pattern=SB),$n.init(t,e),t._zod.check=n=>{xW(n.value)||n.issues.push({code:"invalid_format",format:"cidrv6",input:n.value,inst:t,continue:!e.abort})}});function WL(t){if(t==="")return!0;if(/\s/.test(t)||t.length%4!==0)return!1;try{return atob(t),!0}catch{return!1}}const KL=/^[0-9a-zA-Z+/]*={0,2}$/,kW=fe("$ZodBase64",(t,e)=>{e.pattern??(e.pattern=KL),$n.init(t,e),t._zod.check=n=>{WL(n.value)||n.issues.push({code:"invalid_format",format:"base64",input:n.value,inst:t,continue:!e.abort})}}),VS=/^[A-Za-z0-9_-]*$/;function EW(t){if(!VS.test(t))return!1;const e=t.replace(/[-_]/g,r=>r==="-"?"+":"/"),n=e.padEnd(Math.ceil(e.length/4)*4,"=");return WL(n)}const CW=fe("$ZodBase64URL",(t,e)=>{e.pattern??(e.pattern=VS),$n.init(t,e),t._zod.check=n=>{EW(n.value)||n.issues.push({code:"invalid_format",format:"base64url",input:n.value,inst:t,continue:!e.abort})}}),PW=fe("$ZodE164",(t,e)=>{e.pattern??(e.pattern=PB),$n.init(t,e)});function TW(t,e=null){try{const n=t.split(".");if(n.length!==3)return!1;const[r]=n;if(!r)return!1;const s=JSON.parse(atob(r));return!("typ"in s&&(s==null?void 0:s.typ)!=="JWT"||!s.alg||e&&(!("alg"in s)||s.alg!==e))}catch{return!1}}const RW=fe("$ZodJWT",(t,e)=>{$n.init(t,e),t._zod.check=n=>{TW(n.value,e.alg)||n.issues.push({code:"invalid_format",format:"jwt",input:n.value,inst:t,continue:!e.abort})}}),GL=fe("$ZodNumber",(t,e)=>{Wn.init(t,e),t._zod.pattern=FS,t._zod.parse=(n,r)=>{if(e.coerce)try{n.value=Number(n.value)}catch{}const s=n.value;if(typeof s=="number"&&!Number.isNaN(s)&&Number.isFinite(s))return n;const i=typeof s=="number"?Number.isNaN(s)?"NaN":Number.isFinite(s)?void 0:String(s):void 0;return n.issues.push({expected:"number",code:"invalid_type",input:s,inst:t,...i?{received:i}:{}}),n}}),AW=fe("$ZodNumberFormat",(t,e)=>{FB.init(t,e),GL.init(t,e)}),IW=fe("$ZodBoolean",(t,e)=>{Wn.init(t,e),t._zod.pattern=LB,t._zod.parse=(n,r)=>{if(e.coerce)try{n.value=!!n.value}catch{}const s=n.value;return typeof s=="boolean"||n.issues.push({expected:"boolean",code:"invalid_type",input:s,inst:t}),n}}),OW=fe("$ZodUnknown",(t,e)=>{Wn.init(t,e),t._zod.parse=n=>n}),MW=fe("$ZodNever",(t,e)=>{Wn.init(t,e),t._zod.parse=(n,r)=>(n.issues.push({expected:"never",code:"invalid_type",input:n.value,inst:t}),n)});function LW(t,e){const n=iT(t._zod.def.checks);if(!n.length)return;const r=Math.min(...n.map(i=>i[0])),s=t._zod.parse;t._zod.parse=(i,o)=>{const l=e(i.value);if(l>r&&!(o!=null&&o.skipChecks)&&(o==null?void 0:o.direction)!=="backward"){for(const[u,d]of iT(t._zod.def.checks))if(l>u&&d._zod.def.when(i)){const f=i.issues.length;return d._zod.check(i),i.issues[f].continue=!1,d2(i.issues,f,t),i}}return s(i,o)}}const NW=t=>Array.isArray(t)?t.length:-1;function dT(t,e,n){t.issues.length&&e.issues.push(...Ed(n,t.issues)),e.value[n]=t.value}const DW=fe("$ZodArray",(t,e)=>{Wn.init(t,e);const n=mo.memoizer;n==null||n.attach(t),t._zod.parse=(r,s)=>{const i=r.value;if(!Array.isArray(i))return r.issues.push({expected:"array",code:"invalid_type",input:i,inst:t}),r;r.value=n?n.alloc(t,r,Array(i.length),s):Array(i.length);const o=[],l=s==null?void 0:s.abortEarly;for(let u=0;u<i.length;u++){const d=i[u],f=e.element._zod.run({value:d,issues:[]},s);if(f instanceof Promise)o.push(f.then(h=>dT(h,r,u)));else if(dT(f,r,u),l&&f.issues.length!==0&&Oa(f))break}return o.length?Promise.all(o).then(()=>r):r},LW(t,NW)});function pv(t,e,n,r,s,i){const o=n in r,l=i==="optional";if(!(!o&&l&&s==="optional")){if(t.issues.length){if(s!==void 0&&l&&!o)return;e.issues.push(...Ed(n,t.issues))}if(!o&&s===void 0){t.issues.length||e.issues.push({code:"invalid_type",expected:"nonoptional",input:void 0,path:[n]});return}t.value===void 0?(o||s==="defaulted"&&!l)&&(e.value[n]=void 0):e.value[n]=t.value}}const $W=[];function qL(t){var o,l,u,d;const e=Object.keys(t.shape),n=Object.getOwnPropertySymbols(t.shape),r=n.length?n:$W,s=r.length?[...e,...r]:e;for(const f of s)if(!((d=(u=(l=(o=t.shape)==null?void 0:o[f])==null?void 0:l._zod)==null?void 0:u.traits)!=null&&d.has("$ZodType")))throw new Error(`Invalid element at key "${String(f)}": expected a Zod schema`);const i=xZ(t.shape);return{...t,allKeys:s,symbolKeys:r,keySet:new Set(e),numKeys:e.length,optionalKeys:new Set(i)}}function YL(t,e,n,r,s,i,o){const l=[],u=s.keySet,d=s.catchall._zod,f=d.def.type,h=d.optin,m=d.optout;let g=0;for(const _ in e){if(o&&n.issues.length!==g){if(Oa(n,g))break;g=n.issues.length}if(u.has(_))continue;if(_==="__proto__"){f==="never"&&l.push(_);continue}if(f==="never"){l.push(_);continue}const y=d.run({value:e[_],issues:[]},r);y instanceof Promise?t.push(y.then(b=>pv(b,n,_,e,h,m))):pv(y,n,_,e,h,m)}return l.length&&n.issues.push({code:"unrecognized_keys",keys:l,input:e,inst:i,continue:!0}),t.length?Promise.all(t).then(()=>n):n}const FW=fe("$ZodObject",(t,e)=>{Wn.init(t,e);const n=Object.getOwnPropertyDescriptor(e,"shape"),r=n!=null&&n.get?n.get.raw:e.shape??{};if(r){const d=()=>{const f={...r};return Object.defineProperty(e,"shape",{value:f}),d.raw=f,f};d.raw=r,Object.defineProperty(e,"shape",{get:d})}const s=uy(()=>qL(e));nn(t,"propValues",d=>{const f=d.def.shape,h={};for(const m in f){const g=f[m]._zod;if(g.values){Object.prototype.hasOwnProperty.call(h,m)||Za(h,m,new Set);for(const _ of g.values)h[m].add(_);g.optin!==void 0&&h[m].add(void 0)}}return h});const i=Pp,o=e.catchall;let l;const u=mo.memoizer;u==null||u.attach(t),t._zod.parse=(d,f)=>{l??(l=s.value);const h=d.value;if(!i(h))return d.issues.push({expected:"object",code:"invalid_type",input:h,inst:t}),d;d.value=u?u.alloc(t,d,{},f):{};const m=[],g=l.shape,_=f==null?void 0:f.abortEarly;let y=d.issues.length;for(const b of l.allKeys){if(_&&d.issues.length!==y){if(Oa(d,y))break;y=d.issues.length}if(b==="__proto__")continue;const x=g[b],S=x._zod.optin,E=x._zod.optout,C=x._zod.run({value:h[b],issues:[]},f);C instanceof Promise?m.push(C.then(R=>pv(R,d,b,h,S,E))):pv(C,d,b,h,S,E)}return o?YL(m,h,d,f,s.value,t,_===!0):m.length?Promise.all(m).then(()=>d):d}}),jW=fe("$ZodObjectJIT",(t,e)=>{FW.init(t,e);const n=t._zod.parse,r=uy(()=>qL(e)),s=mo.memoizer,i=g=>{var R,O;const _=r.value,y=_.symbolKeys,b=new qB(["payload","ctx"],{shape:g,inst:t,memo:s,syms:y}),x=I=>`shape[${I}]._zod.run({ value: input[${I}], issues: [] }, ctx)`,S=(I,A)=>`
26
- let ${I}_ab = false;
27
- for (let i = 0; i < ${I}.issues.length; i++) {
28
- const iss = ${I}.issues[i];
29
- iss.path = iss.path ? [${A}, ...iss.path] : [${A}];
30
- payload.issues.push(iss);
31
- if (iss.continue !== true) ${I}_ab = true;
32
- }
33
- if (${I}_ab && ctx && ctx.abortEarly) {
34
- payload.value = newResult;
35
- return payload;
36
- }`;b.write("const input = payload.value;");const E=Object.create(null);let C=0;for(const I of _.allKeys)E[I]=`key_${C++}`;b.write(s?"const newResult = memo.alloc(inst, payload, {}, ctx);":"const newResult = {};");for(const I of _.allKeys){if(I==="__proto__")continue;const A=E[I],L=typeof I=="symbol"?`syms[${y.indexOf(I)}]`:yZ(I),N=`${L} in input`,H=g[I],$=(R=H==null?void 0:H._zod)==null?void 0:R.optin,W=$!==void 0,X=((O=H==null?void 0:H._zod)==null?void 0:O.optout)==="optional";if(b.write(`const ${A} = ${x(L)};`),W&&X){const z=$==="optional"?`${A}_present`:`${A}.value !== undefined || ${A}_present`;b.write(`
37
- const ${A}_present = ${N};
38
- if (!${A}.issues.length || ${A}_present) {
39
- if (${A}.issues.length) {${S(A,L)}
40
- }
41
-
42
- if (${z}) {
43
- newResult[${L}] = ${A}.value;
44
- }
45
- }
46
-
47
- `)}else W?(b.write(`
48
- if (${A}.issues.length) {${S(A,L)}
49
- }
50
- `),$==="defaulted"?b.write(`newResult[${L}] = ${A}.value;`):b.write(`
51
- if (${A}.value !== undefined || ${N}) {
52
- newResult[${L}] = ${A}.value;
53
- }
54
- `)):b.write(`
55
- const ${A}_present = ${N};
56
- if (${A}.issues.length) {${S(A,L)}
57
- }
58
- if (!${A}_present && !${A}.issues.length) {
59
- payload.issues.push({
60
- code: "invalid_type",
61
- expected: "nonoptional",
62
- input: undefined,
63
- path: [${L}]
64
- });
65
- if (ctx && ctx.abortEarly) {
66
- payload.value = newResult;
67
- return payload;
68
- }
69
- }
70
-
71
- if (${A}_present) {
72
- newResult[${L}] = ${A}.value;
73
- }
74
-
75
- `)}return b.write("payload.value = newResult;"),b.write("return payload;"),b.compile()};let o;const l=Pp,u=!mo.jitless,f=u&&wZ.value,h=e.catchall;let m;t._zod.parse=(g,_)=>{m??(m=r.value);const y=g.value;return l(y)?u&&f&&(_==null?void 0:_.async)===!1&&_.jitless!==!0?(o||(o=i(e.shape)),g=o(g,_),h?YL([],y,g,_,m,t,(_==null?void 0:_.abortEarly)===!0):g):n(g,_):(g.issues.push({expected:"object",code:"invalid_type",input:y,inst:t}),g)}});function fT(t,e,n,r){for(const i of t)if(i.issues.length===0)return e.value=i.value,e;const s=t.filter(i=>!Oa(i));return s.length===1?(e.value=s[0].value,s[0]):(e.issues.push({code:"invalid_union",input:e.value,inst:n,errors:t.map(i=>i.issues.map(o=>Kl(o,r,Xo())))}),e)}const XL=fe("$ZodUnion",(t,e)=>{Wn.init(t,e),nn(t,"optin",r=>r.def.options.some(s=>s._zod.optin==="defaulted")?"defaulted":r.def.options.some(s=>s._zod.optin!==void 0)?"optional":void 0),nn(t,"optout",r=>r.def.options.some(s=>s._zod.optout==="optional")?"optional":void 0),nn(t,"values",r=>{if(r.def.options.every(s=>s._zod.values))return new Set(r.def.options.flatMap(s=>Array.from(s._zod.values)))}),nn(t,"pattern",r=>{if(r.def.options.every(s=>s._zod.pattern)){const s=r.def.options.map(i=>i._zod.pattern);return new RegExp(`^(${s.map(i=>AS(i.source)).join("|")})$`)}});const n=e.options.length===1?e.options[0]._zod.run:null;t._zod.parse=(r,s)=>{if(n)return n(r,s);let i=!1;const o=[];for(const l of e.options){const u=l._zod.run({value:r.value,issues:[]},s);if(u instanceof Promise)o.push(u),i=!0;else{if(u.issues.length===0)return u;o.push(u)}}return i?Promise.all(o).then(l=>fT(l,r,t,s)):fT(o,r,t,s)}});function zW(t){var n;const e=new Map;for(const r of t.options){const s=(n=r._zod.propValues)==null?void 0:n[t.discriminator];if(!s||s.size===0)throw new Error(`Invalid discriminated union option at index "${t.options.indexOf(r)}"`);for(const i of s)if(e.has(i)){if(i!==void 0)throw new Error(`Duplicate discriminator value "${String(i)}"`);e.set(i,null)}else e.set(i,r)}return e}const VW=fe("$ZodDiscriminatedUnion",(t,e)=>{e.inclusive=!1,XL.init(t,e);const n=t._zod.parse;nn(t,"propValues",s=>{var l,u;const i={};let o=0;for(const d of s.def.options){const f=d._zod.propValues;if(!f||Object.keys(f).length===0)throw new Error(`Invalid discriminated union option at index "${s.def.options.indexOf(d)}"`);(l=f[s.def.discriminator])!=null&&l.has(void 0)&&o++;for(const[h,m]of Object.entries(f)){Object.prototype.hasOwnProperty.call(i,h)||Za(i,h,new Set);for(const g of m)i[h].add(g)}}return!s.def.unionFallback&&o>1&&((u=i[s.def.discriminator])==null||u.delete(void 0)),i}),e.options.forEach((s,i)=>{const o=IS(s._zod.def);if(o&&!Object.prototype.hasOwnProperty.call(o,e.discriminator))throw new Error(`Invalid discriminated union option at index "${i}"`)});const r=uy(()=>zW(e));t._zod.parse=(s,i)=>{const o=s.value;if(!Pp(o))return s.issues.push({code:"invalid_type",expected:"object",input:o,inst:t}),s;const l=o==null?void 0:o[e.discriminator],u=r.value.get(l);return u&&(l!==void 0||i.direction!=="backward")?u._zod.run(s,i):e.unionFallback||i.direction==="backward"?n(s,i):(s.issues.push({code:"invalid_union",errors:[],note:"No matching discriminator",discriminator:e.discriminator,options:Array.from(r.value.keys()).filter(d=>r.value.get(d)!==null),input:o,path:[e.discriminator],inst:t}),s)}}),HW=fe("$ZodIntersection",(t,e)=>{Wn.init(t,e),t._zod.parse=(n,r)=>{const s=n.value,i=e.left._zod.run({value:s,issues:[]},r),o=e.right._zod.run({value:s,issues:[]},r);return i instanceof Promise||o instanceof Promise?Promise.all([i,o]).then(([u,d])=>hT(n,u,d)):hT(n,i,o)}});function h2(t,e){if(t===e)return{valid:!0,data:t};if(t instanceof Date&&e instanceof Date&&+t==+e)return{valid:!0,data:t};if(uf(t)&&uf(e)){const n=Object.keys(e),r=Object.keys(t).filter(i=>n.indexOf(i)!==-1),s={...t,...e};Object.prototype.hasOwnProperty.call(s,"__proto__")&&delete s.__proto__;for(const i of r){if(i==="__proto__")continue;const o=h2(t[i],e[i]);if(!o.valid)return{valid:!1,mergeErrorPath:[i,...o.mergeErrorPath]};s[i]=o.data}return{valid:!0,data:s}}if(Array.isArray(t)&&Array.isArray(e)){if(t.length!==e.length)return{valid:!1,mergeErrorPath:[]};const n=[];for(let r=0;r<t.length;r++){const s=t[r],i=e[r],o=h2(s,i);if(!o.valid)return{valid:!1,mergeErrorPath:[r,...o.mergeErrorPath]};n.push(o.data)}return{valid:!0,data:n}}return{valid:!1,mergeErrorPath:[]}}function hT(t,e,n){const r=new Map;let s;const i=new Map,o=(d,f)=>{var m,g;let h;if(d.code==="unrecognized_keys"&&!((m=d.path)!=null&&m.length))s??(s=d),h=d.keys;else if(d.code==="invalid_key"&&d.origin==="record"&&((g=d.path)==null?void 0:g.length)===1){const _=String(d.path[0]);i.has(_)||i.set(_,d),h=[_]}else return!1;for(const _ of h)r.has(_)||r.set(_,{}),r.get(_)[f]=!0;return!0};for(const d of e.issues)o(d,"l")||t.issues.push(d);for(const d of n.issues)o(d,"r")||t.issues.push(d);const l=[...r].filter(([,d])=>d.l&&d.r).map(([d])=>d);if(l.length){const d=s?l.filter(f=>s.keys.includes(f)):[];d.length&&t.issues.push({...s,keys:d});for(const f of l)!d.includes(f)&&i.has(f)&&t.issues.push(i.get(f))}const u=h2(e.value,n.value);if(!u.valid){if(Oa(t))return t;throw new Error(`Unmergable intersection. Error path: ${JSON.stringify(u.mergeErrorPath)}`)}return t.value=u.data,t}const UW=fe("$ZodRecord",(t,e)=>{Wn.init(t,e);const n=mo.memoizer;n==null||n.attach(t),t._zod.parse=(r,s)=>{const i=r.value;if(!uf(i))return r.issues.push({expected:"record",code:"invalid_type",input:i,inst:t}),r;const o=[],l=e.keyType._zod.values;if(l&&!e.partial){r.value=n?n.alloc(t,r,{},s):{};const u=new Set;for(const f of l)if(typeof f=="string"||typeof f=="number"||typeof f=="symbol"){if(u.add(typeof f=="number"?f.toString():f),f==="__proto__")continue;const h=e.keyType._zod.run({value:f,issues:[]},s);if(h instanceof Promise)throw new Error("Async schemas not supported in object keys currently");if(h.issues.length){r.issues.push({code:"invalid_key",origin:"record",issues:h.issues.map(_=>Kl(_,s,Xo())),input:f,path:[f],inst:t});continue}const m=h.value;if(m==="__proto__")continue;const g=e.valueType._zod.run({value:i[f],issues:[]},s);g instanceof Promise?o.push(g.then(_=>{_.issues.length&&r.issues.push(...Ed(f,_.issues)),r.value[m]=_.value})):(g.issues.length&&r.issues.push(...Ed(f,g.issues)),r.value[m]=g.value)}let d;for(const f in i)if(!u.has(f))if(e.mode==="loose"){if(f==="__proto__")continue;r.value[f]=i[f]}else d=d??[],d.push(f);d&&d.length>0&&r.issues.push({code:"unrecognized_keys",input:i,inst:t,keys:d,continue:!0})}else{r.value=n?n.alloc(t,r,{},s):{};let u;for(const d of Reflect.ownKeys(i)){if(d==="__proto__"||!Object.prototype.propertyIsEnumerable.call(i,d))continue;let f=e.keyType._zod.run({value:d,issues:[]},s);if(f instanceof Promise)throw new Error("Async schemas not supported in object keys currently");if(typeof d=="string"&&FS.test(d)&&f.issues.length){const _=e.keyType._zod.run({value:Number(d),issues:[]},s);if(_ instanceof Promise)throw new Error("Async schemas not supported in object keys currently");_.issues.length===0&&(f=_)}if(f.issues.length){e.mode==="loose"?r.value[d]=i[d]:l?(u=u??[],u.push(d)):r.issues.push({code:"invalid_key",origin:"record",issues:f.issues.map(_=>Kl(_,s,Xo())),input:d,path:[d],inst:t});continue}const m=f.value;if(m==="__proto__")continue;const g=e.valueType._zod.run({value:i[d],issues:[]},s);g instanceof Promise?o.push(g.then(_=>{_.issues.length&&r.issues.push(...Ed(d,_.issues)),r.value[m]=_.value})):(g.issues.length&&r.issues.push(...Ed(d,g.issues)),r.value[m]=g.value)}u&&u.length>0&&r.issues.push({code:"unrecognized_keys",input:i,inst:t,keys:u,continue:!0})}return o.length?Promise.all(o).then(()=>r):r}}),ZW=fe("$ZodEnum",(t,e)=>{Wn.init(t,e);const n=c2(e.entries),r=new Set(n);t._zod.values=r,nn(t,"pattern",s=>{const i=c2(s.def.entries).filter(o=>bZ.has(typeof o));return new RegExp(i.length?`^(${i.map(o=>df(o.toString())).join("|")})$`:"^[^\\s\\S]$")}),t._zod.parse=(s,i)=>{const o=s.value;return r.has(o)||s.issues.push({code:"invalid_value",values:n,input:o,inst:t}),s}}),BW=fe("$ZodLiteral",(t,e)=>{Wn.init(t,e);const n=new Set(e.values);t._zod.values=n,nn(t,"pattern",r=>{const s=r.def.values;return new RegExp(s.length?`^(${s.map(i=>typeof i=="string"?df(i):i?df(i.toString()):String(i)).join("|")})$`:"^[^\\s\\S]$")}),t._zod.parse=(r,s)=>{const i=r.value;return n.has(i)||r.issues.push({code:"invalid_value",values:e.values,input:i,inst:t}),r}}),WW=fe("$ZodTransform",(t,e)=>{var n;Wn.init(t,e),t._zod.optin="optional",(n=mo.memoizer)==null||n.guard(t),t._zod.parse=(r,s)=>{if(s.direction==="backward")throw new DL(t.constructor.name);const i=e.transform(r.value,r);if(s.async)return(i instanceof Promise?i:Promise.resolve(i)).then(l=>(r.value=l,r));if(i instanceof Promise)throw new ou;return r.value=i,r}});function pT(t,e){return t.value=e.issues.length?void 0:e.value,t}const QL=fe("$ZodOptional",(t,e)=>{Wn.init(t,e),nn(t,"optin",n=>n.def.innerType._zod.optin==="defaulted"?"defaulted":"optional"),t._zod.optout="optional",nn(t,"values",n=>{const r=n.def.innerType._zod.values;return r?new Set([...r,void 0]):void 0}),nn(t,"pattern",n=>{const r=n.def.innerType._zod.pattern;return r?new RegExp(`^(${AS(r.source)})?$`):void 0}),t._zod.parse=(n,r)=>{if(n.value===void 0){if(e.innerType._zod.optin!=="defaulted")return n;const s=e.innerType._zod.run({value:n.value,issues:[]},r);return s instanceof Promise?s.then(i=>pT(n,i)):pT(n,s)}return e.innerType._zod.run(n,r)}}),KW=fe("$ZodExactOptional",(t,e)=>{QL.init(t,e),nn(t,"values",n=>n.def.innerType._zod.values),nn(t,"pattern",n=>n.def.innerType._zod.pattern),t._zod.parse=(n,r)=>e.innerType._zod.run(n,r)}),GW=fe("$ZodNullable",(t,e)=>{Wn.init(t,e),nn(t,"optin",n=>n.def.innerType._zod.optin),nn(t,"optout",n=>n.def.innerType._zod.optout),nn(t,"pattern",n=>{const r=n.def.innerType._zod.pattern;return r?new RegExp(`^(${AS(r.source)}|null)$`):void 0}),nn(t,"values",n=>n.def.innerType._zod.values?new Set([...n.def.innerType._zod.values,null]):void 0),t._zod.parse=(n,r)=>n.value===null?n:e.innerType._zod.run(n,r)}),qW=fe("$ZodDefault",(t,e)=>{Wn.init(t,e),t._zod.optin="defaulted",nn(t,"values",n=>n.def.innerType._zod.values),t._zod.parse=(n,r)=>{if(r.direction==="backward")return e.innerType._zod.run(n,r);if(n.value===void 0)return n.value=e.defaultValue,n;const s=e.innerType._zod.run(n,r);return s instanceof Promise?s.then(i=>mT(i,e)):mT(s,e)}});function mT(t,e){return t.value===void 0&&(t.value=e.defaultValue),t}const YW=fe("$ZodPrefault",(t,e)=>{Wn.init(t,e),t._zod.optin="defaulted",nn(t,"values",n=>n.def.innerType._zod.values),t._zod.parse=(n,r)=>(r.direction==="backward"||n.value===void 0&&(n.value=e.defaultValue),e.innerType._zod.run(n,r))}),XW=fe("$ZodNonOptional",(t,e)=>{Wn.init(t,e),nn(t,"values",n=>{const r=n.def.innerType._zod.values;return r?new Set([...r].filter(s=>s!==void 0)):void 0}),t._zod.parse=(n,r)=>{const s=e.innerType._zod.run(n,r);return s instanceof Promise?s.then(i=>gT(i,t)):gT(s,t)}});function gT(t,e){return!t.issues.length&&t.value===void 0&&t.issues.push({code:"invalid_type",expected:"nonoptional",input:t.value,inst:e}),t}function vT(t,e,n,r){return e.issues.length?(t.value=n.catchValue({...e,value:t.value,error:{issues:e.issues.map(s=>Kl(s,r,Xo()))},input:t.value}),t):(t.value=e.value,e.memo&&(t.memo=!0),t)}const QW=fe("$ZodCatch",(t,e)=>{Wn.init(t,e),nn(t,"optin",n=>n.def.innerType._zod.optin==="defaulted"?"defaulted":"optional"),nn(t,"optout",n=>n.def.innerType._zod.optout),nn(t,"values",n=>n.def.innerType._zod.values),t._zod.parse=(n,r)=>{if(r.direction==="backward")return e.innerType._zod.run(n,r);const s=e.innerType._zod.run({value:n.value,issues:[]},r);return s instanceof Promise?s.then(i=>vT(n,i,e,r)):vT(n,s,e,r)}}),JW=fe("$ZodPipe",(t,e)=>{Wn.init(t,e),nn(t,"values",n=>n.def.in._zod.values),nn(t,"optin",n=>n.def.in._zod.optin),nn(t,"optout",n=>n.def.out._zod.optout),nn(t,"propValues",n=>n.def.in._zod.propValues),t._zod.parse=(n,r)=>{if(r.direction==="backward"){const i=e.out._zod.run(n,r);return i instanceof Promise?i.then(o=>z0(o,e.in,r)):z0(i,e.in,r)}const s=e.in._zod.run(n,r);return s instanceof Promise?s.then(i=>z0(i,e.out,r)):z0(s,e.out,r)}});function z0(t,e,n){return t.issues.some(r=>r.code!=="unrecognized_keys")?(t.aborted=!0,t):e._zod.run({value:t.value,issues:t.issues},n)}const eK=fe("$ZodReadonly",(t,e)=>{Wn.init(t,e),nn(t,"propValues",n=>n.def.innerType._zod.propValues),nn(t,"values",n=>n.def.innerType._zod.values),nn(t,"optin",n=>{var r,s;return(s=(r=n.def.innerType)==null?void 0:r._zod)==null?void 0:s.optin}),nn(t,"optout",n=>{var r,s;return(s=(r=n.def.innerType)==null?void 0:r._zod)==null?void 0:s.optout}),t._zod.parse=(n,r)=>{if(r.direction==="backward")return e.innerType._zod.run(n,r);const s=e.innerType._zod.run(n,r);return s instanceof Promise?s.then(yT):yT(s)}});function yT(t){return t.memo||(t.value=Object.freeze(t.value)),t}const tK=fe("$ZodCustom",(t,e)=>{Js.init(t,e),Wn.init(t,e),t._zod.parse=(n,r)=>n,t._zod.check=n=>{const r=n.value,s=e.fn(r);if(s instanceof Promise)return s.then(i=>_T(i,n,r,t));_T(s,n,r,t)}});function _T(t,e,n,r){if(!t){const s={code:"custom",input:n,inst:r,path:[...r._zod.def.path??[]],continue:!r._zod.def.abort};r._zod.def.params&&(s.params=r._zod.def.params),e.issues.push(Tp(s))}}class nK extends Error{constructor(){super("Cannot parse a reference cycle that closes through a transform"),this.name="ZodCyclicError"}}const p2="~memo",wT=[];function JL(t){return t!==null&&typeof t=="object"}function _w(t){return t.map(e=>e.path?{...e,path:e.path.slice()}:{...e})}const e5=new WeakMap,Hh=0,xg=1,cp=2;function Sg(t,e,n){const r=e5.get(t);if(r!==void 0)return r?cp:Hh;if(e.has(t))return cp;e.add(t);let s=Hh;const i=f=>{if(s!==cp&&(f!=null&&f._zod)){const h=Sg(f,e);h>s&&(s=h)}},o=(f,h)=>{var g;let m=Hh;for(const _ of Reflect.ownKeys(f)){const y=Object.getOwnPropertyDescriptor(f,_);if(!y.enumerable)continue;const b=y.get?xg:(g=y.value)!=null&&g._zod?Sg(y.value,e):Hh;b>m&&(m=b)}return m},l=f=>{f>s&&(s=f)},u=t._zod.def;switch(u.type){case"object":{const f=IS(u);l(f?o(f):xg),i(u.catchall);break}case"array":i(u.element);break;case"tuple":for(const f of u.items)i(f);i(u.rest);break;case"record":case"map":i(u.keyType),i(u.valueType);break;case"set":i(u.valueType);break;case"union":for(const f of u.options)i(f);break;case"intersection":i(u.left),i(u.right);break;case"optional":case"nullable":case"default":case"prefault":case"catch":case"readonly":case"nonoptional":case"promise":case"success":i(u.innerType);break;case"pipe":i(u.in),i(u.out);break;case"function":i(u.input),i(u.output);break;case"lazy":{const f=u._cachedInner??void 0;l(f?Sg(f,e):xg);break}case"template_literal":case"string":case"number":case"int":case"boolean":case"bigint":case"symbol":case"undefined":case"null":case"void":case"never":case"any":case"unknown":case"date":case"nan":case"enum":case"literal":case"file":case"transform":case"custom":break;default:for(const f in u){const h=Object.getOwnPropertyDescriptor(u,f);if(!h||h.get)continue;const m=h.value;if(!(!m||typeof m!="object")){if(m._zod)i(m);else if(Array.isArray(m))for(const g of m)i(g)}}}return e.delete(t),rK(t,s)}function rK(t,e){return e!==xg&&e5.set(t,e===cp),e}function sK(t,e){let n=t.buckets.get(e);return n||(n=new WeakMap,t.buckets.set(e,n)),n}let V0;const H0=[],iK={alloc(t,e,n){const r=V0;if(!r)return n;V0=void 0;const s={value:n,issues:null};return r.set(e.value,s),H0.push(s),n},guard(t){var e;(e=t._zod).deferred??(e.deferred=[]),t._zod.deferred.push(()=>{const n=t._zod.parse,r=(s,i)=>{if(i.direction!=="backward"&&aK(i,s.value))throw new nK;return n(s,i)};t._zod.parse=r,t._zod.run===n&&(t._zod.run=r)})},attach(t){var e;let n,r=!1,s,i;(e=t._zod).deferred??(e.deferred=[]),t._zod.deferred.push(()=>{const o=t._zod.parse,l=(u,d)=>{if(n===void 0){const x=Sg(t,new Set);if(x===Hh)return t._zod.parse=o,t._zod.run===l&&(t._zod.run=o),o(u,d);x===cp||r?n=!0:r=!0}const f=u.value;if(!JL(f))return o(u,d);let h=d[p2];h||(h={buckets:new WeakMap,backEdges:void 0},d[p2]=h);let m;s===d?m=i:(m=sK(h,t),s=d,i=m);const g=m.get(f);if(g)return u.value=g.value,g.issues?g.issues.length&&u.issues.push(..._w(g.issues)):(u.memo=!0,h.backEdges??(h.backEdges=new WeakSet),h.backEdges.add(g.value)),u;V0=m;const _=H0.length,y=o(u,d);V0=void 0;const b=H0.length>_?H0.pop():void 0;return y instanceof Promise?y.then(x=>(b&&(b.issues=x.issues.length?_w(x.issues):wT),x)):(b&&(b.issues=y.issues.length?_w(y.issues):wT),y)};t._zod.parse=l,t._zod.run===o&&(t._zod.run=l)})}};function oK(){return iK}function aK(t,e){var r;const n=(r=t[p2])==null?void 0:r.backEdges;return n!==void 0&&JL(e)&&n.has(e)}const lK=()=>{const t={string:{unit:"characters",verb:"to have"},file:{unit:"bytes",verb:"to have"},array:{unit:"items",verb:"to have"},set:{unit:"items",verb:"to have"},map:{unit:"entries",verb:"to have"}};function e(i){return t[i]??null}const n={regex:"input",email:"email address",url:"URL",emoji:"emoji",uuid:"UUID",uuidv4:"UUIDv4",uuidv6:"UUIDv6",nanoid:"nanoid",guid:"GUID",cuid:"cuid",cuid2:"cuid2",ulid:"ULID",xid:"XID",ksuid:"KSUID",datetime:"ISO datetime",date:"ISO date",time:"ISO time",duration:"ISO duration",ipv4:"IPv4 address",ipv6:"IPv6 address",mac:"MAC address",cidrv4:"IPv4 range",cidrv6:"IPv6 range",base64:"base64-encoded string",base64url:"base64url-encoded string",json_string:"JSON string",e164:"E.164 number",currency_code:"currency code",credit_card:"credit card number",iban:"IBAN",jwt:"JWT",template_literal:"input"},r={nan:"NaN"};function s(i,o){return i==="number"&&typeof o=="number"&&!Number.isFinite(o)?String(o):r[i]??i}return i=>{switch(i.code){case"invalid_type":{const o=s(i.expected),l=OZ(i.input),u=s(l,i.input);return`Invalid input: expected ${o}, received ${u}`}case"invalid_value":return i.values.length===1?`Invalid input: expected ${AL(i.values[0])}`:`Invalid option: expected one of ${rT(i.values,"|")}`;case"too_big":{const o=i.exact?"exactly ":i.inclusive?"<=":"<",l=e(i.origin);return l?`Too big: expected ${i.origin??"value"} to have ${o}${i.maximum.toString()} ${l.unit??"elements"}`:`Too big: expected ${i.origin??"value"} to be ${o}${i.maximum.toString()}`}case"too_small":{const o=i.exact?"exactly ":i.inclusive?">=":">",l=e(i.origin);return l?`Too small: expected ${i.origin} to have ${o}${i.minimum.toString()} ${l.unit}`:`Too small: expected ${i.origin} to be ${o}${i.minimum.toString()}`}case"invalid_format":{const o=i;return o.format==="starts_with"?`Invalid string: must start with "${o.prefix}"`:o.format==="ends_with"?`Invalid string: must end with "${o.suffix}"`:o.format==="includes"?`Invalid string: must include "${o.includes}"`:o.format==="regex"?`Invalid string: must match pattern ${o.pattern}`:`Invalid ${n[o.format]??i.format}`}case"not_multiple_of":return`Invalid number: must be a multiple of ${i.divisor}`;case"unrecognized_keys":return`Unrecognized key${i.keys.length>1?"s":""}: ${rT(i.keys,", ")}`;case"invalid_key":return`Invalid key in ${i.origin}`;case"invalid_union":return i.options&&Array.isArray(i.options)&&i.options.length>0?`Invalid discriminator value. Expected ${i.options.map(l=>`'${l}'`).join(" | ")}`:i.inclusive===!1?"Invalid input: more than one option matched":"Invalid input";case"invalid_element":return`Invalid value in ${i.origin}`;default:return"Invalid input"}}};function cK(){return{localeError:lK()}}var bT;class uK{constructor(){this._map=new WeakMap,this._idmap=new Map}add(e,...n){const r=n[0];return this._map.set(e,r),r&&typeof r=="object"&&"id"in r&&this._idmap.set(r.id,e),this}clear(){return this._map=new WeakMap,this._idmap=new Map,this}remove(e){const n=this._map.get(e);return n&&typeof n=="object"&&"id"in n&&this._idmap.delete(n.id),this._map.delete(e),this}get(e){const n=e._zod.parent;if(n){const r={...this.get(n)??{}};delete r.id;const s={...r,...this._map.get(e)};return Object.keys(s).length?s:void 0}return this._map.get(e)}has(e){return this._map.has(e)}}function dK(){return new uK}(bT=globalThis).__zod_globalRegistry??(bT.__zod_globalRegistry=dK());const Uh=globalThis.__zod_globalRegistry;function t5(t){return t.checks&&(t.checks=[...t.checks]),t}function fK(t,e){return new t(t5({type:"string",...nt(e)}))}function hK(t,e){return new t({type:"string",format:"email",check:"string_format",abort:!1,...nt(e)})}function pK(t,e){return new t({type:"string",format:"guid",check:"string_format",abort:!1,...nt(e)})}function mK(t,e){return new t({type:"string",format:"uuid",check:"string_format",abort:!1,...nt(e)})}function gK(t,e){return new t({type:"string",format:"uuid",check:"string_format",abort:!1,version:"v4",...nt(e)})}function vK(t,e){return new t({type:"string",format:"uuid",check:"string_format",abort:!1,version:"v6",...nt(e)})}function yK(t,e){return new t({type:"string",format:"uuid",check:"string_format",abort:!1,version:"v7",...nt(e)})}function _K(t,e){return new t({type:"string",format:"url",check:"string_format",abort:!1,...nt(e)})}function wK(t,e){return new t({type:"string",format:"emoji",check:"string_format",abort:!1,...nt(e)})}function bK(t,e){return new t({type:"string",format:"nanoid",check:"string_format",abort:!1,...nt(e)})}function xK(t,e){return new t({type:"string",format:"cuid",check:"string_format",abort:!1,...nt(e)})}function SK(t,e){return new t({type:"string",format:"cuid2",check:"string_format",abort:!1,...nt(e)})}function kK(t,e){return new t({type:"string",format:"ulid",check:"string_format",abort:!1,...nt(e)})}function EK(t,e){return new t({type:"string",format:"xid",check:"string_format",abort:!1,...nt(e)})}function CK(t,e){return new t({type:"string",format:"ksuid",check:"string_format",abort:!1,...nt(e)})}function PK(t,e){return new t({type:"string",format:"ipv4",check:"string_format",abort:!1,...nt(e)})}function TK(t,e){return new t({type:"string",format:"ipv6",check:"string_format",abort:!1,...nt(e)})}function RK(t,e){return new t({type:"string",format:"cidrv4",check:"string_format",abort:!1,...nt(e)})}function AK(t,e){return new t({type:"string",format:"cidrv6",check:"string_format",abort:!1,...nt(e)})}function IK(t,e){return new t({type:"string",format:"base64",check:"string_format",abort:!1,...nt(e)})}function OK(t,e){return new t({type:"string",format:"base64url",check:"string_format",abort:!1,...nt(e)})}function MK(t,e){return new t({type:"string",format:"e164",check:"string_format",abort:!1,...nt(e)})}function LK(t,e){return new t({type:"string",format:"jwt",check:"string_format",abort:!1,...nt(e)})}function NK(t,e){return new t({type:"string",format:"datetime",check:"string_format",offset:!1,local:!1,precision:null,...nt(e)})}function DK(t,e){return new t({type:"string",format:"date",check:"string_format",...nt(e)})}function $K(t,e){return new t({type:"string",format:"time",check:"string_format",precision:null,...nt(e)})}function FK(t,e){return new t({type:"string",format:"duration",check:"string_format",...nt(e)})}function jK(t,e){return new t(t5({type:"number",checks:[],...nt(e)}))}function zK(t,e){return new t({type:"number",check:"number_format",abort:!1,format:"safeint",...nt(e)})}function VK(t,e){return new t({type:"boolean",...nt(e)})}function HK(t){return new t({type:"unknown"})}function UK(t,e){return new t({type:"never",...nt(e)})}function xT(t,e){return new jL({check:"less_than",...nt(e),value:t,inclusive:!1})}function ww(t,e){return new jL({check:"less_than",...nt(e),value:t,inclusive:!0})}function ST(t,e){return new zL({check:"greater_than",...nt(e),value:t,inclusive:!1})}function bw(t,e){return new zL({check:"greater_than",...nt(e),value:t,inclusive:!0})}function kT(t,e){return new $B({check:"multiple_of",...nt(e),value:t})}function n5(t,e){return new jB({check:"max_length",...nt(e),maximum:t})}function mv(t,e){return new zB({check:"min_length",...nt(e),minimum:t})}function r5(t,e){return new VB({check:"length_equals",...nt(e),length:t})}function ZK(t,e){return new HB({check:"string_format",format:"regex",...nt(e),pattern:t})}function BK(t){return new UB({check:"string_format",format:"lowercase",...nt(t)})}function WK(t){return new ZB({check:"string_format",format:"uppercase",...nt(t)})}function KK(t,e){return new BB({check:"string_format",format:"includes",...nt(e),includes:t})}function GK(t,e){return new WB({check:"string_format",format:"starts_with",...nt(e),prefix:t})}function qK(t,e){return new KB({check:"string_format",format:"ends_with",...nt(e),suffix:t})}function Lf(t){return new GB({check:"overwrite",tx:t})}function YK(t){return Lf(e=>e.normalize(t))}function XK(){return Lf(t=>t.trim())}function QK(){return Lf(t=>t.toLowerCase())}function JK(){return Lf(t=>t.toUpperCase())}function eG(){return Lf(t=>_Z(t))}function tG(t,e,n){return new t({type:"array",element:e,...nt(n)})}function nG(t,e,n){return new t({type:"custom",check:"custom",fn:e,...nt(n)})}function rG(t,e){const n=sG(r=>(r.addIssue=s=>{if(typeof s=="string")r.issues.push(Tp(s,r.value,n._zod.def));else{const i=s;i.fatal&&(i.continue=!1),i.code??(i.code="custom"),"input"in i||(i.input=r.value),i.inst??(i.inst=n),i.continue??(i.continue=!n._zod.def.abort),r.issues.push(Tp(i))}},t(r.value,r)),e);return n}function sG(t,e){const n=new Js({check:"custom",...nt(e)});return n._zod.check=t,n}function up(t,...e){for(const n of e)for(const r of Reflect.ownKeys(n))Object.prototype.propertyIsEnumerable.call(n,r)&&Za(t,r,n[r]);return t}function s5(t){let e=(t==null?void 0:t.target)??"draft-2020-12";return e==="draft-4"&&(e="draft-04"),e==="draft-7"&&(e="draft-07"),{processors:t.processors??{},metadataRegistry:(t==null?void 0:t.metadata)??Uh,target:e,unrepresentable:(t==null?void 0:t.unrepresentable)??"throw",override:(t==null?void 0:t.override)??(()=>{}),io:(t==null?void 0:t.io)??"output",counter:0,seen:new Map,sharedDefsExtractedFor:void 0,sharedEmitDoneFor:void 0,cycles:(t==null?void 0:t.cycles)??"ref",reused:(t==null?void 0:t.reused)??"inline",intersections:[],deferred:[],external:(t==null?void 0:t.external)??void 0}}function ql(t,e,n,r,s){const i=typeof e.unrepresentable=="function"?e.unrepresentable({zodSchema:t,path:r.path,message:s}):e.unrepresentable;if(i==="any")return!1;if(i===void 0||i==="throw")throw new Error(s);return Object.assign(n,i),!0}function mr(t,e,n={path:[],schemaPath:[]}){var f,h;var r;const s=t._zod.def,i=e.seen.get(t);if(i)return i.count++,n.schemaPath.includes(t)&&(i.cycle=n.path),i.schema;const o={schema:{},count:1,cycle:void 0,path:n.path};e.seen.set(t,o),e.sharedDefsExtractedFor=void 0,e.sharedEmitDoneFor=void 0;const l=(h=(f=t._zod).toJSONSchema)==null?void 0:h.call(f);if(l)o.schema=l;else{const m={...n,schemaPath:[...n.schemaPath,t],path:n.path};if(t._zod.processJSONSchema)t._zod.processJSONSchema(e,o.schema,m);else{const _=o.schema,y=e.processors[s.type];if(!y)throw new Error(`[toJSONSchema]: Non-representable type encountered: ${s.type}`);y(t,e,_,m)}const g=t._zod.parent;g&&(o.ref||(o.ref=g),mr(g,e,m),e.seen.get(g).isParent=!0)}const u=e.metadataRegistry.get(t);return u&&up(o.schema,u),e.io==="input"&&ws(t)&&(delete o.schema.examples,delete o.schema.default),e.io==="input"&&"_prefault"in o.schema&&((r=o.schema).default??(r.default=o.schema._prefault)),delete o.schema._prefault,e.seen.get(t).schema}function ET(t){return t.replace(/~/g,"~0").replace(/\//g,"~1")}function i5(t,e){var o,l,u,d;const n=t.seen.get(e);if(!n)throw new Error("Unprocessed schema. This is a bug in Zod.");if(t.external&&t.sharedDefsExtractedFor===t.external)return;const r=new Map;for(const f of t.seen.entries()){const h=(o=t.metadataRegistry.get(f[0]))==null?void 0:o.id;if(h){const m=r.get(h);if(m&&m!==f[0])throw new Error(`Duplicate schema id "${h}" detected during JSON Schema conversion. Two different schemas cannot share the same id when converted together.`);r.set(h,f[0])}}const s=f=>{var y;const h=t.target==="draft-2020-12"?"$defs":"definitions";if(t.external){const b=(y=t.external.registry.get(f[0]))==null?void 0:y.id,x=t.external.uri??(E=>E);if(b)return{ref:x(b)};const S=f[1].defId??f[1].schema.id??`schema${t.counter++}`;return f[1].defId=S,{defId:S,ref:`${x("__shared")}#/${h}/${ET(S)}`}}const m="#",g=`${m}/${h}/`;if(f[1]===n&&!f[1].schema.id)return{ref:m};const _=f[1].schema.id??`__schema${t.counter++}`;return{defId:_,ref:g+ET(_)}},i=f=>{if(f[1].schema.$ref)return;const h=f[1],{ref:m,defId:g}=s(f);h.def={...h.schema},g&&(h.defId=g);const _=h.schema;for(const y in _)delete _[y];_.$ref=m};if(t.cycles==="throw")for(const f of t.seen.entries()){const h=f[1];if(h.cycle)throw new Error(`Cycle detected: #/${(l=h.cycle)==null?void 0:l.join("/")}/<root>
76
-
77
- Set the \`cycles\` parameter to \`"ref"\` to resolve cyclical schemas with defs.`)}for(const f of t.seen.entries()){const h=f[1];if(e===f[0]){i(f);continue}if(t.external){const g=(u=t.external.registry.get(f[0]))==null?void 0:u.id;if(e!==f[0]&&g){i(f);continue}}if((d=t.metadataRegistry.get(f[0]))==null?void 0:d.id){i(f);continue}if(h.cycle){i(f);continue}h.count>1&&t.reused==="ref"&&i(f)}t.external&&(t.sharedDefsExtractedFor=t.external)}function o5(t){const e=t.anyOf;if(!Array.isArray(e)||e.length===0||t.type!==void 0)return;const n=[];for(const r of e){if(!r||typeof r!="object")return;o5(r);const s=Object.keys(r);if(s.length!==1||s[0]!=="type")return;const i=r.type;for(const o of Array.isArray(i)?i:[i]){if(typeof o!="string")return;n.includes(o)||n.push(o)}}delete t.anyOf,t.type=n.length===1?n[0]:n}const a5=new Set(["type","properties","required","additionalProperties"]),CT=["oneOf","anyOf"];function PT(t){const e=t.additionalProperties;return e===void 0||e===!1||typeof e!="object"||e===null?null:Object.keys(e).length?e:null}function m2(t){var i;const e=[];for(const o of t){if(typeof o!="object"||o.type!=="object")return null;for(const l in o)if(!a5.has(l))return null;e.push(o)}const n={},r=new Set;for(const o of e){for(const l in o.properties){if(Object.prototype.hasOwnProperty.call(n,l))continue;const u=[];for(const f of e){const h=((i=f.properties)==null?void 0:i[l])??PT(f);h!=null&&(u.some(m=>JSON.stringify(m)===JSON.stringify(h))||u.push(h))}const d=u.length===1?u[0]:m2(u)??{allOf:u};Za(n,l,d)}for(const l of o.required??[])r.add(l)}const s={type:"object",properties:n};if(r.size&&(s.required=[...r]),e.every(o=>o.additionalProperties===!1))s.additionalProperties=!1;else{const o=[];for(const l of e){const u=PT(l);u&&!o.some(d=>JSON.stringify(d)===JSON.stringify(u))&&o.push(u)}o.length===1?s.additionalProperties=o[0]:o.length>1&&(s.additionalProperties={allOf:o})}return s}function iG(t){const e=t.allOf;if(!Array.isArray(e)||e.length<2)return;for(const s of a5)if(s in t)return;const n=e.filter(s=>CT.some(i=>Array.isArray(s[i])));let r=null;if(!n.length)r=m2(e);else{const s=n[0],i=CT.find(u=>Array.isArray(s[u]));if(Object.keys(s).length!==1)return;const o=e.filter(u=>u!==s),l=s[i].map(u=>m2([...o,u]));if(l.some(u=>!u))return;r={[i]:l}}r&&(delete t.allOf,up(t,r))}function l5(t,e){var l,u,d,f;const n=t.seen.get(e);if(!n)throw new Error("Unprocessed schema. This is a bug in Zod.");const r=h=>{const m=t.seen.get(h);if(m.ref===null)return;const g=m.def??m.schema,_={...g},y=m.ref;if(m.ref=null,y){r(y);const x=t.seen.get(y),S=x.schema;if(S.$ref&&(t.target==="draft-07"||t.target==="draft-04"||t.target==="openapi-3.0")?(g.allOf=g.allOf??[],g.allOf.push(S)):up(g,S),up(g,_),h._zod.parent===y)for(const C in g)C==="$ref"||C==="allOf"||C in _||delete g[C];if(S.$ref&&x.def)for(const C in g)C==="$ref"||C==="allOf"||C in x.def&&JSON.stringify(g[C])===JSON.stringify(x.def[C])&&delete g[C]}const b=h._zod.parent;if(b&&b!==y){r(b);const x=t.seen.get(b);if(x!=null&&x.schema.$ref&&(g.$ref=x.schema.$ref,x.def))for(const S in g)S==="$ref"||S==="allOf"||S in x.def&&JSON.stringify(g[S])===JSON.stringify(x.def[S])&&delete g[S]}t.override({zodSchema:h,jsonSchema:g,path:m.path??[]})};if(!t.external||t.sharedEmitDoneFor!==t.external){for(const h of[...t.seen.entries()].reverse())r(h[0]);if(t.target!=="openapi-3.0")for(const h of t.seen.entries())o5(h[1].def??h[1].schema);for(const h of t.deferred)h();if(t.intersections.length){const h=new Map;for(const m of t.seen.values())for(const g of[m.schema,m.def]){const _=g==null?void 0:g.allOf;if(!Array.isArray(_))continue;const y=h.get(_);y?y.push(g):h.set(_,[g])}for(const m of t.intersections)for(const g of h.get(m)??[])iG(g)}}const s={};if(t.target==="draft-2020-12"?s.$schema="https://json-schema.org/draft/2020-12/schema":t.target==="draft-07"?s.$schema="http://json-schema.org/draft-07/schema#":t.target==="draft-04"?s.$schema="http://json-schema.org/draft-04/schema#":t.target,(l=t.external)!=null&&l.uri){const h=(u=t.external.registry.get(e))==null?void 0:u.id;if(!h)throw new Error("Schema is missing an `id` property");s.$id=t.external.uri(h)}up(s,n.defId?n.schema:n.def??n.schema);const i=(d=t.metadataRegistry.get(e))==null?void 0:d.id;i!==void 0&&s.id===i&&delete s.id;const o=((f=t.external)==null?void 0:f.defs)??{};if(!t.external||t.sharedEmitDoneFor!==t.external)for(const h of t.seen.entries()){const m=h[1];m.def&&m.defId&&(m.def.id===m.defId&&delete m.def.id,Za(o,m.defId,m.def))}t.external&&(t.sharedEmitDoneFor=t.external),t.external||Object.keys(o).length>0&&(t.target==="draft-2020-12"?s.$defs=o:s.definitions=o);try{const h=JSON.parse(JSON.stringify(s));return Object.defineProperty(h,"~standard",{value:{...e["~standard"],jsonSchema:{input:gv(e,"input",t.processors),output:gv(e,"output",t.processors)}},enumerable:!1,writable:!1}),h}catch{throw new Error("Error converting schema to JSON.")}}function ws(t,e){const n=e??{seen:new Set};if(n.seen.has(t))return!1;n.seen.add(t);const r=t._zod.def;if(r.type==="transform")return!0;if(r.type==="array")return ws(r.element,n);if(r.type==="set")return ws(r.valueType,n);if(r.type==="lazy")return ws(r.getter(),n);if(r.type==="promise"||r.type==="optional"||r.type==="nonoptional"||r.type==="nullable"||r.type==="readonly"||r.type==="default"||r.type==="prefault"||r.type==="catch")return ws(r.innerType,n);if(r.type==="intersection")return ws(r.left,n)||ws(r.right,n);if(r.type==="record"||r.type==="map")return ws(r.keyType,n)||ws(r.valueType,n);if(r.type==="pipe")return t._zod.traits.has("$ZodCodec")?!0:ws(r.in,n)||ws(r.out,n);if(r.type==="object"){for(const s in r.shape)if(ws(r.shape[s],n))return!0;return!1}if(r.type==="union"){for(const s of r.options)if(ws(s,n))return!0;return!1}if(r.type==="tuple"){for(const s of r.items)if(ws(s,n))return!0;return!!(r.rest&&ws(r.rest,n))}return!1}const oG=(t,e={})=>n=>{const r=s5({...n,processors:e});return mr(t,r),i5(r,t),l5(r,t)},gv=(t,e,n={})=>r=>{const{libraryOptions:s,target:i}=r??{},o=s5({...s??{},target:i,io:e,processors:n});return mr(t,o),i5(o,t),l5(o,t)},ff=(t,e,n)=>{(t[e]===void 0||n>t[e])&&(t[e]=n)},hf=(t,e,n)=>{(t[e]===void 0||n<t[e])&&(t[e]=n)},TT=(t,e)=>{ff(t,"minimum",e),hf(t,"maximum",e)},c5=(t,e)=>{t.multipleOf??(t.multipleOf=[]),t.multipleOf.includes(e)||t.multipleOf.push(e)},u5=(t,e)=>{t.patterns??(t.patterns=new Set),t.patterns.add(e)},d5=(t,e)=>{t.mime=t.mime?t.mime.filter(n=>e.includes(n)):[...e]},f5=(t,e)=>{t.format=e,e.includes("int")&&(t.isInt=!0)},RT=(t,e)=>ff(t,"minimum",e.minimum),AT=(t,e)=>hf(t,"maximum",e.maximum),IT=t=>(e,n)=>{f5(e,n.format);const[r,s]=t[n.format];ff(e,"minimum",r),hf(e,"maximum",s)},xw={greater_than:(t,e)=>ff(t,e.inclusive?"minimum":"exclusiveMinimum",e.value),less_than:(t,e)=>hf(t,e.inclusive?"maximum":"exclusiveMaximum",e.value),multiple_of:(t,e)=>c5(t,e.value),number_format:IT(IL),bigint_format:IT(SZ),min_length:RT,max_length:AT,length_equals:(t,e)=>TT(t,e.length),min_size:RT,max_size:AT,size_equals:(t,e)=>TT(t,e.size),string_format:(t,e)=>{f5(t,e.format),e.pattern&&u5(t,e.pattern),(e.format==="base64"||e.format==="base64url")&&(t.contentEncoding=e.format),(e.local||e.precision===-1)&&(t.laxFormat=!0)},mime_type:(t,e)=>d5(t,e.mime)};function ho(t){var i;const e={},n=t._zod.def,r=t._zod.traits.has("$ZodCheck")?[t,...n.checks??[]]:n.checks??[];for(const o of r)(i=xw[o._zod.def.check])==null||i.call(xw,e,o._zod.def);const s=t._zod.bag;s.minimum!==void 0&&ff(e,"minimum",s.minimum),s.exclusiveMinimum!==void 0&&ff(e,"exclusiveMinimum",s.exclusiveMinimum),s.maximum!==void 0&&hf(e,"maximum",s.maximum),s.exclusiveMaximum!==void 0&&hf(e,"exclusiveMaximum",s.exclusiveMaximum),s.multipleOf!==void 0&&c5(e,s.multipleOf),s.format!==void 0&&(e.format??(e.format=s.format),s.format.includes("int")&&(e.isInt=!0)),s.mime&&d5(e,s.mime);for(const o of s.patterns??[])u5(e,o);return e}const aG={guid:"uuid",url:"uri",datetime:"date-time",json_string:"json-string",regex:""},lG=new Map([[KL,kB],[VS,EB]]),h5=t=>lG.get(t)??t,cG=(t,e,n,r)=>{const s=n;s.type="string";const{minimum:i,maximum:o,format:l,patterns:u,contentEncoding:d,laxFormat:f}=ho(t);if(typeof i=="number"&&(s.minLength=i),typeof o=="number"&&(s.maxLength=o),l&&(s.format=aG[l]??l,s.format===""&&delete s.format,(l==="time"||f)&&delete s.format),d&&(s.contentEncoding=d),u&&u.size>0){const h=[...u].map(h5);h.length===1?s.pattern=h[0].source:h.length>1&&(s.allOf=[...h.map(m=>({...e.target==="draft-07"||e.target==="draft-04"||e.target==="openapi-3.0"?{type:"string"}:{},pattern:m.source}))])}},uG=(t,e,n,r)=>{const s=n,{minimum:i,maximum:o,multipleOf:l,exclusiveMaximum:u,exclusiveMinimum:d,isInt:f}=ho(t);s.type=f?"integer":"number";const h=typeof d=="number"&&d>=(i??Number.NEGATIVE_INFINITY),m=typeof u=="number"&&u<=(o??Number.POSITIVE_INFINITY),g=e.target==="draft-04"||e.target==="openapi-3.0";if(h?g?(s.minimum=d,s.exclusiveMinimum=!0):s.exclusiveMinimum=d:typeof i=="number"&&(s.minimum=i),m?g?(s.maximum=u,s.exclusiveMaximum=!0):s.exclusiveMaximum=u:typeof o=="number"&&(s.maximum=o),l){const _=new Set;for(const x of l)Number.isFinite(x)&&x!==0?_.add(Math.abs(x)):ql(t,e,s,r,`A multipleOf divisor of ${x} cannot be represented in JSON Schema`);const[y,...b]=_;y!==void 0&&(s.multipleOf=y),b.length&&(s.allOf=[...s.allOf??[],...b.map(x=>({multipleOf:x}))])}},dG=(t,e,n,r)=>{n.type="boolean"},fG=(t,e,n,r)=>{n.not={}},hG=(t,e,n,r)=>{},pG=(t,e,n,r)=>{const s=t._zod.def,i=c2(s.entries);if(i.length===0){n.not={};return}i.every(o=>typeof o=="number")&&(n.type="number"),i.every(o=>typeof o=="string")&&(n.type="string"),n.enum=i},mG=(t,e,n,r)=>{const s=t._zod.def;if(s.values.length===0){n.not={};return}const i=[];for(const o of s.values)if(o===void 0){if(ql(t,e,n,r,"Literal `undefined` cannot be represented in JSON Schema"))return}else if(typeof o=="bigint"){if(ql(t,e,n,r,"BigInt literals cannot be represented in JSON Schema"))return;i.push(Number(o))}else i.push(o);if(i.length!==0)if(i.length===1){const o=i[0];n.type=o===null?"null":typeof o,e.target==="draft-04"||e.target==="openapi-3.0"?n.enum=[o]:n.const=o}else i.every(o=>typeof o=="number")&&(n.type="number"),i.every(o=>typeof o=="string")&&(n.type="string"),i.every(o=>typeof o=="boolean")&&(n.type="boolean"),i.every(o=>o===null)&&(n.type="null"),n.enum=i},gG=(t,e,n,r)=>{ql(t,e,n,r,"Custom types cannot be represented in JSON Schema")},vG=(t,e,n,r)=>{ql(t,e,n,r,"Transforms cannot be represented in JSON Schema")},yG=(t,e,n,r)=>{const s=n,i=t._zod.def,{minimum:o,maximum:l}=ho(t);typeof o=="number"&&(s.minItems=o),typeof l=="number"&&(s.maxItems=l),s.type="array",s.items=mr(i.element,e,{...r,path:[...r.path,"items"]})};function vv(t){const e=t._zod.def;return e.type==="pipe"&&e.in._zod.traits.has("$ZodTransform")?vv(e.out):e.type==="catch"?vv(e.innerType):t._zod.optin}const _G=(t,e,n,r)=>{var d;const s=n,i=t._zod.def,o=i.shape;if(Object.getOwnPropertySymbols(o).length&&ql(t,e,s,r,"Symbol keys cannot be represented in JSON Schema"))return;s.type="object",s.properties={};for(const f in o)Za(s.properties,f,mr(o[f],e,{...r,path:[...r.path,"properties",f]}));const u=[];for(const f of Object.keys(o)){const h=i.shape[f];(e.io==="input"?vv(h)===void 0:h._zod.optout===void 0)&&u.push(f)}u.length>0&&(s.required=u),((d=i.catchall)==null?void 0:d._zod.def.type)==="never"?s.additionalProperties=!1:i.catchall?i.catchall&&(s.additionalProperties=mr(i.catchall,e,{...r,path:[...r.path,"additionalProperties"]})):e.io==="output"&&(s.additionalProperties=!1)},wG=(t,e,n,r)=>{const s=t._zod.def,i=s.inclusive===!1,o=s.options.map((l,u)=>mr(l,e,{...r,path:[...r.path,i?"oneOf":"anyOf",u]}));i?n.oneOf=o:n.anyOf=o},bG=(t,e,n,r)=>{const s=t._zod.def,i=mr(s.left,e,{...r,path:[...r.path,"allOf",0]}),o=mr(s.right,e,{...r,path:[...r.path,"allOf",1]}),l=d=>"allOf"in d&&Object.keys(d).length===1,u=[...l(i)?i.allOf:[i],...l(o)?o.allOf:[o]];n.allOf=u,e.intersections.push(u)};function g2(t,e,n){var _;if(e.$ref){if(n.has(e))return e;n.add(e);const y=(_=t.get(e))==null?void 0:_.def;if(!y)return e;const b=g2(t,y,n);return b===y?e:b}for(const y of["anyOf","oneOf"]){const b=e[y];if(!Array.isArray(b))continue;const x=b.map(S=>g2(t,S,n));x.some((S,E)=>S!==b[E])&&(e={...e,[y]:x})}const r=Array.isArray(e.type)?e.type:[e.type],s=!r.includes("string")&&r.some(y=>y==="number"||y==="integer"),i=e.enum??(e.const!==void 0?[e.const]:void 0);if(!s&&!(i!=null&&i.some(y=>typeof y=="number")))return e;const{minimum:o,maximum:l,exclusiveMinimum:u,exclusiveMaximum:d,multipleOf:f,format:h,id:m,...g}=e;return g.enum?g.enum=g.enum.map(y=>typeof y=="number"?String(y):y):typeof g.const=="number"&&(g.const=String(g.const)),s&&(g.type="string",i||(g.pattern=(r.includes("number")?FS:MB).source)),g}const v2=new WeakMap;function xG(t){var r;const e=new Map;for(const s of t.seen.values())s.def&&!e.has(s.schema)&&e.set(s.schema,s);const n=new Map;for(const s of v2.get(t)??[]){const i=t.seen.get(s),o=(r=(i==null?void 0:i.def)??(i==null?void 0:i.schema))==null?void 0:r.propertyNames;if(!o||o===!0||n.has(o))continue;const l=g2(e,o,new Set);l!==o&&n.set(o,l)}if(n.size)for(const s of t.seen.values())for(const i of[s.schema,s.def]){const o=i&&n.get(i.propertyNames);o&&(i.propertyNames=o)}}const SG=(t,e,n,r)=>{const s=n,i=t._zod.def;s.type="object";const o=i.keyType,l=ho(o).patterns;if(i.mode==="loose"&&l&&l.size>0){const f=mr(i.valueType,e,{...r,path:[...r.path,"patternProperties","*"]});s.patternProperties={};for(const h of l)Za(s.patternProperties,h5(h).source,f)}else{if(e.target==="draft-07"||e.target==="draft-2020-12"){s.propertyNames=mr(i.keyType,e,{...r,path:[...r.path,"propertyNames"]});let f=v2.get(e);f||(f=[],v2.set(e,f),e.deferred.push(()=>xG(e))),f.push(t)}s.additionalProperties=mr(i.valueType,e,{...r,path:[...r.path,"additionalProperties"]})}const u=o._zod.values,d=e.io==="input"&&vv(i.valueType)!==void 0;if(u&&!i.partial&&!d){const f=[...u].filter(h=>typeof h=="string"||typeof h=="number");f.length>0&&(s.required=f.map(String))}},kG=(t,e,n,r)=>{const s=t._zod.def,i=mr(s.innerType,e,r),o=e.seen.get(t);e.target==="openapi-3.0"?(o.ref=s.innerType,n.nullable=!0):n.anyOf=[i,{type:"null"}]},EG=(t,e,n,r)=>{const s=t._zod.def;mr(s.innerType,e,r);const i=e.seen.get(t);i.ref=s.innerType},HS=Symbol();function p5(t,e,n,r,s){let i=!1;const o=JSON.stringify(t,(l,u)=>typeof u!="bigint"?u:(i=!0,null));return i?(ql(e,n,r,s,"BigInt defaults cannot be represented in JSON Schema"),HS):JSON.parse(o)}const CG=(t,e,n,r)=>{const s=t._zod.def;mr(s.innerType,e,r);const i=e.seen.get(t);i.ref=s.innerType;const o=p5(s.defaultValue,t,e,n,r);o!==HS&&(n.default=o)},PG=(t,e,n,r)=>{const s=t._zod.def;mr(s.innerType,e,r);const i=e.seen.get(t);if(i.ref=s.innerType,e.io!=="input")return;const o=p5(s.defaultValue,t,e,n,r);o!==HS&&(n._prefault=o)},TG=(t,e,n,r)=>{const s=t._zod.def;mr(s.innerType,e,r);const i=e.seen.get(t);i.ref=s.innerType;let o;try{o=s.catchValue(void 0)}catch{ql(t,e,n,r,"Dynamic catch values are not supported in JSON Schema");return}n.default=o},RG=(t,e,n,r)=>{const s=t._zod.def,i=s.in._zod.traits.has("$ZodTransform"),o=e.io==="input"?i?s.out:s.in:s.out;mr(o,e,r);const l=e.seen.get(t);l.ref=o},AG=(t,e,n,r)=>{const s=t._zod.def;mr(s.innerType,e,r);const i=e.seen.get(t);i.ref=s.innerType,n.readOnly=!0},m5=(t,e,n,r)=>{const s=t._zod.def;mr(s.innerType,e,r);const i=e.seen.get(t);i.ref=s.innerType},OT=new WeakSet([Object.prototype,Error.prototype]);function U0(t,e,n){Object.defineProperty(t,e,{configurable:!0,enumerable:!1,get(){const r=n(this);return Object.defineProperty(this,e,{value:r,configurable:!0,writable:!0}),r},set(r){Object.defineProperty(this,e,{value:r,configurable:!0,writable:!0})}})}const IG=(t,e)=>{BZ.init(t,e),t.name="ZodError";const n=Object.getPrototypeOf(t);OT.has(n)||(OT.add(n),U0(n,"format",r=>s=>GZ(r,s)),U0(n,"flatten",r=>s=>KZ(r,s)),U0(n,"addIssue",r=>s=>{r.issues.push(s),r.message=JSON.stringify(r.issues,u2,2)}),U0(n,"addIssues",r=>s=>{r.issues.push(...s),r.message=JSON.stringify(r.issues,u2,2)}),Object.defineProperty(n,"isEmpty",{configurable:!0,enumerable:!1,get(){return this.issues.length===0}}))},Wi=fe("ZodError",IG,void 0,{Parent:Error}),OG=LS(Wi),MG=NS(Wi),LG=DS(Wi),NG=$S(Wi),DG=eB(Wi),$G=tB(Wi),FG=nB(Wi),jG=rB(Wi),zG=sB(Wi),VG=iB(Wi),HG=oB(Wi),UG=aB(Wi);function ZG(){mo.localeError||Xo(cK())}function py(){mo.memoizer||Xo({memoizer:oK()})}const Kn=fe("ZodType",(t,e)=>(ZG(),Wn.init(t,e),t.def=e,t.type=e.type,t),{check(...t){const e=this.def;return this.clone(hi(e,{checks:[...e.checks??[],...t.map(n=>typeof n=="function"?{_zod:{check:n,def:{check:"custom"},onattach:[]}}:n)]}),{parent:!0})},with(...t){return this.check(...t)},clone(t,e){return oc(this,t,e)},brand(){return this},register(t,e){return t.add(this,e),this},refine(t,e){return this.check(Vq(t,e))},superRefine(t,e){return this.check(Hq(t,e))},overwrite(t){return this.check(Lf(t))},optional(){return NT(this)},exactOptional(){return Tq(this)},nullable(){return DT(this)},nullish(){return NT(DT(this))},nonoptional(t){return Lq(this,t)},array(){return Tt(this)},or(t){return hm([this,t])},and(t){return kq(this,t)},transform(t){return $T(this,Pq(t))},default(t){return Iq(this,t)},prefault(t){return Mq(this,t)},catch(t){return Dq(this,t)},pipe(t){return $T(this,t)},readonly(){return jq(this)},describe(t){const e=this.clone();return Uh.add(e,{description:t}),e},meta(...t){if(t.length===0)return Uh.get(this);const e=this.clone();return Uh.add(e,t[0]),e},isOptional(){return this.safeParse(void 0).success},isNullable(){return this.safeParse(null).success},apply(t,...e){return e.length===0?t(this):t(this,...e)},get"~standard"(){return ML(this,"~standard",{...HL(this),jsonSchema:{input:gv(this,"input"),output:gv(this,"output")}})},set"~standard"(t){Gl(this,"~standard",t)},parse:function t(e,n){return OG(this,e,n,{callee:t})},parseAsync:async function t(e,n){return await MG(this,e,n,{callee:t})},safeParse(t,e){return LG(this,t,e)},async safeParseAsync(t,e){return NG(this,t,e)},get spa(){return this==null?void 0:this.safeParseAsync},set spa(t){Gl(this,"spa",t)},validate(t,e){return XZ(this,t,e)},validateAsync(t,e){return JZ(this,t,e)},encode:function t(e,n){return DG(this,e,n,{callee:t})},decode:function t(e,n){return $G(this,e,n,{callee:t})},encodeAsync:async function t(e,n){return await FG(this,e,n,{callee:t})},decodeAsync:async function t(e,n){return await jG(this,e,n,{callee:t})},safeEncode(t,e){return zG(this,t,e)},safeDecode(t,e){return VG(this,t,e)},async safeEncodeAsync(t,e){return HG(this,t,e)},async safeDecodeAsync(t,e){return UG(this,t,e)},toJSONSchema(t){return oG(this,{})(t)},get description(){var t;return(t=Uh.get(this))==null?void 0:t.description},get _def(){return this._zod.def}}),g5=fe("_ZodString",(t,e)=>{zS.init(t,e),Kn.init(t,e),t._zod.processJSONSchema=(n,r,s)=>cG(t,n,r)},LL({format:t=>ho(t).format??null,minLength:t=>ho(t).minimum??null,maxLength:t=>ho(t).maximum??null},{regex(...t){return this.check(ZK(...t))},includes(...t){return this.check(KK(...t))},startsWith(...t){return this.check(GK(...t))},endsWith(...t){return this.check(qK(...t))},min(...t){return this.check(mv(...t))},max(...t){return this.check(n5(...t))},length(...t){return this.check(r5(...t))},nonempty(...t){return this.check(mv(1,...t))},lowercase(t){return this.check(BK(t))},uppercase(t){return this.check(WK(t))},trim(){return this.check(XK())},normalize(...t){return this.check(YK(...t))},toLowerCase(){return this.check(QK())},toUpperCase(){return this.check(JK())},slugify(){return this.check(eG())}})),BG=fe("ZodString",(t,e)=>{zS.init(t,e),g5.init(t,e)},{email(t){return this.check(hK(YG,t))},url(t){return this.check(_K(QG,t))},jwt(t){return this.check(LK(hq,t))},emoji(t){return this.check(wK(JG,t))},guid(t){return this.check(pK(XG,t))},uuid(t){return this.check(mK(Z0,t))},uuidv4(t){return this.check(gK(Z0,t))},uuidv6(t){return this.check(vK(Z0,t))},uuidv7(t){return this.check(yK(Z0,t))},nanoid(t){return this.check(bK(eq,t))},cuid(t){return this.check(xK(tq,t))},cuid2(t){return this.check(SK(nq,t))},ulid(t){return this.check(kK(rq,t))},base64(t){return this.check(IK(uq,t))},base64url(t){return this.check(OK(dq,t))},xid(t){return this.check(EK(sq,t))},ksuid(t){return this.check(CK(iq,t))},ipv4(t){return this.check(PK(oq,t))},ipv6(t){return this.check(TK(aq,t))},cidrv4(t){return this.check(RK(lq,t))},cidrv6(t){return this.check(AK(cq,t))},e164(t){return this.check(MK(fq,t))},datetime(t){return this.check(NK(WG,t))},date(t){return this.check(DK(KG,t))},time(t){return this.check($K(GG,t))},duration(t){return this.check(FK(qG,t))}});function re(t){return fK(BG,t)}const Gn=fe("ZodStringFormat",(t,e)=>{$n.init(t,e),g5.init(t,e)}),WG=fe("ZodISODateTime",(t,e)=>{pW.init(t,e),Gn.init(t,e)}),KG=fe("ZodISODate",(t,e)=>{mW.init(t,e),Gn.init(t,e)}),GG=fe("ZodISOTime",(t,e)=>{gW.init(t,e),Gn.init(t,e)}),qG=fe("ZodISODuration",(t,e)=>{vW.init(t,e),Gn.init(t,e)}),YG=fe("ZodEmail",(t,e)=>{eW.init(t,e),Gn.init(t,e)}),XG=fe("ZodGUID",(t,e)=>{QB.init(t,e),Gn.init(t,e)}),Z0=fe("ZodUUID",(t,e)=>{JB.init(t,e),Gn.init(t,e)}),QG=fe("ZodURL",(t,e)=>{oW.init(t,e),Gn.init(t,e)}),JG=fe("ZodEmoji",(t,e)=>{aW.init(t,e),Gn.init(t,e)}),eq=fe("ZodNanoID",(t,e)=>{lW.init(t,e),Gn.init(t,e)}),tq=fe("ZodCUID",(t,e)=>{cW.init(t,e),Gn.init(t,e)}),nq=fe("ZodCUID2",(t,e)=>{uW.init(t,e),Gn.init(t,e)}),rq=fe("ZodULID",(t,e)=>{dW.init(t,e),Gn.init(t,e)}),sq=fe("ZodXID",(t,e)=>{fW.init(t,e),Gn.init(t,e)}),iq=fe("ZodKSUID",(t,e)=>{hW.init(t,e),Gn.init(t,e)}),oq=fe("ZodIPv4",(t,e)=>{yW.init(t,e),Gn.init(t,e)}),aq=fe("ZodIPv6",(t,e)=>{wW.init(t,e),Gn.init(t,e)}),lq=fe("ZodCIDRv4",(t,e)=>{bW.init(t,e),Gn.init(t,e)}),cq=fe("ZodCIDRv6",(t,e)=>{SW.init(t,e),Gn.init(t,e)}),uq=fe("ZodBase64",(t,e)=>{kW.init(t,e),Gn.init(t,e)}),dq=fe("ZodBase64URL",(t,e)=>{CW.init(t,e),Gn.init(t,e)}),fq=fe("ZodE164",(t,e)=>{PW.init(t,e),Gn.init(t,e)}),hq=fe("ZodJWT",(t,e)=>{RW.init(t,e),Gn.init(t,e)}),v5=fe("ZodNumber",(t,e)=>{GL.init(t,e),Kn.init(t,e),t._zod.processJSONSchema=(n,r,s)=>uG(t,n,r,s),t.isFinite=!0},LL({minValue:t=>{const{minimum:e,exclusiveMinimum:n}=ho(t);return Math.max(e??Number.NEGATIVE_INFINITY,n??Number.NEGATIVE_INFINITY)},maxValue:t=>{const{maximum:e,exclusiveMaximum:n}=ho(t);return Math.min(e??Number.POSITIVE_INFINITY,n??Number.POSITIVE_INFINITY)},isInt:t=>{const{isInt:e,multipleOf:n}=ho(t);return!!e||!!(n!=null&&n.some(Number.isSafeInteger))},format:t=>ho(t).format??null},{gt(t,e){return this.check(ST(t,e))},gte(t,e){return this.check(bw(t,e))},min(t,e){return this.check(bw(t,e))},lt(t,e){return this.check(xT(t,e))},lte(t,e){return this.check(ww(t,e))},max(t,e){return this.check(ww(t,e))},int(t){return this.check(MT(t))},safe(t){return this.check(MT(t))},positive(t){return this.check(ST(0,t))},nonnegative(t){return this.check(bw(0,t))},negative(t){return this.check(xT(0,t))},nonpositive(t){return this.check(ww(0,t))},multipleOf(t,e){return this.check(kT(t,e))},step(t,e){return this.check(kT(t,e))},finite(){return this}}));function An(t){return jK(v5,t)}const pq=fe("ZodNumberFormat",(t,e)=>{AW.init(t,e),v5.init(t,e)});function MT(t){return zK(pq,t)}const mq=fe("ZodBoolean",(t,e)=>{IW.init(t,e),Kn.init(t,e),t._zod.processJSONSchema=(n,r,s)=>dG(t,n,r)});function Zs(t){return VK(mq,t)}const gq=fe("ZodUnknown",(t,e)=>{OW.init(t,e),Kn.init(t,e),t._zod.processJSONSchema=(n,r,s)=>hG()});function y2(){return HK(gq)}const vq=fe("ZodNever",(t,e)=>{MW.init(t,e),Kn.init(t,e),t._zod.processJSONSchema=(n,r,s)=>fG(t,n,r)});function yq(t){return UK(vq,t)}const _q=fe("ZodArray",(t,e)=>{py(),DW.init(t,e),Kn.init(t,e),t._zod.processJSONSchema=(n,r,s)=>yG(t,n,r,s),t.element=e.element},{min(t,e){return this.check(mv(t,e))},nonempty(t){return this.check(mv(1,t))},max(t,e){return this.check(n5(t,e))},length(t,e){return this.check(r5(t,e))},unwrap(){return this.element}});function Tt(t,e){return tG(_q,t,e)}const wq=fe("ZodObject",(t,e)=>{py(),jW.init(t,e),Kn.init(t,e),t._zod.processJSONSchema=(n,r,s)=>_G(t,n,r,s),$Z(t,"shape",n=>n._zod.def.shape,!1)},{keyof(){return jt(Object.keys(this._zod.def.shape))},catchall(t){return this.clone(hi(this._zod.def,{catchall:t}))},passthrough(){return this.clone(hi(this._zod.def,{catchall:y2()}))},loose(){return this.clone(hi(this._zod.def,{catchall:y2()}))},strict(){return this.clone(hi(this._zod.def,{catchall:yq()}))},strip(){return this.clone(hi(this._zod.def,{catchall:void 0}))},extend(t){return CZ(this,t)},safeExtend(t){return PZ(this,t)},merge(t){return TZ(this,t)},pick(t){return kZ(this,t)},omit(t){return EZ(this,t)},partial(...t){return sT(_5,this,t[0])},exactPartial(...t){return sT(w5,this,t[0],"exactPartial")},required(...t){return RZ(b5,this,t[0])}});function ze(t,e){const n={type:"object",shape:t??{},...nt(e)};return new wq(n)}const y5=fe("ZodUnion",(t,e)=>{XL.init(t,e),Kn.init(t,e),t._zod.processJSONSchema=(n,r,s)=>wG(t,n,r,s),t.options=e.options});function hm(t,e){return new y5({type:"union",options:t,...nt(e)})}const bq=fe("ZodDiscriminatedUnion",(t,e)=>{y5.init(t,e),VW.init(t,e)});function xq(t,e,n){return new bq({type:"union",options:e,discriminator:t,...nt(n)})}const Sq=fe("ZodIntersection",(t,e)=>{HW.init(t,e),Kn.init(t,e),t._zod.processJSONSchema=(n,r,s)=>bG(t,n,r,s)});function kq(t,e){return new Sq({type:"intersection",left:t,right:e})}const LT=fe("ZodRecord",(t,e)=>{py(),UW.init(t,e),Kn.init(t,e),t._zod.processJSONSchema=(n,r,s)=>SG(t,n,r,s),t.keyType=e.keyType,t.valueType=e.valueType});function US(t,e,n){return!e||!e._zod?new LT({type:"record",keyType:re(),valueType:t,...nt(e)}):new LT({type:"record",keyType:t,valueType:e,...nt(n)})}const _2=fe("ZodEnum",(t,e)=>{ZW.init(t,e),Kn.init(t,e),t._zod.processJSONSchema=(r,s,i)=>pG(t,r,s),t.enum=e.entries,t.options=[...t._zod.values];const n=new Set(Object.keys(e.entries));t.extract=(r,s)=>{const i={};for(const o of r)if(n.has(o))i[o]=e.entries[o];else throw new Error(`Key ${o} not found in enum`);return new _2({...e,checks:[],...nt(s),entries:i})},t.exclude=(r,s)=>{const i={...e.entries};for(const o of r)if(n.has(o))delete i[o];else throw new Error(`Key ${o} not found in enum`);return new _2({...e,checks:[],...nt(s),entries:i})}});function jt(t,e){const n=Array.isArray(t)?Object.fromEntries(t.map(r=>[r,r])):t;return new _2({type:"enum",entries:n,...nt(e)})}const Eq=fe("ZodLiteral",(t,e)=>{BW.init(t,e),Kn.init(t,e),t._zod.processJSONSchema=(n,r,s)=>mG(t,n,r,s),t.values=new Set(e.values),Object.defineProperty(t,"value",{get(){if(e.values.length>1)throw new Error("This schema contains multiple valid literal values. Use `.values` instead.");return e.values[0]}})});function pf(t,e){return new Eq({type:"literal",values:Array.isArray(t)?t:[t],...nt(e)})}const Cq=fe("ZodTransform",(t,e)=>{py(),WW.init(t,e),Kn.init(t,e),t._zod.processJSONSchema=(n,r,s)=>vG(t,n,r,s),t._zod.parse=(n,r)=>{if(r.direction==="backward")throw new DL(t.constructor.name);n.addIssue=i=>{if(typeof i=="string")n.issues.push(Tp(i,n.value,e));else{const o=i;o.fatal&&(o.continue=!1),o.code??(o.code="custom"),"input"in o||(o.input=n.value),o.inst??(o.inst=t),n.issues.push(Tp(o))}};const s=e.transform(n.value,n);return s instanceof Promise?s.then(i=>(n.value=i,n)):(n.value=s,n)}});function Pq(t){return new Cq({type:"transform",transform:t})}const _5=fe("ZodOptional",(t,e)=>{QL.init(t,e),Kn.init(t,e),t._zod.processJSONSchema=(n,r,s)=>m5(t,n,r,s),t.unwrap=()=>t._zod.def.innerType});function NT(t){return new _5({type:"optional",innerType:t})}const w5=fe("ZodExactOptional",(t,e)=>{KW.init(t,e),Kn.init(t,e),t._zod.processJSONSchema=(n,r,s)=>m5(t,n,r,s),t.unwrap=()=>t._zod.def.innerType});function Tq(t){return new w5({type:"optional",innerType:t})}const Rq=fe("ZodNullable",(t,e)=>{GW.init(t,e),Kn.init(t,e),t._zod.processJSONSchema=(n,r,s)=>kG(t,n,r,s),t.unwrap=()=>t._zod.def.innerType});function DT(t){return new Rq({type:"nullable",innerType:t})}const Aq=fe("ZodDefault",(t,e)=>{qW.init(t,e),Kn.init(t,e),t._zod.processJSONSchema=(n,r,s)=>CG(t,n,r,s),t.unwrap=()=>t._zod.def.innerType,t.removeDefault=t.unwrap});function Iq(t,e){return new Aq({type:"default",innerType:t,get defaultValue(){return typeof e=="function"?e():RL(e)}})}const Oq=fe("ZodPrefault",(t,e)=>{YW.init(t,e),Kn.init(t,e),t._zod.processJSONSchema=(n,r,s)=>PG(t,n,r,s),t.unwrap=()=>t._zod.def.innerType});function Mq(t,e){return new Oq({type:"prefault",innerType:t,get defaultValue(){return typeof e=="function"?e():RL(e)}})}const b5=fe("ZodNonOptional",(t,e)=>{XW.init(t,e),Kn.init(t,e),t._zod.processJSONSchema=(n,r,s)=>EG(t,n,r,s),t.unwrap=()=>t._zod.def.innerType});function Lq(t,e){return new b5({type:"nonoptional",innerType:t,...nt(e)})}const Nq=fe("ZodCatch",(t,e)=>{QW.init(t,e),Kn.init(t,e),t._zod.processJSONSchema=(n,r,s)=>TG(t,n,r,s),t.unwrap=()=>t._zod.def.innerType,t.removeCatch=t.unwrap});function Dq(t,e){return new Nq({type:"catch",innerType:t,catchValue:typeof e=="function"?e:jZ(e)})}const $q=fe("ZodPipe",(t,e)=>{JW.init(t,e),Kn.init(t,e),t._zod.processJSONSchema=(n,r,s)=>RG(t,n,r,s),t.in=e.in,t.out=e.out});function $T(t,e){return new $q({type:"pipe",in:t,out:e})}const Fq=fe("ZodReadonly",(t,e)=>{eK.init(t,e),Kn.init(t,e),t._zod.processJSONSchema=(n,r,s)=>AG(t,n,r,s),t.unwrap=()=>t._zod.def.innerType});function jq(t){return new Fq({type:"readonly",innerType:t})}const zq=fe("ZodCustom",(t,e)=>{tK.init(t,e),Kn.init(t,e),t._zod.processJSONSchema=(n,r,s)=>gG(t,n,r,s)});function Vq(t,e={}){return nG(zq,t,e)}function Hq(t,e){return rG(t,e)}const x5={custom:"custom"},Us=(t,e=String(t))=>t instanceof Error?t.message:e,Uq=["multiple_lockfiles","unsupported_package_manager","invalid_package_manager_field","invalid_manifest","invalid_workspace","path_outside_workspace","dangling_symlink","version_unreadable","version_mismatch","no_install_command","install_failed","lockfile_outdated","engine_incompatible","install_script_failed","installer_unstoppable","inputs_changed"],S5=["ENOENT","EACCES","EPERM","EEXIST","ENOTDIR","EISDIR","ELOOP","ENOSPC","EMFILE","EADDRINUSE","ECONNREFUSED","ECONNRESET","ETIMEDOUT","EBUSY","ENOTSUP","EINVAL","ENOTEMPTY","EROFS","EAI_AGAIN"],Zq=["timeout","aborted","unknown"],k5=[...Uq,...S5,...Zq];new Set(k5);new Set(S5);const ci=An().finite().nonnegative().max(Number.MAX_SAFE_INTEGER),Bq=ze({command:jt(["open","status","stop","wait","auth.status","variants.start","variants.status","variants.get","variants.list","variants.complete","variants.cancel","reference.fetch","evidence.capture","context.add","context.update","context.list","context.show","context.enable","context.disable","context.remove","context.resolve","context.inspect","context.verifier","context.verify"]).optional(),tool_name:jt(["rivet_login","rivet_explore_designs","rivet_get_exploration","rivet_cancel_exploration","rivet_complete_variant_work","rivet_get_design_context","rivet_find_references","rivet_save_reference","rivet_remove_reference","rivet_preview_reference_import","rivet_import_references","rivet_connect_reference_account","rivet_discover_reference_collections","rivet_save_design_preference","rivet_remove_design_preference","rivet_save_design_check","rivet_remove_design_check","rivet_run_design_check"]).optional(),caller_agent:jt(["claude","codex","cursor","unknown","other"]).optional(),mcp_editor:jt(["claude","claude-desktop","codex","cursor","unknown","other"]).optional(),source:jt(["cli","mcp","core","ui","visual_editor"]).optional(),surface:jt(["cli","mcp","visual_editor"]).optional(),mode:jt(["initial_generation","zero_to_one","source_grounded","comment_refine","vary","history_adoption","commit","unknown"]).optional(),entry_point:jt(["mcp_tool","visual_editor_comment","variants_panel","history","watch_loop","route","unknown","login_command","signin_command","install_flow","tool_call","account_menu","library","menu","onboarding","editor_gate","cli","mcp"]).optional(),project_context_kind:jt(["existing","fresh"]).optional(),preview_kind:jt(["dev_server","static_artifact"]).optional(),provider:jt(["pinterest","arena","cosmos","x"]).optional(),request_status:jt(["accepted","rejected","completed","failed","cancelled","degraded","superseded"]).optional(),error_code:jt(["OPERATION_FAILED","USAGE_ERROR","AUTH_REQUIRED","SERVER_UNAVAILABLE","WAIT_TIMEOUT","SESSION_NOT_FOUND","WORK_ITEM_NOT_FOUND","DIRECTION_AMBIGUOUS","MCP_REMOVED","STATIC_PREVIEW_FAILED","DEV_SERVER_FAILED","PREVIEW_UNAVAILABLE","DEPENDENCY_INSTALL_FAILED","DEV_SERVER_START_FAILED","DEV_SCRIPT_MISSING"]).optional(),reason_code:jt(k5).optional(),failure_reason:jt(["ack_failed","active_session","destination_not_empty","feature_disabled","invalid_stage_action","lease_expired","missing_artifact","missing_required_input","pending_change_conflict","queue_full","runtime_validation_failed","schema_validation_failed","source_context_invalid","start_in_flight","target_not_editable","timeout","unknown","work_item_not_found","local_server_failed","oauth_failed","popup_blocked","credential_store_failed","popup_closed","provider_failed","request_failed","auth_required","invalid_arguments","operation_failed","server_unavailable","usage_error","wait_timeout","session_not_found","direction_ambiguous","mcp_removed","server_start_timeout","handshake_missing","handshake_invalid","process_not_running","health_check_failed","plugin_context_mismatch","telemetry_policy_mismatch","server_starting","transport_failed","server_shutdown_pending","server_process_exited","server_upgrade_required","replacement_version_mismatch","replacement_health_failed","app_health_failed","dev_server_resolution_failed","rivet_port_unavailable","editor_server_start_failed"]).optional(),verification_outcome:jt(["pass","fail","blocked","package_required","verifier_missing","verifier_stale","cancelled","timeout","output_limit","process_failed","invalid_result","invalid_evidence","cleanup_failed","setup_failed"]).optional(),verification_check_count:ci.int().optional(),verification_duration_ms:ci.optional(),ok:Zs().optional(),is_recoverable:Zs().optional(),is_fresh:Zs().optional(),duration_ms:ci.optional(),dwell_ms_from_terminal:ci.optional(),exit_code:ci.optional(),requested_count:ci.optional(),accepted_count:ci.optional(),work_item_count:ci.optional(),completed_count:ci.optional(),failed_count:ci.optional(),cancelled_count:ci.optional(),reference_count:ci.optional(),changed_files_count:ci.optional()}),Wq=new Set(["cli_command_completed","cli_auth_started","cli_auth_completed","cli_auth_failed","mcp_auth_started","mcp_auth_completed","mcp_auth_failed","mcp_tool_executed","mcp_tool_failed","mcp_login_failed","mcp_login_started","mcp_login_completed","visual_editor_auth_started","visual_editor_auth_completed","visual_editor_auth_failed","visual_editor_reference_connection_started","visual_editor_reference_connection_completed","visual_editor_reference_connection_failed","agent_variants.request_started","agent_variants.request_accepted","agent_variants.refinement_requested","agent_variants.refinement_completed","agent_variants.refinement_failed","agent_variants.round_started","agent_variants.round_completed","agent_variants.preview_started","agent_variants.preview_ready","agent_variants.preview_failed"]),Kq=(t,e)=>{if(!Wq.has(t))return null;const n={};for(const[r,s]of Object.entries(Bq.shape)){const i=s.safeParse(e[r]);i.success&&i.data!==void 0&&(n[r]=i.data)}return n};var Xt;(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})(Xt||(Xt={}));var FT;(function(t){t.mergeShapes=(e,n)=>({...e,...n})})(FT||(FT={}));const Ye=Xt.arrayToEnum(["string","nan","number","integer","float","boolean","date","bigint","symbol","function","undefined","null","array","object","unknown","promise","void","never","map","set"]),wl=t=>{switch(typeof t){case"undefined":return Ye.undefined;case"string":return Ye.string;case"number":return Number.isNaN(t)?Ye.nan:Ye.number;case"boolean":return Ye.boolean;case"function":return Ye.function;case"bigint":return Ye.bigint;case"symbol":return Ye.symbol;case"object":return Array.isArray(t)?Ye.array:t===null?Ye.null:t.then&&typeof t.then=="function"&&t.catch&&typeof t.catch=="function"?Ye.promise:typeof Map<"u"&&t instanceof Map?Ye.map:typeof Set<"u"&&t instanceof Set?Ye.set:typeof Date<"u"&&t instanceof Date?Ye.date:Ye.object;default:return Ye.unknown}},Pe=Xt.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 Fa 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],f=u===o.path.length-1;if(d==="_errors"){f&&l._errors.push(n(o)),u++;continue}Object.prototype.hasOwnProperty.call(l,d)||(d==="__proto__"?Object.defineProperty(l,d,{value:{_errors:[]},writable:!0,enumerable:!0,configurable:!0}):l[d]={_errors:[]}),l=l[d],f&&l._errors.push(n(o)),u++}}};return s(this),r}static assert(e){if(!(e instanceof Fa))throw new Error(`Not a ZodError: ${e}`)}toString(){return this.message}get message(){return JSON.stringify(this.issues,Xt.jsonStringifyReplacer,2)}get isEmpty(){return this.issues.length===0}flatten(e=n=>n.message){const n=Object.create(null),r=[];for(const s of this.issues)if(s.path.length>0){const i=s.path[0];n[i]=n[i]||[],n[i].push(e(s))}else r.push(e(s));return{formErrors:r,fieldErrors:n}}get formErrors(){return this.flatten()}}Fa.create=t=>new Fa(t);const w2=(t,e)=>{let n;switch(t.code){case Pe.invalid_type:t.received===Ye.undefined?n="Required":n=`Expected ${t.expected}, received ${t.received}`;break;case Pe.invalid_literal:n=`Invalid literal value, expected ${JSON.stringify(t.expected,Xt.jsonStringifyReplacer)}`;break;case Pe.unrecognized_keys:n=`Unrecognized key(s) in object: ${Xt.joinValues(t.keys,", ")}`;break;case Pe.invalid_union:n="Invalid input";break;case Pe.invalid_union_discriminator:n=`Invalid discriminator value. Expected ${Xt.joinValues(t.options)}`;break;case Pe.invalid_enum_value:n=`Invalid enum value. Expected ${Xt.joinValues(t.options)}, received '${t.received}'`;break;case Pe.invalid_arguments:n="Invalid function arguments";break;case Pe.invalid_return_type:n="Invalid function return type";break;case Pe.invalid_date:n="Invalid date";break;case Pe.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}"`:Xt.assertNever(t.validation):t.validation!=="regex"?n=`Invalid ${t.validation}`:n="Invalid";break;case Pe.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 Pe.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 Pe.custom:n="Invalid input";break;case Pe.invalid_intersection_types:n="Intersection results could not be merged";break;case Pe.not_multiple_of:n=`Number must be a multiple of ${t.multipleOf}`;break;case Pe.not_finite:n="Number must be finite";break;default:n=e.defaultError,Xt.assertNever(t)}return{message:n}};let Gq=w2;function qq(){return Gq}const Yq=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 je(t,e){const n=qq(),r=Yq({issueData:e,data:t.data,path:t.path,errorMaps:[t.common.contextualErrorMap,t.schemaErrorMap,n,n===w2?void 0:w2].filter(s=>!!s)});t.common.issues.push(r)}class _i{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 _t;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 _i.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 _t;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 _t=Object.freeze({status:"aborted"}),Zh=t=>({status:"dirty",value:t}),Ki=t=>({status:"valid",value:t}),jT=t=>t.status==="aborted",zT=t=>t.status==="dirty",mf=t=>t.status==="valid",yv=t=>typeof Promise<"u"&&t instanceof Promise;var tt;(function(t){t.errToObj=e=>typeof e=="string"?{message:e}:e||{},t.toString=e=>typeof e=="string"?e:e==null?void 0:e.message})(tt||(tt={}));class Yl{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 VT=(t,e)=>{if(mf(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 Fa(t.common.issues);return this._error=n,this._error}}};function Ot(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 Kt{get description(){return this._def.description}_getType(e){return wl(e.data)}_getOrReturnCtx(e,n){return n||{common:e.parent.common,data:e.data,parsedType:wl(e.data),schemaErrorMap:this._def.errorMap,path:e.path,parent:e.parent}}_processInputParams(e){return{status:new _i,ctx:{common:e.parent.common,data:e.data,parsedType:wl(e.data),schemaErrorMap:this._def.errorMap,path:e.path,parent:e.parent}}}_parseSync(e){const n=this._parse(e);if(yv(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:wl(e)},s=this._parseSync({data:e,path:r.path,parent:r});return VT(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:wl(e)};if(!this["~standard"].async)try{const i=this._parseSync({data:e,path:[],parent:n});return mf(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=>mf(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:wl(e)},s=this._parse({data:e,path:r.path,parent:r}),i=await(yv(s)?s:Promise.resolve(s));return VT(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:Pe.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 vf({schema:this,typeName:wt.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 Hl.create(this,this._def)}nullable(){return yf.create(this,this._def)}nullish(){return this.nullable().optional()}array(){return Go.create(this)}promise(){return xv.create(this,this._def)}or(e){return wv.create([this,e],this._def)}and(e){return bv.create(this,e,this._def)}transform(e){return new vf({...Ot(this._def),schema:this,typeName:wt.ZodEffects,effect:{type:"transform",transform:e}})}default(e){const n=typeof e=="function"?e:()=>e;return new x2({...Ot(this._def),innerType:this,defaultValue:n,typeName:wt.ZodDefault})}brand(){return new _Y({typeName:wt.ZodBranded,type:this,...Ot(this._def)})}catch(e){const n=typeof e=="function"?e:()=>e;return new S2({...Ot(this._def),innerType:this,catchValue:n,typeName:wt.ZodCatch})}describe(e){const n=this.constructor;return new n({...this._def,description:e})}pipe(e){return ZS.create(this,e)}readonly(){return k2.create(this)}isOptional(){return this.safeParse(void 0).success}isNullable(){return this.safeParse(null).success}}const Xq=/^c[^\s-]{8,}$/i,Qq=/^[0-9a-z]+$/,Jq=/^[0-9A-HJKMNP-TV-Z]{26}$/i,eY=/^[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,tY=/^[a-z0-9_-]{21}$/i,nY=/^[A-Za-z0-9-_]+\.[A-Za-z0-9-_]+\.[A-Za-z0-9-_]*$/,rY=/^[-+]?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)?)??$/,sY=/^(?!\.)(?!.*\.\.)([A-Z0-9_'+\-\.]*)[A-Z0-9_+-]@([A-Z0-9][A-Z0-9\-]*\.)+[A-Z]{2,}$/i,iY="^[\\p{Extended_Pictographic}\\p{Emoji_Component}]+$";let Sw;const oY=/^(?:(?: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])$/,aY=/^(?:(?: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])$/,lY=/^(([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]))$/,cY=/^(([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])$/,uY=/^([0-9a-zA-Z+/]{4})*(([0-9a-zA-Z+/]{2}==)|([0-9a-zA-Z+/]{3}=))?$/,dY=/^([0-9a-zA-Z-_]{4})*(([0-9a-zA-Z-_]{2}(==)?)|([0-9a-zA-Z-_]{3}(=)?))?$/,E5="((\\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])))",fY=new RegExp(`^${E5}$`);function C5(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 hY(t){return new RegExp(`^${C5(t)}$`)}function pY(t){let e=`${E5}T${C5(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 mY(t,e){return!!((e==="v4"||!e)&&oY.test(t)||(e==="v6"||!e)&&lY.test(t))}function gY(t,e){if(!nY.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 vY(t,e){return!!((e==="v4"||!e)&&aY.test(t)||(e==="v6"||!e)&&cY.test(t))}class Ll extends Kt{_parse(e){if(this._def.coerce&&(e.data=String(e.data)),this._getType(e)!==Ye.string){const i=this._getOrReturnCtx(e);return je(i,{code:Pe.invalid_type,expected:Ye.string,received:i.parsedType}),_t}const r=new _i;let s;for(const i of this._def.checks)if(i.kind==="min")e.data.length<i.value&&(s=this._getOrReturnCtx(e,s),je(s,{code:Pe.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),je(s,{code:Pe.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?je(s,{code:Pe.too_big,maximum:i.value,type:"string",inclusive:!0,exact:!0,message:i.message}):l&&je(s,{code:Pe.too_small,minimum:i.value,type:"string",inclusive:!0,exact:!0,message:i.message}),r.dirty())}else if(i.kind==="email")sY.test(e.data)||(s=this._getOrReturnCtx(e,s),je(s,{validation:"email",code:Pe.invalid_string,message:i.message}),r.dirty());else if(i.kind==="emoji")Sw||(Sw=new RegExp(iY,"u")),Sw.test(e.data)||(s=this._getOrReturnCtx(e,s),je(s,{validation:"emoji",code:Pe.invalid_string,message:i.message}),r.dirty());else if(i.kind==="uuid")eY.test(e.data)||(s=this._getOrReturnCtx(e,s),je(s,{validation:"uuid",code:Pe.invalid_string,message:i.message}),r.dirty());else if(i.kind==="nanoid")tY.test(e.data)||(s=this._getOrReturnCtx(e,s),je(s,{validation:"nanoid",code:Pe.invalid_string,message:i.message}),r.dirty());else if(i.kind==="cuid")Xq.test(e.data)||(s=this._getOrReturnCtx(e,s),je(s,{validation:"cuid",code:Pe.invalid_string,message:i.message}),r.dirty());else if(i.kind==="cuid2")Qq.test(e.data)||(s=this._getOrReturnCtx(e,s),je(s,{validation:"cuid2",code:Pe.invalid_string,message:i.message}),r.dirty());else if(i.kind==="ulid")Jq.test(e.data)||(s=this._getOrReturnCtx(e,s),je(s,{validation:"ulid",code:Pe.invalid_string,message:i.message}),r.dirty());else if(i.kind==="url")try{new URL(e.data)}catch{s=this._getOrReturnCtx(e,s),je(s,{validation:"url",code:Pe.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),je(s,{validation:"regex",code:Pe.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),je(s,{code:Pe.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),je(s,{code:Pe.invalid_string,validation:{startsWith:i.value},message:i.message}),r.dirty()):i.kind==="endsWith"?e.data.endsWith(i.value)||(s=this._getOrReturnCtx(e,s),je(s,{code:Pe.invalid_string,validation:{endsWith:i.value},message:i.message}),r.dirty()):i.kind==="datetime"?pY(i).test(e.data)||(s=this._getOrReturnCtx(e,s),je(s,{code:Pe.invalid_string,validation:"datetime",message:i.message}),r.dirty()):i.kind==="date"?fY.test(e.data)||(s=this._getOrReturnCtx(e,s),je(s,{code:Pe.invalid_string,validation:"date",message:i.message}),r.dirty()):i.kind==="time"?hY(i).test(e.data)||(s=this._getOrReturnCtx(e,s),je(s,{code:Pe.invalid_string,validation:"time",message:i.message}),r.dirty()):i.kind==="duration"?rY.test(e.data)||(s=this._getOrReturnCtx(e,s),je(s,{validation:"duration",code:Pe.invalid_string,message:i.message}),r.dirty()):i.kind==="ip"?mY(e.data,i.version)||(s=this._getOrReturnCtx(e,s),je(s,{validation:"ip",code:Pe.invalid_string,message:i.message}),r.dirty()):i.kind==="jwt"?gY(e.data,i.alg)||(s=this._getOrReturnCtx(e,s),je(s,{validation:"jwt",code:Pe.invalid_string,message:i.message}),r.dirty()):i.kind==="cidr"?vY(e.data,i.version)||(s=this._getOrReturnCtx(e,s),je(s,{validation:"cidr",code:Pe.invalid_string,message:i.message}),r.dirty()):i.kind==="base64"?uY.test(e.data)||(s=this._getOrReturnCtx(e,s),je(s,{validation:"base64",code:Pe.invalid_string,message:i.message}),r.dirty()):i.kind==="base64url"?dY.test(e.data)||(s=this._getOrReturnCtx(e,s),je(s,{validation:"base64url",code:Pe.invalid_string,message:i.message}),r.dirty()):Xt.assertNever(i);return{status:r.value,value:e.data}}_regex(e,n,r){return this.refinement(s=>e.test(s),{validation:n,code:Pe.invalid_string,...tt.errToObj(r)})}_addCheck(e){return new Ll({...this._def,checks:[...this._def.checks,e]})}email(e){return this._addCheck({kind:"email",...tt.errToObj(e)})}url(e){return this._addCheck({kind:"url",...tt.errToObj(e)})}emoji(e){return this._addCheck({kind:"emoji",...tt.errToObj(e)})}uuid(e){return this._addCheck({kind:"uuid",...tt.errToObj(e)})}nanoid(e){return this._addCheck({kind:"nanoid",...tt.errToObj(e)})}cuid(e){return this._addCheck({kind:"cuid",...tt.errToObj(e)})}cuid2(e){return this._addCheck({kind:"cuid2",...tt.errToObj(e)})}ulid(e){return this._addCheck({kind:"ulid",...tt.errToObj(e)})}base64(e){return this._addCheck({kind:"base64",...tt.errToObj(e)})}base64url(e){return this._addCheck({kind:"base64url",...tt.errToObj(e)})}jwt(e){return this._addCheck({kind:"jwt",...tt.errToObj(e)})}ip(e){return this._addCheck({kind:"ip",...tt.errToObj(e)})}cidr(e){return this._addCheck({kind:"cidr",...tt.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,...tt.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,...tt.errToObj(e==null?void 0:e.message)})}duration(e){return this._addCheck({kind:"duration",...tt.errToObj(e)})}regex(e,n){return this._addCheck({kind:"regex",regex:e,...tt.errToObj(n)})}includes(e,n){return this._addCheck({kind:"includes",value:e,position:n==null?void 0:n.position,...tt.errToObj(n==null?void 0:n.message)})}startsWith(e,n){return this._addCheck({kind:"startsWith",value:e,...tt.errToObj(n)})}endsWith(e,n){return this._addCheck({kind:"endsWith",value:e,...tt.errToObj(n)})}min(e,n){return this._addCheck({kind:"min",value:e,...tt.errToObj(n)})}max(e,n){return this._addCheck({kind:"max",value:e,...tt.errToObj(n)})}length(e,n){return this._addCheck({kind:"length",value:e,...tt.errToObj(n)})}nonempty(e){return this.min(1,tt.errToObj(e))}trim(){return new Ll({...this._def,checks:[...this._def.checks,{kind:"trim"}]})}toLowerCase(){return new Ll({...this._def,checks:[...this._def.checks,{kind:"toLowerCase"}]})}toUpperCase(){return new Ll({...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}}Ll.create=t=>new Ll({checks:[],typeName:wt.ZodString,coerce:(t==null?void 0:t.coerce)??!1,...Ot(t)});function yY(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 Rp extends Kt{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)!==Ye.number){const i=this._getOrReturnCtx(e);return je(i,{code:Pe.invalid_type,expected:Ye.number,received:i.parsedType}),_t}let r;const s=new _i;for(const i of this._def.checks)i.kind==="int"?Xt.isInteger(e.data)||(r=this._getOrReturnCtx(e,r),je(r,{code:Pe.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),je(r,{code:Pe.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),je(r,{code:Pe.too_big,maximum:i.value,type:"number",inclusive:i.inclusive,exact:!1,message:i.message}),s.dirty()):i.kind==="multipleOf"?yY(e.data,i.value)!==0&&(r=this._getOrReturnCtx(e,r),je(r,{code:Pe.not_multiple_of,multipleOf:i.value,message:i.message}),s.dirty()):i.kind==="finite"?Number.isFinite(e.data)||(r=this._getOrReturnCtx(e,r),je(r,{code:Pe.not_finite,message:i.message}),s.dirty()):Xt.assertNever(i);return{status:s.value,value:e.data}}gte(e,n){return this.setLimit("min",e,!0,tt.toString(n))}gt(e,n){return this.setLimit("min",e,!1,tt.toString(n))}lte(e,n){return this.setLimit("max",e,!0,tt.toString(n))}lt(e,n){return this.setLimit("max",e,!1,tt.toString(n))}setLimit(e,n,r,s){return new Rp({...this._def,checks:[...this._def.checks,{kind:e,value:n,inclusive:r,message:tt.toString(s)}]})}_addCheck(e){return new Rp({...this._def,checks:[...this._def.checks,e]})}int(e){return this._addCheck({kind:"int",message:tt.toString(e)})}positive(e){return this._addCheck({kind:"min",value:0,inclusive:!1,message:tt.toString(e)})}negative(e){return this._addCheck({kind:"max",value:0,inclusive:!1,message:tt.toString(e)})}nonpositive(e){return this._addCheck({kind:"max",value:0,inclusive:!0,message:tt.toString(e)})}nonnegative(e){return this._addCheck({kind:"min",value:0,inclusive:!0,message:tt.toString(e)})}multipleOf(e,n){return this._addCheck({kind:"multipleOf",value:e,message:tt.toString(n)})}finite(e){return this._addCheck({kind:"finite",message:tt.toString(e)})}safe(e){return this._addCheck({kind:"min",inclusive:!0,value:Number.MIN_SAFE_INTEGER,message:tt.toString(e)})._addCheck({kind:"max",inclusive:!0,value:Number.MAX_SAFE_INTEGER,message:tt.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"&&Xt.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)}}Rp.create=t=>new Rp({checks:[],typeName:wt.ZodNumber,coerce:(t==null?void 0:t.coerce)||!1,...Ot(t)});class Ap extends Kt{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)!==Ye.bigint)return this._getInvalidInput(e);let r;const s=new _i;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),je(r,{code:Pe.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),je(r,{code:Pe.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),je(r,{code:Pe.not_multiple_of,multipleOf:i.value,message:i.message}),s.dirty()):Xt.assertNever(i);return{status:s.value,value:e.data}}_getInvalidInput(e){const n=this._getOrReturnCtx(e);return je(n,{code:Pe.invalid_type,expected:Ye.bigint,received:n.parsedType}),_t}gte(e,n){return this.setLimit("min",e,!0,tt.toString(n))}gt(e,n){return this.setLimit("min",e,!1,tt.toString(n))}lte(e,n){return this.setLimit("max",e,!0,tt.toString(n))}lt(e,n){return this.setLimit("max",e,!1,tt.toString(n))}setLimit(e,n,r,s){return new Ap({...this._def,checks:[...this._def.checks,{kind:e,value:n,inclusive:r,message:tt.toString(s)}]})}_addCheck(e){return new Ap({...this._def,checks:[...this._def.checks,e]})}positive(e){return this._addCheck({kind:"min",value:BigInt(0),inclusive:!1,message:tt.toString(e)})}negative(e){return this._addCheck({kind:"max",value:BigInt(0),inclusive:!1,message:tt.toString(e)})}nonpositive(e){return this._addCheck({kind:"max",value:BigInt(0),inclusive:!0,message:tt.toString(e)})}nonnegative(e){return this._addCheck({kind:"min",value:BigInt(0),inclusive:!0,message:tt.toString(e)})}multipleOf(e,n){return this._addCheck({kind:"multipleOf",value:e,message:tt.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}}Ap.create=t=>new Ap({checks:[],typeName:wt.ZodBigInt,coerce:(t==null?void 0:t.coerce)??!1,...Ot(t)});class HT extends Kt{_parse(e){if(this._def.coerce&&(e.data=!!e.data),this._getType(e)!==Ye.boolean){const r=this._getOrReturnCtx(e);return je(r,{code:Pe.invalid_type,expected:Ye.boolean,received:r.parsedType}),_t}return Ki(e.data)}}HT.create=t=>new HT({typeName:wt.ZodBoolean,coerce:(t==null?void 0:t.coerce)||!1,...Ot(t)});class _v extends Kt{_parse(e){if(this._def.coerce&&(e.data=new Date(e.data)),this._getType(e)!==Ye.date){const i=this._getOrReturnCtx(e);return je(i,{code:Pe.invalid_type,expected:Ye.date,received:i.parsedType}),_t}if(Number.isNaN(e.data.getTime())){const i=this._getOrReturnCtx(e);return je(i,{code:Pe.invalid_date}),_t}const r=new _i;let s;for(const i of this._def.checks)i.kind==="min"?e.data.getTime()<i.value&&(s=this._getOrReturnCtx(e,s),je(s,{code:Pe.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),je(s,{code:Pe.too_big,message:i.message,inclusive:!0,exact:!1,maximum:i.value,type:"date"}),r.dirty()):Xt.assertNever(i);return{status:r.value,value:new Date(e.data.getTime())}}_addCheck(e){return new _v({...this._def,checks:[...this._def.checks,e]})}min(e,n){return this._addCheck({kind:"min",value:e.getTime(),message:tt.toString(n)})}max(e,n){return this._addCheck({kind:"max",value:e.getTime(),message:tt.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}}_v.create=t=>new _v({checks:[],coerce:(t==null?void 0:t.coerce)||!1,typeName:wt.ZodDate,...Ot(t)});class UT extends Kt{_parse(e){if(this._getType(e)!==Ye.symbol){const r=this._getOrReturnCtx(e);return je(r,{code:Pe.invalid_type,expected:Ye.symbol,received:r.parsedType}),_t}return Ki(e.data)}}UT.create=t=>new UT({typeName:wt.ZodSymbol,...Ot(t)});class ZT extends Kt{_parse(e){if(this._getType(e)!==Ye.undefined){const r=this._getOrReturnCtx(e);return je(r,{code:Pe.invalid_type,expected:Ye.undefined,received:r.parsedType}),_t}return Ki(e.data)}}ZT.create=t=>new ZT({typeName:wt.ZodUndefined,...Ot(t)});class BT extends Kt{_parse(e){if(this._getType(e)!==Ye.null){const r=this._getOrReturnCtx(e);return je(r,{code:Pe.invalid_type,expected:Ye.null,received:r.parsedType}),_t}return Ki(e.data)}}BT.create=t=>new BT({typeName:wt.ZodNull,...Ot(t)});class WT extends Kt{constructor(){super(...arguments),this._any=!0}_parse(e){return Ki(e.data)}}WT.create=t=>new WT({typeName:wt.ZodAny,...Ot(t)});class KT extends Kt{constructor(){super(...arguments),this._unknown=!0}_parse(e){return Ki(e.data)}}KT.create=t=>new KT({typeName:wt.ZodUnknown,...Ot(t)});class Xl extends Kt{_parse(e){const n=this._getOrReturnCtx(e);return je(n,{code:Pe.invalid_type,expected:Ye.never,received:n.parsedType}),_t}}Xl.create=t=>new Xl({typeName:wt.ZodNever,...Ot(t)});class GT extends Kt{_parse(e){if(this._getType(e)!==Ye.undefined){const r=this._getOrReturnCtx(e);return je(r,{code:Pe.invalid_type,expected:Ye.void,received:r.parsedType}),_t}return Ki(e.data)}}GT.create=t=>new GT({typeName:wt.ZodVoid,...Ot(t)});class Go extends Kt{_parse(e){const{ctx:n,status:r}=this._processInputParams(e),s=this._def;if(n.parsedType!==Ye.array)return je(n,{code:Pe.invalid_type,expected:Ye.array,received:n.parsedType}),_t;if(s.exactLength!==null){const o=n.data.length>s.exactLength.value,l=n.data.length<s.exactLength.value;(o||l)&&(je(n,{code:o?Pe.too_big:Pe.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&&(je(n,{code:Pe.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&&(je(n,{code:Pe.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 Yl(n,o,n.path,l)))).then(o=>_i.mergeArray(r,o));const i=[...n.data].map((o,l)=>s.type._parseSync(new Yl(n,o,n.path,l)));return _i.mergeArray(r,i)}get element(){return this._def.type}min(e,n){return new Go({...this._def,minLength:{value:e,message:tt.toString(n)}})}max(e,n){return new Go({...this._def,maxLength:{value:e,message:tt.toString(n)}})}length(e,n){return new Go({...this._def,exactLength:{value:e,message:tt.toString(n)}})}nonempty(e){return this.min(1,e)}}Go.create=(t,e)=>new Go({type:t,minLength:null,maxLength:null,exactLength:null,typeName:wt.ZodArray,...Ot(e)});function yd(t){if(t instanceof dr){const e={};for(const n in t.shape){const r=t.shape[n];e[n]=Hl.create(yd(r))}return new dr({...t._def,shape:()=>e})}else return t instanceof Go?new Go({...t._def,type:yd(t.element)}):t instanceof Hl?Hl.create(yd(t.unwrap())):t instanceof yf?yf.create(yd(t.unwrap())):t instanceof _u?_u.create(t.items.map(e=>yd(e))):t}class dr extends Kt{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=Xt.objectKeys(e);return this._cached={shape:e,keys:n},this._cached}_parse(e){if(this._getType(e)!==Ye.object){const d=this._getOrReturnCtx(e);return je(d,{code:Pe.invalid_type,expected:Ye.object,received:d.parsedType}),_t}const{status:r,ctx:s}=this._processInputParams(e),{shape:i,keys:o}=this._getCached(),l=[];if(!(this._def.catchall instanceof Xl&&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 Yl(s,h,s.path,d)),alwaysSet:d in s.data})}if(this._def.catchall instanceof Xl){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&&(je(s,{code:Pe.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 Yl(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,m=await f.value;d.push({key:h,value:m,alwaysSet:f.alwaysSet})}return d}).then(d=>_i.mergeObjectSync(r,d)):_i.mergeObjectSync(r,u)}get shape(){return this._def.shape()}strict(e){return tt.errToObj,new dr({...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:tt.errToObj(e).message??s}:{message:s}}}:{}})}strip(){return new dr({...this._def,unknownKeys:"strip"})}passthrough(){return new dr({...this._def,unknownKeys:"passthrough"})}extend(e){return new dr({...this._def,shape:()=>({...this._def.shape(),...e})})}merge(e){return new dr({unknownKeys:e._def.unknownKeys,catchall:e._def.catchall,shape:()=>({...this._def.shape(),...e._def.shape()}),typeName:wt.ZodObject})}setKey(e,n){return this.augment({[e]:n})}catchall(e){return new dr({...this._def,catchall:e})}pick(e){const n={};for(const r of Xt.objectKeys(e))e[r]&&this.shape[r]&&(n[r]=this.shape[r]);return new dr({...this._def,shape:()=>n})}omit(e){const n={};for(const r of Xt.objectKeys(this.shape))e[r]||(n[r]=this.shape[r]);return new dr({...this._def,shape:()=>n})}deepPartial(){return yd(this)}partial(e){const n={};for(const r of Xt.objectKeys(this.shape)){const s=this.shape[r];e&&!e[r]?n[r]=s:n[r]=s.optional()}return new dr({...this._def,shape:()=>n})}required(e){const n={};for(const r of Xt.objectKeys(this.shape))if(e&&!e[r])n[r]=this.shape[r];else{let i=this.shape[r];for(;i instanceof Hl;)i=i._def.innerType;n[r]=i}return new dr({...this._def,shape:()=>n})}keyof(){return P5(Xt.objectKeys(this.shape))}}dr.create=(t,e)=>new dr({shape:()=>t,unknownKeys:"strip",catchall:Xl.create(),typeName:wt.ZodObject,...Ot(e)});dr.strictCreate=(t,e)=>new dr({shape:()=>t,unknownKeys:"strict",catchall:Xl.create(),typeName:wt.ZodObject,...Ot(e)});dr.lazycreate=(t,e)=>new dr({shape:t,unknownKeys:"strip",catchall:Xl.create(),typeName:wt.ZodObject,...Ot(e)});class wv extends Kt{_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 Fa(l.ctx.common.issues));return je(n,{code:Pe.invalid_union,unionErrors:o}),_t}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 Fa(u));return je(n,{code:Pe.invalid_union,unionErrors:l}),_t}}get options(){return this._def.options}}wv.create=(t,e)=>new wv({options:t,typeName:wt.ZodUnion,...Ot(e)});function b2(t,e){const n=wl(t),r=wl(e);if(t===e)return{valid:!0,data:t};if(n===Ye.object&&r===Ye.object){const s=Xt.objectKeys(e),i=Xt.objectKeys(t).filter(l=>s.indexOf(l)!==-1),o={...t,...e};Object.prototype.hasOwnProperty.call(o,"__proto__")&&delete o.__proto__;for(const l of i){if(l==="__proto__")continue;const u=b2(t[l],e[l]);if(!u.valid)return{valid:!1};o[l]=u.data}return{valid:!0,data:o}}else if(n===Ye.array&&r===Ye.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=b2(o,l);if(!u.valid)return{valid:!1};s.push(u.data)}return{valid:!0,data:s}}else return n===Ye.date&&r===Ye.date&&+t==+e?{valid:!0,data:t}:{valid:!1}}class bv extends Kt{_parse(e){const{status:n,ctx:r}=this._processInputParams(e),s=(i,o)=>{if(jT(i)||jT(o))return _t;const l=b2(i.value,o.value);return l.valid?((zT(i)||zT(o))&&n.dirty(),{status:n.value,value:l.data}):(je(r,{code:Pe.invalid_intersection_types}),_t)};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}))}}bv.create=(t,e,n)=>new bv({left:t,right:e,typeName:wt.ZodIntersection,...Ot(n)});class _u extends Kt{_parse(e){const{status:n,ctx:r}=this._processInputParams(e);if(r.parsedType!==Ye.array)return je(r,{code:Pe.invalid_type,expected:Ye.array,received:r.parsedType}),_t;if(r.data.length<this._def.items.length)return je(r,{code:Pe.too_small,minimum:this._def.items.length,inclusive:!0,exact:!1,type:"array"}),_t;!this._def.rest&&r.data.length>this._def.items.length&&(je(r,{code:Pe.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 Yl(r,o,r.path,l)):null}).filter(o=>!!o);return r.common.async?Promise.all(i).then(o=>_i.mergeArray(n,o)):_i.mergeArray(n,i)}get items(){return this._def.items}rest(e){return new _u({...this._def,rest:e})}}_u.create=(t,e)=>{if(!Array.isArray(t))throw new Error("You must pass an array of schemas to z.tuple([ ... ])");return new _u({items:t,typeName:wt.ZodTuple,rest:null,...Ot(e)})};class qT extends Kt{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!==Ye.map)return je(r,{code:Pe.invalid_type,expected:Ye.map,received:r.parsedType}),_t;const s=this._def.keyType,i=this._def.valueType,o=[...r.data.entries()].map(([l,u],d)=>({key:s._parse(new Yl(r,l,r.path,[d,"key"])),value:i._parse(new Yl(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 _t;(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 _t;(d.status==="dirty"||f.status==="dirty")&&n.dirty(),l.set(d.value,f.value)}return{status:n.value,value:l}}}}qT.create=(t,e,n)=>new qT({valueType:e,keyType:t,typeName:wt.ZodMap,...Ot(n)});class Ip extends Kt{_parse(e){const{status:n,ctx:r}=this._processInputParams(e);if(r.parsedType!==Ye.set)return je(r,{code:Pe.invalid_type,expected:Ye.set,received:r.parsedType}),_t;const s=this._def;s.minSize!==null&&r.data.size<s.minSize.value&&(je(r,{code:Pe.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&&(je(r,{code:Pe.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 _t;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 Yl(r,u,r.path,d)));return r.common.async?Promise.all(l).then(u=>o(u)):o(l)}min(e,n){return new Ip({...this._def,minSize:{value:e,message:tt.toString(n)}})}max(e,n){return new Ip({...this._def,maxSize:{value:e,message:tt.toString(n)}})}size(e,n){return this.min(e,n).max(e,n)}nonempty(e){return this.min(1,e)}}Ip.create=(t,e)=>new Ip({valueType:t,minSize:null,maxSize:null,typeName:wt.ZodSet,...Ot(e)});class YT extends Kt{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})}}YT.create=(t,e)=>new YT({getter:t,typeName:wt.ZodLazy,...Ot(e)});class XT extends Kt{_parse(e){if(e.data!==this._def.value){const n=this._getOrReturnCtx(e);return je(n,{received:n.data,code:Pe.invalid_literal,expected:this._def.value}),_t}return{status:"valid",value:e.data}}get value(){return this._def.value}}XT.create=(t,e)=>new XT({value:t,typeName:wt.ZodLiteral,...Ot(e)});function P5(t,e){return new gf({values:t,typeName:wt.ZodEnum,...Ot(e)})}class gf extends Kt{_parse(e){if(typeof e.data!="string"){const n=this._getOrReturnCtx(e),r=this._def.values;return je(n,{expected:Xt.joinValues(r),received:n.parsedType,code:Pe.invalid_type}),_t}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 je(n,{received:n.data,code:Pe.invalid_enum_value,options:r}),_t}return Ki(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 gf.create(e,{...this._def,...n})}exclude(e,n=this._def){return gf.create(this.options.filter(r=>!e.includes(r)),{...this._def,...n})}}gf.create=P5;class QT extends Kt{_parse(e){const n=Xt.getValidEnumValues(this._def.values),r=this._getOrReturnCtx(e);if(r.parsedType!==Ye.string&&r.parsedType!==Ye.number){const s=Xt.objectValues(n);return je(r,{expected:Xt.joinValues(s),received:r.parsedType,code:Pe.invalid_type}),_t}if(this._cache||(this._cache=new Set(Xt.getValidEnumValues(this._def.values))),!this._cache.has(e.data)){const s=Xt.objectValues(n);return je(r,{received:r.data,code:Pe.invalid_enum_value,options:s}),_t}return Ki(e.data)}get enum(){return this._def.values}}QT.create=(t,e)=>new QT({values:t,typeName:wt.ZodNativeEnum,...Ot(e)});class xv extends Kt{unwrap(){return this._def.type}_parse(e){const{ctx:n}=this._processInputParams(e);if(n.parsedType!==Ye.promise&&n.common.async===!1)return je(n,{code:Pe.invalid_type,expected:Ye.promise,received:n.parsedType}),_t;const r=n.parsedType===Ye.promise?n.data:Promise.resolve(n.data);return Ki(r.then(s=>this._def.type.parseAsync(s,{path:n.path,errorMap:n.common.contextualErrorMap})))}}xv.create=(t,e)=>new xv({type:t,typeName:wt.ZodPromise,...Ot(e)});class vf extends Kt{innerType(){return this._def.schema}sourceType(){return this._def.schema._def.typeName===wt.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=>{je(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 _t;const u=await this._def.schema._parseAsync({data:l,path:r.path,parent:r});return u.status==="aborted"?_t:u.status==="dirty"||n.value==="dirty"?Zh(u.value):u});{if(n.value==="aborted")return _t;const l=this._def.schema._parseSync({data:o,path:r.path,parent:r});return l.status==="aborted"?_t:l.status==="dirty"||n.value==="dirty"?Zh(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"?_t:(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"?_t:(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(!mf(o))return _t;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=>mf(o)?Promise.resolve(s.transform(o.value,i)).then(l=>({status:n.value,value:l})):_t);Xt.assertNever(s)}}vf.create=(t,e,n)=>new vf({schema:t,typeName:wt.ZodEffects,effect:e,...Ot(n)});vf.createWithPreprocess=(t,e,n)=>new vf({schema:e,effect:{type:"preprocess",transform:t},typeName:wt.ZodEffects,...Ot(n)});class Hl extends Kt{_parse(e){return this._getType(e)===Ye.undefined?Ki(void 0):this._def.innerType._parse(e)}unwrap(){return this._def.innerType}}Hl.create=(t,e)=>new Hl({innerType:t,typeName:wt.ZodOptional,...Ot(e)});class yf extends Kt{_parse(e){return this._getType(e)===Ye.null?Ki(null):this._def.innerType._parse(e)}unwrap(){return this._def.innerType}}yf.create=(t,e)=>new yf({innerType:t,typeName:wt.ZodNullable,...Ot(e)});class x2 extends Kt{_parse(e){const{ctx:n}=this._processInputParams(e);let r=n.data;return n.parsedType===Ye.undefined&&(r=this._def.defaultValue()),this._def.innerType._parse({data:r,path:n.path,parent:n})}removeDefault(){return this._def.innerType}}x2.create=(t,e)=>new x2({innerType:t,typeName:wt.ZodDefault,defaultValue:typeof e.default=="function"?e.default:()=>e.default,...Ot(e)});class S2 extends Kt{_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 yv(s)?s.then(i=>({status:"valid",value:i.status==="valid"?i.value:this._def.catchValue({get error(){return new Fa(r.common.issues)},input:r.data})})):{status:"valid",value:s.status==="valid"?s.value:this._def.catchValue({get error(){return new Fa(r.common.issues)},input:r.data})}}removeCatch(){return this._def.innerType}}S2.create=(t,e)=>new S2({innerType:t,typeName:wt.ZodCatch,catchValue:typeof e.catch=="function"?e.catch:()=>e.catch,...Ot(e)});class JT extends Kt{_parse(e){if(this._getType(e)!==Ye.nan){const r=this._getOrReturnCtx(e);return je(r,{code:Pe.invalid_type,expected:Ye.nan,received:r.parsedType}),_t}return{status:"valid",value:e.data}}}JT.create=t=>new JT({typeName:wt.ZodNaN,...Ot(t)});class _Y extends Kt{_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 ZS extends Kt{_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"?_t:i.status==="dirty"?(n.dirty(),Zh(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"?_t: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 ZS({in:e,out:n,typeName:wt.ZodPipeline})}}class k2 extends Kt{_parse(e){const n=this._def.innerType._parse(e),r=s=>(mf(s)&&(s.value=Object.freeze(s.value)),s);return yv(n)?n.then(s=>r(s)):r(n)}unwrap(){return this._def.innerType}}k2.create=(t,e)=>new k2({innerType:t,typeName:wt.ZodReadonly,...Ot(e)});var wt;(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"})(wt||(wt={}));const Cd=Ll.create;Xl.create;const wY=Go.create,T5=dr.create;wv.create;bv.create;_u.create;const bY=gf.create;xv.create;Hl.create;yf.create;const xY=T5({hash:Cd().regex(/^[a-f0-9]{64}$/),mimeType:bY(["image/png","image/jpeg","image/webp","image/gif","image/avif"])}),R5=T5({id:Cd().min(1),title:Cd().trim().min(1),url:Cd().url().refine(t=>{try{const e=new URL(t);return["http:","https:"].includes(e.protocol)&&!e.username&&!e.password}catch{return!1}}).optional(),reason:Cd().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=R5.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=6,Op=100,eR=100,EY=35*1024*1024,tR=Math.ceil(EY/3)*4,CY=jt(["pinterest","arena","x","cosmos"]),BS=jt(["image",...CY.options,"text","pdf","variant"]),pm=jt(["codex","claude","cursor"]),A5=ze({projectId:re().min(1).max(200),sessionId:re().min(1).max(200),variantId:re().min(1).max(200)}).strict();A5.extend({runtime:pm,note:re().trim().max(500).optional(),imageFile:re().min(1).max(2048).optional()});const I5=A5.extend({treeSha:re().max(100).optional()}),PY=ze({hash:re().regex(/^[a-f0-9]{64}$/),mimeType:jt(["image/png","image/jpeg","image/webp","image/gif"]),bytes:An().int().positive(),representation:jt(["image","video-cover","page","variant"]).default("image"),page:An().int().positive().optional()});ze({provider:BS,remoteId:re().trim().min(1).max(2048),title:re().trim().min(1).max(500),url:re().url().optional()});const O5=ze({provider:BS,remoteId:re().trim().min(1).max(2048),title:re().max(1e3),text:re().max(1e5),url:re().url().optional(),media:Tt(PY).max(100),remoteImages:Tt(re().url()).max(100).optional(),remoteImageRepresentations:Tt(jt(["image","video-cover"])).max(100).optional(),unsupportedReason:re().max(1e3).optional(),variant:I5.optional(),note:re().max(500).optional()}),M5=ze({inputTokens:An().nonnegative().optional(),outputTokens:An().nonnegative().optional(),cachedInputTokens:An().nonnegative().optional(),allocation:pf("equal-share").optional()}),Vpe=ze({referenceId:re().min(1),revision:An().int().positive(),description:re().trim().min(1).max(8e3),runtime:hm([pm,pf("user")]),evidence:jt(["observation","preference"]),usage:M5.optional()}),Hpe=O5.extend({id:re(),revision:An()}),TY=ze({requestId:re().min(1).max(200),instruction:re().min(1).max(3e4),runtime:pm,mode:jt(["auto","off","uploads"]).default("off"),excludedSourceIds:Tt(re()).max(100).default([]),excludedReferenceIds:Tt(re()).max(100).default([]),excludedMediaHashes:Tt(re()).max(100).default([]),suppliedInputHashes:Tt(re().regex(/^[a-f0-9]{64}$/)).max(Op).optional()});TY.extend({mode:jt(["auto","off","uploads"]).default("uploads"),uploads:Tt(re().max(tR+eR)).max(Op).optional()}).refine(t=>(t.uploads??[]).reduce((e,n)=>e+n.length,0)<=tR+Op*eR,"Supplied images exceed the profile upload budget");const RY=y2().transform((t,e)=>{const n=R5.safeParse(t);return n.success?n.data:(e.addIssue({code:x5.custom,message:"Invalid supplied image reference"}),NL)}),nR=ze({suppliedReferences:Tt(RY).max(Op).optional(),failedUploadCount:An().int().min(0).max(Op).optional(),usage:M5.optional(),requestId:re(),status:jt(["selected","empty","off","unavailable","timeout"]),queries:Tt(re()),candidateIds:Tt(re()),selected:Tt(ze({id:re(),revision:An(),title:re().optional(),url:re().url().optional(),mediaHashes:Tt(re().regex(/^[a-f0-9]{64}$/)).optional(),reason:re(),sourceTitles:Tt(re()),variant:I5.optional()})),contextText:re().max(6e3),images:Tt(ze({path:re(),hash:re().regex(/^[a-f0-9]{64}$/),mimeType:jt(["image/png","image/jpeg","image/webp","image/gif"])})).max(kY),durationMs:An()});nR.pick({requestId:!0,suppliedReferences:!0,failedUploadCount:!0,status:!0,selected:!0,images:!0,durationMs:!0}).extend({requestId:re().min(1).max(200),selected:nR.shape.selected.max(3)});const Upe=200,WS=ze({id:re(),name:re(),pinnedAt:re().nullable().optional(),lastOpenedAt:re(),projectPath:re(),isAvailable:Zs(),storageKind:jt(["project","bundle"]),issue:re().optional(),historyIssue:re().optional()}),AY=ze({dataUrl:re(),label:re(),capturedAt:re()}),IY=ze({projectId:re(),sessionId:re(),variantId:re(),label:re(),brief:re(),createdAt:re(),hasStaticPreview:Zs(),hasInteractivePreview:Zs()}),Zpe=ze({projects:Tt(WS),variants:Tt(IY)}),L5=ze({error:re()}),OY=ze({errorCode:re(),message:re()}),MY=ze({error:re().optional(),details:hm([re(),ze({formErrors:Tt(re()).optional(),fieldErrors:US(re(),Tt(re()).optional()).optional()})]).optional()}),LY=ze({token:re().min(1)}),NY=ze({url:re().url()}),Bpe=ze({projects:Tt(WS)}),Wpe=ze({project:WS}),Kpe=ze({projectId:re()}),Gpe=ze({preview:AY.nullable()}),qpe=ze({projectPath:re().nullable()}),Ype=ze({editorUrl:re()}),Xpe=ze({url:re()}),Qpe=ze({saved:pf(!0)}),DY=ze({requestId:re(),sequence:An(),projectId:re().optional(),sessionId:re().optional(),variantId:re().optional()}),Jpe=ze({navigations:Tt(DY)}),eme=ze({acknowledged:Zs()}),N5=ze({profile:ze({isEnabled:Zs()}),sources:Tt(ze({provider:BS,title:re(),url:re().nullable()}))}),D5=ze({id:re(),revision:re(),collectionCount:An(),referenceCount:An(),imageCount:An(),reusableCount:An(),unsupportedCount:An(),scopeDisclosure:re(),usageDisclosure:re()}),$Y=ze({isAuthenticated:Zs(),email:re().optional(),name:re().optional(),userId:re().optional()}),kw=re().min(1).max(500),$5=ze({pinned:Tt(kw).max(1e3),order:ze({groups:Tt(kw).max(1e3),rows:US(re(),Tt(kw).max(1e3))})}),FY=ze({projectPath:re(),uiState:$5});ze({uiState:$5,projectPath:re().optional()});const jY=t=>LY.parse(t).token,rR="The library returned an invalid response.",my="rivet_library_token";let ja="",_f=0,Ma=null,Sv=null,sR=!1;const E2=new Set,Mp=()=>E2.forEach(t=>t()),tme=()=>Ma??Sv,nme=()=>_f,Lp=()=>{try{const t=window.localStorage.getItem(my)??"";ja!==t&&(_f+=1),ja=t,Ma=null}catch{Ma="Rivet cannot access browser storage. Allow site storage and try again."}},F5=()=>{sR||(window.addEventListener("storage",t=>{t.key!==my&&t.key!==null||(Lp(),Mp())}),sR=!0)},rme=()=>!!ja,sme=t=>(F5(),E2.add(t),()=>E2.delete(t)),zY=(t,e)=>{if(e!==void 0&&Lp(),e!==void 0&&e!==_f)throw new Error("Sign-in was cancelled because the browser login changed.");try{window.localStorage.setItem(my,t)}catch{throw Ma="Rivet cannot save browser access. Allow site storage and try again.",Mp(),new Error(Ma)}ja=t,_f+=1,Ma=null,Sv=null,Mp()},j5=()=>{ja="",_f+=1,Ma=null;try{window.localStorage.removeItem(my)}catch{Ma="Rivet cannot clear browser storage. Allow site storage and try again."}Mp()},VY=async()=>{if(!window.location.pathname.startsWith("/rivet/library"))return;F5(),Lp();const t=_f,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){zY(jY(await n.json()),t);return}n.status>=500&&!ja&&(Sv="Rivet is temporarily unavailable. Please retry this link.")}catch{!ja&&!Ma&&(Sv="Rivet could not open this link. Please retry when the server is available.")}}Mp()},z5=async(t,e={})=>{Lp();const n=ja,r=new Headers(e.headers);r.set("Authorization",`Bearer ${n}`);const s=await fetch(t,{...e,headers:r});return s.status===401&&(Lp(),ja===n&&j5()),s},HY=async(t,{schema:e,...n})=>{const r=await z5(`/api/library${t}`,{method:n.method??"GET",signal:n.signal,headers:{"Content-Type":"application/json"},...n.body!==void 0?{body:JSON.stringify(n.body)}:{}});return UY(r,e)},UY=async(t,e)=>{const n=await t.text();let r;try{r=JSON.parse(n)}catch{if(t.ok)throw new Error(rR)}if(!t.ok){if(t.status===401)throw new Error("Sign in to access this library.");const i=L5.safeParse(r),o=i.success&&i.data.error.trim()?i.data.error:`Library request failed (${t.status}).`;throw new Error(o)}const s=e.safeParse(r);if(!s.success)throw new Error(rR);return s.data},Dt=(t,e={})=>{if(!window.location.pathname.startsWith("/rivet/library")){const n=new Headers(e.headers),r=H7();return r&&z7(t,e.method)&&n.set($7,r),fetch(t,{...e,headers:n,redirect:"error"})}return z5(t,e)};let V5="off";const iR=t=>{V5=t},ZY=()=>V5==="full",H5=({userId:t,email:e})=>{ZY()&&(t?(Xe.identify(t,e?{email:e}:{}),e&&Xe.alias(e,t)):e&&Xe.identify(e,{email:e}))},BY="phc_Ntj9tXHbS64XgYxlTfhglRmFivFsfm0AERph4ZlnNH",WY=3e3,KY=/^plugin-[0-9a-f]{8}-[0-9a-f]{4}-4[0-9a-f]{3}-[89ab][0-9a-f]{3}-[0-9a-f]{12}$/,GY=t=>({person_profiles:"never",autocapture:!1,opt_out_useragent_filter:!0,capture_pageview:!1,capture_pageleave:!1,capture_exceptions:!1,capture_performance:!1,disable_session_recording:!0,enable_recording_console_log:!1,disable_external_dependency_loading:!0,disable_surveys:!0,advanced_disable_flags:!0,advanced_disable_feature_flags:!0,mask_all_text:!0,mask_all_element_attributes:!0,persistence:"memory",bootstrap:{distinctID:t,isIdentifiedID:!1},before_send:e=>{const n=Kq(e.event,e.properties);return n&&Dt("/api/telemetry/events",{method:"POST",credentials:"same-origin",headers:{"Content-Type":"application/json"},body:JSON.stringify({event:e.event,properties:n}),keepalive:!0}).catch(()=>{}),null}}),qY=async()=>{try{const t=await Dt("/api/telemetry",{signal:AbortSignal.timeout(WY),cache:"no-store"});if(!t.ok)return;const e=await t.json();if(e.mode!=="full"&&e.mode!=="metrics"||e.mode==="metrics"&&(typeof e.distinctId!="string"||!KY.test(e.distinctId)))return;const n=e.mode,s={api_host:"https://rivet-proxy.onrender.com/ingest",ui_host:"https://us.posthog.com",person_profiles:"always",capture_exceptions:!0,autocapture:!0,capture_pageview:!0,capture_performance:!0,persistence:"localStorage",...{session_recording:{maskAllInputs:!0,maskTextSelector:"[data-rivet-private]",blockSelector:"iframe[data-rivet-private]"}},mask_all_text:!1,mask_all_element_attributes:!1,loaded:i=>i.register({source:"visual_editor",surface:"visual_editor",telemetry_version:2,rivet_version:"0.28.1",env:"production"})};n==="metrics"&&Object.assign(s,GY(e.distinctId),{api_host:window.location.origin}),Xe.init(BY,s),iR(n)}catch{iR("off")}},U5=v.createContext(void 0),mm=t=>{const e=v.useContext(U5);if(!e)throw new Error("No QueryClient set, use QueryClientProvider to set one");return e},YY=({client:t,children:e})=>(v.useEffect(()=>(t.mount(),()=>{t.unmount()}),[t]),T.jsx(U5.Provider,{value:t,children:e})),XY={setTimeout:(t,e)=>setTimeout(t,e),clearTimeout:t=>clearTimeout(t),setInterval:(t,e)=>setInterval(t,e),clearInterval:t=>clearInterval(t)};var xl,iS,jI,QY=(jI=class{constructor(){rt(this,xl,XY);rt(this,iS,!1)}setTimeoutProvider(t){De(this,xl,t)}setTimeout(t,e){return B(this,xl).setTimeout(t,e)}clearTimeout(t){B(this,xl).clearTimeout(t)}setInterval(t,e){return B(this,xl).setInterval(t,e)}clearInterval(t){B(this,xl).clearInterval(t)}},xl=new WeakMap,iS=new WeakMap,jI);const Zc=new QY;function JY(t){setTimeout(t,0)}const eX=typeof window>"u"||"Deno"in globalThis;function ks(){}function tX(t,e){return typeof t=="function"?t(e):t}function Z5(t){return typeof t=="number"&&t>=0&&t!==1/0}function B5(t,e){return Math.max(t+(e||0)-Date.now(),0)}function Ln(t,e){return typeof t=="function"?t(e):t}function oR(t,e){const{type:n="all",exact:r,fetchStatus:s,predicate:i,queryKey:o,stale:l}=t;if(o){if(r){if(e.queryHash!==KS(o,e.options))return!1}else if(!wf(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 aR(t,e){const{exact:n,status:r,predicate:s,mutationKey:i}=t;if(i){if(!e.options.mutationKey)return!1;if(n){if(wu(e.options.mutationKey)!==wu(i))return!1}else if(!wf(e.options.mutationKey,i))return!1}return!(r&&e.state.status!==r||s&&!s(e))}function KS(t,e){return((e==null?void 0:e.queryKeyHashFn)||wu)(t)}function wu(t){return JSON.stringify(t,(e,n)=>C2(n)?Object.keys(n).sort().reduce((r,s)=>(r[s]=n[s],r),{}):n)}function wf(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(!wf(t[r],e[r]))return!1;return!0}const n=Object.keys(e);for(const r of n)if(!wf(t[r],e[r]))return!1;return!0}return!1}const W5=Object.prototype.hasOwnProperty;function K5(t,e,n=0){if(t===e)return t;if(n>500)return e;const r=lR(t)&&lR(e);if(!r&&!(C2(t)&&C2(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],m=e[f];if(h===m){l[f]=h,(r?d<s:W5.call(t,f))&&u++;continue}if(h===null||m===null||typeof h!="object"||typeof m!="object"){l[f]=m;continue}const g=K5(h,m,n+1);l[f]=g,g===h&&u++}return s===o&&u===s?t:l}function kg(t,e){if(!e||Object.keys(t).length!==Object.keys(e).length)return!1;for(const n of Object.keys(t))if(!W5.call(e,n)||t[n]!==e[n])return!1;return!0}function lR(t){return Array.isArray(t)&&t.length===Object.keys(t).length}function C2(t){if(!cR(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!(!cR(r)||!r.hasOwnProperty("isPrototypeOf")||e!==Object.prototype)}function cR(t){return Object.prototype.toString.call(t)==="[object Object]"}function nX(t){return new Promise(e=>{Zc.setTimeout(e,t)})}function P2(t,e,n){return typeof n.structuralSharing=="function"?n.structuralSharing(t,e):n.structuralSharing!==!1?K5(t,e):e}function rX(t){return t}function sX(t,e,n=0){const r=[...t,e];return n&&r.length>n?r.slice(-n):r}function iX(t,e,n=0){const r=[e,...t];return n&&r.length>n?r.slice(0,n):r}const GS=Symbol();function G5(t,e){return!t.queryFn&&(e!=null&&e.initialPromise)?()=>e.initialPromise:!t.queryFn||t.queryFn===GS?()=>Promise.reject(new Error(`Missing queryFn: '${t.queryHash}'`)):t.queryFn}function qS(t,e){return typeof t=="function"?t(...e):!!t}const YS=Symbol();function oX(t,e,n,r){let s=!1,i;return Object.defineProperties(t,{[YS]:{value:r},signal:{enumerable:!0,get:()=>(i??(i=e()),s||(s=!0,i.aborted?n():i.addEventListener("abort",n,{once:!0})),i)}}),t}let aX=()=>eX;const XS=()=>aX();var Nf=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(){}},Gc,Sl,Zd,zI,lX=(zI=class extends Nf{constructor(){super();rt(this,Gc);rt(this,Sl);rt(this,Zd);De(this,Zd,e=>{if(typeof window<"u"&&window.addEventListener){const n=()=>e();return window.addEventListener("visibilitychange",n,!1),()=>{window.removeEventListener("visibilitychange",n)}}})}onSubscribe(){B(this,Sl)||this.setEventListener(B(this,Zd))}onUnsubscribe(){var e;this.hasListeners()||((e=B(this,Sl))==null||e.call(this),De(this,Sl,void 0))}setEventListener(e){var n;De(this,Zd,e),(n=B(this,Sl))==null||n.call(this),De(this,Sl,e(r=>{typeof r=="boolean"?this.setFocused(r):this.onFocus()}))}setFocused(e){B(this,Gc)!==e&&(De(this,Gc,e),this.onFocus())}onFocus(){const e=this.isFocused();this.listeners.forEach(n=>{n(e)})}isFocused(){var e;return typeof B(this,Gc)=="boolean"?B(this,Gc):((e=globalThis.document)==null?void 0:e.visibilityState)!=="hidden"}},Gc=new WeakMap,Sl=new WeakMap,Zd=new WeakMap,zI);const QS=new lX,cX=JY;function uX(){let t=[],e=0,n=l=>{l()},r=l=>{l()},s=cX;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 kr=uX();var Bd,kl,Wd,VI,dX=(VI=class extends Nf{constructor(){super();rt(this,Bd,!0);rt(this,kl);rt(this,Wd);De(this,Wd,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(){B(this,kl)||this.setEventListener(B(this,Wd))}onUnsubscribe(){var e;this.hasListeners()||((e=B(this,kl))==null||e.call(this),De(this,kl,void 0))}setEventListener(e){var n;De(this,Wd,e),(n=B(this,kl))==null||n.call(this),De(this,kl,e(this.setOnline.bind(this)))}setOnline(e){B(this,Bd)!==e&&(De(this,Bd,e),this.listeners.forEach(n=>{n(e)}))}isOnline(){return B(this,Bd)}},Bd=new WeakMap,kl=new WeakMap,Wd=new WeakMap,VI);const kv=new dX;function fX(t){return Math.min(1e3*2**t,3e4)}function q5(t){return(t??"online")==="online"?kv.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 Y5(t){let e=!1,n=0,r,s="pending",i,o;const l=new Promise((S,E)=>{i=S,o=E});l.catch(ks);const u=()=>s!=="pending",d=S=>{var E;if(!u()){const C=new T2(S);y(C),(E=t.onCancel)==null||E.call(t,C)}},f=()=>{e=!0},h=()=>{e=!1},m=()=>QS.isFocused()&&(t.networkMode==="always"||kv.isOnline())&&t.canRun(),g=()=>q5(t.networkMode)&&t.canRun(),_=S=>{u()||(r==null||r(),s="resolved",i(S))},y=S=>{u()||(r==null||r(),s="rejected",o(S))},b=S=>new Promise(E=>{var C;r=R=>{(u()||S())&&E(R)},(C=t.onPause)==null||C.call(t)}).then(()=>{var E;r=void 0,u()||(E=t.onContinue)==null||E.call(t)}),x=()=>{if(u())return;let S;const E=n===0?t.initialPromise:void 0;try{S=E??t.fn()}catch(C){S=Promise.reject(C)}Promise.resolve(S).then(_).catch(C=>{var L;if(u())return;const R=t.retry??(XS()?0:3),O=t.retryDelay??fX,I=typeof O=="function"?O(n,C):O,A=R===!0||typeof R=="number"&&n<R||typeof R=="function"&&R(n,C);if(e||!A){y(C);return}n++,(L=t.onFail)==null||L.call(t,n,C),nX(I).then(()=>u()||m()?void 0:b(m)).then(()=>{e?y(C):x()})})};return{promise:l,status:()=>s,cancel:d,continue:()=>(r==null||r(),l),cancelRetry:f,continueRetry:h,canStart:g,start:()=>(g()?x():b(g).then(x),l)}}var qc,HI,X5=(HI=class{constructor(){rt(this,qc)}destroy(){this.clearGcTimeout()}scheduleGc(){this.clearGcTimeout(),Z5(this.gcTime)&&De(this,qc,Zc.setTimeout(()=>{this.optionalRemove()},this.gcTime))}updateGcTime(t){this.gcTime=Math.max(this.gcTime||0,t??(XS()?1/0:3e5))}clearGcTimeout(){B(this,qc)!==void 0&&(Zc.clearTimeout(B(this,qc)),De(this,qc,void 0))}},qc=new WeakMap,HI);function hX(t){return{onFetch:(e,n)=>{var f,h,m,g,_;const r=e.options,s=(m=(h=(f=e.fetchOptions)==null?void 0:f.meta)==null?void 0:h.fetchMore)==null?void 0:m.direction,i=((g=e.state.data)==null?void 0:g.pages)||[],o=((_=e.state.data)==null?void 0:_.pageParams)||[];let l={pages:[],pageParams:[]},u=0;const d=async()=>{let y=!1;const b=e,x=C=>{oX(C,()=>e.signal,()=>y=!0,b[YS])},S=G5(e.options,e.fetchOptions),E=async(C,R,O)=>{if(y)return Promise.reject(e.signal.reason);if(R==null&&C.pages.length)return Promise.resolve(C);const A=(()=>{const $={client:e.client,queryKey:e.queryKey,pageParam:R,direction:O?"backward":"forward",meta:e.options.meta};return x($),$})(),L=await S(A),{maxPages:N}=e.options,H=O?iX:sX;return{pages:H(C.pages,L,N),pageParams:H(C.pageParams,R,N)}};if(s&&i.length){const C=s==="backward",R=C?pX:uR,O={pages:i,pageParams:o};l=await E(O,R(r,O),C)}else{const C=t??i.length;do{const R=u===0?o[0]===void 0?r.initialPageParam:o[0]:uR(r,l);if(u>0&&R==null)break;l=await E(l,R),u++}while(u<C)}return l};e.options.persister?e.fetchFn=()=>{var y,b;return(b=(y=e.options).persister)==null?void 0:b.call(y,d,{client:e.client,queryKey:e.queryKey,meta:e.options.meta,signal:e.signal},n)}:e.fetchFn=d}}}function uR(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 pX(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 Kd,Yc,Gd,Fi,Xc,Dr,Ea,om,Qc,lo,wa,UI,mX=(UI=class extends X5{constructor(e){super();rt(this,lo);rt(this,Kd);rt(this,Yc);rt(this,Gd);rt(this,Fi);rt(this,Xc);rt(this,Dr);rt(this,Ea);rt(this,om);rt(this,Qc);De(this,Qc,!1),De(this,om,e.defaultOptions),this.setOptions(e.options),this.observers=[],De(this,Xc,e.client),De(this,Fi,B(this,Xc).getQueryCache()),this.queryKey=e.queryKey,this.queryHash=e.queryHash,De(this,Yc,fR(this.options)),this.state=e.state??B(this,Yc),this.scheduleGc()}get meta(){return this.options.meta}get queryType(){return B(this,Kd)}get promise(){var e;return(e=B(this,Dr))==null?void 0:e.promise}setOptions(e){if(this.options={...B(this,om),...e},e!=null&&e._type&&De(this,Kd,e._type),this.updateGcTime(this.options.gcTime),this.state&&this.state.data===void 0){const n=fR(this.options);n.data!==void 0&&(this.setState(dR(n.data,n.dataUpdatedAt)),De(this,Yc,n))}}optionalRemove(){!this.observers.length&&this.state.fetchStatus==="idle"&&B(this,Fi).remove(this)}setData(e,n){const r=P2(this.state.data,e,this.options);return xt(this,lo,wa).call(this,{data:r,type:"success",dataUpdatedAt:n==null?void 0:n.updatedAt,manual:n==null?void 0:n.manual}),r}setState(e){xt(this,lo,wa).call(this,{type:"setState",state:e})}cancel(e){var r,s;const n=(r=B(this,Dr))==null?void 0:r.promise;return(s=B(this,Dr))==null||s.cancel(e),n?n.then(ks).catch(ks):Promise.resolve()}destroy(){super.destroy(),this.cancel({silent:!0})}get resetState(){return B(this,Yc)}reset(){this.destroy(),this.setState(this.resetState)}isActive(){return this.observers.some(e=>Ln(e.options.enabled,this)!==!1)}isDisabled(){return this.getObserversCount()>0?!this.isActive():this.options.queryFn===GS||!this.isFetched()}isFetched(){return this.state.dataUpdateCount+this.state.errorUpdateCount>0}isStatic(){return this.state.data===void 0?!1:this.getObserversCount()>0?this.observers.some(e=>Ln(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:!B5(this.state.dataUpdatedAt,e)}onFocus(){var e,n;(e=this.observers.find(r=>r.shouldFetchOnWindowFocus()))==null||e.refetch({cancelRefetch:!1}),(n=B(this,Dr))==null||n.continue()}onOnline(){var e,n;(e=this.observers.find(r=>r.shouldFetchOnReconnect()))==null||e.refetch({cancelRefetch:!1}),(n=B(this,Dr))==null||n.continue()}addObserver(e){this.observers.includes(e)||(this.observers.push(e),this.clearGcTimeout(),B(this,Fi).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||(B(this,Dr)&&(B(this,Qc)||this.state.fetchStatus==="paused"&&this.state.status==="pending"?B(this,Dr).cancel({revert:!0}):B(this,Dr).cancelRetry()),this.scheduleGc()),B(this,Fi).notify({type:"observerRemoved",query:this,observer:e}))}getObserversCount(){return this.observers.length}invalidate(){this.state.isInvalidated||xt(this,lo,wa).call(this,{type:"invalidate"})}async fetch(e,n){var f,h,m,g;if(this.state.fetchStatus!=="idle"&&((f=B(this,Dr))==null?void 0:f.status())!=="rejected"){if(this.state.data!==void 0&&(n!=null&&n.cancelRefetch))this.cancel({silent:!0});else if(B(this,Dr)&&B(this,Ea))return B(this,Dr).continueRetry(),B(this,Ea)}if(e&&this.setOptions(e),!this.options.queryFn){const _=this.observers.find(y=>y.options.queryFn);_&&this.setOptions(_.options)}const r=new AbortController,s=_=>{Object.defineProperties(_,{[YS]:{value:r.signal,enumerable:!0},signal:{enumerable:!0,get:()=>(De(this,Qc,!0),r.signal)}})},i=()=>{const _=G5(this.options,n),b=(()=>{const x={client:B(this,Xc),queryKey:this.queryKey,meta:this.meta};return s(x),x})();return De(this,Qc,!1),this.options.persister?this.options.persister(_,b,this):_(b)},l=(()=>{const _={fetchOptions:n,options:this.options,queryKey:this.queryKey,client:B(this,Xc),state:this.state,fetchFn:i};return s(_),_})();(h=B(this,Kd)==="infinite"?hX(this.options.pages):this.options.behavior)==null||h.onFetch(l,this),De(this,Gd,this.state),(this.state.fetchStatus==="idle"||this.state.fetchMeta!==((m=l.fetchOptions)==null?void 0:m.meta))&&xt(this,lo,wa).call(this,{type:"fetch",meta:(g=l.fetchOptions)==null?void 0:g.meta});const u=De(this,Dr,Y5({initialPromise:n==null?void 0:n.initialPromise,fn:l.fetchFn,onCancel:_=>{_ instanceof T2&&_.revert&&this.setState({...B(this,Gd),fetchStatus:"idle"}),r.abort()},onFail:(_,y)=>{xt(this,lo,wa).call(this,{type:"failed",failureCount:_,error:y})},onPause:()=>{xt(this,lo,wa).call(this,{type:"pause"})},onContinue:()=>{xt(this,lo,wa).call(this,{type:"continue"})},retry:l.options.retry,retryDelay:l.options.retryDelay,networkMode:l.options.networkMode,canRun:()=>!0})),d=(async()=>{var _,y,b,x,S,E,C,R;try{const O=await u.promise;if(O===void 0)throw new Error(`${this.queryHash} data is undefined`);return this.setData(O),(y=(_=B(this,Fi).config).onSuccess)==null||y.call(_,O,this),(x=(b=B(this,Fi).config).onSettled)==null||x.call(b,O,this.state.error,this),O}catch(O){if(O instanceof T2){if(O.silent){if(B(this,Dr)!==u&&B(this,Ea))return B(this,Ea);throw O}else if(O.revert){if(this.state.data===void 0)throw O;return this.state.data}}throw xt(this,lo,wa).call(this,{type:"error",error:O}),(E=(S=B(this,Fi).config).onError)==null||E.call(S,O,this),(R=(C=B(this,Fi).config).onSettled)==null||R.call(C,this.state.data,O,this),O}finally{B(this,Dr)===u&&(De(this,Dr,void 0),De(this,Ea,void 0)),this.scheduleGc()}})();return De(this,Ea,d),u.start(),d}},Kd=new WeakMap,Yc=new WeakMap,Gd=new WeakMap,Fi=new WeakMap,Xc=new WeakMap,Dr=new WeakMap,Ea=new WeakMap,om=new WeakMap,Qc=new WeakMap,lo=new WeakSet,wa=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,...Q5(r.data,this.options),fetchMeta:e.meta??null};case"success":const s={...r,...dR(e.data,e.dataUpdatedAt),dataUpdateCount:r.dataUpdateCount+1,...!e.manual&&{fetchStatus:"idle",fetchFailureCount:0,fetchFailureReason:null}};return De(this,Gd,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),kr.batch(()=>{this.observers.slice().forEach(r=>{r.onQueryUpdate()}),B(this,Fi).notify({query:this,type:"updated",action:e})})},UI);function Q5(t,e){return{fetchFailureCount:0,fetchFailureReason:null,fetchStatus:q5(e.networkMode)?"fetching":"paused",...t===void 0&&{error:null,status:"pending"}}}function dR(t,e){return{data:t,dataUpdatedAt:e??Date.now(),error:null,isInvalidated:!1,status:"success"}}function fR(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 bs,Ft,am,xs,Jc,qd,Ca,lm,Yd,Xd,eu,tu,El,Qd,rn,Bh,R2,A2,I2,O2,M2,L2,N2,D2,ZI,gX=(ZI=class extends Nf{constructor(e,n){super();rt(this,rn);rt(this,bs);rt(this,Ft);rt(this,am);rt(this,xs);rt(this,Jc);rt(this,qd);rt(this,Ca);rt(this,lm);rt(this,Yd);rt(this,Xd);rt(this,eu);rt(this,tu);rt(this,El);rt(this,Qd,new Set);this.options=n,De(this,bs,e),De(this,Ca,null),this.bindMethods(),this.setOptions(n)}bindMethods(){this.refetch=this.refetch.bind(this)}onSubscribe(){this.listeners.size===1&&(B(this,Ft).addObserver(this),hR(B(this,Ft),this.options)?xt(this,rn,Bh).call(this):this.updateResult(),xt(this,rn,M2).call(this))}onUnsubscribe(){this.hasListeners()||this.destroy()}shouldFetchOnReconnect(){return $2(B(this,Ft),this.options,this.options.refetchOnReconnect)}shouldFetchOnWindowFocus(){return $2(B(this,Ft),this.options,this.options.refetchOnWindowFocus)}destroy(){this.listeners=new Set,xt(this,rn,L2).call(this),xt(this,rn,N2).call(this),B(this,Ft).removeObserver(this)}setOptions(e){const n=this.options,r=B(this,Ft);if(this.options=B(this,bs).defaultQueryOptions(e),this.options.enabled!==void 0&&typeof this.options.enabled!="boolean"&&typeof this.options.enabled!="function"&&typeof Ln(this.options.enabled,B(this,Ft))!="boolean")throw new Error("Expected enabled to be a boolean or a callback that returns a boolean");xt(this,rn,D2).call(this),B(this,Ft).setOptions(this.options),n._defaulted&&!kg(this.options,n)&&B(this,bs).getQueryCache().notify({type:"observerOptionsUpdated",query:B(this,Ft),observer:this});const s=this.hasListeners();s&&pR(B(this,Ft),r,this.options,n)&&xt(this,rn,Bh).call(this),this.updateResult(),s&&(B(this,Ft)!==r||Ln(this.options.enabled,B(this,Ft))!==Ln(n.enabled,B(this,Ft))||Ln(this.options.staleTime,B(this,Ft))!==Ln(n.staleTime,B(this,Ft)))&&xt(this,rn,A2).call(this);const i=xt(this,rn,I2).call(this);s&&(B(this,Ft)!==r||Ln(this.options.enabled,B(this,Ft))!==Ln(n.enabled,B(this,Ft))||i!==B(this,El))&&xt(this,rn,O2).call(this,i)}getOptimisticResult(e){const n=B(this,bs).getQueryCache().build(B(this,bs),e),r=this.createResult(n,e);return kg(this.getCurrentResult(),r)||(De(this,xs,r),De(this,qd,this.options),De(this,Jc,B(this,Ft).state)),r}getCurrentResult(){return B(this,xs)}trackResult(e,n){return new Proxy(e,{get:(r,s)=>(this.trackProp(s),n==null||n(s),Reflect.get(r,s))})}trackProp(e){B(this,Qd).add(e)}getCurrentQuery(){return B(this,Ft)}refetch({...e}={}){return this.fetch({...e})}fetchOptimistic(e){const n=B(this,bs).defaultQueryOptions(e),r=B(this,bs).getQueryCache().build(B(this,bs),n);let s=()=>{},i;const o=new Promise(l=>{i=l,s=B(this,bs).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(n).then(()=>{const l=this.createResult(r,n);return i==null||i(l),l}).finally(()=>{s()}),o])}fetch(e){return xt(this,rn,Bh).call(this,{...e,cancelRefetch:e.cancelRefetch??!0}).then(()=>(this.updateResult(),B(this,xs)))}createResult(e,n){var O;const r=B(this,Ft),s=this.options,i=B(this,xs),o=B(this,Jc),l=B(this,qd),u=e!==r?e.state:B(this,am),{state:d}=e;let f={...d},h=!1,m;if(n._optimisticResults){const I=this.hasListeners(),A=!I&&hR(e,n),L=I&&pR(e,r,n,s);(A||L)&&(f={...f,...Q5(d.data,e.options)}),n._optimisticResults==="isRestoring"&&(f.fetchStatus="idle")}let{error:g,errorUpdatedAt:_,status:y}=f;m=f.data;let b=!1;if(n.placeholderData!==void 0&&m===void 0&&y==="pending"){let I;i!=null&&i.isPlaceholderData&&n.placeholderData===(l==null?void 0:l.placeholderData)?(I=i.data,b=!0):I=typeof n.placeholderData=="function"?n.placeholderData((O=B(this,Xd))==null?void 0:O.state.data,B(this,Xd)):n.placeholderData,I!==void 0&&(y="success",m=P2(i==null?void 0:i.data,I,n),h=!0)}if(n.select&&m!==void 0&&!b)if(i&&m===(o==null?void 0:o.data)&&n.select===B(this,lm))m=B(this,Yd);else try{De(this,lm,n.select),m=n.select(m),m=P2(i==null?void 0:i.data,m,n),De(this,Yd,m),De(this,Ca,null)}catch(I){De(this,Ca,I)}else m===void 0&&De(this,Ca,null);B(this,Ca)&&(g=B(this,Ca),m=B(this,Yd),_=(i==null?void 0:i.error)===g?i.errorUpdatedAt:Date.now(),y="error",h=!1);const x=f.fetchStatus==="fetching",S=y==="pending",E=y==="error",C=S&&x,R=m!==void 0;return{status:y,fetchStatus:f.fetchStatus,isPending:S,isSuccess:y==="success",isError:E,isInitialLoading:C,isLoading:C,data:m,dataUpdatedAt:f.dataUpdatedAt,error:g,errorUpdatedAt:_,failureCount:f.fetchFailureCount,failureReason:f.fetchFailureReason,errorUpdateCount:f.errorUpdateCount,isFetched:e.isFetched(),isFetchedAfterMount:f.dataUpdateCount>u.dataUpdateCount||f.errorUpdateCount>u.errorUpdateCount,isFetching:x,isRefetching:x&&!S,isLoadingError:E&&!R,isPaused:f.fetchStatus==="paused",isPlaceholderData:h,isRefetchError:E&&R,isStale:JS(e,n),refetch:this.refetch,isEnabled:Ln(n.enabled,e)!==!1}}updateResult(){const e=B(this,xs),n=this.createResult(B(this,Ft),this.options);if(De(this,Jc,B(this,Ft).state),De(this,qd,this.options),B(this,Jc).data!==void 0&&De(this,Xd,B(this,Ft)),kg(n,e))return;De(this,xs,n);const s=(()=>{if(!e)return!0;const{notifyOnChangeProps:i}=this.options,o=typeof i=="function"?i():i;if(o==="all"||!o&&!B(this,Qd).size||this.options.throwOnError&&B(this,xs).error!==e.error)return!0;for(const l of o??B(this,Qd))if(B(this,xs)[l]!==e[l])return!0;return!1})();kr.batch(()=>{s&&this.listeners.forEach(i=>{i(B(this,xs))}),B(this,bs).getQueryCache().notify({query:B(this,Ft),type:"observerResultsUpdated"})})}onQueryUpdate(){this.updateResult(),this.hasListeners()&&xt(this,rn,M2).call(this)}},bs=new WeakMap,Ft=new WeakMap,am=new WeakMap,xs=new WeakMap,Jc=new WeakMap,qd=new WeakMap,Ca=new WeakMap,lm=new WeakMap,Yd=new WeakMap,Xd=new WeakMap,eu=new WeakMap,tu=new WeakMap,El=new WeakMap,Qd=new WeakMap,rn=new WeakSet,Bh=function(e){xt(this,rn,D2).call(this);let n=B(this,Ft).fetch(this.options,e);return e!=null&&e.throwOnError||(n=n.catch(ks)),n},R2=function(e){return!XS()&&Ln(this.options.enabled,B(this,Ft))!==!1&&Z5(e)},A2=function(){xt(this,rn,L2).call(this);const e=Ln(this.options.staleTime,B(this,Ft));if(B(this,xs).isStale||!xt(this,rn,R2).call(this,e))return;const n=B5(B(this,xs).dataUpdatedAt,e)+1;De(this,eu,Zc.setTimeout(()=>{B(this,xs).isStale||this.updateResult()},n))},I2=function(){return Ln(this.options.refetchInterval,B(this,Ft))??!1},O2=function(e){xt(this,rn,N2).call(this),De(this,El,e),!(B(this,El)===0||!xt(this,rn,R2).call(this,B(this,El)))&&De(this,tu,Zc.setInterval(()=>{(this.options.refetchIntervalInBackground||QS.isFocused())&&xt(this,rn,Bh).call(this)},B(this,El)))},M2=function(){xt(this,rn,A2).call(this),xt(this,rn,O2).call(this,xt(this,rn,I2).call(this))},L2=function(){B(this,eu)!==void 0&&(Zc.clearTimeout(B(this,eu)),De(this,eu,void 0))},N2=function(){B(this,tu)!==void 0&&(Zc.clearInterval(B(this,tu)),De(this,tu,void 0))},D2=function(){const e=B(this,bs).getQueryCache().build(B(this,bs),this.options);if(e===B(this,Ft))return;const n=B(this,Ft);De(this,Ft,e),De(this,am,e.state),this.hasListeners()&&(n==null||n.removeObserver(this),e.addObserver(this))},ZI);function vX(t,e){return Ln(e.enabled,t)!==!1&&t.state.data===void 0&&!(t.state.status==="error"&&Ln(e.retryOnMount,t)===!1)}function hR(t,e){return vX(t,e)||t.state.data!==void 0&&$2(t,e,e.refetchOnMount)}function $2(t,e,n){if(Ln(e.enabled,t)!==!1&&Ln(e.staleTime,t)!=="static"){const r=Ln(n,t);return r==="always"||r!==!1&&JS(t,e)}return!1}function pR(t,e,n,r){return(t!==e||Ln(r.enabled,t)===!1)&&(!n.suspense||t.state.status!=="error")&&JS(t,n)}function JS(t,e){return Ln(e.enabled,t)!==!1&&t.isStaleByTime(Ln(e.staleTime,t))}var cm,$o,as,nu,Fo,yl,BI,yX=(BI=class extends X5{constructor(e){super();rt(this,Fo);rt(this,cm);rt(this,$o);rt(this,as);rt(this,nu);De(this,cm,e.client),this.mutationId=e.mutationId,De(this,as,e.mutationCache),De(this,$o,[]),this.state=e.state||J5(),this.setOptions(e.options),this.scheduleGc()}setOptions(e){this.options=e,this.updateGcTime(this.options.gcTime)}get meta(){return this.options.meta}addObserver(e){B(this,$o).includes(e)||(B(this,$o).push(e),this.clearGcTimeout(),B(this,as).notify({type:"observerAdded",mutation:this,observer:e}))}removeObserver(e){De(this,$o,B(this,$o).filter(n=>n!==e)),this.scheduleGc(),B(this,as).notify({type:"observerRemoved",mutation:this,observer:e})}optionalRemove(){B(this,$o).length||(this.state.status==="pending"?this.scheduleGc():B(this,as).remove(this))}continue(){var e;return((e=B(this,nu))==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,m,g,_,y,b,x,S,E,C,R,O,I,A;const n=()=>{xt(this,Fo,yl).call(this,{type:"continue"})},r={client:B(this,cm),meta:this.options.meta,mutationKey:this.options.mutationKey},s=De(this,nu,Y5({fn:()=>this.options.mutationFn?this.options.mutationFn(e,r):Promise.reject(new Error("No mutationFn found")),onFail:(L,N)=>{xt(this,Fo,yl).call(this,{type:"failed",failureCount:L,error:N})},onPause:()=>{xt(this,Fo,yl).call(this,{type:"pause"})},onContinue:n,retry:this.options.retry??0,retryDelay:this.options.retryDelay,networkMode:this.options.networkMode,canRun:()=>B(this,as).canRun(this)})),i=this.state.status==="pending",o=!s.canStart();try{if(i)n();else{xt(this,Fo,yl).call(this,{type:"pending",variables:e,isPaused:o}),B(this,as).config.onMutate&&await B(this,as).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&&xt(this,Fo,yl).call(this,{type:"pending",context:N,variables:e,isPaused:o})}this.state.isPaused&&s.canStart()&&n();const L=await s.start();return await((f=(d=B(this,as).config).onSuccess)==null?void 0:f.call(d,L,e,this.state.context,this,r)),await((m=(h=this.options).onSuccess)==null?void 0:m.call(h,L,e,this.state.context,r)),await((_=(g=B(this,as).config).onSettled)==null?void 0:_.call(g,L,null,this.state.variables,this.state.context,this,r)),await((b=(y=this.options).onSettled)==null?void 0:b.call(y,L,null,e,this.state.context,r)),xt(this,Fo,yl).call(this,{type:"success",data:L}),L}catch(L){try{await((S=(x=B(this,as).config).onError)==null?void 0:S.call(x,L,e,this.state.context,this,r))}catch(N){Promise.reject(N)}try{await((C=(E=this.options).onError)==null?void 0:C.call(E,L,e,this.state.context,r))}catch(N){Promise.reject(N)}try{await((O=(R=B(this,as).config).onSettled)==null?void 0:O.call(R,void 0,L,this.state.variables,this.state.context,this,r))}catch(N){Promise.reject(N)}try{await((A=(I=this.options).onSettled)==null?void 0:A.call(I,void 0,L,e,this.state.context,r))}catch(N){Promise.reject(N)}throw xt(this,Fo,yl).call(this,{type:"error",error:L}),L}finally{B(this,nu)===s&&De(this,nu,void 0),B(this,as).runNext(this)}}},cm=new WeakMap,$o=new WeakMap,as=new WeakMap,nu=new WeakMap,Fo=new WeakSet,yl=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),kr.batch(()=>{B(this,$o).forEach(r=>{r.onMutationUpdate(e)}),B(this,as).notify({mutation:this,type:"updated",action:e})})},BI);function J5(){return{context:void 0,data:void 0,error:null,failureCount:0,failureReason:null,isPaused:!1,status:"idle",variables:void 0,submittedAt:0}}var Cl,co,um,WI,_X=(WI=class extends Nf{constructor(e={}){super();rt(this,Cl);rt(this,co);rt(this,um);this.config=e,De(this,Cl,new Set),De(this,co,new Map),De(this,um,0)}build(e,n,r){const s=new yX({client:e,mutationCache:this,mutationId:++E0(this,um)._,options:e.defaultMutationOptions(n),state:r});return this.add(s),s}add(e){B(this,Cl).add(e);const n=B0(e);if(typeof n=="string"){const r=B(this,co).get(n);r?r.push(e):B(this,co).set(n,[e])}this.notify({type:"added",mutation:e})}remove(e){if(B(this,Cl).delete(e)){const n=B0(e);if(typeof n=="string"){const r=B(this,co).get(n);if(r)if(r.length>1){const s=r.indexOf(e);s!==-1&&r.splice(s,1)}else r[0]===e&&B(this,co).delete(n)}}this.notify({type:"removed",mutation:e})}canRun(e){var r;const n=B0(e);if(typeof n=="string"){const s=(r=B(this,co).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=B0(e);return typeof n=="string"?((s=(r=B(this,co).get(n))==null?void 0:r.find(i=>i!==e&&i.state.isPaused))==null?void 0:s.continue())??Promise.resolve():Promise.resolve()}clear(){kr.batch(()=>{const e=this.getAll();B(this,Cl).clear(),B(this,co).clear(),e.forEach(n=>{this.notify({type:"removed",mutation:n})})})}getAll(){return Array.from(B(this,Cl))}find(e){const n={exact:!0,...e};return this.getAll().find(r=>aR(n,r))}findAll(e={}){return this.getAll().filter(n=>aR(e,n))}notify(e){kr.batch(()=>{this.listeners.forEach(n=>{n(e)})})}resumePausedMutations(){const e=this.getAll().filter(n=>n.state.isPaused);return kr.batch(()=>Promise.all(e.map(n=>n.continue().catch(ks))))}},Cl=new WeakMap,co=new WeakMap,um=new WeakMap,WI);function B0(t){var e;return(e=t.options.scope)==null?void 0:e.id}var Pa,Pl,ls,dm,Ko,Wh,F2,KI,wX=(KI=class extends Nf{constructor(n,r){super();rt(this,Ko);rt(this,Pa);rt(this,Pl);rt(this,ls);rt(this,dm);De(this,Pa,n),this.setOptions(r),this.bindMethods(),xt(this,Ko,Wh).call(this)}bindMethods(){this.mutate=this.mutate.bind(this),this.reset=this.reset.bind(this)}setOptions(n){var s;const r=this.options;this.options=B(this,Pa).defaultMutationOptions(n),kg(this.options,r)||B(this,Pa).getMutationCache().notify({type:"observerOptionsUpdated",mutation:B(this,ls),observer:this}),r!=null&&r.mutationKey&&this.options.mutationKey&&wu(r.mutationKey)!==wu(this.options.mutationKey)?this.reset():((s=B(this,ls))==null?void 0:s.state.status)==="pending"&&B(this,ls).setOptions(this.options)}onSubscribe(){this.listeners.size===1&&B(this,ls)&&(B(this,ls).addObserver(this),xt(this,Ko,Wh).call(this))}onUnsubscribe(){var n;this.hasListeners()||(n=B(this,ls))==null||n.removeObserver(this)}onMutationUpdate(n){xt(this,Ko,Wh).call(this),xt(this,Ko,F2).call(this,n)}getCurrentResult(){return B(this,Pl)}reset(){var n;(n=B(this,ls))==null||n.removeObserver(this),De(this,ls,void 0),xt(this,Ko,Wh).call(this),xt(this,Ko,F2).call(this)}mutate(n,r){var s;return De(this,dm,r),(s=B(this,ls))==null||s.removeObserver(this),De(this,ls,B(this,Pa).getMutationCache().build(B(this,Pa),this.options)),B(this,ls).addObserver(this),B(this,ls).execute(n)}},Pa=new WeakMap,Pl=new WeakMap,ls=new WeakMap,dm=new WeakMap,Ko=new WeakSet,Wh=function(){var r;const n=((r=B(this,ls))==null?void 0:r.state)??J5();De(this,Pl,{...n,isPending:n.status==="pending",isSuccess:n.status==="success",isError:n.status==="error",isIdle:n.status==="idle",mutate:this.mutate,reset:this.reset})},F2=function(n){kr.batch(()=>{var s,i,o,l;const r=B(this,dm);if(r&&this.hasListeners()){const u=B(this,Pl).variables,d=B(this,Pl).context,f={client:B(this,Pa),meta:this.options.meta,mutationKey:this.options.mutationKey};if((n==null?void 0:n.type)==="success"){try{(s=r.onSuccess)==null||s.call(r,n.data,u,d,f)}catch(h){Promise.reject(h)}try{(i=r.onSettled)==null||i.call(r,n.data,null,u,d,f)}catch(h){Promise.reject(h)}}else if((n==null?void 0:n.type)==="error"){try{(o=r.onError)==null||o.call(r,n.error,u,d,f)}catch(h){Promise.reject(h)}try{(l=r.onSettled)==null||l.call(r,void 0,n.error,u,d,f)}catch(h){Promise.reject(h)}}}this.listeners.forEach(u=>{u(B(this,Pl))})})},KI),jo,GI,bX=(GI=class extends Nf{constructor(e={}){super();rt(this,jo);this.config=e,De(this,jo,new Map)}build(e,n,r){const s=n.queryKey,i=n.queryHash??KS(s,n);let o=this.get(i);return o||(o=new mX({client:e,queryKey:s,queryHash:i,options:e.defaultQueryOptions(n),state:r,defaultOptions:e.getQueryDefaults(s)}),this.add(o)),o}add(e){B(this,jo).has(e.queryHash)||(B(this,jo).set(e.queryHash,e),this.notify({type:"added",query:e}))}remove(e){B(this,jo).get(e.queryHash)===e&&(e.destroy(),B(this,jo).delete(e.queryHash),this.notify({type:"removed",query:e}))}clear(){kr.batch(()=>{this.getAll().forEach(e=>{this.remove(e)})})}get(e){return B(this,jo).get(e)}getAll(){return[...B(this,jo).values()]}find(e){const n={exact:!0,...e};return this.getAll().find(r=>oR(n,r))}findAll(e={}){const n=this.getAll();return Object.keys(e).length>0?n.filter(r=>oR(e,r)):n}notify(e){kr.batch(()=>{this.listeners.forEach(n=>{n(e)})})}onFocus(){kr.batch(()=>{this.getAll().forEach(e=>{e.onFocus()})})}onOnline(){kr.batch(()=>{this.getAll().forEach(e=>{e.onOnline()})})}},jo=new WeakMap,GI),Vn,Tl,Rl,Jd,ef,Al,tf,nf,qI,xX=(qI=class{constructor(t={}){rt(this,Vn);rt(this,Tl);rt(this,Rl);rt(this,Jd);rt(this,ef);rt(this,Al);rt(this,tf);rt(this,nf);De(this,Vn,t.queryCache||new bX),De(this,Tl,t.mutationCache||new _X),De(this,Rl,t.defaultOptions||{}),De(this,Jd,new Map),De(this,ef,new Map),De(this,Al,0)}mount(){E0(this,Al)._++,B(this,Al)===1&&(De(this,tf,QS.subscribe(async t=>{t&&(await this.resumePausedMutations(),B(this,Vn).onFocus())})),De(this,nf,kv.subscribe(async t=>{t&&(await this.resumePausedMutations(),B(this,Vn).onOnline())})))}unmount(){var t,e;E0(this,Al)._--,B(this,Al)===0&&((t=B(this,tf))==null||t.call(this),De(this,tf,void 0),(e=B(this,nf))==null||e.call(this),De(this,nf,void 0))}isFetching(t){return B(this,Vn).findAll({...t,fetchStatus:"fetching"}).length}isMutating(t){return B(this,Tl).findAll({...t,status:"pending"}).length}getQueryData(t){var n;const e=this.defaultQueryOptions({queryKey:t});return(n=B(this,Vn).get(e.queryHash))==null?void 0:n.state.data}ensureQueryData(t){const e=this.defaultQueryOptions(t),n=B(this,Vn).build(this,e),r=n.state.data;return r===void 0?this.fetchQuery(t):(t.revalidateIfStale&&n.isStaleByTime(Ln(e.staleTime,n))&&this.prefetchQuery(e),Promise.resolve(r))}getQueriesData(t){return B(this,Vn).findAll(t).map(({queryKey:e,state:n})=>[e,n.data])}setQueryData(t,e,n){var o;const r=this.defaultQueryOptions({queryKey:t}),s=(o=B(this,Vn).get(r.queryHash))==null?void 0:o.state.data,i=tX(e,s);if(i!==void 0)return B(this,Vn).build(this,r).setData(i,{...n,manual:!0})}setQueriesData(t,e,n){return kr.batch(()=>B(this,Vn).findAll(t).map(({queryKey:r})=>[r,this.setQueryData(r,e,n)]))}getQueryState(t){var n;const e=this.defaultQueryOptions({queryKey:t});return(n=B(this,Vn).get(e.queryHash))==null?void 0:n.state}removeQueries(t){const e=B(this,Vn);kr.batch(()=>{e.findAll(t).forEach(n=>{e.remove(n)})})}resetQueries(t,e){const n=B(this,Vn);return kr.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=kr.batch(()=>B(this,Vn).findAll(t).map(s=>s.cancel(n)));return Promise.all(r).then(ks).catch(ks)}invalidateQueries(t,e={}){return kr.batch(()=>(B(this,Vn).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=kr.batch(()=>B(this,Vn).findAll(t).filter(s=>!s.isDisabled()&&!s.isStatic()).map(s=>{let i=s.fetch(void 0,n);const o=s.state.fetchStatus==="paused";return(!n.throwOnError||o)&&(i=i.catch(ks)),o?Promise.resolve():i}));return Promise.all(r).then(ks)}async query(t){const e=this.defaultQueryOptions(t);e.retry===void 0&&(e.retry=!1);const n=B(this,Vn).build(this,e),r=n.isStaleByTime(Ln(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=B(this,Vn).build(this,e);return n.isStaleByTime(Ln(e.staleTime,n))?n.fetch(e):Promise.resolve(n.state.data)}prefetchQuery(t){return this.fetchQuery(t).then(ks).catch(ks)}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(ks).catch(ks)}ensureInfiniteQueryData(t){return t._type="infinite",this.ensureQueryData(t)}resumePausedMutations(){return kv.isOnline()?B(this,Tl).resumePausedMutations():Promise.resolve()}getQueryCache(){return B(this,Vn)}getMutationCache(){return B(this,Tl)}getDefaultOptions(){return B(this,Rl)}setDefaultOptions(t){De(this,Rl,t)}setQueryDefaults(t,e){B(this,Jd).set(wu(t),{queryKey:t,defaultOptions:e})}getQueryDefaults(t){const e=[...B(this,Jd).values()],n={};return e.forEach(r=>{wf(t,r.queryKey)&&Object.assign(n,r.defaultOptions)}),n}setMutationDefaults(t,e){B(this,ef).set(wu(t),{mutationKey:t,defaultOptions:e})}getMutationDefaults(t){const e=[...B(this,ef).values()],n={};return e.forEach(r=>{wf(t,r.mutationKey)&&Object.assign(n,r.defaultOptions)}),n}defaultQueryOptions(t){if(t._defaulted)return t;const e={...B(this,Rl).queries,...this.getQueryDefaults(t.queryKey),...t,_defaulted:!0};return e.queryHash||(e.queryHash=KS(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===GS&&(e.enabled=!1),e}defaultMutationOptions(t){return t!=null&&t._defaulted?t:{...B(this,Rl).mutations,...(t==null?void 0:t.mutationKey)&&this.getMutationDefaults(t.mutationKey),...t,_defaulted:!0}}clear(){B(this,Vn).clear(),B(this,Tl).clear()}},Vn=new WeakMap,Tl=new WeakMap,Rl=new WeakMap,Jd=new WeakMap,ef=new WeakMap,Al=new WeakMap,tf=new WeakMap,nf=new WeakMap,qI);const eN=v.createContext(!1),SX=()=>v.useContext(eN);eN.Provider;function kX(){let t=!1;return{clearReset:()=>{t=!1},reset:()=>{t=!0},isReset:()=>t}}const EX=v.createContext(kX()),CX=()=>v.useContext(EX),PX=(t,e,n)=>{const r=(n==null?void 0:n.state.status)==="error"&&typeof t.throwOnError=="function"?qS(t.throwOnError,[n.state.error,n]):t.throwOnError;(t.suspense||r)&&(e.isReset()||(t.retryOnMount=!1))},TX=t=>{v.useEffect(()=>{t.clearReset()},[t])},RX=({result:t,errorResetBoundary:e,throwOnError:n,query:r,suspense:s})=>t.isError&&!e.isReset()&&!t.isFetching&&r&&(s&&t.data===void 0||qS(n,[t.error,r])),AX=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))}},IX=(t,e)=>(t==null?void 0:t.suspense)&&e.isPending,OX=(t,e,n)=>e.fetchOptimistic(t).catch(()=>{n.clearReset()});function MX(t,e,n){const r=SX(),s=CX(),i=mm(),o=i.defaultQueryOptions(t),l=i.getQueryCache().get(o.queryHash),u=t.subscribed!==!1;o._optimisticResults=r?"isRestoring":u?"optimistic":void 0,AX(o),PX(o,s,l),TX(s);const[d]=v.useState(()=>new e(i,o)),f=d.getOptimisticResult(o);v.useEffect(()=>{d.setOptions(o)},[o,d]);const h=!r&&u;if(v.useSyncExternalStore(v.useCallback(m=>{const g=h?d.subscribe(kr.batchCalls(m)):ks;return d.updateResult(),g},[d,h]),()=>d.getCurrentResult(),()=>d.getCurrentResult()),IX(o,f))throw OX(o,d,s);if(RX({result:f,errorResetBoundary:s,throwOnError:o.throwOnError,query:l,suspense:o.suspense}))throw f.error;return o.notifyOnChangeProps?f:d.trackResult(f)}function Qo(t,e){return MX(t,gX)}function tN(t,e){const n=mm(),[r]=v.useState(()=>new wX(n,t));v.useEffect(()=>{r.setOptions(t)},[r,t]);const s=v.useSyncExternalStore(v.useCallback(o=>r.subscribe(kr.batchCalls(o)),[r]),()=>r.getCurrentResult(),()=>r.getCurrentResult()),i=v.useCallback((...o)=>{r.mutate(o[0],o[1]).catch(ks)},[r]);if(s.error&&qS(r.options.throwOnError,[s.error]))throw s.error;return{...s,mutate:i,mutateAsync:s.mutate}}const ek=v.createContext({});function gy(t){const e=v.useRef(null);return e.current===null&&(e.current=t()),e.current}const LX=typeof window<"u",tk=LX?v.useLayoutEffect:v.useEffect,vy=v.createContext(null);function nk(t,e){t.indexOf(e)===-1&&t.push(e)}function Ev(t,e){const n=t.indexOf(e);n>-1&&t.splice(n,1)}const Jo=(t,e,n)=>n>e?e:n<t?t:n;let yy=()=>{};const Ql={},nN=t=>/^-?(?:\d+(?:\.\d+)?|\.\d+)$/u.test(t),rN=t=>typeof t=="object"&&t!==null,sN=t=>/^0[^.\s]+$/u.test(t);function iN(t){let e;return()=>(e===void 0&&(e=t()),e)}const Bi=t=>t,gm=(...t)=>t.reduce((e,n)=>r=>n(e(r))),Np=(t,e,n)=>{const r=e-t;return r?(n-t)/r:1};class rk{constructor(){this.subscriptions=[]}add(e){return nk(this.subscriptions,e),()=>Ev(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 vi=t=>t*1e3,zi=t=>t/1e3,oN=(t,e)=>e?t*(1e3/e):0,aN=(t,e,n)=>(((1-3*n+3*e)*t+(3*n-6*e))*t+3*e)*t,NX=1e-7,DX=12;function $X(t,e,n,r,s){let i,o,l=0;do o=e+(n-e)/2,i=aN(o,r,s)-t,i>0?n=o:e=o;while(Math.abs(i)>NX&&++l<DX);return o}function vm(t,e,n,r){if(t===e&&n===r)return Bi;const s=i=>$X(i,0,1,t,n);return i=>i===0||i===1?i:aN(s(i),e,r)}const lN=t=>e=>e<=.5?t(2*e)/2:(2-t(2*(1-e)))/2,cN=t=>e=>1-t(1-e),uN=vm(.33,1.53,.69,.99),sk=cN(uN),dN=lN(sk),fN=t=>t>=1?1:(t*=2)<1?.5*sk(t):.5*(2-Math.pow(2,-10*(t-1))),ik=t=>1-Math.sin(Math.acos(t)),hN=cN(ik),pN=lN(ik),FX=vm(.42,0,1,1),jX=vm(0,0,.58,1),mN=vm(.42,0,.58,1),zX=t=>Array.isArray(t)&&typeof t[0]!="number",gN=t=>Array.isArray(t)&&typeof t[0]=="number",VX={linear:Bi,easeIn:FX,easeInOut:mN,easeOut:jX,circIn:ik,circInOut:pN,circOut:hN,backIn:sk,backInOut:dN,backOut:uN,anticipate:fN},HX=t=>typeof t=="string",mR=t=>{if(gN(t)){yy(t.length===4);const[e,n,r,s]=t;return vm(e,n,r,s)}else if(HX(t))return VX[t];return t},W0=["setup","read","resolveKeyframes","preUpdate","update","preRender","render","postRender"];function UX(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 g=h&&r?e:n;return f&&i.add(d),g.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 ZX=40;function vN(t,e){let n=!1,r=!0;const s={delta:0,timestamp:0,isProcessing:!1},i=()=>n=!0,o=W0.reduce((E,C)=>(E[C]=UX(i),E),{}),{setup:l,read:u,resolveKeyframes:d,preUpdate:f,update:h,preRender:m,render:g,postRender:_}=o,y=()=>{const E=Ql.useManualTiming,C=E?s.timestamp:performance.now();n=!1,E||(s.delta=r?1e3/60:Math.max(Math.min(C-s.timestamp,ZX),1)),s.timestamp=C,s.isProcessing=!0,l.process(s),u.process(s),d.process(s),f.process(s),h.process(s),m.process(s),g.process(s),_.process(s),s.isProcessing=!1,n&&e&&(r=!1,t(y))},b=()=>{n=!0,r=!0,s.isProcessing||t(y)};return{schedule:W0.reduce((E,C)=>{const R=o[C];return E[C]=(O,I=!1,A=!1)=>(n||b(),R.schedule(O,I,A)),E},{}),cancel:E=>{for(let C=0;C<W0.length;C++)o[W0[C]].cancel(E)},state:s,steps:o}}const{schedule:bn,cancel:Jl,state:Br,steps:Ew}=vN(typeof requestAnimationFrame<"u"?requestAnimationFrame:Bi,!0);let Eg;function BX(){Eg=void 0}const Cs={now:()=>(Eg===void 0&&Cs.set(Br.isProcessing||Ql.useManualTiming?Br.timestamp:performance.now()),Eg),set:t=>{Eg=t,queueMicrotask(BX)}},yN=t=>e=>typeof e=="string"&&e.startsWith(t),_N=yN("--"),WX=yN("var(--"),ok=t=>WX(t)?KX.test(t.split("/*")[0].trim()):!1,KX=/var\(--(?:[\w-]+\s*|[\w-]+\s*,(?:\s*[^)(\s]|\s*\((?:[^)(]|\([^)(]*\))*\))+\s*)\)$/iu;function gR(t){return typeof t!="string"?!1:t.split("/*")[0].includes("var(--")}const Df={test:t=>typeof t=="number",parse:parseFloat,transform:t=>t},Dp={...Df,transform:t=>Jo(0,1,t)},K0={...Df,default:1},dp=t=>Math.round(t*1e5)/1e5,ak=/-?(?:\d+(?:\.\d+)?|\.\d+)/gu;function GX(t){return t==null}const qX=/^(?:#[\da-f]{3,8}|(?:rgb|hsl)a?\((?:-?[\d.]+%?[,\s]+){2}-?[\d.]+%?\s*(?:[,/]\s*)?(?:\b\d+(?:\.\d+)?|\.\d+)?%?\))$/iu,lk=(t,e)=>n=>!!(typeof n=="string"&&qX.test(n)&&n.startsWith(t)||e&&!GX(n)&&Object.prototype.hasOwnProperty.call(n,e)),wN=(t,e,n)=>r=>{if(typeof r!="string")return r;const[s,i,o,l]=r.match(ak);return{[t]:parseFloat(s),[e]:parseFloat(i),[n]:parseFloat(o),alpha:l!==void 0?parseFloat(l):1}},YX=t=>Jo(0,255,t),Cw={...Df,transform:t=>Math.round(YX(t))},Bc={test:lk("rgb","red"),parse:wN("red","green","blue"),transform:({red:t,green:e,blue:n,alpha:r=1})=>"rgba("+Cw.transform(t)+", "+Cw.transform(e)+", "+Cw.transform(n)+", "+dp(Dp.transform(r))+")"};function XX(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 j2={test:lk("#"),parse:XX,transform:Bc.transform},ym=t=>({test:e=>typeof e=="string"&&e.endsWith(t)&&e.split(" ").length===1,parse:parseFloat,transform:e=>`${e}${t}`}),ba=ym("deg"),qo=ym("%"),Ge=ym("px"),QX=ym("vh"),JX=ym("vw"),vR={...qo,parse:t=>qo.parse(t)/100,transform:t=>qo.transform(t*100)},Pd={test:lk("hsl","hue"),parse:wN("hue","saturation","lightness"),transform:({hue:t,saturation:e,lightness:n,alpha:r=1})=>"hsla("+Math.round(t)+", "+qo.transform(dp(e))+", "+qo.transform(dp(n))+", "+dp(Dp.transform(r))+")"},fr={test:t=>Bc.test(t)||j2.test(t)||Pd.test(t),parse:t=>Bc.test(t)?Bc.parse(t):Pd.test(t)?Pd.parse(t):j2.parse(t),transform:t=>typeof t=="string"?t:t.hasOwnProperty("red")?Bc.transform(t):Pd.transform(t),getAnimatableNone:t=>{const e=fr.parse(t);return e.alpha=0,fr.transform(e)}},eQ=/(?:#[\da-f]{3,8}|(?:rgb|hsl)a?\((?:-?[\d.]+%?[,\s]+){2}-?[\d.]+%?\s*(?:[,/]\s*)?(?:\b\d+(?:\.\d+)?|\.\d+)?%?\))/giu;function tQ(t){var e,n;return isNaN(t)&&typeof t=="string"&&(((e=t.match(ak))==null?void 0:e.length)||0)+(((n=t.match(eQ))==null?void 0:n.length)||0)>0}const bN="number",xN="color",nQ="var",rQ="var(",yR="${}",sQ=/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 bf(t){const e=t.toString(),n=[],r={color:[],number:[],var:[]},s=[];let i=0;const l=e.replace(sQ,u=>(fr.test(u)?(r.color.push(i),s.push(xN),n.push(fr.parse(u))):u.startsWith(rQ)?(r.var.push(i),s.push(nQ),n.push(u)):(r.number.push(i),s.push(bN),n.push(parseFloat(u))),++i,yR)).split(yR);return{values:n,split:l,indexes:r,types:s}}function iQ(t){return bf(t).values}function SN({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===bN?s+=dp(r[i]):o===xN?s+=fr.transform(r[i]):s+=r[i]}return s}}function oQ(t){return SN(bf(t))}const aQ=t=>typeof t=="number"?0:fr.test(t)?fr.getAnimatableNone(t):t,lQ=(t,e)=>typeof t=="number"?e!=null&&e.trim().endsWith("/")?t:0:aQ(t);function cQ(t){const e=bf(t);return SN(e)(e.values.map((r,s)=>lQ(r,e.split[s])))}const po={test:tQ,parse:iQ,createTransformer:oQ,getAnimatableNone:cQ};function Pw(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 uQ({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=Pw(u,l,t+1/3),i=Pw(u,l,t),o=Pw(u,l,t-1/3)}return{red:Math.round(s*255),green:Math.round(i*255),blue:Math.round(o*255),alpha:r}}function Cv(t,e){return n=>n>0?e:t}const wn=(t,e,n)=>t+(e-t)*n,Tw=(t,e,n)=>{const r=t*t,s=n*(e*e-r)+r;return s<0?0:Math.sqrt(s)},dQ=[j2,Bc,Pd],fQ=t=>dQ.find(e=>e.test(t));function _R(t){const e=fQ(t);if(!e)return!1;let n=e.parse(t);return e===Pd&&(n=uQ(n)),n}const wR=(t,e)=>{const n=_R(t),r=_R(e);if(!n||!r)return Cv(t,e);const s={...n};return i=>(s.red=Tw(n.red,r.red,i),s.green=Tw(n.green,r.green,i),s.blue=Tw(n.blue,r.blue,i),s.alpha=wn(n.alpha,r.alpha,i),Bc.transform(s))},z2=new Set(["none","hidden"]);function hQ(t,e){return z2.has(t)?n=>n<=0?t:e:n=>n>=1?e:t}function pQ(t,e){return n=>wn(t,e,n)}function ck(t){return typeof t=="number"?pQ:typeof t=="string"?ok(t)?Cv:fr.test(t)?wR:vQ:Array.isArray(t)?kN:typeof t=="object"?fr.test(t)?wR:mQ:Cv}function kN(t,e){const n=[...t],r=n.length,s=t.map((i,o)=>ck(i)(i,e[o]));return i=>{for(let o=0;o<r;o++)n[o]=s[o](i);return n}}function mQ(t,e){const n={...t,...e},r={};for(const s in n)t[s]!==void 0&&e[s]!==void 0&&(r[s]=ck(t[s])(t[s],e[s]));return s=>{for(const i in r)n[i]=r[i](s);return n}}function gQ(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 vQ=(t,e)=>{const n=po.createTransformer(e),r=bf(t),s=bf(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?z2.has(t)&&!s.values.length||z2.has(e)&&!r.values.length?hQ(t,e):gm(kN(gQ(r,s),s.values),n):Cv(t,e)};function EN(t,e,n){return typeof t=="number"&&typeof e=="number"&&typeof n=="number"?wn(t,e,n):ck(t)(t,e)}const yQ=t=>{const e=({timestamp:n})=>t(n);return{start:(n=!0)=>bn.update(e,n),stop:()=>Jl(e),now:()=>Br.isProcessing?Br.timestamp:Cs.now()}},CN=(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)})`},Pv=2e4;function uk(t){let e=0;const n=50;let r=t.next(e);for(;!r.done&&e<Pv;)e+=n,r=t.next(e);return e>=Pv?1/0:e}function _Q(t,e=100,n){const r=n({...t,keyframes:[0,e]}),s=Math.min(uk(r),Pv);return{type:"keyframes",ease:i=>r.next(s*i).value/e,duration:zi(s)}}const er={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 V2(t,e){return t*Math.sqrt(1-e*e)}const wQ=12;function bQ(t,e,n){let r=n;for(let s=1;s<wQ;s++)r=r-t(r)/e(r);return r}const Rw=.001;function xQ({duration:t=er.duration,bounce:e=er.bounce,velocity:n=er.velocity,mass:r=er.mass}){let s,i,o=1-e;o=Jo(er.minDamping,er.maxDamping,o),t=Jo(er.minDuration,er.maxDuration,zi(t)),o<1?(s=d=>{const f=d*o,h=f*t,m=f-n,g=V2(d,o),_=Math.exp(-h);return Rw-m/g*_},i=d=>{const h=d*o*t,m=h*n+n,g=Math.pow(o,2)*Math.pow(d,2)*t,_=Math.exp(-h),y=V2(Math.pow(d,2),o);return(-s(d)+Rw>0?-1:1)*((m-g)*_)/y}):(s=d=>{const f=Math.exp(-d*t),h=(d-n)*t+1;return-Rw+f*h},i=d=>{const f=Math.exp(-d*t),h=(n-d)*(t*t);return f*h});const l=5/t,u=bQ(s,i,l);if(t=vi(t),isNaN(u))return{stiffness:er.stiffness,damping:er.damping,duration:t};{const d=Math.pow(u,2)*r;return{stiffness:d,damping:o*2*Math.sqrt(r*d),duration:t}}}const SQ=["duration","bounce"],kQ=["stiffness","damping","mass"];function bR(t,e){return e.some(n=>t[n]!==void 0)}function EQ(t){let e={velocity:er.velocity,stiffness:er.stiffness,damping:er.damping,mass:er.mass,isResolvedFromDuration:!1,...t};if(!bR(t,kQ)&&bR(t,SQ))if(e.velocity=0,t.visualDuration){const n=t.visualDuration,r=2*Math.PI/(n*1.2),s=r*r,i=2*Jo(.05,1,1-(t.bounce||0))*Math.sqrt(s);e={...e,mass:er.mass,stiffness:s,damping:i}}else{const n=xQ({...t,velocity:0});e={...e,...n,mass:er.mass},e.isResolvedFromDuration=!0}return e}function Tv(t=er.visualDuration,e=er.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:m,isResolvedFromDuration:g}=EQ({...n,velocity:-zi(n.velocity||0)}),_=m||0,y=d/(2*Math.sqrt(u*f)),b=o-i,x=zi(Math.sqrt(u/f)),S=Math.abs(b)<5;r||(r=S?er.restSpeed.granular:er.restSpeed.default),s||(s=S?er.restDelta.granular:er.restDelta.default);let E,C,R,O,I,A;if(y<1)R=V2(x,y),O=(_+y*x*b)/R,E=N=>{const H=Math.exp(-y*x*N);return o-H*(O*Math.sin(R*N)+b*Math.cos(R*N))},I=y*x*O+b*R,A=y*x*b-O*R,C=N=>Math.exp(-y*x*N)*(I*Math.sin(R*N)+A*Math.cos(R*N));else if(y===1){E=H=>o-Math.exp(-x*H)*(b+(_+x*b)*H);const N=_+x*b;C=H=>Math.exp(-x*H)*(x*N*H-_)}else{const N=x*Math.sqrt(y*y-1);E=X=>{const z=Math.exp(-y*x*X),K=Math.min(N*X,300);return o-z*((_+y*x*b)*Math.sinh(K)+N*b*Math.cosh(K))/N};const H=(_+y*x*b)/N,$=y*x*H-b*N,W=y*x*b-H*N;C=X=>{const z=Math.exp(-y*x*X),K=Math.min(N*X,300);return z*($*Math.sinh(K)+W*Math.cosh(K))}}const L={calculatedDuration:g&&h||null,velocity:N=>vi(C(N)),next:N=>{if(!g&&y<1){const $=Math.exp(-y*x*N),W=Math.sin(R*N),X=Math.cos(R*N),z=o-$*(O*W+b*X),K=vi($*(I*W+A*X));return l.done=Math.abs(K)<=r&&Math.abs(o-z)<=s,l.value=l.done?o:z,l}const H=E(N);if(g)l.done=N>=h;else{const $=vi(C(N));l.done=Math.abs($)<=r&&Math.abs(o-H)<=s}return l.value=l.done?o:H,l},toString:()=>{const N=Math.min(uk(L),Pv),H=CN($=>L.next(N*$).value,N,30);return N+"ms "+H},toTransition:()=>{}};return L}Tv.applyToOptions=t=>{const e=_Q(t,100,Tv);return t.ease=e.ease,t.duration=vi(e.duration),t.type="keyframes",t};const CQ=5;function PN(t,e,n){const r=Math.max(e-CQ,0);return oN(n-t(r),e-r)}function H2({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],m={done:!1,value:h},g=A=>l!==void 0&&A<l||u!==void 0&&A>u,_=A=>l===void 0?u:u===void 0||Math.abs(l-A)<Math.abs(u-A)?l:u;let y=n*e;const b=h+y,x=o===void 0?b:o(b);x!==b&&(y=x-h);const S=A=>-y*Math.exp(-A/r),E=A=>x+S(A),C=A=>{const L=S(A),N=E(A);m.done=Math.abs(L)<=d,m.value=m.done?x:N};let R,O;const I=A=>{g(m.value)&&(R=A,O=Tv({keyframes:[m.value,_(m.value)],velocity:PN(E,A,m.value),damping:s,stiffness:i,restDelta:d,restSpeed:f}))};return I(0),{calculatedDuration:null,next:A=>{let L=!1;return!O&&R===void 0&&(L=!0,C(A),I(A)),R!==void 0&&A>=R?O.next(A-R):(!L&&C(A),m)}}}function PQ(t,e,n){const r=[],s=n||Ql.mix||EN,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]||Bi:e;l=gm(u,l)}r.push(l)}return r}function TQ(t,e,{clamp:n=!0,ease:r,mixer:s}={}){const i=t.length;if(yy(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=PQ(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 m=Np(t[h],t[h+1],f);return l[h](m)};return n?f=>d(Jo(t[0],t[i-1],f)):d}function RQ(t,e){const n=t[t.length-1];for(let r=1;r<=e;r++){const s=Np(0,e,r);t.push(wn(n,1,s))}}function AQ(t){const e=[0];return RQ(e,t.length-1),e}function IQ(t,e){return t.map(n=>n*e)}function OQ(t,e){return t.map(()=>e||mN).splice(0,t.length-1)}function fp({duration:t=300,keyframes:e,times:n,ease:r="easeInOut"}){const s=zX(r)?r.map(mR):mR(r),i={done:!1,value:e[0]},o=IQ(n&&n.length===e.length?n:AQ(e),t),l=TQ(o,e,{ease:Array.isArray(s)?s:OQ(e,s)});return{calculatedDuration:t,next:u=>(i.value=l(u),i.done=u>=t,i)}}const MQ=t=>t!==null;function _y(t,{repeat:e,repeatType:n="loop"},r,s=1){const i=t.filter(MQ),l=s<0||e&&n!=="loop"&&e%2===1?0:i.length-1;return!l||r===void 0?i[l]:r}const LQ={decay:H2,inertia:H2,tween:fp,keyframes:fp,spring:Tv};function TN(t){typeof t.type=="string"&&(t.type=LQ[t.type])}class dk{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 NQ=t=>t/100;class Rv extends dk{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!==Cs.now()&&this.tick(Cs.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;TN(e);const{type:n=fp,repeat:r=0,repeatDelay:s=0,repeatType:i,velocity:o=0}=e;let{keyframes:l}=e;const u=n||fp;u!==fp&&typeof l[0]!="number"&&(this.mixKeyframes=gm(NQ,EN(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=uk(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:m,repeatDelay:g,type:_,onUpdate:y,finalKeyframe:b}=this.options;this.speed>0?this.startTime=Math.min(this.startTime,e):this.speed<0&&(this.startTime=Math.min(e-s/this.speed,this.startTime)),n?this.currentTime=e:this.updateTime(e);const x=this.currentTime-d*(this.playbackSpeed>=0?1:-1),S=this.playbackSpeed>=0?x<0:x>s;this.currentTime=Math.max(x,0),this.state==="finished"&&this.holdTime===null&&(this.currentTime=s);let E=this.currentTime,C=r;if(h){const A=Math.min(this.currentTime,s)/l;let L=Math.floor(A),N=A%1;!N&&A>=1&&(N=1),N===1&&L--,L=Math.min(L,h+1),!!(L%2)&&(m==="reverse"?(N=1-N,g&&(N-=g/l)):m==="mirror"&&(C=o)),E=Jo(0,1,N)*l}let R;S?(this.delayState.value=f[0],R=this.delayState):R=C.next(E),i&&!S&&(R.value=i(R.value));let{done:O}=R;!S&&u!==null&&(O=this.playbackSpeed>=0?this.currentTime>=s:this.currentTime<=0);const I=this.holdTime===null&&(this.state==="finished"||this.state==="running"&&O);return I&&_!==H2&&(R.value=_y(f,this.options,b,this.speed)),y&&y(R.value),I&&this.finish(),R}then(e,n){return this.finished.then(e,n)}get duration(){return zi(this.calculatedDuration)}get iterationDuration(){const{delay:e=0}=this.options||{};return this.duration+zi(e)}get time(){return zi(this.currentTime)}set time(e){e=vi(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 PN(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(Cs.now()),this.playbackSpeed=e,n&&this.driver&&(this.time=zi(this.currentTime))}play(){var s,i;if(this.isStopped)return;const{driver:e=yQ,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(Cs.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 DQ(t){for(let e=1;e<t.length;e++)t[e]??(t[e]=t[e-1])}const Wc=t=>t*180/Math.PI,U2=t=>{const e=Wc(Math.atan2(t[1],t[0]));return Z2(e)},$Q={x:4,y:5,translateX:4,translateY:5,scaleX:0,scaleY:3,scale:t=>(Math.abs(t[0])+Math.abs(t[3]))/2,rotate:U2,rotateZ:U2,skewX:t=>Wc(Math.atan(t[1])),skewY:t=>Wc(Math.atan(t[2])),skew:t=>(Math.abs(t[1])+Math.abs(t[2]))/2},Z2=t=>(t=t%360,t<0&&(t+=360),t),xR=U2,SR=t=>Math.sqrt(t[0]*t[0]+t[1]*t[1]),kR=t=>Math.sqrt(t[4]*t[4]+t[5]*t[5]),FQ={x:12,y:13,z:14,translateX:12,translateY:13,translateZ:14,scaleX:SR,scaleY:kR,scale:t=>(SR(t)+kR(t))/2,rotateX:t=>Z2(Wc(Math.atan2(t[6],t[5]))),rotateY:t=>Z2(Wc(Math.atan2(-t[2],t[0]))),rotateZ:xR,rotate:xR,skewX:t=>Wc(Math.atan(t[4])),skewY:t=>Wc(Math.atan(t[1])),skew:t=>(Math.abs(t[1])+Math.abs(t[4]))/2};function B2(t){return t.includes("scale")?1:0}function W2(t,e){if(!t||t==="none")return B2(e);const n=t.match(/^matrix3d\(([-\d.e\s,]+)\)$/u);let r,s;if(n)r=FQ,s=n;else{const l=t.match(/^matrix\(([-\d.e\s,]+)\)$/u);r=$Q,s=l}if(!s)return B2(e);const i=r[e],o=s[1].split(",").map(zQ);return typeof i=="function"?i(o):o[i]}const jQ=(t,e)=>{const{transform:n="none"}=getComputedStyle(t);return W2(n,e)};function zQ(t){return parseFloat(t.trim())}const $f=["transformPerspective","x","y","z","translateX","translateY","translateZ","scale","scaleX","scaleY","rotate","rotateX","rotateY","rotateZ","skew","skewX","skewY"],Ff=new Set([...$f,"pathRotation"]),ER=t=>t===Df||t===Ge,VQ=new Set(["x","y","z"]),HQ=$f.filter(t=>!VQ.has(t));function UQ(t){const e=[];return HQ.forEach(n=>{const r=t.getValue(n);r!==void 0&&(e.push([n,r.get()]),r.set(n.startsWith("scale")?1:0))}),e}const Nl={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})=>W2(e,"x"),y:(t,{transform:e})=>W2(e,"y")};Nl.translateX=Nl.x;Nl.translateY=Nl.y;const au=new Set;let K2=!1,G2=!1,q2=!1;function RN(){if(G2){const t=Array.from(au).filter(r=>r.needsMeasurement),e=new Set(t.map(r=>r.element)),n=new Map;e.forEach(r=>{const s=UQ(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)})}G2=!1,K2=!1,au.forEach(t=>t.complete(q2)),au.clear()}function AN(){au.forEach(t=>{t.readKeyframes(),t.needsMeasurement&&(G2=!0)})}function ZQ(){q2=!0,AN(),RN(),q2=!1}class fk{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?(au.add(this),K2||(K2=!0,bn.read(AN),bn.resolveKeyframes(RN))):(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])}DQ(e)}setFinalKeyframe(){}measureInitialState(){}renderEndStyles(){}measureEndState(){}complete(e=!1){this.state="complete",this.onComplete(this.unresolvedKeyframes,this.finalKeyframe,e),au.delete(this)}cancel(){this.state==="scheduled"&&(au.delete(this),this.state="pending")}resume(){this.state==="pending"&&this.scheduleResolve()}}const BQ=t=>t.startsWith("--");function IN(t,e,n){BQ(e)?t.style.setProperty(e,n):t.style[e]=n}const WQ={};function ON(t,e){const n=iN(t);return()=>WQ[e]??n()}const KQ=ON(()=>window.ScrollTimeline!==void 0,"scrollTimeline"),MN=ON(()=>{try{document.createElement("div").animate({opacity:0},{easing:"linear(0, 1)"})}catch{return!1}return!0},"linearEasing"),Kh=([t,e,n,r])=>`cubic-bezier(${t}, ${e}, ${n}, ${r})`,CR={linear:"linear",ease:"ease",easeIn:"ease-in",easeOut:"ease-out",easeInOut:"ease-in-out",circIn:Kh([0,.65,.55,1]),circOut:Kh([.55,0,1,.45]),backIn:Kh([.31,.01,.66,-.59]),backOut:Kh([.33,1.53,.69,.99])};function LN(t,e){if(t)return typeof t=="function"?MN()?CN(t,e):"ease-out":gN(t)?Kh(t):Array.isArray(t)?t.map(n=>LN(n,e)||CR.easeOut):CR[t]}function GQ(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=LN(l,s);Array.isArray(h)&&(f.easing=h);const m={delay:r,duration:s,easing:Array.isArray(h)?"linear":h,fill:"both",iterations:i+1,direction:o==="reverse"?"alternate":"normal"};return d&&(m.pseudoElement=d),t.animate(f,m)}function NN(t){return typeof t=="function"&&"applyToOptions"in t}function qQ({type:t,...e}){return NN(t)&&MN()?t.applyToOptions(e):(e.duration??(e.duration=300),e.ease??(e.ease="easeOut"),e)}class DN extends dk{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,yy(typeof e.type!="string");const d=qQ(e);this.animation=GQ(n,r,s,d,i),d.autoplay===!1&&this.animation.pause(),this.animation.onfinish=()=>{if(this.finishedTime=this.time,!i){const f=_y(s,this.options,l,this.speed);this.updateMotionValue&&this.updateMotionValue(f),IN(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 zi(Number(e))}get iterationDuration(){const{delay:e=0}=this.options||{};return this.duration+zi(e)}get time(){return zi(Number(this.animation.currentTime)||0)}set time(e){const n=this.finishedTime!==null;this.manualStartTime=null,this.finishedTime=null,this.animation.currentTime=vi(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&&KQ()?(this.animation.timeline=e,n&&(this.animation.rangeStart=n),r&&(this.animation.rangeEnd=r),Bi):s(this)}}const $N={anticipate:fN,backInOut:dN,circInOut:pN};function YQ(t){return t in $N}function XQ(t){typeof t.ease=="string"&&YQ(t.ease)&&(t.ease=$N[t.ease])}const Aw=10;class QQ extends DN{constructor(e){XQ(e),TN(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 Rv({...o,autoplay:!1}),u=Math.max(Aw,Cs.now()-this.startTime),d=Jo(0,Aw,u-Aw),f=l.sample(u).value,{name:h}=this.options;i&&h&&IN(i,h,f),n.setWithVelocity(l.sample(Math.max(0,u-d)).value,f,d),l.stop()}}const PR=(t,e)=>e==="zIndex"?!1:!!(typeof t=="number"||Array.isArray(t)||typeof t=="string"&&(po.test(t)||t==="0")&&!t.startsWith("url("));function JQ(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 eJ(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=PR(s,e),l=PR(i,e);return!o||!l?!1:JQ(t)||(n==="spring"||NN(n))&&r}function Y2(t){t.duration=0,t.type="keyframes"}const FN=new Set(["opacity","clipPath","filter","transform","backgroundColor"]),tJ=/^(?:oklch|oklab|lab|lch|color|color-mix|light-dark)\(/;function nJ(t){for(let e=0;e<t.length;e++)if(typeof t[e]=="string"&&tJ.test(t[e]))return!0;return!1}const rJ=new Set(["color","backgroundColor","outlineColor","fill","stroke","borderColor","borderTopColor","borderRightColor","borderBottomColor","borderLeftColor"]),sJ=iN(()=>Object.hasOwnProperty.call(Element.prototype,"animate"));function iJ(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 sJ()&&n&&(FN.has(n)||rJ.has(n)&&nJ(l))&&(n!=="transform"||!f)&&!d&&!r&&s!=="mirror"&&i!==0&&o!=="inertia"}const oJ=40;class aJ extends dk{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 _;super(),this.stop=()=>{var y,b;this._animation&&(this._animation.stop(),(y=this.stopTimeline)==null||y.call(this)),(b=this.keyframeResolver)==null||b.cancel()},this.createdAt=Cs.now();const m={autoplay:e,delay:n,type:r,repeat:s,repeatDelay:i,repeatType:o,name:u,motionValue:d,element:f,...h},g=(f==null?void 0:f.KeyframeResolver)||fk;this.keyframeResolver=new g(l,(y,b,x)=>this.onKeyframesResolved(y,b,m,!x),u,d,f),(_=this.keyframeResolver)==null||_.scheduleResolve()}onKeyframesResolved(e,n,r,s){var x,S;this.keyframeResolver=void 0;const{name:i,type:o,velocity:l,delay:u,isHandoff:d,onUpdate:f}=r;this.resolvedAt=Cs.now();let h=!0;eJ(e,i,o,l)||(h=!1,(Ql.instantAnimations||!u)&&(f==null||f(_y(e,r,n))),e[0]=e[e.length-1],Y2(r),r.repeat=0);const g={startTime:s?this.resolvedAt?this.resolvedAt-this.createdAt>oJ?this.resolvedAt:this.createdAt:this.createdAt:void 0,finalKeyframe:n,...r,keyframes:e},_=h&&!d&&iJ(g),y=(S=(x=g.motionValue)==null?void 0:x.owner)==null?void 0:S.current;let b;if(_)try{b=new QQ({...g,element:y})}catch{b=new Rv(g)}else b=new Rv(g);b.finished.then(()=>{this.notifyFinished()}).catch(Bi),this.pendingTimeline&&(this.stopTimeline=b.attachTimeline(this.pendingTimeline),this.pendingTimeline=void 0),this._animation=b}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(),ZQ()),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 jN(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 TR=30,lJ=t=>!isNaN(parseFloat(t));class cJ{constructor(e,n={}){this.canTrackVelocity=null,this.events={},this.updateAndNotify=r=>{var i;const s=Cs.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=Cs.now(),this.canTrackVelocity===null&&e!==void 0&&(this.canTrackVelocity=lJ(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 rk);const r=this.events[e].add(n);return e==="change"?()=>{r(),bn.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=Cs.now();if(!this.canTrackVelocity||this.prevFrameValue===void 0||e-this.updatedAt>TR)return 0;const n=Math.min(this.updatedAt-this.prevUpdatedAt,TR);return oN(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 xf(t,e){return new cJ(t,e)}function hk(t,e){if(t!=null&&t.inherit&&e){const{inherit:n,...r}=t;return{...e,...r}}return t}function pk(t,e){const n=(t==null?void 0:t[e])??(t==null?void 0:t.default)??t;return n!==t?hk(n,t):n}const uJ={type:"spring",stiffness:500,damping:25,restSpeed:10},dJ=t=>({type:"spring",stiffness:550,damping:t===0?2*Math.sqrt(550):30,restSpeed:10}),fJ={type:"keyframes",duration:.8},hJ={type:"keyframes",ease:[.25,.1,.35,1],duration:.3},pJ=(t,{keyframes:e})=>e.length>2?fJ:Ff.has(t)?t.startsWith("scale")?dJ(e[1]):uJ:hJ,mJ=new Set(["when","delay","delayChildren","staggerChildren","staggerDirection","repeat","repeatType","repeatDelay","from","elapsed"]);function gJ(t){for(const e in t)if(!mJ.has(e))return!0;return!1}const mk=(t,e,n,r={},s,i)=>o=>{const l=pk(r,t)||{},u=l.delay||r.delay||0;let{elapsed:d=0}=r;d=d-vi(u);const f={keyframes:Array.isArray(n)?n:[null,n],ease:"easeOut",velocity:e.getVelocity(),...l,delay:-d,onUpdate:m=>{e.set(m),l.onUpdate&&l.onUpdate(m)},onComplete:()=>{o(),l.onComplete&&l.onComplete()},name:t,motionValue:e,element:i?void 0:s};gJ(l)||Object.assign(f,pJ(t,f)),f.duration&&(f.duration=vi(f.duration)),f.repeatDelay&&(f.repeatDelay=vi(f.repeatDelay)),f.from!==void 0&&(f.keyframes[0]=f.from);let h=!1;if((f.type===!1||f.duration===0&&!f.repeatDelay)&&(Y2(f),f.delay===0&&(h=!0)),(Ql.instantAnimations||Ql.skipAnimations||s!=null&&s.shouldSkipAnimations||l.skipAnimations)&&(h=!0,Y2(f),f.delay=0),f.allowFlatten=!l.type&&!l.ease,h&&!i&&e.get()!==void 0){const m=_y(f.keyframes,l);if(m!==void 0){bn.update(()=>{f.onUpdate(m),f.onComplete()});return}}return l.isSync?new Rv(f):new aJ(f)},vJ=/^var\(--(?:([\w-]+)|([\w-]+), ?([a-zA-Z\d ()%#.,-]+))\)/u;function yJ(t){const e=vJ.exec(t);if(!e)return[,];const[,n,r,s]=e;return[`--${n??r}`,s]}function zN(t,e,n=1){const[r,s]=yJ(t);if(!r)return;const i=window.getComputedStyle(e).getPropertyValue(r);if(i){const o=i.trim();return nN(o)?parseFloat(o):o}return ok(s)?zN(s,e,n+1):s}function RR(t){const e=[{},{}];return t==null||t.values.forEach((n,r)=>{e[0][r]=n.get(),e[1][r]=n.getVelocity()}),e}function gk(t,e,n,r){if(typeof e=="function"){const[s,i]=RR(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]=RR(r);e=e(n!==void 0?n:t.custom,s,i)}return e}function lu(t,e,n){const r=t.getProps();return gk(r,e,n!==void 0?n:r.custom,t)}const VN=new Set(["width","height","top","left","right","bottom",...$f]),X2=t=>Array.isArray(t);function _J(t,e,n){t.hasValue(e)?t.getValue(e).set(n):t.addValue(e,xf(n))}function wJ(t){return X2(t)?t[t.length-1]||0:t}function bJ(t,e){const n=lu(t,e);let{transitionEnd:r={},transition:s={},...i}=n||{};i={...i,...r};for(const o in i){const l=wJ(i[o]);_J(t,o,l)}}const Gr=t=>!!(t&&t.getVelocity);function xJ(t){return!!(Gr(t)&&t.add)}function Q2(t,e){const n=t.getValue("willChange");if(xJ(n))return n.add(e);if(!n&&Ql.WillChange){const r=new Ql.WillChange("auto");t.addValue("willChange",r),r.add(e)}}function vk(t){return t.replace(/([A-Z])/g,e=>`-${e.toLowerCase()}`)}const SJ="framerAppearId",HN="data-"+vk(SJ);function UN(t){return t.props[HN]}function kJ({protectedKeys:t,needsAnimating:e},n){const r=t.hasOwnProperty(n)&&e[n]!==!0;return e[n]=!1,r}function ZN(t,e,{delay:n=0,transitionOverride:r,type:s}={}){let{transition:i,transitionEnd:o,...l}=e;const u=t.getDefaultTransition();i=i?hk(i,u):u;const d=i==null?void 0:i.reduceMotion,f=i==null?void 0:i.skipAnimations;r&&(i=r);const h=[],m=s&&t.animationState&&t.animationState.getState()[s],g=i==null?void 0:i.path;g&&g.animateVisualElement(t,l,i,n,h);for(const _ in l){const y=t.getValue(_,t.latestValues[_]??null),b=l[_];if(b===void 0||m&&kJ(m,_))continue;const x={delay:n,...pk(i||{},_)};f&&(x.skipAnimations=!0);const S=y.get();if(S!==void 0&&!y.isAnimating()&&!Array.isArray(b)&&b===S&&!x.velocity){bn.update(()=>y.set(b));continue}let E=!1;if(window.MotionHandoffAnimation){const O=UN(t);if(O){const I=window.MotionHandoffAnimation(O,_,bn);I!==null&&(x.startTime=I,E=!0)}}Q2(t,_);const C=d??t.shouldReduceMotion;y.start(mk(_,y,b,C&&VN.has(_)?{type:!1}:x,t,E));const R=y.animation;R&&h.push(R)}if(o){const _=()=>bn.update(()=>{o&&bJ(t,o)});h.length?Promise.all(h).then(_):_()}return h}function J2(t,e,n={}){var u;const r=lu(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(ZN(t,r,n)):()=>Promise.resolve(),o=t.variantChildren&&t.variantChildren.size?(d=0)=>{const{delayChildren:f=0,staggerChildren:h,staggerDirection:m}=s;return EJ(t,e,d,f,h,m,n)}:()=>Promise.resolve(),{when:l}=s;if(l){const[d,f]=l==="beforeChildren"?[i,o]:[o,i];return d().then(()=>f())}else return Promise.all([i(),o(n.delay)])}function EJ(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(J2(u,e,{...o,delay:n+(typeof r=="function"?0:r)+jN(t.variantChildren,u,r,s,i)}).then(()=>u.notify("AnimationComplete",e)));return Promise.all(l)}function CJ(t,e,n={}){t.notify("AnimationStart",e);let r;if(Array.isArray(e)){const s=e.map(i=>J2(t,i,n));r=Promise.all(s)}else if(typeof e=="string")r=J2(t,e,n);else{const s=typeof e=="function"?lu(t,e,n.custom):e;r=Promise.all(ZN(t,s,n))}return r.then(()=>{t.notify("AnimationComplete",e)})}const PJ={test:t=>t==="auto",parse:t=>t},BN=t=>e=>e.test(t),WN=[Df,Ge,qo,ba,JX,QX,PJ],AR=t=>WN.find(BN(t));function TJ(t){return typeof t=="number"?t===0:t!==null?t==="none"||t==="0"||sN(t):!0}const RJ=new Set(["brightness","contrast","saturate","opacity"]);function AJ(t){const[e,n]=t.slice(0,-1).split("(");if(e==="drop-shadow")return t;const[r]=n.match(ak)||[];if(!r)return t;const s=n.replace(r,"");let i=RJ.has(e)?1:0;return r!==n&&(i*=100),e+"("+i+s+")"}const IJ=/\b([a-z-]*)\(.*?\)/gu,ex={...po,getAnimatableNone:t=>{const e=t.match(IJ);return e?e.map(AJ).join(" "):t}},tx={...po,getAnimatableNone:t=>{const e=po.parse(t);return po.createTransformer(t)(e.map(r=>typeof r=="number"?0:typeof r=="object"?{...r,alpha:1}:r))}},IR={...Df,transform:Math.round},OJ={rotate:ba,pathRotation:ba,rotateX:ba,rotateY:ba,rotateZ:ba,scale:K0,scaleX:K0,scaleY:K0,scaleZ:K0,skew:ba,skewX:ba,skewY:ba,distance:Ge,translateX:Ge,translateY:Ge,translateZ:Ge,x:Ge,y:Ge,z:Ge,perspective:Ge,transformPerspective:Ge,opacity:Dp,originX:vR,originY:vR,originZ:Ge},Av={borderWidth:Ge,borderTopWidth:Ge,borderRightWidth:Ge,borderBottomWidth:Ge,borderLeftWidth:Ge,borderRadius:Ge,borderTopLeftRadius:Ge,borderTopRightRadius:Ge,borderBottomRightRadius:Ge,borderBottomLeftRadius:Ge,width:Ge,maxWidth:Ge,height:Ge,maxHeight:Ge,top:Ge,right:Ge,bottom:Ge,left:Ge,inset:Ge,insetBlock:Ge,insetBlockStart:Ge,insetBlockEnd:Ge,insetInline:Ge,insetInlineStart:Ge,insetInlineEnd:Ge,padding:Ge,paddingTop:Ge,paddingRight:Ge,paddingBottom:Ge,paddingLeft:Ge,paddingBlock:Ge,paddingBlockStart:Ge,paddingBlockEnd:Ge,paddingInline:Ge,paddingInlineStart:Ge,paddingInlineEnd:Ge,margin:Ge,marginTop:Ge,marginRight:Ge,marginBottom:Ge,marginLeft:Ge,marginBlock:Ge,marginBlockStart:Ge,marginBlockEnd:Ge,marginInline:Ge,marginInlineStart:Ge,marginInlineEnd:Ge,fontSize:Ge,backgroundPositionX:Ge,backgroundPositionY:Ge,...OJ,zIndex:IR,fillOpacity:Dp,strokeOpacity:Dp,numOctaves:IR},MJ={...Av,color:fr,backgroundColor:fr,outlineColor:fr,fill:fr,stroke:fr,borderColor:fr,borderTopColor:fr,borderRightColor:fr,borderBottomColor:fr,borderLeftColor:fr,filter:ex,WebkitFilter:ex,mask:tx,WebkitMask:tx},KN=t=>MJ[t],LJ=new Set([ex,tx]);function GN(t,e){let n=KN(t);return LJ.has(n)||(n=po),n.getAnimatableNone?n.getAnimatableNone(e):void 0}const NJ=new Set(["auto","none","0"]);function DJ(t,e,n){let r=0,s;for(;r<t.length&&!s;){const i=t[r];typeof i=="string"&&!NJ.has(i)&&bf(i).values.length&&(s=t[r]),r++}if(s&&n)for(const i of e)t[i]=GN(n,s)}class $J extends fk{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(),ok(h))){const m=zN(h,n.current);m!==void 0&&(e[f]=m),f===e.length-1&&(this.finalKeyframe=h)}}if(this.resolveNoneKeyframes(),!VN.has(r)||e.length!==2)return;const[s,i]=e,o=AR(s),l=AR(i),u=gR(s),d=gR(i);if(u!==d&&Nl[r]){this.needsMeasurement=!0;return}if(o!==l)if(ER(o)&&ER(l))for(let f=0;f<e.length;f++){const h=e[f];typeof h=="string"&&(e[f]=parseFloat(h))}else Nl[r]&&(this.needsMeasurement=!0)}resolveNoneKeyframes(){const{unresolvedKeyframes:e,name:n}=this,r=[];for(let s=0;s<e.length;s++)(e[s]===null||TJ(e[s]))&&r.push(s);r.length&&DJ(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=Nl[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]=Nl[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 yk=["borderTopLeftRadius","borderTopRightRadius","borderBottomRightRadius","borderBottomLeftRadius"];function qN(t,e,n){if(t==null)return[];if(t instanceof EventTarget)return[t];if(typeof t=="string"){let r=document;const s=(n==null?void 0:n[t])??r.querySelectorAll(t);return s?Array.from(s):[]}return Array.from(t).filter(r=>r!=null)}const nx=(t,e)=>e&&typeof t=="number"?e.transform(t):t;function Cg(t){return rN(t)&&"offsetHeight"in t&&!("ownerSVGElement"in t)}const{schedule:_k}=vN(queueMicrotask,!1),oo={x:!1,y:!1};function YN(){return oo.x||oo.y}function FJ(t){return t==="x"||t==="y"?oo[t]?null:(oo[t]=!0,()=>{oo[t]=!1}):oo.x||oo.y?null:(oo.x=oo.y=!0,()=>{oo.x=oo.y=!1})}function XN(t,e){const n=qN(t),r=new AbortController,s={passive:!0,...e,signal:r.signal};return[n,s,()=>r.abort()]}function jJ(t){return!(t.pointerType==="touch"||YN())}function zJ(t,e,n={}){const[r,s,i]=XN(t,n);return r.forEach(o=>{let l=!1,u=!1,d;const f=()=>{o.removeEventListener("pointerleave",_)},h=b=>{d&&(d(b),d=void 0),f()},m=b=>{l=!1,window.removeEventListener("pointerup",m),window.removeEventListener("pointercancel",m),u&&(u=!1,h(b))},g=()=>{l=!0,window.addEventListener("pointerup",m,s),window.addEventListener("pointercancel",m,s)},_=b=>{if(b.pointerType!=="touch"){if(l){u=!0;return}h(b)}},y=b=>{if(!jJ(b))return;u=!1;const x=e(o,b);typeof x=="function"&&(d=x,o.addEventListener("pointerleave",_,s))};o.addEventListener("pointerenter",y,s),o.addEventListener("pointerdown",g,s)}),i}const QN=(t,e)=>e?t===e?!0:QN(t,e.parentElement):!1,wk=t=>t.pointerType==="mouse"?typeof t.button!="number"||t.button<=0:t.isPrimary!==!1,VJ=new Set(["BUTTON","INPUT","SELECT","TEXTAREA","A"]);function HJ(t){return VJ.has(t.tagName)||t.isContentEditable===!0}const UJ=new Set(["INPUT","SELECT","TEXTAREA"]);function ZJ(t){return UJ.has(t.tagName)||t.isContentEditable===!0}const Pg=new WeakSet;function OR(t){return e=>{e.key==="Enter"&&t(e)}}function Iw(t,e){t.dispatchEvent(new PointerEvent("pointer"+e,{isPrimary:!0,bubbles:!0}))}const BJ=(t,e)=>{const n=t.currentTarget;if(!n)return;const r=OR(()=>{if(Pg.has(n))return;Iw(n,"down");const s=OR(()=>{Iw(n,"up")}),i=()=>Iw(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 MR(t){return wk(t)&&!YN()}const LR=new WeakSet;function WJ(t,e,n={}){const[r,s,i]=XN(t,n),o=l=>{const u=l.currentTarget;if(!MR(l)||LR.has(l))return;Pg.add(u),n.stopPropagation&&LR.add(l);const d=e(u,l),f={...s,capture:!0},h=(_,y)=>{window.removeEventListener("pointerup",m,f),window.removeEventListener("pointercancel",g,f),Pg.has(u)&&Pg.delete(u),MR(_)&&typeof d=="function"&&d(_,{success:y})},m=_=>{h(_,u===window||u===document||n.useGlobalTarget||QN(u,_.target))},g=_=>{h(_,!1)};window.addEventListener("pointerup",m,f),window.addEventListener("pointercancel",g,f)};return r.forEach(l=>{(n.useGlobalTarget?window:l).addEventListener("pointerdown",o,s),Cg(l)&&(l.addEventListener("focus",d=>BJ(d,s)),!HJ(l)&&!l.hasAttribute("tabindex")&&(l.tabIndex=0))}),i}function bk(t){return rN(t)&&"ownerSVGElement"in t}const Tg=new WeakMap;let _l;const JN=(t,e,n)=>(r,s)=>s&&s[0]?s[0][t+"Size"]:bk(r)&&"getBBox"in r?r.getBBox()[e]:r[n],KJ=JN("inline","width","offsetWidth"),GJ=JN("block","height","offsetHeight");function qJ({target:t,borderBoxSize:e}){var n;(n=Tg.get(t))==null||n.forEach(r=>{r(t,{get width(){return KJ(t,e)},get height(){return GJ(t,e)}})})}function YJ(t){t.forEach(qJ)}function XJ(){typeof ResizeObserver>"u"||(_l=new ResizeObserver(YJ))}function QJ(t,e){_l||XJ();const n=qN(t);return n.forEach(r=>{let s=Tg.get(r);s||(s=new Set,Tg.set(r,s)),s.add(e),_l==null||_l.observe(r)}),()=>{n.forEach(r=>{const s=Tg.get(r);s==null||s.delete(e),s!=null&&s.size||_l==null||_l.unobserve(r)})}}const Rg=new Set;let Td;function JJ(){Td=()=>{const t={get width(){return window.innerWidth},get height(){return window.innerHeight}};Rg.forEach(e=>e(t))},window.addEventListener("resize",Td)}function eee(t){return Rg.add(t),Td||JJ(),()=>{Rg.delete(t),!Rg.size&&typeof Td=="function"&&(window.removeEventListener("resize",Td),Td=void 0)}}function NR(t,e){return typeof t=="function"?eee(t):QJ(t,e)}function tee(t){return bk(t)&&t.tagName==="svg"}const nee=[...WN,fr,po],ree=t=>nee.find(BN(t)),DR=()=>({translate:0,scale:1,origin:0,originPoint:0}),Rd=()=>({x:DR(),y:DR()}),$R=()=>({min:0,max:0}),Sr=()=>({x:$R(),y:$R()}),see=new WeakMap;function wy(t){return t!==null&&typeof t=="object"&&typeof t.start=="function"}function $p(t){return typeof t=="string"||Array.isArray(t)}const xk=["animate","whileInView","whileFocus","whileHover","whileTap","whileDrag","exit"],Sk=["initial",...xk];function by(t){return wy(t.animate)||Sk.some(e=>$p(t[e]))}function eD(t){return!!(by(t)||t.variants)}function iee(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,xf(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,xf(o!==void 0?o:s,{owner:t}))}}for(const r in n)e[r]===void 0&&t.removeValue(r);return e}const Iv={current:null},kk={current:!1},oee=typeof window<"u";function tD(){if(kk.current=!0,!!oee)if(window.matchMedia){const t=window.matchMedia("(prefers-reduced-motion)"),e=()=>Iv.current=t.matches;t.addEventListener("change",e),e()}else Iv.current=!1}const FR=["AnimationStart","AnimationComplete","Update","BeforeLayoutMeasure","LayoutMeasure","LayoutAnimationStart","LayoutAnimationComplete"];let Ov={};function nD(t){Ov=t}function aee(){return Ov}class lee{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=fk,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 g=Cs.now();this.renderScheduledAt<g&&(this.renderScheduledAt=g,bn.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=by(n),this.isVariantNode=eD(n),this.isVariantNode&&(this.variantChildren=new Set),this.manuallyAnimateOnMount=!!(e&&e.current);const{willChange:h,...m}=this.scrapeMotionValuesFromProps(n,{},this);for(const g in m){const _=m[g];d[g]!==void 0&&Gr(_)&&_.set(d[g])}}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,see.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:(kk.current||tD(),this.shouldReduceMotion=Iv.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(),Jl(this.notifyUpdate),Jl(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&&FN.has(e)&&this.current instanceof HTMLElement){const{factory:o,keyframes:l,times:u,ease:d,duration:f}=n.accelerate,h=new DN({element:this.current,name:e,keyframes:l,times:u,ease:d,duration:vi(f)}),m=o(h);this.valueSubscriptions.set(e,()=>{m(),h.cancel()});return}const r=Ff.has(e);r&&this.onBindTransform&&this.onBindTransform();const s=n.on("change",o=>{this.latestValues[e]=o,this.props.onUpdate&&bn.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 Ov){const n=Ov[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):Sr()}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<FR.length;r++){const s=FR[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=iee(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=xf(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"&&(nN(r)||sN(r))?r=parseFloat(r):!ree(r)&&po.test(n)&&(r=GN(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=gk(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 rk),this.events[e].add(n)}notify(e,...n){this.events[e]&&this.events[e].notify(...n)}scheduleRenderMicrotask(){_k.render(this.render)}}class rD extends lee{constructor(){super(...arguments),this.KeyframeResolver=$J}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 ac{constructor(e){this.isMounted=!1,this.node=e}update(){}}function sD({top:t,left:e,right:n,bottom:r}){return{x:{min:e,max:n},y:{min:t,max:r}}}function cee({x:t,y:e}){return{top:e.min,right:t.max,bottom:e.max,left:t.min}}function uee(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 Ow(t){return t===void 0||t===1}function rx({scale:t,scaleX:e,scaleY:n}){return!Ow(t)||!Ow(e)||!Ow(n)}function Hc(t){return rx(t)||iD(t)||t.z||t.rotate||t.rotateX||t.rotateY||t.skewX||t.skewY}function iD(t){return jR(t.x)||jR(t.y)}function jR(t){return t&&t!=="0%"}function Mv(t,e,n){const r=t-n,s=e*r;return n+s}function zR(t,e,n,r,s){return s!==void 0&&(t=Mv(t,s,r)),Mv(t,n,r)+e}function sx(t,e=0,n=1,r,s){t.min=zR(t.min,e,n,r,s),t.max=zR(t.max,e,n,r,s)}function oD(t,{x:e,y:n}){sx(t.x,e.translate,e.scale,e.originPoint),sx(t.y,n.translate,n.scale,n.originPoint)}const VR=.999999999999,HR=1.0000000000001;function dee(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&&(Vo(t.x,-i.scroll.offset.x),Vo(t.y,-i.scroll.offset.y)),o&&(e.x*=o.x.scale,e.y*=o.y.scale,oD(t,o)),r&&Hc(i.latestValues)&&Ag(t,i.latestValues,(l=i.layout)==null?void 0:l.layoutBox))}e.x<HR&&e.x>VR&&(e.x=1),e.y<HR&&e.y>VR&&(e.y=1)}function Vo(t,e){t.min+=e,t.max+=e}function UR(t,e,n,r,s=.5){const i=wn(t.min,t.max,s);sx(t,e,n,i,r)}function ZR(t,e){return typeof t=="string"?parseFloat(t)/100*(e.max-e.min):t}function Ag(t,e,n){const r=n??t;UR(t.x,ZR(e.x,r.x),e.scaleX,e.scale,e.originX),UR(t.y,ZR(e.y,r.y),e.scaleY,e.scale,e.originY)}function aD(t,e){return sD(uee(t.getBoundingClientRect(),e))}function fee(t,e,n){const r=aD(t,n),{scroll:s}=e;return s&&(Vo(r.x,s.offset.x),Vo(r.y,s.offset.y)),r}const hee={x:"translateX",y:"translateY",z:"translateZ",transformPerspective:"perspective"},pee=$f.length;function mee(t,e,n){let r="",s=!0;for(let o=0;o<pee;o++){const l=$f[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=nx(u,Av[l]);if(!d){s=!1;const h=hee[l]||l;r+=`${h}(${f}) `}n&&(e[l]=f)}}const i=t.pathRotation;return i&&(s=!1,r+=`rotate(${nx(i,Av.pathRotation)}) `),r=r.trim(),n?r=n(e,s?"":r):s&&(r="none"),r}function Ek(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(Ff.has(u)){o=!0;continue}else if(_N(u)){s[u]=d;continue}else{const f=nx(d,Av[u]);u.startsWith("origin")?(l=!0,i[u]=f):r[u]=f}}if(e.transform||(o||n?r.transform=mee(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 lD(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 BR(t,e){return e.max===e.min?0:t/(e.max-e.min)*100}const Ih={correct:(t,e)=>{if(!e.target)return t;if(typeof t=="string")if(Ge.test(t))t=parseFloat(t);else return t;const n=BR(t,e.target.x),r=BR(t,e.target.y);return`${n}% ${r}%`}},gee={correct:(t,{treeScale:e,projectionDelta:n})=>{const r=t,s=po.parse(t);if(s.length>5)return r;const i=po.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=wn(l,u,.5);return typeof s[2+o]=="number"&&(s[2+o]/=d),typeof s[3+o]=="number"&&(s[3+o]/=d),i(s)}},ix={borderRadius:{...Ih,applyTo:[...yk]},borderTopLeftRadius:Ih,borderTopRightRadius:Ih,borderBottomLeftRadius:Ih,borderBottomRightRadius:Ih,boxShadow:gee};function cD(t,{layout:e,layoutId:n}){return Ff.has(t)||t.startsWith("origin")||(e||n!==void 0)&&(!!ix[t]||t==="opacity")}function Ck(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])||cD(l,t)||((o=n==null?void 0:n.getValue(l))==null?void 0:o.liveStyle)!==void 0)&&(i[l]=r[l]);return i}function vee(t){return window.getComputedStyle(t)}class yee extends rD{constructor(){super(...arguments),this.type="html",this.renderInstance=lD}mount(e){yy(!!e.style),super.mount(e)}readValueFromInstance(e,n){var r;if(Ff.has(n))return(r=this.projection)!=null&&r.isProjecting?B2(n):jQ(e,n);{const s=vee(e),i=(_N(n)?s.getPropertyValue(n):s[n])||0;return typeof i=="string"?i.trim():i}}measureInstanceViewportBox(e,{transformPagePoint:n}){return aD(e,n)}build(e,n,r){Ek(e,n,r.transformTemplate)}scrapeMotionValuesFromProps(e,n,r){return Ck(e,n,r)}}const _ee={offset:"stroke-dashoffset",array:"stroke-dasharray"},wee={offset:"strokeDashoffset",array:"strokeDasharray"};function bee(t,e,n=1,r=0,s=!0){t.pathLength=1;const i=s?_ee:wee;t[i.offset]=`${-r}`,t[i.array]=`${e} ${n}`}const xee=["offsetDistance","offsetPath","offsetRotate","offsetAnchor"];function uD(t,{attrX:e,attrY:n,attrScale:r,pathLength:s,pathSpacing:i=1,pathOffset:o=0,...l},u,d,f){if(Ek(t,l,d),u){t.style.viewBox&&(t.attrs.viewBox=t.style.viewBox);return}t.attrs=t.style,t.style={};const{attrs:h,style:m}=t;h.transform&&(m.transform=h.transform,delete h.transform),(m.transform||h.transformOrigin)&&(m.transformOrigin=h.transformOrigin??"50% 50%",delete h.transformOrigin),m.transform&&(m.transformBox=(f==null?void 0:f.transformBox)??"fill-box",delete h.transformBox);for(const g of xee)h[g]!==void 0&&(m[g]=h[g],delete h[g]);e!==void 0&&(h.x=e),n!==void 0&&(h.y=n),r!==void 0&&(h.scale=r),s!==void 0&&bee(h,s,i,o,!1)}const dD=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"]),fD=t=>typeof t=="string"&&t.toLowerCase()==="svg";function See(t,e,n,r){lD(t,e,void 0,r);for(const s in e.attrs)t.setAttribute(dD.has(s)?s:vk(s),e.attrs[s])}function hD(t,e,n){const r=Ck(t,e,n);for(const s in t)if(Gr(t[s])||Gr(e[s])){const i=$f.indexOf(s)!==-1?"attr"+s.charAt(0).toUpperCase()+s.substring(1):s;r[i]=t[s]}return r}class kee extends rD{constructor(){super(...arguments),this.type="svg",this.isSVGTag=!1,this.measureInstanceViewportBox=Sr}getBaseTargetFromProps(e,n){return e[n]}readValueFromInstance(e,n){if(Ff.has(n)){const r=KN(n);return r&&r.default||0}return n=dD.has(n)?n:vk(n),e.getAttribute(n)}scrapeMotionValuesFromProps(e,n,r){return hD(e,n,r)}build(e,n,r){uD(e,n,this.isSVGTag,r.transformTemplate,r.style)}renderInstance(e,n,r,s){See(e,n,r,s)}mount(e){this.isSVGTag=fD(e.tagName),super.mount(e)}}const Eee=Sk.length;function pD(t){if(!t)return;if(!t.isControllingVariants){const n=t.parent?pD(t.parent)||{}:{};return t.props.initial!==void 0&&(n.initial=t.props.initial),n}const e={};for(let n=0;n<Eee;n++){const r=Sk[n],s=t.props[r];($p(s)||s===!1)&&(e[r]=s)}return e}function mD(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 Cee=[...xk].reverse(),Pee=xk.length;function Tee(t){return e=>Promise.all(e.map(({animation:n,options:r})=>CJ(t,n,r)))}function Ree(t){let e=Tee(t),n=WR(),r=!0,s=!1;const i=d=>(f,h)=>{var g;const m=lu(t,h,d==="exit"?(g=t.presenceContext)==null?void 0:g.custom:void 0);if(m){const{transition:_,transitionEnd:y,...b}=m;f={...f,...b,...y}}return f};function o(d){e=d(t)}function l(d){const{props:f}=t,h=pD(t.parent)||{},m=[],g=new Set;let _={},y=1/0;for(let x=0;x<Pee;x++){const S=Cee[x],E=n[S],C=f[S]!==void 0?f[S]:h[S],R=$p(C),O=S===d?E.isActive:null;O===!1&&(y=x);let I=C===h[S]&&C!==f[S]&&R;if(I&&(r||s)&&t.manuallyAnimateOnMount&&(I=!1),E.protectedKeys={..._},!E.isActive&&O===null||!C&&!E.prevProp||wy(C)||typeof C=="boolean")continue;if(S==="exit"&&E.isActive&&O!==!0){E.prevResolvedValues&&(_={..._,...E.prevResolvedValues});continue}const A=Aee(E.prevProp,C);let L=A||S===d&&E.isActive&&!I&&R||x>y&&R,N=!1;const H=Array.isArray(C)?C:[C];let $=H.reduce(i(S),{});O===!1&&($={});const{prevResolvedValues:W={}}=E,X={...W,...$},z=Z=>{L=!0,g.has(Z)&&(N=!0,g.delete(Z)),E.needsAnimating[Z]=!0;const J=t.getValue(Z);J&&(J.liveStyle=!1)};for(const Z in X){const J=$[Z],q=W[Z];if(_.hasOwnProperty(Z))continue;let j=!1;X2(J)&&X2(q)?j=!mD(J,q)||A:j=J!==q,j?J!=null?z(Z):g.add(Z):J!==void 0&&g.has(Z)?z(Z):E.protectedKeys[Z]=!0}E.prevProp=C,E.prevResolvedValues=$,E.isActive&&(_={..._,...$}),(r||s)&&t.blockInitialAnimation&&(L=!1);const K=I&&A;L&&(!K||N)&&m.push(...H.map(Z=>{const J={type:S};if(typeof Z=="string"&&(r||s)&&!K&&t.manuallyAnimateOnMount&&t.parent){const{parent:q}=t,j=lu(q,Z);if(q.enteringChildren&&j){const{delayChildren:Y}=j.transition||{};J.delay=jN(q.enteringChildren,t,Y)}}return{animation:Z,options:J}}))}if(g.size){const x={};if(typeof f.initial!="boolean"){const S=lu(t,Array.isArray(f.initial)?f.initial[0]:f.initial);S&&S.transition&&(x.transition=S.transition)}g.forEach(S=>{const E=t.getBaseTarget(S),C=t.getValue(S);C&&(C.liveStyle=!0),x[S]=E??null}),m.push({animation:x})}let b=!!m.length;return r&&(f.initial===!1||f.initial===f.animate)&&!t.manuallyAnimateOnMount&&(b=!1),r=!1,s=!1,b?e(m):Promise.resolve()}function u(d,f){var m;if(n[d].isActive===f)return Promise.resolve();(m=t.variantChildren)==null||m.forEach(g=>{var _;return(_=g.animationState)==null?void 0:_.setActive(d,f)}),n[d].isActive=f;const h=l(d);for(const g in n)n[g].protectedKeys={};return h}return{animateChanges:l,setActive:u,setAnimateFunction:o,getState:()=>n,reset:()=>{n=WR(),s=!0}}}function Aee(t,e){return typeof e=="string"?e!==t:Array.isArray(e)?!mD(e,t):!1}function Oc(t=!1){return{isActive:t,protectedKeys:{},needsAnimating:{},prevResolvedValues:{}}}function WR(){return{animate:Oc(!0),whileInView:Oc(),whileHover:Oc(),whileTap:Oc(),whileDrag:Oc(),whileFocus:Oc(),exit:Oc()}}function ox(t,e){t.min=e.min,t.max=e.max}function so(t,e){ox(t.x,e.x),ox(t.y,e.y)}function KR(t,e){t.translate=e.translate,t.scale=e.scale,t.originPoint=e.originPoint,t.origin=e.origin}const gD=1e-4,Iee=1-gD,Oee=1+gD,vD=.01,Mee=0-vD,Lee=0+vD;function Ps(t){return t.max-t.min}function Nee(t,e,n){return Math.abs(t-e)<=n}function GR(t,e,n,r=.5){t.origin=r,t.originPoint=wn(e.min,e.max,t.origin),t.scale=Ps(n)/Ps(e),t.translate=wn(n.min,n.max,t.origin)-t.originPoint,(t.scale>=Iee&&t.scale<=Oee||isNaN(t.scale))&&(t.scale=1),(t.translate>=Mee&&t.translate<=Lee||isNaN(t.translate))&&(t.translate=0)}function hp(t,e,n,r){GR(t.x,e.x,n.x,r?r.originX:void 0),GR(t.y,e.y,n.y,r?r.originY:void 0)}function qR(t,e,n,r=0){const s=r?wn(n.min,n.max,r):n.min;t.min=s+e.min,t.max=t.min+Ps(e)}function Dee(t,e,n,r){qR(t.x,e.x,n.x,r==null?void 0:r.x),qR(t.y,e.y,n.y,r==null?void 0:r.y)}function YR(t,e,n,r=0){const s=r?wn(n.min,n.max,r):n.min;t.min=e.min-s,t.max=t.min+Ps(e)}function Lv(t,e,n,r){YR(t.x,e.x,n.x,r==null?void 0:r.x),YR(t.y,e.y,n.y,r==null?void 0:r.y)}function XR(t,e,n,r,s){return t-=e,t=Mv(t,1/n,r),s!==void 0&&(t=Mv(t,1/s,r)),t}function $ee(t,e=0,n=1,r=.5,s,i=t,o=t){if(qo.test(e)&&(e=parseFloat(e),e=wn(o.min,o.max,e/100)-o.min),typeof e!="number")return;let l=wn(i.min,i.max,r);t===i&&(l-=e),t.min=XR(t.min,e,n,l,s),t.max=XR(t.max,e,n,l,s)}function QR(t,e,[n,r,s],i,o){$ee(t,e[n],e[r],e[s],e.scale,i,o)}const Fee=["x","scaleX","originX"],jee=["y","scaleY","originY"];function JR(t,e,n,r){QR(t.x,e,Fee,n?n.x:void 0,r?r.x:void 0),QR(t.y,e,jee,n?n.y:void 0,r?r.y:void 0)}function eA(t){return t.translate===0&&t.scale===1}function yD(t){return eA(t.x)&&eA(t.y)}function tA(t,e){return t.min===e.min&&t.max===e.max}function zee(t,e){return tA(t.x,e.x)&&tA(t.y,e.y)}function nA(t,e){return Math.round(t.min)===Math.round(e.min)&&Math.round(t.max)===Math.round(e.max)}function _D(t,e){return nA(t.x,e.x)&&nA(t.y,e.y)}function rA(t){return Ps(t.x)/Ps(t.y)}function sA(t,e){return t.translate===e.translate&&t.scale===e.scale&&t.originPoint===e.originPoint}function No(t){return[t("x"),t("y")]}function Vee(t,e,n){let r="";const s=t.x.translate/e.x,i=t.y.translate/e.y,o=(n==null?void 0:n.z)||0;if((s||i||o)&&(r=`translate3d(${s}px, ${i}px, ${o}px) `),(e.x!==1||e.y!==1)&&(r+=`scale(${1/e.x}, ${1/e.y}) `),n){const{transformPerspective:d,rotate:f,pathRotation:h,rotateX:m,rotateY:g,skewX:_,skewY:y}=n;d&&(r=`perspective(${d}px) ${r}`),f&&(r+=`rotate(${f}deg) `),h&&(r+=`rotate(${h}deg) `),m&&(r+=`rotateX(${m}deg) `),g&&(r+=`rotateY(${g}deg) `),_&&(r+=`skewX(${_}deg) `),y&&(r+=`skewY(${y}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 Hee=yk.length,iA=t=>typeof t=="string"?parseFloat(t):t,oA=t=>typeof t=="number"||Ge.test(t);function Uee(t,e,n,r,s,i){s?(t.opacity=wn(0,n.opacity??1,Zee(r)),t.opacityExit=wn(e.opacity??1,0,Bee(r))):i&&(t.opacity=wn(e.opacity??1,n.opacity??1,r));for(let o=0;o<Hee;o++){const l=yk[o];let u=aA(e,l),d=aA(n,l);if(u===void 0&&d===void 0)continue;u||(u=0),d||(d=0),u===0||d===0||oA(u)===oA(d)?(t[l]=Math.max(wn(iA(u),iA(d),r),0),(qo.test(d)||qo.test(u))&&(t[l]+="%")):t[l]=d}(e.rotate||n.rotate)&&(t.rotate=wn(e.rotate||0,n.rotate||0,r))}function aA(t,e){return t[e]!==void 0?t[e]:t.borderRadius}const Zee=wD(0,.5,hN),Bee=wD(.5,.95,Bi);function wD(t,e,n){return r=>r<t?0:r>e?1:n(Np(t,e,r))}function Wee(t,e,n){const r=Gr(t)?t:xf(t);return r.start(mk("",r,e,n)),r.animation}function Fp(t,e,n,r={passive:!0}){return t.addEventListener(e,n,r),()=>t.removeEventListener(e,n,r)}const Kee=(t,e)=>t.depth-e.depth;class Gee{constructor(){this.children=[],this.isDirty=!1}add(e){nk(this.children,e),this.isDirty=!0}remove(e){Ev(this.children,e),this.isDirty=!0}forEach(e){this.isDirty&&this.children.sort(Kee),this.isDirty=!1,this.children.forEach(e)}}function qee(t,e){const n=Cs.now(),r=({timestamp:s})=>{const i=s-n;i>=e&&(Jl(r),t(i-e))};return bn.setup(r,!0),()=>Jl(r)}function Ig(t){return Gr(t)?t.get():t}class Yee{constructor(){this.members=[]}add(e){nk(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&&(Ev(this.members,r),r.unmount())}e.scheduleRender()}remove(e){if(Ev(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 Og={hasAnimatedSinceResize:!0,hasEverUpdated:!1},Mw=["","X","Y","Z"],Xee=1e3;let Qee=0;function Lw(t,e,n,r){const{latestValues:s}=e;s[t]&&(n[t]=s[t],e.setStaticValue(t,0),r&&(r[t]=0))}function bD(t){if(t.hasCheckedOptimisedAppear=!0,t.root===t)return;const{visualElement:e}=t.options;if(!e)return;const n=UN(e);if(window.MotionHasOptimisedAnimation(n,"transform")){const{layout:s,layoutId:i}=t.options;window.MotionCancelOptimisedAnimation(n,"transform",bn,!(s||i))}const{parent:r}=t;r&&!r.hasCheckedOptimisedAppear&&bD(r)}function xD({attachResizeListener:t,defaultParent:e,measureScroll:n,checkIsScrollRoot:r,resetTransform:s}){return class{constructor(o={},l=e==null?void 0:e()){this.id=Qee++,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(tte),this.nodes.forEach(ate),this.nodes.forEach(lte),this.nodes.forEach(nte)},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 Gee)}addEventListener(o,l){return this.eventHandlers.has(o)||this.eventHandlers.set(o,new rk),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=bk(o)&&!tee(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 m=()=>this.root.updateBlockedByResize=!1;bn.read(()=>{h=window.innerWidth}),t(o,()=>{const g=window.innerWidth;g!==h&&(h=g,this.root.updateBlockedByResize=!0,f&&f(),f=qee(m,250),Og.hasAnimatedSinceResize&&(Og.hasAnimatedSinceResize=!1,this.nodes.forEach(uA)))})}l&&this.root.registerSharedNode(l,this),this.options.animate!==!1&&d&&(l||u)&&this.addEventListener("didUpdate",({delta:f,hasLayoutChanged:h,hasRelativeLayoutChanged:m,layout:g})=>{if(this.isTreeAnimationBlocked()){this.target=void 0,this.relativeTarget=void 0;return}const _=this.options.transition||d.getDefaultTransition()||hte,{onLayoutAnimationStart:y,onLayoutAnimationComplete:b}=d.getProps(),x=!this.targetLayout||!_D(this.targetLayout,g),S=!h&&m;if(this.options.layoutRoot||this.resumeFrom||S||h&&(x||!this.currentAnimation)){this.resumeFrom&&(this.resumingFrom=this.resumeFrom,this.resumingFrom.resumingFrom=void 0);const E={...pk(_,"layout"),onPlay:y,onComplete:b};(d.shouldReduceMotion||this.options.layoutRoot)&&(E.delay=0,E.type=!1),this.startAnimation(E),this.setAnimationOrigin(f,S,E.path)}else h||uA(this),this.isLead()&&this.options.onExitComplete&&this.options.onExitComplete();this.targetLayout=g})}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(),Jl(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(cte),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&&bD(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(ste),this.nodes.forEach(lA);return}if(this.animationId<=this.animationCommitId){this.nodes.forEach(cA);return}this.animationCommitId=this.animationId,this.isUpdating?(this.isUpdating=!1,this.nodes.forEach(ite),this.nodes.forEach(ote),this.nodes.forEach(Jee),this.nodes.forEach(ete)):this.nodes.forEach(cA),this.clearAllSnapshots();const l=Cs.now();Br.delta=Jo(0,1e3/60,l-Br.timestamp),Br.timestamp=l,Br.isProcessing=!0,Ew.update.process(Br),Ew.preRender.process(Br),Ew.render.process(Br),Br.isProcessing=!1}didUpdate(){this.updateScheduled||(this.updateScheduled=!0,_k.read(this.scheduleUpdate))}clearAllSnapshots(){this.nodes.forEach(rte),this.sharedNodes.forEach(ute)}scheduleUpdateProjection(){this.projectionUpdateScheduled||(this.projectionUpdateScheduled=!0,bn.preRender(this.updateProjection,!1,!0))}scheduleCheckAfterUnmount(){bn.postRender(()=>{this.isLayoutDirty?this.root.didUpdate():this.root.checkUpdateFailed()})}updateSnapshot(){this.snapshot||!this.instance||(this.snapshot=this.measure(),this.snapshot&&!Ps(this.snapshot.measuredBox.x)&&!Ps(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=Sr()),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&&!yD(this.projectionDelta),u=this.getTransformTemplate(),d=u?u(this.latestValues,""):void 0,f=d!==this.prevTransformTemplateValue;o&&this.instance&&(l||Hc(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)),pte(u),{animationId:this.root.animationId,measuredBox:l,layoutBox:u,latestValues:{},source:this.id}}measurePageBox(){var d;const{visualElement:o}=this.options;if(!o)return Sr();const l=o.measureViewportBox();if(!(((d=this.scroll)==null?void 0:d.wasRoot)||this.path.some(mte))){const{scroll:f}=this.root;f&&(Vo(l.x,f.offset.x),Vo(l.y,f.offset.y))}return l}removeElementScroll(o){var u;const l=Sr();if(so(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:m}=f;f!==this.root&&h&&m.layoutScroll&&(h.wasRoot&&so(l,o),Vo(l.x,h.offset.x),Vo(l.y,h.offset.y))}return l}applyTransform(o,l=!1,u){var f,h;const d=u||Sr();so(d,o);for(let m=0;m<this.path.length;m++){const g=this.path[m];!l&&g.options.layoutScroll&&g.scroll&&g!==g.root&&(Vo(d.x,-g.scroll.offset.x),Vo(d.y,-g.scroll.offset.y)),Hc(g.latestValues)&&Ag(d,g.latestValues,(f=g.layout)==null?void 0:f.layoutBox)}return Hc(this.latestValues)&&Ag(d,this.latestValues,(h=this.layout)==null?void 0:h.layoutBox),d}removeTransform(o){var u;const l=Sr();so(l,o);for(let d=0;d<this.path.length;d++){const f=this.path[d];if(!Hc(f.latestValues))continue;let h;f.instance&&(rx(f.latestValues)&&f.updateSnapshot(),h=Sr(),so(h,f.measurePageBox())),JR(l,f.latestValues,(u=f.snapshot)==null?void 0:u.layoutBox,h)}return Hc(this.latestValues)&&JR(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!==Br.timestamp&&this.relativeParent.resolveTargetDelta(!0)}resolveTargetDelta(o=!1){var g;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||(g=this.parent)!=null&&g.isProjectionDirty||this.attemptToResolveRelativeTarget||this.root.updateBlockedByResize))return;const{layout:f,layoutId:h}=this.options;if(!this.layout||!(f||h))return;this.resolvedRelativeTargetAt=Br.timestamp;const m=this.getClosestProjectingParent();m&&this.linkedParentVersion!==m.layoutVersion&&!m.options.layoutRoot&&this.removeRelativeTarget(),!this.targetDelta&&!this.relativeTarget&&(this.options.layoutAnchor!==!1&&m&&m.layout?this.createRelativeTarget(m,this.layout.layoutBox,m.layout.layoutBox):this.removeRelativeTarget()),!(!this.relativeTarget&&!this.targetDelta)&&(this.target||(this.target=Sr(),this.targetWithTransforms=Sr()),this.relativeTarget&&this.relativeTargetOrigin&&this.relativeParent&&this.relativeParent.target?(this.forceRelativeParentToResolveTarget(),Dee(this.target,this.relativeTarget,this.relativeParent.target,this.options.layoutAnchor||void 0)):this.targetDelta?(this.resumingFrom?this.applyTransform(this.layout.layoutBox,!1,this.target):so(this.target,this.layout.layoutBox),oD(this.target,this.targetDelta)):so(this.target,this.layout.layoutBox),this.attemptToResolveRelativeTarget&&(this.attemptToResolveRelativeTarget=!1,this.options.layoutAnchor!==!1&&m&&!!m.resumingFrom==!!this.resumingFrom&&!m.options.layoutScroll&&m.target&&this.animationProgress!==1?this.createRelativeTarget(m,this.target,m.target):this.relativeParent=this.relativeTarget=void 0))}getClosestProjectingParent(){if(!(!this.parent||rx(this.parent.latestValues)||iD(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=Sr(),this.relativeTargetOrigin=Sr(),Lv(this.relativeTargetOrigin,l,u,this.options.layoutAnchor||void 0),so(this.relativeTarget,this.relativeTargetOrigin)}removeRelativeTarget(){this.relativeParent=this.relativeTarget=void 0}calcProjection(){var _;const o=this.getLead(),l=!!this.resumingFrom||this!==o;let u=!0;if((this.isProjectionDirty||(_=this.parent)!=null&&_.isProjectionDirty)&&(u=!1),l&&(this.isSharedProjectionDirty||this.isTransformDirty)&&(u=!1),this.resolvedRelativeTargetAt===Br.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;so(this.layoutCorrected,this.layout.layoutBox);const h=this.treeScale.x,m=this.treeScale.y;dee(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=Sr());const{target:g}=o;if(!g){this.prevProjectionDelta&&(this.createProjectionDeltas(),this.scheduleRender());return}!this.projectionDelta||!this.prevProjectionDelta?this.createProjectionDeltas():(KR(this.prevProjectionDelta.x,this.projectionDelta.x),KR(this.prevProjectionDelta.y,this.projectionDelta.y)),hp(this.projectionDelta,this.layoutCorrected,g,this.latestValues),(this.treeScale.x!==h||this.treeScale.y!==m||!sA(this.projectionDelta.x,this.prevProjectionDelta.x)||!sA(this.projectionDelta.y,this.prevProjectionDelta.y))&&(this.hasProjected=!0,this.scheduleRender(),this.notifyListeners("projectionUpdate",g))}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=Rd(),this.projectionDelta=Rd(),this.projectionDeltaWithTransform=Rd()}setAnimationOrigin(o,l=!1,u){const d=this.snapshot,f=d?d.latestValues:{},h={...this.latestValues},m=Rd();(!this.relativeParent||!this.relativeParent.options.layoutRoot)&&(this.relativeTarget=this.relativeTargetOrigin=void 0),this.attemptToResolveRelativeTarget=!l;const g=Sr(),_=d?d.source:void 0,y=this.layout?this.layout.source:void 0,b=_!==y,x=this.getStack(),S=!x||x.members.length<=1,E=!!(b&&!S&&this.options.crossfade===!0&&!this.path.some(fte));this.animationProgress=0;let C;const R=u==null?void 0:u.interpolateProjection(o);this.mixTargetDelta=O=>{const I=O/1e3,A=R==null?void 0:R(I);A?(m.x.translate=A.x,m.x.scale=wn(o.x.scale,1,I),m.x.origin=o.x.origin,m.x.originPoint=o.x.originPoint,m.y.translate=A.y,m.y.scale=wn(o.y.scale,1,I),m.y.origin=o.y.origin,m.y.originPoint=o.y.originPoint):(dA(m.x,o.x,I),dA(m.y,o.y,I)),this.setTargetDelta(m),this.relativeTarget&&this.relativeTargetOrigin&&this.layout&&this.relativeParent&&this.relativeParent.layout&&(Lv(g,this.layout.layoutBox,this.relativeParent.layout.layoutBox,this.options.layoutAnchor||void 0),dte(this.relativeTarget,this.relativeTargetOrigin,g,I),C&&zee(this.relativeTarget,C)&&(this.isProjectionDirty=!1),C||(C=Sr()),so(C,this.relativeTarget)),b&&(this.animationValues=h,Uee(h,f,this.latestValues,I,E,S)),A&&A.rotate!==void 0&&(this.animationValues||(this.animationValues=h),this.animationValues.pathRotation=A.rotate),this.root.scheduleUpdateProjection(),this.scheduleRender(),this.animationProgress=I},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&&(Jl(this.pendingAnimation),this.pendingAnimation=void 0),this.pendingAnimation=bn.update(()=>{Og.hasAnimatedSinceResize=!0,this.motionValue||(this.motionValue=xf(0)),this.motionValue.jump(0,!1),this.currentAnimation=Wee(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(Xee),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&&SD(this.options.animationType,this.layout.layoutBox,d.layoutBox)){u=this.target||Sr();const h=Ps(this.layout.layoutBox.x);u.x.min=o.target.x.min,u.x.max=u.x.min+h;const m=Ps(this.layout.layoutBox.y);u.y.min=o.target.y.min,u.y.max=u.y.min+m}so(l,u),Ag(l,f),hp(this.projectionDeltaWithTransform,this.layoutCorrected,l,f)}}registerSharedNode(o,l){this.sharedNodes.has(o)||this.sharedNodes.set(o,new Yee),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&&Lw("z",o,d,this.animationValues);for(let f=0;f<Mw.length;f++)Lw(`rotate${Mw[f]}`,o,d,this.animationValues),Lw(`skew${Mw[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=Ig(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=Ig(l==null?void 0:l.pointerEvents)||""),this.hasProjected&&!Hc(this.latestValues)&&(o.transform=u?u({},""):"none",this.hasProjected=!1);return}o.visibility="";const f=d.animationValues||d.latestValues;this.applyTransformsToTarget();let h=Vee(this.projectionDeltaWithTransform,this.treeScale,f);u&&(h=u(f,h)),o.transform=h;const{x:m,y:g}=this.projectionDelta;o.transformOrigin=`${m.origin*100}% ${g.origin*100}% 0`,d.animationValues?o.opacity=d===this?f.opacity??this.latestValues.opacity??1:this.preserveOpacity?this.latestValues.opacity:f.opacityExit:o.opacity=d===this?f.opacity!==void 0?f.opacity:"":f.opacityExit!==void 0?f.opacityExit:0;for(const _ in ix){if(f[_]===void 0)continue;const{correct:y,applyTo:b,isCSSVariable:x}=ix[_],S=h==="none"?f[_]:y(f[_],d);if(b){const E=b.length;for(let C=0;C<E;C++)o[b[C]]=S}else x?this.options.visualElement.renderState.vars[_]=S:o[_]=S}this.options.layoutId&&(o.pointerEvents=d===this?Ig(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(lA),this.root.sharedNodes.clear()}}}function Jee(t){t.updateLayout()}function ete(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")No(h=>{const m=o?e.measuredBox[h]:e.layoutBox[h],g=Ps(m);m.min=r[h].min,m.max=m.min+g});else if(i==="x"||i==="y"){const h=i==="x"?"y":"x";ox(o?e.measuredBox[h]:e.layoutBox[h],r[h])}else SD(i,e.layoutBox,r)&&No(h=>{const m=o?e.measuredBox[h]:e.layoutBox[h],g=Ps(r[h]);m.max=m.min+g,t.relativeTarget&&!t.currentAnimation&&(t.isProjectionDirty=!0,t.relativeTarget[h].max=t.relativeTarget[h].min+g)});const l=Rd();hp(l,r,e.layoutBox);const u=Rd();o?hp(u,t.applyTransform(s,!0),e.measuredBox):hp(u,r,e.layoutBox);const d=!yD(l);let f=!1;if(!t.resumeFrom){const h=t.getClosestProjectingParent();if(h&&!h.resumeFrom){const{snapshot:m,layout:g}=h;if(m&&g){const _=t.options.layoutAnchor||void 0,y=Sr();Lv(y,e.layoutBox,m.layoutBox,_);const b=Sr();Lv(b,r,g.layoutBox,_),_D(y,b)||(f=!0),h.options.layoutRoot&&(t.relativeTarget=b,t.relativeTargetOrigin=y,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 tte(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 nte(t){t.isProjectionDirty=t.isSharedProjectionDirty=t.isTransformDirty=!1}function rte(t){t.clearSnapshot()}function lA(t){t.clearMeasurements()}function ste(t){t.isLayoutDirty=!0,t.updateLayout()}function cA(t){t.isLayoutDirty=!1}function ite(t){t.isAnimationBlocked&&t.layout&&!t.isLayoutDirty&&(t.snapshot=t.layout,t.isLayoutDirty=!0)}function ote(t){const{visualElement:e}=t.options;e&&e.getProps().onBeforeLayoutMeasure&&e.notify("BeforeLayoutMeasure"),t.resetTransform()}function uA(t){t.finishAnimation(),t.targetDelta=t.relativeTarget=t.target=void 0,t.isProjectionDirty=!0}function ate(t){t.resolveTargetDelta()}function lte(t){t.calcProjection()}function cte(t){t.resetSkewAndRotation()}function ute(t){t.removeLeadSnapshot()}function dA(t,e,n){t.translate=wn(e.translate,0,n),t.scale=wn(e.scale,1,n),t.origin=e.origin,t.originPoint=e.originPoint}function fA(t,e,n,r){t.min=wn(e.min,n.min,r),t.max=wn(e.max,n.max,r)}function dte(t,e,n,r){fA(t.x,e.x,n.x,r),fA(t.y,e.y,n.y,r)}function fte(t){return t.animationValues&&t.animationValues.opacityExit!==void 0}const hte={duration:.45,ease:[.4,0,.1,1]},hA=t=>typeof navigator<"u"&&navigator.userAgent&&navigator.userAgent.toLowerCase().includes(t),pA=hA("applewebkit/")&&!hA("chrome/")?Math.round:Bi;function mA(t){t.min=pA(t.min),t.max=pA(t.max)}function pte(t){mA(t.x),mA(t.y)}function SD(t,e,n){return t==="position"||t==="preserve-aspect"&&!Nee(rA(e),rA(n),.2)}function mte(t){var e;return t!==t.root&&((e=t.scroll)==null?void 0:e.wasRoot)}const gte=xD({attachResizeListener:(t,e)=>Fp(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}),Nw={current:void 0},kD=xD({measureScroll:t=>({x:t.scrollLeft,y:t.scrollTop}),defaultParent:()=>{if(!Nw.current){const t=new gte({});t.mount(window),t.setOptions({layoutScroll:!0}),Nw.current=t}return Nw.current},resetTransform:(t,e)=>{t.style.transform=e!==void 0?e:"none"},checkIsScrollRoot:t=>window.getComputedStyle(t).position==="fixed"}),jp=v.createContext({transformPagePoint:t=>t,isStatic:!1,reducedMotion:"never"});function gA(t,e){if(typeof t=="function")return t(e);t!=null&&(t.current=e)}function vte(...t){return e=>{let n=!1;const r=t.map(s=>{const i=gA(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():gA(t[s],null)}}}}function yte(...t){return v.useCallback(vte(...t),t)}class _te extends v.Component{getSnapshotBeforeUpdate(e){const n=this.props.childRef.current;if(Cg(n)&&e.isPresent&&!this.props.isPresent&&this.props.pop!==!1){const r=n.offsetParent,s=Cg(r)&&r.offsetWidth||0,i=Cg(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 wte({children:t,isPresent:e,anchorX:n,anchorY:r,root:s,pop:i}){var m;const o=v.useId(),l=v.useRef(null),u=v.useRef({width:0,height:0,top:0,left:0,right:0,bottom:0,direction:"ltr"}),{nonce:d}=v.useContext(jp),f=i!==!1?((m=t.props)==null?void 0:m.ref)??(t==null?void 0:t.ref):void 0,h=yte(l,f);return v.useInsertionEffect(()=>{const{width:g,height:_,top:y,left:b,right:x,bottom:S,direction:E}=u.current;if(e||i===!1||!l.current||!g||!_)return;const C=E==="rtl",R=n==="left"?C?`right: ${x}`:`left: ${b}`:C?`left: ${b}`:`right: ${x}`,O=r==="bottom"?`bottom: ${S}`:`top: ${y}`;l.current.dataset.motionPopId=o;const I=document.createElement("style");d&&(I.nonce=d);const A=s??document.head;return A.appendChild(I),I.sheet&&I.sheet.insertRule(`
78
- [data-motion-pop-id="${o}"] {
79
- position: absolute !important;
80
- width: ${g}px !important;
81
- height: ${_}px !important;
82
- ${R}px !important;
83
- ${O}px !important;
84
- }
85
- `),()=>{var L;(L=l.current)==null||L.removeAttribute("data-motion-pop-id"),A.contains(I)&&A.removeChild(I)}},[e]),T.jsx(_te,{isPresent:e,childRef:l,sizeRef:u,pop:i,children:i===!1?t:v.cloneElement(t,{ref:h})})}const bte=({children:t,initial:e,isPresent:n,onExitComplete:r,custom:s,presenceAffectsLayout:i,mode:o,anchorX:l,anchorY:u,root:d})=>{const f=gy(xte),h=v.useId(),m=v.useRef(n),g=v.useRef(r);tk(()=>{m.current=n,g.current=r});let _=!0,y=v.useMemo(()=>(_=!1,{id:h,initial:e,isPresent:n,custom:s,onExitComplete:b=>{f.set(b,!0);for(const x of f.values())if(!x)return;r&&r()},register:b=>(f.set(b,!1),()=>{var x;f.delete(b),!m.current&&!f.size&&((x=g.current)==null||x.call(g))})}),[n,f,r]);return i&&_&&(y={...y}),v.useMemo(()=>{f.forEach((b,x)=>f.set(x,!1))},[n]),v.useEffect(()=>{!n&&!f.size&&r&&r()},[n]),t=T.jsx(wte,{pop:o==="popLayout",isPresent:n,anchorX:l,anchorY:u,root:d,children:t}),T.jsx(vy.Provider,{value:y,children:t})};function xte(){return new Map}function ED(t=!0){const e=v.useContext(vy);if(e===null)return[!0,null];const{isPresent:n,onExitComplete:r,register:s}=e,i=v.useId();v.useEffect(()=>{if(t)return s(i)},[t]);const o=v.useCallback(()=>t&&r&&r(i),[i,r,t]);return!n&&r?[!1,o]:[!0]}const G0=t=>t.key||"";function vA(t){const e=[];return v.Children.forEach(t,n=>{v.isValidElement(n)&&e.push(n)}),e}const Dd=({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]=ED(o),m=v.useMemo(()=>vA(t),[t]),g=o&&!f?[]:m.map(G0),_=v.useRef(!0),y=v.useRef(m),b=gy(()=>new Map),x=v.useRef(new Set),[S,E]=v.useState(m),[C,R]=v.useState(m);tk(()=>{_.current=!1,y.current=m;for(let A=0;A<C.length;A++){const L=G0(C[A]);g.includes(L)?(b.delete(L),x.current.delete(L)):b.get(L)!==!0&&b.set(L,!1)}},[C,g.length,g.join("-")]);const O=[];if(m!==S){let A=[...m];for(let L=0;L<C.length;L++){const N=C[L],H=G0(N);g.includes(H)||(A.splice(L,0,N),O.push(N))}return i==="wait"&&O.length&&(A=O),R(vA(A)),E(m),null}const{forceRender:I}=v.useContext(ek);return T.jsx(T.Fragment,{children:C.map(A=>{const L=G0(A),N=o&&!f?!1:m===C||g.includes(L),H=()=>{if(x.current.has(L))return;if(b.has(L))x.current.add(L),b.set(L,!0);else return;let $=!0;b.forEach(W=>{W||($=!1)}),$&&(I==null||I(),R(y.current),o&&(h==null||h()),r&&r())};return T.jsx(bte,{isPresent:N,initial:!_.current||n?void 0:!1,custom:e,presenceAffectsLayout:s,mode:i,root:d,onExitComplete:N?void 0:H,anchorX:l,anchorY:u,children:A},L)})})},CD=v.createContext({strict:!1}),yA={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 _A=!1;function Ste(){if(_A)return;const t={};for(const e in yA)t[e]={isEnabled:n=>yA[e].some(r=>!!n[r])};nD(t),_A=!0}function PD(){return Ste(),aee()}function kte(t){const e=PD();for(const n in t)e[n]={...e[n],...t[n]};nD(e)}const Ete=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 Nv(t){return t.startsWith("while")||t.startsWith("drag")&&t!=="draggable"||t.startsWith("layout")||t.startsWith("onTap")||t.startsWith("onPan")||t.startsWith("onLayout")||Ete.has(t)}let TD=t=>!Nv(t);function RD(t){typeof t=="function"&&(TD=e=>e.startsWith("on")?!Nv(e):t(e))}try{RD(require("@emotion/is-prop-valid").default)}catch{}function Cte(t,e,n){const r={};for(const s in t)s==="values"&&typeof t.values=="object"||Gr(t[s])||(TD(s)||n===!0&&Nv(s)||!e&&!Nv(s)||t.draggable&&s.startsWith("onDrag"))&&(r[s]=t[s]);return r}function Pte({children:t,isValidProp:e,...n}){e&&RD(e);const r=v.useContext(jp);n={...r,...n},n.transition=hk(n.transition,r.transition),n.isStatic=gy(()=>n.isStatic);const s=v.useMemo(()=>n,[JSON.stringify(n.transition),n.transformPagePoint,n.reducedMotion,n.skipAnimations]);return T.jsx(jp.Provider,{value:s,children:t})}const xy=v.createContext({});function Tte(t,e){if(by(t)){const{initial:n,animate:r}=t;return{initial:n===!1||$p(n)?n:void 0,animate:$p(r)?r:void 0}}return t.inherit!==!1?e:{}}function Rte(t){const{initial:e,animate:n}=Tte(t,v.useContext(xy));return v.useMemo(()=>({initial:e,animate:n}),[wA(e),wA(n)])}function wA(t){return Array.isArray(t)?t.join(" "):t}const Pk=()=>({style:{},transform:{},transformOrigin:{},vars:{}});function AD(t,e,n){for(const r in e)!Gr(e[r])&&!cD(r,n)&&(t[r]=e[r])}function Ate({transformTemplate:t},e){return v.useMemo(()=>{const n=Pk();return Ek(n,e,t),Object.assign({},n.vars,n.style)},[e])}function Ite(t,e){const n=t.style||{},r={};return AD(r,n,t),Object.assign(r,Ate(t,e)),r}function Ote(t,e){const n={},r=Ite(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 ID=()=>({...Pk(),attrs:{}});function Mte(t,e,n,r){const s=v.useMemo(()=>{const i=ID();return uD(i,e,fD(r),t.transformTemplate,t.style),{...i.attrs,style:{...i.style}}},[e]);if(t.style){const i={};AD(i,t.style,t),s.style={...i,...s.style}}return s}const Lte=["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 Tk(t){return typeof t!="string"||t.includes("-")?!1:!!(Lte.indexOf(t)>-1||/[A-Z]/u.test(t))}function Nte(t,e,n,{latestValues:r},s,i=!1,o){const u=(o??Tk(t)?Mte:Ote)(e,r,s,t),d=Cte(e,typeof t=="string",i),f=t!==v.Fragment?{...d,...u,ref:n}:{},{children:h}=e,m=v.useMemo(()=>Gr(h)?h.get():h,[h]);return v.createElement(t,{...f,children:m})}function Dte({scrapeMotionValuesFromProps:t,createRenderState:e},n,r,s){return{latestValues:$te(n,r,s,t),renderState:e()}}function $te(t,e,n,r){const s={},i=r(t,{});for(const m in i)s[m]=Ig(i[m]);let{initial:o,animate:l}=t;const u=by(t),d=eD(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"&&!wy(h)){const m=Array.isArray(h)?h:[h];for(let g=0;g<m.length;g++){const _=gk(t,m[g]);if(_){const{transitionEnd:y,transition:b,...x}=_;for(const S in x){let E=x[S];if(Array.isArray(E)){const C=f?E.length-1:0;E=E[C]}E!==null&&(s[S]=E)}for(const S in y)s[S]=y[S]}}}return s}const OD=t=>(e,n)=>{const r=v.useContext(xy),s=v.useContext(vy),i=()=>Dte(t,e,r,s);return n?i():gy(i)},Fte=OD({scrapeMotionValuesFromProps:Ck,createRenderState:Pk}),jte=OD({scrapeMotionValuesFromProps:hD,createRenderState:ID}),zte=Symbol.for("motionComponentSymbol");function Vte(t,e,n){const r=v.useRef(n);v.useInsertionEffect(()=>{r.current=n});const s=v.useRef(null);return v.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 MD=v.createContext({});function _d(t){return t&&typeof t=="object"&&Object.prototype.hasOwnProperty.call(t,"current")}function Hte(t,e,n,r,s,i){var E,C;const{visualElement:o}=v.useContext(xy),l=v.useContext(CD),u=v.useContext(vy),d=v.useContext(jp),f=d.reducedMotion,h=d.skipAnimations,m=v.useRef(null),g=v.useRef(!1);r=r||l.renderer,!m.current&&r&&(m.current=r(t,{visualState:e,parent:o,props:n,presenceContext:u,blockInitialAnimation:u?u.initial===!1:!1,reducedMotionConfig:f,skipAnimations:h,isSVG:i}),g.current&&m.current&&(m.current.manuallyAnimateOnMount=!0));const _=m.current,y=v.useContext(MD);_&&!_.projection&&s&&(_.type==="html"||_.type==="svg")&&Ute(m.current,n,s,y);const b=v.useRef(!1);v.useInsertionEffect(()=>{_&&b.current&&_.update(n,u)});const x=n[HN],S=v.useRef(!!x&&typeof window<"u"&&!((E=window.MotionHandoffIsComplete)!=null&&E.call(window,x))&&((C=window.MotionHasOptimisedAnimation)==null?void 0:C.call(window,x)));return tk(()=>{g.current=!0,_&&(b.current=!0,window.MotionIsMounted=!0,_.updateFeatures(),_.scheduleRenderMicrotask(),S.current&&_.animationState&&_.animationState.animateChanges())}),v.useEffect(()=>{_&&(!S.current&&_.animationState&&_.animationState.animateChanges(),S.current&&(queueMicrotask(()=>{var R;(R=window.MotionHandoffMarkAsComplete)==null||R.call(window,x)}),S.current=!1),_.enteringChildren=void 0)}),_}function Ute(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:LD(t.parent)),t.projection.setOptions({layoutId:s,layout:i,alwaysMeasureLayout:!!o||l&&_d(l),visualElement:t,animationType:typeof i=="string"?i:"both",initialPromotionConfig:r,crossfade:h,layoutScroll:u,layoutRoot:d,layoutAnchor:f})}function LD(t){if(t)return t.options.allowProjection!==!1?t.projection:LD(t.parent)}function Dw(t,{forwardMotionProps:e=!1,type:n}={},r,s){r&&kte(r);const i=n?n==="svg":Tk(t),o=i?jte:Fte;function l(d,f){let h;const m={...v.useContext(jp),...d,layoutId:Zte(d)},{isStatic:g}=m,_=Rte(d),y=o(d,g);if(!g&&typeof window<"u"){Bte();const b=Wte(m);h=b.MeasureLayout,_.visualElement=Hte(t,y,m,s,b.ProjectionNode,i)}return T.jsxs(xy.Provider,{value:_,children:[h&&_.visualElement?T.jsx(h,{visualElement:_.visualElement,...m}):null,Nte(t,d,Vte(y,_.visualElement,f),y,g,e,i)]})}l.displayName=`motion.${typeof t=="string"?t:`create(${t.displayName??t.name??""})`}`;const u=v.forwardRef(l);return u[zte]=t,u}function Zte({layoutId:t}){const e=v.useContext(ek).id;return e&&t!==void 0?e+"-"+t:t}function Bte(t,e){v.useContext(CD).strict}function Wte(t){const e=PD(),{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 Kte(t,e){if(typeof Proxy>"u")return Dw;const n=new Map,r=(i,o)=>Dw(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,Dw(o,void 0,t,e)),n.get(o))})}const Gte=(t,e)=>e.isSVG??Tk(t)?new kee(e):new yee(e,{allowProjection:t!==v.Fragment});class qte extends ac{constructor(e){super(e),e.animationState||(e.animationState=Ree(e))}updateAnimationControlsSubscription(){const{animate:e}=this.node.getProps();wy(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 Yte=0;class Xte extends ac{constructor(){super(...arguments),this.id=Yte++,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=lu(this.node,o,l);if(u){const{transition:d,transitionEnd:f,...h}=u;for(const m in h)(i=this.node.getValue(m))==null||i.jump(h[m])}}this.node.animationState.reset(),this.node.animationState.animateChanges()}else this.node.animationState.setActive("exit",!1);this.isExitComplete=!1;return}const s=this.node.animationState.setActive("exit",!e);n&&!e&&s.then(()=>{this.isExitComplete=!0,n(this.id)})}mount(){const{register:e,onExitComplete:n}=this.node.presenceContext||{};n&&n(this.id),e&&(this.unmount=e(this.id))}unmount(){}}const Qte={animation:{Feature:qte},exit:{Feature:Xte}};function _m(t){return{point:{x:t.pageX,y:t.pageY}}}const Jte=t=>e=>wk(e)&&t(e,_m(e));function pp(t,e,n,r){return Fp(t,e,Jte(n),r)}const ND=({current:t})=>t?t.ownerDocument.defaultView:null,bA=(t,e)=>Math.abs(t-e);function ene(t,e){const n=bA(t.x,e.x),r=bA(t.y,e.y);return Math.sqrt(n**2+r**2)}const xA=new Set(["auto","scroll"]);class DD{constructor(e,n,{transformPagePoint:r,contextWindow:s=window,dragSnapToOrigin:i=!1,distanceThreshold:o=3,element:l}={}){if(this.startEvent=null,this.lastMoveEvent=null,this.lastMoveEventInfo=null,this.lastRawMoveEventInfo=null,this.handlers={},this.contextWindow=window,this.scrollPositions=new Map,this.removeScrollListeners=null,this.onElementScroll=_=>{this.handleScroll(_.target)},this.onWindowScroll=()=>{this.handleScroll(window)},this.updatePoint=()=>{if(!(this.lastMoveEvent&&this.lastMoveEventInfo))return;this.lastRawMoveEventInfo&&(this.lastMoveEventInfo=q0(this.lastRawMoveEventInfo,this.transformPagePoint));const _=$w(this.lastMoveEventInfo,this.history),y=this.startEvent!==null,b=ene(_.offset,{x:0,y:0})>=this.distanceThreshold;if(!y&&!b)return;const{point:x}=_,{timestamp:S}=Br;this.history.push({...x,timestamp:S});const{onStart:E,onMove:C}=this.handlers;y||(E&&E(this.lastMoveEvent,_),this.startEvent=this.lastMoveEvent),C&&C(this.lastMoveEvent,_)},this.handlePointerMove=(_,y)=>{this.lastMoveEvent=_,this.lastRawMoveEventInfo=y,this.lastMoveEventInfo=q0(y,this.transformPagePoint),bn.update(this.updatePoint,!0)},this.handlePointerUp=(_,y)=>{this.end();const{onEnd:b,onSessionEnd:x,resumeAnimation:S}=this.handlers;if((this.dragSnapToOrigin||!this.startEvent)&&S&&S(),!(this.lastMoveEvent&&this.lastMoveEventInfo))return;const E=$w(_.type==="pointercancel"?this.lastMoveEventInfo:q0(y,this.transformPagePoint),this.history);this.startEvent&&b&&b(_,E),x&&x(_,E)},!wk(e))return;this.dragSnapToOrigin=i,this.handlers=n,this.transformPagePoint=r,this.distanceThreshold=o,this.contextWindow=s||window;const u=_m(e),d=q0(u,this.transformPagePoint),{point:f}=d,{timestamp:h}=Br;this.history=[{...f,timestamp:h}];const{onSessionStart:m}=n;m&&m(e,$w(d,this.history));const g={passive:!0,capture:!0};this.removeListeners=gm(pp(this.contextWindow,"pointermove",this.handlePointerMove,g),pp(this.contextWindow,"pointerup",this.handlePointerUp,g),pp(this.contextWindow,"pointercancel",this.handlePointerUp,g)),l&&this.startScrollTracking(l)}startScrollTracking(e){let n=e.parentElement;for(;n;){const r=getComputedStyle(n);(xA.has(r.overflowX)||xA.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),bn.update(this.updatePoint,!0))}updateHandlers(e){this.handlers=e}end(){this.removeListeners&&this.removeListeners(),this.removeScrollListeners&&this.removeScrollListeners(),this.scrollPositions.clear(),Jl(this.updatePoint)}}function q0(t,e){return e?{point:e(t.point)}:t}function SA(t,e){return{x:t.x-e.x,y:t.y-e.y}}function $w({point:t},e){return{point:t,delta:SA(t,$D(e)),offset:SA(t,tne(e)),velocity:nne(e,.1)}}function tne(t){return t[0]}function $D(t){return t[t.length-1]}function nne(t,e){if(t.length<2)return{x:0,y:0};let n=t.length-1,r=null;const s=$D(t);for(;n>=0&&(r=t[n],!(s.timestamp-r.timestamp>vi(e)));)n--;if(!r)return{x:0,y:0};r===t[0]&&t.length>2&&s.timestamp-r.timestamp>vi(e)*2&&(r=t[1]);const i=zi(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 rne(t,{min:e,max:n},r){return e!==void 0&&t<e?t=r?wn(e,t,r.min):Math.max(t,e):n!==void 0&&t>n&&(t=r?wn(n,t,r.max):Math.min(t,n)),t}function kA(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 sne(t,{top:e,left:n,bottom:r,right:s}){return{x:kA(t.x,n,s),y:kA(t.y,e,r)}}function EA(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 ine(t,e){return{x:EA(t.x,e.x),y:EA(t.y,e.y)}}function one(t,e){let n=.5;const r=Ps(t),s=Ps(e);return s>r?n=Np(e.min,e.max-r,t.min):r>s&&(n=Np(t.min,t.max-s,e.min)),Jo(0,1,n)}function ane(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 ax=.35;function lne(t=ax){return t===!1?t=0:t===!0&&(t=ax),{x:CA(t,"left","right"),y:CA(t,"top","bottom")}}function CA(t,e,n){return{min:PA(t,e),max:PA(t,n)}}function PA(t,e){return typeof t=="number"?t:t[e]||0}const cne=new WeakMap;class une{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=Sr(),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(_m(h).point),this.stopAnimation()},o=(h,m)=>{const{drag:g,dragPropagation:_,onDragStart:y}=this.getProps();if(g&&!_&&(this.openDragLock&&this.openDragLock(),this.openDragLock=FJ(g),!this.openDragLock))return;this.latestPointerEvent=h,this.latestPanInfo=m,this.isDragging=!0,this.currentDirection=null,this.resolveConstraints(),this.visualElement.projection&&(this.visualElement.projection.isAnimationBlocked=!0,this.visualElement.projection.target=void 0),No(x=>{let S=this.getAxisMotionValue(x).get()||0;if(qo.test(S)){const{projection:E}=this.visualElement;if(E&&E.layout){const C=E.layout.layoutBox[x];C&&(S=Ps(C)*(parseFloat(S)/100))}}this.originPoint[x]=S}),y&&bn.update(()=>y(h,m),!1,!0),Q2(this.visualElement,"transform");const{animationState:b}=this.visualElement;b&&b.setActive("whileDrag",!0)},l=(h,m)=>{this.latestPointerEvent=h,this.latestPanInfo=m;const{dragPropagation:g,dragDirectionLock:_,onDirectionLock:y,onDrag:b}=this.getProps();if(!g&&!this.openDragLock)return;const{offset:x}=m;if(_&&this.currentDirection===null){this.currentDirection=fne(x),this.currentDirection!==null&&y&&y(this.currentDirection);return}this.updateAxis("x",m.point,x),this.updateAxis("y",m.point,x),this.visualElement.render(),b&&bn.update(()=>b(h,m),!1,!0)},u=(h,m)=>{this.latestPointerEvent=h,this.latestPanInfo=m,this.stop(h,m),this.latestPointerEvent=null,this.latestPanInfo=null},d=()=>{const{dragSnapToOrigin:h}=this.getProps();(h||this.constraints)&&this.startAnimation({x:0,y:0})},{dragSnapToOrigin:f}=this.getProps();this.panSession=new DD(e,{onSessionStart:i,onStart:o,onMove:l,onSessionEnd:u,resumeAnimation:d},{transformPagePoint:this.visualElement.getTransformPagePoint(),dragSnapToOrigin:f,distanceThreshold:r,contextWindow:ND(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&&bn.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||!Y0(e,s,this.currentDirection))return;const i=this.getAxisMotionValue(e);let o=this.originPoint[e]+r[e];this.constraints&&this.constraints[e]&&(o=rne(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&&_d(e)?this.constraints||(this.constraints=this.resolveRefConstraints()):e&&r?this.constraints=sne(r.layoutBox,e):this.constraints=!1,this.elastic=lne(n),s!==this.constraints&&!_d(e)&&r&&this.constraints&&!this.hasMutatedConstraints&&No(o=>{this.constraints!==!1&&this.getAxisMotionValue(o)&&(this.constraints[o]=ane(r.layoutBox[o],this.constraints[o]))})}resolveRefConstraints(){const{dragConstraints:e,onMeasureDragConstraints:n}=this.getProps();if(!e||!_d(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=fee(r,s.root,this.visualElement.getTransformPagePoint());let o=ine(s.layout.layoutBox,i);if(n){const l=n(cee(o));this.hasMutatedConstraints=!!l,l&&(o=sD(l))}return o}startAnimation(e){const{drag:n,dragMomentum:r,dragElastic:s,dragTransition:i,dragSnapToOrigin:o,onDragTransitionEnd:l}=this.getProps(),u=this.constraints||{},d=No(f=>{if(!Y0(f,n,this.currentDirection))return;let h=u&&u[f]||{};(o===!0||o===f)&&(h={min:0,max:0});const m=s?200:1e6,g=s?40:1e7,_={type:"inertia",velocity:r?e[f]:0,bounceStiffness:m,bounceDamping:g,timeConstant:750,restDelta:1,restSpeed:10,...i,...h};return this.startAxisValueAnimation(f,_)});return Promise.all(d).then(l)}startAxisValueAnimation(e,n){const r=this.getAxisMotionValue(e);return Q2(this.visualElement,e),r.start(mk(e,r,0,n,this.visualElement,!1))}stopAnimation(){No(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){No(n=>{const{drag:r}=this.getProps();if(!Y0(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]-wn(o,l,.5)+u)}})}scalePositionWithinConstraints(){if(!this.visualElement.current)return;const{drag:e,dragConstraints:n}=this.getProps(),{projection:r}=this.visualElement;if(!_d(n)||!r||!this.constraints)return;this.stopAnimation();const s={x:0,y:0};No(o=>{const l=this.getAxisMotionValue(o);if(l&&this.constraints!==!1){const u=l.get();s[o]=one({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(),No(o=>{if(!Y0(o,e,null))return;const l=this.getAxisMotionValue(o),{min:u,max:d}=this.constraints[o];l.set(wn(u,d,s[o]))}),this.visualElement.render()}addListeners(){if(!this.visualElement.current)return;cne.set(this.visualElement,this);const e=this.visualElement.current,n=pp(e,"pointerdown",d=>{const{drag:f,dragListener:h=!0}=this.getProps(),m=d.target,g=m!==e&&ZJ(m);f&&h&&!g&&this.start(d)});let r;const s=()=>{const{dragConstraints:d}=this.getProps();_d(d)&&d.current&&(this.constraints=this.resolveRefConstraints(),r||(r=dne(e,d.current,()=>this.scalePositionWithinConstraints())))},{projection:i}=this.visualElement,o=i.addEventListener("measure",s);i&&!i.layout&&(i.root&&i.root.updateScroll(),i.updateLayout()),bn.read(s);const l=Fp(window,"resize",()=>this.scalePositionWithinConstraints()),u=i.addEventListener("didUpdate",(({delta:d,hasLayoutChanged:f})=>{this.isDragging&&f&&(No(h=>{const m=this.getAxisMotionValue(h);m&&(this.originPoint[h]+=d[h].translate,m.set(m.get()+d[h].translate))}),this.visualElement.render())}));return()=>{l(),n(),o(),u&&u(),r&&r()}}getProps(){const e=this.visualElement.getProps(),{drag:n=!1,dragDirectionLock:r=!1,dragPropagation:s=!1,dragConstraints:i=!1,dragElastic:o=ax,dragMomentum:l=!0}=e;return{...e,drag:n,dragDirectionLock:r,dragPropagation:s,dragConstraints:i,dragElastic:o,dragMomentum:l}}}function TA(t){let e=!0;return()=>{if(e){e=!1;return}t()}}function dne(t,e,n){const r=NR(t,TA(n)),s=NR(e,TA(n));return()=>{r(),s()}}function Y0(t,e,n){return(e===!0||e===t)&&(n===null||n===t)}function fne(t,e=10){let n=null;return Math.abs(t.y)>e?n="y":Math.abs(t.x)>e&&(n="x"),n}class hne extends ac{constructor(e){super(e),this.removeGroupControls=Bi,this.removeListeners=Bi,this.controls=new une(e)}mount(){const{dragControls:e}=this.node.getProps();e&&(this.removeGroupControls=e.subscribe(this.controls)),this.removeListeners=this.controls.addListeners()||Bi}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 Fw=t=>(e,n)=>{t&&bn.update(()=>t(e,n),!1,!0)};class pne extends ac{constructor(){super(...arguments),this.removePointerDownListener=Bi}onPointerDown(e){this.session=new DD(e,this.createPanHandlers(),{transformPagePoint:this.node.getTransformPagePoint(),contextWindow:ND(this.node)})}createPanHandlers(){const{onPanSessionStart:e,onPanStart:n,onPan:r,onPanEnd:s}=this.node.getProps();return{onSessionStart:Fw(e),onStart:Fw(n),onMove:Fw(r),onEnd:(i,o)=>{delete this.session,s&&bn.postRender(()=>s(i,o))}}}mount(){this.removePointerDownListener=pp(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 jw=!1;class mne extends v.Component{componentDidMount(){const{visualElement:e,layoutGroup:n,switchLayoutGroup:r,layoutId:s}=this.props,{projection:i}=e;i&&(n.group&&n.group.add(i),r&&r.register&&s&&r.register(i),jw&&i.root.didUpdate(),i.addEventListener("animationComplete",()=>{this.safeToRemove()}),i.setOptions({...i.options,layoutDependency:this.props.layoutDependency,onExitComplete:()=>this.safeToRemove()})),Og.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}),jw=!0,s||e.layoutDependency!==n||n===void 0||e.isPresent!==i?o.willUpdate():this.safeToRemove(),e.isPresent!==i&&(i?o.promote():o.relegate()||bn.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(),_k.postRender(()=>{!r.currentAnimation&&r.isLead()&&this.safeToRemove()}))}componentWillUnmount(){const{visualElement:e,layoutGroup:n,switchLayoutGroup:r}=this.props,{projection:s}=e;jw=!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 FD(t){const[e,n]=ED(),r=v.useContext(ek);return T.jsx(mne,{...t,layoutGroup:r,switchLayoutGroup:v.useContext(MD),isPresent:e,safeToRemove:n})}const gne={pan:{Feature:pne},drag:{Feature:hne,ProjectionNode:kD,MeasureLayout:FD}};function RA(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&&bn.postRender(()=>i(e,_m(e)))}class vne extends ac{mount(){const{current:e}=this.node;e&&(this.unmount=zJ(e,(n,r)=>(RA(this.node,r,"Start"),s=>RA(this.node,s,"End"))))}unmount(){}}class yne extends ac{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=gm(Fp(this.node.current,"focus",()=>this.onFocus()),Fp(this.node.current,"blur",()=>this.onBlur()))}unmount(){}}function AA(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&&bn.postRender(()=>i(e,_m(e)))}class _ne extends ac{mount(){const{current:e}=this.node;if(!e)return;const{globalTapTarget:n,propagate:r}=this.node.props;this.unmount=WJ(e,(s,i)=>(AA(this.node,i,"Start"),(o,{success:l})=>AA(this.node,o,l?"End":"Cancel")),{useGlobalTarget:n,stopPropagation:(r==null?void 0:r.tap)===!1})}unmount(){}}const lx=new WeakMap,zw=new WeakMap,wne=t=>{const e=lx.get(t.target);e&&e(t)},bne=t=>{t.forEach(wne)};function xne({root:t,...e}){const n=t||document;zw.has(n)||zw.set(n,{});const r=zw.get(n),s=JSON.stringify(e);return r[s]||(r[s]=new IntersectionObserver(bne,{root:t,...e})),r[s]}function Sne(t,e,n){const r=xne(e);return lx.set(t,n),r.observe(t),()=>{lx.delete(t),r.unobserve(t)}}const kne={some:0,all:1};class Ene extends ac{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:kne[s]},l=d=>{const{isIntersecting:f}=d;if(this.isInView===f||(this.isInView=f,i&&!f&&this.hasEnteredView))return;f&&(this.hasEnteredView=!0),this.node.animationState&&this.node.animationState.setActive("whileInView",f);const{onViewportEnter:h,onViewportLeave:m}=this.node.getProps(),g=f?h:m;g&&g(d)};this.stopObserver=Sne(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(Cne(e,n))&&this.startObserver()}unmount(){var e;(e=this.stopObserver)==null||e.call(this),this.hasEnteredView=!1,this.isInView=!1}}function Cne({viewport:t={}},{viewport:e={}}={}){return n=>t[n]!==e[n]}const Pne={inView:{Feature:Ene},tap:{Feature:_ne},focus:{Feature:yne},hover:{Feature:vne}},Tne={layout:{ProjectionNode:kD,MeasureLayout:FD}},Rne={...Qte,...Pne,...gne,...Tne},Ane=Kte(Rne,Gte);function Ine(){!kk.current&&tD();const[t]=v.useState(Iv.current);return t}const La=Ane;var One=(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 Mne=function(t,e,n){return typeof e=="symbol"&&(e=e.description?"[".concat(e.description,"]"):""),Object.defineProperty(t,"name",{configurable:!0,value:n?"".concat(n," ",e):e})},X0,IA="__POSTHOG_REACT_SHARED_STATE__",OA=typeof globalThis<"u"?globalThis:typeof window<"u"?window:{},zp;try{zp=OA[IA]=OA[IA]||new WeakMap}catch{zp=new WeakMap}zp.has(v.createContext)||zp.set(v.createContext,{});var cu=zp.get(v.createContext),cx;function Lne(t){(!cu.defaultPostHogInstance||cu.defaultPostHogInstance===cx)&&(cu.defaultPostHogInstance=t),cx=t}function ux(){return cx}cu.context||(cu.context=v.createContext({get client(){return ux()||cu.defaultPostHogInstance},bootstrap:void 0}));var Rk=cu.context;function jD(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)||!jD(t[l],e[l],n))return!1}return!0}function Nne(t){var e,n,r=t.children,s=t.client,i=t.apiKey,o=t.options,l=v.useRef(null),u=v.useMemo(function(){if(s)return i&&console.warn("[PostHog.js] You have provided both `client` and `apiKey` to `PostHogProvider`. `apiKey` will be ignored in favour of `client`."),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=ux();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 v.useEffect(function(){if(!(s||!i)){var d=ux(),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&&!jD(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)]),Se.createElement(Rk.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 Vw=function(t){return typeof t=="function"},Dne=function(t){return t===void 0},xi=function(){var t=v.useContext(Rk).client;return t},Mg=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]"},$ne=function(t,e){try{Object.defineProperty(t,"name",{value:e,writable:!0,enumerable:!0,configurable:!0})}catch{}},Fne=function(t,e){for(var n=new WeakSet,r=t;!n.has(r);){if(n.add(r),!Mg(r.cause)){Dne(r.cause)||(e.cause=r.cause),r.cause=e;return}r=r.cause}},jne=function(t,e){if(!e)return t;var n=new Error(Mg(t)?t.message:"Primitive value captured as exception: ".concat(String(t)));return $ne(n,"React ErrorBoundary ".concat(Mg(t)?t.name:"Error")),n.stack=e,Mg(t)?(Fne(t,n),t):n},MA={componentStack:null,exceptionEvent:null,error:null},zne={INVALID_FALLBACK:"[PostHog.js][PostHogErrorBoundary] Invalid fallback prop, provide a valid React element or a function that returns a valid React element."},Vne=(X0=(function(t){One(e,t);function e(n){var r=t.call(this,n)||this;return r._resetError=function(){r.setState(MA)},r.state=MA,r}return e.prototype.componentDidCatch=function(n,r){var s=this.props.additionalProperties,i;Vw(s)?i=s(n,r):typeof s=="object"&&(i=s);var o=this.context.client,l=r.componentStack,u=o.captureException(jne(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 Vw(r)?r():r;var o=Vw(s)?Se.createElement(s,{error:i.error,componentStack:i.componentStack,exceptionEvent:i.exceptionEvent,resetError:this._resetError}):s;return Se.isValidElement(o)?o:(console.warn(zne.INVALID_FALLBACK),Se.createElement(Se.Fragment,null))},e})(Se.Component),Mne(X0,"PostHogErrorBoundary"),(function(){X0.contextType=Rk})(),X0);Lne(Xe);const Hne="rivet-preview-bridge",Une=["ArrowUp","ArrowDown"],Zne=new Set(["INPUT","TEXTAREA","SELECT"]),zD=t=>!t||!("tagName"in t)||typeof t.tagName!="string"?!1:Zne.has(t.tagName.toUpperCase())||"isContentEditable"in t&&t.isContentEditable===!0,Bne=t=>typeof t!="object"||t===null||!("channel"in t)||t.channel!==Hne||!("direction"in t)||t.direction!=="event"||!("type"in t)||t.type!=="keydown"||!("key"in t)?null:Une.find(e=>e===t.key)??null,Wne=t=>{try{return new URL(t.src,window.location.href).origin}catch{return null}},Kne=t=>t.source===null?null:Array.from(document.querySelectorAll("iframe")).find(e=>e.contentWindow===t.source&&Wne(e)===t.origin)??null,Gne=t=>{const e=n=>{zD(n.target)||t(n)};return window.addEventListener("keydown",e),()=>window.removeEventListener("keydown",e)},qne=()=>{const t=e=>{const n=Bne(e.data),r=n?Kne(e):null;!n||!r||r.dispatchEvent(new KeyboardEvent("keydown",{key:n,bubbles:!0,cancelable:!0}))};return window.addEventListener("message",t),()=>window.removeEventListener("message",t)};var Q0={},Hw={exports:{}},$s={},Uw={exports:{}},Zw={};/**
86
- * @license React
87
- * scheduler.production.min.js
88
- *
89
- * Copyright (c) Facebook, Inc. and its affiliates.
90
- *
91
- * This source code is licensed under the MIT license found in the
92
- * LICENSE file in the root directory of this source tree.
93
- */var LA;function Yne(){return LA||(LA=1,(function(t){function e(Z,J){var q=Z.length;Z.push(J);e:for(;0<q;){var j=q-1>>>1,Y=Z[j];if(0<s(Y,J))Z[j]=J,Z[q]=Y,q=j;else break e}}function n(Z){return Z.length===0?null:Z[0]}function r(Z){if(Z.length===0)return null;var J=Z[0],q=Z.pop();if(q!==J){Z[0]=q;e:for(var j=0,Y=Z.length,ue=Y>>>1;j<ue;){var ie=2*(j+1)-1,ce=Z[ie],he=ie+1,ke=Z[he];if(0>s(ce,q))he<Y&&0>s(ke,ce)?(Z[j]=ke,Z[he]=q,j=he):(Z[j]=ce,Z[ie]=q,j=ie);else if(he<Y&&0>s(ke,q))Z[j]=ke,Z[he]=q,j=he;else break e}}return J}function s(Z,J){var q=Z.sortIndex-J.sortIndex;return q!==0?q:Z.id-J.id}if(typeof performance=="object"&&typeof performance.now=="function"){var i=performance;t.unstable_now=function(){return i.now()}}else{var o=Date,l=o.now();t.unstable_now=function(){return o.now()-l}}var u=[],d=[],f=1,h=null,m=3,g=!1,_=!1,y=!1,b=typeof setTimeout=="function"?setTimeout:null,x=typeof clearTimeout=="function"?clearTimeout:null,S=typeof setImmediate<"u"?setImmediate:null;typeof navigator<"u"&&navigator.scheduling!==void 0&&navigator.scheduling.isInputPending!==void 0&&navigator.scheduling.isInputPending.bind(navigator.scheduling);function E(Z){for(var J=n(d);J!==null;){if(J.callback===null)r(d);else if(J.startTime<=Z)r(d),J.sortIndex=J.expirationTime,e(u,J);else break;J=n(d)}}function C(Z){if(y=!1,E(Z),!_)if(n(u)!==null)_=!0,K(R);else{var J=n(d);J!==null&&te(C,J.startTime-Z)}}function R(Z,J){_=!1,y&&(y=!1,x(A),A=-1),g=!0;var q=m;try{for(E(J),h=n(u);h!==null&&(!(h.expirationTime>J)||Z&&!H());){var j=h.callback;if(typeof j=="function"){h.callback=null,m=h.priorityLevel;var Y=j(h.expirationTime<=J);J=t.unstable_now(),typeof Y=="function"?h.callback=Y:h===n(u)&&r(u),E(J)}else r(u);h=n(u)}if(h!==null)var ue=!0;else{var ie=n(d);ie!==null&&te(C,ie.startTime-J),ue=!1}return ue}finally{h=null,m=q,g=!1}}var O=!1,I=null,A=-1,L=5,N=-1;function H(){return!(t.unstable_now()-N<L)}function $(){if(I!==null){var Z=t.unstable_now();N=Z;var J=!0;try{J=I(!0,Z)}finally{J?W():(O=!1,I=null)}}else O=!1}var W;if(typeof S=="function")W=function(){S($)};else if(typeof MessageChannel<"u"){var X=new MessageChannel,z=X.port2;X.port1.onmessage=$,W=function(){z.postMessage(null)}}else W=function(){b($,0)};function K(Z){I=Z,O||(O=!0,W())}function te(Z,J){A=b(function(){Z(t.unstable_now())},J)}t.unstable_IdlePriority=5,t.unstable_ImmediatePriority=1,t.unstable_LowPriority=4,t.unstable_NormalPriority=3,t.unstable_Profiling=null,t.unstable_UserBlockingPriority=2,t.unstable_cancelCallback=function(Z){Z.callback=null},t.unstable_continueExecution=function(){_||g||(_=!0,K(R))},t.unstable_forceFrameRate=function(Z){0>Z||125<Z?console.error("forceFrameRate takes a positive int between 0 and 125, forcing frame rates higher than 125 fps is not supported"):L=0<Z?Math.floor(1e3/Z):5},t.unstable_getCurrentPriorityLevel=function(){return m},t.unstable_getFirstCallbackNode=function(){return n(u)},t.unstable_next=function(Z){switch(m){case 1:case 2:case 3:var J=3;break;default:J=m}var q=m;m=J;try{return Z()}finally{m=q}},t.unstable_pauseExecution=function(){},t.unstable_requestPaint=function(){},t.unstable_runWithPriority=function(Z,J){switch(Z){case 1:case 2:case 3:case 4:case 5:break;default:Z=3}var q=m;m=Z;try{return J()}finally{m=q}},t.unstable_scheduleCallback=function(Z,J,q){var j=t.unstable_now();switch(typeof q=="object"&&q!==null?(q=q.delay,q=typeof q=="number"&&0<q?j+q:j):q=j,Z){case 1:var Y=-1;break;case 2:Y=250;break;case 5:Y=1073741823;break;case 4:Y=1e4;break;default:Y=5e3}return Y=q+Y,Z={id:f++,callback:J,priorityLevel:Z,startTime:q,expirationTime:Y,sortIndex:-1},q>j?(Z.sortIndex=q,e(d,Z),n(u)===null&&Z===n(d)&&(y?(x(A),A=-1):y=!0,te(C,q-j))):(Z.sortIndex=Y,e(u,Z),_||g||(_=!0,K(R))),Z},t.unstable_shouldYield=H,t.unstable_wrapCallback=function(Z){var J=m;return function(){var q=m;m=J;try{return Z.apply(this,arguments)}finally{m=q}}}})(Zw)),Zw}var NA;function Xne(){return NA||(NA=1,Uw.exports=Yne()),Uw.exports}/**
94
- * @license React
95
- * react-dom.production.min.js
96
- *
97
- * Copyright (c) Facebook, Inc. and its affiliates.
98
- *
99
- * This source code is licensed under the MIT license found in the
100
- * LICENSE file in the root directory of this source tree.
101
- */var DA;function Qne(){if(DA)return $s;DA=1;var t=oS(),e=Xne();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 m(a){return u.call(h,a)?!0:u.call(f,a)?!1:d.test(a)?h[a]=!0:(f[a]=!0,!1)}function g(a,c,p,w){if(p!==null&&p.type===0)return!1;switch(typeof c){case"function":case"symbol":return!0;case"boolean":return w?!1:p!==null?!p.acceptsBooleans:(a=a.toLowerCase().slice(0,5),a!=="data-"&&a!=="aria-");default:return!1}}function _(a,c,p,w){if(c===null||typeof c>"u"||g(a,c,p,w))return!0;if(w)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 y(a,c,p,w,k,P,M){this.acceptsBooleans=c===2||c===3||c===4,this.attributeName=w,this.attributeNamespace=k,this.mustUseProperty=p,this.propertyName=a,this.type=c,this.sanitizeURL=P,this.removeEmptyString=M}var b={};"children dangerouslySetInnerHTML defaultValue defaultChecked innerHTML suppressContentEditableWarning suppressHydrationWarning style".split(" ").forEach(function(a){b[a]=new y(a,0,!1,a,null,!1,!1)}),[["acceptCharset","accept-charset"],["className","class"],["htmlFor","for"],["httpEquiv","http-equiv"]].forEach(function(a){var c=a[0];b[c]=new y(c,1,!1,a[1],null,!1,!1)}),["contentEditable","draggable","spellCheck","value"].forEach(function(a){b[a]=new y(a,2,!1,a.toLowerCase(),null,!1,!1)}),["autoReverse","externalResourcesRequired","focusable","preserveAlpha"].forEach(function(a){b[a]=new y(a,2,!1,a,null,!1,!1)}),"allowFullScreen async autoFocus autoPlay controls default defer disabled disablePictureInPicture disableRemotePlayback formNoValidate hidden loop noModule noValidate open playsInline readOnly required reversed scoped seamless itemScope".split(" ").forEach(function(a){b[a]=new y(a,3,!1,a.toLowerCase(),null,!1,!1)}),["checked","multiple","muted","selected"].forEach(function(a){b[a]=new y(a,3,!0,a,null,!1,!1)}),["capture","download"].forEach(function(a){b[a]=new y(a,4,!1,a,null,!1,!1)}),["cols","rows","size","span"].forEach(function(a){b[a]=new y(a,6,!1,a,null,!1,!1)}),["rowSpan","start"].forEach(function(a){b[a]=new y(a,5,!1,a.toLowerCase(),null,!1,!1)});var x=/[\-:]([a-z])/g;function S(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(x,S);b[c]=new y(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(x,S);b[c]=new y(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(x,S);b[c]=new y(c,1,!1,a,"http://www.w3.org/XML/1998/namespace",!1,!1)}),["tabIndex","crossOrigin"].forEach(function(a){b[a]=new y(a,1,!1,a.toLowerCase(),null,!1,!1)}),b.xlinkHref=new y("xlinkHref",1,!1,"xlink:href","http://www.w3.org/1999/xlink",!0,!1),["src","href","action","formAction"].forEach(function(a){b[a]=new y(a,1,!1,a.toLowerCase(),null,!0,!0)});function E(a,c,p,w){var k=b.hasOwnProperty(c)?b[c]:null;(k!==null?k.type!==0:w||!(2<c.length)||c[0]!=="o"&&c[0]!=="O"||c[1]!=="n"&&c[1]!=="N")&&(_(c,p,k,w)&&(p=null),w||k===null?m(c)&&(p===null?a.removeAttribute(c):a.setAttribute(c,""+p)):k.mustUseProperty?a[k.propertyName]=p===null?k.type===3?!1:"":p:(c=k.attributeName,w=k.attributeNamespace,p===null?a.removeAttribute(c):(k=k.type,p=k===3||k===4&&p===!0?"":""+p,w?a.setAttributeNS(w,c,p):a.setAttribute(c,p))))}var C=t.__SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED,R=Symbol.for("react.element"),O=Symbol.for("react.portal"),I=Symbol.for("react.fragment"),A=Symbol.for("react.strict_mode"),L=Symbol.for("react.profiler"),N=Symbol.for("react.provider"),H=Symbol.for("react.context"),$=Symbol.for("react.forward_ref"),W=Symbol.for("react.suspense"),X=Symbol.for("react.suspense_list"),z=Symbol.for("react.memo"),K=Symbol.for("react.lazy"),te=Symbol.for("react.offscreen"),Z=Symbol.iterator;function J(a){return a===null||typeof a!="object"?null:(a=Z&&a[Z]||a["@@iterator"],typeof a=="function"?a:null)}var q=Object.assign,j;function Y(a){if(j===void 0)try{throw Error()}catch(p){var c=p.stack.trim().match(/\n( *(at )?)/);j=c&&c[1]||""}return`
102
- `+j+a}var ue=!1;function ie(a,c){if(!a||ue)return"";ue=!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(se){var w=se}Reflect.construct(a,[],c)}else{try{c.call()}catch(se){w=se}a.call(c.prototype)}else{try{throw Error()}catch(se){w=se}a()}}catch(se){if(se&&w&&typeof se.stack=="string"){for(var k=se.stack.split(`
103
- `),P=w.stack.split(`
104
- `),M=k.length-1,U=P.length-1;1<=M&&0<=U&&k[M]!==P[U];)U--;for(;1<=M&&0<=U;M--,U--)if(k[M]!==P[U]){if(M!==1||U!==1)do if(M--,U--,0>U||k[M]!==P[U]){var G=`
105
- `+k[M].replace(" at new "," at ");return a.displayName&&G.includes("<anonymous>")&&(G=G.replace("<anonymous>",a.displayName)),G}while(1<=M&&0<=U);break}}}finally{ue=!1,Error.prepareStackTrace=p}return(a=a?a.displayName||a.name:"")?Y(a):""}function ce(a){switch(a.tag){case 5:return Y(a.type);case 16:return Y("Lazy");case 13:return Y("Suspense");case 19:return Y("SuspenseList");case 0:case 2:case 15:return a=ie(a.type,!1),a;case 11:return a=ie(a.type.render,!1),a;case 1:return a=ie(a.type,!0),a;default:return""}}function he(a){if(a==null)return null;if(typeof a=="function")return a.displayName||a.name||null;if(typeof a=="string")return a;switch(a){case I:return"Fragment";case O:return"Portal";case L:return"Profiler";case A:return"StrictMode";case W:return"Suspense";case X:return"SuspenseList"}if(typeof a=="object")switch(a.$$typeof){case H:return(a.displayName||"Context")+".Consumer";case N:return(a._context.displayName||"Context")+".Provider";case $:var c=a.render;return a=a.displayName,a||(a=c.displayName||c.name||"",a=a!==""?"ForwardRef("+a+")":"ForwardRef"),a;case z:return c=a.displayName||null,c!==null?c:he(a.type)||"Memo";case K:c=a._payload,a=a._init;try{return he(a(c))}catch{}}return null}function ke(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 he(c);case 8:return c===A?"StrictMode":"Mode";case 22:return"Offscreen";case 12:return"Profiler";case 21:return"Scope";case 13:return"Suspense";case 19:return"SuspenseList";case 25:return"TracingMarker";case 1:case 0:case 17:case 2:case 14:case 15:if(typeof c=="function")return c.displayName||c.name||null;if(typeof c=="string")return c}return null}function ve(a){switch(typeof a){case"boolean":case"number":case"string":case"undefined":return a;case"object":return a;default:return""}}function pe(a){var c=a.type;return(a=a.nodeName)&&a.toLowerCase()==="input"&&(c==="checkbox"||c==="radio")}function Ne(a){var c=pe(a)?"checked":"value",p=Object.getOwnPropertyDescriptor(a.constructor.prototype,c),w=""+a[c];if(!a.hasOwnProperty(c)&&typeof p<"u"&&typeof p.get=="function"&&typeof p.set=="function"){var k=p.get,P=p.set;return Object.defineProperty(a,c,{configurable:!0,get:function(){return k.call(this)},set:function(M){w=""+M,P.call(this,M)}}),Object.defineProperty(a,c,{enumerable:p.enumerable}),{getValue:function(){return w},setValue:function(M){w=""+M},stopTracking:function(){a._valueTracker=null,delete a[c]}}}}function Ae(a){a._valueTracker||(a._valueTracker=Ne(a))}function $e(a){if(!a)return!1;var c=a._valueTracker;if(!c)return!0;var p=c.getValue(),w="";return a&&(w=pe(a)?a.checked?"true":"false":a.value),a=w,a!==p?(c.setValue(a),!0):!1}function kt(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 fn(a,c){var p=c.checked;return q({},c,{defaultChecked:void 0,defaultValue:void 0,value:void 0,checked:p??a._wrapperState.initialChecked})}function on(a,c){var p=c.defaultValue==null?"":c.defaultValue,w=c.checked!=null?c.checked:c.defaultChecked;p=ve(c.value!=null?c.value:p),a._wrapperState={initialChecked:w,initialValue:p,controlled:c.type==="checkbox"||c.type==="radio"?c.checked!=null:c.value!=null}}function Et(a,c){c=c.checked,c!=null&&E(a,"checked",c,!1)}function Gt(a,c){Et(a,c);var p=ve(c.value),w=c.type;if(p!=null)w==="number"?(p===0&&a.value===""||a.value!=p)&&(a.value=""+p):a.value!==""+p&&(a.value=""+p);else if(w==="submit"||w==="reset"){a.removeAttribute("value");return}c.hasOwnProperty("value")?Qt(a,c.type,p):c.hasOwnProperty("defaultValue")&&Qt(a,c.type,ve(c.defaultValue)),c.checked==null&&c.defaultChecked!=null&&(a.defaultChecked=!!c.defaultChecked)}function vn(a,c,p){if(c.hasOwnProperty("value")||c.hasOwnProperty("defaultValue")){var w=c.type;if(!(w!=="submit"&&w!=="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 Qt(a,c,p){(c!=="number"||kt(a.ownerDocument)!==a)&&(p==null?a.defaultValue=""+a._wrapperState.initialValue:a.defaultValue!==""+p&&(a.defaultValue=""+p))}var Me=Array.isArray;function Qe(a,c,p,w){if(a=a.options,c){c={};for(var k=0;k<p.length;k++)c["$"+p[k]]=!0;for(p=0;p<a.length;p++)k=c.hasOwnProperty("$"+a[p].value),a[p].selected!==k&&(a[p].selected=k),k&&w&&(a[p].defaultSelected=!0)}else{for(p=""+ve(p),c=null,k=0;k<a.length;k++){if(a[k].value===p){a[k].selected=!0,w&&(a[k].defaultSelected=!0);return}c!==null||a[k].disabled||(c=a[k])}c!==null&&(c.selected=!0)}}function Te(a,c){if(c.dangerouslySetInnerHTML!=null)throw Error(n(91));return q({},c,{value:void 0,defaultValue:void 0,children:""+a._wrapperState.initialValue})}function St(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(Me(p)){if(1<p.length)throw Error(n(93));p=p[0]}c=p}c==null&&(c=""),p=c}a._wrapperState={initialValue:ve(p)}}function be(a,c){var p=ve(c.value),w=ve(c.defaultValue);p!=null&&(p=""+p,p!==a.value&&(a.value=p),c.defaultValue==null&&a.defaultValue!==p&&(a.defaultValue=p)),w!=null&&(a.defaultValue=""+w)}function Nt(a){var c=a.textContent;c===a._wrapperState.initialValue&&c!==""&&c!==null&&(a.value=c)}function ft(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 pt(a,c){return a==null||a==="http://www.w3.org/1999/xhtml"?ft(c):a==="http://www.w3.org/2000/svg"&&c==="foreignObject"?"http://www.w3.org/1999/xhtml":a}var qn,Ei=(function(a){return typeof MSApp<"u"&&MSApp.execUnsafeLocalFunction?function(c,p,w,k){MSApp.execUnsafeLocalFunction(function(){return a(c,p,w,k)})}:a})(function(a,c){if(a.namespaceURI!=="http://www.w3.org/2000/svg"||"innerHTML"in a)a.innerHTML=c;else{for(qn=qn||document.createElement("div"),qn.innerHTML="<svg>"+c.valueOf().toString()+"</svg>",c=qn.firstChild;a.firstChild;)a.removeChild(a.firstChild);for(;c.firstChild;)a.appendChild(c.firstChild)}});function xn(a,c){if(c){var p=a.firstChild;if(p&&p===a.lastChild&&p.nodeType===3){p.nodeValue=c;return}}a.textContent=c}var nr={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},Gi=["Webkit","ms","Moz","O"];Object.keys(nr).forEach(function(a){Gi.forEach(function(c){c=c+a.charAt(0).toUpperCase()+a.substring(1),nr[c]=nr[a]})});function ps(a,c,p){return c==null||typeof c=="boolean"||c===""?"":p||typeof c!="number"||c===0||nr.hasOwnProperty(a)&&nr[a]?(""+c).trim():c+"px"}function Xr(a,c){a=a.style;for(var p in c)if(c.hasOwnProperty(p)){var w=p.indexOf("--")===0,k=ps(p,c[p],w);p==="float"&&(p="cssFloat"),w?a.setProperty(p,k):a[p]=k}}var Yn=q({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 hn(a,c){if(c){if(Yn[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 Qr(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 ar=null;function vo(a){return a=a.target||a.srcElement||window,a.correspondingUseElement&&(a=a.correspondingUseElement),a.nodeType===3?a.parentNode:a}var zr=null,Xn=null,Pr=null;function ni(a){if(a=nh(a)){if(typeof zr!="function")throw Error(n(280));var c=a.stateNode;c&&(c=zm(c),zr(a.stateNode,a.type,c))}}function rr(a){Xn?Pr?Pr.push(a):Pr=[a]:Xn=a}function ms(){if(Xn){var a=Xn,c=Pr;if(Pr=Xn=null,ni(a),c)for(a=0;a<c.length;a++)ni(c[a])}}function st(a,c){return a(c)}function sn(){}var Jt=!1;function pn(a,c,p){if(Jt)return a(c,p);Jt=!0;try{return st(a,c,p)}finally{Jt=!1,(Xn!==null||Pr!==null)&&(sn(),ms())}}function Sn(a,c){var p=a.stateNode;if(p===null)return null;var w=zm(p);if(w===null)return null;p=w[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":(w=!w.disabled)||(a=a.type,w=!(a==="button"||a==="input"||a==="select"||a==="textarea")),a=!w;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 In={};Object.defineProperty(In,"passive",{get:function(){Bt=!0}}),window.addEventListener("test",In,In),window.removeEventListener("test",In,In)}catch{Bt=!1}function Jr(a,c,p,w,k,P,M,U,G){var se=Array.prototype.slice.call(arguments,3);try{c.apply(p,se)}catch(_e){this.onError(_e)}}var Qn=!1,vr=null,Vt=!1,Ci=null,Uf={onError:function(a){Qn=!0,vr=a}};function Ka(a,c,p,w,k,P,M,U,G){Qn=!1,vr=null,Jr.apply(Uf,arguments)}function yo(a,c,p,w,k,P,M,U,G){if(Ka.apply(this,arguments),Qn){if(Qn){var se=vr;Qn=!1,vr=null}else throw Error(n(198));Vt||(Vt=!0,Ci=se)}}function Tr(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 Pi(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 Rs(a){if(Tr(a)!==a)throw Error(n(188))}function qi(a){var c=a.alternate;if(!c){if(c=Tr(a),c===null)throw Error(n(188));return c!==a?null:a}for(var p=a,w=c;;){var k=p.return;if(k===null)break;var P=k.alternate;if(P===null){if(w=k.return,w!==null){p=w;continue}break}if(k.child===P.child){for(P=k.child;P;){if(P===p)return Rs(k),a;if(P===w)return Rs(k),c;P=P.sibling}throw Error(n(188))}if(p.return!==w.return)p=k,w=P;else{for(var M=!1,U=k.child;U;){if(U===p){M=!0,p=k,w=P;break}if(U===w){M=!0,w=k,p=P;break}U=U.sibling}if(!M){for(U=P.child;U;){if(U===p){M=!0,p=P,w=k;break}if(U===w){M=!0,w=P,p=k;break}U=U.sibling}if(!M)throw Error(n(189))}}if(p.alternate!==w)throw Error(n(190))}if(p.tag!==3)throw Error(n(188));return p.stateNode.current===p?a:c}function As(a){return a=qi(a),a!==null?Ga(a):null}function Ga(a){if(a.tag===5||a.tag===6)return a;for(a=a.child;a!==null;){var c=Ga(a);if(c!==null)return c;a=a.sibling}return null}var ri=e.unstable_scheduleCallback,dc=e.unstable_cancelCallback,Tu=e.unstable_shouldYield,qa=e.unstable_requestPaint,an=e.unstable_now,_o=e.unstable_getCurrentPriorityLevel,si=e.unstable_ImmediatePriority,wo=e.unstable_UserBlockingPriority,Vr=e.unstable_NormalPriority,fc=e.unstable_LowPriority,hc=e.unstable_IdlePriority,ra=null,es=null;function Ru(a){if(es&&typeof es.onCommitFiberRoot=="function")try{es.onCommitFiberRoot(ra,a,void 0,(a.current.flags&128)===128)}catch{}}var gs=Math.clz32?Math.clz32:bo,Zf=Math.log,Au=Math.LN2;function bo(a){return a>>>=0,a===0?32:31-(Zf(a)/Au|0)|0}var xo=64,D=4194304;function de(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 me(a,c){var p=a.pendingLanes;if(p===0)return 0;var w=0,k=a.suspendedLanes,P=a.pingedLanes,M=p&268435455;if(M!==0){var U=M&~k;U!==0?w=de(U):(P&=M,P!==0&&(w=de(P)))}else M=p&~k,M!==0?w=de(M):P!==0&&(w=de(P));if(w===0)return 0;if(c!==0&&c!==w&&(c&k)===0&&(k=w&-w,P=c&-c,k>=P||k===16&&(P&4194240)!==0))return c;if((w&4)!==0&&(w|=p&16),c=a.entangledLanes,c!==0)for(a=a.entanglements,c&=w;0<c;)p=31-gs(c),k=1<<p,w|=a[p],c&=~k;return w}function xe(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 Be(a,c){for(var p=a.suspendedLanes,w=a.pingedLanes,k=a.expirationTimes,P=a.pendingLanes;0<P;){var M=31-gs(P),U=1<<M,G=k[M];G===-1?((U&p)===0||(U&w)!==0)&&(k[M]=xe(U,c)):G<=c&&(a.expiredLanes|=U),P&=~U}}function vt(a){return a=a.pendingLanes&-1073741825,a!==0?a:a&1073741824?1073741824:0}function mt(){var a=xo;return xo<<=1,(xo&4194240)===0&&(xo=64),a}function $t(a){for(var c=[],p=0;31>p;p++)c.push(a);return c}function qt(a,c,p){a.pendingLanes|=c,c!==536870912&&(a.suspendedLanes=0,a.pingedLanes=0),a=a.eventTimes,c=31-gs(c),a[c]=p}function yt(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 w=a.eventTimes;for(a=a.expirationTimes;0<p;){var k=31-gs(p),P=1<<k;c[k]=0,w[k]=-1,a[k]=-1,p&=~P}}function On(a,c){var p=a.entangledLanes|=c;for(a=a.entanglements;p;){var w=31-gs(p),k=1<<w;k&c|a[w]&c&&(a[w]|=c),p&=~k}}var it=0;function Rr(a){return a&=-a,1<a?4<a?(a&268435455)!==0?16:536870912:4:1}var Ya,So,yr,sa,Iu,Ou=!1,pc=[],V=null,oe=null,Ie=null,Ee=new Map,Re=new Map,Le=[],Ct="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 ut(a,c){switch(a){case"focusin":case"focusout":V=null;break;case"dragenter":case"dragleave":oe=null;break;case"mouseover":case"mouseout":Ie=null;break;case"pointerover":case"pointerout":Ee.delete(c.pointerId);break;case"gotpointercapture":case"lostpointercapture":Re.delete(c.pointerId)}}function gt(a,c,p,w,k,P){return a===null||a.nativeEvent!==P?(a={blockedOn:c,domEventName:p,eventSystemFlags:w,nativeEvent:P,targetContainers:[k]},c!==null&&(c=nh(c),c!==null&&So(c)),a):(a.eventSystemFlags|=w,c=a.targetContainers,k!==null&&c.indexOf(k)===-1&&c.push(k),a)}function _r(a,c,p,w,k){switch(c){case"focusin":return V=gt(V,a,c,p,w,k),!0;case"dragenter":return oe=gt(oe,a,c,p,w,k),!0;case"mouseover":return Ie=gt(Ie,a,c,p,w,k),!0;case"pointerover":var P=k.pointerId;return Ee.set(P,gt(Ee.get(P)||null,a,c,p,w,k)),!0;case"gotpointercapture":return P=k.pointerId,Re.set(P,gt(Re.get(P)||null,a,c,p,w,k)),!0}return!1}function ts(a){var c=mc(a.target);if(c!==null){var p=Tr(c);if(p!==null){if(c=p.tag,c===13){if(c=Pi(p),c!==null){a.blockedOn=c,Iu(a.priority,function(){yr(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 vs(a){if(a.blockedOn!==null)return!1;for(var c=a.targetContainers;0<c.length;){var p=qy(a.domEventName,a.eventSystemFlags,c[0],a.nativeEvent);if(p===null){p=a.nativeEvent;var w=new p.constructor(p.type,p);ar=w,p.target.dispatchEvent(w),ar=null}else return c=nh(p),c!==null&&So(c),a.blockedOn=p,!1;c.shift()}return!0}function Is(a,c,p){vs(a)&&p.delete(c)}function en(){Ou=!1,V!==null&&vs(V)&&(V=null),oe!==null&&vs(oe)&&(oe=null),Ie!==null&&vs(Ie)&&(Ie=null),Ee.forEach(Is),Re.forEach(Is)}function Pt(a,c){a.blockedOn===c&&(a.blockedOn=null,Ou||(Ou=!0,e.unstable_scheduleCallback(e.unstable_NormalPriority,en)))}function ko(a){function c(k){return Pt(k,a)}if(0<pc.length){Pt(pc[0],a);for(var p=1;p<pc.length;p++){var w=pc[p];w.blockedOn===a&&(w.blockedOn=null)}}for(V!==null&&Pt(V,a),oe!==null&&Pt(oe,a),Ie!==null&&Pt(Ie,a),Ee.forEach(c),Re.forEach(c),p=0;p<Le.length;p++)w=Le[p],w.blockedOn===a&&(w.blockedOn=null);for(;0<Le.length&&(p=Le[0],p.blockedOn===null);)ts(p),p.blockedOn===null&&Le.shift()}var Ti=C.ReactCurrentBatchConfig,Pm=!0;function nj(a,c,p,w){var k=it,P=Ti.transition;Ti.transition=null;try{it=1,Gy(a,c,p,w)}finally{it=k,Ti.transition=P}}function rj(a,c,p,w){var k=it,P=Ti.transition;Ti.transition=null;try{it=4,Gy(a,c,p,w)}finally{it=k,Ti.transition=P}}function Gy(a,c,p,w){if(Pm){var k=qy(a,c,p,w);if(k===null)f1(a,c,w,Tm,p),ut(a,w);else if(_r(k,a,c,p,w))w.stopPropagation();else if(ut(a,w),c&4&&-1<Ct.indexOf(a)){for(;k!==null;){var P=nh(k);if(P!==null&&Ya(P),P=qy(a,c,p,w),P===null&&f1(a,c,w,Tm,p),P===k)break;k=P}k!==null&&w.stopPropagation()}else f1(a,c,w,null,p)}}var Tm=null;function qy(a,c,p,w){if(Tm=null,a=vo(w),a=mc(a),a!==null)if(c=Tr(a),c===null)a=null;else if(p=c.tag,p===13){if(a=Pi(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 Tm=a,null}function NE(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(_o()){case si:return 1;case wo:return 4;case Vr:case fc:return 16;case hc:return 536870912;default:return 16}default:return 16}}var Xa=null,Yy=null,Rm=null;function DE(){if(Rm)return Rm;var a,c=Yy,p=c.length,w,k="value"in Xa?Xa.value:Xa.textContent,P=k.length;for(a=0;a<p&&c[a]===k[a];a++);var M=p-a;for(w=1;w<=M&&c[p-w]===k[P-w];w++);return Rm=k.slice(a,1<w?1-w:void 0)}function Am(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 Im(){return!0}function $E(){return!1}function ii(a){function c(p,w,k,P,M){this._reactName=p,this._targetInst=k,this.type=w,this.nativeEvent=P,this.target=M,this.currentTarget=null;for(var U in a)a.hasOwnProperty(U)&&(p=a[U],this[U]=p?p(P):P[U]);return this.isDefaultPrevented=(P.defaultPrevented!=null?P.defaultPrevented:P.returnValue===!1)?Im:$E,this.isPropagationStopped=$E,this}return q(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=Im)},stopPropagation:function(){var p=this.nativeEvent;p&&(p.stopPropagation?p.stopPropagation():typeof p.cancelBubble!="unknown"&&(p.cancelBubble=!0),this.isPropagationStopped=Im)},persist:function(){},isPersistent:Im}),c}var Mu={eventPhase:0,bubbles:0,cancelable:0,timeStamp:function(a){return a.timeStamp||Date.now()},defaultPrevented:0,isTrusted:0},Xy=ii(Mu),Bf=q({},Mu,{view:0,detail:0}),sj=ii(Bf),Qy,Jy,Wf,Om=q({},Bf,{screenX:0,screenY:0,clientX:0,clientY:0,pageX:0,pageY:0,ctrlKey:0,shiftKey:0,altKey:0,metaKey:0,getModifierState:t1,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!==Wf&&(Wf&&a.type==="mousemove"?(Qy=a.screenX-Wf.screenX,Jy=a.screenY-Wf.screenY):Jy=Qy=0,Wf=a),Qy)},movementY:function(a){return"movementY"in a?a.movementY:Jy}}),FE=ii(Om),ij=q({},Om,{dataTransfer:0}),oj=ii(ij),aj=q({},Bf,{relatedTarget:0}),e1=ii(aj),lj=q({},Mu,{animationName:0,elapsedTime:0,pseudoElement:0}),cj=ii(lj),uj=q({},Mu,{clipboardData:function(a){return"clipboardData"in a?a.clipboardData:window.clipboardData}}),dj=ii(uj),fj=q({},Mu,{data:0}),jE=ii(fj),hj={Esc:"Escape",Spacebar:" ",Left:"ArrowLeft",Up:"ArrowUp",Right:"ArrowRight",Down:"ArrowDown",Del:"Delete",Win:"OS",Menu:"ContextMenu",Apps:"ContextMenu",Scroll:"ScrollLock",MozPrintableKey:"Unidentified"},pj={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"},mj={Alt:"altKey",Control:"ctrlKey",Meta:"metaKey",Shift:"shiftKey"};function gj(a){var c=this.nativeEvent;return c.getModifierState?c.getModifierState(a):(a=mj[a])?!!c[a]:!1}function t1(){return gj}var vj=q({},Bf,{key:function(a){if(a.key){var c=hj[a.key]||a.key;if(c!=="Unidentified")return c}return a.type==="keypress"?(a=Am(a),a===13?"Enter":String.fromCharCode(a)):a.type==="keydown"||a.type==="keyup"?pj[a.keyCode]||"Unidentified":""},code:0,location:0,ctrlKey:0,shiftKey:0,altKey:0,metaKey:0,repeat:0,locale:0,getModifierState:t1,charCode:function(a){return a.type==="keypress"?Am(a):0},keyCode:function(a){return a.type==="keydown"||a.type==="keyup"?a.keyCode:0},which:function(a){return a.type==="keypress"?Am(a):a.type==="keydown"||a.type==="keyup"?a.keyCode:0}}),yj=ii(vj),_j=q({},Om,{pointerId:0,width:0,height:0,pressure:0,tangentialPressure:0,tiltX:0,tiltY:0,twist:0,pointerType:0,isPrimary:0}),zE=ii(_j),wj=q({},Bf,{touches:0,targetTouches:0,changedTouches:0,altKey:0,metaKey:0,ctrlKey:0,shiftKey:0,getModifierState:t1}),bj=ii(wj),xj=q({},Mu,{propertyName:0,elapsedTime:0,pseudoElement:0}),Sj=ii(xj),kj=q({},Om,{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}),Ej=ii(kj),Cj=[9,13,27,32],n1=l&&"CompositionEvent"in window,Kf=null;l&&"documentMode"in document&&(Kf=document.documentMode);var Pj=l&&"TextEvent"in window&&!Kf,VE=l&&(!n1||Kf&&8<Kf&&11>=Kf),HE=" ",UE=!1;function ZE(a,c){switch(a){case"keyup":return Cj.indexOf(c.keyCode)!==-1;case"keydown":return c.keyCode!==229;case"keypress":case"mousedown":case"focusout":return!0;default:return!1}}function BE(a){return a=a.detail,typeof a=="object"&&"data"in a?a.data:null}var Lu=!1;function Tj(a,c){switch(a){case"compositionend":return BE(c);case"keypress":return c.which!==32?null:(UE=!0,HE);case"textInput":return a=c.data,a===HE&&UE?null:a;default:return null}}function Rj(a,c){if(Lu)return a==="compositionend"||!n1&&ZE(a,c)?(a=DE(),Rm=Yy=Xa=null,Lu=!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 VE&&c.locale!=="ko"?null:c.data;default:return null}}var Aj={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 WE(a){var c=a&&a.nodeName&&a.nodeName.toLowerCase();return c==="input"?!!Aj[a.type]:c==="textarea"}function KE(a,c,p,w){rr(w),c=$m(c,"onChange"),0<c.length&&(p=new Xy("onChange","change",null,p,w),a.push({event:p,listeners:c}))}var Gf=null,qf=null;function Ij(a){d6(a,0)}function Mm(a){var c=ju(a);if($e(c))return a}function Oj(a,c){if(a==="change")return c}var GE=!1;if(l){var r1;if(l){var s1="oninput"in document;if(!s1){var qE=document.createElement("div");qE.setAttribute("oninput","return;"),s1=typeof qE.oninput=="function"}r1=s1}else r1=!1;GE=r1&&(!document.documentMode||9<document.documentMode)}function YE(){Gf&&(Gf.detachEvent("onpropertychange",XE),qf=Gf=null)}function XE(a){if(a.propertyName==="value"&&Mm(qf)){var c=[];KE(c,qf,a,vo(a)),pn(Ij,c)}}function Mj(a,c,p){a==="focusin"?(YE(),Gf=c,qf=p,Gf.attachEvent("onpropertychange",XE)):a==="focusout"&&YE()}function Lj(a){if(a==="selectionchange"||a==="keyup"||a==="keydown")return Mm(qf)}function Nj(a,c){if(a==="click")return Mm(c)}function Dj(a,c){if(a==="input"||a==="change")return Mm(c)}function $j(a,c){return a===c&&(a!==0||1/a===1/c)||a!==a&&c!==c}var Yi=typeof Object.is=="function"?Object.is:$j;function Yf(a,c){if(Yi(a,c))return!0;if(typeof a!="object"||a===null||typeof c!="object"||c===null)return!1;var p=Object.keys(a),w=Object.keys(c);if(p.length!==w.length)return!1;for(w=0;w<p.length;w++){var k=p[w];if(!u.call(c,k)||!Yi(a[k],c[k]))return!1}return!0}function QE(a){for(;a&&a.firstChild;)a=a.firstChild;return a}function JE(a,c){var p=QE(a);a=0;for(var w;p;){if(p.nodeType===3){if(w=a+p.textContent.length,a<=c&&w>=c)return{node:p,offset:c-a};a=w}e:{for(;p;){if(p.nextSibling){p=p.nextSibling;break e}p=p.parentNode}p=void 0}p=QE(p)}}function e6(a,c){return a&&c?a===c?!0:a&&a.nodeType===3?!1:c&&c.nodeType===3?e6(a,c.parentNode):"contains"in a?a.contains(c):a.compareDocumentPosition?!!(a.compareDocumentPosition(c)&16):!1:!1}function t6(){for(var a=window,c=kt();c instanceof a.HTMLIFrameElement;){try{var p=typeof c.contentWindow.location.href=="string"}catch{p=!1}if(p)a=c.contentWindow;else break;c=kt(a.document)}return c}function i1(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 Fj(a){var c=t6(),p=a.focusedElem,w=a.selectionRange;if(c!==p&&p&&p.ownerDocument&&e6(p.ownerDocument.documentElement,p)){if(w!==null&&i1(p)){if(c=w.start,a=w.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 k=p.textContent.length,P=Math.min(w.start,k);w=w.end===void 0?P:Math.min(w.end,k),!a.extend&&P>w&&(k=w,w=P,P=k),k=JE(p,P);var M=JE(p,w);k&&M&&(a.rangeCount!==1||a.anchorNode!==k.node||a.anchorOffset!==k.offset||a.focusNode!==M.node||a.focusOffset!==M.offset)&&(c=c.createRange(),c.setStart(k.node,k.offset),a.removeAllRanges(),P>w?(a.addRange(c),a.extend(M.node,M.offset)):(c.setEnd(M.node,M.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 jj=l&&"documentMode"in document&&11>=document.documentMode,Nu=null,o1=null,Xf=null,a1=!1;function n6(a,c,p){var w=p.window===p?p.document:p.nodeType===9?p:p.ownerDocument;a1||Nu==null||Nu!==kt(w)||(w=Nu,"selectionStart"in w&&i1(w)?w={start:w.selectionStart,end:w.selectionEnd}:(w=(w.ownerDocument&&w.ownerDocument.defaultView||window).getSelection(),w={anchorNode:w.anchorNode,anchorOffset:w.anchorOffset,focusNode:w.focusNode,focusOffset:w.focusOffset}),Xf&&Yf(Xf,w)||(Xf=w,w=$m(o1,"onSelect"),0<w.length&&(c=new Xy("onSelect","select",null,c,p),a.push({event:c,listeners:w}),c.target=Nu)))}function Lm(a,c){var p={};return p[a.toLowerCase()]=c.toLowerCase(),p["Webkit"+a]="webkit"+c,p["Moz"+a]="moz"+c,p}var Du={animationend:Lm("Animation","AnimationEnd"),animationiteration:Lm("Animation","AnimationIteration"),animationstart:Lm("Animation","AnimationStart"),transitionend:Lm("Transition","TransitionEnd")},l1={},r6={};l&&(r6=document.createElement("div").style,"AnimationEvent"in window||(delete Du.animationend.animation,delete Du.animationiteration.animation,delete Du.animationstart.animation),"TransitionEvent"in window||delete Du.transitionend.transition);function Nm(a){if(l1[a])return l1[a];if(!Du[a])return a;var c=Du[a],p;for(p in c)if(c.hasOwnProperty(p)&&p in r6)return l1[a]=c[p];return a}var s6=Nm("animationend"),i6=Nm("animationiteration"),o6=Nm("animationstart"),a6=Nm("transitionend"),l6=new Map,c6="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 Qa(a,c){l6.set(a,c),i(c,[a])}for(var c1=0;c1<c6.length;c1++){var u1=c6[c1],zj=u1.toLowerCase(),Vj=u1[0].toUpperCase()+u1.slice(1);Qa(zj,"on"+Vj)}Qa(s6,"onAnimationEnd"),Qa(i6,"onAnimationIteration"),Qa(o6,"onAnimationStart"),Qa("dblclick","onDoubleClick"),Qa("focusin","onFocus"),Qa("focusout","onBlur"),Qa(a6,"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 Qf="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(" "),Hj=new Set("cancel close invalid load scroll toggle".split(" ").concat(Qf));function u6(a,c,p){var w=a.type||"unknown-event";a.currentTarget=p,yo(w,c,void 0,a),a.currentTarget=null}function d6(a,c){c=(c&4)!==0;for(var p=0;p<a.length;p++){var w=a[p],k=w.event;w=w.listeners;e:{var P=void 0;if(c)for(var M=w.length-1;0<=M;M--){var U=w[M],G=U.instance,se=U.currentTarget;if(U=U.listener,G!==P&&k.isPropagationStopped())break e;u6(k,U,se),P=G}else for(M=0;M<w.length;M++){if(U=w[M],G=U.instance,se=U.currentTarget,U=U.listener,G!==P&&k.isPropagationStopped())break e;u6(k,U,se),P=G}}}if(Vt)throw a=Ci,Vt=!1,Ci=null,a}function Cn(a,c){var p=c[y1];p===void 0&&(p=c[y1]=new Set);var w=a+"__bubble";p.has(w)||(f6(c,a,2,!1),p.add(w))}function d1(a,c,p){var w=0;c&&(w|=4),f6(p,a,w,c)}var Dm="_reactListening"+Math.random().toString(36).slice(2);function Jf(a){if(!a[Dm]){a[Dm]=!0,r.forEach(function(p){p!=="selectionchange"&&(Hj.has(p)||d1(p,!1,a),d1(p,!0,a))});var c=a.nodeType===9?a:a.ownerDocument;c===null||c[Dm]||(c[Dm]=!0,d1("selectionchange",!1,c))}}function f6(a,c,p,w){switch(NE(c)){case 1:var k=nj;break;case 4:k=rj;break;default:k=Gy}p=k.bind(null,c,p,a),k=void 0,!Bt||c!=="touchstart"&&c!=="touchmove"&&c!=="wheel"||(k=!0),w?k!==void 0?a.addEventListener(c,p,{capture:!0,passive:k}):a.addEventListener(c,p,!0):k!==void 0?a.addEventListener(c,p,{passive:k}):a.addEventListener(c,p,!1)}function f1(a,c,p,w,k){var P=w;if((c&1)===0&&(c&2)===0&&w!==null)e:for(;;){if(w===null)return;var M=w.tag;if(M===3||M===4){var U=w.stateNode.containerInfo;if(U===k||U.nodeType===8&&U.parentNode===k)break;if(M===4)for(M=w.return;M!==null;){var G=M.tag;if((G===3||G===4)&&(G=M.stateNode.containerInfo,G===k||G.nodeType===8&&G.parentNode===k))return;M=M.return}for(;U!==null;){if(M=mc(U),M===null)return;if(G=M.tag,G===5||G===6){w=P=M;continue e}U=U.parentNode}}w=w.return}pn(function(){var se=P,_e=vo(p),we=[];e:{var ye=l6.get(a);if(ye!==void 0){var Fe=Xy,Ke=a;switch(a){case"keypress":if(Am(p)===0)break e;case"keydown":case"keyup":Fe=yj;break;case"focusin":Ke="focus",Fe=e1;break;case"focusout":Ke="blur",Fe=e1;break;case"beforeblur":case"afterblur":Fe=e1;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":Fe=FE;break;case"drag":case"dragend":case"dragenter":case"dragexit":case"dragleave":case"dragover":case"dragstart":case"drop":Fe=oj;break;case"touchcancel":case"touchend":case"touchmove":case"touchstart":Fe=bj;break;case s6:case i6:case o6:Fe=cj;break;case a6:Fe=Sj;break;case"scroll":Fe=sj;break;case"wheel":Fe=Ej;break;case"copy":case"cut":case"paste":Fe=dj;break;case"gotpointercapture":case"lostpointercapture":case"pointercancel":case"pointerdown":case"pointermove":case"pointerout":case"pointerover":case"pointerup":Fe=zE}var qe=(c&4)!==0,sr=!qe&&a==="scroll",ee=qe?ye!==null?ye+"Capture":null:ye;qe=[];for(var Q=se,ne;Q!==null;){ne=Q;var Ce=ne.stateNode;if(ne.tag===5&&Ce!==null&&(ne=Ce,ee!==null&&(Ce=Sn(Q,ee),Ce!=null&&qe.push(eh(Q,Ce,ne)))),sr)break;Q=Q.return}0<qe.length&&(ye=new Fe(ye,Ke,null,p,_e),we.push({event:ye,listeners:qe}))}}if((c&7)===0){e:{if(ye=a==="mouseover"||a==="pointerover",Fe=a==="mouseout"||a==="pointerout",ye&&p!==ar&&(Ke=p.relatedTarget||p.fromElement)&&(mc(Ke)||Ke[ia]))break e;if((Fe||ye)&&(ye=_e.window===_e?_e:(ye=_e.ownerDocument)?ye.defaultView||ye.parentWindow:window,Fe?(Ke=p.relatedTarget||p.toElement,Fe=se,Ke=Ke?mc(Ke):null,Ke!==null&&(sr=Tr(Ke),Ke!==sr||Ke.tag!==5&&Ke.tag!==6)&&(Ke=null)):(Fe=null,Ke=se),Fe!==Ke)){if(qe=FE,Ce="onMouseLeave",ee="onMouseEnter",Q="mouse",(a==="pointerout"||a==="pointerover")&&(qe=zE,Ce="onPointerLeave",ee="onPointerEnter",Q="pointer"),sr=Fe==null?ye:ju(Fe),ne=Ke==null?ye:ju(Ke),ye=new qe(Ce,Q+"leave",Fe,p,_e),ye.target=sr,ye.relatedTarget=ne,Ce=null,mc(_e)===se&&(qe=new qe(ee,Q+"enter",Ke,p,_e),qe.target=ne,qe.relatedTarget=sr,Ce=qe),sr=Ce,Fe&&Ke)t:{for(qe=Fe,ee=Ke,Q=0,ne=qe;ne;ne=$u(ne))Q++;for(ne=0,Ce=ee;Ce;Ce=$u(Ce))ne++;for(;0<Q-ne;)qe=$u(qe),Q--;for(;0<ne-Q;)ee=$u(ee),ne--;for(;Q--;){if(qe===ee||ee!==null&&qe===ee.alternate)break t;qe=$u(qe),ee=$u(ee)}qe=null}else qe=null;Fe!==null&&h6(we,ye,Fe,qe,!1),Ke!==null&&sr!==null&&h6(we,sr,Ke,qe,!0)}}e:{if(ye=se?ju(se):window,Fe=ye.nodeName&&ye.nodeName.toLowerCase(),Fe==="select"||Fe==="input"&&ye.type==="file")var Je=Oj;else if(WE(ye))if(GE)Je=Dj;else{Je=Lj;var at=Mj}else(Fe=ye.nodeName)&&Fe.toLowerCase()==="input"&&(ye.type==="checkbox"||ye.type==="radio")&&(Je=Nj);if(Je&&(Je=Je(a,se))){KE(we,Je,p,_e);break e}at&&at(a,ye,se),a==="focusout"&&(at=ye._wrapperState)&&at.controlled&&ye.type==="number"&&Qt(ye,"number",ye.value)}switch(at=se?ju(se):window,a){case"focusin":(WE(at)||at.contentEditable==="true")&&(Nu=at,o1=se,Xf=null);break;case"focusout":Xf=o1=Nu=null;break;case"mousedown":a1=!0;break;case"contextmenu":case"mouseup":case"dragend":a1=!1,n6(we,p,_e);break;case"selectionchange":if(jj)break;case"keydown":case"keyup":n6(we,p,_e)}var lt;if(n1)e:{switch(a){case"compositionstart":var ht="onCompositionStart";break e;case"compositionend":ht="onCompositionEnd";break e;case"compositionupdate":ht="onCompositionUpdate";break e}ht=void 0}else Lu?ZE(a,p)&&(ht="onCompositionEnd"):a==="keydown"&&p.keyCode===229&&(ht="onCompositionStart");ht&&(VE&&p.locale!=="ko"&&(Lu||ht!=="onCompositionStart"?ht==="onCompositionEnd"&&Lu&&(lt=DE()):(Xa=_e,Yy="value"in Xa?Xa.value:Xa.textContent,Lu=!0)),at=$m(se,ht),0<at.length&&(ht=new jE(ht,a,null,p,_e),we.push({event:ht,listeners:at}),lt?ht.data=lt:(lt=BE(p),lt!==null&&(ht.data=lt)))),(lt=Pj?Tj(a,p):Rj(a,p))&&(se=$m(se,"onBeforeInput"),0<se.length&&(_e=new jE("onBeforeInput","beforeinput",null,p,_e),we.push({event:_e,listeners:se}),_e.data=lt))}d6(we,c)})}function eh(a,c,p){return{instance:a,listener:c,currentTarget:p}}function $m(a,c){for(var p=c+"Capture",w=[];a!==null;){var k=a,P=k.stateNode;k.tag===5&&P!==null&&(k=P,P=Sn(a,p),P!=null&&w.unshift(eh(a,P,k)),P=Sn(a,c),P!=null&&w.push(eh(a,P,k))),a=a.return}return w}function $u(a){if(a===null)return null;do a=a.return;while(a&&a.tag!==5);return a||null}function h6(a,c,p,w,k){for(var P=c._reactName,M=[];p!==null&&p!==w;){var U=p,G=U.alternate,se=U.stateNode;if(G!==null&&G===w)break;U.tag===5&&se!==null&&(U=se,k?(G=Sn(p,P),G!=null&&M.unshift(eh(p,G,U))):k||(G=Sn(p,P),G!=null&&M.push(eh(p,G,U)))),p=p.return}M.length!==0&&a.push({event:c,listeners:M})}var Uj=/\r\n?/g,Zj=/\u0000|\uFFFD/g;function p6(a){return(typeof a=="string"?a:""+a).replace(Uj,`
106
- `).replace(Zj,"")}function Fm(a,c,p){if(c=p6(c),p6(a)!==c&&p)throw Error(n(425))}function jm(){}var h1=null,p1=null;function m1(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 g1=typeof setTimeout=="function"?setTimeout:void 0,Bj=typeof clearTimeout=="function"?clearTimeout:void 0,m6=typeof Promise=="function"?Promise:void 0,Wj=typeof queueMicrotask=="function"?queueMicrotask:typeof m6<"u"?function(a){return m6.resolve(null).then(a).catch(Kj)}:g1;function Kj(a){setTimeout(function(){throw a})}function v1(a,c){var p=c,w=0;do{var k=p.nextSibling;if(a.removeChild(p),k&&k.nodeType===8)if(p=k.data,p==="/$"){if(w===0){a.removeChild(k),ko(c);return}w--}else p!=="$"&&p!=="$?"&&p!=="$!"||w++;p=k}while(p);ko(c)}function Ja(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 g6(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 Fu=Math.random().toString(36).slice(2),Eo="__reactFiber$"+Fu,th="__reactProps$"+Fu,ia="__reactContainer$"+Fu,y1="__reactEvents$"+Fu,Gj="__reactListeners$"+Fu,qj="__reactHandles$"+Fu;function mc(a){var c=a[Eo];if(c)return c;for(var p=a.parentNode;p;){if(c=p[ia]||p[Eo]){if(p=c.alternate,c.child!==null||p!==null&&p.child!==null)for(a=g6(a);a!==null;){if(p=a[Eo])return p;a=g6(a)}return c}a=p,p=a.parentNode}return null}function nh(a){return a=a[Eo]||a[ia],!a||a.tag!==5&&a.tag!==6&&a.tag!==13&&a.tag!==3?null:a}function ju(a){if(a.tag===5||a.tag===6)return a.stateNode;throw Error(n(33))}function zm(a){return a[th]||null}var _1=[],zu=-1;function el(a){return{current:a}}function Pn(a){0>zu||(a.current=_1[zu],_1[zu]=null,zu--)}function kn(a,c){zu++,_1[zu]=a.current,a.current=c}var tl={},ns=el(tl),Os=el(!1),gc=tl;function Vu(a,c){var p=a.type.contextTypes;if(!p)return tl;var w=a.stateNode;if(w&&w.__reactInternalMemoizedUnmaskedChildContext===c)return w.__reactInternalMemoizedMaskedChildContext;var k={},P;for(P in p)k[P]=c[P];return w&&(a=a.stateNode,a.__reactInternalMemoizedUnmaskedChildContext=c,a.__reactInternalMemoizedMaskedChildContext=k),k}function Ms(a){return a=a.childContextTypes,a!=null}function Vm(){Pn(Os),Pn(ns)}function v6(a,c,p){if(ns.current!==tl)throw Error(n(168));kn(ns,c),kn(Os,p)}function y6(a,c,p){var w=a.stateNode;if(c=c.childContextTypes,typeof w.getChildContext!="function")return p;w=w.getChildContext();for(var k in w)if(!(k in c))throw Error(n(108,ke(a)||"Unknown",k));return q({},p,w)}function Hm(a){return a=(a=a.stateNode)&&a.__reactInternalMemoizedMergedChildContext||tl,gc=ns.current,kn(ns,a),kn(Os,Os.current),!0}function _6(a,c,p){var w=a.stateNode;if(!w)throw Error(n(169));p?(a=y6(a,c,gc),w.__reactInternalMemoizedMergedChildContext=a,Pn(Os),Pn(ns),kn(ns,a)):Pn(Os),kn(Os,p)}var oa=null,Um=!1,w1=!1;function w6(a){oa===null?oa=[a]:oa.push(a)}function Yj(a){Um=!0,w6(a)}function nl(){if(!w1&&oa!==null){w1=!0;var a=0,c=it;try{var p=oa;for(it=1;a<p.length;a++){var w=p[a];do w=w(!0);while(w!==null)}oa=null,Um=!1}catch(k){throw oa!==null&&(oa=oa.slice(a+1)),ri(si,nl),k}finally{it=c,w1=!1}}return null}var Hu=[],Uu=0,Zm=null,Bm=0,Ri=[],Ai=0,vc=null,aa=1,la="";function yc(a,c){Hu[Uu++]=Bm,Hu[Uu++]=Zm,Zm=a,Bm=c}function b6(a,c,p){Ri[Ai++]=aa,Ri[Ai++]=la,Ri[Ai++]=vc,vc=a;var w=aa;a=la;var k=32-gs(w)-1;w&=~(1<<k),p+=1;var P=32-gs(c)+k;if(30<P){var M=k-k%5;P=(w&(1<<M)-1).toString(32),w>>=M,k-=M,aa=1<<32-gs(c)+k|p<<k|w,la=P+a}else aa=1<<P|p<<k|w,la=a}function b1(a){a.return!==null&&(yc(a,1),b6(a,1,0))}function x1(a){for(;a===Zm;)Zm=Hu[--Uu],Hu[Uu]=null,Bm=Hu[--Uu],Hu[Uu]=null;for(;a===vc;)vc=Ri[--Ai],Ri[Ai]=null,la=Ri[--Ai],Ri[Ai]=null,aa=Ri[--Ai],Ri[Ai]=null}var oi=null,ai=null,Mn=!1,Xi=null;function x6(a,c){var p=Li(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 S6(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,oi=a,ai=Ja(c.firstChild),!0):!1;case 6:return c=a.pendingProps===""||c.nodeType!==3?null:c,c!==null?(a.stateNode=c,oi=a,ai=null,!0):!1;case 13:return c=c.nodeType!==8?null:c,c!==null?(p=vc!==null?{id:aa,overflow:la}:null,a.memoizedState={dehydrated:c,treeContext:p,retryLane:1073741824},p=Li(18,null,null,0),p.stateNode=c,p.return=a,a.child=p,oi=a,ai=null,!0):!1;default:return!1}}function S1(a){return(a.mode&1)!==0&&(a.flags&128)===0}function k1(a){if(Mn){var c=ai;if(c){var p=c;if(!S6(a,c)){if(S1(a))throw Error(n(418));c=Ja(p.nextSibling);var w=oi;c&&S6(a,c)?x6(w,p):(a.flags=a.flags&-4097|2,Mn=!1,oi=a)}}else{if(S1(a))throw Error(n(418));a.flags=a.flags&-4097|2,Mn=!1,oi=a}}}function k6(a){for(a=a.return;a!==null&&a.tag!==5&&a.tag!==3&&a.tag!==13;)a=a.return;oi=a}function Wm(a){if(a!==oi)return!1;if(!Mn)return k6(a),Mn=!0,!1;var c;if((c=a.tag!==3)&&!(c=a.tag!==5)&&(c=a.type,c=c!=="head"&&c!=="body"&&!m1(a.type,a.memoizedProps)),c&&(c=ai)){if(S1(a))throw E6(),Error(n(418));for(;c;)x6(a,c),c=Ja(c.nextSibling)}if(k6(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){ai=Ja(a.nextSibling);break e}c--}else p!=="$"&&p!=="$!"&&p!=="$?"||c++}a=a.nextSibling}ai=null}}else ai=oi?Ja(a.stateNode.nextSibling):null;return!0}function E6(){for(var a=ai;a;)a=Ja(a.nextSibling)}function Zu(){ai=oi=null,Mn=!1}function E1(a){Xi===null?Xi=[a]:Xi.push(a)}var Xj=C.ReactCurrentBatchConfig;function rh(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 w=p.stateNode}if(!w)throw Error(n(147,a));var k=w,P=""+a;return c!==null&&c.ref!==null&&typeof c.ref=="function"&&c.ref._stringRef===P?c.ref:(c=function(M){var U=k.refs;M===null?delete U[P]:U[P]=M},c._stringRef=P,c)}if(typeof a!="string")throw Error(n(284));if(!p._owner)throw Error(n(290,a))}return a}function Km(a,c){throw a=Object.prototype.toString.call(c),Error(n(31,a==="[object Object]"?"object with keys {"+Object.keys(c).join(", ")+"}":a))}function C6(a){var c=a._init;return c(a._payload)}function P6(a){function c(ee,Q){if(a){var ne=ee.deletions;ne===null?(ee.deletions=[Q],ee.flags|=16):ne.push(Q)}}function p(ee,Q){if(!a)return null;for(;Q!==null;)c(ee,Q),Q=Q.sibling;return null}function w(ee,Q){for(ee=new Map;Q!==null;)Q.key!==null?ee.set(Q.key,Q):ee.set(Q.index,Q),Q=Q.sibling;return ee}function k(ee,Q){return ee=ul(ee,Q),ee.index=0,ee.sibling=null,ee}function P(ee,Q,ne){return ee.index=ne,a?(ne=ee.alternate,ne!==null?(ne=ne.index,ne<Q?(ee.flags|=2,Q):ne):(ee.flags|=2,Q)):(ee.flags|=1048576,Q)}function M(ee){return a&&ee.alternate===null&&(ee.flags|=2),ee}function U(ee,Q,ne,Ce){return Q===null||Q.tag!==6?(Q=g_(ne,ee.mode,Ce),Q.return=ee,Q):(Q=k(Q,ne),Q.return=ee,Q)}function G(ee,Q,ne,Ce){var Je=ne.type;return Je===I?_e(ee,Q,ne.props.children,Ce,ne.key):Q!==null&&(Q.elementType===Je||typeof Je=="object"&&Je!==null&&Je.$$typeof===K&&C6(Je)===Q.type)?(Ce=k(Q,ne.props),Ce.ref=rh(ee,Q,ne),Ce.return=ee,Ce):(Ce=v0(ne.type,ne.key,ne.props,null,ee.mode,Ce),Ce.ref=rh(ee,Q,ne),Ce.return=ee,Ce)}function se(ee,Q,ne,Ce){return Q===null||Q.tag!==4||Q.stateNode.containerInfo!==ne.containerInfo||Q.stateNode.implementation!==ne.implementation?(Q=v_(ne,ee.mode,Ce),Q.return=ee,Q):(Q=k(Q,ne.children||[]),Q.return=ee,Q)}function _e(ee,Q,ne,Ce,Je){return Q===null||Q.tag!==7?(Q=Cc(ne,ee.mode,Ce,Je),Q.return=ee,Q):(Q=k(Q,ne),Q.return=ee,Q)}function we(ee,Q,ne){if(typeof Q=="string"&&Q!==""||typeof Q=="number")return Q=g_(""+Q,ee.mode,ne),Q.return=ee,Q;if(typeof Q=="object"&&Q!==null){switch(Q.$$typeof){case R:return ne=v0(Q.type,Q.key,Q.props,null,ee.mode,ne),ne.ref=rh(ee,null,Q),ne.return=ee,ne;case O:return Q=v_(Q,ee.mode,ne),Q.return=ee,Q;case K:var Ce=Q._init;return we(ee,Ce(Q._payload),ne)}if(Me(Q)||J(Q))return Q=Cc(Q,ee.mode,ne,null),Q.return=ee,Q;Km(ee,Q)}return null}function ye(ee,Q,ne,Ce){var Je=Q!==null?Q.key:null;if(typeof ne=="string"&&ne!==""||typeof ne=="number")return Je!==null?null:U(ee,Q,""+ne,Ce);if(typeof ne=="object"&&ne!==null){switch(ne.$$typeof){case R:return ne.key===Je?G(ee,Q,ne,Ce):null;case O:return ne.key===Je?se(ee,Q,ne,Ce):null;case K:return Je=ne._init,ye(ee,Q,Je(ne._payload),Ce)}if(Me(ne)||J(ne))return Je!==null?null:_e(ee,Q,ne,Ce,null);Km(ee,ne)}return null}function Fe(ee,Q,ne,Ce,Je){if(typeof Ce=="string"&&Ce!==""||typeof Ce=="number")return ee=ee.get(ne)||null,U(Q,ee,""+Ce,Je);if(typeof Ce=="object"&&Ce!==null){switch(Ce.$$typeof){case R:return ee=ee.get(Ce.key===null?ne:Ce.key)||null,G(Q,ee,Ce,Je);case O:return ee=ee.get(Ce.key===null?ne:Ce.key)||null,se(Q,ee,Ce,Je);case K:var at=Ce._init;return Fe(ee,Q,ne,at(Ce._payload),Je)}if(Me(Ce)||J(Ce))return ee=ee.get(ne)||null,_e(Q,ee,Ce,Je,null);Km(Q,Ce)}return null}function Ke(ee,Q,ne,Ce){for(var Je=null,at=null,lt=Q,ht=Q=0,Or=null;lt!==null&&ht<ne.length;ht++){lt.index>ht?(Or=lt,lt=null):Or=lt.sibling;var Yt=ye(ee,lt,ne[ht],Ce);if(Yt===null){lt===null&&(lt=Or);break}a&&lt&&Yt.alternate===null&&c(ee,lt),Q=P(Yt,Q,ht),at===null?Je=Yt:at.sibling=Yt,at=Yt,lt=Or}if(ht===ne.length)return p(ee,lt),Mn&&yc(ee,ht),Je;if(lt===null){for(;ht<ne.length;ht++)lt=we(ee,ne[ht],Ce),lt!==null&&(Q=P(lt,Q,ht),at===null?Je=lt:at.sibling=lt,at=lt);return Mn&&yc(ee,ht),Je}for(lt=w(ee,lt);ht<ne.length;ht++)Or=Fe(lt,ee,ht,ne[ht],Ce),Or!==null&&(a&&Or.alternate!==null&&lt.delete(Or.key===null?ht:Or.key),Q=P(Or,Q,ht),at===null?Je=Or:at.sibling=Or,at=Or);return a&&lt.forEach(function(dl){return c(ee,dl)}),Mn&&yc(ee,ht),Je}function qe(ee,Q,ne,Ce){var Je=J(ne);if(typeof Je!="function")throw Error(n(150));if(ne=Je.call(ne),ne==null)throw Error(n(151));for(var at=Je=null,lt=Q,ht=Q=0,Or=null,Yt=ne.next();lt!==null&&!Yt.done;ht++,Yt=ne.next()){lt.index>ht?(Or=lt,lt=null):Or=lt.sibling;var dl=ye(ee,lt,Yt.value,Ce);if(dl===null){lt===null&&(lt=Or);break}a&&lt&&dl.alternate===null&&c(ee,lt),Q=P(dl,Q,ht),at===null?Je=dl:at.sibling=dl,at=dl,lt=Or}if(Yt.done)return p(ee,lt),Mn&&yc(ee,ht),Je;if(lt===null){for(;!Yt.done;ht++,Yt=ne.next())Yt=we(ee,Yt.value,Ce),Yt!==null&&(Q=P(Yt,Q,ht),at===null?Je=Yt:at.sibling=Yt,at=Yt);return Mn&&yc(ee,ht),Je}for(lt=w(ee,lt);!Yt.done;ht++,Yt=ne.next())Yt=Fe(lt,ee,ht,Yt.value,Ce),Yt!==null&&(a&&Yt.alternate!==null&&lt.delete(Yt.key===null?ht:Yt.key),Q=P(Yt,Q,ht),at===null?Je=Yt:at.sibling=Yt,at=Yt);return a&&lt.forEach(function(A7){return c(ee,A7)}),Mn&&yc(ee,ht),Je}function sr(ee,Q,ne,Ce){if(typeof ne=="object"&&ne!==null&&ne.type===I&&ne.key===null&&(ne=ne.props.children),typeof ne=="object"&&ne!==null){switch(ne.$$typeof){case R:e:{for(var Je=ne.key,at=Q;at!==null;){if(at.key===Je){if(Je=ne.type,Je===I){if(at.tag===7){p(ee,at.sibling),Q=k(at,ne.props.children),Q.return=ee,ee=Q;break e}}else if(at.elementType===Je||typeof Je=="object"&&Je!==null&&Je.$$typeof===K&&C6(Je)===at.type){p(ee,at.sibling),Q=k(at,ne.props),Q.ref=rh(ee,at,ne),Q.return=ee,ee=Q;break e}p(ee,at);break}else c(ee,at);at=at.sibling}ne.type===I?(Q=Cc(ne.props.children,ee.mode,Ce,ne.key),Q.return=ee,ee=Q):(Ce=v0(ne.type,ne.key,ne.props,null,ee.mode,Ce),Ce.ref=rh(ee,Q,ne),Ce.return=ee,ee=Ce)}return M(ee);case O:e:{for(at=ne.key;Q!==null;){if(Q.key===at)if(Q.tag===4&&Q.stateNode.containerInfo===ne.containerInfo&&Q.stateNode.implementation===ne.implementation){p(ee,Q.sibling),Q=k(Q,ne.children||[]),Q.return=ee,ee=Q;break e}else{p(ee,Q);break}else c(ee,Q);Q=Q.sibling}Q=v_(ne,ee.mode,Ce),Q.return=ee,ee=Q}return M(ee);case K:return at=ne._init,sr(ee,Q,at(ne._payload),Ce)}if(Me(ne))return Ke(ee,Q,ne,Ce);if(J(ne))return qe(ee,Q,ne,Ce);Km(ee,ne)}return typeof ne=="string"&&ne!==""||typeof ne=="number"?(ne=""+ne,Q!==null&&Q.tag===6?(p(ee,Q.sibling),Q=k(Q,ne),Q.return=ee,ee=Q):(p(ee,Q),Q=g_(ne,ee.mode,Ce),Q.return=ee,ee=Q),M(ee)):p(ee,Q)}return sr}var Bu=P6(!0),T6=P6(!1),Gm=el(null),qm=null,Wu=null,C1=null;function P1(){C1=Wu=qm=null}function T1(a){var c=Gm.current;Pn(Gm),a._currentValue=c}function R1(a,c,p){for(;a!==null;){var w=a.alternate;if((a.childLanes&c)!==c?(a.childLanes|=c,w!==null&&(w.childLanes|=c)):w!==null&&(w.childLanes&c)!==c&&(w.childLanes|=c),a===p)break;a=a.return}}function Ku(a,c){qm=a,C1=Wu=null,a=a.dependencies,a!==null&&a.firstContext!==null&&((a.lanes&c)!==0&&(Ls=!0),a.firstContext=null)}function Ii(a){var c=a._currentValue;if(C1!==a)if(a={context:a,memoizedValue:c,next:null},Wu===null){if(qm===null)throw Error(n(308));Wu=a,qm.dependencies={lanes:0,firstContext:a}}else Wu=Wu.next=a;return c}var _c=null;function A1(a){_c===null?_c=[a]:_c.push(a)}function R6(a,c,p,w){var k=c.interleaved;return k===null?(p.next=p,A1(c)):(p.next=k.next,k.next=p),c.interleaved=p,ca(a,w)}function ca(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 rl=!1;function I1(a){a.updateQueue={baseState:a.memoizedState,firstBaseUpdate:null,lastBaseUpdate:null,shared:{pending:null,interleaved:null,lanes:0},effects:null}}function A6(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 ua(a,c){return{eventTime:a,lane:c,tag:0,payload:null,callback:null,next:null}}function sl(a,c,p){var w=a.updateQueue;if(w===null)return null;if(w=w.shared,(Wt&2)!==0){var k=w.pending;return k===null?c.next=c:(c.next=k.next,k.next=c),w.pending=c,ca(a,p)}return k=w.interleaved,k===null?(c.next=c,A1(w)):(c.next=k.next,k.next=c),w.interleaved=c,ca(a,p)}function Ym(a,c,p){if(c=c.updateQueue,c!==null&&(c=c.shared,(p&4194240)!==0)){var w=c.lanes;w&=a.pendingLanes,p|=w,c.lanes=p,On(a,p)}}function I6(a,c){var p=a.updateQueue,w=a.alternate;if(w!==null&&(w=w.updateQueue,p===w)){var k=null,P=null;if(p=p.firstBaseUpdate,p!==null){do{var M={eventTime:p.eventTime,lane:p.lane,tag:p.tag,payload:p.payload,callback:p.callback,next:null};P===null?k=P=M:P=P.next=M,p=p.next}while(p!==null);P===null?k=P=c:P=P.next=c}else k=P=c;p={baseState:w.baseState,firstBaseUpdate:k,lastBaseUpdate:P,shared:w.shared,effects:w.effects},a.updateQueue=p;return}a=p.lastBaseUpdate,a===null?p.firstBaseUpdate=c:a.next=c,p.lastBaseUpdate=c}function Xm(a,c,p,w){var k=a.updateQueue;rl=!1;var P=k.firstBaseUpdate,M=k.lastBaseUpdate,U=k.shared.pending;if(U!==null){k.shared.pending=null;var G=U,se=G.next;G.next=null,M===null?P=se:M.next=se,M=G;var _e=a.alternate;_e!==null&&(_e=_e.updateQueue,U=_e.lastBaseUpdate,U!==M&&(U===null?_e.firstBaseUpdate=se:U.next=se,_e.lastBaseUpdate=G))}if(P!==null){var we=k.baseState;M=0,_e=se=G=null,U=P;do{var ye=U.lane,Fe=U.eventTime;if((w&ye)===ye){_e!==null&&(_e=_e.next={eventTime:Fe,lane:0,tag:U.tag,payload:U.payload,callback:U.callback,next:null});e:{var Ke=a,qe=U;switch(ye=c,Fe=p,qe.tag){case 1:if(Ke=qe.payload,typeof Ke=="function"){we=Ke.call(Fe,we,ye);break e}we=Ke;break e;case 3:Ke.flags=Ke.flags&-65537|128;case 0:if(Ke=qe.payload,ye=typeof Ke=="function"?Ke.call(Fe,we,ye):Ke,ye==null)break e;we=q({},we,ye);break e;case 2:rl=!0}}U.callback!==null&&U.lane!==0&&(a.flags|=64,ye=k.effects,ye===null?k.effects=[U]:ye.push(U))}else Fe={eventTime:Fe,lane:ye,tag:U.tag,payload:U.payload,callback:U.callback,next:null},_e===null?(se=_e=Fe,G=we):_e=_e.next=Fe,M|=ye;if(U=U.next,U===null){if(U=k.shared.pending,U===null)break;ye=U,U=ye.next,ye.next=null,k.lastBaseUpdate=ye,k.shared.pending=null}}while(!0);if(_e===null&&(G=we),k.baseState=G,k.firstBaseUpdate=se,k.lastBaseUpdate=_e,c=k.shared.interleaved,c!==null){k=c;do M|=k.lane,k=k.next;while(k!==c)}else P===null&&(k.shared.lanes=0);xc|=M,a.lanes=M,a.memoizedState=we}}function O6(a,c,p){if(a=c.effects,c.effects=null,a!==null)for(c=0;c<a.length;c++){var w=a[c],k=w.callback;if(k!==null){if(w.callback=null,w=p,typeof k!="function")throw Error(n(191,k));k.call(w)}}}var sh={},Co=el(sh),ih=el(sh),oh=el(sh);function wc(a){if(a===sh)throw Error(n(174));return a}function O1(a,c){switch(kn(oh,c),kn(ih,a),kn(Co,sh),a=c.nodeType,a){case 9:case 11:c=(c=c.documentElement)?c.namespaceURI:pt(null,"");break;default:a=a===8?c.parentNode:c,c=a.namespaceURI||null,a=a.tagName,c=pt(c,a)}Pn(Co),kn(Co,c)}function Gu(){Pn(Co),Pn(ih),Pn(oh)}function M6(a){wc(oh.current);var c=wc(Co.current),p=pt(c,a.type);c!==p&&(kn(ih,a),kn(Co,p))}function M1(a){ih.current===a&&(Pn(Co),Pn(ih))}var jn=el(0);function Qm(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 L1=[];function N1(){for(var a=0;a<L1.length;a++)L1[a]._workInProgressVersionPrimary=null;L1.length=0}var Jm=C.ReactCurrentDispatcher,D1=C.ReactCurrentBatchConfig,bc=0,zn=null,wr=null,Ar=null,e0=!1,ah=!1,lh=0,Qj=0;function rs(){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(!Yi(a[p],c[p]))return!1;return!0}function F1(a,c,p,w,k,P){if(bc=P,zn=c,c.memoizedState=null,c.updateQueue=null,c.lanes=0,Jm.current=a===null||a.memoizedState===null?n7:r7,a=p(w,k),ah){P=0;do{if(ah=!1,lh=0,25<=P)throw Error(n(301));P+=1,Ar=wr=null,c.updateQueue=null,Jm.current=s7,a=p(w,k)}while(ah)}if(Jm.current=r0,c=wr!==null&&wr.next!==null,bc=0,Ar=wr=zn=null,e0=!1,c)throw Error(n(300));return a}function j1(){var a=lh!==0;return lh=0,a}function Po(){var a={memoizedState:null,baseState:null,baseQueue:null,queue:null,next:null};return Ar===null?zn.memoizedState=Ar=a:Ar=Ar.next=a,Ar}function Oi(){if(wr===null){var a=zn.alternate;a=a!==null?a.memoizedState:null}else a=wr.next;var c=Ar===null?zn.memoizedState:Ar.next;if(c!==null)Ar=c,wr=a;else{if(a===null)throw Error(n(310));wr=a,a={memoizedState:wr.memoizedState,baseState:wr.baseState,baseQueue:wr.baseQueue,queue:wr.queue,next:null},Ar===null?zn.memoizedState=Ar=a:Ar=Ar.next=a}return Ar}function ch(a,c){return typeof c=="function"?c(a):c}function z1(a){var c=Oi(),p=c.queue;if(p===null)throw Error(n(311));p.lastRenderedReducer=a;var w=wr,k=w.baseQueue,P=p.pending;if(P!==null){if(k!==null){var M=k.next;k.next=P.next,P.next=M}w.baseQueue=k=P,p.pending=null}if(k!==null){P=k.next,w=w.baseState;var U=M=null,G=null,se=P;do{var _e=se.lane;if((bc&_e)===_e)G!==null&&(G=G.next={lane:0,action:se.action,hasEagerState:se.hasEagerState,eagerState:se.eagerState,next:null}),w=se.hasEagerState?se.eagerState:a(w,se.action);else{var we={lane:_e,action:se.action,hasEagerState:se.hasEagerState,eagerState:se.eagerState,next:null};G===null?(U=G=we,M=w):G=G.next=we,zn.lanes|=_e,xc|=_e}se=se.next}while(se!==null&&se!==P);G===null?M=w:G.next=U,Yi(w,c.memoizedState)||(Ls=!0),c.memoizedState=w,c.baseState=M,c.baseQueue=G,p.lastRenderedState=w}if(a=p.interleaved,a!==null){k=a;do P=k.lane,zn.lanes|=P,xc|=P,k=k.next;while(k!==a)}else k===null&&(p.lanes=0);return[c.memoizedState,p.dispatch]}function V1(a){var c=Oi(),p=c.queue;if(p===null)throw Error(n(311));p.lastRenderedReducer=a;var w=p.dispatch,k=p.pending,P=c.memoizedState;if(k!==null){p.pending=null;var M=k=k.next;do P=a(P,M.action),M=M.next;while(M!==k);Yi(P,c.memoizedState)||(Ls=!0),c.memoizedState=P,c.baseQueue===null&&(c.baseState=P),p.lastRenderedState=P}return[P,w]}function L6(){}function N6(a,c){var p=zn,w=Oi(),k=c(),P=!Yi(w.memoizedState,k);if(P&&(w.memoizedState=k,Ls=!0),w=w.queue,H1(F6.bind(null,p,w,a),[a]),w.getSnapshot!==c||P||Ar!==null&&Ar.memoizedState.tag&1){if(p.flags|=2048,uh(9,$6.bind(null,p,w,k,c),void 0,null),Ir===null)throw Error(n(349));(bc&30)!==0||D6(p,c,k)}return k}function D6(a,c,p){a.flags|=16384,a={getSnapshot:c,value:p},c=zn.updateQueue,c===null?(c={lastEffect:null,stores:null},zn.updateQueue=c,c.stores=[a]):(p=c.stores,p===null?c.stores=[a]:p.push(a))}function $6(a,c,p,w){c.value=p,c.getSnapshot=w,j6(c)&&z6(a)}function F6(a,c,p){return p(function(){j6(c)&&z6(a)})}function j6(a){var c=a.getSnapshot;a=a.value;try{var p=c();return!Yi(a,p)}catch{return!0}}function z6(a){var c=ca(a,1);c!==null&&to(c,a,1,-1)}function V6(a){var c=Po();return typeof a=="function"&&(a=a()),c.memoizedState=c.baseState=a,a={pending:null,interleaved:null,lanes:0,dispatch:null,lastRenderedReducer:ch,lastRenderedState:a},c.queue=a,a=a.dispatch=t7.bind(null,zn,a),[c.memoizedState,a]}function uh(a,c,p,w){return a={tag:a,create:c,destroy:p,deps:w,next:null},c=zn.updateQueue,c===null?(c={lastEffect:null,stores:null},zn.updateQueue=c,c.lastEffect=a.next=a):(p=c.lastEffect,p===null?c.lastEffect=a.next=a:(w=p.next,p.next=a,a.next=w,c.lastEffect=a)),a}function H6(){return Oi().memoizedState}function t0(a,c,p,w){var k=Po();zn.flags|=a,k.memoizedState=uh(1|c,p,void 0,w===void 0?null:w)}function n0(a,c,p,w){var k=Oi();w=w===void 0?null:w;var P=void 0;if(wr!==null){var M=wr.memoizedState;if(P=M.destroy,w!==null&&$1(w,M.deps)){k.memoizedState=uh(c,p,P,w);return}}zn.flags|=a,k.memoizedState=uh(1|c,p,P,w)}function U6(a,c){return t0(8390656,8,a,c)}function H1(a,c){return n0(2048,8,a,c)}function Z6(a,c){return n0(4,2,a,c)}function B6(a,c){return n0(4,4,a,c)}function W6(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 K6(a,c,p){return p=p!=null?p.concat([a]):null,n0(4,4,W6.bind(null,c,a),p)}function U1(){}function G6(a,c){var p=Oi();c=c===void 0?null:c;var w=p.memoizedState;return w!==null&&c!==null&&$1(c,w[1])?w[0]:(p.memoizedState=[a,c],a)}function q6(a,c){var p=Oi();c=c===void 0?null:c;var w=p.memoizedState;return w!==null&&c!==null&&$1(c,w[1])?w[0]:(a=a(),p.memoizedState=[a,c],a)}function Y6(a,c,p){return(bc&21)===0?(a.baseState&&(a.baseState=!1,Ls=!0),a.memoizedState=p):(Yi(p,c)||(p=mt(),zn.lanes|=p,xc|=p,a.baseState=!0),c)}function Jj(a,c){var p=it;it=p!==0&&4>p?p:4,a(!0);var w=D1.transition;D1.transition={};try{a(!1),c()}finally{it=p,D1.transition=w}}function X6(){return Oi().memoizedState}function e7(a,c,p){var w=ll(a);if(p={lane:w,action:p,hasEagerState:!1,eagerState:null,next:null},Q6(a))J6(c,p);else if(p=R6(a,c,p,w),p!==null){var k=_s();to(p,a,w,k),eC(p,c,w)}}function t7(a,c,p){var w=ll(a),k={lane:w,action:p,hasEagerState:!1,eagerState:null,next:null};if(Q6(a))J6(c,k);else{var P=a.alternate;if(a.lanes===0&&(P===null||P.lanes===0)&&(P=c.lastRenderedReducer,P!==null))try{var M=c.lastRenderedState,U=P(M,p);if(k.hasEagerState=!0,k.eagerState=U,Yi(U,M)){var G=c.interleaved;G===null?(k.next=k,A1(c)):(k.next=G.next,G.next=k),c.interleaved=k;return}}catch{}finally{}p=R6(a,c,k,w),p!==null&&(k=_s(),to(p,a,w,k),eC(p,c,w))}}function Q6(a){var c=a.alternate;return a===zn||c!==null&&c===zn}function J6(a,c){ah=e0=!0;var p=a.pending;p===null?c.next=c:(c.next=p.next,p.next=c),a.pending=c}function eC(a,c,p){if((p&4194240)!==0){var w=c.lanes;w&=a.pendingLanes,p|=w,c.lanes=p,On(a,p)}}var r0={readContext:Ii,useCallback:rs,useContext:rs,useEffect:rs,useImperativeHandle:rs,useInsertionEffect:rs,useLayoutEffect:rs,useMemo:rs,useReducer:rs,useRef:rs,useState:rs,useDebugValue:rs,useDeferredValue:rs,useTransition:rs,useMutableSource:rs,useSyncExternalStore:rs,useId:rs,unstable_isNewReconciler:!1},n7={readContext:Ii,useCallback:function(a,c){return Po().memoizedState=[a,c===void 0?null:c],a},useContext:Ii,useEffect:U6,useImperativeHandle:function(a,c,p){return p=p!=null?p.concat([a]):null,t0(4194308,4,W6.bind(null,c,a),p)},useLayoutEffect:function(a,c){return t0(4194308,4,a,c)},useInsertionEffect:function(a,c){return t0(4,2,a,c)},useMemo:function(a,c){var p=Po();return c=c===void 0?null:c,a=a(),p.memoizedState=[a,c],a},useReducer:function(a,c,p){var w=Po();return c=p!==void 0?p(c):c,w.memoizedState=w.baseState=c,a={pending:null,interleaved:null,lanes:0,dispatch:null,lastRenderedReducer:a,lastRenderedState:c},w.queue=a,a=a.dispatch=e7.bind(null,zn,a),[w.memoizedState,a]},useRef:function(a){var c=Po();return a={current:a},c.memoizedState=a},useState:V6,useDebugValue:U1,useDeferredValue:function(a){return Po().memoizedState=a},useTransition:function(){var a=V6(!1),c=a[0];return a=Jj.bind(null,a[1]),Po().memoizedState=a,[c,a]},useMutableSource:function(){},useSyncExternalStore:function(a,c,p){var w=zn,k=Po();if(Mn){if(p===void 0)throw Error(n(407));p=p()}else{if(p=c(),Ir===null)throw Error(n(349));(bc&30)!==0||D6(w,c,p)}k.memoizedState=p;var P={value:p,getSnapshot:c};return k.queue=P,U6(F6.bind(null,w,P,a),[a]),w.flags|=2048,uh(9,$6.bind(null,w,P,p,c),void 0,null),p},useId:function(){var a=Po(),c=Ir.identifierPrefix;if(Mn){var p=la,w=aa;p=(w&~(1<<32-gs(w)-1)).toString(32)+p,c=":"+c+"R"+p,p=lh++,0<p&&(c+="H"+p.toString(32)),c+=":"}else p=Qj++,c=":"+c+"r"+p.toString(32)+":";return a.memoizedState=c},unstable_isNewReconciler:!1},r7={readContext:Ii,useCallback:G6,useContext:Ii,useEffect:H1,useImperativeHandle:K6,useInsertionEffect:Z6,useLayoutEffect:B6,useMemo:q6,useReducer:z1,useRef:H6,useState:function(){return z1(ch)},useDebugValue:U1,useDeferredValue:function(a){var c=Oi();return Y6(c,wr.memoizedState,a)},useTransition:function(){var a=z1(ch)[0],c=Oi().memoizedState;return[a,c]},useMutableSource:L6,useSyncExternalStore:N6,useId:X6,unstable_isNewReconciler:!1},s7={readContext:Ii,useCallback:G6,useContext:Ii,useEffect:H1,useImperativeHandle:K6,useInsertionEffect:Z6,useLayoutEffect:B6,useMemo:q6,useReducer:V1,useRef:H6,useState:function(){return V1(ch)},useDebugValue:U1,useDeferredValue:function(a){var c=Oi();return wr===null?c.memoizedState=a:Y6(c,wr.memoizedState,a)},useTransition:function(){var a=V1(ch)[0],c=Oi().memoizedState;return[a,c]},useMutableSource:L6,useSyncExternalStore:N6,useId:X6,unstable_isNewReconciler:!1};function Qi(a,c){if(a&&a.defaultProps){c=q({},c),a=a.defaultProps;for(var p in a)c[p]===void 0&&(c[p]=a[p]);return c}return c}function Z1(a,c,p,w){c=a.memoizedState,p=p(w,c),p=p==null?c:q({},c,p),a.memoizedState=p,a.lanes===0&&(a.updateQueue.baseState=p)}var s0={isMounted:function(a){return(a=a._reactInternals)?Tr(a)===a:!1},enqueueSetState:function(a,c,p){a=a._reactInternals;var w=_s(),k=ll(a),P=ua(w,k);P.payload=c,p!=null&&(P.callback=p),c=sl(a,P,k),c!==null&&(to(c,a,k,w),Ym(c,a,k))},enqueueReplaceState:function(a,c,p){a=a._reactInternals;var w=_s(),k=ll(a),P=ua(w,k);P.tag=1,P.payload=c,p!=null&&(P.callback=p),c=sl(a,P,k),c!==null&&(to(c,a,k,w),Ym(c,a,k))},enqueueForceUpdate:function(a,c){a=a._reactInternals;var p=_s(),w=ll(a),k=ua(p,w);k.tag=2,c!=null&&(k.callback=c),c=sl(a,k,w),c!==null&&(to(c,a,w,p),Ym(c,a,w))}};function tC(a,c,p,w,k,P,M){return a=a.stateNode,typeof a.shouldComponentUpdate=="function"?a.shouldComponentUpdate(w,P,M):c.prototype&&c.prototype.isPureReactComponent?!Yf(p,w)||!Yf(k,P):!0}function nC(a,c,p){var w=!1,k=tl,P=c.contextType;return typeof P=="object"&&P!==null?P=Ii(P):(k=Ms(c)?gc:ns.current,w=c.contextTypes,P=(w=w!=null)?Vu(a,k):tl),c=new c(p,P),a.memoizedState=c.state!==null&&c.state!==void 0?c.state:null,c.updater=s0,a.stateNode=c,c._reactInternals=a,w&&(a=a.stateNode,a.__reactInternalMemoizedUnmaskedChildContext=k,a.__reactInternalMemoizedMaskedChildContext=P),c}function rC(a,c,p,w){a=c.state,typeof c.componentWillReceiveProps=="function"&&c.componentWillReceiveProps(p,w),typeof c.UNSAFE_componentWillReceiveProps=="function"&&c.UNSAFE_componentWillReceiveProps(p,w),c.state!==a&&s0.enqueueReplaceState(c,c.state,null)}function B1(a,c,p,w){var k=a.stateNode;k.props=p,k.state=a.memoizedState,k.refs={},I1(a);var P=c.contextType;typeof P=="object"&&P!==null?k.context=Ii(P):(P=Ms(c)?gc:ns.current,k.context=Vu(a,P)),k.state=a.memoizedState,P=c.getDerivedStateFromProps,typeof P=="function"&&(Z1(a,c,P,p),k.state=a.memoizedState),typeof c.getDerivedStateFromProps=="function"||typeof k.getSnapshotBeforeUpdate=="function"||typeof k.UNSAFE_componentWillMount!="function"&&typeof k.componentWillMount!="function"||(c=k.state,typeof k.componentWillMount=="function"&&k.componentWillMount(),typeof k.UNSAFE_componentWillMount=="function"&&k.UNSAFE_componentWillMount(),c!==k.state&&s0.enqueueReplaceState(k,k.state,null),Xm(a,p,k,w),k.state=a.memoizedState),typeof k.componentDidMount=="function"&&(a.flags|=4194308)}function qu(a,c){try{var p="",w=c;do p+=ce(w),w=w.return;while(w);var k=p}catch(P){k=`
107
- Error generating stack: `+P.message+`
108
- `+P.stack}return{value:a,source:c,stack:k,digest:null}}function W1(a,c,p){return{value:a,source:null,stack:p??null,digest:c??null}}function K1(a,c){try{console.error(c.value)}catch(p){setTimeout(function(){throw p})}}var i7=typeof WeakMap=="function"?WeakMap:Map;function sC(a,c,p){p=ua(-1,p),p.tag=3,p.payload={element:null};var w=c.value;return p.callback=function(){d0||(d0=!0,l_=w),K1(a,c)},p}function iC(a,c,p){p=ua(-1,p),p.tag=3;var w=a.type.getDerivedStateFromError;if(typeof w=="function"){var k=c.value;p.payload=function(){return w(k)},p.callback=function(){K1(a,c)}}var P=a.stateNode;return P!==null&&typeof P.componentDidCatch=="function"&&(p.callback=function(){K1(a,c),typeof w!="function"&&(ol===null?ol=new Set([this]):ol.add(this));var M=c.stack;this.componentDidCatch(c.value,{componentStack:M!==null?M:""})}),p}function oC(a,c,p){var w=a.pingCache;if(w===null){w=a.pingCache=new i7;var k=new Set;w.set(c,k)}else k=w.get(c),k===void 0&&(k=new Set,w.set(c,k));k.has(p)||(k.add(p),a=_7.bind(null,a,c,p),c.then(a,a))}function aC(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 lC(a,c,p,w,k){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=ua(-1,1),c.tag=2,sl(p,c,1))),p.lanes|=1),a):(a.flags|=65536,a.lanes=k,a)}var o7=C.ReactCurrentOwner,Ls=!1;function ys(a,c,p,w){c.child=a===null?T6(c,null,p,w):Bu(c,a.child,p,w)}function cC(a,c,p,w,k){p=p.render;var P=c.ref;return Ku(c,k),w=F1(a,c,p,w,P,k),p=j1(),a!==null&&!Ls?(c.updateQueue=a.updateQueue,c.flags&=-2053,a.lanes&=~k,da(a,c,k)):(Mn&&p&&b1(c),c.flags|=1,ys(a,c,w,k),c.child)}function uC(a,c,p,w,k){if(a===null){var P=p.type;return typeof P=="function"&&!m_(P)&&P.defaultProps===void 0&&p.compare===null&&p.defaultProps===void 0?(c.tag=15,c.type=P,dC(a,c,P,w,k)):(a=v0(p.type,null,w,c,c.mode,k),a.ref=c.ref,a.return=c,c.child=a)}if(P=a.child,(a.lanes&k)===0){var M=P.memoizedProps;if(p=p.compare,p=p!==null?p:Yf,p(M,w)&&a.ref===c.ref)return da(a,c,k)}return c.flags|=1,a=ul(P,w),a.ref=c.ref,a.return=c,c.child=a}function dC(a,c,p,w,k){if(a!==null){var P=a.memoizedProps;if(Yf(P,w)&&a.ref===c.ref)if(Ls=!1,c.pendingProps=w=P,(a.lanes&k)!==0)(a.flags&131072)!==0&&(Ls=!0);else return c.lanes=a.lanes,da(a,c,k)}return G1(a,c,p,w,k)}function fC(a,c,p){var w=c.pendingProps,k=w.children,P=a!==null?a.memoizedState:null;if(w.mode==="hidden")if((c.mode&1)===0)c.memoizedState={baseLanes:0,cachePool:null,transitions:null},kn(Xu,li),li|=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,kn(Xu,li),li|=a,null;c.memoizedState={baseLanes:0,cachePool:null,transitions:null},w=P!==null?P.baseLanes:p,kn(Xu,li),li|=w}else P!==null?(w=P.baseLanes|p,c.memoizedState=null):w=p,kn(Xu,li),li|=w;return ys(a,c,k,p),c.child}function hC(a,c){var p=c.ref;(a===null&&p!==null||a!==null&&a.ref!==p)&&(c.flags|=512,c.flags|=2097152)}function G1(a,c,p,w,k){var P=Ms(p)?gc:ns.current;return P=Vu(c,P),Ku(c,k),p=F1(a,c,p,w,P,k),w=j1(),a!==null&&!Ls?(c.updateQueue=a.updateQueue,c.flags&=-2053,a.lanes&=~k,da(a,c,k)):(Mn&&w&&b1(c),c.flags|=1,ys(a,c,p,k),c.child)}function pC(a,c,p,w,k){if(Ms(p)){var P=!0;Hm(c)}else P=!1;if(Ku(c,k),c.stateNode===null)o0(a,c),nC(c,p,w),B1(c,p,w,k),w=!0;else if(a===null){var M=c.stateNode,U=c.memoizedProps;M.props=U;var G=M.context,se=p.contextType;typeof se=="object"&&se!==null?se=Ii(se):(se=Ms(p)?gc:ns.current,se=Vu(c,se));var _e=p.getDerivedStateFromProps,we=typeof _e=="function"||typeof M.getSnapshotBeforeUpdate=="function";we||typeof M.UNSAFE_componentWillReceiveProps!="function"&&typeof M.componentWillReceiveProps!="function"||(U!==w||G!==se)&&rC(c,M,w,se),rl=!1;var ye=c.memoizedState;M.state=ye,Xm(c,w,M,k),G=c.memoizedState,U!==w||ye!==G||Os.current||rl?(typeof _e=="function"&&(Z1(c,p,_e,w),G=c.memoizedState),(U=rl||tC(c,p,U,w,ye,G,se))?(we||typeof M.UNSAFE_componentWillMount!="function"&&typeof M.componentWillMount!="function"||(typeof M.componentWillMount=="function"&&M.componentWillMount(),typeof M.UNSAFE_componentWillMount=="function"&&M.UNSAFE_componentWillMount()),typeof M.componentDidMount=="function"&&(c.flags|=4194308)):(typeof M.componentDidMount=="function"&&(c.flags|=4194308),c.memoizedProps=w,c.memoizedState=G),M.props=w,M.state=G,M.context=se,w=U):(typeof M.componentDidMount=="function"&&(c.flags|=4194308),w=!1)}else{M=c.stateNode,A6(a,c),U=c.memoizedProps,se=c.type===c.elementType?U:Qi(c.type,U),M.props=se,we=c.pendingProps,ye=M.context,G=p.contextType,typeof G=="object"&&G!==null?G=Ii(G):(G=Ms(p)?gc:ns.current,G=Vu(c,G));var Fe=p.getDerivedStateFromProps;(_e=typeof Fe=="function"||typeof M.getSnapshotBeforeUpdate=="function")||typeof M.UNSAFE_componentWillReceiveProps!="function"&&typeof M.componentWillReceiveProps!="function"||(U!==we||ye!==G)&&rC(c,M,w,G),rl=!1,ye=c.memoizedState,M.state=ye,Xm(c,w,M,k);var Ke=c.memoizedState;U!==we||ye!==Ke||Os.current||rl?(typeof Fe=="function"&&(Z1(c,p,Fe,w),Ke=c.memoizedState),(se=rl||tC(c,p,se,w,ye,Ke,G)||!1)?(_e||typeof M.UNSAFE_componentWillUpdate!="function"&&typeof M.componentWillUpdate!="function"||(typeof M.componentWillUpdate=="function"&&M.componentWillUpdate(w,Ke,G),typeof M.UNSAFE_componentWillUpdate=="function"&&M.UNSAFE_componentWillUpdate(w,Ke,G)),typeof M.componentDidUpdate=="function"&&(c.flags|=4),typeof M.getSnapshotBeforeUpdate=="function"&&(c.flags|=1024)):(typeof M.componentDidUpdate!="function"||U===a.memoizedProps&&ye===a.memoizedState||(c.flags|=4),typeof M.getSnapshotBeforeUpdate!="function"||U===a.memoizedProps&&ye===a.memoizedState||(c.flags|=1024),c.memoizedProps=w,c.memoizedState=Ke),M.props=w,M.state=Ke,M.context=G,w=se):(typeof M.componentDidUpdate!="function"||U===a.memoizedProps&&ye===a.memoizedState||(c.flags|=4),typeof M.getSnapshotBeforeUpdate!="function"||U===a.memoizedProps&&ye===a.memoizedState||(c.flags|=1024),w=!1)}return q1(a,c,p,w,P,k)}function q1(a,c,p,w,k,P){hC(a,c);var M=(c.flags&128)!==0;if(!w&&!M)return k&&_6(c,p,!1),da(a,c,P);w=c.stateNode,o7.current=c;var U=M&&typeof p.getDerivedStateFromError!="function"?null:w.render();return c.flags|=1,a!==null&&M?(c.child=Bu(c,a.child,null,P),c.child=Bu(c,null,U,P)):ys(a,c,U,P),c.memoizedState=w.state,k&&_6(c,p,!0),c.child}function mC(a){var c=a.stateNode;c.pendingContext?v6(a,c.pendingContext,c.pendingContext!==c.context):c.context&&v6(a,c.context,!1),O1(a,c.containerInfo)}function gC(a,c,p,w,k){return Zu(),E1(k),c.flags|=256,ys(a,c,p,w),c.child}var Y1={dehydrated:null,treeContext:null,retryLane:0};function X1(a){return{baseLanes:a,cachePool:null,transitions:null}}function vC(a,c,p){var w=c.pendingProps,k=jn.current,P=!1,M=(c.flags&128)!==0,U;if((U=M)||(U=a!==null&&a.memoizedState===null?!1:(k&2)!==0),U?(P=!0,c.flags&=-129):(a===null||a.memoizedState!==null)&&(k|=1),kn(jn,k&1),a===null)return k1(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):(M=w.children,a=w.fallback,P?(w=c.mode,P=c.child,M={mode:"hidden",children:M},(w&1)===0&&P!==null?(P.childLanes=0,P.pendingProps=M):P=y0(M,w,0,null),a=Cc(a,w,p,null),P.return=c,a.return=c,P.sibling=a,c.child=P,c.child.memoizedState=X1(p),c.memoizedState=Y1,a):Q1(c,M));if(k=a.memoizedState,k!==null&&(U=k.dehydrated,U!==null))return a7(a,c,M,w,U,k,p);if(P){P=w.fallback,M=c.mode,k=a.child,U=k.sibling;var G={mode:"hidden",children:w.children};return(M&1)===0&&c.child!==k?(w=c.child,w.childLanes=0,w.pendingProps=G,c.deletions=null):(w=ul(k,G),w.subtreeFlags=k.subtreeFlags&14680064),U!==null?P=ul(U,P):(P=Cc(P,M,p,null),P.flags|=2),P.return=c,w.return=c,w.sibling=P,c.child=w,w=P,P=c.child,M=a.child.memoizedState,M=M===null?X1(p):{baseLanes:M.baseLanes|p,cachePool:null,transitions:M.transitions},P.memoizedState=M,P.childLanes=a.childLanes&~p,c.memoizedState=Y1,w}return P=a.child,a=P.sibling,w=ul(P,{mode:"visible",children:w.children}),(c.mode&1)===0&&(w.lanes=p),w.return=c,w.sibling=null,a!==null&&(p=c.deletions,p===null?(c.deletions=[a],c.flags|=16):p.push(a)),c.child=w,c.memoizedState=null,w}function Q1(a,c){return c=y0({mode:"visible",children:c},a.mode,0,null),c.return=a,a.child=c}function i0(a,c,p,w){return w!==null&&E1(w),Bu(c,a.child,null,p),a=Q1(c,c.pendingProps.children),a.flags|=2,c.memoizedState=null,a}function a7(a,c,p,w,k,P,M){if(p)return c.flags&256?(c.flags&=-257,w=W1(Error(n(422))),i0(a,c,M,w)):c.memoizedState!==null?(c.child=a.child,c.flags|=128,null):(P=w.fallback,k=c.mode,w=y0({mode:"visible",children:w.children},k,0,null),P=Cc(P,k,M,null),P.flags|=2,w.return=c,P.return=c,w.sibling=P,c.child=w,(c.mode&1)!==0&&Bu(c,a.child,null,M),c.child.memoizedState=X1(M),c.memoizedState=Y1,P);if((c.mode&1)===0)return i0(a,c,M,null);if(k.data==="$!"){if(w=k.nextSibling&&k.nextSibling.dataset,w)var U=w.dgst;return w=U,P=Error(n(419)),w=W1(P,w,void 0),i0(a,c,M,w)}if(U=(M&a.childLanes)!==0,Ls||U){if(w=Ir,w!==null){switch(M&-M){case 4:k=2;break;case 16:k=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:k=32;break;case 536870912:k=268435456;break;default:k=0}k=(k&(w.suspendedLanes|M))!==0?0:k,k!==0&&k!==P.retryLane&&(P.retryLane=k,ca(a,k),to(w,a,k,-1))}return p_(),w=W1(Error(n(421))),i0(a,c,M,w)}return k.data==="$?"?(c.flags|=128,c.child=a.child,c=w7.bind(null,a),k._reactRetry=c,null):(a=P.treeContext,ai=Ja(k.nextSibling),oi=c,Mn=!0,Xi=null,a!==null&&(Ri[Ai++]=aa,Ri[Ai++]=la,Ri[Ai++]=vc,aa=a.id,la=a.overflow,vc=c),c=Q1(c,w.children),c.flags|=4096,c)}function yC(a,c,p){a.lanes|=c;var w=a.alternate;w!==null&&(w.lanes|=c),R1(a.return,c,p)}function J1(a,c,p,w,k){var P=a.memoizedState;P===null?a.memoizedState={isBackwards:c,rendering:null,renderingStartTime:0,last:w,tail:p,tailMode:k}:(P.isBackwards=c,P.rendering=null,P.renderingStartTime=0,P.last=w,P.tail=p,P.tailMode=k)}function _C(a,c,p){var w=c.pendingProps,k=w.revealOrder,P=w.tail;if(ys(a,c,w.children,p),w=jn.current,(w&2)!==0)w=w&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&&yC(a,p,c);else if(a.tag===19)yC(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}w&=1}if(kn(jn,w),(c.mode&1)===0)c.memoizedState=null;else switch(k){case"forwards":for(p=c.child,k=null;p!==null;)a=p.alternate,a!==null&&Qm(a)===null&&(k=p),p=p.sibling;p=k,p===null?(k=c.child,c.child=null):(k=p.sibling,p.sibling=null),J1(c,!1,k,p,P);break;case"backwards":for(p=null,k=c.child,c.child=null;k!==null;){if(a=k.alternate,a!==null&&Qm(a)===null){c.child=k;break}a=k.sibling,k.sibling=p,p=k,k=a}J1(c,!0,p,null,P);break;case"together":J1(c,!1,null,null,void 0);break;default:c.memoizedState=null}return c.child}function o0(a,c){(c.mode&1)===0&&a!==null&&(a.alternate=null,c.alternate=null,c.flags|=2)}function da(a,c,p){if(a!==null&&(c.dependencies=a.dependencies),xc|=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=ul(a,a.pendingProps),c.child=p,p.return=c;a.sibling!==null;)a=a.sibling,p=p.sibling=ul(a,a.pendingProps),p.return=c;p.sibling=null}return c.child}function l7(a,c,p){switch(c.tag){case 3:mC(c),Zu();break;case 5:M6(c);break;case 1:Ms(c.type)&&Hm(c);break;case 4:O1(c,c.stateNode.containerInfo);break;case 10:var w=c.type._context,k=c.memoizedProps.value;kn(Gm,w._currentValue),w._currentValue=k;break;case 13:if(w=c.memoizedState,w!==null)return w.dehydrated!==null?(kn(jn,jn.current&1),c.flags|=128,null):(p&c.child.childLanes)!==0?vC(a,c,p):(kn(jn,jn.current&1),a=da(a,c,p),a!==null?a.sibling:null);kn(jn,jn.current&1);break;case 19:if(w=(p&c.childLanes)!==0,(a.flags&128)!==0){if(w)return _C(a,c,p);c.flags|=128}if(k=c.memoizedState,k!==null&&(k.rendering=null,k.tail=null,k.lastEffect=null),kn(jn,jn.current),w)break;return null;case 22:case 23:return c.lanes=0,fC(a,c,p)}return da(a,c,p)}var wC,e_,bC,xC;wC=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}},e_=function(){},bC=function(a,c,p,w){var k=a.memoizedProps;if(k!==w){a=c.stateNode,wc(Co.current);var P=null;switch(p){case"input":k=fn(a,k),w=fn(a,w),P=[];break;case"select":k=q({},k,{value:void 0}),w=q({},w,{value:void 0}),P=[];break;case"textarea":k=Te(a,k),w=Te(a,w),P=[];break;default:typeof k.onClick!="function"&&typeof w.onClick=="function"&&(a.onclick=jm)}hn(p,w);var M;p=null;for(se in k)if(!w.hasOwnProperty(se)&&k.hasOwnProperty(se)&&k[se]!=null)if(se==="style"){var U=k[se];for(M in U)U.hasOwnProperty(M)&&(p||(p={}),p[M]="")}else se!=="dangerouslySetInnerHTML"&&se!=="children"&&se!=="suppressContentEditableWarning"&&se!=="suppressHydrationWarning"&&se!=="autoFocus"&&(s.hasOwnProperty(se)?P||(P=[]):(P=P||[]).push(se,null));for(se in w){var G=w[se];if(U=k!=null?k[se]:void 0,w.hasOwnProperty(se)&&G!==U&&(G!=null||U!=null))if(se==="style")if(U){for(M in U)!U.hasOwnProperty(M)||G&&G.hasOwnProperty(M)||(p||(p={}),p[M]="");for(M in G)G.hasOwnProperty(M)&&U[M]!==G[M]&&(p||(p={}),p[M]=G[M])}else p||(P||(P=[]),P.push(se,p)),p=G;else se==="dangerouslySetInnerHTML"?(G=G?G.__html:void 0,U=U?U.__html:void 0,G!=null&&U!==G&&(P=P||[]).push(se,G)):se==="children"?typeof G!="string"&&typeof G!="number"||(P=P||[]).push(se,""+G):se!=="suppressContentEditableWarning"&&se!=="suppressHydrationWarning"&&(s.hasOwnProperty(se)?(G!=null&&se==="onScroll"&&Cn("scroll",a),P||U===G||(P=[])):(P=P||[]).push(se,G))}p&&(P=P||[]).push("style",p);var se=P;(c.updateQueue=se)&&(c.flags|=4)}},xC=function(a,c,p,w){p!==w&&(c.flags|=4)};function dh(a,c){if(!Mn)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 w=null;p!==null;)p.alternate!==null&&(w=p),p=p.sibling;w===null?c||a.tail===null?a.tail=null:a.tail.sibling=null:w.sibling=null}}function ss(a){var c=a.alternate!==null&&a.alternate.child===a.child,p=0,w=0;if(c)for(var k=a.child;k!==null;)p|=k.lanes|k.childLanes,w|=k.subtreeFlags&14680064,w|=k.flags&14680064,k.return=a,k=k.sibling;else for(k=a.child;k!==null;)p|=k.lanes|k.childLanes,w|=k.subtreeFlags,w|=k.flags,k.return=a,k=k.sibling;return a.subtreeFlags|=w,a.childLanes=p,c}function c7(a,c,p){var w=c.pendingProps;switch(x1(c),c.tag){case 2:case 16:case 15:case 0:case 11:case 7:case 8:case 12:case 9:case 14:return ss(c),null;case 1:return Ms(c.type)&&Vm(),ss(c),null;case 3:return w=c.stateNode,Gu(),Pn(Os),Pn(ns),N1(),w.pendingContext&&(w.context=w.pendingContext,w.pendingContext=null),(a===null||a.child===null)&&(Wm(c)?c.flags|=4:a===null||a.memoizedState.isDehydrated&&(c.flags&256)===0||(c.flags|=1024,Xi!==null&&(d_(Xi),Xi=null))),e_(a,c),ss(c),null;case 5:M1(c);var k=wc(oh.current);if(p=c.type,a!==null&&c.stateNode!=null)bC(a,c,p,w,k),a.ref!==c.ref&&(c.flags|=512,c.flags|=2097152);else{if(!w){if(c.stateNode===null)throw Error(n(166));return ss(c),null}if(a=wc(Co.current),Wm(c)){w=c.stateNode,p=c.type;var P=c.memoizedProps;switch(w[Eo]=c,w[th]=P,a=(c.mode&1)!==0,p){case"dialog":Cn("cancel",w),Cn("close",w);break;case"iframe":case"object":case"embed":Cn("load",w);break;case"video":case"audio":for(k=0;k<Qf.length;k++)Cn(Qf[k],w);break;case"source":Cn("error",w);break;case"img":case"image":case"link":Cn("error",w),Cn("load",w);break;case"details":Cn("toggle",w);break;case"input":on(w,P),Cn("invalid",w);break;case"select":w._wrapperState={wasMultiple:!!P.multiple},Cn("invalid",w);break;case"textarea":St(w,P),Cn("invalid",w)}hn(p,P),k=null;for(var M in P)if(P.hasOwnProperty(M)){var U=P[M];M==="children"?typeof U=="string"?w.textContent!==U&&(P.suppressHydrationWarning!==!0&&Fm(w.textContent,U,a),k=["children",U]):typeof U=="number"&&w.textContent!==""+U&&(P.suppressHydrationWarning!==!0&&Fm(w.textContent,U,a),k=["children",""+U]):s.hasOwnProperty(M)&&U!=null&&M==="onScroll"&&Cn("scroll",w)}switch(p){case"input":Ae(w),vn(w,P,!0);break;case"textarea":Ae(w),Nt(w);break;case"select":case"option":break;default:typeof P.onClick=="function"&&(w.onclick=jm)}w=k,c.updateQueue=w,w!==null&&(c.flags|=4)}else{M=k.nodeType===9?k:k.ownerDocument,a==="http://www.w3.org/1999/xhtml"&&(a=ft(p)),a==="http://www.w3.org/1999/xhtml"?p==="script"?(a=M.createElement("div"),a.innerHTML="<script><\/script>",a=a.removeChild(a.firstChild)):typeof w.is=="string"?a=M.createElement(p,{is:w.is}):(a=M.createElement(p),p==="select"&&(M=a,w.multiple?M.multiple=!0:w.size&&(M.size=w.size))):a=M.createElementNS(a,p),a[Eo]=c,a[th]=w,wC(a,c,!1,!1),c.stateNode=a;e:{switch(M=Qr(p,w),p){case"dialog":Cn("cancel",a),Cn("close",a),k=w;break;case"iframe":case"object":case"embed":Cn("load",a),k=w;break;case"video":case"audio":for(k=0;k<Qf.length;k++)Cn(Qf[k],a);k=w;break;case"source":Cn("error",a),k=w;break;case"img":case"image":case"link":Cn("error",a),Cn("load",a),k=w;break;case"details":Cn("toggle",a),k=w;break;case"input":on(a,w),k=fn(a,w),Cn("invalid",a);break;case"option":k=w;break;case"select":a._wrapperState={wasMultiple:!!w.multiple},k=q({},w,{value:void 0}),Cn("invalid",a);break;case"textarea":St(a,w),k=Te(a,w),Cn("invalid",a);break;default:k=w}hn(p,k),U=k;for(P in U)if(U.hasOwnProperty(P)){var G=U[P];P==="style"?Xr(a,G):P==="dangerouslySetInnerHTML"?(G=G?G.__html:void 0,G!=null&&Ei(a,G)):P==="children"?typeof G=="string"?(p!=="textarea"||G!=="")&&xn(a,G):typeof G=="number"&&xn(a,""+G):P!=="suppressContentEditableWarning"&&P!=="suppressHydrationWarning"&&P!=="autoFocus"&&(s.hasOwnProperty(P)?G!=null&&P==="onScroll"&&Cn("scroll",a):G!=null&&E(a,P,G,M))}switch(p){case"input":Ae(a),vn(a,w,!1);break;case"textarea":Ae(a),Nt(a);break;case"option":w.value!=null&&a.setAttribute("value",""+ve(w.value));break;case"select":a.multiple=!!w.multiple,P=w.value,P!=null?Qe(a,!!w.multiple,P,!1):w.defaultValue!=null&&Qe(a,!!w.multiple,w.defaultValue,!0);break;default:typeof k.onClick=="function"&&(a.onclick=jm)}switch(p){case"button":case"input":case"select":case"textarea":w=!!w.autoFocus;break e;case"img":w=!0;break e;default:w=!1}}w&&(c.flags|=4)}c.ref!==null&&(c.flags|=512,c.flags|=2097152)}return ss(c),null;case 6:if(a&&c.stateNode!=null)xC(a,c,a.memoizedProps,w);else{if(typeof w!="string"&&c.stateNode===null)throw Error(n(166));if(p=wc(oh.current),wc(Co.current),Wm(c)){if(w=c.stateNode,p=c.memoizedProps,w[Eo]=c,(P=w.nodeValue!==p)&&(a=oi,a!==null))switch(a.tag){case 3:Fm(w.nodeValue,p,(a.mode&1)!==0);break;case 5:a.memoizedProps.suppressHydrationWarning!==!0&&Fm(w.nodeValue,p,(a.mode&1)!==0)}P&&(c.flags|=4)}else w=(p.nodeType===9?p:p.ownerDocument).createTextNode(w),w[Eo]=c,c.stateNode=w}return ss(c),null;case 13:if(Pn(jn),w=c.memoizedState,a===null||a.memoizedState!==null&&a.memoizedState.dehydrated!==null){if(Mn&&ai!==null&&(c.mode&1)!==0&&(c.flags&128)===0)E6(),Zu(),c.flags|=98560,P=!1;else if(P=Wm(c),w!==null&&w.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[Eo]=c}else Zu(),(c.flags&128)===0&&(c.memoizedState=null),c.flags|=4;ss(c),P=!1}else Xi!==null&&(d_(Xi),Xi=null),P=!0;if(!P)return c.flags&65536?c:null}return(c.flags&128)!==0?(c.lanes=p,c):(w=w!==null,w!==(a!==null&&a.memoizedState!==null)&&w&&(c.child.flags|=8192,(c.mode&1)!==0&&(a===null||(jn.current&1)!==0?br===0&&(br=3):p_())),c.updateQueue!==null&&(c.flags|=4),ss(c),null);case 4:return Gu(),e_(a,c),a===null&&Jf(c.stateNode.containerInfo),ss(c),null;case 10:return T1(c.type._context),ss(c),null;case 17:return Ms(c.type)&&Vm(),ss(c),null;case 19:if(Pn(jn),P=c.memoizedState,P===null)return ss(c),null;if(w=(c.flags&128)!==0,M=P.rendering,M===null)if(w)dh(P,!1);else{if(br!==0||a!==null&&(a.flags&128)!==0)for(a=c.child;a!==null;){if(M=Qm(a),M!==null){for(c.flags|=128,dh(P,!1),w=M.updateQueue,w!==null&&(c.updateQueue=w,c.flags|=4),c.subtreeFlags=0,w=p,p=c.child;p!==null;)P=p,a=w,P.flags&=14680066,M=P.alternate,M===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=M.childLanes,P.lanes=M.lanes,P.child=M.child,P.subtreeFlags=0,P.deletions=null,P.memoizedProps=M.memoizedProps,P.memoizedState=M.memoizedState,P.updateQueue=M.updateQueue,P.type=M.type,a=M.dependencies,P.dependencies=a===null?null:{lanes:a.lanes,firstContext:a.firstContext}),p=p.sibling;return kn(jn,jn.current&1|2),c.child}a=a.sibling}P.tail!==null&&an()>Qu&&(c.flags|=128,w=!0,dh(P,!1),c.lanes=4194304)}else{if(!w)if(a=Qm(M),a!==null){if(c.flags|=128,w=!0,p=a.updateQueue,p!==null&&(c.updateQueue=p,c.flags|=4),dh(P,!0),P.tail===null&&P.tailMode==="hidden"&&!M.alternate&&!Mn)return ss(c),null}else 2*an()-P.renderingStartTime>Qu&&p!==1073741824&&(c.flags|=128,w=!0,dh(P,!1),c.lanes=4194304);P.isBackwards?(M.sibling=c.child,c.child=M):(p=P.last,p!==null?p.sibling=M:c.child=M,P.last=M)}return P.tail!==null?(c=P.tail,P.rendering=c,P.tail=c.sibling,P.renderingStartTime=an(),c.sibling=null,p=jn.current,kn(jn,w?p&1|2:p&1),c):(ss(c),null);case 22:case 23:return h_(),w=c.memoizedState!==null,a!==null&&a.memoizedState!==null!==w&&(c.flags|=8192),w&&(c.mode&1)!==0?(li&1073741824)!==0&&(ss(c),c.subtreeFlags&6&&(c.flags|=8192)):ss(c),null;case 24:return null;case 25:return null}throw Error(n(156,c.tag))}function u7(a,c){switch(x1(c),c.tag){case 1:return Ms(c.type)&&Vm(),a=c.flags,a&65536?(c.flags=a&-65537|128,c):null;case 3:return Gu(),Pn(Os),Pn(ns),N1(),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(Pn(jn),a=c.memoizedState,a!==null&&a.dehydrated!==null){if(c.alternate===null)throw Error(n(340));Zu()}return a=c.flags,a&65536?(c.flags=a&-65537|128,c):null;case 19:return Pn(jn),null;case 4:return Gu(),null;case 10:return T1(c.type._context),null;case 22:case 23:return h_(),null;case 24:return null;default:return null}}var a0=!1,is=!1,d7=typeof WeakSet=="function"?WeakSet:Set,Ue=null;function Yu(a,c){var p=a.ref;if(p!==null)if(typeof p=="function")try{p(null)}catch(w){Jn(a,c,w)}else p.current=null}function t_(a,c,p){try{p()}catch(w){Jn(a,c,w)}}var SC=!1;function f7(a,c){if(h1=Pm,a=t6(),i1(a)){if("selectionStart"in a)var p={start:a.selectionStart,end:a.selectionEnd};else e:{p=(p=a.ownerDocument)&&p.defaultView||window;var w=p.getSelection&&p.getSelection();if(w&&w.rangeCount!==0){p=w.anchorNode;var k=w.anchorOffset,P=w.focusNode;w=w.focusOffset;try{p.nodeType,P.nodeType}catch{p=null;break e}var M=0,U=-1,G=-1,se=0,_e=0,we=a,ye=null;t:for(;;){for(var Fe;we!==p||k!==0&&we.nodeType!==3||(U=M+k),we!==P||w!==0&&we.nodeType!==3||(G=M+w),we.nodeType===3&&(M+=we.nodeValue.length),(Fe=we.firstChild)!==null;)ye=we,we=Fe;for(;;){if(we===a)break t;if(ye===p&&++se===k&&(U=M),ye===P&&++_e===w&&(G=M),(Fe=we.nextSibling)!==null)break;we=ye,ye=we.parentNode}we=Fe}p=U===-1||G===-1?null:{start:U,end:G}}else p=null}p=p||{start:0,end:0}}else p=null;for(p1={focusedElem:a,selectionRange:p},Pm=!1,Ue=c;Ue!==null;)if(c=Ue,a=c.child,(c.subtreeFlags&1028)!==0&&a!==null)a.return=c,Ue=a;else for(;Ue!==null;){c=Ue;try{var Ke=c.alternate;if((c.flags&1024)!==0)switch(c.tag){case 0:case 11:case 15:break;case 1:if(Ke!==null){var qe=Ke.memoizedProps,sr=Ke.memoizedState,ee=c.stateNode,Q=ee.getSnapshotBeforeUpdate(c.elementType===c.type?qe:Qi(c.type,qe),sr);ee.__reactInternalSnapshotBeforeUpdate=Q}break;case 3:var ne=c.stateNode.containerInfo;ne.nodeType===1?ne.textContent="":ne.nodeType===9&&ne.documentElement&&ne.removeChild(ne.documentElement);break;case 5:case 6:case 4:case 17:break;default:throw Error(n(163))}}catch(Ce){Jn(c,c.return,Ce)}if(a=c.sibling,a!==null){a.return=c.return,Ue=a;break}Ue=c.return}return Ke=SC,SC=!1,Ke}function fh(a,c,p){var w=c.updateQueue;if(w=w!==null?w.lastEffect:null,w!==null){var k=w=w.next;do{if((k.tag&a)===a){var P=k.destroy;k.destroy=void 0,P!==void 0&&t_(c,p,P)}k=k.next}while(k!==w)}}function l0(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 w=p.create;p.destroy=w()}p=p.next}while(p!==c)}}function n_(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 kC(a){var c=a.alternate;c!==null&&(a.alternate=null,kC(c)),a.child=null,a.deletions=null,a.sibling=null,a.tag===5&&(c=a.stateNode,c!==null&&(delete c[Eo],delete c[th],delete c[y1],delete c[Gj],delete c[qj])),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 EC(a){return a.tag===5||a.tag===3||a.tag===4}function CC(a){e:for(;;){for(;a.sibling===null;){if(a.return===null||EC(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 r_(a,c,p){var w=a.tag;if(w===5||w===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=jm));else if(w!==4&&(a=a.child,a!==null))for(r_(a,c,p),a=a.sibling;a!==null;)r_(a,c,p),a=a.sibling}function s_(a,c,p){var w=a.tag;if(w===5||w===6)a=a.stateNode,c?p.insertBefore(a,c):p.appendChild(a);else if(w!==4&&(a=a.child,a!==null))for(s_(a,c,p),a=a.sibling;a!==null;)s_(a,c,p),a=a.sibling}var Hr=null,Ji=!1;function il(a,c,p){for(p=p.child;p!==null;)PC(a,c,p),p=p.sibling}function PC(a,c,p){if(es&&typeof es.onCommitFiberUnmount=="function")try{es.onCommitFiberUnmount(ra,p)}catch{}switch(p.tag){case 5:is||Yu(p,c);case 6:var w=Hr,k=Ji;Hr=null,il(a,c,p),Hr=w,Ji=k,Hr!==null&&(Ji?(a=Hr,p=p.stateNode,a.nodeType===8?a.parentNode.removeChild(p):a.removeChild(p)):Hr.removeChild(p.stateNode));break;case 18:Hr!==null&&(Ji?(a=Hr,p=p.stateNode,a.nodeType===8?v1(a.parentNode,p):a.nodeType===1&&v1(a,p),ko(a)):v1(Hr,p.stateNode));break;case 4:w=Hr,k=Ji,Hr=p.stateNode.containerInfo,Ji=!0,il(a,c,p),Hr=w,Ji=k;break;case 0:case 11:case 14:case 15:if(!is&&(w=p.updateQueue,w!==null&&(w=w.lastEffect,w!==null))){k=w=w.next;do{var P=k,M=P.destroy;P=P.tag,M!==void 0&&((P&2)!==0||(P&4)!==0)&&t_(p,c,M),k=k.next}while(k!==w)}il(a,c,p);break;case 1:if(!is&&(Yu(p,c),w=p.stateNode,typeof w.componentWillUnmount=="function"))try{w.props=p.memoizedProps,w.state=p.memoizedState,w.componentWillUnmount()}catch(U){Jn(p,c,U)}il(a,c,p);break;case 21:il(a,c,p);break;case 22:p.mode&1?(is=(w=is)||p.memoizedState!==null,il(a,c,p),is=w):il(a,c,p);break;default:il(a,c,p)}}function TC(a){var c=a.updateQueue;if(c!==null){a.updateQueue=null;var p=a.stateNode;p===null&&(p=a.stateNode=new d7),c.forEach(function(w){var k=b7.bind(null,a,w);p.has(w)||(p.add(w),w.then(k,k))})}}function eo(a,c){var p=c.deletions;if(p!==null)for(var w=0;w<p.length;w++){var k=p[w];try{var P=a,M=c,U=M;e:for(;U!==null;){switch(U.tag){case 5:Hr=U.stateNode,Ji=!1;break e;case 3:Hr=U.stateNode.containerInfo,Ji=!0;break e;case 4:Hr=U.stateNode.containerInfo,Ji=!0;break e}U=U.return}if(Hr===null)throw Error(n(160));PC(P,M,k),Hr=null,Ji=!1;var G=k.alternate;G!==null&&(G.return=null),k.return=null}catch(se){Jn(k,c,se)}}if(c.subtreeFlags&12854)for(c=c.child;c!==null;)RC(c,a),c=c.sibling}function RC(a,c){var p=a.alternate,w=a.flags;switch(a.tag){case 0:case 11:case 14:case 15:if(eo(c,a),To(a),w&4){try{fh(3,a,a.return),l0(3,a)}catch(qe){Jn(a,a.return,qe)}try{fh(5,a,a.return)}catch(qe){Jn(a,a.return,qe)}}break;case 1:eo(c,a),To(a),w&512&&p!==null&&Yu(p,p.return);break;case 5:if(eo(c,a),To(a),w&512&&p!==null&&Yu(p,p.return),a.flags&32){var k=a.stateNode;try{xn(k,"")}catch(qe){Jn(a,a.return,qe)}}if(w&4&&(k=a.stateNode,k!=null)){var P=a.memoizedProps,M=p!==null?p.memoizedProps:P,U=a.type,G=a.updateQueue;if(a.updateQueue=null,G!==null)try{U==="input"&&P.type==="radio"&&P.name!=null&&Et(k,P),Qr(U,M);var se=Qr(U,P);for(M=0;M<G.length;M+=2){var _e=G[M],we=G[M+1];_e==="style"?Xr(k,we):_e==="dangerouslySetInnerHTML"?Ei(k,we):_e==="children"?xn(k,we):E(k,_e,we,se)}switch(U){case"input":Gt(k,P);break;case"textarea":be(k,P);break;case"select":var ye=k._wrapperState.wasMultiple;k._wrapperState.wasMultiple=!!P.multiple;var Fe=P.value;Fe!=null?Qe(k,!!P.multiple,Fe,!1):ye!==!!P.multiple&&(P.defaultValue!=null?Qe(k,!!P.multiple,P.defaultValue,!0):Qe(k,!!P.multiple,P.multiple?[]:"",!1))}k[th]=P}catch(qe){Jn(a,a.return,qe)}}break;case 6:if(eo(c,a),To(a),w&4){if(a.stateNode===null)throw Error(n(162));k=a.stateNode,P=a.memoizedProps;try{k.nodeValue=P}catch(qe){Jn(a,a.return,qe)}}break;case 3:if(eo(c,a),To(a),w&4&&p!==null&&p.memoizedState.isDehydrated)try{ko(c.containerInfo)}catch(qe){Jn(a,a.return,qe)}break;case 4:eo(c,a),To(a);break;case 13:eo(c,a),To(a),k=a.child,k.flags&8192&&(P=k.memoizedState!==null,k.stateNode.isHidden=P,!P||k.alternate!==null&&k.alternate.memoizedState!==null||(a_=an())),w&4&&TC(a);break;case 22:if(_e=p!==null&&p.memoizedState!==null,a.mode&1?(is=(se=is)||_e,eo(c,a),is=se):eo(c,a),To(a),w&8192){if(se=a.memoizedState!==null,(a.stateNode.isHidden=se)&&!_e&&(a.mode&1)!==0)for(Ue=a,_e=a.child;_e!==null;){for(we=Ue=_e;Ue!==null;){switch(ye=Ue,Fe=ye.child,ye.tag){case 0:case 11:case 14:case 15:fh(4,ye,ye.return);break;case 1:Yu(ye,ye.return);var Ke=ye.stateNode;if(typeof Ke.componentWillUnmount=="function"){w=ye,p=ye.return;try{c=w,Ke.props=c.memoizedProps,Ke.state=c.memoizedState,Ke.componentWillUnmount()}catch(qe){Jn(w,p,qe)}}break;case 5:Yu(ye,ye.return);break;case 22:if(ye.memoizedState!==null){OC(we);continue}}Fe!==null?(Fe.return=ye,Ue=Fe):OC(we)}_e=_e.sibling}e:for(_e=null,we=a;;){if(we.tag===5){if(_e===null){_e=we;try{k=we.stateNode,se?(P=k.style,typeof P.setProperty=="function"?P.setProperty("display","none","important"):P.display="none"):(U=we.stateNode,G=we.memoizedProps.style,M=G!=null&&G.hasOwnProperty("display")?G.display:null,U.style.display=ps("display",M))}catch(qe){Jn(a,a.return,qe)}}}else if(we.tag===6){if(_e===null)try{we.stateNode.nodeValue=se?"":we.memoizedProps}catch(qe){Jn(a,a.return,qe)}}else if((we.tag!==22&&we.tag!==23||we.memoizedState===null||we===a)&&we.child!==null){we.child.return=we,we=we.child;continue}if(we===a)break e;for(;we.sibling===null;){if(we.return===null||we.return===a)break e;_e===we&&(_e=null),we=we.return}_e===we&&(_e=null),we.sibling.return=we.return,we=we.sibling}}break;case 19:eo(c,a),To(a),w&4&&TC(a);break;case 21:break;default:eo(c,a),To(a)}}function To(a){var c=a.flags;if(c&2){try{e:{for(var p=a.return;p!==null;){if(EC(p)){var w=p;break e}p=p.return}throw Error(n(160))}switch(w.tag){case 5:var k=w.stateNode;w.flags&32&&(xn(k,""),w.flags&=-33);var P=CC(a);s_(a,P,k);break;case 3:case 4:var M=w.stateNode.containerInfo,U=CC(a);r_(a,U,M);break;default:throw Error(n(161))}}catch(G){Jn(a,a.return,G)}a.flags&=-3}c&4096&&(a.flags&=-4097)}function h7(a,c,p){Ue=a,AC(a)}function AC(a,c,p){for(var w=(a.mode&1)!==0;Ue!==null;){var k=Ue,P=k.child;if(k.tag===22&&w){var M=k.memoizedState!==null||a0;if(!M){var U=k.alternate,G=U!==null&&U.memoizedState!==null||is;U=a0;var se=is;if(a0=M,(is=G)&&!se)for(Ue=k;Ue!==null;)M=Ue,G=M.child,M.tag===22&&M.memoizedState!==null?MC(k):G!==null?(G.return=M,Ue=G):MC(k);for(;P!==null;)Ue=P,AC(P),P=P.sibling;Ue=k,a0=U,is=se}IC(a)}else(k.subtreeFlags&8772)!==0&&P!==null?(P.return=k,Ue=P):IC(a)}}function IC(a){for(;Ue!==null;){var c=Ue;if((c.flags&8772)!==0){var p=c.alternate;try{if((c.flags&8772)!==0)switch(c.tag){case 0:case 11:case 15:is||l0(5,c);break;case 1:var w=c.stateNode;if(c.flags&4&&!is)if(p===null)w.componentDidMount();else{var k=c.elementType===c.type?p.memoizedProps:Qi(c.type,p.memoizedProps);w.componentDidUpdate(k,p.memoizedState,w.__reactInternalSnapshotBeforeUpdate)}var P=c.updateQueue;P!==null&&O6(c,P,w);break;case 3:var M=c.updateQueue;if(M!==null){if(p=null,c.child!==null)switch(c.child.tag){case 5:p=c.child.stateNode;break;case 1:p=c.child.stateNode}O6(c,M,p)}break;case 5:var U=c.stateNode;if(p===null&&c.flags&4){p=U;var G=c.memoizedProps;switch(c.type){case"button":case"input":case"select":case"textarea":G.autoFocus&&p.focus();break;case"img":G.src&&(p.src=G.src)}}break;case 6:break;case 4:break;case 12:break;case 13:if(c.memoizedState===null){var se=c.alternate;if(se!==null){var _e=se.memoizedState;if(_e!==null){var we=_e.dehydrated;we!==null&&ko(we)}}}break;case 19:case 17:case 21:case 22:case 23:case 25:break;default:throw Error(n(163))}is||c.flags&512&&n_(c)}catch(ye){Jn(c,c.return,ye)}}if(c===a){Ue=null;break}if(p=c.sibling,p!==null){p.return=c.return,Ue=p;break}Ue=c.return}}function OC(a){for(;Ue!==null;){var c=Ue;if(c===a){Ue=null;break}var p=c.sibling;if(p!==null){p.return=c.return,Ue=p;break}Ue=c.return}}function MC(a){for(;Ue!==null;){var c=Ue;try{switch(c.tag){case 0:case 11:case 15:var p=c.return;try{l0(4,c)}catch(G){Jn(c,p,G)}break;case 1:var w=c.stateNode;if(typeof w.componentDidMount=="function"){var k=c.return;try{w.componentDidMount()}catch(G){Jn(c,k,G)}}var P=c.return;try{n_(c)}catch(G){Jn(c,P,G)}break;case 5:var M=c.return;try{n_(c)}catch(G){Jn(c,M,G)}}}catch(G){Jn(c,c.return,G)}if(c===a){Ue=null;break}var U=c.sibling;if(U!==null){U.return=c.return,Ue=U;break}Ue=c.return}}var p7=Math.ceil,c0=C.ReactCurrentDispatcher,i_=C.ReactCurrentOwner,Mi=C.ReactCurrentBatchConfig,Wt=0,Ir=null,lr=null,Ur=0,li=0,Xu=el(0),br=0,hh=null,xc=0,u0=0,o_=0,ph=null,Ns=null,a_=0,Qu=1/0,fa=null,d0=!1,l_=null,ol=null,f0=!1,al=null,h0=0,mh=0,c_=null,p0=-1,m0=0;function _s(){return(Wt&6)!==0?an():p0!==-1?p0:p0=an()}function ll(a){return(a.mode&1)===0?1:(Wt&2)!==0&&Ur!==0?Ur&-Ur:Xj.transition!==null?(m0===0&&(m0=mt()),m0):(a=it,a!==0||(a=window.event,a=a===void 0?16:NE(a.type)),a)}function to(a,c,p,w){if(50<mh)throw mh=0,c_=null,Error(n(185));qt(a,p,w),((Wt&2)===0||a!==Ir)&&(a===Ir&&((Wt&2)===0&&(u0|=p),br===4&&cl(a,Ur)),Ds(a,w),p===1&&Wt===0&&(c.mode&1)===0&&(Qu=an()+500,Um&&nl()))}function Ds(a,c){var p=a.callbackNode;Be(a,c);var w=me(a,a===Ir?Ur:0);if(w===0)p!==null&&dc(p),a.callbackNode=null,a.callbackPriority=0;else if(c=w&-w,a.callbackPriority!==c){if(p!=null&&dc(p),c===1)a.tag===0?Yj(NC.bind(null,a)):w6(NC.bind(null,a)),Wj(function(){(Wt&6)===0&&nl()}),p=null;else{switch(Rr(w)){case 1:p=si;break;case 4:p=wo;break;case 16:p=Vr;break;case 536870912:p=hc;break;default:p=Vr}p=UC(p,LC.bind(null,a))}a.callbackPriority=c,a.callbackNode=p}}function LC(a,c){if(p0=-1,m0=0,(Wt&6)!==0)throw Error(n(327));var p=a.callbackNode;if(Ju()&&a.callbackNode!==p)return null;var w=me(a,a===Ir?Ur:0);if(w===0)return null;if((w&30)!==0||(w&a.expiredLanes)!==0||c)c=g0(a,w);else{c=w;var k=Wt;Wt|=2;var P=$C();(Ir!==a||Ur!==c)&&(fa=null,Qu=an()+500,kc(a,c));do try{v7();break}catch(U){DC(a,U)}while(!0);P1(),c0.current=P,Wt=k,lr!==null?c=0:(Ir=null,Ur=0,c=br)}if(c!==0){if(c===2&&(k=vt(a),k!==0&&(w=k,c=u_(a,k))),c===1)throw p=hh,kc(a,0),cl(a,w),Ds(a,an()),p;if(c===6)cl(a,w);else{if(k=a.current.alternate,(w&30)===0&&!m7(k)&&(c=g0(a,w),c===2&&(P=vt(a),P!==0&&(w=P,c=u_(a,P))),c===1))throw p=hh,kc(a,0),cl(a,w),Ds(a,an()),p;switch(a.finishedWork=k,a.finishedLanes=w,c){case 0:case 1:throw Error(n(345));case 2:Ec(a,Ns,fa);break;case 3:if(cl(a,w),(w&130023424)===w&&(c=a_+500-an(),10<c)){if(me(a,0)!==0)break;if(k=a.suspendedLanes,(k&w)!==w){_s(),a.pingedLanes|=a.suspendedLanes&k;break}a.timeoutHandle=g1(Ec.bind(null,a,Ns,fa),c);break}Ec(a,Ns,fa);break;case 4:if(cl(a,w),(w&4194240)===w)break;for(c=a.eventTimes,k=-1;0<w;){var M=31-gs(w);P=1<<M,M=c[M],M>k&&(k=M),w&=~P}if(w=k,w=an()-w,w=(120>w?120:480>w?480:1080>w?1080:1920>w?1920:3e3>w?3e3:4320>w?4320:1960*p7(w/1960))-w,10<w){a.timeoutHandle=g1(Ec.bind(null,a,Ns,fa),w);break}Ec(a,Ns,fa);break;case 5:Ec(a,Ns,fa);break;default:throw Error(n(329))}}}return Ds(a,an()),a.callbackNode===p?LC.bind(null,a):null}function u_(a,c){var p=ph;return a.current.memoizedState.isDehydrated&&(kc(a,c).flags|=256),a=g0(a,c),a!==2&&(c=Ns,Ns=p,c!==null&&d_(c)),a}function d_(a){Ns===null?Ns=a:Ns.push.apply(Ns,a)}function m7(a){for(var c=a;;){if(c.flags&16384){var p=c.updateQueue;if(p!==null&&(p=p.stores,p!==null))for(var w=0;w<p.length;w++){var k=p[w],P=k.getSnapshot;k=k.value;try{if(!Yi(P(),k))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 cl(a,c){for(c&=~o_,c&=~u0,a.suspendedLanes|=c,a.pingedLanes&=~c,a=a.expirationTimes;0<c;){var p=31-gs(c),w=1<<p;a[p]=-1,c&=~w}}function NC(a){if((Wt&6)!==0)throw Error(n(327));Ju();var c=me(a,0);if((c&1)===0)return Ds(a,an()),null;var p=g0(a,c);if(a.tag!==0&&p===2){var w=vt(a);w!==0&&(c=w,p=u_(a,w))}if(p===1)throw p=hh,kc(a,0),cl(a,c),Ds(a,an()),p;if(p===6)throw Error(n(345));return a.finishedWork=a.current.alternate,a.finishedLanes=c,Ec(a,Ns,fa),Ds(a,an()),null}function f_(a,c){var p=Wt;Wt|=1;try{return a(c)}finally{Wt=p,Wt===0&&(Qu=an()+500,Um&&nl())}}function Sc(a){al!==null&&al.tag===0&&(Wt&6)===0&&Ju();var c=Wt;Wt|=1;var p=Mi.transition,w=it;try{if(Mi.transition=null,it=1,a)return a()}finally{it=w,Mi.transition=p,Wt=c,(Wt&6)===0&&nl()}}function h_(){li=Xu.current,Pn(Xu)}function kc(a,c){a.finishedWork=null,a.finishedLanes=0;var p=a.timeoutHandle;if(p!==-1&&(a.timeoutHandle=-1,Bj(p)),lr!==null)for(p=lr.return;p!==null;){var w=p;switch(x1(w),w.tag){case 1:w=w.type.childContextTypes,w!=null&&Vm();break;case 3:Gu(),Pn(Os),Pn(ns),N1();break;case 5:M1(w);break;case 4:Gu();break;case 13:Pn(jn);break;case 19:Pn(jn);break;case 10:T1(w.type._context);break;case 22:case 23:h_()}p=p.return}if(Ir=a,lr=a=ul(a.current,null),Ur=li=c,br=0,hh=null,o_=u0=xc=0,Ns=ph=null,_c!==null){for(c=0;c<_c.length;c++)if(p=_c[c],w=p.interleaved,w!==null){p.interleaved=null;var k=w.next,P=p.pending;if(P!==null){var M=P.next;P.next=k,w.next=M}p.pending=w}_c=null}return a}function DC(a,c){do{var p=lr;try{if(P1(),Jm.current=r0,e0){for(var w=zn.memoizedState;w!==null;){var k=w.queue;k!==null&&(k.pending=null),w=w.next}e0=!1}if(bc=0,Ar=wr=zn=null,ah=!1,lh=0,i_.current=null,p===null||p.return===null){br=1,hh=c,lr=null;break}e:{var P=a,M=p.return,U=p,G=c;if(c=Ur,U.flags|=32768,G!==null&&typeof G=="object"&&typeof G.then=="function"){var se=G,_e=U,we=_e.tag;if((_e.mode&1)===0&&(we===0||we===11||we===15)){var ye=_e.alternate;ye?(_e.updateQueue=ye.updateQueue,_e.memoizedState=ye.memoizedState,_e.lanes=ye.lanes):(_e.updateQueue=null,_e.memoizedState=null)}var Fe=aC(M);if(Fe!==null){Fe.flags&=-257,lC(Fe,M,U,P,c),Fe.mode&1&&oC(P,se,c),c=Fe,G=se;var Ke=c.updateQueue;if(Ke===null){var qe=new Set;qe.add(G),c.updateQueue=qe}else Ke.add(G);break e}else{if((c&1)===0){oC(P,se,c),p_();break e}G=Error(n(426))}}else if(Mn&&U.mode&1){var sr=aC(M);if(sr!==null){(sr.flags&65536)===0&&(sr.flags|=256),lC(sr,M,U,P,c),E1(qu(G,U));break e}}P=G=qu(G,U),br!==4&&(br=2),ph===null?ph=[P]:ph.push(P),P=M;do{switch(P.tag){case 3:P.flags|=65536,c&=-c,P.lanes|=c;var ee=sC(P,G,c);I6(P,ee);break e;case 1:U=G;var Q=P.type,ne=P.stateNode;if((P.flags&128)===0&&(typeof Q.getDerivedStateFromError=="function"||ne!==null&&typeof ne.componentDidCatch=="function"&&(ol===null||!ol.has(ne)))){P.flags|=65536,c&=-c,P.lanes|=c;var Ce=iC(P,U,c);I6(P,Ce);break e}}P=P.return}while(P!==null)}jC(p)}catch(Je){c=Je,lr===p&&p!==null&&(lr=p=p.return);continue}break}while(!0)}function $C(){var a=c0.current;return c0.current=r0,a===null?r0:a}function p_(){(br===0||br===3||br===2)&&(br=4),Ir===null||(xc&268435455)===0&&(u0&268435455)===0||cl(Ir,Ur)}function g0(a,c){var p=Wt;Wt|=2;var w=$C();(Ir!==a||Ur!==c)&&(fa=null,kc(a,c));do try{g7();break}catch(k){DC(a,k)}while(!0);if(P1(),Wt=p,c0.current=w,lr!==null)throw Error(n(261));return Ir=null,Ur=0,br}function g7(){for(;lr!==null;)FC(lr)}function v7(){for(;lr!==null&&!Tu();)FC(lr)}function FC(a){var c=HC(a.alternate,a,li);a.memoizedProps=a.pendingProps,c===null?jC(a):lr=c,i_.current=null}function jC(a){var c=a;do{var p=c.alternate;if(a=c.return,(c.flags&32768)===0){if(p=c7(p,c,li),p!==null){lr=p;return}}else{if(p=u7(p,c),p!==null){p.flags&=32767,lr=p;return}if(a!==null)a.flags|=32768,a.subtreeFlags=0,a.deletions=null;else{br=6,lr=null;return}}if(c=c.sibling,c!==null){lr=c;return}lr=c=a}while(c!==null);br===0&&(br=5)}function Ec(a,c,p){var w=it,k=Mi.transition;try{Mi.transition=null,it=1,y7(a,c,p,w)}finally{Mi.transition=k,it=w}return null}function y7(a,c,p,w){do Ju();while(al!==null);if((Wt&6)!==0)throw Error(n(327));p=a.finishedWork;var k=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(yt(a,P),a===Ir&&(lr=Ir=null,Ur=0),(p.subtreeFlags&2064)===0&&(p.flags&2064)===0||f0||(f0=!0,UC(Vr,function(){return Ju(),null})),P=(p.flags&15990)!==0,(p.subtreeFlags&15990)!==0||P){P=Mi.transition,Mi.transition=null;var M=it;it=1;var U=Wt;Wt|=4,i_.current=null,f7(a,p),RC(p,a),Fj(p1),Pm=!!h1,p1=h1=null,a.current=p,h7(p),qa(),Wt=U,it=M,Mi.transition=P}else a.current=p;if(f0&&(f0=!1,al=a,h0=k),P=a.pendingLanes,P===0&&(ol=null),Ru(p.stateNode),Ds(a,an()),c!==null)for(w=a.onRecoverableError,p=0;p<c.length;p++)k=c[p],w(k.value,{componentStack:k.stack,digest:k.digest});if(d0)throw d0=!1,a=l_,l_=null,a;return(h0&1)!==0&&a.tag!==0&&Ju(),P=a.pendingLanes,(P&1)!==0?a===c_?mh++:(mh=0,c_=a):mh=0,nl(),null}function Ju(){if(al!==null){var a=Rr(h0),c=Mi.transition,p=it;try{if(Mi.transition=null,it=16>a?16:a,al===null)var w=!1;else{if(a=al,al=null,h0=0,(Wt&6)!==0)throw Error(n(331));var k=Wt;for(Wt|=4,Ue=a.current;Ue!==null;){var P=Ue,M=P.child;if((Ue.flags&16)!==0){var U=P.deletions;if(U!==null){for(var G=0;G<U.length;G++){var se=U[G];for(Ue=se;Ue!==null;){var _e=Ue;switch(_e.tag){case 0:case 11:case 15:fh(8,_e,P)}var we=_e.child;if(we!==null)we.return=_e,Ue=we;else for(;Ue!==null;){_e=Ue;var ye=_e.sibling,Fe=_e.return;if(kC(_e),_e===se){Ue=null;break}if(ye!==null){ye.return=Fe,Ue=ye;break}Ue=Fe}}}var Ke=P.alternate;if(Ke!==null){var qe=Ke.child;if(qe!==null){Ke.child=null;do{var sr=qe.sibling;qe.sibling=null,qe=sr}while(qe!==null)}}Ue=P}}if((P.subtreeFlags&2064)!==0&&M!==null)M.return=P,Ue=M;else e:for(;Ue!==null;){if(P=Ue,(P.flags&2048)!==0)switch(P.tag){case 0:case 11:case 15:fh(9,P,P.return)}var ee=P.sibling;if(ee!==null){ee.return=P.return,Ue=ee;break e}Ue=P.return}}var Q=a.current;for(Ue=Q;Ue!==null;){M=Ue;var ne=M.child;if((M.subtreeFlags&2064)!==0&&ne!==null)ne.return=M,Ue=ne;else e:for(M=Q;Ue!==null;){if(U=Ue,(U.flags&2048)!==0)try{switch(U.tag){case 0:case 11:case 15:l0(9,U)}}catch(Je){Jn(U,U.return,Je)}if(U===M){Ue=null;break e}var Ce=U.sibling;if(Ce!==null){Ce.return=U.return,Ue=Ce;break e}Ue=U.return}}if(Wt=k,nl(),es&&typeof es.onPostCommitFiberRoot=="function")try{es.onPostCommitFiberRoot(ra,a)}catch{}w=!0}return w}finally{it=p,Mi.transition=c}}return!1}function zC(a,c,p){c=qu(p,c),c=sC(a,c,1),a=sl(a,c,1),c=_s(),a!==null&&(qt(a,1,c),Ds(a,c))}function Jn(a,c,p){if(a.tag===3)zC(a,a,p);else for(;c!==null;){if(c.tag===3){zC(c,a,p);break}else if(c.tag===1){var w=c.stateNode;if(typeof c.type.getDerivedStateFromError=="function"||typeof w.componentDidCatch=="function"&&(ol===null||!ol.has(w))){a=qu(p,a),a=iC(c,a,1),c=sl(c,a,1),a=_s(),c!==null&&(qt(c,1,a),Ds(c,a));break}}c=c.return}}function _7(a,c,p){var w=a.pingCache;w!==null&&w.delete(c),c=_s(),a.pingedLanes|=a.suspendedLanes&p,Ir===a&&(Ur&p)===p&&(br===4||br===3&&(Ur&130023424)===Ur&&500>an()-a_?kc(a,0):o_|=p),Ds(a,c)}function VC(a,c){c===0&&((a.mode&1)===0?c=1:(c=D,D<<=1,(D&130023424)===0&&(D=4194304)));var p=_s();a=ca(a,c),a!==null&&(qt(a,c,p),Ds(a,p))}function w7(a){var c=a.memoizedState,p=0;c!==null&&(p=c.retryLane),VC(a,p)}function b7(a,c){var p=0;switch(a.tag){case 13:var w=a.stateNode,k=a.memoizedState;k!==null&&(p=k.retryLane);break;case 19:w=a.stateNode;break;default:throw Error(n(314))}w!==null&&w.delete(c),VC(a,p)}var HC;HC=function(a,c,p){if(a!==null)if(a.memoizedProps!==c.pendingProps||Os.current)Ls=!0;else{if((a.lanes&p)===0&&(c.flags&128)===0)return Ls=!1,l7(a,c,p);Ls=(a.flags&131072)!==0}else Ls=!1,Mn&&(c.flags&1048576)!==0&&b6(c,Bm,c.index);switch(c.lanes=0,c.tag){case 2:var w=c.type;o0(a,c),a=c.pendingProps;var k=Vu(c,ns.current);Ku(c,p),k=F1(null,c,w,a,k,p);var P=j1();return c.flags|=1,typeof k=="object"&&k!==null&&typeof k.render=="function"&&k.$$typeof===void 0?(c.tag=1,c.memoizedState=null,c.updateQueue=null,Ms(w)?(P=!0,Hm(c)):P=!1,c.memoizedState=k.state!==null&&k.state!==void 0?k.state:null,I1(c),k.updater=s0,c.stateNode=k,k._reactInternals=c,B1(c,w,a,p),c=q1(null,c,w,!0,P,p)):(c.tag=0,Mn&&P&&b1(c),ys(null,c,k,p),c=c.child),c;case 16:w=c.elementType;e:{switch(o0(a,c),a=c.pendingProps,k=w._init,w=k(w._payload),c.type=w,k=c.tag=S7(w),a=Qi(w,a),k){case 0:c=G1(null,c,w,a,p);break e;case 1:c=pC(null,c,w,a,p);break e;case 11:c=cC(null,c,w,a,p);break e;case 14:c=uC(null,c,w,Qi(w.type,a),p);break e}throw Error(n(306,w,""))}return c;case 0:return w=c.type,k=c.pendingProps,k=c.elementType===w?k:Qi(w,k),G1(a,c,w,k,p);case 1:return w=c.type,k=c.pendingProps,k=c.elementType===w?k:Qi(w,k),pC(a,c,w,k,p);case 3:e:{if(mC(c),a===null)throw Error(n(387));w=c.pendingProps,P=c.memoizedState,k=P.element,A6(a,c),Xm(c,w,null,p);var M=c.memoizedState;if(w=M.element,P.isDehydrated)if(P={element:w,isDehydrated:!1,cache:M.cache,pendingSuspenseBoundaries:M.pendingSuspenseBoundaries,transitions:M.transitions},c.updateQueue.baseState=P,c.memoizedState=P,c.flags&256){k=qu(Error(n(423)),c),c=gC(a,c,w,p,k);break e}else if(w!==k){k=qu(Error(n(424)),c),c=gC(a,c,w,p,k);break e}else for(ai=Ja(c.stateNode.containerInfo.firstChild),oi=c,Mn=!0,Xi=null,p=T6(c,null,w,p),c.child=p;p;)p.flags=p.flags&-3|4096,p=p.sibling;else{if(Zu(),w===k){c=da(a,c,p);break e}ys(a,c,w,p)}c=c.child}return c;case 5:return M6(c),a===null&&k1(c),w=c.type,k=c.pendingProps,P=a!==null?a.memoizedProps:null,M=k.children,m1(w,k)?M=null:P!==null&&m1(w,P)&&(c.flags|=32),hC(a,c),ys(a,c,M,p),c.child;case 6:return a===null&&k1(c),null;case 13:return vC(a,c,p);case 4:return O1(c,c.stateNode.containerInfo),w=c.pendingProps,a===null?c.child=Bu(c,null,w,p):ys(a,c,w,p),c.child;case 11:return w=c.type,k=c.pendingProps,k=c.elementType===w?k:Qi(w,k),cC(a,c,w,k,p);case 7:return ys(a,c,c.pendingProps,p),c.child;case 8:return ys(a,c,c.pendingProps.children,p),c.child;case 12:return ys(a,c,c.pendingProps.children,p),c.child;case 10:e:{if(w=c.type._context,k=c.pendingProps,P=c.memoizedProps,M=k.value,kn(Gm,w._currentValue),w._currentValue=M,P!==null)if(Yi(P.value,M)){if(P.children===k.children&&!Os.current){c=da(a,c,p);break e}}else for(P=c.child,P!==null&&(P.return=c);P!==null;){var U=P.dependencies;if(U!==null){M=P.child;for(var G=U.firstContext;G!==null;){if(G.context===w){if(P.tag===1){G=ua(-1,p&-p),G.tag=2;var se=P.updateQueue;if(se!==null){se=se.shared;var _e=se.pending;_e===null?G.next=G:(G.next=_e.next,_e.next=G),se.pending=G}}P.lanes|=p,G=P.alternate,G!==null&&(G.lanes|=p),R1(P.return,p,c),U.lanes|=p;break}G=G.next}}else if(P.tag===10)M=P.type===c.type?null:P.child;else if(P.tag===18){if(M=P.return,M===null)throw Error(n(341));M.lanes|=p,U=M.alternate,U!==null&&(U.lanes|=p),R1(M,p,c),M=P.sibling}else M=P.child;if(M!==null)M.return=P;else for(M=P;M!==null;){if(M===c){M=null;break}if(P=M.sibling,P!==null){P.return=M.return,M=P;break}M=M.return}P=M}ys(a,c,k.children,p),c=c.child}return c;case 9:return k=c.type,w=c.pendingProps.children,Ku(c,p),k=Ii(k),w=w(k),c.flags|=1,ys(a,c,w,p),c.child;case 14:return w=c.type,k=Qi(w,c.pendingProps),k=Qi(w.type,k),uC(a,c,w,k,p);case 15:return dC(a,c,c.type,c.pendingProps,p);case 17:return w=c.type,k=c.pendingProps,k=c.elementType===w?k:Qi(w,k),o0(a,c),c.tag=1,Ms(w)?(a=!0,Hm(c)):a=!1,Ku(c,p),nC(c,w,k),B1(c,w,k,p),q1(null,c,w,!0,a,p);case 19:return _C(a,c,p);case 22:return fC(a,c,p)}throw Error(n(156,c.tag))};function UC(a,c){return ri(a,c)}function x7(a,c,p,w){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=w,this.subtreeFlags=this.flags=0,this.deletions=null,this.childLanes=this.lanes=0,this.alternate=null}function Li(a,c,p,w){return new x7(a,c,p,w)}function m_(a){return a=a.prototype,!(!a||!a.isReactComponent)}function S7(a){if(typeof a=="function")return m_(a)?1:0;if(a!=null){if(a=a.$$typeof,a===$)return 11;if(a===z)return 14}return 2}function ul(a,c){var p=a.alternate;return p===null?(p=Li(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 v0(a,c,p,w,k,P){var M=2;if(w=a,typeof a=="function")m_(a)&&(M=1);else if(typeof a=="string")M=5;else e:switch(a){case I:return Cc(p.children,k,P,c);case A:M=8,k|=8;break;case L:return a=Li(12,p,c,k|2),a.elementType=L,a.lanes=P,a;case W:return a=Li(13,p,c,k),a.elementType=W,a.lanes=P,a;case X:return a=Li(19,p,c,k),a.elementType=X,a.lanes=P,a;case te:return y0(p,k,P,c);default:if(typeof a=="object"&&a!==null)switch(a.$$typeof){case N:M=10;break e;case H:M=9;break e;case $:M=11;break e;case z:M=14;break e;case K:M=16,w=null;break e}throw Error(n(130,a==null?a:typeof a,""))}return c=Li(M,p,c,k),c.elementType=a,c.type=w,c.lanes=P,c}function Cc(a,c,p,w){return a=Li(7,a,w,c),a.lanes=p,a}function y0(a,c,p,w){return a=Li(22,a,w,c),a.elementType=te,a.lanes=p,a.stateNode={isHidden:!1},a}function g_(a,c,p){return a=Li(6,a,null,c),a.lanes=p,a}function v_(a,c,p){return c=Li(4,a.children!==null?a.children:[],a.key,c),c.lanes=p,c.stateNode={containerInfo:a.containerInfo,pendingChildren:null,implementation:a.implementation},c}function k7(a,c,p,w,k){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=$t(0),this.expirationTimes=$t(-1),this.entangledLanes=this.finishedLanes=this.mutableReadLanes=this.expiredLanes=this.pingedLanes=this.suspendedLanes=this.pendingLanes=0,this.entanglements=$t(0),this.identifierPrefix=w,this.onRecoverableError=k,this.mutableSourceEagerHydrationData=null}function y_(a,c,p,w,k,P,M,U,G){return a=new k7(a,c,p,U,G),c===1?(c=1,P===!0&&(c|=8)):c=0,P=Li(3,null,null,c),a.current=P,P.stateNode=a,P.memoizedState={element:w,isDehydrated:p,cache:null,transitions:null,pendingSuspenseBoundaries:null},I1(P),a}function E7(a,c,p){var w=3<arguments.length&&arguments[3]!==void 0?arguments[3]:null;return{$$typeof:O,key:w==null?null:""+w,children:a,containerInfo:c,implementation:p}}function ZC(a){if(!a)return tl;a=a._reactInternals;e:{if(Tr(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(Ms(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(Ms(p))return y6(a,p,c)}return c}function BC(a,c,p,w,k,P,M,U,G){return a=y_(p,w,!0,a,k,P,M,U,G),a.context=ZC(null),p=a.current,w=_s(),k=ll(p),P=ua(w,k),P.callback=c??null,sl(p,P,k),a.current.lanes=k,qt(a,k,w),Ds(a,w),a}function _0(a,c,p,w){var k=c.current,P=_s(),M=ll(k);return p=ZC(p),c.context===null?c.context=p:c.pendingContext=p,c=ua(P,M),c.payload={element:a},w=w===void 0?null:w,w!==null&&(c.callback=w),a=sl(k,c,M),a!==null&&(to(a,k,M,P),Ym(a,k,M)),M}function w0(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 WC(a,c){if(a=a.memoizedState,a!==null&&a.dehydrated!==null){var p=a.retryLane;a.retryLane=p!==0&&p<c?p:c}}function __(a,c){WC(a,c),(a=a.alternate)&&WC(a,c)}function C7(){return null}var KC=typeof reportError=="function"?reportError:function(a){console.error(a)};function w_(a){this._internalRoot=a}b0.prototype.render=w_.prototype.render=function(a){var c=this._internalRoot;if(c===null)throw Error(n(409));_0(a,c,null,null)},b0.prototype.unmount=w_.prototype.unmount=function(){var a=this._internalRoot;if(a!==null){this._internalRoot=null;var c=a.containerInfo;Sc(function(){_0(null,a,null,null)}),c[ia]=null}};function b0(a){this._internalRoot=a}b0.prototype.unstable_scheduleHydration=function(a){if(a){var c=sa();a={blockedOn:null,target:a,priority:c};for(var p=0;p<Le.length&&c!==0&&c<Le[p].priority;p++);Le.splice(p,0,a),p===0&&ts(a)}};function b_(a){return!(!a||a.nodeType!==1&&a.nodeType!==9&&a.nodeType!==11)}function x0(a){return!(!a||a.nodeType!==1&&a.nodeType!==9&&a.nodeType!==11&&(a.nodeType!==8||a.nodeValue!==" react-mount-point-unstable "))}function GC(){}function P7(a,c,p,w,k){if(k){if(typeof w=="function"){var P=w;w=function(){var se=w0(M);P.call(se)}}var M=BC(c,w,a,0,null,!1,!1,"",GC);return a._reactRootContainer=M,a[ia]=M.current,Jf(a.nodeType===8?a.parentNode:a),Sc(),M}for(;k=a.lastChild;)a.removeChild(k);if(typeof w=="function"){var U=w;w=function(){var se=w0(G);U.call(se)}}var G=y_(a,0,!1,null,null,!1,!1,"",GC);return a._reactRootContainer=G,a[ia]=G.current,Jf(a.nodeType===8?a.parentNode:a),Sc(function(){_0(c,G,p,w)}),G}function S0(a,c,p,w,k){var P=p._reactRootContainer;if(P){var M=P;if(typeof k=="function"){var U=k;k=function(){var G=w0(M);U.call(G)}}_0(c,M,a,k)}else M=P7(p,c,a,k,w);return w0(M)}Ya=function(a){switch(a.tag){case 3:var c=a.stateNode;if(c.current.memoizedState.isDehydrated){var p=de(c.pendingLanes);p!==0&&(On(c,p|1),Ds(c,an()),(Wt&6)===0&&(Qu=an()+500,nl()))}break;case 13:Sc(function(){var w=ca(a,1);if(w!==null){var k=_s();to(w,a,1,k)}}),__(a,1)}},So=function(a){if(a.tag===13){var c=ca(a,134217728);if(c!==null){var p=_s();to(c,a,134217728,p)}__(a,134217728)}},yr=function(a){if(a.tag===13){var c=ll(a),p=ca(a,c);if(p!==null){var w=_s();to(p,a,c,w)}__(a,c)}},sa=function(){return it},Iu=function(a,c){var p=it;try{return it=a,c()}finally{it=p}},zr=function(a,c,p){switch(c){case"input":if(Gt(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 w=p[c];if(w!==a&&w.form===a.form){var k=zm(w);if(!k)throw Error(n(90));$e(w),Gt(w,k)}}}break;case"textarea":be(a,p);break;case"select":c=p.value,c!=null&&Qe(a,!!p.multiple,c,!1)}},st=f_,sn=Sc;var T7={usingClientEntryPoint:!1,Events:[nh,ju,zm,rr,ms,f_]},gh={findFiberByHostInstance:mc,bundleType:0,version:"18.3.1",rendererPackageName:"react-dom"},R7={bundleType:gh.bundleType,version:gh.version,rendererPackageName:gh.rendererPackageName,rendererConfig:gh.rendererConfig,overrideHookState:null,overrideHookStateDeletePath:null,overrideHookStateRenamePath:null,overrideProps:null,overridePropsDeletePath:null,overridePropsRenamePath:null,setErrorHandler:null,setSuspenseHandler:null,scheduleUpdate:null,currentDispatcherRef:C.ReactCurrentDispatcher,findHostInstanceByFiber:function(a){return a=As(a),a===null?null:a.stateNode},findFiberByHostInstance:gh.findFiberByHostInstance||C7,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 k0=__REACT_DEVTOOLS_GLOBAL_HOOK__;if(!k0.isDisabled&&k0.supportsFiber)try{ra=k0.inject(R7),es=k0}catch{}}return $s.__SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED=T7,$s.createPortal=function(a,c){var p=2<arguments.length&&arguments[2]!==void 0?arguments[2]:null;if(!b_(c))throw Error(n(200));return E7(a,c,null,p)},$s.createRoot=function(a,c){if(!b_(a))throw Error(n(299));var p=!1,w="",k=KC;return c!=null&&(c.unstable_strictMode===!0&&(p=!0),c.identifierPrefix!==void 0&&(w=c.identifierPrefix),c.onRecoverableError!==void 0&&(k=c.onRecoverableError)),c=y_(a,1,!1,null,null,p,!1,w,k),a[ia]=c.current,Jf(a.nodeType===8?a.parentNode:a),new w_(c)},$s.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=As(c),a=a===null?null:a.stateNode,a},$s.flushSync=function(a){return Sc(a)},$s.hydrate=function(a,c,p){if(!x0(c))throw Error(n(200));return S0(null,a,c,!0,p)},$s.hydrateRoot=function(a,c,p){if(!b_(a))throw Error(n(405));var w=p!=null&&p.hydratedSources||null,k=!1,P="",M=KC;if(p!=null&&(p.unstable_strictMode===!0&&(k=!0),p.identifierPrefix!==void 0&&(P=p.identifierPrefix),p.onRecoverableError!==void 0&&(M=p.onRecoverableError)),c=BC(c,null,a,1,p??null,k,!1,P,M),a[ia]=c.current,Jf(a),w)for(a=0;a<w.length;a++)p=w[a],k=p._getVersion,k=k(p._source),c.mutableSourceEagerHydrationData==null?c.mutableSourceEagerHydrationData=[p,k]:c.mutableSourceEagerHydrationData.push(p,k);return new b0(c)},$s.render=function(a,c,p){if(!x0(c))throw Error(n(200));return S0(null,a,c,!1,p)},$s.unmountComponentAtNode=function(a){if(!x0(a))throw Error(n(40));return a._reactRootContainer?(Sc(function(){S0(null,null,a,!1,function(){a._reactRootContainer=null,a[ia]=null})}),!0):!1},$s.unstable_batchedUpdates=f_,$s.unstable_renderSubtreeIntoContainer=function(a,c,p,w){if(!x0(p))throw Error(n(200));if(a==null||a._reactInternals===void 0)throw Error(n(38));return S0(a,c,p,!1,w)},$s.version="18.3.1-next-f1338f8080-20240426",$s}var $A;function VD(){if($A)return Hw.exports;$A=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(),Hw.exports=Qne(),Hw.exports}var FA;function Jne(){if(FA)return Q0;FA=1;var t=VD();return Q0.createRoot=t.createRoot,Q0.hydrateRoot=t.hydrateRoot,Q0}var ere=Jne();const tre=iy(ere),nre=t=>{const e=t==null?void 0:t.userId,n=t==null?void 0:t.email;v.useEffect(()=>{H5({userId:e,email:n})},[e,n])},Aa={BASE_URL:"/",DEV:!1,MODE:"production",PROD:!0,SSR:!1,VITE_SENTRY_DSN:""};function HD(t){return"init"in t}function dx(t){return typeof t.write=="function"}function rre(t){return!!t.onMount}function jA(t){return"v"in t||"e"in t}function Dv(t){if("e"in t)throw t.e;if((Aa?"production":void 0)!=="production"&&!("v"in t))throw new Error("[Bug] atom state is not initialized");return t.v}function $v(t){return typeof(t==null?void 0:t.then)=="function"}function sre(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 UD(t,e,n){if(!n.p.has(t)){n.p.add(t);const r=()=>n.p.delete(t);e.then(r,r)}}function ZD(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 ire(t){return!!t.INTERNAL_onInit}const ore=(t,e,n,...r)=>n.read(...r),are=(t,e,n,...r)=>n.write(...r),lre=(t,e,n)=>n.INTERNAL_onInit(e),cre=(t,e,n,r)=>{var s;return(s=n.onMount)==null?void 0:s.call(n,r)},ure=(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),ire(n)&&l(t,e,n)}return i},dre=(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(m){d.push(m)}};do{l.f&&f(l.f);const h=new Set;for(const m of s){const g=(n=r.get(m))==null?void 0:n.l;if(g)for(const _ of g)h.add(_)}s.clear();for(const m of o)h.add(m);o.clear();for(const m of i)h.add(m);i.clear();for(const m of h)f(m);s.size&&u(t,e)}while(s.size||o.size||i.size);if(d.length)throw new AggregateError(d)},fre=(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,m=[],g=[];for(const _ of s)m.push(_),g.push(i(t,e,_));for(;m.length;){const _=m.length-1,y=m[_],b=g[_];if(h.has(y)){m.pop(),g.pop();continue}if(f.has(y)){if(r.get(y)===b.n)u.push(y),d.push(b);else if((Aa?"production":void 0)!=="production"&&r.has(y))throw new Error("[Bug] invalidated atom exists");h.add(y),m.pop(),g.pop();continue}f.add(y);for(const x of ZD(y,b,n))f.has(x)||(m.push(x),g.push(i(t,e,x)))}for(let _=u.length-1;_>=0;--_){const y=u[_],b=d[_];let x=!1;for(const S of b.d.keys())if(S!==y&&s.has(S)){x=!0;break}x&&(r.set(y,b.n),o(t,e,y),l(t,e,y)),r.delete(y)}},fx=new WeakSet,hre=(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],m=t[13],g=t[14],_=t[16],y=t[17],b=t[20],x=t[26],S=t[28],E=f(t,e,n),C=S[0];if(jA(E)){if(i.has(n)&&o.get(n)!==E.n||E.m===C)return E.m=C,E;let z=!1;for(const[K,te]of E.d)if(g(t,e,K).n!==te){z=!0;break}if(!z)return E.m=C,E}let R=!0;const O=new Set(E.d.keys()),I=()=>{for(const z of O)E.d.delete(z)},A=()=>{if(i.has(n)){const z=!l.size;y(t,e,n),z&&(m(t,e),h(t,e))}},L=z=>{var K;if(z===n){const Z=f(t,e,z);if(!jA(Z))if(HD(z))b(t,e,z,z.init);else throw new Error("no atom init");return Dv(Z)}const te=g(t,e,z);try{return Dv(te)}finally{O.delete(z),E.d.set(z,te.n),$v(E.v)&&UD(n,E.v,te),i.has(n)&&((K=i.get(z))==null||K.t.add(n)),R||A()}};let N,H;const $={get signal(){return N||(N=new AbortController),N.signal},get setSelf(){return(Aa?"production":void 0)!=="production"&&console.warn("[DEPRECATED] setSelf is deprecated and will be removed in v3."),(Aa?"production":void 0)!=="production"&&!dx(n)&&console.warn("setSelf function cannot be used with read-only atom"),!H&&dx(n)&&(H=(...z)=>{if((Aa?"production":void 0)!=="production"&&R&&console.warn("setSelf function cannot be called in sync"),!R)try{return _(t,e,n,z)}finally{m(t,e),h(t,e)}}),H}},W=E.n,X=o.get(n)===W;try{(Aa?"production":void 0)!=="production"&&fx.delete(e);const z=d(t,e,n,L,$);if((Aa?"production":void 0)!=="production"&&fx.has(e)&&console.warn("Detected store mutation during atom read. This is not supported."),b(t,e,n,z),$v(z)){x(t,e,z,()=>N==null?void 0:N.abort());const K=()=>{I(),A()};z.then(K,K)}else I();return(r=u.r)==null||r.call(u,n),E.m=C,E}catch(z){if(sre(z))throw z;return delete E.v,E.e=z,++E.n,E.m=C,E}finally{R=!1,E.n!==W&&X&&(o.set(n,E.n),l.add(n),(s=u.c)==null||s.call(u,n))}},pre=(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 ZD(l,u,r)){const f=i(t,e,d);s.get(d)!==f.n&&(s.set(d,f.n),o.push(d))}}},mre=(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],m=t[16],g=t[17],_=t[20],y=t[28];let b=!0;const x=E=>Dv(f(t,e,E)),S=(E,...C)=>{var R;const O=l(t,e,E);try{if(E===n){if(!HD(E))throw new Error("atom not writable");(Aa?"production":void 0)!=="production"&&fx.add(e);const I=O.n,A=C[0];_(t,e,E,A),g(t,e,E),I!==O.n&&(++y[0],s.add(E),h(t,e,E),(R=i.c)==null||R.call(i,E));return}else return m(t,e,E,C)}finally{b||(d(t,e),u(t,e))}};try{return o(t,e,n,x,S,...r)}finally{b=!1}},gre=(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),m=s.get(n);if(m&&h.d.size>0){for(const[g,_]of h.d)if(!m.d.has(g)){const y=l(t,e,g);d(t,e,g).t.add(n),m.d.add(g),_!==y.n&&(i.add(g),u(t,e,g),(r=o.c)==null||r.call(o,g))}for(const g of m.d)if(!h.d.has(g)){m.d.delete(g);const _=f(t,e,g);_==null||_.t.delete(n)}}},vre=(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],m=t[16],g=t[18],_=u(t,e,n);let y=s.get(n);if(!y){h(t,e,n);for(const b of _.d.keys())g(t,e,b).t.add(n);if(y={l:new Set,d:new Set(_.d.keys()),t:new Set},s.set(n,y),dx(n)&&rre(n)){const b=()=>{let x=!0;const S=(...E)=>{try{return m(t,e,n,E)}finally{x||(f(t,e),d(t,e))}};try{const E=l(t,e,n,S);E&&(y.u=()=>{x=!0;try{E()}finally{x=!1}})}finally{x=!1}};i.add(b)}(r=o.m)==null||r.call(o,n)}return y},yre=(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 m=!1;for(const g of h.t)if((r=i.get(g))!=null&&r.d.has(n)){m=!0;break}if(!m){h.u&&o.add(h.u),h=void 0,i.delete(n);for(const g of f.d.keys()){const _=d(t,e,g);_==null||_.t.delete(n)}(s=l.u)==null||s.call(l,n);return}return h},_re=(t,e,n,r)=>{const s=t[11],i=t[27],o=s(t,e,n),l="v"in o,u=o.v;if($v(r))for(const d of o.d.keys())UD(n,r,s(t,e,d));o.v=r,delete o.e,(!l||!Object.is(u,o.v))&&(++o.n,$v(u)&&i(t,e,u))},wre=(t,e,n)=>{const r=t[14];return Dv(r(t,e,n))},bre=(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))}},xre=(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)}},Sre=(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)},kre=(t,e,n)=>{const s=t[25].get(n);s==null||s.forEach(i=>i())},BD=new WeakMap;function Ere(t){const e=BD.get(t);if((Aa?"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 Cre(...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,{},ore,are,lre,cre,ure,dre,fre,hre,pre,mre,gre,vre,yre,_re,wre,bre,xre,void 0,new WeakMap,Sre,kre,[0]].map((o,l)=>t[l]||o);BD.set(e,Object.freeze(n));const r=n[21],s=n[22],i=n[23];return e}const WD={};let Pre=0;function dn(t,e){const n=`atom${++Pre}`,r={toString(){return(WD?"production":void 0)!=="production"&&this.debugLabel?n+":"+this.debugLabel:n}};return typeof t=="function"?r.read=t:(r.init=t,r.read=Tre,r.write=Rre),r}function Tre(t){return t(this)}function Rre(t,e,n){return e(this,typeof n=="function"?n(t(this)):n)}function Are(){return Cre()}let Oh;function Ire(){return Oh||(Oh=Are(),(WD?"production":void 0)!=="production"&&(globalThis.__JOTAI_DEFAULT_STORE__||(globalThis.__JOTAI_DEFAULT_STORE__=Oh),globalThis.__JOTAI_DEFAULT_STORE__!==Oh&&console.warn("Detected multiple Jotai instances. It may cause unexpected behavior with the default store. https://github.com/pmndrs/jotai/discussions/2044"))),Oh}const Ore={},Mre=v.createContext(void 0);function Ak(t){return v.useContext(Mre)||Ire()}const hx=t=>typeof(t==null?void 0:t.then)=="function",px=t=>{t.status||(t.status="pending",t.then(e=>{t.status="fulfilled",t.value=e},e=>{t.status="rejected",t.reason=e}))},Lre=Se.use||(t=>{if(t.status==="pending")throw t;if(t.status==="fulfilled")return t.value;throw t.status==="rejected"?t.reason:(px(t),t)}),Bw=new WeakMap,zA=(t,e,n)=>{const r=Ere(t),s=r[26];let i=Bw.get(e);return i||(i=new Promise((o,l)=>{let u=e;const d=m=>g=>{u===m&&o(g)},f=m=>g=>{u===m&&l(g)},h=()=>{try{const m=n();hx(m)?(Bw.set(m,i),u=m,m.then(d(m),f(m)),s(r,t,m,h)):o(m)}catch(m){l(m)}};e.then(d(e),f(e)),s(r,t,e,h)}),Bw.set(e,i)),i};function bt(t,e){const{delay:n,unstable_promiseStatus:r=!Se.use}={},s=Ak(),[[i,o,l],u]=v.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)),v.useEffect(()=>{const f=s.sub(t,()=>{if(r)try{const h=s.get(t);hx(h)&&px(zA(s,h,()=>s.get(t)))}catch{}if(typeof n=="number"){console.warn(`[DEPRECATED] delay option is deprecated and will be removed in v3.
109
-
110
- Migration guide:
111
-
112
- Create a custom hook like the following.
113
-
114
- function useAtomValueWithDelay<Value>(
115
- atom: Atom<Value>,
116
- options: { delay: number },
117
- ): Value {
118
- const { delay } = options
119
- const store = useStore(options)
120
- const [value, setValue] = useState(() => store.get(atom))
121
- useEffect(() => {
122
- const unsub = store.sub(atom, () => {
123
- setTimeout(() => setValue(store.get(atom)), delay)
124
- })
125
- return unsub
126
- }, [store, atom, delay])
127
- return value
128
- }
129
- `),setTimeout(u,n);return}u()});return u(),f},[s,t,n,r]),v.useDebugValue(d),hx(d)){const f=zA(s,d,()=>s.get(t));return r&&px(f),Lre(f)}return d}function Mt(t,e){const n=Ak();return v.useCallback((...s)=>{if((Ore?"production":void 0)!=="production"&&!("write"in t))throw new Error("not writable atom");return n.set(t,...s)},[n,t])}function KD(t,e){return[bt(t),Mt(t)]}var wm=VD();const Nre=iy(wm);function Dre(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 $re=t=>{switch(t){case"success":return zre;case"info":return Hre;case"warning":return Vre;case"error":return Ure;default:return null}},Fre=Array(12).fill(0),jre=({visible:t,className:e})=>Se.createElement("div",{className:["sonner-loading-wrapper",e].filter(Boolean).join(" "),"data-visible":t},Se.createElement("div",{className:"sonner-spinner"},Fre.map((n,r)=>Se.createElement("div",{className:"sonner-loading-bar",key:`spinner-bar-${r}`})))),zre=Se.createElement("svg",{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 20 20",fill:"currentColor",height:"20",width:"20","aria-hidden":"true"},Se.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"})),Vre=Se.createElement("svg",{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24",fill:"currentColor",height:"20",width:"20","aria-hidden":"true"},Se.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"})),Hre=Se.createElement("svg",{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 20 20",fill:"currentColor",height:"20",width:"20","aria-hidden":"true"},Se.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"})),Ure=Se.createElement("svg",{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 20 20",fill:"currentColor",height:"20",width:"20","aria-hidden":"true"},Se.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"})),Zre=Se.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"},Se.createElement("line",{x1:"18",y1:"6",x2:"6",y2:"18"}),Se.createElement("line",{x1:"6",y1:"6",x2:"18",y2:"18"})),Bre=()=>{const[t,e]=Se.useState(document.hidden);return Se.useEffect(()=>{const n=()=>{e(document.hidden)};return document.addEventListener("visibilitychange",n),()=>document.removeEventListener("visibilitychange",n)},[]),t};let Wre=1;const Kre=100,VA=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:Wre++};class Gre{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-Kre;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=VA(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],Se.isValidElement(d))i=!1,this.create({id:r,type:"default",message:d});else if(Yre(d)&&!d.ok){i=!1;const h=typeof n.error=="function"?await n.error(`HTTP error! status: ${d.status}`):n.error,m=typeof n.description=="function"?await n.description(`HTTP error! status: ${d.status}`):n.description,_=typeof h=="object"&&!Se.isValidElement(h)?h:{message:h};this.create({id:r,type:"error",description:m,..._})}else if(d instanceof Error){i=!1;const h=typeof n.error=="function"?await n.error(d):n.error,m=typeof n.description=="function"?await n.description(d):n.description,_=typeof h=="object"&&!Se.isValidElement(h)?h:{message:h};this.create({id:r,type:"error",description:m,..._})}else if(n.success!==void 0){i=!1;const h=typeof n.success=="function"?await n.success(d):n.success,m=typeof n.description=="function"?await n.description(d):n.description,_=typeof h=="object"&&!Se.isValidElement(h)?h:{message:h};this.create({id:r,type:"success",description:m,..._})}}).catch(async d=>{if(o=["reject",d],n.error!==void 0){i=!1;const f=typeof n.error=="function"?await n.error(d):n.error,h=typeof n.description=="function"?await n.description(d):n.description,g=typeof f=="object"&&!Se.isValidElement(f)?f:{message:f};this.create({id:r,type:"error",description:h,...g})}}).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=VA(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 Fs=new Gre,qre=(t,e)=>Fs.message(t,e),Yre=t=>t&&typeof t=="object"&&"ok"in t&&typeof t.ok=="boolean"&&"status"in t&&typeof t.status=="number",Xre=qre,Qre=()=>Fs.toasts,Jre=()=>Fs.getActiveToasts(),tn=Object.assign(Xre,{success:Fs.success,info:Fs.info,warning:Fs.warning,error:Fs.error,custom:Fs.custom,message:Fs.message,promise:Fs.promise,dismiss:Fs.dismiss,loading:Fs.loading},{getHistory:Qre,getToasts:Jre});Dre("[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 ese=3,tse="24px",nse="16px",HA=4e3,rse=356,sse=14,ise=45,ose=200;function Ao(...t){return t.filter(Boolean).join(" ")}function ase(t){const[e,n]=t.split("-"),r=[];return e&&r.push(e),n&&r.push(n),r}const lse=t=>{var e,n,r,s,i,o,l,u,d;const{invert:f,toast:h,unstyled:m,interacting:g,setHeights:_,visibleToasts:y,heights:b,index:x,toasts:S,expanded:E,removeToast:C,defaultRichColors:R,closeButton:O,style:I,cancelButtonStyle:A,actionButtonStyle:L,className:N="",descriptionClassName:H="",duration:$,position:W,gap:X,expandByDefault:z,classNames:K,icons:te,closeButtonAriaLabel:Z="Close toast"}=t,[J,q]=Se.useState(null),[j,Y]=Se.useState(null),[ue,ie]=Se.useState(!1),[ce,he]=Se.useState(!1),[ke,ve]=Se.useState(!1),[pe,Ne]=Se.useState(!1),[Ae,$e]=Se.useState(!1),[kt,fn]=Se.useState(0),[on,Et]=Se.useState(0),Gt=Se.useRef(h.duration||$||HA),vn=Se.useRef(null),Qt=Se.useRef(null),Me=x===0,Qe=x+1<=y,Te=h.type,St=Te??"default",be=h.dismissible!==!1,Nt=h.className||"",ft=h.descriptionClassName||"",pt=Se.useMemo(()=>b.findIndex(st=>st.toastId===h.id)||0,[b,h.id]),qn=Se.useMemo(()=>{var st;return(st=h.closeButton)!=null?st:O},[h.closeButton,O]),Ei=Se.useMemo(()=>h.duration||$||HA,[h.duration,$]),xn=Se.useRef(0),nr=Se.useRef(0),Gi=Se.useRef(0),ps=Se.useRef(null),[Xr,Yn]=W.split("-"),hn=Se.useMemo(()=>b.reduce((st,sn,Jt)=>Jt>=pt?st:st+sn.height,0),[b,pt]),Qr=Bre(),ar=Se.useMemo(()=>{var st;return(st=t.swipeDirections)!=null?st:ase(W)},[t.swipeDirections,W]),vo=h.invert||f,zr=Te==="loading";nr.current=Se.useMemo(()=>pt*X+hn,[pt,hn]),Se.useEffect(()=>{Gt.current=Ei},[Ei]),Se.useEffect(()=>{ie(!0)},[]),Se.useEffect(()=>{const st=Qt.current;if(st){const sn=st.getBoundingClientRect().height;return Et(sn),_(Jt=>[{toastId:h.id,height:sn,position:h.position},...Jt]),()=>_(Jt=>Jt.filter(pn=>pn.toastId!==h.id))}},[_,h.id]),Se.useLayoutEffect(()=>{if(!ue)return;const st=Qt.current,sn=st.style.height;st.style.height="auto";const Jt=st.getBoundingClientRect().height;st.style.height=sn,Et(Jt),_(pn=>pn.find(Bt=>Bt.toastId===h.id)?pn.map(Bt=>Bt.toastId===h.id?{...Bt,height:Jt}:Bt):[{toastId:h.id,height:Jt,position:h.position},...pn])},[ue,h.title,h.description,_,h.id,h.jsx,h.action,h.cancel]);const Xn=Se.useCallback(()=>{he(!0),fn(nr.current),_(st=>st.filter(sn=>sn.toastId!==h.id)),setTimeout(()=>{C(h)},ose)},[h,C,_,nr]);Se.useEffect(()=>{if(h.promise&&Te==="loading"||h.duration===1/0||h.type==="loading")return;let st;return E||g||Qr?(()=>{if(Gi.current<xn.current){const pn=new Date().getTime()-xn.current;Gt.current=Gt.current-pn}Gi.current=new Date().getTime()})():(()=>{Gt.current!==1/0&&(xn.current=new Date().getTime(),st=setTimeout(()=>{h.onAutoClose==null||h.onAutoClose.call(h,h),Xn()},Gt.current))})(),()=>clearTimeout(st)},[E,g,h,Te,Qr,Xn]),Se.useEffect(()=>{h.delete&&(Xn(),h.onDismiss==null||h.onDismiss.call(h,h))},[Xn,h.delete]);function Pr(){var st;if(te!=null&&te.loading){var sn;return Se.createElement("div",{className:Ao(K==null?void 0:K.loader,h==null||(sn=h.classNames)==null?void 0:sn.loader,"sonner-loader"),"data-visible":Te==="loading"},te.loading)}return Se.createElement(jre,{className:Ao(K==null?void 0:K.loader,h==null||(st=h.classNames)==null?void 0:st.loader),visible:Te==="loading"})}const ni=h.icon||(te==null?void 0:te[Te])||$re(Te);var rr,ms;return Se.createElement("li",{tabIndex:0,ref:Qt,className:Ao(N,Nt,K==null?void 0:K.toast,h==null||(e=h.classNames)==null?void 0:e.toast,K==null?void 0:K[St],h==null||(n=h.classNames)==null?void 0:n[St]),"data-sonner-toast":"","data-rich-colors":(rr=h.richColors)!=null?rr:R,"data-styled":!(h.jsx||h.unstyled||m),"data-mounted":ue,"data-promise":!!h.promise,"data-swiped":Ae,"data-removed":ce,"data-visible":Qe,"data-y-position":Xr,"data-x-position":Yn,"data-index":x,"data-front":Me,"data-swiping":ke,"data-dismissible":be,"data-type":Te,"data-invert":vo,"data-swipe-out":pe,"data-swipe-direction":j,"data-expanded":!!(E||z&&ue),"data-testid":h.testId,style:{"--index":x,"--toasts-before":x,"--z-index":S.length-x,"--offset":`${ce?kt:nr.current}px`,"--initial-height":z?"auto":`${on}px`,...I,...h.style},onDragEnd:()=>{ve(!1),q(null),ps.current=null},onPointerDown:st=>{st.button!==2&&(zr||!be||(vn.current=new Date,fn(nr.current),st.target.setPointerCapture(st.pointerId),st.target.tagName!=="BUTTON"&&(ve(!0),ps.current={x:st.clientX,y:st.clientY})))},onPointerUp:()=>{var st,sn,Jt;if(pe||!be)return;ps.current=null;const pn=Number(((st=Qt.current)==null?void 0:st.style.getPropertyValue("--swipe-amount-x").replace("px",""))||0),Sn=Number(((sn=Qt.current)==null?void 0:sn.style.getPropertyValue("--swipe-amount-y").replace("px",""))||0),Bt=new Date().getTime()-((Jt=vn.current)==null?void 0:Jt.getTime()),In=J==="x"?pn:Sn,Jr=Math.abs(In)/Bt;if((J==="x"?ar.includes(pn>0?"right":"left"):ar.includes(Sn>0?"bottom":"top"))&&(Math.abs(In)>=ise||Jr>.11)){fn(nr.current),h.onDismiss==null||h.onDismiss.call(h,h),Y(J==="x"?pn>0?"right":"left":Sn>0?"down":"up"),Xn(),Ne(!0);return}else{var vr,Vt;(vr=Qt.current)==null||vr.style.setProperty("--swipe-amount-x","0px"),(Vt=Qt.current)==null||Vt.style.setProperty("--swipe-amount-y","0px")}$e(!1),ve(!1),q(null)},onPointerMove:st=>{var sn,Jt,pn;if(!ps.current||!be||((sn=window.getSelection())==null?void 0:sn.toString().length)>0)return;const Bt=st.clientY-ps.current.y,In=st.clientX-ps.current.x;!J&&(Math.abs(In)>1||Math.abs(Bt)>1)&&q(Math.abs(In)>Math.abs(Bt)?"x":"y");let Jr={x:0,y:0};const Qn=vr=>1/(1.5+Math.abs(vr)/20);if(J==="y"){if(ar.includes("top")||ar.includes("bottom"))if(ar.includes("top")&&Bt<0||ar.includes("bottom")&&Bt>0)Jr.y=Bt;else{const vr=Bt*Qn(Bt);Jr.y=Math.abs(vr)<Math.abs(Bt)?vr:Bt}}else if(J==="x"&&(ar.includes("left")||ar.includes("right")))if(ar.includes("left")&&In<0||ar.includes("right")&&In>0)Jr.x=In;else{const vr=In*Qn(In);Jr.x=Math.abs(vr)<Math.abs(In)?vr:In}(Math.abs(Jr.x)>0||Math.abs(Jr.y)>0)&&$e(!0),(Jt=Qt.current)==null||Jt.style.setProperty("--swipe-amount-x",`${Jr.x}px`),(pn=Qt.current)==null||pn.style.setProperty("--swipe-amount-y",`${Jr.y}px`)}},qn&&!h.jsx&&Te!=="loading"?Se.createElement("button",{"aria-label":Z,"data-disabled":zr,"data-close-button":!0,onClick:zr||!be?()=>{}:()=>{Xn(),h.onDismiss==null||h.onDismiss.call(h,h)},className:Ao(K==null?void 0:K.closeButton,h==null||(r=h.classNames)==null?void 0:r.closeButton)},(ms=te==null?void 0:te.close)!=null?ms:Zre):null,(Te||h.icon||h.promise)&&h.icon!==null&&((te==null?void 0:te[Te])!==null||h.icon)?Se.createElement("div",{"data-icon":"",className:Ao(K==null?void 0:K.icon,h==null||(s=h.classNames)==null?void 0:s.icon)},Te==="loading"?h.icon||Pr():h.promise?Pr():null,Te!=="loading"?ni:null):null,Se.createElement("div",{"data-content":"",className:Ao(K==null?void 0:K.content,h==null||(i=h.classNames)==null?void 0:i.content)},Se.createElement("div",{"data-title":"",className:Ao(K==null?void 0:K.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?Se.createElement("div",{"data-description":"",className:Ao(H,ft,K==null?void 0:K.description,h==null||(l=h.classNames)==null?void 0:l.description)},typeof h.description=="function"?h.description():h.description):null),Se.isValidElement(h.cancel)?h.cancel:h.cancel&&J0(h.cancel)?Se.createElement("button",{"data-button":!0,"data-cancel":!0,style:h.cancelButtonStyle||A,onClick:st=>{J0(h.cancel)&&be&&(h.cancel.onClick==null||h.cancel.onClick.call(h.cancel,st),Xn())},className:Ao(K==null?void 0:K.cancelButton,h==null||(u=h.classNames)==null?void 0:u.cancelButton)},h.cancel.label):null,Se.isValidElement(h.action)?h.action:h.action&&J0(h.action)?Se.createElement("button",{"data-button":!0,"data-action":!0,style:h.actionButtonStyle||L,onClick:st=>{J0(h.action)&&(h.action.onClick==null||h.action.onClick.call(h.action,st),!st.defaultPrevented&&Xn())},className:Ao(K==null?void 0:K.actionButton,h==null||(d=h.classNames)==null?void 0:d.actionButton)},h.action.label):null)};function UA(){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 cse(t,e){const n={};return[t,e].forEach((r,s)=>{const i=s===1,o=i?"--mobile-offset":"--offset",l=i?nse:tse;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 use=Se.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:m="light",richColors:g,duration:_,style:y,visibleToasts:b=ese,toastOptions:x,dir:S=UA(),gap:E=sse,icons:C,customAriaLabel:R,containerAriaLabel:O="Notifications"}=e,[I,A]=Se.useState([]),L=Se.useMemo(()=>r?I.filter(ie=>ie.toasterId===r):I.filter(ie=>!ie.toasterId),[I,r]),N=Se.useMemo(()=>Array.from(new Set([i].concat(L.filter(ie=>ie.position).map(ie=>ie.position)))),[L,i]),[H,$]=Se.useState([]),[W,X]=Se.useState(!1),[z,K]=Se.useState(!1),[te,Z]=Se.useState(m!=="system"?m:typeof window<"u"&&window.matchMedia&&window.matchMedia("(prefers-color-scheme: dark)").matches?"dark":"light"),J=Se.useRef(null),q=o.join("+").replace(/Key/g,"").replace(/Digit/g,""),j=Se.useRef(null),Y=Se.useRef(!1),ue=Se.useCallback(ie=>{A(ce=>{var he;return(he=ce.find(ke=>ke.id===ie.id))!=null&&he.delete||Fs.dismiss(ie.id),ce.filter(({id:ke})=>ke!==ie.id)})},[]);return Se.useEffect(()=>Fs.subscribe(ie=>{if(ie.dismiss){requestAnimationFrame(()=>{A(ce=>ce.map(he=>he.id===ie.id?{...he,delete:!0}:he))});return}setTimeout(()=>{Nre.flushSync(()=>{A(ce=>{const he=ce.findIndex(ke=>ke.id===ie.id);return he!==-1?[...ce.slice(0,he),{...ce[he],...ie},...ce.slice(he+1)]:[ie,...ce]})})})}),[]),Se.useEffect(()=>{if(m!=="system"){Z(m);return}if(m==="system"&&(window.matchMedia&&window.matchMedia("(prefers-color-scheme: dark)").matches?Z("dark"):Z("light")),typeof window>"u")return;const ie=window.matchMedia("(prefers-color-scheme: dark)");try{ie.addEventListener("change",({matches:ce})=>{Z(ce?"dark":"light")})}catch{ie.addListener(({matches:he})=>{try{Z(he?"dark":"light")}catch(ke){console.error(ke)}})}},[m]),Se.useEffect(()=>{I.length<=1&&X(!1)},[I]),Se.useEffect(()=>{const ie=ce=>{var he;if(o.length>0&&o.every(pe=>ce[pe]||ce.code===pe)){var ve;X(!0),(ve=J.current)==null||ve.focus()}ce.code==="Escape"&&(document.activeElement===J.current||(he=J.current)!=null&&he.contains(document.activeElement))&&X(!1)};return document.addEventListener("keydown",ie),()=>document.removeEventListener("keydown",ie)},[o]),Se.useEffect(()=>{if(J.current)return()=>{j.current&&(j.current.focus({preventScroll:!0}),j.current=null,Y.current=!1)}},[J.current]),Se.createElement("section",{ref:n,"aria-label":R??`${O} ${q}`,tabIndex:-1,"aria-live":"polite","aria-relevant":"additions text","aria-atomic":"false",suppressHydrationWarning:!0,"data-react-aria-top-layer":!0},N.map((ie,ce)=>{var he;const[ke,ve]=ie.split("-");return L.length?Se.createElement("ol",{key:ie,dir:S==="auto"?UA():S,tabIndex:-1,ref:J,className:d,"data-sonner-toaster":!0,"data-sonner-theme":te,"data-y-position":ke,"data-x-position":ve,style:{"--front-toast-height":`${((he=H[0])==null?void 0:he.height)||0}px`,"--width":`${rse}px`,"--gap":`${E}px`,...y,...cse(f,h)},onBlur:pe=>{Y.current&&!pe.currentTarget.contains(pe.relatedTarget)&&(Y.current=!1,j.current&&(j.current.focus({preventScroll:!0}),j.current=null))},onFocus:pe=>{pe.target instanceof HTMLElement&&pe.target.dataset.dismissible==="false"||Y.current||(Y.current=!0,j.current=pe.relatedTarget)},onMouseEnter:()=>X(!0),onMouseMove:()=>X(!0),onMouseLeave:()=>{z||X(!1)},onDragEnd:()=>X(!1),onPointerDown:pe=>{pe.target instanceof HTMLElement&&pe.target.dataset.dismissible==="false"||K(!0)},onPointerUp:()=>K(!1)},L.filter(pe=>!pe.position&&ce===0||pe.position===ie).map((pe,Ne)=>{var Ae,$e;return Se.createElement(lse,{key:pe.id,icons:C,index:Ne,toast:pe,defaultRichColors:g,duration:(Ae=x==null?void 0:x.duration)!=null?Ae:_,className:x==null?void 0:x.className,descriptionClassName:x==null?void 0:x.descriptionClassName,invert:s,visibleToasts:b,closeButton:($e=x==null?void 0:x.closeButton)!=null?$e:u,interacting:z,position:ie,style:x==null?void 0:x.style,unstyled:x==null?void 0:x.unstyled,classNames:x==null?void 0:x.classNames,cancelButtonStyle:x==null?void 0:x.cancelButtonStyle,actionButtonStyle:x==null?void 0:x.actionButtonStyle,closeButtonAriaLabel:x==null?void 0:x.closeButtonAriaLabel,removeToast:ue,toasts:L.filter(kt=>kt.position==pe.position),heights:H.filter(kt=>kt.position==pe.position),setHeights:$,expandByDefault:l,gap:E,expanded:W,swipeDirections:e.swipeDirections})})):null}))}),dse=new Map([["bold",v.createElement(v.Fragment,null,v.createElement("path",{d:"M208.49,120.49a12,12,0,0,1-17,0L140,69V216a12,12,0,0,1-24,0V69L64.49,120.49a12,12,0,0,1-17-17l72-72a12,12,0,0,1,17,0l72,72A12,12,0,0,1,208.49,120.49Z"}))],["duotone",v.createElement(v.Fragment,null,v.createElement("path",{d:"M200,112H56l72-72Z",opacity:"0.2"}),v.createElement("path",{d:"M205.66,106.34l-72-72a8,8,0,0,0-11.32,0l-72,72A8,8,0,0,0,56,120h64v96a8,8,0,0,0,16,0V120h64a8,8,0,0,0,5.66-13.66ZM75.31,104,128,51.31,180.69,104Z"}))],["fill",v.createElement(v.Fragment,null,v.createElement("path",{d:"M207.39,115.06A8,8,0,0,1,200,120H136v96a8,8,0,0,1-16,0V120H56a8,8,0,0,1-5.66-13.66l72-72a8,8,0,0,1,11.32,0l72,72A8,8,0,0,1,207.39,115.06Z"}))],["light",v.createElement(v.Fragment,null,v.createElement("path",{d:"M204.24,116.24a6,6,0,0,1-8.48,0L134,54.49V216a6,6,0,0,1-12,0V54.49L60.24,116.24a6,6,0,0,1-8.48-8.48l72-72a6,6,0,0,1,8.48,0l72,72A6,6,0,0,1,204.24,116.24Z"}))],["regular",v.createElement(v.Fragment,null,v.createElement("path",{d:"M205.66,117.66a8,8,0,0,1-11.32,0L136,59.31V216a8,8,0,0,1-16,0V59.31L61.66,117.66a8,8,0,0,1-11.32-11.32l72-72a8,8,0,0,1,11.32,0l72,72A8,8,0,0,1,205.66,117.66Z"}))],["thin",v.createElement(v.Fragment,null,v.createElement("path",{d:"M202.83,114.83a4,4,0,0,1-5.66,0L132,49.66V216a4,4,0,0,1-8,0V49.66L58.83,114.83a4,4,0,0,1-5.66-5.66l72-72a4,4,0,0,1,5.66,0l72,72A4,4,0,0,1,202.83,114.83Z"}))]]),fse=new Map([["bold",v.createElement(v.Fragment,null,v.createElement("path",{d:"M216.49,104.49l-80,80a12,12,0,0,1-17,0l-80-80a12,12,0,0,1,17-17L128,159l71.51-71.52a12,12,0,0,1,17,17Z"}))],["duotone",v.createElement(v.Fragment,null,v.createElement("path",{d:"M208,96l-80,80L48,96Z",opacity:"0.2"}),v.createElement("path",{d:"M215.39,92.94A8,8,0,0,0,208,88H48a8,8,0,0,0-5.66,13.66l80,80a8,8,0,0,0,11.32,0l80-80A8,8,0,0,0,215.39,92.94ZM128,164.69,67.31,104H188.69Z"}))],["fill",v.createElement(v.Fragment,null,v.createElement("path",{d:"M213.66,101.66l-80,80a8,8,0,0,1-11.32,0l-80-80A8,8,0,0,1,48,88H208a8,8,0,0,1,5.66,13.66Z"}))],["light",v.createElement(v.Fragment,null,v.createElement("path",{d:"M212.24,100.24l-80,80a6,6,0,0,1-8.48,0l-80-80a6,6,0,0,1,8.48-8.48L128,167.51l75.76-75.75a6,6,0,0,1,8.48,8.48Z"}))],["regular",v.createElement(v.Fragment,null,v.createElement("path",{d:"M213.66,101.66l-80,80a8,8,0,0,1-11.32,0l-80-80A8,8,0,0,1,53.66,90.34L128,164.69l74.34-74.35a8,8,0,0,1,11.32,11.32Z"}))],["thin",v.createElement(v.Fragment,null,v.createElement("path",{d:"M210.83,98.83l-80,80a4,4,0,0,1-5.66,0l-80-80a4,4,0,0,1,5.66-5.66L128,170.34l77.17-77.17a4,4,0,1,1,5.66,5.66Z"}))]]),hse=new Map([["bold",v.createElement(v.Fragment,null,v.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",v.createElement(v.Fragment,null,v.createElement("path",{d:"M176,128,96,208V48Z",opacity:"0.2"}),v.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",v.createElement(v.Fragment,null,v.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",v.createElement(v.Fragment,null,v.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",v.createElement(v.Fragment,null,v.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",v.createElement(v.Fragment,null,v.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"}))]]),pse=new Map([["bold",v.createElement(v.Fragment,null,v.createElement("path",{d:"M128,20A108,108,0,0,0,31.85,177.23L21,209.66A20,20,0,0,0,46.34,235l32.43-10.81A108,108,0,1,0,128,20Zm0,192a84,84,0,0,1-42.06-11.27,12,12,0,0,0-6-1.62,12.1,12.1,0,0,0-3.8.62l-29.79,9.93,9.93-29.79a12,12,0,0,0-1-9.81A84,84,0,1,1,128,212Z"}))],["duotone",v.createElement(v.Fragment,null,v.createElement("path",{d:"M224,128A96,96,0,0,1,79.93,211.11h0L42.54,223.58a8,8,0,0,1-10.12-10.12l12.47-37.39h0A96,96,0,1,1,224,128Z",opacity:"0.2"}),v.createElement("path",{d:"M128,24A104,104,0,0,0,36.18,176.88L24.83,210.93a16,16,0,0,0,20.24,20.24l34.05-11.35A104,104,0,1,0,128,24Zm0,192a87.87,87.87,0,0,1-44.06-11.81,8,8,0,0,0-6.54-.67L40,216,52.47,178.6a8,8,0,0,0-.66-6.54A88,88,0,1,1,128,216Z"}))],["fill",v.createElement(v.Fragment,null,v.createElement("path",{d:"M232,128A104,104,0,0,1,79.12,219.82L45.07,231.17a16,16,0,0,1-20.24-20.24l11.35-34.05A104,104,0,1,1,232,128Z"}))],["light",v.createElement(v.Fragment,null,v.createElement("path",{d:"M128,26A102,102,0,0,0,38.35,176.69L26.73,211.56a14,14,0,0,0,17.71,17.71l34.87-11.62A102,102,0,1,0,128,26Zm0,192a90,90,0,0,1-45.06-12.08,6.09,6.09,0,0,0-3-.81,6.2,6.2,0,0,0-1.9.31L40.65,217.88a2,2,0,0,1-2.53-2.53L50.58,178a6,6,0,0,0-.5-4.91A90,90,0,1,1,128,218Z"}))],["regular",v.createElement(v.Fragment,null,v.createElement("path",{d:"M128,24A104,104,0,0,0,36.18,176.88L24.83,210.93a16,16,0,0,0,20.24,20.24l34.05-11.35A104,104,0,1,0,128,24Zm0,192a87.87,87.87,0,0,1-44.06-11.81,8,8,0,0,0-6.54-.67L40,216,52.47,178.6a8,8,0,0,0-.66-6.54A88,88,0,1,1,128,216Z"}))],["thin",v.createElement(v.Fragment,null,v.createElement("path",{d:"M128,28A100,100,0,0,0,40.53,176.5l-11.9,35.69a12,12,0,0,0,15.18,15.18l35.69-11.9A100,100,0,1,0,128,28Zm0,192a92,92,0,0,1-46.07-12.35,4.05,4.05,0,0,0-2-.54,3.93,3.93,0,0,0-1.27.21L41.28,219.78a4,4,0,0,1-5.06-5.06l12.46-37.38a4,4,0,0,0-.33-3.27A92,92,0,1,1,128,220Z"}))]]),mse=new Map([["bold",v.createElement(v.Fragment,null,v.createElement("path",{d:"M232.49,80.49l-128,128a12,12,0,0,1-17,0l-56-56a12,12,0,1,1,17-17L96,183,215.51,63.51a12,12,0,0,1,17,17Z"}))],["duotone",v.createElement(v.Fragment,null,v.createElement("path",{d:"M232,56V200a16,16,0,0,1-16,16H40a16,16,0,0,1-16-16V56A16,16,0,0,1,40,40H216A16,16,0,0,1,232,56Z",opacity:"0.2"}),v.createElement("path",{d:"M205.66,85.66l-96,96a8,8,0,0,1-11.32,0l-40-40a8,8,0,0,1,11.32-11.32L104,164.69l90.34-90.35a8,8,0,0,1,11.32,11.32Z"}))],["fill",v.createElement(v.Fragment,null,v.createElement("path",{d:"M216,40H40A16,16,0,0,0,24,56V200a16,16,0,0,0,16,16H216a16,16,0,0,0,16-16V56A16,16,0,0,0,216,40ZM205.66,85.66l-96,96a8,8,0,0,1-11.32,0l-40-40a8,8,0,0,1,11.32-11.32L104,164.69l90.34-90.35a8,8,0,0,1,11.32,11.32Z"}))],["light",v.createElement(v.Fragment,null,v.createElement("path",{d:"M228.24,76.24l-128,128a6,6,0,0,1-8.48,0l-56-56a6,6,0,0,1,8.48-8.48L96,191.51,219.76,67.76a6,6,0,0,1,8.48,8.48Z"}))],["regular",v.createElement(v.Fragment,null,v.createElement("path",{d:"M229.66,77.66l-128,128a8,8,0,0,1-11.32,0l-56-56a8,8,0,0,1,11.32-11.32L96,188.69,218.34,66.34a8,8,0,0,1,11.32,11.32Z"}))],["thin",v.createElement(v.Fragment,null,v.createElement("path",{d:"M226.83,74.83l-128,128a4,4,0,0,1-5.66,0l-56-56a4,4,0,0,1,5.66-5.66L96,194.34,221.17,69.17a4,4,0,1,1,5.66,5.66Z"}))]]),gse=new Map([["bold",v.createElement(v.Fragment,null,v.createElement("path",{d:"M236,128a108,108,0,0,1-216,0c0-42.52,24.73-81.34,63-98.9A12,12,0,1,1,93,50.91C63.24,64.57,44,94.83,44,128a84,84,0,0,0,168,0c0-33.17-19.24-63.43-49-77.09A12,12,0,1,1,173,29.1C211.27,46.66,236,85.48,236,128Z"}))],["duotone",v.createElement(v.Fragment,null,v.createElement("path",{d:"M224,128a96,96,0,1,1-96-96A96,96,0,0,1,224,128Z",opacity:"0.2"}),v.createElement("path",{d:"M232,128a104,104,0,0,1-208,0c0-41,23.81-78.36,60.66-95.27a8,8,0,0,1,6.68,14.54C60.15,61.59,40,93.27,40,128a88,88,0,0,0,176,0c0-34.73-20.15-66.41-51.34-80.73a8,8,0,0,1,6.68-14.54C208.19,49.64,232,87,232,128Z"}))],["fill",v.createElement(v.Fragment,null,v.createElement("path",{d:"M128,24A104,104,0,1,0,232,128,104.11,104.11,0,0,0,128,24Zm0,176A72,72,0,0,1,92,65.64a8,8,0,0,1,8,13.85,56,56,0,1,0,56,0,8,8,0,0,1,8-13.85A72,72,0,0,1,128,200Z"}))],["light",v.createElement(v.Fragment,null,v.createElement("path",{d:"M230,128a102,102,0,0,1-204,0c0-40.18,23.35-76.86,59.5-93.45a6,6,0,0,1,5,10.9C58.61,60.09,38,92.49,38,128a90,90,0,0,0,180,0c0-35.51-20.61-67.91-52.5-82.55a6,6,0,0,1,5-10.9C206.65,51.14,230,87.82,230,128Z"}))],["regular",v.createElement(v.Fragment,null,v.createElement("path",{d:"M232,128a104,104,0,0,1-208,0c0-41,23.81-78.36,60.66-95.27a8,8,0,0,1,6.68,14.54C60.15,61.59,40,93.27,40,128a88,88,0,0,0,176,0c0-34.73-20.15-66.41-51.34-80.73a8,8,0,0,1,6.68-14.54C208.19,49.64,232,87,232,128Z"}))],["thin",v.createElement(v.Fragment,null,v.createElement("path",{d:"M228,128a100,100,0,0,1-200,0c0-39.4,22.9-75.37,58.33-91.63a4,4,0,1,1,3.34,7.27C57.07,58.6,36,91.71,36,128a92,92,0,0,0,184,0c0-36.29-21.07-69.4-53.67-84.36a4,4,0,1,1,3.34-7.27C205.1,52.63,228,88.6,228,128Z"}))]]),vse=new Map([["bold",v.createElement(v.Fragment,null,v.createElement("path",{d:"M216,28H88A12,12,0,0,0,76,40V76H40A12,12,0,0,0,28,88V216a12,12,0,0,0,12,12H168a12,12,0,0,0,12-12V180h36a12,12,0,0,0,12-12V40A12,12,0,0,0,216,28ZM156,204H52V100H156Zm48-48H180V88a12,12,0,0,0-12-12H100V52H204Z"}))],["duotone",v.createElement(v.Fragment,null,v.createElement("path",{d:"M216,40V168H168V88H88V40Z",opacity:"0.2"}),v.createElement("path",{d:"M216,32H88a8,8,0,0,0-8,8V80H40a8,8,0,0,0-8,8V216a8,8,0,0,0,8,8H168a8,8,0,0,0,8-8V176h40a8,8,0,0,0,8-8V40A8,8,0,0,0,216,32ZM160,208H48V96H160Zm48-48H176V88a8,8,0,0,0-8-8H96V48H208Z"}))],["fill",v.createElement(v.Fragment,null,v.createElement("path",{d:"M216,32H88a8,8,0,0,0-8,8V80H40a8,8,0,0,0-8,8V216a8,8,0,0,0,8,8H168a8,8,0,0,0,8-8V176h40a8,8,0,0,0,8-8V40A8,8,0,0,0,216,32Zm-8,128H176V88a8,8,0,0,0-8-8H96V48H208Z"}))],["light",v.createElement(v.Fragment,null,v.createElement("path",{d:"M216,34H88a6,6,0,0,0-6,6V82H40a6,6,0,0,0-6,6V216a6,6,0,0,0,6,6H168a6,6,0,0,0,6-6V174h42a6,6,0,0,0,6-6V40A6,6,0,0,0,216,34ZM162,210H46V94H162Zm48-48H174V88a6,6,0,0,0-6-6H94V46H210Z"}))],["regular",v.createElement(v.Fragment,null,v.createElement("path",{d:"M216,32H88a8,8,0,0,0-8,8V80H40a8,8,0,0,0-8,8V216a8,8,0,0,0,8,8H168a8,8,0,0,0,8-8V176h40a8,8,0,0,0,8-8V40A8,8,0,0,0,216,32ZM160,208H48V96H160Zm48-48H176V88a8,8,0,0,0-8-8H96V48H208Z"}))],["thin",v.createElement(v.Fragment,null,v.createElement("path",{d:"M216,36H88a4,4,0,0,0-4,4V84H40a4,4,0,0,0-4,4V216a4,4,0,0,0,4,4H168a4,4,0,0,0,4-4V172h44a4,4,0,0,0,4-4V40A4,4,0,0,0,216,36ZM164,212H44V92H164Zm48-48H172V88a4,4,0,0,0-4-4H92V44H212Z"}))]]),yse=new Map([["bold",v.createElement(v.Fragment,null,v.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",v.createElement(v.Fragment,null,v.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"}),v.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",v.createElement(v.Fragment,null,v.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",v.createElement(v.Fragment,null,v.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",v.createElement(v.Fragment,null,v.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",v.createElement(v.Fragment,null,v.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"}))]]),_se=new Map([["bold",v.createElement(v.Fragment,null,v.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",v.createElement(v.Fragment,null,v.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"}),v.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",v.createElement(v.Fragment,null,v.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",v.createElement(v.Fragment,null,v.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",v.createElement(v.Fragment,null,v.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",v.createElement(v.Fragment,null,v.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"}))]]),wse=new Map([["bold",v.createElement(v.Fragment,null,v.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",v.createElement(v.Fragment,null,v.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"}),v.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",v.createElement(v.Fragment,null,v.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",v.createElement(v.Fragment,null,v.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",v.createElement(v.Fragment,null,v.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",v.createElement(v.Fragment,null,v.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"}))]]),bse=new Map([["bold",v.createElement(v.Fragment,null,v.createElement("path",{d:"M224,84H180.2l7.61-41.85a12,12,0,0,0-23.62-4.3L155.8,84H116.2l7.61-41.85a12,12,0,1,0-23.62-4.3L91.8,84H48a12,12,0,0,0,0,24H87.44l-7.27,40H32a12,12,0,0,0,0,24H75.8l-7.61,41.85a12,12,0,0,0,9.66,14A11.43,11.43,0,0,0,80,228a12,12,0,0,0,11.8-9.86L100.2,172h39.6l-7.61,41.85a12,12,0,0,0,9.66,14,11.43,11.43,0,0,0,2.16.2,12,12,0,0,0,11.8-9.86L164.2,172H208a12,12,0,0,0,0-24H168.56l7.27-40H224a12,12,0,0,0,0-24Zm-79.83,64H104.56l7.27-40h39.61Z"}))],["duotone",v.createElement(v.Fragment,null,v.createElement("path",{d:"M165.82,96l-11.64,64h-64l11.64-64Z",opacity:"0.2"}),v.createElement("path",{d:"M224,88H175.4l8.47-46.57a8,8,0,0,0-15.74-2.86l-9,49.43H111.4l8.47-46.57a8,8,0,0,0-15.74-2.86L95.14,88H48a8,8,0,0,0,0,16H92.23L83.5,152H32a8,8,0,0,0,0,16H80.6l-8.47,46.57a8,8,0,0,0,6.44,9.3A7.79,7.79,0,0,0,80,224a8,8,0,0,0,7.86-6.57l9-49.43H144.6l-8.47,46.57a8,8,0,0,0,6.44,9.3A7.79,7.79,0,0,0,144,224a8,8,0,0,0,7.86-6.57l9-49.43H208a8,8,0,0,0,0-16H163.77l8.73-48H224a8,8,0,0,0,0-16Zm-76.5,64H99.77l8.73-48h47.73Z"}))],["fill",v.createElement(v.Fragment,null,v.createElement("path",{d:"M116.25,112h31.5l-8,32h-31.5ZM224,48V208a16,16,0,0,1-16,16H48a16,16,0,0,1-16-16V48A16,16,0,0,1,48,32H208A16,16,0,0,1,224,48Zm-16,56a8,8,0,0,0-8-8H168.25l7.51-30.06a8,8,0,0,0-15.52-3.88L151.75,96h-31.5l7.51-30.06a8,8,0,0,0-15.52-3.88L103.75,96H64a8,8,0,0,0,0,16H99.75l-8,32H56a8,8,0,0,0,0,16H87.75l-7.51,30.06a8,8,0,0,0,5.82,9.7,8.13,8.13,0,0,0,2,.24,8,8,0,0,0,7.75-6.06L104.25,160h31.5l-7.51,30.06a8,8,0,0,0,5.82,9.7A8.13,8.13,0,0,0,136,200a8,8,0,0,0,7.75-6.06L152.25,160H192a8,8,0,0,0,0-16H156.25l8-32H200A8,8,0,0,0,208,104Z"}))],["light",v.createElement(v.Fragment,null,v.createElement("path",{d:"M224,90H173l8.89-48.93a6,6,0,1,0-11.8-2.14L160.81,90H109l8.89-48.93a6,6,0,0,0-11.8-2.14L96.81,90H48a6,6,0,0,0,0,12H94.63l-9.46,52H32a6,6,0,0,0,0,12H83L74.1,214.93a6,6,0,0,0,4.83,7A5.64,5.64,0,0,0,80,222a6,6,0,0,0,5.89-4.93L95.19,166H147l-8.89,48.93a6,6,0,0,0,4.83,7,5.64,5.64,0,0,0,1.08.1,6,6,0,0,0,5.89-4.93L159.19,166H208a6,6,0,0,0,0-12H161.37l9.46-52H224a6,6,0,0,0,0-12Zm-74.83,64H97.37l9.46-52h51.8Z"}))],["regular",v.createElement(v.Fragment,null,v.createElement("path",{d:"M224,88H175.4l8.47-46.57a8,8,0,0,0-15.74-2.86l-9,49.43H111.4l8.47-46.57a8,8,0,0,0-15.74-2.86L95.14,88H48a8,8,0,0,0,0,16H92.23L83.5,152H32a8,8,0,0,0,0,16H80.6l-8.47,46.57a8,8,0,0,0,6.44,9.3A7.79,7.79,0,0,0,80,224a8,8,0,0,0,7.86-6.57l9-49.43H144.6l-8.47,46.57a8,8,0,0,0,6.44,9.3A7.79,7.79,0,0,0,144,224a8,8,0,0,0,7.86-6.57l9-49.43H208a8,8,0,0,0,0-16H163.77l8.73-48H224a8,8,0,0,0,0-16Zm-76.5,64H99.77l8.73-48h47.73Z"}))],["thin",v.createElement(v.Fragment,null,v.createElement("path",{d:"M224,92H170.61l9.33-51.28a4,4,0,1,0-7.88-1.44L162.48,92H106.61l9.33-51.28a4,4,0,1,0-7.88-1.44L98.48,92H48a4,4,0,0,0,0,8H97L86.84,156H32a4,4,0,0,0,0,8H85.39l-9.33,51.28a4,4,0,0,0,3.22,4.65A3.65,3.65,0,0,0,80,220a4,4,0,0,0,3.94-3.29L93.52,164h55.87l-9.33,51.28a4,4,0,0,0,3.22,4.65,3.65,3.65,0,0,0,.72.07,4,4,0,0,0,3.94-3.29L157.52,164H208a4,4,0,0,0,0-8H159l10.19-56H224a4,4,0,0,0,0-8Zm-73.16,64H95l10.19-56H161Z"}))]]),xse=new Map([["bold",v.createElement(v.Fragment,null,v.createElement("path",{d:"M232.49,215.51,185,168a92.12,92.12,0,1,0-17,17l47.53,47.54a12,12,0,0,0,17-17ZM44,112a68,68,0,1,1,68,68A68.07,68.07,0,0,1,44,112Z"}))],["duotone",v.createElement(v.Fragment,null,v.createElement("path",{d:"M192,112a80,80,0,1,1-80-80A80,80,0,0,1,192,112Z",opacity:"0.2"}),v.createElement("path",{d:"M229.66,218.34,179.6,168.28a88.21,88.21,0,1,0-11.32,11.31l50.06,50.07a8,8,0,0,0,11.32-11.32ZM40,112a72,72,0,1,1,72,72A72.08,72.08,0,0,1,40,112Z"}))],["fill",v.createElement(v.Fragment,null,v.createElement("path",{d:"M168,112a56,56,0,1,1-56-56A56,56,0,0,1,168,112Zm61.66,117.66a8,8,0,0,1-11.32,0l-50.06-50.07a88,88,0,1,1,11.32-11.31l50.06,50.06A8,8,0,0,1,229.66,229.66ZM112,184a72,72,0,1,0-72-72A72.08,72.08,0,0,0,112,184Z"}))],["light",v.createElement(v.Fragment,null,v.createElement("path",{d:"M228.24,219.76l-51.38-51.38a86.15,86.15,0,1,0-8.48,8.48l51.38,51.38a6,6,0,0,0,8.48-8.48ZM38,112a74,74,0,1,1,74,74A74.09,74.09,0,0,1,38,112Z"}))],["regular",v.createElement(v.Fragment,null,v.createElement("path",{d:"M229.66,218.34l-50.07-50.06a88.11,88.11,0,1,0-11.31,11.31l50.06,50.07a8,8,0,0,0,11.32-11.32ZM40,112a72,72,0,1,1,72,72A72.08,72.08,0,0,1,40,112Z"}))],["thin",v.createElement(v.Fragment,null,v.createElement("path",{d:"M226.83,221.17l-52.7-52.7a84.1,84.1,0,1,0-5.66,5.66l52.7,52.7a4,4,0,0,0,5.66-5.66ZM36,112a76,76,0,1,1,76,76A76.08,76.08,0,0,1,36,112Z"}))]]),Sse=new Map([["bold",v.createElement(v.Fragment,null,v.createElement("path",{d:"M230.14,70.54,185.46,25.85a20,20,0,0,0-28.29,0L33.86,149.17A19.85,19.85,0,0,0,28,163.31V208a20,20,0,0,0,20,20H92.69a19.86,19.86,0,0,0,14.14-5.86L230.14,98.82a20,20,0,0,0,0-28.28ZM91,204H52V165l84-84,39,39ZM192,103,153,64l18.34-18.34,39,39Z"}))],["duotone",v.createElement(v.Fragment,null,v.createElement("path",{d:"M221.66,90.34,192,120,136,64l29.66-29.66a8,8,0,0,1,11.31,0L221.66,79A8,8,0,0,1,221.66,90.34Z",opacity:"0.2"}),v.createElement("path",{d:"M227.31,73.37,182.63,28.68a16,16,0,0,0-22.63,0L36.69,152A15.86,15.86,0,0,0,32,163.31V208a16,16,0,0,0,16,16H92.69A15.86,15.86,0,0,0,104,219.31L227.31,96a16,16,0,0,0,0-22.63ZM92.69,208H48V163.31l88-88L180.69,120ZM192,108.68,147.31,64l24-24L216,84.68Z"}))],["fill",v.createElement(v.Fragment,null,v.createElement("path",{d:"M227.31,73.37,182.63,28.68a16,16,0,0,0-22.63,0L36.69,152A15.86,15.86,0,0,0,32,163.31V208a16,16,0,0,0,16,16H92.69A15.86,15.86,0,0,0,104,219.31L227.31,96a16,16,0,0,0,0-22.63ZM192,108.68,147.31,64l24-24L216,84.68Z"}))],["light",v.createElement(v.Fragment,null,v.createElement("path",{d:"M225.9,74.78,181.21,30.09a14,14,0,0,0-19.8,0L38.1,153.41a13.94,13.94,0,0,0-4.1,9.9V208a14,14,0,0,0,14,14H92.69a13.94,13.94,0,0,0,9.9-4.1L225.9,94.58a14,14,0,0,0,0-19.8ZM94.1,209.41a2,2,0,0,1-1.41.59H48a2,2,0,0,1-2-2V163.31a2,2,0,0,1,.59-1.41L136,72.48,183.51,120ZM217.41,86.1,192,111.51,144.49,64,169.9,38.58a2,2,0,0,1,2.83,0l44.68,44.69a2,2,0,0,1,0,2.83Z"}))],["regular",v.createElement(v.Fragment,null,v.createElement("path",{d:"M227.31,73.37,182.63,28.68a16,16,0,0,0-22.63,0L36.69,152A15.86,15.86,0,0,0,32,163.31V208a16,16,0,0,0,16,16H92.69A15.86,15.86,0,0,0,104,219.31L227.31,96a16,16,0,0,0,0-22.63ZM92.69,208H48V163.31l88-88L180.69,120ZM192,108.68,147.31,64l24-24L216,84.68Z"}))],["thin",v.createElement(v.Fragment,null,v.createElement("path",{d:"M224.49,76.2,179.8,31.51a12,12,0,0,0-17,0L133.17,61.17h0L39.52,154.83A11.9,11.9,0,0,0,36,163.31V208a12,12,0,0,0,12,12H92.69a12,12,0,0,0,8.48-3.51L224.48,93.17a12,12,0,0,0,0-17Zm-129,134.63A4,4,0,0,1,92.69,212H48a4,4,0,0,1-4-4V163.31a4,4,0,0,1,1.17-2.83L136,69.65,186.34,120ZM218.83,87.51,192,114.34,141.66,64l26.82-26.83a4,4,0,0,1,5.66,0l44.69,44.68a4,4,0,0,1,0,5.66Z"}))]]),kse=new Map([["bold",v.createElement(v.Fragment,null,v.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",v.createElement(v.Fragment,null,v.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"}),v.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",v.createElement(v.Fragment,null,v.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",v.createElement(v.Fragment,null,v.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",v.createElement(v.Fragment,null,v.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",v.createElement(v.Fragment,null,v.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"}))]]),Ese=new Map([["bold",v.createElement(v.Fragment,null,v.createElement("path",{d:"M216,36H40A20,20,0,0,0,20,56V200a20,20,0,0,0,20,20H216a20,20,0,0,0,20-20V56A20,20,0,0,0,216,36ZM44,60H76V196H44ZM212,196H100V60H212Z"}))],["duotone",v.createElement(v.Fragment,null,v.createElement("path",{d:"M88,48V208H40a8,8,0,0,1-8-8V56a8,8,0,0,1,8-8Z",opacity:"0.2"}),v.createElement("path",{d:"M216,40H40A16,16,0,0,0,24,56V200a16,16,0,0,0,16,16H216a16,16,0,0,0,16-16V56A16,16,0,0,0,216,40ZM40,56H80V200H40ZM216,200H96V56H216V200Z"}))],["fill",v.createElement(v.Fragment,null,v.createElement("path",{d:"M216,40H40A16,16,0,0,0,24,56V200a16,16,0,0,0,16,16H216a16,16,0,0,0,16-16V56A16,16,0,0,0,216,40Zm0,160H88V56H216V200Z"}))],["light",v.createElement(v.Fragment,null,v.createElement("path",{d:"M216,42H40A14,14,0,0,0,26,56V200a14,14,0,0,0,14,14H216a14,14,0,0,0,14-14V56A14,14,0,0,0,216,42ZM38,200V56a2,2,0,0,1,2-2H82V202H40A2,2,0,0,1,38,200Zm180,0a2,2,0,0,1-2,2H94V54H216a2,2,0,0,1,2,2Z"}))],["regular",v.createElement(v.Fragment,null,v.createElement("path",{d:"M216,40H40A16,16,0,0,0,24,56V200a16,16,0,0,0,16,16H216a16,16,0,0,0,16-16V56A16,16,0,0,0,216,40ZM40,56H80V200H40ZM216,200H96V56H216V200Z"}))],["thin",v.createElement(v.Fragment,null,v.createElement("path",{d:"M216,44H40A12,12,0,0,0,28,56V200a12,12,0,0,0,12,12H216a12,12,0,0,0,12-12V56A12,12,0,0,0,216,44ZM36,200V56a4,4,0,0,1,4-4H84V204H40A4,4,0,0,1,36,200Zm184,0a4,4,0,0,1-4,4H92V52H216a4,4,0,0,1,4,4Z"}))]]),Cse=new Map([["bold",v.createElement(v.Fragment,null,v.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",v.createElement(v.Fragment,null,v.createElement("path",{d:"M200,40V216H40a16,16,0,0,1-16-16V56A16,16,0,0,1,40,40Z",opacity:"0.2"}),v.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",v.createElement(v.Fragment,null,v.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",v.createElement(v.Fragment,null,v.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",v.createElement(v.Fragment,null,v.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",v.createElement(v.Fragment,null,v.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"}))]]),Pse=new Map([["bold",v.createElement(v.Fragment,null,v.createElement("path",{d:"M124,216a12,12,0,0,1-12,12H48a12,12,0,0,1-12-12V40A12,12,0,0,1,48,28h64a12,12,0,0,1,0,24H60V204h52A12,12,0,0,1,124,216Zm108.49-96.49-40-40a12,12,0,0,0-17,17L195,116H112a12,12,0,0,0,0,24h83l-19.52,19.51a12,12,0,0,0,17,17l40-40A12,12,0,0,0,232.49,119.51Z"}))],["duotone",v.createElement(v.Fragment,null,v.createElement("path",{d:"M224,56V200a16,16,0,0,1-16,16H48V40H208A16,16,0,0,1,224,56Z",opacity:"0.2"}),v.createElement("path",{d:"M120,216a8,8,0,0,1-8,8H48a8,8,0,0,1-8-8V40a8,8,0,0,1,8-8h64a8,8,0,0,1,0,16H56V208h56A8,8,0,0,1,120,216Zm109.66-93.66-40-40a8,8,0,0,0-11.32,11.32L204.69,120H112a8,8,0,0,0,0,16h92.69l-26.35,26.34a8,8,0,0,0,11.32,11.32l40-40A8,8,0,0,0,229.66,122.34Z"}))],["fill",v.createElement(v.Fragment,null,v.createElement("path",{d:"M120,216a8,8,0,0,1-8,8H48a8,8,0,0,1-8-8V40a8,8,0,0,1,8-8h64a8,8,0,0,1,0,16H56V208h56A8,8,0,0,1,120,216Zm109.66-93.66-40-40A8,8,0,0,0,176,88v32H112a8,8,0,0,0,0,16h64v32a8,8,0,0,0,13.66,5.66l40-40A8,8,0,0,0,229.66,122.34Z"}))],["light",v.createElement(v.Fragment,null,v.createElement("path",{d:"M118,216a6,6,0,0,1-6,6H48a6,6,0,0,1-6-6V40a6,6,0,0,1,6-6h64a6,6,0,0,1,0,12H54V210h58A6,6,0,0,1,118,216Zm110.24-92.24-40-40a6,6,0,0,0-8.48,8.48L209.51,122H112a6,6,0,0,0,0,12h97.51l-29.75,29.76a6,6,0,1,0,8.48,8.48l40-40A6,6,0,0,0,228.24,123.76Z"}))],["regular",v.createElement(v.Fragment,null,v.createElement("path",{d:"M120,216a8,8,0,0,1-8,8H48a8,8,0,0,1-8-8V40a8,8,0,0,1,8-8h64a8,8,0,0,1,0,16H56V208h56A8,8,0,0,1,120,216Zm109.66-93.66-40-40a8,8,0,0,0-11.32,11.32L204.69,120H112a8,8,0,0,0,0,16h92.69l-26.35,26.34a8,8,0,0,0,11.32,11.32l40-40A8,8,0,0,0,229.66,122.34Z"}))],["thin",v.createElement(v.Fragment,null,v.createElement("path",{d:"M116,216a4,4,0,0,1-4,4H48a4,4,0,0,1-4-4V40a4,4,0,0,1,4-4h64a4,4,0,0,1,0,8H52V212h60A4,4,0,0,1,116,216Zm110.83-90.83-40-40a4,4,0,0,0-5.66,5.66L214.34,124H112a4,4,0,0,0,0,8H214.34l-33.17,33.17a4,4,0,0,0,5.66,5.66l40-40A4,4,0,0,0,226.83,125.17Z"}))]]),Tse=new Map([["bold",v.createElement(v.Fragment,null,v.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",v.createElement(v.Fragment,null,v.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"}),v.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",v.createElement(v.Fragment,null,v.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",v.createElement(v.Fragment,null,v.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",v.createElement(v.Fragment,null,v.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",v.createElement(v.Fragment,null,v.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"}))]]),Rse=new Map([["bold",v.createElement(v.Fragment,null,v.createElement("path",{d:"M242.79,149.32,223.7,97.11A20,20,0,0,0,198.12,85.2l-61.31,22.22L147.7,45.18A20,20,0,0,0,131.55,22L76.87,12.31A19.94,19.94,0,0,0,53.76,28.55l-25,143.13A48,48,0,0,0,67.4,227.26a51.19,51.19,0,0,0,8.7.74H224a20,20,0,0,0,20-20V156.19A21.74,21.74,0,0,0,242.79,149.32ZM99,184.18a23.84,23.84,0,0,1-9.86,15.56,23.28,23.28,0,0,1-17.56,3.89,24,24,0,0,1-19.23-27.82L76.71,36.66,123.37,45,99,184.18Zm23.64,4.13,9.39-53.64,70.49-25.54,16.3,44.59-96.23,34.87C122.62,188.5,122.65,188.41,122.66,188.31ZM220,204H150.52L220,178.82ZM89.22,174.07l-1.4,8A12,12,0,0,1,76,192a12.35,12.35,0,0,1-2.08-.18,12,12,0,0,1-9.75-13.89l1.4-8a12,12,0,0,1,23.64,4.14Z"}))],["duotone",v.createElement(v.Fragment,null,v.createElement("path",{d:"M135.88,43.11l-25,143.14a35.71,35.71,0,0,1-41.34,29.2h0a36,36,0,0,1-28.95-41.71l25-143.13a8,8,0,0,1,9.19-6.49l54.67,9.73A8,8,0,0,1,135.88,43.11Z",opacity:"0.2"}),v.createElement("path",{d:"M88,180a12,12,0,1,1-12-12A12,12,0,0,1,88,180Zm152-23.81V208a16,16,0,0,1-16,16H76a46.36,46.36,0,0,1-7.94-.68,44,44,0,0,1-35.43-50.95l25-143.13a15.94,15.94,0,0,1,18.47-13L130.84,26a16,16,0,0,1,12.92,18.52l-12.08,69L199.49,89a16,16,0,0,1,20.45,9.52L239,150.69A18.35,18.35,0,0,1,240,156.19ZM103,184.87,128,41.74,73.46,32l-25,143.1A28,28,0,0,0,70.9,207.57,27.29,27.29,0,0,0,91.46,203,27.84,27.84,0,0,0,103,184.87ZM116.78,195,224,156.11,204.92,104,128.5,131.7l-9.78,55.92A44.63,44.63,0,0,1,116.78,195ZM224,173.12,127.74,208H224Z"}))],["fill",v.createElement(v.Fragment,null,v.createElement("path",{d:"M240,155.91a16,16,0,0,0-1-5.22L219.94,98.48A16,16,0,0,0,199.49,89l-67.81,24.57,12.08-69A16,16,0,0,0,130.84,26L76.17,16.25a15.94,15.94,0,0,0-18.47,13l-25,143.12A43.82,43.82,0,0,0,75.78,224H224a16,16,0,0,0,16-16ZM76,196a16,16,0,1,1,16-16A16,16,0,0,1,76,196Zm42.72-8.38,9.78-55.92L204.92,104,224,156.11,116.78,195A44.89,44.89,0,0,0,118.72,187.62ZM224,208H127.74L224,173.11Z"}))],["light",v.createElement(v.Fragment,null,v.createElement("path",{d:"M86,180a10,10,0,1,1-10-10A10,10,0,0,1,86,180Zm152-23.81V208a14,14,0,0,1-14,14H76a44.18,44.18,0,0,1-7.58-.65,42,42,0,0,1-33.81-48.64l25-143.13A13.94,13.94,0,0,1,75.82,18.22l54.67,9.72a14,14,0,0,1,11.3,16.21l-12.67,72.44,71-25.75a14,14,0,0,1,17.89,8.32l19.09,52.22A15.66,15.66,0,0,1,238,156.19Zm-133.07,29L130,42.08a2,2,0,0,0-1.58-2.32L73.72,30l-.34,0a1.84,1.84,0,0,0-1.07.35,2,2,0,0,0-.82,1.3l-25,143.13a30,30,0,0,0,24.09,34.76,29.25,29.25,0,0,0,22-4.89,29.81,29.81,0,0,0,12.33-19.44Zm8.25,13.17L224.71,158a2,2,0,0,0,1.11-1,1.86,1.86,0,0,0,.06-1.46l-19.09-52.21a2,2,0,0,0-2.53-1.17l-77.53,28.09-10,57.07A41.9,41.9,0,0,1,113.18,198.38ZM226,170.27,116.35,210H224a2,2,0,0,0,2-2Z"}))],["regular",v.createElement(v.Fragment,null,v.createElement("path",{d:"M88,180a12,12,0,1,1-12-12A12,12,0,0,1,88,180Zm152-23.81V208a16,16,0,0,1-16,16H76a46.36,46.36,0,0,1-7.94-.68,44,44,0,0,1-35.43-50.95l25-143.13a15.94,15.94,0,0,1,18.47-13L130.84,26a16,16,0,0,1,12.92,18.52l-12.08,69L199.49,89a16,16,0,0,1,20.45,9.52L239,150.69A18.35,18.35,0,0,1,240,156.19ZM103,184.87,128,41.74,73.46,32l-25,143.1A28,28,0,0,0,70.9,207.57,27.29,27.29,0,0,0,91.46,203,27.84,27.84,0,0,0,103,184.87ZM116.78,195,224,156.11,204.92,104,128.5,131.7l-9.78,55.92A44.63,44.63,0,0,1,116.78,195ZM224,173.12,127.74,208H224Z"}))],["thin",v.createElement(v.Fragment,null,v.createElement("path",{d:"M235.27,152.07,216.19,99.85a12,12,0,0,0-15.34-7.13l-74.3,26.92,13.27-75.83a12,12,0,0,0-9.68-13.9L75.47,20.19a11.75,11.75,0,0,0-8.89,2,11.9,11.9,0,0,0-4.94,7.77l-25,143.13A40,40,0,0,0,68.8,219.39,42.68,42.68,0,0,0,76,220H224a12,12,0,0,0,12-12V156.19A14,14,0,0,0,235.27,152.07Zm-31.7-51.83a4,4,0,0,1,5.1,2.36l19.09,52.21a3.9,3.9,0,0,1-.13,3,3.94,3.94,0,0,1-2.24,2L108.78,202.11a40,40,0,0,0,6-15.17L125,128.73ZM93.75,206.29a31.25,31.25,0,0,1-23.55,5.22,32,32,0,0,1-25.71-37.08l25-143.13a4,4,0,0,1,1.64-2.59A3.85,3.85,0,0,1,73.38,28a4,4,0,0,1,.69.06l54.67,9.73a4,4,0,0,1,3.2,4.64l-25,143.13h0A31.79,31.79,0,0,1,93.75,206.29ZM228,208a4,4,0,0,1-4,4H105l123-44.59ZM84,180a8,8,0,1,1-8-8A8,8,0,0,1,84,180Z"}))]]),Ase=new Map([["bold",v.createElement(v.Fragment,null,v.createElement("path",{d:"M216,48H180V36A28,28,0,0,0,152,8H104A28,28,0,0,0,76,36V48H40a12,12,0,0,0,0,24h4V208a20,20,0,0,0,20,20H192a20,20,0,0,0,20-20V72h4a12,12,0,0,0,0-24ZM100,36a4,4,0,0,1,4-4h48a4,4,0,0,1,4,4V48H100Zm88,168H68V72H188ZM116,104v64a12,12,0,0,1-24,0V104a12,12,0,0,1,24,0Zm48,0v64a12,12,0,0,1-24,0V104a12,12,0,0,1,24,0Z"}))],["duotone",v.createElement(v.Fragment,null,v.createElement("path",{d:"M200,56V208a8,8,0,0,1-8,8H64a8,8,0,0,1-8-8V56Z",opacity:"0.2"}),v.createElement("path",{d:"M216,48H176V40a24,24,0,0,0-24-24H104A24,24,0,0,0,80,40v8H40a8,8,0,0,0,0,16h8V208a16,16,0,0,0,16,16H192a16,16,0,0,0,16-16V64h8a8,8,0,0,0,0-16ZM96,40a8,8,0,0,1,8-8h48a8,8,0,0,1,8,8v8H96Zm96,168H64V64H192ZM112,104v64a8,8,0,0,1-16,0V104a8,8,0,0,1,16,0Zm48,0v64a8,8,0,0,1-16,0V104a8,8,0,0,1,16,0Z"}))],["fill",v.createElement(v.Fragment,null,v.createElement("path",{d:"M216,48H176V40a24,24,0,0,0-24-24H104A24,24,0,0,0,80,40v8H40a8,8,0,0,0,0,16h8V208a16,16,0,0,0,16,16H192a16,16,0,0,0,16-16V64h8a8,8,0,0,0,0-16ZM112,168a8,8,0,0,1-16,0V104a8,8,0,0,1,16,0Zm48,0a8,8,0,0,1-16,0V104a8,8,0,0,1,16,0Zm0-120H96V40a8,8,0,0,1,8-8h48a8,8,0,0,1,8,8Z"}))],["light",v.createElement(v.Fragment,null,v.createElement("path",{d:"M216,50H174V40a22,22,0,0,0-22-22H104A22,22,0,0,0,82,40V50H40a6,6,0,0,0,0,12H50V208a14,14,0,0,0,14,14H192a14,14,0,0,0,14-14V62h10a6,6,0,0,0,0-12ZM94,40a10,10,0,0,1,10-10h48a10,10,0,0,1,10,10V50H94ZM194,208a2,2,0,0,1-2,2H64a2,2,0,0,1-2-2V62H194ZM110,104v64a6,6,0,0,1-12,0V104a6,6,0,0,1,12,0Zm48,0v64a6,6,0,0,1-12,0V104a6,6,0,0,1,12,0Z"}))],["regular",v.createElement(v.Fragment,null,v.createElement("path",{d:"M216,48H176V40a24,24,0,0,0-24-24H104A24,24,0,0,0,80,40v8H40a8,8,0,0,0,0,16h8V208a16,16,0,0,0,16,16H192a16,16,0,0,0,16-16V64h8a8,8,0,0,0,0-16ZM96,40a8,8,0,0,1,8-8h48a8,8,0,0,1,8,8v8H96Zm96,168H64V64H192ZM112,104v64a8,8,0,0,1-16,0V104a8,8,0,0,1,16,0Zm48,0v64a8,8,0,0,1-16,0V104a8,8,0,0,1,16,0Z"}))],["thin",v.createElement(v.Fragment,null,v.createElement("path",{d:"M216,52H172V40a20,20,0,0,0-20-20H104A20,20,0,0,0,84,40V52H40a4,4,0,0,0,0,8H52V208a12,12,0,0,0,12,12H192a12,12,0,0,0,12-12V60h12a4,4,0,0,0,0-8ZM92,40a12,12,0,0,1,12-12h48a12,12,0,0,1,12,12V52H92ZM196,208a4,4,0,0,1-4,4H64a4,4,0,0,1-4-4V60H196ZM108,104v64a4,4,0,0,1-8,0V104a4,4,0,0,1,8,0Zm48,0v64a4,4,0,0,1-8,0V104a4,4,0,0,1,8,0Z"}))]]),Ise=new Map([["bold",v.createElement(v.Fragment,null,v.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",v.createElement(v.Fragment,null,v.createElement("path",{d:"M192,96a64,64,0,1,1-64-64A64,64,0,0,1,192,96Z",opacity:"0.2"}),v.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",v.createElement(v.Fragment,null,v.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",v.createElement(v.Fragment,null,v.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",v.createElement(v.Fragment,null,v.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",v.createElement(v.Fragment,null,v.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"}))]]),Ose=new Map([["bold",v.createElement(v.Fragment,null,v.createElement("path",{d:"M208.49,191.51a12,12,0,0,1-17,17L128,145,64.49,208.49a12,12,0,0,1-17-17L111,128,47.51,64.49a12,12,0,0,1,17-17L128,111l63.51-63.52a12,12,0,0,1,17,17L145,128Z"}))],["duotone",v.createElement(v.Fragment,null,v.createElement("path",{d:"M216,56V200a16,16,0,0,1-16,16H56a16,16,0,0,1-16-16V56A16,16,0,0,1,56,40H200A16,16,0,0,1,216,56Z",opacity:"0.2"}),v.createElement("path",{d:"M205.66,194.34a8,8,0,0,1-11.32,11.32L128,139.31,61.66,205.66a8,8,0,0,1-11.32-11.32L116.69,128,50.34,61.66A8,8,0,0,1,61.66,50.34L128,116.69l66.34-66.35a8,8,0,0,1,11.32,11.32L139.31,128Z"}))],["fill",v.createElement(v.Fragment,null,v.createElement("path",{d:"M208,32H48A16,16,0,0,0,32,48V208a16,16,0,0,0,16,16H208a16,16,0,0,0,16-16V48A16,16,0,0,0,208,32ZM181.66,170.34a8,8,0,0,1-11.32,11.32L128,139.31,85.66,181.66a8,8,0,0,1-11.32-11.32L116.69,128,74.34,85.66A8,8,0,0,1,85.66,74.34L128,116.69l42.34-42.35a8,8,0,0,1,11.32,11.32L139.31,128Z"}))],["light",v.createElement(v.Fragment,null,v.createElement("path",{d:"M204.24,195.76a6,6,0,1,1-8.48,8.48L128,136.49,60.24,204.24a6,6,0,0,1-8.48-8.48L119.51,128,51.76,60.24a6,6,0,0,1,8.48-8.48L128,119.51l67.76-67.75a6,6,0,0,1,8.48,8.48L136.49,128Z"}))],["regular",v.createElement(v.Fragment,null,v.createElement("path",{d:"M205.66,194.34a8,8,0,0,1-11.32,11.32L128,139.31,61.66,205.66a8,8,0,0,1-11.32-11.32L116.69,128,50.34,61.66A8,8,0,0,1,61.66,50.34L128,116.69l66.34-66.35a8,8,0,0,1,11.32,11.32L139.31,128Z"}))],["thin",v.createElement(v.Fragment,null,v.createElement("path",{d:"M202.83,197.17a4,4,0,0,1-5.66,5.66L128,133.66,58.83,202.83a4,4,0,0,1-5.66-5.66L122.34,128,53.17,58.83a4,4,0,0,1,5.66-5.66L128,122.34l69.17-69.17a4,4,0,1,1,5.66,5.66L133.66,128Z"}))]]),Mse=new Map([["bold",v.createElement(v.Fragment,null,v.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",v.createElement(v.Fragment,null,v.createElement("path",{d:"M208,216H160L48,40H96Z",opacity:"0.2"}),v.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",v.createElement(v.Fragment,null,v.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",v.createElement(v.Fragment,null,v.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",v.createElement(v.Fragment,null,v.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",v.createElement(v.Fragment,null,v.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"}))]]),Lse=v.createContext({color:"currentColor",size:"1em",weight:"regular",mirrored:!1}),Fn=v.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:m="regular",mirrored:g=!1,..._}=v.useContext(Lse);return v.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||g?"scale(-1, 1)":void 0,..._,...d},!!n&&v.createElement("title",null,n),l,u.get(i??m))});Fn.displayName="IconBase";const GD=v.forwardRef((t,e)=>v.createElement(Fn,{ref:e,...t,weights:dse}));GD.displayName="ArrowUpIcon";const Nse=GD,qD=v.forwardRef((t,e)=>v.createElement(Fn,{ref:e,...t,weights:fse}));qD.displayName="CaretDownIcon";const Dse=qD,YD=v.forwardRef((t,e)=>v.createElement(Fn,{ref:e,...t,weights:hse}));YD.displayName="CaretRightIcon";const $se=YD,XD=v.forwardRef((t,e)=>v.createElement(Fn,{ref:e,...t,weights:pse}));XD.displayName="ChatCircleIcon";const Fse=XD,QD=v.forwardRef((t,e)=>v.createElement(Fn,{ref:e,...t,weights:mse}));QD.displayName="CheckIcon";const jse=QD,JD=v.forwardRef((t,e)=>v.createElement(Fn,{ref:e,...t,weights:gse}));JD.displayName="CircleNotchIcon";const Ik=JD,e$=v.forwardRef((t,e)=>v.createElement(Fn,{ref:e,...t,weights:vse}));e$.displayName="CopyIcon";const Vp=e$,t$=v.forwardRef((t,e)=>v.createElement(Fn,{ref:e,...t,weights:yse}));t$.displayName="DotsThreeIcon";const zse=t$,n$=v.forwardRef((t,e)=>v.createElement(Fn,{ref:e,...t,weights:_se}));n$.displayName="FolderOpenIcon";const Vse=n$,r$=v.forwardRef((t,e)=>v.createElement(Fn,{ref:e,...t,weights:wse}));r$.displayName="FolderSimpleIcon";const Hse=r$,s$=v.forwardRef((t,e)=>v.createElement(Fn,{ref:e,...t,weights:bse}));s$.displayName="HashIcon";const Use=s$,i$=v.forwardRef((t,e)=>v.createElement(Fn,{ref:e,...t,weights:xse}));i$.displayName="MagnifyingGlassIcon";const Zse=i$,o$=v.forwardRef((t,e)=>v.createElement(Fn,{ref:e,...t,weights:Sse}));o$.displayName="PencilSimpleIcon";const a$=o$,l$=v.forwardRef((t,e)=>v.createElement(Fn,{ref:e,...t,weights:kse}));l$.displayName="PushPinIcon";const mx=l$,c$=v.forwardRef((t,e)=>v.createElement(Fn,{ref:e,...t,weights:Ese}));c$.displayName="SidebarSimpleIcon";const Bse=c$,u$=v.forwardRef((t,e)=>v.createElement(Fn,{ref:e,...t,weights:Cse}));u$.displayName="SignInIcon";const Wse=u$,d$=v.forwardRef((t,e)=>v.createElement(Fn,{ref:e,...t,weights:Pse}));d$.displayName="SignOutIcon";const Kse=d$,f$=v.forwardRef((t,e)=>v.createElement(Fn,{ref:e,...t,weights:Tse}));f$.displayName="SquaresFourIcon";const Gse=f$,h$=v.forwardRef((t,e)=>v.createElement(Fn,{ref:e,...t,weights:Rse}));h$.displayName="SwatchesIcon";const qse=h$,p$=v.forwardRef((t,e)=>v.createElement(Fn,{ref:e,...t,weights:Ase}));p$.displayName="TrashIcon";const m$=p$,g$=v.forwardRef((t,e)=>v.createElement(Fn,{ref:e,...t,weights:Ise}));g$.displayName="UserIcon";const Yse=g$,v$=v.forwardRef((t,e)=>v.createElement(Fn,{ref:e,...t,weights:Ose}));v$.displayName="XIcon";const Ok=v$,y$=v.forwardRef((t,e)=>v.createElement(Fn,{ref:e,...t,weights:Mse}));y$.displayName="XLogoIcon";const Xse=y$,Qse="/assets/arena-Db0j1set.png",Jse="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 _$(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=_$(t[e]))&&(r&&(r+=" "),r+=n)}else for(n in t)t[n]&&(r&&(r+=" "),r+=n);return r}function w$(){for(var t,e,n=0,r="",s=arguments.length;n<s;n++)(t=arguments[n])&&(e=_$(t))&&(r&&(r+=" "),r+=e);return r}const eie=(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},tie=(t,e)=>({classGroupId:t,validator:e}),b$=(t=new Map,e=null,n)=>({nextPart:t,validators:e,classGroupId:n}),Fv="-",ZA=[],nie="arbitrary..",rie=t=>{const e=iie(t),{conflictingClassGroups:n,conflictingClassGroupModifiers:r}=t;return{getClassGroupId:o=>{if(o.startsWith("[")&&o.endsWith("]"))return sie(o);const l=o.split(Fv),u=l[0]===""&&l.length>1?1:0;return x$(l,u,e)},getConflictingClassGroupIds:(o,l)=>{if(l){const u=r[o],d=n[o];return u?d?eie(d,u):u:d||ZA}return n[o]||ZA}}},x$=(t,e,n)=>{if(t.length-e===0)return n.classGroupId;const s=t[e],i=n.nextPart.get(s);if(i){const d=x$(t,e+1,i);if(d)return d}const o=n.validators;if(o===null)return;const l=e===0?t.join(Fv):t.slice(e).join(Fv),u=o.length;for(let d=0;d<u;d++){const f=o[d];if(f.validator(l))return f.classGroupId}},sie=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?nie+r:void 0})(),iie=t=>{const{theme:e,classGroups:n}=t;return oie(n,e)},oie=(t,e)=>{const n=b$();for(const r in t){const s=t[r];Mk(s,n,r,e)}return n},Mk=(t,e,n,r)=>{const s=t.length;for(let i=0;i<s;i++){const o=t[i];aie(o,e,n,r)}},aie=(t,e,n,r)=>{if(typeof t=="string"){lie(t,e,n);return}if(typeof t=="function"){cie(t,e,n,r);return}uie(t,e,n,r)},lie=(t,e,n)=>{const r=t===""?e:S$(e,t);r.classGroupId=n},cie=(t,e,n,r)=>{if(die(t)){Mk(t(r),e,n,r);return}e.validators===null&&(e.validators=[]),e.validators.push(tie(n,t))},uie=(t,e,n,r)=>{const s=Object.entries(t),i=s.length;for(let o=0;o<i;o++){const[l,u]=s[o];Mk(u,S$(e,l),n,r)}},S$=(t,e)=>{let n=t;const r=e.split(Fv),s=r.length;for(let i=0;i<s;i++){const o=r[i];let l=n.nextPart.get(o);l||(l=b$(),n.nextPart.set(o,l)),n=l}return n},die=t=>"isThemeGetter"in t&&t.isThemeGetter===!0,fie=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)}}},gx="!",BA=":",hie=[],WA=(t,e,n,r,s)=>({modifiers:t,hasImportantModifier:e,baseClassName:n,maybePostfixModifierPosition:r,isExternal:s}),pie=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 y=0;y<f;y++){const b=s[y];if(o===0&&l===0){if(b===BA){i.push(s.slice(u,y)),u=y+1;continue}if(b==="/"){d=y;continue}}b==="["?o++:b==="]"?o--:b==="("?l++:b===")"&&l--}const h=i.length===0?s:s.slice(u);let m=h,g=!1;h.endsWith(gx)?(m=h.slice(0,-1),g=!0):h.startsWith(gx)&&(m=h.slice(1),g=!0);const _=d&&d>u?d-u:void 0;return WA(i,g,m,_)};if(e){const s=e+BA,i=r;r=o=>o.startsWith(s)?i(o.slice(s.length)):WA(hie,!1,o,void 0,!0)}if(n){const s=r;r=i=>n({className:i,parseClassName:s})}return r},mie=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}},gie=t=>({cache:fie(t.cacheSize),parseClassName:pie(t),sortModifiers:mie(t),postfixLookupClassGroupIds:vie(t),...rie(t)}),vie=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},yie=/\s+/,_ie=(t,e)=>{const{parseClassName:n,getClassGroupId:r,getConflictingClassGroupIds:s,sortModifiers:i,postfixLookupClassGroupIds:o}=e,l=[],u=t.trim().split(yie);let d="";for(let f=u.length-1;f>=0;f-=1){const h=u[f],{isExternal:m,modifiers:g,hasImportantModifier:_,baseClassName:y,maybePostfixModifierPosition:b}=n(h);if(m){d=h+(d.length>0?" "+d:d);continue}let x=!!b,S;if(x){const I=y.substring(0,b);S=r(I);const A=S&&o[S]?r(y):void 0;A&&A!==S&&(S=A,x=!1)}else S=r(y);if(!S){if(!x){d=h+(d.length>0?" "+d:d);continue}if(S=r(y),!S){d=h+(d.length>0?" "+d:d);continue}x=!1}const E=g.length===0?"":g.length===1?g[0]:i(g).join(":"),C=_?E+gx:E,R=C+S;if(l.indexOf(R)>-1)continue;l.push(R);const O=s(S,x);for(let I=0;I<O.length;++I){const A=O[I];l.push(C+A)}d=h+(d.length>0?" "+d:d)}return d},wie=(...t)=>{let e=0,n,r,s="";for(;e<t.length;)(n=t[e++])&&(r=k$(n))&&(s&&(s+=" "),s+=r);return s},k$=t=>{if(typeof t=="string")return t;let e,n="";for(let r=0;r<t.length;r++)t[r]&&(e=k$(t[r]))&&(n&&(n+=" "),n+=e);return n},bie=(t,...e)=>{let n,r,s,i;const o=u=>{const d=e.reduce((f,h)=>h(f),t());return n=gie(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=_ie(u,n);return s(u,f),f};return i=o,(...u)=>i(wie(...u))},xie=[],xr=t=>{const e=n=>n[t]||xie;return e.isThemeGetter=!0,e.themeKey=t,e},E$=/^\[(?:(\w[\w-]*):)?(.+)\]$/i,C$=/^\((?:(\w[\w-]*):)?(.+)\)$/i,Sie=/^\d+(?:\.\d+)?\/\d+(?:\.\d+)?$/,kie=/^(\d+(\.\d+)?)?(xs|sm|md|lg|xl)$/,Eie=/\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$/,Cie=/^(rgba?|hsla?|hwb|(ok)?(lab|lch)|color-mix|color|light-dark)\(.+\)$/,Pie=/^(inset_)?-?((\d+)?\.?(\d+)[a-z]+|0)_-?((\d+)?\.?(\d+)[a-z]+|0)/,Tie=/^(url|image|image-set|cross-fade|element|(repeating-)?(linear|radial|conic)-gradient)\(.+\)$/,ml=t=>Sie.test(t),Rt=t=>!!t&&!Number.isNaN(Number(t)),Io=t=>!!t&&Number.isInteger(Number(t)),Ww=t=>t.endsWith("%")&&Rt(t.slice(0,-1)),ma=t=>kie.test(t),P$=()=>!0,Rie=t=>Eie.test(t)&&!Cie.test(t),Lk=()=>!1,Aie=t=>Pie.test(t),Iie=t=>Tie.test(t),Oie=t=>!Ve(t)&&!Ze(t),Mie=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)),Lie=t=>lc(t,A$,Lk),Ve=t=>E$.test(t),Mc=t=>lc(t,I$,Rie),KA=t=>lc(t,Hie,Rt),Nie=t=>lc(t,M$,P$),Die=t=>lc(t,O$,Lk),GA=t=>lc(t,T$,Lk),$ie=t=>lc(t,R$,Iie),eg=t=>lc(t,L$,Aie),Ze=t=>C$.test(t),Mh=t=>Eu(t,I$),Fie=t=>Eu(t,O$),qA=t=>Eu(t,T$),jie=t=>Eu(t,A$),zie=t=>Eu(t,R$),tg=t=>Eu(t,L$,!0),Vie=t=>Eu(t,M$,!0),lc=(t,e,n)=>{const r=E$.exec(t);return r?r[1]?e(r[1]):n(r[2]):!1},Eu=(t,e,n=!1)=>{const r=C$.exec(t);return r?r[1]?e(r[1]):n:!1},T$=t=>t==="position"||t==="percentage",R$=t=>t==="image"||t==="url",A$=t=>t==="length"||t==="size"||t==="bg-size",I$=t=>t==="length",Hie=t=>t==="number",O$=t=>t==="family-name",M$=t=>t==="number"||t==="weight",L$=t=>t==="shadow",Uie=()=>{const t=xr("color"),e=xr("font"),n=xr("text"),r=xr("font-weight"),s=xr("tracking"),i=xr("leading"),o=xr("breakpoint"),l=xr("container"),u=xr("spacing"),d=xr("radius"),f=xr("shadow"),h=xr("inset-shadow"),m=xr("text-shadow"),g=xr("drop-shadow"),_=xr("blur"),y=xr("perspective"),b=xr("aspect"),x=xr("ease"),S=xr("animate"),E=()=>["auto","avoid","all","avoid-page","page","left","right","column"],C=()=>["center","top","bottom","left","right","top-left","left-top","top-right","right-top","bottom-right","right-bottom","bottom-left","left-bottom"],R=()=>[...C(),Ze,Ve],O=()=>["auto","hidden","clip","visible","scroll"],I=()=>["auto","contain","none"],A=()=>[Ze,Ve,u],L=()=>[ml,"full","auto",...A()],N=()=>[Io,"none","subgrid",Ze,Ve],H=()=>["auto",{span:["full",Io,Ze,Ve]},Io,Ze,Ve],$=()=>[Io,"auto",Ze,Ve],W=()=>["auto","min","max","fr",Ze,Ve],X=()=>["start","end","center","between","around","evenly","stretch","baseline","center-safe","end-safe"],z=()=>["start","end","center","stretch","center-safe","end-safe"],K=()=>["auto",...A()],te=()=>[ml,"auto","full","dvw","dvh","lvw","lvh","svw","svh","min","max","fit",...A()],Z=()=>[l,ml,"screen","full","dvw","lvw","svw","min","max","fit",...A()],J=()=>[ml,"screen","full","lh","dvh","lvh","svh","min","max","fit",...A()],q=()=>[t,Ze,Ve],j=()=>[...C(),qA,GA,{position:[Ze,Ve]}],Y=()=>["no-repeat",{repeat:["","x","y","space","round"]}],ue=()=>["auto","cover","contain",jie,Lie,{size:[Ze,Ve]}],ie=()=>[Ww,Mh,Mc],ce=()=>["","none","full",d,Ze,Ve],he=()=>["",Rt,Mh,Mc],ke=()=>["solid","dashed","dotted","double"],ve=()=>["normal","multiply","screen","overlay","darken","lighten","color-dodge","color-burn","hard-light","soft-light","difference","exclusion","hue","saturation","color","luminosity"],pe=()=>[Rt,Ww,qA,GA],Ne=()=>["","none",_,Ze,Ve],Ae=()=>["none",Rt,Ze,Ve],$e=()=>["none",Rt,Ze,Ve],kt=()=>[Rt,Ze,Ve],fn=()=>[ml,"full",...A()];return{cacheSize:500,theme:{animate:["spin","ping","pulse","bounce"],aspect:["video"],blur:[ma],breakpoint:[ma],color:[P$],container:[ma],"drop-shadow":[ma],ease:["in","out","in-out"],font:[Oie],"font-weight":["thin","extralight","light","normal","medium","semibold","bold","extrabold","black"],"inset-shadow":[ma],leading:["none","tight","snug","normal","relaxed","loose"],perspective:["dramatic","near","normal","midrange","distant","none"],radius:[ma],shadow:[ma],spacing:["px",Rt],text:[ma],"text-shadow":[ma],tracking:["tighter","tight","normal","wide","wider","widest"]},classGroups:{aspect:[{aspect:["auto","square",ml,Ve,Ze,b]}],container:["container"],"container-type":[{"@container":["","normal","size",Ze,Ve]}],"container-named":[Mie],columns:[{columns:[Rt,"auto",Ve,Ze,l]}],"break-after":[{"break-after":E()}],"break-before":[{"break-before":E()}],"break-inside":[{"break-inside":["auto","avoid","avoid-page","avoid-column"]}],"box-decoration":[{"box-decoration":["slice","clone"]}],box:[{box:["border","content"]}],display:["block","inline-block","inline","flex","inline-flex","table","inline-table","table-caption","table-cell","table-column","table-column-group","table-footer-group","table-header-group","table-row-group","table-row","flow-root","grid","inline-grid","contents","list-item","hidden"],sr:["sr-only","not-sr-only"],float:[{float:["right","left","none","start","end"]}],clear:[{clear:["left","right","both","none","start","end"]}],isolation:["isolate","isolation-auto"],"object-fit":[{object:["contain","cover","fill","none","scale-down"]}],"object-position":[{object:R()}],overflow:[{overflow:O()}],"overflow-x":[{"overflow-x":O()}],"overflow-y":[{"overflow-y":O()}],overscroll:[{overscroll:I()}],"overscroll-x":[{"overscroll-x":I()}],"overscroll-y":[{"overscroll-y":I()}],position:["static","fixed","absolute","relative","sticky"],inset:[{inset:L()}],"inset-x":[{"inset-x":L()}],"inset-y":[{"inset-y":L()}],start:[{"inset-s":L(),start:L()}],end:[{"inset-e":L(),end:L()}],"inset-bs":[{"inset-bs":L()}],"inset-be":[{"inset-be":L()}],top:[{top:L()}],right:[{right:L()}],bottom:[{bottom:L()}],left:[{left:L()}],visibility:["visible","invisible","collapse"],z:[{z:[Io,"auto",Ze,Ve]}],basis:[{basis:[ml,"full","auto",l,...A()]}],"flex-direction":[{flex:["row","row-reverse","col","col-reverse"]}],"flex-wrap":[{flex:["nowrap","wrap","wrap-reverse"]}],flex:[{flex:[Rt,ml,"auto","initial","none",Ve]}],grow:[{grow:["",Rt,Ze,Ve]}],shrink:[{shrink:["",Rt,Ze,Ve]}],order:[{order:[Io,"first","last","none",Ze,Ve]}],"grid-cols":[{"grid-cols":N()}],"col-start-end":[{col:H()}],"col-start":[{"col-start":$()}],"col-end":[{"col-end":$()}],"grid-rows":[{"grid-rows":N()}],"row-start-end":[{row:H()}],"row-start":[{"row-start":$()}],"row-end":[{"row-end":$()}],"grid-flow":[{"grid-flow":["row","col","dense","row-dense","col-dense"]}],"auto-cols":[{"auto-cols":W()}],"auto-rows":[{"auto-rows":W()}],gap:[{gap:A()}],"gap-x":[{"gap-x":A()}],"gap-y":[{"gap-y":A()}],"justify-content":[{justify:[...X(),"normal"]}],"justify-items":[{"justify-items":[...z(),"normal"]}],"justify-self":[{"justify-self":["auto",...z()]}],"align-content":[{content:["normal",...X()]}],"align-items":[{items:[...z(),{baseline:["","last"]}]}],"align-self":[{self:["auto",...z(),{baseline:["","last"]}]}],"place-content":[{"place-content":X()}],"place-items":[{"place-items":[...z(),"baseline"]}],"place-self":[{"place-self":["auto",...z()]}],p:[{p:A()}],px:[{px:A()}],py:[{py:A()}],ps:[{ps:A()}],pe:[{pe:A()}],pbs:[{pbs:A()}],pbe:[{pbe:A()}],pt:[{pt:A()}],pr:[{pr:A()}],pb:[{pb:A()}],pl:[{pl:A()}],m:[{m:K()}],mx:[{mx:K()}],my:[{my:K()}],ms:[{ms:K()}],me:[{me:K()}],mbs:[{mbs:K()}],mbe:[{mbe:K()}],mt:[{mt:K()}],mr:[{mr:K()}],mb:[{mb:K()}],ml:[{ml:K()}],"space-x":[{"space-x":A()}],"space-x-reverse":["space-x-reverse"],"space-y":[{"space-y":A()}],"space-y-reverse":["space-y-reverse"],size:[{size:te()}],"inline-size":[{inline:["auto",...Z()]}],"min-inline-size":[{"min-inline":["auto",...Z()]}],"max-inline-size":[{"max-inline":["none",...Z()]}],"block-size":[{block:["auto",...J()]}],"min-block-size":[{"min-block":["auto",...J()]}],"max-block-size":[{"max-block":["none",...J()]}],w:[{w:[l,"screen",...te()]}],"min-w":[{"min-w":[l,"screen","none",...te()]}],"max-w":[{"max-w":[l,"screen","none","prose",{screen:[o]},...te()]}],h:[{h:["screen","lh",...te()]}],"min-h":[{"min-h":["screen","lh","none",...te()]}],"max-h":[{"max-h":["screen","lh","none",...te()]}],"font-size":[{text:["base",n,Mh,Mc]}],"font-smoothing":["antialiased","subpixel-antialiased"],"font-style":["italic","not-italic"],"font-weight":[{font:[r,Vie,Nie]}],"font-stretch":[{"font-stretch":["ultra-condensed","extra-condensed","condensed","semi-condensed","normal","semi-expanded","expanded","extra-expanded","ultra-expanded",Ww,Ve]}],"font-family":[{font:[Fie,Die,e]}],"font-features":[{"font-features":[Ve]}],"fvn-normal":["normal-nums"],"fvn-ordinal":["ordinal"],"fvn-slashed-zero":["slashed-zero"],"fvn-figure":["lining-nums","oldstyle-nums"],"fvn-spacing":["proportional-nums","tabular-nums"],"fvn-fraction":["diagonal-fractions","stacked-fractions"],tracking:[{tracking:[s,Ze,Ve]}],"line-clamp":[{"line-clamp":[Rt,"none",Ze,KA]}],leading:[{leading:["none",i,...A()]}],"list-image":[{"list-image":["none",Ze,Ve]}],"list-style-position":[{list:["inside","outside"]}],"list-style-type":[{list:["disc","decimal","none",Ze,Ve]}],"text-alignment":[{text:["left","center","right","justify","start","end"]}],"placeholder-color":[{placeholder:q()}],"text-color":[{text:q()}],"text-decoration":["underline","overline","line-through","no-underline"],"text-decoration-style":[{decoration:[...ke(),"wavy"]}],"text-decoration-thickness":[{decoration:[Rt,"from-font","auto",Ze,Mc]}],"text-decoration-color":[{decoration:q()}],"underline-offset":[{"underline-offset":[Rt,"auto",Ze,Ve]}],"text-transform":["uppercase","lowercase","capitalize","normal-case"],"text-overflow":["truncate","text-ellipsis","text-clip"],"text-wrap":[{text:["wrap","nowrap","balance","pretty"]}],indent:[{indent:A()}],"tab-size":[{tab:[Io,Ze,Ve]}],"vertical-align":[{align:["baseline","top","middle","bottom","text-top","text-bottom","sub","super",Ze,Ve]}],whitespace:[{whitespace:["normal","nowrap","pre","pre-line","pre-wrap","break-spaces"]}],break:[{break:["normal","words","all","keep"]}],wrap:[{wrap:["break-word","anywhere","normal"]}],hyphens:[{hyphens:["none","manual","auto"]}],content:[{content:["none",Ze,Ve]}],"bg-attachment":[{bg:["fixed","local","scroll"]}],"bg-clip":[{"bg-clip":["border","padding","content","text"]}],"bg-origin":[{"bg-origin":["border","padding","content"]}],"bg-position":[{bg:j()}],"bg-repeat":[{bg:Y()}],"bg-size":[{bg:ue()}],"bg-image":[{bg:["none",{linear:[{to:["t","tr","r","br","b","bl","l","tl"]},Io,Ze,Ve],radial:["",Ze,Ve],conic:["",Io,Ze,Ve]},zie,$ie]}],"bg-color":[{bg:q()}],"gradient-from-pos":[{from:ie()}],"gradient-via-pos":[{via:ie()}],"gradient-to-pos":[{to:ie()}],"gradient-from":[{from:q()}],"gradient-via":[{via:q()}],"gradient-to":[{to:q()}],rounded:[{rounded:ce()}],"rounded-s":[{"rounded-s":ce()}],"rounded-e":[{"rounded-e":ce()}],"rounded-t":[{"rounded-t":ce()}],"rounded-r":[{"rounded-r":ce()}],"rounded-b":[{"rounded-b":ce()}],"rounded-l":[{"rounded-l":ce()}],"rounded-ss":[{"rounded-ss":ce()}],"rounded-se":[{"rounded-se":ce()}],"rounded-ee":[{"rounded-ee":ce()}],"rounded-es":[{"rounded-es":ce()}],"rounded-tl":[{"rounded-tl":ce()}],"rounded-tr":[{"rounded-tr":ce()}],"rounded-br":[{"rounded-br":ce()}],"rounded-bl":[{"rounded-bl":ce()}],"border-w":[{border:he()}],"border-w-x":[{"border-x":he()}],"border-w-y":[{"border-y":he()}],"border-w-s":[{"border-s":he()}],"border-w-e":[{"border-e":he()}],"border-w-bs":[{"border-bs":he()}],"border-w-be":[{"border-be":he()}],"border-w-t":[{"border-t":he()}],"border-w-r":[{"border-r":he()}],"border-w-b":[{"border-b":he()}],"border-w-l":[{"border-l":he()}],"divide-x":[{"divide-x":he()}],"divide-x-reverse":["divide-x-reverse"],"divide-y":[{"divide-y":he()}],"divide-y-reverse":["divide-y-reverse"],"border-style":[{border:[...ke(),"hidden","none"]}],"divide-style":[{divide:[...ke(),"hidden","none"]}],"border-color":[{border:q()}],"border-color-x":[{"border-x":q()}],"border-color-y":[{"border-y":q()}],"border-color-s":[{"border-s":q()}],"border-color-e":[{"border-e":q()}],"border-color-bs":[{"border-bs":q()}],"border-color-be":[{"border-be":q()}],"border-color-t":[{"border-t":q()}],"border-color-r":[{"border-r":q()}],"border-color-b":[{"border-b":q()}],"border-color-l":[{"border-l":q()}],"divide-color":[{divide:q()}],"outline-style":[{outline:[...ke(),"none","hidden"]}],"outline-offset":[{"outline-offset":[Rt,Ze,Ve]}],"outline-w":[{outline:["",Rt,Mh,Mc]}],"outline-color":[{outline:q()}],shadow:[{shadow:["","inner","none",f,tg,eg]}],"shadow-color":[{shadow:q()}],"inset-shadow":[{"inset-shadow":["none",h,tg,eg]}],"inset-shadow-color":[{"inset-shadow":q()}],"ring-w":[{ring:he()}],"ring-w-inset":["ring-inset"],"ring-color":[{ring:q()}],"ring-offset-w":[{"ring-offset":[Rt,Mc]}],"ring-offset-color":[{"ring-offset":q()}],"inset-ring-w":[{"inset-ring":he()}],"inset-ring-color":[{"inset-ring":q()}],"text-shadow":[{"text-shadow":["none",m,tg,eg]}],"text-shadow-color":[{"text-shadow":q()}],opacity:[{opacity:[Rt,Ze,Ve]}],"mix-blend":[{"mix-blend":[...ve(),"plus-darker","plus-lighter"]}],"bg-blend":[{"bg-blend":ve()}],"mask-clip":[{"mask-clip":["border","padding","content","fill","stroke","view"]},"mask-no-clip"],"mask-composite":[{mask:["add","subtract","intersect","exclude"]}],"mask-image-linear-pos":[{"mask-linear":[Rt]}],"mask-image-linear-from-pos":[{"mask-linear-from":pe()}],"mask-image-linear-to-pos":[{"mask-linear-to":pe()}],"mask-image-linear-from-color":[{"mask-linear-from":q()}],"mask-image-linear-to-color":[{"mask-linear-to":q()}],"mask-image-t-from-pos":[{"mask-t-from":pe()}],"mask-image-t-to-pos":[{"mask-t-to":pe()}],"mask-image-t-from-color":[{"mask-t-from":q()}],"mask-image-t-to-color":[{"mask-t-to":q()}],"mask-image-r-from-pos":[{"mask-r-from":pe()}],"mask-image-r-to-pos":[{"mask-r-to":pe()}],"mask-image-r-from-color":[{"mask-r-from":q()}],"mask-image-r-to-color":[{"mask-r-to":q()}],"mask-image-b-from-pos":[{"mask-b-from":pe()}],"mask-image-b-to-pos":[{"mask-b-to":pe()}],"mask-image-b-from-color":[{"mask-b-from":q()}],"mask-image-b-to-color":[{"mask-b-to":q()}],"mask-image-l-from-pos":[{"mask-l-from":pe()}],"mask-image-l-to-pos":[{"mask-l-to":pe()}],"mask-image-l-from-color":[{"mask-l-from":q()}],"mask-image-l-to-color":[{"mask-l-to":q()}],"mask-image-x-from-pos":[{"mask-x-from":pe()}],"mask-image-x-to-pos":[{"mask-x-to":pe()}],"mask-image-x-from-color":[{"mask-x-from":q()}],"mask-image-x-to-color":[{"mask-x-to":q()}],"mask-image-y-from-pos":[{"mask-y-from":pe()}],"mask-image-y-to-pos":[{"mask-y-to":pe()}],"mask-image-y-from-color":[{"mask-y-from":q()}],"mask-image-y-to-color":[{"mask-y-to":q()}],"mask-image-radial":[{"mask-radial":[Ze,Ve]}],"mask-image-radial-from-pos":[{"mask-radial-from":pe()}],"mask-image-radial-to-pos":[{"mask-radial-to":pe()}],"mask-image-radial-from-color":[{"mask-radial-from":q()}],"mask-image-radial-to-color":[{"mask-radial-to":q()}],"mask-image-radial-shape":[{"mask-radial":["circle","ellipse"]}],"mask-image-radial-size":[{"mask-radial":[{closest:["side","corner"],farthest:["side","corner"]}]}],"mask-image-radial-pos":[{"mask-radial-at":C()}],"mask-image-conic-pos":[{"mask-conic":[Rt]}],"mask-image-conic-from-pos":[{"mask-conic-from":pe()}],"mask-image-conic-to-pos":[{"mask-conic-to":pe()}],"mask-image-conic-from-color":[{"mask-conic-from":q()}],"mask-image-conic-to-color":[{"mask-conic-to":q()}],"mask-mode":[{mask:["alpha","luminance","match"]}],"mask-origin":[{"mask-origin":["border","padding","content","fill","stroke","view"]}],"mask-position":[{mask:j()}],"mask-repeat":[{mask:Y()}],"mask-size":[{mask:ue()}],"mask-type":[{"mask-type":["alpha","luminance"]}],"mask-image":[{mask:["none",Ze,Ve]}],filter:[{filter:["","none",Ze,Ve]}],blur:[{blur:Ne()}],brightness:[{brightness:[Rt,Ze,Ve]}],contrast:[{contrast:[Rt,Ze,Ve]}],"drop-shadow":[{"drop-shadow":["","none",g,tg,eg]}],"drop-shadow-color":[{"drop-shadow":q()}],grayscale:[{grayscale:["",Rt,Ze,Ve]}],"hue-rotate":[{"hue-rotate":[Rt,Ze,Ve]}],invert:[{invert:["",Rt,Ze,Ve]}],saturate:[{saturate:[Rt,Ze,Ve]}],sepia:[{sepia:["",Rt,Ze,Ve]}],"backdrop-filter":[{"backdrop-filter":["","none",Ze,Ve]}],"backdrop-blur":[{"backdrop-blur":Ne()}],"backdrop-brightness":[{"backdrop-brightness":[Rt,Ze,Ve]}],"backdrop-contrast":[{"backdrop-contrast":[Rt,Ze,Ve]}],"backdrop-grayscale":[{"backdrop-grayscale":["",Rt,Ze,Ve]}],"backdrop-hue-rotate":[{"backdrop-hue-rotate":[Rt,Ze,Ve]}],"backdrop-invert":[{"backdrop-invert":["",Rt,Ze,Ve]}],"backdrop-opacity":[{"backdrop-opacity":[Rt,Ze,Ve]}],"backdrop-saturate":[{"backdrop-saturate":[Rt,Ze,Ve]}],"backdrop-sepia":[{"backdrop-sepia":["",Rt,Ze,Ve]}],"border-collapse":[{border:["collapse","separate"]}],"border-spacing":[{"border-spacing":A()}],"border-spacing-x":[{"border-spacing-x":A()}],"border-spacing-y":[{"border-spacing-y":A()}],"table-layout":[{table:["auto","fixed"]}],caption:[{caption:["top","bottom"]}],transition:[{transition:["","all","colors","opacity","shadow","transform","none",Ze,Ve]}],"transition-behavior":[{transition:["normal","discrete"]}],duration:[{duration:[Rt,"initial",Ze,Ve]}],ease:[{ease:["linear","initial",x,Ze,Ve]}],delay:[{delay:[Rt,Ze,Ve]}],animate:[{animate:["none",S,Ze,Ve]}],backface:[{backface:["hidden","visible"]}],perspective:[{perspective:[y,Ze,Ve]}],"perspective-origin":[{"perspective-origin":R()}],rotate:[{rotate:Ae()}],"rotate-x":[{"rotate-x":Ae()}],"rotate-y":[{"rotate-y":Ae()}],"rotate-z":[{"rotate-z":Ae()}],scale:[{scale:$e()}],"scale-x":[{"scale-x":$e()}],"scale-y":[{"scale-y":$e()}],"scale-z":[{"scale-z":$e()}],"scale-3d":["scale-3d"],skew:[{skew:kt()}],"skew-x":[{"skew-x":kt()}],"skew-y":[{"skew-y":kt()}],transform:[{transform:[Ze,Ve,"","none","gpu","cpu"]}],"transform-origin":[{origin:R()}],"transform-style":[{transform:["3d","flat"]}],translate:[{translate:fn()}],"translate-x":[{"translate-x":fn()}],"translate-y":[{"translate-y":fn()}],"translate-z":[{"translate-z":fn()}],"translate-none":["translate-none"],zoom:[{zoom:[Io,Ze,Ve]}],accent:[{accent:q()}],appearance:[{appearance:["none","auto"]}],"caret-color":[{caret:q()}],"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",Ze,Ve]}],"field-sizing":[{"field-sizing":["fixed","content"]}],"pointer-events":[{"pointer-events":["auto","none"]}],resize:[{resize:["none","","y","x"]}],"scroll-behavior":[{scroll:["auto","smooth"]}],"scrollbar-thumb-color":[{"scrollbar-thumb":q()}],"scrollbar-track-color":[{"scrollbar-track":q()}],"scrollbar-gutter":[{"scrollbar-gutter":["auto","stable","both"]}],"scrollbar-w":[{scrollbar:["auto","thin","none"]}],"scroll-m":[{"scroll-m":A()}],"scroll-mx":[{"scroll-mx":A()}],"scroll-my":[{"scroll-my":A()}],"scroll-ms":[{"scroll-ms":A()}],"scroll-me":[{"scroll-me":A()}],"scroll-mbs":[{"scroll-mbs":A()}],"scroll-mbe":[{"scroll-mbe":A()}],"scroll-mt":[{"scroll-mt":A()}],"scroll-mr":[{"scroll-mr":A()}],"scroll-mb":[{"scroll-mb":A()}],"scroll-ml":[{"scroll-ml":A()}],"scroll-p":[{"scroll-p":A()}],"scroll-px":[{"scroll-px":A()}],"scroll-py":[{"scroll-py":A()}],"scroll-ps":[{"scroll-ps":A()}],"scroll-pe":[{"scroll-pe":A()}],"scroll-pbs":[{"scroll-pbs":A()}],"scroll-pbe":[{"scroll-pbe":A()}],"scroll-pt":[{"scroll-pt":A()}],"scroll-pr":[{"scroll-pr":A()}],"scroll-pb":[{"scroll-pb":A()}],"scroll-pl":[{"scroll-pl":A()}],"snap-align":[{snap:["start","end","center","align-none"]}],"snap-stop":[{snap:["normal","always"]}],"snap-type":[{snap:["none","x","y","both"]}],"snap-strictness":[{snap:["mandatory","proximity"]}],touch:[{touch:["auto","none","manipulation"]}],"touch-x":[{"touch-pan":["x","left","right"]}],"touch-y":[{"touch-pan":["y","up","down"]}],"touch-pz":["touch-pinch-zoom"],select:[{select:["none","text","all","auto"]}],"will-change":[{"will-change":["auto","scroll","contents","transform",Ze,Ve]}],fill:[{fill:["none",...q()]}],"stroke-w":[{stroke:[Rt,Mh,Mc,KA]}],stroke:[{stroke:["none",...q()]}],"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"]}},Zie=bie(Uie);function Fr(...t){return Zie(w$(t))}const mp=({provider:t,className:e})=>{if(t==="x")return T.jsx(Xse,{className:Fr("h-6 w-6",e),"aria-hidden":"true"});if(t==="pinterest")return T.jsx("svg",{viewBox:"0 0 24 24",className:Fr("h-6 w-6",e),"aria-hidden":"true",children:T.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"?Jse:Qse;return T.jsx("span",{"aria-hidden":"true",className:Fr("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"}})},Bie=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},Wie=({reference:t,imageUrl:e,onOpen:n})=>{const[r,s]=v.useState(!1),i=!!e&&!r,o=t.url?Bie(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 T.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:Fr("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?T.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")?T.jsx(mp,{provider:o,className:Fr("h-3.5 w-3.5 shrink-0",o==="pinterest"&&"text-[#e60023]")}):null,!i||!o?T.jsx("span",{className:"max-w-40 truncate",children:d}):null]})},Kie=({references:t,source:e,sessionId:n,variantId:r,projectPath:s,className:i})=>{const o=xi(),l=SY(t);return l?T.jsx("div",{className:Fr("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 T.jsx(Wie,{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},ame=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}},lme=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},Gie=t=>{const e=new URLSearchParams(t),n=e.get("historySession"),r=e.get("historyVariant");return n&&r?{sessionId:n,variantId:r}:null},YA=t=>typeof t=="boolean"?`${t}`:t===0?"0":t,XA=w$,qie=(t,e)=>n=>{var r;if((e==null?void 0:e.variants)==null)return XA(t,n==null?void 0:n.class,n==null?void 0:n.className);const{variants:s,defaultVariants:i}=e,o=Object.keys(s).map(d=>{const f=n==null?void 0:n[d],h=i==null?void 0:i[d];if(f===null)return null;const m=YA(f)||YA(h);return s[d][m]}),l=n&&Object.entries(n).reduce((d,f)=>{let[h,m]=f;return m===void 0||(d[h]=m),d},{}),u=e==null||(r=e.compoundVariants)===null||r===void 0?void 0:r.reduce((d,f)=>{let{class:h,className:m,...g}=f;return Object.entries(g).every(_=>{let[y,b]=_;return Array.isArray(b)?b.includes({...i,...l}[y]):{...i,...l}[y]===b})?[...d,h,m]:d},[]);return XA(t,o,u,n==null?void 0:n.class,n==null?void 0:n.className)},Yie=qie(["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"}}),QA={default:16,compact:14},Xie={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)]"},N$=v.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",m=n??"default",g=m==="icon"||m==="icon-compact",_=m==="compact"||m==="icon-compact",y=_?QA.compact:QA.default;return T.jsxs("button",{...d,ref:f,type:u,disabled:o||r,"aria-busy":r||d["aria-busy"],className:Fr(Yie({variant:h,size:m,iconLeft:!g&&!!s,iconRight:!g&&!!i}),"rounded-lg",t),children:[T.jsx("span",{"aria-hidden":!0,className:Fr("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",Xie[h])}),T.jsxs("span",{className:"relative inline-flex items-center justify-center gap-[inherit]",children:[T.jsxs("span",{className:Fr("inline-flex items-center justify-center gap-[inherit]",r&&"opacity-0"),children:[s&&!g?T.jsx(s,{size:y,strokeWidth:1.5,"aria-hidden":!0}):null,T.jsx("span",{className:"[text-box:trim-both_cap_alphabetic]",children:l}),i&&!g?T.jsx(i,{size:y,strokeWidth:1.5,"aria-hidden":!0}):null]}),r?T.jsx("span",{"aria-hidden":!0,className:"absolute inset-0 flex items-center justify-center",children:T.jsx("svg",{className:_?"h-7 w-7":"h-9 w-9",viewBox:"0 0 24 24",fill:"none",children:T.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]})]})});N$.displayName="Button";var Qie=Object.defineProperty,jf=(t,e)=>Qie(t,"name",{value:e,configurable:!0}),D$=!!(typeof window<"u"&&window.document&&window.document.createElement);function Er(t,e,{checkForDefaultPrevented:n=!0}={}){return jf(function(s){if(t==null||t(s),n===!1||!s||!s.defaultPrevented)return e==null?void 0:e(s)},"handleEvent")}jf(Er,"composeEventHandlers");function Jie(t){var e;if(!D$)throw new Error("Cannot access window outside of the DOM");return((e=t==null?void 0:t.ownerDocument)==null?void 0:e.defaultView)??window}jf(Jie,"getOwnerWindow");function vx(t){if(!D$)throw new Error("Cannot access document outside of the DOM");return(t==null?void 0:t.ownerDocument)??document}jf(vx,"getOwnerDocument");function $$(t,e=!1){const{activeElement:n}=vx(t);if(!(n!=null&&n.nodeName))return null;if(F$(n)&&n.contentDocument)return $$(n.contentDocument.body,e);if(e){const r=n.getAttribute("aria-activedescendant");if(r){const s=vx(n).getElementById(r);if(s)return s}}return n}jf($$,"getActiveElement");function F$(t){return t.tagName==="IFRAME"}jf(F$,"isFrame");var eoe=Object.defineProperty,Nk=(t,e)=>eoe(t,"name",{value:e,configurable:!0});function yx(t,e){if(typeof t=="function")return t(e);t!=null&&(t.current=e)}Nk(yx,"setRef");function j$(...t){return e=>{let n=!1;const r=t.map(s=>{const i=yx(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():yx(t[s],null)}}}}Nk(j$,"composeRefs");function Ts(...t){return v.useCallback(j$(...t),t)}Nk(Ts,"useComposedRefs");var toe=Object.defineProperty,ji=(t,e)=>toe(t,"name",{value:e,configurable:!0});function noe(t,e){const n=v.createContext(e);n.displayName=t+"Context";const r=ji(i=>{const{children:o,...l}=i,u=v.useMemo(()=>l,Object.values(l));return T.jsx(n.Provider,{value:u,children:o})},"Provider");r.displayName=t+"Provider";function s(i,o={}){const{optional:l=!1}=o,u=v.useContext(n);if(u)return u;if(e!==void 0)return e;if(!l)throw new Error(`\`${i}\` must be used within \`${t}\``)}return ji(s,"useContext"),[r,s]}ji(noe,"createContext");function bm(t,e=[]){let n=[];function r(i,o){const l=v.createContext(o);l.displayName=i+"Context";const u=n.length;n=[...n,o];const d=ji(h=>{var x;const{scope:m,children:g,..._}=h,y=((x=m==null?void 0:m[t])==null?void 0:x[u])||l,b=v.useMemo(()=>_,Object.values(_));return T.jsx(y.Provider,{value:b,children:g})},"Provider");d.displayName=i+"Provider";function f(h,m,g={}){var x;const{optional:_=!1}=g,y=((x=m==null?void 0:m[t])==null?void 0:x[u])||l,b=v.useContext(y);if(b)return b;if(o!==void 0)return o;if(!_)throw new Error(`\`${h}\` must be used within \`${i}\``)}return ji(f,"useContext"),[d,f]}ji(r,"createContext");const s=ji(()=>{const i=n.map(o=>v.createContext(o));return ji(function(l){const u=(l==null?void 0:l[t])||i;return v.useMemo(()=>({[`__scope${t}`]:{...l,[t]:u}}),[l,u])},"useScope")},"createScope");return s.scopeName=t,[r,z$(s,...e)]}ji(bm,"createContextScope");function z$(...t){const e=t[0];if(t.length===1)return e;const n=ji(()=>{const r=t.map(s=>({useScope:s(),scopeName:s.scopeName}));return ji(function(i){const o=r.reduce((l,{useScope:u,scopeName:d})=>{const h=u(i)[`__scope${d}`];return{...l,...h}},{});return v.useMemo(()=>({[`__scope${e.scopeName}`]:o}),[o])},"useComposedScopes")},"createScope");return n.scopeName=e.scopeName,n}ji(z$,"composeContextScopes");var roe=Object.defineProperty,Si=(t,e)=>roe(t,"name",{value:e,configurable:!0});function Sy(t){const e=v.forwardRef((n,r)=>{let{children:s,...i}=n,o=null,l=!1;const u=[];s=K$(s),v.Children.forEach(s,m=>{var g;if(B$(m)){l=!0;const _=m;let y="child"in _.props?_.props.child:_.props.children;for(;Dk(y)&&typeof jv=="function";)y=jv(y._payload);o=soe(_,y),u.push((g=o==null?void 0:o.props)==null?void 0:g.children)}else u.push(m)}),o?o=v.cloneElement(o,void 0,u):!l&&v.Children.count(s)===1&&v.isValidElement(s)&&(o=s);const d=o?Z$(o):void 0,f=Ts(r,d);if(!o){if(s||s===0)throw new Error(l?aoe(t):ooe(t));return s}const h=U$(i,o.props??{});return o.type!==v.Fragment&&(h.ref=r?f:d),v.cloneElement(o,h)});return e.displayName=`${t}.Slot`,e}Si(Sy,"createSlot");var V$=Symbol.for("radix.slottable");function H$(t){const e=Si(n=>"child"in n?n.children(n.child):n.children,"Slottable");return e.displayName=`${t}.Slottable`,e.__radixId=V$,e}Si(H$,"createSlottable");var soe=Si((t,e)=>"child"in t.props?v.isValidElement(e)?v.cloneElement(e,void 0,t.props.children(e.props.children)):null:v.isValidElement(e)?e:null,"getSlottableElementFromSlottable");function U$(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]=G$(i,s))}return{...t,...n}}Si(U$,"mergeProps");function Z$(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)}Si(Z$,"getElementRef");function B$(t){return v.isValidElement(t)&&typeof t.type=="function"&&"__radixId"in t.type&&t.type.__radixId===V$}Si(B$,"isSlottable");var ioe=Symbol.for("react.lazy");function Dk(t){return t!=null&&typeof t=="object"&&"$$typeof"in t&&t.$$typeof===ioe&&"_payload"in t&&W$(t._payload)}Si(Dk,"isLazyComponent");function W$(t){return typeof t=="object"&&t!==null&&"then"in t}Si(W$,"isPromiseLike");function K$(t){let e=t;for(;Dk(e)&&typeof jv=="function";)e=jv(e._payload);return e}Si(K$,"useUnwrappedLazy");function G$(...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}Si(G$,"concatAriaDescribedby");var ooe=Si(t=>`${t} failed to slot onto its children. Expected a single React element child or \`Slottable\`.`,"createSlotError"),aoe=Si(t=>`${t} failed to slot onto its \`Slottable\`. Expected \`Slottable\` to receive a single React element child.`,"createSlottableError"),jv=Of[" use ".trim().toString()],loe=Object.defineProperty,coe=(t,e)=>loe(t,"name",{value:e,configurable:!0}),uoe=["a","button","div","form","h2","h3","img","input","label","li","nav","ol","p","select","span","svg","ul"],ki=uoe.reduce((t,e)=>{const n=Sy(`Primitive.${e}`),r=v.forwardRef((s,i)=>{const{asChild:o,...l}=s,u=o?n:e;return typeof window<"u"&&(window[Symbol.for("radix-ui")]=!0),T.jsx(u,{...l,ref:i})});return r.displayName=`Primitive.${e}`,{...t,[e]:r}},{});function q$(t,e){t&&wm.flushSync(()=>t.dispatchEvent(e))}coe(q$,"dispatchDiscreteCustomEvent");var Bs=globalThis!=null&&globalThis.document?v.useLayoutEffect:()=>{},doe=Object.defineProperty,foe=(t,e)=>doe(t,"name",{value:e,configurable:!0}),JA=Of[" useInsertionEffect ".trim().toString()];function bu(t){const e=v.useRef(t);return typeof JA=="function"?JA(()=>{e.current=t}):Bs(()=>{e.current=t}),v.useMemo(()=>((...n)=>{var r;return(r=e.current)==null?void 0:r.call(e,...n)}),[])}foe(bu,"useCallbackRef");var hoe=Object.defineProperty,$r=(t,e)=>hoe(t,"name",{value:e,configurable:!0}),_x="dismissableLayer.update",poe="dismissableLayer.pointerDownOutside",moe="dismissableLayer.focusOutside",e3,Y$=v.createContext({layers:new Set,layersWithOutsidePointerEventsDisabled:new Set,branches:new Set,dismissableSurfaces:new Set}),$k=v.forwardRef($r(function(e,n){const{disableOutsidePointerEvents:r=!1,deferPointerDownOutside:s=!1,onEscapeKeyDown:i,onPointerDownOutside:o,onFocusOutside:l,onInteractOutside:u,onDismiss:d,...f}=e,h=v.useContext(Y$),[m,g]=v.useState(null),_=(m==null?void 0:m.ownerDocument)??(globalThis==null?void 0:globalThis.document),[,y]=v.useState({}),b=Ts(n,g),x=Array.from(h.layers),[S]=[...h.layersWithOutsidePointerEventsDisabled].slice(-1),E=S?x.indexOf(S):-1,C=m?x.indexOf(m):-1,R=h.layersWithOutsidePointerEventsDisabled.size>0,O=C>=E,I=v.useRef(!1),A=Q$($=>{o==null||o($),u==null||u($),$.defaultPrevented||d==null||d()},{ownerDocument:_,deferPointerDownOutside:s,isDeferredPointerDownOutsideRef:I,dismissableSurfaces:h.dismissableSurfaces,shouldHandlePointerDownOutside:v.useCallback($=>{if(!($ instanceof Node))return!1;const W=[...h.branches].some(X=>X.contains($));return O&&!W},[h.branches,O])}),L=J$($=>{if(s&&I.current)return;const W=$.target;[...h.branches].some(z=>z.contains(W))||(l==null||l($),u==null||u($),$.defaultPrevented||d==null||d())},_),N=m?C===x.length-1:!1,H=bu($=>{$.key==="Escape"&&(i==null||i($),!$.defaultPrevented&&d&&($.preventDefault(),d()))});return v.useEffect(()=>{if(N)return _.addEventListener("keydown",H,{capture:!0}),()=>_.removeEventListener("keydown",H,{capture:!0})},[_,N,H]),v.useEffect(()=>{if(m)return r&&(h.layersWithOutsidePointerEventsDisabled.size===0&&(e3=_.body.style.pointerEvents,_.body.style.pointerEvents="none"),h.layersWithOutsidePointerEventsDisabled.add(m)),h.layers.add(m),wx(),()=>{r&&(h.layersWithOutsidePointerEventsDisabled.delete(m),h.layersWithOutsidePointerEventsDisabled.size===0&&(_.body.style.pointerEvents=e3))}},[m,_,r,h]),v.useEffect(()=>()=>{m&&(h.layers.delete(m),h.layersWithOutsidePointerEventsDisabled.delete(m),wx())},[m,h]),v.useEffect(()=>{const $=$r(()=>y({}),"handleUpdate");return document.addEventListener(_x,$),()=>document.removeEventListener(_x,$)},[]),T.jsx(ki.div,{...f,ref:b,style:{pointerEvents:R?O?"auto":"none":void 0,...e.style},onFocusCapture:Er(e.onFocusCapture,L.onFocusCapture),onBlurCapture:Er(e.onBlurCapture,L.onBlurCapture),onPointerDownCapture:Er(e.onPointerDownCapture,A.onPointerDownCapture)})},"DismissableLayer"));function X$(){const t=v.useContext(Y$),[e,n]=v.useState(null);return v.useEffect(()=>{if(e)return t.dismissableSurfaces.add(e),()=>{t.dismissableSurfaces.delete(e)}},[e,t.dismissableSurfaces]),n}$r(X$,"useDismissableLayerSurface");var goe=$r(()=>!0,"IS_TRUE");function Q$(t,e){const{ownerDocument:n=globalThis==null?void 0:globalThis.document,deferPointerDownOutside:r=!1,isDeferredPointerDownOutsideRef:s,dismissableSurfaces:i,shouldHandlePointerDownOutside:o=goe}=e,l=bu(t),u=v.useRef(!1),d=v.useRef(!1),f=v.useRef(new Map),h=v.useRef(()=>{});return v.useEffect(()=>{function m(){d.current=!1,s.current=!1,f.current.clear()}$r(m,"resetOutsideInteraction");function g(){return Array.from(f.current.values()).some(Boolean)}$r(g,"isOutsideInteractionIntercepted");function _(E){if(!d.current)return;const C=E.target;C instanceof Node&&[...i].some(O=>O.contains(C))||f.current.set(E.type,!0),E.type==="click"&&window.setTimeout(()=>{d.current&&h.current()},0)}$r(_,"handleInteractionCapture");function y(E){d.current&&f.current.set(E.type,!1)}$r(y,"handleInteractionBubble");const b=$r(E=>{if(E.target&&!u.current){let C=function(){n.removeEventListener("click",h.current);const O=g();m(),O||Fk(poe,l,R,{discrete:!0})};if($r(C,"handleAndDispatchPointerDownOutsideEvent"),!o(E.target)){n.removeEventListener("click",h.current),m(),u.current=!1;return}const R={originalEvent:E};d.current=!0,s.current=r&&E.button===0,f.current.clear(),!r||E.button!==0?C():(n.removeEventListener("click",h.current),h.current=C,n.addEventListener("click",h.current,{once:!0}))}else n.removeEventListener("click",h.current),m();u.current=!1},"handlePointerDown"),x=["pointerup","mousedown","mouseup","touchstart","touchend","click"];for(const E of x)n.addEventListener(E,_,!0),n.addEventListener(E,y);const S=window.setTimeout(()=>{n.addEventListener("pointerdown",b)},0);return()=>{window.clearTimeout(S),n.removeEventListener("pointerdown",b),n.removeEventListener("click",h.current);for(const E of x)n.removeEventListener(E,_,!0),n.removeEventListener(E,y)}},[n,l,r,s,i,o]),{onPointerDownCapture:$r(()=>u.current=!0,"onPointerDownCapture")}}$r(Q$,"usePointerDownOutside");function J$(t,e=globalThis==null?void 0:globalThis.document){const n=bu(t),r=v.useRef(!1);return v.useEffect(()=>{const s=$r(i=>{i.target&&!r.current&&Fk(moe,n,{originalEvent:i},{discrete:!1})},"handleFocus");return e.addEventListener("focusin",s),()=>e.removeEventListener("focusin",s)},[e,n]),{onFocusCapture:$r(()=>r.current=!0,"onFocusCapture"),onBlurCapture:$r(()=>r.current=!1,"onBlurCapture")}}$r(J$,"useFocusOutside");function wx(){const t=new CustomEvent(_x);document.dispatchEvent(t)}$r(wx,"dispatchUpdate");function Fk(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?q$(s,i):s.dispatchEvent(i)}$r(Fk,"handleAndDispatchCustomEvent");var voe=Object.defineProperty,pr=(t,e)=>voe(t,"name",{value:e,configurable:!0}),Kw="focusScope.autoFocusOnMount",Gw="focusScope.autoFocusOnUnmount",t3={bubbles:!1,cancelable:!0},e4=v.forwardRef(pr(function(e,n){const{loop:r=!1,trapped:s=!1,branches:i,onMountAutoFocus:o,onUnmountAutoFocus:l,...u}=e,[d,f]=v.useState(null),h=bu(o),m=bu(l),g=v.useRef(null),_=Ts(n,f),y=v.useRef(i);v.useEffect(()=>{y.current=i});const b=v.useCallback(E=>{var C;return E?d!=null&&d.contains(E)?!0:!!((C=y.current)!=null&&C.some(R=>R.contains(E))):!1},[d]),x=v.useRef({paused:!1,pause(){this.paused=!0},resume(){this.paused=!1}}).current;v.useEffect(()=>{if(s){let E=function(I){if(x.paused||!d)return;const A=I.target;b(A)?g.current=A:xa(g.current,{select:!0})},C=function(I){if(x.paused||!d)return;const A=I.relatedTarget;A!==null&&(b(A)||xa(g.current,{select:!0}))},R=function(I){if(document.activeElement===document.body)for(const L of I)L.removedNodes.length>0&&xa(d)};pr(E,"handleFocusIn"),pr(C,"handleFocusOut"),pr(R,"handleMutations"),document.addEventListener("focusin",E),document.addEventListener("focusout",C);const O=new MutationObserver(R);return d&&O.observe(d,{childList:!0,subtree:!0}),()=>{document.removeEventListener("focusin",E),document.removeEventListener("focusout",C),O.disconnect()}}},[s,d,x.paused,b]),v.useEffect(()=>{if(d){n3.add(x);const E=document.activeElement;if(!d.contains(E)){const R=new CustomEvent(Kw,t3);d.addEventListener(Kw,h),d.dispatchEvent(R),R.defaultPrevented||(n4(a4(Hk(d)),{select:!0}),document.activeElement===E&&xa(d))}return()=>{d.removeEventListener(Kw,h);const R=d.ownerDocument,O=CustomEvent;setTimeout(()=>{const I=new O(Gw,t3);d.addEventListener(Gw,m),d.dispatchEvent(I),I.defaultPrevented||xa(E??R.body,{select:!0}),d.removeEventListener(Gw,m),n3.remove(x)},0)}}},[d,h,m,x]);const S=v.useCallback(E=>{if(!r&&!s||x.paused)return;const C=E.key==="Tab"&&!E.altKey&&!E.ctrlKey&&!E.metaKey,R=document.activeElement;if(C&&R){const O=E.currentTarget,[I,A]=r4(O);I&&A?!E.shiftKey&&R===A?(E.preventDefault(),r&&xa(I,{select:!0})):E.shiftKey&&R===I&&(E.preventDefault(),r&&xa(A,{select:!0})):R===O&&E.preventDefault()}},[r,s,x.paused]);return T.jsx(ki.div,{tabIndex:-1,...u,ref:_,onKeyDown:S})},"FocusScope")),t4=v.createContext(null);function jk({registry:t,children:e}){return t?T.jsx(t4.Provider,{value:t,children:e}):e}pr(jk,"FocusScopeBranchProvider");function zk(){const[t,e]=v.useState([]),n=v.useMemo(()=>({add:pr(r=>e(s=>s.includes(r)?s:[...s,r]),"add"),remove:pr(r=>e(s=>s.filter(i=>i!==r)),"remove")}),[]);return{nodes:t,registry:n}}pr(zk,"useFocusScopeBranchRegistry");function Vk(t){const e=v.useContext(t4);v.useEffect(()=>{if(!(!t||!e))return e.add(t),()=>e.remove(t)},[t,e])}pr(Vk,"useFocusScopeBranch");function n4(t,{select:e=!1}={}){const n=document.activeElement;for(const r of t)if(xa(r,{select:e}),document.activeElement!==n)return}pr(n4,"focusFirst");function r4(t){const e=Hk(t),n=bx(e,t),r=bx(e.reverse(),t);return[n,r]}pr(r4,"getTabbableEdges");function Hk(t){const e=[],r=t.ownerDocument.createTreeWalker(t,NodeFilter.SHOW_ELEMENT,{acceptNode:pr(s=>{const i=s.tagName==="INPUT"&&s.type==="hidden";return s.disabled||s.hidden||i?NodeFilter.FILTER_SKIP:s.tabIndex>=0?NodeFilter.FILTER_ACCEPT:NodeFilter.FILTER_SKIP},"acceptNode")});for(;r.nextNode();)e.push(r.currentNode);return e}pr(Hk,"getTabbableCandidates");function bx(t,e){const n=typeof e.checkVisibility=="function"&&e.checkVisibility({checkVisibilityCSS:!0});for(const r of t)if(!(n?!r.checkVisibility({checkVisibilityCSS:!0}):s4(r,{upTo:e})))return r}pr(bx,"findVisible");function s4(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}pr(s4,"isHidden");function i4(t){return t.tagName==="INPUT"&&typeof t.select=="function"}pr(i4,"isSelectableInput");function xa(t,{select:e=!1}={}){if(t&&t.focus){const r=(t.ownerDocument??document).activeElement;t.focus({preventScroll:!0}),t!==r&&i4(t)&&e&&t.select()}}pr(xa,"focus");var n3=o4();function o4(){let t=[];return{add(e){const n=t[0];e!==n&&(n==null||n.pause()),t=xx(t,e),t.unshift(e)},remove(e){var n;t=xx(t,e),(n=t[0])==null||n.resume()}}}pr(o4,"createFocusScopesStack");function xx(t,e){const n=[...t],r=n.indexOf(e);return r!==-1&&n.splice(r,1),n}pr(xx,"arrayRemove");function a4(t){return t.filter(e=>e.tagName!=="A")}pr(a4,"removeLinks");var yoe=Object.defineProperty,_oe=(t,e)=>yoe(t,"name",{value:e,configurable:!0}),woe=Of[" useId ".trim().toString()]||(()=>{}),boe=0;function Ul(t){const[e,n]=v.useState(woe());return Bs(()=>{t||n(r=>r??String(boe++))},[t]),t||(e?`radix-${e}`:"")}_oe(Ul,"useId");const xoe=["top","right","bottom","left"],ec=Math.min,Na=Math.max,zv=Math.round,ng=Math.floor,Da=t=>({x:t,y:t}),Soe={left:"right",right:"left",bottom:"top",top:"bottom"};function l4(t,e,n){return Na(t,ec(e,n))}function za(t,e){return typeof t=="function"?t(e):t}function tc(t){return t.split("-")[0]}function zf(t){return t.split("-")[1]}function Uk(t){return t==="x"?"y":"x"}function Zk(t){return t==="y"?"height":"width"}function Bo(t){const e=t[0];return e==="t"||e==="b"?"y":"x"}function Bk(t){return Uk(Bo(t))}function koe(t,e,n){n===void 0&&(n=!1);const r=zf(t),s=Bk(t),i=Zk(s);let o=s==="x"?r===(n?"end":"start")?"right":"left":r==="start"?"bottom":"top";return e.reference[i]>e.floating[i]&&(o=Vv(o)),[o,Vv(o)]}function Eoe(t){const e=Vv(t);return[Sx(t),e,Sx(e)]}function Sx(t){return t.includes("start")?t.replace("start","end"):t.replace("end","start")}const r3=["left","right"],s3=["right","left"],Coe=["top","bottom"],Poe=["bottom","top"];function Toe(t,e,n){switch(t){case"top":case"bottom":return n?e?s3:r3:e?r3:s3;case"left":case"right":return e?Coe:Poe;default:return[]}}function Roe(t,e,n,r){const s=zf(t);let i=Toe(tc(t),n==="start",r);return s&&(i=i.map(o=>o+"-"+s),e&&(i=i.concat(i.map(Sx)))),i}function Vv(t){const e=tc(t);return Soe[e]+t.slice(e.length)}function Aoe(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 c4(t){return typeof t!="number"?Aoe(t):{top:t,right:t,bottom:t,left:t}}function Hv(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 i3(t,e,n){let{reference:r,floating:s}=t;const i=Bo(e),o=Bk(e),l=Zk(o),u=tc(e),d=i==="y",f=r.x+r.width/2-s.width/2,h=r.y+r.height/2-s.height/2,m=r[l]/2-s[l]/2;let g;switch(u){case"top":g={x:f,y:r.y-s.height};break;case"bottom":g={x:f,y:r.y+r.height};break;case"right":g={x:r.x+r.width,y:h};break;case"left":g={x:r.x-s.width,y:h};break;default:g={x:r.x,y:r.y}}const _=zf(e);return _&&(g[o]+=m*(_==="end"?1:-1)*(n&&d?-1:1)),g}async function Ioe(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:m=!1,padding:g=0}=za(e,t),_=c4(g),b=l[m?h==="floating"?"reference":"floating":h],x=Hv(await i.getClippingRect({element:(n=await(i.isElement==null?void 0:i.isElement(b)))==null||n?b:b.contextElement||await(i.getDocumentElement==null?void 0:i.getDocumentElement(l.floating)),boundary:d,rootBoundary:f,strategy:u})),S=h==="floating"?{x:r,y:s,width:o.floating.width,height:o.floating.height}:o.reference,E=await(i.getOffsetParent==null?void 0:i.getOffsetParent(l.floating)),C=await(i.isElement==null?void 0:i.isElement(E))&&await(i.getScale==null?void 0:i.getScale(E))||{x:1,y:1},R=Hv(i.convertOffsetParentRelativeRectToViewportRelativeRect?await i.convertOffsetParentRelativeRectToViewportRelativeRect({elements:l,rect:S,offsetParent:E,strategy:u}):S);return{top:(x.top-R.top+_.top)/C.y,bottom:(R.bottom-x.bottom+_.bottom)/C.y,left:(x.left-R.left+_.left)/C.x,right:(R.right-x.right+_.right)/C.x}}const Ooe=50,Moe=async(t,e,n)=>{const{placement:r="bottom",strategy:s="absolute",middleware:i=[],platform:o}=n,l=o.detectOverflow?o:{...o,detectOverflow:Ioe},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}=i3(d,r,u),m=r,g=0;const _={};for(let y=0;y<i.length;y++){const b=i[y];if(!b)continue;const{name:x,fn:S}=b,{x:E,y:C,data:R,reset:O}=await S({x:f,y:h,initialPlacement:r,placement:m,strategy:s,middlewareData:_,rects:d,platform:l,elements:{reference:t,floating:e}});f=E??f,h=C??h,_[x]={..._[x],...R},O&&g<Ooe&&(g++,typeof O=="object"&&(O.placement&&(m=O.placement),O.rects&&(d=O.rects===!0?await o.getElementRects({reference:t,floating:e,strategy:s}):O.rects),{x:f,y:h}=i3(d,m,u)),y=-1)}return{x:f,y:h,placement:m,strategy:s,middlewareData:_}},Loe=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}=za(t,e)||{};if(d==null)return{};const h=c4(f),m={x:n,y:r},g=Bk(s),_=Zk(g),y=await o.getDimensions(d),b=g==="y",x=b?"top":"left",S=b?"bottom":"right",E=b?"clientHeight":"clientWidth",C=i.reference[_]+i.reference[g]-m[g]-i.floating[_],R=m[g]-i.reference[g],O=await(o.getOffsetParent==null?void 0:o.getOffsetParent(d));let I=O?O[E]:0;(!I||!await(o.isElement==null?void 0:o.isElement(O)))&&(I=l.floating[E]||i.floating[_]);const A=C/2-R/2,L=I/2-y[_]/2-1,N=ec(h[x],L),H=ec(h[S],L),$=I-y[_]-H,W=I/2-y[_]/2+A,X=l4(N,W,$),z=!u.arrow&&zf(s)!=null&&W!==X&&i.reference[_]/2-(W<N?N:H)-y[_]/2<0,K=z?W<N?W-N:W-$:0;return{[g]:m[g]+K,data:{[g]:X,centerOffset:W-X-K,...z&&{alignmentOffset:K}},reset:z}}}),Noe=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:m,fallbackStrategy:g="bestFit",fallbackAxisSideDirection:_="none",flipAlignment:y=!0,...b}=za(t,e);if((n=i.arrow)!=null&&n.alignmentOffset)return{};const x=tc(s),S=Bo(l),E=tc(l)===l,C=await(u.isRTL==null?void 0:u.isRTL(d.floating)),R=m||(E||!y?[Vv(l)]:Eoe(l)),O=_!=="none";!m&&O&&R.push(...Roe(l,y,_,C));const I=[l,...R],A=await u.detectOverflow(e,b),L=[];let N=((r=i.flip)==null?void 0:r.overflows)||[];if(f&&L.push(A[x]),h){const X=koe(s,o,C);L.push(A[X[0]],A[X[1]])}if(N=[...N,{placement:s,overflows:L}],!L.every(X=>X<=0)){var H,$;const X=(((H=i.flip)==null?void 0:H.index)||0)+1,z=I[X];if(z&&(!(h==="alignment"?S!==Bo(z):!1)||N.every(Z=>Bo(Z.placement)===S?Z.overflows[0]>0:!0)))return{data:{index:X,overflows:N},reset:{placement:z}};let K=($=N.filter(te=>te.overflows[0]<=0).sort((te,Z)=>te.overflows[1]-Z.overflows[1])[0])==null?void 0:$.placement;if(!K)switch(g){case"bestFit":{var W;const te=(W=N.filter(Z=>{if(O){const J=Bo(Z.placement);return J===S||J==="y"}return!0}).map(Z=>[Z.placement,Z.overflows.filter(J=>J>0).reduce((J,q)=>J+q,0)]).sort((Z,J)=>Z[1]-J[1])[0])==null?void 0:W[0];te&&(K=te);break}case"initialPlacement":K=l;break}if(s!==K)return{reset:{placement:K}}}return{}}}};function o3(t,e){return{top:t.top-e.height,right:t.right-e.width,bottom:t.bottom-e.height,left:t.left-e.width}}function a3(t){return xoe.some(e=>t[e]>=0)}const Doe=function(t){return t===void 0&&(t={}),{name:"hide",options:t,async fn(e){const{rects:n,platform:r}=e,{strategy:s="referenceHidden",...i}=za(t,e);switch(s){case"referenceHidden":{const o=await r.detectOverflow(e,{...i,elementContext:"reference"}),l=o3(o,n.reference);return{data:{referenceHiddenOffsets:l,referenceHidden:a3(l)}}}case"escaped":{const o=await r.detectOverflow(e,{...i,altBoundary:!0}),l=o3(o,n.floating);return{data:{escapedOffsets:l,escaped:a3(l)}}}default:return{}}}}},u4=new Set(["left","top"]);async function $oe(t,e){const{placement:n,platform:r,elements:s}=t,i=await(r.isRTL==null?void 0:r.isRTL(s.floating)),o=tc(n),l=zf(n),u=Bo(n)==="y",d=u4.has(o)?-1:1,f=i&&u?-1:1,h=za(e,t);let{mainAxis:m,crossAxis:g,alignmentAxis:_}=typeof h=="number"?{mainAxis:h,crossAxis:0,alignmentAxis:null}:{mainAxis:h.mainAxis||0,crossAxis:h.crossAxis||0,alignmentAxis:h.alignmentAxis};return l&&typeof _=="number"&&(g=l==="end"?_*-1:_),u?{x:g*f,y:m*d}:{x:m*d,y:g*f}}const Foe=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 $oe(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}}}}},joe=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:S=>{let{x:E,y:C}=S;return{x:E,y:C}}},...d}=za(t,e),f={x:n,y:r},h=await i.detectOverflow(e,d),m=Bo(s),g=Uk(m);let _=f[g],y=f[m];const b=(S,E)=>l4(E+h[S==="y"?"top":"left"],E,E-h[S==="y"?"bottom":"right"]);o&&(_=b(g,_)),l&&(y=b(m,y));const x=u.fn({...e,[g]:_,[m]:y});return{...x,data:{x:x.x-n,y:x.y-r,enabled:{[g]:o,[m]:l}}}}}},zoe=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}=za(t,e),m={x:s,y:i},g=Bo(o),_=Uk(g);let y=m[_],b=m[g];const x=za(d,e),S=typeof x=="number"?{mainAxis:x,crossAxis:0}:{mainAxis:(n=x.mainAxis)!=null?n:0,crossAxis:(r=x.crossAxis)!=null?r:0};if(f){const R=_==="y"?"height":"width",O=l.reference[_]-l.floating[R]+S.mainAxis,I=l.reference[_]+l.reference[R]-S.mainAxis;y<O?y=O:y>I&&(y=I)}if(h){var E,C;const R=_==="y"?"width":"height",O=u4.has(tc(o)),I=l.reference[g]-l.floating[R]+(O&&((E=u.offset)==null?void 0:E[g])||0)+(O?0:S.crossAxis),A=l.reference[g]+l.reference[R]+(O?0:((C=u.offset)==null?void 0:C[g])||0)-(O?S.crossAxis:0);b<I?b=I:b>A&&(b=A)}return{[_]:y,[g]:b}}}},Voe=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}=za(t,e),u=await s.detectOverflow(e,l),d=tc(n),f=zf(n),h=Bo(n)==="y",{width:m,height:g}=r.floating;let _,y;d==="top"||d==="bottom"?(_=d,y=f===(await(s.isRTL==null?void 0:s.isRTL(i.floating))?"start":"end")?"left":"right"):(y=d,_=f==="end"?"top":"bottom");const b=g-u.top-u.bottom,x=m-u.left-u.right,S=ec(g-u[_],b),E=ec(m-u[y],x),C=e.middlewareData.shift,R=!C;let O=S,I=E;C!=null&&C.enabled.x&&(I=x),C!=null&&C.enabled.y&&(O=b),R&&!f&&(h?I=m-2*Na(u.left,u.right):O=g-2*Na(u.top,u.bottom)),await o({...e,availableWidth:I,availableHeight:O});const A=await s.getDimensions(i.floating);return m!==A.width||g!==A.height?{reset:{rects:!0}}:{}}}};function ky(){return typeof window<"u"}function Vf(t){return d4(t)?(t.nodeName||"").toLowerCase():"#document"}function Ws(t){var e;return(t==null||(e=t.ownerDocument)==null?void 0:e.defaultView)||window}function Ba(t){var e;return(e=(d4(t)?t.ownerDocument:t.document)||window.document)==null?void 0:e.documentElement}function d4(t){return ky()?t instanceof Node||t instanceof Ws(t).Node:!1}function ea(t){return ky()?t instanceof Element||t instanceof Ws(t).Element:!1}function cc(t){return ky()?t instanceof HTMLElement||t instanceof Ws(t).HTMLElement:!1}function l3(t){return!ky()||typeof ShadowRoot>"u"?!1:t instanceof ShadowRoot||t instanceof Ws(t).ShadowRoot}function Ey(t){const{overflow:e,overflowX:n,overflowY:r,display:s}=ta(t);return/auto|scroll|overlay|hidden|clip/.test(e+r+n)&&s!=="inline"&&s!=="contents"}function Hoe(t){return/^(table|td|th)$/.test(Vf(t))}function Cy(t){try{if(t.matches(":popover-open"))return!0}catch{}try{return t.matches(":modal")}catch{return!1}}const Uoe=/transform|translate|scale|rotate|perspective|filter/,Zoe=/paint|layout|strict|content/,Lc=t=>!!t&&t!=="none";let qw;function Wk(t){const e=ea(t)?ta(t):t;return Lc(e.transform)||Lc(e.translate)||Lc(e.scale)||Lc(e.rotate)||Lc(e.perspective)||!Kk()&&(Lc(e.backdropFilter)||Lc(e.filter))||Uoe.test(e.willChange||"")||Zoe.test(e.contain||"")}function Boe(t){let e=xu(t);for(;cc(e)&&!Hp(e);){if(Wk(e))return e;if(Cy(e))return null;e=xu(e)}return null}function Kk(){return qw==null&&(qw=typeof CSS<"u"&&CSS.supports&&CSS.supports("-webkit-backdrop-filter","none")),qw}function Hp(t){return/^(html|body|#document)$/.test(Vf(t))}function ta(t){return Ws(t).getComputedStyle(t)}function Py(t){return ea(t)?{scrollLeft:t.scrollLeft,scrollTop:t.scrollTop}:{scrollLeft:t.scrollX,scrollTop:t.scrollY}}function xu(t){if(Vf(t)==="html")return t;const e=t.assignedSlot||t.parentNode||l3(t)&&t.host||Ba(t);return l3(e)?e.host:e}function f4(t){const e=xu(t);return Hp(e)?(t.ownerDocument||t).body:cc(e)&&Ey(e)?e:f4(e)}function Up(t,e,n){var r;e===void 0&&(e=[]),n===void 0&&(n=!0);const s=f4(t),i=s===((r=t.ownerDocument)==null?void 0:r.body),o=Ws(s);if(i){const l=kx(o);return e.concat(o,o.visualViewport||[],Ey(s)?s:[],l&&n?Up(l):[])}else return e.concat(s,Up(s,[],n))}function kx(t){return t.parent&&Object.getPrototypeOf(t.parent)?t.frameElement:null}function h4(t){const e=ta(t);let n=parseFloat(e.width)||0,r=parseFloat(e.height)||0;const s=cc(t),i=s?t.offsetWidth:n,o=s?t.offsetHeight:r,l=zv(n)!==i||zv(r)!==o;return l&&(n=i,r=o),{width:n,height:r,$:l}}function Gk(t){return ea(t)?t:t.contextElement}function $d(t){const e=Gk(t);if(!cc(e))return Da(1);const n=e.getBoundingClientRect(),{width:r,height:s,$:i}=h4(e);let o=(i?zv(n.width):n.width)/r,l=(i?zv(n.height):n.height)/s;return(!o||!Number.isFinite(o))&&(o=1),(!l||!Number.isFinite(l))&&(l=1),{x:o,y:l}}const Woe=Da(0);function p4(t){const e=Ws(t);return!Kk()||!e.visualViewport?Woe:{x:e.visualViewport.offsetLeft,y:e.visualViewport.offsetTop}}function Koe(t,e,n){return e===void 0&&(e=!1),!!n&&e&&n===Ws(t)}function Su(t,e,n,r){e===void 0&&(e=!1),n===void 0&&(n=!1);const s=t.getBoundingClientRect(),i=Gk(t);let o=Da(1);e&&(r?ea(r)&&(o=$d(r)):o=$d(t));const l=Koe(i,n,r)?p4(i):Da(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 m=Ws(i),g=ea(r)?Ws(r):r;let _=m,y=kx(_);for(;y&&g!==_;){const b=$d(y),x=y.getBoundingClientRect(),S=ta(y),E=x.left+(y.clientLeft+parseFloat(S.paddingLeft))*b.x,C=x.top+(y.clientTop+parseFloat(S.paddingTop))*b.y;u*=b.x,d*=b.y,f*=b.x,h*=b.y,u+=E,d+=C,_=Ws(y),y=kx(_)}}return Hv({width:f,height:h,x:u,y:d})}function Ty(t,e){const n=Py(t).scrollLeft;return e?e.left+n:Su(Ba(t)).left+n}function m4(t,e){const n=t.getBoundingClientRect(),r=n.left+e.scrollLeft-Ty(t,n),s=n.top+e.scrollTop;return{x:r,y:s}}function Goe(t){let{elements:e,rect:n,offsetParent:r,strategy:s}=t;const i=s==="fixed",o=Ba(r),l=e?Cy(e.floating):!1;if(r===o||l&&i)return n;let u={scrollLeft:0,scrollTop:0},d=Da(1);const f=Da(0),h=cc(r);if((h||!i)&&((Vf(r)!=="body"||Ey(o))&&(u=Py(r)),h)){const g=Su(r);d=$d(r),f.x=g.x+r.clientLeft,f.y=g.y+r.clientTop}const m=o&&!h&&!i?m4(o,u):Da(0);return{width:n.width*d.x,height:n.height*d.y,x:n.x*d.x-u.scrollLeft*d.x+f.x+m.x,y:n.y*d.y-u.scrollTop*d.y+f.y+m.y}}function qoe(t){return t.getClientRects?Array.from(t.getClientRects()):[]}function Yoe(t){const e=Py(t),n=t.ownerDocument.body,r=Na(t.scrollWidth,t.clientWidth,n.scrollWidth,n.clientWidth),s=Na(t.scrollHeight,t.clientHeight,n.scrollHeight,n.clientHeight);let i=-e.scrollLeft+Ty(t);const o=-e.scrollTop;return ta(n).direction==="rtl"&&(i+=Na(t.clientWidth,n.clientWidth)-r),{width:r,height:s,x:i,y:o}}const Xoe=25;function Qoe(t,e,n){n===void 0&&(n="viewport");const r=n==="layoutViewport",s=Ws(t),i=Ba(t),o=s.visualViewport;let l=i.clientWidth,u=i.clientHeight,d=0,f=0;if(o){const m=!Kk()||e==="fixed";r?m||(d=-o.offsetLeft,f=-o.offsetTop):(l=o.width,u=o.height,m&&(d=o.offsetLeft,f=o.offsetTop))}if(Ty(i)<=0){const m=i.ownerDocument,g=m.body,_=getComputedStyle(g),y=m.compatMode==="CSS1Compat"&&parseFloat(_.marginLeft)+parseFloat(_.marginRight)||0,b=Math.abs(i.clientWidth-g.clientWidth-y),x=getComputedStyle(i).scrollbarGutter==="stable both-edges"?b/2:b;x<=Xoe&&(l-=x)}return{width:l,height:u,x:d,y:f}}function Joe(t,e){const n=Su(t,!0,e==="fixed"),r=n.top+t.clientTop,s=n.left+t.clientLeft,i=$d(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 c3(t,e,n){let r;if(e==="viewport"||e==="layoutViewport")r=Qoe(t,n,e);else if(e==="document")r=Yoe(Ba(t));else if(ea(e))r=Joe(e,n);else{const s=p4(t);r={x:e.x-s.x,y:e.y-s.y,width:e.width,height:e.height}}return Hv(r)}function eae(t,e){const n=e.get(t);if(n)return n;let r=Up(t,[],!1).filter(l=>ea(l)&&Vf(l)!=="body"),s=null;const i=ta(t).position==="fixed";let o=i?xu(t):t;for(;ea(o)&&!Hp(o);){const l=ta(o),u=Wk(o),d=s?s.position:i?"fixed":"";!u&&(d==="fixed"||d==="absolute"&&l.position==="static")?r=r.filter(h=>h!==o):s=l,o=xu(o)}return e.set(t,r),r}function tae(t){let{element:e,boundary:n,rootBoundary:r,strategy:s}=t;const o=[...n==="clippingAncestors"?Cy(e)?[]:eae(e,this._c):[].concat(n),r],l=c3(e,o[0],s);let u=l.top,d=l.right,f=l.bottom,h=l.left;for(let m=1;m<o.length;m++){const g=c3(e,o[m],s);u=Na(g.top,u),d=ec(g.right,d),f=ec(g.bottom,f),h=Na(g.left,h)}return{width:d-h,height:f-u,x:h,y:u}}function nae(t){const{width:e,height:n}=h4(t);return{width:e,height:n}}function rae(t,e,n){const r=cc(e),s=Ba(e),i=n==="fixed",o=Su(t,!0,i,e);let l={scrollLeft:0,scrollTop:0};const u=Da(0);if((r||!i)&&((Vf(e)!=="body"||Ey(s))&&(l=Py(e)),r)){const m=Su(e,!0,i,e);u.x=m.x+e.clientLeft,u.y=m.y+e.clientTop}!r&&s&&(u.x=Ty(s));const d=s&&!r&&!i?m4(s,l):Da(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 Yw(t){return ta(t).position==="static"}function u3(t,e){if(!cc(t)||ta(t).position==="fixed")return null;if(e)return e(t);let n=t.offsetParent;return Ba(t)===n&&(n=n.ownerDocument.body),n}function g4(t,e){const n=Ws(t);if(Cy(t))return n;if(!cc(t)){let s=xu(t);for(;s&&!Hp(s);){if(ea(s)&&!Yw(s))return s;s=xu(s)}return n}let r=u3(t,e);for(;r&&Hoe(r)&&Yw(r);)r=u3(r,e);return r&&Hp(r)&&Yw(r)&&!Wk(r)?n:r||Boe(t)||n}const sae=async function(t){const e=this.getOffsetParent||g4,n=this.getDimensions,r=await n(t.floating);return{reference:rae(t.reference,await e(t.floating),t.strategy),floating:{x:0,y:0,width:r.width,height:r.height}}};function iae(t){return ta(t).direction==="rtl"}const oae={convertOffsetParentRelativeRectToViewportRelativeRect:Goe,getDocumentElement:Ba,getClippingRect:tae,getOffsetParent:g4,getElementRects:sae,getClientRects:qoe,getDimensions:nae,getScale:$d,isElement:ea,isRTL:iae};function v4(t,e){return t.x===e.x&&t.y===e.y&&t.width===e.width&&t.height===e.height}function aae(t,e,n){let r=null,s;const i=Ba(t);function o(){var f;clearTimeout(s),(f=r)==null||f.disconnect(),r=null}function l(f,h){f===void 0&&(f=!1),h===void 0&&(h=1),o();const m=t.getBoundingClientRect(),{left:g,top:_,width:y,height:b}=m;if(f||e(),!y||!b)return;const x=ng(_),S=ng(i.clientWidth-(g+y)),E=ng(i.clientHeight-(_+b)),C=ng(g),O={rootMargin:-x+"px "+-S+"px "+-E+"px "+-C+"px",threshold:Na(0,ec(1,h))||1};let I=!0;function A(L){const N=L[0].intersectionRatio;if(!v4(m,t.getBoundingClientRect()))return l();if(N!==h){if(!I)return l();N?l(!1,N):s=setTimeout(()=>{l(!1,1e-7)},1e3)}I=!1}try{r=new IntersectionObserver(A,{...O,root:i.ownerDocument})}catch{r=new IntersectionObserver(A,O)}r.observe(t)}const u=Ws(t),d=()=>l(n);return u.addEventListener("resize",d),l(!0),()=>{u.removeEventListener("resize",d),o()}}function lae(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=Gk(t),f=s||i?[...d?Up(d):[],...e?Up(e):[]]:[];f.forEach(x=>{s&&x.addEventListener("scroll",n),i&&x.addEventListener("resize",n)});const h=d&&l?aae(d,n,i):null;let m=-1,g=null;o&&(g=new ResizeObserver(x=>{let[S]=x;S&&S.target===d&&g&&e&&(g.unobserve(e),cancelAnimationFrame(m),m=requestAnimationFrame(()=>{var E;(E=g)==null||E.observe(e)})),n()}),d&&!u&&g.observe(d),e&&g.observe(e));let _,y=u?Su(t):null;u&&b();function b(){const x=Su(t);y&&!v4(y,x)&&n(),y=x,_=requestAnimationFrame(b)}return n(),()=>{var x;f.forEach(S=>{s&&S.removeEventListener("scroll",n),i&&S.removeEventListener("resize",n)}),h==null||h(),(x=g)==null||x.disconnect(),g=null,u&&cancelAnimationFrame(_)}}const cae=Foe,uae=joe,dae=Noe,fae=Voe,hae=Doe,d3=Loe,pae=zoe,mae=(t,e,n)=>{const r=new Map,s=n??{},i={...oae,...s.platform,_c:r};return Moe(t,e,{...s,platform:i})};var gae=typeof document<"u",vae=function(){},Lg=gae?v.useLayoutEffect:vae;function Uv(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(!Uv(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)&&!Uv(t[i],e[i]))return!1}return!0}return t!==t&&e!==e}function y4(t){return typeof window>"u"?1:(t.ownerDocument.defaultView||window).devicePixelRatio||1}function f3(t,e){const n=y4(t);return Math.round(e*n)/n}function Xw(t){const e=v.useRef(t);return Lg(()=>{e.current=t}),e}function yae(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]=v.useState({x:0,y:0,strategy:n,placement:e,middlewareData:{},isPositioned:!1}),[m,g]=v.useState(r);Uv(m,r)||g(r);const[_,y]=v.useState(null),[b,x]=v.useState(null),S=v.useCallback(Z=>{Z!==O.current&&(O.current=Z,y(Z))},[]),E=v.useCallback(Z=>{Z!==I.current&&(I.current=Z,x(Z))},[]),C=i||_,R=o||b,O=v.useRef(null),I=v.useRef(null),A=v.useRef(f),L=u!=null,N=Xw(u),H=Xw(s),$=Xw(d),W=v.useCallback(()=>{if(!O.current||!I.current)return;const Z={placement:e,strategy:n,middleware:m};H.current&&(Z.platform=H.current),mae(O.current,I.current,Z).then(J=>{const q={...J,isPositioned:$.current!==!1};X.current&&!Uv(A.current,q)&&(A.current=q,wm.flushSync(()=>{h(q)}))})},[m,e,n,H,$]);Lg(()=>{d===!1&&A.current.isPositioned&&(A.current.isPositioned=!1,h(Z=>({...Z,isPositioned:!1})))},[d]);const X=v.useRef(!1);Lg(()=>(X.current=!0,()=>{X.current=!1}),[]),Lg(()=>{if(C&&(O.current=C),R&&(I.current=R),C&&R){if(N.current)return N.current(C,R,W);W()}},[C,R,W,N,L]);const z=v.useMemo(()=>({reference:O,floating:I,setReference:S,setFloating:E}),[S,E]),K=v.useMemo(()=>({reference:C,floating:R}),[C,R]),te=v.useMemo(()=>{const Z={position:n,left:0,top:0};if(!K.floating)return Z;const J=f3(K.floating,f.x),q=f3(K.floating,f.y);return l?{...Z,transform:"translate("+J+"px, "+q+"px)",...y4(K.floating)>=1.5&&{willChange:"transform"}}:{position:n,left:J,top:q}},[n,l,K.floating,f.x,f.y]);return v.useMemo(()=>({...f,update:W,refs:z,elements:K,floatingStyles:te}),[f,W,z,K,te])}const _ae=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?d3({element:r.current,padding:s}).fn(n):{}:r?d3({element:r,padding:s}).fn(n):{}}}},wae=(t,e)=>{const n=cae(t);return{name:n.name,fn:n.fn,options:[t,e]}},bae=(t,e)=>{const n=uae(t);return{name:n.name,fn:n.fn,options:[t,e]}},xae=(t,e)=>({fn:pae(t).fn,options:[t,e]}),Sae=(t,e)=>{const n=dae(t);return{name:n.name,fn:n.fn,options:[t,e]}},kae=(t,e)=>{const n=fae(t);return{name:n.name,fn:n.fn,options:[t,e]}},Eae=(t,e)=>{const n=hae(t);return{name:n.name,fn:n.fn,options:[t,e]}},Cae=(t,e)=>{const n=_ae(t);return{name:n.name,fn:n.fn,options:[t,e]}};var Pae=Object.defineProperty,Tae=(t,e)=>Pae(t,"name",{value:e,configurable:!0});function _4(t){const[e,n]=v.useState(void 0);return Bs(()=>{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}Tae(_4,"useSize");var Rae=Object.defineProperty,Zl=(t,e)=>Rae(t,"name",{value:e,configurable:!0}),h3={Partial:"partial"},p3={Optimized:"optimized",Always:"always"},w4="Popper",[b4,Ry]=bm(w4),[Aae,x4]=b4(w4),S4=Zl(t=>{const{__scopePopper:e,children:n}=t,[r,s]=v.useState(null),[i,o]=v.useState(void 0);return T.jsx(Aae,{scope:e,anchor:r,onAnchorChange:s,placementState:i,setPlacementState:o,children:n})},"Popper"),Iae="PopperAnchor",k4=v.forwardRef(Zl(function(e,n){const{__scopePopper:r,virtualRef:s,...i}=e,o=x4(Iae,r),l=v.useRef(null),u=o.onAnchorChange,d=v.useCallback(y=>{l.current=y,y&&u(y)},[u]),f=Ts(n,d),h=v.useRef(null);v.useEffect(()=>{if(!s)return;const y=h.current;h.current=s.current,y!==h.current&&u(h.current)});const m=o.placementState&&Ay(o.placementState),g=m==null?void 0:m[0],_=m==null?void 0:m[1];return s?null:T.jsx(ki.div,{"data-radix-popper-side":g,"data-radix-popper-align":_,...i,ref:f})},"PopperAnchor")),E4="PopperContent",[Oae,cme]=b4(E4),C4=v.forwardRef(Zl(function(e,n){var pe,Ne,Ae,$e,kt,fn,on;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:m=h3.Partial,hideWhenDetached:g=!1,updatePositionStrategy:_=p3.Optimized,onPlaced:y,...b}=e,x=x4(E4,r),[S,E]=v.useState(null),C=Ts(n,E),[R,O]=v.useState(null),I=_4(R),A=(I==null?void 0:I.width)??0,L=(I==null?void 0:I.height)??0,N=s+(o!=="center"?"-"+o:""),H=typeof h=="number"?h:{top:0,right:0,bottom:0,left:0,...h},$=Array.isArray(f)?f:[f],W=$.length>0,X={padding:H,boundary:$.filter(P4),altBoundary:W},{refs:z,floatingStyles:K,placement:te,isPositioned:Z,middlewareData:J}=yae({strategy:"fixed",placement:N,whileElementsMounted:Zl((...Et)=>lae(...Et,{animationFrame:_===p3.Always}),"whileElementsMounted"),elements:{reference:x.anchor},middleware:[wae({mainAxis:i+L,alignmentAxis:l}),d&&bae({mainAxis:!0,crossAxis:!1,...m===h3.Partial?{limiter:xae()}:{},...X}),d&&Sae({...X}),kae({...X,apply:Zl(({elements:Et,rects:Gt,availableWidth:vn,availableHeight:Qt})=>{const{width:Me,height:Qe}=Gt.reference,Te=Et.floating.style;Te.setProperty("--radix-popper-available-width",`${vn}px`),Te.setProperty("--radix-popper-available-height",`${Qt}px`),Te.setProperty("--radix-popper-anchor-width",`${Me}px`),Te.setProperty("--radix-popper-anchor-height",`${Qe}px`)},"apply")}),R&&Cae({element:R,padding:u}),Mae({arrowWidth:A,arrowHeight:L}),g&&Eae(W?{strategy:"referenceHidden",...X}:{strategy:"referenceHidden",padding:X.padding,altBoundary:X.altBoundary})]}),q=x.setPlacementState;Bs(()=>(q(te),()=>{q(void 0)}),[te,q]);const[j,Y]=Ay(te),ue=bu(y);Bs(()=>{Z&&(ue==null||ue())},[Z,ue]);const ie=(pe=J.arrow)==null?void 0:pe.x,ce=(Ne=J.arrow)==null?void 0:Ne.y,he=((Ae=J.arrow)==null?void 0:Ae.centerOffset)!==0,[ke,ve]=v.useState();return Bs(()=>{S&&ve(window.getComputedStyle(S).zIndex)},[S]),T.jsx("div",{ref:z.setFloating,"data-radix-popper-content-wrapper":"",style:{...K,transform:Z?K.transform:"translate(0, -200%)",minWidth:"max-content",zIndex:ke,"--radix-popper-transform-origin":[($e=J.transformOrigin)==null?void 0:$e.x,(kt=J.transformOrigin)==null?void 0:kt.y].join(" "),...((fn=J.hide)==null?void 0:fn.referenceHidden)&&{visibility:"hidden",pointerEvents:"none"}},dir:e.dir,children:T.jsx(Oae,{scope:r,placedSide:j,placedAlign:Y,onArrowChange:O,arrowX:ie,arrowY:ce,shouldHideArrow:he,children:T.jsx(ki.div,{"data-side":j,"data-align":Y,...b,ref:C,style:{...b.style,animation:Z?(on=b.style)==null?void 0:on.animation:"none"}})})})},"PopperContent"));function P4(t){return t!==null}Zl(P4,"isNotNull");var Mae=Zl(t=>({name:"transformOrigin",options:t,fn(e){var b,x,S;const{placement:n,rects:r,middlewareData:s}=e,o=((b=s.arrow)==null?void 0:b.centerOffset)!==0,l=o?0:t.arrowWidth,u=o?0:t.arrowHeight,[d,f]=Ay(n),h={start:"0%",center:"50%",end:"100%"}[f],m=(((x=s.arrow)==null?void 0:x.x)??0)+l/2,g=(((S=s.arrow)==null?void 0:S.y)??0)+u/2;let _="",y="";return d==="bottom"?(_=o?h:`${m}px`,y=`${-u}px`):d==="top"?(_=o?h:`${m}px`,y=`${r.floating.height+u}px`):d==="right"?(_=`${-u}px`,y=o?h:`${g}px`):d==="left"&&(_=`${r.floating.width+u}px`,y=o?h:`${g}px`),{data:{x:_,y}}}}),"transformOrigin");function Ay(t){const[e,n="center"]=t.split("-");return[e,n]}Zl(Ay,"getSideAndAlignFromPlacement");var Lae=Object.defineProperty,Nae=(t,e)=>Lae(t,"name",{value:e,configurable:!0}),qk=v.forwardRef(Nae(function(e,n){var u;const{container:r,...s}=e,[i,o]=v.useState(!1);Bs(()=>o(!0),[]);const l=r||i&&((u=globalThis==null?void 0:globalThis.document)==null?void 0:u.body);return l?wm.createPortal(T.jsx(ki.div,{...s,ref:n}),l):null},"Portal")),Dae=Object.defineProperty,Va=(t,e)=>Dae(t,"name",{value:e,configurable:!0});function T4(t,e){return v.useReducer((n,r)=>e[n][r]??n,t)}Va(T4,"useStateMachine");var Cu=Va(t=>{const{present:e,children:n}=t,r=R4(e),s=typeof n=="function"?n({present:r.isPresent}):v.Children.only(n),i=A4(r.ref,I4(s));return typeof n=="function"||r.isPresent?v.cloneElement(s,{ref:i}):null},"Presence");function R4(t){const[e,n]=v.useState(),r=v.useRef(null),s=v.useRef(t),i=v.useRef("none"),o=v.useRef(void 0),l=t?"mounted":"unmounted",[u,d]=T4(l,{mounted:{UNMOUNT:"unmounted",ANIMATION_OUT:"unmountSuspended"},unmountSuspended:{MOUNT:"mounted",ANIMATION_END:"unmounted"},unmounted:{MOUNT:"mounted"}});return v.useEffect(()=>{u==="mounted"?(i.current=o.current??wd(r.current),o.current=void 0):i.current="none"},[u]),Bs(()=>{const f=r.current,h=s.current;if(h!==t){const g=i.current,_=wd(f);t?(o.current=_,d("MOUNT")):_==="none"||(f==null?void 0:f.display)==="none"?d("UNMOUNT"):d(h&&g!==_?"ANIMATION_OUT":"UNMOUNT"),s.current=t}},[t,d]),Bs(()=>{if(e){let f;const h=e.ownerDocument.defaultView??window,m=Va(_=>{const b=wd(r.current).includes(CSS.escape(_.animationName));if(_.target===e&&b&&(d("ANIMATION_END"),!s.current)){const x=e.style.animationFillMode;e.style.animationFillMode="forwards",f=h.setTimeout(()=>{e.style.animationFillMode==="forwards"&&(e.style.animationFillMode=x)})}},"handleAnimationEnd"),g=Va(_=>{_.target===e&&(i.current=wd(r.current))},"handleAnimationStart");return e.addEventListener("animationstart",g),e.addEventListener("animationcancel",m),e.addEventListener("animationend",m),()=>{h.clearTimeout(f),e.removeEventListener("animationstart",g),e.removeEventListener("animationcancel",m),e.removeEventListener("animationend",m)}}else d("ANIMATION_END")},[e,d]),{isPresent:["mounted","unmountSuspended"].includes(u),ref:v.useCallback(f=>{if(f){const h=getComputedStyle(f);r.current=h,o.current=wd(h)}else r.current=null;n(f)},[])}}Va(R4,"usePresence");function Ex(t,e){if(typeof t=="function")return t(e);t!=null&&(t.current=e)}Va(Ex,"setRef");function A4(...t){const e=v.useRef(t);return e.current=t,v.useCallback(n=>{const r=e.current;let s=!1;const i=r.map(o=>{const l=Ex(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():Ex(r[o],null)}}},[])}Va(A4,"useStableComposedRefs");function wd(t){return(t==null?void 0:t.animationName)||"none"}Va(wd,"getAnimationName");function I4(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)}Va(I4,"getElementRef");var $ae=Object.defineProperty,Fae=(t,e)=>$ae(t,"name",{value:e,configurable:!0}),m3=Of[" useEffectEvent ".trim().toString()],g3=Of[" useInsertionEffect ".trim().toString()];function O4(t){if(typeof m3=="function")return m3(t);const e=v.useRef(()=>{throw new Error("Cannot call an event handler while rendering.")});return typeof g3=="function"?g3(()=>{e.current=t}):Bs(()=>{e.current=t}),v.useMemo(()=>((...n)=>{var r;return(r=e.current)==null?void 0:r.call(e,...n)}),[])}Fae(O4,"useEffectEvent");var jae=Object.defineProperty,xm=(t,e)=>jae(t,"name",{value:e,configurable:!0}),zae=Of[" useInsertionEffect ".trim().toString()]||Bs;function Iy({prop:t,defaultProp:e,onChange:n=xm(()=>{},"onChange"),caller:r}){const[s,i,o]=M4({defaultProp:e,onChange:n}),l=t!==void 0,u=l?t:s,d=v.useCallback(f=>{var h;if(l){const m=L4(f)?f(t):f;m!==t&&((h=o.current)==null||h.call(o,m))}else i(f)},[l,t,i,o]);return[u,d]}xm(Iy,"useControllableState");function M4({defaultProp:t,onChange:e}){const[n,r]=v.useState(t),s=v.useRef(n),i=v.useRef(e);return zae(()=>{i.current=e},[e]),v.useEffect(()=>{var o;s.current!==n&&((o=i.current)==null||o.call(i,n),s.current=n)},[n,s]),[n,r,i]}xm(M4,"useUncontrolledState");function L4(t){return typeof t=="function"}xm(L4,"isFunction");var v3=Symbol("RADIX:SYNC_STATE");function Vae(t,e,n,r){const{prop:s,defaultProp:i,onChange:o,caller:l}=e,u=s!==void 0,d=O4(o),f=[{...n,state:i}];r&&f.push(r);const[h,m]=v.useReducer((b,x)=>{if(x.type===v3)return{...b,state:x.state};const S=t(b,x);return u&&!Object.is(S.state,b.state)&&d(S.state),S},...f),g=h.state,_=v.useRef(g);v.useEffect(()=>{_.current!==g&&(_.current=g,u||d(g))},[g,_,u]);const y=v.useMemo(()=>s!==void 0?{...h,state:s}:h,[h,s]);return v.useEffect(()=>{u&&!Object.is(s,h.state)&&m({type:v3,state:s})},[s,h.state,u]),[y,m]}xm(Vae,"useControllableStateReducer");var Hae=Object.defineProperty,Uae=(t,e)=>Hae(t,"name",{value:e,configurable:!0}),Zae=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"}),Bae=v.forwardRef(Uae(function(e,n){return T.jsx(ki.span,{...e,ref:n,style:{...Zae,...e.style}})},"VisuallyHidden")),Wae=Object.defineProperty,Cr=(t,e)=>Wae(t,"name",{value:e,configurable:!0}),[Yk,ume]=bm("Tooltip",[Ry]),Xk=Ry(),Kae="TooltipProvider",Gae=700,Cx="tooltip.open",[qae,Qk]=Yk(Kae),Yae=Cr(t=>{const{__scopeTooltip:e,delayDuration:n=Gae,skipDelayDuration:r=300,disableHoverableContent:s=!1,children:i}=t,o=v.useRef(!0),l=v.useRef(!1),u=v.useRef(0);return v.useEffect(()=>{const d=u.current;return()=>window.clearTimeout(d)},[]),T.jsx(qae,{scope:e,isOpenDelayedRef:o,delayDuration:n,onOpen:v.useCallback(()=>{r<=0||(window.clearTimeout(u.current),o.current=!1)},[r]),onClose:v.useCallback(()=>{r<=0||(window.clearTimeout(u.current),u.current=window.setTimeout(()=>o.current=!0,r))},[r]),isPointerInTransitRef:l,onPointerInTransitChange:v.useCallback(d=>{l.current=d},[]),disableHoverableContent:s,children:i})},"TooltipProvider"),Px="Tooltip",[Xae,Sm]=Yk(Px),Qae=Cr(t=>{const{__scopeTooltip:e,children:n,open:r,defaultOpen:s,onOpenChange:i,disableHoverableContent:o,delayDuration:l}=t,u=Qk(Px,t.__scopeTooltip),d=Xk(e),[f,h]=v.useState(null),[m,g]=v.useState(void 0),_=Ul(),y=v.useRef(0),b=o??u.disableHoverableContent,x=l??u.delayDuration,S=v.useRef(!1),[E,C]=Iy({prop:r,defaultProp:s??!1,onChange:Cr(N=>{N?(u.onOpen(),document.dispatchEvent(new CustomEvent(Cx))):u.onClose(),i==null||i(N)},"onChange"),caller:Px}),R=v.useMemo(()=>E?S.current?"delayed-open":"instant-open":"closed",[E]),O=v.useCallback(()=>{window.clearTimeout(y.current),y.current=0,S.current=!1,C(!0)},[C]),I=v.useCallback(()=>{window.clearTimeout(y.current),y.current=0,C(!1)},[C]),A=v.useCallback(()=>{window.clearTimeout(y.current),y.current=window.setTimeout(()=>{S.current=!0,C(!0),y.current=0},x)},[x,C]);v.useEffect(()=>()=>{y.current&&(window.clearTimeout(y.current),y.current=0)},[]);const L=m??_;return T.jsx(S4,{...d,children:T.jsx(Xae,{scope:e,contentId:L,setContentId:g,open:E,stateAttribute:R,trigger:f,onTriggerChange:h,onTriggerEnter:v.useCallback(()=>{u.isOpenDelayedRef.current?A():O()},[u.isOpenDelayedRef,A,O]),onTriggerLeave:v.useCallback(()=>{b?I():(window.clearTimeout(y.current),y.current=0)},[I,b]),onOpen:O,onClose:I,disableHoverableContent:b,children:n})})},"Tooltip"),y3="TooltipTrigger",Jae=v.forwardRef(Cr(function(e,n){const{__scopeTooltip:r,"aria-describedby":s,...i}=e,o=Sm(y3,r),l=Qk(y3,r),u=Xk(r),d=v.useRef(null),f=Ts(n,d,o.onTriggerChange),h=v.useRef(!1),m=v.useRef(!1),g=v.useCallback(()=>h.current=!1,[]);return v.useEffect(()=>()=>document.removeEventListener("pointerup",g),[g]),T.jsx(k4,{asChild:!0,...u,children:T.jsx(ki.button,{"aria-describedby":o.open?U4(s,o.contentId):s,"data-state":o.stateAttribute,...i,ref:f,onPointerMove:Er(e.onPointerMove,_=>{_.pointerType!=="touch"&&!m.current&&!l.isPointerInTransitRef.current&&(o.onTriggerEnter(),m.current=!0)}),onPointerLeave:Er(e.onPointerLeave,()=>{o.onTriggerLeave(),m.current=!1}),onPointerDown:Er(e.onPointerDown,()=>{o.open&&o.onClose(),h.current=!0,document.addEventListener("pointerup",g,{once:!0})}),onFocus:Er(e.onFocus,()=>{h.current||o.onOpen()}),onBlur:Er(e.onBlur,o.onClose),onClick:Er(e.onClick,o.onClose)})})},"TooltipTrigger")),N4="TooltipPortal",[ele,tle]=Yk(N4,{forceMount:void 0}),nle=Cr(t=>{const{__scopeTooltip:e,forceMount:n,children:r,container:s}=t,i=Sm(N4,e);return T.jsx(ele,{scope:e,forceMount:n,children:T.jsx(Cu,{present:n||i.open,children:T.jsx(qk,{asChild:!0,container:s,children:r})})})},"TooltipPortal"),Zp="TooltipContent",rle=v.forwardRef(Cr(function(e,n){const r=tle(Zp,e.__scopeTooltip),{forceMount:s=r.forceMount,side:i="top",...o}=e,l=Sm(Zp,e.__scopeTooltip);return T.jsx(Cu,{present:s||l.open,children:l.disableHoverableContent?T.jsx(D4,{side:i,...o,ref:n}):T.jsx(sle,{side:i,...o,ref:n})})},"TooltipContent")),sle=v.forwardRef(Cr(function(e,n){const r=Sm(Zp,e.__scopeTooltip),s=Qk(Zp,e.__scopeTooltip),i=v.useRef(null),o=Ts(n,i),[l,u]=v.useState(null),{trigger:d,onClose:f}=r,h=i.current,{onPointerInTransitChange:m}=s,g=v.useCallback(()=>{u(null),m(!1)},[m]),_=v.useCallback((y,b)=>{const x=y.currentTarget,S={x:y.clientX,y:y.clientY},E=$4(S,x.getBoundingClientRect()),C=F4(S,E),R=j4(b.getBoundingClientRect()),O=V4([...C,...R]);u(O),m(!0)},[m]);return v.useEffect(()=>()=>g(),[g]),v.useEffect(()=>{if(d&&h){const y=Cr(x=>_(x,h),"handleTriggerLeave"),b=Cr(x=>_(x,d),"handleContentLeave");return d.addEventListener("pointerleave",y),h.addEventListener("pointerleave",b),()=>{d.removeEventListener("pointerleave",y),h.removeEventListener("pointerleave",b)}}},[d,h,_,g]),v.useEffect(()=>{if(l){const y=Cr(b=>{const x=b.target,S={x:b.clientX,y:b.clientY},E=(d==null?void 0:d.contains(x))||(h==null?void 0:h.contains(x)),C=!z4(S,l);E?g():C&&(g(),f())},"handleTrackPointerGrace");return document.addEventListener("pointermove",y),()=>document.removeEventListener("pointermove",y)}},[d,h,l,f,g]),T.jsx(D4,{...e,ref:o})},"TooltipContentHoverable")),ile=H$("TooltipContent"),D4=v.forwardRef(Cr(function(e,n){const{__scopeTooltip:r,children:s,"aria-label":i,id:o,onEscapeKeyDown:l,onPointerDownOutside:u,...d}=e,f=Sm(Zp,r),h=Xk(r),{onClose:m}=f,[g,_]=v.useState(null),y=Ts(n,_);Vk(g),v.useEffect(()=>(document.addEventListener(Cx,m),()=>document.removeEventListener(Cx,m)),[m]),v.useEffect(()=>{if(f.trigger){const x=Cr(S=>{S.target instanceof Node&&S.target.contains(f.trigger)&&m()},"handleScroll");return window.addEventListener("scroll",x,{capture:!0}),()=>window.removeEventListener("scroll",x,{capture:!0})}},[f.trigger,m]);const{setContentId:b}=f;return Bs(()=>(b(o),()=>{b(void 0)}),[o,b]),T.jsx($k,{asChild:!0,disableOutsidePointerEvents:!1,onEscapeKeyDown:l,onPointerDownOutside:u,onFocusOutside:x=>x.preventDefault(),onDismiss:m,children:T.jsxs(C4,{"data-state":f.stateAttribute,role:i?void 0:"tooltip",id:i?void 0:f.contentId,...h,...d,ref:y,style:{...d.style,"--radix-tooltip-content-transform-origin":"var(--radix-popper-transform-origin)","--radix-tooltip-content-available-width":"var(--radix-popper-available-width)","--radix-tooltip-content-available-height":"var(--radix-popper-available-height)","--radix-tooltip-trigger-width":"var(--radix-popper-anchor-width)","--radix-tooltip-trigger-height":"var(--radix-popper-anchor-height)"},children:[T.jsx(ile,{children:s}),i?T.jsx(Bae,{id:f.contentId,role:"tooltip",children:i}):null]})})},"TooltipContentImpl"));function $4(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")}}Cr($4,"getExitSideFromRect");function F4(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}Cr(F4,"getPaddedExitPoints");function j4(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}]}Cr(j4,"getPointsFromRect");function z4(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,m=u.y;f>r!=m>r&&n<(h-d)*(r-f)/(m-f)+d&&(s=!s)}return s}Cr(z4,"isPointInPolygon");function V4(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),H4(e)}Cr(V4,"getHull");function H4(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)}Cr(H4,"getHullPresorted");function U4(...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}Cr(U4,"concatAriaDescribedby");const ole={medium:"'wght' 450"},Zv={fast:{type:"spring",duration:.08,bounce:0},moderate:{type:"spring",duration:.16,bounce:0},slow:{type:"spring",duration:.24,bounce:.12}},Z4=v.createContext(null);function B4({value:t,children:e}){return T.jsx(Z4.Provider,{value:t,children:e})}function ale(t){switch(t){case"top":return{y:4};case"bottom":return{y:-4};case"left":return{x:4};case"right":return{x:-4}}}function W4({content:t,children:e,side:n="top",sideOffset:r=8,delayDuration:s=200,className:i,forceOpen:o,onOpenChange:l}){const[u,d]=v.useState(!1),f=o!==void 0?o:u,[h,m]=v.useState(!1),g=v.useContext(Z4);v.useEffect(()=>{f&&m(!0)},[f]);const _=()=>{f||m(!1)},y=ale(n);return T.jsx(Yae,{delayDuration:s,children:T.jsxs(Qae,{open:f,onOpenChange:b=>{d(b),l==null||l(b)},children:[T.jsx(Jae,{asChild:!0,children:e}),h&&T.jsx(nle,{forceMount:!0,container:g??void 0,children:T.jsx(rle,{side:n,sideOffset:r,forceMount:!0,className:"z-tooltip",children:T.jsx(La.div,{className:Fr("bg-neutral-900 text-white text-[12px] px-2 py-1 border border-white/10 shadow-lg","rounded-lg",i),style:{fontVariationSettings:ole.medium},initial:{opacity:0,scale:.8,...y},animate:{opacity:f?1:0,scale:f?1:.9,x:0,y:0},transition:f?Zv.slow:{duration:.1},onAnimationComplete:_,children:t})})})]})})}const ku=v.forwardRef(({title:t,shortcut:e,...n},r)=>{const s=T.jsx(N$,{ref:r,...n});return t?T.jsx(W4,{content:T.jsxs("div",{className:"flex flex-row items-center gap-2",children:[T.jsx("span",{children:t}),e?T.jsx("span",{className:"rounded bg-white/15 px-1.5 py-0.5 text-[11px]",children:e}):null]}),children:s}):s});ku.displayName="Button";var lle=Object.defineProperty,Jk=(t,e)=>lle(t,"name",{value:e,configurable:!0}),rg=0,Oo=null;function cle(t){return Oy(),t.children}Jk(cle,"FocusGuards");function Oy(){v.useEffect(()=>{Oo||(Oo={start:Tx(),end:Tx()});const{start:t,end:e}=Oo;return document.body.firstElementChild!==t&&document.body.insertAdjacentElement("afterbegin",t),document.body.lastElementChild!==e&&document.body.insertAdjacentElement("beforeend",e),rg++,()=>{rg===1&&(Oo==null||Oo.start.remove(),Oo==null||Oo.end.remove(),Oo=null),rg=Math.max(0,rg-1)}},[])}Jk(Oy,"useFocusGuards");function Tx(){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}Jk(Tx,"createFocusGuard");var Ho=function(){return Ho=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},Ho.apply(this,arguments)};function K4(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 ule(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 Ng="right-scroll-bar-position",Dg="width-before-scroll-bar",dle="with-scroll-bars-hidden",fle="--removed-body-scroll-bar-size";function Qw(t,e){return typeof t=="function"?t(e):t&&(t.current=e),t}function hle(t,e){var n=v.useState(function(){return{value:t,callback:e,facade:{get current(){return n.value},set current(r){var s=n.value;s!==r&&(n.value=r,n.callback(r,s))}}}})[0];return n.callback=e,n.facade}var ple=typeof window<"u"?v.useLayoutEffect:v.useEffect,_3=new WeakMap;function mle(t,e){var n=hle(null,function(r){return t.forEach(function(s){return Qw(s,r)})});return ple(function(){var r=_3.get(n);if(r){var s=new Set(r),i=new Set(t),o=n.current;s.forEach(function(l){i.has(l)||Qw(l,null)}),i.forEach(function(l){s.has(l)||Qw(l,o)})}_3.set(n,t)},[t]),n}function gle(t){return t}function vle(t,e){e===void 0&&(e=gle);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 yle(t){t===void 0&&(t={});var e=vle(null);return e.options=Ho({async:!0,ssr:!1},t),e}var G4=function(t){var e=t.sideCar,n=K4(t,["sideCar"]);if(!e)throw new Error("Sidecar: please provide `sideCar` property to import the right car");var r=e.read();if(!r)throw new Error("Sidecar medium not found");return v.createElement(r,Ho({},n))};G4.isSideCarExport=!0;function _le(t,e){return t.useMedium(e),G4}var q4=yle(),Jw=function(){},My=v.forwardRef(function(t,e){var n=v.useRef(null),r=v.useState({onScrollCapture:Jw,onWheelCapture:Jw,onTouchMoveCapture:Jw}),s=r[0],i=r[1],o=t.forwardProps,l=t.children,u=t.className,d=t.removeScrollBar,f=t.enabled,h=t.shards,m=t.sideCar,g=t.noRelative,_=t.noIsolation,y=t.inert,b=t.allowPinchZoom,x=t.as,S=x===void 0?"div":x,E=t.gapMode,C=K4(t,["forwardProps","children","className","removeScrollBar","enabled","shards","sideCar","noRelative","noIsolation","inert","allowPinchZoom","as","gapMode"]),R=m,O=mle([n,e]),I=Ho(Ho({},C),s);return v.createElement(v.Fragment,null,f&&v.createElement(R,{sideCar:q4,removeScrollBar:d,shards:h,noRelative:g,noIsolation:_,inert:y,setCallbacks:i,allowPinchZoom:!!b,lockRef:n,gapMode:E}),o?v.cloneElement(v.Children.only(l),Ho(Ho({},I),{ref:O})):v.createElement(S,Ho({},I,{className:u,ref:O}),l))});My.defaultProps={enabled:!0,removeScrollBar:!0,inert:!1};My.classNames={fullWidth:Dg,zeroRight:Ng};var wle=function(){if(typeof __webpack_nonce__<"u")return __webpack_nonce__};function ble(){if(!document)return null;var t=document.createElement("style");t.type="text/css";var e=wle();return e&&t.setAttribute("nonce",e),t}function xle(t,e){t.styleSheet?t.styleSheet.cssText=e:t.appendChild(document.createTextNode(e))}function Sle(t){var e=document.head||document.getElementsByTagName("head")[0];e.appendChild(t)}var kle=function(){var t=0,e=null;return{add:function(n){t==0&&(e=ble())&&(xle(e,n),Sle(e)),t++},remove:function(){t--,!t&&e&&(e.parentNode&&e.parentNode.removeChild(e),e=null)}}},Ele=function(){var t=kle();return function(e,n){v.useEffect(function(){return t.add(e),function(){t.remove()}},[e&&n])}},Y4=function(){var t=Ele(),e=function(n){var r=n.styles,s=n.dynamic;return t(r,s),null};return e},Cle={left:0,top:0,right:0,gap:0},eb=function(t){return parseInt(t||"",10)||0},Ple=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[eb(n),eb(r),eb(s)]},Tle=function(t){if(t===void 0&&(t="margin"),typeof window>"u")return Cle;var e=Ple(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])}},Rle=Y4(),Fd="data-scroll-locked",Ale=function(t,e,n,r){var s=t.left,i=t.top,o=t.right,l=t.gap;return n===void 0&&(n="margin"),`
130
- .`.concat(dle,` {
131
- overflow: hidden `).concat(r,`;
132
- padding-right: `).concat(l,"px ").concat(r,`;
133
- }
134
- body[`).concat(Fd,`] {
135
- overflow: hidden `).concat(r,`;
136
- overscroll-behavior: contain;
137
- `).concat([e&&"position: relative ".concat(r,";"),n==="margin"&&`
138
- padding-left: `.concat(s,`px;
139
- padding-top: `).concat(i,`px;
140
- padding-right: `).concat(o,`px;
141
- margin-left:0;
142
- margin-top:0;
143
- margin-right: `).concat(l,"px ").concat(r,`;
144
- `),n==="padding"&&"padding-right: ".concat(l,"px ").concat(r,";")].filter(Boolean).join(""),`
145
- }
146
-
147
- .`).concat(Ng,` {
148
- right: `).concat(l,"px ").concat(r,`;
149
- }
150
-
151
- .`).concat(Dg,` {
152
- margin-right: `).concat(l,"px ").concat(r,`;
153
- }
154
-
155
- .`).concat(Ng," .").concat(Ng,` {
156
- right: 0 `).concat(r,`;
157
- }
158
-
159
- .`).concat(Dg," .").concat(Dg,` {
160
- margin-right: 0 `).concat(r,`;
161
- }
162
-
163
- body[`).concat(Fd,`] {
164
- `).concat(fle,": ").concat(l,`px;
165
- }
166
- `)},w3=function(){var t=parseInt(document.body.getAttribute(Fd)||"0",10);return isFinite(t)?t:0},Ile=function(){v.useEffect(function(){return document.body.setAttribute(Fd,(w3()+1).toString()),function(){var t=w3()-1;t<=0?document.body.removeAttribute(Fd):document.body.setAttribute(Fd,t.toString())}},[])},Ole=function(t){var e=t.noRelative,n=t.noImportant,r=t.gapMode,s=r===void 0?"margin":r;Ile();var i=v.useMemo(function(){return Tle(s)},[s]);return v.createElement(Rle,{styles:Ale(i,!e,s,n?"":"!important")})},Rx=!1;if(typeof window<"u")try{var sg=Object.defineProperty({},"passive",{get:function(){return Rx=!0,!0}});window.addEventListener("test",sg,sg),window.removeEventListener("test",sg,sg)}catch{Rx=!1}var fd=Rx?{passive:!1}:!1,Mle=function(t){return t.tagName==="TEXTAREA"},X4=function(t,e){if(!(t instanceof Element))return!1;var n=window.getComputedStyle(t);return n[e]!=="hidden"&&!(n.overflowY===n.overflowX&&!Mle(t)&&n[e]==="visible")},Lle=function(t){return X4(t,"overflowY")},Nle=function(t){return X4(t,"overflowX")},b3=function(t,e){var n=e.ownerDocument,r=e;do{typeof ShadowRoot<"u"&&r instanceof ShadowRoot&&(r=r.host);var s=Q4(t,r);if(s){var i=J4(t,r),o=i[1],l=i[2];if(o>l)return!0}r=r.parentNode}while(r&&r!==n.body);return!1},Dle=function(t){var e=t.scrollTop,n=t.scrollHeight,r=t.clientHeight;return[e,n,r]},$le=function(t){var e=t.scrollLeft,n=t.scrollWidth,r=t.clientWidth;return[e,n,r]},Q4=function(t,e){return t==="v"?Lle(e):Nle(e)},J4=function(t,e){return t==="v"?Dle(e):$le(e)},Fle=function(t,e){return t==="h"&&e==="rtl"?-1:1},jle=function(t,e,n,r,s){var i=Fle(t,window.getComputedStyle(e).direction),o=i*r,l=n.target,u=e.contains(l),d=!1,f=o>0,h=0,m=0;do{if(!l)break;var g=J4(t,l),_=g[0],y=g[1],b=g[2],x=y-b-i*_;(_||x)&&Q4(t,l)&&(h+=x,m+=_);var S=l.parentNode;l=S&&S.nodeType===Node.DOCUMENT_FRAGMENT_NODE?S.host:S}while(!u&&l!==document.body||u&&(e.contains(l)||e===l));return(f&&Math.abs(h)<1||!f&&Math.abs(m)<1)&&(d=!0),d},ig=function(t){return"changedTouches"in t?[t.changedTouches[0].clientX,t.changedTouches[0].clientY]:[0,0]},x3=function(t){return[t.deltaX,t.deltaY]},S3=function(t){return t&&"current"in t?t.current:t},zle=function(t,e){return t[0]===e[0]&&t[1]===e[1]},Vle=function(t){return`
167
- .block-interactivity-`.concat(t,` {pointer-events: none;}
168
- .allow-interactivity-`).concat(t,` {pointer-events: all;}
169
- `)},Hle=0,hd=[];function Ule(t){var e=v.useRef([]),n=v.useRef([0,0]),r=v.useRef(),s=v.useState(Hle++)[0],i=v.useState(Y4)[0],o=v.useRef(t);v.useEffect(function(){o.current=t},[t]),v.useEffect(function(){if(t.inert){document.body.classList.add("block-interactivity-".concat(s));var y=ule([t.lockRef.current],(t.shards||[]).map(S3),!0).filter(Boolean);return y.forEach(function(b){return b.classList.add("allow-interactivity-".concat(s))}),function(){document.body.classList.remove("block-interactivity-".concat(s)),y.forEach(function(b){return b.classList.remove("allow-interactivity-".concat(s))})}}},[t.inert,t.lockRef.current,t.shards]);var l=v.useCallback(function(y,b){if("touches"in y&&y.touches.length===2||y.type==="wheel"&&y.ctrlKey)return!o.current.allowPinchZoom;var x=ig(y),S=n.current,E="deltaX"in y?y.deltaX:S[0]-x[0],C="deltaY"in y?y.deltaY:S[1]-x[1],R,O=y.target,I=Math.abs(E)>Math.abs(C)?"h":"v";if("touches"in y&&I==="h"&&O.type==="range")return!1;var A=window.getSelection(),L=A&&A.anchorNode,N=L?L===O||L.contains(O):!1;if(N)return!1;var H=b3(I,O);if(!H)return!0;if(H?R=I:(R=I==="v"?"h":"v",H=b3(I,O)),!H)return!1;if(!r.current&&"changedTouches"in y&&(E||C)&&(r.current=R),!R)return!0;var $=r.current||R;return jle($,b,y,$==="h"?E:C)},[]),u=v.useCallback(function(y){var b=y;if(!(!hd.length||hd[hd.length-1]!==i)){var x="deltaY"in b?x3(b):ig(b),S=e.current.filter(function(R){return R.name===b.type&&(R.target===b.target||b.target===R.shadowParent)&&zle(R.delta,x)})[0];if(S&&S.should){b.cancelable&&b.preventDefault();return}if(!S){var E=(o.current.shards||[]).map(S3).filter(Boolean).filter(function(R){return R.contains(b.target)}),C=E.length>0?l(b,E[0]):!o.current.noIsolation;C&&b.cancelable&&b.preventDefault()}}},[]),d=v.useCallback(function(y,b,x,S){var E={name:y,delta:b,target:x,should:S,shadowParent:Zle(x)};e.current.push(E),setTimeout(function(){e.current=e.current.filter(function(C){return C!==E})},1)},[]),f=v.useCallback(function(y){n.current=ig(y),r.current=void 0},[]),h=v.useCallback(function(y){d(y.type,x3(y),y.target,l(y,t.lockRef.current))},[]),m=v.useCallback(function(y){d(y.type,ig(y),y.target,l(y,t.lockRef.current))},[]);v.useEffect(function(){return hd.push(i),t.setCallbacks({onScrollCapture:h,onWheelCapture:h,onTouchMoveCapture:m}),document.addEventListener("wheel",u,fd),document.addEventListener("touchmove",u,fd),document.addEventListener("touchstart",f,fd),function(){hd=hd.filter(function(y){return y!==i}),document.removeEventListener("wheel",u,fd),document.removeEventListener("touchmove",u,fd),document.removeEventListener("touchstart",f,fd)}},[]);var g=t.removeScrollBar,_=t.inert;return v.createElement(v.Fragment,null,_?v.createElement(i,{styles:Vle(s)}):null,g?v.createElement(Ole,{noRelative:t.noRelative,gapMode:t.gapMode}):null)}function Zle(t){for(var e=null;t!==null;)t instanceof ShadowRoot&&(e=t.host,t=t.host),t=t.parentNode;return e}const Ble=_le(q4,Ule);var eE=v.forwardRef(function(t,e){return v.createElement(My,Ho({},t,{ref:e,sideCar:Ble}))});eE.classNames=My.classNames;var Wle=function(t){if(typeof document>"u")return null;var e=Array.isArray(t)?t[0]:t;return e.ownerDocument.body},pd=new WeakMap,og=new WeakMap,ag={},tb=0,eF=function(t){return t&&(t.host||eF(t.parentNode))},Kle=function(t,e){return e.map(function(n){if(t.contains(n))return n;var r=eF(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})},Gle=function(t,e,n,r){var s=Kle(e,Array.isArray(t)?t:[t]);ag[n]||(ag[n]=new WeakMap);var i=ag[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(m){if(l.has(m))f(m);else try{var g=m.getAttribute(r),_=g!==null&&g!=="false",y=(pd.get(m)||0)+1,b=(i.get(m)||0)+1;pd.set(m,y),i.set(m,b),o.push(m),y===1&&_&&og.set(m,!0),b===1&&m.setAttribute(n,"true"),_||m.setAttribute(r,"true")}catch(x){console.error("aria-hidden: cannot operate on ",m,x)}})};return f(e),l.clear(),tb++,function(){o.forEach(function(h){var m=pd.get(h)-1,g=i.get(h)-1;pd.set(h,m),i.set(h,g),m||(og.has(h)||h.removeAttribute(r),og.delete(h)),g||h.removeAttribute(n)}),tb--,tb||(pd=new WeakMap,pd=new WeakMap,og=new WeakMap,ag={})}},tF=function(t,e,n){n===void 0&&(n="data-aria-hidden");var r=Array.from(Array.isArray(t)?t:[t]),s=Wle(t);return s?(r.push.apply(r,Array.from(s.querySelectorAll("[aria-live], script"))),Gle(r,s,n,"aria-hidden")):function(){return null}},qle=Object.defineProperty,ei=(t,e)=>qle(t,"name",{value:e,configurable:!0}),tE="Dialog",[nF,dme]=bm(tE),[Yle,go]=nF(tE),Ly=ei(t=>{const{__scopeDialog:e,children:n,open:r,defaultOpen:s,onOpenChange:i,modal:o=!0}=t,l=v.useRef(null),u=v.useRef(null),{nodes:d,registry:f}=zk(),[h,m]=Iy({prop:r,defaultProp:s??!1,onChange:i,caller:tE}),[g,_]=v.useState(0),[y,b]=v.useState(0);return T.jsx(Yle,{scope:e,triggerRef:l,contentRef:u,contentId:Ul(),titleId:Ul(),descriptionId:Ul(),titlePresent:g>0,descriptionPresent:y>0,setTitleCount:_,setDescriptionCount:b,open:h,onOpenChange:m,onOpenToggle:v.useCallback(()=>m(x=>!x),[m]),modal:o,branchNodes:d,branchRegistry:f,children:n})},"Dialog"),Xle="DialogTrigger",fme=v.forwardRef(ei(function(e,n){const{__scopeDialog:r,...s}=e,i=go(Xle,r),o=Ts(n,i.triggerRef);return T.jsx(ki.button,{type:"button","aria-haspopup":"dialog","aria-expanded":i.open,"aria-controls":i.open?i.contentId:void 0,"data-state":zy(i.open),...s,ref:o,onClick:Er(e.onClick,i.onOpenToggle)})},"DialogTrigger")),rF="DialogPortal",[Qle,sF]=nF(rF,{forceMount:void 0}),Ny=ei(t=>{const{__scopeDialog:e,forceMount:n,children:r,container:s}=t,i=go(rF,e);return T.jsx(Qle,{scope:e,forceMount:n,children:v.Children.map(r,o=>T.jsx(Cu,{present:n||i.open,children:T.jsx(qk,{asChild:!0,container:s,children:o})}))})},"DialogPortal"),Ax="DialogOverlay",Dy=v.forwardRef(ei(function(e,n){const r=sF(Ax,e.__scopeDialog),{forceMount:s=r.forceMount,...i}=e,o=go(Ax,e.__scopeDialog);return o.modal?T.jsx(Cu,{present:s||o.open,children:T.jsx(ece,{...i,ref:n})}):null},"DialogOverlay")),Jle=Sy("DialogOverlay.RemoveScroll"),ece=v.forwardRef(ei(function(e,n){const{__scopeDialog:r,...s}=e,i=go(Ax,r),o=X$(),l=Ts(n,o);return T.jsx(eE,{as:Jle,allowPinchZoom:!0,shards:v.useMemo(()=>[i.contentRef,...i.branchNodes.map(u=>({current:u}))],[i.contentRef,i.branchNodes]),children:T.jsx(ki.div,{"data-state":zy(i.open),...s,ref:l,style:{pointerEvents:"auto",...s.style}})})},"DialogOverlayImpl")),Bp="DialogContent",$y=v.forwardRef(ei(function(e,n){const r=sF(Bp,e.__scopeDialog),{forceMount:s=r.forceMount,...i}=e,o=go(Bp,e.__scopeDialog);return T.jsx(Cu,{present:s||o.open,children:o.modal?T.jsx(tce,{...i,ref:n}):T.jsx(nce,{...i,ref:n})})},"DialogContent")),tce=v.forwardRef(ei(function(e,n){const r=go(Bp,e.__scopeDialog),s=v.useRef(null),i=Ts(n,r.contentRef,s);return v.useEffect(()=>{const o=s.current;if(o)return tF(o)},[]),T.jsx(iF,{...e,ref:i,trapFocus:r.open,disableOutsidePointerEvents:r.open,onCloseAutoFocus:Er(e.onCloseAutoFocus,o=>{var l;o.preventDefault(),(l=r.triggerRef.current)==null||l.focus()}),onPointerDownOutside:Er(e.onPointerDownOutside,o=>{const l=o.detail.originalEvent,u=l.button===0&&l.ctrlKey===!0;(l.button===2||u)&&o.preventDefault()}),onFocusOutside:Er(e.onFocusOutside,o=>o.preventDefault())})},"DialogContentModal")),nce=v.forwardRef(ei(function(e,n){const r=go(Bp,e.__scopeDialog),s=v.useRef(!1),i=v.useRef(!1);return T.jsx(iF,{...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")),iF=v.forwardRef(ei(function(e,n){const{__scopeDialog:r,trapFocus:s,onOpenAutoFocus:i,onCloseAutoFocus:o,"aria-describedby":l,children:u,...d}=e,f=go(Bp,r);return Oy(),T.jsx(jk,{registry:f.branchRegistry,children:T.jsx(e4,{asChild:!0,loop:!0,trapped:s,branches:f.branchNodes,onMountAutoFocus:i,onUnmountAutoFocus:o,children:T.jsx($k,{role:"dialog",id:f.contentId,"aria-labelledby":f.titlePresent?f.titleId:void 0,"aria-describedby":f.descriptionPresent?oF(l,f.descriptionId):l,"data-state":zy(f.open),...d,ref:n,deferPointerDownOutside:!0,onDismiss:()=>f.onOpenChange(!1),children:u})})})},"DialogContentImpl")),Fy=v.forwardRef(ei(function(e,n){const{__scopeDialog:r,...s}=e,i=go("DialogTitle",r),{setTitleCount:o}=i;return Bs(()=>(o(l=>l+1),()=>o(l=>l-1)),[o]),T.jsx(ki.h2,{id:i.titleId,...s,ref:n})},"DialogTitle")),jy=v.forwardRef(ei(function(e,n){const{__scopeDialog:r,...s}=e,i=go("DialogDescription",r),{setDescriptionCount:o}=i;return Bs(()=>(o(l=>l+1),()=>o(l=>l-1)),[o]),T.jsx(ki.p,{id:i.descriptionId,...s,ref:n})},"DialogDescription")),rce="DialogClose",hme=v.forwardRef(ei(function(e,n){const{__scopeDialog:r,...s}=e,i=go(rce,r);return T.jsx(ki.button,{type:"button",...s,ref:n,onClick:Er(e.onClick,()=>i.onOpenChange(!1))})},"DialogClose"));function oF(...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}ei(oF,"concatAriaDescribedby");function zy(t){return t?"open":"closed"}ei(zy,"getState");var sce=Object.defineProperty,Wa=(t,e)=>sce(t,"name",{value:e,configurable:!0}),nE="Popover",[aF,pme]=bm(nE,[Ry]),rE=Ry(),[ice,Hf]=aF(nE),sE=Wa(t=>{const{__scopePopover:e,children:n,open:r,defaultOpen:s,onOpenChange:i,modal:o=!1}=t,l=rE(e),u=v.useRef(null),[d,f]=v.useState(!1),[h,m]=v.useState(0),[g,_]=v.useState(0),[y,b]=Iy({prop:r,defaultProp:s??!1,onChange:i,caller:nE});return T.jsx(S4,{...l,children:T.jsx(ice,{scope:e,contentId:Ul(),titleId:Ul(),descriptionId:Ul(),titlePresent:h>0,descriptionPresent:g>0,setTitleCount:m,setDescriptionCount:_,triggerRef:u,open:y,onOpenChange:b,onOpenToggle:v.useCallback(()=>b(x=>!x),[b]),hasCustomAnchor:d,onCustomAnchorAdd:v.useCallback(()=>f(!0),[]),onCustomAnchorRemove:v.useCallback(()=>f(!1),[]),modal:o,children:n})})},"Popover"),oce="PopoverTrigger",iE=v.forwardRef(Wa(function(e,n){const{__scopePopover:r,...s}=e,i=Hf(oce,r),o=rE(r),l=Ts(n,i.triggerRef),u=T.jsx(ki.button,{type:"button","aria-haspopup":"dialog","aria-expanded":i.open,"aria-controls":i.open?i.contentId:void 0,"data-state":lE(i.open),...s,ref:l,onClick:Er(e.onClick,i.onOpenToggle)});return i.hasCustomAnchor?u:T.jsx(k4,{asChild:!0,...o,children:u})},"PopoverTrigger")),lF="PopoverPortal",[ace,lce]=aF(lF,{forceMount:void 0}),oE=Wa(t=>{const{__scopePopover:e,forceMount:n,children:r,container:s}=t,i=Hf(lF,e);return T.jsx(ace,{scope:e,forceMount:n,children:T.jsx(Cu,{present:n||i.open,children:T.jsx(qk,{asChild:!0,container:s,children:r})})})},"PopoverPortal"),Wp="PopoverContent",aE=v.forwardRef(Wa(function(e,n){const r=lce(Wp,e.__scopePopover),{forceMount:s=r.forceMount,...i}=e,o=Hf(Wp,e.__scopePopover);return T.jsx(Cu,{present:s||o.open,children:o.modal?T.jsx(uce,{...i,ref:n}):T.jsx(dce,{...i,ref:n})})},"PopoverContent")),cce=Sy("PopoverContent.RemoveScroll"),uce=v.forwardRef(Wa(function(e,n){const r=Hf(Wp,e.__scopePopover),s=v.useRef(null),i=Ts(n,s),o=v.useRef(!1),{nodes:l,registry:u}=zk();return v.useEffect(()=>{const d=s.current;if(d)return tF(d)},[]),T.jsx(eE,{as:cce,allowPinchZoom:!0,shards:v.useMemo(()=>[s,...l.map(d=>({current:d}))],[s,l]),children:T.jsx(cF,{...e,ref:i,branchNodes:l,branchRegistry:u,trapFocus:r.open,disableOutsidePointerEvents:!0,onCloseAutoFocus:Er(e.onCloseAutoFocus,d=>{var f;d.preventDefault(),o.current||(f=r.triggerRef.current)==null||f.focus()}),onPointerDownOutside:Er(e.onPointerDownOutside,d=>{const f=d.detail.originalEvent,h=f.button===0&&f.ctrlKey===!0,m=f.button===2||h;o.current=m},{checkForDefaultPrevented:!1}),onFocusOutside:Er(e.onFocusOutside,d=>d.preventDefault(),{checkForDefaultPrevented:!1})})})},"PopoverContentModal")),dce=v.forwardRef(Wa(function(e,n){const r=Hf(Wp,e.__scopePopover),s=v.useRef(!1),i=v.useRef(!1);return T.jsx(cF,{...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")),cF=v.forwardRef(Wa(function(e,n){const{__scopePopover:r,trapFocus:s,onOpenAutoFocus:i,onCloseAutoFocus:o,disableOutsidePointerEvents:l,onEscapeKeyDown:u,onPointerDownOutside:d,onFocusOutside:f,onInteractOutside:h,"aria-describedby":m,branchNodes:g,branchRegistry:_,...y}=e,b=Hf(Wp,r),x=rE(r),[S,E]=v.useState(null),C=Ts(n,E);return Vk(S),Oy(),T.jsx(jk,{registry:_,children:T.jsx(e4,{asChild:!0,loop:!0,trapped:s,branches:g,onMountAutoFocus:i,onUnmountAutoFocus:o,children:T.jsx($k,{asChild:!0,disableOutsidePointerEvents:l,onInteractOutside:h,onEscapeKeyDown:u,onPointerDownOutside:d,onFocusOutside:f,onDismiss:()=>b.onOpenChange(!1),deferPointerDownOutside:!0,children:T.jsx(C4,{"data-state":lE(b.open),role:"dialog",id:b.contentId,"aria-labelledby":b.titlePresent?b.titleId:void 0,"aria-describedby":b.descriptionPresent?uF(m,b.descriptionId):m,...x,...y,ref:C,style:{...y.style,"--radix-popover-content-transform-origin":"var(--radix-popper-transform-origin)","--radix-popover-content-available-width":"var(--radix-popper-available-width)","--radix-popover-content-available-height":"var(--radix-popper-available-height)","--radix-popover-trigger-width":"var(--radix-popper-anchor-width)","--radix-popover-trigger-height":"var(--radix-popper-anchor-height)"}})})})})},"PopoverContentImpl"));function lE(t){return t?"open":"closed"}Wa(lE,"getState");function uF(...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}Wa(uF,"concatAriaDescribedby");const fce="data-hover-dead-zone";function hce(t,e={}){const{axis:n="y",snapTolerancePx:r=1/0}=e,s=v.useRef(new Map),[i,o]=v.useState(null),[l,u]=v.useState([]),d=v.useRef([]),f=v.useRef(0),h=v.useRef(null),m=v.useRef(null),g=v.useCallback(()=>{const E=[];return s.current.forEach((C,R)=>{E[R]={top:C.offsetTop,height:C.offsetHeight,left:C.offsetLeft,width:C.offsetWidth}}),E},[]),_=v.useCallback(()=>{if(!t.current)return;const C=g();d.current=C,u(C)},[t,g]),y=v.useCallback((E,C)=>{C?s.current.set(E,C):s.current.delete(E),m.current!==null&&cancelAnimationFrame(m.current),m.current=requestAnimationFrame(()=>{m.current=null,_()})},[_]),b=v.useCallback(E=>{const C=E.clientX,R=E.clientY,O=E.target instanceof Element&&E.target.closest(`[${fce}]`)!==null;h.current!==null&&cancelAnimationFrame(h.current),h.current=requestAnimationFrame(()=>{h.current=null;const I=t.current;if(!I)return;if(O){o(null);return}const A=g(),L=d.current;(A.length!==L.length||A.some((ue,ie)=>{const ce=L[ie];return!ce||!ue||ue.top!==ce.top||ue.height!==ce.height||ue.left!==ce.left||ue.width!==ce.width}))&&(d.current=A,u(A));const H=I.getBoundingClientRect(),$=n==="x"?C:R;let W=null,X=1/0,z=null;const K=d.current,te=n==="x"?I.scrollLeft:I.scrollTop,Z=n==="x"?I.clientLeft:I.clientTop,J=n==="x"?H.left:H.top,q=n==="x"?I.offsetWidth:I.offsetHeight,j=n==="x"?H.width:H.height,Y=q>0?j/q:1;for(let ue=0;ue<K.length;ue++){const ie=K[ue];if(!ie)continue;const ce=n==="x"?ie.left:ie.top,he=J+(Z+ce-te)*Y,ke=(n==="x"?ie.width:ie.height)*Y,ve=he+ke;$>=he&&$<=ve&&(z=ue);let pe=0;$<he?pe=he-$:$>ve&&(pe=$-ve),pe<X&&(X=pe,W=ue)}o(z??(X<=r?W:null))})},[n,t,r,g]),x=v.useCallback(()=>{f.current+=1,_()},[_]),S=v.useCallback(()=>{h.current!==null&&(cancelAnimationFrame(h.current),h.current=null),o(null)},[]);return v.useEffect(()=>()=>{h.current!==null&&cancelAnimationFrame(h.current),m.current!==null&&cancelAnimationFrame(m.current)},[]),{activeIndex:i,setActiveIndex:o,itemRects:l,sessionRef:f,handlers:{onMouseMove:b,onMouseEnter:x,onMouseLeave:S},registerItem:y,measureItems:_}}function pce(t,e,n){v.useEffect(()=>(t(e,n.current),()=>t(e,null)),[e,t,n])}const Kp=t=>{const e=v.useRef(t);return v.useLayoutEffect(()=>{e.current=t}),e};let $g=0;const mce=()=>{$g+=1;let t=!1;return()=>{t||(t=!0,$g=Math.max(0,$g-1))}},gce=()=>$g>0,vce='[data-menu-item]:not([disabled]):not([aria-disabled="true"])',dF=({itemSelector:t=vce,loop:e=!1,onDismiss:n}={})=>{const r=v.useRef(null),s=v.useRef(null),i=Kp(n),o=v.useRef(!1),l=v.useCallback(f=>{var h;if(r.current=f,f){o.current=!1;const m=mce(),g=f.ownerDocument.defaultView;let _;const y=()=>{g==null||g.clearTimeout(_),_=g==null?void 0:g.setTimeout(()=>{const b=f.ownerDocument.activeElement;(b==null?void 0:b.tagName)==="IFRAME"&&!f.contains(b)&&i.current&&(o.current=!0,i.current())})};g==null||g.addEventListener("blur",y),s.current=()=>{g==null||g.removeEventListener("blur",y),g==null||g.clearTimeout(_),m()}}else(h=s.current)==null||h.call(s),s.current=null},[i]),u=f=>{o.current&&f.preventDefault()},d=v.useCallback(f=>{var S;const{key:h}=f;if(h!=="ArrowDown"&&h!=="ArrowUp"&&h!=="Home"&&h!=="End")return;const m=r.current;if(!m)return;const g=Array.from(m.querySelectorAll(t));if(g.length===0)return;f.preventDefault(),f.stopPropagation();const _=g.indexOf(document.activeElement),y=g.length-1,b=E=>{if(_===-1)return E===1?0:y;const C=_+E;return e?(C+g.length)%g.length:Math.min(Math.max(C,0),y)};let x;h==="Home"?x=0:h==="End"?x=y:h==="ArrowDown"?x=b(1):x=b(-1),(S=g[x])==null||S.focus()},[t,e]);return{containerRef:l,onKeyDown:d,onCloseAutoFocus:u}},fF=({queryKey:t,data:e})=>{const n=mm(),[r,s]=v.useState(null),i=r!==null&&r.base===e?r.value:e,o=Kp({queryKey:t,data:e,visible:i}),l=v.useCallback(u=>{const d=o.current,f=u(n.getQueryData(d.queryKey)??d.visible);return n.setQueryData(d.queryKey,f),o.current={...d,visible:f},s({base:d.data,value:f}),f},[n,o]);return{data:i,updateData:l}},Ix=["project-library"],k3=[...Ix,"history"],E3=["library-project-preview"],C3=["variants-history"],Ks={rivetConfig:["rivet-config"],featureFlags:["rivet-feature-flags"],account:["rivet-account"],serverConfig:["server-config"],integrations:["integrations"],cosmosProfile:["cosmos-profile"],previewUpstreamHealth:t=>["preview-upstream-health",t],variantsUiState:t=>["variants-ui-state",t],variantsHistory:{all:C3,list:t=>[...C3,t]},designLibrary:(t,e)=>["design-library",t,e],designReferenceSearch:({profileId:t,revision:e,references:n,search:r,sourceId:s})=>["design-reference-search",t,e,n,r,s],designLibraryImage:({profileId:t,referenceId:e,hash:n})=>["design-library-image",t,e,n],projectLibrary:{all:Ix,projects:[...Ix,"projects"],histories:k3,history:t=>[...k3,t]},libraryProjectPreview:{project:t=>[...E3,t],thumbnail:(t,e)=>[...E3,t,e]},libraryWorkspace:t=>["library-workspace",t],libraryPreview:({projectId:t,sessionId:e,variantId:n})=>["library-preview",t,e,n]};var Fg={exports:{}},yce=Fg.exports,P3;function _ce(){return P3||(P3=1,(function(t){(function(e,n){t.exports?t.exports=n():e.log=n()})(yce,function(){var e=function(){},n="undefined",r=typeof window!==n&&typeof window.navigator!==n&&/Trident\/|MSIE /.test(window.navigator.userAgent),s=["trace","debug","info","warn","error"],i={},o=null;function l(y,b){var x=y[b];if(typeof x.bind=="function")return x.bind(y);try{return Function.prototype.bind.call(x,y)}catch{return function(){return Function.prototype.apply.apply(x,[y,arguments])}}}function 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(y){return y==="debug"&&(y="log"),typeof console===n?!1:y==="trace"&&r?u:console[y]!==void 0?l(console,y):console.log!==void 0?l(console,"log"):e}function f(){for(var y=this.getLevel(),b=0;b<s.length;b++){var x=s[b];this[x]=b<y?e:this.methodFactory(x,y,this.name)}if(this.log=this.debug,typeof console===n&&y<this.levels.SILENT)return"No console available for logging"}function h(y){return function(){typeof console!==n&&(f.call(this),this[y].apply(this,arguments))}}function m(y,b,x){return d(y)||h.apply(this,arguments)}function g(y,b){var x=this,S,E,C,R="loglevel";typeof y=="string"?R+=":"+y:typeof y=="symbol"&&(R=void 0);function O(H){var $=(s[H]||"silent").toUpperCase();if(!(typeof window===n||!R)){try{window.localStorage[R]=$;return}catch{}try{window.document.cookie=encodeURIComponent(R)+"="+$+";"}catch{}}}function I(){var H;if(!(typeof window===n||!R)){try{H=window.localStorage[R]}catch{}if(typeof H===n)try{var $=window.document.cookie,W=encodeURIComponent(R),X=$.indexOf(W+"=");X!==-1&&(H=/^([^;]+)/.exec($.slice(X+W.length+1))[1])}catch{}return x.levels[H]===void 0&&(H=void 0),H}}function A(){if(!(typeof window===n||!R)){try{window.localStorage.removeItem(R)}catch{}try{window.document.cookie=encodeURIComponent(R)+"=; expires=Thu, 01 Jan 1970 00:00:00 UTC"}catch{}}}function L(H){var $=H;if(typeof $=="string"&&x.levels[$.toUpperCase()]!==void 0&&($=x.levels[$.toUpperCase()]),typeof $=="number"&&$>=0&&$<=x.levels.SILENT)return $;throw new TypeError("log.setLevel() called with invalid level: "+H)}x.name=y,x.levels={TRACE:0,DEBUG:1,INFO:2,WARN:3,ERROR:4,SILENT:5},x.methodFactory=b||m,x.getLevel=function(){return C??E??S},x.setLevel=function(H,$){return C=L(H),$!==!1&&O(C),f.call(x)},x.setDefaultLevel=function(H){E=L(H),I()||x.setLevel(H,!1)},x.resetLevel=function(){C=null,A(),f.call(x)},x.enableAll=function(H){x.setLevel(x.levels.TRACE,H)},x.disableAll=function(H){x.setLevel(x.levels.SILENT,H)},x.rebuild=function(){if(o!==x&&(S=L(o.getLevel())),f.call(x),o===x)for(var H in i)i[H].rebuild()},S=L(o?o.getLevel():"WARN");var N=I();N!=null&&(C=L(N)),f.call(x)}o=new g,o.getLogger=function(b){if(typeof b!="symbol"&&typeof b!="string"||b==="")throw new TypeError("You must supply a name when creating a logger.");var x=i[b];return x||(x=i[b]=new g(b,o.methodFactory)),x};var _=typeof window!==n?window.log:void 0;return o.noConflict=function(){return typeof window!==n&&window.log===o&&(window.log=_),o},o.getLoggers=function(){return i},o.default=o,o})})(Fg)),Fg.exports}var wce=_ce();const ao=iy(wce),bce="INFO",xce=bce.toUpperCase();ao.setLevel(ao.levels[xce]||ao.levels.INFO);const ti=t=>{const e=t?`[${t}] `:"";return{trace:(n,...r)=>ao.trace(`${e}${n}`,...r),debug:(n,...r)=>ao.debug(`${e}${n}`,...r),info:(n,...r)=>ao.info(`${e}${n}`,...r),warn:(n,...r)=>ao.warn(`${e}${n}`,...r),error:(n,...r)=>{ao.error(`${e}${n}`,...r);try{const i=r.map(l=>Us(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}:{}};Xe.capture("logger_error",o)}catch(s){console.error("[logger] Failed to send logger_error to PostHog:",s)}},api:(n,...r)=>ao.info(`${e}API: ${n}`,...r),hook:(n,...r)=>ao.debug(`${e}Hook: ${n}`,...r),mount:(n,...r)=>ao.debug(`${e}Mount: ${n}`,...r)}},Sce=ti("useVariantsHistory"),T3=[],kce=(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}),Ece=({historyQuery:t,snapshotKey:e,isEnabled:n,isListed:r,onLoaded:s})=>{const i=Ks.variantsHistory.list({historyQuery:t,snapshotKey:e}),o=Kp(s),l=Qo({queryKey:i,queryFn:async({signal:g})=>{let _;try{const b=await Dt(`/api/variants/history${t}`,{credentials:"same-origin",signal:g});if(!b.ok)return h.current;_=((await b.json()).variants??[]).filter(r)}catch(b){return g.aborted||Sce.warn("Failed to load past variants",b),h.current}if(g.aborted)return h.current;o.current(_);const y=h.current;return kce(y,_)?y:_},enabled:n,placeholderData:rX,gcTime:0,retry:!1,refetchOnWindowFocus:!1,refetchOnReconnect:!1,networkMode:"always"}),{data:u,updateData:d}=fF({queryKey:i,data:l.data}),f=u??T3,h=Kp(f),m=v.useCallback(g=>{d(_=>g(_??T3))},[d]);return{pastVariants:f,setPastVariants:m}},R3=ti("useVariantsUiState"),Cce={groups:[],rows:{}},jg={pinned:[],order:Cce},Gh="pinned",Pce="top",nb=t=>`rows:${t}`,rb=t=>({projectPath:t,mutations:[],preview:jg}),Tce=(t,e)=>e.reduce((n,r)=>r(n),t),hF=t=>t?`/api/variants/ui-state?projectPath=${encodeURIComponent(t)}`:"/api/variants/ui-state",Rce=async t=>{const e=await Dt(hF(t));if(!e.ok)throw new Error(`Failed to load variants UI state (${e.status})`);return FY.parse(await e.json()).uiState},Ace=async({projectPath:t,uiState:e})=>{await Dt(hF(t),{method:"PUT",headers:{"Content-Type":"application/json"},body:JSON.stringify({uiState:e})})},A3=t=>e=>e.pinned.includes(t)?e:{...e,pinned:[...e.pinned,t]},Ice=t=>e=>({...e,pinned:e.pinned.filter(n=>n!==t)}),Oce=(t,e)=>n=>{if(t===Gh){const r=new Set(e);return{...n,pinned:[...e,...n.pinned.filter(s=>!r.has(s))]}}return t===Pce?{...n,order:{...n.order,groups:e}}:{...n,order:{...n.order,rows:{...n.order.rows,[t.slice(5)]:e}}}},Mce=t=>{const e=mm(),n=Ks.variantsUiState(t),[r,s]=v.useState(()=>rb(t)),i=v.useRef(r),o=v.useCallback(C=>{i.current=C,s(C)},[]),l=v.useCallback(C=>i.current.projectPath===C?i.current:rb(C),[]),{mutate:u}=tN({mutationFn:Ace,onError:C=>{R3.warn("persist failed — arrangement kept for this session only",C)}}),d=Qo({queryKey:n,queryFn:async()=>{let C;try{C=await Rce(t)}catch(I){throw R3.warn("load failed — arrangement is session-local until reload",I),I}const{mutations:R}=l(t);if(R.length===0)return C;o(rb(t));const O=Tce(C,R);return t&&u({projectPath:t,uiState:O}),O},enabled:t!==null,gcTime:0,retry:!1,refetchOnWindowFocus:!1,refetchOnReconnect:!1,networkMode:"always"}),{data:f,updateData:h}=fF({queryKey:n,data:d.isSuccess?d.data:void 0}),m=v.useCallback(()=>{var C;return t!==null&&((C=e.getQueryState(Ks.variantsUiState(t)))==null?void 0:C.status)==="success"},[t,e]),g=v.useCallback(()=>m()?e.getQueryData(Ks.variantsUiState(t))??jg:l(t).preview,[m,t,e,l]),_=v.useCallback(C=>{if(t!==null&&m()){const O=h(I=>C(I??jg));u({projectPath:t,uiState:O});return}const R=l(t);o({projectPath:t,mutations:[...R.mutations,C],preview:C(R.preview)})},[m,u,t,l,o,h]),y=v.useCallback(C=>{const R=!g().pinned.includes(C);_(R?A3(C):Ice(C))},[_,g]),b=v.useCallback(C=>{g().pinned.includes(C)||_(A3(C))},[_,g]),x=v.useCallback((C,R)=>{_(Oce(C,R))},[_]);let S=jg;f?S=f:r.projectPath===t&&(S=r.preview);const E=v.useMemo(()=>new Set(S.pinned),[S.pinned]);return{pinnedKeys:S.pinned,pinnedKeySet:E,listOrder:S.order,togglePin:y,pinItem:b,reorder:x}},Lce=t=>{const{containerRef:e,dragged:n,yieldToSelector:r,restrictToSelector:s,onReorder:i}=t,[o,l]=v.useState(null),u=v.useCallback(h=>{const m=e.current;return m?Array.from(m.querySelectorAll(`[data-reorder-container="${CSS.escape(h)}"]`)):[]},[e]),d=v.useCallback(h=>{if(!n){o&&l(null);return}const m=e.current;if(!m)return;if(r){const x=m.querySelector(r);if(x){const S=x.getBoundingClientRect();if(h.clientY>=S.top&&h.clientY<=S.bottom){o&&l(null);return}}}if(s){const x=m.querySelector(s),S=x==null?void 0:x.getBoundingClientRect();if(!S||h.clientY<S.top||h.clientY>S.bottom){o&&l(null);return}}const g=u(n.container);if(g.length===0){o&&l(null);return}const _=m.getBoundingClientRect().top;let y=g.length;for(let x=0;x<g.length;x++){const S=g[x].getBoundingClientRect();if(h.clientY<S.top+S.height/2){y=x;break}}let b;y===0?b=g[0].getBoundingClientRect().top-_-1:y===g.length?b=g[g.length-1].getBoundingClientRect().bottom-_:b=(g[y-1].getBoundingClientRect().bottom+g[y].getBoundingClientRect().top)/2-_,(!o||o.index!==y||o.container!==n.container)&&l({container:n.container,index:y,top:b})},[e,n,o,u,r,s]),f=v.useCallback(()=>{if(!n||!o)return;l(null);const h=u(o.container).map(_=>_.dataset.reorderKey).filter(_=>!!_),m=h.indexOf(n.key);if(m===-1)return;h.splice(m,1);const g=o.index>m?o.index-1:o.index;h.splice(g,0,n.key),i(o.container,h)},[n,o,u,i]);return{dropTarget:o,onPointerMove:d,onPointerUp:f}},Nce={resize:{default:!1},variants:{default:!1},designSystemEditor:{default:!1},branchDiff:{default:!1},gitUi:{default:!0},createProject:{default:!1},share:{default:!1},deployPrototype:{default:!1},canvasShare:{default:!1},generativeControls:{default:!1},refineMode:{default:!1},inspectorUndoRedo:{default:!1}},pF=Object.fromEntries(Object.entries(Nce).map(([t,e])=>[t,{isEnabled:e.default}])),mF=dn(!0),gF=dn(null),vF=dn(0),Dce=dn({name:null,email:null}),Ox=dn(0),Bv=dn(null),Mx=dn(!1),Lx=dn(null),yF=dn(!1),_F=dn(!1),zg=dn(null),Vg=dn(null),Sf=dn(null),cE=dn(null),nc=dn(null),wF=dn(!1),km=dn({active:!1}),bF=dn([]),Nx=dn(pF),$ce=dn(!1),Vy=dn(null),Fce=dn(null),Hy=dn(!0),jce=dn(!1),xF=dn(!1),SF=dn(null),zce=()=>{var t;return typeof window>"u"?null:((t=window.__RIVET_BOOTSTRAP__)==null?void 0:t.agentApplyMode)??null},Uy=dn(zce()),Vce=dn(null);function Hce(t){return t==="cursor"?"Cursor":t==="codex"?"Codex":t==="claude-desktop"?"Claude":"Claude Code"}const Uce=t=>{var e;return[t.label.trim(),(e=t.description)==null?void 0:e.trim()].filter(n=>!!n).join(`
170
- `)},kF=async({text:t,copyKind:e})=>{const n=t.trim();if(n)try{await navigator.clipboard.writeText(n),Xe.capture("variants_panel.copy_completed",{outcome:"success",copyKind:e}),tn.success("Copied")}catch(r){Xe.capture("variants_panel.copy_failed",{outcome:"failure",copyKind:e,errorName:r instanceof Error?r.name:"UnknownError"}),tn.error("Couldn't copy")}},Zce=["⡡⠊⢔⠡","⠊⡰⡡⡘","⢔⢅⠈⢢","⡁⢂⠆⡍","⢔⠨⢑⢐","⠨⡑⡠⠊"],EF=({className:t,"data-testid":e}={})=>T.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:T.jsx("div",{className:"rivet-sparkle-strip",children:Zce.map((n,r)=>T.jsx("span",{className:"block",style:{height:"1em",lineHeight:"1em"},children:n},r))})}),Bce=({entry:t,deploying:e,deployedUrl:n,onDeploy:r,isDeployDisabled:s=!1})=>{const o=e?"Deploying…":n?"Copy link":"Share";return T.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:[T.jsxs("div",{className:"min-w-0",children:[T.jsx("div",{className:"text-content truncate text-sm font-medium",children:t.label.trim()||"Untitled direction"}),n?T.jsx("div",{className:"text-content-muted text-[11px]",children:"Deployed — share link ready"}):null]}),T.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?T.jsx(Vp,{size:12,weight:"bold"}):null,o]})]})},Wce=({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]=v.useState(!1),h=i?o??t:t,m=u.length>0;return T.jsxs("div",{className:"flex items-stretch",children:[T.jsxs("button",{onClick:n,disabled:r||i,className:`bg-main-hover hover:bg-main-input flex h-7 shrink-0 items-center gap-1.5 px-3 text-xs font-medium text-white transition-colors disabled:cursor-not-allowed disabled:opacity-50 ${m?"rounded-l-md":"rounded-md"}`,children:[e?T.jsx(e,{className:"h-3.5 w-3.5",weight:"bold"}):null,h]}),m?T.jsxs(sE,{open:d,onOpenChange:f,children:[T.jsx(iE,{asChild:!0,children:T.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:T.jsx(Dse,{className:"h-3.5 w-3.5",weight:"bold"})})}),T.jsx(oE,{children:T.jsx(aE,{className:"border-divider bg-main z-[60] min-w-[140px] rounded-lg border p-1 shadow-lg",sideOffset:5,align:"end",children:u.map(g=>{const _=g.icon;return T.jsxs("button",{onClick:()=>{g.isDisabled||(g.onClick(),f(!1))},disabled:g.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:[_?T.jsx(_,{className:"h-3.5 w-3.5",weight:"bold"}):null,g.label]},g.label)})})})]}):null]})},kf=({label:t,children:e,side:n="top",sideOffset:r=8,delayDuration:s=300,disabled:i=!1,forceOpen:o})=>i?T.jsx(T.Fragment,{children:e}):T.jsx(W4,{content:t,side:n,sideOffset:r,delayDuration:s,forceOpen:o,children:e}),Kce=32,Gce=2048,CF=Cd().max(Gce).refine(t=>{let e;try{e=decodeURIComponent(t.split(/[?#]/)[0])}catch{return!1}return t.startsWith("/")&&!t.startsWith("//")&&!t.includes("\\")&&!/^\/%(?:2f|5c)/i.test(t)&&!e.includes("\\")&&!e.split("/").some(n=>n==="."||n==="..")&&![...t].some(n=>n<=" "||n==="")},"Expected an app-relative preview route");wY(CF).min(1).max(Kce).transform(t=>[...new Set(t)]);const Zy="/__rivet/preview",I3=`${Zy}/variant/`,O3=`${Zy}/history/`,PF=t=>t?t.startsWith("/")?t:`/${t}`:"/",TF=(t,e)=>{if(!e)return t;const n=CF.parse(e);if(t.includes("?")||t.includes("#"))throw new Error("Preview target must not contain an application query or hash");return t.replace(/\/$/,"")+n},M3=(t,e)=>{const n=new URLSearchParams(e);return n.set("targetAddressed","1"),`/api/variants/history/${encodeURIComponent(t.sessionId)}/${encodeURIComponent(t.variantId)}/run?${n}`},qce=t=>{const e="/api/variants/history/"+encodeURIComponent(t.sessionId)+"/"+encodeURIComponent(t.variantId);return t.routePath?TF(e+"/site/"+encodeURIComponent(t.projectPath??"current"),t.routePath):e+"/preview"+(t.projectPath?"?projectPath="+encodeURIComponent(t.projectPath):"")},Yce=t=>`${Zy}/variant/${encodeURIComponent(t.sessionId)}/${encodeURIComponent(t.variantId)}${PF(t.routePath)}`,L3=t=>`${Zy}/history/${encodeURIComponent(t.sessionId)}/${encodeURIComponent(t.variantId)}${PF(t.routePath)}`,N3=t=>{try{const e=new URL(t,"http://localhost");return e.pathname.startsWith(I3)||e.pathname.startsWith(O3)}catch{return t.startsWith(I3)||t.startsWith(O3)}},uu=t=>{var s,i,o,l,u,d;const{sessionId:e,variant:n,projectContext:r}=t;return n.status!=="succeeded"?null:((s=n.preview)==null?void 0:s.kind)==="static_artifact"?TF(n.preview.url,(i=n.previewRoutes)==null?void 0:i[0]):e&&(((o=n.preview)==null?void 0:o.kind)==="dev_server"||typeof n.port=="number")?Yce({sessionId:e,variantId:n.workItemId,routePath:((l=n.previewRoutes)==null?void 0:l[0])??((r==null?void 0:r.kind)==="fresh"?"/":t.routePath)}):e&&(r==null?void 0:r.kind)==="fresh"&&((u=r.executionPlan)==null?void 0:u.mode)!=="vite_app"&&((d=n.preview)==null?void 0:d.kind)!=="dev_server"?`/api/variants/${e}/static/${n.workItemId}`:null},D3="/rivet/",RF=t=>{if(!t.startsWith(D3))return null;const e=t.slice(D3.length);return!e||e==="/"?null:`/${e}`},jd=t=>{var e;return!!t.hasTree&&((e=t.serve)==null?void 0:e.kind)==="dev-server"},Xce=t=>{var e,n;return((e=t.preview)==null?void 0:e.kind)==="static"||((n=t.serve)==null?void 0:n.kind)==="static"||jd(t)},Qce=t=>[...t].sort((e,n)=>new Date(n.createdAt).getTime()-new Date(e.createdAt).getTime()).find(e=>!jd(e)),Gp=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")},$3=t=>{var e,n;return Gp(t)&&(((e=t.preview)==null?void 0:e.kind)==="static_artifact"||((n=t.preview)==null?void 0:n.kind)==="dev_server")},AF=({entry:t,projectPath:e})=>{var n;return qce({sessionId:t.sessionId,variantId:t.variantId,projectPath:e,routePath:(n=t.previewRoutes)==null?void 0:n[0]})},Jce=({entry:t,projectPath:e})=>({selectedPastVariant:{sessionId:t.sessionId,variantId:t.variantId,previewKind:"static",references:t.references,projectPath:e??void 0},previewUrl:AF({entry:t,projectPath:e})}),eue=({incomingSessionId:t,previousSessionId:e,isIncomingSessionPreviewable:n,selectedPastVariant:r,displayedLiveVariantId:s,pastVariants:i})=>{if(n)return{kind:"clear"};if(r)return r.sessionId===t?{kind:"clear"}:{kind:"keep_selected"};const o=i.find(l=>l.sessionId===e&&l.variantId===s&&!jd(l));return o?{kind:"show_saved",entry:o}:{kind:"clear"}},Ef=(t,e=Dt)=>{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(()=>{})},tue=(t,e=Dt)=>{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),Ef(r,e))}},Wv=(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}}},F3=6,IF="original",uE="Original",OF="The original state of your app before any variants were generated.",j3=200,MF="h-6 w-6 rounded",Dx=[.33,1,.68,1],$x=.22,Zr=ti("AgentVariantsPanel"),sb=()=>{var t;(t=window.getSelection())==null||t.removeAllRanges()},nue=t=>{var e;return t?t.kind==="existing"?!0:((e=t.executionPlan)==null?void 0:e.mode)==="vite_app":!1};function ib(t,...e){return t?e.some(n=>(n??"").toLowerCase().includes(t)):!0}const rue=(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},LF=t=>{const e="requestId"in t?["request",t.requestId]:["label",t.runLabel];return`run:${JSON.stringify([t.sessionId,...e])}`},sue="original",Fx="pinned-section";function NF(t){return`rivet:collapsedRuns:${t}`}function lg(t){try{const e=window.localStorage.getItem(NF(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 ob(t,e){try{window.localStorage.setItem(NF(t),JSON.stringify([...e]))}catch{}}const z3=(t,e)=>{const n=[],r=new Map;for(const s of t){const i=rue(s,e);let o="";s.kind==="original"?o=sue:i&&(o=LF(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 ga(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 DF=t=>t.status==="succeeded",$F=t=>{var e;return((e=t.previewUnavailable)==null?void 0:e.reason)==="idle_timeout"},iue=t=>t.status==="succeeded"&&!Gp(t)&&(!t.previewUnavailable||$F(t)),ab=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"},V3=(t,e,n)=>{const r=new URL(t,window.location.origin);return r.searchParams.set(e,n),`${r.pathname}${r.search}${r.hash}`},oue=t=>{var e;return DF(t)&&((e=t.preview)==null?void 0:e.kind)==="static_artifact"},H3=(t,e)=>t.map(n=>`${n.workItemId}:${e[n.workItemId]??""}`).join("|"),aue=()=>{var Iu,Ou,pc;const t=Ak(),e=bt(km),n=bt(wF),r=v.useRef(!1),s=bt(bF),i=bt(Vy),o=bt(Hy),l=bt(Nx),u=((Iu=l.share)==null?void 0:Iu.isEnabled)??!1,d=((Ou=l.deployPrototype)==null?void 0:Ou.isEnabled)??!1,f=((pc=l.canvasShare)==null?void 0:pc.isEnabled)??!1,h=bt(xF),m=bt(SF),g=Mt(Ox),_=Mt(Bv),y=Mt(Mx),b=Mt(Lx),x=Mt(yF),S=Mt(_F),E=Mt(Sf),C=bt(Sf),R=Mt(cE),O=Mt(gF);v.useEffect(()=>(O("Directions"),()=>O(null)),[O]);const I=bt(nc),A=Mt(nc),L=v.useCallback((V=!1)=>{if(tue(I),A(null),V&&I){const oe=Wv("ended",I);Xe.capture(oe.event,oe.properties)}},[A,I]),N=bt(zg),H=Mt(zg),$=bt(Vg),W=Mt(Vg),X=$?`${$.sessionId}:${$.variantId}`:null,[z,K]=v.useState(""),[te,Z]=v.useReducer(V=>V+1,0),J=v.useMemo(()=>i!==null?lg(i):new Set,[i,te]),q=v.useCallback(V=>{if(i===null)return;const oe=new Set(lg(i));oe.delete(V)||oe.add(V),ob(i,oe),Z()},[i]),[j,Y]=v.useState(null),[ue,ie]=v.useState(null),[ce,he]=v.useState(!1),[ke,ve]=v.useState({}),[pe,Ne]=v.useState(null),[Ae,$e]=v.useState({}),[kt,fn]=v.useState(null),[on,Et]=v.useState(!1),[Gt]=v.useState(()=>Gie(window.location.search)),vn=v.useRef(!1),Qt=Gt!==null||$!==null||N!==null||on,Me=v.useMemo(()=>e.active?e.variants:[],[e]),Qe=v.useMemo(()=>Me.filter(oue),[Me]),Te=v.useMemo(()=>H3(Qe,ke),[Qe,ke]),St=(pe==null?void 0:pe.key)===Te?pe.shareUrl:null,be=e.active?e.sessionId:null,Nt=v.useMemo(()=>{const V=new Set;for(const oe of Me)oe.adoptedSource&&V.add(`${oe.adoptedSource.sessionId}:${oe.adoptedSource.variantId}`);return V},[Me]),ft=e.active?e.projectContext:null,pt=(ft==null?void 0:ft.kind)==="fresh"?ft.workspacePath:i,qn=v.useMemo(()=>pt?`?projectPath=${encodeURIComponent(pt)}`:"",[pt]),Ei=e.active?`${e.sessionId}:${e.stage}`:"inactive",xn=v.useMemo(()=>{var oe;if(on||X)return null;const V=N?Me.find(Ie=>Ie.workItemId===N):null;return N&&!V?null:V?Gp(V)?V.workItemId:null:e.active?((oe=Me.find($3))==null?void 0:oe.workItemId)??null:null},[N,X,on,e,Me]),nr=v.useCallback(V=>{const oe=Jce({entry:V,projectPath:pt});W(oe.selectedPastVariant),Et(!1),_(oe.previewUrl)},[pt,_,W]),Gi=v.useRef(!1),ps=V=>{if(!Gi.current&&!Qt&&xn===null&&V.length>0&&V.every(oe=>oe.projectKind==="fresh")){const oe=Qce(V);oe&&(Gi.current=!0,nr(oe))}W(oe=>{if(!oe)return oe;const Ie=V.find(Ee=>Ee.sessionId===oe.sessionId&&Ee.variantId===oe.variantId);return!Ie||JSON.stringify(oe.references)===JSON.stringify(Ie.references)?oe:{...oe,references:Ie.references}})},{pastVariants:Xr,setPastVariants:Yn}=Ece({historyQuery:qn,snapshotKey:Ei,isEnabled:!o,isListed:Xce,onLoaded:ps}),hn=v.useMemo(()=>[...Xr.filter(oe=>oe.sessionId!==be&&!Nt.has(`${oe.sessionId}:${oe.variantId}`))].sort((oe,Ie)=>{const Ee=new Date(oe.createdAt).getTime(),Re=new Date(Ie.createdAt).getTime();return(Number.isNaN(Re)?0:Re)-(Number.isNaN(Ee)?0:Ee)}),[Nt,Xr,be]),Qr=v.useMemo(()=>$?Me.find(V=>{var oe,Ie;return((oe=V.adoptedSource)==null?void 0:oe.sessionId)===$.sessionId&&((Ie=V.adoptedSource)==null?void 0:Ie.variantId)===$.variantId})??null:null,[$,Me]),ar=v.useMemo(()=>$?hn.find(V=>V.sessionId===$.sessionId&&V.variantId===$.variantId)??null:null,[$,hn]),vo=!e.active&&hn.length>0&&hn.every(V=>V.projectKind==="fresh"),zr=e.active?nue(ft):!!i&&!vo,{pinnedKeys:Xn,pinnedKeySet:Pr,listOrder:ni,togglePin:rr,pinItem:ms,reorder:st}=Mce(pt),sn=v.useRef(null),Jt=v.useRef(null),pn=typeof window>"u"?"/":RF(window.location.pathname)??"/",Sn=v.useRef(null),Bt=v.useRef(!1),In=v.useCallback((V,oe)=>{oe.button!==0&&oe.pointerType==="mouse"||(oe.preventDefault(),sb(),Sn.current={kind:"live",variantId:V,startX:oe.clientX,startY:oe.clientY,committed:!1})},[]),Jr=v.useCallback((V,oe)=>{oe.button!==0&&oe.pointerType==="mouse"||(oe.preventDefault(),sb(),Sn.current={kind:"past",entry:V,startX:oe.clientX,startY:oe.clientY,committed:!1})},[]);v.useEffect(()=>{const V=Ee=>{var ut;const Re=Sn.current;if(!Re)return;const Le=Ee.clientX-Re.startX,Ct=Ee.clientY-Re.startY;if(!Re.committed){if(Le*Le+Ct*Ct<F3*F3)return;if(sb(),Re.kind==="live"){const gt=Me.find(ts=>ts.workItemId===Re.variantId);if(!gt||gt.status!=="succeeded"){Sn.current=null;return}const _r=uu({sessionId:be,variant:gt,projectContext:ft,routePath:pn});E({sessionId:be??"",variantId:gt.workItemId,label:gt.label||"Direction",url:_r,source:"live",runLabel:gt.runLabel,description:gt.description})}else{const{entry:gt}=Re,_r=jd(gt),ts=_r?L3({sessionId:gt.sessionId,variantId:gt.variantId,routePath:((ut=gt.previewRoutes)==null?void 0:ut[0])??pn}):AF({entry:gt,projectPath:pt});if(E({sessionId:gt.sessionId,variantId:gt.variantId,label:gt.label||"Direction",url:ts,source:_r?"history-dev-server":"history-static",runLabel:gt.runLabel,description:gt.brief}),_r){const vs=M3(gt,qn);(async()=>{try{if(!(await Dt(vs,{method:"POST"})).ok)return;const en=V3(ts,"replay",String(Date.now()));E(Pt=>!Pt||Pt.sessionId!==gt.sessionId||Pt.variantId!==gt.variantId||Pt.source!=="history-dev-server"?Pt:{...Pt,url:en}),A(Pt=>{if(!Pt)return Pt;const ko=Ti=>!Ti||Ti.sessionId!==gt.sessionId||Ti.variantId!==gt.variantId?Ti:{...Ti,url:en};return{...Pt,left:ko(Pt.left),right:ko(Pt.right)}})}catch(Is){Zr.warn("history replay drag boot failed",Is)}})()}}Re.committed=!0}R({x:Ee.clientX,y:Ee.clientY})},oe=()=>{const Ee=Sn.current;Ee!=null&&Ee.committed&&(Bt.current=!0,window.setTimeout(()=>{Bt.current=!1},0)),Sn.current=null,R(null)},Ie=Ee=>{if(Ee.key!=="Escape")return;const Re=Sn.current;Re!=null&&Re.committed&&(Re.kind==="past"&&jd(Re.entry)&&Ef({sessionId:Re.entry.sessionId,variantId:Re.entry.variantId,source:"history-dev-server"}),Sn.current=null,E(null),R(null))};return window.addEventListener("pointermove",V),window.addEventListener("pointerup",oe),window.addEventListener("pointercancel",oe),window.addEventListener("keydown",Ie),()=>{window.removeEventListener("pointermove",V),window.removeEventListener("pointerup",oe),window.removeEventListener("pointercancel",oe),window.removeEventListener("keydown",Ie)}},[Me,be,ft,pn,qn,pt,E,R,A]);const Qn=v.useCallback(()=>{var V;(V=Sn.current)!=null&&V.committed&&(Bt.current=!0,window.setTimeout(()=>{Bt.current=!1},0)),Sn.current=null,R(null),C&&(C.source==="history-dev-server"&&Ef({sessionId:C.sessionId,variantId:C.variantId,source:"history-dev-server"}),E(null))},[C,E,R]),vr=v.useCallback((V,oe)=>{const Ie=!Pr.has(V);Xe.capture(Ie?"variants_panel.direction_pinned":"variants_panel.direction_unpinned",{method:oe}),rr(V)},[Pr,rr]),Vt=v.useCallback(()=>{C&&(Xe.capture("variants_panel.direction_pinned",{method:"drag"}),ms(`row:past:${C.sessionId}:${C.variantId}`),Qn())},[C,Qn,ms]),Ci=v.useCallback(V=>{Xe.capture("variants_panel.direction_unpinned",{method:"drag"}),rr(V),Qn()},[rr,Qn]),Uf=v.useCallback((V,oe)=>{st(V,oe),Qn()},[st,Qn]),Ka=on||zr&&N===null&&X===null&&xn===null,yo=v.useCallback(async V=>{var Ie,Ee,Re,Le,Ct;if(!be)return;const oe=(V==null?void 0:V.workItemId)??null;Y({kind:"switch",variantId:oe??void 0});try{if(((Ie=V==null?void 0:V.preview)==null?void 0:Ie.kind)==="static_artifact"){const gt=uu({sessionId:be,variant:V,projectContext:e.active?e.projectContext:null})??V.preview.url;y(!1),b(null),((Ee=V.refinement)==null?void 0:Ee.status)==="succeeded"&&!((Re=V.previewRoutes)!=null&&Re.length)?_(V3(gt,"refinement",V.refinement.workItemId)):_(gt);return}if(oe&&be&&e.active&&e.projectContext.kind==="fresh"&&((Le=e.projectContext.executionPlan)==null?void 0:Le.mode)!=="vite_app"&&((Ct=V==null?void 0:V.preview)==null?void 0:Ct.kind)!=="dev_server"){y(!1),b(null),_(`/api/variants/${be}/static/${oe}`);return}const ut=V&&oe?uu({sessionId:be,variant:V,projectContext:e.active?e.projectContext:null,routePath:pn}):null;if(ut){y(!1),b(null),_(ut);return}Xe.capture("variants_panel.preview_display_failed",{sessionId:be,variantId:oe,previewKind:V?ab(V):"none",hasPreview:!!(V!=null&&V.preview),hasPort:typeof(V==null?void 0:V.port)=="number",errorMessage:"No addressable dev-server preview URL"}),y(!1),b(null)}catch(ut){Zr.warn("preview display failed",ut),Xe.capture("variants_panel.preview_display_failed",{sessionId:be,variantId:oe,previewKind:V?ab(V):"none",hasPreview:!!(V!=null&&V.preview),hasPort:typeof(V==null?void 0:V.port)=="number",errorMessage:ut instanceof Error?ut.message:String(ut)}),y(!1),b(null)}finally{Y(null)}},[be,e,pn,_,y,b]),Tr=v.useRef(0),Pi=v.useCallback(()=>{Tr.current++,Y(V=>(V==null?void 0:V.kind)==="switch"?null:V),x(!1),S(!1)},[x,S]),Rs=v.useCallback(async V=>{if(be){Y({kind:"switch",variantId:V.workItemId});try{const oe=await Dt(`/api/variants/${be}/preview-port`,{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({variantId:V.workItemId})});if(!oe.ok){const Ie=await ga(oe);throw new Error(Ie.message??`Preview restoration failed (${oe.status})`)}}catch(oe){Zr.warn("preview restoration failed",oe),Xe.capture("variants_panel.preview_display_failed",{sessionId:be,variantId:V.workItemId,previewKind:"dev_server",hasPreview:!1,hasPort:!1,errorMessage:oe instanceof Error?oe.message:String(oe)})}finally{Y(null)}}},[be]),qi=v.useCallback(V=>{var Le,Ct,ut,gt,_r;if(Bt.current){Bt.current=!1;return}const oe=Gp(V),Ie=V.status==="pending"||V.status==="running"||iue(V);Pi();const Ee=ab(V),Re=Me.find(ts=>ts.workItemId===N);Xe.capture("variants_panel.preview_requested",{sessionId:be,fromVariantId:Re==null?void 0:Re.workItemId,toVariantId:V.workItemId,variantStatus:V.status,isPreviewReady:oe,isArmed:Ie,previewKind:Ee,hasPreview:!!V.preview,hasPort:typeof V.port=="number",viewEnabled:((Ct=(Le=V.actions)==null?void 0:Le.view)==null?void 0:Ct.enabled)??null,previewUnavailableReason:((ut=V.previewUnavailable)==null?void 0:ut.reason)??null}),H(V.workItemId),W(null),oe?(Jt.current=V.workItemId,Et(!1),L(!0),yo(V)):(Jt.current=null,Et(!1),_(null),y(!1),Ie&&Xe.capture("variants_panel.preview_armed",{sessionId:be,fromVariantId:Re==null?void 0:Re.workItemId,toVariantId:V.workItemId,variantStatus:V.status,previewKind:Ee,hasPreview:!!V.preview,hasPort:typeof V.port=="number",viewEnabled:((_r=(gt=V.actions)==null?void 0:gt.view)==null?void 0:_r.enabled)??null}),$F(V)&&Rs(V)),Xe.capture("variants_panel.preview_switched",{sessionId:be,fromVariantId:Re==null?void 0:Re.workItemId,toVariantId:V.workItemId,armed:Ie})},[N,be,L,H,W,Pi,Rs,yo,Me,_,y]),As=v.useCallback(V=>{if(Bt.current){Bt.current=!1;return}if(L(!0),H(null),jd(V)){W({sessionId:V.sessionId,variantId:V.variantId,previewKind:"dev_server",references:V.references,projectPath:pt??void 0}),Et(!1);const oe=++Tr.current;x(!0),S(!0),(async()=>{var Ee;Y({kind:"switch"}),Xe.capture("variants_panel.history_replay_started",{sessionId:V.sessionId,variantId:V.variantId});const Ie=(Re,Le)=>{Xe.capture("variants_panel.history_replay_failed",{sessionId:V.sessionId,variantId:V.variantId,...Le}),x(!1),S(!1),W(Ct=>Ct?{...Ct,previewError:Re}:null),_(null)};try{const Re=await Dt(M3(V,qn),{method:"POST"});if(oe!==Tr.current)return;if(!Re.ok){const{message:Ct,errorCode:ut}=await ga(Re);if(oe!==Tr.current)return;Zr.warn(`history replay failed: HTTP ${Re.status} ${ut??""}`),Ie(Ct??`Preview startup failed (${Re.status})`,{httpStatus:Re.status,errorCode:ut});return}const Le=await Re.json();if(oe!==Tr.current)return;S(!1),y(!1),b(null),_(L3({sessionId:V.sessionId,variantId:V.variantId,routePath:((Ee=V.previewRoutes)==null?void 0:Ee[0])??pn})),Le.alreadyRunning||g(Ct=>Ct+1),Xe.capture("variants_panel.history_replay_ready",{sessionId:V.sessionId,variantId:V.variantId})}catch(Re){if(oe!==Tr.current)return;Zr.warn("history replay failed",Re);const Le=Us(Re,"Preview startup failed");Ie(Le,{errorMessage:Le})}finally{oe===Tr.current&&Y(null)}})();return}Pi(),y(!1),b(null),nr(V)},[pt,pn,nr,Y,x,S,g,W,H,_,b,L,y,Pi,qn]);v.useEffect(()=>{if(!Gt||vn.current)return;const V=Xr.find(oe=>oe.sessionId===Gt.sessionId&&oe.variantId===Gt.variantId);V&&(vn.current=!0,As(V))},[Gt,Xr,As]);const Ga=v.useCallback(async()=>{Pi();const V=()=>{L(!0),H(null),W(null),Et(!0),Jt.current=null,y(!1),b(null),_(null)};if(!be){V();return}Y({kind:"switch"});try{const oe=await Dt(`/api/variants/${be}/preview-port`,{method:"POST",headers:{"content-type":"application/json"},body:JSON.stringify({variantId:null})});if(!oe.ok){Zr.warn(`switch to original failed: HTTP ${oe.status}`);return}V(),y(!0),Xe.capture("variants_panel.preview_switched",{sessionId:be,fromVariantId:N,toVariantId:null,target:"original",armed:!1})}catch(oe){Zr.warn("preview-port original switch failed",oe)}finally{Y(null)}},[N,be,H,W,_,b,L,y,Pi]),ri=v.useCallback(async(V,oe,Ie)=>{Xe.capture("variants_panel.deploy_clicked",{sessionId:V,variantId:oe,variantLabel:Ie});try{const Ee=await Dt(`/api/variants/${V}/deploy`,{method:"POST",headers:{"content-type":"application/json"},body:JSON.stringify({variantId:oe,...i?{projectPath:i}:{}})});if(!Ee.ok){const{message:Ct,errorCode:ut}=await ga(Ee);return Zr.warn(`deploy failed: HTTP ${Ee.status} ${ut??""} ${Ct??""}`),Xe.capture("variants_panel.deploy_failed",{sessionId:V,variantId:oe,httpStatus:Ee.status,errorCode:ut??null,errorMessage:Ct??null}),tn.error("Couldn't deploy this direction",{description:Ct??`The server rejected the request (HTTP ${Ee.status}). Try again.`}),null}const Re=await Ee.json().catch(()=>null),Le=Re==null?void 0:Re.shareUrl;return Le?(await navigator.clipboard.writeText(Le).catch(()=>{}),Xe.capture("variants_panel.deploy_succeeded",{sessionId:V,variantId:oe}),tn.success(`"${Ie}" is live — link copied`,{action:{label:"Open",onClick:()=>window.open(Le,"_blank","noopener")}}),Le):(tn.error("Couldn't deploy this direction",{description:"The deploy host returned an unexpected response."}),null)}catch(Ee){return Zr.warn("deploy failed",Ee),Xe.capture("variants_panel.deploy_failed",{sessionId:V,variantId:oe,httpStatus:null,errorCode:"NETWORK_ERROR",errorMessage:Ee instanceof Error?Ee.message:String(Ee)}),tn.error("Couldn't deploy this direction",{description:"Network or server error. Check that the Rivet backend is reachable and try again."}),null}},[i]),dc=v.useCallback(async V=>{if(!be)return;const oe=ke[V.workItemId];if(oe){await navigator.clipboard.writeText(oe).catch(()=>{}),tn.success("Share link copied",{action:{label:"Open",onClick:()=>window.open(oe,"_blank","noopener")}});return}Y({kind:"deploy",variantId:V.workItemId});try{const Ie=await ri(be,V.workItemId,V.label);Ie&&ve(Ee=>({...Ee,[V.workItemId]:Ie}))}finally{Y(null)}},[be,ke,ri]),Tu=v.useCallback(async()=>{if(!(!be||Qe.length===0)){if(St){await navigator.clipboard.writeText(St).catch(()=>{}),tn.success("Canvas link copied",{action:{label:"Open",onClick:()=>window.open(St,"_blank","noopener")}});return}Xe.capture("variants_panel.deploy_clicked",{sessionId:be,variantId:"canvas",variantLabel:"Canvas",variantCount:Qe.length}),Y({kind:"deploy-canvas"});try{const V=await Dt(`/api/variants/${be}/canvas/deploy`,{method:"POST",headers:{"content-type":"application/json"},body:JSON.stringify({variantIds:Qe.map(Le=>Le.workItemId),...i?{projectPath:i}:{}})});if(!V.ok){const{message:Le,errorCode:Ct}=await ga(V);Zr.warn(`canvas deploy failed: HTTP ${V.status} ${Ct??""} ${Le??""}`),Xe.capture("variants_panel.deploy_failed",{sessionId:be,variantId:"canvas",httpStatus:V.status,errorCode:Ct??null,errorMessage:Le??null,variantCount:Qe.length}),tn.error("Couldn't share this canvas",{description:Le??`The server rejected the request (HTTP ${V.status}). Try again.`});return}const oe=await V.json().catch(()=>null),Ie=oe==null?void 0:oe.shareUrl;if(!Ie){tn.error("Couldn't share this canvas",{description:"The deploy host returned an unexpected response."});return}const Ee=Object.fromEntries(((oe==null?void 0:oe.variants)??[]).filter(Le=>typeof Le.variantId=="string"&&typeof Le.shareUrl=="string").map(Le=>[Le.variantId,Le.shareUrl])),Re=Object.keys(Ee).length>0?{...ke,...Ee}:ke;Re!==ke&&ve(Re),await navigator.clipboard.writeText(Ie).catch(()=>{}),Ne({key:H3(Qe,Re),shareUrl:Ie}),Xe.capture("variants_panel.deploy_succeeded",{sessionId:be,variantId:"canvas",variantCount:Qe.length}),tn.success("Canvas is live — link copied",{action:{label:"Open",onClick:()=>window.open(Ie,"_blank","noopener")}})}catch(V){Zr.warn("canvas deploy failed",V),Xe.capture("variants_panel.deploy_failed",{sessionId:be,variantId:"canvas",httpStatus:null,errorCode:"NETWORK_ERROR",errorMessage:V instanceof Error?V.message:String(V),variantCount:Qe.length}),tn.error("Couldn't share this canvas",{description:"Network or server error. Check that the Rivet backend is reachable and try again."})}finally{Y(null)}}},[St,Qe,ke,i,be]),qa=v.useCallback(async V=>{const oe=`${V.sessionId}:${V.variantId}`,Ie=Ae[oe];if(Ie){await navigator.clipboard.writeText(Ie).catch(()=>{}),tn.success("Share link copied",{action:{label:"Open",onClick:()=>window.open(Ie,"_blank","noopener")}});return}fn(oe);try{const Ee=await ri(V.sessionId,V.variantId,V.label);Ee&&$e(Re=>({...Re,[oe]:Ee}))}finally{fn(null)}},[Ae,ri]),an=v.useCallback(async V=>{if(be){Xe.capture("variants_panel.remove_clicked",{sessionId:be,variantId:V.workItemId,variantLabelLength:V.label.length}),Y({kind:"remove",variantId:V.workItemId});try{const oe=await Dt(`/api/variants/${be}/${V.workItemId}/remove`,{method:"POST",headers:{"content-type":"application/json"},body:"{}"});if(!oe.ok){const{message:Ie}=await ga(oe);Zr.warn(`remove failed: HTTP ${oe.status} ${Ie??""}`),tn.error("Couldn't remove direction",{description:Ie??`The server rejected the request (HTTP ${oe.status}). Try again.`});return}(V.workItemId===xn||V.workItemId===N)&&(H(null),_(null),y(!1),g(Ie=>Ie+1))}catch(oe){Zr.warn("remove failed",oe),tn.error("Couldn't remove direction",{description:"Network or server error. Try again."})}finally{Y(null)}}},[be,N,xn,H,_,y,g]),_o=v.useCallback(async V=>{if(!pt){tn.error("Couldn't remove direction",{description:"No project path available."});return}Xe.capture("variants_panel.remove_past_clicked",{sessionId:V.sessionId,variantId:V.variantId});const oe=`${V.sessionId}:${V.variantId}`,Ie=Ee=>Ee.sessionId===V.sessionId&&Ee.variantId===V.variantId;Y({kind:"remove",variantId:oe}),Yn(Ee=>Ee.filter(Re=>!Ie(Re))),X===oe&&(W(null),_(null),y(!1),g(Ee=>Ee+1));try{const Ee=await Dt(`/api/variants/history/${encodeURIComponent(V.sessionId)}/${encodeURIComponent(V.variantId)}/remove`,{method:"POST",headers:{"content-type":"application/json"},body:JSON.stringify({projectPath:pt})});if(!Ee.ok){const{message:Re}=await ga(Ee);Yn(Le=>Le.some(Ie)?Le:[...Le,V]),tn.error("Couldn't remove direction",{description:Re??`The server rejected the request (HTTP ${Ee.status}). Try again.`})}}catch(Ee){Zr.warn("remove past failed",Ee),Yn(Re=>Re.some(Ie)?Re:[...Re,V]),tn.error("Couldn't remove direction",{description:"Network or server error. Try again."})}finally{Y(null)}},[pt,X,W,_,y,g,Yn]),si=v.useCallback(V=>{ie(V)},[]),wo=v.useCallback(V=>{if(!V.label||!V.run)return;const oe=V.rows.flatMap(Ee=>Ee.kind==="active"?[Ee.variant]:[]),Ie=V.rows.flatMap(Ee=>Ee.kind==="past"?[Ee.entry]:[]);oe.length===0&&Ie.length===0||ie({kind:"run",label:V.label,variants:oe,entries:Ie})},[]),Vr=v.useCallback(async()=>{if(!(!ue||ce)){he(!0);try{if(ue.kind==="active")await an(ue.variant);else if(ue.kind==="past")await _o(ue.entry);else{for(const V of ue.variants)await an(V);for(const V of ue.entries)await _o(V)}}finally{he(!1),ie(null)}}},[ue,ce,an,_o]),[fc,hc]=v.useState(null),[ra,es]=v.useState(null),Ru=v.useCallback(V=>{es(V)},[]),gs=v.useCallback(()=>{es(null)},[]),Zf=v.useCallback(async(V,oe)=>{es(null);const Ie=oe.trim();if(!Ie||V.kind==="original")return;if(V.kind==="active"){if(!be||Ie===V.variant.label)return;Xe.capture("variants_panel.rename",{sessionId:be,variantId:V.variant.workItemId,labelLength:Ie.length,past:!1});try{const Le=await Dt(`/api/variants/${be}/${V.variant.workItemId}/rename`,{method:"POST",headers:{"content-type":"application/json"},body:JSON.stringify({label:Ie})});if(!Le.ok){const{message:Ct}=await ga(Le);tn.error("Couldn't rename direction",{description:Ct??`The server rejected the request (HTTP ${Le.status}). Try again.`})}}catch(Le){Zr.warn("rename failed",Le),tn.error("Couldn't rename direction",{description:"Network or server error. Try again."})}return}const{entry:Ee}=V;if(Ie===Ee.label.trim())return;if(!pt){tn.error("Couldn't rename direction",{description:"No project path available."});return}Xe.capture("variants_panel.rename",{sessionId:Ee.sessionId,variantId:Ee.variantId,labelLength:Ie.length,past:!0});const Re=Le=>Le.sessionId===Ee.sessionId&&Le.variantId===Ee.variantId;Yn(Le=>Le.map(Ct=>Re(Ct)?{...Ct,label:Ie}:Ct));try{const Le=await Dt(`/api/variants/history/${encodeURIComponent(Ee.sessionId)}/${encodeURIComponent(Ee.variantId)}/rename`,{method:"POST",headers:{"content-type":"application/json"},body:JSON.stringify({label:Ie,projectPath:pt})});if(!Le.ok){const{message:Ct}=await ga(Le);Yn(ut=>ut.map(gt=>Re(gt)?{...gt,label:Ee.label}:gt)),tn.error("Couldn't rename direction",{description:Ct??`The server rejected the request (HTTP ${Le.status}). Try again.`})}}catch(Le){Zr.warn("rename failed",Le),Yn(Ct=>Ct.map(ut=>Re(ut)?{...ut,label:Ee.label}:ut)),tn.error("Couldn't rename direction",{description:"Network or server error. Try again."})}},[be,pt,Yn]),[Au,bo]=v.useState(null),xo=v.useCallback(V=>{bo(V)},[]),D=v.useCallback(()=>{bo(null)},[]),de=v.useCallback(async(V,oe)=>{if(bo(null),!V.label||!V.run)return;const Ie=V.label,Ee=oe.trim();if(!Ee||Ee===Ie)return;Xe.capture("variants_panel.rename_run",{runLabelLength:Ee.length});const Re="requestId"in V.run?V.run.requestId:void 0,Le=Re?V.key:LF({sessionId:V.run.sessionId,runLabel:Ee}),Ct=Le!==V.key;let ut=!1,gt=!1;if(i!==null&&Ct){const en=lg(i);ut=en.has(V.key),gt=en.has(Le),ut&&(en.add(Le),ob(i,en),Z())}const _r=en=>{if(i===null||!Ct)return;const Pt=lg(i);en?Pt.delete(V.key):(ut?Pt.add(V.key):Pt.delete(V.key),gt?Pt.add(Le):Pt.delete(Le)),ob(i,Pt),Z()},ts=new Set(V.rows.flatMap(en=>en.kind==="past"?[`${en.entry.sessionId}:${en.entry.variantId}`]:[])),vs=en=>ts.has(`${en.sessionId}:${en.variantId}`);Yn(en=>en.map(Pt=>vs(Pt)?{...Pt,runLabel:Ee}:Pt));const Is=()=>Yn(en=>en.map(Pt=>vs(Pt)?{...Pt,runLabel:Ie}:Pt));try{const en=await Dt("/api/variants/runs/rename",{method:"POST",headers:{"content-type":"application/json"},body:JSON.stringify({sessionId:V.run.sessionId,...Re?{requestId:Re}:{},runLabel:Ie,label:Ee,...pt?{projectPath:pt}:{}})});if(en.ok)_r(!0);else{const{message:Pt}=await ga(en);Is(),_r(!1),tn.error("Couldn't rename run",{description:Pt??`The server rejected the request (HTTP ${en.status}). Try again.`})}}catch(en){Zr.warn("run rename failed",en),Is(),_r(!1),tn.error("Couldn't rename run",{description:"Network or server error. Try again."})}},[pt,i,Yn]);v.useEffect(()=>{const V=n&&!r.current;if(r.current=n,sn.current!==be){const Ie=sn.current===null,Ee=sn.current;sn.current=be;const Re=t.get(Vg);if(V&&Gt&&(Re==null?void 0:Re.sessionId)===Gt.sessionId&&(Re==null?void 0:Re.variantId)===Gt.variantId)return;const Le=eue({incomingSessionId:be,previousSessionId:Ee,isIncomingSessionPreviewable:e.active&&Me.some($3),selectedPastVariant:Re,displayedLiveVariantId:t.get(zg)??Jt.current,pastVariants:Xr});switch(Jt.current=null,Ne(null),y(!1),b(null),L(),H(null),Et(!1),Gi.current=!1,Le.kind){case"keep_selected":break;case"show_saved":nr(Le.entry);break;case"clear":_(null),W(null);break;default:{const Ct=Le;throw new Error(`Unhandled session preview: ${String(Ct)}`)}}if(!Ie)return}if(X||on||!xn||e.active!==!0||Jt.current===xn)return;const oe=Me.find(Ie=>Ie.workItemId===xn);oe&&(Jt.current=xn,L(),yo(oe))},[be,n,Gt,t,X,on,xn,e,Me,yo,L,Xr,H,W,_,nr,b,y]),v.useEffect(()=>{!$||!Qr||(Jt.current=null,W(null),H(Qr.workItemId))},[Qr,$,be,H,W]),v.useEffect(()=>{!$||Qr||ar||W(null)},[Qr,$,ar,be,W,hn]),v.useEffect(()=>{const V=z.trim().toLowerCase(),oe=[...Me.map(ut=>({kind:"active",variant:ut})),...hn.map(ut=>({kind:"past",entry:ut})),...zr?[{kind:"original"}]:[]],Ie=V?oe.filter(ut=>U3(ut,V)):oe,{pinned:Ee,unpinned:Re}=Z3(W3(z3(Ie,be),ni),Xn,be),Le=[...J.has(Fx)?[]:Ee,...Re.flatMap(ut=>ut.key!==""&&J.has(ut.key)?[]:ut.rows)];return Le.length===0?void 0:Gne(ut=>{if(gce())return;if(ut.key==="Enter"){const Pt=Me.find(ko=>ko.workItemId===fc);Pt&&(ut.preventDefault(),qi(Pt));return}if(ut.key!=="ArrowUp"&&ut.key!=="ArrowDown")return;ut.preventDefault();const gt=N??xn;let _r=gt?`live:${gt}`:null;X?_r=`past:${X}`:Ka&&(_r=IF);const ts=_r?Le.findIndex(Pt=>Cf(Pt)===_r):-1;let vs;if(ts===-1?vs=ut.key==="ArrowDown"?0:Le.length-1:ut.key==="ArrowDown"?vs=Math.min(ts+1,Le.length-1):vs=Math.max(ts-1,0),vs===ts)return;const Is=Le[vs];Is.kind==="active"?qi(Is.variant):Is.kind==="past"?As(Is.entry):Ga();const en=document.querySelector(`[data-variant-key="${Cf(Is)}"]`);en instanceof HTMLElement&&en.focus({preventScroll:!0})})},[Me,hn,z,zr,J,Xn,ni,be,N,X,Ka,xn,fc,qi,As,Ga]);const me=Me.find(V=>V.workItemId===xn)??null,xe=X?hn.find(V=>`${V.sessionId}:${V.variantId}`===X)??null:null,Be=!!xe,mt=[...(e.active?Me:[]).map(V=>({kind:"active",variant:V})),...hn.map(V=>({kind:"past",entry:V})),...zr?[{kind:"original"}]:[]],$t=z.trim().toLowerCase(),qt=$t?mt.filter(V=>U3(V,$t)):mt,yt=W3(z3(qt,be),ni),{pinned:On,unpinned:it}=Z3(yt,Xn,be);let Rr=null;C&&(Rr=C.source==="live"?`live:${C.variantId}`:`past:${C.sessionId}:${C.variantId}`);const Ya=new Set(Me.map(V=>V.requestId).filter(Boolean)),So=s.filter(V=>!Ya.has(V.requestId)),yr=So.length>0,sa=o&&!yr&&mt.length===0;return T.jsxs("div",{className:"flex h-full min-h-0 flex-col",children:[mt.length>0?T.jsx("div",{className:"pt-2 pr-5 pb-1 pl-3",children:T.jsxs("div",{className:"relative",children:[T.jsx(Zse,{size:13,className:"text-content-muted pointer-events-none absolute top-1/2 left-2 -translate-y-1/2"}),T.jsx("input",{type:"text",value:z,onChange:V=>K(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,T.jsxs("div",{className:"flex-1 [scrollbar-gutter:stable] overflow-y-auto px-3 py-2",children:[yr?T.jsx(vue,{groups:So}):null,sa?T.jsx(yue,{}):null,e.active&&mt.length===0&&!yr&&!sa?T.jsx(_ue,{}):null,!e.active&&!yr&&!sa&&hn.length===0&&!zr?T.jsx(wue,{isMCPSession:h,mcpEditor:m}):null,mt.length>0&&qt.length===0?T.jsxs("p",{className:"text-content-muted px-1 py-6 text-center text-xs",children:["No directions match “",z.trim(),"”."]}):null,qt.length>0?T.jsx(hue,{groups:it,pinned:On,pinnedKeys:Pr,draggedRowKey:Rr,onDropPin:Vt,onDropUnpin:Ci,onTogglePin:vr,onReorder:Uf,collapsedRuns:J,onToggleRun:q,activeVariantId:N??xn,activePastKey:X,isOriginalSelected:Ka,busy:j,editingKey:ra,onSelectActive:qi,onSelectPast:As,onSelectOriginal:Ga,onActivePointerDown:In,onPastPointerDown:Jr,onHover:hc,onRemove:V=>si({kind:"active",variant:V}),onRemovePast:V=>si({kind:"past",entry:V}),onStartRename:Ru,onCommitRename:Zf,onCancelRename:gs,editingRunKey:Au,onStartRunRename:xo,onCommitRunRename:de,onCancelRunRename:D,onRemoveRun:wo,onCopyVariantContext:kF,activeSessionId:e.active?e.sessionId:null,projectPath:pt}):null]}),u&&Be&&xe?T.jsx(Bce,{entry:xe,deploying:kt===X,deployedUrl:X?Ae[X]??null:null,onDeploy:qa,isDeployDisabled:!d}):null,!Be&&e.active?T.jsx(gue,{selectedVariant:me,busy:j,onDeploy:dc,onDeployCanvas:Tu,canShare:u,canDeploy:d&&(ft==null?void 0:ft.kind)==="fresh",canDeployCanvas:d&&f&&(ft==null?void 0:ft.kind)==="fresh",canvasVariantCount:Qe.length,canvasDeployedUrl:St,deployedUrl:me?ke[me.workItemId]??null:null}):null,T.jsx(cue,{target:ue,isConfirming:ce,onCancel:()=>ie(null),onConfirm:Vr})]})},lue=t=>t.kind==="active"?t.variant.label.trim()||"this direction":t.kind==="run"?t.label.trim()||"this run":t.entry.label.trim()||"this direction",cue=({target:t,isConfirming:e,onCancel:n,onConfirm:r})=>{if(!t)return null;const s=lue(t),i=t.kind==="run",o=i?t.variants.length+t.entries.length:0,l=i?"Remove run":"Remove direction";return T.jsx(Ly,{open:!0,onOpenChange:u=>{!u&&!e&&n()},children:T.jsxs(Ny,{children:[T.jsx(Dy,{className:"z-max fixed inset-0 bg-black/40"}),T.jsx($y,{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:T.jsxs("div",{className:"flex flex-col gap-3 p-4",children:[T.jsx(Fy,{className:"text-content text-base font-medium",children:i?"Remove run?":"Remove direction?"}),T.jsx(jy,{className:"text-content-subtle text-sm leading-5",children:i?`This removes all ${o} directions in “${s}”.`:`This removes “${s}” from the directions list.`}),T.jsxs("div",{className:"flex justify-end gap-2 pt-1",children:[T.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"}),T.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})]})]})})]})})},Cf=t=>t.kind==="active"?`live:${t.variant.workItemId}`:t.kind==="past"?`past:${t.entry.sessionId}:${t.entry.variantId}`:IF,U3=(t,e)=>t.kind==="active"?ib(e,t.variant.label,t.variant.runLabel):t.kind==="past"?ib(e,t.entry.label,t.entry.runLabel,t.entry.brief):ib(e,uE,OF),FF=(t,e)=>t.startsWith("live:")?`row:past:${e??""}:${t.slice(5)}`:`row:${t}`,jF=(t,e)=>FF(Cf(t),e),Z3=(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=jF(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}},B3=(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]},W3=(t,e)=>{const n=t.map(r=>{const s=e.rows[r.key];return!s||s.length===0?r:{...r,rows:B3(r.rows,s,Cf)}});return B3(n,e.groups,r=>r.key)},uue=t=>t.length<=j3?t:`${t.slice(0,j3-1)}…`,due=(t,e)=>t.kind==="active"?e?`${e}:${t.variant.workItemId}`:null:t.kind==="past"?`${t.entry.sessionId}:${t.entry.variantId}`:null,fue=t=>t.kind==="active"?t.variant.directionRef??null:t.kind==="past"?t.entry.directionRef??null:null,hue=({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:m,busy:g,editingKey:_,onSelectActive:y,onSelectPast:b,onSelectOriginal:x,onActivePointerDown:S,onPastPointerDown:E,onHover:C,onRemove:R,onRemovePast:O,onStartRename:I,onCommitRename:A,onCancelRename:L,editingRunKey:N,onStartRunRename:H,onCommitRunRename:$,onCancelRunRename:W,onRemoveRun:X,onCopyVariantContext:z,activeSessionId:K,projectPath:te})=>{const Z=v.useRef(null),{activeIndex:J,itemRects:q,handlers:j,registerItem:Y}=hce(Z,{snapTolerancePx:5}),[ue,ie]=v.useState(0),[ce,he]=v.useState(!1),[ke,ve]=v.useState(!1),pe=u.has(Fx),Ne=r!==null,Ae=v.useMemo(()=>{if(!r)return null;const Te=FF(r,K);if(n.has(Te))return{container:Gh,key:Te};const St=t.find(be=>be.rows.some(Nt=>Cf(Nt)===r));return St?{container:nb(St.key),key:r}:null},[r,n,t,K]),$e=(Ae==null?void 0:Ae.container)===Gh,{dropTarget:kt,onPointerMove:fn,onPointerUp:on}=Lce({containerRef:Z,dragged:Ae,yieldToSelector:$e?void 0:"[data-pinned-drop-zone]",restrictToSelector:$e?"[data-pinned-drop-zone]":void 0,onReorder:l}),Et=J!==null?q[J]:null,Gt=Te=>Te.kind==="active"?Te.variant.workItemId===f:Te.kind==="past"?`${Te.entry.sessionId}:${Te.entry.variantId}`===h:m,vn=(Te,St,be,Nt)=>{const ft=Cf(Te),pt=jF(Te,K);return T.jsx(mue,{rowKey:ft,row:Te,index:St,isSelected:Gt(Te),isEditing:_===ft,isPinned:n.has(pt),onTogglePin:qn=>o(pt,qn),reorderContainer:be,reorderKey:be===Gh?pt:ft,isNested:Nt,busy:g,registerItem:Y,onSelectActive:y,onSelectPast:b,onSelectOriginal:x,onActivePointerDown:S,onPastPointerDown:E,onHover:C,onRemove:R,onRemovePast:O,onStartRename:I,onCommitRename:A,onCancelRename:L,onCopyVariantContext:z,activeSessionId:K,projectPath:te},ft)};let Qt=0;const Me=Te=>{if(Te.key==="")return Te.rows.map(ft=>vn(ft,Qt++,nb(Te.key),!1));const St=u.has(Te.key),be=St?null:Te.rows.map(ft=>vn(ft,Qt++,nb(Te.key),!0)),Nt=Te.label;return T.jsx(pue,{label:Nt??uE,collapsed:St,onToggle:()=>d(Te.key),directionCount:Te.rows.length,isEditing:Nt!==null&&N===Te.key,onStartRename:Nt!==null?()=>H(Te.key):void 0,onCommitRename:Nt!==null?ft=>$(Te,ft):void 0,onCancelRename:W,onRemove:Nt!==null?()=>X(Te):void 0,children:be},Te.key)},Qe=e.length>0||Ne;return T.jsxs("div",{ref:Z,className:"relative",onMouseEnter:()=>{ie(Te=>Te+1),j.onMouseEnter()},onMouseMove:j.onMouseMove,onMouseLeave:j.onMouseLeave,onPointerMove:fn,onPointerUp:Te=>{var St;if($e&&Ae){const be=(St=Z.current)==null?void 0:St.querySelector("[data-pinned-drop-zone]"),Nt=be==null?void 0:be.getBoundingClientRect();if(!(Nt!==void 0&&Te.clientY>=Nt.top&&Te.clientY<=Nt.bottom)){i(Ae.key);return}}on()},children:[Ae&&kt?T.jsx("div",{className:"bg-content-muted pointer-events-none absolute right-1 left-1 z-20 h-0.5 rounded-full",style:{top:kt.top}}):null,T.jsx(Dd,{children:Et&&T.jsx(La.div,{className:"bg-hover pointer-events-none absolute z-0 rounded-md",initial:{opacity:0,top:Et.top,left:Et.left,width:Et.width,height:Et.height},animate:{opacity:1,top:Et.top,left:Et.left,width:Et.width,height:Et.height},exit:{opacity:0,transition:{duration:.06}},transition:{...Zv.fast,opacity:{duration:.08}}},ue)}),T.jsxs("ul",{className:"relative flex flex-col gap-2",children:[T.jsx(Dd,{initial:!1,children:Qe?T.jsxs(La.li,{initial:{height:0,opacity:0},animate:{height:"auto",opacity:1},exit:{height:0,opacity:0},transition:{duration:$x,ease:Dx},"data-pinned-drop-zone":"",className:Fr("overflow-hidden rounded-lg bg-white/[0.012] transition-shadow",Ne&&"ring-content-muted/30 ring-1",Ne&&ce&&"ring-content-muted/70 bg-white/[0.03]"),onPointerEnter:Ne?()=>he(!0):void 0,onPointerLeave:Ne?()=>he(!1):void 0,onPointerUp:Ne?()=>{he(!1),s()}:void 0,children:[T.jsx("div",{"data-hover-dead-zone":"",children:T.jsxs("button",{type:"button",onClick:()=>d(Fx),"aria-expanded":!pe,"aria-label":`${pe?"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 duration-80 hover:bg-white/[0.03] focus:outline-none focus-visible:ring-1 focus-visible:ring-inset",children:[T.jsx(mx,{size:13,weight:"fill",className:"text-content-muted shrink-0"}),T.jsx("span",{className:"text-content min-w-0 flex-1 truncate text-sm font-medium",children:"Pinned"})]})}),T.jsx(Dd,{initial:!1,children:!pe&&T.jsx(La.div,{initial:{height:0,opacity:0},animate:{height:"auto",opacity:1},exit:{height:0,opacity:0},transition:{duration:$x,ease:Dx},className:"overflow-hidden",children:e.length>0?T.jsx("ul",{className:"flex flex-col gap-2",children:e.map(Te=>vn(Te,Qt++,Gh,!1))}):null},"body")})]},"pinned-section"):null}),Qe&&t.length>0?T.jsxs("li",{className:Fr("mt-2 overflow-hidden rounded-lg bg-white/[0.012] transition-shadow",$e&&"ring-content-muted/30 ring-1",$e&&ke&&"ring-content-muted/70 bg-white/[0.03]"),onPointerEnter:$e?()=>ve(!0):void 0,onPointerLeave:$e?()=>ve(!1):void 0,onPointerUp:$e?()=>ve(!1):void 0,children:[T.jsxs("div",{"data-hover-dead-zone":"",className:"flex w-full items-center gap-2 px-3 py-2",children:[T.jsx(Gse,{size:13,weight:"fill",className:"text-content-muted shrink-0"}),T.jsx("span",{className:"text-content min-w-0 flex-1 truncate text-sm font-medium",children:"Directions"})]}),T.jsx("ul",{className:"flex flex-col gap-2",children:t.map(Te=>Me(Te))})]}):t.map(Te=>Me(Te))]})]})},zF=({open:t,onOpenChange:e,triggerLabel:n,actions:r})=>{const{containerRef:s,onKeyDown:i}=dF({onDismiss:()=>e(!1)});return T.jsxs(sE,{open:t,onOpenChange:e,children:[T.jsx(kf,{label:n,children:T.jsx(iE,{asChild:!0,children:T.jsx(ku,{type:"button",variant:"ghost",size:"icon-compact","aria-label":n,onClick:o=>o.stopPropagation(),onPointerDown:o=>o.stopPropagation(),className:MF,children:T.jsx(zse,{size:15,weight:"bold"})})})}),T.jsx(oE,{children:T.jsx(aE,{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=>T.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.detail?T.jsx("span",{className:"text-content-muted ml-auto pl-3 font-mono",children:o.detail}):null]},o.key))})})]})},pue=({label:t,collapsed:e,directionCount:n,onToggle:r,isEditing:s=!1,onStartRename:i,onCommitRename:o,onCancelRename:l,onRemove:u,children:d})=>{const f=xi(),[h,m]=v.useState(!1),g=[...i?[{key:"rename",label:"Rename",icon:T.jsx(a$,{size:13,weight:"bold"}),onSelect:i}]:[],...u?[{key:"remove",label:"Remove",icon:T.jsx(m$,{size:13,weight:"bold"}),onSelect:u}]:[]],_=e?T.jsx(Hse,{size:13,weight:"fill",className:"shrink-0 text-sky-400"}):T.jsx(Vse,{size:13,weight:"fill",className:"shrink-0 text-sky-400"});return s&&o&&l?T.jsxs("li",{className:"overflow-hidden rounded-lg bg-white/[0.012]",children:[T.jsxs("div",{"data-hover-dead-zone":"",className:"bg-main-input flex w-full items-center gap-2 px-3 py-2",children:[_,T.jsx("span",{className:"min-w-0 flex-1",children:T.jsx(VF,{initial:t,onCommit:o,onCancel:l})})]}),T.jsx(Dd,{initial:!1,children:!e&&T.jsx(La.ul,{className:"overflow-hidden",children:d},"body")})]}):T.jsxs("li",{className:"overflow-hidden rounded-lg bg-white/[0.012]",children:[T.jsxs("div",{"data-hover-dead-zone":"",className:"group relative",children:[T.jsxs("button",{type:"button",onClick:y=>{if((y.metaKey||y.ctrlKey)&&g.length>0){m(!0);return}f==null||f.capture("variants_panel.folder_toggled",{isCollapsed:!e,directionCount:n}),r()},"aria-expanded":!e,"aria-label":`${e?"Expand":"Collapse"} ${t} directions`,className:"focus-visible:ring-content-muted/40 flex w-full items-center gap-2 px-3 py-2 text-left transition-colors duration-80 hover:bg-white/[0.03] focus:outline-none focus-visible:ring-1 focus-visible:ring-inset",children:[_,T.jsx("span",{className:"text-content min-w-0 flex-1 truncate text-sm font-medium",children:t})]}),g.length>0&&T.jsx("div",{className:Fr("absolute top-1.5 right-2 flex items-center gap-0.5 transition-opacity duration-80","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:T.jsx(zF,{open:h,onOpenChange:m,triggerLabel:`${t} run actions`,actions:g})})]}),T.jsx(Dd,{initial:!1,children:!e&&T.jsx(La.ul,{initial:{height:0,opacity:0},animate:{height:"auto",opacity:1},exit:{height:0,opacity:0},transition:{duration:$x,ease:Dx},className:"overflow-hidden",children:d},"body")})]})},mue=({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:m,onSelectPast:g,onSelectOriginal:_,onActivePointerDown:y,onPastPointerDown:b,onHover:x,onRemove:S,onRemovePast:E,onStartRename:C,onCommitRename:R,onCancelRename:O,onCopyVariantContext:I,activeSessionId:A,projectPath:L})=>{var pe,Ne;const N=v.useRef(null);pce(h,n,N);const[H,$]=v.useState(!1),W=e.kind==="active",X=e.kind==="original",z=e.kind==="active"?e.variant:null,K=e.kind==="past"?e.entry:null,te=z?z.status==="succeeded":!0,Z=z?Gp(z):!0,J=z!==null&&(z.status==="pending"||z.status==="running"),q=(z==null?void 0:z.status)==="failed",j=(z==null?void 0:z.status)==="cancelled",Y=z!==null&&(f==null?void 0:f.kind)==="remove"&&f.variantId===z.workItemId,ue=z!==null&&(((pe=z.refinement)==null?void 0:pe.status)==="pending"||((Ne=z.refinement)==null?void 0:Ne.status)==="running");let ie=uE;z?ie=z.label||`Direction ${n+1}`:K&&(ie=K.label.trim()||"Untitled direction");let ce=OF;z?ce=z.description:K&&(ce=K.brief);const he=ce?uue(ce):null,ke=fue(e),ve=ke??due(e,A);return s?T.jsx("li",{ref:N,"data-proximity-index":n,"data-reorder-container":l,"data-reorder-key":u,className:"group relative z-10",children:T.jsx("div",{className:Fr("bg-main-input flex w-full items-start gap-2 rounded-md py-2 pr-3",d?"pl-[33px]":"pl-3"),children:T.jsxs("span",{className:"min-w-0 flex-1",children:[T.jsx(VF,{initial:ie,onCommit:Ae=>R(e,Ae),onCancel:O}),he&&T.jsx("span",{className:"text-content-muted mt-1 line-clamp-2 block text-xs leading-snug",children:he})]})})}):T.jsxs("li",{ref:N,"data-proximity-index":n,"data-reorder-container":l,"data-reorder-key":u,className:Fr("group relative z-10 rounded-md",r&&"bg-main-input"),onMouseEnter:z?()=>x(z.workItemId):void 0,onMouseLeave:W?()=>x(null):void 0,children:[T.jsx("div",{role:"button",tabIndex:0,"data-variant-id":z==null?void 0:z.workItemId,"data-variant-key":t,onClick:Ae=>{if(Ae.metaKey||Ae.ctrlKey){$(!0);return}const $e=window.getSelection();$e&&!$e.isCollapsed||(e.kind==="active"?m(e.variant):e.kind==="past"?g(e.entry):_())},onKeyDown:Ae=>{(Ae.key==="Enter"||Ae.key===" ")&&(Ae.preventDefault(),Ae.stopPropagation(),e.kind==="active"?m(e.variant):e.kind==="past"?g(e.entry):_())},onPointerDown:Ae=>{Ae.metaKey||Ae.ctrlKey||(e.kind==="active"?Z&&y(e.variant.workItemId,Ae):e.kind==="past"&&b(e.entry,Ae))},"aria-pressed":r,"aria-disabled":W?!1:void 0,"aria-busy":J||ue,className:Fr("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",Z&&"cursor-grab active:cursor-grabbing",!Z&&"cursor-pointer"),style:Z?{touchAction:"none"}:void 0,children:T.jsxs("span",{className:"min-w-0 flex-1",children:[T.jsxs("span",{className:"flex items-center gap-2 pr-12",children:[(J||ue)&&T.jsx(EF,{className:"text-content-muted shrink-0 text-sm","data-testid":ue&&!J?"variant-refining":void 0}),T.jsx(kf,{label:"Double-click to rename",disabled:X,children:T.jsx("span",{onDoubleClick:Ae=>{Ae.stopPropagation(),X||C(t)},className:Fr("min-w-0 flex-1 truncate text-sm font-medium select-text",X?"cursor-default":"cursor-text",te||r?"text-content":"text-content-muted"),children:ie})}),q&&T.jsx(kf,{label:(z==null?void 0:z.errorMessage)??(z==null?void 0:z.errorCode)??"Failed",disabled:!(z!=null&&z.errorMessage)&&!(z!=null&&z.errorCode),children:T.jsx("span",{className:"shrink-0",children:T.jsx(K3,{label:"Failed"})})}),j&&T.jsx(K3,{label:"Cancelled"})]}),he&&T.jsx("span",{className:"text-content-muted mt-0.5 line-clamp-2 block cursor-text text-xs leading-snug select-text",children:he})]})}),X?null:T.jsx(Kie,{references:(z==null?void 0:z.references)??(K==null?void 0:K.references),source:W?"active":"history",sessionId:(K==null?void 0:K.sessionId)??A,variantId:(K==null?void 0:K.variantId)??(z==null?void 0:z.workItemId),projectPath:L,className:d?"pl-[33px]":"pl-3"}),T.jsxs("div",{className:Fr("absolute top-1.5 right-2 flex items-center gap-0.5 transition-opacity duration-80 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",H&&"pointer-events-auto opacity-100"),children:[T.jsx(ku,{variant:"ghost",size:"icon-compact",title:i?"Unpin direction":"Pin direction","aria-label":i?"Unpin direction":"Pin direction","aria-pressed":i,onPointerDown:Ae=>Ae.stopPropagation(),onKeyDown:Ae=>{(Ae.key!=="ArrowUp"&&Ae.key!=="ArrowDown"||Ae.altKey||Ae.ctrlKey||Ae.metaKey||Ae.shiftKey)&&Ae.stopPropagation()},onClick:Ae=>{Ae.stopPropagation(),o("button")},className:MF,children:T.jsx(mx,{weight:i?"fill":"bold"})}),T.jsx(zF,{open:H,onOpenChange:$,triggerLabel:"Direction actions",actions:[...ve?[{key:"copy-ref",label:"Copy ref",detail:ve,icon:T.jsx(Use,{size:13,weight:"bold"}),onSelect:()=>I({text:ve,copyKind:ke?"direction_ref":"reference"})}]:[],...!ve&&ce?[{key:"copy",label:"Copy description",icon:T.jsx(Vp,{size:13,weight:"bold"}),onSelect:()=>I({text:Uce({label:ie,description:ce}),copyKind:"description"})}]:[],{key:"pin",label:i?"Unpin":"Pin",icon:T.jsx(mx,{size:13,weight:"bold"}),onSelect:()=>o("menu")},...X?[]:[{key:"rename",label:"Rename",icon:T.jsx(a$,{size:13,weight:"bold"}),onSelect:()=>C(t)},{key:"remove",label:"Remove",icon:T.jsx(m$,{size:13,weight:"bold"}),disabled:Y,onSelect:()=>{e.kind==="active"?S(e.variant):e.kind==="past"&&E(e.entry)}}]]})]})]})},VF=({initial:t,onCommit:e,onCancel:n})=>{const[r,s]=v.useState(t),i=v.useRef(!1),o=v.useCallback(u=>{u&&(u.focus(),u.select())},[]),l=u=>{i.current||(i.current=!0,u?e(r):n())};return T.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"})},K3=({label:t})=>T.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}),gue=({selectedVariant:t,busy:e,onDeploy:n,onDeployCanvas:r,canShare:s,canDeploy:i,canDeployCanvas:o,canvasVariantCount:l,canvasDeployedUrl:u,deployedUrl:d})=>{const f=t?DF(t):!1,h=(e==null?void 0:e.kind)==="deploy"&&e.variantId===(t==null?void 0:t.workItemId),m=(e==null?void 0:e.kind)==="deploy-canvas",g=!i||!f||e!==null,_=o&&l>0,b=h?"Deploying…":d?"Copy link":"Share",S=m?"Sharing…":u?"Copy canvas link":"Share canvas";return T.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:[T.jsx("div",{className:"min-w-0",children:t?T.jsxs(T.Fragment,{children:[T.jsx("div",{className:"text-content truncate text-sm font-medium",children:t.label.trim()||"Untitled direction"}),d?T.jsx("div",{className:"text-content-muted text-[11px]",children:"Deployed — share link ready"}):null]}):null}),T.jsx("div",{className:"flex shrink-0 items-center gap-2",children:s?T.jsx(Wce,{primaryLabel:b,primaryIcon:d&&!h?Vp:void 0,primaryAction:()=>{t&&n(t)},isDisabled:g,isDropdownDisabled:e!==null,isLoading:h,loadingLabel:"Deploying…",dropdownAriaLabel:"More share actions",dropdownItems:_?[{label:S,icon:u&&!m?Vp:void 0,onClick:r,isDisabled:e!==null}]:[]}):null})]})},HF=()=>T.jsx("div",{"data-testid":"direction-skeleton-row","aria-hidden":"true",className:"flex w-full items-start rounded-md px-3 py-2",children:T.jsxs("span",{className:"min-w-0 flex-1",children:[T.jsxs("span",{className:"flex items-center gap-2",children:[T.jsx(EF,{className:"text-content-muted shrink-0 text-sm"}),T.jsx("span",{className:"bg-muted-foreground/15 h-3.5 w-28 animate-pulse rounded"})]}),T.jsx("span",{className:"mt-1.5 flex",children:T.jsx("span",{className:"bg-muted-foreground/10 h-2.5 w-full max-w-[14rem] animate-pulse rounded"})})]})}),vue=({groups:t})=>T.jsx("div",{className:"space-y-0.5",children:t.flatMap(e=>Array.from({length:Math.max(1,e.count)}).map((n,r)=>T.jsx(HF,{},`${e.requestId}-${r}`)))}),yue=()=>T.jsx("div",{"data-testid":"direction-boot-skeletons",className:"space-y-0.5",children:Array.from({length:3}).map((t,e)=>T.jsx(HF,{},e))}),_ue=()=>T.jsxs("div",{className:"flex flex-col items-center gap-2 px-4 py-8 text-center",children:[T.jsx("div",{className:"text-content text-sm",children:"No directions yet"}),T.jsx("div",{className:"text-content-muted text-xs",children:"They’ll appear here as they generate."})]}),G3="Try different ways to create a dropdown that feels fluid and dynamic",wue=({isMCPSession:t=!1,mcpEditor:e=null})=>{const[n,r]=v.useState(!1),s=Hce(e),i=t?s:"your coding agent",o=()=>{navigator.clipboard.writeText(G3).then(()=>{r(!0),setTimeout(()=>r(!1),2e3)})};return T.jsxs("div",{className:"flex flex-col items-start gap-3 px-2 py-2",children:[T.jsx("p",{className:"text-content text-sm font-medium",children:"Create your first direction"}),T.jsxs("p",{className:"text-content-muted text-xs",children:["Use ",i," to generate directions."]}),T.jsxs("div",{className:"w-full",children:[T.jsx("p",{className:"text-content-muted mb-2 text-xs",children:"Here's a sample prompt to use:"}),T.jsxs("div",{className:"border-main-border bg-main-input relative rounded-md border px-3 py-2.5 pr-8",children:[T.jsxs("p",{className:"text-content-muted text-xs leading-snug",children:["“",G3,"”"]}),T.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?T.jsx(jse,{className:"h-3.5 w-3.5 text-emerald-500",weight:"bold"}):T.jsx(Vp,{className:"h-3.5 w-3.5",weight:"bold"})})]})]})]})},bue="Open Rivet",jx="Close Rivet",xue=".",Sue=229,kue=/Mac|iPhone|iPad|iPod/,Eue={ariaKeyShortcuts:"Meta+.",modifier:"metaKey"},Cue={ariaKeyShortcuts:"Control+.",modifier:"ctrlKey"},dE=()=>typeof navigator<"u"&&kue.test(navigator.platform)?Eue:Cue,Pue=t=>{const{modifier:e}=dE();return t.key===xue&&!t.isComposing&&t.keyCode!==Sue&&t.metaKey===(e==="metaKey")&&t.ctrlKey===(e==="ctrlKey")&&!t.altKey&&!t.shiftKey},Tue="rivet:show-projects",Rue=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}},Aue=({onClose:t,libraryOrigin:e})=>{const n=xi(),r=bt(gF),s=bt(Vy),i=Rue(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?T.jsx("span",{className:"text-content min-w-0 truncate text-sm font-medium",title:r,children:r}):T.jsx("span",{});if(o||e){const f=T.jsxs("ol",{className:"flex min-w-0 items-center gap-1 text-xs",children:[T.jsx("li",{className:"shrink-0",children:T.jsx("button",{type:"button",onClick:async()=>{if(o&&i)window.parent.postMessage(Tue,i);else{try{const h=await Dt("/api/library/browser-launches",{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({view:"projects"})});if(!h.ok)throw new Error("The project library could not be opened.");const{url:m}=NY.parse(await h.json());window.location.assign(m)}catch{tn.error("Could not open the project library. Please try again.");return}n==null||n.capture("library_view_changed",{view:"projects"})}},className:"text-content-subtle hover:bg-main-input hover:text-content focus-visible:outline-content rounded px-1 py-1 focus-visible:outline focus-visible:outline-2",children:"Projects"})}),T.jsx("li",{"aria-hidden":!0,className:"text-content-subtle shrink-0",children:T.jsx($se,{className:"h-3 w-3"})}),T.jsx("li",{className:"min-w-0",children:T.jsx("span",{"aria-current":"page",title:l,className:"text-content block truncate font-medium",children:l})})]});u=T.jsx("nav",{"aria-label":"Project breadcrumb",className:"ph-no-capture min-w-0 flex-1","data-rivet-private":!0,children:f})}const d=dE();return T.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,T.jsx(kf,{label:jx,side:"bottom",children:T.jsx("button",{onClick:t,"aria-label":jx,"aria-keyshortcuts":d.ariaKeyShortcuts,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 duration-80",children:T.jsx(Bse,{className:"h-4 w-4",weight:"bold"})})})]})},Iue=ze({agentModeAvailable:Zs(),email:re().optional(),userId:re().optional(),name:re().optional(),isMCPSession:Zs(),mcpEditor:re().nullable(),agentApplyMode:jt(["embedded","external"]).nullable().optional(),queueAccessToken:re().nullable().optional(),projectPath:re(),projectId:re().uuid().nullable().optional(),libraryOrigin:re().url().nullable()}),UF=async({signal:t})=>{const e=await Dt("/api/config",{signal:t});if(!e.ok)throw new Error(`Failed to fetch config: ${e.statusText}`);return Iue.parse(await e.json())},ZF=5e3,Oue=async({signal:t})=>{const e=await Dt("/api/account",{signal:t});if(!e.ok)throw new Error("Could not load your account.");return $Y.parse(await e.json())},Mue=t=>({isAuthenticated:t.agentModeAvailable,name:t.name,email:t.email,userId:t.userId}),Lue=t=>Qo({queryKey:Ks.account,queryFn:Oue,enabled:t,refetchInterval:ZF,retry:!1}),Nue=t=>Qo({queryKey:Ks.rivetConfig,queryFn:UF,select:Mue,enabled:t,refetchInterval:ZF,retry:!1}),Due=()=>{const t=window.location.pathname.startsWith("/rivet/library"),e=Lue(t),n=Nue(!t);return t?e:n},Kv="rivet_just_signed_in",zx="https://rivet-proxy.onrender.com",$ue=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"},lb=({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}:{}}}),q3=ti("useLogin"),Fue=2e3,jue=60,Y3="Connecting to Google...",zue=`<!doctype html>
171
- <html lang="en">
172
- <head>
173
- <meta charset="utf-8" />
174
- <meta name="viewport" content="width=device-width, initial-scale=1" />
175
- <title>${Y3}</title>
176
- <style>
177
- :root { color-scheme: light dark; }
178
- body {
179
- margin: 0;
180
- min-height: 100vh;
181
- display: grid;
182
- place-items: center;
183
- font-family: Inter, system-ui, -apple-system, Segoe UI, sans-serif;
184
- background: #111215;
185
- color: #f3f4f6;
186
- }
187
- .panel {
188
- border: 1px solid rgba(255, 255, 255, 0.16);
189
- border-radius: 12px;
190
- padding: 18px 22px;
191
- background: rgba(255, 255, 255, 0.06);
192
- font-size: 14px;
193
- }
194
- </style>
195
- </head>
196
- <body>
197
- <div class="panel">${Y3}</div>
198
- </body>
199
- </html>`,Vue=ze({success:Zs(),authUrl:re().optional(),sessionId:re().optional(),pollSecret:re().optional(),error:re().optional(),message:re().optional()}),Hue=ze({success:Zs(),token:re().optional(),refreshToken:re().optional(),user:ze({id:re().optional(),email:re().optional()}).optional(),error:re().optional(),message:re().optional()}),Uue="/api/auth/install-ref",Zue=ze({installRef:re().nullable()}),Bue=async()=>{try{const t=await fetch(Uue);if(!t.ok)return;const e=Zue.safeParse(await t.json());return e.success?e.data.installRef??void 0:void 0}catch{return}},BF=(t="editor_gate",e)=>{const n=xi(),[r,s]=v.useState(!1),[i,o]=v.useState(null);return{startLogin:v.useCallback(async()=>{var m;const u=globalThis.crypto.randomUUID(),d=Date.now();s(!0),o(null);const f=lb({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(zue),h.document.close()}catch(x){q3.warn("Failed to render loading state in auth popup:",x)}const g=await Bue(),_=await fetch(`${zx}/api/auth/google/start`,{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({source:"core",...g?{ref:g}:{}})}),y=Vue.safeParse(await _.json());if(!y.success)throw new Error("Invalid Google login response");const b=y.data;if(!_.ok||!b.success||!b.authUrl||!b.sessionId||!b.pollSecret)throw new Error(b.error||b.message||"Failed to start Google login");if(h.closed)throw new Error("Sign-in window was closed before Google login started.");h.location.href=b.authUrl;for(let x=0;x<jue;x+=1){if(h.closed)throw new Error("Sign-in window was closed before authentication completed.");const S=await fetch(`${zx}/api/auth/google/token`,{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({session:b.sessionId,pollSecret:b.pollSecret})}),E=Hue.safeParse(await S.json());if(!E.success)throw new Error("Invalid Google token response");const C=E.data;if(C.success&&C.token&&((m=C.user)!=null&&m.email)){const R={email:C.user.email,token:C.token,refreshToken:C.refreshToken,userId:C.user.id,...g?{installRef:g}:{}};if(e)await e(R);else if(!(await Dt("/api/auth/store",{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify(R)})).ok)throw new Error("Signed in, but failed to store session locally.");h.close(),window.sessionStorage.setItem(Kv,"1");const O=lb({outcome:"completed",authAttemptId:u,entryPoint:t,startedAt:d,now:Date.now()});n==null||n.capture(O.event,O.properties),window.location.reload();return}if(C.error&&C.error!=="Pending")throw new Error(C.error||"Google login failed");await new Promise(R=>setTimeout(R,Fue))}throw new Error("Authentication timed out. Please try again.")}catch(g){h&&!h.closed&&h.close();const _=Us(g,"Failed to start login flow");q3.warn("Login failed:",_);const y=lb({outcome:"failed",authAttemptId:u,entryPoint:t,startedAt:d,now:Date.now(),failureReason:$ue(_)});n==null||n.capture(y.event,y.properties),o(_),s(!1)}},[n,t,e]),isStartingLogin:r,loginError:i}},Wue=ti("useIntegrations"),Kue=ze({provider:re(),status:re(),externalUsername:re().nullable(),connectedAt:re()}),Gue=ze({integrations:Tt(Kue).optional()}),que=ze({authUrl:re().min(1).optional(),error:re().optional()}),Yue="rivet:connect-result",Xue=t=>typeof t=="object"&&t!==null&&t.type===Yue,Que=dn(null),X3=async()=>{const t=await Dt("/api/integrations");if(!t.ok)throw new Error(`Failed to load integrations (${t.status})`);return Gue.parse(await t.json()).integrations??[]},Jue=async t=>{const e=await Dt(`/api/integrations/${t}`,{method:"DELETE"});if(!e.ok){const n=L5.safeParse(await e.json().catch(()=>({})));throw new Error(n.success&&n.data.error||`Could not disconnect ${t}`)}},ede=()=>{const t=mm(),[e,n]=KD(Que),r=Qo({queryKey:Ks.integrations,queryFn:X3,staleTime:1e4}),s=v.useCallback(async()=>(await t.invalidateQueries({queryKey:Ks.integrations,refetchType:"none"}),t.fetchQuery({queryKey:Ks.integrations,queryFn:X3})),[t]),i=v.useCallback(async u=>{const d=window.open("","_blank","width=560,height=720");if(!d)throw new Error("Popup blocked. Allow popups to connect.");n(u);try{const f=await Dt(`/api/integrations/${u}/connect`,{method:"POST"}),h=que.safeParse(await f.json().catch(()=>({}))),m=h.success?h.data:{};if(!f.ok||!m.authUrl)throw d.close(),new Error(m.error||`Could not connect ${u}`);return d.location.href=m.authUrl,await new Promise(g=>{let _=!1,y=null;const b=async(S,E=!1)=>{if(!_){_=!0,window.removeEventListener("message",x),y&&clearInterval(y);try{const R=(await s()).some(O=>O.provider===u&&O.status==="connected");g(E&&R?"connected":S)}catch{g(S)}}},x=S=>{if(Xue(S.data)&&S.data.provider===u){if(S.data.status==="error"){Wue.warn(`Connect failed for ${u}:`,S.data.message),b("failed");return}b("connected")}};window.addEventListener("message",x),y=setInterval(()=>{d.closed&&b("closed",!0)},500)})}finally{n(null)}},[s,n]),{mutateAsync:o}=tN({mutationFn:Jue,onSuccess:s}),l=v.useCallback(async u=>{n(u);try{await o(u)}finally{n(null)}},[o,n]);return{integrations:r.data??[],isLoading:r.isPending,error:r.error instanceof Error?r.error.message:null,pendingProvider:e,connect:i,disconnect:l,refetch:s}},Nc=({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}:{}}}),du=re().regex(/^[1-9]\d{0,15}$/).refine(t=>Number.isSafeInteger(Number(t))),WF=re().min(1).max(4096),fE=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)}`}},KF=re().max(2048).transform((t,e)=>{try{return fE(t).url}catch(n){return e.addIssue({code:x5.custom,message:Us(n,"Invalid Cosmos profile URL")}),NL}}),GF=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("/")}`}},tde=re().url().refine(t=>{const e=new URL(t);return e.protocol==="https:"&&e.hostname==="cdn.cosmos.so"&&!e.username&&!e.password&&!e.port}),nde=ze({id:du,title:re().min(1).max(500),url:re().url().transform(t=>GF(t).url),children:Tt(du)}),rde=ze({id:du,url:re().url(),title:re().max(1e3),text:re().max(1e5),author:re().nullable(),owner:re().nullable(),sourceUrl:re().url().nullable(),images:Tt(ze({url:tde,representation:jt(["image","video-cover"])})).max(100),unsupportedReason:re().optional()}),sde=ze({collection:nde,elements:Tt(rde),total:An().int().nonnegative(),nextCursor:WF.nullable()});xq("status",[sde.extend({status:pf("ok")}),ze({status:pf("error"),message:re(),reason:jt(["rate_limited","provider_unavailable","collection_unavailable"]).optional(),retryAfterMs:An().nonnegative().optional()})]);const qF=ze({id:du,username:re().min(1).max(100),title:re().max(500),url:re().transform(t=>fE(t).url)}),ide=ze({id:du,title:re().min(1).max(500),description:re().max(1e4).nullable(),url:re().transform(t=>GF(t).url),total:An().int().nonnegative(),parentId:du.nullable(),children:Tt(du).max(1e4)});ze({profile:qF,collections:Tt(ide),total:An().int().nonnegative(),nextCursor:WF.nullable()});const YF=jt(["pinterest","arena","x"]),ode=jt(["cosmos","pinterest","arena","x"]),zd=re().min(1).max(200).regex(/^[a-zA-Z0-9:_-]+$/),XF={"www.cosmos.so":"cosmos","www.pinterest.com":"pinterest","www.are.na":"arena","x.com":"x"},ade=re().url().refine(t=>{const e=new URL(t);return e.protocol==="https:"&&!e.username&&!e.password&&!e.port&&!e.search&&!e.hash&&YF.safeParse(XF[e.hostname]).success&&/^\/[a-zA-Z0-9_-]+\/?$/.test(e.pathname)},"Use a canonical reference provider profile URL"),hE=ze({id:zd,username:re().min(1).max(100),title:re().max(500),url:hm([KF,ade])}).transform(t=>XF[new URL(t.url).hostname]==="cosmos"?qF.parse(t):t),pE=ze({id:zd,title:re().min(1).max(500),description:re().max(1e4).nullable(),url:re().url().nullable(),total:An().int().nonnegative().nullable(),parentId:zd.nullable(),children:Tt(zd).max(1e4)});hm([ze({url:KF}).strict(),ze({provider:YF}).strict()]);const lde=ze({collections:Tt(pE),total:An().int().nonnegative().nullable(),nextCursor:re().min(1).max(4096).nullable()});lde.extend({profile:hE});const qp=1e3,cde=1e4,ude=ze({profile:hE,collections:Tt(pE).max(qp),total:An().int().nonnegative().max(qp)}),dde=ude.extend({id:re().uuid(),createdAt:re().datetime()}),fde=ze({collection:pE,collectionIds:Tt(zd).min(1).max(qp),references:Tt(O5.extend({provider:ode})).max(cde)}),hde=ze({discoveryId:re().uuid(),runtime:pm,sources:Tt(fde).min(1).max(qp),reusableCount:An().int().nonnegative()});hde.extend({id:re().uuid(),profile:hE,revision:re().regex(/^[a-f0-9]{64}$/),createdAt:re().datetime(),expiresAt:re().datetime(),approvedAt:re().datetime().nullable(),jobIds:Tt(re().uuid())});ze({discoveryId:re().uuid(),collectionIds:Tt(zd).min(1).max(qp),runtime:pm}).strict();ze({id:re().uuid(),revision:re().regex(/^[a-f0-9]{64}$/),isApproved:pf(!0)}).strict();jt(["later","dismiss","reset"]);const Em=async(t,e,n="GET",r)=>{if(window.location.pathname.startsWith("/rivet/library"))return HY(t,{schema:e,method:n,body:r});const s=await Dt(t.replace(/^\/profile/,"/api/reference-profiles"),{method:n,headers:{"Content-Type":"application/json"},...r!==void 0?{body:JSON.stringify(r)}:{}}),i=await s.text();let o;try{o=JSON.parse(i)}catch{throw new Error(`Reference profile request failed (${s.status})`)}if(!s.ok)throw new Error(o.error??`Request failed (${s.status})`);return o},QF=()=>Em("/profile",N5),pde=t=>Qo({queryKey:Ks.cosmosProfile,queryFn:QF,enabled:t}),mde=t=>Em("/profile/discoveries",dde,"POST",{url:t}),gde=({discoveryId:t,collectionIds:e,runtime:n})=>Em("/profile/import-plans",D5,"POST",{discoveryId:t,collectionIds:e,runtime:n}),vde=t=>Em("/profile",N5,"PATCH",{isEnabled:!0,runtime:t}),yde=t=>Em(`/profile/import-plans/${t.id}/imports`,D5,"POST",{revision:t.revision,isApproved:!0}),_de=({isOpen:t,onClose:e,onImported:n})=>{const[r,s]=v.useState(""),[i,o]=v.useState(null),[l,u]=v.useState([]),[d,f]=v.useState(""),[h,m]=v.useState(null),[g,_]=v.useState(null),[y,b]=v.useState(!1),x=v.useRef(0),S=xi(),E=()=>{x.current+=1,s(""),o(null),u([]),f(""),m(null),_(null),b(!1)},C=()=>{S==null||S.capture("visual_editor_cosmos_modal_closed"),E(),e()},R=async L=>{L.preventDefault(),_(null);let N;try{N=fE(r.trim()).url}catch($){_(Us($,"Invalid Cosmos profile URL"));return}S==null||S.capture("visual_editor_cosmos_discovery_started");const H=++x.current;b(!0);try{const $=await mde(N);if(H!==x.current)return;o($),u([]),S==null||S.capture("visual_editor_cosmos_discovery_completed",{collection_count:$.collections.length})}catch($){if(H!==x.current)return;_(Us($,"Could not find Cosmos profile")),S==null||S.capture("visual_editor_cosmos_discovery_failed")}finally{H===x.current&&b(!1)}},O=async()=>{if(!i||l.length===0||!d)return;_(null),S==null||S.capture("visual_editor_cosmos_plan_started",{collection_count:l.length,runtime:d});const L=++x.current;b(!0);try{const N=await gde({discoveryId:i.id,collectionIds:l,runtime:d});if(L!==x.current)return;m(N),S==null||S.capture("visual_editor_cosmos_plan_completed",{collection_count:N.collectionCount,reference_count:N.referenceCount})}catch(N){if(L!==x.current)return;_(Us(N,"Could not prepare import plan")),S==null||S.capture("visual_editor_cosmos_plan_failed")}finally{L===x.current&&b(!1)}},I=async()=>{if(!h||!d)return;_(null),S==null||S.capture("visual_editor_cosmos_import_started",{collection_count:h.collectionCount,reference_count:h.referenceCount});const L=++x.current;b(!0);try{if((await QF()).profile.isEnabled||await vde(d),await yde(h),S==null||S.capture("visual_editor_cosmos_import_completed",{reference_count:h.referenceCount}),n(),L!==x.current)return;E(),e()}catch(N){if(S==null||S.capture("visual_editor_cosmos_import_failed"),L!==x.current)return;_(Us(N,"Could not start Cosmos import"))}finally{L===x.current&&b(!1)}},A=L=>{u(N=>N.includes(L)?N.filter(H=>H!==L):[...N,L]),S==null||S.capture("visual_editor_cosmos_collection_toggled")};return T.jsx(Ly,{open:t,onOpenChange:L=>!L&&C(),children:T.jsxs(Ny,{children:[T.jsx(Dy,{className:"z-max fixed inset-0 bg-black/60"}),T.jsxs($y,{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:[T.jsxs("div",{className:"border-main-border bg-main-light flex items-center justify-between rounded-t-lg border-b px-4 py-2",children:[T.jsx(Fy,{className:"text-content text-base font-medium",children:"Connect Cosmos"}),T.jsx(ku,{onClick:C,title:"Close","aria-label":"Close",variant:"ghost",size:"icon-compact",children:T.jsx(Ok,{className:"h-4 w-4",weight:"bold"})})]}),T.jsxs("div",{className:"space-y-4 p-4",children:[T.jsx(jy,{className:"text-content-subtle text-sm",children:"Add public collections from a Cosmos profile to your design references."}),i?null:T.jsxs("form",{onSubmit:L=>void R(L),className:"space-y-4",children:[T.jsx("label",{className:"text-content block text-sm font-medium",htmlFor:"cosmos-profile-url",children:"Cosmos profile URL"}),T.jsx("input",{id:"cosmos-profile-url",type:"url",required:!0,autoFocus:!0,value:r,onChange:L=>s(L.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"}),T.jsx("button",{type:"submit",disabled:y,className:"bg-secondary text-secondary-foreground hover:bg-accent rounded-md px-4 py-2 text-sm font-medium disabled:opacity-50",children:y?"Finding collections…":"Continue"})]}),i&&!h?T.jsxs("div",{className:"space-y-4",children:[T.jsxs("p",{className:"text-content text-sm font-medium",children:["Choose collections from"," ",i.profile.title||i.profile.username]}),T.jsx("div",{className:"border-main-border max-h-60 divide-y overflow-y-auto rounded-md border",children:i.collections.map(L=>T.jsxs("label",{className:"text-content hover:bg-main-light flex cursor-pointer items-center gap-3 px-3 py-2 text-sm",children:[T.jsx("input",{type:"checkbox",checked:l.includes(L.id),disabled:y,onChange:()=>A(L.id)}),T.jsx("span",{className:"min-w-0 flex-1 truncate",children:L.title}),T.jsx("span",{className:"text-content-muted text-xs",children:L.total??"—"})]},L.id))}),i.collections.length===0?T.jsx("p",{className:"text-content-muted text-sm",children:"No public collections found for this profile."}):null,T.jsxs("label",{className:"text-content flex items-center justify-between gap-3 text-sm",children:["Analysis runtime",T.jsxs("select",{value:d,disabled:y,onChange:L=>{const N=L.target.value;f(N),S==null||S.capture("visual_editor_cosmos_runtime_selected",{runtime:N})},className:"border-main-border bg-main-input rounded-md border px-2 py-1.5",children:[T.jsx("option",{value:"",disabled:!0,children:"Select a runtime"}),T.jsx("option",{value:"codex",children:"Codex"}),T.jsx("option",{value:"claude",children:"Claude"}),T.jsx("option",{value:"cursor",children:"Cursor"})]})]}),T.jsx("button",{type:"button",onClick:()=>void O(),disabled:y||l.length===0||!d,className:"bg-secondary text-secondary-foreground hover:bg-accent rounded-md px-4 py-2 text-sm font-medium disabled:opacity-50",children:y?"Preparing plan…":"Review import plan"}),T.jsx("button",{type:"button",onClick:()=>{S==null||S.capture("visual_editor_cosmos_profile_changed"),E()},disabled:y,className:"text-content-muted hover:text-content ml-3 text-sm",children:"Use another profile"})]}):null,h?T.jsxs("div",{className:"space-y-4 text-sm",children:[T.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"]}),T.jsx("p",{className:"text-content-subtle",children:h.scopeDisclosure}),T.jsx("p",{className:"text-content-subtle",children:h.usageDisclosure}),T.jsxs("p",{className:"text-content-muted text-xs",children:[h.reusableCount," reusable · ",h.unsupportedCount," ","unsupported · runtime: ",d]}),T.jsx("button",{type:"button",onClick:()=>void I(),disabled:y,className:"bg-secondary text-secondary-foreground hover:bg-accent rounded-md px-4 py-2 text-sm font-medium disabled:opacity-50",children:y?"Starting import…":"Approve and import"}),T.jsx("button",{type:"button",onClick:()=>{S==null||S.capture("visual_editor_cosmos_plan_revised"),m(null)},disabled:y,className:"text-content-muted hover:text-content ml-3 text-sm",children:"Change selection"})]}):null,g?T.jsx("p",{role:"alert",className:"text-sm text-red-300",children:g}):null]})]})]})})},Q3=ti("ConnectorsModal"),wde=[{provider:"x",name:"X",iconClassName:"text-content",icon:T.jsx(mp,{provider:"x"})},{provider:"pinterest",name:"Pinterest",iconClassName:"text-[#e60023]",icon:T.jsx(mp,{provider:"pinterest"})},{provider:"arena",name:"Are.na",iconClassName:"text-content",icon:T.jsx(mp,{provider:"arena"})}],bde={name:"Cosmos",iconClassName:"text-content",icon:T.jsx(mp,{provider:"cosmos"})},J3=({meta:t,status:e,actionLabel:n,buttonLabel:r,isDisabled:s,isHighlighted:i,onAction:o})=>T.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:[T.jsx("span",{className:`grid h-7 w-7 flex-none place-items-center ${t.iconClassName}`,"aria-hidden":"true",children:t.icon}),T.jsxs("div",{className:"min-w-0 flex-1",children:[T.jsx("span",{className:"text-content block text-sm font-medium",children:t.name}),T.jsx("span",{className:"text-content-muted block truncate text-xs",children:e})]}),T.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})]}),Vx=({isOpen:t,onClose:e,context:n="menu",highlightProvider:r=null})=>{var O;const{integrations:s,isLoading:i,error:o,pendingProvider:l,connect:u,disconnect:d}=ede(),f=xi(),[h,m]=v.useState(null),[g,_]=v.useState(!1),y=pde(t),b=I=>s.find(A=>A.provider===I),x=v.useCallback(I=>{const A=Date.now(),L=Nc({action:"connect",outcome:"started",provider:I,entryPoint:n});f==null||f.capture(L.event,L.properties),u(I).then(N=>{const H=Date.now()-A;if(N==="connected"){const W=Nc({action:"connect",outcome:"completed",provider:I,entryPoint:n,durationMs:H});f==null||f.capture(W.event,W.properties);return}const $=Nc({action:"connect",outcome:"failed",provider:I,entryPoint:n,durationMs:H,failureReason:N==="closed"?"popup_closed":"provider_failed"});f==null||f.capture($.event,$.properties)}).catch(N=>{const H=Us(N,"Could not connect."),$=Nc({action:"connect",outcome:"failed",provider:I,entryPoint:n,durationMs:Date.now()-A,failureReason:H.includes("Popup blocked")?"popup_blocked":"request_failed"});f==null||f.capture($.event,$.properties),Q3.warn(`Connect error for ${I}:`,H),tn.error(H)})},[u,n,f]),S=v.useCallback(I=>{const A=Date.now(),L=Nc({action:"disconnect",outcome:"started",provider:I,entryPoint:n});f==null||f.capture(L.event,L.properties),d(I).then(()=>{const N=Nc({action:"disconnect",outcome:"completed",provider:I,entryPoint:n,durationMs:Date.now()-A});f==null||f.capture(N.event,N.properties)}).catch(N=>{const H=Us(N,"Could not disconnect."),$=Nc({action:"disconnect",outcome:"failed",provider:I,entryPoint:n,durationMs:Date.now()-A,failureReason:"request_failed"});f==null||f.capture($.event,$.properties),Q3.warn(`Disconnect error for ${I}:`,H),tn.error(H)})},[n,d,f]),E=n==="onboarding",C=(O=y.data)==null?void 0:O.sources.some(I=>I.provider==="cosmos");let R=C?"Connected":"Not connected";return y.isError&&(R="Status unavailable"),y.isPending&&(R="Checking status…"),T.jsxs(T.Fragment,{children:[T.jsx(Ly,{open:t,onOpenChange:I=>!I&&e(),children:T.jsxs(Ny,{children:[T.jsx(Dy,{className:"z-max fixed inset-0 bg-black/40"}),T.jsx($y,{ref:m,className:"z-max border-main-border bg-main font-main fixed top-1/2 left-1/2 w-[min(440px,calc(100vw-32px))] -translate-x-1/2 -translate-y-1/2 rounded-lg border shadow-2xl outline-none",children:T.jsxs(B4,{value:h,children:[T.jsxs("div",{className:"border-main-border bg-main-light flex items-center justify-between rounded-t-lg border-b px-4 py-2",children:[T.jsx(Fy,{className:"text-content text-base font-medium",children:"Connect design references"}),T.jsx(ku,{onClick:e,title:"Close","aria-label":"Close",variant:"ghost",size:"icon-compact",children:T.jsx(Ok,{className:"h-4 w-4",weight:"bold"})})]}),T.jsxs("div",{className:"flex flex-col gap-4 p-4",children:[T.jsx(jy,{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?T.jsx("p",{className:"rounded-lg bg-red-500/10 px-4 py-3 text-[13px] font-medium text-red-300",children:o}):null,T.jsxs("ul",{className:"divide-main-border divide-y","aria-label":"Design reference services",children:[wde.map(I=>{const A=b(I.provider),L=(A==null?void 0:A.status)==="connected",N=A==null?void 0:A.externalUsername;let H=L?`Connected${N?` as @${N}`:""}`:"Not connected";i&&(H="Checking status…");const $=l===I.provider,W=L?"Disconnect":"Connect";return T.jsx(J3,{meta:I,status:H,actionLabel:`${W} ${I.name}`,buttonLabel:$?`${W}ing…`:W,isDisabled:i||$,isHighlighted:r===I.provider,onAction:()=>L?S(I.provider):x(I.provider)},I.provider)}),T.jsx(J3,{meta:bde,status:R,actionLabel:C?"Add Cosmos profile":"Connect Cosmos",buttonLabel:C?"Add profile":"Connect",isDisabled:!1,isHighlighted:!1,onAction:()=>{f==null||f.capture("visual_editor_cosmos_modal_opened"),_(!0)}})]}),E?T.jsxs("div",{className:"flex items-center justify-between gap-4",children:[T.jsx("p",{className:"text-content-subtle text-xs",children:"You can always do this later from the account menu."}),T.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]})]})})]})}),T.jsx(_de,{isOpen:g,onClose:()=>_(!1),onImported:()=>{y.refetch()}})]})},eI=({className:t=""})=>T.jsx("span",{"aria-hidden":"true",className:`rivet-skeleton block rounded ${t}`.trim()}),xde=ti("SupportTicketModal"),tI=5e3,cb="feedback",Sde=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},kde=async t=>{let e;try{const n=MY.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=Sde(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}`},Ede=({isOpen:t,onClose:e,contactEmail:n})=>{const r=xi(),[s,i]=v.useState(""),[o,l]=v.useState(!1),[u,d]=v.useState(null),f=v.useCallback(()=>{i("")},[]),h=v.useCallback(()=>{o||(f(),e())},[o,e,f]),m=v.useCallback(async()=>{const b=s.trim();if(!(!b||o)){l(!0);try{const x=typeof(r==null?void 0:r.get_session_id)=="function"?r.get_session_id():void 0,S=typeof(r==null?void 0:r.get_distinct_id)=="function"?r.get_distinct_id():void 0,E=n==null?void 0:n.trim(),C=await Dt("/api/support/tickets",{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({type:cb,message:b,contactEmail:E||void 0,metadata:{posthogSessionId:x??void 0,posthogDistinctId:S??void 0,appVersion:"0.28.1",appEnvironment:"production",pageUrl:window.location.href,userAgent:navigator.userAgent,submittedAt:new Date().toISOString()}})});if(!C.ok){const R=await kde(C);throw new Error(R)}r==null||r.capture("support_ticket_submitted",{ticket_type:cb,has_posthog_session_id:!!x}),tn.success("Feedback sent",{description:"Thanks for sharing this."}),f(),e()}catch(x){const S=Us(x,"Failed to send message");r==null||r.capture("support_ticket_submit_failed",{ticket_type:cb,error:S}),xde.error("Failed to submit support ticket:",S),tn.error("Could not send feedback",{description:S})}finally{l(!1)}}},[n,o,s,e,r,f]),g=v.useCallback(b=>{b.key==="Enter"&&(b.metaKey||b.ctrlKey)&&(b.preventDefault(),m())},[m]),_=tI-s.length,y=o||s.trim().length===0;return T.jsx(Ly,{open:t,onOpenChange:b=>!b&&h(),children:T.jsxs(Ny,{children:[T.jsx(Dy,{className:"z-max fixed inset-0 bg-black/40"}),T.jsx($y,{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:T.jsxs(B4,{value:u,children:[T.jsxs("div",{className:"border-main-border bg-main-light flex items-center justify-between rounded-t-lg border-b px-4 py-2",children:[T.jsx(Fy,{className:"text-content text-base font-medium",children:"Send feedback"}),T.jsx(ku,{onClick:h,disabled:o,title:"Close","aria-label":"Close",variant:"ghost",size:"icon-compact",children:T.jsx(Ok,{className:"h-4 w-4",weight:"bold"})})]}),T.jsxs("div",{className:"flex flex-col gap-3 p-4",children:[T.jsx(jy,{className:"text-content-subtle text-sm",children:"Tell us what happened or what we can improve."}),T.jsxs("div",{className:"bg-main-input rounded-lg outline outline-1 outline-transparent transition-[outline-color] focus-within:outline-white/20",children:[T.jsx("textarea",{id:"support-ticket-message","aria-label":"Your feedback",value:s,onChange:b=>i(b.target.value),onKeyDown:g,maxLength:tI,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"}),T.jsxs("div",{className:"flex items-center justify-between px-3 pt-1 pb-3",children:[T.jsx("span",{className:"text-content-subtle text-xs",children:"Context details are included automatically."}),T.jsxs("div",{className:"flex items-center gap-2",children:[_<=500&&T.jsx("span",{className:"text-content-subtle text-xs",children:_}),T.jsx(ku,{onClick:m,disabled:y,title:"Send feedback",shortcut:"⌘↵","aria-label":"Send feedback",variant:"primary",size:"icon-compact",children:o?T.jsx(Ik,{className:"h-5 w-5 animate-spin",weight:"bold"}):T.jsx(Nse,{className:"h-5 w-5",weight:"bold"})})]})]})]})]})]})})]})})},Cde=ti("ProfileAvatar"),JF=(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):""},Pde=(t,e)=>JF(t,e).charAt(0).toUpperCase(),Tde=({className:t="",side:e="bottom",align:n="end"})=>{var W,X,z;const r=Due(),s=((W=r.data)==null?void 0:W.name)??null,i=((X=r.data)==null?void 0:X.email)??null,o=((z=r.data)==null?void 0:z.isAuthenticated)===!0,l=xi(),{startLogin:u,isStartingLogin:d,loginError:f}=BF("account_menu"),[h,m]=v.useState(!1),[g,_]=v.useState(!1),[y,b]=v.useState(!1),[x,S]=v.useState(!1),{containerRef:E,onKeyDown:C,onCloseAutoFocus:R}=dF({onDismiss:()=>$(!1)}),O=Pde(s,i);if(r.isPending)return T.jsxs("span",{"data-testid":"profile-avatar-skeleton","aria-hidden":"true",className:`flex shrink-0 items-center gap-2 ${t}`.trim(),children:[T.jsx(eI,{className:"h-8 w-8 rounded-full"}),T.jsx(eI,{className:"h-3.5 w-16"})]});const I=JF(s,i),A=(s==null?void 0:s.trim())||null,L=(i==null?void 0:i.trim())||null,N=async()=>{S(!0);try{const K=await Dt("/api/auth/logout",{method:"POST",credentials:"same-origin"});if(!K.ok)throw new Error(`Logout failed: ${K.status}`);window.location.pathname.startsWith("/rivet/library")&&j5()}catch(K){Cde.warn("Logout request failed",K),tn.error("Could not log out. Please try again."),S(!1);return}window.location.reload()};let H="Log in";o&&(H=I||"Account"),r.error&&!r.data&&(H="Account unavailable");const $=K=>{m(K),l==null||l.capture(`visual_editor_account_menu_${K?"opened":"closed"}`,{is_authenticated:o})};return T.jsxs(T.Fragment,{children:[T.jsxs(sE,{open:h,onOpenChange:$,children:[T.jsx(iE,{asChild:!0,children:T.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:[T.jsx("span",{className:"border-main-border bg-main-input flex h-8 w-8 items-center justify-center rounded-full border text-xs leading-none font-semibold",children:O||T.jsx(Yse,{className:"h-4 w-4",weight:"bold"})}),T.jsx("span",{className:"max-w-[8rem] truncate text-sm font-medium",children:H})]})}),T.jsx(oE,{children:T.jsxs(aE,{"data-rivet-private":!0,ref:E,onKeyDown:C,onCloseAutoFocus:R,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:[A||L?T.jsxs("div",{className:"border-main-border border-b px-3 py-2",children:[A?T.jsx("div",{className:"text-content truncate text-sm font-medium",children:A}):null,L?T.jsx("div",{className:"text-content-muted truncate text-xs",children:L}):null]}):null,T.jsxs("button",{type:"button",role:"menuitem","data-menu-item":!0,onClick:()=>{$(!1),_(!0)},disabled:!o,className:"text-content hover:bg-hover focus-visible:bg-hover mt-1 flex w-full items-center gap-2 rounded-md px-3 py-1.5 text-sm transition-colors focus:outline-none disabled:cursor-not-allowed disabled:opacity-50",children:[T.jsx(qse,{className:"h-4 w-4",weight:"bold"}),"Connect design references"]}),T.jsxs("button",{type:"button",role:"menuitem","data-menu-item":!0,onClick:()=>{$(!1),b(!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:[T.jsx(Fse,{className:"h-4 w-4",weight:"bold"}),"Share feedback"]}),o?T.jsxs("button",{type:"button",role:"menuitem","data-menu-item":!0,onClick:N,disabled:x,className:"text-content hover:bg-hover focus-visible:bg-hover mt-1 flex w-full items-center gap-2 rounded-md px-3 py-1.5 text-sm transition-colors focus:outline-none disabled:cursor-not-allowed disabled:opacity-50",children:[T.jsx(Kse,{className:"h-4 w-4",weight:"bold"}),x?"Logging out…":"Log out"]}):null,!o&&!r.error?T.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:[T.jsx(Wse,{className:"h-4 w-4",weight:"bold"}),d?"Logging in…":"Log in"]}):null,r.error?T.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?T.jsx("p",{role:"alert",className:"max-w-64 px-3 py-2 text-sm text-red-300",children:f}):null]})})]}),g?T.jsx(Vx,{isOpen:!0,onClose:()=>_(!1)}):null,T.jsx(Ede,{isOpen:y,onClose:()=>b(!1),contactEmail:i??void 0})]})},Rde=({onClose:t,libraryOrigin:e})=>T.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:[T.jsx(Aue,{onClose:t,libraryOrigin:e}),T.jsx("div",{className:"flex min-h-0 flex-1 flex-col",children:T.jsx(aue,{})}),T.jsx("div",{className:"border-main-border bg-main-light flex flex-shrink-0 items-center border-t px-2.5 py-2.5",children:T.jsx(Tde,{side:"top",align:"start"})})]}),nI=ti("useServerConfig"),Yp=[250,500,1e3,2e3,4e3],Ade=Yp.length+1,Ide=async()=>{var n;const t=await Dt("/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}},Ode=(t,e)=>t<Yp.length?(nI.warn(`Server config fetch failed (attempt ${t+1}); retrying in ${Yp[t]}ms`,e),!0):(nI.warn("Error fetching server config:",e),Xe==null||Xe.capture("preview_config_load_failed",{message:Us(e,"unknown_error"),attempts:Ade}),!1),Mde=t=>Yp[Math.min(t,Yp.length-1)],Lde=()=>{const t=Qo({queryKey:Ks.serverConfig,queryFn:Ide,retry:Ode,retryDelay:Mde,staleTime:1/0,refetchOnWindowFocus:!1,refetchOnReconnect:!1,networkMode:"always"}),e=t.isFetching&&!t.data,{refetch:n}=t;return{config:t.data??null,isLoading:e,error:t.error&&!e?t.error.message:null,retry:()=>{n()}}},Nde="#1C1C20",va=[118,118,124],rI=.85,Dde=3,$de=.15,cg=36,Fde=4.4,jde=.7,zde=3.5,Vde=.8,sI=9,Hde=11,Ude=[1.35,1.12,.95,.85],Zde=[0,1.1,2.3,3.1],Bde=[0,.35,.16,.13],Wde=[.9,.5,.4,.35],Dc=3,ub=[[{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}]],ug=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},Hg=t=>{const e=Math.min(1,Math.max(0,t));return e*e*(3-2*e)},$c=(t,e)=>(Math.round(t/e-.5)+.5)*e,Kde=Math.sin(Math.PI/3),iI=(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*Kde;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()},Gde=(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)-sI}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)-sI}return Hg(.5-r/(2*Hde))},e9=({className:t="",trackGlobalLoaderCount:e=!0})=>{const n=Mt(vF),r=v.useRef(null),s=v.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(H=>H+1);const l=window.matchMedia("(prefers-reduced-motion: reduce)").matches;let u=[],d=0,f=0,h=cg,m=cg,g=null,_=null,y=0,b=-1;const x=new Array(33),S=H=>{const $=Math.round(H*32);let W=x[$];if(!W){const X=$/32,z=Math.round(va[0]+(255-va[0])*X),K=Math.round(va[1]+(255-va[1])*X),te=Math.round(va[2]+(255-va[2])*X);W=`rgba(${z}, ${K}, ${te}, ${rI})`,x[$]=W}return W},E=H=>{const $=1-.35*H,W=Math.round(va[0]*$),X=Math.round(va[1]*$),z=Math.round(va[2]*$);return`rgba(${W}, ${X}, ${z}, ${rI})`},C=H=>{let $=Math.floor(Math.random()*ub.length);$===b&&($=($+1)%ub.length),b=$;const W=[0,0,0,0],X=ub[$].map((j,Y)=>{const ue=j.level,ie=W[ue]++,ce=Zde[ue]+ie*Bde[ue],he=Wde[ue]+ug($*131+Y*17+5)*.2;if(j.hline){const pe=$c((j.y??0)*f,m);return{hline:!0,x1:$c(j.x1*d,h),x2:$c(j.x2*d,h),y1:pe,y2:pe,level:ue,start:ce,dur:he}}const ke=$c(j.x1*d,h),ve=$c((j.y1??0)*f,m);return{hline:!1,x1:ke,y1:ve,x2:Math.max($c(j.x2*d,h),ke+h),y2:Math.max($c((j.y2??0)*f,m),ve+m),level:ue,start:ce,dur:he}}),z=X.reduce((j,Y)=>Math.max(j,Y.start+Y.dur),0),K=u.length,te=new Float32Array(K*Dc),Z=new Int16Array(K*Dc).fill(-1),J=new Uint8Array(K),q=X[0];for(let j=0;j<K;j++){const Y=u[j];Y.x>q.x1&&Y.x<q.x2&&Y.y>q.y1&&Y.y<q.y2&&(J[j]=1);const ue=j*Dc;for(let ie=0;ie<X.length;ie++){const ce=Gde(Y.x,Y.y,X[ie]);if(ce<=.02)continue;let he=ue;for(let ke=ue;ke<ue+Dc;ke++){if(Z[ke]===-1){he=ke;break}te[ke]<te[he]&&(he=ke)}(Z[he]===-1||ce>te[he])&&(te[he]=ce,Z[he]=ie)}}return{startT:H,buildEnd:z,els:X,frame:q,cellQ:te,cellEl:Z,inFrame:J}},R=()=>{const H=i.getBoundingClientRect();d=Math.max(1,H.width),f=Math.max(1,H.height);const $=Math.min(2,window.devicePixelRatio||1);i.width=Math.round(d*$),i.height=Math.round(f*$),o.setTransform($,0,0,$,0,0);const W=Math.max(8,Math.round(d/cg)),X=Math.max(6,Math.round(f/cg));h=d/W,m=f/X,u=[];for(let z=0;z<X;z++){const K=X>1?z/(X-1):.5,te=Fde*(1+jde*.4*(K*2-1));for(let Z=0;Z<W;Z++){const J=z*8191+Z*131+1,q={x:(Z+.5)*h,y:(z+.5)*m,size:te,seed:J,phase:ug(J),kind:0};q.kind=Math.floor(ug(J*97)*3),u.push(q)}}_=null,g=null},O=new Float32Array(32),I=H=>{o.fillStyle=Nde,o.fillRect(0,0,d,f),g||(g=C(H+.2)),H>=g.startT+g.buildEnd+zde&&(_=g,y=H,g=C(H+.2));let $=0;_&&($=1-Hg((H-y)/Vde),$<=0&&(_=null));const W=g;for(let q=0;q<W.els.length;q++){const j=W.els[q];O[q]=Hg(Math.min(1,Math.max(0,(H-W.startT-j.start)/j.dur)))}const X=O[0],z=E(0),K=E(X),te=$>0?E($):z,Z=$>0?E(Math.max(X,$)):K,J=u.length;for(let q=0;q<J;q++){const j=u[q];let Y=0,ue=0;const ie=q*Dc;for(let Ae=ie;Ae<ie+Dc;Ae++){const $e=W.cellEl[Ae];if($e<0)break;const kt=W.cellQ[Ae]*O[$e];kt>Y&&(Y=kt,ue=W.els[$e].level)}if(_)for(let Ae=ie;Ae<ie+Dc;Ae++){const $e=_.cellEl[Ae];if($e<0)break;const kt=_.cellQ[Ae]*$;kt>Y&&(Y=kt,ue=_.els[$e].level)}const ce=H/Dde+j.phase,he=Math.floor(ce),ke=ce-he,ve=Hg(Math.min(ke,1-ke)/$de),pe=Math.floor(ug(j.seed*97+he*7919)*3);pe!==j.kind&&Y<.02&&ve<.05&&(j.kind=pe);const Ne=Math.max(ve*(1-Y),Y);if(!(Ne<.01))if(Y<.02){const Ae=W.inFrame[q]===1,$e=_?_.inFrame[q]===1:!1;Ae?o.fillStyle=$e?Z:K:o.fillStyle=$e?te:z;const kt=Math.max(Ae?X:0,$e?$:0);iI(o,j.kind,j.x,j.y,j.size*Ne*(1-.2*kt))}else{o.fillStyle=S(Y);const Ae=1+(Ude[ue]-1)*Y;iI(o,j.kind,j.x,j.y,j.size*Ne*Ae)}}};R();let A=0;if(l)g=C(-100),I(0);else{const H=performance.now(),$=W=>{I((W-H)/1e3),A=requestAnimationFrame($)};A=requestAnimationFrame($)}const L=new ResizeObserver(()=>{R(),l&&(g=C(-100),I(0))});L.observe(i),r.current=()=>{cancelAnimationFrame(A),L.disconnect(),e&&n(H=>H-1)}},[e,n]);return T.jsx("canvas",{ref:s,"aria-hidden":"true",className:`h-full w-full ${t}`.trim()})},qde=[["Problem","problem"],["Reason code","reasonCode"],["Rivet detail","reasonDetail"],["Next step","nextStep"],["Rivet version","rivetVersion"],["Node.js version (Rivet runtime)","nodeVersion"],["Direction","directionLabel"],["Direction ref","directionRef"],["Rivet session","sessionId"]],Yde=t=>{var n;const e=[];for(const[r,s]of qde){const i=(n=t[s])==null?void 0:n.trim();i&&e.push(`${r}: ${i}`)}return e.join(`
200
- `)},oI={kind:"base"};function aI(t){return t.kind==="base"?"base":`variant:${t.sessionId}:${t.variantId}`}const Xde=async(t=null)=>{if(t)return Qde(t);let e;try{e=await Dt("/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 dg();if(!e.ok)return{isOk:!1,unavailableReason:"rivet_unreachable",upstreamStatus:null};let r;try{r=await e.json()}catch{return dg()}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}:dg()},t9=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}}},Qde=t=>t9(t),dg=()=>t9("/"),db=ti("usePreviewUpstreamHealth"),Jde=500,efe=4e3,tfe=15e3,nfe=3,rfe={completedProbeCount:0,isUpstreamReady:!1,unavailableReason:"upstream_unreachable",isFirstUnreachableWindowExceeded:!1,hasCapturedFirstReady:!1,hasCapturedUnreachable:!1,downSince:null,everReady:!1,consecutiveServerErrors:0,hasFiredPersistentErrorHook:!1,lastUpstreamStatus:null},sfe=({history:t,outcome:e,now:n,startedAt:r,firstUnreachableCaptureAfterMs:s})=>{const i=[],{upstreamStatus:o}=e,l=e.isOk&&o!==null&&o>=500;let u=t.consecutiveServerErrors;l&&t.everReady?u+=1:e.isOk&&!l&&(u=0);const d=u>=nfe;let f=t.hasFiredPersistentErrorHook;d&&!f&&o!==null&&(f=!0,i.push({kind:"persistent_server_errors",upstreamStatus:o,consecutiveCount:u}));const h={...t,completedProbeCount:t.completedProbeCount+1,lastUpstreamStatus:o,consecutiveServerErrors:u,hasFiredPersistentErrorHook:f};if(e.isOk&&!d)return t.hasCapturedFirstReady?t.isUpstreamReady||i.push({kind:"restored"}):i.push({kind:"first_ready",readyAfterMs:n-r}),{history:{...h,everReady:h.everReady||!l,hasFiredPersistentErrorHook:h.hasFiredPersistentErrorHook&&l,isUpstreamReady:!0,unavailableReason:null,downSince:null,hasCapturedUnreachable:!1,isFirstUnreachableWindowExceeded:!1,hasCapturedFirstReady:!0},events:i};const m=t.downSince===null,g=t.downSince??n;let _=m?!1:t.hasCapturedUnreachable,y=m?!1:t.isFirstUnreachableWindowExceeded;t.isUpstreamReady&&i.push({kind:"lost",upstreamStatus:o});const b=n-g;return b>=s&&!_&&(_=!0,y=!0,i.push({kind:"first_unreachable",elapsedMs:b,upstreamStatus:o})),{history:{...h,isUpstreamReady:!1,unavailableReason:e.unavailableReason,downSince:g,hasCapturedUnreachable:_,isFirstUnreachableWindowExceeded:y},events:i}},lI=(t,e)=>({id:e,identity:t,startedAt:Date.now()}),ife=(t,e={})=>{const n=v.useId(),r=e.probeMsWhileDown??Jde,s=e.probeMsWhileUp??efe,i=e.firstUnreachableCaptureAfterMs??tfe,o=e.probePath??null,l=e.skip??!1,u=t!=="static"&&!l,d=Kp(e.onPersistentUpstreamServerErrors),f=u?JSON.stringify([t,o,r,s,i]):null,[h,m]=v.useState(()=>lI(f,0)),g=h.identity===f?h:lI(f,h.id+1);g!==h&&m(g);const[_,y]=v.useState(0),b=v.useRef(null),x=C=>{var R;switch(C.kind){case"persistent_server_errors":Xe==null||Xe.capture("preview_upstream_error_responses",{framework:t,upstream_status:C.upstreamStatus,consecutive_count:C.consecutiveCount}),db.warn(`Preview upstream is listening but has served ${C.consecutiveCount} consecutive ${C.upstreamStatus} responses`),(R=d.current)==null||R.call(d,{upstreamStatus:C.upstreamStatus,consecutiveCount:C.consecutiveCount});return;case"first_ready":Xe==null||Xe.capture("preview_dev_server_ready",{framework:t,ready_after_ms:C.readyAfterMs});return;case"restored":Xe==null||Xe.capture("preview_upstream_restored",{framework:t});return;case"lost":Xe==null||Xe.capture("preview_upstream_lost",{framework:t,upstream_status:C.upstreamStatus}),y(O=>O+1),db.warn("Preview upstream became unavailable after it was ready");return;case"first_unreachable":Xe==null||Xe.capture("preview_dev_server_unreachable",{framework:t,elapsed_ms:C.elapsedMs,upstream_status:C.upstreamStatus}),db.warn("Dev server did not become ready within timeout window");return;default:{const O=C;throw new Error(`Unhandled probe event: ${String(O)}`)}}},S=Qo({queryKey:Ks.previewUpstreamHealth({instanceId:n,sessionId:g.id,rerunVersion:e.rerunProbeImmediatelyOnVersion??null}),queryFn:async({signal:C})=>{var L;const R=await Xde(o),O=((L=b.current)==null?void 0:L.sessionId)===g.id?b.current.history:rfe;if(C.aborted)return O;const{history:I,events:A}=sfe({history:O,outcome:R,now:Date.now(),startedAt:g.startedAt,firstUnreachableCaptureAfterMs:i});return b.current={sessionId:g.id,history:I},A.forEach(x),I},enabled:u,placeholderData:(C,R)=>(R==null?void 0:R.queryKey[1].sessionId)===g.id?C:void 0,refetchInterval:C=>{var R;return(R=C.state.data)!=null&&R.isUpstreamReady?s:r},refetchIntervalInBackground:!0,refetchOnWindowFocus:!1,refetchOnReconnect:!1,retry:!1,gcTime:0,networkMode:"always"});if(t==="static")return{isUpstreamReady:!0,iframeRemountKey:_,probeStartedAt:null,probeAttemptCount:0,isFirstUnreachableWindowExceeded:!1,initialProbeComplete:!0,unavailableReason:null};if(l)return{isUpstreamReady:!1,iframeRemountKey:_,probeStartedAt:null,probeAttemptCount:0,isFirstUnreachableWindowExceeded:!1,initialProbeComplete:!0,unavailableReason:"upstream_unreachable"};const E=S.data;return{isUpstreamReady:(E==null?void 0:E.isUpstreamReady)??!1,iframeRemountKey:_,probeStartedAt:g.startedAt,probeAttemptCount:((E==null?void 0:E.completedProbeCount)??0)+(S.isFetching?1:0),isFirstUnreachableWindowExceeded:(E==null?void 0:E.isFirstUnreachableWindowExceeded)??!1,initialProbeComplete:E!==void 0,unavailableReason:E?E.unavailableReason:"upstream_unreachable"}};function ofe(t){return t.enteringSplit&&t.isExistingSession&&t.hasActiveVariantProxy}const n9=t=>{var r;if(typeof window>"u")return"";const e=(r=window.__RIVET_BOOTSTRAP__)==null?void 0:r.previewOrigin;if(e)return e;const n=new URL(window.location.origin);return n.hostname="localhost",n.origin},Hx=({agentApplyMode:t,url:e})=>e.startsWith("/")?`${n9()}${e}`:e,afe="allow-scripts allow-same-origin allow-forms allow-popups allow-modals",lfe=t=>afe,cfe=ti("PreviewSurface"),Lh=(t,e)=>t==="about:blank"?"blank":t.includes("/api/variants/")?"static_artifact":e.kind==="variant"?"dev_server":"original",Ux=({target:t,src:e,framework:n,remountKey:r,isActive:s=!0})=>{bt(Uy);const i=xi(),o=v.useRef(!1),l=v.useRef(s),u=v.useCallback(f=>{t.kind==="variant"&&(i==null||i.capture("variants_panel.preview_displayed",{sessionId:t.sessionId,variantId:t.variantId,renderedTarget:"variant",iframeSrcKind:Lh(e,t),framework:n,isReused:f}))},[n,i,e,t]),d=v.useCallback(f=>{f&&(s&&!l.current&&o.current&&u(!0),l.current=s)},[u,s]);return T.jsx("div",{ref:d,className:"relative h-full w-full",children:T.jsx("iframe",{src:e,className:"h-full w-full border-none",title:s?"Project Preview":"Retained Project Preview",tabIndex:s?void 0:-1,sandbox:lfe(),onLoad:()=>{o.current=!0,i==null||i.capture("preview_iframe_loaded",{framework:n,src_kind:Lh(e,t)}),s&&u(!1)},onError:()=>{i==null||i.capture("preview_iframe_load_failed",{framework:n,src_kind:Lh(e,t)}),s&&t.kind==="variant"&&(i==null||i.capture("variants_panel.preview_display_failed",{sessionId:t.sessionId,variantId:t.variantId,renderedTarget:"variant",iframeSrcKind:Lh(e,t),framework:n})),cfe.warn("Preview iframe failed to load",{framework:n,src_kind:Lh(e,t)})}},r)})},ufe=7,dfe=t=>{const e=aI(t.target),n=`${e}:${t.src}`,r=t.src==="about:blank",[s,i]=v.useState(()=>({selectedKey:n,remountKey:t.remountKey,selection:0,frames:r?[]:[{key:n,props:t,lastSelected:0}]}));if(s.selectedKey!==n||s.remountKey!==t.remountKey){const o=s.selection+1,l=s.remountKey!==t.remountKey;let u=s.frames.filter(d=>!l||aI(d.props.target)!==e);if(!r){const d=u.find(f=>f.key===n);if(d?u=u.map(f=>f===d?{...f,lastSelected:o}:f):u=[...u,{key:n,props:t,lastSelected:o}],u.length>ufe){const f=u.reduce((h,m)=>m.lastSelected<h.lastSelected?m:h);u=u.filter(h=>h!==f)}}i({selectedKey:n,remountKey:t.remountKey,selection:o,frames:u})}return T.jsxs("div",{className:"relative h-full w-full",children:[s.frames.map(o=>{const l=!r&&o.key===n;return T.jsx("div",{className:"absolute inset-0",style:{visibility:l?"visible":"hidden",pointerEvents:l?"auto":"none"},"aria-hidden":!l,children:T.jsx(Ux,{...o.props,isActive:l})},`${o.key}:${o.props.remountKey??""}`)}),r?T.jsx(Ux,{...t}):null]})},ffe=v.lazy(()=>YI(()=>Promise.resolve().then(()=>Yhe),void 0)),hfe={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"},pfe={sm:"text-lg font-semibold text-content",md:"text-2xl font-semibold text-content",lg:"text-3xl font-semibold text-content"},mfe={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"},fu=({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:m=""})=>{const g=v.useCallback(y=>{y&&d&&(Xe==null||Xe.capture("status_surface_shown",{state:d,tone:i,fill:o}))},[d,i,o]),_=!!(e||n||r||u||s!=null&&s.length);return T.jsxs("div",{ref:g,className:`${hfe[o]} ${m}`.trim(),role:f,"aria-live":"polite","aria-busy":h||void 0,"data-state":d,children:[t?T.jsx("div",{className:"absolute inset-0",children:t}):null,_?T.jsxs("div",{className:"relative z-10 flex max-w-sm flex-col items-center gap-5 text-center",children:[e,n?T.jsx("h2",{className:pfe[l],children:n}):null,r?T.jsx("p",{className:"text-content-muted text-base leading-relaxed",children:r}):null,u,s!=null&&s.length?T.jsx("div",{className:"flex flex-row items-center gap-3",children:s.map(y=>T.jsx("button",{type:"button",onClick:y.onClick,className:mfe[y.variant??"neutral"],children:y.label},y.label))}):null]}):null]})},cI=({loader:t="coalesce",trackGlobalLoaderCount:e,size:n="lg",...r})=>t==="coalesce"?T.jsx(fu,{...r,size:n,busy:!0,backdrop:T.jsx(e9,{trackGlobalLoaderCount:e})}):t==="logo"?T.jsx(fu,{...r,size:n,busy:!0,backdrop:T.jsx(v.Suspense,{fallback:null,children:T.jsx(ffe,{className:"absolute inset-0"})})}):T.jsx(fu,{...r,size:n,busy:!0,media:T.jsx(Ik,{"aria-hidden":!0,className:"text-content h-8 w-8 shrink-0 animate-spin",weight:"bold"})}),gfe=({icon:t,...e})=>T.jsx(fu,{...e,tone:"neutral",media:t?T.jsx("div",{className:"text-content-muted",children:t}):void 0}),r9=t=>T.jsx(fu,{...t,tone:"error",role:"alert"}),uI="/static/",vfe=t=>{try{return new URL(t,"http://localhost").pathname.endsWith(uI)}catch{return t.endsWith(uI)}},dI="The direction is saved, but Rivet couldn’t prepare its preview.",yfe={spawn_error:{summary:"The direction is saved, but its preview process didn’t start."},exited:{summary:"The direction is saved, but its preview stopped before it was ready."},timeout:{summary:"The direction is saved, but its preview took too long to become ready."},dependency_install_failed:{summary:"The direction is saved, but its dependencies couldn’t be prepared.",nextStep:"Fix the installation error, then retry the preview."},compile_error:{summary:"The direction is saved, but its app couldn’t compile.",nextStep:"Fix the app error, then retry the preview."},missing_dev_script:{summary:"The direction is saved, but Rivet couldn’t find a dev script to preview it."},missing_static_entry:{summary:"The direction is saved, but Rivet couldn’t find an HTML entry to preview it."},idle_timeout:{summary:dI},unknown:{summary:dI}},_fe=t=>t.nextStep?`${t.summary} ${t.nextStep}`:t.summary,wfe=t=>({label:"Copy for agent",onClick:()=>void kF({text:t,copyKind:"failure_report"})}),bfe=(t,e)=>{if(t.status==="failed"&&t.errorCode==="VARIANT_VERIFICATION_UNAVAILABLE")return{state:"variant_verification_unavailable",title:"Rivet couldn’t verify this direction",description:"The worker completed, but Rivet couldn’t inspect its generated files.",detail:t.errorMessage??t.errorCode,isError:!0};if(t.status==="failed"&&t.errorCode==="VARIANT_QA_FAILED")return{state:"variant_output_integrity_failed",title:"This direction couldn’t be verified",description:"The worker completed, but Rivet found a structural problem in the generated files.",detail:t.errorMessage??t.errorCode,isError:!0};if(t.status==="failed")return{state:"variant_worker_failed",title:"This direction didn’t complete",description:"The worker stopped before producing a usable result.",detail:t.errorMessage??t.errorCode,isError:!0};if(t.status==="cancelled")return{state:"variant_cancelled",title:"Direction was cancelled",description:"Rivet stopped before a preview was ready. Your other directions are unchanged.",isError:!1};if(t.status==="succeeded"&&t.previewUnavailable&&t.previewUnavailable.reason!=="idle_timeout"){const n=t.previewUnavailable,r=n.portInUse?"The preview port was already in use.":void 0,s=yfe[n.reason],i="Rivet couldn’t preview this direction";return{state:"preview_unavailable",title:i,description:_fe(s),detail:n.detail??r,isError:!0,agentPastePackage:Yde({problem:`${i}. ${s.summary}`,reasonCode:n.reasonCode,reasonDetail:n.reasonDetail,nextStep:s.nextStep,rivetVersion:"0.28.1",nodeVersion:n.nodeVersion,directionLabel:t.label,directionRef:t.directionRef,sessionId:e})}}return null},xfe=({issue:t,retryTarget:e})=>{const n=xi(),r=v.useRef(!1),[s,i]=v.useState(!1),[o,l]=v.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 f=await Dt(`/api/variants/${encodeURIComponent(e.sessionId)}/preview-port`,{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({variantId:e.variantId,retry:!0})});if(!f.ok){const h=OY.safeParse(await f.json().catch(()=>({})));throw new Error(h.success?h.data.message:"The preview could not restart. Try again.")}}catch(f){l(Us(f,"The preview could not restart. Try again."))}finally{r.current=!1,i(!1)}}},d=[...e&&!s?[{label:"Retry preview",onClick:()=>void u()}]:[],...t.agentPastePackage?[wfe(t.agentPastePackage)]:[]];return T.jsxs(fu,{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:d,children:[s?T.jsx("p",{className:"text-content-subtle text-xs",children:"Starting preview…"}):null,o?T.jsx("p",{className:"text-content-subtle text-xs",children:o}):null,t.detail?T.jsx("p",{"data-rivet-private":!0,className:"ph-no-capture text-content-subtle max-h-40 overflow-auto text-xs leading-relaxed break-words whitespace-pre-wrap",children:t.detail}):null]})},Sfe=({isInteractionDisabled:t=!1,framework:e,userPort:n})=>{var Qt;const r=bt(Vy),s=bt(Ox),i=Mt(Ox),o=bt(Bv),l=Mt(Bv),u=bt(km),d=bt(Uy),f=bt(Mx),h=bt(Lx),m=bt(yF),g=bt(_F),_=Mt(Lx),y=bt(nc),b=bt(Vg),x=Mt(Mx),S=u.active&&u.projectContext.kind==="fresh",E=bt(zg),C=u.active?u.variants.find(Me=>Me.workItemId===E&&(Me.status==="pending"||Me.status==="running"||Me.status==="succeeded"&&!Me.preview&&typeof Me.port!="number"&&(!Me.previewUnavailable||Me.previewUnavailable.reason==="idle_timeout")))??null:null,R=u.active&&u.variants.some(Me=>Me.status==="pending"||Me.status==="running"),O=S||R,I=u.active?u.variants.find(Me=>Me.workItemId===E)??null:null,A=u.active&&I?bfe(I,u.sessionId):null,L=e==="static"&&o!==null&&vfe(o);v.useEffect(()=>{u.active||x(!1)},[u.active,x]);const N=v.useRef(!1);v.useEffect(()=>{const Me=!!(y!=null&&y.left||y!=null&&y.right),Qe=Me&&!N.current;N.current=Me;const Te=u.active?u.sessionId:null;!Te||!ofe({enteringSplit:Qe,isExistingSession:u.active&&u.projectContext.kind==="existing",hasActiveVariantProxy:f&&h!==null})||(x(!1),_(null),i(St=>St+1),Dt(`/api/variants/${encodeURIComponent(Te)}/preview-port`,{method:"POST",headers:{"content-type":"application/json"},body:JSON.stringify({variantId:null})}).catch(()=>{}))},[y,u,f,h,x,_,i]);const $=v.useMemo(()=>{var Nt;if(f||o&&!L||!u.active)return null;const{stage:Me,variants:Qe}=u,Te=Me==="ready"||Me==="degraded",St=Qe.some(ft=>{var pt,qn;return((pt=ft.refinement)==null?void 0:pt.status)==="pending"||((qn=ft.refinement)==null?void 0:qn.status)==="running"});if(!Te&&!St)return null;const be=Qe.find(ft=>{var pt;return ft.status==="succeeded"&&((pt=ft.preview)==null?void 0:pt.kind)==="static_artifact"});return((Nt=be==null?void 0:be.preview)==null?void 0:Nt.kind)==="static_artifact"?uu({sessionId:u.sessionId,variant:be,projectContext:u.projectContext}):null},[L,o,f,u])??o,W=v.useMemo(()=>!u.active||!$?null:u.variants.find(Me=>{var Qe;return((Qe=Me.preview)==null?void 0:Qe.kind)==="static_artifact"&&$.startsWith(Me.preview.url)})??null,[$,u]),X=v.useMemo(()=>{if((b==null?void 0:b.previewKind)==="static"||(b==null?void 0:b.previewKind)==="dev_server"&&b.previewError||(b==null?void 0:b.previewKind)==="dev_server"&&$&&N3($))return{kind:"variant",sessionId:b.sessionId,variantId:b.variantId};if(!u.active)return oI;if(W)return{kind:"variant",sessionId:u.sessionId,variantId:W.workItemId};if($){const Qe=$.match(/\/__rivet\/preview\/variant\/([^/]+)\/([^/?#]+)/),Te=Qe!=null&&Qe[1]?decodeURIComponent(Qe[1]):null,St=Qe!=null&&Qe[2]?decodeURIComponent(Qe[2]):null;if(Te===u.sessionId&&St&&u.variants.some(ft=>ft.workItemId===St))return{kind:"variant",sessionId:u.sessionId,variantId:St};const be=$.match(/\/api\/variants\/[^/]+\/static\/([^/?#]+)/),Nt=be!=null&&be[1]?decodeURIComponent(be[1]):null;if(Nt&&u.variants.some(ft=>ft.workItemId===Nt))return{kind:"variant",sessionId:u.sessionId,variantId:Nt}}const Me=!!(y!=null&&y.left||y!=null&&y.right);return(!Me||S)&&!$&&f&&h&&u.variants.some(Qe=>Qe.workItemId===h)?{kind:"variant",sessionId:u.sessionId,variantId:h}:(!Me||S)&&!$&&E&&u.variants.some(Qe=>Qe.workItemId===E)?{kind:"variant",sessionId:u.sessionId,variantId:E}:oI},[b,W,u,f,h,$,y,S,E]),z=v.useRef(null);v.useEffect(()=>{var St,be,Nt;if(!W||((St=W.preview)==null?void 0:St.kind)!=="static_artifact"||((be=W.refinement)==null?void 0:be.status)!=="succeeded")return;const Me=`${W.workItemId}:${W.refinement.workItemId}`;if(z.current===Me)return;if(z.current=Me,(Nt=W.previewRoutes)!=null&&Nt.length){i(ft=>ft+1);return}const Qe=W.preview.url.includes("?")?"&":"?",Te=`${W.preview.url}${Qe}refinement=${encodeURIComponent(W.refinement.workItemId)}`;$!==Te&&(l(Te),i(ft=>ft+1))},[$,W,i,l,u]);const K=$!==null&&N3($),te=$!==null&&!K||S&&!f&&!K,{isUpstreamReady:Z,iframeRemountKey:J,probeAttemptCount:q,initialProbeComplete:j}=ife(e,{rerunProbeImmediatelyOnVersion:s,probePath:K?$:null,skip:te}),[Y,ue]=v.useState(()=>m&&Z?s:null),[ie,ce]=v.useState(null);m?Y!==s&&((ie==null?void 0:ie.remountKey)!==s?ce({remountKey:s,probeAttemptCount:q}):Z&&q>ie.probeAttemptCount&&ue(s)):(ie!==null&&ce(null),Y!==null&&ue(null));const ke=$!==null&&!K||Z,pe=g||m&&!K&&Y!==s||m&&!ke,Ne=`${J}:${s}`,Ae=RF(window.location.pathname),$e=e==="static"?`/static${Ae??"/"}`:Ae??"/",kt=n9();let fn=null;$&&(fn=Hx({agentApplyMode:d,url:$}));const on=K&&!ke?"about:blank":fn,Et=C||A||b!=null&&b.previewError||pe?"about:blank":on??(ke?`${kt}${$e}`:"about:blank"),Gt=!!C||!!A||!ke&&j;let vn=null;if(b!=null&&b.previewError)vn=T.jsx(fu,{fill:"overlay",size:"sm",state:"preview_replay_failed",role:"alert",tone:"error",title:"Rivet couldn’t preview this direction",description:"Select the direction again to retry.",children:T.jsx("p",{className:"text-content-subtle text-xs leading-relaxed break-words",children:b.previewError})});else if(pe)vn=T.jsx(cI,{fill:"overlay",loader:"coalesce",trackGlobalLoaderCount:!1,state:"preview_replay_boot"});else if(C)vn=T.jsx(cI,{fill:"overlay",loader:"coalesce",trackGlobalLoaderCount:!1,state:"variant_building",children:T.jsx("span",{className:"sr-only",children:"Building your direction"})});else if(A){const Me=u.active&&I&&A.state==="preview_unavailable"&&((Qt=I.previewUnavailable)==null?void 0:Qt.reason)!=="missing_static_entry"?{sessionId:u.sessionId,variantId:I.workItemId}:void 0;vn=T.jsx(xfe,{issue:A,retryTarget:Me},I==null?void 0:I.workItemId)}else Gt&&(vn=O?T.jsx(gfe,{fill:"overlay",state:"preview_no_selection",title:"Nothing to preview yet",description:"Pick a direction from the panel."}):T.jsx(r9,{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 T.jsx("div",{className:"relative flex h-full min-h-0 w-full flex-col",children:T.jsxs("div",{className:"relative min-h-0 flex-1",children:[vn,T.jsx(dfe,{target:X,src:Et,framework:e,remountKey:Ne},r)]})})};function fI({side:t,sessionId:e,variantId:n,url:r,label:s,source:i,isFallback:o=!1}){var E;const l=bt(nc),u=Mt(nc),d=xi(),f=bt(km),h=bt(Uy),m=v.useRef(!1),g=v.useCallback(()=>{m.current||(m.current=!0,Ef({source:i,sessionId:e,variantId:n}))},[i,e,n]),_=v.useCallback(()=>{if(o){u(null);const I=Wv("ended",l);d==null||d.capture(I.event,I.properties);return}g();const C={...l};delete C[t];const R=C.left||C.right?C:null;u(R);const O=Wv(R?"updated":"ended",R??l);d==null||d.capture(O.event,O.properties)},[o,d,u,t,l,g]),y=v.useMemo(()=>({kind:"variant",sessionId:e,variantId:n}),[e,n]),b=v.useMemo(()=>!f.active||f.sessionId!==e?null:f.variants.find(C=>C.workItemId===n)??null,[e,n,f]),x=v.useMemo(()=>{var R,O,I;let C=r;if(((R=b==null?void 0:b.preview)==null?void 0:R.kind)==="static_artifact"&&((O=b.refinement)==null?void 0:O.status)==="succeeded"){if((I=b.previewRoutes)!=null&&I.length)return Hx({agentApplyMode:h,url:uu({sessionId:e,variant:b,projectContext:null})??r});const A=b.preview.url.includes("?")?"&":"?";C=`${b.preview.url}${A}refinement=${encodeURIComponent(b.refinement.workItemId)}`}return Hx({agentApplyMode:h,url:C})},[h,b,e,r]),S=((E=b==null?void 0:b.refinement)==null?void 0:E.status)==="succeeded"?`${n}:${b.refinement.workItemId}`:n;return T.jsxs("div",{className:"variant-split-secondary","data-cy":"variant-split-pane","data-variant-id":n,children:[T.jsxs("div",{className:"variant-split-secondary-toolbar",children:[T.jsx("span",{className:"variant-split-secondary-label",title:s,children:s}),T.jsx(kf,{label:"Collapse",children:T.jsx("button",{type:"button",className:"variant-split-secondary-close",onClick:_,"aria-label":"Collapse split view",children:T.jsx("svg",{width:"12",height:"12",viewBox:"0 0 12 12","aria-hidden":"true",focusable:"false",children:T.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"})})})})]}),T.jsx("div",{className:"variant-split-secondary-body relative min-h-0 flex-1",children:T.jsx(Ux,{target:y,src:x,framework:"static",remountKey:S})})]})}function kfe(){const t=bt(Sf),e=bt(cE);return!t||!e?null:wm.createPortal(T.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:T.jsx("span",{className:"text-content truncate text-sm font-medium",children:t.label})}),document.body)}const hI=(t,e)=>{if(!t)return null;const n=t.getBoundingClientRect(),{x:r,y:s}=e;return r<n.left||r>n.right||s<n.top||s>n.bottom?null:r<(n.left+n.right)/2?"left":"right"};function Efe(){const t=bt(Sf),e=bt(cE),n=bt(nc),r=Mt(Sf),s=Mt(nc),i=xi(),o=v.useRef(null),[l,u]=v.useState(null),[d,f]=v.useState("hidden");if(!t&&(d!=="hidden"||l!==null)&&(f("hidden"),u(null)),v.useEffect(()=>{if(!t||!e)return;const m=hI(o.current,e);u(g=>g===m?g:m),f(g=>{if(g==="exiting")return g;const _=m!==null?"visible":"hidden";return g===_?g:_})},[t,e]),v.useEffect(()=>{if(!t)return;const m=g=>{const _=hI(o.current,{x:g.clientX,y:g.clientY});if(_&&t.url){const y={sessionId:t.sessionId,variantId:t.variantId,label:t.label,url:t.url,source:t.source},b=n==null?void 0:n[_];b&&(b.sessionId!==y.sessionId||b.variantId!==y.variantId)&&Ef(b);const x={...n??{},[_]:y};s(x);const S=Wv(n?"updated":"started",x);i==null||i.capture(S.event,S.properties),f("exiting"),window.setTimeout(()=>r(null),220)}else Ef(t),f("exiting"),window.setTimeout(()=>r(null),220)};return window.addEventListener("pointerup",m),window.addEventListener("pointercancel",m),()=>{window.removeEventListener("pointerup",m),window.removeEventListener("pointercancel",m)}},[t,i,r,s,n]),!t)return null;const h=["variant-drop-zones",d==="visible"&&"is-visible",d==="exiting"&&"is-exiting"].filter(Boolean).join(" ");return T.jsxs("div",{ref:o,className:h,"aria-hidden":"true",children:[T.jsx(pI,{side:"left",hovered:l==="left",canDrop:!!t.url,label:t.label}),T.jsx(pI,{side:"right",hovered:l==="right",canDrop:!!t.url,label:t.label})]})}function pI({side:t,hovered:e,canDrop:n,label:r}){return T.jsxs("div",{className:["variant-drop-zone",`is-${t}`,e&&"is-hover",!n&&"is-disabled"].filter(Boolean).join(" "),children:[T.jsxs("div",{className:"variant-drop-zone-inner",children:[T.jsx("div",{className:`variant-drop-zone-icon is-${t}`}),T.jsx("div",{className:"variant-drop-zone-caption",children:n?`Add ${t} split`:"Split unavailable for this direction"})]}),T.jsx("div",{className:"variant-drop-zone-preview","aria-hidden":"true",children:T.jsx("div",{className:"variant-drop-zone-preview-label",children:r})}),T.jsx("div",{className:"variant-drop-zone-border"})]})}const s9=(t,e,n)=>{var i,o,l;if(!t.active||t.sessionId!==e)return null;const r=t.variants.find(u=>u.workItemId===n);if(((i=r==null?void 0:r.preview)==null?void 0:i.kind)!=="static_artifact")return null;if((o=r.previewRoutes)!=null&&o.length)return uu({sessionId:e,variant:r,projectContext:t.projectContext});if(((l=r.refinement)==null?void 0:l.status)!=="succeeded")return r.preview.url;const s=r.preview.url.includes("?")?"&":"?";return`${r.preview.url}${s}refinement=${encodeURIComponent(r.refinement.workItemId)}`},mI=(t,e)=>{if(!t)return;const n=s9(e,t.sessionId,t.variantId);return!n||n===t.url?t:{...t,url:n}},Cfe=()=>T.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:T.jsx("div",{className:"border-main-border relative min-h-0 flex-1 overflow-hidden rounded-lg border",children:T.jsx(e9,{trackGlobalLoaderCount:!1})})}),Pfe=({isLoading:t=!1,isInteractionDisabled:e=!1})=>{const{config:n,retry:r,isLoading:s,error:i}=Lde();return s?T.jsx(Cfe,{}):i||!n?T.jsx(r9,{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:()=>{Xe==null||Xe.capture("preview_config_retry_clicked"),r()}}]}):T.jsx(Tfe,{isLoading:t,isInteractionDisabled:e,framework:n.framework,userPort:n.userPort})};function Tfe(t){const e=bt(nc),n=bt(Sf),r=bt(km),s=bt(Bv),i=e==null?void 0:e.left,o=e==null?void 0:e.right,l=v.useMemo(()=>{var R,O;if(!r.active||r.projectContext.kind!=="fresh"||!(!!i!=!!o))return;const y=(R=i??o)==null?void 0:R.variantId,b=r.variants.filter(I=>{var A;return I.status==="succeeded"&&((A=I.preview)==null?void 0:A.kind)==="static_artifact"&&I.workItemId!==y}),x=s==null?void 0:s.replace(/[?&]refinement=[^&]*$/,""),E=b.find(I=>{var A;return((A=I.preview)==null?void 0:A.kind)==="static_artifact"&&(I.preview.url===x||uu({sessionId:r.sessionId,variant:I,projectContext:r.projectContext})===s)})??b[0];if(((O=E==null?void 0:E.preview)==null?void 0:O.kind)!=="static_artifact")return;const C=s9(r,r.sessionId,E.workItemId);if(C)return{sessionId:r.sessionId,variantId:E.workItemId,label:E.label,url:C,source:"live"}},[r,i,o,s]),u=mI(i,r)??(o?l:void 0),d=mI(o,r)??(i?l:void 0),f=!i&&!!u,h=!o&&!!d,m=!!(u||d),g=T.jsx(Sfe,{isInteractionDisabled:t.isInteractionDisabled,framework:t.framework,userPort:t.userPort});return T.jsx("div",{className:"relative flex h-full min-h-0 w-full flex-1 flex-col",children:T.jsxs("div",{className:`variant-preview-region relative flex h-full min-h-0 w-full flex-1 flex-col ${n?"is-dragging":""} ${m?"is-split":""}`,children:[T.jsxs("div",{className:"variant-preview-row flex h-full min-h-0 w-full flex-1",children:[u&&T.jsx(fI,{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}`),T.jsx("div",{className:"variant-preview-primary flex h-full min-h-0 flex-1 flex-col",style:{display:u&&d?"none":void 0},"aria-hidden":!!(u&&d),children:g}),d&&T.jsx(fI,{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}`)]}),T.jsx("div",{className:"variant-preview-atmosphere","aria-hidden":"true"}),T.jsx(Efe,{}),T.jsx(kfe,{})]})})}function Sa(t){if(t===void 0)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return t}function i9(t,e){t.prototype=Object.create(e.prototype),t.prototype.constructor=t,t.__proto__=e}/*!
201
- * GSAP 3.15.1
202
- * https://gsap.com
203
- *
204
- * @license Copyright 2008-2026, GreenSock. All rights reserved.
205
- * Subject to the terms at https://gsap.com/standard-license
206
- * @author: Jack Doyle, jack@greensock.com
207
- */var yi={autoSleep:120,force3D:"auto",nullTargetWarn:1,units:{lineHeight:""}},Xp={duration:.5,overwrite:!1,delay:0},mE,qr,Dn,Vi=1e8,gn=1/Vi,Zx=Math.PI*2,Rfe=Zx/4,Afe=0,o9=Math.sqrt,Ife=Math.cos,Ofe=Math.sin,jr=function(e){return typeof e=="string"},tr=function(e){return typeof e=="function"},Ha=function(e){return typeof e=="number"},gE=function(e){return typeof e>"u"},na=function(e){return typeof e=="object"},Gs=function(e){return e!==!1},vE=function(){return typeof window<"u"},fg=function(e){return tr(e)||jr(e)},a9=typeof ArrayBuffer=="function"&&ArrayBuffer.isView||function(){},hs=Array.isArray,Mfe=/random\([^)]+\)/g,Lfe=/,\s*/g,gI=/(?:-?\.?\d|\.)+/gi,l9=/[-+=.]*\d+[.e\-+]*\d*[e\-+]*\d*/g,Ad=/[-+=.]*\d+[.e-]*\d*[a-z%]*/g,fb=/[-+=.]*\d+\.?\d*(?:e-|e\+)?\d*/gi,c9=/[+-]=-?[.\d]+/,Nfe=/[^,'"\[\]\s]+/gi,Dfe=/^[+\-=e\s\d]*\d+[.\d]*([a-z]*|%)\s*$/i,Un,Do,Bx,yE,wi={},Gv={},u9,d9=function(e){return(Gv=Pf(e,wi))&&Qs},_E=function(e,n){return console.warn("Invalid property",e,"set to",n,"Missing plugin? gsap.registerPlugin()")},Qp=function(e,n){return!n&&console.warn(e)},f9=function(e,n){return e&&(wi[e]=n)&&Gv&&(Gv[e]=n)||wi},Jp=function(){return 0},$fe={suppressEvents:!0,isStart:!0,kill:!1},Ug={suppressEvents:!0,kill:!1},Ffe={suppressEvents:!0},wE={},Bl=[],Wx={},h9,ui={},hb={},vI=30,Zg=[],bE="",xE=function(e){var n=e[0],r,s;if(na(n)||tr(n)||(e=[e]),!(r=(n._gsap||{}).harness)){for(s=Zg.length;s--&&!Zg[s].targetTest(n););r=Zg[s]}for(s=e.length;s--;)e[s]&&(e[s]._gsap||(e[s]._gsap=new N9(e[s],r)))||e.splice(s,1);return e},hu=function(e){return e._gsap||xE(Hi(e))[0]._gsap},p9=function(e,n,r){return(r=e[n])&&tr(r)?e[n]():gE(r)&&e.getAttribute&&e.getAttribute(n)||r},qs=function(e,n){return(e=e.split(",")).forEach(n)||e},ir=function(e){return Math.round(e*1e5)/1e5||0},Hn=function(e){return Math.round(e*1e7)/1e7||0},Vd=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},jfe=function(e,n){for(var r=n.length,s=0;e.indexOf(n[s])<0&&++s<r;);return s<r},qv=function(){var e=Bl.length,n=Bl.slice(0),r,s;for(Wx={},Bl.length=0,r=0;r<e;r++)s=n[r],s&&s._lazy&&(s.render(s._lazy[0],s._lazy[1],!0)._lazy=0)},SE=function(e){return!!(e._initted||e._startAt||e.add)},m9=function(e,n,r,s){Bl.length&&!qr&&qv(),e.render(n,r,!!(qr&&n<0&&SE(e))),Bl.length&&!qr&&qv()},g9=function(e){var n=parseFloat(e);return(n||n===0)&&(e+"").match(Nfe).length<2?n:jr(e)?e.trim():e},v9=function(e){return e},bi=function(e,n){for(var r in n)r in e||(e[r]=n[r]);return e},zfe=function(e){return function(n,r){for(var s in r)s in n||s==="duration"&&e||s==="ease"||(n[s]=r[s])}},Pf=function(e,n){for(var r in n)e[r]=n[r];return e},yI=function t(e,n){for(var r in n)r!=="__proto__"&&r!=="constructor"&&r!=="prototype"&&(e[r]=na(n[r])?t(e[r]||(e[r]={}),n[r]):n[r]);return e},Yv=function(e,n){var r={},s;for(s in e)s in n||(r[s]=e[s]);return r},gp=function(e){var n=e.parent||Un,r=e.keyframes?zfe(hs(e.keyframes)):bi;if(Gs(e.inherit))for(;n;)r(e,n.vars.defaults),n=n.parent||n._dp;return e},Vfe=function(e,n){for(var r=e.length,s=r===n.length;s&&r--&&e[r]===n[r];);return r<0},y9=function(e,n,r,s,i){var o=e[s],l;if(i)for(l=n[i];o&&o[i]>l;)o=o._prev;return o?(n._next=o._next,o._next=n):(n._next=e[r],e[r]=n),n._next?n._next._prev=n:e[s]=n,n._prev=o,n.parent=n._dp=e,n},By=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},rc=function(e,n){e.parent&&(!n||e.parent.autoRemoveChildren)&&e.parent.remove&&e.parent.remove(e),e._act=0},pu=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},Hfe=function(e){for(var n=e.parent;n&&n.parent;)n._dirty=1,n.totalDuration(),n=n.parent;return e},Kx=function(e,n,r,s){return e._startAt&&(qr?e._startAt.revert(Ug):e.vars.immediateRender&&!e.vars.autoRevert||e._startAt.render(n,!0,s))},Ufe=function t(e){return!e||e._ts&&t(e.parent)},_I=function(e){return e._repeat?Tf(e._tTime,e=e.duration()+e._rDelay)*e:0},Tf=function(e,n){var r=Math.floor(e=Hn(e/n));return e&&r===e?r-1:r},Xv=function(e,n){return(e-n._start)*n._ts+(n._ts>=0?0:n._dirty?n.totalDuration():n._tDur)},Wy=function(e){return e._end=Hn(e._start+(e._tDur/Math.abs(e._ts||e._rts||gn)||0))},Ky=function(e,n){var r=e._dp;return r&&r.smoothChildTiming&&e._ts&&(e._start=Hn(r._time-(e._ts>0?n/e._ts:((e._dirty?e.totalDuration():e._tDur)-n)/-e._ts)),Wy(e),r._dirty||pu(r,e)),e},_9=function(e,n){var r;if((n._time||!n._dur&&n._initted||n._start<e._time&&(n._dur||!n.add))&&(r=Xv(e.rawTime(),n),(!n._dur||Cm(0,n.totalDuration(),r)-n._tTime>gn)&&n.render(r,!0)),pu(e,n)._dp&&e._initted&&e._time>=e._dur&&e._ts){if(e._dur<e.duration())for(r=e;r._dp;)r.rawTime()>=0&&r.totalTime(r._tTime),r=r._dp;e._zTime=-gn}},Uo=function(e,n,r,s){return n.parent&&rc(n),n._start=Hn((Ha(r)?r:!r&&Qv(n)&&(!e._last||e._last._start>=e._time)?e._last?e._last._start:e._time:r||e!==Un?$i(e,r,n):e._time)+n._delay),n._end=Hn(n._start+(n.totalDuration()/Math.abs(n.timeScale())||0)),y9(e,n,"_first","_last",e._sort?"_start":0),Qv(n)||(e._recent=n),s||_9(e,n),e._ts<0&&Ky(e,e._tTime),e},w9=function(e,n){return(wi.ScrollTrigger||_E("scrollTrigger",n))&&wi.ScrollTrigger.create(n,e)},b9=function(e,n,r,s,i){if(EE(e,n,i),!e._initted)return 1;if(!r&&e._pt&&!qr&&(e._dur&&e.vars.lazy!==!1||!e._dur&&e.vars.lazy)&&h9!==pi.frame)return Bl.push(e),e._lazy=[i,s],1},Zfe=function t(e){var n=e.parent;return n&&n._ts&&n._initted&&!n._lock&&(n.rawTime()<0||t(n))},Qv=function(e){var n=e.data;return n==="isFromStart"||n==="isStart"},Bfe=function(e,n,r,s){var i=e.ratio,o=n<0||!n&&(!e._start&&Zfe(e)&&!(!e._initted&&Qv(e))||(e._ts<0||e._dp._ts<0)&&!Qv(e))?0:1,l=e._rDelay,u=0,d,f,h;if(l&&e._repeat&&(u=Cm(0,e._tDur,n),f=Tf(u,l),e._yoyo&&f&1&&(o=1-o),f!==Tf(e._tTime,l)&&(i=1-o,e.vars.repeatRefresh&&e._initted&&e.invalidate())),o!==i||qr||s||e._zTime===gn||!n&&e._zTime){if(!e._initted&&b9(e,n,s,r,u))return;for(h=e._zTime,e._zTime=n||(r?gn:0),r||(r=n&&!h),e.ratio=o,e._from&&(o=1-o),e._time=0,e._tTime=u,d=e._pt;d;)d.r(o,d.d),d=d._next;n<0&&Kx(e,n,r,!0),e._onUpdate&&!r&&mi(e,"onUpdate"),u&&e._repeat&&!r&&e.parent&&mi(e,"onRepeat"),(n>=e._tDur||n<0)&&e.ratio===o&&(o&&rc(e,1),!r&&!qr&&(mi(e,o?"onComplete":"onReverseComplete",!0),e._prom&&e._prom()))}else e._zTime||(e._zTime=n)},Wfe=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}},Rf=function(e,n,r,s){var i=e._repeat,o=Hn(n)||0,l=e._tTime/e._tDur;return l&&!s&&(e._time*=o/e._dur),e._dur=o,e._tDur=i?i<0?1e10:Hn(o*(i+1)+e._rDelay*i):o,l>0&&!s&&Ky(e,e._tTime=e._tDur*l),e.parent&&Wy(e),r||pu(e.parent,e),e},wI=function(e){return e instanceof Vs?pu(e):Rf(e,e._dur)},Kfe={_start:0,endTime:Jp,totalDuration:Jp},$i=function t(e,n,r){var s=e.labels,i=e._recent||Kfe,o=e.duration()>=Vi?i.endTime(!1):e._dur,l,u,d;return jr(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*(hs(r)?r[0]:r).totalDuration()),l>1?t(e,n.substr(0,l-1),r)+u:o+u)):n==null?o:+n},vp=function(e,n,r){var s=Ha(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=Gs(u.vars.inherit)&&u.parent;o.immediateRender=Gs(l.immediateRender),e<2?o.runBackwards=1:o.startAt=n[i-1]}return new hr(n[0],o,n[i+1])},uc=function(e,n){return e||e===0?n(e):n},Cm=function(e,n,r){return r<e?e:r>n?n:r},ds=function(e,n){return!jr(e)||!(n=Dfe.exec(e))?"":n[1]},Gfe=function(e,n,r){return uc(r,function(s){return Cm(e,n,s)})},Gx=[].slice,x9=function(e,n){return e&&na(e)&&"length"in e&&(!n&&!e.length||e.length-1 in e&&na(e[0]))&&!e.nodeType&&e!==Do},qfe=function(e,n,r){return r===void 0&&(r=[]),e.forEach(function(s){var i;return jr(s)&&!n||x9(s,1)?(i=r).push.apply(i,Hi(s)):r.push(s)})||r},Hi=function(e,n,r){return Dn&&!n&&Dn.selector?Dn.selector(e):jr(e)&&!r&&(Bx||!Af())?Gx.call((n||yE).querySelectorAll(e),0):hs(e)?qfe(e,r):x9(e)?Gx.call(e,0):e?[e]:[]},qx=function(e){return e=Hi(e)[0]||Qp("Invalid scope")||{},function(n){var r=e.current||e.nativeElement||e;return Hi(n,r.querySelectorAll?r:r===e?Qp("Invalid scope")||yE.createElement("div"):e)}},S9=function(e){return e.sort(function(){return .5-Math.random()})},k9=function(e){if(tr(e))return e;var n=na(e)?e:{each:e},r=mu(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 jr(s)?f=h={center:.5,edges:.5,end:1}[s]||0:!l&&u&&(f=s[0],h=s[1]),function(m,g,_){var y=(_||n).length,b=o[y],x,S,E,C,R,O,I,A,L;if(!b){if(L=n.grid==="auto"?0:(n.grid||[1,Vi])[1],!L){for(I=-Vi;I<(I=_[L++].getBoundingClientRect().left)&&L<y;);L<y&&L--}for(b=o[y]=[],x=u?Math.min(L,y)*f-.5:s%L,S=L===Vi?0:u?y*h/L-.5:s/L|0,I=0,A=Vi,O=0;O<y;O++)E=O%L-x,C=S-(O/L|0),b[O]=R=d?Math.abs(d==="y"?C:E):o9(E*E+C*C),R>I&&(I=R),R<A&&(A=R);s==="random"&&S9(b),b.max=I-A,b.min=A,b.v=y=(parseFloat(n.amount)||parseFloat(n.each)*(L>y?y-1:d?d==="y"?y/L:L:Math.max(L,y/L))||0)*(s==="edges"?-1:1),b.b=y<0?i-y:i,b.u=ds(n.amount||n.each)||0,r=r&&y<0?lhe(r):r}return y=(b[m]-b.min)/b.max||0,Hn(b.b+(r?r(y):y)*b.v)+b.u}},Yx=function(e){var n=Math.pow(10,((e+"").split(".")[1]||"").length);return function(r){var s=Hn(Math.round(parseFloat(r)/e)*e*n);return(s-s%1)/n+(Ha(r)?0:ds(r))}},E9=function(e,n){var r=hs(e),s,i;return!r&&na(e)&&(s=r=e.radius||Vi,e.values?(e=Hi(e.values),(i=!Ha(e[0]))&&(s*=s)):e=Yx(e.increment)),uc(n,r?tr(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=Vi,f=0,h=e.length,m,g;h--;)i?(m=e[h].x-l,g=e[h].y-u,m=m*m+g*g):m=Math.abs(e[h]-l),m<d&&(d=m,f=h);return f=!s||d<=s?e[f]:o,i||f===o||Ha(o)?f:f+ds(o)}:Yx(e))},C9=function(e,n,r,s){return uc(hs(e)?!n:r===!0?!!(r=0):!s,function(){return hs(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})},Yfe=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)}},Xfe=function(e,n){return function(r){return e(parseFloat(r))+(n||ds(r))}},Qfe=function(e,n,r){return T9(e,n,0,1,r)},P9=function(e,n,r){return uc(r,function(s){return e[~~n(s)]})},Jfe=function t(e,n,r){var s=n-e;return hs(e)?P9(e,t(0,e.length),n):uc(r,function(i){return(s+(i-e)%s)%s+e})},ehe=function t(e,n,r){var s=n-e,i=s*2;return hs(e)?P9(e,t(0,e.length-1),n):uc(r,function(o){return o=(i+(o-e)%i)%i||0,e+(o>s?i-o:o)})},em=function(e){return e.replace(Mfe,function(n){var r=n.indexOf("[")+1,s=n.substring(r||7,r?n.indexOf("]"):n.length-1).split(Lfe);return C9(r?s:+s[0],r?0:+s[1],+s[2]||1e-5)})},T9=function(e,n,r,s,i){var o=n-e,l=s-r;return uc(i,function(u){return r+((u-e)/o*l||0)})},the=function t(e,n,r,s){var i=isNaN(e+n)?0:function(g){return(1-g)*e+g*n};if(!i){var o=jr(e),l={},u,d,f,h,m;if(r===!0&&(s=1)&&(r=null),o)e={p:e},n={p:n};else if(hs(e)&&!hs(n)){for(f=[],h=e.length,m=h-2,d=1;d<h;d++)f.push(t(e[d-1],e[d]));h--,i=function(_){_*=h;var y=Math.min(m,~~_);return f[y](_-y)},r=n}else s||(e=Pf(hs(e)?[]:{},e));if(!f){for(u in n)kE.call(l,e,u,"get",n[u]);i=function(_){return TE(_,l)||(o?e.p:e)}}}return uc(r,i)},bI=function(e,n,r){var s=e.labels,i=Vi,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},mi=function(e,n,r){var s=e.vars,i=s[n],o=Dn,l=e._ctx,u,d,f;if(i)return u=s[n+"Params"],d=s.callbackScope||e,r&&Bl.length&&qv(),l&&(Dn=l),f=u?i.apply(d,u):i.call(d),Dn=o,f},qh=function(e){return rc(e),e.scrollTrigger&&e.scrollTrigger.kill(!!qr),e.progress()<1&&mi(e,"onInterrupt"),e},Id,R9=[],A9=function(e){if(e)if(e=!e.name&&e.default||e,vE()||e.headless){var n=e.name,r=tr(e),s=n&&!r&&e.init?function(){this._props=[]}:e,i={init:Jp,render:TE,add:kE,kill:yhe,modifier:vhe,rawVars:0},o={targetTest:0,get:0,getSetter:PE,aliases:{},register:0};if(Af(),e!==s){if(ui[n])return;bi(s,bi(Yv(e,i),o)),Pf(s.prototype,Pf(i,Yv(e,o))),ui[s.prop=n]=s,e.targetTest&&(Zg.push(s),wE[n]=1),n=(n==="css"?"CSS":n.charAt(0).toUpperCase()+n.substr(1))+"Plugin"}f9(n,s),e.register&&e.register(Qs,s,Ys)}else R9.push(e)},_n=255,Yh={aqua:[0,_n,_n],lime:[0,_n,0],silver:[192,192,192],black:[0,0,0],maroon:[128,0,0],teal:[0,128,128],blue:[0,0,_n],navy:[0,0,128],white:[_n,_n,_n],olive:[128,128,0],yellow:[_n,_n,0],orange:[_n,165,0],gray:[128,128,128],purple:[128,0,128],green:[0,128,0],red:[_n,0,0],pink:[_n,192,203],cyan:[0,_n,_n],transparent:[_n,_n,_n,0]},pb=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)*_n+.5|0},I9=function(e,n,r){var s=e?Ha(e)?[e>>16,e>>8&_n,e&_n]:0:Yh.black,i,o,l,u,d,f,h,m,g,_;if(!s){if(e.substr(-1)===","&&(e=e.substr(0,e.length-1)),Yh[e])s=Yh[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&_n,s&_n,parseInt(e.substr(7),16)/255];e=parseInt(e.substr(1),16),s=[e>>16,e>>8&_n,e&_n]}else if(e.substr(0,3)==="hsl"){if(s=_=e.match(gI),!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]=pb(u+1/3,i,o),s[1]=pb(u,i,o),s[2]=pb(u-1/3,i,o);else if(~e.indexOf("="))return s=e.match(l9),r&&s.length<4&&(s[3]=1),s}else s=e.match(gI)||Yh.transparent;s=s.map(Number)}return n&&!_&&(i=s[0]/_n,o=s[1]/_n,l=s[2]/_n,h=Math.max(i,o,l),m=Math.min(i,o,l),f=(h+m)/2,h===m?u=d=0:(g=h-m,d=f>.5?g/(2-h-m):g/(h+m),u=h===i?(o-l)/g+(o<l?6:0):h===o?(l-i)/g+2:(i-o)/g+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},O9=function(e){var n=[],r=[],s=-1;return e.split(Wl).forEach(function(i){var o=i.match(Ad)||[];n.push.apply(n,o),r.push(s+=o.length+1)}),n.c=r,n},xI=function(e,n,r){var s="",i=(e+s).match(Wl),o=n?"hsla(":"rgba(",l=0,u,d,f,h;if(!i)return e;if(i=i.map(function(m){return(m=I9(m,n,1))&&o+(n?m[0]+","+m[1]+"%,"+m[2]+"%,"+m[3]:m.join(","))+")"}),r&&(f=O9(e),u=r.c,u.join(s)!==f.c.join(s)))for(d=e.replace(Wl,"1").split(Ad),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(Wl),h=d.length-1;l<h;l++)s+=d[l]+i[l];return s+d[h]},Wl=(function(){var t="(?:\\b(?:(?:rgb|rgba|hsl|hsla)\\(.+?\\))|\\B#(?:[0-9a-f]{3,4}){1,2}\\b",e;for(e in Yh)t+="|"+e+"\\b";return new RegExp(t+")","gi")})(),nhe=/hsl[a]?\(/,M9=function(e){var n=e.join(" "),r;if(Wl.lastIndex=0,Wl.test(n))return r=nhe.test(n),e[1]=xI(e[1],r),e[0]=xI(e[0],r,O9(e[1])),!0},tm,pi=(function(){var t=Date.now,e=500,n=33,r=t(),s=r,i=1e3/240,o=i,l=[],u,d,f,h,m,g,_=function y(b){var x=t()-s,S=b===!0,E,C,R,O;if((x>e||x<0)&&(r+=x-n),s+=x,R=s-r,E=R-o,(E>0||S)&&(O=++h.frame,m=R-h.time*1e3,h.time=R=R/1e3,o+=E+(E>=i?0:i-E),C=1),S||(u=d(y)),C)for(g=0;g<l.length;g++)l[g](R,m,O,b)};return h={time:0,frame:0,tick:function(){_(!0)},deltaRatio:function(b){return m/(1e3/(b||60))},wake:function(){u9&&(!Bx&&vE()&&(Do=Bx=window,yE=Do.document||{},wi.gsap=Qs,(Do.gsapVersions||(Do.gsapVersions=[])).push(Qs.version),d9(Gv||Do.GreenSockGlobals||!Do.gsap&&Do||{}),R9.forEach(A9)),f=typeof requestAnimationFrame<"u"&&requestAnimationFrame,u&&h.sleep(),d=f||function(b){return setTimeout(b,o-h.time*1e3+1|0)},tm=1,_(2))},sleep:function(){(f?cancelAnimationFrame:clearTimeout)(u),tm=0,d=Jp},lagSmoothing:function(b,x){e=b||1/0,n=Math.min(x||33,e)},fps:function(b){i=1e3/(b||240),o=h.time*1e3+i},add:function(b,x,S){var E=x?function(C,R,O,I){b(C,R,O,I),h.remove(E)}:b;return h.remove(b),l[S?"unshift":"push"](E),Af(),E},remove:function(b,x){~(x=l.indexOf(b))&&l.splice(x,1)&&g>=x&&g--},_listeners:l},h})(),Af=function(){return!tm&&pi.wake()},zt={},rhe=/^[\d.\-M][\d.\-,\s]/,she=/["']/g,ihe=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(she,"").trim():+d,s=u.substr(l+1).trim();return n},ohe=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)},ahe=function(e){var n=(e+"").split("("),r=zt[n[0]];return r&&n.length>1&&r.config?r.config.apply(null,~e.indexOf("{")?[ihe(n[1])]:ohe(e).split(",").map(g9)):zt._CE&&rhe.test(e)?zt._CE("",e):r},lhe=function(e){return function(n){return 1-e(1-n)}},mu=function(e,n){return e&&(tr(e)?e:zt[e]||ahe(e))||n},Pu=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 qs(e,function(l){zt[l]=wi[l]=i,zt[o=l.toLowerCase()]=r;for(var u in i)zt[o+(u==="easeIn"?".in":u==="easeOut"?".out":".inOut")]=zt[l+"."+u]=i[u]}),i},L9=function(e){return function(n){return n<.5?(1-e(1-n*2))/2:.5+e((n-.5)*2)/2}},mb=function t(e,n,r){var s=n>=1?n:1,i=(r||(e?.3:.45))/(n<1?n:1),o=i/Zx*(Math.asin(1/s)||0),l=function(f){return f===1?1:s*Math.pow(2,-10*f)*Ofe((f-o)*i)+1},u=e==="out"?l:e==="in"?function(d){return 1-l(1-d)}:L9(l);return i=Zx/i,u.config=function(d,f){return t(e,d,f)},u},gb=function t(e,n){n===void 0&&(n=1.70158);var r=function(o){return o?--o*o*((n+1)*o+n)+1:0},s=e==="out"?r:e==="in"?function(i){return 1-r(1-i)}:L9(r);return s.config=function(i){return t(e,i)},s};qs("Linear,Quad,Cubic,Quart,Quint,Strong",function(t,e){var n=e<5?e+1:e;Pu(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})});zt.Linear.easeNone=zt.none=zt.Linear.easeIn;Pu("Elastic",mb("in"),mb("out"),mb());(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};Pu("Bounce",function(o){return 1-i(1-o)},i)})(7.5625,2.75);Pu("Expo",function(t){return Math.pow(2,10*(t-1))*t+t*t*t*t*t*t*(1-t)});Pu("Circ",function(t){return-(o9(1-t*t)-1)});Pu("Sine",function(t){return t===1?1:-Ife(t*Rfe)+1});Pu("Back",gb("in"),gb("out"),gb());zt.SteppedEase=zt.steps=wi.SteppedEase={config:function(e,n){e===void 0&&(e=1);var r=1/e,s=e+(n?0:1),i=n?1:0,o=1-gn;return function(l){return((s*Cm(0,o,l)|0)+i)*r}}};Xp.ease=zt["quad.out"];qs("onComplete,onUpdate,onStart,onRepeat,onReverseComplete,onInterrupt",function(t){return bE+=t+","+t+"Params,"});var N9=function(e,n){this.id=Afe++,e._gsap=this,this.target=e,this.harness=n,this.get=n?n.get:p9,this.set=n?n.getSetter:PE},nm=(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,Rf(this,+n.duration,1,1),this.data=n.data,Dn&&(this._ctx=Dn,Dn.data.push(this)),tm||pi.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,Rf(this,this._repeat<0?r:(r-this._repeat*this._rDelay)/(this._repeat+1))):this._tDur},e.totalTime=function(r,s){if(Af(),!arguments.length)return this._tTime;var i=this._dp;if(i&&i.smoothChildTiming&&this._ts){for(Ky(this,r),!i._dp||i.parent||_9(i,this);i&&i.parent;)i.parent._time!==i._start+(i._ts>=0?i._tTime/i._ts:(i.totalDuration()-i._tTime)/-i._ts)&&i.totalTime(i._tTime,!0),i=i.parent;!this.parent&&this._dp.autoRemoveChildren&&(this._ts>0&&r<this._tDur||this._ts<0&&r>0||!this._tDur&&!r)&&Uo(this._dp,this,this._start-this._delay)}return(this._tTime!==r||!this._dur&&!s||this._initted&&Math.abs(this._zTime)===gn||!this._initted&&this._dur&&r||!r&&!this._initted&&(this.add||this._ptLookup))&&(this._ts||(this._pTime=r),m9(this,r,s)),this},e.time=function(r,s){return arguments.length?this.totalTime(Math.min(this.totalDuration(),r+_I(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)+_I(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?Tf(this._tTime,i)+1:1},e.timeScale=function(r,s){if(!arguments.length)return this._rts===-gn?0:this._rts;if(this._rts===r)return this;var i=this.parent&&this._ts?Xv(this.parent._time,this):this._tTime,o=this._rts<0;this._rts=+r||0,this._ts=this._ps||r===-gn?0:this._rts;var l=this.totalDuration();return(o!==this._rts<0||i>0&&i<l)&&this.totalTime(Cm(-Math.abs(this._delay),l,i),s!==!1),Wy(this),Hfe(this)},e.paused=function(r){if(!arguments.length)return this._ps;if(this._ps!==r)if(this._ps=r,r)this._pTime=this._tTime||Math.max(-this._delay,this.rawTime()),this._ts=this._act=0;else{Af(),this._ts=this._rts;var s=this.parent&&!this.parent.smoothChildTiming?this.rawTime():this._tTime||this._pTime,i=this.progress()===1&&Math.abs(this._zTime)!==gn,o;if(i)for(this._tTime-=gn,o=this._first;o;){if(!o._dur&&o._zTime<0&&o._ts&&o._start<=s+gn){i=!1;break}o=o._next}this.totalTime(s,i)}return this},e.startTime=function(r){if(arguments.length){this._start=Hn(r);var s=this.parent||this._dp;return s&&(s._sort||!this.parent)&&Uo(s,this,this._start-this._delay),this}return this._start},e.endTime=function(r){return this._start+(Gs(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?Xv(s.rawTime(r),this):this._tTime:this._tTime},e.revert=function(r){r===void 0&&(r=Ffe);var s=qr;return qr=r,SE(this)&&(this.timeline&&this.timeline.revert(r),this.totalTime(-.01,r.suppressEvents)),this.data!=="nested"&&r.kill!==!1&&this.kill(),qr=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,wI(this)):this._repeat===-2?1/0:this._repeat},e.repeatDelay=function(r){if(arguments.length){var s=this._time;return this._rDelay=r,wI(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($i(this,r),Gs(s))},e.restart=function(r,s){return this.play().totalTime(r?-this._delay:0,Gs(s)),this._dur||(this._zTime=-gn),this},e.play=function(r,s){return r!=null&&this.seek(r,s),this.reversed(!1).paused(!1)},e.reverse=function(r,s){return r!=null&&this.seek(r||this.totalDuration(),s),this.reversed(!0).paused(!1)},e.pause=function(r,s){return r!=null&&this.seek(r,s),this.paused(!0)},e.resume=function(){return this.paused(!1)},e.reversed=function(r){return arguments.length?(!!r!==this.reversed()&&this.timeScale(-this._rts||(r?-gn:0)),this):this._rts<0},e.invalidate=function(){return this._initted=this._act=0,this._zTime=-gn,this},e.isActive=function(){var r=this.parent||this._dp,s=this._start,i;return!!(!r||this._ts&&this._initted&&r.isActive()&&(i=r.rawTime(!0))>=s&&i<this.endTime(!0)-gn)},e.eventCallback=function(r,s,i){var o=this.vars;return arguments.length>1?(s?(o[r]=s,i&&(o[r+"Params"]=i),r==="onUpdate"&&(this._onUpdate=s)):delete o[r],this):o[r]},e.then=function(r){var s=this,i=s._prom;return new Promise(function(o){var l=tr(r)?r:v9,u=function(){var f=s.then;s.then=null,i&&i(),tr(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(){qh(this)},t})();bi(nm.prototype,{_time:0,_start:0,_end:0,_tTime:0,_tDur:0,_dirty:0,_repeat:0,_yoyo:!1,parent:null,_initted:!1,_rDelay:0,_ts:1,_dp:0,ratio:0,_zTime:-gn,_prom:0,_ps:!1,_rts:1});var Vs=(function(t){i9(e,t);function e(r,s){var i;return r===void 0&&(r={}),i=t.call(this,r)||this,i.labels={},i.smoothChildTiming=!!r.smoothChildTiming,i.autoRemoveChildren=!!r.autoRemoveChildren,i._sort=Gs(r.sortChildren),Un&&Uo(r.parent||Un,Sa(i),s),r.reversed&&i.reverse(),r.paused&&i.paused(!0),r.scrollTrigger&&w9(Sa(i),r.scrollTrigger),i}var n=e.prototype;return n.to=function(s,i,o){return vp(0,arguments,this),this},n.from=function(s,i,o){return vp(1,arguments,this),this},n.fromTo=function(s,i,o,l){return vp(2,arguments,this),this},n.set=function(s,i,o){return i.duration=0,i.parent=this,gp(i).repeatDelay||(i.repeat=0),i.immediateRender=!!i.immediateRender,new hr(s,i,$i(this,o),1),this},n.call=function(s,i,o){return Uo(this,hr.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 hr(s,o,$i(this,u)),this},n.staggerFrom=function(s,i,o,l,u,d,f){return o.runBackwards=1,gp(o).immediateRender=Gs(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,gp(l).immediateRender=Gs(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:Hn(s),h=this._zTime<0!=s<0&&(this._initted||!d),m,g,_,y,b,x,S,E,C,R,O,I;if(this!==Un&&f>u&&s>=0&&(f=u),f!==this._tTime||o||h){if(l!==this._time&&d&&(f+=this._time-l,s+=this._time-l),m=f,C=this._start,E=this._ts,x=!E,h&&(d||(l=this._zTime),(s||!i)&&(this._zTime=s)),this._repeat){if(O=this._yoyo,b=d+this._rDelay,this._repeat<-1&&s<0)return this.totalTime(b*100+s,i,o);if(m=Hn(f%b),f===u?(y=this._repeat,m=d):(R=Hn(f/b),y=~~R,y&&y===R&&(m=d,y--),m>d&&(m=d)),R=Tf(this._tTime,b),!l&&this._tTime&&R!==y&&this._tTime-R*b-this._dur<=0&&(R=y),O&&y&1&&(m=d-m,I=1),y!==R&&!this._lock){var A=O&&R&1,L=A===(O&&y&1);if(y<R&&(A=!A),l=A?0:f%d?d:f,this._lock=1,this.render(l||(I?0:Hn(y*b)),i,!d)._lock=0,this._tTime=f,!i&&this.parent&&mi(this,"onRepeat"),this.vars.repeatRefresh&&!I&&(this.invalidate()._lock=1,R=y),l&&l!==this._time||x!==!this._ts||this.vars.onRepeat&&!this.parent&&!this._act)return this;if(d=this._dur,u=this._tDur,L&&(this._lock=2,l=A?d:-1e-4,this.render(l,!0),this.vars.repeatRefresh&&!I&&this.invalidate()),this._lock=0,!this._ts&&!x)return this}}if(this._hasPause&&!this._forcing&&this._lock<2&&(S=Wfe(this,Hn(l),Hn(m)),S&&(f-=m-(m=S._start))),this._tTime=f,this._time=m,this._act=!!E,this._initted||(this._onUpdate=this.vars.onUpdate,this._initted=1,this._zTime=s,l=0),!l&&f&&d&&!i&&!R&&(mi(this,"onStart"),this._tTime!==f))return this;if(m>=l&&s>=0)for(g=this._first;g;){if(_=g._next,(g._act||m>=g._start)&&g._ts&&S!==g){if(g.parent!==this)return this.render(s,i,o);if(g.render(g._ts>0?(m-g._start)*g._ts:(g._dirty?g.totalDuration():g._tDur)+(m-g._start)*g._ts,i,o),m!==this._time||!this._ts&&!x){S=0,_&&(f+=this._zTime=-gn);break}}g=_}else{g=this._last;for(var N=s<0?s:m;g;){if(_=g._prev,(g._act||N<=g._end)&&g._ts&&S!==g){if(g.parent!==this)return this.render(s,i,o);if(g.render(g._ts>0?(N-g._start)*g._ts:(g._dirty?g.totalDuration():g._tDur)+(N-g._start)*g._ts,i,o||qr&&SE(g)),m!==this._time||!this._ts&&!x){S=0,_&&(f+=this._zTime=N?-gn:gn);break}}g=_}}if(S&&!i&&(this.pause(),S.render(m>=l?0:-gn)._zTime=m>=l?1:-1,this._ts))return this._start=C,Wy(this),this.render(s,i,o);this._onUpdate&&!i&&mi(this,"onUpdate",!0),(f===u&&this._tTime>=this.totalDuration()||!f&&l)&&(C===this._start||Math.abs(E)!==Math.abs(this._ts))&&(this._lock||((s||!d)&&(f===u&&this._ts>0||!f&&this._ts<0)&&rc(this,1),!i&&!(s<0&&!l)&&(f||l||!u)&&(mi(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(Ha(i)||(i=$i(this,i,s)),!(s instanceof nm)){if(hs(s))return s.forEach(function(l){return o.add(l,i)}),this;if(jr(s))return this.addLabel(s,i);if(tr(s))s=hr.delayedCall(0,s);else return this}return this!==s?Uo(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=-Vi);for(var u=[],d=this._first;d;)d._start>=l&&(d instanceof hr?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 jr(s)?this.removeLabel(s):tr(s)?this.killTweensOf(s):(s.parent===this&&By(this,s),s===this._recent&&(this._recent=this._last),pu(this))},n.totalTime=function(s,i){return arguments.length?(this._forcing=1,!this._dp&&this._ts&&(this._start=Hn(pi.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]=$i(this,i),this},n.removeLabel=function(s){return delete this.labels[s],this},n.addPause=function(s,i,o){var l=hr.delayedCall(0,i||Jp,o);return l.data="isPause",this._hasPause=1,Uo(this,l,$i(this,s))},n.removePause=function(s){var i=this._first;for(s=$i(this,s);i;)i._start===s&&i.data==="isPause"&&rc(i),i=i._next},n.killTweensOf=function(s,i,o){for(var l=this.getTweensOf(s,o),u=l.length;u--;)Dl!==l[u]&&l[u].kill(s,i);return this},n.getTweensOf=function(s,i){for(var o=[],l=Hi(s),u=this._first,d=Ha(i),f;u;)u instanceof hr?jfe(u._targets,l)&&(d?(!Dl||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=$i(o,s),u=i,d=u.startAt,f=u.onStart,h=u.onStartParams,m=u.immediateRender,g,_=hr.to(o,bi({ease:i.ease||"none",lazy:!1,immediateRender:!1,time:l,overwrite:"auto",duration:i.duration||Math.abs((l-(d&&"time"in d?d.time:o._time))/o.timeScale())||gn,onStart:function(){if(o.pause(),!g){var b=i.duration||Math.abs((l-(d&&"time"in d?d.time:o._time))/o.timeScale());_._dur!==b&&Rf(_,b,0,1).render(_._time,!0,!0),g=1}f&&f.apply(_,h||[])}},i));return m?_.render(0):_},n.tweenFromTo=function(s,i,o){return this.tweenTo(i,bi({startAt:{time:$i(this,s)}},o))},n.recent=function(){return this._recent},n.nextLabel=function(s){return s===void 0&&(s=this._time),bI(this,$i(this,s))},n.previousLabel=function(s){return s===void 0&&(s=this._time),bI(this,$i(this,s),1)},n.currentLabel=function(s){return arguments.length?this.seek(s,!0):this.previousLabel(this._time+gn)},n.shiftChildren=function(s,i,o){o===void 0&&(o=0);var l=this._first,u=this.labels,d;for(s=Hn(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 pu(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={}),pu(this)},n.totalDuration=function(s){var i=0,o=this,l=o._last,u=Vi,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,Uo(o,l,f-l._delay,1)._lock=0):u=f,f<0&&l._ts&&(i-=f,(!h&&!o._dp||h&&h.smoothChildTiming)&&(o._start+=Hn(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;Rf(o,o===Un&&o._time>i?o._time:i,1,1),o._dirty=0}return o._tDur},e.updateRoot=function(s){if(Un._ts&&(m9(Un,Xv(s,Un)),h9=pi.frame),pi.frame>=vI){vI+=yi.autoSleep||120;var i=Un._first;if((!i||!i._ts)&&yi.autoSleep&&pi._listeners.length<2){for(;i&&!i._ts;)i=i._next;i||pi.sleep()}}},e})(nm);bi(Vs.prototype,{_lock:0,_hasPause:0,_forcing:0});var che=function(e,n,r,s,i,o,l){var u=new Ys(this._pt,e,n,0,1,z9,null,i),d=0,f=0,h,m,g,_,y,b,x,S;for(u.b=r,u.e=s,r+="",s+="",(x=~s.indexOf("random("))&&(s=em(s)),o&&(S=[r,s],o(S,e,n),r=S[0],s=S[1]),m=r.match(fb)||[];h=fb.exec(s);)_=h[0],y=s.substring(d,h.index),g?g=(g+1)%5:y.substr(-5)==="rgba("&&(g=1),_!==m[f++]&&(b=parseFloat(m[f-1])||0,u._pt={_next:u._pt,p:y||f===1?y:",",s:b,c:_.charAt(1)==="="?Vd(b,_)-b:parseFloat(_)-b,m:g&&g<4?Math.round:0},d=fb.lastIndex);return u.c=d<s.length?s.substring(d,s.length):"",u.fp=l,(c9.test(s)||x)&&(u.e=0),this._pt=u,u},kE=function(e,n,r,s,i,o,l,u,d,f){tr(s)&&(s=s(i||0,e,o));var h=e[n],m=r!=="get"?r:tr(h)?d?e[n.indexOf("set")||!tr(e["get"+n.substr(3)])?n:"get"+n.substr(3)](d):e[n]():h,g=tr(h)?d?phe:F9:CE,_;if(jr(s)&&(~s.indexOf("random(")&&(s=em(s)),s.charAt(1)==="="&&(_=Vd(m,s)+(ds(m)||0),(_||_===0)&&(s=_))),!f||m!==s||Xx)return!isNaN(m*s)&&s!==""?(_=new Ys(this._pt,e,n,+m||0,s-(m||0),typeof h=="boolean"?ghe:j9,0,g),d&&(_.fp=d),l&&_.modifier(l,this,e),this._pt=_):(!h&&!(n in e)&&_E(n,s),che.call(this,e,n,m,s,g,u||yi.stringFilter,d))},uhe=function(e,n,r,s,i){if(tr(e)&&(e=yp(e,i,n,r,s)),!na(e)||e.style&&e.nodeType||hs(e)||a9(e))return jr(e)?yp(e,i,n,r,s):e;var o={},l;for(l in e)o[l]=yp(e[l],i,n,r,s);return o},D9=function(e,n,r,s,i,o){var l,u,d,f;if(ui[e]&&(l=new ui[e]).init(i,l.rawVars?n[e]:uhe(n[e],s,i,o,r),r,s,o)!==!1&&(r._pt=u=new Ys(r._pt,i,e,0,1,l.render,l,0,l.priority),r!==Id))for(d=r._ptLookup[r._targets.indexOf(i)],f=l._props.length;f--;)d[l._props[f]]=u;return l},Dl,Xx,EE=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,m=s.keyframes,g=s.autoRevert,_=e._dur,y=e._startAt,b=e._targets,x=e.parent,S=x&&x.data==="nested"?x.vars.targets:b,E=e._overwrite==="auto"&&!mE,C=e.timeline,R=s.easeReverse||h,O,I,A,L,N,H,$,W,X,z,K,te,Z;if(C&&(!m||!i)&&(i="none"),e._ease=mu(i,Xp.ease),e._rEase=R&&(mu(R)||e._ease),e._from=!C&&!!s.runBackwards,e._from&&(e.ratio=1),!C||m&&!s.stagger){if(W=b[0]?hu(b[0]).harness:0,te=W&&s[W.prop],O=Yv(s,wE),y&&(y._zTime<0&&y.progress(1),n<0&&f&&l&&!g?y.render(-1,!0):y.revert(f&&_?Ug:$fe),y._lazy=0),o){if(rc(e._startAt=hr.set(b,bi({data:"isStart",overwrite:!1,parent:x,immediateRender:!0,lazy:!y&&Gs(u),startAt:null,delay:0,onUpdate:d&&function(){return mi(e,"onUpdate")},stagger:0},o))),e._startAt._dp=0,e._startAt._sat=e,n<0&&(qr||!l&&!g)&&e._startAt.revert(Ug),l&&_&&n<=0&&r<=0){n&&(e._zTime=n);return}}else if(f&&_&&!y){if(n&&(l=!1),A=bi({overwrite:!1,data:"isFromStart",lazy:l&&!y&&Gs(u),immediateRender:l,stagger:0,parent:x},O),te&&(A[W.prop]=te),rc(e._startAt=hr.set(b,A)),e._startAt._dp=0,e._startAt._sat=e,n<0&&(qr?e._startAt.revert(Ug):e._startAt.render(-1,!0)),e._zTime=n,!l)t(e._startAt,gn,gn);else if(!n)return}for(e._pt=e._ptCache=0,u=_&&Gs(u)||u&&!_,I=0;I<b.length;I++){if(N=b[I],$=N._gsap||xE(b)[I]._gsap,e._ptLookup[I]=z={},Wx[$.id]&&Bl.length&&qv(),K=S===b?I:S.indexOf(N),W&&(X=new W).init(N,te||O,e,K,S)!==!1&&(e._pt=L=new Ys(e._pt,N,X.name,0,1,X.render,X,0,X.priority),X._props.forEach(function(J){z[J]=L}),X.priority&&(H=1)),!W||te)for(A in O)ui[A]&&(X=D9(A,O,e,K,N,S))?X.priority&&(H=1):z[A]=L=kE.call(e,N,A,"get",O[A],K,S,0,s.stringFilter);e._op&&e._op[I]&&e.kill(N,e._op[I]),E&&e._pt&&(Dl=e,Un.killTweensOf(N,z,e.globalTime(n)),Z=!e.parent,Dl=0),e._pt&&u&&(Wx[$.id]=1)}H&&V9(e),e._onInit&&e._onInit(e)}e._onUpdate=d,e._initted=(!e._op||e._pt)&&!Z,m&&n<=0&&C.render(Vi,!0,!0)},dhe=function(e,n,r,s,i,o,l,u){var d=(e._pt&&e._ptCache||(e._ptCache={}))[n],f,h,m,g;if(!d)for(d=e._ptCache[n]=[],m=e._ptLookup,g=e._targets.length;g--;){if(f=m[g][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 Xx=1,e.vars[n]="+=0",EE(e,l),Xx=0,u?Qp(n+" not eligible for reset. Try splitting into individual properties"):1;d.push(f)}for(g=d.length;g--;)h=d[g],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=ir(r)+ds(h.e)),h.b&&(h.b=f.s+ds(h.b))},fhe=function(e,n){var r=e[0]?hu(e[0]).harness:0,s=r&&r.aliases,i,o,l,u;if(!s)return n;i=Pf({},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},hhe=function(e,n,r,s){var i=n.ease||s||"power1.inOut",o,l;if(hs(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})},yp=function(e,n,r,s,i){return tr(e)?e.call(n,r,s,i):jr(e)&&~e.indexOf("random(")?em(e):e},Jv=bE+"repeat,repeatDelay,yoyo,repeatRefresh,yoyoEase,easeReverse,autoRevert",$9={};qs(Jv+",id,stagger,delay,duration,paused,scrollTrigger",function(t){return $9[t]=1});Jv=Jv.split(",");var hr=(function(t){i9(e,t);function e(r,s,i,o){var l;typeof s=="number"&&(i.duration=s,s=i,i=null),l=t.call(this,o?s:gp(s))||this;var u=l.vars,d=u.duration,f=u.delay,h=u.immediateRender,m=u.stagger,g=u.overwrite,_=u.keyframes,y=u.defaults,b=u.scrollTrigger,x=s.parent||Un,S=(hs(r)||a9(r)?Ha(r[0]):"length"in s)?[r]:Hi(r),E,C,R,O,I,A,L,N;if(l._targets=S.length?xE(S):Qp("GSAP target "+r+" not found. https://gsap.com",!yi.nullTargetWarn)||[],l._ptLookup=[],l._overwrite=g,_||m||fg(d)||fg(f)){s=l.vars;var H=s.easeReverse||s.yoyoEase;if(E=l.timeline=new Vs({data:"nested",defaults:y||{},targets:x&&x.data==="nested"?x.vars.targets:S}),E.kill(),E.parent=E._dp=Sa(l),E._start=0,m||fg(d)||fg(f)){if(O=S.length,L=m&&k9(m),na(m))for(I in m)~Jv.indexOf(I)&&(N||(N={}),N[I]=m[I]);for(C=0;C<O;C++)R=Yv(s,$9),R.stagger=0,H&&(R.easeReverse=H),N&&Pf(R,N),A=S[C],R.duration=+yp(d,Sa(l),C,A,S),R.delay=(+yp(f,Sa(l),C,A,S)||0)-l._delay,!m&&O===1&&R.delay&&(l._delay=f=R.delay,l._start+=f,R.delay=0),E.to(A,R,L?L(C,A,S):0),E._ease=zt.none;E.duration()?d=f=0:l.timeline=0}else if(_){gp(bi(E.vars.defaults,{ease:"none"})),E._ease=mu(_.ease||s.ease||"none");var $=0,W,X,z;if(hs(_))_.forEach(function(K){return E.to(S,K,">")}),E.duration();else{R={};for(I in _)I==="ease"||I==="easeEach"||hhe(I,_[I],R,_.easeEach);for(I in R)for(W=R[I].sort(function(K,te){return K.t-te.t}),$=0,C=0;C<W.length;C++)X=W[C],z={ease:X.e,duration:(X.t-(C?W[C-1].t:0))/100*d},z[I]=X.v,E.to(S,z,$),$+=z.duration;E.duration()<d&&E.to({},{duration:d-E.duration()})}}d||l.duration(d=E.duration())}else l.timeline=0;return g===!0&&!mE&&(Dl=Sa(l),Un.killTweensOf(S),Dl=0),Uo(x,Sa(l),i),s.reversed&&l.reverse(),s.paused&&l.paused(!0),(h||!d&&!_&&l._start===Hn(x._time)&&Gs(h)&&Ufe(Sa(l))&&x.data!=="nested")&&(l._tTime=-gn,l.render(Math.max(0,-f)||0)),b&&w9(Sa(l),b),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-gn&&!f?u:s<gn?0:s,m,g,_,y,b,x,S,E;if(!d)Bfe(this,s,i,o);else if(h!==this._tTime||!s||o||!this._initted&&this._tTime||this._startAt&&this._zTime<0!==f||this._lazy){if(m=h,E=this.timeline,this._repeat){if(y=d+this._rDelay,this._repeat<-1&&f)return this.totalTime(y*100+s,i,o);if(m=Hn(h%y),h===u?(_=this._repeat,m=d):(b=Hn(h/y),_=~~b,_&&_===b?(m=d,_--):m>d&&(m=d)),x=this._yoyo&&_&1,x&&(m=d-m),b=Tf(this._tTime,y),m===l&&!o&&this._initted&&_===b)return this._tTime=h,this;_!==b&&this.vars.repeatRefresh&&!x&&!this._lock&&m!==y&&this._initted&&(this._lock=o=1,this.render(Hn(y*_),!0).invalidate()._lock=0)}if(!this._initted){if(b9(this,f?s:m,o,i,h))return this._tTime=0,this;if(l!==this._time&&!(o&&this.vars.repeatRefresh&&_!==b))return this;if(d!==this._dur)return this.render(s,i,o)}if(this._rEase){var C=m<l;if(C!==this._inv){var R=C?l:d-l;this._inv=C,this._from&&(this.ratio=1-this.ratio),this._invRatio=this.ratio,this._invTime=l,this._invRecip=R?(C?-1:1)/R:0,this._invScale=C?-this.ratio:1-this.ratio,this._invEase=C?this._rEase:this._ease}this.ratio=S=this._invRatio+this._invScale*this._invEase((m-this._invTime)*this._invRecip)}else this.ratio=S=this._ease(m/d);if(this._from&&(this.ratio=S=1-S),this._tTime=h,this._time=m,!this._act&&this._ts&&(this._act=1,this._lazy=0),!l&&h&&!i&&!b&&(mi(this,"onStart"),this._tTime!==h))return this;for(g=this._pt;g;)g.r(S,g.d),g=g._next;E&&E.render(s<0?s:E._dur*E._ease(m/this._dur),i,o)||this._startAt&&(this._zTime=s),this._onUpdate&&!i&&(f&&Kx(this,s,i,o),mi(this,"onUpdate")),this._repeat&&_!==b&&this.vars.onRepeat&&!i&&this.parent&&mi(this,"onRepeat"),(h===this._tDur||!h)&&this._tTime===h&&(f&&!this._onUpdate&&Kx(this,s,!0,!0),(s||!d)&&(h===this._tDur&&this._ts>0||!h&&this._ts<0)&&rc(this,1),!i&&!(f&&!l)&&(h||l||x)&&(mi(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){tm||pi.wake(),this._ts||this.play();var d=Math.min(this._dur,(this._dp._time-this._start)*this._ts),f;return this._initted||EE(this,d),f=this._ease(d/this._dur),dhe(this,s,i,o,l,f,d,u)?this.resetTo(s,i,o,l,1):(Ky(this,0),this.parent||y9(this._dp,this,"_first","_last",this._dp._sort?"_start":0),this.render(0))},n.kill=function(s,i){if(i===void 0&&(i="all"),!s&&(!i||i==="all"))return this._lazy=this._pt=0,this.parent?qh(this):this.scrollTrigger&&this.scrollTrigger.kill(!!qr),this;if(this.timeline){var o=this.timeline.totalDuration();return this.timeline.killTweensOf(s,i,Dl&&Dl.vars.overwrite!==!0)._first||qh(this),this.parent&&o!==this.timeline.totalDuration()&&Rf(this,this._dur*this.timeline._tDur/o,0,1),this}var l=this._targets,u=s?Hi(s):l,d=this._ptLookup,f=this._pt,h,m,g,_,y,b,x;if((!i||i==="all")&&Vfe(l,u))return i==="all"&&(this._pt=0),qh(this);for(h=this._op=this._op||[],i!=="all"&&(jr(i)&&(y={},qs(i,function(S){return y[S]=1}),i=y),i=fhe(l,i)),x=l.length;x--;)if(~u.indexOf(l[x])){m=d[x],i==="all"?(h[x]=i,_=m,g={}):(g=h[x]=h[x]||{},_=i);for(y in _)b=m&&m[y],b&&((!("kill"in b.d)||b.d.kill(y)===!0)&&By(this,b,"_pt"),delete m[y]),g!=="all"&&(g[y]=1)}return this._initted&&!this._pt&&f&&qh(this),this},e.to=function(s,i){return new e(s,i,arguments[2])},e.from=function(s,i){return vp(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 vp(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 Un.killTweensOf(s,i,o)},e})(nm);bi(hr.prototype,{_targets:[],_lazy:0,_startAt:0,_op:0,_onInit:0});qs("staggerTo,staggerFrom,staggerFromTo",function(t){hr[t]=function(){var e=new Vs,n=Gx.call(arguments,0);return n.splice(t==="staggerFromTo"?5:4,0,0),e[t].apply(e,n)}});var CE=function(e,n,r){return e[n]=r},F9=function(e,n,r){return e[n](r)},phe=function(e,n,r,s){return e[n](s.fp,r)},mhe=function(e,n,r){return e.setAttribute(n,r)},PE=function(e,n){return tr(e[n])?F9:gE(e[n])&&e.setAttribute?mhe:CE},j9=function(e,n){return n.set(n.t,n.p,Math.round((n.s+n.c*e)*1e6)/1e6,n)},ghe=function(e,n){return n.set(n.t,n.p,!!(n.s+n.c*e),n)},z9=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)},TE=function(e,n){for(var r=n._pt;r;)r.r(e,r.d),r=r._next},vhe=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},yhe=function(e){for(var n=this._pt,r,s;n;)s=n._next,n.p===e&&!n.op||n.op===e?By(this,n,"_pt"):n.dep||(r=1),n=s;return!r},_he=function(e,n,r,s){s.mSet(e,n,s.m.call(s.tween,r,s.mt),s)},V9=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},Ys=(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||j9,this.d=u||this,this.set=d||CE,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=_he,this.m=r,this.mt=i,this.tween=s},t})();qs(bE+"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 wE[t]=1});wi.TweenMax=wi.TweenLite=hr;wi.TimelineLite=wi.TimelineMax=Vs;Un=new Vs({sortChildren:!1,defaults:Xp,autoRemoveChildren:!0,id:"root",smoothChildTiming:!0});yi.stringFilter=M9;var gu=[],Bg={},whe=[],SI=0,bhe=0,vb=function(e){return(Bg[e]||whe).map(function(n){return n()})},rm=function(){var e=Date.now(),n=[];e-SI>2&&(vb("matchMediaInit"),gu.forEach(function(r){var s=r.queries,i=r.conditions,o,l,u,d;for(l in s)o=Do.matchMedia(s[l]).matches,o&&(u=1),o!==i[l]&&(i[l]=o,d=1);d&&(r.revert(),u&&n.push(r))}),vb("matchMediaRevert"),n.forEach(function(r){return r.onMatch(r,function(s){return r.add(null,s)})}),SI=e,vb("matchMedia"))},H9=(function(){function t(n,r){this.selector=r&&qx(r),this.data=[],this._r=[],this.isReverted=!1,this.id=bhe++,n&&this.add(n)}var e=t.prototype;return e.add=function(r,s,i){tr(r)&&(i=s,s=r,r=tr);var o=this,l=function(){var d=Dn,f=o.selector,h;return d&&d!==o&&d.data.push(o),i&&(o.selector=qx(i)),Dn=o,h=s.apply(o,arguments),tr(h)&&o._r.push(h),Dn=d,o.selector=f,o.isReverted=!1,h};return o.last=l,r===tr?l(o,function(u){return o.add(null,u)}):r?o[r]=l:l},e.ignore=function(r){var s=Dn;Dn=null,r(this),Dn=s},e.getTweens=function(){var r=[];return this.data.forEach(function(s){return s instanceof t?r.push.apply(r,s.getTweens()):s instanceof hr&&!(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 Vs?d.data!=="nested"&&(d.scrollTrigger&&d.scrollTrigger.revert(),d.kill()):!(d instanceof hr)&&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=gu.length;o--;)gu[o].id===this.id&&gu.splice(o,1);this._mqs&&this._mqs.forEach(function(l){return l.removeListener?l.removeListener(rm):l.removeEventListener("change",rm)}),this._mqs=null}},e.revert=function(r){this.kill(r||{})},t})(),xhe=(function(){function t(n){this.contexts=[],this.scope=n,Dn&&Dn.data.push(this)}var e=t.prototype;return e.add=function(r,s,i){na(r)||(r={matches:r});var o=new H9(0,i||this.scope),l=o.conditions={},u,d,f;Dn&&!o.selector&&(o.selector=Dn.selector),this.contexts.push(o),s=o.add("onMatch",s),o.queries=r;for(d in r)d==="all"?f=1:(u=Do.matchMedia(r[d]),u&&(gu.indexOf(o)<0&&gu.push(o),(l[d]=u.matches)&&(f=1),u.addListener?u.addListener(rm):u.addEventListener("change",rm),(o._mqs||(o._mqs=[])).push(u)));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})(),ey={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 A9(s)})},timeline:function(e){return new Vs(e)},getTweensOf:function(e,n){return Un.getTweensOf(e,n)},getProperty:function(e,n,r,s){jr(e)&&(e=Hi(e)[0]);var i=hu(e||{}).get,o=r?v9:g9;return r==="native"&&(r=""),e&&(n?o((ui[n]&&ui[n].get||i)(e,n,r,s)):function(l,u,d){return o((ui[l]&&ui[l].get||i)(e,l,u,d))})},quickSetter:function(e,n,r){if(e=Hi(e),e.length>1){var s=e.map(function(f){return Qs.quickSetter(f,n,r)}),i=s.length;return function(f){for(var h=i;h--;)s[h](f)}}e=e[0]||{};var o=ui[n],l=hu(e),u=l.harness&&(l.harness.aliases||{})[n]||n,d=o?function(f){var h=new o;Id._pt=0,h.init(e,r?f+r:f,Id,0,[e]),h.render(1,h),Id._pt&&TE(1,Id)}: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=Qs.to(e,bi((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 Un.getTweensOf(e,!0).length>0},defaults:function(e){return e&&e.ease&&(e.ease=mu(e.ease,Xp.ease)),yI(Xp,e||{})},config:function(e){return yI(yi,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&&!ui[l]&&!wi[l]&&Qp(n+" effect requires "+l+" plugin.")}),hb[n]=function(l,u,d){return r(Hi(l),bi(u||{},i),d)},o&&(Vs.prototype[n]=function(l,u,d){return this.add(hb[n](l,na(u)?u:(d=u)&&{},this),d)})},registerEase:function(e,n){zt[e]=mu(n)},parseEase:function(e,n){return arguments.length?mu(e,n):zt},getById:function(e){return Un.getById(e)},exportRoot:function(e,n){e===void 0&&(e={});var r=new Vs(e),s,i;for(r.smoothChildTiming=Gs(e.smoothChildTiming),Un.remove(r),r._dp=0,r._time=r._tTime=Un._time,s=Un._first;s;)i=s._next,(n||!(!s._dur&&s instanceof hr&&s.vars.onComplete===s._targets[0]))&&Uo(r,s,s._start-s._delay),s=i;return Uo(Un,r,0),r},context:function(e,n){return e?new H9(e,n):Dn},matchMedia:function(e){return new xhe(e)},matchMediaRefresh:function(){return gu.forEach(function(e){var n=e.conditions,r,s;for(s in n)n[s]&&(n[s]=!1,r=1);r&&e.revert()})||rm()},addEventListener:function(e,n){var r=Bg[e]||(Bg[e]=[]);~r.indexOf(n)||r.push(n)},removeEventListener:function(e,n){var r=Bg[e],s=r&&r.indexOf(n);s>=0&&r.splice(s,1)},utils:{wrap:Jfe,wrapYoyo:ehe,distribute:k9,random:C9,snap:E9,normalize:Qfe,getUnit:ds,clamp:Gfe,splitColor:I9,toArray:Hi,selector:qx,mapRange:T9,pipe:Yfe,unitize:Xfe,interpolate:the,shuffle:S9},install:d9,effects:hb,ticker:pi,updateRoot:Vs.updateRoot,plugins:ui,globalTimeline:Un,core:{PropTween:Ys,globals:f9,Tween:hr,Timeline:Vs,Animation:nm,getCache:hu,_removeLinkedListItem:By,reverting:function(){return qr},context:function(e){return e&&Dn&&(Dn.data.push(e),e._ctx=Dn),Dn},suppressOverwrites:function(e){return mE=e}}};qs("to,from,fromTo,delayedCall,set,killTweensOf",function(t){return ey[t]=hr[t]});pi.add(Vs.updateRoot);Id=ey.to({},{duration:0});var She=function(e,n){for(var r=e._pt;r&&r.p!==n&&r.op!==n&&r.fp!==n;)r=r._next;return r},khe=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=She(o,s)),o&&o.modifier&&o.modifier(n[s],e,r[i],s))},yb=function(e,n){return{name:e,headless:1,rawVars:1,init:function(s,i,o){o._onInit=function(l){var u,d;if(jr(i)&&(u={},qs(i,function(f){return u[f]=1}),i=u),n){u={};for(d in i)u[d]=n(i[d]);i=u}khe(l,i)}}}},Qs=ey.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;)qr?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)}},yb("roundProps",Yx),yb("modifiers"),yb("snap",E9))||ey;hr.version=Vs.version=Qs.version="3.15.1";u9=1;vE()&&Af();zt.Power0;zt.Power1;zt.Power2;zt.Power3;zt.Power4;zt.Linear;zt.Quad;zt.Cubic;zt.Quart;zt.Quint;zt.Strong;zt.Elastic;zt.Back;zt.SteppedEase;zt.Bounce;zt.Sine;zt.Expo;zt.Circ;/*!
208
- * CSSPlugin 3.15.1
209
- * https://gsap.com
210
- *
211
- * Copyright 2008-2026, GreenSock. All rights reserved.
212
- * Subject to the terms at https://gsap.com/standard-license
213
- * @author: Jack Doyle, jack@greensock.com
214
- */var kI,$l,Hd,RE,Kc,EI,AE,Ehe=function(){return typeof window<"u"},Ua={},Uc=180/Math.PI,Ud=Math.PI/180,md=Math.atan2,CI=1e8,IE=/([A-Z])/g,Che=/(left|right|width|margin|padding|x)/i,Phe=/[\s,\(]\S/,Wo={autoAlpha:"opacity,visibility",scale:"scaleX,scaleY",alpha:"opacity"},Qx=function(e,n){return n.set(n.t,n.p,Math.round((n.s+n.c*e)*1e4)/1e4+n.u,n)},The=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)},Rhe=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)},Ahe=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)},Ihe=function(e,n){var r=n.s+n.c*e;n.set(n.t,n.p,~~(r+(r<0?-.5:.5))+n.u,n)},U9=function(e,n){return n.set(n.t,n.p,e?n.e:n.b,n)},Z9=function(e,n){return n.set(n.t,n.p,e!==1?n.b:n.e,n)},Ohe=function(e,n,r){return e.style[n]=r},Mhe=function(e,n,r){return e.style.setProperty(n,r)},Lhe=function(e,n,r){return e._gsap[n]=r},Nhe=function(e,n,r){return e._gsap.scaleX=e._gsap.scaleY=r},Dhe=function(e,n,r,s,i){var o=e._gsap;o.scaleX=o.scaleY=r,o.renderTransform(i,o)},$he=function(e,n,r,s,i){var o=e._gsap;o[n]=r,o.renderTransform(i,o)},Zn="transform",Xs=Zn+"Origin",Fhe=function t(e,n){var r=this,s=this.target,i=s.style,o=s._gsap;if(e in Ua&&i){if(this.tfm=this.tfm||{},e!=="transform")e=Wo[e]||e,~e.indexOf(",")?e.split(",").forEach(function(l){return r.tfm[l]=ka(s,l)}):this.tfm[e]=o.x?o[e]:ka(s,e),e===Xs&&(this.tfm.zOrigin=o.zOrigin);else return Wo.transform.split(",").forEach(function(l){return t.call(r,l,n)});if(this.props.indexOf(Zn)>=0)return;o.svg&&(this.svgo=s.getAttribute("data-svg-origin"),this.props.push(Xs,n,"")),e=Zn}(i||n)&&this.props.push(e,n,i[e])},B9=function(e){e.translate&&(e.removeProperty("translate"),e.removeProperty("scale"),e.removeProperty("rotate"))},jhe=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(IE,"-$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=AE(),(!i||!i.isStart)&&!r[Zn]&&(B9(r),s.zOrigin&&r[Xs]&&(r[Xs]+=" "+s.zOrigin+"px",s.zOrigin=0,s.renderTransform()),s.uncache=1)}},W9=function(e,n){var r={target:e,props:[],revert:jhe,save:Fhe};return e._gsap||Qs.core.getCache(e),n&&e.style&&e.nodeType&&n.split(",").forEach(function(s){return r.save(s)}),r},K9,Jx=function(e,n){var r=$l.createElementNS?$l.createElementNS((n||"http://www.w3.org/1999/xhtml").replace(/^https/,"http"),e):$l.createElement(e);return r&&r.style?r:$l.createElement(e)},gi=function t(e,n,r){var s=getComputedStyle(e);return s[n]||s.getPropertyValue(n.replace(IE,"-$1").toLowerCase())||s.getPropertyValue(n)||!r&&t(e,If(n)||n,1)||""},PI="O,Moz,ms,Ms,Webkit".split(","),If=function(e,n,r){var s=n||Kc,i=s.style,o=5;if(e in i&&!r)return e;for(e=e.charAt(0).toUpperCase()+e.substr(1);o--&&!(PI[o]+e in i););return o<0?null:(o===3?"ms":o>=0?PI[o]:"")+e},eS=function(){Ehe()&&window.document&&(kI=window,$l=kI.document,Hd=$l.documentElement,Kc=Jx("div")||{style:{}},Jx("div"),Zn=If(Zn),Xs=Zn+"Origin",Kc.style.cssText="border-width:0;line-height:0;position:absolute;padding:0",K9=!!If("perspective"),AE=Qs.core.reverting,RE=1)},TI=function(e){var n=e.ownerSVGElement,r=Jx("svg",n&&n.getAttribute("xmlns")||"http://www.w3.org/2000/svg"),s=e.cloneNode(!0),i;s.style.display="block",r.appendChild(s),Hd.appendChild(r);try{i=s.getBBox()}catch{}return r.removeChild(s),Hd.removeChild(r),i},RI=function(e,n){for(var r=n.length;r--;)if(e.hasAttribute(n[r]))return e.getAttribute(n[r])},G9=function(e){var n,r;try{n=e.getBBox()}catch{n=TI(e),r=1}return n&&(n.width||n.height)||r||(n=TI(e)),n&&!n.width&&!n.x&&!n.y?{x:+RI(e,["x","cx","x1"])||0,y:+RI(e,["y","cy","y1"])||0,width:0,height:0}:n},q9=function(e){return!!(e.getCTM&&(!e.parentNode||e.ownerSVGElement)&&G9(e))},sc=function(e,n){if(n){var r=e.style,s;n in Ua&&n!==Xs&&(n=Zn),r.removeProperty?(s=n.substr(0,2),(s==="ms"||n.substr(0,6)==="webkit")&&(n="-"+n),r.removeProperty(s==="--"?n:n.replace(IE,"-$1").toLowerCase())):r.removeAttribute(n)}},Fl=function(e,n,r,s,i,o){var l=new Ys(e._pt,n,r,0,1,o?Z9:U9);return e._pt=l,l.b=s,l.e=i,e._props.push(r),l},AI={deg:1,rad:1,turn:1},zhe={grid:1,flex:1},ic=function t(e,n,r,s){var i=parseFloat(r)||0,o=(r+"").trim().substr((i+"").length)||"px",l=Kc.style,u=Che.test(n),d=e.tagName.toLowerCase()==="svg",f=(d?"client":"offset")+(u?"Width":"Height"),h=100,m=s==="px",g=s==="%",_,y,b,x;if(s===o||!i||AI[s]||AI[o])return i;if(o!=="px"&&!m&&(i=t(e,n,r,"px")),x=e.getCTM&&q9(e),(g||o==="%")&&(Ua[n]||~n.indexOf("adius")))return _=x?e.getBBox()[u?"width":"height"]:e[f],ir(g?i/_*h:i/100*_);if(l[u?"width":"height"]=h+(m?o:s),y=s!=="rem"&&~n.indexOf("adius")||s==="em"&&e.appendChild&&!d?e:e.parentNode,x&&(y=(e.ownerSVGElement||{}).parentNode),(!y||y===$l||!y.appendChild)&&(y=$l.body),b=y._gsap,b&&g&&b.width&&u&&b.time===pi.time&&!b.uncache)return ir(i/b.width*h);if(g&&(n==="height"||n==="width")){var S=e.style[n];e.style[n]=h+s,_=e[f],S?e.style[n]=S:sc(e,n)}else(g||o==="%")&&!zhe[gi(y,"display")]&&(l.position=gi(e,"position")),y===e&&(l.position="static"),y.appendChild(Kc),_=Kc[f],y.removeChild(Kc),l.position="absolute";return u&&g&&(b=hu(y),b.time=pi.time,b.width=y[f]),ir(m?_*i/h:_&&i?h/_*i:0)},ka=function(e,n,r,s){var i;return RE||eS(),n in Wo&&n!=="transform"&&(n=Wo[n],~n.indexOf(",")&&(n=n.split(",")[0])),Ua[n]&&n!=="transform"?(i=im(e,s),i=n!=="transformOrigin"?i[n]:i.svg?i.origin:ny(gi(e,Xs))+" "+i.zOrigin+"px"):(i=e.style[n],(!i||i==="auto"||s||~(i+"").indexOf("calc("))&&(i=ty[n]&&ty[n](e,n,r)||gi(e,n)||p9(e,n)||(n==="opacity"?1:0))),r&&!~(i+"").trim().indexOf(" ")?ic(e,n,i,r)+r:i},Vhe=function(e,n,r,s){if(!r||r==="none"){var i=If(n,e,1),o=i&&gi(e,i,1);o&&o!==r?(n=i,r=o):n==="borderColor"&&(r=gi(e,"borderTopColor"))}var l=new Ys(this._pt,e.style,n,0,1,z9),u=0,d=0,f,h,m,g,_,y,b,x,S,E,C,R;if(l.b=r,l.e=s,r+="",s+="",s.substring(0,6)==="var(--"&&(s=gi(e,s.substring(4,s.indexOf(")")))),s==="auto"&&(y=e.style[n],e.style[n]=s,s=gi(e,n)||s,y?e.style[n]=y:sc(e,n)),f=[r,s],M9(f),r=f[0],s=f[1],m=r.match(Ad)||[],R=s.match(Ad)||[],R.length){for(;h=Ad.exec(s);)b=h[0],S=s.substring(u,h.index),_?_=(_+1)%5:(S.substr(-5)==="rgba("||S.substr(-5)==="hsla(")&&(_=1),b!==(y=m[d++]||"")&&(g=parseFloat(y)||0,C=y.substr((g+"").length),b.charAt(1)==="="&&(b=Vd(g,b)+C),x=parseFloat(b),E=b.substr((x+"").length),u=Ad.lastIndex-E.length,E||(E=E||yi.units[n]||C,u===s.length&&(s+=E,l.e+=E)),C!==E&&(g=ic(e,n,y,E)||0),l._pt={_next:l._pt,p:S||d===1?S:",",s:g,c:x-g,m:_&&_<4||n==="zIndex"?Math.round:0});l.c=u<s.length?s.substring(u,s.length):""}else l.r=n==="display"&&s==="none"?Z9:U9;return c9.test(s)&&(l.e=0),this._pt=l,l},II={top:"0%",bottom:"100%",left:"0%",right:"100%",center:"50%"},Hhe=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]=II[r]||r,n[1]=II[s]||s,n.join(" ")},Uhe=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],Ua[l]&&(u=1,l=l==="transformOrigin"?Xs:Zn),sc(r,l);u&&(sc(r,Zn),o&&(o.svg&&r.removeAttribute("transform"),s.scale=s.rotate=s.translate="none",im(r,1),o.uncache=1,B9(s)))}},ty={clearProps:function(e,n,r,s,i){if(i.data!=="isFromStart"){var o=e._pt=new Ys(e._pt,n,r,0,0,Uhe);return o.u=s,o.pr=-10,o.tween=i,e._props.push(r),1}}},sm=[1,0,0,1,0,0],Y9={},X9=function(e){return e==="matrix(1, 0, 0, 1, 0, 0)"||e==="none"||!e},OI=function(e){var n=gi(e,Zn);return X9(n)?sm:n.substr(7).match(l9).map(ir)},OE=function(e,n){var r=e._gsap||hu(e),s=e.style,i=OI(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"?sm:i):(i===sm&&!e.offsetParent&&e!==Hd&&!r.svg&&(u=s.display,s.display="block",o=e.parentNode,(!o||!e.offsetParent&&!e.getBoundingClientRect().width)&&(d=1,l=e.nextElementSibling,Hd.appendChild(e)),i=OI(e),u?s.display=u:sc(e,"display"),d&&(l?o.insertBefore(e,l):o?o.appendChild(e):Hd.removeChild(e))),n&&i.length>6?[i[0],i[1],i[4],i[5],i[12],i[13]]:i)},tS=function(e,n,r,s,i,o){var l=e._gsap,u=i||OE(e,!0),d=l.xOrigin||0,f=l.yOrigin||0,h=l.xOffset||0,m=l.yOffset||0,g=u[0],_=u[1],y=u[2],b=u[3],x=u[4],S=u[5],E=n.split(" "),C=parseFloat(E[0])||0,R=parseFloat(E[1])||0,O,I,A,L;r?u!==sm&&(I=g*b-_*y)&&(A=C*(b/I)+R*(-y/I)+(y*S-b*x)/I,L=C*(-_/I)+R*(g/I)-(g*S-_*x)/I,C=A,R=L):(O=G9(e),C=O.x+(~E[0].indexOf("%")?C/100*O.width:C),R=O.y+(~(E[1]||E[0]).indexOf("%")?R/100*O.height:R)),s||s!==!1&&l.smooth?(x=C-d,S=R-f,l.xOffset=h+(x*g+S*y)-x,l.yOffset=m+(x*_+S*b)-S):l.xOffset=l.yOffset=0,l.xOrigin=C,l.yOrigin=R,l.smooth=!!s,l.origin=n,l.originIsAbsolute=!!r,e.style[Xs]="0px 0px",o&&(Fl(o,l,"xOrigin",d,C),Fl(o,l,"yOrigin",f,R),Fl(o,l,"xOffset",h,l.xOffset),Fl(o,l,"yOffset",m,l.yOffset)),e.setAttribute("data-svg-origin",C+" "+R)},im=function(e,n){var r=e._gsap||new N9(e);if("x"in r&&!n&&!r.uncache)return r;var s=e.style,i=r.scaleX<0,o="px",l="deg",u=getComputedStyle(e),d=gi(e,Xs)||"0",f,h,m,g,_,y,b,x,S,E,C,R,O,I,A,L,N,H,$,W,X,z,K,te,Z,J,q,j,Y,ue,ie,ce;return f=h=m=y=b=x=S=E=C=0,g=_=1,r.svg=!!(e.getCTM&&q9(e)),u.translate&&((u.translate!=="none"||u.scale!=="none"||u.rotate!=="none")&&(s[Zn]=(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[Zn]!=="none"?u[Zn]:"")),s.scale=s.rotate=s.translate="none"),I=OE(e,r.svg),r.svg&&(r.uncache?(Z=e.getBBox(),d=r.xOrigin-Z.x+"px "+(r.yOrigin-Z.y)+"px",te=""):te=!n&&e.getAttribute("data-svg-origin"),tS(e,te||d,!!te||r.originIsAbsolute,r.smooth!==!1,I)),R=r.xOrigin||0,O=r.yOrigin||0,I!==sm&&(H=I[0],$=I[1],W=I[2],X=I[3],f=z=I[4],h=K=I[5],I.length===6?(g=Math.sqrt(H*H+$*$),_=Math.sqrt(X*X+W*W),y=H||$?md($,H)*Uc:0,S=W||X?md(W,X)*Uc+y:0,S&&(_*=Math.abs(Math.cos(S*Ud))),r.svg&&(f-=R-(R*H+O*W),h-=O-(R*$+O*X))):(ce=I[6],ue=I[7],q=I[8],j=I[9],Y=I[10],ie=I[11],f=I[12],h=I[13],m=I[14],A=md(ce,Y),b=A*Uc,A&&(L=Math.cos(-A),N=Math.sin(-A),te=z*L+q*N,Z=K*L+j*N,J=ce*L+Y*N,q=z*-N+q*L,j=K*-N+j*L,Y=ce*-N+Y*L,ie=ue*-N+ie*L,z=te,K=Z,ce=J),A=md(-W,Y),x=A*Uc,A&&(L=Math.cos(-A),N=Math.sin(-A),te=H*L-q*N,Z=$*L-j*N,J=W*L-Y*N,ie=X*N+ie*L,H=te,$=Z,W=J),A=md($,H),y=A*Uc,A&&(L=Math.cos(A),N=Math.sin(A),te=H*L+$*N,Z=z*L+K*N,$=$*L-H*N,K=K*L-z*N,H=te,z=Z),b&&Math.abs(b)+Math.abs(y)>359.9&&(b=y=0,x=180-x),g=ir(Math.sqrt(H*H+$*$+W*W)),_=ir(Math.sqrt(K*K+ce*ce)),A=md(z,K),S=Math.abs(A)>2e-4?A*Uc:0,C=ie?1/(ie<0?-ie:ie):0),r.svg&&(te=e.getAttribute("transform"),r.forceCSS=e.setAttribute("transform","")||!X9(gi(e,Zn)),te&&e.setAttribute("transform",te))),Math.abs(S)>90&&Math.abs(S)<270&&(i?(g*=-1,S+=y<=0?180:-180,y+=y<=0?180:-180):(_*=-1,S+=S<=0?180:-180)),n=n||r.uncache,r.x=f-((r.xPercent=f&&(!n&&r.xPercent||(Math.round(e.offsetWidth/2)===Math.round(-f)?-50:0)))?e.offsetWidth*r.xPercent/100:0)+o,r.y=h-((r.yPercent=h&&(!n&&r.yPercent||(Math.round(e.offsetHeight/2)===Math.round(-h)?-50:0)))?e.offsetHeight*r.yPercent/100:0)+o,r.z=m+o,r.scaleX=ir(g),r.scaleY=ir(_),r.rotation=ir(y)+l,r.rotationX=ir(b)+l,r.rotationY=ir(x)+l,r.skewX=S+l,r.skewY=E+l,r.transformPerspective=C+o,(r.zOrigin=parseFloat(d.split(" ")[2])||!n&&r.zOrigin||0)&&(s[Xs]=ny(d)),r.xOffset=r.yOffset=0,r.force3D=yi.force3D,r.renderTransform=r.svg?Bhe:K9?Q9:Zhe,r.uncache=0,r},ny=function(e){return(e=e.split(" "))[0]+" "+e[1]},_b=function(e,n,r){var s=ds(n);return ir(parseFloat(n)+parseFloat(ic(e,"x",r+"px",s)))+s},Zhe=function(e,n){n.z="0px",n.rotationY=n.rotationX="0deg",n.force3D=0,Q9(e,n)},Fc="0deg",Nh="0px",jc=") ",Q9=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,m=r.skewX,g=r.skewY,_=r.scaleX,y=r.scaleY,b=r.transformPerspective,x=r.force3D,S=r.target,E=r.zOrigin,C="",R=x==="auto"&&e&&e!==1||x===!0;if(E&&(h!==Fc||f!==Fc)){var O=parseFloat(f)*Ud,I=Math.sin(O),A=Math.cos(O),L;O=parseFloat(h)*Ud,L=Math.cos(O),o=_b(S,o,I*L*-E),l=_b(S,l,-Math.sin(O)*-E),u=_b(S,u,A*L*-E+E)}b!==Nh&&(C+="perspective("+b+jc),(s||i)&&(C+="translate("+s+"%, "+i+"%) "),(R||o!==Nh||l!==Nh||u!==Nh)&&(C+=u!==Nh||R?"translate3d("+o+", "+l+", "+u+") ":"translate("+o+", "+l+jc),d!==Fc&&(C+="rotate("+d+jc),f!==Fc&&(C+="rotateY("+f+jc),h!==Fc&&(C+="rotateX("+h+jc),(m!==Fc||g!==Fc)&&(C+="skew("+m+", "+g+jc),(_!==1||y!==1)&&(C+="scale("+_+", "+y+jc),S.style[Zn]=C||"translate(0, 0)"},Bhe=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,m=r.scaleY,g=r.target,_=r.xOrigin,y=r.yOrigin,b=r.xOffset,x=r.yOffset,S=r.forceCSS,E=parseFloat(o),C=parseFloat(l),R,O,I,A,L;u=parseFloat(u),d=parseFloat(d),f=parseFloat(f),f&&(f=parseFloat(f),d+=f,u+=f),u||d?(u*=Ud,d*=Ud,R=Math.cos(u)*h,O=Math.sin(u)*h,I=Math.sin(u-d)*-m,A=Math.cos(u-d)*m,d&&(f*=Ud,L=Math.tan(d-f),L=Math.sqrt(1+L*L),I*=L,A*=L,f&&(L=Math.tan(f),L=Math.sqrt(1+L*L),R*=L,O*=L)),R=ir(R),O=ir(O),I=ir(I),A=ir(A)):(R=h,A=m,O=I=0),(E&&!~(o+"").indexOf("px")||C&&!~(l+"").indexOf("px"))&&(E=ic(g,"x",o,"px"),C=ic(g,"y",l,"px")),(_||y||b||x)&&(E=ir(E+_-(_*R+y*I)+b),C=ir(C+y-(_*O+y*A)+x)),(s||i)&&(L=g.getBBox(),E=ir(E+s/100*L.width),C=ir(C+i/100*L.height)),L="matrix("+R+","+O+","+I+","+A+","+E+","+C+")",g.setAttribute("transform",L),S&&(g.style[Zn]=L)},Whe=function(e,n,r,s,i){var o=360,l=jr(i),u=parseFloat(i)*(l&&~i.indexOf("rad")?Uc:1),d=u-s,f=s+d+"deg",h,m;return l&&(h=i.split("_")[1],h==="short"&&(d%=o,d!==d%(o/2)&&(d+=d<0?o:-o)),h==="cw"&&d<0?d=(d+o*CI)%o-~~(d/o)*o:h==="ccw"&&d>0&&(d=(d-o*CI)%o-~~(d/o)*o)),e._pt=m=new Ys(e._pt,n,r,s,d,The),m.e=f,m.u="deg",e._props.push(r),m},MI=function(e,n){for(var r in n)e[r]=n[r];return e},Khe=function(e,n,r){var s=MI({},r._gsap),i="perspective,force3D,transformOrigin,svgOrigin",o=r.style,l,u,d,f,h,m,g,_;s.svg?(d=r.getAttribute("transform"),r.setAttribute("transform",""),o[Zn]=n,l=im(r,1),sc(r,Zn),r.setAttribute("transform",d)):(d=getComputedStyle(r)[Zn],o[Zn]=n,l=im(r,1),o[Zn]=d);for(u in Ua)d=s[u],f=l[u],d!==f&&i.indexOf(u)<0&&(g=ds(d),_=ds(f),h=g!==_?ic(r,u,d,_):parseFloat(d),m=parseFloat(f),e._pt=new Ys(e._pt,l,u,h,m-h,Qx),e._pt.u=_||0,e._props.push(u));MI(l,s)};qs("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});ty[e>1?"border"+t:t]=function(l,u,d,f,h){var m,g;if(arguments.length<4)return m=o.map(function(_){return ka(l,_,d)}),g=m.join(" "),g.split(m[0]).length===5?m[0]:g;m=(f+"").split(" "),g={},o.forEach(function(_,y){return g[_]=m[y]=m[y]||m[(y-1)/2|0]}),l.init(u,g,h)}});var J9={name:"css",register:eS,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,m,g,_,y,b,x,S,E,C,R,O,I,A,L;RE||eS(),this.styles=this.styles||W9(e),A=this.styles.props,this.tween=r;for(y in n)if(y!=="autoRound"&&(f=n[y],!(ui[y]&&D9(y,n,r,s,e,i)))){if(g=typeof f,_=ty[y],g==="function"&&(f=f.call(r,s,e,i),g=typeof f),g==="string"&&~f.indexOf("random(")&&(f=em(f)),_)_(this,e,y,f,r)&&(I=1);else if(y.substr(0,2)==="--")d=(getComputedStyle(e).getPropertyValue(y)+"").trim(),f+="",Wl.lastIndex=0,Wl.test(d)||(b=ds(d),x=ds(f),x?b!==x&&(d=ic(e,y,d,x)+x):b&&(f+=b)),this.add(l,"setProperty",d,f,s,i,0,0,y),o.push(y),A.push(y,0,l[y]);else if(g!=="undefined"){if(u&&y in u?(d=typeof u[y]=="function"?u[y].call(r,s,e,i):u[y],jr(d)&&~d.indexOf("random(")&&(d=em(d)),ds(d+"")||d==="auto"||(d+=yi.units[y]||ds(ka(e,y))||""),(d+"").charAt(1)==="="&&(d=ka(e,y))):d=ka(e,y),m=parseFloat(d),S=g==="string"&&f.charAt(1)==="="&&f.substr(0,2),S&&(f=f.substr(2)),h=parseFloat(f),y in Wo&&(y==="autoAlpha"&&(m===1&&ka(e,"visibility")==="hidden"&&h&&(m=0),A.push("visibility",0,l.visibility),Fl(this,l,"visibility",m?"inherit":"hidden",h?"inherit":"hidden",!h)),y!=="scale"&&y!=="transform"&&(y=Wo[y],~y.indexOf(",")&&(y=y.split(",")[0]))),E=y in Ua,E){if(this.styles.save(y),L=f,g==="string"&&f.substring(0,6)==="var(--"){if(f=gi(e,f.substring(4,f.indexOf(")"))),f.substring(0,5)==="calc("){var N=e.style.perspective;e.style.perspective=f,f=gi(e,"perspective"),N?e.style.perspective=N:sc(e,"perspective")}h=parseFloat(f)}if(C||(R=e._gsap,R.renderTransform&&!n.parseTransform||im(e,n.parseTransform),O=n.smoothOrigin!==!1&&R.smooth,C=this._pt=new Ys(this._pt,l,Zn,0,1,R.renderTransform,R,0,-1),C.dep=1),y==="scale")this._pt=new Ys(this._pt,R,"scaleY",R.scaleY,(S?Vd(R.scaleY,S+h):h)-R.scaleY||0,Qx),this._pt.u=0,o.push("scaleY",y),y+="X";else if(y==="transformOrigin"){A.push(Xs,0,l[Xs]),f=Hhe(f),R.svg?tS(e,f,0,O,0,this):(x=parseFloat(f.split(" ")[2])||0,x!==R.zOrigin&&Fl(this,R,"zOrigin",R.zOrigin,x),Fl(this,l,y,ny(d),ny(f)));continue}else if(y==="svgOrigin"){tS(e,f,1,O,0,this);continue}else if(y in Y9){Whe(this,R,y,m,S?Vd(m,S+f):f);continue}else if(y==="smoothOrigin"){Fl(this,R,"smooth",R.smooth,f);continue}else if(y==="force3D"){R[y]=f;continue}else if(y==="transform"){Khe(this,f,e);continue}}else y in l||(y=If(y)||y);if(E||(h||h===0)&&(m||m===0)&&!Phe.test(f)&&y in l)b=(d+"").substr((m+"").length),h||(h=0),x=ds(f)||(y in yi.units?yi.units[y]:b),b!==x&&(m=ic(e,y,d,x)),this._pt=new Ys(this._pt,E?R:l,y,m,(S?Vd(m,S+h):h)-m,!E&&(x==="px"||y==="zIndex")&&n.autoRound!==!1?Ihe:Qx),this._pt.u=x||0,E&&L!==f?(this._pt.b=d,this._pt.e=L,this._pt.r=Ahe):b!==x&&x!=="%"&&(this._pt.b=d,this._pt.r=Rhe);else if(y in l)Vhe.call(this,e,y,d,S?S+f:f);else if(y in e)this.add(e,y,d||e[y],S?S+f:f,s,i);else if(y!=="parseTransform"){_E(y,f);continue}E||(y in l?A.push(y,0,l[y]):typeof e[y]=="function"?A.push(y,2,e[y]()):A.push(y,1,d||e[y])),o.push(y)}}I&&V9(this)},render:function(e,n){if(n.tween._time||!AE())for(var r=n._pt;r;)r.r(e,r.d),r=r._next;else n.styles.revert()},get:ka,aliases:Wo,getSetter:function(e,n,r){var s=Wo[n];return s&&s.indexOf(",")<0&&(n=s),n in Ua&&n!==Xs&&(e._gsap.x||ka(e,"x"))?r&&EI===r?n==="scale"?Nhe:Lhe:(EI=r||{})&&(n==="scale"?Dhe:$he):e.style&&!gE(e.style[n])?Ohe:~n.indexOf("-")?Mhe:PE(e,n)},core:{_removeProperty:sc,_getMatrix:OE}};Qs.utils.checkPrefix=If;Qs.core.getStyleSaver=W9;(function(t,e,n,r){var s=qs(t+","+e+","+n,function(i){Ua[i]=1});qs(e,function(i){yi.units[i]="deg",Y9[i]=1}),Wo[s[13]]=t+","+e,qs(r,function(i){var o=i.split(":");Wo[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");qs("x,y,z,top,right,bottom,left,width,height,fontSize,padding,margin,perspective",function(t){yi.units[t]="px"});Qs.registerPlugin(J9);var io=Qs.registerPlugin(J9)||Qs;io.core.Tween;const Wg="/assets/logo-animation",wb=1280,Ghe=[{id:"eraser",src:`${Wg}/eraser.png`,cssW:189,cssH:74,rot:-90,fit:337,localX:60,localY:168,seaX:.2,seaY:.27,seaRot:-8},{id:"clasp",src:`${Wg}/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:`${Wg}/playdough.png`,cssW:236,cssH:206,rot:5,fit:150,localX:182,localY:277,seaX:.52,seaY:.79,seaRot:6}],qhe=[{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}],nS=({className:t})=>{const e=v.useRef(null),n=v.useRef(null),r=v.useRef(null);return v.useEffect(()=>{const s=e.current,i=n.current,o=r.current;if(!s||!i||!o)return;const l=window.matchMedia("(prefers-reduced-motion: reduce)").matches,u=(x,S)=>x+Math.random()*(S-x);let d=null,f,h=1;const m=Ghe.map(x=>({...x})),g=()=>{s.querySelectorAll(".la-obj").forEach(A=>A.remove());const x=s.getBoundingClientRect(),S=x.width||wb,E=x.height||wb*.64;h=S/wb,i.style.width=`${242*h}px`,i.style.height=`${250*h}px`;const R=250*h/337,O=[],I=(A,L,N)=>{const H=document.createElement("div");return H.className="la-obj",H.style.width=`${L}px`,H.innerHTML=`<img src="${A}" alt="" style="${N?"transform:scaleX(-1)":""}">`,s.appendChild(H),H};return qhe.forEach((A,L)=>{const N=A.w*h,H=I(`${Wg}/sea/${A.k}.png`,N,L%2===0);io.set(H,{x:A.x*S-N/2,y:A.y*E-N/2,rotation:A.r,opacity:1,scale:0,transformOrigin:"50% 50%"}),O.push({el:H,hero:!1,rest:1})}),m.forEach(A=>{const L=A.cssW*h;A.el=I(A.src,L,!!A.flip),A.finalScale=A.fit*R/(A.cssW*h),io.set(A.el,{x:A.seaX*S-L/2,y:A.seaY*E-A.cssH*h/2,rotation:A.seaRot,opacity:1,scale:0,transformOrigin:"50% 50%",zIndex:30}),O.push({el:A.el,hero:!0,rest:150/A.cssW})}),O},_=(x,S)=>{const E=s.getBoundingClientRect(),C=o.getBoundingClientRect();return{x:C.left-E.left+x/326*C.width,y:C.top-E.top+S/337*C.height}},y=()=>{d&&d.revert();const x=g();if(l){d=io.context(()=>{x.filter(C=>!C.hero).forEach(C=>io.set(C.el,{scale:0})),m.forEach(C=>{if(!C.el)return;const R=_(C.localX,C.localY);io.set(C.el,{x:R.x-C.cssW*h/2,y:R.y-C.cssH*h/2,rotation:C.rot,scale:C.finalScale})})},s);return}const S=[],E=[];d=io.context(()=>{const C=io.timeline();C.to(x.map(R=>R.el),{scale:R=>x[R].rest,duration:.5,ease:"steps(4)",stagger:{each:.045,from:"random"}}),C.add(()=>{x.forEach(({el:R,hero:O},I)=>{const A=O?S:E,L=I%2?1:-1;A.push(io.to(R,{rotation:"+="+u(2.5,6)*L,duration:u(.5,.9),repeat:-1,yoyo:!0,ease:"steps(2)",delay:u(0,.4)}),io.to(R,{y:"+="+u(5,11)*L,x:"+="+u(4,9)*-L,duration:u(.7,1.2),repeat:-1,yoyo:!0,ease:"steps(3)",delay:u(0,.4)}))})},"<0.1"),C.to({},{duration:1.1}),C.add("pick"),m.forEach((R,O)=>{R.el&&C.to(R.el,{scale:150/R.cssW*1.2,duration:.28,ease:"steps(3)",yoyo:!0,repeat:1},"pick+="+O*.08)}),C.add("clear","pick+=0.7"),C.add(()=>E.forEach(R=>R.kill()),"clear"),C.to(x.filter(R=>!R.hero).map(R=>R.el),{scale:0,rotation:"+=40",duration:.5,ease:"steps(5)",overwrite:"auto",stagger:{each:.025,from:"random"}},"clear"),C.add("assemble","clear+=0.25"),C.add(()=>S.forEach(R=>R.kill()),"assemble"),m.forEach((R,O)=>{if(!R.el||R.finalScale===void 0)return;const I=_(R.localX,R.localY);C.to(R.el,{x:I.x-R.cssW*h/2,y:I.y-R.cssH*h/2,rotation:R.rot,scale:R.finalScale,duration:1.05,ease:"steps(9)",overwrite:"auto"},"assemble+="+O*.12)}),m.forEach(R=>{!R.el||R.finalScale===void 0||C.to(R.el,{scale:R.finalScale*1.03,duration:.16,ease:"steps(2)",yoyo:!0,repeat:1},"assemble+=1.45")})},s)};io.ticker.fps(12),y();const b=()=>{clearTimeout(f),f=setTimeout(y,250)};return window.addEventListener("resize",b),()=>{window.removeEventListener("resize",b),clearTimeout(f),d==null||d.revert(),s.querySelectorAll(".la-obj").forEach(x=>x.remove())}},[]),T.jsx("div",{ref:e,className:`la-scene ${t??""}`,children:T.jsx("div",{ref:n,className:"la-logo-stage",children:T.jsx("svg",{ref:r,className:"la-mark",viewBox:"0 0 326 337","aria-hidden":"true"})})})},Yhe=Object.freeze(Object.defineProperty({__proto__:null,default:nS},Symbol.toStringTag,{value:"Module"})),LI=({isSigningIn:t})=>t?T.jsxs(T.Fragment,{children:[T.jsx("div",{className:"h-5 w-5 animate-spin rounded-full border-2 border-current border-t-transparent"}),T.jsx("span",{children:"Signing in..."})]}):T.jsxs(T.Fragment,{children:[T.jsx("img",{src:"https://www.gstatic.com/firebasejs/ui/2.0.0/images/auth/google.svg",alt:"Google",className:"h-5 w-5"}),T.jsx("span",{children:"Sign in with Google"})]}),Xhe=({isSigningIn:t,onStartSignIn:e,errorMessage:n=null,displayMode:r="full"})=>r==="modal"?T.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:[T.jsx(nS,{className:"relative z-0 h-44 w-full"}),T.jsxs("div",{className:"relative z-10 flex flex-col items-center gap-6 px-8 pb-12 pt-8",children:[T.jsxs("div",{className:"flex flex-col items-center gap-2 text-center",children:[T.jsx("h1",{className:"text-xl font-medium text-content",children:"Welcome to Rivet"}),T.jsx("p",{className:"text-sm leading-relaxed text-content-muted",children:"Rivet understands your references, and then explores dozens of design directions with you."})]}),T.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:T.jsx(LI,{isSigningIn:t})}),n?T.jsx("p",{className:"text-center text-xs text-red-200",children:n}):null]})]}):T.jsxs("div",{className:"relative flex min-h-screen flex-col items-center justify-center overflow-hidden bg-white font-main text-[#18181b]",children:[T.jsx(nS,{className:"absolute inset-0 z-0"}),T.jsxs("div",{className:"pointer-events-none absolute inset-x-0 bottom-0 z-10 flex flex-col items-center gap-5 pb-[14vh]",children:[T.jsxs("div",{className:"flex flex-col items-center gap-2 px-6 text-center",children:[T.jsx("h1",{className:"text-xl font-medium tracking-tight text-[#18181b]",children:"Welcome to Rivet"}),T.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."})]}),T.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:T.jsx(LI,{isSigningIn:t})}),n?T.jsx("p",{className:"text-center text-xs text-red-500",children:n}):null]})]}),Qhe="/assets/rivet-wordmark-orange-CYKVQDmG.svg",Jhe=({message:t})=>T.jsx("div",{className:"relative flex min-h-screen flex-col items-center justify-center overflow-hidden bg-[#1c1c20] font-main text-white",children:T.jsxs("div",{className:"flex flex-col items-center gap-10",children:[T.jsx("img",{src:Qhe,alt:"Rivet",className:"h-8 w-auto object-contain"}),T.jsxs("div",{className:"glass-panel flex items-center gap-3 rounded-xl px-8 py-3.5 text-sm font-medium",children:[T.jsx(Ik,{className:"h-5 w-5 shrink-0 animate-spin text-primary",weight:"bold"}),T.jsx("span",{children:t})]})]})}),epe="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",ry=44,Dh=8,hg=16,tpe=4,NI=-18,npe=.18,rpe=[.22,1,.36,1],DI=.92,spe=1,ipe=.95,ope=.4,ape=[.19,1,.22,1],bb=0,lpe=1,cpe=0,upe=0,dpe=0,ej=({position:t,viewport:e,boundsLeft:n=0})=>{const r=n+Dh,s=Math.max(r,e.width-ry-Dh),i=Math.max(Dh,e.height-ry-Dh);return{x:Math.min(s,Math.max(r,t.x)),y:Math.min(i,Math.max(Dh,t.y))}},ME=()=>({width:window.innerWidth,height:window.innerHeight}),fpe=({position:t,boundsLeftPx:e=0})=>ej({position:t,viewport:ME(),boundsLeft:e}),hpe=()=>{if(typeof window>"u")return{x:hg,y:hg};const t=ME();return{x:t.width-ry-hg,y:t.height-ry-hg}},ppe=({deltaX:t,deltaY:e})=>Math.hypot(t,e)>=tpe,mpe=t=>t.button===void 0||t.button<=dpe,$I=t=>{const e=t.nativeEvent;return{x:Number.isFinite(t.clientX)?t.clientX:e.clientX,y:Number.isFinite(t.clientY)?t.clientY:e.clientY}},gpe=({isVisible:t,isPanelOpen:e,isReducedMotion:n,position:r,dragBoundsLeftPx:s=0,onToggle:i,onPositionChange:o})=>{const l=v.useRef(null),u=v.useRef(!1),[d,f]=v.useState(!1),[h,m]=v.useState(!1),[g,_]=v.useState(!1),y=n?!1:{opacity:bb,scale:DI,x:NI},b=n?{opacity:bb}:{opacity:bb,scale:DI,x:NI},x=n?{duration:upe}:{duration:npe,ease:rpe,scale:{duration:ope,ease:ape}},S=v.useCallback(()=>{const L=l.current;L&&(u.current=L.hasMoved),l.current=null,f(!1)},[]),E=v.useCallback(L=>{const N=l.current;if(!N)return;const H=$I(L),$=H.x-N.startPointer.x,W=H.y-N.startPointer.y,X=N.hasMoved||ppe({deltaX:$,deltaY:W});l.current={...N,hasMoved:X},X&&o(ej({position:{x:N.startPosition.x+$,y:N.startPosition.y+W},viewport:ME(),boundsLeft:s}))},[o,s]),C=v.useCallback(L=>{if(l.current||!mpe(L))return;const N=$I(L);l.current={startPointer:N,startPosition:r,hasMoved:!1},f(!0)},[r]),R=v.useCallback(()=>{if(u.current){u.current=!1;return}i()},[i]),O=e?jx:bue,I=dE(),A=!d&&(h||g);return T.jsxs(T.Fragment,{children:[d?T.jsx("div",{className:"fixed inset-0 z-40 cursor-grabbing","data-cy":"rivet-panel-launcher-drag-surface",onPointerMove:E,onPointerUp:S,onPointerCancel:S,onMouseMove:E,onMouseUp:S}):null,T.jsx(Dd,{children:t?T.jsx(kf,{label:O,side:"top",forceOpen:A?void 0:!1,children:T.jsx(La.button,{type:"button","aria-label":O,"aria-keyshortcuts":I.ariaKeyShortcuts,"data-cy":"reopen-panel",onMouseEnter:()=>m(!0),onMouseLeave:()=>m(!1),onFocus:L=>_(L.currentTarget.matches(":focus-visible")),onBlur:()=>_(!1),initial:y,animate:{opacity:lpe,scale:spe,x:cpe},whileTap:{scale:ipe},exit:b,transition:x,onPointerDown:C,onMouseDown:C,onPointerMove:E,onPointerUp:S,onPointerCancel:S,onMouseMove:E,onMouseUp:S,onClick:R,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:T.jsx("img",{src:epe,alt:"","aria-hidden":"true",draggable:!1,className:"h-4 w-4 brightness-0 invert"})})}):null})]})},xb=ti("useConfig"),vpe=300*1e3,ype=1800*1e3,_pe=60*1e3,wpe=300*1e3,bpe=()=>{var t;return typeof window>"u"?null:((t=window.__RIVET_BOOTSTRAP__)==null?void 0:t.queueAccessToken)??null},xpe=()=>{var t;return typeof window>"u"?null:((t=window.__RIVET_BOOTSTRAP__)==null?void 0:t.agentApplyMode)??null},Spe=ze({featureFlags:US(re(),ze({isEnabled:Zs()})).optional()}),kpe=async()=>{const t=await Dt("/api/feature-flags");if(!t.ok)throw new Error(`Failed to fetch feature flags: ${t.statusText}`);return Spe.parse(await t.json())},Epe=t=>({...pF,...t??{}}),Cpe=()=>{const t=bt(Nx),e=Mt(Nx),n=Mt(xF),r=Mt(SF),s=Mt(Uy),i=Mt(Vce),o=Mt(jce),l=Mt($ce),u=Mt(Hy),d=Mt(Dce),f=Mt(Fce),h=v.useCallback(x=>{o(x.agentModeAvailable),f(x.projectId??null),d({name:x.name??null,email:x.email??null}),x.isMCPSession&&n(!0),x.mcpEditor&&r(x.mcpEditor),s(x.agentApplyMode??xpe()??null),i(x.queueAccessToken??bpe())},[s,o,n,r,i,f,d]),m=Qo({queryKey:Ks.rivetConfig,queryFn:UF,staleTime:vpe,gcTime:ype}),g=Qo({queryKey:Ks.featureFlags,queryFn:kpe,staleTime:_pe,gcTime:wpe}),{refetch:_}=m,{refetch:y}=g;v.useLayoutEffect(()=>{m.data&&(h(m.data),u(!1),xb.info("Config loaded:",m.data)),g.data&&(e(Epe(g.data.featureFlags)),l(!0)),m.error&&(l(!0),u(!1),xb.warn("Failed to load config:",m.error.message)),g.error&&(l(!0),xb.warn("Failed to load feature flags:",g.error.message))},[m.data,m.error,g.data,g.error,h,u,e,l]);const b=v.useCallback(async()=>{const[x]=await Promise.all([_(),y()]);return x.data?x.data:null},[_,y]);return{config:m.data??null,featureFlags:t,loading:m.isPending||!m.error&&g.isPending,error:m.error?m.error.message:null,refetchConfig:b}},gd=ti("useOAuthCallback"),Ppe=()=>{const[t,e]=v.useState({isProcessing:!1,isComplete:!1,error:null});return v.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{gd.info("Processing OAuth callback...");const f=new URLSearchParams(i.substring(1)),h=f.get("access_token"),m=f.get("refresh_token"),_=new URLSearchParams(o).get("session");if(!h)throw new Error("No access token found in URL");if(!_)throw new Error("No session ID found in URL");gd.info(`Completing OAuth with session: ${_}`);const y=await fetch(`${zx}/api/auth/google/complete`,{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({sessionId:_,accessToken:h,refreshToken:m}),signal:n.signal}),b=await y.json();if(!y.ok||!b.success)throw new Error(b.error||b.message||"Failed to complete authentication");if(gd.info("OAuth authentication completed successfully"),r)return;if(H5({userId:(l=b.user)==null?void 0:l.id,email:(u=b.user)==null?void 0:u.email}),(d=b.user)!=null&&d.email&&h)try{const S=await Dt("/api/auth/store",{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({email:b.user.email,token:h,refreshToken:m,userId:b.user.id}),signal:n.signal});S.ok||gd.warn(`Local auth store returned ${S.status}`)}catch(S){if(r)return;gd.warn("Failed to store auth locally:",S)}if(r)return;window.sessionStorage.setItem(Kv,"1");const x=window.location.pathname;window.history.replaceState({},document.title,x),e({isProcessing:!1,isComplete:!0,error:null})}catch(f){if(r)return;gd.warn("OAuth callback error:",f),e({isProcessing:!1,isComplete:!1,error:Us(f,"Unknown error occurred")})}}})(),()=>{r=!0,n.abort()}},[]),t},Tpe=3e3,Rpe=(t,e=Dt)=>{const n=new AbortController;let r;const s={onmessage:null,onerror:null,close:()=>{n.abort(),clearTimeout(r)}},i=async()=>{var l,u,d;let o=!1;try{const f=await e(t,{signal:n.signal,headers:{Accept:"text/event-stream"}});if(o=f.status===401||f.status===403,!f.ok||!f.body)throw await((l=f.body)==null?void 0:l.cancel()),new Error(`Event stream request failed (${f.status}).`);const h=f.body.getReader(),m=new TextDecoder;let g="",_=[];try{for(;!n.signal.aborted;){const y=await h.read();if(y.done)break;g+=m.decode(y.value,{stream:!0});let b=g.indexOf(`
215
- `);for(;b!==-1;){const x=g.slice(0,b).replace(/\r$/,"");g=g.slice(b+1),x===""?(_.length>0&&!n.signal.aborted&&((u=s.onmessage)==null||u.call(s,{data:_.join(`
216
- `)})),_=[]):x.startsWith("data:")&&_.push(x.slice(5).replace(/^ /,"")),b=g.indexOf(`
217
- `)}}}finally{await h.cancel().catch(()=>{}),h.releaseLock()}}catch(f){n.signal.aborted||(d=s.onerror)==null||d.call(s,f)}!n.signal.aborted&&!o&&(r=setTimeout(()=>void i(),Tpe))};return i(),s},Sb=ti("useAgentVariantsSession"),Ape=({enabled:t=!0}={})=>{const e=Mt(km),n=Mt(wF),r=Mt(mF),s=Mt(bF),i=v.useRef(null);v.useEffect(()=>{if(n(!1),!t)return;const o=Rpe("/api/variants/events");return o.onmessage=l=>{try{const u=JSON.parse(l.data),d=i.current;if(u.active){const h=new Set(u.variants.map(m=>m.requestId).filter(m=>!!m));s(m=>m.filter(_=>!h.has(_.requestId))),u.sessionId!==i.current&&(i.current=u.sessionId,r(!0))}else i.current=null;e(u),n(!0),u.active&&u.sessionId!==d&&Dt(`/api/variants/${u.sessionId}/preview-port`,{method:"POST",headers:{"content-type":"application/json"},body:JSON.stringify({variantId:null})}).catch(h=>Sb.warn("failed to reset preview-port on session switch",h))}catch(u){Sb.warn("failed to parse SSE event payload",u)}},o.onerror=l=>{Sb.warn("SSE error (auto-reconnects)",l)},()=>{o.close()}},[t,e,n,r,s])},rS=274,sy=395,kb=Math.min(sy,Math.round((rS+sy)/2*1.1)),FI="rivet:panelWidth:v2",Ipe=({projectPath:t,libraryOrigin:e})=>{const n=bt(vF)>0,[r,s]=KD(mF),i=xi(),o=Ine(),l=v.useCallback(N=>{const H=!r;i==null||i.capture("editor.ui_toggled",{source:N,isOpen:H}),s(H)},[r,i,s]),[u,d]=v.useState(()=>{if(typeof window>"u")return kb;const N=Number(window.localStorage.getItem(FI));return Number.isFinite(N)&&N>=rS&&N<=sy?N:kb}),[f,h]=v.useState(!1),[m,g]=v.useState(hpe),_=r?u:0,y=r?Zv.slow:Zv.moderate,[b,x]=v.useState(r);!r&&b&&x(!1);const[S,E]=v.useState(0);_!==S&&(E(_),r&&g(N=>fpe({position:N,boundsLeftPx:u}))),v.useEffect(()=>{window.localStorage.setItem(FI,String(u))},[u]),v.useEffect(()=>{const N=H=>{if(!zD(H.target)){if(Pue(H)){H.preventDefault(),l("shortcut");return}H.key!=="Escape"||!r||(H.preventDefault(),s(!1))}};return window.addEventListener("keydown",N),()=>window.removeEventListener("keydown",N)},[r,s,l]);const C=v.useCallback(N=>{N.preventDefault(),N.stopPropagation();const H=N.clientX,$=u;h(!0);const W=z=>{const K=Math.min(sy,Math.max(rS,$+(z.clientX-H)));d(K)},X=()=>{window.removeEventListener("pointermove",W),window.removeEventListener("pointerup",X),window.removeEventListener("pointercancel",X),h(!1)};window.addEventListener("pointermove",W),window.addEventListener("pointerup",X),window.addEventListener("pointercancel",X)},[u]),R=v.useCallback(()=>d(kb),[]),O=Ppe(),I=bt(Hy);Ape({enabled:!I});const A=O.isProcessing?"Completing authentication...":null,L=Mt(Vy);return v.useEffect(()=>{L(t??null)},[t,L]),T.jsxs(La.div,{className:"relative flex h-screen overflow-hidden",initial:!1,animate:{opacity:1},transition:{duration:.5,ease:"easeOut"},"data-cy":"rivet-app",children:[A!==null?T.jsx("div",{className:"absolute inset-0 z-50",children:T.jsx(Jhe,{message:A})}):null,T.jsx(Pfe,{}),T.jsx(T.Fragment,{children:n?null:T.jsxs(T.Fragment,{children:[T.jsx("div",{className:"relative order-first h-full flex-shrink-0",style:{width:b?u:0},children:T.jsxs(La.div,{className:"absolute inset-y-0 left-0 z-30",initial:!1,animate:{x:r?0:-u},transition:o?{duration:0}:y,onAnimationComplete:()=>{r&&x(!0)},style:{width:u,willChange:"transform"},children:[T.jsx(Rde,{onClose:()=>s(!1),libraryOrigin:e}),T.jsx("div",{role:"separator","aria-orientation":"vertical","aria-label":"Resize panel",onPointerDown:C,onDoubleClick:R,className:"group/resize absolute inset-y-0 right-0 z-20 flex w-3 cursor-col-resize touch-none justify-end",children:T.jsx("span",{className:`h-full transition-all duration-150 ${f?"bg-content-muted w-0.5":"bg-divider group-hover/resize:bg-content-muted w-px group-hover/resize:w-0.5"}`})})]})}),f&&T.jsx("div",{className:"fixed inset-0 z-[100] cursor-col-resize"}),T.jsx(gpe,{isVisible:!0,isPanelOpen:r,isReducedMotion:!!o,position:m,dragBoundsLeftPx:_,onPositionChange:g,onToggle:()=>l("click")})]})}),T.jsx(use,{duration:5e3,richColors:!0,toastOptions:{style:{maxHeight:"150px",overflow:"hidden"}}})]})},sS="rivet_connect_deep_link",Ope=()=>{if(typeof window>"u")return null;const t=new URLSearchParams(window.location.search),e=t.get("connect"),n=e??window.sessionStorage.getItem(sS);if(n!=="pinterest"&&n!=="arena"&&n!=="x")return null;if(window.sessionStorage.setItem(sS,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},Mpe=Ope(),Lpe=()=>{const[t]=v.useState(()=>typeof window<"u"&&window.sessionStorage.getItem(Kv)==="1"),[e,n]=v.useState(!1),[r,s]=v.useState(Mpe);v.useEffect(()=>{t&&window.sessionStorage.removeItem(Kv)},[t]);const{config:i,refetchConfig:o,loading:l,error:u}=Cpe(),d=Mt(Hy),{startLogin:f,isStartingLogin:h,loginError:m}=BF(),[g,_]=v.useState(!1);nre(i??void 0),v.useEffect(()=>{i&&Xe.register({source:"visual_editor",surface:"visual_editor"})},[i]);const y=i!=null&&i.agentModeAvailable!==!0,b=v.useCallback(async()=>{_(!0),d(!0);try{await o()}finally{d(!1),_(!1)}},[o,d]);if(!l&&i===null&&!g){const C=u||"Could not load Rivet configuration.";return T.jsx("div",{className:"bg-main flex h-screen items-center justify-center px-6",children:T.jsxs("div",{className:"border-divider bg-main w-full max-w-md rounded-lg border p-6 text-center shadow-lg",children:[T.jsx("p",{className:"text-content text-sm font-medium",children:"We could not start Rivet yet."}),T.jsx("p",{className:"text-content-muted mt-2 text-xs",children:C}),T.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:()=>{b()},children:"Retry"})]})})}if(y)return T.jsx(Xhe,{isSigningIn:h,onStartSignIn:()=>{f()},errorMessage:m,displayMode:"full"});const S=(i==null?void 0:i.agentModeAvailable)===!0&&r!==null,E=(i==null?void 0:i.agentModeAvailable)===!0&&t&&!e&&!S;return T.jsxs(T.Fragment,{children:[T.jsx(Ipe,{projectPath:i==null?void 0:i.projectPath,libraryOrigin:(i==null?void 0:i.libraryOrigin)??null}),T.jsx(Vx,{context:"onboarding",isOpen:E,onClose:()=>n(!0)}),T.jsx(Vx,{context:"menu",isOpen:S,highlightProvider:r,onClose:()=>{window.sessionStorage.removeItem(sS),s(null)}})]})};V7();const Npe=v.lazy(()=>YI(()=>import("./LibraryEntry-DS6Ce0sW.js"),[])),LE=window.location.pathname.startsWith("/rivet/library");LE||qne();const Dpe=new xX,$pe=()=>T.jsx("div",{style:{display:"flex",height:"100vh",alignItems:"center",justifyContent:"center"},children:T.jsx("p",{style:{fontSize:"14px",color:"#6b7280"},children:"Something went wrong. Please reload the page."})}),tj=document.getElementById("root");if(!tj)throw new Error("Rivet root element is missing");const Fpe=()=>tre.createRoot(tj).render(T.jsx(Se.StrictMode,{children:T.jsx(Pte,{reducedMotion:"user",children:T.jsx(Nne,{client:Xe,children:T.jsx(Vne,{fallback:T.jsx($pe,{}),children:T.jsx(YY,{client:Dpe,children:LE?T.jsx(v.Suspense,{fallback:T.jsx("div",{className:"bg-background h-screen"}),children:T.jsx(Npe,{})}):T.jsx(Lpe,{})})})})})})),jpe=async()=>{LE&&await VY(),await qY(),Fpe()};jpe();export{Due as $,Upe as A,ku as B,tn as C,Ly as D,Us as E,epe as F,wm as G,z5 as H,Qo as I,w$ as J,Ks as K,ze as L,Hpe as M,Vpe as N,Tt as O,sE as P,gX as Q,mp as R,Nf as S,pm as T,An as U,re as V,BS as W,Zs as X,fme as Y,hme as Z,HY as _,SX as a,Fr as a0,tN as a1,Kpe as a2,Wpe as a3,nre as a4,ame as a5,lme as a6,Tde as a7,use as a8,Jpe as a9,eme as aa,Tue as ab,Qpe as ac,qpe as ad,Gpe as ae,Bpe as af,Zpe as ag,Ype as ah,Xpe as ai,sme as aj,rme as ak,tme as al,BF as am,Dt as an,L5 as ao,zY as ap,jY as aq,nme as ar,CX as b,v as c,PX as d,AX as e,TX as f,ks as g,IX as h,OX as i,RX as j,xi as k,dF as l,T as m,kr as n,mx as o,iE as p,oE as q,K5 as r,kg as s,aE as t,mm as u,Ny as v,Dy as w,$y as x,Fy as y,jy as z};
218
- //# sourceMappingURL=main-DkKRuatC.js.map