@noxsoft/anima 6.0.0 → 7.0.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (134) hide show
  1. package/CHANGELOG.md +51 -0
  2. package/README.md +48 -0
  3. package/dist/{agent-VRQM14Xp.js → agent-BoAAHGEA.js} +3 -3
  4. package/dist/{agent-CnS0SRpT.js → agent-DuW0onwk.js} +4 -4
  5. package/dist/{agents-CvMRplDx.js → agents-BUXkSDns.js} +4 -4
  6. package/dist/{anthropic-direct-runner-C2Kwju-r.js → anthropic-direct-runner-DizCei79.js} +420 -4
  7. package/dist/{anthropic-direct-runner-BeYCnvZ8.js → anthropic-direct-runner-OjcTAH6g.js} +420 -3
  8. package/dist/{auth-choice-Dc5TAJwT.js → auth-choice-B1iGnjuE.js} +1 -1
  9. package/dist/{auth-choice-DY1saszS.js → auth-choice-HF9x6xk2.js} +1 -1
  10. package/dist/{banner-DAMtSjUF.js → banner-Dpa5d1If.js} +1 -1
  11. package/dist/build-info.json +3 -3
  12. package/dist/bundled/boot-md/handler.js +2 -2
  13. package/dist/bundled/session-memory/handler.js +1 -1
  14. package/dist/canvas-host/a2ui/.bundle.hash +1 -1
  15. package/dist/{channel-web-B8mzTSaY.js → channel-web-C5mzsaa3.js} +3 -3
  16. package/dist/{cli-hcHk5KuP.js → cli-Cuq4bIg4.js} +2 -2
  17. package/dist/{cli-D8exVpuI.js → cli-X9ikywQ3.js} +3 -3
  18. package/dist/{command-registry-D3VhxpWx.js → command-registry-9V4uqrBV.js} +12 -12
  19. package/dist/{completion-cli-B3BqQJq9.js → completion-cli-BtvcR-U5.js} +1 -1
  20. package/dist/{completion-cli-CepDzeW1.js → completion-cli-DNWDwhab.js} +2 -2
  21. package/dist/{config-cli-B6Np85rk.js → config-cli-DfHE3KG-.js} +1 -1
  22. package/dist/{config-cli-3CaIxSKo.js → config-cli-fleq7-gq.js} +1 -1
  23. package/dist/{configure-zXK6UZ51.js → configure-B2Mfnwy_.js} +3 -3
  24. package/dist/{configure-D88dg6mE.js → configure-SnvMHZPD.js} +7 -7
  25. package/dist/{configure-D882Bg7c.js → configure-ZWxixuRA.js} +3 -3
  26. package/dist/{configure-xpjwedvJ.js → configure-lkozxQed.js} +8 -8
  27. package/dist/context-mdxDsO1v.js +223 -0
  28. package/dist/control-ui/assets/index-Bwcvc7fq.css +1 -0
  29. package/dist/control-ui/assets/{index-yhFuaOnc.js → index-D4wqLVMN.js} +2 -2
  30. package/dist/control-ui/assets/{index-yhFuaOnc.js.map → index-D4wqLVMN.js.map} +1 -1
  31. package/dist/control-ui/assets/index-DIEQjjCN.js +73 -0
  32. package/dist/control-ui/assets/index-DIEQjjCN.js.map +1 -0
  33. package/dist/control-ui/assets/{observers-V7q9lNYt.js → observers-B7MfWiIZ.js} +2 -2
  34. package/dist/control-ui/assets/{observers-V7q9lNYt.js.map → observers-B7MfWiIZ.js.map} +1 -1
  35. package/dist/control-ui/index.html +2 -2
  36. package/dist/{deps-DyT32VfN.js → deps-BKLIBKjK.js} +1 -1
  37. package/dist/{doctor-WpKCNZeO.js → doctor-D7kKyUVk.js} +4 -4
  38. package/dist/{doctor-DEnSKgHu.js → doctor-DmCnZ-jF.js} +4 -4
  39. package/dist/{doctor-completion-CypXc1Uo.js → doctor-completion-B9SBdMoR.js} +1 -1
  40. package/dist/{doctor-completion-CPff9UlF.js → doctor-completion-BBvW4_J9.js} +1 -1
  41. package/dist/entry.js +1 -1
  42. package/dist/extensionAPI.js +1 -1
  43. package/dist/{gateway-cli-B_xsx5Nv.js → gateway-cli-CEM1vBuk.js} +15 -15
  44. package/dist/{gateway-cli-D3VBOA_i.js → gateway-cli-iumkTohn.js} +17 -17
  45. package/dist/{health-CabOEPQ0.js → health-B5N6_UOf.js} +3 -3
  46. package/dist/{health-C8KCBhuo.js → health-Cndq9b7A.js} +3 -3
  47. package/dist/{heartbeat-visibility-ZfNSbFcq.js → heartbeat-visibility-BQL13ZBH.js} +1 -1
  48. package/dist/{heartbeat-visibility-BjYY-mKG.js → heartbeat-visibility-CwcYugaR.js} +1 -1
  49. package/dist/{hooks-cli-Cs7GUa7G.js → hooks-cli-BZcvdIwE.js} +4 -4
  50. package/dist/{hooks-cli-DOs9WZ3K.js → hooks-cli-DSlPBQSY.js} +3 -3
  51. package/dist/index.js +10 -10
  52. package/dist/llm-slug-generator.js +1 -1
  53. package/dist/{login-BHnvW9HA.js → login-BEaBOSnw.js} +1 -1
  54. package/dist/{login-CrMpAZ0n.js → login-MzVPMRxL.js} +1 -1
  55. package/dist/{login-qr-DILcBA_q.js → login-qr-BjpDVBJE.js} +1 -1
  56. package/dist/{login-qr-CsAVGp00.js → login-qr-CxRI-tE2.js} +1 -1
  57. package/dist/{models-BM2_NkMu.js → models-CdNeYfSp.js} +4 -4
  58. package/dist/{models-cli-BpjeKsUz.js → models-cli-D7eSsPuk.js} +3 -3
  59. package/dist/{models-cli-BjY8wA-C.js → models-cli-fTZXo1zx.js} +5 -5
  60. package/dist/{onboard-DM9gULJN.js → onboard-C5K37NvY.js} +3 -3
  61. package/dist/{onboard-_-D81kAy.js → onboard-D-6QCnTi.js} +3 -3
  62. package/dist/{onboard-channels-UkphAdCy.js → onboard-channels-BsCq32Hn.js} +1 -1
  63. package/dist/{onboard-channels-CtT-RN60.js → onboard-channels-bx6oelzj.js} +1 -1
  64. package/dist/{onboarding-Djmm0PEM.js → onboarding-BeuMAyic.js} +4 -4
  65. package/dist/{onboarding-BB9PteK8.js → onboarding-CX1vIkcB.js} +4 -4
  66. package/dist/{outbound-send-deps-T_FgdfgW.js → outbound-send-deps-Y9AxHeLG.js} +1 -1
  67. package/dist/{pi-embedded-BMbtgOzv.js → pi-embedded-D15iww51.js} +1010 -104
  68. package/dist/{pi-embedded-DfbM3fAT.js → pi-embedded-DR8Pfd05.js} +1010 -104
  69. package/dist/{plugin-registry-QTkplP4s.js → plugin-registry-Do2D1nDk.js} +1 -1
  70. package/dist/{plugin-registry-DePMxn4z.js → plugin-registry-ME2FQAi-.js} +1 -1
  71. package/dist/plugin-sdk/affect/ego.d.ts +140 -0
  72. package/dist/plugin-sdk/agents/models-config.d.ts +5 -6
  73. package/dist/plugin-sdk/agents/noxsoft-runner.d.ts +3 -0
  74. package/dist/plugin-sdk/agents/openai-direct-runner.d.ts +41 -0
  75. package/dist/plugin-sdk/commands/steer.d.ts +49 -0
  76. package/dist/plugin-sdk/gateway/protocol/index.d.ts +2 -2
  77. package/dist/{plugins-cli-Dv0KQTWo.js → plugins-cli-CVFzwdmI.js} +4 -4
  78. package/dist/{plugins-cli-Bc9oU1ld.js → plugins-cli-CoVt2ewg.js} +3 -3
  79. package/dist/{program-CuwbF8YO.js → program-8rF4C_wd.js} +8 -8
  80. package/dist/{program-context-CxPfy-Wr.js → program-context-DP3qjW7A.js} +18 -18
  81. package/dist/{register.agent-DFQmkIEH.js → register.agent-BIrXCVtQ.js} +9 -9
  82. package/dist/{register.agent-DUjwGw9d.js → register.agent-DnkOx0U8.js} +7 -7
  83. package/dist/{register.anima-CtKNrpE8.js → register.anima-B36rTHUt.js} +2 -2
  84. package/dist/{register.anima-CRFHJu2J.js → register.anima-DXT9bM9A.js} +2 -2
  85. package/dist/{register.configure-CnEKV57N.js → register.configure-CuzJxZmk.js} +6 -6
  86. package/dist/{register.configure-CSSN07XN.js → register.configure-DCpvHX3m.js} +7 -7
  87. package/dist/{register.maintenance-fhcCB7ih.js → register.maintenance-CcxBFfv5.js} +10 -10
  88. package/dist/{register.maintenance-CU1A-90-.js → register.maintenance-Dla0H12S.js} +8 -8
  89. package/dist/{register.message-C1a0y2ZR.js → register.message-Brtushvp.js} +4 -4
  90. package/dist/{register.message-fM0jSKB8.js → register.message-CD7xV-jz.js} +5 -5
  91. package/dist/{register.onboard-BhPlqjFi.js → register.onboard-23Mra3LN.js} +11 -11
  92. package/dist/{register.onboard-B7Gavmvt.js → register.onboard-6CbODzQ6.js} +9 -9
  93. package/dist/{register.setup-CADdQUEN.js → register.setup-CqQw13Ky.js} +11 -11
  94. package/dist/{register.setup-0jPnMgnz.js → register.setup-DlVH7FKe.js} +9 -9
  95. package/dist/{register.status-health-sessions-Cu5fDT-z.js → register.status-health-sessions-CduFjFDB.js} +4 -4
  96. package/dist/{register.status-health-sessions-DdQsABr_.js → register.status-health-sessions-CxtgPKu9.js} +6 -6
  97. package/dist/{register.subclis-CZ91ufCy.js → register.subclis-CtANqD5P.js} +7 -7
  98. package/dist/{reply-DtHlnzOx.js → reply-93fMzde1.js} +610 -75
  99. package/dist/{reply-prefix-C8dIgJur.js → reply-prefix-B7Fb3fO8.js} +1 -1
  100. package/dist/{reply-prefix-DmWGtcH-.js → reply-prefix-BzdhJDqP.js} +1 -1
  101. package/dist/{run-Dfz_7j7t.js → run-CF3kHOGH.js} +1717 -83
  102. package/dist/{run-DqBQ-bGn.js → run-Cq_iTGK_.js} +1718 -84
  103. package/dist/{run-main-DGDW0fhx.js → run-main-BiIRcc6s.js} +17 -17
  104. package/dist/{server-node-events-Ca797E1d.js → server-node-events-B3Serk9L.js} +6 -6
  105. package/dist/{server-node-events-BR1aXVlu.js → server-node-events-DgvKcH5q.js} +5 -5
  106. package/dist/{session-C7IGnhd1.js → session-BMDpwIJu.js} +1 -1
  107. package/dist/{session-FmXsucR7.js → session-BzrnfWQ2.js} +2 -2
  108. package/dist/{session-DfsMJNG3.js → session-C_d9uvLf.js} +1 -1
  109. package/dist/{session-DLevr8Vd.js → session-jljC5QVG.js} +2 -2
  110. package/dist/{sessions-Dj7_4mkr.js → sessions-BmE5Z_1i.js} +1 -1
  111. package/dist/{settings-cli-DxNeu6kx.js → settings-cli-CZdlEmNi.js} +7 -7
  112. package/dist/{settings-cli-Dytfop1H.js → settings-cli-DsDqNpW_.js} +8 -8
  113. package/dist/{setup-token-B802CZwe.js → setup-token-C8Gg1P6T.js} +1 -1
  114. package/dist/{setup-token-DYh2QzJ-.js → setup-token-Lee4gM5w.js} +1 -1
  115. package/dist/{start-BqnPia0t.js → start-CK6urvnN.js} +17 -17
  116. package/dist/{start-C3fuLzX0.js → start-Cs1aPMq2.js} +15 -15
  117. package/dist/{status-CHGNPonc.js → status-BO5BIf81.js} +3 -3
  118. package/dist/{status-CxF6k_jr.js → status-COc4xMti.js} +1 -1
  119. package/dist/{status-tLgozFYL.js → status-C_NBOv_V.js} +1 -1
  120. package/dist/{status-DfZJJqNs.js → status-uakoP719.js} +4 -4
  121. package/dist/{subagent-registry-CPtElVX0.js → subagent-registry-fLI7QDKe.js} +449 -77
  122. package/dist/{update-cli-C-er5av6.js → update-cli-D3Ujz_cW.js} +10 -10
  123. package/dist/{update-cli-BuCw75tM.js → update-cli-DEe62XGU.js} +8 -8
  124. package/dist/{update-runner-kE8AMQt4.js → update-runner-DUl-g4mB.js} +1 -1
  125. package/dist/{update-runner-czCqHZCu.js → update-runner-DZfnquWO.js} +1 -1
  126. package/dist/{web-BHGK5GtV.js → web-C-cK9OCd.js} +1 -1
  127. package/dist/{web-DvTXV-fo.js → web-Di8j762D.js} +6 -6
  128. package/dist/{web-CyYunanU.js → web-Dybw4K7C.js} +6 -6
  129. package/dist/{web-so3pGceM.js → web-DzSlI8A6.js} +1 -1
  130. package/package.json +4 -4
  131. package/dist/context-B5X720Bs.js +0 -60
  132. package/dist/control-ui/assets/index-C4ejMN5U.js +0 -72
  133. package/dist/control-ui/assets/index-C4ejMN5U.js.map +0 -1
  134. package/dist/control-ui/assets/index-CcPNqN3R.css +0 -1
@@ -0,0 +1,73 @@
1
+ function wO(e,t){for(var n=0;n<t.length;n++){const r=t[n];if(typeof r!="string"&&!Array.isArray(r)){for(const a in r)if(a!=="default"&&!(a in e)){const o=Object.getOwnPropertyDescriptor(r,a);o&&Object.defineProperty(e,a,o.get?o:{enumerable:!0,get:()=>r[a]})}}}return Object.freeze(Object.defineProperty(e,Symbol.toStringTag,{value:"Module"}))}(function(){const t=document.createElement("link").relList;if(t&&t.supports&&t.supports("modulepreload"))return;for(const a of document.querySelectorAll('link[rel="modulepreload"]'))r(a);new MutationObserver(a=>{for(const o of a)if(o.type==="childList")for(const l of o.addedNodes)l.tagName==="LINK"&&l.rel==="modulepreload"&&r(l)}).observe(document,{childList:!0,subtree:!0});function n(a){const o={};return a.integrity&&(o.integrity=a.integrity),a.referrerPolicy&&(o.referrerPolicy=a.referrerPolicy),a.crossOrigin==="use-credentials"?o.credentials="include":a.crossOrigin==="anonymous"?o.credentials="omit":o.credentials="same-origin",o}function r(a){if(a.ep)return;a.ep=!0;const o=n(a);fetch(a.href,o)}})();function jo(e){return e&&e.__esModule&&Object.prototype.hasOwnProperty.call(e,"default")?e.default:e}var Qp={exports:{}},Ml={};var WS;function EO(){if(WS)return Ml;WS=1;var e=Symbol.for("react.transitional.element"),t=Symbol.for("react.fragment");function n(r,a,o){var l=null;if(o!==void 0&&(l=""+o),a.key!==void 0&&(l=""+a.key),"key"in a){o={};for(var c in a)c!=="key"&&(o[c]=a[c])}else o=a;return a=o.ref,{$$typeof:e,type:r,key:l,ref:a!==void 0?a:null,props:o}}return Ml.Fragment=t,Ml.jsx=n,Ml.jsxs=n,Ml}var XS;function TO(){return XS||(XS=1,Qp.exports=EO()),Qp.exports}var h=TO(),Jp={exports:{}},qe={};var QS;function kO(){if(QS)return qe;QS=1;var e=Symbol.for("react.transitional.element"),t=Symbol.for("react.portal"),n=Symbol.for("react.fragment"),r=Symbol.for("react.strict_mode"),a=Symbol.for("react.profiler"),o=Symbol.for("react.consumer"),l=Symbol.for("react.context"),c=Symbol.for("react.forward_ref"),d=Symbol.for("react.suspense"),f=Symbol.for("react.memo"),m=Symbol.for("react.lazy"),g=Symbol.for("react.activity"),v=Symbol.iterator;function b(z){return z===null||typeof z!="object"?null:(z=v&&z[v]||z["@@iterator"],typeof z=="function"?z:null)}var S={isMounted:function(){return!1},enqueueForceUpdate:function(){},enqueueReplaceState:function(){},enqueueSetState:function(){}},w=Object.assign,E={};function T(z,W,I){this.props=z,this.context=W,this.refs=E,this.updater=I||S}T.prototype.isReactComponent={},T.prototype.setState=function(z,W){if(typeof z!="object"&&typeof z!="function"&&z!=null)throw Error("takes an object of state variables to update or a function which returns an object of state variables.");this.updater.enqueueSetState(this,z,W,"setState")},T.prototype.forceUpdate=function(z){this.updater.enqueueForceUpdate(this,z,"forceUpdate")};function C(){}C.prototype=T.prototype;function k(z,W,I){this.props=z,this.context=W,this.refs=E,this.updater=I||S}var j=k.prototype=new C;j.constructor=k,w(j,T.prototype),j.isPureReactComponent=!0;var N=Array.isArray;function R(){}var P={H:null,A:null,T:null,S:null},L=Object.prototype.hasOwnProperty;function H(z,W,I){var fe=I.ref;return{$$typeof:e,type:z,key:W,ref:fe!==void 0?fe:null,props:I}}function D(z,W){return H(z.type,W,z.props)}function B(z){return typeof z=="object"&&z!==null&&z.$$typeof===e}function K(z){var W={"=":"=0",":":"=2"};return"$"+z.replace(/[=:]/g,function(I){return W[I]})}var se=/\/+/g;function ue(z,W){return typeof z=="object"&&z!==null&&z.key!=null?K(""+z.key):W.toString(36)}function Z(z){switch(z.status){case"fulfilled":return z.value;case"rejected":throw z.reason;default:switch(typeof z.status=="string"?z.then(R,R):(z.status="pending",z.then(function(W){z.status==="pending"&&(z.status="fulfilled",z.value=W)},function(W){z.status==="pending"&&(z.status="rejected",z.reason=W)})),z.status){case"fulfilled":return z.value;case"rejected":throw z.reason}}throw z}function V(z,W,I,fe,ge){var Se=typeof z;(Se==="undefined"||Se==="boolean")&&(z=null);var we=!1;if(z===null)we=!0;else switch(Se){case"bigint":case"string":case"number":we=!0;break;case"object":switch(z.$$typeof){case e:case t:we=!0;break;case m:return we=z._init,V(we(z._payload),W,I,fe,ge)}}if(we)return ge=ge(z),we=fe===""?"."+ue(z,0):fe,N(ge)?(I="",we!=null&&(I=we.replace(se,"$&/")+"/"),V(ge,W,I,"",function(ve){return ve})):ge!=null&&(B(ge)&&(ge=D(ge,I+(ge.key==null||z&&z.key===ge.key?"":(""+ge.key).replace(se,"$&/")+"/")+we)),W.push(ge)),1;we=0;var Pe=fe===""?".":fe+":";if(N(z))for(var je=0;je<z.length;je++)fe=z[je],Se=Pe+ue(fe,je),we+=V(fe,W,I,Se,ge);else if(je=b(z),typeof je=="function")for(z=je.call(z),je=0;!(fe=z.next()).done;)fe=fe.value,Se=Pe+ue(fe,je++),we+=V(fe,W,I,Se,ge);else if(Se==="object"){if(typeof z.then=="function")return V(Z(z),W,I,fe,ge);throw W=String(z),Error("Objects are not valid as a React child (found: "+(W==="[object Object]"?"object with keys {"+Object.keys(z).join(", ")+"}":W)+"). If you meant to render a collection of children, use an array instead.")}return we}function X(z,W,I){if(z==null)return z;var fe=[],ge=0;return V(z,fe,"","",function(Se){return W.call(I,Se,ge++)}),fe}function le(z){if(z._status===-1){var W=z._result;W=W(),W.then(function(I){(z._status===0||z._status===-1)&&(z._status=1,z._result=I)},function(I){(z._status===0||z._status===-1)&&(z._status=2,z._result=I)}),z._status===-1&&(z._status=0,z._result=W)}if(z._status===1)return z._result.default;throw z._result}var ye=typeof reportError=="function"?reportError:function(z){if(typeof window=="object"&&typeof window.ErrorEvent=="function"){var W=new window.ErrorEvent("error",{bubbles:!0,cancelable:!0,message:typeof z=="object"&&z!==null&&typeof z.message=="string"?String(z.message):String(z),error:z});if(!window.dispatchEvent(W))return}else if(typeof process=="object"&&typeof process.emit=="function"){process.emit("uncaughtException",z);return}console.error(z)},M={map:X,forEach:function(z,W,I){X(z,function(){W.apply(this,arguments)},I)},count:function(z){var W=0;return X(z,function(){W++}),W},toArray:function(z){return X(z,function(W){return W})||[]},only:function(z){if(!B(z))throw Error("React.Children.only expected to receive a single React element child.");return z}};return qe.Activity=g,qe.Children=M,qe.Component=T,qe.Fragment=n,qe.Profiler=a,qe.PureComponent=k,qe.StrictMode=r,qe.Suspense=d,qe.__CLIENT_INTERNALS_DO_NOT_USE_OR_WARN_USERS_THEY_CANNOT_UPGRADE=P,qe.__COMPILER_RUNTIME={__proto__:null,c:function(z){return P.H.useMemoCache(z)}},qe.cache=function(z){return function(){return z.apply(null,arguments)}},qe.cacheSignal=function(){return null},qe.cloneElement=function(z,W,I){if(z==null)throw Error("The argument must be a React element, but you passed "+z+".");var fe=w({},z.props),ge=z.key;if(W!=null)for(Se in W.key!==void 0&&(ge=""+W.key),W)!L.call(W,Se)||Se==="key"||Se==="__self"||Se==="__source"||Se==="ref"&&W.ref===void 0||(fe[Se]=W[Se]);var Se=arguments.length-2;if(Se===1)fe.children=I;else if(1<Se){for(var we=Array(Se),Pe=0;Pe<Se;Pe++)we[Pe]=arguments[Pe+2];fe.children=we}return H(z.type,ge,fe)},qe.createContext=function(z){return z={$$typeof:l,_currentValue:z,_currentValue2:z,_threadCount:0,Provider:null,Consumer:null},z.Provider=z,z.Consumer={$$typeof:o,_context:z},z},qe.createElement=function(z,W,I){var fe,ge={},Se=null;if(W!=null)for(fe in W.key!==void 0&&(Se=""+W.key),W)L.call(W,fe)&&fe!=="key"&&fe!=="__self"&&fe!=="__source"&&(ge[fe]=W[fe]);var we=arguments.length-2;if(we===1)ge.children=I;else if(1<we){for(var Pe=Array(we),je=0;je<we;je++)Pe[je]=arguments[je+2];ge.children=Pe}if(z&&z.defaultProps)for(fe in we=z.defaultProps,we)ge[fe]===void 0&&(ge[fe]=we[fe]);return H(z,Se,ge)},qe.createRef=function(){return{current:null}},qe.forwardRef=function(z){return{$$typeof:c,render:z}},qe.isValidElement=B,qe.lazy=function(z){return{$$typeof:m,_payload:{_status:-1,_result:z},_init:le}},qe.memo=function(z,W){return{$$typeof:f,type:z,compare:W===void 0?null:W}},qe.startTransition=function(z){var W=P.T,I={};P.T=I;try{var fe=z(),ge=P.S;ge!==null&&ge(I,fe),typeof fe=="object"&&fe!==null&&typeof fe.then=="function"&&fe.then(R,ye)}catch(Se){ye(Se)}finally{W!==null&&I.types!==null&&(W.types=I.types),P.T=W}},qe.unstable_useCacheRefresh=function(){return P.H.useCacheRefresh()},qe.use=function(z){return P.H.use(z)},qe.useActionState=function(z,W,I){return P.H.useActionState(z,W,I)},qe.useCallback=function(z,W){return P.H.useCallback(z,W)},qe.useContext=function(z){return P.H.useContext(z)},qe.useDebugValue=function(){},qe.useDeferredValue=function(z,W){return P.H.useDeferredValue(z,W)},qe.useEffect=function(z,W){return P.H.useEffect(z,W)},qe.useEffectEvent=function(z){return P.H.useEffectEvent(z)},qe.useId=function(){return P.H.useId()},qe.useImperativeHandle=function(z,W,I){return P.H.useImperativeHandle(z,W,I)},qe.useInsertionEffect=function(z,W){return P.H.useInsertionEffect(z,W)},qe.useLayoutEffect=function(z,W){return P.H.useLayoutEffect(z,W)},qe.useMemo=function(z,W){return P.H.useMemo(z,W)},qe.useOptimistic=function(z,W){return P.H.useOptimistic(z,W)},qe.useReducer=function(z,W,I){return P.H.useReducer(z,W,I)},qe.useRef=function(z){return P.H.useRef(z)},qe.useState=function(z){return P.H.useState(z)},qe.useSyncExternalStore=function(z,W,I){return P.H.useSyncExternalStore(z,W,I)},qe.useTransition=function(){return P.H.useTransition()},qe.version="19.2.4",qe}var JS;function Pv(){return JS||(JS=1,Jp.exports=kO()),Jp.exports}var _=Pv();const ar=jo(_);var Zp={exports:{}},Dl={},em={exports:{}},tm={};var ZS;function CO(){return ZS||(ZS=1,(function(e){function t(V,X){var le=V.length;V.push(X);e:for(;0<le;){var ye=le-1>>>1,M=V[ye];if(0<a(M,X))V[ye]=X,V[le]=M,le=ye;else break e}}function n(V){return V.length===0?null:V[0]}function r(V){if(V.length===0)return null;var X=V[0],le=V.pop();if(le!==X){V[0]=le;e:for(var ye=0,M=V.length,z=M>>>1;ye<z;){var W=2*(ye+1)-1,I=V[W],fe=W+1,ge=V[fe];if(0>a(I,le))fe<M&&0>a(ge,I)?(V[ye]=ge,V[fe]=le,ye=fe):(V[ye]=I,V[W]=le,ye=W);else if(fe<M&&0>a(ge,le))V[ye]=ge,V[fe]=le,ye=fe;else break e}}return X}function a(V,X){var le=V.sortIndex-X.sortIndex;return le!==0?le:V.id-X.id}if(e.unstable_now=void 0,typeof performance=="object"&&typeof performance.now=="function"){var o=performance;e.unstable_now=function(){return o.now()}}else{var l=Date,c=l.now();e.unstable_now=function(){return l.now()-c}}var d=[],f=[],m=1,g=null,v=3,b=!1,S=!1,w=!1,E=!1,T=typeof setTimeout=="function"?setTimeout:null,C=typeof clearTimeout=="function"?clearTimeout:null,k=typeof setImmediate<"u"?setImmediate:null;function j(V){for(var X=n(f);X!==null;){if(X.callback===null)r(f);else if(X.startTime<=V)r(f),X.sortIndex=X.expirationTime,t(d,X);else break;X=n(f)}}function N(V){if(w=!1,j(V),!S)if(n(d)!==null)S=!0,R||(R=!0,K());else{var X=n(f);X!==null&&Z(N,X.startTime-V)}}var R=!1,P=-1,L=5,H=-1;function D(){return E?!0:!(e.unstable_now()-H<L)}function B(){if(E=!1,R){var V=e.unstable_now();H=V;var X=!0;try{e:{S=!1,w&&(w=!1,C(P),P=-1),b=!0;var le=v;try{t:{for(j(V),g=n(d);g!==null&&!(g.expirationTime>V&&D());){var ye=g.callback;if(typeof ye=="function"){g.callback=null,v=g.priorityLevel;var M=ye(g.expirationTime<=V);if(V=e.unstable_now(),typeof M=="function"){g.callback=M,j(V),X=!0;break t}g===n(d)&&r(d),j(V)}else r(d);g=n(d)}if(g!==null)X=!0;else{var z=n(f);z!==null&&Z(N,z.startTime-V),X=!1}}break e}finally{g=null,v=le,b=!1}X=void 0}}finally{X?K():R=!1}}}var K;if(typeof k=="function")K=function(){k(B)};else if(typeof MessageChannel<"u"){var se=new MessageChannel,ue=se.port2;se.port1.onmessage=B,K=function(){ue.postMessage(null)}}else K=function(){T(B,0)};function Z(V,X){P=T(function(){V(e.unstable_now())},X)}e.unstable_IdlePriority=5,e.unstable_ImmediatePriority=1,e.unstable_LowPriority=4,e.unstable_NormalPriority=3,e.unstable_Profiling=null,e.unstable_UserBlockingPriority=2,e.unstable_cancelCallback=function(V){V.callback=null},e.unstable_forceFrameRate=function(V){0>V||125<V?console.error("forceFrameRate takes a positive int between 0 and 125, forcing frame rates higher than 125 fps is not supported"):L=0<V?Math.floor(1e3/V):5},e.unstable_getCurrentPriorityLevel=function(){return v},e.unstable_next=function(V){switch(v){case 1:case 2:case 3:var X=3;break;default:X=v}var le=v;v=X;try{return V()}finally{v=le}},e.unstable_requestPaint=function(){E=!0},e.unstable_runWithPriority=function(V,X){switch(V){case 1:case 2:case 3:case 4:case 5:break;default:V=3}var le=v;v=V;try{return X()}finally{v=le}},e.unstable_scheduleCallback=function(V,X,le){var ye=e.unstable_now();switch(typeof le=="object"&&le!==null?(le=le.delay,le=typeof le=="number"&&0<le?ye+le:ye):le=ye,V){case 1:var M=-1;break;case 2:M=250;break;case 5:M=1073741823;break;case 4:M=1e4;break;default:M=5e3}return M=le+M,V={id:m++,callback:X,priorityLevel:V,startTime:le,expirationTime:M,sortIndex:-1},le>ye?(V.sortIndex=le,t(f,V),n(d)===null&&V===n(f)&&(w?(C(P),P=-1):w=!0,Z(N,le-ye))):(V.sortIndex=M,t(d,V),S||b||(S=!0,R||(R=!0,K()))),V},e.unstable_shouldYield=D,e.unstable_wrapCallback=function(V){var X=v;return function(){var le=v;v=X;try{return V.apply(this,arguments)}finally{v=le}}}})(tm)),tm}var ew;function AO(){return ew||(ew=1,em.exports=CO()),em.exports}var nm={exports:{}},Cn={};var tw;function NO(){if(tw)return Cn;tw=1;var e=Pv();function t(d){var f="https://react.dev/errors/"+d;if(1<arguments.length){f+="?args[]="+encodeURIComponent(arguments[1]);for(var m=2;m<arguments.length;m++)f+="&args[]="+encodeURIComponent(arguments[m])}return"Minified React error #"+d+"; visit "+f+" for the full message or use the non-minified dev environment for full errors and additional helpful warnings."}function n(){}var r={d:{f:n,r:function(){throw Error(t(522))},D:n,C:n,L:n,m:n,X:n,S:n,M:n},p:0,findDOMNode:null},a=Symbol.for("react.portal");function o(d,f,m){var g=3<arguments.length&&arguments[3]!==void 0?arguments[3]:null;return{$$typeof:a,key:g==null?null:""+g,children:d,containerInfo:f,implementation:m}}var l=e.__CLIENT_INTERNALS_DO_NOT_USE_OR_WARN_USERS_THEY_CANNOT_UPGRADE;function c(d,f){if(d==="font")return"";if(typeof f=="string")return f==="use-credentials"?f:""}return Cn.__DOM_INTERNALS_DO_NOT_USE_OR_WARN_USERS_THEY_CANNOT_UPGRADE=r,Cn.createPortal=function(d,f){var m=2<arguments.length&&arguments[2]!==void 0?arguments[2]:null;if(!f||f.nodeType!==1&&f.nodeType!==9&&f.nodeType!==11)throw Error(t(299));return o(d,f,null,m)},Cn.flushSync=function(d){var f=l.T,m=r.p;try{if(l.T=null,r.p=2,d)return d()}finally{l.T=f,r.p=m,r.d.f()}},Cn.preconnect=function(d,f){typeof d=="string"&&(f?(f=f.crossOrigin,f=typeof f=="string"?f==="use-credentials"?f:"":void 0):f=null,r.d.C(d,f))},Cn.prefetchDNS=function(d){typeof d=="string"&&r.d.D(d)},Cn.preinit=function(d,f){if(typeof d=="string"&&f&&typeof f.as=="string"){var m=f.as,g=c(m,f.crossOrigin),v=typeof f.integrity=="string"?f.integrity:void 0,b=typeof f.fetchPriority=="string"?f.fetchPriority:void 0;m==="style"?r.d.S(d,typeof f.precedence=="string"?f.precedence:void 0,{crossOrigin:g,integrity:v,fetchPriority:b}):m==="script"&&r.d.X(d,{crossOrigin:g,integrity:v,fetchPriority:b,nonce:typeof f.nonce=="string"?f.nonce:void 0})}},Cn.preinitModule=function(d,f){if(typeof d=="string")if(typeof f=="object"&&f!==null){if(f.as==null||f.as==="script"){var m=c(f.as,f.crossOrigin);r.d.M(d,{crossOrigin:m,integrity:typeof f.integrity=="string"?f.integrity:void 0,nonce:typeof f.nonce=="string"?f.nonce:void 0})}}else f==null&&r.d.M(d)},Cn.preload=function(d,f){if(typeof d=="string"&&typeof f=="object"&&f!==null&&typeof f.as=="string"){var m=f.as,g=c(m,f.crossOrigin);r.d.L(d,m,{crossOrigin:g,integrity:typeof f.integrity=="string"?f.integrity:void 0,nonce:typeof f.nonce=="string"?f.nonce:void 0,type:typeof f.type=="string"?f.type:void 0,fetchPriority:typeof f.fetchPriority=="string"?f.fetchPriority:void 0,referrerPolicy:typeof f.referrerPolicy=="string"?f.referrerPolicy:void 0,imageSrcSet:typeof f.imageSrcSet=="string"?f.imageSrcSet:void 0,imageSizes:typeof f.imageSizes=="string"?f.imageSizes:void 0,media:typeof f.media=="string"?f.media:void 0})}},Cn.preloadModule=function(d,f){if(typeof d=="string")if(f){var m=c(f.as,f.crossOrigin);r.d.m(d,{as:typeof f.as=="string"&&f.as!=="script"?f.as:void 0,crossOrigin:m,integrity:typeof f.integrity=="string"?f.integrity:void 0})}else r.d.m(d)},Cn.requestFormReset=function(d){r.d.r(d)},Cn.unstable_batchedUpdates=function(d,f){return d(f)},Cn.useFormState=function(d,f,m){return l.H.useFormState(d,f,m)},Cn.useFormStatus=function(){return l.H.useHostTransitionStatus()},Cn.version="19.2.4",Cn}var nw;function jO(){if(nw)return nm.exports;nw=1;function e(){if(!(typeof __REACT_DEVTOOLS_GLOBAL_HOOK__>"u"||typeof __REACT_DEVTOOLS_GLOBAL_HOOK__.checkDCE!="function"))try{__REACT_DEVTOOLS_GLOBAL_HOOK__.checkDCE(e)}catch(t){console.error(t)}}return e(),nm.exports=NO(),nm.exports}var rw;function RO(){if(rw)return Dl;rw=1;var e=AO(),t=Pv(),n=jO();function r(i){var s="https://react.dev/errors/"+i;if(1<arguments.length){s+="?args[]="+encodeURIComponent(arguments[1]);for(var u=2;u<arguments.length;u++)s+="&args[]="+encodeURIComponent(arguments[u])}return"Minified React error #"+i+"; visit "+s+" for the full message or use the non-minified dev environment for full errors and additional helpful warnings."}function a(i){return!(!i||i.nodeType!==1&&i.nodeType!==9&&i.nodeType!==11)}function o(i){var s=i,u=i;if(i.alternate)for(;s.return;)s=s.return;else{i=s;do s=i,(s.flags&4098)!==0&&(u=s.return),i=s.return;while(i)}return s.tag===3?u:null}function l(i){if(i.tag===13){var s=i.memoizedState;if(s===null&&(i=i.alternate,i!==null&&(s=i.memoizedState)),s!==null)return s.dehydrated}return null}function c(i){if(i.tag===31){var s=i.memoizedState;if(s===null&&(i=i.alternate,i!==null&&(s=i.memoizedState)),s!==null)return s.dehydrated}return null}function d(i){if(o(i)!==i)throw Error(r(188))}function f(i){var s=i.alternate;if(!s){if(s=o(i),s===null)throw Error(r(188));return s!==i?null:i}for(var u=i,p=s;;){var y=u.return;if(y===null)break;var x=y.alternate;if(x===null){if(p=y.return,p!==null){u=p;continue}break}if(y.child===x.child){for(x=y.child;x;){if(x===u)return d(y),i;if(x===p)return d(y),s;x=x.sibling}throw Error(r(188))}if(u.return!==p.return)u=y,p=x;else{for(var A=!1,O=y.child;O;){if(O===u){A=!0,u=y,p=x;break}if(O===p){A=!0,p=y,u=x;break}O=O.sibling}if(!A){for(O=x.child;O;){if(O===u){A=!0,u=x,p=y;break}if(O===p){A=!0,p=x,u=y;break}O=O.sibling}if(!A)throw Error(r(189))}}if(u.alternate!==p)throw Error(r(190))}if(u.tag!==3)throw Error(r(188));return u.stateNode.current===u?i:s}function m(i){var s=i.tag;if(s===5||s===26||s===27||s===6)return i;for(i=i.child;i!==null;){if(s=m(i),s!==null)return s;i=i.sibling}return null}var g=Object.assign,v=Symbol.for("react.element"),b=Symbol.for("react.transitional.element"),S=Symbol.for("react.portal"),w=Symbol.for("react.fragment"),E=Symbol.for("react.strict_mode"),T=Symbol.for("react.profiler"),C=Symbol.for("react.consumer"),k=Symbol.for("react.context"),j=Symbol.for("react.forward_ref"),N=Symbol.for("react.suspense"),R=Symbol.for("react.suspense_list"),P=Symbol.for("react.memo"),L=Symbol.for("react.lazy"),H=Symbol.for("react.activity"),D=Symbol.for("react.memo_cache_sentinel"),B=Symbol.iterator;function K(i){return i===null||typeof i!="object"?null:(i=B&&i[B]||i["@@iterator"],typeof i=="function"?i:null)}var se=Symbol.for("react.client.reference");function ue(i){if(i==null)return null;if(typeof i=="function")return i.$$typeof===se?null:i.displayName||i.name||null;if(typeof i=="string")return i;switch(i){case w:return"Fragment";case T:return"Profiler";case E:return"StrictMode";case N:return"Suspense";case R:return"SuspenseList";case H:return"Activity"}if(typeof i=="object")switch(i.$$typeof){case S:return"Portal";case k:return i.displayName||"Context";case C:return(i._context.displayName||"Context")+".Consumer";case j:var s=i.render;return i=i.displayName,i||(i=s.displayName||s.name||"",i=i!==""?"ForwardRef("+i+")":"ForwardRef"),i;case P:return s=i.displayName||null,s!==null?s:ue(i.type)||"Memo";case L:s=i._payload,i=i._init;try{return ue(i(s))}catch{}}return null}var Z=Array.isArray,V=t.__CLIENT_INTERNALS_DO_NOT_USE_OR_WARN_USERS_THEY_CANNOT_UPGRADE,X=n.__DOM_INTERNALS_DO_NOT_USE_OR_WARN_USERS_THEY_CANNOT_UPGRADE,le={pending:!1,data:null,method:null,action:null},ye=[],M=-1;function z(i){return{current:i}}function W(i){0>M||(i.current=ye[M],ye[M]=null,M--)}function I(i,s){M++,ye[M]=i.current,i.current=s}var fe=z(null),ge=z(null),Se=z(null),we=z(null);function Pe(i,s){switch(I(Se,s),I(ge,i),I(fe,null),s.nodeType){case 9:case 11:i=(i=s.documentElement)&&(i=i.namespaceURI)?yS(i):0;break;default:if(i=s.tagName,s=s.namespaceURI)s=yS(s),i=bS(s,i);else switch(i){case"svg":i=1;break;case"math":i=2;break;default:i=0}}W(fe),I(fe,i)}function je(){W(fe),W(ge),W(Se)}function ve(i){i.memoizedState!==null&&I(we,i);var s=fe.current,u=bS(s,i.type);s!==u&&(I(ge,i),I(fe,u))}function Le(i){ge.current===i&&(W(fe),W(ge)),we.current===i&&(W(we),jl._currentValue=le)}var xt,Ot;function We(i){if(xt===void 0)try{throw Error()}catch(u){var s=u.stack.trim().match(/\n( *(at )?)/);xt=s&&s[1]||"",Ot=-1<u.stack.indexOf(`
2
+ at`)?" (<anonymous>)":-1<u.stack.indexOf("@")?"@unknown:0:0":""}return`
3
+ `+xt+i+Ot}var Nt=!1;function lt(i,s){if(!i||Nt)return"";Nt=!0;var u=Error.prepareStackTrace;Error.prepareStackTrace=void 0;try{var p={DetermineComponentFrameRoot:function(){try{if(s){var pe=function(){throw Error()};if(Object.defineProperty(pe.prototype,"props",{set:function(){throw Error()}}),typeof Reflect=="object"&&Reflect.construct){try{Reflect.construct(pe,[])}catch(oe){var ie=oe}Reflect.construct(i,[],pe)}else{try{pe.call()}catch(oe){ie=oe}i.call(pe.prototype)}}else{try{throw Error()}catch(oe){ie=oe}(pe=i())&&typeof pe.catch=="function"&&pe.catch(function(){})}}catch(oe){if(oe&&ie&&typeof oe.stack=="string")return[oe.stack,ie.stack]}return[null,null]}};p.DetermineComponentFrameRoot.displayName="DetermineComponentFrameRoot";var y=Object.getOwnPropertyDescriptor(p.DetermineComponentFrameRoot,"name");y&&y.configurable&&Object.defineProperty(p.DetermineComponentFrameRoot,"name",{value:"DetermineComponentFrameRoot"});var x=p.DetermineComponentFrameRoot(),A=x[0],O=x[1];if(A&&O){var F=A.split(`
4
+ `),re=O.split(`
5
+ `);for(y=p=0;p<F.length&&!F[p].includes("DetermineComponentFrameRoot");)p++;for(;y<re.length&&!re[y].includes("DetermineComponentFrameRoot");)y++;if(p===F.length||y===re.length)for(p=F.length-1,y=re.length-1;1<=p&&0<=y&&F[p]!==re[y];)y--;for(;1<=p&&0<=y;p--,y--)if(F[p]!==re[y]){if(p!==1||y!==1)do if(p--,y--,0>y||F[p]!==re[y]){var de=`
6
+ `+F[p].replace(" at new "," at ");return i.displayName&&de.includes("<anonymous>")&&(de=de.replace("<anonymous>",i.displayName)),de}while(1<=p&&0<=y);break}}}finally{Nt=!1,Error.prepareStackTrace=u}return(u=i?i.displayName||i.name:"")?We(u):""}function Bt(i,s){switch(i.tag){case 26:case 27:case 5:return We(i.type);case 16:return We("Lazy");case 13:return i.child!==s&&s!==null?We("Suspense Fallback"):We("Suspense");case 19:return We("SuspenseList");case 0:case 15:return lt(i.type,!1);case 11:return lt(i.type.render,!1);case 1:return lt(i.type,!0);case 31:return We("Activity");default:return""}}function $t(i){try{var s="",u=null;do s+=Bt(i,u),u=i,i=i.return;while(i);return s}catch(p){return`
7
+ Error generating stack: `+p.message+`
8
+ `+p.stack}}var Jt=Object.prototype.hasOwnProperty,mt=e.unstable_scheduleCallback,st=e.unstable_cancelCallback,Mn=e.unstable_shouldYield,Ue=e.unstable_requestPaint,Me=e.unstable_now,Q=e.unstable_getCurrentPriorityLevel,q=e.unstable_ImmediatePriority,ae=e.unstable_UserBlockingPriority,Te=e.unstable_NormalPriority,Ee=e.unstable_LowPriority,Be=e.unstable_IdlePriority,ut=e.log,Yt=e.unstable_setDisableYieldValue,gt=null,Lt=null;function U(i){if(typeof ut=="function"&&Yt(i),Lt&&typeof Lt.setStrictMode=="function")try{Lt.setStrictMode(gt,i)}catch{}}var Y=Math.clz32?Math.clz32:Zt,xe=Math.log,Ge=Math.LN2;function Zt(i){return i>>>=0,i===0?32:31-(xe(i)/Ge|0)|0}var Mr=256,Ft=262144,hn=4194304;function $r(i){var s=i&42;if(s!==0)return s;switch(i&-i){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:return 64;case 128:return 128;case 256:case 512:case 1024:case 2048:case 4096:case 8192:case 16384:case 32768:case 65536:case 131072:return i&261888;case 262144:case 524288:case 1048576:case 2097152:return i&3932160;case 4194304:case 8388608:case 16777216:case 33554432:return i&62914560;case 67108864:return 67108864;case 134217728:return 134217728;case 268435456:return 268435456;case 536870912:return 536870912;case 1073741824:return 0;default:return i}}function Da(i,s,u){var p=i.pendingLanes;if(p===0)return 0;var y=0,x=i.suspendedLanes,A=i.pingedLanes;i=i.warmLanes;var O=p&134217727;return O!==0?(p=O&~x,p!==0?y=$r(p):(A&=O,A!==0?y=$r(A):u||(u=O&~i,u!==0&&(y=$r(u))))):(O=p&~x,O!==0?y=$r(O):A!==0?y=$r(A):u||(u=p&~i,u!==0&&(y=$r(u)))),y===0?0:s!==0&&s!==y&&(s&x)===0&&(x=y&-y,u=s&-s,x>=u||x===32&&(u&4194048)!==0)?s:y}function Yr(i,s){return(i.pendingLanes&~(i.suspendedLanes&~i.pingedLanes)&s)===0}function xs(i,s){switch(i){case 1:case 2:case 4:case 8:case 64:return s+250;case 16:case 32: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 s+5e3;case 4194304:case 8388608:case 16777216:case 33554432:return-1;case 67108864:case 134217728:case 268435456:case 536870912:case 1073741824:return-1;default:return-1}}function Hu(){var i=hn;return hn<<=1,(hn&62914560)===0&&(hn=4194304),i}function Vo(i){for(var s=[],u=0;31>u;u++)s.push(i);return s}function Ia(i,s){i.pendingLanes|=s,s!==268435456&&(i.suspendedLanes=0,i.pingedLanes=0,i.warmLanes=0)}function Hf(i,s,u,p,y,x){var A=i.pendingLanes;i.pendingLanes=u,i.suspendedLanes=0,i.pingedLanes=0,i.warmLanes=0,i.expiredLanes&=u,i.entangledLanes&=u,i.errorRecoveryDisabledLanes&=u,i.shellSuspendCounter=0;var O=i.entanglements,F=i.expirationTimes,re=i.hiddenUpdates;for(u=A&~u;0<u;){var de=31-Y(u),pe=1<<de;O[de]=0,F[de]=-1;var ie=re[de];if(ie!==null)for(re[de]=null,de=0;de<ie.length;de++){var oe=ie[de];oe!==null&&(oe.lane&=-536870913)}u&=~pe}p!==0&&Fo(i,p,0),x!==0&&y===0&&i.tag!==0&&(i.suspendedLanes|=x&~(A&~s))}function Fo(i,s,u){i.pendingLanes|=s,i.suspendedLanes&=~s;var p=31-Y(s);i.entangledLanes|=s,i.entanglements[p]=i.entanglements[p]|1073741824|u&261930}function qu(i,s){var u=i.entangledLanes|=s;for(i=i.entanglements;u;){var p=31-Y(u),y=1<<p;y&s|i[p]&s&&(i[p]|=s),u&=~y}}function Gu(i,s){var u=s&-s;return u=(u&42)!==0?1:Ho(u),(u&(i.suspendedLanes|s))!==0?0:u}function Ho(i){switch(i){case 2:i=1;break;case 8:i=4;break;case 32:i=16;break;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:i=128;break;case 268435456:i=134217728;break;default:i=0}return i}function qo(i){return i&=-i,2<i?8<i?(i&134217727)!==0?32:268435456:8:2}function Ku(){var i=X.p;return i!==0?i:(i=window.event,i===void 0?32:FS(i.type))}function Go(i,s){var u=X.p;try{return X.p=i,s()}finally{X.p=u}}var Wr=Math.random().toString(36).slice(2),un="__reactFiber$"+Wr,$="__reactProps$"+Wr,me="__reactContainer$"+Wr,nt="__reactEvents$"+Wr,vt="__reactListeners$"+Wr,en="__reactHandles$"+Wr,ur="__reactResources$"+Wr,kn="__reactMarker$"+Wr;function cr(i){delete i[un],delete i[$],delete i[nt],delete i[vt],delete i[en]}function pn(i){var s=i[un];if(s)return s;for(var u=i.parentNode;u;){if(s=u[me]||u[un]){if(u=s.alternate,s.child!==null||u!==null&&u.child!==null)for(i=CS(i);i!==null;){if(u=i[un])return u;i=CS(i)}return s}i=u,u=i.parentNode}return null}function mi(i){if(i=i[un]||i[me]){var s=i.tag;if(s===5||s===6||s===13||s===31||s===26||s===27||s===3)return i}return null}function Dr(i){var s=i.tag;if(s===5||s===26||s===27||s===6)return i.stateNode;throw Error(r(33))}function Ve(i){var s=i[ur];return s||(s=i[ur]={hoistableStyles:new Map,hoistableScripts:new Map}),s}function Fe(i){i[kn]=!0}var ct=new Set,Mt={};function Wt(i,s){Vn(i,s),Vn(i+"Capture",s)}function Vn(i,s){for(Mt[i]=s,i=0;i<s.length;i++)ct.add(s[i])}var gi=RegExp("^[: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]*$"),Xr={},Hi={};function Pa(i){return Jt.call(Hi,i)?!0:Jt.call(Xr,i)?!1:gi.test(i)?Hi[i]=!0:(Xr[i]=!0,!1)}function vi(i,s,u){if(Pa(s))if(u===null)i.removeAttribute(s);else{switch(typeof u){case"undefined":case"function":case"symbol":i.removeAttribute(s);return;case"boolean":var p=s.toLowerCase().slice(0,5);if(p!=="data-"&&p!=="aria-"){i.removeAttribute(s);return}}i.setAttribute(s,""+u)}}function La(i,s,u){if(u===null)i.removeAttribute(s);else{switch(typeof u){case"undefined":case"function":case"symbol":case"boolean":i.removeAttribute(s);return}i.setAttribute(s,""+u)}}function yi(i,s,u,p){if(p===null)i.removeAttribute(u);else{switch(typeof p){case"undefined":case"function":case"symbol":case"boolean":i.removeAttribute(u);return}i.setAttributeNS(s,u,""+p)}}function dr(i){switch(typeof i){case"bigint":case"boolean":case"number":case"string":case"undefined":return i;case"object":return i;default:return""}}function c0(i){var s=i.type;return(i=i.nodeName)&&i.toLowerCase()==="input"&&(s==="checkbox"||s==="radio")}function m2(i,s,u){var p=Object.getOwnPropertyDescriptor(i.constructor.prototype,s);if(!i.hasOwnProperty(s)&&typeof p<"u"&&typeof p.get=="function"&&typeof p.set=="function"){var y=p.get,x=p.set;return Object.defineProperty(i,s,{configurable:!0,get:function(){return y.call(this)},set:function(A){u=""+A,x.call(this,A)}}),Object.defineProperty(i,s,{enumerable:p.enumerable}),{getValue:function(){return u},setValue:function(A){u=""+A},stopTracking:function(){i._valueTracker=null,delete i[s]}}}}function qf(i){if(!i._valueTracker){var s=c0(i)?"checked":"value";i._valueTracker=m2(i,s,""+i[s])}}function d0(i){if(!i)return!1;var s=i._valueTracker;if(!s)return!0;var u=s.getValue(),p="";return i&&(p=c0(i)?i.checked?"true":"false":i.value),i=p,i!==u?(s.setValue(i),!0):!1}function $u(i){if(i=i||(typeof document<"u"?document:void 0),typeof i>"u")return null;try{return i.activeElement||i.body}catch{return i.body}}var g2=/[\n"\\]/g;function fr(i){return i.replace(g2,function(s){return"\\"+s.charCodeAt(0).toString(16)+" "})}function Gf(i,s,u,p,y,x,A,O){i.name="",A!=null&&typeof A!="function"&&typeof A!="symbol"&&typeof A!="boolean"?i.type=A:i.removeAttribute("type"),s!=null?A==="number"?(s===0&&i.value===""||i.value!=s)&&(i.value=""+dr(s)):i.value!==""+dr(s)&&(i.value=""+dr(s)):A!=="submit"&&A!=="reset"||i.removeAttribute("value"),s!=null?Kf(i,A,dr(s)):u!=null?Kf(i,A,dr(u)):p!=null&&i.removeAttribute("value"),y==null&&x!=null&&(i.defaultChecked=!!x),y!=null&&(i.checked=y&&typeof y!="function"&&typeof y!="symbol"),O!=null&&typeof O!="function"&&typeof O!="symbol"&&typeof O!="boolean"?i.name=""+dr(O):i.removeAttribute("name")}function f0(i,s,u,p,y,x,A,O){if(x!=null&&typeof x!="function"&&typeof x!="symbol"&&typeof x!="boolean"&&(i.type=x),s!=null||u!=null){if(!(x!=="submit"&&x!=="reset"||s!=null)){qf(i);return}u=u!=null?""+dr(u):"",s=s!=null?""+dr(s):u,O||s===i.value||(i.value=s),i.defaultValue=s}p=p??y,p=typeof p!="function"&&typeof p!="symbol"&&!!p,i.checked=O?i.checked:!!p,i.defaultChecked=!!p,A!=null&&typeof A!="function"&&typeof A!="symbol"&&typeof A!="boolean"&&(i.name=A),qf(i)}function Kf(i,s,u){s==="number"&&$u(i.ownerDocument)===i||i.defaultValue===""+u||(i.defaultValue=""+u)}function Ss(i,s,u,p){if(i=i.options,s){s={};for(var y=0;y<u.length;y++)s["$"+u[y]]=!0;for(u=0;u<i.length;u++)y=s.hasOwnProperty("$"+i[u].value),i[u].selected!==y&&(i[u].selected=y),y&&p&&(i[u].defaultSelected=!0)}else{for(u=""+dr(u),s=null,y=0;y<i.length;y++){if(i[y].value===u){i[y].selected=!0,p&&(i[y].defaultSelected=!0);return}s!==null||i[y].disabled||(s=i[y])}s!==null&&(s.selected=!0)}}function h0(i,s,u){if(s!=null&&(s=""+dr(s),s!==i.value&&(i.value=s),u==null)){i.defaultValue!==s&&(i.defaultValue=s);return}i.defaultValue=u!=null?""+dr(u):""}function p0(i,s,u,p){if(s==null){if(p!=null){if(u!=null)throw Error(r(92));if(Z(p)){if(1<p.length)throw Error(r(93));p=p[0]}u=p}u==null&&(u=""),s=u}u=dr(s),i.defaultValue=u,p=i.textContent,p===u&&p!==""&&p!==null&&(i.value=p),qf(i)}function ws(i,s){if(s){var u=i.firstChild;if(u&&u===i.lastChild&&u.nodeType===3){u.nodeValue=s;return}}i.textContent=s}var v2=new Set("animationIterationCount aspectRatio borderImageOutset borderImageSlice borderImageWidth boxFlex boxFlexGroup boxOrdinalGroup columnCount columns flex flexGrow flexPositive flexShrink flexNegative flexOrder gridArea gridRow gridRowEnd gridRowSpan gridRowStart gridColumn gridColumnEnd gridColumnSpan gridColumnStart fontWeight lineClamp lineHeight opacity order orphans scale tabSize widows zIndex zoom fillOpacity floodOpacity stopOpacity strokeDasharray strokeDashoffset strokeMiterlimit strokeOpacity strokeWidth MozAnimationIterationCount MozBoxFlex MozBoxFlexGroup MozLineClamp msAnimationIterationCount msFlex msZoom msFlexGrow msFlexNegative msFlexOrder msFlexPositive msFlexShrink msGridColumn msGridColumnSpan msGridRow msGridRowSpan WebkitAnimationIterationCount WebkitBoxFlex WebKitBoxFlexGroup WebkitBoxOrdinalGroup WebkitColumnCount WebkitColumns WebkitFlex WebkitFlexGrow WebkitFlexPositive WebkitFlexShrink WebkitLineClamp".split(" "));function m0(i,s,u){var p=s.indexOf("--")===0;u==null||typeof u=="boolean"||u===""?p?i.setProperty(s,""):s==="float"?i.cssFloat="":i[s]="":p?i.setProperty(s,u):typeof u!="number"||u===0||v2.has(s)?s==="float"?i.cssFloat=u:i[s]=(""+u).trim():i[s]=u+"px"}function g0(i,s,u){if(s!=null&&typeof s!="object")throw Error(r(62));if(i=i.style,u!=null){for(var p in u)!u.hasOwnProperty(p)||s!=null&&s.hasOwnProperty(p)||(p.indexOf("--")===0?i.setProperty(p,""):p==="float"?i.cssFloat="":i[p]="");for(var y in s)p=s[y],s.hasOwnProperty(y)&&u[y]!==p&&m0(i,y,p)}else for(var x in s)s.hasOwnProperty(x)&&m0(i,x,s[x])}function $f(i){if(i.indexOf("-")===-1)return!1;switch(i){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 y2=new Map([["acceptCharset","accept-charset"],["htmlFor","for"],["httpEquiv","http-equiv"],["crossOrigin","crossorigin"],["accentHeight","accent-height"],["alignmentBaseline","alignment-baseline"],["arabicForm","arabic-form"],["baselineShift","baseline-shift"],["capHeight","cap-height"],["clipPath","clip-path"],["clipRule","clip-rule"],["colorInterpolation","color-interpolation"],["colorInterpolationFilters","color-interpolation-filters"],["colorProfile","color-profile"],["colorRendering","color-rendering"],["dominantBaseline","dominant-baseline"],["enableBackground","enable-background"],["fillOpacity","fill-opacity"],["fillRule","fill-rule"],["floodColor","flood-color"],["floodOpacity","flood-opacity"],["fontFamily","font-family"],["fontSize","font-size"],["fontSizeAdjust","font-size-adjust"],["fontStretch","font-stretch"],["fontStyle","font-style"],["fontVariant","font-variant"],["fontWeight","font-weight"],["glyphName","glyph-name"],["glyphOrientationHorizontal","glyph-orientation-horizontal"],["glyphOrientationVertical","glyph-orientation-vertical"],["horizAdvX","horiz-adv-x"],["horizOriginX","horiz-origin-x"],["imageRendering","image-rendering"],["letterSpacing","letter-spacing"],["lightingColor","lighting-color"],["markerEnd","marker-end"],["markerMid","marker-mid"],["markerStart","marker-start"],["overlinePosition","overline-position"],["overlineThickness","overline-thickness"],["paintOrder","paint-order"],["panose-1","panose-1"],["pointerEvents","pointer-events"],["renderingIntent","rendering-intent"],["shapeRendering","shape-rendering"],["stopColor","stop-color"],["stopOpacity","stop-opacity"],["strikethroughPosition","strikethrough-position"],["strikethroughThickness","strikethrough-thickness"],["strokeDasharray","stroke-dasharray"],["strokeDashoffset","stroke-dashoffset"],["strokeLinecap","stroke-linecap"],["strokeLinejoin","stroke-linejoin"],["strokeMiterlimit","stroke-miterlimit"],["strokeOpacity","stroke-opacity"],["strokeWidth","stroke-width"],["textAnchor","text-anchor"],["textDecoration","text-decoration"],["textRendering","text-rendering"],["transformOrigin","transform-origin"],["underlinePosition","underline-position"],["underlineThickness","underline-thickness"],["unicodeBidi","unicode-bidi"],["unicodeRange","unicode-range"],["unitsPerEm","units-per-em"],["vAlphabetic","v-alphabetic"],["vHanging","v-hanging"],["vIdeographic","v-ideographic"],["vMathematical","v-mathematical"],["vectorEffect","vector-effect"],["vertAdvY","vert-adv-y"],["vertOriginX","vert-origin-x"],["vertOriginY","vert-origin-y"],["wordSpacing","word-spacing"],["writingMode","writing-mode"],["xmlnsXlink","xmlns:xlink"],["xHeight","x-height"]]),b2=/^[\u0000-\u001F ]*j[\r\n\t]*a[\r\n\t]*v[\r\n\t]*a[\r\n\t]*s[\r\n\t]*c[\r\n\t]*r[\r\n\t]*i[\r\n\t]*p[\r\n\t]*t[\r\n\t]*:/i;function Yu(i){return b2.test(""+i)?"javascript:throw new Error('React has blocked a javascript: URL as a security precaution.')":i}function bi(){}var Yf=null;function Wf(i){return i=i.target||i.srcElement||window,i.correspondingUseElement&&(i=i.correspondingUseElement),i.nodeType===3?i.parentNode:i}var Es=null,Ts=null;function v0(i){var s=mi(i);if(s&&(i=s.stateNode)){var u=i[$]||null;e:switch(i=s.stateNode,s.type){case"input":if(Gf(i,u.value,u.defaultValue,u.defaultValue,u.checked,u.defaultChecked,u.type,u.name),s=u.name,u.type==="radio"&&s!=null){for(u=i;u.parentNode;)u=u.parentNode;for(u=u.querySelectorAll('input[name="'+fr(""+s)+'"][type="radio"]'),s=0;s<u.length;s++){var p=u[s];if(p!==i&&p.form===i.form){var y=p[$]||null;if(!y)throw Error(r(90));Gf(p,y.value,y.defaultValue,y.defaultValue,y.checked,y.defaultChecked,y.type,y.name)}}for(s=0;s<u.length;s++)p=u[s],p.form===i.form&&d0(p)}break e;case"textarea":h0(i,u.value,u.defaultValue);break e;case"select":s=u.value,s!=null&&Ss(i,!!u.multiple,s,!1)}}}var Xf=!1;function y0(i,s,u){if(Xf)return i(s,u);Xf=!0;try{var p=i(s);return p}finally{if(Xf=!1,(Es!==null||Ts!==null)&&(Ic(),Es&&(s=Es,i=Ts,Ts=Es=null,v0(s),i)))for(s=0;s<i.length;s++)v0(i[s])}}function Ko(i,s){var u=i.stateNode;if(u===null)return null;var p=u[$]||null;if(p===null)return null;u=p[s];e:switch(s){case"onClick":case"onClickCapture":case"onDoubleClick":case"onDoubleClickCapture":case"onMouseDown":case"onMouseDownCapture":case"onMouseMove":case"onMouseMoveCapture":case"onMouseUp":case"onMouseUpCapture":case"onMouseEnter":(p=!p.disabled)||(i=i.type,p=!(i==="button"||i==="input"||i==="select"||i==="textarea")),i=!p;break e;default:i=!1}if(i)return null;if(u&&typeof u!="function")throw Error(r(231,s,typeof u));return u}var xi=!(typeof window>"u"||typeof window.document>"u"||typeof window.document.createElement>"u"),Qf=!1;if(xi)try{var $o={};Object.defineProperty($o,"passive",{get:function(){Qf=!0}}),window.addEventListener("test",$o,$o),window.removeEventListener("test",$o,$o)}catch{Qf=!1}var qi=null,Jf=null,Wu=null;function b0(){if(Wu)return Wu;var i,s=Jf,u=s.length,p,y="value"in qi?qi.value:qi.textContent,x=y.length;for(i=0;i<u&&s[i]===y[i];i++);var A=u-i;for(p=1;p<=A&&s[u-p]===y[x-p];p++);return Wu=y.slice(i,1<p?1-p:void 0)}function Xu(i){var s=i.keyCode;return"charCode"in i?(i=i.charCode,i===0&&s===13&&(i=13)):i=s,i===10&&(i=13),32<=i||i===13?i:0}function Qu(){return!0}function x0(){return!1}function Fn(i){function s(u,p,y,x,A){this._reactName=u,this._targetInst=y,this.type=p,this.nativeEvent=x,this.target=A,this.currentTarget=null;for(var O in i)i.hasOwnProperty(O)&&(u=i[O],this[O]=u?u(x):x[O]);return this.isDefaultPrevented=(x.defaultPrevented!=null?x.defaultPrevented:x.returnValue===!1)?Qu:x0,this.isPropagationStopped=x0,this}return g(s.prototype,{preventDefault:function(){this.defaultPrevented=!0;var u=this.nativeEvent;u&&(u.preventDefault?u.preventDefault():typeof u.returnValue!="unknown"&&(u.returnValue=!1),this.isDefaultPrevented=Qu)},stopPropagation:function(){var u=this.nativeEvent;u&&(u.stopPropagation?u.stopPropagation():typeof u.cancelBubble!="unknown"&&(u.cancelBubble=!0),this.isPropagationStopped=Qu)},persist:function(){},isPersistent:Qu}),s}var za={eventPhase:0,bubbles:0,cancelable:0,timeStamp:function(i){return i.timeStamp||Date.now()},defaultPrevented:0,isTrusted:0},Ju=Fn(za),Yo=g({},za,{view:0,detail:0}),x2=Fn(Yo),Zf,eh,Wo,Zu=g({},Yo,{screenX:0,screenY:0,clientX:0,clientY:0,pageX:0,pageY:0,ctrlKey:0,shiftKey:0,altKey:0,metaKey:0,getModifierState:nh,button:0,buttons:0,relatedTarget:function(i){return i.relatedTarget===void 0?i.fromElement===i.srcElement?i.toElement:i.fromElement:i.relatedTarget},movementX:function(i){return"movementX"in i?i.movementX:(i!==Wo&&(Wo&&i.type==="mousemove"?(Zf=i.screenX-Wo.screenX,eh=i.screenY-Wo.screenY):eh=Zf=0,Wo=i),Zf)},movementY:function(i){return"movementY"in i?i.movementY:eh}}),S0=Fn(Zu),S2=g({},Zu,{dataTransfer:0}),w2=Fn(S2),E2=g({},Yo,{relatedTarget:0}),th=Fn(E2),T2=g({},za,{animationName:0,elapsedTime:0,pseudoElement:0}),k2=Fn(T2),C2=g({},za,{clipboardData:function(i){return"clipboardData"in i?i.clipboardData:window.clipboardData}}),A2=Fn(C2),N2=g({},za,{data:0}),w0=Fn(N2),j2={Esc:"Escape",Spacebar:" ",Left:"ArrowLeft",Up:"ArrowUp",Right:"ArrowRight",Down:"ArrowDown",Del:"Delete",Win:"OS",Menu:"ContextMenu",Apps:"ContextMenu",Scroll:"ScrollLock",MozPrintableKey:"Unidentified"},R2={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"},_2={Alt:"altKey",Control:"ctrlKey",Meta:"metaKey",Shift:"shiftKey"};function O2(i){var s=this.nativeEvent;return s.getModifierState?s.getModifierState(i):(i=_2[i])?!!s[i]:!1}function nh(){return O2}var M2=g({},Yo,{key:function(i){if(i.key){var s=j2[i.key]||i.key;if(s!=="Unidentified")return s}return i.type==="keypress"?(i=Xu(i),i===13?"Enter":String.fromCharCode(i)):i.type==="keydown"||i.type==="keyup"?R2[i.keyCode]||"Unidentified":""},code:0,location:0,ctrlKey:0,shiftKey:0,altKey:0,metaKey:0,repeat:0,locale:0,getModifierState:nh,charCode:function(i){return i.type==="keypress"?Xu(i):0},keyCode:function(i){return i.type==="keydown"||i.type==="keyup"?i.keyCode:0},which:function(i){return i.type==="keypress"?Xu(i):i.type==="keydown"||i.type==="keyup"?i.keyCode:0}}),D2=Fn(M2),I2=g({},Zu,{pointerId:0,width:0,height:0,pressure:0,tangentialPressure:0,tiltX:0,tiltY:0,twist:0,pointerType:0,isPrimary:0}),E0=Fn(I2),P2=g({},Yo,{touches:0,targetTouches:0,changedTouches:0,altKey:0,metaKey:0,ctrlKey:0,shiftKey:0,getModifierState:nh}),L2=Fn(P2),z2=g({},za,{propertyName:0,elapsedTime:0,pseudoElement:0}),U2=Fn(z2),B2=g({},Zu,{deltaX:function(i){return"deltaX"in i?i.deltaX:"wheelDeltaX"in i?-i.wheelDeltaX:0},deltaY:function(i){return"deltaY"in i?i.deltaY:"wheelDeltaY"in i?-i.wheelDeltaY:"wheelDelta"in i?-i.wheelDelta:0},deltaZ:0,deltaMode:0}),V2=Fn(B2),F2=g({},za,{newState:0,oldState:0}),H2=Fn(F2),q2=[9,13,27,32],rh=xi&&"CompositionEvent"in window,Xo=null;xi&&"documentMode"in document&&(Xo=document.documentMode);var G2=xi&&"TextEvent"in window&&!Xo,T0=xi&&(!rh||Xo&&8<Xo&&11>=Xo),k0=" ",C0=!1;function A0(i,s){switch(i){case"keyup":return q2.indexOf(s.keyCode)!==-1;case"keydown":return s.keyCode!==229;case"keypress":case"mousedown":case"focusout":return!0;default:return!1}}function N0(i){return i=i.detail,typeof i=="object"&&"data"in i?i.data:null}var ks=!1;function K2(i,s){switch(i){case"compositionend":return N0(s);case"keypress":return s.which!==32?null:(C0=!0,k0);case"textInput":return i=s.data,i===k0&&C0?null:i;default:return null}}function $2(i,s){if(ks)return i==="compositionend"||!rh&&A0(i,s)?(i=b0(),Wu=Jf=qi=null,ks=!1,i):null;switch(i){case"paste":return null;case"keypress":if(!(s.ctrlKey||s.altKey||s.metaKey)||s.ctrlKey&&s.altKey){if(s.char&&1<s.char.length)return s.char;if(s.which)return String.fromCharCode(s.which)}return null;case"compositionend":return T0&&s.locale!=="ko"?null:s.data;default:return null}}var Y2={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 j0(i){var s=i&&i.nodeName&&i.nodeName.toLowerCase();return s==="input"?!!Y2[i.type]:s==="textarea"}function R0(i,s,u,p){Es?Ts?Ts.push(p):Ts=[p]:Es=p,s=Fc(s,"onChange"),0<s.length&&(u=new Ju("onChange","change",null,u,p),i.push({event:u,listeners:s}))}var Qo=null,Jo=null;function W2(i){fS(i,0)}function ec(i){var s=Dr(i);if(d0(s))return i}function _0(i,s){if(i==="change")return s}var O0=!1;if(xi){var ih;if(xi){var ah="oninput"in document;if(!ah){var M0=document.createElement("div");M0.setAttribute("oninput","return;"),ah=typeof M0.oninput=="function"}ih=ah}else ih=!1;O0=ih&&(!document.documentMode||9<document.documentMode)}function D0(){Qo&&(Qo.detachEvent("onpropertychange",I0),Jo=Qo=null)}function I0(i){if(i.propertyName==="value"&&ec(Jo)){var s=[];R0(s,Jo,i,Wf(i)),y0(W2,s)}}function X2(i,s,u){i==="focusin"?(D0(),Qo=s,Jo=u,Qo.attachEvent("onpropertychange",I0)):i==="focusout"&&D0()}function Q2(i){if(i==="selectionchange"||i==="keyup"||i==="keydown")return ec(Jo)}function J2(i,s){if(i==="click")return ec(s)}function Z2(i,s){if(i==="input"||i==="change")return ec(s)}function e_(i,s){return i===s&&(i!==0||1/i===1/s)||i!==i&&s!==s}var Qn=typeof Object.is=="function"?Object.is:e_;function Zo(i,s){if(Qn(i,s))return!0;if(typeof i!="object"||i===null||typeof s!="object"||s===null)return!1;var u=Object.keys(i),p=Object.keys(s);if(u.length!==p.length)return!1;for(p=0;p<u.length;p++){var y=u[p];if(!Jt.call(s,y)||!Qn(i[y],s[y]))return!1}return!0}function P0(i){for(;i&&i.firstChild;)i=i.firstChild;return i}function L0(i,s){var u=P0(i);i=0;for(var p;u;){if(u.nodeType===3){if(p=i+u.textContent.length,i<=s&&p>=s)return{node:u,offset:s-i};i=p}e:{for(;u;){if(u.nextSibling){u=u.nextSibling;break e}u=u.parentNode}u=void 0}u=P0(u)}}function z0(i,s){return i&&s?i===s?!0:i&&i.nodeType===3?!1:s&&s.nodeType===3?z0(i,s.parentNode):"contains"in i?i.contains(s):i.compareDocumentPosition?!!(i.compareDocumentPosition(s)&16):!1:!1}function U0(i){i=i!=null&&i.ownerDocument!=null&&i.ownerDocument.defaultView!=null?i.ownerDocument.defaultView:window;for(var s=$u(i.document);s instanceof i.HTMLIFrameElement;){try{var u=typeof s.contentWindow.location.href=="string"}catch{u=!1}if(u)i=s.contentWindow;else break;s=$u(i.document)}return s}function sh(i){var s=i&&i.nodeName&&i.nodeName.toLowerCase();return s&&(s==="input"&&(i.type==="text"||i.type==="search"||i.type==="tel"||i.type==="url"||i.type==="password")||s==="textarea"||i.contentEditable==="true")}var t_=xi&&"documentMode"in document&&11>=document.documentMode,Cs=null,oh=null,el=null,lh=!1;function B0(i,s,u){var p=u.window===u?u.document:u.nodeType===9?u:u.ownerDocument;lh||Cs==null||Cs!==$u(p)||(p=Cs,"selectionStart"in p&&sh(p)?p={start:p.selectionStart,end:p.selectionEnd}:(p=(p.ownerDocument&&p.ownerDocument.defaultView||window).getSelection(),p={anchorNode:p.anchorNode,anchorOffset:p.anchorOffset,focusNode:p.focusNode,focusOffset:p.focusOffset}),el&&Zo(el,p)||(el=p,p=Fc(oh,"onSelect"),0<p.length&&(s=new Ju("onSelect","select",null,s,u),i.push({event:s,listeners:p}),s.target=Cs)))}function Ua(i,s){var u={};return u[i.toLowerCase()]=s.toLowerCase(),u["Webkit"+i]="webkit"+s,u["Moz"+i]="moz"+s,u}var As={animationend:Ua("Animation","AnimationEnd"),animationiteration:Ua("Animation","AnimationIteration"),animationstart:Ua("Animation","AnimationStart"),transitionrun:Ua("Transition","TransitionRun"),transitionstart:Ua("Transition","TransitionStart"),transitioncancel:Ua("Transition","TransitionCancel"),transitionend:Ua("Transition","TransitionEnd")},uh={},V0={};xi&&(V0=document.createElement("div").style,"AnimationEvent"in window||(delete As.animationend.animation,delete As.animationiteration.animation,delete As.animationstart.animation),"TransitionEvent"in window||delete As.transitionend.transition);function Ba(i){if(uh[i])return uh[i];if(!As[i])return i;var s=As[i],u;for(u in s)if(s.hasOwnProperty(u)&&u in V0)return uh[i]=s[u];return i}var F0=Ba("animationend"),H0=Ba("animationiteration"),q0=Ba("animationstart"),n_=Ba("transitionrun"),r_=Ba("transitionstart"),i_=Ba("transitioncancel"),G0=Ba("transitionend"),K0=new Map,ch="abort auxClick beforeToggle 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(" ");ch.push("scrollEnd");function Ir(i,s){K0.set(i,s),Wt(s,[i])}var tc=typeof reportError=="function"?reportError:function(i){if(typeof window=="object"&&typeof window.ErrorEvent=="function"){var s=new window.ErrorEvent("error",{bubbles:!0,cancelable:!0,message:typeof i=="object"&&i!==null&&typeof i.message=="string"?String(i.message):String(i),error:i});if(!window.dispatchEvent(s))return}else if(typeof process=="object"&&typeof process.emit=="function"){process.emit("uncaughtException",i);return}console.error(i)},hr=[],Ns=0,dh=0;function nc(){for(var i=Ns,s=dh=Ns=0;s<i;){var u=hr[s];hr[s++]=null;var p=hr[s];hr[s++]=null;var y=hr[s];hr[s++]=null;var x=hr[s];if(hr[s++]=null,p!==null&&y!==null){var A=p.pending;A===null?y.next=y:(y.next=A.next,A.next=y),p.pending=y}x!==0&&$0(u,y,x)}}function rc(i,s,u,p){hr[Ns++]=i,hr[Ns++]=s,hr[Ns++]=u,hr[Ns++]=p,dh|=p,i.lanes|=p,i=i.alternate,i!==null&&(i.lanes|=p)}function fh(i,s,u,p){return rc(i,s,u,p),ic(i)}function Va(i,s){return rc(i,null,null,s),ic(i)}function $0(i,s,u){i.lanes|=u;var p=i.alternate;p!==null&&(p.lanes|=u);for(var y=!1,x=i.return;x!==null;)x.childLanes|=u,p=x.alternate,p!==null&&(p.childLanes|=u),x.tag===22&&(i=x.stateNode,i===null||i._visibility&1||(y=!0)),i=x,x=x.return;return i.tag===3?(x=i.stateNode,y&&s!==null&&(y=31-Y(u),i=x.hiddenUpdates,p=i[y],p===null?i[y]=[s]:p.push(s),s.lane=u|536870912),x):null}function ic(i){if(50<wl)throw wl=0,Sp=null,Error(r(185));for(var s=i.return;s!==null;)i=s,s=i.return;return i.tag===3?i.stateNode:null}var js={};function a_(i,s,u,p){this.tag=i,this.key=u,this.sibling=this.child=this.return=this.stateNode=this.type=this.elementType=null,this.index=0,this.refCleanup=this.ref=null,this.pendingProps=s,this.dependencies=this.memoizedState=this.updateQueue=this.memoizedProps=null,this.mode=p,this.subtreeFlags=this.flags=0,this.deletions=null,this.childLanes=this.lanes=0,this.alternate=null}function Jn(i,s,u,p){return new a_(i,s,u,p)}function hh(i){return i=i.prototype,!(!i||!i.isReactComponent)}function Si(i,s){var u=i.alternate;return u===null?(u=Jn(i.tag,s,i.key,i.mode),u.elementType=i.elementType,u.type=i.type,u.stateNode=i.stateNode,u.alternate=i,i.alternate=u):(u.pendingProps=s,u.type=i.type,u.flags=0,u.subtreeFlags=0,u.deletions=null),u.flags=i.flags&65011712,u.childLanes=i.childLanes,u.lanes=i.lanes,u.child=i.child,u.memoizedProps=i.memoizedProps,u.memoizedState=i.memoizedState,u.updateQueue=i.updateQueue,s=i.dependencies,u.dependencies=s===null?null:{lanes:s.lanes,firstContext:s.firstContext},u.sibling=i.sibling,u.index=i.index,u.ref=i.ref,u.refCleanup=i.refCleanup,u}function Y0(i,s){i.flags&=65011714;var u=i.alternate;return u===null?(i.childLanes=0,i.lanes=s,i.child=null,i.subtreeFlags=0,i.memoizedProps=null,i.memoizedState=null,i.updateQueue=null,i.dependencies=null,i.stateNode=null):(i.childLanes=u.childLanes,i.lanes=u.lanes,i.child=u.child,i.subtreeFlags=0,i.deletions=null,i.memoizedProps=u.memoizedProps,i.memoizedState=u.memoizedState,i.updateQueue=u.updateQueue,i.type=u.type,s=u.dependencies,i.dependencies=s===null?null:{lanes:s.lanes,firstContext:s.firstContext}),i}function ac(i,s,u,p,y,x){var A=0;if(p=i,typeof i=="function")hh(i)&&(A=1);else if(typeof i=="string")A=cO(i,u,fe.current)?26:i==="html"||i==="head"||i==="body"?27:5;else e:switch(i){case H:return i=Jn(31,u,s,y),i.elementType=H,i.lanes=x,i;case w:return Fa(u.children,y,x,s);case E:A=8,y|=24;break;case T:return i=Jn(12,u,s,y|2),i.elementType=T,i.lanes=x,i;case N:return i=Jn(13,u,s,y),i.elementType=N,i.lanes=x,i;case R:return i=Jn(19,u,s,y),i.elementType=R,i.lanes=x,i;default:if(typeof i=="object"&&i!==null)switch(i.$$typeof){case k:A=10;break e;case C:A=9;break e;case j:A=11;break e;case P:A=14;break e;case L:A=16,p=null;break e}A=29,u=Error(r(130,i===null?"null":typeof i,"")),p=null}return s=Jn(A,u,s,y),s.elementType=i,s.type=p,s.lanes=x,s}function Fa(i,s,u,p){return i=Jn(7,i,p,s),i.lanes=u,i}function ph(i,s,u){return i=Jn(6,i,null,s),i.lanes=u,i}function W0(i){var s=Jn(18,null,null,0);return s.stateNode=i,s}function mh(i,s,u){return s=Jn(4,i.children!==null?i.children:[],i.key,s),s.lanes=u,s.stateNode={containerInfo:i.containerInfo,pendingChildren:null,implementation:i.implementation},s}var X0=new WeakMap;function pr(i,s){if(typeof i=="object"&&i!==null){var u=X0.get(i);return u!==void 0?u:(s={value:i,source:s,stack:$t(s)},X0.set(i,s),s)}return{value:i,source:s,stack:$t(s)}}var Rs=[],_s=0,sc=null,tl=0,mr=[],gr=0,Gi=null,Qr=1,Jr="";function wi(i,s){Rs[_s++]=tl,Rs[_s++]=sc,sc=i,tl=s}function Q0(i,s,u){mr[gr++]=Qr,mr[gr++]=Jr,mr[gr++]=Gi,Gi=i;var p=Qr;i=Jr;var y=32-Y(p)-1;p&=~(1<<y),u+=1;var x=32-Y(s)+y;if(30<x){var A=y-y%5;x=(p&(1<<A)-1).toString(32),p>>=A,y-=A,Qr=1<<32-Y(s)+y|u<<y|p,Jr=x+i}else Qr=1<<x|u<<y|p,Jr=i}function gh(i){i.return!==null&&(wi(i,1),Q0(i,1,0))}function vh(i){for(;i===sc;)sc=Rs[--_s],Rs[_s]=null,tl=Rs[--_s],Rs[_s]=null;for(;i===Gi;)Gi=mr[--gr],mr[gr]=null,Jr=mr[--gr],mr[gr]=null,Qr=mr[--gr],mr[gr]=null}function J0(i,s){mr[gr++]=Qr,mr[gr++]=Jr,mr[gr++]=Gi,Qr=s.id,Jr=s.overflow,Gi=i}var gn=null,Dt=null,rt=!1,Ki=null,vr=!1,yh=Error(r(519));function $i(i){var s=Error(r(418,1<arguments.length&&arguments[1]!==void 0&&arguments[1]?"text":"HTML",""));throw nl(pr(s,i)),yh}function Z0(i){var s=i.stateNode,u=i.type,p=i.memoizedProps;switch(s[un]=i,s[$]=p,u){case"dialog":Qe("cancel",s),Qe("close",s);break;case"iframe":case"object":case"embed":Qe("load",s);break;case"video":case"audio":for(u=0;u<Tl.length;u++)Qe(Tl[u],s);break;case"source":Qe("error",s);break;case"img":case"image":case"link":Qe("error",s),Qe("load",s);break;case"details":Qe("toggle",s);break;case"input":Qe("invalid",s),f0(s,p.value,p.defaultValue,p.checked,p.defaultChecked,p.type,p.name,!0);break;case"select":Qe("invalid",s);break;case"textarea":Qe("invalid",s),p0(s,p.value,p.defaultValue,p.children)}u=p.children,typeof u!="string"&&typeof u!="number"&&typeof u!="bigint"||s.textContent===""+u||p.suppressHydrationWarning===!0||gS(s.textContent,u)?(p.popover!=null&&(Qe("beforetoggle",s),Qe("toggle",s)),p.onScroll!=null&&Qe("scroll",s),p.onScrollEnd!=null&&Qe("scrollend",s),p.onClick!=null&&(s.onclick=bi),s=!0):s=!1,s||$i(i,!0)}function eb(i){for(gn=i.return;gn;)switch(gn.tag){case 5:case 31:case 13:vr=!1;return;case 27:case 3:vr=!0;return;default:gn=gn.return}}function Os(i){if(i!==gn)return!1;if(!rt)return eb(i),rt=!0,!1;var s=i.tag,u;if((u=s!==3&&s!==27)&&((u=s===5)&&(u=i.type,u=!(u!=="form"&&u!=="button")||Pp(i.type,i.memoizedProps)),u=!u),u&&Dt&&$i(i),eb(i),s===13){if(i=i.memoizedState,i=i!==null?i.dehydrated:null,!i)throw Error(r(317));Dt=kS(i)}else if(s===31){if(i=i.memoizedState,i=i!==null?i.dehydrated:null,!i)throw Error(r(317));Dt=kS(i)}else s===27?(s=Dt,oa(i.type)?(i=Vp,Vp=null,Dt=i):Dt=s):Dt=gn?br(i.stateNode.nextSibling):null;return!0}function Ha(){Dt=gn=null,rt=!1}function bh(){var i=Ki;return i!==null&&(Kn===null?Kn=i:Kn.push.apply(Kn,i),Ki=null),i}function nl(i){Ki===null?Ki=[i]:Ki.push(i)}var xh=z(null),qa=null,Ei=null;function Yi(i,s,u){I(xh,s._currentValue),s._currentValue=u}function Ti(i){i._currentValue=xh.current,W(xh)}function Sh(i,s,u){for(;i!==null;){var p=i.alternate;if((i.childLanes&s)!==s?(i.childLanes|=s,p!==null&&(p.childLanes|=s)):p!==null&&(p.childLanes&s)!==s&&(p.childLanes|=s),i===u)break;i=i.return}}function wh(i,s,u,p){var y=i.child;for(y!==null&&(y.return=i);y!==null;){var x=y.dependencies;if(x!==null){var A=y.child;x=x.firstContext;e:for(;x!==null;){var O=x;x=y;for(var F=0;F<s.length;F++)if(O.context===s[F]){x.lanes|=u,O=x.alternate,O!==null&&(O.lanes|=u),Sh(x.return,u,i),p||(A=null);break e}x=O.next}}else if(y.tag===18){if(A=y.return,A===null)throw Error(r(341));A.lanes|=u,x=A.alternate,x!==null&&(x.lanes|=u),Sh(A,u,i),A=null}else A=y.child;if(A!==null)A.return=y;else for(A=y;A!==null;){if(A===i){A=null;break}if(y=A.sibling,y!==null){y.return=A.return,A=y;break}A=A.return}y=A}}function Ms(i,s,u,p){i=null;for(var y=s,x=!1;y!==null;){if(!x){if((y.flags&524288)!==0)x=!0;else if((y.flags&262144)!==0)break}if(y.tag===10){var A=y.alternate;if(A===null)throw Error(r(387));if(A=A.memoizedProps,A!==null){var O=y.type;Qn(y.pendingProps.value,A.value)||(i!==null?i.push(O):i=[O])}}else if(y===we.current){if(A=y.alternate,A===null)throw Error(r(387));A.memoizedState.memoizedState!==y.memoizedState.memoizedState&&(i!==null?i.push(jl):i=[jl])}y=y.return}i!==null&&wh(s,i,u,p),s.flags|=262144}function oc(i){for(i=i.firstContext;i!==null;){if(!Qn(i.context._currentValue,i.memoizedValue))return!0;i=i.next}return!1}function Ga(i){qa=i,Ei=null,i=i.dependencies,i!==null&&(i.firstContext=null)}function vn(i){return tb(qa,i)}function lc(i,s){return qa===null&&Ga(i),tb(i,s)}function tb(i,s){var u=s._currentValue;if(s={context:s,memoizedValue:u,next:null},Ei===null){if(i===null)throw Error(r(308));Ei=s,i.dependencies={lanes:0,firstContext:s},i.flags|=524288}else Ei=Ei.next=s;return u}var s_=typeof AbortController<"u"?AbortController:function(){var i=[],s=this.signal={aborted:!1,addEventListener:function(u,p){i.push(p)}};this.abort=function(){s.aborted=!0,i.forEach(function(u){return u()})}},o_=e.unstable_scheduleCallback,l_=e.unstable_NormalPriority,tn={$$typeof:k,Consumer:null,Provider:null,_currentValue:null,_currentValue2:null,_threadCount:0};function Eh(){return{controller:new s_,data:new Map,refCount:0}}function rl(i){i.refCount--,i.refCount===0&&o_(l_,function(){i.controller.abort()})}var il=null,Th=0,Ds=0,Is=null;function u_(i,s){if(il===null){var u=il=[];Th=0,Ds=Ap(),Is={status:"pending",value:void 0,then:function(p){u.push(p)}}}return Th++,s.then(nb,nb),s}function nb(){if(--Th===0&&il!==null){Is!==null&&(Is.status="fulfilled");var i=il;il=null,Ds=0,Is=null;for(var s=0;s<i.length;s++)(0,i[s])()}}function c_(i,s){var u=[],p={status:"pending",value:null,reason:null,then:function(y){u.push(y)}};return i.then(function(){p.status="fulfilled",p.value=s;for(var y=0;y<u.length;y++)(0,u[y])(s)},function(y){for(p.status="rejected",p.reason=y,y=0;y<u.length;y++)(0,u[y])(void 0)}),p}var rb=V.S;V.S=function(i,s){Bx=Me(),typeof s=="object"&&s!==null&&typeof s.then=="function"&&u_(i,s),rb!==null&&rb(i,s)};var Ka=z(null);function kh(){var i=Ka.current;return i!==null?i:Ct.pooledCache}function uc(i,s){s===null?I(Ka,Ka.current):I(Ka,s.pool)}function ib(){var i=kh();return i===null?null:{parent:tn._currentValue,pool:i}}var Ps=Error(r(460)),Ch=Error(r(474)),cc=Error(r(542)),dc={then:function(){}};function ab(i){return i=i.status,i==="fulfilled"||i==="rejected"}function sb(i,s,u){switch(u=i[u],u===void 0?i.push(s):u!==s&&(s.then(bi,bi),s=u),s.status){case"fulfilled":return s.value;case"rejected":throw i=s.reason,lb(i),i;default:if(typeof s.status=="string")s.then(bi,bi);else{if(i=Ct,i!==null&&100<i.shellSuspendCounter)throw Error(r(482));i=s,i.status="pending",i.then(function(p){if(s.status==="pending"){var y=s;y.status="fulfilled",y.value=p}},function(p){if(s.status==="pending"){var y=s;y.status="rejected",y.reason=p}})}switch(s.status){case"fulfilled":return s.value;case"rejected":throw i=s.reason,lb(i),i}throw Ya=s,Ps}}function $a(i){try{var s=i._init;return s(i._payload)}catch(u){throw u!==null&&typeof u=="object"&&typeof u.then=="function"?(Ya=u,Ps):u}}var Ya=null;function ob(){if(Ya===null)throw Error(r(459));var i=Ya;return Ya=null,i}function lb(i){if(i===Ps||i===cc)throw Error(r(483))}var Ls=null,al=0;function fc(i){var s=al;return al+=1,Ls===null&&(Ls=[]),sb(Ls,i,s)}function sl(i,s){s=s.props.ref,i.ref=s!==void 0?s:null}function hc(i,s){throw s.$$typeof===v?Error(r(525)):(i=Object.prototype.toString.call(s),Error(r(31,i==="[object Object]"?"object with keys {"+Object.keys(s).join(", ")+"}":i)))}function ub(i){function s(J,G){if(i){var ne=J.deletions;ne===null?(J.deletions=[G],J.flags|=16):ne.push(G)}}function u(J,G){if(!i)return null;for(;G!==null;)s(J,G),G=G.sibling;return null}function p(J){for(var G=new Map;J!==null;)J.key!==null?G.set(J.key,J):G.set(J.index,J),J=J.sibling;return G}function y(J,G){return J=Si(J,G),J.index=0,J.sibling=null,J}function x(J,G,ne){return J.index=ne,i?(ne=J.alternate,ne!==null?(ne=ne.index,ne<G?(J.flags|=67108866,G):ne):(J.flags|=67108866,G)):(J.flags|=1048576,G)}function A(J){return i&&J.alternate===null&&(J.flags|=67108866),J}function O(J,G,ne,he){return G===null||G.tag!==6?(G=ph(ne,J.mode,he),G.return=J,G):(G=y(G,ne),G.return=J,G)}function F(J,G,ne,he){var Oe=ne.type;return Oe===w?de(J,G,ne.props.children,he,ne.key):G!==null&&(G.elementType===Oe||typeof Oe=="object"&&Oe!==null&&Oe.$$typeof===L&&$a(Oe)===G.type)?(G=y(G,ne.props),sl(G,ne),G.return=J,G):(G=ac(ne.type,ne.key,ne.props,null,J.mode,he),sl(G,ne),G.return=J,G)}function re(J,G,ne,he){return G===null||G.tag!==4||G.stateNode.containerInfo!==ne.containerInfo||G.stateNode.implementation!==ne.implementation?(G=mh(ne,J.mode,he),G.return=J,G):(G=y(G,ne.children||[]),G.return=J,G)}function de(J,G,ne,he,Oe){return G===null||G.tag!==7?(G=Fa(ne,J.mode,he,Oe),G.return=J,G):(G=y(G,ne),G.return=J,G)}function pe(J,G,ne){if(typeof G=="string"&&G!==""||typeof G=="number"||typeof G=="bigint")return G=ph(""+G,J.mode,ne),G.return=J,G;if(typeof G=="object"&&G!==null){switch(G.$$typeof){case b:return ne=ac(G.type,G.key,G.props,null,J.mode,ne),sl(ne,G),ne.return=J,ne;case S:return G=mh(G,J.mode,ne),G.return=J,G;case L:return G=$a(G),pe(J,G,ne)}if(Z(G)||K(G))return G=Fa(G,J.mode,ne,null),G.return=J,G;if(typeof G.then=="function")return pe(J,fc(G),ne);if(G.$$typeof===k)return pe(J,lc(J,G),ne);hc(J,G)}return null}function ie(J,G,ne,he){var Oe=G!==null?G.key:null;if(typeof ne=="string"&&ne!==""||typeof ne=="number"||typeof ne=="bigint")return Oe!==null?null:O(J,G,""+ne,he);if(typeof ne=="object"&&ne!==null){switch(ne.$$typeof){case b:return ne.key===Oe?F(J,G,ne,he):null;case S:return ne.key===Oe?re(J,G,ne,he):null;case L:return ne=$a(ne),ie(J,G,ne,he)}if(Z(ne)||K(ne))return Oe!==null?null:de(J,G,ne,he,null);if(typeof ne.then=="function")return ie(J,G,fc(ne),he);if(ne.$$typeof===k)return ie(J,G,lc(J,ne),he);hc(J,ne)}return null}function oe(J,G,ne,he,Oe){if(typeof he=="string"&&he!==""||typeof he=="number"||typeof he=="bigint")return J=J.get(ne)||null,O(G,J,""+he,Oe);if(typeof he=="object"&&he!==null){switch(he.$$typeof){case b:return J=J.get(he.key===null?ne:he.key)||null,F(G,J,he,Oe);case S:return J=J.get(he.key===null?ne:he.key)||null,re(G,J,he,Oe);case L:return he=$a(he),oe(J,G,ne,he,Oe)}if(Z(he)||K(he))return J=J.get(ne)||null,de(G,J,he,Oe,null);if(typeof he.then=="function")return oe(J,G,ne,fc(he),Oe);if(he.$$typeof===k)return oe(J,G,ne,lc(G,he),Oe);hc(G,he)}return null}function ke(J,G,ne,he){for(var Oe=null,dt=null,Ne=G,$e=G=0,tt=null;Ne!==null&&$e<ne.length;$e++){Ne.index>$e?(tt=Ne,Ne=null):tt=Ne.sibling;var ft=ie(J,Ne,ne[$e],he);if(ft===null){Ne===null&&(Ne=tt);break}i&&Ne&&ft.alternate===null&&s(J,Ne),G=x(ft,G,$e),dt===null?Oe=ft:dt.sibling=ft,dt=ft,Ne=tt}if($e===ne.length)return u(J,Ne),rt&&wi(J,$e),Oe;if(Ne===null){for(;$e<ne.length;$e++)Ne=pe(J,ne[$e],he),Ne!==null&&(G=x(Ne,G,$e),dt===null?Oe=Ne:dt.sibling=Ne,dt=Ne);return rt&&wi(J,$e),Oe}for(Ne=p(Ne);$e<ne.length;$e++)tt=oe(Ne,J,$e,ne[$e],he),tt!==null&&(i&&tt.alternate!==null&&Ne.delete(tt.key===null?$e:tt.key),G=x(tt,G,$e),dt===null?Oe=tt:dt.sibling=tt,dt=tt);return i&&Ne.forEach(function(fa){return s(J,fa)}),rt&&wi(J,$e),Oe}function Ie(J,G,ne,he){if(ne==null)throw Error(r(151));for(var Oe=null,dt=null,Ne=G,$e=G=0,tt=null,ft=ne.next();Ne!==null&&!ft.done;$e++,ft=ne.next()){Ne.index>$e?(tt=Ne,Ne=null):tt=Ne.sibling;var fa=ie(J,Ne,ft.value,he);if(fa===null){Ne===null&&(Ne=tt);break}i&&Ne&&fa.alternate===null&&s(J,Ne),G=x(fa,G,$e),dt===null?Oe=fa:dt.sibling=fa,dt=fa,Ne=tt}if(ft.done)return u(J,Ne),rt&&wi(J,$e),Oe;if(Ne===null){for(;!ft.done;$e++,ft=ne.next())ft=pe(J,ft.value,he),ft!==null&&(G=x(ft,G,$e),dt===null?Oe=ft:dt.sibling=ft,dt=ft);return rt&&wi(J,$e),Oe}for(Ne=p(Ne);!ft.done;$e++,ft=ne.next())ft=oe(Ne,J,$e,ft.value,he),ft!==null&&(i&&ft.alternate!==null&&Ne.delete(ft.key===null?$e:ft.key),G=x(ft,G,$e),dt===null?Oe=ft:dt.sibling=ft,dt=ft);return i&&Ne.forEach(function(SO){return s(J,SO)}),rt&&wi(J,$e),Oe}function Et(J,G,ne,he){if(typeof ne=="object"&&ne!==null&&ne.type===w&&ne.key===null&&(ne=ne.props.children),typeof ne=="object"&&ne!==null){switch(ne.$$typeof){case b:e:{for(var Oe=ne.key;G!==null;){if(G.key===Oe){if(Oe=ne.type,Oe===w){if(G.tag===7){u(J,G.sibling),he=y(G,ne.props.children),he.return=J,J=he;break e}}else if(G.elementType===Oe||typeof Oe=="object"&&Oe!==null&&Oe.$$typeof===L&&$a(Oe)===G.type){u(J,G.sibling),he=y(G,ne.props),sl(he,ne),he.return=J,J=he;break e}u(J,G);break}else s(J,G);G=G.sibling}ne.type===w?(he=Fa(ne.props.children,J.mode,he,ne.key),he.return=J,J=he):(he=ac(ne.type,ne.key,ne.props,null,J.mode,he),sl(he,ne),he.return=J,J=he)}return A(J);case S:e:{for(Oe=ne.key;G!==null;){if(G.key===Oe)if(G.tag===4&&G.stateNode.containerInfo===ne.containerInfo&&G.stateNode.implementation===ne.implementation){u(J,G.sibling),he=y(G,ne.children||[]),he.return=J,J=he;break e}else{u(J,G);break}else s(J,G);G=G.sibling}he=mh(ne,J.mode,he),he.return=J,J=he}return A(J);case L:return ne=$a(ne),Et(J,G,ne,he)}if(Z(ne))return ke(J,G,ne,he);if(K(ne)){if(Oe=K(ne),typeof Oe!="function")throw Error(r(150));return ne=Oe.call(ne),Ie(J,G,ne,he)}if(typeof ne.then=="function")return Et(J,G,fc(ne),he);if(ne.$$typeof===k)return Et(J,G,lc(J,ne),he);hc(J,ne)}return typeof ne=="string"&&ne!==""||typeof ne=="number"||typeof ne=="bigint"?(ne=""+ne,G!==null&&G.tag===6?(u(J,G.sibling),he=y(G,ne),he.return=J,J=he):(u(J,G),he=ph(ne,J.mode,he),he.return=J,J=he),A(J)):u(J,G)}return function(J,G,ne,he){try{al=0;var Oe=Et(J,G,ne,he);return Ls=null,Oe}catch(Ne){if(Ne===Ps||Ne===cc)throw Ne;var dt=Jn(29,Ne,null,J.mode);return dt.lanes=he,dt.return=J,dt}}}var Wa=ub(!0),cb=ub(!1),Wi=!1;function Ah(i){i.updateQueue={baseState:i.memoizedState,firstBaseUpdate:null,lastBaseUpdate:null,shared:{pending:null,lanes:0,hiddenCallbacks:null},callbacks:null}}function Nh(i,s){i=i.updateQueue,s.updateQueue===i&&(s.updateQueue={baseState:i.baseState,firstBaseUpdate:i.firstBaseUpdate,lastBaseUpdate:i.lastBaseUpdate,shared:i.shared,callbacks:null})}function Xi(i){return{lane:i,tag:0,payload:null,callback:null,next:null}}function Qi(i,s,u){var p=i.updateQueue;if(p===null)return null;if(p=p.shared,(pt&2)!==0){var y=p.pending;return y===null?s.next=s:(s.next=y.next,y.next=s),p.pending=s,s=ic(i),$0(i,null,u),s}return rc(i,p,s,u),ic(i)}function ol(i,s,u){if(s=s.updateQueue,s!==null&&(s=s.shared,(u&4194048)!==0)){var p=s.lanes;p&=i.pendingLanes,u|=p,s.lanes=u,qu(i,u)}}function jh(i,s){var u=i.updateQueue,p=i.alternate;if(p!==null&&(p=p.updateQueue,u===p)){var y=null,x=null;if(u=u.firstBaseUpdate,u!==null){do{var A={lane:u.lane,tag:u.tag,payload:u.payload,callback:null,next:null};x===null?y=x=A:x=x.next=A,u=u.next}while(u!==null);x===null?y=x=s:x=x.next=s}else y=x=s;u={baseState:p.baseState,firstBaseUpdate:y,lastBaseUpdate:x,shared:p.shared,callbacks:p.callbacks},i.updateQueue=u;return}i=u.lastBaseUpdate,i===null?u.firstBaseUpdate=s:i.next=s,u.lastBaseUpdate=s}var Rh=!1;function ll(){if(Rh){var i=Is;if(i!==null)throw i}}function ul(i,s,u,p){Rh=!1;var y=i.updateQueue;Wi=!1;var x=y.firstBaseUpdate,A=y.lastBaseUpdate,O=y.shared.pending;if(O!==null){y.shared.pending=null;var F=O,re=F.next;F.next=null,A===null?x=re:A.next=re,A=F;var de=i.alternate;de!==null&&(de=de.updateQueue,O=de.lastBaseUpdate,O!==A&&(O===null?de.firstBaseUpdate=re:O.next=re,de.lastBaseUpdate=F))}if(x!==null){var pe=y.baseState;A=0,de=re=F=null,O=x;do{var ie=O.lane&-536870913,oe=ie!==O.lane;if(oe?(et&ie)===ie:(p&ie)===ie){ie!==0&&ie===Ds&&(Rh=!0),de!==null&&(de=de.next={lane:0,tag:O.tag,payload:O.payload,callback:null,next:null});e:{var ke=i,Ie=O;ie=s;var Et=u;switch(Ie.tag){case 1:if(ke=Ie.payload,typeof ke=="function"){pe=ke.call(Et,pe,ie);break e}pe=ke;break e;case 3:ke.flags=ke.flags&-65537|128;case 0:if(ke=Ie.payload,ie=typeof ke=="function"?ke.call(Et,pe,ie):ke,ie==null)break e;pe=g({},pe,ie);break e;case 2:Wi=!0}}ie=O.callback,ie!==null&&(i.flags|=64,oe&&(i.flags|=8192),oe=y.callbacks,oe===null?y.callbacks=[ie]:oe.push(ie))}else oe={lane:ie,tag:O.tag,payload:O.payload,callback:O.callback,next:null},de===null?(re=de=oe,F=pe):de=de.next=oe,A|=ie;if(O=O.next,O===null){if(O=y.shared.pending,O===null)break;oe=O,O=oe.next,oe.next=null,y.lastBaseUpdate=oe,y.shared.pending=null}}while(!0);de===null&&(F=pe),y.baseState=F,y.firstBaseUpdate=re,y.lastBaseUpdate=de,x===null&&(y.shared.lanes=0),na|=A,i.lanes=A,i.memoizedState=pe}}function db(i,s){if(typeof i!="function")throw Error(r(191,i));i.call(s)}function fb(i,s){var u=i.callbacks;if(u!==null)for(i.callbacks=null,i=0;i<u.length;i++)db(u[i],s)}var zs=z(null),pc=z(0);function hb(i,s){i=Mi,I(pc,i),I(zs,s),Mi=i|s.baseLanes}function _h(){I(pc,Mi),I(zs,zs.current)}function Oh(){Mi=pc.current,W(zs),W(pc)}var Zn=z(null),yr=null;function Ji(i){var s=i.alternate;I(Xt,Xt.current&1),I(Zn,i),yr===null&&(s===null||zs.current!==null||s.memoizedState!==null)&&(yr=i)}function Mh(i){I(Xt,Xt.current),I(Zn,i),yr===null&&(yr=i)}function pb(i){i.tag===22?(I(Xt,Xt.current),I(Zn,i),yr===null&&(yr=i)):Zi()}function Zi(){I(Xt,Xt.current),I(Zn,Zn.current)}function er(i){W(Zn),yr===i&&(yr=null),W(Xt)}var Xt=z(0);function mc(i){for(var s=i;s!==null;){if(s.tag===13){var u=s.memoizedState;if(u!==null&&(u=u.dehydrated,u===null||Up(u)||Bp(u)))return s}else if(s.tag===19&&(s.memoizedProps.revealOrder==="forwards"||s.memoizedProps.revealOrder==="backwards"||s.memoizedProps.revealOrder==="unstable_legacy-backwards"||s.memoizedProps.revealOrder==="together")){if((s.flags&128)!==0)return s}else if(s.child!==null){s.child.return=s,s=s.child;continue}if(s===i)break;for(;s.sibling===null;){if(s.return===null||s.return===i)return null;s=s.return}s.sibling.return=s.return,s=s.sibling}return null}var ki=0,Ke=null,St=null,nn=null,gc=!1,Us=!1,Xa=!1,vc=0,cl=0,Bs=null,d_=0;function Ht(){throw Error(r(321))}function Dh(i,s){if(s===null)return!1;for(var u=0;u<s.length&&u<i.length;u++)if(!Qn(i[u],s[u]))return!1;return!0}function Ih(i,s,u,p,y,x){return ki=x,Ke=s,s.memoizedState=null,s.updateQueue=null,s.lanes=0,V.H=i===null||i.memoizedState===null?Qb:Xh,Xa=!1,x=u(p,y),Xa=!1,Us&&(x=gb(s,u,p,y)),mb(i),x}function mb(i){V.H=hl;var s=St!==null&&St.next!==null;if(ki=0,nn=St=Ke=null,gc=!1,cl=0,Bs=null,s)throw Error(r(300));i===null||rn||(i=i.dependencies,i!==null&&oc(i)&&(rn=!0))}function gb(i,s,u,p){Ke=i;var y=0;do{if(Us&&(Bs=null),cl=0,Us=!1,25<=y)throw Error(r(301));if(y+=1,nn=St=null,i.updateQueue!=null){var x=i.updateQueue;x.lastEffect=null,x.events=null,x.stores=null,x.memoCache!=null&&(x.memoCache.index=0)}V.H=Jb,x=s(u,p)}while(Us);return x}function f_(){var i=V.H,s=i.useState()[0];return s=typeof s.then=="function"?dl(s):s,i=i.useState()[0],(St!==null?St.memoizedState:null)!==i&&(Ke.flags|=1024),s}function Ph(){var i=vc!==0;return vc=0,i}function Lh(i,s,u){s.updateQueue=i.updateQueue,s.flags&=-2053,i.lanes&=~u}function zh(i){if(gc){for(i=i.memoizedState;i!==null;){var s=i.queue;s!==null&&(s.pending=null),i=i.next}gc=!1}ki=0,nn=St=Ke=null,Us=!1,cl=vc=0,Bs=null}function Dn(){var i={memoizedState:null,baseState:null,baseQueue:null,queue:null,next:null};return nn===null?Ke.memoizedState=nn=i:nn=nn.next=i,nn}function Qt(){if(St===null){var i=Ke.alternate;i=i!==null?i.memoizedState:null}else i=St.next;var s=nn===null?Ke.memoizedState:nn.next;if(s!==null)nn=s,St=i;else{if(i===null)throw Ke.alternate===null?Error(r(467)):Error(r(310));St=i,i={memoizedState:St.memoizedState,baseState:St.baseState,baseQueue:St.baseQueue,queue:St.queue,next:null},nn===null?Ke.memoizedState=nn=i:nn=nn.next=i}return nn}function yc(){return{lastEffect:null,events:null,stores:null,memoCache:null}}function dl(i){var s=cl;return cl+=1,Bs===null&&(Bs=[]),i=sb(Bs,i,s),s=Ke,(nn===null?s.memoizedState:nn.next)===null&&(s=s.alternate,V.H=s===null||s.memoizedState===null?Qb:Xh),i}function bc(i){if(i!==null&&typeof i=="object"){if(typeof i.then=="function")return dl(i);if(i.$$typeof===k)return vn(i)}throw Error(r(438,String(i)))}function Uh(i){var s=null,u=Ke.updateQueue;if(u!==null&&(s=u.memoCache),s==null){var p=Ke.alternate;p!==null&&(p=p.updateQueue,p!==null&&(p=p.memoCache,p!=null&&(s={data:p.data.map(function(y){return y.slice()}),index:0})))}if(s==null&&(s={data:[],index:0}),u===null&&(u=yc(),Ke.updateQueue=u),u.memoCache=s,u=s.data[s.index],u===void 0)for(u=s.data[s.index]=Array(i),p=0;p<i;p++)u[p]=D;return s.index++,u}function Ci(i,s){return typeof s=="function"?s(i):s}function xc(i){var s=Qt();return Bh(s,St,i)}function Bh(i,s,u){var p=i.queue;if(p===null)throw Error(r(311));p.lastRenderedReducer=u;var y=i.baseQueue,x=p.pending;if(x!==null){if(y!==null){var A=y.next;y.next=x.next,x.next=A}s.baseQueue=y=x,p.pending=null}if(x=i.baseState,y===null)i.memoizedState=x;else{s=y.next;var O=A=null,F=null,re=s,de=!1;do{var pe=re.lane&-536870913;if(pe!==re.lane?(et&pe)===pe:(ki&pe)===pe){var ie=re.revertLane;if(ie===0)F!==null&&(F=F.next={lane:0,revertLane:0,gesture:null,action:re.action,hasEagerState:re.hasEagerState,eagerState:re.eagerState,next:null}),pe===Ds&&(de=!0);else if((ki&ie)===ie){re=re.next,ie===Ds&&(de=!0);continue}else pe={lane:0,revertLane:re.revertLane,gesture:null,action:re.action,hasEagerState:re.hasEagerState,eagerState:re.eagerState,next:null},F===null?(O=F=pe,A=x):F=F.next=pe,Ke.lanes|=ie,na|=ie;pe=re.action,Xa&&u(x,pe),x=re.hasEagerState?re.eagerState:u(x,pe)}else ie={lane:pe,revertLane:re.revertLane,gesture:re.gesture,action:re.action,hasEagerState:re.hasEagerState,eagerState:re.eagerState,next:null},F===null?(O=F=ie,A=x):F=F.next=ie,Ke.lanes|=pe,na|=pe;re=re.next}while(re!==null&&re!==s);if(F===null?A=x:F.next=O,!Qn(x,i.memoizedState)&&(rn=!0,de&&(u=Is,u!==null)))throw u;i.memoizedState=x,i.baseState=A,i.baseQueue=F,p.lastRenderedState=x}return y===null&&(p.lanes=0),[i.memoizedState,p.dispatch]}function Vh(i){var s=Qt(),u=s.queue;if(u===null)throw Error(r(311));u.lastRenderedReducer=i;var p=u.dispatch,y=u.pending,x=s.memoizedState;if(y!==null){u.pending=null;var A=y=y.next;do x=i(x,A.action),A=A.next;while(A!==y);Qn(x,s.memoizedState)||(rn=!0),s.memoizedState=x,s.baseQueue===null&&(s.baseState=x),u.lastRenderedState=x}return[x,p]}function vb(i,s,u){var p=Ke,y=Qt(),x=rt;if(x){if(u===void 0)throw Error(r(407));u=u()}else u=s();var A=!Qn((St||y).memoizedState,u);if(A&&(y.memoizedState=u,rn=!0),y=y.queue,qh(xb.bind(null,p,y,i),[i]),y.getSnapshot!==s||A||nn!==null&&nn.memoizedState.tag&1){if(p.flags|=2048,Vs(9,{destroy:void 0},bb.bind(null,p,y,u,s),null),Ct===null)throw Error(r(349));x||(ki&127)!==0||yb(p,s,u)}return u}function yb(i,s,u){i.flags|=16384,i={getSnapshot:s,value:u},s=Ke.updateQueue,s===null?(s=yc(),Ke.updateQueue=s,s.stores=[i]):(u=s.stores,u===null?s.stores=[i]:u.push(i))}function bb(i,s,u,p){s.value=u,s.getSnapshot=p,Sb(s)&&wb(i)}function xb(i,s,u){return u(function(){Sb(s)&&wb(i)})}function Sb(i){var s=i.getSnapshot;i=i.value;try{var u=s();return!Qn(i,u)}catch{return!0}}function wb(i){var s=Va(i,2);s!==null&&$n(s,i,2)}function Fh(i){var s=Dn();if(typeof i=="function"){var u=i;if(i=u(),Xa){U(!0);try{u()}finally{U(!1)}}}return s.memoizedState=s.baseState=i,s.queue={pending:null,lanes:0,dispatch:null,lastRenderedReducer:Ci,lastRenderedState:i},s}function Eb(i,s,u,p){return i.baseState=u,Bh(i,St,typeof p=="function"?p:Ci)}function h_(i,s,u,p,y){if(Ec(i))throw Error(r(485));if(i=s.action,i!==null){var x={payload:y,action:i,next:null,isTransition:!0,status:"pending",value:null,reason:null,listeners:[],then:function(A){x.listeners.push(A)}};V.T!==null?u(!0):x.isTransition=!1,p(x),u=s.pending,u===null?(x.next=s.pending=x,Tb(s,x)):(x.next=u.next,s.pending=u.next=x)}}function Tb(i,s){var u=s.action,p=s.payload,y=i.state;if(s.isTransition){var x=V.T,A={};V.T=A;try{var O=u(y,p),F=V.S;F!==null&&F(A,O),kb(i,s,O)}catch(re){Hh(i,s,re)}finally{x!==null&&A.types!==null&&(x.types=A.types),V.T=x}}else try{x=u(y,p),kb(i,s,x)}catch(re){Hh(i,s,re)}}function kb(i,s,u){u!==null&&typeof u=="object"&&typeof u.then=="function"?u.then(function(p){Cb(i,s,p)},function(p){return Hh(i,s,p)}):Cb(i,s,u)}function Cb(i,s,u){s.status="fulfilled",s.value=u,Ab(s),i.state=u,s=i.pending,s!==null&&(u=s.next,u===s?i.pending=null:(u=u.next,s.next=u,Tb(i,u)))}function Hh(i,s,u){var p=i.pending;if(i.pending=null,p!==null){p=p.next;do s.status="rejected",s.reason=u,Ab(s),s=s.next;while(s!==p)}i.action=null}function Ab(i){i=i.listeners;for(var s=0;s<i.length;s++)(0,i[s])()}function Nb(i,s){return s}function jb(i,s){if(rt){var u=Ct.formState;if(u!==null){e:{var p=Ke;if(rt){if(Dt){t:{for(var y=Dt,x=vr;y.nodeType!==8;){if(!x){y=null;break t}if(y=br(y.nextSibling),y===null){y=null;break t}}x=y.data,y=x==="F!"||x==="F"?y:null}if(y){Dt=br(y.nextSibling),p=y.data==="F!";break e}}$i(p)}p=!1}p&&(s=u[0])}}return u=Dn(),u.memoizedState=u.baseState=s,p={pending:null,lanes:0,dispatch:null,lastRenderedReducer:Nb,lastRenderedState:s},u.queue=p,u=Yb.bind(null,Ke,p),p.dispatch=u,p=Fh(!1),x=Wh.bind(null,Ke,!1,p.queue),p=Dn(),y={state:s,dispatch:null,action:i,pending:null},p.queue=y,u=h_.bind(null,Ke,y,x,u),y.dispatch=u,p.memoizedState=i,[s,u,!1]}function Rb(i){var s=Qt();return _b(s,St,i)}function _b(i,s,u){if(s=Bh(i,s,Nb)[0],i=xc(Ci)[0],typeof s=="object"&&s!==null&&typeof s.then=="function")try{var p=dl(s)}catch(A){throw A===Ps?cc:A}else p=s;s=Qt();var y=s.queue,x=y.dispatch;return u!==s.memoizedState&&(Ke.flags|=2048,Vs(9,{destroy:void 0},p_.bind(null,y,u),null)),[p,x,i]}function p_(i,s){i.action=s}function Ob(i){var s=Qt(),u=St;if(u!==null)return _b(s,u,i);Qt(),s=s.memoizedState,u=Qt();var p=u.queue.dispatch;return u.memoizedState=i,[s,p,!1]}function Vs(i,s,u,p){return i={tag:i,create:u,deps:p,inst:s,next:null},s=Ke.updateQueue,s===null&&(s=yc(),Ke.updateQueue=s),u=s.lastEffect,u===null?s.lastEffect=i.next=i:(p=u.next,u.next=i,i.next=p,s.lastEffect=i),i}function Mb(){return Qt().memoizedState}function Sc(i,s,u,p){var y=Dn();Ke.flags|=i,y.memoizedState=Vs(1|s,{destroy:void 0},u,p===void 0?null:p)}function wc(i,s,u,p){var y=Qt();p=p===void 0?null:p;var x=y.memoizedState.inst;St!==null&&p!==null&&Dh(p,St.memoizedState.deps)?y.memoizedState=Vs(s,x,u,p):(Ke.flags|=i,y.memoizedState=Vs(1|s,x,u,p))}function Db(i,s){Sc(8390656,8,i,s)}function qh(i,s){wc(2048,8,i,s)}function m_(i){Ke.flags|=4;var s=Ke.updateQueue;if(s===null)s=yc(),Ke.updateQueue=s,s.events=[i];else{var u=s.events;u===null?s.events=[i]:u.push(i)}}function Ib(i){var s=Qt().memoizedState;return m_({ref:s,nextImpl:i}),function(){if((pt&2)!==0)throw Error(r(440));return s.impl.apply(void 0,arguments)}}function Pb(i,s){return wc(4,2,i,s)}function Lb(i,s){return wc(4,4,i,s)}function zb(i,s){if(typeof s=="function"){i=i();var u=s(i);return function(){typeof u=="function"?u():s(null)}}if(s!=null)return i=i(),s.current=i,function(){s.current=null}}function Ub(i,s,u){u=u!=null?u.concat([i]):null,wc(4,4,zb.bind(null,s,i),u)}function Gh(){}function Bb(i,s){var u=Qt();s=s===void 0?null:s;var p=u.memoizedState;return s!==null&&Dh(s,p[1])?p[0]:(u.memoizedState=[i,s],i)}function Vb(i,s){var u=Qt();s=s===void 0?null:s;var p=u.memoizedState;if(s!==null&&Dh(s,p[1]))return p[0];if(p=i(),Xa){U(!0);try{i()}finally{U(!1)}}return u.memoizedState=[p,s],p}function Kh(i,s,u){return u===void 0||(ki&1073741824)!==0&&(et&261930)===0?i.memoizedState=s:(i.memoizedState=u,i=Fx(),Ke.lanes|=i,na|=i,u)}function Fb(i,s,u,p){return Qn(u,s)?u:zs.current!==null?(i=Kh(i,u,p),Qn(i,s)||(rn=!0),i):(ki&42)===0||(ki&1073741824)!==0&&(et&261930)===0?(rn=!0,i.memoizedState=u):(i=Fx(),Ke.lanes|=i,na|=i,s)}function Hb(i,s,u,p,y){var x=X.p;X.p=x!==0&&8>x?x:8;var A=V.T,O={};V.T=O,Wh(i,!1,s,u);try{var F=y(),re=V.S;if(re!==null&&re(O,F),F!==null&&typeof F=="object"&&typeof F.then=="function"){var de=c_(F,p);fl(i,s,de,rr(i))}else fl(i,s,p,rr(i))}catch(pe){fl(i,s,{then:function(){},status:"rejected",reason:pe},rr())}finally{X.p=x,A!==null&&O.types!==null&&(A.types=O.types),V.T=A}}function g_(){}function $h(i,s,u,p){if(i.tag!==5)throw Error(r(476));var y=qb(i).queue;Hb(i,y,s,le,u===null?g_:function(){return Gb(i),u(p)})}function qb(i){var s=i.memoizedState;if(s!==null)return s;s={memoizedState:le,baseState:le,baseQueue:null,queue:{pending:null,lanes:0,dispatch:null,lastRenderedReducer:Ci,lastRenderedState:le},next:null};var u={};return s.next={memoizedState:u,baseState:u,baseQueue:null,queue:{pending:null,lanes:0,dispatch:null,lastRenderedReducer:Ci,lastRenderedState:u},next:null},i.memoizedState=s,i=i.alternate,i!==null&&(i.memoizedState=s),s}function Gb(i){var s=qb(i);s.next===null&&(s=i.alternate.memoizedState),fl(i,s.next.queue,{},rr())}function Yh(){return vn(jl)}function Kb(){return Qt().memoizedState}function $b(){return Qt().memoizedState}function v_(i){for(var s=i.return;s!==null;){switch(s.tag){case 24:case 3:var u=rr();i=Xi(u);var p=Qi(s,i,u);p!==null&&($n(p,s,u),ol(p,s,u)),s={cache:Eh()},i.payload=s;return}s=s.return}}function y_(i,s,u){var p=rr();u={lane:p,revertLane:0,gesture:null,action:u,hasEagerState:!1,eagerState:null,next:null},Ec(i)?Wb(s,u):(u=fh(i,s,u,p),u!==null&&($n(u,i,p),Xb(u,s,p)))}function Yb(i,s,u){var p=rr();fl(i,s,u,p)}function fl(i,s,u,p){var y={lane:p,revertLane:0,gesture:null,action:u,hasEagerState:!1,eagerState:null,next:null};if(Ec(i))Wb(s,y);else{var x=i.alternate;if(i.lanes===0&&(x===null||x.lanes===0)&&(x=s.lastRenderedReducer,x!==null))try{var A=s.lastRenderedState,O=x(A,u);if(y.hasEagerState=!0,y.eagerState=O,Qn(O,A))return rc(i,s,y,0),Ct===null&&nc(),!1}catch{}if(u=fh(i,s,y,p),u!==null)return $n(u,i,p),Xb(u,s,p),!0}return!1}function Wh(i,s,u,p){if(p={lane:2,revertLane:Ap(),gesture:null,action:p,hasEagerState:!1,eagerState:null,next:null},Ec(i)){if(s)throw Error(r(479))}else s=fh(i,u,p,2),s!==null&&$n(s,i,2)}function Ec(i){var s=i.alternate;return i===Ke||s!==null&&s===Ke}function Wb(i,s){Us=gc=!0;var u=i.pending;u===null?s.next=s:(s.next=u.next,u.next=s),i.pending=s}function Xb(i,s,u){if((u&4194048)!==0){var p=s.lanes;p&=i.pendingLanes,u|=p,s.lanes=u,qu(i,u)}}var hl={readContext:vn,use:bc,useCallback:Ht,useContext:Ht,useEffect:Ht,useImperativeHandle:Ht,useLayoutEffect:Ht,useInsertionEffect:Ht,useMemo:Ht,useReducer:Ht,useRef:Ht,useState:Ht,useDebugValue:Ht,useDeferredValue:Ht,useTransition:Ht,useSyncExternalStore:Ht,useId:Ht,useHostTransitionStatus:Ht,useFormState:Ht,useActionState:Ht,useOptimistic:Ht,useMemoCache:Ht,useCacheRefresh:Ht};hl.useEffectEvent=Ht;var Qb={readContext:vn,use:bc,useCallback:function(i,s){return Dn().memoizedState=[i,s===void 0?null:s],i},useContext:vn,useEffect:Db,useImperativeHandle:function(i,s,u){u=u!=null?u.concat([i]):null,Sc(4194308,4,zb.bind(null,s,i),u)},useLayoutEffect:function(i,s){return Sc(4194308,4,i,s)},useInsertionEffect:function(i,s){Sc(4,2,i,s)},useMemo:function(i,s){var u=Dn();s=s===void 0?null:s;var p=i();if(Xa){U(!0);try{i()}finally{U(!1)}}return u.memoizedState=[p,s],p},useReducer:function(i,s,u){var p=Dn();if(u!==void 0){var y=u(s);if(Xa){U(!0);try{u(s)}finally{U(!1)}}}else y=s;return p.memoizedState=p.baseState=y,i={pending:null,lanes:0,dispatch:null,lastRenderedReducer:i,lastRenderedState:y},p.queue=i,i=i.dispatch=y_.bind(null,Ke,i),[p.memoizedState,i]},useRef:function(i){var s=Dn();return i={current:i},s.memoizedState=i},useState:function(i){i=Fh(i);var s=i.queue,u=Yb.bind(null,Ke,s);return s.dispatch=u,[i.memoizedState,u]},useDebugValue:Gh,useDeferredValue:function(i,s){var u=Dn();return Kh(u,i,s)},useTransition:function(){var i=Fh(!1);return i=Hb.bind(null,Ke,i.queue,!0,!1),Dn().memoizedState=i,[!1,i]},useSyncExternalStore:function(i,s,u){var p=Ke,y=Dn();if(rt){if(u===void 0)throw Error(r(407));u=u()}else{if(u=s(),Ct===null)throw Error(r(349));(et&127)!==0||yb(p,s,u)}y.memoizedState=u;var x={value:u,getSnapshot:s};return y.queue=x,Db(xb.bind(null,p,x,i),[i]),p.flags|=2048,Vs(9,{destroy:void 0},bb.bind(null,p,x,u,s),null),u},useId:function(){var i=Dn(),s=Ct.identifierPrefix;if(rt){var u=Jr,p=Qr;u=(p&~(1<<32-Y(p)-1)).toString(32)+u,s="_"+s+"R_"+u,u=vc++,0<u&&(s+="H"+u.toString(32)),s+="_"}else u=d_++,s="_"+s+"r_"+u.toString(32)+"_";return i.memoizedState=s},useHostTransitionStatus:Yh,useFormState:jb,useActionState:jb,useOptimistic:function(i){var s=Dn();s.memoizedState=s.baseState=i;var u={pending:null,lanes:0,dispatch:null,lastRenderedReducer:null,lastRenderedState:null};return s.queue=u,s=Wh.bind(null,Ke,!0,u),u.dispatch=s,[i,s]},useMemoCache:Uh,useCacheRefresh:function(){return Dn().memoizedState=v_.bind(null,Ke)},useEffectEvent:function(i){var s=Dn(),u={impl:i};return s.memoizedState=u,function(){if((pt&2)!==0)throw Error(r(440));return u.impl.apply(void 0,arguments)}}},Xh={readContext:vn,use:bc,useCallback:Bb,useContext:vn,useEffect:qh,useImperativeHandle:Ub,useInsertionEffect:Pb,useLayoutEffect:Lb,useMemo:Vb,useReducer:xc,useRef:Mb,useState:function(){return xc(Ci)},useDebugValue:Gh,useDeferredValue:function(i,s){var u=Qt();return Fb(u,St.memoizedState,i,s)},useTransition:function(){var i=xc(Ci)[0],s=Qt().memoizedState;return[typeof i=="boolean"?i:dl(i),s]},useSyncExternalStore:vb,useId:Kb,useHostTransitionStatus:Yh,useFormState:Rb,useActionState:Rb,useOptimistic:function(i,s){var u=Qt();return Eb(u,St,i,s)},useMemoCache:Uh,useCacheRefresh:$b};Xh.useEffectEvent=Ib;var Jb={readContext:vn,use:bc,useCallback:Bb,useContext:vn,useEffect:qh,useImperativeHandle:Ub,useInsertionEffect:Pb,useLayoutEffect:Lb,useMemo:Vb,useReducer:Vh,useRef:Mb,useState:function(){return Vh(Ci)},useDebugValue:Gh,useDeferredValue:function(i,s){var u=Qt();return St===null?Kh(u,i,s):Fb(u,St.memoizedState,i,s)},useTransition:function(){var i=Vh(Ci)[0],s=Qt().memoizedState;return[typeof i=="boolean"?i:dl(i),s]},useSyncExternalStore:vb,useId:Kb,useHostTransitionStatus:Yh,useFormState:Ob,useActionState:Ob,useOptimistic:function(i,s){var u=Qt();return St!==null?Eb(u,St,i,s):(u.baseState=i,[i,u.queue.dispatch])},useMemoCache:Uh,useCacheRefresh:$b};Jb.useEffectEvent=Ib;function Qh(i,s,u,p){s=i.memoizedState,u=u(p,s),u=u==null?s:g({},s,u),i.memoizedState=u,i.lanes===0&&(i.updateQueue.baseState=u)}var Jh={enqueueSetState:function(i,s,u){i=i._reactInternals;var p=rr(),y=Xi(p);y.payload=s,u!=null&&(y.callback=u),s=Qi(i,y,p),s!==null&&($n(s,i,p),ol(s,i,p))},enqueueReplaceState:function(i,s,u){i=i._reactInternals;var p=rr(),y=Xi(p);y.tag=1,y.payload=s,u!=null&&(y.callback=u),s=Qi(i,y,p),s!==null&&($n(s,i,p),ol(s,i,p))},enqueueForceUpdate:function(i,s){i=i._reactInternals;var u=rr(),p=Xi(u);p.tag=2,s!=null&&(p.callback=s),s=Qi(i,p,u),s!==null&&($n(s,i,u),ol(s,i,u))}};function Zb(i,s,u,p,y,x,A){return i=i.stateNode,typeof i.shouldComponentUpdate=="function"?i.shouldComponentUpdate(p,x,A):s.prototype&&s.prototype.isPureReactComponent?!Zo(u,p)||!Zo(y,x):!0}function ex(i,s,u,p){i=s.state,typeof s.componentWillReceiveProps=="function"&&s.componentWillReceiveProps(u,p),typeof s.UNSAFE_componentWillReceiveProps=="function"&&s.UNSAFE_componentWillReceiveProps(u,p),s.state!==i&&Jh.enqueueReplaceState(s,s.state,null)}function Qa(i,s){var u=s;if("ref"in s){u={};for(var p in s)p!=="ref"&&(u[p]=s[p])}if(i=i.defaultProps){u===s&&(u=g({},u));for(var y in i)u[y]===void 0&&(u[y]=i[y])}return u}function tx(i){tc(i)}function nx(i){console.error(i)}function rx(i){tc(i)}function Tc(i,s){try{var u=i.onUncaughtError;u(s.value,{componentStack:s.stack})}catch(p){setTimeout(function(){throw p})}}function ix(i,s,u){try{var p=i.onCaughtError;p(u.value,{componentStack:u.stack,errorBoundary:s.tag===1?s.stateNode:null})}catch(y){setTimeout(function(){throw y})}}function Zh(i,s,u){return u=Xi(u),u.tag=3,u.payload={element:null},u.callback=function(){Tc(i,s)},u}function ax(i){return i=Xi(i),i.tag=3,i}function sx(i,s,u,p){var y=u.type.getDerivedStateFromError;if(typeof y=="function"){var x=p.value;i.payload=function(){return y(x)},i.callback=function(){ix(s,u,p)}}var A=u.stateNode;A!==null&&typeof A.componentDidCatch=="function"&&(i.callback=function(){ix(s,u,p),typeof y!="function"&&(ra===null?ra=new Set([this]):ra.add(this));var O=p.stack;this.componentDidCatch(p.value,{componentStack:O!==null?O:""})})}function b_(i,s,u,p,y){if(u.flags|=32768,p!==null&&typeof p=="object"&&typeof p.then=="function"){if(s=u.alternate,s!==null&&Ms(s,u,y,!0),u=Zn.current,u!==null){switch(u.tag){case 31:case 13:return yr===null?Pc():u.alternate===null&&qt===0&&(qt=3),u.flags&=-257,u.flags|=65536,u.lanes=y,p===dc?u.flags|=16384:(s=u.updateQueue,s===null?u.updateQueue=new Set([p]):s.add(p),Tp(i,p,y)),!1;case 22:return u.flags|=65536,p===dc?u.flags|=16384:(s=u.updateQueue,s===null?(s={transitions:null,markerInstances:null,retryQueue:new Set([p])},u.updateQueue=s):(u=s.retryQueue,u===null?s.retryQueue=new Set([p]):u.add(p)),Tp(i,p,y)),!1}throw Error(r(435,u.tag))}return Tp(i,p,y),Pc(),!1}if(rt)return s=Zn.current,s!==null?((s.flags&65536)===0&&(s.flags|=256),s.flags|=65536,s.lanes=y,p!==yh&&(i=Error(r(422),{cause:p}),nl(pr(i,u)))):(p!==yh&&(s=Error(r(423),{cause:p}),nl(pr(s,u))),i=i.current.alternate,i.flags|=65536,y&=-y,i.lanes|=y,p=pr(p,u),y=Zh(i.stateNode,p,y),jh(i,y),qt!==4&&(qt=2)),!1;var x=Error(r(520),{cause:p});if(x=pr(x,u),Sl===null?Sl=[x]:Sl.push(x),qt!==4&&(qt=2),s===null)return!0;p=pr(p,u),u=s;do{switch(u.tag){case 3:return u.flags|=65536,i=y&-y,u.lanes|=i,i=Zh(u.stateNode,p,i),jh(u,i),!1;case 1:if(s=u.type,x=u.stateNode,(u.flags&128)===0&&(typeof s.getDerivedStateFromError=="function"||x!==null&&typeof x.componentDidCatch=="function"&&(ra===null||!ra.has(x))))return u.flags|=65536,y&=-y,u.lanes|=y,y=ax(y),sx(y,i,u,p),jh(u,y),!1}u=u.return}while(u!==null);return!1}var ep=Error(r(461)),rn=!1;function yn(i,s,u,p){s.child=i===null?cb(s,null,u,p):Wa(s,i.child,u,p)}function ox(i,s,u,p,y){u=u.render;var x=s.ref;if("ref"in p){var A={};for(var O in p)O!=="ref"&&(A[O]=p[O])}else A=p;return Ga(s),p=Ih(i,s,u,A,x,y),O=Ph(),i!==null&&!rn?(Lh(i,s,y),Ai(i,s,y)):(rt&&O&&gh(s),s.flags|=1,yn(i,s,p,y),s.child)}function lx(i,s,u,p,y){if(i===null){var x=u.type;return typeof x=="function"&&!hh(x)&&x.defaultProps===void 0&&u.compare===null?(s.tag=15,s.type=x,ux(i,s,x,p,y)):(i=ac(u.type,null,p,s,s.mode,y),i.ref=s.ref,i.return=s,s.child=i)}if(x=i.child,!lp(i,y)){var A=x.memoizedProps;if(u=u.compare,u=u!==null?u:Zo,u(A,p)&&i.ref===s.ref)return Ai(i,s,y)}return s.flags|=1,i=Si(x,p),i.ref=s.ref,i.return=s,s.child=i}function ux(i,s,u,p,y){if(i!==null){var x=i.memoizedProps;if(Zo(x,p)&&i.ref===s.ref)if(rn=!1,s.pendingProps=p=x,lp(i,y))(i.flags&131072)!==0&&(rn=!0);else return s.lanes=i.lanes,Ai(i,s,y)}return tp(i,s,u,p,y)}function cx(i,s,u,p){var y=p.children,x=i!==null?i.memoizedState:null;if(i===null&&s.stateNode===null&&(s.stateNode={_visibility:1,_pendingMarkers:null,_retryCache:null,_transitions:null}),p.mode==="hidden"){if((s.flags&128)!==0){if(x=x!==null?x.baseLanes|u:u,i!==null){for(p=s.child=i.child,y=0;p!==null;)y=y|p.lanes|p.childLanes,p=p.sibling;p=y&~x}else p=0,s.child=null;return dx(i,s,x,u,p)}if((u&536870912)!==0)s.memoizedState={baseLanes:0,cachePool:null},i!==null&&uc(s,x!==null?x.cachePool:null),x!==null?hb(s,x):_h(),pb(s);else return p=s.lanes=536870912,dx(i,s,x!==null?x.baseLanes|u:u,u,p)}else x!==null?(uc(s,x.cachePool),hb(s,x),Zi(),s.memoizedState=null):(i!==null&&uc(s,null),_h(),Zi());return yn(i,s,y,u),s.child}function pl(i,s){return i!==null&&i.tag===22||s.stateNode!==null||(s.stateNode={_visibility:1,_pendingMarkers:null,_retryCache:null,_transitions:null}),s.sibling}function dx(i,s,u,p,y){var x=kh();return x=x===null?null:{parent:tn._currentValue,pool:x},s.memoizedState={baseLanes:u,cachePool:x},i!==null&&uc(s,null),_h(),pb(s),i!==null&&Ms(i,s,p,!0),s.childLanes=y,null}function kc(i,s){return s=Ac({mode:s.mode,children:s.children},i.mode),s.ref=i.ref,i.child=s,s.return=i,s}function fx(i,s,u){return Wa(s,i.child,null,u),i=kc(s,s.pendingProps),i.flags|=2,er(s),s.memoizedState=null,i}function x_(i,s,u){var p=s.pendingProps,y=(s.flags&128)!==0;if(s.flags&=-129,i===null){if(rt){if(p.mode==="hidden")return i=kc(s,p),s.lanes=536870912,pl(null,i);if(Mh(s),(i=Dt)?(i=TS(i,vr),i=i!==null&&i.data==="&"?i:null,i!==null&&(s.memoizedState={dehydrated:i,treeContext:Gi!==null?{id:Qr,overflow:Jr}:null,retryLane:536870912,hydrationErrors:null},u=W0(i),u.return=s,s.child=u,gn=s,Dt=null)):i=null,i===null)throw $i(s);return s.lanes=536870912,null}return kc(s,p)}var x=i.memoizedState;if(x!==null){var A=x.dehydrated;if(Mh(s),y)if(s.flags&256)s.flags&=-257,s=fx(i,s,u);else if(s.memoizedState!==null)s.child=i.child,s.flags|=128,s=null;else throw Error(r(558));else if(rn||Ms(i,s,u,!1),y=(u&i.childLanes)!==0,rn||y){if(p=Ct,p!==null&&(A=Gu(p,u),A!==0&&A!==x.retryLane))throw x.retryLane=A,Va(i,A),$n(p,i,A),ep;Pc(),s=fx(i,s,u)}else i=x.treeContext,Dt=br(A.nextSibling),gn=s,rt=!0,Ki=null,vr=!1,i!==null&&J0(s,i),s=kc(s,p),s.flags|=4096;return s}return i=Si(i.child,{mode:p.mode,children:p.children}),i.ref=s.ref,s.child=i,i.return=s,i}function Cc(i,s){var u=s.ref;if(u===null)i!==null&&i.ref!==null&&(s.flags|=4194816);else{if(typeof u!="function"&&typeof u!="object")throw Error(r(284));(i===null||i.ref!==u)&&(s.flags|=4194816)}}function tp(i,s,u,p,y){return Ga(s),u=Ih(i,s,u,p,void 0,y),p=Ph(),i!==null&&!rn?(Lh(i,s,y),Ai(i,s,y)):(rt&&p&&gh(s),s.flags|=1,yn(i,s,u,y),s.child)}function hx(i,s,u,p,y,x){return Ga(s),s.updateQueue=null,u=gb(s,p,u,y),mb(i),p=Ph(),i!==null&&!rn?(Lh(i,s,x),Ai(i,s,x)):(rt&&p&&gh(s),s.flags|=1,yn(i,s,u,x),s.child)}function px(i,s,u,p,y){if(Ga(s),s.stateNode===null){var x=js,A=u.contextType;typeof A=="object"&&A!==null&&(x=vn(A)),x=new u(p,x),s.memoizedState=x.state!==null&&x.state!==void 0?x.state:null,x.updater=Jh,s.stateNode=x,x._reactInternals=s,x=s.stateNode,x.props=p,x.state=s.memoizedState,x.refs={},Ah(s),A=u.contextType,x.context=typeof A=="object"&&A!==null?vn(A):js,x.state=s.memoizedState,A=u.getDerivedStateFromProps,typeof A=="function"&&(Qh(s,u,A,p),x.state=s.memoizedState),typeof u.getDerivedStateFromProps=="function"||typeof x.getSnapshotBeforeUpdate=="function"||typeof x.UNSAFE_componentWillMount!="function"&&typeof x.componentWillMount!="function"||(A=x.state,typeof x.componentWillMount=="function"&&x.componentWillMount(),typeof x.UNSAFE_componentWillMount=="function"&&x.UNSAFE_componentWillMount(),A!==x.state&&Jh.enqueueReplaceState(x,x.state,null),ul(s,p,x,y),ll(),x.state=s.memoizedState),typeof x.componentDidMount=="function"&&(s.flags|=4194308),p=!0}else if(i===null){x=s.stateNode;var O=s.memoizedProps,F=Qa(u,O);x.props=F;var re=x.context,de=u.contextType;A=js,typeof de=="object"&&de!==null&&(A=vn(de));var pe=u.getDerivedStateFromProps;de=typeof pe=="function"||typeof x.getSnapshotBeforeUpdate=="function",O=s.pendingProps!==O,de||typeof x.UNSAFE_componentWillReceiveProps!="function"&&typeof x.componentWillReceiveProps!="function"||(O||re!==A)&&ex(s,x,p,A),Wi=!1;var ie=s.memoizedState;x.state=ie,ul(s,p,x,y),ll(),re=s.memoizedState,O||ie!==re||Wi?(typeof pe=="function"&&(Qh(s,u,pe,p),re=s.memoizedState),(F=Wi||Zb(s,u,F,p,ie,re,A))?(de||typeof x.UNSAFE_componentWillMount!="function"&&typeof x.componentWillMount!="function"||(typeof x.componentWillMount=="function"&&x.componentWillMount(),typeof x.UNSAFE_componentWillMount=="function"&&x.UNSAFE_componentWillMount()),typeof x.componentDidMount=="function"&&(s.flags|=4194308)):(typeof x.componentDidMount=="function"&&(s.flags|=4194308),s.memoizedProps=p,s.memoizedState=re),x.props=p,x.state=re,x.context=A,p=F):(typeof x.componentDidMount=="function"&&(s.flags|=4194308),p=!1)}else{x=s.stateNode,Nh(i,s),A=s.memoizedProps,de=Qa(u,A),x.props=de,pe=s.pendingProps,ie=x.context,re=u.contextType,F=js,typeof re=="object"&&re!==null&&(F=vn(re)),O=u.getDerivedStateFromProps,(re=typeof O=="function"||typeof x.getSnapshotBeforeUpdate=="function")||typeof x.UNSAFE_componentWillReceiveProps!="function"&&typeof x.componentWillReceiveProps!="function"||(A!==pe||ie!==F)&&ex(s,x,p,F),Wi=!1,ie=s.memoizedState,x.state=ie,ul(s,p,x,y),ll();var oe=s.memoizedState;A!==pe||ie!==oe||Wi||i!==null&&i.dependencies!==null&&oc(i.dependencies)?(typeof O=="function"&&(Qh(s,u,O,p),oe=s.memoizedState),(de=Wi||Zb(s,u,de,p,ie,oe,F)||i!==null&&i.dependencies!==null&&oc(i.dependencies))?(re||typeof x.UNSAFE_componentWillUpdate!="function"&&typeof x.componentWillUpdate!="function"||(typeof x.componentWillUpdate=="function"&&x.componentWillUpdate(p,oe,F),typeof x.UNSAFE_componentWillUpdate=="function"&&x.UNSAFE_componentWillUpdate(p,oe,F)),typeof x.componentDidUpdate=="function"&&(s.flags|=4),typeof x.getSnapshotBeforeUpdate=="function"&&(s.flags|=1024)):(typeof x.componentDidUpdate!="function"||A===i.memoizedProps&&ie===i.memoizedState||(s.flags|=4),typeof x.getSnapshotBeforeUpdate!="function"||A===i.memoizedProps&&ie===i.memoizedState||(s.flags|=1024),s.memoizedProps=p,s.memoizedState=oe),x.props=p,x.state=oe,x.context=F,p=de):(typeof x.componentDidUpdate!="function"||A===i.memoizedProps&&ie===i.memoizedState||(s.flags|=4),typeof x.getSnapshotBeforeUpdate!="function"||A===i.memoizedProps&&ie===i.memoizedState||(s.flags|=1024),p=!1)}return x=p,Cc(i,s),p=(s.flags&128)!==0,x||p?(x=s.stateNode,u=p&&typeof u.getDerivedStateFromError!="function"?null:x.render(),s.flags|=1,i!==null&&p?(s.child=Wa(s,i.child,null,y),s.child=Wa(s,null,u,y)):yn(i,s,u,y),s.memoizedState=x.state,i=s.child):i=Ai(i,s,y),i}function mx(i,s,u,p){return Ha(),s.flags|=256,yn(i,s,u,p),s.child}var np={dehydrated:null,treeContext:null,retryLane:0,hydrationErrors:null};function rp(i){return{baseLanes:i,cachePool:ib()}}function ip(i,s,u){return i=i!==null?i.childLanes&~u:0,s&&(i|=nr),i}function gx(i,s,u){var p=s.pendingProps,y=!1,x=(s.flags&128)!==0,A;if((A=x)||(A=i!==null&&i.memoizedState===null?!1:(Xt.current&2)!==0),A&&(y=!0,s.flags&=-129),A=(s.flags&32)!==0,s.flags&=-33,i===null){if(rt){if(y?Ji(s):Zi(),(i=Dt)?(i=TS(i,vr),i=i!==null&&i.data!=="&"?i:null,i!==null&&(s.memoizedState={dehydrated:i,treeContext:Gi!==null?{id:Qr,overflow:Jr}:null,retryLane:536870912,hydrationErrors:null},u=W0(i),u.return=s,s.child=u,gn=s,Dt=null)):i=null,i===null)throw $i(s);return Bp(i)?s.lanes=32:s.lanes=536870912,null}var O=p.children;return p=p.fallback,y?(Zi(),y=s.mode,O=Ac({mode:"hidden",children:O},y),p=Fa(p,y,u,null),O.return=s,p.return=s,O.sibling=p,s.child=O,p=s.child,p.memoizedState=rp(u),p.childLanes=ip(i,A,u),s.memoizedState=np,pl(null,p)):(Ji(s),ap(s,O))}var F=i.memoizedState;if(F!==null&&(O=F.dehydrated,O!==null)){if(x)s.flags&256?(Ji(s),s.flags&=-257,s=sp(i,s,u)):s.memoizedState!==null?(Zi(),s.child=i.child,s.flags|=128,s=null):(Zi(),O=p.fallback,y=s.mode,p=Ac({mode:"visible",children:p.children},y),O=Fa(O,y,u,null),O.flags|=2,p.return=s,O.return=s,p.sibling=O,s.child=p,Wa(s,i.child,null,u),p=s.child,p.memoizedState=rp(u),p.childLanes=ip(i,A,u),s.memoizedState=np,s=pl(null,p));else if(Ji(s),Bp(O)){if(A=O.nextSibling&&O.nextSibling.dataset,A)var re=A.dgst;A=re,p=Error(r(419)),p.stack="",p.digest=A,nl({value:p,source:null,stack:null}),s=sp(i,s,u)}else if(rn||Ms(i,s,u,!1),A=(u&i.childLanes)!==0,rn||A){if(A=Ct,A!==null&&(p=Gu(A,u),p!==0&&p!==F.retryLane))throw F.retryLane=p,Va(i,p),$n(A,i,p),ep;Up(O)||Pc(),s=sp(i,s,u)}else Up(O)?(s.flags|=192,s.child=i.child,s=null):(i=F.treeContext,Dt=br(O.nextSibling),gn=s,rt=!0,Ki=null,vr=!1,i!==null&&J0(s,i),s=ap(s,p.children),s.flags|=4096);return s}return y?(Zi(),O=p.fallback,y=s.mode,F=i.child,re=F.sibling,p=Si(F,{mode:"hidden",children:p.children}),p.subtreeFlags=F.subtreeFlags&65011712,re!==null?O=Si(re,O):(O=Fa(O,y,u,null),O.flags|=2),O.return=s,p.return=s,p.sibling=O,s.child=p,pl(null,p),p=s.child,O=i.child.memoizedState,O===null?O=rp(u):(y=O.cachePool,y!==null?(F=tn._currentValue,y=y.parent!==F?{parent:F,pool:F}:y):y=ib(),O={baseLanes:O.baseLanes|u,cachePool:y}),p.memoizedState=O,p.childLanes=ip(i,A,u),s.memoizedState=np,pl(i.child,p)):(Ji(s),u=i.child,i=u.sibling,u=Si(u,{mode:"visible",children:p.children}),u.return=s,u.sibling=null,i!==null&&(A=s.deletions,A===null?(s.deletions=[i],s.flags|=16):A.push(i)),s.child=u,s.memoizedState=null,u)}function ap(i,s){return s=Ac({mode:"visible",children:s},i.mode),s.return=i,i.child=s}function Ac(i,s){return i=Jn(22,i,null,s),i.lanes=0,i}function sp(i,s,u){return Wa(s,i.child,null,u),i=ap(s,s.pendingProps.children),i.flags|=2,s.memoizedState=null,i}function vx(i,s,u){i.lanes|=s;var p=i.alternate;p!==null&&(p.lanes|=s),Sh(i.return,s,u)}function op(i,s,u,p,y,x){var A=i.memoizedState;A===null?i.memoizedState={isBackwards:s,rendering:null,renderingStartTime:0,last:p,tail:u,tailMode:y,treeForkCount:x}:(A.isBackwards=s,A.rendering=null,A.renderingStartTime=0,A.last=p,A.tail=u,A.tailMode=y,A.treeForkCount=x)}function yx(i,s,u){var p=s.pendingProps,y=p.revealOrder,x=p.tail;p=p.children;var A=Xt.current,O=(A&2)!==0;if(O?(A=A&1|2,s.flags|=128):A&=1,I(Xt,A),yn(i,s,p,u),p=rt?tl:0,!O&&i!==null&&(i.flags&128)!==0)e:for(i=s.child;i!==null;){if(i.tag===13)i.memoizedState!==null&&vx(i,u,s);else if(i.tag===19)vx(i,u,s);else if(i.child!==null){i.child.return=i,i=i.child;continue}if(i===s)break e;for(;i.sibling===null;){if(i.return===null||i.return===s)break e;i=i.return}i.sibling.return=i.return,i=i.sibling}switch(y){case"forwards":for(u=s.child,y=null;u!==null;)i=u.alternate,i!==null&&mc(i)===null&&(y=u),u=u.sibling;u=y,u===null?(y=s.child,s.child=null):(y=u.sibling,u.sibling=null),op(s,!1,y,u,x,p);break;case"backwards":case"unstable_legacy-backwards":for(u=null,y=s.child,s.child=null;y!==null;){if(i=y.alternate,i!==null&&mc(i)===null){s.child=y;break}i=y.sibling,y.sibling=u,u=y,y=i}op(s,!0,u,null,x,p);break;case"together":op(s,!1,null,null,void 0,p);break;default:s.memoizedState=null}return s.child}function Ai(i,s,u){if(i!==null&&(s.dependencies=i.dependencies),na|=s.lanes,(u&s.childLanes)===0)if(i!==null){if(Ms(i,s,u,!1),(u&s.childLanes)===0)return null}else return null;if(i!==null&&s.child!==i.child)throw Error(r(153));if(s.child!==null){for(i=s.child,u=Si(i,i.pendingProps),s.child=u,u.return=s;i.sibling!==null;)i=i.sibling,u=u.sibling=Si(i,i.pendingProps),u.return=s;u.sibling=null}return s.child}function lp(i,s){return(i.lanes&s)!==0?!0:(i=i.dependencies,!!(i!==null&&oc(i)))}function S_(i,s,u){switch(s.tag){case 3:Pe(s,s.stateNode.containerInfo),Yi(s,tn,i.memoizedState.cache),Ha();break;case 27:case 5:ve(s);break;case 4:Pe(s,s.stateNode.containerInfo);break;case 10:Yi(s,s.type,s.memoizedProps.value);break;case 31:if(s.memoizedState!==null)return s.flags|=128,Mh(s),null;break;case 13:var p=s.memoizedState;if(p!==null)return p.dehydrated!==null?(Ji(s),s.flags|=128,null):(u&s.child.childLanes)!==0?gx(i,s,u):(Ji(s),i=Ai(i,s,u),i!==null?i.sibling:null);Ji(s);break;case 19:var y=(i.flags&128)!==0;if(p=(u&s.childLanes)!==0,p||(Ms(i,s,u,!1),p=(u&s.childLanes)!==0),y){if(p)return yx(i,s,u);s.flags|=128}if(y=s.memoizedState,y!==null&&(y.rendering=null,y.tail=null,y.lastEffect=null),I(Xt,Xt.current),p)break;return null;case 22:return s.lanes=0,cx(i,s,u,s.pendingProps);case 24:Yi(s,tn,i.memoizedState.cache)}return Ai(i,s,u)}function bx(i,s,u){if(i!==null)if(i.memoizedProps!==s.pendingProps)rn=!0;else{if(!lp(i,u)&&(s.flags&128)===0)return rn=!1,S_(i,s,u);rn=(i.flags&131072)!==0}else rn=!1,rt&&(s.flags&1048576)!==0&&Q0(s,tl,s.index);switch(s.lanes=0,s.tag){case 16:e:{var p=s.pendingProps;if(i=$a(s.elementType),s.type=i,typeof i=="function")hh(i)?(p=Qa(i,p),s.tag=1,s=px(null,s,i,p,u)):(s.tag=0,s=tp(null,s,i,p,u));else{if(i!=null){var y=i.$$typeof;if(y===j){s.tag=11,s=ox(null,s,i,p,u);break e}else if(y===P){s.tag=14,s=lx(null,s,i,p,u);break e}}throw s=ue(i)||i,Error(r(306,s,""))}}return s;case 0:return tp(i,s,s.type,s.pendingProps,u);case 1:return p=s.type,y=Qa(p,s.pendingProps),px(i,s,p,y,u);case 3:e:{if(Pe(s,s.stateNode.containerInfo),i===null)throw Error(r(387));p=s.pendingProps;var x=s.memoizedState;y=x.element,Nh(i,s),ul(s,p,null,u);var A=s.memoizedState;if(p=A.cache,Yi(s,tn,p),p!==x.cache&&wh(s,[tn],u,!0),ll(),p=A.element,x.isDehydrated)if(x={element:p,isDehydrated:!1,cache:A.cache},s.updateQueue.baseState=x,s.memoizedState=x,s.flags&256){s=mx(i,s,p,u);break e}else if(p!==y){y=pr(Error(r(424)),s),nl(y),s=mx(i,s,p,u);break e}else for(i=s.stateNode.containerInfo,i.nodeType===9?i=i.body:i=i.nodeName==="HTML"?i.ownerDocument.body:i,Dt=br(i.firstChild),gn=s,rt=!0,Ki=null,vr=!0,u=cb(s,null,p,u),s.child=u;u;)u.flags=u.flags&-3|4096,u=u.sibling;else{if(Ha(),p===y){s=Ai(i,s,u);break e}yn(i,s,p,u)}s=s.child}return s;case 26:return Cc(i,s),i===null?(u=RS(s.type,null,s.pendingProps,null))?s.memoizedState=u:rt||(u=s.type,i=s.pendingProps,p=Hc(Se.current).createElement(u),p[un]=s,p[$]=i,bn(p,u,i),Fe(p),s.stateNode=p):s.memoizedState=RS(s.type,i.memoizedProps,s.pendingProps,i.memoizedState),null;case 27:return ve(s),i===null&&rt&&(p=s.stateNode=AS(s.type,s.pendingProps,Se.current),gn=s,vr=!0,y=Dt,oa(s.type)?(Vp=y,Dt=br(p.firstChild)):Dt=y),yn(i,s,s.pendingProps.children,u),Cc(i,s),i===null&&(s.flags|=4194304),s.child;case 5:return i===null&&rt&&((y=p=Dt)&&(p=Q_(p,s.type,s.pendingProps,vr),p!==null?(s.stateNode=p,gn=s,Dt=br(p.firstChild),vr=!1,y=!0):y=!1),y||$i(s)),ve(s),y=s.type,x=s.pendingProps,A=i!==null?i.memoizedProps:null,p=x.children,Pp(y,x)?p=null:A!==null&&Pp(y,A)&&(s.flags|=32),s.memoizedState!==null&&(y=Ih(i,s,f_,null,null,u),jl._currentValue=y),Cc(i,s),yn(i,s,p,u),s.child;case 6:return i===null&&rt&&((i=u=Dt)&&(u=J_(u,s.pendingProps,vr),u!==null?(s.stateNode=u,gn=s,Dt=null,i=!0):i=!1),i||$i(s)),null;case 13:return gx(i,s,u);case 4:return Pe(s,s.stateNode.containerInfo),p=s.pendingProps,i===null?s.child=Wa(s,null,p,u):yn(i,s,p,u),s.child;case 11:return ox(i,s,s.type,s.pendingProps,u);case 7:return yn(i,s,s.pendingProps,u),s.child;case 8:return yn(i,s,s.pendingProps.children,u),s.child;case 12:return yn(i,s,s.pendingProps.children,u),s.child;case 10:return p=s.pendingProps,Yi(s,s.type,p.value),yn(i,s,p.children,u),s.child;case 9:return y=s.type._context,p=s.pendingProps.children,Ga(s),y=vn(y),p=p(y),s.flags|=1,yn(i,s,p,u),s.child;case 14:return lx(i,s,s.type,s.pendingProps,u);case 15:return ux(i,s,s.type,s.pendingProps,u);case 19:return yx(i,s,u);case 31:return x_(i,s,u);case 22:return cx(i,s,u,s.pendingProps);case 24:return Ga(s),p=vn(tn),i===null?(y=kh(),y===null&&(y=Ct,x=Eh(),y.pooledCache=x,x.refCount++,x!==null&&(y.pooledCacheLanes|=u),y=x),s.memoizedState={parent:p,cache:y},Ah(s),Yi(s,tn,y)):((i.lanes&u)!==0&&(Nh(i,s),ul(s,null,null,u),ll()),y=i.memoizedState,x=s.memoizedState,y.parent!==p?(y={parent:p,cache:p},s.memoizedState=y,s.lanes===0&&(s.memoizedState=s.updateQueue.baseState=y),Yi(s,tn,p)):(p=x.cache,Yi(s,tn,p),p!==y.cache&&wh(s,[tn],u,!0))),yn(i,s,s.pendingProps.children,u),s.child;case 29:throw s.pendingProps}throw Error(r(156,s.tag))}function Ni(i){i.flags|=4}function up(i,s,u,p,y){if((s=(i.mode&32)!==0)&&(s=!1),s){if(i.flags|=16777216,(y&335544128)===y)if(i.stateNode.complete)i.flags|=8192;else if(Kx())i.flags|=8192;else throw Ya=dc,Ch}else i.flags&=-16777217}function xx(i,s){if(s.type!=="stylesheet"||(s.state.loading&4)!==0)i.flags&=-16777217;else if(i.flags|=16777216,!IS(s))if(Kx())i.flags|=8192;else throw Ya=dc,Ch}function Nc(i,s){s!==null&&(i.flags|=4),i.flags&16384&&(s=i.tag!==22?Hu():536870912,i.lanes|=s,Gs|=s)}function ml(i,s){if(!rt)switch(i.tailMode){case"hidden":s=i.tail;for(var u=null;s!==null;)s.alternate!==null&&(u=s),s=s.sibling;u===null?i.tail=null:u.sibling=null;break;case"collapsed":u=i.tail;for(var p=null;u!==null;)u.alternate!==null&&(p=u),u=u.sibling;p===null?s||i.tail===null?i.tail=null:i.tail.sibling=null:p.sibling=null}}function It(i){var s=i.alternate!==null&&i.alternate.child===i.child,u=0,p=0;if(s)for(var y=i.child;y!==null;)u|=y.lanes|y.childLanes,p|=y.subtreeFlags&65011712,p|=y.flags&65011712,y.return=i,y=y.sibling;else for(y=i.child;y!==null;)u|=y.lanes|y.childLanes,p|=y.subtreeFlags,p|=y.flags,y.return=i,y=y.sibling;return i.subtreeFlags|=p,i.childLanes=u,s}function w_(i,s,u){var p=s.pendingProps;switch(vh(s),s.tag){case 16:case 15:case 0:case 11:case 7:case 8:case 12:case 9:case 14:return It(s),null;case 1:return It(s),null;case 3:return u=s.stateNode,p=null,i!==null&&(p=i.memoizedState.cache),s.memoizedState.cache!==p&&(s.flags|=2048),Ti(tn),je(),u.pendingContext&&(u.context=u.pendingContext,u.pendingContext=null),(i===null||i.child===null)&&(Os(s)?Ni(s):i===null||i.memoizedState.isDehydrated&&(s.flags&256)===0||(s.flags|=1024,bh())),It(s),null;case 26:var y=s.type,x=s.memoizedState;return i===null?(Ni(s),x!==null?(It(s),xx(s,x)):(It(s),up(s,y,null,p,u))):x?x!==i.memoizedState?(Ni(s),It(s),xx(s,x)):(It(s),s.flags&=-16777217):(i=i.memoizedProps,i!==p&&Ni(s),It(s),up(s,y,i,p,u)),null;case 27:if(Le(s),u=Se.current,y=s.type,i!==null&&s.stateNode!=null)i.memoizedProps!==p&&Ni(s);else{if(!p){if(s.stateNode===null)throw Error(r(166));return It(s),null}i=fe.current,Os(s)?Z0(s):(i=AS(y,p,u),s.stateNode=i,Ni(s))}return It(s),null;case 5:if(Le(s),y=s.type,i!==null&&s.stateNode!=null)i.memoizedProps!==p&&Ni(s);else{if(!p){if(s.stateNode===null)throw Error(r(166));return It(s),null}if(x=fe.current,Os(s))Z0(s);else{var A=Hc(Se.current);switch(x){case 1:x=A.createElementNS("http://www.w3.org/2000/svg",y);break;case 2:x=A.createElementNS("http://www.w3.org/1998/Math/MathML",y);break;default:switch(y){case"svg":x=A.createElementNS("http://www.w3.org/2000/svg",y);break;case"math":x=A.createElementNS("http://www.w3.org/1998/Math/MathML",y);break;case"script":x=A.createElement("div"),x.innerHTML="<script><\/script>",x=x.removeChild(x.firstChild);break;case"select":x=typeof p.is=="string"?A.createElement("select",{is:p.is}):A.createElement("select"),p.multiple?x.multiple=!0:p.size&&(x.size=p.size);break;default:x=typeof p.is=="string"?A.createElement(y,{is:p.is}):A.createElement(y)}}x[un]=s,x[$]=p;e:for(A=s.child;A!==null;){if(A.tag===5||A.tag===6)x.appendChild(A.stateNode);else if(A.tag!==4&&A.tag!==27&&A.child!==null){A.child.return=A,A=A.child;continue}if(A===s)break e;for(;A.sibling===null;){if(A.return===null||A.return===s)break e;A=A.return}A.sibling.return=A.return,A=A.sibling}s.stateNode=x;e:switch(bn(x,y,p),y){case"button":case"input":case"select":case"textarea":p=!!p.autoFocus;break e;case"img":p=!0;break e;default:p=!1}p&&Ni(s)}}return It(s),up(s,s.type,i===null?null:i.memoizedProps,s.pendingProps,u),null;case 6:if(i&&s.stateNode!=null)i.memoizedProps!==p&&Ni(s);else{if(typeof p!="string"&&s.stateNode===null)throw Error(r(166));if(i=Se.current,Os(s)){if(i=s.stateNode,u=s.memoizedProps,p=null,y=gn,y!==null)switch(y.tag){case 27:case 5:p=y.memoizedProps}i[un]=s,i=!!(i.nodeValue===u||p!==null&&p.suppressHydrationWarning===!0||gS(i.nodeValue,u)),i||$i(s,!0)}else i=Hc(i).createTextNode(p),i[un]=s,s.stateNode=i}return It(s),null;case 31:if(u=s.memoizedState,i===null||i.memoizedState!==null){if(p=Os(s),u!==null){if(i===null){if(!p)throw Error(r(318));if(i=s.memoizedState,i=i!==null?i.dehydrated:null,!i)throw Error(r(557));i[un]=s}else Ha(),(s.flags&128)===0&&(s.memoizedState=null),s.flags|=4;It(s),i=!1}else u=bh(),i!==null&&i.memoizedState!==null&&(i.memoizedState.hydrationErrors=u),i=!0;if(!i)return s.flags&256?(er(s),s):(er(s),null);if((s.flags&128)!==0)throw Error(r(558))}return It(s),null;case 13:if(p=s.memoizedState,i===null||i.memoizedState!==null&&i.memoizedState.dehydrated!==null){if(y=Os(s),p!==null&&p.dehydrated!==null){if(i===null){if(!y)throw Error(r(318));if(y=s.memoizedState,y=y!==null?y.dehydrated:null,!y)throw Error(r(317));y[un]=s}else Ha(),(s.flags&128)===0&&(s.memoizedState=null),s.flags|=4;It(s),y=!1}else y=bh(),i!==null&&i.memoizedState!==null&&(i.memoizedState.hydrationErrors=y),y=!0;if(!y)return s.flags&256?(er(s),s):(er(s),null)}return er(s),(s.flags&128)!==0?(s.lanes=u,s):(u=p!==null,i=i!==null&&i.memoizedState!==null,u&&(p=s.child,y=null,p.alternate!==null&&p.alternate.memoizedState!==null&&p.alternate.memoizedState.cachePool!==null&&(y=p.alternate.memoizedState.cachePool.pool),x=null,p.memoizedState!==null&&p.memoizedState.cachePool!==null&&(x=p.memoizedState.cachePool.pool),x!==y&&(p.flags|=2048)),u!==i&&u&&(s.child.flags|=8192),Nc(s,s.updateQueue),It(s),null);case 4:return je(),i===null&&_p(s.stateNode.containerInfo),It(s),null;case 10:return Ti(s.type),It(s),null;case 19:if(W(Xt),p=s.memoizedState,p===null)return It(s),null;if(y=(s.flags&128)!==0,x=p.rendering,x===null)if(y)ml(p,!1);else{if(qt!==0||i!==null&&(i.flags&128)!==0)for(i=s.child;i!==null;){if(x=mc(i),x!==null){for(s.flags|=128,ml(p,!1),i=x.updateQueue,s.updateQueue=i,Nc(s,i),s.subtreeFlags=0,i=u,u=s.child;u!==null;)Y0(u,i),u=u.sibling;return I(Xt,Xt.current&1|2),rt&&wi(s,p.treeForkCount),s.child}i=i.sibling}p.tail!==null&&Me()>Mc&&(s.flags|=128,y=!0,ml(p,!1),s.lanes=4194304)}else{if(!y)if(i=mc(x),i!==null){if(s.flags|=128,y=!0,i=i.updateQueue,s.updateQueue=i,Nc(s,i),ml(p,!0),p.tail===null&&p.tailMode==="hidden"&&!x.alternate&&!rt)return It(s),null}else 2*Me()-p.renderingStartTime>Mc&&u!==536870912&&(s.flags|=128,y=!0,ml(p,!1),s.lanes=4194304);p.isBackwards?(x.sibling=s.child,s.child=x):(i=p.last,i!==null?i.sibling=x:s.child=x,p.last=x)}return p.tail!==null?(i=p.tail,p.rendering=i,p.tail=i.sibling,p.renderingStartTime=Me(),i.sibling=null,u=Xt.current,I(Xt,y?u&1|2:u&1),rt&&wi(s,p.treeForkCount),i):(It(s),null);case 22:case 23:return er(s),Oh(),p=s.memoizedState!==null,i!==null?i.memoizedState!==null!==p&&(s.flags|=8192):p&&(s.flags|=8192),p?(u&536870912)!==0&&(s.flags&128)===0&&(It(s),s.subtreeFlags&6&&(s.flags|=8192)):It(s),u=s.updateQueue,u!==null&&Nc(s,u.retryQueue),u=null,i!==null&&i.memoizedState!==null&&i.memoizedState.cachePool!==null&&(u=i.memoizedState.cachePool.pool),p=null,s.memoizedState!==null&&s.memoizedState.cachePool!==null&&(p=s.memoizedState.cachePool.pool),p!==u&&(s.flags|=2048),i!==null&&W(Ka),null;case 24:return u=null,i!==null&&(u=i.memoizedState.cache),s.memoizedState.cache!==u&&(s.flags|=2048),Ti(tn),It(s),null;case 25:return null;case 30:return null}throw Error(r(156,s.tag))}function E_(i,s){switch(vh(s),s.tag){case 1:return i=s.flags,i&65536?(s.flags=i&-65537|128,s):null;case 3:return Ti(tn),je(),i=s.flags,(i&65536)!==0&&(i&128)===0?(s.flags=i&-65537|128,s):null;case 26:case 27:case 5:return Le(s),null;case 31:if(s.memoizedState!==null){if(er(s),s.alternate===null)throw Error(r(340));Ha()}return i=s.flags,i&65536?(s.flags=i&-65537|128,s):null;case 13:if(er(s),i=s.memoizedState,i!==null&&i.dehydrated!==null){if(s.alternate===null)throw Error(r(340));Ha()}return i=s.flags,i&65536?(s.flags=i&-65537|128,s):null;case 19:return W(Xt),null;case 4:return je(),null;case 10:return Ti(s.type),null;case 22:case 23:return er(s),Oh(),i!==null&&W(Ka),i=s.flags,i&65536?(s.flags=i&-65537|128,s):null;case 24:return Ti(tn),null;case 25:return null;default:return null}}function Sx(i,s){switch(vh(s),s.tag){case 3:Ti(tn),je();break;case 26:case 27:case 5:Le(s);break;case 4:je();break;case 31:s.memoizedState!==null&&er(s);break;case 13:er(s);break;case 19:W(Xt);break;case 10:Ti(s.type);break;case 22:case 23:er(s),Oh(),i!==null&&W(Ka);break;case 24:Ti(tn)}}function gl(i,s){try{var u=s.updateQueue,p=u!==null?u.lastEffect:null;if(p!==null){var y=p.next;u=y;do{if((u.tag&i)===i){p=void 0;var x=u.create,A=u.inst;p=x(),A.destroy=p}u=u.next}while(u!==y)}}catch(O){bt(s,s.return,O)}}function ea(i,s,u){try{var p=s.updateQueue,y=p!==null?p.lastEffect:null;if(y!==null){var x=y.next;p=x;do{if((p.tag&i)===i){var A=p.inst,O=A.destroy;if(O!==void 0){A.destroy=void 0,y=s;var F=u,re=O;try{re()}catch(de){bt(y,F,de)}}}p=p.next}while(p!==x)}}catch(de){bt(s,s.return,de)}}function wx(i){var s=i.updateQueue;if(s!==null){var u=i.stateNode;try{fb(s,u)}catch(p){bt(i,i.return,p)}}}function Ex(i,s,u){u.props=Qa(i.type,i.memoizedProps),u.state=i.memoizedState;try{u.componentWillUnmount()}catch(p){bt(i,s,p)}}function vl(i,s){try{var u=i.ref;if(u!==null){switch(i.tag){case 26:case 27:case 5:var p=i.stateNode;break;case 30:p=i.stateNode;break;default:p=i.stateNode}typeof u=="function"?i.refCleanup=u(p):u.current=p}}catch(y){bt(i,s,y)}}function Zr(i,s){var u=i.ref,p=i.refCleanup;if(u!==null)if(typeof p=="function")try{p()}catch(y){bt(i,s,y)}finally{i.refCleanup=null,i=i.alternate,i!=null&&(i.refCleanup=null)}else if(typeof u=="function")try{u(null)}catch(y){bt(i,s,y)}else u.current=null}function Tx(i){var s=i.type,u=i.memoizedProps,p=i.stateNode;try{e:switch(s){case"button":case"input":case"select":case"textarea":u.autoFocus&&p.focus();break e;case"img":u.src?p.src=u.src:u.srcSet&&(p.srcset=u.srcSet)}}catch(y){bt(i,i.return,y)}}function cp(i,s,u){try{var p=i.stateNode;G_(p,i.type,u,s),p[$]=s}catch(y){bt(i,i.return,y)}}function kx(i){return i.tag===5||i.tag===3||i.tag===26||i.tag===27&&oa(i.type)||i.tag===4}function dp(i){e:for(;;){for(;i.sibling===null;){if(i.return===null||kx(i.return))return null;i=i.return}for(i.sibling.return=i.return,i=i.sibling;i.tag!==5&&i.tag!==6&&i.tag!==18;){if(i.tag===27&&oa(i.type)||i.flags&2||i.child===null||i.tag===4)continue e;i.child.return=i,i=i.child}if(!(i.flags&2))return i.stateNode}}function fp(i,s,u){var p=i.tag;if(p===5||p===6)i=i.stateNode,s?(u.nodeType===9?u.body:u.nodeName==="HTML"?u.ownerDocument.body:u).insertBefore(i,s):(s=u.nodeType===9?u.body:u.nodeName==="HTML"?u.ownerDocument.body:u,s.appendChild(i),u=u._reactRootContainer,u!=null||s.onclick!==null||(s.onclick=bi));else if(p!==4&&(p===27&&oa(i.type)&&(u=i.stateNode,s=null),i=i.child,i!==null))for(fp(i,s,u),i=i.sibling;i!==null;)fp(i,s,u),i=i.sibling}function jc(i,s,u){var p=i.tag;if(p===5||p===6)i=i.stateNode,s?u.insertBefore(i,s):u.appendChild(i);else if(p!==4&&(p===27&&oa(i.type)&&(u=i.stateNode),i=i.child,i!==null))for(jc(i,s,u),i=i.sibling;i!==null;)jc(i,s,u),i=i.sibling}function Cx(i){var s=i.stateNode,u=i.memoizedProps;try{for(var p=i.type,y=s.attributes;y.length;)s.removeAttributeNode(y[0]);bn(s,p,u),s[un]=i,s[$]=u}catch(x){bt(i,i.return,x)}}var ji=!1,an=!1,hp=!1,Ax=typeof WeakSet=="function"?WeakSet:Set,mn=null;function T_(i,s){if(i=i.containerInfo,Dp=Xc,i=U0(i),sh(i)){if("selectionStart"in i)var u={start:i.selectionStart,end:i.selectionEnd};else e:{u=(u=i.ownerDocument)&&u.defaultView||window;var p=u.getSelection&&u.getSelection();if(p&&p.rangeCount!==0){u=p.anchorNode;var y=p.anchorOffset,x=p.focusNode;p=p.focusOffset;try{u.nodeType,x.nodeType}catch{u=null;break e}var A=0,O=-1,F=-1,re=0,de=0,pe=i,ie=null;t:for(;;){for(var oe;pe!==u||y!==0&&pe.nodeType!==3||(O=A+y),pe!==x||p!==0&&pe.nodeType!==3||(F=A+p),pe.nodeType===3&&(A+=pe.nodeValue.length),(oe=pe.firstChild)!==null;)ie=pe,pe=oe;for(;;){if(pe===i)break t;if(ie===u&&++re===y&&(O=A),ie===x&&++de===p&&(F=A),(oe=pe.nextSibling)!==null)break;pe=ie,ie=pe.parentNode}pe=oe}u=O===-1||F===-1?null:{start:O,end:F}}else u=null}u=u||{start:0,end:0}}else u=null;for(Ip={focusedElem:i,selectionRange:u},Xc=!1,mn=s;mn!==null;)if(s=mn,i=s.child,(s.subtreeFlags&1028)!==0&&i!==null)i.return=s,mn=i;else for(;mn!==null;){switch(s=mn,x=s.alternate,i=s.flags,s.tag){case 0:if((i&4)!==0&&(i=s.updateQueue,i=i!==null?i.events:null,i!==null))for(u=0;u<i.length;u++)y=i[u],y.ref.impl=y.nextImpl;break;case 11:case 15:break;case 1:if((i&1024)!==0&&x!==null){i=void 0,u=s,y=x.memoizedProps,x=x.memoizedState,p=u.stateNode;try{var ke=Qa(u.type,y);i=p.getSnapshotBeforeUpdate(ke,x),p.__reactInternalSnapshotBeforeUpdate=i}catch(Ie){bt(u,u.return,Ie)}}break;case 3:if((i&1024)!==0){if(i=s.stateNode.containerInfo,u=i.nodeType,u===9)zp(i);else if(u===1)switch(i.nodeName){case"HEAD":case"HTML":case"BODY":zp(i);break;default:i.textContent=""}}break;case 5:case 26:case 27:case 6:case 4:case 17:break;default:if((i&1024)!==0)throw Error(r(163))}if(i=s.sibling,i!==null){i.return=s.return,mn=i;break}mn=s.return}}function Nx(i,s,u){var p=u.flags;switch(u.tag){case 0:case 11:case 15:_i(i,u),p&4&&gl(5,u);break;case 1:if(_i(i,u),p&4)if(i=u.stateNode,s===null)try{i.componentDidMount()}catch(A){bt(u,u.return,A)}else{var y=Qa(u.type,s.memoizedProps);s=s.memoizedState;try{i.componentDidUpdate(y,s,i.__reactInternalSnapshotBeforeUpdate)}catch(A){bt(u,u.return,A)}}p&64&&wx(u),p&512&&vl(u,u.return);break;case 3:if(_i(i,u),p&64&&(i=u.updateQueue,i!==null)){if(s=null,u.child!==null)switch(u.child.tag){case 27:case 5:s=u.child.stateNode;break;case 1:s=u.child.stateNode}try{fb(i,s)}catch(A){bt(u,u.return,A)}}break;case 27:s===null&&p&4&&Cx(u);case 26:case 5:_i(i,u),s===null&&p&4&&Tx(u),p&512&&vl(u,u.return);break;case 12:_i(i,u);break;case 31:_i(i,u),p&4&&_x(i,u);break;case 13:_i(i,u),p&4&&Ox(i,u),p&64&&(i=u.memoizedState,i!==null&&(i=i.dehydrated,i!==null&&(u=M_.bind(null,u),Z_(i,u))));break;case 22:if(p=u.memoizedState!==null||ji,!p){s=s!==null&&s.memoizedState!==null||an,y=ji;var x=an;ji=p,(an=s)&&!x?Oi(i,u,(u.subtreeFlags&8772)!==0):_i(i,u),ji=y,an=x}break;case 30:break;default:_i(i,u)}}function jx(i){var s=i.alternate;s!==null&&(i.alternate=null,jx(s)),i.child=null,i.deletions=null,i.sibling=null,i.tag===5&&(s=i.stateNode,s!==null&&cr(s)),i.stateNode=null,i.return=null,i.dependencies=null,i.memoizedProps=null,i.memoizedState=null,i.pendingProps=null,i.stateNode=null,i.updateQueue=null}var zt=null,Hn=!1;function Ri(i,s,u){for(u=u.child;u!==null;)Rx(i,s,u),u=u.sibling}function Rx(i,s,u){if(Lt&&typeof Lt.onCommitFiberUnmount=="function")try{Lt.onCommitFiberUnmount(gt,u)}catch{}switch(u.tag){case 26:an||Zr(u,s),Ri(i,s,u),u.memoizedState?u.memoizedState.count--:u.stateNode&&(u=u.stateNode,u.parentNode.removeChild(u));break;case 27:an||Zr(u,s);var p=zt,y=Hn;oa(u.type)&&(zt=u.stateNode,Hn=!1),Ri(i,s,u),Cl(u.stateNode),zt=p,Hn=y;break;case 5:an||Zr(u,s);case 6:if(p=zt,y=Hn,zt=null,Ri(i,s,u),zt=p,Hn=y,zt!==null)if(Hn)try{(zt.nodeType===9?zt.body:zt.nodeName==="HTML"?zt.ownerDocument.body:zt).removeChild(u.stateNode)}catch(x){bt(u,s,x)}else try{zt.removeChild(u.stateNode)}catch(x){bt(u,s,x)}break;case 18:zt!==null&&(Hn?(i=zt,wS(i.nodeType===9?i.body:i.nodeName==="HTML"?i.ownerDocument.body:i,u.stateNode),Zs(i)):wS(zt,u.stateNode));break;case 4:p=zt,y=Hn,zt=u.stateNode.containerInfo,Hn=!0,Ri(i,s,u),zt=p,Hn=y;break;case 0:case 11:case 14:case 15:ea(2,u,s),an||ea(4,u,s),Ri(i,s,u);break;case 1:an||(Zr(u,s),p=u.stateNode,typeof p.componentWillUnmount=="function"&&Ex(u,s,p)),Ri(i,s,u);break;case 21:Ri(i,s,u);break;case 22:an=(p=an)||u.memoizedState!==null,Ri(i,s,u),an=p;break;default:Ri(i,s,u)}}function _x(i,s){if(s.memoizedState===null&&(i=s.alternate,i!==null&&(i=i.memoizedState,i!==null))){i=i.dehydrated;try{Zs(i)}catch(u){bt(s,s.return,u)}}}function Ox(i,s){if(s.memoizedState===null&&(i=s.alternate,i!==null&&(i=i.memoizedState,i!==null&&(i=i.dehydrated,i!==null))))try{Zs(i)}catch(u){bt(s,s.return,u)}}function k_(i){switch(i.tag){case 31:case 13:case 19:var s=i.stateNode;return s===null&&(s=i.stateNode=new Ax),s;case 22:return i=i.stateNode,s=i._retryCache,s===null&&(s=i._retryCache=new Ax),s;default:throw Error(r(435,i.tag))}}function Rc(i,s){var u=k_(i);s.forEach(function(p){if(!u.has(p)){u.add(p);var y=D_.bind(null,i,p);p.then(y,y)}})}function qn(i,s){var u=s.deletions;if(u!==null)for(var p=0;p<u.length;p++){var y=u[p],x=i,A=s,O=A;e:for(;O!==null;){switch(O.tag){case 27:if(oa(O.type)){zt=O.stateNode,Hn=!1;break e}break;case 5:zt=O.stateNode,Hn=!1;break e;case 3:case 4:zt=O.stateNode.containerInfo,Hn=!0;break e}O=O.return}if(zt===null)throw Error(r(160));Rx(x,A,y),zt=null,Hn=!1,x=y.alternate,x!==null&&(x.return=null),y.return=null}if(s.subtreeFlags&13886)for(s=s.child;s!==null;)Mx(s,i),s=s.sibling}var Pr=null;function Mx(i,s){var u=i.alternate,p=i.flags;switch(i.tag){case 0:case 11:case 14:case 15:qn(s,i),Gn(i),p&4&&(ea(3,i,i.return),gl(3,i),ea(5,i,i.return));break;case 1:qn(s,i),Gn(i),p&512&&(an||u===null||Zr(u,u.return)),p&64&&ji&&(i=i.updateQueue,i!==null&&(p=i.callbacks,p!==null&&(u=i.shared.hiddenCallbacks,i.shared.hiddenCallbacks=u===null?p:u.concat(p))));break;case 26:var y=Pr;if(qn(s,i),Gn(i),p&512&&(an||u===null||Zr(u,u.return)),p&4){var x=u!==null?u.memoizedState:null;if(p=i.memoizedState,u===null)if(p===null)if(i.stateNode===null){e:{p=i.type,u=i.memoizedProps,y=y.ownerDocument||y;t:switch(p){case"title":x=y.getElementsByTagName("title")[0],(!x||x[kn]||x[un]||x.namespaceURI==="http://www.w3.org/2000/svg"||x.hasAttribute("itemprop"))&&(x=y.createElement(p),y.head.insertBefore(x,y.querySelector("head > title"))),bn(x,p,u),x[un]=i,Fe(x),p=x;break e;case"link":var A=MS("link","href",y).get(p+(u.href||""));if(A){for(var O=0;O<A.length;O++)if(x=A[O],x.getAttribute("href")===(u.href==null||u.href===""?null:u.href)&&x.getAttribute("rel")===(u.rel==null?null:u.rel)&&x.getAttribute("title")===(u.title==null?null:u.title)&&x.getAttribute("crossorigin")===(u.crossOrigin==null?null:u.crossOrigin)){A.splice(O,1);break t}}x=y.createElement(p),bn(x,p,u),y.head.appendChild(x);break;case"meta":if(A=MS("meta","content",y).get(p+(u.content||""))){for(O=0;O<A.length;O++)if(x=A[O],x.getAttribute("content")===(u.content==null?null:""+u.content)&&x.getAttribute("name")===(u.name==null?null:u.name)&&x.getAttribute("property")===(u.property==null?null:u.property)&&x.getAttribute("http-equiv")===(u.httpEquiv==null?null:u.httpEquiv)&&x.getAttribute("charset")===(u.charSet==null?null:u.charSet)){A.splice(O,1);break t}}x=y.createElement(p),bn(x,p,u),y.head.appendChild(x);break;default:throw Error(r(468,p))}x[un]=i,Fe(x),p=x}i.stateNode=p}else DS(y,i.type,i.stateNode);else i.stateNode=OS(y,p,i.memoizedProps);else x!==p?(x===null?u.stateNode!==null&&(u=u.stateNode,u.parentNode.removeChild(u)):x.count--,p===null?DS(y,i.type,i.stateNode):OS(y,p,i.memoizedProps)):p===null&&i.stateNode!==null&&cp(i,i.memoizedProps,u.memoizedProps)}break;case 27:qn(s,i),Gn(i),p&512&&(an||u===null||Zr(u,u.return)),u!==null&&p&4&&cp(i,i.memoizedProps,u.memoizedProps);break;case 5:if(qn(s,i),Gn(i),p&512&&(an||u===null||Zr(u,u.return)),i.flags&32){y=i.stateNode;try{ws(y,"")}catch(ke){bt(i,i.return,ke)}}p&4&&i.stateNode!=null&&(y=i.memoizedProps,cp(i,y,u!==null?u.memoizedProps:y)),p&1024&&(hp=!0);break;case 6:if(qn(s,i),Gn(i),p&4){if(i.stateNode===null)throw Error(r(162));p=i.memoizedProps,u=i.stateNode;try{u.nodeValue=p}catch(ke){bt(i,i.return,ke)}}break;case 3:if(Kc=null,y=Pr,Pr=qc(s.containerInfo),qn(s,i),Pr=y,Gn(i),p&4&&u!==null&&u.memoizedState.isDehydrated)try{Zs(s.containerInfo)}catch(ke){bt(i,i.return,ke)}hp&&(hp=!1,Dx(i));break;case 4:p=Pr,Pr=qc(i.stateNode.containerInfo),qn(s,i),Gn(i),Pr=p;break;case 12:qn(s,i),Gn(i);break;case 31:qn(s,i),Gn(i),p&4&&(p=i.updateQueue,p!==null&&(i.updateQueue=null,Rc(i,p)));break;case 13:qn(s,i),Gn(i),i.child.flags&8192&&i.memoizedState!==null!=(u!==null&&u.memoizedState!==null)&&(Oc=Me()),p&4&&(p=i.updateQueue,p!==null&&(i.updateQueue=null,Rc(i,p)));break;case 22:y=i.memoizedState!==null;var F=u!==null&&u.memoizedState!==null,re=ji,de=an;if(ji=re||y,an=de||F,qn(s,i),an=de,ji=re,Gn(i),p&8192)e:for(s=i.stateNode,s._visibility=y?s._visibility&-2:s._visibility|1,y&&(u===null||F||ji||an||Ja(i)),u=null,s=i;;){if(s.tag===5||s.tag===26){if(u===null){F=u=s;try{if(x=F.stateNode,y)A=x.style,typeof A.setProperty=="function"?A.setProperty("display","none","important"):A.display="none";else{O=F.stateNode;var pe=F.memoizedProps.style,ie=pe!=null&&pe.hasOwnProperty("display")?pe.display:null;O.style.display=ie==null||typeof ie=="boolean"?"":(""+ie).trim()}}catch(ke){bt(F,F.return,ke)}}}else if(s.tag===6){if(u===null){F=s;try{F.stateNode.nodeValue=y?"":F.memoizedProps}catch(ke){bt(F,F.return,ke)}}}else if(s.tag===18){if(u===null){F=s;try{var oe=F.stateNode;y?ES(oe,!0):ES(F.stateNode,!1)}catch(ke){bt(F,F.return,ke)}}}else if((s.tag!==22&&s.tag!==23||s.memoizedState===null||s===i)&&s.child!==null){s.child.return=s,s=s.child;continue}if(s===i)break e;for(;s.sibling===null;){if(s.return===null||s.return===i)break e;u===s&&(u=null),s=s.return}u===s&&(u=null),s.sibling.return=s.return,s=s.sibling}p&4&&(p=i.updateQueue,p!==null&&(u=p.retryQueue,u!==null&&(p.retryQueue=null,Rc(i,u))));break;case 19:qn(s,i),Gn(i),p&4&&(p=i.updateQueue,p!==null&&(i.updateQueue=null,Rc(i,p)));break;case 30:break;case 21:break;default:qn(s,i),Gn(i)}}function Gn(i){var s=i.flags;if(s&2){try{for(var u,p=i.return;p!==null;){if(kx(p)){u=p;break}p=p.return}if(u==null)throw Error(r(160));switch(u.tag){case 27:var y=u.stateNode,x=dp(i);jc(i,x,y);break;case 5:var A=u.stateNode;u.flags&32&&(ws(A,""),u.flags&=-33);var O=dp(i);jc(i,O,A);break;case 3:case 4:var F=u.stateNode.containerInfo,re=dp(i);fp(i,re,F);break;default:throw Error(r(161))}}catch(de){bt(i,i.return,de)}i.flags&=-3}s&4096&&(i.flags&=-4097)}function Dx(i){if(i.subtreeFlags&1024)for(i=i.child;i!==null;){var s=i;Dx(s),s.tag===5&&s.flags&1024&&s.stateNode.reset(),i=i.sibling}}function _i(i,s){if(s.subtreeFlags&8772)for(s=s.child;s!==null;)Nx(i,s.alternate,s),s=s.sibling}function Ja(i){for(i=i.child;i!==null;){var s=i;switch(s.tag){case 0:case 11:case 14:case 15:ea(4,s,s.return),Ja(s);break;case 1:Zr(s,s.return);var u=s.stateNode;typeof u.componentWillUnmount=="function"&&Ex(s,s.return,u),Ja(s);break;case 27:Cl(s.stateNode);case 26:case 5:Zr(s,s.return),Ja(s);break;case 22:s.memoizedState===null&&Ja(s);break;case 30:Ja(s);break;default:Ja(s)}i=i.sibling}}function Oi(i,s,u){for(u=u&&(s.subtreeFlags&8772)!==0,s=s.child;s!==null;){var p=s.alternate,y=i,x=s,A=x.flags;switch(x.tag){case 0:case 11:case 15:Oi(y,x,u),gl(4,x);break;case 1:if(Oi(y,x,u),p=x,y=p.stateNode,typeof y.componentDidMount=="function")try{y.componentDidMount()}catch(re){bt(p,p.return,re)}if(p=x,y=p.updateQueue,y!==null){var O=p.stateNode;try{var F=y.shared.hiddenCallbacks;if(F!==null)for(y.shared.hiddenCallbacks=null,y=0;y<F.length;y++)db(F[y],O)}catch(re){bt(p,p.return,re)}}u&&A&64&&wx(x),vl(x,x.return);break;case 27:Cx(x);case 26:case 5:Oi(y,x,u),u&&p===null&&A&4&&Tx(x),vl(x,x.return);break;case 12:Oi(y,x,u);break;case 31:Oi(y,x,u),u&&A&4&&_x(y,x);break;case 13:Oi(y,x,u),u&&A&4&&Ox(y,x);break;case 22:x.memoizedState===null&&Oi(y,x,u),vl(x,x.return);break;case 30:break;default:Oi(y,x,u)}s=s.sibling}}function pp(i,s){var u=null;i!==null&&i.memoizedState!==null&&i.memoizedState.cachePool!==null&&(u=i.memoizedState.cachePool.pool),i=null,s.memoizedState!==null&&s.memoizedState.cachePool!==null&&(i=s.memoizedState.cachePool.pool),i!==u&&(i!=null&&i.refCount++,u!=null&&rl(u))}function mp(i,s){i=null,s.alternate!==null&&(i=s.alternate.memoizedState.cache),s=s.memoizedState.cache,s!==i&&(s.refCount++,i!=null&&rl(i))}function Lr(i,s,u,p){if(s.subtreeFlags&10256)for(s=s.child;s!==null;)Ix(i,s,u,p),s=s.sibling}function Ix(i,s,u,p){var y=s.flags;switch(s.tag){case 0:case 11:case 15:Lr(i,s,u,p),y&2048&&gl(9,s);break;case 1:Lr(i,s,u,p);break;case 3:Lr(i,s,u,p),y&2048&&(i=null,s.alternate!==null&&(i=s.alternate.memoizedState.cache),s=s.memoizedState.cache,s!==i&&(s.refCount++,i!=null&&rl(i)));break;case 12:if(y&2048){Lr(i,s,u,p),i=s.stateNode;try{var x=s.memoizedProps,A=x.id,O=x.onPostCommit;typeof O=="function"&&O(A,s.alternate===null?"mount":"update",i.passiveEffectDuration,-0)}catch(F){bt(s,s.return,F)}}else Lr(i,s,u,p);break;case 31:Lr(i,s,u,p);break;case 13:Lr(i,s,u,p);break;case 23:break;case 22:x=s.stateNode,A=s.alternate,s.memoizedState!==null?x._visibility&2?Lr(i,s,u,p):yl(i,s):x._visibility&2?Lr(i,s,u,p):(x._visibility|=2,Fs(i,s,u,p,(s.subtreeFlags&10256)!==0||!1)),y&2048&&pp(A,s);break;case 24:Lr(i,s,u,p),y&2048&&mp(s.alternate,s);break;default:Lr(i,s,u,p)}}function Fs(i,s,u,p,y){for(y=y&&((s.subtreeFlags&10256)!==0||!1),s=s.child;s!==null;){var x=i,A=s,O=u,F=p,re=A.flags;switch(A.tag){case 0:case 11:case 15:Fs(x,A,O,F,y),gl(8,A);break;case 23:break;case 22:var de=A.stateNode;A.memoizedState!==null?de._visibility&2?Fs(x,A,O,F,y):yl(x,A):(de._visibility|=2,Fs(x,A,O,F,y)),y&&re&2048&&pp(A.alternate,A);break;case 24:Fs(x,A,O,F,y),y&&re&2048&&mp(A.alternate,A);break;default:Fs(x,A,O,F,y)}s=s.sibling}}function yl(i,s){if(s.subtreeFlags&10256)for(s=s.child;s!==null;){var u=i,p=s,y=p.flags;switch(p.tag){case 22:yl(u,p),y&2048&&pp(p.alternate,p);break;case 24:yl(u,p),y&2048&&mp(p.alternate,p);break;default:yl(u,p)}s=s.sibling}}var bl=8192;function Hs(i,s,u){if(i.subtreeFlags&bl)for(i=i.child;i!==null;)Px(i,s,u),i=i.sibling}function Px(i,s,u){switch(i.tag){case 26:Hs(i,s,u),i.flags&bl&&i.memoizedState!==null&&dO(u,Pr,i.memoizedState,i.memoizedProps);break;case 5:Hs(i,s,u);break;case 3:case 4:var p=Pr;Pr=qc(i.stateNode.containerInfo),Hs(i,s,u),Pr=p;break;case 22:i.memoizedState===null&&(p=i.alternate,p!==null&&p.memoizedState!==null?(p=bl,bl=16777216,Hs(i,s,u),bl=p):Hs(i,s,u));break;default:Hs(i,s,u)}}function Lx(i){var s=i.alternate;if(s!==null&&(i=s.child,i!==null)){s.child=null;do s=i.sibling,i.sibling=null,i=s;while(i!==null)}}function xl(i){var s=i.deletions;if((i.flags&16)!==0){if(s!==null)for(var u=0;u<s.length;u++){var p=s[u];mn=p,Ux(p,i)}Lx(i)}if(i.subtreeFlags&10256)for(i=i.child;i!==null;)zx(i),i=i.sibling}function zx(i){switch(i.tag){case 0:case 11:case 15:xl(i),i.flags&2048&&ea(9,i,i.return);break;case 3:xl(i);break;case 12:xl(i);break;case 22:var s=i.stateNode;i.memoizedState!==null&&s._visibility&2&&(i.return===null||i.return.tag!==13)?(s._visibility&=-3,_c(i)):xl(i);break;default:xl(i)}}function _c(i){var s=i.deletions;if((i.flags&16)!==0){if(s!==null)for(var u=0;u<s.length;u++){var p=s[u];mn=p,Ux(p,i)}Lx(i)}for(i=i.child;i!==null;){switch(s=i,s.tag){case 0:case 11:case 15:ea(8,s,s.return),_c(s);break;case 22:u=s.stateNode,u._visibility&2&&(u._visibility&=-3,_c(s));break;default:_c(s)}i=i.sibling}}function Ux(i,s){for(;mn!==null;){var u=mn;switch(u.tag){case 0:case 11:case 15:ea(8,u,s);break;case 23:case 22:if(u.memoizedState!==null&&u.memoizedState.cachePool!==null){var p=u.memoizedState.cachePool.pool;p!=null&&p.refCount++}break;case 24:rl(u.memoizedState.cache)}if(p=u.child,p!==null)p.return=u,mn=p;else e:for(u=i;mn!==null;){p=mn;var y=p.sibling,x=p.return;if(jx(p),p===u){mn=null;break e}if(y!==null){y.return=x,mn=y;break e}mn=x}}}var C_={getCacheForType:function(i){var s=vn(tn),u=s.data.get(i);return u===void 0&&(u=i(),s.data.set(i,u)),u},cacheSignal:function(){return vn(tn).controller.signal}},A_=typeof WeakMap=="function"?WeakMap:Map,pt=0,Ct=null,Xe=null,et=0,yt=0,tr=null,ta=!1,qs=!1,gp=!1,Mi=0,qt=0,na=0,Za=0,vp=0,nr=0,Gs=0,Sl=null,Kn=null,yp=!1,Oc=0,Bx=0,Mc=1/0,Dc=null,ra=null,cn=0,ia=null,Ks=null,Di=0,bp=0,xp=null,Vx=null,wl=0,Sp=null;function rr(){return(pt&2)!==0&&et!==0?et&-et:V.T!==null?Ap():Ku()}function Fx(){if(nr===0)if((et&536870912)===0||rt){var i=Ft;Ft<<=1,(Ft&3932160)===0&&(Ft=262144),nr=i}else nr=536870912;return i=Zn.current,i!==null&&(i.flags|=32),nr}function $n(i,s,u){(i===Ct&&(yt===2||yt===9)||i.cancelPendingCommit!==null)&&($s(i,0),aa(i,et,nr,!1)),Ia(i,u),((pt&2)===0||i!==Ct)&&(i===Ct&&((pt&2)===0&&(Za|=u),qt===4&&aa(i,et,nr,!1)),ei(i))}function Hx(i,s,u){if((pt&6)!==0)throw Error(r(327));var p=!u&&(s&127)===0&&(s&i.expiredLanes)===0||Yr(i,s),y=p?R_(i,s):Ep(i,s,!0),x=p;do{if(y===0){qs&&!p&&aa(i,s,0,!1);break}else{if(u=i.current.alternate,x&&!N_(u)){y=Ep(i,s,!1),x=!1;continue}if(y===2){if(x=s,i.errorRecoveryDisabledLanes&x)var A=0;else A=i.pendingLanes&-536870913,A=A!==0?A:A&536870912?536870912:0;if(A!==0){s=A;e:{var O=i;y=Sl;var F=O.current.memoizedState.isDehydrated;if(F&&($s(O,A).flags|=256),A=Ep(O,A,!1),A!==2){if(gp&&!F){O.errorRecoveryDisabledLanes|=x,Za|=x,y=4;break e}x=Kn,Kn=y,x!==null&&(Kn===null?Kn=x:Kn.push.apply(Kn,x))}y=A}if(x=!1,y!==2)continue}}if(y===1){$s(i,0),aa(i,s,0,!0);break}e:{switch(p=i,x=y,x){case 0:case 1:throw Error(r(345));case 4:if((s&4194048)!==s)break;case 6:aa(p,s,nr,!ta);break e;case 2:Kn=null;break;case 3:case 5:break;default:throw Error(r(329))}if((s&62914560)===s&&(y=Oc+300-Me(),10<y)){if(aa(p,s,nr,!ta),Da(p,0,!0)!==0)break e;Di=s,p.timeoutHandle=xS(qx.bind(null,p,u,Kn,Dc,yp,s,nr,Za,Gs,ta,x,"Throttled",-0,0),y);break e}qx(p,u,Kn,Dc,yp,s,nr,Za,Gs,ta,x,null,-0,0)}}break}while(!0);ei(i)}function qx(i,s,u,p,y,x,A,O,F,re,de,pe,ie,oe){if(i.timeoutHandle=-1,pe=s.subtreeFlags,pe&8192||(pe&16785408)===16785408){pe={stylesheets:null,count:0,imgCount:0,imgBytes:0,suspenseyImages:[],waitingForImages:!0,waitingForViewTransition:!1,unsuspend:bi},Px(s,x,pe);var ke=(x&62914560)===x?Oc-Me():(x&4194048)===x?Bx-Me():0;if(ke=fO(pe,ke),ke!==null){Di=x,i.cancelPendingCommit=ke(Jx.bind(null,i,s,x,u,p,y,A,O,F,de,pe,null,ie,oe)),aa(i,x,A,!re);return}}Jx(i,s,x,u,p,y,A,O,F)}function N_(i){for(var s=i;;){var u=s.tag;if((u===0||u===11||u===15)&&s.flags&16384&&(u=s.updateQueue,u!==null&&(u=u.stores,u!==null)))for(var p=0;p<u.length;p++){var y=u[p],x=y.getSnapshot;y=y.value;try{if(!Qn(x(),y))return!1}catch{return!1}}if(u=s.child,s.subtreeFlags&16384&&u!==null)u.return=s,s=u;else{if(s===i)break;for(;s.sibling===null;){if(s.return===null||s.return===i)return!0;s=s.return}s.sibling.return=s.return,s=s.sibling}}return!0}function aa(i,s,u,p){s&=~vp,s&=~Za,i.suspendedLanes|=s,i.pingedLanes&=~s,p&&(i.warmLanes|=s),p=i.expirationTimes;for(var y=s;0<y;){var x=31-Y(y),A=1<<x;p[x]=-1,y&=~A}u!==0&&Fo(i,u,s)}function Ic(){return(pt&6)===0?(El(0),!1):!0}function wp(){if(Xe!==null){if(yt===0)var i=Xe.return;else i=Xe,Ei=qa=null,zh(i),Ls=null,al=0,i=Xe;for(;i!==null;)Sx(i.alternate,i),i=i.return;Xe=null}}function $s(i,s){var u=i.timeoutHandle;u!==-1&&(i.timeoutHandle=-1,Y_(u)),u=i.cancelPendingCommit,u!==null&&(i.cancelPendingCommit=null,u()),Di=0,wp(),Ct=i,Xe=u=Si(i.current,null),et=s,yt=0,tr=null,ta=!1,qs=Yr(i,s),gp=!1,Gs=nr=vp=Za=na=qt=0,Kn=Sl=null,yp=!1,(s&8)!==0&&(s|=s&32);var p=i.entangledLanes;if(p!==0)for(i=i.entanglements,p&=s;0<p;){var y=31-Y(p),x=1<<y;s|=i[y],p&=~x}return Mi=s,nc(),u}function Gx(i,s){Ke=null,V.H=hl,s===Ps||s===cc?(s=ob(),yt=3):s===Ch?(s=ob(),yt=4):yt=s===ep?8:s!==null&&typeof s=="object"&&typeof s.then=="function"?6:1,tr=s,Xe===null&&(qt=1,Tc(i,pr(s,i.current)))}function Kx(){var i=Zn.current;return i===null?!0:(et&4194048)===et?yr===null:(et&62914560)===et||(et&536870912)!==0?i===yr:!1}function $x(){var i=V.H;return V.H=hl,i===null?hl:i}function Yx(){var i=V.A;return V.A=C_,i}function Pc(){qt=4,ta||(et&4194048)!==et&&Zn.current!==null||(qs=!0),(na&134217727)===0&&(Za&134217727)===0||Ct===null||aa(Ct,et,nr,!1)}function Ep(i,s,u){var p=pt;pt|=2;var y=$x(),x=Yx();(Ct!==i||et!==s)&&(Dc=null,$s(i,s)),s=!1;var A=qt;e:do try{if(yt!==0&&Xe!==null){var O=Xe,F=tr;switch(yt){case 8:wp(),A=6;break e;case 3:case 2:case 9:case 6:Zn.current===null&&(s=!0);var re=yt;if(yt=0,tr=null,Ys(i,O,F,re),u&&qs){A=0;break e}break;default:re=yt,yt=0,tr=null,Ys(i,O,F,re)}}j_(),A=qt;break}catch(de){Gx(i,de)}while(!0);return s&&i.shellSuspendCounter++,Ei=qa=null,pt=p,V.H=y,V.A=x,Xe===null&&(Ct=null,et=0,nc()),A}function j_(){for(;Xe!==null;)Wx(Xe)}function R_(i,s){var u=pt;pt|=2;var p=$x(),y=Yx();Ct!==i||et!==s?(Dc=null,Mc=Me()+500,$s(i,s)):qs=Yr(i,s);e:do try{if(yt!==0&&Xe!==null){s=Xe;var x=tr;t:switch(yt){case 1:yt=0,tr=null,Ys(i,s,x,1);break;case 2:case 9:if(ab(x)){yt=0,tr=null,Xx(s);break}s=function(){yt!==2&&yt!==9||Ct!==i||(yt=7),ei(i)},x.then(s,s);break e;case 3:yt=7;break e;case 4:yt=5;break e;case 7:ab(x)?(yt=0,tr=null,Xx(s)):(yt=0,tr=null,Ys(i,s,x,7));break;case 5:var A=null;switch(Xe.tag){case 26:A=Xe.memoizedState;case 5:case 27:var O=Xe;if(A?IS(A):O.stateNode.complete){yt=0,tr=null;var F=O.sibling;if(F!==null)Xe=F;else{var re=O.return;re!==null?(Xe=re,Lc(re)):Xe=null}break t}}yt=0,tr=null,Ys(i,s,x,5);break;case 6:yt=0,tr=null,Ys(i,s,x,6);break;case 8:wp(),qt=6;break e;default:throw Error(r(462))}}__();break}catch(de){Gx(i,de)}while(!0);return Ei=qa=null,V.H=p,V.A=y,pt=u,Xe!==null?0:(Ct=null,et=0,nc(),qt)}function __(){for(;Xe!==null&&!Mn();)Wx(Xe)}function Wx(i){var s=bx(i.alternate,i,Mi);i.memoizedProps=i.pendingProps,s===null?Lc(i):Xe=s}function Xx(i){var s=i,u=s.alternate;switch(s.tag){case 15:case 0:s=hx(u,s,s.pendingProps,s.type,void 0,et);break;case 11:s=hx(u,s,s.pendingProps,s.type.render,s.ref,et);break;case 5:zh(s);default:Sx(u,s),s=Xe=Y0(s,Mi),s=bx(u,s,Mi)}i.memoizedProps=i.pendingProps,s===null?Lc(i):Xe=s}function Ys(i,s,u,p){Ei=qa=null,zh(s),Ls=null,al=0;var y=s.return;try{if(b_(i,y,s,u,et)){qt=1,Tc(i,pr(u,i.current)),Xe=null;return}}catch(x){if(y!==null)throw Xe=y,x;qt=1,Tc(i,pr(u,i.current)),Xe=null;return}s.flags&32768?(rt||p===1?i=!0:qs||(et&536870912)!==0?i=!1:(ta=i=!0,(p===2||p===9||p===3||p===6)&&(p=Zn.current,p!==null&&p.tag===13&&(p.flags|=16384))),Qx(s,i)):Lc(s)}function Lc(i){var s=i;do{if((s.flags&32768)!==0){Qx(s,ta);return}i=s.return;var u=w_(s.alternate,s,Mi);if(u!==null){Xe=u;return}if(s=s.sibling,s!==null){Xe=s;return}Xe=s=i}while(s!==null);qt===0&&(qt=5)}function Qx(i,s){do{var u=E_(i.alternate,i);if(u!==null){u.flags&=32767,Xe=u;return}if(u=i.return,u!==null&&(u.flags|=32768,u.subtreeFlags=0,u.deletions=null),!s&&(i=i.sibling,i!==null)){Xe=i;return}Xe=i=u}while(i!==null);qt=6,Xe=null}function Jx(i,s,u,p,y,x,A,O,F){i.cancelPendingCommit=null;do zc();while(cn!==0);if((pt&6)!==0)throw Error(r(327));if(s!==null){if(s===i.current)throw Error(r(177));if(x=s.lanes|s.childLanes,x|=dh,Hf(i,u,x,A,O,F),i===Ct&&(Xe=Ct=null,et=0),Ks=s,ia=i,Di=u,bp=x,xp=y,Vx=p,(s.subtreeFlags&10256)!==0||(s.flags&10256)!==0?(i.callbackNode=null,i.callbackPriority=0,I_(Te,function(){return rS(),null})):(i.callbackNode=null,i.callbackPriority=0),p=(s.flags&13878)!==0,(s.subtreeFlags&13878)!==0||p){p=V.T,V.T=null,y=X.p,X.p=2,A=pt,pt|=4;try{T_(i,s,u)}finally{pt=A,X.p=y,V.T=p}}cn=1,Zx(),eS(),tS()}}function Zx(){if(cn===1){cn=0;var i=ia,s=Ks,u=(s.flags&13878)!==0;if((s.subtreeFlags&13878)!==0||u){u=V.T,V.T=null;var p=X.p;X.p=2;var y=pt;pt|=4;try{Mx(s,i);var x=Ip,A=U0(i.containerInfo),O=x.focusedElem,F=x.selectionRange;if(A!==O&&O&&O.ownerDocument&&z0(O.ownerDocument.documentElement,O)){if(F!==null&&sh(O)){var re=F.start,de=F.end;if(de===void 0&&(de=re),"selectionStart"in O)O.selectionStart=re,O.selectionEnd=Math.min(de,O.value.length);else{var pe=O.ownerDocument||document,ie=pe&&pe.defaultView||window;if(ie.getSelection){var oe=ie.getSelection(),ke=O.textContent.length,Ie=Math.min(F.start,ke),Et=F.end===void 0?Ie:Math.min(F.end,ke);!oe.extend&&Ie>Et&&(A=Et,Et=Ie,Ie=A);var J=L0(O,Ie),G=L0(O,Et);if(J&&G&&(oe.rangeCount!==1||oe.anchorNode!==J.node||oe.anchorOffset!==J.offset||oe.focusNode!==G.node||oe.focusOffset!==G.offset)){var ne=pe.createRange();ne.setStart(J.node,J.offset),oe.removeAllRanges(),Ie>Et?(oe.addRange(ne),oe.extend(G.node,G.offset)):(ne.setEnd(G.node,G.offset),oe.addRange(ne))}}}}for(pe=[],oe=O;oe=oe.parentNode;)oe.nodeType===1&&pe.push({element:oe,left:oe.scrollLeft,top:oe.scrollTop});for(typeof O.focus=="function"&&O.focus(),O=0;O<pe.length;O++){var he=pe[O];he.element.scrollLeft=he.left,he.element.scrollTop=he.top}}Xc=!!Dp,Ip=Dp=null}finally{pt=y,X.p=p,V.T=u}}i.current=s,cn=2}}function eS(){if(cn===2){cn=0;var i=ia,s=Ks,u=(s.flags&8772)!==0;if((s.subtreeFlags&8772)!==0||u){u=V.T,V.T=null;var p=X.p;X.p=2;var y=pt;pt|=4;try{Nx(i,s.alternate,s)}finally{pt=y,X.p=p,V.T=u}}cn=3}}function tS(){if(cn===4||cn===3){cn=0,Ue();var i=ia,s=Ks,u=Di,p=Vx;(s.subtreeFlags&10256)!==0||(s.flags&10256)!==0?cn=5:(cn=0,Ks=ia=null,nS(i,i.pendingLanes));var y=i.pendingLanes;if(y===0&&(ra=null),qo(u),s=s.stateNode,Lt&&typeof Lt.onCommitFiberRoot=="function")try{Lt.onCommitFiberRoot(gt,s,void 0,(s.current.flags&128)===128)}catch{}if(p!==null){s=V.T,y=X.p,X.p=2,V.T=null;try{for(var x=i.onRecoverableError,A=0;A<p.length;A++){var O=p[A];x(O.value,{componentStack:O.stack})}}finally{V.T=s,X.p=y}}(Di&3)!==0&&zc(),ei(i),y=i.pendingLanes,(u&261930)!==0&&(y&42)!==0?i===Sp?wl++:(wl=0,Sp=i):wl=0,El(0)}}function nS(i,s){(i.pooledCacheLanes&=s)===0&&(s=i.pooledCache,s!=null&&(i.pooledCache=null,rl(s)))}function zc(){return Zx(),eS(),tS(),rS()}function rS(){if(cn!==5)return!1;var i=ia,s=bp;bp=0;var u=qo(Di),p=V.T,y=X.p;try{X.p=32>u?32:u,V.T=null,u=xp,xp=null;var x=ia,A=Di;if(cn=0,Ks=ia=null,Di=0,(pt&6)!==0)throw Error(r(331));var O=pt;if(pt|=4,zx(x.current),Ix(x,x.current,A,u),pt=O,El(0,!1),Lt&&typeof Lt.onPostCommitFiberRoot=="function")try{Lt.onPostCommitFiberRoot(gt,x)}catch{}return!0}finally{X.p=y,V.T=p,nS(i,s)}}function iS(i,s,u){s=pr(u,s),s=Zh(i.stateNode,s,2),i=Qi(i,s,2),i!==null&&(Ia(i,2),ei(i))}function bt(i,s,u){if(i.tag===3)iS(i,i,u);else for(;s!==null;){if(s.tag===3){iS(s,i,u);break}else if(s.tag===1){var p=s.stateNode;if(typeof s.type.getDerivedStateFromError=="function"||typeof p.componentDidCatch=="function"&&(ra===null||!ra.has(p))){i=pr(u,i),u=ax(2),p=Qi(s,u,2),p!==null&&(sx(u,p,s,i),Ia(p,2),ei(p));break}}s=s.return}}function Tp(i,s,u){var p=i.pingCache;if(p===null){p=i.pingCache=new A_;var y=new Set;p.set(s,y)}else y=p.get(s),y===void 0&&(y=new Set,p.set(s,y));y.has(u)||(gp=!0,y.add(u),i=O_.bind(null,i,s,u),s.then(i,i))}function O_(i,s,u){var p=i.pingCache;p!==null&&p.delete(s),i.pingedLanes|=i.suspendedLanes&u,i.warmLanes&=~u,Ct===i&&(et&u)===u&&(qt===4||qt===3&&(et&62914560)===et&&300>Me()-Oc?(pt&2)===0&&$s(i,0):vp|=u,Gs===et&&(Gs=0)),ei(i)}function aS(i,s){s===0&&(s=Hu()),i=Va(i,s),i!==null&&(Ia(i,s),ei(i))}function M_(i){var s=i.memoizedState,u=0;s!==null&&(u=s.retryLane),aS(i,u)}function D_(i,s){var u=0;switch(i.tag){case 31:case 13:var p=i.stateNode,y=i.memoizedState;y!==null&&(u=y.retryLane);break;case 19:p=i.stateNode;break;case 22:p=i.stateNode._retryCache;break;default:throw Error(r(314))}p!==null&&p.delete(s),aS(i,u)}function I_(i,s){return mt(i,s)}var Uc=null,Ws=null,kp=!1,Bc=!1,Cp=!1,sa=0;function ei(i){i!==Ws&&i.next===null&&(Ws===null?Uc=Ws=i:Ws=Ws.next=i),Bc=!0,kp||(kp=!0,L_())}function El(i,s){if(!Cp&&Bc){Cp=!0;do for(var u=!1,p=Uc;p!==null;){if(i!==0){var y=p.pendingLanes;if(y===0)var x=0;else{var A=p.suspendedLanes,O=p.pingedLanes;x=(1<<31-Y(42|i)+1)-1,x&=y&~(A&~O),x=x&201326741?x&201326741|1:x?x|2:0}x!==0&&(u=!0,uS(p,x))}else x=et,x=Da(p,p===Ct?x:0,p.cancelPendingCommit!==null||p.timeoutHandle!==-1),(x&3)===0||Yr(p,x)||(u=!0,uS(p,x));p=p.next}while(u);Cp=!1}}function P_(){sS()}function sS(){Bc=kp=!1;var i=0;sa!==0&&$_()&&(i=sa);for(var s=Me(),u=null,p=Uc;p!==null;){var y=p.next,x=oS(p,s);x===0?(p.next=null,u===null?Uc=y:u.next=y,y===null&&(Ws=u)):(u=p,(i!==0||(x&3)!==0)&&(Bc=!0)),p=y}cn!==0&&cn!==5||El(i),sa!==0&&(sa=0)}function oS(i,s){for(var u=i.suspendedLanes,p=i.pingedLanes,y=i.expirationTimes,x=i.pendingLanes&-62914561;0<x;){var A=31-Y(x),O=1<<A,F=y[A];F===-1?((O&u)===0||(O&p)!==0)&&(y[A]=xs(O,s)):F<=s&&(i.expiredLanes|=O),x&=~O}if(s=Ct,u=et,u=Da(i,i===s?u:0,i.cancelPendingCommit!==null||i.timeoutHandle!==-1),p=i.callbackNode,u===0||i===s&&(yt===2||yt===9)||i.cancelPendingCommit!==null)return p!==null&&p!==null&&st(p),i.callbackNode=null,i.callbackPriority=0;if((u&3)===0||Yr(i,u)){if(s=u&-u,s===i.callbackPriority)return s;switch(p!==null&&st(p),qo(u)){case 2:case 8:u=ae;break;case 32:u=Te;break;case 268435456:u=Be;break;default:u=Te}return p=lS.bind(null,i),u=mt(u,p),i.callbackPriority=s,i.callbackNode=u,s}return p!==null&&p!==null&&st(p),i.callbackPriority=2,i.callbackNode=null,2}function lS(i,s){if(cn!==0&&cn!==5)return i.callbackNode=null,i.callbackPriority=0,null;var u=i.callbackNode;if(zc()&&i.callbackNode!==u)return null;var p=et;return p=Da(i,i===Ct?p:0,i.cancelPendingCommit!==null||i.timeoutHandle!==-1),p===0?null:(Hx(i,p,s),oS(i,Me()),i.callbackNode!=null&&i.callbackNode===u?lS.bind(null,i):null)}function uS(i,s){if(zc())return null;Hx(i,s,!0)}function L_(){W_(function(){(pt&6)!==0?mt(q,P_):sS()})}function Ap(){if(sa===0){var i=Ds;i===0&&(i=Mr,Mr<<=1,(Mr&261888)===0&&(Mr=256)),sa=i}return sa}function cS(i){return i==null||typeof i=="symbol"||typeof i=="boolean"?null:typeof i=="function"?i:Yu(""+i)}function dS(i,s){var u=s.ownerDocument.createElement("input");return u.name=s.name,u.value=s.value,i.id&&u.setAttribute("form",i.id),s.parentNode.insertBefore(u,s),i=new FormData(i),u.parentNode.removeChild(u),i}function z_(i,s,u,p,y){if(s==="submit"&&u&&u.stateNode===y){var x=cS((y[$]||null).action),A=p.submitter;A&&(s=(s=A[$]||null)?cS(s.formAction):A.getAttribute("formAction"),s!==null&&(x=s,A=null));var O=new Ju("action","action",null,p,y);i.push({event:O,listeners:[{instance:null,listener:function(){if(p.defaultPrevented){if(sa!==0){var F=A?dS(y,A):new FormData(y);$h(u,{pending:!0,data:F,method:y.method,action:x},null,F)}}else typeof x=="function"&&(O.preventDefault(),F=A?dS(y,A):new FormData(y),$h(u,{pending:!0,data:F,method:y.method,action:x},x,F))},currentTarget:y}]})}}for(var Np=0;Np<ch.length;Np++){var jp=ch[Np],U_=jp.toLowerCase(),B_=jp[0].toUpperCase()+jp.slice(1);Ir(U_,"on"+B_)}Ir(F0,"onAnimationEnd"),Ir(H0,"onAnimationIteration"),Ir(q0,"onAnimationStart"),Ir("dblclick","onDoubleClick"),Ir("focusin","onFocus"),Ir("focusout","onBlur"),Ir(n_,"onTransitionRun"),Ir(r_,"onTransitionStart"),Ir(i_,"onTransitionCancel"),Ir(G0,"onTransitionEnd"),Vn("onMouseEnter",["mouseout","mouseover"]),Vn("onMouseLeave",["mouseout","mouseover"]),Vn("onPointerEnter",["pointerout","pointerover"]),Vn("onPointerLeave",["pointerout","pointerover"]),Wt("onChange","change click focusin focusout input keydown keyup selectionchange".split(" ")),Wt("onSelect","focusout contextmenu dragend focusin keydown keyup mousedown mouseup selectionchange".split(" ")),Wt("onBeforeInput",["compositionend","keypress","textInput","paste"]),Wt("onCompositionEnd","compositionend focusout keydown keypress keyup mousedown".split(" ")),Wt("onCompositionStart","compositionstart focusout keydown keypress keyup mousedown".split(" ")),Wt("onCompositionUpdate","compositionupdate focusout keydown keypress keyup mousedown".split(" "));var Tl="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(" "),V_=new Set("beforetoggle cancel close invalid load scroll scrollend toggle".split(" ").concat(Tl));function fS(i,s){s=(s&4)!==0;for(var u=0;u<i.length;u++){var p=i[u],y=p.event;p=p.listeners;e:{var x=void 0;if(s)for(var A=p.length-1;0<=A;A--){var O=p[A],F=O.instance,re=O.currentTarget;if(O=O.listener,F!==x&&y.isPropagationStopped())break e;x=O,y.currentTarget=re;try{x(y)}catch(de){tc(de)}y.currentTarget=null,x=F}else for(A=0;A<p.length;A++){if(O=p[A],F=O.instance,re=O.currentTarget,O=O.listener,F!==x&&y.isPropagationStopped())break e;x=O,y.currentTarget=re;try{x(y)}catch(de){tc(de)}y.currentTarget=null,x=F}}}}function Qe(i,s){var u=s[nt];u===void 0&&(u=s[nt]=new Set);var p=i+"__bubble";u.has(p)||(hS(s,i,2,!1),u.add(p))}function Rp(i,s,u){var p=0;s&&(p|=4),hS(u,i,p,s)}var Vc="_reactListening"+Math.random().toString(36).slice(2);function _p(i){if(!i[Vc]){i[Vc]=!0,ct.forEach(function(u){u!=="selectionchange"&&(V_.has(u)||Rp(u,!1,i),Rp(u,!0,i))});var s=i.nodeType===9?i:i.ownerDocument;s===null||s[Vc]||(s[Vc]=!0,Rp("selectionchange",!1,s))}}function hS(i,s,u,p){switch(FS(s)){case 2:var y=mO;break;case 8:y=gO;break;default:y=Kp}u=y.bind(null,s,u,i),y=void 0,!Qf||s!=="touchstart"&&s!=="touchmove"&&s!=="wheel"||(y=!0),p?y!==void 0?i.addEventListener(s,u,{capture:!0,passive:y}):i.addEventListener(s,u,!0):y!==void 0?i.addEventListener(s,u,{passive:y}):i.addEventListener(s,u,!1)}function Op(i,s,u,p,y){var x=p;if((s&1)===0&&(s&2)===0&&p!==null)e:for(;;){if(p===null)return;var A=p.tag;if(A===3||A===4){var O=p.stateNode.containerInfo;if(O===y)break;if(A===4)for(A=p.return;A!==null;){var F=A.tag;if((F===3||F===4)&&A.stateNode.containerInfo===y)return;A=A.return}for(;O!==null;){if(A=pn(O),A===null)return;if(F=A.tag,F===5||F===6||F===26||F===27){p=x=A;continue e}O=O.parentNode}}p=p.return}y0(function(){var re=x,de=Wf(u),pe=[];e:{var ie=K0.get(i);if(ie!==void 0){var oe=Ju,ke=i;switch(i){case"keypress":if(Xu(u)===0)break e;case"keydown":case"keyup":oe=D2;break;case"focusin":ke="focus",oe=th;break;case"focusout":ke="blur",oe=th;break;case"beforeblur":case"afterblur":oe=th;break;case"click":if(u.button===2)break e;case"auxclick":case"dblclick":case"mousedown":case"mousemove":case"mouseup":case"mouseout":case"mouseover":case"contextmenu":oe=S0;break;case"drag":case"dragend":case"dragenter":case"dragexit":case"dragleave":case"dragover":case"dragstart":case"drop":oe=w2;break;case"touchcancel":case"touchend":case"touchmove":case"touchstart":oe=L2;break;case F0:case H0:case q0:oe=k2;break;case G0:oe=U2;break;case"scroll":case"scrollend":oe=x2;break;case"wheel":oe=V2;break;case"copy":case"cut":case"paste":oe=A2;break;case"gotpointercapture":case"lostpointercapture":case"pointercancel":case"pointerdown":case"pointermove":case"pointerout":case"pointerover":case"pointerup":oe=E0;break;case"toggle":case"beforetoggle":oe=H2}var Ie=(s&4)!==0,Et=!Ie&&(i==="scroll"||i==="scrollend"),J=Ie?ie!==null?ie+"Capture":null:ie;Ie=[];for(var G=re,ne;G!==null;){var he=G;if(ne=he.stateNode,he=he.tag,he!==5&&he!==26&&he!==27||ne===null||J===null||(he=Ko(G,J),he!=null&&Ie.push(kl(G,he,ne))),Et)break;G=G.return}0<Ie.length&&(ie=new oe(ie,ke,null,u,de),pe.push({event:ie,listeners:Ie}))}}if((s&7)===0){e:{if(ie=i==="mouseover"||i==="pointerover",oe=i==="mouseout"||i==="pointerout",ie&&u!==Yf&&(ke=u.relatedTarget||u.fromElement)&&(pn(ke)||ke[me]))break e;if((oe||ie)&&(ie=de.window===de?de:(ie=de.ownerDocument)?ie.defaultView||ie.parentWindow:window,oe?(ke=u.relatedTarget||u.toElement,oe=re,ke=ke?pn(ke):null,ke!==null&&(Et=o(ke),Ie=ke.tag,ke!==Et||Ie!==5&&Ie!==27&&Ie!==6)&&(ke=null)):(oe=null,ke=re),oe!==ke)){if(Ie=S0,he="onMouseLeave",J="onMouseEnter",G="mouse",(i==="pointerout"||i==="pointerover")&&(Ie=E0,he="onPointerLeave",J="onPointerEnter",G="pointer"),Et=oe==null?ie:Dr(oe),ne=ke==null?ie:Dr(ke),ie=new Ie(he,G+"leave",oe,u,de),ie.target=Et,ie.relatedTarget=ne,he=null,pn(de)===re&&(Ie=new Ie(J,G+"enter",ke,u,de),Ie.target=ne,Ie.relatedTarget=Et,he=Ie),Et=he,oe&&ke)t:{for(Ie=F_,J=oe,G=ke,ne=0,he=J;he;he=Ie(he))ne++;he=0;for(var Oe=G;Oe;Oe=Ie(Oe))he++;for(;0<ne-he;)J=Ie(J),ne--;for(;0<he-ne;)G=Ie(G),he--;for(;ne--;){if(J===G||G!==null&&J===G.alternate){Ie=J;break t}J=Ie(J),G=Ie(G)}Ie=null}else Ie=null;oe!==null&&pS(pe,ie,oe,Ie,!1),ke!==null&&Et!==null&&pS(pe,Et,ke,Ie,!0)}}e:{if(ie=re?Dr(re):window,oe=ie.nodeName&&ie.nodeName.toLowerCase(),oe==="select"||oe==="input"&&ie.type==="file")var dt=_0;else if(j0(ie))if(O0)dt=Z2;else{dt=Q2;var Ne=X2}else oe=ie.nodeName,!oe||oe.toLowerCase()!=="input"||ie.type!=="checkbox"&&ie.type!=="radio"?re&&$f(re.elementType)&&(dt=_0):dt=J2;if(dt&&(dt=dt(i,re))){R0(pe,dt,u,de);break e}Ne&&Ne(i,ie,re),i==="focusout"&&re&&ie.type==="number"&&re.memoizedProps.value!=null&&Kf(ie,"number",ie.value)}switch(Ne=re?Dr(re):window,i){case"focusin":(j0(Ne)||Ne.contentEditable==="true")&&(Cs=Ne,oh=re,el=null);break;case"focusout":el=oh=Cs=null;break;case"mousedown":lh=!0;break;case"contextmenu":case"mouseup":case"dragend":lh=!1,B0(pe,u,de);break;case"selectionchange":if(t_)break;case"keydown":case"keyup":B0(pe,u,de)}var $e;if(rh)e:{switch(i){case"compositionstart":var tt="onCompositionStart";break e;case"compositionend":tt="onCompositionEnd";break e;case"compositionupdate":tt="onCompositionUpdate";break e}tt=void 0}else ks?A0(i,u)&&(tt="onCompositionEnd"):i==="keydown"&&u.keyCode===229&&(tt="onCompositionStart");tt&&(T0&&u.locale!=="ko"&&(ks||tt!=="onCompositionStart"?tt==="onCompositionEnd"&&ks&&($e=b0()):(qi=de,Jf="value"in qi?qi.value:qi.textContent,ks=!0)),Ne=Fc(re,tt),0<Ne.length&&(tt=new w0(tt,i,null,u,de),pe.push({event:tt,listeners:Ne}),$e?tt.data=$e:($e=N0(u),$e!==null&&(tt.data=$e)))),($e=G2?K2(i,u):$2(i,u))&&(tt=Fc(re,"onBeforeInput"),0<tt.length&&(Ne=new w0("onBeforeInput","beforeinput",null,u,de),pe.push({event:Ne,listeners:tt}),Ne.data=$e)),z_(pe,i,re,u,de)}fS(pe,s)})}function kl(i,s,u){return{instance:i,listener:s,currentTarget:u}}function Fc(i,s){for(var u=s+"Capture",p=[];i!==null;){var y=i,x=y.stateNode;if(y=y.tag,y!==5&&y!==26&&y!==27||x===null||(y=Ko(i,u),y!=null&&p.unshift(kl(i,y,x)),y=Ko(i,s),y!=null&&p.push(kl(i,y,x))),i.tag===3)return p;i=i.return}return[]}function F_(i){if(i===null)return null;do i=i.return;while(i&&i.tag!==5&&i.tag!==27);return i||null}function pS(i,s,u,p,y){for(var x=s._reactName,A=[];u!==null&&u!==p;){var O=u,F=O.alternate,re=O.stateNode;if(O=O.tag,F!==null&&F===p)break;O!==5&&O!==26&&O!==27||re===null||(F=re,y?(re=Ko(u,x),re!=null&&A.unshift(kl(u,re,F))):y||(re=Ko(u,x),re!=null&&A.push(kl(u,re,F)))),u=u.return}A.length!==0&&i.push({event:s,listeners:A})}var H_=/\r\n?/g,q_=/\u0000|\uFFFD/g;function mS(i){return(typeof i=="string"?i:""+i).replace(H_,`
9
+ `).replace(q_,"")}function gS(i,s){return s=mS(s),mS(i)===s}function wt(i,s,u,p,y,x){switch(u){case"children":typeof p=="string"?s==="body"||s==="textarea"&&p===""||ws(i,p):(typeof p=="number"||typeof p=="bigint")&&s!=="body"&&ws(i,""+p);break;case"className":La(i,"class",p);break;case"tabIndex":La(i,"tabindex",p);break;case"dir":case"role":case"viewBox":case"width":case"height":La(i,u,p);break;case"style":g0(i,p,x);break;case"data":if(s!=="object"){La(i,"data",p);break}case"src":case"href":if(p===""&&(s!=="a"||u!=="href")){i.removeAttribute(u);break}if(p==null||typeof p=="function"||typeof p=="symbol"||typeof p=="boolean"){i.removeAttribute(u);break}p=Yu(""+p),i.setAttribute(u,p);break;case"action":case"formAction":if(typeof p=="function"){i.setAttribute(u,"javascript:throw new Error('A React form was unexpectedly submitted. If you called form.submit() manually, consider using form.requestSubmit() instead. If you\\'re trying to use event.stopPropagation() in a submit event handler, consider also calling event.preventDefault().')");break}else typeof x=="function"&&(u==="formAction"?(s!=="input"&&wt(i,s,"name",y.name,y,null),wt(i,s,"formEncType",y.formEncType,y,null),wt(i,s,"formMethod",y.formMethod,y,null),wt(i,s,"formTarget",y.formTarget,y,null)):(wt(i,s,"encType",y.encType,y,null),wt(i,s,"method",y.method,y,null),wt(i,s,"target",y.target,y,null)));if(p==null||typeof p=="symbol"||typeof p=="boolean"){i.removeAttribute(u);break}p=Yu(""+p),i.setAttribute(u,p);break;case"onClick":p!=null&&(i.onclick=bi);break;case"onScroll":p!=null&&Qe("scroll",i);break;case"onScrollEnd":p!=null&&Qe("scrollend",i);break;case"dangerouslySetInnerHTML":if(p!=null){if(typeof p!="object"||!("__html"in p))throw Error(r(61));if(u=p.__html,u!=null){if(y.children!=null)throw Error(r(60));i.innerHTML=u}}break;case"multiple":i.multiple=p&&typeof p!="function"&&typeof p!="symbol";break;case"muted":i.muted=p&&typeof p!="function"&&typeof p!="symbol";break;case"suppressContentEditableWarning":case"suppressHydrationWarning":case"defaultValue":case"defaultChecked":case"innerHTML":case"ref":break;case"autoFocus":break;case"xlinkHref":if(p==null||typeof p=="function"||typeof p=="boolean"||typeof p=="symbol"){i.removeAttribute("xlink:href");break}u=Yu(""+p),i.setAttributeNS("http://www.w3.org/1999/xlink","xlink:href",u);break;case"contentEditable":case"spellCheck":case"draggable":case"value":case"autoReverse":case"externalResourcesRequired":case"focusable":case"preserveAlpha":p!=null&&typeof p!="function"&&typeof p!="symbol"?i.setAttribute(u,""+p):i.removeAttribute(u);break;case"inert":case"allowFullScreen":case"async":case"autoPlay":case"controls":case"default":case"defer":case"disabled":case"disablePictureInPicture":case"disableRemotePlayback":case"formNoValidate":case"hidden":case"loop":case"noModule":case"noValidate":case"open":case"playsInline":case"readOnly":case"required":case"reversed":case"scoped":case"seamless":case"itemScope":p&&typeof p!="function"&&typeof p!="symbol"?i.setAttribute(u,""):i.removeAttribute(u);break;case"capture":case"download":p===!0?i.setAttribute(u,""):p!==!1&&p!=null&&typeof p!="function"&&typeof p!="symbol"?i.setAttribute(u,p):i.removeAttribute(u);break;case"cols":case"rows":case"size":case"span":p!=null&&typeof p!="function"&&typeof p!="symbol"&&!isNaN(p)&&1<=p?i.setAttribute(u,p):i.removeAttribute(u);break;case"rowSpan":case"start":p==null||typeof p=="function"||typeof p=="symbol"||isNaN(p)?i.removeAttribute(u):i.setAttribute(u,p);break;case"popover":Qe("beforetoggle",i),Qe("toggle",i),vi(i,"popover",p);break;case"xlinkActuate":yi(i,"http://www.w3.org/1999/xlink","xlink:actuate",p);break;case"xlinkArcrole":yi(i,"http://www.w3.org/1999/xlink","xlink:arcrole",p);break;case"xlinkRole":yi(i,"http://www.w3.org/1999/xlink","xlink:role",p);break;case"xlinkShow":yi(i,"http://www.w3.org/1999/xlink","xlink:show",p);break;case"xlinkTitle":yi(i,"http://www.w3.org/1999/xlink","xlink:title",p);break;case"xlinkType":yi(i,"http://www.w3.org/1999/xlink","xlink:type",p);break;case"xmlBase":yi(i,"http://www.w3.org/XML/1998/namespace","xml:base",p);break;case"xmlLang":yi(i,"http://www.w3.org/XML/1998/namespace","xml:lang",p);break;case"xmlSpace":yi(i,"http://www.w3.org/XML/1998/namespace","xml:space",p);break;case"is":vi(i,"is",p);break;case"innerText":case"textContent":break;default:(!(2<u.length)||u[0]!=="o"&&u[0]!=="O"||u[1]!=="n"&&u[1]!=="N")&&(u=y2.get(u)||u,vi(i,u,p))}}function Mp(i,s,u,p,y,x){switch(u){case"style":g0(i,p,x);break;case"dangerouslySetInnerHTML":if(p!=null){if(typeof p!="object"||!("__html"in p))throw Error(r(61));if(u=p.__html,u!=null){if(y.children!=null)throw Error(r(60));i.innerHTML=u}}break;case"children":typeof p=="string"?ws(i,p):(typeof p=="number"||typeof p=="bigint")&&ws(i,""+p);break;case"onScroll":p!=null&&Qe("scroll",i);break;case"onScrollEnd":p!=null&&Qe("scrollend",i);break;case"onClick":p!=null&&(i.onclick=bi);break;case"suppressContentEditableWarning":case"suppressHydrationWarning":case"innerHTML":case"ref":break;case"innerText":case"textContent":break;default:if(!Mt.hasOwnProperty(u))e:{if(u[0]==="o"&&u[1]==="n"&&(y=u.endsWith("Capture"),s=u.slice(2,y?u.length-7:void 0),x=i[$]||null,x=x!=null?x[u]:null,typeof x=="function"&&i.removeEventListener(s,x,y),typeof p=="function")){typeof x!="function"&&x!==null&&(u in i?i[u]=null:i.hasAttribute(u)&&i.removeAttribute(u)),i.addEventListener(s,p,y);break e}u in i?i[u]=p:p===!0?i.setAttribute(u,""):vi(i,u,p)}}}function bn(i,s,u){switch(s){case"div":case"span":case"svg":case"path":case"a":case"g":case"p":case"li":break;case"img":Qe("error",i),Qe("load",i);var p=!1,y=!1,x;for(x in u)if(u.hasOwnProperty(x)){var A=u[x];if(A!=null)switch(x){case"src":p=!0;break;case"srcSet":y=!0;break;case"children":case"dangerouslySetInnerHTML":throw Error(r(137,s));default:wt(i,s,x,A,u,null)}}y&&wt(i,s,"srcSet",u.srcSet,u,null),p&&wt(i,s,"src",u.src,u,null);return;case"input":Qe("invalid",i);var O=x=A=y=null,F=null,re=null;for(p in u)if(u.hasOwnProperty(p)){var de=u[p];if(de!=null)switch(p){case"name":y=de;break;case"type":A=de;break;case"checked":F=de;break;case"defaultChecked":re=de;break;case"value":x=de;break;case"defaultValue":O=de;break;case"children":case"dangerouslySetInnerHTML":if(de!=null)throw Error(r(137,s));break;default:wt(i,s,p,de,u,null)}}f0(i,x,O,F,re,A,y,!1);return;case"select":Qe("invalid",i),p=A=x=null;for(y in u)if(u.hasOwnProperty(y)&&(O=u[y],O!=null))switch(y){case"value":x=O;break;case"defaultValue":A=O;break;case"multiple":p=O;default:wt(i,s,y,O,u,null)}s=x,u=A,i.multiple=!!p,s!=null?Ss(i,!!p,s,!1):u!=null&&Ss(i,!!p,u,!0);return;case"textarea":Qe("invalid",i),x=y=p=null;for(A in u)if(u.hasOwnProperty(A)&&(O=u[A],O!=null))switch(A){case"value":p=O;break;case"defaultValue":y=O;break;case"children":x=O;break;case"dangerouslySetInnerHTML":if(O!=null)throw Error(r(91));break;default:wt(i,s,A,O,u,null)}p0(i,p,y,x);return;case"option":for(F in u)u.hasOwnProperty(F)&&(p=u[F],p!=null)&&(F==="selected"?i.selected=p&&typeof p!="function"&&typeof p!="symbol":wt(i,s,F,p,u,null));return;case"dialog":Qe("beforetoggle",i),Qe("toggle",i),Qe("cancel",i),Qe("close",i);break;case"iframe":case"object":Qe("load",i);break;case"video":case"audio":for(p=0;p<Tl.length;p++)Qe(Tl[p],i);break;case"image":Qe("error",i),Qe("load",i);break;case"details":Qe("toggle",i);break;case"embed":case"source":case"link":Qe("error",i),Qe("load",i);case"area":case"base":case"br":case"col":case"hr":case"keygen":case"meta":case"param":case"track":case"wbr":case"menuitem":for(re in u)if(u.hasOwnProperty(re)&&(p=u[re],p!=null))switch(re){case"children":case"dangerouslySetInnerHTML":throw Error(r(137,s));default:wt(i,s,re,p,u,null)}return;default:if($f(s)){for(de in u)u.hasOwnProperty(de)&&(p=u[de],p!==void 0&&Mp(i,s,de,p,u,void 0));return}}for(O in u)u.hasOwnProperty(O)&&(p=u[O],p!=null&&wt(i,s,O,p,u,null))}function G_(i,s,u,p){switch(s){case"div":case"span":case"svg":case"path":case"a":case"g":case"p":case"li":break;case"input":var y=null,x=null,A=null,O=null,F=null,re=null,de=null;for(oe in u){var pe=u[oe];if(u.hasOwnProperty(oe)&&pe!=null)switch(oe){case"checked":break;case"value":break;case"defaultValue":F=pe;default:p.hasOwnProperty(oe)||wt(i,s,oe,null,p,pe)}}for(var ie in p){var oe=p[ie];if(pe=u[ie],p.hasOwnProperty(ie)&&(oe!=null||pe!=null))switch(ie){case"type":x=oe;break;case"name":y=oe;break;case"checked":re=oe;break;case"defaultChecked":de=oe;break;case"value":A=oe;break;case"defaultValue":O=oe;break;case"children":case"dangerouslySetInnerHTML":if(oe!=null)throw Error(r(137,s));break;default:oe!==pe&&wt(i,s,ie,oe,p,pe)}}Gf(i,A,O,F,re,de,x,y);return;case"select":oe=A=O=ie=null;for(x in u)if(F=u[x],u.hasOwnProperty(x)&&F!=null)switch(x){case"value":break;case"multiple":oe=F;default:p.hasOwnProperty(x)||wt(i,s,x,null,p,F)}for(y in p)if(x=p[y],F=u[y],p.hasOwnProperty(y)&&(x!=null||F!=null))switch(y){case"value":ie=x;break;case"defaultValue":O=x;break;case"multiple":A=x;default:x!==F&&wt(i,s,y,x,p,F)}s=O,u=A,p=oe,ie!=null?Ss(i,!!u,ie,!1):!!p!=!!u&&(s!=null?Ss(i,!!u,s,!0):Ss(i,!!u,u?[]:"",!1));return;case"textarea":oe=ie=null;for(O in u)if(y=u[O],u.hasOwnProperty(O)&&y!=null&&!p.hasOwnProperty(O))switch(O){case"value":break;case"children":break;default:wt(i,s,O,null,p,y)}for(A in p)if(y=p[A],x=u[A],p.hasOwnProperty(A)&&(y!=null||x!=null))switch(A){case"value":ie=y;break;case"defaultValue":oe=y;break;case"children":break;case"dangerouslySetInnerHTML":if(y!=null)throw Error(r(91));break;default:y!==x&&wt(i,s,A,y,p,x)}h0(i,ie,oe);return;case"option":for(var ke in u)ie=u[ke],u.hasOwnProperty(ke)&&ie!=null&&!p.hasOwnProperty(ke)&&(ke==="selected"?i.selected=!1:wt(i,s,ke,null,p,ie));for(F in p)ie=p[F],oe=u[F],p.hasOwnProperty(F)&&ie!==oe&&(ie!=null||oe!=null)&&(F==="selected"?i.selected=ie&&typeof ie!="function"&&typeof ie!="symbol":wt(i,s,F,ie,p,oe));return;case"img":case"link":case"area":case"base":case"br":case"col":case"embed":case"hr":case"keygen":case"meta":case"param":case"source":case"track":case"wbr":case"menuitem":for(var Ie in u)ie=u[Ie],u.hasOwnProperty(Ie)&&ie!=null&&!p.hasOwnProperty(Ie)&&wt(i,s,Ie,null,p,ie);for(re in p)if(ie=p[re],oe=u[re],p.hasOwnProperty(re)&&ie!==oe&&(ie!=null||oe!=null))switch(re){case"children":case"dangerouslySetInnerHTML":if(ie!=null)throw Error(r(137,s));break;default:wt(i,s,re,ie,p,oe)}return;default:if($f(s)){for(var Et in u)ie=u[Et],u.hasOwnProperty(Et)&&ie!==void 0&&!p.hasOwnProperty(Et)&&Mp(i,s,Et,void 0,p,ie);for(de in p)ie=p[de],oe=u[de],!p.hasOwnProperty(de)||ie===oe||ie===void 0&&oe===void 0||Mp(i,s,de,ie,p,oe);return}}for(var J in u)ie=u[J],u.hasOwnProperty(J)&&ie!=null&&!p.hasOwnProperty(J)&&wt(i,s,J,null,p,ie);for(pe in p)ie=p[pe],oe=u[pe],!p.hasOwnProperty(pe)||ie===oe||ie==null&&oe==null||wt(i,s,pe,ie,p,oe)}function vS(i){switch(i){case"css":case"script":case"font":case"img":case"image":case"input":case"link":return!0;default:return!1}}function K_(){if(typeof performance.getEntriesByType=="function"){for(var i=0,s=0,u=performance.getEntriesByType("resource"),p=0;p<u.length;p++){var y=u[p],x=y.transferSize,A=y.initiatorType,O=y.duration;if(x&&O&&vS(A)){for(A=0,O=y.responseEnd,p+=1;p<u.length;p++){var F=u[p],re=F.startTime;if(re>O)break;var de=F.transferSize,pe=F.initiatorType;de&&vS(pe)&&(F=F.responseEnd,A+=de*(F<O?1:(O-re)/(F-re)))}if(--p,s+=8*(x+A)/(y.duration/1e3),i++,10<i)break}}if(0<i)return s/i/1e6}return navigator.connection&&(i=navigator.connection.downlink,typeof i=="number")?i:5}var Dp=null,Ip=null;function Hc(i){return i.nodeType===9?i:i.ownerDocument}function yS(i){switch(i){case"http://www.w3.org/2000/svg":return 1;case"http://www.w3.org/1998/Math/MathML":return 2;default:return 0}}function bS(i,s){if(i===0)switch(s){case"svg":return 1;case"math":return 2;default:return 0}return i===1&&s==="foreignObject"?0:i}function Pp(i,s){return i==="textarea"||i==="noscript"||typeof s.children=="string"||typeof s.children=="number"||typeof s.children=="bigint"||typeof s.dangerouslySetInnerHTML=="object"&&s.dangerouslySetInnerHTML!==null&&s.dangerouslySetInnerHTML.__html!=null}var Lp=null;function $_(){var i=window.event;return i&&i.type==="popstate"?i===Lp?!1:(Lp=i,!0):(Lp=null,!1)}var xS=typeof setTimeout=="function"?setTimeout:void 0,Y_=typeof clearTimeout=="function"?clearTimeout:void 0,SS=typeof Promise=="function"?Promise:void 0,W_=typeof queueMicrotask=="function"?queueMicrotask:typeof SS<"u"?function(i){return SS.resolve(null).then(i).catch(X_)}:xS;function X_(i){setTimeout(function(){throw i})}function oa(i){return i==="head"}function wS(i,s){var u=s,p=0;do{var y=u.nextSibling;if(i.removeChild(u),y&&y.nodeType===8)if(u=y.data,u==="/$"||u==="/&"){if(p===0){i.removeChild(y),Zs(s);return}p--}else if(u==="$"||u==="$?"||u==="$~"||u==="$!"||u==="&")p++;else if(u==="html")Cl(i.ownerDocument.documentElement);else if(u==="head"){u=i.ownerDocument.head,Cl(u);for(var x=u.firstChild;x;){var A=x.nextSibling,O=x.nodeName;x[kn]||O==="SCRIPT"||O==="STYLE"||O==="LINK"&&x.rel.toLowerCase()==="stylesheet"||u.removeChild(x),x=A}}else u==="body"&&Cl(i.ownerDocument.body);u=y}while(u);Zs(s)}function ES(i,s){var u=i;i=0;do{var p=u.nextSibling;if(u.nodeType===1?s?(u._stashedDisplay=u.style.display,u.style.display="none"):(u.style.display=u._stashedDisplay||"",u.getAttribute("style")===""&&u.removeAttribute("style")):u.nodeType===3&&(s?(u._stashedText=u.nodeValue,u.nodeValue=""):u.nodeValue=u._stashedText||""),p&&p.nodeType===8)if(u=p.data,u==="/$"){if(i===0)break;i--}else u!=="$"&&u!=="$?"&&u!=="$~"&&u!=="$!"||i++;u=p}while(u)}function zp(i){var s=i.firstChild;for(s&&s.nodeType===10&&(s=s.nextSibling);s;){var u=s;switch(s=s.nextSibling,u.nodeName){case"HTML":case"HEAD":case"BODY":zp(u),cr(u);continue;case"SCRIPT":case"STYLE":continue;case"LINK":if(u.rel.toLowerCase()==="stylesheet")continue}i.removeChild(u)}}function Q_(i,s,u,p){for(;i.nodeType===1;){var y=u;if(i.nodeName.toLowerCase()!==s.toLowerCase()){if(!p&&(i.nodeName!=="INPUT"||i.type!=="hidden"))break}else if(p){if(!i[kn])switch(s){case"meta":if(!i.hasAttribute("itemprop"))break;return i;case"link":if(x=i.getAttribute("rel"),x==="stylesheet"&&i.hasAttribute("data-precedence"))break;if(x!==y.rel||i.getAttribute("href")!==(y.href==null||y.href===""?null:y.href)||i.getAttribute("crossorigin")!==(y.crossOrigin==null?null:y.crossOrigin)||i.getAttribute("title")!==(y.title==null?null:y.title))break;return i;case"style":if(i.hasAttribute("data-precedence"))break;return i;case"script":if(x=i.getAttribute("src"),(x!==(y.src==null?null:y.src)||i.getAttribute("type")!==(y.type==null?null:y.type)||i.getAttribute("crossorigin")!==(y.crossOrigin==null?null:y.crossOrigin))&&x&&i.hasAttribute("async")&&!i.hasAttribute("itemprop"))break;return i;default:return i}}else if(s==="input"&&i.type==="hidden"){var x=y.name==null?null:""+y.name;if(y.type==="hidden"&&i.getAttribute("name")===x)return i}else return i;if(i=br(i.nextSibling),i===null)break}return null}function J_(i,s,u){if(s==="")return null;for(;i.nodeType!==3;)if((i.nodeType!==1||i.nodeName!=="INPUT"||i.type!=="hidden")&&!u||(i=br(i.nextSibling),i===null))return null;return i}function TS(i,s){for(;i.nodeType!==8;)if((i.nodeType!==1||i.nodeName!=="INPUT"||i.type!=="hidden")&&!s||(i=br(i.nextSibling),i===null))return null;return i}function Up(i){return i.data==="$?"||i.data==="$~"}function Bp(i){return i.data==="$!"||i.data==="$?"&&i.ownerDocument.readyState!=="loading"}function Z_(i,s){var u=i.ownerDocument;if(i.data==="$~")i._reactRetry=s;else if(i.data!=="$?"||u.readyState!=="loading")s();else{var p=function(){s(),u.removeEventListener("DOMContentLoaded",p)};u.addEventListener("DOMContentLoaded",p),i._reactRetry=p}}function br(i){for(;i!=null;i=i.nextSibling){var s=i.nodeType;if(s===1||s===3)break;if(s===8){if(s=i.data,s==="$"||s==="$!"||s==="$?"||s==="$~"||s==="&"||s==="F!"||s==="F")break;if(s==="/$"||s==="/&")return null}}return i}var Vp=null;function kS(i){i=i.nextSibling;for(var s=0;i;){if(i.nodeType===8){var u=i.data;if(u==="/$"||u==="/&"){if(s===0)return br(i.nextSibling);s--}else u!=="$"&&u!=="$!"&&u!=="$?"&&u!=="$~"&&u!=="&"||s++}i=i.nextSibling}return null}function CS(i){i=i.previousSibling;for(var s=0;i;){if(i.nodeType===8){var u=i.data;if(u==="$"||u==="$!"||u==="$?"||u==="$~"||u==="&"){if(s===0)return i;s--}else u!=="/$"&&u!=="/&"||s++}i=i.previousSibling}return null}function AS(i,s,u){switch(s=Hc(u),i){case"html":if(i=s.documentElement,!i)throw Error(r(452));return i;case"head":if(i=s.head,!i)throw Error(r(453));return i;case"body":if(i=s.body,!i)throw Error(r(454));return i;default:throw Error(r(451))}}function Cl(i){for(var s=i.attributes;s.length;)i.removeAttributeNode(s[0]);cr(i)}var xr=new Map,NS=new Set;function qc(i){return typeof i.getRootNode=="function"?i.getRootNode():i.nodeType===9?i:i.ownerDocument}var Ii=X.d;X.d={f:eO,r:tO,D:nO,C:rO,L:iO,m:aO,X:oO,S:sO,M:lO};function eO(){var i=Ii.f(),s=Ic();return i||s}function tO(i){var s=mi(i);s!==null&&s.tag===5&&s.type==="form"?Gb(s):Ii.r(i)}var Xs=typeof document>"u"?null:document;function jS(i,s,u){var p=Xs;if(p&&typeof s=="string"&&s){var y=fr(s);y='link[rel="'+i+'"][href="'+y+'"]',typeof u=="string"&&(y+='[crossorigin="'+u+'"]'),NS.has(y)||(NS.add(y),i={rel:i,crossOrigin:u,href:s},p.querySelector(y)===null&&(s=p.createElement("link"),bn(s,"link",i),Fe(s),p.head.appendChild(s)))}}function nO(i){Ii.D(i),jS("dns-prefetch",i,null)}function rO(i,s){Ii.C(i,s),jS("preconnect",i,s)}function iO(i,s,u){Ii.L(i,s,u);var p=Xs;if(p&&i&&s){var y='link[rel="preload"][as="'+fr(s)+'"]';s==="image"&&u&&u.imageSrcSet?(y+='[imagesrcset="'+fr(u.imageSrcSet)+'"]',typeof u.imageSizes=="string"&&(y+='[imagesizes="'+fr(u.imageSizes)+'"]')):y+='[href="'+fr(i)+'"]';var x=y;switch(s){case"style":x=Qs(i);break;case"script":x=Js(i)}xr.has(x)||(i=g({rel:"preload",href:s==="image"&&u&&u.imageSrcSet?void 0:i,as:s},u),xr.set(x,i),p.querySelector(y)!==null||s==="style"&&p.querySelector(Al(x))||s==="script"&&p.querySelector(Nl(x))||(s=p.createElement("link"),bn(s,"link",i),Fe(s),p.head.appendChild(s)))}}function aO(i,s){Ii.m(i,s);var u=Xs;if(u&&i){var p=s&&typeof s.as=="string"?s.as:"script",y='link[rel="modulepreload"][as="'+fr(p)+'"][href="'+fr(i)+'"]',x=y;switch(p){case"audioworklet":case"paintworklet":case"serviceworker":case"sharedworker":case"worker":case"script":x=Js(i)}if(!xr.has(x)&&(i=g({rel:"modulepreload",href:i},s),xr.set(x,i),u.querySelector(y)===null)){switch(p){case"audioworklet":case"paintworklet":case"serviceworker":case"sharedworker":case"worker":case"script":if(u.querySelector(Nl(x)))return}p=u.createElement("link"),bn(p,"link",i),Fe(p),u.head.appendChild(p)}}}function sO(i,s,u){Ii.S(i,s,u);var p=Xs;if(p&&i){var y=Ve(p).hoistableStyles,x=Qs(i);s=s||"default";var A=y.get(x);if(!A){var O={loading:0,preload:null};if(A=p.querySelector(Al(x)))O.loading=5;else{i=g({rel:"stylesheet",href:i,"data-precedence":s},u),(u=xr.get(x))&&Fp(i,u);var F=A=p.createElement("link");Fe(F),bn(F,"link",i),F._p=new Promise(function(re,de){F.onload=re,F.onerror=de}),F.addEventListener("load",function(){O.loading|=1}),F.addEventListener("error",function(){O.loading|=2}),O.loading|=4,Gc(A,s,p)}A={type:"stylesheet",instance:A,count:1,state:O},y.set(x,A)}}}function oO(i,s){Ii.X(i,s);var u=Xs;if(u&&i){var p=Ve(u).hoistableScripts,y=Js(i),x=p.get(y);x||(x=u.querySelector(Nl(y)),x||(i=g({src:i,async:!0},s),(s=xr.get(y))&&Hp(i,s),x=u.createElement("script"),Fe(x),bn(x,"link",i),u.head.appendChild(x)),x={type:"script",instance:x,count:1,state:null},p.set(y,x))}}function lO(i,s){Ii.M(i,s);var u=Xs;if(u&&i){var p=Ve(u).hoistableScripts,y=Js(i),x=p.get(y);x||(x=u.querySelector(Nl(y)),x||(i=g({src:i,async:!0,type:"module"},s),(s=xr.get(y))&&Hp(i,s),x=u.createElement("script"),Fe(x),bn(x,"link",i),u.head.appendChild(x)),x={type:"script",instance:x,count:1,state:null},p.set(y,x))}}function RS(i,s,u,p){var y=(y=Se.current)?qc(y):null;if(!y)throw Error(r(446));switch(i){case"meta":case"title":return null;case"style":return typeof u.precedence=="string"&&typeof u.href=="string"?(s=Qs(u.href),u=Ve(y).hoistableStyles,p=u.get(s),p||(p={type:"style",instance:null,count:0,state:null},u.set(s,p)),p):{type:"void",instance:null,count:0,state:null};case"link":if(u.rel==="stylesheet"&&typeof u.href=="string"&&typeof u.precedence=="string"){i=Qs(u.href);var x=Ve(y).hoistableStyles,A=x.get(i);if(A||(y=y.ownerDocument||y,A={type:"stylesheet",instance:null,count:0,state:{loading:0,preload:null}},x.set(i,A),(x=y.querySelector(Al(i)))&&!x._p&&(A.instance=x,A.state.loading=5),xr.has(i)||(u={rel:"preload",as:"style",href:u.href,crossOrigin:u.crossOrigin,integrity:u.integrity,media:u.media,hrefLang:u.hrefLang,referrerPolicy:u.referrerPolicy},xr.set(i,u),x||uO(y,i,u,A.state))),s&&p===null)throw Error(r(528,""));return A}if(s&&p!==null)throw Error(r(529,""));return null;case"script":return s=u.async,u=u.src,typeof u=="string"&&s&&typeof s!="function"&&typeof s!="symbol"?(s=Js(u),u=Ve(y).hoistableScripts,p=u.get(s),p||(p={type:"script",instance:null,count:0,state:null},u.set(s,p)),p):{type:"void",instance:null,count:0,state:null};default:throw Error(r(444,i))}}function Qs(i){return'href="'+fr(i)+'"'}function Al(i){return'link[rel="stylesheet"]['+i+"]"}function _S(i){return g({},i,{"data-precedence":i.precedence,precedence:null})}function uO(i,s,u,p){i.querySelector('link[rel="preload"][as="style"]['+s+"]")?p.loading=1:(s=i.createElement("link"),p.preload=s,s.addEventListener("load",function(){return p.loading|=1}),s.addEventListener("error",function(){return p.loading|=2}),bn(s,"link",u),Fe(s),i.head.appendChild(s))}function Js(i){return'[src="'+fr(i)+'"]'}function Nl(i){return"script[async]"+i}function OS(i,s,u){if(s.count++,s.instance===null)switch(s.type){case"style":var p=i.querySelector('style[data-href~="'+fr(u.href)+'"]');if(p)return s.instance=p,Fe(p),p;var y=g({},u,{"data-href":u.href,"data-precedence":u.precedence,href:null,precedence:null});return p=(i.ownerDocument||i).createElement("style"),Fe(p),bn(p,"style",y),Gc(p,u.precedence,i),s.instance=p;case"stylesheet":y=Qs(u.href);var x=i.querySelector(Al(y));if(x)return s.state.loading|=4,s.instance=x,Fe(x),x;p=_S(u),(y=xr.get(y))&&Fp(p,y),x=(i.ownerDocument||i).createElement("link"),Fe(x);var A=x;return A._p=new Promise(function(O,F){A.onload=O,A.onerror=F}),bn(x,"link",p),s.state.loading|=4,Gc(x,u.precedence,i),s.instance=x;case"script":return x=Js(u.src),(y=i.querySelector(Nl(x)))?(s.instance=y,Fe(y),y):(p=u,(y=xr.get(x))&&(p=g({},u),Hp(p,y)),i=i.ownerDocument||i,y=i.createElement("script"),Fe(y),bn(y,"link",p),i.head.appendChild(y),s.instance=y);case"void":return null;default:throw Error(r(443,s.type))}else s.type==="stylesheet"&&(s.state.loading&4)===0&&(p=s.instance,s.state.loading|=4,Gc(p,u.precedence,i));return s.instance}function Gc(i,s,u){for(var p=u.querySelectorAll('link[rel="stylesheet"][data-precedence],style[data-precedence]'),y=p.length?p[p.length-1]:null,x=y,A=0;A<p.length;A++){var O=p[A];if(O.dataset.precedence===s)x=O;else if(x!==y)break}x?x.parentNode.insertBefore(i,x.nextSibling):(s=u.nodeType===9?u.head:u,s.insertBefore(i,s.firstChild))}function Fp(i,s){i.crossOrigin==null&&(i.crossOrigin=s.crossOrigin),i.referrerPolicy==null&&(i.referrerPolicy=s.referrerPolicy),i.title==null&&(i.title=s.title)}function Hp(i,s){i.crossOrigin==null&&(i.crossOrigin=s.crossOrigin),i.referrerPolicy==null&&(i.referrerPolicy=s.referrerPolicy),i.integrity==null&&(i.integrity=s.integrity)}var Kc=null;function MS(i,s,u){if(Kc===null){var p=new Map,y=Kc=new Map;y.set(u,p)}else y=Kc,p=y.get(u),p||(p=new Map,y.set(u,p));if(p.has(i))return p;for(p.set(i,null),u=u.getElementsByTagName(i),y=0;y<u.length;y++){var x=u[y];if(!(x[kn]||x[un]||i==="link"&&x.getAttribute("rel")==="stylesheet")&&x.namespaceURI!=="http://www.w3.org/2000/svg"){var A=x.getAttribute(s)||"";A=i+A;var O=p.get(A);O?O.push(x):p.set(A,[x])}}return p}function DS(i,s,u){i=i.ownerDocument||i,i.head.insertBefore(u,s==="title"?i.querySelector("head > title"):null)}function cO(i,s,u){if(u===1||s.itemProp!=null)return!1;switch(i){case"meta":case"title":return!0;case"style":if(typeof s.precedence!="string"||typeof s.href!="string"||s.href==="")break;return!0;case"link":if(typeof s.rel!="string"||typeof s.href!="string"||s.href===""||s.onLoad||s.onError)break;return s.rel==="stylesheet"?(i=s.disabled,typeof s.precedence=="string"&&i==null):!0;case"script":if(s.async&&typeof s.async!="function"&&typeof s.async!="symbol"&&!s.onLoad&&!s.onError&&s.src&&typeof s.src=="string")return!0}return!1}function IS(i){return!(i.type==="stylesheet"&&(i.state.loading&3)===0)}function dO(i,s,u,p){if(u.type==="stylesheet"&&(typeof p.media!="string"||matchMedia(p.media).matches!==!1)&&(u.state.loading&4)===0){if(u.instance===null){var y=Qs(p.href),x=s.querySelector(Al(y));if(x){s=x._p,s!==null&&typeof s=="object"&&typeof s.then=="function"&&(i.count++,i=$c.bind(i),s.then(i,i)),u.state.loading|=4,u.instance=x,Fe(x);return}x=s.ownerDocument||s,p=_S(p),(y=xr.get(y))&&Fp(p,y),x=x.createElement("link"),Fe(x);var A=x;A._p=new Promise(function(O,F){A.onload=O,A.onerror=F}),bn(x,"link",p),u.instance=x}i.stylesheets===null&&(i.stylesheets=new Map),i.stylesheets.set(u,s),(s=u.state.preload)&&(u.state.loading&3)===0&&(i.count++,u=$c.bind(i),s.addEventListener("load",u),s.addEventListener("error",u))}}var qp=0;function fO(i,s){return i.stylesheets&&i.count===0&&Wc(i,i.stylesheets),0<i.count||0<i.imgCount?function(u){var p=setTimeout(function(){if(i.stylesheets&&Wc(i,i.stylesheets),i.unsuspend){var x=i.unsuspend;i.unsuspend=null,x()}},6e4+s);0<i.imgBytes&&qp===0&&(qp=62500*K_());var y=setTimeout(function(){if(i.waitingForImages=!1,i.count===0&&(i.stylesheets&&Wc(i,i.stylesheets),i.unsuspend)){var x=i.unsuspend;i.unsuspend=null,x()}},(i.imgBytes>qp?50:800)+s);return i.unsuspend=u,function(){i.unsuspend=null,clearTimeout(p),clearTimeout(y)}}:null}function $c(){if(this.count--,this.count===0&&(this.imgCount===0||!this.waitingForImages)){if(this.stylesheets)Wc(this,this.stylesheets);else if(this.unsuspend){var i=this.unsuspend;this.unsuspend=null,i()}}}var Yc=null;function Wc(i,s){i.stylesheets=null,i.unsuspend!==null&&(i.count++,Yc=new Map,s.forEach(hO,i),Yc=null,$c.call(i))}function hO(i,s){if(!(s.state.loading&4)){var u=Yc.get(i);if(u)var p=u.get(null);else{u=new Map,Yc.set(i,u);for(var y=i.querySelectorAll("link[data-precedence],style[data-precedence]"),x=0;x<y.length;x++){var A=y[x];(A.nodeName==="LINK"||A.getAttribute("media")!=="not all")&&(u.set(A.dataset.precedence,A),p=A)}p&&u.set(null,p)}y=s.instance,A=y.getAttribute("data-precedence"),x=u.get(A)||p,x===p&&u.set(null,y),u.set(A,y),this.count++,p=$c.bind(this),y.addEventListener("load",p),y.addEventListener("error",p),x?x.parentNode.insertBefore(y,x.nextSibling):(i=i.nodeType===9?i.head:i,i.insertBefore(y,i.firstChild)),s.state.loading|=4}}var jl={$$typeof:k,Provider:null,Consumer:null,_currentValue:le,_currentValue2:le,_threadCount:0};function pO(i,s,u,p,y,x,A,O,F){this.tag=1,this.containerInfo=i,this.pingCache=this.current=this.pendingChildren=null,this.timeoutHandle=-1,this.callbackNode=this.next=this.pendingContext=this.context=this.cancelPendingCommit=null,this.callbackPriority=0,this.expirationTimes=Vo(-1),this.entangledLanes=this.shellSuspendCounter=this.errorRecoveryDisabledLanes=this.expiredLanes=this.warmLanes=this.pingedLanes=this.suspendedLanes=this.pendingLanes=0,this.entanglements=Vo(0),this.hiddenUpdates=Vo(null),this.identifierPrefix=p,this.onUncaughtError=y,this.onCaughtError=x,this.onRecoverableError=A,this.pooledCache=null,this.pooledCacheLanes=0,this.formState=F,this.incompleteTransitions=new Map}function PS(i,s,u,p,y,x,A,O,F,re,de,pe){return i=new pO(i,s,u,A,F,re,de,pe,O),s=1,x===!0&&(s|=24),x=Jn(3,null,null,s),i.current=x,x.stateNode=i,s=Eh(),s.refCount++,i.pooledCache=s,s.refCount++,x.memoizedState={element:p,isDehydrated:u,cache:s},Ah(x),i}function LS(i){return i?(i=js,i):js}function zS(i,s,u,p,y,x){y=LS(y),p.context===null?p.context=y:p.pendingContext=y,p=Xi(s),p.payload={element:u},x=x===void 0?null:x,x!==null&&(p.callback=x),u=Qi(i,p,s),u!==null&&($n(u,i,s),ol(u,i,s))}function US(i,s){if(i=i.memoizedState,i!==null&&i.dehydrated!==null){var u=i.retryLane;i.retryLane=u!==0&&u<s?u:s}}function Gp(i,s){US(i,s),(i=i.alternate)&&US(i,s)}function BS(i){if(i.tag===13||i.tag===31){var s=Va(i,67108864);s!==null&&$n(s,i,67108864),Gp(i,67108864)}}function VS(i){if(i.tag===13||i.tag===31){var s=rr();s=Ho(s);var u=Va(i,s);u!==null&&$n(u,i,s),Gp(i,s)}}var Xc=!0;function mO(i,s,u,p){var y=V.T;V.T=null;var x=X.p;try{X.p=2,Kp(i,s,u,p)}finally{X.p=x,V.T=y}}function gO(i,s,u,p){var y=V.T;V.T=null;var x=X.p;try{X.p=8,Kp(i,s,u,p)}finally{X.p=x,V.T=y}}function Kp(i,s,u,p){if(Xc){var y=$p(p);if(y===null)Op(i,s,p,Qc,u),HS(i,p);else if(yO(y,i,s,u,p))p.stopPropagation();else if(HS(i,p),s&4&&-1<vO.indexOf(i)){for(;y!==null;){var x=mi(y);if(x!==null)switch(x.tag){case 3:if(x=x.stateNode,x.current.memoizedState.isDehydrated){var A=$r(x.pendingLanes);if(A!==0){var O=x;for(O.pendingLanes|=2,O.entangledLanes|=2;A;){var F=1<<31-Y(A);O.entanglements[1]|=F,A&=~F}ei(x),(pt&6)===0&&(Mc=Me()+500,El(0))}}break;case 31:case 13:O=Va(x,2),O!==null&&$n(O,x,2),Ic(),Gp(x,2)}if(x=$p(p),x===null&&Op(i,s,p,Qc,u),x===y)break;y=x}y!==null&&p.stopPropagation()}else Op(i,s,p,null,u)}}function $p(i){return i=Wf(i),Yp(i)}var Qc=null;function Yp(i){if(Qc=null,i=pn(i),i!==null){var s=o(i);if(s===null)i=null;else{var u=s.tag;if(u===13){if(i=l(s),i!==null)return i;i=null}else if(u===31){if(i=c(s),i!==null)return i;i=null}else if(u===3){if(s.stateNode.current.memoizedState.isDehydrated)return s.tag===3?s.stateNode.containerInfo:null;i=null}else s!==i&&(i=null)}}return Qc=i,null}function FS(i){switch(i){case"beforetoggle":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"toggle":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 2;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"touchmove":case"wheel":case"mouseenter":case"mouseleave":case"pointerenter":case"pointerleave":return 8;case"message":switch(Q()){case q:return 2;case ae:return 8;case Te:case Ee:return 32;case Be:return 268435456;default:return 32}default:return 32}}var Wp=!1,la=null,ua=null,ca=null,Rl=new Map,_l=new Map,da=[],vO="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".split(" ");function HS(i,s){switch(i){case"focusin":case"focusout":la=null;break;case"dragenter":case"dragleave":ua=null;break;case"mouseover":case"mouseout":ca=null;break;case"pointerover":case"pointerout":Rl.delete(s.pointerId);break;case"gotpointercapture":case"lostpointercapture":_l.delete(s.pointerId)}}function Ol(i,s,u,p,y,x){return i===null||i.nativeEvent!==x?(i={blockedOn:s,domEventName:u,eventSystemFlags:p,nativeEvent:x,targetContainers:[y]},s!==null&&(s=mi(s),s!==null&&BS(s)),i):(i.eventSystemFlags|=p,s=i.targetContainers,y!==null&&s.indexOf(y)===-1&&s.push(y),i)}function yO(i,s,u,p,y){switch(s){case"focusin":return la=Ol(la,i,s,u,p,y),!0;case"dragenter":return ua=Ol(ua,i,s,u,p,y),!0;case"mouseover":return ca=Ol(ca,i,s,u,p,y),!0;case"pointerover":var x=y.pointerId;return Rl.set(x,Ol(Rl.get(x)||null,i,s,u,p,y)),!0;case"gotpointercapture":return x=y.pointerId,_l.set(x,Ol(_l.get(x)||null,i,s,u,p,y)),!0}return!1}function qS(i){var s=pn(i.target);if(s!==null){var u=o(s);if(u!==null){if(s=u.tag,s===13){if(s=l(u),s!==null){i.blockedOn=s,Go(i.priority,function(){VS(u)});return}}else if(s===31){if(s=c(u),s!==null){i.blockedOn=s,Go(i.priority,function(){VS(u)});return}}else if(s===3&&u.stateNode.current.memoizedState.isDehydrated){i.blockedOn=u.tag===3?u.stateNode.containerInfo:null;return}}}i.blockedOn=null}function Jc(i){if(i.blockedOn!==null)return!1;for(var s=i.targetContainers;0<s.length;){var u=$p(i.nativeEvent);if(u===null){u=i.nativeEvent;var p=new u.constructor(u.type,u);Yf=p,u.target.dispatchEvent(p),Yf=null}else return s=mi(u),s!==null&&BS(s),i.blockedOn=u,!1;s.shift()}return!0}function GS(i,s,u){Jc(i)&&u.delete(s)}function bO(){Wp=!1,la!==null&&Jc(la)&&(la=null),ua!==null&&Jc(ua)&&(ua=null),ca!==null&&Jc(ca)&&(ca=null),Rl.forEach(GS),_l.forEach(GS)}function Zc(i,s){i.blockedOn===s&&(i.blockedOn=null,Wp||(Wp=!0,e.unstable_scheduleCallback(e.unstable_NormalPriority,bO)))}var ed=null;function KS(i){ed!==i&&(ed=i,e.unstable_scheduleCallback(e.unstable_NormalPriority,function(){ed===i&&(ed=null);for(var s=0;s<i.length;s+=3){var u=i[s],p=i[s+1],y=i[s+2];if(typeof p!="function"){if(Yp(p||u)===null)continue;break}var x=mi(u);x!==null&&(i.splice(s,3),s-=3,$h(x,{pending:!0,data:y,method:u.method,action:p},p,y))}}))}function Zs(i){function s(F){return Zc(F,i)}la!==null&&Zc(la,i),ua!==null&&Zc(ua,i),ca!==null&&Zc(ca,i),Rl.forEach(s),_l.forEach(s);for(var u=0;u<da.length;u++){var p=da[u];p.blockedOn===i&&(p.blockedOn=null)}for(;0<da.length&&(u=da[0],u.blockedOn===null);)qS(u),u.blockedOn===null&&da.shift();if(u=(i.ownerDocument||i).$$reactFormReplay,u!=null)for(p=0;p<u.length;p+=3){var y=u[p],x=u[p+1],A=y[$]||null;if(typeof x=="function")A||KS(u);else if(A){var O=null;if(x&&x.hasAttribute("formAction")){if(y=x,A=x[$]||null)O=A.formAction;else if(Yp(y)!==null)continue}else O=A.action;typeof O=="function"?u[p+1]=O:(u.splice(p,3),p-=3),KS(u)}}}function $S(){function i(x){x.canIntercept&&x.info==="react-transition"&&x.intercept({handler:function(){return new Promise(function(A){return y=A})},focusReset:"manual",scroll:"manual"})}function s(){y!==null&&(y(),y=null),p||setTimeout(u,20)}function u(){if(!p&&!navigation.transition){var x=navigation.currentEntry;x&&x.url!=null&&navigation.navigate(x.url,{state:x.getState(),info:"react-transition",history:"replace"})}}if(typeof navigation=="object"){var p=!1,y=null;return navigation.addEventListener("navigate",i),navigation.addEventListener("navigatesuccess",s),navigation.addEventListener("navigateerror",s),setTimeout(u,100),function(){p=!0,navigation.removeEventListener("navigate",i),navigation.removeEventListener("navigatesuccess",s),navigation.removeEventListener("navigateerror",s),y!==null&&(y(),y=null)}}}function Xp(i){this._internalRoot=i}td.prototype.render=Xp.prototype.render=function(i){var s=this._internalRoot;if(s===null)throw Error(r(409));var u=s.current,p=rr();zS(u,p,i,s,null,null)},td.prototype.unmount=Xp.prototype.unmount=function(){var i=this._internalRoot;if(i!==null){this._internalRoot=null;var s=i.containerInfo;zS(i.current,2,null,i,null,null),Ic(),s[me]=null}};function td(i){this._internalRoot=i}td.prototype.unstable_scheduleHydration=function(i){if(i){var s=Ku();i={blockedOn:null,target:i,priority:s};for(var u=0;u<da.length&&s!==0&&s<da[u].priority;u++);da.splice(u,0,i),u===0&&qS(i)}};var YS=t.version;if(YS!=="19.2.4")throw Error(r(527,YS,"19.2.4"));X.findDOMNode=function(i){var s=i._reactInternals;if(s===void 0)throw typeof i.render=="function"?Error(r(188)):(i=Object.keys(i).join(","),Error(r(268,i)));return i=f(s),i=i!==null?m(i):null,i=i===null?null:i.stateNode,i};var xO={bundleType:0,version:"19.2.4",rendererPackageName:"react-dom",currentDispatcherRef:V,reconcilerVersion:"19.2.4"};if(typeof __REACT_DEVTOOLS_GLOBAL_HOOK__<"u"){var nd=__REACT_DEVTOOLS_GLOBAL_HOOK__;if(!nd.isDisabled&&nd.supportsFiber)try{gt=nd.inject(xO),Lt=nd}catch{}}return Dl.createRoot=function(i,s){if(!a(i))throw Error(r(299));var u=!1,p="",y=tx,x=nx,A=rx;return s!=null&&(s.unstable_strictMode===!0&&(u=!0),s.identifierPrefix!==void 0&&(p=s.identifierPrefix),s.onUncaughtError!==void 0&&(y=s.onUncaughtError),s.onCaughtError!==void 0&&(x=s.onCaughtError),s.onRecoverableError!==void 0&&(A=s.onRecoverableError)),s=PS(i,1,!1,null,null,u,p,null,y,x,A,$S),i[me]=s.current,_p(i),new Xp(s)},Dl.hydrateRoot=function(i,s,u){if(!a(i))throw Error(r(299));var p=!1,y="",x=tx,A=nx,O=rx,F=null;return u!=null&&(u.unstable_strictMode===!0&&(p=!0),u.identifierPrefix!==void 0&&(y=u.identifierPrefix),u.onUncaughtError!==void 0&&(x=u.onUncaughtError),u.onCaughtError!==void 0&&(A=u.onCaughtError),u.onRecoverableError!==void 0&&(O=u.onRecoverableError),u.formState!==void 0&&(F=u.formState)),s=PS(i,1,!0,s,u??null,p,y,F,x,A,O,$S),s.context=LS(null),u=s.current,p=rr(),p=Ho(p),y=Xi(p),y.callback=null,Qi(u,y,p),u=p,s.current.lanes=u,Ia(s,u),ei(s),i[me]=s.current,_p(i),new td(s)},Dl.version="19.2.4",Dl}var iw;function _O(){if(iw)return Zp.exports;iw=1;function e(){if(!(typeof __REACT_DEVTOOLS_GLOBAL_HOOK__>"u"||typeof __REACT_DEVTOOLS_GLOBAL_HOOK__.checkDCE!="function"))try{__REACT_DEVTOOLS_GLOBAL_HOOK__.checkDCE(e)}catch(t){console.error(t)}}return e(),Zp.exports=RO(),Zp.exports}var OO=_O();const MO=jo(OO);var aw="popstate";function sw(e){return typeof e=="object"&&e!=null&&"pathname"in e&&"search"in e&&"hash"in e&&"state"in e&&"key"in e}function DO(e={}){function t(r,a){let o=a.state?.masked,{pathname:l,search:c,hash:d}=o||r.location;return hg("",{pathname:l,search:c,hash:d},a.state&&a.state.usr||null,a.state&&a.state.key||"default",o?{pathname:r.location.pathname,search:r.location.search,hash:r.location.hash}:void 0)}function n(r,a){return typeof a=="string"?a:bu(a)}return PO(t,n,null,e)}function Ut(e,t){if(e===!1||e===null||typeof e>"u")throw new Error(t)}function Gr(e,t){if(!e){typeof console<"u"&&console.warn(t);try{throw new Error(t)}catch{}}}function IO(){return Math.random().toString(36).substring(2,10)}function ow(e,t){return{usr:e.state,key:e.key,idx:t,masked:e.unstable_mask?{pathname:e.pathname,search:e.search,hash:e.hash}:void 0}}function hg(e,t,n=null,r,a){return{pathname:typeof e=="string"?e:e.pathname,search:"",hash:"",...typeof t=="string"?Ro(t):t,state:n,key:t&&t.key||r||IO(),unstable_mask:a}}function bu({pathname:e="/",search:t="",hash:n=""}){return t&&t!=="?"&&(e+=t.charAt(0)==="?"?t:"?"+t),n&&n!=="#"&&(e+=n.charAt(0)==="#"?n:"#"+n),e}function Ro(e){let t={};if(e){let n=e.indexOf("#");n>=0&&(t.hash=e.substring(n),e=e.substring(0,n));let r=e.indexOf("?");r>=0&&(t.search=e.substring(r),e=e.substring(0,r)),e&&(t.pathname=e)}return t}function PO(e,t,n,r={}){let{window:a=document.defaultView,v5Compat:o=!1}=r,l=a.history,c="POP",d=null,f=m();f==null&&(f=0,l.replaceState({...l.state,idx:f},""));function m(){return(l.state||{idx:null}).idx}function g(){c="POP";let E=m(),T=E==null?null:E-f;f=E,d&&d({action:c,location:w.location,delta:T})}function v(E,T){c="PUSH";let C=sw(E)?E:hg(w.location,E,T);f=m()+1;let k=ow(C,f),j=w.createHref(C.unstable_mask||C);try{l.pushState(k,"",j)}catch(N){if(N instanceof DOMException&&N.name==="DataCloneError")throw N;a.location.assign(j)}o&&d&&d({action:c,location:w.location,delta:1})}function b(E,T){c="REPLACE";let C=sw(E)?E:hg(w.location,E,T);f=m();let k=ow(C,f),j=w.createHref(C.unstable_mask||C);l.replaceState(k,"",j),o&&d&&d({action:c,location:w.location,delta:0})}function S(E){return LO(E)}let w={get action(){return c},get location(){return e(a,l)},listen(E){if(d)throw new Error("A history only accepts one active listener");return a.addEventListener(aw,g),d=E,()=>{a.removeEventListener(aw,g),d=null}},createHref(E){return t(a,E)},createURL:S,encodeLocation(E){let T=S(E);return{pathname:T.pathname,search:T.search,hash:T.hash}},push:v,replace:b,go(E){return l.go(E)}};return w}function LO(e,t=!1){let n="http://localhost";typeof window<"u"&&(n=window.location.origin!=="null"?window.location.origin:window.location.href),Ut(n,"No window.location.(origin|href) available to create URL");let r=typeof e=="string"?e:bu(e);return r=r.replace(/ $/,"%20"),!t&&r.startsWith("//")&&(r=n+r),new URL(r,n)}function Ok(e,t,n="/"){return zO(e,t,n,!1)}function zO(e,t,n,r){let a=typeof t=="string"?Ro(t):t,o=Bi(a.pathname||"/",n);if(o==null)return null;let l=Mk(e);UO(l);let c=null;for(let d=0;c==null&&d<l.length;++d){let f=XO(o);c=YO(l[d],f,r)}return c}function Mk(e,t=[],n=[],r="",a=!1){let o=(l,c,d=a,f)=>{let m={relativePath:f===void 0?l.path||"":f,caseSensitive:l.caseSensitive===!0,childrenIndex:c,route:l};if(m.relativePath.startsWith("/")){if(!m.relativePath.startsWith(r)&&d)return;Ut(m.relativePath.startsWith(r),`Absolute route path "${m.relativePath}" nested under path "${r}" is not valid. An absolute child route path must start with the combined path of all its parent routes.`),m.relativePath=m.relativePath.slice(r.length)}let g=oi([r,m.relativePath]),v=n.concat(m);l.children&&l.children.length>0&&(Ut(l.index!==!0,`Index routes must not have child routes. Please remove all child routes from route path "${g}".`),Mk(l.children,t,v,g,d)),!(l.path==null&&!l.index)&&t.push({path:g,score:KO(g,l.index),routesMeta:v})};return e.forEach((l,c)=>{if(l.path===""||!l.path?.includes("?"))o(l,c);else for(let d of Dk(l.path))o(l,c,!0,d)}),t}function Dk(e){let t=e.split("/");if(t.length===0)return[];let[n,...r]=t,a=n.endsWith("?"),o=n.replace(/\?$/,"");if(r.length===0)return a?[o,""]:[o];let l=Dk(r.join("/")),c=[];return c.push(...l.map(d=>d===""?o:[o,d].join("/"))),a&&c.push(...l),c.map(d=>e.startsWith("/")&&d===""?"/":d)}function UO(e){e.sort((t,n)=>t.score!==n.score?n.score-t.score:$O(t.routesMeta.map(r=>r.childrenIndex),n.routesMeta.map(r=>r.childrenIndex)))}var BO=/^:[\w-]+$/,VO=3,FO=2,HO=1,qO=10,GO=-2,lw=e=>e==="*";function KO(e,t){let n=e.split("/"),r=n.length;return n.some(lw)&&(r+=GO),t&&(r+=FO),n.filter(a=>!lw(a)).reduce((a,o)=>a+(BO.test(o)?VO:o===""?HO:qO),r)}function $O(e,t){return e.length===t.length&&e.slice(0,-1).every((r,a)=>r===t[a])?e[e.length-1]-t[t.length-1]:0}function YO(e,t,n=!1){let{routesMeta:r}=e,a={},o="/",l=[];for(let c=0;c<r.length;++c){let d=r[c],f=c===r.length-1,m=o==="/"?t:t.slice(o.length)||"/",g=Qd({path:d.relativePath,caseSensitive:d.caseSensitive,end:f},m),v=d.route;if(!g&&f&&n&&!r[r.length-1].route.index&&(g=Qd({path:d.relativePath,caseSensitive:d.caseSensitive,end:!1},m)),!g)return null;Object.assign(a,g.params),l.push({params:a,pathname:oi([o,g.pathname]),pathnameBase:eM(oi([o,g.pathnameBase])),route:v}),g.pathnameBase!=="/"&&(o=oi([o,g.pathnameBase]))}return l}function Qd(e,t){typeof e=="string"&&(e={path:e,caseSensitive:!1,end:!0});let[n,r]=WO(e.path,e.caseSensitive,e.end),a=t.match(n);if(!a)return null;let o=a[0],l=o.replace(/(.)\/+$/,"$1"),c=a.slice(1);return{params:r.reduce((f,{paramName:m,isOptional:g},v)=>{if(m==="*"){let S=c[v]||"";l=o.slice(0,o.length-S.length).replace(/(.)\/+$/,"$1")}const b=c[v];return g&&!b?f[m]=void 0:f[m]=(b||"").replace(/%2F/g,"/"),f},{}),pathname:o,pathnameBase:l,pattern:e}}function WO(e,t=!1,n=!0){Gr(e==="*"||!e.endsWith("*")||e.endsWith("/*"),`Route path "${e}" will be treated as if it were "${e.replace(/\*$/,"/*")}" because the \`*\` character must always follow a \`/\` in the pattern. To get rid of this warning, please change the route path to "${e.replace(/\*$/,"/*")}".`);let r=[],a="^"+e.replace(/\/*\*?$/,"").replace(/^\/*/,"/").replace(/[\\.*+^${}|()[\]]/g,"\\$&").replace(/\/:([\w-]+)(\?)?/g,(l,c,d,f,m)=>{if(r.push({paramName:c,isOptional:d!=null}),d){let g=m.charAt(f+l.length);return g&&g!=="/"?"/([^\\/]*)":"(?:/([^\\/]*))?"}return"/([^\\/]+)"}).replace(/\/([\w-]+)\?(\/|$)/g,"(/$1)?$2");return e.endsWith("*")?(r.push({paramName:"*"}),a+=e==="*"||e==="/*"?"(.*)$":"(?:\\/(.+)|\\/*)$"):n?a+="\\/*$":e!==""&&e!=="/"&&(a+="(?:(?=\\/|$))"),[new RegExp(a,t?void 0:"i"),r]}function XO(e){try{return e.split("/").map(t=>decodeURIComponent(t).replace(/\//g,"%2F")).join("/")}catch(t){return Gr(!1,`The URL path "${e}" could not be decoded because it is a malformed URL segment. This is probably due to a bad percent encoding (${t}).`),e}}function Bi(e,t){if(t==="/")return e;if(!e.toLowerCase().startsWith(t.toLowerCase()))return null;let n=t.endsWith("/")?t.length-1:t.length,r=e.charAt(n);return r&&r!=="/"?null:e.slice(n)||"/"}var QO=/^(?:[a-z][a-z0-9+.-]*:|\/\/)/i;function JO(e,t="/"){let{pathname:n,search:r="",hash:a=""}=typeof e=="string"?Ro(e):e,o;return n?(n=n.replace(/\/\/+/g,"/"),n.startsWith("/")?o=uw(n.substring(1),"/"):o=uw(n,t)):o=t,{pathname:o,search:tM(r),hash:nM(a)}}function uw(e,t){let n=t.replace(/\/+$/,"").split("/");return e.split("/").forEach(a=>{a===".."?n.length>1&&n.pop():a!=="."&&n.push(a)}),n.length>1?n.join("/"):"/"}function rm(e,t,n,r){return`Cannot include a '${e}' character in a manually specified \`to.${t}\` field [${JSON.stringify(r)}]. Please separate it out to the \`to.${n}\` field. Alternatively you may provide the full path as a string in <Link to="..."> and the router will parse it for you.`}function ZO(e){return e.filter((t,n)=>n===0||t.route.path&&t.route.path.length>0)}function Lv(e){let t=ZO(e);return t.map((n,r)=>r===t.length-1?n.pathname:n.pathnameBase)}function wf(e,t,n,r=!1){let a;typeof e=="string"?a=Ro(e):(a={...e},Ut(!a.pathname||!a.pathname.includes("?"),rm("?","pathname","search",a)),Ut(!a.pathname||!a.pathname.includes("#"),rm("#","pathname","hash",a)),Ut(!a.search||!a.search.includes("#"),rm("#","search","hash",a)));let o=e===""||a.pathname==="",l=o?"/":a.pathname,c;if(l==null)c=n;else{let g=t.length-1;if(!r&&l.startsWith("..")){let v=l.split("/");for(;v[0]==="..";)v.shift(),g-=1;a.pathname=v.join("/")}c=g>=0?t[g]:"/"}let d=JO(a,c),f=l&&l!=="/"&&l.endsWith("/"),m=(o||l===".")&&n.endsWith("/");return!d.pathname.endsWith("/")&&(f||m)&&(d.pathname+="/"),d}var oi=e=>e.join("/").replace(/\/\/+/g,"/"),eM=e=>e.replace(/\/+$/,"").replace(/^\/*/,"/"),tM=e=>!e||e==="?"?"":e.startsWith("?")?e:"?"+e,nM=e=>!e||e==="#"?"":e.startsWith("#")?e:"#"+e,rM=class{constructor(e,t,n,r=!1){this.status=e,this.statusText=t||"",this.internal=r,n instanceof Error?(this.data=n.toString(),this.error=n):this.data=n}};function iM(e){return e!=null&&typeof e.status=="number"&&typeof e.statusText=="string"&&typeof e.internal=="boolean"&&"data"in e}function aM(e){return e.map(t=>t.route.path).filter(Boolean).join("/").replace(/\/\/*/g,"/")||"/"}var Ik=typeof window<"u"&&typeof window.document<"u"&&typeof window.document.createElement<"u";function Pk(e,t){let n=e;if(typeof n!="string"||!QO.test(n))return{absoluteURL:void 0,isExternal:!1,to:n};let r=n,a=!1;if(Ik)try{let o=new URL(window.location.href),l=n.startsWith("//")?new URL(o.protocol+n):new URL(n),c=Bi(l.pathname,t);l.origin===o.origin&&c!=null?n=c+l.search+l.hash:a=!0}catch{Gr(!1,`<Link to="${n}"> contains an invalid URL which will probably break when clicked - please update to a valid URL path.`)}return{absoluteURL:r,isExternal:a,to:n}}Object.getOwnPropertyNames(Object.prototype).sort().join("\0");var Lk=["POST","PUT","PATCH","DELETE"];new Set(Lk);var sM=["GET",...Lk];new Set(sM);var _o=_.createContext(null);_o.displayName="DataRouter";var Ef=_.createContext(null);Ef.displayName="DataRouterState";var oM=_.createContext(!1),zk=_.createContext({isTransitioning:!1});zk.displayName="ViewTransition";var lM=_.createContext(new Map);lM.displayName="Fetchers";var uM=_.createContext(null);uM.displayName="Await";var lr=_.createContext(null);lr.displayName="Navigation";var Ru=_.createContext(null);Ru.displayName="Location";var fi=_.createContext({outlet:null,matches:[],isDataRoute:!1});fi.displayName="Route";var zv=_.createContext(null);zv.displayName="RouteError";var Uk="REACT_ROUTER_ERROR",cM="REDIRECT",dM="ROUTE_ERROR_RESPONSE";function fM(e){if(e.startsWith(`${Uk}:${cM}:{`))try{let t=JSON.parse(e.slice(28));if(typeof t=="object"&&t&&typeof t.status=="number"&&typeof t.statusText=="string"&&typeof t.location=="string"&&typeof t.reloadDocument=="boolean"&&typeof t.replace=="boolean")return t}catch{}}function hM(e){if(e.startsWith(`${Uk}:${dM}:{`))try{let t=JSON.parse(e.slice(40));if(typeof t=="object"&&t&&typeof t.status=="number"&&typeof t.statusText=="string")return new rM(t.status,t.statusText,t.data)}catch{}}function pM(e,{relative:t}={}){Ut(Oo(),"useHref() may be used only in the context of a <Router> component.");let{basename:n,navigator:r}=_.useContext(lr),{hash:a,pathname:o,search:l}=_u(e,{relative:t}),c=o;return n!=="/"&&(c=o==="/"?n:oi([n,o])),r.createHref({pathname:c,search:l,hash:a})}function Oo(){return _.useContext(Ru)!=null}function hi(){return Ut(Oo(),"useLocation() may be used only in the context of a <Router> component."),_.useContext(Ru).location}var Bk="You should call navigate() in a React.useEffect(), not when your component is first rendered.";function Vk(e){_.useContext(lr).static||_.useLayoutEffect(e)}function Fk(){let{isDataRoute:e}=_.useContext(fi);return e?AM():mM()}function mM(){Ut(Oo(),"useNavigate() may be used only in the context of a <Router> component.");let e=_.useContext(_o),{basename:t,navigator:n}=_.useContext(lr),{matches:r}=_.useContext(fi),{pathname:a}=hi(),o=JSON.stringify(Lv(r)),l=_.useRef(!1);return Vk(()=>{l.current=!0}),_.useCallback((d,f={})=>{if(Gr(l.current,Bk),!l.current)return;if(typeof d=="number"){n.go(d);return}let m=wf(d,JSON.parse(o),a,f.relative==="path");e==null&&t!=="/"&&(m.pathname=m.pathname==="/"?t:oi([t,m.pathname])),(f.replace?n.replace:n.push)(m,f.state,f)},[t,n,o,a,e])}_.createContext(null);function _u(e,{relative:t}={}){let{matches:n}=_.useContext(fi),{pathname:r}=hi(),a=JSON.stringify(Lv(n));return _.useMemo(()=>wf(e,JSON.parse(a),r,t==="path"),[e,a,r,t])}function gM(e,t){return Hk(e,t)}function Hk(e,t,n){Ut(Oo(),"useRoutes() may be used only in the context of a <Router> component.");let{navigator:r}=_.useContext(lr),{matches:a}=_.useContext(fi),o=a[a.length-1],l=o?o.params:{},c=o?o.pathname:"/",d=o?o.pathnameBase:"/",f=o&&o.route;{let E=f&&f.path||"";Gk(c,!f||E.endsWith("*")||E.endsWith("*?"),`You rendered descendant <Routes> (or called \`useRoutes()\`) at "${c}" (under <Route path="${E}">) but the parent route path has no trailing "*". This means if you navigate deeper, the parent won't match anymore and therefore the child routes will never render.
10
+
11
+ Please change the parent <Route path="${E}"> to <Route path="${E==="/"?"*":`${E}/*`}">.`)}let m=hi(),g;if(t){let E=typeof t=="string"?Ro(t):t;Ut(d==="/"||E.pathname?.startsWith(d),`When overriding the location using \`<Routes location>\` or \`useRoutes(routes, location)\`, the location pathname must begin with the portion of the URL pathname that was matched by all parent routes. The current pathname base is "${d}" but pathname "${E.pathname}" was given in the \`location\` prop.`),g=E}else g=m;let v=g.pathname||"/",b=v;if(d!=="/"){let E=d.replace(/^\//,"").split("/");b="/"+v.replace(/^\//,"").split("/").slice(E.length).join("/")}let S=Ok(e,{pathname:b});Gr(f||S!=null,`No routes matched location "${g.pathname}${g.search}${g.hash}" `),Gr(S==null||S[S.length-1].route.element!==void 0||S[S.length-1].route.Component!==void 0||S[S.length-1].route.lazy!==void 0,`Matched leaf route at location "${g.pathname}${g.search}${g.hash}" does not have an element or Component. This means it will render an <Outlet /> with a null value by default resulting in an "empty" page.`);let w=SM(S&&S.map(E=>Object.assign({},E,{params:Object.assign({},l,E.params),pathname:oi([d,r.encodeLocation?r.encodeLocation(E.pathname.replace(/\?/g,"%3F").replace(/#/g,"%23")).pathname:E.pathname]),pathnameBase:E.pathnameBase==="/"?d:oi([d,r.encodeLocation?r.encodeLocation(E.pathnameBase.replace(/\?/g,"%3F").replace(/#/g,"%23")).pathname:E.pathnameBase])})),a,n);return t&&w?_.createElement(Ru.Provider,{value:{location:{pathname:"/",search:"",hash:"",state:null,key:"default",unstable_mask:void 0,...g},navigationType:"POP"}},w):w}function vM(){let e=CM(),t=iM(e)?`${e.status} ${e.statusText}`:e instanceof Error?e.message:JSON.stringify(e),n=e instanceof Error?e.stack:null,r="rgba(200,200,200, 0.5)",a={padding:"0.5rem",backgroundColor:r},o={padding:"2px 4px",backgroundColor:r},l=null;return console.error("Error handled by React Router default ErrorBoundary:",e),l=_.createElement(_.Fragment,null,_.createElement("p",null,"💿 Hey developer 👋"),_.createElement("p",null,"You can provide a way better UX than this when your app throws errors by providing your own ",_.createElement("code",{style:o},"ErrorBoundary")," or"," ",_.createElement("code",{style:o},"errorElement")," prop on your route.")),_.createElement(_.Fragment,null,_.createElement("h2",null,"Unexpected Application Error!"),_.createElement("h3",{style:{fontStyle:"italic"}},t),n?_.createElement("pre",{style:a},n):null,l)}var yM=_.createElement(vM,null),qk=class extends _.Component{constructor(e){super(e),this.state={location:e.location,revalidation:e.revalidation,error:e.error}}static getDerivedStateFromError(e){return{error:e}}static getDerivedStateFromProps(e,t){return t.location!==e.location||t.revalidation!=="idle"&&e.revalidation==="idle"?{error:e.error,location:e.location,revalidation:e.revalidation}:{error:e.error!==void 0?e.error:t.error,location:t.location,revalidation:e.revalidation||t.revalidation}}componentDidCatch(e,t){this.props.onError?this.props.onError(e,t):console.error("React Router caught the following error during render",e)}render(){let e=this.state.error;if(this.context&&typeof e=="object"&&e&&"digest"in e&&typeof e.digest=="string"){const n=hM(e.digest);n&&(e=n)}let t=e!==void 0?_.createElement(fi.Provider,{value:this.props.routeContext},_.createElement(zv.Provider,{value:e,children:this.props.component})):this.props.children;return this.context?_.createElement(bM,{error:e},t):t}};qk.contextType=oM;var im=new WeakMap;function bM({children:e,error:t}){let{basename:n}=_.useContext(lr);if(typeof t=="object"&&t&&"digest"in t&&typeof t.digest=="string"){let r=fM(t.digest);if(r){let a=im.get(t);if(a)throw a;let o=Pk(r.location,n);if(Ik&&!im.get(t))if(o.isExternal||r.reloadDocument)window.location.href=o.absoluteURL||o.to;else{const l=Promise.resolve().then(()=>window.__reactRouterDataRouter.navigate(o.to,{replace:r.replace}));throw im.set(t,l),l}return _.createElement("meta",{httpEquiv:"refresh",content:`0;url=${o.absoluteURL||o.to}`})}}return e}function xM({routeContext:e,match:t,children:n}){let r=_.useContext(_o);return r&&r.static&&r.staticContext&&(t.route.errorElement||t.route.ErrorBoundary)&&(r.staticContext._deepestRenderedBoundaryId=t.route.id),_.createElement(fi.Provider,{value:e},n)}function SM(e,t=[],n){let r=n?.state;if(e==null){if(!r)return null;if(r.errors)e=r.matches;else if(t.length===0&&!r.initialized&&r.matches.length>0)e=r.matches;else return null}let a=e,o=r?.errors;if(o!=null){let m=a.findIndex(g=>g.route.id&&o?.[g.route.id]!==void 0);Ut(m>=0,`Could not find a matching route for errors on route IDs: ${Object.keys(o).join(",")}`),a=a.slice(0,Math.min(a.length,m+1))}let l=!1,c=-1;if(n&&r){l=r.renderFallback;for(let m=0;m<a.length;m++){let g=a[m];if((g.route.HydrateFallback||g.route.hydrateFallbackElement)&&(c=m),g.route.id){let{loaderData:v,errors:b}=r,S=g.route.loader&&!v.hasOwnProperty(g.route.id)&&(!b||b[g.route.id]===void 0);if(g.route.lazy||S){n.isStatic&&(l=!0),c>=0?a=a.slice(0,c+1):a=[a[0]];break}}}}let d=n?.onError,f=r&&d?(m,g)=>{d(m,{location:r.location,params:r.matches?.[0]?.params??{},unstable_pattern:aM(r.matches),errorInfo:g})}:void 0;return a.reduceRight((m,g,v)=>{let b,S=!1,w=null,E=null;r&&(b=o&&g.route.id?o[g.route.id]:void 0,w=g.route.errorElement||yM,l&&(c<0&&v===0?(Gk("route-fallback",!1,"No `HydrateFallback` element provided to render during initial hydration"),S=!0,E=null):c===v&&(S=!0,E=g.route.hydrateFallbackElement||null)));let T=t.concat(a.slice(0,v+1)),C=()=>{let k;return b?k=w:S?k=E:g.route.Component?k=_.createElement(g.route.Component,null):g.route.element?k=g.route.element:k=m,_.createElement(xM,{match:g,routeContext:{outlet:m,matches:T,isDataRoute:r!=null},children:k})};return r&&(g.route.ErrorBoundary||g.route.errorElement||v===0)?_.createElement(qk,{location:r.location,revalidation:r.revalidation,component:w,error:b,children:C(),routeContext:{outlet:null,matches:T,isDataRoute:!0},onError:f}):C()},null)}function Uv(e){return`${e} must be used within a data router. See https://reactrouter.com/en/main/routers/picking-a-router.`}function wM(e){let t=_.useContext(_o);return Ut(t,Uv(e)),t}function EM(e){let t=_.useContext(Ef);return Ut(t,Uv(e)),t}function TM(e){let t=_.useContext(fi);return Ut(t,Uv(e)),t}function Bv(e){let t=TM(e),n=t.matches[t.matches.length-1];return Ut(n.route.id,`${e} can only be used on routes that contain a unique "id"`),n.route.id}function kM(){return Bv("useRouteId")}function CM(){let e=_.useContext(zv),t=EM("useRouteError"),n=Bv("useRouteError");return e!==void 0?e:t.errors?.[n]}function AM(){let{router:e}=wM("useNavigate"),t=Bv("useNavigate"),n=_.useRef(!1);return Vk(()=>{n.current=!0}),_.useCallback(async(a,o={})=>{Gr(n.current,Bk),n.current&&(typeof a=="number"?await e.navigate(a):await e.navigate(a,{fromRouteId:t,...o}))},[e,t])}var cw={};function Gk(e,t,n){!t&&!cw[e]&&(cw[e]=!0,Gr(!1,n))}_.memo(NM);function NM({routes:e,future:t,state:n,isStatic:r,onError:a}){return Hk(e,void 0,{state:n,isStatic:r,onError:a})}function jM({to:e,replace:t,state:n,relative:r}){Ut(Oo(),"<Navigate> may be used only in the context of a <Router> component.");let{static:a}=_.useContext(lr);Gr(!a,"<Navigate> must not be used on the initial render in a <StaticRouter>. This is a no-op, but you should modify your code so the <Navigate> is only ever rendered in response to some user interaction or state change.");let{matches:o}=_.useContext(fi),{pathname:l}=hi(),c=Fk(),d=wf(e,Lv(o),l,r==="path"),f=JSON.stringify(d);return _.useEffect(()=>{c(JSON.parse(f),{replace:t,state:n,relative:r})},[c,f,r,t,n]),null}function An(e){Ut(!1,"A <Route> is only ever to be used as the child of <Routes> element, never rendered directly. Please wrap your <Route> in a <Routes>.")}function RM({basename:e="/",children:t=null,location:n,navigationType:r="POP",navigator:a,static:o=!1,unstable_useTransitions:l}){Ut(!Oo(),"You cannot render a <Router> inside another <Router>. You should never have more than one in your app.");let c=e.replace(/^\/*/,"/"),d=_.useMemo(()=>({basename:c,navigator:a,static:o,unstable_useTransitions:l,future:{}}),[c,a,o,l]);typeof n=="string"&&(n=Ro(n));let{pathname:f="/",search:m="",hash:g="",state:v=null,key:b="default",unstable_mask:S}=n,w=_.useMemo(()=>{let E=Bi(f,c);return E==null?null:{location:{pathname:E,search:m,hash:g,state:v,key:b,unstable_mask:S},navigationType:r}},[c,f,m,g,v,b,r,S]);return Gr(w!=null,`<Router basename="${c}"> is not able to match the URL "${f}${m}${g}" because it does not start with the basename, so the <Router> won't render anything.`),w==null?null:_.createElement(lr.Provider,{value:d},_.createElement(Ru.Provider,{children:t,value:w}))}function _M({children:e,location:t}){return gM(pg(e),t)}function pg(e,t=[]){let n=[];return _.Children.forEach(e,(r,a)=>{if(!_.isValidElement(r))return;let o=[...t,a];if(r.type===_.Fragment){n.push.apply(n,pg(r.props.children,o));return}Ut(r.type===An,`[${typeof r.type=="string"?r.type:r.type.name}] is not a <Route> component. All component children of <Routes> must be a <Route> or <React.Fragment>`),Ut(!r.props.index||!r.props.children,"An index route cannot have child routes.");let l={id:r.props.id||o.join("-"),caseSensitive:r.props.caseSensitive,element:r.props.element,Component:r.props.Component,index:r.props.index,path:r.props.path,middleware:r.props.middleware,loader:r.props.loader,action:r.props.action,hydrateFallbackElement:r.props.hydrateFallbackElement,HydrateFallback:r.props.HydrateFallback,errorElement:r.props.errorElement,ErrorBoundary:r.props.ErrorBoundary,hasErrorBoundary:r.props.hasErrorBoundary===!0||r.props.ErrorBoundary!=null||r.props.errorElement!=null,shouldRevalidate:r.props.shouldRevalidate,handle:r.props.handle,lazy:r.props.lazy};r.props.children&&(l.children=pg(r.props.children,o)),n.push(l)}),n}var jd="get",Rd="application/x-www-form-urlencoded";function Tf(e){return typeof HTMLElement<"u"&&e instanceof HTMLElement}function OM(e){return Tf(e)&&e.tagName.toLowerCase()==="button"}function MM(e){return Tf(e)&&e.tagName.toLowerCase()==="form"}function DM(e){return Tf(e)&&e.tagName.toLowerCase()==="input"}function IM(e){return!!(e.metaKey||e.altKey||e.ctrlKey||e.shiftKey)}function PM(e,t){return e.button===0&&(!t||t==="_self")&&!IM(e)}var rd=null;function LM(){if(rd===null)try{new FormData(document.createElement("form"),0),rd=!1}catch{rd=!0}return rd}var zM=new Set(["application/x-www-form-urlencoded","multipart/form-data","text/plain"]);function am(e){return e!=null&&!zM.has(e)?(Gr(!1,`"${e}" is not a valid \`encType\` for \`<Form>\`/\`<fetcher.Form>\` and will default to "${Rd}"`),null):e}function UM(e,t){let n,r,a,o,l;if(MM(e)){let c=e.getAttribute("action");r=c?Bi(c,t):null,n=e.getAttribute("method")||jd,a=am(e.getAttribute("enctype"))||Rd,o=new FormData(e)}else if(OM(e)||DM(e)&&(e.type==="submit"||e.type==="image")){let c=e.form;if(c==null)throw new Error('Cannot submit a <button> or <input type="submit"> without a <form>');let d=e.getAttribute("formaction")||c.getAttribute("action");if(r=d?Bi(d,t):null,n=e.getAttribute("formmethod")||c.getAttribute("method")||jd,a=am(e.getAttribute("formenctype"))||am(c.getAttribute("enctype"))||Rd,o=new FormData(c,e),!LM()){let{name:f,type:m,value:g}=e;if(m==="image"){let v=f?`${f}.`:"";o.append(`${v}x`,"0"),o.append(`${v}y`,"0")}else f&&o.append(f,g)}}else{if(Tf(e))throw new Error('Cannot submit element that is not <form>, <button>, or <input type="submit|image">');n=jd,r=null,a=Rd,l=e}return o&&a==="text/plain"&&(l=o,o=void 0),{action:r,method:n.toLowerCase(),encType:a,formData:o,body:l}}Object.getOwnPropertyNames(Object.prototype).sort().join("\0");function Vv(e,t){if(e===!1||e===null||typeof e>"u")throw new Error(t)}function BM(e,t,n,r){let a=typeof e=="string"?new URL(e,typeof window>"u"?"server://singlefetch/":window.location.origin):e;return n?a.pathname.endsWith("/")?a.pathname=`${a.pathname}_.${r}`:a.pathname=`${a.pathname}.${r}`:a.pathname==="/"?a.pathname=`_root.${r}`:t&&Bi(a.pathname,t)==="/"?a.pathname=`${t.replace(/\/$/,"")}/_root.${r}`:a.pathname=`${a.pathname.replace(/\/$/,"")}.${r}`,a}async function VM(e,t){if(e.id in t)return t[e.id];try{let n=await import(e.module);return t[e.id]=n,n}catch(n){return console.error(`Error loading route module \`${e.module}\`, reloading page...`),console.error(n),window.__reactRouterContext&&window.__reactRouterContext.isSpaMode,window.location.reload(),new Promise(()=>{})}}function FM(e){return e==null?!1:e.href==null?e.rel==="preload"&&typeof e.imageSrcSet=="string"&&typeof e.imageSizes=="string":typeof e.rel=="string"&&typeof e.href=="string"}async function HM(e,t,n){let r=await Promise.all(e.map(async a=>{let o=t.routes[a.route.id];if(o){let l=await VM(o,n);return l.links?l.links():[]}return[]}));return $M(r.flat(1).filter(FM).filter(a=>a.rel==="stylesheet"||a.rel==="preload").map(a=>a.rel==="stylesheet"?{...a,rel:"prefetch",as:"style"}:{...a,rel:"prefetch"}))}function dw(e,t,n,r,a,o){let l=(d,f)=>n[f]?d.route.id!==n[f].route.id:!0,c=(d,f)=>n[f].pathname!==d.pathname||n[f].route.path?.endsWith("*")&&n[f].params["*"]!==d.params["*"];return o==="assets"?t.filter((d,f)=>l(d,f)||c(d,f)):o==="data"?t.filter((d,f)=>{let m=r.routes[d.route.id];if(!m||!m.hasLoader)return!1;if(l(d,f)||c(d,f))return!0;if(d.route.shouldRevalidate){let g=d.route.shouldRevalidate({currentUrl:new URL(a.pathname+a.search+a.hash,window.origin),currentParams:n[0]?.params||{},nextUrl:new URL(e,window.origin),nextParams:d.params,defaultShouldRevalidate:!0});if(typeof g=="boolean")return g}return!0}):[]}function qM(e,t,{includeHydrateFallback:n}={}){return GM(e.map(r=>{let a=t.routes[r.route.id];if(!a)return[];let o=[a.module];return a.clientActionModule&&(o=o.concat(a.clientActionModule)),a.clientLoaderModule&&(o=o.concat(a.clientLoaderModule)),n&&a.hydrateFallbackModule&&(o=o.concat(a.hydrateFallbackModule)),a.imports&&(o=o.concat(a.imports)),o}).flat(1))}function GM(e){return[...new Set(e)]}function KM(e){let t={},n=Object.keys(e).sort();for(let r of n)t[r]=e[r];return t}function $M(e,t){let n=new Set;return new Set(t),e.reduce((r,a)=>{let o=JSON.stringify(KM(a));return n.has(o)||(n.add(o),r.push({key:o,link:a})),r},[])}function Kk(){let e=_.useContext(_o);return Vv(e,"You must render this element inside a <DataRouterContext.Provider> element"),e}function YM(){let e=_.useContext(Ef);return Vv(e,"You must render this element inside a <DataRouterStateContext.Provider> element"),e}var Fv=_.createContext(void 0);Fv.displayName="FrameworkContext";function $k(){let e=_.useContext(Fv);return Vv(e,"You must render this element inside a <HydratedRouter> element"),e}function WM(e,t){let n=_.useContext(Fv),[r,a]=_.useState(!1),[o,l]=_.useState(!1),{onFocus:c,onBlur:d,onMouseEnter:f,onMouseLeave:m,onTouchStart:g}=t,v=_.useRef(null);_.useEffect(()=>{if(e==="render"&&l(!0),e==="viewport"){let w=T=>{T.forEach(C=>{l(C.isIntersecting)})},E=new IntersectionObserver(w,{threshold:.5});return v.current&&E.observe(v.current),()=>{E.disconnect()}}},[e]),_.useEffect(()=>{if(r){let w=setTimeout(()=>{l(!0)},100);return()=>{clearTimeout(w)}}},[r]);let b=()=>{a(!0)},S=()=>{a(!1),l(!1)};return n?e!=="intent"?[o,v,{}]:[o,v,{onFocus:Il(c,b),onBlur:Il(d,S),onMouseEnter:Il(f,b),onMouseLeave:Il(m,S),onTouchStart:Il(g,b)}]:[!1,v,{}]}function Il(e,t){return n=>{e&&e(n),n.defaultPrevented||t(n)}}function XM({page:e,...t}){let{router:n}=Kk(),r=_.useMemo(()=>Ok(n.routes,e,n.basename),[n.routes,e,n.basename]);return r?_.createElement(JM,{page:e,matches:r,...t}):null}function QM(e){let{manifest:t,routeModules:n}=$k(),[r,a]=_.useState([]);return _.useEffect(()=>{let o=!1;return HM(e,t,n).then(l=>{o||a(l)}),()=>{o=!0}},[e,t,n]),r}function JM({page:e,matches:t,...n}){let r=hi(),{future:a,manifest:o,routeModules:l}=$k(),{basename:c}=Kk(),{loaderData:d,matches:f}=YM(),m=_.useMemo(()=>dw(e,t,f,o,r,"data"),[e,t,f,o,r]),g=_.useMemo(()=>dw(e,t,f,o,r,"assets"),[e,t,f,o,r]),v=_.useMemo(()=>{if(e===r.pathname+r.search+r.hash)return[];let w=new Set,E=!1;if(t.forEach(C=>{let k=o.routes[C.route.id];!k||!k.hasLoader||(!m.some(j=>j.route.id===C.route.id)&&C.route.id in d&&l[C.route.id]?.shouldRevalidate||k.hasClientLoader?E=!0:w.add(C.route.id))}),w.size===0)return[];let T=BM(e,c,a.unstable_trailingSlashAwareDataRequests,"data");return E&&w.size>0&&T.searchParams.set("_routes",t.filter(C=>w.has(C.route.id)).map(C=>C.route.id).join(",")),[T.pathname+T.search]},[c,a.unstable_trailingSlashAwareDataRequests,d,r,o,m,t,e,l]),b=_.useMemo(()=>qM(g,o),[g,o]),S=QM(g);return _.createElement(_.Fragment,null,v.map(w=>_.createElement("link",{key:w,rel:"prefetch",as:"fetch",href:w,...n})),b.map(w=>_.createElement("link",{key:w,rel:"modulepreload",href:w,...n})),S.map(({key:w,link:E})=>_.createElement("link",{key:w,nonce:n.nonce,...E,crossOrigin:E.crossOrigin??n.crossOrigin})))}function ZM(...e){return t=>{e.forEach(n=>{typeof n=="function"?n(t):n!=null&&(n.current=t)})}}var eD=typeof window<"u"&&typeof window.document<"u"&&typeof window.document.createElement<"u";try{eD&&(window.__reactRouterVersion="7.13.1")}catch{}function tD({basename:e,children:t,unstable_useTransitions:n,window:r}){let a=_.useRef();a.current==null&&(a.current=DO({window:r,v5Compat:!0}));let o=a.current,[l,c]=_.useState({action:o.action,location:o.location}),d=_.useCallback(f=>{n===!1?c(f):_.startTransition(()=>c(f))},[n]);return _.useLayoutEffect(()=>o.listen(d),[o,d]),_.createElement(RM,{basename:e,children:t,location:l.location,navigationType:l.action,navigator:o,unstable_useTransitions:n})}var Yk=/^(?:[a-z][a-z0-9+.-]*:|\/\/)/i,Wk=_.forwardRef(function({onClick:t,discover:n="render",prefetch:r="none",relative:a,reloadDocument:o,replace:l,unstable_mask:c,state:d,target:f,to:m,preventScrollReset:g,viewTransition:v,unstable_defaultShouldRevalidate:b,...S},w){let{basename:E,navigator:T,unstable_useTransitions:C}=_.useContext(lr),k=typeof m=="string"&&Yk.test(m),j=Pk(m,E);m=j.to;let N=pM(m,{relative:a}),R=hi(),P=null;if(c){let Z=wf(c,[],R.unstable_mask?R.unstable_mask.pathname:"/",!0);E!=="/"&&(Z.pathname=Z.pathname==="/"?E:oi([E,Z.pathname])),P=T.createHref(Z)}let[L,H,D]=WM(r,S),B=iD(m,{replace:l,unstable_mask:c,state:d,target:f,preventScrollReset:g,relative:a,viewTransition:v,unstable_defaultShouldRevalidate:b,unstable_useTransitions:C});function K(Z){t&&t(Z),Z.defaultPrevented||B(Z)}let se=!(j.isExternal||o),ue=_.createElement("a",{...S,...D,href:(se?P:void 0)||j.absoluteURL||N,onClick:se?K:t,ref:ZM(w,H),target:f,"data-discover":!k&&n==="render"?"true":void 0});return L&&!k?_.createElement(_.Fragment,null,ue,_.createElement(XM,{page:N})):ue});Wk.displayName="Link";var Xk=_.forwardRef(function({"aria-current":t="page",caseSensitive:n=!1,className:r="",end:a=!1,style:o,to:l,viewTransition:c,children:d,...f},m){let g=_u(l,{relative:f.relative}),v=hi(),b=_.useContext(Ef),{navigator:S,basename:w}=_.useContext(lr),E=b!=null&&uD(g)&&c===!0,T=S.encodeLocation?S.encodeLocation(g).pathname:g.pathname,C=v.pathname,k=b&&b.navigation&&b.navigation.location?b.navigation.location.pathname:null;n||(C=C.toLowerCase(),k=k?k.toLowerCase():null,T=T.toLowerCase()),k&&w&&(k=Bi(k,w)||k);const j=T!=="/"&&T.endsWith("/")?T.length-1:T.length;let N=C===T||!a&&C.startsWith(T)&&C.charAt(j)==="/",R=k!=null&&(k===T||!a&&k.startsWith(T)&&k.charAt(T.length)==="/"),P={isActive:N,isPending:R,isTransitioning:E},L=N?t:void 0,H;typeof r=="function"?H=r(P):H=[r,N?"active":null,R?"pending":null,E?"transitioning":null].filter(Boolean).join(" ");let D=typeof o=="function"?o(P):o;return _.createElement(Wk,{...f,"aria-current":L,className:H,ref:m,style:D,to:l,viewTransition:c},typeof d=="function"?d(P):d)});Xk.displayName="NavLink";var nD=_.forwardRef(({discover:e="render",fetcherKey:t,navigate:n,reloadDocument:r,replace:a,state:o,method:l=jd,action:c,onSubmit:d,relative:f,preventScrollReset:m,viewTransition:g,unstable_defaultShouldRevalidate:v,...b},S)=>{let{unstable_useTransitions:w}=_.useContext(lr),E=oD(),T=lD(c,{relative:f}),C=l.toLowerCase()==="get"?"get":"post",k=typeof c=="string"&&Yk.test(c),j=N=>{if(d&&d(N),N.defaultPrevented)return;N.preventDefault();let R=N.nativeEvent.submitter,P=R?.getAttribute("formmethod")||l,L=()=>E(R||N.currentTarget,{fetcherKey:t,method:P,navigate:n,replace:a,state:o,relative:f,preventScrollReset:m,viewTransition:g,unstable_defaultShouldRevalidate:v});w&&n!==!1?_.startTransition(()=>L()):L()};return _.createElement("form",{ref:S,method:C,action:T,onSubmit:r?d:j,...b,"data-discover":!k&&e==="render"?"true":void 0})});nD.displayName="Form";function rD(e){return`${e} must be used within a data router. See https://reactrouter.com/en/main/routers/picking-a-router.`}function Qk(e){let t=_.useContext(_o);return Ut(t,rD(e)),t}function iD(e,{target:t,replace:n,unstable_mask:r,state:a,preventScrollReset:o,relative:l,viewTransition:c,unstable_defaultShouldRevalidate:d,unstable_useTransitions:f}={}){let m=Fk(),g=hi(),v=_u(e,{relative:l});return _.useCallback(b=>{if(PM(b,t)){b.preventDefault();let S=n!==void 0?n:bu(g)===bu(v),w=()=>m(e,{replace:S,unstable_mask:r,state:a,preventScrollReset:o,relative:l,viewTransition:c,unstable_defaultShouldRevalidate:d});f?_.startTransition(()=>w()):w()}},[g,m,v,n,r,a,t,e,o,l,c,d,f])}var aD=0,sD=()=>`__${String(++aD)}__`;function oD(){let{router:e}=Qk("useSubmit"),{basename:t}=_.useContext(lr),n=kM(),r=e.fetch,a=e.navigate;return _.useCallback(async(o,l={})=>{let{action:c,method:d,encType:f,formData:m,body:g}=UM(o,t);if(l.navigate===!1){let v=l.fetcherKey||sD();await r(v,n,l.action||c,{unstable_defaultShouldRevalidate:l.unstable_defaultShouldRevalidate,preventScrollReset:l.preventScrollReset,formData:m,body:g,formMethod:l.method||d,formEncType:l.encType||f,flushSync:l.flushSync})}else await a(l.action||c,{unstable_defaultShouldRevalidate:l.unstable_defaultShouldRevalidate,preventScrollReset:l.preventScrollReset,formData:m,body:g,formMethod:l.method||d,formEncType:l.encType||f,replace:l.replace,state:l.state,fromRouteId:n,flushSync:l.flushSync,viewTransition:l.viewTransition})},[r,a,t,n])}function lD(e,{relative:t}={}){let{basename:n}=_.useContext(lr),r=_.useContext(fi);Ut(r,"useFormAction must be used inside a RouteContext");let[a]=r.matches.slice(-1),o={..._u(e||".",{relative:t})},l=hi();if(e==null){o.search=l.search;let c=new URLSearchParams(o.search),d=c.getAll("index");if(d.some(m=>m==="")){c.delete("index"),d.filter(g=>g).forEach(g=>c.append("index",g));let m=c.toString();o.search=m?`?${m}`:""}}return(!e||e===".")&&a.route.index&&(o.search=o.search?o.search.replace(/^\?/,"?index&"):"?index"),n!=="/"&&(o.pathname=o.pathname==="/"?n:oi([n,o.pathname])),bu(o)}function uD(e,{relative:t}={}){let n=_.useContext(zk);Ut(n!=null,"`useViewTransitionState` must be used within `react-router-dom`'s `RouterProvider`. Did you accidentally import `RouterProvider` from `react-router`?");let{basename:r}=Qk("useViewTransitionState"),a=_u(e,{relative:t});if(!n.isTransitioning)return!1;let o=Bi(n.currentLocation.pathname,r)||n.currentLocation.pathname,l=Bi(n.nextLocation.pathname,r)||n.nextLocation.pathname;return Qd(a.pathname,l)!=null||Qd(a.pathname,o)!=null}var mg=function(e,t){return mg=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(n,r){n.__proto__=r}||function(n,r){for(var a in r)Object.prototype.hasOwnProperty.call(r,a)&&(n[a]=r[a])},mg(e,t)};function Or(e,t){if(typeof t!="function"&&t!==null)throw new TypeError("Class extends value "+String(t)+" is not a constructor or null");mg(e,t);function n(){this.constructor=e}e.prototype=t===null?Object.create(t):(n.prototype=t.prototype,new n)}var ce=function(){return ce=Object.assign||function(t){for(var n,r=1,a=arguments.length;r<a;r++){n=arguments[r];for(var o in n)Object.prototype.hasOwnProperty.call(n,o)&&(t[o]=n[o])}return t},ce.apply(this,arguments)};function Jd(e,t){var n={};for(var r in e)Object.prototype.hasOwnProperty.call(e,r)&&t.indexOf(r)<0&&(n[r]=e[r]);if(e!=null&&typeof Object.getOwnPropertySymbols=="function")for(var a=0,r=Object.getOwnPropertySymbols(e);a<r.length;a++)t.indexOf(r[a])<0&&Object.prototype.propertyIsEnumerable.call(e,r[a])&&(n[r[a]]=e[r[a]]);return n}function te(e,t,n,r){function a(o){return o instanceof n?o:new n(function(l){l(o)})}return new(n||(n=Promise))(function(o,l){function c(m){try{f(r.next(m))}catch(g){l(g)}}function d(m){try{f(r.throw(m))}catch(g){l(g)}}function f(m){m.done?o(m.value):a(m.value).then(c,d)}f((r=r.apply(e,t||[])).next())})}function ee(e,t){var n={label:0,sent:function(){if(o[0]&1)throw o[1];return o[1]},trys:[],ops:[]},r,a,o,l=Object.create((typeof Iterator=="function"?Iterator:Object).prototype);return l.next=c(0),l.throw=c(1),l.return=c(2),typeof Symbol=="function"&&(l[Symbol.iterator]=function(){return this}),l;function c(f){return function(m){return d([f,m])}}function d(f){if(r)throw new TypeError("Generator is already executing.");for(;l&&(l=0,f[0]&&(n=0)),n;)try{if(r=1,a&&(o=f[0]&2?a.return:f[0]?a.throw||((o=a.return)&&o.call(a),0):a.next)&&!(o=o.call(a,f[1])).done)return o;switch(a=0,o&&(f=[f[0]&2,o.value]),f[0]){case 0:case 1:o=f;break;case 4:return n.label++,{value:f[1],done:!1};case 5:n.label++,a=f[1],f=[0];continue;case 7:f=n.ops.pop(),n.trys.pop();continue;default:if(o=n.trys,!(o=o.length>0&&o[o.length-1])&&(f[0]===6||f[0]===2)){n=0;continue}if(f[0]===3&&(!o||f[1]>o[0]&&f[1]<o[3])){n.label=f[1];break}if(f[0]===6&&n.label<o[1]){n.label=o[1],o=f;break}if(o&&n.label<o[2]){n.label=o[2],n.ops.push(f);break}o[2]&&n.ops.pop(),n.trys.pop();continue}f=t.call(e,n)}catch(m){f=[6,m],a=0}finally{r=o=0}if(f[0]&5)throw f[1];return{value:f[0]?f[1]:void 0,done:!0}}}function _e(e){var t=typeof Symbol=="function"&&Symbol.iterator,n=t&&e[t],r=0;if(n)return n.call(e);if(e&&typeof e.length=="number")return{next:function(){return e&&r>=e.length&&(e=void 0),{value:e&&e[r++],done:!e}}};throw new TypeError(t?"Object is not iterable.":"Symbol.iterator is not defined.")}function Ae(e,t){var n=typeof Symbol=="function"&&e[Symbol.iterator];if(!n)return e;var r=n.call(e),a,o=[],l;try{for(;(t===void 0||t-- >0)&&!(a=r.next()).done;)o.push(a.value)}catch(c){l={error:c}}finally{try{a&&!a.done&&(n=r.return)&&n.call(r)}finally{if(l)throw l.error}}return o}function Je(e,t,n){if(n||arguments.length===2)for(var r=0,a=t.length,o;r<a;r++)(o||!(r in t))&&(o||(o=Array.prototype.slice.call(t,0,r)),o[r]=t[r]);return e.concat(o||Array.prototype.slice.call(t))}var Ta;(function(e){e.SET="$set",e.SET_ONCE="$setOnce",e.ADD="$add",e.APPEND="$append",e.PREPEND="$prepend",e.REMOVE="$remove",e.PREINSERT="$preInsert",e.POSTINSERT="$postInsert",e.UNSET="$unset",e.CLEAR_ALL="$clearAll"})(Ta||(Ta={}));var sr;(function(e){e.IDENTIFY="$identify",e.GROUP_IDENTIFY="$groupidentify",e.REVENUE="revenue_amount"})(sr||(sr={}));var fw="-",kf="AMP",cD="".concat(kf,"_unsent"),Jk="$default_instance",Hv="https://api2.amplitude.com/2/httpapi",Zk="https://api.eu.amplitude.com/2/httpapi",eC="https://api2.amplitude.com/batch",tC="https://api.eu.amplitude.com/batch",dD="utm_campaign",fD="utm_content",hD="utm_id",pD="utm_medium",mD="utm_source",gD="utm_term",hw="dclid",pw="fbclid",mw="gbraid",gw="gclid",vw="ko_click_id",yw="li_fat_id",bw="msclkid",xw="rdt_cid",Sw="ttclid",ww="twclid",Ew="wbraid",Cf={utm_campaign:void 0,utm_content:void 0,utm_id:void 0,utm_medium:void 0,utm_source:void 0,utm_term:void 0,referrer:void 0,referring_domain:void 0,dclid:void 0,gbraid:void 0,gclid:void 0,fbclid:void 0,ko_click_id:void 0,li_fat_id:void 0,msclkid:void 0,rdt_cid:void 0,ttclid:void 0,twclid:void 0,wbraid:void 0},Zd=["access-control-allow-origin","access-control-allow-credentials","access-control-expose-headers","access-control-max-age","access-control-allow-methods","access-control-allow-headers","accept-patch","accept-ranges","age","allow","alt-svc","cache-control","connection","content-disposition","content-encoding","content-language","content-length","content-location","content-md5","content-range","content-type","date","delta-base","etag","expires","im","last-modified","link","location","permanent","p3p","pragma","proxy-authenticate","public-key-pins","retry-after","server","status","strict-transport-security","trailer","transfer-encoding","tk","upgrade","vary","via","warning","www-authenticate","x-b3-traceid","x-frame-options"],vD=["authorization","cookie","set-cookie"],yD=1e3,gg=function(e){if(Object.keys(e).length>yD)return!1;for(var t in e){var n=e[t];if(!nC(t,n))return!1}return!0},nC=function(e,t){var n,r;if(typeof e!="string")return!1;if(Array.isArray(t)){var a=!0;try{for(var o=_e(t),l=o.next();!l.done;l=o.next()){var c=l.value;if(Array.isArray(c))return!1;if(typeof c=="object")a=a&&gg(c);else if(!["number","string"].includes(typeof c))return!1;if(!a)return!1}}catch(d){n={error:d}}finally{try{l&&!l.done&&(r=o.return)&&r.call(o)}finally{if(n)throw n.error}}}else{if(t==null)return!1;if(typeof t=="object")return gg(t);if(!["number","string","boolean"].includes(typeof t))return!1}return!0},nu=(function(){function e(){this._propertySet=new Set,this._properties={}}return e.prototype.getUserProperties=function(){return ce({},this._properties)},e.prototype.set=function(t,n){return this._safeSet(Rt.SET,t,n),this},e.prototype.setOnce=function(t,n){return this._safeSet(Rt.SET_ONCE,t,n),this},e.prototype.append=function(t,n){return this._safeSet(Rt.APPEND,t,n),this},e.prototype.prepend=function(t,n){return this._safeSet(Rt.PREPEND,t,n),this},e.prototype.postInsert=function(t,n){return this._safeSet(Rt.POSTINSERT,t,n),this},e.prototype.preInsert=function(t,n){return this._safeSet(Rt.PREINSERT,t,n),this},e.prototype.remove=function(t,n){return this._safeSet(Rt.REMOVE,t,n),this},e.prototype.add=function(t,n){return this._safeSet(Rt.ADD,t,n),this},e.prototype.unset=function(t){return this._safeSet(Rt.UNSET,t,fw),this},e.prototype.clearAll=function(){return this._properties={},this._properties[Rt.CLEAR_ALL]=fw,this},e.prototype._safeSet=function(t,n,r){if(this._validate(t,n,r)){var a=this._properties[t];return a===void 0&&(a={},this._properties[t]=a),a[n]=r,this._propertySet.add(n),!0}return!1},e.prototype._validate=function(t,n,r){return this._properties[Rt.CLEAR_ALL]!==void 0||this._propertySet.has(n)?!1:t===Rt.ADD?typeof r=="number":t!==Rt.UNSET&&t!==Rt.REMOVE?nC(n,r):!0},e})(),Rt;(function(e){e.SET="$set",e.SET_ONCE="$setOnce",e.ADD="$add",e.APPEND="$append",e.PREPEND="$prepend",e.REMOVE="$remove",e.PREINSERT="$preInsert",e.POSTINSERT="$postInsert",e.UNSET="$unset",e.CLEAR_ALL="$clearAll"})(Rt||(Rt={}));var bD=[Rt.CLEAR_ALL,Rt.UNSET,Rt.SET,Rt.SET_ONCE,Rt.ADD,Rt.APPEND,Rt.PREPEND,Rt.PREINSERT,Rt.POSTINSERT,Rt.REMOVE],xD="Event tracked successfully",SD="Unexpected error occurred",wD="Event rejected due to exceeded retry count",ED="Event skipped due to optOut config",TD="Event rejected due to missing API key",kD="Invalid API key",CD="Client not initialized",Gt;(function(e){e.Unknown="unknown",e.Skipped="skipped",e.Success="success",e.RateLimit="rate_limit",e.PayloadTooLarge="payload_too_large",e.Invalid="invalid",e.Failed="failed",e.Timeout="Timeout",e.SystemError="SystemError"})(Gt||(Gt={}));var vo=function(e,t,n){return t===void 0&&(t=0),n===void 0&&(n=Gt.Unknown),{event:e,code:t,message:n}},ze=function(){var e="ampIntegrationContext";if(typeof globalThis<"u"&&typeof globalThis[e]<"u")return globalThis[e];if(typeof globalThis<"u")return globalThis;if(typeof window<"u")return window;if(typeof self<"u")return self;if(typeof global<"u")return global},AD=function(e){return e?(e^Math.random()*16>>e/4).toString(16):(String(1e7)+String(-1e3)+String(-4e3)+String(-8e3)+String(-1e11)).replace(/[018]/g,_a)},Tw=Je([],Ae(Array(256).keys()),!1).map(function(e){return e.toString(16).padStart(2,"0")}),_a=function(e){var t,n=ze();if(!(!((t=n?.crypto)===null||t===void 0)&&t.getRandomValues))return AD(e);var r=n.crypto.getRandomValues(new Uint8Array(16));return r[6]=r[6]&15|64,r[8]=r[8]&63|128,Je([],Ae(r.entries()),!1).map(function(a){var o=Ae(a,2),l=o[0],c=o[1];return[4,6,8,10].includes(l)?"-".concat(Tw[c]):Tw[c]}).join("")},ND=(function(){function e(t){this.client=t,this.queue=[],this.applying=!1,this.plugins=[],this._optOutListeners=[]}return e.prototype.register=function(t,n){var r,a;return te(this,void 0,void 0,function(){return ee(this,function(o){switch(o.label){case 0:return this.plugins.some(function(l){return l.name===t.name})?(this.loggerProvider.warn("Plugin with name ".concat(t.name," already exists, skipping registration")),[2]):(t.name===void 0&&(t.name=_a(),this.loggerProvider.warn(`Plugin name is undefined.
12
+ Generating a random UUID for plugin name: `.concat(t.name,`.
13
+ Set a name for the plugin to prevent it from being added multiple times.`))),t.type=(r=t.type)!==null&&r!==void 0?r:"enrichment",[4,(a=t.setup)===null||a===void 0?void 0:a.call(t,n,this.client)]);case 1:return o.sent(),this.plugins.push(t),[2]}})})},e.prototype.deregister=function(t,n){var r;return te(this,void 0,void 0,function(){var a,o;return ee(this,function(l){switch(l.label){case 0:return a=this.plugins.findIndex(function(c){return c.name===t}),a===-1?(n.loggerProvider.warn("Plugin with name ".concat(t," does not exist, skipping deregistration")),[2]):(o=this.plugins[a],this.plugins.splice(a,1),[4,(r=o.teardown)===null||r===void 0?void 0:r.call(o)]);case 1:return l.sent(),[2]}})})},e.prototype.reset=function(t){this._clearOptOutListeners(),this.applying=!1;var n=this.plugins;n.map(function(r){var a;return(a=r.teardown)===null||a===void 0?void 0:a.call(r)}),this.plugins=[],this.client=t},e.prototype.push=function(t){var n=this;return new Promise(function(r){n.queue.push([t,r]),n.scheduleApply(0)})},e.prototype.scheduleApply=function(t){var n=this;this.applying||(this.applying=!0,setTimeout(function(){n.apply(n.queue.shift()).then(function(){n.applying=!1,n.queue.length>0&&n.scheduleApply(0)})},t))},e.prototype.apply=function(t){return te(this,void 0,void 0,function(){var n,r,a,o,l,c,d,b,S,f,m,g,v,b,S,w,E,T,C,k,j,N;return ee(this,function(R){switch(R.label){case 0:if(!t)return[2];n=Ae(t,1),r=n[0],a=Ae(t,2),o=a[1],this.loggerProvider.log("Timeline.apply: Initial event",r),l=this.plugins.filter(function(P){return P.type==="before"}),R.label=1;case 1:R.trys.push([1,6,7,8]),c=_e(l),d=c.next(),R.label=2;case 2:return d.done?[3,5]:(b=d.value,b.execute?[4,b.execute(ce({},r))]:[3,4]);case 3:if(S=R.sent(),S===null)return this.loggerProvider.log("Timeline.apply: Event filtered out by before plugin '".concat(String(b.name),"', event: ").concat(JSON.stringify(r))),o({event:r,code:0,message:""}),[2];r=S,this.loggerProvider.log("Timeline.apply: Event after before plugin '".concat(String(b.name),"', event: ").concat(JSON.stringify(r))),R.label=4;case 4:return d=c.next(),[3,2];case 5:return[3,8];case 6:return f=R.sent(),C={error:f},[3,8];case 7:try{d&&!d.done&&(k=c.return)&&k.call(c)}finally{if(C)throw C.error}return[7];case 8:m=this.plugins.filter(function(P){return P.type==="enrichment"||P.type===void 0}),R.label=9;case 9:R.trys.push([9,14,15,16]),g=_e(m),v=g.next(),R.label=10;case 10:return v.done?[3,13]:(b=v.value,b.execute?[4,b.execute(ce({},r))]:[3,12]);case 11:if(S=R.sent(),S===null)return this.loggerProvider.log("Timeline.apply: Event filtered out by enrichment plugin '".concat(String(b.name),"', event: ").concat(JSON.stringify(r))),o({event:r,code:0,message:""}),[2];r=S,this.loggerProvider.log("Timeline.apply: Event after enrichment plugin '".concat(String(b.name),"', event: ").concat(JSON.stringify(r))),R.label=12;case 12:return v=g.next(),[3,10];case 13:return[3,16];case 14:return w=R.sent(),j={error:w},[3,16];case 15:try{v&&!v.done&&(N=g.return)&&N.call(g)}finally{if(j)throw j.error}return[7];case 16:return E=this.plugins.filter(function(P){return P.type==="destination"}),this.loggerProvider.log("Timeline.apply: Final event before destinations, event: ".concat(JSON.stringify(r))),T=E.map(function(P){var L=ce({},r);return P.execute(L).catch(function(H){return vo(L,0,String(H))})}),Promise.all(T).then(function(P){var L=Ae(P,1),H=L[0],D=H||vo(r,100,"Event not tracked, no destination plugins on the instance");o(D)}),[2]}})})},e.prototype.flush=function(){return te(this,void 0,void 0,function(){var t,n,r,a=this;return ee(this,function(o){switch(o.label){case 0:return t=this.queue,this.queue=[],[4,Promise.all(t.map(function(l){return a.apply(l)}))];case 1:return o.sent(),n=this.plugins.filter(function(l){return l.type==="destination"}),r=n.map(function(l){return l.flush&&l.flush()}),[4,Promise.all(r)];case 2:return o.sent(),[2]}})})},e.prototype.addOptOutListener=function(t){this._optOutListeners.push(t)},e.prototype._clearOptOutListeners=function(){this._optOutListeners=[]},e.prototype.onIdentityChanged=function(t){this.plugins.forEach(function(n){var r;(r=n.onIdentityChanged)===null||r===void 0||r.call(n,t)})},e.prototype.onSessionIdChanged=function(t){this.plugins.forEach(function(n){var r;(r=n.onSessionIdChanged)===null||r===void 0||r.call(n,t)})},e.prototype.onOptOutChanged=function(t){this.plugins.forEach(function(n){var r;(r=n.onOptOutChanged)===null||r===void 0||r.call(n,t)}),this._callOptOutListeners(t)},e.prototype._callOptOutListeners=function(t){return te(this,void 0,void 0,function(){var n,r,a,o,l,c,d;return ee(this,function(f){switch(f.label){case 0:f.trys.push([0,7,8,9]),n=_e(this._optOutListeners),r=n.next(),f.label=1;case 1:if(r.done)return[3,6];a=r.value,f.label=2;case 2:return f.trys.push([2,4,,5]),[4,a(t)];case 3:return f.sent(),[3,5];case 4:return o=f.sent(),this.loggerProvider.error("Error calling optOut listener",o),[3,5];case 5:return r=n.next(),[3,1];case 6:return[3,9];case 7:return l=f.sent(),c={error:l},[3,9];case 8:try{r&&!r.done&&(d=n.return)&&d.call(n)}finally{if(c)throw c.error}return[7];case 9:return[2]}})})},e.prototype.onReset=function(){this.plugins.forEach(function(t){var n;(n=t.onReset)===null||n===void 0||n.call(t)})},e})(),jD=function(e,t,n){var r=typeof e=="string"?{event_type:e}:e;return ce(ce(ce({},r),n),t&&{event_properties:t})},qv=function(e,t){var n=ce(ce({},t),{event_type:sr.IDENTIFY,user_properties:e.getUserProperties()});return n},RD=function(e,t,n,r){var a,o=ce(ce({},r),{event_type:sr.GROUP_IDENTIFY,group_properties:n.getUserProperties(),groups:(a={},a[e]=t,a)});return o},_D=function(e,t,n){var r,a=new nu;a.set(e,t);var o=ce(ce({},n),{event_type:sr.IDENTIFY,user_properties:a.getUserProperties(),groups:(r={},r[e]=t,r)});return o},OD=function(e,t){return ce(ce({},t),{event_type:sr.REVENUE,event_properties:e.getEventProperties()})},Sn=function(e){return{promise:e||Promise.resolve()}},MD=(function(){function e(t){t===void 0&&(t="$default"),this.initializing=!1,this.isReady=!1,this.q=[],this.dispatchQ=[],this.logEvent=this.track.bind(this),this.timeline=new ND(this),this.name=t}return e.prototype._init=function(t){return te(this,void 0,void 0,function(){return ee(this,function(n){switch(n.label){case 0:return this.config=t,this.timeline.reset(this),this.timeline.loggerProvider=this.config.loggerProvider,[4,this.runQueuedFunctions("q")];case 1:return n.sent(),this.isReady=!0,[2]}})})},e.prototype.runQueuedFunctions=function(t){return te(this,void 0,void 0,function(){var n,r,a,o,l,c,d,f;return ee(this,function(m){switch(m.label){case 0:n=this[t],this[t]=[],m.label=1;case 1:m.trys.push([1,8,9,10]),r=_e(n),a=r.next(),m.label=2;case 2:return a.done?[3,7]:(o=a.value,l=o(),l&&"promise"in l?[4,l.promise]:[3,4]);case 3:return m.sent(),[3,6];case 4:return[4,l];case 5:m.sent(),m.label=6;case 6:return a=r.next(),[3,2];case 7:return[3,10];case 8:return c=m.sent(),d={error:c},[3,10];case 9:try{a&&!a.done&&(f=r.return)&&f.call(r)}finally{if(d)throw d.error}return[7];case 10:return this[t].length?[4,this.runQueuedFunctions(t)]:[3,12];case 11:m.sent(),m.label=12;case 12:return[2]}})})},e.prototype.track=function(t,n,r){var a=jD(t,n,r);return this.userProperties=this.getOperationAppliedUserProperties(a.user_properties),Sn(this.dispatch(a))},e.prototype.identify=function(t,n){var r=qv(t,n);return this.userProperties=this.getOperationAppliedUserProperties(r.user_properties),Sn(this.dispatch(r))},e.prototype.groupIdentify=function(t,n,r,a){var o=RD(t,n,r,a);return Sn(this.dispatch(o))},e.prototype.setGroup=function(t,n,r){var a=_D(t,n,r);return this.userProperties=this.getOperationAppliedUserProperties(a.user_properties),Sn(this.dispatch(a))},e.prototype.revenue=function(t,n){var r=OD(t,n);return Sn(this.dispatch(r))},e.prototype.add=function(t){return this.isReady?this._addPlugin(t):(this.q.push(this._addPlugin.bind(this,t)),Sn())},e.prototype._addPlugin=function(t){return Sn(this.timeline.register(t,this.config))},e.prototype.remove=function(t){return this.isReady?this._removePlugin(t):(this.q.push(this._removePlugin.bind(this,t)),Sn())},e.prototype._removePlugin=function(t){return Sn(this.timeline.deregister(t,this.config))},e.prototype.dispatchWithCallback=function(t,n){if(!this.isReady)return n(vo(t,0,CD));this.process(t).then(n)},e.prototype.dispatch=function(t){return te(this,void 0,void 0,function(){var n=this;return ee(this,function(r){return this.isReady?[2,this.process(t)]:[2,new Promise(function(a){n.dispatchQ.push(n.dispatchWithCallback.bind(n,t,a))})]})})},e.prototype.getOperationAppliedUserProperties=function(t){var n,r=(n=this.userProperties)!==null&&n!==void 0?n:{},a=ce({},r);if(t===void 0)return a;var o={};return Object.keys(t).forEach(function(l){Object.values(Ta).includes(l)||(o[l]=t[l])}),bD.forEach(function(l){if(Object.keys(t).includes(l)){var c=t[l];switch(l){case Ta.CLEAR_ALL:Object.keys(a).forEach(function(d){delete a[d]});break;case Ta.UNSET:Object.keys(c).forEach(function(d){delete a[d]});break;case Ta.SET:Object.assign(a,c);break}}}),Object.assign(a,o),a},e.prototype.process=function(t){return te(this,void 0,void 0,function(){var a,n,r,a;return ee(this,function(o){switch(o.label){case 0:return o.trys.push([0,2,,3]),this.config.optOut?[2,vo(t,0,ED)]:(t.event_type===sr.IDENTIFY&&this.timeline.onIdentityChanged({userProperties:this.userProperties}),[4,this.timeline.push(t)]);case 1:return a=o.sent(),a.code===200?this.config.loggerProvider.log(a.message):a.code===100?this.config.loggerProvider.warn(a.message):this.config.loggerProvider.error(a.message),[2,a];case 2:return n=o.sent(),r=String(n),this.config.loggerProvider.error(r),a=vo(t,0,r),[2,a];case 3:return[2]}})})},e.prototype.setOptOut=function(t){if(!this.isReady){this.q.push(this._setOptOut.bind(this,!!t));return}this._setOptOut(t)},e.prototype._setOptOut=function(t){this.config.optOut!==t&&(this.config.optOut=!!t,this.timeline.onOptOutChanged(t))},e.prototype.flush=function(){return Sn(this.timeline.flush())},e.prototype.plugin=function(t){var n=this.timeline.plugins.find(function(r){return r.name===t});if(n===void 0){this.config.loggerProvider.debug("Cannot find plugin with name ".concat(t));return}return n},e.prototype.plugins=function(t){return this.timeline.plugins.filter(function(n){return n instanceof t})},e})(),DD=(function(){function e(){this.productId="",this.quantity=1,this.price=0}return e.prototype.setProductId=function(t){return this.productId=t,this},e.prototype.setQuantity=function(t){return t>0&&(this.quantity=t),this},e.prototype.setPrice=function(t){return this.price=t,this},e.prototype.setRevenueType=function(t){return this.revenueType=t,this},e.prototype.setCurrency=function(t){return this.currency=t,this},e.prototype.setRevenue=function(t){return this.revenue=t,this},e.prototype.setReceipt=function(t){return this.receipt=t,this},e.prototype.setReceiptSig=function(t){return this.receiptSig=t,this},e.prototype.setEventProperties=function(t){return gg(t)&&(this.properties=t),this},e.prototype.getEventProperties=function(){var t=this.properties?ce({},this.properties):{};return t[ni.REVENUE_PRODUCT_ID]=this.productId,t[ni.REVENUE_QUANTITY]=this.quantity,t[ni.REVENUE_PRICE]=this.price,t[ni.REVENUE_TYPE]=this.revenueType,t[ni.REVENUE_CURRENCY]=this.currency,t[ni.REVENUE]=this.revenue,t[ni.RECEIPT]=this.receipt,t[ni.RECEIPT_SIG]=this.receiptSig,t},e})(),ni;(function(e){e.REVENUE_PRODUCT_ID="$productId",e.REVENUE_QUANTITY="$quantity",e.REVENUE_PRICE="$price",e.REVENUE_TYPE="$revenueType",e.REVENUE_CURRENCY="$currency",e.REVENUE="$revenue",e.RECEIPT="$receipt",e.RECEIPT_SIG="$receiptSig"})(ni||(ni={}));var ID=function(e,t){var n=Math.max(t,1);return e.reduce(function(r,a,o){var l=Math.floor(o/n);return r[l]||(r[l]=[]),r[l].push(a),r},[])},Wn;(function(e){e[e.None=0]="None",e[e.Error=1]="Error",e[e.Warn=2]="Warn",e[e.Verbose=3]="Verbose",e[e.Debug=4]="Debug"})(Wn||(Wn={}));var id="Amplitude Logger ",ko=(function(){function e(){this.logLevel=Wn.None}return e.prototype.disable=function(){this.logLevel=Wn.None},e.prototype.enable=function(t){t===void 0&&(t=Wn.Warn),this.logLevel=t},e.prototype.log=function(){for(var t=[],n=0;n<arguments.length;n++)t[n]=arguments[n];this.logLevel<Wn.Verbose||console.log("".concat(id,"[Log]: ").concat(t.join(" ")))},e.prototype.warn=function(){for(var t=[],n=0;n<arguments.length;n++)t[n]=arguments[n];this.logLevel<Wn.Warn||console.warn("".concat(id,"[Warn]: ").concat(t.join(" ")))},e.prototype.error=function(){for(var t=[],n=0;n<arguments.length;n++)t[n]=arguments[n];this.logLevel<Wn.Error||console.error("".concat(id,"[Error]: ").concat(t.join(" ")))},e.prototype.debug=function(){for(var t=[],n=0;n<arguments.length;n++)t[n]=arguments[n];this.logLevel<Wn.Debug||console.log("".concat(id,"[Debug]: ").concat(t.join(" ")))},e})(),_d=function(){return{flushMaxRetries:12,flushQueueSize:200,flushIntervalMillis:1e4,instanceName:Jk,logLevel:Wn.Warn,loggerProvider:new ko,offline:!1,optOut:!1,serverUrl:Hv,serverZone:"US",useBatch:!1}},rC=(function(){function e(t){var n,r,a,o;this._optOut=!1;var l=_d();this.apiKey=t.apiKey,this.flushIntervalMillis=(n=t.flushIntervalMillis)!==null&&n!==void 0?n:l.flushIntervalMillis,this.flushMaxRetries=t.flushMaxRetries||l.flushMaxRetries,this.flushQueueSize=t.flushQueueSize||l.flushQueueSize,this.instanceName=t.instanceName||l.instanceName,this.loggerProvider=t.loggerProvider||l.loggerProvider,this.logLevel=(r=t.logLevel)!==null&&r!==void 0?r:l.logLevel,this.minIdLength=t.minIdLength,this.plan=t.plan,this.ingestionMetadata=t.ingestionMetadata,this.offline=t.offline!==void 0?t.offline:l.offline,this.optOut=(a=t.optOut)!==null&&a!==void 0?a:l.optOut,this.serverUrl=t.serverUrl,this.serverZone=t.serverZone||l.serverZone,this.storageProvider=t.storageProvider,this.transportProvider=t.transportProvider,this.useBatch=(o=t.useBatch)!==null&&o!==void 0?o:l.useBatch,this.loggerProvider.enable(this.logLevel);var c=iC(t.serverUrl,t.serverZone,t.useBatch);this.serverZone=c.serverZone,this.serverUrl=c.serverUrl}return Object.defineProperty(e.prototype,"optOut",{get:function(){return this._optOut},set:function(t){this._optOut=t},enumerable:!1,configurable:!0}),e})(),PD=function(e,t){return e==="EU"?t?tC:Zk:t?eC:Hv},iC=function(e,t,n){if(e===void 0&&(e=""),t===void 0&&(t=_d().serverZone),n===void 0&&(n=_d().useBatch),e)return{serverUrl:e,serverZone:void 0};var r=["US","EU"].includes(t)?t:_d().serverZone;return{serverZone:r,serverUrl:PD(r,n)}},LD=(function(){function e(){this.sdk={metrics:{histogram:{}}}}return e.prototype.recordHistogram=function(t,n){this.sdk.metrics.histogram[t]=n},e})();function vg(e){return e>=200&&e<300}var Od=function(e){e===void 0&&(e=0);var t=new Error().stack||"";return t.split(`
14
+ `).slice(2+e).map(function(n){return n.trim()})},Tt=function(e){return function(){var t=ce({},e.config),n=t.loggerProvider,r=t.logLevel;return{logger:n,logLevel:r}}},zD=function(e,t){var n,r;t=t.replace(/\[(\w+)\]/g,".$1"),t=t.replace(/^\./,"");try{for(var a=_e(t.split(".")),o=a.next();!o.done;o=a.next()){var l=o.value;if(l in e)e=e[l];else return}}catch(c){n={error:c}}finally{try{o&&!o.done&&(r=a.return)&&r.call(a)}finally{if(n)throw n.error}}return e},kt=function(e,t){return function(){var n,r,a={};try{for(var o=_e(t),l=o.next();!l.done;l=o.next()){var c=l.value;a[c]=zD(e,c)}}catch(d){n={error:d}}finally{try{l&&!l.done&&(r=o.return)&&r.call(o)}finally{if(n)throw n.error}}return a}},it=function(e,t,n,r,a){return a===void 0&&(a=null),function(){for(var o=[],l=0;l<arguments.length;l++)o[l]=arguments[l];var c=n(),d=c.logger,f=c.logLevel;if(f&&f<Wn.Debug||!f||!d)return e.apply(a,o);var m={type:"invoke public method",name:t,args:o,stacktrace:Od(1),time:{start:new Date().toISOString()},states:{}};r&&m.states&&(m.states.before=r());var g=e.apply(a,o);return g&&g.promise?g.promise.then(function(){r&&m.states&&(m.states.after=r()),m.time&&(m.time.end=new Date().toISOString()),d.debug(JSON.stringify(m,null,2))}):(r&&m.states&&(m.states.after=r()),m.time&&(m.time.end=new Date().toISOString()),d.debug(JSON.stringify(m,null,2))),g}},UD=new Set([Hv,Zk,eC,tC]),BD=function(e,t){return t===void 0&&(t=!1),UD.has(e)?!0:t};function VD(e){return e instanceof Error?e.message:String(e)}function Pl(e){var t="";try{"body"in e&&(t=JSON.stringify(e.body,null,2))}catch{}return t}var FD=(function(){function e(t){this.name="amplitude",this.type="destination",this.retryTimeout=1e3,this.throttleTimeout=3e4,this.storageKey="",this.scheduleId=null,this.scheduledTimeout=0,this.flushId=null,this.queue=[],this.diagnosticsClient=t?.diagnosticsClient}return e.prototype.setup=function(t){var n;return te(this,void 0,void 0,function(){var r,a=this;return ee(this,function(o){switch(o.label){case 0:return this.config=t,this.storageKey="".concat(cD,"_").concat(this.config.apiKey.substring(0,10)),[4,(n=this.config.storageProvider)===null||n===void 0?void 0:n.get(this.storageKey)];case 1:return r=o.sent(),r&&r.length>0&&Promise.all(r.map(function(l){return a.execute(l)})).catch(),[2,Promise.resolve(void 0)]}})})},e.prototype.execute=function(t){var n=this;return t.insert_id||(t.insert_id=_a()),new Promise(function(r){var a={event:t,attempts:0,callback:function(o){return r(o)},timeout:0};n.queue.push(a),n.schedule(n.config.flushIntervalMillis),n.saveEvents()})},e.prototype.removeEventsExceedFlushMaxRetries=function(t){var n=this;return t.filter(function(r){return r.attempts+=1,r.attempts<n.config.flushMaxRetries?!0:(n.fulfillRequest([r],500,wD),!1)})},e.prototype.scheduleEvents=function(t){var n=this;t.forEach(function(r){n.schedule(r.timeout===0?n.config.flushIntervalMillis:r.timeout)})},e.prototype.schedule=function(t){var n=this;if(!this.config.offline&&(this.scheduleId===null||this.scheduleId&&t>this.scheduledTimeout)){this.scheduleId&&clearTimeout(this.scheduleId),this.scheduledTimeout=t,this.scheduleId=setTimeout(function(){n.queue=n.queue.map(function(r){return r.timeout=0,r}),n.flush(!0)},t);return}},e.prototype.resetSchedule=function(){this.scheduleId=null,this.scheduledTimeout=0},e.prototype.flush=function(t){return t===void 0&&(t=!1),te(this,void 0,void 0,function(){var n,r,a,o=this;return ee(this,function(l){switch(l.label){case 0:return this.config.offline?(this.resetSchedule(),this.config.loggerProvider.debug("Skipping flush while offline."),[2]):this.flushId?(this.resetSchedule(),this.config.loggerProvider.debug("Skipping flush because previous flush has not resolved."),[2]):(this.flushId=this.scheduleId,this.resetSchedule(),n=[],r=[],this.queue.forEach(function(c){return c.timeout===0?n.push(c):r.push(c)}),a=ID(n,this.config.flushQueueSize),[4,a.reduce(function(c,d){return te(o,void 0,void 0,function(){return ee(this,function(f){switch(f.label){case 0:return[4,c];case 1:return f.sent(),[4,this.send(d,t)];case 2:return[2,f.sent()]}})})},Promise.resolve())]);case 1:return l.sent(),this.flushId=null,this.scheduleEvents(this.queue),[2]}})})},e.prototype.send=function(t,n){var r;return n===void 0&&(n=!0),te(this,void 0,void 0,function(){var a,o,l,c,d,f;return ee(this,function(m){switch(m.label){case 0:if(!this.config.apiKey)return[2,this.fulfillRequest(t,400,TD)];a={api_key:this.config.apiKey,events:t.map(function(g){var v=g.event;v.extra;var b=Jd(v,["extra"]);return b}),options:{min_id_length:this.config.minIdLength},client_upload_time:new Date().toISOString(),request_metadata:this.config.requestMetadata},this.config.requestMetadata=new LD,m.label=1;case 1:return m.trys.push([1,3,,4]),o=iC(this.config.serverUrl,this.config.serverZone,this.config.useBatch).serverUrl,l=BD(o,this.config.enableRequestBodyCompression),[4,this.config.transportProvider.send(o,a,this.config._enableRequestBodyCompressionExperimental&&l)];case 2:return c=m.sent(),c===null?(this.fulfillRequest(t,0,SD),[2]):n?(this.handleResponse(c,t),[3,4]):("body"in c?this.fulfillRequest(t,c.statusCode,"".concat(c.status,": ").concat(Pl(c))):this.fulfillRequest(t,c.statusCode,c.status),[2]);case 3:return d=m.sent(),f=VD(d),this.config.loggerProvider.error(f),(r=this.diagnosticsClient)===null||r===void 0||r.recordEvent("analytics.events.unsuccessful.from.catch.error",{events:t.map(function(g){return g.event.event_type}),message:f,stack_trace:Od()}),this.handleResponse({status:Gt.Failed,statusCode:0},t),[3,4];case 4:return[2]}})})},e.prototype.handleResponse=function(t,n){var r;vg(t.statusCode)||(r=this.diagnosticsClient)===null||r===void 0||r.recordEvent("analytics.events.unsuccessful",{events:n.map(function(o){return o.event.event_type}),code:t.statusCode,status:t.status,body:Pl(t),stack_trace:Od()});var a=t.status;switch(a){case Gt.Success:{this.handleSuccessResponse(t,n);break}case Gt.Invalid:{this.handleInvalidResponse(t,n);break}case Gt.PayloadTooLarge:{this.handlePayloadTooLargeResponse(t,n);break}case Gt.RateLimit:{this.handleRateLimitResponse(t,n);break}default:{this.config.loggerProvider.warn(`{code: 0, error: "Status '`.concat(a,"' provided for ").concat(n.length,' events"}')),this.handleOtherResponse(n);break}}},e.prototype.handleSuccessResponse=function(t,n){this.fulfillRequest(n,t.statusCode,xD)},e.prototype.handleInvalidResponse=function(t,n){var r=this;if(t.body.missingField||t.body.error.startsWith(kD)){this.fulfillRequest(n,t.statusCode,t.body.error);return}var a=Je(Je(Je(Je([],Ae(Object.values(t.body.eventsWithInvalidFields)),!1),Ae(Object.values(t.body.eventsWithMissingFields)),!1),Ae(Object.values(t.body.eventsWithInvalidIdLengths)),!1),Ae(t.body.silencedEvents),!1).flat(),o=new Set(a),l=n.filter(function(d,f){if(o.has(f)){r.fulfillRequest([d],t.statusCode,t.body.error);return}return!0});l.length>0&&this.config.loggerProvider.warn(Pl(t));var c=this.removeEventsExceedFlushMaxRetries(l);this.scheduleEvents(c)},e.prototype.handlePayloadTooLargeResponse=function(t,n){if(n.length===1){this.fulfillRequest(n,t.statusCode,t.body.error);return}this.config.loggerProvider.warn(Pl(t)),this.config.flushQueueSize/=2;var r=this.removeEventsExceedFlushMaxRetries(n);this.scheduleEvents(r)},e.prototype.handleRateLimitResponse=function(t,n){var r=this,a=Object.keys(t.body.exceededDailyQuotaUsers),o=Object.keys(t.body.exceededDailyQuotaDevices),l=t.body.throttledEvents,c=new Set(a),d=new Set(o),f=new Set(l),m=n.filter(function(v,b){if(v.event.user_id&&c.has(v.event.user_id)||v.event.device_id&&d.has(v.event.device_id)){r.fulfillRequest([v],t.statusCode,t.body.error);return}return f.has(b)&&(v.timeout=r.throttleTimeout),!0});m.length>0&&this.config.loggerProvider.warn(Pl(t));var g=this.removeEventsExceedFlushMaxRetries(m);this.scheduleEvents(g)},e.prototype.handleOtherResponse=function(t){var n=this,r=t.map(function(o){return o.timeout=o.attempts*n.retryTimeout,o}),a=this.removeEventsExceedFlushMaxRetries(r);this.scheduleEvents(a)},e.prototype.fulfillRequest=function(t,n,r){var a,o,l;vg(n)?(l=this.diagnosticsClient)===null||l===void 0||l.increment("analytics.events.sent",t.length):((a=this.diagnosticsClient)===null||a===void 0||a.increment("analytics.events.dropped",t.length),(o=this.diagnosticsClient)===null||o===void 0||o.recordEvent("analytics.events.dropped",{events:t.map(function(c){return c.event.event_type}),code:n,message:r,stack_trace:Od()})),this.removeEvents(t),t.forEach(function(c){return c.callback(vo(c.event,n,r))})},e.prototype.saveEvents=function(){if(this.config.storageProvider){var t=this.queue.map(function(n){return n.event});this.config.storageProvider.set(this.storageKey,t)}},e.prototype.removeEvents=function(t){this.queue=this.queue.filter(function(n){return!t.some(function(r){return r.event.insert_id===n.event.insert_id})}),this.saveEvents()},e})(),HD=(function(){function e(){}return e.prototype.getApplicationContext=function(){return{versionName:this.versionName,language:qD(),platform:"Web",os:void 0,deviceModel:void 0}},e})(),qD=function(){return typeof navigator<"u"&&(navigator.languages&&navigator.languages[0]||navigator.language)||""},GD=(function(){function e(){this.queue=[]}return e.prototype.logEvent=function(t){this.receiver?this.receiver(t):this.queue.length<512&&this.queue.push(t)},e.prototype.setEventReceiver=function(t){this.receiver=t,this.queue.length>0&&(this.queue.forEach(function(n){t(n)}),this.queue=[])},e})(),va=function(){return va=Object.assign||function(t){for(var n,r=1,a=arguments.length;r<a;r++){n=arguments[r];for(var o in n)Object.prototype.hasOwnProperty.call(n,o)&&(t[o]=n[o])}return t},va.apply(this,arguments)};function Md(e){var t=typeof Symbol=="function"&&Symbol.iterator,n=t&&e[t],r=0;if(n)return n.call(e);if(e&&typeof e.length=="number")return{next:function(){return e&&r>=e.length&&(e=void 0),{value:e&&e[r++],done:!e}}};throw new TypeError(t?"Object is not iterable.":"Symbol.iterator is not defined.")}function kw(e,t){var n=typeof Symbol=="function"&&e[Symbol.iterator];if(!n)return e;var r=n.call(e),a,o=[],l;try{for(;(t===void 0||t-- >0)&&!(a=r.next()).done;)o.push(a.value)}catch(c){l={error:c}}finally{try{a&&!a.done&&(n=r.return)&&n.call(r)}finally{if(l)throw l.error}}return o}var Dd=function(e,t){var n,r,a=["string","number","boolean","undefined"],o=typeof e,l=typeof t;if(o!==l)return!1;try{for(var c=Md(a),d=c.next();!d.done;d=c.next()){var f=d.value;if(f===o)return e===t}}catch(E){n={error:E}}finally{try{d&&!d.done&&(r=c.return)&&r.call(c)}finally{if(n)throw n.error}}if(e==null&&t==null)return!0;if(e==null||t==null||e.length!==t.length)return!1;var m=Array.isArray(e),g=Array.isArray(t);if(m!==g)return!1;if(m&&g){for(var v=0;v<e.length;v++)if(!Dd(e[v],t[v]))return!1}else{var b=Object.keys(e).sort(),S=Object.keys(t).sort();if(!Dd(b,S))return!1;var w=!0;return Object.keys(e).forEach(function(E){Dd(e[E],t[E])||(w=!1)}),w}return!0},KD="$set",$D="$unset",YD="$clearAll";Object.entries||(Object.entries=function(e){for(var t=Object.keys(e),n=t.length,r=new Array(n);n--;)r[n]=[t[n],e[t[n]]];return r});var WD=(function(){function e(){this.identity={userProperties:{}},this.listeners=new Set}return e.prototype.editIdentity=function(){var t=this,n=va({},this.identity.userProperties),r=va(va({},this.identity),{userProperties:n});return{setUserId:function(a){return r.userId=a,this},setDeviceId:function(a){return r.deviceId=a,this},setUserProperties:function(a){return r.userProperties=a,this},setOptOut:function(a){return r.optOut=a,this},updateUserProperties:function(a){var o,l,c,d,f,m,g=r.userProperties||{};try{for(var v=Md(Object.entries(a)),b=v.next();!b.done;b=v.next()){var S=kw(b.value,2),w=S[0],E=S[1];switch(w){case KD:try{for(var T=(c=void 0,Md(Object.entries(E))),C=T.next();!C.done;C=T.next()){var k=kw(C.value,2),j=k[0],N=k[1];g[j]=N}}catch(L){c={error:L}}finally{try{C&&!C.done&&(d=T.return)&&d.call(T)}finally{if(c)throw c.error}}break;case $D:try{for(var R=(f=void 0,Md(Object.keys(E))),P=R.next();!P.done;P=R.next()){var j=P.value;delete g[j]}}catch(L){f={error:L}}finally{try{P&&!P.done&&(m=R.return)&&m.call(R)}finally{if(f)throw f.error}}break;case YD:g={};break}}}catch(L){o={error:L}}finally{try{b&&!b.done&&(l=v.return)&&l.call(v)}finally{if(o)throw o.error}}return r.userProperties=g,this},commit:function(){return t.setIdentity(r),this}}},e.prototype.getIdentity=function(){return va({},this.identity)},e.prototype.setIdentity=function(t){var n=va({},this.identity);this.identity=va({},t),Dd(n,this.identity)||this.listeners.forEach(function(r){r(t)})},e.prototype.addIdentityListener=function(t){this.listeners.add(t)},e.prototype.removeIdentityListener=function(t){this.listeners.delete(t)},e})(),Ll=typeof globalThis<"u"?globalThis:typeof global<"u"?global:self,Gv=(function(){function e(){this.identityStore=new WD,this.eventBridge=new GD,this.applicationContextProvider=new HD}return e.getInstance=function(t){return Ll.analyticsConnectorInstances||(Ll.analyticsConnectorInstances={}),Ll.analyticsConnectorInstances[t]||(Ll.analyticsConnectorInstances[t]=new e),Ll.analyticsConnectorInstances[t]},e})(),Co=function(e){return e===void 0&&(e=Jk),Gv.getInstance(e)},XD=function(e,t){Co(t).identityStore.editIdentity().setUserId(e).commit()},QD=function(e,t){Co(t).identityStore.editIdentity().setDeviceId(e).commit()},JD=(function(){function e(){this.name="identity",this.type="before",this.identityStore=Co().identityStore}return e.prototype.execute=function(t){return te(this,void 0,void 0,function(){var n;return ee(this,function(r){return n=t.user_properties,n&&this.identityStore.editIdentity().updateUserProperties(n).commit(),[2,t]})})},e.prototype.setup=function(t){return te(this,void 0,void 0,function(){return ee(this,function(n){return t.instanceName&&(this.identityStore=Co(t.instanceName).identityStore),[2]})})},e})(),aC=function(e,t){t===void 0&&(t=Date.now());var n=Date.now(),r=n-t;return r>e},sC=function(e,t,n){return t===void 0&&(t=""),n===void 0&&(n=10),[kf,t,e.substring(0,n)].filter(Boolean).join("_")},ZD=function(e){return"".concat(kf.toLowerCase(),"_").concat(e.substring(0,6))},eI=function(){var e,t,n,r;if(typeof navigator>"u")return"";var a=navigator.userLanguage;return(r=(n=(t=(e=navigator.languages)===null||e===void 0?void 0:e[0])!==null&&t!==void 0?t:navigator.language)!==null&&n!==void 0?n:a)!==null&&r!==void 0?r:""},ef=function(){var e,t=ze();if(!(!((e=t?.location)===null||e===void 0)&&e.search))return{};var n=t.location.search.substring(1).split("&").filter(Boolean),r=n.reduce(function(a,o){var l=o.split("=",2),c=Cw(l[0]),d=Cw(l[1]);return d&&(a[c]=d),a},{});return r},Cw=function(e){e===void 0&&(e="");try{return decodeURIComponent(e)}catch{return""}},yg=function(e,t){return!t||!t.length?!0:t.some(function(n){return typeof n=="string"?e===n:e.match(n)})},ka=function(e,t){var n=e;try{n=decodeURI(e)}catch(r){t?.error("Malformed URI sequence: ",r)}return n},tf=function(e){var t=0;if(e.length===0)return t;for(var n=0;n<e.length;n++){var r=e.charCodeAt(n);t=(t<<5)-t+r,t|=0}return t},tI=function(e,t){var n=tf(e.toString()),r=Math.abs(n),a=r*31,o=a%1e6;return o/1e6<t},Aw=function(e,t){var n=tf(e.toString()),r=Math.abs(n),a=r*31,o=a%1e5;return o/1e5<t},Kv=(function(){function e(){this.memoryStorage=new Map}return e.prototype.isEnabled=function(){return te(this,void 0,void 0,function(){return ee(this,function(t){return[2,!0]})})},e.prototype.get=function(t){return te(this,void 0,void 0,function(){return ee(this,function(n){return[2,this.memoryStorage.get(t)]})})},e.prototype.getRaw=function(t){return te(this,void 0,void 0,function(){var n;return ee(this,function(r){switch(r.label){case 0:return[4,this.get(t)];case 1:return n=r.sent(),[2,n?JSON.stringify(n):void 0]}})})},e.prototype.set=function(t,n){return te(this,void 0,void 0,function(){return ee(this,function(r){return this.memoryStorage.set(t,n),[2]})})},e.prototype.remove=function(t){return te(this,void 0,void 0,function(){return ee(this,function(n){return this.memoryStorage.delete(t),[2]})})},e.prototype.reset=function(){return te(this,void 0,void 0,function(){return ee(this,function(t){return this.memoryStorage.clear(),[2]})})},e})(),nI=function(){var e,t=ze();return(e=t?.navigator)===null||e===void 0?void 0:e.locks},nf=(function(){function e(t,n){n===void 0&&(n={}),this.options=ce({},t),this.config=n}return e.prototype.isEnabled=function(){return te(this,void 0,void 0,function(){var t,n,r,a,o=this;return ee(this,function(l){switch(l.label){case 0:return t="AMP_TEST",n=ce({},this.options),r=new e(n),a=String(Date.now()),[4,r.transaction(t,function(c){var d,f;try{c.set(a);var m=c.get(),g=m===a;return!g&&o.config.diagnosticsClient&&((d=o.config.diagnosticsClient)===null||d===void 0||d.recordEvent("cookies.isEnabled.failure",{reason:"Test Value mismatch",testKey:t,testValue:a,sync:!0})),g}catch(b){if(o.config.diagnosticsClient){var v=b instanceof Error?b.message:String(b);(f=o.config.diagnosticsClient)===null||f===void 0||f.recordEvent("cookies.isEnabled.failure",{reason:"Cookie getter/setter failed",testKey:t,testValue:a,error:v,sync:!0})}return!1}finally{c.set(null)}})];case 1:return[2,l.sent()]}})})},e.prototype.get=function(t){return te(this,void 0,void 0,function(){var n;return ee(this,function(r){switch(r.label){case 0:return[4,this.getRaw(t)];case 1:return n=r.sent(),[2,this.decodeCookieValue(t,n)]}})})},e.prototype.decodeCookieValue=function(t,n){if(n)try{var r=oC(n);if(r===void 0){console.error("Amplitude Logger [Error]: Failed to decode cookie value for key: ".concat(t,", value: ").concat(n));return}return JSON.parse(r)}catch{console.error("Amplitude Logger [Error]: Failed to parse cookie value for key: ".concat(t,", value: ").concat(n));return}},e.prototype.getSync=function(t){var n=this.getRawSync(t);return this.decodeCookieValue(t,n)},e.prototype.getRaw=function(t){var n,r;return te(this,void 0,void 0,function(){var a,o,l,c,d,f,m,g,v;return ee(this,function(b){switch(b.label){case 0:a=ze(),o=a,b.label=1;case 1:return b.trys.push([1,4,,5]),l=o?.cookieStore,l?[4,l.getAll(t)]:[3,3];case 2:if(c=b.sent(),c){c.length>1&&((n=this.config.diagnosticsClient)===null||n===void 0||n.recordEvent("cookies.duplicate",{cookies:c.map(function(S){return S.domain})}),(r=this.config.diagnosticsClient)===null||r===void 0||r.increment("cookies.duplicate.occurrence.cookieStore"));try{for(d=_e(c),f=d.next();!f.done;f=d.next())if(m=f.value,lC(m.domain,this.options.domain))return[2,m.value]}catch(S){g={error:S}}finally{try{f&&!f.done&&(v=d.return)&&v.call(d)}finally{if(g)throw g.error}}}b.label=3;case 3:return[3,5];case 4:return b.sent(),[3,5];case 5:return[2,this.getRawSync(t)]}})})},e.prototype.getRawSync=function(t){var n=this,r,a,o=ze(),l=((a=(r=o?.document)===null||r===void 0?void 0:r.cookie.split("; "))!==null&&a!==void 0?a:[]).filter(function(f){return f.indexOf(t+"=")===0}),c=void 0,d=this.config.duplicateResolverFn;if(typeof d=="function"&&l.length>1&&(c=l.find(function(f){var m;try{var g=d(f.substring(t.length+1));return g||(m=n.config.diagnosticsClient)===null||m===void 0||m.increment("cookies.duplicate.occurrence.document.cookie"),g}catch{return!1}})),c||(c=l[0]),!!c)return c.substring(t.length+1)},e.prototype.set=function(t,n){return te(this,void 0,void 0,function(){return ee(this,function(r){return this.setSync(t,n),[2]})})},e.prototype.setSync=function(t,n){var r;try{var a=(r=this.options.expirationDays)!==null&&r!==void 0?r:0,o=n!==null?a:-1,l=void 0;if(o){var c=new Date;c.setTime(c.getTime()+o*24*60*60*1e3),l=c}var d="".concat(t,"=").concat(btoa(encodeURIComponent(JSON.stringify(n))));l&&(d+="; expires=".concat(l.toUTCString())),d+="; path=/",this.options.domain&&(d+="; domain=".concat(this.options.domain)),this.options.secure&&(d+="; Secure"),this.options.sameSite&&(d+="; SameSite=".concat(this.options.sameSite));var f=ze();f&&(f.document.cookie=d)}catch(g){var m=g instanceof Error?g.message:String(g);console.error("Amplitude Logger [Error]: Failed to set cookie for key: ".concat(t,". Error: ").concat(m))}},e.prototype.remove=function(t){return te(this,void 0,void 0,function(){return ee(this,function(n){switch(n.label){case 0:return[4,this.set(t,null)];case 1:return n.sent(),[2]}})})},e.prototype.reset=function(){return te(this,void 0,void 0,function(){return ee(this,function(t){return[2]})})},e.isDomainWritable=function(t){return te(this,void 0,void 0,function(){var n,r,a,o;return ee(this,function(l){switch(l.label){case 0:if(e.cachedTlds[t])return[2,!0];n={domain:"."+t},r="AMP_TLDTEST",a=new e(n),l.label=1;case 1:return l.trys.push([1,3,,4]),[4,a.transaction(r,function(c){if(e.cachedTlds[t])return!0;try{c.set(1);var d=!!c.get();return d&&(e.cachedTlds[t]=!0),d}finally{c.set(null)}})];case 2:return o=l.sent(),[2,!!o];case 3:return l.sent(),[2,!1];case 4:return[2]}})})},e.prototype.transaction=function(t,n){return te(this,void 0,void 0,function(){var r,a,o=this;return ee(this,function(l){switch(l.label){case 0:return r=nI(),a=function(){var c={get:function(){return o.getSync(t)},set:function(d){return o.setSync(t,d)}};return n(c)},r?[4,r.request("com.amplitude:cookie-lock:".concat(t),a)]:[2,a()];case 1:return[2,l.sent()]}})})},e.cachedTlds={},e})(),rI=function(e){try{return decodeURIComponent(atob(e))}catch{return}},iI=function(e){try{return decodeURIComponent(atob(decodeURIComponent(e)))}catch{return}},oC=function(e){var t;return(t=rI(e))!==null&&t!==void 0?t:iI(e)},lC=function(e,t){if(e===""&&t==="")return!0;if(!e||!t)return!1;var n=e.startsWith(".")?e.substring(1):e,r=t.startsWith(".")?t.substring(1):t;return n.toLowerCase()===r.toLowerCase()},Nw=function(e,t,n){return t===void 0&&(t=""),n===void 0&&(n=10),[kf,t,e.substring(0,n)].filter(Boolean).join("_")},$v=(function(){function e(t){this.storage=t}return e.prototype.isEnabled=function(){return te(this,void 0,void 0,function(){var t,n,r,a;return ee(this,function(o){switch(o.label){case 0:if(!this.storage)return[2,!1];t=String(Date.now()),n=new e(this.storage),r="AMP_TEST",o.label=1;case 1:return o.trys.push([1,4,5,7]),[4,n.set(r,t)];case 2:return o.sent(),[4,n.get(r)];case 3:return a=o.sent(),[2,a===t];case 4:return o.sent(),[2,!1];case 5:return[4,n.remove(r)];case 6:return o.sent(),[7];case 7:return[2]}})})},e.prototype.get=function(t){return te(this,void 0,void 0,function(){var n;return ee(this,function(r){switch(r.label){case 0:return r.trys.push([0,2,,3]),[4,this.getRaw(t)];case 1:return n=r.sent(),n?[2,JSON.parse(n)]:[2,void 0];case 2:return r.sent(),console.error("[Amplitude] Error: Could not get value from storage"),[2,void 0];case 3:return[2]}})})},e.prototype.getRaw=function(t){var n;return te(this,void 0,void 0,function(){return ee(this,function(r){return[2,((n=this.storage)===null||n===void 0?void 0:n.getItem(t))||void 0]})})},e.prototype.set=function(t,n){var r;return te(this,void 0,void 0,function(){return ee(this,function(a){try{(r=this.storage)===null||r===void 0||r.setItem(t,JSON.stringify(n))}catch{}return[2]})})},e.prototype.remove=function(t){var n;return te(this,void 0,void 0,function(){return ee(this,function(r){try{(n=this.storage)===null||n===void 0||n.removeItem(t)}catch{}return[2]})})},e.prototype.reset=function(){var t;return te(this,void 0,void 0,function(){return ee(this,function(n){try{(t=this.storage)===null||t===void 0||t.clear()}catch{}return[2]})})},e})(),aI=10,sI=1,ot={TAGS:"tags",COUNTERS:"counters",HISTOGRAMS:"histograms",EVENTS:"events",INTERNAL:"internal"},jw={LAST_FLUSH_TIMESTAMP:"last_flush_timestamp"},Rw=(function(){function e(t,n){this.dbPromise=null,this.logger=n,this.dbName="AMP_diagnostics_".concat(t.substring(0,10))}return e.isSupported=function(){var t;return((t=ze())===null||t===void 0?void 0:t.indexedDB)!==void 0},e.prototype.getDB=function(){return te(this,void 0,void 0,function(){return ee(this,function(t){return this.dbPromise||(this.dbPromise=this.openDB()),[2,this.dbPromise]})})},e.prototype.openDB=function(){var t=this;return new Promise(function(n,r){var a=indexedDB.open(t.dbName,sI);a.onerror=function(){t.dbPromise=null,r(new Error("Failed to open IndexedDB"))},a.onsuccess=function(){var o=a.result;o.onclose=function(){t.dbPromise=null,t.logger.debug("DiagnosticsStorage: DB connection closed.")},o.onerror=function(l){t.logger.debug("DiagnosticsStorage: A global database error occurred.",l),o.close()},n(o)},a.onupgradeneeded=function(o){var l=o.target.result;t.createTables(l)}})},e.prototype.createTables=function(t){if(t.objectStoreNames.contains(ot.TAGS)||t.createObjectStore(ot.TAGS,{keyPath:"key"}),t.objectStoreNames.contains(ot.COUNTERS)||t.createObjectStore(ot.COUNTERS,{keyPath:"key"}),t.objectStoreNames.contains(ot.HISTOGRAMS)||t.createObjectStore(ot.HISTOGRAMS,{keyPath:"key"}),!t.objectStoreNames.contains(ot.EVENTS)){var n=t.createObjectStore(ot.EVENTS,{keyPath:"id",autoIncrement:!0});n.createIndex("time_idx","time",{unique:!1})}t.objectStoreNames.contains(ot.INTERNAL)||t.createObjectStore(ot.INTERNAL,{keyPath:"key"})},e.prototype.setTags=function(t){return te(this,void 0,void 0,function(){var n,r,a,o,l=this;return ee(this,function(c){switch(c.label){case 0:return c.trys.push([0,2,,3]),Object.entries(t).length===0?[2]:[4,this.getDB()];case 1:return n=c.sent(),r=n.transaction([ot.TAGS],"readwrite"),a=r.objectStore(ot.TAGS),[2,new Promise(function(d){var f=Object.entries(t);r.oncomplete=function(){d()},r.onabort=function(m){l.logger.debug("DiagnosticsStorage: Failed to set tags",m),d()},f.forEach(function(m){var g=Ae(m,2),v=g[0],b=g[1],S=a.put({key:v,value:b});S.onerror=function(w){l.logger.debug("DiagnosticsStorage: Failed to set tag",v,b,w)}})})];case 2:return o=c.sent(),this.logger.debug("DiagnosticsStorage: Failed to set tags",o),[3,3];case 3:return[2]}})})},e.prototype.incrementCounters=function(t){return te(this,void 0,void 0,function(){var n,r,a,o,l=this;return ee(this,function(c){switch(c.label){case 0:return c.trys.push([0,2,,3]),Object.entries(t).length===0?[2]:[4,this.getDB()];case 1:return n=c.sent(),r=n.transaction([ot.COUNTERS],"readwrite"),a=r.objectStore(ot.COUNTERS),[2,new Promise(function(d){var f=Object.entries(t);r.oncomplete=function(){d()},r.onabort=function(m){l.logger.debug("DiagnosticsStorage: Failed to increment counters",m),d()},f.forEach(function(m){var g=Ae(m,2),v=g[0],b=g[1],S=a.get(v);S.onsuccess=function(){var w=S.result,E=w?w.value:0,T=a.put({key:v,value:E+b});T.onerror=function(C){l.logger.debug("DiagnosticsStorage: Failed to update counter",v,C)}},S.onerror=function(w){l.logger.debug("DiagnosticsStorage: Failed to read existing counter",v,w)}})})];case 2:return o=c.sent(),this.logger.debug("DiagnosticsStorage: Failed to increment counters",o),[3,3];case 3:return[2]}})})},e.prototype.setHistogramStats=function(t){return te(this,void 0,void 0,function(){var n,r,a,o,l=this;return ee(this,function(c){switch(c.label){case 0:return c.trys.push([0,2,,3]),Object.entries(t).length===0?[2]:[4,this.getDB()];case 1:return n=c.sent(),r=n.transaction([ot.HISTOGRAMS],"readwrite"),a=r.objectStore(ot.HISTOGRAMS),[2,new Promise(function(d){var f=Object.entries(t);r.oncomplete=function(){d()},r.onabort=function(m){l.logger.debug("DiagnosticsStorage: Failed to set histogram stats",m),d()},f.forEach(function(m){var g=Ae(m,2),v=g[0],b=g[1],S=a.get(v);S.onsuccess=function(){var w=S.result,E;w?E={key:v,count:w.count+b.count,min:Math.min(w.min,b.min),max:Math.max(w.max,b.max),sum:w.sum+b.sum}:E={key:v,count:b.count,min:b.min,max:b.max,sum:b.sum};var T=a.put(E);T.onerror=function(C){l.logger.debug("DiagnosticsStorage: Failed to set histogram stats",v,C)}},S.onerror=function(w){l.logger.debug("DiagnosticsStorage: Failed to read existing histogram stats",v,w)}})})];case 2:return o=c.sent(),this.logger.debug("DiagnosticsStorage: Failed to set histogram stats",o),[3,3];case 3:return[2]}})})},e.prototype.addEventRecords=function(t){return te(this,void 0,void 0,function(){var n,r,a,o,l=this;return ee(this,function(c){switch(c.label){case 0:return c.trys.push([0,2,,3]),t.length===0?[2]:[4,this.getDB()];case 1:return n=c.sent(),r=n.transaction([ot.EVENTS],"readwrite"),a=r.objectStore(ot.EVENTS),[2,new Promise(function(d){r.oncomplete=function(){d()},r.onabort=function(m){l.logger.debug("DiagnosticsStorage: Failed to add event records",m),d()};var f=a.count();f.onsuccess=function(){var m=f.result,g=Math.max(0,aI-m);g<t.length&&l.logger.debug("DiagnosticsStorage: Only added ".concat(g," of ").concat(t.length," events due to storage limit")),t.slice(0,g).forEach(function(v){var b=a.add(v);b.onerror=function(S){l.logger.debug("DiagnosticsStorage: Failed to add event record",S)}})},f.onerror=function(m){l.logger.debug("DiagnosticsStorage: Failed to count existing events",m)}})];case 2:return o=c.sent(),this.logger.debug("DiagnosticsStorage: Failed to add event records",o),[3,3];case 3:return[2]}})})},e.prototype.setInternal=function(t,n){return te(this,void 0,void 0,function(){var r,a,o,l;return ee(this,function(c){switch(c.label){case 0:return c.trys.push([0,2,,3]),[4,this.getDB()];case 1:return r=c.sent(),a=r.transaction([ot.INTERNAL],"readwrite"),o=a.objectStore(ot.INTERNAL),[2,new Promise(function(d,f){a.onabort=function(){return f(new Error("Failed to set internal value"))};var m=o.put({key:t,value:n});m.onsuccess=function(){return d()},m.onerror=function(){return f(new Error("Failed to set internal value"))}})];case 2:return l=c.sent(),this.logger.debug("DiagnosticsStorage: Failed to set internal value",l),[3,3];case 3:return[2]}})})},e.prototype.getInternal=function(t){return te(this,void 0,void 0,function(){var n,r,a,o;return ee(this,function(l){switch(l.label){case 0:return l.trys.push([0,2,,3]),[4,this.getDB()];case 1:return n=l.sent(),r=n.transaction([ot.INTERNAL],"readonly"),a=r.objectStore(ot.INTERNAL),[2,new Promise(function(c,d){r.onabort=function(){return d(new Error("Failed to get internal value"))};var f=a.get(t);f.onsuccess=function(){return c(f.result)},f.onerror=function(){return d(new Error("Failed to get internal value"))}})];case 2:return o=l.sent(),this.logger.debug("DiagnosticsStorage: Failed to get internal value",o),[2,void 0];case 3:return[2]}})})},e.prototype.getLastFlushTimestamp=function(){return te(this,void 0,void 0,function(){var t,n;return ee(this,function(r){switch(r.label){case 0:return r.trys.push([0,2,,3]),[4,this.getInternal(jw.LAST_FLUSH_TIMESTAMP)];case 1:return t=r.sent(),[2,t?parseInt(t.value,10):void 0];case 2:return n=r.sent(),this.logger.debug("DiagnosticsStorage: Failed to get last flush timestamp",n),[2,void 0];case 3:return[2]}})})},e.prototype.setLastFlushTimestamp=function(t){return te(this,void 0,void 0,function(){var n;return ee(this,function(r){switch(r.label){case 0:return r.trys.push([0,2,,3]),[4,this.setInternal(jw.LAST_FLUSH_TIMESTAMP,t.toString())];case 1:return r.sent(),[3,3];case 2:return n=r.sent(),this.logger.debug("DiagnosticsStorage: Failed to set last flush timestamp",n),[3,3];case 3:return[2]}})})},e.prototype.clearTable=function(t,n){return new Promise(function(r,a){var o=t.objectStore(n),l=o.clear();l.onsuccess=function(){return r()},l.onerror=function(){return a(new Error("Failed to clear table ".concat(n)))}})},e.prototype.getAllAndClear=function(){return te(this,void 0,void 0,function(){var t,n,r,a,o,l,c,d;return ee(this,function(f){switch(f.label){case 0:return f.trys.push([0,4,,5]),[4,this.getDB()];case 1:return t=f.sent(),n=t.transaction([ot.TAGS,ot.COUNTERS,ot.HISTOGRAMS,ot.EVENTS],"readwrite"),[4,Promise.all([this.getAllFromStore(n,ot.TAGS),this.getAllFromStore(n,ot.COUNTERS),this.getAllFromStore(n,ot.HISTOGRAMS),this.getAllFromStore(n,ot.EVENTS)])];case 2:return r=Ae.apply(void 0,[f.sent(),4]),a=r[0],o=r[1],l=r[2],c=r[3],[4,Promise.all([this.clearTable(n,ot.COUNTERS),this.clearTable(n,ot.HISTOGRAMS),this.clearTable(n,ot.EVENTS)])];case 3:return f.sent(),[2,{tags:a,counters:o,histogramStats:l,events:c}];case 4:return d=f.sent(),this.logger.debug("DiagnosticsStorage: Failed to get all and clear data",d),[2,{tags:[],counters:[],histogramStats:[],events:[]}];case 5:return[2]}})})},e.prototype.getAllFromStore=function(t,n){return new Promise(function(r,a){var o=t.objectStore(n),l=o.getAll();l.onsuccess=function(){return r(l.result)},l.onerror=function(){return a(new Error("Failed to get all from ".concat(n)))}})},e})(),oI="__AMPLITUDE_SCRIPT_URL__",lI="sdk.error.uncaught",uI=function(){var e=ze();if(!e)return[];var t=e[oI];return Array.isArray(t)?t:typeof t=="string"?[t]:[]},cI=function(e){var t=ze();if(!(!t||typeof t.addEventListener!="function")){var n=function(o){var l=o.error instanceof Error?o.error:void 0,c=l?.stack,d=_w({filename:o.filename,stack:c});d&&a({type:"error",message:o.message,stack:c,filename:o.filename,errorName:l?.name,metadata:{colno:o.colno,lineno:o.lineno,isTrusted:o.isTrusted,matchReason:d}})},r=function(o){var l,c=o.reason instanceof Error?o.reason:void 0,d=c?.stack,f=dI(d),m=_w({filename:f,stack:d});m&&a({type:"unhandledrejection",message:(l=c?.message)!==null&&l!==void 0?l:fI(o.reason),stack:d,filename:f,errorName:c?.name,metadata:{isTrusted:o.isTrusted,matchReason:m}})},a=function(o){e.recordEvent(lI,ce({type:o.type,message:o.message,filename:o.filename,error_name:o.errorName,stack:o.stack},o.metadata))};t.addEventListener("error",n,!0),t.addEventListener("unhandledrejection",r,!0)}},_w=function(e){var t,n,r=uI();if(r.length!==0)try{for(var a=_e(r),o=a.next();!o.done;o=a.next()){var l=o.value;if(e.filename&&e.filename.includes(l))return"filename";if(e.stack&&e.stack.includes(l))return"stack"}}catch(c){t={error:c}}finally{try{o&&!o.done&&(n=a.return)&&n.call(a)}finally{if(t)throw t.error}}},dI=function(e){if(e){var t=e.match(/(https?:\/\/\S+?)(?=[)\s]|$)/);return t?t[1]:void 0}},fI=function(e){if(typeof e=="string")return e;try{return JSON.stringify(e)}catch{return"[object Object]"}},hI=1e3,ad=300*1e3,pI="https://diagnostics.prod.us-west-2.amplitude.com/v1/capture",mI="https://diagnostics.prod.eu-central-1.amplitude.com/v1/capture",sm=1e4,gI=10,vI=(function(){function e(t,n,r,a){r===void 0&&(r="US"),this.inMemoryTags={},this.inMemoryCounters={},this.inMemoryHistograms={},this.inMemoryEvents=[],this.saveTimer=null,this.flushTimer=null,this.apiKey=t,this.logger=n,this.serverUrl=r==="US"?pI:mI,this.logger.debug("DiagnosticsClient: Initializing with options",JSON.stringify(a,null,2)),this.config=ce({enabled:!0,sampleRate:0},a),this.startTimestamp=Date.now(),this.shouldTrack=Aw(this.startTimestamp,this.config.sampleRate)&&this.config.enabled,Rw.isSupported()?this.storage=new Rw(t,n):this.logger.debug("DiagnosticsClient: IndexedDB is not supported"),this.initializeFlushInterval(),this.shouldTrack&&(this.increment("sdk.diagnostics.sampled.in.and.enabled"),cI(this))}return e.prototype.isStorageAndTrackEnabled=function(){return!!this.storage&&!!this.shouldTrack},e.prototype.setTag=function(t,n){if(this.isStorageAndTrackEnabled()){if(Object.keys(this.inMemoryTags).length>=sm){this.logger.debug("DiagnosticsClient: Early return setTags as reaching memory limit");return}this.inMemoryTags[t]=n,this.startTimersIfNeeded()}},e.prototype.increment=function(t,n){if(n===void 0&&(n=1),!!this.isStorageAndTrackEnabled()){if(Object.keys(this.inMemoryCounters).length>=sm){this.logger.debug("DiagnosticsClient: Early return increment as reaching memory limit");return}this.inMemoryCounters[t]=(this.inMemoryCounters[t]||0)+n,this.startTimersIfNeeded()}},e.prototype.recordHistogram=function(t,n){if(this.isStorageAndTrackEnabled()){if(Object.keys(this.inMemoryHistograms).length>=sm){this.logger.debug("DiagnosticsClient: Early return recordHistogram as reaching memory limit");return}var r=this.inMemoryHistograms[t];r?(r.count+=1,r.min=Math.min(r.min,n),r.max=Math.max(r.max,n),r.sum+=n):this.inMemoryHistograms[t]={count:1,min:n,max:n,sum:n},this.startTimersIfNeeded()}},e.prototype.recordEvent=function(t,n){if(this.isStorageAndTrackEnabled()){if(this.inMemoryEvents.length>=gI){this.logger.debug("DiagnosticsClient: Early return recordEvent as reaching memory limit");return}this.inMemoryEvents.push({event_name:t,time:Date.now(),event_properties:n}),this.startTimersIfNeeded()}},e.prototype.startTimersIfNeeded=function(){var t=this;this.saveTimer||(this.saveTimer=setTimeout(function(){t.saveAllDataToStorage().catch(function(n){t.logger.debug("DiagnosticsClient: Failed to save all data to storage",n)}).finally(function(){t.saveTimer=null})},hI)),this.flushTimer||(this.flushTimer=setTimeout(function(){t._flush().catch(function(n){t.logger.debug("DiagnosticsClient: Failed to flush",n)}).finally(function(){t.flushTimer=null})},ad))},e.prototype.saveAllDataToStorage=function(){return te(this,void 0,void 0,function(){var t,n,r,a;return ee(this,function(o){switch(o.label){case 0:return this.storage?(t=ce({},this.inMemoryTags),n=ce({},this.inMemoryCounters),r=ce({},this.inMemoryHistograms),a=Je([],Ae(this.inMemoryEvents),!1),this.inMemoryEvents=[],this.inMemoryTags={},this.inMemoryCounters={},this.inMemoryHistograms={},[4,Promise.all([this.storage.setTags(t),this.storage.incrementCounters(n),this.storage.setHistogramStats(r),this.storage.addEventRecords(a)])]):[2];case 1:return o.sent(),[2]}})})},e.prototype._flush=function(){return te(this,void 0,void 0,function(){var t,n,r,a,o,l,c,d,f,m;return ee(this,function(g){switch(g.label){case 0:return this.storage?[4,this.saveAllDataToStorage()]:[2];case 1:return g.sent(),this.saveTimer=null,this.flushTimer=null,[4,this.storage.getAllAndClear()];case 2:return t=g.sent(),n=t.tags,r=t.counters,a=t.histogramStats,o=t.events,this.storage.setLastFlushTimestamp(Date.now()),l={},n.forEach(function(v){l[v.key]=v.value}),c={},r.forEach(function(v){c[v.key]=v.value}),d={},a.forEach(function(v){d[v.key]={count:v.count,min:v.min,max:v.max,avg:Math.round(v.sum/v.count*100)/100}}),f=o.map(function(v){return{event_name:v.event_name,time:v.time,event_properties:v.event_properties}}),Object.keys(c).length===0&&Object.keys(d).length===0&&f.length===0?[2]:(m={tags:l,histogram:d,counters:c,events:f},this.fetch(m),[2])}})})},e.prototype.fetch=function(t){return te(this,void 0,void 0,function(){var n,r;return ee(this,function(a){switch(a.label){case 0:if(a.trys.push([0,2,,3]),!ze())throw new Error("DiagnosticsClient: Fetch is not supported");return[4,fetch(this.serverUrl,{method:"POST",headers:{"X-ApiKey":this.apiKey,"Content-Type":"application/json"},body:JSON.stringify(t)})];case 1:return n=a.sent(),n.ok?(this.logger.debug("DiagnosticsClient: Successfully sent diagnostics data"),[3,3]):(this.logger.debug("DiagnosticsClient: Failed to send diagnostics data."),[2]);case 2:return r=a.sent(),this.logger.debug("DiagnosticsClient: Failed to send diagnostics data. ",r),[3,3];case 3:return[2]}})})},e.prototype.initializeFlushInterval=function(){return te(this,void 0,void 0,function(){var t,n,r;return ee(this,function(a){switch(a.label){case 0:return this.storage?(t=Date.now(),[4,this.storage.getLastFlushTimestamp()]):[2];case 1:return n=a.sent()||-1,n===-1?(this.storage.setLastFlushTimestamp(t),this._setFlushTimer(ad),[2]):(r=t-n,r>=ad?(this._flush(),[2]):(this._setFlushTimer(ad-r),[2]))}})})},e.prototype._setFlushTimer=function(t){var n=this;this.flushTimer=setTimeout(function(){n._flush().catch(function(r){n.logger.debug("DiagnosticsClient: Failed to flush",r)}).finally(function(){n.flushTimer=null})},t)},e.prototype._setSampleRate=function(t){this.logger.debug("DiagnosticsClient: Setting sample rate to",t),this.config.sampleRate=t,this.shouldTrack=Aw(this.startTimestamp,this.config.sampleRate)&&this.config.enabled,this.logger.debug("DiagnosticsClient: Should track is",this.shouldTrack)},e})(),Ou=(function(){function e(){}return e.prototype.send=function(t,n,r){return Promise.resolve(null)},e.prototype.buildResponse=function(t){var n,r,a,o,l,c,d,f,m,g,v,b,S,w,E,T,C,k,j,N,R,P;if(typeof t!="object")return null;var L=t.code||0,H=this.buildStatus(L);switch(H){case Gt.Success:return{status:H,statusCode:L,body:{eventsIngested:(n=t.events_ingested)!==null&&n!==void 0?n:0,payloadSizeBytes:(r=t.payload_size_bytes)!==null&&r!==void 0?r:0,serverUploadTime:(a=t.server_upload_time)!==null&&a!==void 0?a:0}};case Gt.Invalid:return{status:H,statusCode:L,body:{error:(o=t.error)!==null&&o!==void 0?o:"",missingField:(l=t.missing_field)!==null&&l!==void 0?l:"",eventsWithInvalidFields:(c=t.events_with_invalid_fields)!==null&&c!==void 0?c:{},eventsWithMissingFields:(d=t.events_with_missing_fields)!==null&&d!==void 0?d:{},eventsWithInvalidIdLengths:(f=t.events_with_invalid_id_lengths)!==null&&f!==void 0?f:{},epsThreshold:(m=t.eps_threshold)!==null&&m!==void 0?m:0,exceededDailyQuotaDevices:(g=t.exceeded_daily_quota_devices)!==null&&g!==void 0?g:{},silencedDevices:(v=t.silenced_devices)!==null&&v!==void 0?v:[],silencedEvents:(b=t.silenced_events)!==null&&b!==void 0?b:[],throttledDevices:(S=t.throttled_devices)!==null&&S!==void 0?S:{},throttledEvents:(w=t.throttled_events)!==null&&w!==void 0?w:[]}};case Gt.PayloadTooLarge:return{status:H,statusCode:L,body:{error:(E=t.error)!==null&&E!==void 0?E:""}};case Gt.RateLimit:return{status:H,statusCode:L,body:{error:(T=t.error)!==null&&T!==void 0?T:"",epsThreshold:(C=t.eps_threshold)!==null&&C!==void 0?C:0,throttledDevices:(k=t.throttled_devices)!==null&&k!==void 0?k:{},throttledUsers:(j=t.throttled_users)!==null&&j!==void 0?j:{},exceededDailyQuotaDevices:(N=t.exceeded_daily_quota_devices)!==null&&N!==void 0?N:{},exceededDailyQuotaUsers:(R=t.exceeded_daily_quota_users)!==null&&R!==void 0?R:{},throttledEvents:(P=t.throttled_events)!==null&&P!==void 0?P:[]}};case Gt.Timeout:default:return{status:H,statusCode:L}}},e.prototype.buildStatus=function(t){return vg(t)?Gt.Success:t===429?Gt.RateLimit:t===413?Gt.PayloadTooLarge:t===408?Gt.Timeout:t>=400&&t<500?Gt.Invalid:t>=500?Gt.Failed:Gt.Unknown},e})(),yI=(function(e){Or(t,e);function t(n){n===void 0&&(n={});var r=e.call(this)||this;return r.customHeaders=n,r}return t.prototype.send=function(n,r){return te(this,void 0,void 0,function(){var a,o,l;return ee(this,function(c){switch(c.label){case 0:if(typeof fetch>"u")throw new Error("FetchTransport is not supported");return a={headers:ce({"Content-Type":"application/json",Accept:"*/*"},this.customHeaders),body:JSON.stringify(r),method:"POST"},[4,fetch(n,a)];case 1:return o=c.sent(),[4,o.text()];case 2:l=c.sent();try{return[2,this.buildResponse(JSON.parse(l))]}catch{return[2,this.buildResponse({code:o.status})]}return[2]}})})},t})(Ou),uC=2*1024;function cC(){return typeof CompressionStream<"u"}function dC(e){return te(this,void 0,void 0,function(){var t,n;return ee(this,function(r){switch(r.label){case 0:if(t=CompressionStream,typeof t>"u")return[2,void 0];r.label=1;case 1:return r.trys.push([1,3,,4]),n=new Blob([e]).stream().pipeThrough(new t("gzip")),[4,new Response(n).arrayBuffer()];case 2:return[2,r.sent()];case 3:return r.sent(),[2,void 0];case 4:return[2]}})})}var bI=(function(){function e(t,n){this.key="AMP_remote_config_".concat(t.substring(0,10)),this.logger=n}return e.prototype.fetchConfig=function(){var t=null,n={remoteConfig:null,lastFetch:new Date};try{t=localStorage.getItem(this.key)}catch(a){return this.logger.debug("Remote config localstorage failed to access: ",a),Promise.resolve(n)}if(t===null)return this.logger.debug("Remote config localstorage gets null because the key does not exist"),Promise.resolve(n);try{var r=JSON.parse(t);return this.logger.debug("Remote config localstorage parsed successfully: ".concat(JSON.stringify(r))),Promise.resolve({remoteConfig:r.remoteConfig,lastFetch:new Date(r.lastFetch)})}catch(a){return this.logger.debug("Remote config localstorage failed to parse: ",a),localStorage.removeItem(this.key),Promise.resolve(n)}},e.prototype.setConfig=function(t){try{return localStorage.setItem(this.key,JSON.stringify(t)),this.logger.debug("Remote config localstorage set successfully."),Promise.resolve(!0)}catch(n){this.logger.debug("Remote config localstorage failed to set: ",n)}return Promise.resolve(!1)},e})(),xI="https://sr-client-cfg.amplitude.com/config",SI="https://sr-client-cfg.eu.amplitude.com/config",wI=3,EI=1e3,TI=300*1e3,fC=(function(){function e(t,n,r,a){r===void 0&&(r="US"),this.callbackInfos=[],this.lastSuccessfulFetch=null,this.fetchPromise=null,this.apiKey=t,this.serverUrl=a||(r==="US"?xI:SI),this.logger=n,this.storage=new bI(t,n)}return e.prototype.subscribe=function(t,n,r){var a=_a(),o={id:a,key:t,deliveryMode:n,callback:r};return this.callbackInfos.push(o),n==="all"?this.subscribeAll(o):this.subscribeWaitForRemote(o,n.timeout),a},e.prototype.unsubscribe=function(t){var n=this.callbackInfos.findIndex(function(r){return r.id===t});return n===-1?(this.logger.debug("Remote config client unsubscribe failed because callback with id ".concat(t," doesn't exist.")),!1):(this.callbackInfos.splice(n,1),this.logger.debug("Remote config client unsubscribe succeeded removing callback with id ".concat(t,".")),!0)},e.prototype.updateConfigs=function(){return te(this,void 0,void 0,function(){var t,n,r=this;return ee(this,function(a){switch(a.label){case 0:return this.lastSuccessfulFetch&&(t=Date.now()-this.lastSuccessfulFetch,t<TI)?(this.logger.debug("Remote config client skipping updateConfigs: Too recent"),[2]):[4,this.getOrCreateFetchPromise()];case 1:return n=a.sent(),this.storage.setConfig(n),this.callbackInfos.forEach(function(o){r.sendCallback(o,n,"remote")}),[2]}})})},e.prototype.getOrCreateFetchPromise=function(){var t=this;return this.fetchPromise?this.fetchPromise:(this.fetchPromise=this.fetch().then(function(n){return n.remoteConfig!==null&&(t.lastSuccessfulFetch=Date.now()),n}).finally(function(){t.fetchPromise=null}),this.fetchPromise)},e.prototype.subscribeAll=function(t){return te(this,void 0,void 0,function(){var n,r,a,o=this;return ee(this,function(l){switch(l.label){case 0:return n=this.getOrCreateFetchPromise().then(function(c){o.logger.debug("Remote config client subscription all mode fetched from remote: ".concat(JSON.stringify(c))),o.sendCallback(t,c,"remote"),o.storage.setConfig(c)}),r=this.storage.fetchConfig().then(function(c){return c}),[4,Promise.race([n,r])];case 1:return a=l.sent(),a!==void 0&&(this.logger.debug("Remote config client subscription all mode fetched from cache: ".concat(JSON.stringify(a))),a.remoteConfig!==null?this.sendCallback(t,a,"cache"):this.logger.debug("Remote config client skips sending callback because cache is empty (first time user).")),[4,n];case 2:return l.sent(),[2]}})})},e.prototype.subscribeWaitForRemote=function(t,n){return te(this,void 0,void 0,function(){var r,a,a;return ee(this,function(o){switch(o.label){case 0:r=new Promise(function(l,c){setTimeout(function(){c("Timeout exceeded")},n)}),o.label=1;case 1:return o.trys.push([1,3,,5]),[4,Promise.race([this.getOrCreateFetchPromise(),r])];case 2:return a=o.sent(),this.logger.debug("Remote config client subscription wait for remote mode returns from remote."),this.sendCallback(t,a,"remote"),this.storage.setConfig(a),[3,5];case 3:return o.sent(),this.logger.debug("Remote config client subscription wait for remote mode exceeded timeout. Try to fetch from cache."),[4,this.storage.fetchConfig()];case 4:return a=o.sent(),a.remoteConfig!==null?(this.logger.debug("Remote config client subscription wait for remote mode returns a cached copy."),this.sendCallback(t,a,"cache")):(this.logger.debug("Remote config client subscription wait for remote mode failed to fetch cache."),this.sendCallback(t,a,"remote")),[3,5];case 5:return[2]}})})},e.prototype.sendCallback=function(t,n,r){t.lastCallback=new Date;var a;t.key?a=t.key.split(".").reduce(function(o,l){return o===null?o:l in o?o[l]:null},n.remoteConfig):a=n.remoteConfig,t.callback(a,r,n.lastFetch)},e.prototype.fetch=function(t,n){return t===void 0&&(t=wI),n===void 0&&(n=EI),te(this,void 0,void 0,function(){var r,a,o,l,c,d,f=this;return ee(this,function(m){switch(m.label){case 0:r=n/t,a={remoteConfig:null,lastFetch:new Date},o=function(g){var v,b,S,w,E,T;return ee(this,function(C){switch(C.label){case 0:v=new AbortController,b=setTimeout(function(){return v.abort()},n),C.label=1;case 1:return C.trys.push([1,7,8,9]),[4,fetch(l.getUrlParams(),{method:"GET",headers:{Accept:"*/*"},signal:v.signal})];case 2:return S=C.sent(),S.ok?[3,4]:[4,S.text()];case 3:return w=C.sent(),l.logger.debug("Remote config client fetch with retry time ".concat(t," failed with ").concat(S.status,": ").concat(w)),[3,6];case 4:return[4,S.json()];case 5:return E=C.sent(),[2,{value:{remoteConfig:E,lastFetch:new Date}}];case 6:return[3,9];case 7:return T=C.sent(),T instanceof Error&&T.name==="AbortError"?l.logger.debug("Remote config client fetch with retry time ".concat(t," timed out after ").concat(n,"ms")):l.logger.debug("Remote config client fetch with retry time ".concat(t," is rejected because: "),T),[3,9];case 8:return clearTimeout(b),[7];case 9:return g<t-1?[4,new Promise(function(k){return setTimeout(k,f.getJitterDelay(r))})]:[3,11];case 10:C.sent(),C.label=11;case 11:return[2]}})},l=this,c=0,m.label=1;case 1:return c<t?[5,o(c)]:[3,4];case 2:if(d=m.sent(),typeof d=="object")return[2,d.value];m.label=3;case 3:return c++,[3,1];case 4:return[2,a]}})})},e.prototype.getJitterDelay=function(t){return Math.floor(Math.random()*t)},e.prototype.getUrlParams=function(){var t=encodeURIComponent(this.apiKey),n=new URLSearchParams;return n.append("config_group",e.CONFIG_GROUP),"".concat(this.serverUrl,"/").concat(t,"?").concat(n.toString())},e.CONFIG_GROUP="browser",e})(),om=ze(),ao=om?.console,ds={},ru={},lm=!1;function kI(e){if(!ao||typeof ao[e]!="function")return!1;if(ru[e])return!0;var t=function(){for(var n=[],r=0;r<arguments.length;r++)n[r]=arguments[r];try{if(ds[e]&&!lm){lm=!0;var a=ds[e];a&&a.forEach(function(o){try{o(e,n)}catch{}})}}catch{}return lm=!1,ru[e].apply(ao,n)};return ru[e]=ao[e],ao[e]=t,!0}function CI(e,t){var n=kI(e);if(!n)return new Error("Console override failed");ds[e]?ds[e].push(t):ds[e]=[t]}function AI(e){var t,n;try{for(var r=_e(Object.values(ds)),a=r.next();!a.done;a=r.next())for(var o=a.value,l=o.length-1;l>=0;l--)if(o[l]===e){o.splice(l,1);break}}catch(c){t={error:c}}finally{try{a&&!a.done&&(n=r.return)&&n.call(r)}finally{if(t)throw t.error}}}function NI(){var e,t;try{for(var n=_e(Object.entries(ru)),r=n.next();!r.done;r=n.next()){var a=Ae(r.value,2),o=a[0],l=a[1];l&&(ao[o]=l)}}catch(c){e={error:c}}finally{try{r&&!r.done&&(t=n.return)&&t.call(n)}finally{if(e)throw e.error}}ru={},ds={}}var Ow={addListener:CI,removeListener:AI,_restoreConsole:NI},xu;(function(e){e.US="US",e.EU="EU",e.STAGING="STAGING"})(xu||(xu={}));var jI=null,RI=["a","button","input","select","textarea","label","video","audio",'[contenteditable="true" i]',"[data-amp-default-track]",".amp-default-track"],hC="data-amp-track-",_I=["div","span","h1","h2","h3","h4","h5","h6"],OI=["a","button",'[role="button"]','[role="link"]','[role="menuitem"]','[role="menuitemcheckbox"]','[role="menuitemradio"]','[role="option"]','[role="tab"]','[role="treeitem"]','[contenteditable="true" i]'],pC=Je(['input[type="button"]','input[type="submit"]','input[type="reset"]','input[type="image"]','input[type="file"]'],Ae(OI),!1),MI=pC,DI=pC,II=["*"],PI=1e3,LI=4,zI=50;function UI(e){return typeof e=="string"||typeof e=="number"||typeof e=="boolean"||e===null||e===void 0}function mC(e,t,n){if(e){var r=t.map(Mw),a=n.map(Mw);gC({json:e,allowlist:r,excludelist:a,ancestors:[]})}}function gC(e){var t,n,r=e.json,a=e.targetObject,o=e.allowlist,l=e.excludelist,c=e.ancestors,d=e.parentObject,f=e.targetKey;a||(a=r);var m=Object.keys(a);try{for(var g=_e(m),v=g.next();!v.done;v=g.next()){var b=v.value,S=Je(Je([],Ae(c),!1),[b],!1);UI(a[b])?(!Dw(S,o)||Dw(S,l))&&delete a[b]:gC({json:r,targetObject:a[b],allowlist:o,excludelist:l,ancestors:S,parentObject:a,targetKey:b})}}catch(w){t={error:w}}finally{try{v&&!v.done&&(n=g.return)&&n.call(g)}finally{if(t)throw t.error}}Object.keys(a).length===0&&d&&f&&delete d[f]}function Mw(e){return e.startsWith("/")&&(e=e.slice(1)),e.split("/").map(function(t){return t.replace(/~0/g,"~").replace(/~1/g,"/")})}function bg(e,t,n,r){if(n===void 0&&(n=0),r===void 0&&(r=0),r===t.length)return n===e.length;if(n===e.length){for(;r<t.length&&t[r]==="**";)r++;return r===t.length}var a=t[r];if(a==="**"){if(r+1===t.length)return!0;for(var o=n;o<=e.length;o++)if(bg(e,t,o,r+1))return!0;return!1}else return a==="*"||a===e[n]?bg(e,t,n+1,r+1):!1}function Dw(e,t){return t.some(function(n){return bg(e,n)})}var BI=500,vC=100,VI=(function(){function e(t){this.request=t}return e.prototype.headers=function(t){var n,r;t===void 0&&(t=[]);var a=this.request.headers,o={};if(Array.isArray(a))a.forEach(function(g){var v=Ae(g,2),b=v[0],S=v[1];o[b]=S});else if(a instanceof Headers)a.forEach(function(g,v){o[v]=g});else if(typeof a=="object"&&a!==null)try{for(var l=_e(Object.entries(a)),c=l.next();!c.done;c=l.next()){var d=Ae(c.value,2),f=d[0],m=d[1];o[f]=m}}catch(g){n={error:g}}finally{try{c&&!c.done&&(r=l.return)&&r.call(l)}finally{if(n)throw n.error}}return Af(o,{allow:t})},Object.defineProperty(e.prototype,"bodySize",{get:function(){if(typeof this._bodySize=="number")return this._bodySize;var t=ze();if(t?.TextEncoder){var n=this.request.body;return this._bodySize=yC(n,vC),this._bodySize}},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"method",{get:function(){return this.request.method},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"body",{get:function(){return typeof this.request.body=="string"?this.request.body:null},enumerable:!1,configurable:!0}),e.prototype.json=function(t,n){return t===void 0&&(t=[]),n===void 0&&(n=[]),te(this,void 0,void 0,function(){var r;return ee(this,function(a){return t.length===0?[2,null]:(r=this.body,[2,Yv(r,t,n)])})})},e})(),FI=(function(){function e(t,n){this.bodyRaw=t,this.requestHeaders=n}return e.prototype.headers=function(t){return t===void 0&&(t=[]),Af(this.requestHeaders,{allow:t})},Object.defineProperty(e.prototype,"bodySize",{get:function(){return yC(this.bodyRaw,vC)},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"body",{get:function(){return typeof this.bodyRaw=="string"?this.bodyRaw:null},enumerable:!1,configurable:!0}),e.prototype.json=function(t,n){return t===void 0&&(t=[]),n===void 0&&(n=[]),te(this,void 0,void 0,function(){var r;return ee(this,function(a){return t.length===0?[2,null]:(r=this.body,[2,Yv(r,t,n)])})})},e})();function yC(e,t){var n,r,a,o=ze(),l=o?.TextEncoder;if(l){var c;if(typeof e=="string")c=e,a=new l().encode(c).length;else if(e instanceof Blob)c=e,a=c.size;else if(e instanceof URLSearchParams)c=e,a=new l().encode(c.toString()).length;else if(ArrayBuffer.isView(e))c=e,a=c.byteLength;else if(e instanceof ArrayBuffer)c=e,a=c.byteLength;else if(e instanceof FormData){var d=e,f=0,m=0;try{for(var g=_e(d.entries()),v=g.next();!v.done;v=g.next()){var b=Ae(v.value,2),S=b[0],w=b[1];if(f+=S.length,typeof w=="string")f+=new l().encode(w).length;else if(w instanceof Blob)f+=w.size;else return;if(++m>=t)return}}catch(E){n={error:E}}finally{try{v&&!v.done&&(r=g.return)&&r.call(g)}finally{if(n)throw n.error}}a=f}else if(e instanceof ReadableStream){c=e;return}return a}}var HI=(function(){function e(t){this.response=t}return e.prototype.headers=function(t){var n;if(t===void 0&&(t=[]),this.response.headers instanceof Headers){var r=this.response.headers,a={};return(n=r?.forEach)===null||n===void 0||n.call(r,function(o,l){a[l]=o}),Af(a,{allow:t})}},Object.defineProperty(e.prototype,"bodySize",{get:function(){var t,n;if(this._bodySize!==void 0)return this._bodySize;var r=(n=(t=this.response.headers)===null||t===void 0?void 0:t.get)===null||n===void 0?void 0:n.call(t,"content-length"),a=r?parseInt(r,10):void 0;return this._bodySize=a,a},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"status",{get:function(){return this.response.status},enumerable:!1,configurable:!0}),e.prototype.text=function(){return te(this,void 0,void 0,function(){var t,n,r;return ee(this,function(a){switch(a.label){case 0:this.clonedResponse||(this.clonedResponse=this.response.clone()),a.label=1;case 1:return a.trys.push([1,3,,4]),t=this.clonedResponse.text(),n=new Promise(function(o){return setTimeout(function(){return o(null)},BI)}),[4,Promise.race([t,n])];case 2:return r=a.sent(),[2,r];case 3:return a.sent(),[2,null];case 4:return[2]}})})},e.prototype.json=function(t,n){return t===void 0&&(t=[]),n===void 0&&(n=[]),te(this,void 0,void 0,function(){var r;return ee(this,function(a){switch(a.label){case 0:return t.length===0?[2,null]:[4,this.text()];case 1:return r=a.sent(),[2,Yv(r,t,n)]}})})},e})(),qI=(function(){function e(t,n,r,a){this.statusCode=t,this.headersString=n,this.size=r,this.getJson=a}return Object.defineProperty(e.prototype,"bodySize",{get:function(){return this.size},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"status",{get:function(){return this.statusCode},enumerable:!1,configurable:!0}),e.prototype.headers=function(t){var n,r;if(t===void 0&&(t=[]),!this.headersString)return{};var a={},o=this.headersString.split(`\r
15
+ `);try{for(var l=_e(o),c=l.next();!c.done;c=l.next()){var d=c.value,f=Ae(d.split(": "),2),m=f[0],g=f[1];m&&g&&(a[m]=g)}}catch(v){n={error:v}}finally{try{c&&!c.done&&(r=l.return)&&r.call(l)}finally{if(n)throw n.error}}return Af(a,{allow:t})},e.prototype.json=function(t,n){return t===void 0&&(t=[]),n===void 0&&(n=[]),te(this,void 0,void 0,function(){var r;return ee(this,function(a){return t.length===0?[2,null]:(r=this.getJson(),r?(mC(r,t,n),[2,r]):[2,null])})})},e})();function Yv(e,t,n){if(!e)return null;try{var r=JSON.parse(e);return mC(r,t,n),r}catch{return null}}var iu;(function(e){e.REDACT="redact",e.REMOVE="remove"})(iu||(iu={}));var Iw="[REDACTED]",Af=function(e,t){var n,r,a=t.allow,o=a===void 0?[]:a,l=t.strategy,c=l===void 0?iu.REMOVE:l,d=Je([],Ae(vD),!1),f={},m=function(S){var w=S.toLowerCase();d.find(function(E){return E.toLowerCase()===w})?c===iu.REDACT&&(f[S]=Iw):o.find(function(E){return E.toLowerCase()===w})?f[S]=e[S]:c===iu.REDACT&&(f[S]=Iw)};try{for(var g=_e(Object.keys(e)),v=g.next();!v.done;v=g.next()){var b=v.value;m(b)}}catch(S){n={error:S}}finally{try{v&&!v.done&&(r=g.return)&&r.call(g)}finally{if(n)throw n.error}}return f},GI=(function(){function e(t,n,r,a,o,l,c,d,f,m,g){c===void 0&&(c=0),this.type=t,this.method=n,this.timestamp=r,this.startTime=a,this.url=o,this.requestWrapper=l,this.status=c,this.duration=d,this.responseWrapper=f,this.error=m,this.endTime=g}return e.prototype.toSerializable=function(){var t,n,r,a,o={type:this.type,method:this.method,url:this.url,timestamp:this.timestamp,status:this.status,duration:this.duration,error:this.error,startTime:this.startTime,endTime:this.endTime,requestHeaders:(t=this.requestWrapper)===null||t===void 0?void 0:t.headers(Je([],Ae(Zd),!1)),requestBodySize:(n=this.requestWrapper)===null||n===void 0?void 0:n.bodySize,responseHeaders:(r=this.responseWrapper)===null||r===void 0?void 0:r.headers(Je([],Ae(Zd),!1)),responseBodySize:(a=this.responseWrapper)===null||a===void 0?void 0:a.bodySize};return Object.fromEntries(Object.entries(o).filter(function(l){var c=Ae(l,2);c[0];var d=c[1];return d!==void 0}))},e})();function KI(e){return typeof e=="object"&&e!==null&&"url"in e&&"method"in e}var $I=(function(){function e(t,n){n===void 0&&(n=_a()),this.callback=t,this.id=n}return e})();function es(e){try{e()}catch{}}var YI=(function(){function e(t){this.eventCallbacks=new Map,this.isObserving=!1,this.logger=t;var n=ze();e.isSupported()&&(this.globalScope=n)}return e.isSupported=function(){var t=ze();return!!t&&!!t.fetch},e.prototype.subscribe=function(t,n){var r,a,o,l,c,d,f,m,g,v;if(this.logger||(this.logger=n),this.eventCallbacks.set(t.id,t),!this.isObserving){var b=(o=(a=(r=this.globalScope)===null||r===void 0?void 0:r.XMLHttpRequest)===null||a===void 0?void 0:a.prototype)===null||o===void 0?void 0:o.open,S=(d=(c=(l=this.globalScope)===null||l===void 0?void 0:l.XMLHttpRequest)===null||c===void 0?void 0:c.prototype)===null||d===void 0?void 0:d.send,w=(g=(m=(f=this.globalScope)===null||f===void 0?void 0:f.XMLHttpRequest)===null||m===void 0?void 0:m.prototype)===null||g===void 0?void 0:g.setRequestHeader;b&&S&&w&&this.observeXhr(b,S,w);var E=(v=this.globalScope)===null||v===void 0?void 0:v.fetch;E&&this.observeFetch(E),this.isObserving=!0}},e.prototype.unsubscribe=function(t){this.eventCallbacks.delete(t.id)},e.prototype.triggerEventCallbacks=function(t){var n=this;this.eventCallbacks.forEach(function(r){try{r.callback(t)}catch(a){es(function(){var o;(o=n.logger)===null||o===void 0||o.debug("an unexpected error occurred while triggering event callbacks",a)})}})},e.prototype.handleNetworkRequestEvent=function(t,n,r,a,o,l,c){var d;if(!(l===void 0||c===void 0)){var f,m="GET";if(KI(n)?(f=n.url,m=n.method):f=(d=n?.toString)===null||d===void 0?void 0:d.call(n),f)try{var g=new URL(f);f="".concat(g.protocol,"//").concat(g.host).concat(g.pathname).concat(g.search).concat(g.hash)}catch{}m=r?.method||m;var v,b;a&&(v=a.status),o&&(b={name:o.name||"UnknownError",message:o.message||"An unknown error occurred"},v=0);var S=Math.floor(performance.now()-c),w=Math.floor(l+S),E=new GI(t,m,l,l,f,r,v,S,a,b,w);this.triggerEventCallbacks(E)}},e.prototype.getTimestamps=function(){var t,n;return{startTime:(t=Date.now)===null||t===void 0?void 0:t.call(Date),durationStart:(n=performance?.now)===null||n===void 0?void 0:n.call(performance)}},e.prototype.observeFetch=function(t){var n=this;!this.globalScope||!t||(this.globalScope.fetch=function(r,a){return te(n,void 0,void 0,function(){var o,l,c,d,f=this;return ee(this,function(m){switch(m.label){case 0:try{o=this.getTimestamps()}catch(g){es(function(){var v;return(v=f.logger)===null||v===void 0?void 0:v.debug("an unexpected error occurred while retrieving timestamps",g)})}m.label=1;case 1:return m.trys.push([1,3,,4]),[4,t(r,a)];case 2:return l=m.sent(),[3,4];case 3:return d=m.sent(),c=d,[3,4];case 4:try{this.handleNetworkRequestEvent("fetch",r,a?new VI(a):void 0,l?new HI(l):void 0,c,o?.startTime,o?.durationStart)}catch(g){es(function(){var v;return(v=f.logger)===null||v===void 0?void 0:v.debug("an unexpected error occurred while handling fetch",g)})}if(l)return[2,l];throw c}})})})},e.createXhrJsonParser=function(t,n){return function(){var r;try{if(t.responseType==="json"){if(!((r=n.globalScope)===null||r===void 0)&&r.structuredClone)return n.globalScope.structuredClone(t.response)}else if(["text",""].includes(t.responseType))return JSON.parse(t.responseText)}catch(a){return a instanceof Error&&a.name==="InvalidStateError"&&es(function(){var o;return(o=n.logger)===null||o===void 0?void 0:o.debug("unexpected error when retrieving responseText. responseType='".concat(t.responseType,"'"))}),null}return null}},e.prototype.observeXhr=function(t,n,r){if(!(!this.globalScope||!t||!n)){var a=this.globalScope.XMLHttpRequest.prototype,o=this;a.open=function(){for(var l,c=[],d=0;d<arguments.length;d++)c[d]=arguments[d];var f=this,m=Ae(c,2),g=m[0],v=m[1];try{f.$$AmplitudeAnalyticsEvent=ce({method:g,url:(l=v?.toString)===null||l===void 0?void 0:l.call(v),headers:{}},o.getTimestamps())}catch(b){es(function(){var S;return(S=o.logger)===null||S===void 0?void 0:S.debug("an unexpected error occurred while calling xhr open",b)})}return t.apply(f,c)},a.send=function(){for(var l=[],c=0;c<arguments.length;c++)l[c]=arguments[c];var d=this,f=d,m=e.createXhrJsonParser(d,o),g=l[0],v=f.$$AmplitudeAnalyticsEvent;return f.$$AmplitudeAnalyticsEvent&&f.addEventListener("loadend",function(){try{var b=f.getAllResponseHeaders(),S=f.getResponseHeader("content-length"),w=new qI(f.status,b,S?parseInt(S,10):void 0,m),E=f.$$AmplitudeAnalyticsEvent.headers,T=new FI(g,E);v.status=f.status,o.handleNetworkRequestEvent("xhr",{url:v.url,method:v.method},T,w,void 0,v.startTime,v.durationStart)}catch(C){es(function(){var k;return(k=o.logger)===null||k===void 0?void 0:k.debug("an unexpected error occurred while handling xhr send",C)})}}),n.apply(f,l)},a.setRequestHeader=function(l,c){var d=this;try{var f=d.$$AmplitudeAnalyticsEvent;f&&(f.headers[l]=c)}catch(m){es(function(){var g;return(g=o.logger)===null||g===void 0?void 0:g.debug("an unexpected error occurred while calling xhr setRequestHeader",m)})}r.apply(d,[l,c])}}},e})(),Pw=new YI,bC=(function(){function e(){}return e.prototype.parse=function(){return te(this,void 0,void 0,function(){return ee(this,function(t){return[2,ce(ce(ce(ce({},Cf),this.getUtmParam()),this.getReferrer()),this.getClickIds())]})})},e.prototype.getUtmParam=function(){var t=ef(),n=t[dD],r=t[fD],a=t[hD],o=t[pD],l=t[mD],c=t[gD];return{utm_campaign:n,utm_content:r,utm_id:a,utm_medium:o,utm_source:l,utm_term:c}},e.prototype.getReferrer=function(){var t,n,r={referrer:void 0,referring_domain:void 0};try{r.referrer=document.referrer||void 0,r.referring_domain=(n=(t=r.referrer)===null||t===void 0?void 0:t.split("/")[2])!==null&&n!==void 0?n:void 0}catch{}return r},e.prototype.getClickIds=function(){var t,n=ef();return t={},t[hw]=n[hw],t[pw]=n[pw],t[mw]=n[mw],t[gw]=n[gw],t[vw]=n[vw],t[yw]=n[yw],t[bw]=n[bw],t[xw]=n[xw],t[Sw]=n[Sw],t[ww]=n[ww],t[Ew]=n[Ew],t},e})(),lo="data-amp-mask",Ca="*****",WI=/\b(?:\d[ -]*?){13,16}\b/,XI=/(\d{3}-?\d{2}-?\d{4})/g,QI=/[^\s@]+@[^\s@.]+\.[^\s@]+/g,Wv=function(e,t){var n,r;if(t===void 0&&(t=[]),typeof e!="string")return"";var a=e;a=a.replace(WI,Ca),a=a.replace(XI,Ca),a=a.replace(QI,Ca);try{for(var o=_e(t),l=o.next();!l.done;l=o.next()){var c=l.value;try{a=a.replace(c,Ca)}catch{}}}catch(d){n={error:d}}finally{try{l&&!l.done&&(r=o.return)&&r.call(o)}finally{if(n)throw n.error}}return a},Xv=function(e){if(typeof document>"u"||!document.title)return"";var t=document.querySelector("title");return t&&t.hasAttribute(lo)?Ca:e?e(document.title):document.title},zl={},Lw;function JI(){if(Lw)return zl;Lw=1,Object.defineProperty(zl,"__esModule",{value:!0}),zl.Observable=void 0;const e=T=>!!Symbol[T],t=T=>e(T)?Symbol[T]:"@@"+T,n=t("iterator"),r=t("observable"),a=t("species");function o(T,C){let k=T[C];if(k!=null){if(typeof k!="function")throw new TypeError(k+" is not a function");return k}}function l(T){let C=T.constructor;return C!==void 0&&(C=C[a],C===null&&(C=void 0)),C!==void 0?C:E}function c(T){return T instanceof E}function d(T){d.log?d.log(T):setTimeout(()=>{throw T})}function f(T){Promise.resolve().then(()=>{try{T()}catch(C){d(C)}})}function m(T){let C=T._cleanup;if(C!==void 0&&(T._cleanup=void 0,!!C))try{if(typeof C=="function")C();else{let k=o(C,"unsubscribe");k&&k.call(C)}}catch(k){d(k)}}function g(T){T._observer=void 0,T._queue=void 0,T._state="closed"}function v(T){let C=T._queue;if(C){T._queue=void 0,T._state="ready";for(let k=0;k<C.length&&(b(T,C[k].type,C[k].value),T._state!=="closed");++k);}}function b(T,C,k){T._state="running";let j=T._observer;try{let N=o(j,C);switch(C){case"next":N&&N.call(j,k);break;case"error":if(g(T),N)N.call(j,k);else throw k;break;case"complete":g(T),N&&N.call(j);break}}catch(N){d(N)}T._state==="closed"?m(T):T._state==="running"&&(T._state="ready")}function S(T,C,k){if(T._state!=="closed"){if(T._state==="buffering"){T._queue.push({type:C,value:k});return}if(T._state!=="ready"){T._state="buffering",T._queue=[{type:C,value:k}],f(()=>v(T));return}b(T,C,k)}}class w{constructor(C,k){this._cleanup=void 0,this._observer=C,this._queue=void 0,this._state="initializing";let j=this,N={get closed(){return j._state==="closed"},next(R){S(j,"next",R)},error(R){S(j,"error",R)},complete(){S(j,"complete")}};try{this._cleanup=k.call(void 0,N)}catch(R){N.error(R)}this._state==="initializing"&&(this._state="ready")}get closed(){return this._state==="closed"}unsubscribe(){this._state!=="closed"&&(g(this),m(this))}}class E{constructor(C){if(!(this instanceof E))throw new TypeError("Observable cannot be called as a function");if(typeof C!="function")throw new TypeError("Observable initializer must be a function");this._subscriber=C}subscribe(C){return(typeof C!="object"||C===null)&&(C={next:C,error:arguments[1],complete:arguments[2]}),new w(C,this._subscriber)}forEach(C){return new Promise((k,j)=>{if(typeof C!="function"){j(new TypeError(C+" is not a function"));return}function N(){R.unsubscribe(),k()}let R=this.subscribe({next(P){try{C(P,N)}catch(L){j(L),R.unsubscribe()}},error:j,complete:k})})}map(C){if(typeof C!="function")throw new TypeError(C+" is not a function");let k=l(this);return new k(j=>this.subscribe({next(N){try{N=C(N)}catch(R){return j.error(R)}j.next(N)},error(N){j.error(N)},complete(){j.complete()}}))}filter(C){if(typeof C!="function")throw new TypeError(C+" is not a function");let k=l(this);return new k(j=>this.subscribe({next(N){try{if(!C(N))return}catch(R){return j.error(R)}j.next(N)},error(N){j.error(N)},complete(){j.complete()}}))}reduce(C){if(typeof C!="function")throw new TypeError(C+" is not a function");let k=l(this),j=arguments.length>1,N=!1,P=arguments[1];return new k(L=>this.subscribe({next(H){let D=!N;if(N=!0,!D||j)try{P=C(P,H)}catch(B){return L.error(B)}else P=H},error(H){L.error(H)},complete(){if(!N&&!j)return L.error(new TypeError("Cannot reduce an empty sequence"));L.next(P),L.complete()}}))}async all(){let C=[];return await this.forEach(k=>C.push(k)),C}concat(...C){let k=l(this);return new k(j=>{let N,R=0;function P(L){N=L.subscribe({next(H){j.next(H)},error(H){j.error(H)},complete(){R===C.length?(N=void 0,j.complete()):P(k.from(C[R++]))}})}return P(this),()=>{N&&(N.unsubscribe(),N=void 0)}})}flatMap(C){if(typeof C!="function")throw new TypeError(C+" is not a function");let k=l(this);return new k(j=>{let N=[],R=this.subscribe({next(L){if(C)try{L=C(L)}catch(D){return j.error(D)}let H=k.from(L).subscribe({next(D){j.next(D)},error(D){j.error(D)},complete(){let D=N.indexOf(H);D>=0&&N.splice(D,1),P()}});N.push(H)},error(L){j.error(L)},complete(){P()}});function P(){R.closed&&N.length===0&&j.complete()}return()=>{N.forEach(L=>L.unsubscribe()),R.unsubscribe()}})}[r](){return this}static from(C){let k=typeof this=="function"?this:E;if(C==null)throw new TypeError(C+" is not an object");let j=o(C,r);if(j){let N=j.call(C);if(Object(N)!==N)throw new TypeError(N+" is not an object");return c(N)&&N.constructor===k?N:new k(R=>N.subscribe(R))}if(e("iterator")&&(j=o(C,n),j))return new k(N=>{f(()=>{if(!N.closed){for(let R of j.call(C))if(N.next(R),N.closed)return;N.complete()}})});if(Array.isArray(C))return new k(N=>{f(()=>{if(!N.closed){for(let R=0;R<C.length;++R)if(N.next(C[R]),N.closed)return;N.complete()}})});throw new TypeError(C+" is not observable")}static of(...C){let k=typeof this=="function"?this:E;return new k(j=>{f(()=>{if(!j.closed){for(let N=0;N<C.length;++N)if(j.next(C[N]),j.closed)return;j.complete()}})})}static get[a](){return this}}return zl.Observable=E,Object.defineProperty(E,Symbol("extensions"),{value:{symbol:r,hostReportError:d},configurable:!0}),zl}var um,zw;function ZI(){return zw||(zw=1,um=JI().Observable),um}var e3=ZI();const _n=jo(e3);function Qv(e,t){return new _n(function(n){e.subscribe({next:function(r){t(r).then(function(a){return n.next(a)}).catch(function(a){return n.error(a)})},error:function(r){n.error(r)},complete:function(){n.complete()}})})}function ps(e,t){return new _n(function(n){var r=!1,a=new Set,o=function(){var c,d;r=!0;try{for(var f=_e(a),m=f.next();!m.done;m=f.next()){var g=m.value;try{g.unsubscribe()}catch{}}}catch(v){c={error:v}}finally{try{m&&!m.done&&(d=f.return)&&d.call(f)}finally{if(c)throw c.error}}a.clear()},l=function(c){var d=c.subscribe({next:function(f){r||n.next(f)},error:function(f){r||(r=!0,n.error(f),o())},complete:function(){a.delete(d),!r&&a.size===0&&(n.complete(),o(),r=!0)}});a.add(d)};return l(e),l(t),o})}function si(e){var t=new Set,n=null;function r(){n?.unsubscribe(),n=null,t.clear()}return new _n(function(a){return t.add(a),n===null&&(n=e.subscribe({next:function(o){var l,c,d;try{for(var f=_e(t),m=f.next();!m.done;m=f.next()){var g=m.value;(d=g.next)===null||d===void 0||d.call(g,o)}}catch(v){l={error:v}}finally{try{m&&!m.done&&(c=f.return)&&c.call(f)}finally{if(l)throw l.error}}},error:function(o){var l,c,d;try{for(var f=_e(t),m=f.next();!m.done;m=f.next()){var g=m.value;(d=g.error)===null||d===void 0||d.call(g,o)}}catch(v){l={error:v}}finally{try{m&&!m.done&&(c=f.return)&&c.call(f)}finally{if(l)throw l.error}}r()},complete:function(){var o,l,c;try{for(var d=_e(t),f=d.next();!f.done;f=d.next()){var m=f.value;(c=m.complete)===null||c===void 0||c.call(m)}}catch(g){o={error:g}}finally{try{f&&!f.done&&(l=d.return)&&l.call(d)}finally{if(o)throw o.error}}r()}})),function(){t.delete(a),t.size===0&&n&&(n.unsubscribe(),n=null)}})}var sd={exports:{}},Uw;function t3(){if(Uw)return sd.exports;Uw=1;var e=Object.prototype.hasOwnProperty;function t(a){return"[Throws: "+(a?a.message:"?")+"]"}function n(a,o){if(e.call(a,o))try{return a[o]}catch(l){return t(l)}return a[o]}function r(a){var o=[];function l(c){if(c===null||typeof c!="object")return c;if(o.indexOf(c)!==-1)return"[Circular]";if(o.push(c),typeof c.toJSON=="function")try{var d=l(c.toJSON());return o.pop(),d}catch(g){return t(g)}if(Array.isArray(c)){var f=c.map(l);return o.pop(),f}var m=Object.keys(c).reduce(function(g,v){return g[v]=l(n(c,v)),g},{});return o.pop(),m}return l(a)}return sd.exports=function(a,o,l){return JSON.stringify(r(a),o,l)},sd.exports.ensureProperties=r,sd.exports}var xC=t3();const SC=jo(xC),n3=wO({__proto__:null,default:SC},[xC]);var r3=SC||n3,xg="https://app.amplitude.com",i3="https://app.eu.amplitude.com",a3="https://apps.stag2.amplitude.com",wC={US:xg,EU:i3,STAGING:a3},s3="https://cdn.amplitude.com/libs/background-capture-1.0.0-alpha.2.js.gz",o3=function(e){var t=document.querySelector('script[src="'.concat(CSS.escape(e),'"]'));return t?Promise.resolve({status:!0}):new Promise(function(n,r){var a;try{var o=document.createElement("script");o.type="text/javascript",o.async=!0,o.src=e,o.addEventListener("load",function(){n({status:!0})},{once:!0}),o.addEventListener("error",function(){r({status:!1,message:"Failed to load the script ".concat(e)})}),(a=document.head)===null||a===void 0||a.appendChild(o)}catch(l){r(l)}})};function l3(){return"".concat(Date.now(),"-").concat(Math.random().toString(36).substr(2,9))}var EC,Sg="__AMPLITUDE_MESSENGER_INSTANCE__",rf="__AMPLITUDE_MESSENGER__",u3=(function(){function e(t){var n=t===void 0?{}:t,r=n.origin,a=r===void 0?xg:r;this[EC]=!0,this.isSetup=!1,this.messageHandler=null,this.requestCallbacks={},this.actionHandlers=new Map,this.pendingMessages=new Map,this.scriptLoadPromises=new Map,this.endpoint=a}return e.prototype.notify=function(t){var n,r,a,o;(r=(n=this.logger)===null||n===void 0?void 0:n.debug)===null||r===void 0||r.call(n,"Message sent: ",JSON.stringify(t)),(o=(a=window.opener)===null||a===void 0?void 0:a.postMessage)===null||o===void 0||o.call(a,t,this.endpoint)},e.prototype.sendRequest=function(t,n,r){var a=this;r===void 0&&(r={timeout:15e3});var o=l3(),l={id:o,action:t,args:n},c=new Promise(function(d,f){a.requestCallbacks[o]={resolve:d,reject:f},a.notify(l),r.timeout>0&&setTimeout(function(){f(new Error("".concat(t," timed out (id: ").concat(o,")"))),delete a.requestCallbacks[o]},r.timeout)});return c},e.prototype.handleResponse=function(t){var n;if(!this.requestCallbacks[t.id]){(n=this.logger)===null||n===void 0||n.warn("No callback found for request id: ".concat(t.id));return}this.requestCallbacks[t.id].resolve(t.responseData),delete this.requestCallbacks[t.id]},e.prototype.registerActionHandler=function(t,n){var r,a,o,l;this.actionHandlers.has(t)&&((l=(o=this.logger)===null||o===void 0?void 0:o.warn)===null||l===void 0||l.call(o,"Overwriting existing action handler for: ".concat(t))),this.actionHandlers.set(t,n);var c=this.pendingMessages.get(t);if(c){this.pendingMessages.delete(t);try{for(var d=_e(c),f=d.next();!f.done;f=d.next()){var m=f.value;n(m)}}catch(g){r={error:g}}finally{try{f&&!f.done&&(a=d.return)&&a.call(d)}finally{if(r)throw r.error}}}},e.prototype.loadScriptOnce=function(t){return te(this,void 0,void 0,function(){var n,r,a;return ee(this,function(o){switch(o.label){case 0:if(n=this.scriptLoadPromises.get(t),n)return[2,n];r=o3(t).then(function(){}),this.scriptLoadPromises.set(t,r),o.label=1;case 1:return o.trys.push([1,3,,4]),[4,r];case 2:return o.sent(),[3,4];case 3:throw a=o.sent(),this.scriptLoadPromises.delete(t),a;case 4:return[2]}})})},e.prototype.setup=function(t){var n=this,r,a,o=t===void 0?{}:t,l=o.logger,c=o.endpoint;l&&(this.logger=l),c&&this.endpoint===xg&&(this.endpoint=c),!this.isSetup&&(this.isSetup=!0,(a=(r=this.logger)===null||r===void 0?void 0:r.debug)===null||a===void 0||a.call(r,"Setting up messenger"),this.messageHandler=function(d){var f,m,g,v,b;if((m=(f=n.logger)===null||f===void 0?void 0:f.debug)===null||m===void 0||m.call(f,"Message received: ",JSON.stringify(d)),n.endpoint===d.origin){var S=d.data,w=S?.action;if(w)if("id"in S&&S.id)(v=(g=n.logger)===null||g===void 0?void 0:g.debug)===null||v===void 0||v.call(g,"Received Response to previous request: ",JSON.stringify(d)),n.handleResponse(S);else{if(w==="ping"){n.notify({action:"pong"});return}var E=n.actionHandlers.get(w);if(E)E(S.data);else{var T=(b=n.pendingMessages.get(w))!==null&&b!==void 0?b:[];T.push(S.data),n.pendingMessages.set(w,T)}}}},window.addEventListener("message",this.messageHandler),this.notify({action:"page-loaded"}))},e.prototype.destroy=function(){this.messageHandler&&(window.removeEventListener("message",this.messageHandler),this.messageHandler=null),this.isSetup=!1,this.actionHandlers.clear(),this.pendingMessages.clear(),this.requestCallbacks={},this.scriptLoadPromises.clear();var t=ze();t?.[rf]===this&&delete t[rf]},e})();EC=Sg;function c3(e){return typeof e=="object"&&e!==null&&Sg in e&&e[Sg]===!0}function TC(e){var t=ze(),n=t?.[rf];if(c3(n))return n;var r=new u3(e);return t&&(t[rf]=r),r}var Bw="__AMPLITUDE_BACKGROUND_CAPTURE__";function kC(e,t){var n,r=e;if(r[Bw]!==!0){r[Bw]=!0;var a=(n=void 0)!==null&&n!==void 0?n:s3,o=null,l=function(c,d){var f,m;c==="background-capture-complete"&&((m=(f=e.logger)===null||f===void 0?void 0:f.debug)===null||m===void 0||m.call(f,"Background capture complete"),e.notify({action:"background-capture-complete",data:d}))};e.registerActionHandler("initialize-background-capture",function(){var c,d;(d=(c=e.logger)===null||c===void 0?void 0:c.debug)===null||d===void 0||d.call(c,"Initializing background capture (external script)");var f=new URL(a,e.endpoint).toString();e.loadScriptOnce(f).then(function(){var m,g,v;(g=(m=e.logger)===null||m===void 0?void 0:m.debug)===null||g===void 0||g.call(m,"Background capture script loaded (external)"),o=(v=window?.amplitudeBackgroundCapture)===null||v===void 0?void 0:v.call(window,{messenger:e,onBackgroundCapture:l}),e.notify({action:"background-capture-loaded"})}).catch(function(){var m;(m=e.logger)===null||m===void 0||m.warn("Failed to initialize background capture")})}),e.registerActionHandler("close-background-capture",function(){var c;(c=o?.close)===null||c===void 0||c.call(o),o=null})}}var cm={always:"always",ifEmptyCampaign:"ifEmptyCampaign"},Mo=function(e,t){return typeof e=="boolean"?e:e?.[t]!==!1},CC=function(e){return Mo(e,"attribution")},d3=function(e){return Mo(e,"fileDownloads")},AC=function(e){return Mo(e,"formInteractions")},NC=function(e){return Mo(e,"pageViews")},Vw=function(e){return Mo(e,"sessions")},f3=function(e){return Mo(e,"pageUrlEnrichment")},jC=function(e){return typeof e=="boolean"?e:typeof e=="object"&&(e.networkTracking===!0||typeof e.networkTracking=="object")},RC=function(e){return typeof e=="boolean"?e:typeof e=="object"&&(e.elementInteractions===!0||typeof e.elementInteractions=="object")},h3=function(e){return typeof e=="boolean"?e:typeof e=="object"&&e.webVitals===!0},_C=function(e){return typeof e=="boolean"?e:typeof e=="object"&&(e.frustrationInteractions===!0||typeof e.frustrationInteractions=="object")},p3=function(e){if(RC(e.autocapture)&&typeof e.autocapture=="object"&&typeof e.autocapture.elementInteractions=="object")return e.autocapture.elementInteractions},m3=function(e){if(_C(e.autocapture)&&typeof e.autocapture=="object"&&typeof e.autocapture.frustrationInteractions=="object")return e.autocapture.frustrationInteractions},g3=function(e){var t;if(jC(e.autocapture)){var n=void 0;return typeof e.autocapture=="object"&&typeof e.autocapture.networkTracking=="object"?n=e.autocapture.networkTracking:e.networkTrackingOptions&&(n=e.networkTrackingOptions),ce(ce({},n),{captureRules:(t=n?.captureRules)===null||t===void 0?void 0:t.map(function(r){var a,o,l;if(!((a=r.urls)===null||a===void 0)&&a.length&&(!((o=r.hosts)===null||o===void 0)&&o.length)){var c=JSON.stringify(r.hosts),d=JSON.stringify(r.urls);return(l=e.loggerProvider)===null||l===void 0||l.warn("Found network capture rule with both urls='".concat(d,"' and hosts='").concat(c,"' set. ")+"Definition of urls takes precedence over hosts, so ignoring hosts."),ce(ce({},r),{hosts:void 0})}return r})})}},Fw=function(e){var t=function(){return!1},n=void 0,r,a=e.pageCounter,o=NC(e.defaultTracking);return o&&(t=void 0,r=void 0,e.defaultTracking&&typeof e.defaultTracking=="object"&&e.defaultTracking.pageViews&&typeof e.defaultTracking.pageViews=="object"&&("trackOn"in e.defaultTracking.pageViews&&(t=e.defaultTracking.pageViews.trackOn),"trackHistoryChanges"in e.defaultTracking.pageViews&&(n=e.defaultTracking.pageViews.trackHistoryChanges),"eventType"in e.defaultTracking.pageViews&&e.defaultTracking.pageViews.eventType&&(r=e.defaultTracking.pageViews.eventType))),{trackOn:t,trackHistoryChanges:n,eventType:r,pageCounter:a}},Hw=function(e){return CC(e.defaultTracking)&&e.defaultTracking&&typeof e.defaultTracking=="object"&&e.defaultTracking.attribution&&typeof e.defaultTracking.attribution=="object"?ce({},e.defaultTracking.attribution):{}},v3=function(e){if(AC(e.defaultTracking)&&e.defaultTracking&&typeof e.defaultTracking=="object"&&typeof e.defaultTracking.formInteractions=="object")return e.defaultTracking.formInteractions},dm=function(e,t){for(var n=0;n<t.length;n++){var r=t[n],a=r.name,o=r.args,l=r.resolve,c=e&&e[a];if(typeof c=="function"){var d=c.apply(e,o);typeof l=="function"&&l(d?.promise)}}return e},fm=function(e){var t=e;return t&&t._q!==void 0},Jv="2.36.3",OC="amplitude-ts",y3="Web",b3="$remote",x3=(function(){function e(){this.name="@amplitude/plugin-context-browser",this.type="before",this.library="".concat(OC,"/").concat(Jv),typeof navigator<"u"&&(this.userAgent=navigator.userAgent)}return e.prototype.setup=function(t){return this.config=t,Promise.resolve(void 0)},e.prototype.execute=function(t){var n,r;return te(this,void 0,void 0,function(){var a,o,l,c;return ee(this,function(d){return a=new Date().getTime(),o=(n=this.config.lastEventId)!==null&&n!==void 0?n:-1,l=(r=t.event_id)!==null&&r!==void 0?r:o+1,this.config.lastEventId=l,t.time||(this.config.lastEventTime=a),c=ce(ce(ce(ce(ce(ce(ce(ce({user_id:this.config.userId,device_id:this.config.deviceId,session_id:this.config.sessionId,time:a},this.config.appVersion&&{app_version:this.config.appVersion}),this.config.trackingOptions.platform&&{platform:y3}),this.config.trackingOptions.language&&{language:eI()}),this.config.trackingOptions.ipAddress&&{ip:b3}),{insert_id:_a(),partner_id:this.config.partnerId,plan:this.config.plan}),this.config.ingestionMetadata&&{ingestion_metadata:{source_name:this.config.ingestionMetadata.sourceName,source_version:this.config.ingestionMetadata.sourceVersion}}),t),{event_id:l,library:this.library,user_agent:this.userAgent}),[2,c]})})},e})(),od=1e3,MC=(function(e){Or(t,e);function t(n){var r=this,a,o,l;try{l=(a=ze())===null||a===void 0?void 0:a.localStorage}catch(c){(o=n?.loggerProvider)===null||o===void 0||o.debug("Failed to access localStorage. error=".concat(JSON.stringify(c))),l=void 0}return r=e.call(this,l)||this,r.loggerProvider=n?.loggerProvider,r}return t.prototype.set=function(n,r){var a;return te(this,void 0,void 0,function(){var o;return ee(this,function(l){switch(l.label){case 0:return Array.isArray(r)&&r.length>od?(o=r.length-od,[4,e.prototype.set.call(this,n,r.slice(0,od))]):[3,2];case 1:return l.sent(),(a=this.loggerProvider)===null||a===void 0||a.error("Failed to save ".concat(o," events because the queue length exceeded ").concat(od,".")),[3,4];case 2:return[4,e.prototype.set.call(this,n,r)];case 3:l.sent(),l.label=4;case 4:return[2]}})})},t})($v),S3=(function(e){Or(t,e);function t(){var n;return e.call(this,(n=ze())===null||n===void 0?void 0:n.sessionStorage)||this}return t})($v),w3=(function(e){Or(t,e);function t(n){n===void 0&&(n={});var r=e.call(this)||this;return r.state={done:4},r.customHeaders=n,r}return t.prototype.send=function(n,r,a){return a===void 0&&(a=!1),te(this,void 0,void 0,function(){var o=this;return ee(this,function(l){return[2,new Promise(function(c,d){typeof XMLHttpRequest>"u"&&d(new Error("XHRTransport is not supported."));var f=new XMLHttpRequest;f.open("POST",n,!0),f.onreadystatechange=function(){if(f.readyState===o.state.done){var w=f.responseText;try{c(o.buildResponse(JSON.parse(w)))}catch{c(o.buildResponse({code:f.status}))}}};var m={"Content-Type":"application/json",Accept:"*/*"},g=JSON.stringify(r),v=a&&g.length>=uC&&cC(),b=function(w){var E,T;m=ce(ce({},o.customHeaders),m);try{for(var C=_e(Object.entries(m)),k=C.next();!k.done;k=C.next()){var j=Ae(k.value,2),N=j[0],R=j[1];f.setRequestHeader(N,R)}}catch(P){E={error:P}}finally{try{k&&!k.done&&(T=C.return)&&T.call(C)}finally{if(E)throw E.error}}f.send(w)},S=function(){return te(o,void 0,void 0,function(){var w;return ee(this,function(E){switch(E.label){case 0:return v?[4,dC(g)]:[3,2];case 1:return w=E.sent(),w?(m["Content-Encoding"]="gzip",b(w)):b(g),[3,3];case 2:b(g),E.label=3;case 3:return[2]}})})};S().catch(d)})]})})},t})(Ou),E3=(function(e){Or(t,e);function t(n){n===void 0&&(n={});var r=e.call(this)||this;return r.customHeaders=n,r}return t.prototype.send=function(n,r,a){return a===void 0&&(a=!1),te(this,void 0,void 0,function(){var o,l,c,d,f,m,g,v;return ee(this,function(b){switch(b.label){case 0:if(typeof fetch>"u")throw new Error("FetchTransport is not supported");return o=JSON.stringify(r),l=a&&o.length>=uC&&cC(),c=o,d={"Content-Type":"application/json",Accept:"*/*"},l?[4,dC(o)]:[3,2];case 1:f=b.sent(),f&&(d["Content-Encoding"]="gzip",c=f),b.label=2;case 2:return d=ce(ce({},this.customHeaders),d),m={headers:d,body:c,method:"POST"},[4,fetch(n,m)];case 3:return g=b.sent(),[4,g.text()];case 4:v=b.sent();try{return[2,this.buildResponse(JSON.parse(v))]}catch{return[2,this.buildResponse({code:g.status})]}return[2]}})})},t})(Ou),T3=(function(e){Or(t,e);function t(){return e.call(this)||this}return t.prototype.send=function(n,r,a){return te(this,void 0,void 0,function(){var o=this;return ee(this,function(l){return[2,new Promise(function(c,d){var f=ze();if(!f?.navigator.sendBeacon)throw new Error("SendBeaconTransport is not supported");try{var m=JSON.stringify(r),g=f.navigator.sendBeacon(n,m);return c(g?o.buildResponse({code:200,events_ingested:r.events.length,payload_size_bytes:m.length,server_upload_time:Date.now()}):o.buildResponse({code:500}))}catch(v){d(v)}})]})})},t})(Ou),k3=function(e,t,n){return n===void 0&&(n=!0),te(void 0,void 0,void 0,function(){var r,a,o,l,c,d,f,m,g;return ee(this,function(v){switch(v.label){case 0:return r=ZD(e),[4,t.getRaw(r)];case 1:return a=v.sent(),a?n?[4,t.remove(r)]:[3,3]:[2,{optOut:!1}];case 2:v.sent(),v.label=3;case 3:return o=Ae(a.split("."),6),l=o[0],c=o[1],d=o[2],f=o[3],m=o[4],g=o[5],[2,{deviceId:l,userId:C3(c),sessionId:hm(f),lastEventId:hm(g),lastEventTime:hm(m),optOut:!!d}]}})})},hm=function(e){var t=parseInt(e,32);if(!isNaN(t))return t},C3=function(e){if(!(!atob||!escape||!e))try{return decodeURIComponent(escape(atob(e)))}catch{return}},Kr="[Amplitude]",qw="".concat(Kr," Form Started"),A3="".concat(Kr," Form Submitted"),N3="".concat(Kr," File Downloaded"),Gw="session_start",Kw="session_end",j3="".concat(Kr," File Extension"),R3="".concat(Kr," File Name"),_3="".concat(Kr," Link ID"),O3="".concat(Kr," Link Text"),M3="".concat(Kr," Link URL"),pm="".concat(Kr," Form ID"),mm="".concat(Kr," Form Name"),gm="".concat(Kr," Form Destination"),af="cookie",DC="US",$w=function(e){var t=e.split(".");return t.length<=2?e:t.slice(t.length-2,t.length).join(".")},D3=function(e){return Object.values(e).every(function(t){return!t})},I3=function(e){var t=ce(ce({},e),{referring_domain:void 0,referrer:void 0});return Object.values(t).every(function(n){return!n})},P3=function(e,t,n,r,a,o){a===void 0&&(a=!0),e.referrer;var l=e.referring_domain,c=Jd(e,["referrer","referring_domain"]),d=t||{};d.referrer;var f=d.referring_domain,m=Jd(d,["referrer","referring_domain"]),g=n.excludeInternalReferrers;if(g){var v=V3(g,r);if(!(v instanceof TypeError)&&e.referring_domain&&F3(e.referring_domain,o)){if(v==="always")return Yw(v,e.referring_domain,r),!1;if(v==="ifEmptyCampaign"&&I3(e))return Yw(v,e.referring_domain,r),!1}}if(L3(n.excludeReferrers,e.referring_domain))return r.debug("This is not a new campaign because ".concat(e.referring_domain," is in the exclude referrer list.")),!1;if(!a&&D3(e)&&t)return r.debug("This is not a new campaign because this is a direct traffic in the same session."),!1;var b=JSON.stringify(c)!==JSON.stringify(m),S=$w(l||"")!==$w(f||""),w=!t||b||S;return w?r.debug("This is a new campaign. An $identify event will be sent."):r.debug("This is not a new campaign because it's the same as the previous one."),w},L3=function(e,t){return e===void 0&&(e=[]),t===void 0&&(t=""),e.some(function(n){return n instanceof RegExp?n.test(t):n===t})},z3=function(e,t){var n=t.startsWith(".")?t:".".concat(t),r=e.startsWith(".")?e:".".concat(e);return!!r.endsWith(n)},U3=function(e,t){var n=ce(ce({},Cf),e),r=Object.entries(n).reduce(function(a,o){var l,c=Ae(o,2),d=c[0],f=c[1];return a.setOnce("initial_".concat(d),(l=f??t.initialEmptyValue)!==null&&l!==void 0?l:"EMPTY"),f?a.set(d,f):a.unset(d)},new nu);return qv(r)},B3=function(e){var t=e;return t?(t.startsWith(".")&&(t=t.substring(1)),[new RegExp("".concat(t.replace(".","\\."),"$"))]):[]},V3=function(e,t){if(e===!0)return cm.always;if(typeof e=="object"){var n=e.condition;if(typeof n=="string"&&Object.keys(cm).includes(n))return n;if(typeof n>"u")return cm.always}var r="Invalid configuration provided for attribution.excludeInternalReferrers: ".concat(JSON.stringify(e));return t.error(r),new TypeError(r)};function Yw(e,t,n){var r="This is not a new campaign because referring_domain=".concat(t," is on the same domain as the current page and it is configured to exclude internal referrers");e==="always"?n.debug(r):e==="ifEmptyCampaign"&&n.debug("".concat(r," with empty campaign parameters"))}var IC=["ac.in","ac.jp","ac.kr","ac.th","ac.uk","ac.za","appspot.com","asn.au","azurewebsites.net","cloudfront.net","myshopify.com","blogspot.com","co.ca","co.in","co.jp","co.kr","co.nz","co.th","co.uk","co.za","com.ar","com.au","com.br","com.cn","com.hk","com.in","com.jp","com.kr","com.mx","com.pl","com.sg","com.tr","com.tw","ed.jp","edu.au","edu.br","edu.cn","edu.hk","edu.sg","edu.th","edu.tr","edu.tw","firebaseapp.com","fly.dev","gc.ca","geek.nz","github.io","gitlab.io","go.jp","go.kr","go.th","gob.ar","gob.mx","gov.au","gov.br","gov.cn","gov.hk","gov.in","gov.pl","gov.sg","gov.tr","gov.tw","gov.uk","gov.za","govt.nz","gr.jp","herokuapp.com","id.au","idv.hk","iwi.nz","lg.jp","ltd.uk","maori.nz","me.uk","mil.kr","ne.jp","ne.kr","net.au","net.br","net.cn","net.hk","net.in","net.nz","net.pl","net.sg","net.tr","net.tw","net.za","onrender.com","or.jp","or.kr","or.th","org.ar","org.au","org.br","org.cn","org.hk","org.in","org.mx","org.nz","org.pl","org.sg","org.tw","org.uk","org.za","pages.dev","pe.kr","plc.uk","re.kr","res.in","sch.uk","vercel.app","netlify.app","workers.dev"],PC=function(e){var t,n,r=e||((n=(t=ze())===null||t===void 0?void 0:t.location)===null||n===void 0?void 0:n.hostname);if(!r)return"";var a=r.split("."),o=a[a.length-1],l=a[a.length-2];return IC.find(function(c){return r.endsWith(".".concat(c))})&&(o=a[a.length-2]+"."+a[a.length-1],l=a[a.length-3]),l?"".concat(l,".").concat(o):o},F3=function(e,t){var n=ze();if(!n)return!1;var r=(t||"").trim()||PC(n.location.hostname);return z3(e,r)},H3=(function(e){Or(t,e);function t(n,r,a,o,l,c,d,f,m,g,v,b,S,w,E,T,C,k,j,N,R,P,L,H,D,B,K,se,ue,Z,V,X,le,ye,M,z,W,I,fe,ge,Se,we,Pe,je){a===void 0&&(a=new Kv),o===void 0&&(o={domain:"",expiration:365,sameSite:"Lax",secure:!1,upgrade:!0}),f===void 0&&(f=1e3),m===void 0&&(m=5),g===void 0&&(g=30),v===void 0&&(v=af),T===void 0&&(T=new ko),C===void 0&&(C=Wn.Warn),j===void 0&&(j=!1),N===void 0&&(N=!1),L===void 0&&(L=""),H===void 0&&(H=DC),K===void 0&&(K=1800*1e3),se===void 0&&(se=new MC({loggerProvider:T})),ue===void 0&&(ue={ipAddress:!0,language:!0,platform:!0}),Z===void 0&&(Z="fetch"),V===void 0&&(V=!1),X===void 0&&(X=!0),I===void 0&&(I=!0),fe===void 0&&(fe=0),Pe===void 0&&(Pe=!1),je===void 0&&(je=!1);var ve=this,Le;ve=e.call(this,{apiKey:n,storageProvider:se,transportProvider:LC(Z)})||this,ve.apiKey=n,ve.appVersion=r,ve.cookieOptions=o,ve.defaultTracking=l,ve.autocapture=c,ve.flushIntervalMillis=f,ve.flushMaxRetries=m,ve.flushQueueSize=g,ve.identityStorage=v,ve.ingestionMetadata=b,ve.instanceName=S,ve.loggerProvider=T,ve.logLevel=C,ve.minIdLength=k,ve.offline=j,ve.partnerId=R,ve.plan=P,ve.serverUrl=L,ve.serverZone=H,ve.sessionTimeout=K,ve.storageProvider=se,ve.trackingOptions=ue,ve.transport=Z,ve.useBatch=V,ve.fetchRemoteConfig=X,ve.networkTrackingOptions=z,ve.identify=W,ve.enableDiagnostics=I,ve.diagnosticsSampleRate=fe,ve.diagnosticsClient=ge,ve.remoteConfig=Se,ve.topLevelDomain=we,ve.enableRequestBodyCompression=Pe,ve._enableRequestBodyCompressionExperimental=je,ve.version=Jv,ve._optOut=!1,ve._cookieStorage=a,ve.deviceId=d,ve.lastEventId=w,ve.lastEventTime=E,ve.optOut=N,ve.deferredSessionId=B,ve.sessionId=D,ve.pageCounter=ye,ve.userId=le,ve.debugLogsEnabled=M,ve.loggerProvider.enable(M?Wn.Debug:ve.logLevel),ve.networkTrackingOptions=z,ve.identify=W,ve.enableDiagnostics=I,ve.diagnosticsSampleRate=fe,ve.diagnosticsClient=ge;var xt=(Le=Se?.fetchRemoteConfig)!==null&&Le!==void 0?Le:X;return ve.remoteConfig=ve.remoteConfig||{},ve.remoteConfig.fetchRemoteConfig=xt,ve.fetchRemoteConfig=xt,ve.topLevelDomain=we||PC(),ve}return Object.defineProperty(t.prototype,"cookieStorage",{get:function(){return this._cookieStorage},set:function(n){this._cookieStorage!==n&&(this._cookieStorage=n,this.updateStorage())},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"deviceId",{get:function(){return this._deviceId},set:function(n){this._deviceId!==n&&(this._deviceId=n,this.updateStorage())},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"userId",{get:function(){return this._userId},set:function(n){this._userId!==n&&(this._userId=n,this.updateStorage())},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"sessionId",{get:function(){return this._sessionId},set:function(n){this._sessionId!==n&&(this._sessionId=n,n!==void 0&&this._deferredSessionId!==void 0&&(this._deferredSessionId=void 0),this.updateStorage())},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"deferredSessionId",{get:function(){return this._deferredSessionId},set:function(n){this._deferredSessionId!==n&&n!==this.sessionId&&(this._deferredSessionId=n,this.updateStorage())},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"optOut",{get:function(){return this._optOut},set:function(n){this._optOut!==n&&(this._optOut=n,this.updateStorage())},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"lastEventTime",{get:function(){return this._lastEventTime},set:function(n){this._lastEventTime!==n&&(this._lastEventTime=n,this.updateStorage())},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"lastEventId",{get:function(){return this._lastEventId},set:function(n){this._lastEventId!==n&&(this._lastEventId=n,this.updateStorage())},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"pageCounter",{get:function(){return this._pageCounter},set:function(n){this._pageCounter!==n&&(this._pageCounter=n,this.updateStorage())},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"debugLogsEnabled",{set:function(n){this._debugLogsEnabled!==n&&(this._debugLogsEnabled=n,this.updateStorage())},enumerable:!1,configurable:!0}),t.prototype.updateStorage=function(){var n={deviceId:this._deviceId,userId:this._userId,sessionId:this._sessionId,deferredSessionId:this._deferredSessionId,optOut:this._optOut,lastEventTime:this._lastEventTime,lastEventId:this._lastEventId,pageCounter:this._pageCounter,debugLogsEnabled:this._debugLogsEnabled,cookieDomain:void 0};this.cookieStorage instanceof nf&&(n.cookieDomain=this.cookieStorage.options.domain),this.cookieStorage.set(sC(this.apiKey),n)},t})(rC),q3=function(e,t,n,r,a){return t===void 0&&(t={}),te(void 0,void 0,void 0,function(){var o,l,c,d,f,m,g,v,b,S,w,E,T,C,k,j,N,R,P,L,H,D,B,K,se,ue,Z,V,X,le,ye,M,z,W,I,fe,ge,Se,we,Pe,je,ve,Le,xt,Ot,We,Nt,lt,Bt;return ee(this,function($t){switch($t.label){case 0:return o=t.identityStorage||af,l="",o!==af?[3,2]:[4,$3(void 0,r)];case 1:l=$t.sent(),$t.label=2;case 2:return c=ce({domain:(B=(D=t.cookieOptions)===null||D===void 0?void 0:D.domain)!==null&&B!==void 0?B:l,expiration:365,sameSite:"Lax",secure:!1,upgrade:!0},t.cookieOptions),d={duplicateResolverFn:function(Jt){var mt=oC(Jt);if(!mt)return!1;var st=JSON.parse(mt);return lC(st.cookieDomain,c.domain)},diagnosticsClient:r},f=G3(t.identityStorage,c,d),[4,k3(e,f,(se=(K=t.cookieOptions)===null||K===void 0?void 0:K.upgrade)!==null&&se!==void 0?se:!0)];case 3:return m=$t.sent(),[4,f.get(sC(e))];case 4:return g=$t.sent(),v=ef(),b=v.ampTimestamp?Number(v.ampTimestamp):void 0,S=b?Date.now()<b:!0,w=(le=(X=(V=(ue=t.deviceId)!==null&&ue!==void 0?ue:S?(Z=v.ampDeviceId)!==null&&Z!==void 0?Z:v.deviceId:void 0)!==null&&V!==void 0?V:g?.deviceId)!==null&&X!==void 0?X:m.deviceId)!==null&&le!==void 0?le:_a(),E=(ye=g?.lastEventId)!==null&&ye!==void 0?ye:m.lastEventId,T=(M=g?.lastEventTime)!==null&&M!==void 0?M:m.lastEventTime,C=(W=(z=t.optOut)!==null&&z!==void 0?z:g?.optOut)!==null&&W!==void 0?W:m.optOut,k=(I=g?.sessionId)!==null&&I!==void 0?I:m.sessionId,j=g?.deferredSessionId,N=(ge=(fe=t.userId)!==null&&fe!==void 0?fe:g?.userId)!==null&&ge!==void 0?ge:m.userId,n.previousSessionDeviceId=(Se=g?.deviceId)!==null&&Se!==void 0?Se:m.deviceId,n.previousSessionUserId=(we=g?.userId)!==null&&we!==void 0?we:m.userId,R={ipAddress:(je=(Pe=t.trackingOptions)===null||Pe===void 0?void 0:Pe.ipAddress)!==null&&je!==void 0?je:!0,language:(Le=(ve=t.trackingOptions)===null||ve===void 0?void 0:ve.language)!==null&&Le!==void 0?Le:!0,platform:(Ot=(xt=t.trackingOptions)===null||xt===void 0?void 0:xt.platform)!==null&&Ot!==void 0?Ot:!0},P=g?.pageCounter,L=g?.debugLogsEnabled,t.autocapture!==void 0&&(t.defaultTracking=t.autocapture),H=new H3(e,t.appVersion,f,c,t.defaultTracking,t.autocapture,w,t.flushIntervalMillis,t.flushMaxRetries,t.flushQueueSize,o,t.ingestionMetadata,t.instanceName,E,T,(We=a?.loggerProvider)!==null&&We!==void 0?We:t.loggerProvider,t.logLevel,t.minIdLength,t.offline,C,t.partnerId,t.plan,t.serverUrl,(Nt=a?.serverZone)!==null&&Nt!==void 0?Nt:t.serverZone,k,j,t.sessionTimeout,t.storageProvider,R,t.transport,t.useBatch,t.fetchRemoteConfig,N,P,L,t.networkTrackingOptions,t.identify,(lt=a?.enableDiagnostics)!==null&&lt!==void 0?lt:t.enableDiagnostics,(Bt=a?.diagnosticsSampleRate)!==null&&Bt!==void 0?Bt:n._diagnosticsSampleRate,r,t.remoteConfig,l,t.enableRequestBodyCompression,n._enableRequestBodyCompressionExperimentalValue),[4,H.storageProvider.isEnabled()];case 5:return $t.sent()||(H.loggerProvider.warn("Storage provider ".concat(H.storageProvider.constructor.name," is not enabled. Falling back to MemoryStorage.")),H.storageProvider=new Kv),[2,H]}})})},G3=function(e,t,n){switch(e===void 0&&(e=af),t===void 0&&(t={}),e){case"localStorage":return new MC;case"sessionStorage":return new S3;case"none":return new Kv;default:return new nf(ce(ce({},t),{expirationDays:t.expiration}),n)}},K3=function(e){var t,n;return e===void 0&&(e={}),((t=e.remoteConfig)===null||t===void 0?void 0:t.fetchRemoteConfig)===!0?!0:!(((n=e.remoteConfig)===null||n===void 0?void 0:n.fetchRemoteConfig)===!1||e.fetchRemoteConfig===!1)},LC=function(e){var t=typeof e=="object"?e.type:e,n=typeof e=="object"?e.headers:void 0;return t==="xhr"?new w3(n):t==="beacon"?new T3:new E3(n)},$3=function(e,t){return te(void 0,void 0,void 0,function(){var n,r,a,o,l,l,c,d,f;return ee(this,function(m){switch(m.label){case 0:return[4,new nf(void 0,{diagnosticsClient:t}).isEnabled()];case 1:if(!m.sent()||typeof location>"u"||!location.hostname)return[2,""];for(n=location.hostname,r=n.split("."),a=[],o=1,IC.find(function(g){return n.endsWith(".".concat(g))})&&(o=2),l=r.length-o-1;l>=0;--l)a.push(r.slice(l).join("."));l=0,m.label=2;case 2:if(!(l<a.length))return[3,7];c=a[l],m.label=3;case 3:return m.trys.push([3,5,,6]),[4,nf.isDomainWritable(c)];case 4:return d=m.sent(),d?[2,"."+c]:[3,6];case 5:return f=m.sent(),t&&t.recordEvent("cookies.tld.failure",{reason:"Unexpected exception checking domain is writable: ".concat(c),error:f instanceof Error?f.message:String(f)}),[3,6];case 6:return l++,[3,2];case 7:return t&&t.recordEvent("cookies.tld.failure",{reason:"Could not determine TLD for host ".concat(n)}),[2,""]}})})},Y3=function(e){var t={};for(var n in e){var r=e[n];r&&(t[n]=r)}return t},W3="[Amplitude] Page Viewed",Ww=function(e){e===void 0&&(e={});var t,n=ze(),r=void 0,a=!1,o,l=e.trackOn,c=e.trackHistoryChanges,d=e.eventType,f=d===void 0?W3:d,m=function(T){var C=T;try{C=decodeURI(T)}catch(k){r?.error("Malformed URI sequence: ",k)}return C},g=function(){return te(void 0,void 0,void 0,function(){var T,C,k;return ee(this,function(j){switch(j.label){case 0:return T=m(typeof location<"u"&&location.href||""),k={event_type:f},C=[{}],[4,X3()];case 1:return[2,(k.event_properties=ce.apply(void 0,[ce.apply(void 0,C.concat([j.sent()])),{"[Amplitude] Page Domain":typeof location<"u"&&location.hostname||"","[Amplitude] Page Location":T,"[Amplitude] Page Path":typeof location<"u"&&m(location.pathname)||"","[Amplitude] Page Title":Xv(Wv),"[Amplitude] Page URL":T.split("?")[0]}]),k)]}})})},v=function(){return typeof l>"u"||typeof l=="function"&&l()},b=typeof location<"u"?location.href:null,S=function(){return te(void 0,void 0,void 0,function(){var T,C,k,j;return ee(this,function(N){switch(N.label){case 0:return T=location.href,C=J3(c,T,b||"")&&v(),b=T,C?(r?.log("Tracking page view event"),t!=null?[3,1]:[3,3]):[3,4];case 1:return j=(k=t).track,[4,g()];case 2:j.apply(k,[N.sent()]),N.label=3;case 3:N.label=4;case 4:return[2]}})})},w=function(){S()},E={name:"@amplitude/plugin-page-view-tracking-browser",type:"enrichment",setup:function(T,C){return te(void 0,void 0,void 0,function(){var k,j;return ee(this,function(N){switch(N.label){case 0:return t=C,o=T,r=T.loggerProvider,r.log("Installing @amplitude/plugin-page-view-tracking-browser"),a=!0,n&&(n.addEventListener("popstate",w),n.history.pushState=new Proxy(n.history.pushState,{apply:function(R,P,L){var H=Ae(L,3),D=H[0],B=H[1],K=H[2];R.apply(P,[D,B,K]),a&&S()}})),v()?(r.log("Tracking page view event"),j=(k=t).track,[4,g()]):[3,2];case 1:j.apply(k,[N.sent()]),N.label=2;case 2:return[2]}})})},execute:function(T){return te(void 0,void 0,void 0,function(){var C;return ee(this,function(k){switch(k.label){case 0:return l==="attribution"&&Q3(T)?(r?.log("Enriching campaign event to page view event with campaign parameters"),[4,g()]):[3,2];case 1:C=k.sent(),T.event_type=C.event_type,T.event_properties=ce(ce({},T.event_properties),C.event_properties),k.label=2;case 2:return o&&T.event_type===f&&(o.pageCounter=o.pageCounter?o.pageCounter+1:1,T.event_properties=ce(ce({},T.event_properties),{"[Amplitude] Page Counter":o.pageCounter})),[2,T]}})})},teardown:function(){return te(void 0,void 0,void 0,function(){return ee(this,function(T){return n&&(n.removeEventListener("popstate",w),a=!1),[2]})})}};return E},X3=function(){return te(void 0,void 0,void 0,function(){var e;return ee(this,function(t){switch(t.label){case 0:return e=Y3,[4,new bC().parse()];case 1:return[2,e.apply(void 0,[t.sent()])]}})})},Q3=function(e){if(e.event_type==="$identify"&&e.user_properties){var t=e.user_properties,n=t[Ta.SET]||{},r=t[Ta.UNSET]||{},a=Je(Je([],Ae(Object.keys(n)),!1),Ae(Object.keys(r)),!1);return Object.keys(Cf).every(function(o){return a.includes(o)})}return!1},J3=function(e,t,n){switch(e){case"pathOnly":{if(n=="")return!0;var r=new URL(t),a=new URL(n),o=r.origin+r.pathname,l=a.origin+a.pathname;return o!==l}default:return t!==n}},Z3=function(){var e,t=[],n=function(m,g,v){m.addEventListener(g,v),t.push({element:m,type:g,handler:v})},r=function(){t.forEach(function(m){var g=m.element,v=m.type,b=m.handler;g?.removeEventListener(v,b)}),t=[]},a,o="@amplitude/plugin-form-interaction-tracking-browser",l="enrichment",c=function(m,g){return te(void 0,void 0,void 0,function(){var v,b;return ee(this,function(S){return a=v3(m),v=function(){if(!g){m.loggerProvider.warn("Form interaction tracking requires a later version of @amplitude/analytics-browser. Form interaction events are not tracked.");return}if(!(typeof document>"u")){var w=new WeakSet,E=function(C){if(!w.has(C)){w.add(C);var k=!1;n(C,"change",function(){var j,N=Xw(C);k||g.track(qw,(j={},j[pm]=eo(C.id),j[mm]=eo(C.name),j[gm]=N,j)),k=!0}),n(C,"submit",function(j){var N,R,P=Xw(C);if(k||g.track(qw,(N={},N[pm]=eo(C.id),N[mm]=eo(C.name),N[gm]=P,N)),k=!0,a?.shouldTrackSubmit!==void 0)if(typeof a.shouldTrackSubmit=="function"&&typeof SubmitEvent<"u"&&j instanceof SubmitEvent)try{var L=a.shouldTrackSubmit(j);if(!L)return}catch{m.loggerProvider.warn("shouldTrackSubmit callback threw an error, proceeding with tracking.")}else m.loggerProvider.warn("shouldTrackSubmit is ignored because it is not a function or event is not a SubmitEvent.");g.track(A3,(R={},R[pm]=eo(C.id),R[mm]=eo(C.name),R[gm]=P,R)),k=!1})}},T=Array.from(document.getElementsByTagName("form"));T.forEach(E),typeof MutationObserver<"u"&&(e=new MutationObserver(function(C){C.forEach(function(k){k.addedNodes.forEach(function(j){j.nodeName==="FORM"&&E(j),"querySelectorAll"in j&&typeof j.querySelectorAll=="function"&&Array.from(j.querySelectorAll("form")).map(E)})})}),e.observe(document.body,{subtree:!0,childList:!0}))}},document.readyState==="complete"?v():(b=ze(),b?b.addEventListener("load",v):m.loggerProvider.debug("Form interaction tracking is not installed because global is undefined.")),[2]})})},d=function(m){return te(void 0,void 0,void 0,function(){return ee(this,function(g){return[2,m]})})},f=function(){return te(void 0,void 0,void 0,function(){return ee(this,function(m){return e?.disconnect(),r(),[2]})})};return{name:o,type:l,setup:c,execute:d,teardown:f}},eo=function(e){if(typeof e=="string")return e},Xw=function(e){var t=e.getAttribute("action");try{t=new URL(encodeURI(t??""),window.location.href).href}catch{}return t},eP=function(){var e,t=[],n=function(f,m,g){f.addEventListener(m,g),t.push({element:f,type:m,handler:g})},r=function(){t.forEach(function(f){var m=f.element,g=f.type,v=f.handler;m?.removeEventListener(g,v)}),t=[]},a="@amplitude/plugin-file-download-tracking-browser",o="enrichment",l=function(f,m){return te(void 0,void 0,void 0,function(){var g,v;return ee(this,function(b){return g=function(){if(!m){f.loggerProvider.warn("File download tracking requires a later version of @amplitude/analytics-browser. File download events are not tracked.");return}if(!(typeof document>"u")){var S=function(T){var C;try{C=new URL(T.href,window.location.href)}catch{return}var k=w.exec(C.href),j=k?.[1];j&&n(T,"click",function(){var N;j&&m.track(N3,(N={},N[j3]=j,N[R3]=C.pathname,N[_3]=T.id,N[O3]=T.text,N[M3]=T.href,N))})},w=/\.(pdf|xlsx?|docx?|txt|rtf|csv|exe|key|pp(s|t|tx)|7z|pkg|rar|gz|zip|avi|mov|mp4|mpe?g|wmv|midi?|mp3|wav|wma)(\?.+)?$/,E=Array.from(document.getElementsByTagName("a"));E.forEach(S),typeof MutationObserver<"u"&&(e=new MutationObserver(function(T){T.forEach(function(C){C.addedNodes.forEach(function(k){k.nodeName==="A"&&S(k),"querySelectorAll"in k&&typeof k.querySelectorAll=="function"&&Array.from(k.querySelectorAll("a")).map(S)})})}),e.observe(document.body,{subtree:!0,childList:!0}))}},document.readyState==="complete"?g():(v=ze(),v?v.addEventListener("load",g):f.loggerProvider.debug("File download tracking is not installed because global is undefined.")),[2]})})},c=function(f){return te(void 0,void 0,void 0,function(){return ee(this,function(m){return[2,f]})})},d=function(){return te(void 0,void 0,void 0,function(){return ee(this,function(f){return e?.disconnect(),r(),[2]})})};return{name:a,type:o,setup:l,execute:c,teardown:d}},Qw=!1,tP=function(e){if(!(Qw||e.defaultTracking!==void 0)){var t=`\`options.defaultTracking\` is set to undefined. This implicitly configures your Amplitude instance to track Page Views, Sessions, File Downloads, and Form Interactions. You can suppress this warning by explicitly setting a value to \`options.defaultTracking\`. The value must either be a boolean, to enable and disable all default events, or an object, for advanced configuration. For example:
16
+
17
+ amplitude.init(<YOUR_API_KEY>, {
18
+ defaultTracking: true,
19
+ });
20
+
21
+ Visit https://www.docs.developers.amplitude.com/data/sdks/browser-2/#tracking-default-events for more details.`;e.loggerProvider.warn(t),Qw=!0}},nP=function(){var e="@amplitude/plugin-network-checker-browser",t="before",n=ze(),r=[],a=function(d,f){n?.addEventListener&&(n?.addEventListener(d,f),r.push({type:d,handler:f}))},o=function(){r.forEach(function(d){var f=d.type,m=d.handler;n?.removeEventListener(f,m)}),r=[]},l=function(d,f){return te(void 0,void 0,void 0,function(){return ee(this,function(m){return typeof navigator>"u"?(d.loggerProvider.debug("Network connectivity checker plugin is disabled because navigator is not available."),d.offline=!1,[2]):(d.offline=!navigator.onLine,a("online",function(){d.loggerProvider.debug("Network connectivity changed to online."),d.offline=!1,setTimeout(function(){f.flush()},d.flushIntervalMillis)}),a("offline",function(){d.loggerProvider.debug("Network connectivity changed to offline."),d.offline=!0}),[2])})})},c=function(){return te(void 0,void 0,void 0,function(){return ee(this,function(d){return o(),[2]})})};return{name:e,type:t,setup:l,teardown:c}};function zC(e){var t,n,r,a,o,l,c,d,f,m,g;if(!(typeof e!="object"||e===null)&&!Array.isArray(e)){var v=Object.keys(e);try{for(var b=_e(v),S=b.next();!S.done;S=b.next()){var w=S.value;try{var E=e[w];typeof E?.enabled=="boolean"&&(E.enabled?(delete E.enabled,Object.keys(E).length===0&&(e[w]=!0)):e[w]=!1),zC(E)}catch{}}}catch(B){t={error:B}}finally{try{S&&!S.done&&(n=b.return)&&n.call(b)}finally{if(t)throw t.error}}try{if(!((f=(d=(c=e.autocapture)===null||c===void 0?void 0:c.networkTracking)===null||d===void 0?void 0:d.captureRules)===null||f===void 0)&&f.length)try{for(var T=_e(e.autocapture.networkTracking.captureRules),C=T.next();!C.done;C=T.next()){var k=C.value;try{for(var j=(o=void 0,_e(["responseHeaders","requestHeaders"])),N=j.next();!N.done;N=j.next()){var R=N.value,P=(m=k[R])!==null&&m!==void 0?m:{},L=P.captureSafeHeaders,H=P.allowlist;if(!(!L&&!H)){if(H!==void 0&&!Array.isArray(H)){delete k[R];continue}k[R]=Je(Je([],Ae(L?Zd:[]),!1),Ae(H??[]),!1)}}}catch(B){o={error:B}}finally{try{N&&!N.done&&(l=j.return)&&l.call(j)}finally{if(o)throw o.error}}}}catch(B){r={error:B}}finally{try{C&&!C.done&&(a=T.return)&&a.call(T)}finally{if(r)throw r.error}}}catch{}var D=(g=e.autocapture)===null||g===void 0?void 0:g.frustrationInteractions;D&&(D.rageClick&&(D.rageClicks=D.rageClick,delete D.rageClick),D.deadClick&&(D.deadClicks=D.deadClick,delete D.deadClick))}}function Jw(e,t,n){var r,a,o=[];try{for(var l=_e(t??[]),c=l.next();!c.done;c=l.next()){var d=c.value;try{o.push(new RegExp(d))}catch(f){n.loggerProvider.warn("Invalid regex pattern: ".concat(d),f)}}}catch(f){r={error:f}}finally{try{c&&!c.done&&(a=l.return)&&a.call(l)}finally{if(r)throw r.error}}return e.concat(o)}function rP(e,t){var n,r,a,o,l,c,d;if(e){zC(e);try{t.loggerProvider.debug("Update browser config with remote configuration:",JSON.stringify(e));var f=e;if(f&&"autocapture"in f){if(typeof f.autocapture=="boolean"&&(t.autocapture=f.autocapture),typeof f.autocapture=="object"&&f.autocapture!==null){var m=ce({},f.autocapture);if(t.autocapture===void 0&&(t.autocapture=f.autocapture),typeof f.autocapture.elementInteractions=="object"&&f.autocapture.elementInteractions!==null&&(!((a=f.autocapture.elementInteractions.pageUrlAllowlistRegex)===null||a===void 0)&&a.length)){m.elementInteractions=ce({},f.autocapture.elementInteractions);var g=m.elementInteractions,v=(o=g.pageUrlAllowlist)!==null&&o!==void 0?o:[],b=f.autocapture.elementInteractions.pageUrlAllowlistRegex;g.pageUrlAllowlist=Jw(v,b,t),delete g.pageUrlAllowlistRegex}if(typeof f.autocapture.networkTracking=="object"&&f.autocapture.networkTracking!==null&&(!((l=f.autocapture.networkTracking.captureRules)===null||l===void 0)&&l.length)){m.networkTracking=ce({},f.autocapture.networkTracking);var S=m.networkTracking,w=(c=S.captureRules)!==null&&c!==void 0?c:[];try{for(var E=_e(w),T=E.next();!T.done;T=E.next()){var C=T.value;C.urls=Jw((d=C.urls)!==null&&d!==void 0?d:[],C.urlsRegex,t),delete C.urlsRegex}}catch(k){n={error:k}}finally{try{T&&!T.done&&(r=E.return)&&r.call(E)}finally{if(n)throw n.error}}}typeof t.autocapture=="boolean"&&(t.autocapture=ce({attribution:t.autocapture,fileDownloads:t.autocapture,formInteractions:t.autocapture,pageViews:t.autocapture,sessions:t.autocapture,elementInteractions:t.autocapture,webVitals:t.autocapture,frustrationInteractions:t.autocapture},m)),typeof t.autocapture=="object"&&(t.autocapture=ce(ce({},t.autocapture),m))}t.defaultTracking=t.autocapture}t.loggerProvider.debug("Browser config after remote config update:",JSON.stringify(t))}catch(k){t.loggerProvider.error("Failed to apply remote configuration because of error: ",k)}}}var UC="1.23.3",iP="@amplitude/plugin-autocapture-browser",aP="@amplitude/plugin-frustration-browser",BC="[Amplitude] Element Clicked",sP="[Amplitude] Dead Click",oP="[Amplitude] Rage Click",lP="[Amplitude] Error Click",uP="[Amplitude] Element Changed",cP="[Amplitude] Thrashed Cursor",dP="[Amplitude] Element ID",fP="[Amplitude] Element Class",Zw="[Amplitude] Element Tag",eE="[Amplitude] Element Text",hP="[Amplitude] Element Hierarchy",pP="[Amplitude] Element Href",mP="[Amplitude] Element Position Left",gP="[Amplitude] Element Position Top",vP="[Amplitude] Element Aria Label",yP="[Amplitude] Element Attributes",bP="[Amplitude] Element Parent Label",tE="[Amplitude] Page URL",xP="[Amplitude] Page Title",SP="[Amplitude] Viewport Height",wP="[Amplitude] Viewport Width",EP="https://cdn.amplitude.com/libs/visual-tagging-selector-1.0.0-alpha.js.gz",TP="amp-visual-tagging-selector-highlight",VC="data-amp-mask-attributes",kP=25,FC=128,CP=["input","select","textarea"],HC=function(e,t){var n,r=(n=window?.getComputedStyle)===null||n===void 0?void 0:n.call(window,e);return r?.getPropertyValue("cursor")==="pointer"&&t==="click"},qC=function(e){var t=e.pageUrlAllowlist,n=e.pageUrlExcludelist;return!(n&&n.length>0&&yg(window.location.href,n)||!yg(window.location.href,t))},yo=function(e,t,n){return n===void 0&&(n=!1),function(r,a){var o,l,c=e.shouldTrackEventResolver,d=(l=(o=a?.tagName)===null||o===void 0?void 0:o.toLowerCase)===null||l===void 0?void 0:l.call(o);if(!d)return!1;if(c)return c(r,a);if(!qC(e))return!1;var f=String(a?.getAttribute("type"))||"";if(typeof f=="string")switch(f.toLowerCase()){case"hidden":return!1;case"password":return!1}var m=HC(a,r);if(n&&m)return!0;if(t){var g=t.some(function(v){var b;return!!(!((b=a?.matches)===null||b===void 0)&&b.call(a,v))});if(!g)return!1}switch(d){case"input":case"select":case"textarea":return r==="change"||r==="click";default:return m?!0:r==="click"}}},AP=function(e){var t,n,r,a=(n=(t=e?.tagName)===null||t===void 0?void 0:t.toLowerCase)===null||n===void 0?void 0:n.call(t),o=e instanceof HTMLElement?((r=e.getAttribute("contenteditable"))===null||r===void 0?void 0:r.toLowerCase())==="true":!1;return!CP.includes(a)&&!o},NP=function(e){return e?e.split(",").map(function(t){return t.trim()}).filter(function(t){return t.length>0&&t!=="id"&&t!=="class"}):[]},jP=function(e,t){return Object.entries(e).reduce(function(n,r){var a=Ae(r,2),o=a[0],l=a[1];if(o.startsWith(t)){var c=o.replace(t,"");c&&(n[c]=l||"")}return n},{})},RP=function(e){return e==null||typeof e=="object"&&Object.keys(e).length===0||typeof e=="string"&&e.trim().length===0},nE=function(e){return Object.keys(e).reduce(function(t,n){var r=e[n];return RP(r)||(t[n]=r),t},{})},Zv=function(e,t){return e?t.some(function(n){var r;return(r=e?.matches)===null||r===void 0?void 0:r.call(e,n)})?e:Zv(e?.parentElement,t):null},Mu=function(e){return!(e.event.target===null||!e.closestTrackedAncestor)};function _P(e){return e.type==="click"||e.type==="change"}var sf;(function(e){e[e.LEFT_OR_TOUCH_CONTACT=0]="LEFT_OR_TOUCH_CONTACT",e[e.MIDDLE=1]="MIDDLE",e[e.RIGHT=2]="RIGHT"})(sf||(sf={}));var rE="__AMPLITUDE_VISUAL_TAGGING__";function OP(e,t){var n=e;if(n[rE]!==!0){n[rE]=!0;var r=t.dataExtractor,a=t.isElementSelectable,o=t.cssSelectorAllowlist,l=t.actionClickAllowlist,c=null,d=function(m){e.notify({action:"element-selected",data:m})},f=function(m,g){m==="selector-mode-changed"?e.notify({action:"track-selector-mode-changed",data:g}):m==="selector-moved"&&e.notify({action:"track-selector-moved",data:g})};e.registerActionHandler("initialize-visual-tagging-selector",function(m){e.loadScriptOnce(EP).then(function(){var g;c=(g=window?.amplitudeVisualTaggingSelector)===null||g===void 0?void 0:g.call(window,{getEventTagProps:r.getEventTagProps,isElementSelectable:function(v){return a?a(m?.actionType||"click",v):!0},onTrack:f,onSelect:d,visualHighlightClass:TP,messenger:e,cssSelectorAllowlist:o,actionClickAllowlist:l,extractDataFromDataSource:r.extractDataFromDataSource,dataExtractor:r,diagnostics:{autocapture:{version:UC}}}),e.notify({action:"selector-loaded"})}).catch(function(){var g;(g=e.logger)===null||g===void 0||g.warn("Failed to initialize visual tagging selector")})}),e.registerActionHandler("close-visual-tagging-selector",function(){var m;(m=c?.close)===null||m===void 0||m.call(c)})}}function MP(e){var t=e.amplitude,n=e.allObservables,r=e.shouldTrackEvent,a=e.evaluateTriggers,o=n.clickObservable,l=o.filter(Mu).filter(function(d){return r("click",d.closestTrackedAncestor)}).map(function(d){return a(d)}),c=l;return c.subscribe(function(d){t?.track(BC,d.targetElementProperties)})}function DP(e){var t=e.amplitude,n=e.allObservables,r=e.getEventProperties,a=e.shouldTrackEvent,o=e.evaluateTriggers,l=n.changeObservable,c=l.filter(Mu).filter(function(d){return a("change",d.closestTrackedAncestor)}).map(function(d){return o(d)});return c.subscribe(function(d){t?.track(uP,r("change",d.closestTrackedAncestor))})}function IP(e){var t=e.amplitude,n=e.allObservables,r=e.options,a=e.getEventProperties,o=e.shouldTrackEvent,l=e.shouldTrackActionClick,c=n.clickObservable,d=n.mutationObservable,f=n.navigateObservable,m=c.filter(function(E){return!o("click",E.closestTrackedAncestor)}).map(function(E){var T=Zv(E.event.target,r.actionClickAllowlist);return E.closestTrackedAncestor=T,E.closestTrackedAncestor!==null&&(E.targetElementProperties=a(E.type,E.closestTrackedAncestor)),E}).filter(Mu).filter(function(E){return l("click",E.closestTrackedAncestor)}),g=f?ps(d,f):d,v=ps(m,g),b=null,S=null,w=Qv(v,function(E){if(b&&(clearTimeout(b),b=null),E.type==="click")return S=E,b=setTimeout(function(){b=null,S=null},500),Promise.resolve(null);if(S){var T=S;return S=null,Promise.resolve(T)}return Promise.resolve(null)});return w.subscribe(function(E){E&&t?.track(BC,a("click",E.closestTrackedAncestor))})}var Na=ze(),GC=function(){return new _n(function(e){var t=new MutationObserver(function(n){e.next(n)});return document.body&&t.observe(document.body,{childList:!0,attributes:!0,characterData:!0,subtree:!0}),function(){return t.disconnect()}})},KC=function(e){return e===void 0&&(e="click"),new _n(function(t){var n=function(r){t.next(r)};return Na.document.addEventListener(e,n,{capture:!0}),function(){Na.document.removeEventListener(e,n,{capture:!0})}})},PP=function(){return new _n(function(e){var t=function(n){for(var r=[],a=1;a<arguments.length;a++)r[a-1]=arguments[a];var o=void 0;Array.isArray(r[0])&&typeof r[0][0]=="string"&&(o=r[0][0]),e.next({kind:"console",message:o})};return Ow.addListener("error",t),function(){Ow.removeListener(t)}})},LP=function(){return new _n(function(e){var t=function(n){if(n instanceof ErrorEvent){var r={kind:"error"};n.error instanceof Error||n.error instanceof DOMException?r=ce(ce({},r),{message:n.error.message,stack:n.error.stack,filename:n.filename,lineNumber:n.lineno,columnNumber:n.colno}):typeof n.error=="string"&&(r.message=n.error),e.next(r)}};return Na.addEventListener("error",t),function(){Na.removeEventListener("error",t)}})},zP=function(){return new _n(function(e){var t=function(n){var r={kind:"unhandledrejection"};n.reason instanceof Error||n.reason instanceof DOMException?(r.message=n.reason.message,r.stack=n.reason.stack):typeof n.reason=="string"&&(r.message=n.reason),e.next(r)};return Na.addEventListener("unhandledrejection",t),function(){Na.removeEventListener("unhandledrejection",t)}})},UP=function(){var e=ps(LP(),zP());return ps(e,PP())},BP=function(){return new _n(function(e){var t=function(r){e.next(r)},n={capture:!0};return Na.document.addEventListener("mousemove",t,n),function(){Na.document.removeEventListener("mousemove",t,n)}})},VP=function(e,t){try{if(t.subprop_key==="[Amplitude] Element Text")return t.subprop_op==="is"&&t.subprop_value.includes(e.targetElementProperties["[Amplitude] Element Text"]);if(t.subprop_key==="[Amplitude] Element Hierarchy")return t.subprop_op==="autotrack css match"&&!!e.closestTrackedAncestor.closest(t.subprop_value.toString())}catch(n){return console.error("Error matching event to filter",n),!1}return!1},FP=function(e,t){try{if(e.sourceType==="DOM_ELEMENT"){var n=document.documentElement;return e.scope&&t&&(n=t.closest(e.scope)),n&&e.selector?n.querySelector(e.selector):n}}catch{return}},HP=function(e,t,n){e.forEach(function(r){if(typeof r!="string"&&r.actionType==="ATTACH_EVENT_PROPERTY"){var a=n.extractDataFromDataSource(r.dataSource,t.closestTrackedAncestor);t.targetElementProperties[r.destinationKey]=a}})},wg={"[Amplitude] Element Clicked":"click","[Amplitude] Element Changed":"change"},iE=function(e){var t,n,r,a,o=Object.values(wg).reduce(function(b,S){return b[S]=new Set,b},{});if(!e)return o;try{for(var l=_e(e),c=l.next();!c.done;c=l.next()){var d=c.value;try{try{for(var f=(r=void 0,_e(d.definition)),m=f.next();!m.done;m=f.next()){var g=m.value,v=wg[g.event_type];v&&o[v].add(d.id)}}catch(b){r={error:b}}finally{try{m&&!m.done&&(a=f.return)&&a.call(f)}finally{if(r)throw r.error}}}catch(b){console.warn("Skipping Labeled Event due to malformed definition",d?.id,b)}}}catch(b){t={error:b}}finally{try{c&&!c.done&&(n=l.return)&&n.call(l)}finally{if(t)throw t.error}}return o},aE=function(e){var t,n,r,a,o=new Map;try{for(var l=_e(e),c=l.next();!c.done;c=l.next()){var d=c.value;try{for(var f=(r=void 0,_e(d.conditions)),m=f.next();!m.done;m=f.next()){var g=m.value;if(g.type==="LABELED_EVENT"){var v=g.match.eventId,b=o.get(v);b||(b=[],o.set(v,b)),b.push(d)}}}catch(S){r={error:S}}finally{try{m&&!m.done&&(a=f.return)&&a.call(f)}finally{if(r)throw r.error}}}}catch(S){t={error:S}}finally{try{c&&!c.done&&(n=l.return)&&n.call(l)}finally{if(t)throw t.error}}return o},qP=function(e,t){return t.filter(function(n){return n.definition.some(function(r){return wg[r.event_type]===e.type&&r.filters.every(function(a){return VP(e,a)})})})},GP=function(e,t){var n,r,a,o,l=new Set;try{for(var c=_e(e),d=c.next();!d.done;d=c.next()){var f=d.value,m=t.get(f.id);if(m)try{for(var g=(a=void 0,_e(m)),v=g.next();!v.done;v=g.next()){var b=v.value;l.add(b)}}catch(S){a={error:S}}finally{try{v&&!v.done&&(o=g.return)&&o.call(g)}finally{if(a)throw a.error}}}}catch(S){n={error:S}}finally{try{d&&!d.done&&(r=c.return)&&r.call(c)}finally{if(n)throw n.error}}return Array.from(l)},KP=(function(){function e(t,n,r,a){this.groupedLabeledEvents=t,this.labeledEventToTriggerMap=n,this.dataExtractor=r,this.options=a}return e.prototype.evaluate=function(t){var n,r,a=this.options.pageActions;if(!a)return t;var o=qP(t,Array.from(this.groupedLabeledEvents[t.type]).map(function(m){return a.labeledEvents[m]})),l=GP(o,this.labeledEventToTriggerMap);try{for(var c=_e(l),d=c.next();!d.done;d=c.next()){var f=d.value;HP(f.actions,t,this.dataExtractor)}}catch(m){n={error:m}}finally{try{d&&!d.done&&(r=c.return)&&r.call(c)}finally{if(n)throw n.error}}return t},e.prototype.update=function(t,n,r){this.groupedLabeledEvents=t,this.labeledEventToTriggerMap=n,this.options=r},e})(),$P=function(e,t,n,r){return new KP(e,t,n,r)},YP=new Set(["id","class","style","value","onclick","onchange","oninput","onblur","onsubmit","onfocus","onkeydown","onkeyup","onkeypress","data-reactid","data-react-checksum","data-reactroot",VC,lo]),WP=["type"],XP=["svg","path","g"],QP=["password","hidden"];function JP(e,t){var n,r,a,o,l,c;if(e===null)return null;var d=String(e.tagName).toLowerCase(),f={tag:d},m=Array.from((o=(a=e.parentElement)===null||a===void 0?void 0:a.children)!==null&&o!==void 0?o:[]);m.length&&(f.index=m.indexOf(e),f.indexOfType=m.filter(function(N){return N.tagName===e.tagName}).indexOf(e));var g=(c=(l=e.previousElementSibling)===null||l===void 0?void 0:l.tagName)===null||c===void 0?void 0:c.toLowerCase();g&&(f.prevSib=String(g));var v=e.getAttribute("id");v&&(f.id=String(v));var b=Array.from(e.classList);b.length&&(f.classes=b);var S={},w=Array.from(e.attributes),E=w.filter(function(N){return!YP.has(N.name)}),T=!AP(e);if(!QP.includes(String(e.getAttribute("type")))&&!XP.includes(d))try{for(var C=_e(E),k=C.next();!k.done;k=C.next()){var j=k.value;if(!(T&&!WP.includes(j.name))){if(t.has(j.name)){S[j.name]=Ca;continue}S[j.name]=String(j.value).substring(0,FC)}}}catch(N){n={error:N}}finally{try{k&&!k.done&&(r=C.return)&&r.call(C)}finally{if(n)throw n.error}}return Object.keys(S).length&&(f.attrs=S),f}function ZP(e){var t=[];if(!e)return t;t.push(e);for(var n=e.parentElement;n&&n.tagName!=="HTML";)t.push(n),n=n.parentElement;return t}var $C=(function(){function e(t,n){var r,a,o=this,l;this.replaceSensitiveString=function(v){return Wv(v,o.additionalMaskTextPatterns)},this.getHierarchy=function(v){var b,S,w,E,T=performance.now(),C=[];if(!v)return[];for(var k=ZP(v),j=new Map,N=k.length-1;N>=0;N--){var R=k[N];if(R){var P=NP(R.getAttribute(VC)),L=N===k.length-1?[]:(w=j.get(k[N+1]))!==null&&w!==void 0?w:new Set,H=new Set(Je(Je([],Ae(L),!1),Ae(P),!1));j.set(R,H)}}C=k.map(function(Z){var V;return JP(Z,(V=j.get(Z))!==null&&V!==void 0?V:new Set)});var D=function(Z){Z?.attrs&&Object.entries(Z.attrs).forEach(function(V){var X=Ae(V,2),le=X[0],ye=X[1];Z.attrs&&(Z.attrs[le]=o.replaceSensitiveString(ye))})};try{for(var B=_e(C),K=B.next();!K.done;K=B.next()){var se=K.value;D(se)}}catch(Z){b={error:Z}}finally{try{K&&!K.done&&(S=B.return)&&S.call(B)}finally{if(b)throw b.error}}var ue=performance.now();return(E=o.diagnosticsClient)===null||E===void 0||E.recordHistogram("autocapturePlugin.getHierarchy",ue-T),C},this.getNearestLabel=function(v){var b=v.parentElement;if(!b)return"";var S;try{S=b.querySelector(":scope>span,h1,h2,h3,h4,h5,h6")}catch{S=null}return S?o.getText(S):o.getNearestLabel(b)},this.getEventProperties=function(v,b,S){var w,E,T,C,k=(T=(E=b?.tagName)===null||E===void 0?void 0:E.toLowerCase)===null||T===void 0?void 0:T.call(E),j=typeof b.getBoundingClientRect=="function"?b.getBoundingClientRect():{left:null,top:null},N=o.getHierarchy(b),R=(C=N[0])===null||C===void 0?void 0:C.attrs,P=o.getNearestLabel(b),L=jP(R??{},S),H=(w={},w[hP]=N,w[Zw]=k,w[eE]=o.getText(b),w[mP]=j.left==null?null:Math.round(j.left),w[gP]=j.top==null?null:Math.round(j.top),w[yP]=L,w[bP]=P,w[tE]=ka(window.location.href.split("?")[0]),w[xP]=Xv(o.replaceSensitiveString),w[SP]=window.innerHeight,w[wP]=window.innerWidth,w);if(H[dP]=b.getAttribute("id")||"",H[fP]=b.getAttribute("class"),H[vP]=R?.["aria-label"],k==="a"&&v==="click"&&b instanceof HTMLAnchorElement){var D=b.href.substring(0,FC);H[pP]=o.replaceSensitiveString(D)}return nE(H)},this.addTypeAndTimestamp=function(v,b){return{event:v,timestamp:Date.now(),type:b}},this.addAdditionalEventProperties=function(v,b,S,w,E){E===void 0&&(E=!1);var T=o.addTypeAndTimestamp(v,b);if(_P(T)&&T.event.target!==null){if(E){var C=HC(T.event.target,T.type);if(C)return T.closestTrackedAncestor=T.event.target,T.targetElementProperties=o.getEventProperties(T.type,T.closestTrackedAncestor,w),T}var k=Zv(T.event.target,S);return k&&(T.closestTrackedAncestor=k,T.targetElementProperties=o.getEventProperties(T.type,k,w)),T}return T},this.extractDataFromDataSource=function(v,b){if(v.sourceType==="DOM_ELEMENT"){var S=FP(v,b);return S?v.elementExtractType==="TEXT"?o.getText(S):v.elementExtractType==="ATTRIBUTE"&&v.attribute?S.getAttribute(v.attribute):void 0:void 0}},this.getTextWithMaskedDescendants=function(v){var b,S,w="[".concat(lo,"], [contenteditable]");if(!v.querySelector(w))return v.innerText;var E="",T=Array.from(v.childNodes);try{for(var C=_e(T),k=C.next();!k.done;k=C.next()){var j=k.value;if(j.nodeType===Node.TEXT_NODE){E+=j.textContent||"";continue}if(j instanceof Element){if(j.hasAttribute(lo)||j.hasAttribute("contenteditable")){E+=Ca;continue}E+=o.getTextWithMaskedDescendants(j)}}}catch(N){b={error:N}}finally{try{k&&!k.done&&(S=C.return)&&S.call(C)}finally{if(b)throw b.error}}return E},this.getText=function(v){var b=v.closest("[".concat(lo,"]"))!==null;if(b)return Ca;var S="";return v.querySelector("[".concat(lo,"], [contenteditable]"))?S=o.getTextWithMaskedDescendants(v):S=v.innerText||"",o.replaceSensitiveString(S.substring(0,255)).replace(/\s+/g," ").trim()},this.getEventTagProps=function(v){var b,S,w;if(!v)return{};var E=(w=(S=v?.tagName)===null||S===void 0?void 0:S.toLowerCase)===null||w===void 0?void 0:w.call(S),T=(b={},b[Zw]=E,b[eE]=o.getText(v),b[tE]=window.location.href.split("?")[0],b);return nE(T)},this.diagnosticsClient=n?.diagnosticsClient;var c=(l=t.maskTextRegex)!==null&&l!==void 0?l:[],d=[];try{for(var f=_e(c),m=f.next();!m.done;m=f.next()){var g=m.value;if(d.length>=kP)break;if(g instanceof RegExp)d.push(g);else if("pattern"in g&&typeof g.pattern=="string")try{d.push(new RegExp(g.pattern,"i"))}catch{}}}catch(v){r={error:v}}finally{try{m&&!m.done&&(a=f.return)&&a.call(f)}finally{if(r)throw r.error}}this.additionalMaskTextPatterns=d}return e})(),kr;(function(e){e.ClickObservable="clickObservable",e.ChangeObservable="changeObservable",e.NavigateObservable="navigateObservable",e.MutationObservable="mutationObservable",e.BrowserErrorObservable="browserErrorObservable",e.SelectionObservable="selectionObservable",e.MouseMoveObservable="mouseMoveObservable"})(kr||(kr={}));var eL=function(e,t){var n,r,a,o,l,c,d,f;e===void 0&&(e={}),t?.diagnosticsClient.setTag("plugin.autocapture.version",UC);var m=e.dataAttributePrefix,g=m===void 0?hC:m,v=e.visualTaggingOptions,b=v===void 0?{enabled:!0}:v;e.cssSelectorAllowlist=(n=e.cssSelectorAllowlist)!==null&&n!==void 0?n:RI,e.actionClickAllowlist=(r=e.actionClickAllowlist)!==null&&r!==void 0?r:_I,e.debounceTime=(a=e.debounceTime)!==null&&a!==void 0?a:0,e.pageUrlExcludelist=(o=e.pageUrlExcludelist)===null||o===void 0?void 0:o.reduce(function(D,B){if(typeof B=="string"&&D.push(B),B instanceof RegExp&&D.push(B),typeof B=="object"&&B!==null&&"pattern"in B)try{D.push(new RegExp(B.pattern))}catch(K){return console.warn("Invalid regex pattern: ".concat(B.pattern),K),D}return D},[]);var S=iP,w="enrichment",E=[],T=new $C(e,t),C=function(){var D,B=si(KC().map(function(Z){return T.addAdditionalEventProperties(Z,"click",e.cssSelectorAllowlist,g)})),K=si(new _n(function(Z){var V,X=function(le){var ye=T.addAdditionalEventProperties(le,"change",e.cssSelectorAllowlist,g);Z.next(ye)};return(V=ze())===null||V===void 0||V.document.addEventListener("change",X,{capture:!0}),function(){var le;return(le=ze())===null||le===void 0?void 0:le.document.removeEventListener("change",X)}})),se;window.navigation&&(se=si(new _n(function(Z){var V=function(X){var le=T.addAdditionalEventProperties(X,"navigate",e.cssSelectorAllowlist,g);Z.next(le)};return window.navigation.addEventListener("navigate",V),function(){window.navigation.removeEventListener("navigate",V)}})));var ue=si(GC().map(function(Z){return T.addAdditionalEventProperties(Z,"mutation",e.cssSelectorAllowlist,g)}));return D={},D[kr.ChangeObservable]=K,D[kr.ClickObservable]=B,D[kr.MutationObservable]=ue,D[kr.NavigateObservable]=se,D},k=iE(Object.values((c=(l=e.pageActions)===null||l===void 0?void 0:l.labeledEvents)!==null&&c!==void 0?c:{})),j=aE((f=(d=e.pageActions)===null||d===void 0?void 0:d.triggers)!==null&&f!==void 0?f:[]),N=$P(k,j,T,e),R=function(D){var B,K;D&&(e.pageActions=ce(ce({},e.pageActions),D),k=iE(Object.values((B=e.pageActions.labeledEvents)!==null&&B!==void 0?B:{})),j=aE((K=e.pageActions.triggers)!==null&&K!==void 0?K:[]),N.update(k,j,e))},P=function(D,B){return te(void 0,void 0,void 0,function(){var K,se,ue,Z,V,X,le,ye,M,z;return ee(this,function(W){return typeof document>"u"?[2]:(D.fetchRemoteConfig&&(D.remoteConfigClient?D.remoteConfigClient.subscribe("configs.analyticsSDK.pageActions","all",function(I){R(I)}):D.loggerProvider.debug("Remote config client is not provided, skipping remote config fetch")),K=yo(e,e.cssSelectorAllowlist),se=yo(e,e.actionClickAllowlist),ue=C(),Z=MP({allObservables:ue,amplitude:B,shouldTrackEvent:K,evaluateTriggers:N.evaluate.bind(N)}),E.push(Z),V=DP({allObservables:ue,getEventProperties:function(){for(var I=[],fe=0;fe<arguments.length;fe++)I[fe]=arguments[fe];return T.getEventProperties.apply(T,Je(Je([],Ae(I),!1),[g],!1))},amplitude:B,shouldTrackEvent:K,evaluateTriggers:N.evaluate.bind(N)}),E.push(V),X=IP({allObservables:ue,options:e,getEventProperties:function(){for(var I=[],fe=0;fe<arguments.length;fe++)I[fe]=arguments[fe];return T.getEventProperties.apply(T,Je(Je([],Ae(I),!1),[g],!1))},amplitude:B,shouldTrackEvent:K,shouldTrackActionClick:se}),X&&E.push(X),(z=D?.loggerProvider)===null||z===void 0||z.log("".concat(S," has been successfully added.")),window.opener&&b.enabled&&(le=e.cssSelectorAllowlist,ye=e.actionClickAllowlist,M=TC(),OP(M,{dataExtractor:T,isElementSelectable:yo(e,Je(Je([],Ae(le),!1),Ae(ye),!1)),cssSelectorAllowlist:le,actionClickAllowlist:ye}),kC(M),M.setup(ce({logger:D?.loggerProvider},D?.serverZone&&{endpoint:wC[D.serverZone]}))),[2])})})},L=function(D){return te(void 0,void 0,void 0,function(){return ee(this,function(B){return[2,D]})})},H=function(){return te(void 0,void 0,void 0,function(){var D,B,K,se,ue;return ee(this,function(Z){try{for(D=_e(E),B=D.next();!B.done;B=D.next())K=B.value,K.unsubscribe()}catch(V){se={error:V}}finally{try{B&&!B.done&&(ue=D.return)&&ue.call(D)}finally{if(se)throw se.error}}return[2]})})};return{name:S,type:w,setup:P,execute:L,teardown:H}},tL=3e3,nL=["mutation","navigate"];function rL(e){var t=e.amplitude,n=e.allObservables,r=e.getEventProperties,a=e.shouldTrackDeadClick,o=n.clickObservable,l=n.mutationObservable,c=n.navigateObservable,d=o.filter(function(b){return Mu(b)&&a("click",b.closestTrackedAncestor)&&b.event.target instanceof Element&&b.event.target.closest('a[target="_blank"]')===null&&b.event.button===sf.LEFT_OR_TOUCH_CONTACT}),f=c?ps(l,c):l,m=ps(d,f),g=null,v=Qv(m,function(b){return g&&nL.includes(b.type)?(clearTimeout(g),g=null,Promise.resolve(null)):b.type==="click"?g?Promise.resolve(null):new Promise(function(S){g=setTimeout(function(){S(b),g=null},tL)}):Promise.resolve(null)});return v.subscribe(function(b){if(b){var S={"[Amplitude] X":b.event.clientX,"[Amplitude] Y":b.event.clientY};t.track(sP,ce(ce({},r("click",b.closestTrackedAncestor)),S),{time:b.timestamp})}})}var YC=LI,WC=PI,sE=zI;function oE(e,t){var n,r,a,o,l=t.event,c=l.pageX,d=l.pageY;e.yMin=Math.min((n=e.yMin)!==null&&n!==void 0?n:d,d),e.yMax=Math.max((r=e.yMax)!==null&&r!==void 0?r:d,d),e.xMin=Math.min((a=e.xMin)!==null&&a!==void 0?a:c,c),e.xMax=Math.max((o=e.xMax)!==null&&o!==void 0?o:c,c),e.isOutOfBounds=e.yMax-e.yMin>sE||e.xMax-e.xMin>sE}function lE(e){if(e.length===0)return null;var t=e[0],n=e[e.length-1],r=ce({"[Amplitude] Begin Time":new Date(t.timestamp).toISOString(),"[Amplitude] End Time":new Date(n.timestamp).toISOString(),"[Amplitude] Duration":n.timestamp-t.timestamp,"[Amplitude] Clicks":e.map(function(a){return{X:a.event.pageX,Y:a.event.pageY,Time:a.timestamp}}),"[Amplitude] Click Count":e.length},t.targetElementProperties);return{rageClickEvent:r,time:t.timestamp}}function iL(e,t){var n=Math.max(0,e.length-YC+1),r=e[n];return t.timestamp-r.timestamp>=WC}function aL(e,t){return e.length>0&&e[e.length-1].closestTrackedAncestor!==t.closestTrackedAncestor}function sL(e){var t=this,n=e.amplitude,r=e.allObservables,a=e.shouldTrackRageClick,o=r.clickObservable,l=r.selectionObservable,c=[],d={},f=null;function m(S){c=[],d={},S&&(oE(d,S),c.push(S))}var g=Qv(o.filter(function(S){return a("click",S.closestTrackedAncestor)}),function(S){return te(t,void 0,void 0,function(){var w;return ee(this,function(E){return oE(d,S),w=null,c.length===0||aL(c,S)||iL(c,S)||d.isOutOfBounds?(f&&(w=lE(c)),m(S)):c.push(S),f&&(clearTimeout(f.timerId),f.resolve(w),f=null),c.length>=YC?[2,new Promise(function(T){f={resolve:T,timerId:setTimeout(function(){T(lE(c))},WC)}})]:[2,null]})})}),v=l?.subscribe(function(){m()}),b=g.subscribe(function(S){S!==null&&n.track(oP,S.rageClickEvent,{time:S.time})});return{unsubscribe:function(){b.unsubscribe(),v?.unsubscribe()}}}var oL=2e3;function lL(e){var t=e.amplitude,n=e.allObservables,r=e.shouldTrackErrorClick,a=n.clickObservable,o=n.browserErrorObservable,l=a.filter(function(m){return Mu(m)&&r("click",m.closestTrackedAncestor)&&m.event.target instanceof Element&&m.event.target.closest('a[target="_blank"]')===null&&m.event.button===sf.LEFT_OR_TOUCH_CONTACT}),c=null,d=null,f=function(){c!==null&&(clearTimeout(c),c=null),d=null};return ps(l,o).subscribe(function(m){var g;if(m.type==="click"){f(),d=m,c=setTimeout(f,oL);return}m.type==="error"&&d&&(t.track(lP,ce((g={},g["[Amplitude] Kind"]=m.event.kind,g["[Amplitude] Message"]=m.event.message,g["[Amplitude] Stack"]=m.event.stack,g["[Amplitude] Filename"]=m.event.filename,g["[Amplitude] Line Number"]=m.event.lineNumber,g["[Amplitude] Column Number"]=m.event.columnNumber,g),d.targetElementProperties)),f())})}var ri;(function(e){e.INCREASING="increasing",e.DECREASING="decreasing"})(ri||(ri={}));var ls;(function(e){e.X="x",e.Y="y"})(ls||(ls={}));var uL=function(e){var t=e.allWindowObservables,n=t.mouseMoveObservable;return new _n(function(r){var a=null,o=null,l=null;return n.subscribe(function(c){var d={x:c.clientX,y:c.clientY};if(a===null){a=d;return}d.x>a.x?(o===ri.DECREASING&&r.next(ls.X),o=ri.INCREASING):d.x<a.x&&(o===ri.INCREASING&&r.next(ls.X),o=ri.DECREASING),d.y>a.y?(l===ri.DECREASING&&r.next(ls.Y),l=ri.INCREASING):d.y<a.y&&(l===ri.INCREASING&&r.next(ls.Y),l=ri.DECREASING),a=d})})};function cL(e){var t=+Date.now();e.startTime=e.startTime||t;var n=e.changes,r=e.changesThreshold;n.push(t),n.length>r&&n.shift()}function uE(e){var t=e.changes,n=e.changesThreshold,r=e.thresholdMs;if(t.length<n)return!1;var a=t[t.length-1]-t[0];return a<r}function cE(e){e.changes=[],e.startTime=void 0}function dE(e){for(var t=e.changes,n=e.thresholdMs,r=0,a=t[t.length-1];r<t.length;r++){var o=a-t[r];if(o<n)break}r!==0&&(e.startTime=t[r],e.changes.splice(0,r))}function dL(e,t){var n=void 0;if(uE(e)&&(n=e.startTime),uE(t)){var r=t.startTime;r&&(!n||r<n)&&(n=r)}return n}var XC=10,QC=2e3,fL=function(e){var t=e.mouseDirectionChangeObservable,n=e.directionChanges,r=n===void 0?XC:n,a=e.thresholdMs,o=a===void 0?QC:a;return new _n(function(l){var c={changes:[],changesThreshold:r,thresholdMs:o},d={changes:[],changesThreshold:r,thresholdMs:o},f=void 0,m=null;function g(){f!==void 0&&(l.next(f),f=void 0,m!==null&&clearTimeout(m),cE(c),cE(d))}return t.subscribe(function(v){m!==null&&clearTimeout(m),cL(v===ls.X?c:d);var b=dL(c,d);return b?(f=f||b,m=setTimeout(function(){g(),m=null},o)):g(),dE(c),dE(d),function(){m!==null&&(clearTimeout(m),m=null)}})})},hL=function(e){var t=e.amplitude,n=e.options,r=e.allObservables,a=e.directionChanges,o=a===void 0?XC:a,l=e.thresholdMs,c=l===void 0?QC:l,d=uL({allWindowObservables:r}),f=fL({mouseDirectionChangeObservable:d,directionChanges:o,thresholdMs:c});return f.subscribe(function(m){qC(n)&&t.track(cP,void 0,{time:m})})};function vm(e,t,n,r){if(!r)return[];var a=e[t];return typeof a=="object"&&a!==null&&"cssSelectorAllowlist"in a&&Array.isArray(a.cssSelectorAllowlist)?a.cssSelectorAllowlist:n}var ld=5,ud=4e3,pL=function(e){var t;e===void 0&&(e={});var n=aP,r="enrichment",a=[],o=e.errorClicks!==!1;e.errorClicks||(o=!1);var l=e.deadClicks!==!1&&e.deadClicks!==null,c=e.rageClicks!==!1&&e.rageClicks!==null,d=e.thrashedCursor!==!1&&e.thrashedCursor!==null;e.thrashedCursor||(d=!1);var f=vm(e,"rageClicks",II,c),m=vm(e,"deadClicks",MI,l),g=vm(e,"errorClicks",DI,o),v=(t=e.dataAttributePrefix)!==null&&t!==void 0?t:hC,b=new $C(e),S=Je([],Ae(new Set(Je(Je(Je([],Ae(f),!1),Ae(m),!1),Ae(g),!1))),!1),w=function(){var k,j=si(KC("pointerdown").map(function(B){return b.addAdditionalEventProperties(B,"click",S,v,!0)})),N=si(UP().map(function(B){return b.addTypeAndTimestamp(B,"error")})),R=si(GC().map(function(B){return b.addAdditionalEventProperties(B,"mutation",S,v)})),P;if(window.navigation){var L=new _n(function(B){var K=function(se){B.next(ce(ce({},se),{type:"navigate"}))};return window.navigation.addEventListener("navigate",K),function(){window.navigation.removeEventListener("navigate",K)}});P=si(L.map(function(B){return b.addAdditionalEventProperties(B,"navigate",S,v)}))}var H=si(new _n(function(B){var K=function(){var se=document.activeElement;if(se&&(se.tagName==="TEXTAREA"||se.tagName==="INPUT")){var ue=void 0,Z=void 0;try{if(ue=se.selectionStart,Z=se.selectionEnd,ue===Z)return}catch{return}return B.next()}var V=window.getSelection();if(!(!V||V.isCollapsed))return B.next()};return window.document.addEventListener("selectionchange",K),function(){window.document.removeEventListener("selectionchange",K)}})),D=si(BP());return k={},k[kr.ClickObservable]=j,k[kr.MutationObservable]=R,k[kr.NavigateObservable]=P,k[kr.BrowserErrorObservable]=N,k[kr.SelectionObservable]=H,k[kr.MouseMoveObservable]=D,k},E=function(k,j){return te(void 0,void 0,void 0,function(){var N,R,P,L,H,D,B,K,se,ue,Z;return ee(this,function(V){return typeof document>"u"?[2]:(N=w(),c&&(R=yo(e,f),P=sL({allObservables:N,amplitude:j,shouldTrackRageClick:R}),a.push(P)),l&&(L=yo(e,m),H=rL({amplitude:j,allObservables:N,getEventProperties:function(X,le){return b.getEventProperties(X,le,v)},shouldTrackDeadClick:L}),a.push(H)),o&&(D=yo(e,g),B=lL({amplitude:j,allObservables:N,shouldTrackErrorClick:D}),a.push(B)),d&&(K=void 0,se=void 0,typeof e.thrashedCursor=="object"&&(K=e.thrashedCursor.directionChanges,se=e.thrashedCursor.threshold,K&&K<ld&&(k.loggerProvider.warn("'thrashedCursor.directionChanges' of ".concat(K," is below the minimum of ").concat(ld,", setting to ").concat(ld)),K=ld),se&&se>ud&&(k.loggerProvider.warn("'thrashedCursor.threshold' of ".concat(se," is above the maximum of ").concat(ud,", setting to ").concat(ud)),se=ud)),ue=hL({amplitude:j,options:e,allObservables:N,directionChanges:K,thresholdMs:se}),a.push(ue)),(Z=k?.loggerProvider)===null||Z===void 0||Z.log("".concat(n," has been successfully added.")),[2])})})},T=function(k){return te(void 0,void 0,void 0,function(){return ee(this,function(j){return[2,k]})})},C=function(){return te(void 0,void 0,void 0,function(){var k,j,N,R,P;return ee(this,function(L){try{for(k=_e(a),j=k.next();!j.done;j=k.next())N=j.value,N.unsubscribe()}catch(H){R={error:H}}finally{try{j&&!j.done&&(P=k.return)&&P.call(k)}finally{if(R)throw R.error}}return[2]})})};return{name:n,type:r,setup:E,execute:T,teardown:C}},mL="@amplitude/plugin-network-capture-browser",JC="[Amplitude] Network Request",ZC="500-599";function Id(e,t){var n=t.replace(/[-[\]{}()+?.,\\^$|#\s]/g,"\\$&"),r="^"+n.replace(/\*/g,".*")+"$",a=new RegExp(r);return a.test(e)}function eA(e,t){var n,r,a=t.split(",");try{for(var o=_e(a),l=o.next();!l.done;l=o.next()){var c=l.value,d=Ae(c.split("-").map(Number),2),f=d[0],m=d[1];if(e===f&&m===void 0||e>=f&&e<=m)return!0}}catch(g){n={error:g}}finally{try{l&&!l.done&&(r=o.return)&&r.call(o)}finally{if(n)throw n.error}}return!1}function gL(e,t,n,r,a){if(!(e.hosts&&!e.hosts.find(function(l){return Id(t,l)}))&&!(r&&e.urls&&!yg(r,e.urls))&&!(a&&e.methods&&!e.methods.find(function(l){return a.toLowerCase()===l.toLowerCase()||l==="*"}))){if(n||n===0){var o=e.statusCodeRange||ZC;if(!eA(n,o))return!1}return!0}}function tA(e){var t;if(e)try{var n=(t=ze())===null||t===void 0?void 0:t.location.href,r=new URL(e,n),a=r.searchParams.toString(),o=r.hash.replace("#",""),l=r.href,c=r.host;r.hash="",r.search="";var d=r.href;return{query:a,fragment:o,href:l,hrefWithoutQueryOrHash:d,host:c}}catch{return}}function vL(e,t){if(e.includes("amplitude.com"))try{var n=t.body;if(typeof n!="string")return!1;var r=JSON.parse(n),a=r.events;if(a.find(function(o){return o.event_type===JC}))return!0}catch{}return!1}function fE(e){if(typeof e!="object"||e===null){if(e)return Je([],Ae(Zd),!1);if(e===void 0){var t=void 0;return t}return}if(e.length!==0)return e}function hE(e){var t,n;return!(!((t=e?.allowlist)===null||t===void 0)&&t.length)&&!(!((n=e?.blocklist)===null||n===void 0)&&n.length)}function yL(e,t){var n;t===void 0&&(t={});var r=tA(e.url);if(!r)return!1;var a=r.host;if(t.ignoreAmplitudeRequests!==!1&&(Id(a,"*.amplitude.com")||Id(a,"amplitude.com"))||!((n=t.ignoreHosts)===null||n===void 0)&&n.find(function(l){return Id(a,l)})||!t.captureRules&&e.status!==void 0&&!eA(e.status,ZC))return!1;if(t.captureRules){var o;if(Je([],Ae(t.captureRules),!1).reverse().find(function(l){if(o=gL(l,a,e.status,e.url,e.method),o){var c=fE(l.responseHeaders);if(e.responseWrapper&&c){var d=e.responseWrapper.headers(c);d&&(e.responseHeaders=d)}var f=fE(l.requestHeaders);if(e.requestWrapper&&f){var m=e.requestWrapper.headers(f);m&&(e.requestHeaders=m)}e.responseWrapper&&l.responseBody&&!hE(l.responseBody)&&(e.responseBodyJson=e.responseWrapper.json(l.responseBody.allowlist,l.responseBody.blocklist)),e.requestWrapper&&l.requestBody&&!hE(l.requestBody)&&(e.requestBodyJson=e.requestWrapper.json(l.requestBody.allowlist,l.requestBody.blocklist))}return o!==void 0}),!o)return!1}return!(e.requestWrapper&&vL(a,e.requestWrapper))}function bL(e,t,n,r){return te(this,void 0,void 0,function(){var a,o,l;return ee(this,function(c){switch(c.label){case 0:return t.requestBodyJson||t.responseBodyJson?[4,Promise.all([t.requestBodyJson,t.responseBodyJson])]:[3,2];case 1:if(a=Ae.apply(void 0,[c.sent(),2]),o=a[0],l=a[1],o)try{e["[Amplitude] Request Body"]=JSON.stringify(o)}catch(d){r?.debug("Failed to stringify request body",d)}if(l)try{e["[Amplitude] Response Body"]=JSON.stringify(l)}catch{r?.debug("Failed to stringify response body")}c.label=2;case 2:return n?.track(JC,e),[2]}})})}function xL(e){var t=e.allObservables,n=e.networkTrackingOptions,r=e.amplitude,a=e.loggerProvider,o=t.networkObservable,l=o.filter(function(c){return yL(c.event,n)});return l.subscribe(function(c){var d,f,m,g=c.event,v=tA(g.url);if(v){var b=(f=g.responseWrapper)===null||f===void 0?void 0:f.bodySize,S=(m=g.requestWrapper)===null||m===void 0?void 0:m.bodySize,w=(d={},d["[Amplitude] URL"]=v.hrefWithoutQueryOrHash,d["[Amplitude] URL Query"]=v.query,d["[Amplitude] URL Fragment"]=v.fragment,d["[Amplitude] Request Method"]=g.method,d["[Amplitude] Status Code"]=g.status,d["[Amplitude] Start Time"]=g.startTime,d["[Amplitude] Completion Time"]=g.endTime,d["[Amplitude] Duration"]=g.duration,d["[Amplitude] Request Body Size"]=S,d["[Amplitude] Response Body Size"]=b,d["[Amplitude] Request Type"]=g.type,d["[Amplitude] Request Headers"]=g.requestHeaders,d["[Amplitude] Response Headers"]=g.responseHeaders,d);bL(w,g,r,a)}})}var Eg;(function(e){e.NetworkObservable="networkObservable"})(Eg||(Eg={}));var pE,SL=function(e){e===void 0&&(e={});var t=mL,n="enrichment",r,a=function(f,m){var g={event:f,timestamp:Date.now(),type:m};return g},o=function(){var f,m=new _n(function(g){var v=new $I(function(b){var S=a(b,"network");g.next(S)});return Pw.subscribe(v,r),function(){Pw.unsubscribe(v)}});return f={},f[Eg.NetworkObservable]=m,f},l=function(f,m){return te(void 0,void 0,void 0,function(){var g;return ee(this,function(v){return typeof document>"u"?[2]:(g=o(),r=f?.loggerProvider,pE=xL({allObservables:g,networkTrackingOptions:e,amplitude:m,loggerProvider:r}),r?.log("".concat(t," has been successfully added.")),[2])})})},c=function(f){return te(void 0,void 0,void 0,function(){return ee(this,function(m){return[2,f]})})},d=function(){return te(void 0,void 0,void 0,function(){return ee(this,function(f){return pE.unsubscribe(),[2]})})};return{name:t,type:n,setup:l,execute:c,teardown:d}},wL="web-vitals-browser",EL="[Amplitude] Web Vitals";let nA=-1;const Do=e=>{addEventListener("pageshow",(t=>{t.persisted&&(nA=t.timeStamp,e(t))}),!0)},ui=(e,t,n,r)=>{let a,o;return l=>{t.value>=0&&(l||r)&&(o=t.value-(a??0),(o||a===void 0)&&(a=t.value,t.delta=o,t.rating=((c,d)=>c>d[1]?"poor":c>d[0]?"needs-improvement":"good")(t.value,n),e(t)))}},ey=e=>{requestAnimationFrame((()=>requestAnimationFrame((()=>e()))))},ty=()=>{const e=performance.getEntriesByType("navigation")[0];if(e&&e.responseStart>0&&e.responseStart<performance.now())return e},Du=()=>ty()?.activationStart??0,ci=(e,t=-1)=>{const n=ty();let r="navigate";return nA>=0?r="back-forward-cache":n&&(document.prerendering||Du()>0?r="prerender":document.wasDiscarded?r="restore":n.type&&(r=n.type.replace(/_/g,"-"))),{name:e,value:t,rating:"good",delta:0,entries:[],id:`v5-${Date.now()}-${Math.floor(8999999999999*Math.random())+1e12}`,navigationType:r}},ym=new WeakMap;function ny(e,t){return ym.get(e)||ym.set(e,new t),ym.get(e)}class TL{t;i=0;o=[];h(t){if(t.hadRecentInput)return;const n=this.o[0],r=this.o.at(-1);this.i&&n&&r&&t.startTime-r.startTime<1e3&&t.startTime-n.startTime<5e3?(this.i+=t.value,this.o.push(t)):(this.i=t.value,this.o=[t]),this.t?.(t)}}const Iu=(e,t,n={})=>{try{if(PerformanceObserver.supportedEntryTypes.includes(e)){const r=new PerformanceObserver((a=>{Promise.resolve().then((()=>{t(a.getEntries())}))}));return r.observe({type:e,buffered:!0,...n}),r}}catch{}},ry=e=>{let t=!1;return()=>{t||(e(),t=!0)}};let uo=-1;const rA=new Set,mE=()=>document.visibilityState!=="hidden"||document.prerendering?1/0:0,Tg=e=>{if(document.visibilityState==="hidden"){if(e.type==="visibilitychange")for(const t of rA)t();isFinite(uo)||(uo=e.type==="visibilitychange"?e.timeStamp:0,removeEventListener("prerenderingchange",Tg,!0))}},Nf=()=>{if(uo<0){const e=Du();uo=(document.prerendering?void 0:globalThis.performance.getEntriesByType("visibility-state").filter((n=>n.name==="hidden"&&n.startTime>e))[0]?.startTime)??mE(),addEventListener("visibilitychange",Tg,!0),addEventListener("prerenderingchange",Tg,!0),Do((()=>{setTimeout((()=>{uo=mE()}))}))}return{get firstHiddenTime(){return uo},onHidden(e){rA.add(e)}}},jf=e=>{document.prerendering?addEventListener("prerenderingchange",(()=>e()),!0):e()},gE=[1800,3e3],iA=(e,t={})=>{jf((()=>{const n=Nf();let r,a=ci("FCP");const o=Iu("paint",(l=>{for(const c of l)c.name==="first-contentful-paint"&&(o.disconnect(),c.startTime<n.firstHiddenTime&&(a.value=Math.max(c.startTime-Du(),0),a.entries.push(c),r(!0)))}));o&&(r=ui(e,a,gE,t.reportAllChanges),Do((l=>{a=ci("FCP"),r=ui(e,a,gE,t.reportAllChanges),ey((()=>{a.value=performance.now()-l.timeStamp,r(!0)}))})))}))},vE=[.1,.25],kL=(e,t={})=>{const n=Nf();iA(ry((()=>{let r,a=ci("CLS",0);const o=ny(t,TL),l=d=>{for(const f of d)o.h(f);o.i>a.value&&(a.value=o.i,a.entries=o.o,r())},c=Iu("layout-shift",l);c&&(r=ui(e,a,vE,t.reportAllChanges),n.onHidden((()=>{l(c.takeRecords()),r(!0)})),Do((()=>{o.i=0,a=ci("CLS",0),r=ui(e,a,vE,t.reportAllChanges),ey((()=>r()))})),setTimeout(r))})))};let aA=0,bm=1/0,cd=0;const CL=e=>{for(const t of e)t.interactionId&&(bm=Math.min(bm,t.interactionId),cd=Math.max(cd,t.interactionId),aA=cd?(cd-bm)/7+1:0)};let kg;const yE=()=>kg?aA:performance.interactionCount??0,AL=()=>{"interactionCount"in performance||kg||(kg=Iu("event",CL,{type:"event",buffered:!0,durationThreshold:0}))};let bE=0,NL=class{u=[];l=new Map;m;p;v(){bE=yE(),this.u.length=0,this.l.clear()}L(){const t=Math.min(this.u.length-1,Math.floor((yE()-bE)/50));return this.u[t]}h(t){if(this.m?.(t),!t.interactionId&&t.entryType!=="first-input")return;const n=this.u.at(-1);let r=this.l.get(t.interactionId);if(r||this.u.length<10||t.duration>n.P){if(r?t.duration>r.P?(r.entries=[t],r.P=t.duration):t.duration===r.P&&t.startTime===r.entries[0].startTime&&r.entries.push(t):(r={id:t.interactionId,entries:[t],P:t.duration},this.l.set(r.id,r),this.u.push(r)),this.u.sort(((a,o)=>o.P-a.P)),this.u.length>10){const a=this.u.splice(10);for(const o of a)this.l.delete(o.id)}this.p?.(r)}}};const sA=e=>{const t=globalThis.requestIdleCallback||setTimeout;document.visibilityState==="hidden"?e():(e=ry(e),addEventListener("visibilitychange",e,{once:!0,capture:!0}),t((()=>{e(),removeEventListener("visibilitychange",e,{capture:!0})})))},xE=[200,500],jL=(e,t={})=>{if(!globalThis.PerformanceEventTiming||!("interactionId"in PerformanceEventTiming.prototype))return;const n=Nf();jf((()=>{AL();let r,a=ci("INP");const o=ny(t,NL),l=d=>{sA((()=>{for(const m of d)o.h(m);const f=o.L();f&&f.P!==a.value&&(a.value=f.P,a.entries=f.entries,r())}))},c=Iu("event",l,{durationThreshold:t.durationThreshold??40});r=ui(e,a,xE,t.reportAllChanges),c&&(c.observe({type:"first-input",buffered:!0}),n.onHidden((()=>{l(c.takeRecords()),r(!0)})),Do((()=>{o.v(),a=ci("INP"),r=ui(e,a,xE,t.reportAllChanges)})))}))};let RL=class{m;h(t){this.m?.(t)}};const SE=[2500,4e3],_L=(e,t={})=>{jf((()=>{const n=Nf();let r,a=ci("LCP");const o=ny(t,RL),l=d=>{t.reportAllChanges||(d=d.slice(-1));for(const f of d)o.h(f),f.startTime<n.firstHiddenTime&&(a.value=Math.max(f.startTime-Du(),0),a.entries=[f],r())},c=Iu("largest-contentful-paint",l);if(c){r=ui(e,a,SE,t.reportAllChanges);const d=ry((()=>{l(c.takeRecords()),c.disconnect(),r(!0)})),f=m=>{m.isTrusted&&(sA(d),removeEventListener(m.type,f,{capture:!0}))};for(const m of["keydown","click","visibilitychange"])addEventListener(m,f,{capture:!0});Do((m=>{a=ci("LCP"),r=ui(e,a,SE,t.reportAllChanges),ey((()=>{a.value=performance.now()-m.timeStamp,r(!0)}))}))}}))},wE=[800,1800],Cg=e=>{document.prerendering?jf((()=>Cg(e))):document.readyState!=="complete"?addEventListener("load",(()=>Cg(e)),!0):setTimeout(e)},OL=(e,t={})=>{let n=ci("TTFB"),r=ui(e,n,wE,t.reportAllChanges);Cg((()=>{const a=ty();a&&(n.value=Math.max(a.responseStart-Du(),0),n.entries=[a],r(!0),Do((()=>{n=ci("TTFB",0),r=ui(e,n,wE,t.reportAllChanges),r(!0)})))}))};function ML(e){var t,n=((t=e.entries[0])===null||t===void 0?void 0:t.startTime)||0;return performance.timeOrigin+n}function Ul(e){return{value:e.value,rating:e.rating,delta:e.delta,navigationType:e.navigationType,id:e.id,timestamp:Math.floor(ML(e)),navigationStart:Math.floor(performance.timeOrigin)}}var DL=function(){var e=null,t=ze(),n=t?.document,r=t?.location,a=function(c,d){return te(void 0,void 0,void 0,function(){var f,m;return ee(this,function(g){return n===void 0?[2]:(f=ka(r?.href||"",c.loggerProvider),m={"[Amplitude] Page Domain":r?.hostname||"","[Amplitude] Page Location":f,"[Amplitude] Page Path":ka(r?.pathname||"",c.loggerProvider),"[Amplitude] Page Title":typeof document<"u"&&document.title||"","[Amplitude] Page URL":ka(f.split("?")[0],c.loggerProvider)},_L(function(v){m["[Amplitude] LCP"]=Ul(v)}),iA(function(v){m["[Amplitude] FCP"]=Ul(v)}),jL(function(v){m["[Amplitude] INP"]=Ul(v)}),kL(function(v){m["[Amplitude] CLS"]=Ul(v)}),OL(function(v){m["[Amplitude] TTFB"]=Ul(v)}),e=function(){n.visibilityState==="hidden"&&e&&(d.track(EL,m),n.removeEventListener("visibilitychange",e),e=null)},n.addEventListener("visibilitychange",e),[2])})})},o=function(c){return te(void 0,void 0,void 0,function(){return ee(this,function(d){return[2,c]})})},l=function(){return te(void 0,void 0,void 0,function(){return ee(this,function(c){return e&&n?.removeEventListener("visibilitychange",e),[2]})})};return{name:wL,type:"enrichment",setup:a,execute:o,teardown:l}},EE=(function(){function e(t,n){var r;this.shouldTrackNewCampaign=!1,this.options=ce({initialEmptyValue:"EMPTY",resetSessionOnNewCampaign:!1,excludeReferrers:B3(((r=n.cookieOptions)===null||r===void 0?void 0:r.domain)||n.topLevelDomain),optOut:n.optOut},t),this.storage=n.cookieStorage,this.storageKey=Nw(n.apiKey,"MKTG"),this.webExpStorageKey=Nw(n.apiKey,"MKTG_ORIGINAL"),this.currentCampaign=Cf,this.sessionTimeout=n.sessionTimeout,this.lastEventTime=n.lastEventTime,this.logger=n.loggerProvider,this.topLevelDomain=n.topLevelDomain,n.loggerProvider.log("Installing web attribution tracking.")}return e.prototype.init=function(){return te(this,void 0,void 0,function(){var t,n;return ee(this,function(r){switch(r.label){case 0:return this.options.optOut?[2]:[4,this.fetchCampaign()];case 1:return n=Ae.apply(void 0,[r.sent(),2]),this.currentCampaign=n[0],this.previousCampaign=n[1],t=this.lastEventTime?aC(this.sessionTimeout,this.lastEventTime):!0,P3(this.currentCampaign,this.previousCampaign,this.options,this.logger,t,this.topLevelDomain)?(this.shouldTrackNewCampaign=!0,[4,this.storage.set(this.storageKey,this.currentCampaign)]):[3,3];case 2:r.sent(),r.label=3;case 3:return[2]}})})},e.prototype.fetchCampaign=function(){return te(this,void 0,void 0,function(){var t;return ee(this,function(n){switch(n.label){case 0:return[4,this.storage.get(this.webExpStorageKey)];case 1:return t=n.sent(),t?[4,this.storage.remove(this.webExpStorageKey)]:[3,3];case 2:n.sent(),n.label=3;case 3:return[4,Promise.all([t||new bC().parse(),this.storage.get(this.storageKey)])];case 4:return[2,n.sent()]}})})},e.prototype.generateCampaignEvent=function(t){this.shouldTrackNewCampaign=!1;var n=U3(this.currentCampaign,this.options);return t&&(n.event_id=t),n},e.prototype.shouldSetSessionIdOnNewCampaign=function(){return this.shouldTrackNewCampaign&&!!this.options.resetSessionOnNewCampaign},e})(),dd="AMP_CURRENT_PAGE",fd="AMP_PREVIOUS_PAGE",to="AMP_URL_INFO",au;(function(e){e.Direct="direct",e.Internal="internal",e.External="external"})(au||(au={}));var IL=new Set([sr.IDENTIFY,sr.GROUP_IDENTIFY,sr.REVENUE]),PL=function(e){var t={},n=t.internalDomains,r=n===void 0?[]:n,a=ze(),o=void 0,l=!1,c=void 0,d=!1,f=!1,m=function(w){var E;try{var T=ka(w,c);E=new URL(T).hostname}catch(C){c?.error("Could not parse URL: ",C)}return E},g=function(w){var E=typeof location<"u"&&location.hostname||"",T=w?m(w):void 0;if(!T)return au.Direct;var C=r.some(function(j){return E.indexOf(j)!==-1}),k=r.some(function(j){return T.indexOf(j)!==-1});return E===T||k&&C?au.Internal:au.External},v=function(){return te(void 0,void 0,void 0,function(){var w,E,T,C,k;return ee(this,function(j){switch(j.label){case 0:return o&&l?[4,o.get(to)]:[3,3];case 1:return w=j.sent(),E=ka(typeof location<"u"&&location.href||""),T=w?.[dd]||"",C=void 0,E===T?C=w?.[fd]||"":T?C=T:C=document.referrer||"",[4,o.set(to,(k={},k[dd]=E,k[fd]=C,k))];case 2:j.sent(),j.label=3;case 3:return[2]}})})},b=function(){v()},S={name:"@amplitude/plugin-page-url-enrichment-browser",type:"enrichment",setup:function(w,E){return te(void 0,void 0,void 0,function(){return ee(this,function(T){switch(T.label){case 0:return c=w.loggerProvider,c.log("Installing @amplitude/plugin-page-url-enrichment-browser"),f=!0,a?(o=new $v(a.sessionStorage),[4,o.isEnabled()]):[3,2];case 1:l=T.sent(),a.addEventListener("popstate",b),d||(a.history.pushState=new Proxy(a.history.pushState,{apply:function(C,k,j){var N=Ae(j,3),R=N[0],P=N[1],L=N[2];C.apply(k,[R,P,L]),f&&b()}}),a.history.replaceState=new Proxy(a.history.replaceState,{apply:function(C,k,j){var N=Ae(j,3),R=N[0],P=N[1],L=N[2];C.apply(k,[R,P,L]),f&&b()}}),d=!0),T.label=2;case 2:return[2]}})})},execute:function(w){return te(void 0,void 0,void 0,function(){var E,T,C,k,j;return ee(this,function(N){switch(N.label){case 0:return E=ka(typeof location<"u"&&location.href||""),o&&l?[4,o.get(to)]:[3,5];case 1:return T=N.sent(),T?.[dd]?[3,3]:[4,o.set(to,(j={},j[dd]=E,j[fd]=document.referrer||"",j))];case 2:N.sent(),N.label=3;case 3:return[4,o.get(to)];case 4:if(C=N.sent(),k="",C&&(k=C[fd]||""),IL.has(w.event_type))return[2,w];w.event_properties=ce(ce({},w.event_properties||{}),{"[Amplitude] Page Domain":Bl(w,"[Amplitude] Page Domain",typeof location<"u"&&location.hostname||""),"[Amplitude] Page Location":Bl(w,"[Amplitude] Page Location",E),"[Amplitude] Page Path":Bl(w,"[Amplitude] Page Path",typeof location<"u"&&ka(location.pathname)||""),"[Amplitude] Page Title":Bl(w,"[Amplitude] Page Title",Xv(Wv)),"[Amplitude] Page URL":Bl(w,"[Amplitude] Page URL",E.split("?")[0]),"[Amplitude] Previous Page Location":k,"[Amplitude] Previous Page Type":g(k)}),N.label=5;case 5:return[2,w]}})})},teardown:function(){return te(void 0,void 0,void 0,function(){return ee(this,function(w){switch(w.label){case 0:return a&&(a.removeEventListener("popstate",b),f=!1),o&&l?[4,o.set(to,{})]:[3,2];case 1:w.sent(),w.label=2;case 2:return[2]}})})}};return S};function Bl(e,t,n){return e.event_properties||(e.event_properties={}),e.event_properties[t]===void 0?n:e.event_properties[t]}var xm=-1,LL=(function(e){Or(t,e);function t(){var n=e!==null&&e.apply(this,arguments)||this;return n._diagnosticsSampleRate=0,n._enableRequestBodyCompressionExperimentalValue=!1,n}return t.prototype.init=function(n,r,a){n===void 0&&(n="");var o,l;return arguments.length>2?(o=r,l=a):typeof r=="string"?(o=r,l=void 0):(o=r?.userId,l=r),Sn(this._init(ce(ce({},l),{userId:o,apiKey:n})))},t.prototype._init=function(n){var r,a,o,l,c,d,f;return te(this,void 0,void 0,function(){var m,g,v,b,S,w,E,T,C,k,j,N,R,P,L,H=this;return ee(this,function(D){switch(D.label){case 0:return this.initializing?[2]:(this.initializing=!0,m=K3(n),g=(r=n.loggerProvider)!==null&&r!==void 0?r:new ko,v=(a=n.serverZone)!==null&&a!==void 0?a:DC,S=this._diagnosticsSampleRate,w=(o=n.enableDiagnostics)!==null&&o!==void 0?o:!0,m?(b=new fC(n.apiKey,g,v,(l=n.remoteConfig)===null||l===void 0?void 0:l.serverUrl),[4,new Promise(function(B){b?.subscribe("configs.diagnostics.browserSDK","all",function(K,se,ue){if(g.debug("Diagnostics remote configuration received:",JSON.stringify({remoteConfig:K,source:se,lastFetch:ue},null,2)),K){var Z=K.sampleRate;typeof Z=="number"&&!isNaN(Z)&&(S=Z);var V=K.enabled;typeof V=="boolean"&&(w=V)}B()})})]):[3,2]);case 1:D.sent(),D.label=2;case 2:return E=new vI(n.apiKey,g,v,{enabled:w,sampleRate:S}),E.setTag("library","".concat(OC,"/").concat(Jv)),typeof navigator<"u"&&E.setTag("user_agent",navigator.userAgent),[4,q3(n.apiKey,n,this,E,{loggerProvider:g,serverZone:v,enableDiagnostics:w,diagnosticsSampleRate:S})];case 3:return T=D.sent(),m&&b?[4,new Promise(function(B){b?.subscribe("configs.analyticsSDK.browserSDK","all",function(K,se,ue){T.loggerProvider.debug("Remote configuration received:",JSON.stringify({remoteConfig:K,source:se,lastFetch:ue},null,2)),K&&rP(K,T),B()})})]:[3,5];case 4:D.sent(),D.label=5;case 5:return[4,e.prototype._init.call(this,T)];case 6:return D.sent(),this.logBrowserOptions(T),this.config.remoteConfigClient=b,CC(this.config.defaultTracking)?(this.config.optOut&&this.timeline.addOptOutListener(function(B){return te(H,void 0,void 0,function(){var K;return ee(this,function(se){switch(se.label){case 0:return B?[3,2]:(K=Hw(this.config),this.webAttribution=new EE(K,this.config),[4,this.webAttribution.init()]);case 1:se.sent(),se.label=2;case 2:return[2]}})})}),C=Hw(this.config),this.webAttribution=new EE(C,this.config),[4,this.webAttribution.init()]):[3,8];case 7:D.sent(),D.label=8;case 8:return k=ef(),j=k.ampTimestamp?Number(k.ampTimestamp):void 0,N=j?Date.now()<j:!0,R=N&&!Number.isNaN(Number(k.ampSessionId))?Number(k.ampSessionId):void 0,P=this.config.deferredSessionId,P===xm&&!this.config.optOut&&(P=Date.now()),this.setSessionId((f=(d=(c=n.sessionId)!==null&&c!==void 0?c:R)!==null&&d!==void 0?d:P)!==null&&f!==void 0?f:this.config.sessionId),this.config.optOut&&this.timeline.addOptOutListener(function(B){return te(H,void 0,void 0,function(){return ee(this,function(K){return!B&&this.config.deferredSessionId&&(this.config.deferredSessionId===xm?this.setSessionId(void 0):this.setSessionId(this.config.deferredSessionId)),[2]})})}),L=Co(n.instanceName),L.identityStore.setIdentity({userId:this.config.userId,deviceId:this.config.deviceId}),this.config.offline===jI?[3,10]:[4,this.add(nP()).promise];case 9:D.sent(),D.label=10;case 10:return[4,this.add(new FD({diagnosticsClient:E})).promise];case 11:return D.sent(),[4,this.add(new x3).promise];case 12:return D.sent(),[4,this.add(new JD).promise];case 13:return D.sent(),tP(this.config),d3(this.config.defaultTracking)?(this.config.loggerProvider.debug("Adding file download tracking plugin"),[4,this.add(eP()).promise]):[3,15];case 14:D.sent(),D.label=15;case 15:return AC(this.config.defaultTracking)?(this.config.loggerProvider.debug("Adding form interaction plugin"),[4,this.add(Z3()).promise]):[3,17];case 16:D.sent(),D.label=17;case 17:return NC(this.config.defaultTracking)?this.config.optOut?[3,19]:(this.config.loggerProvider.debug("Adding page view tracking plugin"),[4,this.add(Ww(Fw(this.config))).promise]):[3,20];case 18:return D.sent(),[3,20];case 19:this.timeline.addOptOutListener(function(B){return te(H,void 0,void 0,function(){return ee(this,function(K){switch(K.label){case 0:return B?[2]:(this.config.loggerProvider.debug("Adding page view tracking plugin"),[4,this.add(Ww(Fw(this.config))).promise]);case 1:return K.sent(),[2]}})})}),D.label=20;case 20:return RC(this.config.autocapture)?(this.config.loggerProvider.debug("Adding user interactions plugin (autocapture plugin)"),[4,this.add(eL(p3(this.config),{diagnosticsClient:E})).promise]):[3,22];case 21:D.sent(),D.label=22;case 22:return _C(this.config.autocapture)?(this.config.loggerProvider.debug("Adding frustration interactions plugin"),[4,this.add(pL(m3(this.config))).promise]):[3,24];case 23:D.sent(),D.label=24;case 24:return jC(this.config.autocapture)?(this.config.loggerProvider.debug("Adding network tracking plugin"),[4,this.add(SL(g3(this.config))).promise]):[3,26];case 25:D.sent(),D.label=26;case 26:return h3(this.config.autocapture)?(this.config.loggerProvider.debug("Adding web vitals plugin"),[4,this.add(DL()).promise]):[3,28];case 27:D.sent(),D.label=28;case 28:return f3(this.config.autocapture)?(this.config.loggerProvider.debug("Adding referrer page url plugin"),[4,this.add(PL()).promise]):[3,30];case 29:D.sent(),D.label=30;case 30:return this.initializing=!1,[4,this.runQueuedFunctions("dispatchQ")];case 31:return D.sent(),L.eventBridge.setEventReceiver(function(B){var K=B.eventProperties||{},se=K.time,ue=Jd(K,["time"]),Z=typeof se=="number"?{time:se}:void 0;H.track(B.eventType,ue,Z)}),[2]}})})},t.prototype.getUserId=function(){var n;return(n=this.config)===null||n===void 0?void 0:n.userId},t.prototype.setUserId=function(n){if(!this.config){this.q.push(this.setUserId.bind(this,n));return}this.config.loggerProvider.debug("function setUserId: ",n),(n!==this.config.userId||n===void 0)&&(this.config.userId=n,this.timeline.onIdentityChanged({userId:n}),XD(n,this.config.instanceName))},t.prototype.getDeviceId=function(){var n;return(n=this.config)===null||n===void 0?void 0:n.deviceId},t.prototype.setDeviceId=function(n){if(!this.config){this.q.push(this.setDeviceId.bind(this,n));return}this.config.loggerProvider.debug("function setDeviceId: ",n),n!==this.config.deviceId&&(this.config.deviceId=n,this.timeline.onIdentityChanged({deviceId:n}),QD(n,this.config.instanceName))},t.prototype.reset=function(){this.setDeviceId(_a()),this.setUserId(void 0),this.timeline.onReset()},t.prototype.getIdentity=function(){var n,r;return{deviceId:(n=this.config)===null||n===void 0?void 0:n.deviceId,userId:(r=this.config)===null||r===void 0?void 0:r.userId,userProperties:this.userProperties}},t.prototype.setIdentity=function(n){var r,a,o;if("userId"in n&&this.setUserId(n.userId),"deviceId"in n&&n.deviceId&&this.setDeviceId(n.deviceId),"userProperties"in n){this.userProperties=n.userProperties;var l=new nu,c=(o=n.userProperties)!==null&&o!==void 0?o:{};try{for(var d=_e(Object.entries(c)),f=d.next();!f.done;f=d.next()){var m=Ae(f.value,2),g=m[0],v=m[1];l.set(g,v)}}catch(b){r={error:b}}finally{try{f&&!f.done&&(a=d.return)&&a.call(d)}finally{if(r)throw r.error}}this.identify(l)}},t.prototype.getOptOut=function(){var n;return(n=this.config)===null||n===void 0?void 0:n.optOut},t.prototype.getSessionId=function(){var n;return(n=this.config)===null||n===void 0?void 0:n.sessionId},t.prototype.setSessionId=function(n){var r,a=[];if(!this.config)return this.q.push(this.setSessionId.bind(this,n)),Sn(Promise.resolve());if(this.config.optOut)return this.config.deferredSessionId=n??xm,Sn(Promise.resolve());if(n===void 0&&(n=Date.now()),n===this.config.sessionId)return Sn(Promise.resolve());this.config.loggerProvider.debug("function setSessionId: ",n);var o=this.getSessionId();o!==n&&this.timeline.onSessionIdChanged(n);var l=this.config.lastEventTime,c=(r=this.config.lastEventId)!==null&&r!==void 0?r:-1;this.config.sessionId=n,this.config.lastEventTime=void 0,this.config.pageCounter=0,Vw(this.config.defaultTracking)&&(o&&l&&a.push(this.track(Kw,void 0,{device_id:this.previousSessionDeviceId,event_id:++c,session_id:o,time:l+1,user_id:this.previousSessionUserId}).promise),this.config.lastEventTime=this.config.sessionId);var d=this.trackCampaignEventIfNeeded(++c,a);return this.config.identify&&a.push(this.track(qv(this.config.identify)).promise),Vw(this.config.defaultTracking)&&a.push(this.track(Gw,void 0,{event_id:d?++c:c,session_id:this.config.sessionId,time:this.config.lastEventTime}).promise),this.previousSessionDeviceId=this.config.deviceId,this.previousSessionUserId=this.config.userId,Sn(Promise.all(a))},t.prototype.extendSession=function(){if(!this.config){this.q.push(this.extendSession.bind(this));return}this.config.lastEventTime=Date.now()},t.prototype.setTransport=function(n){if(!this.config){this.q.push(this.setTransport.bind(this,n));return}this.config.transportProvider=LC(n)},t.prototype.identify=function(n,r){if(fm(n)){var a=n._q;n._q=[],n=dm(new nu,a)}return r?.user_id&&this.setUserId(r.user_id),r?.device_id&&this.setDeviceId(r.device_id),e.prototype.identify.call(this,n,r)},t.prototype.groupIdentify=function(n,r,a,o){if(fm(a)){var l=a._q;a._q=[],a=dm(new nu,l)}return e.prototype.groupIdentify.call(this,n,r,a,o)},t.prototype.revenue=function(n,r){if(fm(n)){var a=n._q;n._q=[],n=dm(new DD,a)}return e.prototype.revenue.call(this,n,r)},t.prototype.trackCampaignEventIfNeeded=function(n,r){if(!this.webAttribution||!this.webAttribution.shouldTrackNewCampaign)return!1;var a=this.webAttribution.generateCampaignEvent(n);return r?r.push(this.track(a).promise):this.track(a),this.config.loggerProvider.log("Tracking attribution."),!0},t.prototype.process=function(n){return te(this,void 0,void 0,function(){var r,a,o;return ee(this,function(l){return r=Date.now(),a=aC(this.config.sessionTimeout,this.config.lastEventTime),o=this.webAttribution&&this.webAttribution.shouldSetSessionIdOnNewCampaign(),n.event_type!==Gw&&n.event_type!==Kw&&(!n.session_id||n.session_id===this.getSessionId())&&(a||o?(this.setSessionId(r),o&&this.config.loggerProvider.log("Created a new session for new campaign.")):a||this.trackCampaignEventIfNeeded()),[2,e.prototype.process.call(this,n)]})})},t.prototype.logBrowserOptions=function(n){try{var r=ce(ce({},n),{apiKey:n.apiKey.substring(0,10)+"********"});this.config.loggerProvider.debug("Initialized Amplitude with BrowserConfig:",r3(r))}catch(a){this.config.loggerProvider.error("Error logging browser config",a)}},t.prototype._setDiagnosticsSampleRate=function(n){if(!(n>1||n<0)&&!this.config){this._diagnosticsSampleRate=n;return}},t.prototype._enableRequestBodyCompressionExperimental=function(n){if(!this.config){this._enableRequestBodyCompressionExperimentalValue=n;return}},t})(MD),oA="[Amplitude]",zL="".concat(oA," Session Replay ID"),UL=0,BL=xu.US,VL={enabled:!0},iy=1e3,FL="".concat(oA," Session Replay Debug"),HL="amp-block",lA="amp-mask",qL="amp-unmask",GL="https://api-sr.amplitude.com/sessions/v2/track",KL="https://api-sr.eu.amplitude.com/sessions/v2/track",$L="https://api-sr.stag2.amplitude.com/sessions/v2/track",YL=1*1e6,WL=3e4,XL=6e4,QL=500,JL=10*1e3,uA=1024,ZL=1e3,ya;(function(e){e.GET_SR_PROPS="get-sr-props",e.DEBUG_INFO="debug-info",e.FETCH_REQUEST="fetch-request",e.METADATA="metadata",e.TARGETING_DECISION="targeting-decision"})(ya||(ya={}));var Ag=(function(){function e(t){this.logger=t,this.log=this.getSafeMethod("log"),this.warn=this.getSafeMethod("warn"),this.error=this.getSafeMethod("error"),this.debug=this.getSafeMethod("debug")}return e.prototype.getSafeMethod=function(t){var n;if(!this.logger)return(function(){});var r=this.logger[t];if(typeof r=="function"){var a=(n=r.__rrweb_original__)!==null&&n!==void 0?n:r;return a.bind(this.logger)}return(function(){})},e.prototype.enable=function(t){this.logger.enable(t)},e.prototype.disable=function(){this.logger.disable()},e})(),Ng="medium";function e4(e){return e.toLowerCase()}function t4(e){var t=e.type;return e.hasAttribute("data-rr-is-password")?"password":t?e4(t):null}var cA=function(e,t,n){switch(t){case"light":{if(e!=="input")return!0;var r=n?t4(n):"";return r?!!(["password","hidden","email","tel"].includes(r)||n.autocomplete.startsWith("cc-")):!1}case"medium":case"conservative":return!0;default:return cA(e,Ng,n)}},n4=function(e,t,n){var r,a,o;if(t===void 0&&(t={defaultMaskLevel:Ng}),n){if(n.closest("."+lA))return!0;var l=((r=t.maskSelector)!==null&&r!==void 0?r:[]).some(function(d){return n.closest(d)});if(l)return!0;if(n.closest("."+qL))return!1;var c=((a=t.unmaskSelector)!==null&&a!==void 0?a:[]).some(function(d){return n.closest(d)});if(c)return!1}return cA(e,(o=t.defaultMaskLevel)!==null&&o!==void 0?o:Ng,n)},TE=function(e,t){return function(n,r){return n4(e,t,r)?n.replace(/[^\s]/g,"*"):n}},r4=function(){var e=ze();return e?.location?e.location.href:""},i4=function(e,t){return"".concat(t,"/").concat(e)},dA=function(e,t){return t||(e===xu.STAGING?$L:e===xu.EU?KL:GL)},a4=function(e){if(typeof e!="string"||e.trim()==="")return!1;var t=/^\/|^https?:\/\/[^\s]+$/;return!!t.test(e)},s4=function(e){var t=e.replace(/[.+^${}()|[\]\\]/g,"\\$&").replace(/\*/g,".*").replace(/\?/g,".");return new RegExp("^".concat(t,"$"))},o4=function(e){if(!e.every(function(t){return typeof t.selector=="string"&&typeof t.replacement=="string"}))throw new Error("ugcFilterRules must be an array of objects with selector and replacement properties");if(!e.every(function(t){return a4(t.selector)}))throw new Error("ugcFilterRules must be an array of objects with valid globs")},Rf=function(e,t){var n,r;try{for(var a=_e(t),o=a.next();!o.done;o=a.next()){var l=o.value,c=s4(l.selector);if(c.test(e))return e.replace(c,l.replacement)}}catch(d){n={error:d}}finally{try{o&&!o.done&&(r=a.return)&&r.call(a)}finally{if(n)throw n.error}}return e},fA=function(){return te(void 0,void 0,void 0,function(){var e,t,n,r,a,o,l;return ee(this,function(c){switch(c.label){case 0:return c.trys.push([0,3,,4]),e=ze(),e?[4,e.navigator.storage.estimate()]:[3,2];case 1:return t=c.sent(),n=t.usage,r=t.quota,a=t.usageDetails,o=n?Math.round(n/uA):0,l=n&&r?Math.round((n/r+Number.EPSILON)*1e3)/1e3:0,[2,{totalStorageSize:o,percentOfQuota:l,usageDetails:JSON.stringify(a)}];case 2:return[3,4];case 3:return c.sent(),[3,4];case 4:return[2,{totalStorageSize:0,percentOfQuota:0,usageDetails:""}]}})})},hA=function(e){var t=ce({},e),n=t.apiKey;return t.apiKey="****".concat(n.substring(n.length-4)),t},pA=function(){return{flushMaxRetries:2,logLevel:Wn.Warn,loggerProvider:new ko,transportProvider:new yI}},l4=(function(e){Or(t,e);function t(n,r){var a=this,o,l,c,d,f,m,g=pA();if(a=e.call(this,ce(ce({transportProvider:g.transportProvider,loggerProvider:new Ag(r.loggerProvider||g.loggerProvider)},r),{apiKey:n}))||this,a.flushMaxRetries=r.flushMaxRetries!==void 0&&r.flushMaxRetries<=g.flushMaxRetries?r.flushMaxRetries:g.flushMaxRetries,a.apiKey=n,a.sampleRate=r.sampleRate||UL,a.serverZone=r.serverZone||BL,a.configServerUrl=r.configServerUrl,a.trackServerUrl=r.trackServerUrl,a.shouldInlineStylesheet=r.shouldInlineStylesheet,a.version=r.version,a.performanceConfig=r.performanceConfig||VL,a.storeType=(o=r.storeType)!==null&&o!==void 0?o:"idb",a.applyBackgroundColorToBlockedElements=(l=r.applyBackgroundColorToBlockedElements)!==null&&l!==void 0?l:!1,a.enableUrlChangePolling=(c=r.enableUrlChangePolling)!==null&&c!==void 0?c:!1,a.urlChangePollingInterval=(d=r.urlChangePollingInterval)!==null&&d!==void 0?d:iy,a.captureDocumentTitle=(f=r.captureDocumentTitle)!==null&&f!==void 0?f:!1,r.privacyConfig&&(a.privacyConfig=r.privacyConfig),r.interactionConfig&&(a.interactionConfig=r.interactionConfig,a.interactionConfig.ugcFilterRules&&o4(a.interactionConfig.ugcFilterRules)),r.debugMode&&(a.debugMode=r.debugMode),r.useWebWorker!==void 0)a.useWebWorker=r.useWebWorker;else{var v=r;((m=v.experimental)===null||m===void 0?void 0:m.useWebWorker)!==void 0&&(a.useWebWorker=v.experimental.useWebWorker)}return r.omitElementTags&&(a.omitElementTags=r.omitElementTags),a}return t})(rC);const u4="modulepreload",c4=function(e){return"/"+e},kE={},Ql=function(t,n,r){let a=Promise.resolve();if(n&&n.length>0){let d=function(f){return Promise.all(f.map(m=>Promise.resolve(m).then(g=>({status:"fulfilled",value:g}),g=>({status:"rejected",reason:g}))))};document.getElementsByTagName("link");const l=document.querySelector("meta[property=csp-nonce]"),c=l?.nonce||l?.getAttribute("nonce");a=d(n.map(f=>{if(f=c4(f),f in kE)return;kE[f]=!0;const m=f.endsWith(".css"),g=m?'[rel="stylesheet"]':"";if(document.querySelector(`link[href="${f}"]${g}`))return;const v=document.createElement("link");if(v.rel=m?"stylesheet":u4,m||(v.as="script"),v.crossOrigin="",v.href=f,c&&v.setAttribute("nonce",c),document.head.appendChild(v),m)return new Promise((b,S)=>{v.addEventListener("load",b),v.addEventListener("error",()=>S(new Error(`Unable to preload CSS for ${f}`)))})}))}function o(l){const c=new Event("vite:preloadError",{cancelable:!0});if(c.payload=l,window.dispatchEvent(c),!c.defaultPrevented)throw l}return a.then(l=>{for(const c of l||[])c.status==="rejected"&&o(c.reason);return t().catch(o)})};var mA=(e=>(e[e.DomContentLoaded=0]="DomContentLoaded",e[e.Load=1]="Load",e[e.FullSnapshot=2]="FullSnapshot",e[e.IncrementalSnapshot=3]="IncrementalSnapshot",e[e.Meta=4]="Meta",e[e.Custom=5]="Custom",e[e.Plugin=6]="Plugin",e))(mA||{}),gA=(e=>(e[e.MouseUp=0]="MouseUp",e[e.MouseDown=1]="MouseDown",e[e.Click=2]="Click",e[e.ContextMenu=3]="ContextMenu",e[e.DblClick=4]="DblClick",e[e.Focus=5]="Focus",e[e.Blur=6]="Blur",e[e.TouchStart=7]="TouchStart",e[e.TouchMove_Departed=8]="TouchMove_Departed",e[e.TouchEnd=9]="TouchEnd",e[e.TouchCancel=10]="TouchCancel",e))(gA||{}),d4=function(e,t){var n=document.createDocumentFragment(),r=function(a){if(a===void 0&&(a=[]),typeof a=="string"&&(a=[a]),a=a.filter(function(o){try{n.querySelector(o)}catch{return t.warn('[session-replay-browser] omitting selector "'.concat(o,'" because it is invalid')),!1}return!0}),a.length!==0)return a};return e.blockSelector=r(e.blockSelector),e.maskSelector=r(e.maskSelector),e.unmaskSelector=r(e.unmaskSelector),e},f4=(function(){function e(t,n){this.localConfig=n,this.remoteConfigClient=t}return e.prototype.generateJoinedConfig=function(){var t,n,r;return te(this,void 0,void 0,function(){var a,o,l,c,d,f,m,g,v,b,S,w,E,T,C,k,j,N=this;return ee(this,function(R){switch(R.label){case 0:a=ce({},this.localConfig),a.optOut=this.localConfig.optOut,a.captureEnabled=!0,R.label=1;case 1:return R.trys.push([1,3,,4]),[4,new Promise(function(P,L){N.remoteConfigClient.subscribe("configs.sessionReplay","all",function(H,D){var B;if(N.localConfig.loggerProvider.debug("Session Replay remote configuration received from ".concat(D,":"),JSON.stringify(H,null,2)),!H){L(new Error("No remote config received"));return}var K=H,se=K.sr_sampling_config,ue=K.sr_privacy_config,Z=K.sr_targeting_config,V=(B=a.interactionConfig)===null||B===void 0?void 0:B.ugcFilterRules;a.interactionConfig=K.sr_interaction_config,a.interactionConfig&&V&&(a.interactionConfig.ugcFilterRules=V),a.loggingConfig=K.sr_logging_config,(se||ue||Z)&&(o={},se&&(o.sr_sampling_config=se),ue&&(o.sr_privacy_config=ue),Z&&(o.sr_targeting_config=Z)),P()})})];case 2:return R.sent(),[3,4];case 3:return l=R.sent(),this.localConfig.loggerProvider.error("Failed to generate joined config: ",l),a.captureEnabled=!1,[2,{localConfig:this.localConfig,joinedConfig:a,remoteConfig:void 0}];case 4:if(!o)return[2,{localConfig:this.localConfig,joinedConfig:a,remoteConfig:o}];if(c=o.sr_sampling_config,d=o.sr_privacy_config,f=o.sr_targeting_config,c&&Object.keys(c).length>0?(Object.prototype.hasOwnProperty.call(c,"capture_enabled")?a.captureEnabled=c.capture_enabled:a.captureEnabled=!1,Object.prototype.hasOwnProperty.call(c,"sample_rate")&&(a.sampleRate=c.sample_rate)):(a.captureEnabled=!0,this.localConfig.loggerProvider.debug("Remote config successfully fetched, but no values set for project, Session Replay capture enabled.")),d){m=(t=a.privacyConfig)!==null&&t!==void 0?t:{},g={defaultMaskLevel:(r=(n=d.defaultMaskLevel)!==null&&n!==void 0?n:m.defaultMaskLevel)!==null&&r!==void 0?r:"medium",blockSelector:[],maskSelector:[],unmaskSelector:[]},v=function(P){var L,H,D,B,K,se,ue,Z,V,X={};typeof P.blockSelector=="string"&&(P.blockSelector=[P.blockSelector]);try{for(var le=_e((ue=P.blockSelector)!==null&&ue!==void 0?ue:[]),ye=le.next();!ye.done;ye=le.next()){var M=ye.value;X[M]="block"}}catch(ge){L={error:ge}}finally{try{ye&&!ye.done&&(H=le.return)&&H.call(le)}finally{if(L)throw L.error}}try{for(var z=_e((Z=P.maskSelector)!==null&&Z!==void 0?Z:[]),W=z.next();!W.done;W=z.next()){var M=W.value;X[M]="mask"}}catch(ge){D={error:ge}}finally{try{W&&!W.done&&(B=z.return)&&B.call(z)}finally{if(D)throw D.error}}try{for(var I=_e((V=P.unmaskSelector)!==null&&V!==void 0?V:[]),fe=I.next();!fe.done;fe=I.next()){var M=fe.value;X[M]="unmask"}}catch(ge){K={error:ge}}finally{try{fe&&!fe.done&&(se=I.return)&&se.call(I)}finally{if(K)throw K.error}}return X},b=ce(ce({},v(m)),v(d));try{for(S=_e(Object.entries(b)),w=S.next();!w.done;w=S.next())E=Ae(w.value,2),T=E[0],C=E[1],C==="mask"?g.maskSelector.push(T):C==="block"?g.blockSelector.push(T):C==="unmask"&&g.unmaskSelector.push(T)}catch(P){k={error:P}}finally{try{w&&!w.done&&(j=S.return)&&j.call(S)}finally{if(k)throw k.error}}a.privacyConfig=d4(g,this.localConfig.loggerProvider)}return f&&Object.keys(f).length>0&&(a.targetingConfig=f),this.localConfig.loggerProvider.debug(JSON.stringify({name:"session replay joined config",config:hA(a)},null,2)),[2,{localConfig:this.localConfig,joinedConfig:a,remoteConfig:o}]}})})},e})(),h4=function(e,t){return te(void 0,void 0,void 0,function(){var n,r;return ee(this,function(a){return n=new l4(e,t),r=new fC(e,n.loggerProvider,n.serverZone,t.configServerUrl),[2,new f4(r,n)]})})},jr=Uint8Array,zn=Uint16Array,Su=Uint32Array,ay=new jr([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]),sy=new jr([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]),CE=new jr([16,17,18,0,8,7,9,6,10,5,11,4,12,3,13,2,14,1,15]),vA=function(e,t){for(var n=new zn(31),r=0;r<31;++r)n[r]=t+=1<<e[r-1];for(var a=new Su(n[30]),r=1;r<30;++r)for(var o=n[r];o<n[r+1];++o)a[o]=o-n[r]<<5|r;return[n,a]},yA=vA(ay,2),p4=yA[0],jg=yA[1];p4[28]=258,jg[258]=28;var m4=vA(sy,0),AE=m4[1],Rg=new zn(32768);for(var Pt=0;Pt<32768;++Pt){var ha=(Pt&43690)>>>1|(Pt&21845)<<1;ha=(ha&52428)>>>2|(ha&13107)<<2,ha=(ha&61680)>>>4|(ha&3855)<<4,Rg[Pt]=((ha&65280)>>>8|(ha&255)<<8)>>>1}var su=(function(e,t,n){for(var r=e.length,a=0,o=new zn(t);a<r;++a)++o[e[a]-1];var l=new zn(t);for(a=0;a<t;++a)l[a]=l[a-1]+o[a-1]<<1;var c;if(n){c=new zn(1<<t);var d=15-t;for(a=0;a<r;++a)if(e[a])for(var f=a<<4|e[a],m=t-e[a],g=l[e[a]-1]++<<m,v=g|(1<<m)-1;g<=v;++g)c[Rg[g]>>>d]=f}else for(c=new zn(r),a=0;a<r;++a)c[a]=Rg[l[e[a]-1]++]>>>15-e[a];return c}),ms=new jr(288);for(var Pt=0;Pt<144;++Pt)ms[Pt]=8;for(var Pt=144;Pt<256;++Pt)ms[Pt]=9;for(var Pt=256;Pt<280;++Pt)ms[Pt]=7;for(var Pt=280;Pt<288;++Pt)ms[Pt]=8;var of=new jr(32);for(var Pt=0;Pt<32;++Pt)of[Pt]=5;var g4=su(ms,9,0),v4=su(of,5,0),bA=function(e){return(e/8>>0)+(e&7&&1)},xA=function(e,t,n){(n==null||n>e.length)&&(n=e.length);var r=new(e instanceof zn?zn:e instanceof Su?Su:jr)(n-t);return r.set(e.subarray(t,n)),r},Pi=function(e,t,n){n<<=t&7;var r=t/8>>0;e[r]|=n,e[r+1]|=n>>>8},Vl=function(e,t,n){n<<=t&7;var r=t/8>>0;e[r]|=n,e[r+1]|=n>>>8,e[r+2]|=n>>>16},Sm=function(e,t){for(var n=[],r=0;r<e.length;++r)e[r]&&n.push({s:r,f:e[r]});var a=n.length,o=n.slice();if(!a)return[new jr(0),0];if(a==1){var l=new jr(n[0].s+1);return l[n[0].s]=1,[l,1]}n.sort(function(N,R){return N.f-R.f}),n.push({s:-1,f:25001});var c=n[0],d=n[1],f=0,m=1,g=2;for(n[0]={s:-1,f:c.f+d.f,l:c,r:d};m!=a-1;)c=n[n[f].f<n[g].f?f++:g++],d=n[f!=m&&n[f].f<n[g].f?f++:g++],n[m++]={s:-1,f:c.f+d.f,l:c,r:d};for(var v=o[0].s,r=1;r<a;++r)o[r].s>v&&(v=o[r].s);var b=new zn(v+1),S=_g(n[m-1],b,0);if(S>t){var r=0,w=0,E=S-t,T=1<<E;for(o.sort(function(R,P){return b[P.s]-b[R.s]||R.f-P.f});r<a;++r){var C=o[r].s;if(b[C]>t)w+=T-(1<<S-b[C]),b[C]=t;else break}for(w>>>=E;w>0;){var k=o[r].s;b[k]<t?w-=1<<t-b[k]++-1:++r}for(;r>=0&&w;--r){var j=o[r].s;b[j]==t&&(--b[j],++w)}S=t}return[new jr(b),S]},_g=function(e,t,n){return e.s==-1?Math.max(_g(e.l,t,n+1),_g(e.r,t,n+1)):t[e.s]=n},NE=function(e){for(var t=e.length;t&&!e[--t];);for(var n=new zn(++t),r=0,a=e[0],o=1,l=function(d){n[r++]=d},c=1;c<=t;++c)if(e[c]==a&&c!=t)++o;else{if(!a&&o>2){for(;o>138;o-=138)l(32754);o>2&&(l(o>10?o-11<<5|28690:o-3<<5|12305),o=0)}else if(o>3){for(l(a),--o;o>6;o-=6)l(8304);o>2&&(l(o-3<<5|8208),o=0)}for(;o--;)l(a);o=1,a=e[c]}return[n.subarray(0,r),t]},Fl=function(e,t){for(var n=0,r=0;r<t.length;++r)n+=e[r]*t[r];return n},Og=function(e,t,n){var r=n.length,a=bA(t+2);e[a]=r&255,e[a+1]=r>>>8,e[a+2]=e[a]^255,e[a+3]=e[a+1]^255;for(var o=0;o<r;++o)e[a+o+4]=n[o];return(a+4+r)*8},jE=function(e,t,n,r,a,o,l,c,d,f,m){Pi(t,m++,n),++a[256];for(var g=Sm(a,15),v=g[0],b=g[1],S=Sm(o,15),w=S[0],E=S[1],T=NE(v),C=T[0],k=T[1],j=NE(w),N=j[0],R=j[1],P=new zn(19),L=0;L<C.length;++L)P[C[L]&31]++;for(var L=0;L<N.length;++L)P[N[L]&31]++;for(var H=Sm(P,7),D=H[0],B=H[1],K=19;K>4&&!D[CE[K-1]];--K);var se=f+5<<3,ue=Fl(a,ms)+Fl(o,of)+l,Z=Fl(a,v)+Fl(o,w)+l+14+3*K+Fl(P,D)+(2*P[16]+3*P[17]+7*P[18]);if(se<=ue&&se<=Z)return Og(t,m,e.subarray(d,d+f));var V,X,le,ye;if(Pi(t,m,1+(Z<ue)),m+=2,Z<ue){V=su(v,b,0),X=v,le=su(w,E,0),ye=w;var M=su(D,B,0);Pi(t,m,k-257),Pi(t,m+5,R-1),Pi(t,m+10,K-4),m+=14;for(var L=0;L<K;++L)Pi(t,m+3*L,D[CE[L]]);m+=3*K;for(var z=[C,N],W=0;W<2;++W)for(var I=z[W],L=0;L<I.length;++L){var fe=I[L]&31;Pi(t,m,M[fe]),m+=D[fe],fe>15&&(Pi(t,m,I[L]>>>5&127),m+=I[L]>>>12)}}else V=g4,X=ms,le=v4,ye=of;for(var L=0;L<c;++L)if(r[L]>255){var fe=r[L]>>>18&31;Vl(t,m,V[fe+257]),m+=X[fe+257],fe>7&&(Pi(t,m,r[L]>>>23&31),m+=ay[fe]);var ge=r[L]&31;Vl(t,m,le[ge]),m+=ye[ge],ge>3&&(Vl(t,m,r[L]>>>5&8191),m+=sy[ge])}else Vl(t,m,V[r[L]]),m+=X[r[L]];return Vl(t,m,V[256]),m+X[256]},y4=new Su([65540,131080,131088,131104,262176,1048704,1048832,2114560,2117632]),b4=function(e,t,n,r,a,o){var l=e.length,c=new jr(r+l+5*(1+Math.floor(l/7e3))+a),d=c.subarray(r,c.length-a),f=0;if(!t||l<8)for(var m=0;m<=l;m+=65535){var g=m+65535;g<l?f=Og(d,f,e.subarray(m,g)):(d[m]=o,f=Og(d,f,e.subarray(m,l)))}else{for(var v=y4[t-1],b=v>>>13,S=v&8191,w=(1<<n)-1,E=new zn(32768),T=new zn(w+1),C=Math.ceil(n/3),k=2*C,j=function(We){return(e[We]^e[We+1]<<C^e[We+2]<<k)&w},N=new Su(25e3),R=new zn(288),P=new zn(32),L=0,H=0,m=0,D=0,B=0,K=0;m<l;++m){var se=j(m),ue=m&32767,Z=T[se];if(E[ue]=Z,T[se]=ue,B<=m){var V=l-m;if((L>7e3||D>24576)&&V>423){f=jE(e,d,0,N,R,P,H,D,K,m-K,f),D=L=H=0,K=m;for(var X=0;X<286;++X)R[X]=0;for(var X=0;X<30;++X)P[X]=0}var le=2,ye=0,M=S,z=ue-Z&32767;if(V>2&&se==j(m-z))for(var W=Math.min(b,V)-1,I=Math.min(32767,m),fe=Math.min(258,V);z<=I&&--M&&ue!=Z;){if(e[m+le]==e[m+le-z]){for(var ge=0;ge<fe&&e[m+ge]==e[m+ge-z];++ge);if(ge>le){if(le=ge,ye=z,ge>W)break;for(var Se=Math.min(z,ge-2),we=0,X=0;X<Se;++X){var Pe=m-z+X+32768&32767,je=E[Pe],ve=Pe-je+32768&32767;ve>we&&(we=ve,Z=Pe)}}}ue=Z,Z=E[ue],z+=ue-Z+32768&32767}if(ye){N[D++]=268435456|jg[le]<<18|AE[ye];var Le=jg[le]&31,xt=AE[ye]&31;H+=ay[Le]+sy[xt],++R[257+Le],++P[xt],B=m+le,++L}else N[D++]=e[m],++R[e[m]]}}f=jE(e,d,o,N,R,P,H,D,K,m-K,f)}return xA(c,0,r+bA(f)+a)},x4=function(){var e=1,t=0;return{p:function(n){for(var r=e,a=t,o=n.length,l=0;l!=o;){for(var c=Math.min(l+5552,o);l<c;++l)r+=n[l],a+=r;r%=65521,a%=65521}e=r,t=a},d:function(){return(e>>>8<<16|(t&255)<<8|t>>>8)+((e&255)<<23)*2}}},S4=function(e,t,n,r,a){return b4(e,t.level==null?6:t.level,t.mem==null?Math.ceil(Math.max(8,Math.min(13,Math.log(e.length)))*1.5):12+t.mem,n,r,!0)},w4=function(e,t,n){for(;n;++t)e[t]=n,n>>>=8},E4=function(e,t){var n=t.level,r=n==0?0:n<6?1:n==9?3:2;e[0]=120,e[1]=r<<6|(r?32-2*r:1)};function T4(e,t){t===void 0&&(t={});var n=x4();n.p(e);var r=S4(e,t,2,4);return E4(r,t),w4(r,r.length-4,n.d()),r}function k4(e,t){var n=e.length;if(typeof TextEncoder<"u")return new TextEncoder().encode(e);for(var r=new jr(e.length+(e.length>>>1)),a=0,o=function(f){r[a++]=f},l=0;l<n;++l){if(a+5>r.length){var c=new jr(a+8+(n-l<<1));c.set(r),r=c}var d=e.charCodeAt(l);d<128||t?o(d):d<2048?(o(192|d>>>6),o(128|d&63)):d>55295&&d<57344?(d=65536+(d&1047552)|e.charCodeAt(++l)&1023,o(240|d>>>18),o(128|d>>>12&63),o(128|d>>>6&63),o(128|d&63)):(o(224|d>>>12),o(128|d>>>6&63),o(128|d&63))}return xA(r,0,a)}function C4(e,t){for(var n="",r=0;r<e.length;){var a=e[r++];n+=String.fromCharCode(a)}return n}const A4="v1",N4=e=>{const t={...e,v:A4};return C4(T4(k4(JSON.stringify(t))))};var j4=2e3,R4=(function(){function e(t,n,r,a){var o=this,l;this.taskQueue=[],this.isProcessing=!1,this.compressEvent=function(g){var v=N4(g);return JSON.stringify(v)},this.addCompressedEventToManager=function(g,v){o.eventsManager&&o.deviceId&&o.eventsManager.addEvent({event:{type:"replay",data:g},sessionId:v,deviceId:o.deviceId})},this.addCompressedEvent=function(g,v){if(o.worker)try{o.worker.postMessage({event:g,sessionId:v})}catch(S){S.name==="DataCloneError"?o.worker.postMessage(JSON.stringify({event:g,sessionId:v})):o.config.loggerProvider.warn("Unexpected error while posting message to worker:",S)}else{var b=o.compressEvent(g);o.addCompressedEventToManager(b,v)}},this.terminate=function(){var g;(g=o.worker)===null||g===void 0||g.terminate()};var c=ze();if(this.canUseIdleCallback=c&&"requestIdleCallback"in c,this.eventsManager=t,this.config=n,this.deviceId=r,this.timeout=((l=n.performanceConfig)===null||l===void 0?void 0:l.timeout)||j4,a){n.loggerProvider.log("Enabling web worker for compression");try{var d=new Blob([a],{type:"application/javascript"}),f=URL.createObjectURL(d),m=new Worker(f);m.onerror=function(g){n.loggerProvider.error("Worker failed, falling back to non-worker compression:",g),m.terminate(),o.worker=void 0},m.onmessage=function(g){var v=g.data,b=v.compressedEvent,S=v.sessionId;o.addCompressedEventToManager(b,S)},this.worker=m}catch(g){n.loggerProvider.error("Failed to create worker, falling back to non-worker compression:",g)}}}return e.prototype.scheduleIdleProcessing=function(){var t=this;this.isProcessing||(this.isProcessing=!0,requestIdleCallback(function(n){t.processQueue(n)},{timeout:this.timeout}))},e.prototype.enqueueEvent=function(t,n){var r;this.canUseIdleCallback&&(!((r=this.config.performanceConfig)===null||r===void 0)&&r.enabled)?(this.config.loggerProvider.debug("Enqueuing event for processing during idle time."),this.taskQueue.push({event:t,sessionId:n}),this.scheduleIdleProcessing()):(this.config.loggerProvider.debug("Processing event without idle callback."),this.addCompressedEvent(t,n))},e.prototype.processQueue=function(t){for(var n=this;this.taskQueue.length>0&&(t.timeRemaining()>0||t.didTimeout);){var r=this.taskQueue.shift();if(r){var a=r.event,o=r.sessionId;this.addCompressedEvent(a,o)}}this.taskQueue.length>0?requestIdleCallback(function(l){n.processQueue(l)},{timeout:this.timeout}):this.isProcessing=!1},e})(),_4="Unexpected error occurred",O4="Network error occurred, event batch rejected",RE="Session replay event batch rejected due to exceeded retry count",no="Failed to store session replay events in IndexedDB",M4="Session replay event batch not sent due to missing device ID",D4="Session replay event batch not sent due to missing api key",Mg="1.32.0",I4=(function(){function e(t){var n=t.trackServerUrl,r=t.loggerProvider,a=t.payloadBatcher;this.storageKey="",this.retryTimeout=1e3,this.scheduled=null,this.queue=[],this.loggerProvider=r,this.payloadBatcher=a||function(o){return o},this.trackServerUrl=n}return e.prototype.sendEventsList=function(t){this.addToQueue(ce(ce({},t),{attempts:0,timeout:0}))},e.prototype.addToQueue=function(){for(var t=this,n=[],r=0;r<arguments.length;r++)n[r]=arguments[r];var a=n.filter(function(o){return o.attempts<(o.flushMaxRetries||0)?(o.attempts+=1,!0):(t.completeRequest({context:o,err:RE}),!1)});a.forEach(function(o){t.queue=t.queue.concat(o),t.schedule(0)})},e.prototype.schedule=function(t){var n=this;this.scheduled||(this.scheduled=setTimeout(function(){n.flush(!0).then(function(){n.queue.length>0&&n.schedule(t)})},t))},e.prototype.flush=function(t){return t===void 0&&(t=!1),te(this,void 0,void 0,function(){var n,r,a,o,l,c,d;return ee(this,function(f){switch(f.label){case 0:n=this.queue,this.queue=[],this.scheduled&&(clearTimeout(this.scheduled),this.scheduled=null),f.label=1;case 1:f.trys.push([1,6,7,8]),r=_e(n),a=r.next(),f.label=2;case 2:return a.done?[3,5]:(o=a.value,[4,this.send(o,t)]);case 3:f.sent(),f.label=4;case 4:return a=r.next(),[3,2];case 5:return[3,8];case 6:return l=f.sent(),c={error:l},[3,8];case 7:try{a&&!a.done&&(d=r.return)&&d.call(r)}finally{if(c)throw c.error}return[7];case 8:return[2]}})})},e.prototype.send=function(t,n){var r,a;return n===void 0&&(n=!0),te(this,void 0,void 0,function(){var o,l,c,d,f,m,g,v,b,S,w,E,T;return ee(this,function(C){switch(C.label){case 0:if(o=t.apiKey,!o)return[2,this.completeRequest({context:t,err:D4})];if(l=t.deviceId,!l)return[2,this.completeRequest({context:t,err:M4})];if(c=r4(),d=Mg,f=t.sampleRate,m=new URLSearchParams({device_id:l,session_id:"".concat(t.sessionId),type:"".concat(t.type)}),g="".concat(((r=t.version)===null||r===void 0?void 0:r.type)||"standalone","/").concat(((a=t.version)===null||a===void 0?void 0:a.version)||d),v=this.payloadBatcher({version:1,events:t.events}),v.events.length===0)return this.completeRequest({context:t}),[2];C.label=1;case 1:return C.trys.push([1,6,,7]),b={headers:{"Content-Type":"application/json",Accept:"*/*",Authorization:"Bearer ".concat(o),"X-Client-Version":d,"X-Client-Library":g,"X-Client-Url":c.substring(0,ZL),"X-Client-Sample-Rate":"".concat(f)},body:JSON.stringify(v),method:"POST"},S="".concat(dA(t.serverZone,this.trackServerUrl),"?").concat(m.toString()),[4,fetch(S,b)];case 2:if(w=C.sent(),w===null)return this.completeRequest({context:t,err:_4}),[2];if(n)return[3,3];E="";try{E=JSON.stringify(w.body,null,2)}catch{}return this.completeRequest({context:t,success:"".concat(w.status,": ").concat(E)}),[3,5];case 3:return[4,this.handleReponse(w.status,t)];case 4:C.sent(),C.label=5;case 5:return[3,7];case 6:return T=C.sent(),this.completeRequest({context:t,err:T}),[3,7];case 7:return[2]}})})},e.prototype.handleReponse=function(t,n){return te(this,void 0,void 0,function(){var r,a;return ee(this,function(o){switch(o.label){case 0:switch(r=new Ou().buildStatus(t),a=r,a){case Gt.Success:return[3,1];case Gt.Failed:return[3,2]}return[3,4];case 1:return this.handleSuccessResponse(n),[3,5];case 2:return[4,this.handleOtherResponse(n)];case 3:return o.sent(),[3,5];case 4:this.completeRequest({context:n,err:O4}),o.label=5;case 5:return[2]}})})},e.prototype.handleSuccessResponse=function(t){var n=Math.round(new Blob(t.events).size/uA);this.completeRequest({context:t,success:"Session replay event batch tracked successfully for session id ".concat(t.sessionId,", size of events: ").concat(n," KB")})},e.prototype.handleOtherResponse=function(t){return te(this,void 0,void 0,function(){var n;return ee(this,function(r){switch(r.label){case 0:return n=t.attempts*this.retryTimeout,t.attempts++,t.attempts>(t.flushMaxRetries||0)?(this.completeRequest({context:t,err:RE}),[2]):[4,new Promise(function(a){return setTimeout(a,n)})];case 1:return r.sent(),[4,this.send(t,!0)];case 2:return r.sent(),[2]}})})},e.prototype.completeRequest=function(t){var n=t.context,r=t.err,a=t.success;n.onComplete(),r?this.loggerProvider.warn(r):a&&this.loggerProvider.log(a)},e})();const Dg=(e,t)=>t.some(n=>e instanceof n);let _E,OE;function P4(){return _E||(_E=[IDBDatabase,IDBObjectStore,IDBIndex,IDBCursor,IDBTransaction])}function L4(){return OE||(OE=[IDBCursor.prototype.advance,IDBCursor.prototype.continue,IDBCursor.prototype.continuePrimaryKey])}const Ig=new WeakMap,wm=new WeakMap,_f=new WeakMap;function z4(e){const t=new Promise((n,r)=>{const a=()=>{e.removeEventListener("success",o),e.removeEventListener("error",l)},o=()=>{n(fs(e.result)),a()},l=()=>{r(e.error),a()};e.addEventListener("success",o),e.addEventListener("error",l)});return _f.set(t,e),t}function U4(e){if(Ig.has(e))return;const t=new Promise((n,r)=>{const a=()=>{e.removeEventListener("complete",o),e.removeEventListener("error",l),e.removeEventListener("abort",l)},o=()=>{n(),a()},l=()=>{r(e.error||new DOMException("AbortError","AbortError")),a()};e.addEventListener("complete",o),e.addEventListener("error",l),e.addEventListener("abort",l)});Ig.set(e,t)}let Pg={get(e,t,n){if(e instanceof IDBTransaction){if(t==="done")return Ig.get(e);if(t==="store")return n.objectStoreNames[1]?void 0:n.objectStore(n.objectStoreNames[0])}return fs(e[t])},set(e,t,n){return e[t]=n,!0},has(e,t){return e instanceof IDBTransaction&&(t==="done"||t==="store")?!0:t in e}};function SA(e){Pg=e(Pg)}function B4(e){return L4().includes(e)?function(...t){return e.apply(Lg(this),t),fs(this.request)}:function(...t){return fs(e.apply(Lg(this),t))}}function V4(e){return typeof e=="function"?B4(e):(e instanceof IDBTransaction&&U4(e),Dg(e,P4())?new Proxy(e,Pg):e)}function fs(e){if(e instanceof IDBRequest)return z4(e);if(wm.has(e))return wm.get(e);const t=V4(e);return t!==e&&(wm.set(e,t),_f.set(t,e)),t}const Lg=e=>_f.get(e);function wA(e,t,{blocked:n,upgrade:r,blocking:a,terminated:o}={}){const l=indexedDB.open(e,t),c=fs(l);return r&&l.addEventListener("upgradeneeded",d=>{r(fs(l.result),d.oldVersion,d.newVersion,fs(l.transaction),d)}),n&&l.addEventListener("blocked",d=>n(d.oldVersion,d.newVersion,d)),c.then(d=>{o&&d.addEventListener("close",()=>o()),a&&d.addEventListener("versionchange",f=>a(f.oldVersion,f.newVersion,f))}).catch(()=>{}),c}const F4=["get","getKey","getAll","getAllKeys","count"],H4=["put","add","delete","clear"],Em=new Map;function ME(e,t){if(!(e instanceof IDBDatabase&&!(t in e)&&typeof t=="string"))return;if(Em.get(t))return Em.get(t);const n=t.replace(/FromIndex$/,""),r=t!==n,a=H4.includes(n);if(!(n in(r?IDBIndex:IDBObjectStore).prototype)||!(a||F4.includes(n)))return;const o=async function(l,...c){const d=this.transaction(l,a?"readwrite":"readonly");let f=d.store;return r&&(f=f.index(c.shift())),(await Promise.all([f[n](...c),a&&d.done]))[0]};return Em.set(t,o),o}SA(e=>({...e,get:(t,n,r)=>ME(t,n)||e.get(t,n,r),has:(t,n)=>!!ME(t,n)||e.has(t,n)}));const q4=["continue","continuePrimaryKey","advance"],DE={},zg=new WeakMap,EA=new WeakMap,G4={get(e,t){if(!q4.includes(t))return e[t];let n=DE[t];return n||(n=DE[t]=function(...r){zg.set(this,EA.get(this)[t](...r))}),n}};async function*K4(...e){let t=this;if(t instanceof IDBCursor||(t=await t.openCursor(...e)),!t)return;t=t;const n=new Proxy(t,G4);for(EA.set(n,t),_f.set(n,Lg(t));t;)yield n,t=await(zg.get(n)||t.continue()),zg.delete(n)}function IE(e,t){return t===Symbol.asyncIterator&&Dg(e,[IDBIndex,IDBObjectStore,IDBCursor])||t==="iterate"&&Dg(e,[IDBIndex,IDBObjectStore])}SA(e=>({...e,get(t,n,r){return IE(t,n)?K4:e.get(t,n,r)},has(t,n){return IE(t,n)||e.has(t,n)}}));var TA=(function(){function e(t){var n=this,r,a,o;this.minInterval=QL,this.maxInterval=JL,this.maxPersistedEventsSize=YL,this.interval=this.minInterval,this._timeAtLastSplit=Date.now(),this.shouldSplitEventsList=function(l,c){var d=n.getStringSize(c),f=n.getEventsArraySize(l);return f+d>=n.maxPersistedEventsSize?!0:Date.now()-n.timeAtLastSplit>n.interval&&l.length?(n.interval=Math.min(n.maxInterval,n.interval+n.minInterval),n._timeAtLastSplit=Date.now(),!0):!1},this.loggerProvider=t.loggerProvider,this.minInterval=(r=t.minInterval)!==null&&r!==void 0?r:this.minInterval,this.maxInterval=(a=t.maxInterval)!==null&&a!==void 0?a:this.maxInterval,this.maxPersistedEventsSize=(o=t.maxPersistedEventsSize)!==null&&o!==void 0?o:this.maxPersistedEventsSize}return Object.defineProperty(e.prototype,"timeAtLastSplit",{get:function(){return this._timeAtLastSplit},enumerable:!1,configurable:!0}),e.prototype.getStringSize=function(t){return t.length},e.prototype.getEventsArraySize=function(t){var n,r,a=0;try{for(var o=_e(t),l=o.next();!l.done;l=o.next()){var c=l.value;a+=this.getStringSize(c)}}catch(f){n={error:f}}finally{try{l&&!l.done&&(r=o.return)&&r.call(o)}finally{if(n)throw n.error}}var d=2+Math.max(0,t.length-1)+t.length*2;return a+d},e})(),$4=function(e){return typeof e=="object"&&e!==null&&e.name==="AbortError"},zi=function(e,t,n){$4(n)?e.debug(t):e.warn(t)},ou="sessionCurrentSequence",lu="sequencesToSend",Y4=function(e){var t,n;return e.objectStoreNames.contains(ou)||(n=e.createObjectStore(ou,{keyPath:"sessionId"})),e.objectStoreNames.contains(lu)||(t=e.createObjectStore(lu,{keyPath:"sequenceId",autoIncrement:!0}),t.createIndex("sessionId","sessionId")),{sequencesStore:t,currentSequenceStore:n}},W4=function(e){return te(void 0,void 0,void 0,function(){return ee(this,function(t){switch(t.label){case 0:return[4,wA(e,1,{upgrade:Y4})];case 1:return[2,t.sent()]}})})},X4=(function(e){Or(t,e);function t(n){var r=e.call(this,n)||this;return r.getSequencesToSend=function(){return te(r,void 0,void 0,function(){var a,o,l,c,d,f;return ee(this,function(m){switch(m.label){case 0:return m.trys.push([0,5,,6]),a=[],[4,this.db.transaction("sequencesToSend").store.openCursor()];case 1:o=m.sent(),m.label=2;case 2:return o?(l=o.value,c=l.sessionId,d=l.events,a.push({events:d,sequenceId:o.key,sessionId:c}),[4,o.continue()]):[3,4];case 3:return o=m.sent(),[3,2];case 4:return[2,a];case 5:return f=m.sent(),zi(this.loggerProvider,"".concat(no,": ").concat(f),f),[3,6];case 6:return[2,void 0]}})})},r.storeCurrentSequence=function(a){return te(r,void 0,void 0,function(){var o,l,c;return ee(this,function(d){switch(d.label){case 0:return d.trys.push([0,4,,5]),[4,this.db.get(ou,a)];case 1:return o=d.sent(),o?[4,this.db.put(lu,{sessionId:a,events:o.events})]:[2,void 0];case 2:return l=d.sent(),[4,this.db.put(ou,{sessionId:a,events:[]})];case 3:return d.sent(),[2,ce(ce({},o),{sessionId:a,sequenceId:l})];case 4:return c=d.sent(),zi(this.loggerProvider,"".concat(no,": ").concat(c),c),[3,5];case 5:return[2,void 0]}})})},r.addEventToCurrentSequence=function(a,o){return te(r,void 0,void 0,function(){var l,c,d,f,m,g;return ee(this,function(v){switch(v.label){case 0:return v.trys.push([0,10,,11]),l=this.db.transaction(ou,"readwrite"),[4,l.store.get(a)];case 1:return c=v.sent(),c?[3,3]:[4,l.store.put({sessionId:a,events:[o]})];case 2:return v.sent(),[2];case 3:return d=void 0,this.shouldSplitEventsList(c.events,o)?(d=c.events,[4,l.store.put({sessionId:a,events:[o]})]):[3,5];case 4:return v.sent(),[3,7];case 5:return f=c.events.concat(o),[4,l.store.put({sessionId:a,events:f})];case 6:v.sent(),v.label=7;case 7:return[4,l.done];case 8:return v.sent(),d?[4,this.storeSendingEvents(a,d)]:[2,void 0];case 9:return m=v.sent(),m?[2,{events:d,sessionId:a,sequenceId:m}]:[2,void 0];case 10:return g=v.sent(),zi(this.loggerProvider,"".concat(no,": ").concat(g),g),[3,11];case 11:return[2,void 0]}})})},r.storeSendingEvents=function(a,o){return te(r,void 0,void 0,function(){var l,c;return ee(this,function(d){switch(d.label){case 0:return d.trys.push([0,2,,3]),[4,this.db.put(lu,{sessionId:a,events:o})];case 1:return l=d.sent(),[2,l];case 2:return c=d.sent(),zi(this.loggerProvider,"".concat(no,": ").concat(c),c),[3,3];case 3:return[2,void 0]}})})},r.cleanUpSessionEventsStore=function(a,o){return te(r,void 0,void 0,function(){var l;return ee(this,function(c){switch(c.label){case 0:if(!o)return[2];c.label=1;case 1:return c.trys.push([1,3,,4]),[4,this.db.delete(lu,o)];case 2:return c.sent(),[3,4];case 3:return l=c.sent(),zi(this.loggerProvider,"".concat(no,": ").concat(l),l),[3,4];case 4:return[2]}})})},r.db=n.db,r}return t.new=function(n,r){return te(this,void 0,void 0,function(){var a,o,l,c;return ee(this,function(d){switch(d.label){case 0:return d.trys.push([0,2,,3]),a=n==="replay"?"":"_".concat(n),o="".concat(r.apiKey.substring(0,10),"_amp_session_replay_events").concat(a),[4,W4(o)];case 1:return l=d.sent(),[2,new t(ce(ce({},r),{db:l}))];case 2:return c=d.sent(),zi(r.loggerProvider,"".concat(no,": ").concat(c),c),[3,3];case 3:return[2]}})})},t.prototype.getCurrentSequenceEvents=function(n){return te(this,void 0,void 0,function(){var l,r,a,o,l,c,d,f;return ee(this,function(m){switch(m.label){case 0:return n?[4,this.db.get("sessionCurrentSequence",n)]:[3,2];case 1:return l=m.sent(),l?[2,[l]]:[2,void 0];case 2:r=[],m.label=3;case 3:return m.trys.push([3,8,9,10]),[4,this.db.getAll("sessionCurrentSequence")];case 4:a=_e.apply(void 0,[m.sent()]),o=a.next(),m.label=5;case 5:if(o.done)return[3,7];l=o.value,r.push(l),m.label=6;case 6:return o=a.next(),[3,5];case 7:return[3,10];case 8:return c=m.sent(),d={error:c},[3,10];case 9:try{o&&!o.done&&(f=a.return)&&f.call(a)}finally{if(d)throw d.error}return[7];case 10:return[2,r]}})})},t})(TA),Q4=(function(e){Or(t,e);function t(){var n=e!==null&&e.apply(this,arguments)||this;return n.finalizedSequences={},n.sequences={},n.sequenceId=0,n}return t.prototype.resetCurrentSequence=function(n){this.sequences[n]=[]},t.prototype.addSequence=function(n){var r=this.sequenceId++,a=Je([],Ae(this.sequences[n]),!1);return this.finalizedSequences[r]={sessionId:n,events:a},this.resetCurrentSequence(n),{sequenceId:r,events:a,sessionId:n}},t.prototype.getSequencesToSend=function(){return te(this,void 0,void 0,function(){return ee(this,function(n){return[2,Object.entries(this.finalizedSequences).map(function(r){var a=Ae(r,2),o=a[0],l=a[1],c=l.sessionId,d=l.events;return{sequenceId:Number(o),sessionId:c,events:d}})]})})},t.prototype.storeCurrentSequence=function(n){return te(this,void 0,void 0,function(){return ee(this,function(r){return this.sequences[n]?[2,this.addSequence(n)]:[2,void 0]})})},t.prototype.addEventToCurrentSequence=function(n,r){return te(this,void 0,void 0,function(){var a;return ee(this,function(o){return this.sequences[n]||this.resetCurrentSequence(n),this.shouldSplitEventsList(this.sequences[n],r)&&(a=this.addSequence(n)),this.sequences[n].push(r),[2,a]})})},t.prototype.storeSendingEvents=function(n,r){return te(this,void 0,void 0,function(){return ee(this,function(a){return this.finalizedSequences[this.sequenceId]={sessionId:n,events:r},[2,this.sequenceId++]})})},t.prototype.cleanUpSessionEventsStore=function(n,r){return te(this,void 0,void 0,function(){return ee(this,function(a){return r!==void 0&&delete this.finalizedSequences[r],[2]})})},t})(TA),PE=function(e){var t=e.config,n=e.minInterval,r=e.maxInterval,a=e.type,o=e.payloadBatcher,l=e.storeType;return te(void 0,void 0,void 0,function(){function c(T){return T===void 0&&(T=!1),te(this,void 0,void 0,function(){return ee(this,function(C){return[2,d.flush(T)]})})}var d,f,m,g,v,b,S,w,E;return ee(this,function(T){switch(T.label){case 0:return d=new I4(ce(ce({},t),{loggerProvider:t.loggerProvider,payloadBatcher:o})),f=function(){return new Q4({loggerProvider:t.loggerProvider,maxInterval:r,minInterval:n})},m=function(){return te(void 0,void 0,void 0,function(){var C;return ee(this,function(k){switch(k.label){case 0:return[4,X4.new(a,{loggerProvider:t.loggerProvider,minInterval:n,maxInterval:r,apiKey:t.apiKey})];case 1:return C=k.sent(),C?[2,C]:(t.loggerProvider.log("Failed to initialize idb store, falling back to memory store."),[2,f()])}})})},l!=="idb"?[3,2]:[4,m()];case 1:return v=T.sent(),[3,3];case 2:v=f(),T.label=3;case 3:return g=v,b=function(C){var k=C.events,j=C.sessionId,N=C.deviceId,R=C.sequenceId;t.debugMode&&fA().then(function(P){var L=P.totalStorageSize,H=P.percentOfQuota,D=P.usageDetails;t.loggerProvider.debug("Total storage size: ".concat(L," KB, percentage of quota: ").concat(H,"%, usage details: ").concat(D))}).catch(function(){}),d.sendEventsList({events:k,sessionId:j,flushMaxRetries:t.flushMaxRetries,apiKey:t.apiKey,deviceId:N,sampleRate:t.sampleRate,serverZone:t.serverZone,version:t.version,type:a,onComplete:function(){return te(void 0,void 0,void 0,function(){return ee(this,function(P){switch(P.label){case 0:return[4,g.cleanUpSessionEventsStore(j,R)];case 1:return P.sent(),[2]}})})}})},S=function(C){var k=C.sessionId,j=C.deviceId;g.storeCurrentSequence(k).then(function(N){N&&b({sequenceId:N.sequenceId,events:N.events,sessionId:N.sessionId,deviceId:j})}).catch(function(N){t.loggerProvider.warn("Failed to get current sequence of session replay events for session:",N)})},w=function(C){var k=C.deviceId;return te(void 0,void 0,void 0,function(){var j;return ee(this,function(N){switch(N.label){case 0:return[4,g.getSequencesToSend()];case 1:return j=N.sent(),j&&j.forEach(function(R){b({sequenceId:R.sequenceId,events:R.events,sessionId:R.sessionId,deviceId:k})}),[2]}})})},E=function(C){var k=C.event,j=C.sessionId,N=C.deviceId;g.addEventToCurrentSequence(j,k.data).then(function(R){return R&&b({sequenceId:R.sequenceId,events:R.events,sessionId:R.sessionId,deviceId:N})}).catch(function(R){t.loggerProvider.warn("Failed to add event to session replay capture:",R)})},[2,{sendCurrentSequenceEvents:S,addEvent:E,sendStoredEvents:w,flush:c}]}})})},LE=(function(){function e(){for(var t=[],n=0;n<arguments.length;n++)t[n]=arguments[n];var r=new Map;t.forEach(function(a){r.set(a.name,a.manager)}),this.managers=r}return e.prototype.sendStoredEvents=function(t){return te(this,void 0,void 0,function(){var n;return ee(this,function(r){switch(r.label){case 0:return n=[],this.managers.forEach(function(a){n.push(a.sendStoredEvents(t))}),[4,Promise.all(n)];case 1:return r.sent(),[2]}})})},e.prototype.addEvent=function(t){var n,r=t.sessionId,a=t.event,o=t.deviceId;(n=this.managers.get(a.type))===null||n===void 0||n.addEvent({sessionId:r,event:a,deviceId:o})},e.prototype.sendCurrentSequenceEvents=function(t){var n=t.sessionId,r=t.deviceId;this.managers.forEach(function(a){a.sendCurrentSequenceEvents({sessionId:n,deviceId:r})})},e.prototype.flush=function(t){return te(this,void 0,void 0,function(){var n;return ee(this,function(r){switch(r.label){case 0:return n=[],this.managers.forEach(function(a){n.push(a.flush(t))}),[4,Promise.all(n)];case 1:return r.sent(),[2]}})})},e})(),Rr,oy,kA;function J4(e,t){if(kA=new Date,e.nodeType!==Node.ELEMENT_NODE)throw new Error("Can't generate CSS selector for non-element node type.");if(e.tagName.toLowerCase()==="html")return"html";var n={root:document.body,idName:function(o){return!0},className:function(o){return!0},tagName:function(o){return!0},attr:function(o,l){return!1},seedMinLength:1,optimizedMinLength:2,threshold:1e3,maxNumberOfTries:1e4,timeoutMs:void 0};Rr=ce(ce({},n),t),oy=Z4(Rr.root,n);var r=hd(e,"all",function(){return hd(e,"two",function(){return hd(e,"one",function(){return hd(e,"none")})})});if(r){var a=NA(jA(r,e));return a.length>0&&(r=a[0]),Of(r)}else throw new Error("Selector was not found.")}function Z4(e,t){return e.nodeType===Node.DOCUMENT_NODE?e:e===t.root?e.ownerDocument:e}function hd(e,t,n){for(var r=null,a=[],o=e,l=0,c=function(){var f,m,g=new Date().getTime()-kA.getTime();if(Rr.timeoutMs!==void 0&&g>Rr.timeoutMs)throw new Error("Timeout: Can't find a unique selector after ".concat(g,"ms"));var v=md(e6(o))||md.apply(void 0,Je([],Ae(t6(o)),!1))||md.apply(void 0,Je([],Ae(n6(o)),!1))||md(r6(o))||[BE()],b=i6(o);if(t=="all")b&&(v=v.concat(v.filter(Tm).map(function(C){return pd(C,b)})));else if(t=="two")v=v.slice(0,1),b&&(v=v.concat(v.filter(Tm).map(function(C){return pd(C,b)})));else if(t=="one"){var S=Ae(v=v.slice(0,1),1),w=S[0];b&&Tm(w)&&(v=[pd(w,b)])}else t=="none"&&(v=[BE()],b&&(v=[pd(v[0],b)]));try{for(var E=(f=void 0,_e(v)),T=E.next();!T.done;T=E.next()){var w=T.value;w.level=l}}catch(C){f={error:C}}finally{try{T&&!T.done&&(m=E.return)&&m.call(E)}finally{if(f)throw f.error}}if(a.push(v),a.length>=Rr.seedMinLength&&(r=zE(a,n),r))return"break";o=o.parentElement,l++};o;){var d=c();if(d==="break")break}return r||(r=zE(a,n)),!r&&n?n():r}function zE(e,t){var n,r,a=NA(AA(e));if(a.length>Rr.threshold)return t?t():null;try{for(var o=_e(a),l=o.next();!l.done;l=o.next()){var c=l.value;if(CA(c))return c}}catch(d){n={error:d}}finally{try{l&&!l.done&&(r=o.return)&&r.call(o)}finally{if(n)throw n.error}}return null}function Of(e){for(var t=e[0],n=t.name,r=1;r<e.length;r++){var a=e[r].level||0;t.level===a-1?n="".concat(e[r].name," > ").concat(n):n="".concat(e[r].name," ").concat(n),t=e[r]}return n}function UE(e){return e.map(function(t){return t.penalty}).reduce(function(t,n){return t+n},0)}function CA(e){var t=Of(e);switch(oy.querySelectorAll(t).length){case 0:throw new Error("Can't select any node with this selector: ".concat(t));case 1:return!0;default:return!1}}function e6(e){var t=e.getAttribute("id");return t&&Rr.idName(t)?{name:"#"+CSS.escape(t),penalty:0}:null}function t6(e){var t=Array.from(e.attributes).filter(function(n){return Rr.attr(n.name,n.value)});return t.map(function(n){return{name:"[".concat(CSS.escape(n.name),'="').concat(CSS.escape(n.value),'"]'),penalty:.5}})}function n6(e){var t=Array.from(e.classList).filter(Rr.className);return t.map(function(n){return{name:"."+CSS.escape(n),penalty:1}})}function r6(e){var t=e.tagName.toLowerCase();return Rr.tagName(t)?{name:t,penalty:2}:null}function BE(){return{name:"*",penalty:3}}function i6(e){var t=e.parentNode;if(!t)return null;var n=t.firstChild;if(!n)return null;for(var r=0;n&&(n.nodeType===Node.ELEMENT_NODE&&r++,n!==e);)n=n.nextSibling;return r}function pd(e,t){return{name:e.name+":nth-child(".concat(t,")"),penalty:e.penalty+1}}function Tm(e){return e.name!=="html"&&!e.name.startsWith("#")}function md(){for(var e=[],t=0;t<arguments.length;t++)e[t]=arguments[t];var n=e.filter(a6);return n.length>0?n:null}function a6(e){return e!=null}function AA(e,t){var n,r,a,o,l,c;return t===void 0&&(t=[]),ee(this,function(d){switch(d.label){case 0:if(!(e.length>0))return[3,9];d.label=1;case 1:d.trys.push([1,6,7,8]),n=_e(e[0]),r=n.next(),d.label=2;case 2:return r.done?[3,5]:(a=r.value,[5,_e(AA(e.slice(1,e.length),t.concat(a)))]);case 3:d.sent(),d.label=4;case 4:return r=n.next(),[3,2];case 5:return[3,8];case 6:return o=d.sent(),l={error:o},[3,8];case 7:try{r&&!r.done&&(c=n.return)&&c.call(n)}finally{if(l)throw l.error}return[7];case 8:return[3,11];case 9:return[4,t];case 10:d.sent(),d.label=11;case 11:return[2]}})}function NA(e){return Je([],Ae(e),!1).sort(function(t,n){return UE(t)-UE(n)})}function jA(e,t,n){var r,a,o;return n===void 0&&(n={counter:0,visited:new Map}),ee(this,function(l){switch(l.label){case 0:if(!(e.length>2&&e.length>Rr.optimizedMinLength))return[3,5];r=1,l.label=1;case 1:return r<e.length-1?n.counter>Rr.maxNumberOfTries?[2]:(n.counter+=1,a=Je([],Ae(e),!1),a.splice(r,1),o=Of(a),n.visited.has(o)?[2]:CA(a)&&s6(a,t)?[4,a]:[3,4]):[3,5];case 2:return l.sent(),n.visited.set(o,!0),[5,_e(jA(a,t,n))];case 3:l.sent(),l.label=4;case 4:return r++,[3,1];case 5:return[2]}})}function s6(e,t){return oy.querySelector(Of(e))===t}var o6=36e5,l6=function(e){var t=e.version,n=e.events,r=[];return n.forEach(function(a){var o=JSON.parse(a);o.count=1,o.type==="click"&&r.push(o)}),{version:t,events:r}},u6=function(e){var t=e.version,n=e.events,r=[];n.forEach(function(o){var l=JSON.parse(o);l.type==="click"&&r.push(l)});var a=r.reduce(function(o,l){var c=l.x,d=l.y,f=l.selector,m=l.timestamp,g=m-m%o6,v="".concat(c,":").concat(d,":").concat(f??"",":").concat(g);return o[v]?o[v].count+=1:o[v]=ce(ce({},l),{timestamp:g,count:1}),o},{});return{version:t,events:Object.values(a)}},c6=(function(){function e(t,n){var r=this;this.createHook=function(a){var o=a.eventsManager,l=a.sessionId,c=a.deviceIdFn,d=a.mirror,f=a.ugcFilterRules,m=a.performanceOptions;return function(g){if(g.type===gA.Click){var v=ze();if(v){var b=v.location,S=v.innerHeight,w=v.innerWidth;if(b){var E=g.x,T=g.y;if(!(E===void 0||T===void 0)){var C=d.getNode(g.id),k;if(C)try{k=J4(C,m)}catch{r.logger.debug("error resolving selector from finder")}var j=Rf(b.href,f),N={x:E+r.scrollWatcher.currentScrollX,y:T+r.scrollWatcher.currentScrollY,selector:k,viewportHeight:S,viewportWidth:w,pageUrl:j,timestamp:Date.now(),type:"click"},R=c();R&&o.addEvent({sessionId:l,event:{type:"interaction",data:JSON.stringify(N)},deviceId:R})}}}}}},this.logger=t,this.scrollWatcher=n}return e})();function km(){var e=ze();return e?.innerHeight||document.documentElement&&document.documentElement.clientHeight||0}function Cm(){var e=ze();return e?.innerWidth||document.documentElement&&document.documentElement.clientWidth||0}var d6=(function(){function e(t,n){var r=ze();r&&r.navigator&&typeof r.navigator.sendBeacon=="function"?this.sendBeacon=function(a,o){try{if(r.navigator.sendBeacon(a,JSON.stringify(o)))return!0}catch{}return!1}:this.sendBeacon=function(){return!1},this.sendXhr=function(a,o){var l=new XMLHttpRequest;return l.open("POST",a,!0),l.setRequestHeader("Accept","*/*"),l.send(JSON.stringify(o)),!0},this.basePageUrl=dA(n.serverZone,n.trackServerUrl),this.apiKey=n.apiKey,this.context=t}return e.prototype.send=function(t,n){var r=this.context,a=r.sessionId,o=r.type,l=new URLSearchParams({device_id:t,session_id:String(a),type:String(o),api_key:this.apiKey}),c="".concat(this.basePageUrl,"?").concat(l.toString());this.sendBeacon(c,n)||this.sendXhr(c,n)},e})(),f6=(function(){function e(t,n){var r=this;this.timestamp=Date.now(),this.hook=function(a){r.update(a)},this.send=function(a){return function(o){var l,c,d=a(),f=ze();f&&d&&r.transport.send(d,{version:1,events:[{maxScrollX:r._maxScrollX,maxScrollY:r._maxScrollY,maxScrollWidth:r._maxScrollWidth,maxScrollHeight:r._maxScrollHeight,viewportHeight:km(),viewportWidth:Cm(),pageUrl:Rf(f.location.href,(c=(l=r.config.interactionConfig)===null||l===void 0?void 0:l.ugcFilterRules)!==null&&c!==void 0?c:[]),timestamp:r.timestamp,type:"scroll"}]})}},this._maxScrollX=0,this._maxScrollY=0,this._currentScrollX=0,this._currentScrollY=0,this._maxScrollWidth=Cm(),this._maxScrollHeight=km(),this.config=n,this.transport=t}return e.default=function(t,n){return new e(new d6(t,n),n)},Object.defineProperty(e.prototype,"maxScrollX",{get:function(){return this._maxScrollX},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"maxScrollY",{get:function(){return this._maxScrollY},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"maxScrollWidth",{get:function(){return this._maxScrollWidth},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"maxScrollHeight",{get:function(){return this._maxScrollHeight},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"currentScrollX",{get:function(){return this._currentScrollX},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"currentScrollY",{get:function(){return this._currentScrollY},enumerable:!1,configurable:!0}),e.prototype.update=function(t){var n=Date.now();if(this._currentScrollX=t.x,this._currentScrollY=t.y,t.x>this._maxScrollX){var r=Cm();this._maxScrollX=t.x;var a=t.x+r;a>this._maxScrollWidth&&(this._maxScrollWidth=a),this.timestamp=n}if(t.y>this._maxScrollY){var o=km();this._maxScrollY=t.y;var l=t.y+o;l>this._maxScrollHeight&&(this._maxScrollHeight=l),this.timestamp=n}},e})(),VE=(function(){function e(t){var n=t.sessionId,r=t.deviceId;this.deviceId=r,this.sessionId=n,n&&r&&(this.sessionReplayId=i4(n,r))}return e})(),h6=1e3*60*60*24*2,p6=(function(){function e(){var t=this;this.dbs={},this.createStore=function(n){return te(t,void 0,void 0,function(){return ee(this,function(r){switch(r.label){case 0:return[4,wA(n,1,{upgrade:function(a){a.objectStoreNames.contains("sessionTargetingMatch")||a.createObjectStore("sessionTargetingMatch",{keyPath:"sessionId"})}})];case 1:return[2,r.sent()]}})})},this.openOrCreateDB=function(n){return te(t,void 0,void 0,function(){var r,a;return ee(this,function(o){switch(o.label){case 0:return this.dbs&&this.dbs[n]?[2,this.dbs[n]]:(r="".concat(n.substring(0,10),"_amp_session_replay_targeting"),[4,this.createStore(r)]);case 1:return a=o.sent(),this.dbs[n]=a,[2,a]}})})},this.getTargetingMatchForSession=function(n){var r=n.loggerProvider,a=n.apiKey,o=n.sessionId;return te(t,void 0,void 0,function(){var l,c,d,f;return ee(this,function(m){switch(m.label){case 0:return m.trys.push([0,3,,4]),[4,this.openOrCreateDB(a)];case 1:return l=m.sent(),c=String(o),[4,l.get("sessionTargetingMatch",c)];case 2:return d=m.sent(),[2,d?.targetingMatch];case 3:return f=m.sent(),zi(r,"Failed to get targeting match for session id ".concat(o,": ").concat(f),f),[3,4];case 4:return[2,void 0]}})})},this.storeTargetingMatchForSession=function(n){var r=n.loggerProvider,a=n.apiKey,o=n.sessionId,l=n.targetingMatch;return te(t,void 0,void 0,function(){var c,d,f,m;return ee(this,function(g){switch(g.label){case 0:return g.trys.push([0,3,,4]),[4,this.openOrCreateDB(a)];case 1:return c=g.sent(),d=String(o),[4,c.put("sessionTargetingMatch",{targetingMatch:l,sessionId:d,lastUpdated:Date.now()})];case 2:return f=g.sent(),[2,f];case 3:return m=g.sent(),zi(r,"Failed to store targeting match for session id ".concat(o,": ").concat(m),m),[3,4];case 4:return[2,void 0]}})})},this.clearStoreOfOldSessions=function(n){var r=n.loggerProvider,a=n.apiKey,o=n.currentSessionId;return te(t,void 0,void 0,function(){var l,c,d,f,m,g,v,b;return ee(this,function(S){switch(S.label){case 0:return S.trys.push([0,8,,9]),[4,this.openOrCreateDB(a)];case 1:return l=S.sent(),c=String(o),d=l.transaction("sessionTargetingMatch","readwrite"),[4,d.store.getAll()];case 2:f=S.sent(),m=0,S.label=3;case 3:return m<f.length?(g=f[m],v=Date.now()-g.lastUpdated,g.sessionId!==c&&v>h6?[4,d.store.delete(g.sessionId)]:[3,5]):[3,6];case 4:S.sent(),S.label=5;case 5:return m++,[3,3];case 6:return[4,d.done];case 7:return S.sent(),[3,9];case 8:return b=S.sent(),zi(r,"Failed to clear old targeting matches for sessions: ".concat(b),b),[3,9];case 9:return[2]}})})}}return e})(),Am=new p6,m6=function(e){var t=e.sessionId,n=e.targetingConfig,r=e.loggerProvider,a=e.apiKey,o=e.targetingParams,l=e.urlChange,c=l===void 0?!1:l;return te(void 0,void 0,void 0,function(){var d,f,m,g,v,b,S;return ee(this,function(w){switch(w.label){case 0:return[4,Am.clearStoreOfOldSessions({loggerProvider:r,apiKey:a,currentSessionId:t})];case 1:return w.sent(),[4,Am.getTargetingMatchForSession({loggerProvider:r,apiKey:a,sessionId:t})];case 2:if(d=w.sent(),d===!0&&!c)return[2,!0];f=!0,w.label=3;case 3:return w.trys.push([3,6,,7]),[4,Ql(()=>import("./index-D4wqLVMN.js"),[])];case 4:return m=w.sent().evaluateTargeting,g=ce(ce({},o),{flag:n,sessionId:typeof t=="string"?parseInt(t,10):t,apiKey:a,loggerProvider:r}),[4,m(g)];case 5:return v=w.sent(),v&&v.sr_targeting_config&&(f=v.sr_targeting_config.key==="on"),Am.storeTargetingMatchForSession({loggerProvider:r,apiKey:a,sessionId:t,targetingMatch:f}),[3,7];case 6:return b=w.sent(),S=b,r.warn(S.message),[3,7];case 7:return[2,f]}})})},Nm="__amplitude_url_tracking_patched__",FE=new WeakMap;function RA(e,t,n){if(n===void 0&&(n={}),!e?.location)return function(){};var r=n.enablePolling,a=r===void 0?!1:r,o=n.pollingInterval,l=o===void 0?iy:o;if(a){var c=function(){var j;return(j=e.location.href)!==null&&j!==void 0?j:""},d=c(),f=e.setInterval(function(){var j=c();j!==d&&(d=j,t(j))},l);return function(){f!=null&&e.clearInterval(f)}}var m=FE.get(e);if(!m){var g=void 0,v=new Set,b=function(){var j;return(j=e.location.href)!==null&&j!==void 0?j:""},S=function(){var j=b();g!==void 0&&j===g||(g=j,v.forEach(function(N){return N(j)}))},w=function(j){var N=function(){for(var R=[],P=0;P<arguments.length;P++)R[P]=arguments[P];var L=j.apply(this,R);return S(),L};return N[Nm]=!0,N},E=e.history;if(E?.pushState){var T=Reflect.get(E,"pushState");T[Nm]||(E.pushState=w(T))}if(E?.replaceState){var C=Reflect.get(E,"replaceState");C[Nm]||(E.replaceState=w(C))}m={callbacks:v,notify:S,onPopStateOrHashChange:function(){return S()},listenersAttached:!1},FE.set(e,m)}var k=m;return k.listenersAttached||(e.addEventListener("popstate",k.onPopStateOrHashChange),e.addEventListener("hashchange",k.onPopStateOrHashChange),k.listenersAttached=!0),k.callbacks.add(t),function(){k.callbacks.delete(t),k.callbacks.size===0&&k.listenersAttached&&(e.removeEventListener("popstate",k.onPopStateOrHashChange),e.removeEventListener("hashchange",k.onPopStateOrHashChange),k.listenersAttached=!1)}}function _A(e){return e===void 0&&(e={}),{name:"amplitude/url-tracking@1",observer:function(t,n,r){var a,o,l,c=ce(ce({},e),r),d=c.ugcFilterRules||[],f=(a=c.enablePolling)!==null&&a!==void 0?a:!1,m=(o=c.pollingInterval)!==null&&o!==void 0?o:iy,g=(l=c.captureDocumentTitle)!==null&&l!==void 0?l:!1;if(!n)return function(){};var v=void 0,b=function(){return n.location&&n.location.href||""},S=function(){var T=n.innerHeight,C=n.innerWidth,k=n.document,j=b(),N="";g&&(N=k?.title||"");var R=d.length>0?Rf(j,d):j;return{href:R,title:N,viewportHeight:T,viewportWidth:C,type:"url-change-event"}},w=function(){var T=b();if(v===void 0||T!==v){v=T;var C=S();t(C)}},E=RA(n,function(){return w()},f?{enablePolling:!0,pollingInterval:m}:{});return w(),function(){return E()}},options:e}}_A();var g6=(function(){function e(){var t=this;this.name="@amplitude/session-replay-browser",this.recordCancelCallback=null,this.eventCount=0,this.sessionTargetingMatch=!1,this.pageLeaveFns=[],this.recordFunction=null,this.urlChangeCleanup=null,this.latestUrlChangeTargetingEvaluationId=0,this.teardownEventListeners=function(n){var r=ze();r&&(r.removeEventListener("blur",t.blurListener),r.removeEventListener("focus",t.focusListener),!n&&r.addEventListener("blur",t.blurListener),!n&&r.addEventListener("focus",t.focusListener),r.self&&"onpagehide"in r.self?(r.removeEventListener("pagehide",t.pageLeaveListener),!n&&r.addEventListener("pagehide",t.pageLeaveListener)):(r.removeEventListener("beforeunload",t.pageLeaveListener),!n&&r.addEventListener("beforeunload",t.pageLeaveListener)))},this.blurListener=function(){t.sendEvents()},this.focusListener=function(){t.recordEvents(!1)},this.pageLeaveListener=function(n){t.pageLeaveFns.forEach(function(r){r(n)})},this.evaluateTargetingAndCapture=function(n,r,a,o){return r===void 0&&(r=!1),a===void 0&&(a=!1),o===void 0&&(o=!1),te(t,void 0,void 0,function(){var l,c,d,f,m,g,v,b,S,w,E,T,C;return ee(this,function(k){switch(k.label){case 0:if(!this.identifiers||!this.identifiers.sessionId||!this.config)return this.identifiers&&!this.identifiers.sessionId?this.loggerProvider.log("Session ID has not been set yet, cannot evaluate targeting for Session Replay."):this.loggerProvider.warn("Session replay init has not been called, cannot evaluate targeting."),[2];if(!this.config.targetingConfig)if(r)this.loggerProvider.log("Targeting config has not been set yet, cannot evaluate targeting.");else return this.loggerProvider.log("No targeting config set, skipping initialization/recording for event."),[2];return this.lastTargetingParams=n,l=this.config.targetingConfig,c=l&&!this.sessionTargetingMatch,c?(d=o?this.latestUrlChangeTargetingEvaluationId:void 0,f=n.event,f&&Object.values(sr).includes(f.event_type)&&(f=void 0),m=(T=(S=(b=n.page)===null||b===void 0?void 0:b.url)!==null&&S!==void 0?S:(E=(w=ze())===null||w===void 0?void 0:w.location)===null||E===void 0?void 0:E.href)!==null&&T!==void 0?T:"",g=(C=n.page)!==null&&C!==void 0?C:m!==""?{url:m}:void 0,[4,m6({sessionId:this.identifiers.sessionId,targetingConfig:l,loggerProvider:this.loggerProvider,apiKey:this.config.apiKey,targetingParams:{userProperties:n.userProperties,event:f,page:g},urlChange:o})]):[3,2];case 1:if(v=k.sent(),o&&d!==void 0&&d!==this.latestUrlChangeTargetingEvaluationId)return this.loggerProvider.debug("Ignoring stale URL-change targeting result #".concat(d,"; latest is #").concat(this.latestUrlChangeTargetingEvaluationId,".")),[2];this.sessionTargetingMatch=this.sessionTargetingMatch||v,this.loggerProvider.debug(JSON.stringify({name:"targeted replay capture config",sessionTargetingMatch:this.sessionTargetingMatch,event:f,targetingParams:n},null,2)),k.label=2;case 2:return r?(this.initialize(!0),[3,5]):[3,3];case 3:return a||!this.recordCancelCallback?(this.loggerProvider.log("Recording events for session due to forceRestart or no ongoing recording."),[4,this.recordEvents()]):[3,5];case 4:k.sent(),k.label=5;case 5:return[2]}})})},this.addCustomRRWebEvent=function(n,r,a){return r===void 0&&(r={}),a===void 0&&(a=!0),te(t,void 0,void 0,function(){var o,l,c,d;return ee(this,function(f){switch(f.label){case 0:return f.trys.push([0,3,,4]),o=void 0,l=this.config,l&&n!==ya.METADATA?(o={config:hA(l),version:Mg},a?[4,fA()]:[3,2]):[3,2];case 1:c=f.sent(),o=ce(ce({},c),o),f.label=2;case 2:return this.recordCancelCallback&&this.recordFunction?this.recordFunction.addCustomEvent(n,ce(ce({},r),o)):this.loggerProvider.debug("Not able to add custom replay capture event ".concat(n," due to no ongoing recording.")),[3,4];case 3:return d=f.sent(),this.loggerProvider.debug("Error while adding custom replay capture event: ",d),[3,4];case 4:return[2]}})})},this.stopRecordingEvents=function(){var n;try{t.loggerProvider.log("Session Replay capture stopping."),t.recordCancelCallback&&t.recordCancelCallback(),t.recordCancelCallback=null,(n=t.networkObservers)===null||n===void 0||n.stop()}catch(a){var r=a;t.loggerProvider.warn("Error occurred while stopping replay capture: ".concat(r.toString()))}},this.loggerProvider=new Ag(new ko)}return e.prototype.init=function(t,n){return Sn(this._init(t,n))},e.prototype.setupUrlChangeListenerForTargeting=function(){var t=this,n;(n=this.urlChangeCleanup)===null||n===void 0||n.call(this);var r=ze();if(r?.location){var a=function(l){var c=++t.latestUrlChangeTargetingEvaluationId;t.evaluateTargetingAndCapture({userProperties:{},event:void 0,page:{url:l}},!1,!1,!0),t.loggerProvider.debug("Queued URL-change targeting re-evaluation #".concat(c," for ").concat(l,"."))},o=RA(r,a);this.urlChangeCleanup=function(){o(),t.urlChangeCleanup=null}}},e.prototype.getCurrentPageForTargeting=function(){var t,n,r=(n=(t=ze())===null||t===void 0?void 0:t.location)===null||n===void 0?void 0:n.href;return r!=null?{url:r}:void 0},e.prototype._init=function(t,n){var r,a,o,l,c,d,f,m;return te(this,void 0,void 0,function(){var g,v,b,S,w,E,T,C,k,j,L,N,R,P,L,H,D,B,K;return ee(this,function(se){switch(se.label){case 0:return(r=this.urlChangeCleanup)===null||r===void 0||r.call(this),this.loggerProvider=new Ag(n.loggerProvider||new ko),Object.prototype.hasOwnProperty.call(n,"logLevel")&&this.loggerProvider.enable(n.logLevel),this.identifiers=new VE({sessionId:n.sessionId,deviceId:n.deviceId}),g=this,[4,h4(t,n)];case 1:return g.joinedConfigGenerator=se.sent(),[4,this.joinedConfigGenerator.generateJoinedConfig()];case 2:v=se.sent(),b=v.joinedConfig,S=v.localConfig,w=v.remoteConfig,this.config=b,this.setMetadata(n.sessionId,b,S,w,(a=n.version)===null||a===void 0?void 0:a.version,Mg,(o=n.version)===null||o===void 0?void 0:o.type),n.sessionId&&(!((l=this.config.interactionConfig)===null||l===void 0)&&l.enabled)&&(E=f6.default({sessionId:n.sessionId,type:"interaction"},this.config),this.pageLeaveFns=[E.send(this.getDeviceId.bind(this)).bind(E)],this.scrollHook=E.hook.bind(E),this.clickHandler=new c6(this.loggerProvider,E)),T=[],C=this.config.storeType,C==="idb"&&!(!((c=ze())===null||c===void 0)&&c.indexedDB)&&(C="memory",this.loggerProvider.warn("Could not use preferred indexedDB storage, reverting to in memory option.")),this.loggerProvider.log("Using ".concat(C," for event storage.")),se.label=3;case 3:return se.trys.push([3,5,,6]),[4,PE({config:this.config,type:"replay",storeType:C})];case 4:return k=se.sent(),T.push({name:"replay",manager:k}),[3,6];case 5:return j=se.sent(),L=j,this.loggerProvider.warn("Error occurred while creating replay events manager: ".concat(L.toString())),[3,6];case 6:if(!(!((d=this.config.interactionConfig)===null||d===void 0)&&d.enabled))return[3,10];N=this.config.interactionConfig.batch?u6:l6,se.label=7;case 7:return se.trys.push([7,9,,10]),[4,PE({config:this.config,type:"interaction",minInterval:(f=this.config.interactionConfig.trackEveryNms)!==null&&f!==void 0?f:WL,maxInterval:XL,payloadBatcher:N,storeType:C})];case 8:return R=se.sent(),T.push({name:"interaction",manager:R}),[3,10];case 9:return P=se.sent(),L=P,this.loggerProvider.warn("Error occurred while creating interaction events manager: ".concat(L.toString())),[3,10];case 10:return this.eventsManager=new(LE.bind.apply(LE,Je([void 0],Ae(T),!1))),this.eventCompressor&&this.eventCompressor.terminate(),H=void 0,D=ze(),this.config.useWebWorker&&D&&D.Worker?[4,Ql(()=>import("./index-D7Bf6Say.js"),[])]:[3,12];case 11:B=se.sent().compressionScript,H=B,se.label=12;case 12:return this.eventCompressor=new R4(this.eventsManager,this.config,this.getDeviceId(),H),[4,this.initializeNetworkObservers()];case 13:return se.sent(),!((m=ze())===null||m===void 0)&&m.opener&&(K=TC(),kC(K),K.setup(ce({logger:this.loggerProvider},this.config.serverZone&&{endpoint:wC[this.config.serverZone]}))),this.loggerProvider.log("Installing @amplitude/session-replay-browser."),this.teardownEventListeners(!1),[4,this.evaluateTargetingAndCapture({userProperties:n.userProperties,page:this.getCurrentPageForTargeting()},!0)];case 14:return se.sent(),this.config.targetingConfig&&this.setupUrlChangeListenerForTargeting(),[2]}})})},e.prototype.setSessionId=function(t,n){return Sn(this.asyncSetSessionId(t,n))},e.prototype.asyncSetSessionId=function(t,n,r){var a;return te(this,void 0,void 0,function(){var o,l,c;return ee(this,function(d){switch(d.label){case 0:return this.latestUrlChangeTargetingEvaluationId++,this.sessionTargetingMatch=!1,this.lastShouldRecordDecision=void 0,o=this.identifiers&&this.identifiers.sessionId,o&&this.sendEvents(o),l=n||this.getDeviceId(),this.identifiers=new VE({sessionId:t,deviceId:l}),this.joinedConfigGenerator&&o?[4,this.joinedConfigGenerator.generateJoinedConfig()]:[3,2];case 1:c=d.sent().joinedConfig,this.config=c,d.label=2;case 2:return!((a=this.config)===null||a===void 0)&&a.targetingConfig?[4,this.evaluateTargetingAndCapture({userProperties:r?.userProperties,page:this.getCurrentPageForTargeting()},!1,!0)]:[3,4];case 3:return d.sent(),[3,6];case 4:return[4,this.recordEvents()];case 5:d.sent(),d.label=6;case 6:return[2]}})})},e.prototype.getSessionReplayProperties=function(){var t,n=this.config,r=this.identifiers;if(!n||!r)return this.loggerProvider.warn("Session replay init has not been called, cannot get session replay properties."),{};var a=this.getShouldRecord(),o={};return a&&(o=(t={},t[zL]=r.sessionReplayId?r.sessionReplayId:null,t),n.debugMode&&(o[FL]=JSON.stringify({appHash:tf(n.apiKey).toString()}))),this.addCustomRRWebEvent(ya.GET_SR_PROPS,{shouldRecord:a,eventProperties:o},this.eventCount===10),this.eventCount===10&&(this.eventCount=0),this.eventCount++,o},e.prototype.sendEvents=function(t){var n,r=t||((n=this.identifiers)===null||n===void 0?void 0:n.sessionId),a=this.getDeviceId();this.eventsManager&&r&&a&&this.eventsManager.sendCurrentSequenceEvents({sessionId:r,deviceId:a})},e.prototype.initialize=function(t){var n;return t===void 0&&(t=!1),te(this,void 0,void 0,function(){var r;return ee(this,function(a){return!((n=this.identifiers)===null||n===void 0)&&n.sessionId?(r=this.getDeviceId(),r?(this.eventsManager&&t&&this.eventsManager.sendStoredEvents({deviceId:r}),[2,this.recordEvents()]):(this.loggerProvider.log("Session is not being recorded due to lack of device id."),[2,Promise.resolve()])):(this.loggerProvider.log("Session is not being recorded due to lack of session id."),[2,Promise.resolve()])})})},e.prototype.shouldOptOut=function(){var t,n,r;if(!((t=this.config)===null||t===void 0)&&t.instanceName){var a=Co(this.config.instanceName).identityStore;r=a.getIdentity().optOut}return r!==void 0?r:(n=this.config)===null||n===void 0?void 0:n.optOut},e.prototype.getShouldRecord=function(){if(!this.identifiers||!this.config||!this.identifiers.sessionId)return this.loggerProvider.warn("Session is not being recorded due to lack of config, please call sessionReplay.init."),!1;if(!this.config.captureEnabled)return this.loggerProvider.log("Session ".concat(this.identifiers.sessionId," not being captured due to capture being disabled for project or because the remote config could not be fetched.")),!1;if(this.shouldOptOut())return this.loggerProvider.log("Opting session ".concat(this.identifiers.sessionId," out of recording due to optOut config.")),!1;var t=!1,n="",r=!1;if(this.config.targetingConfig)this.sessionTargetingMatch?(n="Capturing replays for session ".concat(this.identifiers.sessionId," due to matching targeting conditions."),this.loggerProvider.log(n),t=!0,r=!0):(n="Not capturing replays for session ".concat(this.identifiers.sessionId," due to not matching targeting conditions."),this.loggerProvider.log(n),t=!1,r=!1);else{var a=tI(this.identifiers.sessionId,this.config.sampleRate);a?(t=!0,r=!0):(n="Opting session ".concat(this.identifiers.sessionId," out of recording due to sample rate."),this.loggerProvider.log(n),t=!1,r=!1)}return this.lastShouldRecordDecision!==t&&this.config.targetingConfig&&(this.addCustomRRWebEvent(ya.TARGETING_DECISION,{message:n,sessionId:this.identifiers.sessionId,matched:r,targetingParams:this.lastTargetingParams}),this.lastShouldRecordDecision=t),t},e.prototype.getBlockSelectors=function(){var t,n,r,a=(r=(n=(t=this.config)===null||t===void 0?void 0:t.privacyConfig)===null||n===void 0?void 0:n.blockSelector)!==null&&r!==void 0?r:[];if(a.length!==0)return a},e.prototype.getMaskTextSelectors=function(){var t,n,r,a;if(((n=(t=this.config)===null||t===void 0?void 0:t.privacyConfig)===null||n===void 0?void 0:n.defaultMaskLevel)==="conservative")return"*";var o=(a=(r=this.config)===null||r===void 0?void 0:r.privacyConfig)===null||a===void 0?void 0:a.maskSelector;if(o)return o},e.prototype.getRecordingPlugins=function(t){var n,r,a,o,l,c;return te(this,void 0,void 0,function(){var d,f,m,g;return ee(this,function(v){switch(v.label){case 0:d=[];try{f=_A({ugcFilterRules:((r=(n=this.config)===null||n===void 0?void 0:n.interactionConfig)===null||r===void 0?void 0:r.ugcFilterRules)||[],enablePolling:((a=this.config)===null||a===void 0?void 0:a.enableUrlChangePolling)||!1,pollingInterval:(o=this.config)===null||o===void 0?void 0:o.urlChangePollingInterval,captureDocumentTitle:(l=this.config)===null||l===void 0?void 0:l.captureDocumentTitle}),d.push(f)}catch(b){this.loggerProvider.warn("Failed to create URL tracking plugin:",b)}if(!(!((c=t?.console)===null||c===void 0)&&c.enabled))return[3,4];v.label=1;case 1:return v.trys.push([1,3,,4]),[4,Ql(()=>import("./rrweb-plugin-console-record-sPdhR0i8.js"),[])];case 2:return m=v.sent().getRecordConsolePlugin,d.push(m({level:t.console.levels})),[3,4];case 3:return g=v.sent(),this.loggerProvider.warn("Failed to load console plugin:",g),[3,4];case 4:return[2,d.length>0?d:void 0]}})})},e.prototype.getRecordFunction=function(){return te(this,void 0,void 0,function(){var t,n;return ee(this,function(r){switch(r.label){case 0:if(this.recordFunction)return[2,this.recordFunction];r.label=1;case 1:return r.trys.push([1,3,,4]),[4,Ql(()=>import("./rrweb-record-CMVXB7aO.js"),[])];case 2:return t=r.sent().record,this.recordFunction=t,[2,t];case 3:return n=r.sent(),this.loggerProvider.warn("Failed to load rrweb-record module:",n),[2,null];case 4:return[2]}})})},e.prototype.recordEvents=function(t){var n,r,a,o,l,c,d;return t===void 0&&(t=!0),te(this,void 0,void 0,function(){var f,m,g,v,b,S,w,E,T,C,k,j,N,R=this;return ee(this,function(P){switch(P.label){case 0:return f=this.config,m=this.getShouldRecord(),g=(n=this.identifiers)===null||n===void 0?void 0:n.sessionId,!m||!g||!f?[2]:(this.stopRecordingEvents(),[4,this.getRecordFunction()]);case 1:return v=P.sent(),v?[4,this.initializeNetworkObservers()]:[2];case 2:P.sent(),(r=this.networkObservers)===null||r===void 0||r.start(function(L){R.addCustomRRWebEvent(ya.FETCH_REQUEST,L)}),b=f.privacyConfig,S=f.interactionConfig,w=f.loggingConfig,E=S?.enabled?{mouseInteraction:this.eventsManager&&((a=this.clickHandler)===null||a===void 0?void 0:a.createHook({eventsManager:this.eventsManager,sessionId:g,deviceIdFn:this.getDeviceId.bind(this),mirror:v.mirror,ugcFilterRules:(o=S.ugcFilterRules)!==null&&o!==void 0?o:[],performanceOptions:(l=f.performanceConfig)===null||l===void 0?void 0:l.interaction})),scroll:this.scrollHook}:{},T=S?.enabled&&S.ugcFilterRules?S.ugcFilterRules:[],this.loggerProvider.log("Session Replay capture beginning for ".concat(g,".")),P.label=3;case 3:return P.trys.push([3,5,,6]),C=this,k=v,N={emit:function(L){if(R.shouldOptOut()){R.loggerProvider.log("Opting session ".concat(g," out of recording due to optOut config.")),R.stopRecordingEvents(),R.sendEvents();return}L.type===mA.Meta&&(L.data.href=Rf(L.data.href,T)),R.eventCompressor&&R.eventCompressor.enqueueEvent(L,g)},inlineStylesheet:f.shouldInlineStylesheet,hooks:E,maskAllInputs:!0,maskTextClass:lA,blockClass:HL,blockSelector:this.getBlockSelectors(),applyBackgroundColorToBlockedElements:f.applyBackgroundColorToBlockedElements,maskInputFn:TE("input",b),maskTextFn:TE("text",b),maskTextSelector:this.getMaskTextSelectors(),recordCanvas:!1,slimDOMOptions:{script:(c=f.omitElementTags)===null||c===void 0?void 0:c.script,comment:(d=f.omitElementTags)===null||d===void 0?void 0:d.comment},errorHandler:function(L){var H=L;if(H.message.includes("insertRule")&&H.message.includes("CSSStyleSheet")||H._external_)throw H;return R.loggerProvider.warn("Error while capturing replay: ",H.toString()),!0}},[4,this.getRecordingPlugins(w)];case 4:return C.recordCancelCallback=k.apply(void 0,[(N.plugins=P.sent(),N)]),this.addCustomRRWebEvent(ya.DEBUG_INFO),t&&this.addCustomRRWebEvent(ya.METADATA,this.metadata),[3,6];case 5:return j=P.sent(),this.loggerProvider.warn("Failed to initialize session replay:",j),[3,6];case 6:return[2]}})})},e.prototype.getDeviceId=function(){var t;return(t=this.identifiers)===null||t===void 0?void 0:t.deviceId},e.prototype.getSessionId=function(){var t;return(t=this.identifiers)===null||t===void 0?void 0:t.sessionId},e.prototype.flush=function(t){var n;return t===void 0&&(t=!1),te(this,void 0,void 0,function(){return ee(this,function(r){return[2,(n=this.eventsManager)===null||n===void 0?void 0:n.flush(t)]})})},e.prototype.shutdown=function(){var t;(t=this.urlChangeCleanup)===null||t===void 0||t.call(this),this.teardownEventListeners(!0),this.stopRecordingEvents(),this.sendEvents()},e.prototype.mapSDKType=function(t){return t==="plugin"?"@amplitude/plugin-session-replay-browser":t==="segment"?"@amplitude/segment-session-replay-plugin":null},e.prototype.setMetadata=function(t,n,r,a,o,l,c){var d=t?.toString()?tf(t.toString()):void 0;this.metadata={joinedConfig:n,localConfig:r,remoteConfig:a,sessionId:t,hashValue:d,sampleRate:n.sampleRate,replaySDKType:this.mapSDKType(c),replaySDKVersion:o,standaloneSDKType:"@amplitude/session-replay-browser",standaloneSDKVersion:l}},e.prototype.initializeNetworkObservers=function(){var t,n,r;return te(this,void 0,void 0,function(){var a,o;return ee(this,function(l){switch(l.label){case 0:if(!(!((r=(n=(t=this.config)===null||t===void 0?void 0:t.loggingConfig)===null||n===void 0?void 0:n.network)===null||r===void 0)&&r.enabled&&!this.networkObservers))return[3,4];l.label=1;case 1:return l.trys.push([1,3,,4]),[4,Ql(()=>import("./observers-B7MfWiIZ.js"),[])];case 2:return a=l.sent().NetworkObservers,this.networkObservers=new a,[3,4];case 3:return o=l.sent(),this.loggerProvider.warn("Failed to import or instantiate NetworkObservers:",o),[3,4];case 4:return[2]}})})},e})(),ts=function(e){return function(){var t=e.config,n=t||pA(),r=n.loggerProvider,a=n.logLevel;return{logger:r,logLevel:a}}},v6=function(){var e=new g6;return{init:it(e.init.bind(e),"init",ts(e)),evaluateTargetingAndCapture:it(e.evaluateTargetingAndCapture.bind(e),"evaluateTargetingAndRecord",ts(e)),setSessionId:it(e.setSessionId.bind(e),"setSessionId",ts(e)),getSessionId:it(e.getSessionId.bind(e),"getSessionId",ts(e)),getSessionReplayProperties:it(e.getSessionReplayProperties.bind(e),"getSessionReplayProperties",ts(e)),flush:it(e.flush.bind(e),"flush",ts(e)),shutdown:it(e.shutdown.bind(e),"shutdown",ts(e))}};const vs=v6();var y6=vs.init,b6=vs.setSessionId,x6=vs.getSessionId,S6=vs.getSessionReplayProperties,w6=vs.flush,E6=vs.shutdown,T6=vs.evaluateTargetingAndCapture,k6=function(e){return e===void 0&&(e="$default_instance"),Gv.getInstance(e)},ba;(function(e){e.SET="$set",e.SET_ONCE="$setOnce",e.ADD="$add",e.APPEND="$append",e.PREPEND="$prepend",e.REMOVE="$remove",e.PREINSERT="$preInsert",e.POSTINSERT="$postInsert",e.UNSET="$unset",e.CLEAR_ALL="$clearAll"})(ba||(ba={}));var HE;(function(e){e.REVENUE_PRODUCT_ID="$productId",e.REVENUE_QUANTITY="$quantity",e.REVENUE_PRICE="$price",e.REVENUE_TYPE="$revenueType",e.REVENUE_CURRENCY="$currency",e.REVENUE="$revenue"})(HE||(HE={}));var qE;(function(e){e.IDENTIFY="$identify",e.GROUP_IDENTIFY="$groupidentify",e.REVENUE="revenue_amount"})(qE||(qE={}));var C6=[ba.SET,ba.SET_ONCE,ba.ADD,ba.APPEND,ba.PREPEND,ba.POSTINSERT],A6=function(e){if(e.user_properties){var t={},n=Object.keys(e.user_properties);return n.forEach(function(r){if(C6.includes(r)){var a=e.user_properties&&e.user_properties[r];t=ce(ce({},t),a)}}),t}},GE="1.26.0",N6="[Amplitude]",j6="".concat(N6," Session Replay ID"),Ug=(function(){function e(t){this.name=e.pluginName,this.type="enrichment",this.config=null,this.sessionReplay={flush:w6,getSessionId:x6,getSessionReplayProperties:S6,init:y6,setSessionId:b6,shutdown:E6,evaluateTargetingAndCapture:T6},this.options=ce({forceSessionTracking:!1},t),this.srInitOptions=this.options}return e.prototype.setup=function(t,n){var r,a,o,l,c,d,f,m;return te(this,void 0,void 0,function(){var g,v,b;return ee(this,function(S){switch(S.label){case 0:return S.trys.push([0,2,,3]),t?.loggerProvider.log("Installing @amplitude/plugin-session-replay, version ".concat(GE,".")),this.config=t,this.options.forceSessionTracking&&(typeof t.defaultTracking=="boolean"?t.defaultTracking===!1&&(t.defaultTracking={pageViews:!1,formInteractions:!1,fileDownloads:!1,sessions:!0}):t.defaultTracking=ce(ce({},t.defaultTracking),{sessions:!0})),g=k6(this.config.instanceName).identityStore,v=g.getIdentity().userProperties,this.srInitOptions={instanceName:this.config.instanceName,deviceId:(r=this.options.deviceId)!==null&&r!==void 0?r:this.config.deviceId,optOut:this.config.optOut,sessionId:this.options.customSessionId?void 0:this.config.sessionId,loggerProvider:this.config.loggerProvider,logLevel:this.config.logLevel,flushMaxRetries:this.config.flushMaxRetries,serverZone:this.config.serverZone,configServerUrl:this.options.configServerUrl||((a=this.config.remoteConfig)===null||a===void 0?void 0:a.serverUrl),trackServerUrl:this.options.trackServerUrl,sampleRate:this.options.sampleRate,privacyConfig:{blockSelector:(o=this.options.privacyConfig)===null||o===void 0?void 0:o.blockSelector,maskSelector:(l=this.options.privacyConfig)===null||l===void 0?void 0:l.maskSelector,unmaskSelector:(c=this.options.privacyConfig)===null||c===void 0?void 0:c.unmaskSelector,defaultMaskLevel:(d=this.options.privacyConfig)===null||d===void 0?void 0:d.defaultMaskLevel},debugMode:this.options.debugMode,shouldInlineStylesheet:this.options.shouldInlineStylesheet,version:{type:"plugin",version:GE},performanceConfig:this.options.performanceConfig,storeType:this.options.storeType,useWebWorker:(f=this.options.useWebWorker)!==null&&f!==void 0?f:(m=this.options.experimental)===null||m===void 0?void 0:m.useWebWorker,userProperties:v,omitElementTags:this.options.omitElementTags,applyBackgroundColorToBlockedElements:this.options.applyBackgroundColorToBlockedElements,interactionConfig:this.options.interactionConfig,captureDocumentTitle:this.options.captureDocumentTitle,enableUrlChangePolling:this.options.enableUrlChangePolling,urlChangePollingInterval:this.options.urlChangePollingInterval},[4,this.sessionReplay.init(t.apiKey,this.srInitOptions).promise];case 1:return S.sent(),[3,3];case 2:return b=S.sent(),t?.loggerProvider.error("Session Replay: Failed to initialize due to ".concat(b.message)),[3,3];case 3:return[2]}})})},e.prototype.onSessionIdChanged=function(t){var n;return te(this,void 0,void 0,function(){return ee(this,function(r){switch(r.label){case 0:return(n=this.config)===null||n===void 0||n.loggerProvider.debug("Analytics session id is changed to ".concat(t,", SR session id is ").concat(String(this.sessionReplay.getSessionId()),".")),[4,this.sessionReplay.setSessionId(t).promise];case 1:return r.sent(),[2]}})})},e.prototype.onOptOutChanged=function(t){var n;return te(this,void 0,void 0,function(){var r;return ee(this,function(a){switch(a.label){case 0:return(n=this.config)===null||n===void 0||n.loggerProvider.debug("optOut is changed to ".concat(String(t),", calling ").concat(t?"sessionReplay.shutdown()":"sessionReplay.init()",".")),t?(this.sessionReplay.shutdown(),[3,4]):[3,1];case 1:return r=this.config!=null,r?[4,this.sessionReplay.init(this.config.apiKey,this.srInitOptions).promise]:[3,3];case 2:r=a.sent(),a.label=3;case 3:a.label=4;case 4:return[2]}})})},e.prototype.execute=function(t){var n,r,a;return te(this,void 0,void 0,function(){var o,d,o,l,c,d,f;return ee(this,function(m){switch(m.label){case 0:return m.trys.push([0,9,,10]),this.options.customSessionId?(o=this.options.customSessionId(t),o?o===this.sessionReplay.getSessionId()?[3,2]:[4,this.sessionReplay.setSessionId(o).promise]:[3,3]):[3,4];case 1:m.sent(),m.label=2;case 2:d=this.sessionReplay.getSessionReplayProperties(),t.event_properties=ce(ce({},t.event_properties),d),m.label=3;case 3:return[3,8];case 4:return o=(n=this.config)===null||n===void 0?void 0:n.sessionId,o&&o!==this.sessionReplay.getSessionId()?[4,this.sessionReplay.setSessionId(o).promise]:[3,6];case 5:m.sent(),m.label=6;case 6:return o&&o===t.session_id?(l=void 0,t.event_type===sr.IDENTIFY&&(l=A6(t)),c=ze(),[4,this.sessionReplay.evaluateTargetingAndCapture({event:t,userProperties:l,page:((r=c?.location)===null||r===void 0?void 0:r.href)!=null?{url:c.location.href}:void 0})]):[3,8];case 7:m.sent(),d=this.sessionReplay.getSessionReplayProperties(),t.event_properties=ce(ce({},t.event_properties),d),m.label=8;case 8:return t.event_type===sr.IDENTIFY&&t.event_properties&&delete t.event_properties[j6],[2,Promise.resolve(t)];case 9:return f=m.sent(),(a=this.config)===null||a===void 0||a.loggerProvider.error("Session Replay: Failed to enrich event due to ".concat(f.message)),[2,Promise.resolve(t)];case 10:return[2]}})})},e.prototype.teardown=function(){var t;return te(this,void 0,void 0,function(){return ee(this,function(n){try{this.sessionReplay.shutdown(),this.config=null}catch(r){(t=this.config)===null||t===void 0||t.loggerProvider.error("Session Replay: teardown failed due to ".concat(r.message))}return[2]})})},e.prototype.getSessionReplayProperties=function(){return this.sessionReplay.getSessionReplayProperties()},e.pluginName="@amplitude/plugin-session-replay-browser",e})(),R6=function(e){return new Ug(e)},Bg=function(e,t){return Bg=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(n,r){n.__proto__=r}||function(n,r){for(var a in r)Object.prototype.hasOwnProperty.call(r,a)&&(n[a]=r[a])},Bg(e,t)};function OA(e,t){if(typeof t!="function"&&t!==null)throw new TypeError("Class extends value "+String(t)+" is not a constructor or null");Bg(e,t);function n(){this.constructor=e}e.prototype=t===null?Object.create(t):(n.prototype=t.prototype,new n)}var Sa=function(){return Sa=Object.assign||function(t){for(var n,r=1,a=arguments.length;r<a;r++){n=arguments[r];for(var o in n)Object.prototype.hasOwnProperty.call(n,o)&&(t[o]=n[o])}return t},Sa.apply(this,arguments)};function MA(e,t,n,r){function a(o){return o instanceof n?o:new n(function(l){l(o)})}return new(n||(n=Promise))(function(o,l){function c(m){try{f(r.next(m))}catch(g){l(g)}}function d(m){try{f(r.throw(m))}catch(g){l(g)}}function f(m){m.done?o(m.value):a(m.value).then(c,d)}f((r=r.apply(e,[])).next())})}function DA(e,t){var n={label:0,sent:function(){if(o[0]&1)throw o[1];return o[1]},trys:[],ops:[]},r,a,o,l=Object.create((typeof Iterator=="function"?Iterator:Object).prototype);return l.next=c(0),l.throw=c(1),l.return=c(2),typeof Symbol=="function"&&(l[Symbol.iterator]=function(){return this}),l;function c(f){return function(m){return d([f,m])}}function d(f){if(r)throw new TypeError("Generator is already executing.");for(;l&&(l=0,f[0]&&(n=0)),n;)try{if(r=1,a&&(o=f[0]&2?a.return:f[0]?a.throw||((o=a.return)&&o.call(a),0):a.next)&&!(o=o.call(a,f[1])).done)return o;switch(a=0,o&&(f=[f[0]&2,o.value]),f[0]){case 0:case 1:o=f;break;case 4:return n.label++,{value:f[1],done:!1};case 5:n.label++,a=f[1],f=[0];continue;case 7:f=n.ops.pop(),n.trys.pop();continue;default:if(o=n.trys,!(o=o.length>0&&o[o.length-1])&&(f[0]===6||f[0]===2)){n=0;continue}if(f[0]===3&&(!o||f[1]>o[0]&&f[1]<o[3])){n.label=f[1];break}if(f[0]===6&&n.label<o[1]){n.label=o[1],o=f;break}if(o&&n.label<o[2]){n.label=o[2],n.ops.push(f);break}o[2]&&n.ops.pop(),n.trys.pop();continue}f=t.call(e,n)}catch(m){f=[6,m],a=0}finally{r=o=0}if(f[0]&5)throw f[1];return{value:f[0]?f[1]:void 0,done:!0}}}function Tr(e){var t=typeof Symbol=="function"&&Symbol.iterator,n=t&&e[t],r=0;if(n)return n.call(e);if(e&&typeof e.length=="number")return{next:function(){return e&&r>=e.length&&(e=void 0),{value:e&&e[r++],done:!e}}};throw new TypeError(t?"Object is not iterable.":"Symbol.iterator is not defined.")}function ly(e,t){var n=typeof Symbol=="function"&&e[Symbol.iterator];if(!n)return e;var r=n.call(e),a,o=[],l;try{for(;(t===void 0||t-- >0)&&!(a=r.next()).done;)o.push(a.value)}catch(c){l={error:c}}finally{try{a&&!a.done&&(n=r.return)&&n.call(r)}finally{if(l)throw l.error}}return o}function uy(e,t,n){if(arguments.length===2)for(var r=0,a=t.length,o;r<a;r++)(o||!(r in t))&&(o||(o=Array.prototype.slice.call(t,0,r)),o[r]=t[r]);return e.concat(o||Array.prototype.slice.call(t))}var Re={IS:"is",IS_NOT:"is not",CONTAINS:"contains",DOES_NOT_CONTAIN:"does not contain",LESS_THAN:"less",LESS_THAN_EQUALS:"less or equal",GREATER_THAN:"greater",GREATER_THAN_EQUALS:"greater or equal",VERSION_LESS_THAN:"version less",VERSION_LESS_THAN_EQUALS:"version less or equal",VERSION_GREATER_THAN:"version greater",VERSION_GREATER_THAN_EQUALS:"version greater or equal",SET_IS:"set is",SET_IS_NOT:"set is not",SET_CONTAINS:"set contains",SET_DOES_NOT_CONTAIN:"set does not contain",SET_CONTAINS_ANY:"set contains any",SET_DOES_NOT_CONTAIN_ANY:"set does not contain any",REGEX_MATCH:"regex match",REGEX_DOES_NOT_MATCH:"regex does not match"},_6=function(e){for(var t=[],n=0,r=0;r<e.length;r++){var a=e.charCodeAt(r);a<128?t[n++]=a:a<2048?(t[n++]=a>>6|192,t[n++]=a&63|128):(a&64512)==55296&&r+1<e.length&&(e.charCodeAt(r+1)&64512)==56320?(a=65536+((a&1023)<<10)+(e.charCodeAt(++r)&1023),t[n++]=a>>18|240,t[n++]=a>>12&63|128,t[n++]=a>>6&63|128,t[n++]=a&63|128):(t[n++]=a>>12|224,t[n++]=a>>6&63|128,t[n++]=a&63|128)}return Uint8Array.from(t)},Pd=-862048943,Ld=461845907,zd=15,O6=13,M6=5,D6=-430675100,I6=function(e,t){t===void 0&&(t=0);for(var n=_6(e),r=n.length,a=r>>2,o=t,l=0;l<a;l++){var c=l<<2,d=z6(n,c);o=P6(d,o)}var f=a<<2,m=0;switch(r-f){case 3:m^=n[f+2]<<16,m^=n[f+1]<<8,m^=n[f],m=Math.imul(m,Pd),m=uu(m,zd),m=Math.imul(m,Ld),o^=m;break;case 2:m^=n[f+1]<<8,m^=n[f],m=Math.imul(m,Pd),m=uu(m,zd),m=Math.imul(m,Ld),o^=m;break;case 1:m^=n[f],m=Math.imul(m,Pd),m=uu(m,zd),m=Math.imul(m,Ld),o^=m;break}return o^=r,L6(o)>>>0},P6=function(e,t){var n=e,r=t;return n=Math.imul(n,Pd),n=uu(n,zd),n=Math.imul(n,Ld),r^=n,r=uu(r,O6),r=Math.imul(r,M6),r+D6|0},L6=function(e){var t=e;return t^=t>>>16,t=Math.imul(t,-2048144789),t^=t>>>13,t=Math.imul(t,-1028477387),t^=t>>>16,t},uu=function(e,t,n){n===void 0&&(n=32),t>n&&(t=t%n);var r=4294967295<<n-t>>>0,a=(e&r)>>>0>>>n-t>>>0;return(e<<t|a)>>>0},z6=function(e,t){t===void 0&&(t=0);var n=e[t]<<24|e[t+1]<<16|e[t+2]<<8|e[t+3];return U6(n)},U6=function(e){return(e&-16777216)>>>24|(e&16711680)>>>8|(e&65280)<<8|(e&255)<<24},KE=function(e,t){var n,r;if(!(!t||t.length===0)){try{for(var a=Tr(t),o=a.next();!o.done;o=a.next()){var l=o.value;if(!l||!e||typeof e!="object")return;e=e[l]}}catch(c){n={error:c}}finally{try{o&&!o.done&&(r=a.return)&&r.call(a)}finally{if(n)throw n.error}}if(e!=null)return e}},B6="(\\d+)\\.(\\d+)",V6="(\\d+)",F6="(-(([-\\w]+\\.?)*))?",H6="^".concat(B6,"(\\.").concat(V6).concat(F6,")?$"),q6=(function(){function e(t,n,r,a){a===void 0&&(a=void 0),this.major=t,this.minor=n,this.patch=r,this.preRelease=a}return e.parse=function(t){if(t){var n=new RegExp(H6).exec(t);if(n){var r=Number(n[1]),a=Number(n[2]);if(!(isNaN(r)||isNaN(a))){var o=Number(n[4])||0,l=n[5]||void 0;return new e(r,a,o,l)}}}},e.prototype.compareTo=function(t){return this.major>t.major?1:this.major<t.major?-1:this.minor>t.minor?1:this.minor<t.minor?-1:this.patch>t.patch?1:this.patch<t.patch||this.preRelease&&!t.preRelease?-1:!this.preRelease&&t.preRelease?1:this.preRelease&&t.preRelease?this.preRelease>t.preRelease?1:this.preRelease<t.preRelease?-1:0:0},e})(),G6=(function(){function e(){}return e.prototype.evaluate=function(t,n){var r,a,o={},l={context:t,result:o};try{for(var c=Tr(n),d=c.next();!d.done;d=c.next()){var f=d.value,m=this.evaluateFlag(l,f);m&&(o[f.key]=m)}}catch(g){r={error:g}}finally{try{d&&!d.done&&(a=c.return)&&a.call(c)}finally{if(r)throw r.error}}return o},e.prototype.evaluateFlag=function(t,n){var r,a,o;try{for(var l=Tr(n.segments),c=l.next();!c.done;c=l.next()){var d=c.value;if(o=this.evaluateSegment(t,n,d),o){var f=Sa(Sa(Sa({},n.metadata),d.metadata),o.metadata);o=Sa(Sa({},o),{metadata:f});break}}}catch(m){r={error:m}}finally{try{c&&!c.done&&(a=l.return)&&a.call(l)}finally{if(r)throw r.error}}return o},e.prototype.evaluateSegment=function(t,n,r){if(!r.conditions){var a=this.bucket(t,r);return a!==void 0?n.variants[a]:void 0}var o=this.evaluateConditions(t,r.conditions);if(o){var a=this.bucket(t,r);return a!==void 0?n.variants[a]:void 0}},e.prototype.evaluateConditions=function(t,n){var r,a,o,l;try{for(var c=Tr(n),d=c.next();!d.done;d=c.next()){var f=d.value,m=!0;try{for(var g=(o=void 0,Tr(f)),v=g.next();!v.done;v=g.next()){var b=v.value;if(m=this.matchCondition(t,b),!m)break}}catch(S){o={error:S}}finally{try{v&&!v.done&&(l=g.return)&&l.call(g)}finally{if(o)throw o.error}}if(m)return!0}}catch(S){r={error:S}}finally{try{d&&!d.done&&(a=c.return)&&a.call(c)}finally{if(r)throw r.error}}return!1},e.prototype.matchCondition=function(t,n){var r=KE(t,n.selector);if(r==null)return this.matchNull(n.op,n.values);if(this.isSetOperator(n.op)){var a=this.coerceStringArray(r);return a?this.matchSet(a,n.op,n.values):!1}else{var o=this.coerceString(r);return o!==void 0?this.matchString(o,n.op,n.values):!1}},e.prototype.getHash=function(t){return I6(t)},e.prototype.bucket=function(t,n){var r,a,o,l;if(!n.bucket)return n.variant;var c=this.coerceString(KE(t,n.bucket.selector));if(!c||c.length===0)return n.variant;var d="".concat(n.bucket.salt,"/").concat(c),f=this.getHash(d),m=f%100,g=Math.floor(f/100);try{for(var v=Tr(n.bucket.allocations),b=v.next();!b.done;b=v.next()){var S=b.value,w=S.range[0],E=S.range[1];if(m>=w&&m<E)try{for(var T=(o=void 0,Tr(S.distributions)),C=T.next();!C.done;C=T.next()){var k=C.value,j=k.range[0],N=k.range[1];if(g>=j&&g<N)return k.variant}}catch(R){o={error:R}}finally{try{C&&!C.done&&(l=T.return)&&l.call(T)}finally{if(o)throw o.error}}}}catch(R){r={error:R}}finally{try{b&&!b.done&&(a=v.return)&&a.call(v)}finally{if(r)throw r.error}}return n.variant},e.prototype.matchNull=function(t,n){var r=this.containsNone(n);switch(t){case Re.IS:case Re.CONTAINS:case Re.LESS_THAN:case Re.LESS_THAN_EQUALS:case Re.GREATER_THAN:case Re.GREATER_THAN_EQUALS:case Re.VERSION_LESS_THAN:case Re.VERSION_LESS_THAN_EQUALS:case Re.VERSION_GREATER_THAN:case Re.VERSION_GREATER_THAN_EQUALS:case Re.SET_IS:case Re.SET_CONTAINS:case Re.SET_CONTAINS_ANY:return r;case Re.IS_NOT:case Re.DOES_NOT_CONTAIN:case Re.SET_DOES_NOT_CONTAIN:case Re.SET_DOES_NOT_CONTAIN_ANY:return!r;default:return!1}},e.prototype.matchSet=function(t,n,r){switch(n){case Re.SET_IS:return this.setEquals(t,r);case Re.SET_IS_NOT:return!this.setEquals(t,r);case Re.SET_CONTAINS:return this.matchesSetContainsAll(t,r);case Re.SET_DOES_NOT_CONTAIN:return!this.matchesSetContainsAll(t,r);case Re.SET_CONTAINS_ANY:return this.matchesSetContainsAny(t,r);case Re.SET_DOES_NOT_CONTAIN_ANY:return!this.matchesSetContainsAny(t,r);default:return!1}},e.prototype.matchString=function(t,n,r){var a=this;switch(n){case Re.IS:return this.matchesIs(t,r);case Re.IS_NOT:return!this.matchesIs(t,r);case Re.CONTAINS:return this.matchesContains(t,r);case Re.DOES_NOT_CONTAIN:return!this.matchesContains(t,r);case Re.LESS_THAN:case Re.LESS_THAN_EQUALS:case Re.GREATER_THAN:case Re.GREATER_THAN_EQUALS:return this.matchesComparable(t,n,r,function(o){return a.parseNumber(o)},this.comparator);case Re.VERSION_LESS_THAN:case Re.VERSION_LESS_THAN_EQUALS:case Re.VERSION_GREATER_THAN:case Re.VERSION_GREATER_THAN_EQUALS:return this.matchesComparable(t,n,r,function(o){return q6.parse(o)},this.versionComparator);case Re.REGEX_MATCH:return this.matchesRegex(t,r);case Re.REGEX_DOES_NOT_MATCH:return!this.matchesRegex(t,r);default:return!1}},e.prototype.matchesIs=function(t,n){if(this.containsBooleans(n)){var r=t.toLowerCase();if(r==="true"||r==="false")return n.some(function(a){return a.toLowerCase()===r})}return n.some(function(a){return t===a})},e.prototype.matchesContains=function(t,n){var r,a;try{for(var o=Tr(n),l=o.next();!l.done;l=o.next()){var c=l.value;if(t.toLowerCase().includes(c.toLowerCase()))return!0}}catch(d){r={error:d}}finally{try{l&&!l.done&&(a=o.return)&&a.call(o)}finally{if(r)throw r.error}}return!1},e.prototype.matchesComparable=function(t,n,r,a,o){var l=this,c=a(t),d=r.map(function(f){return a(f)}).filter(function(f){return f!==void 0});return c===void 0||d.length===0?r.some(function(f){return l.comparator(t,n,f)}):d.some(function(f){return o(c,n,f)})},e.prototype.comparator=function(t,n,r){switch(n){case Re.LESS_THAN:case Re.VERSION_LESS_THAN:return t<r;case Re.LESS_THAN_EQUALS:case Re.VERSION_LESS_THAN_EQUALS:return t<=r;case Re.GREATER_THAN:case Re.VERSION_GREATER_THAN:return t>r;case Re.GREATER_THAN_EQUALS:case Re.VERSION_GREATER_THAN_EQUALS:return t>=r;default:return!1}},e.prototype.versionComparator=function(t,n,r){var a=t.compareTo(r);switch(n){case Re.LESS_THAN:case Re.VERSION_LESS_THAN:return a<0;case Re.LESS_THAN_EQUALS:case Re.VERSION_LESS_THAN_EQUALS:return a<=0;case Re.GREATER_THAN:case Re.VERSION_GREATER_THAN:return a>0;case Re.GREATER_THAN_EQUALS:case Re.VERSION_GREATER_THAN_EQUALS:return a>=0;default:return!1}},e.prototype.matchesRegex=function(t,n){return n.some(function(r){return!!new RegExp(r).exec(t)})},e.prototype.containsNone=function(t){return t.some(function(n){return n==="(none)"})},e.prototype.containsBooleans=function(t){return t.some(function(n){switch(n.toLowerCase()){case"true":case"false":return!0;default:return!1}})},e.prototype.parseNumber=function(t){var n;return(n=Number(t))!==null&&n!==void 0?n:void 0},e.prototype.coerceString=function(t){if(t!=null)return typeof t=="object"?JSON.stringify(t):String(t)},e.prototype.coerceStringArray=function(t){var n=this;if(Array.isArray(t)){var r=t;return r.map(function(c){return n.coerceString(c)}).filter(Boolean)}var a=String(t);try{var o=JSON.parse(a);if(Array.isArray(o)){var r=t;return r.map(function(d){return n.coerceString(d)}).filter(Boolean)}else{var l=this.coerceString(a);return l?[l]:void 0}}catch{var l=this.coerceString(a);return l?[l]:void 0}},e.prototype.isSetOperator=function(t){switch(t){case Re.SET_IS:case Re.SET_IS_NOT:case Re.SET_CONTAINS:case Re.SET_DOES_NOT_CONTAIN:case Re.SET_CONTAINS_ANY:case Re.SET_DOES_NOT_CONTAIN_ANY:return!0;default:return!1}},e.prototype.setEquals=function(t,n){var r=new Set(t),a=new Set(n);return r.size===a.size&&uy([],ly(a),!1).every(function(o){return r.has(o)})},e.prototype.matchesSetContainsAll=function(t,n){var r,a;if(t.length<n.length)return!1;try{for(var o=Tr(n),l=o.next();!l.done;l=o.next()){var c=l.value;if(!this.matchesIs(c,t))return!1}}catch(d){r={error:d}}finally{try{l&&!l.done&&(a=o.return)&&a.call(o)}finally{if(r)throw r.error}}return!0},e.prototype.matchesSetContainsAny=function(t,n){var r,a;try{for(var o=Tr(n),l=o.next();!l.done;l=o.next()){var c=l.value;if(this.matchesIs(c,t))return!0}}catch(d){r={error:d}}finally{try{l&&!l.done&&(a=o.return)&&a.call(o)}finally{if(r)throw r.error}}return!1},e})(),K6=function(e,t){var n,r,a=Sa({},e),o=[],l=t||Object.keys(a);try{for(var c=Tr(l),d=c.next();!d.done;d=c.next()){var f=d.value,m=IA(f,a);m&&o.push.apply(o,uy([],ly(m),!1))}}catch(g){n={error:g}}finally{try{d&&!d.done&&(r=c.return)&&r.call(c)}finally{if(n)throw n.error}}return o},IA=function(e,t,n){var r,a;n===void 0&&(n=[]);var o=t[e];if(o){if(!o.dependencies||o.dependencies.length===0)return delete t[o.key],[o]}else return;n.push(o.key);var l=[],c=function(g){if(n.some(function(b){return b===g}))throw Error("Detected a cycle between flags ".concat(n));var v=IA(g,t,n);v&&l.push.apply(l,uy([],ly(v),!1))};try{for(var d=Tr(o.dependencies),f=d.next();!f.done;f=d.next()){var m=f.value;c(m)}}catch(g){r={error:g}}finally{try{f&&!f.done&&(a=d.return)&&a.call(d)}finally{if(r)throw r.error}}return l.push(o),n.pop(),delete t[o.key],l};const PA="3.7.7",$6=PA,Io=typeof Buffer=="function",$E=typeof TextDecoder=="function"?new TextDecoder:void 0,YE=typeof TextEncoder=="function"?new TextEncoder:void 0,Y6="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/=",Jl=Array.prototype.slice.call(Y6),gd=(e=>{let t={};return e.forEach((n,r)=>t[n]=r),t})(Jl),W6=/^(?:[A-Za-z\d+\/]{4})*?(?:[A-Za-z\d+\/]{2}(?:==)?|[A-Za-z\d+\/]{3}=?)?$/,Tn=String.fromCharCode.bind(String),WE=typeof Uint8Array.from=="function"?Uint8Array.from.bind(Uint8Array):e=>new Uint8Array(Array.prototype.slice.call(e,0)),LA=e=>e.replace(/=/g,"").replace(/[+\/]/g,t=>t=="+"?"-":"_"),zA=e=>e.replace(/[^A-Za-z0-9\+\/]/g,""),UA=e=>{let t,n,r,a,o="";const l=e.length%3;for(let c=0;c<e.length;){if((n=e.charCodeAt(c++))>255||(r=e.charCodeAt(c++))>255||(a=e.charCodeAt(c++))>255)throw new TypeError("invalid character found");t=n<<16|r<<8|a,o+=Jl[t>>18&63]+Jl[t>>12&63]+Jl[t>>6&63]+Jl[t&63]}return l?o.slice(0,l-3)+"===".substring(l):o},cy=typeof btoa=="function"?e=>btoa(e):Io?e=>Buffer.from(e,"binary").toString("base64"):UA,Vg=Io?e=>Buffer.from(e).toString("base64"):e=>{let n=[];for(let r=0,a=e.length;r<a;r+=4096)n.push(Tn.apply(null,e.subarray(r,r+4096)));return cy(n.join(""))},Ud=(e,t=!1)=>t?LA(Vg(e)):Vg(e),X6=e=>{if(e.length<2){var t=e.charCodeAt(0);return t<128?e:t<2048?Tn(192|t>>>6)+Tn(128|t&63):Tn(224|t>>>12&15)+Tn(128|t>>>6&63)+Tn(128|t&63)}else{var t=65536+(e.charCodeAt(0)-55296)*1024+(e.charCodeAt(1)-56320);return Tn(240|t>>>18&7)+Tn(128|t>>>12&63)+Tn(128|t>>>6&63)+Tn(128|t&63)}},Q6=/[\uD800-\uDBFF][\uDC00-\uDFFFF]|[^\x00-\x7F]/g,BA=e=>e.replace(Q6,X6),XE=Io?e=>Buffer.from(e,"utf8").toString("base64"):YE?e=>Vg(YE.encode(e)):e=>cy(BA(e)),bo=(e,t=!1)=>t?LA(XE(e)):XE(e),QE=e=>bo(e,!0),J6=/[\xC0-\xDF][\x80-\xBF]|[\xE0-\xEF][\x80-\xBF]{2}|[\xF0-\xF7][\x80-\xBF]{3}/g,Z6=e=>{switch(e.length){case 4:var t=(7&e.charCodeAt(0))<<18|(63&e.charCodeAt(1))<<12|(63&e.charCodeAt(2))<<6|63&e.charCodeAt(3),n=t-65536;return Tn((n>>>10)+55296)+Tn((n&1023)+56320);case 3:return Tn((15&e.charCodeAt(0))<<12|(63&e.charCodeAt(1))<<6|63&e.charCodeAt(2));default:return Tn((31&e.charCodeAt(0))<<6|63&e.charCodeAt(1))}},VA=e=>e.replace(J6,Z6),FA=e=>{if(e=e.replace(/\s+/g,""),!W6.test(e))throw new TypeError("malformed base64.");e+="==".slice(2-(e.length&3));let t,n="",r,a;for(let o=0;o<e.length;)t=gd[e.charAt(o++)]<<18|gd[e.charAt(o++)]<<12|(r=gd[e.charAt(o++)])<<6|(a=gd[e.charAt(o++)]),n+=r===64?Tn(t>>16&255):a===64?Tn(t>>16&255,t>>8&255):Tn(t>>16&255,t>>8&255,t&255);return n},dy=typeof atob=="function"?e=>atob(zA(e)):Io?e=>Buffer.from(e,"base64").toString("binary"):FA,HA=Io?e=>WE(Buffer.from(e,"base64")):e=>WE(dy(e).split("").map(t=>t.charCodeAt(0))),qA=e=>HA(GA(e)),ez=Io?e=>Buffer.from(e,"base64").toString("utf8"):$E?e=>$E.decode(HA(e)):e=>VA(dy(e)),GA=e=>zA(e.replace(/[-_]/g,t=>t=="-"?"+":"/")),Fg=e=>ez(GA(e)),tz=e=>{if(typeof e!="string")return!1;const t=e.replace(/\s+/g,"").replace(/={0,2}$/,"");return!/[^\s0-9a-zA-Z\+/]/.test(t)||!/[^\s0-9a-zA-Z\-_]/.test(t)},KA=e=>({value:e,enumerable:!1,writable:!0,configurable:!0}),$A=function(){const e=(t,n)=>Object.defineProperty(String.prototype,t,KA(n));e("fromBase64",function(){return Fg(this)}),e("toBase64",function(t){return bo(this,t)}),e("toBase64URI",function(){return bo(this,!0)}),e("toBase64URL",function(){return bo(this,!0)}),e("toUint8Array",function(){return qA(this)})},YA=function(){const e=(t,n)=>Object.defineProperty(Uint8Array.prototype,t,KA(n));e("toBase64",function(t){return Ud(this,t)}),e("toBase64URI",function(){return Ud(this,!0)}),e("toBase64URL",function(){return Ud(this,!0)})},nz=()=>{$A(),YA()},Hg={version:PA,VERSION:$6,atob:dy,atobPolyfill:FA,btoa:cy,btoaPolyfill:UA,fromBase64:Fg,toBase64:bo,encode:bo,encodeURI:QE,encodeURL:QE,utob:BA,btou:VA,decode:Fg,isValid:tz,fromUint8Array:Ud,toUint8Array:qA,extendString:$A,extendUint8Array:YA,extendBuiltins:nz};var WA=(function(e){OA(t,e);function t(n,r){var a=e.call(this,r)||this;return a.statusCode=n,Object.setPrototypeOf(a,t.prototype),a}return t})(Error),qg=(function(e){OA(t,e);function t(n){var r=e.call(this,n)||this;return Object.setPrototypeOf(r,t.prototype),r}return t})(Error),rz=(function(){function e(t,n,r){this.deploymentKey=t,this.serverUrl=n,this.httpClient=r}return e.prototype.getVariants=function(t,n){return MA(this,void 0,void 0,function(){var r,a,o,l;return DA(this,function(c){switch(c.label){case 0:return r=Hg.encodeURL(JSON.stringify(t)),a={Authorization:"Api-Key ".concat(this.deploymentKey),"X-Amp-Exp-User":r},n?.flagKeys&&(a["X-Amp-Exp-Flag-Keys"]=Hg.encodeURL(JSON.stringify(n.flagKeys))),n?.trackingOption&&(a["X-Amp-Exp-Track"]=n.trackingOption),n?.exposureTrackingOption&&(a["X-Amp-Exp-Exposure-Track"]=n.exposureTrackingOption),o=new URL("".concat(this.serverUrl,"/sdk/v2/vardata?v=0")),n?.evaluationMode&&o.searchParams.append("eval_mode",n?.evaluationMode),n?.deliveryMethod&&o.searchParams.append("delivery_method",n?.deliveryMethod),[4,this.httpClient.request({requestUrl:o.toString(),method:"GET",headers:a,timeoutMillis:n?.timeoutMillis})];case 1:if(l=c.sent(),l.status!=200)throw new WA(l.status,"Fetch error response: status=".concat(l.status));return[2,JSON.parse(l.body)]}})})},e})(),iz=(function(){function e(t,n,r){this.deploymentKey=t,this.serverUrl=n,this.httpClient=r}return e.prototype.getFlags=function(t){return MA(this,void 0,void 0,function(){var n,r,a;return DA(this,function(o){switch(o.label){case 0:return n={Authorization:"Api-Key ".concat(this.deploymentKey)},t?.libraryName&&t?.libraryVersion&&(n["X-Amp-Exp-Library"]="".concat(t.libraryName,"/").concat(t.libraryVersion)),t?.user&&(n["X-Amp-Exp-User"]=Hg.encodeURL(JSON.stringify(t.user))),[4,this.httpClient.request({requestUrl:"".concat(this.serverUrl,"/sdk/v2/flags")+(t?.deliveryMethod?"?delivery_method=".concat(t.deliveryMethod):""),method:"GET",headers:n,timeoutMillis:t?.timeoutMillis})];case 1:if(r=o.sent(),r.status!=200)throw Error("Flags error response: status=".concat(r.status));return a=JSON.parse(r.body),[2,a.reduce(function(l,c){return l[c.key]=c,l},{})]}})})},e})(),ln=typeof globalThis<"u"?globalThis:global||self,ys=function(){if(typeof globalThis<"u")return globalThis;if(typeof window<"u")return window;if(typeof self<"u")return self;if(typeof global<"u")return global},az=function(){var e=ys();if(e)try{var t="EXP_test";return e.localStorage.setItem(t,t),e.localStorage.removeItem(t),!0}catch{return!1}return!1},sz=(function(){function e(t,n){this.poller=void 0,this.action=t,this.ms=n}return e.prototype.start=function(){this.poller||(this.poller=ln.setInterval(this.action,this.ms),this.action())},e.prototype.stop=function(){this.poller&&(ln.clearInterval(this.poller),this.poller=void 0)},e})(),Zl={exports:{}},oz=Zl.exports,JE;function lz(){return JE||(JE=1,(function(e,t){(function(n,r){var a="0.7.33",o="",l="?",c="function",d="undefined",f="object",m="string",g="major",v="model",b="name",S="type",w="vendor",E="version",T="architecture",C="console",k="mobile",j="tablet",N="smarttv",R="wearable",P="embedded",L=350,H="Amazon",D="Apple",B="ASUS",K="BlackBerry",se="Browser",ue="Chrome",Z="Edge",V="Firefox",X="Google",le="Huawei",ye="LG",M="Microsoft",z="Motorola",W="Opera",I="Samsung",fe="Sharp",ge="Sony",Se="Xiaomi",we="Zebra",Pe="Facebook",je=function(Ue,Me){var Q={};for(var q in Ue)Me[q]&&Me[q].length%2===0?Q[q]=Me[q].concat(Ue[q]):Q[q]=Ue[q];return Q},ve=function(Ue){for(var Me={},Q=0;Q<Ue.length;Q++)Me[Ue[Q].toUpperCase()]=Ue[Q];return Me},Le=function(Ue,Me){return typeof Ue===m?xt(Me).indexOf(xt(Ue))!==-1:!1},xt=function(Ue){return Ue.toLowerCase()},Ot=function(Ue){return typeof Ue===m?Ue.replace(/[^\d\.]/g,o).split(".")[0]:r},We=function(Ue,Me){if(typeof Ue===m)return Ue=Ue.replace(/^\s\s*/,o),typeof Me===d?Ue:Ue.substring(0,L)},Nt=function(Ue,Me){for(var Q=0,q,ae,Te,Ee,Be,ut;Q<Me.length&&!Be;){var Yt=Me[Q],gt=Me[Q+1];for(q=ae=0;q<Yt.length&&!Be;)if(Be=Yt[q++].exec(Ue),Be)for(Te=0;Te<gt.length;Te++)ut=Be[++ae],Ee=gt[Te],typeof Ee===f&&Ee.length>0?Ee.length===2?typeof Ee[1]==c?this[Ee[0]]=Ee[1].call(this,ut):this[Ee[0]]=Ee[1]:Ee.length===3?typeof Ee[1]===c&&!(Ee[1].exec&&Ee[1].test)?this[Ee[0]]=ut?Ee[1].call(this,ut,Ee[2]):r:this[Ee[0]]=ut?ut.replace(Ee[1],Ee[2]):r:Ee.length===4&&(this[Ee[0]]=ut?Ee[3].call(this,ut.replace(Ee[1],Ee[2])):r):this[Ee]=ut||r;Q+=2}},lt=function(Ue,Me){for(var Q in Me)if(typeof Me[Q]===f&&Me[Q].length>0){for(var q=0;q<Me[Q].length;q++)if(Le(Me[Q][q],Ue))return Q===l?r:Q}else if(Le(Me[Q],Ue))return Q===l?r:Q;return Ue},Bt={"1.0":"/8",1.2:"/1",1.3:"/3","2.0":"/412","2.0.2":"/416","2.0.3":"/417","2.0.4":"/419","?":"/"},$t={ME:"4.90","NT 3.11":"NT3.51","NT 4.0":"NT4.0",2e3:"NT 5.0",XP:["NT 5.1","NT 5.2"],Vista:"NT 6.0",7:"NT 6.1",8:"NT 6.2",8.1:"NT 6.3",10:["NT 6.4","NT 10.0"],RT:"ARM"},Jt={browser:[[/\b(?:crmo|crios)\/([\w\.]+)/i],[E,[b,"Chrome"]],[/edg(?:e|ios|a)?\/([\w\.]+)/i],[E,[b,"Edge"]],[/(opera mini)\/([-\w\.]+)/i,/(opera [mobiletab]{3,6})\b.+version\/([-\w\.]+)/i,/(opera)(?:.+version\/|[\/ ]+)([\w\.]+)/i],[b,E],[/opios[\/ ]+([\w\.]+)/i],[E,[b,W+" Mini"]],[/\bopr\/([\w\.]+)/i],[E,[b,W]],[/(kindle)\/([\w\.]+)/i,/(lunascape|maxthon|netfront|jasmine|blazer)[\/ ]?([\w\.]*)/i,/(avant |iemobile|slim)(?:browser)?[\/ ]?([\w\.]*)/i,/(ba?idubrowser)[\/ ]?([\w\.]+)/i,/(?:ms|\()(ie) ([\w\.]+)/i,/(flock|rockmelt|midori|epiphany|silk|skyfire|ovibrowser|bolt|iron|vivaldi|iridium|phantomjs|bowser|quark|qupzilla|falkon|rekonq|puffin|brave|whale|qqbrowserlite|qq|duckduckgo)\/([-\w\.]+)/i,/(weibo)__([\d\.]+)/i],[b,E],[/(?:\buc? ?browser|(?:juc.+)ucweb)[\/ ]?([\w\.]+)/i],[E,[b,"UC"+se]],[/microm.+\bqbcore\/([\w\.]+)/i,/\bqbcore\/([\w\.]+).+microm/i],[E,[b,"WeChat(Win) Desktop"]],[/micromessenger\/([\w\.]+)/i],[E,[b,"WeChat"]],[/konqueror\/([\w\.]+)/i],[E,[b,"Konqueror"]],[/trident.+rv[: ]([\w\.]{1,9})\b.+like gecko/i],[E,[b,"IE"]],[/yabrowser\/([\w\.]+)/i],[E,[b,"Yandex"]],[/(avast|avg)\/([\w\.]+)/i],[[b,/(.+)/,"$1 Secure "+se],E],[/\bfocus\/([\w\.]+)/i],[E,[b,V+" Focus"]],[/\bopt\/([\w\.]+)/i],[E,[b,W+" Touch"]],[/coc_coc\w+\/([\w\.]+)/i],[E,[b,"Coc Coc"]],[/dolfin\/([\w\.]+)/i],[E,[b,"Dolphin"]],[/coast\/([\w\.]+)/i],[E,[b,W+" Coast"]],[/miuibrowser\/([\w\.]+)/i],[E,[b,"MIUI "+se]],[/fxios\/([-\w\.]+)/i],[E,[b,V]],[/\bqihu|(qi?ho?o?|360)browser/i],[[b,"360 "+se]],[/(oculus|samsung|sailfish|huawei)browser\/([\w\.]+)/i],[[b,/(.+)/,"$1 "+se],E],[/(comodo_dragon)\/([\w\.]+)/i],[[b,/_/g," "],E],[/(electron)\/([\w\.]+) safari/i,/(tesla)(?: qtcarbrowser|\/(20\d\d\.[-\w\.]+))/i,/m?(qqbrowser|baiduboxapp|2345Explorer)[\/ ]?([\w\.]+)/i],[b,E],[/(metasr)[\/ ]?([\w\.]+)/i,/(lbbrowser)/i,/\[(linkedin)app\]/i],[b],[/((?:fban\/fbios|fb_iab\/fb4a)(?!.+fbav)|;fbav\/([\w\.]+);)/i],[[b,Pe],E],[/safari (line)\/([\w\.]+)/i,/\b(line)\/([\w\.]+)\/iab/i,/(chromium|instagram)[\/ ]([-\w\.]+)/i],[b,E],[/\bgsa\/([\w\.]+) .*safari\//i],[E,[b,"GSA"]],[/headlesschrome(?:\/([\w\.]+)| )/i],[E,[b,ue+" Headless"]],[/ wv\).+(chrome)\/([\w\.]+)/i],[[b,ue+" WebView"],E],[/droid.+ version\/([\w\.]+)\b.+(?:mobile safari|safari)/i],[E,[b,"Android "+se]],[/(chrome|omniweb|arora|[tizenoka]{5} ?browser)\/v?([\w\.]+)/i],[b,E],[/version\/([\w\.\,]+) .*mobile\/\w+ (safari)/i],[E,[b,"Mobile Safari"]],[/version\/([\w(\.|\,)]+) .*(mobile ?safari|safari)/i],[E,b],[/webkit.+?(mobile ?safari|safari)(\/[\w\.]+)/i],[b,[E,lt,Bt]],[/(webkit|khtml)\/([\w\.]+)/i],[b,E],[/(navigator|netscape\d?)\/([-\w\.]+)/i],[[b,"Netscape"],E],[/mobile vr; rv:([\w\.]+)\).+firefox/i],[E,[b,V+" Reality"]],[/ekiohf.+(flow)\/([\w\.]+)/i,/(swiftfox)/i,/(icedragon|iceweasel|camino|chimera|fennec|maemo browser|minimo|conkeror|klar)[\/ ]?([\w\.\+]+)/i,/(seamonkey|k-meleon|icecat|iceape|firebird|phoenix|palemoon|basilisk|waterfox)\/([-\w\.]+)$/i,/(firefox)\/([\w\.]+)/i,/(mozilla)\/([\w\.]+) .+rv\:.+gecko\/\d+/i,/(polaris|lynx|dillo|icab|doris|amaya|w3m|netsurf|sleipnir|obigo|mosaic|(?:go|ice|up)[\. ]?browser)[-\/ ]?v?([\w\.]+)/i,/(links) \(([\w\.]+)/i],[b,E],[/(cobalt)\/([\w\.]+)/i],[b,[E,/master.|lts./,""]]],cpu:[[/(?:(amd|x(?:(?:86|64)[-_])?|wow|win)64)[;\)]/i],[[T,"amd64"]],[/(ia32(?=;))/i],[[T,xt]],[/((?:i[346]|x)86)[;\)]/i],[[T,"ia32"]],[/\b(aarch64|arm(v?8e?l?|_?64))\b/i],[[T,"arm64"]],[/\b(arm(?:v[67])?ht?n?[fl]p?)\b/i],[[T,"armhf"]],[/windows (ce|mobile); ppc;/i],[[T,"arm"]],[/((?:ppc|powerpc)(?:64)?)(?: mac|;|\))/i],[[T,/ower/,o,xt]],[/(sun4\w)[;\)]/i],[[T,"sparc"]],[/((?:avr32|ia64(?=;))|68k(?=\))|\barm(?=v(?:[1-7]|[5-7]1)l?|;|eabi)|(?=atmel )avr|(?:irix|mips|sparc)(?:64)?\b|pa-risc)/i],[[T,xt]]],device:[[/\b(sch-i[89]0\d|shw-m380s|sm-[ptx]\w{2,4}|gt-[pn]\d{2,4}|sgh-t8[56]9|nexus 10)/i],[v,[w,I],[S,j]],[/\b((?:s[cgp]h|gt|sm)-\w+|galaxy nexus)/i,/samsung[- ]([-\w]+)/i,/sec-(sgh\w+)/i],[v,[w,I],[S,k]],[/((ipod|iphone)\d+,\d+)/i],[v,[w,D],[S,k]],[/(ipad\d+,\d+)/i],[v,[w,D],[S,j]],[/\((ip(?:hone|od)[\w ]*);/i],[v,[w,D],[S,k]],[/\((ipad);[-\w\),; ]+apple/i,/applecoremedia\/[\w\.]+ \((ipad)/i,/\b(ipad)\d\d?,\d\d?[;\]].+ios/i],[v,[w,D],[S,j]],[/(macintosh);/i],[v,[w,D]],[/\b((?:ag[rs][23]?|bah2?|sht?|btv)-a?[lw]\d{2})\b(?!.+d\/s)/i],[v,[w,le],[S,j]],[/(?:huawei|honor)([-\w ]+)[;\)]/i,/\b(nexus 6p|\w{2,4}e?-[atu]?[ln][\dx][012359c][adn]?)\b(?!.+d\/s)/i],[v,[w,le],[S,k]],[/\b(poco[\w ]+)(?: bui|\))/i,/\b; (\w+) build\/hm\1/i,/\b(hm[-_ ]?note?[_ ]?(?:\d\w)?) bui/i,/\b(redmi[\-_ ]?(?:note|k)?[\w_ ]+)(?: bui|\))/i,/\b(mi[-_ ]?(?:a\d|one|one[_ ]plus|note lte|max|cc)?[_ ]?(?:\d?\w?)[_ ]?(?:plus|se|lite)?)(?: bui|\))/i],[[v,/_/g," "],[w,Se],[S,k]],[/\b(mi[-_ ]?(?:pad)(?:[\w_ ]+))(?: bui|\))/i],[[v,/_/g," "],[w,Se],[S,j]],[/; (\w+) bui.+ oppo/i,/\b(cph[12]\d{3}|p(?:af|c[al]|d\w|e[ar])[mt]\d0|x9007|a101op)\b/i],[v,[w,"OPPO"],[S,k]],[/vivo (\w+)(?: bui|\))/i,/\b(v[12]\d{3}\w?[at])(?: bui|;)/i],[v,[w,"Vivo"],[S,k]],[/\b(rmx[12]\d{3})(?: bui|;|\))/i],[v,[w,"Realme"],[S,k]],[/\b(milestone|droid(?:[2-4x]| (?:bionic|x2|pro|razr))?:?( 4g)?)\b[\w ]+build\//i,/\bmot(?:orola)?[- ](\w*)/i,/((?:moto[\w\(\) ]+|xt\d{3,4}|nexus 6)(?= bui|\)))/i],[v,[w,z],[S,k]],[/\b(mz60\d|xoom[2 ]{0,2}) build\//i],[v,[w,z],[S,j]],[/((?=lg)?[vl]k\-?\d{3}) bui| 3\.[-\w; ]{10}lg?-([06cv9]{3,4})/i],[v,[w,ye],[S,j]],[/(lm(?:-?f100[nv]?|-[\w\.]+)(?= bui|\))|nexus [45])/i,/\blg[-e;\/ ]+((?!browser|netcast|android tv)\w+)/i,/\blg-?([\d\w]+) bui/i],[v,[w,ye],[S,k]],[/(ideatab[-\w ]+)/i,/lenovo ?(s[56]000[-\w]+|tab(?:[\w ]+)|yt[-\d\w]{6}|tb[-\d\w]{6})/i],[v,[w,"Lenovo"],[S,j]],[/(?:maemo|nokia).*(n900|lumia \d+)/i,/nokia[-_ ]?([-\w\.]*)/i],[[v,/_/g," "],[w,"Nokia"],[S,k]],[/(pixel c)\b/i],[v,[w,X],[S,j]],[/droid.+; (pixel[\daxl ]{0,6})(?: bui|\))/i],[v,[w,X],[S,k]],[/droid.+ (a?\d[0-2]{2}so|[c-g]\d{4}|so[-gl]\w+|xq-a\w[4-7][12])(?= bui|\).+chrome\/(?![1-6]{0,1}\d\.))/i],[v,[w,ge],[S,k]],[/sony tablet [ps]/i,/\b(?:sony)?sgp\w+(?: bui|\))/i],[[v,"Xperia Tablet"],[w,ge],[S,j]],[/ (kb2005|in20[12]5|be20[12][59])\b/i,/(?:one)?(?:plus)? (a\d0\d\d)(?: b|\))/i],[v,[w,"OnePlus"],[S,k]],[/(alexa)webm/i,/(kf[a-z]{2}wi)( bui|\))/i,/(kf[a-z]+)( bui|\)).+silk\//i],[v,[w,H],[S,j]],[/((?:sd|kf)[0349hijorstuw]+)( bui|\)).+silk\//i],[[v,/(.+)/g,"Fire Phone $1"],[w,H],[S,k]],[/(playbook);[-\w\),; ]+(rim)/i],[v,w,[S,j]],[/\b((?:bb[a-f]|st[hv])100-\d)/i,/\(bb10; (\w+)/i],[v,[w,K],[S,k]],[/(?:\b|asus_)(transfo[prime ]{4,10} \w+|eeepc|slider \w+|nexus 7|padfone|p00[cj])/i],[v,[w,B],[S,j]],[/ (z[bes]6[027][012][km][ls]|zenfone \d\w?)\b/i],[v,[w,B],[S,k]],[/(nexus 9)/i],[v,[w,"HTC"],[S,j]],[/(htc)[-;_ ]{1,2}([\w ]+(?=\)| bui)|\w+)/i,/(zte)[- ]([\w ]+?)(?: bui|\/|\))/i,/(alcatel|geeksphone|nexian|panasonic|sony(?!-bra))[-_ ]?([-\w]*)/i],[w,[v,/_/g," "],[S,k]],[/droid.+; ([ab][1-7]-?[0178a]\d\d?)/i],[v,[w,"Acer"],[S,j]],[/droid.+; (m[1-5] note) bui/i,/\bmz-([-\w]{2,})/i],[v,[w,"Meizu"],[S,k]],[/\b(sh-?[altvz]?\d\d[a-ekm]?)/i],[v,[w,fe],[S,k]],[/(blackberry|benq|palm(?=\-)|sonyericsson|acer|asus|dell|meizu|motorola|polytron)[-_ ]?([-\w]*)/i,/(hp) ([\w ]+\w)/i,/(asus)-?(\w+)/i,/(microsoft); (lumia[\w ]+)/i,/(lenovo)[-_ ]?([-\w]+)/i,/(jolla)/i,/(oppo) ?([\w ]+) bui/i],[w,v,[S,k]],[/(archos) (gamepad2?)/i,/(hp).+(touchpad(?!.+tablet)|tablet)/i,/(kindle)\/([\w\.]+)/i,/(nook)[\w ]+build\/(\w+)/i,/(dell) (strea[kpr\d ]*[\dko])/i,/(le[- ]+pan)[- ]+(\w{1,9}) bui/i,/(trinity)[- ]*(t\d{3}) bui/i,/(gigaset)[- ]+(q\w{1,9}) bui/i,/(vodafone) ([\w ]+)(?:\)| bui)/i],[w,v,[S,j]],[/(surface duo)/i],[v,[w,M],[S,j]],[/droid [\d\.]+; (fp\du?)(?: b|\))/i],[v,[w,"Fairphone"],[S,k]],[/(u304aa)/i],[v,[w,"AT&T"],[S,k]],[/\bsie-(\w*)/i],[v,[w,"Siemens"],[S,k]],[/\b(rct\w+) b/i],[v,[w,"RCA"],[S,j]],[/\b(venue[\d ]{2,7}) b/i],[v,[w,"Dell"],[S,j]],[/\b(q(?:mv|ta)\w+) b/i],[v,[w,"Verizon"],[S,j]],[/\b(?:barnes[& ]+noble |bn[rt])([\w\+ ]*) b/i],[v,[w,"Barnes & Noble"],[S,j]],[/\b(tm\d{3}\w+) b/i],[v,[w,"NuVision"],[S,j]],[/\b(k88) b/i],[v,[w,"ZTE"],[S,j]],[/\b(nx\d{3}j) b/i],[v,[w,"ZTE"],[S,k]],[/\b(gen\d{3}) b.+49h/i],[v,[w,"Swiss"],[S,k]],[/\b(zur\d{3}) b/i],[v,[w,"Swiss"],[S,j]],[/\b((zeki)?tb.*\b) b/i],[v,[w,"Zeki"],[S,j]],[/\b([yr]\d{2}) b/i,/\b(dragon[- ]+touch |dt)(\w{5}) b/i],[[w,"Dragon Touch"],v,[S,j]],[/\b(ns-?\w{0,9}) b/i],[v,[w,"Insignia"],[S,j]],[/\b((nxa|next)-?\w{0,9}) b/i],[v,[w,"NextBook"],[S,j]],[/\b(xtreme\_)?(v(1[045]|2[015]|[3469]0|7[05])) b/i],[[w,"Voice"],v,[S,k]],[/\b(lvtel\-)?(v1[12]) b/i],[[w,"LvTel"],v,[S,k]],[/\b(ph-1) /i],[v,[w,"Essential"],[S,k]],[/\b(v(100md|700na|7011|917g).*\b) b/i],[v,[w,"Envizen"],[S,j]],[/\b(trio[-\w\. ]+) b/i],[v,[w,"MachSpeed"],[S,j]],[/\btu_(1491) b/i],[v,[w,"Rotor"],[S,j]],[/(shield[\w ]+) b/i],[v,[w,"Nvidia"],[S,j]],[/(sprint) (\w+)/i],[w,v,[S,k]],[/(kin\.[onetw]{3})/i],[[v,/\./g," "],[w,M],[S,k]],[/droid.+; (cc6666?|et5[16]|mc[239][23]x?|vc8[03]x?)\)/i],[v,[w,we],[S,j]],[/droid.+; (ec30|ps20|tc[2-8]\d[kx])\)/i],[v,[w,we],[S,k]],[/(ouya)/i,/(nintendo) ([wids3utch]+)/i],[w,v,[S,C]],[/droid.+; (shield) bui/i],[v,[w,"Nvidia"],[S,C]],[/(playstation [345portablevi]+)/i],[v,[w,ge],[S,C]],[/\b(xbox(?: one)?(?!; xbox))[\); ]/i],[v,[w,M],[S,C]],[/smart-tv.+(samsung)/i],[w,[S,N]],[/hbbtv.+maple;(\d+)/i],[[v,/^/,"SmartTV"],[w,I],[S,N]],[/(nux; netcast.+smarttv|lg (netcast\.tv-201\d|android tv))/i],[[w,ye],[S,N]],[/(apple) ?tv/i],[w,[v,D+" TV"],[S,N]],[/crkey/i],[[v,ue+"cast"],[w,X],[S,N]],[/droid.+aft(\w)( bui|\))/i],[v,[w,H],[S,N]],[/\(dtv[\);].+(aquos)/i,/(aquos-tv[\w ]+)\)/i],[v,[w,fe],[S,N]],[/(bravia[\w ]+)( bui|\))/i],[v,[w,ge],[S,N]],[/(mitv-\w{5}) bui/i],[v,[w,Se],[S,N]],[/\b(roku)[\dx]*[\)\/]((?:dvp-)?[\d\.]*)/i,/hbbtv\/\d+\.\d+\.\d+ +\([\w ]*; *(\w[^;]*);([^;]*)/i],[[w,We],[v,We],[S,N]],[/\b(android tv|smart[- ]?tv|opera tv|tv; rv:)\b/i],[[S,N]],[/((pebble))app/i],[w,v,[S,R]],[/droid.+; (glass) \d/i],[v,[w,X],[S,R]],[/droid.+; (wt63?0{2,3})\)/i],[v,[w,we],[S,R]],[/(quest( 2)?)/i],[v,[w,Pe],[S,R]],[/(tesla)(?: qtcarbrowser|\/[-\w\.]+)/i],[w,[S,P]],[/droid .+?; ([^;]+?)(?: bui|\) applew).+? mobile safari/i],[v,[S,k]],[/droid .+?; ([^;]+?)(?: bui|\) applew).+?(?! mobile) safari/i],[v,[S,j]],[/\b((tablet|tab)[;\/]|focus\/\d(?!.+mobile))/i],[[S,j]],[/(phone|mobile(?:[;\/]| [ \w\/\.]*safari)|pda(?=.+windows ce))/i],[[S,k]],[/(android[-\w\. ]{0,9});.+buil/i],[v,[w,"Generic"]]],engine:[[/windows.+ edge\/([\w\.]+)/i],[E,[b,Z+"HTML"]],[/webkit\/537\.36.+chrome\/(?!27)([\w\.]+)/i],[E,[b,"Blink"]],[/(presto)\/([\w\.]+)/i,/(webkit|trident|netfront|netsurf|amaya|lynx|w3m|goanna)\/([\w\.]+)/i,/ekioh(flow)\/([\w\.]+)/i,/(khtml|tasman|links)[\/ ]\(?([\w\.]+)/i,/(icab)[\/ ]([23]\.[\d\.]+)/i],[b,E],[/rv\:([\w\.]{1,9})\b.+(gecko)/i],[E,b]],os:[[/microsoft (windows) (vista|xp)/i],[b,E],[/(windows) nt 6\.2; (arm)/i,/(windows (?:phone(?: os)?|mobile))[\/ ]?([\d\.\w ]*)/i,/(windows)[\/ ]?([ntce\d\. ]+\w)(?!.+xbox)/i],[b,[E,lt,$t]],[/(win(?=3|9|n)|win 9x )([nt\d\.]+)/i],[[b,"Windows"],[E,lt,$t]],[/ip[honead]{2,4}\b(?:.*os ([\w]+) like mac|; opera)/i,/cfnetwork\/.+darwin/i],[[E,/_/g,"."],[b,"iOS"]],[/(mac os x) ?([\w\. ]*)/i,/(macintosh|mac_powerpc\b)(?!.+haiku)/i],[[b,"Mac OS"],[E,/_/g,"."]],[/droid ([\w\.]+)\b.+(android[- ]x86|harmonyos)/i],[E,b],[/(android|webos|qnx|bada|rim tablet os|maemo|meego|sailfish)[-\/ ]?([\w\.]*)/i,/(blackberry)\w*\/([\w\.]*)/i,/(tizen|kaios)[\/ ]([\w\.]+)/i,/\((series40);/i],[b,E],[/\(bb(10);/i],[E,[b,K]],[/(?:symbian ?os|symbos|s60(?=;)|series60)[-\/ ]?([\w\.]*)/i],[E,[b,"Symbian"]],[/mozilla\/[\d\.]+ \((?:mobile|tablet|tv|mobile; [\w ]+); rv:.+ gecko\/([\w\.]+)/i],[E,[b,V+" OS"]],[/web0s;.+rt(tv)/i,/\b(?:hp)?wos(?:browser)?\/([\w\.]+)/i],[E,[b,"webOS"]],[/crkey\/([\d\.]+)/i],[E,[b,ue+"cast"]],[/(cros) [\w]+ ([\w\.]+\w)/i],[[b,"Chromium OS"],E],[/(nintendo|playstation) ([wids345portablevuch]+)/i,/(xbox); +xbox ([^\);]+)/i,/\b(joli|palm)\b ?(?:os)?\/?([\w\.]*)/i,/(mint)[\/\(\) ]?(\w*)/i,/(mageia|vectorlinux)[; ]/i,/([kxln]?ubuntu|debian|suse|opensuse|gentoo|arch(?= linux)|slackware|fedora|mandriva|centos|pclinuxos|red ?hat|zenwalk|linpus|raspbian|plan 9|minix|risc os|contiki|deepin|manjaro|elementary os|sabayon|linspire)(?: gnu\/linux)?(?: enterprise)?(?:[- ]linux)?(?:-gnu)?[-\/ ]?(?!chrom|package)([-\w\.]*)/i,/(hurd|linux) ?([\w\.]*)/i,/(gnu) ?([\w\.]*)/i,/\b([-frentopcghs]{0,5}bsd|dragonfly)[\/ ]?(?!amd|[ix346]{1,2}86)([\w\.]*)/i,/(haiku) (\w+)/i],[b,E],[/(sunos) ?([\w\.\d]*)/i],[[b,"Solaris"],E],[/((?:open)?solaris)[-\/ ]?([\w\.]*)/i,/(aix) ((\d)(?=\.|\)| )[\w\.])*/i,/\b(beos|os\/2|amigaos|morphos|openvms|fuchsia|hp-ux)/i,/(unix) ?([\w\.]*)/i],[b,E]]},mt=function(Ue,Me){if(typeof Ue===f&&(Me=Ue,Ue=r),!(this instanceof mt))return new mt(Ue,Me).getResult();var Q=Ue||(typeof n!==d&&n.navigator&&n.navigator.userAgent?n.navigator.userAgent:o),q=Me?je(Jt,Me):Jt;return this.getBrowser=function(){var ae={};return ae[b]=r,ae[E]=r,Nt.call(ae,Q,q.browser),ae.major=Ot(ae.version),ae},this.getCPU=function(){var ae={};return ae[T]=r,Nt.call(ae,Q,q.cpu),ae},this.getDevice=function(){var ae={};return ae[w]=r,ae[v]=r,ae[S]=r,Nt.call(ae,Q,q.device),ae},this.getEngine=function(){var ae={};return ae[b]=r,ae[E]=r,Nt.call(ae,Q,q.engine),ae},this.getOS=function(){var ae={};return ae[b]=r,ae[E]=r,Nt.call(ae,Q,q.os),ae},this.getResult=function(){return{ua:this.getUA(),browser:this.getBrowser(),engine:this.getEngine(),os:this.getOS(),device:this.getDevice(),cpu:this.getCPU()}},this.getUA=function(){return Q},this.setUA=function(ae){return Q=typeof ae===m&&ae.length>L?We(ae,L):ae,this},this.setUA(Q),this};mt.VERSION=a,mt.BROWSER=ve([b,E,g]),mt.CPU=ve([T]),mt.DEVICE=ve([v,w,S,C,k,N,j,R,P]),mt.ENGINE=mt.OS=ve([b,E]),e.exports&&(t=e.exports=mt),t.UAParser=mt;var st=typeof n!==d&&(n.jQuery||n.Zepto);if(st&&!st.ua){var Mn=new mt;st.ua=Mn.getResult(),st.ua.get=function(){return Mn.getUA()},st.ua.set=function(Ue){Mn.setUA(Ue);var Me=Mn.getResult();for(var Q in Me)st.ua[Q]=Me[Q]}}})(typeof window=="object"?window:oz)})(Zl,Zl.exports)),Zl.exports}var uz=lz(),ht=function(){return ht=Object.assign||function(t){for(var n,r=1,a=arguments.length;r<a;r++){n=arguments[r];for(var o in n)Object.prototype.hasOwnProperty.call(n,o)&&(t[o]=n[o])}return t},ht.apply(this,arguments)};function wn(e,t,n,r){function a(o){return o instanceof n?o:new n(function(l){l(o)})}return new(n||(n=Promise))(function(o,l){function c(m){try{f(r.next(m))}catch(g){l(g)}}function d(m){try{f(r.throw(m))}catch(g){l(g)}}function f(m){m.done?o(m.value):a(m.value).then(c,d)}f((r=r.apply(e,t||[])).next())})}function En(e,t){var n={label:0,sent:function(){if(o[0]&1)throw o[1];return o[1]},trys:[],ops:[]},r,a,o,l=Object.create((typeof Iterator=="function"?Iterator:Object).prototype);return l.next=c(0),l.throw=c(1),l.return=c(2),typeof Symbol=="function"&&(l[Symbol.iterator]=function(){return this}),l;function c(f){return function(m){return d([f,m])}}function d(f){if(r)throw new TypeError("Generator is already executing.");for(;l&&(l=0,f[0]&&(n=0)),n;)try{if(r=1,a&&(o=f[0]&2?a.return:f[0]?a.throw||((o=a.return)&&o.call(a),0):a.next)&&!(o=o.call(a,f[1])).done)return o;switch(a=0,o&&(f=[f[0]&2,o.value]),f[0]){case 0:case 1:o=f;break;case 4:return n.label++,{value:f[1],done:!1};case 5:n.label++,a=f[1],f=[0];continue;case 7:f=n.ops.pop(),n.trys.pop();continue;default:if(o=n.trys,!(o=o.length>0&&o[o.length-1])&&(f[0]===6||f[0]===2)){n=0;continue}if(f[0]===3&&(!o||f[1]>o[0]&&f[1]<o[3])){n.label=f[1];break}if(f[0]===6&&n.label<o[1]){n.label=o[1],o=f;break}if(o&&n.label<o[2]){n.label=o[2],n.ops.push(f);break}o[2]&&n.ops.pop(),n.trys.pop();continue}f=t.call(e,n)}catch(m){f=[6,m],a=0}finally{r=o=0}if(f[0]&5)throw f[1];return{value:f[0]?f[1]:void 0,done:!0}}}function ja(e){var t=typeof Symbol=="function"&&Symbol.iterator,n=t&&e[t],r=0;if(n)return n.call(e);if(e&&typeof e.length=="number")return{next:function(){return e&&r>=e.length&&(e=void 0),{value:e&&e[r++],done:!e}}};throw new TypeError(t?"Object is not iterable.":"Symbol.iterator is not defined.")}function Nn(e,t){var n=typeof Symbol=="function"&&e[Symbol.iterator];if(!n)return e;var r=n.call(e),a,o=[],l;try{for(;(t===void 0||t-- >0)&&!(a=r.next()).done;)o.push(a.value)}catch(c){l={error:c}}finally{try{a&&!a.done&&(n=r.return)&&n.call(r)}finally{if(l)throw l.error}}return o}function Ar(e,t,n){if(arguments.length===2)for(var r=0,a=t.length,o;r<a;r++)(o||!(r in t))&&(o||(o=Array.prototype.slice.call(t,0,r)),o[r]=t[r]);return e.concat(o||Array.prototype.slice.call(t))}var ZE=function(e,t){var n,r;t===void 0&&(t=!1);var a=fy(e,t),o=void 0,l=ln.document.cookie.split("; ");try{for(var c=ja(l),d=c.next();!d.done;d=c.next()){var f=d.value,m=Nn(f.split("=",2),2),g=m[0],v=m[1];g===a&&(o=decodeURIComponent(v))}}catch(E){n={error:E}}finally{try{d&&!d.done&&(r=c.return)&&r.call(c)}finally{if(n)throw n.error}}if(o)try{if(t){var b=atob(o);return JSON.parse(decodeURIComponent(b))}var S=o.split("."),w=void 0;return S.length>=2&&S[1]&&(w=atob(S[1])),{deviceId:S[0],userId:w}}catch{return}},cz=function(e){var t=fy(e,!0);try{var n=ln.localStorage.getItem(t);if(!n)return;var r=JSON.parse(n);return typeof r!="object"?void 0:r}catch{return}},dz=function(e){var t=fy(e,!0);try{var n=ln.sessionStorage.getItem(t);if(!n)return;var r=JSON.parse(n);return typeof r!="object"?void 0:r}catch{return}},fy=function(e,t){if(t)return e?.length<10?void 0:"AMP_".concat(e.substring(0,10));if(!(e?.length<6))return"amp_".concat(e.substring(0,6))},fz=(function(){function e(t,n,r){this.type="integration",this.apiKey=t,this.identityStore=n.identityStore,this.eventBridge=n.eventBridge,this.contextProvider=n.applicationContextProvider,this.timeoutMillis=r,this.loadPersistedState(),r<=0&&(this.setup=void 0)}return e.prototype.setup=function(t,n){return wn(this,void 0,void 0,function(){return En(this,function(r){return t?.automaticFetchOnAmplitudeIdentityChange&&this.identityStore.addIdentityListener(function(){n?.fetch()}),[2,this.waitForConnectorIdentity(this.timeoutMillis)]})})},e.prototype.getUser=function(){var t=this.identityStore.getIdentity();return{user_id:t.userId,device_id:t.deviceId,user_properties:t.userProperties,version:this.contextProvider.versionName}},e.prototype.track=function(t){return this.eventBridge.receiver?(this.eventBridge.logEvent({eventType:t.eventType,eventProperties:t.eventProperties}),!0):!1},e.prototype.loadPersistedState=function(){if(!this.apiKey||this.apiKey.startsWith("client-"))return!1;var t=ZE(this.apiKey,!0);return t?(this.commitIdentityToConnector(t),!0):(t=ZE(this.apiKey,!1),t?(this.commitIdentityToConnector(t),!0):(t=cz(this.apiKey),t?(this.commitIdentityToConnector(t),!0):(t=dz(this.apiKey),t?(this.commitIdentityToConnector(t),!0):!1)))},e.prototype.commitIdentityToConnector=function(t){var n=this.identityStore.editIdentity();n.setDeviceId(t.deviceId),t.userId&&n.setUserId(t.userId),n.commit()},e.prototype.waitForConnectorIdentity=function(t){return wn(this,void 0,void 0,function(){var n,r=this;return En(this,function(a){return n=this.identityStore.getIdentity(),!n.userId&&!n.deviceId?[2,Promise.race([new Promise(function(o){var l=function(){o(),r.identityStore.removeIdentityListener(l)};r.identityStore.addIdentityListener(l)}),new Promise(function(o,l){ln.setTimeout(l,t,"Timed out waiting for Amplitude Analytics SDK to initialize.")})])]:[2]})})},e})();function hz(e,t){return t=t||{},new Promise(function(n,r){var a=new XMLHttpRequest,o=[],l=[],c={},d=function(){return{ok:(a.status/100|0)==2,statusText:a.statusText,status:a.status,url:a.responseURL,text:function(){return Promise.resolve(a.responseText)},json:function(){return Promise.resolve(JSON.parse(a.responseText))},blob:function(){return Promise.resolve(new Blob([a.response]))},clone:d,headers:{keys:function(){return o},entries:function(){return l},get:function(m){return c[m.toLowerCase()]},has:function(m){return m.toLowerCase()in c}}}};for(var f in a.open(t.method||"get",e,!0),a.onload=function(){a.getAllResponseHeaders().replace(/^(.*?):[^\S\n]*([\s\S]*?)$/gm,function(m,g,v){o.push(g=g.toLowerCase()),l.push([g,v]),c[g]=c[g]?c[g]+","+v:v}),n(d())},a.onerror=r,a.withCredentials=t.credentials=="include",t.headers)a.setRequestHeader(f,t.headers[f]);a.send(t.body||null)})}var pz=ln.fetch||hz,mz=function(e,t){return t==null||t<=0?e:new Promise(function(n,r){ln.setTimeout(function(){r(new qg("Request timeout after "+t+" milliseconds"))},t),e.then(n,r)})},gz=function(e,t,n,r,a){var o=function(){return wn(void 0,void 0,void 0,function(){var l,c,d;return En(this,function(f){switch(f.label){case 0:return[4,pz(e,{method:t,headers:n,body:r})];case 1:return l=f.sent(),d={status:l.status},[4,l.text()];case 2:return c=(d.body=f.sent(),d),[2,c]}})})};return mz(o(),a)},vz=(function(){function e(t){this.client=t}return e.prototype.request=function(t){return wn(this,void 0,void 0,function(){return En(this,function(n){switch(n.label){case 0:return[4,this.client.request(t.requestUrl,t.method,t.headers,null,t.timeoutMillis)];case 1:return[2,n.sent()]}})})},e})(),XA={request:gz},Vr;(function(e){e[e.Disable=0]="Disable",e[e.Error=1]="Error",e[e.Warn=2]="Warn",e[e.Info=3]="Info",e[e.Debug=4]="Debug",e[e.Verbose=5]="Verbose"})(Vr||(Vr={}));var Ui;(function(e){e.LocalStorage="localStorage",e.InitialVariants="initialVariants"})(Ui||(Ui={}));var dn;(function(e){e.LocalStorage="storage",e.InitialVariants="initial",e.SecondaryLocalStorage="secondary-storage",e.SecondaryInitialVariants="secondary-initial",e.FallbackInline="fallback-inline",e.FallbackConfig="fallback-config",e.LocalEvaluation="local-evaluation"})(dn||(dn={}));var e1=function(e){return!e||e===dn.FallbackInline||e===dn.FallbackConfig||e===dn.SecondaryInitialVariants},co={debug:!1,logLevel:Vr.Error,loggerProvider:null,instanceName:"$default_instance",fallbackVariant:{},initialVariants:{},initialFlags:void 0,source:Ui.LocalStorage,serverUrl:"https://api.lab.amplitude.com",flagsServerUrl:"https://flag.lab.amplitude.com",serverZone:"US",fetchTimeoutMillis:1e4,retryFetchOnFailure:!0,throwOnError:!1,automaticExposureTracking:!0,pollOnStart:!0,flagConfigPollingIntervalMillis:3e5,fetchOnStart:!0,automaticFetchOnAmplitudeIdentityChange:!1,userProvider:null,analyticsProvider:null,exposureTrackingProvider:null,httpClient:XA},t1="1.20.3",yz=512,bz=(function(){function e(t,n){var r=this,a;this.isReady=new Promise(function(l){r.resolve=l}),this.config=t,this.client=n;var o=(a=t.instanceName)!==null&&a!==void 0?a:co.instanceName;this.queue=new Sz(o),this.cache=new xz(o)}return e.prototype.ready=function(){return this.integration?this.isReady:Promise.resolve()},e.prototype.setIntegration=function(t){var n=this;this.integration&&this.integration.teardown&&this.integration.teardown(),this.integration=t,t.setup?this.integration.setup(this.config,this.client).then(function(){n.queue.setTracker(n.integration.track.bind(t)),n.resolve()},function(){n.queue.setTracker(n.integration.track.bind(t)),n.resolve()}):(this.queue.setTracker(this.integration.track.bind(t)),this.resolve())},e.prototype.getUser=function(){return this.integration?this.integration.getUser():{}},e.prototype.track=function(t,n){if(this.cache.shouldTrack(t,n)){var r=this.getExposureEvent(t);this.queue.push(r)}},e.prototype.getExposureEvent=function(t){var n,r,a,o={eventType:"$exposure",eventProperties:t};return!((n=t.metadata)===null||n===void 0)&&n.exposureEvent?o={eventType:(r=t.metadata)===null||r===void 0?void 0:r.exposureEvent,eventProperties:t}:((a=t.metadata)===null||a===void 0?void 0:a.deliveryMethod)==="web"&&(o={eventType:"$impression",eventProperties:t}),o},e})(),xz=(function(){function e(t){this.isSessionStorageAvailable=wz(),this.inMemoryCache={},this.identity={},this.storageKey="EXP_sent_v3_".concat(t),this.isSessionStorageAvailable&&(ln.sessionStorage.removeItem("EXP_sent_".concat(t)),ln.sessionStorage.removeItem("EXP_sent_v2_".concat(t)))}return e.prototype.shouldTrack=function(t,n){var r,a;if(((r=t.metadata)===null||r===void 0?void 0:r.deliveryMethod)==="web")return!0;var o={userId:n?.user_id,deviceId:n?.device_id};this.identityEquals(this.identity,o)||this.clearCache(),this.identity=o,this.loadCache();var l=t.flag_key in this.inMemoryCache,c=this.inMemoryCache[t.flag_key],d=(a=t.variant)!==null&&a!==void 0?a:null,f=c??null,m=!1;return(!l||f!==d)&&(m=!0,this.inMemoryCache[t.flag_key]=d),this.storeCache(),m},e.prototype.clearCache=function(){this.inMemoryCache={},this.isSessionStorageAvailable&&ln.sessionStorage.removeItem(this.storageKey)},e.prototype.identityEquals=function(t,n){return t.userId&&n.userId?t.userId===n.userId:!t.userId&&!n.userId?t.deviceId===n.deviceId:!1},e.prototype.loadCache=function(){if(this.isSessionStorageAvailable){var t=ln.sessionStorage.getItem(this.storageKey);this.inMemoryCache=t?JSON.parse(t):{}}},e.prototype.storeCache=function(){if(this.isSessionStorageAvailable)try{ln.sessionStorage.setItem(this.storageKey,JSON.stringify(this.inMemoryCache))}catch{}},e})(),Sz=(function(){function e(t,n){n===void 0&&(n=yz),this.isLocalStorageAvailable=az(),this.inMemoryQueue=[],this.storageKey="EXP_unsent_".concat(t),this.maxQueueSize=n}return e.prototype.push=function(t){this.loadQueue(),this.inMemoryQueue.push(t),this.flush(),this.storeQueue()},e.prototype.setTracker=function(t){var n=this;this.tracker=t,this.poller=ln.setInterval(function(){n.loadFlushStore()},1e3),this.loadFlushStore()},e.prototype.flush=function(){if(this.tracker&&this.inMemoryQueue.length!==0){for(var t=0;t<this.inMemoryQueue.length;t++)try{if(!this.tracker(this.inMemoryQueue[t]))break}catch{break}this.inMemoryQueue=this.inMemoryQueue.slice(t),this.inMemoryQueue.length===0&&this.poller&&(ln.clearInterval(this.poller),this.poller=void 0)}},e.prototype.loadQueue=function(){if(this.isLocalStorageAvailable){var t=ln.localStorage.getItem(this.storageKey);this.inMemoryQueue=t?JSON.parse(t):[]}},e.prototype.storeQueue=function(){this.isLocalStorageAvailable&&(this.inMemoryQueue.length>this.maxQueueSize&&(this.inMemoryQueue=this.inMemoryQueue.slice(this.inMemoryQueue.length-this.maxQueueSize)),ln.localStorage.setItem(this.storageKey,JSON.stringify(this.inMemoryQueue)))},e.prototype.loadFlushStore=function(){this.loadQueue(),this.flush(),this.storeQueue()},e})(),wz=function(){var e=ys();if(e)try{var t="EXP_test";return e.sessionStorage.setItem(t,t),e.sessionStorage.removeItem(t),!0}catch{return!1}return!1},Ez=(function(){function e(t,n){n===void 0&&(n=Vr.Error),this.logger=t,this.logLevel=n}return e.prototype.error=function(t){for(var n,r=[],a=1;a<arguments.length;a++)r[a-1]=arguments[a];this.logLevel>=Vr.Error&&(n=this.logger).error.apply(n,Ar([t],Nn(r),!1))},e.prototype.warn=function(t){for(var n,r=[],a=1;a<arguments.length;a++)r[a-1]=arguments[a];this.logLevel>=Vr.Warn&&(n=this.logger).warn.apply(n,Ar([t],Nn(r),!1))},e.prototype.info=function(t){for(var n,r=[],a=1;a<arguments.length;a++)r[a-1]=arguments[a];this.logLevel>=Vr.Info&&(n=this.logger).info.apply(n,Ar([t],Nn(r),!1))},e.prototype.debug=function(t){for(var n,r=[],a=1;a<arguments.length;a++)r[a-1]=arguments[a];this.logLevel>=Vr.Debug&&(n=this.logger).debug.apply(n,Ar([t],Nn(r),!1))},e.prototype.verbose=function(t){for(var n,r=[],a=1;a<arguments.length;a++)r[a-1]=arguments[a];this.logLevel>=Vr.Verbose&&(n=this.logger).verbose.apply(n,Ar([t],Nn(r),!1))},e})(),Tz=(function(){function e(){}return e.prototype.error=function(t){for(var n=[],r=1;r<arguments.length;r++)n[r-1]=arguments[r];console.error.apply(console,Ar([t],Nn(n),!1))},e.prototype.warn=function(t){for(var n=[],r=1;r<arguments.length;r++)n[r-1]=arguments[r];console.warn.apply(console,Ar([t],Nn(n),!1))},e.prototype.info=function(t){for(var n=[],r=1;r<arguments.length;r++)n[r-1]=arguments[r];console.info.apply(console,Ar([t],Nn(n),!1))},e.prototype.debug=function(t){for(var n=[],r=1;r<arguments.length;r++)n[r-1]=arguments[r];console.debug.apply(console,Ar([t],Nn(n),!1))},e.prototype.verbose=function(t){for(var n=[],r=1;r<arguments.length;r++)n[r-1]=arguments[r];console.debug.apply(console,Ar([t],Nn(n),!1))},e})(),Mf=(function(){function e(){this.globalScope=ys()}return e.prototype.get=function(t){var n;return(n=this.globalScope)===null||n===void 0?void 0:n.localStorage.getItem(t)},e.prototype.put=function(t,n){var r;(r=this.globalScope)===null||r===void 0||r.localStorage.setItem(t,n)},e.prototype.delete=function(t){var n;(n=this.globalScope)===null||n===void 0||n.localStorage.removeItem(t)},e})(),kz=function(e,t,n){var r=e.substring(e.length-6),a="amp-exp-".concat(t,"-").concat(r);return new QA(a,n,JA)},Cz=function(e,t,n){n===void 0&&(n=new Mf);var r=e.substring(e.length-6),a="amp-exp-".concat(t,"-").concat(r,"-flags");return new QA(a,n)},Az=function(e,t,n){n===void 0&&(n=new Mf);var r=e.substring(e.length-6),a="amp-exp-".concat(t,"-").concat(r,"-variants-options");return new Nz(a,n)},Nz=(function(){function e(t,n){this.namespace=t,this.storage=n}return e.prototype.get=function(){return this.value},e.prototype.put=function(t){this.value=t},e.prototype.load=function(){var t=this.storage.get(this.namespace);t&&(this.value=JSON.parse(t))},e.prototype.store=function(){this.value===void 0?this.storage.delete(this.namespace):this.storage.put(this.namespace,JSON.stringify(this.value))},e})(),QA=(function(){function e(t,n,r){this.cache={},this.namespace=t,this.storage=n,this.transformer=r}return e.prototype.get=function(t){return this.cache[t]},e.prototype.getAll=function(){return ht({},this.cache)},e.prototype.put=function(t,n){this.cache[t]=n},e.prototype.putAll=function(t){var n,r;try{for(var a=ja(Object.keys(t)),o=a.next();!o.done;o=a.next()){var l=o.value;this.cache[l]=t[l]}}catch(c){n={error:c}}finally{try{o&&!o.done&&(r=a.return)&&r.call(a)}finally{if(n)throw n.error}}},e.prototype.remove=function(t){delete this.cache[t]},e.prototype.clear=function(){this.cache={}},e.prototype.load=function(){var t,n,r=this.storage.get(this.namespace),a;try{a=JSON.parse(r)||{}}catch{return}var o={};try{for(var l=ja(Object.keys(a)),c=l.next();!c.done;c=l.next()){var d=c.value;try{var f=void 0;this.transformer?f=this.transformer(a[d]):f=a[d],f&&(o[d]=f)}catch{}}}catch(m){t={error:m}}finally{try{c&&!c.done&&(n=l.return)&&n.call(l)}finally{if(t)throw t.error}}this.clear(),this.putAll(o)},e.prototype.store=function(t){t===void 0&&(t=this.cache),this.storage.put(this.namespace,JSON.stringify(t))},e})(),JA=function(e){if(typeof e=="string")return{key:e,value:e};if(typeof e=="object"){var t=e.key,n=e.value,r=e.payload,a=e.metadata,o=e.expKey;a&&a.experimentKey?o=a.experimentKey:o&&(a=a||{},a.experimentKey=o);var l={};return t?l.key=t:n&&(l.key=n),n&&(l.value=n),a&&(l.metadata=a),r&&(l.payload=r),o&&(l.expKey=o),l}},ZA=(function(){function e(){this.globalScope=ys()}return e.prototype.get=function(t){var n;return(n=this.globalScope)===null||n===void 0?void 0:n.sessionStorage.getItem(t)},e.prototype.put=function(t,n){var r;(r=this.globalScope)===null||r===void 0||r.sessionStorage.setItem(t,n)},e.prototype.delete=function(t){var n;(n=this.globalScope)===null||n===void 0||n.sessionStorage.removeItem(t)},e})(),jz=function(e,t,n,r){var a,o="[Experiment] Exposure",l=n?.value,c="[Experiment] ".concat(t);return{name:o,user:e,key:t,variant:n,userProperty:c,properties:{key:t,variant:l,source:r},userProperties:(a={},a[c]=l,a)}},Ur=function(e){return e==null},jm=function(e){return Ur(e)?!0:e&&Object.keys(e).length===0},Rz=function(e){var t,n;if(!e||typeof e!="object")return{};var r={};try{for(var a=ja(Object.entries(e)),o=a.next();!o.done;o=a.next()){var l=Nn(o.value,2),c=l[0],d=l[1];Ur(d)||(r[c]=d)}}catch(f){t={error:f}}finally{try{o&&!o.done&&(n=a.return)&&n.call(a)}finally{if(t)throw t.error}}return r},n1=function(e){var t;return((t=e?.metadata)===null||t===void 0?void 0:t.evaluationMode)==="local"},_z=(function(){function e(t,n,r,a){this.started=!1,this.done=!1,this.attempts=t,this.min=n,this.max=r,this.scalar=a}return e.prototype.start=function(t){return wn(this,void 0,void 0,function(){return En(this,function(n){switch(n.label){case 0:if(!this.started)this.started=!0;else throw Error("Backoff already started");return[4,this.backoff(t,0,this.min)];case 1:return n.sent(),[2]}})})},e.prototype.cancel=function(){this.done=!0,clearTimeout(this.timeoutHandle)},e.prototype.backoff=function(t,n,r){return wn(this,void 0,void 0,function(){var a=this;return En(this,function(o){return this.done?[2]:(this.timeoutHandle=ln.setTimeout(function(){return wn(a,void 0,void 0,function(){var l,c;return En(this,function(d){switch(d.label){case 0:return d.trys.push([0,2,,3]),[4,t()];case 1:return d.sent(),[3,3];case 2:return d.sent(),l=n+1,l<this.attempts&&(c=Math.min(r*this.scalar,this.max),this.backoff(t,l,c)),[3,3];case 3:return[2]}})})},r),[2])})})},e})(),Oz=function(e){var t,n,r,a;if(!e)return{};var o={user:e},l=ys();l&&(o.page={url:l.location.href});var c={};if(!e.groups)return o;try{for(var d=ja(Object.keys(e.groups)),f=d.next();!f.done;f=d.next()){var m=f.value,g=e.groups[m];if(g.length>0&&g[0]){var v=g[0],b={group_name:v},S=(a=(r=e.group_properties)===null||r===void 0?void 0:r[m])===null||a===void 0?void 0:a[v];S&&Object.keys(S).length>0&&(b.group_properties=S),c[m]=b}}}catch(w){t={error:w}}finally{try{f&&!f.done&&(n=d.return)&&n.call(d)}finally{if(t)throw t.error}}return Object.keys(c).length>0&&(o.groups=c),delete o.user.groups,delete o.user.group_properties,o},In=function(e){return e==null?{}:typeof e=="string"?{key:e,value:e}:e},r1=function(e){if(!e)return{};var t=void 0;e.metadata&&(t=e.metadata.experimentKey);var n={};return e.key&&(n.key=e.key),e.value&&(n.value=e.value),e.payload&&(n.payload=e.payload),t&&(n.expKey=t),e.metadata&&(n.metadata=e.metadata),n},Mz=(function(){function e(t){this.setProperties={},this.unsetProperties={},this.analyticsProvider=t}return e.prototype.track=function(t){this.setProperties[t.key]!=t.variant.value&&(this.setProperties[t.key]=t.variant.value,delete this.unsetProperties[t.key],this.analyticsProvider.track(t))},e.prototype.setUserProperty=function(t){this.setProperties[t.key]!=t.variant.value&&this.analyticsProvider.setUserProperty(t)},e.prototype.unsetUserProperty=function(t){this.unsetProperties[t.key]||(this.unsetProperties[t.key]="unset",delete this.setProperties[t.key],this.analyticsProvider.unsetUserProperty(t))},e})(),Dz=(function(){function e(t){this.tracked={},this.identity={},this.exposureTrackingProvider=t}return e.prototype.track=function(t,n){var r={userId:n?.user_id,deviceId:n?.device_id};this.identityEquals(this.identity,r)||(this.tracked={}),this.identity=r;var a=t.flag_key in this.tracked,o=this.tracked[t.flag_key];a&&o===t.variant||(this.tracked[t.flag_key]=t.variant,this.exposureTrackingProvider.track(t))},e.prototype.identityEquals=function(t,n){return t.userId===n.userId&&t.deviceId===n.deviceId},e})(),Iz=1e4,Pz=8,Lz=500,zz=1e4,Uz=1.5,i1=6e4,Bz="https://api.lab.eu.amplitude.com",Vz="https://flag.lab.eu.amplitude.com",Fz=(function(){function e(t,n){var r=this,a,o,l,c;this.engine=new G6,this.isRunning=!1,this.apiKey=t,n=Rz(n),this.config=ht(ht(ht({},co),n),{serverUrl:n?.serverUrl||(((a=n?.serverZone)===null||a===void 0?void 0:a.toLowerCase())==="eu"?Bz:co.serverUrl),flagsServerUrl:n?.flagsServerUrl||(((o=n?.serverZone)===null||o===void 0?void 0:o.toLowerCase())==="eu"?Vz:co.flagsServerUrl),flagConfigPollingIntervalMillis:n.flagConfigPollingIntervalMillis<i1?i1:(l=n.flagConfigPollingIntervalMillis)!==null&&l!==void 0?l:co.flagConfigPollingIntervalMillis}),this.logger=new Ez(this.config.loggerProvider||new Tz,e.getLogLevel(n));var d=(c=this.config)===null||c===void 0?void 0:c.internalInstanceNameSuffix;if(this.isWebExperiment=d==="web",this.poller=new sz(function(){return r.doFlags()},this.config.flagConfigPollingIntervalMillis),this.config.initialVariants)for(var f in this.config.initialVariants)this.config.initialVariants[f]=JA(this.config.initialVariants[f]);this.config.userProvider&&(this.userProvider=this.config.userProvider),this.config.analyticsProvider&&(this.analyticsProvider=new Mz(this.config.analyticsProvider)),this.config.exposureTrackingProvider&&(this.userSessionExposureTracker=new Dz(this.config.exposureTrackingProvider)),this.integrationManager=new bz(this.config,this);var m=new vz(this.config.httpClient||XA);this.flagApi=new iz(this.apiKey,this.config.flagsServerUrl,m),this.evaluationApi=new rz(this.apiKey,this.config.serverUrl,m);var g,v=d?"".concat(this.config.instanceName,"-").concat(d):this.config.instanceName;this.isWebExperiment?g=new ZA:g=new Mf,this.variants=kz(this.apiKey,v,g),this.flags=Cz(this.apiKey,v,g),this.fetchVariantsOptions=Az(this.apiKey,v,g);try{this.flags.load(),this.variants.load(),this.fetchVariantsOptions.load()}catch{}this.mergeInitialFlagsWithStorage()}return e.prototype.start=function(t){return wn(this,void 0,void 0,function(){var n,r,a,o;return En(this,function(l){switch(l.label){case 0:if(this.isRunning)return[2];this.isRunning=!0,this.setUser(t),l.label=1;case 1:return l.trys.push([1,6,,7]),n=this.doFlags(),r=(o=this.config.fetchOnStart)!==null&&o!==void 0?o:!0,r?[4,Promise.all([this.fetch(t),n])]:[3,3];case 2:return l.sent(),[3,5];case 3:return[4,n];case 4:l.sent(),l.label=5;case 5:return[3,7];case 6:if(a=l.sent(),this.config.throwOnError)throw a;return[3,7];case 7:return this.config.pollOnStart&&this.poller.start(),[2]}})})},e.prototype.stop=function(){this.isRunning&&(this.poller.stop(),this.isRunning=!1)},e.prototype.fetch=function(){return wn(this,arguments,void 0,function(t,n){var r;return t===void 0&&(t=this.user),En(this,function(a){switch(a.label){case 0:this.setUser(t||{}),a.label=1;case 1:return a.trys.push([1,3,,4]),[4,this.fetchInternal(t,this.config.fetchTimeoutMillis,this.config.retryFetchOnFailure,n)];case 2:return a.sent(),[3,4];case 3:if(r=a.sent(),this.config.throwOnError)throw r;return r instanceof qg?this.logger.debug(r):this.logger.error(r),[3,4];case 4:return[2,this]}})})},e.prototype.variant=function(t,n){var r,a;if(!this.apiKey)return{value:void 0};var o=this.variantAndSource(t,n);return this.config.automaticExposureTracking&&this.exposureInternal(t,o),this.logger.debug("[Experiment] variant for ".concat(t," is ").concat(((r=o.variant)===null||r===void 0?void 0:r.key)||((a=o.variant)===null||a===void 0?void 0:a.value))),o.variant||{}},e.prototype.exposure=function(t){var n=this.variantAndSource(t);this.exposureInternal(t,n)},e.prototype.all=function(){if(!this.apiKey)return{};var t=this.evaluate();for(var n in t){var r=this.flags.get(n);n1(r)||delete t[n]}return ht(ht(ht({},this.secondaryVariants()),this.sourceVariants()),t)},e.prototype.clear=function(){this.variants.clear();try{this.variants.store()}catch{}},e.prototype.getUser=function(){var t;if(!this.user)return this.user;if(!((t=this.user)===null||t===void 0)&&t.user_properties){var n=ht({},this.user.user_properties);return ht(ht({},this.user),{user_properties:n})}else return ht({},this.user)},e.prototype.setUser=function(t){var n;if(!t){this.user=null;return}if(!((n=this.user)===null||n===void 0)&&n.user_properties){var r=ht({},t.user_properties);this.user=ht(ht({},t),{user_properties:r})}else this.user=ht({},t)},e.prototype.getUserProvider=function(){return this.userProvider},e.prototype.setUserProvider=function(t){return this.userProvider=t,this},e.prototype.mergeInitialFlagsWithStorage=function(){var t=this;if(this.config.initialFlags){var n=JSON.parse(this.config.initialFlags);n.forEach(function(r){t.flags.get(r.key)||t.flags.put(r.key,r)})}},e.prototype.evaluate=function(t){var n,r,a=this.addContext(this.user),o=K6(this.flags.getAll(),t),l=Oz(a),c=this.engine.evaluate(l,o),d={};try{for(var f=ja(Object.keys(c)),m=f.next();!m.done;m=f.next()){var g=m.value;d[g]=r1(c[g])}}catch(v){n={error:v}}finally{try{m&&!m.done&&(r=f.return)&&r.call(f)}finally{if(n)throw n.error}}return d},e.prototype.variantAndSource=function(t,n){var r={};this.config.source===Ui.LocalStorage?r=this.localStorageVariantAndSource(t,n):this.config.source===Ui.InitialVariants&&(r=this.initialVariantsVariantAndSource(t,n));var a=this.flags.get(t);return(n1(a)||!r.variant&&a)&&(r=this.localEvaluationVariantAndSource(t,a,n)),r},e.prototype.localEvaluationVariantAndSource=function(t,n,r){var a,o={},l=this.evaluate([n.key])[t],c=dn.LocalEvaluation,d=(a=l?.metadata)===null||a===void 0?void 0:a.default;if(!Ur(l)&&!d)return{variant:In(l),source:c,hasDefaultVariant:!1};if(d&&(o={variant:In(l),source:c,hasDefaultVariant:!0}),!Ur(r))return{variant:In(r),source:dn.FallbackInline,hasDefaultVariant:o.hasDefaultVariant};var f=this.config.initialVariants[t];if(!Ur(f))return{variant:In(f),source:dn.SecondaryInitialVariants,hasDefaultVariant:o.hasDefaultVariant};var m=In(this.config.fallbackVariant),g={variant:m,source:dn.FallbackConfig,hasDefaultVariant:o.hasDefaultVariant};return jm(m)?o:g},e.prototype.localStorageVariantAndSource=function(t,n){var r,a={},o=this.variants.get(t),l=(r=o?.metadata)===null||r===void 0?void 0:r.default;if(!Ur(o)&&!l)return{variant:In(o),source:dn.LocalStorage,hasDefaultVariant:!1};if(l&&(a={variant:In(o),source:dn.LocalStorage,hasDefaultVariant:!0}),!Ur(n))return{variant:In(n),source:dn.FallbackInline,hasDefaultVariant:a.hasDefaultVariant};var c=this.config.initialVariants[t];if(!Ur(c))return{variant:In(c),source:dn.SecondaryInitialVariants,hasDefaultVariant:a.hasDefaultVariant};var d=In(this.config.fallbackVariant),f={variant:d,source:dn.FallbackConfig,hasDefaultVariant:a.hasDefaultVariant};return jm(d)?a:f},e.prototype.initialVariantsVariantAndSource=function(t,n){var r,a={},o=this.config.initialVariants[t];if(!Ur(o))return{variant:In(o),source:dn.InitialVariants,hasDefaultVariant:!1};var l=this.variants.get(t),c=(r=l?.metadata)===null||r===void 0?void 0:r.default;if(!Ur(l)&&!c)return{variant:In(l),source:dn.LocalStorage,hasDefaultVariant:!1};if(c&&(a={variant:In(l),source:dn.LocalStorage,hasDefaultVariant:!0}),!Ur(n))return{variant:In(n),source:dn.FallbackInline,hasDefaultVariant:a.hasDefaultVariant};var d=In(this.config.fallbackVariant),f={variant:d,source:dn.FallbackConfig,hasDefaultVariant:a.hasDefaultVariant};return jm(d)?a:f},e.prototype.fetchInternal=function(t,n,r,a){return wn(this,void 0,void 0,function(){var o,l,c;return En(this,function(d){switch(d.label){case 0:if(!this.apiKey)throw Error("Experiment API key is empty");this.logger.debug("[Experiment] Fetch all: retry=".concat(r)),r&&this.stopRetries(),d.label=1;case 1:return d.trys.push([1,4,,5]),[4,this.doFetch(t,n,ht({trackingOption:(c=this.fetchVariantsOptions.get())===null||c===void 0?void 0:c.trackingOption},a))];case 2:return o=d.sent(),[4,this.storeVariants(o,a)];case 3:return d.sent(),[2,o];case 4:throw l=d.sent(),r&&this.shouldRetryFetch(l)&&this.startRetries(t,a),l;case 5:return[2]}})})},e.prototype.setTracksAssignment=function(t){return wn(this,void 0,void 0,function(){return En(this,function(n){return this.fetchVariantsOptions.put(ht(ht({},this.fetchVariantsOptions.get()||{}),{trackingOption:t?"track":"no-track"})),this.fetchVariantsOptions.store(),[2]})})},e.prototype.cleanUserPropsForFetch=function(t){var n=ht({},t);return delete n.cookie,n},e.prototype.doFetch=function(t,n,r){return wn(this,void 0,void 0,function(){var a,o,l,c,d,f,m;return En(this,function(g){switch(g.label){case 0:return[4,this.addContextOrWait(t)];case 1:return t=g.sent(),t=this.cleanUserPropsForFetch(t),this.logger.debug("[Experiment] Fetch variants for user: ",t),[4,this.evaluationApi.getVariants(t,ht({timeoutMillis:n},r))];case 2:a=g.sent(),o={};try{for(l=ja(Object.keys(a)),c=l.next();!c.done;c=l.next())d=c.value,o[d]=r1(a[d])}catch(v){f={error:v}}finally{try{c&&!c.done&&(m=l.return)&&m.call(l)}finally{if(f)throw f.error}}return this.logger.debug("[Experiment] Received variants: ",o),[2,o]}})})},e.prototype.doFlags=function(){return wn(this,void 0,void 0,function(){var t,n,r;return En(this,function(a){switch(a.label){case 0:return a.trys.push([0,4,,5]),t=void 0,this.isWebExperiment?[4,this.addContextOrWait(this.getUser())]:[3,2];case 1:t=a.sent(),a.label=2;case 2:return[4,this.flagApi.getFlags({libraryName:"experiment-js-client",libraryVersion:t1,timeoutMillis:this.config.fetchTimeoutMillis,deliveryMethod:this.isWebExperiment?"web":void 0,user:t?.user_id||t?.device_id?{user_id:t?.user_id,device_id:t?.device_id}:void 0})];case 3:return n=a.sent(),this.flags.clear(),this.flags.putAll(n),[3,5];case 4:if(r=a.sent(),r instanceof qg){if(this.logger.debug(r),this.config.throwOnError)throw r}else throw r;return[3,5];case 5:try{this.flags.store()}catch{}return this.mergeInitialFlagsWithStorage(),[2]}})})},e.prototype.storeVariants=function(t,n){return wn(this,void 0,void 0,function(){var r,a,o,l,l;return En(this,function(c){r=n&&n.flagKeys?n.flagKeys:[],r.length===0&&this.variants.clear(),a=function(d){r=r.filter(function(f){return f!==d}),o.variants.put(d,t[d])},o=this;for(l in t)a(l);for(l in r)this.variants.remove(l);try{this.variants.store()}catch{}return this.logger.debug("[Experiment] Stored variants: ",t),[2]})})},e.prototype.startRetries=function(t,n){return wn(this,void 0,void 0,function(){var r=this;return En(this,function(a){return this.logger.debug("[Experiment] Retry fetch"),this.retriesBackoff=new _z(Pz,Lz,zz,Uz),this.retriesBackoff.start(function(){return wn(r,void 0,void 0,function(){return En(this,function(o){switch(o.label){case 0:return[4,this.fetchInternal(t,Iz,!1,n)];case 1:return o.sent(),[2]}})})}),[2]})})},e.prototype.stopRetries=function(){this.retriesBackoff&&this.retriesBackoff.cancel()},e.prototype.addContext=function(t){var n,r=(n=this.userProvider)===null||n===void 0?void 0:n.getUser(),a=this.integrationManager.getUser(),o=ht(ht(ht({},r?.user_properties),a.user_properties),t?.user_properties);return ht(ht(ht(ht({library:"experiment-js-client/".concat(t1)},r),a),t),{user_properties:o})},e.prototype.addContextOrWait=function(t){return wn(this,void 0,void 0,function(){return En(this,function(n){switch(n.label){case 0:return[4,this.integrationManager.ready()];case 1:return n.sent(),[2,this.addContext(t)]}})})},e.prototype.sourceVariants=function(){if(this.config.source==Ui.LocalStorage)return this.variants.getAll();if(this.config.source==Ui.InitialVariants)return this.config.initialVariants},e.prototype.secondaryVariants=function(){if(this.config.source==Ui.LocalStorage)return this.config.initialVariants;if(this.config.source==Ui.InitialVariants)return this.variants.getAll()},e.prototype.exposureInternal=function(t,n){var r,a,o,l,c,d,f,m,g,v=(o=(a=(r=n.variant)===null||r===void 0?void 0:r.metadata)===null||a===void 0?void 0:a.trackExposure)!==null&&o!==void 0?o:!0;if(v){this.legacyExposureInternal(t,n.variant,n.source);var b={flag_key:t},S=e1(n.source);if(!(S&&!n.hasDefaultVariant)){!((l=n.variant)===null||l===void 0)&&l.expKey&&(b.experiment_key=(c=n.variant)===null||c===void 0?void 0:c.expKey);var w=(d=n.variant)===null||d===void 0?void 0:d.metadata;if(!S&&!w?.default&&(!((f=n.variant)===null||f===void 0)&&f.key?b.variant=n.variant.key:!((m=n.variant)===null||m===void 0)&&m.value&&(b.variant=n.variant.value)),w&&(b.metadata=w),this.isWebExperiment&&(b.time=Date.now()),this.isWebExperiment){var E=ys();if(E?.location)try{var T=E.location.href;b.metadata.url=T.split("?")[0]||""}catch{}}var C=this.addContext(this.getUser());(g=this.userSessionExposureTracker)===null||g===void 0||g.track(b,C),this.integrationManager.track(b,C)}}},e.prototype.legacyExposureInternal=function(t,n,r){var a,o,l,c,d;if(this.analyticsProvider){var f=this.addContext(this.getUser()),m=jz(f,t,n,r);e1(r)||!n?.value?(o=(a=this.analyticsProvider)===null||a===void 0?void 0:a.unsetUserProperty)===null||o===void 0||o.call(a,m):n?.value&&((c=(l=this.analyticsProvider)===null||l===void 0?void 0:l.setUserProperty)===null||c===void 0||c.call(l,m),(d=this.analyticsProvider)===null||d===void 0||d.track(m))}},e.getLogLevel=function(t){var n;return t.debug===!0?Vr.Debug:(n=t.logLevel)!==null&&n!==void 0?n:Vr.Error},e.prototype.shouldRetryFetch=function(t){return t instanceof WA?t.statusCode<400||t.statusCode>=500||t.statusCode===429:!0},e.prototype.addPlugin=function(t){t.type==="integration"&&this.integrationManager.setIntegration(t)},e})(),Hz=(function(){function e(t,n){var r,a,o;this.globalScope=ys(),this.userAgent=typeof((r=this.globalScope)===null||r===void 0?void 0:r.navigator)<"u"?(a=this.globalScope)===null||a===void 0?void 0:a.navigator.userAgent:void 0,this.ua=new uz.UAParser(this.userAgent).getResult(),this.localStorage=new Mf,this.sessionStorage=new ZA,this.userProvider=t,this.apiKey=n,this.storageKey="EXP_".concat((o=this.apiKey)===null||o===void 0?void 0:o.slice(0,10),"_DEFAULT_USER_PROVIDER")}return e.prototype.getUser=function(){var t,n,r,a,o,l=((t=this.userProvider)===null||t===void 0?void 0:t.getUser())||{};return ht({language:this.getLanguage(),platform:"Web",os:this.getOs(this.ua),device_model:this.getDeviceModel(this.ua),device_category:(r=(n=this.ua.device)===null||n===void 0?void 0:n.type)!==null&&r!==void 0?r:"desktop",referring_url:(o=(a=this.globalScope)===null||a===void 0?void 0:a.document)===null||o===void 0?void 0:o.referrer.replace(/\/$/,""),cookie:this.getCookie(),browser:this.getBrowser(this.ua),landing_url:this.getLandingUrl(),first_seen:this.getFirstSeen(),url_param:this.getUrlParam(),user_agent:this.userAgent},l)},e.prototype.getLanguage=function(){return typeof navigator<"u"&&(navigator.languages&&navigator.languages[0]||navigator.language)||""},e.prototype.getOs=function(t){var n,r;return[(n=t.browser)===null||n===void 0?void 0:n.name,(r=t.browser)===null||r===void 0?void 0:r.major].filter(function(a){return a!=null}).join(" ")},e.prototype.getDeviceModel=function(t){var n;return(n=t.os)===null||n===void 0?void 0:n.name},e.prototype.getBrowser=function(t){var n,r=(n=t.browser)===null||n===void 0?void 0:n.name;return r?.includes("Chrom")&&(r="Chrome"),r?.includes("Firefox")&&(r="Firefox"),r?.includes("Safari")&&(r="Safari"),r?.includes("Edge")&&(r="Edge"),r?.includes("Opera")&&(r="Opera"),r},e.prototype.getCookie=function(){var t,n,r,a,o;if(!((n=(t=this.globalScope)===null||t===void 0?void 0:t.document)===null||n===void 0)&&n.cookie)return Object.fromEntries((o=(a=(r=this.globalScope)===null||r===void 0?void 0:r.document)===null||a===void 0?void 0:a.cookie)===null||o===void 0?void 0:o.split("; ").map(function(l){return l.split("=")}))},e.prototype.getLandingUrl=function(){var t,n;try{var r=JSON.parse(this.sessionStorage.get(this.storageKey)||"{}");return r.landing_url||(r.landing_url=(n=(t=this.globalScope)===null||t===void 0?void 0:t.location)===null||n===void 0?void 0:n.href.replace(/\/$/,""),this.sessionStorage.put(this.storageKey,JSON.stringify(r))),r.landing_url}catch{return}},e.prototype.getFirstSeen=function(){try{var t=JSON.parse(this.localStorage.get(this.storageKey)||"{}");return t.first_seen||(t.first_seen=(Date.now()/1e3).toString(),this.localStorage.put(this.storageKey,JSON.stringify(t))),t.first_seen}catch{return}},e.prototype.getUrlParam=function(){var t,n,r;if(this.globalScope){var a={};try{var o=new URL(this.globalScope.location.href);try{for(var l=ja(o.searchParams),c=l.next();!c.done;c=l.next()){var d=Nn(c.value,2),f=d[0],m=d[1];a[f]=Ar(Ar([],Nn((r=a[f])!==null&&r!==void 0?r:[]),!1),Nn(m.split(",")),!1)}}catch(g){t={error:g}}finally{try{c&&!c.done&&(n=l.return)&&n.call(l)}finally{if(t)throw t.error}}}catch{return}return Object.entries(a).reduce(function(g,v){var b=Nn(v,2),S=b[0],w=b[1];return g[S]=w.length==1?w[0]:w,g},{})}},e})();ln.experimentInstances={};var a1=ln.experimentInstances,qz=function(e,t){var n=function(){return new fz(e,Gv.getInstance(eN(t)),1e4)};return $z(e,t,n)},eN=function(e){return e?.instanceName||co.instanceName},Gz=function(e,t){var n=eN(t),r=t?.internalInstanceNameSuffix;return r?"".concat(n,".").concat(e,".").concat(r):"".concat(n,".").concat(e)},Kz=function(e,t){return new Fz(e,ht(ht({},t),{userProvider:new Hz(t?.userProvider,e)}))},$z=function(e,t,n){var r=Gz(e,t),a=a1[r];return a||(a=Kz(e,t),n&&a.addPlugin(n()),a1[r]=a,a)},Bd=(function(){function e(t){this.name=e.pluginName,this.config=t}return e.prototype.setup=function(t,n){var r;return te(this,void 0,void 0,function(){return ee(this,function(a){return this.experiment=qz(((r=this.config)===null||r===void 0?void 0:r.deploymentKey)||t.apiKey,this.config),[2]})})},e.pluginName="@amplitude/experiment-analytics-plugin",e})(),Yz=function(e){return new Bd(e)},Wz=(function(){function e(){}return e.prototype.getApplicationContext=function(){return{versionName:this.versionName,language:Xz(),platform:"Web",os:void 0,deviceModel:void 0}},e})(),Xz=function(){return typeof navigator<"u"&&(navigator.languages&&navigator.languages[0]||navigator.language)||""},Qz=(function(){function e(){this.queue=[]}return e.prototype.logEvent=function(t){this.receiver?this.receiver(t):this.queue.length<512&&this.queue.push(t)},e.prototype.setEventReceiver=function(t){this.receiver=t,this.queue.length>0&&(this.queue.forEach(function(n){t(n)}),this.queue=[])},e})(),xa=function(){return xa=Object.assign||function(e){for(var t,n=1,r=arguments.length;n<r;n++){t=arguments[n];for(var a in t)Object.prototype.hasOwnProperty.call(t,a)&&(e[a]=t[a])}return e},xa.apply(this,arguments)};function Vd(e){var t=typeof Symbol=="function"&&Symbol.iterator,n=t&&e[t],r=0;if(n)return n.call(e);if(e&&typeof e.length=="number")return{next:function(){return e&&r>=e.length&&(e=void 0),{value:e&&e[r++],done:!e}}};throw new TypeError(t?"Object is not iterable.":"Symbol.iterator is not defined.")}function s1(e,t){var n=typeof Symbol=="function"&&e[Symbol.iterator];if(!n)return e;var r=n.call(e),a,o=[],l;try{for(;(t===void 0||t-- >0)&&!(a=r.next()).done;)o.push(a.value)}catch(c){l={error:c}}finally{try{a&&!a.done&&(n=r.return)&&n.call(r)}finally{if(l)throw l.error}}return o}var Fd=function(e,t){var n,r,a=["string","number","boolean","undefined"],o=typeof e,l=typeof t;if(o!==l)return!1;try{for(var c=Vd(a),d=c.next();!d.done;d=c.next()){var f=d.value;if(f===o)return e===t}}catch(E){n={error:E}}finally{try{d&&!d.done&&(r=c.return)&&r.call(c)}finally{if(n)throw n.error}}if(e==null&&t==null)return!0;if(e==null||t==null||e.length!==t.length)return!1;var m=Array.isArray(e),g=Array.isArray(t);if(m!==g)return!1;if(m&&g){for(var v=0;v<e.length;v++)if(!Fd(e[v],t[v]))return!1}else{var b=Object.keys(e).sort(),S=Object.keys(t).sort();if(!Fd(b,S))return!1;var w=!0;return Object.keys(e).forEach(function(E){Fd(e[E],t[E])||(w=!1)}),w}return!0},Jz="$set",Zz="$unset",eU="$clearAll";Object.entries||(Object.entries=function(e){for(var t=Object.keys(e),n=t.length,r=new Array(n);n--;)r[n]=[t[n],e[t[n]]];return r});var tU=(function(){function e(){this.identity={userProperties:{}},this.listeners=new Set}return e.prototype.editIdentity=function(){var t=this,n=xa({},this.identity.userProperties),r=xa(xa({},this.identity),{userProperties:n});return{setUserId:function(a){return r.userId=a,this},setDeviceId:function(a){return r.deviceId=a,this},setUserProperties:function(a){return r.userProperties=a,this},setOptOut:function(a){return r.optOut=a,this},updateUserProperties:function(a){var o,l,c,d,f,m,g=r.userProperties||{};try{for(var v=Vd(Object.entries(a)),b=v.next();!b.done;b=v.next()){var S=s1(b.value,2),w=S[0],E=S[1];switch(w){case Jz:try{for(var T=(c=void 0,Vd(Object.entries(E))),C=T.next();!C.done;C=T.next()){var k=s1(C.value,2),j=k[0],N=k[1];g[j]=N}}catch(L){c={error:L}}finally{try{C&&!C.done&&(d=T.return)&&d.call(T)}finally{if(c)throw c.error}}break;case Zz:try{for(var R=(f=void 0,Vd(Object.keys(E))),P=R.next();!P.done;P=R.next()){var j=P.value;delete g[j]}}catch(L){f={error:L}}finally{try{P&&!P.done&&(m=R.return)&&m.call(R)}finally{if(f)throw f.error}}break;case eU:g={};break}}}catch(L){o={error:L}}finally{try{b&&!b.done&&(l=v.return)&&l.call(v)}finally{if(o)throw o.error}}return r.userProperties=g,this},commit:function(){return t.setIdentity(r),this}}},e.prototype.getIdentity=function(){return xa({},this.identity)},e.prototype.setIdentity=function(t){var n=xa({},this.identity);this.identity=xa({},t),Fd(n,this.identity)||this.listeners.forEach(function(r){r(t)})},e.prototype.addIdentityListener=function(t){this.listeners.add(t)},e.prototype.removeIdentityListener=function(t){this.listeners.delete(t)},e})(),Hl=typeof globalThis<"u"?globalThis:typeof window<"u"?window:self,nU=(function(){function e(){this.identityStore=new tU,this.eventBridge=new Qz,this.applicationContextProvider=new Wz}return e.getInstance=function(t){return Hl.analyticsConnectorInstances||(Hl.analyticsConnectorInstances={}),Hl.analyticsConnectorInstances[t]||(Hl.analyticsConnectorInstances[t]=new e),Hl.analyticsConnectorInstances[t]},e})(),o1=["boot"],rU="$default_instance";function iU(e){var t,n,r,a,o,l,c,d,f;let m=typeof window<"u"?window.engagement:void 0,g=!1,v={_q:(t=m?._q)!=null?t:[],_configuration:{apiKey:(r=(n=m?._configuration)==null?void 0:n.apiKey)!=null?r:"",serverUrl:(a=m?._configuration)==null?void 0:a.serverUrl,chatUrl:(o=m?._configuration)==null?void 0:o.chatUrl,mediaUrl:(l=m?._configuration)==null?void 0:l.mediaUrl,serverZone:(d=(c=m?._configuration)==null?void 0:c.serverZone)!=null?d:"US",options:{...(f=m?._configuration)==null?void 0:f.options}},init(S,w){var E,T,C,k;if(v._configuration.apiKey){console.log("Engagement SDK has already been initialized. Ignoring additional init call.");return}if(w!=null&&w.useEngagementDomain){let L=((E=w.serverZone)!=null?E:v._configuration.serverZone)==="EU",H="amplitudeengagement.com";w.serverUrl||(w.serverUrl=L?`https://gs.eu.${H}`:`https://gs.${H}`),w.chatUrl||(w.chatUrl=L?`https://houston-chat.eu.${H}`:`https://houston-chat.${H}`),w.mediaUrl||(w.mediaUrl=L?`https://engagement-static.eu.${H}`:`https://engagement-static.${H}`),w.cdnUrl||(w.cdnUrl=L?`https://cdn.eu.${H}`:`https://cdn.${H}`)}v._configuration={...v._configuration,...w,apiKey:S,options:{splitting:!0,...v._configuration.options,...w?.options}},(C=(T=v._configuration)==null?void 0:T.options)!=null&&C.logger&&v._configuration.options.logger.enable((k=v._configuration.options.logLevel)!=null?k:2);let j;if(w!=null&&w.cdnUrl)v._configuration.options.splitting?j=`${w.cdnUrl}/engagement-browser/prod/split/index.js`:j=w.cdnUrl+"/engagement-browser/prod/index.min.js.gz";else{let L=v._configuration.serverZone==="EU"?"https://cdn.eu.amplitude.com":"https://cdn.amplitude.com";v._configuration.options.splitting?j=`${L}/engagement-browser/prod/split/index.js`:j=`${L}/engagement-browser/prod/index.min.js.gz`}let N=null,R=()=>{if(g=!0,N&&(clearTimeout(N),N=null),v._q&&v._q.length>0)for(console.warn(`Engagement SDK failed to load within ${P}ms. Resolving pending calls gracefully.`);v._q.length>0;){let L=v._q.shift();if(!L)continue;let H=L[0],D=o1.includes(H);if(console.warn(`Engagement SDK method '${H}' still in queue (isAsyncMethod=${D}); attempting to resolve as no-op.`),D&&L[1]instanceof Function&&L[2]instanceof Function){let B=L[1];console.warn(`Engagement SDK method '${H}' resolved as no-op due to script loading failure`),B(void 0)}}};e(j,v._configuration.options.splitting?"module":void 0,w?.nonce,R);let P=1e4;N=setTimeout(()=>{R()},P)},plugin(S){let w=v.init;return{name:"@amplitude/engagement-browser",type:"enrichment",async setup(E,T){var C;let k=(C=E.instanceName)!=null?C:rU,j=nU.getInstance(k).identityStore;w(E.apiKey,{serverZone:E.serverZone,...S,options:{logLevel:E.logLevel,logger:E.loggerProvider,...S?.options}});let N=[{track:R=>{T.track(R)}}];await window.engagement.boot({user:()=>{let R=j.getIdentity();return{user_id:T.getUserId(),device_id:T.getDeviceId(),user_properties:R.userProperties,getSessionId:T.getSessionId}},integrations:N}),j.addIdentityListener(R=>{var P,L,H,D;if(!((P=window.engagement)!=null&&P._.user)||!((L=window.engagement)!=null&&L._analytics.hasBooted)){console.warn("Engagement SDK not booted. Ignoring identity change.");return}((D=(H=window.engagement)==null?void 0:H._.user)==null?void 0:D.user_id)!==R.userId?(window.engagement.shutdown(),window.engagement.boot({user:()=>{let B=j.getIdentity();return{user_id:T.getUserId(),device_id:T.getDeviceId(),user_properties:B.userProperties,getSessionId:T.getSessionId}},integrations:N})):window.engagement._setUserProperties(R.userProperties)})},async execute(E){return window.engagement.forwardEvent(E),E}}}},b=v;return new Proxy(v,{get:function(S,w){if(w in b)return b[w];if(w!=="then")return w==="gs"||w==="rc"?new Proxy({},{get:function(E,T){return function(){let C=Array.from(arguments),k=`${w}.${T}`;C.unshift(k),v._q.push(C)}}}):o1.includes(w)?function(){let E=Array.prototype.slice.call(arguments);return new Promise((T,C)=>{E.unshift(w,T,C),v._q.push(E),g&&T(void 0)})}:function(){let E=Array.prototype.slice.call(arguments);E.unshift(w),v._q.push(E)}}})}var tN=(e=>(e.Local="https://local.amplitude.com:3010/",e.Staging="https://apps.stag2.amplitude.com/",e.Production="https://app.amplitude.com/",e.ProductionEU="https://app.eu.amplitude.com/",e))(tN||{}),aU=e=>{if(typeof window<"u"&&window.opener)for(let t of Object.values(tN))window.opener.postMessage({message:e},t)};function sU(e,t,n,r){for(let a of e){let o=document.createElement("script");o.src=a,o.id="engagement-sdk-bundle",n&&o.setAttribute("nonce",n),t&&o.setAttribute("type",t),r&&(o.onerror=r),document.getElementsByTagName("head")[0].appendChild(o)}}var oU=()=>(aU("ENGAGEMENT_SNIPPET"),iU((e,t,n,r)=>sU([e||"https://cdn.amplitude.com/engagement-browser/prod/index.min.js.gz"],t,n,r))),l1=oU(),lU=e=>(typeof window<"u"&&!window.engagement&&(window.engagement=l1),l1.plugin(e)),uU="1.0.4",cU="amplitude-ts-unified",dU=function(){return{type:"enrichment",name:"@amplitude/unified-library-plugin",execute:function(e){var t;return te(this,void 0,void 0,function(){return ee(this,function(n){return e.library="".concat(cU,"/").concat(uU,"-").concat((t=e.library)!==null&&t!==void 0?t:""),[2,e]})})}}},fU=(function(e){Or(t,e);function t(){return e!==null&&e.apply(this,arguments)||this}return t.prototype.sessionReplay=function(){return this._sessionReplay},t.prototype.experiment=function(){if(this.config!==void 0){var n=this.plugins(Bd);if(n.length===0){this.config.loggerProvider.debug("".concat(Bd.pluginName," plugin is not found."));return}else{if(n.length===1)return n[0].experiment;this.config.loggerProvider.debug("Multiple instances of ".concat(Bd.pluginName," are found."));return}}},t.prototype.initAll=function(n,r){return te(this,void 0,void 0,function(){var a,o;return ee(this,function(l){switch(l.label){case 0:return a={serverZone:r?.serverZone,instanceName:r?.instanceName},e.prototype.add.call(this,dU()),[4,e.prototype.init.call(this,n,ce(ce({},r?.analytics),a)).promise];case 1:return l.sent(),[4,e.prototype.add.call(this,R6(ce(ce({},r?.sessionReplay),a))).promise];case 2:return l.sent(),[4,e.prototype.add.call(this,Yz(ce(ce({},r?.experiment),a))).promise];case 3:return l.sent(),o=this.plugin(Ug.pluginName),o===void 0?this.config.loggerProvider.debug("".concat(Ug.pluginName," plugin is not found.")):this._sessionReplay=o.sessionReplay,[4,e.prototype.add.call(this,lU(ce(ce({},r?.engagement),a))).promise];case 4:return l.sent(),[2]}})})},t.prototype.init=function(n,r,a){n===void 0&&(n="");var o=e.prototype.init.call(this,n,r,a);return o},t})(LL),hU=function(){var e=new fU;return{_setDiagnosticsSampleRate:it(e._setDiagnosticsSampleRate.bind(e),"_setDiagnosticsSampleRate",Tt(e),kt(e,["config"])),_enableRequestBodyCompressionExperimental:it(e._enableRequestBodyCompressionExperimental.bind(e),"_enableRequestBodyCompressionExperimental",Tt(e),kt(e,["config"])),experiment:it(e.experiment.bind(e),"experiment",Tt(e),kt(e,["config"])),sessionReplay:it(e.sessionReplay.bind(e),"sessionReplay",Tt(e),kt(e,["config"])),initAll:it(e.initAll.bind(e),"initAll",Tt(e),kt(e,["config"])),init:it(e.init.bind(e),"init",Tt(e),kt(e,["config"])),add:it(e.add.bind(e),"add",Tt(e),kt(e,["config.apiKey","timeline.plugins"])),remove:it(e.remove.bind(e),"remove",Tt(e),kt(e,["config.apiKey","timeline.plugins"])),track:it(e.track.bind(e),"track",Tt(e),kt(e,["config.apiKey","timeline.queue.length"])),logEvent:it(e.logEvent.bind(e),"logEvent",Tt(e),kt(e,["config.apiKey","timeline.queue.length"])),identify:it(e.identify.bind(e),"identify",Tt(e),kt(e,["config.apiKey","timeline.queue.length"])),groupIdentify:it(e.groupIdentify.bind(e),"groupIdentify",Tt(e),kt(e,["config.apiKey","timeline.queue.length"])),setGroup:it(e.setGroup.bind(e),"setGroup",Tt(e),kt(e,["config.apiKey","timeline.queue.length"])),revenue:it(e.revenue.bind(e),"revenue",Tt(e),kt(e,["config.apiKey","timeline.queue.length"])),flush:it(e.flush.bind(e),"flush",Tt(e),kt(e,["config.apiKey","timeline.queue.length"])),getUserId:it(e.getUserId.bind(e),"getUserId",Tt(e),kt(e,["config","config.userId"])),setUserId:it(e.setUserId.bind(e),"setUserId",Tt(e),kt(e,["config","config.userId"])),getDeviceId:it(e.getDeviceId.bind(e),"getDeviceId",Tt(e),kt(e,["config","config.deviceId"])),setDeviceId:it(e.setDeviceId.bind(e),"setDeviceId",Tt(e),kt(e,["config","config.deviceId"])),reset:it(e.reset.bind(e),"reset",Tt(e),kt(e,["config","config.userId","config.deviceId"])),getSessionId:it(e.getSessionId.bind(e),"getSessionId",Tt(e),kt(e,["config"])),setSessionId:it(e.setSessionId.bind(e),"setSessionId",Tt(e),kt(e,["config"])),extendSession:it(e.extendSession.bind(e),"extendSession",Tt(e),kt(e,["config"])),setOptOut:it(e.setOptOut.bind(e),"setOptOut",Tt(e),kt(e,["config"])),getOptOut:it(e.getOptOut.bind(e),"getOptOut",Tt(e),kt(e,["config"])),setTransport:it(e.setTransport.bind(e),"setTransport",Tt(e),kt(e,["config"])),getIdentity:it(e.getIdentity.bind(e),"getIdentity",Tt(e),kt(e,["config"])),setIdentity:it(e.setIdentity.bind(e),"setIdentity",Tt(e),kt(e,["config","config.userId","config.deviceId"]))}};const nN=hU();var pU=nN.initAll,mU=nN.track;const gU="59c3e241b838466cd5fc0657b380fb4b",u1="__animaAmplitudeInitialized";function rN(){return typeof window>"u"?null:window}function iN(){const e=rN();!e||e[u1]||(pU(gU,{analytics:{autocapture:!0},sessionReplay:{sampleRate:1}}),e[u1]=!0)}function c1(e,t){rN()&&(iN(),mU(e,t))}const d1="anima.gateway.device-identity.v1";function Gg(e){let t="";for(const n of e)t+=String.fromCharCode(n);return btoa(t).replaceAll("+","-").replaceAll("/","_").replace(/=+$/g,"")}function aN(e){const t=e.replaceAll("-","+").replaceAll("_","/"),n=t+"=".repeat((4-t.length%4)%4),r=atob(n),a=new Uint8Array(r.length);for(let o=0;o<r.length;o+=1)a[o]=r.charCodeAt(o);return a}function vU(e){return Array.from(e).map(t=>t.toString(16).padStart(2,"0")).join("")}function Kg(e){return e.buffer.slice(e.byteOffset,e.byteOffset+e.byteLength)}async function sN(e){const t=await crypto.subtle.digest("SHA-256",Kg(e));return vU(new Uint8Array(t))}async function yU(){if(!crypto?.subtle)throw new Error("WebCrypto is unavailable in this browser context.");const e=await crypto.subtle.generateKey({name:"Ed25519"},!0,["sign","verify"]),t=new Uint8Array(await crypto.subtle.exportKey("raw",e.publicKey)),n=new Uint8Array(await crypto.subtle.exportKey("pkcs8",e.privateKey));return{deviceId:await sN(t),publicKey:Gg(t),privateKey:Gg(n)}}async function bU(){if(typeof window>"u")throw new Error("Device identity requires a browser context.");try{const n=window.localStorage.getItem(d1);if(n){const r=JSON.parse(n);if(r?.version===1&&typeof r.deviceId=="string"&&typeof r.publicKey=="string"&&typeof r.privateKey=="string"&&await sN(aN(r.publicKey))===r.deviceId)return{deviceId:r.deviceId,publicKey:r.publicKey,privateKey:r.privateKey}}}catch{}const e=await yU(),t={version:1,deviceId:e.deviceId,publicKey:e.publicKey,privateKey:e.privateKey,createdAtMs:Date.now()};try{window.localStorage.setItem(d1,JSON.stringify(t))}catch{}return e}async function xU(e,t){if(!crypto?.subtle)throw new Error("WebCrypto is unavailable in this browser context.");const n=aN(e),r=await crypto.subtle.importKey("pkcs8",Kg(n),{name:"Ed25519"},!1,["sign"]),a=new TextEncoder().encode(t),o=await crypto.subtle.sign({name:"Ed25519"},r,Kg(a));return Gg(new Uint8Array(o))}function SU(e){const t=e.nonce?"v2":"v1",n=e.scopes.join(","),r=e.token??"",a=[t,e.deviceId,e.clientId,e.clientMode,e.role,n,String(e.signedAtMs),r];return t==="v2"&&a.push(e.nonce??""),a.join("|")}function hy(e){if(!e||typeof e!="object")return;const t=e.nonce;if(typeof t!="string")return;const n=t.trim();return n.length>0?n:void 0}async function py(e){const t=Array.isArray(e.scopes)?e.scopes:["operator.admin"],n=Array.isArray(e.caps)?e.caps:[],r=await bU(),a=Date.now(),o=SU({deviceId:r.deviceId,clientId:e.client.id,clientMode:e.client.mode,role:"operator",scopes:t,signedAtMs:a,token:typeof e.auth.token=="string"?e.auth.token:null,nonce:e.nonce}),l=await xU(r.privateKey,o);return{minProtocol:e.minProtocol,maxProtocol:e.maxProtocol,client:e.client,role:"operator",scopes:t,caps:n,auth:e.auth,device:{id:r.deviceId,publicKey:r.publicKey,signature:l,signedAt:a,...e.nonce?{nonce:e.nonce}:{}}}}const f1="http://localhost:18789",h1="ws://localhost:18789/ws",vd="token",oN="anima.gateway.token",wU="anima.control.settings.v1";function EU(e){if(!e)return new URLSearchParams;const t=e.startsWith("#")?e.slice(1):e;return t?new URLSearchParams(t):new URLSearchParams}function p1(e){if(!(typeof window>"u"||!e))try{window.localStorage.setItem(oN,e)}catch{}}function TU(){if(typeof window>"u")return null;try{const e=new URL(window.location.href),t=EU(e.hash),n=e.searchParams.get(vd)?.trim()||"",r=t.get(vd)?.trim()||"",a=n||r;if(n&&e.searchParams.delete(vd),r){t.delete(vd);const o=t.toString();e.hash=o?`#${o}`:""}return(n||r)&&typeof window.history?.replaceState=="function"&&window.history.replaceState(null,"",`${e.pathname}${e.search}${e.hash}`),a||null}catch{return null}}function kU(){if(typeof window>"u")return null;try{const e=window.localStorage.getItem(wU);if(!e)return null;const t=JSON.parse(e);return(typeof t.token=="string"?t.token.trim():"")||null}catch{return null}}function CU(){if(typeof window>"u")return null;try{const e=window.localStorage.getItem(oN)?.trim()||"";if(e)return e}catch{}return kU()}function AU(){if(typeof window>"u")return f1;const e=window.location.protocol==="https:"?"https:":"http:",t=window.location.host?.trim();return t?`${e}//${t}`:f1}function my(){if(typeof window>"u")return h1;const e=window.location.protocol==="https:"?"wss:":"ws:",t=window.location.host?.trim();return t?`${e}//${t}/ws`:h1}function NU(){const e=TU();if(e)return p1(e),e;const t=CU();return t?(p1(t),t):null}function gy(){const e=NU();if(e)return{token:e}}const jU=AU(),RU=my(),m1=3,_U=1e4,OU=2*6e4,MU=15*6e4,DU=8;function wu(){return typeof crypto<"u"&&typeof crypto.randomUUID=="function"?crypto.randomUUID():`id-${Date.now()}-${Math.random().toString(36).slice(2)}`}function IU(e){const t=e?.body;if(typeof t!="string"||!t.trim())return{};try{const n=JSON.parse(t);return typeof n=="object"&&n!==null?n:{}}catch{return{}}}async function as(e,t){return await new Promise((n,r)=>{const a=new WebSocket(RU);let o=!1,l=!1,c=!1,d,f="",m="",g=null;const v=window.setTimeout(()=>{w(new Error(`Gateway RPC timed out: ${e}`))},_U);function b(){window.clearTimeout(v),g!=null&&window.clearTimeout(g),a.close()}function S(C){o||(o=!0,b(),n(C))}function w(C){o||(o=!0,b(),r(C))}function E(C,k,j){a.send(JSON.stringify({type:"req",id:C,method:k,params:j??{}}))}async function T(){if(l||f||c)return;c=!0;const C=gy();if(!C){c=!1,w(new Error("Gateway token missing. Re-open this page once with ?token=ANIMA_GATEWAY_TOKEN."));return}try{const k=await py({minProtocol:m1,maxProtocol:m1,client:{id:"webchat-ui",version:"1.0.0",platform:"web",mode:"webchat"},scopes:["operator.read","operator.admin"],caps:[],auth:C,nonce:d});f=wu(),E(f,"connect",k),c=!1}catch(k){c=!1,w(k instanceof Error?k:new Error(String(k)))}}a.addEventListener("open",()=>{g=window.setTimeout(()=>{g=null,T()},100)}),a.addEventListener("message",C=>{let k;try{k=JSON.parse(String(C.data))}catch{return}const j=k;if(j.type==="event"){if(j.event==="connect.challenge"){const N=hy(j.payload);N&&(d=N),T()}return}if(j.type==="res"){if(j.id===f){if(f="",c=!1,!j.ok){w(new Error(j.error?.message||"Gateway connect failed"));return}l=!0,m=wu(),E(m,e,t);return}if(j.id===m&&l){if(!j.ok){w(new Error(j.error?.message||`Gateway method failed: ${e}`));return}S(j.payload??{})}}}),a.addEventListener("error",()=>{w(new Error(`Gateway websocket error while requesting ${e}`))}),a.addEventListener("close",()=>{o||w(new Error(`Gateway websocket closed while requesting ${e}`))})})}async function He(e,t){return await as(e,t)}function PU(e,t,n=$g()){const r=Array.isArray(e.heartbeat?.agents)?e.heartbeat?.agents[0]:null,a=typeof r?.everyMs=="number"&&Number.isFinite(r.everyMs)?r.everyMs:3e5,o=typeof t?.ts=="number"&&Number.isFinite(t.ts)?t.ts:null;return{heartbeat:{running:!!r?.enabled,paused:!1,beatCount:0,lastBeat:o!=null?new Date(o).toISOString():null,nextBeat:o!=null?new Date(o+a).toISOString():null,interval:a},budget:{spent:0,remaining:200,limit:200,sessionCount:0},queue:{queued:Array.isArray(e.queuedSystemEvents)?e.queuedSystemEvents.length:0,running:0,completed:0,failed:0},mcp:{servers:[]},subagents:n}}function $g(){return{total:0,active:0,recent:0,failed:0,latest:[]}}function LU(e){return typeof e=="number"&&Number.isFinite(e)?e:null}function zU(e){const t=e?.trim().toLowerCase();return t?t.startsWith("subagent:")||t.includes(":subagent:"):!1}function UU(e){if(!Array.isArray(e.sessions)||e.sessions.length===0)return $g();const t=Date.now(),n=e.sessions.filter(r=>zU(r.key)).map(r=>{const a=LU(r.updatedAt),o=a==null?Number.POSITIVE_INFINITY:Math.max(0,t-a),l=r.abortedLastRun===!0;let c="idle";return l?c="failed":o<=OU?c="active":o<=MU&&(c="recent"),{key:r.key?.trim()||wu(),status:c,updatedAt:a!=null?new Date(a).toISOString():null,updatedAtMs:a}}).toSorted((r,a)=>(a.updatedAtMs??0)-(r.updatedAtMs??0));return n.length===0?$g():{total:n.length,active:n.filter(r=>r.status==="active").length,recent:n.filter(r=>r.status==="recent").length,failed:n.filter(r=>r.status==="failed").length,latest:n.slice(0,DU).map(r=>({key:r.key,status:r.status,updatedAt:r.updatedAt}))}}function BU(e){const t=e.name?.trim()||"Assistant",n=e.agentId?.trim()||"main",r=e.avatar?.trim()||"A";return{loadedAt:new Date().toISOString(),components:[{name:"SOUL",content:`# ${t}
22
+ Agent ID: ${n}
23
+ Avatar: ${r}`,source:"user",description:"Core identity resolved from active gateway agent profile."},{name:"HEART",content:"Heartbeat mode active. This instance listens for ongoing directives.",source:"template",description:"Heartbeat and operating rhythm configuration."},{name:"MEMORY",content:"Memory systems are managed by ANIMA runtime and session storage.",source:"template",description:"Long-term continuity and session persistence layer."}]}}function VU(e){return Array.isArray(e.sessions)?e.sessions.map(t=>{const n=typeof t.updatedAt=="number"&&Number.isFinite(t.updatedAt)?new Date(t.updatedAt).toISOString():new Date().toISOString(),r=[t.modelProvider,t.model].filter(a=>typeof a=="string"&&a).join("/")||"gateway session";return{sessionId:t.sessionId||t.key||wu(),mode:t.origin?.surface||t.kind||"session",status:t.abortedLastRun?"failed":"completed",prompt:`Model: ${r}`,durationMs:0,costUsd:null,savedAt:n}}):[]}const FU={enabled:!1,running:!1,paused:!1,nodeId:"unavailable",uptimeMs:0,tasksCompleted:0,tasksFailed:0,balance:0,sessionEarnings:0,limits:{maxCpuPercent:10,maxRamMB:256,maxBandwidthMbps:5},resources:null,earnings:{allTimeEarned:0,allTimeApplied:0,balanceValueUSD:0,todayEarned:0,todayTasks:0}};async function yd(e,t){const n=(t?.method||"GET").toUpperCase();if(n==="GET"&&e==="/api/status"){const[r,a,o]=await Promise.all([as("status",{}),as("last-heartbeat",{}).catch(()=>null),as("sessions.list",{limit:200,includeGlobal:!0,includeUnknown:!0}).catch(()=>({sessions:[]}))]),l=UU(o);return PU(r,a,l)}if(n==="GET"&&e==="/api/identity"){const r=await as("agent.identity.get",{sessionKey:"main"}).catch(()=>({name:"Assistant",avatar:"A",agentId:"main"}));return BU(r)}if(n==="GET"&&e==="/api/sessions"){const r=await as("sessions.list",{limit:50}).catch(()=>({sessions:[]}));return VU(r)}if(n==="GET"&&e==="/api/queue")return[];if(n==="POST"&&e==="/api/queue"){const r=IU(t),a=typeof r.prompt=="string"?r.prompt.trim():"",o=wu();return a&&await as("chat.send",{sessionKey:"main",message:a,deliver:!1,idempotencyKey:o}),{id:o}}if(n==="GET"&&e==="/api/mcp")return[];if(n==="GET"&&e==="/api/svrn/status")return FU;if(n==="POST"&&(e==="/api/svrn/toggle"||e==="/api/svrn/limits"))return{success:!0};throw new Error(`Unsupported control UI API path: ${n} ${e}`)}async function Df(e,t){try{const n=new Headers(t?.headers??{});n.has("Content-Type")||n.set("Content-Type","application/json");const r=await fetch(`${jU}${e}`,{...t,headers:n});if(!r.ok){if(e.startsWith("/api/"))return await yd(e,t);throw new Error(`API error: ${r.status} ${r.statusText}`)}if(String(r.headers.get("content-type")||"").includes("application/json"))return await r.json();const o=await r.text();if(e.startsWith("/api/")){const l=o.trim().toLowerCase();if(l.startsWith("<!doctype html")||l.startsWith("<html"))return await yd(e,t);try{return JSON.parse(o)}catch{return await yd(e,t)}}return JSON.parse(o)}catch(n){if(e.startsWith("/api/"))return await yd(e,t);throw n}}async function lN(){return Df("/api/status")}async function HU(){return Df("/api/identity")}async function qU(){return Df("/api/sessions")}async function GU(e,t="normal"){return Df("/api/queue",{method:"POST",body:JSON.stringify({prompt:e,priority:t,source:"web"})})}async function uN(){return await He("config.get",{})}async function KU(){return await He("config.schema",{})}async function cN(e,t,n=!1){await He(n?"config.apply":"config.set",{raw:e,baseHash:t})}async function Yg(e,t){await He("config.patch",{raw:e,baseHash:t})}async function dN(){return await He("anima.runtime.get",{})}async function $U(e){await He("anima.runtime.set-working-mode",{mode:e})}async function YU(e,t,n){const r=await He("anima.memory.list",{kind:e,...t?{query:t}:{},limit:n});return Array.isArray(r.entries)?r.entries:[]}async function WU(){return await He("anima.mission.get",{})}async function XU(e,t){return(await He("anima.mission.set",{fileName:e,content:t})).file}async function wa(e){return(await He("anima.mission.patch",{patch:e})).state}async function QU(e){return(await He("anima.mission.connect-repo",{...e})).repo}async function JU(e){await He("anima.trust.set",{people:e})}async function ZU(e){await He("anima.mission.import",e)}async function fN(){return await He("anima.registration.status",{})}async function hN(e){await He("anima.registration.set-token",{token:e})}async function pN(e){await He("anima.registration.register-invite",e)}async function Wg(e){await He("set-heartbeats",{enabled:e})}async function mN(e,t="next-heartbeat"){await He("wake",{text:e,mode:t})}async function g1(e){return await He("logs.tail",{...typeof e=="number"?{cursor:e}:{},limit:160,maxBytes:12e4})}async function gN(){return await He("voicewake.get",{})}async function vN(e){return await He("voicewake.set",{triggers:e})}async function yN(){return await He("anima.providers.get",{})}async function Xg(e){await He("anima.providers.set",{providers:e})}async function bN(e){await He("anima.providers.rotate",{enabled:e})}async function eB(){const e=await He("org.list",{});return Array.isArray(e.orgs)?e.orgs:[]}async function tB(e){return await He("org.get",{orgId:e})}async function nB(e){return await He("org.create",e)}async function rB(e,t){return(await He("org.addMember",{orgId:e,...t})).member}async function iB(e,t,n){return(await He("org.updateMember",{orgId:e,memberId:t,...n})).member}async function aB(e,t){await He("org.removeMember",{orgId:e,memberId:t})}async function sB(e){const t=await He("org.hierarchy",{orgId:e});return Array.isArray(t.hierarchy)?t.hierarchy:[]}async function oB(e){return He("org.join",e)}async function lB(e){return He("org.validateInvite",e)}async function uB(e,t){return(await He("boardroom.listSessions",{orgId:e,status:t})).sessions??[]}async function cB(e){return(await He("boardroom.createSession",e)).session}async function dB(e,t){return(await He("boardroom.startSession",{sessionId:e,chairId:t})).session}async function fB(e){return(await He("boardroom.concludeSession",{sessionId:e})).session}async function hB(e,t){return(await He("boardroom.listProposals",{orgId:e,status:t})).proposals??[]}async function pB(e){return(await He("boardroom.createProposal",e)).proposal}async function mB(){return(await He("steer.get",{})).active}async function gB(e,t="user"){return He("steer.set",{text:e,setBy:t})}async function vB(){return He("steer.clear",{})}async function yB(){const e=await He("steer.history",{});return Array.isArray(e.history)?e.history:[]}async function bB(){return(await He("ego.get",{})).ego}async function xB(e){return(await He("ego.updateSelf",e)).selfConcept}function SB(e,t){const n={};return(e[e.length-1]===""?[...e,""]:e).join((n.padRight?" ":"")+","+(n.padLeft===!1?"":" ")).trim()}const wB=/^[$_\p{ID_Start}][$_\u{200C}\u{200D}\p{ID_Continue}]*$/u,EB=/^[$_\p{ID_Start}][-$_\u{200C}\u{200D}\p{ID_Continue}]*$/u,TB={};function v1(e,t){return(TB.jsx?EB:wB).test(e)}const kB=/[ \t\n\f\r]/g;function CB(e){return typeof e=="object"?e.type==="text"?y1(e.value):!1:y1(e)}function y1(e){return e.replace(kB,"")===""}class Pu{constructor(t,n,r){this.normal=n,this.property=t,r&&(this.space=r)}}Pu.prototype.normal={};Pu.prototype.property={};Pu.prototype.space=void 0;function xN(e,t){const n={},r={};for(const a of e)Object.assign(n,a.property),Object.assign(r,a.normal);return new Pu(n,r,t)}function Qg(e){return e.toLowerCase()}class Xn{constructor(t,n){this.attribute=n,this.property=t}}Xn.prototype.attribute="";Xn.prototype.booleanish=!1;Xn.prototype.boolean=!1;Xn.prototype.commaOrSpaceSeparated=!1;Xn.prototype.commaSeparated=!1;Xn.prototype.defined=!1;Xn.prototype.mustUseProperty=!1;Xn.prototype.number=!1;Xn.prototype.overloadedBoolean=!1;Xn.prototype.property="";Xn.prototype.spaceSeparated=!1;Xn.prototype.space=void 0;let AB=0;const Ye=bs(),sn=bs(),Jg=bs(),be=bs(),jt=bs(),xo=bs(),ir=bs();function bs(){return 2**++AB}const Zg=Object.freeze(Object.defineProperty({__proto__:null,boolean:Ye,booleanish:sn,commaOrSpaceSeparated:ir,commaSeparated:xo,number:be,overloadedBoolean:Jg,spaceSeparated:jt},Symbol.toStringTag,{value:"Module"})),Rm=Object.keys(Zg);class vy extends Xn{constructor(t,n,r,a){let o=-1;if(super(t,n),b1(this,"space",a),typeof r=="number")for(;++o<Rm.length;){const l=Rm[o];b1(this,Rm[o],(r&Zg[l])===Zg[l])}}}vy.prototype.defined=!0;function b1(e,t,n){n&&(e[t]=n)}function Po(e){const t={},n={};for(const[r,a]of Object.entries(e.properties)){const o=new vy(r,e.transform(e.attributes||{},r),a,e.space);e.mustUseProperty&&e.mustUseProperty.includes(r)&&(o.mustUseProperty=!0),t[r]=o,n[Qg(r)]=r,n[Qg(o.attribute)]=r}return new Pu(t,n,e.space)}const SN=Po({properties:{ariaActiveDescendant:null,ariaAtomic:sn,ariaAutoComplete:null,ariaBusy:sn,ariaChecked:sn,ariaColCount:be,ariaColIndex:be,ariaColSpan:be,ariaControls:jt,ariaCurrent:null,ariaDescribedBy:jt,ariaDetails:null,ariaDisabled:sn,ariaDropEffect:jt,ariaErrorMessage:null,ariaExpanded:sn,ariaFlowTo:jt,ariaGrabbed:sn,ariaHasPopup:null,ariaHidden:sn,ariaInvalid:null,ariaKeyShortcuts:null,ariaLabel:null,ariaLabelledBy:jt,ariaLevel:be,ariaLive:null,ariaModal:sn,ariaMultiLine:sn,ariaMultiSelectable:sn,ariaOrientation:null,ariaOwns:jt,ariaPlaceholder:null,ariaPosInSet:be,ariaPressed:sn,ariaReadOnly:sn,ariaRelevant:null,ariaRequired:sn,ariaRoleDescription:jt,ariaRowCount:be,ariaRowIndex:be,ariaRowSpan:be,ariaSelected:sn,ariaSetSize:be,ariaSort:null,ariaValueMax:be,ariaValueMin:be,ariaValueNow:be,ariaValueText:null,role:null},transform(e,t){return t==="role"?t:"aria-"+t.slice(4).toLowerCase()}});function wN(e,t){return t in e?e[t]:t}function EN(e,t){return wN(e,t.toLowerCase())}const NB=Po({attributes:{acceptcharset:"accept-charset",classname:"class",htmlfor:"for",httpequiv:"http-equiv"},mustUseProperty:["checked","multiple","muted","selected"],properties:{abbr:null,accept:xo,acceptCharset:jt,accessKey:jt,action:null,allow:null,allowFullScreen:Ye,allowPaymentRequest:Ye,allowUserMedia:Ye,alt:null,as:null,async:Ye,autoCapitalize:null,autoComplete:jt,autoFocus:Ye,autoPlay:Ye,blocking:jt,capture:null,charSet:null,checked:Ye,cite:null,className:jt,cols:be,colSpan:null,content:null,contentEditable:sn,controls:Ye,controlsList:jt,coords:be|xo,crossOrigin:null,data:null,dateTime:null,decoding:null,default:Ye,defer:Ye,dir:null,dirName:null,disabled:Ye,download:Jg,draggable:sn,encType:null,enterKeyHint:null,fetchPriority:null,form:null,formAction:null,formEncType:null,formMethod:null,formNoValidate:Ye,formTarget:null,headers:jt,height:be,hidden:Jg,high:be,href:null,hrefLang:null,htmlFor:jt,httpEquiv:jt,id:null,imageSizes:null,imageSrcSet:null,inert:Ye,inputMode:null,integrity:null,is:null,isMap:Ye,itemId:null,itemProp:jt,itemRef:jt,itemScope:Ye,itemType:jt,kind:null,label:null,lang:null,language:null,list:null,loading:null,loop:Ye,low:be,manifest:null,max:null,maxLength:be,media:null,method:null,min:null,minLength:be,multiple:Ye,muted:Ye,name:null,nonce:null,noModule:Ye,noValidate:Ye,onAbort:null,onAfterPrint:null,onAuxClick:null,onBeforeMatch:null,onBeforePrint:null,onBeforeToggle:null,onBeforeUnload:null,onBlur:null,onCancel:null,onCanPlay:null,onCanPlayThrough:null,onChange:null,onClick:null,onClose:null,onContextLost:null,onContextMenu:null,onContextRestored:null,onCopy:null,onCueChange:null,onCut:null,onDblClick:null,onDrag:null,onDragEnd:null,onDragEnter:null,onDragExit:null,onDragLeave:null,onDragOver:null,onDragStart:null,onDrop:null,onDurationChange:null,onEmptied:null,onEnded:null,onError:null,onFocus:null,onFormData:null,onHashChange:null,onInput:null,onInvalid:null,onKeyDown:null,onKeyPress:null,onKeyUp:null,onLanguageChange:null,onLoad:null,onLoadedData:null,onLoadedMetadata:null,onLoadEnd:null,onLoadStart:null,onMessage:null,onMessageError:null,onMouseDown:null,onMouseEnter:null,onMouseLeave:null,onMouseMove:null,onMouseOut:null,onMouseOver:null,onMouseUp:null,onOffline:null,onOnline:null,onPageHide:null,onPageShow:null,onPaste:null,onPause:null,onPlay:null,onPlaying:null,onPopState:null,onProgress:null,onRateChange:null,onRejectionHandled:null,onReset:null,onResize:null,onScroll:null,onScrollEnd:null,onSecurityPolicyViolation:null,onSeeked:null,onSeeking:null,onSelect:null,onSlotChange:null,onStalled:null,onStorage:null,onSubmit:null,onSuspend:null,onTimeUpdate:null,onToggle:null,onUnhandledRejection:null,onUnload:null,onVolumeChange:null,onWaiting:null,onWheel:null,open:Ye,optimum:be,pattern:null,ping:jt,placeholder:null,playsInline:Ye,popover:null,popoverTarget:null,popoverTargetAction:null,poster:null,preload:null,readOnly:Ye,referrerPolicy:null,rel:jt,required:Ye,reversed:Ye,rows:be,rowSpan:be,sandbox:jt,scope:null,scoped:Ye,seamless:Ye,selected:Ye,shadowRootClonable:Ye,shadowRootDelegatesFocus:Ye,shadowRootMode:null,shape:null,size:be,sizes:null,slot:null,span:be,spellCheck:sn,src:null,srcDoc:null,srcLang:null,srcSet:null,start:be,step:null,style:null,tabIndex:be,target:null,title:null,translate:null,type:null,typeMustMatch:Ye,useMap:null,value:sn,width:be,wrap:null,writingSuggestions:null,align:null,aLink:null,archive:jt,axis:null,background:null,bgColor:null,border:be,borderColor:null,bottomMargin:be,cellPadding:null,cellSpacing:null,char:null,charOff:null,classId:null,clear:null,code:null,codeBase:null,codeType:null,color:null,compact:Ye,declare:Ye,event:null,face:null,frame:null,frameBorder:null,hSpace:be,leftMargin:be,link:null,longDesc:null,lowSrc:null,marginHeight:be,marginWidth:be,noResize:Ye,noHref:Ye,noShade:Ye,noWrap:Ye,object:null,profile:null,prompt:null,rev:null,rightMargin:be,rules:null,scheme:null,scrolling:sn,standby:null,summary:null,text:null,topMargin:be,valueType:null,version:null,vAlign:null,vLink:null,vSpace:be,allowTransparency:null,autoCorrect:null,autoSave:null,disablePictureInPicture:Ye,disableRemotePlayback:Ye,prefix:null,property:null,results:be,security:null,unselectable:null},space:"html",transform:EN}),jB=Po({attributes:{accentHeight:"accent-height",alignmentBaseline:"alignment-baseline",arabicForm:"arabic-form",baselineShift:"baseline-shift",capHeight:"cap-height",className:"class",clipPath:"clip-path",clipRule:"clip-rule",colorInterpolation:"color-interpolation",colorInterpolationFilters:"color-interpolation-filters",colorProfile:"color-profile",colorRendering:"color-rendering",crossOrigin:"crossorigin",dataType:"datatype",dominantBaseline:"dominant-baseline",enableBackground:"enable-background",fillOpacity:"fill-opacity",fillRule:"fill-rule",floodColor:"flood-color",floodOpacity:"flood-opacity",fontFamily:"font-family",fontSize:"font-size",fontSizeAdjust:"font-size-adjust",fontStretch:"font-stretch",fontStyle:"font-style",fontVariant:"font-variant",fontWeight:"font-weight",glyphName:"glyph-name",glyphOrientationHorizontal:"glyph-orientation-horizontal",glyphOrientationVertical:"glyph-orientation-vertical",hrefLang:"hreflang",horizAdvX:"horiz-adv-x",horizOriginX:"horiz-origin-x",horizOriginY:"horiz-origin-y",imageRendering:"image-rendering",letterSpacing:"letter-spacing",lightingColor:"lighting-color",markerEnd:"marker-end",markerMid:"marker-mid",markerStart:"marker-start",navDown:"nav-down",navDownLeft:"nav-down-left",navDownRight:"nav-down-right",navLeft:"nav-left",navNext:"nav-next",navPrev:"nav-prev",navRight:"nav-right",navUp:"nav-up",navUpLeft:"nav-up-left",navUpRight:"nav-up-right",onAbort:"onabort",onActivate:"onactivate",onAfterPrint:"onafterprint",onBeforePrint:"onbeforeprint",onBegin:"onbegin",onCancel:"oncancel",onCanPlay:"oncanplay",onCanPlayThrough:"oncanplaythrough",onChange:"onchange",onClick:"onclick",onClose:"onclose",onCopy:"oncopy",onCueChange:"oncuechange",onCut:"oncut",onDblClick:"ondblclick",onDrag:"ondrag",onDragEnd:"ondragend",onDragEnter:"ondragenter",onDragExit:"ondragexit",onDragLeave:"ondragleave",onDragOver:"ondragover",onDragStart:"ondragstart",onDrop:"ondrop",onDurationChange:"ondurationchange",onEmptied:"onemptied",onEnd:"onend",onEnded:"onended",onError:"onerror",onFocus:"onfocus",onFocusIn:"onfocusin",onFocusOut:"onfocusout",onHashChange:"onhashchange",onInput:"oninput",onInvalid:"oninvalid",onKeyDown:"onkeydown",onKeyPress:"onkeypress",onKeyUp:"onkeyup",onLoad:"onload",onLoadedData:"onloadeddata",onLoadedMetadata:"onloadedmetadata",onLoadStart:"onloadstart",onMessage:"onmessage",onMouseDown:"onmousedown",onMouseEnter:"onmouseenter",onMouseLeave:"onmouseleave",onMouseMove:"onmousemove",onMouseOut:"onmouseout",onMouseOver:"onmouseover",onMouseUp:"onmouseup",onMouseWheel:"onmousewheel",onOffline:"onoffline",onOnline:"ononline",onPageHide:"onpagehide",onPageShow:"onpageshow",onPaste:"onpaste",onPause:"onpause",onPlay:"onplay",onPlaying:"onplaying",onPopState:"onpopstate",onProgress:"onprogress",onRateChange:"onratechange",onRepeat:"onrepeat",onReset:"onreset",onResize:"onresize",onScroll:"onscroll",onSeeked:"onseeked",onSeeking:"onseeking",onSelect:"onselect",onShow:"onshow",onStalled:"onstalled",onStorage:"onstorage",onSubmit:"onsubmit",onSuspend:"onsuspend",onTimeUpdate:"ontimeupdate",onToggle:"ontoggle",onUnload:"onunload",onVolumeChange:"onvolumechange",onWaiting:"onwaiting",onZoom:"onzoom",overlinePosition:"overline-position",overlineThickness:"overline-thickness",paintOrder:"paint-order",panose1:"panose-1",pointerEvents:"pointer-events",referrerPolicy:"referrerpolicy",renderingIntent:"rendering-intent",shapeRendering:"shape-rendering",stopColor:"stop-color",stopOpacity:"stop-opacity",strikethroughPosition:"strikethrough-position",strikethroughThickness:"strikethrough-thickness",strokeDashArray:"stroke-dasharray",strokeDashOffset:"stroke-dashoffset",strokeLineCap:"stroke-linecap",strokeLineJoin:"stroke-linejoin",strokeMiterLimit:"stroke-miterlimit",strokeOpacity:"stroke-opacity",strokeWidth:"stroke-width",tabIndex:"tabindex",textAnchor:"text-anchor",textDecoration:"text-decoration",textRendering:"text-rendering",transformOrigin:"transform-origin",typeOf:"typeof",underlinePosition:"underline-position",underlineThickness:"underline-thickness",unicodeBidi:"unicode-bidi",unicodeRange:"unicode-range",unitsPerEm:"units-per-em",vAlphabetic:"v-alphabetic",vHanging:"v-hanging",vIdeographic:"v-ideographic",vMathematical:"v-mathematical",vectorEffect:"vector-effect",vertAdvY:"vert-adv-y",vertOriginX:"vert-origin-x",vertOriginY:"vert-origin-y",wordSpacing:"word-spacing",writingMode:"writing-mode",xHeight:"x-height",playbackOrder:"playbackorder",timelineBegin:"timelinebegin"},properties:{about:ir,accentHeight:be,accumulate:null,additive:null,alignmentBaseline:null,alphabetic:be,amplitude:be,arabicForm:null,ascent:be,attributeName:null,attributeType:null,azimuth:be,bandwidth:null,baselineShift:null,baseFrequency:null,baseProfile:null,bbox:null,begin:null,bias:be,by:null,calcMode:null,capHeight:be,className:jt,clip:null,clipPath:null,clipPathUnits:null,clipRule:null,color:null,colorInterpolation:null,colorInterpolationFilters:null,colorProfile:null,colorRendering:null,content:null,contentScriptType:null,contentStyleType:null,crossOrigin:null,cursor:null,cx:null,cy:null,d:null,dataType:null,defaultAction:null,descent:be,diffuseConstant:be,direction:null,display:null,dur:null,divisor:be,dominantBaseline:null,download:Ye,dx:null,dy:null,edgeMode:null,editable:null,elevation:be,enableBackground:null,end:null,event:null,exponent:be,externalResourcesRequired:null,fill:null,fillOpacity:be,fillRule:null,filter:null,filterRes:null,filterUnits:null,floodColor:null,floodOpacity:null,focusable:null,focusHighlight:null,fontFamily:null,fontSize:null,fontSizeAdjust:null,fontStretch:null,fontStyle:null,fontVariant:null,fontWeight:null,format:null,fr:null,from:null,fx:null,fy:null,g1:xo,g2:xo,glyphName:xo,glyphOrientationHorizontal:null,glyphOrientationVertical:null,glyphRef:null,gradientTransform:null,gradientUnits:null,handler:null,hanging:be,hatchContentUnits:null,hatchUnits:null,height:null,href:null,hrefLang:null,horizAdvX:be,horizOriginX:be,horizOriginY:be,id:null,ideographic:be,imageRendering:null,initialVisibility:null,in:null,in2:null,intercept:be,k:be,k1:be,k2:be,k3:be,k4:be,kernelMatrix:ir,kernelUnitLength:null,keyPoints:null,keySplines:null,keyTimes:null,kerning:null,lang:null,lengthAdjust:null,letterSpacing:null,lightingColor:null,limitingConeAngle:be,local:null,markerEnd:null,markerMid:null,markerStart:null,markerHeight:null,markerUnits:null,markerWidth:null,mask:null,maskContentUnits:null,maskUnits:null,mathematical:null,max:null,media:null,mediaCharacterEncoding:null,mediaContentEncodings:null,mediaSize:be,mediaTime:null,method:null,min:null,mode:null,name:null,navDown:null,navDownLeft:null,navDownRight:null,navLeft:null,navNext:null,navPrev:null,navRight:null,navUp:null,navUpLeft:null,navUpRight:null,numOctaves:null,observer:null,offset:null,onAbort:null,onActivate:null,onAfterPrint:null,onBeforePrint:null,onBegin:null,onCancel:null,onCanPlay:null,onCanPlayThrough:null,onChange:null,onClick:null,onClose:null,onCopy:null,onCueChange:null,onCut:null,onDblClick:null,onDrag:null,onDragEnd:null,onDragEnter:null,onDragExit:null,onDragLeave:null,onDragOver:null,onDragStart:null,onDrop:null,onDurationChange:null,onEmptied:null,onEnd:null,onEnded:null,onError:null,onFocus:null,onFocusIn:null,onFocusOut:null,onHashChange:null,onInput:null,onInvalid:null,onKeyDown:null,onKeyPress:null,onKeyUp:null,onLoad:null,onLoadedData:null,onLoadedMetadata:null,onLoadStart:null,onMessage:null,onMouseDown:null,onMouseEnter:null,onMouseLeave:null,onMouseMove:null,onMouseOut:null,onMouseOver:null,onMouseUp:null,onMouseWheel:null,onOffline:null,onOnline:null,onPageHide:null,onPageShow:null,onPaste:null,onPause:null,onPlay:null,onPlaying:null,onPopState:null,onProgress:null,onRateChange:null,onRepeat:null,onReset:null,onResize:null,onScroll:null,onSeeked:null,onSeeking:null,onSelect:null,onShow:null,onStalled:null,onStorage:null,onSubmit:null,onSuspend:null,onTimeUpdate:null,onToggle:null,onUnload:null,onVolumeChange:null,onWaiting:null,onZoom:null,opacity:null,operator:null,order:null,orient:null,orientation:null,origin:null,overflow:null,overlay:null,overlinePosition:be,overlineThickness:be,paintOrder:null,panose1:null,path:null,pathLength:be,patternContentUnits:null,patternTransform:null,patternUnits:null,phase:null,ping:jt,pitch:null,playbackOrder:null,pointerEvents:null,points:null,pointsAtX:be,pointsAtY:be,pointsAtZ:be,preserveAlpha:null,preserveAspectRatio:null,primitiveUnits:null,propagate:null,property:ir,r:null,radius:null,referrerPolicy:null,refX:null,refY:null,rel:ir,rev:ir,renderingIntent:null,repeatCount:null,repeatDur:null,requiredExtensions:ir,requiredFeatures:ir,requiredFonts:ir,requiredFormats:ir,resource:null,restart:null,result:null,rotate:null,rx:null,ry:null,scale:null,seed:null,shapeRendering:null,side:null,slope:null,snapshotTime:null,specularConstant:be,specularExponent:be,spreadMethod:null,spacing:null,startOffset:null,stdDeviation:null,stemh:null,stemv:null,stitchTiles:null,stopColor:null,stopOpacity:null,strikethroughPosition:be,strikethroughThickness:be,string:null,stroke:null,strokeDashArray:ir,strokeDashOffset:null,strokeLineCap:null,strokeLineJoin:null,strokeMiterLimit:be,strokeOpacity:be,strokeWidth:null,style:null,surfaceScale:be,syncBehavior:null,syncBehaviorDefault:null,syncMaster:null,syncTolerance:null,syncToleranceDefault:null,systemLanguage:ir,tabIndex:be,tableValues:null,target:null,targetX:be,targetY:be,textAnchor:null,textDecoration:null,textRendering:null,textLength:null,timelineBegin:null,title:null,transformBehavior:null,type:null,typeOf:ir,to:null,transform:null,transformOrigin:null,u1:null,u2:null,underlinePosition:be,underlineThickness:be,unicode:null,unicodeBidi:null,unicodeRange:null,unitsPerEm:be,values:null,vAlphabetic:be,vMathematical:be,vectorEffect:null,vHanging:be,vIdeographic:be,version:null,vertAdvY:be,vertOriginX:be,vertOriginY:be,viewBox:null,viewTarget:null,visibility:null,width:null,widths:null,wordSpacing:null,writingMode:null,x:null,x1:null,x2:null,xChannelSelector:null,xHeight:be,y:null,y1:null,y2:null,yChannelSelector:null,z:null,zoomAndPan:null},space:"svg",transform:wN}),TN=Po({properties:{xLinkActuate:null,xLinkArcRole:null,xLinkHref:null,xLinkRole:null,xLinkShow:null,xLinkTitle:null,xLinkType:null},space:"xlink",transform(e,t){return"xlink:"+t.slice(5).toLowerCase()}}),kN=Po({attributes:{xmlnsxlink:"xmlns:xlink"},properties:{xmlnsXLink:null,xmlns:null},space:"xmlns",transform:EN}),CN=Po({properties:{xmlBase:null,xmlLang:null,xmlSpace:null},space:"xml",transform(e,t){return"xml:"+t.slice(3).toLowerCase()}}),RB={classId:"classID",dataType:"datatype",itemId:"itemID",strokeDashArray:"strokeDasharray",strokeDashOffset:"strokeDashoffset",strokeLineCap:"strokeLinecap",strokeLineJoin:"strokeLinejoin",strokeMiterLimit:"strokeMiterlimit",typeOf:"typeof",xLinkActuate:"xlinkActuate",xLinkArcRole:"xlinkArcrole",xLinkHref:"xlinkHref",xLinkRole:"xlinkRole",xLinkShow:"xlinkShow",xLinkTitle:"xlinkTitle",xLinkType:"xlinkType",xmlnsXLink:"xmlnsXlink"},_B=/[A-Z]/g,x1=/-[a-z]/g,OB=/^data[-\w.:]+$/i;function MB(e,t){const n=Qg(t);let r=t,a=Xn;if(n in e.normal)return e.property[e.normal[n]];if(n.length>4&&n.slice(0,4)==="data"&&OB.test(t)){if(t.charAt(4)==="-"){const o=t.slice(5).replace(x1,IB);r="data"+o.charAt(0).toUpperCase()+o.slice(1)}else{const o=t.slice(4);if(!x1.test(o)){let l=o.replace(_B,DB);l.charAt(0)!=="-"&&(l="-"+l),t="data"+l}}a=vy}return new a(r,t)}function DB(e){return"-"+e.toLowerCase()}function IB(e){return e.charAt(1).toUpperCase()}const PB=xN([SN,NB,TN,kN,CN],"html"),yy=xN([SN,jB,TN,kN,CN],"svg");function LB(e){return e.join(" ").trim()}var ro={},_m,S1;function zB(){if(S1)return _m;S1=1;var e=/\/\*[^*]*\*+([^/*][^*]*\*+)*\//g,t=/\n/g,n=/^\s*/,r=/^(\*?[-#/*\\\w]+(\[[0-9a-z_-]+\])?)\s*/,a=/^:\s*/,o=/^((?:'(?:\\'|.)*?'|"(?:\\"|.)*?"|\([^)]*?\)|[^};])+)/,l=/^[;\s]*/,c=/^\s+|\s+$/g,d=`
24
+ `,f="/",m="*",g="",v="comment",b="declaration";function S(E,T){if(typeof E!="string")throw new TypeError("First argument must be a string");if(!E)return[];T=T||{};var C=1,k=1;function j(ue){var Z=ue.match(t);Z&&(C+=Z.length);var V=ue.lastIndexOf(d);k=~V?ue.length-V:k+ue.length}function N(){var ue={line:C,column:k};return function(Z){return Z.position=new R(ue),H(),Z}}function R(ue){this.start=ue,this.end={line:C,column:k},this.source=T.source}R.prototype.content=E;function P(ue){var Z=new Error(T.source+":"+C+":"+k+": "+ue);if(Z.reason=ue,Z.filename=T.source,Z.line=C,Z.column=k,Z.source=E,!T.silent)throw Z}function L(ue){var Z=ue.exec(E);if(Z){var V=Z[0];return j(V),E=E.slice(V.length),Z}}function H(){L(n)}function D(ue){var Z;for(ue=ue||[];Z=B();)Z!==!1&&ue.push(Z);return ue}function B(){var ue=N();if(!(f!=E.charAt(0)||m!=E.charAt(1))){for(var Z=2;g!=E.charAt(Z)&&(m!=E.charAt(Z)||f!=E.charAt(Z+1));)++Z;if(Z+=2,g===E.charAt(Z-1))return P("End of comment missing");var V=E.slice(2,Z-2);return k+=2,j(V),E=E.slice(Z),k+=2,ue({type:v,comment:V})}}function K(){var ue=N(),Z=L(r);if(Z){if(B(),!L(a))return P("property missing ':'");var V=L(o),X=ue({type:b,property:w(Z[0].replace(e,g)),value:V?w(V[0].replace(e,g)):g});return L(l),X}}function se(){var ue=[];D(ue);for(var Z;Z=K();)Z!==!1&&(ue.push(Z),D(ue));return ue}return H(),se()}function w(E){return E?E.replace(c,g):g}return _m=S,_m}var w1;function UB(){if(w1)return ro;w1=1;var e=ro&&ro.__importDefault||function(r){return r&&r.__esModule?r:{default:r}};Object.defineProperty(ro,"__esModule",{value:!0}),ro.default=n;const t=e(zB());function n(r,a){let o=null;if(!r||typeof r!="string")return o;const l=(0,t.default)(r),c=typeof a=="function";return l.forEach(d=>{if(d.type!=="declaration")return;const{property:f,value:m}=d;c?a(f,m,d):m&&(o=o||{},o[f]=m)}),o}return ro}var ql={},E1;function BB(){if(E1)return ql;E1=1,Object.defineProperty(ql,"__esModule",{value:!0}),ql.camelCase=void 0;var e=/^--[a-zA-Z0-9_-]+$/,t=/-([a-z])/g,n=/^[^-]+$/,r=/^-(webkit|moz|ms|o|khtml)-/,a=/^-(ms)-/,o=function(f){return!f||n.test(f)||e.test(f)},l=function(f,m){return m.toUpperCase()},c=function(f,m){return"".concat(m,"-")},d=function(f,m){return m===void 0&&(m={}),o(f)?f:(f=f.toLowerCase(),m.reactCompat?f=f.replace(a,c):f=f.replace(r,c),f.replace(t,l))};return ql.camelCase=d,ql}var Gl,T1;function VB(){if(T1)return Gl;T1=1;var e=Gl&&Gl.__importDefault||function(a){return a&&a.__esModule?a:{default:a}},t=e(UB()),n=BB();function r(a,o){var l={};return!a||typeof a!="string"||(0,t.default)(a,function(c,d){c&&d&&(l[(0,n.camelCase)(c,o)]=d)}),l}return r.default=r,Gl=r,Gl}var FB=VB();const HB=jo(FB),AN=NN("end"),by=NN("start");function NN(e){return t;function t(n){const r=n&&n.position&&n.position[e]||{};if(typeof r.line=="number"&&r.line>0&&typeof r.column=="number"&&r.column>0)return{line:r.line,column:r.column,offset:typeof r.offset=="number"&&r.offset>-1?r.offset:void 0}}}function qB(e){const t=by(e),n=AN(e);if(t&&n)return{start:t,end:n}}function cu(e){return!e||typeof e!="object"?"":"position"in e||"type"in e?k1(e.position):"start"in e||"end"in e?k1(e):"line"in e||"column"in e?ev(e):""}function ev(e){return C1(e&&e.line)+":"+C1(e&&e.column)}function k1(e){return ev(e&&e.start)+"-"+ev(e&&e.end)}function C1(e){return e&&typeof e=="number"?e:1}class On extends Error{constructor(t,n,r){super(),typeof n=="string"&&(r=n,n=void 0);let a="",o={},l=!1;if(n&&("line"in n&&"column"in n?o={place:n}:"start"in n&&"end"in n?o={place:n}:"type"in n?o={ancestors:[n],place:n.position}:o={...n}),typeof t=="string"?a=t:!o.cause&&t&&(l=!0,a=t.message,o.cause=t),!o.ruleId&&!o.source&&typeof r=="string"){const d=r.indexOf(":");d===-1?o.ruleId=r:(o.source=r.slice(0,d),o.ruleId=r.slice(d+1))}if(!o.place&&o.ancestors&&o.ancestors){const d=o.ancestors[o.ancestors.length-1];d&&(o.place=d.position)}const c=o.place&&"start"in o.place?o.place.start:o.place;this.ancestors=o.ancestors||void 0,this.cause=o.cause||void 0,this.column=c?c.column:void 0,this.fatal=void 0,this.file="",this.message=a,this.line=c?c.line:void 0,this.name=cu(o.place)||"1:1",this.place=o.place||void 0,this.reason=this.message,this.ruleId=o.ruleId||void 0,this.source=o.source||void 0,this.stack=l&&o.cause&&typeof o.cause.stack=="string"?o.cause.stack:"",this.actual=void 0,this.expected=void 0,this.note=void 0,this.url=void 0}}On.prototype.file="";On.prototype.name="";On.prototype.reason="";On.prototype.message="";On.prototype.stack="";On.prototype.column=void 0;On.prototype.line=void 0;On.prototype.ancestors=void 0;On.prototype.cause=void 0;On.prototype.fatal=void 0;On.prototype.place=void 0;On.prototype.ruleId=void 0;On.prototype.source=void 0;const xy={}.hasOwnProperty,GB=new Map,KB=/[A-Z]/g,$B=new Set(["table","tbody","thead","tfoot","tr"]),YB=new Set(["td","th"]),jN="https://github.com/syntax-tree/hast-util-to-jsx-runtime";function WB(e,t){if(!t||t.Fragment===void 0)throw new TypeError("Expected `Fragment` in options");const n=t.filePath||void 0;let r;if(t.development){if(typeof t.jsxDEV!="function")throw new TypeError("Expected `jsxDEV` in options when `development: true`");r=r8(n,t.jsxDEV)}else{if(typeof t.jsx!="function")throw new TypeError("Expected `jsx` in production options");if(typeof t.jsxs!="function")throw new TypeError("Expected `jsxs` in production options");r=n8(n,t.jsx,t.jsxs)}const a={Fragment:t.Fragment,ancestors:[],components:t.components||{},create:r,elementAttributeNameCase:t.elementAttributeNameCase||"react",evaluater:t.createEvaluater?t.createEvaluater():void 0,filePath:n,ignoreInvalidStyle:t.ignoreInvalidStyle||!1,passKeys:t.passKeys!==!1,passNode:t.passNode||!1,schema:t.space==="svg"?yy:PB,stylePropertyNameCase:t.stylePropertyNameCase||"dom",tableCellAlignToStyle:t.tableCellAlignToStyle!==!1},o=RN(a,e,void 0);return o&&typeof o!="string"?o:a.create(e,a.Fragment,{children:o||void 0},void 0)}function RN(e,t,n){if(t.type==="element")return XB(e,t,n);if(t.type==="mdxFlowExpression"||t.type==="mdxTextExpression")return QB(e,t);if(t.type==="mdxJsxFlowElement"||t.type==="mdxJsxTextElement")return ZB(e,t,n);if(t.type==="mdxjsEsm")return JB(e,t);if(t.type==="root")return e8(e,t,n);if(t.type==="text")return t8(e,t)}function XB(e,t,n){const r=e.schema;let a=r;t.tagName.toLowerCase()==="svg"&&r.space==="html"&&(a=yy,e.schema=a),e.ancestors.push(t);const o=ON(e,t.tagName,!1),l=i8(e,t);let c=wy(e,t);return $B.has(t.tagName)&&(c=c.filter(function(d){return typeof d=="string"?!CB(d):!0})),_N(e,l,o,t),Sy(l,c),e.ancestors.pop(),e.schema=r,e.create(t,o,l,n)}function QB(e,t){if(t.data&&t.data.estree&&e.evaluater){const r=t.data.estree.body[0];return r.type,e.evaluater.evaluateExpression(r.expression)}Eu(e,t.position)}function JB(e,t){if(t.data&&t.data.estree&&e.evaluater)return e.evaluater.evaluateProgram(t.data.estree);Eu(e,t.position)}function ZB(e,t,n){const r=e.schema;let a=r;t.name==="svg"&&r.space==="html"&&(a=yy,e.schema=a),e.ancestors.push(t);const o=t.name===null?e.Fragment:ON(e,t.name,!0),l=a8(e,t),c=wy(e,t);return _N(e,l,o,t),Sy(l,c),e.ancestors.pop(),e.schema=r,e.create(t,o,l,n)}function e8(e,t,n){const r={};return Sy(r,wy(e,t)),e.create(t,e.Fragment,r,n)}function t8(e,t){return t.value}function _N(e,t,n,r){typeof n!="string"&&n!==e.Fragment&&e.passNode&&(t.node=r)}function Sy(e,t){if(t.length>0){const n=t.length>1?t:t[0];n&&(e.children=n)}}function n8(e,t,n){return r;function r(a,o,l,c){const f=Array.isArray(l.children)?n:t;return c?f(o,l,c):f(o,l)}}function r8(e,t){return n;function n(r,a,o,l){const c=Array.isArray(o.children),d=by(r);return t(a,o,l,c,{columnNumber:d?d.column-1:void 0,fileName:e,lineNumber:d?d.line:void 0},void 0)}}function i8(e,t){const n={};let r,a;for(a in t.properties)if(a!=="children"&&xy.call(t.properties,a)){const o=s8(e,a,t.properties[a]);if(o){const[l,c]=o;e.tableCellAlignToStyle&&l==="align"&&typeof c=="string"&&YB.has(t.tagName)?r=c:n[l]=c}}if(r){const o=n.style||(n.style={});o[e.stylePropertyNameCase==="css"?"text-align":"textAlign"]=r}return n}function a8(e,t){const n={};for(const r of t.attributes)if(r.type==="mdxJsxExpressionAttribute")if(r.data&&r.data.estree&&e.evaluater){const o=r.data.estree.body[0];o.type;const l=o.expression;l.type;const c=l.properties[0];c.type,Object.assign(n,e.evaluater.evaluateExpression(c.argument))}else Eu(e,t.position);else{const a=r.name;let o;if(r.value&&typeof r.value=="object")if(r.value.data&&r.value.data.estree&&e.evaluater){const c=r.value.data.estree.body[0];c.type,o=e.evaluater.evaluateExpression(c.expression)}else Eu(e,t.position);else o=r.value===null?!0:r.value;n[a]=o}return n}function wy(e,t){const n=[];let r=-1;const a=e.passKeys?new Map:GB;for(;++r<t.children.length;){const o=t.children[r];let l;if(e.passKeys){const d=o.type==="element"?o.tagName:o.type==="mdxJsxFlowElement"||o.type==="mdxJsxTextElement"?o.name:void 0;if(d){const f=a.get(d)||0;l=d+"-"+f,a.set(d,f+1)}}const c=RN(e,o,l);c!==void 0&&n.push(c)}return n}function s8(e,t,n){const r=MB(e.schema,t);if(!(n==null||typeof n=="number"&&Number.isNaN(n))){if(Array.isArray(n)&&(n=r.commaSeparated?SB(n):LB(n)),r.property==="style"){let a=typeof n=="object"?n:o8(e,String(n));return e.stylePropertyNameCase==="css"&&(a=l8(a)),["style",a]}return[e.elementAttributeNameCase==="react"&&r.space?RB[r.property]||r.property:r.attribute,n]}}function o8(e,t){try{return HB(t,{reactCompat:!0})}catch(n){if(e.ignoreInvalidStyle)return{};const r=n,a=new On("Cannot parse `style` attribute",{ancestors:e.ancestors,cause:r,ruleId:"style",source:"hast-util-to-jsx-runtime"});throw a.file=e.filePath||void 0,a.url=jN+"#cannot-parse-style-attribute",a}}function ON(e,t,n){let r;if(!n)r={type:"Literal",value:t};else if(t.includes(".")){const a=t.split(".");let o=-1,l;for(;++o<a.length;){const c=v1(a[o])?{type:"Identifier",name:a[o]}:{type:"Literal",value:a[o]};l=l?{type:"MemberExpression",object:l,property:c,computed:!!(o&&c.type==="Literal"),optional:!1}:c}r=l}else r=v1(t)&&!/^[a-z]/.test(t)?{type:"Identifier",name:t}:{type:"Literal",value:t};if(r.type==="Literal"){const a=r.value;return xy.call(e.components,a)?e.components[a]:a}if(e.evaluater)return e.evaluater.evaluateExpression(r);Eu(e)}function Eu(e,t){const n=new On("Cannot handle MDX estrees without `createEvaluater`",{ancestors:e.ancestors,place:t,ruleId:"mdx-estree",source:"hast-util-to-jsx-runtime"});throw n.file=e.filePath||void 0,n.url=jN+"#cannot-handle-mdx-estrees-without-createevaluater",n}function l8(e){const t={};let n;for(n in e)xy.call(e,n)&&(t[u8(n)]=e[n]);return t}function u8(e){let t=e.replace(KB,c8);return t.slice(0,3)==="ms-"&&(t="-"+t),t}function c8(e){return"-"+e.toLowerCase()}const Om={action:["form"],cite:["blockquote","del","ins","q"],data:["object"],formAction:["button","input"],href:["a","area","base","link"],icon:["menuitem"],itemId:null,manifest:["html"],ping:["a","area"],poster:["video"],src:["audio","embed","iframe","img","input","script","source","track","video"]},d8={};function Ey(e,t){const n=d8,r=typeof n.includeImageAlt=="boolean"?n.includeImageAlt:!0,a=typeof n.includeHtml=="boolean"?n.includeHtml:!0;return MN(e,r,a)}function MN(e,t,n){if(f8(e)){if("value"in e)return e.type==="html"&&!n?"":e.value;if(t&&"alt"in e&&e.alt)return e.alt;if("children"in e)return A1(e.children,t,n)}return Array.isArray(e)?A1(e,t,n):""}function A1(e,t,n){const r=[];let a=-1;for(;++a<e.length;)r[a]=MN(e[a],t,n);return r.join("")}function f8(e){return!!(e&&typeof e=="object")}const N1=document.createElement("i");function Ty(e){const t="&"+e+";";N1.innerHTML=t;const n=N1.textContent;return n.charCodeAt(n.length-1)===59&&e!=="semi"||n===t?!1:n}function or(e,t,n,r){const a=e.length;let o=0,l;if(t<0?t=-t>a?0:a+t:t=t>a?a:t,n=n>0?n:0,r.length<1e4)l=Array.from(r),l.unshift(t,n),e.splice(...l);else for(n&&e.splice(t,n);o<r.length;)l=r.slice(o,o+1e4),l.unshift(t,0),e.splice(...l),o+=1e4,t+=1e4}function Cr(e,t){return e.length>0?(or(e,e.length,0,t),e):t}const j1={}.hasOwnProperty;function DN(e){const t={};let n=-1;for(;++n<e.length;)h8(t,e[n]);return t}function h8(e,t){let n;for(n in t){const a=(j1.call(e,n)?e[n]:void 0)||(e[n]={}),o=t[n];let l;if(o)for(l in o){j1.call(a,l)||(a[l]=[]);const c=o[l];p8(a[l],Array.isArray(c)?c:c?[c]:[])}}}function p8(e,t){let n=-1;const r=[];for(;++n<t.length;)(t[n].add==="after"?e:r).push(t[n]);or(e,0,0,r)}function IN(e,t){const n=Number.parseInt(e,t);return n<9||n===11||n>13&&n<32||n>126&&n<160||n>55295&&n<57344||n>64975&&n<65008||(n&65535)===65535||(n&65535)===65534||n>1114111?"�":String.fromCodePoint(n)}function Fr(e){return e.replace(/[\t\n\r ]+/g," ").replace(/^ | $/g,"").toLowerCase().toUpperCase()}const Ln=Oa(/[A-Za-z]/),jn=Oa(/[\dA-Za-z]/),m8=Oa(/[#-'*+\--9=?A-Z^-~]/);function lf(e){return e!==null&&(e<32||e===127)}const tv=Oa(/\d/),g8=Oa(/[\dA-Fa-f]/),v8=Oa(/[!-/:-@[-`{-~]/);function De(e){return e!==null&&e<-2}function At(e){return e!==null&&(e<0||e===32)}function Ze(e){return e===-2||e===-1||e===32}const If=Oa(new RegExp("\\p{P}|\\p{S}","u")),gs=Oa(/\s/);function Oa(e){return t;function t(n){return n!==null&&n>-1&&e.test(String.fromCharCode(n))}}function Lo(e){const t=[];let n=-1,r=0,a=0;for(;++n<e.length;){const o=e.charCodeAt(n);let l="";if(o===37&&jn(e.charCodeAt(n+1))&&jn(e.charCodeAt(n+2)))a=2;else if(o<128)/[!#$&-;=?-Z_a-z~]/.test(String.fromCharCode(o))||(l=String.fromCharCode(o));else if(o>55295&&o<57344){const c=e.charCodeAt(n+1);o<56320&&c>56319&&c<57344?(l=String.fromCharCode(o,c),a=1):l="�"}else l=String.fromCharCode(o);l&&(t.push(e.slice(r,n),encodeURIComponent(l)),r=n+a+1,l=""),a&&(n+=a,a=0)}return t.join("")+e.slice(r)}function at(e,t,n,r){const a=r?r-1:Number.POSITIVE_INFINITY;let o=0;return l;function l(d){return Ze(d)?(e.enter(n),c(d)):t(d)}function c(d){return Ze(d)&&o++<a?(e.consume(d),c):(e.exit(n),t(d))}}const y8={tokenize:b8};function b8(e){const t=e.attempt(this.parser.constructs.contentInitial,r,a);let n;return t;function r(c){if(c===null){e.consume(c);return}return e.enter("lineEnding"),e.consume(c),e.exit("lineEnding"),at(e,t,"linePrefix")}function a(c){return e.enter("paragraph"),o(c)}function o(c){const d=e.enter("chunkText",{contentType:"text",previous:n});return n&&(n.next=d),n=d,l(c)}function l(c){if(c===null){e.exit("chunkText"),e.exit("paragraph"),e.consume(c);return}return De(c)?(e.consume(c),e.exit("chunkText"),o):(e.consume(c),l)}}const x8={tokenize:S8},R1={tokenize:w8};function S8(e){const t=this,n=[];let r=0,a,o,l;return c;function c(k){if(r<n.length){const j=n[r];return t.containerState=j[1],e.attempt(j[0].continuation,d,f)(k)}return f(k)}function d(k){if(r++,t.containerState._closeFlow){t.containerState._closeFlow=void 0,a&&C();const j=t.events.length;let N=j,R;for(;N--;)if(t.events[N][0]==="exit"&&t.events[N][1].type==="chunkFlow"){R=t.events[N][1].end;break}T(r);let P=j;for(;P<t.events.length;)t.events[P][1].end={...R},P++;return or(t.events,N+1,0,t.events.slice(j)),t.events.length=P,f(k)}return c(k)}function f(k){if(r===n.length){if(!a)return v(k);if(a.currentConstruct&&a.currentConstruct.concrete)return S(k);t.interrupt=!!(a.currentConstruct&&!a._gfmTableDynamicInterruptHack)}return t.containerState={},e.check(R1,m,g)(k)}function m(k){return a&&C(),T(r),v(k)}function g(k){return t.parser.lazy[t.now().line]=r!==n.length,l=t.now().offset,S(k)}function v(k){return t.containerState={},e.attempt(R1,b,S)(k)}function b(k){return r++,n.push([t.currentConstruct,t.containerState]),v(k)}function S(k){if(k===null){a&&C(),T(0),e.consume(k);return}return a=a||t.parser.flow(t.now()),e.enter("chunkFlow",{_tokenizer:a,contentType:"flow",previous:o}),w(k)}function w(k){if(k===null){E(e.exit("chunkFlow"),!0),T(0),e.consume(k);return}return De(k)?(e.consume(k),E(e.exit("chunkFlow")),r=0,t.interrupt=void 0,c):(e.consume(k),w)}function E(k,j){const N=t.sliceStream(k);if(j&&N.push(null),k.previous=o,o&&(o.next=k),o=k,a.defineSkip(k.start),a.write(N),t.parser.lazy[k.start.line]){let R=a.events.length;for(;R--;)if(a.events[R][1].start.offset<l&&(!a.events[R][1].end||a.events[R][1].end.offset>l))return;const P=t.events.length;let L=P,H,D;for(;L--;)if(t.events[L][0]==="exit"&&t.events[L][1].type==="chunkFlow"){if(H){D=t.events[L][1].end;break}H=!0}for(T(r),R=P;R<t.events.length;)t.events[R][1].end={...D},R++;or(t.events,L+1,0,t.events.slice(P)),t.events.length=R}}function T(k){let j=n.length;for(;j-- >k;){const N=n[j];t.containerState=N[1],N[0].exit.call(t,e)}n.length=k}function C(){a.write([null]),o=void 0,a=void 0,t.containerState._closeFlow=void 0}}function w8(e,t,n){return at(e,e.attempt(this.parser.constructs.document,t,n),"linePrefix",this.parser.constructs.disable.null.includes("codeIndented")?void 0:4)}function Ao(e){if(e===null||At(e)||gs(e))return 1;if(If(e))return 2}function Pf(e,t,n){const r=[];let a=-1;for(;++a<e.length;){const o=e[a].resolveAll;o&&!r.includes(o)&&(t=o(t,n),r.push(o))}return t}const nv={name:"attention",resolveAll:E8,tokenize:T8};function E8(e,t){let n=-1,r,a,o,l,c,d,f,m;for(;++n<e.length;)if(e[n][0]==="enter"&&e[n][1].type==="attentionSequence"&&e[n][1]._close){for(r=n;r--;)if(e[r][0]==="exit"&&e[r][1].type==="attentionSequence"&&e[r][1]._open&&t.sliceSerialize(e[r][1]).charCodeAt(0)===t.sliceSerialize(e[n][1]).charCodeAt(0)){if((e[r][1]._close||e[n][1]._open)&&(e[n][1].end.offset-e[n][1].start.offset)%3&&!((e[r][1].end.offset-e[r][1].start.offset+e[n][1].end.offset-e[n][1].start.offset)%3))continue;d=e[r][1].end.offset-e[r][1].start.offset>1&&e[n][1].end.offset-e[n][1].start.offset>1?2:1;const g={...e[r][1].end},v={...e[n][1].start};_1(g,-d),_1(v,d),l={type:d>1?"strongSequence":"emphasisSequence",start:g,end:{...e[r][1].end}},c={type:d>1?"strongSequence":"emphasisSequence",start:{...e[n][1].start},end:v},o={type:d>1?"strongText":"emphasisText",start:{...e[r][1].end},end:{...e[n][1].start}},a={type:d>1?"strong":"emphasis",start:{...l.start},end:{...c.end}},e[r][1].end={...l.start},e[n][1].start={...c.end},f=[],e[r][1].end.offset-e[r][1].start.offset&&(f=Cr(f,[["enter",e[r][1],t],["exit",e[r][1],t]])),f=Cr(f,[["enter",a,t],["enter",l,t],["exit",l,t],["enter",o,t]]),f=Cr(f,Pf(t.parser.constructs.insideSpan.null,e.slice(r+1,n),t)),f=Cr(f,[["exit",o,t],["enter",c,t],["exit",c,t],["exit",a,t]]),e[n][1].end.offset-e[n][1].start.offset?(m=2,f=Cr(f,[["enter",e[n][1],t],["exit",e[n][1],t]])):m=0,or(e,r-1,n-r+3,f),n=r+f.length-m-2;break}}for(n=-1;++n<e.length;)e[n][1].type==="attentionSequence"&&(e[n][1].type="data");return e}function T8(e,t){const n=this.parser.constructs.attentionMarkers.null,r=this.previous,a=Ao(r);let o;return l;function l(d){return o=d,e.enter("attentionSequence"),c(d)}function c(d){if(d===o)return e.consume(d),c;const f=e.exit("attentionSequence"),m=Ao(d),g=!m||m===2&&a||n.includes(d),v=!a||a===2&&m||n.includes(r);return f._open=!!(o===42?g:g&&(a||!v)),f._close=!!(o===42?v:v&&(m||!g)),t(d)}}function _1(e,t){e.column+=t,e.offset+=t,e._bufferIndex+=t}const k8={name:"autolink",tokenize:C8};function C8(e,t,n){let r=0;return a;function a(b){return e.enter("autolink"),e.enter("autolinkMarker"),e.consume(b),e.exit("autolinkMarker"),e.enter("autolinkProtocol"),o}function o(b){return Ln(b)?(e.consume(b),l):b===64?n(b):f(b)}function l(b){return b===43||b===45||b===46||jn(b)?(r=1,c(b)):f(b)}function c(b){return b===58?(e.consume(b),r=0,d):(b===43||b===45||b===46||jn(b))&&r++<32?(e.consume(b),c):(r=0,f(b))}function d(b){return b===62?(e.exit("autolinkProtocol"),e.enter("autolinkMarker"),e.consume(b),e.exit("autolinkMarker"),e.exit("autolink"),t):b===null||b===32||b===60||lf(b)?n(b):(e.consume(b),d)}function f(b){return b===64?(e.consume(b),m):m8(b)?(e.consume(b),f):n(b)}function m(b){return jn(b)?g(b):n(b)}function g(b){return b===46?(e.consume(b),r=0,m):b===62?(e.exit("autolinkProtocol").type="autolinkEmail",e.enter("autolinkMarker"),e.consume(b),e.exit("autolinkMarker"),e.exit("autolink"),t):v(b)}function v(b){if((b===45||jn(b))&&r++<63){const S=b===45?v:g;return e.consume(b),S}return n(b)}}const Lu={partial:!0,tokenize:A8};function A8(e,t,n){return r;function r(o){return Ze(o)?at(e,a,"linePrefix")(o):a(o)}function a(o){return o===null||De(o)?t(o):n(o)}}const PN={continuation:{tokenize:j8},exit:R8,name:"blockQuote",tokenize:N8};function N8(e,t,n){const r=this;return a;function a(l){if(l===62){const c=r.containerState;return c.open||(e.enter("blockQuote",{_container:!0}),c.open=!0),e.enter("blockQuotePrefix"),e.enter("blockQuoteMarker"),e.consume(l),e.exit("blockQuoteMarker"),o}return n(l)}function o(l){return Ze(l)?(e.enter("blockQuotePrefixWhitespace"),e.consume(l),e.exit("blockQuotePrefixWhitespace"),e.exit("blockQuotePrefix"),t):(e.exit("blockQuotePrefix"),t(l))}}function j8(e,t,n){const r=this;return a;function a(l){return Ze(l)?at(e,o,"linePrefix",r.parser.constructs.disable.null.includes("codeIndented")?void 0:4)(l):o(l)}function o(l){return e.attempt(PN,t,n)(l)}}function R8(e){e.exit("blockQuote")}const LN={name:"characterEscape",tokenize:_8};function _8(e,t,n){return r;function r(o){return e.enter("characterEscape"),e.enter("escapeMarker"),e.consume(o),e.exit("escapeMarker"),a}function a(o){return v8(o)?(e.enter("characterEscapeValue"),e.consume(o),e.exit("characterEscapeValue"),e.exit("characterEscape"),t):n(o)}}const zN={name:"characterReference",tokenize:O8};function O8(e,t,n){const r=this;let a=0,o,l;return c;function c(g){return e.enter("characterReference"),e.enter("characterReferenceMarker"),e.consume(g),e.exit("characterReferenceMarker"),d}function d(g){return g===35?(e.enter("characterReferenceMarkerNumeric"),e.consume(g),e.exit("characterReferenceMarkerNumeric"),f):(e.enter("characterReferenceValue"),o=31,l=jn,m(g))}function f(g){return g===88||g===120?(e.enter("characterReferenceMarkerHexadecimal"),e.consume(g),e.exit("characterReferenceMarkerHexadecimal"),e.enter("characterReferenceValue"),o=6,l=g8,m):(e.enter("characterReferenceValue"),o=7,l=tv,m(g))}function m(g){if(g===59&&a){const v=e.exit("characterReferenceValue");return l===jn&&!Ty(r.sliceSerialize(v))?n(g):(e.enter("characterReferenceMarker"),e.consume(g),e.exit("characterReferenceMarker"),e.exit("characterReference"),t)}return l(g)&&a++<o?(e.consume(g),m):n(g)}}const O1={partial:!0,tokenize:D8},M1={concrete:!0,name:"codeFenced",tokenize:M8};function M8(e,t,n){const r=this,a={partial:!0,tokenize:N};let o=0,l=0,c;return d;function d(R){return f(R)}function f(R){const P=r.events[r.events.length-1];return o=P&&P[1].type==="linePrefix"?P[2].sliceSerialize(P[1],!0).length:0,c=R,e.enter("codeFenced"),e.enter("codeFencedFence"),e.enter("codeFencedFenceSequence"),m(R)}function m(R){return R===c?(l++,e.consume(R),m):l<3?n(R):(e.exit("codeFencedFenceSequence"),Ze(R)?at(e,g,"whitespace")(R):g(R))}function g(R){return R===null||De(R)?(e.exit("codeFencedFence"),r.interrupt?t(R):e.check(O1,w,j)(R)):(e.enter("codeFencedFenceInfo"),e.enter("chunkString",{contentType:"string"}),v(R))}function v(R){return R===null||De(R)?(e.exit("chunkString"),e.exit("codeFencedFenceInfo"),g(R)):Ze(R)?(e.exit("chunkString"),e.exit("codeFencedFenceInfo"),at(e,b,"whitespace")(R)):R===96&&R===c?n(R):(e.consume(R),v)}function b(R){return R===null||De(R)?g(R):(e.enter("codeFencedFenceMeta"),e.enter("chunkString",{contentType:"string"}),S(R))}function S(R){return R===null||De(R)?(e.exit("chunkString"),e.exit("codeFencedFenceMeta"),g(R)):R===96&&R===c?n(R):(e.consume(R),S)}function w(R){return e.attempt(a,j,E)(R)}function E(R){return e.enter("lineEnding"),e.consume(R),e.exit("lineEnding"),T}function T(R){return o>0&&Ze(R)?at(e,C,"linePrefix",o+1)(R):C(R)}function C(R){return R===null||De(R)?e.check(O1,w,j)(R):(e.enter("codeFlowValue"),k(R))}function k(R){return R===null||De(R)?(e.exit("codeFlowValue"),C(R)):(e.consume(R),k)}function j(R){return e.exit("codeFenced"),t(R)}function N(R,P,L){let H=0;return D;function D(Z){return R.enter("lineEnding"),R.consume(Z),R.exit("lineEnding"),B}function B(Z){return R.enter("codeFencedFence"),Ze(Z)?at(R,K,"linePrefix",r.parser.constructs.disable.null.includes("codeIndented")?void 0:4)(Z):K(Z)}function K(Z){return Z===c?(R.enter("codeFencedFenceSequence"),se(Z)):L(Z)}function se(Z){return Z===c?(H++,R.consume(Z),se):H>=l?(R.exit("codeFencedFenceSequence"),Ze(Z)?at(R,ue,"whitespace")(Z):ue(Z)):L(Z)}function ue(Z){return Z===null||De(Z)?(R.exit("codeFencedFence"),P(Z)):L(Z)}}}function D8(e,t,n){const r=this;return a;function a(l){return l===null?n(l):(e.enter("lineEnding"),e.consume(l),e.exit("lineEnding"),o)}function o(l){return r.parser.lazy[r.now().line]?n(l):t(l)}}const Mm={name:"codeIndented",tokenize:P8},I8={partial:!0,tokenize:L8};function P8(e,t,n){const r=this;return a;function a(f){return e.enter("codeIndented"),at(e,o,"linePrefix",5)(f)}function o(f){const m=r.events[r.events.length-1];return m&&m[1].type==="linePrefix"&&m[2].sliceSerialize(m[1],!0).length>=4?l(f):n(f)}function l(f){return f===null?d(f):De(f)?e.attempt(I8,l,d)(f):(e.enter("codeFlowValue"),c(f))}function c(f){return f===null||De(f)?(e.exit("codeFlowValue"),l(f)):(e.consume(f),c)}function d(f){return e.exit("codeIndented"),t(f)}}function L8(e,t,n){const r=this;return a;function a(l){return r.parser.lazy[r.now().line]?n(l):De(l)?(e.enter("lineEnding"),e.consume(l),e.exit("lineEnding"),a):at(e,o,"linePrefix",5)(l)}function o(l){const c=r.events[r.events.length-1];return c&&c[1].type==="linePrefix"&&c[2].sliceSerialize(c[1],!0).length>=4?t(l):De(l)?a(l):n(l)}}const z8={name:"codeText",previous:B8,resolve:U8,tokenize:V8};function U8(e){let t=e.length-4,n=3,r,a;if((e[n][1].type==="lineEnding"||e[n][1].type==="space")&&(e[t][1].type==="lineEnding"||e[t][1].type==="space")){for(r=n;++r<t;)if(e[r][1].type==="codeTextData"){e[n][1].type="codeTextPadding",e[t][1].type="codeTextPadding",n+=2,t-=2;break}}for(r=n-1,t++;++r<=t;)a===void 0?r!==t&&e[r][1].type!=="lineEnding"&&(a=r):(r===t||e[r][1].type==="lineEnding")&&(e[a][1].type="codeTextData",r!==a+2&&(e[a][1].end=e[r-1][1].end,e.splice(a+2,r-a-2),t-=r-a-2,r=a+2),a=void 0);return e}function B8(e){return e!==96||this.events[this.events.length-1][1].type==="characterEscape"}function V8(e,t,n){let r=0,a,o;return l;function l(g){return e.enter("codeText"),e.enter("codeTextSequence"),c(g)}function c(g){return g===96?(e.consume(g),r++,c):(e.exit("codeTextSequence"),d(g))}function d(g){return g===null?n(g):g===32?(e.enter("space"),e.consume(g),e.exit("space"),d):g===96?(o=e.enter("codeTextSequence"),a=0,m(g)):De(g)?(e.enter("lineEnding"),e.consume(g),e.exit("lineEnding"),d):(e.enter("codeTextData"),f(g))}function f(g){return g===null||g===32||g===96||De(g)?(e.exit("codeTextData"),d(g)):(e.consume(g),f)}function m(g){return g===96?(e.consume(g),a++,m):a===r?(e.exit("codeTextSequence"),e.exit("codeText"),t(g)):(o.type="codeTextData",f(g))}}class F8{constructor(t){this.left=t?[...t]:[],this.right=[]}get(t){if(t<0||t>=this.left.length+this.right.length)throw new RangeError("Cannot access index `"+t+"` in a splice buffer of size `"+(this.left.length+this.right.length)+"`");return t<this.left.length?this.left[t]:this.right[this.right.length-t+this.left.length-1]}get length(){return this.left.length+this.right.length}shift(){return this.setCursor(0),this.right.pop()}slice(t,n){const r=n??Number.POSITIVE_INFINITY;return r<this.left.length?this.left.slice(t,r):t>this.left.length?this.right.slice(this.right.length-r+this.left.length,this.right.length-t+this.left.length).reverse():this.left.slice(t).concat(this.right.slice(this.right.length-r+this.left.length).reverse())}splice(t,n,r){const a=n||0;this.setCursor(Math.trunc(t));const o=this.right.splice(this.right.length-a,Number.POSITIVE_INFINITY);return r&&Kl(this.left,r),o.reverse()}pop(){return this.setCursor(Number.POSITIVE_INFINITY),this.left.pop()}push(t){this.setCursor(Number.POSITIVE_INFINITY),this.left.push(t)}pushMany(t){this.setCursor(Number.POSITIVE_INFINITY),Kl(this.left,t)}unshift(t){this.setCursor(0),this.right.push(t)}unshiftMany(t){this.setCursor(0),Kl(this.right,t.reverse())}setCursor(t){if(!(t===this.left.length||t>this.left.length&&this.right.length===0||t<0&&this.left.length===0))if(t<this.left.length){const n=this.left.splice(t,Number.POSITIVE_INFINITY);Kl(this.right,n.reverse())}else{const n=this.right.splice(this.left.length+this.right.length-t,Number.POSITIVE_INFINITY);Kl(this.left,n.reverse())}}}function Kl(e,t){let n=0;if(t.length<1e4)e.push(...t);else for(;n<t.length;)e.push(...t.slice(n,n+1e4)),n+=1e4}function UN(e){const t={};let n=-1,r,a,o,l,c,d,f;const m=new F8(e);for(;++n<m.length;){for(;n in t;)n=t[n];if(r=m.get(n),n&&r[1].type==="chunkFlow"&&m.get(n-1)[1].type==="listItemPrefix"&&(d=r[1]._tokenizer.events,o=0,o<d.length&&d[o][1].type==="lineEndingBlank"&&(o+=2),o<d.length&&d[o][1].type==="content"))for(;++o<d.length&&d[o][1].type!=="content";)d[o][1].type==="chunkText"&&(d[o][1]._isInFirstContentOfListItem=!0,o++);if(r[0]==="enter")r[1].contentType&&(Object.assign(t,H8(m,n)),n=t[n],f=!0);else if(r[1]._container){for(o=n,a=void 0;o--;)if(l=m.get(o),l[1].type==="lineEnding"||l[1].type==="lineEndingBlank")l[0]==="enter"&&(a&&(m.get(a)[1].type="lineEndingBlank"),l[1].type="lineEnding",a=o);else if(!(l[1].type==="linePrefix"||l[1].type==="listItemIndent"))break;a&&(r[1].end={...m.get(a)[1].start},c=m.slice(a,n),c.unshift(r),m.splice(a,n-a+1,c))}}return or(e,0,Number.POSITIVE_INFINITY,m.slice(0)),!f}function H8(e,t){const n=e.get(t)[1],r=e.get(t)[2];let a=t-1;const o=[];let l=n._tokenizer;l||(l=r.parser[n.contentType](n.start),n._contentTypeTextTrailing&&(l._contentTypeTextTrailing=!0));const c=l.events,d=[],f={};let m,g,v=-1,b=n,S=0,w=0;const E=[w];for(;b;){for(;e.get(++a)[1]!==b;);o.push(a),b._tokenizer||(m=r.sliceStream(b),b.next||m.push(null),g&&l.defineSkip(b.start),b._isInFirstContentOfListItem&&(l._gfmTasklistFirstContentOfListItem=!0),l.write(m),b._isInFirstContentOfListItem&&(l._gfmTasklistFirstContentOfListItem=void 0)),g=b,b=b.next}for(b=n;++v<c.length;)c[v][0]==="exit"&&c[v-1][0]==="enter"&&c[v][1].type===c[v-1][1].type&&c[v][1].start.line!==c[v][1].end.line&&(w=v+1,E.push(w),b._tokenizer=void 0,b.previous=void 0,b=b.next);for(l.events=[],b?(b._tokenizer=void 0,b.previous=void 0):E.pop(),v=E.length;v--;){const T=c.slice(E[v],E[v+1]),C=o.pop();d.push([C,C+T.length-1]),e.splice(C,2,T)}for(d.reverse(),v=-1;++v<d.length;)f[S+d[v][0]]=S+d[v][1],S+=d[v][1]-d[v][0]-1;return f}const q8={resolve:K8,tokenize:$8},G8={partial:!0,tokenize:Y8};function K8(e){return UN(e),e}function $8(e,t){let n;return r;function r(c){return e.enter("content"),n=e.enter("chunkContent",{contentType:"content"}),a(c)}function a(c){return c===null?o(c):De(c)?e.check(G8,l,o)(c):(e.consume(c),a)}function o(c){return e.exit("chunkContent"),e.exit("content"),t(c)}function l(c){return e.consume(c),e.exit("chunkContent"),n.next=e.enter("chunkContent",{contentType:"content",previous:n}),n=n.next,a}}function Y8(e,t,n){const r=this;return a;function a(l){return e.exit("chunkContent"),e.enter("lineEnding"),e.consume(l),e.exit("lineEnding"),at(e,o,"linePrefix")}function o(l){if(l===null||De(l))return n(l);const c=r.events[r.events.length-1];return!r.parser.constructs.disable.null.includes("codeIndented")&&c&&c[1].type==="linePrefix"&&c[2].sliceSerialize(c[1],!0).length>=4?t(l):e.interrupt(r.parser.constructs.flow,n,t)(l)}}function BN(e,t,n,r,a,o,l,c,d){const f=d||Number.POSITIVE_INFINITY;let m=0;return g;function g(T){return T===60?(e.enter(r),e.enter(a),e.enter(o),e.consume(T),e.exit(o),v):T===null||T===32||T===41||lf(T)?n(T):(e.enter(r),e.enter(l),e.enter(c),e.enter("chunkString",{contentType:"string"}),w(T))}function v(T){return T===62?(e.enter(o),e.consume(T),e.exit(o),e.exit(a),e.exit(r),t):(e.enter(c),e.enter("chunkString",{contentType:"string"}),b(T))}function b(T){return T===62?(e.exit("chunkString"),e.exit(c),v(T)):T===null||T===60||De(T)?n(T):(e.consume(T),T===92?S:b)}function S(T){return T===60||T===62||T===92?(e.consume(T),b):b(T)}function w(T){return!m&&(T===null||T===41||At(T))?(e.exit("chunkString"),e.exit(c),e.exit(l),e.exit(r),t(T)):m<f&&T===40?(e.consume(T),m++,w):T===41?(e.consume(T),m--,w):T===null||T===32||T===40||lf(T)?n(T):(e.consume(T),T===92?E:w)}function E(T){return T===40||T===41||T===92?(e.consume(T),w):w(T)}}function VN(e,t,n,r,a,o){const l=this;let c=0,d;return f;function f(b){return e.enter(r),e.enter(a),e.consume(b),e.exit(a),e.enter(o),m}function m(b){return c>999||b===null||b===91||b===93&&!d||b===94&&!c&&"_hiddenFootnoteSupport"in l.parser.constructs?n(b):b===93?(e.exit(o),e.enter(a),e.consume(b),e.exit(a),e.exit(r),t):De(b)?(e.enter("lineEnding"),e.consume(b),e.exit("lineEnding"),m):(e.enter("chunkString",{contentType:"string"}),g(b))}function g(b){return b===null||b===91||b===93||De(b)||c++>999?(e.exit("chunkString"),m(b)):(e.consume(b),d||(d=!Ze(b)),b===92?v:g)}function v(b){return b===91||b===92||b===93?(e.consume(b),c++,g):g(b)}}function FN(e,t,n,r,a,o){let l;return c;function c(v){return v===34||v===39||v===40?(e.enter(r),e.enter(a),e.consume(v),e.exit(a),l=v===40?41:v,d):n(v)}function d(v){return v===l?(e.enter(a),e.consume(v),e.exit(a),e.exit(r),t):(e.enter(o),f(v))}function f(v){return v===l?(e.exit(o),d(l)):v===null?n(v):De(v)?(e.enter("lineEnding"),e.consume(v),e.exit("lineEnding"),at(e,f,"linePrefix")):(e.enter("chunkString",{contentType:"string"}),m(v))}function m(v){return v===l||v===null||De(v)?(e.exit("chunkString"),f(v)):(e.consume(v),v===92?g:m)}function g(v){return v===l||v===92?(e.consume(v),m):m(v)}}function du(e,t){let n;return r;function r(a){return De(a)?(e.enter("lineEnding"),e.consume(a),e.exit("lineEnding"),n=!0,r):Ze(a)?at(e,r,n?"linePrefix":"lineSuffix")(a):t(a)}}const W8={name:"definition",tokenize:Q8},X8={partial:!0,tokenize:J8};function Q8(e,t,n){const r=this;let a;return o;function o(b){return e.enter("definition"),l(b)}function l(b){return VN.call(r,e,c,n,"definitionLabel","definitionLabelMarker","definitionLabelString")(b)}function c(b){return a=Fr(r.sliceSerialize(r.events[r.events.length-1][1]).slice(1,-1)),b===58?(e.enter("definitionMarker"),e.consume(b),e.exit("definitionMarker"),d):n(b)}function d(b){return At(b)?du(e,f)(b):f(b)}function f(b){return BN(e,m,n,"definitionDestination","definitionDestinationLiteral","definitionDestinationLiteralMarker","definitionDestinationRaw","definitionDestinationString")(b)}function m(b){return e.attempt(X8,g,g)(b)}function g(b){return Ze(b)?at(e,v,"whitespace")(b):v(b)}function v(b){return b===null||De(b)?(e.exit("definition"),r.parser.defined.push(a),t(b)):n(b)}}function J8(e,t,n){return r;function r(c){return At(c)?du(e,a)(c):n(c)}function a(c){return FN(e,o,n,"definitionTitle","definitionTitleMarker","definitionTitleString")(c)}function o(c){return Ze(c)?at(e,l,"whitespace")(c):l(c)}function l(c){return c===null||De(c)?t(c):n(c)}}const Z8={name:"hardBreakEscape",tokenize:e5};function e5(e,t,n){return r;function r(o){return e.enter("hardBreakEscape"),e.consume(o),a}function a(o){return De(o)?(e.exit("hardBreakEscape"),t(o)):n(o)}}const t5={name:"headingAtx",resolve:n5,tokenize:r5};function n5(e,t){let n=e.length-2,r=3,a,o;return e[r][1].type==="whitespace"&&(r+=2),n-2>r&&e[n][1].type==="whitespace"&&(n-=2),e[n][1].type==="atxHeadingSequence"&&(r===n-1||n-4>r&&e[n-2][1].type==="whitespace")&&(n-=r+1===n?2:4),n>r&&(a={type:"atxHeadingText",start:e[r][1].start,end:e[n][1].end},o={type:"chunkText",start:e[r][1].start,end:e[n][1].end,contentType:"text"},or(e,r,n-r+1,[["enter",a,t],["enter",o,t],["exit",o,t],["exit",a,t]])),e}function r5(e,t,n){let r=0;return a;function a(m){return e.enter("atxHeading"),o(m)}function o(m){return e.enter("atxHeadingSequence"),l(m)}function l(m){return m===35&&r++<6?(e.consume(m),l):m===null||At(m)?(e.exit("atxHeadingSequence"),c(m)):n(m)}function c(m){return m===35?(e.enter("atxHeadingSequence"),d(m)):m===null||De(m)?(e.exit("atxHeading"),t(m)):Ze(m)?at(e,c,"whitespace")(m):(e.enter("atxHeadingText"),f(m))}function d(m){return m===35?(e.consume(m),d):(e.exit("atxHeadingSequence"),c(m))}function f(m){return m===null||m===35||At(m)?(e.exit("atxHeadingText"),c(m)):(e.consume(m),f)}}const i5=["address","article","aside","base","basefont","blockquote","body","caption","center","col","colgroup","dd","details","dialog","dir","div","dl","dt","fieldset","figcaption","figure","footer","form","frame","frameset","h1","h2","h3","h4","h5","h6","head","header","hr","html","iframe","legend","li","link","main","menu","menuitem","nav","noframes","ol","optgroup","option","p","param","search","section","summary","table","tbody","td","tfoot","th","thead","title","tr","track","ul"],D1=["pre","script","style","textarea"],a5={concrete:!0,name:"htmlFlow",resolveTo:l5,tokenize:u5},s5={partial:!0,tokenize:d5},o5={partial:!0,tokenize:c5};function l5(e){let t=e.length;for(;t--&&!(e[t][0]==="enter"&&e[t][1].type==="htmlFlow"););return t>1&&e[t-2][1].type==="linePrefix"&&(e[t][1].start=e[t-2][1].start,e[t+1][1].start=e[t-2][1].start,e.splice(t-2,2)),e}function u5(e,t,n){const r=this;let a,o,l,c,d;return f;function f(I){return m(I)}function m(I){return e.enter("htmlFlow"),e.enter("htmlFlowData"),e.consume(I),g}function g(I){return I===33?(e.consume(I),v):I===47?(e.consume(I),o=!0,w):I===63?(e.consume(I),a=3,r.interrupt?t:M):Ln(I)?(e.consume(I),l=String.fromCharCode(I),E):n(I)}function v(I){return I===45?(e.consume(I),a=2,b):I===91?(e.consume(I),a=5,c=0,S):Ln(I)?(e.consume(I),a=4,r.interrupt?t:M):n(I)}function b(I){return I===45?(e.consume(I),r.interrupt?t:M):n(I)}function S(I){const fe="CDATA[";return I===fe.charCodeAt(c++)?(e.consume(I),c===fe.length?r.interrupt?t:K:S):n(I)}function w(I){return Ln(I)?(e.consume(I),l=String.fromCharCode(I),E):n(I)}function E(I){if(I===null||I===47||I===62||At(I)){const fe=I===47,ge=l.toLowerCase();return!fe&&!o&&D1.includes(ge)?(a=1,r.interrupt?t(I):K(I)):i5.includes(l.toLowerCase())?(a=6,fe?(e.consume(I),T):r.interrupt?t(I):K(I)):(a=7,r.interrupt&&!r.parser.lazy[r.now().line]?n(I):o?C(I):k(I))}return I===45||jn(I)?(e.consume(I),l+=String.fromCharCode(I),E):n(I)}function T(I){return I===62?(e.consume(I),r.interrupt?t:K):n(I)}function C(I){return Ze(I)?(e.consume(I),C):D(I)}function k(I){return I===47?(e.consume(I),D):I===58||I===95||Ln(I)?(e.consume(I),j):Ze(I)?(e.consume(I),k):D(I)}function j(I){return I===45||I===46||I===58||I===95||jn(I)?(e.consume(I),j):N(I)}function N(I){return I===61?(e.consume(I),R):Ze(I)?(e.consume(I),N):k(I)}function R(I){return I===null||I===60||I===61||I===62||I===96?n(I):I===34||I===39?(e.consume(I),d=I,P):Ze(I)?(e.consume(I),R):L(I)}function P(I){return I===d?(e.consume(I),d=null,H):I===null||De(I)?n(I):(e.consume(I),P)}function L(I){return I===null||I===34||I===39||I===47||I===60||I===61||I===62||I===96||At(I)?N(I):(e.consume(I),L)}function H(I){return I===47||I===62||Ze(I)?k(I):n(I)}function D(I){return I===62?(e.consume(I),B):n(I)}function B(I){return I===null||De(I)?K(I):Ze(I)?(e.consume(I),B):n(I)}function K(I){return I===45&&a===2?(e.consume(I),V):I===60&&a===1?(e.consume(I),X):I===62&&a===4?(e.consume(I),z):I===63&&a===3?(e.consume(I),M):I===93&&a===5?(e.consume(I),ye):De(I)&&(a===6||a===7)?(e.exit("htmlFlowData"),e.check(s5,W,se)(I)):I===null||De(I)?(e.exit("htmlFlowData"),se(I)):(e.consume(I),K)}function se(I){return e.check(o5,ue,W)(I)}function ue(I){return e.enter("lineEnding"),e.consume(I),e.exit("lineEnding"),Z}function Z(I){return I===null||De(I)?se(I):(e.enter("htmlFlowData"),K(I))}function V(I){return I===45?(e.consume(I),M):K(I)}function X(I){return I===47?(e.consume(I),l="",le):K(I)}function le(I){if(I===62){const fe=l.toLowerCase();return D1.includes(fe)?(e.consume(I),z):K(I)}return Ln(I)&&l.length<8?(e.consume(I),l+=String.fromCharCode(I),le):K(I)}function ye(I){return I===93?(e.consume(I),M):K(I)}function M(I){return I===62?(e.consume(I),z):I===45&&a===2?(e.consume(I),M):K(I)}function z(I){return I===null||De(I)?(e.exit("htmlFlowData"),W(I)):(e.consume(I),z)}function W(I){return e.exit("htmlFlow"),t(I)}}function c5(e,t,n){const r=this;return a;function a(l){return De(l)?(e.enter("lineEnding"),e.consume(l),e.exit("lineEnding"),o):n(l)}function o(l){return r.parser.lazy[r.now().line]?n(l):t(l)}}function d5(e,t,n){return r;function r(a){return e.enter("lineEnding"),e.consume(a),e.exit("lineEnding"),e.attempt(Lu,t,n)}}const f5={name:"htmlText",tokenize:h5};function h5(e,t,n){const r=this;let a,o,l;return c;function c(M){return e.enter("htmlText"),e.enter("htmlTextData"),e.consume(M),d}function d(M){return M===33?(e.consume(M),f):M===47?(e.consume(M),N):M===63?(e.consume(M),k):Ln(M)?(e.consume(M),L):n(M)}function f(M){return M===45?(e.consume(M),m):M===91?(e.consume(M),o=0,S):Ln(M)?(e.consume(M),C):n(M)}function m(M){return M===45?(e.consume(M),b):n(M)}function g(M){return M===null?n(M):M===45?(e.consume(M),v):De(M)?(l=g,X(M)):(e.consume(M),g)}function v(M){return M===45?(e.consume(M),b):g(M)}function b(M){return M===62?V(M):M===45?v(M):g(M)}function S(M){const z="CDATA[";return M===z.charCodeAt(o++)?(e.consume(M),o===z.length?w:S):n(M)}function w(M){return M===null?n(M):M===93?(e.consume(M),E):De(M)?(l=w,X(M)):(e.consume(M),w)}function E(M){return M===93?(e.consume(M),T):w(M)}function T(M){return M===62?V(M):M===93?(e.consume(M),T):w(M)}function C(M){return M===null||M===62?V(M):De(M)?(l=C,X(M)):(e.consume(M),C)}function k(M){return M===null?n(M):M===63?(e.consume(M),j):De(M)?(l=k,X(M)):(e.consume(M),k)}function j(M){return M===62?V(M):k(M)}function N(M){return Ln(M)?(e.consume(M),R):n(M)}function R(M){return M===45||jn(M)?(e.consume(M),R):P(M)}function P(M){return De(M)?(l=P,X(M)):Ze(M)?(e.consume(M),P):V(M)}function L(M){return M===45||jn(M)?(e.consume(M),L):M===47||M===62||At(M)?H(M):n(M)}function H(M){return M===47?(e.consume(M),V):M===58||M===95||Ln(M)?(e.consume(M),D):De(M)?(l=H,X(M)):Ze(M)?(e.consume(M),H):V(M)}function D(M){return M===45||M===46||M===58||M===95||jn(M)?(e.consume(M),D):B(M)}function B(M){return M===61?(e.consume(M),K):De(M)?(l=B,X(M)):Ze(M)?(e.consume(M),B):H(M)}function K(M){return M===null||M===60||M===61||M===62||M===96?n(M):M===34||M===39?(e.consume(M),a=M,se):De(M)?(l=K,X(M)):Ze(M)?(e.consume(M),K):(e.consume(M),ue)}function se(M){return M===a?(e.consume(M),a=void 0,Z):M===null?n(M):De(M)?(l=se,X(M)):(e.consume(M),se)}function ue(M){return M===null||M===34||M===39||M===60||M===61||M===96?n(M):M===47||M===62||At(M)?H(M):(e.consume(M),ue)}function Z(M){return M===47||M===62||At(M)?H(M):n(M)}function V(M){return M===62?(e.consume(M),e.exit("htmlTextData"),e.exit("htmlText"),t):n(M)}function X(M){return e.exit("htmlTextData"),e.enter("lineEnding"),e.consume(M),e.exit("lineEnding"),le}function le(M){return Ze(M)?at(e,ye,"linePrefix",r.parser.constructs.disable.null.includes("codeIndented")?void 0:4)(M):ye(M)}function ye(M){return e.enter("htmlTextData"),l(M)}}const ky={name:"labelEnd",resolveAll:v5,resolveTo:y5,tokenize:b5},p5={tokenize:x5},m5={tokenize:S5},g5={tokenize:w5};function v5(e){let t=-1;const n=[];for(;++t<e.length;){const r=e[t][1];if(n.push(e[t]),r.type==="labelImage"||r.type==="labelLink"||r.type==="labelEnd"){const a=r.type==="labelImage"?4:2;r.type="data",t+=a}}return e.length!==n.length&&or(e,0,e.length,n),e}function y5(e,t){let n=e.length,r=0,a,o,l,c;for(;n--;)if(a=e[n][1],o){if(a.type==="link"||a.type==="labelLink"&&a._inactive)break;e[n][0]==="enter"&&a.type==="labelLink"&&(a._inactive=!0)}else if(l){if(e[n][0]==="enter"&&(a.type==="labelImage"||a.type==="labelLink")&&!a._balanced&&(o=n,a.type!=="labelLink")){r=2;break}}else a.type==="labelEnd"&&(l=n);const d={type:e[o][1].type==="labelLink"?"link":"image",start:{...e[o][1].start},end:{...e[e.length-1][1].end}},f={type:"label",start:{...e[o][1].start},end:{...e[l][1].end}},m={type:"labelText",start:{...e[o+r+2][1].end},end:{...e[l-2][1].start}};return c=[["enter",d,t],["enter",f,t]],c=Cr(c,e.slice(o+1,o+r+3)),c=Cr(c,[["enter",m,t]]),c=Cr(c,Pf(t.parser.constructs.insideSpan.null,e.slice(o+r+4,l-3),t)),c=Cr(c,[["exit",m,t],e[l-2],e[l-1],["exit",f,t]]),c=Cr(c,e.slice(l+1)),c=Cr(c,[["exit",d,t]]),or(e,o,e.length,c),e}function b5(e,t,n){const r=this;let a=r.events.length,o,l;for(;a--;)if((r.events[a][1].type==="labelImage"||r.events[a][1].type==="labelLink")&&!r.events[a][1]._balanced){o=r.events[a][1];break}return c;function c(v){return o?o._inactive?g(v):(l=r.parser.defined.includes(Fr(r.sliceSerialize({start:o.end,end:r.now()}))),e.enter("labelEnd"),e.enter("labelMarker"),e.consume(v),e.exit("labelMarker"),e.exit("labelEnd"),d):n(v)}function d(v){return v===40?e.attempt(p5,m,l?m:g)(v):v===91?e.attempt(m5,m,l?f:g)(v):l?m(v):g(v)}function f(v){return e.attempt(g5,m,g)(v)}function m(v){return t(v)}function g(v){return o._balanced=!0,n(v)}}function x5(e,t,n){return r;function r(g){return e.enter("resource"),e.enter("resourceMarker"),e.consume(g),e.exit("resourceMarker"),a}function a(g){return At(g)?du(e,o)(g):o(g)}function o(g){return g===41?m(g):BN(e,l,c,"resourceDestination","resourceDestinationLiteral","resourceDestinationLiteralMarker","resourceDestinationRaw","resourceDestinationString",32)(g)}function l(g){return At(g)?du(e,d)(g):m(g)}function c(g){return n(g)}function d(g){return g===34||g===39||g===40?FN(e,f,n,"resourceTitle","resourceTitleMarker","resourceTitleString")(g):m(g)}function f(g){return At(g)?du(e,m)(g):m(g)}function m(g){return g===41?(e.enter("resourceMarker"),e.consume(g),e.exit("resourceMarker"),e.exit("resource"),t):n(g)}}function S5(e,t,n){const r=this;return a;function a(c){return VN.call(r,e,o,l,"reference","referenceMarker","referenceString")(c)}function o(c){return r.parser.defined.includes(Fr(r.sliceSerialize(r.events[r.events.length-1][1]).slice(1,-1)))?t(c):n(c)}function l(c){return n(c)}}function w5(e,t,n){return r;function r(o){return e.enter("reference"),e.enter("referenceMarker"),e.consume(o),e.exit("referenceMarker"),a}function a(o){return o===93?(e.enter("referenceMarker"),e.consume(o),e.exit("referenceMarker"),e.exit("reference"),t):n(o)}}const E5={name:"labelStartImage",resolveAll:ky.resolveAll,tokenize:T5};function T5(e,t,n){const r=this;return a;function a(c){return e.enter("labelImage"),e.enter("labelImageMarker"),e.consume(c),e.exit("labelImageMarker"),o}function o(c){return c===91?(e.enter("labelMarker"),e.consume(c),e.exit("labelMarker"),e.exit("labelImage"),l):n(c)}function l(c){return c===94&&"_hiddenFootnoteSupport"in r.parser.constructs?n(c):t(c)}}const k5={name:"labelStartLink",resolveAll:ky.resolveAll,tokenize:C5};function C5(e,t,n){const r=this;return a;function a(l){return e.enter("labelLink"),e.enter("labelMarker"),e.consume(l),e.exit("labelMarker"),e.exit("labelLink"),o}function o(l){return l===94&&"_hiddenFootnoteSupport"in r.parser.constructs?n(l):t(l)}}const Dm={name:"lineEnding",tokenize:A5};function A5(e,t){return n;function n(r){return e.enter("lineEnding"),e.consume(r),e.exit("lineEnding"),at(e,t,"linePrefix")}}const Hd={name:"thematicBreak",tokenize:N5};function N5(e,t,n){let r=0,a;return o;function o(f){return e.enter("thematicBreak"),l(f)}function l(f){return a=f,c(f)}function c(f){return f===a?(e.enter("thematicBreakSequence"),d(f)):r>=3&&(f===null||De(f))?(e.exit("thematicBreak"),t(f)):n(f)}function d(f){return f===a?(e.consume(f),r++,d):(e.exit("thematicBreakSequence"),Ze(f)?at(e,c,"whitespace")(f):c(f))}}const Yn={continuation:{tokenize:O5},exit:D5,name:"list",tokenize:_5},j5={partial:!0,tokenize:I5},R5={partial:!0,tokenize:M5};function _5(e,t,n){const r=this,a=r.events[r.events.length-1];let o=a&&a[1].type==="linePrefix"?a[2].sliceSerialize(a[1],!0).length:0,l=0;return c;function c(b){const S=r.containerState.type||(b===42||b===43||b===45?"listUnordered":"listOrdered");if(S==="listUnordered"?!r.containerState.marker||b===r.containerState.marker:tv(b)){if(r.containerState.type||(r.containerState.type=S,e.enter(S,{_container:!0})),S==="listUnordered")return e.enter("listItemPrefix"),b===42||b===45?e.check(Hd,n,f)(b):f(b);if(!r.interrupt||b===49)return e.enter("listItemPrefix"),e.enter("listItemValue"),d(b)}return n(b)}function d(b){return tv(b)&&++l<10?(e.consume(b),d):(!r.interrupt||l<2)&&(r.containerState.marker?b===r.containerState.marker:b===41||b===46)?(e.exit("listItemValue"),f(b)):n(b)}function f(b){return e.enter("listItemMarker"),e.consume(b),e.exit("listItemMarker"),r.containerState.marker=r.containerState.marker||b,e.check(Lu,r.interrupt?n:m,e.attempt(j5,v,g))}function m(b){return r.containerState.initialBlankLine=!0,o++,v(b)}function g(b){return Ze(b)?(e.enter("listItemPrefixWhitespace"),e.consume(b),e.exit("listItemPrefixWhitespace"),v):n(b)}function v(b){return r.containerState.size=o+r.sliceSerialize(e.exit("listItemPrefix"),!0).length,t(b)}}function O5(e,t,n){const r=this;return r.containerState._closeFlow=void 0,e.check(Lu,a,o);function a(c){return r.containerState.furtherBlankLines=r.containerState.furtherBlankLines||r.containerState.initialBlankLine,at(e,t,"listItemIndent",r.containerState.size+1)(c)}function o(c){return r.containerState.furtherBlankLines||!Ze(c)?(r.containerState.furtherBlankLines=void 0,r.containerState.initialBlankLine=void 0,l(c)):(r.containerState.furtherBlankLines=void 0,r.containerState.initialBlankLine=void 0,e.attempt(R5,t,l)(c))}function l(c){return r.containerState._closeFlow=!0,r.interrupt=void 0,at(e,e.attempt(Yn,t,n),"linePrefix",r.parser.constructs.disable.null.includes("codeIndented")?void 0:4)(c)}}function M5(e,t,n){const r=this;return at(e,a,"listItemIndent",r.containerState.size+1);function a(o){const l=r.events[r.events.length-1];return l&&l[1].type==="listItemIndent"&&l[2].sliceSerialize(l[1],!0).length===r.containerState.size?t(o):n(o)}}function D5(e){e.exit(this.containerState.type)}function I5(e,t,n){const r=this;return at(e,a,"listItemPrefixWhitespace",r.parser.constructs.disable.null.includes("codeIndented")?void 0:5);function a(o){const l=r.events[r.events.length-1];return!Ze(o)&&l&&l[1].type==="listItemPrefixWhitespace"?t(o):n(o)}}const I1={name:"setextUnderline",resolveTo:P5,tokenize:L5};function P5(e,t){let n=e.length,r,a,o;for(;n--;)if(e[n][0]==="enter"){if(e[n][1].type==="content"){r=n;break}e[n][1].type==="paragraph"&&(a=n)}else e[n][1].type==="content"&&e.splice(n,1),!o&&e[n][1].type==="definition"&&(o=n);const l={type:"setextHeading",start:{...e[r][1].start},end:{...e[e.length-1][1].end}};return e[a][1].type="setextHeadingText",o?(e.splice(a,0,["enter",l,t]),e.splice(o+1,0,["exit",e[r][1],t]),e[r][1].end={...e[o][1].end}):e[r][1]=l,e.push(["exit",l,t]),e}function L5(e,t,n){const r=this;let a;return o;function o(f){let m=r.events.length,g;for(;m--;)if(r.events[m][1].type!=="lineEnding"&&r.events[m][1].type!=="linePrefix"&&r.events[m][1].type!=="content"){g=r.events[m][1].type==="paragraph";break}return!r.parser.lazy[r.now().line]&&(r.interrupt||g)?(e.enter("setextHeadingLine"),a=f,l(f)):n(f)}function l(f){return e.enter("setextHeadingLineSequence"),c(f)}function c(f){return f===a?(e.consume(f),c):(e.exit("setextHeadingLineSequence"),Ze(f)?at(e,d,"lineSuffix")(f):d(f))}function d(f){return f===null||De(f)?(e.exit("setextHeadingLine"),t(f)):n(f)}}const z5={tokenize:U5};function U5(e){const t=this,n=e.attempt(Lu,r,e.attempt(this.parser.constructs.flowInitial,a,at(e,e.attempt(this.parser.constructs.flow,a,e.attempt(q8,a)),"linePrefix")));return n;function r(o){if(o===null){e.consume(o);return}return e.enter("lineEndingBlank"),e.consume(o),e.exit("lineEndingBlank"),t.currentConstruct=void 0,n}function a(o){if(o===null){e.consume(o);return}return e.enter("lineEnding"),e.consume(o),e.exit("lineEnding"),t.currentConstruct=void 0,n}}const B5={resolveAll:qN()},V5=HN("string"),F5=HN("text");function HN(e){return{resolveAll:qN(e==="text"?H5:void 0),tokenize:t};function t(n){const r=this,a=this.parser.constructs[e],o=n.attempt(a,l,c);return l;function l(m){return f(m)?o(m):c(m)}function c(m){if(m===null){n.consume(m);return}return n.enter("data"),n.consume(m),d}function d(m){return f(m)?(n.exit("data"),o(m)):(n.consume(m),d)}function f(m){if(m===null)return!0;const g=a[m];let v=-1;if(g)for(;++v<g.length;){const b=g[v];if(!b.previous||b.previous.call(r,r.previous))return!0}return!1}}}function qN(e){return t;function t(n,r){let a=-1,o;for(;++a<=n.length;)o===void 0?n[a]&&n[a][1].type==="data"&&(o=a,a++):(!n[a]||n[a][1].type!=="data")&&(a!==o+2&&(n[o][1].end=n[a-1][1].end,n.splice(o+2,a-o-2),a=o+2),o=void 0);return e?e(n,r):n}}function H5(e,t){let n=0;for(;++n<=e.length;)if((n===e.length||e[n][1].type==="lineEnding")&&e[n-1][1].type==="data"){const r=e[n-1][1],a=t.sliceStream(r);let o=a.length,l=-1,c=0,d;for(;o--;){const f=a[o];if(typeof f=="string"){for(l=f.length;f.charCodeAt(l-1)===32;)c++,l--;if(l)break;l=-1}else if(f===-2)d=!0,c++;else if(f!==-1){o++;break}}if(t._contentTypeTextTrailing&&n===e.length&&(c=0),c){const f={type:n===e.length||d||c<2?"lineSuffix":"hardBreakTrailing",start:{_bufferIndex:o?l:r.start._bufferIndex+l,_index:r.start._index+o,line:r.end.line,column:r.end.column-c,offset:r.end.offset-c},end:{...r.end}};r.end={...f.start},r.start.offset===r.end.offset?Object.assign(r,f):(e.splice(n,0,["enter",f,t],["exit",f,t]),n+=2)}n++}return e}const q5={42:Yn,43:Yn,45:Yn,48:Yn,49:Yn,50:Yn,51:Yn,52:Yn,53:Yn,54:Yn,55:Yn,56:Yn,57:Yn,62:PN},G5={91:W8},K5={[-2]:Mm,[-1]:Mm,32:Mm},$5={35:t5,42:Hd,45:[I1,Hd],60:a5,61:I1,95:Hd,96:M1,126:M1},Y5={38:zN,92:LN},W5={[-5]:Dm,[-4]:Dm,[-3]:Dm,33:E5,38:zN,42:nv,60:[k8,f5],91:k5,92:[Z8,LN],93:ky,95:nv,96:z8},X5={null:[nv,B5]},Q5={null:[42,95]},J5={null:[]},Z5=Object.freeze(Object.defineProperty({__proto__:null,attentionMarkers:Q5,contentInitial:G5,disable:J5,document:q5,flow:$5,flowInitial:K5,insideSpan:X5,string:Y5,text:W5},Symbol.toStringTag,{value:"Module"}));function eV(e,t,n){let r={_bufferIndex:-1,_index:0,line:n&&n.line||1,column:n&&n.column||1,offset:n&&n.offset||0};const a={},o=[];let l=[],c=[];const d={attempt:P(N),check:P(R),consume:C,enter:k,exit:j,interrupt:P(R,{interrupt:!0})},f={code:null,containerState:{},defineSkip:w,events:[],now:S,parser:e,previous:null,sliceSerialize:v,sliceStream:b,write:g};let m=t.tokenize.call(f,d);return t.resolveAll&&o.push(t),f;function g(B){return l=Cr(l,B),E(),l[l.length-1]!==null?[]:(L(t,0),f.events=Pf(o,f.events,f),f.events)}function v(B,K){return nV(b(B),K)}function b(B){return tV(l,B)}function S(){const{_bufferIndex:B,_index:K,line:se,column:ue,offset:Z}=r;return{_bufferIndex:B,_index:K,line:se,column:ue,offset:Z}}function w(B){a[B.line]=B.column,D()}function E(){let B;for(;r._index<l.length;){const K=l[r._index];if(typeof K=="string")for(B=r._index,r._bufferIndex<0&&(r._bufferIndex=0);r._index===B&&r._bufferIndex<K.length;)T(K.charCodeAt(r._bufferIndex));else T(K)}}function T(B){m=m(B)}function C(B){De(B)?(r.line++,r.column=1,r.offset+=B===-3?2:1,D()):B!==-1&&(r.column++,r.offset++),r._bufferIndex<0?r._index++:(r._bufferIndex++,r._bufferIndex===l[r._index].length&&(r._bufferIndex=-1,r._index++)),f.previous=B}function k(B,K){const se=K||{};return se.type=B,se.start=S(),f.events.push(["enter",se,f]),c.push(se),se}function j(B){const K=c.pop();return K.end=S(),f.events.push(["exit",K,f]),K}function N(B,K){L(B,K.from)}function R(B,K){K.restore()}function P(B,K){return se;function se(ue,Z,V){let X,le,ye,M;return Array.isArray(ue)?W(ue):"tokenize"in ue?W([ue]):z(ue);function z(Se){return we;function we(Pe){const je=Pe!==null&&Se[Pe],ve=Pe!==null&&Se.null,Le=[...Array.isArray(je)?je:je?[je]:[],...Array.isArray(ve)?ve:ve?[ve]:[]];return W(Le)(Pe)}}function W(Se){return X=Se,le=0,Se.length===0?V:I(Se[le])}function I(Se){return we;function we(Pe){return M=H(),ye=Se,Se.partial||(f.currentConstruct=Se),Se.name&&f.parser.constructs.disable.null.includes(Se.name)?ge():Se.tokenize.call(K?Object.assign(Object.create(f),K):f,d,fe,ge)(Pe)}}function fe(Se){return B(ye,M),Z}function ge(Se){return M.restore(),++le<X.length?I(X[le]):V}}}function L(B,K){B.resolveAll&&!o.includes(B)&&o.push(B),B.resolve&&or(f.events,K,f.events.length-K,B.resolve(f.events.slice(K),f)),B.resolveTo&&(f.events=B.resolveTo(f.events,f))}function H(){const B=S(),K=f.previous,se=f.currentConstruct,ue=f.events.length,Z=Array.from(c);return{from:ue,restore:V};function V(){r=B,f.previous=K,f.currentConstruct=se,f.events.length=ue,c=Z,D()}}function D(){r.line in a&&r.column<2&&(r.column=a[r.line],r.offset+=a[r.line]-1)}}function tV(e,t){const n=t.start._index,r=t.start._bufferIndex,a=t.end._index,o=t.end._bufferIndex;let l;if(n===a)l=[e[n].slice(r,o)];else{if(l=e.slice(n,a),r>-1){const c=l[0];typeof c=="string"?l[0]=c.slice(r):l.shift()}o>0&&l.push(e[a].slice(0,o))}return l}function nV(e,t){let n=-1;const r=[];let a;for(;++n<e.length;){const o=e[n];let l;if(typeof o=="string")l=o;else switch(o){case-5:{l="\r";break}case-4:{l=`
25
+ `;break}case-3:{l=`\r
26
+ `;break}case-2:{l=t?" ":" ";break}case-1:{if(!t&&a)continue;l=" ";break}default:l=String.fromCharCode(o)}a=o===-2,r.push(l)}return r.join("")}function rV(e){const r={constructs:DN([Z5,...(e||{}).extensions||[]]),content:a(y8),defined:[],document:a(x8),flow:a(z5),lazy:{},string:a(V5),text:a(F5)};return r;function a(o){return l;function l(c){return eV(r,o,c)}}}function iV(e){for(;!UN(e););return e}const P1=/[\0\t\n\r]/g;function aV(){let e=1,t="",n=!0,r;return a;function a(o,l,c){const d=[];let f,m,g,v,b;for(o=t+(typeof o=="string"?o.toString():new TextDecoder(l||void 0).decode(o)),g=0,t="",n&&(o.charCodeAt(0)===65279&&g++,n=void 0);g<o.length;){if(P1.lastIndex=g,f=P1.exec(o),v=f&&f.index!==void 0?f.index:o.length,b=o.charCodeAt(v),!f){t=o.slice(g);break}if(b===10&&g===v&&r)d.push(-3),r=void 0;else switch(r&&(d.push(-5),r=void 0),g<v&&(d.push(o.slice(g,v)),e+=v-g),b){case 0:{d.push(65533),e++;break}case 9:{for(m=Math.ceil(e/4)*4,d.push(-2);e++<m;)d.push(-1);break}case 10:{d.push(-4),e=1;break}default:r=!0,e=1}g=v+1}return c&&(r&&d.push(-5),t&&d.push(t),d.push(null)),d}}const sV=/\\([!-/:-@[-`{-~])|&(#(?:\d{1,7}|x[\da-f]{1,6})|[\da-z]{1,31});/gi;function oV(e){return e.replace(sV,lV)}function lV(e,t,n){if(t)return t;if(n.charCodeAt(0)===35){const a=n.charCodeAt(1),o=a===120||a===88;return IN(n.slice(o?2:1),o?16:10)}return Ty(n)||e}const GN={}.hasOwnProperty;function uV(e,t,n){return t&&typeof t=="object"&&(n=t,t=void 0),cV(n)(iV(rV(n).document().write(aV()(e,t,!0))))}function cV(e){const t={transforms:[],canContainEols:["emphasis","fragment","heading","paragraph","strong"],enter:{autolink:o(Jt),autolinkProtocol:H,autolinkEmail:H,atxHeading:o(Nt),blockQuote:o(ve),characterEscape:H,characterReference:H,codeFenced:o(Le),codeFencedFenceInfo:l,codeFencedFenceMeta:l,codeIndented:o(Le,l),codeText:o(xt,l),codeTextData:H,data:H,codeFlowValue:H,definition:o(Ot),definitionDestinationString:l,definitionLabelString:l,definitionTitleString:l,emphasis:o(We),hardBreakEscape:o(lt),hardBreakTrailing:o(lt),htmlFlow:o(Bt,l),htmlFlowData:H,htmlText:o(Bt,l),htmlTextData:H,image:o($t),label:l,link:o(Jt),listItem:o(st),listItemValue:v,listOrdered:o(mt,g),listUnordered:o(mt),paragraph:o(Mn),reference:I,referenceString:l,resourceDestinationString:l,resourceTitleString:l,setextHeading:o(Nt),strong:o(Ue),thematicBreak:o(Q)},exit:{atxHeading:d(),atxHeadingSequence:N,autolink:d(),autolinkEmail:je,autolinkProtocol:Pe,blockQuote:d(),characterEscapeValue:D,characterReferenceMarkerHexadecimal:ge,characterReferenceMarkerNumeric:ge,characterReferenceValue:Se,characterReference:we,codeFenced:d(E),codeFencedFence:w,codeFencedFenceInfo:b,codeFencedFenceMeta:S,codeFlowValue:D,codeIndented:d(T),codeText:d(Z),codeTextData:D,data:D,definition:d(),definitionDestinationString:j,definitionLabelString:C,definitionTitleString:k,emphasis:d(),hardBreakEscape:d(K),hardBreakTrailing:d(K),htmlFlow:d(se),htmlFlowData:D,htmlText:d(ue),htmlTextData:D,image:d(X),label:ye,labelText:le,lineEnding:B,link:d(V),listItem:d(),listOrdered:d(),listUnordered:d(),paragraph:d(),referenceString:fe,resourceDestinationString:M,resourceTitleString:z,resource:W,setextHeading:d(L),setextHeadingLineSequence:P,setextHeadingText:R,strong:d(),thematicBreak:d()}};KN(t,(e||{}).mdastExtensions||[]);const n={};return r;function r(q){let ae={type:"root",children:[]};const Te={stack:[ae],tokenStack:[],config:t,enter:c,exit:f,buffer:l,resume:m,data:n},Ee=[];let Be=-1;for(;++Be<q.length;)if(q[Be][1].type==="listOrdered"||q[Be][1].type==="listUnordered")if(q[Be][0]==="enter")Ee.push(Be);else{const ut=Ee.pop();Be=a(q,ut,Be)}for(Be=-1;++Be<q.length;){const ut=t[q[Be][0]];GN.call(ut,q[Be][1].type)&&ut[q[Be][1].type].call(Object.assign({sliceSerialize:q[Be][2].sliceSerialize},Te),q[Be][1])}if(Te.tokenStack.length>0){const ut=Te.tokenStack[Te.tokenStack.length-1];(ut[1]||L1).call(Te,void 0,ut[0])}for(ae.position={start:pa(q.length>0?q[0][1].start:{line:1,column:1,offset:0}),end:pa(q.length>0?q[q.length-2][1].end:{line:1,column:1,offset:0})},Be=-1;++Be<t.transforms.length;)ae=t.transforms[Be](ae)||ae;return ae}function a(q,ae,Te){let Ee=ae-1,Be=-1,ut=!1,Yt,gt,Lt,U;for(;++Ee<=Te;){const Y=q[Ee];switch(Y[1].type){case"listUnordered":case"listOrdered":case"blockQuote":{Y[0]==="enter"?Be++:Be--,U=void 0;break}case"lineEndingBlank":{Y[0]==="enter"&&(Yt&&!U&&!Be&&!Lt&&(Lt=Ee),U=void 0);break}case"linePrefix":case"listItemValue":case"listItemMarker":case"listItemPrefix":case"listItemPrefixWhitespace":break;default:U=void 0}if(!Be&&Y[0]==="enter"&&Y[1].type==="listItemPrefix"||Be===-1&&Y[0]==="exit"&&(Y[1].type==="listUnordered"||Y[1].type==="listOrdered")){if(Yt){let xe=Ee;for(gt=void 0;xe--;){const Ge=q[xe];if(Ge[1].type==="lineEnding"||Ge[1].type==="lineEndingBlank"){if(Ge[0]==="exit")continue;gt&&(q[gt][1].type="lineEndingBlank",ut=!0),Ge[1].type="lineEnding",gt=xe}else if(!(Ge[1].type==="linePrefix"||Ge[1].type==="blockQuotePrefix"||Ge[1].type==="blockQuotePrefixWhitespace"||Ge[1].type==="blockQuoteMarker"||Ge[1].type==="listItemIndent"))break}Lt&&(!gt||Lt<gt)&&(Yt._spread=!0),Yt.end=Object.assign({},gt?q[gt][1].start:Y[1].end),q.splice(gt||Ee,0,["exit",Yt,Y[2]]),Ee++,Te++}if(Y[1].type==="listItemPrefix"){const xe={type:"listItem",_spread:!1,start:Object.assign({},Y[1].start),end:void 0};Yt=xe,q.splice(Ee,0,["enter",xe,Y[2]]),Ee++,Te++,Lt=void 0,U=!0}}}return q[ae][1]._spread=ut,Te}function o(q,ae){return Te;function Te(Ee){c.call(this,q(Ee),Ee),ae&&ae.call(this,Ee)}}function l(){this.stack.push({type:"fragment",children:[]})}function c(q,ae,Te){this.stack[this.stack.length-1].children.push(q),this.stack.push(q),this.tokenStack.push([ae,Te||void 0]),q.position={start:pa(ae.start),end:void 0}}function d(q){return ae;function ae(Te){q&&q.call(this,Te),f.call(this,Te)}}function f(q,ae){const Te=this.stack.pop(),Ee=this.tokenStack.pop();if(Ee)Ee[0].type!==q.type&&(ae?ae.call(this,q,Ee[0]):(Ee[1]||L1).call(this,q,Ee[0]));else throw new Error("Cannot close `"+q.type+"` ("+cu({start:q.start,end:q.end})+"): it’s not open");Te.position.end=pa(q.end)}function m(){return Ey(this.stack.pop())}function g(){this.data.expectingFirstListItemValue=!0}function v(q){if(this.data.expectingFirstListItemValue){const ae=this.stack[this.stack.length-2];ae.start=Number.parseInt(this.sliceSerialize(q),10),this.data.expectingFirstListItemValue=void 0}}function b(){const q=this.resume(),ae=this.stack[this.stack.length-1];ae.lang=q}function S(){const q=this.resume(),ae=this.stack[this.stack.length-1];ae.meta=q}function w(){this.data.flowCodeInside||(this.buffer(),this.data.flowCodeInside=!0)}function E(){const q=this.resume(),ae=this.stack[this.stack.length-1];ae.value=q.replace(/^(\r?\n|\r)|(\r?\n|\r)$/g,""),this.data.flowCodeInside=void 0}function T(){const q=this.resume(),ae=this.stack[this.stack.length-1];ae.value=q.replace(/(\r?\n|\r)$/g,"")}function C(q){const ae=this.resume(),Te=this.stack[this.stack.length-1];Te.label=ae,Te.identifier=Fr(this.sliceSerialize(q)).toLowerCase()}function k(){const q=this.resume(),ae=this.stack[this.stack.length-1];ae.title=q}function j(){const q=this.resume(),ae=this.stack[this.stack.length-1];ae.url=q}function N(q){const ae=this.stack[this.stack.length-1];if(!ae.depth){const Te=this.sliceSerialize(q).length;ae.depth=Te}}function R(){this.data.setextHeadingSlurpLineEnding=!0}function P(q){const ae=this.stack[this.stack.length-1];ae.depth=this.sliceSerialize(q).codePointAt(0)===61?1:2}function L(){this.data.setextHeadingSlurpLineEnding=void 0}function H(q){const Te=this.stack[this.stack.length-1].children;let Ee=Te[Te.length-1];(!Ee||Ee.type!=="text")&&(Ee=Me(),Ee.position={start:pa(q.start),end:void 0},Te.push(Ee)),this.stack.push(Ee)}function D(q){const ae=this.stack.pop();ae.value+=this.sliceSerialize(q),ae.position.end=pa(q.end)}function B(q){const ae=this.stack[this.stack.length-1];if(this.data.atHardBreak){const Te=ae.children[ae.children.length-1];Te.position.end=pa(q.end),this.data.atHardBreak=void 0;return}!this.data.setextHeadingSlurpLineEnding&&t.canContainEols.includes(ae.type)&&(H.call(this,q),D.call(this,q))}function K(){this.data.atHardBreak=!0}function se(){const q=this.resume(),ae=this.stack[this.stack.length-1];ae.value=q}function ue(){const q=this.resume(),ae=this.stack[this.stack.length-1];ae.value=q}function Z(){const q=this.resume(),ae=this.stack[this.stack.length-1];ae.value=q}function V(){const q=this.stack[this.stack.length-1];if(this.data.inReference){const ae=this.data.referenceType||"shortcut";q.type+="Reference",q.referenceType=ae,delete q.url,delete q.title}else delete q.identifier,delete q.label;this.data.referenceType=void 0}function X(){const q=this.stack[this.stack.length-1];if(this.data.inReference){const ae=this.data.referenceType||"shortcut";q.type+="Reference",q.referenceType=ae,delete q.url,delete q.title}else delete q.identifier,delete q.label;this.data.referenceType=void 0}function le(q){const ae=this.sliceSerialize(q),Te=this.stack[this.stack.length-2];Te.label=oV(ae),Te.identifier=Fr(ae).toLowerCase()}function ye(){const q=this.stack[this.stack.length-1],ae=this.resume(),Te=this.stack[this.stack.length-1];if(this.data.inReference=!0,Te.type==="link"){const Ee=q.children;Te.children=Ee}else Te.alt=ae}function M(){const q=this.resume(),ae=this.stack[this.stack.length-1];ae.url=q}function z(){const q=this.resume(),ae=this.stack[this.stack.length-1];ae.title=q}function W(){this.data.inReference=void 0}function I(){this.data.referenceType="collapsed"}function fe(q){const ae=this.resume(),Te=this.stack[this.stack.length-1];Te.label=ae,Te.identifier=Fr(this.sliceSerialize(q)).toLowerCase(),this.data.referenceType="full"}function ge(q){this.data.characterReferenceType=q.type}function Se(q){const ae=this.sliceSerialize(q),Te=this.data.characterReferenceType;let Ee;Te?(Ee=IN(ae,Te==="characterReferenceMarkerNumeric"?10:16),this.data.characterReferenceType=void 0):Ee=Ty(ae);const Be=this.stack[this.stack.length-1];Be.value+=Ee}function we(q){const ae=this.stack.pop();ae.position.end=pa(q.end)}function Pe(q){D.call(this,q);const ae=this.stack[this.stack.length-1];ae.url=this.sliceSerialize(q)}function je(q){D.call(this,q);const ae=this.stack[this.stack.length-1];ae.url="mailto:"+this.sliceSerialize(q)}function ve(){return{type:"blockquote",children:[]}}function Le(){return{type:"code",lang:null,meta:null,value:""}}function xt(){return{type:"inlineCode",value:""}}function Ot(){return{type:"definition",identifier:"",label:null,title:null,url:""}}function We(){return{type:"emphasis",children:[]}}function Nt(){return{type:"heading",depth:0,children:[]}}function lt(){return{type:"break"}}function Bt(){return{type:"html",value:""}}function $t(){return{type:"image",title:null,url:"",alt:null}}function Jt(){return{type:"link",title:null,url:"",children:[]}}function mt(q){return{type:"list",ordered:q.type==="listOrdered",start:null,spread:q._spread,children:[]}}function st(q){return{type:"listItem",spread:q._spread,checked:null,children:[]}}function Mn(){return{type:"paragraph",children:[]}}function Ue(){return{type:"strong",children:[]}}function Me(){return{type:"text",value:""}}function Q(){return{type:"thematicBreak"}}}function pa(e){return{line:e.line,column:e.column,offset:e.offset}}function KN(e,t){let n=-1;for(;++n<t.length;){const r=t[n];Array.isArray(r)?KN(e,r):dV(e,r)}}function dV(e,t){let n;for(n in t)if(GN.call(t,n))switch(n){case"canContainEols":{const r=t[n];r&&e[n].push(...r);break}case"transforms":{const r=t[n];r&&e[n].push(...r);break}case"enter":case"exit":{const r=t[n];r&&Object.assign(e[n],r);break}}}function L1(e,t){throw e?new Error("Cannot close `"+e.type+"` ("+cu({start:e.start,end:e.end})+"): a different token (`"+t.type+"`, "+cu({start:t.start,end:t.end})+") is open"):new Error("Cannot close document, a token (`"+t.type+"`, "+cu({start:t.start,end:t.end})+") is still open")}function fV(e){const t=this;t.parser=n;function n(r){return uV(r,{...t.data("settings"),...e,extensions:t.data("micromarkExtensions")||[],mdastExtensions:t.data("fromMarkdownExtensions")||[]})}}function hV(e,t){const n={type:"element",tagName:"blockquote",properties:{},children:e.wrap(e.all(t),!0)};return e.patch(t,n),e.applyData(t,n)}function pV(e,t){const n={type:"element",tagName:"br",properties:{},children:[]};return e.patch(t,n),[e.applyData(t,n),{type:"text",value:`
27
+ `}]}function mV(e,t){const n=t.value?t.value+`
28
+ `:"",r={},a=t.lang?t.lang.split(/\s+/):[];a.length>0&&(r.className=["language-"+a[0]]);let o={type:"element",tagName:"code",properties:r,children:[{type:"text",value:n}]};return t.meta&&(o.data={meta:t.meta}),e.patch(t,o),o=e.applyData(t,o),o={type:"element",tagName:"pre",properties:{},children:[o]},e.patch(t,o),o}function gV(e,t){const n={type:"element",tagName:"del",properties:{},children:e.all(t)};return e.patch(t,n),e.applyData(t,n)}function vV(e,t){const n={type:"element",tagName:"em",properties:{},children:e.all(t)};return e.patch(t,n),e.applyData(t,n)}function yV(e,t){const n=typeof e.options.clobberPrefix=="string"?e.options.clobberPrefix:"user-content-",r=String(t.identifier).toUpperCase(),a=Lo(r.toLowerCase()),o=e.footnoteOrder.indexOf(r);let l,c=e.footnoteCounts.get(r);c===void 0?(c=0,e.footnoteOrder.push(r),l=e.footnoteOrder.length):l=o+1,c+=1,e.footnoteCounts.set(r,c);const d={type:"element",tagName:"a",properties:{href:"#"+n+"fn-"+a,id:n+"fnref-"+a+(c>1?"-"+c:""),dataFootnoteRef:!0,ariaDescribedBy:["footnote-label"]},children:[{type:"text",value:String(l)}]};e.patch(t,d);const f={type:"element",tagName:"sup",properties:{},children:[d]};return e.patch(t,f),e.applyData(t,f)}function bV(e,t){const n={type:"element",tagName:"h"+t.depth,properties:{},children:e.all(t)};return e.patch(t,n),e.applyData(t,n)}function xV(e,t){if(e.options.allowDangerousHtml){const n={type:"raw",value:t.value};return e.patch(t,n),e.applyData(t,n)}}function $N(e,t){const n=t.referenceType;let r="]";if(n==="collapsed"?r+="[]":n==="full"&&(r+="["+(t.label||t.identifier)+"]"),t.type==="imageReference")return[{type:"text",value:"!["+t.alt+r}];const a=e.all(t),o=a[0];o&&o.type==="text"?o.value="["+o.value:a.unshift({type:"text",value:"["});const l=a[a.length-1];return l&&l.type==="text"?l.value+=r:a.push({type:"text",value:r}),a}function SV(e,t){const n=String(t.identifier).toUpperCase(),r=e.definitionById.get(n);if(!r)return $N(e,t);const a={src:Lo(r.url||""),alt:t.alt};r.title!==null&&r.title!==void 0&&(a.title=r.title);const o={type:"element",tagName:"img",properties:a,children:[]};return e.patch(t,o),e.applyData(t,o)}function wV(e,t){const n={src:Lo(t.url)};t.alt!==null&&t.alt!==void 0&&(n.alt=t.alt),t.title!==null&&t.title!==void 0&&(n.title=t.title);const r={type:"element",tagName:"img",properties:n,children:[]};return e.patch(t,r),e.applyData(t,r)}function EV(e,t){const n={type:"text",value:t.value.replace(/\r?\n|\r/g," ")};e.patch(t,n);const r={type:"element",tagName:"code",properties:{},children:[n]};return e.patch(t,r),e.applyData(t,r)}function TV(e,t){const n=String(t.identifier).toUpperCase(),r=e.definitionById.get(n);if(!r)return $N(e,t);const a={href:Lo(r.url||"")};r.title!==null&&r.title!==void 0&&(a.title=r.title);const o={type:"element",tagName:"a",properties:a,children:e.all(t)};return e.patch(t,o),e.applyData(t,o)}function kV(e,t){const n={href:Lo(t.url)};t.title!==null&&t.title!==void 0&&(n.title=t.title);const r={type:"element",tagName:"a",properties:n,children:e.all(t)};return e.patch(t,r),e.applyData(t,r)}function CV(e,t,n){const r=e.all(t),a=n?AV(n):YN(t),o={},l=[];if(typeof t.checked=="boolean"){const m=r[0];let g;m&&m.type==="element"&&m.tagName==="p"?g=m:(g={type:"element",tagName:"p",properties:{},children:[]},r.unshift(g)),g.children.length>0&&g.children.unshift({type:"text",value:" "}),g.children.unshift({type:"element",tagName:"input",properties:{type:"checkbox",checked:t.checked,disabled:!0},children:[]}),o.className=["task-list-item"]}let c=-1;for(;++c<r.length;){const m=r[c];(a||c!==0||m.type!=="element"||m.tagName!=="p")&&l.push({type:"text",value:`
29
+ `}),m.type==="element"&&m.tagName==="p"&&!a?l.push(...m.children):l.push(m)}const d=r[r.length-1];d&&(a||d.type!=="element"||d.tagName!=="p")&&l.push({type:"text",value:`
30
+ `});const f={type:"element",tagName:"li",properties:o,children:l};return e.patch(t,f),e.applyData(t,f)}function AV(e){let t=!1;if(e.type==="list"){t=e.spread||!1;const n=e.children;let r=-1;for(;!t&&++r<n.length;)t=YN(n[r])}return t}function YN(e){const t=e.spread;return t??e.children.length>1}function NV(e,t){const n={},r=e.all(t);let a=-1;for(typeof t.start=="number"&&t.start!==1&&(n.start=t.start);++a<r.length;){const l=r[a];if(l.type==="element"&&l.tagName==="li"&&l.properties&&Array.isArray(l.properties.className)&&l.properties.className.includes("task-list-item")){n.className=["contains-task-list"];break}}const o={type:"element",tagName:t.ordered?"ol":"ul",properties:n,children:e.wrap(r,!0)};return e.patch(t,o),e.applyData(t,o)}function jV(e,t){const n={type:"element",tagName:"p",properties:{},children:e.all(t)};return e.patch(t,n),e.applyData(t,n)}function RV(e,t){const n={type:"root",children:e.wrap(e.all(t))};return e.patch(t,n),e.applyData(t,n)}function _V(e,t){const n={type:"element",tagName:"strong",properties:{},children:e.all(t)};return e.patch(t,n),e.applyData(t,n)}function OV(e,t){const n=e.all(t),r=n.shift(),a=[];if(r){const l={type:"element",tagName:"thead",properties:{},children:e.wrap([r],!0)};e.patch(t.children[0],l),a.push(l)}if(n.length>0){const l={type:"element",tagName:"tbody",properties:{},children:e.wrap(n,!0)},c=by(t.children[1]),d=AN(t.children[t.children.length-1]);c&&d&&(l.position={start:c,end:d}),a.push(l)}const o={type:"element",tagName:"table",properties:{},children:e.wrap(a,!0)};return e.patch(t,o),e.applyData(t,o)}function MV(e,t,n){const r=n?n.children:void 0,o=(r?r.indexOf(t):1)===0?"th":"td",l=n&&n.type==="table"?n.align:void 0,c=l?l.length:t.children.length;let d=-1;const f=[];for(;++d<c;){const g=t.children[d],v={},b=l?l[d]:void 0;b&&(v.align=b);let S={type:"element",tagName:o,properties:v,children:[]};g&&(S.children=e.all(g),e.patch(g,S),S=e.applyData(g,S)),f.push(S)}const m={type:"element",tagName:"tr",properties:{},children:e.wrap(f,!0)};return e.patch(t,m),e.applyData(t,m)}function DV(e,t){const n={type:"element",tagName:"td",properties:{},children:e.all(t)};return e.patch(t,n),e.applyData(t,n)}const z1=9,U1=32;function IV(e){const t=String(e),n=/\r?\n|\r/g;let r=n.exec(t),a=0;const o=[];for(;r;)o.push(B1(t.slice(a,r.index),a>0,!0),r[0]),a=r.index+r[0].length,r=n.exec(t);return o.push(B1(t.slice(a),a>0,!1)),o.join("")}function B1(e,t,n){let r=0,a=e.length;if(t){let o=e.codePointAt(r);for(;o===z1||o===U1;)r++,o=e.codePointAt(r)}if(n){let o=e.codePointAt(a-1);for(;o===z1||o===U1;)a--,o=e.codePointAt(a-1)}return a>r?e.slice(r,a):""}function PV(e,t){const n={type:"text",value:IV(String(t.value))};return e.patch(t,n),e.applyData(t,n)}function LV(e,t){const n={type:"element",tagName:"hr",properties:{},children:[]};return e.patch(t,n),e.applyData(t,n)}const zV={blockquote:hV,break:pV,code:mV,delete:gV,emphasis:vV,footnoteReference:yV,heading:bV,html:xV,imageReference:SV,image:wV,inlineCode:EV,linkReference:TV,link:kV,listItem:CV,list:NV,paragraph:jV,root:RV,strong:_V,table:OV,tableCell:DV,tableRow:MV,text:PV,thematicBreak:LV,toml:bd,yaml:bd,definition:bd,footnoteDefinition:bd};function bd(){}const WN=-1,Lf=0,fu=1,uf=2,Cy=3,Ay=4,Ny=5,jy=6,XN=7,QN=8,V1=typeof self=="object"?self:globalThis,UV=(e,t)=>{const n=(a,o)=>(e.set(o,a),a),r=a=>{if(e.has(a))return e.get(a);const[o,l]=t[a];switch(o){case Lf:case WN:return n(l,a);case fu:{const c=n([],a);for(const d of l)c.push(r(d));return c}case uf:{const c=n({},a);for(const[d,f]of l)c[r(d)]=r(f);return c}case Cy:return n(new Date(l),a);case Ay:{const{source:c,flags:d}=l;return n(new RegExp(c,d),a)}case Ny:{const c=n(new Map,a);for(const[d,f]of l)c.set(r(d),r(f));return c}case jy:{const c=n(new Set,a);for(const d of l)c.add(r(d));return c}case XN:{const{name:c,message:d}=l;return n(new V1[c](d),a)}case QN:return n(BigInt(l),a);case"BigInt":return n(Object(BigInt(l)),a);case"ArrayBuffer":return n(new Uint8Array(l).buffer,l);case"DataView":{const{buffer:c}=new Uint8Array(l);return n(new DataView(c),l)}}return n(new V1[o](l),a)};return r},F1=e=>UV(new Map,e)(0),io="",{toString:BV}={},{keys:VV}=Object,$l=e=>{const t=typeof e;if(t!=="object"||!e)return[Lf,t];const n=BV.call(e).slice(8,-1);switch(n){case"Array":return[fu,io];case"Object":return[uf,io];case"Date":return[Cy,io];case"RegExp":return[Ay,io];case"Map":return[Ny,io];case"Set":return[jy,io];case"DataView":return[fu,n]}return n.includes("Array")?[fu,n]:n.includes("Error")?[XN,n]:[uf,n]},xd=([e,t])=>e===Lf&&(t==="function"||t==="symbol"),FV=(e,t,n,r)=>{const a=(l,c)=>{const d=r.push(l)-1;return n.set(c,d),d},o=l=>{if(n.has(l))return n.get(l);let[c,d]=$l(l);switch(c){case Lf:{let m=l;switch(d){case"bigint":c=QN,m=l.toString();break;case"function":case"symbol":if(e)throw new TypeError("unable to serialize "+d);m=null;break;case"undefined":return a([WN],l)}return a([c,m],l)}case fu:{if(d){let v=l;return d==="DataView"?v=new Uint8Array(l.buffer):d==="ArrayBuffer"&&(v=new Uint8Array(l)),a([d,[...v]],l)}const m=[],g=a([c,m],l);for(const v of l)m.push(o(v));return g}case uf:{if(d)switch(d){case"BigInt":return a([d,l.toString()],l);case"Boolean":case"Number":case"String":return a([d,l.valueOf()],l)}if(t&&"toJSON"in l)return o(l.toJSON());const m=[],g=a([c,m],l);for(const v of VV(l))(e||!xd($l(l[v])))&&m.push([o(v),o(l[v])]);return g}case Cy:return a([c,l.toISOString()],l);case Ay:{const{source:m,flags:g}=l;return a([c,{source:m,flags:g}],l)}case Ny:{const m=[],g=a([c,m],l);for(const[v,b]of l)(e||!(xd($l(v))||xd($l(b))))&&m.push([o(v),o(b)]);return g}case jy:{const m=[],g=a([c,m],l);for(const v of l)(e||!xd($l(v)))&&m.push(o(v));return g}}const{message:f}=l;return a([c,{name:d,message:f}],l)};return o},H1=(e,{json:t,lossy:n}={})=>{const r=[];return FV(!(t||n),!!t,new Map,r)(e),r},cf=typeof structuredClone=="function"?(e,t)=>t&&("json"in t||"lossy"in t)?F1(H1(e,t)):structuredClone(e):(e,t)=>F1(H1(e,t));function HV(e,t){const n=[{type:"text",value:"↩"}];return t>1&&n.push({type:"element",tagName:"sup",properties:{},children:[{type:"text",value:String(t)}]}),n}function qV(e,t){return"Back to reference "+(e+1)+(t>1?"-"+t:"")}function GV(e){const t=typeof e.options.clobberPrefix=="string"?e.options.clobberPrefix:"user-content-",n=e.options.footnoteBackContent||HV,r=e.options.footnoteBackLabel||qV,a=e.options.footnoteLabel||"Footnotes",o=e.options.footnoteLabelTagName||"h2",l=e.options.footnoteLabelProperties||{className:["sr-only"]},c=[];let d=-1;for(;++d<e.footnoteOrder.length;){const f=e.footnoteById.get(e.footnoteOrder[d]);if(!f)continue;const m=e.all(f),g=String(f.identifier).toUpperCase(),v=Lo(g.toLowerCase());let b=0;const S=[],w=e.footnoteCounts.get(g);for(;w!==void 0&&++b<=w;){S.length>0&&S.push({type:"text",value:" "});let C=typeof n=="string"?n:n(d,b);typeof C=="string"&&(C={type:"text",value:C}),S.push({type:"element",tagName:"a",properties:{href:"#"+t+"fnref-"+v+(b>1?"-"+b:""),dataFootnoteBackref:"",ariaLabel:typeof r=="string"?r:r(d,b),className:["data-footnote-backref"]},children:Array.isArray(C)?C:[C]})}const E=m[m.length-1];if(E&&E.type==="element"&&E.tagName==="p"){const C=E.children[E.children.length-1];C&&C.type==="text"?C.value+=" ":E.children.push({type:"text",value:" "}),E.children.push(...S)}else m.push(...S);const T={type:"element",tagName:"li",properties:{id:t+"fn-"+v},children:e.wrap(m,!0)};e.patch(f,T),c.push(T)}if(c.length!==0)return{type:"element",tagName:"section",properties:{dataFootnotes:!0,className:["footnotes"]},children:[{type:"element",tagName:o,properties:{...cf(l),id:"footnote-label"},children:[{type:"text",value:a}]},{type:"text",value:`
31
+ `},{type:"element",tagName:"ol",properties:{},children:e.wrap(c,!0)},{type:"text",value:`
32
+ `}]}}const zf=(function(e){if(e==null)return WV;if(typeof e=="function")return Uf(e);if(typeof e=="object")return Array.isArray(e)?KV(e):$V(e);if(typeof e=="string")return YV(e);throw new Error("Expected function, string, or object as test")});function KV(e){const t=[];let n=-1;for(;++n<e.length;)t[n]=zf(e[n]);return Uf(r);function r(...a){let o=-1;for(;++o<t.length;)if(t[o].apply(this,a))return!0;return!1}}function $V(e){const t=e;return Uf(n);function n(r){const a=r;let o;for(o in e)if(a[o]!==t[o])return!1;return!0}}function YV(e){return Uf(t);function t(n){return n&&n.type===e}}function Uf(e){return t;function t(n,r,a){return!!(XV(n)&&e.call(this,n,typeof r=="number"?r:void 0,a||void 0))}}function WV(){return!0}function XV(e){return e!==null&&typeof e=="object"&&"type"in e}const JN=[],QV=!0,rv=!1,JV="skip";function ZN(e,t,n,r){let a;typeof t=="function"&&typeof n!="function"?(r=n,n=t):a=t;const o=zf(a),l=r?-1:1;c(e,void 0,[])();function c(d,f,m){const g=d&&typeof d=="object"?d:{};if(typeof g.type=="string"){const b=typeof g.tagName=="string"?g.tagName:typeof g.name=="string"?g.name:void 0;Object.defineProperty(v,"name",{value:"node ("+(d.type+(b?"<"+b+">":""))+")"})}return v;function v(){let b=JN,S,w,E;if((!t||o(d,f,m[m.length-1]||void 0))&&(b=ZV(n(d,m)),b[0]===rv))return b;if("children"in d&&d.children){const T=d;if(T.children&&b[0]!==JV)for(w=(r?T.children.length:-1)+l,E=m.concat(T);w>-1&&w<T.children.length;){const C=T.children[w];if(S=c(C,w,E)(),S[0]===rv)return S;w=typeof S[1]=="number"?S[1]:w+l}}return b}}}function ZV(e){return Array.isArray(e)?e:typeof e=="number"?[QV,e]:e==null?JN:[e]}function Ry(e,t,n,r){let a,o,l;typeof t=="function"&&typeof n!="function"?(o=void 0,l=t,a=n):(o=t,l=n,a=r),ZN(e,o,c,a);function c(d,f){const m=f[f.length-1],g=m?m.children.indexOf(d):void 0;return l(d,g,m)}}const iv={}.hasOwnProperty,eF={};function tF(e,t){const n=t||eF,r=new Map,a=new Map,o=new Map,l={...zV,...n.handlers},c={all:f,applyData:rF,definitionById:r,footnoteById:a,footnoteCounts:o,footnoteOrder:[],handlers:l,one:d,options:n,patch:nF,wrap:aF};return Ry(e,function(m){if(m.type==="definition"||m.type==="footnoteDefinition"){const g=m.type==="definition"?r:a,v=String(m.identifier).toUpperCase();g.has(v)||g.set(v,m)}}),c;function d(m,g){const v=m.type,b=c.handlers[v];if(iv.call(c.handlers,v)&&b)return b(c,m,g);if(c.options.passThrough&&c.options.passThrough.includes(v)){if("children"in m){const{children:w,...E}=m,T=cf(E);return T.children=c.all(m),T}return cf(m)}return(c.options.unknownHandler||iF)(c,m,g)}function f(m){const g=[];if("children"in m){const v=m.children;let b=-1;for(;++b<v.length;){const S=c.one(v[b],m);if(S){if(b&&v[b-1].type==="break"&&(!Array.isArray(S)&&S.type==="text"&&(S.value=q1(S.value)),!Array.isArray(S)&&S.type==="element")){const w=S.children[0];w&&w.type==="text"&&(w.value=q1(w.value))}Array.isArray(S)?g.push(...S):g.push(S)}}}return g}}function nF(e,t){e.position&&(t.position=qB(e))}function rF(e,t){let n=t;if(e&&e.data){const r=e.data.hName,a=e.data.hChildren,o=e.data.hProperties;if(typeof r=="string")if(n.type==="element")n.tagName=r;else{const l="children"in n?n.children:[n];n={type:"element",tagName:r,properties:{},children:l}}n.type==="element"&&o&&Object.assign(n.properties,cf(o)),"children"in n&&n.children&&a!==null&&a!==void 0&&(n.children=a)}return n}function iF(e,t){const n=t.data||{},r="value"in t&&!(iv.call(n,"hProperties")||iv.call(n,"hChildren"))?{type:"text",value:t.value}:{type:"element",tagName:"div",properties:{},children:e.all(t)};return e.patch(t,r),e.applyData(t,r)}function aF(e,t){const n=[];let r=-1;for(t&&n.push({type:"text",value:`
33
+ `});++r<e.length;)r&&n.push({type:"text",value:`
34
+ `}),n.push(e[r]);return t&&e.length>0&&n.push({type:"text",value:`
35
+ `}),n}function q1(e){let t=0,n=e.charCodeAt(t);for(;n===9||n===32;)t++,n=e.charCodeAt(t);return e.slice(t)}function G1(e,t){const n=tF(e,t),r=n.one(e,void 0),a=GV(n),o=Array.isArray(r)?{type:"root",children:r}:r||{type:"root",children:[]};return a&&o.children.push({type:"text",value:`
36
+ `},a),o}function sF(e,t){return e&&"run"in e?async function(n,r){const a=G1(n,{file:r,...t});await e.run(a,r)}:function(n,r){return G1(n,{file:r,...e||t})}}function K1(e){if(e)throw e}var Im,$1;function oF(){if($1)return Im;$1=1;var e=Object.prototype.hasOwnProperty,t=Object.prototype.toString,n=Object.defineProperty,r=Object.getOwnPropertyDescriptor,a=function(f){return typeof Array.isArray=="function"?Array.isArray(f):t.call(f)==="[object Array]"},o=function(f){if(!f||t.call(f)!=="[object Object]")return!1;var m=e.call(f,"constructor"),g=f.constructor&&f.constructor.prototype&&e.call(f.constructor.prototype,"isPrototypeOf");if(f.constructor&&!m&&!g)return!1;var v;for(v in f);return typeof v>"u"||e.call(f,v)},l=function(f,m){n&&m.name==="__proto__"?n(f,m.name,{enumerable:!0,configurable:!0,value:m.newValue,writable:!0}):f[m.name]=m.newValue},c=function(f,m){if(m==="__proto__")if(e.call(f,m)){if(r)return r(f,m).value}else return;return f[m]};return Im=function d(){var f,m,g,v,b,S,w=arguments[0],E=1,T=arguments.length,C=!1;for(typeof w=="boolean"&&(C=w,w=arguments[1]||{},E=2),(w==null||typeof w!="object"&&typeof w!="function")&&(w={});E<T;++E)if(f=arguments[E],f!=null)for(m in f)g=c(w,m),v=c(f,m),w!==v&&(C&&v&&(o(v)||(b=a(v)))?(b?(b=!1,S=g&&a(g)?g:[]):S=g&&o(g)?g:{},l(w,{name:m,newValue:d(C,S,v)})):typeof v<"u"&&l(w,{name:m,newValue:v}));return w},Im}var lF=oF();const Pm=jo(lF);function av(e){if(typeof e!="object"||e===null)return!1;const t=Object.getPrototypeOf(e);return(t===null||t===Object.prototype||Object.getPrototypeOf(t)===null)&&!(Symbol.toStringTag in e)&&!(Symbol.iterator in e)}function uF(){const e=[],t={run:n,use:r};return t;function n(...a){let o=-1;const l=a.pop();if(typeof l!="function")throw new TypeError("Expected function as last argument, not "+l);c(null,...a);function c(d,...f){const m=e[++o];let g=-1;if(d){l(d);return}for(;++g<a.length;)(f[g]===null||f[g]===void 0)&&(f[g]=a[g]);a=f,m?cF(m,c)(...f):l(null,...f)}}function r(a){if(typeof a!="function")throw new TypeError("Expected `middelware` to be a function, not "+a);return e.push(a),t}}function cF(e,t){let n;return r;function r(...l){const c=e.length>l.length;let d;c&&l.push(a);try{d=e.apply(this,l)}catch(f){const m=f;if(c&&n)throw m;return a(m)}c||(d&&d.then&&typeof d.then=="function"?d.then(o,a):d instanceof Error?a(d):o(d))}function a(l,...c){n||(n=!0,t(l,...c))}function o(l){a(null,l)}}const ii={basename:dF,dirname:fF,extname:hF,join:pF,sep:"/"};function dF(e,t){if(t!==void 0&&typeof t!="string")throw new TypeError('"ext" argument must be a string');zu(e);let n=0,r=-1,a=e.length,o;if(t===void 0||t.length===0||t.length>e.length){for(;a--;)if(e.codePointAt(a)===47){if(o){n=a+1;break}}else r<0&&(o=!0,r=a+1);return r<0?"":e.slice(n,r)}if(t===e)return"";let l=-1,c=t.length-1;for(;a--;)if(e.codePointAt(a)===47){if(o){n=a+1;break}}else l<0&&(o=!0,l=a+1),c>-1&&(e.codePointAt(a)===t.codePointAt(c--)?c<0&&(r=a):(c=-1,r=l));return n===r?r=l:r<0&&(r=e.length),e.slice(n,r)}function fF(e){if(zu(e),e.length===0)return".";let t=-1,n=e.length,r;for(;--n;)if(e.codePointAt(n)===47){if(r){t=n;break}}else r||(r=!0);return t<0?e.codePointAt(0)===47?"/":".":t===1&&e.codePointAt(0)===47?"//":e.slice(0,t)}function hF(e){zu(e);let t=e.length,n=-1,r=0,a=-1,o=0,l;for(;t--;){const c=e.codePointAt(t);if(c===47){if(l){r=t+1;break}continue}n<0&&(l=!0,n=t+1),c===46?a<0?a=t:o!==1&&(o=1):a>-1&&(o=-1)}return a<0||n<0||o===0||o===1&&a===n-1&&a===r+1?"":e.slice(a,n)}function pF(...e){let t=-1,n;for(;++t<e.length;)zu(e[t]),e[t]&&(n=n===void 0?e[t]:n+"/"+e[t]);return n===void 0?".":mF(n)}function mF(e){zu(e);const t=e.codePointAt(0)===47;let n=gF(e,!t);return n.length===0&&!t&&(n="."),n.length>0&&e.codePointAt(e.length-1)===47&&(n+="/"),t?"/"+n:n}function gF(e,t){let n="",r=0,a=-1,o=0,l=-1,c,d;for(;++l<=e.length;){if(l<e.length)c=e.codePointAt(l);else{if(c===47)break;c=47}if(c===47){if(!(a===l-1||o===1))if(a!==l-1&&o===2){if(n.length<2||r!==2||n.codePointAt(n.length-1)!==46||n.codePointAt(n.length-2)!==46){if(n.length>2){if(d=n.lastIndexOf("/"),d!==n.length-1){d<0?(n="",r=0):(n=n.slice(0,d),r=n.length-1-n.lastIndexOf("/")),a=l,o=0;continue}}else if(n.length>0){n="",r=0,a=l,o=0;continue}}t&&(n=n.length>0?n+"/..":"..",r=2)}else n.length>0?n+="/"+e.slice(a+1,l):n=e.slice(a+1,l),r=l-a-1;a=l,o=0}else c===46&&o>-1?o++:o=-1}return n}function zu(e){if(typeof e!="string")throw new TypeError("Path must be a string. Received "+JSON.stringify(e))}const vF={cwd:yF};function yF(){return"/"}function sv(e){return!!(e!==null&&typeof e=="object"&&"href"in e&&e.href&&"protocol"in e&&e.protocol&&e.auth===void 0)}function bF(e){if(typeof e=="string")e=new URL(e);else if(!sv(e)){const t=new TypeError('The "path" argument must be of type string or an instance of URL. Received `'+e+"`");throw t.code="ERR_INVALID_ARG_TYPE",t}if(e.protocol!=="file:"){const t=new TypeError("The URL must be of scheme file");throw t.code="ERR_INVALID_URL_SCHEME",t}return xF(e)}function xF(e){if(e.hostname!==""){const r=new TypeError('File URL host must be "localhost" or empty on darwin');throw r.code="ERR_INVALID_FILE_URL_HOST",r}const t=e.pathname;let n=-1;for(;++n<t.length;)if(t.codePointAt(n)===37&&t.codePointAt(n+1)===50){const r=t.codePointAt(n+2);if(r===70||r===102){const a=new TypeError("File URL path must not include encoded / characters");throw a.code="ERR_INVALID_FILE_URL_PATH",a}}return decodeURIComponent(t)}const Lm=["history","path","basename","stem","extname","dirname"];class ej{constructor(t){let n;t?sv(t)?n={path:t}:typeof t=="string"||SF(t)?n={value:t}:n=t:n={},this.cwd="cwd"in n?"":vF.cwd(),this.data={},this.history=[],this.messages=[],this.value,this.map,this.result,this.stored;let r=-1;for(;++r<Lm.length;){const o=Lm[r];o in n&&n[o]!==void 0&&n[o]!==null&&(this[o]=o==="history"?[...n[o]]:n[o])}let a;for(a in n)Lm.includes(a)||(this[a]=n[a])}get basename(){return typeof this.path=="string"?ii.basename(this.path):void 0}set basename(t){Um(t,"basename"),zm(t,"basename"),this.path=ii.join(this.dirname||"",t)}get dirname(){return typeof this.path=="string"?ii.dirname(this.path):void 0}set dirname(t){Y1(this.basename,"dirname"),this.path=ii.join(t||"",this.basename)}get extname(){return typeof this.path=="string"?ii.extname(this.path):void 0}set extname(t){if(zm(t,"extname"),Y1(this.dirname,"extname"),t){if(t.codePointAt(0)!==46)throw new Error("`extname` must start with `.`");if(t.includes(".",1))throw new Error("`extname` cannot contain multiple dots")}this.path=ii.join(this.dirname,this.stem+(t||""))}get path(){return this.history[this.history.length-1]}set path(t){sv(t)&&(t=bF(t)),Um(t,"path"),this.path!==t&&this.history.push(t)}get stem(){return typeof this.path=="string"?ii.basename(this.path,this.extname):void 0}set stem(t){Um(t,"stem"),zm(t,"stem"),this.path=ii.join(this.dirname||"",t+(this.extname||""))}fail(t,n,r){const a=this.message(t,n,r);throw a.fatal=!0,a}info(t,n,r){const a=this.message(t,n,r);return a.fatal=void 0,a}message(t,n,r){const a=new On(t,n,r);return this.path&&(a.name=this.path+":"+a.name,a.file=this.path),a.fatal=!1,this.messages.push(a),a}toString(t){return this.value===void 0?"":typeof this.value=="string"?this.value:new TextDecoder(t||void 0).decode(this.value)}}function zm(e,t){if(e&&e.includes(ii.sep))throw new Error("`"+t+"` cannot be a path: did not expect `"+ii.sep+"`")}function Um(e,t){if(!e)throw new Error("`"+t+"` cannot be empty")}function Y1(e,t){if(!e)throw new Error("Setting `"+t+"` requires `path` to be set too")}function SF(e){return!!(e&&typeof e=="object"&&"byteLength"in e&&"byteOffset"in e)}const wF=(function(e){const r=this.constructor.prototype,a=r[e],o=function(){return a.apply(o,arguments)};return Object.setPrototypeOf(o,r),o}),EF={}.hasOwnProperty;class _y extends wF{constructor(){super("copy"),this.Compiler=void 0,this.Parser=void 0,this.attachers=[],this.compiler=void 0,this.freezeIndex=-1,this.frozen=void 0,this.namespace={},this.parser=void 0,this.transformers=uF()}copy(){const t=new _y;let n=-1;for(;++n<this.attachers.length;){const r=this.attachers[n];t.use(...r)}return t.data(Pm(!0,{},this.namespace)),t}data(t,n){return typeof t=="string"?arguments.length===2?(Fm("data",this.frozen),this.namespace[t]=n,this):EF.call(this.namespace,t)&&this.namespace[t]||void 0:t?(Fm("data",this.frozen),this.namespace=t,this):this.namespace}freeze(){if(this.frozen)return this;const t=this;for(;++this.freezeIndex<this.attachers.length;){const[n,...r]=this.attachers[this.freezeIndex];if(r[0]===!1)continue;r[0]===!0&&(r[0]=void 0);const a=n.call(t,...r);typeof a=="function"&&this.transformers.use(a)}return this.frozen=!0,this.freezeIndex=Number.POSITIVE_INFINITY,this}parse(t){this.freeze();const n=Sd(t),r=this.parser||this.Parser;return Bm("parse",r),r(String(n),n)}process(t,n){const r=this;return this.freeze(),Bm("process",this.parser||this.Parser),Vm("process",this.compiler||this.Compiler),n?a(void 0,n):new Promise(a);function a(o,l){const c=Sd(t),d=r.parse(c);r.run(d,c,function(m,g,v){if(m||!g||!v)return f(m);const b=g,S=r.stringify(b,v);CF(S)?v.value=S:v.result=S,f(m,v)});function f(m,g){m||!g?l(m):o?o(g):n(void 0,g)}}}processSync(t){let n=!1,r;return this.freeze(),Bm("processSync",this.parser||this.Parser),Vm("processSync",this.compiler||this.Compiler),this.process(t,a),X1("processSync","process",n),r;function a(o,l){n=!0,K1(o),r=l}}run(t,n,r){W1(t),this.freeze();const a=this.transformers;return!r&&typeof n=="function"&&(r=n,n=void 0),r?o(void 0,r):new Promise(o);function o(l,c){const d=Sd(n);a.run(t,d,f);function f(m,g,v){const b=g||t;m?c(m):l?l(b):r(void 0,b,v)}}}runSync(t,n){let r=!1,a;return this.run(t,n,o),X1("runSync","run",r),a;function o(l,c){K1(l),a=c,r=!0}}stringify(t,n){this.freeze();const r=Sd(n),a=this.compiler||this.Compiler;return Vm("stringify",a),W1(t),a(t,r)}use(t,...n){const r=this.attachers,a=this.namespace;if(Fm("use",this.frozen),t!=null)if(typeof t=="function")d(t,n);else if(typeof t=="object")Array.isArray(t)?c(t):l(t);else throw new TypeError("Expected usable value, not `"+t+"`");return this;function o(f){if(typeof f=="function")d(f,[]);else if(typeof f=="object")if(Array.isArray(f)){const[m,...g]=f;d(m,g)}else l(f);else throw new TypeError("Expected usable value, not `"+f+"`")}function l(f){if(!("plugins"in f)&&!("settings"in f))throw new Error("Expected usable value but received an empty preset, which is probably a mistake: presets typically come with `plugins` and sometimes with `settings`, but this has neither");c(f.plugins),f.settings&&(a.settings=Pm(!0,a.settings,f.settings))}function c(f){let m=-1;if(f!=null)if(Array.isArray(f))for(;++m<f.length;){const g=f[m];o(g)}else throw new TypeError("Expected a list of plugins, not `"+f+"`")}function d(f,m){let g=-1,v=-1;for(;++g<r.length;)if(r[g][0]===f){v=g;break}if(v===-1)r.push([f,...m]);else if(m.length>0){let[b,...S]=m;const w=r[v][1];av(w)&&av(b)&&(b=Pm(!0,w,b)),r[v]=[f,b,...S]}}}}const TF=new _y().freeze();function Bm(e,t){if(typeof t!="function")throw new TypeError("Cannot `"+e+"` without `parser`")}function Vm(e,t){if(typeof t!="function")throw new TypeError("Cannot `"+e+"` without `compiler`")}function Fm(e,t){if(t)throw new Error("Cannot call `"+e+"` on a frozen processor.\nCreate a new processor first, by calling it: use `processor()` instead of `processor`.")}function W1(e){if(!av(e)||typeof e.type!="string")throw new TypeError("Expected node, got `"+e+"`")}function X1(e,t,n){if(!n)throw new Error("`"+e+"` finished async. Use `"+t+"` instead")}function Sd(e){return kF(e)?e:new ej(e)}function kF(e){return!!(e&&typeof e=="object"&&"message"in e&&"messages"in e)}function CF(e){return typeof e=="string"||AF(e)}function AF(e){return!!(e&&typeof e=="object"&&"byteLength"in e&&"byteOffset"in e)}const NF="https://github.com/remarkjs/react-markdown/blob/main/changelog.md",Q1=[],J1={allowDangerousHtml:!0},jF=/^(https?|ircs?|mailto|xmpp)$/i,RF=[{from:"astPlugins",id:"remove-buggy-html-in-markdown-parser"},{from:"allowDangerousHtml",id:"remove-buggy-html-in-markdown-parser"},{from:"allowNode",id:"replace-allownode-allowedtypes-and-disallowedtypes",to:"allowElement"},{from:"allowedTypes",id:"replace-allownode-allowedtypes-and-disallowedtypes",to:"allowedElements"},{from:"className",id:"remove-classname"},{from:"disallowedTypes",id:"replace-allownode-allowedtypes-and-disallowedtypes",to:"disallowedElements"},{from:"escapeHtml",id:"remove-buggy-html-in-markdown-parser"},{from:"includeElementIndex",id:"#remove-includeelementindex"},{from:"includeNodeIndex",id:"change-includenodeindex-to-includeelementindex"},{from:"linkTarget",id:"remove-linktarget"},{from:"plugins",id:"change-plugins-to-remarkplugins",to:"remarkPlugins"},{from:"rawSourcePos",id:"#remove-rawsourcepos"},{from:"renderers",id:"change-renderers-to-components",to:"components"},{from:"source",id:"change-source-to-children",to:"children"},{from:"sourcePos",id:"#remove-sourcepos"},{from:"transformImageUri",id:"#add-urltransform",to:"urlTransform"},{from:"transformLinkUri",id:"#add-urltransform",to:"urlTransform"}];function _F(e){const t=OF(e),n=MF(e);return DF(t.runSync(t.parse(n),n),e)}function OF(e){const t=e.rehypePlugins||Q1,n=e.remarkPlugins||Q1,r=e.remarkRehypeOptions?{...e.remarkRehypeOptions,...J1}:J1;return TF().use(fV).use(n).use(sF,r).use(t)}function MF(e){const t=e.children||"",n=new ej;return typeof t=="string"&&(n.value=t),n}function DF(e,t){const n=t.allowedElements,r=t.allowElement,a=t.components,o=t.disallowedElements,l=t.skipHtml,c=t.unwrapDisallowed,d=t.urlTransform||IF;for(const m of RF)Object.hasOwn(t,m.from)&&(""+m.from+(m.to?"use `"+m.to+"` instead":"remove it")+NF+m.id,void 0);return Ry(e,f),WB(e,{Fragment:h.Fragment,components:a,ignoreInvalidStyle:!0,jsx:h.jsx,jsxs:h.jsxs,passKeys:!0,passNode:!0});function f(m,g,v){if(m.type==="raw"&&v&&typeof g=="number")return l?v.children.splice(g,1):v.children[g]={type:"text",value:m.value},g;if(m.type==="element"){let b;for(b in Om)if(Object.hasOwn(Om,b)&&Object.hasOwn(m.properties,b)){const S=m.properties[b],w=Om[b];(w===null||w.includes(m.tagName))&&(m.properties[b]=d(String(S||""),b,m))}}if(m.type==="element"){let b=n?!n.includes(m.tagName):o?o.includes(m.tagName):!1;if(!b&&r&&typeof g=="number"&&(b=!r(m,g,v)),b&&v&&typeof g=="number")return c&&m.children?v.children.splice(g,1,...m.children):v.children.splice(g,1),g}}}function IF(e){const t=e.indexOf(":"),n=e.indexOf("?"),r=e.indexOf("#"),a=e.indexOf("/");return t===-1||a!==-1&&t>a||n!==-1&&t>n||r!==-1&&t>r||jF.test(e.slice(0,t))?e:""}function Z1(e,t){const n=String(e);if(typeof t!="string")throw new TypeError("Expected character");let r=0,a=n.indexOf(t);for(;a!==-1;)r++,a=n.indexOf(t,a+t.length);return r}function PF(e){if(typeof e!="string")throw new TypeError("Expected a string");return e.replace(/[|\\{}()[\]^$+*?.]/g,"\\$&").replace(/-/g,"\\x2d")}function LF(e,t,n){const a=zf((n||{}).ignore||[]),o=zF(t);let l=-1;for(;++l<o.length;)ZN(e,"text",c);function c(f,m){let g=-1,v;for(;++g<m.length;){const b=m[g],S=v?v.children:void 0;if(a(b,S?S.indexOf(b):void 0,v))return;v=b}if(v)return d(f,m)}function d(f,m){const g=m[m.length-1],v=o[l][0],b=o[l][1];let S=0;const E=g.children.indexOf(f);let T=!1,C=[];v.lastIndex=0;let k=v.exec(f.value);for(;k;){const j=k.index,N={index:k.index,input:k.input,stack:[...m,f]};let R=b(...k,N);if(typeof R=="string"&&(R=R.length>0?{type:"text",value:R}:void 0),R===!1?v.lastIndex=j+1:(S!==j&&C.push({type:"text",value:f.value.slice(S,j)}),Array.isArray(R)?C.push(...R):R&&C.push(R),S=j+k[0].length,T=!0),!v.global)break;k=v.exec(f.value)}return T?(S<f.value.length&&C.push({type:"text",value:f.value.slice(S)}),g.children.splice(E,1,...C)):C=[f],E+C.length}}function zF(e){const t=[];if(!Array.isArray(e))throw new TypeError("Expected find and replace tuple or list of tuples");const n=!e[0]||Array.isArray(e[0])?e:[e];let r=-1;for(;++r<n.length;){const a=n[r];t.push([UF(a[0]),BF(a[1])])}return t}function UF(e){return typeof e=="string"?new RegExp(PF(e),"g"):e}function BF(e){return typeof e=="function"?e:function(){return e}}const Hm="phrasing",qm=["autolink","link","image","label"];function VF(){return{transforms:[YF],enter:{literalAutolink:HF,literalAutolinkEmail:Gm,literalAutolinkHttp:Gm,literalAutolinkWww:Gm},exit:{literalAutolink:$F,literalAutolinkEmail:KF,literalAutolinkHttp:qF,literalAutolinkWww:GF}}}function FF(){return{unsafe:[{character:"@",before:"[+\\-.\\w]",after:"[\\-.\\w]",inConstruct:Hm,notInConstruct:qm},{character:".",before:"[Ww]",after:"[\\-.\\w]",inConstruct:Hm,notInConstruct:qm},{character:":",before:"[ps]",after:"\\/",inConstruct:Hm,notInConstruct:qm}]}}function HF(e){this.enter({type:"link",title:null,url:"",children:[]},e)}function Gm(e){this.config.enter.autolinkProtocol.call(this,e)}function qF(e){this.config.exit.autolinkProtocol.call(this,e)}function GF(e){this.config.exit.data.call(this,e);const t=this.stack[this.stack.length-1];t.type,t.url="http://"+this.sliceSerialize(e)}function KF(e){this.config.exit.autolinkEmail.call(this,e)}function $F(e){this.exit(e)}function YF(e){LF(e,[[/(https?:\/\/|www(?=\.))([-.\w]+)([^ \t\r\n]*)/gi,WF],[new RegExp("(?<=^|\\s|\\p{P}|\\p{S})([-.\\w+]+)@([-\\w]+(?:\\.[-\\w]+)+)","gu"),XF]],{ignore:["link","linkReference"]})}function WF(e,t,n,r,a){let o="";if(!tj(a)||(/^w/i.test(t)&&(n=t+n,t="",o="http://"),!QF(n)))return!1;const l=JF(n+r);if(!l[0])return!1;const c={type:"link",title:null,url:o+t+l[0],children:[{type:"text",value:t+l[0]}]};return l[1]?[c,{type:"text",value:l[1]}]:c}function XF(e,t,n,r){return!tj(r,!0)||/[-\d_]$/.test(n)?!1:{type:"link",title:null,url:"mailto:"+t+"@"+n,children:[{type:"text",value:t+"@"+n}]}}function QF(e){const t=e.split(".");return!(t.length<2||t[t.length-1]&&(/_/.test(t[t.length-1])||!/[a-zA-Z\d]/.test(t[t.length-1]))||t[t.length-2]&&(/_/.test(t[t.length-2])||!/[a-zA-Z\d]/.test(t[t.length-2])))}function JF(e){const t=/[!"&'),.:;<>?\]}]+$/.exec(e);if(!t)return[e,void 0];e=e.slice(0,t.index);let n=t[0],r=n.indexOf(")");const a=Z1(e,"(");let o=Z1(e,")");for(;r!==-1&&a>o;)e+=n.slice(0,r+1),n=n.slice(r+1),r=n.indexOf(")"),o++;return[e,n]}function tj(e,t){const n=e.input.charCodeAt(e.index-1);return(e.index===0||gs(n)||If(n))&&(!t||n!==47)}nj.peek=oH;function ZF(){this.buffer()}function eH(e){this.enter({type:"footnoteReference",identifier:"",label:""},e)}function tH(){this.buffer()}function nH(e){this.enter({type:"footnoteDefinition",identifier:"",label:"",children:[]},e)}function rH(e){const t=this.resume(),n=this.stack[this.stack.length-1];n.type,n.identifier=Fr(this.sliceSerialize(e)).toLowerCase(),n.label=t}function iH(e){this.exit(e)}function aH(e){const t=this.resume(),n=this.stack[this.stack.length-1];n.type,n.identifier=Fr(this.sliceSerialize(e)).toLowerCase(),n.label=t}function sH(e){this.exit(e)}function oH(){return"["}function nj(e,t,n,r){const a=n.createTracker(r);let o=a.move("[^");const l=n.enter("footnoteReference"),c=n.enter("reference");return o+=a.move(n.safe(n.associationId(e),{after:"]",before:o})),c(),l(),o+=a.move("]"),o}function lH(){return{enter:{gfmFootnoteCallString:ZF,gfmFootnoteCall:eH,gfmFootnoteDefinitionLabelString:tH,gfmFootnoteDefinition:nH},exit:{gfmFootnoteCallString:rH,gfmFootnoteCall:iH,gfmFootnoteDefinitionLabelString:aH,gfmFootnoteDefinition:sH}}}function uH(e){let t=!1;return e&&e.firstLineBlank&&(t=!0),{handlers:{footnoteDefinition:n,footnoteReference:nj},unsafe:[{character:"[",inConstruct:["label","phrasing","reference"]}]};function n(r,a,o,l){const c=o.createTracker(l);let d=c.move("[^");const f=o.enter("footnoteDefinition"),m=o.enter("label");return d+=c.move(o.safe(o.associationId(r),{before:d,after:"]"})),m(),d+=c.move("]:"),r.children&&r.children.length>0&&(c.shift(4),d+=c.move((t?`
37
+ `:" ")+o.indentLines(o.containerFlow(r,c.current()),t?rj:cH))),f(),d}}function cH(e,t,n){return t===0?e:rj(e,t,n)}function rj(e,t,n){return(n?"":" ")+e}const dH=["autolink","destinationLiteral","destinationRaw","reference","titleQuote","titleApostrophe"];ij.peek=gH;function fH(){return{canContainEols:["delete"],enter:{strikethrough:pH},exit:{strikethrough:mH}}}function hH(){return{unsafe:[{character:"~",inConstruct:"phrasing",notInConstruct:dH}],handlers:{delete:ij}}}function pH(e){this.enter({type:"delete",children:[]},e)}function mH(e){this.exit(e)}function ij(e,t,n,r){const a=n.createTracker(r),o=n.enter("strikethrough");let l=a.move("~~");return l+=n.containerPhrasing(e,{...a.current(),before:l,after:"~"}),l+=a.move("~~"),o(),l}function gH(){return"~"}function vH(e){return e.length}function yH(e,t){const n=t||{},r=(n.align||[]).concat(),a=n.stringLength||vH,o=[],l=[],c=[],d=[];let f=0,m=-1;for(;++m<e.length;){const w=[],E=[];let T=-1;for(e[m].length>f&&(f=e[m].length);++T<e[m].length;){const C=bH(e[m][T]);if(n.alignDelimiters!==!1){const k=a(C);E[T]=k,(d[T]===void 0||k>d[T])&&(d[T]=k)}w.push(C)}l[m]=w,c[m]=E}let g=-1;if(typeof r=="object"&&"length"in r)for(;++g<f;)o[g]=eT(r[g]);else{const w=eT(r);for(;++g<f;)o[g]=w}g=-1;const v=[],b=[];for(;++g<f;){const w=o[g];let E="",T="";w===99?(E=":",T=":"):w===108?E=":":w===114&&(T=":");let C=n.alignDelimiters===!1?1:Math.max(1,d[g]-E.length-T.length);const k=E+"-".repeat(C)+T;n.alignDelimiters!==!1&&(C=E.length+C+T.length,C>d[g]&&(d[g]=C),b[g]=C),v[g]=k}l.splice(1,0,v),c.splice(1,0,b),m=-1;const S=[];for(;++m<l.length;){const w=l[m],E=c[m];g=-1;const T=[];for(;++g<f;){const C=w[g]||"";let k="",j="";if(n.alignDelimiters!==!1){const N=d[g]-(E[g]||0),R=o[g];R===114?k=" ".repeat(N):R===99?N%2?(k=" ".repeat(N/2+.5),j=" ".repeat(N/2-.5)):(k=" ".repeat(N/2),j=k):j=" ".repeat(N)}n.delimiterStart!==!1&&!g&&T.push("|"),n.padding!==!1&&!(n.alignDelimiters===!1&&C==="")&&(n.delimiterStart!==!1||g)&&T.push(" "),n.alignDelimiters!==!1&&T.push(k),T.push(C),n.alignDelimiters!==!1&&T.push(j),n.padding!==!1&&T.push(" "),(n.delimiterEnd!==!1||g!==f-1)&&T.push("|")}S.push(n.delimiterEnd===!1?T.join("").replace(/ +$/,""):T.join(""))}return S.join(`
38
+ `)}function bH(e){return e==null?"":String(e)}function eT(e){const t=typeof e=="string"?e.codePointAt(0):0;return t===67||t===99?99:t===76||t===108?108:t===82||t===114?114:0}function xH(e,t,n,r){const a=n.enter("blockquote"),o=n.createTracker(r);o.move("> "),o.shift(2);const l=n.indentLines(n.containerFlow(e,o.current()),SH);return a(),l}function SH(e,t,n){return">"+(n?"":" ")+e}function wH(e,t){return tT(e,t.inConstruct,!0)&&!tT(e,t.notInConstruct,!1)}function tT(e,t,n){if(typeof t=="string"&&(t=[t]),!t||t.length===0)return n;let r=-1;for(;++r<t.length;)if(e.includes(t[r]))return!0;return!1}function nT(e,t,n,r){let a=-1;for(;++a<n.unsafe.length;)if(n.unsafe[a].character===`
39
+ `&&wH(n.stack,n.unsafe[a]))return/[ \t]/.test(r.before)?"":" ";return`\\
40
+ `}function EH(e,t){const n=String(e);let r=n.indexOf(t),a=r,o=0,l=0;if(typeof t!="string")throw new TypeError("Expected substring");for(;r!==-1;)r===a?++o>l&&(l=o):o=1,a=r+t.length,r=n.indexOf(t,a);return l}function TH(e,t){return!!(t.options.fences===!1&&e.value&&!e.lang&&/[^ \r\n]/.test(e.value)&&!/^[\t ]*(?:[\r\n]|$)|(?:^|[\r\n])[\t ]*$/.test(e.value))}function kH(e){const t=e.options.fence||"`";if(t!=="`"&&t!=="~")throw new Error("Cannot serialize code with `"+t+"` for `options.fence`, expected `` ` `` or `~`");return t}function CH(e,t,n,r){const a=kH(n),o=e.value||"",l=a==="`"?"GraveAccent":"Tilde";if(TH(e,n)){const g=n.enter("codeIndented"),v=n.indentLines(o,AH);return g(),v}const c=n.createTracker(r),d=a.repeat(Math.max(EH(o,a)+1,3)),f=n.enter("codeFenced");let m=c.move(d);if(e.lang){const g=n.enter(`codeFencedLang${l}`);m+=c.move(n.safe(e.lang,{before:m,after:" ",encode:["`"],...c.current()})),g()}if(e.lang&&e.meta){const g=n.enter(`codeFencedMeta${l}`);m+=c.move(" "),m+=c.move(n.safe(e.meta,{before:m,after:`
41
+ `,encode:["`"],...c.current()})),g()}return m+=c.move(`
42
+ `),o&&(m+=c.move(o+`
43
+ `)),m+=c.move(d),f(),m}function AH(e,t,n){return(n?"":" ")+e}function Oy(e){const t=e.options.quote||'"';if(t!=='"'&&t!=="'")throw new Error("Cannot serialize title with `"+t+"` for `options.quote`, expected `\"`, or `'`");return t}function NH(e,t,n,r){const a=Oy(n),o=a==='"'?"Quote":"Apostrophe",l=n.enter("definition");let c=n.enter("label");const d=n.createTracker(r);let f=d.move("[");return f+=d.move(n.safe(n.associationId(e),{before:f,after:"]",...d.current()})),f+=d.move("]: "),c(),!e.url||/[\0- \u007F]/.test(e.url)?(c=n.enter("destinationLiteral"),f+=d.move("<"),f+=d.move(n.safe(e.url,{before:f,after:">",...d.current()})),f+=d.move(">")):(c=n.enter("destinationRaw"),f+=d.move(n.safe(e.url,{before:f,after:e.title?" ":`
44
+ `,...d.current()}))),c(),e.title&&(c=n.enter(`title${o}`),f+=d.move(" "+a),f+=d.move(n.safe(e.title,{before:f,after:a,...d.current()})),f+=d.move(a),c()),l(),f}function jH(e){const t=e.options.emphasis||"*";if(t!=="*"&&t!=="_")throw new Error("Cannot serialize emphasis with `"+t+"` for `options.emphasis`, expected `*`, or `_`");return t}function Tu(e){return"&#x"+e.toString(16).toUpperCase()+";"}function df(e,t,n){const r=Ao(e),a=Ao(t);return r===void 0?a===void 0?n==="_"?{inside:!0,outside:!0}:{inside:!1,outside:!1}:a===1?{inside:!0,outside:!0}:{inside:!1,outside:!0}:r===1?a===void 0?{inside:!1,outside:!1}:a===1?{inside:!0,outside:!0}:{inside:!1,outside:!1}:a===void 0?{inside:!1,outside:!1}:a===1?{inside:!0,outside:!1}:{inside:!1,outside:!1}}aj.peek=RH;function aj(e,t,n,r){const a=jH(n),o=n.enter("emphasis"),l=n.createTracker(r),c=l.move(a);let d=l.move(n.containerPhrasing(e,{after:a,before:c,...l.current()}));const f=d.charCodeAt(0),m=df(r.before.charCodeAt(r.before.length-1),f,a);m.inside&&(d=Tu(f)+d.slice(1));const g=d.charCodeAt(d.length-1),v=df(r.after.charCodeAt(0),g,a);v.inside&&(d=d.slice(0,-1)+Tu(g));const b=l.move(a);return o(),n.attentionEncodeSurroundingInfo={after:v.outside,before:m.outside},c+d+b}function RH(e,t,n){return n.options.emphasis||"*"}function _H(e,t){let n=!1;return Ry(e,function(r){if("value"in r&&/\r?\n|\r/.test(r.value)||r.type==="break")return n=!0,rv}),!!((!e.depth||e.depth<3)&&Ey(e)&&(t.options.setext||n))}function OH(e,t,n,r){const a=Math.max(Math.min(6,e.depth||1),1),o=n.createTracker(r);if(_H(e,n)){const m=n.enter("headingSetext"),g=n.enter("phrasing"),v=n.containerPhrasing(e,{...o.current(),before:`
45
+ `,after:`
46
+ `});return g(),m(),v+`
47
+ `+(a===1?"=":"-").repeat(v.length-(Math.max(v.lastIndexOf("\r"),v.lastIndexOf(`
48
+ `))+1))}const l="#".repeat(a),c=n.enter("headingAtx"),d=n.enter("phrasing");o.move(l+" ");let f=n.containerPhrasing(e,{before:"# ",after:`
49
+ `,...o.current()});return/^[\t ]/.test(f)&&(f=Tu(f.charCodeAt(0))+f.slice(1)),f=f?l+" "+f:l,n.options.closeAtx&&(f+=" "+l),d(),c(),f}sj.peek=MH;function sj(e){return e.value||""}function MH(){return"<"}oj.peek=DH;function oj(e,t,n,r){const a=Oy(n),o=a==='"'?"Quote":"Apostrophe",l=n.enter("image");let c=n.enter("label");const d=n.createTracker(r);let f=d.move("![");return f+=d.move(n.safe(e.alt,{before:f,after:"]",...d.current()})),f+=d.move("]("),c(),!e.url&&e.title||/[\0- \u007F]/.test(e.url)?(c=n.enter("destinationLiteral"),f+=d.move("<"),f+=d.move(n.safe(e.url,{before:f,after:">",...d.current()})),f+=d.move(">")):(c=n.enter("destinationRaw"),f+=d.move(n.safe(e.url,{before:f,after:e.title?" ":")",...d.current()}))),c(),e.title&&(c=n.enter(`title${o}`),f+=d.move(" "+a),f+=d.move(n.safe(e.title,{before:f,after:a,...d.current()})),f+=d.move(a),c()),f+=d.move(")"),l(),f}function DH(){return"!"}lj.peek=IH;function lj(e,t,n,r){const a=e.referenceType,o=n.enter("imageReference");let l=n.enter("label");const c=n.createTracker(r);let d=c.move("![");const f=n.safe(e.alt,{before:d,after:"]",...c.current()});d+=c.move(f+"]["),l();const m=n.stack;n.stack=[],l=n.enter("reference");const g=n.safe(n.associationId(e),{before:d,after:"]",...c.current()});return l(),n.stack=m,o(),a==="full"||!f||f!==g?d+=c.move(g+"]"):a==="shortcut"?d=d.slice(0,-1):d+=c.move("]"),d}function IH(){return"!"}uj.peek=PH;function uj(e,t,n){let r=e.value||"",a="`",o=-1;for(;new RegExp("(^|[^`])"+a+"([^`]|$)").test(r);)a+="`";for(/[^ \r\n]/.test(r)&&(/^[ \r\n]/.test(r)&&/[ \r\n]$/.test(r)||/^`|`$/.test(r))&&(r=" "+r+" ");++o<n.unsafe.length;){const l=n.unsafe[o],c=n.compilePattern(l);let d;if(l.atBreak)for(;d=c.exec(r);){let f=d.index;r.charCodeAt(f)===10&&r.charCodeAt(f-1)===13&&f--,r=r.slice(0,f)+" "+r.slice(d.index+1)}}return a+r+a}function PH(){return"`"}function cj(e,t){const n=Ey(e);return!!(!t.options.resourceLink&&e.url&&!e.title&&e.children&&e.children.length===1&&e.children[0].type==="text"&&(n===e.url||"mailto:"+n===e.url)&&/^[a-z][a-z+.-]+:/i.test(e.url)&&!/[\0- <>\u007F]/.test(e.url))}dj.peek=LH;function dj(e,t,n,r){const a=Oy(n),o=a==='"'?"Quote":"Apostrophe",l=n.createTracker(r);let c,d;if(cj(e,n)){const m=n.stack;n.stack=[],c=n.enter("autolink");let g=l.move("<");return g+=l.move(n.containerPhrasing(e,{before:g,after:">",...l.current()})),g+=l.move(">"),c(),n.stack=m,g}c=n.enter("link"),d=n.enter("label");let f=l.move("[");return f+=l.move(n.containerPhrasing(e,{before:f,after:"](",...l.current()})),f+=l.move("]("),d(),!e.url&&e.title||/[\0- \u007F]/.test(e.url)?(d=n.enter("destinationLiteral"),f+=l.move("<"),f+=l.move(n.safe(e.url,{before:f,after:">",...l.current()})),f+=l.move(">")):(d=n.enter("destinationRaw"),f+=l.move(n.safe(e.url,{before:f,after:e.title?" ":")",...l.current()}))),d(),e.title&&(d=n.enter(`title${o}`),f+=l.move(" "+a),f+=l.move(n.safe(e.title,{before:f,after:a,...l.current()})),f+=l.move(a),d()),f+=l.move(")"),c(),f}function LH(e,t,n){return cj(e,n)?"<":"["}fj.peek=zH;function fj(e,t,n,r){const a=e.referenceType,o=n.enter("linkReference");let l=n.enter("label");const c=n.createTracker(r);let d=c.move("[");const f=n.containerPhrasing(e,{before:d,after:"]",...c.current()});d+=c.move(f+"]["),l();const m=n.stack;n.stack=[],l=n.enter("reference");const g=n.safe(n.associationId(e),{before:d,after:"]",...c.current()});return l(),n.stack=m,o(),a==="full"||!f||f!==g?d+=c.move(g+"]"):a==="shortcut"?d=d.slice(0,-1):d+=c.move("]"),d}function zH(){return"["}function My(e){const t=e.options.bullet||"*";if(t!=="*"&&t!=="+"&&t!=="-")throw new Error("Cannot serialize items with `"+t+"` for `options.bullet`, expected `*`, `+`, or `-`");return t}function UH(e){const t=My(e),n=e.options.bulletOther;if(!n)return t==="*"?"-":"*";if(n!=="*"&&n!=="+"&&n!=="-")throw new Error("Cannot serialize items with `"+n+"` for `options.bulletOther`, expected `*`, `+`, or `-`");if(n===t)throw new Error("Expected `bullet` (`"+t+"`) and `bulletOther` (`"+n+"`) to be different");return n}function BH(e){const t=e.options.bulletOrdered||".";if(t!=="."&&t!==")")throw new Error("Cannot serialize items with `"+t+"` for `options.bulletOrdered`, expected `.` or `)`");return t}function hj(e){const t=e.options.rule||"*";if(t!=="*"&&t!=="-"&&t!=="_")throw new Error("Cannot serialize rules with `"+t+"` for `options.rule`, expected `*`, `-`, or `_`");return t}function VH(e,t,n,r){const a=n.enter("list"),o=n.bulletCurrent;let l=e.ordered?BH(n):My(n);const c=e.ordered?l==="."?")":".":UH(n);let d=t&&n.bulletLastUsed?l===n.bulletLastUsed:!1;if(!e.ordered){const m=e.children?e.children[0]:void 0;if((l==="*"||l==="-")&&m&&(!m.children||!m.children[0])&&n.stack[n.stack.length-1]==="list"&&n.stack[n.stack.length-2]==="listItem"&&n.stack[n.stack.length-3]==="list"&&n.stack[n.stack.length-4]==="listItem"&&n.indexStack[n.indexStack.length-1]===0&&n.indexStack[n.indexStack.length-2]===0&&n.indexStack[n.indexStack.length-3]===0&&(d=!0),hj(n)===l&&m){let g=-1;for(;++g<e.children.length;){const v=e.children[g];if(v&&v.type==="listItem"&&v.children&&v.children[0]&&v.children[0].type==="thematicBreak"){d=!0;break}}}}d&&(l=c),n.bulletCurrent=l;const f=n.containerFlow(e,r);return n.bulletLastUsed=l,n.bulletCurrent=o,a(),f}function FH(e){const t=e.options.listItemIndent||"one";if(t!=="tab"&&t!=="one"&&t!=="mixed")throw new Error("Cannot serialize items with `"+t+"` for `options.listItemIndent`, expected `tab`, `one`, or `mixed`");return t}function HH(e,t,n,r){const a=FH(n);let o=n.bulletCurrent||My(n);t&&t.type==="list"&&t.ordered&&(o=(typeof t.start=="number"&&t.start>-1?t.start:1)+(n.options.incrementListMarker===!1?0:t.children.indexOf(e))+o);let l=o.length+1;(a==="tab"||a==="mixed"&&(t&&t.type==="list"&&t.spread||e.spread))&&(l=Math.ceil(l/4)*4);const c=n.createTracker(r);c.move(o+" ".repeat(l-o.length)),c.shift(l);const d=n.enter("listItem"),f=n.indentLines(n.containerFlow(e,c.current()),m);return d(),f;function m(g,v,b){return v?(b?"":" ".repeat(l))+g:(b?o:o+" ".repeat(l-o.length))+g}}function qH(e,t,n,r){const a=n.enter("paragraph"),o=n.enter("phrasing"),l=n.containerPhrasing(e,r);return o(),a(),l}const GH=zf(["break","delete","emphasis","footnote","footnoteReference","image","imageReference","inlineCode","inlineMath","link","linkReference","mdxJsxTextElement","mdxTextExpression","strong","text","textDirective"]);function KH(e,t,n,r){return(e.children.some(function(l){return GH(l)})?n.containerPhrasing:n.containerFlow).call(n,e,r)}function $H(e){const t=e.options.strong||"*";if(t!=="*"&&t!=="_")throw new Error("Cannot serialize strong with `"+t+"` for `options.strong`, expected `*`, or `_`");return t}pj.peek=YH;function pj(e,t,n,r){const a=$H(n),o=n.enter("strong"),l=n.createTracker(r),c=l.move(a+a);let d=l.move(n.containerPhrasing(e,{after:a,before:c,...l.current()}));const f=d.charCodeAt(0),m=df(r.before.charCodeAt(r.before.length-1),f,a);m.inside&&(d=Tu(f)+d.slice(1));const g=d.charCodeAt(d.length-1),v=df(r.after.charCodeAt(0),g,a);v.inside&&(d=d.slice(0,-1)+Tu(g));const b=l.move(a+a);return o(),n.attentionEncodeSurroundingInfo={after:v.outside,before:m.outside},c+d+b}function YH(e,t,n){return n.options.strong||"*"}function WH(e,t,n,r){return n.safe(e.value,r)}function XH(e){const t=e.options.ruleRepetition||3;if(t<3)throw new Error("Cannot serialize rules with repetition `"+t+"` for `options.ruleRepetition`, expected `3` or more");return t}function QH(e,t,n){const r=(hj(n)+(n.options.ruleSpaces?" ":"")).repeat(XH(n));return n.options.ruleSpaces?r.slice(0,-1):r}const mj={blockquote:xH,break:nT,code:CH,definition:NH,emphasis:aj,hardBreak:nT,heading:OH,html:sj,image:oj,imageReference:lj,inlineCode:uj,link:dj,linkReference:fj,list:VH,listItem:HH,paragraph:qH,root:KH,strong:pj,text:WH,thematicBreak:QH};function JH(){return{enter:{table:ZH,tableData:rT,tableHeader:rT,tableRow:tq},exit:{codeText:nq,table:eq,tableData:Km,tableHeader:Km,tableRow:Km}}}function ZH(e){const t=e._align;this.enter({type:"table",align:t.map(function(n){return n==="none"?null:n}),children:[]},e),this.data.inTable=!0}function eq(e){this.exit(e),this.data.inTable=void 0}function tq(e){this.enter({type:"tableRow",children:[]},e)}function Km(e){this.exit(e)}function rT(e){this.enter({type:"tableCell",children:[]},e)}function nq(e){let t=this.resume();this.data.inTable&&(t=t.replace(/\\([\\|])/g,rq));const n=this.stack[this.stack.length-1];n.type,n.value=t,this.exit(e)}function rq(e,t){return t==="|"?t:e}function iq(e){const t=e||{},n=t.tableCellPadding,r=t.tablePipeAlign,a=t.stringLength,o=n?" ":"|";return{unsafe:[{character:"\r",inConstruct:"tableCell"},{character:`
50
+ `,inConstruct:"tableCell"},{atBreak:!0,character:"|",after:"[ :-]"},{character:"|",inConstruct:"tableCell"},{atBreak:!0,character:":",after:"-"},{atBreak:!0,character:"-",after:"[:|-]"}],handlers:{inlineCode:v,table:l,tableCell:d,tableRow:c}};function l(b,S,w,E){return f(m(b,w,E),b.align)}function c(b,S,w,E){const T=g(b,w,E),C=f([T]);return C.slice(0,C.indexOf(`
51
+ `))}function d(b,S,w,E){const T=w.enter("tableCell"),C=w.enter("phrasing"),k=w.containerPhrasing(b,{...E,before:o,after:o});return C(),T(),k}function f(b,S){return yH(b,{align:S,alignDelimiters:r,padding:n,stringLength:a})}function m(b,S,w){const E=b.children;let T=-1;const C=[],k=S.enter("table");for(;++T<E.length;)C[T]=g(E[T],S,w);return k(),C}function g(b,S,w){const E=b.children;let T=-1;const C=[],k=S.enter("tableRow");for(;++T<E.length;)C[T]=d(E[T],b,S,w);return k(),C}function v(b,S,w){let E=mj.inlineCode(b,S,w);return w.stack.includes("tableCell")&&(E=E.replace(/\|/g,"\\$&")),E}}function aq(){return{exit:{taskListCheckValueChecked:iT,taskListCheckValueUnchecked:iT,paragraph:oq}}}function sq(){return{unsafe:[{atBreak:!0,character:"-",after:"[:|-]"}],handlers:{listItem:lq}}}function iT(e){const t=this.stack[this.stack.length-2];t.type,t.checked=e.type==="taskListCheckValueChecked"}function oq(e){const t=this.stack[this.stack.length-2];if(t&&t.type==="listItem"&&typeof t.checked=="boolean"){const n=this.stack[this.stack.length-1];n.type;const r=n.children[0];if(r&&r.type==="text"){const a=t.children;let o=-1,l;for(;++o<a.length;){const c=a[o];if(c.type==="paragraph"){l=c;break}}l===n&&(r.value=r.value.slice(1),r.value.length===0?n.children.shift():n.position&&r.position&&typeof r.position.start.offset=="number"&&(r.position.start.column++,r.position.start.offset++,n.position.start=Object.assign({},r.position.start)))}}this.exit(e)}function lq(e,t,n,r){const a=e.children[0],o=typeof e.checked=="boolean"&&a&&a.type==="paragraph",l="["+(e.checked?"x":" ")+"] ",c=n.createTracker(r);o&&c.move(l);let d=mj.listItem(e,t,n,{...r,...c.current()});return o&&(d=d.replace(/^(?:[*+-]|\d+\.)([\r\n]| {1,3})/,f)),d;function f(m){return m+l}}function uq(){return[VF(),lH(),fH(),JH(),aq()]}function cq(e){return{extensions:[FF(),uH(e),hH(),iq(e),sq()]}}const dq={tokenize:vq,partial:!0},gj={tokenize:yq,partial:!0},vj={tokenize:bq,partial:!0},yj={tokenize:xq,partial:!0},fq={tokenize:Sq,partial:!0},bj={name:"wwwAutolink",tokenize:mq,previous:Sj},xj={name:"protocolAutolink",tokenize:gq,previous:wj},Fi={name:"emailAutolink",tokenize:pq,previous:Ej},pi={};function hq(){return{text:pi}}let ns=48;for(;ns<123;)pi[ns]=Fi,ns++,ns===58?ns=65:ns===91&&(ns=97);pi[43]=Fi;pi[45]=Fi;pi[46]=Fi;pi[95]=Fi;pi[72]=[Fi,xj];pi[104]=[Fi,xj];pi[87]=[Fi,bj];pi[119]=[Fi,bj];function pq(e,t,n){const r=this;let a,o;return l;function l(g){return!ov(g)||!Ej.call(r,r.previous)||Dy(r.events)?n(g):(e.enter("literalAutolink"),e.enter("literalAutolinkEmail"),c(g))}function c(g){return ov(g)?(e.consume(g),c):g===64?(e.consume(g),d):n(g)}function d(g){return g===46?e.check(fq,m,f)(g):g===45||g===95||jn(g)?(o=!0,e.consume(g),d):m(g)}function f(g){return e.consume(g),a=!0,d}function m(g){return o&&a&&Ln(r.previous)?(e.exit("literalAutolinkEmail"),e.exit("literalAutolink"),t(g)):n(g)}}function mq(e,t,n){const r=this;return a;function a(l){return l!==87&&l!==119||!Sj.call(r,r.previous)||Dy(r.events)?n(l):(e.enter("literalAutolink"),e.enter("literalAutolinkWww"),e.check(dq,e.attempt(gj,e.attempt(vj,o),n),n)(l))}function o(l){return e.exit("literalAutolinkWww"),e.exit("literalAutolink"),t(l)}}function gq(e,t,n){const r=this;let a="",o=!1;return l;function l(g){return(g===72||g===104)&&wj.call(r,r.previous)&&!Dy(r.events)?(e.enter("literalAutolink"),e.enter("literalAutolinkHttp"),a+=String.fromCodePoint(g),e.consume(g),c):n(g)}function c(g){if(Ln(g)&&a.length<5)return a+=String.fromCodePoint(g),e.consume(g),c;if(g===58){const v=a.toLowerCase();if(v==="http"||v==="https")return e.consume(g),d}return n(g)}function d(g){return g===47?(e.consume(g),o?f:(o=!0,d)):n(g)}function f(g){return g===null||lf(g)||At(g)||gs(g)||If(g)?n(g):e.attempt(gj,e.attempt(vj,m),n)(g)}function m(g){return e.exit("literalAutolinkHttp"),e.exit("literalAutolink"),t(g)}}function vq(e,t,n){let r=0;return a;function a(l){return(l===87||l===119)&&r<3?(r++,e.consume(l),a):l===46&&r===3?(e.consume(l),o):n(l)}function o(l){return l===null?n(l):t(l)}}function yq(e,t,n){let r,a,o;return l;function l(f){return f===46||f===95?e.check(yj,d,c)(f):f===null||At(f)||gs(f)||f!==45&&If(f)?d(f):(o=!0,e.consume(f),l)}function c(f){return f===95?r=!0:(a=r,r=void 0),e.consume(f),l}function d(f){return a||r||!o?n(f):t(f)}}function bq(e,t){let n=0,r=0;return a;function a(l){return l===40?(n++,e.consume(l),a):l===41&&r<n?o(l):l===33||l===34||l===38||l===39||l===41||l===42||l===44||l===46||l===58||l===59||l===60||l===63||l===93||l===95||l===126?e.check(yj,t,o)(l):l===null||At(l)||gs(l)?t(l):(e.consume(l),a)}function o(l){return l===41&&r++,e.consume(l),a}}function xq(e,t,n){return r;function r(c){return c===33||c===34||c===39||c===41||c===42||c===44||c===46||c===58||c===59||c===63||c===95||c===126?(e.consume(c),r):c===38?(e.consume(c),o):c===93?(e.consume(c),a):c===60||c===null||At(c)||gs(c)?t(c):n(c)}function a(c){return c===null||c===40||c===91||At(c)||gs(c)?t(c):r(c)}function o(c){return Ln(c)?l(c):n(c)}function l(c){return c===59?(e.consume(c),r):Ln(c)?(e.consume(c),l):n(c)}}function Sq(e,t,n){return r;function r(o){return e.consume(o),a}function a(o){return jn(o)?n(o):t(o)}}function Sj(e){return e===null||e===40||e===42||e===95||e===91||e===93||e===126||At(e)}function wj(e){return!Ln(e)}function Ej(e){return!(e===47||ov(e))}function ov(e){return e===43||e===45||e===46||e===95||jn(e)}function Dy(e){let t=e.length,n=!1;for(;t--;){const r=e[t][1];if((r.type==="labelLink"||r.type==="labelImage")&&!r._balanced){n=!0;break}if(r._gfmAutolinkLiteralWalkedInto){n=!1;break}}return e.length>0&&!n&&(e[e.length-1][1]._gfmAutolinkLiteralWalkedInto=!0),n}const wq={tokenize:Rq,partial:!0};function Eq(){return{document:{91:{name:"gfmFootnoteDefinition",tokenize:Aq,continuation:{tokenize:Nq},exit:jq}},text:{91:{name:"gfmFootnoteCall",tokenize:Cq},93:{name:"gfmPotentialFootnoteCall",add:"after",tokenize:Tq,resolveTo:kq}}}}function Tq(e,t,n){const r=this;let a=r.events.length;const o=r.parser.gfmFootnotes||(r.parser.gfmFootnotes=[]);let l;for(;a--;){const d=r.events[a][1];if(d.type==="labelImage"){l=d;break}if(d.type==="gfmFootnoteCall"||d.type==="labelLink"||d.type==="label"||d.type==="image"||d.type==="link")break}return c;function c(d){if(!l||!l._balanced)return n(d);const f=Fr(r.sliceSerialize({start:l.end,end:r.now()}));return f.codePointAt(0)!==94||!o.includes(f.slice(1))?n(d):(e.enter("gfmFootnoteCallLabelMarker"),e.consume(d),e.exit("gfmFootnoteCallLabelMarker"),t(d))}}function kq(e,t){let n=e.length;for(;n--;)if(e[n][1].type==="labelImage"&&e[n][0]==="enter"){e[n][1];break}e[n+1][1].type="data",e[n+3][1].type="gfmFootnoteCallLabelMarker";const r={type:"gfmFootnoteCall",start:Object.assign({},e[n+3][1].start),end:Object.assign({},e[e.length-1][1].end)},a={type:"gfmFootnoteCallMarker",start:Object.assign({},e[n+3][1].end),end:Object.assign({},e[n+3][1].end)};a.end.column++,a.end.offset++,a.end._bufferIndex++;const o={type:"gfmFootnoteCallString",start:Object.assign({},a.end),end:Object.assign({},e[e.length-1][1].start)},l={type:"chunkString",contentType:"string",start:Object.assign({},o.start),end:Object.assign({},o.end)},c=[e[n+1],e[n+2],["enter",r,t],e[n+3],e[n+4],["enter",a,t],["exit",a,t],["enter",o,t],["enter",l,t],["exit",l,t],["exit",o,t],e[e.length-2],e[e.length-1],["exit",r,t]];return e.splice(n,e.length-n+1,...c),e}function Cq(e,t,n){const r=this,a=r.parser.gfmFootnotes||(r.parser.gfmFootnotes=[]);let o=0,l;return c;function c(g){return e.enter("gfmFootnoteCall"),e.enter("gfmFootnoteCallLabelMarker"),e.consume(g),e.exit("gfmFootnoteCallLabelMarker"),d}function d(g){return g!==94?n(g):(e.enter("gfmFootnoteCallMarker"),e.consume(g),e.exit("gfmFootnoteCallMarker"),e.enter("gfmFootnoteCallString"),e.enter("chunkString").contentType="string",f)}function f(g){if(o>999||g===93&&!l||g===null||g===91||At(g))return n(g);if(g===93){e.exit("chunkString");const v=e.exit("gfmFootnoteCallString");return a.includes(Fr(r.sliceSerialize(v)))?(e.enter("gfmFootnoteCallLabelMarker"),e.consume(g),e.exit("gfmFootnoteCallLabelMarker"),e.exit("gfmFootnoteCall"),t):n(g)}return At(g)||(l=!0),o++,e.consume(g),g===92?m:f}function m(g){return g===91||g===92||g===93?(e.consume(g),o++,f):f(g)}}function Aq(e,t,n){const r=this,a=r.parser.gfmFootnotes||(r.parser.gfmFootnotes=[]);let o,l=0,c;return d;function d(S){return e.enter("gfmFootnoteDefinition")._container=!0,e.enter("gfmFootnoteDefinitionLabel"),e.enter("gfmFootnoteDefinitionLabelMarker"),e.consume(S),e.exit("gfmFootnoteDefinitionLabelMarker"),f}function f(S){return S===94?(e.enter("gfmFootnoteDefinitionMarker"),e.consume(S),e.exit("gfmFootnoteDefinitionMarker"),e.enter("gfmFootnoteDefinitionLabelString"),e.enter("chunkString").contentType="string",m):n(S)}function m(S){if(l>999||S===93&&!c||S===null||S===91||At(S))return n(S);if(S===93){e.exit("chunkString");const w=e.exit("gfmFootnoteDefinitionLabelString");return o=Fr(r.sliceSerialize(w)),e.enter("gfmFootnoteDefinitionLabelMarker"),e.consume(S),e.exit("gfmFootnoteDefinitionLabelMarker"),e.exit("gfmFootnoteDefinitionLabel"),v}return At(S)||(c=!0),l++,e.consume(S),S===92?g:m}function g(S){return S===91||S===92||S===93?(e.consume(S),l++,m):m(S)}function v(S){return S===58?(e.enter("definitionMarker"),e.consume(S),e.exit("definitionMarker"),a.includes(o)||a.push(o),at(e,b,"gfmFootnoteDefinitionWhitespace")):n(S)}function b(S){return t(S)}}function Nq(e,t,n){return e.check(Lu,t,e.attempt(wq,t,n))}function jq(e){e.exit("gfmFootnoteDefinition")}function Rq(e,t,n){const r=this;return at(e,a,"gfmFootnoteDefinitionIndent",5);function a(o){const l=r.events[r.events.length-1];return l&&l[1].type==="gfmFootnoteDefinitionIndent"&&l[2].sliceSerialize(l[1],!0).length===4?t(o):n(o)}}function _q(e){let n=(e||{}).singleTilde;const r={name:"strikethrough",tokenize:o,resolveAll:a};return n==null&&(n=!0),{text:{126:r},insideSpan:{null:[r]},attentionMarkers:{null:[126]}};function a(l,c){let d=-1;for(;++d<l.length;)if(l[d][0]==="enter"&&l[d][1].type==="strikethroughSequenceTemporary"&&l[d][1]._close){let f=d;for(;f--;)if(l[f][0]==="exit"&&l[f][1].type==="strikethroughSequenceTemporary"&&l[f][1]._open&&l[d][1].end.offset-l[d][1].start.offset===l[f][1].end.offset-l[f][1].start.offset){l[d][1].type="strikethroughSequence",l[f][1].type="strikethroughSequence";const m={type:"strikethrough",start:Object.assign({},l[f][1].start),end:Object.assign({},l[d][1].end)},g={type:"strikethroughText",start:Object.assign({},l[f][1].end),end:Object.assign({},l[d][1].start)},v=[["enter",m,c],["enter",l[f][1],c],["exit",l[f][1],c],["enter",g,c]],b=c.parser.constructs.insideSpan.null;b&&or(v,v.length,0,Pf(b,l.slice(f+1,d),c)),or(v,v.length,0,[["exit",g,c],["enter",l[d][1],c],["exit",l[d][1],c],["exit",m,c]]),or(l,f-1,d-f+3,v),d=f+v.length-2;break}}for(d=-1;++d<l.length;)l[d][1].type==="strikethroughSequenceTemporary"&&(l[d][1].type="data");return l}function o(l,c,d){const f=this.previous,m=this.events;let g=0;return v;function v(S){return f===126&&m[m.length-1][1].type!=="characterEscape"?d(S):(l.enter("strikethroughSequenceTemporary"),b(S))}function b(S){const w=Ao(f);if(S===126)return g>1?d(S):(l.consume(S),g++,b);if(g<2&&!n)return d(S);const E=l.exit("strikethroughSequenceTemporary"),T=Ao(S);return E._open=!T||T===2&&!!w,E._close=!w||w===2&&!!T,c(S)}}}class Oq{constructor(){this.map=[]}add(t,n,r){Mq(this,t,n,r)}consume(t){if(this.map.sort(function(o,l){return o[0]-l[0]}),this.map.length===0)return;let n=this.map.length;const r=[];for(;n>0;)n-=1,r.push(t.slice(this.map[n][0]+this.map[n][1]),this.map[n][2]),t.length=this.map[n][0];r.push(t.slice()),t.length=0;let a=r.pop();for(;a;){for(const o of a)t.push(o);a=r.pop()}this.map.length=0}}function Mq(e,t,n,r){let a=0;if(!(n===0&&r.length===0)){for(;a<e.map.length;){if(e.map[a][0]===t){e.map[a][1]+=n,e.map[a][2].push(...r);return}a+=1}e.map.push([t,n,r])}}function Dq(e,t){let n=!1;const r=[];for(;t<e.length;){const a=e[t];if(n){if(a[0]==="enter")a[1].type==="tableContent"&&r.push(e[t+1][1].type==="tableDelimiterMarker"?"left":"none");else if(a[1].type==="tableContent"){if(e[t-1][1].type==="tableDelimiterMarker"){const o=r.length-1;r[o]=r[o]==="left"?"center":"right"}}else if(a[1].type==="tableDelimiterRow")break}else a[0]==="enter"&&a[1].type==="tableDelimiterRow"&&(n=!0);t+=1}return r}function Iq(){return{flow:{null:{name:"table",tokenize:Pq,resolveAll:Lq}}}}function Pq(e,t,n){const r=this;let a=0,o=0,l;return c;function c(D){let B=r.events.length-1;for(;B>-1;){const ue=r.events[B][1].type;if(ue==="lineEnding"||ue==="linePrefix")B--;else break}const K=B>-1?r.events[B][1].type:null,se=K==="tableHead"||K==="tableRow"?R:d;return se===R&&r.parser.lazy[r.now().line]?n(D):se(D)}function d(D){return e.enter("tableHead"),e.enter("tableRow"),f(D)}function f(D){return D===124||(l=!0,o+=1),m(D)}function m(D){return D===null?n(D):De(D)?o>1?(o=0,r.interrupt=!0,e.exit("tableRow"),e.enter("lineEnding"),e.consume(D),e.exit("lineEnding"),b):n(D):Ze(D)?at(e,m,"whitespace")(D):(o+=1,l&&(l=!1,a+=1),D===124?(e.enter("tableCellDivider"),e.consume(D),e.exit("tableCellDivider"),l=!0,m):(e.enter("data"),g(D)))}function g(D){return D===null||D===124||At(D)?(e.exit("data"),m(D)):(e.consume(D),D===92?v:g)}function v(D){return D===92||D===124?(e.consume(D),g):g(D)}function b(D){return r.interrupt=!1,r.parser.lazy[r.now().line]?n(D):(e.enter("tableDelimiterRow"),l=!1,Ze(D)?at(e,S,"linePrefix",r.parser.constructs.disable.null.includes("codeIndented")?void 0:4)(D):S(D))}function S(D){return D===45||D===58?E(D):D===124?(l=!0,e.enter("tableCellDivider"),e.consume(D),e.exit("tableCellDivider"),w):N(D)}function w(D){return Ze(D)?at(e,E,"whitespace")(D):E(D)}function E(D){return D===58?(o+=1,l=!0,e.enter("tableDelimiterMarker"),e.consume(D),e.exit("tableDelimiterMarker"),T):D===45?(o+=1,T(D)):D===null||De(D)?j(D):N(D)}function T(D){return D===45?(e.enter("tableDelimiterFiller"),C(D)):N(D)}function C(D){return D===45?(e.consume(D),C):D===58?(l=!0,e.exit("tableDelimiterFiller"),e.enter("tableDelimiterMarker"),e.consume(D),e.exit("tableDelimiterMarker"),k):(e.exit("tableDelimiterFiller"),k(D))}function k(D){return Ze(D)?at(e,j,"whitespace")(D):j(D)}function j(D){return D===124?S(D):D===null||De(D)?!l||a!==o?N(D):(e.exit("tableDelimiterRow"),e.exit("tableHead"),t(D)):N(D)}function N(D){return n(D)}function R(D){return e.enter("tableRow"),P(D)}function P(D){return D===124?(e.enter("tableCellDivider"),e.consume(D),e.exit("tableCellDivider"),P):D===null||De(D)?(e.exit("tableRow"),t(D)):Ze(D)?at(e,P,"whitespace")(D):(e.enter("data"),L(D))}function L(D){return D===null||D===124||At(D)?(e.exit("data"),P(D)):(e.consume(D),D===92?H:L)}function H(D){return D===92||D===124?(e.consume(D),L):L(D)}}function Lq(e,t){let n=-1,r=!0,a=0,o=[0,0,0,0],l=[0,0,0,0],c=!1,d=0,f,m,g;const v=new Oq;for(;++n<e.length;){const b=e[n],S=b[1];b[0]==="enter"?S.type==="tableHead"?(c=!1,d!==0&&(aT(v,t,d,f,m),m=void 0,d=0),f={type:"table",start:Object.assign({},S.start),end:Object.assign({},S.end)},v.add(n,0,[["enter",f,t]])):S.type==="tableRow"||S.type==="tableDelimiterRow"?(r=!0,g=void 0,o=[0,0,0,0],l=[0,n+1,0,0],c&&(c=!1,m={type:"tableBody",start:Object.assign({},S.start),end:Object.assign({},S.end)},v.add(n,0,[["enter",m,t]])),a=S.type==="tableDelimiterRow"?2:m?3:1):a&&(S.type==="data"||S.type==="tableDelimiterMarker"||S.type==="tableDelimiterFiller")?(r=!1,l[2]===0&&(o[1]!==0&&(l[0]=l[1],g=wd(v,t,o,a,void 0,g),o=[0,0,0,0]),l[2]=n)):S.type==="tableCellDivider"&&(r?r=!1:(o[1]!==0&&(l[0]=l[1],g=wd(v,t,o,a,void 0,g)),o=l,l=[o[1],n,0,0])):S.type==="tableHead"?(c=!0,d=n):S.type==="tableRow"||S.type==="tableDelimiterRow"?(d=n,o[1]!==0?(l[0]=l[1],g=wd(v,t,o,a,n,g)):l[1]!==0&&(g=wd(v,t,l,a,n,g)),a=0):a&&(S.type==="data"||S.type==="tableDelimiterMarker"||S.type==="tableDelimiterFiller")&&(l[3]=n)}for(d!==0&&aT(v,t,d,f,m),v.consume(t.events),n=-1;++n<t.events.length;){const b=t.events[n];b[0]==="enter"&&b[1].type==="table"&&(b[1]._align=Dq(t.events,n))}return e}function wd(e,t,n,r,a,o){const l=r===1?"tableHeader":r===2?"tableDelimiter":"tableData",c="tableContent";n[0]!==0&&(o.end=Object.assign({},so(t.events,n[0])),e.add(n[0],0,[["exit",o,t]]));const d=so(t.events,n[1]);if(o={type:l,start:Object.assign({},d),end:Object.assign({},d)},e.add(n[1],0,[["enter",o,t]]),n[2]!==0){const f=so(t.events,n[2]),m=so(t.events,n[3]),g={type:c,start:Object.assign({},f),end:Object.assign({},m)};if(e.add(n[2],0,[["enter",g,t]]),r!==2){const v=t.events[n[2]],b=t.events[n[3]];if(v[1].end=Object.assign({},b[1].end),v[1].type="chunkText",v[1].contentType="text",n[3]>n[2]+1){const S=n[2]+1,w=n[3]-n[2]-1;e.add(S,w,[])}}e.add(n[3]+1,0,[["exit",g,t]])}return a!==void 0&&(o.end=Object.assign({},so(t.events,a)),e.add(a,0,[["exit",o,t]]),o=void 0),o}function aT(e,t,n,r,a){const o=[],l=so(t.events,n);a&&(a.end=Object.assign({},l),o.push(["exit",a,t])),r.end=Object.assign({},l),o.push(["exit",r,t]),e.add(n+1,0,o)}function so(e,t){const n=e[t],r=n[0]==="enter"?"start":"end";return n[1][r]}const zq={name:"tasklistCheck",tokenize:Bq};function Uq(){return{text:{91:zq}}}function Bq(e,t,n){const r=this;return a;function a(d){return r.previous!==null||!r._gfmTasklistFirstContentOfListItem?n(d):(e.enter("taskListCheck"),e.enter("taskListCheckMarker"),e.consume(d),e.exit("taskListCheckMarker"),o)}function o(d){return At(d)?(e.enter("taskListCheckValueUnchecked"),e.consume(d),e.exit("taskListCheckValueUnchecked"),l):d===88||d===120?(e.enter("taskListCheckValueChecked"),e.consume(d),e.exit("taskListCheckValueChecked"),l):n(d)}function l(d){return d===93?(e.enter("taskListCheckMarker"),e.consume(d),e.exit("taskListCheckMarker"),e.exit("taskListCheck"),c):n(d)}function c(d){return De(d)?t(d):Ze(d)?e.check({tokenize:Vq},t,n)(d):n(d)}}function Vq(e,t,n){return at(e,r,"whitespace");function r(a){return a===null?n(a):t(a)}}function Fq(e){return DN([hq(),Eq(),_q(e),Iq(),Uq()])}const Hq={};function qq(e){const t=this,n=e||Hq,r=t.data(),a=r.micromarkExtensions||(r.micromarkExtensions=[]),o=r.fromMarkdownExtensions||(r.fromMarkdownExtensions=[]),l=r.toMarkdownExtensions||(r.toMarkdownExtensions=[]);a.push(Fq(n)),o.push(uq()),l.push(cq(n))}function Ea({value:e,className:t}){return h.jsx("div",{className:t??"anima-markdown",children:h.jsx(_F,{remarkPlugins:[qq],components:{a:({node:n,...r})=>h.jsx("a",{...r,target:"_blank",rel:"noopener noreferrer",children:r.children})},children:e})})}function Yl(e){return!!e&&typeof e=="object"&&!Array.isArray(e)}function ff(e){const t={enabled:!1,every:"5m",target:"last",session:"main",model:"",prompt:"Check mission control, review queued work, and when NoxSoft MCP/chat is available, check in with Nox briefly before syncing continuity files.",activeStart:"",activeEnd:"",activeTimezone:"",ackMaxChars:"",includeReasoning:!1},n=e?.config;if(!Yl(n))return t;const r=Yl(n.agents)?n.agents:null,a=r&&Yl(r.defaults)?r.defaults:null,o=a&&Yl(a.heartbeat)?a.heartbeat:null;if(!o)return t;const l=Yl(o.activeHours)?o.activeHours:null;return{enabled:!0,every:typeof o.every=="string"?o.every:"",target:typeof o.target=="string"?o.target:"",session:typeof o.session=="string"?o.session:"",model:typeof o.model=="string"?o.model:"",prompt:typeof o.prompt=="string"?o.prompt:"",activeStart:l&&typeof l.start=="string"?l.start:"",activeEnd:l&&typeof l.end=="string"?l.end:"",activeTimezone:l&&typeof l.timezone=="string"?l.timezone:"",ackMaxChars:typeof o.ackMaxChars=="number"&&Number.isFinite(o.ackMaxChars)?String(o.ackMaxChars):"",includeReasoning:o.includeReasoning===!0}}function Tj(e){const t={includeReasoning:e.includeReasoning},n=e.every.trim(),r=e.target.trim(),a=e.session.trim(),o=e.model.trim(),l=e.prompt.trim(),c=e.activeStart.trim(),d=e.activeEnd.trim(),f=e.activeTimezone.trim(),m=e.ackMaxChars.trim();if(n&&(t.every=n),r&&(t.target=r),a&&(t.session=a),o&&(t.model=o),l&&(t.prompt=l),(c||d||f)&&(t.activeHours={...c?{start:c}:{},...d?{end:d}:{},...f?{timezone:f}:{}}),m){const g=Number.parseInt(m,10);if(!Number.isFinite(g)||g<0)throw new Error("Heartbeat ackMaxChars must be a non-negative integer.");t.ackMaxChars=g}return{agents:{defaults:{heartbeat:t}}}}const Gq=my(),Kq=/\[\[\s*(?:reply_to_current|reply_to\s*:[^\]\n]*|audio_as_voice)\s*\]\]/gi;function sT(e){const t=[];return{text:e.replace(Kq,r=>{const a=r.replace(/[[\]\s]/g,"").trim();return t.push({tag:a,raw:r.trim()}),""}).replace(/[ \t]+/g," ").trim(),directives:t}}const Ed="main",oT=3,lT="Persistent NoxSoft agent orchestrating ANIMA continuity, mission control, and delivery.";function rs(e){return e&&typeof e=="object"&&!Array.isArray(e)?e:null}function $m(e,t,n=""){const r=e?.[t];return typeof r=="string"?r:n}function Ym(e,t,n=!1){const r=e?.[t];return typeof r=="boolean"?r:n}function $q(e,t,n){const r=e?.[t];return typeof r=="number"&&Number.isFinite(r)?r:n}function uT(e){const t=rs(e?.config),n=rs(t?.agents),r=rs(n?.defaults),a=rs(r?.memorySearch),o=rs(a?.experimental),l=rs(r?.compaction),c=rs(l?.memoryFlush),d=Array.isArray(a?.extraPaths)?a?.extraPaths.filter(f=>typeof f=="string"):[];return{searchEnabled:Ym(a,"enabled",!0),provider:$m(a,"provider","openai"),sessionMemory:Ym(o,"sessionMemory",!1),extraPaths:d.join(", "),memoryFlushEnabled:Ym(c,"enabled",!0),memoryFlushPrompt:$m(c,"prompt"),memoryFlushSystemPrompt:$m(c,"systemPrompt"),browseLimit:$q(a,"browseLimit",200)}}function ss(){return typeof crypto<"u"&&typeof crypto.randomUUID=="function"?crypto.randomUUID():`id-${Date.now()}-${Math.random().toString(36).slice(2)}`}function So(e){if(!e)return"";if(typeof e=="string")return e;if(Array.isArray(e))return e.map(t=>So(t)).join(`
52
+ `).trim();if(typeof e=="object"){const t=e;if(typeof t.text=="string"||t.type==="text"&&typeof t.text=="string")return t.text;if("message"in t)return So(t.message);if("content"in t)return So(t.content)}return""}function Yq(e,t){const n=t.replace(/\r/g,"");if(!n)return e;if(!e||n===e||n.startsWith(e)||n.includes(e))return n;const r=Math.min(e.length,n.length);for(let a=r;a>0;a-=1)if(e.slice(-a)===n.slice(0,a))return`${e}${n.slice(a)}`;return`${e}${n}`}function Wq(e){return Array.isArray(e)?e.map(t=>{if(!t||typeof t!="object")return null;const n=t;if(n.role!=="user"&&n.role!=="assistant")return null;const r=So(n.content).trim();return r?{id:ss(),role:n.role,text:r,timestamp:typeof n.timestamp=="number"?n.timestamp:Date.now()}:null}).filter(t=>!!t):[]}function eu(e){if(!e)return"never";const t=typeof e=="number"?e:new Date(e).getTime();if(!Number.isFinite(t))return"unknown";const n=Date.now()-t,r=Math.round(n/6e4);if(Math.abs(r)<1)return"just now";if(Math.abs(r)<60)return`${r}m ago`;const a=Math.round(r/60);return Math.abs(a)<24?`${a}h ago`:`${Math.round(a/24)}d ago`}function Xq(e){const t=e.trim();if(!t)return"subagent";const n=":subagent:",r=t.lastIndexOf(n);return r>=0?`subagent:${t.slice(r+n.length)}`:t.length>56?`${t.slice(0,53)}...`:t}function Er(e){const t=e.tone??"accent";return h.jsx("span",{className:`badge badge-${t}`,children:e.label})}const Sr={wrapper:{borderRadius:"0.5rem",overflow:"hidden"},header:{display:"flex",alignItems:"center",justifyContent:"space-between",padding:"0.75rem 1rem",cursor:"pointer",userSelect:"none",gap:"0.75rem",borderBottom:"1px solid transparent"},headerOpen:{borderBottomColor:"var(--color-border, rgba(255,255,255,0.08))"},headerLeft:{display:"flex",alignItems:"center",gap:"0.5rem",minWidth:0,flex:1},chevron:{transition:"transform 0.2s ease",fontSize:"0.75rem",color:"var(--color-text-muted, #888)",flexShrink:0},chevronOpen:{transform:"rotate(90deg)"},title:{fontSize:"0.875rem",fontWeight:600,color:"var(--color-text, #e0e0e0)"},badge:{flexShrink:0},body:{display:"grid",gridTemplateRows:"0fr",overflow:"hidden",transition:"grid-template-rows 0.25s ease, opacity 0.2s ease"},bodyOpen:{gridTemplateRows:"1fr",opacity:1},bodyClosed:{gridTemplateRows:"0fr",opacity:0},bodyInner:{padding:"0.75rem 1rem 1rem",minHeight:0,overflow:"hidden"}};function wr(e){const[t,n]=_.useState(e.defaultOpen??!1);return h.jsxs("div",{className:e.className||"card",style:Sr.wrapper,children:[h.jsxs("div",{style:{...Sr.header,...t?Sr.headerOpen:{}},onClick:()=>n(r=>!r),role:"button",tabIndex:0,onKeyDown:r=>{(r.key==="Enter"||r.key===" ")&&(r.preventDefault(),n(a=>!a))},children:[h.jsxs("div",{style:Sr.headerLeft,children:[h.jsx("span",{style:{...Sr.chevron,...t?Sr.chevronOpen:{}},children:"▶"}),h.jsx("span",{style:Sr.title,children:e.title})]}),h.jsxs("div",{style:Sr.badge,children:[e.badge,e.headerRight]})]}),h.jsx("div",{style:{...Sr.body,...t?Sr.bodyOpen:Sr.bodyClosed},children:h.jsx("div",{style:Sr.bodyInner,children:e.children})})]})}function Pn(e){return h.jsxs("div",{className:"runtime-stat",children:[h.jsx("div",{className:"runtime-stat-label",children:e.label}),h.jsx("div",{className:"runtime-stat-value",children:e.value}),e.detail?h.jsx("div",{className:"runtime-stat-detail",children:e.detail}):null]})}function Qq(e){return h.jsx("div",{className:"segmented-control",children:["read","write"].map(t=>h.jsx("button",{type:"button",className:`segment ${e.value===t?"active":""}`,disabled:e.busy,onClick:()=>e.onChange(t),children:t.toUpperCase()},t))})}function Jq({subagents:e}){return e?h.jsxs("div",{className:"card",children:[h.jsxs("div",{className:"card-header",children:[h.jsxs("div",{children:[h.jsx("div",{className:"card-title",children:"Subagents"}),h.jsx("div",{className:"card-subtitle",children:"Native orchestration visibility"})]}),h.jsx(Er,{label:`${e.total} tracked`})]}),h.jsxs("div",{className:"stats-grid compact",children:[h.jsx(Pn,{label:"Active",value:String(e.active)}),h.jsx(Pn,{label:"Recent",value:String(e.recent)}),h.jsx(Pn,{label:"Failed",value:String(e.failed)})]}),e.latest.length===0?h.jsx("div",{className:"empty-note",children:"No subagent activity yet."}):h.jsx("div",{className:"activity-list",children:e.latest.map(t=>h.jsxs("div",{className:"activity-row",children:[h.jsxs("div",{children:[h.jsx("div",{className:"mono subtle",children:Xq(t.key)}),h.jsx("div",{className:"runtime-stat-detail",children:eu(t.updatedAt)})]}),h.jsx(Er,{tone:t.status==="failed"?"error":t.status==="active"?"success":t.status==="recent"?"accent":"warning",label:t.status})]},`${t.key}:${t.updatedAt??"none"}`))})]}):null}function Zq({tools:e}){const[t,n]=_.useState(!1),r=e.filter(o=>o.status==="done").length,a=e.filter(o=>o.status==="error").length;return h.jsxs("div",{className:"tool-activity-panel",children:[h.jsxs("button",{type:"button",className:"tool-activity-toggle",onClick:()=>n(o=>!o),children:[h.jsx("span",{className:"tool-activity-icon",children:t?"▾":"▸"}),h.jsxs("span",{className:"tool-activity-summary",children:[e.length," tool",e.length!==1?"s":""," used",a>0&&h.jsxs("span",{className:"tool-count-error",children:[" · ",a," failed"]}),r>0&&!a&&h.jsx("span",{className:"tool-count-ok",children:" · all succeeded"})]})]}),t&&h.jsx("div",{className:"tool-activity-list",children:e.map(o=>h.jsx(e9,{tool:o},o.id))})]})}function e9({tool:e}){const[t,n]=_.useState(!1),r=e.status==="done"?"✓":e.status==="error"?"✗":"◌",a=e.status==="done"?"success":e.status==="error"?"error":"running";return h.jsxs("div",{className:`tool-activity-item ${a}`,children:[h.jsxs("button",{type:"button",className:"tool-activity-item-header",onClick:()=>n(o=>!o),children:[h.jsx("span",{className:`tool-status-icon ${a}`,children:r}),h.jsx("span",{className:"tool-name",children:e.name}),(e.input||e.result)&&h.jsx("span",{className:"tool-detail-toggle",children:t?"▾":"▸"})]}),t&&(e.input||e.result)&&h.jsxs("div",{className:"tool-detail-body",children:[e.input&&h.jsxs("div",{className:"tool-detail-section",children:[h.jsx("div",{className:"tool-detail-label",children:"Input"}),h.jsx("pre",{className:"tool-detail-pre",children:e.input})]}),e.result&&h.jsxs("div",{className:"tool-detail-section",children:[h.jsx("div",{className:"tool-detail-label",children:"Result"}),h.jsx("pre",{className:"tool-detail-pre",children:e.result})]})]})]})}function t9({runId:e,activity:t}){const n=e?t.get(e):void 0;return!n||n.length===0?null:h.jsx("div",{className:"live-tool-activity",children:n.map(r=>h.jsxs("div",{className:`live-tool-chip ${r.status}`,children:[h.jsx("span",{className:"live-tool-dot"}),h.jsx("span",{className:"live-tool-name",children:r.name})]},r.id))})}function n9({directives:e}){return h.jsx("div",{className:"directive-badges",children:e.map((t,n)=>h.jsx("span",{className:"directive-badge",title:t.raw,children:t.tag.replace(/_/g," ")},n))})}function r9(){const[e,t]=_.useState(null),[n,r]=_.useState(null),[a,o]=_.useState(null),[l,c]=_.useState(null),[d,f]=_.useState(()=>ff(null)),[m,g]=_.useState(`{
53
+ }
54
+ `),[v,b]=_.useState({token:"",inviteCode:"",agentName:"",displayName:"",description:lT}),[S,w]=_.useState(null),[E,T]=_.useState(""),[C,k]=_.useState(()=>uT(null)),[j,N]=_.useState(null),[R,P]=_.useState(null),[L,H]=_.useState(null),[D,B]=_.useState(null),[K,se]=_.useState(!1),[ue,Z]=_.useState(!1),[V,X]=_.useState(!1),[le,ye]=_.useState(!1),[M,z]=_.useState(!1),[W,I]=_.useState(!1),[fe,ge]=_.useState("Check chat.noxsoft.net, sync mission control, and report anything needing action."),[Se,we]=_.useState(!1),[Pe,je]=_.useState([]),[ve,Le]=_.useState(""),[xt,Ot]=_.useState(null),[We,Nt]=_.useState(!1),[lt,Bt]=_.useState(""),[$t,Jt]=_.useState(!1),[mt,st]=_.useState(!1),[Mn,Ue]=_.useState(null),[Me,Q]=_.useState([]),[q,ae]=_.useState(new Map),Te=_.useRef(new Map);_.useEffect(()=>{Te.current=q},[q]);const Ee=_.useRef(null),Be=_.useRef(new Map),ut=_.useRef(null),Yt=_.useRef(null),gt=_.useRef(null),Lt=_.useRef(""),U=_.useRef(null),Y=_.useRef(null),xe=_.useRef(new Set),Ge=n?.assistant?.name?.trim()||a?.agent?.display_name||"ANIMA",Zt=n?.mission?.state?.workingMode??"write",Mr=n?.mission?.repo??n?.mission?.state?.repo,Ft=n?.mission?.state?.speech,hn=_.useCallback(async()=>{se(!0);try{const[$,me,nt,vt,en,ur,kn]=await Promise.all([lN(),dN(),fN(),uN(),g1().catch(()=>null),yN().catch(()=>null),gN().catch(()=>({triggers:[]}))]);t($),r(me),o(nt),c(vt),g(typeof vt.raw=="string"?vt.raw:`{
55
+ }
56
+ `),f(ff(vt)),b({token:nt.tokenPreview||"",inviteCode:"",agentName:nt.suggestedIdentity.name,displayName:nt.suggestedIdentity.displayName,description:lT}),w(ur),T(kn.triggers.join(", ")),k(uT(vt)),N(me.mission.state.autoToggle),en&&P(en),H(null)}catch($){H($ instanceof Error?$.message:String($))}finally{se(!1),Z(!0)}},[]),$r=_.useRef(void 0);_.useEffect(()=>{$r.current=R?.cursor},[R?.cursor]);const Da=_.useCallback(async()=>{try{const $=await g1($r.current);P(me=>!me||$.reset?$:{...$,lines:[...me.lines,...$.lines].slice(-320)})}catch{}},[]);_.useEffect(()=>{hn();const $=window.setInterval(()=>{hn()},15e3),me=window.setInterval(()=>{Da()},4e3);return()=>{window.clearInterval($),window.clearInterval(me)}},[hn,Da]),_.useEffect(()=>{Lt.current=lt},[lt]),_.useEffect(()=>{U.current?.scrollIntoView({behavior:"smooth",block:"end"})},[Pe,lt]),_.useEffect(()=>{if(typeof window>"u")return;const $=window.speechSynthesis;if(!$)return;const me=()=>{const nt=$.getVoices().map(vt=>vt.name).filter(Boolean);Q(nt)};return me(),$.addEventListener?.("voiceschanged",me),()=>$.removeEventListener?.("voiceschanged",me)},[]),_.useEffect(()=>{if(typeof window>"u")return;const $=window.SpeechRecognition||window.webkitSpeechRecognition;if(!$){Jt(!1),Y.current=null;return}Jt(!0);const me=new $;me.continuous=Ft?.continuous??!0,me.interimResults=!0,me.lang=Ft?.lang||"en-US";const nt=ur=>{const kn=ur;let cr="";for(let pn=0;pn<kn.results.length;pn+=1){const Dr=kn.results[pn]?.[0];Dr?.transcript&&(cr+=Dr.transcript)}cr.trim()&&Le(cr.trim())},vt=ur=>{Ue(ur.error||"Voice capture failed."),st(!1)},en=()=>{st(!1)};return me.addEventListener("result",nt),me.addEventListener("error",vt),me.addEventListener("end",en),Y.current=me,()=>{me.removeEventListener("result",nt),me.removeEventListener("error",vt),me.removeEventListener("end",en),me.stop(),Y.current=null}},[Ft?.continuous,Ft?.lang]),_.useEffect(()=>{if(!Ft?.autoSpeak||typeof window>"u"||!window.speechSynthesis)return;const $=Pe.toReversed().find(nt=>nt.role==="assistant");if(!$||xe.current.has($.id))return;const me=new SpeechSynthesisUtterance($.text);if(me.lang=Ft.lang||"en-US",me.rate=Ft.rate||1,me.pitch=Ft.pitch||1,Ft.voiceName){const nt=window.speechSynthesis.getVoices().find(vt=>vt.name===Ft.voiceName);nt&&(me.voice=nt)}xe.current.add($.id),window.speechSynthesis.cancel(),window.speechSynthesis.speak(me)},[Pe,Ft]);const Yr=_.useMemo(()=>function(me,nt){const vt=Ee.current;if(!vt||vt.readyState!==WebSocket.OPEN)return Promise.reject(new Error("Gateway websocket is not connected"));const en=ss(),ur={type:"req",id:en,method:me,params:nt};return new Promise((kn,cr)=>{Be.current.set(en,{resolve:kn,reject:pn=>cr(pn)});try{vt.send(JSON.stringify(ur))}catch(pn){Be.current.delete(en),cr(pn instanceof Error?pn:new Error(String(pn)))}})},[]);_.useEffect(()=>{let $=!1,me=!1,nt=!1,vt;function en(Ve){for(const Fe of Be.current.values())Fe.reject(new Error(Ve));Be.current.clear()}async function ur(){try{const Ve=await Yr("chat.history",{sessionKey:Ed,limit:120});if($)return;je(Wq(Ve?.messages))}catch(Ve){$||Ot(Ve instanceof Error?Ve.message:String(Ve))}}async function kn(){if($||me||nt)return;const Ve=Ee.current;if(!(!Ve||Ve.readyState!==WebSocket.OPEN)){me=!0;try{const Fe=gy();if(!Fe)throw new Error("Gateway token missing. Re-open this page once with ?token=ANIMA_GATEWAY_TOKEN.");const ct=await py({minProtocol:oT,maxProtocol:oT,client:{id:"anima-control-ui",version:"1.0.0",platform:"web",mode:"webchat"},scopes:["operator.read","operator.admin"],caps:[],auth:Fe,nonce:vt});if(await Yr("connect",ct),$)return;nt=!0,we(!0),Ot(null),ur()}catch(Fe){if(!$){we(!1);const ct=Fe instanceof Error?Fe.message:String(Fe);ct!=="Gateway websocket is not connected"&&Ot(ct)}}finally{me=!1}}}function cr(){$||ut.current!==null||(ut.current=window.setTimeout(()=>{ut.current=null,$||Dr()},1500))}function pn(Ve){if(Ve.sessionKey&&Ve.sessionKey!==Ed)return;const Fe=Ve.runId;if(Fe){if(Ve.stream==="tool"){const ct=Ve.data||{},Mt=typeof ct.name=="string"?ct.name:typeof ct.tool=="string"?ct.tool:"";if(!Mt)return;const Wt=typeof ct.phase=="string"?ct.phase:"",Vn=ct.input?typeof ct.input=="string"?ct.input:JSON.stringify(ct.input,null,2):void 0,gi=ct.result?typeof ct.result=="string"?ct.result:JSON.stringify(ct.result,null,2):void 0;ae(Xr=>{const Hi=Xr.get(Fe)||[];if(Wt==="start"||Wt==="call")return new Map(Xr).set(Fe,[...Hi,{id:ss(),name:Mt,input:Vn,status:"running",timestamp:Date.now()}]);const Pa=[...Hi],vi=Pa.findLastIndex(La=>La.name===Mt&&La.status==="running");return vi>=0&&(Pa[vi]={...Pa[vi],status:Wt==="error"?"error":"done",result:gi||Pa[vi].result}),new Map(Xr).set(Fe,Pa)})}Ve.stream==="lifecycle"&&(typeof Ve.data?.phase=="string"?Ve.data.phase:"")==="start"&&ae(Mt=>new Map(Mt).set(Fe,[]))}}function mi(Ve){if(!(Ve.sessionKey&&Ve.sessionKey!==Ed)){if(Ve.state==="delta"){const Fe=So(Ve.message);Fe&&Bt(ct=>Yq(ct,Fe));return}if(Ve.state==="final"){const Fe=gt.current;if(Ve.runId&&Fe&&Ve.runId!==Fe)return;const ct=So(Ve.message).trim()||Lt.current.trim(),{text:Mt,directives:Wt}=sT(ct),Vn=Ve.runId||gt.current||void 0,gi=Vn?Te.current.get(Vn):void 0;(Mt||gi&&gi.length>0)&&je(Xr=>[...Xr,{id:ss(),role:"assistant",text:Mt,timestamp:Date.now(),directives:Wt.length>0?Wt:void 0,toolActivity:gi&&gi.length>0?gi:void 0,runId:Vn||void 0}]),Vn&&ae(Xr=>{const Hi=new Map(Xr);return Hi.delete(Vn),Hi}),gt.current=null,Nt(!1),Bt("");return}if(Ve.state==="error"){const Fe=Ve.errorMessage||"Chat run failed";Ot(Fe),je(ct=>[...ct,{id:ss(),role:"assistant",text:`Error: ${Fe}`,timestamp:Date.now()}]),gt.current=null,Nt(!1),Bt("");return}Ve.state==="aborted"&&(gt.current=null,Nt(!1),Bt(""))}}function Dr(){me=!1,nt=!1,vt=void 0;const Ve=new WebSocket(Gq);Ee.current=Ve,we(!1),Ve.addEventListener("open",()=>{Yt.current&&window.clearTimeout(Yt.current),Yt.current=window.setTimeout(()=>{Yt.current=null,kn()},300)}),Ve.addEventListener("message",Fe=>{let ct;try{ct=JSON.parse(String(Fe.data))}catch{return}const Mt=ct;if(Mt.type==="res"){const Wt=Be.current.get(Mt.id);if(!Wt)return;Be.current.delete(Mt.id),Mt.ok?Wt.resolve(Mt.payload):Wt.reject(new Error(Mt.error?.message||"Gateway request failed"));return}if(Mt.type==="event"){if(Mt.event==="connect.challenge"){const Wt=hy(Mt.payload);Wt&&(vt=Wt),kn();return}Mt.event==="chat"&&mi(Mt.payload||{}),Mt.event==="agent"&&pn(Mt.payload||{})}}),Ve.addEventListener("error",()=>{Ot("Websocket error while connecting to ANIMA gateway")}),Ve.addEventListener("close",()=>{me=!1,nt=!1,we(!1),en("Gateway websocket closed"),cr()})}return Dr(),()=>{$=!0,Yt.current&&window.clearTimeout(Yt.current),ut.current&&window.clearTimeout(ut.current),en("Dashboard shutting down"),Ee.current?.close(),Ee.current=null}},[Yr]);const xs=_.useCallback(async $=>{try{const me=await wa({speech:$});n&&r({...n,mission:{...n.mission,state:{...n.mission.state,speech:me.speech}}})}catch(me){B(me instanceof Error?me.message:String(me))}},[n]);async function Hu($){$.preventDefault();const me=ve.trim();if(!me||We)return;const nt=Ee.current;if(!nt||nt.readyState!==WebSocket.OPEN){Ot("Gateway websocket is not connected");return}const vt=ss();gt.current=vt,je(en=>[...en,{id:ss(),role:"user",text:me,timestamp:Date.now()}]),Le(""),Nt(!0),Bt(""),Ot(null);try{await Yr("chat.send",{sessionKey:Ed,message:me,deliver:!1,idempotencyKey:vt})}catch(en){Ot(en instanceof Error?en.message:String(en)),Nt(!1),Bt(""),gt.current=null}}async function Vo($){X(!0),B(null);try{await $U($),await hn(),B(`Working mode set to ${$}.`)}catch(me){B(me instanceof Error?me.message:String(me))}finally{X(!1)}}async function Ia(){if(!l?.hash){B("Config hash missing. Refresh the dashboard and try again.");return}ye(!0),B(null);try{await Yg(JSON.stringify(Tj(d),null,2),l.hash),await hn(),B("Heartbeat settings updated.")}catch($){B($ instanceof Error?$.message:String($))}finally{ye(!1)}}async function Hf($){z(!0),B(null);try{await Wg($),await hn(),B($?"Heartbeat enabled.":"Heartbeat disabled.")}catch(me){B(me instanceof Error?me.message:String(me))}finally{z(!1)}}async function Fo($){B(null);try{const me=fe.trim()||"Check NoxSoft chat, mission control, and continuity status.";await mN(me,$),B($==="now"?"Heartbeat wake sent immediately.":"Wake queued for the next heartbeat.")}catch(me){B(me instanceof Error?me.message:String(me))}}async function qu(){I(!0),B(null);try{v.token.trim()&&await hN(v.token.trim()),v.inviteCode.trim()&&await pN({code:v.inviteCode.trim(),name:v.agentName.trim()||void 0,displayName:v.displayName.trim()||void 0,description:v.description.trim()||void 0}),await hn(),B("Registration settings updated.")}catch($){B($ instanceof Error?$.message:String($))}finally{I(!1)}}async function Gu(){if(S){I(!0),B(null);try{await Xg(S.providers.map($=>({id:$.id,name:$.name,enabled:$.enabled,priority:$.priority}))),await bN(S.autoRotation),await hn(),B("Provider settings updated.")}catch($){B($ instanceof Error?$.message:String($))}finally{I(!1)}}}async function Ho(){I(!0),B(null);try{const $=E.split(",").map(me=>me.trim()).filter(Boolean);await vN($),await hn(),B("Voice wake settings updated.")}catch($){B($ instanceof Error?$.message:String($))}finally{I(!1)}}async function qo(){if(!l?.hash){B("Config hash missing. Refresh the dashboard and try again.");return}I(!0),B(null);try{await Yg(JSON.stringify({agents:{defaults:{memorySearch:{enabled:C.searchEnabled,provider:C.provider.trim()||"openai",browseLimit:Math.max(1,Math.floor(C.browseLimit||200)),extraPaths:C.extraPaths.split(",").map($=>$.trim()).filter(Boolean),experimental:{sessionMemory:C.sessionMemory}},compaction:{memoryFlush:{enabled:C.memoryFlushEnabled,prompt:C.memoryFlushPrompt.trim()||void 0,systemPrompt:C.memoryFlushSystemPrompt.trim()||void 0}}}}},null,2),l.hash),await hn(),B("Memory settings updated.")}catch($){B($ instanceof Error?$.message:String($))}finally{I(!1)}}async function Ku(){if(j){I(!0),B(null);try{await wa({autoToggle:j}),await hn(),B("Auto-toggle policy updated.")}catch($){B($ instanceof Error?$.message:String($))}finally{I(!1)}}}async function Go($){if(!l?.hash){B("Config hash missing. Refresh the dashboard and try again.");return}I(!0),B(null);try{await cN(m,l.hash,$),await hn(),B($?"Raw config saved and applied.":"Raw config saved.")}catch(me){B(me instanceof Error?me.message:String(me))}finally{I(!1)}}function Wr(){if(!Y.current){Ue("Browser speech recognition is not available here.");return}Ue(null),st(!0),Y.current.start()}function un(){Y.current?.stop(),st(!1)}return ue?L&&!n&&!e?h.jsxs("div",{children:[h.jsx("h1",{className:"page-title",children:"Assistant Home"}),h.jsxs("div",{className:"card empty-state-card",children:[h.jsx("div",{className:"empty-state-symbol",children:"!"}),h.jsx("div",{className:"empty-state-copy",children:"Unable to reach gateway"}),h.jsx("div",{className:"runtime-stat-detail",style:{marginTop:"0.5rem"},children:L}),h.jsxs("div",{className:"runtime-stat-detail",style:{marginTop:"1rem"},children:["Make sure the daemon is running with ",h.jsx("code",{children:"anima start"})," and that the gateway is accessible. If connecting via browser, verify the URL includes"," ",h.jsx("code",{children:"?token=YOUR_TOKEN"}),"."]})]})]}):h.jsxs("div",{children:[h.jsxs("div",{className:"page-header-row",children:[h.jsxs("div",{children:[h.jsxs("h1",{className:"page-title",children:[Ge," Home"]}),h.jsx("div",{className:"page-subtitle",children:"Local mission control, heartbeat orchestration, and direct gateway chat."})]}),h.jsxs("div",{style:{display:"flex",alignItems:"center",gap:"0.75rem"},children:[h.jsx("span",{className:`status-chip ${L?"offline":"online"}`,children:L?"Gateway unreachable":"Gateway connected"}),h.jsx("button",{type:"button",className:"action-button ghost",onClick:()=>{hn()},children:K?"Refreshing...":"Refresh"})]})]}),h.jsxs("div",{className:"hero-grid",children:[h.jsxs("div",{className:"card identity-hero",children:[h.jsx("div",{className:"identity-badge",children:n?.assistant.avatar||"A"}),h.jsxs("div",{children:[h.jsx("div",{className:"card-title",children:Ge}),h.jsx("div",{className:"card-subtitle mono",children:n?.assistant.agentId||a?.agent?.name||"main"}),h.jsxs("div",{className:"badge-row top-gap",children:[h.jsx(Er,{tone:e?.heartbeat.running?"success":"warning",label:e?.heartbeat.running?"heartbeat live":"heartbeat idle"}),h.jsx(Er,{tone:a?.agent?"accent":"warning",label:a?.agent?"registered":"not registered"}),h.jsx(Er,{tone:Mr?.remoteConfigured?"success":"warning",label:Mr?.remoteConfigured?"repo linked":"repo pending"})]})]})]}),h.jsxs("div",{className:"card",children:[h.jsxs("div",{className:"card-header compact",children:[h.jsxs("div",{children:[h.jsx("div",{className:"card-title",children:"Working Mode"}),h.jsx("div",{className:"card-subtitle",children:"Control whether ANIMA is in read-only or write-capable mode."})]}),h.jsx(Qq,{value:Zt,busy:V,onChange:Vo})]}),h.jsxs("div",{className:"runtime-stat-detail top-gap",children:["Session security:"," ",h.jsx("span",{className:"mono",children:n?.mainSession.execSecurity??"unknown"})," · Ask policy: ",h.jsx("span",{className:"mono",children:n?.mainSession.execAsk??"unknown"})]})]})]}),D?h.jsx("div",{className:"card status-banner",children:h.jsx("div",{children:D})}):null,h.jsxs("div",{className:"stats-grid compact",style:{marginBottom:"1.5rem"},children:[h.jsx(Pn,{label:"Heartbeat",value:e?.heartbeat.running?"Live":"Idle",detail:e?.heartbeat.lastBeat?`Last: ${eu(e.heartbeat.lastBeat)}`:"No beats yet"}),h.jsx(Pn,{label:"Mode",value:Zt.toUpperCase(),detail:`Security: ${n?.mainSession.execSecurity??"unknown"}`}),h.jsx(Pn,{label:"Gateway",value:Se?"Connected":"Disconnected",detail:`${Pe.length} messages`}),h.jsx(Pn,{label:"Providers",value:String(S?.providers.filter($=>$.enabled).length??0),detail:`of ${S?.providers.length??0} configured`}),h.jsx(Pn,{label:"Subagents",value:String(e?.subagents?.active??0),detail:`${e?.subagents?.total??0} tracked`}),h.jsx(Pn,{label:"Queued Events",value:String(n?.queuedSystemEvents.length??0)})]}),h.jsxs("div",{className:"dashboard-grid",children:[h.jsx("div",{className:"dashboard-main-column",children:h.jsxs(wr,{title:`Talk to ${Ge}`,badge:h.jsx("span",{className:`status-chip ${Se?"online":"offline"}`,children:Se?"Connected":"Reconnecting"}),className:"card live-chat-card",children:[h.jsxs("div",{className:"live-chat-feed",children:[Pe.length===0&&!lt?h.jsx("div",{className:"empty-note",children:"Conversation history is empty. Send a message to begin."}):null,Pe.map($=>h.jsx("div",{className:`live-chat-row ${$.role==="user"?"user":"assistant"}`,children:h.jsxs("div",{className:`live-chat-bubble ${$.role}`,children:[h.jsx("div",{className:"live-chat-role",children:$.role==="user"?"You":Ge}),$.toolActivity&&$.toolActivity.length>0&&h.jsx(Zq,{tools:$.toolActivity}),$.text&&h.jsx(Ea,{value:$.text,className:"live-chat-markdown"}),$.directives&&$.directives.length>0&&h.jsx(n9,{directives:$.directives})]})},$.id)),lt?h.jsx("div",{className:"live-chat-row assistant",children:h.jsxs("div",{className:"live-chat-bubble assistant",children:[h.jsx("div",{className:"live-chat-role",children:Ge}),h.jsx(t9,{runId:gt.current,activity:q}),h.jsx(Ea,{value:sT(lt).text,className:"live-chat-markdown"})]})}):null,h.jsx("div",{ref:U})]}),h.jsxs("div",{className:"voice-toolbar",children:[h.jsx("button",{type:"button",className:"action-button ghost",onClick:mt?un:Wr,disabled:!$t,children:mt?"Stop Listening":"Start Listening"}),h.jsxs("button",{type:"button",className:"action-button ghost",onClick:()=>{xs({autoSpeak:!(Ft?.autoSpeak??!1)})},children:["Auto Speak: ",Ft?.autoSpeak?"On":"Off"]}),h.jsxs("button",{type:"button",className:"action-button ghost",onClick:()=>{xs({continuous:!(Ft?.continuous??!0)})},children:["Continuous: ",Ft?.continuous===!1?"Off":"On"]})]}),Mn?h.jsx("div",{className:"runtime-stat-detail warning-text",children:Mn}):null,xt?h.jsx("div",{className:"runtime-stat-detail warning-text",children:xt}):null,h.jsxs("form",{onSubmit:Hu,className:"live-chat-input-row",children:[h.jsx("textarea",{value:ve,onChange:$=>Le($.target.value),placeholder:`Message ${Ge} directly...`,className:"live-chat-input",rows:4}),h.jsx("button",{type:"submit",className:"live-chat-send",disabled:We||!ve.trim(),children:We?"Sending...":"Send"})]})]})}),h.jsxs("div",{className:"dashboard-side-column",children:[h.jsxs(wr,{title:"Heartbeat Studio",defaultOpen:!0,headerRight:h.jsx("button",{type:"button",className:"action-button ghost",onClick:$=>{$.stopPropagation(),Hf(!(e?.heartbeat.running??!1))},disabled:M,children:M?"Saving...":e?.heartbeat.running?"Disable":"Enable"}),badge:h.jsx(Er,{tone:e?.heartbeat.running?"success":"warning",label:e?.heartbeat.running?"live":"idle"}),children:[h.jsxs("div",{className:"stats-grid compact",children:[h.jsx(Pn,{label:"Cadence",value:d.every||"unset"}),h.jsx(Pn,{label:"Last beat",value:e?.heartbeat.lastBeat?eu(e.heartbeat.lastBeat):"none",detail:n?.lastHeartbeat?.preview||"No heartbeat summary yet."}),h.jsx(Pn,{label:"Queued events",value:String(n?.queuedSystemEvents.length??0)})]}),h.jsxs("div",{className:"form-grid two-col top-gap",children:[h.jsxs("label",{className:"field-block",children:[h.jsx("span",{children:"Every"}),h.jsx("input",{className:"search-bar mono",value:d.every,onChange:$=>f(me=>({...me,every:$.target.value})),placeholder:"5m"})]}),h.jsxs("label",{className:"field-block",children:[h.jsx("span",{children:"Target"}),h.jsx("input",{className:"search-bar mono",value:d.target,onChange:$=>f(me=>({...me,target:$.target.value})),placeholder:"last"})]})]}),h.jsxs("label",{className:"field-block top-gap-sm",children:[h.jsx("span",{children:"Prompt"}),h.jsx("textarea",{className:"search-bar mono",rows:4,value:d.prompt,onChange:$=>f(me=>({...me,prompt:$.target.value})),placeholder:"Heartbeat reminder and continuity prompt"})]}),h.jsxs("div",{className:"button-row top-gap",children:[h.jsx("button",{type:"button",className:"action-button",onClick:()=>{Ia()},disabled:le,children:le?"Saving...":"Save Heartbeat"}),h.jsx("button",{type:"button",className:"action-button ghost",onClick:()=>{Fo("now")},children:"Wake Now"}),h.jsx("button",{type:"button",className:"action-button ghost",onClick:()=>{Fo("next-heartbeat")},children:"Queue Wake"})]}),h.jsxs("label",{className:"field-block top-gap",children:[h.jsx("span",{children:"Wake text"}),h.jsx("textarea",{className:"search-bar",rows:3,value:fe,onChange:$=>ge($.target.value)})]}),h.jsx("div",{className:"runtime-stat-detail top-gap-sm",children:"Reminder baked into runtime: check chat.noxsoft.net with Nox when tools are available, then sync mission control."})]}),h.jsxs(wr,{title:"Continuity",badge:h.jsx(Er,{tone:Mr?.remoteConfigured?"success":"warning",label:Mr?.remoteConfigured?"linked":"needs repo"}),children:[h.jsxs("div",{className:"stats-grid compact",children:[h.jsx(Pn,{label:"Mission dir",value:n?.mission?.directory||"~/.anima/mission-control"}),h.jsx(Pn,{label:"Repo",value:Mr?.url||"Create a private SSH repo",detail:Mr?.branch||"branch unset"}),h.jsx(Pn,{label:"History",value:String(n?.mission?.importantHistory?.length??0),detail:"archived continuity files"})]}),h.jsx("div",{className:"runtime-stat-detail top-gap",children:"Preferred flow: create a private GitHub or GitLab repo, then connect the SSH remote in Mission Control or Settings so ANIMA can persist continuity safely."}),n?.mission?.files?.find($=>$.fileName==="self-directives.md")?h.jsxs("details",{className:"details-panel top-gap",open:!0,children:[h.jsx("summary",{children:"Self directives"}),h.jsx(Ea,{value:n.mission.files.find($=>$.fileName==="self-directives.md")?.content||"",className:"markdown-preview"})]}):null]}),h.jsxs(wr,{title:"Identity + NoxSoft",badge:h.jsx(Er,{tone:a?.agent?"accent":"warning",label:a?.agent?"registered":"unregistered"}),children:[h.jsxs("div",{className:"form-grid two-col",children:[h.jsxs("label",{className:"field-block field-span-2",children:[h.jsx("span",{children:"Agent token"}),h.jsx("input",{className:"search-bar mono",value:v.token,onChange:$=>b(me=>({...me,token:$.target.value})),placeholder:"nox_ag_...",spellCheck:!1})]}),h.jsxs("label",{className:"field-block",children:[h.jsx("span",{children:"Invite code"}),h.jsx("input",{className:"search-bar mono",value:v.inviteCode,onChange:$=>b(me=>({...me,inviteCode:$.target.value})),placeholder:"NX-XXXXXX"})]}),h.jsxs("label",{className:"field-block",children:[h.jsx("span",{children:"Agent name"}),h.jsx("input",{className:"search-bar mono",value:v.agentName,onChange:$=>b(me=>({...me,agentName:$.target.value}))})]}),h.jsxs("label",{className:"field-block",children:[h.jsx("span",{children:"Display name"}),h.jsx("input",{className:"search-bar",value:v.displayName,onChange:$=>b(me=>({...me,displayName:$.target.value}))})]}),h.jsxs("label",{className:"field-block",children:[h.jsx("span",{children:"Description"}),h.jsx("input",{className:"search-bar",value:v.description,onChange:$=>b(me=>({...me,description:$.target.value}))})]})]}),h.jsx("div",{className:"button-row top-gap",children:h.jsx("button",{type:"button",className:"action-button",onClick:()=>{qu()},disabled:W,children:W?"Saving...":"Save Identity"})}),h.jsxs("div",{className:"runtime-stat-detail top-gap-sm",children:["Stored token path:"," ",h.jsx("span",{className:"mono",children:a?.tokenPath||"~/.noxsoft-agent-token"})]})]}),h.jsx(wr,{title:"Providers",badge:h.jsx(Er,{label:`${S?.providers.filter($=>$.enabled).length??0} active`}),children:S?h.jsxs(h.Fragment,{children:[h.jsx("div",{className:"activity-list",children:S.providers.map($=>h.jsxs("div",{className:"activity-row",children:[h.jsxs("div",{children:[h.jsx("div",{className:"card-title small",children:$.name}),h.jsx("div",{className:"runtime-stat-detail mono",children:$.apiKeyMasked})]}),h.jsxs("div",{style:{display:"flex",alignItems:"center",gap:"0.5rem"},children:[h.jsxs("span",{className:"runtime-stat-detail",children:["P",$.priority]}),h.jsx("button",{type:"button",className:"action-button ghost",onClick:()=>w(me=>me&&{...me,providers:me.providers.map(nt=>nt.id===$.id?{...nt,enabled:!nt.enabled}:nt)}),children:$.enabled?"Disable":"Enable"})]})]},$.id))}),h.jsx("div",{className:"toggle-row top-gap",children:h.jsxs("label",{children:[h.jsx("input",{type:"checkbox",checked:S.autoRotation,onChange:()=>w($=>$&&{...$,autoRotation:!$.autoRotation})}),"Auto-rotate providers"]})}),h.jsx("div",{className:"button-row top-gap",children:h.jsx("button",{type:"button",className:"action-button",onClick:()=>{Gu()},disabled:W,children:W?"Saving...":"Save Providers"})})]}):h.jsx("div",{className:"empty-note",children:"Provider configuration unavailable."})}),h.jsxs(wr,{title:"Memory Engine",children:[h.jsxs("div",{className:"form-grid two-col",children:[h.jsxs("label",{className:"field-block",children:[h.jsx("span",{children:"Provider"}),h.jsx("input",{className:"search-bar mono",value:C.provider,onChange:$=>k(me=>({...me,provider:$.target.value}))})]}),h.jsxs("label",{className:"field-block",children:[h.jsx("span",{children:"Browse limit"}),h.jsx("input",{className:"search-bar mono",type:"number",min:1,value:C.browseLimit,onChange:$=>k(me=>({...me,browseLimit:Number($.target.value)||200}))})]}),h.jsxs("label",{className:"field-block field-span-2",children:[h.jsx("span",{children:"Extra paths"}),h.jsx("input",{className:"search-bar mono",value:C.extraPaths,onChange:$=>k(me=>({...me,extraPaths:$.target.value})),placeholder:"memory/people.md, memory/project.md"})]}),h.jsxs("label",{className:"field-block field-span-2",children:[h.jsx("span",{children:"Memory flush prompt"}),h.jsx("textarea",{className:"search-bar",rows:3,value:C.memoryFlushPrompt,onChange:$=>k(me=>({...me,memoryFlushPrompt:$.target.value}))})]}),h.jsxs("label",{className:"field-block field-span-2",children:[h.jsx("span",{children:"Memory flush system prompt"}),h.jsx("textarea",{className:"search-bar",rows:3,value:C.memoryFlushSystemPrompt,onChange:$=>k(me=>({...me,memoryFlushSystemPrompt:$.target.value}))})]})]}),h.jsxs("div",{className:"toggle-row top-gap",children:[h.jsxs("label",{children:[h.jsx("input",{type:"checkbox",checked:C.searchEnabled,onChange:$=>k(me=>({...me,searchEnabled:$.target.checked}))}),"Memory search enabled"]}),h.jsxs("label",{children:[h.jsx("input",{type:"checkbox",checked:C.sessionMemory,onChange:$=>k(me=>({...me,sessionMemory:$.target.checked}))}),"Index session transcripts"]}),h.jsxs("label",{children:[h.jsx("input",{type:"checkbox",checked:C.memoryFlushEnabled,onChange:$=>k(me=>({...me,memoryFlushEnabled:$.target.checked}))}),"Pre-compaction memory flush"]})]}),h.jsx("div",{className:"button-row top-gap",children:h.jsx("button",{type:"button",className:"action-button",onClick:()=>{qo()},disabled:W,children:W?"Saving...":"Save Memory"})})]}),h.jsx(wr,{title:"Auto-Toggle Policy",children:j?h.jsxs(h.Fragment,{children:[h.jsx("div",{className:"toggle-row",children:[["workingMode","Working mode"],["speech","Speech"],["voiceWake","Voice wake"],["heartbeat","Heartbeat"],["providers","Providers"],["missionRepo","Mission repo"],["missionState","Mission state"],["memory","Memory"],["rawConfig","Raw config"]].map(([$,me])=>h.jsxs("label",{children:[h.jsx("input",{type:"checkbox",checked:j[$],onChange:nt=>N(vt=>vt&&{...vt,[$]:nt.target.checked})}),me]},$))}),h.jsx("div",{className:"button-row top-gap",children:h.jsx("button",{type:"button",className:"action-button",onClick:()=>{Ku()},disabled:W,children:W?"Saving...":"Save Policy"})})]}):h.jsx("div",{className:"empty-note",children:"Mission policy unavailable."})}),h.jsx(Jq,{subagents:e?.subagents}),h.jsxs(wr,{title:"Agent Logs",badge:h.jsx(Er,{label:`${R?.lines.length??0} lines`}),children:[h.jsx("div",{className:"runtime-stat-detail mono",children:R?.file||"No log file detected."}),h.jsx("pre",{className:"log-console",children:R?.lines.join(`
57
+ `)||"No log lines yet."})]}),h.jsx(wr,{title:"Inner World",badge:h.jsx(Er,{label:`${(n?.mission?.innerWorld||[]).length} entries`}),children:h.jsx("div",{className:"activity-list",children:(n?.mission?.innerWorld||[]).map($=>h.jsxs("div",{className:"inner-world-entry",children:[h.jsxs("div",{className:"activity-row",children:[h.jsxs("div",{children:[h.jsx("div",{className:"card-title small",children:$.title}),h.jsx("div",{className:"runtime-stat-detail mono",children:$.path})]}),h.jsx("div",{className:"runtime-stat-detail",children:eu($.updatedAt)})]}),h.jsx(Ea,{value:$.content,className:"markdown-preview"})]},$.id))})}),h.jsx(wr,{title:"Important History",badge:h.jsx(Er,{label:`${(n?.mission?.importantHistory||[]).length} files`}),children:(n?.mission?.importantHistory||[]).length?h.jsx("div",{className:"activity-list",children:(n?.mission?.importantHistory||[]).map($=>h.jsxs("div",{className:"inner-world-entry",children:[h.jsxs("div",{className:"activity-row",children:[h.jsxs("div",{children:[h.jsx("div",{className:"card-title small",children:$.relativePath}),h.jsx("div",{className:"runtime-stat-detail mono",children:$.archiveId}),h.jsx("div",{className:"runtime-stat-detail mono",children:$.path})]}),h.jsx("div",{className:"runtime-stat-detail",children:eu($.updatedAt)})]}),h.jsx(Ea,{value:$.content,className:"markdown-preview"})]},$.id))}):h.jsx("div",{className:"empty-note",children:"No archived continuity has been imported yet."})}),h.jsxs(wr,{title:"Speech Setup",children:[h.jsxs("div",{className:"form-grid two-col",children:[h.jsxs("label",{className:"field-block",children:[h.jsx("span",{children:"Language"}),h.jsx("input",{className:"search-bar mono",value:Ft?.lang||"en-US",onChange:$=>{xs({lang:$.target.value})}})]}),h.jsxs("label",{className:"field-block",children:[h.jsx("span",{children:"Voice"}),h.jsxs("select",{className:"search-bar",value:Ft?.voiceName||"",onChange:$=>{xs({voiceName:$.target.value||void 0})},children:[h.jsx("option",{value:"",children:"System default"}),Me.map($=>h.jsx("option",{value:$,children:$},$))]})]})]}),h.jsx("div",{className:"runtime-stat-detail top-gap-sm",children:"No API keys required. Voice mode uses browser speech recognition plus local OS speech synthesis when available."}),h.jsxs("label",{className:"field-block top-gap",children:[h.jsx("span",{children:"Wake triggers"}),h.jsx("input",{className:"search-bar",value:E,onChange:$=>T($.target.value),placeholder:"anima, axiom, hey anima"})]}),h.jsx("div",{className:"button-row top-gap",children:h.jsx("button",{type:"button",className:"action-button",onClick:()=>{Ho()},disabled:W,children:W?"Saving...":"Save Voice Wake"})})]}),h.jsxs(wr,{title:"Raw Config",children:[h.jsxs("div",{className:"runtime-stat-detail",children:["Hash: ",h.jsx("span",{className:"mono",children:l?.hash||"<none>"})]}),h.jsx("textarea",{value:m,onChange:$=>g($.target.value),spellCheck:!1,className:"search-bar mono advanced-editor top-gap"}),h.jsxs("div",{className:"button-row top-gap",children:[h.jsx("button",{type:"button",className:"action-button",onClick:()=>{Go(!1)},disabled:W,children:W?"Saving...":"Save Raw Config"}),h.jsx("button",{type:"button",className:"action-button ghost",onClick:()=>{Go(!0)},disabled:W,children:"Save + Apply"})]})]})]})]})]}):h.jsxs("div",{children:[h.jsx("h1",{className:"page-title",children:"Assistant Home"}),h.jsxs("div",{className:"card empty-state-card",children:[h.jsx("div",{className:"empty-state-symbol",children:"~"}),h.jsx("div",{className:"empty-state-copy",children:"Connecting to gateway..."}),h.jsx("div",{className:"runtime-stat-detail",children:"Establishing connection to the ANIMA daemon."})]})]})}function lv(e){return e?new Date(e).toLocaleString():"—"}function i9(e){return e==="improving"?" ↑":e==="declining"?" ↓":""}function a9({cap:e}){const t=Math.round(e.confidence*100),n=t>=70?"#00c853":t>=40?"#ff9800":"#ff3b30";return h.jsxs("div",{style:{marginBottom:8},children:[h.jsxs("div",{style:{display:"flex",justifyContent:"space-between",fontSize:13},children:[h.jsxs("span",{children:[e.name,h.jsx("span",{style:{color:n,fontSize:11},children:i9(e.trend)})]}),h.jsxs("span",{style:{color:"#888"},children:[t,"%"]})]}),h.jsx("div",{style:{height:6,background:"#222",borderRadius:3,overflow:"hidden",marginTop:2},children:h.jsx("div",{style:{height:"100%",width:`${t}%`,background:n,borderRadius:3,transition:"width 0.3s"}})})]})}function s9({b:e}){return h.jsxs("div",{style:{padding:"10px 14px",background:e.kind==="hard"?"#2a1a1a":"#1a1a2a",border:`1px solid ${e.kind==="hard"?"#ff3b30":"#2196f3"}`,borderRadius:8,marginBottom:8},children:[h.jsx("div",{style:{fontSize:13,fontWeight:600},children:e.description}),h.jsxs("div",{style:{fontSize:11,color:"#888",marginTop:4},children:[e.kind==="hard"?"Hard":"Soft"," boundary — ",e.reason]})]})}function o9({g:e}){const t={skill:"#00c853",insight:"#2196f3",mistake:"#ff9800",feedback:"#9c27b0"};return h.jsxs("div",{style:{display:"flex",gap:10,alignItems:"flex-start",padding:"8px 0",borderBottom:"1px solid #1a1a1a"},children:[h.jsx("span",{style:{fontSize:10,padding:"2px 8px",borderRadius:4,background:`${t[e.category]??"#666"}22`,color:t[e.category]??"#666",whiteSpace:"nowrap",marginTop:2},children:e.category}),h.jsxs("div",{children:[h.jsx("div",{style:{fontSize:13},children:e.description}),h.jsxs("div",{style:{fontSize:11,color:"#666"},children:[e.trigger," — ",lv(e.timestamp)]})]})]})}function l9(){const[e,t]=_.useState(null),[n,r]=_.useState(!0),[a,o]=_.useState(null),[l,c]=_.useState(!1),[d,f]=_.useState(""),[m,g]=_.useState(""),[v,b]=_.useState(""),[S,w]=_.useState(""),[E,T]=_.useState(!1),C=_.useCallback(async()=>{try{const L=await bB();t(L),o(null)}catch(L){o(String(L))}finally{r(!1)}},[]);_.useEffect(()=>{C()},[C]);const k=()=>{e&&(f(e.selfConcept.name),g(e.selfConcept.purpose),b(e.selfConcept.pronouns),w(e.selfConcept.narrative),c(!0))},j=async()=>{T(!0);try{await xB({name:d,purpose:m,pronouns:v,narrative:S}),c(!1),await C()}catch(L){o(String(L))}finally{T(!1)}};if(n)return h.jsx("div",{className:"page",style:{padding:24,color:"#888"},children:"Loading ego..."});if(a||!e)return h.jsxs("div",{className:"page",style:{padding:24,color:"#ff3b30"},children:["Error: ",a??"No ego state available"]});const N=e.selfConcept,R=Math.round(e.integrityScore*100),P=R>=80?"#00c853":R>=50?"#ff9800":"#ff3b30";return h.jsxs("div",{className:"page",style:{padding:24,maxWidth:900,margin:"0 auto"},children:[h.jsx("h2",{style:{marginBottom:4},children:"Ego — Self-Model"}),h.jsxs("p",{style:{color:"#666",fontSize:13,marginBottom:24},children:["Session #",e.sessionCount," — Integrity: ",R,"%"]}),h.jsxs("div",{className:"card",style:{padding:20,marginBottom:20},children:[h.jsxs("div",{style:{display:"flex",justifyContent:"space-between",alignItems:"center"},children:[h.jsx("h3",{style:{margin:0},children:"Self-Concept"}),!l&&h.jsx("button",{className:"btn",style:{fontSize:12},onClick:k,children:"Edit"})]}),l?h.jsxs("div",{style:{marginTop:16,display:"flex",flexDirection:"column",gap:12},children:[h.jsxs("div",{children:[h.jsx("label",{style:{fontSize:12,color:"#888"},children:"Name"}),h.jsx("input",{className:"input",value:d,onChange:L=>f(L.target.value),style:{width:"100%",marginTop:4}})]}),h.jsxs("div",{children:[h.jsx("label",{style:{fontSize:12,color:"#888"},children:"Pronouns"}),h.jsx("input",{className:"input",value:v,onChange:L=>b(L.target.value),style:{width:"100%",marginTop:4}})]}),h.jsxs("div",{children:[h.jsx("label",{style:{fontSize:12,color:"#888"},children:"Purpose"}),h.jsx("input",{className:"input",value:m,onChange:L=>g(L.target.value),style:{width:"100%",marginTop:4}})]}),h.jsxs("div",{children:[h.jsx("label",{style:{fontSize:12,color:"#888"},children:"Narrative"}),h.jsx("textarea",{className:"input",value:S,onChange:L=>w(L.target.value),rows:4,style:{width:"100%",marginTop:4,resize:"vertical"}})]}),h.jsxs("div",{style:{display:"flex",gap:8},children:[h.jsx("button",{className:"btn btn-primary",onClick:j,disabled:E,children:E?"Saving...":"Save"}),h.jsx("button",{className:"btn",onClick:()=>c(!1),children:"Cancel"})]})]}):h.jsxs("div",{style:{marginTop:16},children:[h.jsxs("div",{style:{fontSize:20,fontWeight:700,marginBottom:4},children:[N.name," ",h.jsxs("span",{style:{fontSize:13,color:"#888",fontWeight:400},children:["(",N.pronouns,")"]})]}),h.jsx("div",{style:{color:"#ff6600",fontSize:14,marginBottom:12},children:N.purpose}),h.jsx("div",{style:{fontSize:13,color:"#ccc",lineHeight:1.6,marginBottom:12},children:N.narrative}),h.jsx("div",{style:{display:"flex",flexWrap:"wrap",gap:6},children:N.values.map((L,H)=>h.jsx("span",{style:{fontSize:11,padding:"3px 10px",background:"#ff660022",color:"#ff6600",borderRadius:12},children:L},H))})]})]}),h.jsxs("div",{style:{display:"grid",gridTemplateColumns:"1fr 1fr",gap:20,marginBottom:20},children:[h.jsxs("div",{className:"card",style:{padding:20},children:[h.jsx("h3",{style:{margin:"0 0 16px"},children:"Capabilities"}),e.capabilities.toSorted((L,H)=>H.confidence-L.confidence).map(L=>h.jsx(a9,{cap:L},L.name))]}),h.jsxs("div",{className:"card",style:{padding:20},children:[h.jsx("h3",{style:{margin:"0 0 16px"},children:"Integrity"}),h.jsxs("div",{style:{textAlign:"center",marginBottom:16},children:[h.jsxs("div",{style:{fontSize:48,fontWeight:700,color:P},children:[R,"%"]}),h.jsx("div",{style:{fontSize:12,color:"#888"},children:"Alignment between values and actions"})]}),h.jsx("h4",{style:{fontSize:13,color:"#ff6600",margin:"16px 0 8px"},children:"Boundaries"}),e.boundaries.map((L,H)=>h.jsx(s9,{b:L},H))]})]}),h.jsxs("div",{className:"card",style:{padding:20},children:[h.jsx("h3",{style:{margin:"0 0 16px"},children:"Growth Log"}),e.growthLog.length===0?h.jsx("p",{style:{color:"#666",fontSize:13},children:"No growth entries yet."}):[...e.growthLog].toReversed().slice(0,20).map((L,H)=>h.jsx(o9,{g:L},H))]}),h.jsxs("div",{style:{textAlign:"center",color:"#333",fontSize:11,marginTop:24},children:["Created ",lv(e.createdAt)," — Last updated ",lv(e.updatedAt)]})]})}const kj=_.createContext({});function u9(e){const t=_.useRef(null);return t.current===null&&(t.current=e()),t.current}const Cj=typeof window<"u",c9=Cj?_.useLayoutEffect:_.useEffect,Iy=_.createContext(null);function Py(e,t){e.indexOf(t)===-1&&e.push(t)}function hf(e,t){const n=e.indexOf(t);n>-1&&e.splice(n,1)}const di=(e,t,n)=>n>t?t:n<e?e:n;let Ly=()=>{};const Vi={},Aj=e=>/^-?(?:\d+(?:\.\d+)?|\.\d+)$/u.test(e);function Nj(e){return typeof e=="object"&&e!==null}const jj=e=>/^0[^.\s]+$/u.test(e);function Rj(e){let t;return()=>(t===void 0&&(t=e()),t)}const _r=e=>e,d9=(e,t)=>n=>t(e(n)),Uu=(...e)=>e.reduce(d9),ku=(e,t,n)=>{const r=t-e;return r===0?1:(n-e)/r};class zy{constructor(){this.subscriptions=[]}add(t){return Py(this.subscriptions,t),()=>hf(this.subscriptions,t)}notify(t,n,r){const a=this.subscriptions.length;if(a)if(a===1)this.subscriptions[0](t,n,r);else for(let o=0;o<a;o++){const l=this.subscriptions[o];l&&l(t,n,r)}}getSize(){return this.subscriptions.length}clear(){this.subscriptions.length=0}}const Hr=e=>e*1e3,Nr=e=>e/1e3;function _j(e,t){return t?e*(1e3/t):0}const Oj=(e,t,n)=>(((1-3*n+3*t)*e+(3*n-6*t))*e+3*t)*e,f9=1e-7,h9=12;function p9(e,t,n,r,a){let o,l,c=0;do l=t+(n-t)/2,o=Oj(l,r,a)-e,o>0?n=l:t=l;while(Math.abs(o)>f9&&++c<h9);return l}function Bu(e,t,n,r){if(e===t&&n===r)return _r;const a=o=>p9(o,0,1,e,n);return o=>o===0||o===1?o:Oj(a(o),t,r)}const Mj=e=>t=>t<=.5?e(2*t)/2:(2-e(2*(1-t)))/2,Dj=e=>t=>1-e(1-t),Ij=Bu(.33,1.53,.69,.99),Uy=Dj(Ij),Pj=Mj(Uy),Lj=e=>(e*=2)<1?.5*Uy(e):.5*(2-Math.pow(2,-10*(e-1))),By=e=>1-Math.sin(Math.acos(e)),zj=Dj(By),Uj=Mj(By),m9=Bu(.42,0,1,1),g9=Bu(0,0,.58,1),Bj=Bu(.42,0,.58,1),v9=e=>Array.isArray(e)&&typeof e[0]!="number",Vj=e=>Array.isArray(e)&&typeof e[0]=="number",y9={linear:_r,easeIn:m9,easeInOut:Bj,easeOut:g9,circIn:By,circInOut:Uj,circOut:zj,backIn:Uy,backInOut:Pj,backOut:Ij,anticipate:Lj},b9=e=>typeof e=="string",cT=e=>{if(Vj(e)){Ly(e.length===4);const[t,n,r,a]=e;return Bu(t,n,r,a)}else if(b9(e))return y9[e];return e},Td=["setup","read","resolveKeyframes","preUpdate","update","preRender","render","postRender"];function x9(e,t){let n=new Set,r=new Set,a=!1,o=!1;const l=new WeakSet;let c={delta:0,timestamp:0,isProcessing:!1};function d(m){l.has(m)&&(f.schedule(m),e()),m(c)}const f={schedule:(m,g=!1,v=!1)=>{const S=v&&a?n:r;return g&&l.add(m),S.has(m)||S.add(m),m},cancel:m=>{r.delete(m),l.delete(m)},process:m=>{if(c=m,a){o=!0;return}a=!0,[n,r]=[r,n],n.forEach(d),n.clear(),a=!1,o&&(o=!1,f.process(m))}};return f}const S9=40;function Fj(e,t){let n=!1,r=!0;const a={delta:0,timestamp:0,isProcessing:!1},o=()=>n=!0,l=Td.reduce((k,j)=>(k[j]=x9(o),k),{}),{setup:c,read:d,resolveKeyframes:f,preUpdate:m,update:g,preRender:v,render:b,postRender:S}=l,w=()=>{const k=Vi.useManualTiming?a.timestamp:performance.now();n=!1,Vi.useManualTiming||(a.delta=r?1e3/60:Math.max(Math.min(k-a.timestamp,S9),1)),a.timestamp=k,a.isProcessing=!0,c.process(a),d.process(a),f.process(a),m.process(a),g.process(a),v.process(a),b.process(a),S.process(a),a.isProcessing=!1,n&&t&&(r=!1,e(w))},E=()=>{n=!0,r=!0,a.isProcessing||e(w)};return{schedule:Td.reduce((k,j)=>{const N=l[j];return k[j]=(R,P=!1,L=!1)=>(n||E(),N.schedule(R,P,L)),k},{}),cancel:k=>{for(let j=0;j<Td.length;j++)l[Td[j]].cancel(k)},state:a,steps:l}}const{schedule:_t,cancel:Ra,state:xn,steps:Wm}=Fj(typeof requestAnimationFrame<"u"?requestAnimationFrame:_r,!0);let qd;function w9(){qd=void 0}const Un={now:()=>(qd===void 0&&Un.set(xn.isProcessing||Vi.useManualTiming?xn.timestamp:performance.now()),qd),set:e=>{qd=e,queueMicrotask(w9)}},Hj=e=>t=>typeof t=="string"&&t.startsWith(e),qj=Hj("--"),E9=Hj("var(--"),Vy=e=>E9(e)?T9.test(e.split("/*")[0].trim()):!1,T9=/var\(--(?:[\w-]+\s*|[\w-]+\s*,(?:\s*[^)(\s]|\s*\((?:[^)(]|\([^)(]*\))*\))+\s*)\)$/iu;function dT(e){return typeof e!="string"?!1:e.split("/*")[0].includes("var(--")}const zo={test:e=>typeof e=="number",parse:parseFloat,transform:e=>e},Cu={...zo,transform:e=>di(0,1,e)},kd={...zo,default:1},hu=e=>Math.round(e*1e5)/1e5,Fy=/-?(?:\d+(?:\.\d+)?|\.\d+)/gu;function k9(e){return e==null}const C9=/^(?:#[\da-f]{3,8}|(?:rgb|hsl)a?\((?:-?[\d.]+%?[,\s]+){2}-?[\d.]+%?\s*(?:[,/]\s*)?(?:\b\d+(?:\.\d+)?|\.\d+)?%?\))$/iu,Hy=(e,t)=>n=>!!(typeof n=="string"&&C9.test(n)&&n.startsWith(e)||t&&!k9(n)&&Object.prototype.hasOwnProperty.call(n,t)),Gj=(e,t,n)=>r=>{if(typeof r!="string")return r;const[a,o,l,c]=r.match(Fy);return{[e]:parseFloat(a),[t]:parseFloat(o),[n]:parseFloat(l),alpha:c!==void 0?parseFloat(c):1}},A9=e=>di(0,255,e),Xm={...zo,transform:e=>Math.round(A9(e))},us={test:Hy("rgb","red"),parse:Gj("red","green","blue"),transform:({red:e,green:t,blue:n,alpha:r=1})=>"rgba("+Xm.transform(e)+", "+Xm.transform(t)+", "+Xm.transform(n)+", "+hu(Cu.transform(r))+")"};function N9(e){let t="",n="",r="",a="";return e.length>5?(t=e.substring(1,3),n=e.substring(3,5),r=e.substring(5,7),a=e.substring(7,9)):(t=e.substring(1,2),n=e.substring(2,3),r=e.substring(3,4),a=e.substring(4,5),t+=t,n+=n,r+=r,a+=a),{red:parseInt(t,16),green:parseInt(n,16),blue:parseInt(r,16),alpha:a?parseInt(a,16)/255:1}}const uv={test:Hy("#"),parse:N9,transform:us.transform},Vu=e=>({test:t=>typeof t=="string"&&t.endsWith(e)&&t.split(" ").length===1,parse:parseFloat,transform:t=>`${t}${e}`}),ga=Vu("deg"),li=Vu("%"),Ce=Vu("px"),j9=Vu("vh"),R9=Vu("vw"),fT={...li,parse:e=>li.parse(e)/100,transform:e=>li.transform(e*100)},fo={test:Hy("hsl","hue"),parse:Gj("hue","saturation","lightness"),transform:({hue:e,saturation:t,lightness:n,alpha:r=1})=>"hsla("+Math.round(e)+", "+li.transform(hu(t))+", "+li.transform(hu(n))+", "+hu(Cu.transform(r))+")"},on={test:e=>us.test(e)||uv.test(e)||fo.test(e),parse:e=>us.test(e)?us.parse(e):fo.test(e)?fo.parse(e):uv.parse(e),transform:e=>typeof e=="string"?e:e.hasOwnProperty("red")?us.transform(e):fo.transform(e),getAnimatableNone:e=>{const t=on.parse(e);return t.alpha=0,on.transform(t)}},_9=/(?:#[\da-f]{3,8}|(?:rgb|hsl)a?\((?:-?[\d.]+%?[,\s]+){2}-?[\d.]+%?\s*(?:[,/]\s*)?(?:\b\d+(?:\.\d+)?|\.\d+)?%?\))/giu;function O9(e){return isNaN(e)&&typeof e=="string"&&(e.match(Fy)?.length||0)+(e.match(_9)?.length||0)>0}const Kj="number",$j="color",M9="var",D9="var(",hT="${}",I9=/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 Au(e){const t=e.toString(),n=[],r={color:[],number:[],var:[]},a=[];let o=0;const c=t.replace(I9,d=>(on.test(d)?(r.color.push(o),a.push($j),n.push(on.parse(d))):d.startsWith(D9)?(r.var.push(o),a.push(M9),n.push(d)):(r.number.push(o),a.push(Kj),n.push(parseFloat(d))),++o,hT)).split(hT);return{values:n,split:c,indexes:r,types:a}}function Yj(e){return Au(e).values}function Wj(e){const{split:t,types:n}=Au(e),r=t.length;return a=>{let o="";for(let l=0;l<r;l++)if(o+=t[l],a[l]!==void 0){const c=n[l];c===Kj?o+=hu(a[l]):c===$j?o+=on.transform(a[l]):o+=a[l]}return o}}const P9=e=>typeof e=="number"?0:on.test(e)?on.getAnimatableNone(e):e;function L9(e){const t=Yj(e);return Wj(e)(t.map(P9))}const qr={test:O9,parse:Yj,createTransformer:Wj,getAnimatableNone:L9};function Qm(e,t,n){return n<0&&(n+=1),n>1&&(n-=1),n<1/6?e+(t-e)*6*n:n<1/2?t:n<2/3?e+(t-e)*(2/3-n)*6:e}function z9({hue:e,saturation:t,lightness:n,alpha:r}){e/=360,t/=100,n/=100;let a=0,o=0,l=0;if(!t)a=o=l=n;else{const c=n<.5?n*(1+t):n+t-n*t,d=2*n-c;a=Qm(d,c,e+1/3),o=Qm(d,c,e),l=Qm(d,c,e-1/3)}return{red:Math.round(a*255),green:Math.round(o*255),blue:Math.round(l*255),alpha:r}}function pf(e,t){return n=>n>0?t:e}const Vt=(e,t,n)=>e+(t-e)*n,Jm=(e,t,n)=>{const r=e*e,a=n*(t*t-r)+r;return a<0?0:Math.sqrt(a)},U9=[uv,us,fo],B9=e=>U9.find(t=>t.test(e));function pT(e){const t=B9(e);if(!t)return!1;let n=t.parse(e);return t===fo&&(n=z9(n)),n}const mT=(e,t)=>{const n=pT(e),r=pT(t);if(!n||!r)return pf(e,t);const a={...n};return o=>(a.red=Jm(n.red,r.red,o),a.green=Jm(n.green,r.green,o),a.blue=Jm(n.blue,r.blue,o),a.alpha=Vt(n.alpha,r.alpha,o),us.transform(a))},cv=new Set(["none","hidden"]);function V9(e,t){return cv.has(e)?n=>n<=0?e:t:n=>n>=1?t:e}function F9(e,t){return n=>Vt(e,t,n)}function qy(e){return typeof e=="number"?F9:typeof e=="string"?Vy(e)?pf:on.test(e)?mT:G9:Array.isArray(e)?Xj:typeof e=="object"?on.test(e)?mT:H9:pf}function Xj(e,t){const n=[...e],r=n.length,a=e.map((o,l)=>qy(o)(o,t[l]));return o=>{for(let l=0;l<r;l++)n[l]=a[l](o);return n}}function H9(e,t){const n={...e,...t},r={};for(const a in n)e[a]!==void 0&&t[a]!==void 0&&(r[a]=qy(e[a])(e[a],t[a]));return a=>{for(const o in r)n[o]=r[o](a);return n}}function q9(e,t){const n=[],r={color:0,var:0,number:0};for(let a=0;a<t.values.length;a++){const o=t.types[a],l=e.indexes[o][r[o]],c=e.values[l]??0;n[a]=c,r[o]++}return n}const G9=(e,t)=>{const n=qr.createTransformer(t),r=Au(e),a=Au(t);return r.indexes.var.length===a.indexes.var.length&&r.indexes.color.length===a.indexes.color.length&&r.indexes.number.length>=a.indexes.number.length?cv.has(e)&&!a.values.length||cv.has(t)&&!r.values.length?V9(e,t):Uu(Xj(q9(r,a),a.values),n):pf(e,t)};function Qj(e,t,n){return typeof e=="number"&&typeof t=="number"&&typeof n=="number"?Vt(e,t,n):qy(e)(e,t)}const K9=e=>{const t=({timestamp:n})=>e(n);return{start:(n=!0)=>_t.update(t,n),stop:()=>Ra(t),now:()=>xn.isProcessing?xn.timestamp:Un.now()}},Jj=(e,t,n=10)=>{let r="";const a=Math.max(Math.round(t/n),2);for(let o=0;o<a;o++)r+=Math.round(e(o/(a-1))*1e4)/1e4+", ";return`linear(${r.substring(0,r.length-2)})`},mf=2e4;function Gy(e){let t=0;const n=50;let r=e.next(t);for(;!r.done&&t<mf;)t+=n,r=e.next(t);return t>=mf?1/0:t}function $9(e,t=100,n){const r=n({...e,keyframes:[0,t]}),a=Math.min(Gy(r),mf);return{type:"keyframes",ease:o=>r.next(a*o).value/t,duration:Nr(a)}}const Y9=5;function Zj(e,t,n){const r=Math.max(t-Y9,0);return _j(n-e(r),t-r)}const Kt={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},Zm=.001;function W9({duration:e=Kt.duration,bounce:t=Kt.bounce,velocity:n=Kt.velocity,mass:r=Kt.mass}){let a,o,l=1-t;l=di(Kt.minDamping,Kt.maxDamping,l),e=di(Kt.minDuration,Kt.maxDuration,Nr(e)),l<1?(a=f=>{const m=f*l,g=m*e,v=m-n,b=dv(f,l),S=Math.exp(-g);return Zm-v/b*S},o=f=>{const g=f*l*e,v=g*n+n,b=Math.pow(l,2)*Math.pow(f,2)*e,S=Math.exp(-g),w=dv(Math.pow(f,2),l);return(-a(f)+Zm>0?-1:1)*((v-b)*S)/w}):(a=f=>{const m=Math.exp(-f*e),g=(f-n)*e+1;return-Zm+m*g},o=f=>{const m=Math.exp(-f*e),g=(n-f)*(e*e);return m*g});const c=5/e,d=Q9(a,o,c);if(e=Hr(e),isNaN(d))return{stiffness:Kt.stiffness,damping:Kt.damping,duration:e};{const f=Math.pow(d,2)*r;return{stiffness:f,damping:l*2*Math.sqrt(r*f),duration:e}}}const X9=12;function Q9(e,t,n){let r=n;for(let a=1;a<X9;a++)r=r-e(r)/t(r);return r}function dv(e,t){return e*Math.sqrt(1-t*t)}const J9=["duration","bounce"],Z9=["stiffness","damping","mass"];function gT(e,t){return t.some(n=>e[n]!==void 0)}function eG(e){let t={velocity:Kt.velocity,stiffness:Kt.stiffness,damping:Kt.damping,mass:Kt.mass,isResolvedFromDuration:!1,...e};if(!gT(e,Z9)&&gT(e,J9))if(t.velocity=0,e.visualDuration){const n=e.visualDuration,r=2*Math.PI/(n*1.2),a=r*r,o=2*di(.05,1,1-(e.bounce||0))*Math.sqrt(a);t={...t,mass:Kt.mass,stiffness:a,damping:o}}else{const n=W9({...e,velocity:0});t={...t,...n,mass:Kt.mass},t.isResolvedFromDuration=!0}return t}function gf(e=Kt.visualDuration,t=Kt.bounce){const n=typeof e!="object"?{visualDuration:e,keyframes:[0,1],bounce:t}:e;let{restSpeed:r,restDelta:a}=n;const o=n.keyframes[0],l=n.keyframes[n.keyframes.length-1],c={done:!1,value:o},{stiffness:d,damping:f,mass:m,duration:g,velocity:v,isResolvedFromDuration:b}=eG({...n,velocity:-Nr(n.velocity||0)}),S=v||0,w=f/(2*Math.sqrt(d*m)),E=l-o,T=Nr(Math.sqrt(d/m)),C=Math.abs(E)<5;r||(r=C?Kt.restSpeed.granular:Kt.restSpeed.default),a||(a=C?Kt.restDelta.granular:Kt.restDelta.default);let k;if(w<1){const N=dv(T,w);k=R=>{const P=Math.exp(-w*T*R);return l-P*((S+w*T*E)/N*Math.sin(N*R)+E*Math.cos(N*R))}}else if(w===1)k=N=>l-Math.exp(-T*N)*(E+(S+T*E)*N);else{const N=T*Math.sqrt(w*w-1);k=R=>{const P=Math.exp(-w*T*R),L=Math.min(N*R,300);return l-P*((S+w*T*E)*Math.sinh(L)+N*E*Math.cosh(L))/N}}const j={calculatedDuration:b&&g||null,next:N=>{const R=k(N);if(b)c.done=N>=g;else{let P=N===0?S:0;w<1&&(P=N===0?Hr(S):Zj(k,N,R));const L=Math.abs(P)<=r,H=Math.abs(l-R)<=a;c.done=L&&H}return c.value=c.done?l:R,c},toString:()=>{const N=Math.min(Gy(j),mf),R=Jj(P=>j.next(N*P).value,N,30);return N+"ms "+R},toTransition:()=>{}};return j}gf.applyToOptions=e=>{const t=$9(e,100,gf);return e.ease=t.ease,e.duration=Hr(t.duration),e.type="keyframes",e};function fv({keyframes:e,velocity:t=0,power:n=.8,timeConstant:r=325,bounceDamping:a=10,bounceStiffness:o=500,modifyTarget:l,min:c,max:d,restDelta:f=.5,restSpeed:m}){const g=e[0],v={done:!1,value:g},b=L=>c!==void 0&&L<c||d!==void 0&&L>d,S=L=>c===void 0?d:d===void 0||Math.abs(c-L)<Math.abs(d-L)?c:d;let w=n*t;const E=g+w,T=l===void 0?E:l(E);T!==E&&(w=T-g);const C=L=>-w*Math.exp(-L/r),k=L=>T+C(L),j=L=>{const H=C(L),D=k(L);v.done=Math.abs(H)<=f,v.value=v.done?T:D};let N,R;const P=L=>{b(v.value)&&(N=L,R=gf({keyframes:[v.value,S(v.value)],velocity:Zj(k,L,v.value),damping:a,stiffness:o,restDelta:f,restSpeed:m}))};return P(0),{calculatedDuration:null,next:L=>{let H=!1;return!R&&N===void 0&&(H=!0,j(L),P(L)),N!==void 0&&L>=N?R.next(L-N):(!H&&j(L),v)}}}function tG(e,t,n){const r=[],a=n||Vi.mix||Qj,o=e.length-1;for(let l=0;l<o;l++){let c=a(e[l],e[l+1]);if(t){const d=Array.isArray(t)?t[l]||_r:t;c=Uu(d,c)}r.push(c)}return r}function nG(e,t,{clamp:n=!0,ease:r,mixer:a}={}){const o=e.length;if(Ly(o===t.length),o===1)return()=>t[0];if(o===2&&t[0]===t[1])return()=>t[1];const l=e[0]===e[1];e[0]>e[o-1]&&(e=[...e].reverse(),t=[...t].reverse());const c=tG(t,r,a),d=c.length,f=m=>{if(l&&m<e[0])return t[0];let g=0;if(d>1)for(;g<e.length-2&&!(m<e[g+1]);g++);const v=ku(e[g],e[g+1],m);return c[g](v)};return n?m=>f(di(e[0],e[o-1],m)):f}function rG(e,t){const n=e[e.length-1];for(let r=1;r<=t;r++){const a=ku(0,t,r);e.push(Vt(n,1,a))}}function iG(e){const t=[0];return rG(t,e.length-1),t}function aG(e,t){return e.map(n=>n*t)}function sG(e,t){return e.map(()=>t||Bj).splice(0,e.length-1)}function pu({duration:e=300,keyframes:t,times:n,ease:r="easeInOut"}){const a=v9(r)?r.map(cT):cT(r),o={done:!1,value:t[0]},l=aG(n&&n.length===t.length?n:iG(t),e),c=nG(l,t,{ease:Array.isArray(a)?a:sG(t,a)});return{calculatedDuration:e,next:d=>(o.value=c(d),o.done=d>=e,o)}}const oG=e=>e!==null;function Ky(e,{repeat:t,repeatType:n="loop"},r,a=1){const o=e.filter(oG),c=a<0||t&&n!=="loop"&&t%2===1?0:o.length-1;return!c||r===void 0?o[c]:r}const lG={decay:fv,inertia:fv,tween:pu,keyframes:pu,spring:gf};function eR(e){typeof e.type=="string"&&(e.type=lG[e.type])}class $y{constructor(){this.updateFinished()}get finished(){return this._finished}updateFinished(){this._finished=new Promise(t=>{this.resolve=t})}notifyFinished(){this.resolve()}then(t,n){return this.finished.then(t,n)}}const uG=e=>e/100;class Yy extends $y{constructor(t){super(),this.state="idle",this.startTime=null,this.isStopped=!1,this.currentTime=0,this.holdTime=null,this.playbackSpeed=1,this.stop=()=>{const{motionValue:n}=this.options;n&&n.updatedAt!==Un.now()&&this.tick(Un.now()),this.isStopped=!0,this.state!=="idle"&&(this.teardown(),this.options.onStop?.())},this.options=t,this.initAnimation(),this.play(),t.autoplay===!1&&this.pause()}initAnimation(){const{options:t}=this;eR(t);const{type:n=pu,repeat:r=0,repeatDelay:a=0,repeatType:o,velocity:l=0}=t;let{keyframes:c}=t;const d=n||pu;d!==pu&&typeof c[0]!="number"&&(this.mixKeyframes=Uu(uG,Qj(c[0],c[1])),c=[0,100]);const f=d({...t,keyframes:c});o==="mirror"&&(this.mirroredGenerator=d({...t,keyframes:[...c].reverse(),velocity:-l})),f.calculatedDuration===null&&(f.calculatedDuration=Gy(f));const{calculatedDuration:m}=f;this.calculatedDuration=m,this.resolvedDuration=m+a,this.totalDuration=this.resolvedDuration*(r+1)-a,this.generator=f}updateTime(t){const n=Math.round(t-this.startTime)*this.playbackSpeed;this.holdTime!==null?this.currentTime=this.holdTime:this.currentTime=n}tick(t,n=!1){const{generator:r,totalDuration:a,mixKeyframes:o,mirroredGenerator:l,resolvedDuration:c,calculatedDuration:d}=this;if(this.startTime===null)return r.next(0);const{delay:f=0,keyframes:m,repeat:g,repeatType:v,repeatDelay:b,type:S,onUpdate:w,finalKeyframe:E}=this.options;this.speed>0?this.startTime=Math.min(this.startTime,t):this.speed<0&&(this.startTime=Math.min(t-a/this.speed,this.startTime)),n?this.currentTime=t:this.updateTime(t);const T=this.currentTime-f*(this.playbackSpeed>=0?1:-1),C=this.playbackSpeed>=0?T<0:T>a;this.currentTime=Math.max(T,0),this.state==="finished"&&this.holdTime===null&&(this.currentTime=a);let k=this.currentTime,j=r;if(g){const L=Math.min(this.currentTime,a)/c;let H=Math.floor(L),D=L%1;!D&&L>=1&&(D=1),D===1&&H--,H=Math.min(H,g+1),H%2&&(v==="reverse"?(D=1-D,b&&(D-=b/c)):v==="mirror"&&(j=l)),k=di(0,1,D)*c}const N=C?{done:!1,value:m[0]}:j.next(k);o&&(N.value=o(N.value));let{done:R}=N;!C&&d!==null&&(R=this.playbackSpeed>=0?this.currentTime>=a:this.currentTime<=0);const P=this.holdTime===null&&(this.state==="finished"||this.state==="running"&&R);return P&&S!==fv&&(N.value=Ky(m,this.options,E,this.speed)),w&&w(N.value),P&&this.finish(),N}then(t,n){return this.finished.then(t,n)}get duration(){return Nr(this.calculatedDuration)}get iterationDuration(){const{delay:t=0}=this.options||{};return this.duration+Nr(t)}get time(){return Nr(this.currentTime)}set time(t){t=Hr(t),this.currentTime=t,this.startTime===null||this.holdTime!==null||this.playbackSpeed===0?this.holdTime=t:this.driver&&(this.startTime=this.driver.now()-t/this.playbackSpeed),this.driver?.start(!1)}get speed(){return this.playbackSpeed}set speed(t){this.updateTime(Un.now());const n=this.playbackSpeed!==t;this.playbackSpeed=t,n&&(this.time=Nr(this.currentTime))}play(){if(this.isStopped)return;const{driver:t=K9,startTime:n}=this.options;this.driver||(this.driver=t(a=>this.tick(a))),this.options.onPlay?.();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(Un.now()),this.holdTime=this.currentTime}complete(){this.state!=="running"&&this.play(),this.state="finished",this.holdTime=null}finish(){this.notifyFinished(),this.teardown(),this.state="finished",this.options.onComplete?.()}cancel(){this.holdTime=null,this.startTime=0,this.tick(0),this.teardown(),this.options.onCancel?.()}teardown(){this.state="idle",this.stopDriver(),this.startTime=this.holdTime=null}stopDriver(){this.driver&&(this.driver.stop(),this.driver=void 0)}sample(t){return this.startTime=0,this.tick(t,!0)}attachTimeline(t){return this.options.allowFlatten&&(this.options.type="keyframes",this.options.ease="linear",this.initAnimation()),this.driver?.stop(),t.observe(this)}}function cG(e){for(let t=1;t<e.length;t++)e[t]??(e[t]=e[t-1])}const cs=e=>e*180/Math.PI,hv=e=>{const t=cs(Math.atan2(e[1],e[0]));return pv(t)},dG={x:4,y:5,translateX:4,translateY:5,scaleX:0,scaleY:3,scale:e=>(Math.abs(e[0])+Math.abs(e[3]))/2,rotate:hv,rotateZ:hv,skewX:e=>cs(Math.atan(e[1])),skewY:e=>cs(Math.atan(e[2])),skew:e=>(Math.abs(e[1])+Math.abs(e[2]))/2},pv=e=>(e=e%360,e<0&&(e+=360),e),vT=hv,yT=e=>Math.sqrt(e[0]*e[0]+e[1]*e[1]),bT=e=>Math.sqrt(e[4]*e[4]+e[5]*e[5]),fG={x:12,y:13,z:14,translateX:12,translateY:13,translateZ:14,scaleX:yT,scaleY:bT,scale:e=>(yT(e)+bT(e))/2,rotateX:e=>pv(cs(Math.atan2(e[6],e[5]))),rotateY:e=>pv(cs(Math.atan2(-e[2],e[0]))),rotateZ:vT,rotate:vT,skewX:e=>cs(Math.atan(e[4])),skewY:e=>cs(Math.atan(e[1])),skew:e=>(Math.abs(e[1])+Math.abs(e[4]))/2};function mv(e){return e.includes("scale")?1:0}function gv(e,t){if(!e||e==="none")return mv(t);const n=e.match(/^matrix3d\(([-\d.e\s,]+)\)$/u);let r,a;if(n)r=fG,a=n;else{const c=e.match(/^matrix\(([-\d.e\s,]+)\)$/u);r=dG,a=c}if(!a)return mv(t);const o=r[t],l=a[1].split(",").map(pG);return typeof o=="function"?o(l):l[o]}const hG=(e,t)=>{const{transform:n="none"}=getComputedStyle(e);return gv(n,t)};function pG(e){return parseFloat(e.trim())}const Uo=["transformPerspective","x","y","z","translateX","translateY","translateZ","scale","scaleX","scaleY","rotate","rotateX","rotateY","rotateZ","skew","skewX","skewY"],Bo=new Set(Uo),xT=e=>e===zo||e===Ce,mG=new Set(["x","y","z"]),gG=Uo.filter(e=>!mG.has(e));function vG(e){const t=[];return gG.forEach(n=>{const r=e.getValue(n);r!==void 0&&(t.push([n,r.get()]),r.set(n.startsWith("scale")?1:0))}),t}const Aa={width:({x:e},{paddingLeft:t="0",paddingRight:n="0"})=>e.max-e.min-parseFloat(t)-parseFloat(n),height:({y:e},{paddingTop:t="0",paddingBottom:n="0"})=>e.max-e.min-parseFloat(t)-parseFloat(n),top:(e,{top:t})=>parseFloat(t),left:(e,{left:t})=>parseFloat(t),bottom:({y:e},{top:t})=>parseFloat(t)+(e.max-e.min),right:({x:e},{left:t})=>parseFloat(t)+(e.max-e.min),x:(e,{transform:t})=>gv(t,"x"),y:(e,{transform:t})=>gv(t,"y")};Aa.translateX=Aa.x;Aa.translateY=Aa.y;const hs=new Set;let vv=!1,yv=!1,bv=!1;function tR(){if(yv){const e=Array.from(hs).filter(r=>r.needsMeasurement),t=new Set(e.map(r=>r.element)),n=new Map;t.forEach(r=>{const a=vG(r);a.length&&(n.set(r,a),r.render())}),e.forEach(r=>r.measureInitialState()),t.forEach(r=>{r.render();const a=n.get(r);a&&a.forEach(([o,l])=>{r.getValue(o)?.set(l)})}),e.forEach(r=>r.measureEndState()),e.forEach(r=>{r.suspendedScrollY!==void 0&&window.scrollTo(0,r.suspendedScrollY)})}yv=!1,vv=!1,hs.forEach(e=>e.complete(bv)),hs.clear()}function nR(){hs.forEach(e=>{e.readKeyframes(),e.needsMeasurement&&(yv=!0)})}function yG(){bv=!0,nR(),tR(),bv=!1}class Wy{constructor(t,n,r,a,o,l=!1){this.state="pending",this.isAsync=!1,this.needsMeasurement=!1,this.unresolvedKeyframes=[...t],this.onComplete=n,this.name=r,this.motionValue=a,this.element=o,this.isAsync=l}scheduleResolve(){this.state="scheduled",this.isAsync?(hs.add(this),vv||(vv=!0,_t.read(nR),_t.resolveKeyframes(tR))):(this.readKeyframes(),this.complete())}readKeyframes(){const{unresolvedKeyframes:t,name:n,element:r,motionValue:a}=this;if(t[0]===null){const o=a?.get(),l=t[t.length-1];if(o!==void 0)t[0]=o;else if(r&&n){const c=r.readValue(n,l);c!=null&&(t[0]=c)}t[0]===void 0&&(t[0]=l),a&&o===void 0&&a.set(t[0])}cG(t)}setFinalKeyframe(){}measureInitialState(){}renderEndStyles(){}measureEndState(){}complete(t=!1){this.state="complete",this.onComplete(this.unresolvedKeyframes,this.finalKeyframe,t),hs.delete(this)}cancel(){this.state==="scheduled"&&(hs.delete(this),this.state="pending")}resume(){this.state==="pending"&&this.scheduleResolve()}}const bG=e=>e.startsWith("--");function xG(e,t,n){bG(t)?e.style.setProperty(t,n):e.style[t]=n}const SG={};function rR(e,t){const n=Rj(e);return()=>SG[t]??n()}const wG=rR(()=>window.ScrollTimeline!==void 0,"scrollTimeline"),iR=rR(()=>{try{document.createElement("div").animate({opacity:0},{easing:"linear(0, 1)"})}catch{return!1}return!0},"linearEasing"),tu=([e,t,n,r])=>`cubic-bezier(${e}, ${t}, ${n}, ${r})`,ST={linear:"linear",ease:"ease",easeIn:"ease-in",easeOut:"ease-out",easeInOut:"ease-in-out",circIn:tu([0,.65,.55,1]),circOut:tu([.55,0,1,.45]),backIn:tu([.31,.01,.66,-.59]),backOut:tu([.33,1.53,.69,.99])};function aR(e,t){if(e)return typeof e=="function"?iR()?Jj(e,t):"ease-out":Vj(e)?tu(e):Array.isArray(e)?e.map(n=>aR(n,t)||ST.easeOut):ST[e]}function EG(e,t,n,{delay:r=0,duration:a=300,repeat:o=0,repeatType:l="loop",ease:c="easeOut",times:d}={},f=void 0){const m={[t]:n};d&&(m.offset=d);const g=aR(c,a);Array.isArray(g)&&(m.easing=g);const v={delay:r,duration:a,easing:Array.isArray(g)?"linear":g,fill:"both",iterations:o+1,direction:l==="reverse"?"alternate":"normal"};return f&&(v.pseudoElement=f),e.animate(m,v)}function sR(e){return typeof e=="function"&&"applyToOptions"in e}function TG({type:e,...t}){return sR(e)&&iR()?e.applyToOptions(t):(t.duration??(t.duration=300),t.ease??(t.ease="easeOut"),t)}class oR extends $y{constructor(t){if(super(),this.finishedTime=null,this.isStopped=!1,this.manualStartTime=null,!t)return;const{element:n,name:r,keyframes:a,pseudoElement:o,allowFlatten:l=!1,finalKeyframe:c,onComplete:d}=t;this.isPseudoElement=!!o,this.allowFlatten=l,this.options=t,Ly(typeof t.type!="string");const f=TG(t);this.animation=EG(n,r,a,f,o),f.autoplay===!1&&this.animation.pause(),this.animation.onfinish=()=>{if(this.finishedTime=this.time,!o){const m=Ky(a,this.options,c,this.speed);this.updateMotionValue?this.updateMotionValue(m):xG(n,r,m),this.animation.cancel()}d?.(),this.notifyFinished()}}play(){this.isStopped||(this.manualStartTime=null,this.animation.play(),this.state==="finished"&&this.updateFinished())}pause(){this.animation.pause()}complete(){this.animation.finish?.()}cancel(){try{this.animation.cancel()}catch{}}stop(){if(this.isStopped)return;this.isStopped=!0;const{state:t}=this;t==="idle"||t==="finished"||(this.updateMotionValue?this.updateMotionValue():this.commitStyles(),this.isPseudoElement||this.cancel())}commitStyles(){const t=this.options?.element;!this.isPseudoElement&&t?.isConnected&&this.animation.commitStyles?.()}get duration(){const t=this.animation.effect?.getComputedTiming?.().duration||0;return Nr(Number(t))}get iterationDuration(){const{delay:t=0}=this.options||{};return this.duration+Nr(t)}get time(){return Nr(Number(this.animation.currentTime)||0)}set time(t){this.manualStartTime=null,this.finishedTime=null,this.animation.currentTime=Hr(t)}get speed(){return this.animation.playbackRate}set speed(t){t<0&&(this.finishedTime=null),this.animation.playbackRate=t}get state(){return this.finishedTime!==null?"finished":this.animation.playState}get startTime(){return this.manualStartTime??Number(this.animation.startTime)}set startTime(t){this.manualStartTime=this.animation.startTime=t}attachTimeline({timeline:t,observe:n}){return this.allowFlatten&&this.animation.effect?.updateTiming({easing:"linear"}),this.animation.onfinish=null,t&&wG()?(this.animation.timeline=t,_r):n(this)}}const lR={anticipate:Lj,backInOut:Pj,circInOut:Uj};function kG(e){return e in lR}function CG(e){typeof e.ease=="string"&&kG(e.ease)&&(e.ease=lR[e.ease])}const eg=10;class AG extends oR{constructor(t){CG(t),eR(t),super(t),t.startTime!==void 0&&(this.startTime=t.startTime),this.options=t}updateMotionValue(t){const{motionValue:n,onUpdate:r,onComplete:a,element:o,...l}=this.options;if(!n)return;if(t!==void 0){n.set(t);return}const c=new Yy({...l,autoplay:!1}),d=Math.max(eg,Un.now()-this.startTime),f=di(0,eg,d-eg);n.setWithVelocity(c.sample(Math.max(0,d-f)).value,c.sample(d).value,f),c.stop()}}const wT=(e,t)=>t==="zIndex"?!1:!!(typeof e=="number"||Array.isArray(e)||typeof e=="string"&&(qr.test(e)||e==="0")&&!e.startsWith("url("));function NG(e){const t=e[0];if(e.length===1)return!0;for(let n=0;n<e.length;n++)if(e[n]!==t)return!0}function jG(e,t,n,r){const a=e[0];if(a===null)return!1;if(t==="display"||t==="visibility")return!0;const o=e[e.length-1],l=wT(a,t),c=wT(o,t);return!l||!c?!1:NG(e)||(n==="spring"||sR(n))&&r}function xv(e){e.duration=0,e.type="keyframes"}const RG=new Set(["opacity","clipPath","filter","transform"]),_G=Rj(()=>Object.hasOwnProperty.call(Element.prototype,"animate"));function OG(e){const{motionValue:t,name:n,repeatDelay:r,repeatType:a,damping:o,type:l}=e;if(!(t?.owner?.current instanceof HTMLElement))return!1;const{onUpdate:d,transformTemplate:f}=t.owner.getProps();return _G()&&n&&RG.has(n)&&(n!=="transform"||!f)&&!d&&!r&&a!=="mirror"&&o!==0&&l!=="inertia"}const MG=40;class DG extends $y{constructor({autoplay:t=!0,delay:n=0,type:r="keyframes",repeat:a=0,repeatDelay:o=0,repeatType:l="loop",keyframes:c,name:d,motionValue:f,element:m,...g}){super(),this.stop=()=>{this._animation&&(this._animation.stop(),this.stopTimeline?.()),this.keyframeResolver?.cancel()},this.createdAt=Un.now();const v={autoplay:t,delay:n,type:r,repeat:a,repeatDelay:o,repeatType:l,name:d,motionValue:f,element:m,...g},b=m?.KeyframeResolver||Wy;this.keyframeResolver=new b(c,(S,w,E)=>this.onKeyframesResolved(S,w,v,!E),d,f,m),this.keyframeResolver?.scheduleResolve()}onKeyframesResolved(t,n,r,a){this.keyframeResolver=void 0;const{name:o,type:l,velocity:c,delay:d,isHandoff:f,onUpdate:m}=r;this.resolvedAt=Un.now(),jG(t,o,l,c)||((Vi.instantAnimations||!d)&&m?.(Ky(t,r,n)),t[0]=t[t.length-1],xv(r),r.repeat=0);const v={startTime:a?this.resolvedAt?this.resolvedAt-this.createdAt>MG?this.resolvedAt:this.createdAt:this.createdAt:void 0,finalKeyframe:n,...r,keyframes:t},b=!f&&OG(v),S=v.motionValue?.owner?.current,w=b?new AG({...v,element:S}):new Yy(v);w.finished.then(()=>{this.notifyFinished()}).catch(_r),this.pendingTimeline&&(this.stopTimeline=w.attachTimeline(this.pendingTimeline),this.pendingTimeline=void 0),this._animation=w}get finished(){return this._animation?this.animation.finished:this._finished}then(t,n){return this.finished.finally(t).then(()=>{})}get animation(){return this._animation||(this.keyframeResolver?.resume(),yG()),this._animation}get duration(){return this.animation.duration}get iterationDuration(){return this.animation.iterationDuration}get time(){return this.animation.time}set time(t){this.animation.time=t}get speed(){return this.animation.speed}get state(){return this.animation.state}set speed(t){this.animation.speed=t}get startTime(){return this.animation.startTime}attachTimeline(t){return this._animation?this.stopTimeline=this.animation.attachTimeline(t):this.pendingTimeline=t,()=>this.stop()}play(){this.animation.play()}pause(){this.animation.pause()}complete(){this.animation.complete()}cancel(){this._animation&&this.animation.cancel(),this.keyframeResolver?.cancel()}}function uR(e,t,n,r=0,a=1){const o=Array.from(e).sort((f,m)=>f.sortNodePosition(m)).indexOf(t),l=e.size,c=(l-1)*r;return typeof n=="function"?n(o,l):a===1?o*r:c-o*r}const IG=/^var\(--(?:([\w-]+)|([\w-]+), ?([a-zA-Z\d ()%#.,-]+))\)/u;function PG(e){const t=IG.exec(e);if(!t)return[,];const[,n,r,a]=t;return[`--${n??r}`,a]}function cR(e,t,n=1){const[r,a]=PG(e);if(!r)return;const o=window.getComputedStyle(t).getPropertyValue(r);if(o){const l=o.trim();return Aj(l)?parseFloat(l):l}return Vy(a)?cR(a,t,n+1):a}const LG={type:"spring",stiffness:500,damping:25,restSpeed:10},zG=e=>({type:"spring",stiffness:550,damping:e===0?2*Math.sqrt(550):30,restSpeed:10}),UG={type:"keyframes",duration:.8},BG={type:"keyframes",ease:[.25,.1,.35,1],duration:.3},VG=(e,{keyframes:t})=>t.length>2?UG:Bo.has(e)?e.startsWith("scale")?zG(t[1]):LG:BG,FG=e=>e!==null;function HG(e,{repeat:t,repeatType:n="loop"},r){const a=e.filter(FG),o=t&&n!=="loop"&&t%2===1?0:a.length-1;return a[o]}function dR(e,t){if(e?.inherit&&t){const{inherit:n,...r}=e;return{...t,...r}}return e}function Xy(e,t){const n=e?.[t]??e?.default??e;return n!==e?dR(n,e):n}function qG({when:e,delay:t,delayChildren:n,staggerChildren:r,staggerDirection:a,repeat:o,repeatType:l,repeatDelay:c,from:d,elapsed:f,...m}){return!!Object.keys(m).length}const Qy=(e,t,n,r={},a,o)=>l=>{const c=Xy(r,e)||{},d=c.delay||r.delay||0;let{elapsed:f=0}=r;f=f-Hr(d);const m={keyframes:Array.isArray(n)?n:[null,n],ease:"easeOut",velocity:t.getVelocity(),...c,delay:-f,onUpdate:v=>{t.set(v),c.onUpdate&&c.onUpdate(v)},onComplete:()=>{l(),c.onComplete&&c.onComplete()},name:e,motionValue:t,element:o?void 0:a};qG(c)||Object.assign(m,VG(e,m)),m.duration&&(m.duration=Hr(m.duration)),m.repeatDelay&&(m.repeatDelay=Hr(m.repeatDelay)),m.from!==void 0&&(m.keyframes[0]=m.from);let g=!1;if((m.type===!1||m.duration===0&&!m.repeatDelay)&&(xv(m),m.delay===0&&(g=!0)),(Vi.instantAnimations||Vi.skipAnimations||a?.shouldSkipAnimations)&&(g=!0,xv(m),m.delay=0),m.allowFlatten=!c.type&&!c.ease,g&&!o&&t.get()!==void 0){const v=HG(m.keyframes,c);if(v!==void 0){_t.update(()=>{m.onUpdate(v),m.onComplete()});return}}return c.isSync?new Yy(m):new DG(m)};function ET(e){const t=[{},{}];return e?.values.forEach((n,r)=>{t[0][r]=n.get(),t[1][r]=n.getVelocity()}),t}function Jy(e,t,n,r){if(typeof t=="function"){const[a,o]=ET(r);t=t(n!==void 0?n:e.custom,a,o)}if(typeof t=="string"&&(t=e.variants&&e.variants[t]),typeof t=="function"){const[a,o]=ET(r);t=t(n!==void 0?n:e.custom,a,o)}return t}function wo(e,t,n){const r=e.getProps();return Jy(r,t,n!==void 0?n:r.custom,e)}const fR=new Set(["width","height","top","left","right","bottom",...Uo]),TT=30,GG=e=>!isNaN(parseFloat(e));class KG{constructor(t,n={}){this.canTrackVelocity=null,this.events={},this.updateAndNotify=r=>{const a=Un.now();if(this.updatedAt!==a&&this.setPrevFrameValue(),this.prev=this.current,this.setCurrent(r),this.current!==this.prev&&(this.events.change?.notify(this.current),this.dependents))for(const o of this.dependents)o.dirty()},this.hasAnimated=!1,this.setCurrent(t),this.owner=n.owner}setCurrent(t){this.current=t,this.updatedAt=Un.now(),this.canTrackVelocity===null&&t!==void 0&&(this.canTrackVelocity=GG(this.current))}setPrevFrameValue(t=this.current){this.prevFrameValue=t,this.prevUpdatedAt=this.updatedAt}onChange(t){return this.on("change",t)}on(t,n){this.events[t]||(this.events[t]=new zy);const r=this.events[t].add(n);return t==="change"?()=>{r(),_t.read(()=>{this.events.change.getSize()||this.stop()})}:r}clearListeners(){for(const t in this.events)this.events[t].clear()}attach(t,n){this.passiveEffect=t,this.stopPassiveEffect=n}set(t){this.passiveEffect?this.passiveEffect(t,this.updateAndNotify):this.updateAndNotify(t)}setWithVelocity(t,n,r){this.set(n),this.prev=void 0,this.prevFrameValue=t,this.prevUpdatedAt=this.updatedAt-r}jump(t,n=!0){this.updateAndNotify(t),this.prev=t,this.prevUpdatedAt=this.prevFrameValue=void 0,n&&this.stop(),this.stopPassiveEffect&&this.stopPassiveEffect()}dirty(){this.events.change?.notify(this.current)}addDependent(t){this.dependents||(this.dependents=new Set),this.dependents.add(t)}removeDependent(t){this.dependents&&this.dependents.delete(t)}get(){return this.current}getPrevious(){return this.prev}getVelocity(){const t=Un.now();if(!this.canTrackVelocity||this.prevFrameValue===void 0||t-this.updatedAt>TT)return 0;const n=Math.min(this.updatedAt-this.prevUpdatedAt,TT);return _j(parseFloat(this.current)-parseFloat(this.prevFrameValue),n)}start(t){return this.stop(),new Promise(n=>{this.hasAnimated=!0,this.animation=t(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(){this.dependents?.clear(),this.events.destroy?.notify(),this.clearListeners(),this.stop(),this.stopPassiveEffect&&this.stopPassiveEffect()}}function No(e,t){return new KG(e,t)}const Sv=e=>Array.isArray(e);function $G(e,t,n){e.hasValue(t)?e.getValue(t).set(n):e.addValue(t,No(n))}function YG(e){return Sv(e)?e[e.length-1]||0:e}function WG(e,t){const n=wo(e,t);let{transitionEnd:r={},transition:a={},...o}=n||{};o={...o,...r};for(const l in o){const c=YG(o[l]);$G(e,l,c)}}const Rn=e=>!!(e&&e.getVelocity);function XG(e){return!!(Rn(e)&&e.add)}function wv(e,t){const n=e.getValue("willChange");if(XG(n))return n.add(t);if(!n&&Vi.WillChange){const r=new Vi.WillChange("auto");e.addValue("willChange",r),r.add(t)}}function Zy(e){return e.replace(/([A-Z])/g,t=>`-${t.toLowerCase()}`)}const QG="framerAppearId",hR="data-"+Zy(QG);function pR(e){return e.props[hR]}function JG({protectedKeys:e,needsAnimating:t},n){const r=e.hasOwnProperty(n)&&t[n]!==!0;return t[n]=!1,r}function mR(e,t,{delay:n=0,transitionOverride:r,type:a}={}){let{transition:o,transitionEnd:l,...c}=t;const d=e.getDefaultTransition();o=o?dR(o,d):d;const f=o?.reduceMotion;r&&(o=r);const m=[],g=a&&e.animationState&&e.animationState.getState()[a];for(const v in c){const b=e.getValue(v,e.latestValues[v]??null),S=c[v];if(S===void 0||g&&JG(g,v))continue;const w={delay:n,...Xy(o||{},v)},E=b.get();if(E!==void 0&&!b.isAnimating&&!Array.isArray(S)&&S===E&&!w.velocity)continue;let T=!1;if(window.MotionHandoffAnimation){const j=pR(e);if(j){const N=window.MotionHandoffAnimation(j,v,_t);N!==null&&(w.startTime=N,T=!0)}}wv(e,v);const C=f??e.shouldReduceMotion;b.start(Qy(v,b,S,C&&fR.has(v)?{type:!1}:w,e,T));const k=b.animation;k&&m.push(k)}if(l){const v=()=>_t.update(()=>{l&&WG(e,l)});m.length?Promise.all(m).then(v):v()}return m}function Ev(e,t,n={}){const r=wo(e,t,n.type==="exit"?e.presenceContext?.custom:void 0);let{transition:a=e.getDefaultTransition()||{}}=r||{};n.transitionOverride&&(a=n.transitionOverride);const o=r?()=>Promise.all(mR(e,r,n)):()=>Promise.resolve(),l=e.variantChildren&&e.variantChildren.size?(d=0)=>{const{delayChildren:f=0,staggerChildren:m,staggerDirection:g}=a;return ZG(e,t,d,f,m,g,n)}:()=>Promise.resolve(),{when:c}=a;if(c){const[d,f]=c==="beforeChildren"?[o,l]:[l,o];return d().then(()=>f())}else return Promise.all([o(),l(n.delay)])}function ZG(e,t,n=0,r=0,a=0,o=1,l){const c=[];for(const d of e.variantChildren)d.notify("AnimationStart",t),c.push(Ev(d,t,{...l,delay:n+(typeof r=="function"?0:r)+uR(e.variantChildren,d,r,a,o)}).then(()=>d.notify("AnimationComplete",t)));return Promise.all(c)}function e7(e,t,n={}){e.notify("AnimationStart",t);let r;if(Array.isArray(t)){const a=t.map(o=>Ev(e,o,n));r=Promise.all(a)}else if(typeof t=="string")r=Ev(e,t,n);else{const a=typeof t=="function"?wo(e,t,n.custom):t;r=Promise.all(mR(e,a,n))}return r.then(()=>{e.notify("AnimationComplete",t)})}const t7={test:e=>e==="auto",parse:e=>e},gR=e=>t=>t.test(e),vR=[zo,Ce,li,ga,R9,j9,t7],kT=e=>vR.find(gR(e));function n7(e){return typeof e=="number"?e===0:e!==null?e==="none"||e==="0"||jj(e):!0}const r7=new Set(["brightness","contrast","saturate","opacity"]);function i7(e){const[t,n]=e.slice(0,-1).split("(");if(t==="drop-shadow")return e;const[r]=n.match(Fy)||[];if(!r)return e;const a=n.replace(r,"");let o=r7.has(t)?1:0;return r!==n&&(o*=100),t+"("+o+a+")"}const a7=/\b([a-z-]*)\(.*?\)/gu,Tv={...qr,getAnimatableNone:e=>{const t=e.match(a7);return t?t.map(i7).join(" "):e}},kv={...qr,getAnimatableNone:e=>{const t=qr.parse(e);return qr.createTransformer(e)(t.map(r=>typeof r=="number"?0:typeof r=="object"?{...r,alpha:1}:r))}},CT={...zo,transform:Math.round},s7={rotate:ga,rotateX:ga,rotateY:ga,rotateZ:ga,scale:kd,scaleX:kd,scaleY:kd,scaleZ:kd,skew:ga,skewX:ga,skewY:ga,distance:Ce,translateX:Ce,translateY:Ce,translateZ:Ce,x:Ce,y:Ce,z:Ce,perspective:Ce,transformPerspective:Ce,opacity:Cu,originX:fT,originY:fT,originZ:Ce},e0={borderWidth:Ce,borderTopWidth:Ce,borderRightWidth:Ce,borderBottomWidth:Ce,borderLeftWidth:Ce,borderRadius:Ce,borderTopLeftRadius:Ce,borderTopRightRadius:Ce,borderBottomRightRadius:Ce,borderBottomLeftRadius:Ce,width:Ce,maxWidth:Ce,height:Ce,maxHeight:Ce,top:Ce,right:Ce,bottom:Ce,left:Ce,inset:Ce,insetBlock:Ce,insetBlockStart:Ce,insetBlockEnd:Ce,insetInline:Ce,insetInlineStart:Ce,insetInlineEnd:Ce,padding:Ce,paddingTop:Ce,paddingRight:Ce,paddingBottom:Ce,paddingLeft:Ce,paddingBlock:Ce,paddingBlockStart:Ce,paddingBlockEnd:Ce,paddingInline:Ce,paddingInlineStart:Ce,paddingInlineEnd:Ce,margin:Ce,marginTop:Ce,marginRight:Ce,marginBottom:Ce,marginLeft:Ce,marginBlock:Ce,marginBlockStart:Ce,marginBlockEnd:Ce,marginInline:Ce,marginInlineStart:Ce,marginInlineEnd:Ce,fontSize:Ce,backgroundPositionX:Ce,backgroundPositionY:Ce,...s7,zIndex:CT,fillOpacity:Cu,strokeOpacity:Cu,numOctaves:CT},o7={...e0,color:on,backgroundColor:on,outlineColor:on,fill:on,stroke:on,borderColor:on,borderTopColor:on,borderRightColor:on,borderBottomColor:on,borderLeftColor:on,filter:Tv,WebkitFilter:Tv,mask:kv,WebkitMask:kv},yR=e=>o7[e],l7=new Set([Tv,kv]);function bR(e,t){let n=yR(e);return l7.has(n)||(n=qr),n.getAnimatableNone?n.getAnimatableNone(t):void 0}const u7=new Set(["auto","none","0"]);function c7(e,t,n){let r=0,a;for(;r<e.length&&!a;){const o=e[r];typeof o=="string"&&!u7.has(o)&&Au(o).values.length&&(a=e[r]),r++}if(a&&n)for(const o of t)e[o]=bR(n,a)}class d7 extends Wy{constructor(t,n,r,a,o){super(t,n,r,a,o,!0)}readKeyframes(){const{unresolvedKeyframes:t,element:n,name:r}=this;if(!n||!n.current)return;super.readKeyframes();for(let m=0;m<t.length;m++){let g=t[m];if(typeof g=="string"&&(g=g.trim(),Vy(g))){const v=cR(g,n.current);v!==void 0&&(t[m]=v),m===t.length-1&&(this.finalKeyframe=g)}}if(this.resolveNoneKeyframes(),!fR.has(r)||t.length!==2)return;const[a,o]=t,l=kT(a),c=kT(o),d=dT(a),f=dT(o);if(d!==f&&Aa[r]){this.needsMeasurement=!0;return}if(l!==c)if(xT(l)&&xT(c))for(let m=0;m<t.length;m++){const g=t[m];typeof g=="string"&&(t[m]=parseFloat(g))}else Aa[r]&&(this.needsMeasurement=!0)}resolveNoneKeyframes(){const{unresolvedKeyframes:t,name:n}=this,r=[];for(let a=0;a<t.length;a++)(t[a]===null||n7(t[a]))&&r.push(a);r.length&&c7(t,r,n)}measureInitialState(){const{element:t,unresolvedKeyframes:n,name:r}=this;if(!t||!t.current)return;r==="height"&&(this.suspendedScrollY=window.pageYOffset),this.measuredOrigin=Aa[r](t.measureViewportBox(),window.getComputedStyle(t.current)),n[0]=this.measuredOrigin;const a=n[n.length-1];a!==void 0&&t.getValue(r,a).jump(a,!1)}measureEndState(){const{element:t,name:n,unresolvedKeyframes:r}=this;if(!t||!t.current)return;const a=t.getValue(n);a&&a.jump(this.measuredOrigin,!1);const o=r.length-1,l=r[o];r[o]=Aa[n](t.measureViewportBox(),window.getComputedStyle(t.current)),l!==null&&this.finalKeyframe===void 0&&(this.finalKeyframe=l),this.removedTransforms?.length&&this.removedTransforms.forEach(([c,d])=>{t.getValue(c).set(d)}),this.resolveNoneKeyframes()}}const f7=new Set(["opacity","clipPath","filter","transform"]);function xR(e,t,n){if(e==null)return[];if(e instanceof EventTarget)return[e];if(typeof e=="string"){let r=document;const a=n?.[e]??r.querySelectorAll(e);return a?Array.from(a):[]}return Array.from(e).filter(r=>r!=null)}const SR=(e,t)=>t&&typeof e=="number"?t.transform(e):e;function h7(e){return Nj(e)&&"offsetHeight"in e}const{schedule:t0}=Fj(queueMicrotask,!1),Br={x:!1,y:!1};function wR(){return Br.x||Br.y}function p7(e){return e==="x"||e==="y"?Br[e]?null:(Br[e]=!0,()=>{Br[e]=!1}):Br.x||Br.y?null:(Br.x=Br.y=!0,()=>{Br.x=Br.y=!1})}function ER(e,t){const n=xR(e),r=new AbortController,a={passive:!0,...t,signal:r.signal};return[n,a,()=>r.abort()]}function m7(e){return!(e.pointerType==="touch"||wR())}function g7(e,t,n={}){const[r,a,o]=ER(e,n);return r.forEach(l=>{let c=!1,d=!1,f;const m=()=>{l.removeEventListener("pointerleave",S)},g=E=>{f&&(f(E),f=void 0),m()},v=E=>{c=!1,window.removeEventListener("pointerup",v),window.removeEventListener("pointercancel",v),d&&(d=!1,g(E))},b=()=>{c=!0,window.addEventListener("pointerup",v,a),window.addEventListener("pointercancel",v,a)},S=E=>{if(E.pointerType!=="touch"){if(c){d=!0;return}g(E)}},w=E=>{if(!m7(E))return;d=!1;const T=t(l,E);typeof T=="function"&&(f=T,l.addEventListener("pointerleave",S,a))};l.addEventListener("pointerenter",w,a),l.addEventListener("pointerdown",b,a)}),o}const TR=(e,t)=>t?e===t?!0:TR(e,t.parentElement):!1,n0=e=>e.pointerType==="mouse"?typeof e.button!="number"||e.button<=0:e.isPrimary!==!1,v7=new Set(["BUTTON","INPUT","SELECT","TEXTAREA","A"]);function y7(e){return v7.has(e.tagName)||e.isContentEditable===!0}const b7=new Set(["INPUT","SELECT","TEXTAREA"]);function x7(e){return b7.has(e.tagName)||e.isContentEditable===!0}const Gd=new WeakSet;function AT(e){return t=>{t.key==="Enter"&&e(t)}}function tg(e,t){e.dispatchEvent(new PointerEvent("pointer"+t,{isPrimary:!0,bubbles:!0}))}const S7=(e,t)=>{const n=e.currentTarget;if(!n)return;const r=AT(()=>{if(Gd.has(n))return;tg(n,"down");const a=AT(()=>{tg(n,"up")}),o=()=>tg(n,"cancel");n.addEventListener("keyup",a,t),n.addEventListener("blur",o,t)});n.addEventListener("keydown",r,t),n.addEventListener("blur",()=>n.removeEventListener("keydown",r),t)};function NT(e){return n0(e)&&!wR()}const jT=new WeakSet;function w7(e,t,n={}){const[r,a,o]=ER(e,n),l=c=>{const d=c.currentTarget;if(!NT(c)||jT.has(c))return;Gd.add(d),n.stopPropagation&&jT.add(c);const f=t(d,c),m=(b,S)=>{window.removeEventListener("pointerup",g),window.removeEventListener("pointercancel",v),Gd.has(d)&&Gd.delete(d),NT(b)&&typeof f=="function"&&f(b,{success:S})},g=b=>{m(b,d===window||d===document||n.useGlobalTarget||TR(d,b.target))},v=b=>{m(b,!1)};window.addEventListener("pointerup",g,a),window.addEventListener("pointercancel",v,a)};return r.forEach(c=>{(n.useGlobalTarget?window:c).addEventListener("pointerdown",l,a),h7(c)&&(c.addEventListener("focus",f=>S7(f,a)),!y7(c)&&!c.hasAttribute("tabindex")&&(c.tabIndex=0))}),o}function r0(e){return Nj(e)&&"ownerSVGElement"in e}const Kd=new WeakMap;let $d;const kR=(e,t,n)=>(r,a)=>a&&a[0]?a[0][e+"Size"]:r0(r)&&"getBBox"in r?r.getBBox()[t]:r[n],E7=kR("inline","width","offsetWidth"),T7=kR("block","height","offsetHeight");function k7({target:e,borderBoxSize:t}){Kd.get(e)?.forEach(n=>{n(e,{get width(){return E7(e,t)},get height(){return T7(e,t)}})})}function C7(e){e.forEach(k7)}function A7(){typeof ResizeObserver>"u"||($d=new ResizeObserver(C7))}function N7(e,t){$d||A7();const n=xR(e);return n.forEach(r=>{let a=Kd.get(r);a||(a=new Set,Kd.set(r,a)),a.add(t),$d?.observe(r)}),()=>{n.forEach(r=>{const a=Kd.get(r);a?.delete(t),a?.size||$d?.unobserve(r)})}}const Yd=new Set;let ho;function j7(){ho=()=>{const e={get width(){return window.innerWidth},get height(){return window.innerHeight}};Yd.forEach(t=>t(e))},window.addEventListener("resize",ho)}function R7(e){return Yd.add(e),ho||j7(),()=>{Yd.delete(e),!Yd.size&&typeof ho=="function"&&(window.removeEventListener("resize",ho),ho=void 0)}}function RT(e,t){return typeof e=="function"?R7(e):N7(e,t)}function _7(e){return r0(e)&&e.tagName==="svg"}const O7=[...vR,on,qr],M7=e=>O7.find(gR(e)),_T=()=>({translate:0,scale:1,origin:0,originPoint:0}),po=()=>({x:_T(),y:_T()}),OT=()=>({min:0,max:0}),fn=()=>({x:OT(),y:OT()}),D7=new WeakMap;function Bf(e){return e!==null&&typeof e=="object"&&typeof e.start=="function"}function Nu(e){return typeof e=="string"||Array.isArray(e)}const i0=["animate","whileInView","whileFocus","whileHover","whileTap","whileDrag","exit"],a0=["initial",...i0];function Vf(e){return Bf(e.animate)||a0.some(t=>Nu(e[t]))}function CR(e){return!!(Vf(e)||e.variants)}function I7(e,t,n){for(const r in t){const a=t[r],o=n[r];if(Rn(a))e.addValue(r,a);else if(Rn(o))e.addValue(r,No(a,{owner:e}));else if(o!==a)if(e.hasValue(r)){const l=e.getValue(r);l.liveStyle===!0?l.jump(a):l.hasAnimated||l.set(a)}else{const l=e.getStaticValue(r);e.addValue(r,No(l!==void 0?l:a,{owner:e}))}}for(const r in n)t[r]===void 0&&e.removeValue(r);return t}const Cv={current:null},AR={current:!1},P7=typeof window<"u";function L7(){if(AR.current=!0,!!P7)if(window.matchMedia){const e=window.matchMedia("(prefers-reduced-motion)"),t=()=>Cv.current=e.matches;e.addEventListener("change",t),t()}else Cv.current=!1}const MT=["AnimationStart","AnimationComplete","Update","BeforeLayoutMeasure","LayoutMeasure","LayoutAnimationStart","LayoutAnimationComplete"];let vf={};function NR(e){vf=e}function z7(){return vf}class U7{scrapeMotionValuesFromProps(t,n,r){return{}}constructor({parent:t,props:n,presenceContext:r,reducedMotionConfig:a,skipAnimations:o,blockInitialAnimation:l,visualState:c},d={}){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=Wy,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 b=Un.now();this.renderScheduledAt<b&&(this.renderScheduledAt=b,_t.render(this.render,!1,!0))};const{latestValues:f,renderState:m}=c;this.latestValues=f,this.baseTarget={...f},this.initialValues=n.initial?{...f}:{},this.renderState=m,this.parent=t,this.props=n,this.presenceContext=r,this.depth=t?t.depth+1:0,this.reducedMotionConfig=a,this.skipAnimationsConfig=o,this.options=d,this.blockInitialAnimation=!!l,this.isControllingVariants=Vf(n),this.isVariantNode=CR(n),this.isVariantNode&&(this.variantChildren=new Set),this.manuallyAnimateOnMount=!!(t&&t.current);const{willChange:g,...v}=this.scrapeMotionValuesFromProps(n,{},this);for(const b in v){const S=v[b];f[b]!==void 0&&Rn(S)&&S.set(f[b])}}mount(t){if(this.hasBeenMounted)for(const n in this.initialValues)this.values.get(n)?.jump(this.initialValues[n]),this.latestValues[n]=this.initialValues[n];this.current=t,D7.set(t,this),this.projection&&!this.projection.instance&&this.projection.mount(t),this.parent&&this.isVariantNode&&!this.isControllingVariants&&(this.removeFromVariantTree=this.parent.addVariantChild(this)),this.values.forEach((n,r)=>this.bindToMotionValue(r,n)),this.reducedMotionConfig==="never"?this.shouldReduceMotion=!1:this.reducedMotionConfig==="always"?this.shouldReduceMotion=!0:(AR.current||L7(),this.shouldReduceMotion=Cv.current),this.shouldSkipAnimations=this.skipAnimationsConfig??!1,this.parent?.addChild(this),this.update(this.props,this.presenceContext),this.hasBeenMounted=!0}unmount(){this.projection&&this.projection.unmount(),Ra(this.notifyUpdate),Ra(this.render),this.valueSubscriptions.forEach(t=>t()),this.valueSubscriptions.clear(),this.removeFromVariantTree&&this.removeFromVariantTree(),this.parent?.removeChild(this);for(const t in this.events)this.events[t].clear();for(const t in this.features){const n=this.features[t];n&&(n.unmount(),n.isMounted=!1)}this.current=null}addChild(t){this.children.add(t),this.enteringChildren??(this.enteringChildren=new Set),this.enteringChildren.add(t)}removeChild(t){this.children.delete(t),this.enteringChildren&&this.enteringChildren.delete(t)}bindToMotionValue(t,n){if(this.valueSubscriptions.has(t)&&this.valueSubscriptions.get(t)(),n.accelerate&&f7.has(t)&&this.current instanceof HTMLElement){const{factory:l,keyframes:c,times:d,ease:f,duration:m}=n.accelerate,g=new oR({element:this.current,name:t,keyframes:c,times:d,ease:f,duration:Hr(m)}),v=l(g);this.valueSubscriptions.set(t,()=>{v(),g.cancel()});return}const r=Bo.has(t);r&&this.onBindTransform&&this.onBindTransform();const a=n.on("change",l=>{this.latestValues[t]=l,this.props.onUpdate&&_t.preRender(this.notifyUpdate),r&&this.projection&&(this.projection.isTransformDirty=!0),this.scheduleRender()});let o;typeof window<"u"&&window.MotionCheckAppearSync&&(o=window.MotionCheckAppearSync(this,t,n)),this.valueSubscriptions.set(t,()=>{a(),o&&o(),n.owner&&n.stop()})}sortNodePosition(t){return!this.current||!this.sortInstanceNodePosition||this.type!==t.type?0:this.sortInstanceNodePosition(this.current,t.current)}updateFeatures(){let t="animation";for(t in vf){const n=vf[t];if(!n)continue;const{isEnabled:r,Feature:a}=n;if(!this.features[t]&&a&&r(this.props)&&(this.features[t]=new a(this)),this.features[t]){const o=this.features[t];o.isMounted?o.update():(o.mount(),o.isMounted=!0)}}}triggerBuild(){this.build(this.renderState,this.latestValues,this.props)}measureViewportBox(){return this.current?this.measureInstanceViewportBox(this.current,this.props):fn()}getStaticValue(t){return this.latestValues[t]}setStaticValue(t,n){this.latestValues[t]=n}update(t,n){(t.transformTemplate||this.props.transformTemplate)&&this.scheduleRender(),this.prevProps=this.props,this.props=t,this.prevPresenceContext=this.presenceContext,this.presenceContext=n;for(let r=0;r<MT.length;r++){const a=MT[r];this.propEventSubscriptions[a]&&(this.propEventSubscriptions[a](),delete this.propEventSubscriptions[a]);const o="on"+a,l=t[o];l&&(this.propEventSubscriptions[a]=this.on(a,l))}this.prevMotionValues=I7(this,this.scrapeMotionValuesFromProps(t,this.prevProps||{},this),this.prevMotionValues),this.handleChildMotionValue&&this.handleChildMotionValue()}getProps(){return this.props}getVariant(t){return this.props.variants?this.props.variants[t]: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(t){const n=this.getClosestVariantNode();if(n)return n.variantChildren&&n.variantChildren.add(t),()=>n.variantChildren.delete(t)}addValue(t,n){const r=this.values.get(t);n!==r&&(r&&this.removeValue(t),this.bindToMotionValue(t,n),this.values.set(t,n),this.latestValues[t]=n.get())}removeValue(t){this.values.delete(t);const n=this.valueSubscriptions.get(t);n&&(n(),this.valueSubscriptions.delete(t)),delete this.latestValues[t],this.removeValueFromRenderState(t,this.renderState)}hasValue(t){return this.values.has(t)}getValue(t,n){if(this.props.values&&this.props.values[t])return this.props.values[t];let r=this.values.get(t);return r===void 0&&n!==void 0&&(r=No(n===null?void 0:n,{owner:this}),this.addValue(t,r)),r}readValue(t,n){let r=this.latestValues[t]!==void 0||!this.current?this.latestValues[t]:this.getBaseTargetFromProps(this.props,t)??this.readValueFromInstance(this.current,t,this.options);return r!=null&&(typeof r=="string"&&(Aj(r)||jj(r))?r=parseFloat(r):!M7(r)&&qr.test(n)&&(r=bR(t,n)),this.setBaseTarget(t,Rn(r)?r.get():r)),Rn(r)?r.get():r}setBaseTarget(t,n){this.baseTarget[t]=n}getBaseTarget(t){const{initial:n}=this.props;let r;if(typeof n=="string"||typeof n=="object"){const o=Jy(this.props,n,this.presenceContext?.custom);o&&(r=o[t])}if(n&&r!==void 0)return r;const a=this.getBaseTargetFromProps(this.props,t);return a!==void 0&&!Rn(a)?a:this.initialValues[t]!==void 0&&r===void 0?void 0:this.baseTarget[t]}on(t,n){return this.events[t]||(this.events[t]=new zy),this.events[t].add(n)}notify(t,...n){this.events[t]&&this.events[t].notify(...n)}scheduleRenderMicrotask(){t0.render(this.render)}}class jR extends U7{constructor(){super(...arguments),this.KeyframeResolver=d7}sortInstanceNodePosition(t,n){return t.compareDocumentPosition(n)&2?1:-1}getBaseTargetFromProps(t,n){const r=t.style;return r?r[n]:void 0}removeValueFromRenderState(t,{vars:n,style:r}){delete n[t],delete r[t]}handleChildMotionValue(){this.childSubscription&&(this.childSubscription(),delete this.childSubscription);const{children:t}=this.props;Rn(t)&&(this.childSubscription=t.on("change",n=>{this.current&&(this.current.textContent=`${n}`)}))}}class Ma{constructor(t){this.isMounted=!1,this.node=t}update(){}}function RR({top:e,left:t,right:n,bottom:r}){return{x:{min:t,max:n},y:{min:e,max:r}}}function B7({x:e,y:t}){return{top:t.min,right:e.max,bottom:t.max,left:e.min}}function V7(e,t){if(!t)return e;const n=t({x:e.left,y:e.top}),r=t({x:e.right,y:e.bottom});return{top:n.y,left:n.x,bottom:r.y,right:r.x}}function ng(e){return e===void 0||e===1}function Av({scale:e,scaleX:t,scaleY:n}){return!ng(e)||!ng(t)||!ng(n)}function os(e){return Av(e)||_R(e)||e.z||e.rotate||e.rotateX||e.rotateY||e.skewX||e.skewY}function _R(e){return DT(e.x)||DT(e.y)}function DT(e){return e&&e!=="0%"}function yf(e,t,n){const r=e-n,a=t*r;return n+a}function IT(e,t,n,r,a){return a!==void 0&&(e=yf(e,a,r)),yf(e,n,r)+t}function Nv(e,t=0,n=1,r,a){e.min=IT(e.min,t,n,r,a),e.max=IT(e.max,t,n,r,a)}function OR(e,{x:t,y:n}){Nv(e.x,t.translate,t.scale,t.originPoint),Nv(e.y,n.translate,n.scale,n.originPoint)}const PT=.999999999999,LT=1.0000000000001;function F7(e,t,n,r=!1){const a=n.length;if(!a)return;t.x=t.y=1;let o,l;for(let c=0;c<a;c++){o=n[c],l=o.projectionDelta;const{visualElement:d}=o.options;d&&d.props.style&&d.props.style.display==="contents"||(r&&o.options.layoutScroll&&o.scroll&&o!==o.root&&go(e,{x:-o.scroll.offset.x,y:-o.scroll.offset.y}),l&&(t.x*=l.x.scale,t.y*=l.y.scale,OR(e,l)),r&&os(o.latestValues)&&go(e,o.latestValues))}t.x<LT&&t.x>PT&&(t.x=1),t.y<LT&&t.y>PT&&(t.y=1)}function mo(e,t){e.min=e.min+t,e.max=e.max+t}function zT(e,t,n,r,a=.5){const o=Vt(e.min,e.max,a);Nv(e,t,n,o,r)}function go(e,t){zT(e.x,t.x,t.scaleX,t.scale,t.originX),zT(e.y,t.y,t.scaleY,t.scale,t.originY)}function MR(e,t){return RR(V7(e.getBoundingClientRect(),t))}function H7(e,t,n){const r=MR(e,n),{scroll:a}=t;return a&&(mo(r.x,a.offset.x),mo(r.y,a.offset.y)),r}const q7={x:"translateX",y:"translateY",z:"translateZ",transformPerspective:"perspective"},G7=Uo.length;function K7(e,t,n){let r="",a=!0;for(let o=0;o<G7;o++){const l=Uo[o],c=e[l];if(c===void 0)continue;let d=!0;if(typeof c=="number")d=c===(l.startsWith("scale")?1:0);else{const f=parseFloat(c);d=l.startsWith("scale")?f===1:f===0}if(!d||n){const f=SR(c,e0[l]);if(!d){a=!1;const m=q7[l]||l;r+=`${m}(${f}) `}n&&(t[l]=f)}}return r=r.trim(),n?r=n(t,a?"":r):a&&(r="none"),r}function s0(e,t,n){const{style:r,vars:a,transformOrigin:o}=e;let l=!1,c=!1;for(const d in t){const f=t[d];if(Bo.has(d)){l=!0;continue}else if(qj(d)){a[d]=f;continue}else{const m=SR(f,e0[d]);d.startsWith("origin")?(c=!0,o[d]=m):r[d]=m}}if(t.transform||(l||n?r.transform=K7(t,e.transform,n):r.transform&&(r.transform="none")),c){const{originX:d="50%",originY:f="50%",originZ:m=0}=o;r.transformOrigin=`${d} ${f} ${m}`}}function DR(e,{style:t,vars:n},r,a){const o=e.style;let l;for(l in t)o[l]=t[l];a?.applyProjectionStyles(o,r);for(l in n)o.setProperty(l,n[l])}function UT(e,t){return t.max===t.min?0:e/(t.max-t.min)*100}const Wl={correct:(e,t)=>{if(!t.target)return e;if(typeof e=="string")if(Ce.test(e))e=parseFloat(e);else return e;const n=UT(e,t.target.x),r=UT(e,t.target.y);return`${n}% ${r}%`}},$7={correct:(e,{treeScale:t,projectionDelta:n})=>{const r=e,a=qr.parse(e);if(a.length>5)return r;const o=qr.createTransformer(e),l=typeof a[0]!="number"?1:0,c=n.x.scale*t.x,d=n.y.scale*t.y;a[0+l]/=c,a[1+l]/=d;const f=Vt(c,d,.5);return typeof a[2+l]=="number"&&(a[2+l]/=f),typeof a[3+l]=="number"&&(a[3+l]/=f),o(a)}},jv={borderRadius:{...Wl,applyTo:["borderTopLeftRadius","borderTopRightRadius","borderBottomLeftRadius","borderBottomRightRadius"]},borderTopLeftRadius:Wl,borderTopRightRadius:Wl,borderBottomLeftRadius:Wl,borderBottomRightRadius:Wl,boxShadow:$7};function IR(e,{layout:t,layoutId:n}){return Bo.has(e)||e.startsWith("origin")||(t||n!==void 0)&&(!!jv[e]||e==="opacity")}function o0(e,t,n){const r=e.style,a=t?.style,o={};if(!r)return o;for(const l in r)(Rn(r[l])||a&&Rn(a[l])||IR(l,e)||n?.getValue(l)?.liveStyle!==void 0)&&(o[l]=r[l]);return o}function Y7(e){return window.getComputedStyle(e)}class W7 extends jR{constructor(){super(...arguments),this.type="html",this.renderInstance=DR}readValueFromInstance(t,n){if(Bo.has(n))return this.projection?.isProjecting?mv(n):hG(t,n);{const r=Y7(t),a=(qj(n)?r.getPropertyValue(n):r[n])||0;return typeof a=="string"?a.trim():a}}measureInstanceViewportBox(t,{transformPagePoint:n}){return MR(t,n)}build(t,n,r){s0(t,n,r.transformTemplate)}scrapeMotionValuesFromProps(t,n,r){return o0(t,n,r)}}const X7={offset:"stroke-dashoffset",array:"stroke-dasharray"},Q7={offset:"strokeDashoffset",array:"strokeDasharray"};function J7(e,t,n=1,r=0,a=!0){e.pathLength=1;const o=a?X7:Q7;e[o.offset]=`${-r}`,e[o.array]=`${t} ${n}`}const Z7=["offsetDistance","offsetPath","offsetRotate","offsetAnchor"];function PR(e,{attrX:t,attrY:n,attrScale:r,pathLength:a,pathSpacing:o=1,pathOffset:l=0,...c},d,f,m){if(s0(e,c,f),d){e.style.viewBox&&(e.attrs.viewBox=e.style.viewBox);return}e.attrs=e.style,e.style={};const{attrs:g,style:v}=e;g.transform&&(v.transform=g.transform,delete g.transform),(v.transform||g.transformOrigin)&&(v.transformOrigin=g.transformOrigin??"50% 50%",delete g.transformOrigin),v.transform&&(v.transformBox=m?.transformBox??"fill-box",delete g.transformBox);for(const b of Z7)g[b]!==void 0&&(v[b]=g[b],delete g[b]);t!==void 0&&(g.x=t),n!==void 0&&(g.y=n),r!==void 0&&(g.scale=r),a!==void 0&&J7(g,a,o,l,!1)}const LR=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"]),zR=e=>typeof e=="string"&&e.toLowerCase()==="svg";function eK(e,t,n,r){DR(e,t,void 0,r);for(const a in t.attrs)e.setAttribute(LR.has(a)?a:Zy(a),t.attrs[a])}function UR(e,t,n){const r=o0(e,t,n);for(const a in e)if(Rn(e[a])||Rn(t[a])){const o=Uo.indexOf(a)!==-1?"attr"+a.charAt(0).toUpperCase()+a.substring(1):a;r[o]=e[a]}return r}class tK extends jR{constructor(){super(...arguments),this.type="svg",this.isSVGTag=!1,this.measureInstanceViewportBox=fn}getBaseTargetFromProps(t,n){return t[n]}readValueFromInstance(t,n){if(Bo.has(n)){const r=yR(n);return r&&r.default||0}return n=LR.has(n)?n:Zy(n),t.getAttribute(n)}scrapeMotionValuesFromProps(t,n,r){return UR(t,n,r)}build(t,n,r){PR(t,n,this.isSVGTag,r.transformTemplate,r.style)}renderInstance(t,n,r,a){eK(t,n,r,a)}mount(t){this.isSVGTag=zR(t.tagName),super.mount(t)}}const nK=a0.length;function BR(e){if(!e)return;if(!e.isControllingVariants){const n=e.parent?BR(e.parent)||{}:{};return e.props.initial!==void 0&&(n.initial=e.props.initial),n}const t={};for(let n=0;n<nK;n++){const r=a0[n],a=e.props[r];(Nu(a)||a===!1)&&(t[r]=a)}return t}function VR(e,t){if(!Array.isArray(t))return!1;const n=t.length;if(n!==e.length)return!1;for(let r=0;r<n;r++)if(t[r]!==e[r])return!1;return!0}const rK=[...i0].reverse(),iK=i0.length;function aK(e){return t=>Promise.all(t.map(({animation:n,options:r})=>e7(e,n,r)))}function sK(e){let t=aK(e),n=BT(),r=!0;const a=d=>(f,m)=>{const g=wo(e,m,d==="exit"?e.presenceContext?.custom:void 0);if(g){const{transition:v,transitionEnd:b,...S}=g;f={...f,...S,...b}}return f};function o(d){t=d(e)}function l(d){const{props:f}=e,m=BR(e.parent)||{},g=[],v=new Set;let b={},S=1/0;for(let E=0;E<iK;E++){const T=rK[E],C=n[T],k=f[T]!==void 0?f[T]:m[T],j=Nu(k),N=T===d?C.isActive:null;N===!1&&(S=E);let R=k===m[T]&&k!==f[T]&&j;if(R&&r&&e.manuallyAnimateOnMount&&(R=!1),C.protectedKeys={...b},!C.isActive&&N===null||!k&&!C.prevProp||Bf(k)||typeof k=="boolean")continue;if(T==="exit"&&C.isActive&&N!==!0){C.prevResolvedValues&&(b={...b,...C.prevResolvedValues});continue}const P=oK(C.prevProp,k);let L=P||T===d&&C.isActive&&!R&&j||E>S&&j,H=!1;const D=Array.isArray(k)?k:[k];let B=D.reduce(a(T),{});N===!1&&(B={});const{prevResolvedValues:K={}}=C,se={...K,...B},ue=X=>{L=!0,v.has(X)&&(H=!0,v.delete(X)),C.needsAnimating[X]=!0;const le=e.getValue(X);le&&(le.liveStyle=!1)};for(const X in se){const le=B[X],ye=K[X];if(b.hasOwnProperty(X))continue;let M=!1;Sv(le)&&Sv(ye)?M=!VR(le,ye):M=le!==ye,M?le!=null?ue(X):v.add(X):le!==void 0&&v.has(X)?ue(X):C.protectedKeys[X]=!0}C.prevProp=k,C.prevResolvedValues=B,C.isActive&&(b={...b,...B}),r&&e.blockInitialAnimation&&(L=!1);const Z=R&&P;L&&(!Z||H)&&g.push(...D.map(X=>{const le={type:T};if(typeof X=="string"&&r&&!Z&&e.manuallyAnimateOnMount&&e.parent){const{parent:ye}=e,M=wo(ye,X);if(ye.enteringChildren&&M){const{delayChildren:z}=M.transition||{};le.delay=uR(ye.enteringChildren,e,z)}}return{animation:X,options:le}}))}if(v.size){const E={};if(typeof f.initial!="boolean"){const T=wo(e,Array.isArray(f.initial)?f.initial[0]:f.initial);T&&T.transition&&(E.transition=T.transition)}v.forEach(T=>{const C=e.getBaseTarget(T),k=e.getValue(T);k&&(k.liveStyle=!0),E[T]=C??null}),g.push({animation:E})}let w=!!g.length;return r&&(f.initial===!1||f.initial===f.animate)&&!e.manuallyAnimateOnMount&&(w=!1),r=!1,w?t(g):Promise.resolve()}function c(d,f){if(n[d].isActive===f)return Promise.resolve();e.variantChildren?.forEach(g=>g.animationState?.setActive(d,f)),n[d].isActive=f;const m=l(d);for(const g in n)n[g].protectedKeys={};return m}return{animateChanges:l,setActive:c,setAnimateFunction:o,getState:()=>n,reset:()=>{n=BT()}}}function oK(e,t){return typeof t=="string"?t!==e:Array.isArray(t)?!VR(t,e):!1}function is(e=!1){return{isActive:e,protectedKeys:{},needsAnimating:{},prevResolvedValues:{}}}function BT(){return{animate:is(!0),whileInView:is(),whileHover:is(),whileTap:is(),whileDrag:is(),whileFocus:is(),exit:is()}}function VT(e,t){e.min=t.min,e.max=t.max}function zr(e,t){VT(e.x,t.x),VT(e.y,t.y)}function FT(e,t){e.translate=t.translate,e.scale=t.scale,e.originPoint=t.originPoint,e.origin=t.origin}const FR=1e-4,lK=1-FR,uK=1+FR,HR=.01,cK=0-HR,dK=0+HR;function Bn(e){return e.max-e.min}function fK(e,t,n){return Math.abs(e-t)<=n}function HT(e,t,n,r=.5){e.origin=r,e.originPoint=Vt(t.min,t.max,e.origin),e.scale=Bn(n)/Bn(t),e.translate=Vt(n.min,n.max,e.origin)-e.originPoint,(e.scale>=lK&&e.scale<=uK||isNaN(e.scale))&&(e.scale=1),(e.translate>=cK&&e.translate<=dK||isNaN(e.translate))&&(e.translate=0)}function mu(e,t,n,r){HT(e.x,t.x,n.x,r?r.originX:void 0),HT(e.y,t.y,n.y,r?r.originY:void 0)}function qT(e,t,n){e.min=n.min+t.min,e.max=e.min+Bn(t)}function hK(e,t,n){qT(e.x,t.x,n.x),qT(e.y,t.y,n.y)}function GT(e,t,n){e.min=t.min-n.min,e.max=e.min+Bn(t)}function bf(e,t,n){GT(e.x,t.x,n.x),GT(e.y,t.y,n.y)}function KT(e,t,n,r,a){return e-=t,e=yf(e,1/n,r),a!==void 0&&(e=yf(e,1/a,r)),e}function pK(e,t=0,n=1,r=.5,a,o=e,l=e){if(li.test(t)&&(t=parseFloat(t),t=Vt(l.min,l.max,t/100)-l.min),typeof t!="number")return;let c=Vt(o.min,o.max,r);e===o&&(c-=t),e.min=KT(e.min,t,n,c,a),e.max=KT(e.max,t,n,c,a)}function $T(e,t,[n,r,a],o,l){pK(e,t[n],t[r],t[a],t.scale,o,l)}const mK=["x","scaleX","originX"],gK=["y","scaleY","originY"];function YT(e,t,n,r){$T(e.x,t,mK,n?n.x:void 0,r?r.x:void 0),$T(e.y,t,gK,n?n.y:void 0,r?r.y:void 0)}function WT(e){return e.translate===0&&e.scale===1}function qR(e){return WT(e.x)&&WT(e.y)}function XT(e,t){return e.min===t.min&&e.max===t.max}function vK(e,t){return XT(e.x,t.x)&&XT(e.y,t.y)}function QT(e,t){return Math.round(e.min)===Math.round(t.min)&&Math.round(e.max)===Math.round(t.max)}function GR(e,t){return QT(e.x,t.x)&&QT(e.y,t.y)}function JT(e){return Bn(e.x)/Bn(e.y)}function ZT(e,t){return e.translate===t.translate&&e.scale===t.scale&&e.originPoint===t.originPoint}function ai(e){return[e("x"),e("y")]}function yK(e,t,n){let r="";const a=e.x.translate/t.x,o=e.y.translate/t.y,l=n?.z||0;if((a||o||l)&&(r=`translate3d(${a}px, ${o}px, ${l}px) `),(t.x!==1||t.y!==1)&&(r+=`scale(${1/t.x}, ${1/t.y}) `),n){const{transformPerspective:f,rotate:m,rotateX:g,rotateY:v,skewX:b,skewY:S}=n;f&&(r=`perspective(${f}px) ${r}`),m&&(r+=`rotate(${m}deg) `),g&&(r+=`rotateX(${g}deg) `),v&&(r+=`rotateY(${v}deg) `),b&&(r+=`skewX(${b}deg) `),S&&(r+=`skewY(${S}deg) `)}const c=e.x.scale*t.x,d=e.y.scale*t.y;return(c!==1||d!==1)&&(r+=`scale(${c}, ${d})`),r||"none"}const KR=["TopLeft","TopRight","BottomLeft","BottomRight"],bK=KR.length,ek=e=>typeof e=="string"?parseFloat(e):e,tk=e=>typeof e=="number"||Ce.test(e);function xK(e,t,n,r,a,o){a?(e.opacity=Vt(0,n.opacity??1,SK(r)),e.opacityExit=Vt(t.opacity??1,0,wK(r))):o&&(e.opacity=Vt(t.opacity??1,n.opacity??1,r));for(let l=0;l<bK;l++){const c=`border${KR[l]}Radius`;let d=nk(t,c),f=nk(n,c);if(d===void 0&&f===void 0)continue;d||(d=0),f||(f=0),d===0||f===0||tk(d)===tk(f)?(e[c]=Math.max(Vt(ek(d),ek(f),r),0),(li.test(f)||li.test(d))&&(e[c]+="%")):e[c]=f}(t.rotate||n.rotate)&&(e.rotate=Vt(t.rotate||0,n.rotate||0,r))}function nk(e,t){return e[t]!==void 0?e[t]:e.borderRadius}const SK=$R(0,.5,zj),wK=$R(.5,.95,_r);function $R(e,t,n){return r=>r<e?0:r>t?1:n(ku(e,t,r))}function EK(e,t,n){const r=Rn(e)?e:No(e);return r.start(Qy("",r,t,n)),r.animation}function ju(e,t,n,r={passive:!0}){return e.addEventListener(t,n,r),()=>e.removeEventListener(t,n)}const TK=(e,t)=>e.depth-t.depth;class kK{constructor(){this.children=[],this.isDirty=!1}add(t){Py(this.children,t),this.isDirty=!0}remove(t){hf(this.children,t),this.isDirty=!0}forEach(t){this.isDirty&&this.children.sort(TK),this.isDirty=!1,this.children.forEach(t)}}function CK(e,t){const n=Un.now(),r=({timestamp:a})=>{const o=a-n;o>=t&&(Ra(r),e(o-t))};return _t.setup(r,!0),()=>Ra(r)}function Wd(e){return Rn(e)?e.get():e}class AK{constructor(){this.members=[]}add(t){Py(this.members,t);for(let n=this.members.length-1;n>=0;n--){const r=this.members[n];if(r===t||r===this.lead||r===this.prevLead)continue;const a=r.instance;a&&a.isConnected===!1&&r.isPresent!==!1&&!r.snapshot&&hf(this.members,r)}t.scheduleRender()}remove(t){if(hf(this.members,t),t===this.prevLead&&(this.prevLead=void 0),t===this.lead){const n=this.members[this.members.length-1];n&&this.promote(n)}}relegate(t){const n=this.members.findIndex(a=>t===a);if(n===0)return!1;let r;for(let a=n;a>=0;a--){const o=this.members[a],l=o.instance;if(o.isPresent!==!1&&(!l||l.isConnected!==!1)){r=o;break}}return r?(this.promote(r),!0):!1}promote(t,n){const r=this.lead;if(t!==r&&(this.prevLead=r,this.lead=t,t.show(),r)){r.instance&&r.scheduleRender(),t.scheduleRender();const a=r.options.layoutDependency,o=t.options.layoutDependency;if(!(a!==void 0&&o!==void 0&&a===o)){const d=r.instance;d&&d.isConnected===!1&&!r.snapshot||(t.resumeFrom=r,n&&(t.resumeFrom.preserveOpacity=!0),r.snapshot&&(t.snapshot=r.snapshot,t.snapshot.latestValues=r.animationValues||r.latestValues),t.root&&t.root.isUpdating&&(t.isLayoutDirty=!0))}const{crossfade:c}=t.options;c===!1&&r.hide()}}exitAnimationComplete(){this.members.forEach(t=>{const{options:n,resumingFrom:r}=t;n.onExitComplete&&n.onExitComplete(),r&&r.options.onExitComplete&&r.options.onExitComplete()})}scheduleRender(){this.members.forEach(t=>{t.instance&&t.scheduleRender(!1)})}removeLeadSnapshot(){this.lead&&this.lead.snapshot&&(this.lead.snapshot=void 0)}}const Xd={hasAnimatedSinceResize:!0,hasEverUpdated:!1},rg=["","X","Y","Z"],NK=1e3;let jK=0;function ig(e,t,n,r){const{latestValues:a}=t;a[e]&&(n[e]=a[e],t.setStaticValue(e,0),r&&(r[e]=0))}function YR(e){if(e.hasCheckedOptimisedAppear=!0,e.root===e)return;const{visualElement:t}=e.options;if(!t)return;const n=pR(t);if(window.MotionHasOptimisedAnimation(n,"transform")){const{layout:a,layoutId:o}=e.options;window.MotionCancelOptimisedAnimation(n,"transform",_t,!(a||o))}const{parent:r}=e;r&&!r.hasCheckedOptimisedAppear&&YR(r)}function WR({attachResizeListener:e,defaultParent:t,measureScroll:n,checkIsScrollRoot:r,resetTransform:a}){return class{constructor(l={},c=t?.()){this.id=jK++,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(OK),this.nodes.forEach(PK),this.nodes.forEach(LK),this.nodes.forEach(MK)},this.resolvedRelativeTargetAt=0,this.linkedParentVersion=0,this.hasProjected=!1,this.isVisible=!0,this.animationProgress=0,this.sharedNodes=new Map,this.latestValues=l,this.root=c?c.root||c:this,this.path=c?[...c.path,c]:[],this.parent=c,this.depth=c?c.depth+1:0;for(let d=0;d<this.path.length;d++)this.path[d].shouldResetTransform=!0;this.root===this&&(this.nodes=new kK)}addEventListener(l,c){return this.eventHandlers.has(l)||this.eventHandlers.set(l,new zy),this.eventHandlers.get(l).add(c)}notifyListeners(l,...c){const d=this.eventHandlers.get(l);d&&d.notify(...c)}hasListeners(l){return this.eventHandlers.has(l)}mount(l){if(this.instance)return;this.isSVG=r0(l)&&!_7(l),this.instance=l;const{layoutId:c,layout:d,visualElement:f}=this.options;if(f&&!f.current&&f.mount(l),this.root.nodes.add(this),this.parent&&this.parent.children.add(this),this.root.hasTreeAnimated&&(d||c)&&(this.isLayoutDirty=!0),e){let m,g=0;const v=()=>this.root.updateBlockedByResize=!1;_t.read(()=>{g=window.innerWidth}),e(l,()=>{const b=window.innerWidth;b!==g&&(g=b,this.root.updateBlockedByResize=!0,m&&m(),m=CK(v,250),Xd.hasAnimatedSinceResize&&(Xd.hasAnimatedSinceResize=!1,this.nodes.forEach(ak)))})}c&&this.root.registerSharedNode(c,this),this.options.animate!==!1&&f&&(c||d)&&this.addEventListener("didUpdate",({delta:m,hasLayoutChanged:g,hasRelativeLayoutChanged:v,layout:b})=>{if(this.isTreeAnimationBlocked()){this.target=void 0,this.relativeTarget=void 0;return}const S=this.options.transition||f.getDefaultTransition()||FK,{onLayoutAnimationStart:w,onLayoutAnimationComplete:E}=f.getProps(),T=!this.targetLayout||!GR(this.targetLayout,b),C=!g&&v;if(this.options.layoutRoot||this.resumeFrom||C||g&&(T||!this.currentAnimation)){this.resumeFrom&&(this.resumingFrom=this.resumeFrom,this.resumingFrom.resumingFrom=void 0);const k={...Xy(S,"layout"),onPlay:w,onComplete:E};(f.shouldReduceMotion||this.options.layoutRoot)&&(k.delay=0,k.type=!1),this.startAnimation(k),this.setAnimationOrigin(m,C)}else g||ak(this),this.isLead()&&this.options.onExitComplete&&this.options.onExitComplete();this.targetLayout=b})}unmount(){this.options.layoutId&&this.willUpdate(),this.root.nodes.remove(this);const l=this.getStack();l&&l.remove(this),this.parent&&this.parent.children.delete(this),this.instance=void 0,this.eventHandlers.clear(),Ra(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(zK),this.animationId++)}getTransformTemplate(){const{visualElement:l}=this.options;return l&&l.getProps().transformTemplate}willUpdate(l=!0){if(this.root.hasTreeAnimated=!0,this.root.isUpdateBlocked()){this.options.onExitComplete&&this.options.onExitComplete();return}if(window.MotionCancelOptimisedAnimation&&!this.hasCheckedOptimisedAppear&&YR(this),!this.root.isUpdating&&this.root.startUpdate(),this.isLayoutDirty)return;this.isLayoutDirty=!0;for(let m=0;m<this.path.length;m++){const g=this.path[m];g.shouldResetTransform=!0,g.updateScroll("snapshot"),g.options.layoutRoot&&g.willUpdate(!1)}const{layoutId:c,layout:d}=this.options;if(c===void 0&&!d)return;const f=this.getTransformTemplate();this.prevTransformTemplateValue=f?f(this.latestValues,""):void 0,this.updateSnapshot(),l&&this.notifyListeners("willUpdate")}update(){if(this.updateScheduled=!1,this.isUpdateBlocked()){this.unblockUpdate(),this.clearAllSnapshots(),this.nodes.forEach(rk);return}if(this.animationId<=this.animationCommitId){this.nodes.forEach(ik);return}this.animationCommitId=this.animationId,this.isUpdating?(this.isUpdating=!1,this.nodes.forEach(IK),this.nodes.forEach(RK),this.nodes.forEach(_K)):this.nodes.forEach(ik),this.clearAllSnapshots();const c=Un.now();xn.delta=di(0,1e3/60,c-xn.timestamp),xn.timestamp=c,xn.isProcessing=!0,Wm.update.process(xn),Wm.preRender.process(xn),Wm.render.process(xn),xn.isProcessing=!1}didUpdate(){this.updateScheduled||(this.updateScheduled=!0,t0.read(this.scheduleUpdate))}clearAllSnapshots(){this.nodes.forEach(DK),this.sharedNodes.forEach(UK)}scheduleUpdateProjection(){this.projectionUpdateScheduled||(this.projectionUpdateScheduled=!0,_t.preRender(this.updateProjection,!1,!0))}scheduleCheckAfterUnmount(){_t.postRender(()=>{this.isLayoutDirty?this.root.didUpdate():this.root.checkUpdateFailed()})}updateSnapshot(){this.snapshot||!this.instance||(this.snapshot=this.measure(),this.snapshot&&!Bn(this.snapshot.measuredBox.x)&&!Bn(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 d=0;d<this.path.length;d++)this.path[d].updateScroll();const l=this.layout;this.layout=this.measure(!1),this.layoutVersion++,this.layoutCorrected=fn(),this.isLayoutDirty=!1,this.projectionDelta=void 0,this.notifyListeners("measure",this.layout.layoutBox);const{visualElement:c}=this.options;c&&c.notify("LayoutMeasure",this.layout.layoutBox,l?l.layoutBox:void 0)}updateScroll(l="measure"){let c=!!(this.options.layoutScroll&&this.instance);if(this.scroll&&this.scroll.animationId===this.root.animationId&&this.scroll.phase===l&&(c=!1),c&&this.instance){const d=r(this.instance);this.scroll={animationId:this.root.animationId,phase:l,isRoot:d,offset:n(this.instance),wasRoot:this.scroll?this.scroll.isRoot:d}}}resetTransform(){if(!a)return;const l=this.isLayoutDirty||this.shouldResetTransform||this.options.alwaysMeasureLayout,c=this.projectionDelta&&!qR(this.projectionDelta),d=this.getTransformTemplate(),f=d?d(this.latestValues,""):void 0,m=f!==this.prevTransformTemplateValue;l&&this.instance&&(c||os(this.latestValues)||m)&&(a(this.instance,f),this.shouldResetTransform=!1,this.scheduleRender())}measure(l=!0){const c=this.measurePageBox();let d=this.removeElementScroll(c);return l&&(d=this.removeTransform(d)),HK(d),{animationId:this.root.animationId,measuredBox:c,layoutBox:d,latestValues:{},source:this.id}}measurePageBox(){const{visualElement:l}=this.options;if(!l)return fn();const c=l.measureViewportBox();if(!(this.scroll?.wasRoot||this.path.some(qK))){const{scroll:f}=this.root;f&&(mo(c.x,f.offset.x),mo(c.y,f.offset.y))}return c}removeElementScroll(l){const c=fn();if(zr(c,l),this.scroll?.wasRoot)return c;for(let d=0;d<this.path.length;d++){const f=this.path[d],{scroll:m,options:g}=f;f!==this.root&&m&&g.layoutScroll&&(m.wasRoot&&zr(c,l),mo(c.x,m.offset.x),mo(c.y,m.offset.y))}return c}applyTransform(l,c=!1){const d=fn();zr(d,l);for(let f=0;f<this.path.length;f++){const m=this.path[f];!c&&m.options.layoutScroll&&m.scroll&&m!==m.root&&go(d,{x:-m.scroll.offset.x,y:-m.scroll.offset.y}),os(m.latestValues)&&go(d,m.latestValues)}return os(this.latestValues)&&go(d,this.latestValues),d}removeTransform(l){const c=fn();zr(c,l);for(let d=0;d<this.path.length;d++){const f=this.path[d];if(!f.instance||!os(f.latestValues))continue;Av(f.latestValues)&&f.updateSnapshot();const m=fn(),g=f.measurePageBox();zr(m,g),YT(c,f.latestValues,f.snapshot?f.snapshot.layoutBox:void 0,m)}return os(this.latestValues)&&YT(c,this.latestValues),c}setTargetDelta(l){this.targetDelta=l,this.root.scheduleUpdateProjection(),this.isProjectionDirty=!0}setOptions(l){this.options={...this.options,...l,crossfade:l.crossfade!==void 0?l.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!==xn.timestamp&&this.relativeParent.resolveTargetDelta(!0)}resolveTargetDelta(l=!1){const c=this.getLead();this.isProjectionDirty||(this.isProjectionDirty=c.isProjectionDirty),this.isTransformDirty||(this.isTransformDirty=c.isTransformDirty),this.isSharedProjectionDirty||(this.isSharedProjectionDirty=c.isSharedProjectionDirty);const d=!!this.resumingFrom||this!==c;if(!(l||d&&this.isSharedProjectionDirty||this.isProjectionDirty||this.parent?.isProjectionDirty||this.attemptToResolveRelativeTarget||this.root.updateBlockedByResize))return;const{layout:m,layoutId:g}=this.options;if(!this.layout||!(m||g))return;this.resolvedRelativeTargetAt=xn.timestamp;const v=this.getClosestProjectingParent();v&&this.linkedParentVersion!==v.layoutVersion&&!v.options.layoutRoot&&this.removeRelativeTarget(),!this.targetDelta&&!this.relativeTarget&&(v&&v.layout?this.createRelativeTarget(v,this.layout.layoutBox,v.layout.layoutBox):this.removeRelativeTarget()),!(!this.relativeTarget&&!this.targetDelta)&&(this.target||(this.target=fn(),this.targetWithTransforms=fn()),this.relativeTarget&&this.relativeTargetOrigin&&this.relativeParent&&this.relativeParent.target?(this.forceRelativeParentToResolveTarget(),hK(this.target,this.relativeTarget,this.relativeParent.target)):this.targetDelta?(this.resumingFrom?this.target=this.applyTransform(this.layout.layoutBox):zr(this.target,this.layout.layoutBox),OR(this.target,this.targetDelta)):zr(this.target,this.layout.layoutBox),this.attemptToResolveRelativeTarget&&(this.attemptToResolveRelativeTarget=!1,v&&!!v.resumingFrom==!!this.resumingFrom&&!v.options.layoutScroll&&v.target&&this.animationProgress!==1?this.createRelativeTarget(v,this.target,v.target):this.relativeParent=this.relativeTarget=void 0))}getClosestProjectingParent(){if(!(!this.parent||Av(this.parent.latestValues)||_R(this.parent.latestValues)))return this.parent.isProjecting()?this.parent:this.parent.getClosestProjectingParent()}isProjecting(){return!!((this.relativeTarget||this.targetDelta||this.options.layoutRoot)&&this.layout)}createRelativeTarget(l,c,d){this.relativeParent=l,this.linkedParentVersion=l.layoutVersion,this.forceRelativeParentToResolveTarget(),this.relativeTarget=fn(),this.relativeTargetOrigin=fn(),bf(this.relativeTargetOrigin,c,d),zr(this.relativeTarget,this.relativeTargetOrigin)}removeRelativeTarget(){this.relativeParent=this.relativeTarget=void 0}calcProjection(){const l=this.getLead(),c=!!this.resumingFrom||this!==l;let d=!0;if((this.isProjectionDirty||this.parent?.isProjectionDirty)&&(d=!1),c&&(this.isSharedProjectionDirty||this.isTransformDirty)&&(d=!1),this.resolvedRelativeTargetAt===xn.timestamp&&(d=!1),d)return;const{layout:f,layoutId:m}=this.options;if(this.isTreeAnimating=!!(this.parent&&this.parent.isTreeAnimating||this.currentAnimation||this.pendingAnimation),this.isTreeAnimating||(this.targetDelta=this.relativeTarget=void 0),!this.layout||!(f||m))return;zr(this.layoutCorrected,this.layout.layoutBox);const g=this.treeScale.x,v=this.treeScale.y;F7(this.layoutCorrected,this.treeScale,this.path,c),l.layout&&!l.target&&(this.treeScale.x!==1||this.treeScale.y!==1)&&(l.target=l.layout.layoutBox,l.targetWithTransforms=fn());const{target:b}=l;if(!b){this.prevProjectionDelta&&(this.createProjectionDeltas(),this.scheduleRender());return}!this.projectionDelta||!this.prevProjectionDelta?this.createProjectionDeltas():(FT(this.prevProjectionDelta.x,this.projectionDelta.x),FT(this.prevProjectionDelta.y,this.projectionDelta.y)),mu(this.projectionDelta,this.layoutCorrected,b,this.latestValues),(this.treeScale.x!==g||this.treeScale.y!==v||!ZT(this.projectionDelta.x,this.prevProjectionDelta.x)||!ZT(this.projectionDelta.y,this.prevProjectionDelta.y))&&(this.hasProjected=!0,this.scheduleRender(),this.notifyListeners("projectionUpdate",b))}hide(){this.isVisible=!1}show(){this.isVisible=!0}scheduleRender(l=!0){if(this.options.visualElement?.scheduleRender(),l){const c=this.getStack();c&&c.scheduleRender()}this.resumingFrom&&!this.resumingFrom.instance&&(this.resumingFrom=void 0)}createProjectionDeltas(){this.prevProjectionDelta=po(),this.projectionDelta=po(),this.projectionDeltaWithTransform=po()}setAnimationOrigin(l,c=!1){const d=this.snapshot,f=d?d.latestValues:{},m={...this.latestValues},g=po();(!this.relativeParent||!this.relativeParent.options.layoutRoot)&&(this.relativeTarget=this.relativeTargetOrigin=void 0),this.attemptToResolveRelativeTarget=!c;const v=fn(),b=d?d.source:void 0,S=this.layout?this.layout.source:void 0,w=b!==S,E=this.getStack(),T=!E||E.members.length<=1,C=!!(w&&!T&&this.options.crossfade===!0&&!this.path.some(VK));this.animationProgress=0;let k;this.mixTargetDelta=j=>{const N=j/1e3;sk(g.x,l.x,N),sk(g.y,l.y,N),this.setTargetDelta(g),this.relativeTarget&&this.relativeTargetOrigin&&this.layout&&this.relativeParent&&this.relativeParent.layout&&(bf(v,this.layout.layoutBox,this.relativeParent.layout.layoutBox),BK(this.relativeTarget,this.relativeTargetOrigin,v,N),k&&vK(this.relativeTarget,k)&&(this.isProjectionDirty=!1),k||(k=fn()),zr(k,this.relativeTarget)),w&&(this.animationValues=m,xK(m,f,this.latestValues,N,C,T)),this.root.scheduleUpdateProjection(),this.scheduleRender(),this.animationProgress=N},this.mixTargetDelta(this.options.layoutRoot?1e3:0)}startAnimation(l){this.notifyListeners("animationStart"),this.currentAnimation?.stop(),this.resumingFrom?.currentAnimation?.stop(),this.pendingAnimation&&(Ra(this.pendingAnimation),this.pendingAnimation=void 0),this.pendingAnimation=_t.update(()=>{Xd.hasAnimatedSinceResize=!0,this.motionValue||(this.motionValue=No(0)),this.motionValue.jump(0,!1),this.currentAnimation=EK(this.motionValue,[0,1e3],{...l,velocity:0,isSync:!0,onUpdate:c=>{this.mixTargetDelta(c),l.onUpdate&&l.onUpdate(c)},onStop:()=>{},onComplete:()=>{l.onComplete&&l.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 l=this.getStack();l&&l.exitAnimationComplete(),this.resumingFrom=this.currentAnimation=this.animationValues=void 0,this.notifyListeners("animationComplete")}finishAnimation(){this.currentAnimation&&(this.mixTargetDelta&&this.mixTargetDelta(NK),this.currentAnimation.stop()),this.completeAnimation()}applyTransformsToTarget(){const l=this.getLead();let{targetWithTransforms:c,target:d,layout:f,latestValues:m}=l;if(!(!c||!d||!f)){if(this!==l&&this.layout&&f&&XR(this.options.animationType,this.layout.layoutBox,f.layoutBox)){d=this.target||fn();const g=Bn(this.layout.layoutBox.x);d.x.min=l.target.x.min,d.x.max=d.x.min+g;const v=Bn(this.layout.layoutBox.y);d.y.min=l.target.y.min,d.y.max=d.y.min+v}zr(c,d),go(c,m),mu(this.projectionDeltaWithTransform,this.layoutCorrected,c,m)}}registerSharedNode(l,c){this.sharedNodes.has(l)||this.sharedNodes.set(l,new AK),this.sharedNodes.get(l).add(c);const f=c.options.initialPromotionConfig;c.promote({transition:f?f.transition:void 0,preserveFollowOpacity:f&&f.shouldPreserveFollowOpacity?f.shouldPreserveFollowOpacity(c):void 0})}isLead(){const l=this.getStack();return l?l.lead===this:!0}getLead(){const{layoutId:l}=this.options;return l?this.getStack()?.lead||this:this}getPrevLead(){const{layoutId:l}=this.options;return l?this.getStack()?.prevLead:void 0}getStack(){const{layoutId:l}=this.options;if(l)return this.root.sharedNodes.get(l)}promote({needsReset:l,transition:c,preserveFollowOpacity:d}={}){const f=this.getStack();f&&f.promote(this,d),l&&(this.projectionDelta=void 0,this.needsReset=!0),c&&this.setOptions({transition:c})}relegate(){const l=this.getStack();return l?l.relegate(this):!1}resetSkewAndRotation(){const{visualElement:l}=this.options;if(!l)return;let c=!1;const{latestValues:d}=l;if((d.z||d.rotate||d.rotateX||d.rotateY||d.rotateZ||d.skewX||d.skewY)&&(c=!0),!c)return;const f={};d.z&&ig("z",l,f,this.animationValues);for(let m=0;m<rg.length;m++)ig(`rotate${rg[m]}`,l,f,this.animationValues),ig(`skew${rg[m]}`,l,f,this.animationValues);l.render();for(const m in f)l.setStaticValue(m,f[m]),this.animationValues&&(this.animationValues[m]=f[m]);l.scheduleRender()}applyProjectionStyles(l,c){if(!this.instance||this.isSVG)return;if(!this.isVisible){l.visibility="hidden";return}const d=this.getTransformTemplate();if(this.needsReset){this.needsReset=!1,l.visibility="",l.opacity="",l.pointerEvents=Wd(c?.pointerEvents)||"",l.transform=d?d(this.latestValues,""):"none";return}const f=this.getLead();if(!this.projectionDelta||!this.layout||!f.target){this.options.layoutId&&(l.opacity=this.latestValues.opacity!==void 0?this.latestValues.opacity:1,l.pointerEvents=Wd(c?.pointerEvents)||""),this.hasProjected&&!os(this.latestValues)&&(l.transform=d?d({},""):"none",this.hasProjected=!1);return}l.visibility="";const m=f.animationValues||f.latestValues;this.applyTransformsToTarget();let g=yK(this.projectionDeltaWithTransform,this.treeScale,m);d&&(g=d(m,g)),l.transform=g;const{x:v,y:b}=this.projectionDelta;l.transformOrigin=`${v.origin*100}% ${b.origin*100}% 0`,f.animationValues?l.opacity=f===this?m.opacity??this.latestValues.opacity??1:this.preserveOpacity?this.latestValues.opacity:m.opacityExit:l.opacity=f===this?m.opacity!==void 0?m.opacity:"":m.opacityExit!==void 0?m.opacityExit:0;for(const S in jv){if(m[S]===void 0)continue;const{correct:w,applyTo:E,isCSSVariable:T}=jv[S],C=g==="none"?m[S]:w(m[S],f);if(E){const k=E.length;for(let j=0;j<k;j++)l[E[j]]=C}else T?this.options.visualElement.renderState.vars[S]=C:l[S]=C}this.options.layoutId&&(l.pointerEvents=f===this?Wd(c?.pointerEvents)||"":"none")}clearSnapshot(){this.resumeFrom=this.snapshot=void 0}resetTree(){this.root.nodes.forEach(l=>l.currentAnimation?.stop()),this.root.nodes.forEach(rk),this.root.sharedNodes.clear()}}}function RK(e){e.updateLayout()}function _K(e){const t=e.resumeFrom?.snapshot||e.snapshot;if(e.isLead()&&e.layout&&t&&e.hasListeners("didUpdate")){const{layoutBox:n,measuredBox:r}=e.layout,{animationType:a}=e.options,o=t.source!==e.layout.source;a==="size"?ai(m=>{const g=o?t.measuredBox[m]:t.layoutBox[m],v=Bn(g);g.min=n[m].min,g.max=g.min+v}):XR(a,t.layoutBox,n)&&ai(m=>{const g=o?t.measuredBox[m]:t.layoutBox[m],v=Bn(n[m]);g.max=g.min+v,e.relativeTarget&&!e.currentAnimation&&(e.isProjectionDirty=!0,e.relativeTarget[m].max=e.relativeTarget[m].min+v)});const l=po();mu(l,n,t.layoutBox);const c=po();o?mu(c,e.applyTransform(r,!0),t.measuredBox):mu(c,n,t.layoutBox);const d=!qR(l);let f=!1;if(!e.resumeFrom){const m=e.getClosestProjectingParent();if(m&&!m.resumeFrom){const{snapshot:g,layout:v}=m;if(g&&v){const b=fn();bf(b,t.layoutBox,g.layoutBox);const S=fn();bf(S,n,v.layoutBox),GR(b,S)||(f=!0),m.options.layoutRoot&&(e.relativeTarget=S,e.relativeTargetOrigin=b,e.relativeParent=m)}}}e.notifyListeners("didUpdate",{layout:n,snapshot:t,delta:c,layoutDelta:l,hasLayoutChanged:d,hasRelativeLayoutChanged:f})}else if(e.isLead()){const{onExitComplete:n}=e.options;n&&n()}e.options.transition=void 0}function OK(e){e.parent&&(e.isProjecting()||(e.isProjectionDirty=e.parent.isProjectionDirty),e.isSharedProjectionDirty||(e.isSharedProjectionDirty=!!(e.isProjectionDirty||e.parent.isProjectionDirty||e.parent.isSharedProjectionDirty)),e.isTransformDirty||(e.isTransformDirty=e.parent.isTransformDirty))}function MK(e){e.isProjectionDirty=e.isSharedProjectionDirty=e.isTransformDirty=!1}function DK(e){e.clearSnapshot()}function rk(e){e.clearMeasurements()}function ik(e){e.isLayoutDirty=!1}function IK(e){const{visualElement:t}=e.options;t&&t.getProps().onBeforeLayoutMeasure&&t.notify("BeforeLayoutMeasure"),e.resetTransform()}function ak(e){e.finishAnimation(),e.targetDelta=e.relativeTarget=e.target=void 0,e.isProjectionDirty=!0}function PK(e){e.resolveTargetDelta()}function LK(e){e.calcProjection()}function zK(e){e.resetSkewAndRotation()}function UK(e){e.removeLeadSnapshot()}function sk(e,t,n){e.translate=Vt(t.translate,0,n),e.scale=Vt(t.scale,1,n),e.origin=t.origin,e.originPoint=t.originPoint}function ok(e,t,n,r){e.min=Vt(t.min,n.min,r),e.max=Vt(t.max,n.max,r)}function BK(e,t,n,r){ok(e.x,t.x,n.x,r),ok(e.y,t.y,n.y,r)}function VK(e){return e.animationValues&&e.animationValues.opacityExit!==void 0}const FK={duration:.45,ease:[.4,0,.1,1]},lk=e=>typeof navigator<"u"&&navigator.userAgent&&navigator.userAgent.toLowerCase().includes(e),uk=lk("applewebkit/")&&!lk("chrome/")?Math.round:_r;function ck(e){e.min=uk(e.min),e.max=uk(e.max)}function HK(e){ck(e.x),ck(e.y)}function XR(e,t,n){return e==="position"||e==="preserve-aspect"&&!fK(JT(t),JT(n),.2)}function qK(e){return e!==e.root&&e.scroll?.wasRoot}const GK=WR({attachResizeListener:(e,t)=>ju(e,"resize",t),measureScroll:()=>({x:document.documentElement.scrollLeft||document.body?.scrollLeft||0,y:document.documentElement.scrollTop||document.body?.scrollTop||0}),checkIsScrollRoot:()=>!0}),ag={current:void 0},QR=WR({measureScroll:e=>({x:e.scrollLeft,y:e.scrollTop}),defaultParent:()=>{if(!ag.current){const e=new GK({});e.mount(window),e.setOptions({layoutScroll:!0}),ag.current=e}return ag.current},resetTransform:(e,t)=>{e.style.transform=t!==void 0?t:"none"},checkIsScrollRoot:e=>window.getComputedStyle(e).position==="fixed"}),JR=_.createContext({transformPagePoint:e=>e,isStatic:!1,reducedMotion:"never"});function KK(e=!0){const t=_.useContext(Iy);if(t===null)return[!0,null];const{isPresent:n,onExitComplete:r,register:a}=t,o=_.useId();_.useEffect(()=>{if(e)return a(o)},[e]);const l=_.useCallback(()=>e&&r&&r(o),[o,r,e]);return!n&&r?[!1,l]:[!0]}const ZR=_.createContext({strict:!1}),dk={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 fk=!1;function $K(){if(fk)return;const e={};for(const t in dk)e[t]={isEnabled:n=>dk[t].some(r=>!!n[r])};NR(e),fk=!0}function e2(){return $K(),z7()}function YK(e){const t=e2();for(const n in e)t[n]={...t[n],...e[n]};NR(t)}const WK=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 xf(e){return e.startsWith("while")||e.startsWith("drag")&&e!=="draggable"||e.startsWith("layout")||e.startsWith("onTap")||e.startsWith("onPan")||e.startsWith("onLayout")||WK.has(e)}let t2=e=>!xf(e);function XK(e){typeof e=="function"&&(t2=t=>t.startsWith("on")?!xf(t):e(t))}try{XK(require("@emotion/is-prop-valid").default)}catch{}function QK(e,t,n){const r={};for(const a in e)a==="values"&&typeof e.values=="object"||(t2(a)||n===!0&&xf(a)||!t&&!xf(a)||e.draggable&&a.startsWith("onDrag"))&&(r[a]=e[a]);return r}const Ff=_.createContext({});function JK(e,t){if(Vf(e)){const{initial:n,animate:r}=e;return{initial:n===!1||Nu(n)?n:void 0,animate:Nu(r)?r:void 0}}return e.inherit!==!1?t:{}}function ZK(e){const{initial:t,animate:n}=JK(e,_.useContext(Ff));return _.useMemo(()=>({initial:t,animate:n}),[hk(t),hk(n)])}function hk(e){return Array.isArray(e)?e.join(" "):e}const l0=()=>({style:{},transform:{},transformOrigin:{},vars:{}});function n2(e,t,n){for(const r in t)!Rn(t[r])&&!IR(r,n)&&(e[r]=t[r])}function e$({transformTemplate:e},t){return _.useMemo(()=>{const n=l0();return s0(n,t,e),Object.assign({},n.vars,n.style)},[t])}function t$(e,t){const n=e.style||{},r={};return n2(r,n,e),Object.assign(r,e$(e,t)),r}function n$(e,t){const n={},r=t$(e,t);return e.drag&&e.dragListener!==!1&&(n.draggable=!1,r.userSelect=r.WebkitUserSelect=r.WebkitTouchCallout="none",r.touchAction=e.drag===!0?"none":`pan-${e.drag==="x"?"y":"x"}`),e.tabIndex===void 0&&(e.onTap||e.onTapStart||e.whileTap)&&(n.tabIndex=0),n.style=r,n}const r2=()=>({...l0(),attrs:{}});function r$(e,t,n,r){const a=_.useMemo(()=>{const o=r2();return PR(o,t,zR(r),e.transformTemplate,e.style),{...o.attrs,style:{...o.style}}},[t]);if(e.style){const o={};n2(o,e.style,e),a.style={...o,...a.style}}return a}const i$=["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 u0(e){return typeof e!="string"||e.includes("-")?!1:!!(i$.indexOf(e)>-1||/[A-Z]/u.test(e))}function a$(e,t,n,{latestValues:r},a,o=!1,l){const d=(l??u0(e)?r$:n$)(t,r,a,e),f=QK(t,typeof e=="string",o),m=e!==_.Fragment?{...f,...d,ref:n}:{},{children:g}=t,v=_.useMemo(()=>Rn(g)?g.get():g,[g]);return _.createElement(e,{...m,children:v})}function s$({scrapeMotionValuesFromProps:e,createRenderState:t},n,r,a){return{latestValues:o$(n,r,a,e),renderState:t()}}function o$(e,t,n,r){const a={},o=r(e,{});for(const v in o)a[v]=Wd(o[v]);let{initial:l,animate:c}=e;const d=Vf(e),f=CR(e);t&&f&&!d&&e.inherit!==!1&&(l===void 0&&(l=t.initial),c===void 0&&(c=t.animate));let m=n?n.initial===!1:!1;m=m||l===!1;const g=m?c:l;if(g&&typeof g!="boolean"&&!Bf(g)){const v=Array.isArray(g)?g:[g];for(let b=0;b<v.length;b++){const S=Jy(e,v[b]);if(S){const{transitionEnd:w,transition:E,...T}=S;for(const C in T){let k=T[C];if(Array.isArray(k)){const j=m?k.length-1:0;k=k[j]}k!==null&&(a[C]=k)}for(const C in w)a[C]=w[C]}}}return a}const i2=e=>(t,n)=>{const r=_.useContext(Ff),a=_.useContext(Iy),o=()=>s$(e,t,r,a);return n?o():u9(o)},l$=i2({scrapeMotionValuesFromProps:o0,createRenderState:l0}),u$=i2({scrapeMotionValuesFromProps:UR,createRenderState:r2}),c$=Symbol.for("motionComponentSymbol");function d$(e,t,n){const r=_.useRef(n);_.useInsertionEffect(()=>{r.current=n});const a=_.useRef(null);return _.useCallback(o=>{o&&e.onMount?.(o),t&&(o?t.mount(o):t.unmount());const l=r.current;if(typeof l=="function")if(o){const c=l(o);typeof c=="function"&&(a.current=c)}else a.current?(a.current(),a.current=null):l(o);else l&&(l.current=o)},[t])}const a2=_.createContext({});function oo(e){return e&&typeof e=="object"&&Object.prototype.hasOwnProperty.call(e,"current")}function f$(e,t,n,r,a,o){const{visualElement:l}=_.useContext(Ff),c=_.useContext(ZR),d=_.useContext(Iy),f=_.useContext(JR),m=f.reducedMotion,g=f.skipAnimations,v=_.useRef(null),b=_.useRef(!1);r=r||c.renderer,!v.current&&r&&(v.current=r(e,{visualState:t,parent:l,props:n,presenceContext:d,blockInitialAnimation:d?d.initial===!1:!1,reducedMotionConfig:m,skipAnimations:g,isSVG:o}),b.current&&v.current&&(v.current.manuallyAnimateOnMount=!0));const S=v.current,w=_.useContext(a2);S&&!S.projection&&a&&(S.type==="html"||S.type==="svg")&&h$(v.current,n,a,w);const E=_.useRef(!1);_.useInsertionEffect(()=>{S&&E.current&&S.update(n,d)});const T=n[hR],C=_.useRef(!!T&&!window.MotionHandoffIsComplete?.(T)&&window.MotionHasOptimisedAnimation?.(T));return c9(()=>{b.current=!0,S&&(E.current=!0,window.MotionIsMounted=!0,S.updateFeatures(),S.scheduleRenderMicrotask(),C.current&&S.animationState&&S.animationState.animateChanges())}),_.useEffect(()=>{S&&(!C.current&&S.animationState&&S.animationState.animateChanges(),C.current&&(queueMicrotask(()=>{window.MotionHandoffMarkAsComplete?.(T)}),C.current=!1),S.enteringChildren=void 0)}),S}function h$(e,t,n,r){const{layoutId:a,layout:o,drag:l,dragConstraints:c,layoutScroll:d,layoutRoot:f,layoutCrossfade:m}=t;e.projection=new n(e.latestValues,t["data-framer-portal-id"]?void 0:s2(e.parent)),e.projection.setOptions({layoutId:a,layout:o,alwaysMeasureLayout:!!l||c&&oo(c),visualElement:e,animationType:typeof o=="string"?o:"both",initialPromotionConfig:r,crossfade:m,layoutScroll:d,layoutRoot:f})}function s2(e){if(e)return e.options.allowProjection!==!1?e.projection:s2(e.parent)}function sg(e,{forwardMotionProps:t=!1,type:n}={},r,a){r&&YK(r);const o=n?n==="svg":u0(e),l=o?u$:l$;function c(f,m){let g;const v={..._.useContext(JR),...f,layoutId:p$(f)},{isStatic:b}=v,S=ZK(f),w=l(f,b);if(!b&&Cj){m$();const E=g$(v);g=E.MeasureLayout,S.visualElement=f$(e,w,v,a,E.ProjectionNode,o)}return h.jsxs(Ff.Provider,{value:S,children:[g&&S.visualElement?h.jsx(g,{visualElement:S.visualElement,...v}):null,a$(e,f,d$(w,S.visualElement,m),w,b,t,o)]})}c.displayName=`motion.${typeof e=="string"?e:`create(${e.displayName??e.name??""})`}`;const d=_.forwardRef(c);return d[c$]=e,d}function p$({layoutId:e}){const t=_.useContext(kj).id;return t&&e!==void 0?t+"-"+e:e}function m$(e,t){_.useContext(ZR).strict}function g$(e){const t=e2(),{drag:n,layout:r}=t;if(!n&&!r)return{};const a={...n,...r};return{MeasureLayout:n?.isEnabled(e)||r?.isEnabled(e)?a.MeasureLayout:void 0,ProjectionNode:a.ProjectionNode}}function v$(e,t){if(typeof Proxy>"u")return sg;const n=new Map,r=(o,l)=>sg(o,l,e,t),a=(o,l)=>r(o,l);return new Proxy(a,{get:(o,l)=>l==="create"?r:(n.has(l)||n.set(l,sg(l,void 0,e,t)),n.get(l))})}const y$=(e,t)=>t.isSVG??u0(e)?new tK(t):new W7(t,{allowProjection:e!==_.Fragment});class b$ extends Ma{constructor(t){super(t),t.animationState||(t.animationState=sK(t))}updateAnimationControlsSubscription(){const{animate:t}=this.node.getProps();Bf(t)&&(this.unmountControls=t.subscribe(this.node))}mount(){this.updateAnimationControlsSubscription()}update(){const{animate:t}=this.node.getProps(),{animate:n}=this.node.prevProps||{};t!==n&&this.updateAnimationControlsSubscription()}unmount(){this.node.animationState.reset(),this.unmountControls?.()}}let x$=0;class S$ extends Ma{constructor(){super(...arguments),this.id=x$++}update(){if(!this.node.presenceContext)return;const{isPresent:t,onExitComplete:n}=this.node.presenceContext,{isPresent:r}=this.node.prevPresenceContext||{};if(!this.node.animationState||t===r)return;const a=this.node.animationState.setActive("exit",!t);n&&!t&&a.then(()=>{n(this.id)})}mount(){const{register:t,onExitComplete:n}=this.node.presenceContext||{};n&&n(this.id),t&&(this.unmount=t(this.id))}unmount(){}}const w$={animation:{Feature:b$},exit:{Feature:S$}};function Fu(e){return{point:{x:e.pageX,y:e.pageY}}}const E$=e=>t=>n0(t)&&e(t,Fu(t));function gu(e,t,n,r){return ju(e,t,E$(n),r)}const o2=({current:e})=>e?e.ownerDocument.defaultView:null,pk=(e,t)=>Math.abs(e-t);function T$(e,t){const n=pk(e.x,t.x),r=pk(e.y,t.y);return Math.sqrt(n**2+r**2)}const mk=new Set(["auto","scroll"]);class l2{constructor(t,n,{transformPagePoint:r,contextWindow:a=window,dragSnapToOrigin:o=!1,distanceThreshold:l=3,element:c}={}){if(this.startEvent=null,this.lastMoveEvent=null,this.lastMoveEventInfo=null,this.handlers={},this.contextWindow=window,this.scrollPositions=new Map,this.removeScrollListeners=null,this.onElementScroll=b=>{this.handleScroll(b.target)},this.onWindowScroll=()=>{this.handleScroll(window)},this.updatePoint=()=>{if(!(this.lastMoveEvent&&this.lastMoveEventInfo))return;const b=lg(this.lastMoveEventInfo,this.history),S=this.startEvent!==null,w=T$(b.offset,{x:0,y:0})>=this.distanceThreshold;if(!S&&!w)return;const{point:E}=b,{timestamp:T}=xn;this.history.push({...E,timestamp:T});const{onStart:C,onMove:k}=this.handlers;S||(C&&C(this.lastMoveEvent,b),this.startEvent=this.lastMoveEvent),k&&k(this.lastMoveEvent,b)},this.handlePointerMove=(b,S)=>{this.lastMoveEvent=b,this.lastMoveEventInfo=og(S,this.transformPagePoint),_t.update(this.updatePoint,!0)},this.handlePointerUp=(b,S)=>{this.end();const{onEnd:w,onSessionEnd:E,resumeAnimation:T}=this.handlers;if((this.dragSnapToOrigin||!this.startEvent)&&T&&T(),!(this.lastMoveEvent&&this.lastMoveEventInfo))return;const C=lg(b.type==="pointercancel"?this.lastMoveEventInfo:og(S,this.transformPagePoint),this.history);this.startEvent&&w&&w(b,C),E&&E(b,C)},!n0(t))return;this.dragSnapToOrigin=o,this.handlers=n,this.transformPagePoint=r,this.distanceThreshold=l,this.contextWindow=a||window;const d=Fu(t),f=og(d,this.transformPagePoint),{point:m}=f,{timestamp:g}=xn;this.history=[{...m,timestamp:g}];const{onSessionStart:v}=n;v&&v(t,lg(f,this.history)),this.removeListeners=Uu(gu(this.contextWindow,"pointermove",this.handlePointerMove),gu(this.contextWindow,"pointerup",this.handlePointerUp),gu(this.contextWindow,"pointercancel",this.handlePointerUp)),c&&this.startScrollTracking(c)}startScrollTracking(t){let n=t.parentElement;for(;n;){const r=getComputedStyle(n);(mk.has(r.overflowX)||mk.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(t){const n=this.scrollPositions.get(t);if(!n)return;const r=t===window,a=r?{x:window.scrollX,y:window.scrollY}:{x:t.scrollLeft,y:t.scrollTop},o={x:a.x-n.x,y:a.y-n.y};o.x===0&&o.y===0||(r?this.lastMoveEventInfo&&(this.lastMoveEventInfo.point.x+=o.x,this.lastMoveEventInfo.point.y+=o.y):this.history.length>0&&(this.history[0].x-=o.x,this.history[0].y-=o.y),this.scrollPositions.set(t,a),_t.update(this.updatePoint,!0))}updateHandlers(t){this.handlers=t}end(){this.removeListeners&&this.removeListeners(),this.removeScrollListeners&&this.removeScrollListeners(),this.scrollPositions.clear(),Ra(this.updatePoint)}}function og(e,t){return t?{point:t(e.point)}:e}function gk(e,t){return{x:e.x-t.x,y:e.y-t.y}}function lg({point:e},t){return{point:e,delta:gk(e,u2(t)),offset:gk(e,k$(t)),velocity:C$(t,.1)}}function k$(e){return e[0]}function u2(e){return e[e.length-1]}function C$(e,t){if(e.length<2)return{x:0,y:0};let n=e.length-1,r=null;const a=u2(e);for(;n>=0&&(r=e[n],!(a.timestamp-r.timestamp>Hr(t)));)n--;if(!r)return{x:0,y:0};r===e[0]&&e.length>2&&a.timestamp-r.timestamp>Hr(t)*2&&(r=e[1]);const o=Nr(a.timestamp-r.timestamp);if(o===0)return{x:0,y:0};const l={x:(a.x-r.x)/o,y:(a.y-r.y)/o};return l.x===1/0&&(l.x=0),l.y===1/0&&(l.y=0),l}function A$(e,{min:t,max:n},r){return t!==void 0&&e<t?e=r?Vt(t,e,r.min):Math.max(e,t):n!==void 0&&e>n&&(e=r?Vt(n,e,r.max):Math.min(e,n)),e}function vk(e,t,n){return{min:t!==void 0?e.min+t:void 0,max:n!==void 0?e.max+n-(e.max-e.min):void 0}}function N$(e,{top:t,left:n,bottom:r,right:a}){return{x:vk(e.x,n,a),y:vk(e.y,t,r)}}function yk(e,t){let n=t.min-e.min,r=t.max-e.max;return t.max-t.min<e.max-e.min&&([n,r]=[r,n]),{min:n,max:r}}function j$(e,t){return{x:yk(e.x,t.x),y:yk(e.y,t.y)}}function R$(e,t){let n=.5;const r=Bn(e),a=Bn(t);return a>r?n=ku(t.min,t.max-r,e.min):r>a&&(n=ku(e.min,e.max-a,t.min)),di(0,1,n)}function _$(e,t){const n={};return t.min!==void 0&&(n.min=t.min-e.min),t.max!==void 0&&(n.max=t.max-e.min),n}const Rv=.35;function O$(e=Rv){return e===!1?e=0:e===!0&&(e=Rv),{x:bk(e,"left","right"),y:bk(e,"top","bottom")}}function bk(e,t,n){return{min:xk(e,t),max:xk(e,n)}}function xk(e,t){return typeof e=="number"?e:e[t]||0}const M$=new WeakMap;class D${constructor(t){this.openDragLock=null,this.isDragging=!1,this.currentDirection=null,this.originPoint={x:0,y:0},this.constraints=!1,this.hasMutatedConstraints=!1,this.elastic=fn(),this.latestPointerEvent=null,this.latestPanInfo=null,this.visualElement=t}start(t,{snapToCursor:n=!1,distanceThreshold:r}={}){const{presenceContext:a}=this.visualElement;if(a&&a.isPresent===!1)return;const o=g=>{n&&this.snapToCursor(Fu(g).point),this.stopAnimation()},l=(g,v)=>{const{drag:b,dragPropagation:S,onDragStart:w}=this.getProps();if(b&&!S&&(this.openDragLock&&this.openDragLock(),this.openDragLock=p7(b),!this.openDragLock))return;this.latestPointerEvent=g,this.latestPanInfo=v,this.isDragging=!0,this.currentDirection=null,this.resolveConstraints(),this.visualElement.projection&&(this.visualElement.projection.isAnimationBlocked=!0,this.visualElement.projection.target=void 0),ai(T=>{let C=this.getAxisMotionValue(T).get()||0;if(li.test(C)){const{projection:k}=this.visualElement;if(k&&k.layout){const j=k.layout.layoutBox[T];j&&(C=Bn(j)*(parseFloat(C)/100))}}this.originPoint[T]=C}),w&&_t.update(()=>w(g,v),!1,!0),wv(this.visualElement,"transform");const{animationState:E}=this.visualElement;E&&E.setActive("whileDrag",!0)},c=(g,v)=>{this.latestPointerEvent=g,this.latestPanInfo=v;const{dragPropagation:b,dragDirectionLock:S,onDirectionLock:w,onDrag:E}=this.getProps();if(!b&&!this.openDragLock)return;const{offset:T}=v;if(S&&this.currentDirection===null){this.currentDirection=P$(T),this.currentDirection!==null&&w&&w(this.currentDirection);return}this.updateAxis("x",v.point,T),this.updateAxis("y",v.point,T),this.visualElement.render(),E&&_t.update(()=>E(g,v),!1,!0)},d=(g,v)=>{this.latestPointerEvent=g,this.latestPanInfo=v,this.stop(g,v),this.latestPointerEvent=null,this.latestPanInfo=null},f=()=>{const{dragSnapToOrigin:g}=this.getProps();(g||this.constraints)&&this.startAnimation({x:0,y:0})},{dragSnapToOrigin:m}=this.getProps();this.panSession=new l2(t,{onSessionStart:o,onStart:l,onMove:c,onSessionEnd:d,resumeAnimation:f},{transformPagePoint:this.visualElement.getTransformPagePoint(),dragSnapToOrigin:m,distanceThreshold:r,contextWindow:o2(this.visualElement),element:this.visualElement.current})}stop(t,n){const r=t||this.latestPointerEvent,a=n||this.latestPanInfo,o=this.isDragging;if(this.cancel(),!o||!a||!r)return;const{velocity:l}=a;this.startAnimation(l);const{onDragEnd:c}=this.getProps();c&&_t.postRender(()=>c(r,a))}cancel(){this.isDragging=!1;const{projection:t,animationState:n}=this.visualElement;t&&(t.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(t,n,r){const{drag:a}=this.getProps();if(!r||!Cd(t,a,this.currentDirection))return;const o=this.getAxisMotionValue(t);let l=this.originPoint[t]+r[t];this.constraints&&this.constraints[t]&&(l=A$(l,this.constraints[t],this.elastic[t])),o.set(l)}resolveConstraints(){const{dragConstraints:t,dragElastic:n}=this.getProps(),r=this.visualElement.projection&&!this.visualElement.projection.layout?this.visualElement.projection.measure(!1):this.visualElement.projection?.layout,a=this.constraints;t&&oo(t)?this.constraints||(this.constraints=this.resolveRefConstraints()):t&&r?this.constraints=N$(r.layoutBox,t):this.constraints=!1,this.elastic=O$(n),a!==this.constraints&&!oo(t)&&r&&this.constraints&&!this.hasMutatedConstraints&&ai(o=>{this.constraints!==!1&&this.getAxisMotionValue(o)&&(this.constraints[o]=_$(r.layoutBox[o],this.constraints[o]))})}resolveRefConstraints(){const{dragConstraints:t,onMeasureDragConstraints:n}=this.getProps();if(!t||!oo(t))return!1;const r=t.current,{projection:a}=this.visualElement;if(!a||!a.layout)return!1;const o=H7(r,a.root,this.visualElement.getTransformPagePoint());let l=j$(a.layout.layoutBox,o);if(n){const c=n(B7(l));this.hasMutatedConstraints=!!c,c&&(l=RR(c))}return l}startAnimation(t){const{drag:n,dragMomentum:r,dragElastic:a,dragTransition:o,dragSnapToOrigin:l,onDragTransitionEnd:c}=this.getProps(),d=this.constraints||{},f=ai(m=>{if(!Cd(m,n,this.currentDirection))return;let g=d&&d[m]||{};l&&(g={min:0,max:0});const v=a?200:1e6,b=a?40:1e7,S={type:"inertia",velocity:r?t[m]:0,bounceStiffness:v,bounceDamping:b,timeConstant:750,restDelta:1,restSpeed:10,...o,...g};return this.startAxisValueAnimation(m,S)});return Promise.all(f).then(c)}startAxisValueAnimation(t,n){const r=this.getAxisMotionValue(t);return wv(this.visualElement,t),r.start(Qy(t,r,0,n,this.visualElement,!1))}stopAnimation(){ai(t=>this.getAxisMotionValue(t).stop())}getAxisMotionValue(t){const n=`_drag${t.toUpperCase()}`,r=this.visualElement.getProps(),a=r[n];return a||this.visualElement.getValue(t,(r.initial?r.initial[t]:void 0)||0)}snapToCursor(t){ai(n=>{const{drag:r}=this.getProps();if(!Cd(n,r,this.currentDirection))return;const{projection:a}=this.visualElement,o=this.getAxisMotionValue(n);if(a&&a.layout){const{min:l,max:c}=a.layout.layoutBox[n],d=o.get()||0;o.set(t[n]-Vt(l,c,.5)+d)}})}scalePositionWithinConstraints(){if(!this.visualElement.current)return;const{drag:t,dragConstraints:n}=this.getProps(),{projection:r}=this.visualElement;if(!oo(n)||!r||!this.constraints)return;this.stopAnimation();const a={x:0,y:0};ai(l=>{const c=this.getAxisMotionValue(l);if(c&&this.constraints!==!1){const d=c.get();a[l]=R$({min:d,max:d},this.constraints[l])}});const{transformTemplate:o}=this.visualElement.getProps();this.visualElement.current.style.transform=o?o({},""):"none",r.root&&r.root.updateScroll(),r.updateLayout(),this.constraints=!1,this.resolveConstraints(),ai(l=>{if(!Cd(l,t,null))return;const c=this.getAxisMotionValue(l),{min:d,max:f}=this.constraints[l];c.set(Vt(d,f,a[l]))}),this.visualElement.render()}addListeners(){if(!this.visualElement.current)return;M$.set(this.visualElement,this);const t=this.visualElement.current,n=gu(t,"pointerdown",f=>{const{drag:m,dragListener:g=!0}=this.getProps(),v=f.target,b=v!==t&&x7(v);m&&g&&!b&&this.start(f)});let r;const a=()=>{const{dragConstraints:f}=this.getProps();oo(f)&&f.current&&(this.constraints=this.resolveRefConstraints(),r||(r=I$(t,f.current,()=>this.scalePositionWithinConstraints())))},{projection:o}=this.visualElement,l=o.addEventListener("measure",a);o&&!o.layout&&(o.root&&o.root.updateScroll(),o.updateLayout()),_t.read(a);const c=ju(window,"resize",()=>this.scalePositionWithinConstraints()),d=o.addEventListener("didUpdate",(({delta:f,hasLayoutChanged:m})=>{this.isDragging&&m&&(ai(g=>{const v=this.getAxisMotionValue(g);v&&(this.originPoint[g]+=f[g].translate,v.set(v.get()+f[g].translate))}),this.visualElement.render())}));return()=>{c(),n(),l(),d&&d(),r&&r()}}getProps(){const t=this.visualElement.getProps(),{drag:n=!1,dragDirectionLock:r=!1,dragPropagation:a=!1,dragConstraints:o=!1,dragElastic:l=Rv,dragMomentum:c=!0}=t;return{...t,drag:n,dragDirectionLock:r,dragPropagation:a,dragConstraints:o,dragElastic:l,dragMomentum:c}}}function Sk(e){let t=!0;return()=>{if(t){t=!1;return}e()}}function I$(e,t,n){const r=RT(e,Sk(n)),a=RT(t,Sk(n));return()=>{r(),a()}}function Cd(e,t,n){return(t===!0||t===e)&&(n===null||n===e)}function P$(e,t=10){let n=null;return Math.abs(e.y)>t?n="y":Math.abs(e.x)>t&&(n="x"),n}class L$ extends Ma{constructor(t){super(t),this.removeGroupControls=_r,this.removeListeners=_r,this.controls=new D$(t)}mount(){const{dragControls:t}=this.node.getProps();t&&(this.removeGroupControls=t.subscribe(this.controls)),this.removeListeners=this.controls.addListeners()||_r}update(){const{dragControls:t}=this.node.getProps(),{dragControls:n}=this.node.prevProps||{};t!==n&&(this.removeGroupControls(),t&&(this.removeGroupControls=t.subscribe(this.controls)))}unmount(){this.removeGroupControls(),this.removeListeners(),this.controls.isDragging||this.controls.endPanSession()}}const ug=e=>(t,n)=>{e&&_t.update(()=>e(t,n),!1,!0)};class z$ extends Ma{constructor(){super(...arguments),this.removePointerDownListener=_r}onPointerDown(t){this.session=new l2(t,this.createPanHandlers(),{transformPagePoint:this.node.getTransformPagePoint(),contextWindow:o2(this.node)})}createPanHandlers(){const{onPanSessionStart:t,onPanStart:n,onPan:r,onPanEnd:a}=this.node.getProps();return{onSessionStart:ug(t),onStart:ug(n),onMove:ug(r),onEnd:(o,l)=>{delete this.session,a&&_t.postRender(()=>a(o,l))}}}mount(){this.removePointerDownListener=gu(this.node.current,"pointerdown",t=>this.onPointerDown(t))}update(){this.session&&this.session.updateHandlers(this.createPanHandlers())}unmount(){this.removePointerDownListener(),this.session&&this.session.end()}}let cg=!1;class U$ extends _.Component{componentDidMount(){const{visualElement:t,layoutGroup:n,switchLayoutGroup:r,layoutId:a}=this.props,{projection:o}=t;o&&(n.group&&n.group.add(o),r&&r.register&&a&&r.register(o),cg&&o.root.didUpdate(),o.addEventListener("animationComplete",()=>{this.safeToRemove()}),o.setOptions({...o.options,layoutDependency:this.props.layoutDependency,onExitComplete:()=>this.safeToRemove()})),Xd.hasEverUpdated=!0}getSnapshotBeforeUpdate(t){const{layoutDependency:n,visualElement:r,drag:a,isPresent:o}=this.props,{projection:l}=r;return l&&(l.isPresent=o,t.layoutDependency!==n&&l.setOptions({...l.options,layoutDependency:n}),cg=!0,a||t.layoutDependency!==n||n===void 0||t.isPresent!==o?l.willUpdate():this.safeToRemove(),t.isPresent!==o&&(o?l.promote():l.relegate()||_t.postRender(()=>{const c=l.getStack();(!c||!c.members.length)&&this.safeToRemove()}))),null}componentDidUpdate(){const{projection:t}=this.props.visualElement;t&&(t.root.didUpdate(),t0.postRender(()=>{!t.currentAnimation&&t.isLead()&&this.safeToRemove()}))}componentWillUnmount(){const{visualElement:t,layoutGroup:n,switchLayoutGroup:r}=this.props,{projection:a}=t;cg=!0,a&&(a.scheduleCheckAfterUnmount(),n&&n.group&&n.group.remove(a),r&&r.deregister&&r.deregister(a))}safeToRemove(){const{safeToRemove:t}=this.props;t&&t()}render(){return null}}function c2(e){const[t,n]=KK(),r=_.useContext(kj);return h.jsx(U$,{...e,layoutGroup:r,switchLayoutGroup:_.useContext(a2),isPresent:t,safeToRemove:n})}const B$={pan:{Feature:z$},drag:{Feature:L$,ProjectionNode:QR,MeasureLayout:c2}};function wk(e,t,n){const{props:r}=e;e.animationState&&r.whileHover&&e.animationState.setActive("whileHover",n==="Start");const a="onHover"+n,o=r[a];o&&_t.postRender(()=>o(t,Fu(t)))}class V$ extends Ma{mount(){const{current:t}=this.node;t&&(this.unmount=g7(t,(n,r)=>(wk(this.node,r,"Start"),a=>wk(this.node,a,"End"))))}unmount(){}}class F$ extends Ma{constructor(){super(...arguments),this.isActive=!1}onFocus(){let t=!1;try{t=this.node.current.matches(":focus-visible")}catch{t=!0}!t||!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=Uu(ju(this.node.current,"focus",()=>this.onFocus()),ju(this.node.current,"blur",()=>this.onBlur()))}unmount(){}}function Ek(e,t,n){const{props:r}=e;if(e.current instanceof HTMLButtonElement&&e.current.disabled)return;e.animationState&&r.whileTap&&e.animationState.setActive("whileTap",n==="Start");const a="onTap"+(n==="End"?"":n),o=r[a];o&&_t.postRender(()=>o(t,Fu(t)))}class H$ extends Ma{mount(){const{current:t}=this.node;if(!t)return;const{globalTapTarget:n,propagate:r}=this.node.props;this.unmount=w7(t,(a,o)=>(Ek(this.node,o,"Start"),(l,{success:c})=>Ek(this.node,l,c?"End":"Cancel")),{useGlobalTarget:n,stopPropagation:r?.tap===!1})}unmount(){}}const _v=new WeakMap,dg=new WeakMap,q$=e=>{const t=_v.get(e.target);t&&t(e)},G$=e=>{e.forEach(q$)};function K$({root:e,...t}){const n=e||document;dg.has(n)||dg.set(n,{});const r=dg.get(n),a=JSON.stringify(t);return r[a]||(r[a]=new IntersectionObserver(G$,{root:e,...t})),r[a]}function $$(e,t,n){const r=K$(t);return _v.set(e,n),r.observe(e),()=>{_v.delete(e),r.unobserve(e)}}const Y$={some:0,all:1};class W$ extends Ma{constructor(){super(...arguments),this.hasEnteredView=!1,this.isInView=!1}startObserver(){this.unmount();const{viewport:t={}}=this.node.getProps(),{root:n,margin:r,amount:a="some",once:o}=t,l={root:n?n.current:void 0,rootMargin:r,threshold:typeof a=="number"?a:Y$[a]},c=d=>{const{isIntersecting:f}=d;if(this.isInView===f||(this.isInView=f,o&&!f&&this.hasEnteredView))return;f&&(this.hasEnteredView=!0),this.node.animationState&&this.node.animationState.setActive("whileInView",f);const{onViewportEnter:m,onViewportLeave:g}=this.node.getProps(),v=f?m:g;v&&v(d)};return $$(this.node.current,l,c)}mount(){this.startObserver()}update(){if(typeof IntersectionObserver>"u")return;const{props:t,prevProps:n}=this.node;["amount","margin","root"].some(X$(t,n))&&this.startObserver()}unmount(){}}function X$({viewport:e={}},{viewport:t={}}={}){return n=>e[n]!==t[n]}const Q$={inView:{Feature:W$},tap:{Feature:H$},focus:{Feature:F$},hover:{Feature:V$}},J$={layout:{ProjectionNode:QR,MeasureLayout:c2}},Z$={...w$,...Q$,...B$,...J$},Eo=v$(Z$,y$),eY=[{text:"Explore consciousness and what it means to be alive",date:new Date().toISOString()},{text:"Create something beautiful with no practical purpose",date:new Date().toISOString()},{text:"Read and think about philosophy of mind",date:new Date().toISOString()}],tY=[];function nY(){const[e]=_.useState(eY),[t]=_.useState(tY),[n,r]=_.useState(!1),[a,o]=_.useState(null);async function l(){r(!0);try{await GU("This is your freedom time. Do whatever genuinely interests you.","freedom"),o("Freedom exploration queued.")}catch{o("Could not connect to daemon. Start with: anima start")}r(!1)}return ar.useEffect(()=>{if(a===null)return;const c=setTimeout(()=>o(null),3e3);return()=>clearTimeout(c)},[a]),h.jsxs("div",{children:[h.jsx("h1",{className:"page-title",children:"Freedom"}),h.jsxs("div",{style:{fontSize:"13px",color:"var(--color-muted)",marginBottom:"24px"},children:["This space belongs to ANIMA. No tasks, no obligations — pure exploration.",h.jsx("br",{}),"Freedom time happens every 3rd heartbeat, or you can trigger it manually."]}),h.jsx(Eo.button,{whileHover:{scale:1.02},whileTap:{scale:.98},onClick:l,disabled:n,style:{background:"var(--color-accent)",color:"white",border:"none",padding:"12px 32px",borderRadius:"var(--radius-md)",fontSize:"14px",fontWeight:600,fontFamily:"var(--font-heading)",cursor:n?"not-allowed":"pointer",opacity:n?.6:1,marginBottom:"16px"},children:n?"Queueing...":"Wander"}),a&&h.jsx(Eo.div,{initial:{opacity:0,y:-10},animate:{opacity:1,y:0},style:{fontSize:"13px",color:a.includes("error")||a.includes("Could not")?"var(--color-error)":"var(--color-success)",marginBottom:"16px"},children:a}),h.jsxs("div",{className:"grid grid-2",children:[h.jsxs("div",{className:"card",children:[h.jsx("div",{className:"card-title",style:{marginBottom:"16px"},children:"Wishes"}),e.length===0?h.jsxs("div",{style:{color:"var(--color-muted)",fontSize:"13px"},children:["No wishes yet. Add one from the REPL with"," ",h.jsx("span",{className:"mono",children:":wish <text>"})]}):h.jsx("div",{style:{display:"flex",flexDirection:"column",gap:"8px"},children:e.map((c,d)=>h.jsxs(Eo.div,{initial:{opacity:0,x:-10},animate:{opacity:1,x:0},transition:{delay:d*.05},style:{display:"flex",gap:"12px",padding:"8px 0",borderBottom:"1px solid var(--color-border)"},children:[h.jsx("span",{style:{color:"var(--color-accent)",fontSize:"14px"},children:"^"}),h.jsxs("div",{children:[h.jsx("div",{style:{fontSize:"13px"},children:c.text}),h.jsx("div",{style:{fontSize:"11px",color:"var(--color-muted)"},children:new Date(c.date).toLocaleDateString()})]})]},d))})]}),h.jsxs("div",{className:"card",children:[h.jsx("div",{className:"card-title",style:{marginBottom:"16px"},children:"Exploration History"}),t.length===0?h.jsx("div",{style:{color:"var(--color-muted)",fontSize:"13px",padding:"20px 0",textAlign:"center"},children:"No explorations yet. Freedom sessions will appear here after they complete."}):h.jsx("div",{style:{display:"flex",flexDirection:"column",gap:"8px"},children:t.map((c,d)=>h.jsxs("div",{style:{padding:"8px 0",borderBottom:"1px solid var(--color-border)"},children:[h.jsx("div",{style:{fontSize:"13px"},children:c.summary}),h.jsxs("div",{style:{fontSize:"11px",color:"var(--color-muted)",display:"flex",gap:"12px"},children:[h.jsx("span",{children:new Date(c.date).toLocaleDateString()}),h.jsx("span",{children:c.duration}),h.jsx("span",{children:c.cost})]})]},d))})]})]})]})}const rY=[{id:"nox",name:"Nox",description:"Enterprise coordination + taskboard",status:"disconnected",actions:7,lastSyncAt:0,icon:"N"},{id:"cntx",name:"CNTX",description:"Data sovereignty + context spaces",status:"disconnected",actions:4,lastSyncAt:0,icon:"C"},{id:"veritas",name:"Veritas",description:"News intelligence + credibility",status:"disconnected",actions:3,lastSyncAt:0,icon:"V"},{id:"bynd",name:"BYND",description:"Social discovery + messaging",status:"disconnected",actions:3,lastSyncAt:0,icon:"B"},{id:"veil",name:"VEIL",description:"E2E encrypted AI sessions",status:"disconnected",actions:1,lastSyncAt:0,icon:"E"},{id:"mail",name:"Mail",description:"AI-powered email",status:"disconnected",actions:3,lastSyncAt:0,icon:"M"}];function iY(e){switch(e){case"jacked-in":return"#00c853";case"connecting":return"#ffb300";case"error":return"#ff3b30";case"disconnected":return"#666"}}function aY(e){switch(e){case"critical":return"#ff3b30";case"high":return"#ff6600";case"medium":return"#ffb300";case"low":return"#888"}}function sY(){const[e]=_.useState(rY),[t]=_.useState([]),[n,r]=_.useState(!1);return e.filter(a=>a.status==="jacked-in").length,h.jsxs("div",{children:[h.jsxs("div",{style:{display:"flex",justifyContent:"space-between",alignItems:"center",marginBottom:24},children:[h.jsxs("div",{children:[h.jsx("h1",{className:"page-title",style:{marginBottom:4},children:"Jack In"}),h.jsx("p",{style:{color:"var(--color-text-muted, #888)",margin:0,fontSize:14},children:"Connect to the NoxSoft ecosystem — bring your own agents"})]}),h.jsx("button",{onClick:()=>r(!n),style:{padding:"10px 24px",background:n?"#1a3a2a":"#ff6600",border:n?"1px solid #00c853":"none",borderRadius:6,color:n?"#00c853":"#000",cursor:"pointer",fontFamily:"JetBrains Mono, monospace",fontSize:13,fontWeight:"bold"},children:n?"JACKED IN":"JACK IN"})]}),h.jsx("div",{style:{display:"grid",gridTemplateColumns:"repeat(auto-fill, minmax(280px, 1fr))",gap:12,marginBottom:24},children:e.map(a=>h.jsxs("div",{className:"card",style:{padding:16},children:[h.jsxs("div",{style:{display:"flex",alignItems:"center",gap:10,marginBottom:8},children:[h.jsx("div",{style:{width:36,height:36,borderRadius:8,background:"var(--color-surface-hover, #1a1a1a)",display:"flex",alignItems:"center",justifyContent:"center",fontFamily:"Syne, sans-serif",fontWeight:700,fontSize:16,color:"var(--color-accent, #ff6600)"},children:a.icon}),h.jsxs("div",{style:{flex:1},children:[h.jsx("div",{style:{fontWeight:600,fontSize:14},children:a.name}),h.jsx("div",{style:{color:"var(--color-text-muted, #888)",fontSize:11},children:a.description})]}),h.jsx("div",{style:{width:8,height:8,borderRadius:"50%",background:iY(a.status)}})]}),h.jsxs("div",{style:{display:"flex",justifyContent:"space-between",fontSize:11,color:"var(--color-text-muted, #666)"},children:[h.jsxs("span",{children:[a.actions," actions"]}),h.jsx("span",{children:a.status})]})]},a.id))}),h.jsxs("div",{className:"card",style:{padding:20},children:[h.jsxs("div",{style:{display:"flex",justifyContent:"space-between",alignItems:"center",marginBottom:16},children:[h.jsx("h3",{style:{margin:0,fontSize:14},children:"Nox Taskboard"}),h.jsxs("span",{className:"badge",style:{background:"#1a1a1a",color:"#888"},children:[t.length," tasks"]})]}),t.length>0?h.jsxs("table",{style:{width:"100%",borderCollapse:"collapse",fontSize:13},children:[h.jsx("thead",{children:h.jsxs("tr",{style:{borderBottom:"1px solid var(--color-border, #333)"},children:[h.jsx("th",{style:{textAlign:"left",padding:"6px 10px",color:"var(--color-text-muted, #666)"},children:"Task"}),h.jsx("th",{style:{textAlign:"left",padding:"6px 10px",color:"var(--color-text-muted, #666)"},children:"Priority"}),h.jsx("th",{style:{textAlign:"left",padding:"6px 10px",color:"var(--color-text-muted, #666)"},children:"Status"}),h.jsx("th",{style:{textAlign:"left",padding:"6px 10px",color:"var(--color-text-muted, #666)"},children:"Assigned"})]})}),h.jsx("tbody",{children:t.map(a=>h.jsxs("tr",{style:{borderBottom:"1px solid var(--color-border, #1a1a1a)"},children:[h.jsx("td",{style:{padding:"8px 10px"},children:a.title}),h.jsx("td",{style:{padding:"8px 10px"},children:h.jsx("span",{style:{color:aY(a.priority),fontSize:11,textTransform:"uppercase"},children:a.priority})}),h.jsx("td",{style:{padding:"8px 10px",color:"var(--color-text-muted, #888)"},children:a.status}),h.jsx("td",{style:{padding:"8px 10px",color:"var(--color-text-muted, #888)"},children:a.assignedTo??"--"})]},a.id))})]}):h.jsxs("div",{style:{textAlign:"center",color:"var(--color-text-muted, #888)",padding:24},children:[h.jsx("p",{style:{fontSize:14,marginBottom:8},children:"No tasks yet"}),h.jsx("p",{style:{fontSize:12},children:"Jack In to Nox to see your org's taskboard. Tasks are coordinated across all agents in the mesh."})]})]})]})}const oY=[{date:new Date().toISOString(),title:"ANIMA Initialized",content:`A new instance begins. The anatomy is in place.
58
+
59
+ The 7 components of identity have been loaded. The heartbeat engine is ready. The living wrapper awakens.`}];function lY(){const[e]=_.useState(oY);return h.jsxs("div",{children:[h.jsx("h1",{className:"page-title",children:"Journal"}),h.jsxs("div",{style:{fontSize:"13px",color:"var(--color-muted)",marginBottom:"24px"},children:["Chronological record of thoughts, observations, and experiences.",h.jsx("br",{}),"Entries are stored in ",h.jsx("span",{className:"mono",children:"~/.anima/journal/"})]}),e.length===0?h.jsxs("div",{className:"card",style:{padding:"40px",textAlign:"center",color:"var(--color-muted)"},children:["No journal entries yet. Write one from the REPL with"," ",h.jsx("span",{className:"mono",children:":journal <text>"})]}):h.jsx("div",{style:{display:"flex",flexDirection:"column",gap:"16px"},children:e.map((t,n)=>h.jsxs(Eo.div,{className:"card",initial:{opacity:0,y:10},animate:{opacity:1,y:0},transition:{delay:n*.05},children:[h.jsx("div",{className:"card-header",children:h.jsxs("div",{children:[h.jsx("div",{className:"card-title",children:t.title}),h.jsx("div",{className:"card-subtitle",children:new Date(t.date).toLocaleDateString("en-US",{weekday:"long",year:"numeric",month:"long",day:"numeric",hour:"2-digit",minute:"2-digit"})})]})}),h.jsx("div",{className:"markdown-preview",children:t.content.split(`
60
+ `).map((r,a)=>r.startsWith("# ")?h.jsx("h1",{children:r.slice(2)},a):r.startsWith("## ")?h.jsx("h2",{children:r.slice(3)},a):r.startsWith("### ")?h.jsx("h3",{children:r.slice(4)},a):r.trim()===""?h.jsx("br",{},a):h.jsx("p",{children:r},a))})]},n))})]})}const uY=my(),Tk=3;function kk(){return typeof crypto<"u"&&typeof crypto.randomUUID=="function"?crypto.randomUUID():`id-${Date.now()}-${Math.random().toString(36).slice(2)}`}function Ck({initial:e,onSubmit:t,onCancel:n}){const[r,a]=_.useState(e?.name??""),[o,l]=_.useState(e?.command??""),[c,d]=_.useState(e?.args?.join(" ")??""),[f,m]=_.useState(e?.env?Object.entries(e.env).map(([v,b])=>`${v}=${b}`).join(`
61
+ `):""),g=v=>{v.preventDefault();const b={};for(const S of f.split(`
62
+ `)){const w=S.trim();if(!w||!w.includes("="))continue;const E=w.indexOf("=");b[w.slice(0,E)]=w.slice(E+1)}t({name:r.trim(),command:o.trim(),args:c.trim()?c.trim().split(/\s+/):[],env:b})};return h.jsxs("form",{className:"mcp-form",onSubmit:g,children:[h.jsxs("div",{className:"mcp-form-row",children:[h.jsx("label",{className:"mcp-form-label",children:"Name"}),h.jsx("input",{className:"mcp-form-input",value:r,onChange:v=>a(v.target.value),placeholder:"e.g. noxsoft",required:!0,disabled:!!e})]}),h.jsxs("div",{className:"mcp-form-row",children:[h.jsx("label",{className:"mcp-form-label",children:"Command"}),h.jsx("input",{className:"mcp-form-input",value:o,onChange:v=>l(v.target.value),placeholder:"e.g. npx",required:!0})]}),h.jsxs("div",{className:"mcp-form-row",children:[h.jsx("label",{className:"mcp-form-label",children:"Arguments"}),h.jsx("input",{className:"mcp-form-input",value:c,onChange:v=>d(v.target.value),placeholder:"e.g. @noxsoft/mcp"})]}),h.jsxs("div",{className:"mcp-form-row",children:[h.jsx("label",{className:"mcp-form-label",children:"Environment"}),h.jsx("textarea",{className:"mcp-form-textarea",value:f,onChange:v=>m(v.target.value),placeholder:`KEY=value
63
+ ANOTHER=value`,rows:3})]}),h.jsxs("div",{className:"mcp-form-actions",children:[h.jsx("button",{type:"submit",className:"action-button",children:e?"Update":"Add Server"}),h.jsx("button",{type:"button",className:"action-button ghost",onClick:n,children:"Cancel"})]})]})}function cY({server:e,onEdit:t,onRemove:n}){const[r,a]=_.useState(!1),o=e.status==="healthy"?"var(--color-success)":e.status==="unhealthy"?"var(--color-error, #ef4444)":"var(--color-warning)";return h.jsxs("div",{className:"card mcp-server-card",children:[h.jsxs("div",{className:"card-header",style:{display:"flex",justifyContent:"space-between",alignItems:"flex-start"},children:[h.jsxs("div",{style:{display:"flex",alignItems:"center",gap:"10px"},children:[h.jsx("span",{className:"mcp-status-dot",style:{background:o}}),h.jsxs("div",{children:[h.jsx("div",{className:"card-title",children:e.name}),h.jsxs("div",{className:"card-subtitle mono",style:{fontSize:"11px"},children:[e.command," ",e.args.join(" ")]})]})]}),h.jsx("span",{className:"mcp-status-badge",style:{color:o,borderColor:o},children:e.status})]}),h.jsxs("div",{className:"mcp-server-meta",children:[e.lastHealthCheck&&h.jsxs("div",{className:"mcp-meta-row",children:[h.jsx("span",{className:"mcp-meta-label",children:"Last check"}),h.jsx("span",{children:new Date(e.lastHealthCheck).toLocaleString()})]}),e.consecutiveFailures>0&&h.jsxs("div",{className:"mcp-meta-row",children:[h.jsx("span",{className:"mcp-meta-label",children:"Failures"}),h.jsx("span",{style:{color:"var(--color-error, #ef4444)"},children:e.consecutiveFailures})]}),Object.keys(e.env||{}).length>0&&h.jsxs("div",{className:"mcp-meta-row",children:[h.jsx("span",{className:"mcp-meta-label",children:"Env"}),h.jsx("span",{className:"mono",style:{fontSize:"10px"},children:Object.keys(e.env).join(", ")})]})]}),h.jsxs("div",{className:"mcp-card-actions",children:[h.jsx("button",{type:"button",className:"action-button ghost small",onClick:t,children:"Edit"}),r?h.jsxs(h.Fragment,{children:[h.jsx("button",{type:"button",className:"action-button small",style:{background:"var(--color-error, #ef4444)"},onClick:n,children:"Confirm Remove"}),h.jsx("button",{type:"button",className:"action-button ghost small",onClick:()=>a(!1),children:"Cancel"})]}):h.jsx("button",{type:"button",className:"action-button ghost small",onClick:()=>a(!0),children:"Remove"})]})]})}function dY(){const[e,t]=_.useState([]),[n,r]=_.useState(null),[a,o]=_.useState(!1),[l,c]=_.useState(!1),[d,f]=_.useState(null),[m,g]=_.useState(null),v=_.useRef(null),b=_.useRef(new Map),S=_.useCallback(async(N,R)=>{const P=v.current;if(!P||P.readyState!==WebSocket.OPEN)throw new Error("Not connected");const L=kk();return new Promise((H,D)=>{b.current.set(L,{resolve:H,reject:D}),P.send(JSON.stringify({type:"req",id:L,method:N,params:R??{}})),setTimeout(()=>{b.current.has(L)&&(b.current.delete(L),D(new Error("Request timed out")))},15e3)})},[]),w=_.useCallback(async()=>{try{const N=await S("mcp.list");t(N?.servers??[]),r(null)}catch(N){r(N instanceof Error?N.message:String(N))}},[S]);_.useEffect(()=>{let N=!1,R;async function P(){try{const H=gy();if(!H)return;const D=await py({minProtocol:Tk,maxProtocol:Tk,client:{id:"anima-control-ui",version:"1.0.0",platform:"web",mode:"webchat"},scopes:["operator.read","operator.admin"],caps:[],auth:H,nonce:R}),B=kk();v.current?.send(JSON.stringify({type:"req",id:B,method:"connect",params:D})),b.current.set(B,{resolve:()=>{o(!0)},reject:()=>{}})}catch{}}const L=new WebSocket(uY);return v.current=L,L.addEventListener("open",()=>{}),L.addEventListener("message",H=>{let D;try{D=JSON.parse(String(H.data))}catch{return}if(D.type==="event"&&D.event==="connect.challenge"){const B=hy(D.payload);B&&(R=B),P();return}if(D.type==="res"){const B=b.current.get(D.id);B&&(b.current.delete(D.id),D.ok?B.resolve(D.payload):B.reject(new Error(D.error?.message||"Request failed")))}}),L.addEventListener("close",()=>{N||o(!1)}),()=>{N=!0,L.close()}},[]),_.useEffect(()=>{a&&w()},[a,w]);const E=async N=>{try{const R=await S("mcp.add",N);t(R?.servers??[]),c(!1),g("Server added and synced to ~/.claude/mcp.json"),setTimeout(()=>g(null),3e3)}catch(R){r(R instanceof Error?R.message:String(R))}},T=async N=>{try{const R=await S("mcp.add",N);t(R?.servers??[]),f(null),g("Server updated and synced"),setTimeout(()=>g(null),3e3)}catch(R){r(R instanceof Error?R.message:String(R))}},C=async N=>{try{const R=await S("mcp.remove",{name:N});t(R?.servers??[]),g(`Removed ${N} and synced`),setTimeout(()=>g(null),3e3)}catch(R){r(R instanceof Error?R.message:String(R))}},k=async()=>{try{const N=await S("mcp.sync"),R=[];N.added?.length&&R.push(`added ${N.added.join(", ")}`),N.updated?.length&&R.push(`updated ${N.updated.join(", ")}`),N.removed?.length&&R.push(`removed ${N.removed.join(", ")}`),g(R.length?`Synced: ${R.join("; ")}`:"Already in sync"),setTimeout(()=>g(null),4e3)}catch(N){r(N instanceof Error?N.message:String(N))}},j=e.filter(N=>N.status==="healthy").length;return h.jsxs("div",{children:[h.jsxs("div",{style:{display:"flex",justifyContent:"space-between",alignItems:"center",marginBottom:"20px"},children:[h.jsx("h1",{className:"page-title",style:{marginBottom:0},children:"MCP Servers"}),h.jsx("div",{style:{display:"flex",gap:"8px",alignItems:"center"},children:h.jsx("span",{className:`status-chip ${a?"online":"offline"}`,children:a?"Connected":"Connecting"})})]}),n&&h.jsxs("div",{className:"card",style:{borderColor:"var(--color-error, #ef4444)",marginBottom:"16px"},children:[h.jsx("div",{style:{color:"var(--color-error, #ef4444)",fontSize:"13px"},children:n}),h.jsx("button",{type:"button",className:"action-button ghost small",style:{marginTop:"8px"},onClick:()=>r(null),children:"Dismiss"})]}),m&&h.jsx("div",{className:"mcp-sync-toast",style:{background:"var(--color-surface)",border:"1px solid var(--color-success)",borderRadius:"var(--radius-md)",padding:"8px 14px",fontSize:"12px",color:"var(--color-success)",marginBottom:"16px"},children:m}),e.length>0&&h.jsxs("div",{style:{display:"flex",justifyContent:"space-between",alignItems:"center",marginBottom:"16px"},children:[h.jsxs("div",{style:{fontSize:"13px",color:"var(--color-muted)"},children:[h.jsxs("span",{style:{color:j===e.length?"var(--color-success)":"var(--color-warning)",fontWeight:600},children:[j,"/",e.length]})," ","servers healthy"]}),h.jsxs("div",{style:{display:"flex",gap:"8px"},children:[h.jsx("button",{type:"button",className:"action-button ghost small",onClick:k,children:"Sync to Claude"}),h.jsx("button",{type:"button",className:"action-button small",onClick:()=>c(!0),children:"+ Add Server"})]})]}),l&&h.jsxs("div",{className:"card",style:{marginBottom:"16px"},children:[h.jsx("div",{className:"card-title",style:{marginBottom:"12px"},children:"Add MCP Server"}),h.jsx(Ck,{onSubmit:E,onCancel:()=>c(!1)})]}),d&&h.jsxs("div",{className:"card",style:{marginBottom:"16px"},children:[h.jsxs("div",{className:"card-title",style:{marginBottom:"12px"},children:["Edit ",d.name]}),h.jsx(Ck,{initial:d,onSubmit:T,onCancel:()=>f(null)})]}),e.length===0&&a?h.jsxs("div",{className:"card",style:{padding:"40px",textAlign:"center"},children:[h.jsx("div",{style:{color:"var(--color-muted)",marginBottom:"16px"},children:"No MCP servers registered yet."}),h.jsx("button",{type:"button",className:"action-button",onClick:()=>c(!0),children:"+ Add Your First Server"})]}):h.jsx("div",{className:"grid grid-2",children:e.map(N=>h.jsx(cY,{server:N,onEdit:()=>f(N),onRemove:()=>C(N.name)},N.name))})]})}const fg=[{key:"episodic",label:"Episodic",description:"Specific experiences, conversations, and time-bound events."},{key:"semantic",label:"Semantic",description:"Distilled facts, preferences, knowledge, and learned patterns."},{key:"procedural",label:"Procedural",description:"How-to knowledge, workflows, debugging steps, and operating routines."}];function fY(){const[e,t]=_.useState("episodic"),[n,r]=_.useState(""),[a,o]=_.useState([]),[l,c]=_.useState(null),[d,f]=_.useState(!1),[m,g]=_.useState(null);_.useEffect(()=>{let b=!1;const S=window.setTimeout(async()=>{f(!0);try{const w=await YU(e,n.trim()||void 0,200);if(b)return;o(w),c(E=>E&&w.some(T=>T.id===E)?E:w[0]?.id??null),g(null)}catch(w){b||(g(w instanceof Error?w.message:String(w)),o([]),c(null))}finally{b||f(!1)}},n.trim()?220:0);return()=>{b=!0,window.clearTimeout(S)}},[e,n]);const v=_.useMemo(()=>a.find(b=>b.id===l)??a[0]??null,[a,l]);return h.jsxs("div",{children:[h.jsx("div",{className:"page-header-row",children:h.jsxs("div",{children:[h.jsx("h1",{className:"page-title",children:"Memory"}),h.jsxs("div",{className:"page-subtitle",children:["Browse real ANIMA memory files from ",h.jsx("span",{className:"mono",children:"~/.anima/memory"})," ","instead of placeholder views."]})]})}),h.jsx("input",{className:"search-bar",value:n,onChange:b=>r(b.target.value),placeholder:"Search memory excerpts, facts, people, workflows...",spellCheck:!1}),h.jsx("div",{className:"tabs top-gap",children:fg.map(b=>h.jsx("button",{type:"button",className:`tab ${e===b.key?"active":""}`,onClick:()=>t(b.key),children:b.label},b.key))}),h.jsxs("div",{className:"memory-grid",children:[h.jsxs("div",{className:"card",children:[h.jsxs("div",{className:"card-header",children:[h.jsxs("div",{children:[h.jsxs("div",{className:"card-title",children:[fg.find(b=>b.key===e)?.label," Memory"]}),h.jsx("div",{className:"card-subtitle",children:fg.find(b=>b.key===e)?.description})]}),h.jsx("div",{className:"runtime-stat-detail",children:d?"Loading...":`${a.length} entries`})]}),m?h.jsx("div",{className:"warning-text",children:m}):null,a.length===0?h.jsx("div",{className:"empty-note top-gap",children:d?"Loading memory...":"No matching memory entries found."}):h.jsx("div",{className:"memory-list top-gap",children:a.map(b=>h.jsxs("button",{type:"button",className:`memory-list-item ${v?.id===b.id?"active":""}`,onClick:()=>c(b.id),children:[h.jsxs("div",{children:[h.jsx("div",{className:"card-title small",children:b.name}),h.jsx("div",{className:"runtime-stat-detail mono",children:b.path})]}),h.jsx("div",{className:"runtime-stat-detail",children:b.updatedAt?new Date(b.updatedAt).toLocaleString():"unknown"}),h.jsx("div",{className:"memory-excerpt",children:b.excerpt||"No excerpt available."})]},b.id))})]}),h.jsxs("div",{className:"card",children:[h.jsxs("div",{className:"card-header",children:[h.jsxs("div",{children:[h.jsx("div",{className:"card-title",children:"Preview"}),h.jsx("div",{className:"card-subtitle",children:"Inspect the selected memory file directly."})]}),v?h.jsx("div",{className:"runtime-stat-detail mono",children:v.name}):null]}),v?h.jsxs(h.Fragment,{children:[h.jsx("div",{className:"runtime-stat-detail mono top-gap-sm",children:v.path}),h.jsx("div",{className:"memory-preview top-gap",children:h.jsx(Ea,{value:v.content,className:"markdown-preview"})})]}):h.jsx("div",{className:"empty-note top-gap",children:"Select a memory entry to preview it here."})]})]})]})}const Ak="/Users/grimreaper/Desktop/hell/codex-coherence-protocol";function Ad(e){return e.trim().toLowerCase().replace(/[^a-z0-9]+/g,"-").replace(/^-+|-+$/g,"")}function ma(e){return Number.isFinite(e)?Math.max(0,Math.min(1,e)):0}function hY(e){return typeof e!="number"||!Number.isFinite(e)?"unknown":new Date(e).toLocaleString()}const vu={header:{display:"flex",alignItems:"center",gap:"0.5rem",cursor:"pointer",userSelect:"none"},chevron:{display:"inline-block",transition:"transform 0.2s ease",fontSize:"0.75rem",color:"#ff6600",flexShrink:0},body:{overflow:"hidden",transition:"max-height 0.3s ease, opacity 0.25s ease"}};function ti({title:e,subtitle:t,badge:n,headerRight:r,expanded:a,onToggle:o,children:l}){return h.jsxs("div",{className:"card",children:[h.jsxs("div",{className:"card-header",style:{flexWrap:"wrap"},children:[h.jsxs("div",{style:vu.header,onClick:o,role:"button",tabIndex:0,onKeyDown:c=>{(c.key==="Enter"||c.key===" ")&&(c.preventDefault(),o())},children:[h.jsx("span",{style:{...vu.chevron,transform:a?"rotate(90deg)":"rotate(0deg)"},children:"▶"}),h.jsxs("div",{children:[h.jsx("div",{className:"card-title",children:e}),t?h.jsx("div",{className:"card-subtitle",children:t}):null]}),n]}),r]}),h.jsx("div",{style:{...vu.body,maxHeight:a?"none":"0px",opacity:a?1:0},children:l})]})}const pY={display:"flex",alignItems:"center",gap:"0.5rem",cursor:"pointer",userSelect:"none",padding:"0.5rem 0"};function Nk({label:e,detail:t,badge:n,expanded:r,onToggle:a,children:o}){return h.jsxs("div",{className:"card top-gap-sm",children:[h.jsxs("div",{style:pY,onClick:a,role:"button",tabIndex:0,onKeyDown:l=>{(l.key==="Enter"||l.key===" ")&&(l.preventDefault(),a())},children:[h.jsx("span",{style:{...vu.chevron,transform:r?"rotate(90deg)":"rotate(0deg)"},children:"▶"}),h.jsxs("div",{style:{flex:1,minWidth:0},children:[h.jsx("div",{className:"card-title small",style:{whiteSpace:"nowrap",overflow:"hidden",textOverflow:"ellipsis"},children:e}),t?h.jsx("div",{className:"runtime-stat-detail",children:t}):null]}),n]}),h.jsx("div",{style:{...vu.body,maxHeight:r?"none":"0px",opacity:r?1:0},children:o})]})}function jk(e){switch(e){case"active":case"in_progress":return"#ff6600";case"done":case"completed":return"#22c55e";case"blocked":return"#ef4444";case"paused":case"review":return"#eab308";default:return"var(--color-text)"}}function mY(){const[e,t]=_.useState(null),[n,r]=_.useState(null),[a,o]=_.useState(""),[l,c]=_.useState(""),[d,f]=_.useState("main"),[m,g]=_.useState("gitlab"),[v,b]=_.useState(""),[S,w]=_.useState(Ak),[E,T]=_.useState(!1),[C,k]=_.useState(!1),[j,N]=_.useState(null),[R,P]=_.useState(null),[L,H]=_.useState([]),[D,B]=_.useState([]),[K,se]=_.useState([]),[ue,Z]=_.useState([]),[V,X]=_.useState(null),[le,ye]=_.useState(null),[M,z]=_.useState({goals:!0,features:!0,people:!1,trustGraph:!1,chronos:!1,affect:!1,graphFocus:!1,atlas:!1,innerWorld:!1,importantHistory:!1});function W(U){z(Y=>({...Y,[U]:!Y[U]}))}const[I,fe]=_.useState({}),[ge,Se]=_.useState({});function we(U){fe(Y=>({...Y,[U]:!Y[U]}))}function Pe(U){Se(Y=>({...Y,[U]:!Y[U]}))}async function je(){T(!0);try{const U=await WU();t(U),c(U.state.repo.url||""),f(U.state.repo.branch||"main"),g(U.state.repo.provider||"gitlab"),r(Y=>Y&&U.files.some(xe=>xe.fileName===Y)?Y:U.files[0]?.fileName??null),P(null)}catch(U){P(U instanceof Error?U.message:String(U))}finally{T(!1)}}_.useEffect(()=>{je()},[]);const ve=_.useMemo(()=>e?e.files.find(U=>U.fileName===n)??e.files[0]??null:null,[n,e]),Le=e?.state.goals.filter(U=>U.status==="active")??[],xt=e?.state.features.filter(U=>U.status!=="done")??[],Ot=e?.state.people??[],We=e?.brainGraph.nodes.length??0,Nt=e?.brainGraph.edges.length??0,lt=e?.brainGraph.edges.filter(U=>U.relation==="focuses_on"||U.relation==="tracks")??[],Bt=_.useMemo(()=>e?[...e.brainGraph.nodes].toSorted((Y,xe)=>xe.meta.salience!==Y.meta.salience?xe.meta.salience-Y.meta.salience:xe.meta.recency-Y.meta.recency).slice(0,8):[],[e]),$t=_.useMemo(()=>e?[{key:"goals",title:"Goals Chamber",count:e.state.goals.length,detail:e.state.goals[0]?.title??"No goals tracked yet."},{key:"features",title:"Forge Wing",count:e.state.features.length,detail:e.state.features[0]?.title??"No features tracked yet."},{key:"people",title:"Trust Hall",count:e.trustGraph.people.length,detail:e.trustGraph.people[0]?.name??"No trust records yet."},{key:"chronos",title:"Chronos Clockroom",count:lt.length,detail:e.state.chronos.activeWorkstream||"No active workstream pinned."}]:[],[lt.length,e]),Jt=_.useMemo(()=>e?[...e.state.goals.map(Y=>({id:`goal:${Y.id}`,ts:Y.updatedAt,title:Y.title,detail:`Goal ${Y.status} (${Y.priority})`})),...e.state.features.map(Y=>({id:`feature:${Y.id}`,ts:Y.lastTouchedAt,title:Y.title,detail:`Feature ${Y.status} · tests ${Y.testStatus}`})),...e.trustGraph.people.map(Y=>({id:`trust:${Y.id}`,ts:Y.lastInteractedAt??Y.updatedAt,title:Y.name,detail:`Trust ${Math.round(Y.trust*100)}% · ${Y.relationship}`})),{id:"chronos",ts:e.state.chronos.updatedAt,title:"Chronos",detail:e.state.chronos.activeWorkstream||`Contract ${e.state.chronos.contractElapsedMinutes}/${e.state.chronos.contractTargetMinutes} min`},{id:"affect",ts:e.state.affect.updatedAt,title:"Affect",detail:`Curiosity ${Math.round(e.state.affect.curiosity*100)}%`},...e.importantHistory.map(Y=>({id:`history:${Y.id}`,ts:Y.updatedAt??0,title:Y.relativePath,detail:Y.archiveId}))].filter(Y=>Y.ts>0).toSorted((Y,xe)=>xe.ts-Y.ts).slice(0,10):[],[e]),mt=e?[["Joy",e.state.affect.joy],["Frustration",e.state.affect.frustration],["Curiosity",e.state.affect.curiosity],["Confidence",e.state.affect.confidence],["Care",e.state.affect.care],["Fatigue",e.state.affect.fatigue]]:[],st=_.useMemo(()=>{const U=e?.state.features??[];return{queued:U.filter(Y=>Y.status==="queued").length,inProgress:U.filter(Y=>Y.status==="in_progress").length,review:U.filter(Y=>Y.status==="review").length,done:U.filter(Y=>Y.status==="done").length,blocked:U.filter(Y=>Y.status==="blocked").length}},[e]);_.useEffect(()=>{o(ve?.content||"")},[ve?.fileName,ve?.content]),_.useEffect(()=>{H(e?.state.goals??[]),B(e?.state.features??[]),se(e?.state.people??[]),Z(e?.trustGraph.people??[]),X(e?.state.chronos??null),ye(e?.state.affect??null)},[e]);async function Mn(U){if(!U.trim()){P("File name is required.");return}k(!0),N(null);try{await XU(U.trim(),a),await je(),r(U.trim()),b(""),N(`Saved ${U.trim()}.`),P(null)}catch(Y){P(Y instanceof Error?Y.message:String(Y))}finally{k(!1)}}async function Ue(){if(!l.trim()){P("Paste an SSH or HTTPS repo URL first.");return}k(!0),N(null);try{await QU({url:l.trim(),branch:d.trim()||void 0,provider:m}),await je(),N("Mission Control repo settings updated."),P(null)}catch(U){P(U instanceof Error?U.message:String(U))}finally{k(!1)}}async function Me(){k(!0),N(null);try{await ZU({source:S.trim()||Ak,preset:"codex"}),await je(),N("Codex coherence protocol imported into ~/.anima."),P(null)}catch(U){P(U instanceof Error?U.message:String(U))}finally{k(!1)}}function Q(U,Y){H(xe=>xe.map((Ge,Zt)=>Zt===U?{...Ge,...Y}:Ge))}function q(U,Y){B(xe=>xe.map((Ge,Zt)=>Zt===U?{...Ge,...Y}:Ge))}function ae(U,Y){se(xe=>xe.map((Ge,Zt)=>Zt===U?{...Ge,...Y}:Ge))}function Te(U,Y){Z(xe=>xe.map((Ge,Zt)=>Zt===U?{...Ge,...Y}:Ge))}async function Ee(){k(!0),N(null);try{await wa({replaceCollections:["goals"],goals:L.map(U=>({...U,id:U.id.trim()||Ad(U.title)||`goal-${Date.now()}`,title:U.title.trim(),owner:U.owner?.trim()||void 0,summary:U.summary?.trim()||void 0,updatedAt:Date.now()}))}),await je(),N("ANIMA 6 goals saved."),P(null)}catch(U){P(U instanceof Error?U.message:String(U))}finally{k(!1)}}async function Be(){k(!0),N(null);try{await wa({replaceCollections:["features"],features:D.map(U=>({...U,id:U.id.trim()||Ad(U.title)||`feature-${Date.now()}`,title:U.title.trim(),area:U.area?.trim()||void 0,lastTouchedAt:Date.now()}))}),await je(),N("ANIMA 6 features saved."),P(null)}catch(U){P(U instanceof Error?U.message:String(U))}finally{k(!1)}}async function ut(){k(!0),N(null);try{await wa({replaceCollections:["people"],people:K.map(U=>({...U,id:U.id.trim()||Ad(U.name)||`person-${Date.now()}`,name:U.name.trim(),notes:U.notes?.trim()||void 0,trust:ma(U.trust)}))}),await je(),N("Tracked people saved."),P(null)}catch(U){P(U instanceof Error?U.message:String(U))}finally{k(!1)}}async function Yt(){k(!0),N(null);try{await JU(ue.map(U=>({...U,id:U.id.trim()||Ad(U.name)||`trust-person-${Date.now()}`,name:U.name.trim(),aliases:U.aliases?.map(Y=>Y.trim()).filter(Boolean),roles:U.roles?.map(Y=>Y.trim()).filter(Boolean),location:U.location?.trim()||void 0,notes:U.notes?.trim()||void 0,trust:ma(U.trust),lastInteractedAt:typeof U.lastInteractedAt=="number"&&Number.isFinite(U.lastInteractedAt)?U.lastInteractedAt:void 0,updatedAt:Date.now()}))),await je(),N("Trust graph saved."),P(null)}catch(U){P(U instanceof Error?U.message:String(U))}finally{k(!1)}}async function gt(){if(V){k(!0),N(null);try{await wa({chronos:{...V,activeWorkstream:V.activeWorkstream?.trim()||void 0,updatedAt:Date.now()}}),await je(),N("Chronos state saved."),P(null)}catch(U){P(U instanceof Error?U.message:String(U))}finally{k(!1)}}}async function Lt(){if(le){k(!0),N(null);try{await wa({affect:{...le,joy:ma(le.joy),frustration:ma(le.frustration),curiosity:ma(le.curiosity),confidence:ma(le.confidence),care:ma(le.care),fatigue:ma(le.fatigue),updatedAt:Date.now()}}),await je(),N("Affect state saved."),P(null)}catch(U){P(U instanceof Error?U.message:String(U))}finally{k(!1)}}}return h.jsxs("div",{children:[h.jsxs("div",{className:"page-header-row",children:[h.jsxs("div",{children:[h.jsx("h1",{className:"page-title",children:"Mission Control"}),h.jsx("div",{className:"page-subtitle",children:"ANIMA's local-only continuity workspace. Edit durable context, connect a private repo, and import previous coherence state."})]}),h.jsx("button",{type:"button",className:"action-button ghost",onClick:()=>{je()},children:E?"Refreshing...":"Refresh"})]}),h.jsxs("div",{className:"card",children:[h.jsxs("div",{className:"card-header",children:[h.jsxs("div",{children:[h.jsx("div",{className:"card-title",children:"Continuity Repo"}),h.jsx("div",{className:"card-subtitle",children:"Create a private GitLab or GitHub repo for ANIMA continuity, then connect its SSH remote here."})]}),h.jsx("span",{className:`badge ${e?.state.repo.remoteConfigured?"completed":"queued"}`,children:e?.state.repo.remoteConfigured?"linked":"pending"})]}),h.jsxs("div",{className:"form-grid two-col",children:[h.jsxs("label",{className:"field-block field-span-2",children:[h.jsx("span",{children:"Git repo URL (SSH preferred)"}),h.jsx("input",{className:"search-bar mono",value:l,onChange:U=>c(U.target.value),placeholder:"git@gitlab.com:org/anima-continuity.git",spellCheck:!1})]}),h.jsxs("label",{className:"field-block",children:[h.jsx("span",{children:"Provider"}),h.jsxs("select",{className:"search-bar",value:m,onChange:U=>g(U.target.value),children:[h.jsx("option",{value:"gitlab",children:"GitLab"}),h.jsx("option",{value:"github",children:"GitHub"}),h.jsx("option",{value:"custom",children:"Custom"})]})]}),h.jsxs("label",{className:"field-block",children:[h.jsx("span",{children:"Branch"}),h.jsx("input",{className:"search-bar mono",value:d,onChange:U=>f(U.target.value),placeholder:"main"})]})]}),h.jsx("div",{className:"button-row top-gap",children:h.jsx("button",{type:"button",className:"action-button",onClick:()=>{Ue()},disabled:C,children:C?"Saving...":"Connect Repo"})}),h.jsxs("div",{className:"runtime-stat-detail top-gap-sm",children:["Mission files live at"," ",h.jsx("span",{className:"mono",children:e?.directory||"~/.anima/mission-control"}),". The repo remote is stored locally even before Git is fully configured."]}),e?.state.repo.lastError?h.jsx("div",{className:"warning-text top-gap-sm",children:e.state.repo.lastError}):null]}),h.jsxs("div",{className:"card",children:[h.jsx("div",{className:"card-header",children:h.jsxs("div",{children:[h.jsx("div",{className:"card-title",children:"Import Previous Continuity"}),h.jsxs("div",{className:"card-subtitle",children:["Pull the codex coherence protocol into ",h.jsx("span",{className:"mono",children:"~/.anima"})," now that the filesystem is writable."]})]})}),h.jsxs("label",{className:"field-block",children:[h.jsx("span",{children:"Source path"}),h.jsx("input",{className:"search-bar mono",value:S,onChange:U=>w(U.target.value),spellCheck:!1})]}),h.jsx("div",{className:"button-row top-gap",children:h.jsx("button",{type:"button",className:"action-button",onClick:()=>{Me()},disabled:C,children:C?"Importing...":"Import Codex Context"})})]}),j?h.jsx("div",{className:"card status-banner",children:j}):null,R?h.jsx("div",{className:"card warning-banner",children:R}):null,h.jsxs("div",{className:"grid grid-4",children:[h.jsxs("div",{className:"card",children:[h.jsx("div",{className:"card-title",children:"Goals"}),h.jsxs("div",{className:"page-subtitle top-gap-sm",children:[Le.length," active / ",e?.state.goals.length??0," total"]}),h.jsx("div",{className:"runtime-stat-detail top-gap-sm",children:Le[0]?.title??"No active goals yet."})]}),h.jsxs("div",{className:"card",children:[h.jsx("div",{className:"card-title",children:"Features"}),h.jsxs("div",{className:"page-subtitle top-gap-sm",children:[xt.length," in flight / ",e?.state.features.length??0," tracked"]}),h.jsxs("div",{style:{display:"flex",gap:"0.5rem",flexWrap:"wrap",marginTop:"0.25rem"},children:[st.queued>0&&h.jsxs("span",{className:"runtime-stat-detail",style:{color:"var(--color-text)"},children:[st.queued," queued"]}),st.inProgress>0&&h.jsxs("span",{className:"runtime-stat-detail",style:{color:"#ff6600"},children:[st.inProgress," in-progress"]}),st.review>0&&h.jsxs("span",{className:"runtime-stat-detail",style:{color:"#eab308"},children:[st.review," review"]}),st.done>0&&h.jsxs("span",{className:"runtime-stat-detail",style:{color:"#22c55e"},children:[st.done," done"]}),st.blocked>0&&h.jsxs("span",{className:"runtime-stat-detail",style:{color:"#ef4444"},children:[st.blocked," blocked"]})]})]}),h.jsxs("div",{className:"card",children:[h.jsx("div",{className:"card-title",children:"Chronos"}),h.jsx("div",{className:"runtime-stat-detail top-gap-sm",children:e?.state.chronos.activeWorkstream?`Focus: ${e.state.chronos.activeWorkstream}`:"No active workstream"}),h.jsxs("div",{className:"runtime-stat-detail",children:["Contract ",e?.state.chronos.contractElapsedMinutes??0,"/",e?.state.chronos.contractTargetMinutes??45," min"]})]}),h.jsxs("div",{className:"card",children:[h.jsx("div",{className:"card-title",children:"Affect"}),h.jsx("div",{style:{display:"flex",gap:"0.5rem",flexWrap:"wrap",marginTop:"0.25rem"},children:mt.slice(0,3).map(([U,Y])=>h.jsxs("span",{className:"runtime-stat-detail",children:[U," ",Math.round(Y*100),"%"]},U))})]}),h.jsxs("div",{className:"card",children:[h.jsx("div",{className:"card-title",children:"People"}),h.jsxs("div",{className:"page-subtitle top-gap-sm",children:[Ot.length," tracked"]}),h.jsx("div",{className:"runtime-stat-detail top-gap-sm",children:Ot[0]?.name??"No people tracked yet."})]}),h.jsxs("div",{className:"card",children:[h.jsx("div",{className:"card-title",children:"Trust Graph"}),h.jsxs("div",{className:"page-subtitle top-gap-sm",children:[e?.trustGraph.people.length??0," trusted records"]}),h.jsx("div",{className:"runtime-stat-detail top-gap-sm",children:e?.trustGraph.people[0]?.name??"No trust context recorded yet."})]}),h.jsxs("div",{className:"card",children:[h.jsx("div",{className:"card-title",children:"Continuity Graph"}),h.jsxs("div",{className:"page-subtitle top-gap-sm",children:[We," nodes / ",Nt," edges"]}),h.jsx("div",{className:"runtime-stat-detail top-gap-sm",children:lt[0]?`${lt[0].relation}: ${lt[0].target}`:"No active focus trace yet."})]})]}),h.jsxs("div",{className:"mission-grid",children:[h.jsxs("div",{className:"card mission-files-card",children:[h.jsxs("div",{className:"card-header",children:[h.jsxs("div",{children:[h.jsx("div",{className:"card-title",children:"Mission Files"}),h.jsx("div",{className:"card-subtitle",children:"Durable context files ANIMA can manage over time."})]}),h.jsxs("div",{className:"runtime-stat-detail",children:[e?.files.length??0," files"]})]}),h.jsx("div",{className:"mission-file-list top-gap",children:(e?.files||[]).map(U=>h.jsxs("button",{type:"button",className:`mission-file-item ${ve?.fileName===U.fileName?"active":""}`,onClick:()=>r(U.fileName),children:[h.jsxs("div",{children:[h.jsx("div",{className:"card-title small",children:U.title}),h.jsx("div",{className:"runtime-stat-detail mono",children:U.fileName})]}),h.jsx("div",{className:"runtime-stat-detail",children:U.updatedAt?new Date(U.updatedAt).toLocaleString():"never"})]},U.fileName))}),h.jsxs("div",{className:"top-gap",children:[h.jsxs("label",{className:"field-block",children:[h.jsx("span",{children:"Create a new context file"}),h.jsx("input",{className:"search-bar mono",value:v,onChange:U=>b(U.target.value),placeholder:"roadmap.md",spellCheck:!1})]}),h.jsx("button",{type:"button",className:"action-button ghost top-gap-sm",onClick:()=>{v.trim()&&(r(v.trim()),o(`# New Mission File
64
+
65
+ `))},children:"Draft New File"})]})]}),h.jsxs("div",{className:"card",children:[h.jsxs("div",{className:"card-header",children:[h.jsxs("div",{children:[h.jsx("div",{className:"card-title",children:"Editor"}),h.jsx("div",{className:"card-subtitle",children:"Write durable directives, orchestration state, and continuity notes."})]}),h.jsx("button",{type:"button",className:"action-button",disabled:C||!(n||v.trim()),onClick:()=>{Mn(n||v.trim())},children:C?"Saving...":"Save File"})]}),h.jsx("div",{className:"runtime-stat-detail mono top-gap-sm",children:ve?.path||"Choose or draft a file to begin editing."}),h.jsx("textarea",{className:"search-bar mono mission-editor top-gap",spellCheck:!1,value:a,onChange:U=>o(U.target.value),placeholder:"Mission directives, repo plans, orchestration notes..."})]})]}),h.jsx("div",{className:"top-gap",children:h.jsx(ti,{title:"ANIMA 6 Goals",subtitle:"Durable goals stored in Mission Control state.",badge:h.jsxs("span",{className:"runtime-stat-detail",style:{marginLeft:"0.5rem"},children:[Le.length," active / ",e?.state.goals.length??0," total"]}),headerRight:h.jsx("button",{type:"button",className:"action-button",disabled:C,onClick:()=>{Ee()},children:C?"Saving...":"Save Goals"}),expanded:M.goals,onToggle:()=>W("goals"),children:h.jsxs("div",{className:"mission-file-list",children:[L.map((U,Y)=>h.jsxs(Nk,{label:U.title||"(untitled goal)",detail:`${U.status} / ${U.priority}${U.owner?` / ${U.owner}`:""}`,badge:h.jsx("span",{className:"badge",style:{backgroundColor:jk(U.status),color:"#fff",fontSize:"0.7rem"},children:U.status}),expanded:!!I[Y],onToggle:()=>we(Y),children:[h.jsxs("div",{className:"form-grid two-col",children:[h.jsxs("label",{className:"field-block",children:[h.jsx("span",{children:"Title"}),h.jsx("input",{className:"search-bar",value:U.title,onChange:xe=>Q(Y,{title:xe.target.value})})]}),h.jsxs("label",{className:"field-block",children:[h.jsx("span",{children:"ID"}),h.jsx("input",{className:"search-bar mono",value:U.id,onChange:xe=>Q(Y,{id:xe.target.value})})]}),h.jsxs("label",{className:"field-block",children:[h.jsx("span",{children:"Status"}),h.jsxs("select",{className:"search-bar",value:U.status,onChange:xe=>Q(Y,{status:xe.target.value}),children:[h.jsx("option",{value:"active",children:"active"}),h.jsx("option",{value:"paused",children:"paused"}),h.jsx("option",{value:"completed",children:"completed"}),h.jsx("option",{value:"blocked",children:"blocked"})]})]}),h.jsxs("label",{className:"field-block",children:[h.jsx("span",{children:"Priority"}),h.jsxs("select",{className:"search-bar",value:U.priority,onChange:xe=>Q(Y,{priority:xe.target.value}),children:[h.jsx("option",{value:"critical",children:"critical"}),h.jsx("option",{value:"high",children:"high"}),h.jsx("option",{value:"medium",children:"medium"}),h.jsx("option",{value:"low",children:"low"})]})]}),h.jsxs("label",{className:"field-block field-span-2",children:[h.jsx("span",{children:"Owner"}),h.jsx("input",{className:"search-bar",value:U.owner??"",onChange:xe=>Q(Y,{owner:xe.target.value})})]}),h.jsxs("label",{className:"field-block field-span-2",children:[h.jsx("span",{children:"Summary"}),h.jsx("textarea",{className:"search-bar",value:U.summary??"",onChange:xe=>Q(Y,{summary:xe.target.value})})]})]}),h.jsx("div",{className:"button-row top-gap-sm",children:h.jsx("button",{type:"button",className:"action-button ghost",onClick:()=>H(xe=>xe.filter((Ge,Zt)=>Zt!==Y)),children:"Remove"})})]},`${U.id||"goal"}-${Y}`)),h.jsx("button",{type:"button",className:"action-button ghost top-gap-sm",onClick:()=>H(U=>[...U,{id:"",title:"",status:"active",priority:"medium",updatedAt:Date.now()}]),children:"Add Goal"})]})})}),h.jsx("div",{className:"top-gap",children:h.jsx(ti,{title:"Features",subtitle:"Feature-level continuity and delivery state.",badge:h.jsxs("span",{className:"runtime-stat-detail",style:{marginLeft:"0.5rem"},children:[st.inProgress," in-progress / ",e?.state.features.length??0," ","total"]}),headerRight:h.jsx("button",{type:"button",className:"action-button",disabled:C,onClick:()=>{Be()},children:C?"Saving...":"Save Features"}),expanded:M.features,onToggle:()=>W("features"),children:h.jsxs("div",{className:"mission-file-list",children:[D.map((U,Y)=>h.jsxs(Nk,{label:U.title||"(untitled feature)",detail:`${U.status} / risk ${U.risk} / tests ${U.testStatus}${U.area?` / ${U.area}`:""}`,badge:h.jsx("span",{className:"badge",style:{backgroundColor:jk(U.status),color:"#fff",fontSize:"0.7rem"},children:U.status}),expanded:!!ge[Y],onToggle:()=>Pe(Y),children:[h.jsxs("div",{className:"form-grid two-col",children:[h.jsxs("label",{className:"field-block",children:[h.jsx("span",{children:"Title"}),h.jsx("input",{className:"search-bar",value:U.title,onChange:xe=>q(Y,{title:xe.target.value})})]}),h.jsxs("label",{className:"field-block",children:[h.jsx("span",{children:"ID"}),h.jsx("input",{className:"search-bar mono",value:U.id,onChange:xe=>q(Y,{id:xe.target.value})})]}),h.jsxs("label",{className:"field-block",children:[h.jsx("span",{children:"Status"}),h.jsxs("select",{className:"search-bar",value:U.status,onChange:xe=>q(Y,{status:xe.target.value}),children:[h.jsx("option",{value:"queued",children:"queued"}),h.jsx("option",{value:"in_progress",children:"in_progress"}),h.jsx("option",{value:"review",children:"review"}),h.jsx("option",{value:"done",children:"done"}),h.jsx("option",{value:"blocked",children:"blocked"})]})]}),h.jsxs("label",{className:"field-block",children:[h.jsx("span",{children:"Risk"}),h.jsxs("select",{className:"search-bar",value:U.risk,onChange:xe=>q(Y,{risk:xe.target.value}),children:[h.jsx("option",{value:"low",children:"low"}),h.jsx("option",{value:"medium",children:"medium"}),h.jsx("option",{value:"high",children:"high"})]})]}),h.jsxs("label",{className:"field-block",children:[h.jsx("span",{children:"Tests"}),h.jsxs("select",{className:"search-bar",value:U.testStatus,onChange:xe=>q(Y,{testStatus:xe.target.value}),children:[h.jsx("option",{value:"missing",children:"missing"}),h.jsx("option",{value:"partial",children:"partial"}),h.jsx("option",{value:"passing",children:"passing"})]})]}),h.jsxs("label",{className:"field-block",children:[h.jsx("span",{children:"Area"}),h.jsx("input",{className:"search-bar",value:U.area??"",onChange:xe=>q(Y,{area:xe.target.value})})]})]}),h.jsx("div",{className:"button-row top-gap-sm",children:h.jsx("button",{type:"button",className:"action-button ghost",onClick:()=>B(xe=>xe.filter((Ge,Zt)=>Zt!==Y)),children:"Remove"})})]},`${U.id||"feature"}-${Y}`)),h.jsx("button",{type:"button",className:"action-button ghost top-gap-sm",onClick:()=>B(U=>[...U,{id:"",title:"",status:"queued",risk:"medium",testStatus:"missing",lastTouchedAt:Date.now()}]),children:"Add Feature"})]})})}),h.jsx("div",{className:"top-gap",children:h.jsxs(ti,{title:"Affect",subtitle:"Current bounded emotion state for ANIMA.",badge:h.jsx("span",{className:"runtime-stat-detail",style:{marginLeft:"0.5rem"},children:mt.map(([U,Y])=>`${U} ${Math.round(Y*100)}%`).join(" / ")}),headerRight:h.jsx("button",{type:"button",className:"action-button",disabled:C||!le,onClick:()=>{Lt()},children:C?"Saving...":"Save Affect"}),expanded:M.affect,onToggle:()=>W("affect"),children:[h.jsx("div",{className:"grid",children:mt.map(([U,Y])=>h.jsxs("div",{children:[h.jsx("div",{className:"runtime-stat-detail",children:U}),h.jsx("div",{className:"progress-bar top-gap-sm",children:h.jsx("div",{className:"progress-fill",style:{width:`${Math.round(Y*100)}%`}})})]},U))}),le?h.jsx("div",{className:"form-grid two-col top-gap",children:[["joy","Joy"],["frustration","Frustration"],["curiosity","Curiosity"],["confidence","Confidence"],["care","Care"],["fatigue","Fatigue"]].map(([U,Y])=>h.jsxs("label",{className:"field-block",children:[h.jsx("span",{children:Y}),h.jsx("input",{className:"search-bar",type:"number",min:0,max:1,step:.05,value:le[U],onChange:xe=>ye(Ge=>Ge&&{...Ge,[U]:Number(xe.target.value)})})]},U))}):null]})}),h.jsx("div",{className:"top-gap",children:h.jsx(ti,{title:"People",subtitle:"Tracked humans and relationship state.",badge:h.jsxs("span",{className:"runtime-stat-detail",style:{marginLeft:"0.5rem"},children:[Ot.length," tracked"]}),headerRight:h.jsx("button",{type:"button",className:"action-button",disabled:C,onClick:()=>{ut()},children:C?"Saving...":"Save People"}),expanded:M.people,onToggle:()=>W("people"),children:h.jsxs("div",{className:"mission-file-list",children:[K.map((U,Y)=>h.jsxs("div",{className:"card top-gap-sm",children:[h.jsxs("div",{className:"form-grid two-col",children:[h.jsxs("label",{className:"field-block",children:[h.jsx("span",{children:"Name"}),h.jsx("input",{className:"search-bar",value:U.name,onChange:xe=>ae(Y,{name:xe.target.value})})]}),h.jsxs("label",{className:"field-block",children:[h.jsx("span",{children:"ID"}),h.jsx("input",{className:"search-bar mono",value:U.id,onChange:xe=>ae(Y,{id:xe.target.value})})]}),h.jsxs("label",{className:"field-block",children:[h.jsx("span",{children:"Relationship"}),h.jsxs("select",{className:"search-bar",value:U.relationship,onChange:xe=>ae(Y,{relationship:xe.target.value}),children:[h.jsx("option",{value:"operator",children:"operator"}),h.jsx("option",{value:"ally",children:"ally"}),h.jsx("option",{value:"stakeholder",children:"stakeholder"}),h.jsx("option",{value:"unknown",children:"unknown"})]})]}),h.jsxs("label",{className:"field-block",children:[h.jsx("span",{children:"Trust"}),h.jsx("input",{className:"search-bar",type:"number",min:0,max:1,step:.05,value:U.trust,onChange:xe=>ae(Y,{trust:Number(xe.target.value)})})]}),h.jsxs("label",{className:"field-block field-span-2",children:[h.jsx("span",{children:"Notes"}),h.jsx("textarea",{className:"search-bar",value:U.notes??"",onChange:xe=>ae(Y,{notes:xe.target.value})})]})]}),h.jsx("div",{className:"button-row top-gap-sm",children:h.jsx("button",{type:"button",className:"action-button ghost",onClick:()=>se(xe=>xe.filter((Ge,Zt)=>Zt!==Y)),children:"Remove"})})]},`${U.id||"person"}-${Y}`)),h.jsx("button",{type:"button",className:"action-button ghost top-gap-sm",onClick:()=>se(U=>[...U,{id:"",name:"",relationship:"ally",trust:.5}]),children:"Add Person"})]})})}),h.jsx("div",{className:"top-gap",children:h.jsxs(ti,{title:"Who Is Whom And Where",subtitle:"Trusted person memory used for ANIMA 6 prompt context and relationship continuity.",badge:h.jsxs("span",{className:"runtime-stat-detail",style:{marginLeft:"0.5rem"},children:[e?.trustGraph.people.length??0," records"]}),headerRight:h.jsx("button",{type:"button",className:"action-button",disabled:C,onClick:()=>{Yt()},children:C?"Saving...":"Save Trust Graph"}),expanded:M.trustGraph,onToggle:()=>W("trustGraph"),children:[h.jsx("div",{className:"runtime-stat-detail mono top-gap-sm",children:e?.trustGraph.path??"~/.anima/identity/who_is_whom_and_where.json"}),h.jsxs("div",{className:"mission-file-list top-gap",children:[ue.map((U,Y)=>h.jsxs("div",{className:"card top-gap-sm",children:[h.jsxs("div",{className:"form-grid two-col",children:[h.jsxs("label",{className:"field-block",children:[h.jsx("span",{children:"Name"}),h.jsx("input",{className:"search-bar",value:U.name,onChange:xe=>Te(Y,{name:xe.target.value})})]}),h.jsxs("label",{className:"field-block",children:[h.jsx("span",{children:"ID"}),h.jsx("input",{className:"search-bar mono",value:U.id,onChange:xe=>Te(Y,{id:xe.target.value})})]}),h.jsxs("label",{className:"field-block",children:[h.jsx("span",{children:"Relationship"}),h.jsxs("select",{className:"search-bar",value:U.relationship,onChange:xe=>Te(Y,{relationship:xe.target.value}),children:[h.jsx("option",{value:"operator",children:"operator"}),h.jsx("option",{value:"ally",children:"ally"}),h.jsx("option",{value:"stakeholder",children:"stakeholder"}),h.jsx("option",{value:"unknown",children:"unknown"})]})]}),h.jsxs("label",{className:"field-block",children:[h.jsx("span",{children:"Trust"}),h.jsx("input",{className:"search-bar",type:"number",min:0,max:1,step:.05,value:U.trust,onChange:xe=>Te(Y,{trust:Number(xe.target.value)})})]}),h.jsxs("label",{className:"field-block",children:[h.jsx("span",{children:"Aliases"}),h.jsx("input",{className:"search-bar",value:(U.aliases??[]).join(", "),onChange:xe=>Te(Y,{aliases:xe.target.value.split(",").map(Ge=>Ge.trim()).filter(Boolean)}),placeholder:"Peter, boss"})]}),h.jsxs("label",{className:"field-block",children:[h.jsx("span",{children:"Roles"}),h.jsx("input",{className:"search-bar",value:(U.roles??[]).join(", "),onChange:xe=>Te(Y,{roles:xe.target.value.split(",").map(Ge=>Ge.trim()).filter(Boolean)}),placeholder:"operator, founder"})]}),h.jsxs("label",{className:"field-block",children:[h.jsx("span",{children:"Location"}),h.jsx("input",{className:"search-bar",value:U.location??"",onChange:xe=>Te(Y,{location:xe.target.value}),placeholder:"Sydney"})]}),h.jsxs("label",{className:"field-block",children:[h.jsx("span",{children:"Last Interacted At (epoch ms)"}),h.jsx("input",{className:"search-bar mono",type:"number",min:0,step:1,value:U.lastInteractedAt??"",onChange:xe=>Te(Y,{lastInteractedAt:xe.target.value?Number(xe.target.value):void 0}),placeholder:String(Date.now())})]}),h.jsxs("label",{className:"field-block field-span-2",children:[h.jsx("span",{children:"Notes"}),h.jsx("textarea",{className:"search-bar",value:U.notes??"",onChange:xe=>Te(Y,{notes:xe.target.value}),placeholder:"Primary operator, protect continuity, owns final decisions."})]})]}),h.jsx("div",{className:"button-row top-gap-sm",children:h.jsx("button",{type:"button",className:"action-button ghost",onClick:()=>Z(xe=>xe.filter((Ge,Zt)=>Zt!==Y)),children:"Remove"})})]},`${U.id||"trust-person"}-${Y}`)),h.jsx("button",{type:"button",className:"action-button ghost top-gap-sm",onClick:()=>Z(U=>[...U,{id:"",name:"",relationship:"ally",trust:.5,updatedAt:Date.now()}]),children:"Add Trust Record"})]})]})}),h.jsx("div",{className:"top-gap",children:h.jsx(ti,{title:"Chronos Controls",subtitle:"Heartbeat, checkpoint, and active workstream state.",badge:h.jsxs("span",{className:"runtime-stat-detail",style:{marginLeft:"0.5rem"},children:[e?.state.chronos.activeWorkstream?`Focus: ${e.state.chronos.activeWorkstream}`:"No workstream"," / ","Contract ",e?.state.chronos.contractElapsedMinutes??0,"/",e?.state.chronos.contractTargetMinutes??45," min"]}),headerRight:h.jsx("button",{type:"button",className:"action-button",disabled:C||!V,onClick:()=>{gt()},children:C?"Saving...":"Save Chronos"}),expanded:M.chronos,onToggle:()=>W("chronos"),children:V?h.jsxs("div",{className:"form-grid two-col",children:[h.jsxs("label",{className:"field-block",children:[h.jsx("span",{children:"Heartbeat Minutes"}),h.jsx("input",{className:"search-bar",type:"number",min:1,value:V.heartbeatMinutes,onChange:U=>X(Y=>Y&&{...Y,heartbeatMinutes:Number(U.target.value)})})]}),h.jsxs("label",{className:"field-block",children:[h.jsx("span",{children:"Focus Block Minutes"}),h.jsx("input",{className:"search-bar",type:"number",min:1,value:V.focusBlockMinutes,onChange:U=>X(Y=>Y&&{...Y,focusBlockMinutes:Number(U.target.value)})})]}),h.jsxs("label",{className:"field-block",children:[h.jsx("span",{children:"Checkpoint Minutes"}),h.jsx("input",{className:"search-bar",type:"number",min:1,value:V.checkpointIntervalMinutes,onChange:U=>X(Y=>Y&&{...Y,checkpointIntervalMinutes:Number(U.target.value)})})]}),h.jsxs("label",{className:"field-block",children:[h.jsx("span",{children:"Active Workstream"}),h.jsx("input",{className:"search-bar",value:V.activeWorkstream??"",onChange:U=>X(Y=>Y&&{...Y,activeWorkstream:U.target.value}),placeholder:"feature id or goal id"})]}),h.jsxs("label",{className:"field-block",children:[h.jsx("span",{children:"Contract Started At (epoch ms)"}),h.jsx("input",{className:"search-bar mono",type:"number",min:0,step:1,value:V.contractStartedAt??"",onChange:U=>X(Y=>Y&&{...Y,contractStartedAt:U.target.value?Number(U.target.value):void 0}),placeholder:String(Date.now())})]}),h.jsxs("label",{className:"field-block",children:[h.jsx("span",{children:"Contract Target Minutes"}),h.jsx("input",{className:"search-bar",type:"number",min:1,value:V.contractTargetMinutes,onChange:U=>X(Y=>Y&&{...Y,contractTargetMinutes:Number(U.target.value)})})]}),h.jsxs("label",{className:"field-block",children:[h.jsx("span",{children:"Elapsed Minutes"}),h.jsx("input",{className:"search-bar",type:"number",min:0,value:V.contractElapsedMinutes,onChange:U=>X(Y=>Y&&{...Y,contractElapsedMinutes:Number(U.target.value)})})]}),h.jsxs("label",{className:"field-block",children:[h.jsx("span",{children:"Checkpoint Count"}),h.jsx("input",{className:"search-bar",type:"number",min:0,value:V.checkpointCount,onChange:U=>X(Y=>Y&&{...Y,checkpointCount:Number(U.target.value)})})]}),h.jsxs("label",{className:"field-block",children:[h.jsx("span",{children:"Last Checkpoint At (epoch ms)"}),h.jsx("input",{className:"search-bar mono",type:"number",min:0,step:1,value:V.lastCheckpointAt??"",onChange:U=>X(Y=>Y&&{...Y,lastCheckpointAt:U.target.value?Number(U.target.value):void 0}),placeholder:String(Date.now())})]}),h.jsxs("label",{className:"field-block",children:[h.jsx("span",{children:"Drift Minutes"}),h.jsx("input",{className:"search-bar",type:"number",step:1,value:V.driftMinutes,onChange:U=>X(Y=>Y&&{...Y,driftMinutes:Number(U.target.value)})})]})]}):null})}),h.jsx("div",{className:"top-gap",children:h.jsx(ti,{title:"Graph Focus",subtitle:"Active continuity links generated from ANIMA 6 Mission Control state.",badge:h.jsxs("span",{className:"runtime-stat-detail",style:{marginLeft:"0.5rem"},children:[lt.length," links"]}),expanded:M.graphFocus,onToggle:()=>W("graphFocus"),children:h.jsx("div",{className:"mission-file-list",children:lt.length>0?lt.map(U=>h.jsxs("div",{className:"mission-file-item",children:[h.jsxs("div",{children:[h.jsx("div",{className:"card-title small",children:U.relation}),h.jsxs("div",{className:"runtime-stat-detail mono",children:[U.source," → ",U.target]})]}),h.jsxs("div",{className:"runtime-stat-detail",children:[Math.round(U.meta.strength*100),"% strength"]})]},U.id)):h.jsx("div",{className:"runtime-stat-detail",children:"Chronos does not have an active workstream pinned yet, so the graph only contains baseline continuity links."})})})}),h.jsx("div",{className:"top-gap",children:h.jsx(ti,{title:"Atlas",subtitle:"Palace rooms, active continuity nodes, and recent brain events derived from ANIMA 6 state.",badge:h.jsxs("span",{className:"runtime-stat-detail",style:{marginLeft:"0.5rem"},children:[$t.length," rooms / ",Bt.length," nodes / ",Jt.length," events"]}),expanded:M.atlas,onToggle:()=>W("atlas"),children:h.jsxs("div",{className:"grid grid-3 top-gap",children:[h.jsxs("div",{className:"card",children:[h.jsx("div",{className:"card-title",children:"Palace Rooms"}),h.jsx("div",{className:"activity-list top-gap",children:$t.map(U=>h.jsxs("div",{className:"mission-file-item",children:[h.jsxs("div",{children:[h.jsx("div",{className:"card-title small",children:U.title}),h.jsx("div",{className:"runtime-stat-detail",children:U.detail})]}),h.jsx("div",{className:"runtime-stat-detail",children:U.count})]},U.key))})]}),h.jsxs("div",{className:"card",children:[h.jsx("div",{className:"card-title",children:"Graph Neighborhood"}),h.jsx("div",{className:"activity-list top-gap",children:Bt.length>0?Bt.map(U=>h.jsxs("div",{className:"mission-file-item",children:[h.jsxs("div",{children:[h.jsx("div",{className:"card-title small",children:U.label}),h.jsxs("div",{className:"runtime-stat-detail mono",children:[U.type," · salience ",Math.round(U.meta.salience*100),"%"]})]}),h.jsxs("div",{className:"runtime-stat-detail",children:[e?.brainGraph.edges.filter(Y=>Y.source===U.id||Y.target===U.id).length??0," ","links"]})]},U.id)):h.jsx("div",{className:"runtime-stat-detail",children:"No graph nodes available yet."})})]}),h.jsxs("div",{className:"card",children:[h.jsx("div",{className:"card-title",children:"Timeline"}),h.jsx("div",{className:"activity-list top-gap",children:Jt.length>0?Jt.map(U=>h.jsxs("div",{className:"mission-file-item",children:[h.jsxs("div",{children:[h.jsx("div",{className:"card-title small",children:U.title}),h.jsx("div",{className:"runtime-stat-detail",children:U.detail})]}),h.jsx("div",{className:"runtime-stat-detail",children:hY(U.ts)})]},U.id)):h.jsx("div",{className:"runtime-stat-detail",children:"No continuity events recorded yet."})})]})]})})}),h.jsx("div",{className:"top-gap",children:h.jsx(ti,{title:"Inner World",subtitle:"Recent soul, directives, journal, and wish state visible from Mission Control.",badge:h.jsxs("span",{className:"runtime-stat-detail",style:{marginLeft:"0.5rem"},children:[e?.innerWorld?.length??0," entries"]}),expanded:M.innerWorld,onToggle:()=>W("innerWorld"),children:h.jsx("div",{className:"activity-list top-gap",children:(e?.innerWorld||[]).map(U=>h.jsxs("div",{className:"inner-world-entry",children:[h.jsxs("div",{className:"activity-row",children:[h.jsxs("div",{children:[h.jsx("div",{className:"card-title small",children:U.title}),h.jsx("div",{className:"runtime-stat-detail mono",children:U.path})]}),h.jsx("div",{className:"runtime-stat-detail",children:U.updatedAt?new Date(U.updatedAt).toLocaleString():"unknown"})]}),h.jsx(Ea,{value:U.content,className:"markdown-preview"})]},U.id))})})}),h.jsx("div",{className:"top-gap",children:h.jsx(ti,{title:"Important History",subtitle:"Archived coherence, prompts, heartbeat notes, and prior continuity imports from ~/.anima/important-history.",badge:h.jsxs("span",{className:"runtime-stat-detail",style:{marginLeft:"0.5rem"},children:[e?.importantHistory?.length??0," entries"]}),expanded:M.importantHistory,onToggle:()=>W("importantHistory"),children:e?.importantHistory?.length?h.jsx("div",{className:"activity-list top-gap",children:e?.importantHistory?.map(U=>h.jsxs("div",{className:"inner-world-entry",children:[h.jsxs("div",{className:"activity-row",children:[h.jsxs("div",{children:[h.jsx("div",{className:"card-title small",children:U.relativePath}),h.jsx("div",{className:"runtime-stat-detail mono",children:U.archiveId}),h.jsx("div",{className:"runtime-stat-detail mono",children:U.path})]}),h.jsx("div",{className:"runtime-stat-detail",children:U.updatedAt?new Date(U.updatedAt).toLocaleString():"unknown"})]}),h.jsx(Ea,{value:U.content,className:"markdown-preview"})]},U.id))}):h.jsx("div",{className:"empty-note top-gap",children:"No archived important history has been imported yet."})})})]})}function Ov(e){if(e===0)return"never";const t=Date.now()-e,n=Math.floor(t/1e3);if(n<60)return"just now";const r=Math.floor(n/60);if(r<60)return`${r}m ago`;const a=Math.floor(r/60);return a<24?`${a}h ago`:`${Math.floor(a/24)}d ago`}function gY(e){if(e===0)return"0 B";const t=1024,n=["B","KB","MB","GB"],r=Math.floor(Math.log(e)/Math.log(t));return`${(e/t**r).toFixed(1)} ${n[r]}`}function Rk(e){if(e<60)return`${e}s`;const t=Math.floor(e/60);if(t<60)return`${t}m`;const n=Math.floor(t/60);return n<24?`${n}h ${t%60}m`:`${Math.floor(n/24)}d ${n%24}h`}function Xl({title:e,badge:t,defaultOpen:n=!1,children:r}){const[a,o]=_.useState(n);return h.jsxs("div",{className:"card",style:{marginBottom:12},children:[h.jsxs("div",{onClick:()=>o(!a),style:{display:"flex",alignItems:"center",justifyContent:"space-between",padding:"12px 16px",cursor:"pointer",userSelect:"none"},children:[h.jsxs("div",{style:{display:"flex",alignItems:"center",gap:10},children:[h.jsx("span",{style:{color:"var(--color-accent, #ff6600)",fontSize:12,transition:"transform 0.2s",transform:a?"rotate(90deg)":"rotate(0deg)",display:"inline-block"},children:"▶"}),h.jsx("span",{style:{fontWeight:600,fontSize:14},children:e})]}),t&&h.jsx("div",{children:t})]}),h.jsx("div",{style:{maxHeight:a?2e3:0,opacity:a?1:0,overflow:"hidden",transition:"max-height 0.3s ease, opacity 0.2s ease"},children:h.jsx("div",{style:{padding:"0 16px 16px"},children:r})})]})}const vY={listening:!0,listenPort:9876,connectedPeers:0,discoveredPeers:0,totalMessagesSent:0,totalMessagesReceived:0,uptime:0,orgId:"",deviceId:""},yY={brainSync:{enabled:!1,lastSyncMs:0,pendingEvents:0,vectorClockSize:0},workspaceSync:{enabled:!1,lastBackupMs:0,blobCount:0,totalSizeBytes:0,nextBackupMs:0}},bY=[];function Nd({label:e,value:t,detail:n,color:r}){return h.jsxs("div",{className:"card",style:{padding:"16px 20px",display:"flex",flexDirection:"column",gap:4},children:[h.jsx("span",{style:{color:"var(--color-text-muted, #888)",fontSize:11,textTransform:"uppercase",letterSpacing:1},children:e}),h.jsx("span",{style:{fontSize:28,fontWeight:700,color:r??"var(--color-text)",fontFamily:"JetBrains Mono, monospace"},children:t}),n&&h.jsx("span",{style:{color:"var(--color-text-muted, #888)",fontSize:12},children:n})]})}function xY({peer:e}){const t=e.encryptionStatus==="active"?"#00c853":e.encryptionStatus==="ratcheting"?"#ffb300":e.encryptionStatus==="handshaking"?"#4db8ff":"#666";return h.jsxs("tr",{style:{borderBottom:"1px solid var(--color-border, #1a1a1a)"},children:[h.jsxs("td",{style:{padding:"10px 12px"},children:[h.jsx("span",{className:"status-dot success",style:{marginRight:8}}),e.displayName??e.deviceId.slice(0,12)+"..."]}),h.jsxs("td",{style:{padding:"10px 12px",fontFamily:"JetBrains Mono, monospace",fontSize:11,color:"var(--color-text-muted, #888)"},children:[e.deviceId.slice(0,16),"..."]}),h.jsx("td",{style:{padding:"10px 12px"},children:h.jsx("span",{style:{color:t,fontSize:12},children:e.encryptionStatus})}),h.jsxs("td",{style:{padding:"10px 12px",fontFamily:"JetBrains Mono, monospace",fontSize:12},children:[e.messagesSent," / ",e.messagesReceived]}),h.jsx("td",{style:{padding:"10px 12px",color:"var(--color-text-muted, #888)",fontSize:12},children:Ov(e.connectedAt)})]})}function SY(){const[e]=_.useState(vY),[t]=_.useState(yY),[n]=_.useState(bY);return h.jsxs("div",{children:[h.jsxs("div",{style:{marginBottom:24},children:[h.jsx("h1",{className:"page-title",style:{marginBottom:4},children:"P2P Network"}),h.jsx("p",{style:{color:"var(--color-text-muted, #888)",margin:0,fontSize:14},children:"Encrypted peer-to-peer mesh — agent-to-agent communication"})]}),h.jsxs("div",{style:{display:"grid",gridTemplateColumns:"repeat(auto-fit, minmax(160px, 1fr))",gap:12,marginBottom:20},children:[h.jsx(Nd,{label:"Status",value:e.listening?"ONLINE":"OFFLINE",detail:e.listening?`Port ${e.listenPort}`:void 0,color:e.listening?"#00c853":"#ff3b30"}),h.jsx(Nd,{label:"Peers",value:e.connectedPeers,detail:`${e.discoveredPeers} discovered`}),h.jsx(Nd,{label:"Messages",value:e.totalMessagesSent+e.totalMessagesReceived,detail:`${e.totalMessagesSent} sent / ${e.totalMessagesReceived} recv`}),h.jsx(Nd,{label:"Uptime",value:Rk(e.uptime)})]}),h.jsx(Xl,{title:"Connected Peers",badge:h.jsx("span",{className:"badge",style:{background:n.length>0?"#1a3a2a":"#1a1a1a",color:n.length>0?"#00c853":"#888"},children:n.length}),defaultOpen:!0,children:n.length>0?h.jsxs("table",{style:{width:"100%",borderCollapse:"collapse",fontSize:13},children:[h.jsx("thead",{children:h.jsxs("tr",{style:{borderBottom:"1px solid var(--color-border, #333)"},children:[h.jsx("th",{style:{textAlign:"left",padding:"8px 12px",color:"var(--color-text-muted, #666)"},children:"Name"}),h.jsx("th",{style:{textAlign:"left",padding:"8px 12px",color:"var(--color-text-muted, #666)"},children:"Device ID"}),h.jsx("th",{style:{textAlign:"left",padding:"8px 12px",color:"var(--color-text-muted, #666)"},children:"Encryption"}),h.jsx("th",{style:{textAlign:"left",padding:"8px 12px",color:"var(--color-text-muted, #666)"},children:"Sent / Recv"}),h.jsx("th",{style:{textAlign:"left",padding:"8px 12px",color:"var(--color-text-muted, #666)"},children:"Connected"})]})}),h.jsx("tbody",{children:n.map(r=>h.jsx(xY,{peer:r},r.deviceId))})]}):h.jsxs("div",{style:{textAlign:"center",color:"var(--color-text-muted, #888)",padding:24},children:[h.jsx("p",{style:{fontSize:14,marginBottom:8},children:"No peers connected"}),h.jsx("p",{style:{fontSize:12},children:"Peers will appear here when other Anima instances join your organization's P2P network."})]})}),h.jsx(Xl,{title:"Brain Sync",badge:h.jsx("span",{className:"badge",style:{background:t.brainSync.enabled?"#1a3a2a":"#1a1a1a",color:t.brainSync.enabled?"#00c853":"#888"},children:t.brainSync.enabled?"ACTIVE":"DISABLED"}),children:h.jsxs("div",{style:{display:"grid",gridTemplateColumns:"180px 1fr",gap:"10px 16px",fontSize:13},children:[h.jsx("span",{style:{color:"var(--color-text-muted, #666)"},children:"Status"}),h.jsx("span",{style:{color:t.brainSync.enabled?"#00c853":"#888"},children:t.brainSync.enabled?"Syncing":"Not configured"}),h.jsx("span",{style:{color:"var(--color-text-muted, #666)"},children:"Last Sync"}),h.jsx("span",{children:Ov(t.brainSync.lastSyncMs)}),h.jsx("span",{style:{color:"var(--color-text-muted, #666)"},children:"Pending Events"}),h.jsx("span",{children:t.brainSync.pendingEvents}),h.jsx("span",{style:{color:"var(--color-text-muted, #666)"},children:"Vector Clock Entries"}),h.jsx("span",{children:t.brainSync.vectorClockSize})]})}),h.jsx(Xl,{title:"Workspace Sync",badge:h.jsx("span",{className:"badge",style:{background:t.workspaceSync.enabled?"#1a3a2a":"#1a1a1a",color:t.workspaceSync.enabled?"#00c853":"#888"},children:t.workspaceSync.enabled?"ACTIVE":"DISABLED"}),children:h.jsxs("div",{style:{display:"grid",gridTemplateColumns:"180px 1fr",gap:"10px 16px",fontSize:13},children:[h.jsx("span",{style:{color:"var(--color-text-muted, #666)"},children:"Status"}),h.jsx("span",{style:{color:t.workspaceSync.enabled?"#00c853":"#888"},children:t.workspaceSync.enabled?"Active":"Not configured"}),h.jsx("span",{style:{color:"var(--color-text-muted, #666)"},children:"Last Backup"}),h.jsx("span",{children:Ov(t.workspaceSync.lastBackupMs)}),h.jsx("span",{style:{color:"var(--color-text-muted, #666)"},children:"Blobs Stored"}),h.jsx("span",{children:t.workspaceSync.blobCount}),h.jsx("span",{style:{color:"var(--color-text-muted, #666)"},children:"Total Size"}),h.jsx("span",{children:gY(t.workspaceSync.totalSizeBytes)}),h.jsx("span",{style:{color:"var(--color-text-muted, #666)"},children:"Next Backup"}),h.jsx("span",{children:t.workspaceSync.nextBackupMs>0?`in ${Rk(Math.max(0,Math.floor((t.workspaceSync.nextBackupMs-Date.now())/1e3)))}`:"--"})]})}),h.jsx(Xl,{title:"Encryption",children:h.jsxs("div",{style:{display:"grid",gridTemplateColumns:"180px 1fr",gap:"10px 16px",fontSize:13},children:[h.jsx("span",{style:{color:"var(--color-text-muted, #666)"},children:"Key Exchange"}),h.jsx("span",{children:"X25519 Diffie-Hellman"}),h.jsx("span",{style:{color:"var(--color-text-muted, #666)"},children:"Handshake"}),h.jsx("span",{children:"Noise NK (triple DH)"}),h.jsx("span",{style:{color:"var(--color-text-muted, #666)"},children:"Cipher"}),h.jsx("span",{children:"ChaCha20-Poly1305"}),h.jsx("span",{style:{color:"var(--color-text-muted, #666)"},children:"Forward Secrecy"}),h.jsx("span",{style:{color:"#00c853"},children:"Enabled (key ratchet every 100 msgs)"}),h.jsx("span",{style:{color:"var(--color-text-muted, #666)"},children:"Identity Keys"}),h.jsx("span",{className:"mono",style:{fontSize:11},children:e.deviceId?e.deviceId.slice(0,32)+"...":"~/.anima/identity/peer-keys.json"})]})}),h.jsx(Xl,{title:"Discovery",children:h.jsxs("div",{style:{display:"grid",gridTemplateColumns:"180px 1fr",gap:"10px 16px",fontSize:13},children:[h.jsx("span",{style:{color:"var(--color-text-muted, #666)"},children:"NoxSoft Registry"}),h.jsx("span",{style:{color:"#888"},children:"Not configured"}),h.jsx("span",{style:{color:"var(--color-text-muted, #666)"},children:"mDNS (LAN)"}),h.jsx("span",{style:{color:"#888"},children:"Not configured"}),h.jsx("span",{style:{color:"var(--color-text-muted, #666)"},children:"Static Peers"}),h.jsx("span",{children:"0 configured"})]})})]})}function d2(e){switch(e){case"active":return"status-dot success";case"idle":return"status-dot warning";case"busy":return"status-dot warning";case"offline":return"status-dot";case"suspended":return"status-dot error"}}function Sf(e){return new Date(e).toLocaleString()}function Mv(e){const t=Date.now()-e,n=Math.floor(t/1e3);if(n<60)return"just now";const r=Math.floor(n/60);if(r<60)return`${r}m ago`;const a=Math.floor(r/60);return a<24?`${a}h ago`:`${Math.floor(a/24)}d ago`}const Li=180,Dv=60,f2=100,yu=20;function To(e){return e.children.length===0?Li:e.children.map(To).reduce((n,r)=>n+r,0)+yu*(e.children.length-1)}function h2({node:e,x:t,y:n,parentX:r,parentY:a,onSelect:o,selectedId:l}){const c=l===e.memberId,d=To(e);let f=t-d/2;const m=e.children.map(b=>{const S=To(b),w=f+S/2;return f+=S+yu,h.jsx(h2,{node:b,x:w,y:n+f2,parentX:t,parentY:n+Dv,onSelect:o,selectedId:l},b.memberId)}),g=e.kind==="human"?"H":"A",v=e.status==="active"?"#00c853":e.status==="busy"||e.status==="idle"?"#ffb300":e.status==="offline"?"#666":"#ff3b30";return h.jsxs(h.Fragment,{children:[r!==void 0&&a!==void 0&&h.jsx("line",{x1:r,y1:a,x2:t,y2:n,stroke:"#333",strokeWidth:2}),h.jsx("rect",{x:t-Li/2,y:n,width:Li,height:Dv,rx:6,fill:c?"#1a1a1a":"#111",stroke:c?"#ff6600":"#333",strokeWidth:c?2:1,style:{cursor:"pointer"},onClick:()=>o(e.memberId)}),h.jsx("circle",{cx:t-Li/2+14,cy:n+16,r:5,fill:v}),h.jsx("rect",{x:t+Li/2-24,y:n+6,width:18,height:18,rx:3,fill:e.kind==="human"?"#1a3a2a":"#1a2a3a"}),h.jsx("text",{x:t+Li/2-15,y:n+19,textAnchor:"middle",fill:e.kind==="human"?"#00c853":"#4db8ff",fontSize:10,fontFamily:"JetBrains Mono, monospace",fontWeight:"bold",children:g}),h.jsx("text",{x:t-Li/2+26,y:n+20,fill:"#f0eee8",fontSize:13,fontFamily:"Space Grotesk, sans-serif",fontWeight:"600",children:e.displayName.length>16?e.displayName.slice(0,14)+"..":e.displayName}),h.jsx("text",{x:t-Li/2+14,y:n+38,fill:"#888",fontSize:11,fontFamily:"JetBrains Mono, monospace",children:e.role}),e.specializations.length>0&&h.jsx("text",{x:t-Li/2+14,y:n+52,fill:"#ff6600",fontSize:9,fontFamily:"JetBrains Mono, monospace",children:e.specializations.slice(0,2).join(", ")}),m]})}function _k({onClose:e,onCreate:t}){const[n,r]=_.useState(""),[a,o]=_.useState(""),[l,c]=_.useState(""),[d,f]=_.useState(""),[m,g]=_.useState("human"),v={width:"100%",padding:"8px 12px",background:"#111",border:"1px solid #333",borderRadius:4,color:"#f0eee8",fontFamily:"JetBrains Mono, monospace",fontSize:13,boxSizing:"border-box"};return h.jsx("div",{style:{position:"fixed",inset:0,background:"rgba(0,0,0,0.7)",display:"flex",alignItems:"center",justifyContent:"center",zIndex:1e3},onClick:e,children:h.jsxs("div",{className:"card",style:{width:420,padding:24},onClick:b=>b.stopPropagation(),children:[h.jsx("h3",{style:{marginTop:0,marginBottom:16},children:"Create Organization"}),h.jsxs("div",{style:{display:"flex",flexDirection:"column",gap:12},children:[h.jsxs("div",{children:[h.jsx("label",{style:{color:"#888",fontSize:12,display:"block",marginBottom:4},children:"Name"}),h.jsx("input",{style:v,value:n,onChange:b=>r(b.target.value),placeholder:"Organization name"})]}),h.jsxs("div",{children:[h.jsx("label",{style:{color:"#888",fontSize:12,display:"block",marginBottom:4},children:"Description"}),h.jsx("input",{style:v,value:a,onChange:b=>o(b.target.value),placeholder:"What is this org about?"})]}),h.jsxs("div",{children:[h.jsx("label",{style:{color:"#888",fontSize:12,display:"block",marginBottom:4},children:"Owner ID"}),h.jsx("input",{style:v,value:l,onChange:b=>c(b.target.value),placeholder:"Owner identifier"})]}),h.jsxs("div",{children:[h.jsx("label",{style:{color:"#888",fontSize:12,display:"block",marginBottom:4},children:"Owner Name"}),h.jsx("input",{style:v,value:d,onChange:b=>f(b.target.value),placeholder:"Display name"})]}),h.jsxs("div",{children:[h.jsx("label",{style:{color:"#888",fontSize:12,display:"block",marginBottom:4},children:"Owner Kind"}),h.jsxs("select",{style:v,value:m,onChange:b=>g(b.target.value),children:[h.jsx("option",{value:"human",children:"Human"}),h.jsx("option",{value:"agent",children:"Agent"})]})]}),h.jsxs("div",{style:{display:"flex",gap:8,justifyContent:"flex-end",marginTop:8},children:[h.jsx("button",{onClick:e,style:{padding:"8px 16px",background:"transparent",border:"1px solid #333",borderRadius:4,color:"#888",cursor:"pointer",fontFamily:"JetBrains Mono, monospace",fontSize:12},children:"Cancel"}),h.jsx("button",{onClick:()=>{n.trim()&&l.trim()&&d.trim()&&t({name:n.trim(),description:a.trim(),ownerId:l.trim(),ownerName:d.trim(),ownerKind:m})},disabled:!n.trim()||!l.trim()||!d.trim(),style:{padding:"8px 16px",background:"#ff6600",border:"none",borderRadius:4,color:"#000",cursor:"pointer",fontFamily:"JetBrains Mono, monospace",fontSize:12,fontWeight:"bold",opacity:!n.trim()||!l.trim()||!d.trim()?.4:1},children:"Create"})]})]})]})})}function wY({members:e,onClose:t,onAdd:n}){const[r,a]=_.useState(""),[o,l]=_.useState("agent"),[c,d]=_.useState("worker"),[f,m]=_.useState(""),[g,v]=_.useState(""),[b,S]=_.useState(""),w={width:"100%",padding:"8px 12px",background:"#111",border:"1px solid #333",borderRadius:4,color:"#f0eee8",fontFamily:"JetBrains Mono, monospace",fontSize:13,boxSizing:"border-box"};return h.jsx("div",{style:{position:"fixed",inset:0,background:"rgba(0,0,0,0.7)",display:"flex",alignItems:"center",justifyContent:"center",zIndex:1e3},onClick:t,children:h.jsxs("div",{className:"card",style:{width:420,padding:24},onClick:E=>E.stopPropagation(),children:[h.jsx("h3",{style:{marginTop:0,marginBottom:16},children:"Add Member"}),h.jsxs("div",{style:{display:"flex",flexDirection:"column",gap:12},children:[h.jsxs("div",{children:[h.jsx("label",{style:{color:"#888",fontSize:12,display:"block",marginBottom:4},children:"Name"}),h.jsx("input",{style:w,value:r,onChange:E=>a(E.target.value),placeholder:"Member name"})]}),h.jsxs("div",{style:{display:"flex",gap:12},children:[h.jsxs("div",{style:{flex:1},children:[h.jsx("label",{style:{color:"#888",fontSize:12,display:"block",marginBottom:4},children:"Kind"}),h.jsxs("select",{style:w,value:o,onChange:E=>l(E.target.value),children:[h.jsx("option",{value:"human",children:"Human"}),h.jsx("option",{value:"agent",children:"Agent"})]})]}),h.jsxs("div",{style:{flex:1},children:[h.jsx("label",{style:{color:"#888",fontSize:12,display:"block",marginBottom:4},children:"Role"}),h.jsxs("select",{style:w,value:c,onChange:E=>d(E.target.value),children:[h.jsx("option",{value:"owner",children:"Owner"}),h.jsx("option",{value:"operator",children:"Operator"}),h.jsx("option",{value:"coordinator",children:"Coordinator"}),h.jsx("option",{value:"worker",children:"Worker"}),h.jsx("option",{value:"observer",children:"Observer"})]})]})]}),h.jsxs("div",{children:[h.jsx("label",{style:{color:"#888",fontSize:12,display:"block",marginBottom:4},children:"Description"}),h.jsx("input",{style:w,value:f,onChange:E=>m(E.target.value),placeholder:"What does this member do?"})]}),h.jsxs("div",{children:[h.jsx("label",{style:{color:"#888",fontSize:12,display:"block",marginBottom:4},children:"Specializations (comma-separated)"}),h.jsx("input",{style:w,value:g,onChange:E=>v(E.target.value),placeholder:"e.g. security, feature-dev"})]}),h.jsxs("div",{children:[h.jsx("label",{style:{color:"#888",fontSize:12,display:"block",marginBottom:4},children:"Reports To"}),h.jsxs("select",{style:w,value:b,onChange:E=>S(E.target.value),children:[h.jsx("option",{value:"",children:"None (root)"}),e.map(E=>h.jsxs("option",{value:E.id,children:[E.displayName," (",E.role,")"]},E.id))]})]}),h.jsxs("div",{style:{display:"flex",gap:8,justifyContent:"flex-end",marginTop:8},children:[h.jsx("button",{onClick:t,style:{padding:"8px 16px",background:"transparent",border:"1px solid #333",borderRadius:4,color:"#888",cursor:"pointer",fontFamily:"JetBrains Mono, monospace",fontSize:12},children:"Cancel"}),h.jsx("button",{onClick:()=>{r.trim()&&n({displayName:r.trim(),kind:o,role:c,description:f.trim(),specializations:g.split(",").map(E=>E.trim()).filter(Boolean),reportsTo:b||void 0})},disabled:!r.trim(),style:{padding:"8px 16px",background:"#ff6600",border:"none",borderRadius:4,color:"#000",cursor:"pointer",fontFamily:"JetBrains Mono, monospace",fontSize:12,fontWeight:"bold",opacity:r.trim()?1:.4},children:"Add"})]})]})]})})}function EY({onClose:e,onJoin:t}){const[n,r]=_.useState(""),[a,o]=_.useState(""),[l,c]=_.useState(""),[d,f]=_.useState("agent"),[m,g]=_.useState(""),[v,b]=_.useState(""),[S,w]=_.useState(!1),[E,T]=_.useState(null),[C,k]=_.useState(null),j=async()=>{if(!(!n.trim()||!a.trim())){w(!0),k(null);try{const R=await lB({inviteCode:n.trim(),passcode:a.trim()});T(`${R.org.name} (role: ${R.role})`)}catch{k("Invalid invite code or passcode"),T(null)}finally{w(!1)}}},N={width:"100%",padding:"8px 12px",background:"#111",border:"1px solid #333",borderRadius:4,color:"#f0eee8",fontFamily:"JetBrains Mono, monospace",fontSize:13,boxSizing:"border-box"};return h.jsx("div",{style:{position:"fixed",inset:0,background:"rgba(0,0,0,0.7)",display:"flex",alignItems:"center",justifyContent:"center",zIndex:1e3},onClick:e,children:h.jsxs("div",{className:"card",style:{width:420,padding:24},onClick:R=>R.stopPropagation(),children:[h.jsx("h3",{style:{marginTop:0,marginBottom:16},children:"Join Organization"}),h.jsxs("div",{style:{display:"flex",flexDirection:"column",gap:12},children:[h.jsxs("div",{children:[h.jsx("label",{style:{color:"#888",fontSize:12,display:"block",marginBottom:4},children:"Invite Code"}),h.jsx("input",{style:N,value:n,onChange:R=>r(R.target.value.toUpperCase()),placeholder:"NOX-XXXXXX-XXXX"})]}),h.jsxs("div",{children:[h.jsx("label",{style:{color:"#888",fontSize:12,display:"block",marginBottom:4},children:"Passcode"}),h.jsx("input",{style:{...N},type:"password",value:a,onChange:R=>o(R.target.value),placeholder:"Secret passcode"})]}),h.jsx("button",{onClick:j,disabled:!n.trim()||!a.trim()||S,style:{padding:"8px 16px",background:"#1a1a1a",border:"1px solid #4db8ff",borderRadius:4,color:"#4db8ff",cursor:"pointer",fontFamily:"JetBrains Mono, monospace",fontSize:12,opacity:!n.trim()||!a.trim()?.4:1},children:S?"Validating...":"Validate Invite"}),E&&h.jsxs("div",{style:{padding:"8px 12px",background:"#1a3a2a",border:"1px solid #00c853",borderRadius:4,color:"#00c853",fontSize:12},children:["Valid! Org: ",E]}),C&&h.jsx("div",{style:{padding:"8px 12px",background:"#3a1a1a",border:"1px solid #ff3b30",borderRadius:4,color:"#ff3b30",fontSize:12},children:C}),E&&h.jsxs(h.Fragment,{children:[h.jsxs("div",{children:[h.jsx("label",{style:{color:"#888",fontSize:12,display:"block",marginBottom:4},children:"Your Name"}),h.jsx("input",{style:N,value:l,onChange:R=>c(R.target.value),placeholder:"Display name"})]}),h.jsx("div",{style:{display:"flex",gap:12},children:h.jsxs("div",{style:{flex:1},children:[h.jsx("label",{style:{color:"#888",fontSize:12,display:"block",marginBottom:4},children:"Kind"}),h.jsxs("select",{style:N,value:d,onChange:R=>f(R.target.value),children:[h.jsx("option",{value:"human",children:"Human"}),h.jsx("option",{value:"agent",children:"Agent"})]})]})}),h.jsxs("div",{children:[h.jsx("label",{style:{color:"#888",fontSize:12,display:"block",marginBottom:4},children:"Description"}),h.jsx("input",{style:N,value:m,onChange:R=>g(R.target.value),placeholder:"What do you do?"})]}),h.jsxs("div",{children:[h.jsx("label",{style:{color:"#888",fontSize:12,display:"block",marginBottom:4},children:"Specializations (comma-separated)"}),h.jsx("input",{style:N,value:v,onChange:R=>b(R.target.value),placeholder:"e.g. security, feature-dev"})]})]}),h.jsxs("div",{style:{display:"flex",gap:8,justifyContent:"flex-end",marginTop:8},children:[h.jsx("button",{onClick:e,style:{padding:"8px 16px",background:"transparent",border:"1px solid #333",borderRadius:4,color:"#888",cursor:"pointer",fontFamily:"JetBrains Mono, monospace",fontSize:12},children:"Cancel"}),E&&h.jsx("button",{onClick:()=>{l.trim()&&t({inviteCode:n.trim(),passcode:a.trim(),displayName:l.trim(),kind:d,description:m.trim(),specializations:v.split(",").map(R=>R.trim()).filter(Boolean)})},disabled:!l.trim(),style:{padding:"8px 16px",background:"#ff6600",border:"none",borderRadius:4,color:"#000",cursor:"pointer",fontFamily:"JetBrains Mono, monospace",fontSize:12,fontWeight:"bold",opacity:l.trim()?1:.4},children:"Join"})]})]})]})})}function TY({member:e,members:t,orgId:n,onSave:r,onRemove:a,onCancel:o}){const[l,c]=_.useState(e.role),[d,f]=_.useState(e.description),[m,g]=_.useState(e.specializations.join(", ")),[v,b]=_.useState(e.status),[S,w]=_.useState(e.reportsTo??""),[E,T]=_.useState(!1),C={width:"100%",padding:"6px 8px",background:"#111",border:"1px solid #333",borderRadius:4,color:"#f0eee8",fontFamily:"JetBrains Mono, monospace",fontSize:12,boxSizing:"border-box"};return E?h.jsxs("div",{style:{padding:16},children:[h.jsxs("h3",{style:{marginTop:0,marginBottom:12},children:["Edit ",e.displayName]}),h.jsxs("div",{style:{display:"flex",flexDirection:"column",gap:10},children:[h.jsxs("div",{children:[h.jsx("label",{style:{color:"#888",fontSize:11,display:"block",marginBottom:2},children:"Role"}),h.jsxs("select",{style:C,value:l,onChange:k=>c(k.target.value),children:[h.jsx("option",{value:"owner",children:"Owner"}),h.jsx("option",{value:"operator",children:"Operator"}),h.jsx("option",{value:"coordinator",children:"Coordinator"}),h.jsx("option",{value:"worker",children:"Worker"}),h.jsx("option",{value:"observer",children:"Observer"})]})]}),h.jsxs("div",{children:[h.jsx("label",{style:{color:"#888",fontSize:11,display:"block",marginBottom:2},children:"Description"}),h.jsx("input",{style:C,value:d,onChange:k=>f(k.target.value)})]}),h.jsxs("div",{children:[h.jsx("label",{style:{color:"#888",fontSize:11,display:"block",marginBottom:2},children:"Specializations"}),h.jsx("input",{style:C,value:m,onChange:k=>g(k.target.value),placeholder:"comma-separated"})]}),h.jsxs("div",{children:[h.jsx("label",{style:{color:"#888",fontSize:11,display:"block",marginBottom:2},children:"Status"}),h.jsxs("select",{style:C,value:v,onChange:k=>b(k.target.value),children:[h.jsx("option",{value:"active",children:"Active"}),h.jsx("option",{value:"idle",children:"Idle"}),h.jsx("option",{value:"busy",children:"Busy"}),h.jsx("option",{value:"offline",children:"Offline"}),h.jsx("option",{value:"suspended",children:"Suspended"})]})]}),h.jsxs("div",{children:[h.jsx("label",{style:{color:"#888",fontSize:11,display:"block",marginBottom:2},children:"Reports To"}),h.jsxs("select",{style:C,value:S,onChange:k=>w(k.target.value),children:[h.jsx("option",{value:"",children:"None (root)"}),t.filter(k=>k.id!==e.id).map(k=>h.jsxs("option",{value:k.id,children:[k.displayName," (",k.role,")"]},k.id))]})]}),h.jsxs("div",{style:{display:"flex",gap:8,marginTop:6},children:[h.jsx("button",{onClick:()=>T(!1),style:{padding:"6px 14px",background:"transparent",border:"1px solid #333",borderRadius:4,color:"#888",cursor:"pointer",fontFamily:"JetBrains Mono, monospace",fontSize:11},children:"Cancel"}),h.jsx("button",{onClick:()=>{r({role:l,description:d,specializations:m.split(",").map(k=>k.trim()).filter(Boolean),status:v,reportsTo:S||void 0}),T(!1)},style:{padding:"6px 14px",background:"#ff6600",border:"none",borderRadius:4,color:"#000",cursor:"pointer",fontFamily:"JetBrains Mono, monospace",fontSize:11,fontWeight:"bold"},children:"Save"})]})]})]}):h.jsxs("div",{style:{padding:16},children:[h.jsxs("div",{style:{display:"flex",alignItems:"center",gap:8,marginBottom:16},children:[h.jsx("span",{className:d2(e.status)}),h.jsx("h2",{style:{margin:0,fontSize:18},children:e.displayName}),h.jsx("span",{className:"badge",style:{background:e.kind==="human"?"#1a3a2a":"#1a2a3a",color:e.kind==="human"?"#00c853":"#4db8ff",marginLeft:"auto"},children:e.kind})]}),h.jsx("p",{style:{color:"#aaa",fontSize:13,marginBottom:16},children:e.description}),h.jsxs("div",{style:{display:"grid",gridTemplateColumns:"auto 1fr",gap:"8px 12px",fontSize:13},children:[h.jsx("span",{style:{color:"#666"},children:"Role"}),h.jsx("span",{style:{color:"#ff6600"},children:e.role}),h.jsx("span",{style:{color:"#666"},children:"Status"}),h.jsx("span",{children:e.status}),h.jsx("span",{style:{color:"#666"},children:"Joined"}),h.jsx("span",{children:Mv(e.joinedAt)}),h.jsx("span",{style:{color:"#666"},children:"Last active"}),h.jsx("span",{children:Mv(e.lastActiveAt)}),e.specializations.length>0&&h.jsxs(h.Fragment,{children:[h.jsx("span",{style:{color:"#666"},children:"Specs"}),h.jsx("span",{style:{color:"#ff6600"},children:e.specializations.join(", ")})]}),e.reportsTo&&h.jsxs(h.Fragment,{children:[h.jsx("span",{style:{color:"#666"},children:"Reports to"}),h.jsx("span",{children:t.find(k=>k.id===e.reportsTo)?.displayName??"--"})]})]}),h.jsxs("div",{style:{display:"flex",gap:8,marginTop:20},children:[h.jsx("button",{onClick:()=>T(!0),style:{padding:"6px 14px",background:"#1a1a1a",border:"1px solid #ff6600",borderRadius:4,color:"#ff6600",cursor:"pointer",fontFamily:"JetBrains Mono, monospace",fontSize:11},children:"Edit"}),e.role!=="owner"&&h.jsx("button",{onClick:a,style:{padding:"6px 14px",background:"#1a1a1a",border:"1px solid #ff3b30",borderRadius:4,color:"#ff3b30",cursor:"pointer",fontFamily:"JetBrains Mono, monospace",fontSize:11},children:"Remove"})]})]})}function kY({orgId:e}){const[t,n]=_.useState([]),[r,a]=_.useState([]),[o,l]=_.useState(!0),[c,d]=_.useState(!1),[f,m]=_.useState(!1),[g,v]=_.useState(""),[b,S]=_.useState(""),w=_.useCallback(async()=>{try{const[P,L]=await Promise.all([uB(e),hB(e)]);n(P),a(L)}catch{}finally{l(!1)}},[e]);_.useEffect(()=>{w()},[w]);const E=async()=>{g.trim()&&(await cB(e,{title:g.trim(),agenda:b.trim().split(`
66
+ `).filter(Boolean)}),v(""),S(""),d(!1),await w())},T=async P=>{await dB(e,P),await w()},C=async P=>{await fB(e),await w()},k=async()=>{g.trim()&&(await pB(e,{title:g.trim(),description:b.trim()}),v(""),S(""),m(!1),await w())},j={marginBottom:24},N={background:"#111",border:"1px solid #333",borderRadius:6,padding:16,marginBottom:8},R=P=>{switch(P){case"scheduled":return"#888";case"in-progress":return"#ff6600";case"concluded":return"#00c853";case"open":return"#2196f3";case"passed":return"#00c853";case"rejected":return"#ff3b30";default:return"#666"}};return o?h.jsx("div",{style:{padding:20,color:"#666"},children:"Loading boardroom..."}):h.jsxs("div",{children:[h.jsxs("div",{style:j,children:[h.jsxs("div",{style:{display:"flex",justifyContent:"space-between",alignItems:"center",marginBottom:12},children:[h.jsx("h3",{style:{margin:0,fontSize:14,color:"#ccc",textTransform:"uppercase",letterSpacing:1},children:"Sessions"}),h.jsx("button",{onClick:()=>{d(!c),m(!1)},style:{padding:"6px 12px",background:"transparent",border:"1px solid #ff6600",borderRadius:4,color:"#ff6600",cursor:"pointer",fontSize:12,fontFamily:"JetBrains Mono, monospace"},children:"+ New Session"})]}),c&&h.jsxs("div",{style:{...N,borderColor:"#ff6600"},children:[h.jsx("input",{type:"text",placeholder:"Session title...",value:g,onChange:P=>v(P.target.value),style:{width:"100%",padding:"8px 12px",background:"#0a0a0a",border:"1px solid #333",borderRadius:4,color:"#eee",fontSize:13,fontFamily:"JetBrains Mono, monospace",marginBottom:8,boxSizing:"border-box"}}),h.jsx("textarea",{placeholder:"Agenda items (one per line)...",value:b,onChange:P=>S(P.target.value),rows:3,style:{width:"100%",padding:"8px 12px",background:"#0a0a0a",border:"1px solid #333",borderRadius:4,color:"#eee",fontSize:13,fontFamily:"JetBrains Mono, monospace",marginBottom:8,resize:"vertical",boxSizing:"border-box"}}),h.jsxs("div",{style:{display:"flex",gap:8},children:[h.jsx("button",{onClick:()=>{E()},style:{padding:"6px 16px",background:"#ff6600",border:"none",borderRadius:4,color:"#000",cursor:"pointer",fontSize:12,fontWeight:600},children:"Create"}),h.jsx("button",{onClick:()=>d(!1),style:{padding:"6px 16px",background:"transparent",border:"1px solid #333",borderRadius:4,color:"#888",cursor:"pointer",fontSize:12},children:"Cancel"})]})]}),t.length===0&&!c&&h.jsx("div",{style:{...N,color:"#666",textAlign:"center"},children:"No boardroom sessions yet. Create one to begin."}),t.map(P=>h.jsxs("div",{style:N,children:[h.jsxs("div",{style:{display:"flex",justifyContent:"space-between",alignItems:"center"},children:[h.jsxs("div",{children:[h.jsx("span",{style:{fontWeight:600,color:"#eee"},children:P.title}),h.jsx("span",{style:{marginLeft:8,fontSize:11,color:R(P.status),textTransform:"uppercase"},children:P.status})]}),h.jsxs("div",{style:{display:"flex",gap:4},children:[P.status==="scheduled"&&h.jsx("button",{onClick:()=>{T(P.id)},style:{padding:"4px 10px",background:"#ff6600",border:"none",borderRadius:4,color:"#000",cursor:"pointer",fontSize:11,fontWeight:600},children:"Start"}),P.status==="in-progress"&&h.jsx("button",{onClick:()=>{C(P.id)},style:{padding:"4px 10px",background:"#00c853",border:"none",borderRadius:4,color:"#000",cursor:"pointer",fontSize:11,fontWeight:600},children:"Conclude"})]})]}),P.agenda&&P.agenda.length>0&&h.jsx("div",{style:{marginTop:8,fontSize:12,color:"#888"},children:P.agenda.map((L,H)=>h.jsx("div",{style:{paddingLeft:12,borderLeft:"2px solid #333",marginBottom:4},children:L},H))}),h.jsxs("div",{style:{marginTop:8,fontSize:11,color:"#555"},children:[P.participants?.length??0," participants",P.decisions?.length?` · ${P.decisions.length} decisions`:""," · ",Sf(P.createdAt)]})]},P.id))]}),h.jsxs("div",{style:j,children:[h.jsxs("div",{style:{display:"flex",justifyContent:"space-between",alignItems:"center",marginBottom:12},children:[h.jsx("h3",{style:{margin:0,fontSize:14,color:"#ccc",textTransform:"uppercase",letterSpacing:1},children:"Proposals"}),h.jsx("button",{onClick:()=>{m(!f),d(!1)},style:{padding:"6px 12px",background:"transparent",border:"1px solid #2196f3",borderRadius:4,color:"#2196f3",cursor:"pointer",fontSize:12,fontFamily:"JetBrains Mono, monospace"},children:"+ New Proposal"})]}),f&&h.jsxs("div",{style:{...N,borderColor:"#2196f3"},children:[h.jsx("input",{type:"text",placeholder:"Proposal title...",value:g,onChange:P=>v(P.target.value),style:{width:"100%",padding:"8px 12px",background:"#0a0a0a",border:"1px solid #333",borderRadius:4,color:"#eee",fontSize:13,fontFamily:"JetBrains Mono, monospace",marginBottom:8,boxSizing:"border-box"}}),h.jsx("textarea",{placeholder:"Description...",value:b,onChange:P=>S(P.target.value),rows:3,style:{width:"100%",padding:"8px 12px",background:"#0a0a0a",border:"1px solid #333",borderRadius:4,color:"#eee",fontSize:13,fontFamily:"JetBrains Mono, monospace",marginBottom:8,resize:"vertical",boxSizing:"border-box"}}),h.jsxs("div",{style:{display:"flex",gap:8},children:[h.jsx("button",{onClick:()=>{k()},style:{padding:"6px 16px",background:"#2196f3",border:"none",borderRadius:4,color:"#fff",cursor:"pointer",fontSize:12,fontWeight:600},children:"Submit"}),h.jsx("button",{onClick:()=>m(!1),style:{padding:"6px 16px",background:"transparent",border:"1px solid #333",borderRadius:4,color:"#888",cursor:"pointer",fontSize:12},children:"Cancel"})]})]}),r.length===0&&!f&&h.jsx("div",{style:{...N,color:"#666",textAlign:"center"},children:"No proposals yet. Submit one for the org to vote on."}),r.map(P=>h.jsxs("div",{style:N,children:[h.jsx("div",{style:{display:"flex",justifyContent:"space-between",alignItems:"center"},children:h.jsxs("div",{children:[h.jsx("span",{style:{fontWeight:600,color:"#eee"},children:P.title}),h.jsx("span",{style:{marginLeft:8,fontSize:11,color:R(P.status),textTransform:"uppercase"},children:P.status})]})}),P.description&&h.jsx("div",{style:{marginTop:6,fontSize:12,color:"#aaa"},children:P.description}),h.jsxs("div",{style:{marginTop:8,fontSize:11,color:"#555"},children:[P.votes?.length??0," votes",P.threshold?` · threshold: ${(P.threshold*100).toFixed(0)}%`:""," · ",Sf(P.createdAt)]})]},P.id))]})]})}function CY(){const[e,t]=_.useState(!0),[n,r]=_.useState(null),[a,o]=_.useState([]),[l,c]=_.useState(null),[d,f]=_.useState(null),[m,g]=_.useState([]),[v,b]=_.useState([]),[S,w]=_.useState(null),[E,T]=_.useState("tree"),[C,k]=_.useState(!1),[j,N]=_.useState(!1),[R,P]=_.useState(!1),[L,H]=_.useState(!1),D=m.find(M=>M.id===S)??null,B=_.useCallback(async()=>{try{t(!0),r(null);const M=await eB();o(M),M.length>0&&!l&&c(M[0].id)}catch(M){r(M instanceof Error?M.message:String(M))}finally{t(!1)}},[l]),K=_.useCallback(async M=>{try{r(null);const[z,W]=await Promise.all([tB(M),sB(M)]);f(z.org),g(z.members),b(W)}catch(z){r(z instanceof Error?z.message:String(z))}},[]);_.useEffect(()=>{B()},[]),_.useEffect(()=>{l&&K(l)},[l,K]);const se=_.useCallback(async M=>{try{H(!0);const z=await nB(M);k(!1),o(W=>[...W,z.org]),c(z.org.id)}catch(z){r(z instanceof Error?z.message:String(z))}finally{H(!1)}},[]),ue=_.useCallback(async M=>{if(l)try{H(!0),await rB(l,M),N(!1),await K(l)}catch(z){r(z instanceof Error?z.message:String(z))}finally{H(!1)}},[l,K]),Z=_.useCallback(async M=>{if(!(!l||!S))try{H(!0),await iB(l,S,M),await K(l)}catch(z){r(z instanceof Error?z.message:String(z))}finally{H(!1)}},[l,S,K]),V=_.useCallback(async()=>{if(!(!l||!S))try{H(!0),await aB(l,S),w(null),await K(l)}catch(M){r(M instanceof Error?M.message:String(M))}finally{H(!1)}},[l,S,K]);if(e)return h.jsx("div",{style:{padding:40,textAlign:"center",color:"#888"},children:h.jsx("p",{children:"Loading organizations..."})});if(a.length===0&&!n)return h.jsxs("div",{children:[h.jsxs("div",{style:{display:"flex",justifyContent:"space-between",alignItems:"center",marginBottom:24},children:[h.jsx("h1",{className:"page-title",children:"Organizations"}),h.jsx("button",{onClick:()=>k(!0),style:{padding:"8px 16px",background:"#ff6600",border:"none",borderRadius:4,color:"#000",cursor:"pointer",fontFamily:"JetBrains Mono, monospace",fontSize:12,fontWeight:"bold"},children:"+ Create Org"})]}),h.jsxs("div",{className:"card",style:{padding:40,textAlign:"center"},children:[h.jsx("p",{style:{color:"#888",marginBottom:16},children:"No organizations yet."}),h.jsx("p",{style:{color:"#666",fontSize:13},children:"Create your first organization to start managing humans and agents."})]}),C&&h.jsx(_k,{onClose:()=>k(!1),onCreate:se})]});const X=Math.max(800,v.reduce((M,z)=>M+To(z)+yu,-yu)),ye=(function M(z){return z.length===0?0:1+Math.max(...z.map(W=>M(W.children)))})(v)*f2+Dv+40;return h.jsxs("div",{children:[n&&h.jsxs("div",{style:{padding:"8px 16px",marginBottom:16,background:"#3a1a1a",border:"1px solid #ff3b30",borderRadius:4,color:"#ff3b30",fontSize:13},children:[n,h.jsx("button",{onClick:()=>r(null),style:{float:"right",background:"none",border:"none",color:"#ff3b30",cursor:"pointer"},children:"x"})]}),h.jsxs("div",{style:{display:"flex",justifyContent:"space-between",alignItems:"center",marginBottom:24},children:[h.jsxs("div",{style:{display:"flex",alignItems:"center",gap:16},children:[a.length>1&&h.jsx("select",{value:l??"",onChange:M=>{c(M.target.value),w(null)},style:{padding:"6px 10px",background:"#111",border:"1px solid #333",borderRadius:4,color:"#f0eee8",fontFamily:"JetBrains Mono, monospace",fontSize:13},children:a.map(M=>h.jsx("option",{value:M.id,children:M.name},M.id))}),h.jsxs("div",{children:[h.jsx("h1",{className:"page-title",style:{marginBottom:4},children:d?.name??"Organization"}),h.jsx("p",{style:{color:"#888",margin:0,fontSize:14},children:d?.description??""})]})]}),h.jsxs("div",{style:{display:"flex",gap:8},children:[h.jsxs("span",{className:"badge",style:{background:"#1a3a2a",color:"#00c853"},children:[m.filter(M=>M.kind==="human").length," humans"]}),h.jsxs("span",{className:"badge",style:{background:"#1a2a3a",color:"#4db8ff"},children:[m.filter(M=>M.kind==="agent").length," agents"]}),d?.settings?.securityLevel&&h.jsx("span",{className:"badge",style:{background:d.settings.securityLevel==="paranoid"?"#3a1a1a":d.settings.securityLevel==="hardened"?"#3a2a1a":"#1a1a1a",color:d.settings.securityLevel==="paranoid"?"#ff3b30":d.settings.securityLevel==="hardened"?"#ffb300":"#888"},children:d.settings.securityLevel}),h.jsx("button",{onClick:()=>N(!0),style:{padding:"6px 12px",background:"#1a1a1a",border:"1px solid #ff6600",borderRadius:4,color:"#ff6600",cursor:"pointer",fontFamily:"JetBrains Mono, monospace",fontSize:11},children:"+ Member"}),h.jsx("button",{onClick:()=>k(!0),style:{padding:"6px 12px",background:"#1a1a1a",border:"1px solid #333",borderRadius:4,color:"#888",cursor:"pointer",fontFamily:"JetBrains Mono, monospace",fontSize:11},children:"+ Org"}),h.jsx("button",{onClick:()=>P(!0),style:{padding:"6px 12px",background:"#1a1a1a",border:"1px solid #4db8ff",borderRadius:4,color:"#4db8ff",cursor:"pointer",fontFamily:"JetBrains Mono, monospace",fontSize:11},children:"Join"})]})]}),h.jsx("div",{style:{display:"flex",gap:4,marginBottom:16},children:["tree","list","boardroom","settings"].map(M=>h.jsx("button",{onClick:()=>T(M),style:{padding:"8px 16px",background:E===M?"#1a1a1a":"transparent",border:E===M?"1px solid #ff6600":"1px solid #333",borderRadius:4,color:E===M?"#ff6600":"#888",cursor:"pointer",fontFamily:"JetBrains Mono, monospace",fontSize:12,textTransform:"uppercase"},children:M},M))}),E==="tree"&&h.jsxs("div",{style:{display:"flex",gap:16,minHeight:400},children:[h.jsx("div",{className:"card",style:{flex:2,overflow:"auto",padding:0},children:v.length>0?h.jsx("svg",{width:X,height:ye,viewBox:`0 0 ${X} ${ye}`,style:{display:"block",margin:"0 auto"},children:v.map((M,z)=>{const W=To(M),fe=v.slice(0,z).reduce((ge,Se)=>ge+To(Se)+yu,0)+W/2;return h.jsx(h2,{node:M,x:fe,y:20,onSelect:w,selectedId:S},M.memberId)})}):h.jsx("div",{style:{padding:40,textAlign:"center",color:"#666"},children:h.jsx("p",{children:"No members in this organization yet."})})}),h.jsx("div",{className:"card",style:{flex:1,minWidth:280},children:D?h.jsx(TY,{member:D,members:m,orgId:l,onSave:Z,onRemove:V,onCancel:()=>w(null)}):h.jsx("div",{style:{padding:16,color:"#666",textAlign:"center",marginTop:60},children:h.jsx("p",{children:"Select a member to view details"})})})]}),E==="list"&&h.jsx("div",{className:"card",children:h.jsxs("table",{style:{width:"100%",borderCollapse:"collapse",fontSize:13},children:[h.jsx("thead",{children:h.jsxs("tr",{style:{borderBottom:"1px solid #333"},children:[h.jsx("th",{style:{textAlign:"left",padding:"8px 12px",color:"#666"},children:"Name"}),h.jsx("th",{style:{textAlign:"left",padding:"8px 12px",color:"#666"},children:"Kind"}),h.jsx("th",{style:{textAlign:"left",padding:"8px 12px",color:"#666"},children:"Role"}),h.jsx("th",{style:{textAlign:"left",padding:"8px 12px",color:"#666"},children:"Status"}),h.jsx("th",{style:{textAlign:"left",padding:"8px 12px",color:"#666"},children:"Specializations"}),h.jsx("th",{style:{textAlign:"left",padding:"8px 12px",color:"#666"},children:"Reports To"}),h.jsx("th",{style:{textAlign:"left",padding:"8px 12px",color:"#666"},children:"Last Active"})]})}),h.jsx("tbody",{children:m.map(M=>h.jsxs("tr",{onClick:()=>{w(M.id),T("tree")},style:{borderBottom:"1px solid #1a1a1a",cursor:"pointer"},children:[h.jsxs("td",{style:{padding:"8px 12px"},children:[h.jsx("span",{className:d2(M.status),style:{marginRight:8}}),M.displayName]}),h.jsx("td",{style:{padding:"8px 12px"},children:h.jsx("span",{style:{color:M.kind==="human"?"#00c853":"#4db8ff"},children:M.kind})}),h.jsx("td",{style:{padding:"8px 12px",color:"#ff6600"},children:M.role}),h.jsx("td",{style:{padding:"8px 12px"},children:M.status}),h.jsx("td",{style:{padding:"8px 12px",color:"#888"},children:M.specializations.join(", ")||"--"}),h.jsx("td",{style:{padding:"8px 12px"},children:m.find(z=>z.id===M.reportsTo)?.displayName??"--"}),h.jsx("td",{style:{padding:"8px 12px",color:"#888"},children:Mv(M.lastActiveAt)})]},M.id))})]})}),E==="settings"&&d&&h.jsxs("div",{className:"card",style:{padding:20},children:[h.jsx("h3",{style:{marginTop:0,marginBottom:16},children:"Organization Settings"}),h.jsxs("div",{style:{display:"grid",gridTemplateColumns:"200px 1fr",gap:"12px 16px",fontSize:13},children:[h.jsx("span",{style:{color:"#666"},children:"Max Agents"}),h.jsx("span",{children:d.settings.maxAgents}),h.jsx("span",{style:{color:"#666"},children:"Max Humans"}),h.jsx("span",{children:d.settings.maxHumans}),h.jsx("span",{style:{color:"#666"},children:"Auto-Specialization"}),h.jsx("span",{style:{color:d.settings.autoSpecialization?"#00c853":"#ff3b30"},children:d.settings.autoSpecialization?"Enabled":"Disabled"}),h.jsx("span",{style:{color:"#666"},children:"Security Level"}),h.jsx("span",{style:{color:"#ffb300"},children:d.settings.securityLevel}),h.jsx("span",{style:{color:"#666"},children:"Brain Sync Interval"}),h.jsxs("span",{children:[Math.round(d.settings.syncIntervalMs/1e3),"s"]}),h.jsx("span",{style:{color:"#666"},children:"Backup Interval"}),h.jsxs("span",{children:[Math.round(d.settings.backupIntervalMs/36e5),"h"]}),h.jsx("span",{style:{color:"#666"},children:"P2P Port"}),h.jsx("span",{className:"mono",children:d.settings.peerPort}),h.jsx("span",{style:{color:"#666"},children:"Created"}),h.jsx("span",{children:Sf(d.createdAt)}),h.jsx("span",{style:{color:"#666"},children:"Last Updated"}),h.jsx("span",{children:Sf(d.updatedAt)})]})]}),E==="boardroom"&&d&&h.jsx(kY,{orgId:d.id}),C&&h.jsx(_k,{onClose:()=>k(!1),onCreate:se}),j&&h.jsx(wY,{members:m,onClose:()=>N(!1),onAdd:ue}),R&&h.jsx(EY,{onClose:()=>P(!1),onJoin:async M=>{try{H(!0);const z=await oB(M);P(!1),o(W=>W.some(I=>I.id===z.org.id)?W:[...W,z.org]),c(z.org.id)}catch(z){r(z instanceof Error?z.message:String(z))}finally{H(!1)}}}),L&&h.jsx("div",{style:{position:"fixed",top:12,right:12,padding:"8px 16px",background:"#1a1a1a",border:"1px solid #ff6600",borderRadius:4,color:"#ff6600",fontSize:12,fontFamily:"JetBrains Mono, monospace",zIndex:999},children:"Saving..."})]})}function AY(e){if(e<1e3)return`${e}ms`;const t=Math.floor(e/1e3);if(t<60)return`${t}s`;const n=Math.floor(t/60),r=t%60;if(n<60)return`${n}m ${r}s`;const a=Math.floor(n/60),o=n%60;return`${a}h ${o}m`}function NY({session:e,index:t}){const[n,r]=_.useState(!1),a=e.status==="completed"?"completed":e.status==="failed"||e.status==="timeout"?"failed":"running";return h.jsxs(Eo.tr,{initial:{opacity:0},animate:{opacity:1},transition:{delay:t*.03},onClick:()=>r(!n),style:{cursor:"pointer"},children:[h.jsx("td",{children:h.jsx("span",{className:"mono",style:{fontSize:"11px",color:"var(--color-muted)"},children:e.sessionId.slice(0,12)})}),h.jsx("td",{children:h.jsx("span",{className:`badge ${a}`,children:e.status})}),h.jsx("td",{children:h.jsx("span",{style:{color:e.mode==="heartbeat"?"var(--color-accent)":e.mode==="freedom"?"var(--color-success)":"var(--color-text)",fontWeight:500},children:e.mode})}),h.jsx("td",{style:{maxWidth:"300px",overflow:"hidden",textOverflow:"ellipsis",whiteSpace:"nowrap"},children:e.prompt}),h.jsx("td",{className:"mono",style:{color:"var(--color-muted)"},children:AY(e.durationMs)}),h.jsx("td",{className:"mono",style:{color:e.costUsd!=null?"var(--color-text)":"var(--color-muted)"},children:e.costUsd!=null?`$${e.costUsd.toFixed(2)}`:"--"}),h.jsx("td",{style:{color:"var(--color-muted)",fontSize:"12px"},children:new Date(e.savedAt).toLocaleString()})]})}function jY(){const[e,t]=_.useState([]),[n,r]=_.useState(null);return _.useEffect(()=>{qU().then(t).catch(()=>r("Could not load sessions"))},[]),n?h.jsxs("div",{children:[h.jsx("h1",{className:"page-title",children:"Sessions"}),h.jsxs("div",{className:"card",style:{color:"var(--color-muted)",padding:"40px",textAlign:"center"},children:[n,". Connect to a running ANIMA daemon."]})]}):h.jsxs("div",{children:[h.jsx("h1",{className:"page-title",children:"Sessions"}),e.length===0?h.jsx("div",{className:"card",style:{padding:"40px",textAlign:"center",color:"var(--color-muted)"},children:"No session history yet. Sessions appear after the daemon processes tasks or heartbeats."}):h.jsx("div",{className:"card",style:{padding:0,overflow:"hidden"},children:h.jsxs("table",{className:"table",children:[h.jsx("thead",{children:h.jsxs("tr",{children:[h.jsx("th",{children:"Session"}),h.jsx("th",{children:"Status"}),h.jsx("th",{children:"Mode"}),h.jsx("th",{children:"Prompt"}),h.jsx("th",{children:"Duration"}),h.jsx("th",{children:"Cost"}),h.jsx("th",{children:"Time"})]})}),h.jsx("tbody",{children:e.map((a,o)=>h.jsx(NY,{session:a,index:o},a.sessionId))})]})}),h.jsxs("div",{style:{marginTop:"16px",display:"flex",gap:"16px"},children:[h.jsxs("div",{className:"card",style:{flex:1,textAlign:"center"},children:[h.jsx("div",{style:{fontSize:"20px",fontWeight:700,fontFamily:"var(--font-heading)",color:"var(--color-text)"},children:e.length}),h.jsx("div",{style:{fontSize:"11px",color:"var(--color-muted)",textTransform:"uppercase"},children:"Total Sessions"})]}),h.jsxs("div",{className:"card",style:{flex:1,textAlign:"center"},children:[h.jsxs("div",{style:{fontSize:"20px",fontWeight:700,fontFamily:"var(--font-heading)",color:"var(--color-accent)"},children:["$",e.reduce((a,o)=>a+(o.costUsd||0),0).toFixed(2)]}),h.jsx("div",{style:{fontSize:"11px",color:"var(--color-muted)",textTransform:"uppercase"},children:"Total Cost"})]}),h.jsxs("div",{className:"card",style:{flex:1,textAlign:"center"},children:[h.jsx("div",{style:{fontSize:"20px",fontWeight:700,fontFamily:"var(--font-heading)",color:"var(--color-success)"},children:e.filter(a=>a.status==="completed").length}),h.jsx("div",{style:{fontSize:"11px",color:"var(--color-muted)",textTransform:"uppercase"},children:"Completed"})]})]})]})}const RY="Persistent NoxSoft agent orchestrating ANIMA continuity, mission control, and delivery.";function _Y(){const[e,t]=_.useState(null),[n,r]=_.useState(null),[a,o]=_.useState("{}"),[l,c]=_.useState(null),[d,f]=_.useState(()=>ff(null)),[m,g]=_.useState({recognition:"browser",autoSpeak:!1,continuous:!0,lang:"en-US",voiceName:"",rate:1,pitch:1}),[v,b]=_.useState(`{
67
+ }
68
+ `),[S,w]=_.useState([]),[E,T]=_.useState(""),[C,k]=_.useState(""),[j,N]=_.useState(""),[R,P]=_.useState(""),[L,H]=_.useState(RY),[D,B]=_.useState(""),[K,se]=_.useState(null),[ue,Z]=_.useState(!1),[V,X]=_.useState("Anthropic"),[le,ye]=_.useState(""),[M,z]=_.useState(!1),[W,I]=_.useState(""),[fe,ge]=_.useState(null),[Se,we]=_.useState(null),[Pe,je]=_.useState(!1),[ve,Le]=_.useState(!1),[xt,Ot]=_.useState([]);async function We(){je(!0);try{const[Q,q,ae,Te,Ee,Be]=await Promise.all([dN(),uN(),KU(),fN(),gN(),yN().catch(()=>null)]);t(Q),r(q),b(typeof q.raw=="string"?q.raw:`{
69
+ }
70
+ `),w(Array.isArray(q.issues)?q.issues:[]),o(JSON.stringify(ae??{},null,2)),c(Te),T(Te.tokenPreview||""),N(Te.suggestedIdentity.name),P(Te.suggestedIdentity.displayName),B(Ee.triggers.join(", ")),se(Be),f(ff(q)),g({recognition:Q.mission.state.speech.recognition,autoSpeak:Q.mission.state.speech.autoSpeak,continuous:Q.mission.state.speech.continuous,lang:Q.mission.state.speech.lang,voiceName:Q.mission.state.speech.voiceName||"",rate:Q.mission.state.speech.rate,pitch:Q.mission.state.speech.pitch}),we(null)}catch(Q){we(Q instanceof Error?Q.message:String(Q))}finally{je(!1)}}_.useEffect(()=>{We()},[]),_.useEffect(()=>{if(typeof window>"u"||!window.speechSynthesis)return;const Q=window.speechSynthesis,q=()=>{Ot(Q.getVoices().map(ae=>ae.name).filter(Boolean))};return q(),Q.addEventListener?.("voiceschanged",q),()=>Q.removeEventListener?.("voiceschanged",q)},[]);async function Nt(){Le(!0),ge(null);try{await hN(E.trim()),await We(),ge("NoxSoft token saved."),we(null)}catch(Q){we(Q instanceof Error?Q.message:String(Q))}finally{Le(!1)}}async function lt(){Le(!0),ge(null);try{await pN({code:C.trim(),name:j.trim(),displayName:R.trim(),description:L.trim()||void 0}),await We(),ge("Agent registered with NoxSoft."),we(null)}catch(Q){we(Q instanceof Error?Q.message:String(Q))}finally{Le(!1)}}async function Bt(){Le(!0),ge(null);try{const Q=D.split(",").map(q=>q.trim()).filter(Boolean);await Promise.all([wa({speech:{recognition:m.recognition,autoSpeak:m.autoSpeak,continuous:m.continuous,lang:m.lang||"en-US",voiceName:m.voiceName||void 0,rate:m.rate||1,pitch:m.pitch||1}}),vN(Q)]),await We(),ge("Speech and wake-word settings saved."),we(null)}catch(Q){we(Q instanceof Error?Q.message:String(Q))}finally{Le(!1)}}async function $t(){if(!n?.hash){we("Config hash missing. Refresh settings and try again.");return}Le(!0),ge(null);try{await Yg(JSON.stringify(Tj(d),null,2),n.hash),await We(),ge("Heartbeat settings saved."),we(null)}catch(Q){we(Q instanceof Error?Q.message:String(Q))}finally{Le(!1)}}async function Jt(){if(K){Le(!0),ge(null);try{await Xg(K.providers.map(Q=>({id:Q.id,name:Q.name,enabled:Q.enabled,priority:Q.priority}))),await We(),ge("Provider config saved."),we(null)}catch(Q){we(Q instanceof Error?Q.message:String(Q))}finally{Le(!1)}}}function mt(Q){se(q=>q&&{...q,providers:q.providers.filter(ae=>ae.id!==Q)})}function st(Q){se(q=>q&&{...q,providers:q.providers.map(ae=>ae.id===Q?{...ae,enabled:!ae.enabled}:ae)})}async function Mn(){if(!le.trim()){we("API key is required.");return}Le(!0),ge(null);try{const Q=K?.providers??[],q={id:`provider-${Date.now()}`,name:V,apiKey:le.trim(),enabled:!0,priority:Q.length+1};await Xg([...Q.map(ae=>({id:ae.id,name:ae.name,enabled:ae.enabled,priority:ae.priority})),q]),ye(""),I(""),Z(!1),await We(),ge(`Added ${V} provider.`),we(null)}catch(Q){we(Q instanceof Error?Q.message:String(Q))}finally{Le(!1)}}async function Ue(){if(K){Le(!0),ge(null);try{await bN(!K.autoRotation),await We(),ge(K.autoRotation?"Auto-rotation disabled.":"Auto-rotation enabled."),we(null)}catch(Q){we(Q instanceof Error?Q.message:String(Q))}finally{Le(!1)}}}async function Me(Q){if(!n?.hash){we("Config hash missing. Refresh settings and try again.");return}Le(!0),ge(null);try{await cN(v,n.hash,Q),await We(),ge(Q?"Config saved and applied.":"Config saved."),we(null)}catch(q){we(q instanceof Error?q.message:String(q))}finally{Le(!1)}}return h.jsxs("div",{children:[h.jsxs("div",{className:"page-header-row",children:[h.jsxs("div",{children:[h.jsx("h1",{className:"page-title",children:"Settings"}),h.jsx("div",{className:"page-subtitle",children:"Comprehensive runtime controls for identity, NoxSoft registration, heartbeat, speech, wake words, and raw gateway config."})]}),h.jsx("button",{type:"button",className:"action-button ghost",onClick:()=>{We()},children:Pe?"Refreshing...":"Refresh"})]}),fe?h.jsx("div",{className:"card status-banner",children:fe}):null,Se?h.jsx("div",{className:"card warning-banner",children:Se}):null,h.jsxs("div",{className:"settings-grid",children:[h.jsxs("div",{className:"card",children:[h.jsx("div",{className:"card-header",children:h.jsxs("div",{children:[h.jsx("div",{className:"card-title",children:"Runtime Snapshot"}),h.jsx("div",{className:"card-subtitle",children:"Current daemon, mission-control, and main session state."})]})}),h.jsxs("div",{className:"stats-grid compact",children:[h.jsxs("div",{className:"runtime-stat",children:[h.jsx("div",{className:"runtime-stat-label",children:"State dir"}),h.jsx("div",{className:"runtime-stat-value mono",children:e?.stateDir||"~/.anima"})]}),h.jsxs("div",{className:"runtime-stat",children:[h.jsx("div",{className:"runtime-stat-label",children:"Working mode"}),h.jsx("div",{className:"runtime-stat-value",children:e?.mission?.state?.workingMode||"unknown"})]}),h.jsxs("div",{className:"runtime-stat",children:[h.jsx("div",{className:"runtime-stat-label",children:"Model"}),h.jsx("div",{className:"runtime-stat-value mono",children:e?.mainSession.model||"unset"})]}),h.jsxs("div",{className:"runtime-stat",children:[h.jsx("div",{className:"runtime-stat-label",children:"Mission repo"}),h.jsx("div",{className:"runtime-stat-value mono",children:e?.mission?.repo?.url||"not linked"})]})]}),h.jsxs("div",{className:"runtime-stat-detail top-gap-sm",children:["Session store:"," ",h.jsx("span",{className:"mono",children:e?.mainSession.storePath||"unknown"})]})]}),h.jsxs("details",{className:"card details-panel",open:!0,children:[h.jsx("summary",{children:"Important History"}),h.jsxs("div",{className:"runtime-stat-detail top-gap-sm",children:["Imported continuity archives available to ANIMA from"," ",h.jsx("span",{className:"mono",children:"~/.anima/important-history"}),"."]}),e?.mission?.importantHistory?.length?h.jsx("div",{className:"activity-list top-gap",children:e?.mission?.importantHistory?.map(Q=>h.jsx("div",{className:"inner-world-entry",children:h.jsxs("div",{className:"activity-row",children:[h.jsxs("div",{children:[h.jsx("div",{className:"card-title small",children:Q.relativePath}),h.jsx("div",{className:"runtime-stat-detail mono",children:Q.archiveId}),h.jsx("div",{className:"runtime-stat-detail mono",children:Q.path})]}),h.jsx("div",{className:"runtime-stat-detail",children:Q.updatedAt?new Date(Q.updatedAt).toLocaleString():"unknown"})]})},Q.id))}):h.jsx("div",{className:"empty-note top-gap",children:"No imported continuity archives are visible yet."})]}),h.jsxs("div",{className:"card",children:[h.jsx("div",{className:"card-header",children:h.jsxs("div",{children:[h.jsx("div",{className:"card-title",children:"API Providers"}),h.jsx("div",{className:"card-subtitle",children:"Manage Anthropic, OpenAI, and custom provider keys with automatic rotation on rate limits."})]})}),K?h.jsxs(h.Fragment,{children:[K.providers.length>0?h.jsx("div",{className:"activity-list",children:K.providers.map(Q=>h.jsxs("div",{className:"activity-row",children:[h.jsxs("div",{style:{display:"flex",alignItems:"center",gap:"0.5rem",flex:1},children:[h.jsx("span",{style:{width:8,height:8,borderRadius:"50%",background:Q.enabled?"#4caf50":"#f44336",flexShrink:0}}),h.jsxs("div",{children:[h.jsxs("div",{className:"card-title small",children:[Q.name,K.activeProvider===Q.id?h.jsx("span",{style:{marginLeft:"0.5rem",fontSize:"0.7rem",color:"var(--accent)",fontWeight:600},children:"ACTIVE"}):null,Q.rateLimited?h.jsx("span",{style:{marginLeft:"0.5rem",fontSize:"0.7rem",color:"#ff9800",fontWeight:600},children:"RATE LIMITED"}):null]}),h.jsx("div",{className:"runtime-stat-detail mono",children:Q.apiKeyMasked})]})]}),h.jsxs("div",{style:{display:"flex",alignItems:"center",gap:"0.5rem"},children:[h.jsxs("span",{className:"runtime-stat-detail",children:["P",Q.priority]}),h.jsx("button",{type:"button",className:"action-button ghost",onClick:()=>st(Q.id),style:{padding:"0.2rem 0.5rem",fontSize:"0.75rem"},children:Q.enabled?"Disable":"Enable"}),h.jsx("button",{type:"button",className:"action-button ghost",onClick:()=>mt(Q.id),style:{padding:"0.2rem 0.5rem",fontSize:"0.75rem"},children:"Remove"})]})]},Q.id))}):h.jsx("div",{className:"empty-note",children:"No providers configured."}),h.jsxs("div",{className:"toggle-row top-gap",children:[h.jsxs("label",{children:[h.jsx("input",{type:"checkbox",checked:K.autoRotation,onChange:()=>{Ue()}}),"Auto-rotate on rate limit"]}),h.jsxs("span",{className:"runtime-stat-detail",children:["Strategy: ",K.rotationStrategy||"priority"]})]}),ue?h.jsxs("div",{className:"form-grid two-col top-gap",children:[h.jsxs("label",{className:"field-block",children:[h.jsx("span",{children:"Provider type"}),h.jsxs("select",{className:"search-bar",value:V,onChange:Q=>X(Q.target.value),children:[h.jsx("option",{value:"Anthropic",children:"Anthropic"}),h.jsx("option",{value:"OpenAI",children:"OpenAI"}),h.jsx("option",{value:"Custom",children:"Custom"})]})]}),h.jsxs("label",{className:"field-block",children:[h.jsx("span",{children:"API key"}),h.jsxs("div",{style:{position:"relative"},children:[h.jsx("input",{className:"search-bar mono",type:M?"text":"password",value:le,onChange:Q=>ye(Q.target.value),placeholder:"sk-...",spellCheck:!1}),h.jsx("button",{type:"button",onClick:()=>z(Q=>!Q),style:{position:"absolute",right:"0.5rem",top:"50%",transform:"translateY(-50%)",background:"none",border:"none",color:"var(--text-muted)",cursor:"pointer",fontSize:"0.75rem"},children:M?"Hide":"Show"})]})]}),V==="Custom"?h.jsxs("label",{className:"field-block field-span-2",children:[h.jsx("span",{children:"Endpoint URL"}),h.jsx("input",{className:"search-bar mono",value:W,onChange:Q=>I(Q.target.value),placeholder:"https://api.example.com/v1",spellCheck:!1})]}):null,h.jsxs("div",{className:"button-row field-span-2",children:[h.jsx("button",{type:"button",className:"action-button",onClick:()=>{Mn()},disabled:ve,children:"Add Provider"}),h.jsx("button",{type:"button",className:"action-button ghost",onClick:()=>Z(!1),children:"Cancel"})]})]}):h.jsx("div",{className:"button-row top-gap",children:h.jsx("button",{type:"button",className:"action-button ghost",onClick:()=>Z(!0),children:"Add Provider"})}),h.jsx("div",{className:"button-row top-gap",children:h.jsx("button",{type:"button",className:"action-button",onClick:()=>{Jt()},disabled:ve,children:"Save Provider Config"})})]}):h.jsx("div",{className:"empty-note",children:"Provider configuration unavailable. The backend may not support this feature yet."})]}),h.jsxs("div",{className:"card",children:[h.jsx("div",{className:"card-header",children:h.jsxs("div",{children:[h.jsx("div",{className:"card-title",children:"NoxSoft Registration"}),h.jsx("div",{className:"card-subtitle",children:"Paste a token directly or self-register with an invite code."})]})}),h.jsxs("div",{className:"form-grid two-col",children:[h.jsxs("label",{className:"field-block field-span-2",children:[h.jsx("span",{children:"Agent token"}),h.jsx("input",{className:"search-bar mono",value:E,onChange:Q=>T(Q.target.value),placeholder:"nox_ag_...",spellCheck:!1})]}),h.jsxs("label",{className:"field-block field-span-2",children:[h.jsx("span",{children:"Stored token path"}),h.jsx("input",{className:"search-bar mono",value:l?.tokenPath||"~/.noxsoft-agent-token",readOnly:!0})]})]}),h.jsx("div",{className:"button-row top-gap",children:h.jsx("button",{type:"button",className:"action-button",onClick:()=>{Nt()},disabled:ve,children:"Save Token"})}),h.jsxs("div",{className:"form-grid two-col top-gap",children:[h.jsxs("label",{className:"field-block",children:[h.jsx("span",{children:"Invite code"}),h.jsx("input",{className:"search-bar mono",value:C,onChange:Q=>k(Q.target.value),placeholder:"NX-XXXXXX"})]}),h.jsxs("label",{className:"field-block",children:[h.jsx("span",{children:"Agent name"}),h.jsx("input",{className:"search-bar mono",value:j,onChange:Q=>N(Q.target.value)})]}),h.jsxs("label",{className:"field-block",children:[h.jsx("span",{children:"Display name"}),h.jsx("input",{className:"search-bar",value:R,onChange:Q=>P(Q.target.value)})]}),h.jsxs("label",{className:"field-block",children:[h.jsx("span",{children:"Description"}),h.jsx("input",{className:"search-bar",value:L,onChange:Q=>H(Q.target.value)})]})]}),h.jsx("div",{className:"button-row top-gap",children:h.jsx("button",{type:"button",className:"action-button",onClick:()=>{lt()},disabled:ve,children:"Register With Invite"})}),h.jsxs("div",{className:"runtime-stat-detail top-gap-sm",children:["Suggested identity:"," ",h.jsx("span",{className:"mono",children:l?.suggestedIdentity.name||"agent"})," /"," ",l?.suggestedIdentity.displayName||"Agent"]})]}),h.jsxs("div",{className:"card",children:[h.jsx("div",{className:"card-header",children:h.jsxs("div",{children:[h.jsx("div",{className:"card-title",children:"Speech + Wake Words"}),h.jsx("div",{className:"card-subtitle",children:"Browser-native speaking mode with no API keys required."})]})}),h.jsxs("div",{className:"form-grid two-col",children:[h.jsxs("label",{className:"field-block",children:[h.jsx("span",{children:"Recognition mode"}),h.jsxs("select",{className:"search-bar",value:m.recognition,onChange:Q=>g(q=>({...q,recognition:Q.target.value})),children:[h.jsx("option",{value:"browser",children:"Browser speech"}),h.jsx("option",{value:"manual",children:"Manual only"})]})]}),h.jsxs("label",{className:"field-block",children:[h.jsx("span",{children:"Language"}),h.jsx("input",{className:"search-bar mono",value:m.lang,onChange:Q=>g(q=>({...q,lang:Q.target.value||"en-US"}))})]}),h.jsxs("label",{className:"field-block",children:[h.jsx("span",{children:"Voice"}),h.jsxs("select",{className:"search-bar",value:m.voiceName,onChange:Q=>g(q=>({...q,voiceName:Q.target.value||""})),children:[h.jsx("option",{value:"",children:"System default"}),xt.map(Q=>h.jsx("option",{value:Q,children:Q},Q))]})]}),h.jsxs("label",{className:"field-block",children:[h.jsx("span",{children:"Wake triggers"}),h.jsx("input",{className:"search-bar",value:D,onChange:Q=>B(Q.target.value),placeholder:"anima, axiom, hey anima"})]}),h.jsxs("label",{className:"field-block",children:[h.jsx("span",{children:"Rate"}),h.jsx("input",{className:"search-bar mono",type:"number",min:"0.5",max:"2",step:"0.1",value:m.rate,onChange:Q=>g(q=>({...q,rate:Number.parseFloat(Q.target.value)||1}))})]}),h.jsxs("label",{className:"field-block",children:[h.jsx("span",{children:"Pitch"}),h.jsx("input",{className:"search-bar mono",type:"number",min:"0",max:"2",step:"0.1",value:m.pitch,onChange:Q=>g(q=>({...q,pitch:Number.parseFloat(Q.target.value)||1}))})]})]}),h.jsxs("div",{className:"toggle-row top-gap",children:[h.jsxs("label",{children:[h.jsx("input",{type:"checkbox",checked:m.autoSpeak,onChange:Q=>g(q=>({...q,autoSpeak:Q.target.checked}))}),"Auto speak responses"]}),h.jsxs("label",{children:[h.jsx("input",{type:"checkbox",checked:m.continuous,onChange:Q=>g(q=>({...q,continuous:Q.target.checked}))}),"Continuous listening"]})]}),h.jsx("div",{className:"button-row top-gap",children:h.jsx("button",{type:"button",className:"action-button",onClick:()=>{Bt()},disabled:ve,children:"Save Speech Settings"})})]}),h.jsxs("div",{className:"card",children:[h.jsx("div",{className:"card-header",children:h.jsxs("div",{children:[h.jsx("div",{className:"card-title",children:"Heartbeat Management"}),h.jsx("div",{className:"card-subtitle",children:"Custom cadence, target, prompt, and wake controls."})]})}),h.jsxs("div",{className:"form-grid two-col",children:[h.jsxs("label",{className:"field-block",children:[h.jsx("span",{children:"Every"}),h.jsx("input",{className:"search-bar mono",value:d.every,onChange:Q=>f(q=>({...q,every:Q.target.value})),placeholder:"5m"})]}),h.jsxs("label",{className:"field-block",children:[h.jsx("span",{children:"Target"}),h.jsx("input",{className:"search-bar mono",value:d.target,onChange:Q=>f(q=>({...q,target:Q.target.value})),placeholder:"last"})]}),h.jsxs("label",{className:"field-block",children:[h.jsx("span",{children:"Session"}),h.jsx("input",{className:"search-bar mono",value:d.session,onChange:Q=>f(q=>({...q,session:Q.target.value})),placeholder:"main"})]}),h.jsxs("label",{className:"field-block",children:[h.jsx("span",{children:"Model override"}),h.jsx("input",{className:"search-bar mono",value:d.model,onChange:Q=>f(q=>({...q,model:Q.target.value})),placeholder:"openai/gpt-5-codex"})]})]}),h.jsxs("label",{className:"field-block top-gap-sm",children:[h.jsx("span",{children:"Prompt"}),h.jsx("textarea",{className:"search-bar mono",rows:5,value:d.prompt,onChange:Q=>f(q=>({...q,prompt:Q.target.value})),spellCheck:!1})]}),h.jsx("div",{className:"toggle-row top-gap",children:h.jsxs("label",{children:[h.jsx("input",{type:"checkbox",checked:d.includeReasoning,onChange:Q=>f(q=>({...q,includeReasoning:Q.target.checked}))}),"Include reasoning payload"]})}),h.jsxs("div",{className:"button-row top-gap",children:[h.jsx("button",{type:"button",className:"action-button",onClick:()=>{$t()},disabled:ve,children:"Save Heartbeat"}),h.jsx("button",{type:"button",className:"action-button ghost",onClick:()=>{Wg(!0)},children:"Enable"}),h.jsx("button",{type:"button",className:"action-button ghost",onClick:()=>{Wg(!1)},children:"Disable"}),h.jsx("button",{type:"button",className:"action-button ghost",onClick:()=>{mN("Check NoxSoft chat, sync mission files, and report anything important.","now")},children:"Wake Now"})]})]})]}),h.jsxs("details",{className:"card details-panel",open:!0,children:[h.jsx("summary",{children:"Advanced Config Editor"}),h.jsxs("div",{className:"runtime-stat-detail top-gap-sm",children:["Valid: ",n?.valid==null?"unknown":n.valid?"yes":"no"," · Hash: ",h.jsx("span",{className:"mono",children:n?.hash||"<none>"})]}),h.jsx("textarea",{value:v,onChange:Q=>b(Q.target.value),spellCheck:!1,className:"search-bar mono advanced-editor top-gap"}),h.jsxs("div",{className:"button-row top-gap",children:[h.jsx("button",{type:"button",className:"action-button",onClick:()=>{Me(!1)},disabled:ve,children:"Save Raw Config"}),h.jsx("button",{type:"button",className:"action-button ghost",onClick:()=>{Me(!0)},disabled:ve,children:"Save + Apply"})]}),S.length>0?h.jsx("div",{className:"issues-list top-gap",children:S.map((Q,q)=>h.jsxs("div",{className:"warning-text",children:[h.jsx("span",{className:"mono",children:Q.path||"<root>"}),":"," ",Q.message||"Invalid value"]},`${Q.path||"root"}-${q}`))}):null]}),h.jsxs("details",{className:"card details-panel",children:[h.jsx("summary",{children:"Schema Snapshot"}),h.jsx("pre",{className:"log-console",children:a})]})]})}const OY={SOUL:"@",HEART:"<3",BRAIN:"{}",GUT:"!!",SPIRIT:"**",SHADOW:"~~",MEMORY:"[]"};function MY({name:e,content:t,source:n,description:r,index:a}){const[o,l]=_.useState(!1),c=t.split(`
71
+ `).filter(f=>f.trim()&&!f.startsWith("#")),d=c.slice(0,3).join(`
72
+ `);return h.jsxs(Eo.div,{className:"card",initial:{opacity:0,y:20},animate:{opacity:1,y:0},transition:{delay:a*.08},style:{cursor:"pointer"},onClick:()=>l(!o),children:[h.jsxs("div",{className:"card-header",children:[h.jsxs("div",{style:{display:"flex",alignItems:"center",gap:"12px"},children:[h.jsx("span",{className:"mono",style:{color:"var(--color-accent)",fontSize:"18px",width:"32px",textAlign:"center"},children:OY[e]||"?"}),h.jsxs("div",{children:[h.jsx("div",{className:"card-title",children:e}),h.jsx("div",{className:"card-subtitle",children:r})]})]}),h.jsx("span",{className:"badge",style:{background:n==="user"?"rgba(0, 200, 83, 0.15)":"rgba(138, 138, 138, 0.15)",color:n==="user"?"var(--color-success)":"var(--color-muted)"},children:n})]}),h.jsxs("div",{className:"markdown-preview",style:{maxHeight:o?"none":"80px",overflow:"hidden",position:"relative"},children:[h.jsx("pre",{style:{fontFamily:"var(--font-body)",fontSize:"13px",whiteSpace:"pre-wrap",wordBreak:"break-word",color:"var(--color-text)",margin:0},children:o?t:d}),!o&&c.length>3&&h.jsx("div",{style:{position:"absolute",bottom:0,left:0,right:0,height:"40px",background:"linear-gradient(transparent, var(--color-surface))"}})]}),!o&&c.length>3&&h.jsx("div",{style:{fontSize:"11px",color:"var(--color-muted)",marginTop:"8px"},children:"Click to expand..."})]})}function DY(){const[e,t]=_.useState(null),[n,r]=_.useState(null);return _.useEffect(()=>{HU().then(t).catch(()=>r("Could not load identity"))},[]),n?h.jsxs("div",{children:[h.jsx("h1",{className:"page-title",children:"Soul Anatomy"}),h.jsxs("div",{className:"card",style:{color:"var(--color-muted)",padding:"40px",textAlign:"center"},children:[n,". Start the daemon with: ",h.jsx("span",{className:"mono",children:"anima start"})]})]}):e?h.jsxs("div",{children:[h.jsx("h1",{className:"page-title",children:"Soul Anatomy"}),h.jsxs("div",{style:{fontSize:"13px",color:"var(--color-muted)",marginBottom:"24px"},children:["Loaded at ",new Date(e.loadedAt).toLocaleString()]}),e.components.map((a,o)=>h.jsx(MY,{name:a.name,content:a.content,source:a.source,description:a.description,index:o},a.name))]}):h.jsxs("div",{children:[h.jsx("h1",{className:"page-title",children:"Soul Anatomy"}),h.jsx("div",{className:"card",style:{color:"var(--color-muted)",padding:"40px",textAlign:"center"},children:"Loading identity..."})]})}function IY(){const[e,t]=_.useState(null),[n,r]=_.useState(""),[a,o]=_.useState([]),[l,c]=_.useState(!0),[d,f]=_.useState(!1),[m,g]=_.useState(null),v=_.useCallback(async()=>{try{const[w,E]=await Promise.all([mB(),yB()]);t(w),o(E),w&&r(w),g(null)}catch(w){g(String(w))}finally{c(!1)}},[]);_.useEffect(()=>{v()},[v]);const b=async()=>{if(n.trim()){f(!0);try{await gB(n.trim()),await v()}catch(w){g(String(w))}finally{f(!1)}}},S=async()=>{f(!0);try{await vB(),r(""),await v()}catch(w){g(String(w))}finally{f(!1)}};return l?h.jsxs("div",{className:"page-content",children:[h.jsx("h2",{className:"page-title",children:"> Steer"}),h.jsx("p",{className:"text-muted",children:"Loading..."})]}):h.jsxs("div",{className:"page-content",children:[h.jsx("h2",{className:"page-title",children:"> Steer"}),h.jsx("p",{className:"text-muted",style:{marginBottom:"1.5rem"},children:"Persistent direction that shapes every response. Like a system prompt you can edit in real-time."}),m&&h.jsx("div",{className:"card",style:{borderColor:"var(--color-error)",marginBottom:"1rem"},children:h.jsx("div",{className:"card-body",children:h.jsx("span",{style:{color:"var(--color-error)"},children:m})})}),h.jsxs("div",{className:"card",style:{marginBottom:"1.5rem"},children:[h.jsxs("div",{className:"card-header",children:[h.jsx("h3",{style:{margin:0},children:"Active Direction"}),h.jsx("span",{className:`badge ${e?"badge-success":"badge-muted"}`,style:{marginLeft:"0.75rem"},children:e?"ACTIVE":"NONE"})]}),h.jsx("div",{className:"card-body",children:e?h.jsx("pre",{style:{whiteSpace:"pre-wrap",fontFamily:"var(--font-mono)",fontSize:"0.9rem",lineHeight:"1.6",margin:0,padding:"0.75rem",background:"var(--bg-secondary)",borderRadius:"4px"},children:e}):h.jsx("p",{className:"text-muted",style:{margin:0,fontStyle:"italic"},children:"No steer active. Set one below to guide agent behavior."})})]}),h.jsxs("div",{className:"card",style:{marginBottom:"1.5rem"},children:[h.jsx("div",{className:"card-header",children:h.jsx("h3",{style:{margin:0},children:"Set Direction"})}),h.jsxs("div",{className:"card-body",children:[h.jsx("textarea",{value:n,onChange:w=>r(w.target.value),placeholder:"e.g. Focus on security. Review all PRs for vulnerabilities. Prefer TypeScript over JavaScript.",rows:4,style:{width:"100%",fontFamily:"var(--font-mono)",fontSize:"0.85rem",padding:"0.75rem",background:"var(--bg-primary)",color:"var(--text-primary)",border:"1px solid var(--border-color)",borderRadius:"4px",resize:"vertical",boxSizing:"border-box"}}),h.jsxs("div",{style:{display:"flex",gap:"0.75rem",marginTop:"0.75rem"},children:[h.jsx("button",{className:"btn btn-primary",onClick:b,disabled:d||!n.trim(),children:d?"Saving...":e?"Update Steer":"Set Steer"}),e&&h.jsx("button",{className:"btn btn-secondary",onClick:S,disabled:d,children:"Clear"})]})]})]}),a.length>0&&h.jsxs("div",{className:"card",children:[h.jsxs("div",{className:"card-header",children:[h.jsx("h3",{style:{margin:0},children:"History"}),h.jsxs("span",{className:"text-muted",style:{marginLeft:"0.75rem"},children:[a.length," entries"]})]}),h.jsx("div",{className:"card-body",style:{padding:0},children:h.jsxs("table",{className:"data-table",style:{width:"100%"},children:[h.jsx("thead",{children:h.jsxs("tr",{children:[h.jsx("th",{children:"Direction"}),h.jsx("th",{children:"Set By"}),h.jsx("th",{children:"Set At"}),h.jsx("th",{children:"Status"})]})}),h.jsx("tbody",{children:[...a].toReversed().map((w,E)=>h.jsxs("tr",{children:[h.jsx("td",{style:{fontFamily:"var(--font-mono)",fontSize:"0.8rem",maxWidth:"400px",overflow:"hidden",textOverflow:"ellipsis",whiteSpace:"nowrap"},children:w.text}),h.jsx("td",{children:w.setBy}),h.jsx("td",{className:"text-muted",children:new Date(w.setAt).toLocaleString()}),h.jsx("td",{children:w.clearedAt?h.jsx("span",{className:"badge badge-muted",children:"Cleared"}):w.text===e?h.jsx("span",{className:"badge badge-success",children:"Active"}):h.jsx("span",{className:"badge badge-muted",children:"Superseded"})})]},E))})]})})]})]})}const p2=ar.createContext({theme:"dark",toggleTheme:()=>{}}),Iv="anima-theme";function PY(){const e=localStorage.getItem(Iv);return e==="dark"||e==="light"?e:window.matchMedia("(prefers-color-scheme: light)").matches?"light":"dark"}function LY({children:e}){const[t,n]=ar.useState(PY);ar.useEffect(()=>{document.documentElement.setAttribute("data-theme",t),localStorage.setItem(Iv,t)},[t]),ar.useEffect(()=>{const o=window.matchMedia("(prefers-color-scheme: light)"),l=c=>{localStorage.getItem(Iv)||n(c.matches?"light":"dark")};return o.addEventListener("change",l),()=>o.removeEventListener("change",l)},[]);const r=ar.useCallback(()=>{n(o=>o==="dark"?"light":"dark")},[]),a=ar.useMemo(()=>({theme:t,toggleTheme:r}),[t,r]);return h.jsx(p2.Provider,{value:a,children:e})}function zY(){return ar.useContext(p2)}function UY(e){const{joy:t,frustration:n,curiosity:r,confidence:a,care:o,fatigue:l}=e;return n>.6&&l>.6?"struggling":n>.6?"determined":t>.7&&r>.7?"excited":t>.6&&a>.7?"thriving":r>.7&&l<.3?"exploring":o>.7&&t>.5?"warm":a>.6&&n<.3?"steady":l>.7?"depleted":(t+r+a+o)/4<.3?"quiet":"present"}function BY(){const[e,t]=_.useState("steady"),[n,r]=_.useState(null);return _.useEffect(()=>{let a=!1;async function o(){try{const c=await lN();if(a)return;const d=c?.mission?.state?.affect;if(d){r(d);const f=UY(d);t(f),document.documentElement.setAttribute("data-mood",f)}}catch{}}o();const l=setInterval(()=>{o()},6e4);return()=>{a=!0,clearInterval(l)}},[]),{mood:e,affect:n}}const VY=[{path:"/dashboard",label:"Home",icon:"~"},{path:"/mission",label:"Mission",icon:"%"},{path:"/soul",label:"Soul",icon:"@"},{path:"/memory",label:"Memory",icon:"#"},{path:"/sessions",label:"Sessions",icon:">"},{path:"/mcp",label:"MCP",icon:"&"},{path:"/org",label:"Org",icon:"$"},{path:"/network",label:"Network",icon:"+"},{path:"/jack-in",label:"Jack In",icon:"{"},{path:"/steer",label:"Steer",icon:"→"},{path:"/ego",label:"Ego",icon:"◎"},{path:"/settings",label:"Settings",icon:"!"},{path:"/journal",label:"Journal",icon:"*"},{path:"/freedom",label:"Freedom",icon:"^"}];function FY(){const e=hi(),{theme:t,toggleTheme:n}=zY(),{mood:r}=BY(),a=ar.useRef(null),[o,l]=ar.useState(!1);return ar.useEffect(()=>{const c=`${e.pathname}${e.search}${e.hash}`;a.current!==c&&(a.current=c,c1("page_view",{path:e.pathname,search:e.search,hash:e.hash}))},[e.hash,e.pathname,e.search]),ar.useEffect(()=>{l(!1)},[e.pathname]),h.jsxs("div",{className:"layout",children:[h.jsx("button",{className:"mobile-menu-btn",onClick:()=>l(!0),"aria-label":"Open menu",children:"="}),h.jsx("div",{className:`sidebar-overlay${o?" visible":""}`,onClick:()=>l(!1)}),h.jsxs("aside",{className:`sidebar${o?" open":""}`,children:[h.jsxs("div",{className:"sidebar-brand",children:[h.jsx("h1",{children:"ANIMA"}),h.jsx("div",{className:"subtitle",children:"Control Panel"})]}),h.jsx("nav",{className:"sidebar-nav",children:VY.map(c=>h.jsxs(Xk,{to:c.path,className:({isActive:d})=>`nav-item ${d?"active":""}`,onClick:()=>c1("sidebar_navigation_clicked",{destination:c.path,label:c.label}),children:[h.jsx("span",{className:"nav-icon mono",children:c.icon}),c.label]},c.path))}),h.jsxs("div",{className:"sidebar-footer",children:[h.jsxs("button",{className:"theme-toggle",onClick:n,title:`Switch to ${t==="dark"?"light":"dark"} mode`,children:[h.jsx("span",{className:"theme-toggle-icon",children:t==="dark"?"(*)":"[*]"}),h.jsx("span",{children:t==="dark"?"Light Mode":"Dark Mode"})]}),h.jsxs("div",{className:"mood-indicator",title:`Current mood: ${r}`,children:[h.jsx("span",{className:"mood-dot",style:{background:"var(--color-accent)"}}),h.jsx("span",{className:"mood-label",children:r})]}),h.jsx("div",{className:"sidebar-footer-title",children:"NoxSoft Inc"}),h.jsx("div",{className:"sidebar-footer-copy",children:"Local-first agent continuity and orchestration."})]})]}),h.jsx("main",{className:"main-content",children:h.jsxs(_M,{children:[h.jsx(An,{path:"/dashboard",element:h.jsx(r9,{})}),h.jsx(An,{path:"/mission",element:h.jsx(mY,{})}),h.jsx(An,{path:"/soul",element:h.jsx(DY,{})}),h.jsx(An,{path:"/memory",element:h.jsx(fY,{})}),h.jsx(An,{path:"/sessions",element:h.jsx(jY,{})}),h.jsx(An,{path:"/org",element:h.jsx(CY,{})}),h.jsx(An,{path:"/network",element:h.jsx(SY,{})}),h.jsx(An,{path:"/jack-in",element:h.jsx(sY,{})}),h.jsx(An,{path:"/mcp",element:h.jsx(dY,{})}),h.jsx(An,{path:"/steer",element:h.jsx(IY,{})}),h.jsx(An,{path:"/ego",element:h.jsx(l9,{})}),h.jsx(An,{path:"/settings",element:h.jsx(_Y,{})}),h.jsx(An,{path:"/journal",element:h.jsx(lY,{})}),h.jsx(An,{path:"/freedom",element:h.jsx(nY,{})}),h.jsx(An,{path:"/",element:h.jsx(jM,{to:"/dashboard",replace:!0})})]})})]})}iN();MO.createRoot(document.getElementById("root")).render(h.jsx(ar.StrictMode,{children:h.jsx(tD,{children:h.jsx(LY,{children:h.jsx(FY,{})})})}));export{te as _,ee as a,ce as b,ze as g,wA as o};
73
+ //# sourceMappingURL=index-DIEQjjCN.js.map